From: Andrea Cuccaro Date: Mon, 20 Jan 2020 17:10:47 +0000 (+0100) Subject: Built motion from commit (unavailable).|2.4.4 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22my-avatar.png/%22?a=commitdiff_plain;h=753592ccd8875b62def7e00866a5c72faca2b9b7;p=motion2.git Built motion from commit (unavailable).|2.4.4 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index ce1fb22..53701e8 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1 +1 @@ -define({ "name": "xCALLY Motion API", "version": "2.4.4", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

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

\n

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

\n

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

\n

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

\n
GET /api/users\n
\n

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

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

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

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

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

\n

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

\n

Security and Authentication

\n

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

\n

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

\n

Basic authentication

\n

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

\n

Example:

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

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

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

\n

Example:

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

API Key

\n

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

\n

Example:

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

Request Format

\n

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

\n

Response Format

\n

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

\n

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

\n

200 range

\n

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

\n

400 range

\n

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

\n

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

\n

500 range

\n

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

\n

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

\n

Data Types

\n

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

\n

ID integers

\n

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

\n

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

\n

Time stamps

\n

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

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

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

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

\n

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

\n

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

\n

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

\n
GET /api/users\n
\n

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

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

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

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

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

\n

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

\n

Security and Authentication

\n

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

\n

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

\n

Basic authentication

\n

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

\n

Example:

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

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

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

\n

Example:

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

API Key

\n

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

\n

Example:

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

Request Format

\n

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

\n

Response Format

\n

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

\n

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

\n

200 range

\n

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

\n

400 range

\n

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

\n

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

\n

500 range

\n

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

\n

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

\n

Data Types

\n

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

\n

ID integers

\n

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

\n

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

\n

Time stamps

\n

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

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-01-20T17:01:58.362Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); diff --git a/apidoc/api_project.json b/apidoc/api_project.json index ca3801f..3527ca6 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1 +1 @@ -{ "name": "xCALLY Motion API", "version": "2.4.4", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

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

\n

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

\n

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

\n

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

\n
GET /api/users\n
\n

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

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

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

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

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

\n

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

\n

Security and Authentication

\n

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

\n

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

\n

Basic authentication

\n

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

\n

Example:

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

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

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

\n

Example:

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

API Key

\n

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

\n

Example:

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

Request Format

\n

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

\n

Response Format

\n

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

\n

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

\n

200 range

\n

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

\n

400 range

\n

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

\n

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

\n

500 range

\n

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

\n

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

\n

Data Types

\n

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

\n

ID integers

\n

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

\n

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

\n

Time stamps

\n

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

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

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

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

\n

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

\n

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

\n

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

\n
GET /api/users\n
\n

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

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

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

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

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

\n

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

\n

Security and Authentication

\n

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

\n

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

\n

Basic authentication

\n

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

\n

Example:

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

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

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

\n

Example:

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

API Key

\n

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

\n

Example:

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

Request Format

\n

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

\n

Response Format

\n

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

\n

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

\n

200 range

\n

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

\n

400 range

\n

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

\n

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

\n

500 range

\n

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

\n

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

\n

Data Types

\n

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

\n

ID integers

\n

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

\n

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

\n

Time stamps

\n

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

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-01-20T17:01:58.362Z", "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 24da5aa..891bc61 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 _0x55ca=['sequelize','exports','action','STRING','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','TEXT'];(function(_0x43e209,_0x277b66){var _0x479b4f=function(_0x3dc2a5){while(--_0x3dc2a5){_0x43e209['push'](_0x43e209['shift']());}};_0x479b4f(++_0x277b66);}(_0x55ca,0x126));var _0xa55c=function(_0xfd0d38,_0x3e89fe){_0xfd0d38=_0xfd0d38-0x0;var _0x38eea8=_0x55ca[_0xfd0d38];return _0x38eea8;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5edc58){return this['getDataValue'](_0xa55c('0x2'));}},'action':{'type':Sequelize[_0xa55c('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xa55c('0x4'),_0xa55c('0x5'),_0xa55c('0x6'),_0xa55c('0x7'),_0xa55c('0x8'),_0xa55c('0x9'),_0xa55c('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xa55c('0xb')},'data1':{'type':Sequelize[_0xa55c('0x3')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0xa55c('0x3')](0x1000),'comment':_0xa55c('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize[_0xa55c('0x3')](0x1000)},'data5':{'type':Sequelize[_0xa55c('0x3')](0x1000)},'data6':{'type':Sequelize[_0xa55c('0x3')]},'data7':{'type':Sequelize[_0xa55c('0xd')]}}; \ No newline at end of file +var _0x008c=['TEXT','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','motionbar[NULL,NULL,WinAppArguments]'];(function(_0x3387d3,_0x315428){var _0x305a47=function(_0x357527){while(--_0x357527){_0x3387d3['push'](_0x3387d3['shift']());}};_0x305a47(++_0x315428);}(_0x008c,0x188));var _0xc008=function(_0x2c3aed,_0xa4011f){_0x2c3aed=_0x2c3aed-0x0;var _0x473dc4=_0x008c[_0x2c3aed];return _0x473dc4;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'name':{'type':Sequelize[_0xc008('0x2')],'get':function(_0xae17af){return this[_0xc008('0x3')]('action');}},'action':{'type':Sequelize[_0xc008('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xc008('0x5'),_0xc008('0x6'),_0xc008('0x7'),_0xc008('0x8'),_0xc008('0x9'),_0xc008('0xa'),_0xc008('0xb'),_0xc008('0xc')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xc008('0xd')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xc008('0xe')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0xc008('0x4')](0x1000),'comment':_0xc008('0xf')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0xc008('0x10')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index d1f24dd..2726ccf 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 _0xd4a7=['Action','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','then','destroy','error','stack','name','send','update','find','params','body','catch'];(function(_0x1d3a5d,_0x17fc32){var _0x257078=function(_0x482f3a){while(--_0x482f3a){_0x1d3a5d['push'](_0x1d3a5d['shift']());}};_0x257078(++_0x17fc32);}(_0xd4a7,0xe2));var _0x7d4a=function(_0x4e5cc0,_0xa05e68){_0x4e5cc0=_0x4e5cc0-0x0;var _0x2813ab=_0xd4a7[_0x4e5cc0];return _0x2813ab;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x7d4a('0x0'));var zipdir=require(_0x7d4a('0x1'));var jsonpatch=require(_0x7d4a('0x2'));var rp=require(_0x7d4a('0x3'));var moment=require(_0x7d4a('0x4'));var BPromise=require(_0x7d4a('0x5'));var Mustache=require(_0x7d4a('0x6'));var util=require(_0x7d4a('0x7'));var path=require('path');var sox=require(_0x7d4a('0x8'));var csv=require(_0x7d4a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7d4a('0xa'));var squel=require(_0x7d4a('0xb'));var crypto=require(_0x7d4a('0xc'));var jsforce=require(_0x7d4a('0xd'));var deskjs=require(_0x7d4a('0xe'));var toCsv=require(_0x7d4a('0x9'));var querystring=require(_0x7d4a('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7d4a('0x10'));var qs=require(_0x7d4a('0x11'));var hardwareService=require(_0x7d4a('0x12'));var logger=require(_0x7d4a('0x13'))(_0x7d4a('0x14'));var utils=require(_0x7d4a('0x15'));var config=require(_0x7d4a('0x16'));var db=require(_0x7d4a('0x17'))['db'];function respondWithStatusCode(_0x4d7d46,_0x17f016){_0x17f016=_0x17f016||0xcc;return function(_0x471eab){if(_0x471eab){return _0x4d7d46[_0x7d4a('0x18')](_0x17f016);}return _0x4d7d46[_0x7d4a('0x19')](_0x17f016)[_0x7d4a('0x1a')]();};}function respondWithResult(_0x2fe3d1,_0x4bdb75){_0x4bdb75=_0x4bdb75||0xc8;return function(_0x3211c0){if(_0x3211c0){return _0x2fe3d1[_0x7d4a('0x19')](_0x4bdb75)[_0x7d4a('0x1b')](_0x3211c0);}};}function respondWithFilteredResult(_0x509dde,_0x5aa9d7){return function(_0x421877){if(_0x421877){var _0x332bbd=_0x421877[_0x7d4a('0x1c')],_0x48d56e=_0x5aa9d7['offset'],_0x4e768b=_0x5aa9d7[_0x7d4a('0x1d')]+_0x5aa9d7['limit'],_0xdf8cc2;if(_0x4e768b>=_0x332bbd){_0x4e768b=_0x332bbd;_0xdf8cc2=0xc8;}else{_0xdf8cc2=0xce;}_0x509dde['status'](_0xdf8cc2);return _0x509dde[_0x7d4a('0x1e')](_0x7d4a('0x1f'),_0x48d56e+'-'+_0x4e768b+'/'+_0x332bbd)[_0x7d4a('0x1b')](_0x421877);}return null;};}function patchUpdates(_0x1d3863){return function(_0x721186){try{jsonpatch[_0x7d4a('0x20')](_0x721186,_0x1d3863,!![]);}catch(_0x5c73b0){return BPromise['reject'](_0x5c73b0);}return _0x721186['save']();};}function saveUpdates(_0x54f156,_0x1881b1){return function(_0xcf01d3){if(_0xcf01d3){return _0xcf01d3['update'](_0x54f156)[_0x7d4a('0x21')](function(_0x336f81){return _0x336f81;});}return null;};}function removeEntity(_0x3cef90,_0x3856cd){return function(_0x92ed19){if(_0x92ed19){return _0x92ed19[_0x7d4a('0x22')]()[_0x7d4a('0x21')](function(){_0x3cef90[_0x7d4a('0x19')](0xcc)[_0x7d4a('0x1a')]();});}};}function handleEntityNotFound(_0x5cef70,_0x65ef79){return function(_0x32b790){if(!_0x32b790){_0x5cef70['sendStatus'](0x194);}return _0x32b790;};}function handleError(_0x52a55c,_0x50d5b1){_0x50d5b1=_0x50d5b1||0x1f4;return function(_0xb56909){logger[_0x7d4a('0x23')](_0xb56909[_0x7d4a('0x24')]);if(_0xb56909['name']){delete _0xb56909[_0x7d4a('0x25')];}_0x52a55c[_0x7d4a('0x19')](_0x50d5b1)[_0x7d4a('0x26')](_0xb56909);};}exports[_0x7d4a('0x27')]=function(_0x207b79,_0x39bffe){if(_0x207b79['body']['id']){delete _0x207b79['body']['id'];}return db['Action'][_0x7d4a('0x28')]({'where':{'id':_0x207b79[_0x7d4a('0x29')]['id']}})[_0x7d4a('0x21')](handleEntityNotFound(_0x39bffe,null))[_0x7d4a('0x21')](saveUpdates(_0x207b79[_0x7d4a('0x2a')],null))['then'](respondWithResult(_0x39bffe,null))[_0x7d4a('0x2b')](handleError(_0x39bffe,null));};exports['destroy']=function(_0x230fc4,_0x283527){return db[_0x7d4a('0x2c')][_0x7d4a('0x28')]({'where':{'id':_0x230fc4[_0x7d4a('0x29')]['id']}})['then'](handleEntityNotFound(_0x283527,null))[_0x7d4a('0x21')](removeEntity(_0x283527,null))[_0x7d4a('0x2b')](handleError(_0x283527,null));}; \ No newline at end of file +var _0xe507=['Content-Range','apply','reject','save','update','then','error','stack','name','send','body','find','params','destroy','Action','catch','html-pdf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set'];(function(_0x46e64b,_0x2628d5){var _0x33ea5b=function(_0x5d7e0a){while(--_0x5d7e0a){_0x46e64b['push'](_0x46e64b['shift']());}};_0x33ea5b(++_0x2628d5);}(_0xe507,0x1dc));var _0x7e50=function(_0x218fdc,_0x3b552b){_0x218fdc=_0x218fdc-0x0;var _0x54f74e=_0xe507[_0x218fdc];return _0x54f74e;};'use strict';var pdf=require(_0x7e50('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7e50('0x1'));var jsonpatch=require(_0x7e50('0x2'));var rp=require('request-promise');var moment=require(_0x7e50('0x3'));var BPromise=require(_0x7e50('0x4'));var Mustache=require('mustache');var util=require(_0x7e50('0x5'));var path=require('path');var sox=require(_0x7e50('0x6'));var csv=require(_0x7e50('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7e50('0x8'));var squel=require(_0x7e50('0x9'));var crypto=require(_0x7e50('0xa'));var jsforce=require(_0x7e50('0xb'));var deskjs=require(_0x7e50('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7e50('0xd'));var Papa=require(_0x7e50('0xe'));var Redis=require('ioredis');var authService=require(_0x7e50('0xf'));var qs=require(_0x7e50('0x10'));var hardwareService=require(_0x7e50('0x11'));var logger=require(_0x7e50('0x12'))(_0x7e50('0x13'));var utils=require(_0x7e50('0x14'));var config=require(_0x7e50('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa78989,_0x166a76){_0x166a76=_0x166a76||0xcc;return function(_0x392920){if(_0x392920){return _0xa78989[_0x7e50('0x16')](_0x166a76);}return _0xa78989[_0x7e50('0x17')](_0x166a76)[_0x7e50('0x18')]();};}function respondWithResult(_0x36ea30,_0x16b4c9){_0x16b4c9=_0x16b4c9||0xc8;return function(_0x3ed127){if(_0x3ed127){return _0x36ea30[_0x7e50('0x17')](_0x16b4c9)[_0x7e50('0x19')](_0x3ed127);}};}function respondWithFilteredResult(_0xdcd09f,_0x754556){return function(_0x4e4f07){if(_0x4e4f07){var _0x55621b=_0x4e4f07[_0x7e50('0x1a')],_0x12a823=_0x754556[_0x7e50('0x1b')],_0x597898=_0x754556[_0x7e50('0x1b')]+_0x754556[_0x7e50('0x1c')],_0x89fba5;if(_0x597898>=_0x55621b){_0x597898=_0x55621b;_0x89fba5=0xc8;}else{_0x89fba5=0xce;}_0xdcd09f[_0x7e50('0x17')](_0x89fba5);return _0xdcd09f[_0x7e50('0x1d')](_0x7e50('0x1e'),_0x12a823+'-'+_0x597898+'/'+_0x55621b)['json'](_0x4e4f07);}return null;};}function patchUpdates(_0x286515){return function(_0x27916a){try{jsonpatch[_0x7e50('0x1f')](_0x27916a,_0x286515,!![]);}catch(_0x452604){return BPromise[_0x7e50('0x20')](_0x452604);}return _0x27916a[_0x7e50('0x21')]();};}function saveUpdates(_0x599558,_0x2b665b){return function(_0x59f1d1){if(_0x59f1d1){return _0x59f1d1[_0x7e50('0x22')](_0x599558)[_0x7e50('0x23')](function(_0x53b6ba){return _0x53b6ba;});}return null;};}function removeEntity(_0x1ef553,_0x33f9fd){return function(_0x4df789){if(_0x4df789){return _0x4df789['destroy']()[_0x7e50('0x23')](function(){_0x1ef553['status'](0xcc)[_0x7e50('0x18')]();});}};}function handleEntityNotFound(_0x18d78d,_0x3d8ed8){return function(_0x19235c){if(!_0x19235c){_0x18d78d[_0x7e50('0x16')](0x194);}return _0x19235c;};}function handleError(_0xe859dd,_0x2fa215){_0x2fa215=_0x2fa215||0x1f4;return function(_0x767a6d){logger[_0x7e50('0x24')](_0x767a6d[_0x7e50('0x25')]);if(_0x767a6d[_0x7e50('0x26')]){delete _0x767a6d[_0x7e50('0x26')];}_0xe859dd['status'](_0x2fa215)[_0x7e50('0x27')](_0x767a6d);};}exports[_0x7e50('0x22')]=function(_0x2f5b31,_0x4d9673){if(_0x2f5b31[_0x7e50('0x28')]['id']){delete _0x2f5b31[_0x7e50('0x28')]['id'];}return db['Action'][_0x7e50('0x29')]({'where':{'id':_0x2f5b31[_0x7e50('0x2a')]['id']}})['then'](handleEntityNotFound(_0x4d9673,null))[_0x7e50('0x23')](saveUpdates(_0x2f5b31['body'],null))['then'](respondWithResult(_0x4d9673,null))['catch'](handleError(_0x4d9673,null));};exports[_0x7e50('0x2b')]=function(_0x13a7da,_0x20aff6){return db[_0x7e50('0x2c')][_0x7e50('0x29')]({'where':{'id':_0x13a7da[_0x7e50('0x2a')]['id']}})[_0x7e50('0x23')](handleEntityNotFound(_0x20aff6,null))[_0x7e50('0x23')](removeEntity(_0x20aff6,null))[_0x7e50('0x2d')](handleError(_0x20aff6,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 2b56d2d..fe5f838 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 _0x2216=['tools_actions','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','define','Action'];(function(_0x4e9e9a,_0x555578){var _0x114cce=function(_0x45e5c8){while(--_0x45e5c8){_0x4e9e9a['push'](_0x4e9e9a['shift']());}};_0x114cce(++_0x555578);}(_0x2216,0x137));var _0x6221=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x2216[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0x6221('0x0'));var util=require('util');var logger=require(_0x6221('0x1'))(_0x6221('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6221('0x3'));var fs=require('fs');var path=require(_0x6221('0x4'));var rimraf=require(_0x6221('0x5'));var config=require(_0x6221('0x6'));var attributes=require('./action.attributes');module['exports']=function(_0x14ba4c,_0x5accca){return _0x14ba4c[_0x6221('0x7')](_0x6221('0x8'),attributes,{'tableName':_0x6221('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa86=['Action','tools_actions','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./action.attributes'];(function(_0xc9b216,_0x356a4d){var _0x51e9c5=function(_0x45ba4d){while(--_0x45ba4d){_0xc9b216['push'](_0xc9b216['shift']());}};_0x51e9c5(++_0x356a4d);}(_0xaa86,0x70));var _0x6aa8=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xaa86[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0x6aa8('0x0'));var util=require(_0x6aa8('0x1'));var logger=require(_0x6aa8('0x2'))(_0x6aa8('0x3'));var moment=require(_0x6aa8('0x4'));var BPromise=require('bluebird');var rp=require(_0x6aa8('0x5'));var fs=require('fs');var path=require(_0x6aa8('0x6'));var rimraf=require('rimraf');var config=require(_0x6aa8('0x7'));var attributes=require(_0x6aa8('0x8'));module['exports']=function(_0x1d155c,_0x6ee5d8){return _0x1d155c['define'](_0x6aa8('0x9'),attributes,{'tableName':_0x6aa8('0xa'),'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 c97034f..94dab38 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 _0x885e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','Action,\x20%s,\x20%s','message','lodash','util','bluebird'];(function(_0x478a28,_0x277ac3){var _0x2698ba=function(_0x4148a3){while(--_0x4148a3){_0x478a28['push'](_0x478a28['shift']());}};_0x2698ba(++_0x277ac3);}(_0x885e,0xe4));var _0xe885=function(_0x189ca9,_0x7a5d6b){_0x189ca9=_0x189ca9-0x0;var _0x346b70=_0x885e[_0x189ca9];return _0x346b70;};'use strict';var _=require(_0xe885('0x0'));var util=require(_0xe885('0x1'));var moment=require('moment');var BPromise=require(_0xe885('0x2'));var rs=require(_0xe885('0x3'));var fs=require('fs');var Redis=require(_0xe885('0x4'));var db=require(_0xe885('0x5'))['db'];var utils=require(_0xe885('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xe885('0x7'));var jayson=require(_0xe885('0x8'));var client=jayson[_0xe885('0x9')][_0xe885('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55d2b2,_0x37778a,_0x597bdc){return new BPromise(function(_0x2e8fe0,_0x3c5cc7){return client[_0xe885('0xb')](_0x55d2b2,_0x597bdc)[_0xe885('0xc')](function(_0x231f2f){logger[_0xe885('0xd')]('Action,\x20%s,\x20%s',_0x37778a,_0xe885('0xe'));logger[_0xe885('0xf')](_0xe885('0x10'),_0x37778a,_0xe885('0xe'),JSON[_0xe885('0x11')](_0x231f2f));if(_0x231f2f[_0xe885('0x12')]){if(_0x231f2f[_0xe885('0x12')]['code']===0x1f4){logger[_0xe885('0x12')](_0xe885('0x13'),_0x37778a,_0x231f2f[_0xe885('0x12')][_0xe885('0x14')]);return _0x3c5cc7(_0x231f2f[_0xe885('0x12')][_0xe885('0x14')]);}logger[_0xe885('0x12')]('Action,\x20%s,\x20%s',_0x37778a,_0x231f2f['error']['message']);return _0x2e8fe0(_0x231f2f[_0xe885('0x12')][_0xe885('0x14')]);}else{logger[_0xe885('0xd')](_0xe885('0x13'),_0x37778a,'request\x20sent');_0x2e8fe0(_0x231f2f['result'][_0xe885('0x14')]);}})['catch'](function(_0x36b9e7){logger[_0xe885('0x12')](_0xe885('0x13'),_0x37778a,_0x36b9e7);_0x3c5cc7(_0x36b9e7);});});} \ No newline at end of file +var _0xb2ff=['stringify','error','Action,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','Action,\x20%s,\x20%s,\x20%s'];(function(_0x225ab9,_0x36e39f){var _0x28ebc4=function(_0x5da302){while(--_0x5da302){_0x225ab9['push'](_0x225ab9['shift']());}};_0x28ebc4(++_0x36e39f);}(_0xb2ff,0x123));var _0xfb2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb2ff[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfb2f('0x0'));var util=require(_0xfb2f('0x1'));var moment=require('moment');var BPromise=require(_0xfb2f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfb2f('0x3'));var logger=require('../../config/logger')(_0xfb2f('0x4'));var config=require(_0xfb2f('0x5'));var jayson=require(_0xfb2f('0x6'));var client=jayson[_0xfb2f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a0fd7,_0x28cb13,_0x4ff2df){return new BPromise(function(_0x34c04e,_0x4588d6){return client[_0xfb2f('0x8')](_0x4a0fd7,_0x4ff2df)[_0xfb2f('0x9')](function(_0x5abcdb){logger[_0xfb2f('0xa')]('Action,\x20%s,\x20%s',_0x28cb13,_0xfb2f('0xb'));logger['debug'](_0xfb2f('0xc'),_0x28cb13,_0xfb2f('0xb'),JSON[_0xfb2f('0xd')](_0x5abcdb));if(_0x5abcdb[_0xfb2f('0xe')]){if(_0x5abcdb[_0xfb2f('0xe')]['code']===0x1f4){logger[_0xfb2f('0xe')](_0xfb2f('0xf'),_0x28cb13,_0x5abcdb[_0xfb2f('0xe')][_0xfb2f('0x10')]);return _0x4588d6(_0x5abcdb[_0xfb2f('0xe')][_0xfb2f('0x10')]);}logger[_0xfb2f('0xe')](_0xfb2f('0xf'),_0x28cb13,_0x5abcdb['error'][_0xfb2f('0x10')]);return _0x34c04e(_0x5abcdb[_0xfb2f('0xe')][_0xfb2f('0x10')]);}else{logger[_0xfb2f('0xa')](_0xfb2f('0xf'),_0x28cb13,'request\x20sent');_0x34c04e(_0x5abcdb[_0xfb2f('0x11')][_0xfb2f('0x10')]);}})[_0xfb2f('0x12')](function(_0x240b79){logger[_0xfb2f('0xe')](_0xfb2f('0xf'),_0x28cb13,_0x240b79);_0x4588d6(_0x240b79);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 299dd1e..920b01c 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 _0x5088=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','update','delete','isAuthenticated','destroy'];(function(_0x310391,_0x599d32){var _0x265f3e=function(_0x2ce057){while(--_0x2ce057){_0x310391['push'](_0x310391['shift']());}};_0x265f3e(++_0x599d32);}(_0x5088,0xa9));var _0x8508=function(_0x25c7fb,_0x2e4e86){_0x25c7fb=_0x25c7fb-0x0;var _0x214b77=_0x5088[_0x25c7fb];return _0x214b77;};'use strict';var multer=require('multer');var util=require(_0x8508('0x0'));var path=require(_0x8508('0x1'));var timeout=require(_0x8508('0x2'));var express=require(_0x8508('0x3'));var router=express['Router']();var auth=require(_0x8508('0x4'));var interaction=require(_0x8508('0x5'));var config=require(_0x8508('0x6'));var controller=require(_0x8508('0x7'));router['put'](_0x8508('0x8'),auth['isAuthenticated'](),controller[_0x8508('0x9')]);router[_0x8508('0xa')]('/:id',auth[_0x8508('0xb')](),controller[_0x8508('0xc')]);module['exports']=router; \ No newline at end of file +var _0x3cfb=['./action.controller','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x142ec2,_0x5bb03d){var _0x45ef4e=function(_0x4bc513){while(--_0x4bc513){_0x142ec2['push'](_0x142ec2['shift']());}};_0x45ef4e(++_0x5bb03d);}(_0x3cfb,0x1b8));var _0xb3cf=function(_0x55b220,_0x4dd84f){_0x55b220=_0x55b220-0x0;var _0x1f5e16=_0x3cfb[_0x55b220];return _0x1f5e16;};'use strict';var multer=require(_0xb3cf('0x0'));var util=require(_0xb3cf('0x1'));var path=require(_0xb3cf('0x2'));var timeout=require(_0xb3cf('0x3'));var express=require(_0xb3cf('0x4'));var router=express[_0xb3cf('0x5')]();var auth=require(_0xb3cf('0x6'));var interaction=require(_0xb3cf('0x7'));var config=require('../../config/environment');var controller=require(_0xb3cf('0x8'));router[_0xb3cf('0x9')](_0xb3cf('0xa'),auth['isAuthenticated'](),controller[_0xb3cf('0xb')]);router[_0xb3cf('0xc')](_0xb3cf('0xa'),auth['isAuthenticated'](),controller[_0xb3cf('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index bb7295d..3d26ce8 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 _0xa1db=['TEXT','sequelize','exports','STRING'];(function(_0x12f085,_0x59f761){var _0x139ef5=function(_0xfafc20){while(--_0xfafc20){_0x12f085['push'](_0x12f085['shift']());}};_0x139ef5(++_0x59f761);}(_0xa1db,0x121));var _0xba1d=function(_0x52d4ad,_0x25e611){_0x52d4ad=_0x52d4ad-0x0;var _0x34a767=_0xa1db[_0x52d4ad];return _0x34a767;};'use strict';var Sequelize=require(_0xba1d('0x0'));module[_0xba1d('0x1')]={'name':{'type':Sequelize[_0xba1d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xba1d('0x2')]},'parent':{'type':Sequelize[_0xba1d('0x2')]},'table':{'type':Sequelize[_0xba1d('0x2')]},'conditions':{'type':Sequelize[_0xba1d('0x3')]},'joins':{'type':Sequelize[_0xba1d('0x3')]}}; \ No newline at end of file +var _0x5416=['sequelize','STRING','TEXT'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x5416,0x1b6));var _0x6541=function(_0x5e8e62,_0x4dcbe2){_0x5e8e62=_0x5e8e62-0x0;var _0x3e1b94=_0x5416[_0x5e8e62];return _0x3e1b94;};'use strict';var Sequelize=require(_0x6541('0x0'));module['exports']={'name':{'type':Sequelize[_0x6541('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x6541('0x1')]},'parent':{'type':Sequelize[_0x6541('0x1')]},'table':{'type':Sequelize[_0x6541('0x1')]},'conditions':{'type':Sequelize[_0x6541('0x2')]},'joins':{'type':Sequelize[_0x6541('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index a57f813..53189c4 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 _0x94c9=['attributes','fields','length','nolimit','limit','order','sort','where','filter','merge','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','DESC','joins','type','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','parse','debug','toString','sequelize','QueryTypes','SELECT','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','operator','value','ValidationErrorItem','metric','Limited\x20Query:','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','run','runReport','ROUND(%s)','alias','clone','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','set','reject','save','update','destroy','then','CustomReports','UserProfileResource','error','stack','name','send','AnalyticCustomReport','rawAttributes','model','keys','query','filters'];(function(_0x10f7d8,_0x3b5488){var _0x2260dd=function(_0x57f7dd){while(--_0x57f7dd){_0x10f7d8['push'](_0x10f7d8['shift']());}};_0x2260dd(++_0x3b5488);}(_0x94c9,0x1a7));var _0x994c=function(_0x516961,_0x35b1fc){_0x516961=_0x516961-0x0;var _0x4a70ce=_0x94c9[_0x516961];return _0x4a70ce;};'use strict';var pdf=require(_0x994c('0x0'));var emlformat=require(_0x994c('0x1'));var rimraf=require(_0x994c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x994c('0x3'));var rp=require('request-promise');var moment=require(_0x994c('0x4'));var BPromise=require(_0x994c('0x5'));var Mustache=require(_0x994c('0x6'));var util=require(_0x994c('0x7'));var path=require(_0x994c('0x8'));var sox=require(_0x994c('0x9'));var csv=require(_0x994c('0xa'));var ejs=require(_0x994c('0xb'));var fs=require('fs');var _=require(_0x994c('0xc'));var squel=require(_0x994c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x994c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x994c('0xf'));var Redis=require(_0x994c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x994c('0x11'));var hardwareService=require(_0x994c('0x12'));var logger=require(_0x994c('0x13'))(_0x994c('0x14'));var utils=require(_0x994c('0x15'));var config=require(_0x994c('0x16'));var db=require(_0x994c('0x17'))['db'];function respondWithStatusCode(_0x5a9416,_0x8a576f){_0x8a576f=_0x8a576f||0xcc;return function(_0x292857){if(_0x292857){return _0x5a9416[_0x994c('0x18')](_0x8a576f);}return _0x5a9416[_0x994c('0x19')](_0x8a576f)['end']();};}function respondWithResult(_0x4cadf7,_0x5c7353){_0x5c7353=_0x5c7353||0xc8;return function(_0x7ffdba){if(_0x7ffdba){return _0x4cadf7[_0x994c('0x19')](_0x5c7353)['json'](_0x7ffdba);}};}function respondWithFilteredResult(_0x218af3,_0x30e52e){return function(_0x10509e){if(_0x10509e){var _0x508064=_0x10509e['count'],_0x56965c=_0x30e52e[_0x994c('0x1a')],_0x3d55e5=_0x30e52e[_0x994c('0x1a')]+_0x30e52e['limit'],_0x49d510;if(_0x3d55e5>=_0x508064){_0x3d55e5=_0x508064;_0x49d510=0xc8;}else{_0x49d510=0xce;}_0x218af3[_0x994c('0x19')](_0x49d510);return _0x218af3[_0x994c('0x1b')]('Content-Range',_0x56965c+'-'+_0x3d55e5+'/'+_0x508064)['json'](_0x10509e);}return null;};}function patchUpdates(_0x50d23a){return function(_0x158d13){try{jsonpatch['apply'](_0x158d13,_0x50d23a,!![]);}catch(_0x8a9837){return BPromise[_0x994c('0x1c')](_0x8a9837);}return _0x158d13[_0x994c('0x1d')]();};}function saveUpdates(_0xe86d40,_0x3d2482){return function(_0x3e6c47){if(_0x3e6c47){return _0x3e6c47[_0x994c('0x1e')](_0xe86d40)['then'](function(_0x2cb1b5){return _0x2cb1b5;});}return null;};}function removeEntity(_0x3096fa,_0x5efae7){return function(_0x37fa6d){if(_0x37fa6d){return _0x37fa6d[_0x994c('0x1f')]()[_0x994c('0x20')](function(){var _0xa8417f=_0x37fa6d['get']({'plain':!![]});var _0x27fdf6=_0x994c('0x21');return db[_0x994c('0x22')][_0x994c('0x1f')]({'where':{'type':_0x27fdf6,'resourceId':_0xa8417f['id']}})['then'](function(){return _0x37fa6d;});})[_0x994c('0x20')](function(){_0x3096fa[_0x994c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d890d,_0x28bd7a){return function(_0x343268){if(!_0x343268){_0x2d890d[_0x994c('0x18')](0x194);}return _0x343268;};}function handleError(_0x37aa53,_0x3063a4){_0x3063a4=_0x3063a4||0x1f4;return function(_0x23febd){logger[_0x994c('0x23')](_0x23febd[_0x994c('0x24')]);if(_0x23febd[_0x994c('0x25')]){delete _0x23febd['name'];}_0x37aa53['status'](_0x3063a4)[_0x994c('0x26')](_0x23febd);};}exports['index']=function(_0x1122a1,_0x2985ff){var _0xf15830={},_0x425f27={},_0x567c83={'count':0x0,'rows':[]};var _0x50efde=db[_0x994c('0x27')][_0x994c('0x28')];_0x425f27[_0x994c('0x29')]=_[_0x994c('0x2a')](_0x50efde);_0x425f27[_0x994c('0x2b')]=_[_0x994c('0x2a')](_0x1122a1[_0x994c('0x2b')]);_0x425f27[_0x994c('0x2c')]=_['intersection'](_0x425f27[_0x994c('0x29')],_0x425f27[_0x994c('0x2b')]);_0xf15830[_0x994c('0x2d')]=_['intersection'](_0x425f27[_0x994c('0x29')],qs[_0x994c('0x2e')](_0x1122a1[_0x994c('0x2b')][_0x994c('0x2e')]));_0xf15830[_0x994c('0x2d')]=_0xf15830[_0x994c('0x2d')][_0x994c('0x2f')]?_0xf15830[_0x994c('0x2d')]:_0x425f27[_0x994c('0x29')];if(!_0x1122a1[_0x994c('0x2b')]['hasOwnProperty'](_0x994c('0x30'))){_0xf15830['limit']=qs[_0x994c('0x31')](_0x1122a1['query']['limit']);_0xf15830[_0x994c('0x1a')]=qs[_0x994c('0x1a')](_0x1122a1[_0x994c('0x2b')][_0x994c('0x1a')]);}_0xf15830[_0x994c('0x32')]=qs[_0x994c('0x33')](_0x1122a1[_0x994c('0x2b')][_0x994c('0x33')]);_0xf15830[_0x994c('0x34')]=qs[_0x994c('0x2c')](_['pick'](_0x1122a1[_0x994c('0x2b')],_0x425f27[_0x994c('0x2c')]));if(_0x1122a1[_0x994c('0x2b')][_0x994c('0x35')]){_0xf15830[_0x994c('0x34')]=_[_0x994c('0x36')](_0xf15830[_0x994c('0x34')],{'$or':_['map'](_0x50efde,function(_0x42bf66){if(_0x42bf66['type'][_0x994c('0x37')]!==_0x994c('0x38')){var _0x508b6d={};_0x508b6d[_0x42bf66[_0x994c('0x39')]]={'$like':'%'+_0x1122a1[_0x994c('0x2b')][_0x994c('0x35')]+'%'};return _0x508b6d;}})});}_0xf15830=_[_0x994c('0x36')]({},_0xf15830,_0x1122a1[_0x994c('0x3a')]);var _0x2030a2={'where':_0xf15830[_0x994c('0x34')]};return db[_0x994c('0x27')]['count'](_0x2030a2)[_0x994c('0x20')](function(_0x336ee5){_0x567c83[_0x994c('0x3b')]=_0x336ee5;if(_0x1122a1[_0x994c('0x2b')][_0x994c('0x3c')]){_0xf15830[_0x994c('0x3d')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x994c('0x3e')](_0xf15830);})[_0x994c('0x20')](function(_0x3dbe37){_0x567c83[_0x994c('0x3f')]=_0x3dbe37;return _0x567c83;})[_0x994c('0x20')](respondWithFilteredResult(_0x2985ff,_0xf15830))[_0x994c('0x40')](handleError(_0x2985ff,null));};exports['show']=function(_0x206a30,_0x5e16c5){var _0x1b77ab={'raw':![],'where':{'id':_0x206a30[_0x994c('0x41')]['id']}},_0x3156bc={};_0x3156bc[_0x994c('0x29')]=_['keys'](db[_0x994c('0x27')][_0x994c('0x28')]);_0x3156bc[_0x994c('0x2b')]=_[_0x994c('0x2a')](_0x206a30[_0x994c('0x2b')]);_0x3156bc[_0x994c('0x2c')]=_[_0x994c('0x42')](_0x3156bc[_0x994c('0x29')],_0x3156bc[_0x994c('0x2b')]);_0x1b77ab['attributes']=_['intersection'](_0x3156bc['model'],qs['fields'](_0x206a30[_0x994c('0x2b')][_0x994c('0x2e')]));_0x1b77ab[_0x994c('0x2d')]=_0x1b77ab[_0x994c('0x2d')][_0x994c('0x2f')]?_0x1b77ab[_0x994c('0x2d')]:_0x3156bc[_0x994c('0x29')];if(_0x206a30[_0x994c('0x2b')]['includeAll']){_0x1b77ab[_0x994c('0x3d')]=[{'all':!![]}];}_0x1b77ab=_[_0x994c('0x36')]({},_0x1b77ab,_0x206a30['options']);return db['AnalyticCustomReport'][_0x994c('0x43')](_0x1b77ab)[_0x994c('0x20')](handleEntityNotFound(_0x5e16c5,null))[_0x994c('0x20')](respondWithResult(_0x5e16c5,null))[_0x994c('0x40')](handleError(_0x5e16c5,null));};exports[_0x994c('0x44')]=function(_0x288e5c,_0x535918){return db[_0x994c('0x27')][_0x994c('0x44')](_0x288e5c[_0x994c('0x45')],{})[_0x994c('0x20')](function(_0x6a0666){var _0x3e9b7b=_0x288e5c[_0x994c('0x46')]['get']({'plain':!![]});if(!_0x3e9b7b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e9b7b['role']==='user'){var _0x204f46=_0x6a0666['get']({'plain':!![]});var _0xfe85a4=_0x994c('0x47');return db[_0x994c('0x48')][_0x994c('0x43')]({'where':{'name':_0xfe85a4,'userProfileId':_0x3e9b7b[_0x994c('0x49')]},'raw':!![]})[_0x994c('0x20')](function(_0x4e88bd){if(_0x4e88bd&&_0x4e88bd[_0x994c('0x4a')]===0x0){return db[_0x994c('0x22')][_0x994c('0x44')]({'name':_0x204f46['name'],'resourceId':_0x204f46['id'],'type':_0x994c('0x21'),'sectionId':_0x4e88bd['id']},{})[_0x994c('0x20')](function(){return _0x6a0666;});}else{return _0x6a0666;}})[_0x994c('0x40')](function(_0x4a4c15){logger[_0x994c('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a4c15);throw _0x4a4c15;});}return _0x6a0666;})['then'](respondWithResult(_0x535918,0xc9))[_0x994c('0x40')](handleError(_0x535918,null));};exports['update']=function(_0x2e5d2b,_0x13703e){if(_0x2e5d2b['body']['id']){delete _0x2e5d2b[_0x994c('0x45')]['id'];}return db[_0x994c('0x27')][_0x994c('0x43')]({'where':{'id':_0x2e5d2b['params']['id']}})['then'](handleEntityNotFound(_0x13703e,null))[_0x994c('0x20')](saveUpdates(_0x2e5d2b[_0x994c('0x45')],null))['then'](respondWithResult(_0x13703e,null))['catch'](handleError(_0x13703e,null));};exports['destroy']=function(_0x2a8d35,_0x485816){return db[_0x994c('0x27')][_0x994c('0x43')]({'where':{'id':_0x2a8d35[_0x994c('0x41')]['id']}})[_0x994c('0x20')](handleEntityNotFound(_0x485816,null))[_0x994c('0x20')](removeEntity(_0x485816,null))[_0x994c('0x40')](handleError(_0x485816,null));};exports[_0x994c('0x4b')]=function(_0x2b9092,_0x78efde){var _0x134793=0xa;var _0x5bb240=[_0x994c('0x4c'),_0x994c('0x4d'),'right_join',_0x994c('0x4e')];var _0x5cb840={'SUM':_0x994c('0x4f'),'COUNT':_0x994c('0x50'),'COUNT DISTINCT':_0x994c('0x51'),'MAX':_0x994c('0x52'),'MIN':'MIN(%s)','AVG':_0x994c('0x53'),'GROUP_CONCAT':_0x994c('0x54'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1a0b0f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x994c('0x55'),'HOUR':_0x994c('0x56'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x994c('0x57')};var _0x20087d=function(_0x350834){return!_[_0x994c('0x58')]([_0x994c('0x59'),_0x994c('0x5a'),_0x994c('0x5b'),_0x994c('0x5c')],_0x350834);};var _0x280ead=function(_0x23a56e){if(!_0x23a56e||!_0x23a56e[_0x994c('0x5d')][_0x994c('0x2f')]){return'';}for(var _0x2e852e='(',_0xa5f041=0x0;_0xa5f041<_0x23a56e[_0x994c('0x5d')][_0x994c('0x2f')];_0xa5f041+=0x1){_0xa5f041>0x0&&(_0x2e852e+='\x20'+_0x23a56e['operator']+'\x20');_0x2e852e+=_0x23a56e[_0x994c('0x5d')][_0xa5f041][_0x994c('0x5e')]?_0x280ead(_0x23a56e[_0x994c('0x5d')][_0xa5f041][_0x994c('0x5e')]):_0x23a56e[_0x994c('0x5d')][_0xa5f041][_0x994c('0x39')]+'\x20'+_0x23a56e[_0x994c('0x5d')][_0xa5f041][_0x994c('0x5f')]+(_0x20087d(_0x23a56e['rules'][_0xa5f041][_0x994c('0x5f')])?'\x20'+_0x23a56e[_0x994c('0x5d')][_0xa5f041]['value']:'');}return _0x2e852e+')';};var _0x52261e={'where':{'id':_0x2b9092[_0x994c('0x41')]['id']}},_0x4265d3,_0x5f3ed0,_0x554a24,_0x3866bc,_0x3cd6b2;_0x52261e=_[_0x994c('0x36')]({},_0x52261e,_0x2b9092[_0x994c('0x3a')]);return db[_0x994c('0x27')][_0x994c('0x43')](_0x52261e)[_0x994c('0x20')](function(_0x3f5fd3){if(_0x3f5fd3){_0x4265d3=_0x3f5fd3;return _0x3f5fd3[_0x994c('0x60')]();}return null;})['then'](function(_0xc8d654){if(_0xc8d654){if(!_0xc8d654['length']){throw new db[(_0x994c('0x61'))]['ValidationErrorItem'](_0x994c('0x62'),0x193);}_0x5f3ed0=_0xc8d654;return db[_0x994c('0x63')][_0x994c('0x3e')]({'raw':!![]});}return null;})[_0x994c('0x20')](function(_0x14f722){if(_0x14f722){_0x554a24=_[_0x994c('0x64')](_0x14f722,'id');var _0xf017fc;var _0x3f4a9c=squel[_0x994c('0x65')]();_0x3f4a9c[_0x994c('0x66')](_0x4265d3[_0x994c('0x67')]);for(var _0x130500=0x0;_0x130500<_0x5f3ed0[_0x994c('0x2f')];_0x130500+=0x1){_0xf017fc=_0x5f3ed0[_0x130500][_0x994c('0x68')]?_0x554a24[_0x5f3ed0[_0x130500][_0x994c('0x68')]]['metric']:_0x5f3ed0[_0x130500][_0x994c('0x39')];_0xf017fc=_0x5f3ed0[_0x130500][_0x994c('0x69')]?_[_0x994c('0x6a')](_0x5cb840[_0x5f3ed0[_0x130500][_0x994c('0x69')]],'%s',_0xf017fc):_0xf017fc;_0xf017fc=_0x5f3ed0[_0x130500][_0x994c('0x6b')]?_[_0x994c('0x6a')](_0x1a0b0f[_0x5f3ed0[_0x130500]['format']],'%s',_0xf017fc):_0xf017fc;if(_0x5f3ed0[_0x130500][_0x994c('0x6c')]){_0x3f4a9c[_0x994c('0x5e')](_0xf017fc);}_0x5f3ed0[_0x130500][_0x994c('0x6d')]&&_0x3f4a9c[_0x994c('0x32')](_0xf017fc,_0x5f3ed0[_0x130500][_0x994c('0x6d')]===_0x994c('0x6e')?![]:!![]);_0x3f4a9c[_0x994c('0x39')](_0xf017fc,_0x5f3ed0[_0x130500]['alias']||_0xf017fc);}if(_0x4265d3[_0x994c('0x6f')]){_0x4265d3[_0x994c('0x6f')]=JSON['parse'](_0x4265d3[_0x994c('0x6f')]);for(var _0x5e0264=0x0;_0x5e0264<_0x4265d3[_0x994c('0x6f')][_0x994c('0x2f')];_0x5e0264+=0x1){if(_0x4265d3[_0x994c('0x6f')][_0x5e0264][_0x994c('0x70')]&&_[_0x994c('0x58')](_0x5bb240,_0x4265d3[_0x994c('0x6f')][_0x5e0264]['type'])&&_0x4265d3[_0x994c('0x6f')][_0x5e0264][_0x994c('0x71')]&&_0x4265d3[_0x994c('0x6f')][_0x5e0264][_0x994c('0x72')]&&_0x4265d3[_0x994c('0x6f')][_0x5e0264]['foreignKey']){_0x3f4a9c[_0x4265d3[_0x994c('0x6f')][_0x5e0264][_0x994c('0x70')]](_0x4265d3[_0x994c('0x6f')][_0x5e0264][_0x994c('0x72')],null,util[_0x994c('0x6b')](_0x994c('0x73'),_0x4265d3[_0x994c('0x67')],_0x4265d3['joins'][_0x5e0264][_0x994c('0x71')],_0x4265d3[_0x994c('0x6f')][_0x5e0264][_0x994c('0x72')],_0x4265d3['joins'][_0x5e0264][_0x994c('0x74')]));}}}if(_0x4265d3[_0x994c('0x75')]){_0x4265d3[_0x994c('0x75')]=JSON[_0x994c('0x76')](_0x4265d3[_0x994c('0x75')]);_0x3f4a9c[_0x994c('0x34')](_0x280ead(_0x4265d3['conditions'][_0x994c('0x5e')]));}_0x3cd6b2=_0x3f4a9c['clone']();_0x3f4a9c[_0x994c('0x31')](_0x134793);_0x3f4a9c['offset'](0x0);logger[_0x994c('0x77')]('Limited\x20Query:',_0x3f4a9c[_0x994c('0x78')]());return db[_0x994c('0x79')]['query'](_0x3f4a9c[_0x994c('0x78')](),{'type':db[_0x994c('0x79')][_0x994c('0x7a')][_0x994c('0x7b')]});}})[_0x994c('0x20')](respondWithResult(_0x78efde,null))[_0x994c('0x40')](handleError(_0x78efde,null));};function runReport(_0x59bf61,_0xa8f5e3,_0x7071a0){var _0xf8978d=_0xa8f5e3[_0x994c('0x25')];var _0x1783a9=0xa;var _0xb69ba=[_0x994c('0x4c'),_0x994c('0x4d'),'right_join','cross_join'];var _0x47bc2c={'SUM':_0x994c('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x994c('0x51'),'MAX':_0x994c('0x52'),'MIN':_0x994c('0x7c'),'AVG':_0x994c('0x53'),'GROUP_CONCAT':_0x994c('0x54'),'GROUP_CONCAT ASC':_0x994c('0x7d'),'GROUP_CONCAT DESC':_0x994c('0x7e')};var _0x25db9c={'SEC_TO_TIME':_0x994c('0x7f'),'DATE':_0x994c('0x55'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x994c('0x57')};var _0x15d058=function(_0x1eac6e){return!_[_0x994c('0x58')]([_0x994c('0x59'),_0x994c('0x5a'),_0x994c('0x5b'),'IS\x20NOT\x20EMPTY'],_0x1eac6e);};var _0x3e2e62=function(_0xb37607){if(!_0xb37607||!_0xb37607[_0x994c('0x5d')][_0x994c('0x2f')]){return'';}for(var _0x3f0429='(',_0x1b1970=0x0;_0x1b1970<_0xb37607[_0x994c('0x5d')][_0x994c('0x2f')];_0x1b1970+=0x1){_0x1b1970>0x0&&(_0x3f0429+='\x20'+_0xb37607[_0x994c('0x80')]+'\x20');_0x3f0429+=_0xb37607[_0x994c('0x5d')][_0x1b1970]['group']?_0x3e2e62(_0xb37607[_0x994c('0x5d')][_0x1b1970][_0x994c('0x5e')]):_0xb37607[_0x994c('0x5d')][_0x1b1970][_0x994c('0x39')]+'\x20'+_0xb37607['rules'][_0x1b1970][_0x994c('0x5f')]+(_0x15d058(_0xb37607['rules'][_0x1b1970]['condition'])?'\x20'+_0xb37607['rules'][_0x1b1970][_0x994c('0x81')]:'');}return _0x3f0429+')';};var _0x3d6cd1={'where':{'id':_0x59bf61['id']}},_0x44db51,_0x486838,_0x1c4d90,_0x40ed1a,_0x1f3128;_0x3d6cd1=_[_0x994c('0x36')]({},_0x3d6cd1,_0x7071a0);return db[_0x994c('0x27')]['find'](_0x3d6cd1)['then'](function(_0x1abe63){if(_0x1abe63){_0x44db51=_0x1abe63;return _0x1abe63[_0x994c('0x60')]();}return null;})[_0x994c('0x20')](function(_0x185ea1){if(_0x185ea1){if(!_0x185ea1['length']){throw new db[(_0x994c('0x61'))][(_0x994c('0x82'))](_0x994c('0x62'),0x193);}_0x486838=_0x185ea1;return db['AnalyticMetric'][_0x994c('0x3e')]({'raw':!![]});}return null;})[_0x994c('0x20')](function(_0x220b44){if(_0x220b44){_0x1c4d90=_[_0x994c('0x64')](_0x220b44,'id');var _0x5da27c;var _0x488713=squel[_0x994c('0x65')]();_0x488713[_0x994c('0x66')](_0x44db51[_0x994c('0x67')]);for(var _0x360fa4=0x0;_0x360fa4<_0x486838[_0x994c('0x2f')];_0x360fa4+=0x1){_0x5da27c=_0x486838[_0x360fa4][_0x994c('0x68')]?_0x1c4d90[_0x486838[_0x360fa4][_0x994c('0x68')]][_0x994c('0x83')]:_0x486838[_0x360fa4][_0x994c('0x39')];_0x5da27c=_0x486838[_0x360fa4][_0x994c('0x69')]?_['replace'](_0x47bc2c[_0x486838[_0x360fa4][_0x994c('0x69')]],'%s',_0x5da27c):_0x5da27c;_0x5da27c=_0x486838[_0x360fa4][_0x994c('0x6b')]?_[_0x994c('0x6a')](_0x25db9c[_0x486838[_0x360fa4][_0x994c('0x6b')]],'%s',_0x5da27c):_0x5da27c;if(_0x486838[_0x360fa4]['groupBy']){_0x488713['group'](_0x5da27c);}_0x486838[_0x360fa4][_0x994c('0x6d')]&&_0x488713['order'](_0x5da27c,_0x486838[_0x360fa4][_0x994c('0x6d')]==='DESC'?![]:!![]);_0x488713[_0x994c('0x39')](_0x5da27c,_0x486838[_0x360fa4]['alias']||_0x5da27c);}if(_0x44db51['joins']){_0x44db51['joins']=JSON['parse'](_0x44db51[_0x994c('0x6f')]);for(var _0x355ee5=0x0;_0x355ee5<_0x44db51['joins'][_0x994c('0x2f')];_0x355ee5+=0x1){if(_0x44db51['joins'][_0x355ee5][_0x994c('0x70')]&&_[_0x994c('0x58')](_0xb69ba,_0x44db51[_0x994c('0x6f')][_0x355ee5][_0x994c('0x70')])&&_0x44db51['joins'][_0x355ee5][_0x994c('0x71')]&&_0x44db51[_0x994c('0x6f')][_0x355ee5][_0x994c('0x72')]&&_0x44db51[_0x994c('0x6f')][_0x355ee5]['foreignKey']){_0x488713[_0x44db51[_0x994c('0x6f')][_0x355ee5]['type']](_0x44db51[_0x994c('0x6f')][_0x355ee5][_0x994c('0x72')],null,util[_0x994c('0x6b')]('%s.%s\x20=\x20%s.%s',_0x44db51[_0x994c('0x67')],_0x44db51[_0x994c('0x6f')][_0x355ee5][_0x994c('0x71')],_0x44db51['joins'][_0x355ee5][_0x994c('0x72')],_0x44db51[_0x994c('0x6f')][_0x355ee5]['foreignKey']));}}}if(_0x44db51[_0x994c('0x75')]){_0x44db51[_0x994c('0x75')]=JSON[_0x994c('0x76')](_0x44db51[_0x994c('0x75')]);_0x488713[_0x994c('0x34')](_0x3e2e62(_0x44db51[_0x994c('0x75')]['group']));}_0x1f3128=_0x488713['clone']();_0x488713[_0x994c('0x31')](_0x1783a9);_0x488713[_0x994c('0x1a')](0x0);logger[_0x994c('0x77')](_0x994c('0x84'),_0x488713[_0x994c('0x78')]());return db['sequelize'][_0x994c('0x2b')](_0x488713[_0x994c('0x78')](),{'type':db[_0x994c('0x79')][_0x994c('0x7a')][_0x994c('0x7b')]});}})[_0x994c('0x20')](function(_0x46a728){if(!_0x46a728[_0x994c('0x2f')]){throw new db['Sequelize'][(_0x994c('0x82'))]('No\x20available\x20data',0xcc);}if(_0xa8f5e3[_0x994c('0x85')]==='web'){return null;}var _0x3ae8ba=_[_0x994c('0x36')](_0xa8f5e3,{'name':_0xa8f5e3[_0x994c('0x86')]||_0xa8f5e3['name']||_0x44db51[_0x994c('0x25')],'basename':_0xf8978d,'savename':util[_0x994c('0x6b')](_0x994c('0x87'),_0xa8f5e3[_0x994c('0x25')]||_0x44db51[_0x994c('0x25')],require(_0x994c('0x88'))[_0x994c('0x89')](0x4),_0xa8f5e3[_0x994c('0x85')]||_0x994c('0x8a')),'reportId':_0x44db51['id'],'reportType':_0x994c('0x8b')});return db[_0x994c('0x8c')][_0x994c('0x44')](_0x3ae8ba,{'raw':!![]});})[_0x994c('0x20')](function(_0x1155c4){if(_0x44db51[_0x994c('0x67')]==='cdr'){_0x1f3128[_0x994c('0x34')](_0x44db51[_0x994c('0x67')]+_0x994c('0x8d'),_0xa8f5e3['startDate'],_0xa8f5e3[_0x994c('0x8e')]);}else{_0x1f3128[_0x994c('0x34')](_0x44db51[_0x994c('0x67')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xa8f5e3[_0x994c('0x8f')],_0xa8f5e3[_0x994c('0x8e')]);}if(_0x1155c4){logger[_0x994c('0x90')](_0x994c('0x91'),_0x1f3128['toString']());require(_0x994c('0x92'))[_0x994c('0x93')](path['join'](__dirname,_0x994c('0x94'),_0x1155c4[_0x994c('0x85')]),[_0x1155c4['id'],_0x1f3128[_0x994c('0x78')](),path['join'](__dirname,'../../files/reports',_0x1155c4[_0x994c('0x95')]),_0xf8978d]);return _0x1155c4;}else{var _0x2ec234=squel['select']();_0x2ec234['from']('('+_0x1f3128[_0x994c('0x78')]()+')',_0x994c('0x96'));_0x2ec234[_0x994c('0x39')]('COUNT(*)',_0x994c('0x3b'));_0x1f3128[_0x994c('0x31')](_0xa8f5e3[_0x994c('0x31')]||_0x1783a9);_0x1f3128[_0x994c('0x1a')](_0xa8f5e3[_0x994c('0x1a')]||0x0);return db['sequelize'][_0x994c('0x2b')](_0x2ec234[_0x994c('0x78')](),{'type':db[_0x994c('0x79')]['QueryTypes']['SELECT']})[_0x994c('0x20')](function(_0x6d6101){if(!_0x6d6101[_0x994c('0x2f')]){_0x40ed1a=0x0;}else{_0x40ed1a=_0x6d6101[0x0][_0x994c('0x3b')]||0x0;}return db['sequelize']['query'](_0x1f3128[_0x994c('0x78')](),{'type':db[_0x994c('0x79')][_0x994c('0x7a')]['SELECT']});})[_0x994c('0x20')](function(_0x5eed4a){return{'rows':_0x5eed4a||[],'count':_0x40ed1a};});}});}exports[_0x994c('0x97')]=function(_0x4118d3,_0x316804){return runReport(_0x4118d3['params'],_0x4118d3[_0x994c('0x2b')],_0x4118d3['options'])['then'](respondWithResult(_0x316804,null))['catch'](handleError(_0x316804,null));};exports[_0x994c('0x98')]=runReport;exports[_0x994c('0x2b')]=function(_0x19ad48,_0x141e4f){var _0x2c1e53=0xa;var _0x30f23e=['join',_0x994c('0x4d'),'right_join',_0x994c('0x4e')];var _0x5376d4={'SUM':_0x994c('0x4f'),'COUNT':_0x994c('0x50'),'COUNT DISTINCT':_0x994c('0x51'),'MAX':'MAX(%s)','MIN':_0x994c('0x7c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x994c('0x54'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x994c('0x7e')};var _0x5027bc={'SEC_TO_TIME':_0x994c('0x7f'),'DATE':_0x994c('0x55'),'HOUR':_0x994c('0x56'),'ROUND':_0x994c('0x99'),'UNIX_TIMESTAMP':_0x994c('0x57')};var _0x8bdf2b=function(_0x38c958){return!_[_0x994c('0x58')]([_0x994c('0x59'),_0x994c('0x5a'),'IS\x20EMPTY',_0x994c('0x5c')],_0x38c958);};var _0xe2e015=function(_0x2c340a){if(!_0x2c340a||!_0x2c340a['rules']['length']){return'';}for(var _0x32be82='(',_0x2d7101=0x0;_0x2d7101<_0x2c340a[_0x994c('0x5d')][_0x994c('0x2f')];_0x2d7101+=0x1){_0x2d7101>0x0&&(_0x32be82+='\x20'+_0x2c340a['operator']+'\x20');_0x32be82+=_0x2c340a[_0x994c('0x5d')][_0x2d7101][_0x994c('0x5e')]?_0xe2e015(_0x2c340a[_0x994c('0x5d')][_0x2d7101][_0x994c('0x5e')]):_0x2c340a['rules'][_0x2d7101][_0x994c('0x39')]+'\x20'+_0x2c340a[_0x994c('0x5d')][_0x2d7101][_0x994c('0x5f')]+(_0x8bdf2b(_0x2c340a[_0x994c('0x5d')][_0x2d7101][_0x994c('0x5f')])?'\x20'+_0x2c340a[_0x994c('0x5d')][_0x2d7101][_0x994c('0x81')]:'');}return _0x32be82+')';};var _0x52e285={'where':{'id':_0x19ad48[_0x994c('0x41')]['id']}},_0xfe9640,_0x30acda,_0x1f5ec4,_0x6acf79,_0x22cc49;_0x52e285=_['merge']({},_0x52e285,_0x19ad48[_0x994c('0x3a')]);return db['AnalyticCustomReport'][_0x994c('0x43')](_0x52e285)[_0x994c('0x20')](function(_0x2691f1){if(_0x2691f1){_0xfe9640=_0x2691f1;return _0x2691f1[_0x994c('0x60')]();}return null;})[_0x994c('0x20')](function(_0x30c1b5){if(_0x30c1b5){if(!_0x30c1b5[_0x994c('0x2f')]){throw new db[(_0x994c('0x61'))][(_0x994c('0x82'))](_0x994c('0x62'),0x193);}_0x30acda=_0x30c1b5;return db['AnalyticMetric'][_0x994c('0x3e')]({'raw':!![]});}return null;})[_0x994c('0x20')](function(_0x5889ce){if(_0x5889ce){_0x1f5ec4=_['keyBy'](_0x5889ce,'id');var _0x40a911;var _0x146b1e=squel[_0x994c('0x65')]();_0x146b1e['from'](_0xfe9640[_0x994c('0x67')]);for(var _0x854ae5=0x0;_0x854ae5<_0x30acda['length'];_0x854ae5+=0x1){_0x40a911=_0x30acda[_0x854ae5][_0x994c('0x68')]?_0x1f5ec4[_0x30acda[_0x854ae5][_0x994c('0x68')]]['metric']:_0x30acda[_0x854ae5]['field'];_0x40a911=_0x30acda[_0x854ae5][_0x994c('0x69')]?_[_0x994c('0x6a')](_0x5376d4[_0x30acda[_0x854ae5][_0x994c('0x69')]],'%s',_0x40a911):_0x40a911;_0x40a911=_0x30acda[_0x854ae5][_0x994c('0x6b')]?_[_0x994c('0x6a')](_0x5027bc[_0x30acda[_0x854ae5][_0x994c('0x6b')]],'%s',_0x40a911):_0x40a911;if(_0x30acda[_0x854ae5]['groupBy']){_0x146b1e[_0x994c('0x5e')](_0x40a911);}_0x30acda[_0x854ae5]['orderBy']&&_0x146b1e['order'](_0x40a911,_0x30acda[_0x854ae5][_0x994c('0x6d')]===_0x994c('0x6e')?![]:!![]);_0x146b1e['field'](_0x40a911,_0x30acda[_0x854ae5][_0x994c('0x9a')]||_0x40a911);}if(_0xfe9640[_0x994c('0x6f')]){_0xfe9640[_0x994c('0x6f')]=JSON[_0x994c('0x76')](_0xfe9640[_0x994c('0x6f')]);for(var _0xe8ba05=0x0;_0xe8ba05<_0xfe9640['joins']['length'];_0xe8ba05+=0x1){if(_0xfe9640['joins'][_0xe8ba05]['type']&&_[_0x994c('0x58')](_0x30f23e,_0xfe9640[_0x994c('0x6f')][_0xe8ba05]['type'])&&_0xfe9640[_0x994c('0x6f')][_0xe8ba05]['parentKey']&&_0xfe9640[_0x994c('0x6f')][_0xe8ba05]['foreignTable']&&_0xfe9640[_0x994c('0x6f')][_0xe8ba05][_0x994c('0x74')]){_0x146b1e[_0xfe9640['joins'][_0xe8ba05][_0x994c('0x70')]](_0xfe9640['joins'][_0xe8ba05][_0x994c('0x72')],null,util[_0x994c('0x6b')](_0x994c('0x73'),_0xfe9640[_0x994c('0x67')],_0xfe9640[_0x994c('0x6f')][_0xe8ba05][_0x994c('0x71')],_0xfe9640[_0x994c('0x6f')][_0xe8ba05][_0x994c('0x72')],_0xfe9640[_0x994c('0x6f')][_0xe8ba05][_0x994c('0x74')]));}}}if(_0xfe9640['conditions']){_0xfe9640['conditions']=JSON[_0x994c('0x76')](_0xfe9640[_0x994c('0x75')]);_0x146b1e[_0x994c('0x34')](_0xe2e015(_0xfe9640[_0x994c('0x75')][_0x994c('0x5e')]));}_0x22cc49=_0x146b1e[_0x994c('0x9b')]();_0x146b1e[_0x994c('0x31')](_0x2c1e53);_0x146b1e['offset'](0x0);logger[_0x994c('0x77')](_0x994c('0x84'),_0x146b1e[_0x994c('0x78')]());return db[_0x994c('0x79')][_0x994c('0x2b')](_0x146b1e['toString'](),{'type':db[_0x994c('0x79')][_0x994c('0x7a')]['SELECT']});}})['then'](function(){return{'sql':_0x22cc49[_0x994c('0x78')]()};})[_0x994c('0x20')](respondWithResult(_0x141e4f,null))['catch'](handleError(_0x141e4f,null));}; \ No newline at end of file +var _0x0195=['parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','sequelize','QueryTypes','join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','keyBy','select','toString','SELECT','No\x20available\x20data','web','fullPath','%s-%s.%s','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','../../files/reports','savename','countTable','COUNT(*)','runReport','%s.%s\x20=\x20%s.%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','apply','save','then','destroy','get','CustomReports','sendStatus','name','send','index','AnalyticCustomReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','map','type','VIRTUAL','field','merge','includeAll','include','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','update','params','preview','left_join','right_join','cross_join','COUNT(%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)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','group','condition','value','options','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse'];(function(_0x69727d,_0x4efad0){var _0xd3660d=function(_0x51fb13){while(--_0x51fb13){_0x69727d['push'](_0x69727d['shift']());}};_0xd3660d(++_0x4efad0);}(_0x0195,0x168));var _0x5019=function(_0x3277f3,_0x31c9ff){_0x3277f3=_0x3277f3-0x0;var _0x523ee0=_0x0195[_0x3277f3];return _0x523ee0;};'use strict';var pdf=require(_0x5019('0x0'));var emlformat=require(_0x5019('0x1'));var rimraf=require(_0x5019('0x2'));var zipdir=require(_0x5019('0x3'));var jsonpatch=require(_0x5019('0x4'));var rp=require(_0x5019('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5019('0x6'));var path=require('path');var sox=require(_0x5019('0x7'));var csv=require(_0x5019('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5019('0x9'));var crypto=require(_0x5019('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5019('0x8'));var querystring=require(_0x5019('0xb'));var Papa=require(_0x5019('0xc'));var Redis=require(_0x5019('0xd'));var authService=require(_0x5019('0xe'));var qs=require(_0x5019('0xf'));var hardwareService=require(_0x5019('0x10'));var logger=require(_0x5019('0x11'))(_0x5019('0x12'));var utils=require(_0x5019('0x13'));var config=require('../../config/environment');var db=require(_0x5019('0x14'))['db'];function respondWithStatusCode(_0x1efef6,_0x4d6ef4){_0x4d6ef4=_0x4d6ef4||0xcc;return function(_0x37d26f){if(_0x37d26f){return _0x1efef6['sendStatus'](_0x4d6ef4);}return _0x1efef6[_0x5019('0x15')](_0x4d6ef4)[_0x5019('0x16')]();};}function respondWithResult(_0x3d8573,_0x182849){_0x182849=_0x182849||0xc8;return function(_0x17283f){if(_0x17283f){return _0x3d8573[_0x5019('0x15')](_0x182849)[_0x5019('0x17')](_0x17283f);}};}function respondWithFilteredResult(_0x1a7b04,_0x782130){return function(_0x500782){if(_0x500782){var _0x1eddaa=_0x500782[_0x5019('0x18')],_0x24f41c=_0x782130[_0x5019('0x19')],_0x1cc116=_0x782130[_0x5019('0x19')]+_0x782130[_0x5019('0x1a')],_0x466392;if(_0x1cc116>=_0x1eddaa){_0x1cc116=_0x1eddaa;_0x466392=0xc8;}else{_0x466392=0xce;}_0x1a7b04['status'](_0x466392);return _0x1a7b04['set']('Content-Range',_0x24f41c+'-'+_0x1cc116+'/'+_0x1eddaa)['json'](_0x500782);}return null;};}function patchUpdates(_0x227df5){return function(_0x1cf608){try{jsonpatch[_0x5019('0x1b')](_0x1cf608,_0x227df5,!![]);}catch(_0xae2ab4){return BPromise['reject'](_0xae2ab4);}return _0x1cf608[_0x5019('0x1c')]();};}function saveUpdates(_0x81d2d7,_0x479760){return function(_0x37c95b){if(_0x37c95b){return _0x37c95b['update'](_0x81d2d7)[_0x5019('0x1d')](function(_0x3f6b68){return _0x3f6b68;});}return null;};}function removeEntity(_0x5d9a28,_0x4d2ebc){return function(_0x28a588){if(_0x28a588){return _0x28a588[_0x5019('0x1e')]()[_0x5019('0x1d')](function(){var _0x5d471f=_0x28a588[_0x5019('0x1f')]({'plain':!![]});var _0x856879=_0x5019('0x20');return db['UserProfileResource'][_0x5019('0x1e')]({'where':{'type':_0x856879,'resourceId':_0x5d471f['id']}})['then'](function(){return _0x28a588;});})[_0x5019('0x1d')](function(){_0x5d9a28[_0x5019('0x15')](0xcc)[_0x5019('0x16')]();});}};}function handleEntityNotFound(_0x39dc31,_0x22ad48){return function(_0x20f67e){if(!_0x20f67e){_0x39dc31[_0x5019('0x21')](0x194);}return _0x20f67e;};}function handleError(_0x5ba900,_0x334f55){_0x334f55=_0x334f55||0x1f4;return function(_0x4d229c){logger['error'](_0x4d229c['stack']);if(_0x4d229c[_0x5019('0x22')]){delete _0x4d229c['name'];}_0x5ba900[_0x5019('0x15')](_0x334f55)[_0x5019('0x23')](_0x4d229c);};}exports[_0x5019('0x24')]=function(_0x37e380,_0x371251){var _0xf9891b={},_0xaa19c={},_0x58ac42={'count':0x0,'rows':[]};var _0x238d9f=db[_0x5019('0x25')][_0x5019('0x26')];_0xaa19c[_0x5019('0x27')]=_[_0x5019('0x28')](_0x238d9f);_0xaa19c[_0x5019('0x29')]=_['keys'](_0x37e380[_0x5019('0x29')]);_0xaa19c[_0x5019('0x2a')]=_['intersection'](_0xaa19c['model'],_0xaa19c[_0x5019('0x29')]);_0xf9891b[_0x5019('0x2b')]=_[_0x5019('0x2c')](_0xaa19c['model'],qs[_0x5019('0x2d')](_0x37e380['query'][_0x5019('0x2d')]));_0xf9891b[_0x5019('0x2b')]=_0xf9891b['attributes'][_0x5019('0x2e')]?_0xf9891b[_0x5019('0x2b')]:_0xaa19c[_0x5019('0x27')];if(!_0x37e380['query']['hasOwnProperty'](_0x5019('0x2f'))){_0xf9891b[_0x5019('0x1a')]=qs[_0x5019('0x1a')](_0x37e380[_0x5019('0x29')][_0x5019('0x1a')]);_0xf9891b[_0x5019('0x19')]=qs[_0x5019('0x19')](_0x37e380[_0x5019('0x29')][_0x5019('0x19')]);}_0xf9891b[_0x5019('0x30')]=qs[_0x5019('0x31')](_0x37e380[_0x5019('0x29')][_0x5019('0x31')]);_0xf9891b['where']=qs[_0x5019('0x2a')](_[_0x5019('0x32')](_0x37e380[_0x5019('0x29')],_0xaa19c[_0x5019('0x2a')]));if(_0x37e380[_0x5019('0x29')][_0x5019('0x33')]){_0xf9891b[_0x5019('0x34')]=_['merge'](_0xf9891b[_0x5019('0x34')],{'$or':_[_0x5019('0x35')](_0x238d9f,function(_0x45a8ed){if(_0x45a8ed[_0x5019('0x36')]['key']!==_0x5019('0x37')){var _0x328f69={};_0x328f69[_0x45a8ed[_0x5019('0x38')]]={'$like':'%'+_0x37e380[_0x5019('0x29')][_0x5019('0x33')]+'%'};return _0x328f69;}})});}_0xf9891b=_[_0x5019('0x39')]({},_0xf9891b,_0x37e380['options']);var _0x47dd56={'where':_0xf9891b[_0x5019('0x34')]};return db[_0x5019('0x25')][_0x5019('0x18')](_0x47dd56)[_0x5019('0x1d')](function(_0x16c17b){_0x58ac42[_0x5019('0x18')]=_0x16c17b;if(_0x37e380['query'][_0x5019('0x3a')]){_0xf9891b[_0x5019('0x3b')]=[{'all':!![]}];}return db[_0x5019('0x25')]['findAll'](_0xf9891b);})[_0x5019('0x1d')](function(_0x1c0ec9){_0x58ac42[_0x5019('0x3c')]=_0x1c0ec9;return _0x58ac42;})[_0x5019('0x1d')](respondWithFilteredResult(_0x371251,_0xf9891b))[_0x5019('0x3d')](handleError(_0x371251,null));};exports[_0x5019('0x3e')]=function(_0x56139e,_0x287d29){var _0x2f9aad={'raw':![],'where':{'id':_0x56139e['params']['id']}},_0x4ec2bf={};_0x4ec2bf[_0x5019('0x27')]=_[_0x5019('0x28')](db[_0x5019('0x25')][_0x5019('0x26')]);_0x4ec2bf['query']=_[_0x5019('0x28')](_0x56139e['query']);_0x4ec2bf['filters']=_[_0x5019('0x2c')](_0x4ec2bf[_0x5019('0x27')],_0x4ec2bf[_0x5019('0x29')]);_0x2f9aad[_0x5019('0x2b')]=_[_0x5019('0x2c')](_0x4ec2bf[_0x5019('0x27')],qs[_0x5019('0x2d')](_0x56139e[_0x5019('0x29')]['fields']));_0x2f9aad['attributes']=_0x2f9aad['attributes']['length']?_0x2f9aad['attributes']:_0x4ec2bf[_0x5019('0x27')];if(_0x56139e[_0x5019('0x29')][_0x5019('0x3a')]){_0x2f9aad[_0x5019('0x3b')]=[{'all':!![]}];}_0x2f9aad=_[_0x5019('0x39')]({},_0x2f9aad,_0x56139e['options']);return db[_0x5019('0x25')][_0x5019('0x3f')](_0x2f9aad)['then'](handleEntityNotFound(_0x287d29,null))[_0x5019('0x1d')](respondWithResult(_0x287d29,null))['catch'](handleError(_0x287d29,null));};exports['create']=function(_0x12ea8a,_0x3d2b1f){return db[_0x5019('0x25')][_0x5019('0x40')](_0x12ea8a[_0x5019('0x41')],{})['then'](function(_0x57c2a7){var _0x1f2b27=_0x12ea8a[_0x5019('0x42')]['get']({'plain':!![]});if(!_0x1f2b27)throw new Error(_0x5019('0x43'));if(_0x1f2b27['role']===_0x5019('0x42')){var _0x161810=_0x57c2a7[_0x5019('0x1f')]({'plain':!![]});var _0x2b246f=_0x5019('0x44');return db[_0x5019('0x45')][_0x5019('0x3f')]({'where':{'name':_0x2b246f,'userProfileId':_0x1f2b27[_0x5019('0x46')]},'raw':!![]})[_0x5019('0x1d')](function(_0x272434){if(_0x272434&&_0x272434[_0x5019('0x47')]===0x0){return db[_0x5019('0x48')]['create']({'name':_0x161810['name'],'resourceId':_0x161810['id'],'type':_0x5019('0x20'),'sectionId':_0x272434['id']},{})[_0x5019('0x1d')](function(){return _0x57c2a7;});}else{return _0x57c2a7;}})[_0x5019('0x3d')](function(_0x38da5c){logger[_0x5019('0x49')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38da5c);throw _0x38da5c;});}return _0x57c2a7;})[_0x5019('0x1d')](respondWithResult(_0x3d2b1f,0xc9))[_0x5019('0x3d')](handleError(_0x3d2b1f,null));};exports[_0x5019('0x4a')]=function(_0x22757a,_0x329310){if(_0x22757a[_0x5019('0x41')]['id']){delete _0x22757a[_0x5019('0x41')]['id'];}return db[_0x5019('0x25')][_0x5019('0x3f')]({'where':{'id':_0x22757a['params']['id']}})[_0x5019('0x1d')](handleEntityNotFound(_0x329310,null))[_0x5019('0x1d')](saveUpdates(_0x22757a[_0x5019('0x41')],null))[_0x5019('0x1d')](respondWithResult(_0x329310,null))['catch'](handleError(_0x329310,null));};exports['destroy']=function(_0x41caee,_0x12dbd4){return db[_0x5019('0x25')][_0x5019('0x3f')]({'where':{'id':_0x41caee[_0x5019('0x4b')]['id']}})[_0x5019('0x1d')](handleEntityNotFound(_0x12dbd4,null))[_0x5019('0x1d')](removeEntity(_0x12dbd4,null))[_0x5019('0x3d')](handleError(_0x12dbd4,null));};exports[_0x5019('0x4c')]=function(_0x133a22,_0x37e2ab){var _0x4cf94c=0xa;var _0x3c3f11=['join',_0x5019('0x4d'),_0x5019('0x4e'),_0x5019('0x4f')];var _0xd9e410={'SUM':'SUM(%s)','COUNT':_0x5019('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x5019('0x51'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x5019('0x52'),'GROUP_CONCAT ASC':_0x5019('0x53'),'GROUP_CONCAT DESC':_0x5019('0x54')};var _0x149f4d={'SEC_TO_TIME':_0x5019('0x55'),'DATE':_0x5019('0x56'),'HOUR':_0x5019('0x57'),'ROUND':_0x5019('0x58'),'UNIX_TIMESTAMP':_0x5019('0x59')};var _0x1c7d44=function(_0x585f8d){return!_[_0x5019('0x5a')]([_0x5019('0x5b'),_0x5019('0x5c'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x585f8d);};var _0x9884e7=function(_0x4358fe){if(!_0x4358fe||!_0x4358fe[_0x5019('0x5d')]['length']){return'';}for(var _0x46cdc4='(',_0x205d87=0x0;_0x205d87<_0x4358fe[_0x5019('0x5d')][_0x5019('0x2e')];_0x205d87+=0x1){_0x205d87>0x0&&(_0x46cdc4+='\x20'+_0x4358fe['operator']+'\x20');_0x46cdc4+=_0x4358fe['rules'][_0x205d87][_0x5019('0x5e')]?_0x9884e7(_0x4358fe['rules'][_0x205d87][_0x5019('0x5e')]):_0x4358fe[_0x5019('0x5d')][_0x205d87]['field']+'\x20'+_0x4358fe[_0x5019('0x5d')][_0x205d87][_0x5019('0x5f')]+(_0x1c7d44(_0x4358fe[_0x5019('0x5d')][_0x205d87][_0x5019('0x5f')])?'\x20'+_0x4358fe[_0x5019('0x5d')][_0x205d87][_0x5019('0x60')]:'');}return _0x46cdc4+')';};var _0x5a9d8b={'where':{'id':_0x133a22[_0x5019('0x4b')]['id']}},_0x4399c6,_0x171c3b,_0x5790f0,_0x1ec3f5,_0x528e6;_0x5a9d8b=_[_0x5019('0x39')]({},_0x5a9d8b,_0x133a22[_0x5019('0x61')]);return db[_0x5019('0x25')]['find'](_0x5a9d8b)['then'](function(_0x4e7c66){if(_0x4e7c66){_0x4399c6=_0x4e7c66;return _0x4e7c66[_0x5019('0x62')]();}return null;})[_0x5019('0x1d')](function(_0x3de7f3){if(_0x3de7f3){if(!_0x3de7f3[_0x5019('0x2e')]){throw new db[(_0x5019('0x63'))][(_0x5019('0x64'))](_0x5019('0x65'),0x193);}_0x171c3b=_0x3de7f3;return db[_0x5019('0x66')][_0x5019('0x67')]({'raw':!![]});}return null;})[_0x5019('0x1d')](function(_0x21e610){if(_0x21e610){_0x5790f0=_['keyBy'](_0x21e610,'id');var _0x3c9498;var _0x1aa722=squel['select']();_0x1aa722[_0x5019('0x68')](_0x4399c6[_0x5019('0x69')]);for(var _0xda7725=0x0;_0xda7725<_0x171c3b[_0x5019('0x2e')];_0xda7725+=0x1){_0x3c9498=_0x171c3b[_0xda7725][_0x5019('0x6a')]?_0x5790f0[_0x171c3b[_0xda7725][_0x5019('0x6a')]][_0x5019('0x6b')]:_0x171c3b[_0xda7725][_0x5019('0x38')];_0x3c9498=_0x171c3b[_0xda7725][_0x5019('0x6c')]?_[_0x5019('0x6d')](_0xd9e410[_0x171c3b[_0xda7725][_0x5019('0x6c')]],'%s',_0x3c9498):_0x3c9498;_0x3c9498=_0x171c3b[_0xda7725][_0x5019('0x6e')]?_[_0x5019('0x6d')](_0x149f4d[_0x171c3b[_0xda7725][_0x5019('0x6e')]],'%s',_0x3c9498):_0x3c9498;if(_0x171c3b[_0xda7725][_0x5019('0x6f')]){_0x1aa722['group'](_0x3c9498);}_0x171c3b[_0xda7725][_0x5019('0x70')]&&_0x1aa722[_0x5019('0x30')](_0x3c9498,_0x171c3b[_0xda7725][_0x5019('0x70')]===_0x5019('0x71')?![]:!![]);_0x1aa722[_0x5019('0x38')](_0x3c9498,_0x171c3b[_0xda7725][_0x5019('0x72')]||_0x3c9498);}if(_0x4399c6[_0x5019('0x73')]){_0x4399c6[_0x5019('0x73')]=JSON[_0x5019('0x74')](_0x4399c6['joins']);for(var _0x5d142c=0x0;_0x5d142c<_0x4399c6[_0x5019('0x73')][_0x5019('0x2e')];_0x5d142c+=0x1){if(_0x4399c6[_0x5019('0x73')][_0x5d142c][_0x5019('0x36')]&&_[_0x5019('0x5a')](_0x3c3f11,_0x4399c6[_0x5019('0x73')][_0x5d142c][_0x5019('0x36')])&&_0x4399c6['joins'][_0x5d142c][_0x5019('0x75')]&&_0x4399c6[_0x5019('0x73')][_0x5d142c][_0x5019('0x76')]&&_0x4399c6[_0x5019('0x73')][_0x5d142c][_0x5019('0x77')]){_0x1aa722[_0x4399c6[_0x5019('0x73')][_0x5d142c][_0x5019('0x36')]](_0x4399c6[_0x5019('0x73')][_0x5d142c][_0x5019('0x76')],null,util[_0x5019('0x6e')]('%s.%s\x20=\x20%s.%s',_0x4399c6[_0x5019('0x69')],_0x4399c6['joins'][_0x5d142c][_0x5019('0x75')],_0x4399c6[_0x5019('0x73')][_0x5d142c]['foreignTable'],_0x4399c6[_0x5019('0x73')][_0x5d142c]['foreignKey']));}}}if(_0x4399c6[_0x5019('0x78')]){_0x4399c6[_0x5019('0x78')]=JSON[_0x5019('0x74')](_0x4399c6[_0x5019('0x78')]);_0x1aa722['where'](_0x9884e7(_0x4399c6[_0x5019('0x78')]['group']));}_0x528e6=_0x1aa722[_0x5019('0x79')]();_0x1aa722['limit'](_0x4cf94c);_0x1aa722[_0x5019('0x19')](0x0);logger[_0x5019('0x7a')](_0x5019('0x7b'),_0x1aa722['toString']());return db[_0x5019('0x7c')][_0x5019('0x29')](_0x1aa722['toString'](),{'type':db[_0x5019('0x7c')][_0x5019('0x7d')]['SELECT']});}})[_0x5019('0x1d')](respondWithResult(_0x37e2ab,null))['catch'](handleError(_0x37e2ab,null));};function runReport(_0xbae654,_0x35ad2e,_0x21e09e){var _0x346368=_0x35ad2e[_0x5019('0x22')];var _0x211ca5=0xa;var _0x128b96=[_0x5019('0x7e'),_0x5019('0x4d'),'right_join',_0x5019('0x4f')];var _0x3c3eb0={'SUM':_0x5019('0x7f'),'COUNT':_0x5019('0x50'),'COUNT DISTINCT':_0x5019('0x80'),'MAX':_0x5019('0x81'),'MIN':_0x5019('0x51'),'AVG':_0x5019('0x82'),'GROUP_CONCAT':_0x5019('0x52'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x5019('0x54')};var _0x105a54={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5019('0x56'),'HOUR':_0x5019('0x57'),'ROUND':_0x5019('0x58'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2b7896=function(_0x3e2f15){return!_[_0x5019('0x5a')]([_0x5019('0x5b'),'IS\x20NOT\x20NULL',_0x5019('0x83'),_0x5019('0x84')],_0x3e2f15);};var _0x1c621d=function(_0xc6aaec){if(!_0xc6aaec||!_0xc6aaec[_0x5019('0x5d')][_0x5019('0x2e')]){return'';}for(var _0xe6fc1d='(',_0x200244=0x0;_0x200244<_0xc6aaec['rules'][_0x5019('0x2e')];_0x200244+=0x1){_0x200244>0x0&&(_0xe6fc1d+='\x20'+_0xc6aaec[_0x5019('0x85')]+'\x20');_0xe6fc1d+=_0xc6aaec[_0x5019('0x5d')][_0x200244][_0x5019('0x5e')]?_0x1c621d(_0xc6aaec[_0x5019('0x5d')][_0x200244][_0x5019('0x5e')]):_0xc6aaec[_0x5019('0x5d')][_0x200244][_0x5019('0x38')]+'\x20'+_0xc6aaec[_0x5019('0x5d')][_0x200244][_0x5019('0x5f')]+(_0x2b7896(_0xc6aaec[_0x5019('0x5d')][_0x200244][_0x5019('0x5f')])?'\x20'+_0xc6aaec[_0x5019('0x5d')][_0x200244][_0x5019('0x60')]:'');}return _0xe6fc1d+')';};var _0x54a882={'where':{'id':_0xbae654['id']}},_0x5c1268,_0x5b36f4,_0x3aaffe,_0x4fdfac,_0x5a09ac;_0x54a882=_[_0x5019('0x39')]({},_0x54a882,_0x21e09e);return db[_0x5019('0x25')]['find'](_0x54a882)['then'](function(_0x317d24){if(_0x317d24){_0x5c1268=_0x317d24;return _0x317d24[_0x5019('0x62')]();}return null;})['then'](function(_0x2bfd8d){if(_0x2bfd8d){if(!_0x2bfd8d[_0x5019('0x2e')]){throw new db[(_0x5019('0x63'))][(_0x5019('0x64'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5b36f4=_0x2bfd8d;return db[_0x5019('0x66')][_0x5019('0x67')]({'raw':!![]});}return null;})[_0x5019('0x1d')](function(_0x120c3a){if(_0x120c3a){_0x3aaffe=_[_0x5019('0x86')](_0x120c3a,'id');var _0xbfabc2;var _0x4e45f1=squel[_0x5019('0x87')]();_0x4e45f1['from'](_0x5c1268['table']);for(var _0x581e99=0x0;_0x581e99<_0x5b36f4[_0x5019('0x2e')];_0x581e99+=0x1){_0xbfabc2=_0x5b36f4[_0x581e99][_0x5019('0x6a')]?_0x3aaffe[_0x5b36f4[_0x581e99][_0x5019('0x6a')]]['metric']:_0x5b36f4[_0x581e99]['field'];_0xbfabc2=_0x5b36f4[_0x581e99][_0x5019('0x6c')]?_[_0x5019('0x6d')](_0x3c3eb0[_0x5b36f4[_0x581e99]['function']],'%s',_0xbfabc2):_0xbfabc2;_0xbfabc2=_0x5b36f4[_0x581e99][_0x5019('0x6e')]?_[_0x5019('0x6d')](_0x105a54[_0x5b36f4[_0x581e99][_0x5019('0x6e')]],'%s',_0xbfabc2):_0xbfabc2;if(_0x5b36f4[_0x581e99][_0x5019('0x6f')]){_0x4e45f1[_0x5019('0x5e')](_0xbfabc2);}_0x5b36f4[_0x581e99][_0x5019('0x70')]&&_0x4e45f1[_0x5019('0x30')](_0xbfabc2,_0x5b36f4[_0x581e99][_0x5019('0x70')]==='DESC'?![]:!![]);_0x4e45f1[_0x5019('0x38')](_0xbfabc2,_0x5b36f4[_0x581e99][_0x5019('0x72')]||_0xbfabc2);}if(_0x5c1268[_0x5019('0x73')]){_0x5c1268[_0x5019('0x73')]=JSON[_0x5019('0x74')](_0x5c1268['joins']);for(var _0x409f32=0x0;_0x409f32<_0x5c1268[_0x5019('0x73')][_0x5019('0x2e')];_0x409f32+=0x1){if(_0x5c1268[_0x5019('0x73')][_0x409f32][_0x5019('0x36')]&&_[_0x5019('0x5a')](_0x128b96,_0x5c1268[_0x5019('0x73')][_0x409f32][_0x5019('0x36')])&&_0x5c1268[_0x5019('0x73')][_0x409f32][_0x5019('0x75')]&&_0x5c1268[_0x5019('0x73')][_0x409f32][_0x5019('0x76')]&&_0x5c1268['joins'][_0x409f32][_0x5019('0x77')]){_0x4e45f1[_0x5c1268[_0x5019('0x73')][_0x409f32]['type']](_0x5c1268[_0x5019('0x73')][_0x409f32]['foreignTable'],null,util[_0x5019('0x6e')]('%s.%s\x20=\x20%s.%s',_0x5c1268[_0x5019('0x69')],_0x5c1268['joins'][_0x409f32][_0x5019('0x75')],_0x5c1268[_0x5019('0x73')][_0x409f32][_0x5019('0x76')],_0x5c1268['joins'][_0x409f32]['foreignKey']));}}}if(_0x5c1268['conditions']){_0x5c1268[_0x5019('0x78')]=JSON[_0x5019('0x74')](_0x5c1268[_0x5019('0x78')]);_0x4e45f1[_0x5019('0x34')](_0x1c621d(_0x5c1268[_0x5019('0x78')]['group']));}_0x5a09ac=_0x4e45f1['clone']();_0x4e45f1['limit'](_0x211ca5);_0x4e45f1['offset'](0x0);logger[_0x5019('0x7a')](_0x5019('0x7b'),_0x4e45f1['toString']());return db[_0x5019('0x7c')][_0x5019('0x29')](_0x4e45f1[_0x5019('0x88')](),{'type':db[_0x5019('0x7c')]['QueryTypes'][_0x5019('0x89')]});}})[_0x5019('0x1d')](function(_0x2b6a75){if(!_0x2b6a75[_0x5019('0x2e')]){throw new db['Sequelize'][(_0x5019('0x64'))](_0x5019('0x8a'),0xcc);}if(_0x35ad2e['output']===_0x5019('0x8b')){return null;}var _0x440666=_['merge'](_0x35ad2e,{'name':_0x35ad2e[_0x5019('0x8c')]||_0x35ad2e['name']||_0x5c1268[_0x5019('0x22')],'basename':_0x346368,'savename':util[_0x5019('0x6e')](_0x5019('0x8d'),_0x35ad2e[_0x5019('0x22')]||_0x5c1268[_0x5019('0x22')],require('randomstring')[_0x5019('0x8e')](0x4),_0x35ad2e[_0x5019('0x8f')]||_0x5019('0x90')),'reportId':_0x5c1268['id'],'reportType':_0x5019('0x91')});return db[_0x5019('0x92')][_0x5019('0x40')](_0x440666,{'raw':!![]});})[_0x5019('0x1d')](function(_0x3c4069){if(_0x5c1268['table']===_0x5019('0x93')){_0x5a09ac[_0x5019('0x34')](_0x5c1268[_0x5019('0x69')]+_0x5019('0x94'),_0x35ad2e[_0x5019('0x95')],_0x35ad2e[_0x5019('0x96')]);}else{_0x5a09ac[_0x5019('0x34')](_0x5c1268[_0x5019('0x69')]+_0x5019('0x97'),_0x35ad2e[_0x5019('0x95')],_0x35ad2e[_0x5019('0x96')]);}if(_0x3c4069){logger['info'](_0x5019('0x98'),_0x5a09ac[_0x5019('0x88')]());require('child_process')['fork'](path['join'](__dirname,'../../components/export/',_0x3c4069[_0x5019('0x8f')]),[_0x3c4069['id'],_0x5a09ac['toString'](),path['join'](__dirname,_0x5019('0x99'),_0x3c4069[_0x5019('0x9a')]),_0x346368]);return _0x3c4069;}else{var _0x206bb4=squel[_0x5019('0x87')]();_0x206bb4[_0x5019('0x68')]('('+_0x5a09ac['toString']()+')',_0x5019('0x9b'));_0x206bb4[_0x5019('0x38')](_0x5019('0x9c'),_0x5019('0x18'));_0x5a09ac[_0x5019('0x1a')](_0x35ad2e[_0x5019('0x1a')]||_0x211ca5);_0x5a09ac[_0x5019('0x19')](_0x35ad2e[_0x5019('0x19')]||0x0);return db['sequelize'][_0x5019('0x29')](_0x206bb4[_0x5019('0x88')](),{'type':db[_0x5019('0x7c')][_0x5019('0x7d')][_0x5019('0x89')]})[_0x5019('0x1d')](function(_0xf0e056){if(!_0xf0e056[_0x5019('0x2e')]){_0x4fdfac=0x0;}else{_0x4fdfac=_0xf0e056[0x0][_0x5019('0x18')]||0x0;}return db['sequelize'][_0x5019('0x29')](_0x5a09ac[_0x5019('0x88')](),{'type':db[_0x5019('0x7c')][_0x5019('0x7d')][_0x5019('0x89')]});})['then'](function(_0x1cb7d8){return{'rows':_0x1cb7d8||[],'count':_0x4fdfac};});}});}exports['run']=function(_0x3f66ef,_0x348a8d){return runReport(_0x3f66ef[_0x5019('0x4b')],_0x3f66ef[_0x5019('0x29')],_0x3f66ef['options'])[_0x5019('0x1d')](respondWithResult(_0x348a8d,null))[_0x5019('0x3d')](handleError(_0x348a8d,null));};exports[_0x5019('0x9d')]=runReport;exports[_0x5019('0x29')]=function(_0x3942ba,_0x38059e){var _0x37ba8b=0xa;var _0x16915a=[_0x5019('0x7e'),_0x5019('0x4d'),_0x5019('0x4e'),_0x5019('0x4f')];var _0x1982c5={'SUM':_0x5019('0x7f'),'COUNT':_0x5019('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x5019('0x51'),'AVG':_0x5019('0x82'),'GROUP_CONCAT':_0x5019('0x52'),'GROUP_CONCAT ASC':_0x5019('0x53'),'GROUP_CONCAT DESC':_0x5019('0x54')};var _0x536f40={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x5019('0x58'),'UNIX_TIMESTAMP':_0x5019('0x59')};var _0x55bc72=function(_0xe538fc){return!_[_0x5019('0x5a')](['IS\x20NULL',_0x5019('0x5c'),_0x5019('0x83'),'IS\x20NOT\x20EMPTY'],_0xe538fc);};var _0x26afd3=function(_0x5be3b3){if(!_0x5be3b3||!_0x5be3b3[_0x5019('0x5d')]['length']){return'';}for(var _0x2341e2='(',_0x2d85c3=0x0;_0x2d85c3<_0x5be3b3['rules'][_0x5019('0x2e')];_0x2d85c3+=0x1){_0x2d85c3>0x0&&(_0x2341e2+='\x20'+_0x5be3b3[_0x5019('0x85')]+'\x20');_0x2341e2+=_0x5be3b3['rules'][_0x2d85c3][_0x5019('0x5e')]?_0x26afd3(_0x5be3b3['rules'][_0x2d85c3][_0x5019('0x5e')]):_0x5be3b3[_0x5019('0x5d')][_0x2d85c3]['field']+'\x20'+_0x5be3b3['rules'][_0x2d85c3][_0x5019('0x5f')]+(_0x55bc72(_0x5be3b3[_0x5019('0x5d')][_0x2d85c3][_0x5019('0x5f')])?'\x20'+_0x5be3b3[_0x5019('0x5d')][_0x2d85c3][_0x5019('0x60')]:'');}return _0x2341e2+')';};var _0x4f9f9a={'where':{'id':_0x3942ba[_0x5019('0x4b')]['id']}},_0x44df19,_0x39db79,_0x308f5f,_0x500519,_0x2bfcdc;_0x4f9f9a=_[_0x5019('0x39')]({},_0x4f9f9a,_0x3942ba[_0x5019('0x61')]);return db[_0x5019('0x25')][_0x5019('0x3f')](_0x4f9f9a)[_0x5019('0x1d')](function(_0x2191dd){if(_0x2191dd){_0x44df19=_0x2191dd;return _0x2191dd['getFields']();}return null;})[_0x5019('0x1d')](function(_0x4570d2){if(_0x4570d2){if(!_0x4570d2[_0x5019('0x2e')]){throw new db[(_0x5019('0x63'))]['ValidationErrorItem'](_0x5019('0x65'),0x193);}_0x39db79=_0x4570d2;return db['AnalyticMetric'][_0x5019('0x67')]({'raw':!![]});}return null;})[_0x5019('0x1d')](function(_0xff4500){if(_0xff4500){_0x308f5f=_[_0x5019('0x86')](_0xff4500,'id');var _0x4de699;var _0x94476f=squel[_0x5019('0x87')]();_0x94476f['from'](_0x44df19['table']);for(var _0x47c952=0x0;_0x47c952<_0x39db79[_0x5019('0x2e')];_0x47c952+=0x1){_0x4de699=_0x39db79[_0x47c952][_0x5019('0x6a')]?_0x308f5f[_0x39db79[_0x47c952][_0x5019('0x6a')]]['metric']:_0x39db79[_0x47c952][_0x5019('0x38')];_0x4de699=_0x39db79[_0x47c952]['function']?_[_0x5019('0x6d')](_0x1982c5[_0x39db79[_0x47c952][_0x5019('0x6c')]],'%s',_0x4de699):_0x4de699;_0x4de699=_0x39db79[_0x47c952]['format']?_[_0x5019('0x6d')](_0x536f40[_0x39db79[_0x47c952][_0x5019('0x6e')]],'%s',_0x4de699):_0x4de699;if(_0x39db79[_0x47c952][_0x5019('0x6f')]){_0x94476f['group'](_0x4de699);}_0x39db79[_0x47c952][_0x5019('0x70')]&&_0x94476f[_0x5019('0x30')](_0x4de699,_0x39db79[_0x47c952][_0x5019('0x70')]===_0x5019('0x71')?![]:!![]);_0x94476f[_0x5019('0x38')](_0x4de699,_0x39db79[_0x47c952][_0x5019('0x72')]||_0x4de699);}if(_0x44df19[_0x5019('0x73')]){_0x44df19[_0x5019('0x73')]=JSON[_0x5019('0x74')](_0x44df19[_0x5019('0x73')]);for(var _0x4d0be8=0x0;_0x4d0be8<_0x44df19[_0x5019('0x73')]['length'];_0x4d0be8+=0x1){if(_0x44df19[_0x5019('0x73')][_0x4d0be8]['type']&&_['includes'](_0x16915a,_0x44df19['joins'][_0x4d0be8][_0x5019('0x36')])&&_0x44df19[_0x5019('0x73')][_0x4d0be8]['parentKey']&&_0x44df19[_0x5019('0x73')][_0x4d0be8][_0x5019('0x76')]&&_0x44df19[_0x5019('0x73')][_0x4d0be8][_0x5019('0x77')]){_0x94476f[_0x44df19['joins'][_0x4d0be8][_0x5019('0x36')]](_0x44df19[_0x5019('0x73')][_0x4d0be8][_0x5019('0x76')],null,util[_0x5019('0x6e')](_0x5019('0x9e'),_0x44df19[_0x5019('0x69')],_0x44df19['joins'][_0x4d0be8][_0x5019('0x75')],_0x44df19['joins'][_0x4d0be8]['foreignTable'],_0x44df19[_0x5019('0x73')][_0x4d0be8][_0x5019('0x77')]));}}}if(_0x44df19[_0x5019('0x78')]){_0x44df19['conditions']=JSON[_0x5019('0x74')](_0x44df19[_0x5019('0x78')]);_0x94476f[_0x5019('0x34')](_0x26afd3(_0x44df19[_0x5019('0x78')]['group']));}_0x2bfcdc=_0x94476f[_0x5019('0x79')]();_0x94476f['limit'](_0x37ba8b);_0x94476f['offset'](0x0);logger[_0x5019('0x7a')]('Limited\x20Query:',_0x94476f[_0x5019('0x88')]());return db[_0x5019('0x7c')][_0x5019('0x29')](_0x94476f[_0x5019('0x88')](),{'type':db[_0x5019('0x7c')][_0x5019('0x7d')][_0x5019('0x89')]});}})[_0x5019('0x1d')](function(){return{'sql':_0x2bfcdc[_0x5019('0x88')]()};})[_0x5019('0x1d')](respondWithResult(_0x38059e,null))[_0x5019('0x3d')](handleError(_0x38059e,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index c603be6..4b0bc7a 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 _0x2274=['./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','bluebird','request-promise','path','rimraf'];(function(_0x28007b,_0x145c95){var _0x1a71af=function(_0x132310){while(--_0x132310){_0x28007b['push'](_0x28007b['shift']());}};_0x1a71af(++_0x145c95);}(_0x2274,0xcb));var _0x4227=function(_0x318ef,_0x4cad16){_0x318ef=_0x318ef-0x0;var _0x4429f9=_0x2274[_0x318ef];return _0x4429f9;};'use strict';var _=require(_0x4227('0x0'));var util=require(_0x4227('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4227('0x2'));var rp=require(_0x4227('0x3'));var fs=require('fs');var path=require(_0x4227('0x4'));var rimraf=require(_0x4227('0x5'));var config=require('../../config/environment');var attributes=require(_0x4227('0x6'));module[_0x4227('0x7')]=function(_0x2d5f19,_0x40d4a8){return _0x2d5f19[_0x4227('0x8')](_0x4227('0x9'),attributes,{'tableName':_0x4227('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e97=['rimraf','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','request-promise'];(function(_0x3a37fc,_0x3ae839){var _0x1f028d=function(_0x2b4915){while(--_0x2b4915){_0x3a37fc['push'](_0x3a37fc['shift']());}};_0x1f028d(++_0x3ae839);}(_0x5e97,0xe5));var _0x75e9=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x5e97[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x75e9('0x0'));var util=require('util');var logger=require(_0x75e9('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x75e9('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75e9('0x3'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x75e9('0x4')]=function(_0x160415,_0x2bbc1f){return _0x160415[_0x75e9('0x5')](_0x75e9('0x6'),attributes,{'tableName':_0x75e9('0x7'),'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 14e035d..92748a3 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x576139,_0x4d401d){var _0x3519cc=function(_0x45c718){while(--_0x45c718){_0x576139['push'](_0x576139['shift']());}};_0x3519cc(++_0x4d401d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _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(_0x5df00c,_0xf96970){var _0x551d26=function(_0x3d1ce6){while(--_0x3d1ce6){_0x5df00c['push'](_0x5df00c['shift']());}};_0x551d26(++_0xf96970);}(_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 diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 79bfede..6879d1a 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 _0x1c9a=['express','Router','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','show','preview','/:id/run','run','/:id/query','query','post','create','put','/:id','update','delete','destroy','multer','path'];(function(_0x30952f,_0x1b10c){var _0x2487ff=function(_0x58c562){while(--_0x58c562){_0x30952f['push'](_0x30952f['shift']());}};_0x2487ff(++_0x1b10c);}(_0x1c9a,0x98));var _0xa1c9=function(_0x6fd1b0,_0x2de940){_0x6fd1b0=_0x6fd1b0-0x0;var _0x30fad9=_0x1c9a[_0x6fd1b0];return _0x30fad9;};'use strict';var multer=require(_0xa1c9('0x0'));var util=require('util');var path=require(_0xa1c9('0x1'));var timeout=require('connect-timeout');var express=require(_0xa1c9('0x2'));var router=express[_0xa1c9('0x3')]();var auth=require(_0xa1c9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa1c9('0x5'));var controller=require(_0xa1c9('0x6'));router[_0xa1c9('0x7')]('/',auth[_0xa1c9('0x8')](),controller['index']);router[_0xa1c9('0x7')]('/:id',auth[_0xa1c9('0x8')](),controller[_0xa1c9('0x9')]);router[_0xa1c9('0x7')]('/:id/preview',auth[_0xa1c9('0x8')](),controller[_0xa1c9('0xa')]);router[_0xa1c9('0x7')](_0xa1c9('0xb'),auth['isAuthenticated'](),controller[_0xa1c9('0xc')]);router[_0xa1c9('0x7')](_0xa1c9('0xd'),auth[_0xa1c9('0x8')](),controller[_0xa1c9('0xe')]);router[_0xa1c9('0xf')]('/',auth[_0xa1c9('0x8')](),controller[_0xa1c9('0x10')]);router[_0xa1c9('0x11')](_0xa1c9('0x12'),auth['isAuthenticated'](),controller[_0xa1c9('0x13')]);router[_0xa1c9('0x14')](_0xa1c9('0x12'),auth[_0xa1c9('0x8')](),controller[_0xa1c9('0x15')]);module['exports']=router; \ No newline at end of file +var _0x0abf=['exports','multer','path','connect-timeout','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','/:id/query','query','post','create','put','delete','destroy'];(function(_0x111e94,_0x31c837){var _0x3de107=function(_0x65bd1e){while(--_0x65bd1e){_0x111e94['push'](_0x111e94['shift']());}};_0x3de107(++_0x31c837);}(_0x0abf,0xe8));var _0xf0ab=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0abf[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0xf0ab('0x0'));var util=require('util');var path=require(_0xf0ab('0x1'));var timeout=require(_0xf0ab('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xf0ab('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf0ab('0x4'));var controller=require(_0xf0ab('0x5'));router[_0xf0ab('0x6')]('/',auth[_0xf0ab('0x7')](),controller[_0xf0ab('0x8')]);router[_0xf0ab('0x6')](_0xf0ab('0x9'),auth['isAuthenticated'](),controller[_0xf0ab('0xa')]);router[_0xf0ab('0x6')](_0xf0ab('0xb'),auth[_0xf0ab('0x7')](),controller['preview']);router[_0xf0ab('0x6')](_0xf0ab('0xc'),auth[_0xf0ab('0x7')](),controller['run']);router['get'](_0xf0ab('0xd'),auth['isAuthenticated'](),controller[_0xf0ab('0xe')]);router[_0xf0ab('0xf')]('/',auth[_0xf0ab('0x7')](),controller[_0xf0ab('0x10')]);router[_0xf0ab('0x11')](_0xf0ab('0x9'),auth[_0xf0ab('0x7')](),controller['update']);router[_0xf0ab('0x12')](_0xf0ab('0x9'),auth[_0xf0ab('0x7')](),controller[_0xf0ab('0x13')]);module[_0xf0ab('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index c0bf000..5e0913f 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 _0xc472=['sequelize','exports','STRING','TEXT'];(function(_0x1071d6,_0x293323){var _0x4c6be4=function(_0x43a973){while(--_0x43a973){_0x1071d6['push'](_0x1071d6['shift']());}};_0x4c6be4(++_0x293323);}(_0xc472,0x1d4));var _0x2c47=function(_0x2df387,_0x1d3ea1){_0x2df387=_0x2df387-0x0;var _0x3b1708=_0xc472[_0x2df387];return _0x3b1708;};'use strict';var Sequelize=require(_0x2c47('0x0'));module[_0x2c47('0x1')]={'name':{'type':Sequelize[_0x2c47('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2c47('0x2')]},'parent':{'type':Sequelize[_0x2c47('0x2')]},'table':{'type':Sequelize[_0x2c47('0x2')]},'conditions':{'type':Sequelize[_0x2c47('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xed92=['STRING','TEXT','sequelize','exports'];(function(_0x52daaa,_0x5e9e7e){var _0x5cf871=function(_0x4d12b9){while(--_0x4d12b9){_0x52daaa['push'](_0x52daaa['shift']());}};_0x5cf871(++_0x5e9e7e);}(_0xed92,0x96));var _0x2ed9=function(_0x1bbd1a,_0x476a4f){_0x1bbd1a=_0x1bbd1a-0x0;var _0x52eb91=_0xed92[_0x1bbd1a];return _0x52eb91;};'use strict';var Sequelize=require(_0x2ed9('0x0'));module[_0x2ed9('0x1')]={'name':{'type':Sequelize[_0x2ed9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x2ed9('0x2')]},'conditions':{'type':Sequelize[_0x2ed9('0x3')]},'joins':{'type':Sequelize[_0x2ed9('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index e5bacfa..bae18ba 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 _0x433c=['map','type','key','VIRTUAL','options','count','includeAll','include','rows','catch','show','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_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)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','SELECT','right_join','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','SEC_TO_TIME(%s)','DATE(%s)','IS\x20NOT\x20EMPTY','findAll','keyBy','from','alias','clone','QueryTypes','web','fullPath','%s-%s.%s','generate','output','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','run','runReport','%s.%s\x20=\x20%s.%s','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','AnalyticDefaultReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter'];(function(_0x575246,_0x77ec5d){var _0x223f70=function(_0x349c28){while(--_0x349c28){_0x575246['push'](_0x575246['shift']());}};_0x223f70(++_0x77ec5d);}(_0x433c,0x66));var _0xc433=function(_0x58422c,_0x55903e){_0x58422c=_0x58422c-0x0;var _0x4f4554=_0x433c[_0x58422c];return _0x4f4554;};'use strict';var pdf=require(_0xc433('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc433('0x1'));var zipdir=require(_0xc433('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc433('0x3'));var moment=require(_0xc433('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc433('0x5'));var util=require(_0xc433('0x6'));var path=require(_0xc433('0x7'));var sox=require(_0xc433('0x8'));var csv=require(_0xc433('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc433('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc433('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc433('0x9'));var querystring=require(_0xc433('0xc'));var Papa=require(_0xc433('0xd'));var Redis=require(_0xc433('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc433('0xf'));var hardwareService=require(_0xc433('0x10'));var logger=require(_0xc433('0x11'))(_0xc433('0x12'));var utils=require(_0xc433('0x13'));var config=require('../../config/environment');var db=require(_0xc433('0x14'))['db'];function respondWithStatusCode(_0x1c6f97,_0x3a04a5){_0x3a04a5=_0x3a04a5||0xcc;return function(_0x3191cc){if(_0x3191cc){return _0x1c6f97[_0xc433('0x15')](_0x3a04a5);}return _0x1c6f97[_0xc433('0x16')](_0x3a04a5)[_0xc433('0x17')]();};}function respondWithResult(_0x3cde6d,_0x18e5b5){_0x18e5b5=_0x18e5b5||0xc8;return function(_0x31e621){if(_0x31e621){return _0x3cde6d['status'](_0x18e5b5)[_0xc433('0x18')](_0x31e621);}};}function respondWithFilteredResult(_0x18d78e,_0x2c5240){return function(_0x48f92c){if(_0x48f92c){var _0x45922d=_0x48f92c['count'],_0x576df0=_0x2c5240[_0xc433('0x19')],_0x4c33f8=_0x2c5240[_0xc433('0x19')]+_0x2c5240['limit'],_0x2ae6d1;if(_0x4c33f8>=_0x45922d){_0x4c33f8=_0x45922d;_0x2ae6d1=0xc8;}else{_0x2ae6d1=0xce;}_0x18d78e[_0xc433('0x16')](_0x2ae6d1);return _0x18d78e['set'](_0xc433('0x1a'),_0x576df0+'-'+_0x4c33f8+'/'+_0x45922d)[_0xc433('0x18')](_0x48f92c);}return null;};}function patchUpdates(_0x36a4f3){return function(_0x226f6a){try{jsonpatch[_0xc433('0x1b')](_0x226f6a,_0x36a4f3,!![]);}catch(_0x1e4781){return BPromise[_0xc433('0x1c')](_0x1e4781);}return _0x226f6a[_0xc433('0x1d')]();};}function saveUpdates(_0x573de4,_0x58fe4e){return function(_0xa0d136){if(_0xa0d136){return _0xa0d136['update'](_0x573de4)[_0xc433('0x1e')](function(_0x4f439c){return _0x4f439c;});}return null;};}function removeEntity(_0xea348a,_0x494bb8){return function(_0x1da732){if(_0x1da732){return _0x1da732[_0xc433('0x1f')]()[_0xc433('0x1e')](function(){var _0x4d7225=_0x1da732[_0xc433('0x20')]({'plain':!![]});var _0x5438a8=_0xc433('0x21');return db[_0xc433('0x22')][_0xc433('0x1f')]({'where':{'type':_0x5438a8,'resourceId':_0x4d7225['id']}})['then'](function(){return _0x1da732;});})[_0xc433('0x1e')](function(){_0xea348a[_0xc433('0x16')](0xcc)[_0xc433('0x17')]();});}};}function handleEntityNotFound(_0xd3bfb4,_0x25cfe4){return function(_0x34ef02){if(!_0x34ef02){_0xd3bfb4[_0xc433('0x15')](0x194);}return _0x34ef02;};}function handleError(_0x433f6a,_0xe09e41){_0xe09e41=_0xe09e41||0x1f4;return function(_0xa32c93){logger[_0xc433('0x23')](_0xa32c93[_0xc433('0x24')]);if(_0xa32c93[_0xc433('0x25')]){delete _0xa32c93[_0xc433('0x25')];}_0x433f6a[_0xc433('0x16')](_0xe09e41)['send'](_0xa32c93);};}exports['index']=function(_0x3cabf1,_0x37ecba){var _0x22344a={},_0x140e02={},_0x279e13={'count':0x0,'rows':[]};var _0x348ca5=db[_0xc433('0x26')][_0xc433('0x27')];_0x140e02[_0xc433('0x28')]=_['keys'](_0x348ca5);_0x140e02[_0xc433('0x29')]=_[_0xc433('0x2a')](_0x3cabf1[_0xc433('0x29')]);_0x140e02[_0xc433('0x2b')]=_[_0xc433('0x2c')](_0x140e02[_0xc433('0x28')],_0x140e02[_0xc433('0x29')]);_0x22344a[_0xc433('0x2d')]=_[_0xc433('0x2c')](_0x140e02[_0xc433('0x28')],qs['fields'](_0x3cabf1['query'][_0xc433('0x2e')]));_0x22344a[_0xc433('0x2d')]=_0x22344a[_0xc433('0x2d')][_0xc433('0x2f')]?_0x22344a[_0xc433('0x2d')]:_0x140e02['model'];if(!_0x3cabf1[_0xc433('0x29')][_0xc433('0x30')]('nolimit')){_0x22344a[_0xc433('0x31')]=qs[_0xc433('0x31')](_0x3cabf1[_0xc433('0x29')][_0xc433('0x31')]);_0x22344a[_0xc433('0x19')]=qs[_0xc433('0x19')](_0x3cabf1[_0xc433('0x29')][_0xc433('0x19')]);}_0x22344a[_0xc433('0x32')]=qs['sort'](_0x3cabf1[_0xc433('0x29')][_0xc433('0x33')]);_0x22344a[_0xc433('0x34')]=qs[_0xc433('0x2b')](_['pick'](_0x3cabf1[_0xc433('0x29')],_0x140e02[_0xc433('0x2b')]));if(_0x3cabf1['query'][_0xc433('0x35')]){_0x22344a[_0xc433('0x34')]=_['merge'](_0x22344a[_0xc433('0x34')],{'$or':_[_0xc433('0x36')](_0x348ca5,function(_0x264ea4){if(_0x264ea4[_0xc433('0x37')][_0xc433('0x38')]!==_0xc433('0x39')){var _0x58c42b={};_0x58c42b[_0x264ea4['field']]={'$like':'%'+_0x3cabf1[_0xc433('0x29')][_0xc433('0x35')]+'%'};return _0x58c42b;}})});}_0x22344a=_['merge']({},_0x22344a,_0x3cabf1[_0xc433('0x3a')]);var _0x54cc2e={'where':_0x22344a[_0xc433('0x34')]};return db[_0xc433('0x26')][_0xc433('0x3b')](_0x54cc2e)[_0xc433('0x1e')](function(_0x55e705){_0x279e13[_0xc433('0x3b')]=_0x55e705;if(_0x3cabf1[_0xc433('0x29')][_0xc433('0x3c')]){_0x22344a[_0xc433('0x3d')]=[{'all':!![]}];}return db[_0xc433('0x26')]['findAll'](_0x22344a);})[_0xc433('0x1e')](function(_0x18aac4){_0x279e13[_0xc433('0x3e')]=_0x18aac4;return _0x279e13;})[_0xc433('0x1e')](respondWithFilteredResult(_0x37ecba,_0x22344a))[_0xc433('0x3f')](handleError(_0x37ecba,null));};exports[_0xc433('0x40')]=function(_0x3c7fbd,_0x36d5f3){var _0x2f0ec4={'raw':!![],'where':{'id':_0x3c7fbd['params']['id']}},_0x11a5ca={};_0x11a5ca['model']=_[_0xc433('0x2a')](db[_0xc433('0x26')][_0xc433('0x27')]);_0x11a5ca['query']=_['keys'](_0x3c7fbd['query']);_0x11a5ca['filters']=_[_0xc433('0x2c')](_0x11a5ca[_0xc433('0x28')],_0x11a5ca[_0xc433('0x29')]);_0x2f0ec4[_0xc433('0x2d')]=_[_0xc433('0x2c')](_0x11a5ca['model'],qs[_0xc433('0x2e')](_0x3c7fbd[_0xc433('0x29')]['fields']));_0x2f0ec4[_0xc433('0x2d')]=_0x2f0ec4[_0xc433('0x2d')][_0xc433('0x2f')]?_0x2f0ec4[_0xc433('0x2d')]:_0x11a5ca[_0xc433('0x28')];if(_0x3c7fbd['query'][_0xc433('0x3c')]){_0x2f0ec4[_0xc433('0x3d')]=[{'all':!![]}];}_0x2f0ec4=_[_0xc433('0x41')]({},_0x2f0ec4,_0x3c7fbd['options']);return db[_0xc433('0x26')][_0xc433('0x42')](_0x2f0ec4)['then'](handleEntityNotFound(_0x36d5f3,null))['then'](respondWithResult(_0x36d5f3,null))['catch'](handleError(_0x36d5f3,null));};exports[_0xc433('0x43')]=function(_0x207e39,_0x68ad8){return db[_0xc433('0x26')][_0xc433('0x43')](_0x207e39[_0xc433('0x44')],{})[_0xc433('0x1e')](function(_0x74b4f4){var _0x4d1fe7=_0x207e39[_0xc433('0x45')][_0xc433('0x20')]({'plain':!![]});if(!_0x4d1fe7)throw new Error(_0xc433('0x46'));if(_0x4d1fe7[_0xc433('0x47')]===_0xc433('0x45')){var _0x4d3df0=_0x74b4f4['get']({'plain':!![]});var _0x494913=_0xc433('0x48');return db[_0xc433('0x49')][_0xc433('0x42')]({'where':{'name':_0x494913,'userProfileId':_0x4d1fe7[_0xc433('0x4a')]},'raw':!![]})[_0xc433('0x1e')](function(_0x2cec12){if(_0x2cec12&&_0x2cec12['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4d3df0[_0xc433('0x25')],'resourceId':_0x4d3df0['id'],'type':_0xc433('0x21'),'sectionId':_0x2cec12['id']},{})[_0xc433('0x1e')](function(){return _0x74b4f4;});}else{return _0x74b4f4;}})[_0xc433('0x3f')](function(_0x2b0099){logger[_0xc433('0x23')](_0xc433('0x4b'),_0x2b0099);throw _0x2b0099;});}return _0x74b4f4;})[_0xc433('0x1e')](respondWithResult(_0x68ad8,0xc9))[_0xc433('0x3f')](handleError(_0x68ad8,null));};exports['update']=function(_0x409e79,_0x2bf282){if(_0x409e79['body']['id']){delete _0x409e79[_0xc433('0x44')]['id'];}return db[_0xc433('0x26')][_0xc433('0x42')]({'where':{'id':_0x409e79[_0xc433('0x4c')]['id']}})[_0xc433('0x1e')](handleEntityNotFound(_0x2bf282,null))['then'](saveUpdates(_0x409e79[_0xc433('0x44')],null))[_0xc433('0x1e')](respondWithResult(_0x2bf282,null))[_0xc433('0x3f')](handleError(_0x2bf282,null));};exports['destroy']=function(_0x4dea00,_0x38a958){return db[_0xc433('0x26')][_0xc433('0x42')]({'where':{'id':_0x4dea00[_0xc433('0x4c')]['id']}})[_0xc433('0x1e')](handleEntityNotFound(_0x38a958,null))[_0xc433('0x1e')](removeEntity(_0x38a958,null))['catch'](handleError(_0x38a958,null));};exports['preview']=function(_0x5f369d,_0x4130bf){var _0x46c214=0xa;var _0x4f757e=[_0xc433('0x4d'),_0xc433('0x4e'),'right_join','cross_join'];var _0x1ed87b={'SUM':_0xc433('0x4f'),'COUNT':_0xc433('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc433('0x51'),'MIN':_0xc433('0x52'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xc433('0x53'),'GROUP_CONCAT ASC':_0xc433('0x54'),'GROUP_CONCAT DESC':_0xc433('0x55')};var _0x4d0ba1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xc433('0x56'),'ROUND':_0xc433('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4fac74=function(_0x185f93){return!_[_0xc433('0x58')]([_0xc433('0x59'),_0xc433('0x5a'),_0xc433('0x5b'),'IS\x20NOT\x20EMPTY'],_0x185f93);};var _0x4a3a95=function(_0x14ea35){if(!_0x14ea35||!_0x14ea35[_0xc433('0x5c')]['length']){return'';}for(var _0x422639='(',_0x5a084b=0x0;_0x5a084b<_0x14ea35[_0xc433('0x5c')]['length'];_0x5a084b+=0x1){_0x5a084b>0x0&&(_0x422639+='\x20'+_0x14ea35[_0xc433('0x5d')]+'\x20');_0x422639+=_0x14ea35[_0xc433('0x5c')][_0x5a084b][_0xc433('0x5e')]?_0x4a3a95(_0x14ea35['rules'][_0x5a084b][_0xc433('0x5e')]):_0x14ea35[_0xc433('0x5c')][_0x5a084b][_0xc433('0x5f')]+'\x20'+_0x14ea35[_0xc433('0x5c')][_0x5a084b]['condition']+(_0x4fac74(_0x14ea35[_0xc433('0x5c')][_0x5a084b][_0xc433('0x60')])?'\x20'+_0x14ea35['rules'][_0x5a084b][_0xc433('0x61')]:'');}return _0x422639+')';};var _0x121a08={'where':{'id':_0x5f369d[_0xc433('0x4c')]['id']}},_0xe037f8,_0x150d74,_0x2746ba,_0x1bc09a,_0x4b00d2;_0x121a08=_[_0xc433('0x41')]({},_0x121a08,_0x5f369d[_0xc433('0x3a')]);return db[_0xc433('0x26')][_0xc433('0x42')](_0x121a08)[_0xc433('0x1e')](function(_0x4be192){if(_0x4be192){_0xe037f8=_0x4be192;return _0x4be192[_0xc433('0x62')]();}return null;})[_0xc433('0x1e')](function(_0x1d3934){if(_0x1d3934){if(!_0x1d3934[_0xc433('0x2f')]){throw new db[(_0xc433('0x63'))][(_0xc433('0x64'))](_0xc433('0x65'),0x193);}_0x150d74=_0x1d3934;return db[_0xc433('0x66')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x10eaec){if(_0x10eaec){_0x2746ba=_['keyBy'](_0x10eaec,'id');var _0x3b382c;var _0x335ece=squel[_0xc433('0x67')]();_0x335ece['from'](_0xe037f8[_0xc433('0x68')]);for(var _0x128663=0x0;_0x128663<_0x150d74['length'];_0x128663+=0x1){_0x3b382c=_0x150d74[_0x128663][_0xc433('0x69')]?_0x2746ba[_0x150d74[_0x128663][_0xc433('0x69')]][_0xc433('0x6a')]:_0x150d74[_0x128663]['field'];_0x3b382c=_0x150d74[_0x128663][_0xc433('0x6b')]?_[_0xc433('0x6c')](_0x1ed87b[_0x150d74[_0x128663][_0xc433('0x6b')]],'%s',_0x3b382c):_0x3b382c;_0x3b382c=_0x150d74[_0x128663]['format']?_[_0xc433('0x6c')](_0x4d0ba1[_0x150d74[_0x128663][_0xc433('0x6d')]],'%s',_0x3b382c):_0x3b382c;if(_0x150d74[_0x128663][_0xc433('0x6e')]){_0x335ece[_0xc433('0x5e')](_0x3b382c);}_0x150d74[_0x128663][_0xc433('0x6f')]&&_0x335ece[_0xc433('0x32')](_0x3b382c,_0x150d74[_0x128663][_0xc433('0x6f')]===_0xc433('0x70')?![]:!![]);_0x335ece[_0xc433('0x5f')](_0x3b382c,_0x150d74[_0x128663]['alias']||_0x3b382c);}if(_0xe037f8[_0xc433('0x71')]){_0xe037f8[_0xc433('0x71')]=JSON[_0xc433('0x72')](_0xe037f8[_0xc433('0x71')]);for(var _0x34311b=0x0;_0x34311b<_0xe037f8[_0xc433('0x71')]['length'];_0x34311b+=0x1){if(_0xe037f8['joins'][_0x34311b][_0xc433('0x37')]&&_[_0xc433('0x58')](_0x4f757e,_0xe037f8[_0xc433('0x71')][_0x34311b]['type'])&&_0xe037f8['joins'][_0x34311b][_0xc433('0x73')]&&_0xe037f8[_0xc433('0x71')][_0x34311b][_0xc433('0x74')]&&_0xe037f8[_0xc433('0x71')][_0x34311b]['foreignKey']){_0x335ece[_0xe037f8['joins'][_0x34311b][_0xc433('0x37')]](_0xe037f8[_0xc433('0x71')][_0x34311b][_0xc433('0x74')],null,util[_0xc433('0x6d')]('%s.%s\x20=\x20%s.%s',_0xe037f8[_0xc433('0x68')],_0xe037f8[_0xc433('0x71')][_0x34311b][_0xc433('0x73')],_0xe037f8[_0xc433('0x71')][_0x34311b]['foreignTable'],_0xe037f8['joins'][_0x34311b][_0xc433('0x75')]));}}}if(_0xe037f8[_0xc433('0x76')]){_0xe037f8['conditions']=JSON['parse'](_0xe037f8['conditions']);_0x335ece['where'](_0x4a3a95(_0xe037f8[_0xc433('0x76')][_0xc433('0x5e')]));}_0x4b00d2=_0x335ece['clone']();_0x335ece[_0xc433('0x31')](_0x46c214);_0x335ece['offset'](0x0);logger[_0xc433('0x77')](_0xc433('0x78'),_0x335ece[_0xc433('0x79')]());return db[_0xc433('0x7a')]['query'](_0x335ece[_0xc433('0x79')](),{'type':db[_0xc433('0x7a')]['QueryTypes'][_0xc433('0x7b')]});}})[_0xc433('0x1e')](respondWithResult(_0x4130bf,null))[_0xc433('0x3f')](handleError(_0x4130bf,null));};function runReport(_0xa8cd7d,_0x56e260,_0x385cc5){var _0x273139=_0x56e260[_0xc433('0x25')];var _0x204ff1=0xa;var _0x2d2586=[_0xc433('0x4d'),'left_join',_0xc433('0x7c'),_0xc433('0x7d')];var _0x4d7509={'SUM':_0xc433('0x4f'),'COUNT':_0xc433('0x50'),'COUNT DISTINCT':_0xc433('0x7e'),'MAX':'MAX(%s)','MIN':_0xc433('0x52'),'AVG':_0xc433('0x7f'),'GROUP_CONCAT':_0xc433('0x53'),'GROUP_CONCAT ASC':_0xc433('0x54'),'GROUP_CONCAT DESC':_0xc433('0x55')};var _0x5287e6={'SEC_TO_TIME':_0xc433('0x80'),'DATE':_0xc433('0x81'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x231ea1=function(_0x5729e9){return!_[_0xc433('0x58')]([_0xc433('0x59'),_0xc433('0x5a'),'IS\x20EMPTY',_0xc433('0x82')],_0x5729e9);};var _0x1171c8=function(_0x36aa9e){if(!_0x36aa9e||!_0x36aa9e[_0xc433('0x5c')][_0xc433('0x2f')]){return'';}for(var _0x204941='(',_0x1ce95d=0x0;_0x1ce95d<_0x36aa9e['rules'][_0xc433('0x2f')];_0x1ce95d+=0x1){_0x1ce95d>0x0&&(_0x204941+='\x20'+_0x36aa9e[_0xc433('0x5d')]+'\x20');_0x204941+=_0x36aa9e[_0xc433('0x5c')][_0x1ce95d][_0xc433('0x5e')]?_0x1171c8(_0x36aa9e[_0xc433('0x5c')][_0x1ce95d][_0xc433('0x5e')]):_0x36aa9e['rules'][_0x1ce95d][_0xc433('0x5f')]+'\x20'+_0x36aa9e['rules'][_0x1ce95d][_0xc433('0x60')]+(_0x231ea1(_0x36aa9e[_0xc433('0x5c')][_0x1ce95d]['condition'])?'\x20'+_0x36aa9e[_0xc433('0x5c')][_0x1ce95d][_0xc433('0x61')]:'');}return _0x204941+')';};var _0x31f562={'where':{'id':_0xa8cd7d['id']}},_0x83fa3b,_0xa17205,_0x2c5d21,_0x160d0c,_0x3c3a65;_0x31f562=_['merge']({},_0x31f562,_0x385cc5);return db['AnalyticDefaultReport'][_0xc433('0x42')](_0x31f562)[_0xc433('0x1e')](function(_0x39cf72){if(_0x39cf72){_0x83fa3b=_0x39cf72;return _0x39cf72[_0xc433('0x62')]();}return null;})[_0xc433('0x1e')](function(_0x555d99){if(_0x555d99){if(!_0x555d99[_0xc433('0x2f')]){throw new db[(_0xc433('0x63'))]['ValidationErrorItem'](_0xc433('0x65'),0x193);}_0xa17205=_0x555d99;return db[_0xc433('0x66')][_0xc433('0x83')]({'raw':!![]});}return null;})['then'](function(_0x412f42){if(_0x412f42){_0x2c5d21=_[_0xc433('0x84')](_0x412f42,'id');var _0x38acea;var _0x443223=squel[_0xc433('0x67')]();_0x443223[_0xc433('0x85')](_0x83fa3b[_0xc433('0x68')]);for(var _0x138b72=0x0;_0x138b72<_0xa17205[_0xc433('0x2f')];_0x138b72+=0x1){_0x38acea=_0xa17205[_0x138b72]['MetricId']?_0x2c5d21[_0xa17205[_0x138b72][_0xc433('0x69')]][_0xc433('0x6a')]:_0xa17205[_0x138b72]['field'];_0x38acea=_0xa17205[_0x138b72]['function']?_[_0xc433('0x6c')](_0x4d7509[_0xa17205[_0x138b72]['function']],'%s',_0x38acea):_0x38acea;_0x38acea=_0xa17205[_0x138b72][_0xc433('0x6d')]?_[_0xc433('0x6c')](_0x5287e6[_0xa17205[_0x138b72][_0xc433('0x6d')]],'%s',_0x38acea):_0x38acea;if(_0xa17205[_0x138b72][_0xc433('0x6e')]){_0x443223[_0xc433('0x5e')](_0x38acea);}_0xa17205[_0x138b72]['orderBy']&&_0x443223[_0xc433('0x32')](_0x38acea,_0xa17205[_0x138b72][_0xc433('0x6f')]===_0xc433('0x70')?![]:!![]);_0x443223[_0xc433('0x5f')](_0x38acea,_0xa17205[_0x138b72][_0xc433('0x86')]||_0x38acea);}if(_0x83fa3b['joins']){_0x83fa3b[_0xc433('0x71')]=JSON['parse'](_0x83fa3b[_0xc433('0x71')]);for(var _0x3af232=0x0;_0x3af232<_0x83fa3b['joins']['length'];_0x3af232+=0x1){if(_0x83fa3b['joins'][_0x3af232][_0xc433('0x37')]&&_[_0xc433('0x58')](_0x2d2586,_0x83fa3b[_0xc433('0x71')][_0x3af232]['type'])&&_0x83fa3b['joins'][_0x3af232][_0xc433('0x73')]&&_0x83fa3b['joins'][_0x3af232][_0xc433('0x74')]&&_0x83fa3b[_0xc433('0x71')][_0x3af232][_0xc433('0x75')]){_0x443223[_0x83fa3b['joins'][_0x3af232][_0xc433('0x37')]](_0x83fa3b[_0xc433('0x71')][_0x3af232][_0xc433('0x74')],null,util[_0xc433('0x6d')]('%s.%s\x20=\x20%s.%s',_0x83fa3b[_0xc433('0x68')],_0x83fa3b['joins'][_0x3af232]['parentKey'],_0x83fa3b['joins'][_0x3af232]['foreignTable'],_0x83fa3b[_0xc433('0x71')][_0x3af232][_0xc433('0x75')]));}}}if(_0x83fa3b[_0xc433('0x76')]){_0x83fa3b[_0xc433('0x76')]=JSON[_0xc433('0x72')](_0x83fa3b[_0xc433('0x76')]);_0x443223[_0xc433('0x34')](_0x1171c8(_0x83fa3b['conditions'][_0xc433('0x5e')]));}_0x3c3a65=_0x443223[_0xc433('0x87')]();_0x443223[_0xc433('0x31')](_0x204ff1);_0x443223['offset'](0x0);logger[_0xc433('0x77')](_0xc433('0x78'),_0x443223['toString']());return db[_0xc433('0x7a')][_0xc433('0x29')](_0x443223[_0xc433('0x79')](),{'type':db[_0xc433('0x7a')][_0xc433('0x88')][_0xc433('0x7b')]});}})[_0xc433('0x1e')](function(_0x3af35d){if(!_0x3af35d['length']){throw new db[(_0xc433('0x63'))][(_0xc433('0x64'))]('No\x20available\x20data',0xcc);}if(_0x56e260['output']===_0xc433('0x89')){return null;}var _0x340aa2=_[_0xc433('0x41')](_0x56e260,{'name':_0x56e260[_0xc433('0x8a')]||_0x56e260[_0xc433('0x25')]||_0x83fa3b['name'],'basename':_0x273139,'savename':util[_0xc433('0x6d')](_0xc433('0x8b'),_0x56e260[_0xc433('0x25')]||_0x83fa3b['name'],require('randomstring')[_0xc433('0x8c')](0x4),_0x56e260[_0xc433('0x8d')]||'csv'),'reportId':_0x83fa3b['id'],'reportType':'default'});return db[_0xc433('0x8e')][_0xc433('0x43')](_0x340aa2,{'raw':!![]});})['then'](function(_0x599c30){if(_0x83fa3b[_0xc433('0x68')]===_0xc433('0x8f')){_0x3c3a65['where'](_0x83fa3b[_0xc433('0x68')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x56e260['startDate'],_0x56e260[_0xc433('0x90')]);}else{_0x3c3a65[_0xc433('0x34')](_0x83fa3b[_0xc433('0x68')]+_0xc433('0x91'),_0x56e260[_0xc433('0x92')],_0x56e260[_0xc433('0x90')]);}if(_0x599c30){logger[_0xc433('0x93')](_0xc433('0x94'),_0x3c3a65[_0xc433('0x79')]());require(_0xc433('0x95'))[_0xc433('0x96')](path[_0xc433('0x4d')](__dirname,'../../components/export/',_0x599c30[_0xc433('0x8d')]),[_0x599c30['id'],_0x3c3a65[_0xc433('0x79')](),path[_0xc433('0x4d')](__dirname,_0xc433('0x97'),_0x599c30[_0xc433('0x98')]),_0x273139]);return _0x599c30;}else{var _0x27031a=squel[_0xc433('0x67')]();_0x27031a[_0xc433('0x85')]('('+_0x3c3a65[_0xc433('0x79')]()+')','countTable');_0x27031a[_0xc433('0x5f')]('COUNT(*)',_0xc433('0x3b'));_0x3c3a65[_0xc433('0x31')](_0x56e260[_0xc433('0x31')]||_0x204ff1);_0x3c3a65[_0xc433('0x19')](_0x56e260[_0xc433('0x19')]||0x0);return db[_0xc433('0x7a')][_0xc433('0x29')](_0x27031a[_0xc433('0x79')](),{'type':db[_0xc433('0x7a')][_0xc433('0x88')][_0xc433('0x7b')]})[_0xc433('0x1e')](function(_0x53a9ba){if(!_0x53a9ba['length']){_0x160d0c=0x0;}else{_0x160d0c=_0x53a9ba[0x0][_0xc433('0x3b')]||0x0;}return db[_0xc433('0x7a')][_0xc433('0x29')](_0x3c3a65['toString'](),{'type':db[_0xc433('0x7a')]['QueryTypes']['SELECT']});})['then'](function(_0x21b6ac){return{'rows':_0x21b6ac||[],'count':_0x160d0c};});}});}exports[_0xc433('0x99')]=function(_0x3d8256,_0x968bee){return runReport(_0x3d8256[_0xc433('0x4c')],_0x3d8256[_0xc433('0x29')],_0x3d8256[_0xc433('0x3a')])[_0xc433('0x1e')](respondWithResult(_0x968bee,null))[_0xc433('0x3f')](handleError(_0x968bee,null));};exports[_0xc433('0x9a')]=runReport;exports['query']=function(_0x57b559,_0x278888){var _0x2dff01=0xa;var _0x5ea094=[_0xc433('0x4d'),_0xc433('0x4e'),_0xc433('0x7c'),_0xc433('0x7d')];var _0x56fdae={'SUM':_0xc433('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc433('0x7e'),'MAX':_0xc433('0x51'),'MIN':'MIN(%s)','AVG':_0xc433('0x7f'),'GROUP_CONCAT':_0xc433('0x53'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc433('0x55')};var _0x146dff={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xc433('0x81'),'HOUR':_0xc433('0x56'),'ROUND':_0xc433('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1f1ec3=function(_0x55ec5c){return!_[_0xc433('0x58')]([_0xc433('0x59'),_0xc433('0x5a'),'IS\x20EMPTY',_0xc433('0x82')],_0x55ec5c);};var _0x7a9d8b=function(_0x34922f){if(!_0x34922f||!_0x34922f[_0xc433('0x5c')]['length']){return'';}for(var _0x4375f0='(',_0x2264f1=0x0;_0x2264f1<_0x34922f['rules'][_0xc433('0x2f')];_0x2264f1+=0x1){_0x2264f1>0x0&&(_0x4375f0+='\x20'+_0x34922f[_0xc433('0x5d')]+'\x20');_0x4375f0+=_0x34922f['rules'][_0x2264f1][_0xc433('0x5e')]?_0x7a9d8b(_0x34922f['rules'][_0x2264f1][_0xc433('0x5e')]):_0x34922f[_0xc433('0x5c')][_0x2264f1][_0xc433('0x5f')]+'\x20'+_0x34922f[_0xc433('0x5c')][_0x2264f1][_0xc433('0x60')]+(_0x1f1ec3(_0x34922f[_0xc433('0x5c')][_0x2264f1][_0xc433('0x60')])?'\x20'+_0x34922f[_0xc433('0x5c')][_0x2264f1][_0xc433('0x61')]:'');}return _0x4375f0+')';};var _0x4cb8c0={'where':{'id':_0x57b559[_0xc433('0x4c')]['id']}},_0x486409,_0x47d063,_0x1fb457,_0x8d4a46,_0x7a357c;_0x4cb8c0=_[_0xc433('0x41')]({},_0x4cb8c0,_0x57b559[_0xc433('0x3a')]);return db['AnalyticDefaultReport'][_0xc433('0x42')](_0x4cb8c0)[_0xc433('0x1e')](function(_0x24ee0a){if(_0x24ee0a){_0x486409=_0x24ee0a;return _0x24ee0a['getFields']();}return null;})[_0xc433('0x1e')](function(_0x20ed90){if(_0x20ed90){if(!_0x20ed90[_0xc433('0x2f')]){throw new db['Sequelize'][(_0xc433('0x64'))](_0xc433('0x65'),0x193);}_0x47d063=_0x20ed90;return db[_0xc433('0x66')][_0xc433('0x83')]({'raw':!![]});}return null;})[_0xc433('0x1e')](function(_0x43a67b){if(_0x43a67b){_0x1fb457=_[_0xc433('0x84')](_0x43a67b,'id');var _0x2d4415;var _0x54a492=squel[_0xc433('0x67')]();_0x54a492[_0xc433('0x85')](_0x486409['table']);for(var _0x5f73da=0x0;_0x5f73da<_0x47d063[_0xc433('0x2f')];_0x5f73da+=0x1){_0x2d4415=_0x47d063[_0x5f73da][_0xc433('0x69')]?_0x1fb457[_0x47d063[_0x5f73da]['MetricId']][_0xc433('0x6a')]:_0x47d063[_0x5f73da][_0xc433('0x5f')];_0x2d4415=_0x47d063[_0x5f73da][_0xc433('0x6b')]?_[_0xc433('0x6c')](_0x56fdae[_0x47d063[_0x5f73da][_0xc433('0x6b')]],'%s',_0x2d4415):_0x2d4415;_0x2d4415=_0x47d063[_0x5f73da][_0xc433('0x6d')]?_[_0xc433('0x6c')](_0x146dff[_0x47d063[_0x5f73da]['format']],'%s',_0x2d4415):_0x2d4415;if(_0x47d063[_0x5f73da][_0xc433('0x6e')]){_0x54a492['group'](_0x2d4415);}_0x47d063[_0x5f73da][_0xc433('0x6f')]&&_0x54a492[_0xc433('0x32')](_0x2d4415,_0x47d063[_0x5f73da][_0xc433('0x6f')]==='DESC'?![]:!![]);_0x54a492[_0xc433('0x5f')](_0x2d4415,_0x47d063[_0x5f73da][_0xc433('0x86')]||_0x2d4415);}if(_0x486409['joins']){_0x486409[_0xc433('0x71')]=JSON['parse'](_0x486409['joins']);for(var _0x21ef28=0x0;_0x21ef28<_0x486409[_0xc433('0x71')][_0xc433('0x2f')];_0x21ef28+=0x1){if(_0x486409[_0xc433('0x71')][_0x21ef28][_0xc433('0x37')]&&_[_0xc433('0x58')](_0x5ea094,_0x486409[_0xc433('0x71')][_0x21ef28][_0xc433('0x37')])&&_0x486409[_0xc433('0x71')][_0x21ef28]['parentKey']&&_0x486409[_0xc433('0x71')][_0x21ef28][_0xc433('0x74')]&&_0x486409['joins'][_0x21ef28][_0xc433('0x75')]){_0x54a492[_0x486409[_0xc433('0x71')][_0x21ef28]['type']](_0x486409[_0xc433('0x71')][_0x21ef28]['foreignTable'],null,util[_0xc433('0x6d')](_0xc433('0x9b'),_0x486409[_0xc433('0x68')],_0x486409['joins'][_0x21ef28][_0xc433('0x73')],_0x486409[_0xc433('0x71')][_0x21ef28][_0xc433('0x74')],_0x486409[_0xc433('0x71')][_0x21ef28][_0xc433('0x75')]));}}}if(_0x486409['conditions']){_0x486409['conditions']=JSON[_0xc433('0x72')](_0x486409[_0xc433('0x76')]);_0x54a492[_0xc433('0x34')](_0x7a9d8b(_0x486409[_0xc433('0x76')]['group']));}_0x7a357c=_0x54a492[_0xc433('0x87')]();_0x54a492[_0xc433('0x31')](_0x2dff01);_0x54a492[_0xc433('0x19')](0x0);logger['debug'](_0xc433('0x78'),_0x54a492[_0xc433('0x79')]());return db[_0xc433('0x7a')][_0xc433('0x29')](_0x54a492[_0xc433('0x79')](),{'type':db[_0xc433('0x7a')][_0xc433('0x88')][_0xc433('0x7b')]});}})[_0xc433('0x1e')](function(){return{'sql':_0x7a357c[_0xc433('0x79')]()};})[_0xc433('0x1e')](respondWithResult(_0x278888,null))['catch'](handleError(_0x278888,null));}; \ No newline at end of file +var _0x011a=['map','type','key','field','options','AnalyticDefaultReport','includeAll','include','catch','show','params','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','autoAssociation','preview','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\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','MetricId','metric','function','replace','format','orderBy','order','DESC','alias','joins','parentKey','table','foreignTable','foreignKey','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','join','AVG(%s)','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20NOT\x20NULL','Sequelize','from','%s.%s\x20=\x20%s.%s','clone','debug','SELECT','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','end','error','name','send','index','rawAttributes','model','keys','query','filters','fields','attributes','length','nolimit','sort','where','pick','filter','merge'];(function(_0x4d089c,_0x74bc49){var _0x4b7678=function(_0x188b99){while(--_0x188b99){_0x4d089c['push'](_0x4d089c['shift']());}};_0x4b7678(++_0x74bc49);}(_0x011a,0x1b2));var _0xa011=function(_0x3399bb,_0x5e7c53){_0x3399bb=_0x3399bb-0x0;var _0x1afd51=_0x011a[_0x3399bb];return _0x1afd51;};'use strict';var pdf=require(_0xa011('0x0'));var emlformat=require(_0xa011('0x1'));var rimraf=require(_0xa011('0x2'));var zipdir=require(_0xa011('0x3'));var jsonpatch=require(_0xa011('0x4'));var rp=require(_0xa011('0x5'));var moment=require('moment');var BPromise=require(_0xa011('0x6'));var Mustache=require(_0xa011('0x7'));var util=require(_0xa011('0x8'));var path=require(_0xa011('0x9'));var sox=require(_0xa011('0xa'));var csv=require(_0xa011('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa011('0xc'));var squel=require(_0xa011('0xd'));var crypto=require(_0xa011('0xe'));var jsforce=require(_0xa011('0xf'));var deskjs=require(_0xa011('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa011('0x11'));var Papa=require(_0xa011('0x12'));var Redis=require(_0xa011('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xa011('0x14'));var logger=require(_0xa011('0x15'))(_0xa011('0x16'));var utils=require(_0xa011('0x17'));var config=require(_0xa011('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x521dda,_0x1070b5){_0x1070b5=_0x1070b5||0xcc;return function(_0x52abda){if(_0x52abda){return _0x521dda[_0xa011('0x19')](_0x1070b5);}return _0x521dda[_0xa011('0x1a')](_0x1070b5)['end']();};}function respondWithResult(_0x3cd8b2,_0xb7d96a){_0xb7d96a=_0xb7d96a||0xc8;return function(_0x1daca4){if(_0x1daca4){return _0x3cd8b2[_0xa011('0x1a')](_0xb7d96a)[_0xa011('0x1b')](_0x1daca4);}};}function respondWithFilteredResult(_0x1dead8,_0x3e018b){return function(_0x515882){if(_0x515882){var _0xbe9300=_0x515882[_0xa011('0x1c')],_0x4bd0c5=_0x3e018b[_0xa011('0x1d')],_0x5c48df=_0x3e018b[_0xa011('0x1d')]+_0x3e018b[_0xa011('0x1e')],_0x2b0b5c;if(_0x5c48df>=_0xbe9300){_0x5c48df=_0xbe9300;_0x2b0b5c=0xc8;}else{_0x2b0b5c=0xce;}_0x1dead8[_0xa011('0x1a')](_0x2b0b5c);return _0x1dead8[_0xa011('0x1f')](_0xa011('0x20'),_0x4bd0c5+'-'+_0x5c48df+'/'+_0xbe9300)[_0xa011('0x1b')](_0x515882);}return null;};}function patchUpdates(_0x51a2b2){return function(_0xe4b554){try{jsonpatch[_0xa011('0x21')](_0xe4b554,_0x51a2b2,!![]);}catch(_0x31895d){return BPromise[_0xa011('0x22')](_0x31895d);}return _0xe4b554[_0xa011('0x23')]();};}function saveUpdates(_0x3cbeee,_0x1bf2c5){return function(_0x2cf3f9){if(_0x2cf3f9){return _0x2cf3f9[_0xa011('0x24')](_0x3cbeee)[_0xa011('0x25')](function(_0x3c8dff){return _0x3c8dff;});}return null;};}function removeEntity(_0x2fc5a9,_0x218838){return function(_0x47ca3f){if(_0x47ca3f){return _0x47ca3f[_0xa011('0x26')]()['then'](function(){var _0x3e92e6=_0x47ca3f[_0xa011('0x27')]({'plain':!![]});var _0x424b57=_0xa011('0x28');return db[_0xa011('0x29')][_0xa011('0x26')]({'where':{'type':_0x424b57,'resourceId':_0x3e92e6['id']}})[_0xa011('0x25')](function(){return _0x47ca3f;});})[_0xa011('0x25')](function(){_0x2fc5a9[_0xa011('0x1a')](0xcc)[_0xa011('0x2a')]();});}};}function handleEntityNotFound(_0x1bbd5a,_0x52768f){return function(_0x59b271){if(!_0x59b271){_0x1bbd5a['sendStatus'](0x194);}return _0x59b271;};}function handleError(_0x2ccbe3,_0x311ea8){_0x311ea8=_0x311ea8||0x1f4;return function(_0x44f938){logger[_0xa011('0x2b')](_0x44f938['stack']);if(_0x44f938['name']){delete _0x44f938[_0xa011('0x2c')];}_0x2ccbe3[_0xa011('0x1a')](_0x311ea8)[_0xa011('0x2d')](_0x44f938);};}exports[_0xa011('0x2e')]=function(_0x4d8bd1,_0x3af09f){var _0xd23f70={},_0x4cc8ca={},_0x28db4d={'count':0x0,'rows':[]};var _0xaa0d76=db['AnalyticDefaultReport'][_0xa011('0x2f')];_0x4cc8ca[_0xa011('0x30')]=_[_0xa011('0x31')](_0xaa0d76);_0x4cc8ca[_0xa011('0x32')]=_[_0xa011('0x31')](_0x4d8bd1[_0xa011('0x32')]);_0x4cc8ca[_0xa011('0x33')]=_['intersection'](_0x4cc8ca[_0xa011('0x30')],_0x4cc8ca['query']);_0xd23f70['attributes']=_['intersection'](_0x4cc8ca[_0xa011('0x30')],qs[_0xa011('0x34')](_0x4d8bd1[_0xa011('0x32')]['fields']));_0xd23f70[_0xa011('0x35')]=_0xd23f70[_0xa011('0x35')][_0xa011('0x36')]?_0xd23f70[_0xa011('0x35')]:_0x4cc8ca['model'];if(!_0x4d8bd1[_0xa011('0x32')]['hasOwnProperty'](_0xa011('0x37'))){_0xd23f70[_0xa011('0x1e')]=qs[_0xa011('0x1e')](_0x4d8bd1[_0xa011('0x32')][_0xa011('0x1e')]);_0xd23f70['offset']=qs['offset'](_0x4d8bd1[_0xa011('0x32')][_0xa011('0x1d')]);}_0xd23f70['order']=qs[_0xa011('0x38')](_0x4d8bd1['query']['sort']);_0xd23f70[_0xa011('0x39')]=qs[_0xa011('0x33')](_[_0xa011('0x3a')](_0x4d8bd1['query'],_0x4cc8ca[_0xa011('0x33')]));if(_0x4d8bd1[_0xa011('0x32')][_0xa011('0x3b')]){_0xd23f70['where']=_[_0xa011('0x3c')](_0xd23f70[_0xa011('0x39')],{'$or':_[_0xa011('0x3d')](_0xaa0d76,function(_0xff1269){if(_0xff1269[_0xa011('0x3e')][_0xa011('0x3f')]!=='VIRTUAL'){var _0x1d6864={};_0x1d6864[_0xff1269[_0xa011('0x40')]]={'$like':'%'+_0x4d8bd1[_0xa011('0x32')][_0xa011('0x3b')]+'%'};return _0x1d6864;}})});}_0xd23f70=_[_0xa011('0x3c')]({},_0xd23f70,_0x4d8bd1[_0xa011('0x41')]);var _0x2d9f7f={'where':_0xd23f70['where']};return db[_0xa011('0x42')][_0xa011('0x1c')](_0x2d9f7f)[_0xa011('0x25')](function(_0x3c9612){_0x28db4d['count']=_0x3c9612;if(_0x4d8bd1[_0xa011('0x32')][_0xa011('0x43')]){_0xd23f70[_0xa011('0x44')]=[{'all':!![]}];}return db[_0xa011('0x42')]['findAll'](_0xd23f70);})[_0xa011('0x25')](function(_0x22a169){_0x28db4d['rows']=_0x22a169;return _0x28db4d;})[_0xa011('0x25')](respondWithFilteredResult(_0x3af09f,_0xd23f70))[_0xa011('0x45')](handleError(_0x3af09f,null));};exports[_0xa011('0x46')]=function(_0x4cd9c4,_0x5b5882){var _0x54a9d7={'raw':!![],'where':{'id':_0x4cd9c4[_0xa011('0x47')]['id']}},_0x347592={};_0x347592[_0xa011('0x30')]=_[_0xa011('0x31')](db[_0xa011('0x42')][_0xa011('0x2f')]);_0x347592['query']=_[_0xa011('0x31')](_0x4cd9c4[_0xa011('0x32')]);_0x347592[_0xa011('0x33')]=_[_0xa011('0x48')](_0x347592['model'],_0x347592[_0xa011('0x32')]);_0x54a9d7[_0xa011('0x35')]=_['intersection'](_0x347592[_0xa011('0x30')],qs[_0xa011('0x34')](_0x4cd9c4['query'][_0xa011('0x34')]));_0x54a9d7[_0xa011('0x35')]=_0x54a9d7[_0xa011('0x35')][_0xa011('0x36')]?_0x54a9d7[_0xa011('0x35')]:_0x347592[_0xa011('0x30')];if(_0x4cd9c4['query'][_0xa011('0x43')]){_0x54a9d7[_0xa011('0x44')]=[{'all':!![]}];}_0x54a9d7=_[_0xa011('0x3c')]({},_0x54a9d7,_0x4cd9c4[_0xa011('0x41')]);return db[_0xa011('0x42')]['find'](_0x54a9d7)['then'](handleEntityNotFound(_0x5b5882,null))['then'](respondWithResult(_0x5b5882,null))['catch'](handleError(_0x5b5882,null));};exports[_0xa011('0x49')]=function(_0x2b28d9,_0x28e9a8){return db[_0xa011('0x42')][_0xa011('0x49')](_0x2b28d9[_0xa011('0x4a')],{})[_0xa011('0x25')](function(_0x4f7cc8){var _0x4aae33=_0x2b28d9[_0xa011('0x4b')][_0xa011('0x27')]({'plain':!![]});if(!_0x4aae33)throw new Error(_0xa011('0x4c'));if(_0x4aae33['role']===_0xa011('0x4b')){var _0xd255b3=_0x4f7cc8[_0xa011('0x27')]({'plain':!![]});var _0xa3485b=_0xa011('0x4d');return db[_0xa011('0x4e')][_0xa011('0x4f')]({'where':{'name':_0xa3485b,'userProfileId':_0x4aae33[_0xa011('0x50')]},'raw':!![]})[_0xa011('0x25')](function(_0x569eef){if(_0x569eef&&_0x569eef[_0xa011('0x51')]===0x0){return db[_0xa011('0x29')][_0xa011('0x49')]({'name':_0xd255b3[_0xa011('0x2c')],'resourceId':_0xd255b3['id'],'type':_0xa011('0x28'),'sectionId':_0x569eef['id']},{})[_0xa011('0x25')](function(){return _0x4f7cc8;});}else{return _0x4f7cc8;}})[_0xa011('0x45')](function(_0x15b5ea){logger[_0xa011('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15b5ea);throw _0x15b5ea;});}return _0x4f7cc8;})['then'](respondWithResult(_0x28e9a8,0xc9))[_0xa011('0x45')](handleError(_0x28e9a8,null));};exports[_0xa011('0x24')]=function(_0xaa108b,_0x278ee2){if(_0xaa108b['body']['id']){delete _0xaa108b[_0xa011('0x4a')]['id'];}return db[_0xa011('0x42')][_0xa011('0x4f')]({'where':{'id':_0xaa108b[_0xa011('0x47')]['id']}})[_0xa011('0x25')](handleEntityNotFound(_0x278ee2,null))[_0xa011('0x25')](saveUpdates(_0xaa108b['body'],null))[_0xa011('0x25')](respondWithResult(_0x278ee2,null))[_0xa011('0x45')](handleError(_0x278ee2,null));};exports[_0xa011('0x26')]=function(_0x273ef3,_0x5b018a){return db[_0xa011('0x42')][_0xa011('0x4f')]({'where':{'id':_0x273ef3[_0xa011('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b018a,null))[_0xa011('0x25')](removeEntity(_0x5b018a,null))[_0xa011('0x45')](handleError(_0x5b018a,null));};exports[_0xa011('0x52')]=function(_0x36e767,_0x43d33f){var _0x192a8a=0xa;var _0x2980c5=['join',_0xa011('0x53'),_0xa011('0x54'),_0xa011('0x55')];var _0x426862={'SUM':_0xa011('0x56'),'COUNT':_0xa011('0x57'),'COUNT DISTINCT':_0xa011('0x58'),'MAX':_0xa011('0x59'),'MIN':_0xa011('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xa011('0x5b'),'GROUP_CONCAT ASC':_0xa011('0x5c'),'GROUP_CONCAT DESC':_0xa011('0x5d')};var _0x5f5a6a={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa011('0x5e'),'HOUR':_0xa011('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xa011('0x60')};var _0x3ec32f=function(_0x1155a9){return!_[_0xa011('0x61')]([_0xa011('0x62'),'IS\x20NOT\x20NULL',_0xa011('0x63'),_0xa011('0x64')],_0x1155a9);};var _0x466545=function(_0x70fe9e){if(!_0x70fe9e||!_0x70fe9e[_0xa011('0x65')]['length']){return'';}for(var _0x15280f='(',_0x332263=0x0;_0x332263<_0x70fe9e[_0xa011('0x65')][_0xa011('0x36')];_0x332263+=0x1){_0x332263>0x0&&(_0x15280f+='\x20'+_0x70fe9e[_0xa011('0x66')]+'\x20');_0x15280f+=_0x70fe9e[_0xa011('0x65')][_0x332263][_0xa011('0x67')]?_0x466545(_0x70fe9e[_0xa011('0x65')][_0x332263][_0xa011('0x67')]):_0x70fe9e[_0xa011('0x65')][_0x332263][_0xa011('0x40')]+'\x20'+_0x70fe9e[_0xa011('0x65')][_0x332263][_0xa011('0x68')]+(_0x3ec32f(_0x70fe9e[_0xa011('0x65')][_0x332263][_0xa011('0x68')])?'\x20'+_0x70fe9e[_0xa011('0x65')][_0x332263][_0xa011('0x69')]:'');}return _0x15280f+')';};var _0x45d7e5={'where':{'id':_0x36e767[_0xa011('0x47')]['id']}},_0x4c7b73,_0x54c396,_0x4877c4,_0x38e47b,_0x132e7b;_0x45d7e5=_[_0xa011('0x3c')]({},_0x45d7e5,_0x36e767[_0xa011('0x41')]);return db[_0xa011('0x42')][_0xa011('0x4f')](_0x45d7e5)['then'](function(_0x208f43){if(_0x208f43){_0x4c7b73=_0x208f43;return _0x208f43[_0xa011('0x6a')]();}return null;})[_0xa011('0x25')](function(_0x49c001){if(_0x49c001){if(!_0x49c001[_0xa011('0x36')]){throw new db['Sequelize'][(_0xa011('0x6b'))](_0xa011('0x6c'),0x193);}_0x54c396=_0x49c001;return db[_0xa011('0x6d')][_0xa011('0x6e')]({'raw':!![]});}return null;})[_0xa011('0x25')](function(_0xf1b52d){if(_0xf1b52d){_0x4877c4=_[_0xa011('0x6f')](_0xf1b52d,'id');var _0x394ce3;var _0x145dc5=squel[_0xa011('0x70')]();_0x145dc5['from'](_0x4c7b73['table']);for(var _0xa3a185=0x0;_0xa3a185<_0x54c396[_0xa011('0x36')];_0xa3a185+=0x1){_0x394ce3=_0x54c396[_0xa3a185]['MetricId']?_0x4877c4[_0x54c396[_0xa3a185][_0xa011('0x71')]][_0xa011('0x72')]:_0x54c396[_0xa3a185]['field'];_0x394ce3=_0x54c396[_0xa3a185][_0xa011('0x73')]?_[_0xa011('0x74')](_0x426862[_0x54c396[_0xa3a185][_0xa011('0x73')]],'%s',_0x394ce3):_0x394ce3;_0x394ce3=_0x54c396[_0xa3a185][_0xa011('0x75')]?_[_0xa011('0x74')](_0x5f5a6a[_0x54c396[_0xa3a185][_0xa011('0x75')]],'%s',_0x394ce3):_0x394ce3;if(_0x54c396[_0xa3a185]['groupBy']){_0x145dc5[_0xa011('0x67')](_0x394ce3);}_0x54c396[_0xa3a185][_0xa011('0x76')]&&_0x145dc5[_0xa011('0x77')](_0x394ce3,_0x54c396[_0xa3a185][_0xa011('0x76')]===_0xa011('0x78')?![]:!![]);_0x145dc5[_0xa011('0x40')](_0x394ce3,_0x54c396[_0xa3a185][_0xa011('0x79')]||_0x394ce3);}if(_0x4c7b73[_0xa011('0x7a')]){_0x4c7b73[_0xa011('0x7a')]=JSON['parse'](_0x4c7b73[_0xa011('0x7a')]);for(var _0x4b59d9=0x0;_0x4b59d9<_0x4c7b73[_0xa011('0x7a')]['length'];_0x4b59d9+=0x1){if(_0x4c7b73['joins'][_0x4b59d9][_0xa011('0x3e')]&&_[_0xa011('0x61')](_0x2980c5,_0x4c7b73['joins'][_0x4b59d9]['type'])&&_0x4c7b73[_0xa011('0x7a')][_0x4b59d9][_0xa011('0x7b')]&&_0x4c7b73['joins'][_0x4b59d9]['foreignTable']&&_0x4c7b73[_0xa011('0x7a')][_0x4b59d9]['foreignKey']){_0x145dc5[_0x4c7b73[_0xa011('0x7a')][_0x4b59d9]['type']](_0x4c7b73[_0xa011('0x7a')][_0x4b59d9]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4c7b73[_0xa011('0x7c')],_0x4c7b73[_0xa011('0x7a')][_0x4b59d9][_0xa011('0x7b')],_0x4c7b73['joins'][_0x4b59d9][_0xa011('0x7d')],_0x4c7b73['joins'][_0x4b59d9][_0xa011('0x7e')]));}}}if(_0x4c7b73[_0xa011('0x7f')]){_0x4c7b73[_0xa011('0x7f')]=JSON[_0xa011('0x80')](_0x4c7b73[_0xa011('0x7f')]);_0x145dc5[_0xa011('0x39')](_0x466545(_0x4c7b73[_0xa011('0x7f')][_0xa011('0x67')]));}_0x132e7b=_0x145dc5['clone']();_0x145dc5[_0xa011('0x1e')](_0x192a8a);_0x145dc5[_0xa011('0x1d')](0x0);logger['debug'](_0xa011('0x81'),_0x145dc5[_0xa011('0x82')]());return db[_0xa011('0x83')][_0xa011('0x32')](_0x145dc5[_0xa011('0x82')](),{'type':db['sequelize'][_0xa011('0x84')]['SELECT']});}})[_0xa011('0x25')](respondWithResult(_0x43d33f,null))['catch'](handleError(_0x43d33f,null));};function runReport(_0x2dc58f,_0x1a3d87,_0x32a2b5){var _0x5df34c=_0x1a3d87[_0xa011('0x2c')];var _0xe5cea5=0xa;var _0x1afa8b=[_0xa011('0x85'),_0xa011('0x53'),_0xa011('0x54'),'cross_join'];var _0x56923b={'SUM':_0xa011('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xa011('0x58'),'MAX':_0xa011('0x59'),'MIN':_0xa011('0x5a'),'AVG':_0xa011('0x86'),'GROUP_CONCAT':_0xa011('0x5b'),'GROUP_CONCAT ASC':_0xa011('0x5c'),'GROUP_CONCAT DESC':_0xa011('0x5d')};var _0x195b51={'SEC_TO_TIME':_0xa011('0x87'),'DATE':_0xa011('0x5e'),'HOUR':_0xa011('0x5f'),'ROUND':_0xa011('0x88'),'UNIX_TIMESTAMP':_0xa011('0x60')};var _0x550706=function(_0x2309e2){return!_[_0xa011('0x61')]([_0xa011('0x62'),_0xa011('0x89'),_0xa011('0x63'),_0xa011('0x64')],_0x2309e2);};var _0x3e4017=function(_0xad596d){if(!_0xad596d||!_0xad596d[_0xa011('0x65')]['length']){return'';}for(var _0xd34c16='(',_0x4c87c3=0x0;_0x4c87c3<_0xad596d[_0xa011('0x65')][_0xa011('0x36')];_0x4c87c3+=0x1){_0x4c87c3>0x0&&(_0xd34c16+='\x20'+_0xad596d['operator']+'\x20');_0xd34c16+=_0xad596d[_0xa011('0x65')][_0x4c87c3][_0xa011('0x67')]?_0x3e4017(_0xad596d[_0xa011('0x65')][_0x4c87c3][_0xa011('0x67')]):_0xad596d[_0xa011('0x65')][_0x4c87c3][_0xa011('0x40')]+'\x20'+_0xad596d[_0xa011('0x65')][_0x4c87c3][_0xa011('0x68')]+(_0x550706(_0xad596d['rules'][_0x4c87c3][_0xa011('0x68')])?'\x20'+_0xad596d[_0xa011('0x65')][_0x4c87c3][_0xa011('0x69')]:'');}return _0xd34c16+')';};var _0x74c5c={'where':{'id':_0x2dc58f['id']}},_0x2bbd20,_0x541960,_0x32dc1a,_0x88a4ed,_0x445fc7;_0x74c5c=_[_0xa011('0x3c')]({},_0x74c5c,_0x32a2b5);return db[_0xa011('0x42')][_0xa011('0x4f')](_0x74c5c)['then'](function(_0x510981){if(_0x510981){_0x2bbd20=_0x510981;return _0x510981[_0xa011('0x6a')]();}return null;})[_0xa011('0x25')](function(_0x2e273e){if(_0x2e273e){if(!_0x2e273e[_0xa011('0x36')]){throw new db[(_0xa011('0x8a'))][(_0xa011('0x6b'))](_0xa011('0x6c'),0x193);}_0x541960=_0x2e273e;return db[_0xa011('0x6d')][_0xa011('0x6e')]({'raw':!![]});}return null;})[_0xa011('0x25')](function(_0x194732){if(_0x194732){_0x32dc1a=_[_0xa011('0x6f')](_0x194732,'id');var _0x279d2b;var _0xf2b687=squel[_0xa011('0x70')]();_0xf2b687[_0xa011('0x8b')](_0x2bbd20['table']);for(var _0x4a5af5=0x0;_0x4a5af5<_0x541960['length'];_0x4a5af5+=0x1){_0x279d2b=_0x541960[_0x4a5af5][_0xa011('0x71')]?_0x32dc1a[_0x541960[_0x4a5af5][_0xa011('0x71')]]['metric']:_0x541960[_0x4a5af5][_0xa011('0x40')];_0x279d2b=_0x541960[_0x4a5af5][_0xa011('0x73')]?_['replace'](_0x56923b[_0x541960[_0x4a5af5][_0xa011('0x73')]],'%s',_0x279d2b):_0x279d2b;_0x279d2b=_0x541960[_0x4a5af5][_0xa011('0x75')]?_[_0xa011('0x74')](_0x195b51[_0x541960[_0x4a5af5][_0xa011('0x75')]],'%s',_0x279d2b):_0x279d2b;if(_0x541960[_0x4a5af5]['groupBy']){_0xf2b687[_0xa011('0x67')](_0x279d2b);}_0x541960[_0x4a5af5][_0xa011('0x76')]&&_0xf2b687[_0xa011('0x77')](_0x279d2b,_0x541960[_0x4a5af5][_0xa011('0x76')]===_0xa011('0x78')?![]:!![]);_0xf2b687[_0xa011('0x40')](_0x279d2b,_0x541960[_0x4a5af5]['alias']||_0x279d2b);}if(_0x2bbd20[_0xa011('0x7a')]){_0x2bbd20[_0xa011('0x7a')]=JSON[_0xa011('0x80')](_0x2bbd20[_0xa011('0x7a')]);for(var _0x4d3f58=0x0;_0x4d3f58<_0x2bbd20['joins'][_0xa011('0x36')];_0x4d3f58+=0x1){if(_0x2bbd20['joins'][_0x4d3f58][_0xa011('0x3e')]&&_[_0xa011('0x61')](_0x1afa8b,_0x2bbd20['joins'][_0x4d3f58]['type'])&&_0x2bbd20[_0xa011('0x7a')][_0x4d3f58][_0xa011('0x7b')]&&_0x2bbd20[_0xa011('0x7a')][_0x4d3f58]['foreignTable']&&_0x2bbd20[_0xa011('0x7a')][_0x4d3f58][_0xa011('0x7e')]){_0xf2b687[_0x2bbd20[_0xa011('0x7a')][_0x4d3f58][_0xa011('0x3e')]](_0x2bbd20[_0xa011('0x7a')][_0x4d3f58][_0xa011('0x7d')],null,util[_0xa011('0x75')](_0xa011('0x8c'),_0x2bbd20[_0xa011('0x7c')],_0x2bbd20[_0xa011('0x7a')][_0x4d3f58][_0xa011('0x7b')],_0x2bbd20[_0xa011('0x7a')][_0x4d3f58][_0xa011('0x7d')],_0x2bbd20[_0xa011('0x7a')][_0x4d3f58][_0xa011('0x7e')]));}}}if(_0x2bbd20['conditions']){_0x2bbd20['conditions']=JSON[_0xa011('0x80')](_0x2bbd20[_0xa011('0x7f')]);_0xf2b687[_0xa011('0x39')](_0x3e4017(_0x2bbd20[_0xa011('0x7f')]['group']));}_0x445fc7=_0xf2b687[_0xa011('0x8d')]();_0xf2b687[_0xa011('0x1e')](_0xe5cea5);_0xf2b687[_0xa011('0x1d')](0x0);logger[_0xa011('0x8e')](_0xa011('0x81'),_0xf2b687[_0xa011('0x82')]());return db[_0xa011('0x83')]['query'](_0xf2b687[_0xa011('0x82')](),{'type':db[_0xa011('0x83')][_0xa011('0x84')][_0xa011('0x8f')]});}})[_0xa011('0x25')](function(_0x32710f){if(!_0x32710f[_0xa011('0x36')]){throw new db[(_0xa011('0x8a'))][(_0xa011('0x6b'))]('No\x20available\x20data',0xcc);}if(_0x1a3d87[_0xa011('0x90')]==='web'){return null;}var _0x1d935c=_[_0xa011('0x3c')](_0x1a3d87,{'name':_0x1a3d87[_0xa011('0x91')]||_0x1a3d87[_0xa011('0x2c')]||_0x2bbd20[_0xa011('0x2c')],'basename':_0x5df34c,'savename':util['format'](_0xa011('0x92'),_0x1a3d87['name']||_0x2bbd20[_0xa011('0x2c')],require(_0xa011('0x93'))[_0xa011('0x94')](0x4),_0x1a3d87[_0xa011('0x90')]||_0xa011('0x95')),'reportId':_0x2bbd20['id'],'reportType':_0xa011('0x96')});return db[_0xa011('0x97')]['create'](_0x1d935c,{'raw':!![]});})[_0xa011('0x25')](function(_0xf535ff){if(_0x2bbd20[_0xa011('0x7c')]===_0xa011('0x98')){_0x445fc7[_0xa011('0x39')](_0x2bbd20[_0xa011('0x7c')]+_0xa011('0x99'),_0x1a3d87['startDate'],_0x1a3d87[_0xa011('0x9a')]);}else{_0x445fc7[_0xa011('0x39')](_0x2bbd20[_0xa011('0x7c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1a3d87[_0xa011('0x9b')],_0x1a3d87[_0xa011('0x9a')]);}if(_0xf535ff){logger[_0xa011('0x9c')]('Run\x20Query:',_0x445fc7['toString']());require(_0xa011('0x9d'))['fork'](path[_0xa011('0x85')](__dirname,_0xa011('0x9e'),_0xf535ff[_0xa011('0x90')]),[_0xf535ff['id'],_0x445fc7[_0xa011('0x82')](),path[_0xa011('0x85')](__dirname,_0xa011('0x9f'),_0xf535ff[_0xa011('0xa0')]),_0x5df34c]);return _0xf535ff;}else{var _0x38af8b=squel[_0xa011('0x70')]();_0x38af8b['from']('('+_0x445fc7[_0xa011('0x82')]()+')',_0xa011('0xa1'));_0x38af8b[_0xa011('0x40')](_0xa011('0xa2'),_0xa011('0x1c'));_0x445fc7[_0xa011('0x1e')](_0x1a3d87[_0xa011('0x1e')]||_0xe5cea5);_0x445fc7[_0xa011('0x1d')](_0x1a3d87[_0xa011('0x1d')]||0x0);return db[_0xa011('0x83')]['query'](_0x38af8b[_0xa011('0x82')](),{'type':db[_0xa011('0x83')][_0xa011('0x84')][_0xa011('0x8f')]})[_0xa011('0x25')](function(_0x2ca30b){if(!_0x2ca30b[_0xa011('0x36')]){_0x88a4ed=0x0;}else{_0x88a4ed=_0x2ca30b[0x0][_0xa011('0x1c')]||0x0;}return db[_0xa011('0x83')][_0xa011('0x32')](_0x445fc7[_0xa011('0x82')](),{'type':db['sequelize'][_0xa011('0x84')][_0xa011('0x8f')]});})[_0xa011('0x25')](function(_0x509a94){return{'rows':_0x509a94||[],'count':_0x88a4ed};});}});}exports[_0xa011('0xa3')]=function(_0x340307,_0x122757){return runReport(_0x340307['params'],_0x340307[_0xa011('0x32')],_0x340307[_0xa011('0x41')])['then'](respondWithResult(_0x122757,null))[_0xa011('0x45')](handleError(_0x122757,null));};exports[_0xa011('0xa4')]=runReport;exports['query']=function(_0x2b1c8c,_0x6a2dd4){var _0xfc82eb=0xa;var _0x3eae34=[_0xa011('0x85'),_0xa011('0x53'),_0xa011('0x54'),_0xa011('0x55')];var _0x273af7={'SUM':'SUM(%s)','COUNT':_0xa011('0x57'),'COUNT DISTINCT':_0xa011('0x58'),'MAX':_0xa011('0x59'),'MIN':_0xa011('0x5a'),'AVG':_0xa011('0x86'),'GROUP_CONCAT':_0xa011('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xa011('0x5d')};var _0x514ab0={'SEC_TO_TIME':_0xa011('0x87'),'DATE':_0xa011('0x5e'),'HOUR':_0xa011('0x5f'),'ROUND':_0xa011('0x88'),'UNIX_TIMESTAMP':_0xa011('0x60')};var _0x495791=function(_0x25fc5f){return!_[_0xa011('0x61')](['IS\x20NULL',_0xa011('0x89'),_0xa011('0x63'),_0xa011('0x64')],_0x25fc5f);};var _0x196b78=function(_0x1b614d){if(!_0x1b614d||!_0x1b614d[_0xa011('0x65')][_0xa011('0x36')]){return'';}for(var _0x22dd84='(',_0x460cc2=0x0;_0x460cc2<_0x1b614d['rules']['length'];_0x460cc2+=0x1){_0x460cc2>0x0&&(_0x22dd84+='\x20'+_0x1b614d[_0xa011('0x66')]+'\x20');_0x22dd84+=_0x1b614d['rules'][_0x460cc2][_0xa011('0x67')]?_0x196b78(_0x1b614d[_0xa011('0x65')][_0x460cc2][_0xa011('0x67')]):_0x1b614d[_0xa011('0x65')][_0x460cc2][_0xa011('0x40')]+'\x20'+_0x1b614d[_0xa011('0x65')][_0x460cc2]['condition']+(_0x495791(_0x1b614d['rules'][_0x460cc2][_0xa011('0x68')])?'\x20'+_0x1b614d[_0xa011('0x65')][_0x460cc2][_0xa011('0x69')]:'');}return _0x22dd84+')';};var _0x53c781={'where':{'id':_0x2b1c8c[_0xa011('0x47')]['id']}},_0x4b77ae,_0xb8bb24,_0x1a1b3c,_0x39ead9,_0x1e1707;_0x53c781=_['merge']({},_0x53c781,_0x2b1c8c[_0xa011('0x41')]);return db[_0xa011('0x42')][_0xa011('0x4f')](_0x53c781)[_0xa011('0x25')](function(_0x1c8ddb){if(_0x1c8ddb){_0x4b77ae=_0x1c8ddb;return _0x1c8ddb[_0xa011('0x6a')]();}return null;})[_0xa011('0x25')](function(_0x1619b3){if(_0x1619b3){if(!_0x1619b3[_0xa011('0x36')]){throw new db[(_0xa011('0x8a'))][(_0xa011('0x6b'))](_0xa011('0x6c'),0x193);}_0xb8bb24=_0x1619b3;return db[_0xa011('0x6d')][_0xa011('0x6e')]({'raw':!![]});}return null;})[_0xa011('0x25')](function(_0xabec60){if(_0xabec60){_0x1a1b3c=_[_0xa011('0x6f')](_0xabec60,'id');var _0x90900;var _0x4251b5=squel[_0xa011('0x70')]();_0x4251b5[_0xa011('0x8b')](_0x4b77ae[_0xa011('0x7c')]);for(var _0x31c6c7=0x0;_0x31c6c7<_0xb8bb24[_0xa011('0x36')];_0x31c6c7+=0x1){_0x90900=_0xb8bb24[_0x31c6c7][_0xa011('0x71')]?_0x1a1b3c[_0xb8bb24[_0x31c6c7][_0xa011('0x71')]][_0xa011('0x72')]:_0xb8bb24[_0x31c6c7][_0xa011('0x40')];_0x90900=_0xb8bb24[_0x31c6c7]['function']?_[_0xa011('0x74')](_0x273af7[_0xb8bb24[_0x31c6c7][_0xa011('0x73')]],'%s',_0x90900):_0x90900;_0x90900=_0xb8bb24[_0x31c6c7]['format']?_[_0xa011('0x74')](_0x514ab0[_0xb8bb24[_0x31c6c7][_0xa011('0x75')]],'%s',_0x90900):_0x90900;if(_0xb8bb24[_0x31c6c7]['groupBy']){_0x4251b5['group'](_0x90900);}_0xb8bb24[_0x31c6c7][_0xa011('0x76')]&&_0x4251b5[_0xa011('0x77')](_0x90900,_0xb8bb24[_0x31c6c7][_0xa011('0x76')]===_0xa011('0x78')?![]:!![]);_0x4251b5['field'](_0x90900,_0xb8bb24[_0x31c6c7][_0xa011('0x79')]||_0x90900);}if(_0x4b77ae[_0xa011('0x7a')]){_0x4b77ae[_0xa011('0x7a')]=JSON['parse'](_0x4b77ae[_0xa011('0x7a')]);for(var _0x130979=0x0;_0x130979<_0x4b77ae[_0xa011('0x7a')][_0xa011('0x36')];_0x130979+=0x1){if(_0x4b77ae[_0xa011('0x7a')][_0x130979][_0xa011('0x3e')]&&_[_0xa011('0x61')](_0x3eae34,_0x4b77ae[_0xa011('0x7a')][_0x130979][_0xa011('0x3e')])&&_0x4b77ae[_0xa011('0x7a')][_0x130979][_0xa011('0x7b')]&&_0x4b77ae['joins'][_0x130979]['foreignTable']&&_0x4b77ae[_0xa011('0x7a')][_0x130979][_0xa011('0x7e')]){_0x4251b5[_0x4b77ae[_0xa011('0x7a')][_0x130979]['type']](_0x4b77ae[_0xa011('0x7a')][_0x130979][_0xa011('0x7d')],null,util[_0xa011('0x75')](_0xa011('0x8c'),_0x4b77ae[_0xa011('0x7c')],_0x4b77ae['joins'][_0x130979][_0xa011('0x7b')],_0x4b77ae[_0xa011('0x7a')][_0x130979][_0xa011('0x7d')],_0x4b77ae[_0xa011('0x7a')][_0x130979][_0xa011('0x7e')]));}}}if(_0x4b77ae['conditions']){_0x4b77ae[_0xa011('0x7f')]=JSON[_0xa011('0x80')](_0x4b77ae[_0xa011('0x7f')]);_0x4251b5[_0xa011('0x39')](_0x196b78(_0x4b77ae[_0xa011('0x7f')]['group']));}_0x1e1707=_0x4251b5[_0xa011('0x8d')]();_0x4251b5[_0xa011('0x1e')](_0xfc82eb);_0x4251b5[_0xa011('0x1d')](0x0);logger[_0xa011('0x8e')](_0xa011('0x81'),_0x4251b5[_0xa011('0x82')]());return db[_0xa011('0x83')]['query'](_0x4251b5[_0xa011('0x82')](),{'type':db[_0xa011('0x83')][_0xa011('0x84')][_0xa011('0x8f')]});}})[_0xa011('0x25')](function(){return{'sql':_0x1e1707['toString']()};})['then'](respondWithResult(_0x6a2dd4,null))[_0xa011('0x45')](handleError(_0x6a2dd4,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 0bfac20..d73a3d6 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 _0x54e4=['moment','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api'];(function(_0x19c2ba,_0x494ad0){var _0x3e5077=function(_0x518454){while(--_0x518454){_0x19c2ba['push'](_0x19c2ba['shift']());}};_0x3e5077(++_0x494ad0);}(_0x54e4,0x8b));var _0x454e=function(_0x2fdc4f,_0x25dd82){_0x2fdc4f=_0x2fdc4f-0x0;var _0xb69295=_0x54e4[_0x2fdc4f];return _0xb69295;};'use strict';var _=require(_0x454e('0x0'));var util=require(_0x454e('0x1'));var logger=require(_0x454e('0x2'))(_0x454e('0x3'));var moment=require(_0x454e('0x4'));var BPromise=require(_0x454e('0x5'));var rp=require(_0x454e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x454e('0x7'));var config=require(_0x454e('0x8'));var attributes=require(_0x454e('0x9'));module['exports']=function(_0x319ff1,_0x4c12fd){return _0x319ff1[_0x454e('0xa')](_0x454e('0xb'),attributes,{'tableName':_0x454e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0cf0=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport'];(function(_0x2b305c,_0x5ae303){var _0x5d8c85=function(_0x33129f){while(--_0x33129f){_0x2b305c['push'](_0x2b305c['shift']());}};_0x5d8c85(++_0x5ae303);}(_0x0cf0,0x150));var _0x00cf=function(_0x182da3,_0x398a19){_0x182da3=_0x182da3-0x0;var _0x56e36e=_0x0cf0[_0x182da3];return _0x56e36e;};'use strict';var _=require(_0x00cf('0x0'));var util=require(_0x00cf('0x1'));var logger=require('../../config/logger')(_0x00cf('0x2'));var moment=require(_0x00cf('0x3'));var BPromise=require(_0x00cf('0x4'));var rp=require(_0x00cf('0x5'));var fs=require('fs');var path=require(_0x00cf('0x6'));var rimraf=require(_0x00cf('0x7'));var config=require(_0x00cf('0x8'));var attributes=require(_0x00cf('0x9'));module['exports']=function(_0x4df4fd,_0x6243e){return _0x4df4fd[_0x00cf('0xa')](_0x00cf('0xb'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 64da4ac..192a873 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 _0x54ef=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x45a848,_0x40f833){var _0x402ae0=function(_0x4b4479){while(--_0x4b4479){_0x45a848['push'](_0x45a848['shift']());}};_0x402ae0(++_0x40f833);}(_0x54ef,0x112));var _0xf54e=function(_0x74c228,_0x418410){_0x74c228=_0x74c228-0x0;var _0x20a218=_0x54ef[_0x74c228];return _0x20a218;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99cf9,_0x2464ae,_0x561870){return new BPromise(function(_0x27e69b,_0x57a1ce){return client[_0xf54e('0xb')](_0x99cf9,_0x561870)[_0xf54e('0xc')](function(_0x47c5e1){logger[_0xf54e('0xd')](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));logger[_0xf54e('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x2464ae,_0xf54e('0xf'),JSON[_0xf54e('0x11')](_0x47c5e1));if(_0x47c5e1[_0xf54e('0x12')]){if(_0x47c5e1[_0xf54e('0x12')]['code']===0x1f4){logger[_0xf54e('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2464ae,_0x47c5e1['error'][_0xf54e('0x13')]);return _0x57a1ce(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}logger[_0xf54e('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2464ae,_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);return _0x27e69b(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}else{logger['info'](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));_0x27e69b(_0x47c5e1[_0xf54e('0x14')]['message']);}})['catch'](function(_0xd87020){logger[_0xf54e('0x12')](_0xf54e('0xe'),_0x2464ae,_0xd87020);_0x57a1ce(_0xd87020);});});} \ No newline at end of file +var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','AnalyticDefaultReport,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x469253,_0x25bd58){var _0x346faa=function(_0xd131a5){while(--_0xd131a5){_0x469253['push'](_0x469253['shift']());}};_0x346faa(++_0x25bd58);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index f2791aa..70b9ff7 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 _0x2274=['/:id/preview','preview','/:id/run','run','/:id/query','create','put','/:id','delete','destroy','path','Router','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','show','get'];(function(_0x29df13,_0x123cc7){var _0x3331dc=function(_0xd35065){while(--_0xd35065){_0x29df13['push'](_0x29df13['shift']());}};_0x3331dc(++_0x123cc7);}(_0x2274,0xbe));var _0x4227=function(_0x1c33cf,_0x474950){_0x1c33cf=_0x1c33cf-0x0;var _0x584b6a=_0x2274[_0x1c33cf];return _0x584b6a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4227('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4227('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x4227('0x2'));var config=require(_0x4227('0x3'));var controller=require(_0x4227('0x4'));router['get']('/',auth[_0x4227('0x5')](),controller['index']);router['get']('/:id',auth[_0x4227('0x5')](),controller[_0x4227('0x6')]);router[_0x4227('0x7')](_0x4227('0x8'),auth[_0x4227('0x5')](),controller[_0x4227('0x9')]);router['get'](_0x4227('0xa'),auth['isAuthenticated'](),controller[_0x4227('0xb')]);router[_0x4227('0x7')](_0x4227('0xc'),auth['isAuthenticated'](),controller['query']);router['post']('/',auth[_0x4227('0x5')](),controller[_0x4227('0xd')]);router[_0x4227('0xe')](_0x4227('0xf'),auth[_0x4227('0x5')](),controller['update']);router[_0x4227('0x10')]('/:id',auth[_0x4227('0x5')](),controller[_0x4227('0x11')]);module['exports']=router; \ No newline at end of file +var _0xcb07=['Router','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','/:id','destroy','exports','multer','path','connect-timeout','express'];(function(_0x155924,_0x2a5368){var _0x262e4b=function(_0x1e245a){while(--_0x1e245a){_0x155924['push'](_0x155924['shift']());}};_0x262e4b(++_0x2a5368);}(_0xcb07,0xab));var _0x7cb0=function(_0x32f26d,_0x2c0b5d){_0x32f26d=_0x32f26d-0x0;var _0x5d9ddc=_0xcb07[_0x32f26d];return _0x5d9ddc;};'use strict';var multer=require(_0x7cb0('0x0'));var util=require('util');var path=require(_0x7cb0('0x1'));var timeout=require(_0x7cb0('0x2'));var express=require(_0x7cb0('0x3'));var router=express[_0x7cb0('0x4')]();var auth=require(_0x7cb0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7cb0('0x6'));var controller=require(_0x7cb0('0x7'));router['get']('/',auth[_0x7cb0('0x8')](),controller[_0x7cb0('0x9')]);router[_0x7cb0('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x7cb0('0xb')]);router[_0x7cb0('0xa')](_0x7cb0('0xc'),auth[_0x7cb0('0x8')](),controller[_0x7cb0('0xd')]);router[_0x7cb0('0xa')](_0x7cb0('0xe'),auth[_0x7cb0('0x8')](),controller[_0x7cb0('0xf')]);router[_0x7cb0('0xa')](_0x7cb0('0x10'),auth[_0x7cb0('0x8')](),controller[_0x7cb0('0x11')]);router[_0x7cb0('0x12')]('/',auth[_0x7cb0('0x8')](),controller[_0x7cb0('0x13')]);router[_0x7cb0('0x14')]('/:id',auth[_0x7cb0('0x8')](),controller[_0x7cb0('0x15')]);router['delete'](_0x7cb0('0x16'),auth['isAuthenticated'](),controller[_0x7cb0('0x17')]);module[_0x7cb0('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index e87eca5..6910d46 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 _0x6b21=['STRING','csv','pdf','DATE','Loading','ENUM','manual','UNSIGNED','sequelize','exports'];(function(_0x2a2fe5,_0x2e1b10){var _0x137082=function(_0x412f1e){while(--_0x412f1e){_0x2a2fe5['push'](_0x2a2fe5['shift']());}};_0x137082(++_0x2e1b10);}(_0x6b21,0x13e));var _0x16b2=function(_0xa902a1,_0x376d9c){_0xa902a1=_0xa902a1-0x0;var _0x4d5624=_0x6b21[_0xa902a1];return _0x4d5624;};'use strict';var Sequelize=require(_0x16b2('0x0'));var moment=require('moment');module[_0x16b2('0x1')]={'name':{'type':Sequelize[_0x16b2('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x16b2('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x16b2('0x3'),_0x16b2('0x4'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x16b2('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x16b2('0x5')]},'endDate':{'type':Sequelize[_0x16b2('0x5')]},'status':{'type':Sequelize[_0x16b2('0x2')],'defaultValue':_0x16b2('0x6')},'type':{'type':Sequelize[_0x16b2('0x7')](_0x16b2('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0x16b2('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x16b2('0x9')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdf96=['DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','moment','exports','ENUM','csv','pdf','xlsx','STRING'];(function(_0x2714ec,_0x36daa4){var _0x2608e5=function(_0x408468){while(--_0x408468){_0x2714ec['push'](_0x2714ec['shift']());}};_0x2608e5(++_0x36daa4);}(_0xdf96,0xae));var _0x6df9=function(_0x1674c3,_0x9b1025){_0x1674c3=_0x1674c3-0x0;var _0x4df37c=_0xdf96[_0x1674c3];return _0x4df37c;};'use strict';var Sequelize=require(_0x6df9('0x0'));var moment=require(_0x6df9('0x1'));module[_0x6df9('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x6df9('0x3')](_0x6df9('0x4'),_0x6df9('0x5'),_0x6df9('0x6')),'allowNull':![],'defaultValue':_0x6df9('0x4')},'savename':{'type':Sequelize[_0x6df9('0x7')],'allowNull':![]},'startDate':{'type':Sequelize[_0x6df9('0x8')]},'endDate':{'type':Sequelize[_0x6df9('0x8')]},'status':{'type':Sequelize[_0x6df9('0x7')],'defaultValue':_0x6df9('0x9')},'type':{'type':Sequelize['ENUM'](_0x6df9('0xa'),'scheduled'),'allowNull':![],'defaultValue':_0x6df9('0xa')},'reportId':{'type':Sequelize[_0x6df9('0xb')](0xb)[_0x6df9('0xc')]},'reportType':{'type':Sequelize[_0x6df9('0x7')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 7d99cac..b14f096 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 _0xf19b=['UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','savename','output','existsSync','join','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','%s.%s','basename','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','get','ExtractedReports','error','name','send','index','AnalyticExtractedReport','rawAttributes','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filters','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','UserProfileSection','userProfileId','autoAssociation'];(function(_0x2f91ae,_0x3be8f7){var _0x5b364c=function(_0x1f9bd7){while(--_0x1f9bd7){_0x2f91ae['push'](_0x2f91ae['shift']());}};_0x5b364c(++_0x3be8f7);}(_0xf19b,0x127));var _0xbf19=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xf19b[_0x2a6809];return _0x11c371;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xbf19('0x0'));var zipdir=require(_0xbf19('0x1'));var jsonpatch=require(_0xbf19('0x2'));var rp=require(_0xbf19('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbf19('0x4'));var util=require(_0xbf19('0x5'));var path=require(_0xbf19('0x6'));var sox=require(_0xbf19('0x7'));var csv=require(_0xbf19('0x8'));var ejs=require(_0xbf19('0x9'));var fs=require('fs');var _=require(_0xbf19('0xa'));var squel=require(_0xbf19('0xb'));var crypto=require('crypto');var jsforce=require(_0xbf19('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbf19('0x8'));var querystring=require(_0xbf19('0xd'));var Papa=require(_0xbf19('0xe'));var Redis=require(_0xbf19('0xf'));var authService=require(_0xbf19('0x10'));var qs=require(_0xbf19('0x11'));var hardwareService=require(_0xbf19('0x12'));var logger=require(_0xbf19('0x13'))(_0xbf19('0x14'));var utils=require(_0xbf19('0x15'));var config=require(_0xbf19('0x16'));var db=require(_0xbf19('0x17'))['db'];function respondWithStatusCode(_0x4160d4,_0x1f5b7b){_0x1f5b7b=_0x1f5b7b||0xcc;return function(_0x3c3608){if(_0x3c3608){return _0x4160d4[_0xbf19('0x18')](_0x1f5b7b);}return _0x4160d4[_0xbf19('0x19')](_0x1f5b7b)[_0xbf19('0x1a')]();};}function respondWithResult(_0x2a7ced,_0x5ebb66){_0x5ebb66=_0x5ebb66||0xc8;return function(_0x31e512){if(_0x31e512){return _0x2a7ced[_0xbf19('0x19')](_0x5ebb66)[_0xbf19('0x1b')](_0x31e512);}};}function respondWithFilteredResult(_0x32f19d,_0x1e8e45){return function(_0x4d0a5d){if(_0x4d0a5d){var _0xcddd61=_0x4d0a5d[_0xbf19('0x1c')],_0x3c82dc=_0x1e8e45[_0xbf19('0x1d')],_0x172c21=_0x1e8e45[_0xbf19('0x1d')]+_0x1e8e45[_0xbf19('0x1e')],_0x1c8725;if(_0x172c21>=_0xcddd61){_0x172c21=_0xcddd61;_0x1c8725=0xc8;}else{_0x1c8725=0xce;}_0x32f19d[_0xbf19('0x19')](_0x1c8725);return _0x32f19d[_0xbf19('0x1f')]('Content-Range',_0x3c82dc+'-'+_0x172c21+'/'+_0xcddd61)[_0xbf19('0x1b')](_0x4d0a5d);}return null;};}function patchUpdates(_0x3c3203){return function(_0x2ef82d){try{jsonpatch[_0xbf19('0x20')](_0x2ef82d,_0x3c3203,!![]);}catch(_0xcb07b2){return BPromise['reject'](_0xcb07b2);}return _0x2ef82d[_0xbf19('0x21')]();};}function saveUpdates(_0x472435,_0x1ca048){return function(_0x1598a1){if(_0x1598a1){return _0x1598a1[_0xbf19('0x22')](_0x472435)[_0xbf19('0x23')](function(_0xc8546a){return _0xc8546a;});}return null;};}function removeEntity(_0x4bd7ad,_0x20b8a4){return function(_0x279f5f){if(_0x279f5f){return _0x279f5f[_0xbf19('0x24')]()[_0xbf19('0x23')](function(){var _0x22e34d=_0x279f5f[_0xbf19('0x25')]({'plain':!![]});var _0xa00d4d=_0xbf19('0x26');return db['UserProfileResource'][_0xbf19('0x24')]({'where':{'type':_0xa00d4d,'resourceId':_0x22e34d['id']}})['then'](function(){return _0x279f5f;});})[_0xbf19('0x23')](function(){_0x4bd7ad[_0xbf19('0x19')](0xcc)[_0xbf19('0x1a')]();});}};}function handleEntityNotFound(_0x477379,_0x3f12a8){return function(_0x50c8cf){if(!_0x50c8cf){_0x477379[_0xbf19('0x18')](0x194);}return _0x50c8cf;};}function handleError(_0x247a3f,_0x5dbed1){_0x5dbed1=_0x5dbed1||0x1f4;return function(_0x2f0f78){logger[_0xbf19('0x27')](_0x2f0f78['stack']);if(_0x2f0f78[_0xbf19('0x28')]){delete _0x2f0f78[_0xbf19('0x28')];}_0x247a3f[_0xbf19('0x19')](_0x5dbed1)[_0xbf19('0x29')](_0x2f0f78);};}exports[_0xbf19('0x2a')]=function(_0x172fc4,_0x56b170){var _0x424697={},_0x48e633={},_0x47f9bf={'count':0x0,'rows':[]};var _0x253b1b=db[_0xbf19('0x2b')][_0xbf19('0x2c')];_0x48e633['model']=_['keys'](_0x253b1b);_0x48e633[_0xbf19('0x2d')]=_[_0xbf19('0x2e')](_0x172fc4[_0xbf19('0x2d')]);_0x48e633['filters']=_[_0xbf19('0x2f')](_0x48e633[_0xbf19('0x30')],_0x48e633[_0xbf19('0x2d')]);_0x424697[_0xbf19('0x31')]=_['intersection'](_0x48e633['model'],qs[_0xbf19('0x32')](_0x172fc4['query'][_0xbf19('0x32')]));_0x424697['attributes']=_0x424697['attributes'][_0xbf19('0x33')]?_0x424697[_0xbf19('0x31')]:_0x48e633[_0xbf19('0x30')];if(!_0x172fc4[_0xbf19('0x2d')][_0xbf19('0x34')](_0xbf19('0x35'))){_0x424697[_0xbf19('0x1e')]=qs[_0xbf19('0x1e')](_0x172fc4[_0xbf19('0x2d')]['limit']);_0x424697[_0xbf19('0x1d')]=qs[_0xbf19('0x1d')](_0x172fc4[_0xbf19('0x2d')][_0xbf19('0x1d')]);}_0x424697['order']=qs['sort'](_0x172fc4[_0xbf19('0x2d')]['sort']);_0x424697[_0xbf19('0x36')]=qs['filters'](_[_0xbf19('0x37')](_0x172fc4[_0xbf19('0x2d')],_0x48e633[_0xbf19('0x38')]));if(_0x172fc4['query'][_0xbf19('0x39')]){_0x424697[_0xbf19('0x36')]=_[_0xbf19('0x3a')](_0x424697[_0xbf19('0x36')],{'$or':_[_0xbf19('0x3b')](_0x253b1b,function(_0x223fe2){if(_0x223fe2[_0xbf19('0x3c')][_0xbf19('0x3d')]!==_0xbf19('0x3e')){var _0x30b7fa={};_0x30b7fa[_0x223fe2['field']]={'$like':'%'+_0x172fc4[_0xbf19('0x2d')][_0xbf19('0x39')]+'%'};return _0x30b7fa;}})});}_0x424697=_[_0xbf19('0x3a')]({},_0x424697,_0x172fc4[_0xbf19('0x3f')]);var _0x4d08f9={'where':_0x424697[_0xbf19('0x36')]};return db[_0xbf19('0x2b')][_0xbf19('0x1c')](_0x4d08f9)['then'](function(_0x5e1aa4){_0x47f9bf[_0xbf19('0x1c')]=_0x5e1aa4;if(_0x172fc4[_0xbf19('0x2d')][_0xbf19('0x40')]){_0x424697[_0xbf19('0x41')]=[{'all':!![]}];}return db[_0xbf19('0x2b')][_0xbf19('0x42')](_0x424697);})[_0xbf19('0x23')](function(_0x2c1992){_0x47f9bf[_0xbf19('0x43')]=_0x2c1992;return _0x47f9bf;})['then'](respondWithFilteredResult(_0x56b170,_0x424697))[_0xbf19('0x44')](handleError(_0x56b170,null));};exports[_0xbf19('0x45')]=function(_0x1bf685,_0x2a3884){var _0x4e8c84={'raw':!![],'where':{'id':_0x1bf685['params']['id']}},_0x256a6d={};_0x256a6d[_0xbf19('0x30')]=_[_0xbf19('0x2e')](db[_0xbf19('0x2b')][_0xbf19('0x2c')]);_0x256a6d[_0xbf19('0x2d')]=_[_0xbf19('0x2e')](_0x1bf685['query']);_0x256a6d[_0xbf19('0x38')]=_[_0xbf19('0x2f')](_0x256a6d[_0xbf19('0x30')],_0x256a6d[_0xbf19('0x2d')]);_0x4e8c84[_0xbf19('0x31')]=_['intersection'](_0x256a6d['model'],qs[_0xbf19('0x32')](_0x1bf685['query']['fields']));_0x4e8c84[_0xbf19('0x31')]=_0x4e8c84[_0xbf19('0x31')]['length']?_0x4e8c84[_0xbf19('0x31')]:_0x256a6d[_0xbf19('0x30')];if(_0x1bf685[_0xbf19('0x2d')][_0xbf19('0x40')]){_0x4e8c84['include']=[{'all':!![]}];}_0x4e8c84=_[_0xbf19('0x3a')]({},_0x4e8c84,_0x1bf685[_0xbf19('0x3f')]);return db[_0xbf19('0x2b')][_0xbf19('0x46')](_0x4e8c84)['then'](handleEntityNotFound(_0x2a3884,null))[_0xbf19('0x23')](respondWithResult(_0x2a3884,null))[_0xbf19('0x44')](handleError(_0x2a3884,null));};exports[_0xbf19('0x47')]=function(_0x4f2d44,_0x57bed5){return db[_0xbf19('0x2b')]['create'](_0x4f2d44[_0xbf19('0x48')],{})[_0xbf19('0x23')](function(_0x49bb32){var _0x559140=_0x4f2d44[_0xbf19('0x49')][_0xbf19('0x25')]({'plain':!![]});if(!_0x559140)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x559140['role']==='user'){var _0x25bdf6=_0x49bb32[_0xbf19('0x25')]({'plain':!![]});var _0x6ffc4f=_0xbf19('0x26');return db[_0xbf19('0x4a')][_0xbf19('0x46')]({'where':{'name':_0x6ffc4f,'userProfileId':_0x559140[_0xbf19('0x4b')]},'raw':!![]})[_0xbf19('0x23')](function(_0x228ca6){if(_0x228ca6&&_0x228ca6[_0xbf19('0x4c')]===0x0){return db[_0xbf19('0x4d')][_0xbf19('0x47')]({'name':_0x25bdf6[_0xbf19('0x28')],'resourceId':_0x25bdf6['id'],'type':_0x228ca6[_0xbf19('0x28')],'sectionId':_0x228ca6['id']},{})[_0xbf19('0x23')](function(){return _0x49bb32;});}else{return _0x49bb32;}})['catch'](function(_0x14a85d){logger[_0xbf19('0x27')](_0xbf19('0x4e'),_0x14a85d);throw _0x14a85d;});}return _0x49bb32;})['then'](respondWithResult(_0x57bed5,0xc9))[_0xbf19('0x44')](handleError(_0x57bed5,null));};exports[_0xbf19('0x22')]=function(_0x1cc836,_0x4266ae){if(_0x1cc836[_0xbf19('0x48')]['id']){delete _0x1cc836[_0xbf19('0x48')]['id'];}return db[_0xbf19('0x2b')][_0xbf19('0x46')]({'where':{'id':_0x1cc836[_0xbf19('0x4f')]['id']}})[_0xbf19('0x23')](handleEntityNotFound(_0x4266ae,null))['then'](saveUpdates(_0x1cc836[_0xbf19('0x48')],null))['then'](respondWithResult(_0x4266ae,null))['catch'](handleError(_0x4266ae,null));};exports[_0xbf19('0x24')]=function(_0xf441b0,_0x1389e8){return db['AnalyticExtractedReport']['find']({'where':{'id':_0xf441b0[_0xbf19('0x4f')]['id']}})[_0xbf19('0x23')](handleEntityNotFound(_0x1389e8,null))['then'](removeEntity(_0x1389e8,null))['catch'](handleError(_0x1389e8,null));};exports[_0xbf19('0x50')]=function(_0x55c7d6,_0x2b4dca,_0x409dec){return db[_0xbf19('0x2b')][_0xbf19('0x46')]({'where':{'id':_0x55c7d6['params']['id']},'attributes':['name','basename',_0xbf19('0x51'),_0xbf19('0x52')],'raw':!![]})[_0xbf19('0x23')](handleEntityNotFound(_0x2b4dca,null))['then'](function(_0x292f12){if(_0x292f12){if(!fs[_0xbf19('0x53')](path[_0xbf19('0x54')](config['root'],'server/files/reports',_0x292f12[_0xbf19('0x51')]))){throw new db[(_0xbf19('0x55'))][(_0xbf19('0x56'))](_0xbf19('0x57'));}if(_0x55c7d6['query'][_0xbf19('0x58')]){return _0x2b4dca[_0xbf19('0x18')](0xc8);}return _0x2b4dca[_0xbf19('0x50')](path['join'](config[_0xbf19('0x59')],'server/files/reports',_0x292f12[_0xbf19('0x51')]),util[_0xbf19('0x5a')](_0xbf19('0x5b'),_0x292f12[_0xbf19('0x5c')]||_0x292f12['name'],_0x292f12['output']['toLowerCase']()));}})['catch'](handleError(_0x2b4dca,null));}; \ No newline at end of file +var _0xaeab=['lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','then','destroy','get','ExtractedReports','end','error','name','send','AnalyticExtractedReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','sort','pick','filter','where','merge','map','type','key','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','output','existsSync','root','ValidationError','Report\x20not\x20found\x20or\x20empty','join','server/files/reports','%s.%s','toLowerCase','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv'];(function(_0x1483e5,_0x105935){var _0x2d494a=function(_0x5b997d){while(--_0x5b997d){_0x1483e5['push'](_0x1483e5['shift']());}};_0x2d494a(++_0x105935);}(_0xaeab,0xad));var _0xbaea=function(_0x2f8082,_0x329f92){_0x2f8082=_0x2f8082-0x0;var _0x58d55c=_0xaeab[_0x2f8082];return _0x58d55c;};'use strict';var pdf=require(_0xbaea('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbaea('0x1'));var zipdir=require(_0xbaea('0x2'));var jsonpatch=require(_0xbaea('0x3'));var rp=require(_0xbaea('0x4'));var moment=require(_0xbaea('0x5'));var BPromise=require(_0xbaea('0x6'));var Mustache=require('mustache');var util=require(_0xbaea('0x7'));var path=require(_0xbaea('0x8'));var sox=require(_0xbaea('0x9'));var csv=require(_0xbaea('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbaea('0xb'));var squel=require(_0xbaea('0xc'));var crypto=require('crypto');var jsforce=require(_0xbaea('0xd'));var deskjs=require(_0xbaea('0xe'));var toCsv=require(_0xbaea('0xa'));var querystring=require('querystring');var Papa=require(_0xbaea('0xf'));var Redis=require(_0xbaea('0x10'));var authService=require(_0xbaea('0x11'));var qs=require(_0xbaea('0x12'));var hardwareService=require(_0xbaea('0x13'));var logger=require(_0xbaea('0x14'))(_0xbaea('0x15'));var utils=require(_0xbaea('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c3c31,_0x4bae2c){_0x4bae2c=_0x4bae2c||0xcc;return function(_0x1c5454){if(_0x1c5454){return _0x2c3c31[_0xbaea('0x17')](_0x4bae2c);}return _0x2c3c31[_0xbaea('0x18')](_0x4bae2c)['end']();};}function respondWithResult(_0x44d027,_0x469c8b){_0x469c8b=_0x469c8b||0xc8;return function(_0x2976e0){if(_0x2976e0){return _0x44d027['status'](_0x469c8b)[_0xbaea('0x19')](_0x2976e0);}};}function respondWithFilteredResult(_0x49b459,_0x1ae13a){return function(_0x141db4){if(_0x141db4){var _0x304d84=_0x141db4['count'],_0x13bf33=_0x1ae13a[_0xbaea('0x1a')],_0x32ebb7=_0x1ae13a[_0xbaea('0x1a')]+_0x1ae13a[_0xbaea('0x1b')],_0x31abd2;if(_0x32ebb7>=_0x304d84){_0x32ebb7=_0x304d84;_0x31abd2=0xc8;}else{_0x31abd2=0xce;}_0x49b459['status'](_0x31abd2);return _0x49b459[_0xbaea('0x1c')](_0xbaea('0x1d'),_0x13bf33+'-'+_0x32ebb7+'/'+_0x304d84)[_0xbaea('0x19')](_0x141db4);}return null;};}function patchUpdates(_0xa0b831){return function(_0x1b93e8){try{jsonpatch[_0xbaea('0x1e')](_0x1b93e8,_0xa0b831,!![]);}catch(_0x335fd8){return BPromise[_0xbaea('0x1f')](_0x335fd8);}return _0x1b93e8['save']();};}function saveUpdates(_0x1fe1ee,_0x5b5811){return function(_0x4f6dde){if(_0x4f6dde){return _0x4f6dde['update'](_0x1fe1ee)[_0xbaea('0x20')](function(_0x4ec528){return _0x4ec528;});}return null;};}function removeEntity(_0x2c2f7f,_0x22c526){return function(_0x202b74){if(_0x202b74){return _0x202b74[_0xbaea('0x21')]()['then'](function(){var _0x3d7b64=_0x202b74[_0xbaea('0x22')]({'plain':!![]});var _0x38796e=_0xbaea('0x23');return db['UserProfileResource'][_0xbaea('0x21')]({'where':{'type':_0x38796e,'resourceId':_0x3d7b64['id']}})[_0xbaea('0x20')](function(){return _0x202b74;});})[_0xbaea('0x20')](function(){_0x2c2f7f[_0xbaea('0x18')](0xcc)[_0xbaea('0x24')]();});}};}function handleEntityNotFound(_0x5e3718,_0x4200e0){return function(_0x4a2bd8){if(!_0x4a2bd8){_0x5e3718['sendStatus'](0x194);}return _0x4a2bd8;};}function handleError(_0x39c972,_0x29dca7){_0x29dca7=_0x29dca7||0x1f4;return function(_0xf240aa){logger[_0xbaea('0x25')](_0xf240aa['stack']);if(_0xf240aa[_0xbaea('0x26')]){delete _0xf240aa[_0xbaea('0x26')];}_0x39c972['status'](_0x29dca7)[_0xbaea('0x27')](_0xf240aa);};}exports['index']=function(_0xd27475,_0x3089e5){var _0x12fd7b={},_0x30734f={},_0x16bc68={'count':0x0,'rows':[]};var _0x459640=db[_0xbaea('0x28')][_0xbaea('0x29')];_0x30734f[_0xbaea('0x2a')]=_[_0xbaea('0x2b')](_0x459640);_0x30734f['query']=_[_0xbaea('0x2b')](_0xd27475[_0xbaea('0x2c')]);_0x30734f[_0xbaea('0x2d')]=_['intersection'](_0x30734f[_0xbaea('0x2a')],_0x30734f[_0xbaea('0x2c')]);_0x12fd7b['attributes']=_[_0xbaea('0x2e')](_0x30734f['model'],qs[_0xbaea('0x2f')](_0xd27475['query'][_0xbaea('0x2f')]));_0x12fd7b[_0xbaea('0x30')]=_0x12fd7b[_0xbaea('0x30')]['length']?_0x12fd7b[_0xbaea('0x30')]:_0x30734f[_0xbaea('0x2a')];if(!_0xd27475[_0xbaea('0x2c')][_0xbaea('0x31')]('nolimit')){_0x12fd7b[_0xbaea('0x1b')]=qs[_0xbaea('0x1b')](_0xd27475[_0xbaea('0x2c')][_0xbaea('0x1b')]);_0x12fd7b['offset']=qs[_0xbaea('0x1a')](_0xd27475[_0xbaea('0x2c')][_0xbaea('0x1a')]);}_0x12fd7b['order']=qs['sort'](_0xd27475[_0xbaea('0x2c')][_0xbaea('0x32')]);_0x12fd7b['where']=qs[_0xbaea('0x2d')](_[_0xbaea('0x33')](_0xd27475['query'],_0x30734f['filters']));if(_0xd27475[_0xbaea('0x2c')][_0xbaea('0x34')]){_0x12fd7b[_0xbaea('0x35')]=_[_0xbaea('0x36')](_0x12fd7b[_0xbaea('0x35')],{'$or':_[_0xbaea('0x37')](_0x459640,function(_0x1b898d){if(_0x1b898d[_0xbaea('0x38')][_0xbaea('0x39')]!==_0xbaea('0x3a')){var _0x1ab4e5={};_0x1ab4e5[_0x1b898d['field']]={'$like':'%'+_0xd27475[_0xbaea('0x2c')][_0xbaea('0x34')]+'%'};return _0x1ab4e5;}})});}_0x12fd7b=_[_0xbaea('0x36')]({},_0x12fd7b,_0xd27475['options']);var _0x3ba038={'where':_0x12fd7b[_0xbaea('0x35')]};return db['AnalyticExtractedReport'][_0xbaea('0x3b')](_0x3ba038)[_0xbaea('0x20')](function(_0x13d777){_0x16bc68['count']=_0x13d777;if(_0xd27475['query'][_0xbaea('0x3c')]){_0x12fd7b[_0xbaea('0x3d')]=[{'all':!![]}];}return db[_0xbaea('0x28')][_0xbaea('0x3e')](_0x12fd7b);})['then'](function(_0x13d602){_0x16bc68[_0xbaea('0x3f')]=_0x13d602;return _0x16bc68;})[_0xbaea('0x20')](respondWithFilteredResult(_0x3089e5,_0x12fd7b))[_0xbaea('0x40')](handleError(_0x3089e5,null));};exports[_0xbaea('0x41')]=function(_0x289202,_0x1d11fc){var _0x4abddd={'raw':!![],'where':{'id':_0x289202[_0xbaea('0x42')]['id']}},_0x46444d={};_0x46444d[_0xbaea('0x2a')]=_[_0xbaea('0x2b')](db[_0xbaea('0x28')]['rawAttributes']);_0x46444d[_0xbaea('0x2c')]=_[_0xbaea('0x2b')](_0x289202[_0xbaea('0x2c')]);_0x46444d[_0xbaea('0x2d')]=_['intersection'](_0x46444d[_0xbaea('0x2a')],_0x46444d[_0xbaea('0x2c')]);_0x4abddd[_0xbaea('0x30')]=_[_0xbaea('0x2e')](_0x46444d['model'],qs['fields'](_0x289202[_0xbaea('0x2c')][_0xbaea('0x2f')]));_0x4abddd[_0xbaea('0x30')]=_0x4abddd[_0xbaea('0x30')][_0xbaea('0x43')]?_0x4abddd[_0xbaea('0x30')]:_0x46444d[_0xbaea('0x2a')];if(_0x289202['query'][_0xbaea('0x3c')]){_0x4abddd[_0xbaea('0x3d')]=[{'all':!![]}];}_0x4abddd=_[_0xbaea('0x36')]({},_0x4abddd,_0x289202[_0xbaea('0x44')]);return db['AnalyticExtractedReport'][_0xbaea('0x45')](_0x4abddd)[_0xbaea('0x20')](handleEntityNotFound(_0x1d11fc,null))[_0xbaea('0x20')](respondWithResult(_0x1d11fc,null))[_0xbaea('0x40')](handleError(_0x1d11fc,null));};exports[_0xbaea('0x46')]=function(_0x33cb52,_0x3236b9){return db[_0xbaea('0x28')][_0xbaea('0x46')](_0x33cb52[_0xbaea('0x47')],{})[_0xbaea('0x20')](function(_0x51d322){var _0x20feb5=_0x33cb52[_0xbaea('0x48')]['get']({'plain':!![]});if(!_0x20feb5)throw new Error(_0xbaea('0x49'));if(_0x20feb5['role']==='user'){var _0x3405b6=_0x51d322[_0xbaea('0x22')]({'plain':!![]});var _0x204b49=_0xbaea('0x23');return db[_0xbaea('0x4a')][_0xbaea('0x45')]({'where':{'name':_0x204b49,'userProfileId':_0x20feb5[_0xbaea('0x4b')]},'raw':!![]})[_0xbaea('0x20')](function(_0x5cf7c1){if(_0x5cf7c1&&_0x5cf7c1[_0xbaea('0x4c')]===0x0){return db[_0xbaea('0x4d')][_0xbaea('0x46')]({'name':_0x3405b6[_0xbaea('0x26')],'resourceId':_0x3405b6['id'],'type':_0x5cf7c1['name'],'sectionId':_0x5cf7c1['id']},{})['then'](function(){return _0x51d322;});}else{return _0x51d322;}})[_0xbaea('0x40')](function(_0x1fa463){logger['error'](_0xbaea('0x4e'),_0x1fa463);throw _0x1fa463;});}return _0x51d322;})[_0xbaea('0x20')](respondWithResult(_0x3236b9,0xc9))['catch'](handleError(_0x3236b9,null));};exports[_0xbaea('0x4f')]=function(_0x4ec74a,_0x63f186){if(_0x4ec74a[_0xbaea('0x47')]['id']){delete _0x4ec74a[_0xbaea('0x47')]['id'];}return db[_0xbaea('0x28')]['find']({'where':{'id':_0x4ec74a['params']['id']}})[_0xbaea('0x20')](handleEntityNotFound(_0x63f186,null))[_0xbaea('0x20')](saveUpdates(_0x4ec74a[_0xbaea('0x47')],null))[_0xbaea('0x20')](respondWithResult(_0x63f186,null))[_0xbaea('0x40')](handleError(_0x63f186,null));};exports[_0xbaea('0x21')]=function(_0x45fea5,_0x53a191){return db[_0xbaea('0x28')][_0xbaea('0x45')]({'where':{'id':_0x45fea5[_0xbaea('0x42')]['id']}})[_0xbaea('0x20')](handleEntityNotFound(_0x53a191,null))[_0xbaea('0x20')](removeEntity(_0x53a191,null))[_0xbaea('0x40')](handleError(_0x53a191,null));};exports[_0xbaea('0x50')]=function(_0xc888e1,_0x4beb96,_0x485f38){return db[_0xbaea('0x28')][_0xbaea('0x45')]({'where':{'id':_0xc888e1[_0xbaea('0x42')]['id']},'attributes':[_0xbaea('0x26'),_0xbaea('0x51'),_0xbaea('0x52'),_0xbaea('0x53')],'raw':!![]})[_0xbaea('0x20')](handleEntityNotFound(_0x4beb96,null))[_0xbaea('0x20')](function(_0x15003a){if(_0x15003a){if(!fs[_0xbaea('0x54')](path['join'](config[_0xbaea('0x55')],'server/files/reports',_0x15003a[_0xbaea('0x52')]))){throw new db['Sequelize'][(_0xbaea('0x56'))](_0xbaea('0x57'));}if(_0xc888e1[_0xbaea('0x2c')]['exists']){return _0x4beb96['sendStatus'](0xc8);}return _0x4beb96[_0xbaea('0x50')](path[_0xbaea('0x58')](config['root'],_0xbaea('0x59'),_0x15003a[_0xbaea('0x52')]),util['format'](_0xbaea('0x5a'),_0x15003a['basename']||_0x15003a[_0xbaea('0x26')],_0x15003a[_0xbaea('0x53')][_0xbaea('0x5b')]()));}})[_0xbaea('0x40')](handleError(_0x4beb96,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 19cbbed..6943546 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 _0xcd59=['bluebird','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment'];(function(_0x98862f,_0x53f655){var _0x69c9ac=function(_0x477b28){while(--_0x477b28){_0x98862f['push'](_0x98862f['shift']());}};_0x69c9ac(++_0x53f655);}(_0xcd59,0x14b));var _0x9cd5=function(_0x5eca6f,_0x76ec15){_0x5eca6f=_0x5eca6f-0x0;var _0x4c34b7=_0xcd59[_0x5eca6f];return _0x4c34b7;};'use strict';var _=require(_0x9cd5('0x0'));var util=require(_0x9cd5('0x1'));var logger=require(_0x9cd5('0x2'))(_0x9cd5('0x3'));var moment=require(_0x9cd5('0x4'));var BPromise=require(_0x9cd5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9cd5('0x6'));var rimraf=require(_0x9cd5('0x7'));var config=require(_0x9cd5('0x8'));var attributes=require(_0x9cd5('0x9'));module[_0x9cd5('0xa')]=function(_0x2db192,_0x46277c){return _0x2db192[_0x9cd5('0xb')](_0x9cd5('0xc'),attributes,{'tableName':_0x9cd5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4c7=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','analytics_extracted_reports','lodash','util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x91521c,_0x5cbb47){_0x91521c=_0x91521c-0x0;var _0x230549=_0xb4c7[_0x91521c];return _0x230549;};'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')]('AnalyticExtractedReport',attributes,{'tableName':_0x7b4c('0xb'),'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 76d4609..79933fd 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 _0xc870=['stringify','error','code','message','result','catch','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x237173,_0x38a7){var _0x15e9ad=function(_0x56ece4){while(--_0x56ece4){_0x237173['push'](_0x237173['shift']());}};_0x15e9ad(++_0x38a7);}(_0xc870,0x11e));var _0x0c87=function(_0x35d09c,_0x2d80a3){_0x35d09c=_0x35d09c-0x0;var _0x195323=_0xc870[_0x35d09c];return _0x195323;};'use strict';var _=require('lodash');var util=require(_0x0c87('0x0'));var moment=require('moment');var BPromise=require(_0x0c87('0x1'));var rs=require(_0x0c87('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0c87('0x3'));var logger=require('../../config/logger')(_0x0c87('0x4'));var config=require(_0x0c87('0x5'));var jayson=require(_0x0c87('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d7b9f,_0x3a7904,_0x13859d){return new BPromise(function(_0x14eba4,_0x49e038){return client[_0x0c87('0x7')](_0x4d7b9f,_0x13859d)[_0x0c87('0x8')](function(_0x5d65d2){logger[_0x0c87('0x9')](_0x0c87('0xa'),_0x3a7904,_0x0c87('0xb'));logger[_0x0c87('0xc')](_0x0c87('0xd'),_0x3a7904,_0x0c87('0xb'),JSON[_0x0c87('0xe')](_0x5d65d2));if(_0x5d65d2[_0x0c87('0xf')]){if(_0x5d65d2[_0x0c87('0xf')][_0x0c87('0x10')]===0x1f4){logger['error'](_0x0c87('0xa'),_0x3a7904,_0x5d65d2[_0x0c87('0xf')][_0x0c87('0x11')]);return _0x49e038(_0x5d65d2['error'][_0x0c87('0x11')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x3a7904,_0x5d65d2['error'][_0x0c87('0x11')]);return _0x14eba4(_0x5d65d2[_0x0c87('0xf')]['message']);}else{logger[_0x0c87('0x9')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3a7904,_0x0c87('0xb'));_0x14eba4(_0x5d65d2[_0x0c87('0x12')][_0x0c87('0x11')]);}})[_0x0c87('0x13')](function(_0x39e824){logger[_0x0c87('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3a7904,_0x39e824);_0x49e038(_0x39e824);});});} \ No newline at end of file +var _0x36d7=['ioredis','../../config/logger','rpc','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0x36d7,0x171));var _0x736d=function(_0x49edf3,_0xc5f778){_0x49edf3=_0x49edf3-0x0;var _0xcb0f17=_0x36d7[_0x49edf3];return _0xcb0f17;};'use strict';var _=require(_0x736d('0x0'));var util=require(_0x736d('0x1'));var moment=require(_0x736d('0x2'));var BPromise=require(_0x736d('0x3'));var rs=require(_0x736d('0x4'));var fs=require('fs');var Redis=require(_0x736d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x736d('0x6'))(_0x736d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x736d('0x8')][_0x736d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49e29c,_0xf913ca,_0xd94466){return new BPromise(function(_0x3d8c24,_0x369c66){return client[_0x736d('0xa')](_0x49e29c,_0xd94466)[_0x736d('0xb')](function(_0x276eb9){logger[_0x736d('0xc')](_0x736d('0xd'),_0xf913ca,_0x736d('0xe'));logger[_0x736d('0xf')](_0x736d('0x10'),_0xf913ca,'request\x20sent',JSON['stringify'](_0x276eb9));if(_0x276eb9[_0x736d('0x11')]){if(_0x276eb9[_0x736d('0x11')][_0x736d('0x12')]===0x1f4){logger[_0x736d('0x11')](_0x736d('0xd'),_0xf913ca,_0x276eb9[_0x736d('0x11')][_0x736d('0x13')]);return _0x369c66(_0x276eb9['error'][_0x736d('0x13')]);}logger[_0x736d('0x11')](_0x736d('0xd'),_0xf913ca,_0x276eb9[_0x736d('0x11')][_0x736d('0x13')]);return _0x3d8c24(_0x276eb9[_0x736d('0x11')][_0x736d('0x13')]);}else{logger['info'](_0x736d('0xd'),_0xf913ca,_0x736d('0xe'));_0x3d8c24(_0x276eb9[_0x736d('0x14')]['message']);}})[_0x736d('0x15')](function(_0x365fd1){logger[_0x736d('0x11')](_0x736d('0xd'),_0xf913ca,_0x365fd1);_0x369c66(_0x365fd1);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index c092712..e24b82b 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 _0x3e9a=['exports','multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','download','post'];(function(_0x5af37c,_0x5a9ae0){var _0x4a9797=function(_0x2cdfe8){while(--_0x2cdfe8){_0x5af37c['push'](_0x5af37c['shift']());}};_0x4a9797(++_0x5a9ae0);}(_0x3e9a,0x7f));var _0xa3e9=function(_0x3401ab,_0x5e1301){_0x3401ab=_0x3401ab-0x0;var _0x438391=_0x3e9a[_0x3401ab];return _0x438391;};'use strict';var multer=require(_0xa3e9('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa3e9('0x1')]();var auth=require(_0xa3e9('0x2'));var interaction=require(_0xa3e9('0x3'));var config=require(_0xa3e9('0x4'));var controller=require(_0xa3e9('0x5'));router[_0xa3e9('0x6')]('/',auth[_0xa3e9('0x7')](),controller[_0xa3e9('0x8')]);router[_0xa3e9('0x6')](_0xa3e9('0x9'),auth[_0xa3e9('0x7')](),controller[_0xa3e9('0xa')]);router[_0xa3e9('0x6')]('/:id/download',auth[_0xa3e9('0x7')](),controller[_0xa3e9('0xb')]);router[_0xa3e9('0xc')]('/',auth[_0xa3e9('0x7')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xa3e9('0x9'),auth[_0xa3e9('0x7')](),controller['destroy']);module[_0xa3e9('0xd')]=router; \ No newline at end of file +var _0xd342=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','multer','util','path'];(function(_0xd3bdab,_0x5d784a){var _0x1c3178=function(_0x4f7ef4){while(--_0x4f7ef4){_0xd3bdab['push'](_0xd3bdab['shift']());}};_0x1c3178(++_0x5d784a);}(_0xd342,0x165));var _0x2d34=function(_0xdbd6cf,_0x2e5278){_0xdbd6cf=_0xdbd6cf-0x0;var _0x4694df=_0xd342[_0xdbd6cf];return _0x4694df;};'use strict';var multer=require(_0x2d34('0x0'));var util=require(_0x2d34('0x1'));var path=require(_0x2d34('0x2'));var timeout=require(_0x2d34('0x3'));var express=require(_0x2d34('0x4'));var router=express[_0x2d34('0x5')]();var auth=require(_0x2d34('0x6'));var interaction=require(_0x2d34('0x7'));var config=require(_0x2d34('0x8'));var controller=require(_0x2d34('0x9'));router[_0x2d34('0xa')]('/',auth[_0x2d34('0xb')](),controller[_0x2d34('0xc')]);router['get'](_0x2d34('0xd'),auth[_0x2d34('0xb')](),controller[_0x2d34('0xe')]);router[_0x2d34('0xa')](_0x2d34('0xf'),auth[_0x2d34('0xb')](),controller[_0x2d34('0x10')]);router[_0x2d34('0x11')]('/',auth[_0x2d34('0xb')](),controller[_0x2d34('0x12')]);router[_0x2d34('0x13')](_0x2d34('0xd'),auth[_0x2d34('0xb')](),controller['update']);router['delete']('/:id',auth[_0x2d34('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 62c47aa..0edd0d0 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 _0x1d2a=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x159c68,_0xc544c9){var _0x32792f=function(_0x3c4ed5){while(--_0x3c4ed5){_0x159c68['push'](_0x159c68['shift']());}};_0x32792f(++_0xc544c9);}(_0x1d2a,0x97));var _0xa1d2=function(_0x1b6928,_0x404cae){_0x1b6928=_0x1b6928-0x0;var _0x32833f=_0x1d2a[_0x1b6928];return _0x32833f;};'use strict';var Sequelize=require(_0xa1d2('0x0'));module[_0xa1d2('0x1')]={'field':{'type':Sequelize[_0xa1d2('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xa1d2('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xa1d2('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xa1d2('0x3')]},'custom':{'type':Sequelize[_0xa1d2('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x2586=['sequelize','exports','STRING','BOOLEAN'];(function(_0x3cec8c,_0x3f6c1d){var _0x38032e=function(_0x4ef75b){while(--_0x4ef75b){_0x3cec8c['push'](_0x3cec8c['shift']());}};_0x38032e(++_0x3f6c1d);}(_0x2586,0x164));var _0x6258=function(_0x148adb,_0x2fb952){_0x148adb=_0x148adb-0x0;var _0x1253c4=_0x2586[_0x148adb];return _0x1253c4;};'use strict';var Sequelize=require(_0x6258('0x0'));module[_0x6258('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x6258('0x2')]},'format':{'type':Sequelize[_0x6258('0x2')]},'groupBy':{'type':Sequelize[_0x6258('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x6258('0x2')]},'custom':{'type':Sequelize[_0x6258('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index a866b56..1e605c5 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 _0xb43c=['map','type','VIRTUAL','field','options','AnalyticFieldReport','include','findAll','catch','show','params','rawAttributes','length','find','body','bulkCreate','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','sendStatus','end','status','count','offset','limit','set','json','apply','save','update','then','destroy','error','stack','name','send','index','model','keys','query','attributes','intersection','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge'];(function(_0x2f189d,_0x55b162){var _0x57bbad=function(_0x119dd5){while(--_0x119dd5){_0x2f189d['push'](_0x2f189d['shift']());}};_0x57bbad(++_0x55b162);}(_0xb43c,0x1ea));var _0xcb43=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb43c[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xcb43('0x0'));var emlformat=require(_0xcb43('0x1'));var rimraf=require(_0xcb43('0x2'));var zipdir=require(_0xcb43('0x3'));var jsonpatch=require(_0xcb43('0x4'));var rp=require(_0xcb43('0x5'));var moment=require(_0xcb43('0x6'));var BPromise=require(_0xcb43('0x7'));var Mustache=require(_0xcb43('0x8'));var util=require(_0xcb43('0x9'));var path=require(_0xcb43('0xa'));var sox=require(_0xcb43('0xb'));var csv=require('to-csv');var ejs=require(_0xcb43('0xc'));var fs=require('fs');var _=require(_0xcb43('0xd'));var squel=require(_0xcb43('0xe'));var crypto=require(_0xcb43('0xf'));var jsforce=require(_0xcb43('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcb43('0x11'));var querystring=require(_0xcb43('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcb43('0x13'));var qs=require(_0xcb43('0x14'));var hardwareService=require(_0xcb43('0x15'));var logger=require(_0xcb43('0x16'))(_0xcb43('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x310d51,_0x880c79){_0x880c79=_0x880c79||0xcc;return function(_0x7355a3){if(_0x7355a3){return _0x310d51[_0xcb43('0x18')](_0x880c79);}return _0x310d51['status'](_0x880c79)[_0xcb43('0x19')]();};}function respondWithResult(_0x1a4528,_0x4004ff){_0x4004ff=_0x4004ff||0xc8;return function(_0x2b9725){if(_0x2b9725){return _0x1a4528[_0xcb43('0x1a')](_0x4004ff)['json'](_0x2b9725);}};}function respondWithFilteredResult(_0x13d749,_0xdcd747){return function(_0x3484fa){if(_0x3484fa){var _0x262339=_0x3484fa[_0xcb43('0x1b')],_0x11b5e6=_0xdcd747['offset'],_0x8e4800=_0xdcd747[_0xcb43('0x1c')]+_0xdcd747[_0xcb43('0x1d')],_0x294be5;if(_0x8e4800>=_0x262339){_0x8e4800=_0x262339;_0x294be5=0xc8;}else{_0x294be5=0xce;}_0x13d749[_0xcb43('0x1a')](_0x294be5);return _0x13d749[_0xcb43('0x1e')]('Content-Range',_0x11b5e6+'-'+_0x8e4800+'/'+_0x262339)[_0xcb43('0x1f')](_0x3484fa);}return null;};}function patchUpdates(_0x300f46){return function(_0x11a637){try{jsonpatch[_0xcb43('0x20')](_0x11a637,_0x300f46,!![]);}catch(_0x3660a3){return BPromise['reject'](_0x3660a3);}return _0x11a637[_0xcb43('0x21')]();};}function saveUpdates(_0x2f439b,_0xc0c417){return function(_0x12115f){if(_0x12115f){return _0x12115f[_0xcb43('0x22')](_0x2f439b)[_0xcb43('0x23')](function(_0x30dc17){return _0x30dc17;});}return null;};}function removeEntity(_0x3f878d,_0x5583c8){return function(_0x295070){if(_0x295070){return _0x295070[_0xcb43('0x24')]()[_0xcb43('0x23')](function(){_0x3f878d[_0xcb43('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31fa57,_0x5ba07b){return function(_0xf860d4){if(!_0xf860d4){_0x31fa57[_0xcb43('0x18')](0x194);}return _0xf860d4;};}function handleError(_0x5440a6,_0x328284){_0x328284=_0x328284||0x1f4;return function(_0x32c742){logger[_0xcb43('0x25')](_0x32c742[_0xcb43('0x26')]);if(_0x32c742[_0xcb43('0x27')]){delete _0x32c742[_0xcb43('0x27')];}_0x5440a6['status'](_0x328284)[_0xcb43('0x28')](_0x32c742);};}exports[_0xcb43('0x29')]=function(_0x40e064,_0x3ad9fa){var _0x4bb32b={},_0x5b25df={},_0x34b278={'count':0x0,'rows':[]};var _0x1c0d69=db['AnalyticFieldReport']['rawAttributes'];_0x5b25df[_0xcb43('0x2a')]=_['keys'](_0x1c0d69);_0x5b25df['query']=_[_0xcb43('0x2b')](_0x40e064[_0xcb43('0x2c')]);_0x5b25df['filters']=_['intersection'](_0x5b25df[_0xcb43('0x2a')],_0x5b25df['query']);_0x4bb32b[_0xcb43('0x2d')]=_[_0xcb43('0x2e')](_0x5b25df['model'],qs[_0xcb43('0x2f')](_0x40e064[_0xcb43('0x2c')][_0xcb43('0x2f')]));_0x4bb32b['attributes']=_0x4bb32b['attributes']['length']?_0x4bb32b[_0xcb43('0x2d')]:_0x5b25df[_0xcb43('0x2a')];if(!_0x40e064['query'][_0xcb43('0x30')]('nolimit')){_0x4bb32b[_0xcb43('0x1d')]=qs['limit'](_0x40e064[_0xcb43('0x2c')][_0xcb43('0x1d')]);_0x4bb32b[_0xcb43('0x1c')]=qs[_0xcb43('0x1c')](_0x40e064[_0xcb43('0x2c')][_0xcb43('0x1c')]);}_0x4bb32b[_0xcb43('0x31')]=qs[_0xcb43('0x32')](_0x40e064[_0xcb43('0x2c')]['sort']);_0x4bb32b[_0xcb43('0x33')]=qs[_0xcb43('0x34')](_[_0xcb43('0x35')](_0x40e064[_0xcb43('0x2c')],_0x5b25df[_0xcb43('0x34')]));if(_0x40e064[_0xcb43('0x2c')][_0xcb43('0x36')]){_0x4bb32b[_0xcb43('0x33')]=_[_0xcb43('0x37')](_0x4bb32b[_0xcb43('0x33')],{'$or':_[_0xcb43('0x38')](_0x1c0d69,function(_0x110e40){if(_0x110e40[_0xcb43('0x39')]['key']!==_0xcb43('0x3a')){var _0x47bbfb={};_0x47bbfb[_0x110e40[_0xcb43('0x3b')]]={'$like':'%'+_0x40e064[_0xcb43('0x2c')]['filter']+'%'};return _0x47bbfb;}})});}_0x4bb32b=_[_0xcb43('0x37')]({},_0x4bb32b,_0x40e064[_0xcb43('0x3c')]);var _0x446f09={'where':_0x4bb32b['where']};return db[_0xcb43('0x3d')][_0xcb43('0x1b')](_0x446f09)[_0xcb43('0x23')](function(_0xe79476){_0x34b278['count']=_0xe79476;if(_0x40e064[_0xcb43('0x2c')]['includeAll']){_0x4bb32b[_0xcb43('0x3e')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xcb43('0x3f')](_0x4bb32b);})[_0xcb43('0x23')](function(_0x45847e){_0x34b278['rows']=_0x45847e;return _0x34b278;})[_0xcb43('0x23')](respondWithFilteredResult(_0x3ad9fa,_0x4bb32b))[_0xcb43('0x40')](handleError(_0x3ad9fa,null));};exports[_0xcb43('0x41')]=function(_0x11aa19,_0x85d2ab){var _0x1a5ded={'raw':![],'where':{'id':_0x11aa19[_0xcb43('0x42')]['id']}},_0x29d1f4={};_0x29d1f4['model']=_[_0xcb43('0x2b')](db[_0xcb43('0x3d')][_0xcb43('0x43')]);_0x29d1f4[_0xcb43('0x2c')]=_['keys'](_0x11aa19[_0xcb43('0x2c')]);_0x29d1f4[_0xcb43('0x34')]=_[_0xcb43('0x2e')](_0x29d1f4[_0xcb43('0x2a')],_0x29d1f4['query']);_0x1a5ded[_0xcb43('0x2d')]=_[_0xcb43('0x2e')](_0x29d1f4['model'],qs[_0xcb43('0x2f')](_0x11aa19[_0xcb43('0x2c')][_0xcb43('0x2f')]));_0x1a5ded['attributes']=_0x1a5ded[_0xcb43('0x2d')][_0xcb43('0x44')]?_0x1a5ded['attributes']:_0x29d1f4[_0xcb43('0x2a')];if(_0x11aa19[_0xcb43('0x2c')]['includeAll']){_0x1a5ded[_0xcb43('0x3e')]=[{'all':!![]}];}_0x1a5ded=_[_0xcb43('0x37')]({},_0x1a5ded,_0x11aa19[_0xcb43('0x3c')]);return db[_0xcb43('0x3d')][_0xcb43('0x45')](_0x1a5ded)[_0xcb43('0x23')](handleEntityNotFound(_0x85d2ab,null))[_0xcb43('0x23')](respondWithResult(_0x85d2ab,null))[_0xcb43('0x40')](handleError(_0x85d2ab,null));};exports['create']=function(_0x44e4f3,_0x477ed3){return db[_0xcb43('0x3d')]['create'](_0x44e4f3[_0xcb43('0x46')],{})[_0xcb43('0x23')](respondWithResult(_0x477ed3,0xc9))[_0xcb43('0x40')](handleError(_0x477ed3,null));};exports[_0xcb43('0x47')]=function(_0x5506fd,_0x20d7f8){return db['AnalyticFieldReport'][_0xcb43('0x47')](_0x5506fd[_0xcb43('0x46')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x20d7f8,0xc9))['catch'](handleError(_0x20d7f8,null));};exports[_0xcb43('0x22')]=function(_0x2c2aa7,_0x54b83c){if(_0x2c2aa7['body']['id']){delete _0x2c2aa7['body']['id'];}return db[_0xcb43('0x3d')][_0xcb43('0x45')]({'where':{'id':_0x2c2aa7[_0xcb43('0x42')]['id']}})[_0xcb43('0x23')](handleEntityNotFound(_0x54b83c,null))[_0xcb43('0x23')](saveUpdates(_0x2c2aa7['body'],null))[_0xcb43('0x23')](respondWithResult(_0x54b83c,null))['catch'](handleError(_0x54b83c,null));};exports[_0xcb43('0x24')]=function(_0x299322,_0x2cf704){return db[_0xcb43('0x3d')]['find']({'where':{'id':_0x299322[_0xcb43('0x42')]['id']}})['then'](handleEntityNotFound(_0x2cf704,null))[_0xcb43('0x23')](removeEntity(_0x2cf704,null))[_0xcb43('0x40')](handleError(_0x2cf704,null));};exports[_0xcb43('0x48')]=function(_0x1ee374,_0x28e950){return db[_0xcb43('0x3d')][_0xcb43('0x24')]({'where':{'id':_0x1ee374[_0xcb43('0x2c')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xcb43('0x23')](respondWithResult(_0x28e950,0xcc))['catch'](handleError(_0x28e950,null));};exports[_0xcb43('0x49')]=function(_0x54ff82,_0x1f444b,_0x22a399){return db[_0xcb43('0x4a')][_0xcb43('0x4b')]({'where':{'id':_0x54ff82['params']['id']}})[_0xcb43('0x23')](handleEntityNotFound(_0x1f444b,null))[_0xcb43('0x23')](function(_0x2e39f2){if(_0x2e39f2){return db[_0xcb43('0x4c')][_0xcb43('0x4d')](function(_0x52ca5c){return db[_0xcb43('0x3d')][_0xcb43('0x24')]({'where':{'CustomReportId':_0x54ff82[_0xcb43('0x42')]['id']},'transaction':_0x52ca5c})['then'](function(_0x5d0223){var _0x21e6fb=_['map'](_0x54ff82[_0xcb43('0x46')],function(_0x6df34){delete _0x6df34['id'];_0x6df34['CustomReportId']=_0x54ff82[_0xcb43('0x42')]['id'];return _0x6df34;});return db[_0xcb43('0x3d')][_0xcb43('0x47')](_0x21e6fb,{'transaction':_0x52ca5c});});})[_0xcb43('0x23')](function(){return db[_0xcb43('0x3d')][_0xcb43('0x3f')]({'where':{'CustomReportId':_0x54ff82[_0xcb43('0x42')]['id']}});});}})[_0xcb43('0x23')](respondWithResult(_0x1f444b,null))['catch'](handleError(_0x1f444b,null));}; \ No newline at end of file +var _0x2a2b=['offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','type','key','VIRTUAL','field','options','includeAll','include','AnalyticFieldReport','rows','catch','show','params','merge','find','create','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','end','status','json','count'];(function(_0x5ef55a,_0x2a03b1){var _0x20ae40=function(_0x46ce81){while(--_0x46ce81){_0x5ef55a['push'](_0x5ef55a['shift']());}};_0x20ae40(++_0x2a03b1);}(_0x2a2b,0x1de));var _0xb2a2=function(_0x11e73d,_0x1b3fbd){_0x11e73d=_0x11e73d-0x0;var _0x4d8eac=_0x2a2b[_0x11e73d];return _0x4d8eac;};'use strict';var pdf=require(_0xb2a2('0x0'));var emlformat=require(_0xb2a2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb2a2('0x2'));var jsonpatch=require(_0xb2a2('0x3'));var rp=require(_0xb2a2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb2a2('0x5'));var path=require(_0xb2a2('0x6'));var sox=require(_0xb2a2('0x7'));var csv=require(_0xb2a2('0x8'));var ejs=require(_0xb2a2('0x9'));var fs=require('fs');var _=require(_0xb2a2('0xa'));var squel=require(_0xb2a2('0xb'));var crypto=require('crypto');var jsforce=require(_0xb2a2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb2a2('0x8'));var querystring=require(_0xb2a2('0xd'));var Papa=require(_0xb2a2('0xe'));var Redis=require(_0xb2a2('0xf'));var authService=require(_0xb2a2('0x10'));var qs=require(_0xb2a2('0x11'));var hardwareService=require(_0xb2a2('0x12'));var logger=require('../../config/logger')(_0xb2a2('0x13'));var utils=require(_0xb2a2('0x14'));var config=require(_0xb2a2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x348841,_0x2c9170){_0x2c9170=_0x2c9170||0xcc;return function(_0x202159){if(_0x202159){return _0x348841['sendStatus'](_0x2c9170);}return _0x348841['status'](_0x2c9170)[_0xb2a2('0x16')]();};}function respondWithResult(_0x205f9d,_0x95aab0){_0x95aab0=_0x95aab0||0xc8;return function(_0x2b79b7){if(_0x2b79b7){return _0x205f9d[_0xb2a2('0x17')](_0x95aab0)[_0xb2a2('0x18')](_0x2b79b7);}};}function respondWithFilteredResult(_0x32e1ea,_0x477ea5){return function(_0x49542a){if(_0x49542a){var _0x26a932=_0x49542a[_0xb2a2('0x19')],_0x1785aa=_0x477ea5[_0xb2a2('0x1a')],_0x36f9e7=_0x477ea5[_0xb2a2('0x1a')]+_0x477ea5[_0xb2a2('0x1b')],_0x21fa28;if(_0x36f9e7>=_0x26a932){_0x36f9e7=_0x26a932;_0x21fa28=0xc8;}else{_0x21fa28=0xce;}_0x32e1ea[_0xb2a2('0x17')](_0x21fa28);return _0x32e1ea[_0xb2a2('0x1c')](_0xb2a2('0x1d'),_0x1785aa+'-'+_0x36f9e7+'/'+_0x26a932)[_0xb2a2('0x18')](_0x49542a);}return null;};}function patchUpdates(_0x31c012){return function(_0x3ae9e9){try{jsonpatch[_0xb2a2('0x1e')](_0x3ae9e9,_0x31c012,!![]);}catch(_0x5855b2){return BPromise['reject'](_0x5855b2);}return _0x3ae9e9[_0xb2a2('0x1f')]();};}function saveUpdates(_0x484bcc,_0x3d3847){return function(_0x44984a){if(_0x44984a){return _0x44984a[_0xb2a2('0x20')](_0x484bcc)[_0xb2a2('0x21')](function(_0x5930e3){return _0x5930e3;});}return null;};}function removeEntity(_0x46dc40,_0x2797b8){return function(_0x409095){if(_0x409095){return _0x409095[_0xb2a2('0x22')]()[_0xb2a2('0x21')](function(){_0x46dc40[_0xb2a2('0x17')](0xcc)[_0xb2a2('0x16')]();});}};}function handleEntityNotFound(_0x13b8b6,_0xe052c5){return function(_0xe01b68){if(!_0xe01b68){_0x13b8b6[_0xb2a2('0x23')](0x194);}return _0xe01b68;};}function handleError(_0x175aa4,_0x9aa6c8){_0x9aa6c8=_0x9aa6c8||0x1f4;return function(_0x3391c6){logger[_0xb2a2('0x24')](_0x3391c6[_0xb2a2('0x25')]);if(_0x3391c6[_0xb2a2('0x26')]){delete _0x3391c6[_0xb2a2('0x26')];}_0x175aa4[_0xb2a2('0x17')](_0x9aa6c8)[_0xb2a2('0x27')](_0x3391c6);};}exports[_0xb2a2('0x28')]=function(_0x5ea1fc,_0xcd01a2){var _0x121a48={},_0x59b395={},_0x20c828={'count':0x0,'rows':[]};var _0x1ad9be=db['AnalyticFieldReport'][_0xb2a2('0x29')];_0x59b395[_0xb2a2('0x2a')]=_[_0xb2a2('0x2b')](_0x1ad9be);_0x59b395[_0xb2a2('0x2c')]=_['keys'](_0x5ea1fc['query']);_0x59b395[_0xb2a2('0x2d')]=_[_0xb2a2('0x2e')](_0x59b395[_0xb2a2('0x2a')],_0x59b395[_0xb2a2('0x2c')]);_0x121a48[_0xb2a2('0x2f')]=_['intersection'](_0x59b395[_0xb2a2('0x2a')],qs['fields'](_0x5ea1fc[_0xb2a2('0x2c')][_0xb2a2('0x30')]));_0x121a48['attributes']=_0x121a48[_0xb2a2('0x2f')][_0xb2a2('0x31')]?_0x121a48['attributes']:_0x59b395[_0xb2a2('0x2a')];if(!_0x5ea1fc[_0xb2a2('0x2c')][_0xb2a2('0x32')](_0xb2a2('0x33'))){_0x121a48['limit']=qs[_0xb2a2('0x1b')](_0x5ea1fc[_0xb2a2('0x2c')][_0xb2a2('0x1b')]);_0x121a48[_0xb2a2('0x1a')]=qs[_0xb2a2('0x1a')](_0x5ea1fc['query'][_0xb2a2('0x1a')]);}_0x121a48[_0xb2a2('0x34')]=qs[_0xb2a2('0x35')](_0x5ea1fc[_0xb2a2('0x2c')][_0xb2a2('0x35')]);_0x121a48['where']=qs[_0xb2a2('0x2d')](_[_0xb2a2('0x36')](_0x5ea1fc[_0xb2a2('0x2c')],_0x59b395[_0xb2a2('0x2d')]));if(_0x5ea1fc[_0xb2a2('0x2c')][_0xb2a2('0x37')]){_0x121a48[_0xb2a2('0x38')]=_['merge'](_0x121a48['where'],{'$or':_[_0xb2a2('0x39')](_0x1ad9be,function(_0x1e3572){if(_0x1e3572[_0xb2a2('0x3a')][_0xb2a2('0x3b')]!==_0xb2a2('0x3c')){var _0x6f3378={};_0x6f3378[_0x1e3572[_0xb2a2('0x3d')]]={'$like':'%'+_0x5ea1fc[_0xb2a2('0x2c')]['filter']+'%'};return _0x6f3378;}})});}_0x121a48=_['merge']({},_0x121a48,_0x5ea1fc[_0xb2a2('0x3e')]);var _0x23776f={'where':_0x121a48[_0xb2a2('0x38')]};return db['AnalyticFieldReport'][_0xb2a2('0x19')](_0x23776f)[_0xb2a2('0x21')](function(_0x3a6493){_0x20c828[_0xb2a2('0x19')]=_0x3a6493;if(_0x5ea1fc[_0xb2a2('0x2c')][_0xb2a2('0x3f')]){_0x121a48[_0xb2a2('0x40')]=[{'all':!![]}];}return db[_0xb2a2('0x41')]['findAll'](_0x121a48);})['then'](function(_0x2e7c48){_0x20c828[_0xb2a2('0x42')]=_0x2e7c48;return _0x20c828;})[_0xb2a2('0x21')](respondWithFilteredResult(_0xcd01a2,_0x121a48))[_0xb2a2('0x43')](handleError(_0xcd01a2,null));};exports[_0xb2a2('0x44')]=function(_0x25680d,_0x1a9678){var _0xffbca9={'raw':![],'where':{'id':_0x25680d[_0xb2a2('0x45')]['id']}},_0x41ca41={};_0x41ca41[_0xb2a2('0x2a')]=_[_0xb2a2('0x2b')](db[_0xb2a2('0x41')][_0xb2a2('0x29')]);_0x41ca41['query']=_['keys'](_0x25680d[_0xb2a2('0x2c')]);_0x41ca41[_0xb2a2('0x2d')]=_[_0xb2a2('0x2e')](_0x41ca41[_0xb2a2('0x2a')],_0x41ca41[_0xb2a2('0x2c')]);_0xffbca9['attributes']=_[_0xb2a2('0x2e')](_0x41ca41['model'],qs[_0xb2a2('0x30')](_0x25680d[_0xb2a2('0x2c')][_0xb2a2('0x30')]));_0xffbca9[_0xb2a2('0x2f')]=_0xffbca9[_0xb2a2('0x2f')][_0xb2a2('0x31')]?_0xffbca9[_0xb2a2('0x2f')]:_0x41ca41[_0xb2a2('0x2a')];if(_0x25680d[_0xb2a2('0x2c')][_0xb2a2('0x3f')]){_0xffbca9['include']=[{'all':!![]}];}_0xffbca9=_[_0xb2a2('0x46')]({},_0xffbca9,_0x25680d[_0xb2a2('0x3e')]);return db[_0xb2a2('0x41')][_0xb2a2('0x47')](_0xffbca9)[_0xb2a2('0x21')](handleEntityNotFound(_0x1a9678,null))[_0xb2a2('0x21')](respondWithResult(_0x1a9678,null))[_0xb2a2('0x43')](handleError(_0x1a9678,null));};exports[_0xb2a2('0x48')]=function(_0x59ba85,_0x1e1d1f){return db[_0xb2a2('0x41')][_0xb2a2('0x48')](_0x59ba85['body'],{})[_0xb2a2('0x21')](respondWithResult(_0x1e1d1f,0xc9))['catch'](handleError(_0x1e1d1f,null));};exports[_0xb2a2('0x49')]=function(_0x244c0a,_0x3b9dfe){return db[_0xb2a2('0x41')][_0xb2a2('0x49')](_0x244c0a['body'],{'raw':![],'individualHooks':!![]})[_0xb2a2('0x21')](respondWithResult(_0x3b9dfe,0xc9))[_0xb2a2('0x43')](handleError(_0x3b9dfe,null));};exports[_0xb2a2('0x20')]=function(_0x1a4584,_0xa30970){if(_0x1a4584[_0xb2a2('0x4a')]['id']){delete _0x1a4584[_0xb2a2('0x4a')]['id'];}return db[_0xb2a2('0x41')]['find']({'where':{'id':_0x1a4584['params']['id']}})[_0xb2a2('0x21')](handleEntityNotFound(_0xa30970,null))[_0xb2a2('0x21')](saveUpdates(_0x1a4584[_0xb2a2('0x4a')],null))[_0xb2a2('0x21')](respondWithResult(_0xa30970,null))[_0xb2a2('0x43')](handleError(_0xa30970,null));};exports[_0xb2a2('0x22')]=function(_0x4e9424,_0x2a773c){return db['AnalyticFieldReport'][_0xb2a2('0x47')]({'where':{'id':_0x4e9424[_0xb2a2('0x45')]['id']}})[_0xb2a2('0x21')](handleEntityNotFound(_0x2a773c,null))[_0xb2a2('0x21')](removeEntity(_0x2a773c,null))[_0xb2a2('0x43')](handleError(_0x2a773c,null));};exports[_0xb2a2('0x4b')]=function(_0x2b6cfb,_0x54caf4){return db[_0xb2a2('0x41')]['destroy']({'where':{'id':_0x2b6cfb[_0xb2a2('0x2c')][_0xb2a2('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0xb2a2('0x21')](respondWithResult(_0x54caf4,0xcc))['catch'](handleError(_0x54caf4,null));};exports[_0xb2a2('0x4d')]=function(_0x1be4a9,_0x4c6224,_0x51cdaa){return db[_0xb2a2('0x4e')][_0xb2a2('0x4f')]({'where':{'id':_0x1be4a9[_0xb2a2('0x45')]['id']}})['then'](handleEntityNotFound(_0x4c6224,null))[_0xb2a2('0x21')](function(_0x1e92af){if(_0x1e92af){return db[_0xb2a2('0x50')][_0xb2a2('0x51')](function(_0x43bc38){return db[_0xb2a2('0x41')][_0xb2a2('0x22')]({'where':{'CustomReportId':_0x1be4a9['params']['id']},'transaction':_0x43bc38})[_0xb2a2('0x21')](function(_0x3a63b4){var _0x2de2ef=_[_0xb2a2('0x39')](_0x1be4a9['body'],function(_0x1dde1c){delete _0x1dde1c['id'];_0x1dde1c[_0xb2a2('0x52')]=_0x1be4a9[_0xb2a2('0x45')]['id'];return _0x1dde1c;});return db[_0xb2a2('0x41')]['bulkCreate'](_0x2de2ef,{'transaction':_0x43bc38});});})[_0xb2a2('0x21')](function(){return db[_0xb2a2('0x41')][_0xb2a2('0x53')]({'where':{'CustomReportId':_0x1be4a9[_0xb2a2('0x45')]['id']}});});}})['then'](respondWithResult(_0x4c6224,null))[_0xb2a2('0x43')](handleError(_0x4c6224,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index fd39981..933a941 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 _0xf364=['request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','moment','bluebird'];(function(_0x3122c1,_0x325686){var _0x490f8e=function(_0x595044){while(--_0x595044){_0x3122c1['push'](_0x3122c1['shift']());}};_0x490f8e(++_0x325686);}(_0xf364,0x194));var _0x4f36=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xf364[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x4f36('0x0'));var util=require('util');var logger=require(_0x4f36('0x1'))('api');var moment=require(_0x4f36('0x2'));var BPromise=require(_0x4f36('0x3'));var rp=require(_0x4f36('0x4'));var fs=require('fs');var path=require(_0x4f36('0x5'));var rimraf=require(_0x4f36('0x6'));var config=require(_0x4f36('0x7'));var attributes=require(_0x4f36('0x8'));module[_0x4f36('0x9')]=function(_0x42e919,_0x1dc721){return _0x42e919['define'](_0x4f36('0xa'),attributes,{'tableName':_0x4f36('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5c4=['AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x5f5c8c,_0x2e3b21){var _0x4c4772=function(_0x421b36){while(--_0x421b36){_0x5f5c8c['push'](_0x5f5c8c['shift']());}};_0x4c4772(++_0x2e3b21);}(_0xd5c4,0x12d));var _0x4d5c=function(_0x40c4a5,_0x6646e2){_0x40c4a5=_0x40c4a5-0x0;var _0x1a2610=_0xd5c4[_0x40c4a5];return _0x1a2610;};'use strict';var _=require(_0x4d5c('0x0'));var util=require(_0x4d5c('0x1'));var logger=require(_0x4d5c('0x2'))(_0x4d5c('0x3'));var moment=require(_0x4d5c('0x4'));var BPromise=require(_0x4d5c('0x5'));var rp=require(_0x4d5c('0x6'));var fs=require('fs');var path=require(_0x4d5c('0x7'));var rimraf=require('rimraf');var config=require(_0x4d5c('0x8'));var attributes=require('./analyticFieldReport.attributes');module[_0x4d5c('0x9')]=function(_0x5b0d7b,_0x453881){return _0x5b0d7b[_0x4d5c('0xa')](_0x4d5c('0xb'),attributes,{'tableName':_0x4d5c('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 8ff677d..38a1cf4 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 _0x126e=['request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1bcb4a,_0x4c6e6d){var _0x4655c6=function(_0xb19e93){while(--_0xb19e93){_0x1bcb4a['push'](_0x1bcb4a['shift']());}};_0x4655c6(++_0x4c6e6d);}(_0x126e,0x108));var _0xe126=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x126e[_0x18ab2a];return _0x16dcee;};'use strict';var _=require('lodash');var util=require(_0xe126('0x0'));var moment=require(_0xe126('0x1'));var BPromise=require(_0xe126('0x2'));var rs=require(_0xe126('0x3'));var fs=require('fs');var Redis=require(_0xe126('0x4'));var db=require(_0xe126('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe126('0x6'))(_0xe126('0x7'));var config=require(_0xe126('0x8'));var jayson=require(_0xe126('0x9'));var client=jayson[_0xe126('0xa')][_0xe126('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10210f,_0x47ae76,_0x316be0){return new BPromise(function(_0x19f94e,_0x437fd0){return client[_0xe126('0xc')](_0x10210f,_0x316be0)[_0xe126('0xd')](function(_0x5e8c30){logger[_0xe126('0xe')](_0xe126('0xf'),_0x47ae76,'request\x20sent');logger[_0xe126('0x10')](_0xe126('0x11'),_0x47ae76,'request\x20sent',JSON[_0xe126('0x12')](_0x5e8c30));if(_0x5e8c30['error']){if(_0x5e8c30[_0xe126('0x13')]['code']===0x1f4){logger[_0xe126('0x13')](_0xe126('0xf'),_0x47ae76,_0x5e8c30[_0xe126('0x13')][_0xe126('0x14')]);return _0x437fd0(_0x5e8c30[_0xe126('0x13')][_0xe126('0x14')]);}logger[_0xe126('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x47ae76,_0x5e8c30[_0xe126('0x13')][_0xe126('0x14')]);return _0x19f94e(_0x5e8c30['error'][_0xe126('0x14')]);}else{logger[_0xe126('0xe')](_0xe126('0xf'),_0x47ae76,_0xe126('0x15'));_0x19f94e(_0x5e8c30['result'][_0xe126('0x14')]);}})[_0xe126('0x16')](function(_0x1c32fe){logger['error'](_0xe126('0xf'),_0x47ae76,_0x1c32fe);_0x437fd0(_0x1c32fe);});});} \ No newline at end of file +var _0x5d17=['request','info','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x85fbb2,_0x55d447){var _0x2c94e5=function(_0x3bd403){while(--_0x3bd403){_0x85fbb2['push'](_0x85fbb2['shift']());}};_0x2c94e5(++_0x55d447);}(_0x5d17,0x114));var _0x75d1=function(_0x528497,_0x147e87){_0x528497=_0x528497-0x0;var _0x392d59=_0x5d17[_0x528497];return _0x392d59;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x75d1('0x2'));var fs=require('fs');var Redis=require(_0x75d1('0x3'));var db=require(_0x75d1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x75d1('0x5'))(_0x75d1('0x6'));var config=require(_0x75d1('0x7'));var jayson=require(_0x75d1('0x8'));var client=jayson['client'][_0x75d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x116a51,_0x5c957a,_0x1ee61b){return new BPromise(function(_0x3a9d5e,_0x105607){return client[_0x75d1('0xa')](_0x116a51,_0x1ee61b)['then'](function(_0x4cf632){logger[_0x75d1('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5c957a,'request\x20sent');logger[_0x75d1('0xc')](_0x75d1('0xd'),_0x5c957a,'request\x20sent',JSON[_0x75d1('0xe')](_0x4cf632));if(_0x4cf632[_0x75d1('0xf')]){if(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x10')]===0x1f4){logger[_0x75d1('0xf')](_0x75d1('0x11'),_0x5c957a,_0x4cf632['error'][_0x75d1('0x12')]);return _0x105607(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x12')]);}logger[_0x75d1('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5c957a,_0x4cf632['error']['message']);return _0x3a9d5e(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x12')]);}else{logger[_0x75d1('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5c957a,_0x75d1('0x13'));_0x3a9d5e(_0x4cf632[_0x75d1('0x14')][_0x75d1('0x12')]);}})[_0x75d1('0x15')](function(_0x1160ca){logger[_0x75d1('0xf')](_0x75d1('0x11'),_0x5c957a,_0x1160ca);_0x105607(_0x1160ca);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 83ffeec..826c18a 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 _0x34b7=['update','delete','/destroy_many','bulkDestroy','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','post','/:id/create_many','addFields','put'];(function(_0x1a6d68,_0x12dae9){var _0x3fff=function(_0x18d22c){while(--_0x18d22c){_0x1a6d68['push'](_0x1a6d68['shift']());}};_0x3fff(++_0x12dae9);}(_0x34b7,0x196));var _0x734b=function(_0x496c30,_0x4f32cf){_0x496c30=_0x496c30-0x0;var _0x168fbb=_0x34b7[_0x496c30];return _0x168fbb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x734b('0x0'));var timeout=require(_0x734b('0x1'));var express=require(_0x734b('0x2'));var router=express[_0x734b('0x3')]();var auth=require(_0x734b('0x4'));var interaction=require(_0x734b('0x5'));var config=require('../../config/environment');var controller=require('./analyticFieldReport.controller');router[_0x734b('0x6')]('/',auth[_0x734b('0x7')](),controller[_0x734b('0x8')]);router[_0x734b('0x6')](_0x734b('0x9'),auth[_0x734b('0x7')](),controller['show']);router[_0x734b('0xa')]('/',auth[_0x734b('0x7')](),controller['create']);router['post']('/create_many',auth[_0x734b('0x7')](),controller['bulkCreate']);router[_0x734b('0xa')](_0x734b('0xb'),auth[_0x734b('0x7')](),controller[_0x734b('0xc')]);router[_0x734b('0xd')](_0x734b('0x9'),auth[_0x734b('0x7')](),controller[_0x734b('0xe')]);router[_0x734b('0xf')](_0x734b('0x10'),auth[_0x734b('0x7')](),controller[_0x734b('0x11')]);router[_0x734b('0xf')](_0x734b('0x9'),auth['isAuthenticated'](),controller[_0x734b('0x12')]);module[_0x734b('0x13')]=router; \ No newline at end of file +var _0x22fb=['delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','/create_many','bulkCreate','/:id/create_many','addFields','update','bulkDestroy'];(function(_0x43167d,_0x589fb8){var _0x112ec8=function(_0x578318){while(--_0x578318){_0x43167d['push'](_0x43167d['shift']());}};_0x112ec8(++_0x589fb8);}(_0x22fb,0x192));var _0xb22f=function(_0x180618,_0x559091){_0x180618=_0x180618-0x0;var _0x15755d=_0x22fb[_0x180618];return _0x15755d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb22f('0x0'));var timeout=require('connect-timeout');var express=require(_0xb22f('0x1'));var router=express[_0xb22f('0x2')]();var auth=require(_0xb22f('0x3'));var interaction=require(_0xb22f('0x4'));var config=require(_0xb22f('0x5'));var controller=require('./analyticFieldReport.controller');router[_0xb22f('0x6')]('/',auth[_0xb22f('0x7')](),controller[_0xb22f('0x8')]);router[_0xb22f('0x6')](_0xb22f('0x9'),auth[_0xb22f('0x7')](),controller['show']);router[_0xb22f('0xa')]('/',auth[_0xb22f('0x7')](),controller[_0xb22f('0xb')]);router[_0xb22f('0xa')](_0xb22f('0xc'),auth[_0xb22f('0x7')](),controller[_0xb22f('0xd')]);router[_0xb22f('0xa')](_0xb22f('0xe'),auth[_0xb22f('0x7')](),controller[_0xb22f('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb22f('0x10')]);router['delete']('/destroy_many',auth['isAuthenticated'](),controller[_0xb22f('0x11')]);router[_0xb22f('0x12')](_0xb22f('0x9'),auth[_0xb22f('0x7')](),controller[_0xb22f('0x13')]);module[_0xb22f('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index bb39c17..d285d5b 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 _0x1a19=['name','TEXT','STRING'];(function(_0x4b7d85,_0x541121){var _0x593073=function(_0x89d9a2){while(--_0x89d9a2){_0x4b7d85['push'](_0x4b7d85['shift']());}};_0x593073(++_0x541121);}(_0x1a19,0x68));var _0x91a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a19[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x91a1('0x0')],'allowNull':![],'unique':_0x91a1('0x1')},'table':{'type':Sequelize[_0x91a1('0x0')]},'metric':{'type':Sequelize[_0x91a1('0x2')]},'description':{'type':Sequelize[_0x91a1('0x0')]}}; \ No newline at end of file +var _0x985f=['STRING','name','sequelize'];(function(_0x729c4c,_0x55989b){var _0x4b066b=function(_0x3e4e97){while(--_0x3e4e97){_0x729c4c['push'](_0x729c4c['shift']());}};_0x4b066b(++_0x55989b);}(_0x985f,0xd4));var _0xf985=function(_0x192a0c,_0x299c0f){_0x192a0c=_0x192a0c-0x0;var _0x42ac96=_0x985f[_0x192a0c];return _0x42ac96;};'use strict';var Sequelize=require(_0xf985('0x0'));module['exports']={'name':{'type':Sequelize[_0xf985('0x1')],'allowNull':![],'unique':_0xf985('0x2')},'table':{'type':Sequelize[_0xf985('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xf985('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 2a5201c..8965436 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 _0x7c6a=['VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','fast-json-patch','request-promise','bluebird','mustache','util','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','get','Metrics','sendStatus','stack','name','index','AnalyticMetric','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','map','type','key'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7c6a,0xae));var _0xa7c6=function(_0x49f250,_0x446fac){_0x49f250=_0x49f250-0x0;var _0x5e8ff2=_0x7c6a[_0x49f250];return _0x5e8ff2;};'use strict';var pdf=require(_0xa7c6('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa7c6('0x1'));var rp=require(_0xa7c6('0x2'));var moment=require('moment');var BPromise=require(_0xa7c6('0x3'));var Mustache=require(_0xa7c6('0x4'));var util=require(_0xa7c6('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xa7c6('0x6'));var squel=require(_0xa7c6('0x7'));var crypto=require(_0xa7c6('0x8'));var jsforce=require(_0xa7c6('0x9'));var deskjs=require(_0xa7c6('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa7c6('0xb'));var Redis=require(_0xa7c6('0xc'));var authService=require(_0xa7c6('0xd'));var qs=require(_0xa7c6('0xe'));var hardwareService=require(_0xa7c6('0xf'));var logger=require(_0xa7c6('0x10'))(_0xa7c6('0x11'));var utils=require(_0xa7c6('0x12'));var config=require('../../config/environment');var db=require(_0xa7c6('0x13'))['db'];function respondWithStatusCode(_0x1d4464,_0x2de360){_0x2de360=_0x2de360||0xcc;return function(_0x3516fb){if(_0x3516fb){return _0x1d4464['sendStatus'](_0x2de360);}return _0x1d4464['status'](_0x2de360)[_0xa7c6('0x14')]();};}function respondWithResult(_0x561a26,_0x4ef47a){_0x4ef47a=_0x4ef47a||0xc8;return function(_0x5bb282){if(_0x5bb282){return _0x561a26[_0xa7c6('0x15')](_0x4ef47a)[_0xa7c6('0x16')](_0x5bb282);}};}function respondWithFilteredResult(_0x499150,_0xb70659){return function(_0x4b9471){if(_0x4b9471){var _0x19eed8=_0x4b9471[_0xa7c6('0x17')],_0x12c58c=_0xb70659[_0xa7c6('0x18')],_0x4843f0=_0xb70659[_0xa7c6('0x18')]+_0xb70659[_0xa7c6('0x19')],_0x22ec3f;if(_0x4843f0>=_0x19eed8){_0x4843f0=_0x19eed8;_0x22ec3f=0xc8;}else{_0x22ec3f=0xce;}_0x499150[_0xa7c6('0x15')](_0x22ec3f);return _0x499150['set'](_0xa7c6('0x1a'),_0x12c58c+'-'+_0x4843f0+'/'+_0x19eed8)[_0xa7c6('0x16')](_0x4b9471);}return null;};}function patchUpdates(_0x425a81){return function(_0x1b29ef){try{jsonpatch[_0xa7c6('0x1b')](_0x1b29ef,_0x425a81,!![]);}catch(_0x3eb516){return BPromise[_0xa7c6('0x1c')](_0x3eb516);}return _0x1b29ef[_0xa7c6('0x1d')]();};}function saveUpdates(_0x2c4b30,_0x53e233){return function(_0x31cef5){if(_0x31cef5){return _0x31cef5['update'](_0x2c4b30)[_0xa7c6('0x1e')](function(_0x3f95f1){return _0x3f95f1;});}return null;};}function removeEntity(_0x18e1e3,_0x1a76c2){return function(_0x462c8f){if(_0x462c8f){return _0x462c8f[_0xa7c6('0x1f')]()[_0xa7c6('0x1e')](function(){var _0x516b99=_0x462c8f[_0xa7c6('0x20')]({'plain':!![]});var _0xb83cc7=_0xa7c6('0x21');return db['UserProfileResource'][_0xa7c6('0x1f')]({'where':{'type':_0xb83cc7,'resourceId':_0x516b99['id']}})[_0xa7c6('0x1e')](function(){return _0x462c8f;});})['then'](function(){_0x18e1e3['status'](0xcc)[_0xa7c6('0x14')]();});}};}function handleEntityNotFound(_0x1510e7,_0x338c80){return function(_0x5e8ff2){if(!_0x5e8ff2){_0x1510e7[_0xa7c6('0x22')](0x194);}return _0x5e8ff2;};}function handleError(_0x3ac036,_0x463a44){_0x463a44=_0x463a44||0x1f4;return function(_0x57d4e5){logger['error'](_0x57d4e5[_0xa7c6('0x23')]);if(_0x57d4e5[_0xa7c6('0x24')]){delete _0x57d4e5[_0xa7c6('0x24')];}_0x3ac036[_0xa7c6('0x15')](_0x463a44)['send'](_0x57d4e5);};}exports[_0xa7c6('0x25')]=function(_0x1bccb5,_0x3fd118){var _0x2d75d7={},_0xd27605={},_0x2958c6={'count':0x0,'rows':[]};var _0x3be313=db[_0xa7c6('0x26')][_0xa7c6('0x27')];_0xd27605[_0xa7c6('0x28')]=_[_0xa7c6('0x29')](_0x3be313);_0xd27605[_0xa7c6('0x2a')]=_[_0xa7c6('0x29')](_0x1bccb5['query']);_0xd27605[_0xa7c6('0x2b')]=_['intersection'](_0xd27605['model'],_0xd27605[_0xa7c6('0x2a')]);_0x2d75d7[_0xa7c6('0x2c')]=_[_0xa7c6('0x2d')](_0xd27605[_0xa7c6('0x28')],qs[_0xa7c6('0x2e')](_0x1bccb5[_0xa7c6('0x2a')]['fields']));_0x2d75d7[_0xa7c6('0x2c')]=_0x2d75d7[_0xa7c6('0x2c')][_0xa7c6('0x2f')]?_0x2d75d7[_0xa7c6('0x2c')]:_0xd27605[_0xa7c6('0x28')];if(!_0x1bccb5['query']['hasOwnProperty'](_0xa7c6('0x30'))){_0x2d75d7[_0xa7c6('0x19')]=qs[_0xa7c6('0x19')](_0x1bccb5[_0xa7c6('0x2a')][_0xa7c6('0x19')]);_0x2d75d7['offset']=qs[_0xa7c6('0x18')](_0x1bccb5[_0xa7c6('0x2a')][_0xa7c6('0x18')]);}_0x2d75d7['order']=qs[_0xa7c6('0x31')](_0x1bccb5[_0xa7c6('0x2a')]['sort']);_0x2d75d7[_0xa7c6('0x32')]=qs[_0xa7c6('0x2b')](_[_0xa7c6('0x33')](_0x1bccb5[_0xa7c6('0x2a')],_0xd27605[_0xa7c6('0x2b')]));if(_0x1bccb5[_0xa7c6('0x2a')][_0xa7c6('0x34')]){_0x2d75d7['where']=_[_0xa7c6('0x35')](_0x2d75d7[_0xa7c6('0x32')],{'$or':_[_0xa7c6('0x36')](_0x3be313,function(_0x32fd7d){if(_0x32fd7d[_0xa7c6('0x37')][_0xa7c6('0x38')]!==_0xa7c6('0x39')){var _0x213f5b={};_0x213f5b[_0x32fd7d['field']]={'$like':'%'+_0x1bccb5[_0xa7c6('0x2a')][_0xa7c6('0x34')]+'%'};return _0x213f5b;}})});}_0x2d75d7=_[_0xa7c6('0x35')]({},_0x2d75d7,_0x1bccb5[_0xa7c6('0x3a')]);var _0x3af6c0={'where':_0x2d75d7[_0xa7c6('0x32')]};return db['AnalyticMetric'][_0xa7c6('0x17')](_0x3af6c0)[_0xa7c6('0x1e')](function(_0x380c2c){_0x2958c6[_0xa7c6('0x17')]=_0x380c2c;if(_0x1bccb5[_0xa7c6('0x2a')][_0xa7c6('0x3b')]){_0x2d75d7[_0xa7c6('0x3c')]=[{'all':!![]}];}return db[_0xa7c6('0x26')][_0xa7c6('0x3d')](_0x2d75d7);})['then'](function(_0x2b86c3){_0x2958c6[_0xa7c6('0x3e')]=_0x2b86c3;return _0x2958c6;})['then'](respondWithFilteredResult(_0x3fd118,_0x2d75d7))[_0xa7c6('0x3f')](handleError(_0x3fd118,null));};exports['show']=function(_0x34f1ac,_0x5d9445){var _0x125b69={'raw':!![],'where':{'id':_0x34f1ac[_0xa7c6('0x40')]['id']}},_0x36f36e={};_0x36f36e[_0xa7c6('0x28')]=_[_0xa7c6('0x29')](db['AnalyticMetric']['rawAttributes']);_0x36f36e['query']=_[_0xa7c6('0x29')](_0x34f1ac['query']);_0x36f36e[_0xa7c6('0x2b')]=_[_0xa7c6('0x2d')](_0x36f36e[_0xa7c6('0x28')],_0x36f36e[_0xa7c6('0x2a')]);_0x125b69[_0xa7c6('0x2c')]=_[_0xa7c6('0x2d')](_0x36f36e[_0xa7c6('0x28')],qs[_0xa7c6('0x2e')](_0x34f1ac[_0xa7c6('0x2a')][_0xa7c6('0x2e')]));_0x125b69['attributes']=_0x125b69[_0xa7c6('0x2c')]['length']?_0x125b69[_0xa7c6('0x2c')]:_0x36f36e[_0xa7c6('0x28')];if(_0x34f1ac[_0xa7c6('0x2a')][_0xa7c6('0x3b')]){_0x125b69[_0xa7c6('0x3c')]=[{'all':!![]}];}_0x125b69=_[_0xa7c6('0x35')]({},_0x125b69,_0x34f1ac['options']);return db[_0xa7c6('0x26')][_0xa7c6('0x41')](_0x125b69)[_0xa7c6('0x1e')](handleEntityNotFound(_0x5d9445,null))['then'](respondWithResult(_0x5d9445,null))['catch'](handleError(_0x5d9445,null));};exports['create']=function(_0x5291d4,_0x365aa9){return db['AnalyticMetric'][_0xa7c6('0x42')](_0x5291d4[_0xa7c6('0x43')],{})[_0xa7c6('0x1e')](function(_0x5e2bbe){var _0x547aad=_0x5291d4[_0xa7c6('0x44')][_0xa7c6('0x20')]({'plain':!![]});if(!_0x547aad)throw new Error(_0xa7c6('0x45'));if(_0x547aad['role']==='user'){var _0x40e99e=_0x5e2bbe[_0xa7c6('0x20')]({'plain':!![]});var _0x2249ea='Metrics';return db[_0xa7c6('0x46')][_0xa7c6('0x41')]({'where':{'name':_0x2249ea,'userProfileId':_0x547aad[_0xa7c6('0x47')]},'raw':!![]})[_0xa7c6('0x1e')](function(_0x3bfe86){if(_0x3bfe86&&_0x3bfe86[_0xa7c6('0x48')]===0x0){return db[_0xa7c6('0x49')]['create']({'name':_0x40e99e[_0xa7c6('0x24')],'resourceId':_0x40e99e['id'],'type':_0x3bfe86[_0xa7c6('0x24')],'sectionId':_0x3bfe86['id']},{})['then'](function(){return _0x5e2bbe;});}else{return _0x5e2bbe;}})[_0xa7c6('0x3f')](function(_0x1f0263){logger[_0xa7c6('0x4a')](_0xa7c6('0x4b'),_0x1f0263);throw _0x1f0263;});}return _0x5e2bbe;})[_0xa7c6('0x1e')](respondWithResult(_0x365aa9,0xc9))['catch'](handleError(_0x365aa9,null));};exports[_0xa7c6('0x4c')]=function(_0x1f7a60,_0x3ebc15){if(_0x1f7a60['body']['id']){delete _0x1f7a60['body']['id'];}return db[_0xa7c6('0x26')][_0xa7c6('0x41')]({'where':{'id':_0x1f7a60['params']['id']}})[_0xa7c6('0x1e')](handleEntityNotFound(_0x3ebc15,null))[_0xa7c6('0x1e')](saveUpdates(_0x1f7a60[_0xa7c6('0x43')],null))['then'](respondWithResult(_0x3ebc15,null))['catch'](handleError(_0x3ebc15,null));};exports['destroy']=function(_0x3e2612,_0x57701d){return db['AnalyticMetric'][_0xa7c6('0x41')]({'where':{'id':_0x3e2612[_0xa7c6('0x40')]['id']}})['then'](handleEntityNotFound(_0x57701d,null))[_0xa7c6('0x1e')](removeEntity(_0x57701d,null))['catch'](handleError(_0x57701d,null));}; \ No newline at end of file +var _0x74e1=['body','destroy','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','get','Metrics','UserProfileResource','error','send','index','AnalyticMetric','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','type','key','VIRTUAL','field','filter','merge','options','count','include','findAll','rows','catch','rawAttributes','fields','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x4ca88f,_0xbd5b23){var _0x4bd853=function(_0xac771f){while(--_0xac771f){_0x4ca88f['push'](_0x4ca88f['shift']());}};_0x4bd853(++_0xbd5b23);}(_0x74e1,0x9d));var _0x174e=function(_0x2abf2a,_0x25dd7c){_0x2abf2a=_0x2abf2a-0x0;var _0xccd5ae=_0x74e1[_0x2abf2a];return _0xccd5ae;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x174e('0x0'));var rimraf=require(_0x174e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x174e('0x2'));var rp=require(_0x174e('0x3'));var moment=require(_0x174e('0x4'));var BPromise=require(_0x174e('0x5'));var Mustache=require(_0x174e('0x6'));var util=require('util');var path=require('path');var sox=require(_0x174e('0x7'));var csv=require(_0x174e('0x8'));var ejs=require(_0x174e('0x9'));var fs=require('fs');var _=require(_0x174e('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x174e('0xb'));var deskjs=require(_0x174e('0xc'));var toCsv=require(_0x174e('0x8'));var querystring=require('querystring');var Papa=require(_0x174e('0xd'));var Redis=require('ioredis');var authService=require(_0x174e('0xe'));var qs=require(_0x174e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x174e('0x10'))(_0x174e('0x11'));var utils=require(_0x174e('0x12'));var config=require(_0x174e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ab32d,_0x1797be){_0x1797be=_0x1797be||0xcc;return function(_0x15a046){if(_0x15a046){return _0x5ab32d[_0x174e('0x14')](_0x1797be);}return _0x5ab32d[_0x174e('0x15')](_0x1797be)[_0x174e('0x16')]();};}function respondWithResult(_0x93503e,_0x536943){_0x536943=_0x536943||0xc8;return function(_0x2881d7){if(_0x2881d7){return _0x93503e['status'](_0x536943)[_0x174e('0x17')](_0x2881d7);}};}function respondWithFilteredResult(_0x4a040f,_0x3dc391){return function(_0x2a3167){if(_0x2a3167){var _0x478bc4=_0x2a3167['count'],_0x484a60=_0x3dc391['offset'],_0x5661b4=_0x3dc391[_0x174e('0x18')]+_0x3dc391[_0x174e('0x19')],_0x2fb7dd;if(_0x5661b4>=_0x478bc4){_0x5661b4=_0x478bc4;_0x2fb7dd=0xc8;}else{_0x2fb7dd=0xce;}_0x4a040f[_0x174e('0x15')](_0x2fb7dd);return _0x4a040f[_0x174e('0x1a')](_0x174e('0x1b'),_0x484a60+'-'+_0x5661b4+'/'+_0x478bc4)['json'](_0x2a3167);}return null;};}function patchUpdates(_0x5bc83c){return function(_0x4afaab){try{jsonpatch[_0x174e('0x1c')](_0x4afaab,_0x5bc83c,!![]);}catch(_0x1070cf){return BPromise['reject'](_0x1070cf);}return _0x4afaab[_0x174e('0x1d')]();};}function saveUpdates(_0x2fe8f0,_0x482104){return function(_0x303158){if(_0x303158){return _0x303158[_0x174e('0x1e')](_0x2fe8f0)[_0x174e('0x1f')](function(_0x282c1b){return _0x282c1b;});}return null;};}function removeEntity(_0x58dae7,_0xa3c0f0){return function(_0x3befc9){if(_0x3befc9){return _0x3befc9['destroy']()[_0x174e('0x1f')](function(){var _0x36afe5=_0x3befc9[_0x174e('0x20')]({'plain':!![]});var _0x54e1e1=_0x174e('0x21');return db[_0x174e('0x22')]['destroy']({'where':{'type':_0x54e1e1,'resourceId':_0x36afe5['id']}})[_0x174e('0x1f')](function(){return _0x3befc9;});})['then'](function(){_0x58dae7[_0x174e('0x15')](0xcc)[_0x174e('0x16')]();});}};}function handleEntityNotFound(_0x3c1440,_0x5119fe){return function(_0x31fdb3){if(!_0x31fdb3){_0x3c1440[_0x174e('0x14')](0x194);}return _0x31fdb3;};}function handleError(_0x225113,_0xd9741e){_0xd9741e=_0xd9741e||0x1f4;return function(_0x2f96d9){logger[_0x174e('0x23')](_0x2f96d9['stack']);if(_0x2f96d9['name']){delete _0x2f96d9['name'];}_0x225113[_0x174e('0x15')](_0xd9741e)[_0x174e('0x24')](_0x2f96d9);};}exports[_0x174e('0x25')]=function(_0x4cfae4,_0x4dcc91){var _0x5efcd2={},_0x528c67={},_0x2af22c={'count':0x0,'rows':[]};var _0x142972=db[_0x174e('0x26')]['rawAttributes'];_0x528c67[_0x174e('0x27')]=_['keys'](_0x142972);_0x528c67[_0x174e('0x28')]=_[_0x174e('0x29')](_0x4cfae4[_0x174e('0x28')]);_0x528c67[_0x174e('0x2a')]=_[_0x174e('0x2b')](_0x528c67['model'],_0x528c67['query']);_0x5efcd2[_0x174e('0x2c')]=_[_0x174e('0x2b')](_0x528c67[_0x174e('0x27')],qs['fields'](_0x4cfae4[_0x174e('0x28')]['fields']));_0x5efcd2[_0x174e('0x2c')]=_0x5efcd2[_0x174e('0x2c')]['length']?_0x5efcd2[_0x174e('0x2c')]:_0x528c67[_0x174e('0x27')];if(!_0x4cfae4[_0x174e('0x28')][_0x174e('0x2d')](_0x174e('0x2e'))){_0x5efcd2[_0x174e('0x19')]=qs['limit'](_0x4cfae4[_0x174e('0x28')][_0x174e('0x19')]);_0x5efcd2['offset']=qs[_0x174e('0x18')](_0x4cfae4[_0x174e('0x28')][_0x174e('0x18')]);}_0x5efcd2[_0x174e('0x2f')]=qs[_0x174e('0x30')](_0x4cfae4['query'][_0x174e('0x30')]);_0x5efcd2[_0x174e('0x31')]=qs['filters'](_[_0x174e('0x32')](_0x4cfae4['query'],_0x528c67[_0x174e('0x2a')]));if(_0x4cfae4[_0x174e('0x28')]['filter']){_0x5efcd2[_0x174e('0x31')]=_['merge'](_0x5efcd2[_0x174e('0x31')],{'$or':_['map'](_0x142972,function(_0x56f7e7){if(_0x56f7e7[_0x174e('0x33')][_0x174e('0x34')]!==_0x174e('0x35')){var _0x5c142e={};_0x5c142e[_0x56f7e7[_0x174e('0x36')]]={'$like':'%'+_0x4cfae4[_0x174e('0x28')][_0x174e('0x37')]+'%'};return _0x5c142e;}})});}_0x5efcd2=_[_0x174e('0x38')]({},_0x5efcd2,_0x4cfae4[_0x174e('0x39')]);var _0x3820a2={'where':_0x5efcd2[_0x174e('0x31')]};return db[_0x174e('0x26')][_0x174e('0x3a')](_0x3820a2)[_0x174e('0x1f')](function(_0x260bf4){_0x2af22c[_0x174e('0x3a')]=_0x260bf4;if(_0x4cfae4[_0x174e('0x28')]['includeAll']){_0x5efcd2[_0x174e('0x3b')]=[{'all':!![]}];}return db[_0x174e('0x26')][_0x174e('0x3c')](_0x5efcd2);})[_0x174e('0x1f')](function(_0x2109ae){_0x2af22c[_0x174e('0x3d')]=_0x2109ae;return _0x2af22c;})[_0x174e('0x1f')](respondWithFilteredResult(_0x4dcc91,_0x5efcd2))[_0x174e('0x3e')](handleError(_0x4dcc91,null));};exports['show']=function(_0x32739c,_0x1420bf){var _0x48bec2={'raw':!![],'where':{'id':_0x32739c['params']['id']}},_0x431d5b={};_0x431d5b['model']=_['keys'](db['AnalyticMetric'][_0x174e('0x3f')]);_0x431d5b[_0x174e('0x28')]=_['keys'](_0x32739c[_0x174e('0x28')]);_0x431d5b['filters']=_['intersection'](_0x431d5b['model'],_0x431d5b[_0x174e('0x28')]);_0x48bec2['attributes']=_[_0x174e('0x2b')](_0x431d5b['model'],qs[_0x174e('0x40')](_0x32739c[_0x174e('0x28')][_0x174e('0x40')]));_0x48bec2[_0x174e('0x2c')]=_0x48bec2[_0x174e('0x2c')]['length']?_0x48bec2[_0x174e('0x2c')]:_0x431d5b[_0x174e('0x27')];if(_0x32739c[_0x174e('0x28')][_0x174e('0x41')]){_0x48bec2['include']=[{'all':!![]}];}_0x48bec2=_[_0x174e('0x38')]({},_0x48bec2,_0x32739c['options']);return db[_0x174e('0x26')][_0x174e('0x42')](_0x48bec2)['then'](handleEntityNotFound(_0x1420bf,null))['then'](respondWithResult(_0x1420bf,null))[_0x174e('0x3e')](handleError(_0x1420bf,null));};exports[_0x174e('0x43')]=function(_0x2f4294,_0x38e74c){return db[_0x174e('0x26')][_0x174e('0x43')](_0x2f4294['body'],{})[_0x174e('0x1f')](function(_0x11be83){var _0x4aa60d=_0x2f4294['user'][_0x174e('0x20')]({'plain':!![]});if(!_0x4aa60d)throw new Error(_0x174e('0x44'));if(_0x4aa60d['role']===_0x174e('0x45')){var _0x1f7403=_0x11be83[_0x174e('0x20')]({'plain':!![]});var _0x37d20f='Metrics';return db[_0x174e('0x46')]['find']({'where':{'name':_0x37d20f,'userProfileId':_0x4aa60d['userProfileId']},'raw':!![]})['then'](function(_0x3ba0fc){if(_0x3ba0fc&&_0x3ba0fc[_0x174e('0x47')]===0x0){return db[_0x174e('0x22')][_0x174e('0x43')]({'name':_0x1f7403['name'],'resourceId':_0x1f7403['id'],'type':_0x3ba0fc[_0x174e('0x48')],'sectionId':_0x3ba0fc['id']},{})['then'](function(){return _0x11be83;});}else{return _0x11be83;}})[_0x174e('0x3e')](function(_0x4e82a9){logger[_0x174e('0x23')](_0x174e('0x49'),_0x4e82a9);throw _0x4e82a9;});}return _0x11be83;})[_0x174e('0x1f')](respondWithResult(_0x38e74c,0xc9))[_0x174e('0x3e')](handleError(_0x38e74c,null));};exports[_0x174e('0x1e')]=function(_0x5b7d64,_0x18c670){if(_0x5b7d64[_0x174e('0x4a')]['id']){delete _0x5b7d64[_0x174e('0x4a')]['id'];}return db[_0x174e('0x26')]['find']({'where':{'id':_0x5b7d64['params']['id']}})[_0x174e('0x1f')](handleEntityNotFound(_0x18c670,null))[_0x174e('0x1f')](saveUpdates(_0x5b7d64[_0x174e('0x4a')],null))[_0x174e('0x1f')](respondWithResult(_0x18c670,null))['catch'](handleError(_0x18c670,null));};exports[_0x174e('0x4b')]=function(_0x334448,_0x59d2a3){return db[_0x174e('0x26')][_0x174e('0x42')]({'where':{'id':_0x334448[_0x174e('0x4c')]['id']}})[_0x174e('0x1f')](handleEntityNotFound(_0x59d2a3,null))['then'](removeEntity(_0x59d2a3,null))[_0x174e('0x3e')](handleError(_0x59d2a3,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 7bdff24..77644e2 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 _0x9834=['exports','analytics_metrics','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x3269c7,_0x5e14c3){var _0x122819=function(_0x59d6d8){while(--_0x59d6d8){_0x3269c7['push'](_0x3269c7['shift']());}};_0x122819(++_0x5e14c3);}(_0x9834,0xd1));var _0x4983=function(_0x173057,_0x6488d7){_0x173057=_0x173057-0x0;var _0x41246a=_0x9834[_0x173057];return _0x41246a;};'use strict';var _=require(_0x4983('0x0'));var util=require(_0x4983('0x1'));var logger=require(_0x4983('0x2'))('api');var moment=require(_0x4983('0x3'));var BPromise=require(_0x4983('0x4'));var rp=require(_0x4983('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4983('0x6'));var attributes=require('./analyticMetric.attributes');module[_0x4983('0x7')]=function(_0x1a837a,_0x219404){return _0x1a837a['define']('AnalyticMetric',attributes,{'tableName':_0x4983('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3124=['../../config/environment','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x3d48c6,_0x57c2c2){var _0x13dccc=function(_0x48bd83){while(--_0x48bd83){_0x3d48c6['push'](_0x3d48c6['shift']());}};_0x13dccc(++_0x57c2c2);}(_0x3124,0x149));var _0x4312=function(_0x3bd29b,_0x24404f){_0x3bd29b=_0x3bd29b-0x0;var _0x46eea0=_0x3124[_0x3bd29b];return _0x46eea0;};'use strict';var _=require(_0x4312('0x0'));var util=require(_0x4312('0x1'));var logger=require(_0x4312('0x2'))(_0x4312('0x3'));var moment=require('moment');var BPromise=require(_0x4312('0x4'));var rp=require(_0x4312('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4312('0x6'));var config=require(_0x4312('0x7'));var attributes=require('./analyticMetric.attributes');module[_0x4312('0x8')]=function(_0x18a6b8,_0x25cc6f){return _0x18a6b8[_0x4312('0x9')](_0x4312('0xa'),attributes,{'tableName':_0x4312('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 3e94da2..7e201c1 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 _0xf874=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','moment','bluebird','randomstring'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xf874,0xed));var _0x4f87=function(_0x2ebd3e,_0x4ace79){_0x2ebd3e=_0x2ebd3e-0x0;var _0xab4770=_0xf874[_0x2ebd3e];return _0xab4770;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4f87('0x0'));var BPromise=require(_0x4f87('0x1'));var rs=require(_0x4f87('0x2'));var fs=require('fs');var Redis=require(_0x4f87('0x3'));var db=require(_0x4f87('0x4'))['db'];var utils=require(_0x4f87('0x5'));var logger=require('../../config/logger')(_0x4f87('0x6'));var config=require(_0x4f87('0x7'));var jayson=require(_0x4f87('0x8'));var client=jayson[_0x4f87('0x9')][_0x4f87('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44fea6,_0x4a0662,_0x3a89e3){return new BPromise(function(_0x194853,_0x592008){return client[_0x4f87('0xb')](_0x44fea6,_0x3a89e3)[_0x4f87('0xc')](function(_0x4d8354){logger[_0x4f87('0xd')](_0x4f87('0xe'),_0x4a0662,_0x4f87('0xf'));logger[_0x4f87('0x10')](_0x4f87('0x11'),_0x4a0662,_0x4f87('0xf'),JSON[_0x4f87('0x12')](_0x4d8354));if(_0x4d8354['error']){if(_0x4d8354['error'][_0x4f87('0x13')]===0x1f4){logger[_0x4f87('0x14')](_0x4f87('0xe'),_0x4a0662,_0x4d8354['error']['message']);return _0x592008(_0x4d8354[_0x4f87('0x14')][_0x4f87('0x15')]);}logger[_0x4f87('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x4a0662,_0x4d8354[_0x4f87('0x14')]['message']);return _0x194853(_0x4d8354[_0x4f87('0x14')][_0x4f87('0x15')]);}else{logger['info'](_0x4f87('0xe'),_0x4a0662,_0x4f87('0xf'));_0x194853(_0x4d8354[_0x4f87('0x16')][_0x4f87('0x15')]);}})[_0x4f87('0x17')](function(_0x3bd90f){logger['error'](_0x4f87('0xe'),_0x4a0662,_0x3bd90f);_0x592008(_0x3bd90f);});});} \ No newline at end of file +var _0x45d1=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticMetric,\x20%s,\x20%s','result','lodash','util','bluebird'];(function(_0x45f0e0,_0x5a7bf2){var _0x167425=function(_0x61968f){while(--_0x61968f){_0x45f0e0['push'](_0x45f0e0['shift']());}};_0x167425(++_0x5a7bf2);}(_0x45d1,0x1cb));var _0x145d=function(_0x46cf00,_0x457a43){_0x46cf00=_0x46cf00-0x0;var _0x3974dc=_0x45d1[_0x46cf00];return _0x3974dc;};'use strict';var _=require(_0x145d('0x0'));var util=require(_0x145d('0x1'));var moment=require('moment');var BPromise=require(_0x145d('0x2'));var rs=require(_0x145d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x145d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x145d('0x5'))(_0x145d('0x6'));var config=require(_0x145d('0x7'));var jayson=require(_0x145d('0x8'));var client=jayson[_0x145d('0x9')][_0x145d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbc4161,_0x45ff66,_0x46a729){return new BPromise(function(_0x47eadc,_0x4ef552){return client['request'](_0xbc4161,_0x46a729)[_0x145d('0xb')](function(_0x183afe){logger[_0x145d('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x45ff66,_0x145d('0xd'));logger['debug'](_0x145d('0xe'),_0x45ff66,_0x145d('0xd'),JSON[_0x145d('0xf')](_0x183afe));if(_0x183afe[_0x145d('0x10')]){if(_0x183afe['error'][_0x145d('0x11')]===0x1f4){logger[_0x145d('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x45ff66,_0x183afe[_0x145d('0x10')][_0x145d('0x12')]);return _0x4ef552(_0x183afe[_0x145d('0x10')][_0x145d('0x12')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x45ff66,_0x183afe[_0x145d('0x10')][_0x145d('0x12')]);return _0x47eadc(_0x183afe[_0x145d('0x10')]['message']);}else{logger[_0x145d('0xc')](_0x145d('0x13'),_0x45ff66,_0x145d('0xd'));_0x47eadc(_0x183afe[_0x145d('0x14')][_0x145d('0x12')]);}})['catch'](function(_0x1c9ee2){logger[_0x145d('0x10')](_0x145d('0x13'),_0x45ff66,_0x1c9ee2);_0x4ef552(_0x1c9ee2);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 07e2b8b..cc32fda 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 _0x3024=['isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','./analyticMetric.controller','get','index'];(function(_0x36a9bf,_0x2edc43){var _0x24b93c=function(_0x48ff01){while(--_0x48ff01){_0x36a9bf['push'](_0x36a9bf['shift']());}};_0x24b93c(++_0x2edc43);}(_0x3024,0x64));var _0x4302=function(_0x285d55,_0x9aff50){_0x285d55=_0x285d55-0x0;var _0x36c9c9=_0x3024[_0x285d55];return _0x36c9c9;};'use strict';var multer=require(_0x4302('0x0'));var util=require(_0x4302('0x1'));var path=require('path');var timeout=require(_0x4302('0x2'));var express=require(_0x4302('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4302('0x4'));var config=require('../../config/environment');var controller=require(_0x4302('0x5'));router[_0x4302('0x6')]('/',auth['isAuthenticated'](),controller[_0x4302('0x7')]);router[_0x4302('0x6')]('/:id',auth[_0x4302('0x8')](),controller[_0x4302('0x9')]);router[_0x4302('0xa')]('/',auth[_0x4302('0x8')](),controller[_0x4302('0xb')]);router[_0x4302('0xc')](_0x4302('0xd'),auth['isAuthenticated'](),controller[_0x4302('0xe')]);router[_0x4302('0xf')](_0x4302('0xd'),auth['isAuthenticated'](),controller[_0x4302('0x10')]);module[_0x4302('0x11')]=router; \ No newline at end of file +var _0xccde=['exports','multer','path','express','Router','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy'];(function(_0x560ec3,_0x1413e8){var _0x55760b=function(_0x3d1fad){while(--_0x3d1fad){_0x560ec3['push'](_0x560ec3['shift']());}};_0x55760b(++_0x1413e8);}(_0xccde,0x1e1));var _0xeccd=function(_0xb24fad,_0xd58756){_0xb24fad=_0xb24fad-0x0;var _0x173226=_0xccde[_0xb24fad];return _0x173226;};'use strict';var multer=require(_0xeccd('0x0'));var util=require('util');var path=require(_0xeccd('0x1'));var timeout=require('connect-timeout');var express=require(_0xeccd('0x2'));var router=express[_0xeccd('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xeccd('0x4'));var controller=require(_0xeccd('0x5'));router[_0xeccd('0x6')]('/',auth[_0xeccd('0x7')](),controller[_0xeccd('0x8')]);router['get'](_0xeccd('0x9'),auth[_0xeccd('0x7')](),controller[_0xeccd('0xa')]);router[_0xeccd('0xb')]('/',auth['isAuthenticated'](),controller[_0xeccd('0xc')]);router[_0xeccd('0xd')](_0xeccd('0x9'),auth[_0xeccd('0x7')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xeccd('0xe')]);module[_0xeccd('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index a2f6803..f2f2a2c 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 _0xf51f=['TEXT','sequelize','exports'];(function(_0x46ec32,_0x1e842f){var _0x338f60=function(_0x10e02c){while(--_0x10e02c){_0x46ec32['push'](_0x46ec32['shift']());}};_0x338f60(++_0x1e842f);}(_0xf51f,0x19f));var _0xff51=function(_0x1f99a0,_0x50b73d){_0x1f99a0=_0x1f99a0-0x0;var _0x1e0849=_0xf51f[_0x1f99a0];return _0x1e0849;};'use strict';var Sequelize=require(_0xff51('0x0'));module[_0xff51('0x1')]={'tree':{'type':Sequelize[_0xff51('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x5ed4=['exports','TEXT'];(function(_0x2a2a51,_0x27c252){var _0x4e31e1=function(_0x26a45e){while(--_0x26a45e){_0x2a2a51['push'](_0x2a2a51['shift']());}};_0x4e31e1(++_0x27c252);}(_0x5ed4,0x7e));var _0x45ed=function(_0x3d7ebe,_0x5e48b4){_0x3d7ebe=_0x3d7ebe-0x0;var _0x2a1c0a=_0x5ed4[_0x3d7ebe];return _0x2a1c0a;};'use strict';var Sequelize=require('sequelize');module[_0x45ed('0x0')]={'tree':{'type':Sequelize[_0x45ed('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 2cb2374..dc817aa 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 _0xdda4=['model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','update','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../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','apply','reject','save','then','destroy','end','error','stack','name','send','index','AnalyticTreeReport'];(function(_0xfe2393,_0x110ad5){var _0x3239bd=function(_0x186ba8){while(--_0x186ba8){_0xfe2393['push'](_0xfe2393['shift']());}};_0x3239bd(++_0x110ad5);}(_0xdda4,0x1a6));var _0x4dda=function(_0x7729b1,_0x468322){_0x7729b1=_0x7729b1-0x0;var _0x349504=_0xdda4[_0x7729b1];return _0x349504;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4dda('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4dda('0x1'));var jsonpatch=require(_0x4dda('0x2'));var rp=require(_0x4dda('0x3'));var moment=require(_0x4dda('0x4'));var BPromise=require(_0x4dda('0x5'));var Mustache=require(_0x4dda('0x6'));var util=require(_0x4dda('0x7'));var path=require(_0x4dda('0x8'));var sox=require(_0x4dda('0x9'));var csv=require(_0x4dda('0xa'));var ejs=require(_0x4dda('0xb'));var fs=require('fs');var _=require(_0x4dda('0xc'));var squel=require(_0x4dda('0xd'));var crypto=require(_0x4dda('0xe'));var jsforce=require(_0x4dda('0xf'));var deskjs=require(_0x4dda('0x10'));var toCsv=require('to-csv');var querystring=require(_0x4dda('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4dda('0x12'));var qs=require(_0x4dda('0x13'));var hardwareService=require(_0x4dda('0x14'));var logger=require(_0x4dda('0x15'))(_0x4dda('0x16'));var utils=require(_0x4dda('0x17'));var config=require(_0x4dda('0x18'));var db=require(_0x4dda('0x19'))['db'];function respondWithStatusCode(_0x518111,_0x3623f0){_0x3623f0=_0x3623f0||0xcc;return function(_0xdd5eda){if(_0xdd5eda){return _0x518111[_0x4dda('0x1a')](_0x3623f0);}return _0x518111['status'](_0x3623f0)['end']();};}function respondWithResult(_0x277d29,_0x268d66){_0x268d66=_0x268d66||0xc8;return function(_0x4b70ce){if(_0x4b70ce){return _0x277d29[_0x4dda('0x1b')](_0x268d66)['json'](_0x4b70ce);}};}function respondWithFilteredResult(_0x3b745c,_0x2a00a2){return function(_0x47ee25){if(_0x47ee25){var _0x2b446b=_0x47ee25[_0x4dda('0x1c')],_0x4eef1f=_0x2a00a2[_0x4dda('0x1d')],_0x5ab015=_0x2a00a2[_0x4dda('0x1d')]+_0x2a00a2[_0x4dda('0x1e')],_0x215f92;if(_0x5ab015>=_0x2b446b){_0x5ab015=_0x2b446b;_0x215f92=0xc8;}else{_0x215f92=0xce;}_0x3b745c[_0x4dda('0x1b')](_0x215f92);return _0x3b745c[_0x4dda('0x1f')](_0x4dda('0x20'),_0x4eef1f+'-'+_0x5ab015+'/'+_0x2b446b)[_0x4dda('0x21')](_0x47ee25);}return null;};}function patchUpdates(_0x4b8423){return function(_0x4a9ca1){try{jsonpatch[_0x4dda('0x22')](_0x4a9ca1,_0x4b8423,!![]);}catch(_0x49d06d){return BPromise[_0x4dda('0x23')](_0x49d06d);}return _0x4a9ca1[_0x4dda('0x24')]();};}function saveUpdates(_0x4bf835,_0x2ccb6c){return function(_0x21c25e){if(_0x21c25e){return _0x21c25e['update'](_0x4bf835)[_0x4dda('0x25')](function(_0x457d91){return _0x457d91;});}return null;};}function removeEntity(_0x541aca,_0xad968d){return function(_0x241d01){if(_0x241d01){return _0x241d01[_0x4dda('0x26')]()[_0x4dda('0x25')](function(){_0x541aca[_0x4dda('0x1b')](0xcc)[_0x4dda('0x27')]();});}};}function handleEntityNotFound(_0xa93df,_0x1ecc68){return function(_0x49fa4d){if(!_0x49fa4d){_0xa93df['sendStatus'](0x194);}return _0x49fa4d;};}function handleError(_0x508d50,_0x92fb36){_0x92fb36=_0x92fb36||0x1f4;return function(_0x248c77){logger[_0x4dda('0x28')](_0x248c77[_0x4dda('0x29')]);if(_0x248c77[_0x4dda('0x2a')]){delete _0x248c77['name'];}_0x508d50[_0x4dda('0x1b')](_0x92fb36)[_0x4dda('0x2b')](_0x248c77);};}exports[_0x4dda('0x2c')]=function(_0x4a1a55,_0x26b9d6){var _0x68ff6={},_0x49b3b8={},_0x325462={'count':0x0,'rows':[]};var _0x39cdfa=db[_0x4dda('0x2d')]['rawAttributes'];_0x49b3b8[_0x4dda('0x2e')]=_[_0x4dda('0x2f')](_0x39cdfa);_0x49b3b8[_0x4dda('0x30')]=_[_0x4dda('0x2f')](_0x4a1a55[_0x4dda('0x30')]);_0x49b3b8[_0x4dda('0x31')]=_['intersection'](_0x49b3b8[_0x4dda('0x2e')],_0x49b3b8['query']);_0x68ff6[_0x4dda('0x32')]=_[_0x4dda('0x33')](_0x49b3b8[_0x4dda('0x2e')],qs[_0x4dda('0x34')](_0x4a1a55[_0x4dda('0x30')][_0x4dda('0x34')]));_0x68ff6[_0x4dda('0x32')]=_0x68ff6[_0x4dda('0x32')][_0x4dda('0x35')]?_0x68ff6[_0x4dda('0x32')]:_0x49b3b8['model'];if(!_0x4a1a55[_0x4dda('0x30')]['hasOwnProperty'](_0x4dda('0x36'))){_0x68ff6[_0x4dda('0x1e')]=qs[_0x4dda('0x1e')](_0x4a1a55[_0x4dda('0x30')][_0x4dda('0x1e')]);_0x68ff6[_0x4dda('0x1d')]=qs[_0x4dda('0x1d')](_0x4a1a55[_0x4dda('0x30')][_0x4dda('0x1d')]);}_0x68ff6[_0x4dda('0x37')]=qs[_0x4dda('0x38')](_0x4a1a55['query'][_0x4dda('0x38')]);_0x68ff6[_0x4dda('0x39')]=qs['filters'](_[_0x4dda('0x3a')](_0x4a1a55[_0x4dda('0x30')],_0x49b3b8[_0x4dda('0x31')]));if(_0x4a1a55[_0x4dda('0x30')][_0x4dda('0x3b')]){_0x68ff6[_0x4dda('0x39')]=_[_0x4dda('0x3c')](_0x68ff6[_0x4dda('0x39')],{'$or':_[_0x4dda('0x3d')](_0x39cdfa,function(_0x24b251){if(_0x24b251[_0x4dda('0x3e')][_0x4dda('0x3f')]!==_0x4dda('0x40')){var _0x1dce6a={};_0x1dce6a[_0x24b251['field']]={'$like':'%'+_0x4a1a55[_0x4dda('0x30')][_0x4dda('0x3b')]+'%'};return _0x1dce6a;}})});}_0x68ff6=_['merge']({},_0x68ff6,_0x4a1a55[_0x4dda('0x41')]);var _0x38a46a={'where':_0x68ff6[_0x4dda('0x39')]};return db[_0x4dda('0x2d')]['count'](_0x38a46a)[_0x4dda('0x25')](function(_0x569880){_0x325462[_0x4dda('0x1c')]=_0x569880;if(_0x4a1a55[_0x4dda('0x30')][_0x4dda('0x42')]){_0x68ff6[_0x4dda('0x43')]=[{'all':!![]}];}return db[_0x4dda('0x2d')][_0x4dda('0x44')](_0x68ff6);})['then'](function(_0x2744db){_0x325462[_0x4dda('0x45')]=_0x2744db;return _0x325462;})[_0x4dda('0x25')](respondWithFilteredResult(_0x26b9d6,_0x68ff6))['catch'](handleError(_0x26b9d6,null));};exports[_0x4dda('0x46')]=function(_0x3ca202,_0x593a7b){var _0x558b16={'raw':!![],'where':{'id':_0x3ca202['params']['id']}},_0x4406d3={};_0x4406d3['model']=_[_0x4dda('0x2f')](db[_0x4dda('0x2d')][_0x4dda('0x47')]);_0x4406d3['query']=_[_0x4dda('0x2f')](_0x3ca202['query']);_0x4406d3[_0x4dda('0x31')]=_[_0x4dda('0x33')](_0x4406d3[_0x4dda('0x2e')],_0x4406d3['query']);_0x558b16[_0x4dda('0x32')]=_['intersection'](_0x4406d3[_0x4dda('0x2e')],qs[_0x4dda('0x34')](_0x3ca202[_0x4dda('0x30')][_0x4dda('0x34')]));_0x558b16['attributes']=_0x558b16['attributes'][_0x4dda('0x35')]?_0x558b16['attributes']:_0x4406d3[_0x4dda('0x2e')];if(_0x3ca202[_0x4dda('0x30')][_0x4dda('0x42')]){_0x558b16[_0x4dda('0x43')]=[{'all':!![]}];}_0x558b16=_[_0x4dda('0x3c')]({},_0x558b16,_0x3ca202[_0x4dda('0x41')]);return db[_0x4dda('0x2d')][_0x4dda('0x48')](_0x558b16)[_0x4dda('0x25')](handleEntityNotFound(_0x593a7b,null))['then'](respondWithResult(_0x593a7b,null))[_0x4dda('0x49')](handleError(_0x593a7b,null));};exports[_0x4dda('0x4a')]=function(_0x227e90,_0x5de700){return db[_0x4dda('0x2d')]['create'](_0x227e90['body'],{})[_0x4dda('0x25')](respondWithResult(_0x5de700,0xc9))[_0x4dda('0x49')](handleError(_0x5de700,null));};exports[_0x4dda('0x4b')]=function(_0x232664,_0xf0802e){if(_0x232664[_0x4dda('0x4c')]['id']){delete _0x232664[_0x4dda('0x4c')]['id'];}return db[_0x4dda('0x2d')][_0x4dda('0x48')]({'where':{'id':_0x232664[_0x4dda('0x4d')]['id']}})[_0x4dda('0x25')](handleEntityNotFound(_0xf0802e,null))['then'](saveUpdates(_0x232664['body'],null))[_0x4dda('0x25')](respondWithResult(_0xf0802e,null))[_0x4dda('0x49')](handleError(_0xf0802e,null));};exports[_0x4dda('0x26')]=function(_0x4daf79,_0x396add){return db[_0x4dda('0x2d')][_0x4dda('0x48')]({'where':{'id':_0x4daf79[_0x4dda('0x4d')]['id']}})['then'](handleEntityNotFound(_0x396add,null))[_0x4dda('0x25')](removeEntity(_0x396add,null))['catch'](handleError(_0x396add,null));}; \ No newline at end of file +var _0x3679=['filter','where','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','AnalyticTreeReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick'];(function(_0x18f506,_0x3642b2){var _0x1c727d=function(_0x28d872){while(--_0x28d872){_0x18f506['push'](_0x18f506['shift']());}};_0x1c727d(++_0x3642b2);}(_0x3679,0xec));var _0x9367=function(_0x4c147b,_0x3b30c8){_0x4c147b=_0x4c147b-0x0;var _0x78f4ba=_0x3679[_0x4c147b];return _0x78f4ba;};'use strict';var pdf=require(_0x9367('0x0'));var emlformat=require(_0x9367('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9367('0x2'));var jsonpatch=require(_0x9367('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9367('0x4'));var util=require(_0x9367('0x5'));var path=require(_0x9367('0x6'));var sox=require(_0x9367('0x7'));var csv=require(_0x9367('0x8'));var ejs=require(_0x9367('0x9'));var fs=require('fs');var _=require(_0x9367('0xa'));var squel=require(_0x9367('0xb'));var crypto=require(_0x9367('0xc'));var jsforce=require(_0x9367('0xd'));var deskjs=require(_0x9367('0xe'));var toCsv=require(_0x9367('0x8'));var querystring=require(_0x9367('0xf'));var Papa=require(_0x9367('0x10'));var Redis=require(_0x9367('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9367('0x12'));var hardwareService=require(_0x9367('0x13'));var logger=require('../../config/logger')(_0x9367('0x14'));var utils=require(_0x9367('0x15'));var config=require(_0x9367('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17b859,_0x521102){_0x521102=_0x521102||0xcc;return function(_0x25331b){if(_0x25331b){return _0x17b859[_0x9367('0x17')](_0x521102);}return _0x17b859['status'](_0x521102)[_0x9367('0x18')]();};}function respondWithResult(_0x386ff2,_0xf0de90){_0xf0de90=_0xf0de90||0xc8;return function(_0x330460){if(_0x330460){return _0x386ff2[_0x9367('0x19')](_0xf0de90)[_0x9367('0x1a')](_0x330460);}};}function respondWithFilteredResult(_0xfbba1,_0x2ef7ba){return function(_0x2f0160){if(_0x2f0160){var _0x1c2c7c=_0x2f0160[_0x9367('0x1b')],_0x17fd0a=_0x2ef7ba[_0x9367('0x1c')],_0x1aafb3=_0x2ef7ba[_0x9367('0x1c')]+_0x2ef7ba['limit'],_0x7fd076;if(_0x1aafb3>=_0x1c2c7c){_0x1aafb3=_0x1c2c7c;_0x7fd076=0xc8;}else{_0x7fd076=0xce;}_0xfbba1[_0x9367('0x19')](_0x7fd076);return _0xfbba1[_0x9367('0x1d')](_0x9367('0x1e'),_0x17fd0a+'-'+_0x1aafb3+'/'+_0x1c2c7c)[_0x9367('0x1a')](_0x2f0160);}return null;};}function patchUpdates(_0x1519fe){return function(_0x1f53b1){try{jsonpatch[_0x9367('0x1f')](_0x1f53b1,_0x1519fe,!![]);}catch(_0x464718){return BPromise[_0x9367('0x20')](_0x464718);}return _0x1f53b1[_0x9367('0x21')]();};}function saveUpdates(_0x34dca9,_0x4d2c2a){return function(_0x3d0a46){if(_0x3d0a46){return _0x3d0a46[_0x9367('0x22')](_0x34dca9)[_0x9367('0x23')](function(_0x1ea3c0){return _0x1ea3c0;});}return null;};}function removeEntity(_0x50b227,_0x22fab3){return function(_0x2990c5){if(_0x2990c5){return _0x2990c5['destroy']()[_0x9367('0x23')](function(){_0x50b227['status'](0xcc)[_0x9367('0x18')]();});}};}function handleEntityNotFound(_0x415555,_0x558410){return function(_0x4fae6b){if(!_0x4fae6b){_0x415555[_0x9367('0x17')](0x194);}return _0x4fae6b;};}function handleError(_0x190fa6,_0x3da155){_0x3da155=_0x3da155||0x1f4;return function(_0x1588d1){logger['error'](_0x1588d1[_0x9367('0x24')]);if(_0x1588d1[_0x9367('0x25')]){delete _0x1588d1[_0x9367('0x25')];}_0x190fa6[_0x9367('0x19')](_0x3da155)[_0x9367('0x26')](_0x1588d1);};}exports[_0x9367('0x27')]=function(_0x38c6b0,_0x4b734e){var _0x241eab={},_0xd85975={},_0x49067f={'count':0x0,'rows':[]};var _0x552a46=db[_0x9367('0x28')][_0x9367('0x29')];_0xd85975[_0x9367('0x2a')]=_[_0x9367('0x2b')](_0x552a46);_0xd85975['query']=_[_0x9367('0x2b')](_0x38c6b0[_0x9367('0x2c')]);_0xd85975[_0x9367('0x2d')]=_['intersection'](_0xd85975[_0x9367('0x2a')],_0xd85975[_0x9367('0x2c')]);_0x241eab['attributes']=_[_0x9367('0x2e')](_0xd85975[_0x9367('0x2a')],qs[_0x9367('0x2f')](_0x38c6b0['query'][_0x9367('0x2f')]));_0x241eab[_0x9367('0x30')]=_0x241eab[_0x9367('0x30')][_0x9367('0x31')]?_0x241eab['attributes']:_0xd85975[_0x9367('0x2a')];if(!_0x38c6b0['query'][_0x9367('0x32')](_0x9367('0x33'))){_0x241eab['limit']=qs[_0x9367('0x34')](_0x38c6b0[_0x9367('0x2c')][_0x9367('0x34')]);_0x241eab['offset']=qs[_0x9367('0x1c')](_0x38c6b0[_0x9367('0x2c')][_0x9367('0x1c')]);}_0x241eab[_0x9367('0x35')]=qs[_0x9367('0x36')](_0x38c6b0[_0x9367('0x2c')][_0x9367('0x36')]);_0x241eab['where']=qs['filters'](_[_0x9367('0x37')](_0x38c6b0['query'],_0xd85975[_0x9367('0x2d')]));if(_0x38c6b0[_0x9367('0x2c')][_0x9367('0x38')]){_0x241eab[_0x9367('0x39')]=_['merge'](_0x241eab[_0x9367('0x39')],{'$or':_[_0x9367('0x3a')](_0x552a46,function(_0x634057){if(_0x634057[_0x9367('0x3b')][_0x9367('0x3c')]!==_0x9367('0x3d')){var _0x5b4731={};_0x5b4731[_0x634057['field']]={'$like':'%'+_0x38c6b0['query']['filter']+'%'};return _0x5b4731;}})});}_0x241eab=_['merge']({},_0x241eab,_0x38c6b0[_0x9367('0x3e')]);var _0x26ba9e={'where':_0x241eab[_0x9367('0x39')]};return db['AnalyticTreeReport'][_0x9367('0x1b')](_0x26ba9e)['then'](function(_0x5c8f72){_0x49067f[_0x9367('0x1b')]=_0x5c8f72;if(_0x38c6b0[_0x9367('0x2c')][_0x9367('0x3f')]){_0x241eab[_0x9367('0x40')]=[{'all':!![]}];}return db[_0x9367('0x28')][_0x9367('0x41')](_0x241eab);})[_0x9367('0x23')](function(_0x518c30){_0x49067f[_0x9367('0x42')]=_0x518c30;return _0x49067f;})['then'](respondWithFilteredResult(_0x4b734e,_0x241eab))[_0x9367('0x43')](handleError(_0x4b734e,null));};exports[_0x9367('0x44')]=function(_0xd8df91,_0x89a186){var _0x168806={'raw':!![],'where':{'id':_0xd8df91['params']['id']}},_0x1c5a32={};_0x1c5a32[_0x9367('0x2a')]=_['keys'](db[_0x9367('0x28')][_0x9367('0x29')]);_0x1c5a32['query']=_[_0x9367('0x2b')](_0xd8df91[_0x9367('0x2c')]);_0x1c5a32[_0x9367('0x2d')]=_['intersection'](_0x1c5a32[_0x9367('0x2a')],_0x1c5a32[_0x9367('0x2c')]);_0x168806['attributes']=_[_0x9367('0x2e')](_0x1c5a32[_0x9367('0x2a')],qs[_0x9367('0x2f')](_0xd8df91['query'][_0x9367('0x2f')]));_0x168806[_0x9367('0x30')]=_0x168806[_0x9367('0x30')]['length']?_0x168806[_0x9367('0x30')]:_0x1c5a32[_0x9367('0x2a')];if(_0xd8df91[_0x9367('0x2c')]['includeAll']){_0x168806[_0x9367('0x40')]=[{'all':!![]}];}_0x168806=_['merge']({},_0x168806,_0xd8df91[_0x9367('0x3e')]);return db[_0x9367('0x28')][_0x9367('0x45')](_0x168806)['then'](handleEntityNotFound(_0x89a186,null))['then'](respondWithResult(_0x89a186,null))[_0x9367('0x43')](handleError(_0x89a186,null));};exports[_0x9367('0x46')]=function(_0x2c4ec0,_0x608c5c){return db[_0x9367('0x28')]['create'](_0x2c4ec0[_0x9367('0x47')],{})[_0x9367('0x23')](respondWithResult(_0x608c5c,0xc9))[_0x9367('0x43')](handleError(_0x608c5c,null));};exports[_0x9367('0x22')]=function(_0x2b7d52,_0x179b78){if(_0x2b7d52[_0x9367('0x47')]['id']){delete _0x2b7d52['body']['id'];}return db[_0x9367('0x28')][_0x9367('0x45')]({'where':{'id':_0x2b7d52[_0x9367('0x48')]['id']}})[_0x9367('0x23')](handleEntityNotFound(_0x179b78,null))[_0x9367('0x23')](saveUpdates(_0x2b7d52[_0x9367('0x47')],null))[_0x9367('0x23')](respondWithResult(_0x179b78,null))[_0x9367('0x43')](handleError(_0x179b78,null));};exports['destroy']=function(_0x5ebe20,_0x137d0d){return db[_0x9367('0x28')][_0x9367('0x45')]({'where':{'id':_0x5ebe20[_0x9367('0x48')]['id']}})[_0x9367('0x23')](handleEntityNotFound(_0x137d0d,null))[_0x9367('0x23')](removeEntity(_0x137d0d,null))[_0x9367('0x43')](handleError(_0x137d0d,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 0840081..bc00dc8 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 _0x285e=['path','rimraf','../../config/environment','exports','define','AnalyticTreeReport','lodash','util','api','bluebird','request-promise'];(function(_0x919512,_0x189e52){var _0x38eecf=function(_0x39c1bb){while(--_0x39c1bb){_0x919512['push'](_0x919512['shift']());}};_0x38eecf(++_0x189e52);}(_0x285e,0x19d));var _0xe285=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0x285e[_0x29db36];return _0x234e87;};'use strict';var _=require(_0xe285('0x0'));var util=require(_0xe285('0x1'));var logger=require('../../config/logger')(_0xe285('0x2'));var moment=require('moment');var BPromise=require(_0xe285('0x3'));var rp=require(_0xe285('0x4'));var fs=require('fs');var path=require(_0xe285('0x5'));var rimraf=require(_0xe285('0x6'));var config=require(_0xe285('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0xe285('0x8')]=function(_0x4b4865,_0x1f5fb7){return _0x4b4865[_0xe285('0x9')](_0xe285('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47d9=['analytics_report_trees','lodash','util','api','moment','bluebird','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport'];(function(_0xd4cf1e,_0x1467a6){var _0x1940a9=function(_0x36e6df){while(--_0x36e6df){_0xd4cf1e['push'](_0xd4cf1e['shift']());}};_0x1940a9(++_0x1467a6);}(_0x47d9,0x11f));var _0x947d=function(_0x6fbf91,_0xe0c4eb){_0x6fbf91=_0x6fbf91-0x0;var _0x1bd68b=_0x47d9[_0x6fbf91];return _0x1bd68b;};'use strict';var _=require(_0x947d('0x0'));var util=require(_0x947d('0x1'));var logger=require('../../config/logger')(_0x947d('0x2'));var moment=require(_0x947d('0x3'));var BPromise=require(_0x947d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x947d('0x5'));var config=require('../../config/environment');var attributes=require(_0x947d('0x6'));module[_0x947d('0x7')]=function(_0x3c0316,_0x423d14){return _0x3c0316[_0x947d('0x8')](_0x947d('0x9'),attributes,{'tableName':_0x947d('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 62c312f..9e217ed 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 _0xcf71=['client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2f96da,_0x3338c4){var _0x2a5c8a=function(_0x41eda0){while(--_0x41eda0){_0x2f96da['push'](_0x2f96da['shift']());}};_0x2a5c8a(++_0x3338c4);}(_0xcf71,0x86));var _0x1cf7=function(_0x437e08,_0x1cab6c){_0x437e08=_0x437e08-0x0;var _0xcf57f2=_0xcf71[_0x437e08];return _0xcf57f2;};'use strict';var _=require('lodash');var util=require(_0x1cf7('0x0'));var moment=require('moment');var BPromise=require(_0x1cf7('0x1'));var rs=require(_0x1cf7('0x2'));var fs=require('fs');var Redis=require(_0x1cf7('0x3'));var db=require(_0x1cf7('0x4'))['db'];var utils=require(_0x1cf7('0x5'));var logger=require(_0x1cf7('0x6'))(_0x1cf7('0x7'));var config=require(_0x1cf7('0x8'));var jayson=require(_0x1cf7('0x9'));var client=jayson[_0x1cf7('0xa')][_0x1cf7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x512397,_0x39a657,_0x2a2228){return new BPromise(function(_0x34dfeb,_0x48a99a){return client[_0x1cf7('0xc')](_0x512397,_0x2a2228)[_0x1cf7('0xd')](function(_0x4bbb66){logger[_0x1cf7('0xe')](_0x1cf7('0xf'),_0x39a657,_0x1cf7('0x10'));logger[_0x1cf7('0x11')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x39a657,'request\x20sent',JSON[_0x1cf7('0x12')](_0x4bbb66));if(_0x4bbb66[_0x1cf7('0x13')]){if(_0x4bbb66[_0x1cf7('0x13')][_0x1cf7('0x14')]===0x1f4){logger[_0x1cf7('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x39a657,_0x4bbb66[_0x1cf7('0x13')][_0x1cf7('0x15')]);return _0x48a99a(_0x4bbb66[_0x1cf7('0x13')][_0x1cf7('0x15')]);}logger['error'](_0x1cf7('0xf'),_0x39a657,_0x4bbb66['error'][_0x1cf7('0x15')]);return _0x34dfeb(_0x4bbb66['error']['message']);}else{logger[_0x1cf7('0xe')]('AnalyticTreeReport,\x20%s,\x20%s',_0x39a657,'request\x20sent');_0x34dfeb(_0x4bbb66[_0x1cf7('0x16')][_0x1cf7('0x15')]);}})[_0x1cf7('0x17')](function(_0xe2efdb){logger[_0x1cf7('0x13')](_0x1cf7('0xf'),_0x39a657,_0xe2efdb);_0x48a99a(_0xe2efdb);});});} \ No newline at end of file +var _0xc8b6=['then','info','request\x20sent','debug','stringify','error','code','AnalyticTreeReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','http','request'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xc8b6,0x1d9));var _0x6c8b=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xc8b6[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0x6c8b('0x0'));var util=require(_0x6c8b('0x1'));var moment=require(_0x6c8b('0x2'));var BPromise=require(_0x6c8b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c8b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c8b('0x5'));var logger=require(_0x6c8b('0x6'))(_0x6c8b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6c8b('0x8')][_0x6c8b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d483d,_0x19d2b8,_0x290d8c){return new BPromise(function(_0xb3890b,_0x547b14){return client[_0x6c8b('0xa')](_0x2d483d,_0x290d8c)[_0x6c8b('0xb')](function(_0x57ca9d){logger[_0x6c8b('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x19d2b8,_0x6c8b('0xd'));logger[_0x6c8b('0xe')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x19d2b8,_0x6c8b('0xd'),JSON[_0x6c8b('0xf')](_0x57ca9d));if(_0x57ca9d['error']){if(_0x57ca9d[_0x6c8b('0x10')][_0x6c8b('0x11')]===0x1f4){logger['error'](_0x6c8b('0x12'),_0x19d2b8,_0x57ca9d[_0x6c8b('0x10')][_0x6c8b('0x13')]);return _0x547b14(_0x57ca9d[_0x6c8b('0x10')][_0x6c8b('0x13')]);}logger[_0x6c8b('0x10')](_0x6c8b('0x12'),_0x19d2b8,_0x57ca9d[_0x6c8b('0x10')][_0x6c8b('0x13')]);return _0xb3890b(_0x57ca9d[_0x6c8b('0x10')]['message']);}else{logger[_0x6c8b('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x19d2b8,_0x6c8b('0xd'));_0xb3890b(_0x57ca9d[_0x6c8b('0x14')][_0x6c8b('0x13')]);}})[_0x6c8b('0x15')](function(_0x5dd6b5){logger['error'](_0x6c8b('0x12'),_0x19d2b8,_0x5dd6b5);_0x547b14(_0x5dd6b5);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index e3c4173..35cce11 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 _0xbe2f=['isAuthenticated','post','update','delete','destroy','exports','multer','util','path','express','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id'];(function(_0x584b3f,_0x3b21a5){var _0x359088=function(_0x30a07a){while(--_0x30a07a){_0x584b3f['push'](_0x584b3f['shift']());}};_0x359088(++_0x3b21a5);}(_0xbe2f,0x156));var _0xfbe2=function(_0x38a53b,_0x1385c0){_0x38a53b=_0x38a53b-0x0;var _0x2080d8=_0xbe2f[_0x38a53b];return _0x2080d8;};'use strict';var multer=require(_0xfbe2('0x0'));var util=require(_0xfbe2('0x1'));var path=require(_0xfbe2('0x2'));var timeout=require('connect-timeout');var express=require(_0xfbe2('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xfbe2('0x4'));var config=require(_0xfbe2('0x5'));var controller=require(_0xfbe2('0x6'));router[_0xfbe2('0x7')]('/',auth['isAuthenticated'](),controller[_0xfbe2('0x8')]);router[_0xfbe2('0x7')](_0xfbe2('0x9'),auth[_0xfbe2('0xa')](),controller['show']);router[_0xfbe2('0xb')]('/',auth[_0xfbe2('0xa')](),controller['create']);router['put'](_0xfbe2('0x9'),auth[_0xfbe2('0xa')](),controller[_0xfbe2('0xc')]);router[_0xfbe2('0xd')](_0xfbe2('0x9'),auth[_0xfbe2('0xa')](),controller[_0xfbe2('0xe')]);module[_0xfbe2('0xf')]=router; \ No newline at end of file +var _0x57b5=['../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4f4fd5,_0x2dc33a){var _0xe67be6=function(_0x2c4fb6){while(--_0x2c4fb6){_0x4f4fd5['push'](_0x4f4fd5['shift']());}};_0xe67be6(++_0x2dc33a);}(_0x57b5,0xa5));var _0x557b=function(_0x1fd6f4,_0x4b8481){_0x1fd6f4=_0x1fd6f4-0x0;var _0x32b7f1=_0x57b5[_0x1fd6f4];return _0x32b7f1;};'use strict';var multer=require(_0x557b('0x0'));var util=require('util');var path=require(_0x557b('0x1'));var timeout=require(_0x557b('0x2'));var express=require(_0x557b('0x3'));var router=express[_0x557b('0x4')]();var auth=require(_0x557b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x557b('0x6'));var controller=require(_0x557b('0x7'));router['get']('/',auth[_0x557b('0x8')](),controller[_0x557b('0x9')]);router[_0x557b('0xa')](_0x557b('0xb'),auth[_0x557b('0x8')](),controller[_0x557b('0xc')]);router[_0x557b('0xd')]('/',auth[_0x557b('0x8')](),controller[_0x557b('0xe')]);router[_0x557b('0xf')](_0x557b('0xb'),auth['isAuthenticated'](),controller[_0x557b('0x10')]);router[_0x557b('0x11')](_0x557b('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x557b('0x12')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 1ad22ed..6b86741 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 _0x26bd=['STRING','sequelize'];(function(_0x3eb33b,_0x4da084){var _0x176b9b=function(_0x36211f){while(--_0x36211f){_0x3eb33b['push'](_0x3eb33b['shift']());}};_0x176b9b(++_0x4da084);}(_0x26bd,0x121));var _0xd26b=function(_0x22fdf2,_0x540457){_0x22fdf2=_0x22fdf2-0x0;var _0x121766=_0x26bd[_0x22fdf2];return _0x121766;};'use strict';var Sequelize=require(_0xd26b('0x0'));module['exports']={'name':{'type':Sequelize[_0xd26b('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd26b('0x1')]}}; \ No newline at end of file +var _0x9987=['STRING','exports'];(function(_0x18f152,_0x41585a){var _0xa10b34=function(_0x1e9798){while(--_0x1e9798){_0x18f152['push'](_0x18f152['shift']());}};_0xa10b34(++_0x41585a);}(_0x9987,0xeb));var _0x7998=function(_0xa92f47,_0x1cb6e8){_0xa92f47=_0xa92f47-0x0;var _0x23b232=_0x9987[_0xa92f47];return _0x23b232;};'use strict';var Sequelize=require('sequelize');module[_0x7998('0x0')]={'name':{'type':Sequelize[_0x7998('0x1')]},'basename':{'type':Sequelize[_0x7998('0x1')]},'type':{'type':Sequelize[_0x7998('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index b7ca545..e1f2f07 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 _0x31c1=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','sendStatus','end','json','count','offset','limit','status','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','Attachment','rawAttributes','model','keys','query','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','map','type','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','show','params','fields','catch','body','find','basename','file','mimetype','create','download','findOne','join','root','server/files/attachments/','html-pdf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs'];(function(_0x262d14,_0x5806f9){var _0x437001=function(_0x393fe5){while(--_0x393fe5){_0x262d14['push'](_0x262d14['shift']());}};_0x437001(++_0x5806f9);}(_0x31c1,0x133));var _0x131c=function(_0x4d1aba,_0x59e2f0){_0x4d1aba=_0x4d1aba-0x0;var _0x354960=_0x31c1[_0x4d1aba];return _0x354960;};'use strict';var pdf=require(_0x131c('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x131c('0x1'));var rp=require(_0x131c('0x2'));var moment=require(_0x131c('0x3'));var BPromise=require(_0x131c('0x4'));var Mustache=require('mustache');var util=require(_0x131c('0x5'));var path=require('path');var sox=require(_0x131c('0x6'));var csv=require(_0x131c('0x7'));var ejs=require(_0x131c('0x8'));var fs=require('fs');var _=require(_0x131c('0x9'));var squel=require(_0x131c('0xa'));var crypto=require(_0x131c('0xb'));var jsforce=require(_0x131c('0xc'));var deskjs=require(_0x131c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x131c('0xe'));var Papa=require(_0x131c('0xf'));var Redis=require(_0x131c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x131c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x131c('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x131c('0x13'))['db'];function respondWithStatusCode(_0x112408,_0x53ca5f){_0x53ca5f=_0x53ca5f||0xcc;return function(_0x344587){if(_0x344587){return _0x112408[_0x131c('0x14')](_0x53ca5f);}return _0x112408['status'](_0x53ca5f)[_0x131c('0x15')]();};}function respondWithResult(_0x1f0fff,_0x48d050){_0x48d050=_0x48d050||0xc8;return function(_0xea7527){if(_0xea7527){return _0x1f0fff['status'](_0x48d050)[_0x131c('0x16')](_0xea7527);}};}function respondWithFilteredResult(_0x1ec14f,_0x12d1b3){return function(_0xf9db13){if(_0xf9db13){var _0x32d5f1=_0xf9db13[_0x131c('0x17')],_0x138796=_0x12d1b3[_0x131c('0x18')],_0x538216=_0x12d1b3[_0x131c('0x18')]+_0x12d1b3[_0x131c('0x19')],_0x308af8;if(_0x538216>=_0x32d5f1){_0x538216=_0x32d5f1;_0x308af8=0xc8;}else{_0x308af8=0xce;}_0x1ec14f[_0x131c('0x1a')](_0x308af8);return _0x1ec14f['set'](_0x131c('0x1b'),_0x138796+'-'+_0x538216+'/'+_0x32d5f1)[_0x131c('0x16')](_0xf9db13);}return null;};}function patchUpdates(_0x9c4c68){return function(_0x1e4ce1){try{jsonpatch[_0x131c('0x1c')](_0x1e4ce1,_0x9c4c68,!![]);}catch(_0x125527){return BPromise[_0x131c('0x1d')](_0x125527);}return _0x1e4ce1[_0x131c('0x1e')]();};}function saveUpdates(_0x44aed7,_0x2ee25b){return function(_0x1911aa){if(_0x1911aa){return _0x1911aa[_0x131c('0x1f')](_0x44aed7)[_0x131c('0x20')](function(_0x4b0dda){return _0x4b0dda;});}return null;};}function removeEntity(_0x3576a4,_0x567fe){return function(_0x27bf69){if(_0x27bf69){return _0x27bf69[_0x131c('0x21')]()[_0x131c('0x20')](function(){_0x3576a4['status'](0xcc)[_0x131c('0x15')]();});}};}function handleEntityNotFound(_0x31243f,_0x25249b){return function(_0x4a0ec3){if(!_0x4a0ec3){_0x31243f[_0x131c('0x14')](0x194);}return _0x4a0ec3;};}function handleError(_0x13d461,_0x1c0b99){_0x1c0b99=_0x1c0b99||0x1f4;return function(_0x1f7e5f){logger[_0x131c('0x22')](_0x1f7e5f['stack']);if(_0x1f7e5f[_0x131c('0x23')]){delete _0x1f7e5f[_0x131c('0x23')];}_0x13d461[_0x131c('0x1a')](_0x1c0b99)[_0x131c('0x24')](_0x1f7e5f);};}exports[_0x131c('0x25')]=function(_0x57d156,_0x2fcf62){var _0x111161={},_0x124d7e={},_0x133c4c={'count':0x0,'rows':[]};var _0x4349e4=db[_0x131c('0x26')][_0x131c('0x27')];_0x124d7e[_0x131c('0x28')]=_[_0x131c('0x29')](_0x4349e4);_0x124d7e[_0x131c('0x2a')]=_[_0x131c('0x29')](_0x57d156['query']);_0x124d7e['filters']=_['intersection'](_0x124d7e['model'],_0x124d7e[_0x131c('0x2a')]);_0x111161[_0x131c('0x2b')]=_[_0x131c('0x2c')](_0x124d7e[_0x131c('0x28')],qs['fields'](_0x57d156[_0x131c('0x2a')]['fields']));_0x111161[_0x131c('0x2b')]=_0x111161[_0x131c('0x2b')][_0x131c('0x2d')]?_0x111161[_0x131c('0x2b')]:_0x124d7e[_0x131c('0x28')];if(!_0x57d156[_0x131c('0x2a')][_0x131c('0x2e')](_0x131c('0x2f'))){_0x111161[_0x131c('0x19')]=qs[_0x131c('0x19')](_0x57d156['query'][_0x131c('0x19')]);_0x111161[_0x131c('0x18')]=qs['offset'](_0x57d156[_0x131c('0x2a')][_0x131c('0x18')]);}_0x111161[_0x131c('0x30')]=qs[_0x131c('0x31')](_0x57d156[_0x131c('0x2a')][_0x131c('0x31')]);_0x111161['where']=qs[_0x131c('0x32')](_[_0x131c('0x33')](_0x57d156['query'],_0x124d7e[_0x131c('0x32')]));if(_0x57d156[_0x131c('0x2a')]['filter']){_0x111161[_0x131c('0x34')]=_[_0x131c('0x35')](_0x111161['where'],{'$or':_[_0x131c('0x36')](_0x4349e4,function(_0x1b7d17){if(_0x1b7d17[_0x131c('0x37')]['key']!==_0x131c('0x38')){var _0x24d3ad={};_0x24d3ad[_0x1b7d17[_0x131c('0x39')]]={'$like':'%'+_0x57d156['query'][_0x131c('0x3a')]+'%'};return _0x24d3ad;}})});}_0x111161=_['merge']({},_0x111161,_0x57d156[_0x131c('0x3b')]);var _0x2cbfb8={'where':_0x111161[_0x131c('0x34')]};return db[_0x131c('0x26')][_0x131c('0x17')](_0x2cbfb8)[_0x131c('0x20')](function(_0x519cf8){_0x133c4c[_0x131c('0x17')]=_0x519cf8;if(_0x57d156[_0x131c('0x2a')][_0x131c('0x3c')]){_0x111161[_0x131c('0x3d')]=[{'all':!![]}];}return db['Attachment'][_0x131c('0x3e')](_0x111161);})[_0x131c('0x20')](function(_0x20e5ef){_0x133c4c[_0x131c('0x3f')]=_0x20e5ef;return _0x133c4c;})[_0x131c('0x20')](respondWithFilteredResult(_0x2fcf62,_0x111161))['catch'](handleError(_0x2fcf62,null));};exports[_0x131c('0x40')]=function(_0x11c1b2,_0x66c7f8){var _0x34ae28={'raw':!![],'where':{'id':_0x11c1b2[_0x131c('0x41')]['id']}},_0x1c7408={};_0x1c7408['model']=_['keys'](db[_0x131c('0x26')][_0x131c('0x27')]);_0x1c7408[_0x131c('0x2a')]=_[_0x131c('0x29')](_0x11c1b2['query']);_0x1c7408[_0x131c('0x32')]=_['intersection'](_0x1c7408[_0x131c('0x28')],_0x1c7408['query']);_0x34ae28[_0x131c('0x2b')]=_[_0x131c('0x2c')](_0x1c7408['model'],qs[_0x131c('0x42')](_0x11c1b2['query'][_0x131c('0x42')]));_0x34ae28['attributes']=_0x34ae28[_0x131c('0x2b')][_0x131c('0x2d')]?_0x34ae28[_0x131c('0x2b')]:_0x1c7408['model'];if(_0x11c1b2[_0x131c('0x2a')][_0x131c('0x3c')]){_0x34ae28['include']=[{'all':!![]}];}_0x34ae28=_['merge']({},_0x34ae28,_0x11c1b2[_0x131c('0x3b')]);return db[_0x131c('0x26')]['find'](_0x34ae28)['then'](handleEntityNotFound(_0x66c7f8,null))[_0x131c('0x20')](respondWithResult(_0x66c7f8,null))[_0x131c('0x43')](handleError(_0x66c7f8,null));};exports[_0x131c('0x1f')]=function(_0x84541e,_0x4d7299){if(_0x84541e[_0x131c('0x44')]['id']){delete _0x84541e[_0x131c('0x44')]['id'];}return db[_0x131c('0x26')]['find']({'where':{'id':_0x84541e[_0x131c('0x41')]['id']}})[_0x131c('0x20')](handleEntityNotFound(_0x4d7299,null))[_0x131c('0x20')](saveUpdates(_0x84541e['body'],null))[_0x131c('0x20')](respondWithResult(_0x4d7299,null))[_0x131c('0x43')](handleError(_0x4d7299,null));};exports[_0x131c('0x21')]=function(_0x7d6035,_0x1a92e3){return db[_0x131c('0x26')][_0x131c('0x45')]({'where':{'id':_0x7d6035[_0x131c('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a92e3,null))[_0x131c('0x20')](removeEntity(_0x1a92e3,null))[_0x131c('0x43')](handleError(_0x1a92e3,null));};exports['create']=function(_0x31d150,_0x24b761,_0x48ef3b){_0x31d150['body'][_0x131c('0x23')]=_0x31d150['file']['originalname'];_0x31d150['body'][_0x131c('0x46')]=_0x31d150[_0x131c('0x47')]['filename'];_0x31d150[_0x131c('0x44')][_0x131c('0x37')]=_0x31d150[_0x131c('0x47')][_0x131c('0x48')];return db[_0x131c('0x26')][_0x131c('0x49')](_0x31d150[_0x131c('0x44')])[_0x131c('0x20')](respondWithResult(_0x24b761,0xc9))[_0x131c('0x43')](handleError(_0x24b761,null));};exports[_0x131c('0x4a')]=function(_0x44a677,_0x5a73a4,_0x4074a8){return db[_0x131c('0x26')][_0x131c('0x4b')]({'where':{'id':_0x44a677[_0x131c('0x41')]['id']},'raw':!![]})[_0x131c('0x20')](handleEntityNotFound(_0x5a73a4,null))['then'](function(_0x550004){if(_0x550004){return _0x5a73a4[_0x131c('0x4a')](path[_0x131c('0x4c')](config[_0x131c('0x4d')],_0x131c('0x4e'),_0x550004[_0x131c('0x46')]));}})[_0x131c('0x43')](handleError(_0x5a73a4,null));}; \ No newline at end of file +var _0xe70c=['file','originalname','basename','filename','mimetype','create','download','findOne','root','server/files/attachments/','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','update','then','end','error','stack','name','send','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','Attachment','findAll','catch','show','params','intersection','body','find','destroy'];(function(_0x46b22a,_0x5bf83a){var _0x44c2e8=function(_0x21b6fc){while(--_0x21b6fc){_0x46b22a['push'](_0x46b22a['shift']());}};_0x44c2e8(++_0x5bf83a);}(_0xe70c,0xf7));var _0xce70=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xe70c[_0xbca1b1];return _0x4e1686;};'use strict';var pdf=require(_0xce70('0x0'));var emlformat=require(_0xce70('0x1'));var rimraf=require(_0xce70('0x2'));var zipdir=require(_0xce70('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xce70('0x4'));var moment=require(_0xce70('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xce70('0x6'));var util=require(_0xce70('0x7'));var path=require(_0xce70('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xce70('0x9'));var squel=require(_0xce70('0xa'));var crypto=require('crypto');var jsforce=require(_0xce70('0xb'));var deskjs=require(_0xce70('0xc'));var toCsv=require('to-csv');var querystring=require(_0xce70('0xd'));var Papa=require(_0xce70('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xce70('0xf'));var hardwareService=require(_0xce70('0x10'));var logger=require(_0xce70('0x11'))(_0xce70('0x12'));var utils=require(_0xce70('0x13'));var config=require(_0xce70('0x14'));var db=require(_0xce70('0x15'))['db'];function respondWithStatusCode(_0x197037,_0x17c8fc){_0x17c8fc=_0x17c8fc||0xcc;return function(_0x5252f1){if(_0x5252f1){return _0x197037[_0xce70('0x16')](_0x17c8fc);}return _0x197037[_0xce70('0x17')](_0x17c8fc)['end']();};}function respondWithResult(_0x3e0a7e,_0x55c111){_0x55c111=_0x55c111||0xc8;return function(_0x4ba6d2){if(_0x4ba6d2){return _0x3e0a7e[_0xce70('0x17')](_0x55c111)[_0xce70('0x18')](_0x4ba6d2);}};}function respondWithFilteredResult(_0x23c844,_0x376517){return function(_0x56338a){if(_0x56338a){var _0x50f8c8=_0x56338a[_0xce70('0x19')],_0x18ea6a=_0x376517[_0xce70('0x1a')],_0x19c572=_0x376517[_0xce70('0x1a')]+_0x376517[_0xce70('0x1b')],_0xe8092;if(_0x19c572>=_0x50f8c8){_0x19c572=_0x50f8c8;_0xe8092=0xc8;}else{_0xe8092=0xce;}_0x23c844[_0xce70('0x17')](_0xe8092);return _0x23c844[_0xce70('0x1c')]('Content-Range',_0x18ea6a+'-'+_0x19c572+'/'+_0x50f8c8)[_0xce70('0x18')](_0x56338a);}return null;};}function patchUpdates(_0x51acf7){return function(_0x4fc092){try{jsonpatch[_0xce70('0x1d')](_0x4fc092,_0x51acf7,!![]);}catch(_0x5e81be){return BPromise['reject'](_0x5e81be);}return _0x4fc092['save']();};}function saveUpdates(_0x3adc49,_0x510d6e){return function(_0x1dca9b){if(_0x1dca9b){return _0x1dca9b[_0xce70('0x1e')](_0x3adc49)[_0xce70('0x1f')](function(_0x4c2cba){return _0x4c2cba;});}return null;};}function removeEntity(_0x3a6c93,_0x590f46){return function(_0x18fd1e){if(_0x18fd1e){return _0x18fd1e['destroy']()[_0xce70('0x1f')](function(){_0x3a6c93[_0xce70('0x17')](0xcc)[_0xce70('0x20')]();});}};}function handleEntityNotFound(_0x51371b,_0x532994){return function(_0x268db0){if(!_0x268db0){_0x51371b[_0xce70('0x16')](0x194);}return _0x268db0;};}function handleError(_0x24445f,_0x47f69a){_0x47f69a=_0x47f69a||0x1f4;return function(_0x4e3b7a){logger[_0xce70('0x21')](_0x4e3b7a[_0xce70('0x22')]);if(_0x4e3b7a['name']){delete _0x4e3b7a[_0xce70('0x23')];}_0x24445f[_0xce70('0x17')](_0x47f69a)[_0xce70('0x24')](_0x4e3b7a);};}exports['index']=function(_0x35a0ec,_0x4a1a8c){var _0x24df0c={},_0x1abd29={},_0x4f9f39={'count':0x0,'rows':[]};var _0x1863cb=db['Attachment'][_0xce70('0x25')];_0x1abd29[_0xce70('0x26')]=_[_0xce70('0x27')](_0x1863cb);_0x1abd29[_0xce70('0x28')]=_[_0xce70('0x27')](_0x35a0ec[_0xce70('0x28')]);_0x1abd29[_0xce70('0x29')]=_['intersection'](_0x1abd29[_0xce70('0x26')],_0x1abd29[_0xce70('0x28')]);_0x24df0c[_0xce70('0x2a')]=_['intersection'](_0x1abd29[_0xce70('0x26')],qs[_0xce70('0x2b')](_0x35a0ec[_0xce70('0x28')][_0xce70('0x2b')]));_0x24df0c[_0xce70('0x2a')]=_0x24df0c[_0xce70('0x2a')][_0xce70('0x2c')]?_0x24df0c[_0xce70('0x2a')]:_0x1abd29[_0xce70('0x26')];if(!_0x35a0ec[_0xce70('0x28')][_0xce70('0x2d')](_0xce70('0x2e'))){_0x24df0c[_0xce70('0x1b')]=qs['limit'](_0x35a0ec[_0xce70('0x28')]['limit']);_0x24df0c['offset']=qs['offset'](_0x35a0ec[_0xce70('0x28')][_0xce70('0x1a')]);}_0x24df0c[_0xce70('0x2f')]=qs['sort'](_0x35a0ec[_0xce70('0x28')][_0xce70('0x30')]);_0x24df0c[_0xce70('0x31')]=qs[_0xce70('0x29')](_[_0xce70('0x32')](_0x35a0ec['query'],_0x1abd29[_0xce70('0x29')]));if(_0x35a0ec[_0xce70('0x28')][_0xce70('0x33')]){_0x24df0c[_0xce70('0x31')]=_[_0xce70('0x34')](_0x24df0c[_0xce70('0x31')],{'$or':_[_0xce70('0x35')](_0x1863cb,function(_0x558363){if(_0x558363['type'][_0xce70('0x36')]!==_0xce70('0x37')){var _0x272a42={};_0x272a42[_0x558363[_0xce70('0x38')]]={'$like':'%'+_0x35a0ec[_0xce70('0x28')][_0xce70('0x33')]+'%'};return _0x272a42;}})});}_0x24df0c=_[_0xce70('0x34')]({},_0x24df0c,_0x35a0ec[_0xce70('0x39')]);var _0xe37a8d={'where':_0x24df0c[_0xce70('0x31')]};return db['Attachment']['count'](_0xe37a8d)[_0xce70('0x1f')](function(_0x3519a4){_0x4f9f39[_0xce70('0x19')]=_0x3519a4;if(_0x35a0ec['query'][_0xce70('0x3a')]){_0x24df0c[_0xce70('0x3b')]=[{'all':!![]}];}return db[_0xce70('0x3c')][_0xce70('0x3d')](_0x24df0c);})[_0xce70('0x1f')](function(_0x23cdc6){_0x4f9f39['rows']=_0x23cdc6;return _0x4f9f39;})[_0xce70('0x1f')](respondWithFilteredResult(_0x4a1a8c,_0x24df0c))[_0xce70('0x3e')](handleError(_0x4a1a8c,null));};exports[_0xce70('0x3f')]=function(_0x4a0be6,_0x203456){var _0x2d2ab6={'raw':!![],'where':{'id':_0x4a0be6[_0xce70('0x40')]['id']}},_0x24fee7={};_0x24fee7[_0xce70('0x26')]=_['keys'](db[_0xce70('0x3c')][_0xce70('0x25')]);_0x24fee7[_0xce70('0x28')]=_[_0xce70('0x27')](_0x4a0be6['query']);_0x24fee7['filters']=_[_0xce70('0x41')](_0x24fee7[_0xce70('0x26')],_0x24fee7[_0xce70('0x28')]);_0x2d2ab6[_0xce70('0x2a')]=_['intersection'](_0x24fee7[_0xce70('0x26')],qs[_0xce70('0x2b')](_0x4a0be6['query']['fields']));_0x2d2ab6[_0xce70('0x2a')]=_0x2d2ab6[_0xce70('0x2a')][_0xce70('0x2c')]?_0x2d2ab6[_0xce70('0x2a')]:_0x24fee7[_0xce70('0x26')];if(_0x4a0be6[_0xce70('0x28')][_0xce70('0x3a')]){_0x2d2ab6[_0xce70('0x3b')]=[{'all':!![]}];}_0x2d2ab6=_[_0xce70('0x34')]({},_0x2d2ab6,_0x4a0be6[_0xce70('0x39')]);return db[_0xce70('0x3c')]['find'](_0x2d2ab6)[_0xce70('0x1f')](handleEntityNotFound(_0x203456,null))[_0xce70('0x1f')](respondWithResult(_0x203456,null))[_0xce70('0x3e')](handleError(_0x203456,null));};exports[_0xce70('0x1e')]=function(_0x21ca48,_0x4e0f79){if(_0x21ca48[_0xce70('0x42')]['id']){delete _0x21ca48[_0xce70('0x42')]['id'];}return db[_0xce70('0x3c')][_0xce70('0x43')]({'where':{'id':_0x21ca48[_0xce70('0x40')]['id']}})[_0xce70('0x1f')](handleEntityNotFound(_0x4e0f79,null))[_0xce70('0x1f')](saveUpdates(_0x21ca48['body'],null))[_0xce70('0x1f')](respondWithResult(_0x4e0f79,null))[_0xce70('0x3e')](handleError(_0x4e0f79,null));};exports[_0xce70('0x44')]=function(_0x3f4690,_0x15838a){return db[_0xce70('0x3c')][_0xce70('0x43')]({'where':{'id':_0x3f4690[_0xce70('0x40')]['id']}})[_0xce70('0x1f')](handleEntityNotFound(_0x15838a,null))[_0xce70('0x1f')](removeEntity(_0x15838a,null))['catch'](handleError(_0x15838a,null));};exports['create']=function(_0x1c2570,_0x109cd9,_0x1d9162){_0x1c2570['body']['name']=_0x1c2570[_0xce70('0x45')][_0xce70('0x46')];_0x1c2570['body'][_0xce70('0x47')]=_0x1c2570[_0xce70('0x45')][_0xce70('0x48')];_0x1c2570['body']['type']=_0x1c2570[_0xce70('0x45')][_0xce70('0x49')];return db[_0xce70('0x3c')][_0xce70('0x4a')](_0x1c2570[_0xce70('0x42')])[_0xce70('0x1f')](respondWithResult(_0x109cd9,0xc9))['catch'](handleError(_0x109cd9,null));};exports[_0xce70('0x4b')]=function(_0x1f0b1c,_0x2b517d,_0x1f1118){return db[_0xce70('0x3c')][_0xce70('0x4c')]({'where':{'id':_0x1f0b1c[_0xce70('0x40')]['id']},'raw':!![]})[_0xce70('0x1f')](handleEntityNotFound(_0x2b517d,null))[_0xce70('0x1f')](function(_0x35729c){if(_0x35729c){return _0x2b517d[_0xce70('0x4b')](path['join'](config[_0xce70('0x4d')],_0xce70('0x4e'),_0x35729c[_0xce70('0x47')]));}})[_0xce70('0x3e')](handleError(_0x2b517d,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 7954c70..540fcd7 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 _0x682e=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments'];(function(_0x3e2175,_0x2c8f4a){var _0x185334=function(_0x18ea69){while(--_0x18ea69){_0x3e2175['push'](_0x3e2175['shift']());}};_0x185334(++_0x2c8f4a);}(_0x682e,0x1ce));var _0xe682=function(_0x326f86,_0x1e344f){_0x326f86=_0x326f86-0x0;var _0x4b4932=_0x682e[_0x326f86];return _0x4b4932;};'use strict';var _=require(_0xe682('0x0'));var util=require(_0xe682('0x1'));var logger=require(_0xe682('0x2'))(_0xe682('0x3'));var moment=require(_0xe682('0x4'));var BPromise=require(_0xe682('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe682('0x6'));var rimraf=require(_0xe682('0x7'));var config=require(_0xe682('0x8'));var attributes=require(_0xe682('0x9'));module[_0xe682('0xa')]=function(_0x51e786,_0x3b4c98){return _0x51e786[_0xe682('0xb')](_0xe682('0xc'),attributes,{'tableName':_0xe682('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa62c=['bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','lodash','util','../../config/logger','api','moment'];(function(_0x2ef60e,_0x35c32c){var _0x3be207=function(_0x25377d){while(--_0x25377d){_0x2ef60e['push'](_0x2ef60e['shift']());}};_0x3be207(++_0x35c32c);}(_0xa62c,0x70));var _0xca62=function(_0x4f6d08,_0x1b3dd0){_0x4f6d08=_0x4f6d08-0x0;var _0x53a9c6=_0xa62c[_0x4f6d08];return _0x53a9c6;};'use strict';var _=require(_0xca62('0x0'));var util=require(_0xca62('0x1'));var logger=require(_0xca62('0x2'))(_0xca62('0x3'));var moment=require(_0xca62('0x4'));var BPromise=require(_0xca62('0x5'));var rp=require(_0xca62('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xca62('0x7'));var config=require(_0xca62('0x8'));var attributes=require(_0xca62('0x9'));module[_0xca62('0xa')]=function(_0x1e51ba,_0x31d267){return _0x1e51ba[_0xca62('0xb')](_0xca62('0xc'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 26b8111..26879a5 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 _0xb5c1=['CreateAttachment','debug','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Attachment','create','options','info'];(function(_0x675246,_0x1d0878){var _0x59e2c7=function(_0x2d3d74){while(--_0x2d3d74){_0x675246['push'](_0x675246['shift']());}};_0x59e2c7(++_0x1d0878);}(_0xb5c1,0x152));var _0x1b5c=function(_0x440ffa,_0x4b2611){_0x440ffa=_0x440ffa-0x0;var _0x819083=_0xb5c1[_0x440ffa];return _0x819083;};'use strict';var _=require(_0x1b5c('0x0'));var util=require(_0x1b5c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1b5c('0x2'));var fs=require('fs');var Redis=require(_0x1b5c('0x3'));var db=require(_0x1b5c('0x4'))['db'];var utils=require(_0x1b5c('0x5'));var logger=require('../../config/logger')(_0x1b5c('0x6'));var config=require(_0x1b5c('0x7'));var jayson=require(_0x1b5c('0x8'));var client=jayson[_0x1b5c('0x9')][_0x1b5c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x536ec9,_0x461c8c,_0x21f4bc){return new BPromise(function(_0x374dba,_0x53c361){return client[_0x1b5c('0xb')](_0x536ec9,_0x21f4bc)[_0x1b5c('0xc')](function(_0xd7fd46){logger['info'](_0x1b5c('0xd'),_0x461c8c,_0x1b5c('0xe'));logger['debug'](_0x1b5c('0xf'),_0x461c8c,'request\x20sent',JSON[_0x1b5c('0x10')](_0xd7fd46));if(_0xd7fd46[_0x1b5c('0x11')]){if(_0xd7fd46[_0x1b5c('0x11')][_0x1b5c('0x12')]===0x1f4){logger['error'](_0x1b5c('0xd'),_0x461c8c,_0xd7fd46[_0x1b5c('0x11')]['message']);return _0x53c361(_0xd7fd46[_0x1b5c('0x11')]['message']);}logger[_0x1b5c('0x11')]('Attachment,\x20%s,\x20%s',_0x461c8c,_0xd7fd46[_0x1b5c('0x11')][_0x1b5c('0x13')]);return _0x374dba(_0xd7fd46[_0x1b5c('0x11')][_0x1b5c('0x13')]);}else{logger['info'](_0x1b5c('0xd'),_0x461c8c,'request\x20sent');_0x374dba(_0xd7fd46[_0x1b5c('0x14')][_0x1b5c('0x13')]);}})[_0x1b5c('0x15')](function(_0x302cd7){logger[_0x1b5c('0x11')](_0x1b5c('0xd'),_0x461c8c,_0x302cd7);_0x53c361(_0x302cd7);});});}exports['CreateAttachment']=function(_0x536c4b){var _0x195fcc=this;return new Promise(function(_0x4b12fb,_0x1a78e8){return db[_0x1b5c('0x16')][_0x1b5c('0x17')](_0x536c4b['body'],{'raw':_0x536c4b[_0x1b5c('0x18')]?_0x536c4b[_0x1b5c('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x1b5c('0xc')](function(_0x356d47){logger[_0x1b5c('0x19')](_0x1b5c('0x1a'),_0x536c4b);logger[_0x1b5c('0x1b')](_0x1b5c('0x1a'),_0x536c4b,JSON['stringify'](_0x356d47));_0x4b12fb(_0x356d47);})[_0x1b5c('0x15')](function(_0x1aac1d){logger[_0x1b5c('0x11')](_0x1b5c('0x1a'),_0x1aac1d[_0x1b5c('0x13')],_0x536c4b);_0x1a78e8(_0x195fcc[_0x1b5c('0x11')](0x1f4,_0x1aac1d[_0x1b5c('0x13')]));});});}; \ No newline at end of file +var _0x0381=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateAttachment','create','body','options','raw','lodash','util','bluebird','randomstring'];(function(_0x2327a4,_0x4ac0ce){var _0x44de36=function(_0x5e3183){while(--_0x5e3183){_0x2327a4['push'](_0x2327a4['shift']());}};_0x44de36(++_0x4ac0ce);}(_0x0381,0x1c7));var _0x1038=function(_0x5e45f8,_0x336669){_0x5e45f8=_0x5e45f8-0x0;var _0x418888=_0x0381[_0x5e45f8];return _0x418888;};'use strict';var _=require(_0x1038('0x0'));var util=require(_0x1038('0x1'));var moment=require('moment');var BPromise=require(_0x1038('0x2'));var rs=require(_0x1038('0x3'));var fs=require('fs');var Redis=require(_0x1038('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1038('0x5'));var logger=require(_0x1038('0x6'))(_0x1038('0x7'));var config=require(_0x1038('0x8'));var jayson=require(_0x1038('0x9'));var client=jayson['client'][_0x1038('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x265f51,_0x44dc20,_0x30744a){return new BPromise(function(_0x3b987d,_0x2c6630){return client['request'](_0x265f51,_0x30744a)[_0x1038('0xb')](function(_0x38b9aa){logger[_0x1038('0xc')](_0x1038('0xd'),_0x44dc20,_0x1038('0xe'));logger[_0x1038('0xf')](_0x1038('0x10'),_0x44dc20,_0x1038('0xe'),JSON[_0x1038('0x11')](_0x38b9aa));if(_0x38b9aa[_0x1038('0x12')]){if(_0x38b9aa['error'][_0x1038('0x13')]===0x1f4){logger[_0x1038('0x12')](_0x1038('0xd'),_0x44dc20,_0x38b9aa[_0x1038('0x12')]['message']);return _0x2c6630(_0x38b9aa[_0x1038('0x12')]['message']);}logger[_0x1038('0x12')](_0x1038('0xd'),_0x44dc20,_0x38b9aa[_0x1038('0x12')][_0x1038('0x14')]);return _0x3b987d(_0x38b9aa[_0x1038('0x12')]['message']);}else{logger[_0x1038('0xc')](_0x1038('0xd'),_0x44dc20,_0x1038('0xe'));_0x3b987d(_0x38b9aa['result'][_0x1038('0x14')]);}})[_0x1038('0x15')](function(_0x538bcb){logger['error'](_0x1038('0xd'),_0x44dc20,_0x538bcb);_0x2c6630(_0x538bcb);});});}exports[_0x1038('0x16')]=function(_0x4a0e28){var _0x557964=this;return new Promise(function(_0x300295,_0x539e67){return db['Attachment'][_0x1038('0x17')](_0x4a0e28[_0x1038('0x18')],{'raw':_0x4a0e28[_0x1038('0x19')]?_0x4a0e28[_0x1038('0x19')][_0x1038('0x1a')]===undefined?!![]:![]:!![]})[_0x1038('0xb')](function(_0x5dbd2f){logger['info'](_0x1038('0x16'),_0x4a0e28);logger[_0x1038('0xf')](_0x1038('0x16'),_0x4a0e28,JSON[_0x1038('0x11')](_0x5dbd2f));_0x300295(_0x5dbd2f);})[_0x1038('0x15')](function(_0x43b148){logger['error'](_0x1038('0x16'),_0x43b148['message'],_0x4a0e28);_0x539e67(_0x557964[_0x1038('0x12')](0x1f4,_0x43b148['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index b4c4607..8fafa9f 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 _0x49e9=['destroy','multer','util','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','join','root','format','%s-%s','now','originalname','replace','post','single','file','create','put','delete'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x49e9,0x10f));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x949e('0x0'));var util=require(_0x949e('0x1'));var path=require('path');var timeout=require(_0x949e('0x2'));var express=require(_0x949e('0x3'));var router=express[_0x949e('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x949e('0x5'));var controller=require('./attachment.controller');router[_0x949e('0x6')]('/',auth[_0x949e('0x7')](),controller[_0x949e('0x8')]);router['get'](_0x949e('0x9'),auth[_0x949e('0x7')](),controller[_0x949e('0xa')]);router[_0x949e('0x6')](_0x949e('0xb'),auth[_0x949e('0x7')](),controller[_0x949e('0xc')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x394859,_0x50ca96,_0x422dcc){_0x422dcc(null,path[_0x949e('0xd')](config[_0x949e('0xe')],'server/files/attachments/'));},'filename':function(_0x2e401f,_0x1935a3,_0x227ea9){_0x227ea9(null,util[_0x949e('0xf')](_0x949e('0x10'),Date[_0x949e('0x11')](),_0x1935a3[_0x949e('0x12')][_0x949e('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x949e('0x14')]('/',upload[_0x949e('0x15')](_0x949e('0x16')),controller[_0x949e('0x17')]);router[_0x949e('0x18')](_0x949e('0x9'),auth[_0x949e('0x7')](),controller['update']);router[_0x949e('0x19')](_0x949e('0x9'),auth[_0x949e('0x7')](),controller[_0x949e('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x9b87=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','/:id','download','diskStorage','join','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','exports','multer','util','path'];(function(_0x1b5ea5,_0x96cd5c){var _0x1bfcf8=function(_0x3be973){while(--_0x3be973){_0x1b5ea5['push'](_0x1b5ea5['shift']());}};_0x1bfcf8(++_0x96cd5c);}(_0x9b87,0x8e));var _0x79b8=function(_0x3431dd,_0x51eea1){_0x3431dd=_0x3431dd-0x0;var _0x404de6=_0x9b87[_0x3431dd];return _0x404de6;};'use strict';var multer=require(_0x79b8('0x0'));var util=require(_0x79b8('0x1'));var path=require(_0x79b8('0x2'));var timeout=require(_0x79b8('0x3'));var express=require(_0x79b8('0x4'));var router=express[_0x79b8('0x5')]();var auth=require(_0x79b8('0x6'));var interaction=require(_0x79b8('0x7'));var config=require(_0x79b8('0x8'));var controller=require(_0x79b8('0x9'));router[_0x79b8('0xa')]('/',auth[_0x79b8('0xb')](),controller[_0x79b8('0xc')]);router[_0x79b8('0xa')](_0x79b8('0xd'),auth[_0x79b8('0xb')](),controller['show']);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x79b8('0xe')]);var upload=multer({'storage':multer[_0x79b8('0xf')]({'destination':function(_0x2f3453,_0x4bc41f,_0x28434){_0x28434(null,path[_0x79b8('0x10')](config[_0x79b8('0x11')],'server/files/attachments/'));},'filename':function(_0x5a4683,_0x46c0ce,_0x476e35){_0x476e35(null,util[_0x79b8('0x12')](_0x79b8('0x13'),Date[_0x79b8('0x14')](),_0x46c0ce[_0x79b8('0x15')][_0x79b8('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x79b8('0x17')]('/',upload[_0x79b8('0x18')](_0x79b8('0x19')),controller[_0x79b8('0x1a')]);router['put'](_0x79b8('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x79b8('0x1b')](_0x79b8('0xd'),auth[_0x79b8('0xb')](),controller['destroy']);module[_0x79b8('0x1c')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 1b6564d..c89f395 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 _0x30bc=['../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','email','callback','use','clientID','clientSecret','secret','callbackURL','Setting','allowedLoginAttempts','User','map','emails','value','admin','agent','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blockedAt','add','minutes','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','moment'];(function(_0x15797a,_0x16274f){var _0x3e2618=function(_0x2b6e99){while(--_0x2b6e99){_0x15797a['push'](_0x15797a['shift']());}};_0x3e2618(++_0x16274f);}(_0x30bc,0x149));var _0xc30b=function(_0x36856f,_0x98b59e){_0x36856f=_0x36856f-0x0;var _0x43ac52=_0x30bc[_0x36856f];return _0x43ac52;};'use strict';var _=require(_0xc30b('0x0'));var passport=require(_0xc30b('0x1'));var GoogleStrategy=require(_0xc30b('0x2'))['Strategy'];var moment=require(_0xc30b('0x3'));var db=require(_0xc30b('0x4'))['db'];var config=require(_0xc30b('0x5'));var signToken=require(_0xc30b('0x6'))[_0xc30b('0x7')];var utils=require(_0xc30b('0x8'));exports[_0xc30b('0x9')]=passport[_0xc30b('0xa')](_0xc30b('0xb'),{'failureRedirect':_0xc30b('0xc'),'scope':['profile',_0xc30b('0xd')],'session':![]});exports[_0xc30b('0xe')]=passport[_0xc30b('0xa')](_0xc30b('0xb'),{'failureRedirect':'/login','session':![]});passport[_0xc30b('0xf')](new GoogleStrategy({'clientID':config['google']?config[_0xc30b('0xb')][_0xc30b('0x10')]:'id','clientSecret':config['google']?config['google'][_0xc30b('0x11')]:_0xc30b('0x12'),'callbackURL':config[_0xc30b('0xb')]?config[_0xc30b('0xb')][_0xc30b('0x13')]:''},function(_0x41210d,_0x597c8d,_0x32f7f0,_0x3e155a){var _0x4d72a2,_0x15b529;return db[_0xc30b('0x14')]['findOne']({'where':{'id':0x1},'attributes':[_0xc30b('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x4d7725){_0x4d72a2=_0x4d7725;return db[_0xc30b('0x16')]['find']({'where':{'email':_[_0xc30b('0x17')](_0x32f7f0[_0xc30b('0x18')],_0xc30b('0x19')),'role':{'$or':[_0xc30b('0x1a'),'user',_0xc30b('0x1b')]}}});})[_0xc30b('0x1c')](function(_0x1cd5de){_0x15b529=_0x1cd5de;if(_0x15b529){if(_0x15b529[_0xc30b('0x1d')]){return _0x3e155a(_0xc30b('0x1e'));}else if(_0x4d72a2[_0xc30b('0x1f')]>0x0){if(_0x15b529['blocked']){if(moment(_0x15b529[_0xc30b('0x20')])[_0xc30b('0x21')](_0x4d72a2[_0xc30b('0x1f')],_0xc30b('0x22'))>moment()){return _0x3e155a(_0xc30b('0x1e'));}else{return utils[_0xc30b('0x23')](_0x15b529,0x0,![],null)[_0xc30b('0x1c')](function(){return utils['getLicense'](_0x15b529);})[_0xc30b('0x1c')](function(){return _0x3e155a(null,_0x15b529);});}}else{return utils['getLicense'](_0x15b529)[_0xc30b('0x1c')](function(){return _0x3e155a(null,_0x15b529);});}}else{return utils[_0xc30b('0x24')](_0x15b529)[_0xc30b('0x1c')](function(){return _0x3e155a(null,_0x15b529);});}}return _0x3e155a(_0xc30b('0x1e'));})['catch'](function(_0x1ed77f){_0x3e155a(_0x1ed77f);});})); \ No newline at end of file +var _0x36bb=['then','disabled','blocked','blockedAt','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','profile','email','callback','use','clientSecret','callbackURL','Setting','findOne','blockDuration','User','find','map','emails','value','admin','agent'];(function(_0x3e444a,_0x50a463){var _0x421b22=function(_0x4b980c){while(--_0x4b980c){_0x3e444a['push'](_0x3e444a['shift']());}};_0x421b22(++_0x50a463);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb36b('0x0'));var passport=require(_0xb36b('0x1'));var GoogleStrategy=require(_0xb36b('0x2'))['Strategy'];var moment=require(_0xb36b('0x3'));var db=require(_0xb36b('0x4'))['db'];var config=require(_0xb36b('0x5'));var signToken=require(_0xb36b('0x6'))[_0xb36b('0x7')];var utils=require(_0xb36b('0x8'));exports[_0xb36b('0x9')]=passport[_0xb36b('0xa')](_0xb36b('0xb'),{'failureRedirect':_0xb36b('0xc'),'scope':[_0xb36b('0xd'),_0xb36b('0xe')],'session':![]});exports[_0xb36b('0xf')]=passport[_0xb36b('0xa')](_0xb36b('0xb'),{'failureRedirect':_0xb36b('0xc'),'session':![]});passport[_0xb36b('0x10')](new GoogleStrategy({'clientID':config[_0xb36b('0xb')]?config[_0xb36b('0xb')]['clientID']:'id','clientSecret':config[_0xb36b('0xb')]?config[_0xb36b('0xb')][_0xb36b('0x11')]:'secret','callbackURL':config[_0xb36b('0xb')]?config[_0xb36b('0xb')][_0xb36b('0x12')]:''},function(_0x10a41b,_0x2d7d3b,_0x11f775,_0x1ad623){var _0x1c266a,_0x1e686b;return db[_0xb36b('0x13')][_0xb36b('0x14')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xb36b('0x15')],'raw':!![]})['then'](function(_0x5ca650){_0x1c266a=_0x5ca650;return db[_0xb36b('0x16')][_0xb36b('0x17')]({'where':{'email':_[_0xb36b('0x18')](_0x11f775[_0xb36b('0x19')],_0xb36b('0x1a')),'role':{'$or':[_0xb36b('0x1b'),'user',_0xb36b('0x1c')]}}});})[_0xb36b('0x1d')](function(_0xfe29fc){_0x1e686b=_0xfe29fc;if(_0x1e686b){if(_0x1e686b[_0xb36b('0x1e')]){return _0x1ad623('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x1c266a[_0xb36b('0x15')]>0x0){if(_0x1e686b[_0xb36b('0x1f')]){if(moment(_0x1e686b[_0xb36b('0x20')])['add'](_0x1c266a[_0xb36b('0x15')],'minutes')>moment()){return _0x1ad623(_0xb36b('0x21'));}else{return utils[_0xb36b('0x22')](_0x1e686b,0x0,![],null)[_0xb36b('0x1d')](function(){return utils[_0xb36b('0x23')](_0x1e686b);})[_0xb36b('0x1d')](function(){return _0x1ad623(null,_0x1e686b);});}}else{return utils[_0xb36b('0x23')](_0x1e686b)[_0xb36b('0x1d')](function(){return _0x1ad623(null,_0x1e686b);});}}else{return utils['getLicense'](_0x1e686b)[_0xb36b('0x1d')](function(){return _0x1ad623(null,_0x1e686b);});}}return _0x1ad623('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xb36b('0x24')](function(_0x52b74f){_0x1ad623(_0x52b74f);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index f2c6ec5..5e2b43b 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 _0x4917=['passport','Router','../../components/auth/service','get','login','callback','isMiddleware','setTokenCookie','express'];(function(_0x121d9e,_0x11b966){var _0x5df466=function(_0x519340){while(--_0x519340){_0x121d9e['push'](_0x121d9e['shift']());}};_0x5df466(++_0x11b966);}(_0x4917,0x116));var _0x7491=function(_0x42ff02,_0x402e7b){_0x42ff02=_0x42ff02-0x0;var _0x28ae4b=_0x4917[_0x42ff02];return _0x28ae4b;};'use strict';var express=require(_0x7491('0x0'));var passport=require(_0x7491('0x1'));var router=express[_0x7491('0x2')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0x7491('0x3'));router[_0x7491('0x4')]('/',controller[_0x7491('0x5')]);router[_0x7491('0x4')]('/callback',controller[_0x7491('0x6')],authService[_0x7491('0x7')],userController[_0x7491('0x5')],authService[_0x7491('0x8')]);module['exports']=router; \ No newline at end of file +var _0x3b4e=['passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','isMiddleware','setTokenCookie','exports','express'];(function(_0x364390,_0x46b408){var _0x3cf60d=function(_0x551d05){while(--_0x551d05){_0x364390['push'](_0x364390['shift']());}};_0x3cf60d(++_0x46b408);}(_0x3b4e,0x107));var _0xe3b4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3b4e[_0x321bb2];return _0x9c12ed;};'use strict';var express=require(_0xe3b4('0x0'));var passport=require(_0xe3b4('0x1'));var router=express['Router']();var controller=require(_0xe3b4('0x2'));var userController=require(_0xe3b4('0x3'));var authService=require(_0xe3b4('0x4'));router[_0xe3b4('0x5')]('/',controller[_0xe3b4('0x6')]);router[_0xe3b4('0x5')](_0xe3b4('0x7'),controller['callback'],authService[_0xe3b4('0x8')],userController[_0xe3b4('0x6')],authService[_0xe3b4('0x9')]);module[_0xe3b4('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index a1b132e..3ab7e70 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 _0x01c6=['catch','MailAccount','find','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','merge','format','\x22%s\x22\x20<%s>','error','message','stringify','status','send','test','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','forgot','body','email','Email\x20parameter\x20is\x20missing','trim','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','Reset\x20Email\x20sent!','reset','securePassword','password','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','signToken','client','http','Setting','allowedLoginAttempts','then','findOne','name','salt','disabled','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','add','clearBlockUser','blockDuration','minutes','getLicense'];(function(_0x29f476,_0x41183f){var _0xb9e004=function(_0x269863){while(--_0x269863){_0x29f476['push'](_0x29f476['shift']());}};_0xb9e004(++_0x41183f);}(_0x01c6,0x114));var _0x601c=function(_0x334599,_0x4b1cfa){_0x334599=_0x334599-0x0;var _0x4cdff2=_0x01c6[_0x334599];return _0x4cdff2;};'use strict';var util=require(_0x601c('0x0'));var passport=require(_0x601c('0x1'));var LocalStrategy=require(_0x601c('0x2'))[_0x601c('0x3')];var jayson=require(_0x601c('0x4'));var _=require(_0x601c('0x5'));var rs=require('randomstring');var moment=require(_0x601c('0x6'));var db=require(_0x601c('0x7'))['db'];var signToken=require(_0x601c('0x8'))[_0x601c('0x9')];var utils=require('../../config/utils');var client=jayson[_0x601c('0xa')][_0x601c('0xb')]({'port':0x232b});function localAuthenticate(_0x3e4fb5,_0x31b5eb,_0x5de965,_0x32226b){var _0x35204a,_0x2f8dee;return db[_0x601c('0xc')]['findOne']({'where':{'id':0x1},'attributes':[_0x601c('0xd'),'blockDuration'],'raw':!![]})[_0x601c('0xe')](function(_0x7d732a){_0x35204a=_0x7d732a;return _0x3e4fb5[_0x601c('0xf')]({'attributes':['id',_0x601c('0x10'),'password',_0x601c('0x11'),'role',_0x601c('0x12'),'blocked',_0x601c('0x13'),_0x601c('0x14')],'where':{'name':_0x31b5eb,'role':{'$or':[_0x601c('0x15'),_0x601c('0x16'),_0x601c('0x17')]}}});})['then'](function(_0x15bb7b){if(!_0x15bb7b||_0x15bb7b&&_0x15bb7b['name']!==_0x31b5eb){throw new Error(_0x601c('0x18'));}else{_0x2f8dee=_0x15bb7b;return _0x2f8dee;}})[_0x601c('0xe')](function(){_0x2f8dee[_0x601c('0x19')](_0x5de965,function(_0x3ba285,_0x2c7523){var _0x12252f=_0x2f8dee['loginAttempts']+0x1;if(_0x3ba285){return _0x32226b(_0x3ba285);}else if(!_0x2c7523){if(_0x2f8dee['disabled']){return _0x32226b(null,![],{'message':_0x601c('0x18')});}else if(_0x35204a[_0x601c('0xd')]>0x0){if(_0x2f8dee[_0x601c('0x1a')]){if(_0x35204a['blockDuration']>0x0){if(moment(_0x2f8dee[_0x601c('0x13')])[_0x601c('0x1b')](_0x35204a['blockDuration'],'minutes')>moment()){return _0x32226b(null,![],{'message':_0x601c('0x18')});}else{return utils[_0x601c('0x1c')](_0x2f8dee,_0x12252f,![],null)[_0x601c('0xe')](function(){return _0x32226b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x32226b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x12252f>=_0x35204a[_0x601c('0xd')]){return utils['clearBlockUser'](_0x2f8dee,0x0,!![],moment())[_0x601c('0xe')](function(){return _0x32226b(null,![],{'message':_0x601c('0x18')});});}else{return utils[_0x601c('0x1c')](_0x2f8dee,_0x12252f,![],null)[_0x601c('0xe')](function(){return _0x32226b(null,![],{'message':_0x601c('0x18')});});}}}else{return _0x32226b(null,![],{'message':_0x601c('0x18')});}}else{if(_0x2f8dee[_0x601c('0x12')]){return _0x32226b(null,![],{'message':_0x601c('0x18')});}else if(_0x35204a[_0x601c('0xd')]>0x0){if(_0x2f8dee['blocked']){if(_0x35204a[_0x601c('0x1d')]>0x0){if(moment(_0x2f8dee['blockedAt'])['add'](_0x35204a[_0x601c('0x1d')],_0x601c('0x1e'))>moment()){return _0x32226b(null,![],{'message':_0x601c('0x18')});}else{return utils[_0x601c('0x1c')](_0x2f8dee,0x0,![],null)['then'](function(){return utils[_0x601c('0x1f')](_0x2f8dee);})[_0x601c('0xe')](function(){return _0x32226b(null,_0x2f8dee);});}}else{return _0x32226b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x2f8dee,0x0,![],null)[_0x601c('0xe')](function(){return utils[_0x601c('0x1f')](_0x2f8dee);})[_0x601c('0xe')](function(){return _0x32226b(null,_0x2f8dee);})[_0x601c('0x20')](function(_0x5ea670){return _0x32226b(null,![],_0x5ea670);});}}else{if(_0x2f8dee[_0x601c('0x1a')]){return _0x32226b(null,![],{'message':_0x601c('0x18')});}else{return utils[_0x601c('0x1f')](_0x2f8dee)[_0x601c('0xe')](function(){return _0x32226b(null,_0x2f8dee);});}}}});})[_0x601c('0x20')](function(_0x350231){return _0x32226b(null,![],_0x350231);});}function sendServiceMail(_0x176031){return db[_0x601c('0x21')][_0x601c('0x22')]({'where':{'service':!![]},'attributes':['id',_0x601c('0x10'),'email'],'include':[{'model':db[_0x601c('0x23')],'as':_0x601c('0x24')}]})[_0x601c('0xe')](function(_0x3c1a54){if(!_0x3c1a54){throw new Error(_0x601c('0x25'));}var _0x403098={'tls':{'rejectUnauthorized':![]}};if(_0x3c1a54[_0x601c('0x24')]['service']){_0x403098[_0x601c('0x26')]=_0x3c1a54[_0x601c('0x24')][_0x601c('0x26')];}else{_0x403098[_0x601c('0x27')]=_0x3c1a54['Smtp'][_0x601c('0x27')];_0x403098['port']=_0x3c1a54[_0x601c('0x24')][_0x601c('0x28')];_0x403098[_0x601c('0x29')]=_0x3c1a54['Smtp'][_0x601c('0x29')];}if(_0x3c1a54[_0x601c('0x24')][_0x601c('0x2a')]){_0x403098[_0x601c('0x2b')]={'user':_0x3c1a54[_0x601c('0x24')]['user'],'pass':_0x3c1a54[_0x601c('0x24')]['pass']};}var _0x357884={'account':_0x403098,'message':_[_0x601c('0x2c')]({'from':util[_0x601c('0x2d')](_0x601c('0x2e'),_0x3c1a54[_0x601c('0x10')],_0x3c1a54['email']||_0x3c1a54[_0x601c('0x24')][_0x601c('0x16')])},_0x176031)};return client['request']('SendMail',_0x357884);})['then'](function(_0xd2f3ea){if(_0xd2f3ea['error']){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0xd2f3ea[_0x601c('0x2f')][_0x601c('0x30')]||JSON[_0x601c('0x31')](_0xd2f3ea['error'])));}return!![];});}function handleError(_0x1cc7f9,_0xf137ed,_0x98435){return _0x1cc7f9[_0x601c('0x32')](_0xf137ed||0x1f4)[_0x601c('0x33')]({'message':_0x98435?_0x98435[_0x601c('0x30')]||_0x98435:''});}function checkPasswordPattern(_0x44494f,_0x2a683d,_0x2d7049){if(_0x2d7049){var _0x1ae285=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ae285[_0x601c('0x34')](_0x2a683d)){return _0x44494f;}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 _0x44494f;}}exports['login']=function(_0x4cdd6a,_0x176c30,_0x18a95f){passport['authenticate'](_0x601c('0x35'),function(_0x15f00b,_0x202c3c,_0x2b5611){var _0x5431e5=_0x15f00b||_0x2b5611;if(_0x5431e5){return handleError(_0x176c30,0x191,_0x5431e5);}if(!_0x202c3c){return handleError(_0x176c30,0x194,{'message':_0x601c('0x36')});}else{var _0x32b203=signToken(_0x202c3c['id'],_0x202c3c['role']);_0x176c30[_0x601c('0x37')]({'id':_0x202c3c['id'],'token':_0x32b203,'statusCall':'','isAlreadyLogged':_0x202c3c['online']});}})(_0x4cdd6a,_0x176c30,_0x18a95f);};exports[_0x601c('0x38')]=function(_0x3a7c00,_0x3ef473,_0x3101c1){if(!_0x3a7c00[_0x601c('0x39')][_0x601c('0x3a')]){return handleError(_0x3ef473,0x1f4,{'message':_0x601c('0x3b')});}var _0x47c7e7=rs['generate']();_0x3a7c00[_0x601c('0x39')]['email']=_0x3a7c00[_0x601c('0x39')][_0x601c('0x3a')][_0x601c('0x3c')]()['toLowerCase']();var _0x1863d9;return db[_0x601c('0xc')][_0x601c('0xf')]({'where':{'id':0x1},'attributes':[_0x601c('0xd'),_0x601c('0x1d')],'raw':!![]})[_0x601c('0xe')](function(_0x3c8110){_0x1863d9=_0x3c8110;return db[_0x601c('0x3d')][_0x601c('0x22')]({'where':{'email':_0x3a7c00[_0x601c('0x39')][_0x601c('0x3a')]}});})[_0x601c('0xe')](function(_0x46160a){if(!_0x46160a){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x46160a[_0x601c('0x12')]){throw new Error(_0x601c('0x3e'));}if(_0x46160a[_0x601c('0x1a')]){if(moment(_0x46160a[_0x601c('0x13')])[_0x601c('0x1b')](_0x1863d9[_0x601c('0x1d')],_0x601c('0x1e'))>moment()){throw new Error(_0x601c('0x3f'));}else{_0x46160a['blocked']=![];_0x46160a[_0x601c('0x13')]=null;}}_0x46160a[_0x601c('0x40')]=_0x47c7e7;_0x46160a['resetPasswordExpires']=Date[_0x601c('0x41')]()+0x36ee80;return _0x46160a[_0x601c('0x42')]();})['then'](function(){return sendServiceMail({'to':_0x3a7c00[_0x601c('0x39')][_0x601c('0x3a')],'subject':_0x601c('0x43'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x601c('0x44')+_0x601c('0x45')+_0x3a7c00['headers'][_0x601c('0x27')]+'/reset/'+_0x47c7e7+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x601c('0xe')](function(){_0x3ef473[_0x601c('0x32')](0xc8)['send']({'message':_0x601c('0x46')});})[_0x601c('0x20')](function(_0x3e260b){return handleError(_0x3ef473,0x1f4,_0x3e260b);});};exports[_0x601c('0x47')]=function(_0x34d824,_0x5c6cb4,_0x2f8d6e){var _0x3c7a15;return db['User'][_0x601c('0x22')]({'where':{'resetPasswordToken':_0x34d824['params']['token'],'resetPasswordExpires':{'$gt':Date[_0x601c('0x41')]()}}})[_0x601c('0xe')](function(_0x4491ac){_0x3c7a15=_0x4491ac;if(!_0x3c7a15){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x601c('0xf')]({'attributes':['id',_0x601c('0x48')]});})[_0x601c('0xe')](function(_0x315a98){return checkPasswordPattern(_0x315a98,_0x34d824['body'][_0x601c('0x49')],_0x315a98[_0x601c('0x48')]);})[_0x601c('0xe')](function(){_0x3c7a15['password']=_0x34d824['body'][_0x601c('0x49')];_0x3c7a15['resetPasswordToken']=null;_0x3c7a15[_0x601c('0x4a')]=null;return _0x3c7a15[_0x601c('0x42')]();})[_0x601c('0xe')](function(){_0x5c6cb4[_0x601c('0x32')](0xc8)[_0x601c('0x33')]({'message':_0x601c('0x4b')});})[_0x601c('0x20')](function(_0x37c38b){return handleError(_0x5c6cb4,0x1f4,_0x37c38b);});};passport[_0x601c('0x4c')](new LocalStrategy({'usernameField':_0x601c('0x10'),'passwordField':_0x601c('0x49')},function(_0x5279dd,_0x2ff9e0,_0x2d01b9){return localAuthenticate(db[_0x601c('0x3d')],_0x5279dd,_0x2ff9e0,_0x2d01b9);})); \ No newline at end of file +var _0xceb6=['find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','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.','forgot','body','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','securePassword','use','passport','passport-local','Strategy','moment','../../mysqldb','../../components/auth/service','signToken','client','http','Setting','findOne','allowedLoginAttempts','name','password','salt','role','disabled','blockedAt','user','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','blockDuration','add','minutes','clearBlockUser','blocked','catch','MailAccount'];(function(_0x47d2b5,_0x4a749b){var _0x4562aa=function(_0x3a32dd){while(--_0x3a32dd){_0x47d2b5['push'](_0x47d2b5['shift']());}};_0x4562aa(++_0x4a749b);}(_0xceb6,0x80));var _0x6ceb=function(_0x4910d9,_0x339094){_0x4910d9=_0x4910d9-0x0;var _0x1b8b4b=_0xceb6[_0x4910d9];return _0x1b8b4b;};'use strict';var util=require('util');var passport=require(_0x6ceb('0x0'));var LocalStrategy=require(_0x6ceb('0x1'))[_0x6ceb('0x2')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require('randomstring');var moment=require(_0x6ceb('0x3'));var db=require(_0x6ceb('0x4'))['db'];var signToken=require(_0x6ceb('0x5'))[_0x6ceb('0x6')];var utils=require('../../config/utils');var client=jayson[_0x6ceb('0x7')][_0x6ceb('0x8')]({'port':0x232b});function localAuthenticate(_0x11cb60,_0x3cc245,_0x15345a,_0x5b90c7){var _0x33ddb0,_0xb52442;return db[_0x6ceb('0x9')][_0x6ceb('0xa')]({'where':{'id':0x1},'attributes':[_0x6ceb('0xb'),'blockDuration'],'raw':!![]})['then'](function(_0xefeee5){_0x33ddb0=_0xefeee5;return _0x11cb60[_0x6ceb('0xa')]({'attributes':['id',_0x6ceb('0xc'),_0x6ceb('0xd'),_0x6ceb('0xe'),_0x6ceb('0xf'),_0x6ceb('0x10'),'blocked',_0x6ceb('0x11'),'loginAttempts'],'where':{'name':_0x3cc245,'role':{'$or':['admin',_0x6ceb('0x12'),'agent']}}});})[_0x6ceb('0x13')](function(_0x5923d5){if(!_0x5923d5||_0x5923d5&&_0x5923d5[_0x6ceb('0xc')]!==_0x3cc245){throw new Error(_0x6ceb('0x14'));}else{_0xb52442=_0x5923d5;return _0xb52442;}})[_0x6ceb('0x13')](function(){_0xb52442[_0x6ceb('0x15')](_0x15345a,function(_0x198899,_0x2cfd91){var _0x44d454=_0xb52442[_0x6ceb('0x16')]+0x1;if(_0x198899){return _0x5b90c7(_0x198899);}else if(!_0x2cfd91){if(_0xb52442['disabled']){return _0x5b90c7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x33ddb0[_0x6ceb('0xb')]>0x0){if(_0xb52442['blocked']){if(_0x33ddb0[_0x6ceb('0x17')]>0x0){if(moment(_0xb52442[_0x6ceb('0x11')])[_0x6ceb('0x18')](_0x33ddb0[_0x6ceb('0x17')],_0x6ceb('0x19'))>moment()){return _0x5b90c7(null,![],{'message':_0x6ceb('0x14')});}else{return utils[_0x6ceb('0x1a')](_0xb52442,_0x44d454,![],null)[_0x6ceb('0x13')](function(){return _0x5b90c7(null,![],{'message':_0x6ceb('0x14')});});}}else{return _0x5b90c7(null,![],{'message':_0x6ceb('0x14')});}}else{if(_0x44d454>=_0x33ddb0[_0x6ceb('0xb')]){return utils[_0x6ceb('0x1a')](_0xb52442,0x0,!![],moment())[_0x6ceb('0x13')](function(){return _0x5b90c7(null,![],{'message':_0x6ceb('0x14')});});}else{return utils[_0x6ceb('0x1a')](_0xb52442,_0x44d454,![],null)[_0x6ceb('0x13')](function(){return _0x5b90c7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x5b90c7(null,![],{'message':_0x6ceb('0x14')});}}else{if(_0xb52442['disabled']){return _0x5b90c7(null,![],{'message':_0x6ceb('0x14')});}else if(_0x33ddb0[_0x6ceb('0xb')]>0x0){if(_0xb52442[_0x6ceb('0x1b')]){if(_0x33ddb0['blockDuration']>0x0){if(moment(_0xb52442[_0x6ceb('0x11')])[_0x6ceb('0x18')](_0x33ddb0[_0x6ceb('0x17')],_0x6ceb('0x19'))>moment()){return _0x5b90c7(null,![],{'message':_0x6ceb('0x14')});}else{return utils['clearBlockUser'](_0xb52442,0x0,![],null)[_0x6ceb('0x13')](function(){return utils['getLicense'](_0xb52442);})['then'](function(){return _0x5b90c7(null,_0xb52442);});}}else{return _0x5b90c7(null,![],{'message':_0x6ceb('0x14')});}}else{return utils[_0x6ceb('0x1a')](_0xb52442,0x0,![],null)[_0x6ceb('0x13')](function(){return utils['getLicense'](_0xb52442);})['then'](function(){return _0x5b90c7(null,_0xb52442);})[_0x6ceb('0x1c')](function(_0x789fac){return _0x5b90c7(null,![],_0x789fac);});}}else{if(_0xb52442['blocked']){return _0x5b90c7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0xb52442)[_0x6ceb('0x13')](function(){return _0x5b90c7(null,_0xb52442);});}}}});})['catch'](function(_0x3b44f6){return _0x5b90c7(null,![],_0x3b44f6);});}function sendServiceMail(_0x4221b0){return db[_0x6ceb('0x1d')][_0x6ceb('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x6ceb('0xc'),_0x6ceb('0x1f')],'include':[{'model':db[_0x6ceb('0x20')],'as':_0x6ceb('0x21')}]})[_0x6ceb('0x13')](function(_0x4fed52){if(!_0x4fed52){throw new Error(_0x6ceb('0x22'));}var _0x17bc33={'tls':{'rejectUnauthorized':![]}};if(_0x4fed52[_0x6ceb('0x21')]['service']){_0x17bc33[_0x6ceb('0x23')]=_0x4fed52[_0x6ceb('0x21')]['service'];}else{_0x17bc33[_0x6ceb('0x24')]=_0x4fed52[_0x6ceb('0x21')]['host'];_0x17bc33[_0x6ceb('0x25')]=_0x4fed52[_0x6ceb('0x21')][_0x6ceb('0x25')];_0x17bc33[_0x6ceb('0x26')]=_0x4fed52['Smtp'][_0x6ceb('0x26')];}if(_0x4fed52[_0x6ceb('0x21')][_0x6ceb('0x27')]){_0x17bc33[_0x6ceb('0x28')]={'user':_0x4fed52[_0x6ceb('0x21')][_0x6ceb('0x12')],'pass':_0x4fed52['Smtp']['pass']};}var _0x46bc6b={'account':_0x17bc33,'message':_[_0x6ceb('0x29')]({'from':util[_0x6ceb('0x2a')](_0x6ceb('0x2b'),_0x4fed52[_0x6ceb('0xc')],_0x4fed52[_0x6ceb('0x1f')]||_0x4fed52[_0x6ceb('0x21')][_0x6ceb('0x12')])},_0x4221b0)};return client['request'](_0x6ceb('0x2c'),_0x46bc6b);})[_0x6ceb('0x13')](function(_0x1eb727){if(_0x1eb727[_0x6ceb('0x2d')]){throw new Error(util[_0x6ceb('0x2a')](_0x6ceb('0x2e'),_0x1eb727[_0x6ceb('0x2d')]['message']||JSON[_0x6ceb('0x2f')](_0x1eb727[_0x6ceb('0x2d')])));}return!![];});}function handleError(_0x25f87d,_0x51a9eb,_0x27cd94){return _0x25f87d[_0x6ceb('0x30')](_0x51a9eb||0x1f4)[_0x6ceb('0x31')]({'message':_0x27cd94?_0x27cd94[_0x6ceb('0x32')]||_0x27cd94:''});}function checkPasswordPattern(_0x5bcc02,_0x5d0dd1,_0x25c4f5){if(_0x25c4f5){var _0x561425=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x561425['test'](_0x5d0dd1)){return _0x5bcc02;}else{throw new Error(_0x6ceb('0x33'));}}else{return _0x5bcc02;}}exports[_0x6ceb('0x34')]=function(_0x508e79,_0x559830,_0x4a0e5a){passport[_0x6ceb('0x15')](_0x6ceb('0x35'),function(_0x40bafa,_0x55c5cd,_0x545001){var _0x1faf0b=_0x40bafa||_0x545001;if(_0x1faf0b){return handleError(_0x559830,0x191,_0x1faf0b);}if(!_0x55c5cd){return handleError(_0x559830,0x194,{'message':_0x6ceb('0x36')});}else{var _0x7e961d=signToken(_0x55c5cd['id'],_0x55c5cd[_0x6ceb('0xf')]);_0x559830['json']({'id':_0x55c5cd['id'],'token':_0x7e961d,'statusCall':'','isAlreadyLogged':_0x55c5cd['online']});}})(_0x508e79,_0x559830,_0x4a0e5a);};exports[_0x6ceb('0x37')]=function(_0x2190a7,_0x17bd2f,_0xd03a52){if(!_0x2190a7[_0x6ceb('0x38')][_0x6ceb('0x1f')]){return handleError(_0x17bd2f,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x4492fd=rs[_0x6ceb('0x39')]();_0x2190a7[_0x6ceb('0x38')][_0x6ceb('0x1f')]=_0x2190a7[_0x6ceb('0x38')]['email'][_0x6ceb('0x3a')]()[_0x6ceb('0x3b')]();var _0x2ce661;return db[_0x6ceb('0x9')][_0x6ceb('0xa')]({'where':{'id':0x1},'attributes':[_0x6ceb('0xb'),_0x6ceb('0x17')],'raw':!![]})[_0x6ceb('0x13')](function(_0x281bd0){_0x2ce661=_0x281bd0;return db[_0x6ceb('0x3c')][_0x6ceb('0x1e')]({'where':{'email':_0x2190a7['body'][_0x6ceb('0x1f')]}});})[_0x6ceb('0x13')](function(_0x53e7fe){if(!_0x53e7fe){throw new Error(_0x6ceb('0x3d'));}if(_0x53e7fe[_0x6ceb('0x10')]){throw new Error(_0x6ceb('0x3e'));}if(_0x53e7fe[_0x6ceb('0x1b')]){if(moment(_0x53e7fe[_0x6ceb('0x11')])['add'](_0x2ce661[_0x6ceb('0x17')],'minutes')>moment()){throw new Error(_0x6ceb('0x3f'));}else{_0x53e7fe[_0x6ceb('0x1b')]=![];_0x53e7fe['blockedAt']=null;}}_0x53e7fe[_0x6ceb('0x40')]=_0x4492fd;_0x53e7fe[_0x6ceb('0x41')]=Date[_0x6ceb('0x42')]()+0x36ee80;return _0x53e7fe[_0x6ceb('0x43')]();})[_0x6ceb('0x13')](function(){return sendServiceMail({'to':_0x2190a7[_0x6ceb('0x38')][_0x6ceb('0x1f')],'subject':_0x6ceb('0x44'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x6ceb('0x45')+_0x6ceb('0x46')+_0x2190a7[_0x6ceb('0x47')][_0x6ceb('0x24')]+_0x6ceb('0x48')+_0x4492fd+'\x0a\x0a'+_0x6ceb('0x49')});})[_0x6ceb('0x13')](function(){_0x17bd2f[_0x6ceb('0x30')](0xc8)[_0x6ceb('0x31')]({'message':_0x6ceb('0x4a')});})[_0x6ceb('0x1c')](function(_0x4df93d){return handleError(_0x17bd2f,0x1f4,_0x4df93d);});};exports[_0x6ceb('0x4b')]=function(_0x43361c,_0x41c0d8,_0x10819a){var _0x5c6137;return db[_0x6ceb('0x3c')][_0x6ceb('0x1e')]({'where':{'resetPasswordToken':_0x43361c['params'][_0x6ceb('0x4c')],'resetPasswordExpires':{'$gt':Date[_0x6ceb('0x42')]()}}})['then'](function(_0x360ae2){_0x5c6137=_0x360ae2;if(!_0x5c6137){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x6ceb('0x9')]['findOne']({'attributes':['id','securePassword']});})[_0x6ceb('0x13')](function(_0x3abd43){return checkPasswordPattern(_0x3abd43,_0x43361c[_0x6ceb('0x38')][_0x6ceb('0xd')],_0x3abd43[_0x6ceb('0x4d')]);})['then'](function(){_0x5c6137[_0x6ceb('0xd')]=_0x43361c[_0x6ceb('0x38')][_0x6ceb('0xd')];_0x5c6137[_0x6ceb('0x40')]=null;_0x5c6137['resetPasswordExpires']=null;return _0x5c6137[_0x6ceb('0x43')]();})['then'](function(){_0x41c0d8[_0x6ceb('0x30')](0xc8)['send']({'message':'Password\x20reset!'});})[_0x6ceb('0x1c')](function(_0x268c29){return handleError(_0x41c0d8,0x1f4,_0x268c29);});};passport[_0x6ceb('0x4e')](new LocalStrategy({'usernameField':_0x6ceb('0xc'),'passwordField':_0x6ceb('0xd')},function(_0x326711,_0x112efe,_0x344345){return localAuthenticate(db[_0x6ceb('0x3c')],_0x326711,_0x112efe,_0x344345);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 1e0ba04..c58d4a5 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 _0xd708=['login','post','/forgot','forgot','/reset/:token','reset','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd708,0xf5));var _0x8d70=function(_0x3c7cf8,_0xc3fcb0){_0x3c7cf8=_0x3c7cf8-0x0;var _0x5818db=_0xd708[_0x3c7cf8];return _0x5818db;};'use strict';var express=require('express');var router=express['Router']();var controller=require('./authLocal.controller');router['post']('/',controller[_0x8d70('0x0')]);router[_0x8d70('0x1')](_0x8d70('0x2'),controller[_0x8d70('0x3')]);router['post'](_0x8d70('0x4'),controller[_0x8d70('0x5')]);module[_0x8d70('0x6')]=router; \ No newline at end of file +var _0x8a4c=['exports','express','Router','./authLocal.controller','post','login','/forgot','/reset/:token','reset'];(function(_0x5fdf05,_0x25284d){var _0xdfce7a=function(_0x44e546){while(--_0x44e546){_0x5fdf05['push'](_0x5fdf05['shift']());}};_0xdfce7a(++_0x25284d);}(_0x8a4c,0x172));var _0xc8a4=function(_0x46bec2,_0x36cde0){_0x46bec2=_0x46bec2-0x0;var _0x39b857=_0x8a4c[_0x46bec2];return _0x39b857;};'use strict';var express=require(_0xc8a4('0x0'));var router=express[_0xc8a4('0x1')]();var controller=require(_0xc8a4('0x2'));router[_0xc8a4('0x3')]('/',controller[_0xc8a4('0x4')]);router[_0xc8a4('0x3')](_0xc8a4('0x5'),controller['forgot']);router[_0xc8a4('0x3')](_0xc8a4('0x6'),controller[_0xc8a4('0x7')]);module[_0xc8a4('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 64a9bce..675fa48 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 _0x0664=['exports','STRING','INTEGER'];(function(_0x363d5c,_0x305fc4){var _0x501b2a=function(_0xefc05e){while(--_0xefc05e){_0x363d5c['push'](_0x363d5c['shift']());}};_0x501b2a(++_0x305fc4);}(_0x0664,0x93));var _0x4066=function(_0x2075b6,_0x827b83){_0x2075b6=_0x2075b6-0x0;var _0x29ab04=_0x0664[_0x2075b6];return _0x29ab04;};'use strict';var Sequelize=require('sequelize');module[_0x4066('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x4066('0x1')]},'description':{'type':Sequelize[_0x4066('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x4066('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0xf274=['INTEGER','exports','STRING','BOOLEAN'];(function(_0x22ac14,_0x384d49){var _0x14326e=function(_0x1d796f){while(--_0x1d796f){_0x22ac14['push'](_0x22ac14['shift']());}};_0x14326e(++_0x384d49);}(_0xf274,0x99));var _0x4f27=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xf274[_0x19b3f9];return _0x18c3f6;};'use strict';var Sequelize=require('sequelize');module[_0x4f27('0x0')]={'name':{'type':Sequelize[_0x4f27('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x4f27('0x1')]},'description':{'type':Sequelize[_0x4f27('0x1')]},'status':{'type':Sequelize[_0x4f27('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x4f27('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 6eea5b1..e7de498 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 _0x88f5=['model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','map','type','VIRTUAL','field','merge','options','Automation','includeAll','findAll','rows','catch','show','params','fields','include','find','create','body','addConditions','Condition','ids','omit','getConditions','Action','addActions','getActions','findOne','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','reject','update','then','destroy','error','stack','send','index','rawAttributes'];(function(_0x211fef,_0x4ab716){var _0x5447bf=function(_0x306ea3){while(--_0x306ea3){_0x211fef['push'](_0x211fef['shift']());}};_0x5447bf(++_0x4ab716);}(_0x88f5,0x79));var _0x588f=function(_0x3fa8e5,_0xc71805){_0x3fa8e5=_0x3fa8e5-0x0;var _0x2c1ce8=_0x88f5[_0x3fa8e5];return _0x2c1ce8;};'use strict';var pdf=require(_0x588f('0x0'));var emlformat=require(_0x588f('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x588f('0x2'));var rp=require(_0x588f('0x3'));var moment=require(_0x588f('0x4'));var BPromise=require(_0x588f('0x5'));var Mustache=require('mustache');var util=require(_0x588f('0x6'));var path=require(_0x588f('0x7'));var sox=require(_0x588f('0x8'));var csv=require(_0x588f('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x588f('0xa'));var squel=require(_0x588f('0xb'));var crypto=require(_0x588f('0xc'));var jsforce=require(_0x588f('0xd'));var deskjs=require(_0x588f('0xe'));var toCsv=require(_0x588f('0x9'));var querystring=require('querystring');var Papa=require(_0x588f('0xf'));var Redis=require(_0x588f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x588f('0x11'));var logger=require(_0x588f('0x12'))(_0x588f('0x13'));var utils=require('../../config/utils');var config=require(_0x588f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28e4ba,_0x30fff3){_0x30fff3=_0x30fff3||0xcc;return function(_0x134c59){if(_0x134c59){return _0x28e4ba[_0x588f('0x15')](_0x30fff3);}return _0x28e4ba[_0x588f('0x16')](_0x30fff3)['end']();};}function respondWithResult(_0x9a757d,_0x15a8d7){_0x15a8d7=_0x15a8d7||0xc8;return function(_0x512ddc){if(_0x512ddc){return _0x9a757d[_0x588f('0x16')](_0x15a8d7)[_0x588f('0x17')](_0x512ddc);}};}function respondWithFilteredResult(_0x332bf7,_0x4a8a85){return function(_0x16138f){if(_0x16138f){var _0x452869=_0x16138f[_0x588f('0x18')],_0x4ae67c=_0x4a8a85[_0x588f('0x19')],_0x25331b=_0x4a8a85[_0x588f('0x19')]+_0x4a8a85['limit'],_0x2b49a0;if(_0x25331b>=_0x452869){_0x25331b=_0x452869;_0x2b49a0=0xc8;}else{_0x2b49a0=0xce;}_0x332bf7[_0x588f('0x16')](_0x2b49a0);return _0x332bf7[_0x588f('0x1a')](_0x588f('0x1b'),_0x4ae67c+'-'+_0x25331b+'/'+_0x452869)[_0x588f('0x17')](_0x16138f);}return null;};}function patchUpdates(_0x5589ce){return function(_0x4201c5){try{jsonpatch['apply'](_0x4201c5,_0x5589ce,!![]);}catch(_0x213112){return BPromise[_0x588f('0x1c')](_0x213112);}return _0x4201c5['save']();};}function saveUpdates(_0x55d49d,_0x9ff7a2){return function(_0x433ab3){if(_0x433ab3){return _0x433ab3[_0x588f('0x1d')](_0x55d49d)[_0x588f('0x1e')](function(_0x404e8c){return _0x404e8c;});}return null;};}function removeEntity(_0x3274f3,_0x52c9fc){return function(_0x22d590){if(_0x22d590){return _0x22d590[_0x588f('0x1f')]()['then'](function(){_0x3274f3[_0x588f('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x212a0e,_0x12afbb){return function(_0x191d80){if(!_0x191d80){_0x212a0e[_0x588f('0x15')](0x194);}return _0x191d80;};}function handleError(_0x534aa8,_0x153213){_0x153213=_0x153213||0x1f4;return function(_0x16c6a9){logger[_0x588f('0x20')](_0x16c6a9[_0x588f('0x21')]);if(_0x16c6a9['name']){delete _0x16c6a9['name'];}_0x534aa8[_0x588f('0x16')](_0x153213)[_0x588f('0x22')](_0x16c6a9);};}exports[_0x588f('0x23')]=function(_0x516027,_0x3b3755){var _0x5595be={},_0x1dea82={},_0x34d47c={'count':0x0,'rows':[]};var _0x210fa6=db['Automation'][_0x588f('0x24')];_0x1dea82[_0x588f('0x25')]=_[_0x588f('0x26')](_0x210fa6);_0x1dea82[_0x588f('0x27')]=_[_0x588f('0x26')](_0x516027[_0x588f('0x27')]);_0x1dea82[_0x588f('0x28')]=_[_0x588f('0x29')](_0x1dea82[_0x588f('0x25')],_0x1dea82[_0x588f('0x27')]);_0x5595be[_0x588f('0x2a')]=_[_0x588f('0x29')](_0x1dea82['model'],qs['fields'](_0x516027[_0x588f('0x27')]['fields']));_0x5595be[_0x588f('0x2a')]=_0x5595be[_0x588f('0x2a')][_0x588f('0x2b')]?_0x5595be[_0x588f('0x2a')]:_0x1dea82[_0x588f('0x25')];if(!_0x516027[_0x588f('0x27')][_0x588f('0x2c')](_0x588f('0x2d'))){_0x5595be[_0x588f('0x2e')]=qs[_0x588f('0x2e')](_0x516027[_0x588f('0x27')][_0x588f('0x2e')]);_0x5595be['offset']=qs[_0x588f('0x19')](_0x516027[_0x588f('0x27')][_0x588f('0x19')]);}_0x5595be[_0x588f('0x2f')]=qs[_0x588f('0x30')](_0x516027[_0x588f('0x27')][_0x588f('0x30')]);_0x5595be['where']=qs[_0x588f('0x28')](_[_0x588f('0x31')](_0x516027[_0x588f('0x27')],_0x1dea82['filters']));if(_0x516027[_0x588f('0x27')][_0x588f('0x32')]){_0x5595be['where']=_['merge'](_0x5595be[_0x588f('0x33')],{'$or':_[_0x588f('0x34')](_0x210fa6,function(_0x171cc5){if(_0x171cc5[_0x588f('0x35')]['key']!==_0x588f('0x36')){var _0x287bda={};_0x287bda[_0x171cc5[_0x588f('0x37')]]={'$like':'%'+_0x516027[_0x588f('0x27')][_0x588f('0x32')]+'%'};return _0x287bda;}})});}_0x5595be=_[_0x588f('0x38')]({},_0x5595be,_0x516027[_0x588f('0x39')]);var _0x4e70f8={'where':_0x5595be[_0x588f('0x33')]};return db[_0x588f('0x3a')]['count'](_0x4e70f8)[_0x588f('0x1e')](function(_0x4718b3){_0x34d47c['count']=_0x4718b3;if(_0x516027[_0x588f('0x27')][_0x588f('0x3b')]){_0x5595be['include']=[{'all':!![]}];}return db['Automation'][_0x588f('0x3c')](_0x5595be);})[_0x588f('0x1e')](function(_0x5a8cd7){_0x34d47c[_0x588f('0x3d')]=_0x5a8cd7;return _0x34d47c;})[_0x588f('0x1e')](respondWithFilteredResult(_0x3b3755,_0x5595be))[_0x588f('0x3e')](handleError(_0x3b3755,null));};exports[_0x588f('0x3f')]=function(_0x1a3abf,_0x5437cf){var _0x2eb548={'raw':![],'where':{'id':_0x1a3abf[_0x588f('0x40')]['id']}},_0x2aa042={};_0x2aa042[_0x588f('0x25')]=_[_0x588f('0x26')](db[_0x588f('0x3a')][_0x588f('0x24')]);_0x2aa042[_0x588f('0x27')]=_[_0x588f('0x26')](_0x1a3abf[_0x588f('0x27')]);_0x2aa042[_0x588f('0x28')]=_[_0x588f('0x29')](_0x2aa042[_0x588f('0x25')],_0x2aa042[_0x588f('0x27')]);_0x2eb548[_0x588f('0x2a')]=_[_0x588f('0x29')](_0x2aa042[_0x588f('0x25')],qs[_0x588f('0x41')](_0x1a3abf[_0x588f('0x27')][_0x588f('0x41')]));_0x2eb548[_0x588f('0x2a')]=_0x2eb548[_0x588f('0x2a')][_0x588f('0x2b')]?_0x2eb548['attributes']:_0x2aa042[_0x588f('0x25')];if(_0x1a3abf[_0x588f('0x27')][_0x588f('0x3b')]){_0x2eb548[_0x588f('0x42')]=[{'all':!![]}];}_0x2eb548=_[_0x588f('0x38')]({},_0x2eb548,_0x1a3abf[_0x588f('0x39')]);return db[_0x588f('0x3a')][_0x588f('0x43')](_0x2eb548)[_0x588f('0x1e')](handleEntityNotFound(_0x5437cf,null))[_0x588f('0x1e')](respondWithResult(_0x5437cf,null))[_0x588f('0x3e')](handleError(_0x5437cf,null));};exports[_0x588f('0x44')]=function(_0xe672ee,_0x1f2270){return db[_0x588f('0x3a')][_0x588f('0x44')](_0xe672ee[_0x588f('0x45')],{})[_0x588f('0x1e')](respondWithResult(_0x1f2270,0xc9))['catch'](handleError(_0x1f2270,null));};exports[_0x588f('0x1d')]=function(_0x38c80e,_0x395e78){if(_0x38c80e['body']['id']){delete _0x38c80e[_0x588f('0x45')]['id'];}return db[_0x588f('0x3a')][_0x588f('0x43')]({'where':{'id':_0x38c80e['params']['id']}})['then'](handleEntityNotFound(_0x395e78,null))[_0x588f('0x1e')](saveUpdates(_0x38c80e[_0x588f('0x45')],null))[_0x588f('0x1e')](respondWithResult(_0x395e78,null))['catch'](handleError(_0x395e78,null));};exports[_0x588f('0x1f')]=function(_0x5637ca,_0x37df48){return db[_0x588f('0x3a')]['find']({'where':{'id':_0x5637ca[_0x588f('0x40')]['id']}})[_0x588f('0x1e')](handleEntityNotFound(_0x37df48,null))[_0x588f('0x1e')](removeEntity(_0x37df48,null))[_0x588f('0x3e')](handleError(_0x37df48,null));};exports[_0x588f('0x46')]=function(_0x5c8fb0,_0x3777dd,_0x485dd8){return db[_0x588f('0x47')][_0x588f('0x43')]({'where':{'id':_0x5c8fb0[_0x588f('0x40')]['id']}})[_0x588f('0x1e')](handleEntityNotFound(_0x3777dd,null))['then'](function(_0x182621){if(_0x182621){return _0x182621[_0x588f('0x46')](_0x5c8fb0[_0x588f('0x45')][_0x588f('0x48')],_[_0x588f('0x49')](_0x5c8fb0[_0x588f('0x45')],[_0x588f('0x48'),'id'])||{});}})['then'](respondWithResult(_0x3777dd,null))[_0x588f('0x3e')](handleError(_0x3777dd,null));};exports[_0x588f('0x4a')]=function(_0x4dfbc5,_0x52f5fe,_0x196f75){var _0x1f84c0={};var _0x21ae37={};var _0x4695cc;var _0x30a637;return db[_0x588f('0x3a')]['findOne']({'where':{'id':_0x4dfbc5[_0x588f('0x40')]['id']}})[_0x588f('0x1e')](handleEntityNotFound(_0x52f5fe,null))[_0x588f('0x1e')](function(_0x5000ec){if(_0x5000ec){_0x4695cc=_0x5000ec;_0x21ae37[_0x588f('0x25')]=_['keys'](db[_0x588f('0x47')]['rawAttributes']);_0x21ae37[_0x588f('0x27')]=_['keys'](_0x4dfbc5[_0x588f('0x27')]);_0x21ae37['filters']=_[_0x588f('0x29')](_0x21ae37[_0x588f('0x25')],_0x21ae37[_0x588f('0x27')]);_0x1f84c0[_0x588f('0x2a')]=_[_0x588f('0x29')](_0x21ae37['model'],qs[_0x588f('0x41')](_0x4dfbc5[_0x588f('0x27')][_0x588f('0x41')]));_0x1f84c0[_0x588f('0x2a')]=_0x1f84c0[_0x588f('0x2a')][_0x588f('0x2b')]?_0x1f84c0[_0x588f('0x2a')]:_0x21ae37[_0x588f('0x25')];_0x1f84c0['order']=qs[_0x588f('0x30')](_0x4dfbc5[_0x588f('0x27')][_0x588f('0x30')]);_0x1f84c0[_0x588f('0x33')]=qs[_0x588f('0x28')](_[_0x588f('0x31')](_0x4dfbc5[_0x588f('0x27')],_0x21ae37[_0x588f('0x28')]));if(_0x4dfbc5['query'][_0x588f('0x32')]){_0x1f84c0['where']=_['merge'](_0x1f84c0[_0x588f('0x33')],{'$or':_[_0x588f('0x34')](_0x1f84c0['attributes'],function(_0x5616c6){var _0x1a209a={};_0x1a209a[_0x5616c6]={'$like':'%'+_0x4dfbc5['query']['filter']+'%'};return _0x1a209a;})});}_0x1f84c0=_[_0x588f('0x38')]({},_0x1f84c0,_0x4dfbc5[_0x588f('0x39')]);return _0x4695cc[_0x588f('0x4a')](_0x1f84c0);}})[_0x588f('0x1e')](function(_0x17c4cd){if(_0x17c4cd){_0x30a637=_0x17c4cd['length'];if(!_0x4dfbc5[_0x588f('0x27')][_0x588f('0x2c')](_0x588f('0x2d'))){_0x1f84c0[_0x588f('0x2e')]=qs['limit'](_0x4dfbc5[_0x588f('0x27')]['limit']);_0x1f84c0[_0x588f('0x19')]=qs['offset'](_0x4dfbc5['query'][_0x588f('0x19')]);}return _0x4695cc[_0x588f('0x4a')](_0x1f84c0);}})[_0x588f('0x1e')](function(_0x2241d8){if(_0x2241d8){return _0x2241d8?{'count':_0x30a637,'rows':_0x2241d8}:null;}})['then'](respondWithResult(_0x52f5fe,null))[_0x588f('0x3e')](handleError(_0x52f5fe,null));};exports['addActions']=function(_0x28e02b,_0x30783a,_0x55c7c1){return db[_0x588f('0x4b')][_0x588f('0x43')]({'where':{'id':_0x28e02b[_0x588f('0x40')]['id']}})['then'](handleEntityNotFound(_0x30783a,null))[_0x588f('0x1e')](function(_0x108acb){if(_0x108acb){return _0x108acb[_0x588f('0x4c')](_0x28e02b[_0x588f('0x45')][_0x588f('0x48')],_[_0x588f('0x49')](_0x28e02b[_0x588f('0x45')],[_0x588f('0x48'),'id'])||{});}})[_0x588f('0x1e')](respondWithResult(_0x30783a,null))[_0x588f('0x3e')](handleError(_0x30783a,null));};exports[_0x588f('0x4d')]=function(_0x4d9807,_0x7cd0d,_0x1d1aa0){var _0x3fb0bf={};var _0x6bd522={};var _0x1d8421;var _0x2668a6;return db[_0x588f('0x3a')][_0x588f('0x4e')]({'where':{'id':_0x4d9807['params']['id']}})[_0x588f('0x1e')](handleEntityNotFound(_0x7cd0d,null))[_0x588f('0x1e')](function(_0xdd3285){if(_0xdd3285){_0x1d8421=_0xdd3285;_0x6bd522[_0x588f('0x25')]=_['keys'](db['Action'][_0x588f('0x24')]);_0x6bd522[_0x588f('0x27')]=_['keys'](_0x4d9807[_0x588f('0x27')]);_0x6bd522[_0x588f('0x28')]=_[_0x588f('0x29')](_0x6bd522['model'],_0x6bd522[_0x588f('0x27')]);_0x3fb0bf[_0x588f('0x2a')]=_[_0x588f('0x29')](_0x6bd522[_0x588f('0x25')],qs[_0x588f('0x41')](_0x4d9807['query'][_0x588f('0x41')]));_0x3fb0bf[_0x588f('0x2a')]=_0x3fb0bf[_0x588f('0x2a')][_0x588f('0x2b')]?_0x3fb0bf[_0x588f('0x2a')]:_0x6bd522['model'];_0x3fb0bf[_0x588f('0x2f')]=qs[_0x588f('0x30')](_0x4d9807[_0x588f('0x27')]['sort']);_0x3fb0bf[_0x588f('0x33')]=qs[_0x588f('0x28')](_[_0x588f('0x31')](_0x4d9807[_0x588f('0x27')],_0x6bd522[_0x588f('0x28')]));if(_0x4d9807[_0x588f('0x27')][_0x588f('0x32')]){_0x3fb0bf['where']=_[_0x588f('0x38')](_0x3fb0bf['where'],{'$or':_[_0x588f('0x34')](_0x3fb0bf['attributes'],function(_0x256eba){var _0x476dd1={};_0x476dd1[_0x256eba]={'$like':'%'+_0x4d9807[_0x588f('0x27')][_0x588f('0x32')]+'%'};return _0x476dd1;})});}_0x3fb0bf=_[_0x588f('0x38')]({},_0x3fb0bf,_0x4d9807[_0x588f('0x39')]);return _0x1d8421['getActions'](_0x3fb0bf);}})['then'](function(_0x3125bd){if(_0x3125bd){_0x2668a6=_0x3125bd[_0x588f('0x2b')];if(!_0x4d9807[_0x588f('0x27')][_0x588f('0x2c')](_0x588f('0x2d'))){_0x3fb0bf[_0x588f('0x2e')]=qs[_0x588f('0x2e')](_0x4d9807[_0x588f('0x27')]['limit']);_0x3fb0bf[_0x588f('0x19')]=qs[_0x588f('0x19')](_0x4d9807[_0x588f('0x27')][_0x588f('0x19')]);}return _0x1d8421[_0x588f('0x4d')](_0x3fb0bf);}})[_0x588f('0x1e')](function(_0x8d7152){if(_0x8d7152){return _0x8d7152?{'count':_0x2668a6,'rows':_0x8d7152}:null;}})[_0x588f('0x1e')](respondWithResult(_0x7cd0d,null))[_0x588f('0x3e')](handleError(_0x7cd0d,null));}; \ No newline at end of file +var _0x02ba=['send','index','Automation','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','sort','pick','filter','key','VIRTUAL','field','merge','options','includeAll','include','rows','show','length','find','create','body','catch','params','Condition','addConditions','ids','omit','getConditions','findOne','order','where','map','nolimit','Action','addActions','getActions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name'];(function(_0x3d40c8,_0x3416db){var _0x1d1872=function(_0x3e6194){while(--_0x3e6194){_0x3d40c8['push'](_0x3d40c8['shift']());}};_0x1d1872(++_0x3416db);}(_0x02ba,0xd5));var _0xa02b=function(_0x5e3a0e,_0xe22491){_0x5e3a0e=_0x5e3a0e-0x0;var _0x4d0a6d=_0x02ba[_0x5e3a0e];return _0x4d0a6d;};'use strict';var pdf=require(_0xa02b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa02b('0x1'));var zipdir=require(_0xa02b('0x2'));var jsonpatch=require(_0xa02b('0x3'));var rp=require(_0xa02b('0x4'));var moment=require(_0xa02b('0x5'));var BPromise=require(_0xa02b('0x6'));var Mustache=require(_0xa02b('0x7'));var util=require(_0xa02b('0x8'));var path=require(_0xa02b('0x9'));var sox=require(_0xa02b('0xa'));var csv=require(_0xa02b('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa02b('0xc'));var squel=require(_0xa02b('0xd'));var crypto=require(_0xa02b('0xe'));var jsforce=require(_0xa02b('0xf'));var deskjs=require(_0xa02b('0x10'));var toCsv=require(_0xa02b('0xb'));var querystring=require(_0xa02b('0x11'));var Papa=require(_0xa02b('0x12'));var Redis=require(_0xa02b('0x13'));var authService=require(_0xa02b('0x14'));var qs=require(_0xa02b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa02b('0x16'))(_0xa02b('0x17'));var utils=require(_0xa02b('0x18'));var config=require('../../config/environment');var db=require(_0xa02b('0x19'))['db'];function respondWithStatusCode(_0x3887b9,_0x5709ea){_0x5709ea=_0x5709ea||0xcc;return function(_0x51f1f9){if(_0x51f1f9){return _0x3887b9[_0xa02b('0x1a')](_0x5709ea);}return _0x3887b9[_0xa02b('0x1b')](_0x5709ea)[_0xa02b('0x1c')]();};}function respondWithResult(_0x3fe087,_0x4a4bba){_0x4a4bba=_0x4a4bba||0xc8;return function(_0x1bab53){if(_0x1bab53){return _0x3fe087[_0xa02b('0x1b')](_0x4a4bba)[_0xa02b('0x1d')](_0x1bab53);}};}function respondWithFilteredResult(_0x4b0de9,_0x40a796){return function(_0x1e5745){if(_0x1e5745){var _0x8d9bea=_0x1e5745[_0xa02b('0x1e')],_0x5d488c=_0x40a796[_0xa02b('0x1f')],_0x2319ce=_0x40a796[_0xa02b('0x1f')]+_0x40a796[_0xa02b('0x20')],_0x4e9d19;if(_0x2319ce>=_0x8d9bea){_0x2319ce=_0x8d9bea;_0x4e9d19=0xc8;}else{_0x4e9d19=0xce;}_0x4b0de9[_0xa02b('0x1b')](_0x4e9d19);return _0x4b0de9[_0xa02b('0x21')](_0xa02b('0x22'),_0x5d488c+'-'+_0x2319ce+'/'+_0x8d9bea)[_0xa02b('0x1d')](_0x1e5745);}return null;};}function patchUpdates(_0x376883){return function(_0x2051b6){try{jsonpatch[_0xa02b('0x23')](_0x2051b6,_0x376883,!![]);}catch(_0x2745d8){return BPromise[_0xa02b('0x24')](_0x2745d8);}return _0x2051b6['save']();};}function saveUpdates(_0x438aa6,_0x5d91fa){return function(_0x36fedb){if(_0x36fedb){return _0x36fedb[_0xa02b('0x25')](_0x438aa6)[_0xa02b('0x26')](function(_0x1ba228){return _0x1ba228;});}return null;};}function removeEntity(_0x132668,_0x3d19e3){return function(_0xd70019){if(_0xd70019){return _0xd70019[_0xa02b('0x27')]()[_0xa02b('0x26')](function(){_0x132668[_0xa02b('0x1b')](0xcc)[_0xa02b('0x1c')]();});}};}function handleEntityNotFound(_0x2d8e89,_0x39d97c){return function(_0x208ff1){if(!_0x208ff1){_0x2d8e89[_0xa02b('0x1a')](0x194);}return _0x208ff1;};}function handleError(_0x347372,_0x173e55){_0x173e55=_0x173e55||0x1f4;return function(_0x292942){logger['error'](_0x292942[_0xa02b('0x28')]);if(_0x292942[_0xa02b('0x29')]){delete _0x292942['name'];}_0x347372[_0xa02b('0x1b')](_0x173e55)[_0xa02b('0x2a')](_0x292942);};}exports[_0xa02b('0x2b')]=function(_0x11783d,_0x50506d){var _0x57962d={},_0x1a9e2c={},_0x255a8e={'count':0x0,'rows':[]};var _0x41e2e8=db[_0xa02b('0x2c')][_0xa02b('0x2d')];_0x1a9e2c[_0xa02b('0x2e')]=_[_0xa02b('0x2f')](_0x41e2e8);_0x1a9e2c['query']=_['keys'](_0x11783d[_0xa02b('0x30')]);_0x1a9e2c[_0xa02b('0x31')]=_[_0xa02b('0x32')](_0x1a9e2c[_0xa02b('0x2e')],_0x1a9e2c[_0xa02b('0x30')]);_0x57962d['attributes']=_[_0xa02b('0x32')](_0x1a9e2c[_0xa02b('0x2e')],qs['fields'](_0x11783d[_0xa02b('0x30')][_0xa02b('0x33')]));_0x57962d[_0xa02b('0x34')]=_0x57962d['attributes']['length']?_0x57962d[_0xa02b('0x34')]:_0x1a9e2c[_0xa02b('0x2e')];if(!_0x11783d[_0xa02b('0x30')][_0xa02b('0x35')]('nolimit')){_0x57962d[_0xa02b('0x20')]=qs['limit'](_0x11783d[_0xa02b('0x30')][_0xa02b('0x20')]);_0x57962d[_0xa02b('0x1f')]=qs[_0xa02b('0x1f')](_0x11783d[_0xa02b('0x30')][_0xa02b('0x1f')]);}_0x57962d['order']=qs[_0xa02b('0x36')](_0x11783d[_0xa02b('0x30')][_0xa02b('0x36')]);_0x57962d['where']=qs[_0xa02b('0x31')](_[_0xa02b('0x37')](_0x11783d[_0xa02b('0x30')],_0x1a9e2c[_0xa02b('0x31')]));if(_0x11783d[_0xa02b('0x30')][_0xa02b('0x38')]){_0x57962d['where']=_['merge'](_0x57962d['where'],{'$or':_['map'](_0x41e2e8,function(_0x49a351){if(_0x49a351['type'][_0xa02b('0x39')]!==_0xa02b('0x3a')){var _0x4fd517={};_0x4fd517[_0x49a351[_0xa02b('0x3b')]]={'$like':'%'+_0x11783d[_0xa02b('0x30')][_0xa02b('0x38')]+'%'};return _0x4fd517;}})});}_0x57962d=_[_0xa02b('0x3c')]({},_0x57962d,_0x11783d[_0xa02b('0x3d')]);var _0x5d4ec={'where':_0x57962d['where']};return db[_0xa02b('0x2c')]['count'](_0x5d4ec)['then'](function(_0x29faf8){_0x255a8e[_0xa02b('0x1e')]=_0x29faf8;if(_0x11783d['query'][_0xa02b('0x3e')]){_0x57962d[_0xa02b('0x3f')]=[{'all':!![]}];}return db[_0xa02b('0x2c')]['findAll'](_0x57962d);})[_0xa02b('0x26')](function(_0x2e2726){_0x255a8e[_0xa02b('0x40')]=_0x2e2726;return _0x255a8e;})[_0xa02b('0x26')](respondWithFilteredResult(_0x50506d,_0x57962d))['catch'](handleError(_0x50506d,null));};exports[_0xa02b('0x41')]=function(_0x3100cf,_0x3eb43c){var _0x33aa71={'raw':![],'where':{'id':_0x3100cf['params']['id']}},_0x285366={};_0x285366['model']=_[_0xa02b('0x2f')](db[_0xa02b('0x2c')]['rawAttributes']);_0x285366[_0xa02b('0x30')]=_[_0xa02b('0x2f')](_0x3100cf[_0xa02b('0x30')]);_0x285366[_0xa02b('0x31')]=_[_0xa02b('0x32')](_0x285366[_0xa02b('0x2e')],_0x285366['query']);_0x33aa71[_0xa02b('0x34')]=_[_0xa02b('0x32')](_0x285366[_0xa02b('0x2e')],qs[_0xa02b('0x33')](_0x3100cf[_0xa02b('0x30')][_0xa02b('0x33')]));_0x33aa71['attributes']=_0x33aa71[_0xa02b('0x34')][_0xa02b('0x42')]?_0x33aa71['attributes']:_0x285366[_0xa02b('0x2e')];if(_0x3100cf[_0xa02b('0x30')][_0xa02b('0x3e')]){_0x33aa71[_0xa02b('0x3f')]=[{'all':!![]}];}_0x33aa71=_[_0xa02b('0x3c')]({},_0x33aa71,_0x3100cf[_0xa02b('0x3d')]);return db[_0xa02b('0x2c')][_0xa02b('0x43')](_0x33aa71)[_0xa02b('0x26')](handleEntityNotFound(_0x3eb43c,null))['then'](respondWithResult(_0x3eb43c,null))['catch'](handleError(_0x3eb43c,null));};exports[_0xa02b('0x44')]=function(_0x3008cd,_0x460a30){return db[_0xa02b('0x2c')]['create'](_0x3008cd[_0xa02b('0x45')],{})[_0xa02b('0x26')](respondWithResult(_0x460a30,0xc9))[_0xa02b('0x46')](handleError(_0x460a30,null));};exports[_0xa02b('0x25')]=function(_0x5d5ee3,_0x54f71f){if(_0x5d5ee3['body']['id']){delete _0x5d5ee3['body']['id'];}return db[_0xa02b('0x2c')][_0xa02b('0x43')]({'where':{'id':_0x5d5ee3[_0xa02b('0x47')]['id']}})[_0xa02b('0x26')](handleEntityNotFound(_0x54f71f,null))[_0xa02b('0x26')](saveUpdates(_0x5d5ee3[_0xa02b('0x45')],null))[_0xa02b('0x26')](respondWithResult(_0x54f71f,null))['catch'](handleError(_0x54f71f,null));};exports['destroy']=function(_0xaebddb,_0x2d420d){return db[_0xa02b('0x2c')][_0xa02b('0x43')]({'where':{'id':_0xaebddb['params']['id']}})['then'](handleEntityNotFound(_0x2d420d,null))[_0xa02b('0x26')](removeEntity(_0x2d420d,null))[_0xa02b('0x46')](handleError(_0x2d420d,null));};exports['addConditions']=function(_0x23588,_0x3a09f8,_0x40f75a){return db[_0xa02b('0x48')][_0xa02b('0x43')]({'where':{'id':_0x23588[_0xa02b('0x47')]['id']}})[_0xa02b('0x26')](handleEntityNotFound(_0x3a09f8,null))[_0xa02b('0x26')](function(_0x5a5561){if(_0x5a5561){return _0x5a5561[_0xa02b('0x49')](_0x23588[_0xa02b('0x45')][_0xa02b('0x4a')],_[_0xa02b('0x4b')](_0x23588[_0xa02b('0x45')],[_0xa02b('0x4a'),'id'])||{});}})[_0xa02b('0x26')](respondWithResult(_0x3a09f8,null))[_0xa02b('0x46')](handleError(_0x3a09f8,null));};exports[_0xa02b('0x4c')]=function(_0x5b9339,_0x1f09fc,_0x630db8){var _0xba8cbf={};var _0x281610={};var _0x3d3d42;var _0x37c77a;return db[_0xa02b('0x2c')][_0xa02b('0x4d')]({'where':{'id':_0x5b9339[_0xa02b('0x47')]['id']}})[_0xa02b('0x26')](handleEntityNotFound(_0x1f09fc,null))[_0xa02b('0x26')](function(_0x1b36fc){if(_0x1b36fc){_0x3d3d42=_0x1b36fc;_0x281610[_0xa02b('0x2e')]=_[_0xa02b('0x2f')](db[_0xa02b('0x48')][_0xa02b('0x2d')]);_0x281610[_0xa02b('0x30')]=_[_0xa02b('0x2f')](_0x5b9339[_0xa02b('0x30')]);_0x281610['filters']=_[_0xa02b('0x32')](_0x281610['model'],_0x281610[_0xa02b('0x30')]);_0xba8cbf['attributes']=_[_0xa02b('0x32')](_0x281610[_0xa02b('0x2e')],qs[_0xa02b('0x33')](_0x5b9339[_0xa02b('0x30')][_0xa02b('0x33')]));_0xba8cbf[_0xa02b('0x34')]=_0xba8cbf[_0xa02b('0x34')][_0xa02b('0x42')]?_0xba8cbf['attributes']:_0x281610['model'];_0xba8cbf[_0xa02b('0x4e')]=qs[_0xa02b('0x36')](_0x5b9339[_0xa02b('0x30')]['sort']);_0xba8cbf[_0xa02b('0x4f')]=qs[_0xa02b('0x31')](_[_0xa02b('0x37')](_0x5b9339[_0xa02b('0x30')],_0x281610[_0xa02b('0x31')]));if(_0x5b9339['query'][_0xa02b('0x38')]){_0xba8cbf[_0xa02b('0x4f')]=_[_0xa02b('0x3c')](_0xba8cbf[_0xa02b('0x4f')],{'$or':_[_0xa02b('0x50')](_0xba8cbf[_0xa02b('0x34')],function(_0x2c515c){var _0x1126b3={};_0x1126b3[_0x2c515c]={'$like':'%'+_0x5b9339[_0xa02b('0x30')][_0xa02b('0x38')]+'%'};return _0x1126b3;})});}_0xba8cbf=_[_0xa02b('0x3c')]({},_0xba8cbf,_0x5b9339['options']);return _0x3d3d42[_0xa02b('0x4c')](_0xba8cbf);}})[_0xa02b('0x26')](function(_0x4f8f7f){if(_0x4f8f7f){_0x37c77a=_0x4f8f7f[_0xa02b('0x42')];if(!_0x5b9339[_0xa02b('0x30')]['hasOwnProperty'](_0xa02b('0x51'))){_0xba8cbf['limit']=qs[_0xa02b('0x20')](_0x5b9339['query'][_0xa02b('0x20')]);_0xba8cbf[_0xa02b('0x1f')]=qs[_0xa02b('0x1f')](_0x5b9339[_0xa02b('0x30')][_0xa02b('0x1f')]);}return _0x3d3d42[_0xa02b('0x4c')](_0xba8cbf);}})[_0xa02b('0x26')](function(_0x16a319){if(_0x16a319){return _0x16a319?{'count':_0x37c77a,'rows':_0x16a319}:null;}})[_0xa02b('0x26')](respondWithResult(_0x1f09fc,null))[_0xa02b('0x46')](handleError(_0x1f09fc,null));};exports['addActions']=function(_0x192fe7,_0x2f3a10,_0x1a2554){return db[_0xa02b('0x52')][_0xa02b('0x43')]({'where':{'id':_0x192fe7[_0xa02b('0x47')]['id']}})['then'](handleEntityNotFound(_0x2f3a10,null))[_0xa02b('0x26')](function(_0xa57115){if(_0xa57115){return _0xa57115[_0xa02b('0x53')](_0x192fe7[_0xa02b('0x45')]['ids'],_['omit'](_0x192fe7[_0xa02b('0x45')],[_0xa02b('0x4a'),'id'])||{});}})[_0xa02b('0x26')](respondWithResult(_0x2f3a10,null))[_0xa02b('0x46')](handleError(_0x2f3a10,null));};exports['getActions']=function(_0x2afc50,_0x434b1e,_0x11a3e0){var _0x531845={};var _0x29d990={};var _0x12a887;var _0x364f73;return db[_0xa02b('0x2c')][_0xa02b('0x4d')]({'where':{'id':_0x2afc50[_0xa02b('0x47')]['id']}})[_0xa02b('0x26')](handleEntityNotFound(_0x434b1e,null))['then'](function(_0x954885){if(_0x954885){_0x12a887=_0x954885;_0x29d990[_0xa02b('0x2e')]=_['keys'](db['Action'][_0xa02b('0x2d')]);_0x29d990[_0xa02b('0x30')]=_[_0xa02b('0x2f')](_0x2afc50[_0xa02b('0x30')]);_0x29d990[_0xa02b('0x31')]=_[_0xa02b('0x32')](_0x29d990['model'],_0x29d990['query']);_0x531845[_0xa02b('0x34')]=_[_0xa02b('0x32')](_0x29d990['model'],qs['fields'](_0x2afc50['query'][_0xa02b('0x33')]));_0x531845[_0xa02b('0x34')]=_0x531845[_0xa02b('0x34')][_0xa02b('0x42')]?_0x531845[_0xa02b('0x34')]:_0x29d990[_0xa02b('0x2e')];_0x531845[_0xa02b('0x4e')]=qs['sort'](_0x2afc50[_0xa02b('0x30')][_0xa02b('0x36')]);_0x531845[_0xa02b('0x4f')]=qs[_0xa02b('0x31')](_[_0xa02b('0x37')](_0x2afc50['query'],_0x29d990[_0xa02b('0x31')]));if(_0x2afc50['query'][_0xa02b('0x38')]){_0x531845[_0xa02b('0x4f')]=_[_0xa02b('0x3c')](_0x531845[_0xa02b('0x4f')],{'$or':_[_0xa02b('0x50')](_0x531845[_0xa02b('0x34')],function(_0x4965fc){var _0x25470d={};_0x25470d[_0x4965fc]={'$like':'%'+_0x2afc50[_0xa02b('0x30')][_0xa02b('0x38')]+'%'};return _0x25470d;})});}_0x531845=_[_0xa02b('0x3c')]({},_0x531845,_0x2afc50[_0xa02b('0x3d')]);return _0x12a887[_0xa02b('0x54')](_0x531845);}})['then'](function(_0x146eb5){if(_0x146eb5){_0x364f73=_0x146eb5[_0xa02b('0x42')];if(!_0x2afc50[_0xa02b('0x30')]['hasOwnProperty'](_0xa02b('0x51'))){_0x531845[_0xa02b('0x20')]=qs[_0xa02b('0x20')](_0x2afc50[_0xa02b('0x30')]['limit']);_0x531845[_0xa02b('0x1f')]=qs[_0xa02b('0x1f')](_0x2afc50['query']['offset']);}return _0x12a887[_0xa02b('0x54')](_0x531845);}})['then'](function(_0x2cefdf){if(_0x2cefdf){return _0x2cefdf?{'count':_0x364f73,'rows':_0x2cefdf}:null;}})[_0xa02b('0x26')](respondWithResult(_0x434b1e,null))[_0xa02b('0x46')](handleError(_0x434b1e,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 778c4c9..4e083d8 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 _0x2cae=['../../config/logger','api','moment','bluebird','path','../../config/environment','./automation.attributes','define','Automation','tools_automations','lodash'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x2cae,0x16a));var _0xe2ca=function(_0x2f3794,_0x3c3bec){_0x2f3794=_0x2f3794-0x0;var _0x1c9fbe=_0x2cae[_0x2f3794];return _0x1c9fbe;};'use strict';var _=require(_0xe2ca('0x0'));var util=require('util');var logger=require(_0xe2ca('0x1'))(_0xe2ca('0x2'));var moment=require(_0xe2ca('0x3'));var BPromise=require(_0xe2ca('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe2ca('0x5'));var rimraf=require('rimraf');var config=require(_0xe2ca('0x6'));var attributes=require(_0xe2ca('0x7'));module['exports']=function(_0x52f698,_0x3f92a4){return _0x52f698[_0xe2ca('0x8')](_0xe2ca('0x9'),attributes,{'tableName':_0xe2ca('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdea6=['Automation','tools_automations','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define'];(function(_0x1d98da,_0x532964){var _0x2a56f2=function(_0x42db4d){while(--_0x42db4d){_0x1d98da['push'](_0x1d98da['shift']());}};_0x2a56f2(++_0x532964);}(_0xdea6,0x86));var _0x6dea=function(_0x3d41e8,_0x5db0c0){_0x3d41e8=_0x3d41e8-0x0;var _0x14ff65=_0xdea6[_0x3d41e8];return _0x14ff65;};'use strict';var _=require('lodash');var util=require(_0x6dea('0x0'));var logger=require(_0x6dea('0x1'))(_0x6dea('0x2'));var moment=require(_0x6dea('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6dea('0x4'));var rimraf=require(_0x6dea('0x5'));var config=require(_0x6dea('0x6'));var attributes=require('./automation.attributes');module[_0x6dea('0x7')]=function(_0x44c917,_0x5e7a11){return _0x44c917[_0x6dea('0x8')](_0x6dea('0x9'),attributes,{'tableName':_0x6dea('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 62260e8..f83ed0a 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 _0x9797=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x520f7e,_0x67518d){var _0x587f49=function(_0x226a93){while(--_0x226a93){_0x520f7e['push'](_0x520f7e['shift']());}};_0x587f49(++_0x67518d);}(_0x9797,0x1c9));var _0x7979=function(_0x7185f7,_0x37065){_0x7185f7=_0x7185f7-0x0;var _0x182e45=_0x9797[_0x7185f7];return _0x182e45;};'use strict';var _=require(_0x7979('0x0'));var util=require(_0x7979('0x1'));var moment=require(_0x7979('0x2'));var BPromise=require('bluebird');var rs=require(_0x7979('0x3'));var fs=require('fs');var Redis=require(_0x7979('0x4'));var db=require(_0x7979('0x5'))['db'];var utils=require(_0x7979('0x6'));var logger=require(_0x7979('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7979('0x8'));var client=jayson[_0x7979('0x9')][_0x7979('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20c280,_0x48ac8e,_0x8dbe35){return new BPromise(function(_0x391f8a,_0xf8c40){return client[_0x7979('0xb')](_0x20c280,_0x8dbe35)[_0x7979('0xc')](function(_0x530d18){logger['info'](_0x7979('0xd'),_0x48ac8e,_0x7979('0xe'));logger[_0x7979('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x48ac8e,'request\x20sent',JSON[_0x7979('0x10')](_0x530d18));if(_0x530d18[_0x7979('0x11')]){if(_0x530d18[_0x7979('0x11')][_0x7979('0x12')]===0x1f4){logger[_0x7979('0x11')]('Automation,\x20%s,\x20%s',_0x48ac8e,_0x530d18['error'][_0x7979('0x13')]);return _0xf8c40(_0x530d18['error']['message']);}logger[_0x7979('0x11')](_0x7979('0xd'),_0x48ac8e,_0x530d18[_0x7979('0x11')]['message']);return _0x391f8a(_0x530d18[_0x7979('0x11')][_0x7979('0x13')]);}else{logger[_0x7979('0x14')](_0x7979('0xd'),_0x48ac8e,'request\x20sent');_0x391f8a(_0x530d18[_0x7979('0x15')][_0x7979('0x13')]);}})[_0x7979('0x16')](function(_0x27f44a){logger[_0x7979('0x11')](_0x7979('0xd'),_0x48ac8e,_0x27f44a);_0xf8c40(_0x27f44a);});});} \ No newline at end of file +var _0xa994=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x19c529,_0x36d01e){var _0x3aa259=function(_0x2ed537){while(--_0x2ed537){_0x19c529['push'](_0x19c529['shift']());}};_0x3aa259(++_0x36d01e);}(_0xa994,0x150));var _0x4a99=function(_0x51a9b6,_0x378140){_0x51a9b6=_0x51a9b6-0x0;var _0x2a4c89=_0xa994[_0x51a9b6];return _0x2a4c89;};'use strict';var _=require('lodash');var util=require(_0x4a99('0x0'));var moment=require('moment');var BPromise=require(_0x4a99('0x1'));var rs=require(_0x4a99('0x2'));var fs=require('fs');var Redis=require(_0x4a99('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4a99('0x4'))(_0x4a99('0x5'));var config=require(_0x4a99('0x6'));var jayson=require(_0x4a99('0x7'));var client=jayson[_0x4a99('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d03b0,_0x398c3f,_0x3c708a){return new BPromise(function(_0x2a155f,_0xabe62b){return client['request'](_0x1d03b0,_0x3c708a)[_0x4a99('0x9')](function(_0x43152c){logger['info'](_0x4a99('0xa'),_0x398c3f,_0x4a99('0xb'));logger[_0x4a99('0xc')](_0x4a99('0xd'),_0x398c3f,_0x4a99('0xb'),JSON[_0x4a99('0xe')](_0x43152c));if(_0x43152c[_0x4a99('0xf')]){if(_0x43152c[_0x4a99('0xf')][_0x4a99('0x10')]===0x1f4){logger[_0x4a99('0xf')](_0x4a99('0xa'),_0x398c3f,_0x43152c[_0x4a99('0xf')][_0x4a99('0x11')]);return _0xabe62b(_0x43152c[_0x4a99('0xf')][_0x4a99('0x11')]);}logger[_0x4a99('0xf')](_0x4a99('0xa'),_0x398c3f,_0x43152c[_0x4a99('0xf')][_0x4a99('0x11')]);return _0x2a155f(_0x43152c[_0x4a99('0xf')][_0x4a99('0x11')]);}else{logger[_0x4a99('0x12')](_0x4a99('0xa'),_0x398c3f,_0x4a99('0xb'));_0x2a155f(_0x43152c[_0x4a99('0x13')]['message']);}})[_0x4a99('0x14')](function(_0x49090e){logger[_0x4a99('0xf')](_0x4a99('0xa'),_0x398c3f,_0x49090e);_0xabe62b(_0x49090e);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index bc13628..5401301 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 _0x9b07=['../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addConditions','update','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x19eec4,_0x3adfb9){var _0x531833=function(_0x2314a8){while(--_0x2314a8){_0x19eec4['push'](_0x19eec4['shift']());}};_0x531833(++_0x3adfb9);}(_0x9b07,0xb7));var _0x79b0=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x9b07[_0x42245d];return _0x4b211a;};'use strict';var multer=require(_0x79b0('0x0'));var util=require(_0x79b0('0x1'));var path=require(_0x79b0('0x2'));var timeout=require(_0x79b0('0x3'));var express=require(_0x79b0('0x4'));var router=express['Router']();var auth=require(_0x79b0('0x5'));var interaction=require(_0x79b0('0x6'));var config=require(_0x79b0('0x7'));var controller=require(_0x79b0('0x8'));router['get']('/',auth[_0x79b0('0x9')](),controller[_0x79b0('0xa')]);router[_0x79b0('0xb')](_0x79b0('0xc'),auth[_0x79b0('0x9')](),controller['show']);router[_0x79b0('0xb')]('/:id/conditions',auth[_0x79b0('0x9')](),controller[_0x79b0('0xd')]);router['get'](_0x79b0('0xe'),auth[_0x79b0('0x9')](),controller[_0x79b0('0xf')]);router[_0x79b0('0x10')]('/',auth[_0x79b0('0x9')](),controller[_0x79b0('0x11')]);router['post'](_0x79b0('0x12'),auth[_0x79b0('0x9')](),controller[_0x79b0('0x13')]);router['post'](_0x79b0('0xe'),auth[_0x79b0('0x9')](),controller['addActions']);router['put'](_0x79b0('0xc'),auth[_0x79b0('0x9')](),controller[_0x79b0('0x14')]);router['delete'](_0x79b0('0xc'),auth[_0x79b0('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4073=['get','/:id/actions','getActions','post','/:id/conditions','addConditions','addActions','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./automation.controller','isAuthenticated','index','/:id','getConditions'];(function(_0x4ef734,_0x5826d){var _0x33a7cb=function(_0x127a2b){while(--_0x127a2b){_0x4ef734['push'](_0x4ef734['shift']());}};_0x33a7cb(++_0x5826d);}(_0x4073,0x135));var _0x3407=function(_0x417b1f,_0x5ee3f2){_0x417b1f=_0x417b1f-0x0;var _0x3da5ee=_0x4073[_0x417b1f];return _0x3da5ee;};'use strict';var multer=require(_0x3407('0x0'));var util=require(_0x3407('0x1'));var path=require(_0x3407('0x2'));var timeout=require(_0x3407('0x3'));var express=require(_0x3407('0x4'));var router=express[_0x3407('0x5')]();var auth=require(_0x3407('0x6'));var interaction=require(_0x3407('0x7'));var config=require('../../config/environment');var controller=require(_0x3407('0x8'));router['get']('/',auth[_0x3407('0x9')](),controller[_0x3407('0xa')]);router['get'](_0x3407('0xb'),auth[_0x3407('0x9')](),controller['show']);router['get']('/:id/conditions',auth[_0x3407('0x9')](),controller[_0x3407('0xc')]);router[_0x3407('0xd')](_0x3407('0xe'),auth[_0x3407('0x9')](),controller[_0x3407('0xf')]);router[_0x3407('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3407('0x10')](_0x3407('0x11'),auth[_0x3407('0x9')](),controller[_0x3407('0x12')]);router[_0x3407('0x10')](_0x3407('0xe'),auth['isAuthenticated'](),controller[_0x3407('0x13')]);router[_0x3407('0x14')](_0x3407('0xb'),auth[_0x3407('0x9')](),controller['update']);router[_0x3407('0x15')](_0x3407('0xb'),auth['isAuthenticated'](),controller[_0x3407('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 0d85f78..f6369bb 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 _0xab9b=['#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','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','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','#AMD\x20After\x20Greeting\x20Silence'];(function(_0x43bad9,_0x579595){var _0x2a0549=function(_0x440d5d){while(--_0x440d5d){_0x43bad9['push'](_0x43bad9['shift']());}};_0x2a0549(++_0x579595);}(_0xab9b,0x84));var _0xbab9=function(_0x3452eb,_0x44035e){_0x3452eb=_0x3452eb-0x0;var _0x4244fd=_0xab9b[_0x3452eb];return _0x4244fd;};'use strict';var Sequelize=require('sequelize');module[_0xbab9('0x0')]={'name':{'type':Sequelize[_0xbab9('0x1')],'unique':_0xbab9('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xbab9('0x3')](_0xbab9('0x4')),'allowNull':![],'defaultValue':_0xbab9('0x4')},'description':{'type':Sequelize[_0xbab9('0x1')]},'active':{'type':Sequelize[_0xbab9('0x5')],'defaultValue':0x0,'comment':_0xbab9('0x6')},'limitCalls':{'type':Sequelize[_0xbab9('0x7')](0x4)[_0xbab9('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xbab9('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xbab9('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xbab9('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xbab9('0x7')](0x3)[_0xbab9('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbab9('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xbab9('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xbab9('0x7')](0x5)[_0xbab9('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xbab9('0x7')](0x3)[_0xbab9('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbab9('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xbab9('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbab9('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbab9('0x8')],'defaultValue':0x3,'comment':_0xbab9('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xbab9('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xbab9('0x7')](0x3)[_0xbab9('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xbab9('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xbab9('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xbab9('0x3')](_0xbab9('0xe'),_0xbab9('0xf'),_0xbab9('0x10')),'defaultValue':_0xbab9('0xe')},'dialAMDActive':{'type':Sequelize[_0xbab9('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xbab9('0x7')](0x9)[_0xbab9('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xbab9('0x7')](0x9)[_0xbab9('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xbab9('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xbab9('0x11')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xbab9('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbab9('0x12')},'dialAMDMinWordLength':{'type':Sequelize[_0xbab9('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xbab9('0x13')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xbab9('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xbab9('0x7')](0x9)[_0xbab9('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xbab9('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xbab9('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xbab9('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xbab9('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xbab9('0x3')]('DESC','ASC'),'defaultValue':_0xbab9('0x16')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xbab9('0x7')](0x3)[_0xbab9('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbab9('0x17')},'dialCutDigit':{'type':Sequelize[_0xbab9('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbab9('0x18')}}; \ No newline at end of file +var _0x4a7a=['ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length'];(function(_0xc52447,_0x4b5265){var _0x3ff35e=function(_0x25061b){while(--_0x25061b){_0xc52447['push'](_0xc52447['shift']());}};_0x3ff35e(++_0x4b5265);}(_0x4a7a,0xac));var _0xa4a7=function(_0xe96931,_0x2f59d7){_0xe96931=_0xe96931-0x0;var _0x332f08=_0x4a7a[_0xe96931];return _0x332f08;};'use strict';var Sequelize=require('sequelize');module[_0xa4a7('0x0')]={'name':{'type':Sequelize[_0xa4a7('0x1')],'unique':_0xa4a7('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xa4a7('0x3')](_0xa4a7('0x4')),'allowNull':![],'defaultValue':_0xa4a7('0x4')},'description':{'type':Sequelize[_0xa4a7('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xa4a7('0x5')},'limitCalls':{'type':Sequelize[_0xa4a7('0x6')](0x4)[_0xa4a7('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa4a7('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xa4a7('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4a7('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xa4a7('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4a7('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa4a7('0x6')](0x5)[_0xa4a7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4a7('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xa4a7('0x6')](0x3)[_0xa4a7('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4a7('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa4a7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4a7('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa4a7('0x6')](0x3)[_0xa4a7('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa4a7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xa4a7('0x6')](0x3)[_0xa4a7('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa4a7('0xd')},'dialTimezone':{'type':Sequelize[_0xa4a7('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xa4a7('0x3')](_0xa4a7('0xe'),_0xa4a7('0xf'),_0xa4a7('0x10')),'defaultValue':_0xa4a7('0xe')},'dialAMDActive':{'type':Sequelize[_0xa4a7('0x11')],'defaultValue':0x0,'comment':_0xa4a7('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xa4a7('0x6')](0x9)[_0xa4a7('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa4a7('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xa4a7('0x6')](0x9)[_0xa4a7('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa4a7('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa4a7('0x6')](0x9)[_0xa4a7('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xa4a7('0x6')](0x9)[_0xa4a7('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa4a7('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa4a7('0x6')](0x9)[_0xa4a7('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa4a7('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa4a7('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa4a7('0x6')](0x5)[_0xa4a7('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa4a7('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa4a7('0x6')](0x9)[_0xa4a7('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa4a7('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0xa4a7('0x3')]('DESC',_0xa4a7('0x18')),'defaultValue':_0xa4a7('0x19')},'dialPrefix':{'type':Sequelize[_0xa4a7('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa4a7('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa4a7('0x1a')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xa4a7('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa4a7('0x1b')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 6881fe9..516c85c 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 _0x29aa=['all','removeLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','save','then','get','IvrCampaigns','UserProfileResource','destroy','stack','name','send','index','Campaign','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','getHoppers','findOne','CmHopper','rows','CmHopperHistory','CmHopperFinal','CampaignId','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','deletedAt\x20IS\x20NULL','push'];(function(_0x2daca7,_0x40e8cb){var _0x41bb55=function(_0x3674a7){while(--_0x3674a7){_0x2daca7['push'](_0x2daca7['shift']());}};_0x41bb55(++_0x40e8cb);}(_0x29aa,0x195));var _0xa29a=function(_0x2ceea3,_0x4a8f4b){_0x2ceea3=_0x2ceea3-0x0;var _0xda1c30=_0x29aa[_0x2ceea3];return _0xda1c30;};'use strict';var pdf=require(_0xa29a('0x0'));var emlformat=require(_0xa29a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa29a('0x2'));var jsonpatch=require(_0xa29a('0x3'));var rp=require(_0xa29a('0x4'));var moment=require(_0xa29a('0x5'));var BPromise=require(_0xa29a('0x6'));var Mustache=require(_0xa29a('0x7'));var util=require(_0xa29a('0x8'));var path=require(_0xa29a('0x9'));var sox=require(_0xa29a('0xa'));var csv=require(_0xa29a('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa29a('0xc'));var squel=require(_0xa29a('0xd'));var crypto=require('crypto');var jsforce=require(_0xa29a('0xe'));var deskjs=require(_0xa29a('0xf'));var toCsv=require(_0xa29a('0xb'));var querystring=require(_0xa29a('0x10'));var Papa=require('papaparse');var Redis=require(_0xa29a('0x11'));var authService=require(_0xa29a('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xa29a('0x13'));var logger=require(_0xa29a('0x14'))('api');var utils=require(_0xa29a('0x15'));var config=require(_0xa29a('0x16'));var db=require(_0xa29a('0x17'))['db'];function respondWithStatusCode(_0x1050bb,_0x4a5df5){_0x4a5df5=_0x4a5df5||0xcc;return function(_0x230031){if(_0x230031){return _0x1050bb[_0xa29a('0x18')](_0x4a5df5);}return _0x1050bb[_0xa29a('0x19')](_0x4a5df5)[_0xa29a('0x1a')]();};}function respondWithResult(_0x16784d,_0x3bf283){_0x3bf283=_0x3bf283||0xc8;return function(_0x30c536){if(_0x30c536){return _0x16784d['status'](_0x3bf283)['json'](_0x30c536);}};}function respondWithFilteredResult(_0x4ba0da,_0x4e5c7d){return function(_0x1a7afb){if(_0x1a7afb){var _0x1f176f=_0x1a7afb[_0xa29a('0x1b')],_0x314f96=_0x4e5c7d['offset'],_0x1097d3=_0x4e5c7d[_0xa29a('0x1c')]+_0x4e5c7d[_0xa29a('0x1d')],_0x869df4;if(_0x1097d3>=_0x1f176f){_0x1097d3=_0x1f176f;_0x869df4=0xc8;}else{_0x869df4=0xce;}_0x4ba0da['status'](_0x869df4);return _0x4ba0da[_0xa29a('0x1e')](_0xa29a('0x1f'),_0x314f96+'-'+_0x1097d3+'/'+_0x1f176f)[_0xa29a('0x20')](_0x1a7afb);}return null;};}function patchUpdates(_0x45758d){return function(_0x522a95){try{jsonpatch['apply'](_0x522a95,_0x45758d,!![]);}catch(_0xa5a7d7){return BPromise['reject'](_0xa5a7d7);}return _0x522a95[_0xa29a('0x21')]();};}function saveUpdates(_0x36377a,_0xe620bd){return function(_0x247e0a){if(_0x247e0a){return _0x247e0a['update'](_0x36377a)['then'](function(_0x186719){return _0x186719;});}return null;};}function removeEntity(_0x401317,_0x43f2a6){return function(_0x125885){if(_0x125885){return _0x125885['destroy']()[_0xa29a('0x22')](function(){var _0x1ca58c=_0x125885[_0xa29a('0x23')]({'plain':!![]});var _0x540057=_0xa29a('0x24');return db[_0xa29a('0x25')][_0xa29a('0x26')]({'where':{'type':_0x540057,'resourceId':_0x1ca58c['id']}})[_0xa29a('0x22')](function(){return _0x125885;});})[_0xa29a('0x22')](function(){_0x401317['status'](0xcc)[_0xa29a('0x1a')]();});}};}function handleEntityNotFound(_0x418120,_0x4fdd06){return function(_0xa6fca){if(!_0xa6fca){_0x418120[_0xa29a('0x18')](0x194);}return _0xa6fca;};}function handleError(_0x1dd032,_0x26697d){_0x26697d=_0x26697d||0x1f4;return function(_0x52dba4){logger['error'](_0x52dba4[_0xa29a('0x27')]);if(_0x52dba4[_0xa29a('0x28')]){delete _0x52dba4[_0xa29a('0x28')];}_0x1dd032['status'](_0x26697d)[_0xa29a('0x29')](_0x52dba4);};}exports[_0xa29a('0x2a')]=function(_0x1f144a,_0x234c32){var _0x2c2ef5={},_0x274be4={},_0x133de5={'count':0x0,'rows':[]};var _0x1b1f31=db[_0xa29a('0x2b')]['rawAttributes'];_0x274be4[_0xa29a('0x2c')]=_[_0xa29a('0x2d')](_0x1b1f31);_0x274be4['query']=_['keys'](_0x1f144a[_0xa29a('0x2e')]);_0x274be4[_0xa29a('0x2f')]=_[_0xa29a('0x30')](_0x274be4[_0xa29a('0x2c')],_0x274be4[_0xa29a('0x2e')]);_0x2c2ef5[_0xa29a('0x31')]=_[_0xa29a('0x30')](_0x274be4[_0xa29a('0x2c')],qs[_0xa29a('0x32')](_0x1f144a[_0xa29a('0x2e')][_0xa29a('0x32')]));_0x2c2ef5[_0xa29a('0x31')]=_0x2c2ef5[_0xa29a('0x31')][_0xa29a('0x33')]?_0x2c2ef5[_0xa29a('0x31')]:_0x274be4[_0xa29a('0x2c')];if(!_0x1f144a['query'][_0xa29a('0x34')](_0xa29a('0x35'))){_0x2c2ef5['limit']=qs[_0xa29a('0x1d')](_0x1f144a[_0xa29a('0x2e')]['limit']);_0x2c2ef5['offset']=qs[_0xa29a('0x1c')](_0x1f144a[_0xa29a('0x2e')][_0xa29a('0x1c')]);}_0x2c2ef5[_0xa29a('0x36')]=qs[_0xa29a('0x37')](_0x1f144a[_0xa29a('0x2e')][_0xa29a('0x37')]);_0x2c2ef5[_0xa29a('0x38')]=qs[_0xa29a('0x2f')](_[_0xa29a('0x39')](_0x1f144a[_0xa29a('0x2e')],_0x274be4[_0xa29a('0x2f')]));if(_0x1f144a[_0xa29a('0x2e')][_0xa29a('0x3a')]){_0x2c2ef5[_0xa29a('0x38')]=_[_0xa29a('0x3b')](_0x2c2ef5[_0xa29a('0x38')],{'$or':_[_0xa29a('0x3c')](_0x1b1f31,function(_0x1cc85e){if(_0x1cc85e[_0xa29a('0x3d')]['key']!==_0xa29a('0x3e')){var _0x3ed7fc={};_0x3ed7fc[_0x1cc85e[_0xa29a('0x3f')]]={'$like':'%'+_0x1f144a[_0xa29a('0x2e')][_0xa29a('0x3a')]+'%'};return _0x3ed7fc;}})});}_0x2c2ef5=_[_0xa29a('0x3b')]({},_0x2c2ef5,_0x1f144a[_0xa29a('0x40')]);var _0x171488={'where':_0x2c2ef5[_0xa29a('0x38')]};return db['Campaign']['count'](_0x171488)[_0xa29a('0x22')](function(_0x1add46){_0x133de5[_0xa29a('0x1b')]=_0x1add46;if(_0x1f144a['query'][_0xa29a('0x41')]){_0x2c2ef5['include']=[{'all':!![]}];}return db[_0xa29a('0x2b')][_0xa29a('0x42')](_0x2c2ef5);})[_0xa29a('0x22')](function(_0x55e4cc){_0x133de5['rows']=_0x55e4cc;return _0x133de5;})['then'](respondWithFilteredResult(_0x234c32,_0x2c2ef5))[_0xa29a('0x43')](handleError(_0x234c32,null));};exports[_0xa29a('0x44')]=function(_0x36b31d,_0x4e8531){var _0xaf3561={'raw':![],'where':{'id':_0x36b31d[_0xa29a('0x45')]['id']}},_0x5d4aee={};_0x5d4aee['model']=_[_0xa29a('0x2d')](db[_0xa29a('0x2b')][_0xa29a('0x46')]);_0x5d4aee[_0xa29a('0x2e')]=_[_0xa29a('0x2d')](_0x36b31d[_0xa29a('0x2e')]);_0x5d4aee[_0xa29a('0x2f')]=_[_0xa29a('0x30')](_0x5d4aee[_0xa29a('0x2c')],_0x5d4aee[_0xa29a('0x2e')]);_0xaf3561[_0xa29a('0x31')]=_[_0xa29a('0x30')](_0x5d4aee[_0xa29a('0x2c')],qs[_0xa29a('0x32')](_0x36b31d[_0xa29a('0x2e')][_0xa29a('0x32')]));_0xaf3561[_0xa29a('0x31')]=_0xaf3561[_0xa29a('0x31')][_0xa29a('0x33')]?_0xaf3561[_0xa29a('0x31')]:_0x5d4aee[_0xa29a('0x2c')];if(_0x36b31d[_0xa29a('0x2e')][_0xa29a('0x41')]){_0xaf3561[_0xa29a('0x47')]=[{'all':!![]}];}_0xaf3561=_['merge']({},_0xaf3561,_0x36b31d[_0xa29a('0x40')]);return db[_0xa29a('0x2b')][_0xa29a('0x48')](_0xaf3561)[_0xa29a('0x22')](handleEntityNotFound(_0x4e8531,null))['then'](respondWithResult(_0x4e8531,null))['catch'](handleError(_0x4e8531,null));};exports[_0xa29a('0x49')]=function(_0x45a324,_0x5c7aa6){return db[_0xa29a('0x2b')][_0xa29a('0x49')](_0x45a324[_0xa29a('0x4a')],{})[_0xa29a('0x22')](function(_0x2f6041){var _0x3c8a86=_0x45a324[_0xa29a('0x4b')][_0xa29a('0x23')]({'plain':!![]});if(!_0x3c8a86)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c8a86[_0xa29a('0x4c')]===_0xa29a('0x4b')){var _0x2a4676=_0x2f6041[_0xa29a('0x23')]({'plain':!![]});var _0x38ac41='IvrCampaigns';return db[_0xa29a('0x4d')][_0xa29a('0x48')]({'where':{'name':_0x38ac41,'userProfileId':_0x3c8a86[_0xa29a('0x4e')]},'raw':!![]})[_0xa29a('0x22')](function(_0x2421bd){if(_0x2421bd&&_0x2421bd['autoAssociation']===0x0){return db[_0xa29a('0x25')][_0xa29a('0x49')]({'name':_0x2a4676[_0xa29a('0x28')],'resourceId':_0x2a4676['id'],'type':_0x2421bd[_0xa29a('0x28')],'sectionId':_0x2421bd['id']},{})[_0xa29a('0x22')](function(){return _0x2f6041;});}else{return _0x2f6041;}})['catch'](function(_0x9174b0){logger[_0xa29a('0x4f')](_0xa29a('0x50'),_0x9174b0);throw _0x9174b0;});}return _0x2f6041;})[_0xa29a('0x22')](respondWithResult(_0x5c7aa6,0xc9))['catch'](handleError(_0x5c7aa6,null));};exports[_0xa29a('0x51')]=function(_0x354e06,_0x4084f0){var _0x834e53={'raw':![],'where':{'id':_0x354e06['params']['id']}},_0x97da4a={};_0x97da4a['model']=_[_0xa29a('0x2d')](db[_0xa29a('0x2b')]['rawAttributes']);_0x834e53['attributes']=_['intersection'](_0x97da4a['model'],qs[_0xa29a('0x32')](_0x354e06[_0xa29a('0x2e')][_0xa29a('0x32')]));_0x834e53[_0xa29a('0x31')]=_0x834e53[_0xa29a('0x31')][_0xa29a('0x33')]?_0x834e53[_0xa29a('0x31')]:_0x97da4a['model'];if(_0x354e06[_0xa29a('0x2e')][_0xa29a('0x41')]){_0x834e53[_0xa29a('0x47')]=[{'all':!![]}];}_0x834e53=_['merge']({},_0x834e53,_0x354e06[_0xa29a('0x40')]);return db[_0xa29a('0x2b')][_0xa29a('0x48')](_0x834e53)[_0xa29a('0x22')](handleEntityNotFound(_0x4084f0,null))['then'](function(_0xa6c21b){if(_0xa6c21b){var _0x1e6ff4=_0xa6c21b['get']({'plain':!![]});_0x1e6ff4=qs[_0xa29a('0x52')](_0x1e6ff4,['id',_0xa29a('0x53'),_0xa29a('0x54')]);_0x354e06[_0xa29a('0x4a')]=_[_0xa29a('0x52')](_0x354e06[_0xa29a('0x4a')],['id',_0xa29a('0x53'),_0xa29a('0x54')]);return db[_0xa29a('0x2b')][_0xa29a('0x49')](_[_0xa29a('0x3b')](_0x1e6ff4,_0x354e06[_0xa29a('0x4a')]),{'include':_0x354e06[_0xa29a('0x2e')][_0xa29a('0x41')]?[{'all':!![]}]:undefined})[_0xa29a('0x22')](function(_0x1bb9ad){var _0x3037c5=_0x354e06[_0xa29a('0x4b')]['get']({'plain':!![]});if(!_0x3037c5)throw new Error(_0xa29a('0x55'));if(_0x3037c5[_0xa29a('0x4c')]===_0xa29a('0x4b')){var _0x3478ad=_0x1bb9ad['get']({'plain':!![]});var _0x2b332a=_0xa29a('0x24');return db[_0xa29a('0x4d')][_0xa29a('0x48')]({'where':{'name':_0x2b332a,'userProfileId':_0x3037c5[_0xa29a('0x4e')]},'raw':!![]})['then'](function(_0x468a2d){if(_0x468a2d&&_0x468a2d[_0xa29a('0x56')]===0x0){return db[_0xa29a('0x25')][_0xa29a('0x49')]({'name':_0x3478ad[_0xa29a('0x28')],'resourceId':_0x3478ad['id'],'type':_0x468a2d[_0xa29a('0x28')],'sectionId':_0x468a2d['id']},{})[_0xa29a('0x22')](function(){return _0x1bb9ad;});}else{return _0x1bb9ad;}})[_0xa29a('0x43')](function(_0x2d216d){logger[_0xa29a('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d216d);throw _0x2d216d;});}return _0x1bb9ad;});}})[_0xa29a('0x22')](respondWithResult(_0x4084f0,0xc9))[_0xa29a('0x43')](handleError(_0x4084f0,null));};exports['update']=function(_0x46fd07,_0x403d4b){if(_0x46fd07[_0xa29a('0x4a')]['id']){delete _0x46fd07['body']['id'];}return db[_0xa29a('0x2b')]['find']({'where':{'id':_0x46fd07[_0xa29a('0x45')]['id']}})[_0xa29a('0x22')](handleEntityNotFound(_0x403d4b,null))['then'](saveUpdates(_0x46fd07['body'],null))[_0xa29a('0x22')](respondWithResult(_0x403d4b,null))[_0xa29a('0x43')](handleError(_0x403d4b,null));};exports[_0xa29a('0x26')]=function(_0x567966,_0x2a0e4d){return db['Campaign'][_0xa29a('0x48')]({'where':{'id':_0x567966[_0xa29a('0x45')]['id']}})[_0xa29a('0x22')](handleEntityNotFound(_0x2a0e4d,null))[_0xa29a('0x22')](removeEntity(_0x2a0e4d,null))['catch'](handleError(_0x2a0e4d,null));};exports[_0xa29a('0x57')]=function(_0x522394,_0x157821,_0x4a8f6a){var _0x4b2fc4={'raw':!![],'where':{}};var _0x32ca9f={};var _0x1f0a8e={'count':0x0,'rows':[]};return db[_0xa29a('0x2b')][_0xa29a('0x58')]({'where':{'id':_0x522394[_0xa29a('0x45')]['id']}})[_0xa29a('0x22')](handleEntityNotFound(_0x157821,null))[_0xa29a('0x22')](function(_0x2975dc){if(_0x2975dc){_0x32ca9f[_0xa29a('0x2c')]=_[_0xa29a('0x2d')](db[_0xa29a('0x59')][_0xa29a('0x46')]);_0x32ca9f[_0xa29a('0x2e')]=_['keys'](_0x522394[_0xa29a('0x2e')]);_0x32ca9f[_0xa29a('0x2f')]=_[_0xa29a('0x30')](_0x32ca9f[_0xa29a('0x2c')],_0x32ca9f['query']);_0x4b2fc4[_0xa29a('0x31')]=_[_0xa29a('0x30')](_0x32ca9f[_0xa29a('0x2c')],qs[_0xa29a('0x32')](_0x522394[_0xa29a('0x2e')][_0xa29a('0x32')]));_0x4b2fc4['attributes']=_0x4b2fc4['attributes'][_0xa29a('0x33')]?_0x4b2fc4[_0xa29a('0x31')]:_0x32ca9f[_0xa29a('0x2c')];if(!_0x522394[_0xa29a('0x2e')][_0xa29a('0x34')]('nolimit')){_0x4b2fc4[_0xa29a('0x1d')]=qs[_0xa29a('0x1d')](_0x522394[_0xa29a('0x2e')][_0xa29a('0x1d')]);_0x4b2fc4[_0xa29a('0x1c')]=qs[_0xa29a('0x1c')](_0x522394['query'][_0xa29a('0x1c')]);}_0x4b2fc4[_0xa29a('0x36')]=qs['sort'](_0x522394[_0xa29a('0x2e')][_0xa29a('0x37')]);_0x4b2fc4[_0xa29a('0x38')]=qs['filters'](_[_0xa29a('0x39')](_0x522394[_0xa29a('0x2e')],_0x32ca9f[_0xa29a('0x2f')]));_0x4b2fc4[_0xa29a('0x38')]['CampaignId']=_0x2975dc['id'];if(_0x522394['query'][_0xa29a('0x3a')]){_0x4b2fc4[_0xa29a('0x38')]=_[_0xa29a('0x3b')](_0x4b2fc4[_0xa29a('0x38')],{'$or':_[_0xa29a('0x3c')](_0x4b2fc4[_0xa29a('0x31')],function(_0x453e5d){var _0x3e14c4={};_0x3e14c4[_0x453e5d]={'$like':'%'+_0x522394['query']['filter']+'%'};return _0x3e14c4;})});}_0x4b2fc4=_['merge']({},_0x4b2fc4,_0x522394[_0xa29a('0x40')]);return db[_0xa29a('0x59')][_0xa29a('0x1b')]({'where':_0x4b2fc4['where']})[_0xa29a('0x22')](function(_0x52fc77){_0x1f0a8e[_0xa29a('0x1b')]=_0x52fc77;if(_0x522394['query'][_0xa29a('0x41')]){_0x4b2fc4[_0xa29a('0x47')]=[{'all':!![]}];}return db[_0xa29a('0x59')][_0xa29a('0x42')](_0x4b2fc4);})[_0xa29a('0x22')](function(_0x4a5c47){_0x1f0a8e[_0xa29a('0x5a')]=_0x4a5c47;return _0x1f0a8e;});}})[_0xa29a('0x22')](respondWithFilteredResult(_0x157821,_0x4b2fc4))[_0xa29a('0x43')](handleError(_0x157821,null));};exports['getHopperHistories']=function(_0x454354,_0x1f142b,_0x5ee8a4){var _0x4b8a24={'raw':!![],'where':{}};var _0xa291f7={};var _0x5b33ba={'count':0x0,'rows':[]};return db[_0xa29a('0x2b')]['findOne']({'where':{'id':_0x454354[_0xa29a('0x45')]['id']}})[_0xa29a('0x22')](handleEntityNotFound(_0x1f142b,null))['then'](function(_0x48da90){if(_0x48da90){_0xa291f7['model']=_[_0xa29a('0x2d')](db['CmHopperHistory'][_0xa29a('0x46')]);_0xa291f7['query']=_[_0xa29a('0x2d')](_0x454354[_0xa29a('0x2e')]);_0xa291f7[_0xa29a('0x2f')]=_['intersection'](_0xa291f7[_0xa29a('0x2c')],_0xa291f7['query']);_0x4b8a24[_0xa29a('0x31')]=_[_0xa29a('0x30')](_0xa291f7[_0xa29a('0x2c')],qs['fields'](_0x454354['query'][_0xa29a('0x32')]));_0x4b8a24[_0xa29a('0x31')]=_0x4b8a24['attributes'][_0xa29a('0x33')]?_0x4b8a24['attributes']:_0xa291f7[_0xa29a('0x2c')];if(!_0x454354[_0xa29a('0x2e')][_0xa29a('0x34')]('nolimit')){_0x4b8a24[_0xa29a('0x1d')]=qs[_0xa29a('0x1d')](_0x454354[_0xa29a('0x2e')][_0xa29a('0x1d')]);_0x4b8a24[_0xa29a('0x1c')]=qs['offset'](_0x454354[_0xa29a('0x2e')][_0xa29a('0x1c')]);}_0x4b8a24[_0xa29a('0x36')]=qs[_0xa29a('0x37')](_0x454354[_0xa29a('0x2e')][_0xa29a('0x37')]);_0x4b8a24[_0xa29a('0x38')]=qs['filters'](_[_0xa29a('0x39')](_0x454354['query'],_0xa291f7[_0xa29a('0x2f')]));_0x4b8a24[_0xa29a('0x38')]['CampaignId']=_0x48da90['id'];if(_0x454354['query'][_0xa29a('0x3a')]){_0x4b8a24[_0xa29a('0x38')]=_[_0xa29a('0x3b')](_0x4b8a24[_0xa29a('0x38')],{'$or':_[_0xa29a('0x3c')](_0x4b8a24[_0xa29a('0x31')],function(_0x34b985){var _0x2fa35d={};_0x2fa35d[_0x34b985]={'$like':'%'+_0x454354[_0xa29a('0x2e')]['filter']+'%'};return _0x2fa35d;})});}_0x4b8a24=_[_0xa29a('0x3b')]({},_0x4b8a24,_0x454354[_0xa29a('0x40')]);return db[_0xa29a('0x5b')][_0xa29a('0x1b')]({'where':_0x4b8a24['where']})[_0xa29a('0x22')](function(_0x4a5cc0){_0x5b33ba[_0xa29a('0x1b')]=_0x4a5cc0;if(_0x454354[_0xa29a('0x2e')]['includeAll']){_0x4b8a24['include']=[{'all':!![]}];}return db[_0xa29a('0x5b')]['findAll'](_0x4b8a24);})['then'](function(_0x5ee629){_0x5b33ba[_0xa29a('0x5a')]=_0x5ee629;return _0x5b33ba;});}})['then'](respondWithFilteredResult(_0x1f142b,_0x4b8a24))[_0xa29a('0x43')](handleError(_0x1f142b,null));};exports['getHopperFinals']=function(_0x1bf569,_0x54b7e3,_0x555049){var _0x1d2179={'raw':!![],'where':{}};var _0x2914f7={};var _0x278910={'count':0x0,'rows':[]};return db['Campaign'][_0xa29a('0x58')]({'where':{'id':_0x1bf569[_0xa29a('0x45')]['id']}})[_0xa29a('0x22')](handleEntityNotFound(_0x54b7e3,null))['then'](function(_0x57e4fa){if(_0x57e4fa){_0x2914f7[_0xa29a('0x2c')]=_[_0xa29a('0x2d')](db[_0xa29a('0x5c')][_0xa29a('0x46')]);_0x2914f7['query']=_[_0xa29a('0x2d')](_0x1bf569[_0xa29a('0x2e')]);_0x2914f7['filters']=_[_0xa29a('0x30')](_0x2914f7[_0xa29a('0x2c')],_0x2914f7[_0xa29a('0x2e')]);_0x1d2179[_0xa29a('0x31')]=_[_0xa29a('0x30')](_0x2914f7[_0xa29a('0x2c')],qs['fields'](_0x1bf569[_0xa29a('0x2e')]['fields']));_0x1d2179[_0xa29a('0x31')]=_0x1d2179[_0xa29a('0x31')][_0xa29a('0x33')]?_0x1d2179[_0xa29a('0x31')]:_0x2914f7[_0xa29a('0x2c')];if(!_0x1bf569['query'][_0xa29a('0x34')](_0xa29a('0x35'))){_0x1d2179[_0xa29a('0x1d')]=qs[_0xa29a('0x1d')](_0x1bf569[_0xa29a('0x2e')][_0xa29a('0x1d')]);_0x1d2179['offset']=qs[_0xa29a('0x1c')](_0x1bf569[_0xa29a('0x2e')]['offset']);}_0x1d2179[_0xa29a('0x36')]=qs[_0xa29a('0x37')](_0x1bf569['query'][_0xa29a('0x37')]);_0x1d2179[_0xa29a('0x38')]=qs[_0xa29a('0x2f')](_[_0xa29a('0x39')](_0x1bf569[_0xa29a('0x2e')],_0x2914f7[_0xa29a('0x2f')]));_0x1d2179['where'][_0xa29a('0x5d')]=_0x57e4fa['id'];if(_0x1bf569['query'][_0xa29a('0x3a')]){_0x1d2179['where']=_[_0xa29a('0x3b')](_0x1d2179[_0xa29a('0x38')],{'$or':_[_0xa29a('0x3c')](_0x1d2179[_0xa29a('0x31')],function(_0x104329){var _0x4543b3={};_0x4543b3[_0x104329]={'$like':'%'+_0x1bf569[_0xa29a('0x2e')][_0xa29a('0x3a')]+'%'};return _0x4543b3;})});}_0x1d2179=_['merge']({},_0x1d2179,_0x1bf569[_0xa29a('0x40')]);return db[_0xa29a('0x5c')][_0xa29a('0x1b')]({'where':_0x1d2179[_0xa29a('0x38')]})['then'](function(_0x397906){_0x278910['count']=_0x397906;if(_0x1bf569['query']['includeAll']){_0x1d2179[_0xa29a('0x47')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xa29a('0x42')](_0x1d2179);})[_0xa29a('0x22')](function(_0x1054d3){_0x278910['rows']=_0x1054d3;return _0x278910;});}})[_0xa29a('0x22')](respondWithFilteredResult(_0x54b7e3,_0x1d2179))['catch'](handleError(_0x54b7e3,null));};exports[_0xa29a('0x5e')]=function(_0x29872f,_0xf6bab2,_0x101478){var _0x57a932={'raw':!![],'where':{}};var _0x2a9800={};var _0x531383={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x29872f[_0xa29a('0x45')]['id']}})[_0xa29a('0x22')](handleEntityNotFound(_0xf6bab2,null))[_0xa29a('0x22')](function(_0x561864){if(_0x561864){_0x2a9800[_0xa29a('0x2c')]=_[_0xa29a('0x2d')](db[_0xa29a('0x5f')][_0xa29a('0x46')]);_0x2a9800[_0xa29a('0x2e')]=_[_0xa29a('0x2d')](_0x29872f['query']);_0x2a9800['filters']=_[_0xa29a('0x30')](_0x2a9800['model'],_0x2a9800[_0xa29a('0x2e')]);_0x57a932[_0xa29a('0x31')]=_[_0xa29a('0x30')](_0x2a9800['model'],qs[_0xa29a('0x32')](_0x29872f['query'][_0xa29a('0x32')]));_0x57a932[_0xa29a('0x31')]=_0x57a932[_0xa29a('0x31')]['length']?_0x57a932[_0xa29a('0x31')]:_0x2a9800[_0xa29a('0x2c')];if(!_0x29872f[_0xa29a('0x2e')]['hasOwnProperty'](_0xa29a('0x35'))){_0x57a932[_0xa29a('0x1d')]=qs[_0xa29a('0x1d')](_0x29872f[_0xa29a('0x2e')][_0xa29a('0x1d')]);_0x57a932[_0xa29a('0x1c')]=qs[_0xa29a('0x1c')](_0x29872f[_0xa29a('0x2e')]['offset']);}_0x57a932[_0xa29a('0x36')]=qs[_0xa29a('0x37')](_0x29872f[_0xa29a('0x2e')]['sort']);_0x57a932[_0xa29a('0x38')]=qs[_0xa29a('0x2f')](_[_0xa29a('0x39')](_0x29872f[_0xa29a('0x2e')],_0x2a9800[_0xa29a('0x2f')]));_0x57a932['where'][_0xa29a('0x5d')]=_0x561864['id'];if(_0x29872f[_0xa29a('0x2e')][_0xa29a('0x3a')]){_0x57a932[_0xa29a('0x38')]=_[_0xa29a('0x3b')](_0x57a932[_0xa29a('0x38')],{'$or':_[_0xa29a('0x3c')](_0x57a932[_0xa29a('0x31')],function(_0x12e464){var _0x33740a={};_0x33740a[_0x12e464]={'$like':'%'+_0x29872f['query'][_0xa29a('0x3a')]+'%'};return _0x33740a;})});}_0x57a932=_[_0xa29a('0x3b')]({},_0x57a932,_0x29872f['options']);return db['CmHopperBlack'][_0xa29a('0x1b')]({'where':_0x57a932[_0xa29a('0x38')]})[_0xa29a('0x22')](function(_0x127774){_0x531383[_0xa29a('0x1b')]=_0x127774;if(_0x29872f['query'][_0xa29a('0x41')]){_0x57a932[_0xa29a('0x47')]=[{'all':!![]}];}return db[_0xa29a('0x5f')][_0xa29a('0x42')](_0x57a932);})[_0xa29a('0x22')](function(_0x1d2e84){_0x531383[_0xa29a('0x5a')]=_0x1d2e84;return _0x531383;});}})[_0xa29a('0x22')](respondWithFilteredResult(_0xf6bab2,_0x57a932))[_0xa29a('0x43')](handleError(_0xf6bab2,null));};exports[_0xa29a('0x60')]=function(_0x3bc896,_0x2756ca,_0x566eca){var _0x9cf8e={};var _0x293733={};var _0x3b42ab;var _0x563379;return db[_0xa29a('0x2b')][_0xa29a('0x58')]({'where':{'id':_0x3bc896[_0xa29a('0x45')]['id']}})[_0xa29a('0x22')](handleEntityNotFound(_0x2756ca,null))[_0xa29a('0x22')](function(_0x17c7d8){if(_0x17c7d8){_0x3b42ab=_0x17c7d8;_0x293733[_0xa29a('0x2c')]=_[_0xa29a('0x2d')](db[_0xa29a('0x61')]['rawAttributes']);_0x293733[_0xa29a('0x2e')]=_[_0xa29a('0x2d')](_0x3bc896[_0xa29a('0x2e')]);_0x293733[_0xa29a('0x2f')]=_[_0xa29a('0x30')](_0x293733['model'],_0x293733['query']);_0x9cf8e[_0xa29a('0x31')]=_[_0xa29a('0x30')](_0x293733[_0xa29a('0x2c')],qs[_0xa29a('0x32')](_0x3bc896[_0xa29a('0x2e')]['fields']));_0x9cf8e[_0xa29a('0x31')]=_0x9cf8e['attributes']['length']?_0x9cf8e[_0xa29a('0x31')]:_0x293733[_0xa29a('0x2c')];_0x9cf8e[_0xa29a('0x36')]=qs['sort'](_0x3bc896['query'][_0xa29a('0x37')]);_0x9cf8e[_0xa29a('0x38')]=qs[_0xa29a('0x2f')](_[_0xa29a('0x39')](_0x3bc896[_0xa29a('0x2e')],_0x293733[_0xa29a('0x2f')]));if(_0x3bc896[_0xa29a('0x2e')][_0xa29a('0x3a')]){_0x9cf8e[_0xa29a('0x38')]=_[_0xa29a('0x3b')](_0x9cf8e[_0xa29a('0x38')],{'$or':_[_0xa29a('0x3c')](_0x9cf8e[_0xa29a('0x31')],function(_0x5f1a3a){var _0xeec39a={};_0xeec39a[_0x5f1a3a]={'$like':'%'+_0x3bc896[_0xa29a('0x2e')]['filter']+'%'};return _0xeec39a;})});}_0x9cf8e=_[_0xa29a('0x3b')]({},_0x9cf8e,_0x3bc896[_0xa29a('0x40')]);return _0x3b42ab[_0xa29a('0x60')](_0x9cf8e);}})[_0xa29a('0x22')](function(_0x251b74){if(_0x251b74){_0x563379=_0x251b74[_0xa29a('0x33')];if(!_0x3bc896['query']['hasOwnProperty'](_0xa29a('0x35'))){_0x9cf8e['limit']=qs[_0xa29a('0x1d')](_0x3bc896[_0xa29a('0x2e')][_0xa29a('0x1d')]);_0x9cf8e[_0xa29a('0x1c')]=qs[_0xa29a('0x1c')](_0x3bc896['query']['offset']);}return _0x3b42ab['getLists'](_0x9cf8e);}})[_0xa29a('0x22')](function(_0x37b236){if(_0x37b236){return _0x37b236?{'count':_0x563379,'rows':_0x37b236}:null;}})[_0xa29a('0x22')](respondWithResult(_0x2756ca,null))['catch'](handleError(_0x2756ca,null));};exports['addLists']=function(_0x5ded4a,_0x490b3a,_0x535640){var _0x1b6c0b,_0x294300;return db[_0xa29a('0x2b')][_0xa29a('0x48')]({'where':{'id':_0x5ded4a['params']['id']}})[_0xa29a('0x22')](handleEntityNotFound(_0x490b3a,null))['then'](function(_0x3973e6){if(_0x3973e6){_0x294300=_0x3973e6;return _0x3973e6[_0xa29a('0x62')](_0x5ded4a[_0xa29a('0x4a')]['ids'],_[_0xa29a('0x52')](_0x5ded4a['body'],[_0xa29a('0x63'),'id'])||{});}return null;})[_0xa29a('0x64')](function(_0x221e3f){var _0x5c0f94;_0x1b6c0b=_0x221e3f||[];var _0x22b585=[];if(_0x221e3f){for(var _0x3c26a4=0x0;_0x3c26a4<_0x221e3f['length'];_0x3c26a4+=0x1){var _0x480a9d=_0x221e3f[_0x3c26a4][_0xa29a('0x23')]({'plain':!![]});_0x294300[_0xa29a('0x65')]=_0x5ded4a[_0xa29a('0x4a')]['dialCheckDuplicateType']?_0x5ded4a['body']['dialCheckDuplicateType']:_0x294300['dialCheckDuplicateType'];switch(_0x294300[_0xa29a('0x65')]){case _0xa29a('0x66'):_0x5c0f94=squel['insert']()[_0xa29a('0x67')](_0xa29a('0x68'))[_0xa29a('0x69')]([_0xa29a('0x6a'),_0xa29a('0x6b'),_0xa29a('0x6c'),_0xa29a('0x6d'),'CampaignId',_0xa29a('0x53'),_0xa29a('0x54')],squel['select']()[_0xa29a('0x3f')]('phone',_0xa29a('0x6a'))['field'](_0xa29a('0x6e'),'scheduledAt')[_0xa29a('0x3f')]('id',_0xa29a('0x6c'))[_0xa29a('0x3f')](_0x480a9d[_0xa29a('0x6f')][_0xa29a('0x70')](),_0xa29a('0x6d'))['field'](_0x5ded4a['params']['id'][_0xa29a('0x70')](),_0xa29a('0x5d'))[_0xa29a('0x3f')](_0xa29a('0x6e'),'createdAt')[_0xa29a('0x3f')](_0xa29a('0x6e'),_0xa29a('0x54'))[_0xa29a('0x71')](_0xa29a('0x72'))[_0xa29a('0x38')]('deletedAt\x20IS\x20NULL')[_0xa29a('0x38')](_0xa29a('0x73'),_0x480a9d[_0xa29a('0x6f')][_0xa29a('0x70')]())[_0xa29a('0x38')](_0xa29a('0x74'))[_0xa29a('0x38')](_0xa29a('0x75'),squel[_0xa29a('0x76')]()[_0xa29a('0x3f')](_0xa29a('0x77'))['from'](_0xa29a('0x78'))[_0xa29a('0x38')](_0xa29a('0x79'),_0x5ded4a[_0xa29a('0x45')]['id'][_0xa29a('0x70')]()))[_0xa29a('0x38')](_0xa29a('0x75'),squel['select']()['field'](_0xa29a('0x7a'))[_0xa29a('0x71')](_0xa29a('0x68'))[_0xa29a('0x38')](_0xa29a('0x79'),_0x5ded4a[_0xa29a('0x45')]['id'][_0xa29a('0x70')]())))[_0xa29a('0x70')]();break;case _0xa29a('0x7b'):_0x5c0f94=squel[_0xa29a('0x7c')]()[_0xa29a('0x67')](_0xa29a('0x68'))[_0xa29a('0x69')](['phone',_0xa29a('0x6b'),_0xa29a('0x6c'),_0xa29a('0x6d'),_0xa29a('0x5d'),_0xa29a('0x53'),'updatedAt'],squel['select']()[_0xa29a('0x3f')](_0xa29a('0x6a'),_0xa29a('0x6a'))['field'](_0xa29a('0x6e'),_0xa29a('0x6b'))[_0xa29a('0x3f')]('id',_0xa29a('0x6c'))[_0xa29a('0x3f')](_0x480a9d[_0xa29a('0x6f')][_0xa29a('0x70')](),_0xa29a('0x6d'))[_0xa29a('0x3f')](_0x5ded4a['params']['id']['toString'](),_0xa29a('0x5d'))['field'](_0xa29a('0x6e'),'createdAt')['field'](_0xa29a('0x6e'),'updatedAt')[_0xa29a('0x71')](_0xa29a('0x72'))[_0xa29a('0x38')]('deletedAt\x20IS\x20NULL')['where'](_0xa29a('0x73'),_0x480a9d[_0xa29a('0x6f')]['toString']())[_0xa29a('0x38')](_0xa29a('0x74'))['where'](_0xa29a('0x75'),squel[_0xa29a('0x76')]()[_0xa29a('0x3f')]('COALESCE(phone,\x27\x27)')[_0xa29a('0x71')](_0xa29a('0x68'))[_0xa29a('0x38')](_0xa29a('0x79'),_0x5ded4a['params']['id'][_0xa29a('0x70')]())))['toString']();break;default:_0x5c0f94=squel[_0xa29a('0x7c')]()[_0xa29a('0x67')](_0xa29a('0x68'))[_0xa29a('0x69')](['phone',_0xa29a('0x6b'),'ContactId',_0xa29a('0x6d'),_0xa29a('0x5d'),_0xa29a('0x53'),_0xa29a('0x54')],squel[_0xa29a('0x76')]()[_0xa29a('0x3f')](_0xa29a('0x6a'),_0xa29a('0x6a'))[_0xa29a('0x3f')]('NOW()',_0xa29a('0x6b'))['field']('id',_0xa29a('0x6c'))[_0xa29a('0x3f')](_0x480a9d[_0xa29a('0x6f')][_0xa29a('0x70')](),_0xa29a('0x6d'))[_0xa29a('0x3f')](_0x5ded4a[_0xa29a('0x45')]['id']['toString'](),'CampaignId')[_0xa29a('0x3f')](_0xa29a('0x6e'),'createdAt')['field']('NOW()',_0xa29a('0x54'))['from'](_0xa29a('0x72'))[_0xa29a('0x38')](_0xa29a('0x7d'))[_0xa29a('0x38')](_0xa29a('0x73'),_0x480a9d[_0xa29a('0x6f')][_0xa29a('0x70')]())[_0xa29a('0x38')](_0xa29a('0x74')))[_0xa29a('0x70')]();}_0x22b585[_0xa29a('0x7e')](db['sequelize'][_0xa29a('0x2e')](_0x5c0f94));}return BPromise[_0xa29a('0x7f')](_0x22b585);}})[_0xa29a('0x22')](function(){return _0x1b6c0b;})[_0xa29a('0x22')](respondWithResult(_0x490b3a,null))[_0xa29a('0x43')](handleError(_0x490b3a,null));};exports['removeLists']=function(_0x345d49,_0x293d61,_0x536a0c){return db[_0xa29a('0x2b')][_0xa29a('0x48')]({'where':{'id':_0x345d49[_0xa29a('0x45')]['id']}})[_0xa29a('0x22')](handleEntityNotFound(_0x293d61,null))[_0xa29a('0x22')](function(_0x5a7945){if(_0x5a7945){return _0x5a7945[_0xa29a('0x80')](_0x345d49[_0xa29a('0x2e')][_0xa29a('0x63')]);}})[_0xa29a('0x22')](function(_0x36283b){if(_0x36283b){return db['CmHopper'][_0xa29a('0x26')]({'where':{'ListId':_0x345d49['query']['ids'],'CampaignId':_0x345d49[_0xa29a('0x45')]['id']}})[_0xa29a('0x22')](function(){return _0x36283b;});}})['then'](respondWithStatusCode(_0x293d61,null))[_0xa29a('0x43')](handleError(_0x293d61,null));};exports['getBlackLists']=function(_0xc55446,_0x5e596f,_0x18dbb2){var _0x4812eb={'raw':!![],'where':{}};var _0x30032d={};var _0x841dd8={'count':0x0,'rows':[]};return db[_0xa29a('0x2b')]['findOne']({'where':{'id':_0xc55446[_0xa29a('0x45')]['id']}})[_0xa29a('0x22')](handleEntityNotFound(_0x5e596f,null))['then'](function(_0x43bc1e){if(_0x43bc1e){_0x30032d[_0xa29a('0x2c')]=_[_0xa29a('0x2d')](db[_0xa29a('0x61')][_0xa29a('0x46')]);_0x30032d[_0xa29a('0x2e')]=_['keys'](_0xc55446[_0xa29a('0x2e')]);_0x30032d[_0xa29a('0x2f')]=_[_0xa29a('0x30')](_0x30032d[_0xa29a('0x2c')],_0x30032d[_0xa29a('0x2e')]);_0x4812eb['attributes']=_['intersection'](_0x30032d[_0xa29a('0x2c')],qs[_0xa29a('0x32')](_0xc55446[_0xa29a('0x2e')][_0xa29a('0x32')]));_0x4812eb['attributes']=_0x4812eb[_0xa29a('0x31')][_0xa29a('0x33')]?_0x4812eb['attributes']:_0x30032d[_0xa29a('0x2c')];if(!_0xc55446[_0xa29a('0x2e')]['hasOwnProperty'](_0xa29a('0x35'))){_0x4812eb[_0xa29a('0x1d')]=qs[_0xa29a('0x1d')](_0xc55446[_0xa29a('0x2e')][_0xa29a('0x1d')]);_0x4812eb[_0xa29a('0x1c')]=qs[_0xa29a('0x1c')](_0xc55446[_0xa29a('0x2e')][_0xa29a('0x1c')]);}_0x4812eb[_0xa29a('0x36')]=qs[_0xa29a('0x37')](_0xc55446['query']['sort']);_0x4812eb[_0xa29a('0x38')]=qs[_0xa29a('0x2f')](_[_0xa29a('0x39')](_0xc55446[_0xa29a('0x2e')],_0x30032d[_0xa29a('0x2f')]));_0x4812eb[_0xa29a('0x38')]['CampaignId']=_0x43bc1e['id'];if(_0xc55446[_0xa29a('0x2e')][_0xa29a('0x3a')]){_0x4812eb[_0xa29a('0x38')]=_[_0xa29a('0x3b')](_0x4812eb[_0xa29a('0x38')],{'$or':_[_0xa29a('0x3c')](_0x4812eb[_0xa29a('0x31')],function(_0x3c9715){var _0x4370e7={};_0x4370e7[_0x3c9715]={'$like':'%'+_0xc55446[_0xa29a('0x2e')]['filter']+'%'};return _0x4370e7;})});}_0x4812eb=_[_0xa29a('0x3b')]({},_0x4812eb,_0xc55446[_0xa29a('0x40')]);return db[_0xa29a('0x61')][_0xa29a('0x1b')]({'where':_0x4812eb[_0xa29a('0x38')]})[_0xa29a('0x22')](function(_0x22994a){_0x841dd8[_0xa29a('0x1b')]=_0x22994a;if(_0xc55446[_0xa29a('0x2e')][_0xa29a('0x41')]){_0x4812eb[_0xa29a('0x47')]=[{'all':!![]}];}return db['CmList'][_0xa29a('0x42')](_0x4812eb);})[_0xa29a('0x22')](function(_0x47fd7f){_0x841dd8[_0xa29a('0x5a')]=_0x47fd7f;return _0x841dd8;});}})[_0xa29a('0x22')](respondWithFilteredResult(_0x5e596f,_0x4812eb))[_0xa29a('0x43')](handleError(_0x5e596f,null));};exports[_0xa29a('0x81')]=function(_0x2d4db8,_0x372319,_0x51da80){var _0x588d9d,_0x19a9e8;return db[_0xa29a('0x2b')][_0xa29a('0x48')]({'where':{'id':_0x2d4db8['params']['id']}})[_0xa29a('0x22')](handleEntityNotFound(_0x372319,null))['then'](function(_0x8d0eec){if(_0x8d0eec){_0x19a9e8=_0x8d0eec;return _0x8d0eec[_0xa29a('0x81')](_0x2d4db8['body'][_0xa29a('0x63')],_[_0xa29a('0x52')](_0x2d4db8[_0xa29a('0x4a')],[_0xa29a('0x63'),'id'])||{});}return null;})['spread'](function(_0x18c7e2){var _0x1b75a6;_0x588d9d=_0x18c7e2||[];var _0x4200b6=[];if(_0x18c7e2){for(var _0x44359a=0x0;_0x44359a<_0x18c7e2[_0xa29a('0x33')];_0x44359a+=0x1){var _0x104980=_0x18c7e2[_0x44359a][_0xa29a('0x23')]({'plain':!![]});_0x1b75a6=squel['insert']()[_0xa29a('0x67')](_0xa29a('0x82'))[_0xa29a('0x69')]([_0xa29a('0x6a'),_0xa29a('0x6c'),_0xa29a('0x6d'),_0xa29a('0x5d'),'createdAt',_0xa29a('0x54')],squel[_0xa29a('0x76')]()[_0xa29a('0x3f')]('phone',_0xa29a('0x6a'))[_0xa29a('0x3f')]('id','ContactId')[_0xa29a('0x3f')](_0x104980['CmListId'][_0xa29a('0x70')](),_0xa29a('0x6d'))[_0xa29a('0x3f')](_0x2d4db8['params']['id'][_0xa29a('0x70')](),_0xa29a('0x5d'))[_0xa29a('0x3f')](_0xa29a('0x6e'),_0xa29a('0x53'))[_0xa29a('0x3f')](_0xa29a('0x6e'),_0xa29a('0x54'))[_0xa29a('0x71')](_0xa29a('0x72'))[_0xa29a('0x38')](_0xa29a('0x7d'))[_0xa29a('0x38')](_0xa29a('0x73'),_0x104980['CmListId'][_0xa29a('0x70')]())[_0xa29a('0x38')](_0xa29a('0x74')))['toString']();_0x4200b6[_0xa29a('0x7e')](db[_0xa29a('0x83')][_0xa29a('0x2e')](_0x1b75a6));}return BPromise['all'](_0x4200b6);}})['then'](function(){return _0x588d9d;})[_0xa29a('0x22')](respondWithResult(_0x372319,null))[_0xa29a('0x43')](handleError(_0x372319,null));};exports['removeBlackLists']=function(_0x35447d,_0x3d2a5b,_0x18d0fd){return db[_0xa29a('0x2b')][_0xa29a('0x48')]({'where':{'id':_0x35447d['params']['id']}})['then'](handleEntityNotFound(_0x3d2a5b,null))[_0xa29a('0x22')](function(_0xc3487e){if(_0xc3487e){return _0xc3487e[_0xa29a('0x84')](_0x35447d[_0xa29a('0x2e')][_0xa29a('0x63')]);}})[_0xa29a('0x22')](function(_0x31c25e){if(_0x31c25e){return db[_0xa29a('0x5f')]['destroy']({'where':{'ListId':_0x35447d[_0xa29a('0x2e')][_0xa29a('0x63')],'CampaignId':_0x35447d[_0xa29a('0x45')]['id']}})[_0xa29a('0x22')](function(){return _0x31c25e;});}})[_0xa29a('0x22')](respondWithStatusCode(_0x3d2a5b,null))[_0xa29a('0x43')](handleError(_0x3d2a5b,null));}; \ No newline at end of file +var _0x3e47=['path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','reject','save','update','then','destroy','get','stack','name','index','Campaign','rawAttributes','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','field','options','count','rows','catch','params','includeAll','include','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','IvrCampaigns','UserProfileSection','find','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','body','createdAt','role','UserProfileResource','getHoppers','findOne','CmHopper','findAll','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','insert','into','ContactId','ListId','updatedAt','select','phone','NOW()','scheduledAt','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','from','CampaignId\x20=\x20?','toString','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','push','all','removeLists','getBlackLists','CmList','cm_hopper_black','sequelize','removeBlackLists','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util'];(function(_0x1636da,_0x53d333){var _0x58e810=function(_0x1cd63c){while(--_0x1cd63c){_0x1636da['push'](_0x1636da['shift']());}};_0x58e810(++_0x53d333);}(_0x3e47,0x173));var _0x73e4=function(_0x52e9e3,_0xe465a7){_0x52e9e3=_0x52e9e3-0x0;var _0x960a8d=_0x3e47[_0x52e9e3];return _0x960a8d;};'use strict';var pdf=require(_0x73e4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x73e4('0x1'));var zipdir=require(_0x73e4('0x2'));var jsonpatch=require(_0x73e4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x73e4('0x4'));var Mustache=require(_0x73e4('0x5'));var util=require(_0x73e4('0x6'));var path=require(_0x73e4('0x7'));var sox=require(_0x73e4('0x8'));var csv=require('to-csv');var ejs=require(_0x73e4('0x9'));var fs=require('fs');var _=require(_0x73e4('0xa'));var squel=require(_0x73e4('0xb'));var crypto=require(_0x73e4('0xc'));var jsforce=require(_0x73e4('0xd'));var deskjs=require(_0x73e4('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x73e4('0xf'));var Redis=require('ioredis');var authService=require(_0x73e4('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x73e4('0x11'))(_0x73e4('0x12'));var utils=require('../../config/utils');var config=require(_0x73e4('0x13'));var db=require(_0x73e4('0x14'))['db'];function respondWithStatusCode(_0x3ac33c,_0x499b5c){_0x499b5c=_0x499b5c||0xcc;return function(_0x452b3c){if(_0x452b3c){return _0x3ac33c[_0x73e4('0x15')](_0x499b5c);}return _0x3ac33c[_0x73e4('0x16')](_0x499b5c)[_0x73e4('0x17')]();};}function respondWithResult(_0x252b19,_0x2a7c0f){_0x2a7c0f=_0x2a7c0f||0xc8;return function(_0x334851){if(_0x334851){return _0x252b19[_0x73e4('0x16')](_0x2a7c0f)[_0x73e4('0x18')](_0x334851);}};}function respondWithFilteredResult(_0x4044e0,_0x5afdbe){return function(_0x11e966){if(_0x11e966){var _0x3be0ea=_0x11e966['count'],_0x3a59d0=_0x5afdbe[_0x73e4('0x19')],_0x325428=_0x5afdbe['offset']+_0x5afdbe[_0x73e4('0x1a')],_0xf2f9ef;if(_0x325428>=_0x3be0ea){_0x325428=_0x3be0ea;_0xf2f9ef=0xc8;}else{_0xf2f9ef=0xce;}_0x4044e0['status'](_0xf2f9ef);return _0x4044e0['set']('Content-Range',_0x3a59d0+'-'+_0x325428+'/'+_0x3be0ea)[_0x73e4('0x18')](_0x11e966);}return null;};}function patchUpdates(_0x3f7dbb){return function(_0x198df8){try{jsonpatch['apply'](_0x198df8,_0x3f7dbb,!![]);}catch(_0x5899dc){return BPromise[_0x73e4('0x1b')](_0x5899dc);}return _0x198df8[_0x73e4('0x1c')]();};}function saveUpdates(_0xfb2f3b,_0x3d210b){return function(_0x50e190){if(_0x50e190){return _0x50e190[_0x73e4('0x1d')](_0xfb2f3b)[_0x73e4('0x1e')](function(_0x21e9e7){return _0x21e9e7;});}return null;};}function removeEntity(_0x2b839b,_0x4b5285){return function(_0x327b63){if(_0x327b63){return _0x327b63[_0x73e4('0x1f')]()['then'](function(){var _0x2bbf8a=_0x327b63[_0x73e4('0x20')]({'plain':!![]});var _0x7d4907='IvrCampaigns';return db['UserProfileResource'][_0x73e4('0x1f')]({'where':{'type':_0x7d4907,'resourceId':_0x2bbf8a['id']}})[_0x73e4('0x1e')](function(){return _0x327b63;});})[_0x73e4('0x1e')](function(){_0x2b839b[_0x73e4('0x16')](0xcc)[_0x73e4('0x17')]();});}};}function handleEntityNotFound(_0x41748a,_0x41ea43){return function(_0x4a6558){if(!_0x4a6558){_0x41748a[_0x73e4('0x15')](0x194);}return _0x4a6558;};}function handleError(_0x55a2c2,_0x4c9199){_0x4c9199=_0x4c9199||0x1f4;return function(_0x44c03f){logger['error'](_0x44c03f[_0x73e4('0x21')]);if(_0x44c03f[_0x73e4('0x22')]){delete _0x44c03f[_0x73e4('0x22')];}_0x55a2c2['status'](_0x4c9199)['send'](_0x44c03f);};}exports[_0x73e4('0x23')]=function(_0x5da3b0,_0x1f92b6){var _0xa62b87={},_0x6071d8={},_0x23046b={'count':0x0,'rows':[]};var _0x53ab96=db[_0x73e4('0x24')][_0x73e4('0x25')];_0x6071d8['model']=_['keys'](_0x53ab96);_0x6071d8[_0x73e4('0x26')]=_[_0x73e4('0x27')](_0x5da3b0[_0x73e4('0x26')]);_0x6071d8['filters']=_[_0x73e4('0x28')](_0x6071d8[_0x73e4('0x29')],_0x6071d8['query']);_0xa62b87[_0x73e4('0x2a')]=_[_0x73e4('0x28')](_0x6071d8[_0x73e4('0x29')],qs[_0x73e4('0x2b')](_0x5da3b0['query'][_0x73e4('0x2b')]));_0xa62b87[_0x73e4('0x2a')]=_0xa62b87['attributes'][_0x73e4('0x2c')]?_0xa62b87['attributes']:_0x6071d8[_0x73e4('0x29')];if(!_0x5da3b0[_0x73e4('0x26')][_0x73e4('0x2d')](_0x73e4('0x2e'))){_0xa62b87[_0x73e4('0x1a')]=qs[_0x73e4('0x1a')](_0x5da3b0[_0x73e4('0x26')][_0x73e4('0x1a')]);_0xa62b87[_0x73e4('0x19')]=qs[_0x73e4('0x19')](_0x5da3b0['query'][_0x73e4('0x19')]);}_0xa62b87[_0x73e4('0x2f')]=qs[_0x73e4('0x30')](_0x5da3b0[_0x73e4('0x26')]['sort']);_0xa62b87[_0x73e4('0x31')]=qs[_0x73e4('0x32')](_[_0x73e4('0x33')](_0x5da3b0[_0x73e4('0x26')],_0x6071d8[_0x73e4('0x32')]));if(_0x5da3b0[_0x73e4('0x26')][_0x73e4('0x34')]){_0xa62b87[_0x73e4('0x31')]=_[_0x73e4('0x35')](_0xa62b87[_0x73e4('0x31')],{'$or':_[_0x73e4('0x36')](_0x53ab96,function(_0x5373f4){if(_0x5373f4['type'][_0x73e4('0x37')]!==_0x73e4('0x38')){var _0x322766={};_0x322766[_0x5373f4[_0x73e4('0x39')]]={'$like':'%'+_0x5da3b0[_0x73e4('0x26')][_0x73e4('0x34')]+'%'};return _0x322766;}})});}_0xa62b87=_['merge']({},_0xa62b87,_0x5da3b0[_0x73e4('0x3a')]);var _0x44b235={'where':_0xa62b87[_0x73e4('0x31')]};return db[_0x73e4('0x24')][_0x73e4('0x3b')](_0x44b235)[_0x73e4('0x1e')](function(_0x17dbef){_0x23046b[_0x73e4('0x3b')]=_0x17dbef;if(_0x5da3b0['query']['includeAll']){_0xa62b87['include']=[{'all':!![]}];}return db[_0x73e4('0x24')]['findAll'](_0xa62b87);})['then'](function(_0x4f8140){_0x23046b[_0x73e4('0x3c')]=_0x4f8140;return _0x23046b;})['then'](respondWithFilteredResult(_0x1f92b6,_0xa62b87))[_0x73e4('0x3d')](handleError(_0x1f92b6,null));};exports['show']=function(_0x25f5ce,_0x163846){var _0x2fa6ef={'raw':![],'where':{'id':_0x25f5ce[_0x73e4('0x3e')]['id']}},_0x3ba214={};_0x3ba214[_0x73e4('0x29')]=_[_0x73e4('0x27')](db['Campaign'][_0x73e4('0x25')]);_0x3ba214[_0x73e4('0x26')]=_[_0x73e4('0x27')](_0x25f5ce[_0x73e4('0x26')]);_0x3ba214['filters']=_[_0x73e4('0x28')](_0x3ba214['model'],_0x3ba214[_0x73e4('0x26')]);_0x2fa6ef[_0x73e4('0x2a')]=_[_0x73e4('0x28')](_0x3ba214[_0x73e4('0x29')],qs[_0x73e4('0x2b')](_0x25f5ce[_0x73e4('0x26')][_0x73e4('0x2b')]));_0x2fa6ef[_0x73e4('0x2a')]=_0x2fa6ef[_0x73e4('0x2a')][_0x73e4('0x2c')]?_0x2fa6ef[_0x73e4('0x2a')]:_0x3ba214[_0x73e4('0x29')];if(_0x25f5ce['query'][_0x73e4('0x3f')]){_0x2fa6ef[_0x73e4('0x40')]=[{'all':!![]}];}_0x2fa6ef=_[_0x73e4('0x35')]({},_0x2fa6ef,_0x25f5ce['options']);return db[_0x73e4('0x24')]['find'](_0x2fa6ef)[_0x73e4('0x1e')](handleEntityNotFound(_0x163846,null))[_0x73e4('0x1e')](respondWithResult(_0x163846,null))[_0x73e4('0x3d')](handleError(_0x163846,null));};exports['create']=function(_0x354052,_0x570960){return db[_0x73e4('0x24')]['create'](_0x354052['body'],{})[_0x73e4('0x1e')](function(_0x347008){var _0x59a171=_0x354052['user']['get']({'plain':!![]});if(!_0x59a171)throw new Error(_0x73e4('0x41'));if(_0x59a171['role']===_0x73e4('0x42')){var _0x13f0b7=_0x347008[_0x73e4('0x20')]({'plain':!![]});var _0x2f814d=_0x73e4('0x43');return db[_0x73e4('0x44')][_0x73e4('0x45')]({'where':{'name':_0x2f814d,'userProfileId':_0x59a171[_0x73e4('0x46')]},'raw':!![]})[_0x73e4('0x1e')](function(_0x1caf77){if(_0x1caf77&&_0x1caf77[_0x73e4('0x47')]===0x0){return db['UserProfileResource'][_0x73e4('0x48')]({'name':_0x13f0b7['name'],'resourceId':_0x13f0b7['id'],'type':_0x1caf77[_0x73e4('0x22')],'sectionId':_0x1caf77['id']},{})['then'](function(){return _0x347008;});}else{return _0x347008;}})[_0x73e4('0x3d')](function(_0x4fa41d){logger[_0x73e4('0x49')](_0x73e4('0x4a'),_0x4fa41d);throw _0x4fa41d;});}return _0x347008;})[_0x73e4('0x1e')](respondWithResult(_0x570960,0xc9))['catch'](handleError(_0x570960,null));};exports[_0x73e4('0x4b')]=function(_0x5cbd53,_0x56e7c2){var _0x525a81={'raw':![],'where':{'id':_0x5cbd53['params']['id']}},_0x2012c1={};_0x2012c1[_0x73e4('0x29')]=_[_0x73e4('0x27')](db[_0x73e4('0x24')][_0x73e4('0x25')]);_0x525a81[_0x73e4('0x2a')]=_['intersection'](_0x2012c1['model'],qs[_0x73e4('0x2b')](_0x5cbd53[_0x73e4('0x26')][_0x73e4('0x2b')]));_0x525a81[_0x73e4('0x2a')]=_0x525a81[_0x73e4('0x2a')][_0x73e4('0x2c')]?_0x525a81[_0x73e4('0x2a')]:_0x2012c1[_0x73e4('0x29')];if(_0x5cbd53[_0x73e4('0x26')][_0x73e4('0x3f')]){_0x525a81[_0x73e4('0x40')]=[{'all':!![]}];}_0x525a81=_[_0x73e4('0x35')]({},_0x525a81,_0x5cbd53[_0x73e4('0x3a')]);return db[_0x73e4('0x24')][_0x73e4('0x45')](_0x525a81)[_0x73e4('0x1e')](handleEntityNotFound(_0x56e7c2,null))['then'](function(_0x2e3b4d){if(_0x2e3b4d){var _0x32ae78=_0x2e3b4d[_0x73e4('0x20')]({'plain':!![]});_0x32ae78=qs[_0x73e4('0x4c')](_0x32ae78,['id','createdAt','updatedAt']);_0x5cbd53[_0x73e4('0x4d')]=_[_0x73e4('0x4c')](_0x5cbd53['body'],['id',_0x73e4('0x4e'),'updatedAt']);return db[_0x73e4('0x24')][_0x73e4('0x48')](_[_0x73e4('0x35')](_0x32ae78,_0x5cbd53['body']),{'include':_0x5cbd53['query'][_0x73e4('0x3f')]?[{'all':!![]}]:undefined})['then'](function(_0x4bd80c){var _0xf7ae43=_0x5cbd53[_0x73e4('0x42')][_0x73e4('0x20')]({'plain':!![]});if(!_0xf7ae43)throw new Error(_0x73e4('0x41'));if(_0xf7ae43[_0x73e4('0x4f')]===_0x73e4('0x42')){var _0x158a5e=_0x4bd80c[_0x73e4('0x20')]({'plain':!![]});var _0x3e3ec2=_0x73e4('0x43');return db[_0x73e4('0x44')][_0x73e4('0x45')]({'where':{'name':_0x3e3ec2,'userProfileId':_0xf7ae43['userProfileId']},'raw':!![]})[_0x73e4('0x1e')](function(_0x1c9162){if(_0x1c9162&&_0x1c9162[_0x73e4('0x47')]===0x0){return db[_0x73e4('0x50')]['create']({'name':_0x158a5e['name'],'resourceId':_0x158a5e['id'],'type':_0x1c9162['name'],'sectionId':_0x1c9162['id']},{})[_0x73e4('0x1e')](function(){return _0x4bd80c;});}else{return _0x4bd80c;}})['catch'](function(_0x30052f){logger['error'](_0x73e4('0x4a'),_0x30052f);throw _0x30052f;});}return _0x4bd80c;});}})['then'](respondWithResult(_0x56e7c2,0xc9))[_0x73e4('0x3d')](handleError(_0x56e7c2,null));};exports[_0x73e4('0x1d')]=function(_0x487745,_0x4e4a82){if(_0x487745[_0x73e4('0x4d')]['id']){delete _0x487745['body']['id'];}return db[_0x73e4('0x24')][_0x73e4('0x45')]({'where':{'id':_0x487745[_0x73e4('0x3e')]['id']}})[_0x73e4('0x1e')](handleEntityNotFound(_0x4e4a82,null))[_0x73e4('0x1e')](saveUpdates(_0x487745[_0x73e4('0x4d')],null))[_0x73e4('0x1e')](respondWithResult(_0x4e4a82,null))[_0x73e4('0x3d')](handleError(_0x4e4a82,null));};exports[_0x73e4('0x1f')]=function(_0x5c630a,_0x6d6079){return db[_0x73e4('0x24')]['find']({'where':{'id':_0x5c630a['params']['id']}})[_0x73e4('0x1e')](handleEntityNotFound(_0x6d6079,null))['then'](removeEntity(_0x6d6079,null))['catch'](handleError(_0x6d6079,null));};exports[_0x73e4('0x51')]=function(_0x29e3b7,_0x142277,_0x5915ea){var _0x50ff5b={'raw':!![],'where':{}};var _0x4f0ddf={};var _0x5522e5={'count':0x0,'rows':[]};return db[_0x73e4('0x24')][_0x73e4('0x52')]({'where':{'id':_0x29e3b7[_0x73e4('0x3e')]['id']}})[_0x73e4('0x1e')](handleEntityNotFound(_0x142277,null))[_0x73e4('0x1e')](function(_0x2c9c70){if(_0x2c9c70){_0x4f0ddf[_0x73e4('0x29')]=_[_0x73e4('0x27')](db[_0x73e4('0x53')][_0x73e4('0x25')]);_0x4f0ddf[_0x73e4('0x26')]=_[_0x73e4('0x27')](_0x29e3b7[_0x73e4('0x26')]);_0x4f0ddf[_0x73e4('0x32')]=_['intersection'](_0x4f0ddf[_0x73e4('0x29')],_0x4f0ddf[_0x73e4('0x26')]);_0x50ff5b[_0x73e4('0x2a')]=_['intersection'](_0x4f0ddf[_0x73e4('0x29')],qs[_0x73e4('0x2b')](_0x29e3b7[_0x73e4('0x26')][_0x73e4('0x2b')]));_0x50ff5b[_0x73e4('0x2a')]=_0x50ff5b[_0x73e4('0x2a')]['length']?_0x50ff5b[_0x73e4('0x2a')]:_0x4f0ddf['model'];if(!_0x29e3b7[_0x73e4('0x26')][_0x73e4('0x2d')]('nolimit')){_0x50ff5b[_0x73e4('0x1a')]=qs[_0x73e4('0x1a')](_0x29e3b7[_0x73e4('0x26')][_0x73e4('0x1a')]);_0x50ff5b[_0x73e4('0x19')]=qs[_0x73e4('0x19')](_0x29e3b7[_0x73e4('0x26')][_0x73e4('0x19')]);}_0x50ff5b[_0x73e4('0x2f')]=qs[_0x73e4('0x30')](_0x29e3b7[_0x73e4('0x26')][_0x73e4('0x30')]);_0x50ff5b[_0x73e4('0x31')]=qs[_0x73e4('0x32')](_[_0x73e4('0x33')](_0x29e3b7[_0x73e4('0x26')],_0x4f0ddf[_0x73e4('0x32')]));_0x50ff5b[_0x73e4('0x31')]['CampaignId']=_0x2c9c70['id'];if(_0x29e3b7[_0x73e4('0x26')][_0x73e4('0x34')]){_0x50ff5b[_0x73e4('0x31')]=_['merge'](_0x50ff5b[_0x73e4('0x31')],{'$or':_['map'](_0x50ff5b[_0x73e4('0x2a')],function(_0x57d2fc){var _0x448a1d={};_0x448a1d[_0x57d2fc]={'$like':'%'+_0x29e3b7[_0x73e4('0x26')][_0x73e4('0x34')]+'%'};return _0x448a1d;})});}_0x50ff5b=_[_0x73e4('0x35')]({},_0x50ff5b,_0x29e3b7[_0x73e4('0x3a')]);return db[_0x73e4('0x53')][_0x73e4('0x3b')]({'where':_0x50ff5b[_0x73e4('0x31')]})[_0x73e4('0x1e')](function(_0x5b323a){_0x5522e5[_0x73e4('0x3b')]=_0x5b323a;if(_0x29e3b7[_0x73e4('0x26')]['includeAll']){_0x50ff5b['include']=[{'all':!![]}];}return db[_0x73e4('0x53')][_0x73e4('0x54')](_0x50ff5b);})[_0x73e4('0x1e')](function(_0x3c210a){_0x5522e5[_0x73e4('0x3c')]=_0x3c210a;return _0x5522e5;});}})[_0x73e4('0x1e')](respondWithFilteredResult(_0x142277,_0x50ff5b))['catch'](handleError(_0x142277,null));};exports[_0x73e4('0x55')]=function(_0x206ed2,_0x534354,_0x4e46c3){var _0x121510={'raw':!![],'where':{}};var _0x4d2d10={};var _0x448db9={'count':0x0,'rows':[]};return db['Campaign'][_0x73e4('0x52')]({'where':{'id':_0x206ed2[_0x73e4('0x3e')]['id']}})[_0x73e4('0x1e')](handleEntityNotFound(_0x534354,null))[_0x73e4('0x1e')](function(_0x57ba65){if(_0x57ba65){_0x4d2d10['model']=_[_0x73e4('0x27')](db[_0x73e4('0x56')][_0x73e4('0x25')]);_0x4d2d10['query']=_[_0x73e4('0x27')](_0x206ed2[_0x73e4('0x26')]);_0x4d2d10[_0x73e4('0x32')]=_[_0x73e4('0x28')](_0x4d2d10['model'],_0x4d2d10[_0x73e4('0x26')]);_0x121510[_0x73e4('0x2a')]=_['intersection'](_0x4d2d10['model'],qs[_0x73e4('0x2b')](_0x206ed2[_0x73e4('0x26')][_0x73e4('0x2b')]));_0x121510['attributes']=_0x121510[_0x73e4('0x2a')]['length']?_0x121510[_0x73e4('0x2a')]:_0x4d2d10[_0x73e4('0x29')];if(!_0x206ed2[_0x73e4('0x26')]['hasOwnProperty']('nolimit')){_0x121510[_0x73e4('0x1a')]=qs[_0x73e4('0x1a')](_0x206ed2[_0x73e4('0x26')][_0x73e4('0x1a')]);_0x121510[_0x73e4('0x19')]=qs['offset'](_0x206ed2['query'][_0x73e4('0x19')]);}_0x121510[_0x73e4('0x2f')]=qs[_0x73e4('0x30')](_0x206ed2[_0x73e4('0x26')][_0x73e4('0x30')]);_0x121510['where']=qs[_0x73e4('0x32')](_[_0x73e4('0x33')](_0x206ed2[_0x73e4('0x26')],_0x4d2d10['filters']));_0x121510[_0x73e4('0x31')][_0x73e4('0x57')]=_0x57ba65['id'];if(_0x206ed2[_0x73e4('0x26')][_0x73e4('0x34')]){_0x121510['where']=_[_0x73e4('0x35')](_0x121510[_0x73e4('0x31')],{'$or':_[_0x73e4('0x36')](_0x121510[_0x73e4('0x2a')],function(_0x2fd6ce){var _0x22f920={};_0x22f920[_0x2fd6ce]={'$like':'%'+_0x206ed2[_0x73e4('0x26')]['filter']+'%'};return _0x22f920;})});}_0x121510=_[_0x73e4('0x35')]({},_0x121510,_0x206ed2[_0x73e4('0x3a')]);return db[_0x73e4('0x56')]['count']({'where':_0x121510[_0x73e4('0x31')]})[_0x73e4('0x1e')](function(_0x477aaf){_0x448db9['count']=_0x477aaf;if(_0x206ed2['query']['includeAll']){_0x121510[_0x73e4('0x40')]=[{'all':!![]}];}return db[_0x73e4('0x56')][_0x73e4('0x54')](_0x121510);})[_0x73e4('0x1e')](function(_0x418004){_0x448db9[_0x73e4('0x3c')]=_0x418004;return _0x448db9;});}})['then'](respondWithFilteredResult(_0x534354,_0x121510))[_0x73e4('0x3d')](handleError(_0x534354,null));};exports[_0x73e4('0x58')]=function(_0x5e7d17,_0x4cca34,_0x36f9ee){var _0xf8ce0e={'raw':!![],'where':{}};var _0x4feefe={};var _0x2247fb={'count':0x0,'rows':[]};return db[_0x73e4('0x24')][_0x73e4('0x52')]({'where':{'id':_0x5e7d17[_0x73e4('0x3e')]['id']}})[_0x73e4('0x1e')](handleEntityNotFound(_0x4cca34,null))[_0x73e4('0x1e')](function(_0x5b59bc){if(_0x5b59bc){_0x4feefe[_0x73e4('0x29')]=_['keys'](db[_0x73e4('0x59')]['rawAttributes']);_0x4feefe[_0x73e4('0x26')]=_['keys'](_0x5e7d17['query']);_0x4feefe[_0x73e4('0x32')]=_[_0x73e4('0x28')](_0x4feefe[_0x73e4('0x29')],_0x4feefe[_0x73e4('0x26')]);_0xf8ce0e[_0x73e4('0x2a')]=_[_0x73e4('0x28')](_0x4feefe[_0x73e4('0x29')],qs['fields'](_0x5e7d17[_0x73e4('0x26')]['fields']));_0xf8ce0e[_0x73e4('0x2a')]=_0xf8ce0e['attributes'][_0x73e4('0x2c')]?_0xf8ce0e[_0x73e4('0x2a')]:_0x4feefe[_0x73e4('0x29')];if(!_0x5e7d17[_0x73e4('0x26')][_0x73e4('0x2d')]('nolimit')){_0xf8ce0e[_0x73e4('0x1a')]=qs[_0x73e4('0x1a')](_0x5e7d17['query'][_0x73e4('0x1a')]);_0xf8ce0e[_0x73e4('0x19')]=qs[_0x73e4('0x19')](_0x5e7d17[_0x73e4('0x26')][_0x73e4('0x19')]);}_0xf8ce0e[_0x73e4('0x2f')]=qs[_0x73e4('0x30')](_0x5e7d17[_0x73e4('0x26')][_0x73e4('0x30')]);_0xf8ce0e[_0x73e4('0x31')]=qs['filters'](_[_0x73e4('0x33')](_0x5e7d17[_0x73e4('0x26')],_0x4feefe[_0x73e4('0x32')]));_0xf8ce0e[_0x73e4('0x31')][_0x73e4('0x57')]=_0x5b59bc['id'];if(_0x5e7d17[_0x73e4('0x26')][_0x73e4('0x34')]){_0xf8ce0e['where']=_[_0x73e4('0x35')](_0xf8ce0e[_0x73e4('0x31')],{'$or':_[_0x73e4('0x36')](_0xf8ce0e['attributes'],function(_0x62989e){var _0x4fb0fb={};_0x4fb0fb[_0x62989e]={'$like':'%'+_0x5e7d17['query'][_0x73e4('0x34')]+'%'};return _0x4fb0fb;})});}_0xf8ce0e=_['merge']({},_0xf8ce0e,_0x5e7d17[_0x73e4('0x3a')]);return db['CmHopperFinal'][_0x73e4('0x3b')]({'where':_0xf8ce0e[_0x73e4('0x31')]})['then'](function(_0x4a7adb){_0x2247fb[_0x73e4('0x3b')]=_0x4a7adb;if(_0x5e7d17['query']['includeAll']){_0xf8ce0e[_0x73e4('0x40')]=[{'all':!![]}];}return db[_0x73e4('0x59')][_0x73e4('0x54')](_0xf8ce0e);})[_0x73e4('0x1e')](function(_0x5529bb){_0x2247fb[_0x73e4('0x3c')]=_0x5529bb;return _0x2247fb;});}})[_0x73e4('0x1e')](respondWithFilteredResult(_0x4cca34,_0xf8ce0e))[_0x73e4('0x3d')](handleError(_0x4cca34,null));};exports['getHopperBlacks']=function(_0x50c5e1,_0xf7ae07,_0x3dbe23){var _0x1666f4={'raw':!![],'where':{}};var _0x1b340c={};var _0x3ed5a2={'count':0x0,'rows':[]};return db[_0x73e4('0x24')][_0x73e4('0x52')]({'where':{'id':_0x50c5e1[_0x73e4('0x3e')]['id']}})['then'](handleEntityNotFound(_0xf7ae07,null))[_0x73e4('0x1e')](function(_0x57967a){if(_0x57967a){_0x1b340c[_0x73e4('0x29')]=_[_0x73e4('0x27')](db[_0x73e4('0x5a')][_0x73e4('0x25')]);_0x1b340c[_0x73e4('0x26')]=_['keys'](_0x50c5e1[_0x73e4('0x26')]);_0x1b340c[_0x73e4('0x32')]=_[_0x73e4('0x28')](_0x1b340c[_0x73e4('0x29')],_0x1b340c[_0x73e4('0x26')]);_0x1666f4[_0x73e4('0x2a')]=_[_0x73e4('0x28')](_0x1b340c[_0x73e4('0x29')],qs['fields'](_0x50c5e1[_0x73e4('0x26')][_0x73e4('0x2b')]));_0x1666f4['attributes']=_0x1666f4[_0x73e4('0x2a')][_0x73e4('0x2c')]?_0x1666f4[_0x73e4('0x2a')]:_0x1b340c[_0x73e4('0x29')];if(!_0x50c5e1[_0x73e4('0x26')]['hasOwnProperty'](_0x73e4('0x2e'))){_0x1666f4[_0x73e4('0x1a')]=qs[_0x73e4('0x1a')](_0x50c5e1[_0x73e4('0x26')][_0x73e4('0x1a')]);_0x1666f4[_0x73e4('0x19')]=qs[_0x73e4('0x19')](_0x50c5e1['query'][_0x73e4('0x19')]);}_0x1666f4[_0x73e4('0x2f')]=qs[_0x73e4('0x30')](_0x50c5e1[_0x73e4('0x26')][_0x73e4('0x30')]);_0x1666f4['where']=qs[_0x73e4('0x32')](_['pick'](_0x50c5e1[_0x73e4('0x26')],_0x1b340c['filters']));_0x1666f4[_0x73e4('0x31')]['CampaignId']=_0x57967a['id'];if(_0x50c5e1[_0x73e4('0x26')][_0x73e4('0x34')]){_0x1666f4['where']=_[_0x73e4('0x35')](_0x1666f4['where'],{'$or':_[_0x73e4('0x36')](_0x1666f4[_0x73e4('0x2a')],function(_0x5b8ee7){var _0x269d00={};_0x269d00[_0x5b8ee7]={'$like':'%'+_0x50c5e1['query'][_0x73e4('0x34')]+'%'};return _0x269d00;})});}_0x1666f4=_[_0x73e4('0x35')]({},_0x1666f4,_0x50c5e1[_0x73e4('0x3a')]);return db[_0x73e4('0x5a')][_0x73e4('0x3b')]({'where':_0x1666f4['where']})['then'](function(_0x582658){_0x3ed5a2[_0x73e4('0x3b')]=_0x582658;if(_0x50c5e1[_0x73e4('0x26')]['includeAll']){_0x1666f4[_0x73e4('0x40')]=[{'all':!![]}];}return db[_0x73e4('0x5a')][_0x73e4('0x54')](_0x1666f4);})[_0x73e4('0x1e')](function(_0x4883a6){_0x3ed5a2[_0x73e4('0x3c')]=_0x4883a6;return _0x3ed5a2;});}})[_0x73e4('0x1e')](respondWithFilteredResult(_0xf7ae07,_0x1666f4))[_0x73e4('0x3d')](handleError(_0xf7ae07,null));};exports['getLists']=function(_0x952eac,_0x319deb,_0x3ce535){var _0xdcd29c={};var _0x3a6f3c={};var _0x94d94b;var _0x32e49e;return db[_0x73e4('0x24')]['findOne']({'where':{'id':_0x952eac[_0x73e4('0x3e')]['id']}})['then'](handleEntityNotFound(_0x319deb,null))[_0x73e4('0x1e')](function(_0x5c4f1f){if(_0x5c4f1f){_0x94d94b=_0x5c4f1f;_0x3a6f3c[_0x73e4('0x29')]=_[_0x73e4('0x27')](db['CmList']['rawAttributes']);_0x3a6f3c[_0x73e4('0x26')]=_[_0x73e4('0x27')](_0x952eac['query']);_0x3a6f3c[_0x73e4('0x32')]=_[_0x73e4('0x28')](_0x3a6f3c['model'],_0x3a6f3c[_0x73e4('0x26')]);_0xdcd29c[_0x73e4('0x2a')]=_[_0x73e4('0x28')](_0x3a6f3c['model'],qs[_0x73e4('0x2b')](_0x952eac[_0x73e4('0x26')][_0x73e4('0x2b')]));_0xdcd29c[_0x73e4('0x2a')]=_0xdcd29c[_0x73e4('0x2a')][_0x73e4('0x2c')]?_0xdcd29c[_0x73e4('0x2a')]:_0x3a6f3c['model'];_0xdcd29c[_0x73e4('0x2f')]=qs['sort'](_0x952eac[_0x73e4('0x26')][_0x73e4('0x30')]);_0xdcd29c['where']=qs[_0x73e4('0x32')](_[_0x73e4('0x33')](_0x952eac['query'],_0x3a6f3c[_0x73e4('0x32')]));if(_0x952eac[_0x73e4('0x26')][_0x73e4('0x34')]){_0xdcd29c[_0x73e4('0x31')]=_[_0x73e4('0x35')](_0xdcd29c['where'],{'$or':_['map'](_0xdcd29c[_0x73e4('0x2a')],function(_0x5500e9){var _0x2ad457={};_0x2ad457[_0x5500e9]={'$like':'%'+_0x952eac[_0x73e4('0x26')]['filter']+'%'};return _0x2ad457;})});}_0xdcd29c=_[_0x73e4('0x35')]({},_0xdcd29c,_0x952eac[_0x73e4('0x3a')]);return _0x94d94b[_0x73e4('0x5b')](_0xdcd29c);}})[_0x73e4('0x1e')](function(_0x111228){if(_0x111228){_0x32e49e=_0x111228[_0x73e4('0x2c')];if(!_0x952eac[_0x73e4('0x26')][_0x73e4('0x2d')]('nolimit')){_0xdcd29c[_0x73e4('0x1a')]=qs[_0x73e4('0x1a')](_0x952eac[_0x73e4('0x26')][_0x73e4('0x1a')]);_0xdcd29c[_0x73e4('0x19')]=qs[_0x73e4('0x19')](_0x952eac['query'][_0x73e4('0x19')]);}return _0x94d94b[_0x73e4('0x5b')](_0xdcd29c);}})[_0x73e4('0x1e')](function(_0x2deaa4){if(_0x2deaa4){return _0x2deaa4?{'count':_0x32e49e,'rows':_0x2deaa4}:null;}})[_0x73e4('0x1e')](respondWithResult(_0x319deb,null))[_0x73e4('0x3d')](handleError(_0x319deb,null));};exports['addLists']=function(_0x1cdb56,_0x1869ee,_0x44ae3e){var _0x271ec1,_0x13edf4;return db[_0x73e4('0x24')][_0x73e4('0x45')]({'where':{'id':_0x1cdb56[_0x73e4('0x3e')]['id']}})[_0x73e4('0x1e')](handleEntityNotFound(_0x1869ee,null))['then'](function(_0x14d6a4){if(_0x14d6a4){_0x13edf4=_0x14d6a4;return _0x14d6a4[_0x73e4('0x5c')](_0x1cdb56[_0x73e4('0x4d')][_0x73e4('0x5d')],_[_0x73e4('0x4c')](_0x1cdb56[_0x73e4('0x4d')],[_0x73e4('0x5d'),'id'])||{});}return null;})[_0x73e4('0x5e')](function(_0x26ae2f){var _0x52e599;_0x271ec1=_0x26ae2f||[];var _0xcc25e5=[];if(_0x26ae2f){for(var _0x308efa=0x0;_0x308efa<_0x26ae2f[_0x73e4('0x2c')];_0x308efa+=0x1){var _0xe7bb0e=_0x26ae2f[_0x308efa][_0x73e4('0x20')]({'plain':!![]});_0x13edf4[_0x73e4('0x5f')]=_0x1cdb56[_0x73e4('0x4d')][_0x73e4('0x5f')]?_0x1cdb56[_0x73e4('0x4d')][_0x73e4('0x5f')]:_0x13edf4['dialCheckDuplicateType'];switch(_0x13edf4[_0x73e4('0x5f')]){case'always':_0x52e599=squel[_0x73e4('0x60')]()[_0x73e4('0x61')]('cm_hopper')['fromQuery'](['phone','scheduledAt',_0x73e4('0x62'),_0x73e4('0x63'),_0x73e4('0x57'),'createdAt',_0x73e4('0x64')],squel[_0x73e4('0x65')]()['field'](_0x73e4('0x66'),_0x73e4('0x66'))[_0x73e4('0x39')](_0x73e4('0x67'),_0x73e4('0x68'))[_0x73e4('0x39')]('id','ContactId')[_0x73e4('0x39')](_0xe7bb0e['CmListId']['toString'](),_0x73e4('0x63'))[_0x73e4('0x39')](_0x1cdb56['params']['id']['toString'](),_0x73e4('0x57'))[_0x73e4('0x39')](_0x73e4('0x67'),'createdAt')[_0x73e4('0x39')](_0x73e4('0x67'),_0x73e4('0x64'))['from'](_0x73e4('0x69'))[_0x73e4('0x31')](_0x73e4('0x6a'))[_0x73e4('0x31')](_0x73e4('0x6b'),_0xe7bb0e[_0x73e4('0x6c')]['toString']())['where'](_0x73e4('0x6d'))[_0x73e4('0x31')]('phone\x20NOT\x20IN\x20(?)',squel[_0x73e4('0x65')]()['field'](_0x73e4('0x6e'))[_0x73e4('0x6f')]('cm_hopper_final')[_0x73e4('0x31')](_0x73e4('0x70'),_0x1cdb56[_0x73e4('0x3e')]['id'][_0x73e4('0x71')]()))[_0x73e4('0x31')](_0x73e4('0x72'),squel['select']()[_0x73e4('0x39')](_0x73e4('0x73'))[_0x73e4('0x6f')]('cm_hopper')['where'](_0x73e4('0x70'),_0x1cdb56[_0x73e4('0x3e')]['id'][_0x73e4('0x71')]())))[_0x73e4('0x71')]();break;case _0x73e4('0x74'):_0x52e599=squel[_0x73e4('0x60')]()['into']('cm_hopper')[_0x73e4('0x75')]([_0x73e4('0x66'),_0x73e4('0x68'),_0x73e4('0x62'),_0x73e4('0x63'),'CampaignId',_0x73e4('0x4e'),_0x73e4('0x64')],squel[_0x73e4('0x65')]()['field'](_0x73e4('0x66'),_0x73e4('0x66'))[_0x73e4('0x39')]('NOW()','scheduledAt')[_0x73e4('0x39')]('id',_0x73e4('0x62'))['field'](_0xe7bb0e[_0x73e4('0x6c')]['toString'](),_0x73e4('0x63'))['field'](_0x1cdb56[_0x73e4('0x3e')]['id'][_0x73e4('0x71')](),_0x73e4('0x57'))[_0x73e4('0x39')](_0x73e4('0x67'),_0x73e4('0x4e'))[_0x73e4('0x39')](_0x73e4('0x67'),_0x73e4('0x64'))['from']('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x73e4('0x31')](_0x73e4('0x6b'),_0xe7bb0e['CmListId'][_0x73e4('0x71')]())['where'](_0x73e4('0x6d'))[_0x73e4('0x31')]('phone\x20NOT\x20IN\x20(?)',squel[_0x73e4('0x65')]()[_0x73e4('0x39')](_0x73e4('0x73'))['from']('cm_hopper')[_0x73e4('0x31')]('CampaignId\x20=\x20?',_0x1cdb56[_0x73e4('0x3e')]['id']['toString']())))[_0x73e4('0x71')]();break;default:_0x52e599=squel[_0x73e4('0x60')]()[_0x73e4('0x61')]('cm_hopper')[_0x73e4('0x75')]([_0x73e4('0x66'),_0x73e4('0x68'),_0x73e4('0x62'),_0x73e4('0x63'),_0x73e4('0x57'),'createdAt','updatedAt'],squel[_0x73e4('0x65')]()['field'](_0x73e4('0x66'),_0x73e4('0x66'))[_0x73e4('0x39')](_0x73e4('0x67'),_0x73e4('0x68'))['field']('id','ContactId')[_0x73e4('0x39')](_0xe7bb0e['CmListId']['toString'](),'ListId')['field'](_0x1cdb56[_0x73e4('0x3e')]['id']['toString'](),_0x73e4('0x57'))[_0x73e4('0x39')](_0x73e4('0x67'),_0x73e4('0x4e'))['field'](_0x73e4('0x67'),_0x73e4('0x64'))['from'](_0x73e4('0x69'))[_0x73e4('0x31')](_0x73e4('0x6a'))[_0x73e4('0x31')](_0x73e4('0x6b'),_0xe7bb0e[_0x73e4('0x6c')][_0x73e4('0x71')]())[_0x73e4('0x31')](_0x73e4('0x6d')))[_0x73e4('0x71')]();}_0xcc25e5[_0x73e4('0x76')](db['sequelize']['query'](_0x52e599));}return BPromise[_0x73e4('0x77')](_0xcc25e5);}})[_0x73e4('0x1e')](function(){return _0x271ec1;})[_0x73e4('0x1e')](respondWithResult(_0x1869ee,null))['catch'](handleError(_0x1869ee,null));};exports['removeLists']=function(_0x295ddd,_0x23dd3a,_0x1d1cdf){return db[_0x73e4('0x24')][_0x73e4('0x45')]({'where':{'id':_0x295ddd[_0x73e4('0x3e')]['id']}})[_0x73e4('0x1e')](handleEntityNotFound(_0x23dd3a,null))[_0x73e4('0x1e')](function(_0x4f87c8){if(_0x4f87c8){return _0x4f87c8[_0x73e4('0x78')](_0x295ddd[_0x73e4('0x26')][_0x73e4('0x5d')]);}})[_0x73e4('0x1e')](function(_0x383367){if(_0x383367){return db[_0x73e4('0x53')][_0x73e4('0x1f')]({'where':{'ListId':_0x295ddd[_0x73e4('0x26')]['ids'],'CampaignId':_0x295ddd[_0x73e4('0x3e')]['id']}})[_0x73e4('0x1e')](function(){return _0x383367;});}})['then'](respondWithStatusCode(_0x23dd3a,null))['catch'](handleError(_0x23dd3a,null));};exports[_0x73e4('0x79')]=function(_0x172f09,_0xa7e5f3,_0x3c1214){var _0x1b17ae={'raw':!![],'where':{}};var _0x185572={};var _0x18aff1={'count':0x0,'rows':[]};return db[_0x73e4('0x24')][_0x73e4('0x52')]({'where':{'id':_0x172f09[_0x73e4('0x3e')]['id']}})[_0x73e4('0x1e')](handleEntityNotFound(_0xa7e5f3,null))[_0x73e4('0x1e')](function(_0x3c493a){if(_0x3c493a){_0x185572['model']=_[_0x73e4('0x27')](db['CmList'][_0x73e4('0x25')]);_0x185572[_0x73e4('0x26')]=_[_0x73e4('0x27')](_0x172f09[_0x73e4('0x26')]);_0x185572['filters']=_[_0x73e4('0x28')](_0x185572[_0x73e4('0x29')],_0x185572[_0x73e4('0x26')]);_0x1b17ae['attributes']=_[_0x73e4('0x28')](_0x185572[_0x73e4('0x29')],qs[_0x73e4('0x2b')](_0x172f09['query'][_0x73e4('0x2b')]));_0x1b17ae[_0x73e4('0x2a')]=_0x1b17ae['attributes']['length']?_0x1b17ae[_0x73e4('0x2a')]:_0x185572['model'];if(!_0x172f09[_0x73e4('0x26')][_0x73e4('0x2d')]('nolimit')){_0x1b17ae[_0x73e4('0x1a')]=qs[_0x73e4('0x1a')](_0x172f09[_0x73e4('0x26')][_0x73e4('0x1a')]);_0x1b17ae['offset']=qs[_0x73e4('0x19')](_0x172f09['query'][_0x73e4('0x19')]);}_0x1b17ae[_0x73e4('0x2f')]=qs['sort'](_0x172f09['query']['sort']);_0x1b17ae[_0x73e4('0x31')]=qs[_0x73e4('0x32')](_[_0x73e4('0x33')](_0x172f09[_0x73e4('0x26')],_0x185572[_0x73e4('0x32')]));_0x1b17ae[_0x73e4('0x31')]['CampaignId']=_0x3c493a['id'];if(_0x172f09[_0x73e4('0x26')][_0x73e4('0x34')]){_0x1b17ae[_0x73e4('0x31')]=_[_0x73e4('0x35')](_0x1b17ae[_0x73e4('0x31')],{'$or':_[_0x73e4('0x36')](_0x1b17ae[_0x73e4('0x2a')],function(_0x4d93c8){var _0x4cc75a={};_0x4cc75a[_0x4d93c8]={'$like':'%'+_0x172f09[_0x73e4('0x26')][_0x73e4('0x34')]+'%'};return _0x4cc75a;})});}_0x1b17ae=_['merge']({},_0x1b17ae,_0x172f09['options']);return db[_0x73e4('0x7a')]['count']({'where':_0x1b17ae['where']})[_0x73e4('0x1e')](function(_0x5e8cfc){_0x18aff1['count']=_0x5e8cfc;if(_0x172f09[_0x73e4('0x26')][_0x73e4('0x3f')]){_0x1b17ae['include']=[{'all':!![]}];}return db['CmList'][_0x73e4('0x54')](_0x1b17ae);})[_0x73e4('0x1e')](function(_0x34940d){_0x18aff1['rows']=_0x34940d;return _0x18aff1;});}})[_0x73e4('0x1e')](respondWithFilteredResult(_0xa7e5f3,_0x1b17ae))[_0x73e4('0x3d')](handleError(_0xa7e5f3,null));};exports['addBlackLists']=function(_0x49197a,_0x5ed851,_0x116a1f){var _0x21e855,_0x2a5d68;return db['Campaign']['find']({'where':{'id':_0x49197a[_0x73e4('0x3e')]['id']}})[_0x73e4('0x1e')](handleEntityNotFound(_0x5ed851,null))['then'](function(_0x1b74bc){if(_0x1b74bc){_0x2a5d68=_0x1b74bc;return _0x1b74bc['addBlackLists'](_0x49197a['body'][_0x73e4('0x5d')],_['omit'](_0x49197a[_0x73e4('0x4d')],['ids','id'])||{});}return null;})['spread'](function(_0x1ba875){var _0x370f44;_0x21e855=_0x1ba875||[];var _0x97a343=[];if(_0x1ba875){for(var _0x10e3eb=0x0;_0x10e3eb<_0x1ba875['length'];_0x10e3eb+=0x1){var _0x3eb3cc=_0x1ba875[_0x10e3eb]['get']({'plain':!![]});_0x370f44=squel[_0x73e4('0x60')]()[_0x73e4('0x61')](_0x73e4('0x7b'))[_0x73e4('0x75')]([_0x73e4('0x66'),_0x73e4('0x62'),_0x73e4('0x63'),_0x73e4('0x57'),'createdAt','updatedAt'],squel['select']()[_0x73e4('0x39')]('phone','phone')[_0x73e4('0x39')]('id','ContactId')[_0x73e4('0x39')](_0x3eb3cc[_0x73e4('0x6c')]['toString'](),_0x73e4('0x63'))[_0x73e4('0x39')](_0x49197a['params']['id']['toString'](),_0x73e4('0x57'))['field']('NOW()',_0x73e4('0x4e'))[_0x73e4('0x39')]('NOW()',_0x73e4('0x64'))[_0x73e4('0x6f')](_0x73e4('0x69'))[_0x73e4('0x31')](_0x73e4('0x6a'))['where'](_0x73e4('0x6b'),_0x3eb3cc[_0x73e4('0x6c')][_0x73e4('0x71')]())[_0x73e4('0x31')](_0x73e4('0x6d')))['toString']();_0x97a343[_0x73e4('0x76')](db[_0x73e4('0x7c')][_0x73e4('0x26')](_0x370f44));}return BPromise[_0x73e4('0x77')](_0x97a343);}})[_0x73e4('0x1e')](function(){return _0x21e855;})['then'](respondWithResult(_0x5ed851,null))[_0x73e4('0x3d')](handleError(_0x5ed851,null));};exports[_0x73e4('0x7d')]=function(_0x1416bb,_0x438e3f,_0x451bbf){return db[_0x73e4('0x24')][_0x73e4('0x45')]({'where':{'id':_0x1416bb[_0x73e4('0x3e')]['id']}})[_0x73e4('0x1e')](handleEntityNotFound(_0x438e3f,null))[_0x73e4('0x1e')](function(_0x1c67f5){if(_0x1c67f5){return _0x1c67f5[_0x73e4('0x7d')](_0x1416bb['query'][_0x73e4('0x5d')]);}})[_0x73e4('0x1e')](function(_0x788b9e){if(_0x788b9e){return db[_0x73e4('0x5a')][_0x73e4('0x1f')]({'where':{'ListId':_0x1416bb[_0x73e4('0x26')][_0x73e4('0x5d')],'CampaignId':_0x1416bb['params']['id']}})[_0x73e4('0x1e')](function(){return _0x788b9e;});}})[_0x73e4('0x1e')](respondWithStatusCode(_0x438e3f,null))[_0x73e4('0x3d')](handleError(_0x438e3f,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 9e58383..992da5d 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 _0x3823=['rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x414658,_0x32591f){var _0x3f33b8=function(_0x1ce3f3){while(--_0x1ce3f3){_0x414658['push'](_0x414658['shift']());}};_0x3f33b8(++_0x32591f);}(_0x3823,0x7b));var _0x3382=function(_0x529115,_0x440956){_0x529115=_0x529115-0x0;var _0x1adb01=_0x3823[_0x529115];return _0x1adb01;};'use strict';var _=require(_0x3382('0x0'));var util=require(_0x3382('0x1'));var logger=require('../../config/logger')(_0x3382('0x2'));var moment=require(_0x3382('0x3'));var BPromise=require(_0x3382('0x4'));var rp=require(_0x3382('0x5'));var fs=require('fs');var path=require(_0x3382('0x6'));var rimraf=require(_0x3382('0x7'));var config=require(_0x3382('0x8'));var attributes=require(_0x3382('0x9'));module[_0x3382('0xa')]=function(_0x15c58a,_0x1198f9){return _0x15c58a['define'](_0x3382('0xb'),attributes,{'tableName':_0x3382('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcab3=['bluebird','path','exports','define','Campaign','util','../../config/logger','api','moment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xcab3,0x19a));var _0x3cab=function(_0xef4fa7,_0x464c6c){_0xef4fa7=_0xef4fa7-0x0;var _0x15d6ba=_0xcab3[_0xef4fa7];return _0x15d6ba;};'use strict';var _=require('lodash');var util=require(_0x3cab('0x0'));var logger=require(_0x3cab('0x1'))(_0x3cab('0x2'));var moment=require(_0x3cab('0x3'));var BPromise=require(_0x3cab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3cab('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./campaign.attributes');module[_0x3cab('0x6')]=function(_0x5822cf,_0x3298e0){return _0x5822cf[_0x3cab('0x7')](_0x3cab('0x8'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 45a9f13..80b5380 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 _0x0f17=['options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCampaign','Campaign','findAll'];(function(_0x491e15,_0x19559b){var _0x3a4c39=function(_0x32abae){while(--_0x32abae){_0x491e15['push'](_0x491e15['shift']());}};_0x3a4c39(++_0x19559b);}(_0x0f17,0xe0));var _0x70f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f17[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x70f1('0x0'));var util=require(_0x70f1('0x1'));var moment=require(_0x70f1('0x2'));var BPromise=require(_0x70f1('0x3'));var rs=require(_0x70f1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x70f1('0x5'))['db'];var utils=require(_0x70f1('0x6'));var logger=require(_0x70f1('0x7'))(_0x70f1('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x70f1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x97150d,_0x34283b,_0x499715){return new BPromise(function(_0x26d18,_0x2e8704){return client['request'](_0x97150d,_0x499715)[_0x70f1('0xa')](function(_0x51e0dc){logger[_0x70f1('0xb')](_0x70f1('0xc'),_0x34283b,'request\x20sent');logger[_0x70f1('0xd')](_0x70f1('0xe'),_0x34283b,_0x70f1('0xf'),JSON[_0x70f1('0x10')](_0x51e0dc));if(_0x51e0dc[_0x70f1('0x11')]){if(_0x51e0dc[_0x70f1('0x11')]['code']===0x1f4){logger[_0x70f1('0x11')]('Campaign,\x20%s,\x20%s',_0x34283b,_0x51e0dc[_0x70f1('0x11')][_0x70f1('0x12')]);return _0x2e8704(_0x51e0dc[_0x70f1('0x11')]['message']);}logger['error']('Campaign,\x20%s,\x20%s',_0x34283b,_0x51e0dc[_0x70f1('0x11')]['message']);return _0x26d18(_0x51e0dc[_0x70f1('0x11')]['message']);}else{logger[_0x70f1('0xb')](_0x70f1('0xc'),_0x34283b,_0x70f1('0xf'));_0x26d18(_0x51e0dc[_0x70f1('0x13')]['message']);}})[_0x70f1('0x14')](function(_0x3eff8f){logger[_0x70f1('0x11')](_0x70f1('0xc'),_0x34283b,_0x3eff8f);_0x2e8704(_0x3eff8f);});});}exports[_0x70f1('0x15')]=function(_0x1ad137){var _0x376a1e=this;return new Promise(function(_0x2cd646,_0x114b72){return db[_0x70f1('0x16')][_0x70f1('0x17')]({'raw':_0x1ad137[_0x70f1('0x18')]?_0x1ad137['options'][_0x70f1('0x19')]===undefined?!![]:![]:!![],'where':_0x1ad137[_0x70f1('0x18')]?_0x1ad137['options'][_0x70f1('0x1a')]||null:null,'attributes':_0x1ad137[_0x70f1('0x18')]?_0x1ad137[_0x70f1('0x18')][_0x70f1('0x1b')]||null:null,'limit':_0x1ad137['options']?_0x1ad137['options']['limit']||null:null,'include':_0x1ad137['options']?_0x1ad137['options'][_0x70f1('0x1c')]?_[_0x70f1('0x1d')](_0x1ad137[_0x70f1('0x18')][_0x70f1('0x1c')],function(_0xdc1f0e){return{'model':db[_0xdc1f0e[_0x70f1('0x1e')]],'as':_0xdc1f0e['as'],'attributes':_0xdc1f0e[_0x70f1('0x1b')],'include':_0xdc1f0e[_0x70f1('0x1c')]?_[_0x70f1('0x1d')](_0xdc1f0e['include'],function(_0x2d109c){return{'model':db[_0x2d109c['model']],'as':_0x2d109c['as'],'attributes':_0x2d109c['attributes'],'include':_0x2d109c['include']?_['map'](_0x2d109c[_0x70f1('0x1c')],function(_0xde2907){return{'model':db[_0xde2907[_0x70f1('0x1e')]],'as':_0xde2907['as'],'attributes':_0xde2907['attributes']};}):[]};}):[]};}):[]:[]})[_0x70f1('0xa')](function(_0x23f2a2){logger[_0x70f1('0xb')](_0x70f1('0x15'),_0x1ad137);logger[_0x70f1('0xd')](_0x70f1('0x15'),_0x1ad137,JSON[_0x70f1('0x10')](_0x23f2a2));_0x2cd646(_0x23f2a2);})['catch'](function(_0x198363){logger['error'](_0x70f1('0x15'),_0x198363['message'],_0x1ad137);_0x114b72(_0x376a1e[_0x70f1('0x11')](0x1f4,_0x198363['message']));});});}; \ No newline at end of file +var _0xb817=['attributes','limit','include','map','model','debug','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCampaign','Campaign','findAll','options','where'];(function(_0x2dae91,_0x1300f9){var _0x7dd587=function(_0x403a8b){while(--_0x403a8b){_0x2dae91['push'](_0x2dae91['shift']());}};_0x7dd587(++_0x1300f9);}(_0xb817,0x162));var _0x7b81=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb817[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7b81('0x0'));var BPromise=require(_0x7b81('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b81('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b81('0x3'))(_0x7b81('0x4'));var config=require('../../config/environment');var jayson=require(_0x7b81('0x5'));var client=jayson['client'][_0x7b81('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x505c7a,_0x4bc469,_0x27ad90){return new BPromise(function(_0x12e617,_0x342663){return client[_0x7b81('0x7')](_0x505c7a,_0x27ad90)[_0x7b81('0x8')](function(_0x43b77d){logger[_0x7b81('0x9')](_0x7b81('0xa'),_0x4bc469,_0x7b81('0xb'));logger['debug'](_0x7b81('0xc'),_0x4bc469,_0x7b81('0xb'),JSON[_0x7b81('0xd')](_0x43b77d));if(_0x43b77d[_0x7b81('0xe')]){if(_0x43b77d[_0x7b81('0xe')][_0x7b81('0xf')]===0x1f4){logger[_0x7b81('0xe')](_0x7b81('0xa'),_0x4bc469,_0x43b77d['error'][_0x7b81('0x10')]);return _0x342663(_0x43b77d['error'][_0x7b81('0x10')]);}logger[_0x7b81('0xe')](_0x7b81('0xa'),_0x4bc469,_0x43b77d['error']['message']);return _0x12e617(_0x43b77d[_0x7b81('0xe')][_0x7b81('0x10')]);}else{logger[_0x7b81('0x9')](_0x7b81('0xa'),_0x4bc469,_0x7b81('0xb'));_0x12e617(_0x43b77d['result'][_0x7b81('0x10')]);}})[_0x7b81('0x11')](function(_0x182934){logger[_0x7b81('0xe')](_0x7b81('0xa'),_0x4bc469,_0x182934);_0x342663(_0x182934);});});}exports[_0x7b81('0x12')]=function(_0x8a5df1){var _0x47bd6f=this;return new Promise(function(_0x4ff81f,_0xb14ca9){return db[_0x7b81('0x13')][_0x7b81('0x14')]({'raw':_0x8a5df1['options']?_0x8a5df1['options']['raw']===undefined?!![]:![]:!![],'where':_0x8a5df1['options']?_0x8a5df1[_0x7b81('0x15')][_0x7b81('0x16')]||null:null,'attributes':_0x8a5df1['options']?_0x8a5df1[_0x7b81('0x15')][_0x7b81('0x17')]||null:null,'limit':_0x8a5df1[_0x7b81('0x15')]?_0x8a5df1[_0x7b81('0x15')][_0x7b81('0x18')]||null:null,'include':_0x8a5df1[_0x7b81('0x15')]?_0x8a5df1['options'][_0x7b81('0x19')]?_['map'](_0x8a5df1['options']['include'],function(_0x531305){return{'model':db[_0x531305['model']],'as':_0x531305['as'],'attributes':_0x531305[_0x7b81('0x17')],'include':_0x531305[_0x7b81('0x19')]?_[_0x7b81('0x1a')](_0x531305[_0x7b81('0x19')],function(_0x2bce9b){return{'model':db[_0x2bce9b[_0x7b81('0x1b')]],'as':_0x2bce9b['as'],'attributes':_0x2bce9b[_0x7b81('0x17')],'include':_0x2bce9b[_0x7b81('0x19')]?_[_0x7b81('0x1a')](_0x2bce9b[_0x7b81('0x19')],function(_0x259d0e){return{'model':db[_0x259d0e[_0x7b81('0x1b')]],'as':_0x259d0e['as'],'attributes':_0x259d0e['attributes']};}):[]};}):[]};}):[]:[]})[_0x7b81('0x8')](function(_0x446f65){logger['info'](_0x7b81('0x12'),_0x8a5df1);logger[_0x7b81('0x1c')](_0x7b81('0x12'),_0x8a5df1,JSON[_0x7b81('0xd')](_0x446f65));_0x4ff81f(_0x446f65);})[_0x7b81('0x11')](function(_0x3070b5){logger['error']('GetCampaign',_0x3070b5[_0x7b81('0x10')],_0x8a5df1);_0xb14ca9(_0x47bd6f[_0x7b81('0xe')](0x1f4,_0x3070b5[_0x7b81('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 1eb7308..2126a45 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 _0xc3b6=['destroy','removeLists','removeBlackLists','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','/:id/lists','addLists','addBlackLists','put','update','delete'];(function(_0x3d7645,_0xd64a6){var _0x39845b=function(_0x4e8b4d){while(--_0x4e8b4d){_0x3d7645['push'](_0x3d7645['shift']());}};_0x39845b(++_0xd64a6);}(_0xc3b6,0x1c3));var _0x6c3b=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0xc3b6[_0x381589];return _0x2a075d;};'use strict';var multer=require(_0x6c3b('0x0'));var util=require(_0x6c3b('0x1'));var path=require(_0x6c3b('0x2'));var timeout=require(_0x6c3b('0x3'));var express=require(_0x6c3b('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x6c3b('0x5'));var config=require(_0x6c3b('0x6'));var controller=require('./campaign.controller');router[_0x6c3b('0x7')]('/',auth[_0x6c3b('0x8')](),controller[_0x6c3b('0x9')]);router['get'](_0x6c3b('0xa'),auth['isAuthenticated'](),controller[_0x6c3b('0xb')]);router[_0x6c3b('0x7')](_0x6c3b('0xc'),auth[_0x6c3b('0x8')](),controller['getHoppers']);router[_0x6c3b('0x7')](_0x6c3b('0xd'),auth[_0x6c3b('0x8')](),controller[_0x6c3b('0xe')]);router['get']('/:id/hopper_finals',auth[_0x6c3b('0x8')](),controller[_0x6c3b('0xf')]);router[_0x6c3b('0x7')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x6c3b('0x10')]);router[_0x6c3b('0x7')]('/:id/lists',auth[_0x6c3b('0x8')](),controller[_0x6c3b('0x11')]);router[_0x6c3b('0x7')](_0x6c3b('0x12'),auth[_0x6c3b('0x8')](),controller[_0x6c3b('0x13')]);router[_0x6c3b('0x14')]('/',auth[_0x6c3b('0x8')](),controller['create']);router['post'](_0x6c3b('0x15'),auth[_0x6c3b('0x8')](),controller[_0x6c3b('0x16')]);router[_0x6c3b('0x14')](_0x6c3b('0x17'),auth[_0x6c3b('0x8')](),controller[_0x6c3b('0x18')]);router['post'](_0x6c3b('0x12'),auth['isAuthenticated'](),controller[_0x6c3b('0x19')]);router[_0x6c3b('0x1a')]('/:id',auth[_0x6c3b('0x8')](),controller[_0x6c3b('0x1b')]);router[_0x6c3b('0x1c')](_0x6c3b('0xa'),auth[_0x6c3b('0x8')](),controller[_0x6c3b('0x1d')]);router['delete'](_0x6c3b('0x17'),auth[_0x6c3b('0x8')](),controller[_0x6c3b('0x1e')]);router[_0x6c3b('0x1c')](_0x6c3b('0x12'),auth['isAuthenticated'](),controller[_0x6c3b('0x1f')]);module['exports']=router; \ No newline at end of file +var _0x45eb=['./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','/:id/clone','addLists','/:id','update','delete','destroy','removeLists','/:id/blacklists','removeBlackLists','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x2acc97,_0x3095b5){var _0x24dc67=function(_0x590b0c){while(--_0x590b0c){_0x2acc97['push'](_0x2acc97['shift']());}};_0x24dc67(++_0x3095b5);}(_0x45eb,0x90));var _0xb45e=function(_0x1ee191,_0x2b8c91){_0x1ee191=_0x1ee191-0x0;var _0x5288bc=_0x45eb[_0x1ee191];return _0x5288bc;};'use strict';var multer=require(_0xb45e('0x0'));var util=require('util');var path=require(_0xb45e('0x1'));var timeout=require(_0xb45e('0x2'));var express=require(_0xb45e('0x3'));var router=express['Router']();var auth=require(_0xb45e('0x4'));var interaction=require(_0xb45e('0x5'));var config=require('../../config/environment');var controller=require(_0xb45e('0x6'));router[_0xb45e('0x7')]('/',auth[_0xb45e('0x8')](),controller[_0xb45e('0x9')]);router[_0xb45e('0x7')]('/:id',auth[_0xb45e('0x8')](),controller[_0xb45e('0xa')]);router['get'](_0xb45e('0xb'),auth[_0xb45e('0x8')](),controller['getHoppers']);router[_0xb45e('0x7')]('/:id/hopper_histories',auth[_0xb45e('0x8')](),controller[_0xb45e('0xc')]);router[_0xb45e('0x7')](_0xb45e('0xd'),auth[_0xb45e('0x8')](),controller['getHopperFinals']);router['get'](_0xb45e('0xe'),auth[_0xb45e('0x8')](),controller[_0xb45e('0xf')]);router['get'](_0xb45e('0x10'),auth['isAuthenticated'](),controller[_0xb45e('0x11')]);router[_0xb45e('0x7')]('/:id/blacklists',auth[_0xb45e('0x8')](),controller[_0xb45e('0x12')]);router['post']('/',auth[_0xb45e('0x8')](),controller['create']);router[_0xb45e('0x13')](_0xb45e('0x14'),auth[_0xb45e('0x8')](),controller['clone']);router['post']('/:id/lists',auth[_0xb45e('0x8')](),controller[_0xb45e('0x15')]);router[_0xb45e('0x13')]('/:id/blacklists',auth[_0xb45e('0x8')](),controller['addBlackLists']);router['put'](_0xb45e('0x16'),auth['isAuthenticated'](),controller[_0xb45e('0x17')]);router[_0xb45e('0x18')](_0xb45e('0x16'),auth['isAuthenticated'](),controller[_0xb45e('0x19')]);router[_0xb45e('0x18')](_0xb45e('0x10'),auth['isAuthenticated'](),controller[_0xb45e('0x1a')]);router[_0xb45e('0x18')](_0xb45e('0x1b'),auth[_0xb45e('0x8')](),controller[_0xb45e('0x1c')]);module[_0xb45e('0x1d')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 66b5003..770499d 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 _0xf9f3=['sequelize','STRING','VIRTUAL','getDataValue','key'];(function(_0x49d3b6,_0x32764f){var _0x562c3d=function(_0x254c8d){while(--_0x254c8d){_0x49d3b6['push'](_0x49d3b6['shift']());}};_0x562c3d(++_0x32764f);}(_0xf9f3,0x17c));var _0x3f9f=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xf9f3[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0x3f9f('0x0'));module['exports']={'key':{'type':Sequelize[_0x3f9f('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x3f9f('0x1')]},'name':{'type':Sequelize[_0x3f9f('0x2')],'get':function(){return this[_0x3f9f('0x3')](_0x3f9f('0x4'));}}}; \ No newline at end of file +var _0xc045=['STRING','TEXT','VIRTUAL','getDataValue','key','exports'];(function(_0x21aedb,_0x3c67bf){var _0x2ce48d=function(_0xe0cb8c){while(--_0xe0cb8c){_0x21aedb['push'](_0x21aedb['shift']());}};_0x2ce48d(++_0x3c67bf);}(_0xc045,0x131));var _0x5c04=function(_0x15294d,_0x4f6a0d){_0x15294d=_0x15294d-0x0;var _0x4f6dab=_0xc045[_0x15294d];return _0x4f6dab;};'use strict';var Sequelize=require('sequelize');module[_0x5c04('0x0')]={'key':{'type':Sequelize[_0x5c04('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x5c04('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5c04('0x1')]},'name':{'type':Sequelize[_0x5c04('0x3')],'get':function(){return this[_0x5c04('0x4')](_0x5c04('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index b67f1f3..bf26920 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 _0x77ed=['ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','status','end','count','offset','limit','set','json','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','send','index','CannedAnswer','rawAttributes','model','keys','query','filters','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','catch','show','intersection','length','body','find','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x573d22,_0xcab1c0){var _0x11ddde=function(_0x2a058c){while(--_0x2a058c){_0x573d22['push'](_0x573d22['shift']());}};_0x11ddde(++_0xcab1c0);}(_0x77ed,0x19e));var _0xd77e=function(_0x1e4148,_0x445c72){_0x1e4148=_0x1e4148-0x0;var _0x3d4fd7=_0x77ed[_0x1e4148];return _0x3d4fd7;};'use strict';var pdf=require(_0xd77e('0x0'));var emlformat=require(_0xd77e('0x1'));var rimraf=require(_0xd77e('0x2'));var zipdir=require(_0xd77e('0x3'));var jsonpatch=require(_0xd77e('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd77e('0x5'));var Mustache=require('mustache');var util=require(_0xd77e('0x6'));var path=require(_0xd77e('0x7'));var sox=require('sox');var csv=require(_0xd77e('0x8'));var ejs=require(_0xd77e('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd77e('0xa'));var crypto=require(_0xd77e('0xb'));var jsforce=require(_0xd77e('0xc'));var deskjs=require(_0xd77e('0xd'));var toCsv=require(_0xd77e('0x8'));var querystring=require(_0xd77e('0xe'));var Papa=require(_0xd77e('0xf'));var Redis=require(_0xd77e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd77e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd77e('0x12'))(_0xd77e('0x13'));var utils=require(_0xd77e('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42bf97,_0x1790bf){_0x1790bf=_0x1790bf||0xcc;return function(_0x7054be){if(_0x7054be){return _0x42bf97['sendStatus'](_0x1790bf);}return _0x42bf97[_0xd77e('0x15')](_0x1790bf)[_0xd77e('0x16')]();};}function respondWithResult(_0x5af217,_0x57c97a){_0x57c97a=_0x57c97a||0xc8;return function(_0x2cedb1){if(_0x2cedb1){return _0x5af217[_0xd77e('0x15')](_0x57c97a)['json'](_0x2cedb1);}};}function respondWithFilteredResult(_0x24fa04,_0x316766){return function(_0x41de86){if(_0x41de86){var _0x3dab3d=_0x41de86[_0xd77e('0x17')],_0x5ecc45=_0x316766[_0xd77e('0x18')],_0x47cc2d=_0x316766[_0xd77e('0x18')]+_0x316766[_0xd77e('0x19')],_0x178bba;if(_0x47cc2d>=_0x3dab3d){_0x47cc2d=_0x3dab3d;_0x178bba=0xc8;}else{_0x178bba=0xce;}_0x24fa04['status'](_0x178bba);return _0x24fa04[_0xd77e('0x1a')]('Content-Range',_0x5ecc45+'-'+_0x47cc2d+'/'+_0x3dab3d)[_0xd77e('0x1b')](_0x41de86);}return null;};}function patchUpdates(_0x3d61d6){return function(_0x12d4b9){try{jsonpatch[_0xd77e('0x1c')](_0x12d4b9,_0x3d61d6,!![]);}catch(_0x266ffe){return BPromise[_0xd77e('0x1d')](_0x266ffe);}return _0x12d4b9[_0xd77e('0x1e')]();};}function saveUpdates(_0x5de109,_0x78979f){return function(_0x91a43){if(_0x91a43){return _0x91a43[_0xd77e('0x1f')](_0x5de109)[_0xd77e('0x20')](function(_0x3f747d){return _0x3f747d;});}return null;};}function removeEntity(_0x52807c,_0x4acd8e){return function(_0x24991e){if(_0x24991e){return _0x24991e[_0xd77e('0x21')]()[_0xd77e('0x20')](function(){var _0x3a9a75=_0x24991e[_0xd77e('0x22')]({'plain':!![]});var _0x39d474=_0xd77e('0x23');return db[_0xd77e('0x24')]['destroy']({'where':{'type':_0x39d474,'resourceId':_0x3a9a75['id']}})['then'](function(){return _0x24991e;});})[_0xd77e('0x20')](function(){_0x52807c['status'](0xcc)[_0xd77e('0x16')]();});}};}function handleEntityNotFound(_0x48a7cb,_0x548194){return function(_0x4cc58e){if(!_0x4cc58e){_0x48a7cb[_0xd77e('0x25')](0x194);}return _0x4cc58e;};}function handleError(_0x9d1476,_0x44483d){_0x44483d=_0x44483d||0x1f4;return function(_0x482098){logger[_0xd77e('0x26')](_0x482098['stack']);if(_0x482098['name']){delete _0x482098['name'];}_0x9d1476[_0xd77e('0x15')](_0x44483d)[_0xd77e('0x27')](_0x482098);};}exports[_0xd77e('0x28')]=function(_0x58d8f9,_0x39b325){var _0x249b2c={},_0xb356ad={},_0x56a6fb={'count':0x0,'rows':[]};var _0x3583da=db[_0xd77e('0x29')][_0xd77e('0x2a')];_0xb356ad[_0xd77e('0x2b')]=_[_0xd77e('0x2c')](_0x3583da);_0xb356ad[_0xd77e('0x2d')]=_[_0xd77e('0x2c')](_0x58d8f9[_0xd77e('0x2d')]);_0xb356ad[_0xd77e('0x2e')]=_['intersection'](_0xb356ad[_0xd77e('0x2b')],_0xb356ad[_0xd77e('0x2d')]);_0x249b2c['attributes']=_['intersection'](_0xb356ad[_0xd77e('0x2b')],qs[_0xd77e('0x2f')](_0x58d8f9[_0xd77e('0x2d')][_0xd77e('0x2f')]));_0x249b2c[_0xd77e('0x30')]=_0x249b2c[_0xd77e('0x30')]['length']?_0x249b2c[_0xd77e('0x30')]:_0xb356ad[_0xd77e('0x2b')];if(!_0x58d8f9['query'][_0xd77e('0x31')](_0xd77e('0x32'))){_0x249b2c['limit']=qs[_0xd77e('0x19')](_0x58d8f9[_0xd77e('0x2d')][_0xd77e('0x19')]);_0x249b2c[_0xd77e('0x18')]=qs[_0xd77e('0x18')](_0x58d8f9[_0xd77e('0x2d')][_0xd77e('0x18')]);}_0x249b2c['order']=qs[_0xd77e('0x33')](_0x58d8f9[_0xd77e('0x2d')][_0xd77e('0x33')]);_0x249b2c['where']=qs[_0xd77e('0x2e')](_[_0xd77e('0x34')](_0x58d8f9[_0xd77e('0x2d')],_0xb356ad[_0xd77e('0x2e')]));if(_0x58d8f9[_0xd77e('0x2d')][_0xd77e('0x35')]){_0x249b2c[_0xd77e('0x36')]=_[_0xd77e('0x37')](_0x249b2c[_0xd77e('0x36')],{'$or':_[_0xd77e('0x38')](_0x3583da,function(_0x4245de){if(_0x4245de[_0xd77e('0x39')][_0xd77e('0x3a')]!==_0xd77e('0x3b')){var _0x1822e1={};_0x1822e1[_0x4245de[_0xd77e('0x3c')]]={'$like':'%'+_0x58d8f9[_0xd77e('0x2d')][_0xd77e('0x35')]+'%'};return _0x1822e1;}})});}_0x249b2c=_[_0xd77e('0x37')]({},_0x249b2c,_0x58d8f9[_0xd77e('0x3d')]);var _0x49dee5={'where':_0x249b2c[_0xd77e('0x36')]};return db['CannedAnswer'][_0xd77e('0x17')](_0x49dee5)[_0xd77e('0x20')](function(_0x33fa40){_0x56a6fb[_0xd77e('0x17')]=_0x33fa40;if(_0x58d8f9['query'][_0xd77e('0x3e')]){_0x249b2c[_0xd77e('0x3f')]=[{'all':!![]}];}return db[_0xd77e('0x29')][_0xd77e('0x40')](_0x249b2c);})[_0xd77e('0x20')](function(_0x13cf31){_0x56a6fb['rows']=_0x13cf31;return _0x56a6fb;})['then'](respondWithFilteredResult(_0x39b325,_0x249b2c))[_0xd77e('0x41')](handleError(_0x39b325,null));};exports[_0xd77e('0x42')]=function(_0x462ef7,_0x26c4ff){var _0x290a74={'raw':!![],'where':{'id':_0x462ef7['params']['id']}},_0x5ed285={};_0x5ed285['model']=_['keys'](db[_0xd77e('0x29')][_0xd77e('0x2a')]);_0x5ed285[_0xd77e('0x2d')]=_[_0xd77e('0x2c')](_0x462ef7['query']);_0x5ed285[_0xd77e('0x2e')]=_['intersection'](_0x5ed285[_0xd77e('0x2b')],_0x5ed285[_0xd77e('0x2d')]);_0x290a74[_0xd77e('0x30')]=_[_0xd77e('0x43')](_0x5ed285[_0xd77e('0x2b')],qs[_0xd77e('0x2f')](_0x462ef7[_0xd77e('0x2d')][_0xd77e('0x2f')]));_0x290a74['attributes']=_0x290a74[_0xd77e('0x30')][_0xd77e('0x44')]?_0x290a74['attributes']:_0x5ed285['model'];if(_0x462ef7[_0xd77e('0x2d')]['includeAll']){_0x290a74['include']=[{'all':!![]}];}_0x290a74=_[_0xd77e('0x37')]({},_0x290a74,_0x462ef7[_0xd77e('0x3d')]);return db['CannedAnswer']['find'](_0x290a74)[_0xd77e('0x20')](handleEntityNotFound(_0x26c4ff,null))[_0xd77e('0x20')](respondWithResult(_0x26c4ff,null))['catch'](handleError(_0x26c4ff,null));};exports[_0xd77e('0x1f')]=function(_0x553e66,_0x2f6d99){if(_0x553e66[_0xd77e('0x45')]['id']){delete _0x553e66['body']['id'];}return db['CannedAnswer'][_0xd77e('0x46')]({'where':{'id':_0x553e66[_0xd77e('0x47')]['id']}})[_0xd77e('0x20')](handleEntityNotFound(_0x2f6d99,null))[_0xd77e('0x20')](saveUpdates(_0x553e66[_0xd77e('0x45')],null))['then'](respondWithResult(_0x2f6d99,null))['catch'](handleError(_0x2f6d99,null));};exports['destroy']=function(_0xbf7ed7,_0x2638ea){return db[_0xd77e('0x29')][_0xd77e('0x46')]({'where':{'id':_0xbf7ed7[_0xd77e('0x47')]['id']}})[_0xd77e('0x20')](handleEntityNotFound(_0x2638ea,null))[_0xd77e('0x20')](removeEntity(_0x2638ea,null))['catch'](handleError(_0x2638ea,null));};exports[_0xd77e('0x48')]=function(_0x29dbed,_0x16d65d){var _0x214128={'key':_0x29dbed[_0xd77e('0x45')][_0xd77e('0x3a')]};if(_0x29dbed['body'][_0xd77e('0x49')]){_0x214128[_0xd77e('0x49')]=_0x29dbed[_0xd77e('0x45')][_0xd77e('0x49')];}else if(_0x29dbed[_0xd77e('0x45')][_0xd77e('0x4a')]){_0x214128['SmsAccountId']=_0x29dbed[_0xd77e('0x45')][_0xd77e('0x4a')];}else if(_0x29dbed[_0xd77e('0x45')][_0xd77e('0x4b')]){_0x214128[_0xd77e('0x4b')]=_0x29dbed[_0xd77e('0x45')][_0xd77e('0x4b')];}else if(_0x29dbed['body'][_0xd77e('0x4c')]){_0x214128[_0xd77e('0x4c')]=_0x29dbed[_0xd77e('0x45')][_0xd77e('0x4c')];}return db[_0xd77e('0x29')][_0xd77e('0x46')]({'where':_0x214128})[_0xd77e('0x20')](function(_0x1d707a){if(_0x1d707a){throw new db[(_0xd77e('0x4d'))][(_0xd77e('0x4e'))](_0xd77e('0x4f'));}return db[_0xd77e('0x29')]['create'](_0x29dbed['body']);})[_0xd77e('0x20')](function(_0x5b7cce){var _0x241c9e=_0x29dbed[_0xd77e('0x50')][_0xd77e('0x22')]({'plain':!![]});if(!_0x241c9e)throw new Error(_0xd77e('0x51'));if(_0x241c9e['role']===_0xd77e('0x50')){var _0x4b30ea=_0x5b7cce['get']({'plain':!![]});return db['UserProfileSection'][_0xd77e('0x46')]({'where':{'name':_0xd77e('0x23'),'userProfileId':_0x241c9e[_0xd77e('0x52')]},'raw':!![]})[_0xd77e('0x20')](function(_0x366b4f){if(_0x366b4f&&_0x366b4f[_0xd77e('0x53')]===0x0){return db[_0xd77e('0x24')][_0xd77e('0x48')]({'name':_0x4b30ea[_0xd77e('0x54')],'resourceId':_0x4b30ea['id'],'type':_0x366b4f[_0xd77e('0x54')],'sectionId':_0x366b4f['id']},{})[_0xd77e('0x20')](function(){return _0x5b7cce;});}else{return _0x5b7cce;}})[_0xd77e('0x41')](function(_0x457f99){logger[_0xd77e('0x26')](_0xd77e('0x55'),_0x457f99);throw _0x457f99;});}return _0x5b7cce;})[_0xd77e('0x20')](respondWithResult(_0x16d65d,0xc9))['catch'](handleError(_0x16d65d,null));}; \ No newline at end of file +var _0xca7a=['merge','map','key','VIRTUAL','includeAll','include','findAll','rows','catch','options','find','update','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','reject','save','then','destroy','get','UserProfileResource','error','name','index','CannedAnswer','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filters','filter'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xca7a,0x6d));var _0xaca7=function(_0x48c938,_0x14ac2c){_0x48c938=_0x48c938-0x0;var _0x5625b2=_0xca7a[_0x48c938];return _0x5625b2;};'use strict';var pdf=require(_0xaca7('0x0'));var emlformat=require(_0xaca7('0x1'));var rimraf=require(_0xaca7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaca7('0x3'));var rp=require('request-promise');var moment=require(_0xaca7('0x4'));var BPromise=require(_0xaca7('0x5'));var Mustache=require(_0xaca7('0x6'));var util=require('util');var path=require(_0xaca7('0x7'));var sox=require(_0xaca7('0x8'));var csv=require(_0xaca7('0x9'));var ejs=require(_0xaca7('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xaca7('0xb'));var crypto=require(_0xaca7('0xc'));var jsforce=require(_0xaca7('0xd'));var deskjs=require(_0xaca7('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xaca7('0xf'));var Redis=require('ioredis');var authService=require(_0xaca7('0x10'));var qs=require(_0xaca7('0x11'));var hardwareService=require(_0xaca7('0x12'));var logger=require(_0xaca7('0x13'))('api');var utils=require(_0xaca7('0x14'));var config=require(_0xaca7('0x15'));var db=require(_0xaca7('0x16'))['db'];function respondWithStatusCode(_0x2c57cb,_0x4d60c6){_0x4d60c6=_0x4d60c6||0xcc;return function(_0x293ab8){if(_0x293ab8){return _0x2c57cb[_0xaca7('0x17')](_0x4d60c6);}return _0x2c57cb[_0xaca7('0x18')](_0x4d60c6)[_0xaca7('0x19')]();};}function respondWithResult(_0x335260,_0x3994f4){_0x3994f4=_0x3994f4||0xc8;return function(_0x3367d6){if(_0x3367d6){return _0x335260[_0xaca7('0x18')](_0x3994f4)[_0xaca7('0x1a')](_0x3367d6);}};}function respondWithFilteredResult(_0x5039a6,_0x2c82d5){return function(_0x1cf6e8){if(_0x1cf6e8){var _0x3d1a99=_0x1cf6e8[_0xaca7('0x1b')],_0xc625bb=_0x2c82d5[_0xaca7('0x1c')],_0x304e5a=_0x2c82d5['offset']+_0x2c82d5['limit'],_0x17214f;if(_0x304e5a>=_0x3d1a99){_0x304e5a=_0x3d1a99;_0x17214f=0xc8;}else{_0x17214f=0xce;}_0x5039a6[_0xaca7('0x18')](_0x17214f);return _0x5039a6['set'](_0xaca7('0x1d'),_0xc625bb+'-'+_0x304e5a+'/'+_0x3d1a99)[_0xaca7('0x1a')](_0x1cf6e8);}return null;};}function patchUpdates(_0x535ed1){return function(_0x34a9cd){try{jsonpatch['apply'](_0x34a9cd,_0x535ed1,!![]);}catch(_0x2994db){return BPromise[_0xaca7('0x1e')](_0x2994db);}return _0x34a9cd[_0xaca7('0x1f')]();};}function saveUpdates(_0x5c99ad,_0xab9910){return function(_0x3d9b43){if(_0x3d9b43){return _0x3d9b43['update'](_0x5c99ad)[_0xaca7('0x20')](function(_0x2cd232){return _0x2cd232;});}return null;};}function removeEntity(_0x3d16c5,_0x1a1c97){return function(_0x4bf83b){if(_0x4bf83b){return _0x4bf83b[_0xaca7('0x21')]()[_0xaca7('0x20')](function(){var _0x16044c=_0x4bf83b[_0xaca7('0x22')]({'plain':!![]});var _0x537671='CannedAnswers';return db[_0xaca7('0x23')]['destroy']({'where':{'type':_0x537671,'resourceId':_0x16044c['id']}})[_0xaca7('0x20')](function(){return _0x4bf83b;});})[_0xaca7('0x20')](function(){_0x3d16c5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d80b3,_0xe9d4b1){return function(_0xd3fdc3){if(!_0xd3fdc3){_0x5d80b3[_0xaca7('0x17')](0x194);}return _0xd3fdc3;};}function handleError(_0x19aca6,_0x37f94e){_0x37f94e=_0x37f94e||0x1f4;return function(_0x464a8b){logger[_0xaca7('0x24')](_0x464a8b['stack']);if(_0x464a8b[_0xaca7('0x25')]){delete _0x464a8b['name'];}_0x19aca6[_0xaca7('0x18')](_0x37f94e)['send'](_0x464a8b);};}exports[_0xaca7('0x26')]=function(_0x2e1df2,_0x4a75dd){var _0x2a159f={},_0x1eef78={},_0x35a140={'count':0x0,'rows':[]};var _0x482798=db[_0xaca7('0x27')][_0xaca7('0x28')];_0x1eef78[_0xaca7('0x29')]=_[_0xaca7('0x2a')](_0x482798);_0x1eef78['query']=_[_0xaca7('0x2a')](_0x2e1df2[_0xaca7('0x2b')]);_0x1eef78['filters']=_[_0xaca7('0x2c')](_0x1eef78[_0xaca7('0x29')],_0x1eef78['query']);_0x2a159f['attributes']=_[_0xaca7('0x2c')](_0x1eef78[_0xaca7('0x29')],qs[_0xaca7('0x2d')](_0x2e1df2[_0xaca7('0x2b')]['fields']));_0x2a159f[_0xaca7('0x2e')]=_0x2a159f['attributes'][_0xaca7('0x2f')]?_0x2a159f[_0xaca7('0x2e')]:_0x1eef78[_0xaca7('0x29')];if(!_0x2e1df2[_0xaca7('0x2b')][_0xaca7('0x30')]('nolimit')){_0x2a159f[_0xaca7('0x31')]=qs[_0xaca7('0x31')](_0x2e1df2[_0xaca7('0x2b')]['limit']);_0x2a159f['offset']=qs[_0xaca7('0x1c')](_0x2e1df2[_0xaca7('0x2b')][_0xaca7('0x1c')]);}_0x2a159f[_0xaca7('0x32')]=qs[_0xaca7('0x33')](_0x2e1df2['query'][_0xaca7('0x33')]);_0x2a159f[_0xaca7('0x34')]=qs[_0xaca7('0x35')](_['pick'](_0x2e1df2[_0xaca7('0x2b')],_0x1eef78[_0xaca7('0x35')]));if(_0x2e1df2[_0xaca7('0x2b')][_0xaca7('0x36')]){_0x2a159f['where']=_[_0xaca7('0x37')](_0x2a159f[_0xaca7('0x34')],{'$or':_[_0xaca7('0x38')](_0x482798,function(_0x2e354d){if(_0x2e354d['type'][_0xaca7('0x39')]!==_0xaca7('0x3a')){var _0x280b91={};_0x280b91[_0x2e354d['field']]={'$like':'%'+_0x2e1df2[_0xaca7('0x2b')]['filter']+'%'};return _0x280b91;}})});}_0x2a159f=_[_0xaca7('0x37')]({},_0x2a159f,_0x2e1df2['options']);var _0x33c792={'where':_0x2a159f[_0xaca7('0x34')]};return db[_0xaca7('0x27')][_0xaca7('0x1b')](_0x33c792)[_0xaca7('0x20')](function(_0x2c1593){_0x35a140[_0xaca7('0x1b')]=_0x2c1593;if(_0x2e1df2[_0xaca7('0x2b')][_0xaca7('0x3b')]){_0x2a159f[_0xaca7('0x3c')]=[{'all':!![]}];}return db[_0xaca7('0x27')][_0xaca7('0x3d')](_0x2a159f);})['then'](function(_0x944f0a){_0x35a140[_0xaca7('0x3e')]=_0x944f0a;return _0x35a140;})[_0xaca7('0x20')](respondWithFilteredResult(_0x4a75dd,_0x2a159f))[_0xaca7('0x3f')](handleError(_0x4a75dd,null));};exports['show']=function(_0x53bd94,_0x4bc1bb){var _0x4536c4={'raw':!![],'where':{'id':_0x53bd94['params']['id']}},_0x14c773={};_0x14c773[_0xaca7('0x29')]=_[_0xaca7('0x2a')](db[_0xaca7('0x27')][_0xaca7('0x28')]);_0x14c773[_0xaca7('0x2b')]=_[_0xaca7('0x2a')](_0x53bd94[_0xaca7('0x2b')]);_0x14c773[_0xaca7('0x35')]=_['intersection'](_0x14c773['model'],_0x14c773[_0xaca7('0x2b')]);_0x4536c4['attributes']=_[_0xaca7('0x2c')](_0x14c773[_0xaca7('0x29')],qs['fields'](_0x53bd94[_0xaca7('0x2b')]['fields']));_0x4536c4[_0xaca7('0x2e')]=_0x4536c4[_0xaca7('0x2e')][_0xaca7('0x2f')]?_0x4536c4[_0xaca7('0x2e')]:_0x14c773[_0xaca7('0x29')];if(_0x53bd94[_0xaca7('0x2b')][_0xaca7('0x3b')]){_0x4536c4[_0xaca7('0x3c')]=[{'all':!![]}];}_0x4536c4=_[_0xaca7('0x37')]({},_0x4536c4,_0x53bd94[_0xaca7('0x40')]);return db[_0xaca7('0x27')][_0xaca7('0x41')](_0x4536c4)[_0xaca7('0x20')](handleEntityNotFound(_0x4bc1bb,null))['then'](respondWithResult(_0x4bc1bb,null))[_0xaca7('0x3f')](handleError(_0x4bc1bb,null));};exports[_0xaca7('0x42')]=function(_0x57be3a,_0x326587){if(_0x57be3a[_0xaca7('0x43')]['id']){delete _0x57be3a[_0xaca7('0x43')]['id'];}return db[_0xaca7('0x27')][_0xaca7('0x41')]({'where':{'id':_0x57be3a['params']['id']}})[_0xaca7('0x20')](handleEntityNotFound(_0x326587,null))[_0xaca7('0x20')](saveUpdates(_0x57be3a[_0xaca7('0x43')],null))[_0xaca7('0x20')](respondWithResult(_0x326587,null))[_0xaca7('0x3f')](handleError(_0x326587,null));};exports[_0xaca7('0x21')]=function(_0x167e64,_0x17c2b6){return db[_0xaca7('0x27')][_0xaca7('0x41')]({'where':{'id':_0x167e64[_0xaca7('0x44')]['id']}})[_0xaca7('0x20')](handleEntityNotFound(_0x17c2b6,null))[_0xaca7('0x20')](removeEntity(_0x17c2b6,null))[_0xaca7('0x3f')](handleError(_0x17c2b6,null));};exports[_0xaca7('0x45')]=function(_0x3fe9fb,_0x3ebae0){var _0x27defd={'key':_0x3fe9fb[_0xaca7('0x43')][_0xaca7('0x39')]};if(_0x3fe9fb[_0xaca7('0x43')][_0xaca7('0x46')]){_0x27defd[_0xaca7('0x46')]=_0x3fe9fb[_0xaca7('0x43')][_0xaca7('0x46')];}else if(_0x3fe9fb[_0xaca7('0x43')]['SmsAccountId']){_0x27defd[_0xaca7('0x47')]=_0x3fe9fb[_0xaca7('0x43')][_0xaca7('0x47')];}else if(_0x3fe9fb[_0xaca7('0x43')]['OpenchannelAccountId']){_0x27defd[_0xaca7('0x48')]=_0x3fe9fb[_0xaca7('0x43')][_0xaca7('0x48')];}else if(_0x3fe9fb['body'][_0xaca7('0x49')]){_0x27defd[_0xaca7('0x49')]=_0x3fe9fb[_0xaca7('0x43')][_0xaca7('0x49')];}return db[_0xaca7('0x27')][_0xaca7('0x41')]({'where':_0x27defd})[_0xaca7('0x20')](function(_0x4c63a4){if(_0x4c63a4){throw new db[(_0xaca7('0x4a'))][(_0xaca7('0x4b'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xaca7('0x27')][_0xaca7('0x45')](_0x3fe9fb[_0xaca7('0x43')]);})['then'](function(_0xdbe8d){var _0x186074=_0x3fe9fb[_0xaca7('0x4c')]['get']({'plain':!![]});if(!_0x186074)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x186074['role']===_0xaca7('0x4c')){var _0x104707=_0xdbe8d[_0xaca7('0x22')]({'plain':!![]});return db[_0xaca7('0x4d')]['find']({'where':{'name':_0xaca7('0x4e'),'userProfileId':_0x186074[_0xaca7('0x4f')]},'raw':!![]})[_0xaca7('0x20')](function(_0x18c51e){if(_0x18c51e&&_0x18c51e[_0xaca7('0x50')]===0x0){return db[_0xaca7('0x23')]['create']({'name':_0x104707['name'],'resourceId':_0x104707['id'],'type':_0x18c51e['name'],'sectionId':_0x18c51e['id']},{})[_0xaca7('0x20')](function(){return _0xdbe8d;});}else{return _0xdbe8d;}})[_0xaca7('0x3f')](function(_0xbc8b8f){logger['error'](_0xaca7('0x51'),_0xbc8b8f);throw _0xbc8b8f;});}return _0xdbe8d;})[_0xaca7('0x20')](respondWithResult(_0x3ebae0,0xc9))[_0xaca7('0x3f')](handleError(_0x3ebae0,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 799b418..4ced1b8 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 _0xdb2d=['moment','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xdb2d,0xbf));var _0xddb2=function(_0x1504ad,_0x300199){_0x1504ad=_0x1504ad-0x0;var _0x53e092=_0xdb2d[_0x1504ad];return _0x53e092;};'use strict';var _=require(_0xddb2('0x0'));var util=require(_0xddb2('0x1'));var logger=require(_0xddb2('0x2'))(_0xddb2('0x3'));var moment=require(_0xddb2('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xddb2('0x5'));var rimraf=require(_0xddb2('0x6'));var config=require(_0xddb2('0x7'));var attributes=require(_0xddb2('0x8'));module['exports']=function(_0x59e3d5,_0x1f04a6){return _0x59e3d5[_0xddb2('0x9')](_0xddb2('0xa'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xddb2('0xb'),'collate':_0xddb2('0xc')});}; \ No newline at end of file +var _0x171c=['moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x5aa206,_0x3d4856){var _0x15c2eb=function(_0x3c7579){while(--_0x3c7579){_0x5aa206['push'](_0x5aa206['shift']());}};_0x15c2eb(++_0x3d4856);}(_0x171c,0x165));var _0xc171=function(_0x569a4f,_0x57c44a){_0x569a4f=_0x569a4f-0x0;var _0x95782b=_0x171c[_0x569a4f];return _0x95782b;};'use strict';var _=require(_0xc171('0x0'));var util=require('util');var logger=require(_0xc171('0x1'))(_0xc171('0x2'));var moment=require(_0xc171('0x3'));var BPromise=require(_0xc171('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc171('0x5'));var rimraf=require(_0xc171('0x6'));var config=require(_0xc171('0x7'));var attributes=require(_0xc171('0x8'));module[_0xc171('0x9')]=function(_0x579ce6,_0x8b23b4){return _0x579ce6[_0xc171('0xa')](_0xc171('0xb'),attributes,{'tableName':_0xc171('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc171('0xd'),'collate':_0xc171('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 57db184..e9f3e6c 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 _0x127d=['error','code','CannedAnswer,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','client','http','then','request\x20sent','stringify'];(function(_0x286a9e,_0x46db07){var _0x49ebf9=function(_0x31d048){while(--_0x31d048){_0x286a9e['push'](_0x286a9e['shift']());}};_0x49ebf9(++_0x46db07);}(_0x127d,0x181));var _0xd127=function(_0x2c1a44,_0x5d3d7d){_0x2c1a44=_0x2c1a44-0x0;var _0x27df32=_0x127d[_0x2c1a44];return _0x27df32;};'use strict';var _=require('lodash');var util=require(_0xd127('0x0'));var moment=require(_0xd127('0x1'));var BPromise=require(_0xd127('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd127('0x3'));var logger=require(_0xd127('0x4'))('rpc');var config=require(_0xd127('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd127('0x6')][_0xd127('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5d6344,_0x19a5e8,_0x562e7a){return new BPromise(function(_0x2729c0,_0x3f8845){return client['request'](_0x5d6344,_0x562e7a)[_0xd127('0x8')](function(_0x27a565){logger['info']('CannedAnswer,\x20%s,\x20%s',_0x19a5e8,_0xd127('0x9'));logger['debug']('CannedAnswer,\x20%s,\x20%s,\x20%s',_0x19a5e8,_0xd127('0x9'),JSON[_0xd127('0xa')](_0x27a565));if(_0x27a565['error']){if(_0x27a565[_0xd127('0xb')][_0xd127('0xc')]===0x1f4){logger[_0xd127('0xb')](_0xd127('0xd'),_0x19a5e8,_0x27a565[_0xd127('0xb')][_0xd127('0xe')]);return _0x3f8845(_0x27a565[_0xd127('0xb')]['message']);}logger[_0xd127('0xb')](_0xd127('0xd'),_0x19a5e8,_0x27a565[_0xd127('0xb')][_0xd127('0xe')]);return _0x2729c0(_0x27a565['error'][_0xd127('0xe')]);}else{logger[_0xd127('0xf')](_0xd127('0xd'),_0x19a5e8,'request\x20sent');_0x2729c0(_0x27a565[_0xd127('0x10')][_0xd127('0xe')]);}})[_0xd127('0x11')](function(_0xab9b5d){logger['error'](_0xd127('0xd'),_0x19a5e8,_0xab9b5d);_0x3f8845(_0xab9b5d);});});} \ No newline at end of file +var _0x9cb5=['catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x144a71,_0x42f448){var _0xd1e133=function(_0xa597f6){while(--_0xa597f6){_0x144a71['push'](_0x144a71['shift']());}};_0xd1e133(++_0x42f448);}(_0x9cb5,0x1a3));var _0x59cb=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9cb5[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x59cb('0x0'));var util=require('util');var moment=require(_0x59cb('0x1'));var BPromise=require(_0x59cb('0x2'));var rs=require(_0x59cb('0x3'));var fs=require('fs');var Redis=require(_0x59cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x59cb('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x59cb('0x6'));var jayson=require(_0x59cb('0x7'));var client=jayson[_0x59cb('0x8')][_0x59cb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa5a0d,_0x54c3f7,_0x38bde){return new BPromise(function(_0x5a6ac8,_0x3e652f){return client[_0x59cb('0xa')](_0xa5a0d,_0x38bde)['then'](function(_0x4d0b59){logger['info'](_0x59cb('0xb'),_0x54c3f7,_0x59cb('0xc'));logger[_0x59cb('0xd')](_0x59cb('0xe'),_0x54c3f7,'request\x20sent',JSON[_0x59cb('0xf')](_0x4d0b59));if(_0x4d0b59[_0x59cb('0x10')]){if(_0x4d0b59[_0x59cb('0x10')][_0x59cb('0x11')]===0x1f4){logger[_0x59cb('0x10')](_0x59cb('0xb'),_0x54c3f7,_0x4d0b59['error'][_0x59cb('0x12')]);return _0x3e652f(_0x4d0b59[_0x59cb('0x10')][_0x59cb('0x12')]);}logger['error'](_0x59cb('0xb'),_0x54c3f7,_0x4d0b59[_0x59cb('0x10')][_0x59cb('0x12')]);return _0x5a6ac8(_0x4d0b59['error'][_0x59cb('0x12')]);}else{logger[_0x59cb('0x13')](_0x59cb('0xb'),_0x54c3f7,_0x59cb('0xc'));_0x5a6ac8(_0x4d0b59[_0x59cb('0x14')][_0x59cb('0x12')]);}})[_0x59cb('0x15')](function(_0x12cd87){logger[_0x59cb('0x10')]('CannedAnswer,\x20%s,\x20%s',_0x54c3f7,_0x12cd87);_0x3e652f(_0x12cd87);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 7690edc..5deb3da 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 _0x74c9=['multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x74c9,0xb0));var _0x974c=function(_0x5f18f2,_0x212d51){_0x5f18f2=_0x5f18f2-0x0;var _0x1097a0=_0x74c9[_0x5f18f2];return _0x1097a0;};'use strict';var multer=require(_0x974c('0x0'));var util=require(_0x974c('0x1'));var path=require(_0x974c('0x2'));var timeout=require(_0x974c('0x3'));var express=require(_0x974c('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x974c('0x5'));var config=require(_0x974c('0x6'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0x974c('0x7')](),controller[_0x974c('0x8')]);router['get'](_0x974c('0x9'),auth[_0x974c('0x7')](),controller['show']);router[_0x974c('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x974c('0xb')](_0x974c('0x9'),auth[_0x974c('0x7')](),controller[_0x974c('0xc')]);router[_0x974c('0xd')](_0x974c('0x9'),auth['isAuthenticated'](),controller[_0x974c('0xe')]);module[_0x974c('0xf')]=router; \ No newline at end of file +var _0xfb6d=['destroy','multer','util','express','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','put','delete'];(function(_0x407ffb,_0x5d6dbc){var _0x4d4206=function(_0x1a2b5b){while(--_0x1a2b5b){_0x407ffb['push'](_0x407ffb['shift']());}};_0x4d4206(++_0x5d6dbc);}(_0xfb6d,0xa6));var _0xdfb6=function(_0x242486,_0x24b319){_0x242486=_0x242486-0x0;var _0xb39e4e=_0xfb6d[_0x242486];return _0xb39e4e;};'use strict';var multer=require(_0xdfb6('0x0'));var util=require(_0xdfb6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdfb6('0x2'));var router=express['Router']();var auth=require(_0xdfb6('0x3'));var interaction=require(_0xdfb6('0x4'));var config=require('../../config/environment');var controller=require(_0xdfb6('0x5'));router[_0xdfb6('0x6')]('/',auth[_0xdfb6('0x7')](),controller['index']);router[_0xdfb6('0x6')](_0xdfb6('0x8'),auth[_0xdfb6('0x7')](),controller[_0xdfb6('0x9')]);router[_0xdfb6('0xa')]('/',auth[_0xdfb6('0x7')](),controller[_0xdfb6('0xb')]);router[_0xdfb6('0xc')](_0xdfb6('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xdfb6('0xd')](_0xdfb6('0x8'),auth[_0xdfb6('0x7')](),controller[_0xdfb6('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 0e36216..9f28468 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 _0xd246=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x511de4,_0x5877d4){var _0x3b49af=function(_0x1e76b4){while(--_0x1e76b4){_0x511de4['push'](_0x511de4['shift']());}};_0x3b49af(++_0x5877d4);}(_0xd246,0x1ea));var _0x6d24=function(_0x40956e,_0x26a380){_0x40956e=_0x40956e-0x0;var _0x167445=_0xd246[_0x40956e];return _0x167445;};'use strict';var Sequelize=require(_0x6d24('0x0'));module[_0x6d24('0x1')]={'calldate':{'type':Sequelize[_0x6d24('0x2')],'allowNull':![],'defaultValue':_0x6d24('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x6d24('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x6d24('0x4')]},'channel':{'type':Sequelize[_0x6d24('0x4')]},'dstchannel':{'type':Sequelize[_0x6d24('0x4')]},'lastapp':{'type':Sequelize[_0x6d24('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x6d24('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x6d24('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6d24('0x4')]},'amaflags':{'type':Sequelize[_0x6d24('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x6d24('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x6d24('0x4')]}}; \ No newline at end of file +var _0xd1dd=['STRING','INTEGER','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x1e85b3,_0x11726d){var _0x20835a=function(_0x438dee){while(--_0x438dee){_0x1e85b3['push'](_0x1e85b3['shift']());}};_0x20835a(++_0x11726d);}(_0xd1dd,0xde));var _0xdd1d=function(_0x3ed074,_0x3edf91){_0x3ed074=_0x3ed074-0x0;var _0x3c9e0c=_0xd1dd[_0x3ed074];return _0x3c9e0c;};'use strict';var Sequelize=require('sequelize');module[_0xdd1d('0x0')]={'calldate':{'type':Sequelize[_0xdd1d('0x1')],'allowNull':![],'defaultValue':_0xdd1d('0x2')},'clid':{'type':Sequelize[_0xdd1d('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xdd1d('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xdd1d('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xdd1d('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xdd1d('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xdd1d('0x3')]},'amaflags':{'type':Sequelize[_0xdd1d('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xdd1d('0x3')]},'uniqueid':{'type':Sequelize[_0xdd1d('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xdd1d('0x3')]},'peeraccount':{'type':Sequelize[_0xdd1d('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xdd1d('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index c524863..24f1195 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 _0x803b=['fields','attributes','length','hasOwnProperty','limit','sort','where','pick','filters','merge','map','key','field','options','includeAll','rows','catch','show','include','body','find','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','Cdr','rawAttributes','keys','query','intersection','model'];(function(_0x2ce62c,_0x340208){var _0x35de48=function(_0x5c3182){while(--_0x5c3182){_0x2ce62c['push'](_0x2ce62c['shift']());}};_0x35de48(++_0x340208);}(_0x803b,0x11f));var _0xb803=function(_0x51da15,_0x1b0bde){_0x51da15=_0x51da15-0x0;var _0x2481e1=_0x803b[_0x51da15];return _0x2481e1;};'use strict';var pdf=require(_0xb803('0x0'));var emlformat=require(_0xb803('0x1'));var rimraf=require(_0xb803('0x2'));var zipdir=require(_0xb803('0x3'));var jsonpatch=require(_0xb803('0x4'));var rp=require(_0xb803('0x5'));var moment=require('moment');var BPromise=require(_0xb803('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb803('0x7'));var sox=require(_0xb803('0x8'));var csv=require(_0xb803('0x9'));var ejs=require(_0xb803('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb803('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb803('0xc'));var Redis=require(_0xb803('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb803('0xe'));var logger=require(_0xb803('0xf'))(_0xb803('0x10'));var utils=require(_0xb803('0x11'));var config=require('../../config/environment');var db=require(_0xb803('0x12'))['db'];function respondWithStatusCode(_0x3b96bf,_0x209ad5){_0x209ad5=_0x209ad5||0xcc;return function(_0x21d5af){if(_0x21d5af){return _0x3b96bf[_0xb803('0x13')](_0x209ad5);}return _0x3b96bf[_0xb803('0x14')](_0x209ad5)[_0xb803('0x15')]();};}function respondWithResult(_0x1e4375,_0x37dcb4){_0x37dcb4=_0x37dcb4||0xc8;return function(_0xca29be){if(_0xca29be){return _0x1e4375['status'](_0x37dcb4)['json'](_0xca29be);}};}function respondWithFilteredResult(_0x3f7a6c,_0xc13c4a){return function(_0x4f6b3a){if(_0x4f6b3a){var _0xdfe641=_0x4f6b3a[_0xb803('0x16')],_0x13e46e=_0xc13c4a[_0xb803('0x17')],_0x25a028=_0xc13c4a[_0xb803('0x17')]+_0xc13c4a['limit'],_0x26656e;if(_0x25a028>=_0xdfe641){_0x25a028=_0xdfe641;_0x26656e=0xc8;}else{_0x26656e=0xce;}_0x3f7a6c['status'](_0x26656e);return _0x3f7a6c[_0xb803('0x18')](_0xb803('0x19'),_0x13e46e+'-'+_0x25a028+'/'+_0xdfe641)[_0xb803('0x1a')](_0x4f6b3a);}return null;};}function patchUpdates(_0x3a8beb){return function(_0x5a49f2){try{jsonpatch[_0xb803('0x1b')](_0x5a49f2,_0x3a8beb,!![]);}catch(_0x4235b8){return BPromise[_0xb803('0x1c')](_0x4235b8);}return _0x5a49f2[_0xb803('0x1d')]();};}function saveUpdates(_0x58d74f,_0x245a0f){return function(_0x1a6e32){if(_0x1a6e32){return _0x1a6e32[_0xb803('0x1e')](_0x58d74f)[_0xb803('0x1f')](function(_0x21e0ba){return _0x21e0ba;});}return null;};}function removeEntity(_0xf63f1b,_0x128d12){return function(_0x5d5fbb){if(_0x5d5fbb){return _0x5d5fbb[_0xb803('0x20')]()['then'](function(){_0xf63f1b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9e0d65,_0x7d21fd){return function(_0x489cee){if(!_0x489cee){_0x9e0d65['sendStatus'](0x194);}return _0x489cee;};}function handleError(_0x2fbe55,_0x55a71c){_0x55a71c=_0x55a71c||0x1f4;return function(_0x1dc730){logger[_0xb803('0x21')](_0x1dc730[_0xb803('0x22')]);if(_0x1dc730[_0xb803('0x23')]){delete _0x1dc730['name'];}_0x2fbe55[_0xb803('0x14')](_0x55a71c)[_0xb803('0x24')](_0x1dc730);};}exports['index']=function(_0x13a430,_0x192f41){var _0x380141={},_0x5a5776={},_0x386be1={'count':0x0,'rows':[]};var _0x2eae3d=db[_0xb803('0x25')][_0xb803('0x26')];_0x5a5776['model']=_[_0xb803('0x27')](_0x2eae3d);_0x5a5776[_0xb803('0x28')]=_[_0xb803('0x27')](_0x13a430[_0xb803('0x28')]);_0x5a5776['filters']=_[_0xb803('0x29')](_0x5a5776[_0xb803('0x2a')],_0x5a5776[_0xb803('0x28')]);_0x380141['attributes']=_[_0xb803('0x29')](_0x5a5776['model'],qs[_0xb803('0x2b')](_0x13a430['query'][_0xb803('0x2b')]));_0x380141[_0xb803('0x2c')]=_0x380141[_0xb803('0x2c')][_0xb803('0x2d')]?_0x380141[_0xb803('0x2c')]:_0x5a5776['model'];if(!_0x13a430[_0xb803('0x28')][_0xb803('0x2e')]('nolimit')){_0x380141[_0xb803('0x2f')]=qs['limit'](_0x13a430[_0xb803('0x28')][_0xb803('0x2f')]);_0x380141[_0xb803('0x17')]=qs['offset'](_0x13a430[_0xb803('0x28')]['offset']);}_0x380141['order']=qs[_0xb803('0x30')](_0x13a430[_0xb803('0x28')][_0xb803('0x30')]);_0x380141[_0xb803('0x31')]=qs['filters'](_[_0xb803('0x32')](_0x13a430[_0xb803('0x28')],_0x5a5776[_0xb803('0x33')]));if(_0x13a430[_0xb803('0x28')]['filter']){_0x380141['where']=_[_0xb803('0x34')](_0x380141[_0xb803('0x31')],{'$or':_[_0xb803('0x35')](_0x2eae3d,function(_0x286532){if(_0x286532['type'][_0xb803('0x36')]!=='VIRTUAL'){var _0x40c336={};_0x40c336[_0x286532[_0xb803('0x37')]]={'$like':'%'+_0x13a430['query']['filter']+'%'};return _0x40c336;}})});}_0x380141=_[_0xb803('0x34')]({},_0x380141,_0x13a430[_0xb803('0x38')]);var _0x2f9a6d={'where':_0x380141[_0xb803('0x31')]};return db[_0xb803('0x25')][_0xb803('0x16')](_0x2f9a6d)[_0xb803('0x1f')](function(_0x58b194){_0x386be1[_0xb803('0x16')]=_0x58b194;if(_0x13a430[_0xb803('0x28')][_0xb803('0x39')]){_0x380141['include']=[{'all':!![]}];}return db['Cdr']['findAll'](_0x380141);})[_0xb803('0x1f')](function(_0x431721){_0x386be1[_0xb803('0x3a')]=_0x431721;return _0x386be1;})[_0xb803('0x1f')](respondWithFilteredResult(_0x192f41,_0x380141))[_0xb803('0x3b')](handleError(_0x192f41,null));};exports[_0xb803('0x3c')]=function(_0x5bc766,_0x8ffe00){var _0x1aefef={'raw':!![],'where':{'id':_0x5bc766['params']['id']}},_0xdcc5c6={};_0xdcc5c6[_0xb803('0x2a')]=_['keys'](db[_0xb803('0x25')][_0xb803('0x26')]);_0xdcc5c6[_0xb803('0x28')]=_['keys'](_0x5bc766[_0xb803('0x28')]);_0xdcc5c6['filters']=_[_0xb803('0x29')](_0xdcc5c6[_0xb803('0x2a')],_0xdcc5c6[_0xb803('0x28')]);_0x1aefef[_0xb803('0x2c')]=_[_0xb803('0x29')](_0xdcc5c6[_0xb803('0x2a')],qs[_0xb803('0x2b')](_0x5bc766[_0xb803('0x28')]['fields']));_0x1aefef[_0xb803('0x2c')]=_0x1aefef['attributes'][_0xb803('0x2d')]?_0x1aefef[_0xb803('0x2c')]:_0xdcc5c6[_0xb803('0x2a')];if(_0x5bc766[_0xb803('0x28')]['includeAll']){_0x1aefef[_0xb803('0x3d')]=[{'all':!![]}];}_0x1aefef=_[_0xb803('0x34')]({},_0x1aefef,_0x5bc766[_0xb803('0x38')]);return db[_0xb803('0x25')]['find'](_0x1aefef)[_0xb803('0x1f')](handleEntityNotFound(_0x8ffe00,null))[_0xb803('0x1f')](respondWithResult(_0x8ffe00,null))[_0xb803('0x3b')](handleError(_0x8ffe00,null));};exports['create']=function(_0x36622c,_0x2523ce){return db['Cdr']['create'](_0x36622c[_0xb803('0x3e')],{})[_0xb803('0x1f')](respondWithResult(_0x2523ce,0xc9))[_0xb803('0x3b')](handleError(_0x2523ce,null));};exports[_0xb803('0x1e')]=function(_0xaac3fd,_0x2d9a34){if(_0xaac3fd[_0xb803('0x3e')]['id']){delete _0xaac3fd[_0xb803('0x3e')]['id'];}return db[_0xb803('0x25')][_0xb803('0x3f')]({'where':{'id':_0xaac3fd[_0xb803('0x40')]['id']}})[_0xb803('0x1f')](handleEntityNotFound(_0x2d9a34,null))['then'](saveUpdates(_0xaac3fd[_0xb803('0x3e')],null))[_0xb803('0x1f')](respondWithResult(_0x2d9a34,null))[_0xb803('0x3b')](handleError(_0x2d9a34,null));};exports[_0xb803('0x20')]=function(_0x29afda,_0x15a12b){return db[_0xb803('0x25')][_0xb803('0x3f')]({'where':{'id':_0x29afda[_0xb803('0x40')]['id']}})[_0xb803('0x1f')](handleEntityNotFound(_0x15a12b,null))[_0xb803('0x1f')](removeEntity(_0x15a12b,null))['catch'](handleError(_0x15a12b,null));};exports[_0xb803('0x41')]=function(_0x49816a,_0x1849f1){return db['Cdr']['describe']()[_0xb803('0x1f')](respondWithResult(_0x1849f1,null))['catch'](handleError(_0x1849f1,null));}; \ No newline at end of file +var _0x368f=['html-pdf','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','../../config/license/hardware','api','../../config/utils','../../config/environment','status','json','count','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','index','Cdr','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','offset','order','sort','pick','filter','merge','map','type','key','field','where','findAll','rows','show','params','includeAll','include','options','find','catch','create','body','update','describe'];(function(_0x4e5c37,_0x170d7b){var _0x2a80d1=function(_0x118e40){while(--_0x118e40){_0x4e5c37['push'](_0x4e5c37['shift']());}};_0x2a80d1(++_0x170d7b);}(_0x368f,0x159));var _0xf368=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x368f[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xf368('0x0'));var emlformat=require(_0xf368('0x1'));var rimraf=require(_0xf368('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf368('0x3'));var moment=require('moment');var BPromise=require(_0xf368('0x4'));var Mustache=require('mustache');var util=require(_0xf368('0x5'));var path=require(_0xf368('0x6'));var sox=require(_0xf368('0x7'));var csv=require(_0xf368('0x8'));var ejs=require(_0xf368('0x9'));var fs=require('fs');var _=require(_0xf368('0xa'));var squel=require(_0xf368('0xb'));var crypto=require('crypto');var jsforce=require(_0xf368('0xc'));var deskjs=require(_0xf368('0xd'));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(_0xf368('0xe'));var logger=require('../../config/logger')(_0xf368('0xf'));var utils=require(_0xf368('0x10'));var config=require(_0xf368('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56b1d7,_0x55901e){_0x55901e=_0x55901e||0xcc;return function(_0x3bfcc2){if(_0x3bfcc2){return _0x56b1d7['sendStatus'](_0x55901e);}return _0x56b1d7[_0xf368('0x12')](_0x55901e)['end']();};}function respondWithResult(_0xeb7aa4,_0x5a27ec){_0x5a27ec=_0x5a27ec||0xc8;return function(_0x59bb64){if(_0x59bb64){return _0xeb7aa4[_0xf368('0x12')](_0x5a27ec)[_0xf368('0x13')](_0x59bb64);}};}function respondWithFilteredResult(_0x2df1d9,_0x4f941b){return function(_0x55511a){if(_0x55511a){var _0xd54b9c=_0x55511a[_0xf368('0x14')],_0x446dca=_0x4f941b['offset'],_0x598dd1=_0x4f941b['offset']+_0x4f941b[_0xf368('0x15')],_0x5f30a6;if(_0x598dd1>=_0xd54b9c){_0x598dd1=_0xd54b9c;_0x5f30a6=0xc8;}else{_0x5f30a6=0xce;}_0x2df1d9[_0xf368('0x12')](_0x5f30a6);return _0x2df1d9[_0xf368('0x16')](_0xf368('0x17'),_0x446dca+'-'+_0x598dd1+'/'+_0xd54b9c)[_0xf368('0x13')](_0x55511a);}return null;};}function patchUpdates(_0x613c16){return function(_0x3abb11){try{jsonpatch[_0xf368('0x18')](_0x3abb11,_0x613c16,!![]);}catch(_0x45dcd8){return BPromise[_0xf368('0x19')](_0x45dcd8);}return _0x3abb11[_0xf368('0x1a')]();};}function saveUpdates(_0x2db85c,_0x5da10a){return function(_0x2c15e7){if(_0x2c15e7){return _0x2c15e7['update'](_0x2db85c)[_0xf368('0x1b')](function(_0x2b2057){return _0x2b2057;});}return null;};}function removeEntity(_0x35a6d0,_0x4f02f5){return function(_0x2f7864){if(_0x2f7864){return _0x2f7864[_0xf368('0x1c')]()[_0xf368('0x1b')](function(){_0x35a6d0[_0xf368('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ce0c0,_0xf18997){return function(_0x31bfb5){if(!_0x31bfb5){_0x1ce0c0[_0xf368('0x1d')](0x194);}return _0x31bfb5;};}function handleError(_0x1510a4,_0x4e2551){_0x4e2551=_0x4e2551||0x1f4;return function(_0x4078df){logger[_0xf368('0x1e')](_0x4078df['stack']);if(_0x4078df['name']){delete _0x4078df[_0xf368('0x1f')];}_0x1510a4['status'](_0x4e2551)[_0xf368('0x20')](_0x4078df);};}exports[_0xf368('0x21')]=function(_0x408306,_0x2954ac){var _0x22a0e2={},_0x5e8654={},_0x3929cc={'count':0x0,'rows':[]};var _0x130591=db[_0xf368('0x22')][_0xf368('0x23')];_0x5e8654[_0xf368('0x24')]=_['keys'](_0x130591);_0x5e8654[_0xf368('0x25')]=_[_0xf368('0x26')](_0x408306[_0xf368('0x25')]);_0x5e8654[_0xf368('0x27')]=_[_0xf368('0x28')](_0x5e8654[_0xf368('0x24')],_0x5e8654['query']);_0x22a0e2['attributes']=_[_0xf368('0x28')](_0x5e8654[_0xf368('0x24')],qs[_0xf368('0x29')](_0x408306[_0xf368('0x25')][_0xf368('0x29')]));_0x22a0e2[_0xf368('0x2a')]=_0x22a0e2[_0xf368('0x2a')][_0xf368('0x2b')]?_0x22a0e2[_0xf368('0x2a')]:_0x5e8654[_0xf368('0x24')];if(!_0x408306[_0xf368('0x25')][_0xf368('0x2c')]('nolimit')){_0x22a0e2[_0xf368('0x15')]=qs['limit'](_0x408306['query']['limit']);_0x22a0e2[_0xf368('0x2d')]=qs['offset'](_0x408306[_0xf368('0x25')][_0xf368('0x2d')]);}_0x22a0e2[_0xf368('0x2e')]=qs[_0xf368('0x2f')](_0x408306[_0xf368('0x25')][_0xf368('0x2f')]);_0x22a0e2['where']=qs['filters'](_[_0xf368('0x30')](_0x408306['query'],_0x5e8654[_0xf368('0x27')]));if(_0x408306[_0xf368('0x25')][_0xf368('0x31')]){_0x22a0e2['where']=_[_0xf368('0x32')](_0x22a0e2['where'],{'$or':_[_0xf368('0x33')](_0x130591,function(_0x4b0aa6){if(_0x4b0aa6[_0xf368('0x34')][_0xf368('0x35')]!=='VIRTUAL'){var _0x21e8fc={};_0x21e8fc[_0x4b0aa6[_0xf368('0x36')]]={'$like':'%'+_0x408306['query']['filter']+'%'};return _0x21e8fc;}})});}_0x22a0e2=_[_0xf368('0x32')]({},_0x22a0e2,_0x408306['options']);var _0x2df057={'where':_0x22a0e2[_0xf368('0x37')]};return db[_0xf368('0x22')][_0xf368('0x14')](_0x2df057)[_0xf368('0x1b')](function(_0x366209){_0x3929cc['count']=_0x366209;if(_0x408306['query']['includeAll']){_0x22a0e2['include']=[{'all':!![]}];}return db['Cdr'][_0xf368('0x38')](_0x22a0e2);})[_0xf368('0x1b')](function(_0x4c34f3){_0x3929cc[_0xf368('0x39')]=_0x4c34f3;return _0x3929cc;})[_0xf368('0x1b')](respondWithFilteredResult(_0x2954ac,_0x22a0e2))['catch'](handleError(_0x2954ac,null));};exports[_0xf368('0x3a')]=function(_0x461e65,_0xb0cabf){var _0x37f04f={'raw':!![],'where':{'id':_0x461e65[_0xf368('0x3b')]['id']}},_0x551383={};_0x551383[_0xf368('0x24')]=_[_0xf368('0x26')](db['Cdr'][_0xf368('0x23')]);_0x551383[_0xf368('0x25')]=_[_0xf368('0x26')](_0x461e65[_0xf368('0x25')]);_0x551383[_0xf368('0x27')]=_[_0xf368('0x28')](_0x551383[_0xf368('0x24')],_0x551383[_0xf368('0x25')]);_0x37f04f[_0xf368('0x2a')]=_['intersection'](_0x551383[_0xf368('0x24')],qs[_0xf368('0x29')](_0x461e65[_0xf368('0x25')][_0xf368('0x29')]));_0x37f04f[_0xf368('0x2a')]=_0x37f04f['attributes']['length']?_0x37f04f['attributes']:_0x551383[_0xf368('0x24')];if(_0x461e65['query'][_0xf368('0x3c')]){_0x37f04f[_0xf368('0x3d')]=[{'all':!![]}];}_0x37f04f=_['merge']({},_0x37f04f,_0x461e65[_0xf368('0x3e')]);return db['Cdr'][_0xf368('0x3f')](_0x37f04f)[_0xf368('0x1b')](handleEntityNotFound(_0xb0cabf,null))[_0xf368('0x1b')](respondWithResult(_0xb0cabf,null))[_0xf368('0x40')](handleError(_0xb0cabf,null));};exports[_0xf368('0x41')]=function(_0x357519,_0x21a6b3){return db[_0xf368('0x22')]['create'](_0x357519[_0xf368('0x42')],{})[_0xf368('0x1b')](respondWithResult(_0x21a6b3,0xc9))[_0xf368('0x40')](handleError(_0x21a6b3,null));};exports[_0xf368('0x43')]=function(_0x46a849,_0x2fc701){if(_0x46a849[_0xf368('0x42')]['id']){delete _0x46a849[_0xf368('0x42')]['id'];}return db[_0xf368('0x22')]['find']({'where':{'id':_0x46a849['params']['id']}})['then'](handleEntityNotFound(_0x2fc701,null))['then'](saveUpdates(_0x46a849[_0xf368('0x42')],null))[_0xf368('0x1b')](respondWithResult(_0x2fc701,null))['catch'](handleError(_0x2fc701,null));};exports[_0xf368('0x1c')]=function(_0x10e903,_0x2e7f28){return db[_0xf368('0x22')][_0xf368('0x3f')]({'where':{'id':_0x10e903['params']['id']}})[_0xf368('0x1b')](handleEntityNotFound(_0x2e7f28,null))['then'](removeEntity(_0x2e7f28,null))['catch'](handleError(_0x2e7f28,null));};exports['describe']=function(_0xe7d5fc,_0x56daaf){return db[_0xf368('0x22')][_0xf368('0x44')]()[_0xf368('0x1b')](respondWithResult(_0x56daaf,null))[_0xf368('0x40')](handleError(_0x56daaf,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index a64a83b..9861ef8 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 _0xb5db=['./cdr.attributes','exports','Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x9edfd5,_0x286486){var _0x330738=function(_0x4aceb3){while(--_0x4aceb3){_0x9edfd5['push'](_0x9edfd5['shift']());}};_0x330738(++_0x286486);}(_0xb5db,0x1ea));var _0xbb5d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb5db[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbb5d('0x0'));var util=require(_0xbb5d('0x1'));var logger=require(_0xbb5d('0x2'))(_0xbb5d('0x3'));var moment=require(_0xbb5d('0x4'));var BPromise=require(_0xbb5d('0x5'));var rp=require(_0xbb5d('0x6'));var fs=require('fs');var path=require(_0xbb5d('0x7'));var rimraf=require(_0xbb5d('0x8'));var config=require(_0xbb5d('0x9'));var attributes=require(_0xbb5d('0xa'));module[_0xbb5d('0xb')]=function(_0x2e1422,_0x16da23){return _0x2e1422['define'](_0xbb5d('0xc'),attributes,{'tableName':_0xbb5d('0xd'),'paranoid':![],'indexes':[{'name':_0xbb5d('0xe'),'fields':[_0xbb5d('0xe')]},{'name':_0xbb5d('0xf'),'fields':['calldate']},{'name':_0xbb5d('0x10'),'fields':[_0xbb5d('0x10')]},{'name':_0xbb5d('0x11'),'fields':['dst']},{'name':_0xbb5d('0x12'),'fields':[_0xbb5d('0x12')]},{'name':_0xbb5d('0x13'),'fields':[_0xbb5d('0x13')]}],'timestamps':![]});}; \ No newline at end of file +var _0x35cf=['accountcode','calldate','disposition','dst','src','uniqueid','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr'];(function(_0x347e31,_0x49832b){var _0x316a7a=function(_0x34aeef){while(--_0x34aeef){_0x347e31['push'](_0x347e31['shift']());}};_0x316a7a(++_0x49832b);}(_0x35cf,0x16b));var _0xf35c=function(_0x5027b1,_0x6c2346){_0x5027b1=_0x5027b1-0x0;var _0x5ef581=_0x35cf[_0x5027b1];return _0x5ef581;};'use strict';var _=require('lodash');var util=require(_0xf35c('0x0'));var logger=require(_0xf35c('0x1'))('api');var moment=require(_0xf35c('0x2'));var BPromise=require(_0xf35c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf35c('0x4'));var rimraf=require(_0xf35c('0x5'));var config=require(_0xf35c('0x6'));var attributes=require(_0xf35c('0x7'));module[_0xf35c('0x8')]=function(_0x283802,_0x442112){return _0x283802[_0xf35c('0x9')](_0xf35c('0xa'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':'accountcode','fields':[_0xf35c('0xb')]},{'name':_0xf35c('0xc'),'fields':[_0xf35c('0xc')]},{'name':'disposition','fields':[_0xf35c('0xd')]},{'name':_0xf35c('0xe'),'fields':[_0xf35c('0xe')]},{'name':_0xf35c('0xf'),'fields':[_0xf35c('0xf')]},{'name':_0xf35c('0x10'),'fields':[_0xf35c('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 5f16bae..25a0a49 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 _0x8e75=['randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x38779f,_0x3b15ba){var _0x54b6c3=function(_0x458fd6){while(--_0x458fd6){_0x38779f['push'](_0x38779f['shift']());}};_0x54b6c3(++_0x3b15ba);}(_0x8e75,0x127));var _0x58e7=function(_0x2da71d,_0x34f66b){_0x2da71d=_0x2da71d-0x0;var _0x16c334=_0x8e75[_0x2da71d];return _0x16c334;};'use strict';var _=require(_0x58e7('0x0'));var util=require(_0x58e7('0x1'));var moment=require(_0x58e7('0x2'));var BPromise=require(_0x58e7('0x3'));var rs=require(_0x58e7('0x4'));var fs=require('fs');var Redis=require(_0x58e7('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x58e7('0x6'));var config=require(_0x58e7('0x7'));var jayson=require(_0x58e7('0x8'));var client=jayson[_0x58e7('0x9')][_0x58e7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ba965,_0xc76172,_0x8a94c6){return new BPromise(function(_0x3d6d52,_0x1f5be1){return client[_0x58e7('0xb')](_0x5ba965,_0x8a94c6)[_0x58e7('0xc')](function(_0x21fd60){logger[_0x58e7('0xd')](_0x58e7('0xe'),_0xc76172,_0x58e7('0xf'));logger[_0x58e7('0x10')](_0x58e7('0x11'),_0xc76172,_0x58e7('0xf'),JSON[_0x58e7('0x12')](_0x21fd60));if(_0x21fd60[_0x58e7('0x13')]){if(_0x21fd60[_0x58e7('0x13')][_0x58e7('0x14')]===0x1f4){logger['error'](_0x58e7('0xe'),_0xc76172,_0x21fd60['error'][_0x58e7('0x15')]);return _0x1f5be1(_0x21fd60['error'][_0x58e7('0x15')]);}logger[_0x58e7('0x13')](_0x58e7('0xe'),_0xc76172,_0x21fd60['error'][_0x58e7('0x15')]);return _0x3d6d52(_0x21fd60['error'][_0x58e7('0x15')]);}else{logger['info'](_0x58e7('0xe'),_0xc76172,'request\x20sent');_0x3d6d52(_0x21fd60[_0x58e7('0x16')][_0x58e7('0x15')]);}})['catch'](function(_0x5175e5){logger[_0x58e7('0x13')](_0x58e7('0xe'),_0xc76172,_0x5175e5);_0x1f5be1(_0x5175e5);});});} \ No newline at end of file +var _0xd944=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','Cdr,\x20%s,\x20%s','result'];(function(_0x4e942c,_0x215ddd){var _0x421baa=function(_0x5dd37a){while(--_0x5dd37a){_0x4e942c['push'](_0x4e942c['shift']());}};_0x421baa(++_0x215ddd);}(_0xd944,0x1b1));var _0x4d94=function(_0x18fd88,_0x32fb37){_0x18fd88=_0x18fd88-0x0;var _0xe4298d=_0xd944[_0x18fd88];return _0xe4298d;};'use strict';var _=require(_0x4d94('0x0'));var util=require(_0x4d94('0x1'));var moment=require('moment');var BPromise=require(_0x4d94('0x2'));var rs=require(_0x4d94('0x3'));var fs=require('fs');var Redis=require(_0x4d94('0x4'));var db=require(_0x4d94('0x5'))['db'];var utils=require(_0x4d94('0x6'));var logger=require(_0x4d94('0x7'))(_0x4d94('0x8'));var config=require(_0x4d94('0x9'));var jayson=require(_0x4d94('0xa'));var client=jayson['client'][_0x4d94('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa94273,_0x3cfe58,_0x4a6381){return new BPromise(function(_0x5cb029,_0x5d2747){return client['request'](_0xa94273,_0x4a6381)[_0x4d94('0xc')](function(_0x2687cf){logger['info']('Cdr,\x20%s,\x20%s',_0x3cfe58,_0x4d94('0xd'));logger[_0x4d94('0xe')](_0x4d94('0xf'),_0x3cfe58,'request\x20sent',JSON[_0x4d94('0x10')](_0x2687cf));if(_0x2687cf[_0x4d94('0x11')]){if(_0x2687cf[_0x4d94('0x11')][_0x4d94('0x12')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x3cfe58,_0x2687cf[_0x4d94('0x11')][_0x4d94('0x13')]);return _0x5d2747(_0x2687cf[_0x4d94('0x11')][_0x4d94('0x13')]);}logger['error']('Cdr,\x20%s,\x20%s',_0x3cfe58,_0x2687cf[_0x4d94('0x11')][_0x4d94('0x13')]);return _0x5cb029(_0x2687cf[_0x4d94('0x11')][_0x4d94('0x13')]);}else{logger[_0x4d94('0x14')](_0x4d94('0x15'),_0x3cfe58,_0x4d94('0xd'));_0x5cb029(_0x2687cf[_0x4d94('0x16')]['message']);}})[_0x4d94('0x17')](function(_0x2df8ba){logger['error'](_0x4d94('0x15'),_0x3cfe58,_0x2df8ba);_0x5d2747(_0x2df8ba);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 1e2e140..42878df 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 _0xdb5f=['Router','../../components/auth/service','../../config/environment','./cdr.controller','isAuthenticated','get','describe','/:id','post','create','put','update','delete','exports','multer','util','path','express'];(function(_0x55acd8,_0x1408eb){var _0x28a195=function(_0x1fa7e8){while(--_0x1fa7e8){_0x55acd8['push'](_0x55acd8['shift']());}};_0x28a195(++_0x1408eb);}(_0xdb5f,0x1d0));var _0xfdb5=function(_0x52700f,_0x152e8b){_0x52700f=_0x52700f-0x0;var _0x4a9189=_0xdb5f[_0x52700f];return _0x4a9189;};'use strict';var multer=require(_0xfdb5('0x0'));var util=require(_0xfdb5('0x1'));var path=require(_0xfdb5('0x2'));var timeout=require('connect-timeout');var express=require(_0xfdb5('0x3'));var router=express[_0xfdb5('0x4')]();var auth=require(_0xfdb5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfdb5('0x6'));var controller=require(_0xfdb5('0x7'));router['get']('/',auth[_0xfdb5('0x8')](),controller['index']);router[_0xfdb5('0x9')]('/describe',auth[_0xfdb5('0x8')](),controller[_0xfdb5('0xa')]);router[_0xfdb5('0x9')](_0xfdb5('0xb'),auth[_0xfdb5('0x8')](),controller['show']);router[_0xfdb5('0xc')]('/',auth[_0xfdb5('0x8')](),controller[_0xfdb5('0xd')]);router[_0xfdb5('0xe')](_0xfdb5('0xb'),auth['isAuthenticated'](),controller[_0xfdb5('0xf')]);router[_0xfdb5('0x10')](_0xfdb5('0xb'),auth[_0xfdb5('0x8')](),controller['destroy']);module[_0xfdb5('0x11')]=router; \ No newline at end of file +var _0xceee=['/describe','/:id','show','create','put','delete','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','isAuthenticated','index','get'];(function(_0x100495,_0x1a9b15){var _0x1d538b=function(_0x1265d6){while(--_0x1265d6){_0x100495['push'](_0x100495['shift']());}};_0x1d538b(++_0x1a9b15);}(_0xceee,0xbb));var _0xecee=function(_0x6b2557,_0x4eaeb0){_0x6b2557=_0x6b2557-0x0;var _0x22b36f=_0xceee[_0x6b2557];return _0x22b36f;};'use strict';var multer=require(_0xecee('0x0'));var util=require(_0xecee('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xecee('0x2'));var router=express[_0xecee('0x3')]();var auth=require(_0xecee('0x4'));var interaction=require(_0xecee('0x5'));var config=require(_0xecee('0x6'));var controller=require(_0xecee('0x7'));router['get']('/',auth[_0xecee('0x8')](),controller[_0xecee('0x9')]);router[_0xecee('0xa')](_0xecee('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xecee('0xa')](_0xecee('0xc'),auth['isAuthenticated'](),controller[_0xecee('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xecee('0xe')]);router[_0xecee('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xecee('0x10')]('/:id',auth[_0xecee('0x8')](),controller['destroy']);module[_0xecee('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 7a91e5a..2ed882c 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 _0x6343=['INTEGER','STRING','*,*,*,*'];(function(_0x4eefac,_0x9f654c){var _0x76bbd=function(_0x4b7147){while(--_0x4b7147){_0x4eefac['push'](_0x4eefac['shift']());}};_0x76bbd(++_0x9f654c);}(_0x6343,0x168));var _0x3634=function(_0x1e0594,_0x380128){_0x1e0594=_0x1e0594-0x0;var _0x2b98cb=_0x6343[_0x1e0594];return _0x2b98cb;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x3634('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x3634('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x3634('0x2')}}; \ No newline at end of file +var _0xfc4f=['noop','TEXT','exports','INTEGER','STRING'];(function(_0x54bac5,_0x8d3a16){var _0xc15971=function(_0x254653){while(--_0x254653){_0x54bac5['push'](_0x54bac5['shift']());}};_0xc15971(++_0x8d3a16);}(_0xfc4f,0x192));var _0xffc4=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xfc4f[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0xffc4('0x0')]={'priority':{'type':Sequelize[_0xffc4('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xffc4('0x2')],'allowNull':![],'defaultValue':_0xffc4('0x3')},'appdata':{'type':Sequelize[_0xffc4('0x4')]()},'description':{'type':Sequelize[_0xffc4('0x2')]},'interval':{'type':Sequelize[_0xffc4('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index eddf739..ee56b28 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 _0xb1ca=['body','html-pdf','eml-format','rimraf','request-promise','moment','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','find','catch'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xb1ca,0xe1));var _0xab1c=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xb1ca[_0x49b207];return _0x2dc8fa;};'use strict';var pdf=require(_0xab1c('0x0'));var emlformat=require(_0xab1c('0x1'));var rimraf=require(_0xab1c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xab1c('0x3'));var moment=require(_0xab1c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xab1c('0x5'));var util=require('util');var path=require(_0xab1c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xab1c('0x7'));var fs=require('fs');var _=require(_0xab1c('0x8'));var squel=require(_0xab1c('0x9'));var crypto=require(_0xab1c('0xa'));var jsforce=require(_0xab1c('0xb'));var deskjs=require(_0xab1c('0xc'));var toCsv=require(_0xab1c('0xd'));var querystring=require(_0xab1c('0xe'));var Papa=require(_0xab1c('0xf'));var Redis=require(_0xab1c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xab1c('0x11'));var hardwareService=require(_0xab1c('0x12'));var logger=require(_0xab1c('0x13'))(_0xab1c('0x14'));var utils=require('../../config/utils');var config=require(_0xab1c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39c102,_0x13084a){_0x13084a=_0x13084a||0xcc;return function(_0x4c4d0f){if(_0x4c4d0f){return _0x39c102[_0xab1c('0x16')](_0x13084a);}return _0x39c102['status'](_0x13084a)[_0xab1c('0x17')]();};}function respondWithResult(_0x3c962c,_0x1955a5){_0x1955a5=_0x1955a5||0xc8;return function(_0x4f0dd4){if(_0x4f0dd4){return _0x3c962c[_0xab1c('0x18')](_0x1955a5)[_0xab1c('0x19')](_0x4f0dd4);}};}function respondWithFilteredResult(_0x35dd8f,_0xdce148){return function(_0xa326bd){if(_0xa326bd){var _0x33ee09=_0xa326bd[_0xab1c('0x1a')],_0x5d89b4=_0xdce148[_0xab1c('0x1b')],_0x1b0546=_0xdce148[_0xab1c('0x1b')]+_0xdce148['limit'],_0x31894b;if(_0x1b0546>=_0x33ee09){_0x1b0546=_0x33ee09;_0x31894b=0xc8;}else{_0x31894b=0xce;}_0x35dd8f[_0xab1c('0x18')](_0x31894b);return _0x35dd8f[_0xab1c('0x1c')](_0xab1c('0x1d'),_0x5d89b4+'-'+_0x1b0546+'/'+_0x33ee09)[_0xab1c('0x19')](_0xa326bd);}return null;};}function patchUpdates(_0x10ee0f){return function(_0x1effa8){try{jsonpatch[_0xab1c('0x1e')](_0x1effa8,_0x10ee0f,!![]);}catch(_0x20d4a8){return BPromise[_0xab1c('0x1f')](_0x20d4a8);}return _0x1effa8['save']();};}function saveUpdates(_0x5f17d9,_0x4c0c83){return function(_0x519cef){if(_0x519cef){return _0x519cef[_0xab1c('0x20')](_0x5f17d9)[_0xab1c('0x21')](function(_0x251e9e){return _0x251e9e;});}return null;};}function removeEntity(_0x13045c,_0x2dc5e0){return function(_0x1727fc){if(_0x1727fc){return _0x1727fc[_0xab1c('0x22')]()['then'](function(){_0x13045c[_0xab1c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x353fff,_0x400213){return function(_0x4efacc){if(!_0x4efacc){_0x353fff[_0xab1c('0x16')](0x194);}return _0x4efacc;};}function handleError(_0x14c430,_0x515550){_0x515550=_0x515550||0x1f4;return function(_0x41c54c){logger[_0xab1c('0x23')](_0x41c54c[_0xab1c('0x24')]);if(_0x41c54c[_0xab1c('0x25')]){delete _0x41c54c[_0xab1c('0x25')];}_0x14c430['status'](_0x515550)[_0xab1c('0x26')](_0x41c54c);};}exports[_0xab1c('0x27')]=function(_0x55d995,_0x3aa344){var _0x38c0aa={'raw':!![],'where':{'id':_0x55d995[_0xab1c('0x28')]['id']}},_0x484c9d={};_0x484c9d[_0xab1c('0x29')]=_[_0xab1c('0x2a')](db['ChatApplication'][_0xab1c('0x2b')]);_0x484c9d['query']=_[_0xab1c('0x2a')](_0x55d995[_0xab1c('0x2c')]);_0x484c9d[_0xab1c('0x2d')]=_[_0xab1c('0x2e')](_0x484c9d['model'],_0x484c9d[_0xab1c('0x2c')]);_0x38c0aa[_0xab1c('0x2f')]=_['intersection'](_0x484c9d[_0xab1c('0x29')],qs[_0xab1c('0x30')](_0x55d995[_0xab1c('0x2c')]['fields']));_0x38c0aa[_0xab1c('0x2f')]=_0x38c0aa[_0xab1c('0x2f')][_0xab1c('0x31')]?_0x38c0aa[_0xab1c('0x2f')]:_0x484c9d[_0xab1c('0x29')];if(_0x55d995['query'][_0xab1c('0x32')]){_0x38c0aa[_0xab1c('0x33')]=[{'all':!![]}];}_0x38c0aa=_['merge']({},_0x38c0aa,_0x55d995[_0xab1c('0x34')]);return db['ChatApplication'][_0xab1c('0x35')](_0x38c0aa)[_0xab1c('0x21')](handleEntityNotFound(_0x3aa344,null))[_0xab1c('0x21')](respondWithResult(_0x3aa344,null))[_0xab1c('0x36')](handleError(_0x3aa344,null));};exports[_0xab1c('0x20')]=function(_0x3a2ae6,_0xe9be13){if(_0x3a2ae6[_0xab1c('0x37')]['id']){delete _0x3a2ae6['body']['id'];}return db['ChatApplication'][_0xab1c('0x35')]({'where':{'id':_0x3a2ae6['params']['id']}})[_0xab1c('0x21')](handleEntityNotFound(_0xe9be13,null))[_0xab1c('0x21')](saveUpdates(_0x3a2ae6[_0xab1c('0x37')],null))[_0xab1c('0x21')](respondWithResult(_0xe9be13,null))[_0xab1c('0x36')](handleError(_0xe9be13,null));};exports[_0xab1c('0x22')]=function(_0x16bf96,_0x4dfe03){return db['ChatApplication'][_0xab1c('0x35')]({'where':{'id':_0x16bf96[_0xab1c('0x28')]['id']}})[_0xab1c('0x21')](handleEntityNotFound(_0x4dfe03,null))[_0xab1c('0x21')](removeEntity(_0x4dfe03,null))[_0xab1c('0x36')](handleError(_0x4dfe03,null));}; \ No newline at end of file +var _0xdaf1=['offset','limit','set','apply','save','update','then','end','error','stack','name','send','params','ChatApplication','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','sendStatus','status','json','count'];(function(_0x5f2d85,_0x4e6793){var _0xbf1541=function(_0x4740f1){while(--_0x4740f1){_0x5f2d85['push'](_0x5f2d85['shift']());}};_0xbf1541(++_0x4e6793);}(_0xdaf1,0x132));var _0x1daf=function(_0x48f3d0,_0x594655){_0x48f3d0=_0x48f3d0-0x0;var _0x1f6ab8=_0xdaf1[_0x48f3d0];return _0x1f6ab8;};'use strict';var pdf=require(_0x1daf('0x0'));var emlformat=require(_0x1daf('0x1'));var rimraf=require(_0x1daf('0x2'));var zipdir=require(_0x1daf('0x3'));var jsonpatch=require(_0x1daf('0x4'));var rp=require(_0x1daf('0x5'));var moment=require(_0x1daf('0x6'));var BPromise=require(_0x1daf('0x7'));var Mustache=require(_0x1daf('0x8'));var util=require('util');var path=require(_0x1daf('0x9'));var sox=require('sox');var csv=require(_0x1daf('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1daf('0xb'));var squel=require(_0x1daf('0xc'));var crypto=require(_0x1daf('0xd'));var jsforce=require(_0x1daf('0xe'));var deskjs=require(_0x1daf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1daf('0x10'));var Papa=require('papaparse');var Redis=require(_0x1daf('0x11'));var authService=require(_0x1daf('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1daf('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12cbd9,_0x1b6049){_0x1b6049=_0x1b6049||0xcc;return function(_0x33eb82){if(_0x33eb82){return _0x12cbd9[_0x1daf('0x14')](_0x1b6049);}return _0x12cbd9[_0x1daf('0x15')](_0x1b6049)['end']();};}function respondWithResult(_0x2bb81e,_0x35a5a4){_0x35a5a4=_0x35a5a4||0xc8;return function(_0x41043e){if(_0x41043e){return _0x2bb81e[_0x1daf('0x15')](_0x35a5a4)[_0x1daf('0x16')](_0x41043e);}};}function respondWithFilteredResult(_0x41c418,_0x577ddb){return function(_0x4f1355){if(_0x4f1355){var _0x3a86fb=_0x4f1355[_0x1daf('0x17')],_0x292bde=_0x577ddb[_0x1daf('0x18')],_0x16f95d=_0x577ddb['offset']+_0x577ddb[_0x1daf('0x19')],_0x30fed3;if(_0x16f95d>=_0x3a86fb){_0x16f95d=_0x3a86fb;_0x30fed3=0xc8;}else{_0x30fed3=0xce;}_0x41c418[_0x1daf('0x15')](_0x30fed3);return _0x41c418[_0x1daf('0x1a')]('Content-Range',_0x292bde+'-'+_0x16f95d+'/'+_0x3a86fb)[_0x1daf('0x16')](_0x4f1355);}return null;};}function patchUpdates(_0x39008f){return function(_0x282eac){try{jsonpatch[_0x1daf('0x1b')](_0x282eac,_0x39008f,!![]);}catch(_0x1510d4){return BPromise['reject'](_0x1510d4);}return _0x282eac[_0x1daf('0x1c')]();};}function saveUpdates(_0x1cc3ff,_0x5d5550){return function(_0x3303f8){if(_0x3303f8){return _0x3303f8[_0x1daf('0x1d')](_0x1cc3ff)[_0x1daf('0x1e')](function(_0x406b8c){return _0x406b8c;});}return null;};}function removeEntity(_0x38abed,_0x1b51b2){return function(_0x6fbb5d){if(_0x6fbb5d){return _0x6fbb5d['destroy']()[_0x1daf('0x1e')](function(){_0x38abed[_0x1daf('0x15')](0xcc)[_0x1daf('0x1f')]();});}};}function handleEntityNotFound(_0xdfd78a,_0x169386){return function(_0xc3deeb){if(!_0xc3deeb){_0xdfd78a[_0x1daf('0x14')](0x194);}return _0xc3deeb;};}function handleError(_0x5cd898,_0x5752d4){_0x5752d4=_0x5752d4||0x1f4;return function(_0x1ea8ee){logger[_0x1daf('0x20')](_0x1ea8ee[_0x1daf('0x21')]);if(_0x1ea8ee[_0x1daf('0x22')]){delete _0x1ea8ee[_0x1daf('0x22')];}_0x5cd898[_0x1daf('0x15')](_0x5752d4)[_0x1daf('0x23')](_0x1ea8ee);};}exports['show']=function(_0x151e64,_0x10e2ae){var _0x21c761={'raw':!![],'where':{'id':_0x151e64[_0x1daf('0x24')]['id']}},_0x528537={};_0x528537['model']=_['keys'](db[_0x1daf('0x25')][_0x1daf('0x26')]);_0x528537[_0x1daf('0x27')]=_[_0x1daf('0x28')](_0x151e64[_0x1daf('0x27')]);_0x528537[_0x1daf('0x29')]=_[_0x1daf('0x2a')](_0x528537[_0x1daf('0x2b')],_0x528537['query']);_0x21c761[_0x1daf('0x2c')]=_[_0x1daf('0x2a')](_0x528537[_0x1daf('0x2b')],qs[_0x1daf('0x2d')](_0x151e64[_0x1daf('0x27')][_0x1daf('0x2d')]));_0x21c761[_0x1daf('0x2c')]=_0x21c761[_0x1daf('0x2c')][_0x1daf('0x2e')]?_0x21c761[_0x1daf('0x2c')]:_0x528537[_0x1daf('0x2b')];if(_0x151e64[_0x1daf('0x27')][_0x1daf('0x2f')]){_0x21c761[_0x1daf('0x30')]=[{'all':!![]}];}_0x21c761=_[_0x1daf('0x31')]({},_0x21c761,_0x151e64[_0x1daf('0x32')]);return db[_0x1daf('0x25')][_0x1daf('0x33')](_0x21c761)['then'](handleEntityNotFound(_0x10e2ae,null))[_0x1daf('0x1e')](respondWithResult(_0x10e2ae,null))[_0x1daf('0x34')](handleError(_0x10e2ae,null));};exports[_0x1daf('0x1d')]=function(_0x43aa44,_0x3a3f8d){if(_0x43aa44[_0x1daf('0x35')]['id']){delete _0x43aa44[_0x1daf('0x35')]['id'];}return db['ChatApplication'][_0x1daf('0x33')]({'where':{'id':_0x43aa44[_0x1daf('0x24')]['id']}})[_0x1daf('0x1e')](handleEntityNotFound(_0x3a3f8d,null))[_0x1daf('0x1e')](saveUpdates(_0x43aa44[_0x1daf('0x35')],null))[_0x1daf('0x1e')](respondWithResult(_0x3a3f8d,null))[_0x1daf('0x34')](handleError(_0x3a3f8d,null));};exports[_0x1daf('0x36')]=function(_0x17bfd5,_0x3effde){return db['ChatApplication'][_0x1daf('0x33')]({'where':{'id':_0x17bfd5[_0x1daf('0x24')]['id']}})['then'](handleEntityNotFound(_0x3effde,null))[_0x1daf('0x1e')](removeEntity(_0x3effde,null))[_0x1daf('0x34')](handleError(_0x3effde,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 5c3264e..212950f 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 _0x8afa=['ChatApplication','chat_applications','utf8mb4','lodash','util','bluebird','request-promise','path','rimraf','./chatApplication.attributes','define'];(function(_0x211695,_0x53d57c){var _0x4c1a75=function(_0x5ea641){while(--_0x5ea641){_0x211695['push'](_0x211695['shift']());}};_0x4c1a75(++_0x53d57c);}(_0x8afa,0xf5));var _0xa8af=function(_0xd6af03,_0x2256dc){_0xd6af03=_0xd6af03-0x0;var _0x185653=_0x8afa[_0xd6af03];return _0x185653;};'use strict';var _=require(_0xa8af('0x0'));var util=require(_0xa8af('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa8af('0x2'));var rp=require(_0xa8af('0x3'));var fs=require('fs');var path=require(_0xa8af('0x4'));var rimraf=require(_0xa8af('0x5'));var config=require('../../config/environment');var attributes=require(_0xa8af('0x6'));module['exports']=function(_0xf2251f,_0x412c3b){return _0xf2251f[_0xa8af('0x7')](_0xa8af('0x8'),attributes,{'tableName':_0xa8af('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa8af('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5b8d=['define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./chatApplication.attributes','exports'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x5b8d,0xf5));var _0xd5b8=function(_0x1ac808,_0xe559b2){_0x1ac808=_0x1ac808-0x0;var _0x3a0d8f=_0x5b8d[_0x1ac808];return _0x3a0d8f;};'use strict';var _=require(_0xd5b8('0x0'));var util=require(_0xd5b8('0x1'));var logger=require(_0xd5b8('0x2'))(_0xd5b8('0x3'));var moment=require(_0xd5b8('0x4'));var BPromise=require(_0xd5b8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd5b8('0x6'));var rimraf=require(_0xd5b8('0x7'));var config=require('../../config/environment');var attributes=require(_0xd5b8('0x8'));module[_0xd5b8('0x9')]=function(_0x582ee2,_0x176de8){return _0x582ee2[_0xd5b8('0xa')](_0xd5b8('0xb'),attributes,{'tableName':_0xd5b8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd5b8('0xd'),'collate':_0xd5b8('0xe')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index d060e28..3a06064 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 _0x586b=['rpc','../../config/environment','client','http','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x36c8ca,_0x2291e9){var _0x2ff1a8=function(_0x352081){while(--_0x352081){_0x36c8ca['push'](_0x36c8ca['shift']());}};_0x2ff1a8(++_0x2291e9);}(_0x586b,0x188));var _0xb586=function(_0xb4488f,_0x29073d){_0xb4488f=_0xb4488f-0x0;var _0x19ee59=_0x586b[_0xb4488f];return _0x19ee59;};'use strict';var _=require(_0xb586('0x0'));var util=require(_0xb586('0x1'));var moment=require('moment');var BPromise=require(_0xb586('0x2'));var rs=require(_0xb586('0x3'));var fs=require('fs');var Redis=require(_0xb586('0x4'));var db=require(_0xb586('0x5'))['db'];var utils=require(_0xb586('0x6'));var logger=require('../../config/logger')(_0xb586('0x7'));var config=require(_0xb586('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb586('0x9')][_0xb586('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x307b42,_0x39a33f,_0x49b8ee){return new BPromise(function(_0x158592,_0x17a4ea){return client['request'](_0x307b42,_0x49b8ee)['then'](function(_0x1cf6ec){logger['info'](_0xb586('0xb'),_0x39a33f,_0xb586('0xc'));logger['debug'](_0xb586('0xd'),_0x39a33f,_0xb586('0xc'),JSON['stringify'](_0x1cf6ec));if(_0x1cf6ec[_0xb586('0xe')]){if(_0x1cf6ec[_0xb586('0xe')][_0xb586('0xf')]===0x1f4){logger['error'](_0xb586('0xb'),_0x39a33f,_0x1cf6ec[_0xb586('0xe')][_0xb586('0x10')]);return _0x17a4ea(_0x1cf6ec[_0xb586('0xe')][_0xb586('0x10')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x39a33f,_0x1cf6ec[_0xb586('0xe')][_0xb586('0x10')]);return _0x158592(_0x1cf6ec[_0xb586('0xe')][_0xb586('0x10')]);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x39a33f,_0xb586('0xc'));_0x158592(_0x1cf6ec[_0xb586('0x11')][_0xb586('0x10')]);}})[_0xb586('0x12')](function(_0x4b2974){logger[_0xb586('0xe')](_0xb586('0xb'),_0x39a33f,_0x4b2974);_0x17a4ea(_0x4b2974);});});} \ No newline at end of file +var _0x2d8c=['then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http','request'];(function(_0x160a03,_0x3769f2){var _0x899179=function(_0x263287){while(--_0x263287){_0x160a03['push'](_0x160a03['shift']());}};_0x899179(++_0x3769f2);}(_0x2d8c,0x199));var _0xc2d8=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x2d8c[_0x455c6c];return _0x488242;};'use strict';var _=require(_0xc2d8('0x0'));var util=require(_0xc2d8('0x1'));var moment=require(_0xc2d8('0x2'));var BPromise=require(_0xc2d8('0x3'));var rs=require(_0xc2d8('0x4'));var fs=require('fs');var Redis=require(_0xc2d8('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc2d8('0x6'))('rpc');var config=require(_0xc2d8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc2d8('0x8')][_0xc2d8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x371a31,_0x44dd9c,_0x2101bc){return new BPromise(function(_0x2c9ff2,_0x1eb9fa){return client[_0xc2d8('0xa')](_0x371a31,_0x2101bc)[_0xc2d8('0xb')](function(_0x1dac2d){logger[_0xc2d8('0xc')](_0xc2d8('0xd'),_0x44dd9c,_0xc2d8('0xe'));logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x44dd9c,_0xc2d8('0xe'),JSON[_0xc2d8('0xf')](_0x1dac2d));if(_0x1dac2d[_0xc2d8('0x10')]){if(_0x1dac2d[_0xc2d8('0x10')][_0xc2d8('0x11')]===0x1f4){logger['error'](_0xc2d8('0xd'),_0x44dd9c,_0x1dac2d[_0xc2d8('0x10')][_0xc2d8('0x12')]);return _0x1eb9fa(_0x1dac2d['error'][_0xc2d8('0x12')]);}logger['error'](_0xc2d8('0xd'),_0x44dd9c,_0x1dac2d[_0xc2d8('0x10')]['message']);return _0x2c9ff2(_0x1dac2d[_0xc2d8('0x10')][_0xc2d8('0x12')]);}else{logger[_0xc2d8('0xc')](_0xc2d8('0xd'),_0x44dd9c,_0xc2d8('0xe'));_0x2c9ff2(_0x1dac2d[_0xc2d8('0x13')]['message']);}})[_0xc2d8('0x14')](function(_0x159f4d){logger[_0xc2d8('0x10')](_0xc2d8('0xd'),_0x44dd9c,_0x159f4d);_0x1eb9fa(_0x159f4d);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 70e7136..e0cabbb 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 _0x4065=['put','/:id','update','delete','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show'];(function(_0x4d3951,_0x47d793){var _0x2beecf=function(_0x42181a){while(--_0x42181a){_0x4d3951['push'](_0x4d3951['shift']());}};_0x2beecf(++_0x47d793);}(_0x4065,0x12b));var _0x5406=function(_0x2d01f5,_0x1135de){_0x2d01f5=_0x2d01f5-0x0;var _0x155920=_0x4065[_0x2d01f5];return _0x155920;};'use strict';var multer=require(_0x5406('0x0'));var util=require('util');var path=require(_0x5406('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5406('0x2')]();var auth=require(_0x5406('0x3'));var interaction=require(_0x5406('0x4'));var config=require(_0x5406('0x5'));var controller=require('./chatApplication.controller');router[_0x5406('0x6')]('/:id',auth[_0x5406('0x7')](),controller[_0x5406('0x8')]);router[_0x5406('0x9')](_0x5406('0xa'),auth[_0x5406('0x7')](),controller[_0x5406('0xb')]);router[_0x5406('0xc')](_0x5406('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x5406('0xd')]=router; \ No newline at end of file +var _0x6288=['show','put','delete','exports','express','Router','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6288,0x185));var _0x8628=function(_0x5c1f07,_0x35d59e){_0x5c1f07=_0x5c1f07-0x0;var _0x22c4d3=_0x6288[_0x5c1f07];return _0x22c4d3;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8628('0x0'));var router=express[_0x8628('0x1')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8628('0x2'));var controller=require(_0x8628('0x3'));router[_0x8628('0x4')](_0x8628('0x5'),auth[_0x8628('0x6')](),controller[_0x8628('0x7')]);router[_0x8628('0x8')](_0x8628('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x8628('0x9')](_0x8628('0x5'),auth[_0x8628('0x6')](),controller['destroy']);module[_0x8628('0xa')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 44e6c5d..25d62f9 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 _0xd17a=['BOOLEAN','exports','STRING'];(function(_0x21923a,_0x126523){var _0x20c556=function(_0x1cda2d){while(--_0x1cda2d){_0x21923a['push'](_0x21923a['shift']());}};_0x20c556(++_0x126523);}(_0xd17a,0xf4));var _0xad17=function(_0xee588,_0x368239){_0xee588=_0xee588-0x0;var _0x58dd1a=_0xd17a[_0xee588];return _0x58dd1a;};'use strict';var Sequelize=require('sequelize');module[_0xad17('0x0')]={'name':{'type':Sequelize[_0xad17('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xad17('0x1')]},'write':{'type':Sequelize[_0xad17('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa7c9=['sequelize','exports','STRING'];(function(_0x3ac97f,_0x5a43eb){var _0x3d1e10=function(_0x6a2b3b){while(--_0x6a2b3b){_0x3ac97f['push'](_0x3ac97f['shift']());}};_0x3d1e10(++_0x5a43eb);}(_0xa7c9,0x1ce));var _0x9a7c=function(_0x5df7f8,_0x5c98a1){_0x5df7f8=_0x5df7f8-0x0;var _0x5becd8=_0xa7c9[_0x5df7f8];return _0x5becd8;};'use strict';var Sequelize=require(_0x9a7c('0x0'));module[_0x9a7c('0x1')]={'name':{'type':Sequelize[_0x9a7c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9a7c('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index a5cf007..cd5e4b7 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 _0x2285=['filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','type','key','field','options','ChatGroup','include','findAll','rows','show','params','rawAttributes','length','includeAll','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','order','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','jayson/promise','client','test','then','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','count','offset','set','apply','save','update','destroy','stack','name','send','index','model','query','keys'];(function(_0x60c642,_0xd270ca){var _0xd32484=function(_0x1234b6){while(--_0x1234b6){_0x60c642['push'](_0x60c642['shift']());}};_0xd32484(++_0xd270ca);}(_0x2285,0x177));var _0x5228=function(_0x75ee9d,_0x584d9b){_0x75ee9d=_0x75ee9d-0x0;var _0x2e1962=_0x2285[_0x75ee9d];return _0x2e1962;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5228('0x0'));var rimraf=require(_0x5228('0x1'));var zipdir=require(_0x5228('0x2'));var jsonpatch=require(_0x5228('0x3'));var rp=require(_0x5228('0x4'));var moment=require('moment');var BPromise=require(_0x5228('0x5'));var Mustache=require(_0x5228('0x6'));var util=require('util');var path=require(_0x5228('0x7'));var sox=require(_0x5228('0x8'));var csv=require(_0x5228('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5228('0xa'));var squel=require(_0x5228('0xb'));var crypto=require(_0x5228('0xc'));var jsforce=require(_0x5228('0xd'));var deskjs=require(_0x5228('0xe'));var toCsv=require(_0x5228('0x9'));var querystring=require(_0x5228('0xf'));var Papa=require(_0x5228('0x10'));var Redis=require(_0x5228('0x11'));var authService=require(_0x5228('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5228('0x13'));var logger=require(_0x5228('0x14'))(_0x5228('0x15'));var utils=require(_0x5228('0x16'));var config=require('../../config/environment');var db=require(_0x5228('0x17'))['db'];config[_0x5228('0x18')]=_[_0x5228('0x19')](config[_0x5228('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x5228('0x1a'))(new Redis(config[_0x5228('0x18')]));require(_0x5228('0x1b'))[_0x5228('0x1c')](socket);var jayson=require(_0x5228('0x1d'));var client=jayson[_0x5228('0x1e')]['http']({'port':0x232a});function checkPasswordPattern(_0x11efcb,_0x3711dc,_0x55f637){if(_0x55f637){var _0xa4aab9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa4aab9[_0x5228('0x1f')](_0x3711dc)){return _0x11efcb;}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 _0x11efcb;}}function respondWithRpcPromise(_0x1e1af5,_0x2863ac,_0x1c4121,_0x25410b){return new BPromise(function(_0x5ebf0c,_0x3191ea){var _0x23419b=_0x25410b||client;return _0x23419b['request'](_0x1e1af5,_0x1c4121)[_0x5228('0x20')](function(_0x2c7dc4){logger[_0x5228('0x21')]('ChatGroup,\x20%s,\x20%s',_0x2863ac,_0x5228('0x22'));logger['debug'](_0x5228('0x23'),_0x2863ac,_0x5228('0x22'),JSON[_0x5228('0x24')](_0x2c7dc4));if(_0x2c7dc4['error']){if(_0x2c7dc4[_0x5228('0x25')][_0x5228('0x26')]===0x1f4){logger[_0x5228('0x25')](_0x5228('0x27'),_0x2863ac,_0x2c7dc4['error']['message']);return _0x3191ea(_0x2c7dc4[_0x5228('0x25')][_0x5228('0x28')]);}logger['error'](_0x5228('0x27'),_0x2863ac,_0x2c7dc4[_0x5228('0x25')][_0x5228('0x28')]);return _0x5ebf0c(_0x2c7dc4[_0x5228('0x25')][_0x5228('0x28')]);}else{logger[_0x5228('0x21')](_0x5228('0x27'),_0x2863ac,'request\x20sent');_0x5ebf0c(_0x2c7dc4[_0x5228('0x29')]['message']);}})[_0x5228('0x2a')](function(_0x3f587d){logger['error']('ChatGroup,\x20%s,\x20%s',_0x2863ac,_0x3f587d);_0x3191ea(_0x3f587d);});});}function respondWithStatusCode(_0x53cb40,_0xfc158e){_0xfc158e=_0xfc158e||0xcc;return function(_0x9db71e){if(_0x9db71e){return _0x53cb40[_0x5228('0x2b')](_0xfc158e);}return _0x53cb40['status'](_0xfc158e)[_0x5228('0x2c')]();};}function respondWithResult(_0x3a5d5d,_0x25dc5a){_0x25dc5a=_0x25dc5a||0xc8;return function(_0x5dcac9){if(_0x5dcac9){return _0x3a5d5d[_0x5228('0x2d')](_0x25dc5a)[_0x5228('0x2e')](_0x5dcac9);}};}function respondWithFilteredResult(_0x3e2561,_0x2adfb5){return function(_0x44bacd){if(_0x44bacd){var _0x4bdb1d=_0x44bacd[_0x5228('0x2f')],_0x3a08e3=_0x2adfb5[_0x5228('0x30')],_0x2864ef=_0x2adfb5['offset']+_0x2adfb5['limit'],_0x33ae22;if(_0x2864ef>=_0x4bdb1d){_0x2864ef=_0x4bdb1d;_0x33ae22=0xc8;}else{_0x33ae22=0xce;}_0x3e2561[_0x5228('0x2d')](_0x33ae22);return _0x3e2561[_0x5228('0x31')]('Content-Range',_0x3a08e3+'-'+_0x2864ef+'/'+_0x4bdb1d)['json'](_0x44bacd);}return null;};}function patchUpdates(_0x2e4668){return function(_0x4b5949){try{jsonpatch[_0x5228('0x32')](_0x4b5949,_0x2e4668,!![]);}catch(_0x10aebd){return BPromise['reject'](_0x10aebd);}return _0x4b5949[_0x5228('0x33')]();};}function saveUpdates(_0x57ead3,_0x589adb){return function(_0x3a8250){if(_0x3a8250){return _0x3a8250[_0x5228('0x34')](_0x57ead3)[_0x5228('0x20')](function(_0x2ad7c0){return _0x2ad7c0;});}return null;};}function removeEntity(_0x568c62,_0x42f9af){return function(_0x38781c){if(_0x38781c){return _0x38781c[_0x5228('0x35')]()[_0x5228('0x20')](function(){_0x568c62[_0x5228('0x2d')](0xcc)[_0x5228('0x2c')]();});}};}function handleEntityNotFound(_0x4b9b52,_0x26d31b){return function(_0x5dce78){if(!_0x5dce78){_0x4b9b52[_0x5228('0x2b')](0x194);}return _0x5dce78;};}function handleError(_0x81f4eb,_0x488a65){_0x488a65=_0x488a65||0x1f4;return function(_0x5c182e){logger['error'](_0x5c182e[_0x5228('0x36')]);if(_0x5c182e[_0x5228('0x37')]){delete _0x5c182e[_0x5228('0x37')];}_0x81f4eb[_0x5228('0x2d')](_0x488a65)[_0x5228('0x38')](_0x5c182e);};}exports[_0x5228('0x39')]=function(_0x4d5ff2,_0x493a05){var _0x3601fb={},_0x1bd2e3={},_0x5e0ad4={'count':0x0,'rows':[]};var _0x42744d=db['ChatGroup']['rawAttributes'];_0x1bd2e3[_0x5228('0x3a')]=_['keys'](_0x42744d);_0x1bd2e3[_0x5228('0x3b')]=_[_0x5228('0x3c')](_0x4d5ff2[_0x5228('0x3b')]);_0x1bd2e3[_0x5228('0x3d')]=_[_0x5228('0x3e')](_0x1bd2e3[_0x5228('0x3a')],_0x1bd2e3['query']);_0x3601fb['attributes']=_[_0x5228('0x3e')](_0x1bd2e3['model'],qs[_0x5228('0x3f')](_0x4d5ff2[_0x5228('0x3b')][_0x5228('0x3f')]));_0x3601fb[_0x5228('0x40')]=_0x3601fb[_0x5228('0x40')]['length']?_0x3601fb[_0x5228('0x40')]:_0x1bd2e3['model'];if(!_0x4d5ff2[_0x5228('0x3b')][_0x5228('0x41')](_0x5228('0x42'))){_0x3601fb[_0x5228('0x43')]=qs[_0x5228('0x43')](_0x4d5ff2[_0x5228('0x3b')][_0x5228('0x43')]);_0x3601fb['offset']=qs[_0x5228('0x30')](_0x4d5ff2['query']['offset']);}_0x3601fb['order']=qs[_0x5228('0x44')](_0x4d5ff2[_0x5228('0x3b')][_0x5228('0x44')]);_0x3601fb[_0x5228('0x45')]=qs[_0x5228('0x3d')](_[_0x5228('0x46')](_0x4d5ff2[_0x5228('0x3b')],_0x1bd2e3[_0x5228('0x3d')]));if(_0x4d5ff2[_0x5228('0x3b')][_0x5228('0x47')]){_0x3601fb[_0x5228('0x45')]=_[_0x5228('0x48')](_0x3601fb[_0x5228('0x45')],{'$or':_[_0x5228('0x49')](_0x42744d,function(_0x32250f){if(_0x32250f[_0x5228('0x4a')][_0x5228('0x4b')]!=='VIRTUAL'){var _0xae3ba6={};_0xae3ba6[_0x32250f[_0x5228('0x4c')]]={'$like':'%'+_0x4d5ff2[_0x5228('0x3b')][_0x5228('0x47')]+'%'};return _0xae3ba6;}})});}_0x3601fb=_[_0x5228('0x48')]({},_0x3601fb,_0x4d5ff2[_0x5228('0x4d')]);var _0x1555b4={'where':_0x3601fb[_0x5228('0x45')]};return db[_0x5228('0x4e')][_0x5228('0x2f')](_0x1555b4)['then'](function(_0x56873a){_0x5e0ad4['count']=_0x56873a;if(_0x4d5ff2[_0x5228('0x3b')]['includeAll']){_0x3601fb[_0x5228('0x4f')]=[{'all':!![]}];}return db[_0x5228('0x4e')][_0x5228('0x50')](_0x3601fb);})['then'](function(_0x339d25){_0x5e0ad4[_0x5228('0x51')]=_0x339d25;return _0x5e0ad4;})['then'](respondWithFilteredResult(_0x493a05,_0x3601fb))[_0x5228('0x2a')](handleError(_0x493a05,null));};exports[_0x5228('0x52')]=function(_0x55297f,_0x4bbbef){var _0x2abfae={'raw':!![],'where':{'id':_0x55297f[_0x5228('0x53')]['id']}},_0x3a96fe={};_0x3a96fe[_0x5228('0x3a')]=_[_0x5228('0x3c')](db[_0x5228('0x4e')][_0x5228('0x54')]);_0x3a96fe[_0x5228('0x3b')]=_['keys'](_0x55297f[_0x5228('0x3b')]);_0x3a96fe[_0x5228('0x3d')]=_[_0x5228('0x3e')](_0x3a96fe[_0x5228('0x3a')],_0x3a96fe[_0x5228('0x3b')]);_0x2abfae['attributes']=_[_0x5228('0x3e')](_0x3a96fe['model'],qs[_0x5228('0x3f')](_0x55297f[_0x5228('0x3b')][_0x5228('0x3f')]));_0x2abfae[_0x5228('0x40')]=_0x2abfae[_0x5228('0x40')][_0x5228('0x55')]?_0x2abfae[_0x5228('0x40')]:_0x3a96fe[_0x5228('0x3a')];if(_0x55297f['query'][_0x5228('0x56')]){_0x2abfae[_0x5228('0x4f')]=[{'all':!![]}];}_0x2abfae=_['merge']({},_0x2abfae,_0x55297f[_0x5228('0x4d')]);return db[_0x5228('0x4e')][_0x5228('0x57')](_0x2abfae)[_0x5228('0x20')](handleEntityNotFound(_0x4bbbef,null))[_0x5228('0x20')](respondWithResult(_0x4bbbef,null))[_0x5228('0x2a')](handleError(_0x4bbbef,null));};exports[_0x5228('0x58')]=function(_0x5b0ad3,_0x462b6f){return db[_0x5228('0x4e')][_0x5228('0x58')](_0x5b0ad3[_0x5228('0x59')],{})['then'](respondWithResult(_0x462b6f,0xc9))['catch'](handleError(_0x462b6f,null));};exports[_0x5228('0x34')]=function(_0x480062,_0x54713f){if(_0x480062[_0x5228('0x59')]['id']){delete _0x480062[_0x5228('0x59')]['id'];}return db[_0x5228('0x4e')][_0x5228('0x57')]({'where':{'id':_0x480062['params']['id']}})[_0x5228('0x20')](handleEntityNotFound(_0x54713f,null))[_0x5228('0x20')](saveUpdates(_0x480062[_0x5228('0x59')],null))[_0x5228('0x20')](respondWithResult(_0x54713f,null))[_0x5228('0x2a')](handleError(_0x54713f,null));};exports[_0x5228('0x35')]=function(_0x8d6674,_0xe74ead){return db[_0x5228('0x4e')][_0x5228('0x57')]({'where':{'id':_0x8d6674[_0x5228('0x53')]['id']}})[_0x5228('0x20')](handleEntityNotFound(_0xe74ead,null))[_0x5228('0x20')](removeEntity(_0xe74ead,null))[_0x5228('0x2a')](handleError(_0xe74ead,null));};exports[_0x5228('0x5a')]=function(_0xf3b4ff,_0x478c9c){return db[_0x5228('0x4e')][_0x5228('0x5a')]()[_0x5228('0x20')](respondWithResult(_0x478c9c,null))['catch'](handleError(_0x478c9c,null));};exports[_0x5228('0x5b')]=function(_0x12f157,_0x2890eb,_0x430881){return db[_0x5228('0x5c')][_0x5228('0x2f')]({'where':{'ChatGroupId':_0x12f157[_0x5228('0x53')]['id'],'ToId':_0x12f157[_0x5228('0x5d')]['id'],'read':![]}})[_0x5228('0x20')](function(_0x25bfbe){return{'id':_[_0x5228('0x5e')](_0x12f157[_0x5228('0x53')]['id']),'count':_0x25bfbe};})[_0x5228('0x20')](respondWithResult(_0x2890eb,null))[_0x5228('0x2a')](handleError(_0x2890eb,null));};exports[_0x5228('0x5f')]=function(_0x1144a2,_0x2ba9c2,_0x593d3e){return db[_0x5228('0x4e')][_0x5228('0x57')]({'where':{'id':_0x1144a2[_0x5228('0x53')]['id']}})[_0x5228('0x20')](handleEntityNotFound(_0x2ba9c2,null))[_0x5228('0x20')](function(_0x15dbe3){if(_0x15dbe3){return _0x15dbe3[_0x5228('0x5f')](_0x1144a2['body']['ids'],_[_0x5228('0x60')](_0x1144a2[_0x5228('0x59')],[_0x5228('0x61'),'id'])||{});}})[_0x5228('0x20')](respondWithResult(_0x2ba9c2,null))[_0x5228('0x2a')](handleError(_0x2ba9c2,null));};exports['getMembers']=function(_0x2de501,_0x289279,_0x69c051){var _0x3f0d17={};var _0x4ccda2={};var _0x3423d9;var _0x3b02ac;return db['ChatGroup']['findOne']({'where':{'id':_0x2de501[_0x5228('0x53')]['id']}})[_0x5228('0x20')](handleEntityNotFound(_0x289279,null))['then'](function(_0x48422c){if(_0x48422c){_0x3423d9=_0x48422c;_0x4ccda2[_0x5228('0x3a')]=_[_0x5228('0x3c')](db['User'][_0x5228('0x54')]);_0x4ccda2['query']=_[_0x5228('0x3c')](_0x2de501[_0x5228('0x3b')]);_0x4ccda2['filters']=_[_0x5228('0x3e')](_0x4ccda2[_0x5228('0x3a')],_0x4ccda2['query']);_0x3f0d17[_0x5228('0x40')]=_[_0x5228('0x3e')](_0x4ccda2[_0x5228('0x3a')],qs['fields'](_0x2de501['query'][_0x5228('0x3f')]));_0x3f0d17['attributes']=_0x3f0d17[_0x5228('0x40')]['length']?_0x3f0d17[_0x5228('0x40')]:_0x4ccda2['model'];_0x3f0d17[_0x5228('0x62')]=qs['sort'](_0x2de501['query'][_0x5228('0x44')]);_0x3f0d17[_0x5228('0x45')]=qs[_0x5228('0x3d')](_[_0x5228('0x46')](_0x2de501['query'],_0x4ccda2[_0x5228('0x3d')]));if(_0x2de501[_0x5228('0x3b')][_0x5228('0x47')]){_0x3f0d17[_0x5228('0x45')]=_[_0x5228('0x48')](_0x3f0d17[_0x5228('0x45')],{'$or':_[_0x5228('0x49')](_0x3f0d17[_0x5228('0x40')],function(_0x4ea614){var _0x40c271={};_0x40c271[_0x4ea614]={'$like':'%'+_0x2de501['query'][_0x5228('0x47')]+'%'};return _0x40c271;})});}_0x3f0d17=_[_0x5228('0x48')]({},_0x3f0d17,_0x2de501[_0x5228('0x4d')]);return _0x3423d9[_0x5228('0x63')](_0x3f0d17);}})[_0x5228('0x20')](function(_0x91051e){if(_0x91051e){_0x3b02ac=_0x91051e[_0x5228('0x55')];if(!_0x2de501[_0x5228('0x3b')][_0x5228('0x41')](_0x5228('0x42'))){_0x3f0d17['limit']=qs[_0x5228('0x43')](_0x2de501[_0x5228('0x3b')][_0x5228('0x43')]);_0x3f0d17['offset']=qs['offset'](_0x2de501[_0x5228('0x3b')][_0x5228('0x30')]);}return _0x3423d9['getMembers'](_0x3f0d17);}})[_0x5228('0x20')](function(_0x52b4f2){if(_0x52b4f2){return _0x52b4f2?{'count':_0x3b02ac,'rows':_0x52b4f2}:null;}})[_0x5228('0x20')](respondWithResult(_0x289279,null))['catch'](handleError(_0x289279,null));};exports['removeMembers']=function(_0x44841d,_0x51b291,_0x217fe8){return db[_0x5228('0x4e')][_0x5228('0x57')]({'where':{'id':_0x44841d[_0x5228('0x53')]['id']}})[_0x5228('0x20')](handleEntityNotFound(_0x51b291,null))['then'](function(_0x42f844){if(_0x42f844){return _0x42f844[_0x5228('0x64')](_0x44841d['query'][_0x5228('0x61')]);}})['then'](respondWithStatusCode(_0x51b291,null))[_0x5228('0x2a')](handleError(_0x51b291,null));};exports[_0x5228('0x65')]=function(_0x207dde,_0x518396,_0x24ad03){if(_0x207dde[_0x5228('0x59')]['id']){delete _0x207dde[_0x5228('0x59')]['id'];}return db['ChatGroup'][_0x5228('0x57')]({'where':{'id':_0x207dde[_0x5228('0x53')]['id']}})['then'](handleEntityNotFound(_0x518396,null))[_0x5228('0x20')](function(_0x99b983){if(_0x99b983){_0x207dde[_0x5228('0x59')][_0x5228('0x66')]=_0x99b983['id'];return db['ChatInternalMessage']['create'](_0x207dde[_0x5228('0x59')]);}})[_0x5228('0x20')](respondWithResult(_0x518396,null))['catch'](handleError(_0x518396,null));};exports[_0x5228('0x67')]=function(_0x5b6db2,_0x5d10ae,_0x3359f9){var _0x2051c9={};var _0x472138={};var _0x177369;var _0x5339a7;return db[_0x5228('0x4e')][_0x5228('0x68')]({'where':{'id':_0x5b6db2[_0x5228('0x53')]['id']}})[_0x5228('0x20')](handleEntityNotFound(_0x5d10ae,null))[_0x5228('0x20')](function(_0x1d153a){if(_0x1d153a){_0x177369=_0x1d153a;_0x472138[_0x5228('0x3a')]=_['keys'](db[_0x5228('0x5c')][_0x5228('0x54')]);_0x472138[_0x5228('0x3b')]=_[_0x5228('0x3c')](_0x5b6db2['query']);_0x472138['filters']=_[_0x5228('0x3e')](_0x472138[_0x5228('0x3a')],_0x472138[_0x5228('0x3b')]);_0x2051c9[_0x5228('0x40')]=_[_0x5228('0x3e')](_0x472138['model'],qs['fields'](_0x5b6db2[_0x5228('0x3b')][_0x5228('0x3f')]));_0x2051c9[_0x5228('0x40')]=_0x2051c9[_0x5228('0x40')]['length']?_0x2051c9['attributes']:_0x472138[_0x5228('0x3a')];_0x2051c9[_0x5228('0x62')]=qs[_0x5228('0x44')](_0x5b6db2[_0x5228('0x3b')][_0x5228('0x44')]);_0x2051c9[_0x5228('0x45')]=qs['filters'](_[_0x5228('0x46')](_0x5b6db2[_0x5228('0x3b')],_0x472138[_0x5228('0x3d')]));if(_0x5b6db2[_0x5228('0x3b')]['filter']){_0x2051c9[_0x5228('0x45')]=_['merge'](_0x2051c9[_0x5228('0x45')],{'$or':_[_0x5228('0x49')](_0x2051c9[_0x5228('0x40')],function(_0x289cfa){var _0x44a722={};_0x44a722[_0x289cfa]={'$like':'%'+_0x5b6db2['query'][_0x5228('0x47')]+'%'};return _0x44a722;})});}if(_0x5b6db2[_0x5228('0x3b')][_0x5228('0x69')]){var _0x23d23a=_0x5b6db2[_0x5228('0x3b')][_0x5228('0x69')][_0x5228('0x6a')](',');var _0x337705={};_0x337705[_0x23d23a[0x0]]={'$gte':moment(_0x23d23a[0x1])[_0x5228('0x6b')](_0x5228('0x6c'))};_0x2051c9[_0x5228('0x45')]=_['merge'](_0x2051c9[_0x5228('0x45')],_0x337705);}_0x2051c9=_[_0x5228('0x48')]({},_0x2051c9,_0x5b6db2[_0x5228('0x4d')]);return _0x177369[_0x5228('0x67')](_0x2051c9);}})['then'](function(_0x52b22f){if(_0x52b22f){_0x5339a7=_0x52b22f[_0x5228('0x55')];if(!_0x5b6db2['query'][_0x5228('0x41')](_0x5228('0x42'))){_0x2051c9[_0x5228('0x43')]=qs[_0x5228('0x43')](_0x5b6db2[_0x5228('0x3b')][_0x5228('0x43')]);_0x2051c9['offset']=qs[_0x5228('0x30')](_0x5b6db2[_0x5228('0x3b')]['offset']);}return _0x177369[_0x5228('0x67')](_0x2051c9);}})[_0x5228('0x20')](function(_0x2b2cd2){if(_0x2b2cd2){return _0x2b2cd2?{'count':_0x5339a7,'rows':_0x2b2cd2}:null;}})[_0x5228('0x20')](respondWithResult(_0x5d10ae,null))['catch'](handleError(_0x5d10ae,null));}; \ No newline at end of file +var _0x98d3=['filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','type','key','VIRTUAL','filter','includeAll','include','show','options','find','create','body','params','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','findOne','map','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','order','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','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','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','info','ChatGroup,\x20%s,\x20%s','catch','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','stack','name','send','index','ChatGroup','rawAttributes','model','keys','query'];(function(_0x3cf78e,_0x5d2c47){var _0x5b6b18=function(_0x3e97b6){while(--_0x3e97b6){_0x3cf78e['push'](_0x3cf78e['shift']());}};_0x5b6b18(++_0x5d2c47);}(_0x98d3,0x173));var _0x398d=function(_0x3ce73d,_0x5a5c50){_0x3ce73d=_0x3ce73d-0x0;var _0x487489=_0x98d3[_0x3ce73d];return _0x487489;};'use strict';var pdf=require(_0x398d('0x0'));var emlformat=require(_0x398d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x398d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x398d('0x3'));var moment=require('moment');var BPromise=require(_0x398d('0x4'));var Mustache=require(_0x398d('0x5'));var util=require('util');var path=require('path');var sox=require(_0x398d('0x6'));var csv=require(_0x398d('0x7'));var ejs=require(_0x398d('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x398d('0x9'));var crypto=require(_0x398d('0xa'));var jsforce=require(_0x398d('0xb'));var deskjs=require(_0x398d('0xc'));var toCsv=require(_0x398d('0x7'));var querystring=require('querystring');var Papa=require(_0x398d('0xd'));var Redis=require(_0x398d('0xe'));var authService=require(_0x398d('0xf'));var qs=require(_0x398d('0x10'));var hardwareService=require(_0x398d('0x11'));var logger=require(_0x398d('0x12'))(_0x398d('0x13'));var utils=require(_0x398d('0x14'));var config=require('../../config/environment');var db=require(_0x398d('0x15'))['db'];config[_0x398d('0x16')]=_[_0x398d('0x17')](config[_0x398d('0x16')],{'host':_0x398d('0x18'),'port':0x18eb});var socket=require(_0x398d('0x19'))(new Redis(config[_0x398d('0x16')]));require(_0x398d('0x1a'))[_0x398d('0x1b')](socket);var jayson=require(_0x398d('0x1c'));var client=jayson[_0x398d('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x50a3f9,_0x3d424f,_0x36cde2){if(_0x36cde2){var _0x347508=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x347508[_0x398d('0x1e')](_0x3d424f)){return _0x50a3f9;}else{throw new Error(_0x398d('0x1f'));}}else{return _0x50a3f9;}}function respondWithRpcPromise(_0x4099a5,_0x3ff03c,_0x3c151a,_0x57a2b9){return new BPromise(function(_0x26b9a0,_0x54e717){var _0x673840=_0x57a2b9||client;return _0x673840[_0x398d('0x20')](_0x4099a5,_0x3c151a)[_0x398d('0x21')](function(_0x5de1be){logger['info']('ChatGroup,\x20%s,\x20%s',_0x3ff03c,_0x398d('0x22'));logger[_0x398d('0x23')](_0x398d('0x24'),_0x3ff03c,_0x398d('0x22'),JSON[_0x398d('0x25')](_0x5de1be));if(_0x5de1be[_0x398d('0x26')]){if(_0x5de1be[_0x398d('0x26')]['code']===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x3ff03c,_0x5de1be[_0x398d('0x26')][_0x398d('0x27')]);return _0x54e717(_0x5de1be[_0x398d('0x26')][_0x398d('0x27')]);}logger[_0x398d('0x26')]('ChatGroup,\x20%s,\x20%s',_0x3ff03c,_0x5de1be['error'][_0x398d('0x27')]);return _0x26b9a0(_0x5de1be[_0x398d('0x26')]['message']);}else{logger[_0x398d('0x28')](_0x398d('0x29'),_0x3ff03c,'request\x20sent');_0x26b9a0(_0x5de1be['result']['message']);}})[_0x398d('0x2a')](function(_0x2cc4ef){logger[_0x398d('0x26')](_0x398d('0x29'),_0x3ff03c,_0x2cc4ef);_0x54e717(_0x2cc4ef);});});}function respondWithStatusCode(_0x2a1f4d,_0xd614bf){_0xd614bf=_0xd614bf||0xcc;return function(_0xc9c9b7){if(_0xc9c9b7){return _0x2a1f4d[_0x398d('0x2b')](_0xd614bf);}return _0x2a1f4d['status'](_0xd614bf)[_0x398d('0x2c')]();};}function respondWithResult(_0x557dce,_0x4aa568){_0x4aa568=_0x4aa568||0xc8;return function(_0x124bc9){if(_0x124bc9){return _0x557dce[_0x398d('0x2d')](_0x4aa568)['json'](_0x124bc9);}};}function respondWithFilteredResult(_0x373326,_0x558249){return function(_0x3ae172){if(_0x3ae172){var _0x8abf30=_0x3ae172[_0x398d('0x2e')],_0x582d16=_0x558249['offset'],_0x5681d0=_0x558249[_0x398d('0x2f')]+_0x558249[_0x398d('0x30')],_0x410db2;if(_0x5681d0>=_0x8abf30){_0x5681d0=_0x8abf30;_0x410db2=0xc8;}else{_0x410db2=0xce;}_0x373326[_0x398d('0x2d')](_0x410db2);return _0x373326[_0x398d('0x31')](_0x398d('0x32'),_0x582d16+'-'+_0x5681d0+'/'+_0x8abf30)[_0x398d('0x33')](_0x3ae172);}return null;};}function patchUpdates(_0x490bee){return function(_0x5a9f61){try{jsonpatch[_0x398d('0x34')](_0x5a9f61,_0x490bee,!![]);}catch(_0xe6a05){return BPromise[_0x398d('0x35')](_0xe6a05);}return _0x5a9f61[_0x398d('0x36')]();};}function saveUpdates(_0xcc7d81,_0x27ed5b){return function(_0xd8dc6c){if(_0xd8dc6c){return _0xd8dc6c[_0x398d('0x37')](_0xcc7d81)[_0x398d('0x21')](function(_0x5411c5){return _0x5411c5;});}return null;};}function removeEntity(_0x6dac9f,_0x3807f0){return function(_0x182650){if(_0x182650){return _0x182650['destroy']()['then'](function(){_0x6dac9f[_0x398d('0x2d')](0xcc)[_0x398d('0x2c')]();});}};}function handleEntityNotFound(_0x3fb8ff,_0x2c37fa){return function(_0x20fe0d){if(!_0x20fe0d){_0x3fb8ff[_0x398d('0x2b')](0x194);}return _0x20fe0d;};}function handleError(_0x324d76,_0xf578f9){_0xf578f9=_0xf578f9||0x1f4;return function(_0x28318f){logger[_0x398d('0x26')](_0x28318f[_0x398d('0x38')]);if(_0x28318f[_0x398d('0x39')]){delete _0x28318f[_0x398d('0x39')];}_0x324d76[_0x398d('0x2d')](_0xf578f9)[_0x398d('0x3a')](_0x28318f);};}exports[_0x398d('0x3b')]=function(_0x3e4c9a,_0x24cd9b){var _0x3d5b3f={},_0x5ae43b={},_0x244512={'count':0x0,'rows':[]};var _0x3a860d=db[_0x398d('0x3c')][_0x398d('0x3d')];_0x5ae43b[_0x398d('0x3e')]=_[_0x398d('0x3f')](_0x3a860d);_0x5ae43b[_0x398d('0x40')]=_['keys'](_0x3e4c9a[_0x398d('0x40')]);_0x5ae43b[_0x398d('0x41')]=_[_0x398d('0x42')](_0x5ae43b[_0x398d('0x3e')],_0x5ae43b[_0x398d('0x40')]);_0x3d5b3f[_0x398d('0x43')]=_[_0x398d('0x42')](_0x5ae43b[_0x398d('0x3e')],qs['fields'](_0x3e4c9a[_0x398d('0x40')][_0x398d('0x44')]));_0x3d5b3f[_0x398d('0x43')]=_0x3d5b3f[_0x398d('0x43')][_0x398d('0x45')]?_0x3d5b3f['attributes']:_0x5ae43b[_0x398d('0x3e')];if(!_0x3e4c9a[_0x398d('0x40')]['hasOwnProperty'](_0x398d('0x46'))){_0x3d5b3f[_0x398d('0x30')]=qs[_0x398d('0x30')](_0x3e4c9a[_0x398d('0x40')][_0x398d('0x30')]);_0x3d5b3f[_0x398d('0x2f')]=qs[_0x398d('0x2f')](_0x3e4c9a[_0x398d('0x40')][_0x398d('0x2f')]);}_0x3d5b3f['order']=qs[_0x398d('0x47')](_0x3e4c9a[_0x398d('0x40')][_0x398d('0x47')]);_0x3d5b3f[_0x398d('0x48')]=qs[_0x398d('0x41')](_[_0x398d('0x49')](_0x3e4c9a['query'],_0x5ae43b[_0x398d('0x41')]));if(_0x3e4c9a[_0x398d('0x40')]['filter']){_0x3d5b3f[_0x398d('0x48')]=_[_0x398d('0x4a')](_0x3d5b3f[_0x398d('0x48')],{'$or':_['map'](_0x3a860d,function(_0x20f91f){if(_0x20f91f[_0x398d('0x4b')][_0x398d('0x4c')]!==_0x398d('0x4d')){var _0xe87d16={};_0xe87d16[_0x20f91f['field']]={'$like':'%'+_0x3e4c9a[_0x398d('0x40')][_0x398d('0x4e')]+'%'};return _0xe87d16;}})});}_0x3d5b3f=_[_0x398d('0x4a')]({},_0x3d5b3f,_0x3e4c9a['options']);var _0x2e4acb={'where':_0x3d5b3f[_0x398d('0x48')]};return db['ChatGroup'][_0x398d('0x2e')](_0x2e4acb)[_0x398d('0x21')](function(_0x15eab8){_0x244512[_0x398d('0x2e')]=_0x15eab8;if(_0x3e4c9a[_0x398d('0x40')][_0x398d('0x4f')]){_0x3d5b3f[_0x398d('0x50')]=[{'all':!![]}];}return db[_0x398d('0x3c')]['findAll'](_0x3d5b3f);})[_0x398d('0x21')](function(_0x3f146c){_0x244512['rows']=_0x3f146c;return _0x244512;})['then'](respondWithFilteredResult(_0x24cd9b,_0x3d5b3f))[_0x398d('0x2a')](handleError(_0x24cd9b,null));};exports[_0x398d('0x51')]=function(_0x2dff69,_0x35d260){var _0x49a6de={'raw':!![],'where':{'id':_0x2dff69['params']['id']}},_0x40418d={};_0x40418d[_0x398d('0x3e')]=_['keys'](db[_0x398d('0x3c')]['rawAttributes']);_0x40418d['query']=_['keys'](_0x2dff69[_0x398d('0x40')]);_0x40418d[_0x398d('0x41')]=_[_0x398d('0x42')](_0x40418d[_0x398d('0x3e')],_0x40418d['query']);_0x49a6de['attributes']=_[_0x398d('0x42')](_0x40418d[_0x398d('0x3e')],qs[_0x398d('0x44')](_0x2dff69['query'][_0x398d('0x44')]));_0x49a6de[_0x398d('0x43')]=_0x49a6de[_0x398d('0x43')][_0x398d('0x45')]?_0x49a6de[_0x398d('0x43')]:_0x40418d[_0x398d('0x3e')];if(_0x2dff69['query'][_0x398d('0x4f')]){_0x49a6de[_0x398d('0x50')]=[{'all':!![]}];}_0x49a6de=_[_0x398d('0x4a')]({},_0x49a6de,_0x2dff69[_0x398d('0x52')]);return db['ChatGroup'][_0x398d('0x53')](_0x49a6de)[_0x398d('0x21')](handleEntityNotFound(_0x35d260,null))[_0x398d('0x21')](respondWithResult(_0x35d260,null))[_0x398d('0x2a')](handleError(_0x35d260,null));};exports['create']=function(_0x5bee14,_0x891244){return db['ChatGroup'][_0x398d('0x54')](_0x5bee14[_0x398d('0x55')],{})['then'](respondWithResult(_0x891244,0xc9))[_0x398d('0x2a')](handleError(_0x891244,null));};exports['update']=function(_0x2eac8c,_0x185df4){if(_0x2eac8c[_0x398d('0x55')]['id']){delete _0x2eac8c[_0x398d('0x55')]['id'];}return db[_0x398d('0x3c')][_0x398d('0x53')]({'where':{'id':_0x2eac8c[_0x398d('0x56')]['id']}})[_0x398d('0x21')](handleEntityNotFound(_0x185df4,null))[_0x398d('0x21')](saveUpdates(_0x2eac8c[_0x398d('0x55')],null))[_0x398d('0x21')](respondWithResult(_0x185df4,null))[_0x398d('0x2a')](handleError(_0x185df4,null));};exports[_0x398d('0x57')]=function(_0x783c74,_0x16e393){return db[_0x398d('0x3c')][_0x398d('0x53')]({'where':{'id':_0x783c74[_0x398d('0x56')]['id']}})[_0x398d('0x21')](handleEntityNotFound(_0x16e393,null))[_0x398d('0x21')](removeEntity(_0x16e393,null))[_0x398d('0x2a')](handleError(_0x16e393,null));};exports[_0x398d('0x58')]=function(_0x5453b6,_0x12ef87){return db[_0x398d('0x3c')][_0x398d('0x58')]()[_0x398d('0x21')](respondWithResult(_0x12ef87,null))[_0x398d('0x2a')](handleError(_0x12ef87,null));};exports[_0x398d('0x59')]=function(_0x22d30a,_0x256602,_0xe6cf33){return db[_0x398d('0x5a')][_0x398d('0x2e')]({'where':{'ChatGroupId':_0x22d30a['params']['id'],'ToId':_0x22d30a[_0x398d('0x5b')]['id'],'read':![]}})[_0x398d('0x21')](function(_0x545a5d){return{'id':_[_0x398d('0x5c')](_0x22d30a['params']['id']),'count':_0x545a5d};})['then'](respondWithResult(_0x256602,null))['catch'](handleError(_0x256602,null));};exports[_0x398d('0x5d')]=function(_0x38970c,_0x4fc42f,_0x17c11e){return db[_0x398d('0x3c')][_0x398d('0x53')]({'where':{'id':_0x38970c['params']['id']}})[_0x398d('0x21')](handleEntityNotFound(_0x4fc42f,null))[_0x398d('0x21')](function(_0xf582f2){if(_0xf582f2){return _0xf582f2['addMembers'](_0x38970c[_0x398d('0x55')]['ids'],_[_0x398d('0x5e')](_0x38970c['body'],[_0x398d('0x5f'),'id'])||{});}})['then'](respondWithResult(_0x4fc42f,null))[_0x398d('0x2a')](handleError(_0x4fc42f,null));};exports[_0x398d('0x60')]=function(_0x318e5b,_0x322eec,_0x2938d7){var _0x56e3f6={};var _0xa7d084={};var _0x4446d7;var _0x1e150f;return db[_0x398d('0x3c')][_0x398d('0x61')]({'where':{'id':_0x318e5b[_0x398d('0x56')]['id']}})[_0x398d('0x21')](handleEntityNotFound(_0x322eec,null))['then'](function(_0x227661){if(_0x227661){_0x4446d7=_0x227661;_0xa7d084[_0x398d('0x3e')]=_[_0x398d('0x3f')](db['User']['rawAttributes']);_0xa7d084[_0x398d('0x40')]=_[_0x398d('0x3f')](_0x318e5b['query']);_0xa7d084['filters']=_[_0x398d('0x42')](_0xa7d084['model'],_0xa7d084[_0x398d('0x40')]);_0x56e3f6['attributes']=_[_0x398d('0x42')](_0xa7d084['model'],qs['fields'](_0x318e5b['query'][_0x398d('0x44')]));_0x56e3f6[_0x398d('0x43')]=_0x56e3f6[_0x398d('0x43')][_0x398d('0x45')]?_0x56e3f6[_0x398d('0x43')]:_0xa7d084['model'];_0x56e3f6['order']=qs['sort'](_0x318e5b['query'][_0x398d('0x47')]);_0x56e3f6['where']=qs[_0x398d('0x41')](_[_0x398d('0x49')](_0x318e5b[_0x398d('0x40')],_0xa7d084[_0x398d('0x41')]));if(_0x318e5b[_0x398d('0x40')][_0x398d('0x4e')]){_0x56e3f6['where']=_['merge'](_0x56e3f6[_0x398d('0x48')],{'$or':_[_0x398d('0x62')](_0x56e3f6['attributes'],function(_0x801207){var _0x4fbf02={};_0x4fbf02[_0x801207]={'$like':'%'+_0x318e5b[_0x398d('0x40')][_0x398d('0x4e')]+'%'};return _0x4fbf02;})});}_0x56e3f6=_[_0x398d('0x4a')]({},_0x56e3f6,_0x318e5b[_0x398d('0x52')]);return _0x4446d7['getMembers'](_0x56e3f6);}})[_0x398d('0x21')](function(_0x9ccaec){if(_0x9ccaec){_0x1e150f=_0x9ccaec[_0x398d('0x45')];if(!_0x318e5b[_0x398d('0x40')][_0x398d('0x63')]('nolimit')){_0x56e3f6[_0x398d('0x30')]=qs['limit'](_0x318e5b[_0x398d('0x40')][_0x398d('0x30')]);_0x56e3f6[_0x398d('0x2f')]=qs['offset'](_0x318e5b[_0x398d('0x40')][_0x398d('0x2f')]);}return _0x4446d7['getMembers'](_0x56e3f6);}})[_0x398d('0x21')](function(_0x36801f){if(_0x36801f){return _0x36801f?{'count':_0x1e150f,'rows':_0x36801f}:null;}})[_0x398d('0x21')](respondWithResult(_0x322eec,null))['catch'](handleError(_0x322eec,null));};exports['removeMembers']=function(_0x4b1d15,_0x4bc424,_0x441f3b){return db['ChatGroup'][_0x398d('0x53')]({'where':{'id':_0x4b1d15[_0x398d('0x56')]['id']}})[_0x398d('0x21')](handleEntityNotFound(_0x4bc424,null))[_0x398d('0x21')](function(_0x19f1c6){if(_0x19f1c6){return _0x19f1c6[_0x398d('0x64')](_0x4b1d15['query'][_0x398d('0x5f')]);}})[_0x398d('0x21')](respondWithStatusCode(_0x4bc424,null))['catch'](handleError(_0x4bc424,null));};exports[_0x398d('0x65')]=function(_0x2d8aad,_0x24debd,_0x2245ba){if(_0x2d8aad[_0x398d('0x55')]['id']){delete _0x2d8aad[_0x398d('0x55')]['id'];}return db[_0x398d('0x3c')][_0x398d('0x53')]({'where':{'id':_0x2d8aad[_0x398d('0x56')]['id']}})[_0x398d('0x21')](handleEntityNotFound(_0x24debd,null))['then'](function(_0x4732de){if(_0x4732de){_0x2d8aad[_0x398d('0x55')][_0x398d('0x66')]=_0x4732de['id'];return db['ChatInternalMessage'][_0x398d('0x54')](_0x2d8aad[_0x398d('0x55')]);}})[_0x398d('0x21')](respondWithResult(_0x24debd,null))[_0x398d('0x2a')](handleError(_0x24debd,null));};exports[_0x398d('0x67')]=function(_0x2ba660,_0x2f9fba,_0x3d7618){var _0x5f0a88={};var _0x30394c={};var _0x46d4a6;var _0x153834;return db[_0x398d('0x3c')][_0x398d('0x61')]({'where':{'id':_0x2ba660[_0x398d('0x56')]['id']}})['then'](handleEntityNotFound(_0x2f9fba,null))['then'](function(_0xc8f67a){if(_0xc8f67a){_0x46d4a6=_0xc8f67a;_0x30394c[_0x398d('0x3e')]=_[_0x398d('0x3f')](db[_0x398d('0x5a')]['rawAttributes']);_0x30394c['query']=_[_0x398d('0x3f')](_0x2ba660[_0x398d('0x40')]);_0x30394c[_0x398d('0x41')]=_[_0x398d('0x42')](_0x30394c[_0x398d('0x3e')],_0x30394c['query']);_0x5f0a88['attributes']=_['intersection'](_0x30394c[_0x398d('0x3e')],qs[_0x398d('0x44')](_0x2ba660[_0x398d('0x40')][_0x398d('0x44')]));_0x5f0a88[_0x398d('0x43')]=_0x5f0a88[_0x398d('0x43')][_0x398d('0x45')]?_0x5f0a88[_0x398d('0x43')]:_0x30394c[_0x398d('0x3e')];_0x5f0a88[_0x398d('0x68')]=qs[_0x398d('0x47')](_0x2ba660[_0x398d('0x40')][_0x398d('0x47')]);_0x5f0a88[_0x398d('0x48')]=qs[_0x398d('0x41')](_[_0x398d('0x49')](_0x2ba660[_0x398d('0x40')],_0x30394c[_0x398d('0x41')]));if(_0x2ba660['query']['filter']){_0x5f0a88[_0x398d('0x48')]=_[_0x398d('0x4a')](_0x5f0a88[_0x398d('0x48')],{'$or':_['map'](_0x5f0a88[_0x398d('0x43')],function(_0x382cc6){var _0x31f5e1={};_0x31f5e1[_0x382cc6]={'$like':'%'+_0x2ba660[_0x398d('0x40')][_0x398d('0x4e')]+'%'};return _0x31f5e1;})});}if(_0x2ba660[_0x398d('0x40')][_0x398d('0x69')]){var _0x8a9c74=_0x2ba660['query'][_0x398d('0x69')][_0x398d('0x6a')](',');var _0x5caaf1={};_0x5caaf1[_0x8a9c74[0x0]]={'$gte':moment(_0x8a9c74[0x1])[_0x398d('0x6b')](_0x398d('0x6c'))};_0x5f0a88['where']=_['merge'](_0x5f0a88[_0x398d('0x48')],_0x5caaf1);}_0x5f0a88=_[_0x398d('0x4a')]({},_0x5f0a88,_0x2ba660[_0x398d('0x52')]);return _0x46d4a6[_0x398d('0x67')](_0x5f0a88);}})[_0x398d('0x21')](function(_0xcd8e5b){if(_0xcd8e5b){_0x153834=_0xcd8e5b[_0x398d('0x45')];if(!_0x2ba660[_0x398d('0x40')]['hasOwnProperty'](_0x398d('0x46'))){_0x5f0a88[_0x398d('0x30')]=qs[_0x398d('0x30')](_0x2ba660[_0x398d('0x40')][_0x398d('0x30')]);_0x5f0a88[_0x398d('0x2f')]=qs['offset'](_0x2ba660[_0x398d('0x40')]['offset']);}return _0x46d4a6[_0x398d('0x67')](_0x5f0a88);}})['then'](function(_0x3bac12){if(_0x3bac12){return _0x3bac12?{'count':_0x153834,'rows':_0x3bac12}:null;}})[_0x398d('0x21')](respondWithResult(_0x2f9fba,null))[_0x398d('0x2a')](handleError(_0x2f9fba,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 3010db1..e312be0 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 _0xd63a=['update','remove','emit','hook','events','../../mysqldb','ChatGroup','setMaxListeners'];(function(_0x1f5e6b,_0x1cc42e){var _0xb1f130=function(_0x1569df){while(--_0x1569df){_0x1f5e6b['push'](_0x1f5e6b['shift']());}};_0xb1f130(++_0x1cc42e);}(_0xd63a,0x84));var _0xad63=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd63a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xad63('0x0'));var ChatGroup=require(_0xad63('0x1'))['db'][_0xad63('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xad63('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xad63('0x4'),'afterDestroy':_0xad63('0x5')};function emitEvent(_0x1aa51c){return function(_0x5ea3da,_0x5f589e,_0x2f55fc){ChatGroupEvents['emit'](_0x1aa51c+':'+_0x5ea3da['id'],_0x5ea3da);ChatGroupEvents[_0xad63('0x6')](_0x1aa51c,_0x5ea3da);_0x2f55fc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xad63('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x721d=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x721d,0x110));var _0xd721=function(_0xc6e4ea,_0x35edbe){_0xc6e4ea=_0xc6e4ea-0x0;var _0x76c775=_0x721d[_0xc6e4ea];return _0x76c775;};'use strict';var EventEmitter=require(_0xd721('0x0'));var ChatGroup=require(_0xd721('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xd721('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd721('0x3'),'afterDestroy':_0xd721('0x4')};function emitEvent(_0x2ca1f8){return function(_0x35dff6,_0xfcf423,_0x55f421){ChatGroupEvents['emit'](_0x2ca1f8+':'+_0x35dff6['id'],_0x35dff6);ChatGroupEvents[_0xd721('0x5')](_0x2ca1f8,_0x35dff6);_0x55f421(null);};}for(var e in events){if(events[_0xd721('0x6')](e)){var event=events[e];ChatGroup[_0xd721('0x7')](e,emitEvent(event));}}module[_0xd721('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index fb411f0..b8cf503 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 _0x2a26=['chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2a26,0xc1));var _0x62a2=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x2a26[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x62a2('0x0'));var util=require(_0x62a2('0x1'));var logger=require(_0x62a2('0x2'))(_0x62a2('0x3'));var moment=require(_0x62a2('0x4'));var BPromise=require(_0x62a2('0x5'));var rp=require(_0x62a2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x62a2('0x7'));module[_0x62a2('0x8')]=function(_0x57ae6a,_0x1a9b31){return _0x57ae6a[_0x62a2('0x9')](_0x62a2('0xa'),attributes,{'tableName':_0x62a2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdab6=['./chatGroup.attributes','exports','ChatGroup','chat_groups','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x158b15,_0x31ffb0){var _0x5baed4=function(_0x22771d){while(--_0x22771d){_0x158b15['push'](_0x158b15['shift']());}};_0x5baed4(++_0x31ffb0);}(_0xdab6,0x7c));var _0x6dab=function(_0x14cc78,_0x1d6d29){_0x14cc78=_0x14cc78-0x0;var _0x4e5112=_0xdab6[_0x14cc78];return _0x4e5112;};'use strict';var _=require('lodash');var util=require(_0x6dab('0x0'));var logger=require(_0x6dab('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6dab('0x2'));var rp=require(_0x6dab('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6dab('0x4'));var config=require(_0x6dab('0x5'));var attributes=require(_0x6dab('0x6'));module[_0x6dab('0x7')]=function(_0x22272f,_0x31bd01){return _0x22272f['define'](_0x6dab('0x8'),attributes,{'tableName':_0x6dab('0x9'),'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 bd9cbf5..8a2f866 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 _0x7217=['then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request'];(function(_0x20e295,_0x308599){var _0x33ffbe=function(_0x2eeb46){while(--_0x2eeb46){_0x20e295['push'](_0x20e295['shift']());}};_0x33ffbe(++_0x308599);}(_0x7217,0x19e));var _0x7721=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x7217[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});config[_0x7721('0xb')]=_[_0x7721('0xc')](config[_0x7721('0xb')],{'host':_0x7721('0xd'),'port':0x18eb});var socket=require(_0x7721('0xe'))(new Redis(config[_0x7721('0xb')]));require(_0x7721('0xf'))[_0x7721('0x10')](socket);function respondWithRpcPromise(_0x138740,_0x2c3986,_0x578d59){return new BPromise(function(_0x461d1a,_0x29bc8f){return client[_0x7721('0x11')](_0x138740,_0x578d59)[_0x7721('0x12')](function(_0xa8977c){logger[_0x7721('0x13')](_0x7721('0x14'),_0x2c3986,_0x7721('0x15'));logger['debug'](_0x7721('0x16'),_0x2c3986,_0x7721('0x15'),JSON['stringify'](_0xa8977c));if(_0xa8977c[_0x7721('0x17')]){if(_0xa8977c[_0x7721('0x17')][_0x7721('0x18')]===0x1f4){logger[_0x7721('0x17')]('ChatGroup,\x20%s,\x20%s',_0x2c3986,_0xa8977c[_0x7721('0x17')][_0x7721('0x19')]);return _0x29bc8f(_0xa8977c['error']['message']);}logger['error'](_0x7721('0x14'),_0x2c3986,_0xa8977c[_0x7721('0x17')][_0x7721('0x19')]);return _0x461d1a(_0xa8977c[_0x7721('0x17')]['message']);}else{logger[_0x7721('0x13')]('ChatGroup,\x20%s,\x20%s',_0x2c3986,_0x7721('0x15'));_0x461d1a(_0xa8977c['result'][_0x7721('0x19')]);}})[_0x7721('0x1a')](function(_0x3ab5a5){logger[_0x7721('0x17')](_0x7721('0x14'),_0x2c3986,_0x3ab5a5);_0x29bc8f(_0x3ab5a5);});});} \ No newline at end of file +var _0xf021=['redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client'];(function(_0x20ae13,_0x2a0c8e){var _0x533fd5=function(_0x3bb746){while(--_0x3bb746){_0x20ae13['push'](_0x20ae13['shift']());}};_0x533fd5(++_0x2a0c8e);}(_0xf021,0x18f));var _0x1f02=function(_0xb67251,_0x1f6208){_0xb67251=_0xb67251-0x0;var _0x979d96=_0xf021[_0xb67251];return _0x979d96;};'use strict';var _=require(_0x1f02('0x0'));var util=require(_0x1f02('0x1'));var moment=require(_0x1f02('0x2'));var BPromise=require(_0x1f02('0x3'));var rs=require(_0x1f02('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f02('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f02('0x6'))(_0x1f02('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1f02('0x8')]['http']({'port':0x232a});config[_0x1f02('0x9')]=_[_0x1f02('0xa')](config[_0x1f02('0x9')],{'host':_0x1f02('0xb'),'port':0x18eb});var socket=require(_0x1f02('0xc'))(new Redis(config['redis']));require(_0x1f02('0xd'))['register'](socket);function respondWithRpcPromise(_0x569083,_0x5412ed,_0x669b5a){return new BPromise(function(_0x13fb8c,_0x1a93ec){return client[_0x1f02('0xe')](_0x569083,_0x669b5a)[_0x1f02('0xf')](function(_0x5e31e1){logger[_0x1f02('0x10')](_0x1f02('0x11'),_0x5412ed,_0x1f02('0x12'));logger['debug'](_0x1f02('0x13'),_0x5412ed,_0x1f02('0x12'),JSON[_0x1f02('0x14')](_0x5e31e1));if(_0x5e31e1['error']){if(_0x5e31e1['error']['code']===0x1f4){logger[_0x1f02('0x15')](_0x1f02('0x11'),_0x5412ed,_0x5e31e1[_0x1f02('0x15')][_0x1f02('0x16')]);return _0x1a93ec(_0x5e31e1[_0x1f02('0x15')][_0x1f02('0x16')]);}logger[_0x1f02('0x15')](_0x1f02('0x11'),_0x5412ed,_0x5e31e1['error'][_0x1f02('0x16')]);return _0x13fb8c(_0x5e31e1['error']['message']);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x5412ed,_0x1f02('0x12'));_0x13fb8c(_0x5e31e1[_0x1f02('0x17')][_0x1f02('0x16')]);}})['catch'](function(_0x2215f8){logger[_0x1f02('0x15')](_0x1f02('0x11'),_0x5412ed,_0x2215f8);_0x1a93ec(_0x2215f8);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index d40341d..cdcf52c 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 _0x063c=['chatGroup:','save','remove','update','length'];(function(_0x4b728b,_0x72fcf0){var _0x45ce7f=function(_0x644bc){while(--_0x644bc){_0x4b728b['push'](_0x4b728b['shift']());}};_0x45ce7f(++_0x72fcf0);}(_0x063c,0xba));var _0xc063=function(_0x20abbe,_0x2b21c2){_0x20abbe=_0x20abbe-0x0;var _0x41d826=_0x063c[_0x20abbe];return _0x41d826;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xc063('0x0'),_0xc063('0x1'),_0xc063('0x2')];function createListener(_0x25e61c,_0x314f1b){return function(_0x33d075){_0x314f1b['emit'](_0x25e61c,_0x33d075);};}function removeListener(_0x3803ac,_0x5ec48e){return function(){ChatGroupEvents['removeListener'](_0x3803ac,_0x5ec48e);};}exports['register']=function(_0x182d20){for(var _0xe2a646=0x0,_0x57ba85=events[_0xc063('0x3')];_0xe2a646<_0x57ba85;_0xe2a646++){var _0x10716b=events[_0xe2a646];var _0x3f286a=createListener(_0xc063('0x4')+_0x10716b,_0x182d20);ChatGroupEvents['on'](_0x10716b,_0x3f286a);}}; \ No newline at end of file +var _0x66fa=['removeListener','register','length','./chatGroup.events','save','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x66fa,0x168));var _0xa66f=function(_0x4e55b0,_0x29daf4){_0x4e55b0=_0x4e55b0-0x0;var _0x4589bc=_0x66fa[_0x4e55b0];return _0x4589bc;};'use strict';var ChatGroupEvents=require(_0xa66f('0x0'));var events=[_0xa66f('0x1'),_0xa66f('0x2'),'update'];function createListener(_0x4a6840,_0x3dc747){return function(_0x2325d7){_0x3dc747[_0xa66f('0x3')](_0x4a6840,_0x2325d7);};}function removeListener(_0x2e663b,_0x2143e6){return function(){ChatGroupEvents[_0xa66f('0x4')](_0x2e663b,_0x2143e6);};}exports[_0xa66f('0x5')]=function(_0x4532ee){for(var _0x25a7a0=0x0,_0x33bd0d=events[_0xa66f('0x6')];_0x25a7a0<_0x33bd0d;_0x25a7a0++){var _0x5b7cf7=events[_0x25a7a0];var _0x1cf624=createListener('chatGroup:'+_0x5b7cf7,_0x4532ee);ChatGroupEvents['on'](_0x5b7cf7,_0x1cf624);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index eaf2d1d..f945a67 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 _0xc6fe=['describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMembers','addMessage','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index'];(function(_0x1cd94b,_0x3eebce){var _0x2e98d2=function(_0xbbee3f){while(--_0xbbee3f){_0x1cd94b['push'](_0x1cd94b['shift']());}};_0x2e98d2(++_0x3eebce);}(_0xc6fe,0x1a8));var _0xec6f=function(_0x4cb373,_0x3d2a7b){_0x4cb373=_0x4cb373-0x0;var _0x935a9c=_0xc6fe[_0x4cb373];return _0x935a9c;};'use strict';var multer=require('multer');var util=require(_0xec6f('0x0'));var path=require('path');var timeout=require(_0xec6f('0x1'));var express=require(_0xec6f('0x2'));var router=express[_0xec6f('0x3')]();var auth=require(_0xec6f('0x4'));var interaction=require(_0xec6f('0x5'));var config=require(_0xec6f('0x6'));var controller=require(_0xec6f('0x7'));router[_0xec6f('0x8')]('/',auth[_0xec6f('0x9')](),controller[_0xec6f('0xa')]);router[_0xec6f('0x8')]('/describe',auth[_0xec6f('0x9')](),controller[_0xec6f('0xb')]);router['get'](_0xec6f('0xc'),auth['isAuthenticated'](),controller[_0xec6f('0xd')]);router['get'](_0xec6f('0xe'),auth['isAuthenticated'](),controller[_0xec6f('0xf')]);router[_0xec6f('0x8')](_0xec6f('0x10'),auth['isAuthenticated'](),controller[_0xec6f('0x11')]);router[_0xec6f('0x8')](_0xec6f('0x12'),auth[_0xec6f('0x9')](),controller[_0xec6f('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xec6f('0x14')]);router[_0xec6f('0x15')](_0xec6f('0x10'),auth[_0xec6f('0x9')](),controller[_0xec6f('0x16')]);router['post'](_0xec6f('0x12'),auth[_0xec6f('0x9')](),controller[_0xec6f('0x17')]);router[_0xec6f('0x18')](_0xec6f('0xc'),auth[_0xec6f('0x9')](),controller[_0xec6f('0x19')]);router[_0xec6f('0x1a')]('/:id',auth[_0xec6f('0x9')](),controller[_0xec6f('0x1b')]);router[_0xec6f('0x1a')](_0xec6f('0x10'),auth[_0xec6f('0x9')](),controller['removeMembers']);module[_0xec6f('0x1c')]=router; \ No newline at end of file +var _0x685d=['addMessage','put','update','destroy','removeMembers','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMembers'];(function(_0x10d18a,_0x513909){var _0x5e4377=function(_0x51001f){while(--_0x51001f){_0x10d18a['push'](_0x10d18a['shift']());}};_0x5e4377(++_0x513909);}(_0x685d,0xde));var _0xd685=function(_0xee524c,_0x31ed04){_0xee524c=_0xee524c-0x0;var _0x1e202b=_0x685d[_0xee524c];return _0x1e202b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd685('0x0'));var timeout=require(_0xd685('0x1'));var express=require(_0xd685('0x2'));var router=express[_0xd685('0x3')]();var auth=require(_0xd685('0x4'));var interaction=require(_0xd685('0x5'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0xd685('0x6')]('/',auth[_0xd685('0x7')](),controller[_0xd685('0x8')]);router[_0xd685('0x6')](_0xd685('0x9'),auth[_0xd685('0x7')](),controller[_0xd685('0xa')]);router[_0xd685('0x6')](_0xd685('0xb'),auth[_0xd685('0x7')](),controller['show']);router[_0xd685('0x6')](_0xd685('0xc'),auth['isAuthenticated'](),controller[_0xd685('0xd')]);router[_0xd685('0x6')](_0xd685('0xe'),auth[_0xd685('0x7')](),controller[_0xd685('0xf')]);router[_0xd685('0x6')](_0xd685('0x10'),auth[_0xd685('0x7')](),controller[_0xd685('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd685('0x12')]);router[_0xd685('0x13')](_0xd685('0xe'),auth['isAuthenticated'](),controller[_0xd685('0x14')]);router['post'](_0xd685('0x10'),auth['isAuthenticated'](),controller[_0xd685('0x15')]);router[_0xd685('0x16')](_0xd685('0xb'),auth[_0xd685('0x7')](),controller[_0xd685('0x17')]);router['delete'](_0xd685('0xb'),auth[_0xd685('0x7')](),controller[_0xd685('0x18')]);router['delete'](_0xd685('0xe'),auth[_0xd685('0x7')](),controller[_0xd685('0x19')]);module[_0xd685('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index db7e9d6..edf38bb 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 _0x9354=['star','thumb','TEXT','STRING','DATE','long','exports','BOOLEAN','ENUM'];(function(_0x3c0e9a,_0x4390ac){var _0x442bf3=function(_0x388a7c){while(--_0x388a7c){_0x3c0e9a['push'](_0x3c0e9a['shift']());}};_0x442bf3(++_0x4390ac);}(_0x9354,0x96));var _0x4935=function(_0x14915a,_0x222f6b){_0x14915a=_0x14915a-0x0;var _0x2f683c=_0x9354[_0x14915a];return _0x2f683c;};'use strict';var Sequelize=require('sequelize');module[_0x4935('0x0')]={'closed':{'type':Sequelize[_0x4935('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x4935('0x2')](_0x4935('0x3'),_0x4935('0x4')),'defaultValue':_0x4935('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x4935('0x5')]},'mailTranscript':{'type':Sequelize[_0x4935('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x4935('0x7')]},'disposition':{'type':Sequelize[_0x4935('0x6')]},'note':{'type':Sequelize[_0x4935('0x6')]},'browserName':{'type':Sequelize[_0x4935('0x6')]},'browserVersion':{'type':Sequelize[_0x4935('0x6')]},'osName':{'type':Sequelize[_0x4935('0x6')]},'osVersion':{'type':Sequelize[_0x4935('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x4935('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x4935('0x6')]},'customerIp':{'type':Sequelize[_0x4935('0x6')]},'formData':{'type':Sequelize[_0x4935('0x5')](_0x4935('0x8'))},'read1stAt':{'type':Sequelize[_0x4935('0x7')]},'lastMsgAt':{'type':Sequelize[_0x4935('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x4935('0x6')]}}; \ No newline at end of file +var _0x5c00=['ENUM','thumb','star','TEXT','DATE','STRING','long','out','sequelize','exports','BOOLEAN'];(function(_0x45cfd9,_0x253571){var _0x410d47=function(_0x28a7b){while(--_0x28a7b){_0x45cfd9['push'](_0x45cfd9['shift']());}};_0x410d47(++_0x253571);}(_0x5c00,0x17e));var _0x05c0=function(_0x1233d2,_0x5416f4){_0x1233d2=_0x1233d2-0x0;var _0x22759e=_0x5c00[_0x1233d2];return _0x22759e;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'closed':{'type':Sequelize[_0x05c0('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x05c0('0x3')]('star',_0x05c0('0x4')),'defaultValue':_0x05c0('0x5')},'ratingMessage':{'type':Sequelize[_0x05c0('0x6')]},'pathTranscript':{'type':Sequelize[_0x05c0('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x05c0('0x7')]},'disposition':{'type':Sequelize[_0x05c0('0x8')]},'note':{'type':Sequelize[_0x05c0('0x8')]},'browserName':{'type':Sequelize[_0x05c0('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x05c0('0x8')]},'osVersion':{'type':Sequelize[_0x05c0('0x8')]},'deviceModel':{'type':Sequelize[_0x05c0('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x05c0('0x8')]},'referer':{'type':Sequelize[_0x05c0('0x8')]},'customerIp':{'type':Sequelize[_0x05c0('0x8')]},'formData':{'type':Sequelize[_0x05c0('0x6')](_0x05c0('0x9'))},'read1stAt':{'type':Sequelize[_0x05c0('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x05c0('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index a31acfa..8d708e3 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 _0x0bb5=['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','Chat','YYYY-MM-DD','mkdirSync','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','tail','existsSync','createReadStream','pipe','createWriteStream','direction','out','firstName','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','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','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatInteraction.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','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','TagIds','forEach','Tags','push','index','ChatInteraction','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','select','field','color','from','COUNT(*)','chat_messages','me.ChatInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','u.id','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','cm_contacts','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','parse','createdAt','value','startOf','day','utc','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','unreadMessages','\x20IN\x20?','tableAlias','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','\x20>\x20?','\x20<\x20?','c.email','filter','isNil','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','$gte','$lte','null','\x20IS\x20NULL','replace','i.id\x20LIKE\x20?','split','toString','join','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','sequelize','COUNT(me.id)','a.key','Account.key','Contact.firstName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','map','groupBy','ChatInteractionId','all','rows','show','params','includeAll','include','merge','options','find','create','body','describe','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','ValidationError','closed','disposition','AbandonInteraction','attachmentUpload','file','basename','filename','type','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','download','root','mailTranscript','server/files/chat/upload/','now','pathTranscript','ChatMessage','Messages','User','ChatWebsite','CmContact','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','agent_alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailServerOut','Smtp','service','host','port','secure','auth','user','pass','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','pick','findAll','getMyMessages','alias','addTags','setTags','ids','spread','Tag','emit','removeTags','unix','server','files','tmp','transcript-%d-%s.zip','Contact','lastName','Account'];(function(_0x1efd75,_0x507a31){var _0x3ff196=function(_0x15397d){while(--_0x15397d){_0x1efd75['push'](_0x1efd75['shift']());}};_0x3ff196(++_0x507a31);}(_0x0bb5,0x148));var _0x50bb=function(_0x592c4e,_0x31d0c5){_0x592c4e=_0x592c4e-0x0;var _0x11549b=_0x0bb5[_0x592c4e];return _0x11549b;};'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'];config[_0x50bb('0x18')]=_['defaults'](config[_0x50bb('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x50bb('0x19'))(new Redis(config[_0x50bb('0x18')]));require(_0x50bb('0x1a'))['register'](socket);var jayson=require(_0x50bb('0x1b'));var client=jayson[_0x50bb('0x1c')][_0x50bb('0x1d')]({'port':0x232b});var client9004=jayson['client'][_0x50bb('0x1d')]({'port':0x232c});function checkPasswordPattern(_0x5e8478,_0x21befa,_0x3e1a51){if(_0x3e1a51){var _0x253073=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x253073[_0x50bb('0x1e')](_0x21befa)){return _0x5e8478;}else{throw new Error(_0x50bb('0x1f'));}}else{return _0x5e8478;}}function respondWithRpcPromise(_0x4f2897,_0x10a191,_0x174065,_0x4b1f5f){return new BPromise(function(_0x24ba19,_0x4796ec){var _0x301f61=_0x4b1f5f||client;return _0x301f61[_0x50bb('0x20')](_0x4f2897,_0x174065)['then'](function(_0x4f1c0a){logger[_0x50bb('0x21')](_0x50bb('0x22'),_0x10a191,_0x50bb('0x23'));logger[_0x50bb('0x24')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x10a191,_0x50bb('0x23'),JSON[_0x50bb('0x25')](_0x4f1c0a));if(_0x4f1c0a[_0x50bb('0x26')]){if(_0x4f1c0a['error'][_0x50bb('0x27')]===0x1f4){logger[_0x50bb('0x26')](_0x50bb('0x22'),_0x10a191,_0x4f1c0a['error'][_0x50bb('0x28')]);return _0x4796ec(_0x4f1c0a['error'][_0x50bb('0x28')]);}logger[_0x50bb('0x26')](_0x50bb('0x22'),_0x10a191,_0x4f1c0a[_0x50bb('0x26')][_0x50bb('0x28')]);return _0x24ba19(_0x4f1c0a[_0x50bb('0x26')]['message']);}else{logger[_0x50bb('0x21')](_0x50bb('0x22'),_0x10a191,_0x50bb('0x23'));_0x24ba19(_0x4f1c0a[_0x50bb('0x29')]['message']);}})[_0x50bb('0x2a')](function(_0x4d38f7){logger['error'](_0x50bb('0x22'),_0x10a191,_0x4d38f7);_0x4796ec(_0x4d38f7);});});}function respondWithStatusCode(_0x491632,_0x5cfe4b){_0x5cfe4b=_0x5cfe4b||0xcc;return function(_0x41fd89){if(_0x41fd89){return _0x491632[_0x50bb('0x2b')](_0x5cfe4b);}return _0x491632[_0x50bb('0x2c')](_0x5cfe4b)[_0x50bb('0x2d')]();};}function respondWithResult(_0x17c158,_0x269479){_0x269479=_0x269479||0xc8;return function(_0x41a8ad){if(_0x41a8ad){return _0x17c158[_0x50bb('0x2c')](_0x269479)['json'](_0x41a8ad);}};}function respondWithFilteredResult(_0x44ce86,_0x461cf3){return function(_0x15ee2e){if(_0x15ee2e){var _0x1b7c0f=_0x15ee2e[_0x50bb('0x2e')],_0x560b07=_0x461cf3[_0x50bb('0x2f')],_0x13dc3c=_0x461cf3[_0x50bb('0x2f')]+_0x461cf3[_0x50bb('0x30')],_0x1a62fb;if(_0x13dc3c>=_0x1b7c0f){_0x13dc3c=_0x1b7c0f;_0x1a62fb=0xc8;}else{_0x1a62fb=0xce;}_0x44ce86[_0x50bb('0x2c')](_0x1a62fb);return _0x44ce86[_0x50bb('0x31')](_0x50bb('0x32'),_0x560b07+'-'+_0x13dc3c+'/'+_0x1b7c0f)[_0x50bb('0x33')](_0x15ee2e);}return null;};}function patchUpdates(_0x1c2ee2){return function(_0x210b0d){try{jsonpatch['apply'](_0x210b0d,_0x1c2ee2,!![]);}catch(_0x1ae66c){return BPromise[_0x50bb('0x34')](_0x1ae66c);}return _0x210b0d[_0x50bb('0x35')]();};}function saveUpdates(_0x309f3b,_0x2bea60){return function(_0x2db122){if(_0x2db122){return _0x2db122[_0x50bb('0x36')](_0x309f3b)[_0x50bb('0x37')](function(_0x397a0c){return _0x397a0c;});}return null;};}function removeEntity(_0x1cc4e2,_0x34fa35){return function(_0x53d288){if(_0x53d288){return _0x53d288[_0x50bb('0x38')]()[_0x50bb('0x37')](function(){_0x1cc4e2[_0x50bb('0x2c')](0xcc)[_0x50bb('0x2d')]();});}};}function handleEntityNotFound(_0x1faced,_0x3eb8a8){return function(_0x53600a){if(!_0x53600a){_0x1faced['sendStatus'](0x194);}return _0x53600a;};}function handleError(_0x11eee8,_0x5ed0b4){_0x5ed0b4=_0x5ed0b4||0x1f4;return function(_0xa6dbc5){logger[_0x50bb('0x26')](_0xa6dbc5[_0x50bb('0x39')]);if(_0xa6dbc5[_0x50bb('0x3a')]){delete _0xa6dbc5[_0x50bb('0x3a')];}_0x11eee8['status'](_0x5ed0b4)[_0x50bb('0x3b')](_0xa6dbc5);};}function getInteractionUsers(_0x4acf2e,_0x1d1fad){return new BPromise(function(_0xc78d23,_0x280e5a){try{if(_0x1d1fad[_0x4acf2e['id']]){_0x4acf2e['Users']=_['map'](_0x1d1fad[_0x4acf2e['id']],function(_0x1df163){return{'id':_0x1df163['id']};});}}catch(_0x2e904e){_0x280e5a(_0x2e904e);}_0xc78d23(_0x4acf2e);});}function getInteractionTags(_0x43e86f,_0x21a180){return new BPromise(function(_0x51750b,_0x3c273b){try{if(_0x43e86f['TagIds']){_0x43e86f['Tags']=[];_0x43e86f[_0x50bb('0x3c')]['split'](',')[_0x50bb('0x3d')](function(_0x3d94b8){_0x43e86f[_0x50bb('0x3e')][_0x50bb('0x3f')](_0x21a180[_0x3d94b8]);});}delete _0x43e86f[_0x50bb('0x3c')];}catch(_0x437524){_0x3c273b(_0x437524);}_0x51750b(_0x43e86f);});}function updateChatInteraction(_0x2c079a,_0x1cf782,_0x46039a){return new BPromise(function(_0x718128,_0x594f16){return getInteractionUsers(_0x2c079a,_0x46039a)['then'](function(_0x316609){return getInteractionTags(_0x316609,_0x1cf782);})[_0x50bb('0x37')](function(_0x1cf062){_0x718128(_0x1cf062);})[_0x50bb('0x2a')](function(_0x5e8085){_0x594f16(_0x5e8085);});});}exports[_0x50bb('0x40')]=function(_0x4d34f5,_0x8a0b28){var _0x473a4c={},_0x379944={},_0x40748d={'count':0x0,'rows':[]};var _0x1c438b=db[_0x50bb('0x41')][_0x50bb('0x42')];_0x379944[_0x50bb('0x43')]=_[_0x50bb('0x44')](_0x1c438b);_0x379944[_0x50bb('0x45')]=_[_0x50bb('0x44')](_0x4d34f5[_0x50bb('0x45')]);_0x379944[_0x50bb('0x46')]=_[_0x50bb('0x47')](_0x379944[_0x50bb('0x43')],_0x379944[_0x50bb('0x45')]);_0x473a4c['attributes']=_[_0x50bb('0x47')](_0x379944['model'],qs[_0x50bb('0x48')](_0x4d34f5[_0x50bb('0x45')][_0x50bb('0x48')]));_0x473a4c[_0x50bb('0x49')]=_0x473a4c[_0x50bb('0x49')][_0x50bb('0x4a')]?_0x473a4c[_0x50bb('0x49')]:_0x379944[_0x50bb('0x43')];if(!_0x4d34f5[_0x50bb('0x45')][_0x50bb('0x4b')](_0x50bb('0x4c'))){_0x473a4c[_0x50bb('0x30')]=qs[_0x50bb('0x30')](_0x4d34f5[_0x50bb('0x45')]['limit']);_0x473a4c[_0x50bb('0x2f')]=qs['offset'](_0x4d34f5[_0x50bb('0x45')][_0x50bb('0x2f')]);}_0x473a4c[_0x50bb('0x4d')]=qs[_0x50bb('0x4e')](_0x4d34f5[_0x50bb('0x45')][_0x50bb('0x4e')]);_0x473a4c[_0x50bb('0x4f')]=qs[_0x50bb('0x46')](_['pick'](_0x4d34f5[_0x50bb('0x45')],_0x379944[_0x50bb('0x46')]));var _0xf52a22=[];var _0x13afe2=squel[_0x50bb('0x50')]()['field']('id')[_0x50bb('0x51')](_0x50bb('0x3a'))[_0x50bb('0x51')](_0x50bb('0x52'))[_0x50bb('0x53')]('tools_tags');var _0x498dc7=squel[_0x50bb('0x50')]()['field'](_0x50bb('0x54'))['from'](_0x50bb('0x55'),'me')[_0x50bb('0x4f')](_0x50bb('0x56'))['where'](_0x50bb('0x57'))[_0x50bb('0x4f')]('me.read\x20=\x20false');var _0x184147=squel[_0x50bb('0x50')]()[_0x50bb('0x51')](_0x50bb('0x58'))['field'](_0x50bb('0x59'))[_0x50bb('0x53')](_0x50bb('0x5a'),'ui')[_0x50bb('0x5b')](_0x50bb('0x5c'),'u','u.id\x20=\x20ui.UserId');var _0x2a8d82=squel['select']()[_0x50bb('0x53')]('chat_interactions','i')['left_join'](_0x50bb('0x5d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x50bb('0x5c'),'o',_0x50bb('0x5e'))[_0x50bb('0x5b')](_0x50bb('0x5f'),'a',_0x50bb('0x60'))[_0x50bb('0x5b')](_0x50bb('0x55'),'me',_0x50bb('0x61'));var _0x57d749=squel['expr']();if(_0x4d34f5[_0x50bb('0x45')][_0x50bb('0x62')]){var _0xfc2a72=JSON[_0x50bb('0x63')](_0x4d34f5[_0x50bb('0x45')][_0x50bb('0x62')]);_[_0x50bb('0x44')](_0xfc2a72)['forEach'](function(_0x3be83b){var _0x31cfca=_0xfc2a72[_0x3be83b];if(_0x3be83b===_0x50bb('0x64')){var _0x2625ff=moment(_0x31cfca[_0x50bb('0x65')]['dateStart'])[_0x50bb('0x66')](_0x50bb('0x67'))[_0x50bb('0x68')]()[_0x50bb('0x69')]();var _0x2ba758=moment(_0x2ba758)['utc']()[_0x50bb('0x6a')]('day')['format']();_0x57d749[_0x50bb('0x6b')](_0x50bb('0x6c'),_0x2625ff,_0x2ba758);}else{if(_[_0x50bb('0x6d')](_0x31cfca[_0x50bb('0x6e')])){_0x31cfca[_0x50bb('0x6e')][_0x50bb('0x3d')](function(_0x15aaf8){switch(_0x31cfca[_0x50bb('0x6e')][_0x50bb('0x65')]){case'IS':if(_0x3be83b!==_0x50bb('0x6f')&&_0x3be83b!==_0x50bb('0x70')){if(_['isArray'](_0x31cfca[_0x50bb('0x65')])&&_0x31cfca['value'][_0x50bb('0x4a')]>0x1){_0x57d749[_0x50bb('0x6b')](_0x31cfca['tableAlias']+'.'+_0x3be83b+_0x50bb('0x71'),_0x31cfca[_0x50bb('0x65')]);}else{_0x57d749[_0x50bb('0x6b')](_0x31cfca[_0x50bb('0x72')]+'.'+_0x3be83b+_0x50bb('0x73'),_0x31cfca[_0x50bb('0x65')][0x0]);}}break;case'=':_0x57d749[_0x50bb('0x6b')](_0x31cfca[_0x50bb('0x72')]+'.'+_0x3be83b+'\x20=\x20?',_0x31cfca[_0x50bb('0x65')]);break;case _0x50bb('0x74'):if(_0x3be83b===_0x50bb('0x75')){_0x57d749['and'](_0x50bb('0x76')+_0x50bb('0x77'),'%'+_0x31cfca[_0x50bb('0x65')]+'%');_0x57d749['or'](_0x50bb('0x78')+_0x50bb('0x77'),'%'+_0x31cfca[_0x50bb('0x65')]+'%');_0x57d749['or']('c.email'+_0x50bb('0x77'),'%'+_0x31cfca[_0x50bb('0x65')]+'%');}else{_0x57d749[_0x50bb('0x6b')](_0x31cfca[_0x50bb('0x72')]+'.'+_0x3be83b+_0x50bb('0x77'),'%'+_0x31cfca[_0x50bb('0x65')]+'%');}break;case'>':_0x57d749['and'](_0x31cfca[_0x50bb('0x72')]+'.'+_0x3be83b+_0x50bb('0x79'),_0x31cfca[_0x50bb('0x65')]);break;case'<':_0x57d749[_0x50bb('0x6b')](_0x31cfca[_0x50bb('0x72')]+'.'+_0x3be83b+_0x50bb('0x7a'),_0x31cfca[_0x50bb('0x65')]);break;}});}else{switch(_0x31cfca[_0x50bb('0x6e')][_0x50bb('0x65')]){case'IS':if(_0x3be83b!=='TagId'&&_0x3be83b!==_0x50bb('0x70')){if(_[_0x50bb('0x6d')](_0x31cfca[_0x50bb('0x65')])&&_0x31cfca[_0x50bb('0x65')][_0x50bb('0x4a')]>0x1){_0x57d749[_0x50bb('0x6b')](_0x31cfca[_0x50bb('0x72')]+'.'+_0x3be83b+_0x50bb('0x71'),_0x31cfca[_0x50bb('0x65')]);}else{_0x57d749['and'](_0x31cfca['tableAlias']+'.'+_0x3be83b+'\x20=\x20?',_0x31cfca[_0x50bb('0x65')][0x0]);}}break;case'=':_0x57d749['and'](_0x31cfca['tableAlias']+'.'+_0x3be83b+_0x50bb('0x73'),_0x31cfca[_0x50bb('0x65')]);break;case _0x50bb('0x74'):if(_0x3be83b===_0x50bb('0x75')){_0x57d749['and'](_0x50bb('0x76')+_0x50bb('0x77'),'%'+_0x31cfca['value']+'%');_0x57d749['or'](_0x50bb('0x78')+'\x20LIKE\x20?','%'+_0x31cfca[_0x50bb('0x65')]+'%');_0x57d749['or'](_0x50bb('0x7b')+'\x20LIKE\x20?','%'+_0x31cfca[_0x50bb('0x65')]+'%');}else{_0x57d749['and'](_0x31cfca[_0x50bb('0x72')]+'.'+_0x3be83b+_0x50bb('0x77'),'%'+_0x31cfca['value']+'%');}break;case'>':_0x57d749[_0x50bb('0x6b')](_0x31cfca[_0x50bb('0x72')]+'.'+_0x3be83b+_0x50bb('0x79'),_0x31cfca['value']);break;case'<':_0x57d749[_0x50bb('0x6b')](_0x31cfca[_0x50bb('0x72')]+'.'+_0x3be83b+_0x50bb('0x7a'),_0x31cfca[_0x50bb('0x65')]);break;}}}});}else{var _0x5b7949=_(Object[_0x50bb('0x44')](_0x4d34f5[_0x50bb('0x45')]))['map'](function(_0x54f4d0){return _0x1c438b[_0x50bb('0x4b')](_0x54f4d0)?_0x54f4d0:undefined;})[_0x50bb('0x7c')](function(_0x58ad0b){return!_[_0x50bb('0x7d')](_0x58ad0b);})[_0x50bb('0x65')]();if(!_[_0x50bb('0x7e')](_0x5b7949)){_0x5b7949[_0x50bb('0x3d')](function(_0x197798){if(_0x197798==='ChatWebsiteId'){_0x2a8d82['where'](_0x50bb('0x7f'),[][_0x50bb('0x80')](_0x4d34f5[_0x50bb('0x45')][_0x197798]));}else if(_0x197798===_0x50bb('0x64')){var _0x4b51d4=JSON[_0x50bb('0x63')](_0x4d34f5['query'][_0x197798])[_0x50bb('0x81')];var _0x3494f4=JSON[_0x50bb('0x63')](_0x4d34f5[_0x50bb('0x45')][_0x197798])[_0x50bb('0x82')];_0x2a8d82[_0x50bb('0x4f')](_0x50bb('0x6c'),_0x4b51d4,_0x3494f4);}else{if(_0x4d34f5['query'][_0x197798]===_0x50bb('0x83')){_0x2a8d82[_0x50bb('0x4f')]('i.'+_0x197798+_0x50bb('0x84'));}else{_0x2a8d82[_0x50bb('0x4f')]('i.'+_0x197798+_0x50bb('0x73'),_0x4d34f5[_0x50bb('0x45')][_0x197798]);}}});}if(_0x4d34f5[_0x50bb('0x45')]['filter']){var _0x101b4e=_0x4d34f5[_0x50bb('0x45')][_0x50bb('0x7c')][_0x50bb('0x85')]('\x5c','\x5c\x5c')[_0x50bb('0x85')]('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x101b4e)){_0x57d749['or'](_0x50bb('0x86'),_0x101b4e+'%');}else{var _0x47e80f=[];_0x101b4e[_0x50bb('0x87')]('\x20')[_0x50bb('0x3d')](function(_0x58f938){_0x47e80f['push']('+'+_0x58f938[_0x50bb('0x88')]());});var _0x80d34c=_0x47e80f[_0x50bb('0x89')]('\x20');_0x57d749['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x80d34c)['or'](_0x50bb('0x8a'),_0x101b4e+'%');}}}_0x2a8d82[_0x50bb('0x4f')](_0x57d749);if(_0x473a4c[_0x50bb('0x4d')]){_0x473a4c[_0x50bb('0x4d')][_0x50bb('0x3d')](function(_0x3a25a4){_0x2a8d82[_0x50bb('0x4d')]('i.'+_0x3a25a4[0x0],_0x3a25a4[0x1]==='DESC'?![]:!![]);});}_0x2a8d82['group'](_0x50bb('0x8b'));var _0x27ffc5={'type':db[_0x50bb('0x8c')][_0x50bb('0x8d')][_0x50bb('0x8e')],'raw':!![]};var _0x2ed84a=_0x2a8d82[_0x50bb('0x8f')]()[_0x50bb('0x51')](_0x50bb('0x54'))[_0x50bb('0x51')]('COUNT(me.id)',_0x50bb('0x70'));if(!_0x4d34f5[_0x50bb('0x45')][_0x50bb('0x62')]){if(_0x4d34f5[_0x50bb('0x45')][_0x50bb('0x90')]){if(_0x4d34f5[_0x50bb('0x45')][_0x50bb('0x90')]==0x1){_0x2ed84a[_0x50bb('0x91')](_0x50bb('0x92'));_0x2a8d82[_0x50bb('0x91')](_0x50bb('0x92'));}else{_0x2ed84a[_0x50bb('0x91')](_0x50bb('0x93'));_0x2a8d82[_0x50bb('0x91')](_0x50bb('0x93'));}}if(_0x4d34f5['query'][_0x50bb('0x94')]){var _0x28c4ca=_[_0x50bb('0x6d')](_0x4d34f5['query'][_0x50bb('0x94')])?_0x4d34f5[_0x50bb('0x45')][_0x50bb('0x94')]:new Array(_0x4d34f5[_0x50bb('0x45')][_0x50bb('0x94')]);var _0x1ee1bf=squel[_0x50bb('0x95')]();_0x28c4ca[_0x50bb('0x3d')](function(_0x383ad2){_0x1ee1bf['or'](_0x50bb('0x96'),'%,'+_0x383ad2+',%');});_0x2a8d82['having'](_0x1ee1bf);_0x2ed84a[_0x50bb('0x5b')](_0x50bb('0x97'),'it',_0x50bb('0x98'));_0x2ed84a[_0x50bb('0x5b')](_0x50bb('0x99'),'t',_0x50bb('0x9a'));_0x2ed84a[_0x50bb('0x4f')](_0x50bb('0x9b'),_0x28c4ca);}}else{var _0xfc2a72=JSON[_0x50bb('0x63')](_0x4d34f5[_0x50bb('0x45')]['advancedFilter']);_[_0x50bb('0x44')](_0xfc2a72)[_0x50bb('0x3d')](function(_0x32be54){var _0xcd3af6=_0xfc2a72[_0x32be54];if(_0x32be54===_0x50bb('0x6f')){var _0x123a1e=_0xcd3af6['value'];var _0x1548f1=squel['expr']();_0x123a1e[_0x50bb('0x3d')](function(_0x35edd2){_0x1548f1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x35edd2+',%');});_0x2a8d82['having'](_0x1548f1);_0x2ed84a['left_join'](_0x50bb('0x9c'),'it',_0x50bb('0x9d'));_0x2ed84a[_0x50bb('0x5b')](_0x50bb('0x99'),'t',_0x50bb('0x9a'));_0x2ed84a[_0x50bb('0x4f')](_0x50bb('0x9b'),_0x123a1e);}else if(_0x32be54==='unreadMessages'){if(_0xcd3af6[_0x50bb('0x65')]['length']===0x1){if(_0xcd3af6[_0x50bb('0x65')][0x0]===0x1){_0x2ed84a[_0x50bb('0x91')]('`unreadMessages`\x20=\x200');_0x2a8d82['having'](_0x50bb('0x92'));}else{_0x2ed84a['having'](_0x50bb('0x93'));_0x2a8d82[_0x50bb('0x91')](_0x50bb('0x93'));}}}});}db[_0x50bb('0x9e')][_0x50bb('0x45')](_0x2ed84a[_0x50bb('0x88')](),_0x27ffc5)['then'](function(_0xda9b){_0x40748d[_0x50bb('0x2e')]=_0xda9b[_0x50bb('0x4a')];if(_0x40748d[_0x50bb('0x2e')]===0x0)return[];return db[_0x50bb('0x9e')][_0x50bb('0x45')](_0x13afe2[_0x50bb('0x88')](),_0x27ffc5)[_0x50bb('0x37')](function(_0x432e1a){_0xf52a22=_['keyBy'](_0x432e1a,'id');_0x27ffc5=_['merge'](_0x27ffc5,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x2a8d82[_0x50bb('0x51')](_0x50bb('0x9f'),_0x50bb('0x70'));_0x2a8d82['field'](_0x50bb('0xa0'),_0x50bb('0xa1'));_0x2a8d82[_0x50bb('0x51')]('i.*');_0x2a8d82[_0x50bb('0x51')]('c.firstName',_0x50bb('0xa2'));_0x2a8d82[_0x50bb('0x51')](_0x50bb('0x78'),_0x50bb('0xa3'));_0x2a8d82[_0x50bb('0x51')](_0x50bb('0x7b'),_0x50bb('0xa4'));_0x2a8d82['field'](_0x50bb('0xa5'),'Contact.phone');_0x2a8d82[_0x50bb('0x51')](_0x50bb('0xa6'),_0x50bb('0xa7'));_0x2a8d82[_0x50bb('0x51')]('c.fax',_0x50bb('0xa8'));_0x2a8d82[_0x50bb('0x51')](_0x50bb('0xa9'),_0x50bb('0x3c'));_0x2a8d82[_0x50bb('0x5b')]('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id');_0x2a8d82[_0x50bb('0x5b')](_0x50bb('0x99'),'t',_0x50bb('0x9a'));_0x2a8d82[_0x50bb('0x30')](_0x473a4c[_0x50bb('0x30')]);_0x2a8d82[_0x50bb('0x2f')](_0x473a4c[_0x50bb('0x2f')]);return db[_0x50bb('0x9e')][_0x50bb('0x45')](_0x2a8d82['toString'](),_0x27ffc5);})[_0x50bb('0x37')](function(_0x46a774){_0x184147['where'](_0x50bb('0xaa'),_[_0x50bb('0xab')](_0x46a774,'id'));return db[_0x50bb('0x9e')]['query'](_0x184147[_0x50bb('0x88')](),_0x27ffc5)[_0x50bb('0x37')](function(_0x5f17f1){var _0x18a997=_[_0x50bb('0xac')](_0x5f17f1,_0x50bb('0xad'));var _0x105b11=[];_0x46a774['forEach'](function(_0x59d3d0){_0x105b11['push'](updateChatInteraction(_0x59d3d0,_0xf52a22,_0x18a997));});return BPromise[_0x50bb('0xae')](_0x105b11);});});})[_0x50bb('0x37')](function(_0x1c0735){_0x40748d[_0x50bb('0xaf')]=_0x1c0735;return _0x40748d;})[_0x50bb('0x37')](respondWithFilteredResult(_0x8a0b28,_0x473a4c))['catch'](handleError(_0x8a0b28,null));};exports[_0x50bb('0xb0')]=function(_0x21be37,_0x5e9811){var _0x3b1b27={'raw':![],'where':{'id':_0x21be37[_0x50bb('0xb1')]['id']}},_0x523840={};_0x523840[_0x50bb('0x43')]=_[_0x50bb('0x44')](db[_0x50bb('0x41')][_0x50bb('0x42')]);_0x523840[_0x50bb('0x45')]=_['keys'](_0x21be37[_0x50bb('0x45')]);_0x523840[_0x50bb('0x46')]=_[_0x50bb('0x47')](_0x523840[_0x50bb('0x43')],_0x523840[_0x50bb('0x45')]);_0x3b1b27['attributes']=_[_0x50bb('0x47')](_0x523840['model'],qs['fields'](_0x21be37['query'][_0x50bb('0x48')]));_0x3b1b27[_0x50bb('0x49')]=_0x3b1b27[_0x50bb('0x49')][_0x50bb('0x4a')]?_0x3b1b27[_0x50bb('0x49')]:_0x523840[_0x50bb('0x43')];if(_0x21be37[_0x50bb('0x45')][_0x50bb('0xb2')]){_0x3b1b27[_0x50bb('0xb3')]=[{'all':!![]}];}_0x3b1b27=_[_0x50bb('0xb4')]({},_0x3b1b27,_0x21be37[_0x50bb('0xb5')]);return db['ChatInteraction'][_0x50bb('0xb6')](_0x3b1b27)[_0x50bb('0x37')](handleEntityNotFound(_0x5e9811,null))['then'](respondWithResult(_0x5e9811,null))['catch'](handleError(_0x5e9811,null));};exports[_0x50bb('0xb7')]=function(_0x3c3095,_0x2cbec9){return db[_0x50bb('0x41')][_0x50bb('0xb7')](_0x3c3095[_0x50bb('0xb8')],{})['then'](respondWithResult(_0x2cbec9,0xc9))[_0x50bb('0x2a')](handleError(_0x2cbec9,null));};exports['update']=function(_0x4590cb,_0x115ca4){if(_0x4590cb['body']['id']){delete _0x4590cb[_0x50bb('0xb8')]['id'];}return db[_0x50bb('0x41')][_0x50bb('0xb6')]({'where':{'id':_0x4590cb[_0x50bb('0xb1')]['id']}})[_0x50bb('0x37')](handleEntityNotFound(_0x115ca4,null))[_0x50bb('0x37')](saveUpdates(_0x4590cb[_0x50bb('0xb8')],null))['then'](respondWithResult(_0x115ca4,null))[_0x50bb('0x2a')](handleError(_0x115ca4,null));};exports[_0x50bb('0x38')]=function(_0x254111,_0x3e33db){return db[_0x50bb('0x41')][_0x50bb('0xb6')]({'where':{'id':_0x254111[_0x50bb('0xb1')]['id']}})[_0x50bb('0x37')](handleEntityNotFound(_0x3e33db,null))['then'](removeEntity(_0x3e33db,null))[_0x50bb('0x2a')](handleError(_0x3e33db,null));};exports['describe']=function(_0x2e2141,_0x2e8d86){return db[_0x50bb('0x41')][_0x50bb('0xb9')]()[_0x50bb('0x37')](respondWithResult(_0x2e8d86,null))[_0x50bb('0x2a')](handleError(_0x2e8d86,null));};exports['customUpdate']=function(_0x516a05,_0x3772f9){if(_0x516a05[_0x50bb('0xb8')]['id']){delete _0x516a05[_0x50bb('0xb8')]['id'];}return db[_0x50bb('0x41')][_0x50bb('0xb6')]({'where':{'id':_0x516a05[_0x50bb('0xb1')]['id']}})[_0x50bb('0x37')](handleEntityNotFound(_0x3772f9,null))[_0x50bb('0x37')](saveUpdates(_0x516a05[_0x50bb('0xb8')],null))['then'](respondWithResult(_0x3772f9,null))['catch'](handleError(_0x3772f9,null));};exports[_0x50bb('0xba')]=function(_0x682765,_0x9fd0b4,_0x2c0fff){if(_0x682765[_0x50bb('0xb8')]['id']){delete _0x682765[_0x50bb('0xb8')]['id'];}return db['ChatInteraction'][_0x50bb('0xb6')]({'where':{'id':_0x682765[_0x50bb('0xb1')]['id']}})[_0x50bb('0x37')](function(_0x2e7350){if(!_0x2e7350){logger[_0x50bb('0x26')](_0x50bb('0xbb'),'abandon',0x194,'entity\x20not\x20found');_0x9fd0b4[_0x50bb('0x2b')](0x194);}else{if(_0x2e7350[_0x50bb('0xbc')]){throw new db[(_0x50bb('0x8c'))][(_0x50bb('0xbd'))]('Interaction\x20already\x20assigned');}}return _0x2e7350;})[_0x50bb('0x37')](function(_0x530b54){if(_0x530b54){return _0x530b54[_0x50bb('0x36')]({'closed':_0x682765['body'][_0x50bb('0xbe')],'disposition':_0x682765[_0x50bb('0xb8')][_0x50bb('0xbf')]})[_0x50bb('0x37')](function(_0x1cec50){return _0x1cec50;});}})[_0x50bb('0x37')](function(_0x5e6ae3){return respondWithRpcPromise(_0x50bb('0xc0'),_0x50bb('0xba'),_0x682765[_0x50bb('0xb8')],client9004);})[_0x50bb('0x37')](respondWithResult(_0x9fd0b4,null))[_0x50bb('0x2a')](handleError(_0x9fd0b4,null));};exports[_0x50bb('0xc1')]=function(_0x5554d2,_0x49334e,_0x5745ed){_0x5554d2['body'][_0x50bb('0x3a')]=_0x5554d2[_0x50bb('0xc2')]['originalname'];_0x5554d2[_0x50bb('0xb8')][_0x50bb('0xc3')]=_0x5554d2[_0x50bb('0xc2')][_0x50bb('0xc4')];_0x5554d2['body'][_0x50bb('0xc5')]=_0x5554d2[_0x50bb('0xc2')][_0x50bb('0xc6')];return db[_0x50bb('0xc7')][_0x50bb('0xb7')](_0x5554d2[_0x50bb('0xb8')])[_0x50bb('0x37')](respondWithResult(_0x49334e,0xc9))[_0x50bb('0x2a')](handleError(_0x49334e,null));};exports[_0x50bb('0xc8')]=function(_0x2cf5f0,_0x184b15,_0x117563){return db['ChatInteraction'][_0x50bb('0xc9')]({'where':{'id':_0x2cf5f0[_0x50bb('0xb1')]['id']},'raw':!![]})[_0x50bb('0x37')](handleEntityNotFound(_0x184b15,null))[_0x50bb('0x37')](function(_0x59ab85){if(_0x59ab85){if(_0x59ab85['closed']){return _0x184b15[_0x50bb('0x2c')](0x193)[_0x50bb('0x33')]({'status':0x193,'message':_0x50bb('0xca')});}return db[_0x50bb('0xc7')][_0x50bb('0xc9')]({'where':{'id':_0x2cf5f0[_0x50bb('0x45')][_0x50bb('0xcb')]},'raw':!![]})[_0x50bb('0x37')](handleEntityNotFound(_0x184b15,null));}})[_0x50bb('0x37')](function(_0x4a6493){if(_0x4a6493){return _0x184b15[_0x50bb('0xcc')](path[_0x50bb('0x89')](config[_0x50bb('0xcd')],'server/files/attachments/',_0x4a6493['basename']));}})[_0x50bb('0x2a')](handleError(_0x184b15,null));};exports['close']=function(_0xd91d16,_0x193c71){var _0x446ea0=null;var _0x2486a0=null;var _0x47d957=null;var _0x354f07=null;if(_0xd91d16['body']['id']){delete _0xd91d16[_0x50bb('0xb8')]['id'];}if(_0xd91d16[_0x50bb('0xb8')][_0x50bb('0xce')]){_0x354f07=path[_0x50bb('0x89')](config[_0x50bb('0xcd')],_0x50bb('0xcf'),util['format']('transcript-%s.txt',Date[_0x50bb('0xd0')]()));_0xd91d16[_0x50bb('0xb8')][_0x50bb('0xd1')]=_0x354f07;}return db['ChatInteraction'][_0x50bb('0xb6')]({'where':{'id':_0xd91d16[_0x50bb('0xb1')]['id']},'include':[{'model':db[_0x50bb('0xd2')],'as':_0x50bb('0xd3'),'include':[{'model':db[_0x50bb('0xd4')],'as':'User'}]}]})[_0x50bb('0x37')](handleEntityNotFound(_0x193c71,null))[_0x50bb('0x37')](saveUpdates(_0xd91d16['body'],null))['then'](function(_0x60dec9){if(_0x60dec9){_0x446ea0=_0x60dec9;return db[_0x50bb('0xd5')]['find']({'where':{'id':_0x446ea0['ChatWebsiteId']}});}})[_0x50bb('0x37')](function(_0xe67a42){if(_0xe67a42){_0x47d957=_0xe67a42;return db[_0x50bb('0xd6')][_0x50bb('0xb6')]({'where':{'id':_0x446ea0[_0x50bb('0x75')]}});}})[_0x50bb('0x37')](function(_0xae319b){if(_0xae319b){_0x2486a0=_0xae319b;if(_0x354f07){var _0x354e69=null;for(var _0x10154c=0x1;_0x10154c<_0x446ea0[_0x50bb('0xd3')]['length'];++_0x10154c){_0x354e69=_0x446ea0[_0x50bb('0xd3')][_0x10154c];var _0x68cd2c=_0x354e69[_0x50bb('0xbc')]?util[_0x50bb('0x69')](_0x50bb('0xd7'),_0x47d957[_0x50bb('0xd8')],_0x354e69['UserId']):'System';var _0x3b700a=_0xd91d16['body'][_0x50bb('0xd9')]||util[_0x50bb('0x69')](_0x50bb('0xd7'),_0x50bb('0xda'),_0x354e69[_0x50bb('0x75')]);switch(_0x47d957[_0x50bb('0xdb')]){case _0x50bb('0xdc'):_0x68cd2c=_0x354e69[_0x50bb('0xbc')]?util[_0x50bb('0x69')](_0x50bb('0xd7'),_0x47d957[_0x50bb('0xd8')],_0x354e69[_0x50bb('0xbc')]):_0x50bb('0xdd');break;case _0x50bb('0xde'):_0x68cd2c=_0x354e69[_0x50bb('0xbc')]?_0x354e69['User']['alias']||_0x354e69[_0x50bb('0xd4')][_0x50bb('0xdf')]:_0x50bb('0xdd');break;case _0x50bb('0xe0'):_0x68cd2c=_0x354e69['UserId']?_0x354e69['User'][_0x50bb('0xdf')]:_0x50bb('0xdd');break;default:_0x68cd2c=_0x354e69[_0x50bb('0xbc')]?util[_0x50bb('0x69')](_0x50bb('0xd7'),_0x47d957[_0x50bb('0xd8')],_0x354e69[_0x50bb('0xbc')]):'System';}var _0x5e250f=util['format'](_0x50bb('0xe1'),moment(_0x354e69[_0x50bb('0x64')])[_0x50bb('0x69')](_0x50bb('0xe2')),_0x354e69['direction']==='in'?_0x3b700a:_0x68cd2c,_0x354e69[_0x50bb('0xb8')]);if(!_0x354e69[_0x50bb('0xe3')]){fs[_0x50bb('0xe4')](_0x354f07,_0x5e250f);}}return db['MailAccount'][_0x50bb('0xc9')]({'where':{'service':!![]},'include':[{'model':db[_0x50bb('0xe5')],'as':_0x50bb('0xe6'),'raw':!![]}]});}}})[_0x50bb('0x37')](function(_0x4aa60c){if(_0x4aa60c&&_0x4aa60c[_0x50bb('0xe6')]&&_0xd91d16[_0x50bb('0xb8')]){var _0x48c642={'tls':{'rejectUnauthorized':![]}};if(_0x4aa60c[_0x50bb('0xe6')]['service']){_0x48c642[_0x50bb('0xe7')]=_0x4aa60c[_0x50bb('0xe6')][_0x50bb('0xe7')];}else{_0x48c642[_0x50bb('0xe8')]=_0x4aa60c[_0x50bb('0xe6')][_0x50bb('0xe8')];_0x48c642[_0x50bb('0xe9')]=_0x4aa60c[_0x50bb('0xe6')][_0x50bb('0xe9')];_0x48c642[_0x50bb('0xea')]=_0x4aa60c[_0x50bb('0xe6')]['secure'];}if(_0x4aa60c[_0x50bb('0xe6')]['authentication']){_0x48c642[_0x50bb('0xeb')]={'user':_0x4aa60c[_0x50bb('0xe6')][_0x50bb('0xec')],'pass':_0x4aa60c['Smtp'][_0x50bb('0xed')]};}return respondWithRpcPromise('SendMail',_0x50bb('0xee'),{'account':_0x48c642,'message':{'from':util[_0x50bb('0x69')](_0x50bb('0xef'),_0x4aa60c[_0x50bb('0x3a')],_0x4aa60c[_0x50bb('0xf0')]||_0x4aa60c[_0x50bb('0xe6')][_0x50bb('0xec')]),'to':_0xd91d16[_0x50bb('0xb8')][_0x50bb('0xce')],'subject':_0x50bb('0xf1'),'text':util['format'](_0x50bb('0xf2'),_0xd91d16[_0x50bb('0xb8')][_0x50bb('0xce')]),'attachments':[{'path':_0x354f07}]}})[_0x50bb('0x37')](function(){return _0x446ea0;})[_0x50bb('0x2a')](function(_0x4713df){console[_0x50bb('0x26')](_0x4713df);});}else{return _0x446ea0;}})[_0x50bb('0x37')](respondWithStatusCode(_0x193c71,0xc8))[_0x50bb('0x2a')](handleError(_0x193c71,null));};exports[_0x50bb('0xf3')]=function(_0x29246d,_0x3aa7b9,_0x4d7b41){return db[_0x50bb('0xd2')][_0x50bb('0xb6')]({'where':{'id':_0x29246d[_0x50bb('0xb1')]['id']}})['then'](handleEntityNotFound(_0x3aa7b9,null))[_0x50bb('0x37')](function(_0x27d6ff){if(_0x27d6ff){return _0x27d6ff['addMessage'](_0x29246d[_0x50bb('0xb8')]['ids'],_[_0x50bb('0xf4')](_0x29246d['body'],['ids','id'])||{});}})[_0x50bb('0x37')](respondWithResult(_0x3aa7b9,null))[_0x50bb('0x2a')](handleError(_0x3aa7b9,null));};exports['getMessages']=function(_0x251806,_0x3782a8,_0x3adcfc){var _0x752476={'raw':![],'where':{}};var _0x51c3ea={};var _0x25cf4a={'count':0x0,'rows':[]};return db[_0x50bb('0x41')][_0x50bb('0xc9')]({'where':{'id':_0x251806[_0x50bb('0xb1')]['id']}})[_0x50bb('0x37')](handleEntityNotFound(_0x3782a8,null))[_0x50bb('0x37')](function(_0x1d71d5){if(_0x1d71d5){_0x51c3ea[_0x50bb('0x43')]=_['keys'](db['ChatMessage'][_0x50bb('0x42')]);_0x51c3ea['query']=_['keys'](_0x251806[_0x50bb('0x45')]);_0x51c3ea[_0x50bb('0x46')]=_[_0x50bb('0x47')](_0x51c3ea[_0x50bb('0x43')],_0x51c3ea[_0x50bb('0x45')]);_0x752476[_0x50bb('0x49')]=_['intersection'](_0x51c3ea['model'],qs['fields'](_0x251806[_0x50bb('0x45')][_0x50bb('0x48')]));_0x752476['attributes']=_0x752476[_0x50bb('0x49')]['length']?_0x752476[_0x50bb('0x49')]:_0x51c3ea[_0x50bb('0x43')];if(!_0x251806['query'][_0x50bb('0x4b')]('nolimit')){_0x752476[_0x50bb('0x30')]=qs[_0x50bb('0x30')](_0x251806['query'][_0x50bb('0x30')]);_0x752476[_0x50bb('0x2f')]=qs[_0x50bb('0x2f')](_0x251806[_0x50bb('0x45')][_0x50bb('0x2f')]);}_0x752476[_0x50bb('0x4d')]=qs['sort'](_0x251806[_0x50bb('0x45')]['sort']);_0x752476[_0x50bb('0x4f')]=qs[_0x50bb('0x46')](_[_0x50bb('0xf5')](_0x251806[_0x50bb('0x45')],_0x51c3ea[_0x50bb('0x46')]));_0x752476[_0x50bb('0x4f')][_0x50bb('0xad')]=_0x1d71d5['id'];if(_0x251806[_0x50bb('0x45')][_0x50bb('0x7c')]){_0x752476[_0x50bb('0x4f')]=_[_0x50bb('0xb4')](_0x752476['where'],{'$or':_[_0x50bb('0xab')](_0x752476[_0x50bb('0x49')],function(_0x57e641){var _0x2242b1={};_0x2242b1[_0x57e641]={'$like':'%'+_0x251806[_0x50bb('0x45')][_0x50bb('0x7c')]+'%'};return _0x2242b1;})});}if(_0x251806[_0x50bb('0x45')][_0x50bb('0x81')]){var _0x4c0a14=_0x251806[_0x50bb('0x45')][_0x50bb('0x81')][_0x50bb('0x87')](',');var _0x80dcf5={};_0x80dcf5[_0x4c0a14[0x0]]={'$gte':moment(_0x4c0a14[0x1])[_0x50bb('0x69')]('YYYY-MM-DD\x20HH:mm:ss')};_0x752476[_0x50bb('0x4f')]=_[_0x50bb('0xb4')](_0x752476['where'],_0x80dcf5);}_0x752476=_[_0x50bb('0xb4')]({},_0x752476,_0x251806[_0x50bb('0xb5')]);return db[_0x50bb('0xd2')]['count']({'where':_0x752476['where']})[_0x50bb('0x37')](function(_0x322868){_0x25cf4a[_0x50bb('0x2e')]=_0x322868;if(_0x251806['query']['includeAll']){_0x752476[_0x50bb('0xb3')]=[{'all':!![]}];}return db[_0x50bb('0xd2')][_0x50bb('0xf6')](_0x752476);})[_0x50bb('0x37')](function(_0x491dd4){_0x25cf4a[_0x50bb('0xaf')]=_0x491dd4;return _0x25cf4a;});}})[_0x50bb('0x37')](respondWithFilteredResult(_0x3782a8,_0x752476))[_0x50bb('0x2a')](handleError(_0x3782a8,null));};exports[_0x50bb('0xf7')]=function(_0x4b3ef3,_0x28ad38,_0x247524){var _0x4dea9e={'where':{}},_0x4a689c={},_0x3cb6cf={'count':0x0,'rows':[]};return db[_0x50bb('0x41')][_0x50bb('0xc9')]({'where':{'id':_0x4b3ef3['params']['id']}})[_0x50bb('0x37')](handleEntityNotFound(_0x28ad38,null))[_0x50bb('0x37')](function(_0x479b53){if(_0x479b53){_0x4a689c['model']=_[_0x50bb('0x44')](db[_0x50bb('0xd2')][_0x50bb('0x42')]);_0x4a689c['query']=_[_0x50bb('0x44')](_0x4b3ef3['query']);_0x4a689c[_0x50bb('0x46')]=_[_0x50bb('0x47')](_0x4a689c[_0x50bb('0x43')],_0x4a689c[_0x50bb('0x45')]);_0x4dea9e['attributes']=_[_0x50bb('0x47')](_0x4a689c['model'],qs[_0x50bb('0x48')](_0x4b3ef3[_0x50bb('0x45')][_0x50bb('0x48')]));_0x4dea9e[_0x50bb('0x49')]=_0x4dea9e[_0x50bb('0x49')]['length']?_0x4dea9e[_0x50bb('0x49')]:_0x4a689c[_0x50bb('0x43')];if(!_0x4b3ef3[_0x50bb('0x45')]['hasOwnProperty'](_0x50bb('0x4c'))){_0x4dea9e[_0x50bb('0x30')]=qs[_0x50bb('0x30')](_0x4b3ef3[_0x50bb('0x45')][_0x50bb('0x30')]);_0x4dea9e[_0x50bb('0x2f')]=qs[_0x50bb('0x2f')](_0x4b3ef3[_0x50bb('0x45')][_0x50bb('0x2f')]);}_0x4dea9e[_0x50bb('0x4d')]=qs[_0x50bb('0x4e')](_0x4b3ef3['query'][_0x50bb('0x4e')]);_0x4dea9e[_0x50bb('0x4f')]=qs[_0x50bb('0x46')](_[_0x50bb('0xf5')](_0x4b3ef3[_0x50bb('0x45')],_0x4a689c[_0x50bb('0x46')]));_0x4dea9e['where'][_0x50bb('0xad')]=_0x479b53['id'];if(_0x4b3ef3[_0x50bb('0x45')][_0x50bb('0x7c')]){_0x4dea9e['where']=_[_0x50bb('0xb4')](_0x4dea9e[_0x50bb('0x4f')],{'$or':_[_0x50bb('0xab')](_0x4dea9e['attributes'],function(_0x3a1be6){var _0x362f84={};_0x362f84[_0x3a1be6]={'$like':'%'+_0x4b3ef3[_0x50bb('0x45')][_0x50bb('0x7c')]+'%'};return _0x362f84;})});}_0x4dea9e[_0x50bb('0x4f')][_0x50bb('0xe3')]=![];if(_0x4b3ef3[_0x50bb('0x45')]['id']){_0x4dea9e[_0x50bb('0x4f')]['id']={'$gt':_0x4b3ef3['query']['id']};}_0x4dea9e=_[_0x50bb('0xb4')]({},_0x4dea9e,_0x4b3ef3[_0x50bb('0xb5')]);return db['ChatMessage'][_0x50bb('0x2e')]({'where':_0x4dea9e[_0x50bb('0x4f')]})[_0x50bb('0x37')](function(_0x27dab8){_0x3cb6cf[_0x50bb('0x2e')]=_0x27dab8;_0x4dea9e[_0x50bb('0xb3')]=[];if(_0x4b3ef3[_0x50bb('0x45')]['includeAgent']){_0x4dea9e[_0x50bb('0xb3')]['push']({'model':db[_0x50bb('0xd4')],'as':_0x50bb('0xd4'),'attributes':['id',_0x50bb('0xdf'),_0x50bb('0xf8')]});}if(_0x4b3ef3[_0x50bb('0x45')][_0x50bb('0xb2')]){_0x4dea9e['include']=[{'all':!![]}];}return db['ChatMessage'][_0x50bb('0xf6')](_0x4dea9e);})[_0x50bb('0x37')](function(_0x167e3a){_0x3cb6cf[_0x50bb('0xaf')]=_0x167e3a;return _0x3cb6cf;});}})['then'](respondWithFilteredResult(_0x28ad38,_0x4dea9e))[_0x50bb('0x2a')](handleError(_0x28ad38,null));};exports[_0x50bb('0xf9')]=function(_0x59cb65,_0xf22240,_0x25c453){return db[_0x50bb('0x41')][_0x50bb('0xb6')]({'where':{'id':_0x59cb65[_0x50bb('0xb1')]['id']}})[_0x50bb('0x37')](handleEntityNotFound(_0xf22240,null))[_0x50bb('0x37')](function(_0x5b2619){if(_0x5b2619){return _0x5b2619[_0x50bb('0xfa')](_0x59cb65[_0x50bb('0xb8')][_0x50bb('0xfb')],_[_0x50bb('0xf4')](_0x59cb65[_0x50bb('0xb8')],['ids','id'])||{})[_0x50bb('0xfc')](function(){return db[_0x50bb('0xfd')][_0x50bb('0xf6')]({'attributes':['id',_0x50bb('0x3a'),_0x50bb('0x52')],'where':{'id':_0x59cb65[_0x50bb('0xb8')][_0x50bb('0xfb')]}});})[_0x50bb('0x37')](function(_0x14a999){socket[_0x50bb('0xfe')]('chatInteractionTags:save',{'id':Number(_0x59cb65[_0x50bb('0xb1')]['id']),'tags':_0x14a999||[]});return{'id':Number(_0x59cb65[_0x50bb('0xb1')]['id']),'tags':_0x14a999||[]};});}})['then'](respondWithResult(_0xf22240,null))['catch'](handleError(_0xf22240,null));};exports[_0x50bb('0xff')]=function(_0x5cf6b2,_0x34125e,_0x5b7cad){return db[_0x50bb('0x41')]['find']({'where':{'id':_0x5cf6b2['params']['id']}})[_0x50bb('0x37')](handleEntityNotFound(_0x34125e,null))[_0x50bb('0x37')](function(_0x52ac61){if(_0x52ac61){return _0x52ac61[_0x50bb('0xff')](_0x5cf6b2[_0x50bb('0x45')][_0x50bb('0xfb')]);}})[_0x50bb('0x37')](respondWithStatusCode(_0x34125e,null))[_0x50bb('0x2a')](handleError(_0x34125e,null));};exports['download']=function(_0xc549a1,_0x560b24){var _0x46d250=moment()[_0x50bb('0x100')]()[_0x50bb('0x88')]();var _0x1153ed=path[_0x50bb('0x89')](config[_0x50bb('0xcd')],_0x50bb('0x101'),_0x50bb('0x102'),_0x50bb('0x103'));var _0x3bbfa1=path['join'](config[_0x50bb('0xcd')],_0x50bb('0x101'),_0x50bb('0x102'),'attachments');var _0x2dccbb=path['join'](_0x1153ed,_0x46d250);var _0x373a90=util[_0x50bb('0x69')](_0x50bb('0x104'),_0xc549a1['params']['id'],_0x46d250);var _0x7e94e5=path[_0x50bb('0x89')](_0x1153ed,_0x373a90);var _0x59ffdd=![];return db[_0x50bb('0x41')]['find']({'where':{'id':_0xc549a1[_0x50bb('0xb1')]['id']},'include':[{'model':db[_0x50bb('0xd2')],'as':_0x50bb('0xd3'),'attributes':['id',_0x50bb('0xb8'),_0x50bb('0x64'),'direction','secret'],'include':[{'model':db['User'],'as':'User','attributes':['id',_0x50bb('0xdf')],'raw':!![]},{'model':db[_0x50bb('0xd6')],'as':_0x50bb('0x105'),'attributes':['id','firstName',_0x50bb('0x106')],'raw':!![]},{'model':db['Attachment'],'as':'Attachment','raw':!![]}]},{'model':db[_0x50bb('0xd5')],'as':_0x50bb('0x107'),'attributes':['id','name']},{'model':db['User'],'as':_0x50bb('0x108'),'attributes':['id',_0x50bb('0xdf')]}]})[_0x50bb('0x37')](handleEntityNotFound(_0x560b24,null))[_0x50bb('0x37')](function(_0x1a4a2c){if(_0x1a4a2c){var _0x311be7=_0x1a4a2c[_0x50bb('0x109')]({'plain':!![]});_0x59ffdd=!![];var _0x45a7ff={'format':'A4','border':_0x50bb('0x10a'),'header':{'height':_0x50bb('0x10b'),'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':_0x50bb('0x10c'),'contents':{'default':util[_0x50bb('0x69')](_0x50bb('0x10d'),util[_0x50bb('0x69')](_0x50bb('0x10e'),_0x50bb('0x10f'),_0x311be7['id']),moment()[_0x50bb('0x69')](_0x50bb('0x110'))[_0x50bb('0x88')]())}}};fs[_0x50bb('0x111')](_0x2dccbb);var _0x21f175={'channel':'Chat','account':_0x311be7['Account'][_0x50bb('0x3a')],'agent':_0x311be7[_0x50bb('0x108')]?_0x311be7[_0x50bb('0x108')][_0x50bb('0xdf')]:'N.A.','createdAt':moment(_0x311be7[_0x50bb('0x64')])['format'](_0x50bb('0x112'))[_0x50bb('0x88')](),'closedAt':_0x311be7[_0x50bb('0xbe')]?moment(_0x311be7[_0x50bb('0x113')])[_0x50bb('0x69')](_0x50bb('0x112'))[_0x50bb('0x88')]():'','disposition':_0x311be7[_0x50bb('0xbf')],'chatInfo':{'browser':_0x311be7[_0x50bb('0x114')],'os':_0x311be7[_0x50bb('0x115')],'referer':_0x311be7[_0x50bb('0x116')],'customerIp':_0x311be7[_0x50bb('0x117')]},'messages':_(_0x311be7['Messages'])[_0x50bb('0x118')]()['filter']({'secret':![]})['map'](function(_0x930f91){if(_0x930f91['Attachment']){var _0x5016da=path[_0x50bb('0x89')](_0x3bbfa1,_0x930f91['Attachment']['basename']);if(fs[_0x50bb('0x119')](_0x5016da)){fs[_0x50bb('0x11a')](_0x5016da)[_0x50bb('0x11b')](fs[_0x50bb('0x11c')](path['join'](_0x2dccbb,_0x930f91['Attachment']['basename'])));}}return{'date':moment(_0x930f91[_0x50bb('0x64')])[_0x50bb('0x69')](_0x50bb('0x112'))[_0x50bb('0x88')](),'sender':_0x930f91[_0x50bb('0x11d')]===_0x50bb('0x11e')?_0x930f91[_0x50bb('0xd4')]?_0x930f91[_0x50bb('0xd4')][_0x50bb('0xdf')]:_0x50bb('0xdd'):_0x930f91[_0x50bb('0x105')][_0x50bb('0x11f')]+(_0x930f91[_0x50bb('0x105')]['lastName']?'\x20'+_0x930f91['Contact'][_0x50bb('0x106')]:''),'body':_0x930f91[_0x50bb('0xc7')]?_0x930f91[_0x50bb('0xc7')][_0x50bb('0xc3')]:_0x930f91[_0x50bb('0xb8')],'direction':_0x930f91[_0x50bb('0x11d')]==='out'?'A':'C','secret':_0x930f91[_0x50bb('0xe3')],'attachment':_0x930f91['Attachment']};})[_0x50bb('0x65')]()};return ejs[_0x50bb('0x120')](path[_0x50bb('0x89')](config[_0x50bb('0xcd')],_0x50bb('0x101'),_0x50bb('0x121'),_0x50bb('0x122')),{'interaction':_0x21f175})[_0x50bb('0x37')](function(_0x47f2f3){return new BPromise(function(_0x145850,_0x756b0b){pdf[_0x50bb('0xb7')](_0x47f2f3,_0x45a7ff)[_0x50bb('0x123')](path[_0x50bb('0x89')](_0x2dccbb,_0x50bb('0x124')+_0x311be7['id']+'-'+_0x46d250+_0x50bb('0x125')),function(_0x361b18,_0x12fd05){if(_0x361b18)return _0x756b0b(_0x361b18);_0x145850(_0x12fd05);});});});}})[_0x50bb('0x37')](function(){if(_0x59ffdd){return new BPromise(function(_0x2efcbf,_0xe2ccbe){zipdir(_0x2dccbb,{'saveTo':_0x7e94e5},function(_0x5b7cc8,_0x3f83f7){if(_0x5b7cc8)return _0xe2ccbe(_0x5b7cc8);return _0x2efcbf(_0x3f83f7);});})[_0x50bb('0x37')](function(){return new BPromise(function(_0x30d8c4,_0x40efdb){rimraf(_0x2dccbb,function(_0x56c30b){if(_0x56c30b)_0x40efdb(_0x56c30b);return _0x30d8c4();});});})[_0x50bb('0x37')](function(){return _0x560b24[_0x50bb('0xcc')](_0x7e94e5,_0x373a90,function(_0x57f622){if(_0x57f622){console[_0x50bb('0x126')](_0x50bb('0x127'),_0x57f622);}else{fs['unlinkSync'](_0x7e94e5);}});});}else{return _0x560b24[_0x50bb('0x2b')](0xc8);}})[_0x50bb('0x2a')](handleError(_0x560b24,null));}; \ No newline at end of file +var _0xcea2=['pass','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','secret','rows','addTags','spread','Tag','color','chatInteractionTags:save','removeTags','unix','server','files','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Attachment','Account','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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','YYYY-MM-DD','Chat','Owner','closedAt','browserName','osName','referer','customerIp','tail','existsSync','createReadStream','out','direction','renderFile','downloadInteraction.html','toFile','transcript-','log','err','unlinkSync','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','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/utils','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','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','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','stack','name','send','TagIds','Tags','split','forEach','push','ChatInteraction','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','from','tools_tags','chat_messages','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','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','me.ChatInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','parse','advancedFilter','createdAt','value','dateStart','startOf','utc','format','endOf','and','isArray','condition','TagId','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','\x20<\x20?','unreadMessages','c.email','\x20>\x20?','filter','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','group','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.ChatInteractionId\x20=\x20i.id','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','sequelize','toString','keyBy','merge','a.key','Account.key','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','chat_interaction_has_tags','ui.ChatInteractionId\x20IN\x20?','map','groupBy','ChatInteractionId','all','show','params','include','options','find','create','body','update','describe','abandon','UserId','ValidationError','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','type','mimetype','attachmentDownload','findOne','Unauthorized','attachId','download','join','root','server/files/attachments/','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','ChatMessage','User','ChatWebsite','CmContact','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','fullname','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','user'];(function(_0x53a968,_0x4fdd9d){var _0x4102a1=function(_0x37c0d2){while(--_0x37c0d2){_0x53a968['push'](_0x53a968['shift']());}};_0x4102a1(++_0x4fdd9d);}(_0xcea2,0x15a));var _0x2cea=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xcea2[_0x45d3f0];return _0x314b79;};'use strict';var pdf=require(_0x2cea('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2cea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2cea('0x2'));var rp=require(_0x2cea('0x3'));var moment=require(_0x2cea('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2cea('0x5'));var util=require(_0x2cea('0x6'));var path=require(_0x2cea('0x7'));var sox=require('sox');var csv=require(_0x2cea('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2cea('0x9'));var squel=require(_0x2cea('0xa'));var crypto=require(_0x2cea('0xb'));var jsforce=require(_0x2cea('0xc'));var deskjs=require(_0x2cea('0xd'));var toCsv=require(_0x2cea('0x8'));var querystring=require('querystring');var Papa=require(_0x2cea('0xe'));var Redis=require(_0x2cea('0xf'));var authService=require(_0x2cea('0x10'));var qs=require(_0x2cea('0x11'));var hardwareService=require(_0x2cea('0x12'));var logger=require(_0x2cea('0x13'))(_0x2cea('0x14'));var utils=require(_0x2cea('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x2cea('0x16')]=_[_0x2cea('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2cea('0x18'))(new Redis(config['redis']));require(_0x2cea('0x19'))[_0x2cea('0x1a')](socket);var jayson=require(_0x2cea('0x1b'));var client=jayson['client']['http']({'port':0x232b});var client9004=jayson['client'][_0x2cea('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x586ad5,_0x3c7130,_0x338669){if(_0x338669){var _0x981e3f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x981e3f[_0x2cea('0x1d')](_0x3c7130)){return _0x586ad5;}else{throw new Error(_0x2cea('0x1e'));}}else{return _0x586ad5;}}function respondWithRpcPromise(_0x1bbfdb,_0x3530d7,_0x1ead4c,_0x5eee09){return new BPromise(function(_0x19927a,_0x464f7d){var _0x20c46c=_0x5eee09||client;return _0x20c46c[_0x2cea('0x1f')](_0x1bbfdb,_0x1ead4c)[_0x2cea('0x20')](function(_0x17dc48){logger['info'](_0x2cea('0x21'),_0x3530d7,'request\x20sent');logger[_0x2cea('0x22')](_0x2cea('0x23'),_0x3530d7,_0x2cea('0x24'),JSON['stringify'](_0x17dc48));if(_0x17dc48[_0x2cea('0x25')]){if(_0x17dc48[_0x2cea('0x25')][_0x2cea('0x26')]===0x1f4){logger[_0x2cea('0x25')](_0x2cea('0x21'),_0x3530d7,_0x17dc48[_0x2cea('0x25')][_0x2cea('0x27')]);return _0x464f7d(_0x17dc48['error'][_0x2cea('0x27')]);}logger['error'](_0x2cea('0x21'),_0x3530d7,_0x17dc48['error'][_0x2cea('0x27')]);return _0x19927a(_0x17dc48[_0x2cea('0x25')]['message']);}else{logger[_0x2cea('0x28')](_0x2cea('0x21'),_0x3530d7,_0x2cea('0x24'));_0x19927a(_0x17dc48[_0x2cea('0x29')][_0x2cea('0x27')]);}})[_0x2cea('0x2a')](function(_0x5d032f){logger[_0x2cea('0x25')](_0x2cea('0x21'),_0x3530d7,_0x5d032f);_0x464f7d(_0x5d032f);});});}function respondWithStatusCode(_0x2bbe9b,_0x32af98){_0x32af98=_0x32af98||0xcc;return function(_0x46ef5a){if(_0x46ef5a){return _0x2bbe9b[_0x2cea('0x2b')](_0x32af98);}return _0x2bbe9b[_0x2cea('0x2c')](_0x32af98)[_0x2cea('0x2d')]();};}function respondWithResult(_0x4e9cab,_0xff69ad){_0xff69ad=_0xff69ad||0xc8;return function(_0x128863){if(_0x128863){return _0x4e9cab['status'](_0xff69ad)[_0x2cea('0x2e')](_0x128863);}};}function respondWithFilteredResult(_0xc398c5,_0x271b2f){return function(_0x16cf9f){if(_0x16cf9f){var _0x5e0519=_0x16cf9f[_0x2cea('0x2f')],_0x3c0066=_0x271b2f[_0x2cea('0x30')],_0x128934=_0x271b2f[_0x2cea('0x30')]+_0x271b2f[_0x2cea('0x31')],_0x4a51e5;if(_0x128934>=_0x5e0519){_0x128934=_0x5e0519;_0x4a51e5=0xc8;}else{_0x4a51e5=0xce;}_0xc398c5[_0x2cea('0x2c')](_0x4a51e5);return _0xc398c5[_0x2cea('0x32')](_0x2cea('0x33'),_0x3c0066+'-'+_0x128934+'/'+_0x5e0519)[_0x2cea('0x2e')](_0x16cf9f);}return null;};}function patchUpdates(_0x2e1cd6){return function(_0x1e721b){try{jsonpatch[_0x2cea('0x34')](_0x1e721b,_0x2e1cd6,!![]);}catch(_0x47ea58){return BPromise[_0x2cea('0x35')](_0x47ea58);}return _0x1e721b[_0x2cea('0x36')]();};}function saveUpdates(_0x18a287,_0x1bd2a5){return function(_0x5a0061){if(_0x5a0061){return _0x5a0061['update'](_0x18a287)[_0x2cea('0x20')](function(_0x1451f2){return _0x1451f2;});}return null;};}function removeEntity(_0x5eefbf,_0x381ad7){return function(_0x49d851){if(_0x49d851){return _0x49d851[_0x2cea('0x37')]()['then'](function(){_0x5eefbf[_0x2cea('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c3e1b,_0x4518eb){return function(_0x5d254d){if(!_0x5d254d){_0x2c3e1b[_0x2cea('0x2b')](0x194);}return _0x5d254d;};}function handleError(_0x1e6c30,_0x55b4d1){_0x55b4d1=_0x55b4d1||0x1f4;return function(_0x24b67d){logger[_0x2cea('0x25')](_0x24b67d[_0x2cea('0x38')]);if(_0x24b67d[_0x2cea('0x39')]){delete _0x24b67d[_0x2cea('0x39')];}_0x1e6c30['status'](_0x55b4d1)[_0x2cea('0x3a')](_0x24b67d);};}function getInteractionUsers(_0x69e6e8,_0x57037f){return new BPromise(function(_0x53c088,_0x1913a2){try{if(_0x57037f[_0x69e6e8['id']]){_0x69e6e8['Users']=_['map'](_0x57037f[_0x69e6e8['id']],function(_0x4bd760){return{'id':_0x4bd760['id']};});}}catch(_0x50f632){_0x1913a2(_0x50f632);}_0x53c088(_0x69e6e8);});}function getInteractionTags(_0x9d3f2,_0xb5b358){return new BPromise(function(_0x53d597,_0x219560){try{if(_0x9d3f2[_0x2cea('0x3b')]){_0x9d3f2[_0x2cea('0x3c')]=[];_0x9d3f2['TagIds'][_0x2cea('0x3d')](',')[_0x2cea('0x3e')](function(_0x352f60){_0x9d3f2[_0x2cea('0x3c')][_0x2cea('0x3f')](_0xb5b358[_0x352f60]);});}delete _0x9d3f2[_0x2cea('0x3b')];}catch(_0x3afee0){_0x219560(_0x3afee0);}_0x53d597(_0x9d3f2);});}function updateChatInteraction(_0xdcec25,_0x2cfa0e,_0x27677c){return new BPromise(function(_0x3c0b91,_0x1516a2){return getInteractionUsers(_0xdcec25,_0x27677c)[_0x2cea('0x20')](function(_0x22a002){return getInteractionTags(_0x22a002,_0x2cfa0e);})[_0x2cea('0x20')](function(_0x28bb35){_0x3c0b91(_0x28bb35);})[_0x2cea('0x2a')](function(_0xa0692d){_0x1516a2(_0xa0692d);});});}exports['index']=function(_0x294057,_0x4da411){var _0x29ab58={},_0x1afbb9={},_0x22ce6b={'count':0x0,'rows':[]};var _0x5b5d71=db[_0x2cea('0x40')][_0x2cea('0x41')];_0x1afbb9[_0x2cea('0x42')]=_[_0x2cea('0x43')](_0x5b5d71);_0x1afbb9[_0x2cea('0x44')]=_[_0x2cea('0x43')](_0x294057['query']);_0x1afbb9['filters']=_[_0x2cea('0x45')](_0x1afbb9[_0x2cea('0x42')],_0x1afbb9['query']);_0x29ab58[_0x2cea('0x46')]=_['intersection'](_0x1afbb9[_0x2cea('0x42')],qs['fields'](_0x294057[_0x2cea('0x44')][_0x2cea('0x47')]));_0x29ab58[_0x2cea('0x46')]=_0x29ab58[_0x2cea('0x46')][_0x2cea('0x48')]?_0x29ab58[_0x2cea('0x46')]:_0x1afbb9[_0x2cea('0x42')];if(!_0x294057[_0x2cea('0x44')][_0x2cea('0x49')](_0x2cea('0x4a'))){_0x29ab58['limit']=qs[_0x2cea('0x31')](_0x294057[_0x2cea('0x44')][_0x2cea('0x31')]);_0x29ab58[_0x2cea('0x30')]=qs['offset'](_0x294057['query'][_0x2cea('0x30')]);}_0x29ab58[_0x2cea('0x4b')]=qs[_0x2cea('0x4c')](_0x294057['query'][_0x2cea('0x4c')]);_0x29ab58[_0x2cea('0x4d')]=qs[_0x2cea('0x4e')](_[_0x2cea('0x4f')](_0x294057['query'],_0x1afbb9[_0x2cea('0x4e')]));var _0x526e92=[];var _0x4d1b77=squel[_0x2cea('0x50')]()[_0x2cea('0x51')]('id')[_0x2cea('0x51')](_0x2cea('0x39'))['field']('color')[_0x2cea('0x52')](_0x2cea('0x53'));var _0x464b89=squel[_0x2cea('0x50')]()['field']('COUNT(*)')['from'](_0x2cea('0x54'),'me')[_0x2cea('0x4d')](_0x2cea('0x55'))[_0x2cea('0x4d')](_0x2cea('0x56'))[_0x2cea('0x4d')](_0x2cea('0x57'));var _0x4d31dc=squel[_0x2cea('0x50')]()[_0x2cea('0x51')](_0x2cea('0x58'))['field'](_0x2cea('0x59'))['from'](_0x2cea('0x5a'),'ui')[_0x2cea('0x5b')](_0x2cea('0x5c'),'u',_0x2cea('0x5d'));var _0x280483=squel[_0x2cea('0x50')]()[_0x2cea('0x52')](_0x2cea('0x5e'),'i')['left_join'](_0x2cea('0x5f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x2cea('0x5b')](_0x2cea('0x5c'),'o',_0x2cea('0x60'))['left_join'](_0x2cea('0x61'),'a','a.id\x20=\x20i.ChatWebsiteId')['left_join'](_0x2cea('0x54'),'me',_0x2cea('0x62'));var _0x28e720=squel[_0x2cea('0x63')]();if(_0x294057[_0x2cea('0x44')]['advancedFilter']){var _0x41705c=JSON[_0x2cea('0x64')](_0x294057[_0x2cea('0x44')][_0x2cea('0x65')]);_[_0x2cea('0x43')](_0x41705c)['forEach'](function(_0x45e8c5){var _0x5ae31b=_0x41705c[_0x45e8c5];if(_0x45e8c5===_0x2cea('0x66')){var _0x3a7daf=moment(_0x5ae31b[_0x2cea('0x67')][_0x2cea('0x68')])[_0x2cea('0x69')]('day')[_0x2cea('0x6a')]()[_0x2cea('0x6b')]();var _0x2c6dd4=moment(_0x2c6dd4)[_0x2cea('0x6a')]()[_0x2cea('0x6c')]('day')[_0x2cea('0x6b')]();_0x28e720[_0x2cea('0x6d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a7daf,_0x2c6dd4);}else{if(_[_0x2cea('0x6e')](_0x5ae31b[_0x2cea('0x6f')])){_0x5ae31b[_0x2cea('0x6f')][_0x2cea('0x3e')](function(_0x548dbb){switch(_0x5ae31b['condition'][_0x2cea('0x67')]){case'IS':if(_0x45e8c5!==_0x2cea('0x70')&&_0x45e8c5!=='unreadMessages'){if(_[_0x2cea('0x6e')](_0x5ae31b[_0x2cea('0x67')])&&_0x5ae31b['value'][_0x2cea('0x48')]>0x1){_0x28e720[_0x2cea('0x6d')](_0x5ae31b[_0x2cea('0x71')]+'.'+_0x45e8c5+_0x2cea('0x72'),_0x5ae31b[_0x2cea('0x67')]);}else{_0x28e720['and'](_0x5ae31b[_0x2cea('0x71')]+'.'+_0x45e8c5+_0x2cea('0x73'),_0x5ae31b['value'][0x0]);}}break;case'=':_0x28e720[_0x2cea('0x6d')](_0x5ae31b[_0x2cea('0x71')]+'.'+_0x45e8c5+_0x2cea('0x73'),_0x5ae31b[_0x2cea('0x67')]);break;case _0x2cea('0x74'):if(_0x45e8c5===_0x2cea('0x75')){_0x28e720[_0x2cea('0x6d')](_0x2cea('0x76')+_0x2cea('0x77'),'%'+_0x5ae31b[_0x2cea('0x67')]+'%');_0x28e720['or'](_0x2cea('0x78')+_0x2cea('0x77'),'%'+_0x5ae31b[_0x2cea('0x67')]+'%');_0x28e720['or']('c.email'+'\x20LIKE\x20?','%'+_0x5ae31b[_0x2cea('0x67')]+'%');}else{_0x28e720[_0x2cea('0x6d')](_0x5ae31b[_0x2cea('0x71')]+'.'+_0x45e8c5+_0x2cea('0x77'),'%'+_0x5ae31b[_0x2cea('0x67')]+'%');}break;case'>':_0x28e720[_0x2cea('0x6d')](_0x5ae31b[_0x2cea('0x71')]+'.'+_0x45e8c5+'\x20>\x20?',_0x5ae31b['value']);break;case'<':_0x28e720[_0x2cea('0x6d')](_0x5ae31b[_0x2cea('0x71')]+'.'+_0x45e8c5+_0x2cea('0x79'),_0x5ae31b['value']);break;}});}else{switch(_0x5ae31b['condition']['value']){case'IS':if(_0x45e8c5!==_0x2cea('0x70')&&_0x45e8c5!==_0x2cea('0x7a')){if(_['isArray'](_0x5ae31b['value'])&&_0x5ae31b[_0x2cea('0x67')][_0x2cea('0x48')]>0x1){_0x28e720[_0x2cea('0x6d')](_0x5ae31b[_0x2cea('0x71')]+'.'+_0x45e8c5+_0x2cea('0x72'),_0x5ae31b[_0x2cea('0x67')]);}else{_0x28e720[_0x2cea('0x6d')](_0x5ae31b[_0x2cea('0x71')]+'.'+_0x45e8c5+'\x20=\x20?',_0x5ae31b[_0x2cea('0x67')][0x0]);}}break;case'=':_0x28e720[_0x2cea('0x6d')](_0x5ae31b[_0x2cea('0x71')]+'.'+_0x45e8c5+_0x2cea('0x73'),_0x5ae31b[_0x2cea('0x67')]);break;case'LIKE':if(_0x45e8c5===_0x2cea('0x75')){_0x28e720[_0x2cea('0x6d')]('c.firstName'+_0x2cea('0x77'),'%'+_0x5ae31b[_0x2cea('0x67')]+'%');_0x28e720['or'](_0x2cea('0x78')+_0x2cea('0x77'),'%'+_0x5ae31b['value']+'%');_0x28e720['or'](_0x2cea('0x7b')+_0x2cea('0x77'),'%'+_0x5ae31b[_0x2cea('0x67')]+'%');}else{_0x28e720['and'](_0x5ae31b[_0x2cea('0x71')]+'.'+_0x45e8c5+_0x2cea('0x77'),'%'+_0x5ae31b[_0x2cea('0x67')]+'%');}break;case'>':_0x28e720[_0x2cea('0x6d')](_0x5ae31b[_0x2cea('0x71')]+'.'+_0x45e8c5+_0x2cea('0x7c'),_0x5ae31b[_0x2cea('0x67')]);break;case'<':_0x28e720[_0x2cea('0x6d')](_0x5ae31b[_0x2cea('0x71')]+'.'+_0x45e8c5+'\x20<\x20?',_0x5ae31b[_0x2cea('0x67')]);break;}}}});}else{var _0xe35546=_(Object[_0x2cea('0x43')](_0x294057[_0x2cea('0x44')]))['map'](function(_0x111ef6){return _0x5b5d71[_0x2cea('0x49')](_0x111ef6)?_0x111ef6:undefined;})[_0x2cea('0x7d')](function(_0x1eb530){return!_['isNil'](_0x1eb530);})[_0x2cea('0x67')]();if(!_[_0x2cea('0x7e')](_0xe35546)){_0xe35546[_0x2cea('0x3e')](function(_0x2ae3f1){if(_0x2ae3f1===_0x2cea('0x7f')){_0x280483[_0x2cea('0x4d')](_0x2cea('0x80'),[][_0x2cea('0x81')](_0x294057[_0x2cea('0x44')][_0x2ae3f1]));}else if(_0x2ae3f1===_0x2cea('0x66')){var _0x31b09c=JSON[_0x2cea('0x64')](_0x294057[_0x2cea('0x44')][_0x2ae3f1])[_0x2cea('0x82')];var _0x59ee75=JSON[_0x2cea('0x64')](_0x294057['query'][_0x2ae3f1])[_0x2cea('0x83')];_0x280483[_0x2cea('0x4d')](_0x2cea('0x84'),_0x31b09c,_0x59ee75);}else{if(_0x294057[_0x2cea('0x44')][_0x2ae3f1]===_0x2cea('0x85')){_0x280483['where']('i.'+_0x2ae3f1+_0x2cea('0x86'));}else{_0x280483['where']('i.'+_0x2ae3f1+'\x20=\x20?',_0x294057[_0x2cea('0x44')][_0x2ae3f1]);}}});}if(_0x294057[_0x2cea('0x44')][_0x2cea('0x7d')]){var _0x53b06e=_0x294057[_0x2cea('0x44')][_0x2cea('0x7d')][_0x2cea('0x87')]('\x5c','\x5c\x5c')[_0x2cea('0x87')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x2cea('0x88')](_0x53b06e)){_0x28e720['or'](_0x2cea('0x89'),_0x53b06e+'%');}else{var _0x47e16f=[];_0x53b06e[_0x2cea('0x3d')]('\x20')[_0x2cea('0x3e')](function(_0x2d4b11){_0x47e16f[_0x2cea('0x3f')]('+'+_0x2d4b11['toString']());});var _0x10b0f2=_0x47e16f['join']('\x20');_0x28e720['or'](_0x2cea('0x8a'),_0x10b0f2)['or'](_0x2cea('0x8b'),_0x53b06e+'%');}}}_0x280483[_0x2cea('0x4d')](_0x28e720);if(_0x29ab58[_0x2cea('0x4b')]){_0x29ab58[_0x2cea('0x4b')][_0x2cea('0x3e')](function(_0x257b0c){_0x280483[_0x2cea('0x4b')]('i.'+_0x257b0c[0x0],_0x257b0c[0x1]===_0x2cea('0x8c')?![]:!![]);});}_0x280483[_0x2cea('0x8d')](_0x2cea('0x8e'));var _0x1f9cdd={'type':db[_0x2cea('0x8f')][_0x2cea('0x90')][_0x2cea('0x91')],'raw':!![]};var _0x1a2f79=_0x280483[_0x2cea('0x92')]()[_0x2cea('0x51')](_0x2cea('0x93'))[_0x2cea('0x51')](_0x2cea('0x94'),'unreadMessages');if(!_0x294057[_0x2cea('0x44')][_0x2cea('0x65')]){if(_0x294057[_0x2cea('0x44')]['read']){if(_0x294057[_0x2cea('0x44')][_0x2cea('0x95')]==0x1){_0x1a2f79[_0x2cea('0x96')](_0x2cea('0x97'));_0x280483[_0x2cea('0x96')]('`unreadMessages`\x20=\x200');}else{_0x1a2f79['having']('`unreadMessages`\x20>\x200');_0x280483['having'](_0x2cea('0x98'));}}if(_0x294057['query'][_0x2cea('0x99')]){var _0x52db25=_[_0x2cea('0x6e')](_0x294057[_0x2cea('0x44')][_0x2cea('0x99')])?_0x294057[_0x2cea('0x44')]['tag']:new Array(_0x294057[_0x2cea('0x44')]['tag']);var _0x401fdb=squel[_0x2cea('0x63')]();_0x52db25[_0x2cea('0x3e')](function(_0x1ae494){_0x401fdb['or'](_0x2cea('0x9a'),'%,'+_0x1ae494+',%');});_0x280483['having'](_0x401fdb);_0x1a2f79[_0x2cea('0x5b')]('chat_interaction_has_tags','it',_0x2cea('0x9b'));_0x1a2f79['left_join'](_0x2cea('0x53'),'t','t.id\x20=\x20it.TagId');_0x1a2f79[_0x2cea('0x4d')](_0x2cea('0x9c'),_0x52db25);}}else{var _0x41705c=JSON[_0x2cea('0x64')](_0x294057[_0x2cea('0x44')][_0x2cea('0x65')]);_[_0x2cea('0x43')](_0x41705c)[_0x2cea('0x3e')](function(_0x4b6051){var _0x341df6=_0x41705c[_0x4b6051];if(_0x4b6051==='TagId'){var _0x21cd24=_0x341df6['value'];var _0x42194c=squel[_0x2cea('0x63')]();_0x21cd24['forEach'](function(_0x1bb5a5){_0x42194c['or'](_0x2cea('0x9a'),'%,'+_0x1bb5a5+',%');});_0x280483[_0x2cea('0x96')](_0x42194c);_0x1a2f79[_0x2cea('0x5b')](_0x2cea('0x9d'),'it',_0x2cea('0x9e'));_0x1a2f79[_0x2cea('0x5b')](_0x2cea('0x53'),'t',_0x2cea('0x9f'));_0x1a2f79[_0x2cea('0x4d')](_0x2cea('0x9c'),_0x21cd24);}else if(_0x4b6051===_0x2cea('0x7a')){if(_0x341df6[_0x2cea('0x67')][_0x2cea('0x48')]===0x1){if(_0x341df6['value'][0x0]===0x1){_0x1a2f79['having'](_0x2cea('0x97'));_0x280483[_0x2cea('0x96')](_0x2cea('0x97'));}else{_0x1a2f79[_0x2cea('0x96')](_0x2cea('0x98'));_0x280483['having']('`unreadMessages`\x20>\x200');}}}});}db[_0x2cea('0xa0')][_0x2cea('0x44')](_0x1a2f79[_0x2cea('0xa1')](),_0x1f9cdd)[_0x2cea('0x20')](function(_0x4c14d6){_0x22ce6b[_0x2cea('0x2f')]=_0x4c14d6[_0x2cea('0x48')];if(_0x22ce6b[_0x2cea('0x2f')]===0x0)return[];return db['sequelize'][_0x2cea('0x44')](_0x4d1b77[_0x2cea('0xa1')](),_0x1f9cdd)[_0x2cea('0x20')](function(_0x6b3570){_0x526e92=_[_0x2cea('0xa2')](_0x6b3570,'id');_0x1f9cdd=_[_0x2cea('0xa3')](_0x1f9cdd,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x280483[_0x2cea('0x51')](_0x2cea('0x94'),'unreadMessages');_0x280483[_0x2cea('0x51')](_0x2cea('0xa4'),_0x2cea('0xa5'));_0x280483['field']('i.*');_0x280483[_0x2cea('0x51')](_0x2cea('0x76'),_0x2cea('0xa6'));_0x280483[_0x2cea('0x51')](_0x2cea('0x78'),_0x2cea('0xa7'));_0x280483[_0x2cea('0x51')](_0x2cea('0x7b'),_0x2cea('0xa8'));_0x280483[_0x2cea('0x51')](_0x2cea('0xa9'),_0x2cea('0xaa'));_0x280483['field'](_0x2cea('0xab'),'Contact.mobile');_0x280483[_0x2cea('0x51')](_0x2cea('0xac'),_0x2cea('0xad'));_0x280483['field'](_0x2cea('0xae'),'TagIds');_0x280483[_0x2cea('0x5b')](_0x2cea('0xaf'),'it',_0x2cea('0x9b'));_0x280483[_0x2cea('0x5b')](_0x2cea('0x53'),'t',_0x2cea('0x9f'));_0x280483[_0x2cea('0x31')](_0x29ab58['limit']);_0x280483[_0x2cea('0x30')](_0x29ab58[_0x2cea('0x30')]);return db[_0x2cea('0xa0')]['query'](_0x280483[_0x2cea('0xa1')](),_0x1f9cdd);})['then'](function(_0x4d0eea){_0x4d31dc[_0x2cea('0x4d')](_0x2cea('0xb0'),_[_0x2cea('0xb1')](_0x4d0eea,'id'));return db['sequelize'][_0x2cea('0x44')](_0x4d31dc['toString'](),_0x1f9cdd)['then'](function(_0x3c2714){var _0x48dee7=_[_0x2cea('0xb2')](_0x3c2714,_0x2cea('0xb3'));var _0x1b583e=[];_0x4d0eea['forEach'](function(_0x511109){_0x1b583e[_0x2cea('0x3f')](updateChatInteraction(_0x511109,_0x526e92,_0x48dee7));});return BPromise[_0x2cea('0xb4')](_0x1b583e);});});})[_0x2cea('0x20')](function(_0xd09681){_0x22ce6b['rows']=_0xd09681;return _0x22ce6b;})['then'](respondWithFilteredResult(_0x4da411,_0x29ab58))[_0x2cea('0x2a')](handleError(_0x4da411,null));};exports[_0x2cea('0xb5')]=function(_0x970c24,_0x13ad50){var _0x2303ba={'raw':![],'where':{'id':_0x970c24[_0x2cea('0xb6')]['id']}},_0x472e50={};_0x472e50[_0x2cea('0x42')]=_[_0x2cea('0x43')](db['ChatInteraction'][_0x2cea('0x41')]);_0x472e50[_0x2cea('0x44')]=_[_0x2cea('0x43')](_0x970c24[_0x2cea('0x44')]);_0x472e50['filters']=_['intersection'](_0x472e50[_0x2cea('0x42')],_0x472e50['query']);_0x2303ba[_0x2cea('0x46')]=_[_0x2cea('0x45')](_0x472e50[_0x2cea('0x42')],qs[_0x2cea('0x47')](_0x970c24['query'][_0x2cea('0x47')]));_0x2303ba[_0x2cea('0x46')]=_0x2303ba[_0x2cea('0x46')][_0x2cea('0x48')]?_0x2303ba[_0x2cea('0x46')]:_0x472e50[_0x2cea('0x42')];if(_0x970c24[_0x2cea('0x44')]['includeAll']){_0x2303ba[_0x2cea('0xb7')]=[{'all':!![]}];}_0x2303ba=_[_0x2cea('0xa3')]({},_0x2303ba,_0x970c24[_0x2cea('0xb8')]);return db[_0x2cea('0x40')][_0x2cea('0xb9')](_0x2303ba)[_0x2cea('0x20')](handleEntityNotFound(_0x13ad50,null))['then'](respondWithResult(_0x13ad50,null))[_0x2cea('0x2a')](handleError(_0x13ad50,null));};exports[_0x2cea('0xba')]=function(_0x2ec6b9,_0x1090b6){return db['ChatInteraction'][_0x2cea('0xba')](_0x2ec6b9[_0x2cea('0xbb')],{})[_0x2cea('0x20')](respondWithResult(_0x1090b6,0xc9))['catch'](handleError(_0x1090b6,null));};exports[_0x2cea('0xbc')]=function(_0x578407,_0x13a11f){if(_0x578407[_0x2cea('0xbb')]['id']){delete _0x578407[_0x2cea('0xbb')]['id'];}return db['ChatInteraction'][_0x2cea('0xb9')]({'where':{'id':_0x578407[_0x2cea('0xb6')]['id']}})['then'](handleEntityNotFound(_0x13a11f,null))[_0x2cea('0x20')](saveUpdates(_0x578407['body'],null))[_0x2cea('0x20')](respondWithResult(_0x13a11f,null))[_0x2cea('0x2a')](handleError(_0x13a11f,null));};exports[_0x2cea('0x37')]=function(_0x4b517c,_0x57f36d){return db[_0x2cea('0x40')][_0x2cea('0xb9')]({'where':{'id':_0x4b517c[_0x2cea('0xb6')]['id']}})['then'](handleEntityNotFound(_0x57f36d,null))[_0x2cea('0x20')](removeEntity(_0x57f36d,null))[_0x2cea('0x2a')](handleError(_0x57f36d,null));};exports[_0x2cea('0xbd')]=function(_0x2aeeb0,_0x3715fe){return db['ChatInteraction'][_0x2cea('0xbd')]()['then'](respondWithResult(_0x3715fe,null))[_0x2cea('0x2a')](handleError(_0x3715fe,null));};exports['customUpdate']=function(_0x4d2aea,_0x170b28){if(_0x4d2aea[_0x2cea('0xbb')]['id']){delete _0x4d2aea[_0x2cea('0xbb')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x4d2aea[_0x2cea('0xb6')]['id']}})[_0x2cea('0x20')](handleEntityNotFound(_0x170b28,null))[_0x2cea('0x20')](saveUpdates(_0x4d2aea[_0x2cea('0xbb')],null))[_0x2cea('0x20')](respondWithResult(_0x170b28,null))[_0x2cea('0x2a')](handleError(_0x170b28,null));};exports['abandon']=function(_0x305f9c,_0x127f9e,_0x3c6734){if(_0x305f9c[_0x2cea('0xbb')]['id']){delete _0x305f9c[_0x2cea('0xbb')]['id'];}return db[_0x2cea('0x40')][_0x2cea('0xb9')]({'where':{'id':_0x305f9c[_0x2cea('0xb6')]['id']}})[_0x2cea('0x20')](function(_0x53f40c){if(!_0x53f40c){logger[_0x2cea('0x25')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x2cea('0xbe'),0x194,'entity\x20not\x20found');_0x127f9e[_0x2cea('0x2b')](0x194);}else{if(_0x53f40c[_0x2cea('0xbf')]){throw new db[(_0x2cea('0x8f'))][(_0x2cea('0xc0'))](_0x2cea('0xc1'));}}return _0x53f40c;})[_0x2cea('0x20')](function(_0x4f2efb){if(_0x4f2efb){return _0x4f2efb[_0x2cea('0xbc')]({'closed':_0x305f9c[_0x2cea('0xbb')][_0x2cea('0xc2')],'disposition':_0x305f9c[_0x2cea('0xbb')]['disposition']})[_0x2cea('0x20')](function(_0x5bec70){return _0x5bec70;});}})[_0x2cea('0x20')](function(_0x890180){return respondWithRpcPromise(_0x2cea('0xc3'),_0x2cea('0xbe'),_0x305f9c[_0x2cea('0xbb')],client9004);})[_0x2cea('0x20')](respondWithResult(_0x127f9e,null))['catch'](handleError(_0x127f9e,null));};exports[_0x2cea('0xc4')]=function(_0x1f00fa,_0x2be704,_0x5623c1){_0x1f00fa[_0x2cea('0xbb')][_0x2cea('0x39')]=_0x1f00fa[_0x2cea('0xc5')][_0x2cea('0xc6')];_0x1f00fa[_0x2cea('0xbb')][_0x2cea('0xc7')]=_0x1f00fa[_0x2cea('0xc5')]['filename'];_0x1f00fa[_0x2cea('0xbb')][_0x2cea('0xc8')]=_0x1f00fa['file'][_0x2cea('0xc9')];return db['Attachment'][_0x2cea('0xba')](_0x1f00fa[_0x2cea('0xbb')])[_0x2cea('0x20')](respondWithResult(_0x2be704,0xc9))[_0x2cea('0x2a')](handleError(_0x2be704,null));};exports[_0x2cea('0xca')]=function(_0x365423,_0x1d5b52,_0x3aeb2b){return db['ChatInteraction'][_0x2cea('0xcb')]({'where':{'id':_0x365423[_0x2cea('0xb6')]['id']},'raw':!![]})[_0x2cea('0x20')](handleEntityNotFound(_0x1d5b52,null))[_0x2cea('0x20')](function(_0x1ad89d){if(_0x1ad89d){if(_0x1ad89d[_0x2cea('0xc2')]){return _0x1d5b52[_0x2cea('0x2c')](0x193)[_0x2cea('0x2e')]({'status':0x193,'message':_0x2cea('0xcc')});}return db['Attachment'][_0x2cea('0xcb')]({'where':{'id':_0x365423['query'][_0x2cea('0xcd')]},'raw':!![]})['then'](handleEntityNotFound(_0x1d5b52,null));}})[_0x2cea('0x20')](function(_0x1d84b3){if(_0x1d84b3){return _0x1d5b52[_0x2cea('0xce')](path[_0x2cea('0xcf')](config[_0x2cea('0xd0')],_0x2cea('0xd1'),_0x1d84b3[_0x2cea('0xc7')]));}})[_0x2cea('0x2a')](handleError(_0x1d5b52,null));};exports[_0x2cea('0xd2')]=function(_0x2c2e50,_0x243801){var _0x515f4d=null;var _0x17c34a=null;var _0x26b336=null;var _0x39988f=null;if(_0x2c2e50['body']['id']){delete _0x2c2e50['body']['id'];}if(_0x2c2e50[_0x2cea('0xbb')][_0x2cea('0xd3')]){_0x39988f=path[_0x2cea('0xcf')](config['root'],_0x2cea('0xd4'),util[_0x2cea('0x6b')](_0x2cea('0xd5'),Date[_0x2cea('0xd6')]()));_0x2c2e50[_0x2cea('0xbb')][_0x2cea('0xd7')]=_0x39988f;}return db[_0x2cea('0x40')][_0x2cea('0xb9')]({'where':{'id':_0x2c2e50[_0x2cea('0xb6')]['id']},'include':[{'model':db[_0x2cea('0xd8')],'as':'Messages','include':[{'model':db[_0x2cea('0xd9')],'as':'User'}]}]})[_0x2cea('0x20')](handleEntityNotFound(_0x243801,null))[_0x2cea('0x20')](saveUpdates(_0x2c2e50['body'],null))[_0x2cea('0x20')](function(_0x406b0a){if(_0x406b0a){_0x515f4d=_0x406b0a;return db[_0x2cea('0xda')][_0x2cea('0xb9')]({'where':{'id':_0x515f4d['ChatWebsiteId']}});}})[_0x2cea('0x20')](function(_0x4daa58){if(_0x4daa58){_0x26b336=_0x4daa58;return db[_0x2cea('0xdb')]['find']({'where':{'id':_0x515f4d[_0x2cea('0x75')]}});}})[_0x2cea('0x20')](function(_0x3d65cf){if(_0x3d65cf){_0x17c34a=_0x3d65cf;if(_0x39988f){var _0x17fe9e=null;for(var _0x54c153=0x1;_0x54c153<_0x515f4d[_0x2cea('0xdc')][_0x2cea('0x48')];++_0x54c153){_0x17fe9e=_0x515f4d[_0x2cea('0xdc')][_0x54c153];var _0x4c59c4=_0x17fe9e[_0x2cea('0xbf')]?util[_0x2cea('0x6b')](_0x2cea('0xdd'),_0x26b336[_0x2cea('0xde')],_0x17fe9e['UserId']):_0x2cea('0xdf');var _0x1b7d4e=_0x2c2e50[_0x2cea('0xbb')][_0x2cea('0xe0')]||util[_0x2cea('0x6b')](_0x2cea('0xdd'),_0x2cea('0xe1'),_0x17fe9e[_0x2cea('0x75')]);switch(_0x26b336[_0x2cea('0xe2')]){case _0x2cea('0xe3'):_0x4c59c4=_0x17fe9e[_0x2cea('0xbf')]?util[_0x2cea('0x6b')](_0x2cea('0xdd'),_0x26b336[_0x2cea('0xde')],_0x17fe9e[_0x2cea('0xbf')]):_0x2cea('0xdf');break;case _0x2cea('0xe4'):_0x4c59c4=_0x17fe9e[_0x2cea('0xbf')]?_0x17fe9e[_0x2cea('0xd9')][_0x2cea('0xe5')]||_0x17fe9e['User']['fullname']:'System';break;case _0x2cea('0xe6'):_0x4c59c4=_0x17fe9e[_0x2cea('0xbf')]?_0x17fe9e['User'][_0x2cea('0xe7')]:_0x2cea('0xdf');break;default:_0x4c59c4=_0x17fe9e['UserId']?util[_0x2cea('0x6b')]('%s%d',_0x26b336[_0x2cea('0xde')],_0x17fe9e[_0x2cea('0xbf')]):_0x2cea('0xdf');}var _0x33583e=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x17fe9e['createdAt'])[_0x2cea('0x6b')]('MM/DD/YYYY\x20HH:mm:ss'),_0x17fe9e['direction']==='in'?_0x1b7d4e:_0x4c59c4,_0x17fe9e[_0x2cea('0xbb')]);if(!_0x17fe9e['secret']){fs[_0x2cea('0xe8')](_0x39988f,_0x33583e);}}return db[_0x2cea('0xe9')][_0x2cea('0xcb')]({'where':{'service':!![]},'include':[{'model':db[_0x2cea('0xea')],'as':_0x2cea('0xeb'),'raw':!![]}]});}}})['then'](function(_0x2dbdbd){if(_0x2dbdbd&&_0x2dbdbd[_0x2cea('0xeb')]&&_0x2c2e50[_0x2cea('0xbb')]){var _0x5c6357={'tls':{'rejectUnauthorized':![]}};if(_0x2dbdbd[_0x2cea('0xeb')][_0x2cea('0xec')]){_0x5c6357[_0x2cea('0xec')]=_0x2dbdbd[_0x2cea('0xeb')][_0x2cea('0xec')];}else{_0x5c6357[_0x2cea('0xed')]=_0x2dbdbd[_0x2cea('0xeb')][_0x2cea('0xed')];_0x5c6357['port']=_0x2dbdbd[_0x2cea('0xeb')][_0x2cea('0xee')];_0x5c6357[_0x2cea('0xef')]=_0x2dbdbd[_0x2cea('0xeb')][_0x2cea('0xef')];}if(_0x2dbdbd[_0x2cea('0xeb')]['authentication']){_0x5c6357[_0x2cea('0xf0')]={'user':_0x2dbdbd[_0x2cea('0xeb')][_0x2cea('0xf1')],'pass':_0x2dbdbd[_0x2cea('0xeb')][_0x2cea('0xf2')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x5c6357,'message':{'from':util[_0x2cea('0x6b')]('\x22%s\x22\x20<%s>',_0x2dbdbd[_0x2cea('0x39')],_0x2dbdbd[_0x2cea('0xf3')]||_0x2dbdbd['Smtp']['user']),'to':_0x2c2e50[_0x2cea('0xbb')][_0x2cea('0xd3')],'subject':_0x2cea('0xf4'),'text':util[_0x2cea('0x6b')](_0x2cea('0xf5'),_0x2c2e50[_0x2cea('0xbb')]['mailTranscript']),'attachments':[{'path':_0x39988f}]}})[_0x2cea('0x20')](function(){return _0x515f4d;})[_0x2cea('0x2a')](function(_0x41f7b2){console[_0x2cea('0x25')](_0x41f7b2);});}else{return _0x515f4d;}})[_0x2cea('0x20')](respondWithStatusCode(_0x243801,0xc8))['catch'](handleError(_0x243801,null));};exports['addMessage']=function(_0x1eb3c2,_0xb2ef5e,_0x57726d){return db[_0x2cea('0xd8')][_0x2cea('0xb9')]({'where':{'id':_0x1eb3c2[_0x2cea('0xb6')]['id']}})[_0x2cea('0x20')](handleEntityNotFound(_0xb2ef5e,null))[_0x2cea('0x20')](function(_0x1fc72e){if(_0x1fc72e){return _0x1fc72e[_0x2cea('0xf6')](_0x1eb3c2['body'][_0x2cea('0xf7')],_[_0x2cea('0xf8')](_0x1eb3c2[_0x2cea('0xbb')],['ids','id'])||{});}})[_0x2cea('0x20')](respondWithResult(_0xb2ef5e,null))[_0x2cea('0x2a')](handleError(_0xb2ef5e,null));};exports['getMessages']=function(_0x26481a,_0x8203fd,_0x527551){var _0x55c253={'raw':![],'where':{}};var _0x4a8f6b={};var _0x5a6ba1={'count':0x0,'rows':[]};return db[_0x2cea('0x40')][_0x2cea('0xcb')]({'where':{'id':_0x26481a[_0x2cea('0xb6')]['id']}})['then'](handleEntityNotFound(_0x8203fd,null))[_0x2cea('0x20')](function(_0x264696){if(_0x264696){_0x4a8f6b[_0x2cea('0x42')]=_['keys'](db[_0x2cea('0xd8')][_0x2cea('0x41')]);_0x4a8f6b['query']=_['keys'](_0x26481a[_0x2cea('0x44')]);_0x4a8f6b[_0x2cea('0x4e')]=_['intersection'](_0x4a8f6b[_0x2cea('0x42')],_0x4a8f6b[_0x2cea('0x44')]);_0x55c253[_0x2cea('0x46')]=_[_0x2cea('0x45')](_0x4a8f6b[_0x2cea('0x42')],qs[_0x2cea('0x47')](_0x26481a[_0x2cea('0x44')][_0x2cea('0x47')]));_0x55c253[_0x2cea('0x46')]=_0x55c253[_0x2cea('0x46')][_0x2cea('0x48')]?_0x55c253['attributes']:_0x4a8f6b[_0x2cea('0x42')];if(!_0x26481a['query'][_0x2cea('0x49')]('nolimit')){_0x55c253['limit']=qs[_0x2cea('0x31')](_0x26481a['query']['limit']);_0x55c253[_0x2cea('0x30')]=qs[_0x2cea('0x30')](_0x26481a[_0x2cea('0x44')][_0x2cea('0x30')]);}_0x55c253['order']=qs[_0x2cea('0x4c')](_0x26481a[_0x2cea('0x44')][_0x2cea('0x4c')]);_0x55c253[_0x2cea('0x4d')]=qs['filters'](_['pick'](_0x26481a[_0x2cea('0x44')],_0x4a8f6b[_0x2cea('0x4e')]));_0x55c253[_0x2cea('0x4d')][_0x2cea('0xb3')]=_0x264696['id'];if(_0x26481a[_0x2cea('0x44')][_0x2cea('0x7d')]){_0x55c253[_0x2cea('0x4d')]=_[_0x2cea('0xa3')](_0x55c253[_0x2cea('0x4d')],{'$or':_[_0x2cea('0xb1')](_0x55c253[_0x2cea('0x46')],function(_0x3ad866){var _0x59028a={};_0x59028a[_0x3ad866]={'$like':'%'+_0x26481a[_0x2cea('0x44')][_0x2cea('0x7d')]+'%'};return _0x59028a;})});}if(_0x26481a[_0x2cea('0x44')]['$gte']){var _0xe83b12=_0x26481a['query'][_0x2cea('0x82')][_0x2cea('0x3d')](',');var _0x466b70={};_0x466b70[_0xe83b12[0x0]]={'$gte':moment(_0xe83b12[0x1])[_0x2cea('0x6b')](_0x2cea('0xf9'))};_0x55c253[_0x2cea('0x4d')]=_[_0x2cea('0xa3')](_0x55c253[_0x2cea('0x4d')],_0x466b70);}_0x55c253=_[_0x2cea('0xa3')]({},_0x55c253,_0x26481a[_0x2cea('0xb8')]);return db[_0x2cea('0xd8')][_0x2cea('0x2f')]({'where':_0x55c253[_0x2cea('0x4d')]})['then'](function(_0x3072d6){_0x5a6ba1[_0x2cea('0x2f')]=_0x3072d6;if(_0x26481a[_0x2cea('0x44')][_0x2cea('0xfa')]){_0x55c253[_0x2cea('0xb7')]=[{'all':!![]}];}return db['ChatMessage'][_0x2cea('0xfb')](_0x55c253);})[_0x2cea('0x20')](function(_0x592395){_0x5a6ba1['rows']=_0x592395;return _0x5a6ba1;});}})[_0x2cea('0x20')](respondWithFilteredResult(_0x8203fd,_0x55c253))[_0x2cea('0x2a')](handleError(_0x8203fd,null));};exports['getMyMessages']=function(_0x26d520,_0x25e5eb,_0x150b47){var _0x122e2c={'where':{}},_0x23d559={},_0x47f1ea={'count':0x0,'rows':[]};return db[_0x2cea('0x40')][_0x2cea('0xcb')]({'where':{'id':_0x26d520['params']['id']}})[_0x2cea('0x20')](handleEntityNotFound(_0x25e5eb,null))['then'](function(_0x34d8a5){if(_0x34d8a5){_0x23d559[_0x2cea('0x42')]=_[_0x2cea('0x43')](db[_0x2cea('0xd8')][_0x2cea('0x41')]);_0x23d559[_0x2cea('0x44')]=_[_0x2cea('0x43')](_0x26d520[_0x2cea('0x44')]);_0x23d559[_0x2cea('0x4e')]=_[_0x2cea('0x45')](_0x23d559[_0x2cea('0x42')],_0x23d559[_0x2cea('0x44')]);_0x122e2c[_0x2cea('0x46')]=_['intersection'](_0x23d559[_0x2cea('0x42')],qs[_0x2cea('0x47')](_0x26d520[_0x2cea('0x44')][_0x2cea('0x47')]));_0x122e2c[_0x2cea('0x46')]=_0x122e2c[_0x2cea('0x46')][_0x2cea('0x48')]?_0x122e2c[_0x2cea('0x46')]:_0x23d559[_0x2cea('0x42')];if(!_0x26d520[_0x2cea('0x44')][_0x2cea('0x49')](_0x2cea('0x4a'))){_0x122e2c['limit']=qs[_0x2cea('0x31')](_0x26d520[_0x2cea('0x44')][_0x2cea('0x31')]);_0x122e2c[_0x2cea('0x30')]=qs[_0x2cea('0x30')](_0x26d520['query'][_0x2cea('0x30')]);}_0x122e2c[_0x2cea('0x4b')]=qs[_0x2cea('0x4c')](_0x26d520[_0x2cea('0x44')]['sort']);_0x122e2c[_0x2cea('0x4d')]=qs[_0x2cea('0x4e')](_[_0x2cea('0x4f')](_0x26d520[_0x2cea('0x44')],_0x23d559[_0x2cea('0x4e')]));_0x122e2c[_0x2cea('0x4d')]['ChatInteractionId']=_0x34d8a5['id'];if(_0x26d520[_0x2cea('0x44')][_0x2cea('0x7d')]){_0x122e2c[_0x2cea('0x4d')]=_['merge'](_0x122e2c[_0x2cea('0x4d')],{'$or':_[_0x2cea('0xb1')](_0x122e2c[_0x2cea('0x46')],function(_0x21a68d){var _0x2f011f={};_0x2f011f[_0x21a68d]={'$like':'%'+_0x26d520['query'][_0x2cea('0x7d')]+'%'};return _0x2f011f;})});}_0x122e2c[_0x2cea('0x4d')][_0x2cea('0xfc')]=![];if(_0x26d520['query']['id']){_0x122e2c[_0x2cea('0x4d')]['id']={'$gt':_0x26d520['query']['id']};}_0x122e2c=_[_0x2cea('0xa3')]({},_0x122e2c,_0x26d520[_0x2cea('0xb8')]);return db[_0x2cea('0xd8')][_0x2cea('0x2f')]({'where':_0x122e2c[_0x2cea('0x4d')]})[_0x2cea('0x20')](function(_0x29f2f7){_0x47f1ea[_0x2cea('0x2f')]=_0x29f2f7;_0x122e2c['include']=[];if(_0x26d520[_0x2cea('0x44')]['includeAgent']){_0x122e2c[_0x2cea('0xb7')][_0x2cea('0x3f')]({'model':db[_0x2cea('0xd9')],'as':_0x2cea('0xd9'),'attributes':['id','fullname','alias']});}if(_0x26d520[_0x2cea('0x44')][_0x2cea('0xfa')]){_0x122e2c[_0x2cea('0xb7')]=[{'all':!![]}];}return db[_0x2cea('0xd8')][_0x2cea('0xfb')](_0x122e2c);})[_0x2cea('0x20')](function(_0x19d998){_0x47f1ea[_0x2cea('0xfd')]=_0x19d998;return _0x47f1ea;});}})[_0x2cea('0x20')](respondWithFilteredResult(_0x25e5eb,_0x122e2c))[_0x2cea('0x2a')](handleError(_0x25e5eb,null));};exports[_0x2cea('0xfe')]=function(_0x46bb3,_0x2566bc,_0x3fdbff){return db[_0x2cea('0x40')][_0x2cea('0xb9')]({'where':{'id':_0x46bb3[_0x2cea('0xb6')]['id']}})['then'](handleEntityNotFound(_0x2566bc,null))[_0x2cea('0x20')](function(_0x4cbfa1){if(_0x4cbfa1){return _0x4cbfa1['setTags'](_0x46bb3[_0x2cea('0xbb')]['ids'],_[_0x2cea('0xf8')](_0x46bb3['body'],[_0x2cea('0xf7'),'id'])||{})[_0x2cea('0xff')](function(){return db[_0x2cea('0x100')]['findAll']({'attributes':['id',_0x2cea('0x39'),_0x2cea('0x101')],'where':{'id':_0x46bb3['body'][_0x2cea('0xf7')]}});})[_0x2cea('0x20')](function(_0x448e6a){socket['emit'](_0x2cea('0x102'),{'id':Number(_0x46bb3[_0x2cea('0xb6')]['id']),'tags':_0x448e6a||[]});return{'id':Number(_0x46bb3[_0x2cea('0xb6')]['id']),'tags':_0x448e6a||[]};});}})[_0x2cea('0x20')](respondWithResult(_0x2566bc,null))['catch'](handleError(_0x2566bc,null));};exports[_0x2cea('0x103')]=function(_0x36270e,_0x244bc8,_0x1051b0){return db[_0x2cea('0x40')][_0x2cea('0xb9')]({'where':{'id':_0x36270e[_0x2cea('0xb6')]['id']}})[_0x2cea('0x20')](handleEntityNotFound(_0x244bc8,null))['then'](function(_0x385252){if(_0x385252){return _0x385252[_0x2cea('0x103')](_0x36270e[_0x2cea('0x44')][_0x2cea('0xf7')]);}})[_0x2cea('0x20')](respondWithStatusCode(_0x244bc8,null))['catch'](handleError(_0x244bc8,null));};exports[_0x2cea('0xce')]=function(_0x512924,_0x21d459){var _0x260266=moment()[_0x2cea('0x104')]()[_0x2cea('0xa1')]();var _0x2a7fa2=path[_0x2cea('0xcf')](config[_0x2cea('0xd0')],_0x2cea('0x105'),_0x2cea('0x106'),'tmp');var _0x36888d=path[_0x2cea('0xcf')](config[_0x2cea('0xd0')],_0x2cea('0x105'),_0x2cea('0x106'),_0x2cea('0x107'));var _0x2017b2=path[_0x2cea('0xcf')](_0x2a7fa2,_0x260266);var _0x428180=util[_0x2cea('0x6b')](_0x2cea('0x108'),_0x512924[_0x2cea('0xb6')]['id'],_0x260266);var _0x5042e7=path[_0x2cea('0xcf')](_0x2a7fa2,_0x428180);var _0x4c0c40=![];return db[_0x2cea('0x40')][_0x2cea('0xb9')]({'where':{'id':_0x512924[_0x2cea('0xb6')]['id']},'include':[{'model':db[_0x2cea('0xd8')],'as':'Messages','attributes':['id',_0x2cea('0xbb'),'createdAt','direction',_0x2cea('0xfc')],'include':[{'model':db[_0x2cea('0xd9')],'as':_0x2cea('0xd9'),'attributes':['id',_0x2cea('0xe7')],'raw':!![]},{'model':db[_0x2cea('0xdb')],'as':_0x2cea('0x109'),'attributes':['id',_0x2cea('0x10a'),_0x2cea('0x10b')],'raw':!![]},{'model':db[_0x2cea('0x10c')],'as':'Attachment','raw':!![]}]},{'model':db[_0x2cea('0xda')],'as':_0x2cea('0x10d'),'attributes':['id',_0x2cea('0x39')]},{'model':db[_0x2cea('0xd9')],'as':'Owner','attributes':['id',_0x2cea('0xe7')]}]})[_0x2cea('0x20')](handleEntityNotFound(_0x21d459,null))[_0x2cea('0x20')](function(_0xc23c0a){if(_0xc23c0a){var _0x366eca=_0xc23c0a['get']({'plain':!![]});_0x4c0c40=!![];var _0x1491cb={'format':'A4','border':'10px','header':{'height':'40px','contents':{'first':_0x2cea('0x10e')}},'footer':{'height':_0x2cea('0x10f'),'contents':{'default':util[_0x2cea('0x6b')](_0x2cea('0x110'),util[_0x2cea('0x6b')](_0x2cea('0x111'),'Chat',_0x366eca['id']),moment()[_0x2cea('0x6b')](_0x2cea('0x112'))[_0x2cea('0xa1')]())}}};fs['mkdirSync'](_0x2017b2);var _0x508e78={'channel':_0x2cea('0x113'),'account':_0x366eca[_0x2cea('0x10d')]['name'],'agent':_0x366eca[_0x2cea('0x114')]?_0x366eca['Owner'][_0x2cea('0xe7')]:'N.A.','createdAt':moment(_0x366eca['createdAt'])[_0x2cea('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2cea('0xa1')](),'closedAt':_0x366eca[_0x2cea('0xc2')]?moment(_0x366eca[_0x2cea('0x115')])[_0x2cea('0x6b')](_0x2cea('0xf9'))['toString']():'','disposition':_0x366eca['disposition'],'chatInfo':{'browser':_0x366eca[_0x2cea('0x116')],'os':_0x366eca[_0x2cea('0x117')],'referer':_0x366eca[_0x2cea('0x118')],'customerIp':_0x366eca[_0x2cea('0x119')]},'messages':_(_0x366eca[_0x2cea('0xdc')])[_0x2cea('0x11a')]()['filter']({'secret':![]})[_0x2cea('0xb1')](function(_0xf4c957){if(_0xf4c957[_0x2cea('0x10c')]){var _0x40a7d8=path[_0x2cea('0xcf')](_0x36888d,_0xf4c957[_0x2cea('0x10c')][_0x2cea('0xc7')]);if(fs[_0x2cea('0x11b')](_0x40a7d8)){fs[_0x2cea('0x11c')](_0x40a7d8)['pipe'](fs['createWriteStream'](path['join'](_0x2017b2,_0xf4c957['Attachment'][_0x2cea('0xc7')])));}}return{'date':moment(_0xf4c957[_0x2cea('0x66')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x2cea('0xa1')](),'sender':_0xf4c957['direction']===_0x2cea('0x11d')?_0xf4c957['User']?_0xf4c957[_0x2cea('0xd9')][_0x2cea('0xe7')]:'System':_0xf4c957['Contact'][_0x2cea('0x10a')]+(_0xf4c957[_0x2cea('0x109')][_0x2cea('0x10b')]?'\x20'+_0xf4c957[_0x2cea('0x109')][_0x2cea('0x10b')]:''),'body':_0xf4c957[_0x2cea('0x10c')]?_0xf4c957['Attachment'][_0x2cea('0xc7')]:_0xf4c957[_0x2cea('0xbb')],'direction':_0xf4c957[_0x2cea('0x11e')]===_0x2cea('0x11d')?'A':'C','secret':_0xf4c957[_0x2cea('0xfc')],'attachment':_0xf4c957[_0x2cea('0x10c')]};})['value']()};return ejs[_0x2cea('0x11f')](path['join'](config[_0x2cea('0xd0')],_0x2cea('0x105'),'views',_0x2cea('0x120')),{'interaction':_0x508e78})['then'](function(_0x131220){return new BPromise(function(_0x1a79dd,_0x4b9559){pdf[_0x2cea('0xba')](_0x131220,_0x1491cb)[_0x2cea('0x121')](path[_0x2cea('0xcf')](_0x2017b2,_0x2cea('0x122')+_0x366eca['id']+'-'+_0x260266+'.pdf'),function(_0x754cb2,_0x375559){if(_0x754cb2)return _0x4b9559(_0x754cb2);_0x1a79dd(_0x375559);});});});}})[_0x2cea('0x20')](function(){if(_0x4c0c40){return new BPromise(function(_0x7cb6f4,_0x1bca91){zipdir(_0x2017b2,{'saveTo':_0x5042e7},function(_0x2c325c,_0x136d70){if(_0x2c325c)return _0x1bca91(_0x2c325c);return _0x7cb6f4(_0x136d70);});})[_0x2cea('0x20')](function(){return new BPromise(function(_0x438c28,_0x135dd1){rimraf(_0x2017b2,function(_0x10b41e){if(_0x10b41e)_0x135dd1(_0x10b41e);return _0x438c28();});});})[_0x2cea('0x20')](function(){return _0x21d459[_0x2cea('0xce')](_0x5042e7,_0x428180,function(_0x2e0335){if(_0x2e0335){console[_0x2cea('0x123')](_0x2cea('0x124'),_0x2e0335);}else{fs[_0x2cea('0x125')](_0x5042e7);}});});}else{return _0x21d459[_0x2cea('0x2b')](0xc8);}})[_0x2cea('0x2a')](handleError(_0x21d459,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index c331e56..3b1afe4 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 _0x4f90=['save','update','remove','getUsers','setDataValue','map','findAll','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x2a7a0e,_0x480312){var _0x5d3576=function(_0x556975){while(--_0x556975){_0x2a7a0e['push'](_0x2a7a0e['shift']());}};_0x5d3576(++_0x480312);}(_0x4f90,0x19a));var _0x04f9=function(_0x1d930e,_0x20d8b8){_0x1d930e=_0x1d930e-0x0;var _0x5bbd66=_0x4f90[_0x1d930e];return _0x5bbd66;};'use strict';var EventEmitter=require(_0x04f9('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0x04f9('0x1'))['db'][_0x04f9('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x04f9('0x3')](0x0);var events={'afterCreate':_0x04f9('0x4'),'afterUpdate':_0x04f9('0x5'),'afterDestroy':_0x04f9('0x6')};function emitEvent(_0x3e605b){return function(_0x165e0e,_0x3ab361,_0x3c0648){_0x165e0e[_0x04f9('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3d99d9){_0x165e0e[_0x04f9('0x8')]('Users',_0x3d99d9[_0x04f9('0x9')](function(_0x39a0fb){return{'id':_0x39a0fb['id']};}));return ChatMessage[_0x04f9('0xa')]({'where':{'ChatInteractionId':_0x165e0e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x04f9('0xb')](function(_0x1f5dae){_0x165e0e[_0x04f9('0x8')](_0x04f9('0xc'),_0x1f5dae[_0x04f9('0xd')]);ChatInteractionEvents[_0x04f9('0xe')](_0x3e605b+':'+_0x165e0e['id'],_0x165e0e);ChatInteractionEvents[_0x04f9('0xe')](_0x3e605b,_0x165e0e);_0x3c0648(null);})[_0x04f9('0xf')](_0x3c0648(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x04f9('0x10')](e,emitEvent(event));}}module[_0x04f9('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x70e4=['../../mysqldb','ChatInteraction','ChatMessage','update','getUsers','then','Users','map','findAll','setDataValue','length','emit','catch','hook','exports','events'];(function(_0x374c7b,_0x1f5d2d){var _0x30cb54=function(_0x170901){while(--_0x170901){_0x374c7b['push'](_0x374c7b['shift']());}};_0x30cb54(++_0x1f5d2d);}(_0x70e4,0x6f));var _0x470e=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0x70e4[_0xd1c39b];return _0x58f5bc;};'use strict';var EventEmitter=require(_0x470e('0x0'));var ChatInteraction=require(_0x470e('0x1'))['db'][_0x470e('0x2')];var ChatMessage=require(_0x470e('0x1'))['db'][_0x470e('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x470e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1aaedc){return function(_0x320f69,_0x46233c,_0x4547de){_0x320f69[_0x470e('0x5')]({'attributes':['id'],'raw':!![]})[_0x470e('0x6')](function(_0x250f63){_0x320f69['setDataValue'](_0x470e('0x7'),_0x250f63[_0x470e('0x8')](function(_0x2f709a){return{'id':_0x2f709a['id']};}));return ChatMessage[_0x470e('0x9')]({'where':{'ChatInteractionId':_0x320f69['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4e7035){_0x320f69[_0x470e('0xa')]('unreadMessages',_0x4e7035[_0x470e('0xb')]);ChatInteractionEvents[_0x470e('0xc')](_0x1aaedc+':'+_0x320f69['id'],_0x320f69);ChatInteractionEvents[_0x470e('0xc')](_0x1aaedc,_0x320f69);_0x4547de(null);})[_0x470e('0xd')](_0x4547de(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x470e('0xe')](e,emitEvent(event));}}module[_0x470e('0xf')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index b92605e..610be13 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 _0xbdb7=['moment','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','define','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x53b7c9,_0xe8c16e){var _0x13766c=function(_0x18996f){while(--_0x18996f){_0x53b7c9['push'](_0x53b7c9['shift']());}};_0x13766c(++_0xe8c16e);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x5dbc6a,_0x55c7c6){_0x5dbc6a=_0x5dbc6a-0x0;var _0x33c9c7=_0xbdb7[_0x5dbc6a];return _0x33c9c7;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var moment=require(_0x7bdb('0x4'));var BPromise=require(_0x7bdb('0x5'));var rp=require(_0x7bdb('0x6'));var fs=require('fs');var path=require(_0x7bdb('0x7'));var rimraf=require(_0x7bdb('0x8'));var config=require('../../config/environment');var attributes=require(_0x7bdb('0x9'));module['exports']=function(_0x4b5fff,_0xffdc86){return _0x4b5fff[_0x7bdb('0xa')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x468041,_0x11a877,_0x530f81){if(_0x468041['changed'](_0x7bdb('0xb'))){_0x468041[_0x7bdb('0xc')]=moment()[_0x7bdb('0xd')](_0x7bdb('0xe'));}_0x530f81(null,_0x468041);}},'charset':_0x7bdb('0xf'),'collate':_0x7bdb('0x10')});}; \ No newline at end of file +var _0x2032=['./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x531f91,_0x876745){var _0x2ee70f=function(_0x41d769){while(--_0x41d769){_0x531f91['push'](_0x531f91['shift']());}};_0x2ee70f(++_0x876745);}(_0x2032,0xd9));var _0x2203=function(_0x2b7051,_0x1ecac3){_0x2b7051=_0x2b7051-0x0;var _0xc71356=_0x2032[_0x2b7051];return _0xc71356;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2049ff,_0x2999ed,_0x5ecf9e){if(_0x2049ff['changed'](_0x2203('0xc'))){_0x2049ff['closedAt']=moment()[_0x2203('0xd')](_0x2203('0xe'));}_0x5ecf9e(null,_0x2049ff);}},'charset':_0x2203('0xf'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 53c9a4c..1f46e42 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 _0x95f2=['message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x443865,_0x395e48){var _0x139846=function(_0x2d947e){while(--_0x2d947e){_0x443865['push'](_0x443865['shift']());}};_0x139846(++_0x395e48);}(_0x95f2,0xd4));var _0x295f=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0x95f2[_0xd1c39b];return _0x58f5bc;};'use strict';var _=require(_0x295f('0x0'));var util=require(_0x295f('0x1'));var moment=require(_0x295f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x295f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x295f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x295f('0x5'));var jayson=require(_0x295f('0x6'));var client=jayson[_0x295f('0x7')][_0x295f('0x8')]({'port':0x232a});config[_0x295f('0x9')]=_['defaults'](config[_0x295f('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x295f('0xa'))(new Redis(config[_0x295f('0x9')]));require(_0x295f('0xb'))['register'](socket);function respondWithRpcPromise(_0x304bff,_0x322c0a,_0x2f7750){return new BPromise(function(_0xd8b4d0,_0x2249e7){return client[_0x295f('0xc')](_0x304bff,_0x2f7750)[_0x295f('0xd')](function(_0x42ae58){logger[_0x295f('0xe')](_0x295f('0xf'),_0x322c0a,_0x295f('0x10'));logger[_0x295f('0x11')](_0x295f('0x12'),_0x322c0a,_0x295f('0x10'),JSON[_0x295f('0x13')](_0x42ae58));if(_0x42ae58[_0x295f('0x14')]){if(_0x42ae58['error'][_0x295f('0x15')]===0x1f4){logger[_0x295f('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x322c0a,_0x42ae58[_0x295f('0x14')][_0x295f('0x16')]);return _0x2249e7(_0x42ae58[_0x295f('0x14')]['message']);}logger['error'](_0x295f('0xf'),_0x322c0a,_0x42ae58[_0x295f('0x14')][_0x295f('0x16')]);return _0xd8b4d0(_0x42ae58[_0x295f('0x14')][_0x295f('0x16')]);}else{logger['info'](_0x295f('0xf'),_0x322c0a,'request\x20sent');_0xd8b4d0(_0x42ae58[_0x295f('0x17')][_0x295f('0x16')]);}})[_0x295f('0x18')](function(_0x4e7cdc){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x322c0a,_0x4e7cdc);_0x2249e7(_0x4e7cdc);});});}exports[_0x295f('0x19')]=function(_0x2d4333){var _0x4a1552=this;return new Promise(function(_0x21e46a,_0x49d477){return db[_0x295f('0x1a')][_0x295f('0x1b')](_0x2d4333[_0x295f('0x1c')],{'raw':_0x2d4333[_0x295f('0x1d')]?_0x2d4333['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d4333[_0x295f('0x1d')]?_0x2d4333[_0x295f('0x1d')][_0x295f('0x1e')]||null:null,'attributes':_0x2d4333['options']?_0x2d4333[_0x295f('0x1d')][_0x295f('0x1f')]||null:null,'limit':_0x2d4333[_0x295f('0x1d')]?_0x2d4333[_0x295f('0x1d')]['limit']||null:null})[_0x295f('0xd')](function(_0x34fdc1){logger[_0x295f('0xe')](_0x295f('0x19'),_0x2d4333);logger[_0x295f('0x11')](_0x295f('0x19'),_0x2d4333,JSON[_0x295f('0x13')](_0x34fdc1));_0x21e46a(_0x34fdc1);})['catch'](function(_0x8a9273){logger[_0x295f('0x14')]('UpdateChatInteraction',_0x8a9273[_0x295f('0x16')],_0x2d4333);_0x49d477(_0x4a1552[_0x295f('0x14')](0x1f4,_0x8a9273[_0x295f('0x16')]));});});};exports[_0x295f('0x20')]=function(_0x44c810){return new Promise(function(_0x57357e,_0x5e2713){return db[_0x295f('0x1a')][_0x295f('0x21')]({'where':_0x44c810[_0x295f('0x1d')]?_0x44c810[_0x295f('0x1d')][_0x295f('0x1e')]||null:null})['then'](function(_0x352e74){if(_0x352e74){return _0x352e74[_0x295f('0x22')](_0x44c810['body'][_0x295f('0x23')],_[_0x295f('0x24')](_0x44c810[_0x295f('0x1c')],['ids','id'])||{});}})[_0x295f('0x25')](function(_0x595561){logger[_0x295f('0xe')](_0x295f('0x26'),_0x44c810);logger[_0x295f('0x11')](_0x295f('0x26'),_0x44c810,JSON[_0x295f('0x13')](_0x595561));_0x57357e(_0x595561);})[_0x295f('0x18')](function(_0x19117){logger[_0x295f('0x14')](_0x295f('0x26'),_0x19117[_0x295f('0x16')],_0x44c810);_0x5e2713(_this[_0x295f('0x14')](0x1f4,_0x19117[_0x295f('0x16')]));});});}; \ No newline at end of file +var _0xcd8f=['addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatInteraction','update','body','options','raw','where','attributes','UpdateChatInteraction','debug','AddTagsToChatInteraction','find'];(function(_0x153846,_0x1227ad){var _0x3ee557=function(_0x514e76){while(--_0x514e76){_0x153846['push'](_0x153846['shift']());}};_0x3ee557(++_0x1227ad);}(_0xcd8f,0x199));var _0xfcd8=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xcd8f[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0xfcd8('0x0'));var util=require(_0xfcd8('0x1'));var moment=require(_0xfcd8('0x2'));var BPromise=require(_0xfcd8('0x3'));var rs=require(_0xfcd8('0x4'));var fs=require('fs');var Redis=require(_0xfcd8('0x5'));var db=require(_0xfcd8('0x6'))['db'];var utils=require(_0xfcd8('0x7'));var logger=require('../../config/logger')(_0xfcd8('0x8'));var config=require(_0xfcd8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfcd8('0xa')][_0xfcd8('0xb')]({'port':0x232a});config['redis']=_[_0xfcd8('0xc')](config['redis'],{'host':_0xfcd8('0xd'),'port':0x18eb});var socket=require(_0xfcd8('0xe'))(new Redis(config[_0xfcd8('0xf')]));require(_0xfcd8('0x10'))[_0xfcd8('0x11')](socket);function respondWithRpcPromise(_0x4a62cc,_0x18d83f,_0x275ecd){return new BPromise(function(_0x595f1e,_0x1b35f2){return client[_0xfcd8('0x12')](_0x4a62cc,_0x275ecd)[_0xfcd8('0x13')](function(_0x5210c8){logger[_0xfcd8('0x14')](_0xfcd8('0x15'),_0x18d83f,_0xfcd8('0x16'));logger['debug'](_0xfcd8('0x17'),_0x18d83f,_0xfcd8('0x16'),JSON[_0xfcd8('0x18')](_0x5210c8));if(_0x5210c8[_0xfcd8('0x19')]){if(_0x5210c8[_0xfcd8('0x19')][_0xfcd8('0x1a')]===0x1f4){logger[_0xfcd8('0x19')](_0xfcd8('0x15'),_0x18d83f,_0x5210c8[_0xfcd8('0x19')][_0xfcd8('0x1b')]);return _0x1b35f2(_0x5210c8[_0xfcd8('0x19')][_0xfcd8('0x1b')]);}logger[_0xfcd8('0x19')](_0xfcd8('0x15'),_0x18d83f,_0x5210c8[_0xfcd8('0x19')][_0xfcd8('0x1b')]);return _0x595f1e(_0x5210c8['error'][_0xfcd8('0x1b')]);}else{logger[_0xfcd8('0x14')](_0xfcd8('0x15'),_0x18d83f,_0xfcd8('0x16'));_0x595f1e(_0x5210c8[_0xfcd8('0x1c')]['message']);}})[_0xfcd8('0x1d')](function(_0x2a10f7){logger[_0xfcd8('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x18d83f,_0x2a10f7);_0x1b35f2(_0x2a10f7);});});}exports['UpdateChatInteraction']=function(_0x4786bc){var _0x340726=this;return new Promise(function(_0x5557e6,_0x230bee){return db[_0xfcd8('0x1e')][_0xfcd8('0x1f')](_0x4786bc[_0xfcd8('0x20')],{'raw':_0x4786bc[_0xfcd8('0x21')]?_0x4786bc['options'][_0xfcd8('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4786bc[_0xfcd8('0x21')]?_0x4786bc[_0xfcd8('0x21')][_0xfcd8('0x23')]||null:null,'attributes':_0x4786bc[_0xfcd8('0x21')]?_0x4786bc['options'][_0xfcd8('0x24')]||null:null,'limit':_0x4786bc[_0xfcd8('0x21')]?_0x4786bc[_0xfcd8('0x21')]['limit']||null:null})[_0xfcd8('0x13')](function(_0x4adad9){logger[_0xfcd8('0x14')](_0xfcd8('0x25'),_0x4786bc);logger[_0xfcd8('0x26')](_0xfcd8('0x25'),_0x4786bc,JSON['stringify'](_0x4adad9));_0x5557e6(_0x4adad9);})['catch'](function(_0x2ec744){logger[_0xfcd8('0x19')]('UpdateChatInteraction',_0x2ec744[_0xfcd8('0x1b')],_0x4786bc);_0x230bee(_0x340726[_0xfcd8('0x19')](0x1f4,_0x2ec744['message']));});});};exports[_0xfcd8('0x27')]=function(_0x98d98c){return new Promise(function(_0x26ac28,_0x3584ad){return db[_0xfcd8('0x1e')][_0xfcd8('0x28')]({'where':_0x98d98c['options']?_0x98d98c[_0xfcd8('0x21')]['where']||null:null})['then'](function(_0x2cd6f0){if(_0x2cd6f0){return _0x2cd6f0[_0xfcd8('0x29')](_0x98d98c[_0xfcd8('0x20')]['ids'],_['omit'](_0x98d98c['body'],[_0xfcd8('0x2a'),'id'])||{});}})[_0xfcd8('0x2b')](function(_0x36c7c3){logger[_0xfcd8('0x14')](_0xfcd8('0x2c'),_0x98d98c);logger[_0xfcd8('0x26')](_0xfcd8('0x2c'),_0x98d98c,JSON['stringify'](_0x36c7c3));_0x26ac28(_0x36c7c3);})['catch'](function(_0x57376a){logger[_0xfcd8('0x19')](_0xfcd8('0x2c'),_0x57376a[_0xfcd8('0x1b')],_0x98d98c);_0x3584ad(_this[_0xfcd8('0x19')](0x1f4,_0x57376a[_0xfcd8('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 3ab617e..8091714 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 _0x6c41=['removeListener','length','./chatInteraction.events','remove','emit'];(function(_0x5eff24,_0x30f546){var _0x2da2c2=function(_0x5376cc){while(--_0x5376cc){_0x5eff24['push'](_0x5eff24['shift']());}};_0x2da2c2(++_0x30f546);}(_0x6c41,0x1ab));var _0x16c4=function(_0x2d994d,_0x168a27){_0x2d994d=_0x2d994d-0x0;var _0xd54be4=_0x6c41[_0x2d994d];return _0xd54be4;};'use strict';var ChatInteractionEvents=require(_0x16c4('0x0'));var events=['save',_0x16c4('0x1'),'update'];function createListener(_0x357cf7,_0xeced13){return function(_0x46a0c5){_0xeced13[_0x16c4('0x2')](_0x357cf7,_0x46a0c5);};}function removeListener(_0x2eb74e,_0x4c80c5){return function(){ChatInteractionEvents[_0x16c4('0x3')](_0x2eb74e,_0x4c80c5);};}exports['register']=function(_0x42fd0c){for(var _0xbcfe8b=0x0,_0x5d3ec2=events[_0x16c4('0x4')];_0xbcfe8b<_0x5d3ec2;_0xbcfe8b++){var _0x5d23d6=events[_0xbcfe8b];var _0x1b01b6=createListener('chatInteraction:'+_0x5d23d6,_0x42fd0c);ChatInteractionEvents['on'](_0x5d23d6,_0x1b01b6);}}; \ No newline at end of file +var _0xea4e=['remove','update','emit','length','./chatInteraction.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xea4e,0x160));var _0xeea4=function(_0x3937b6,_0xd53d2b){_0x3937b6=_0x3937b6-0x0;var _0x1ba356=_0xea4e[_0x3937b6];return _0x1ba356;};'use strict';var ChatInteractionEvents=require(_0xeea4('0x0'));var events=[_0xeea4('0x1'),_0xeea4('0x2'),_0xeea4('0x3')];function createListener(_0x5dbe87,_0x28358e){return function(_0x4cf36a){_0x28358e[_0xeea4('0x4')](_0x5dbe87,_0x4cf36a);};}function removeListener(_0x4989a2,_0x1fb2e9){return function(){ChatInteractionEvents['removeListener'](_0x4989a2,_0x1fb2e9);};}exports['register']=function(_0x3fc23b){for(var _0x4fca37=0x0,_0x3144c6=events[_0xeea4('0x5')];_0x4fca37<_0x3144c6;_0x4fca37++){var _0xea953=events[_0x4fca37];var _0x283c50=createListener('chatInteraction:'+_0xea953,_0x3fc23b);ChatInteractionEvents['on'](_0xea953,_0x283c50);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 91a3065..be1012d 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 _0x1399=['put','/:id','chatinteraction:update','update','/:id/custom_update','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','removeTags','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','/describe','isAuthenticated','show','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','post','create','diskStorage','server/files/attachments/','format','%s-%s','replace','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags'];(function(_0x545868,_0x36aadd){var _0x411a82=function(_0xccea08){while(--_0xccea08){_0x545868['push'](_0x545868['shift']());}};_0x411a82(++_0x36aadd);}(_0x1399,0x16c));var _0x9139=function(_0x20a590,_0x1e8a6d){_0x20a590=_0x20a590-0x0;var _0x2e1b41=_0x1399[_0x20a590];return _0x2e1b41;};'use strict';var multer=require(_0x9139('0x0'));var util=require(_0x9139('0x1'));var path=require('path');var timeout=require(_0x9139('0x2'));var express=require('express');var router=express[_0x9139('0x3')]();var auth=require(_0x9139('0x4'));var interaction=require(_0x9139('0x5'));var config=require(_0x9139('0x6'));var controller=require(_0x9139('0x7'));router[_0x9139('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9139('0x8')](_0x9139('0x9'),auth[_0x9139('0xa')](),controller['describe']);router[_0x9139('0x8')]('/:id',auth['isChatInteractionAuthorized'](),controller[_0x9139('0xb')]);router[_0x9139('0x8')]('/:id/attachment_download',auth[_0x9139('0xc')](),controller[_0x9139('0xd')]);router['get']('/:id/messages',auth[_0x9139('0xa')](),controller[_0x9139('0xe')]);router[_0x9139('0x8')](_0x9139('0xf'),auth[_0x9139('0xc')](),controller['getMyMessages']);router['get']('/:id/download',auth[_0x9139('0xa')](),controller['download']);router[_0x9139('0x10')]('/',auth[_0x9139('0xa')](),controller[_0x9139('0x11')]);var upload=multer({'storage':multer[_0x9139('0x12')]({'destination':function(_0x5936d2,_0x3b1f21,_0x4d1a85){_0x4d1a85(null,path['join'](config['root'],_0x9139('0x13')));},'filename':function(_0x3e2bad,_0x1cd24e,_0x3fadf7){_0x3fadf7(null,util[_0x9139('0x14')](_0x9139('0x15'),Date['now'](),_0x1cd24e['originalname'][_0x9139('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9139('0x10')]('/:id/attachment_upload',upload['single'](_0x9139('0x17')),controller[_0x9139('0x18')]);router['post'](_0x9139('0x19'),auth[_0x9139('0xc')](),controller[_0x9139('0x1a')]);router[_0x9139('0x10')](_0x9139('0x1b'),auth[_0x9139('0xa')](),interaction[_0x9139('0x1c')](_0x9139('0x1d'),_0x9139('0x1e')),controller[_0x9139('0x1f')]);router[_0x9139('0x20')](_0x9139('0x21'),auth[_0x9139('0xa')](),interaction[_0x9139('0x1c')](_0x9139('0x1d'),_0x9139('0x22')),controller[_0x9139('0x23')]);router[_0x9139('0x20')](_0x9139('0x24'),controller['customUpdate']);router[_0x9139('0x20')](_0x9139('0x25'),auth['isChatInteractionAuthorized'](),controller[_0x9139('0x26')]);router[_0x9139('0x20')](_0x9139('0x27'),controller['close']);router[_0x9139('0x28')](_0x9139('0x21'),auth['isAuthenticated'](),interaction[_0x9139('0x1c')](_0x9139('0x1d'),_0x9139('0x29')),controller['destroy']);router[_0x9139('0x28')](_0x9139('0x1b'),auth[_0x9139('0xa')](),controller[_0x9139('0x2a')]);module[_0x9139('0x2b')]=router; \ No newline at end of file +var _0x13f6=['tracked','chatinteraction:addtags','addTags','put','chat','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','/:id/tags','removeTags','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','index','/:id','isChatInteractionAuthorized','show','attachmentDownload','isAuthenticated','getMessages','getMyMessages','download','post','create','diskStorage','join','root','format','%s-%s','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage'];(function(_0x4ccbef,_0x2d2e9c){var _0x1185e4=function(_0x3c0646){while(--_0x3c0646){_0x4ccbef['push'](_0x4ccbef['shift']());}};_0x1185e4(++_0x2d2e9c);}(_0x13f6,0x124));var _0x613f=function(_0x53e37c,_0x53b06f){_0x53e37c=_0x53e37c-0x0;var _0x16dda6=_0x13f6[_0x53e37c];return _0x16dda6;};'use strict';var multer=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x613f('0x2'));var router=express[_0x613f('0x3')]();var auth=require(_0x613f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x613f('0x5'));var controller=require(_0x613f('0x6'));router[_0x613f('0x7')]('/',auth['isAuthenticated'](),controller[_0x613f('0x8')]);router[_0x613f('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x613f('0x9'),auth[_0x613f('0xa')](),controller[_0x613f('0xb')]);router[_0x613f('0x7')]('/:id/attachment_download',auth[_0x613f('0xa')](),controller[_0x613f('0xc')]);router[_0x613f('0x7')]('/:id/messages',auth[_0x613f('0xd')](),controller[_0x613f('0xe')]);router[_0x613f('0x7')]('/:id/my_messages',auth[_0x613f('0xa')](),controller[_0x613f('0xf')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x613f('0x10')]);router[_0x613f('0x11')]('/',auth[_0x613f('0xd')](),controller[_0x613f('0x12')]);var upload=multer({'storage':multer[_0x613f('0x13')]({'destination':function(_0x4a6fc,_0x305894,_0x291268){_0x291268(null,path[_0x613f('0x14')](config[_0x613f('0x15')],'server/files/attachments/'));},'filename':function(_0x3c9edf,_0x5d7c69,_0x5c769c){_0x5c769c(null,util[_0x613f('0x16')](_0x613f('0x17'),Date['now'](),_0x5d7c69[_0x613f('0x18')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x613f('0x11')](_0x613f('0x19'),upload[_0x613f('0x1a')](_0x613f('0x1b')),controller[_0x613f('0x1c')]);router[_0x613f('0x11')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x613f('0x1d')]);router['post']('/:id/tags',auth[_0x613f('0xd')](),interaction[_0x613f('0x1e')]('chat',_0x613f('0x1f')),controller[_0x613f('0x20')]);router[_0x613f('0x21')]('/:id',auth['isAuthenticated'](),interaction[_0x613f('0x1e')](_0x613f('0x22'),_0x613f('0x23')),controller['update']);router[_0x613f('0x21')](_0x613f('0x24'),controller[_0x613f('0x25')]);router[_0x613f('0x21')](_0x613f('0x26'),auth['isChatInteractionAuthorized'](),controller[_0x613f('0x27')]);router[_0x613f('0x21')]('/:id/close',controller[_0x613f('0x28')]);router[_0x613f('0x29')](_0x613f('0x9'),auth['isAuthenticated'](),interaction['tracked']('chat',_0x613f('0x2a')),controller['destroy']);router[_0x613f('0x29')](_0x613f('0x2b'),auth['isAuthenticated'](),controller[_0x613f('0x2c')]);module[_0x613f('0x2d')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 8826722..dfcafb4 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 _0x6455=['INTEGER','sequelize','TEXT','medium','BOOLEAN'];(function(_0x5a75f6,_0x1296cd){var _0x46daeb=function(_0x36ce2c){while(--_0x36ce2c){_0x5a75f6['push'](_0x5a75f6['shift']());}};_0x46daeb(++_0x1296cd);}(_0x6455,0x97));var _0x5645=function(_0x3273e2,_0x5d4597){_0x3273e2=_0x3273e2-0x0;var _0x55e879=_0x6455[_0x3273e2];return _0x55e879;};'use strict';var Sequelize=require(_0x5645('0x0'));module['exports']={'body':{'type':Sequelize[_0x5645('0x1')](_0x5645('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5645('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5645('0x4')]}}; \ No newline at end of file +var _0x6365=['TEXT','medium','INTEGER','sequelize','exports'];(function(_0x30cc1a,_0x162bbc){var _0xb3f18f=function(_0x26bdfe){while(--_0x26bdfe){_0x30cc1a['push'](_0x30cc1a['shift']());}};_0xb3f18f(++_0x162bbc);}(_0x6365,0x148));var _0x5636=function(_0xcd2de8,_0x5e3ea8){_0xcd2de8=_0xcd2de8-0x0;var _0x2c7f40=_0x6365[_0xcd2de8];return _0x2c7f40;};'use strict';var Sequelize=require(_0x5636('0x0'));module[_0x5636('0x1')]={'body':{'type':Sequelize[_0x5636('0x2')](_0x5636('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5636('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 624b003..12ae143 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 _0xb382=['api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','status','end','json','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','index','ChatInternalMessage','rawAttributes','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','offset','order','where','filters','pick','filter','merge','map','type','VIRTUAL','field','options','count','includeAll','include','catch','show','params','find','create','body','update','describe','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','admin','fullname','role','online','allowmessenger','showWebBar','sort','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','all','html-pdf','rimraf','fast-json-patch','bluebird','mustache','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger'];(function(_0x2b5661,_0x13990f){var _0x3afb89=function(_0x5b4582){while(--_0x5b4582){_0x2b5661['push'](_0x2b5661['shift']());}};_0x3afb89(++_0x13990f);}(_0xb382,0x130));var _0x2b38=function(_0x4e1a73,_0x2056b1){_0x4e1a73=_0x4e1a73-0x0;var _0x5efdd5=_0xb382[_0x4e1a73];return _0x5efdd5;};'use strict';var pdf=require(_0x2b38('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2b38('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2b38('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2b38('0x3'));var Mustache=require(_0x2b38('0x4'));var util=require('util');var path=require(_0x2b38('0x5'));var sox=require('sox');var csv=require(_0x2b38('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2b38('0x7'));var squel=require(_0x2b38('0x8'));var crypto=require('crypto');var jsforce=require(_0x2b38('0x9'));var deskjs=require(_0x2b38('0xa'));var toCsv=require('to-csv');var querystring=require(_0x2b38('0xb'));var Papa=require(_0x2b38('0xc'));var Redis=require(_0x2b38('0xd'));var authService=require(_0x2b38('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x2b38('0xf'));var logger=require(_0x2b38('0x10'))(_0x2b38('0x11'));var utils=require('../../config/utils');var config=require(_0x2b38('0x12'));var db=require(_0x2b38('0x13'))['db'];config[_0x2b38('0x14')]=_[_0x2b38('0x15')](config[_0x2b38('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x2b38('0x16'))(new Redis(config['redis']));require(_0x2b38('0x17'))[_0x2b38('0x18')](socket);function respondWithStatusCode(_0x1c4803,_0x380036){_0x380036=_0x380036||0xcc;return function(_0x2c0d29){if(_0x2c0d29){return _0x1c4803['sendStatus'](_0x380036);}return _0x1c4803[_0x2b38('0x19')](_0x380036)[_0x2b38('0x1a')]();};}function respondWithResult(_0x3b87b7,_0x5f1eae){_0x5f1eae=_0x5f1eae||0xc8;return function(_0x4ce7d1){if(_0x4ce7d1){return _0x3b87b7[_0x2b38('0x19')](_0x5f1eae)[_0x2b38('0x1b')](_0x4ce7d1);}};}function respondWithFilteredResult(_0x53d6cc,_0x15252d){return function(_0x27beeb){if(_0x27beeb){var _0x2db552=_0x27beeb['count'],_0x40865d=_0x15252d['offset'],_0x4fbf85=_0x15252d['offset']+_0x15252d[_0x2b38('0x1c')],_0xbb0b27;if(_0x4fbf85>=_0x2db552){_0x4fbf85=_0x2db552;_0xbb0b27=0xc8;}else{_0xbb0b27=0xce;}_0x53d6cc[_0x2b38('0x19')](_0xbb0b27);return _0x53d6cc[_0x2b38('0x1d')](_0x2b38('0x1e'),_0x40865d+'-'+_0x4fbf85+'/'+_0x2db552)[_0x2b38('0x1b')](_0x27beeb);}return null;};}function patchUpdates(_0x825c15){return function(_0x5447e5){try{jsonpatch[_0x2b38('0x1f')](_0x5447e5,_0x825c15,!![]);}catch(_0x5d8ce3){return BPromise[_0x2b38('0x20')](_0x5d8ce3);}return _0x5447e5[_0x2b38('0x21')]();};}function saveUpdates(_0xbe9704,_0x4e39bf){return function(_0x13d7d4){if(_0x13d7d4){return _0x13d7d4['update'](_0xbe9704)[_0x2b38('0x22')](function(_0x1dd3eb){return _0x1dd3eb;});}return null;};}function removeEntity(_0x22da04,_0x119697){return function(_0x599a75){if(_0x599a75){return _0x599a75[_0x2b38('0x23')]()[_0x2b38('0x22')](function(){_0x22da04[_0x2b38('0x19')](0xcc)[_0x2b38('0x1a')]();});}};}function handleEntityNotFound(_0x18e3ad,_0x3ef0e6){return function(_0x435b01){if(!_0x435b01){_0x18e3ad[_0x2b38('0x24')](0x194);}return _0x435b01;};}function handleError(_0xd94a55,_0x238dc8){_0x238dc8=_0x238dc8||0x1f4;return function(_0x54ed3d){logger[_0x2b38('0x25')](_0x54ed3d[_0x2b38('0x26')]);if(_0x54ed3d[_0x2b38('0x27')]){delete _0x54ed3d['name'];}_0xd94a55[_0x2b38('0x19')](_0x238dc8)['send'](_0x54ed3d);};}exports[_0x2b38('0x28')]=function(_0x2a480f,_0x4db2fb){var _0x3452ef={},_0x33e91f={},_0x1ba111={'count':0x0,'rows':[]};var _0x3a62e6=db[_0x2b38('0x29')][_0x2b38('0x2a')];_0x33e91f[_0x2b38('0x2b')]=_[_0x2b38('0x2c')](_0x3a62e6);_0x33e91f['query']=_['keys'](_0x2a480f['query']);_0x33e91f['filters']=_['intersection'](_0x33e91f[_0x2b38('0x2b')],_0x33e91f['query']);_0x3452ef['attributes']=_[_0x2b38('0x2d')](_0x33e91f['model'],qs['fields'](_0x2a480f[_0x2b38('0x2e')][_0x2b38('0x2f')]));_0x3452ef['attributes']=_0x3452ef[_0x2b38('0x30')][_0x2b38('0x31')]?_0x3452ef[_0x2b38('0x30')]:_0x33e91f[_0x2b38('0x2b')];if(!_0x2a480f[_0x2b38('0x2e')][_0x2b38('0x32')](_0x2b38('0x33'))){_0x3452ef[_0x2b38('0x1c')]=qs['limit'](_0x2a480f[_0x2b38('0x2e')][_0x2b38('0x1c')]);_0x3452ef[_0x2b38('0x34')]=qs[_0x2b38('0x34')](_0x2a480f['query'][_0x2b38('0x34')]);}_0x3452ef[_0x2b38('0x35')]=qs['sort'](_0x2a480f['query']['sort']);_0x3452ef[_0x2b38('0x36')]=qs[_0x2b38('0x37')](_[_0x2b38('0x38')](_0x2a480f[_0x2b38('0x2e')],_0x33e91f['filters']));if(_0x2a480f['query'][_0x2b38('0x39')]){_0x3452ef['where']=_[_0x2b38('0x3a')](_0x3452ef[_0x2b38('0x36')],{'$or':_[_0x2b38('0x3b')](_0x3a62e6,function(_0x3c9df3){if(_0x3c9df3[_0x2b38('0x3c')]['key']!==_0x2b38('0x3d')){var _0x4385e9={};_0x4385e9[_0x3c9df3[_0x2b38('0x3e')]]={'$like':'%'+_0x2a480f[_0x2b38('0x2e')][_0x2b38('0x39')]+'%'};return _0x4385e9;}})});}_0x3452ef=_['merge']({},_0x3452ef,_0x2a480f[_0x2b38('0x3f')]);var _0x3f313a={'where':_0x3452ef[_0x2b38('0x36')]};return db[_0x2b38('0x29')][_0x2b38('0x40')](_0x3f313a)[_0x2b38('0x22')](function(_0x1436a7){_0x1ba111[_0x2b38('0x40')]=_0x1436a7;if(_0x2a480f['query'][_0x2b38('0x41')]){_0x3452ef[_0x2b38('0x42')]=[{'all':!![]}];}return db[_0x2b38('0x29')]['findAll'](_0x3452ef);})[_0x2b38('0x22')](function(_0x57d6b2){_0x1ba111['rows']=_0x57d6b2;return _0x1ba111;})[_0x2b38('0x22')](respondWithFilteredResult(_0x4db2fb,_0x3452ef))[_0x2b38('0x43')](handleError(_0x4db2fb,null));};exports[_0x2b38('0x44')]=function(_0x46c7a8,_0x566a8a){var _0x14a914={'raw':!![],'where':{'id':_0x46c7a8[_0x2b38('0x45')]['id']}},_0xa6f392={};_0xa6f392[_0x2b38('0x2b')]=_[_0x2b38('0x2c')](db[_0x2b38('0x29')]['rawAttributes']);_0xa6f392[_0x2b38('0x2e')]=_[_0x2b38('0x2c')](_0x46c7a8[_0x2b38('0x2e')]);_0xa6f392[_0x2b38('0x37')]=_[_0x2b38('0x2d')](_0xa6f392[_0x2b38('0x2b')],_0xa6f392[_0x2b38('0x2e')]);_0x14a914['attributes']=_['intersection'](_0xa6f392[_0x2b38('0x2b')],qs[_0x2b38('0x2f')](_0x46c7a8[_0x2b38('0x2e')]['fields']));_0x14a914['attributes']=_0x14a914[_0x2b38('0x30')][_0x2b38('0x31')]?_0x14a914['attributes']:_0xa6f392[_0x2b38('0x2b')];if(_0x46c7a8[_0x2b38('0x2e')][_0x2b38('0x41')]){_0x14a914[_0x2b38('0x42')]=[{'all':!![]}];}_0x14a914=_['merge']({},_0x14a914,_0x46c7a8[_0x2b38('0x3f')]);return db[_0x2b38('0x29')][_0x2b38('0x46')](_0x14a914)[_0x2b38('0x22')](handleEntityNotFound(_0x566a8a,null))[_0x2b38('0x22')](respondWithResult(_0x566a8a,null))['catch'](handleError(_0x566a8a,null));};exports[_0x2b38('0x47')]=function(_0x556ff4,_0x19ca58){return db[_0x2b38('0x29')][_0x2b38('0x47')](_0x556ff4[_0x2b38('0x48')],{})[_0x2b38('0x22')](respondWithResult(_0x19ca58,0xc9))[_0x2b38('0x43')](handleError(_0x19ca58,null));};exports[_0x2b38('0x49')]=function(_0x53d520,_0x46c8e4){if(_0x53d520['body']['id']){delete _0x53d520[_0x2b38('0x48')]['id'];}return db[_0x2b38('0x29')][_0x2b38('0x46')]({'where':{'id':_0x53d520[_0x2b38('0x45')]['id']}})[_0x2b38('0x22')](handleEntityNotFound(_0x46c8e4,null))[_0x2b38('0x22')](saveUpdates(_0x53d520['body'],null))[_0x2b38('0x22')](respondWithResult(_0x46c8e4,null))[_0x2b38('0x43')](handleError(_0x46c8e4,null));};exports[_0x2b38('0x23')]=function(_0x138df1,_0x1196cf){return db[_0x2b38('0x29')][_0x2b38('0x46')]({'where':{'id':_0x138df1['params']['id']}})[_0x2b38('0x22')](handleEntityNotFound(_0x1196cf,null))[_0x2b38('0x22')](removeEntity(_0x1196cf,null))[_0x2b38('0x43')](handleError(_0x1196cf,null));};exports[_0x2b38('0x4a')]=function(_0x497623,_0xa6d3ed){return db[_0x2b38('0x29')][_0x2b38('0x4a')]()['then'](respondWithResult(_0xa6d3ed,null))[_0x2b38('0x43')](handleError(_0xa6d3ed,null));};function wrapUser(_0x5c8fe5){return function(_0x173225){var _0x23cfc4=_0x5c8fe5['get']({'plain':!![]});_0x23cfc4[_0x2b38('0x4b')]=[];if(_0x173225){_0x23cfc4[_0x2b38('0x4c')]=_0x173225[_0x2b38('0x4d')];_0x23cfc4[_0x2b38('0x4e')]=_0x173225;}else{_0x23cfc4[_0x2b38('0x4c')]=moment(0x0)['format'](_0x2b38('0x4f'));_0x23cfc4[_0x2b38('0x4e')]={};}return _0x23cfc4;};}exports[_0x2b38('0x50')]=function(_0xfa9638,_0x33d4af,_0x6b4ca8){var _0x1743a0=[];return db[_0x2b38('0x51')][_0x2b38('0x52')]({'where':{'role':[_0x2b38('0x53'),_0x2b38('0x54'),'user']},'attributes':['id',_0x2b38('0x55'),_0x2b38('0x27'),_0x2b38('0x56'),'userpic','internal',_0x2b38('0x57'),'lastLoginAt',_0x2b38('0x58'),_0x2b38('0x59')],'order':qs[_0x2b38('0x5a')](_0x2b38('0x5b')),'include':[{'model':db[_0x2b38('0x5c')],'as':_0x2b38('0x5d'),'attributes':['id',_0x2b38('0x27'),_0x2b38('0x3c')],'through':{'attributes':[]}}]})[_0x2b38('0x22')](function(_0x5e835b){if(_0x5e835b){var _0x1d9deb=_0xfa9638[_0x2b38('0x5e')]['get']({'plain':!![]});if(!_0x1d9deb)throw new Error(_0x2b38('0x5f'));if(_0x1d9deb['role']===_0x2b38('0x5e')){return db[_0x2b38('0x60')]['find']({'where':{'name':'Agents','userProfileId':_0x1d9deb[_0x2b38('0x61')]},'raw':!![]})[_0x2b38('0x22')](function(_0x404ec3){if(_0x404ec3){if(_0x404ec3[_0x2b38('0x62')]===0x0){return db[_0x2b38('0x63')]['findAll']({'where':{'sectionId':_0x404ec3['id']},'raw':!![]})['then'](function(_0x23f5eb){var _0x423897=[];if(_[_0x2b38('0x64')](_0x23f5eb)){_0x423897=_['filter'](_0x5e835b,function(_0x1c5c9e){if(_0x1c5c9e['role']!==_0x2b38('0x53')){return _0x1c5c9e;}});return _0x423897;}else{for(var _0x1125d8=0x0;_0x1125d8<_0x5e835b[_0x2b38('0x31')];_0x1125d8++){var _0x5444c6=_0x5e835b[_0x1125d8];if(_0x5444c6[_0x2b38('0x56')]==='agent'){var _0xe18402=_[_0x2b38('0x46')](_0x23f5eb,function(_0x2d7478){return _0x2d7478[_0x2b38('0x65')]===_0x5444c6['id'];});if(_0xe18402)_0x423897[_0x2b38('0x66')](_0x5444c6);}else{_0x423897[_0x2b38('0x66')](_0x5444c6);}}return _0x423897;}});}else{return _0x5e835b;}}else{var _0x141ec2=_['filter'](_0x5e835b,function(_0x43bcd3){if(_0x43bcd3['role']!==_0x2b38('0x53')){return _0x43bcd3;}});return _0x141ec2;}});}else{return _0x5e835b;}}})[_0x2b38('0x22')](function(_0x20da9a){var _0x1d3844=[];if(_0x20da9a){_0x1743a0=_0x20da9a;for(var _0x3a5a80=0x0;_0x3a5a80<_0x20da9a[_0x2b38('0x31')];_0x3a5a80+=0x1){_0x1743a0[_0x3a5a80]['messages']=[];_0x1d3844[_0x2b38('0x66')](db[_0x2b38('0x29')][_0x2b38('0x46')]({'where':{'FromId':[_0xfa9638['user']['id'],_0x20da9a[_0x3a5a80]['id']],'ToId':[_0xfa9638[_0x2b38('0x5e')]['id'],_0x20da9a[_0x3a5a80]['id']],'ChatGroupId':null},'attributes':['id',_0x2b38('0x4d'),_0x2b38('0x67'),_0x2b38('0x68'),_0x2b38('0x69'),_0x2b38('0x48')],'order':qs[_0x2b38('0x5a')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x20da9a[_0x3a5a80])));}return BPromise[_0x2b38('0x6a')](_0x1d3844);}return[];})[_0x2b38('0x22')](function(_0x5681c3){return{'rows':_0x5681c3,'count':_0x5681c3['length']};})[_0x2b38('0x22')](respondWithResult(_0x33d4af,null))[_0x2b38('0x43')](handleError(_0x33d4af,null));}; \ No newline at end of file +var _0x7a22=['../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','count','offset','limit','set','apply','update','then','destroy','error','stack','name','send','index','ChatInternalMessage','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','filter','merge','where','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','type','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','resourceId','push','messages','ToId','-createdAt','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x3c4a7c,_0x2f4e3c){var _0xf13d1e=function(_0x24cb78){while(--_0x24cb78){_0x3c4a7c['push'](_0x3c4a7c['shift']());}};_0xf13d1e(++_0x2f4e3c);}(_0x7a22,0x13b));var _0x27a2=function(_0x3d523e,_0x2301b4){_0x3d523e=_0x3d523e-0x0;var _0x1afa26=_0x7a22[_0x3d523e];return _0x1afa26;};'use strict';var pdf=require(_0x27a2('0x0'));var emlformat=require(_0x27a2('0x1'));var rimraf=require(_0x27a2('0x2'));var zipdir=require(_0x27a2('0x3'));var jsonpatch=require(_0x27a2('0x4'));var rp=require(_0x27a2('0x5'));var moment=require(_0x27a2('0x6'));var BPromise=require(_0x27a2('0x7'));var Mustache=require(_0x27a2('0x8'));var util=require(_0x27a2('0x9'));var path=require(_0x27a2('0xa'));var sox=require(_0x27a2('0xb'));var csv=require(_0x27a2('0xc'));var ejs=require(_0x27a2('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x27a2('0xe'));var crypto=require(_0x27a2('0xf'));var jsforce=require(_0x27a2('0x10'));var deskjs=require(_0x27a2('0x11'));var toCsv=require('to-csv');var querystring=require(_0x27a2('0x12'));var Papa=require(_0x27a2('0x13'));var Redis=require(_0x27a2('0x14'));var authService=require(_0x27a2('0x15'));var qs=require(_0x27a2('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x27a2('0x17'))(_0x27a2('0x18'));var utils=require(_0x27a2('0x19'));var config=require(_0x27a2('0x1a'));var db=require(_0x27a2('0x1b'))['db'];config[_0x27a2('0x1c')]=_[_0x27a2('0x1d')](config['redis'],{'host':_0x27a2('0x1e'),'port':0x18eb});var socket=require(_0x27a2('0x1f'))(new Redis(config[_0x27a2('0x1c')]));require(_0x27a2('0x20'))[_0x27a2('0x21')](socket);function respondWithStatusCode(_0x83e9e8,_0xed89de){_0xed89de=_0xed89de||0xcc;return function(_0xa1c49e){if(_0xa1c49e){return _0x83e9e8[_0x27a2('0x22')](_0xed89de);}return _0x83e9e8[_0x27a2('0x23')](_0xed89de)[_0x27a2('0x24')]();};}function respondWithResult(_0x2d2c4a,_0xe7ae8b){_0xe7ae8b=_0xe7ae8b||0xc8;return function(_0x5a5624){if(_0x5a5624){return _0x2d2c4a['status'](_0xe7ae8b)[_0x27a2('0x25')](_0x5a5624);}};}function respondWithFilteredResult(_0x2d3d7b,_0x4324da){return function(_0x59ad71){if(_0x59ad71){var _0x1b4d19=_0x59ad71[_0x27a2('0x26')],_0x5e214c=_0x4324da[_0x27a2('0x27')],_0x5c58c9=_0x4324da[_0x27a2('0x27')]+_0x4324da[_0x27a2('0x28')],_0x2f4424;if(_0x5c58c9>=_0x1b4d19){_0x5c58c9=_0x1b4d19;_0x2f4424=0xc8;}else{_0x2f4424=0xce;}_0x2d3d7b[_0x27a2('0x23')](_0x2f4424);return _0x2d3d7b[_0x27a2('0x29')]('Content-Range',_0x5e214c+'-'+_0x5c58c9+'/'+_0x1b4d19)[_0x27a2('0x25')](_0x59ad71);}return null;};}function patchUpdates(_0x4622f5){return function(_0x2ba18c){try{jsonpatch[_0x27a2('0x2a')](_0x2ba18c,_0x4622f5,!![]);}catch(_0x4d50b6){return BPromise['reject'](_0x4d50b6);}return _0x2ba18c['save']();};}function saveUpdates(_0x4e91a3,_0x1ccd54){return function(_0xcac22d){if(_0xcac22d){return _0xcac22d[_0x27a2('0x2b')](_0x4e91a3)[_0x27a2('0x2c')](function(_0x3cf4f5){return _0x3cf4f5;});}return null;};}function removeEntity(_0x1b1ae5,_0xad35c0){return function(_0x4873a5){if(_0x4873a5){return _0x4873a5[_0x27a2('0x2d')]()[_0x27a2('0x2c')](function(){_0x1b1ae5['status'](0xcc)[_0x27a2('0x24')]();});}};}function handleEntityNotFound(_0x505217,_0x12c4d5){return function(_0x4707d7){if(!_0x4707d7){_0x505217[_0x27a2('0x22')](0x194);}return _0x4707d7;};}function handleError(_0x25a164,_0x14ac15){_0x14ac15=_0x14ac15||0x1f4;return function(_0x2a27ee){logger[_0x27a2('0x2e')](_0x2a27ee[_0x27a2('0x2f')]);if(_0x2a27ee[_0x27a2('0x30')]){delete _0x2a27ee[_0x27a2('0x30')];}_0x25a164[_0x27a2('0x23')](_0x14ac15)[_0x27a2('0x31')](_0x2a27ee);};}exports[_0x27a2('0x32')]=function(_0x4b8db4,_0x413e56){var _0xb05b82={},_0x3c516e={},_0x7e5f46={'count':0x0,'rows':[]};var _0x58cf39=db[_0x27a2('0x33')]['rawAttributes'];_0x3c516e[_0x27a2('0x34')]=_['keys'](_0x58cf39);_0x3c516e[_0x27a2('0x35')]=_['keys'](_0x4b8db4[_0x27a2('0x35')]);_0x3c516e[_0x27a2('0x36')]=_[_0x27a2('0x37')](_0x3c516e[_0x27a2('0x34')],_0x3c516e[_0x27a2('0x35')]);_0xb05b82['attributes']=_['intersection'](_0x3c516e[_0x27a2('0x34')],qs[_0x27a2('0x38')](_0x4b8db4['query'][_0x27a2('0x38')]));_0xb05b82[_0x27a2('0x39')]=_0xb05b82[_0x27a2('0x39')][_0x27a2('0x3a')]?_0xb05b82[_0x27a2('0x39')]:_0x3c516e[_0x27a2('0x34')];if(!_0x4b8db4[_0x27a2('0x35')][_0x27a2('0x3b')]('nolimit')){_0xb05b82[_0x27a2('0x28')]=qs[_0x27a2('0x28')](_0x4b8db4[_0x27a2('0x35')]['limit']);_0xb05b82['offset']=qs[_0x27a2('0x27')](_0x4b8db4[_0x27a2('0x35')][_0x27a2('0x27')]);}_0xb05b82[_0x27a2('0x3c')]=qs[_0x27a2('0x3d')](_0x4b8db4[_0x27a2('0x35')][_0x27a2('0x3d')]);_0xb05b82['where']=qs['filters'](_['pick'](_0x4b8db4[_0x27a2('0x35')],_0x3c516e['filters']));if(_0x4b8db4[_0x27a2('0x35')][_0x27a2('0x3e')]){_0xb05b82['where']=_[_0x27a2('0x3f')](_0xb05b82[_0x27a2('0x40')],{'$or':_['map'](_0x58cf39,function(_0x573621){if(_0x573621['type'][_0x27a2('0x41')]!==_0x27a2('0x42')){var _0x160916={};_0x160916[_0x573621[_0x27a2('0x43')]]={'$like':'%'+_0x4b8db4[_0x27a2('0x35')][_0x27a2('0x3e')]+'%'};return _0x160916;}})});}_0xb05b82=_['merge']({},_0xb05b82,_0x4b8db4[_0x27a2('0x44')]);var _0x3af144={'where':_0xb05b82[_0x27a2('0x40')]};return db[_0x27a2('0x33')][_0x27a2('0x26')](_0x3af144)[_0x27a2('0x2c')](function(_0x4af068){_0x7e5f46[_0x27a2('0x26')]=_0x4af068;if(_0x4b8db4[_0x27a2('0x35')][_0x27a2('0x45')]){_0xb05b82[_0x27a2('0x46')]=[{'all':!![]}];}return db[_0x27a2('0x33')][_0x27a2('0x47')](_0xb05b82);})[_0x27a2('0x2c')](function(_0x5f42c9){_0x7e5f46[_0x27a2('0x48')]=_0x5f42c9;return _0x7e5f46;})[_0x27a2('0x2c')](respondWithFilteredResult(_0x413e56,_0xb05b82))[_0x27a2('0x49')](handleError(_0x413e56,null));};exports['show']=function(_0x583cff,_0x4d2775){var _0x3ba3d5={'raw':!![],'where':{'id':_0x583cff[_0x27a2('0x4a')]['id']}},_0x2e9c65={};_0x2e9c65[_0x27a2('0x34')]=_[_0x27a2('0x4b')](db[_0x27a2('0x33')][_0x27a2('0x4c')]);_0x2e9c65[_0x27a2('0x35')]=_[_0x27a2('0x4b')](_0x583cff['query']);_0x2e9c65[_0x27a2('0x36')]=_['intersection'](_0x2e9c65['model'],_0x2e9c65['query']);_0x3ba3d5[_0x27a2('0x39')]=_['intersection'](_0x2e9c65[_0x27a2('0x34')],qs[_0x27a2('0x38')](_0x583cff[_0x27a2('0x35')][_0x27a2('0x38')]));_0x3ba3d5[_0x27a2('0x39')]=_0x3ba3d5[_0x27a2('0x39')][_0x27a2('0x3a')]?_0x3ba3d5['attributes']:_0x2e9c65[_0x27a2('0x34')];if(_0x583cff['query'][_0x27a2('0x45')]){_0x3ba3d5[_0x27a2('0x46')]=[{'all':!![]}];}_0x3ba3d5=_[_0x27a2('0x3f')]({},_0x3ba3d5,_0x583cff[_0x27a2('0x44')]);return db['ChatInternalMessage'][_0x27a2('0x4d')](_0x3ba3d5)[_0x27a2('0x2c')](handleEntityNotFound(_0x4d2775,null))[_0x27a2('0x2c')](respondWithResult(_0x4d2775,null))[_0x27a2('0x49')](handleError(_0x4d2775,null));};exports[_0x27a2('0x4e')]=function(_0x275582,_0x5c9912){return db[_0x27a2('0x33')]['create'](_0x275582[_0x27a2('0x4f')],{})[_0x27a2('0x2c')](respondWithResult(_0x5c9912,0xc9))[_0x27a2('0x49')](handleError(_0x5c9912,null));};exports[_0x27a2('0x2b')]=function(_0x24e6c9,_0x19071b){if(_0x24e6c9['body']['id']){delete _0x24e6c9['body']['id'];}return db[_0x27a2('0x33')]['find']({'where':{'id':_0x24e6c9['params']['id']}})['then'](handleEntityNotFound(_0x19071b,null))[_0x27a2('0x2c')](saveUpdates(_0x24e6c9[_0x27a2('0x4f')],null))[_0x27a2('0x2c')](respondWithResult(_0x19071b,null))['catch'](handleError(_0x19071b,null));};exports[_0x27a2('0x2d')]=function(_0xbf7ea7,_0x173c52){return db[_0x27a2('0x33')][_0x27a2('0x4d')]({'where':{'id':_0xbf7ea7['params']['id']}})[_0x27a2('0x2c')](handleEntityNotFound(_0x173c52,null))[_0x27a2('0x2c')](removeEntity(_0x173c52,null))[_0x27a2('0x49')](handleError(_0x173c52,null));};exports['describe']=function(_0x506109,_0x49af52){return db[_0x27a2('0x33')]['describe']()[_0x27a2('0x2c')](respondWithResult(_0x49af52,null))[_0x27a2('0x49')](handleError(_0x49af52,null));};function wrapUser(_0x294b6e){return function(_0x50c09b){var _0x47786d=_0x294b6e[_0x27a2('0x50')]({'plain':!![]});_0x47786d['messages']=[];if(_0x50c09b){_0x47786d[_0x27a2('0x51')]=_0x50c09b[_0x27a2('0x52')];_0x47786d[_0x27a2('0x53')]=_0x50c09b;}else{_0x47786d[_0x27a2('0x51')]=moment(0x0)[_0x27a2('0x54')](_0x27a2('0x55'));_0x47786d[_0x27a2('0x53')]={};}return _0x47786d;};}exports[_0x27a2('0x56')]=function(_0x399b2b,_0x5df87c,_0x12e925){var _0x193419=[];return db[_0x27a2('0x57')][_0x27a2('0x47')]({'where':{'role':[_0x27a2('0x58'),_0x27a2('0x59'),_0x27a2('0x5a')]},'attributes':['id','fullname','name',_0x27a2('0x5b'),_0x27a2('0x5c'),_0x27a2('0x5d'),_0x27a2('0x5e'),_0x27a2('0x5f'),_0x27a2('0x60'),_0x27a2('0x61')],'order':qs[_0x27a2('0x3d')](_0x27a2('0x62')),'include':[{'model':db[_0x27a2('0x63')],'as':_0x27a2('0x64'),'attributes':['id',_0x27a2('0x30'),_0x27a2('0x65')],'through':{'attributes':[]}}]})[_0x27a2('0x2c')](function(_0x561182){if(_0x561182){var _0x210ff8=_0x399b2b[_0x27a2('0x5a')][_0x27a2('0x50')]({'plain':!![]});if(!_0x210ff8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x210ff8[_0x27a2('0x5b')]==='user'){return db[_0x27a2('0x66')][_0x27a2('0x4d')]({'where':{'name':_0x27a2('0x67'),'userProfileId':_0x210ff8[_0x27a2('0x68')]},'raw':!![]})['then'](function(_0x593056){if(_0x593056){if(_0x593056[_0x27a2('0x69')]===0x0){return db['UserProfileResource'][_0x27a2('0x47')]({'where':{'sectionId':_0x593056['id']},'raw':!![]})['then'](function(_0x1da2c9){var _0x1884b3=[];if(_[_0x27a2('0x6a')](_0x1da2c9)){_0x1884b3=_[_0x27a2('0x3e')](_0x561182,function(_0x28c958){if(_0x28c958[_0x27a2('0x5b')]!==_0x27a2('0x58')){return _0x28c958;}});return _0x1884b3;}else{for(var _0x481998=0x0;_0x481998<_0x561182[_0x27a2('0x3a')];_0x481998++){var _0x6aa30=_0x561182[_0x481998];if(_0x6aa30[_0x27a2('0x5b')]===_0x27a2('0x58')){var _0x286fc8=_['find'](_0x1da2c9,function(_0x1986e5){return _0x1986e5[_0x27a2('0x6b')]===_0x6aa30['id'];});if(_0x286fc8)_0x1884b3[_0x27a2('0x6c')](_0x6aa30);}else{_0x1884b3[_0x27a2('0x6c')](_0x6aa30);}}return _0x1884b3;}});}else{return _0x561182;}}else{var _0x38fa2f=_['filter'](_0x561182,function(_0x23bbef){if(_0x23bbef[_0x27a2('0x5b')]!==_0x27a2('0x58')){return _0x23bbef;}});return _0x38fa2f;}});}else{return _0x561182;}}})[_0x27a2('0x2c')](function(_0x277523){var _0x893786=[];if(_0x277523){_0x193419=_0x277523;for(var _0x50a0d9=0x0;_0x50a0d9<_0x277523['length'];_0x50a0d9+=0x1){_0x193419[_0x50a0d9][_0x27a2('0x6d')]=[];_0x893786[_0x27a2('0x6c')](db['ChatInternalMessage'][_0x27a2('0x4d')]({'where':{'FromId':[_0x399b2b[_0x27a2('0x5a')]['id'],_0x277523[_0x50a0d9]['id']],'ToId':[_0x399b2b[_0x27a2('0x5a')]['id'],_0x277523[_0x50a0d9]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x27a2('0x6e'),'read',_0x27a2('0x4f')],'order':qs[_0x27a2('0x3d')](_0x27a2('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x277523[_0x50a0d9])));}return BPromise['all'](_0x893786);}return[];})['then'](function(_0x20e464){return{'rows':_0x20e464,'count':_0x20e464[_0x27a2('0x3a')]};})[_0x27a2('0x2c')](respondWithResult(_0x5df87c,null))[_0x27a2('0x49')](handleError(_0x5df87c,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index fdc5e4c..1d3585e 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 _0x3eec=['../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x533aae,_0x891185){var _0x49fd89=function(_0x46a98c){while(--_0x46a98c){_0x533aae['push'](_0x533aae['shift']());}};_0x49fd89(++_0x891185);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x33a2f0,_0x208cb4){_0x33a2f0=_0x33a2f0-0x0;var _0x41c937=_0x3eec[_0x33a2f0];return _0x41c937;};'use strict';var EventEmitter=require(_0xc3ee('0x0'));var ChatInternalMessage=require(_0xc3ee('0x1'))['db'][_0xc3ee('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xc3ee('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc3ee('0x4'),'afterDestroy':_0xc3ee('0x5')};function emitEvent(_0x12db6b){return function(_0x35b2fb,_0x25074b,_0x237115){ChatInternalMessageEvents['emit'](_0x12db6b+':'+_0x35b2fb['id'],_0x35b2fb);ChatInternalMessageEvents[_0xc3ee('0x6')](_0x12db6b,_0x35b2fb);_0x237115(null);};}for(var e in events){if(events[_0xc3ee('0x7')](e)){var event=events[e];ChatInternalMessage[_0xc3ee('0x8')](e,emitEvent(event));}}module[_0xc3ee('0x9')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x1ba2=['remove','emit','hasOwnProperty','exports','events','ChatInternalMessage','save','update'];(function(_0x5e551d,_0x221082){var _0x552c34=function(_0x367be3){while(--_0x367be3){_0x5e551d['push'](_0x5e551d['shift']());}};_0x552c34(++_0x221082);}(_0x1ba2,0xb4));var _0x21ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ba2[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x21ba('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x21ba('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x21ba('0x2'),'afterUpdate':_0x21ba('0x3'),'afterDestroy':_0x21ba('0x4')};function emitEvent(_0xface0a){return function(_0x3661dd,_0x527ad5,_0x36e207){ChatInternalMessageEvents[_0x21ba('0x5')](_0xface0a+':'+_0x3661dd['id'],_0x3661dd);ChatInternalMessageEvents['emit'](_0xface0a,_0x3661dd);_0x36e207(null);};}for(var e in events){if(events[_0x21ba('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x21ba('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 22f1bb3..1133734 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 _0x58e7=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','api','moment'];(function(_0x5aaa1d,_0x1652bc){var _0x5751ef=function(_0x4f70a8){while(--_0x4f70a8){_0x5aaa1d['push'](_0x5aaa1d['shift']());}};_0x5751ef(++_0x1652bc);}(_0x58e7,0x1ec));var _0x758e=function(_0x22c873,_0xa2448e){_0x22c873=_0x22c873-0x0;var _0x165b1b=_0x58e7[_0x22c873];return _0x165b1b;};'use strict';var _=require('lodash');var util=require(_0x758e('0x0'));var logger=require('../../config/logger')(_0x758e('0x1'));var moment=require(_0x758e('0x2'));var BPromise=require(_0x758e('0x3'));var rp=require(_0x758e('0x4'));var fs=require('fs');var path=require(_0x758e('0x5'));var rimraf=require(_0x758e('0x6'));var config=require(_0x758e('0x7'));var attributes=require(_0x758e('0x8'));module[_0x758e('0x9')]=function(_0x5885ee,_0x4d037e){return _0x5885ee[_0x758e('0xa')](_0x758e('0xb'),attributes,{'tableName':_0x758e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x758e('0xd'),'collate':_0x758e('0xe')});}; \ No newline at end of file +var _0xc775=['request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird'];(function(_0x10baa1,_0x15e4b1){var _0x3a6439=function(_0x285a64){while(--_0x285a64){_0x10baa1['push'](_0x10baa1['shift']());}};_0x3a6439(++_0x15e4b1);}(_0xc775,0xec));var _0x5c77=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc775[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x5c77('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5c77('0x1'));var moment=require(_0x5c77('0x2'));var BPromise=require(_0x5c77('0x3'));var rp=require(_0x5c77('0x4'));var fs=require('fs');var path=require(_0x5c77('0x5'));var rimraf=require(_0x5c77('0x6'));var config=require(_0x5c77('0x7'));var attributes=require(_0x5c77('0x8'));module[_0x5c77('0x9')]=function(_0x59aebc,_0x2ec767){return _0x59aebc[_0x5c77('0xa')](_0x5c77('0xb'),attributes,{'tableName':_0x5c77('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5c77('0xd'),'collate':_0x5c77('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 6dea0cd..dabd5fd 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 _0x6c2e=['request\x20sent','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x49e49a,_0x5da5a7){var _0x37e5fc=function(_0x53abca){while(--_0x53abca){_0x49e49a['push'](_0x49e49a['shift']());}};_0x37e5fc(++_0x5da5a7);}(_0x6c2e,0x118));var _0xe6c2=function(_0x54e04f,_0x174322){_0x54e04f=_0x54e04f-0x0;var _0x39ce59=_0x6c2e[_0x54e04f];return _0x39ce59;};'use strict';var _=require('lodash');var util=require(_0xe6c2('0x0'));var moment=require(_0xe6c2('0x1'));var BPromise=require(_0xe6c2('0x2'));var rs=require(_0xe6c2('0x3'));var fs=require('fs');var Redis=require(_0xe6c2('0x4'));var db=require(_0xe6c2('0x5'))['db'];var utils=require(_0xe6c2('0x6'));var logger=require(_0xe6c2('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe6c2('0x8'));var client=jayson[_0xe6c2('0x9')][_0xe6c2('0xa')]({'port':0x232a});config[_0xe6c2('0xb')]=_['defaults'](config['redis'],{'host':_0xe6c2('0xc'),'port':0x18eb});var socket=require(_0xe6c2('0xd'))(new Redis(config[_0xe6c2('0xb')]));require(_0xe6c2('0xe'))[_0xe6c2('0xf')](socket);function respondWithRpcPromise(_0x1d3c99,_0x463c66,_0x43d201){return new BPromise(function(_0x21dbff,_0x1e0352){return client[_0xe6c2('0x10')](_0x1d3c99,_0x43d201)[_0xe6c2('0x11')](function(_0x5252fc){logger[_0xe6c2('0x12')](_0xe6c2('0x13'),_0x463c66,_0xe6c2('0x14'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x463c66,_0xe6c2('0x14'),JSON['stringify'](_0x5252fc));if(_0x5252fc[_0xe6c2('0x15')]){if(_0x5252fc[_0xe6c2('0x15')][_0xe6c2('0x16')]===0x1f4){logger[_0xe6c2('0x15')](_0xe6c2('0x13'),_0x463c66,_0x5252fc['error']['message']);return _0x1e0352(_0x5252fc[_0xe6c2('0x15')][_0xe6c2('0x17')]);}logger[_0xe6c2('0x15')](_0xe6c2('0x13'),_0x463c66,_0x5252fc[_0xe6c2('0x15')][_0xe6c2('0x17')]);return _0x21dbff(_0x5252fc[_0xe6c2('0x15')]['message']);}else{logger[_0xe6c2('0x12')](_0xe6c2('0x13'),_0x463c66,'request\x20sent');_0x21dbff(_0x5252fc['result'][_0xe6c2('0x17')]);}})[_0xe6c2('0x18')](function(_0x1929bb){logger[_0xe6c2('0x15')](_0xe6c2('0x13'),_0x463c66,_0x1929bb);_0x1e0352(_0x1929bb);});});} \ No newline at end of file +var _0xe085=['register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x39d474,_0x280fb6){var _0x5915ca=function(_0x5233c1){while(--_0x5233c1){_0x39d474['push'](_0x39d474['shift']());}};_0x5915ca(++_0x280fb6);}(_0xe085,0x16a));var _0x5e08=function(_0x3d7dd3,_0x2bc0b6){_0x3d7dd3=_0x3d7dd3-0x0;var _0xfa848e=_0xe085[_0x3d7dd3];return _0xfa848e;};'use strict';var _=require(_0x5e08('0x0'));var util=require(_0x5e08('0x1'));var moment=require(_0x5e08('0x2'));var BPromise=require(_0x5e08('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e08('0x4'));var db=require(_0x5e08('0x5'))['db'];var utils=require(_0x5e08('0x6'));var logger=require(_0x5e08('0x7'))('rpc');var config=require(_0x5e08('0x8'));var jayson=require(_0x5e08('0x9'));var client=jayson['client'][_0x5e08('0xa')]({'port':0x232a});config['redis']=_[_0x5e08('0xb')](config[_0x5e08('0xc')],{'host':_0x5e08('0xd'),'port':0x18eb});var socket=require(_0x5e08('0xe'))(new Redis(config[_0x5e08('0xc')]));require('./chatInternalMessage.socket')[_0x5e08('0xf')](socket);function respondWithRpcPromise(_0x1472a2,_0x401a94,_0x541be1){return new BPromise(function(_0xdaa68b,_0x42eddd){return client[_0x5e08('0x10')](_0x1472a2,_0x541be1)[_0x5e08('0x11')](function(_0x4031e){logger[_0x5e08('0x12')](_0x5e08('0x13'),_0x401a94,'request\x20sent');logger[_0x5e08('0x14')](_0x5e08('0x15'),_0x401a94,_0x5e08('0x16'),JSON[_0x5e08('0x17')](_0x4031e));if(_0x4031e[_0x5e08('0x18')]){if(_0x4031e[_0x5e08('0x18')][_0x5e08('0x19')]===0x1f4){logger[_0x5e08('0x18')](_0x5e08('0x13'),_0x401a94,_0x4031e['error'][_0x5e08('0x1a')]);return _0x42eddd(_0x4031e['error']['message']);}logger[_0x5e08('0x18')](_0x5e08('0x13'),_0x401a94,_0x4031e[_0x5e08('0x18')][_0x5e08('0x1a')]);return _0xdaa68b(_0x4031e['error'][_0x5e08('0x1a')]);}else{logger['info'](_0x5e08('0x13'),_0x401a94,'request\x20sent');_0xdaa68b(_0x4031e[_0x5e08('0x1b')][_0x5e08('0x1a')]);}})[_0x5e08('0x1c')](function(_0x370a8b){logger[_0x5e08('0x18')](_0x5e08('0x13'),_0x401a94,_0x370a8b);_0x42eddd(_0x370a8b);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 642be2c..5a5c4e2 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 _0x24f4=['emit','removeListener','remove','update'];(function(_0xd77fa2,_0x489a23){var _0x101679=function(_0xebb241){while(--_0xebb241){_0xd77fa2['push'](_0xd77fa2['shift']());}};_0x101679(++_0x489a23);}(_0x24f4,0x166));var _0x424f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x24f4[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0x424f('0x0'),_0x424f('0x1')];function createListener(_0x4d0888,_0x45ecfb){return function(_0x3ab2c8){_0x45ecfb[_0x424f('0x2')](_0x4d0888,_0x3ab2c8);};}function removeListener(_0x15d9d3,_0x36a8c4){return function(){ChatInternalMessageEvents[_0x424f('0x3')](_0x15d9d3,_0x36a8c4);};}exports['register']=function(_0x26a960){for(var _0x5c5609=0x0,_0x477b6a=events['length'];_0x5c5609<_0x477b6a;_0x5c5609++){var _0x278966=events[_0x5c5609];var _0x21e446=createListener('chatInternalMessage:'+_0x278966,_0x26a960);ChatInternalMessageEvents['on'](_0x278966,_0x21e446);}}; \ No newline at end of file +var _0xd367=['register','length','chatInternalMessage:','save','remove','update','emit','removeListener'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0xd367,0x1c3));var _0x7d36=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd367[_0xa464c9];return _0x3d73c4;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x7d36('0x0'),_0x7d36('0x1'),_0x7d36('0x2')];function createListener(_0x28b2ba,_0x6798c7){return function(_0x2d56f5){_0x6798c7[_0x7d36('0x3')](_0x28b2ba,_0x2d56f5);};}function removeListener(_0x12d27e,_0x45a84a){return function(){ChatInternalMessageEvents[_0x7d36('0x4')](_0x12d27e,_0x45a84a);};}exports[_0x7d36('0x5')]=function(_0x5c65e4){for(var _0x9bb5b6=0x0,_0x5846d2=events[_0x7d36('0x6')];_0x9bb5b6<_0x5846d2;_0x9bb5b6++){var _0x134e03=events[_0x9bb5b6];var _0x3fddb8=createListener(_0x7d36('0x7')+_0x134e03,_0x5c65e4);ChatInternalMessageEvents['on'](_0x134e03,_0x3fddb8);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index a935d24..6248450 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 _0xea68=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users','getUsers','show','post','put','/:id','update','delete','destroy','exports','express'];(function(_0x3e9cdf,_0x5abc82){var _0x24d051=function(_0x5e0a28){while(--_0x5e0a28){_0x3e9cdf['push'](_0x3e9cdf['shift']());}};_0x24d051(++_0x5abc82);}(_0xea68,0x77));var _0x8ea6=function(_0x4cc7d8,_0x1bf703){_0x4cc7d8=_0x4cc7d8-0x0;var _0x64abfa=_0xea68[_0x4cc7d8];return _0x64abfa;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8ea6('0x0'));var router=express[_0x8ea6('0x1')]();var auth=require(_0x8ea6('0x2'));var interaction=require(_0x8ea6('0x3'));var config=require(_0x8ea6('0x4'));var controller=require(_0x8ea6('0x5'));router[_0x8ea6('0x6')]('/',auth[_0x8ea6('0x7')](),controller[_0x8ea6('0x8')]);router[_0x8ea6('0x6')]('/describe',auth[_0x8ea6('0x7')](),controller[_0x8ea6('0x9')]);router[_0x8ea6('0x6')](_0x8ea6('0xa'),auth[_0x8ea6('0x7')](),controller[_0x8ea6('0xb')]);router[_0x8ea6('0x6')]('/:id',auth[_0x8ea6('0x7')](),controller[_0x8ea6('0xc')]);router[_0x8ea6('0xd')]('/',auth[_0x8ea6('0x7')](),controller['create']);router[_0x8ea6('0xe')](_0x8ea6('0xf'),controller[_0x8ea6('0x10')]);router[_0x8ea6('0x11')](_0x8ea6('0xf'),auth[_0x8ea6('0x7')](),controller[_0x8ea6('0x12')]);module[_0x8ea6('0x13')]=router; \ No newline at end of file +var _0xdec3=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','getUsers','/:id','post','put','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0xdec3,0x89));var _0x3dec=function(_0x44eef7,_0x32c464){_0x44eef7=_0x44eef7-0x0;var _0x526dfc=_0xdec3[_0x44eef7];return _0x526dfc;};'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('0xa')]('/users',auth[_0x3dec('0x8')](),controller[_0x3dec('0xd')]);router['get'](_0x3dec('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x3dec('0xf')]('/',auth[_0x3dec('0x8')](),controller['create']);router[_0x3dec('0x10')](_0x3dec('0xe'),controller['update']);router[_0x3dec('0x11')](_0x3dec('0xe'),auth[_0x3dec('0x8')](),controller[_0x3dec('0x12')]);module[_0x3dec('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 4121c6e..b47d581 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 _0xa8ed=['out','DATE','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x5e3aed,_0x598bc5){var _0x328bc6=function(_0x4669ed){while(--_0x4669ed){_0x5e3aed['push'](_0x5e3aed['shift']());}};_0x328bc6(++_0x598bc5);}(_0xa8ed,0x10c));var _0xda8e=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xa8ed[_0x55e08b];return _0xd1a7ff;};'use strict';var Sequelize=require(_0xda8e('0x0'));module[_0xda8e('0x1')]={'body':{'type':Sequelize[_0xda8e('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xda8e('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xda8e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xda8e('0x4')]('in',_0xda8e('0x5')),'defaultValue':_0xda8e('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xda8e('0x6')]}}; \ No newline at end of file +var _0xe7f4=['ENUM','out','sequelize','medium','BOOLEAN'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xe7f4,0x1b5));var _0x4e7f=function(_0x1d2bbb,_0x202267){_0x1d2bbb=_0x1d2bbb-0x0;var _0x38082b=_0xe7f4[_0x1d2bbb];return _0x38082b;};'use strict';var Sequelize=require(_0x4e7f('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x4e7f('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x4e7f('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4e7f('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4e7f('0x3')]('in','out'),'defaultValue':_0x4e7f('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 1dc255f..14591da 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 _0x5eb9=['limit','set','apply','reject','save','update','stack','send','index','ChatMessage','model','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','field','count','include','findAll','keys','rawAttributes','fields','includeAll','options','find','create','body','params','destroy','describe','chat-interactions','accept','chat','readAt','UserId','user','CmContact','Contact','ChatInteraction','ChatInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','AcceptMessage','acceptMessage','manual','format','SIP/%s','channel','EventManager','acceptmessage','parse','agent','RejectMessage','rejectMessage','event','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','test','request','then','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','ChatMessage,\x20%s,\x20%s','request\x20sent','catch','sendStatus','end','status','json','offset'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5eb9,0x13d));var _0x95eb=function(_0x25c988,_0xce8221){_0x25c988=_0x25c988-0x0;var _0x45fcc2=_0x5eb9[_0x25c988];return _0x45fcc2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x95eb('0x0'));var rimraf=require(_0x95eb('0x1'));var zipdir=require(_0x95eb('0x2'));var jsonpatch=require(_0x95eb('0x3'));var rp=require(_0x95eb('0x4'));var moment=require(_0x95eb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x95eb('0x6'));var util=require('util');var path=require(_0x95eb('0x7'));var sox=require(_0x95eb('0x8'));var csv=require('to-csv');var ejs=require(_0x95eb('0x9'));var fs=require('fs');var _=require(_0x95eb('0xa'));var squel=require('squel');var crypto=require(_0x95eb('0xb'));var jsforce=require(_0x95eb('0xc'));var deskjs=require(_0x95eb('0xd'));var toCsv=require('to-csv');var querystring=require(_0x95eb('0xe'));var Papa=require(_0x95eb('0xf'));var Redis=require(_0x95eb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x95eb('0x11'));var hardwareService=require(_0x95eb('0x12'));var logger=require(_0x95eb('0x13'))(_0x95eb('0x14'));var utils=require(_0x95eb('0x15'));var config=require(_0x95eb('0x16'));var db=require(_0x95eb('0x17'))['db'];config[_0x95eb('0x18')]=_[_0x95eb('0x19')](config[_0x95eb('0x18')],{'host':_0x95eb('0x1a'),'port':0x18eb});var socket=require(_0x95eb('0x1b'))(new Redis(config['redis']));require(_0x95eb('0x1c'))['register'](socket);var jayson=require(_0x95eb('0x1d'));var client=jayson[_0x95eb('0x1e')][_0x95eb('0x1f')]({'port':0x232c});var client9002=jayson[_0x95eb('0x1e')][_0x95eb('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x3493b7,_0x365964,_0x51734b){if(_0x51734b){var _0xc4823c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xc4823c[_0x95eb('0x20')](_0x365964)){return _0x3493b7;}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 _0x3493b7;}}function respondWithRpcPromise(_0x586515,_0x5bf13b,_0x42985f,_0x28683c){return new BPromise(function(_0xcbbe5f,_0x3d72ee){var _0x2e8fb9=_0x28683c||client;return _0x2e8fb9[_0x95eb('0x21')](_0x586515,_0x42985f)[_0x95eb('0x22')](function(_0x4893fb){logger[_0x95eb('0x23')]('ChatMessage,\x20%s,\x20%s',_0x5bf13b,'request\x20sent');logger[_0x95eb('0x24')](_0x95eb('0x25'),_0x5bf13b,'request\x20sent',JSON['stringify'](_0x4893fb));if(_0x4893fb[_0x95eb('0x26')]){if(_0x4893fb[_0x95eb('0x26')][_0x95eb('0x27')]===0x1f4){logger[_0x95eb('0x26')]('ChatMessage,\x20%s,\x20%s',_0x5bf13b,_0x4893fb[_0x95eb('0x26')][_0x95eb('0x28')]);return _0x3d72ee(_0x4893fb[_0x95eb('0x26')][_0x95eb('0x28')]);}logger[_0x95eb('0x26')](_0x95eb('0x29'),_0x5bf13b,_0x4893fb[_0x95eb('0x26')][_0x95eb('0x28')]);return _0xcbbe5f(_0x4893fb[_0x95eb('0x26')][_0x95eb('0x28')]);}else{logger[_0x95eb('0x23')](_0x95eb('0x29'),_0x5bf13b,_0x95eb('0x2a'));_0xcbbe5f(_0x4893fb['result'][_0x95eb('0x28')]);}})[_0x95eb('0x2b')](function(_0x37a520){logger[_0x95eb('0x26')](_0x95eb('0x29'),_0x5bf13b,_0x37a520);_0x3d72ee(_0x37a520);});});}function respondWithStatusCode(_0x2d0079,_0x7ce969){_0x7ce969=_0x7ce969||0xcc;return function(_0xbd2909){if(_0xbd2909){return _0x2d0079[_0x95eb('0x2c')](_0x7ce969);}return _0x2d0079['status'](_0x7ce969)[_0x95eb('0x2d')]();};}function respondWithResult(_0x27d851,_0x2e3b54){_0x2e3b54=_0x2e3b54||0xc8;return function(_0x4e8990){if(_0x4e8990){return _0x27d851[_0x95eb('0x2e')](_0x2e3b54)[_0x95eb('0x2f')](_0x4e8990);}};}function respondWithFilteredResult(_0x1483c1,_0x160cbb){return function(_0x2e5e3e){if(_0x2e5e3e){var _0x5537a7=_0x2e5e3e['count'],_0x5a1f53=_0x160cbb[_0x95eb('0x30')],_0x40adcf=_0x160cbb[_0x95eb('0x30')]+_0x160cbb[_0x95eb('0x31')],_0x4304e0;if(_0x40adcf>=_0x5537a7){_0x40adcf=_0x5537a7;_0x4304e0=0xc8;}else{_0x4304e0=0xce;}_0x1483c1['status'](_0x4304e0);return _0x1483c1[_0x95eb('0x32')]('Content-Range',_0x5a1f53+'-'+_0x40adcf+'/'+_0x5537a7)[_0x95eb('0x2f')](_0x2e5e3e);}return null;};}function patchUpdates(_0x55c3d1){return function(_0x36e5cb){try{jsonpatch[_0x95eb('0x33')](_0x36e5cb,_0x55c3d1,!![]);}catch(_0x5808c5){return BPromise[_0x95eb('0x34')](_0x5808c5);}return _0x36e5cb[_0x95eb('0x35')]();};}function saveUpdates(_0x35a6f8,_0x397384){return function(_0x11a55f){if(_0x11a55f){return _0x11a55f[_0x95eb('0x36')](_0x35a6f8)['then'](function(_0xfe86ee){return _0xfe86ee;});}return null;};}function removeEntity(_0x314e08,_0x2ba841){return function(_0x45eadc){if(_0x45eadc){return _0x45eadc['destroy']()['then'](function(){_0x314e08[_0x95eb('0x2e')](0xcc)[_0x95eb('0x2d')]();});}};}function handleEntityNotFound(_0x4f640b,_0xe04b19){return function(_0x295f7d){if(!_0x295f7d){_0x4f640b[_0x95eb('0x2c')](0x194);}return _0x295f7d;};}function handleError(_0x26d063,_0x292a11){_0x292a11=_0x292a11||0x1f4;return function(_0x3c1bed){logger[_0x95eb('0x26')](_0x3c1bed[_0x95eb('0x37')]);if(_0x3c1bed['name']){delete _0x3c1bed['name'];}_0x26d063['status'](_0x292a11)[_0x95eb('0x38')](_0x3c1bed);};}exports[_0x95eb('0x39')]=function(_0x56b7a5,_0x43590e){var _0x20fb6d={},_0x224f73={},_0x52a7e9={'count':0x0,'rows':[]};var _0x5a5619=db[_0x95eb('0x3a')]['rawAttributes'];_0x224f73[_0x95eb('0x3b')]=_['keys'](_0x5a5619);_0x224f73[_0x95eb('0x3c')]=_['keys'](_0x56b7a5[_0x95eb('0x3c')]);_0x224f73['filters']=_[_0x95eb('0x3d')](_0x224f73[_0x95eb('0x3b')],_0x224f73[_0x95eb('0x3c')]);_0x20fb6d[_0x95eb('0x3e')]=_['intersection'](_0x224f73['model'],qs['fields'](_0x56b7a5[_0x95eb('0x3c')]['fields']));_0x20fb6d[_0x95eb('0x3e')]=_0x20fb6d['attributes'][_0x95eb('0x3f')]?_0x20fb6d[_0x95eb('0x3e')]:_0x224f73[_0x95eb('0x3b')];if(!_0x56b7a5[_0x95eb('0x3c')][_0x95eb('0x40')]('nolimit')){_0x20fb6d['limit']=qs[_0x95eb('0x31')](_0x56b7a5[_0x95eb('0x3c')][_0x95eb('0x31')]);_0x20fb6d[_0x95eb('0x30')]=qs[_0x95eb('0x30')](_0x56b7a5['query'][_0x95eb('0x30')]);}_0x20fb6d[_0x95eb('0x41')]=qs[_0x95eb('0x42')](_0x56b7a5[_0x95eb('0x3c')][_0x95eb('0x42')]);_0x20fb6d[_0x95eb('0x43')]=qs[_0x95eb('0x44')](_[_0x95eb('0x45')](_0x56b7a5[_0x95eb('0x3c')],_0x224f73['filters']));if(_0x56b7a5[_0x95eb('0x3c')][_0x95eb('0x46')]){_0x20fb6d[_0x95eb('0x43')]=_[_0x95eb('0x47')](_0x20fb6d[_0x95eb('0x43')],{'$or':_['map'](_0x5a5619,function(_0x5a2462){if(_0x5a2462[_0x95eb('0x48')][_0x95eb('0x49')]!==_0x95eb('0x4a')){var _0x5439dc={};_0x5439dc[_0x5a2462[_0x95eb('0x4b')]]={'$like':'%'+_0x56b7a5[_0x95eb('0x3c')][_0x95eb('0x46')]+'%'};return _0x5439dc;}})});}_0x20fb6d=_[_0x95eb('0x47')]({},_0x20fb6d,_0x56b7a5['options']);var _0x2795b4={'where':_0x20fb6d[_0x95eb('0x43')]};return db[_0x95eb('0x3a')][_0x95eb('0x4c')](_0x2795b4)[_0x95eb('0x22')](function(_0xd04845){_0x52a7e9[_0x95eb('0x4c')]=_0xd04845;if(_0x56b7a5[_0x95eb('0x3c')]['includeAll']){_0x20fb6d[_0x95eb('0x4d')]=[{'all':!![]}];}return db[_0x95eb('0x3a')][_0x95eb('0x4e')](_0x20fb6d);})['then'](function(_0x2e6220){_0x52a7e9['rows']=_0x2e6220;return _0x52a7e9;})[_0x95eb('0x22')](respondWithFilteredResult(_0x43590e,_0x20fb6d))[_0x95eb('0x2b')](handleError(_0x43590e,null));};exports['show']=function(_0x54aeee,_0x334668){var _0x1dc714={'raw':!![],'where':{'id':_0x54aeee['params']['id']}},_0x8fc84e={};_0x8fc84e[_0x95eb('0x3b')]=_[_0x95eb('0x4f')](db[_0x95eb('0x3a')][_0x95eb('0x50')]);_0x8fc84e[_0x95eb('0x3c')]=_['keys'](_0x54aeee[_0x95eb('0x3c')]);_0x8fc84e['filters']=_[_0x95eb('0x3d')](_0x8fc84e['model'],_0x8fc84e[_0x95eb('0x3c')]);_0x1dc714['attributes']=_[_0x95eb('0x3d')](_0x8fc84e[_0x95eb('0x3b')],qs['fields'](_0x54aeee[_0x95eb('0x3c')][_0x95eb('0x51')]));_0x1dc714[_0x95eb('0x3e')]=_0x1dc714['attributes'][_0x95eb('0x3f')]?_0x1dc714[_0x95eb('0x3e')]:_0x8fc84e[_0x95eb('0x3b')];if(_0x54aeee['query'][_0x95eb('0x52')]){_0x1dc714['include']=[{'all':!![]}];}_0x1dc714=_['merge']({},_0x1dc714,_0x54aeee[_0x95eb('0x53')]);return db[_0x95eb('0x3a')][_0x95eb('0x54')](_0x1dc714)[_0x95eb('0x22')](handleEntityNotFound(_0x334668,null))[_0x95eb('0x22')](respondWithResult(_0x334668,null))[_0x95eb('0x2b')](handleError(_0x334668,null));};exports['create']=function(_0x5f02a0,_0x30580c){return db[_0x95eb('0x3a')][_0x95eb('0x55')](_0x5f02a0['body'],{})[_0x95eb('0x22')](respondWithResult(_0x30580c,0xc9))[_0x95eb('0x2b')](handleError(_0x30580c,null));};exports[_0x95eb('0x36')]=function(_0x58dbc7,_0x3b2dbf){if(_0x58dbc7[_0x95eb('0x56')]['id']){delete _0x58dbc7[_0x95eb('0x56')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x58dbc7[_0x95eb('0x57')]['id']}})['then'](handleEntityNotFound(_0x3b2dbf,null))[_0x95eb('0x22')](saveUpdates(_0x58dbc7[_0x95eb('0x56')],null))[_0x95eb('0x22')](respondWithResult(_0x3b2dbf,null))['catch'](handleError(_0x3b2dbf,null));};exports[_0x95eb('0x58')]=function(_0x39f99c,_0x5d2473){return db[_0x95eb('0x3a')]['find']({'where':{'id':_0x39f99c[_0x95eb('0x57')]['id']}})['then'](handleEntityNotFound(_0x5d2473,null))[_0x95eb('0x22')](removeEntity(_0x5d2473,null))['catch'](handleError(_0x5d2473,null));};exports[_0x95eb('0x59')]=function(_0x4afb4f,_0x3f9ed4){return db['ChatMessage']['describe']()['then'](respondWithResult(_0x3f9ed4,null))['catch'](handleError(_0x3f9ed4,null));};var interaction_log=require(_0x95eb('0x13'))(_0x95eb('0x5a'));exports[_0x95eb('0x5b')]=function(_0x1962af,_0x1fef77,_0x23be9c){var _0x42123f={'channel':_0x95eb('0x5c')};if(_0x1962af[_0x95eb('0x56')]['id']){delete _0x1962af['body']['id'];}_0x1962af['body']['read']=!![];_0x1962af['body'][_0x95eb('0x5d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1962af[_0x95eb('0x56')][_0x95eb('0x5e')]=_0x1962af[_0x95eb('0x56')][_0x95eb('0x5e')]||_0x1962af[_0x95eb('0x5f')]['id'];return db[_0x95eb('0x3a')]['find']({'where':{'id':_0x1962af['params']['id'],'UserId':null},'include':[{'model':db[_0x95eb('0x60')],'as':_0x95eb('0x61')}]})['then'](handleEntityNotFound(_0x1fef77,null))[_0x95eb('0x22')](saveUpdates(_0x1962af[_0x95eb('0x56')],null))[_0x95eb('0x22')](function(_0x236ea5){if(_0x236ea5){_0x42123f[_0x95eb('0x28')]=_0x236ea5['get']({'plain':!![]});return db[_0x95eb('0x62')][_0x95eb('0x54')]({'where':{'id':_0x236ea5[_0x95eb('0x63')]}});}return null;})[_0x95eb('0x22')](handleEntityNotFound(_0x1fef77,null))['then'](function(_0x37f9e5){if(_0x37f9e5){return _0x37f9e5[_0x95eb('0x36')]({'UserId':_0x1962af[_0x95eb('0x56')][_0x95eb('0x5e')],'read1stAt':_[_0x95eb('0x64')](_0x37f9e5['read1stAt'])?moment()['format'](_0x95eb('0x65')):undefined});}return null;})[_0x95eb('0x22')](function(_0x415c9f){if(_0x415c9f){_0x42123f[_0x95eb('0x66')]=_0x415c9f[_0x95eb('0x67')]({'plain':!![]});interaction_log[_0x95eb('0x23')](_0x95eb('0x68'),_0x1962af[_0x95eb('0x5f')]['id'],_0x1962af[_0x95eb('0x5f')][_0x95eb('0x69')],_0x1962af[_0x95eb('0x5f')][_0x95eb('0x6a')],_0x42123f['interaction']['id'],_0x1962af[_0x95eb('0x56')]?JSON[_0x95eb('0x6b')](_0x1962af[_0x95eb('0x56')]):_0x95eb('0x6c'));return respondWithRpcPromise(_0x95eb('0x6d'),_0x95eb('0x6e'),_0x42123f);}return null;})[_0x95eb('0x22')](function(_0x369d68){if(_0x369d68){if(_0x1962af[_0x95eb('0x56')][_0x95eb('0x6f')]){_0x42123f[_0x95eb('0x28')]['interface']=util[_0x95eb('0x70')](_0x95eb('0x71'),_0x1962af['user'][_0x95eb('0x69')]);_0x42123f[_0x95eb('0x28')][_0x95eb('0x72')]=_0x42123f['channel'];_0x42123f[_0x95eb('0x28')]['event']=_0x95eb('0x5b');return respondWithRpcPromise(_0x95eb('0x73'),_0x95eb('0x73'),{'event':_0x95eb('0x74'),'message':_[_0x95eb('0x47')](_0x42123f['message'],JSON[_0x95eb('0x75')](_0x42123f[_0x95eb('0x66')]['formData']))},client9002)['then'](function(){return _0x42123f;});}return _0x42123f;}return null;})[_0x95eb('0x22')](respondWithResult(_0x1fef77,null))[_0x95eb('0x2b')](handleError(_0x1fef77,null));};var interaction_log=require(_0x95eb('0x13'))(_0x95eb('0x5a'));exports['reject']=function(_0x29f0d1,_0x5b272f,_0x1ef6d4){var _0x277749={'agent':{},'channel':'chat'};if(_0x29f0d1[_0x95eb('0x56')]['id']){delete _0x29f0d1[_0x95eb('0x56')]['id'];}_0x29f0d1['body'][_0x95eb('0x5e')]=_0x29f0d1['body'][_0x95eb('0x5e')]||_0x29f0d1[_0x95eb('0x5f')]['id'];_0x277749[_0x95eb('0x76')]['id']=_0x29f0d1[_0x95eb('0x56')][_0x95eb('0x5e')];return db[_0x95eb('0x3a')][_0x95eb('0x54')]({'where':{'id':_0x29f0d1[_0x95eb('0x57')]['id'],'UserId':null}})[_0x95eb('0x22')](handleEntityNotFound(_0x5b272f,null))[_0x95eb('0x22')](function(_0xc2d19b){if(_0xc2d19b){_0x277749['message']=_0xc2d19b[_0x95eb('0x67')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0xc2d19b[_0x95eb('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x5b272f,null))['then'](function(_0x1fcb04){if(_0x1fcb04){_0x277749[_0x95eb('0x66')]=_0x1fcb04['get']({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x29f0d1[_0x95eb('0x5f')]['id'],_0x29f0d1['user'][_0x95eb('0x69')],_0x29f0d1[_0x95eb('0x5f')][_0x95eb('0x6a')],_0x277749[_0x95eb('0x66')]['id'],_0x29f0d1[_0x95eb('0x56')]?JSON[_0x95eb('0x6b')](_0x29f0d1[_0x95eb('0x56')]):_0x95eb('0x6c'));return respondWithRpcPromise(_0x95eb('0x77'),_0x95eb('0x78'),_0x277749);}return null;})[_0x95eb('0x22')](function(_0x42acf2){if(_0x42acf2){_0x42acf2[_0x95eb('0x28')]['interface']=util[_0x95eb('0x70')]('SIP/%s',_0x29f0d1[_0x95eb('0x5f')][_0x95eb('0x69')]);_0x42acf2[_0x95eb('0x28')][_0x95eb('0x72')]=_0x277749[_0x95eb('0x72')];_0x42acf2['message'][_0x95eb('0x79')]=_0x95eb('0x34');respondWithRpcPromise(_0x95eb('0x73'),_0x95eb('0x73'),{'event':'rejectmessage','message':_0x42acf2[_0x95eb('0x28')]},client9002);return _0x277749;}return null;})['then'](respondWithResult(_0x5b272f,null))[_0x95eb('0x2b')](handleError(_0x5b272f,null));}; \ No newline at end of file +var _0x4452=['client','http','test','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','ChatMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','send','index','ChatMessage','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','VIRTUAL','field','filter','options','includeAll','include','findAll','show','params','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','ChatInteraction','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','SIP/%s','channel','event','EventManager','formData','agent','get','rejectMessage','interface','rejectmessage','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','jayson/promise'];(function(_0x28edda,_0xbd447a){var _0x21f4a4=function(_0x5ae05e){while(--_0x5ae05e){_0x28edda['push'](_0x28edda['shift']());}};_0x21f4a4(++_0xbd447a);}(_0x4452,0x14a));var _0x2445=function(_0x5e0817,_0x1b6393){_0x5e0817=_0x5e0817-0x0;var _0x35e7a9=_0x4452[_0x5e0817];return _0x35e7a9;};'use strict';var pdf=require(_0x2445('0x0'));var emlformat=require(_0x2445('0x1'));var rimraf=require(_0x2445('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2445('0x3'));var moment=require(_0x2445('0x4'));var BPromise=require(_0x2445('0x5'));var Mustache=require(_0x2445('0x6'));var util=require(_0x2445('0x7'));var path=require(_0x2445('0x8'));var sox=require(_0x2445('0x9'));var csv=require(_0x2445('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2445('0xb'));var crypto=require(_0x2445('0xc'));var jsforce=require(_0x2445('0xd'));var deskjs=require(_0x2445('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2445('0xf'));var Papa=require('papaparse');var Redis=require(_0x2445('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2445('0x11'));var hardwareService=require(_0x2445('0x12'));var logger=require(_0x2445('0x13'))(_0x2445('0x14'));var utils=require(_0x2445('0x15'));var config=require(_0x2445('0x16'));var db=require('../../mysqldb')['db'];config[_0x2445('0x17')]=_[_0x2445('0x18')](config[_0x2445('0x17')],{'host':_0x2445('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')['register'](socket);var jayson=require(_0x2445('0x1a'));var client=jayson[_0x2445('0x1b')][_0x2445('0x1c')]({'port':0x232c});var client9002=jayson[_0x2445('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x2328f6,_0x1f42b8,_0x2d589d){if(_0x2d589d){var _0x2c9a33=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c9a33[_0x2445('0x1d')](_0x1f42b8)){return _0x2328f6;}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 _0x2328f6;}}function respondWithRpcPromise(_0x42d0d9,_0x185a07,_0xd64fb4,_0x212812){return new BPromise(function(_0x588b1c,_0xd0f3d9){var _0x25e3d4=_0x212812||client;return _0x25e3d4[_0x2445('0x1e')](_0x42d0d9,_0xd64fb4)[_0x2445('0x1f')](function(_0x29b718){logger[_0x2445('0x20')]('ChatMessage,\x20%s,\x20%s',_0x185a07,_0x2445('0x21'));logger[_0x2445('0x22')](_0x2445('0x23'),_0x185a07,_0x2445('0x21'),JSON['stringify'](_0x29b718));if(_0x29b718[_0x2445('0x24')]){if(_0x29b718[_0x2445('0x24')][_0x2445('0x25')]===0x1f4){logger[_0x2445('0x24')]('ChatMessage,\x20%s,\x20%s',_0x185a07,_0x29b718[_0x2445('0x24')][_0x2445('0x26')]);return _0xd0f3d9(_0x29b718[_0x2445('0x24')][_0x2445('0x26')]);}logger[_0x2445('0x24')]('ChatMessage,\x20%s,\x20%s',_0x185a07,_0x29b718[_0x2445('0x24')][_0x2445('0x26')]);return _0x588b1c(_0x29b718[_0x2445('0x24')][_0x2445('0x26')]);}else{logger[_0x2445('0x20')](_0x2445('0x27'),_0x185a07,_0x2445('0x21'));_0x588b1c(_0x29b718[_0x2445('0x28')][_0x2445('0x26')]);}})[_0x2445('0x29')](function(_0x1d162b){logger[_0x2445('0x24')](_0x2445('0x27'),_0x185a07,_0x1d162b);_0xd0f3d9(_0x1d162b);});});}function respondWithStatusCode(_0x10a4fa,_0x1ca356){_0x1ca356=_0x1ca356||0xcc;return function(_0x53aab5){if(_0x53aab5){return _0x10a4fa[_0x2445('0x2a')](_0x1ca356);}return _0x10a4fa[_0x2445('0x2b')](_0x1ca356)[_0x2445('0x2c')]();};}function respondWithResult(_0x5199db,_0xb56329){_0xb56329=_0xb56329||0xc8;return function(_0x3021ff){if(_0x3021ff){return _0x5199db['status'](_0xb56329)[_0x2445('0x2d')](_0x3021ff);}};}function respondWithFilteredResult(_0x49c692,_0x365f79){return function(_0x8ff00){if(_0x8ff00){var _0x521f79=_0x8ff00[_0x2445('0x2e')],_0x2e9d79=_0x365f79[_0x2445('0x2f')],_0xde6049=_0x365f79[_0x2445('0x2f')]+_0x365f79[_0x2445('0x30')],_0xa61a66;if(_0xde6049>=_0x521f79){_0xde6049=_0x521f79;_0xa61a66=0xc8;}else{_0xa61a66=0xce;}_0x49c692['status'](_0xa61a66);return _0x49c692[_0x2445('0x31')](_0x2445('0x32'),_0x2e9d79+'-'+_0xde6049+'/'+_0x521f79)[_0x2445('0x2d')](_0x8ff00);}return null;};}function patchUpdates(_0x366a98){return function(_0x53297c){try{jsonpatch[_0x2445('0x33')](_0x53297c,_0x366a98,!![]);}catch(_0x37462f){return BPromise[_0x2445('0x34')](_0x37462f);}return _0x53297c[_0x2445('0x35')]();};}function saveUpdates(_0x2a94e8,_0x4c9d3e){return function(_0x47a481){if(_0x47a481){return _0x47a481[_0x2445('0x36')](_0x2a94e8)[_0x2445('0x1f')](function(_0x423998){return _0x423998;});}return null;};}function removeEntity(_0x2eda48,_0x10cdfc){return function(_0x32d83b){if(_0x32d83b){return _0x32d83b['destroy']()[_0x2445('0x1f')](function(){_0x2eda48[_0x2445('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11b262,_0x1a2ff2){return function(_0x286d83){if(!_0x286d83){_0x11b262[_0x2445('0x2a')](0x194);}return _0x286d83;};}function handleError(_0x3f4323,_0x284ba6){_0x284ba6=_0x284ba6||0x1f4;return function(_0x32fb40){logger[_0x2445('0x24')](_0x32fb40[_0x2445('0x37')]);if(_0x32fb40[_0x2445('0x38')]){delete _0x32fb40['name'];}_0x3f4323['status'](_0x284ba6)[_0x2445('0x39')](_0x32fb40);};}exports[_0x2445('0x3a')]=function(_0x16d029,_0x242114){var _0x419812={},_0xb165d3={},_0x54c01f={'count':0x0,'rows':[]};var _0x20f81e=db[_0x2445('0x3b')][_0x2445('0x3c')];_0xb165d3[_0x2445('0x3d')]=_['keys'](_0x20f81e);_0xb165d3[_0x2445('0x3e')]=_[_0x2445('0x3f')](_0x16d029[_0x2445('0x3e')]);_0xb165d3[_0x2445('0x40')]=_['intersection'](_0xb165d3[_0x2445('0x3d')],_0xb165d3[_0x2445('0x3e')]);_0x419812[_0x2445('0x41')]=_[_0x2445('0x42')](_0xb165d3['model'],qs[_0x2445('0x43')](_0x16d029[_0x2445('0x3e')][_0x2445('0x43')]));_0x419812[_0x2445('0x41')]=_0x419812['attributes'][_0x2445('0x44')]?_0x419812[_0x2445('0x41')]:_0xb165d3[_0x2445('0x3d')];if(!_0x16d029[_0x2445('0x3e')][_0x2445('0x45')]('nolimit')){_0x419812[_0x2445('0x30')]=qs['limit'](_0x16d029[_0x2445('0x3e')][_0x2445('0x30')]);_0x419812[_0x2445('0x2f')]=qs[_0x2445('0x2f')](_0x16d029['query'][_0x2445('0x2f')]);}_0x419812[_0x2445('0x46')]=qs['sort'](_0x16d029[_0x2445('0x3e')][_0x2445('0x47')]);_0x419812[_0x2445('0x48')]=qs['filters'](_[_0x2445('0x49')](_0x16d029[_0x2445('0x3e')],_0xb165d3[_0x2445('0x40')]));if(_0x16d029[_0x2445('0x3e')]['filter']){_0x419812[_0x2445('0x48')]=_[_0x2445('0x4a')](_0x419812[_0x2445('0x48')],{'$or':_[_0x2445('0x4b')](_0x20f81e,function(_0x6a61e9){if(_0x6a61e9['type']['key']!==_0x2445('0x4c')){var _0x9f8647={};_0x9f8647[_0x6a61e9[_0x2445('0x4d')]]={'$like':'%'+_0x16d029[_0x2445('0x3e')][_0x2445('0x4e')]+'%'};return _0x9f8647;}})});}_0x419812=_[_0x2445('0x4a')]({},_0x419812,_0x16d029[_0x2445('0x4f')]);var _0x12e4c2={'where':_0x419812[_0x2445('0x48')]};return db[_0x2445('0x3b')][_0x2445('0x2e')](_0x12e4c2)[_0x2445('0x1f')](function(_0x6f53c0){_0x54c01f[_0x2445('0x2e')]=_0x6f53c0;if(_0x16d029[_0x2445('0x3e')][_0x2445('0x50')]){_0x419812[_0x2445('0x51')]=[{'all':!![]}];}return db[_0x2445('0x3b')][_0x2445('0x52')](_0x419812);})['then'](function(_0x4be37c){_0x54c01f['rows']=_0x4be37c;return _0x54c01f;})[_0x2445('0x1f')](respondWithFilteredResult(_0x242114,_0x419812))['catch'](handleError(_0x242114,null));};exports[_0x2445('0x53')]=function(_0x5b6564,_0x43ac3b){var _0x86fb94={'raw':!![],'where':{'id':_0x5b6564[_0x2445('0x54')]['id']}},_0xd55008={};_0xd55008[_0x2445('0x3d')]=_[_0x2445('0x3f')](db[_0x2445('0x3b')][_0x2445('0x3c')]);_0xd55008['query']=_['keys'](_0x5b6564[_0x2445('0x3e')]);_0xd55008[_0x2445('0x40')]=_[_0x2445('0x42')](_0xd55008['model'],_0xd55008[_0x2445('0x3e')]);_0x86fb94[_0x2445('0x41')]=_[_0x2445('0x42')](_0xd55008[_0x2445('0x3d')],qs[_0x2445('0x43')](_0x5b6564[_0x2445('0x3e')]['fields']));_0x86fb94[_0x2445('0x41')]=_0x86fb94[_0x2445('0x41')][_0x2445('0x44')]?_0x86fb94[_0x2445('0x41')]:_0xd55008[_0x2445('0x3d')];if(_0x5b6564['query']['includeAll']){_0x86fb94[_0x2445('0x51')]=[{'all':!![]}];}_0x86fb94=_[_0x2445('0x4a')]({},_0x86fb94,_0x5b6564[_0x2445('0x4f')]);return db[_0x2445('0x3b')][_0x2445('0x55')](_0x86fb94)[_0x2445('0x1f')](handleEntityNotFound(_0x43ac3b,null))[_0x2445('0x1f')](respondWithResult(_0x43ac3b,null))[_0x2445('0x29')](handleError(_0x43ac3b,null));};exports['create']=function(_0x4e8df1,_0x521c24){return db[_0x2445('0x3b')][_0x2445('0x56')](_0x4e8df1[_0x2445('0x57')],{})[_0x2445('0x1f')](respondWithResult(_0x521c24,0xc9))['catch'](handleError(_0x521c24,null));};exports[_0x2445('0x36')]=function(_0x293da7,_0x3b896c){if(_0x293da7[_0x2445('0x57')]['id']){delete _0x293da7[_0x2445('0x57')]['id'];}return db[_0x2445('0x3b')]['find']({'where':{'id':_0x293da7[_0x2445('0x54')]['id']}})[_0x2445('0x1f')](handleEntityNotFound(_0x3b896c,null))[_0x2445('0x1f')](saveUpdates(_0x293da7[_0x2445('0x57')],null))[_0x2445('0x1f')](respondWithResult(_0x3b896c,null))['catch'](handleError(_0x3b896c,null));};exports['destroy']=function(_0x31762b,_0x248c29){return db[_0x2445('0x3b')][_0x2445('0x55')]({'where':{'id':_0x31762b[_0x2445('0x54')]['id']}})[_0x2445('0x1f')](handleEntityNotFound(_0x248c29,null))['then'](removeEntity(_0x248c29,null))[_0x2445('0x29')](handleError(_0x248c29,null));};exports[_0x2445('0x58')]=function(_0x4b9953,_0x3d98e7){return db['ChatMessage'][_0x2445('0x58')]()[_0x2445('0x1f')](respondWithResult(_0x3d98e7,null))['catch'](handleError(_0x3d98e7,null));};var interaction_log=require(_0x2445('0x13'))(_0x2445('0x59'));exports[_0x2445('0x5a')]=function(_0x36f89d,_0x17eacf,_0x3236a4){var _0x3163da={'channel':_0x2445('0x5b')};if(_0x36f89d[_0x2445('0x57')]['id']){delete _0x36f89d[_0x2445('0x57')]['id'];}_0x36f89d['body'][_0x2445('0x5c')]=!![];_0x36f89d[_0x2445('0x57')][_0x2445('0x5d')]=moment()[_0x2445('0x5e')](_0x2445('0x5f'));_0x36f89d[_0x2445('0x57')][_0x2445('0x60')]=_0x36f89d[_0x2445('0x57')][_0x2445('0x60')]||_0x36f89d['user']['id'];return db['ChatMessage'][_0x2445('0x55')]({'where':{'id':_0x36f89d[_0x2445('0x54')]['id'],'UserId':null},'include':[{'model':db[_0x2445('0x61')],'as':_0x2445('0x62')}]})[_0x2445('0x1f')](handleEntityNotFound(_0x17eacf,null))[_0x2445('0x1f')](saveUpdates(_0x36f89d[_0x2445('0x57')],null))['then'](function(_0x14b3a7){if(_0x14b3a7){_0x3163da[_0x2445('0x26')]=_0x14b3a7['get']({'plain':!![]});return db[_0x2445('0x63')][_0x2445('0x55')]({'where':{'id':_0x14b3a7[_0x2445('0x64')]}});}return null;})[_0x2445('0x1f')](handleEntityNotFound(_0x17eacf,null))['then'](function(_0x3a516e){if(_0x3a516e){return _0x3a516e[_0x2445('0x36')]({'UserId':_0x36f89d[_0x2445('0x57')]['UserId'],'read1stAt':_[_0x2445('0x65')](_0x3a516e['read1stAt'])?moment()['format'](_0x2445('0x5f')):undefined});}return null;})['then'](function(_0x199e8a){if(_0x199e8a){_0x3163da[_0x2445('0x66')]=_0x199e8a['get']({'plain':!![]});interaction_log[_0x2445('0x20')](_0x2445('0x67'),_0x36f89d[_0x2445('0x68')]['id'],_0x36f89d['user'][_0x2445('0x38')],_0x36f89d[_0x2445('0x68')][_0x2445('0x69')],_0x3163da[_0x2445('0x66')]['id'],_0x36f89d[_0x2445('0x57')]?JSON[_0x2445('0x6a')](_0x36f89d[_0x2445('0x57')]):_0x2445('0x6b'));return respondWithRpcPromise(_0x2445('0x6c'),'acceptMessage',_0x3163da);}return null;})[_0x2445('0x1f')](function(_0x59754a){if(_0x59754a){if(_0x36f89d[_0x2445('0x57')]['manual']){_0x3163da[_0x2445('0x26')]['interface']=util[_0x2445('0x5e')](_0x2445('0x6d'),_0x36f89d[_0x2445('0x68')][_0x2445('0x38')]);_0x3163da[_0x2445('0x26')][_0x2445('0x6e')]=_0x3163da[_0x2445('0x6e')];_0x3163da['message'][_0x2445('0x6f')]='accept';return respondWithRpcPromise('EventManager',_0x2445('0x70'),{'event':'acceptmessage','message':_[_0x2445('0x4a')](_0x3163da[_0x2445('0x26')],JSON['parse'](_0x3163da[_0x2445('0x66')][_0x2445('0x71')]))},client9002)[_0x2445('0x1f')](function(){return _0x3163da;});}return _0x3163da;}return null;})[_0x2445('0x1f')](respondWithResult(_0x17eacf,null))[_0x2445('0x29')](handleError(_0x17eacf,null));};var interaction_log=require(_0x2445('0x13'))('chat-interactions');exports[_0x2445('0x34')]=function(_0x114fee,_0x998810,_0x354f95){var _0x129390={'agent':{},'channel':_0x2445('0x5b')};if(_0x114fee[_0x2445('0x57')]['id']){delete _0x114fee[_0x2445('0x57')]['id'];}_0x114fee[_0x2445('0x57')][_0x2445('0x60')]=_0x114fee[_0x2445('0x57')]['UserId']||_0x114fee[_0x2445('0x68')]['id'];_0x129390[_0x2445('0x72')]['id']=_0x114fee[_0x2445('0x57')]['UserId'];return db['ChatMessage'][_0x2445('0x55')]({'where':{'id':_0x114fee[_0x2445('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x998810,null))[_0x2445('0x1f')](function(_0x522ca9){if(_0x522ca9){_0x129390['message']=_0x522ca9['get']({'plain':!![]});return db['ChatInteraction'][_0x2445('0x55')]({'where':{'id':_0x522ca9[_0x2445('0x64')]}});}return null;})[_0x2445('0x1f')](handleEntityNotFound(_0x998810,null))['then'](function(_0x1d2479){if(_0x1d2479){_0x129390[_0x2445('0x66')]=_0x1d2479[_0x2445('0x73')]({'plain':!![]});interaction_log[_0x2445('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x114fee[_0x2445('0x68')]['id'],_0x114fee[_0x2445('0x68')][_0x2445('0x38')],_0x114fee['user']['role'],_0x129390[_0x2445('0x66')]['id'],_0x114fee[_0x2445('0x57')]?JSON[_0x2445('0x6a')](_0x114fee[_0x2445('0x57')]):_0x2445('0x6b'));return respondWithRpcPromise('RejectMessage',_0x2445('0x74'),_0x129390);}return null;})[_0x2445('0x1f')](function(_0x50559b){if(_0x50559b){_0x50559b[_0x2445('0x26')][_0x2445('0x75')]=util[_0x2445('0x5e')](_0x2445('0x6d'),_0x114fee[_0x2445('0x68')][_0x2445('0x38')]);_0x50559b['message'][_0x2445('0x6e')]=_0x129390['channel'];_0x50559b[_0x2445('0x26')][_0x2445('0x6f')]=_0x2445('0x34');respondWithRpcPromise('EventManager',_0x2445('0x70'),{'event':_0x2445('0x76'),'message':_0x50559b[_0x2445('0x26')]},client9002);return _0x129390;}return null;})[_0x2445('0x1f')](respondWithResult(_0x998810,null))[_0x2445('0x29')](handleError(_0x998810,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 4d3a3fb..bd0b487 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 _0xea5b=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','update'];(function(_0x82882b,_0x8a5ef8){var _0x3ef7d9=function(_0x43bfd7){while(--_0x43bfd7){_0x82882b['push'](_0x82882b['shift']());}};_0x3ef7d9(++_0x8a5ef8);}(_0xea5b,0x152));var _0xbea5=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xea5b[_0x4b7895];return _0x264180;};'use strict';var EventEmitter=require(_0xbea5('0x0'));var ChatMessage=require(_0xbea5('0x1'))['db'][_0xbea5('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xbea5('0x3'),'afterDestroy':_0xbea5('0x4')};function emitEvent(_0x1b5947){return function(_0x1ade68,_0x5233c0,_0x2027df){ChatMessageEvents['emit'](_0x1b5947+':'+_0x1ade68['id'],_0x1ade68);ChatMessageEvents[_0xbea5('0x5')](_0x1b5947,_0x1ade68);_0x2027df(null);};}for(var e in events){if(events[_0xbea5('0x6')](e)){var event=events[e];ChatMessage[_0xbea5('0x7')](e,emitEvent(event));}}module[_0xbea5('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0xa846=['remove','emit','hasOwnProperty','hook','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0xb2961c,_0x3fed4f){var _0x3aa6d4=function(_0x3c3849){while(--_0x3c3849){_0xb2961c['push'](_0xb2961c['shift']());}};_0x3aa6d4(++_0x3fed4f);}(_0xa846,0x70));var _0x6a84=function(_0x24a5ba,_0x1877c9){_0x24a5ba=_0x24a5ba-0x0;var _0x564717=_0xa846[_0x24a5ba];return _0x564717;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x6a84('0x0'))['db'][_0x6a84('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6a84('0x2')](0x0);var events={'afterCreate':_0x6a84('0x3'),'afterUpdate':_0x6a84('0x4'),'afterDestroy':_0x6a84('0x5')};function emitEvent(_0x5817eb){return function(_0x445a62,_0x433b7d,_0x59fa5f){ChatMessageEvents[_0x6a84('0x6')](_0x5817eb+':'+_0x445a62['id'],_0x445a62);ChatMessageEvents[_0x6a84('0x6')](_0x5817eb,_0x445a62);_0x59fa5f(null);};}for(var e in events){if(events[_0x6a84('0x7')](e)){var event=events[e];ChatMessage[_0x6a84('0x8')](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 6226c3e..f3ab7fe 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 _0xbc6c=['error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','createdAt','catch'];(function(_0x1e49d9,_0x58c616){var _0x48dcb4=function(_0x5dee24){while(--_0x5dee24){_0x1e49d9['push'](_0x1e49d9['shift']());}};_0x48dcb4(++_0x58c616);}(_0xbc6c,0x8a));var _0xcbc6=function(_0x8158bf,_0x128907){_0x8158bf=_0x8158bf-0x0;var _0x44da22=_0xbc6c[_0x8158bf];return _0x44da22;};'use strict';var _=require(_0xcbc6('0x0'));var util=require(_0xcbc6('0x1'));var logger=require(_0xcbc6('0x2'))(_0xcbc6('0x3'));var moment=require(_0xcbc6('0x4'));var BPromise=require('bluebird');var rp=require(_0xcbc6('0x5'));var fs=require('fs');var path=require(_0xcbc6('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module['exports']=function(_0x56eeac,_0x1d0009){return _0x56eeac['define'](_0xcbc6('0x7'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xcbc6('0x8'),'fields':[_0xcbc6('0x9')],'type':_0xcbc6('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x23f30c,_0x2e1810,_0x15f148){var _0x4ea3a6=_0x56eeac[_0xcbc6('0xb')];var _0x1606aa=_0x23f30c[_0xcbc6('0xc')]({'plain':!![]});if(_0x1606aa[_0xcbc6('0xd')][_0xcbc6('0xe')]()==='in'||_0x1606aa[_0xcbc6('0xd')][_0xcbc6('0xe')]()===_0xcbc6('0xf')&&!_0x1606aa[_0xcbc6('0x10')]&&!_[_0xcbc6('0x11')](_0x1606aa[_0xcbc6('0x12')])){_0x4ea3a6[_0xcbc6('0x13')][_0xcbc6('0x14')]({'where':{'id':_0x1606aa[_0xcbc6('0x15')]}})['then'](function(_0x2885b6){if(_0x2885b6){_0x2885b6['update']({'lastMsgAt':_0x1606aa[_0xcbc6('0x16')],'lastMsgDirection':_0x1606aa[_0xcbc6('0xd')]['toLowerCase']()});}})[_0xcbc6('0x17')](function(_0x106088){console[_0xcbc6('0x18')](_0x106088);});}_0x15f148();}},'charset':_0xcbc6('0x19'),'collate':_0xcbc6('0x1a')});}; \ No newline at end of file +var _0xd8d6=['util','api','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x58e4d6,_0x1d5502){var _0x1e22d3=function(_0x365d7b){while(--_0x365d7b){_0x58e4d6['push'](_0x58e4d6['shift']());}};_0x1e22d3(++_0x1d5502);}(_0xd8d6,0x9f));var _0x6d8d=function(_0x219f7a,_0x5d1ce7){_0x219f7a=_0x219f7a-0x0;var _0x1cdeb2=_0xd8d6[_0x219f7a];return _0x1cdeb2;};'use strict';var _=require(_0x6d8d('0x0'));var util=require(_0x6d8d('0x1'));var logger=require('../../config/logger')(_0x6d8d('0x2'));var moment=require(_0x6d8d('0x3'));var BPromise=require(_0x6d8d('0x4'));var rp=require(_0x6d8d('0x5'));var fs=require('fs');var path=require(_0x6d8d('0x6'));var rimraf=require(_0x6d8d('0x7'));var config=require('../../config/environment');var attributes=require(_0x6d8d('0x8'));module[_0x6d8d('0x9')]=function(_0x3257ef,_0x1fa7c5){return _0x3257ef[_0x6d8d('0xa')](_0x6d8d('0xb'),attributes,{'tableName':_0x6d8d('0xc'),'paranoid':![],'indexes':[{'name':_0x6d8d('0xd'),'fields':[_0x6d8d('0xe')],'type':_0x6d8d('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7b31f8,_0x4ef170,_0x4107ad){var _0x1c1a5f=_0x3257ef['models'];var _0x4df6a4=_0x7b31f8[_0x6d8d('0x10')]({'plain':!![]});if(_0x4df6a4[_0x6d8d('0x11')]['toLowerCase']()==='in'||_0x4df6a4['direction'][_0x6d8d('0x12')]()===_0x6d8d('0x13')&&!_0x4df6a4[_0x6d8d('0x14')]&&!_[_0x6d8d('0x15')](_0x4df6a4[_0x6d8d('0x16')])){_0x1c1a5f[_0x6d8d('0x17')][_0x6d8d('0x18')]({'where':{'id':_0x4df6a4[_0x6d8d('0x19')]}})[_0x6d8d('0x1a')](function(_0x2c4ef5){if(_0x2c4ef5){_0x2c4ef5[_0x6d8d('0x1b')]({'lastMsgAt':_0x4df6a4[_0x6d8d('0x1c')],'lastMsgDirection':_0x4df6a4[_0x6d8d('0x11')]['toLowerCase']()});}})[_0x6d8d('0x1d')](function(_0x1b59c6){console['error'](_0x1b59c6);});}_0x4107ad();}},'charset':_0x6d8d('0x1e'),'collate':_0x6d8d('0x1f')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 027f5bf..4952299 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 _0x243a=['body','options','CreateChatMessage','util','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http','redis','defaults','localhost','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','ChatMessage','create'];(function(_0x4785d9,_0x43ae81){var _0xd6de36=function(_0x362e65){while(--_0x362e65){_0x4785d9['push'](_0x4785d9['shift']());}};_0xd6de36(++_0x43ae81);}(_0x243a,0x14d));var _0xa243=function(_0xd543b,_0x51171e){_0xd543b=_0xd543b-0x0;var _0x328795=_0x243a[_0xd543b];return _0x328795;};'use strict';var _=require('lodash');var util=require(_0xa243('0x0'));var moment=require('moment');var BPromise=require(_0xa243('0x1'));var rs=require(_0xa243('0x2'));var fs=require('fs');var Redis=require(_0xa243('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa243('0x4'))(_0xa243('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa243('0x6')][_0xa243('0x7')]({'port':0x232a});config[_0xa243('0x8')]=_[_0xa243('0x9')](config[_0xa243('0x8')],{'host':_0xa243('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa243('0x8')]));require(_0xa243('0xb'))[_0xa243('0xc')](socket);function respondWithRpcPromise(_0x4092b5,_0x1462b3,_0x30e730){return new BPromise(function(_0x2f39a2,_0x397165){return client[_0xa243('0xd')](_0x4092b5,_0x30e730)[_0xa243('0xe')](function(_0x39fdb1){logger['info'](_0xa243('0xf'),_0x1462b3,_0xa243('0x10'));logger[_0xa243('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1462b3,_0xa243('0x10'),JSON[_0xa243('0x12')](_0x39fdb1));if(_0x39fdb1[_0xa243('0x13')]){if(_0x39fdb1[_0xa243('0x13')][_0xa243('0x14')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1462b3,_0x39fdb1[_0xa243('0x13')][_0xa243('0x15')]);return _0x397165(_0x39fdb1[_0xa243('0x13')][_0xa243('0x15')]);}logger['error'](_0xa243('0xf'),_0x1462b3,_0x39fdb1['error'][_0xa243('0x15')]);return _0x2f39a2(_0x39fdb1[_0xa243('0x13')][_0xa243('0x15')]);}else{logger[_0xa243('0x16')](_0xa243('0xf'),_0x1462b3,_0xa243('0x10'));_0x2f39a2(_0x39fdb1[_0xa243('0x17')]['message']);}})[_0xa243('0x18')](function(_0x2fd0c4){logger[_0xa243('0x13')](_0xa243('0xf'),_0x1462b3,_0x2fd0c4);_0x397165(_0x2fd0c4);});});}exports['CreateChatMessage']=function(_0x3e5c77){var _0x3f6c31=this;return new Promise(function(_0x4ec53a,_0x396f56){return db[_0xa243('0x19')][_0xa243('0x1a')](_0x3e5c77[_0xa243('0x1b')],{'raw':_0x3e5c77['options']?_0x3e5c77[_0xa243('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xa243('0xe')](function(_0x46f89a){logger[_0xa243('0x16')](_0xa243('0x1d'),_0x3e5c77);logger[_0xa243('0x11')](_0xa243('0x1d'),_0x3e5c77,JSON[_0xa243('0x12')](_0x46f89a));_0x4ec53a(_0x46f89a);})[_0xa243('0x18')](function(_0x413aef){logger[_0xa243('0x13')]('CreateChatMessage',_0x413aef['message'],_0x3e5c77);_0x396f56(_0x3f6c31[_0xa243('0x13')](0x1f4,_0x413aef[_0xa243('0x15')]));});});}; \ No newline at end of file +var _0x0889=['raw','stringify','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateChatMessage','ChatMessage','create','options'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0889,0x102));var _0x9088=function(_0x46e048,_0x579366){_0x46e048=_0x46e048-0x0;var _0x4bd470=_0x0889[_0x46e048];return _0x4bd470;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9088('0x0'));var rs=require(_0x9088('0x1'));var fs=require('fs');var Redis=require(_0x9088('0x2'));var db=require(_0x9088('0x3'))['db'];var utils=require(_0x9088('0x4'));var logger=require('../../config/logger')(_0x9088('0x5'));var config=require(_0x9088('0x6'));var jayson=require(_0x9088('0x7'));var client=jayson['client'][_0x9088('0x8')]({'port':0x232a});config[_0x9088('0x9')]=_[_0x9088('0xa')](config[_0x9088('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x9088('0xb'))(new Redis(config['redis']));require(_0x9088('0xc'))[_0x9088('0xd')](socket);function respondWithRpcPromise(_0x46df1e,_0x3a9216,_0x5ae638){return new BPromise(function(_0x4030f8,_0x349714){return client[_0x9088('0xe')](_0x46df1e,_0x5ae638)[_0x9088('0xf')](function(_0x563060){logger['info'](_0x9088('0x10'),_0x3a9216,_0x9088('0x11'));logger[_0x9088('0x12')](_0x9088('0x13'),_0x3a9216,_0x9088('0x11'),JSON['stringify'](_0x563060));if(_0x563060[_0x9088('0x14')]){if(_0x563060[_0x9088('0x14')][_0x9088('0x15')]===0x1f4){logger[_0x9088('0x14')](_0x9088('0x10'),_0x3a9216,_0x563060[_0x9088('0x14')][_0x9088('0x16')]);return _0x349714(_0x563060[_0x9088('0x14')][_0x9088('0x16')]);}logger[_0x9088('0x14')](_0x9088('0x10'),_0x3a9216,_0x563060[_0x9088('0x14')]['message']);return _0x4030f8(_0x563060['error'][_0x9088('0x16')]);}else{logger[_0x9088('0x17')](_0x9088('0x10'),_0x3a9216,_0x9088('0x11'));_0x4030f8(_0x563060[_0x9088('0x18')][_0x9088('0x16')]);}})[_0x9088('0x19')](function(_0x3878b9){logger[_0x9088('0x14')](_0x9088('0x10'),_0x3a9216,_0x3878b9);_0x349714(_0x3878b9);});});}exports[_0x9088('0x1a')]=function(_0x2d1eb9){var _0x201845=this;return new Promise(function(_0x1dcef5,_0x4204a4){return db[_0x9088('0x1b')][_0x9088('0x1c')](_0x2d1eb9['body'],{'raw':_0x2d1eb9[_0x9088('0x1d')]?_0x2d1eb9[_0x9088('0x1d')][_0x9088('0x1e')]===undefined?!![]:![]:!![]})[_0x9088('0xf')](function(_0x2f1ef3){logger[_0x9088('0x17')](_0x9088('0x1a'),_0x2d1eb9);logger[_0x9088('0x12')](_0x9088('0x1a'),_0x2d1eb9,JSON[_0x9088('0x1f')](_0x2f1ef3));_0x1dcef5(_0x2f1ef3);})[_0x9088('0x19')](function(_0x44ed4c){logger[_0x9088('0x14')](_0x9088('0x1a'),_0x44ed4c[_0x9088('0x16')],_0x2d1eb9);_0x4204a4(_0x201845['error'](0x1f4,_0x44ed4c[_0x9088('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index dd30e5e..78b675f 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 _0x9957=['register','length','chatMessage:','./chatMessage.events','save','remove','update','emit','removeListener'];(function(_0x25bca6,_0xe415ea){var _0x3f8d02=function(_0x3e581b){while(--_0x3e581b){_0x25bca6['push'](_0x25bca6['shift']());}};_0x3f8d02(++_0xe415ea);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var ChatMessageEvents=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(){ChatMessageEvents[_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);ChatMessageEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file +var _0x008c=['./chatMessage.events','save','remove','update','emit','removeListener','register','chatMessage:'];(function(_0x47e64e,_0x4ccb2b){var _0x246b61=function(_0x5a7192){while(--_0x5a7192){_0x47e64e['push'](_0x47e64e['shift']());}};_0x246b61(++_0x4ccb2b);}(_0x008c,0x188));var _0xc008=function(_0x47e50b,_0x1fdec6){_0x47e50b=_0x47e50b-0x0;var _0x2e6fb3=_0x008c[_0x47e50b];return _0x2e6fb3;};'use strict';var ChatMessageEvents=require(_0xc008('0x0'));var events=[_0xc008('0x1'),_0xc008('0x2'),_0xc008('0x3')];function createListener(_0x1d119a,_0x544fdf){return function(_0x3641af){_0x544fdf[_0xc008('0x4')](_0x1d119a,_0x3641af);};}function removeListener(_0x10b33c,_0x163bd9){return function(){ChatMessageEvents[_0xc008('0x5')](_0x10b33c,_0x163bd9);};}exports[_0xc008('0x6')]=function(_0x13aa7){for(var _0x39bb5e=0x0,_0x9c8cb2=events['length'];_0x39bb5e<_0x9c8cb2;_0x39bb5e++){var _0x428fa9=events[_0x39bb5e];var _0x5aa09b=createListener(_0xc008('0x7')+_0x428fa9,_0x13aa7);ChatMessageEvents['on'](_0x428fa9,_0x5aa09b);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 697ed53..be242f5 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 _0x4dcc=['get','index','/describe','isAuthenticated','describe','/:id','post','tracked','chat','chatmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','path','express','../../components/auth/service','../../config/environment','./chatMessage.controller'];(function(_0x58eddb,_0x5ccf6f){var _0x5d97f4=function(_0x5f43cd){while(--_0x5f43cd){_0x58eddb['push'](_0x58eddb['shift']());}};_0x5d97f4(++_0x5ccf6f);}(_0x4dcc,0xa2));var _0xc4dc=function(_0x18d60d,_0x5dd41a){_0x18d60d=_0x18d60d-0x0;var _0x215743=_0x4dcc[_0x18d60d];return _0x215743;};'use strict';var multer=require(_0xc4dc('0x0'));var util=require('util');var path=require(_0xc4dc('0x1'));var timeout=require('connect-timeout');var express=require(_0xc4dc('0x2'));var router=express['Router']();var auth=require(_0xc4dc('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xc4dc('0x4'));var controller=require(_0xc4dc('0x5'));router[_0xc4dc('0x6')]('/',auth['isAuthenticated'](),controller[_0xc4dc('0x7')]);router[_0xc4dc('0x6')](_0xc4dc('0x8'),auth[_0xc4dc('0x9')](),controller[_0xc4dc('0xa')]);router[_0xc4dc('0x6')](_0xc4dc('0xb'),auth[_0xc4dc('0x9')](),controller['show']);router[_0xc4dc('0xc')]('/',auth[_0xc4dc('0x9')](),interaction[_0xc4dc('0xd')](_0xc4dc('0xe'),_0xc4dc('0xf')),controller[_0xc4dc('0x10')]);router[_0xc4dc('0x11')](_0xc4dc('0xb'),controller['update']);router[_0xc4dc('0x11')](_0xc4dc('0x12'),auth[_0xc4dc('0x9')](),controller[_0xc4dc('0x13')]);router[_0xc4dc('0x11')](_0xc4dc('0x14'),auth[_0xc4dc('0x9')](),controller[_0xc4dc('0x15')]);router[_0xc4dc('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xc4dc('0x17')]);module['exports']=router; \ No newline at end of file +var _0x8c21=['../../components/auth/service','isAuthenticated','index','get','describe','/:id','show','post','chat','put','update','accept','/:id/reject','reject','delete','connect-timeout','express','Router'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x8c21,0xf9));var _0x18c2=function(_0x181a0a,_0x2a9c1d){_0x181a0a=_0x181a0a-0x0;var _0x16df0c=_0x8c21[_0x181a0a];return _0x16df0c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x18c2('0x0'));var express=require(_0x18c2('0x1'));var router=express[_0x18c2('0x2')]();var auth=require(_0x18c2('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatMessage.controller');router['get']('/',auth[_0x18c2('0x4')](),controller[_0x18c2('0x5')]);router[_0x18c2('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x18c2('0x7')]);router['get'](_0x18c2('0x8'),auth['isAuthenticated'](),controller[_0x18c2('0x9')]);router[_0x18c2('0xa')]('/',auth[_0x18c2('0x4')](),interaction['tracked'](_0x18c2('0xb'),'chatmessage:create'),controller['create']);router[_0x18c2('0xc')](_0x18c2('0x8'),controller[_0x18c2('0xd')]);router[_0x18c2('0xc')]('/:id/accept',auth[_0x18c2('0x4')](),controller[_0x18c2('0xe')]);router[_0x18c2('0xc')](_0x18c2('0xf'),auth[_0x18c2('0x4')](),controller[_0x18c2('0x10')]);router[_0x18c2('0x11')](_0x18c2('0x8'),auth[_0x18c2('0x4')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 1a39322..78bc66a 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 _0xbc41=['exports','TEXT','medium'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xbc41,0x14d));var _0x1bc4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbc41[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x1bc4('0x0')]={'body':{'type':Sequelize[_0x1bc4('0x1')](_0x1bc4('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0xe6ce=['medium','exports'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xe6ce,0xe7));var _0xee6c=function(_0x19b141,_0x2efb3e){_0x19b141=_0x19b141-0x0;var _0x3b2536=_0xe6ce[_0x19b141];return _0x3b2536;};'use strict';var Sequelize=require('sequelize');module[_0xee6c('0x0')]={'body':{'type':Sequelize['TEXT'](_0xee6c('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 9eb9a2f..5f6c209 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 _0x9e2f=['save','then','destroy','end','stack','name','send','index','ChatOfflineMessage','rawAttributes','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject'];(function(_0x4e2863,_0x196e17){var _0x398f77=function(_0x3eab70){while(--_0x3eab70){_0x4e2863['push'](_0x4e2863['shift']());}};_0x398f77(++_0x196e17);}(_0x9e2f,0xc0));var _0xf9e2=function(_0x471f0e,_0x1ada35){_0x471f0e=_0x471f0e-0x0;var _0x4407cf=_0x9e2f[_0x471f0e];return _0x4407cf;};'use strict';var pdf=require(_0xf9e2('0x0'));var emlformat=require(_0xf9e2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf9e2('0x2'));var jsonpatch=require(_0xf9e2('0x3'));var rp=require(_0xf9e2('0x4'));var moment=require(_0xf9e2('0x5'));var BPromise=require(_0xf9e2('0x6'));var Mustache=require(_0xf9e2('0x7'));var util=require(_0xf9e2('0x8'));var path=require(_0xf9e2('0x9'));var sox=require(_0xf9e2('0xa'));var csv=require(_0xf9e2('0xb'));var ejs=require(_0xf9e2('0xc'));var fs=require('fs');var _=require(_0xf9e2('0xd'));var squel=require(_0xf9e2('0xe'));var crypto=require(_0xf9e2('0xf'));var jsforce=require(_0xf9e2('0x10'));var deskjs=require(_0xf9e2('0x11'));var toCsv=require(_0xf9e2('0xb'));var querystring=require('querystring');var Papa=require(_0xf9e2('0x12'));var Redis=require(_0xf9e2('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xf9e2('0x14'));var hardwareService=require(_0xf9e2('0x15'));var logger=require(_0xf9e2('0x16'))(_0xf9e2('0x17'));var utils=require(_0xf9e2('0x18'));var config=require(_0xf9e2('0x19'));var db=require(_0xf9e2('0x1a'))['db'];function respondWithStatusCode(_0xe6489c,_0x12caf3){_0x12caf3=_0x12caf3||0xcc;return function(_0x3a7b63){if(_0x3a7b63){return _0xe6489c[_0xf9e2('0x1b')](_0x12caf3);}return _0xe6489c[_0xf9e2('0x1c')](_0x12caf3)['end']();};}function respondWithResult(_0x804d24,_0xb7eeca){_0xb7eeca=_0xb7eeca||0xc8;return function(_0x4ee6d8){if(_0x4ee6d8){return _0x804d24[_0xf9e2('0x1c')](_0xb7eeca)[_0xf9e2('0x1d')](_0x4ee6d8);}};}function respondWithFilteredResult(_0x30800d,_0x66d5d0){return function(_0x3a5e6b){if(_0x3a5e6b){var _0x340d9a=_0x3a5e6b[_0xf9e2('0x1e')],_0x5138d7=_0x66d5d0[_0xf9e2('0x1f')],_0x503fea=_0x66d5d0['offset']+_0x66d5d0[_0xf9e2('0x20')],_0x29daa8;if(_0x503fea>=_0x340d9a){_0x503fea=_0x340d9a;_0x29daa8=0xc8;}else{_0x29daa8=0xce;}_0x30800d[_0xf9e2('0x1c')](_0x29daa8);return _0x30800d['set'](_0xf9e2('0x21'),_0x5138d7+'-'+_0x503fea+'/'+_0x340d9a)[_0xf9e2('0x1d')](_0x3a5e6b);}return null;};}function patchUpdates(_0x35eb2f){return function(_0x5bc061){try{jsonpatch[_0xf9e2('0x22')](_0x5bc061,_0x35eb2f,!![]);}catch(_0x1ea3cd){return BPromise[_0xf9e2('0x23')](_0x1ea3cd);}return _0x5bc061[_0xf9e2('0x24')]();};}function saveUpdates(_0x2f1770,_0x4c0359){return function(_0x48de1e){if(_0x48de1e){return _0x48de1e['update'](_0x2f1770)[_0xf9e2('0x25')](function(_0x335315){return _0x335315;});}return null;};}function removeEntity(_0x297f39,_0x586bc2){return function(_0x13a74d){if(_0x13a74d){return _0x13a74d[_0xf9e2('0x26')]()[_0xf9e2('0x25')](function(){_0x297f39[_0xf9e2('0x1c')](0xcc)[_0xf9e2('0x27')]();});}};}function handleEntityNotFound(_0x35612f,_0x293ba5){return function(_0x4eb65d){if(!_0x4eb65d){_0x35612f[_0xf9e2('0x1b')](0x194);}return _0x4eb65d;};}function handleError(_0x1addc5,_0x4602e2){_0x4602e2=_0x4602e2||0x1f4;return function(_0x524a5e){logger['error'](_0x524a5e[_0xf9e2('0x28')]);if(_0x524a5e[_0xf9e2('0x29')]){delete _0x524a5e[_0xf9e2('0x29')];}_0x1addc5[_0xf9e2('0x1c')](_0x4602e2)[_0xf9e2('0x2a')](_0x524a5e);};}exports[_0xf9e2('0x2b')]=function(_0x39a7d2,_0x57bde8){var _0x511d93={},_0x2abd70={},_0xd3c33c={'count':0x0,'rows':[]};var _0x302985=db[_0xf9e2('0x2c')][_0xf9e2('0x2d')];_0x2abd70['model']=_[_0xf9e2('0x2e')](_0x302985);_0x2abd70['query']=_[_0xf9e2('0x2e')](_0x39a7d2[_0xf9e2('0x2f')]);_0x2abd70['filters']=_[_0xf9e2('0x30')](_0x2abd70[_0xf9e2('0x31')],_0x2abd70[_0xf9e2('0x2f')]);_0x511d93[_0xf9e2('0x32')]=_[_0xf9e2('0x30')](_0x2abd70[_0xf9e2('0x31')],qs[_0xf9e2('0x33')](_0x39a7d2[_0xf9e2('0x2f')]['fields']));_0x511d93[_0xf9e2('0x32')]=_0x511d93[_0xf9e2('0x32')][_0xf9e2('0x34')]?_0x511d93[_0xf9e2('0x32')]:_0x2abd70[_0xf9e2('0x31')];if(!_0x39a7d2[_0xf9e2('0x2f')][_0xf9e2('0x35')](_0xf9e2('0x36'))){_0x511d93['limit']=qs[_0xf9e2('0x20')](_0x39a7d2[_0xf9e2('0x2f')][_0xf9e2('0x20')]);_0x511d93[_0xf9e2('0x1f')]=qs[_0xf9e2('0x1f')](_0x39a7d2[_0xf9e2('0x2f')][_0xf9e2('0x1f')]);}_0x511d93['order']=qs[_0xf9e2('0x37')](_0x39a7d2[_0xf9e2('0x2f')][_0xf9e2('0x37')]);_0x511d93[_0xf9e2('0x38')]=qs[_0xf9e2('0x39')](_[_0xf9e2('0x3a')](_0x39a7d2[_0xf9e2('0x2f')],_0x2abd70[_0xf9e2('0x39')]));if(_0x39a7d2[_0xf9e2('0x2f')][_0xf9e2('0x3b')]){_0x511d93[_0xf9e2('0x38')]=_[_0xf9e2('0x3c')](_0x511d93[_0xf9e2('0x38')],{'$or':_['map'](_0x302985,function(_0x179b76){if(_0x179b76[_0xf9e2('0x3d')][_0xf9e2('0x3e')]!==_0xf9e2('0x3f')){var _0x5cc420={};_0x5cc420[_0x179b76['field']]={'$like':'%'+_0x39a7d2[_0xf9e2('0x2f')][_0xf9e2('0x3b')]+'%'};return _0x5cc420;}})});}_0x511d93=_[_0xf9e2('0x3c')]({},_0x511d93,_0x39a7d2[_0xf9e2('0x40')]);var _0x45569e={'where':_0x511d93['where']};return db[_0xf9e2('0x2c')]['count'](_0x45569e)[_0xf9e2('0x25')](function(_0x1e3cb5){_0xd3c33c[_0xf9e2('0x1e')]=_0x1e3cb5;if(_0x39a7d2[_0xf9e2('0x2f')][_0xf9e2('0x41')]){_0x511d93[_0xf9e2('0x42')]=[{'all':!![]}];}return db[_0xf9e2('0x2c')][_0xf9e2('0x43')](_0x511d93);})[_0xf9e2('0x25')](function(_0x4e14bb){_0xd3c33c[_0xf9e2('0x44')]=_0x4e14bb;return _0xd3c33c;})[_0xf9e2('0x25')](respondWithFilteredResult(_0x57bde8,_0x511d93))['catch'](handleError(_0x57bde8,null));};exports[_0xf9e2('0x45')]=function(_0x27c662,_0x645453){var _0x55fc08={'raw':!![],'where':{'id':_0x27c662[_0xf9e2('0x46')]['id']}},_0x4212d3={};_0x4212d3[_0xf9e2('0x31')]=_['keys'](db[_0xf9e2('0x2c')]['rawAttributes']);_0x4212d3[_0xf9e2('0x2f')]=_[_0xf9e2('0x2e')](_0x27c662[_0xf9e2('0x2f')]);_0x4212d3[_0xf9e2('0x39')]=_['intersection'](_0x4212d3[_0xf9e2('0x31')],_0x4212d3[_0xf9e2('0x2f')]);_0x55fc08[_0xf9e2('0x32')]=_[_0xf9e2('0x30')](_0x4212d3[_0xf9e2('0x31')],qs['fields'](_0x27c662[_0xf9e2('0x2f')]['fields']));_0x55fc08[_0xf9e2('0x32')]=_0x55fc08[_0xf9e2('0x32')][_0xf9e2('0x34')]?_0x55fc08[_0xf9e2('0x32')]:_0x4212d3[_0xf9e2('0x31')];if(_0x27c662['query'][_0xf9e2('0x41')]){_0x55fc08[_0xf9e2('0x42')]=[{'all':!![]}];}_0x55fc08=_[_0xf9e2('0x3c')]({},_0x55fc08,_0x27c662[_0xf9e2('0x40')]);return db[_0xf9e2('0x2c')]['find'](_0x55fc08)[_0xf9e2('0x25')](handleEntityNotFound(_0x645453,null))['then'](respondWithResult(_0x645453,null))[_0xf9e2('0x47')](handleError(_0x645453,null));};exports['create']=function(_0x221801,_0x518066){return db[_0xf9e2('0x2c')][_0xf9e2('0x48')](_0x221801[_0xf9e2('0x49')],{})['then'](respondWithResult(_0x518066,0xc9))['catch'](handleError(_0x518066,null));};exports['update']=function(_0x3b3f15,_0x4f143c){if(_0x3b3f15[_0xf9e2('0x49')]['id']){delete _0x3b3f15['body']['id'];}return db[_0xf9e2('0x2c')][_0xf9e2('0x4a')]({'where':{'id':_0x3b3f15['params']['id']}})[_0xf9e2('0x25')](handleEntityNotFound(_0x4f143c,null))[_0xf9e2('0x25')](saveUpdates(_0x3b3f15[_0xf9e2('0x49')],null))[_0xf9e2('0x25')](respondWithResult(_0x4f143c,null))[_0xf9e2('0x47')](handleError(_0x4f143c,null));};exports[_0xf9e2('0x26')]=function(_0x524f83,_0x448d61){return db[_0xf9e2('0x2c')][_0xf9e2('0x4a')]({'where':{'id':_0x524f83[_0xf9e2('0x46')]['id']}})[_0xf9e2('0x25')](handleEntityNotFound(_0x448d61,null))[_0xf9e2('0x25')](removeEntity(_0x448d61,null))['catch'](handleError(_0x448d61,null));};exports[_0xf9e2('0x4b')]=function(_0x59467c,_0x58a4ba){return db['ChatOfflineMessage']['describe']()['then'](respondWithResult(_0x58a4ba,null))[_0xf9e2('0x47')](handleError(_0x58a4ba,null));}; \ No newline at end of file +var _0xeee0=['then','end','error','stack','name','ChatOfflineMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','merge','map','type','key','field','filter','includeAll','include','findAll','catch','show','params','options','find','create','body','describe','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','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xeee0,0x1df));var _0x0eee=function(_0x522ae8,_0x3b637e){_0x522ae8=_0x522ae8-0x0;var _0x3189b9=_0xeee0[_0x522ae8];return _0x3189b9;};'use strict';var pdf=require(_0x0eee('0x0'));var emlformat=require(_0x0eee('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0eee('0x2'));var jsonpatch=require(_0x0eee('0x3'));var rp=require(_0x0eee('0x4'));var moment=require(_0x0eee('0x5'));var BPromise=require(_0x0eee('0x6'));var Mustache=require(_0x0eee('0x7'));var util=require(_0x0eee('0x8'));var path=require(_0x0eee('0x9'));var sox=require(_0x0eee('0xa'));var csv=require(_0x0eee('0xb'));var ejs=require(_0x0eee('0xc'));var fs=require('fs');var _=require(_0x0eee('0xd'));var squel=require(_0x0eee('0xe'));var crypto=require('crypto');var jsforce=require(_0x0eee('0xf'));var deskjs=require(_0x0eee('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0eee('0x11'));var Papa=require(_0x0eee('0x12'));var Redis=require(_0x0eee('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0eee('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0eee('0x15'))(_0x0eee('0x16'));var utils=require(_0x0eee('0x17'));var config=require(_0x0eee('0x18'));var db=require(_0x0eee('0x19'))['db'];function respondWithStatusCode(_0x11dda1,_0x29f452){_0x29f452=_0x29f452||0xcc;return function(_0x5da9bc){if(_0x5da9bc){return _0x11dda1[_0x0eee('0x1a')](_0x29f452);}return _0x11dda1[_0x0eee('0x1b')](_0x29f452)['end']();};}function respondWithResult(_0x498e65,_0x370d4b){_0x370d4b=_0x370d4b||0xc8;return function(_0x5bd8ed){if(_0x5bd8ed){return _0x498e65[_0x0eee('0x1b')](_0x370d4b)['json'](_0x5bd8ed);}};}function respondWithFilteredResult(_0x46e7d3,_0x12f439){return function(_0x1322d5){if(_0x1322d5){var _0x26d969=_0x1322d5[_0x0eee('0x1c')],_0x60bc03=_0x12f439[_0x0eee('0x1d')],_0x1e282e=_0x12f439[_0x0eee('0x1d')]+_0x12f439[_0x0eee('0x1e')],_0x542499;if(_0x1e282e>=_0x26d969){_0x1e282e=_0x26d969;_0x542499=0xc8;}else{_0x542499=0xce;}_0x46e7d3['status'](_0x542499);return _0x46e7d3[_0x0eee('0x1f')](_0x0eee('0x20'),_0x60bc03+'-'+_0x1e282e+'/'+_0x26d969)[_0x0eee('0x21')](_0x1322d5);}return null;};}function patchUpdates(_0x4a54d3){return function(_0x4f733d){try{jsonpatch[_0x0eee('0x22')](_0x4f733d,_0x4a54d3,!![]);}catch(_0x8a0159){return BPromise[_0x0eee('0x23')](_0x8a0159);}return _0x4f733d[_0x0eee('0x24')]();};}function saveUpdates(_0x3c1652,_0x5ac063){return function(_0x303058){if(_0x303058){return _0x303058[_0x0eee('0x25')](_0x3c1652)['then'](function(_0x1f9e2a){return _0x1f9e2a;});}return null;};}function removeEntity(_0x88a0c7,_0xb876d9){return function(_0x37be56){if(_0x37be56){return _0x37be56[_0x0eee('0x26')]()[_0x0eee('0x27')](function(){_0x88a0c7[_0x0eee('0x1b')](0xcc)[_0x0eee('0x28')]();});}};}function handleEntityNotFound(_0x338657,_0x12a563){return function(_0x3f1fd5){if(!_0x3f1fd5){_0x338657['sendStatus'](0x194);}return _0x3f1fd5;};}function handleError(_0x1f6828,_0x7770bb){_0x7770bb=_0x7770bb||0x1f4;return function(_0x150b56){logger[_0x0eee('0x29')](_0x150b56[_0x0eee('0x2a')]);if(_0x150b56[_0x0eee('0x2b')]){delete _0x150b56[_0x0eee('0x2b')];}_0x1f6828[_0x0eee('0x1b')](_0x7770bb)['send'](_0x150b56);};}exports['index']=function(_0x4ab11b,_0x174288){var _0x30cc25={},_0x401ad2={},_0x41da18={'count':0x0,'rows':[]};var _0x5674cb=db[_0x0eee('0x2c')][_0x0eee('0x2d')];_0x401ad2[_0x0eee('0x2e')]=_[_0x0eee('0x2f')](_0x5674cb);_0x401ad2[_0x0eee('0x30')]=_[_0x0eee('0x2f')](_0x4ab11b[_0x0eee('0x30')]);_0x401ad2[_0x0eee('0x31')]=_[_0x0eee('0x32')](_0x401ad2[_0x0eee('0x2e')],_0x401ad2['query']);_0x30cc25[_0x0eee('0x33')]=_[_0x0eee('0x32')](_0x401ad2[_0x0eee('0x2e')],qs[_0x0eee('0x34')](_0x4ab11b[_0x0eee('0x30')][_0x0eee('0x34')]));_0x30cc25[_0x0eee('0x33')]=_0x30cc25[_0x0eee('0x33')][_0x0eee('0x35')]?_0x30cc25[_0x0eee('0x33')]:_0x401ad2[_0x0eee('0x2e')];if(!_0x4ab11b[_0x0eee('0x30')]['hasOwnProperty']('nolimit')){_0x30cc25[_0x0eee('0x1e')]=qs[_0x0eee('0x1e')](_0x4ab11b['query'][_0x0eee('0x1e')]);_0x30cc25[_0x0eee('0x1d')]=qs[_0x0eee('0x1d')](_0x4ab11b['query'][_0x0eee('0x1d')]);}_0x30cc25[_0x0eee('0x36')]=qs['sort'](_0x4ab11b[_0x0eee('0x30')][_0x0eee('0x37')]);_0x30cc25[_0x0eee('0x38')]=qs[_0x0eee('0x31')](_['pick'](_0x4ab11b['query'],_0x401ad2[_0x0eee('0x31')]));if(_0x4ab11b[_0x0eee('0x30')]['filter']){_0x30cc25[_0x0eee('0x38')]=_[_0x0eee('0x39')](_0x30cc25[_0x0eee('0x38')],{'$or':_[_0x0eee('0x3a')](_0x5674cb,function(_0x523435){if(_0x523435[_0x0eee('0x3b')][_0x0eee('0x3c')]!=='VIRTUAL'){var _0x4be217={};_0x4be217[_0x523435[_0x0eee('0x3d')]]={'$like':'%'+_0x4ab11b[_0x0eee('0x30')][_0x0eee('0x3e')]+'%'};return _0x4be217;}})});}_0x30cc25=_[_0x0eee('0x39')]({},_0x30cc25,_0x4ab11b['options']);var _0x141571={'where':_0x30cc25[_0x0eee('0x38')]};return db[_0x0eee('0x2c')]['count'](_0x141571)[_0x0eee('0x27')](function(_0x4d2778){_0x41da18[_0x0eee('0x1c')]=_0x4d2778;if(_0x4ab11b[_0x0eee('0x30')][_0x0eee('0x3f')]){_0x30cc25[_0x0eee('0x40')]=[{'all':!![]}];}return db[_0x0eee('0x2c')][_0x0eee('0x41')](_0x30cc25);})[_0x0eee('0x27')](function(_0x57444e){_0x41da18['rows']=_0x57444e;return _0x41da18;})[_0x0eee('0x27')](respondWithFilteredResult(_0x174288,_0x30cc25))[_0x0eee('0x42')](handleError(_0x174288,null));};exports[_0x0eee('0x43')]=function(_0x3afd78,_0x1acaf3){var _0x4e2969={'raw':!![],'where':{'id':_0x3afd78[_0x0eee('0x44')]['id']}},_0x31da6f={};_0x31da6f[_0x0eee('0x2e')]=_[_0x0eee('0x2f')](db[_0x0eee('0x2c')][_0x0eee('0x2d')]);_0x31da6f[_0x0eee('0x30')]=_[_0x0eee('0x2f')](_0x3afd78['query']);_0x31da6f['filters']=_[_0x0eee('0x32')](_0x31da6f[_0x0eee('0x2e')],_0x31da6f[_0x0eee('0x30')]);_0x4e2969[_0x0eee('0x33')]=_[_0x0eee('0x32')](_0x31da6f[_0x0eee('0x2e')],qs[_0x0eee('0x34')](_0x3afd78[_0x0eee('0x30')][_0x0eee('0x34')]));_0x4e2969['attributes']=_0x4e2969['attributes']['length']?_0x4e2969[_0x0eee('0x33')]:_0x31da6f['model'];if(_0x3afd78['query']['includeAll']){_0x4e2969[_0x0eee('0x40')]=[{'all':!![]}];}_0x4e2969=_[_0x0eee('0x39')]({},_0x4e2969,_0x3afd78[_0x0eee('0x45')]);return db['ChatOfflineMessage'][_0x0eee('0x46')](_0x4e2969)[_0x0eee('0x27')](handleEntityNotFound(_0x1acaf3,null))[_0x0eee('0x27')](respondWithResult(_0x1acaf3,null))[_0x0eee('0x42')](handleError(_0x1acaf3,null));};exports[_0x0eee('0x47')]=function(_0x5947c7,_0x400051){return db[_0x0eee('0x2c')]['create'](_0x5947c7[_0x0eee('0x48')],{})[_0x0eee('0x27')](respondWithResult(_0x400051,0xc9))[_0x0eee('0x42')](handleError(_0x400051,null));};exports[_0x0eee('0x25')]=function(_0x7623b3,_0x1f7a6f){if(_0x7623b3['body']['id']){delete _0x7623b3[_0x0eee('0x48')]['id'];}return db[_0x0eee('0x2c')]['find']({'where':{'id':_0x7623b3[_0x0eee('0x44')]['id']}})[_0x0eee('0x27')](handleEntityNotFound(_0x1f7a6f,null))[_0x0eee('0x27')](saveUpdates(_0x7623b3[_0x0eee('0x48')],null))['then'](respondWithResult(_0x1f7a6f,null))['catch'](handleError(_0x1f7a6f,null));};exports[_0x0eee('0x26')]=function(_0x44b65c,_0x485349){return db[_0x0eee('0x2c')]['find']({'where':{'id':_0x44b65c['params']['id']}})[_0x0eee('0x27')](handleEntityNotFound(_0x485349,null))[_0x0eee('0x27')](removeEntity(_0x485349,null))[_0x0eee('0x42')](handleError(_0x485349,null));};exports[_0x0eee('0x49')]=function(_0x53b035,_0x38c178){return db[_0x0eee('0x2c')][_0x0eee('0x49')]()[_0x0eee('0x27')](respondWithResult(_0x38c178,null))[_0x0eee('0x42')](handleError(_0x38c178,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index d525229..acd35cf 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 _0x2e85=['rimraf','../../config/environment','exports','define','utf8mb4','utf8mb4_unicode_ci','util','bluebird','request-promise','path'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x2e85,0xc4));var _0x52e8=function(_0x55f746,_0x485fd0){_0x55f746=_0x55f746-0x0;var _0x519cc4=_0x2e85[_0x55f746];return _0x519cc4;};'use strict';var _=require('lodash');var util=require(_0x52e8('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x52e8('0x1'));var rp=require(_0x52e8('0x2'));var fs=require('fs');var path=require(_0x52e8('0x3'));var rimraf=require(_0x52e8('0x4'));var config=require(_0x52e8('0x5'));var attributes=require('./chatOfflineMessage.attributes');module[_0x52e8('0x6')]=function(_0x4f5017,_0x243274){return _0x4f5017[_0x52e8('0x7')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x52e8('0x8'),'collate':_0x52e8('0x9')});}; \ No newline at end of file +var _0x1d10=['rimraf','../../config/environment','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3d1d82,_0x4fb643){var _0x5e96bb=function(_0xbd598b){while(--_0xbd598b){_0x3d1d82['push'](_0x3d1d82['shift']());}};_0x5e96bb(++_0x4fb643);}(_0x1d10,0x133));var _0x01d1=function(_0x8c89f6,_0x4934c7){_0x8c89f6=_0x8c89f6-0x0;var _0x158424=_0x1d10[_0x8c89f6];return _0x158424;};'use strict';var _=require(_0x01d1('0x0'));var util=require(_0x01d1('0x1'));var logger=require(_0x01d1('0x2'))(_0x01d1('0x3'));var moment=require(_0x01d1('0x4'));var BPromise=require(_0x01d1('0x5'));var rp=require(_0x01d1('0x6'));var fs=require('fs');var path=require(_0x01d1('0x7'));var rimraf=require(_0x01d1('0x8'));var config=require(_0x01d1('0x9'));var attributes=require(_0x01d1('0xa'));module['exports']=function(_0x43fe94,_0x4de5e9){return _0x43fe94[_0x01d1('0xb')](_0x01d1('0xc'),attributes,{'tableName':_0x01d1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x01d1('0xe')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 1fd3c36..67e5010 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 _0x009a=['stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x38960a,_0x555254){var _0x2495e1=function(_0xc319e5){while(--_0xc319e5){_0x38960a['push'](_0x38960a['shift']());}};_0x2495e1(++_0x555254);}(_0x009a,0x16c));var _0xa009=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x009a[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require(_0xa009('0x0'));var util=require(_0xa009('0x1'));var moment=require(_0xa009('0x2'));var BPromise=require(_0xa009('0x3'));var rs=require(_0xa009('0x4'));var fs=require('fs');var Redis=require(_0xa009('0x5'));var db=require(_0xa009('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa009('0x7'))(_0xa009('0x8'));var config=require(_0xa009('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa009('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1eb32b,_0x3104bd,_0x29f978){return new BPromise(function(_0x5270a9,_0x1192e7){return client['request'](_0x1eb32b,_0x29f978)[_0xa009('0xb')](function(_0x1649eb){logger[_0xa009('0xc')](_0xa009('0xd'),_0x3104bd,_0xa009('0xe'));logger['debug'](_0xa009('0xf'),_0x3104bd,_0xa009('0xe'),JSON[_0xa009('0x10')](_0x1649eb));if(_0x1649eb['error']){if(_0x1649eb[_0xa009('0x11')][_0xa009('0x12')]===0x1f4){logger[_0xa009('0x11')](_0xa009('0xd'),_0x3104bd,_0x1649eb[_0xa009('0x11')][_0xa009('0x13')]);return _0x1192e7(_0x1649eb[_0xa009('0x11')][_0xa009('0x13')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3104bd,_0x1649eb[_0xa009('0x11')][_0xa009('0x13')]);return _0x5270a9(_0x1649eb[_0xa009('0x11')][_0xa009('0x13')]);}else{logger[_0xa009('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3104bd,_0xa009('0xe'));_0x5270a9(_0x1649eb['result'][_0xa009('0x13')]);}})['catch'](function(_0x330852){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3104bd,_0x330852);_0x1192e7(_0x330852);});});} \ No newline at end of file +var _0x4277=['ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info'];(function(_0x34ca55,_0x4f48c9){var _0x39ea16=function(_0x222237){while(--_0x222237){_0x34ca55['push'](_0x34ca55['shift']());}};_0x39ea16(++_0x4f48c9);}(_0x4277,0x125));var _0x7427=function(_0x20dfec,_0x1de109){_0x20dfec=_0x20dfec-0x0;var _0xac7287=_0x4277[_0x20dfec];return _0xac7287;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7427('0x0'));var BPromise=require('bluebird');var rs=require(_0x7427('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7427('0x2'))['db'];var utils=require(_0x7427('0x3'));var logger=require(_0x7427('0x4'))(_0x7427('0x5'));var config=require('../../config/environment');var jayson=require(_0x7427('0x6'));var client=jayson[_0x7427('0x7')][_0x7427('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x138130,_0x280789,_0x3bd454){return new BPromise(function(_0x2778ff,_0x3526d5){return client['request'](_0x138130,_0x3bd454)[_0x7427('0x9')](function(_0xd4a9c2){logger[_0x7427('0xa')](_0x7427('0xb'),_0x280789,_0x7427('0xc'));logger[_0x7427('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x280789,'request\x20sent',JSON['stringify'](_0xd4a9c2));if(_0xd4a9c2[_0x7427('0xe')]){if(_0xd4a9c2['error'][_0x7427('0xf')]===0x1f4){logger[_0x7427('0xe')](_0x7427('0xb'),_0x280789,_0xd4a9c2['error'][_0x7427('0x10')]);return _0x3526d5(_0xd4a9c2[_0x7427('0xe')][_0x7427('0x10')]);}logger[_0x7427('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x280789,_0xd4a9c2[_0x7427('0xe')][_0x7427('0x10')]);return _0x2778ff(_0xd4a9c2[_0x7427('0xe')][_0x7427('0x10')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x280789,_0x7427('0xc'));_0x2778ff(_0xd4a9c2[_0x7427('0x11')][_0x7427('0x10')]);}})[_0x7427('0x12')](function(_0x579bae){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x280789,_0x579bae);_0x3526d5(_0x579bae);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index ee6f326..3a1bf19 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 _0x0e35=['put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','describe','show','post','create'];(function(_0x529af9,_0x164b51){var _0x4d5f1b=function(_0x5b1a01){while(--_0x5b1a01){_0x529af9['push'](_0x529af9['shift']());}};_0x4d5f1b(++_0x164b51);}(_0x0e35,0xc2));var _0x50e3=function(_0x384b8d,_0x53c193){_0x384b8d=_0x384b8d-0x0;var _0x1217d0=_0x0e35[_0x384b8d];return _0x1217d0;};'use strict';var multer=require(_0x50e3('0x0'));var util=require(_0x50e3('0x1'));var path=require(_0x50e3('0x2'));var timeout=require(_0x50e3('0x3'));var express=require(_0x50e3('0x4'));var router=express[_0x50e3('0x5')]();var auth=require(_0x50e3('0x6'));var interaction=require(_0x50e3('0x7'));var config=require(_0x50e3('0x8'));var controller=require(_0x50e3('0x9'));router['get']('/',auth[_0x50e3('0xa')](),controller[_0x50e3('0xb')]);router['get']('/describe',auth[_0x50e3('0xa')](),controller[_0x50e3('0xc')]);router['get']('/:id',auth[_0x50e3('0xa')](),controller[_0x50e3('0xd')]);router[_0x50e3('0xe')]('/',auth[_0x50e3('0xa')](),controller[_0x50e3('0xf')]);router[_0x50e3('0x10')](_0x50e3('0x11'),auth[_0x50e3('0xa')](),controller[_0x50e3('0x12')]);router[_0x50e3('0x13')](_0x50e3('0x11'),auth[_0x50e3('0xa')](),controller[_0x50e3('0x14')]);module['exports']=router; \ No newline at end of file +var _0x3248=['show','post','put','/:id','update','delete','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','/describe','describe','get'];(function(_0x2c13d7,_0x74e2d2){var _0x1eb7b2=function(_0x1d27be){while(--_0x1d27be){_0x2c13d7['push'](_0x2c13d7['shift']());}};_0x1eb7b2(++_0x74e2d2);}(_0x3248,0x1bc));var _0x8324=function(_0x3a31ad,_0x55cbff){_0x3a31ad=_0x3a31ad-0x0;var _0x50a8d0=_0x3248[_0x3a31ad];return _0x50a8d0;};'use strict';var multer=require('multer');var util=require(_0x8324('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8324('0x1'));var router=express[_0x8324('0x2')]();var auth=require(_0x8324('0x3'));var interaction=require(_0x8324('0x4'));var config=require(_0x8324('0x5'));var controller=require(_0x8324('0x6'));router['get']('/',auth[_0x8324('0x7')](),controller[_0x8324('0x8')]);router['get'](_0x8324('0x9'),auth[_0x8324('0x7')](),controller[_0x8324('0xa')]);router[_0x8324('0xb')]('/:id',auth[_0x8324('0x7')](),controller[_0x8324('0xc')]);router[_0x8324('0xd')]('/',auth[_0x8324('0x7')](),controller['create']);router[_0x8324('0xe')](_0x8324('0xf'),auth['isAuthenticated'](),controller[_0x8324('0x10')]);router[_0x8324('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x8324('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 21ee493..26d728c 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 _0xb18e=['STRING','ENUM','mouseOver','sequelize','exports'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0xb18e,0x67));var _0xeb18=function(_0x11e05d,_0x3a4491){_0x11e05d=_0x11e05d-0x0;var _0x335588=_0xb18e[_0x11e05d];return _0x335588;};'use strict';var Sequelize=require(_0xeb18('0x0'));module[_0xeb18('0x1')]={'name':{'type':Sequelize[_0xeb18('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xeb18('0x3')](_0xeb18('0x4'),'timeout'),'defaultValue':_0xeb18('0x4')},'selector':{'type':Sequelize[_0xeb18('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xca2c=['ENUM','mouseOver','sequelize','exports','STRING'];(function(_0x454017,_0x4c2948){var _0x22d946=function(_0x3b9da6){while(--_0x3b9da6){_0x454017['push'](_0x454017['shift']());}};_0x22d946(++_0x4c2948);}(_0xca2c,0x93));var _0xcca2=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xca2c[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0xcca2('0x0'));module[_0xcca2('0x1')]={'name':{'type':Sequelize[_0xcca2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xcca2('0x3')]('mouseOver','timeout'),'defaultValue':_0xcca2('0x4')},'selector':{'type':Sequelize[_0xcca2('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index fbaf20d..b6e37c3 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 _0x75d7=['../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','show','params','model','ChatProactiveAction','rawAttributes','query','keys','filters','attributes','fields','length','includeAll','options','catch','create','body','find','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x101125,_0x2c5953){var _0x40f6b0=function(_0x58a6fc){while(--_0x58a6fc){_0x101125['push'](_0x101125['shift']());}};_0x40f6b0(++_0x2c5953);}(_0x75d7,0x18f));var _0x775d=function(_0x5f1cf8,_0x5e0923){_0x5f1cf8=_0x5f1cf8-0x0;var _0x27d0fa=_0x75d7[_0x5f1cf8];return _0x27d0fa;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x775d('0x0'));var rimraf=require(_0x775d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x775d('0x2'));var rp=require(_0x775d('0x3'));var moment=require(_0x775d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x775d('0x5'));var util=require('util');var path=require(_0x775d('0x6'));var sox=require('sox');var csv=require(_0x775d('0x7'));var ejs=require(_0x775d('0x8'));var fs=require('fs');var _=require(_0x775d('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x775d('0xa'));var toCsv=require(_0x775d('0x7'));var querystring=require('querystring');var Papa=require(_0x775d('0xb'));var Redis=require('ioredis');var authService=require(_0x775d('0xc'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x775d('0xd'));var logger=require(_0x775d('0xe'))(_0x775d('0xf'));var utils=require(_0x775d('0x10'));var config=require(_0x775d('0x11'));var db=require(_0x775d('0x12'))['db'];function respondWithStatusCode(_0x2e5bc9,_0x53ae9c){_0x53ae9c=_0x53ae9c||0xcc;return function(_0x24cff4){if(_0x24cff4){return _0x2e5bc9[_0x775d('0x13')](_0x53ae9c);}return _0x2e5bc9['status'](_0x53ae9c)[_0x775d('0x14')]();};}function respondWithResult(_0x13f810,_0x54210f){_0x54210f=_0x54210f||0xc8;return function(_0x592668){if(_0x592668){return _0x13f810[_0x775d('0x15')](_0x54210f)[_0x775d('0x16')](_0x592668);}};}function respondWithFilteredResult(_0x25c4d0,_0x50af99){return function(_0x2d2dd5){if(_0x2d2dd5){var _0x58fde9=_0x2d2dd5[_0x775d('0x17')],_0x386d37=_0x50af99[_0x775d('0x18')],_0x2d0065=_0x50af99[_0x775d('0x18')]+_0x50af99['limit'],_0x205ad6;if(_0x2d0065>=_0x58fde9){_0x2d0065=_0x58fde9;_0x205ad6=0xc8;}else{_0x205ad6=0xce;}_0x25c4d0['status'](_0x205ad6);return _0x25c4d0[_0x775d('0x19')](_0x775d('0x1a'),_0x386d37+'-'+_0x2d0065+'/'+_0x58fde9)['json'](_0x2d2dd5);}return null;};}function patchUpdates(_0x3f955c){return function(_0x30bd73){try{jsonpatch[_0x775d('0x1b')](_0x30bd73,_0x3f955c,!![]);}catch(_0x2bf1ef){return BPromise[_0x775d('0x1c')](_0x2bf1ef);}return _0x30bd73[_0x775d('0x1d')]();};}function saveUpdates(_0x49eb74,_0x480557){return function(_0xd7c77c){if(_0xd7c77c){return _0xd7c77c[_0x775d('0x1e')](_0x49eb74)[_0x775d('0x1f')](function(_0x46a6af){return _0x46a6af;});}return null;};}function removeEntity(_0x2b253b,_0xdb9a5d){return function(_0x54e402){if(_0x54e402){return _0x54e402['destroy']()[_0x775d('0x1f')](function(){_0x2b253b[_0x775d('0x15')](0xcc)[_0x775d('0x14')]();});}};}function handleEntityNotFound(_0x3b332d,_0x338264){return function(_0x371ef7){if(!_0x371ef7){_0x3b332d[_0x775d('0x13')](0x194);}return _0x371ef7;};}function handleError(_0x2e026a,_0x1d8ced){_0x1d8ced=_0x1d8ced||0x1f4;return function(_0x5c50f3){logger['error'](_0x5c50f3[_0x775d('0x20')]);if(_0x5c50f3[_0x775d('0x21')]){delete _0x5c50f3[_0x775d('0x21')];}_0x2e026a[_0x775d('0x15')](_0x1d8ced)['send'](_0x5c50f3);};}exports[_0x775d('0x22')]=function(_0x229606,_0x3a544c){var _0x2d7cda={'raw':!![],'where':{'id':_0x229606[_0x775d('0x23')]['id']}},_0x4342bd={};_0x4342bd[_0x775d('0x24')]=_['keys'](db[_0x775d('0x25')][_0x775d('0x26')]);_0x4342bd[_0x775d('0x27')]=_[_0x775d('0x28')](_0x229606['query']);_0x4342bd[_0x775d('0x29')]=_['intersection'](_0x4342bd['model'],_0x4342bd['query']);_0x2d7cda[_0x775d('0x2a')]=_['intersection'](_0x4342bd[_0x775d('0x24')],qs['fields'](_0x229606[_0x775d('0x27')][_0x775d('0x2b')]));_0x2d7cda[_0x775d('0x2a')]=_0x2d7cda[_0x775d('0x2a')][_0x775d('0x2c')]?_0x2d7cda['attributes']:_0x4342bd[_0x775d('0x24')];if(_0x229606[_0x775d('0x27')][_0x775d('0x2d')]){_0x2d7cda['include']=[{'all':!![]}];}_0x2d7cda=_['merge']({},_0x2d7cda,_0x229606[_0x775d('0x2e')]);return db[_0x775d('0x25')]['find'](_0x2d7cda)[_0x775d('0x1f')](handleEntityNotFound(_0x3a544c,null))[_0x775d('0x1f')](respondWithResult(_0x3a544c,null))[_0x775d('0x2f')](handleError(_0x3a544c,null));};exports[_0x775d('0x30')]=function(_0x3c8297,_0x4336aa){return db[_0x775d('0x25')][_0x775d('0x30')](_0x3c8297['body'],{})[_0x775d('0x1f')](respondWithResult(_0x4336aa,0xc9))[_0x775d('0x2f')](handleError(_0x4336aa,null));};exports['update']=function(_0x9615ec,_0x50b1af){if(_0x9615ec['body']['id']){delete _0x9615ec[_0x775d('0x31')]['id'];}return db[_0x775d('0x25')][_0x775d('0x32')]({'where':{'id':_0x9615ec['params']['id']}})['then'](handleEntityNotFound(_0x50b1af,null))[_0x775d('0x1f')](saveUpdates(_0x9615ec[_0x775d('0x31')],null))[_0x775d('0x1f')](respondWithResult(_0x50b1af,null))['catch'](handleError(_0x50b1af,null));};exports[_0x775d('0x33')]=function(_0x32dec6,_0x3eb658){return db[_0x775d('0x25')][_0x775d('0x32')]({'where':{'id':_0x32dec6['params']['id']}})['then'](handleEntityNotFound(_0x3eb658,null))['then'](removeEntity(_0x3eb658,null))['catch'](handleError(_0x3eb658,null));}; \ No newline at end of file +var _0x1d15=['request-promise','moment','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','update','then','end','error','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','merge','catch','create','body','find','params','destroy','eml-format','zip-dir','fast-json-patch'];(function(_0x5af9b8,_0x2655f1){var _0x315e09=function(_0xe78853){while(--_0xe78853){_0x5af9b8['push'](_0x5af9b8['shift']());}};_0x315e09(++_0x2655f1);}(_0x1d15,0x1bd));var _0x51d1=function(_0x508e1a,_0x4e6318){_0x508e1a=_0x508e1a-0x0;var _0x3e23c0=_0x1d15[_0x508e1a];return _0x3e23c0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x51d1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x51d1('0x1'));var jsonpatch=require(_0x51d1('0x2'));var rp=require(_0x51d1('0x3'));var moment=require(_0x51d1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x51d1('0x5'));var util=require('util');var path=require(_0x51d1('0x6'));var sox=require('sox');var csv=require(_0x51d1('0x7'));var ejs=require(_0x51d1('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x51d1('0x9'));var crypto=require(_0x51d1('0xa'));var jsforce=require(_0x51d1('0xb'));var deskjs=require(_0x51d1('0xc'));var toCsv=require(_0x51d1('0x7'));var querystring=require(_0x51d1('0xd'));var Papa=require(_0x51d1('0xe'));var Redis=require('ioredis');var authService=require(_0x51d1('0xf'));var qs=require(_0x51d1('0x10'));var hardwareService=require(_0x51d1('0x11'));var logger=require(_0x51d1('0x12'))(_0x51d1('0x13'));var utils=require(_0x51d1('0x14'));var config=require('../../config/environment');var db=require(_0x51d1('0x15'))['db'];function respondWithStatusCode(_0x411e47,_0x4a9e13){_0x4a9e13=_0x4a9e13||0xcc;return function(_0x179e66){if(_0x179e66){return _0x411e47[_0x51d1('0x16')](_0x4a9e13);}return _0x411e47[_0x51d1('0x17')](_0x4a9e13)['end']();};}function respondWithResult(_0x47ca12,_0x185a31){_0x185a31=_0x185a31||0xc8;return function(_0x3ede8c){if(_0x3ede8c){return _0x47ca12[_0x51d1('0x17')](_0x185a31)['json'](_0x3ede8c);}};}function respondWithFilteredResult(_0x39c3e3,_0x50a6ed){return function(_0x4f99cf){if(_0x4f99cf){var _0x1ac473=_0x4f99cf[_0x51d1('0x18')],_0x410c29=_0x50a6ed[_0x51d1('0x19')],_0x332d98=_0x50a6ed[_0x51d1('0x19')]+_0x50a6ed['limit'],_0x4e9d63;if(_0x332d98>=_0x1ac473){_0x332d98=_0x1ac473;_0x4e9d63=0xc8;}else{_0x4e9d63=0xce;}_0x39c3e3[_0x51d1('0x17')](_0x4e9d63);return _0x39c3e3[_0x51d1('0x1a')](_0x51d1('0x1b'),_0x410c29+'-'+_0x332d98+'/'+_0x1ac473)[_0x51d1('0x1c')](_0x4f99cf);}return null;};}function patchUpdates(_0x1e6acb){return function(_0x34c8c8){try{jsonpatch[_0x51d1('0x1d')](_0x34c8c8,_0x1e6acb,!![]);}catch(_0x5b3748){return BPromise[_0x51d1('0x1e')](_0x5b3748);}return _0x34c8c8[_0x51d1('0x1f')]();};}function saveUpdates(_0x1163f2,_0x14183b){return function(_0x12a7f7){if(_0x12a7f7){return _0x12a7f7[_0x51d1('0x20')](_0x1163f2)['then'](function(_0x1a4ba4){return _0x1a4ba4;});}return null;};}function removeEntity(_0x346374,_0x4079ca){return function(_0x28f5f4){if(_0x28f5f4){return _0x28f5f4['destroy']()[_0x51d1('0x21')](function(){_0x346374['status'](0xcc)[_0x51d1('0x22')]();});}};}function handleEntityNotFound(_0x4006d0,_0x2a2dcf){return function(_0x387624){if(!_0x387624){_0x4006d0[_0x51d1('0x16')](0x194);}return _0x387624;};}function handleError(_0x19833e,_0x2c63b7){_0x2c63b7=_0x2c63b7||0x1f4;return function(_0x46e8f3){logger[_0x51d1('0x23')](_0x46e8f3['stack']);if(_0x46e8f3[_0x51d1('0x24')]){delete _0x46e8f3['name'];}_0x19833e[_0x51d1('0x17')](_0x2c63b7)[_0x51d1('0x25')](_0x46e8f3);};}exports[_0x51d1('0x26')]=function(_0x1df125,_0xdb7b35){var _0x5c6c57={'raw':!![],'where':{'id':_0x1df125['params']['id']}},_0x5bd77b={};_0x5bd77b[_0x51d1('0x27')]=_[_0x51d1('0x28')](db[_0x51d1('0x29')][_0x51d1('0x2a')]);_0x5bd77b[_0x51d1('0x2b')]=_['keys'](_0x1df125[_0x51d1('0x2b')]);_0x5bd77b[_0x51d1('0x2c')]=_[_0x51d1('0x2d')](_0x5bd77b[_0x51d1('0x27')],_0x5bd77b['query']);_0x5c6c57[_0x51d1('0x2e')]=_[_0x51d1('0x2d')](_0x5bd77b[_0x51d1('0x27')],qs['fields'](_0x1df125['query'][_0x51d1('0x2f')]));_0x5c6c57[_0x51d1('0x2e')]=_0x5c6c57[_0x51d1('0x2e')][_0x51d1('0x30')]?_0x5c6c57['attributes']:_0x5bd77b[_0x51d1('0x27')];if(_0x1df125[_0x51d1('0x2b')]['includeAll']){_0x5c6c57['include']=[{'all':!![]}];}_0x5c6c57=_[_0x51d1('0x31')]({},_0x5c6c57,_0x1df125['options']);return db[_0x51d1('0x29')]['find'](_0x5c6c57)[_0x51d1('0x21')](handleEntityNotFound(_0xdb7b35,null))['then'](respondWithResult(_0xdb7b35,null))[_0x51d1('0x32')](handleError(_0xdb7b35,null));};exports[_0x51d1('0x33')]=function(_0x43fe89,_0x24a964){return db[_0x51d1('0x29')][_0x51d1('0x33')](_0x43fe89[_0x51d1('0x34')],{})[_0x51d1('0x21')](respondWithResult(_0x24a964,0xc9))[_0x51d1('0x32')](handleError(_0x24a964,null));};exports[_0x51d1('0x20')]=function(_0x3e0ba9,_0x269a07){if(_0x3e0ba9[_0x51d1('0x34')]['id']){delete _0x3e0ba9['body']['id'];}return db[_0x51d1('0x29')][_0x51d1('0x35')]({'where':{'id':_0x3e0ba9[_0x51d1('0x36')]['id']}})['then'](handleEntityNotFound(_0x269a07,null))[_0x51d1('0x21')](saveUpdates(_0x3e0ba9['body'],null))[_0x51d1('0x21')](respondWithResult(_0x269a07,null))[_0x51d1('0x32')](handleError(_0x269a07,null));};exports[_0x51d1('0x37')]=function(_0x385677,_0x12e5a3){return db['ChatProactiveAction'][_0x51d1('0x35')]({'where':{'id':_0x385677[_0x51d1('0x36')]['id']}})['then'](handleEntityNotFound(_0x12e5a3,null))[_0x51d1('0x21')](removeEntity(_0x12e5a3,null))['catch'](handleError(_0x12e5a3,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 1078253..7f59b28 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 _0x1c82=['bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment'];(function(_0x431e03,_0x4c7e17){var _0x3c2535=function(_0x47de0c){while(--_0x47de0c){_0x431e03['push'](_0x431e03['shift']());}};_0x3c2535(++_0x4c7e17);}(_0x1c82,0x1bd));var _0x21c8=function(_0x5438ad,_0x284215){_0x5438ad=_0x5438ad-0x0;var _0x3faae6=_0x1c82[_0x5438ad];return _0x3faae6;};'use strict';var _=require(_0x21c8('0x0'));var util=require(_0x21c8('0x1'));var logger=require(_0x21c8('0x2'))(_0x21c8('0x3'));var moment=require(_0x21c8('0x4'));var BPromise=require(_0x21c8('0x5'));var rp=require(_0x21c8('0x6'));var fs=require('fs');var path=require(_0x21c8('0x7'));var rimraf=require(_0x21c8('0x8'));var config=require(_0x21c8('0x9'));var attributes=require(_0x21c8('0xa'));module[_0x21c8('0xb')]=function(_0x24d5e9,_0x41a632){return _0x24d5e9[_0x21c8('0xc')](_0x21c8('0xd'),attributes,{'tableName':_0x21c8('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d2a=['../../config/environment','exports','define','ChatProactiveAction','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xc1c722,_0x1d5597){var _0x4fc48a=function(_0x1eb1fd){while(--_0x1eb1fd){_0xc1c722['push'](_0xc1c722['shift']());}};_0x4fc48a(++_0x1d5597);}(_0x4d2a,0x122));var _0xa4d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4d2a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa4d2('0x0'));var util=require(_0xa4d2('0x1'));var logger=require(_0xa4d2('0x2'))(_0xa4d2('0x3'));var moment=require(_0xa4d2('0x4'));var BPromise=require(_0xa4d2('0x5'));var rp=require(_0xa4d2('0x6'));var fs=require('fs');var path=require(_0xa4d2('0x7'));var rimraf=require(_0xa4d2('0x8'));var config=require(_0xa4d2('0x9'));var attributes=require('./chatProactiveAction.attributes');module[_0xa4d2('0xa')]=function(_0x1bac64,_0x506760){return _0x1bac64[_0xa4d2('0xb')](_0xa4d2('0xc'),attributes,{'tableName':'chat_proactive_actions','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 60128dc..dd86168 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 _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(_0x10a61b,_0x273fbe){var _0x14a200=function(_0x7153bd){while(--_0x7153bd){_0x10a61b['push'](_0x10a61b['shift']());}};_0x14a200(++_0x273fbe);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 +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(_0x4d5a45,_0x8caef1){var _0x2f7d5c=function(_0x54194e){while(--_0x54194e){_0x4d5a45['push'](_0x4d5a45['shift']());}};_0x2f7d5c(++_0x8caef1);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 b8e6994..d074606 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 _0xdaa8=['multer','util','path','connect-timeout','get','/:id','isAuthenticated','put','update','delete','destroy','exports'];(function(_0x19d68d,_0x29e877){var _0xad7540=function(_0x58e389){while(--_0x58e389){_0x19d68d['push'](_0x19d68d['shift']());}};_0xad7540(++_0x29e877);}(_0xdaa8,0xe4));var _0x8daa=function(_0x3c526b,_0x1dd099){_0x3c526b=_0x3c526b-0x0;var _0x5060d9=_0xdaa8[_0x3c526b];return _0x5060d9;};'use strict';var multer=require(_0x8daa('0x0'));var util=require(_0x8daa('0x1'));var path=require(_0x8daa('0x2'));var timeout=require(_0x8daa('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0x8daa('0x4')](_0x8daa('0x5'),auth[_0x8daa('0x6')](),controller['show']);router['post']('/',auth[_0x8daa('0x6')](),controller['create']);router[_0x8daa('0x7')](_0x8daa('0x5'),auth[_0x8daa('0x6')](),controller[_0x8daa('0x8')]);router[_0x8daa('0x9')]('/:id',auth[_0x8daa('0x6')](),controller[_0x8daa('0xa')]);module[_0x8daa('0xb')]=router; \ No newline at end of file +var _0xf643=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create'];(function(_0x15386e,_0x1b787e){var _0x4304d6=function(_0x445fb4){while(--_0x445fb4){_0x15386e['push'](_0x15386e['shift']());}};_0x4304d6(++_0x1b787e);}(_0xf643,0x122));var _0x3f64=function(_0x1a55b1,_0x96ec8b){_0x1a55b1=_0x1a55b1-0x0;var _0x3ba4b0=_0xf643[_0x1a55b1];return _0x3ba4b0;};'use strict';var multer=require(_0x3f64('0x0'));var util=require(_0x3f64('0x1'));var path=require(_0x3f64('0x2'));var timeout=require(_0x3f64('0x3'));var express=require('express');var router=express[_0x3f64('0x4')]();var auth=require(_0x3f64('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3f64('0x6'));var controller=require(_0x3f64('0x7'));router[_0x3f64('0x8')](_0x3f64('0x9'),auth[_0x3f64('0xa')](),controller[_0x3f64('0xb')]);router[_0x3f64('0xc')]('/',auth[_0x3f64('0xa')](),controller[_0x3f64('0xd')]);router[_0x3f64('0xe')](_0x3f64('0x9'),auth[_0x3f64('0xa')](),controller[_0x3f64('0xf')]);router[_0x3f64('0x10')](_0x3f64('0x9'),auth['isAuthenticated'](),controller[_0x3f64('0x11')]);module[_0x3f64('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 95cd02a..6d1889e 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 _0x1212=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','name'];(function(_0x3cc237,_0x34a581){var _0x4e1cfc=function(_0x3864dc){while(--_0x3864dc){_0x3cc237['push'](_0x3cc237['shift']());}};_0x4e1cfc(++_0x34a581);}(_0x1212,0x1a3));var _0x2121=function(_0x598b37,_0x39e238){_0x598b37=_0x598b37-0x0;var _0x344326=_0x1212[_0x598b37];return _0x344326;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x2121('0x0'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2121('0x1')]},'timeout':{'type':Sequelize[_0x2121('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2121('0x3')](_0x2121('0x4'),_0x2121('0x5'),_0x2121('0x6'))}}; \ No newline at end of file +var _0x9ee9=['STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports'];(function(_0x5e92c2,_0xf93f76){var _0x36576d=function(_0xb4b1e){while(--_0xb4b1e){_0x5e92c2['push'](_0x5e92c2['shift']());}};_0x36576d(++_0xf93f76);}(_0x9ee9,0x76));var _0x99ee=function(_0x5c3d42,_0x87e49a){_0x5c3d42=_0x5c3d42-0x0;var _0x270ca3=_0x9ee9[_0x5c3d42];return _0x270ca3;};'use strict';var Sequelize=require(_0x99ee('0x0'));module[_0x99ee('0x1')]={'name':{'type':Sequelize[_0x99ee('0x2')],'unique':_0x99ee('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x99ee('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x99ee('0x5')](_0x99ee('0x6'),'beepall',_0x99ee('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 43db47c..18eb4eb 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 _0x3642=['create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','UserChatQueue','ChatQueueId','map','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','teams','Team','User','online','voicePause','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','includes','all','union','compact','removeAgents','userChatQueue:remove','addAgents','isArray','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./chatQueue.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','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','get','ChatQueues','UserProfileResource','destroy','stack','name','send','index','ChatQueue','rawAttributes','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','field','options','includeAll','include','findAll','rows','params','model','find'];(function(_0x2e2ce9,_0x39945f){var _0x30f2f6=function(_0x186959){while(--_0x186959){_0x2e2ce9['push'](_0x2e2ce9['shift']());}};_0x30f2f6(++_0x39945f);}(_0x3642,0xc5));var _0x2364=function(_0x21ecc8,_0x2bdead){_0x21ecc8=_0x21ecc8-0x0;var _0x510c1d=_0x3642[_0x21ecc8];return _0x510c1d;};'use strict';var pdf=require(_0x2364('0x0'));var emlformat=require(_0x2364('0x1'));var rimraf=require(_0x2364('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2364('0x3'));var rp=require('request-promise');var moment=require(_0x2364('0x4'));var BPromise=require(_0x2364('0x5'));var Mustache=require('mustache');var util=require(_0x2364('0x6'));var path=require(_0x2364('0x7'));var sox=require('sox');var csv=require(_0x2364('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2364('0x9'));var squel=require('squel');var crypto=require(_0x2364('0xa'));var jsforce=require(_0x2364('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2364('0x8'));var querystring=require(_0x2364('0xc'));var Papa=require(_0x2364('0xd'));var Redis=require(_0x2364('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2364('0xf'));var hardwareService=require(_0x2364('0x10'));var logger=require(_0x2364('0x11'))(_0x2364('0x12'));var utils=require(_0x2364('0x13'));var config=require(_0x2364('0x14'));var db=require(_0x2364('0x15'))['db'];config[_0x2364('0x16')]=_['defaults'](config[_0x2364('0x16')],{'host':_0x2364('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2364('0x16')]));require(_0x2364('0x18'))[_0x2364('0x19')](socket);var jayson=require(_0x2364('0x1a'));var client=jayson[_0x2364('0x1b')][_0x2364('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x4a05c9,_0x222e15,_0x280f0a){if(_0x280f0a){var _0x20f84a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20f84a[_0x2364('0x1d')](_0x222e15)){return _0x4a05c9;}else{throw new Error(_0x2364('0x1e'));}}else{return _0x4a05c9;}}function respondWithRpcPromise(_0x44188c,_0x560d45,_0x2deb32,_0x6cb205){return new BPromise(function(_0x564ada,_0x1962cc){var _0x5c506f=_0x6cb205||client;return _0x5c506f[_0x2364('0x1f')](_0x44188c,_0x2deb32)[_0x2364('0x20')](function(_0x3ede6a){logger['info'](_0x2364('0x21'),_0x560d45,_0x2364('0x22'));logger['debug'](_0x2364('0x23'),_0x560d45,_0x2364('0x22'),JSON[_0x2364('0x24')](_0x3ede6a));if(_0x3ede6a[_0x2364('0x25')]){if(_0x3ede6a[_0x2364('0x25')][_0x2364('0x26')]===0x1f4){logger[_0x2364('0x25')](_0x2364('0x21'),_0x560d45,_0x3ede6a[_0x2364('0x25')]['message']);return _0x1962cc(_0x3ede6a['error'][_0x2364('0x27')]);}logger['error'](_0x2364('0x21'),_0x560d45,_0x3ede6a[_0x2364('0x25')][_0x2364('0x27')]);return _0x564ada(_0x3ede6a[_0x2364('0x25')][_0x2364('0x27')]);}else{logger[_0x2364('0x28')](_0x2364('0x21'),_0x560d45,_0x2364('0x22'));_0x564ada(_0x3ede6a['result'][_0x2364('0x27')]);}})[_0x2364('0x29')](function(_0x4d01e7){logger[_0x2364('0x25')]('ChatQueue,\x20%s,\x20%s',_0x560d45,_0x4d01e7);_0x1962cc(_0x4d01e7);});});}function respondWithStatusCode(_0x2c7d7b,_0x56f1a5){_0x56f1a5=_0x56f1a5||0xcc;return function(_0x2e630a){if(_0x2e630a){return _0x2c7d7b[_0x2364('0x2a')](_0x56f1a5);}return _0x2c7d7b[_0x2364('0x2b')](_0x56f1a5)[_0x2364('0x2c')]();};}function respondWithResult(_0x5e2d99,_0x3f205f){_0x3f205f=_0x3f205f||0xc8;return function(_0x640f36){if(_0x640f36){return _0x5e2d99[_0x2364('0x2b')](_0x3f205f)[_0x2364('0x2d')](_0x640f36);}};}function respondWithFilteredResult(_0x89cc8d,_0x37a8c2){return function(_0x8e3279){if(_0x8e3279){var _0x45587f=_0x8e3279[_0x2364('0x2e')],_0x3a99e7=_0x37a8c2[_0x2364('0x2f')],_0x5ac687=_0x37a8c2[_0x2364('0x2f')]+_0x37a8c2[_0x2364('0x30')],_0x19b8b;if(_0x5ac687>=_0x45587f){_0x5ac687=_0x45587f;_0x19b8b=0xc8;}else{_0x19b8b=0xce;}_0x89cc8d[_0x2364('0x2b')](_0x19b8b);return _0x89cc8d[_0x2364('0x31')](_0x2364('0x32'),_0x3a99e7+'-'+_0x5ac687+'/'+_0x45587f)[_0x2364('0x2d')](_0x8e3279);}return null;};}function patchUpdates(_0x46966e){return function(_0x4fad46){try{jsonpatch['apply'](_0x4fad46,_0x46966e,!![]);}catch(_0x286dc1){return BPromise[_0x2364('0x33')](_0x286dc1);}return _0x4fad46[_0x2364('0x34')]();};}function saveUpdates(_0x302e57,_0x430a8c){return function(_0x13edc0){if(_0x13edc0){return _0x13edc0['update'](_0x302e57)[_0x2364('0x20')](function(_0x4a4e3b){return _0x4a4e3b;});}return null;};}function removeEntity(_0x15eb2b,_0x44a379){return function(_0x6f0021){if(_0x6f0021){return _0x6f0021['destroy']()[_0x2364('0x20')](function(){var _0x137096=_0x6f0021[_0x2364('0x35')]({'plain':!![]});var _0x142cf8=_0x2364('0x36');return db[_0x2364('0x37')][_0x2364('0x38')]({'where':{'type':_0x142cf8,'resourceId':_0x137096['id']}})[_0x2364('0x20')](function(){return _0x6f0021;});})[_0x2364('0x20')](function(){_0x15eb2b['status'](0xcc)[_0x2364('0x2c')]();});}};}function handleEntityNotFound(_0x5db715,_0x46594d){return function(_0x1c8e0b){if(!_0x1c8e0b){_0x5db715[_0x2364('0x2a')](0x194);}return _0x1c8e0b;};}function handleError(_0x525215,_0x42d57e){_0x42d57e=_0x42d57e||0x1f4;return function(_0x4484c3){logger[_0x2364('0x25')](_0x4484c3[_0x2364('0x39')]);if(_0x4484c3[_0x2364('0x3a')]){delete _0x4484c3[_0x2364('0x3a')];}_0x525215[_0x2364('0x2b')](_0x42d57e)[_0x2364('0x3b')](_0x4484c3);};}exports[_0x2364('0x3c')]=function(_0x1bd5e1,_0x186431){var _0xbf8e53={},_0x10268a={},_0x16fe89={'count':0x0,'rows':[]};var _0x3828ea=db[_0x2364('0x3d')][_0x2364('0x3e')];_0x10268a['model']=_[_0x2364('0x3f')](_0x3828ea);_0x10268a['query']=_['keys'](_0x1bd5e1[_0x2364('0x40')]);_0x10268a[_0x2364('0x41')]=_[_0x2364('0x42')](_0x10268a['model'],_0x10268a[_0x2364('0x40')]);_0xbf8e53['attributes']=_[_0x2364('0x42')](_0x10268a['model'],qs[_0x2364('0x43')](_0x1bd5e1[_0x2364('0x40')]['fields']));_0xbf8e53[_0x2364('0x44')]=_0xbf8e53[_0x2364('0x44')][_0x2364('0x45')]?_0xbf8e53[_0x2364('0x44')]:_0x10268a['model'];if(!_0x1bd5e1[_0x2364('0x40')][_0x2364('0x46')](_0x2364('0x47'))){_0xbf8e53[_0x2364('0x30')]=qs[_0x2364('0x30')](_0x1bd5e1[_0x2364('0x40')]['limit']);_0xbf8e53[_0x2364('0x2f')]=qs[_0x2364('0x2f')](_0x1bd5e1['query']['offset']);}_0xbf8e53[_0x2364('0x48')]=qs[_0x2364('0x49')](_0x1bd5e1[_0x2364('0x40')][_0x2364('0x49')]);_0xbf8e53[_0x2364('0x4a')]=qs[_0x2364('0x41')](_[_0x2364('0x4b')](_0x1bd5e1['query'],_0x10268a['filters']));if(_0x1bd5e1[_0x2364('0x40')][_0x2364('0x4c')]){_0xbf8e53['where']=_[_0x2364('0x4d')](_0xbf8e53[_0x2364('0x4a')],{'$or':_['map'](_0x3828ea,function(_0x13b9c8){if(_0x13b9c8[_0x2364('0x4e')][_0x2364('0x4f')]!=='VIRTUAL'){var _0x3567fe={};_0x3567fe[_0x13b9c8[_0x2364('0x50')]]={'$like':'%'+_0x1bd5e1[_0x2364('0x40')][_0x2364('0x4c')]+'%'};return _0x3567fe;}})});}_0xbf8e53=_[_0x2364('0x4d')]({},_0xbf8e53,_0x1bd5e1[_0x2364('0x51')]);var _0xb0f22a={'where':_0xbf8e53[_0x2364('0x4a')]};return db[_0x2364('0x3d')][_0x2364('0x2e')](_0xb0f22a)[_0x2364('0x20')](function(_0x478f36){_0x16fe89[_0x2364('0x2e')]=_0x478f36;if(_0x1bd5e1[_0x2364('0x40')][_0x2364('0x52')]){_0xbf8e53[_0x2364('0x53')]=[{'all':!![]}];}return db['ChatQueue'][_0x2364('0x54')](_0xbf8e53);})[_0x2364('0x20')](function(_0x1da7c9){_0x16fe89[_0x2364('0x55')]=_0x1da7c9;return _0x16fe89;})['then'](respondWithFilteredResult(_0x186431,_0xbf8e53))[_0x2364('0x29')](handleError(_0x186431,null));};exports['show']=function(_0x293997,_0x4c3bb8){var _0x1596ab={'raw':!![],'where':{'id':_0x293997[_0x2364('0x56')]['id']}},_0x3acd35={};_0x3acd35[_0x2364('0x57')]=_['keys'](db['ChatQueue']['rawAttributes']);_0x3acd35['query']=_[_0x2364('0x3f')](_0x293997[_0x2364('0x40')]);_0x3acd35['filters']=_['intersection'](_0x3acd35[_0x2364('0x57')],_0x3acd35[_0x2364('0x40')]);_0x1596ab['attributes']=_['intersection'](_0x3acd35[_0x2364('0x57')],qs['fields'](_0x293997[_0x2364('0x40')]['fields']));_0x1596ab[_0x2364('0x44')]=_0x1596ab[_0x2364('0x44')][_0x2364('0x45')]?_0x1596ab[_0x2364('0x44')]:_0x3acd35[_0x2364('0x57')];if(_0x293997[_0x2364('0x40')][_0x2364('0x52')]){_0x1596ab[_0x2364('0x53')]=[{'all':!![]}];}_0x1596ab=_['merge']({},_0x1596ab,_0x293997[_0x2364('0x51')]);return db[_0x2364('0x3d')][_0x2364('0x58')](_0x1596ab)['then'](handleEntityNotFound(_0x4c3bb8,null))[_0x2364('0x20')](respondWithResult(_0x4c3bb8,null))[_0x2364('0x29')](handleError(_0x4c3bb8,null));};exports['create']=function(_0x1096f4,_0x3d4137){return db['ChatQueue'][_0x2364('0x59')](_0x1096f4[_0x2364('0x5a')],{})['then'](function(_0x26e727){var _0x358f78=_0x1096f4['user'][_0x2364('0x35')]({'plain':!![]});if(!_0x358f78)throw new Error(_0x2364('0x5b'));if(_0x358f78[_0x2364('0x5c')]==='user'){var _0x1522cb=_0x26e727['get']({'plain':!![]});var _0x402b52=_0x2364('0x36');return db[_0x2364('0x5d')][_0x2364('0x58')]({'where':{'name':_0x402b52,'userProfileId':_0x358f78[_0x2364('0x5e')]},'raw':!![]})[_0x2364('0x20')](function(_0x12dba1){if(_0x12dba1&&_0x12dba1['autoAssociation']===0x0){return db[_0x2364('0x37')][_0x2364('0x59')]({'name':_0x1522cb['name'],'resourceId':_0x1522cb['id'],'type':_0x12dba1[_0x2364('0x3a')],'sectionId':_0x12dba1['id']},{})['then'](function(){return _0x26e727;});}else{return _0x26e727;}})[_0x2364('0x29')](function(_0x31ed38){logger[_0x2364('0x25')](_0x2364('0x5f'),_0x31ed38);throw _0x31ed38;});}return _0x26e727;})[_0x2364('0x20')](respondWithResult(_0x3d4137,0xc9))[_0x2364('0x29')](handleError(_0x3d4137,null));};exports['update']=function(_0x39a9ae,_0x16ad9a){if(_0x39a9ae['body']['id']){delete _0x39a9ae[_0x2364('0x5a')]['id'];}return db['ChatQueue'][_0x2364('0x58')]({'where':{'id':_0x39a9ae[_0x2364('0x56')]['id']}})[_0x2364('0x20')](handleEntityNotFound(_0x16ad9a,null))[_0x2364('0x20')](saveUpdates(_0x39a9ae[_0x2364('0x5a')],null))[_0x2364('0x20')](respondWithResult(_0x16ad9a,null))[_0x2364('0x29')](handleError(_0x16ad9a,null));};exports[_0x2364('0x38')]=function(_0xa4b82c,_0x5a09ff){return db[_0x2364('0x3d')][_0x2364('0x58')]({'where':{'id':_0xa4b82c[_0x2364('0x56')]['id']}})[_0x2364('0x20')](handleEntityNotFound(_0x5a09ff,null))['then'](removeEntity(_0x5a09ff,null))[_0x2364('0x29')](handleError(_0x5a09ff,null));};exports['describe']=function(_0x35830c,_0x3c140c){return db[_0x2364('0x3d')]['describe']()[_0x2364('0x20')](respondWithResult(_0x3c140c,null))['catch'](handleError(_0x3c140c,null));};exports[_0x2364('0x60')]=function(_0x40dc40,_0x2a538c,_0x118500){var _0x3049fe={'raw':!![],'where':{}},_0x3a28b9={},_0x1839cd;return db[_0x2364('0x3d')]['findOne']({'where':{'id':_0x40dc40[_0x2364('0x56')]['id']}})[_0x2364('0x20')](handleEntityNotFound(_0x2a538c,null))[_0x2364('0x20')](function(_0x5c8e64){if(_0x5c8e64){_0x1839cd=_0x5c8e64[_0x2364('0x35')]({'plain':!![]});_0x3a28b9['model']=_[_0x2364('0x3f')](db[_0x2364('0x61')][_0x2364('0x3e')]);_0x3a28b9[_0x2364('0x40')]=_[_0x2364('0x3f')](_0x40dc40[_0x2364('0x40')]);_0x3a28b9[_0x2364('0x41')]=_['intersection'](_0x3a28b9[_0x2364('0x57')],_0x3a28b9['query']);_0x3049fe[_0x2364('0x44')]=_[_0x2364('0x42')](_0x3a28b9['model'],qs[_0x2364('0x43')](_0x40dc40[_0x2364('0x40')]['fields']));_0x3049fe[_0x2364('0x44')]=_0x3049fe[_0x2364('0x44')][_0x2364('0x45')]?_0x3049fe[_0x2364('0x44')]:_0x3a28b9[_0x2364('0x57')];if(!_0x40dc40[_0x2364('0x40')][_0x2364('0x46')](_0x2364('0x47'))){_0x3049fe[_0x2364('0x30')]=qs[_0x2364('0x30')](_0x40dc40[_0x2364('0x40')][_0x2364('0x30')]);_0x3049fe['offset']=qs[_0x2364('0x2f')](_0x40dc40[_0x2364('0x40')]['offset']);}_0x3049fe['order']=qs[_0x2364('0x49')](_0x40dc40[_0x2364('0x40')][_0x2364('0x49')]);_0x3049fe[_0x2364('0x4a')]=qs['filters'](_[_0x2364('0x4b')](_0x40dc40[_0x2364('0x40')],_0x3a28b9[_0x2364('0x41')]));_0x3049fe[_0x2364('0x4a')][_0x2364('0x62')]=_0x5c8e64['id'];if(_0x40dc40[_0x2364('0x40')][_0x2364('0x4c')]){_0x3049fe['where']=_[_0x2364('0x4d')](_0x3049fe['where'],{'$or':_[_0x2364('0x63')](_0x3049fe['attributes'],function(_0x3986eb){var _0x1df207={};_0x1df207[_0x3986eb]={'$like':'%'+_0x40dc40[_0x2364('0x40')]['filter']+'%'};return _0x1df207;})});}_0x3049fe=_['merge']({},_0x3049fe,_0x40dc40[_0x2364('0x51')]);return db[_0x2364('0x61')][_0x2364('0x54')](_0x3049fe);}})[_0x2364('0x20')](function(_0x5d860a){if(_0x5d860a){return db['User'][_0x2364('0x64')]({'where':{'id':_[_0x2364('0x63')](_0x5d860a,_0x2364('0x65')),'role':_0x2364('0x66')},'attributes':['id',_0x2364('0x3a'),_0x2364('0x67'),_0x2364('0x68'),_0x2364('0x69')]});}})[_0x2364('0x20')](function(_0x59ef5a){if(_0x59ef5a){return{'count':_0x59ef5a['count'],'rows':_[_0x2364('0x63')](_0x59ef5a['rows'],function(_0x333c5d){return{'membername':_0x333c5d[_0x2364('0x3a')],'UserId':_0x333c5d['id'],'queue_name':_0x1839cd['name'],'ChatQueueId':_0x1839cd['id'],'interface':util[_0x2364('0x6a')](_0x2364('0x6b'),'SIP',_0x333c5d['name']),'penalty':0x0,'paused':_0x333c5d[_0x2364('0x67')],'createdAt':_0x333c5d[_0x2364('0x69')],'updatedAt':_0x333c5d[_0x2364('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2364('0x20')](respondWithFilteredResult(_0x2a538c,_0x3049fe))[_0x2364('0x29')](handleError(_0x2a538c,null));};exports[_0x2364('0x6c')]=function(_0x364b0a,_0x31d5c6,_0xf05e98){var _0x3d3c01={};var _0x18ac9e={};var _0x527f48;var _0x2e31cf;return db[_0x2364('0x3d')][_0x2364('0x6d')]({'where':{'id':_0x364b0a[_0x2364('0x56')]['id']}})[_0x2364('0x20')](handleEntityNotFound(_0x31d5c6,null))[_0x2364('0x20')](function(_0x1cd0a7){if(_0x1cd0a7){_0x527f48=_0x1cd0a7;_0x18ac9e['model']=_[_0x2364('0x3f')](db['Team'][_0x2364('0x3e')]);_0x18ac9e['query']=_[_0x2364('0x3f')](_0x364b0a[_0x2364('0x40')]);_0x18ac9e['filters']=_[_0x2364('0x42')](_0x18ac9e[_0x2364('0x57')],_0x18ac9e[_0x2364('0x40')]);_0x3d3c01['attributes']=_[_0x2364('0x42')](_0x18ac9e[_0x2364('0x57')],qs['fields'](_0x364b0a['query'][_0x2364('0x43')]));_0x3d3c01[_0x2364('0x44')]=_0x3d3c01[_0x2364('0x44')][_0x2364('0x45')]?_0x3d3c01[_0x2364('0x44')]:_0x18ac9e['model'];_0x3d3c01[_0x2364('0x48')]=qs[_0x2364('0x49')](_0x364b0a[_0x2364('0x40')][_0x2364('0x49')]);_0x3d3c01[_0x2364('0x4a')]=qs[_0x2364('0x41')](_['pick'](_0x364b0a[_0x2364('0x40')],_0x18ac9e[_0x2364('0x41')]));if(_0x364b0a['query']['filter']){_0x3d3c01[_0x2364('0x4a')]=_[_0x2364('0x4d')](_0x3d3c01[_0x2364('0x4a')],{'$or':_[_0x2364('0x63')](_0x3d3c01['attributes'],function(_0x23adf6){var _0x27c1d7={};_0x27c1d7[_0x23adf6]={'$like':'%'+_0x364b0a[_0x2364('0x40')][_0x2364('0x4c')]+'%'};return _0x27c1d7;})});}_0x3d3c01=_[_0x2364('0x4d')]({},_0x3d3c01,_0x364b0a['options']);return _0x527f48[_0x2364('0x6c')](_0x3d3c01);}})[_0x2364('0x20')](function(_0x4ad70a){if(_0x4ad70a){_0x2e31cf=_0x4ad70a[_0x2364('0x45')];if(!_0x364b0a[_0x2364('0x40')][_0x2364('0x46')]('nolimit')){_0x3d3c01[_0x2364('0x30')]=qs[_0x2364('0x30')](_0x364b0a[_0x2364('0x40')][_0x2364('0x30')]);_0x3d3c01[_0x2364('0x2f')]=qs[_0x2364('0x2f')](_0x364b0a[_0x2364('0x40')][_0x2364('0x2f')]);}return _0x527f48[_0x2364('0x6c')](_0x3d3c01);}})[_0x2364('0x20')](function(_0x22159a){if(_0x22159a){return _0x22159a?{'count':_0x2e31cf,'rows':_0x22159a}:null;}})[_0x2364('0x20')](respondWithResult(_0x31d5c6,null))['catch'](handleError(_0x31d5c6,null));};exports['addTeams']=function(_0x3c7b4e,_0x2e9b61,_0x50d8cd){var _0x3900ec=_0x3c7b4e[_0x2364('0x5a')][_0x2364('0x6e')];return db[_0x2364('0x6f')]['findAll']({'where':{'id':_[_0x2364('0x63')](_0x3900ec,'id')},'attributes':['id'],'include':[{'model':db[_0x2364('0x70')],'as':'Agents','attributes':['id',_0x2364('0x3a'),_0x2364('0x71'),_0x2364('0x72'),'interface'],'raw':!![]}]})[_0x2364('0x20')](function(_0x142e5a){if(_0x142e5a){var _0x129031=_[_0x2364('0x73')](_0x142e5a,function(_0x2c15fa){var _0x31080c=_0x2c15fa[_0x2364('0x35')]({'plain':!![]});return _0x31080c[_0x2364('0x74')];});return db[_0x2364('0x3d')]['find']({'where':{'id':_0x3c7b4e[_0x2364('0x56')]['id']}})[_0x2364('0x20')](function(_0x4c0d42){return db[_0x2364('0x75')][_0x2364('0x76')](function(_0x4e584a){return _0x4c0d42['addTeams'](_[_0x2364('0x63')](_0x3900ec,'id'),{'transaction':_0x4e584a})[_0x2364('0x20')](function(){return BPromise[_0x2364('0x77')](_0x129031,function(_0x37bdb2){return db[_0x2364('0x61')][_0x2364('0x78')]({'where':{'UserId':_0x37bdb2['id'],'ChatQueueId':_0x3c7b4e[_0x2364('0x56')]['id']},'transaction':_0x4e584a});});})['then'](function(){_0x129031[_0x2364('0x79')](function(_0xb6ce83){socket[_0x2364('0x7a')](_0x2364('0x7b'),{'UserId':_0xb6ce83['id'],'ChatQueueId':_0x4c0d42['id']});});});});});}})[_0x2364('0x20')](respondWithStatusCode(_0x2e9b61,null))[_0x2364('0x29')](handleError(_0x2e9b61,null));};exports[_0x2364('0x7c')]=function(_0x1b1d39,_0x513bd7,_0x220584){return db[_0x2364('0x6f')][_0x2364('0x54')]({'where':{'id':_0x1b1d39['query'][_0x2364('0x7d')]},'attributes':['id'],'include':[{'model':db[_0x2364('0x70')],'as':_0x2364('0x74'),'attributes':['id'],'raw':!![]}]})[_0x2364('0x20')](handleEntityNotFound(_0x513bd7,null))[_0x2364('0x20')](function(_0x164757){var _0x4ea121=_[_0x2364('0x63')](_0x164757,'id');var _0x56a486=[];var _0x42268e=[];var _0x5493f5=squel['select']();_0x5493f5[_0x2364('0x50')]('tq.TeamId')[_0x2364('0x7e')]('team_has_chat_queues','tq')[_0x2364('0x7f')](_0x2364('0x80'),'ut',_0x2364('0x81'))[_0x2364('0x4a')]('ChatQueueId\x20=\x20?',_0x1b1d39[_0x2364('0x56')]['id']);for(var _0x438044=0x0;_0x438044<_0x164757[_0x2364('0x45')];_0x438044+=0x1){let _0x5d33bb=_0x164757[_0x438044];for(var _0x1eab7a=0x0;_0x1eab7a<_0x5d33bb[_0x2364('0x74')]['length'];_0x1eab7a+=0x1){let _0x3db8ea=_0x5d33bb[_0x2364('0x74')][_0x1eab7a];var _0x4be3e0=_0x5493f5[_0x2364('0x82')]();_0x4be3e0[_0x2364('0x4a')](_0x2364('0x83'),_0x3db8ea['id']);_0x42268e[_0x2364('0x84')](db[_0x2364('0x75')][_0x2364('0x40')](_0x4be3e0[_0x2364('0x85')](),{'type':db[_0x2364('0x75')][_0x2364('0x86')]['SELECT']})[_0x2364('0x20')](function(_0x5b82a1){if(_0x5b82a1[_0x2364('0x45')]===0x1){return _0x3db8ea['id'];}else{var _0x3dc3c3=_['every'](_[_0x2364('0x63')](_0x5b82a1,'TeamId'),function(_0x1bb77f){return _[_0x2364('0x87')](_0x4ea121,_0x1bb77f);});if(_0x3dc3c3){return _0x3db8ea['id'];}}}));}}return BPromise[_0x2364('0x88')](_0x42268e)[_0x2364('0x20')](function(_0x299000){_0x56a486=_(_0x56a486)[_0x2364('0x89')](_0x299000)[_0x2364('0x8a')]()['value']();return db[_0x2364('0x3d')][_0x2364('0x58')]({'where':{'id':_0x1b1d39['params']['id']}})[_0x2364('0x20')](function(_0x49499d){return db['sequelize']['transaction'](function(_0x2a9bb7){return _0x49499d[_0x2364('0x7c')](_0x1b1d39[_0x2364('0x40')][_0x2364('0x7d')],{'transaction':_0x2a9bb7})[_0x2364('0x20')](function(){if(!_['isEmpty'](_0x56a486)){return _0x49499d[_0x2364('0x8b')](_0x56a486,{'transaction':_0x2a9bb7});}})[_0x2364('0x20')](function(){_0x56a486['forEach'](function(_0x41900e){socket[_0x2364('0x7a')](_0x2364('0x8c'),{'UserId':_0x41900e,'ChatQueueId':_0x49499d['id']});});});});});});})['then'](respondWithStatusCode(_0x513bd7,null))[_0x2364('0x29')](handleError(_0x513bd7,null));};exports['addAgents']=function(_0x3fc7f0,_0x366692,_0x5cd1ed){return db[_0x2364('0x3d')][_0x2364('0x58')]({'where':{'id':_0x3fc7f0['params']['id']}})[_0x2364('0x20')](handleEntityNotFound(_0x366692,null))[_0x2364('0x20')](function(_0x52f2c4){if(_0x52f2c4){return _0x52f2c4[_0x2364('0x8d')](_0x3fc7f0[_0x2364('0x5a')]['ids'],_['omit'](_0x3fc7f0[_0x2364('0x5a')],[_0x2364('0x7d'),'id'])||{})['spread'](function(_0x1472b1){for(var _0x12c9bc=0x0;_0x12c9bc<_0x3fc7f0[_0x2364('0x5a')][_0x2364('0x7d')][_0x2364('0x45')];_0x12c9bc+=0x1){socket[_0x2364('0x7a')](_0x2364('0x7b'),{'UserId':_0x3fc7f0[_0x2364('0x5a')][_0x2364('0x7d')][_0x12c9bc],'ChatQueueId':_0x3fc7f0[_0x2364('0x56')]['id']});}return _0x1472b1;});}})['then'](respondWithResult(_0x366692,null))['catch'](handleError(_0x366692,null));};exports[_0x2364('0x8b')]=function(_0x5dfe18,_0x7b4414,_0x4fde0c){return db[_0x2364('0x3d')][_0x2364('0x58')]({'where':{'id':_0x5dfe18[_0x2364('0x56')]['id']}})[_0x2364('0x20')](handleEntityNotFound(_0x7b4414,null))[_0x2364('0x20')](function(_0x8acfab){if(_0x8acfab){return _0x8acfab['removeAgents'](_0x5dfe18[_0x2364('0x40')][_0x2364('0x7d')])[_0x2364('0x20')](function(){if(_[_0x2364('0x8e')](_0x5dfe18[_0x2364('0x40')][_0x2364('0x7d')])){for(var _0x41d1cb=0x0;_0x41d1cb<_0x5dfe18['query'][_0x2364('0x7d')][_0x2364('0x45')];_0x41d1cb+=0x1){socket[_0x2364('0x7a')](_0x2364('0x8c'),{'UserId':Number(_0x5dfe18['query']['ids'][_0x41d1cb]),'ChatQueueId':Number(_0x5dfe18[_0x2364('0x56')]['id'])});}}else{socket[_0x2364('0x7a')](_0x2364('0x8c'),{'UserId':Number(_0x5dfe18[_0x2364('0x40')]['ids']),'ChatQueueId':Number(_0x5dfe18['params']['id'])});}});}})['then'](respondWithStatusCode(_0x7b4414,null))['catch'](handleError(_0x7b4414,null));};exports['getAgents']=function(_0x36d590,_0x58a867,_0x2bbe80){var _0x318921={};var _0x4d270b={};var _0x2f190a;var _0xbd7bed;return db[_0x2364('0x3d')][_0x2364('0x6d')]({'where':{'id':_0x36d590['params']['id']}})[_0x2364('0x20')](handleEntityNotFound(_0x58a867,null))[_0x2364('0x20')](function(_0x170fbe){if(_0x170fbe){_0x2f190a=_0x170fbe;_0x4d270b['model']=_[_0x2364('0x3f')](db['User']['rawAttributes']);_0x4d270b[_0x2364('0x40')]=_[_0x2364('0x3f')](_0x36d590[_0x2364('0x40')]);_0x4d270b[_0x2364('0x41')]=_[_0x2364('0x42')](_0x4d270b[_0x2364('0x57')],_0x4d270b['query']);_0x318921[_0x2364('0x44')]=_['intersection'](_0x4d270b[_0x2364('0x57')],qs[_0x2364('0x43')](_0x36d590[_0x2364('0x40')][_0x2364('0x43')]));_0x318921[_0x2364('0x44')]=_0x318921[_0x2364('0x44')][_0x2364('0x45')]?_0x318921[_0x2364('0x44')]:_0x4d270b[_0x2364('0x57')];_0x318921[_0x2364('0x48')]=qs[_0x2364('0x49')](_0x36d590[_0x2364('0x40')][_0x2364('0x49')]);_0x318921[_0x2364('0x4a')]=qs[_0x2364('0x41')](_[_0x2364('0x4b')](_0x36d590[_0x2364('0x40')],_0x4d270b[_0x2364('0x41')]));if(_0x36d590[_0x2364('0x40')][_0x2364('0x4c')]){_0x318921[_0x2364('0x4a')]=_[_0x2364('0x4d')](_0x318921[_0x2364('0x4a')],{'$or':_[_0x2364('0x63')](_0x318921[_0x2364('0x44')],function(_0x6831b0){var _0x4d4fa2={};_0x4d4fa2[_0x6831b0]={'$like':'%'+_0x36d590[_0x2364('0x40')][_0x2364('0x4c')]+'%'};return _0x4d4fa2;})});}_0x318921=_['merge']({},_0x318921,_0x36d590[_0x2364('0x51')]);return _0x2f190a['getAgents'](_0x318921);}})[_0x2364('0x20')](function(_0x2c2e68){if(_0x2c2e68){_0xbd7bed=_0x2c2e68[_0x2364('0x45')];if(!_0x36d590[_0x2364('0x40')][_0x2364('0x46')](_0x2364('0x47'))){_0x318921['limit']=qs[_0x2364('0x30')](_0x36d590['query'][_0x2364('0x30')]);_0x318921[_0x2364('0x2f')]=qs[_0x2364('0x2f')](_0x36d590[_0x2364('0x40')][_0x2364('0x2f')]);}return _0x2f190a['getAgents'](_0x318921);}})[_0x2364('0x20')](function(_0x1a5486){if(_0x1a5486){return _0x1a5486?{'count':_0xbd7bed,'rows':_0x1a5486}:null;}})[_0x2364('0x20')](respondWithResult(_0x58a867,null))[_0x2364('0x29')](handleError(_0x58a867,null));}; \ No newline at end of file +var _0x1cfe=['status','json','count','offset','limit','set','apply','reject','save','update','destroy','get','ChatQueues','name','send','ChatQueue','rawAttributes','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','map','key','VIRTUAL','field','filter','options','includeAll','findAll','rows','show','include','find','create','user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','Agents','interface','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','tq.TeamId','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','fast-json-patch','request-promise','moment','bluebird','util','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.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','debug','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','request\x20sent','catch','end'];(function(_0x59ac72,_0x231bc8){var _0x12923c=function(_0x5ea63f){while(--_0x5ea63f){_0x59ac72['push'](_0x59ac72['shift']());}};_0x12923c(++_0x231bc8);}(_0x1cfe,0x184));var _0xe1cf=function(_0x581af1,_0x4f02c5){_0x581af1=_0x581af1-0x0;var _0x54c22e=_0x1cfe[_0x581af1];return _0x54c22e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe1cf('0x0'));var rp=require(_0xe1cf('0x1'));var moment=require(_0xe1cf('0x2'));var BPromise=require(_0xe1cf('0x3'));var Mustache=require('mustache');var util=require(_0xe1cf('0x4'));var path=require('path');var sox=require(_0xe1cf('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe1cf('0x6'));var squel=require(_0xe1cf('0x7'));var crypto=require('crypto');var jsforce=require(_0xe1cf('0x8'));var deskjs=require(_0xe1cf('0x9'));var toCsv=require(_0xe1cf('0xa'));var querystring=require(_0xe1cf('0xb'));var Papa=require(_0xe1cf('0xc'));var Redis=require('ioredis');var authService=require(_0xe1cf('0xd'));var qs=require(_0xe1cf('0xe'));var hardwareService=require(_0xe1cf('0xf'));var logger=require(_0xe1cf('0x10'))('api');var utils=require(_0xe1cf('0x11'));var config=require(_0xe1cf('0x12'));var db=require(_0xe1cf('0x13'))['db'];config[_0xe1cf('0x14')]=_[_0xe1cf('0x15')](config[_0xe1cf('0x14')],{'host':_0xe1cf('0x16'),'port':0x18eb});var socket=require(_0xe1cf('0x17'))(new Redis(config[_0xe1cf('0x14')]));require(_0xe1cf('0x18'))[_0xe1cf('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe1cf('0x1a')][_0xe1cf('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x5714d5,_0x17780f,_0x1f114c){if(_0x1f114c){var _0x2c3d52=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c3d52[_0xe1cf('0x1c')](_0x17780f)){return _0x5714d5;}else{throw new Error(_0xe1cf('0x1d'));}}else{return _0x5714d5;}}function respondWithRpcPromise(_0x29b371,_0xf1c27a,_0x508af4,_0x4e2e85){return new BPromise(function(_0x3b1ffe,_0x40b642){var _0x4d00db=_0x4e2e85||client;return _0x4d00db['request'](_0x29b371,_0x508af4)[_0xe1cf('0x1e')](function(_0x392c97){logger[_0xe1cf('0x1f')]('ChatQueue,\x20%s,\x20%s',_0xf1c27a,'request\x20sent');logger[_0xe1cf('0x20')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0xf1c27a,'request\x20sent',JSON[_0xe1cf('0x21')](_0x392c97));if(_0x392c97[_0xe1cf('0x22')]){if(_0x392c97[_0xe1cf('0x22')][_0xe1cf('0x23')]===0x1f4){logger[_0xe1cf('0x22')](_0xe1cf('0x24'),_0xf1c27a,_0x392c97['error']['message']);return _0x40b642(_0x392c97[_0xe1cf('0x22')]['message']);}logger[_0xe1cf('0x22')](_0xe1cf('0x24'),_0xf1c27a,_0x392c97[_0xe1cf('0x22')][_0xe1cf('0x25')]);return _0x3b1ffe(_0x392c97[_0xe1cf('0x22')][_0xe1cf('0x25')]);}else{logger[_0xe1cf('0x1f')](_0xe1cf('0x24'),_0xf1c27a,_0xe1cf('0x26'));_0x3b1ffe(_0x392c97['result'][_0xe1cf('0x25')]);}})[_0xe1cf('0x27')](function(_0x5c9a41){logger[_0xe1cf('0x22')](_0xe1cf('0x24'),_0xf1c27a,_0x5c9a41);_0x40b642(_0x5c9a41);});});}function respondWithStatusCode(_0x58f3f1,_0x19fc39){_0x19fc39=_0x19fc39||0xcc;return function(_0x62e460){if(_0x62e460){return _0x58f3f1['sendStatus'](_0x19fc39);}return _0x58f3f1['status'](_0x19fc39)[_0xe1cf('0x28')]();};}function respondWithResult(_0x54b8c6,_0x19c8d7){_0x19c8d7=_0x19c8d7||0xc8;return function(_0x457ee8){if(_0x457ee8){return _0x54b8c6[_0xe1cf('0x29')](_0x19c8d7)[_0xe1cf('0x2a')](_0x457ee8);}};}function respondWithFilteredResult(_0x11d9ca,_0x1c2e58){return function(_0x523caf){if(_0x523caf){var _0x1525ad=_0x523caf[_0xe1cf('0x2b')],_0x55c43f=_0x1c2e58[_0xe1cf('0x2c')],_0x5418f9=_0x1c2e58[_0xe1cf('0x2c')]+_0x1c2e58[_0xe1cf('0x2d')],_0x5ea379;if(_0x5418f9>=_0x1525ad){_0x5418f9=_0x1525ad;_0x5ea379=0xc8;}else{_0x5ea379=0xce;}_0x11d9ca[_0xe1cf('0x29')](_0x5ea379);return _0x11d9ca[_0xe1cf('0x2e')]('Content-Range',_0x55c43f+'-'+_0x5418f9+'/'+_0x1525ad)[_0xe1cf('0x2a')](_0x523caf);}return null;};}function patchUpdates(_0x2b36ea){return function(_0x4af705){try{jsonpatch[_0xe1cf('0x2f')](_0x4af705,_0x2b36ea,!![]);}catch(_0x2ab293){return BPromise[_0xe1cf('0x30')](_0x2ab293);}return _0x4af705[_0xe1cf('0x31')]();};}function saveUpdates(_0x3b477c,_0xfd7e9e){return function(_0x3f0ad2){if(_0x3f0ad2){return _0x3f0ad2[_0xe1cf('0x32')](_0x3b477c)[_0xe1cf('0x1e')](function(_0x460839){return _0x460839;});}return null;};}function removeEntity(_0x310008,_0x6e9901){return function(_0x2af2ca){if(_0x2af2ca){return _0x2af2ca[_0xe1cf('0x33')]()['then'](function(){var _0x5c592f=_0x2af2ca[_0xe1cf('0x34')]({'plain':!![]});var _0x233b3f=_0xe1cf('0x35');return db['UserProfileResource'][_0xe1cf('0x33')]({'where':{'type':_0x233b3f,'resourceId':_0x5c592f['id']}})[_0xe1cf('0x1e')](function(){return _0x2af2ca;});})[_0xe1cf('0x1e')](function(){_0x310008['status'](0xcc)[_0xe1cf('0x28')]();});}};}function handleEntityNotFound(_0x50fd66,_0x1587b2){return function(_0xc594c8){if(!_0xc594c8){_0x50fd66['sendStatus'](0x194);}return _0xc594c8;};}function handleError(_0x19fcc4,_0xf160c7){_0xf160c7=_0xf160c7||0x1f4;return function(_0x56dc2d){logger['error'](_0x56dc2d['stack']);if(_0x56dc2d[_0xe1cf('0x36')]){delete _0x56dc2d['name'];}_0x19fcc4[_0xe1cf('0x29')](_0xf160c7)[_0xe1cf('0x37')](_0x56dc2d);};}exports['index']=function(_0xaefa15,_0x16f30b){var _0x454294={},_0x27aab6={},_0x4353b8={'count':0x0,'rows':[]};var _0x51b1ab=db[_0xe1cf('0x38')][_0xe1cf('0x39')];_0x27aab6['model']=_[_0xe1cf('0x3a')](_0x51b1ab);_0x27aab6[_0xe1cf('0x3b')]=_['keys'](_0xaefa15[_0xe1cf('0x3b')]);_0x27aab6['filters']=_['intersection'](_0x27aab6[_0xe1cf('0x3c')],_0x27aab6[_0xe1cf('0x3b')]);_0x454294[_0xe1cf('0x3d')]=_[_0xe1cf('0x3e')](_0x27aab6['model'],qs['fields'](_0xaefa15[_0xe1cf('0x3b')][_0xe1cf('0x3f')]));_0x454294[_0xe1cf('0x3d')]=_0x454294[_0xe1cf('0x3d')][_0xe1cf('0x40')]?_0x454294[_0xe1cf('0x3d')]:_0x27aab6[_0xe1cf('0x3c')];if(!_0xaefa15[_0xe1cf('0x3b')][_0xe1cf('0x41')](_0xe1cf('0x42'))){_0x454294['limit']=qs[_0xe1cf('0x2d')](_0xaefa15[_0xe1cf('0x3b')]['limit']);_0x454294[_0xe1cf('0x2c')]=qs[_0xe1cf('0x2c')](_0xaefa15[_0xe1cf('0x3b')][_0xe1cf('0x2c')]);}_0x454294[_0xe1cf('0x43')]=qs[_0xe1cf('0x44')](_0xaefa15[_0xe1cf('0x3b')][_0xe1cf('0x44')]);_0x454294['where']=qs[_0xe1cf('0x45')](_[_0xe1cf('0x46')](_0xaefa15[_0xe1cf('0x3b')],_0x27aab6[_0xe1cf('0x45')]));if(_0xaefa15[_0xe1cf('0x3b')]['filter']){_0x454294[_0xe1cf('0x47')]=_[_0xe1cf('0x48')](_0x454294[_0xe1cf('0x47')],{'$or':_[_0xe1cf('0x49')](_0x51b1ab,function(_0x27c879){if(_0x27c879['type'][_0xe1cf('0x4a')]!==_0xe1cf('0x4b')){var _0x5a0621={};_0x5a0621[_0x27c879[_0xe1cf('0x4c')]]={'$like':'%'+_0xaefa15[_0xe1cf('0x3b')][_0xe1cf('0x4d')]+'%'};return _0x5a0621;}})});}_0x454294=_['merge']({},_0x454294,_0xaefa15[_0xe1cf('0x4e')]);var _0x1178d0={'where':_0x454294[_0xe1cf('0x47')]};return db['ChatQueue']['count'](_0x1178d0)[_0xe1cf('0x1e')](function(_0x7287c){_0x4353b8[_0xe1cf('0x2b')]=_0x7287c;if(_0xaefa15[_0xe1cf('0x3b')][_0xe1cf('0x4f')]){_0x454294['include']=[{'all':!![]}];}return db[_0xe1cf('0x38')][_0xe1cf('0x50')](_0x454294);})[_0xe1cf('0x1e')](function(_0x5e849d){_0x4353b8[_0xe1cf('0x51')]=_0x5e849d;return _0x4353b8;})['then'](respondWithFilteredResult(_0x16f30b,_0x454294))[_0xe1cf('0x27')](handleError(_0x16f30b,null));};exports[_0xe1cf('0x52')]=function(_0x2de16f,_0xc95dfd){var _0x17e5d8={'raw':!![],'where':{'id':_0x2de16f['params']['id']}},_0x446392={};_0x446392['model']=_['keys'](db[_0xe1cf('0x38')][_0xe1cf('0x39')]);_0x446392['query']=_[_0xe1cf('0x3a')](_0x2de16f[_0xe1cf('0x3b')]);_0x446392['filters']=_[_0xe1cf('0x3e')](_0x446392[_0xe1cf('0x3c')],_0x446392['query']);_0x17e5d8['attributes']=_['intersection'](_0x446392[_0xe1cf('0x3c')],qs[_0xe1cf('0x3f')](_0x2de16f[_0xe1cf('0x3b')][_0xe1cf('0x3f')]));_0x17e5d8[_0xe1cf('0x3d')]=_0x17e5d8[_0xe1cf('0x3d')][_0xe1cf('0x40')]?_0x17e5d8['attributes']:_0x446392[_0xe1cf('0x3c')];if(_0x2de16f['query'][_0xe1cf('0x4f')]){_0x17e5d8[_0xe1cf('0x53')]=[{'all':!![]}];}_0x17e5d8=_[_0xe1cf('0x48')]({},_0x17e5d8,_0x2de16f['options']);return db[_0xe1cf('0x38')][_0xe1cf('0x54')](_0x17e5d8)['then'](handleEntityNotFound(_0xc95dfd,null))['then'](respondWithResult(_0xc95dfd,null))[_0xe1cf('0x27')](handleError(_0xc95dfd,null));};exports[_0xe1cf('0x55')]=function(_0x2d072a,_0x4b242f){return db[_0xe1cf('0x38')][_0xe1cf('0x55')](_0x2d072a['body'],{})[_0xe1cf('0x1e')](function(_0x5b146a){var _0x424e02=_0x2d072a[_0xe1cf('0x56')][_0xe1cf('0x34')]({'plain':!![]});if(!_0x424e02)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x424e02[_0xe1cf('0x57')]===_0xe1cf('0x56')){var _0x5924e6=_0x5b146a[_0xe1cf('0x34')]({'plain':!![]});var _0x3c6ae1=_0xe1cf('0x35');return db[_0xe1cf('0x58')][_0xe1cf('0x54')]({'where':{'name':_0x3c6ae1,'userProfileId':_0x424e02['userProfileId']},'raw':!![]})[_0xe1cf('0x1e')](function(_0xf9ba16){if(_0xf9ba16&&_0xf9ba16['autoAssociation']===0x0){return db[_0xe1cf('0x59')][_0xe1cf('0x55')]({'name':_0x5924e6[_0xe1cf('0x36')],'resourceId':_0x5924e6['id'],'type':_0xf9ba16['name'],'sectionId':_0xf9ba16['id']},{})[_0xe1cf('0x1e')](function(){return _0x5b146a;});}else{return _0x5b146a;}})[_0xe1cf('0x27')](function(_0x42f669){logger['error'](_0xe1cf('0x5a'),_0x42f669);throw _0x42f669;});}return _0x5b146a;})['then'](respondWithResult(_0x4b242f,0xc9))[_0xe1cf('0x27')](handleError(_0x4b242f,null));};exports['update']=function(_0x47579b,_0x42f78f){if(_0x47579b[_0xe1cf('0x5b')]['id']){delete _0x47579b[_0xe1cf('0x5b')]['id'];}return db[_0xe1cf('0x38')][_0xe1cf('0x54')]({'where':{'id':_0x47579b['params']['id']}})[_0xe1cf('0x1e')](handleEntityNotFound(_0x42f78f,null))[_0xe1cf('0x1e')](saveUpdates(_0x47579b[_0xe1cf('0x5b')],null))[_0xe1cf('0x1e')](respondWithResult(_0x42f78f,null))['catch'](handleError(_0x42f78f,null));};exports[_0xe1cf('0x33')]=function(_0x41e34f,_0x59f3a9){return db[_0xe1cf('0x38')][_0xe1cf('0x54')]({'where':{'id':_0x41e34f[_0xe1cf('0x5c')]['id']}})[_0xe1cf('0x1e')](handleEntityNotFound(_0x59f3a9,null))[_0xe1cf('0x1e')](removeEntity(_0x59f3a9,null))[_0xe1cf('0x27')](handleError(_0x59f3a9,null));};exports[_0xe1cf('0x5d')]=function(_0x3aa7db,_0xac93f5){return db[_0xe1cf('0x38')]['describe']()[_0xe1cf('0x1e')](respondWithResult(_0xac93f5,null))[_0xe1cf('0x27')](handleError(_0xac93f5,null));};exports[_0xe1cf('0x5e')]=function(_0x2b8240,_0x3ce2f2,_0x21519c){var _0x6c7e03={'raw':!![],'where':{}},_0x5a2f76={},_0x50a284;return db[_0xe1cf('0x38')]['findOne']({'where':{'id':_0x2b8240['params']['id']}})[_0xe1cf('0x1e')](handleEntityNotFound(_0x3ce2f2,null))[_0xe1cf('0x1e')](function(_0x2e91e3){if(_0x2e91e3){_0x50a284=_0x2e91e3[_0xe1cf('0x34')]({'plain':!![]});_0x5a2f76[_0xe1cf('0x3c')]=_['keys'](db[_0xe1cf('0x5f')][_0xe1cf('0x39')]);_0x5a2f76[_0xe1cf('0x3b')]=_[_0xe1cf('0x3a')](_0x2b8240[_0xe1cf('0x3b')]);_0x5a2f76[_0xe1cf('0x45')]=_['intersection'](_0x5a2f76[_0xe1cf('0x3c')],_0x5a2f76[_0xe1cf('0x3b')]);_0x6c7e03[_0xe1cf('0x3d')]=_[_0xe1cf('0x3e')](_0x5a2f76[_0xe1cf('0x3c')],qs[_0xe1cf('0x3f')](_0x2b8240[_0xe1cf('0x3b')][_0xe1cf('0x3f')]));_0x6c7e03[_0xe1cf('0x3d')]=_0x6c7e03[_0xe1cf('0x3d')]['length']?_0x6c7e03['attributes']:_0x5a2f76[_0xe1cf('0x3c')];if(!_0x2b8240[_0xe1cf('0x3b')][_0xe1cf('0x41')](_0xe1cf('0x42'))){_0x6c7e03[_0xe1cf('0x2d')]=qs[_0xe1cf('0x2d')](_0x2b8240[_0xe1cf('0x3b')][_0xe1cf('0x2d')]);_0x6c7e03[_0xe1cf('0x2c')]=qs['offset'](_0x2b8240[_0xe1cf('0x3b')][_0xe1cf('0x2c')]);}_0x6c7e03[_0xe1cf('0x43')]=qs[_0xe1cf('0x44')](_0x2b8240[_0xe1cf('0x3b')][_0xe1cf('0x44')]);_0x6c7e03[_0xe1cf('0x47')]=qs[_0xe1cf('0x45')](_[_0xe1cf('0x46')](_0x2b8240['query'],_0x5a2f76[_0xe1cf('0x45')]));_0x6c7e03[_0xe1cf('0x47')][_0xe1cf('0x60')]=_0x2e91e3['id'];if(_0x2b8240['query'][_0xe1cf('0x4d')]){_0x6c7e03[_0xe1cf('0x47')]=_[_0xe1cf('0x48')](_0x6c7e03[_0xe1cf('0x47')],{'$or':_['map'](_0x6c7e03['attributes'],function(_0xaa86c9){var _0x15ac8b={};_0x15ac8b[_0xaa86c9]={'$like':'%'+_0x2b8240[_0xe1cf('0x3b')][_0xe1cf('0x4d')]+'%'};return _0x15ac8b;})});}_0x6c7e03=_[_0xe1cf('0x48')]({},_0x6c7e03,_0x2b8240['options']);return db[_0xe1cf('0x5f')][_0xe1cf('0x50')](_0x6c7e03);}})['then'](function(_0x5070ca){if(_0x5070ca){return db[_0xe1cf('0x61')][_0xe1cf('0x62')]({'where':{'id':_[_0xe1cf('0x49')](_0x5070ca,_0xe1cf('0x63')),'role':'agent'},'attributes':['id',_0xe1cf('0x36'),_0xe1cf('0x64'),_0xe1cf('0x65'),_0xe1cf('0x66')]});}})[_0xe1cf('0x1e')](function(_0x3d91c1){if(_0x3d91c1){return{'count':_0x3d91c1['count'],'rows':_['map'](_0x3d91c1[_0xe1cf('0x51')],function(_0x563971){return{'membername':_0x563971[_0xe1cf('0x36')],'UserId':_0x563971['id'],'queue_name':_0x50a284[_0xe1cf('0x36')],'ChatQueueId':_0x50a284['id'],'interface':util[_0xe1cf('0x67')](_0xe1cf('0x68'),_0xe1cf('0x69'),_0x563971[_0xe1cf('0x36')]),'penalty':0x0,'paused':_0x563971[_0xe1cf('0x64')],'createdAt':_0x563971[_0xe1cf('0x66')],'updatedAt':_0x563971[_0xe1cf('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe1cf('0x1e')](respondWithFilteredResult(_0x3ce2f2,_0x6c7e03))[_0xe1cf('0x27')](handleError(_0x3ce2f2,null));};exports[_0xe1cf('0x6a')]=function(_0x21a1ec,_0xda943f,_0xc2b2a8){var _0x17a0c3={};var _0xaf1327={};var _0x5d9f17;var _0x2bb781;return db['ChatQueue'][_0xe1cf('0x6b')]({'where':{'id':_0x21a1ec[_0xe1cf('0x5c')]['id']}})[_0xe1cf('0x1e')](handleEntityNotFound(_0xda943f,null))[_0xe1cf('0x1e')](function(_0xfb1403){if(_0xfb1403){_0x5d9f17=_0xfb1403;_0xaf1327['model']=_['keys'](db[_0xe1cf('0x6c')][_0xe1cf('0x39')]);_0xaf1327[_0xe1cf('0x3b')]=_[_0xe1cf('0x3a')](_0x21a1ec['query']);_0xaf1327[_0xe1cf('0x45')]=_['intersection'](_0xaf1327[_0xe1cf('0x3c')],_0xaf1327[_0xe1cf('0x3b')]);_0x17a0c3[_0xe1cf('0x3d')]=_[_0xe1cf('0x3e')](_0xaf1327[_0xe1cf('0x3c')],qs['fields'](_0x21a1ec[_0xe1cf('0x3b')][_0xe1cf('0x3f')]));_0x17a0c3['attributes']=_0x17a0c3[_0xe1cf('0x3d')][_0xe1cf('0x40')]?_0x17a0c3['attributes']:_0xaf1327[_0xe1cf('0x3c')];_0x17a0c3[_0xe1cf('0x43')]=qs[_0xe1cf('0x44')](_0x21a1ec[_0xe1cf('0x3b')]['sort']);_0x17a0c3[_0xe1cf('0x47')]=qs['filters'](_['pick'](_0x21a1ec[_0xe1cf('0x3b')],_0xaf1327[_0xe1cf('0x45')]));if(_0x21a1ec[_0xe1cf('0x3b')][_0xe1cf('0x4d')]){_0x17a0c3[_0xe1cf('0x47')]=_[_0xe1cf('0x48')](_0x17a0c3[_0xe1cf('0x47')],{'$or':_[_0xe1cf('0x49')](_0x17a0c3[_0xe1cf('0x3d')],function(_0x38ee05){var _0x4c7b12={};_0x4c7b12[_0x38ee05]={'$like':'%'+_0x21a1ec[_0xe1cf('0x3b')][_0xe1cf('0x4d')]+'%'};return _0x4c7b12;})});}_0x17a0c3=_[_0xe1cf('0x48')]({},_0x17a0c3,_0x21a1ec['options']);return _0x5d9f17['getTeams'](_0x17a0c3);}})[_0xe1cf('0x1e')](function(_0x474bac){if(_0x474bac){_0x2bb781=_0x474bac[_0xe1cf('0x40')];if(!_0x21a1ec[_0xe1cf('0x3b')][_0xe1cf('0x41')]('nolimit')){_0x17a0c3[_0xe1cf('0x2d')]=qs['limit'](_0x21a1ec[_0xe1cf('0x3b')][_0xe1cf('0x2d')]);_0x17a0c3[_0xe1cf('0x2c')]=qs[_0xe1cf('0x2c')](_0x21a1ec[_0xe1cf('0x3b')][_0xe1cf('0x2c')]);}return _0x5d9f17[_0xe1cf('0x6a')](_0x17a0c3);}})[_0xe1cf('0x1e')](function(_0x2e4c8f){if(_0x2e4c8f){return _0x2e4c8f?{'count':_0x2bb781,'rows':_0x2e4c8f}:null;}})['then'](respondWithResult(_0xda943f,null))[_0xe1cf('0x27')](handleError(_0xda943f,null));};exports['addTeams']=function(_0x7277d,_0x46bbc6,_0x313bdb){var _0xabac50=_0x7277d[_0xe1cf('0x5b')]['teams'];return db['Team'][_0xe1cf('0x50')]({'where':{'id':_[_0xe1cf('0x49')](_0xabac50,'id')},'attributes':['id'],'include':[{'model':db[_0xe1cf('0x61')],'as':_0xe1cf('0x6d'),'attributes':['id',_0xe1cf('0x36'),'online','voicePause',_0xe1cf('0x6e')],'raw':!![]}]})['then'](function(_0x150270){if(_0x150270){var _0x1c0313=_['flatMap'](_0x150270,function(_0x1ac9a5){var _0x1feadc=_0x1ac9a5[_0xe1cf('0x34')]({'plain':!![]});return _0x1feadc[_0xe1cf('0x6d')];});return db['ChatQueue']['find']({'where':{'id':_0x7277d['params']['id']}})[_0xe1cf('0x1e')](function(_0x424ea4){return db[_0xe1cf('0x6f')][_0xe1cf('0x70')](function(_0x5d682e){return _0x424ea4[_0xe1cf('0x71')](_[_0xe1cf('0x49')](_0xabac50,'id'),{'transaction':_0x5d682e})['then'](function(){return BPromise[_0xe1cf('0x72')](_0x1c0313,function(_0x1d8c4c){return db[_0xe1cf('0x5f')][_0xe1cf('0x73')]({'where':{'UserId':_0x1d8c4c['id'],'ChatQueueId':_0x7277d[_0xe1cf('0x5c')]['id']},'transaction':_0x5d682e});});})[_0xe1cf('0x1e')](function(){_0x1c0313[_0xe1cf('0x74')](function(_0x53df5c){socket[_0xe1cf('0x75')](_0xe1cf('0x76'),{'UserId':_0x53df5c['id'],'ChatQueueId':_0x424ea4['id']});});});});});}})[_0xe1cf('0x1e')](respondWithStatusCode(_0x46bbc6,null))[_0xe1cf('0x27')](handleError(_0x46bbc6,null));};exports[_0xe1cf('0x77')]=function(_0x5ba599,_0x31ff17,_0x4b4183){return db[_0xe1cf('0x6c')]['findAll']({'where':{'id':_0x5ba599[_0xe1cf('0x3b')][_0xe1cf('0x78')]},'attributes':['id'],'include':[{'model':db[_0xe1cf('0x61')],'as':_0xe1cf('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xe1cf('0x1e')](handleEntityNotFound(_0x31ff17,null))[_0xe1cf('0x1e')](function(_0x437650){var _0x5c8475=_[_0xe1cf('0x49')](_0x437650,'id');var _0x1e9043=[];var _0x1a6371=[];var _0x50b6ce=squel['select']();_0x50b6ce[_0xe1cf('0x4c')](_0xe1cf('0x79'))['from'](_0xe1cf('0x7a'),'tq')[_0xe1cf('0x7b')](_0xe1cf('0x7c'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe1cf('0x47')](_0xe1cf('0x7d'),_0x5ba599[_0xe1cf('0x5c')]['id']);for(var _0x490496=0x0;_0x490496<_0x437650[_0xe1cf('0x40')];_0x490496+=0x1){let _0x5b4c6a=_0x437650[_0x490496];for(var _0x5e1c43=0x0;_0x5e1c43<_0x5b4c6a[_0xe1cf('0x6d')]['length'];_0x5e1c43+=0x1){let _0x1244d8=_0x5b4c6a[_0xe1cf('0x6d')][_0x5e1c43];var _0x586b03=_0x50b6ce[_0xe1cf('0x7e')]();_0x586b03[_0xe1cf('0x47')](_0xe1cf('0x7f'),_0x1244d8['id']);_0x1a6371[_0xe1cf('0x80')](db[_0xe1cf('0x6f')][_0xe1cf('0x3b')](_0x586b03[_0xe1cf('0x81')](),{'type':db[_0xe1cf('0x6f')]['QueryTypes']['SELECT']})[_0xe1cf('0x1e')](function(_0x728103){if(_0x728103['length']===0x1){return _0x1244d8['id'];}else{var _0x2b09a1=_['every'](_['map'](_0x728103,_0xe1cf('0x82')),function(_0x47be43){return _[_0xe1cf('0x83')](_0x5c8475,_0x47be43);});if(_0x2b09a1){return _0x1244d8['id'];}}}));}}return BPromise[_0xe1cf('0x84')](_0x1a6371)['then'](function(_0x530acf){_0x1e9043=_(_0x1e9043)[_0xe1cf('0x85')](_0x530acf)[_0xe1cf('0x86')]()[_0xe1cf('0x87')]();return db['ChatQueue']['find']({'where':{'id':_0x5ba599[_0xe1cf('0x5c')]['id']}})['then'](function(_0x42aa20){return db['sequelize'][_0xe1cf('0x70')](function(_0x48b8de){return _0x42aa20[_0xe1cf('0x77')](_0x5ba599[_0xe1cf('0x3b')][_0xe1cf('0x78')],{'transaction':_0x48b8de})[_0xe1cf('0x1e')](function(){if(!_[_0xe1cf('0x88')](_0x1e9043)){return _0x42aa20[_0xe1cf('0x89')](_0x1e9043,{'transaction':_0x48b8de});}})[_0xe1cf('0x1e')](function(){_0x1e9043['forEach'](function(_0x40da54){socket[_0xe1cf('0x75')](_0xe1cf('0x8a'),{'UserId':_0x40da54,'ChatQueueId':_0x42aa20['id']});});});});});});})[_0xe1cf('0x1e')](respondWithStatusCode(_0x31ff17,null))['catch'](handleError(_0x31ff17,null));};exports[_0xe1cf('0x8b')]=function(_0xad7f42,_0x247dba,_0x276736){return db[_0xe1cf('0x38')]['find']({'where':{'id':_0xad7f42[_0xe1cf('0x5c')]['id']}})[_0xe1cf('0x1e')](handleEntityNotFound(_0x247dba,null))[_0xe1cf('0x1e')](function(_0x4eaf93){if(_0x4eaf93){return _0x4eaf93[_0xe1cf('0x8b')](_0xad7f42[_0xe1cf('0x5b')][_0xe1cf('0x78')],_[_0xe1cf('0x8c')](_0xad7f42['body'],[_0xe1cf('0x78'),'id'])||{})[_0xe1cf('0x8d')](function(_0x424a81){for(var _0x1384a2=0x0;_0x1384a2<_0xad7f42['body'][_0xe1cf('0x78')][_0xe1cf('0x40')];_0x1384a2+=0x1){socket[_0xe1cf('0x75')](_0xe1cf('0x76'),{'UserId':_0xad7f42[_0xe1cf('0x5b')][_0xe1cf('0x78')][_0x1384a2],'ChatQueueId':_0xad7f42['params']['id']});}return _0x424a81;});}})[_0xe1cf('0x1e')](respondWithResult(_0x247dba,null))['catch'](handleError(_0x247dba,null));};exports[_0xe1cf('0x89')]=function(_0x73eb46,_0x2de363,_0x27af0e){return db['ChatQueue'][_0xe1cf('0x54')]({'where':{'id':_0x73eb46[_0xe1cf('0x5c')]['id']}})[_0xe1cf('0x1e')](handleEntityNotFound(_0x2de363,null))[_0xe1cf('0x1e')](function(_0x4765df){if(_0x4765df){return _0x4765df[_0xe1cf('0x89')](_0x73eb46[_0xe1cf('0x3b')]['ids'])[_0xe1cf('0x1e')](function(){if(_['isArray'](_0x73eb46[_0xe1cf('0x3b')][_0xe1cf('0x78')])){for(var _0x1479e8=0x0;_0x1479e8<_0x73eb46['query'][_0xe1cf('0x78')][_0xe1cf('0x40')];_0x1479e8+=0x1){socket[_0xe1cf('0x75')]('userChatQueue:remove',{'UserId':Number(_0x73eb46[_0xe1cf('0x3b')][_0xe1cf('0x78')][_0x1479e8]),'ChatQueueId':Number(_0x73eb46['params']['id'])});}}else{socket[_0xe1cf('0x75')](_0xe1cf('0x8a'),{'UserId':Number(_0x73eb46[_0xe1cf('0x3b')]['ids']),'ChatQueueId':Number(_0x73eb46['params']['id'])});}});}})[_0xe1cf('0x1e')](respondWithStatusCode(_0x2de363,null))[_0xe1cf('0x27')](handleError(_0x2de363,null));};exports[_0xe1cf('0x8e')]=function(_0x4425db,_0xeb0c46,_0x59d38e){var _0x1ec57b={};var _0x2edbee={};var _0x5590f0;var _0x2c7783;return db[_0xe1cf('0x38')][_0xe1cf('0x6b')]({'where':{'id':_0x4425db['params']['id']}})[_0xe1cf('0x1e')](handleEntityNotFound(_0xeb0c46,null))['then'](function(_0x15567d){if(_0x15567d){_0x5590f0=_0x15567d;_0x2edbee[_0xe1cf('0x3c')]=_[_0xe1cf('0x3a')](db[_0xe1cf('0x61')][_0xe1cf('0x39')]);_0x2edbee['query']=_[_0xe1cf('0x3a')](_0x4425db[_0xe1cf('0x3b')]);_0x2edbee[_0xe1cf('0x45')]=_['intersection'](_0x2edbee[_0xe1cf('0x3c')],_0x2edbee[_0xe1cf('0x3b')]);_0x1ec57b['attributes']=_[_0xe1cf('0x3e')](_0x2edbee[_0xe1cf('0x3c')],qs[_0xe1cf('0x3f')](_0x4425db[_0xe1cf('0x3b')][_0xe1cf('0x3f')]));_0x1ec57b[_0xe1cf('0x3d')]=_0x1ec57b[_0xe1cf('0x3d')][_0xe1cf('0x40')]?_0x1ec57b[_0xe1cf('0x3d')]:_0x2edbee['model'];_0x1ec57b['order']=qs[_0xe1cf('0x44')](_0x4425db[_0xe1cf('0x3b')][_0xe1cf('0x44')]);_0x1ec57b[_0xe1cf('0x47')]=qs[_0xe1cf('0x45')](_[_0xe1cf('0x46')](_0x4425db[_0xe1cf('0x3b')],_0x2edbee[_0xe1cf('0x45')]));if(_0x4425db[_0xe1cf('0x3b')]['filter']){_0x1ec57b['where']=_['merge'](_0x1ec57b['where'],{'$or':_['map'](_0x1ec57b[_0xe1cf('0x3d')],function(_0x2dbd07){var _0x846282={};_0x846282[_0x2dbd07]={'$like':'%'+_0x4425db['query']['filter']+'%'};return _0x846282;})});}_0x1ec57b=_['merge']({},_0x1ec57b,_0x4425db['options']);return _0x5590f0['getAgents'](_0x1ec57b);}})['then'](function(_0x484b75){if(_0x484b75){_0x2c7783=_0x484b75[_0xe1cf('0x40')];if(!_0x4425db[_0xe1cf('0x3b')][_0xe1cf('0x41')](_0xe1cf('0x42'))){_0x1ec57b[_0xe1cf('0x2d')]=qs[_0xe1cf('0x2d')](_0x4425db[_0xe1cf('0x3b')][_0xe1cf('0x2d')]);_0x1ec57b[_0xe1cf('0x2c')]=qs[_0xe1cf('0x2c')](_0x4425db[_0xe1cf('0x3b')][_0xe1cf('0x2c')]);}return _0x5590f0[_0xe1cf('0x8e')](_0x1ec57b);}})[_0xe1cf('0x1e')](function(_0x540fd5){if(_0x540fd5){return _0x540fd5?{'count':_0x2c7783,'rows':_0x540fd5}:null;}})[_0xe1cf('0x1e')](respondWithResult(_0xeb0c46,null))[_0xe1cf('0x27')](handleError(_0xeb0c46,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index e08e8c8..1db4b9b 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 _0x9f4d=['events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x204ad4,_0x502841){var _0x50675f=function(_0x30ad49){while(--_0x30ad49){_0x204ad4['push'](_0x204ad4['shift']());}};_0x50675f(++_0x502841);}(_0x9f4d,0xb0));var _0xd9f4=function(_0x2ff252,_0x222a1b){_0x2ff252=_0x2ff252-0x0;var _0x327741=_0x9f4d[_0x2ff252];return _0x327741;};'use strict';var EventEmitter=require(_0xd9f4('0x0'));var ChatQueue=require(_0xd9f4('0x1'))['db'][_0xd9f4('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd9f4('0x3')](0x0);var events={'afterCreate':_0xd9f4('0x4'),'afterUpdate':_0xd9f4('0x5'),'afterDestroy':_0xd9f4('0x6')};function emitEvent(_0x273eb9){return function(_0x7dccea,_0x5e0ab0,_0x2c39cb){ChatQueueEvents['emit'](_0x273eb9+':'+_0x7dccea['id'],_0x7dccea);ChatQueueEvents[_0xd9f4('0x7')](_0x273eb9,_0x7dccea);_0x2c39cb(null);};}for(var e in events){if(events[_0xd9f4('0x8')](e)){var event=events[e];ChatQueue[_0xd9f4('0x9')](e,emitEvent(event));}}module[_0xd9f4('0xa')]=ChatQueueEvents; \ No newline at end of file +var _0x235a=['../../mysqldb','ChatQueue','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x533529,_0x329f47){var _0xc6a506=function(_0x349d5b){while(--_0x349d5b){_0x533529['push'](_0x533529['shift']());}};_0xc6a506(++_0x329f47);}(_0x235a,0x1ef));var _0xa235=function(_0x6cfd5d,_0x1aa789){_0x6cfd5d=_0x6cfd5d-0x0;var _0x22610e=_0x235a[_0x6cfd5d];return _0x22610e;};'use strict';var EventEmitter=require(_0xa235('0x0'));var ChatQueue=require(_0xa235('0x1'))['db'][_0xa235('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa235('0x3'),'afterUpdate':'update','afterDestroy':_0xa235('0x4')};function emitEvent(_0x2f7920){return function(_0x277a68,_0x314ebf,_0x2e6eca){ChatQueueEvents[_0xa235('0x5')](_0x2f7920+':'+_0x277a68['id'],_0x277a68);ChatQueueEvents[_0xa235('0x5')](_0x2f7920,_0x277a68);_0x2e6eca(null);};}for(var e in events){if(events[_0xa235('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xa235('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index d73688e..ed9103c 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 _0x04b8=['../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','util','api','moment','request-promise','path'];(function(_0x35fb43,_0xdca547){var _0x3e6f83=function(_0x52ed31){while(--_0x52ed31){_0x35fb43['push'](_0x35fb43['shift']());}};_0x3e6f83(++_0xdca547);}(_0x04b8,0x159));var _0x804b=function(_0x331001,_0x3f5dfd){_0x331001=_0x331001-0x0;var _0x31d748=_0x04b8[_0x331001];return _0x31d748;};'use strict';var _=require('lodash');var util=require(_0x804b('0x0'));var logger=require('../../config/logger')(_0x804b('0x1'));var moment=require(_0x804b('0x2'));var BPromise=require('bluebird');var rp=require(_0x804b('0x3'));var fs=require('fs');var path=require(_0x804b('0x4'));var rimraf=require('rimraf');var config=require(_0x804b('0x5'));var attributes=require(_0x804b('0x6'));module[_0x804b('0x7')]=function(_0x5a8a5b,_0x2c22e3){return _0x5a8a5b[_0x804b('0x8')](_0x804b('0x9'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9434=['api','moment','bluebird','path','rimraf','./chatQueue.attributes','exports','chat_queues','lodash','util','../../config/logger'];(function(_0x5b443c,_0x4b1a0d){var _0x14436c=function(_0x56b725){while(--_0x56b725){_0x5b443c['push'](_0x5b443c['shift']());}};_0x14436c(++_0x4b1a0d);}(_0x9434,0x168));var _0x4943=function(_0x2fc60d,_0xec3696){_0x2fc60d=_0x2fc60d-0x0;var _0x39fa8b=_0x9434[_0x2fc60d];return _0x39fa8b;};'use strict';var _=require(_0x4943('0x0'));var util=require(_0x4943('0x1'));var logger=require(_0x4943('0x2'))(_0x4943('0x3'));var moment=require(_0x4943('0x4'));var BPromise=require(_0x4943('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4943('0x6'));var rimraf=require(_0x4943('0x7'));var config=require('../../config/environment');var attributes=require(_0x4943('0x8'));module[_0x4943('0x9')]=function(_0x4f930e,_0x394d9d){return _0x4f930e['define']('ChatQueue',attributes,{'tableName':_0x4943('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 28945ca..8f02394 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 _0xea58=['ChatQueue','findAll','options','where','limit','include','model','attributes','map','ShowChatQueue','find','raw','lodash','bluebird','randomstring','ioredis','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetChatQueue'];(function(_0x2e495d,_0x25a809){var _0x28cfa1=function(_0x316a99){while(--_0x316a99){_0x2e495d['push'](_0x2e495d['shift']());}};_0x28cfa1(++_0x25a809);}(_0xea58,0x7e));var _0x8ea5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea58[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8ea5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8ea5('0x1'));var rs=require(_0x8ea5('0x2'));var fs=require('fs');var Redis=require(_0x8ea5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8ea5('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8ea5('0x5')][_0x8ea5('0x6')]({'port':0x232a});config[_0x8ea5('0x7')]=_[_0x8ea5('0x8')](config[_0x8ea5('0x7')],{'host':_0x8ea5('0x9'),'port':0x18eb});var socket=require(_0x8ea5('0xa'))(new Redis(config[_0x8ea5('0x7')]));require(_0x8ea5('0xb'))[_0x8ea5('0xc')](socket);function respondWithRpcPromise(_0x596051,_0x5e95fb,_0x511a24){return new BPromise(function(_0x4f874a,_0x5dc587){return client[_0x8ea5('0xd')](_0x596051,_0x511a24)[_0x8ea5('0xe')](function(_0x58698c){logger['info'](_0x8ea5('0xf'),_0x5e95fb,_0x8ea5('0x10'));logger[_0x8ea5('0x11')](_0x8ea5('0x12'),_0x5e95fb,_0x8ea5('0x10'),JSON[_0x8ea5('0x13')](_0x58698c));if(_0x58698c[_0x8ea5('0x14')]){if(_0x58698c[_0x8ea5('0x14')]['code']===0x1f4){logger[_0x8ea5('0x14')](_0x8ea5('0xf'),_0x5e95fb,_0x58698c['error'][_0x8ea5('0x15')]);return _0x5dc587(_0x58698c[_0x8ea5('0x14')]['message']);}logger[_0x8ea5('0x14')]('ChatQueue,\x20%s,\x20%s',_0x5e95fb,_0x58698c[_0x8ea5('0x14')][_0x8ea5('0x15')]);return _0x4f874a(_0x58698c[_0x8ea5('0x14')][_0x8ea5('0x15')]);}else{logger[_0x8ea5('0x16')]('ChatQueue,\x20%s,\x20%s',_0x5e95fb,_0x8ea5('0x10'));_0x4f874a(_0x58698c[_0x8ea5('0x17')]['message']);}})[_0x8ea5('0x18')](function(_0x1300e2){logger[_0x8ea5('0x14')](_0x8ea5('0xf'),_0x5e95fb,_0x1300e2);_0x5dc587(_0x1300e2);});});}exports[_0x8ea5('0x19')]=function(_0x37b278){var _0x1e0104=this;return new Promise(function(_0x5882e6,_0x103521){return db[_0x8ea5('0x1a')][_0x8ea5('0x1b')]({'raw':_0x37b278[_0x8ea5('0x1c')]?_0x37b278[_0x8ea5('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x37b278[_0x8ea5('0x1c')]?_0x37b278[_0x8ea5('0x1c')][_0x8ea5('0x1d')]||null:null,'attributes':_0x37b278[_0x8ea5('0x1c')]?_0x37b278[_0x8ea5('0x1c')]['attributes']||null:null,'limit':_0x37b278['options']?_0x37b278['options'][_0x8ea5('0x1e')]||null:null,'include':_0x37b278[_0x8ea5('0x1c')]?_0x37b278[_0x8ea5('0x1c')][_0x8ea5('0x1f')]?_['map'](_0x37b278[_0x8ea5('0x1c')][_0x8ea5('0x1f')],function(_0x1ce66d){return{'model':db[_0x1ce66d[_0x8ea5('0x20')]],'as':_0x1ce66d['as'],'attributes':_0x1ce66d[_0x8ea5('0x21')],'include':_0x1ce66d[_0x8ea5('0x1f')]?_[_0x8ea5('0x22')](_0x1ce66d[_0x8ea5('0x1f')],function(_0x5a1305){return{'model':db[_0x5a1305['model']],'as':_0x5a1305['as'],'attributes':_0x5a1305[_0x8ea5('0x21')],'include':_0x5a1305[_0x8ea5('0x1f')]?_[_0x8ea5('0x22')](_0x5a1305[_0x8ea5('0x1f')],function(_0x2bc818){return{'model':db[_0x2bc818[_0x8ea5('0x20')]],'as':_0x2bc818['as'],'attributes':_0x2bc818[_0x8ea5('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa9495){logger['info'](_0x8ea5('0x19'),_0x37b278);logger[_0x8ea5('0x11')]('GetChatQueue',_0x37b278,JSON[_0x8ea5('0x13')](_0xa9495));_0x5882e6(_0xa9495);})[_0x8ea5('0x18')](function(_0x294b2f){logger[_0x8ea5('0x14')](_0x8ea5('0x19'),_0x294b2f[_0x8ea5('0x15')],_0x37b278);_0x103521(_0x1e0104['error'](0x1f4,_0x294b2f[_0x8ea5('0x15')]));});});};exports[_0x8ea5('0x23')]=function(_0x2ebf6b){var _0x5893aa=this;return new Promise(function(_0x1f9794,_0x39078e){return db[_0x8ea5('0x1a')][_0x8ea5('0x24')]({'raw':_0x2ebf6b[_0x8ea5('0x1c')]?_0x2ebf6b[_0x8ea5('0x1c')][_0x8ea5('0x25')]===undefined?!![]:![]:!![],'where':_0x2ebf6b[_0x8ea5('0x1c')]?_0x2ebf6b[_0x8ea5('0x1c')]['where']||null:null,'attributes':_0x2ebf6b[_0x8ea5('0x1c')]?_0x2ebf6b[_0x8ea5('0x1c')]['attributes']||null:null,'include':_0x2ebf6b[_0x8ea5('0x1c')]?_0x2ebf6b[_0x8ea5('0x1c')]['include']?_[_0x8ea5('0x22')](_0x2ebf6b[_0x8ea5('0x1c')][_0x8ea5('0x1f')],function(_0x267b76){return{'model':db[_0x267b76['model']],'as':_0x267b76['as'],'attributes':_0x267b76['attributes'],'include':_0x267b76['include']?_[_0x8ea5('0x22')](_0x267b76[_0x8ea5('0x1f')],function(_0x4c5e24){return{'model':db[_0x4c5e24['model']],'as':_0x4c5e24['as'],'attributes':_0x4c5e24['attributes'],'include':_0x4c5e24[_0x8ea5('0x1f')]?_[_0x8ea5('0x22')](_0x4c5e24['include'],function(_0x3398bf){return{'model':db[_0x3398bf[_0x8ea5('0x20')]],'as':_0x3398bf['as'],'attributes':_0x3398bf[_0x8ea5('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8ea5('0xe')](function(_0x239aab){logger[_0x8ea5('0x16')](_0x8ea5('0x23'),_0x2ebf6b);logger[_0x8ea5('0x11')](_0x8ea5('0x23'),_0x2ebf6b,JSON[_0x8ea5('0x13')](_0x239aab));_0x1f9794(_0x239aab);})[_0x8ea5('0x18')](function(_0x16e468){logger[_0x8ea5('0x14')](_0x8ea5('0x23'),_0x16e468[_0x8ea5('0x15')],_0x2ebf6b);_0x39078e(_0x5893aa[_0x8ea5('0x14')](0x1f4,_0x16e468[_0x8ea5('0x15')]));});});}; \ No newline at end of file +var _0xc7c4=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetChatQueue','ChatQueue','findAll','options','where','attributes','map','include','model','debug','ShowChatQueue','find','raw'];(function(_0x36bff5,_0x3156cb){var _0x80ade5=function(_0x5eee65){while(--_0x5eee65){_0x36bff5['push'](_0x36bff5['shift']());}};_0x80ade5(++_0x3156cb);}(_0xc7c4,0x17c));var _0x4c7c=function(_0x469b69,_0x1b9cc1){_0x469b69=_0x469b69-0x0;var _0x45c74f=_0xc7c4[_0x469b69];return _0x45c74f;};'use strict';var _=require(_0x4c7c('0x0'));var util=require(_0x4c7c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4c7c('0x2'));var fs=require('fs');var Redis=require(_0x4c7c('0x3'));var db=require(_0x4c7c('0x4'))['db'];var utils=require(_0x4c7c('0x5'));var logger=require(_0x4c7c('0x6'))(_0x4c7c('0x7'));var config=require('../../config/environment');var jayson=require(_0x4c7c('0x8'));var client=jayson[_0x4c7c('0x9')]['http']({'port':0x232a});config[_0x4c7c('0xa')]=_[_0x4c7c('0xb')](config[_0x4c7c('0xa')],{'host':_0x4c7c('0xc'),'port':0x18eb});var socket=require(_0x4c7c('0xd'))(new Redis(config[_0x4c7c('0xa')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x356328,_0x15dd8a,_0x57ade8){return new BPromise(function(_0x19d3f5,_0x232edf){return client[_0x4c7c('0xe')](_0x356328,_0x57ade8)[_0x4c7c('0xf')](function(_0x4d73d1){logger['info'](_0x4c7c('0x10'),_0x15dd8a,_0x4c7c('0x11'));logger['debug'](_0x4c7c('0x12'),_0x15dd8a,_0x4c7c('0x11'),JSON[_0x4c7c('0x13')](_0x4d73d1));if(_0x4d73d1[_0x4c7c('0x14')]){if(_0x4d73d1[_0x4c7c('0x14')]['code']===0x1f4){logger[_0x4c7c('0x14')](_0x4c7c('0x10'),_0x15dd8a,_0x4d73d1[_0x4c7c('0x14')][_0x4c7c('0x15')]);return _0x232edf(_0x4d73d1['error'][_0x4c7c('0x15')]);}logger[_0x4c7c('0x14')](_0x4c7c('0x10'),_0x15dd8a,_0x4d73d1[_0x4c7c('0x14')][_0x4c7c('0x15')]);return _0x19d3f5(_0x4d73d1[_0x4c7c('0x14')]['message']);}else{logger[_0x4c7c('0x16')](_0x4c7c('0x10'),_0x15dd8a,_0x4c7c('0x11'));_0x19d3f5(_0x4d73d1[_0x4c7c('0x17')][_0x4c7c('0x15')]);}})[_0x4c7c('0x18')](function(_0x3b43c8){logger[_0x4c7c('0x14')](_0x4c7c('0x10'),_0x15dd8a,_0x3b43c8);_0x232edf(_0x3b43c8);});});}exports[_0x4c7c('0x19')]=function(_0xa49f0d){var _0x55642b=this;return new Promise(function(_0x5b5880,_0x5774ef){return db[_0x4c7c('0x1a')][_0x4c7c('0x1b')]({'raw':_0xa49f0d['options']?_0xa49f0d[_0x4c7c('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xa49f0d['options']?_0xa49f0d[_0x4c7c('0x1c')][_0x4c7c('0x1d')]||null:null,'attributes':_0xa49f0d['options']?_0xa49f0d['options'][_0x4c7c('0x1e')]||null:null,'limit':_0xa49f0d[_0x4c7c('0x1c')]?_0xa49f0d[_0x4c7c('0x1c')]['limit']||null:null,'include':_0xa49f0d[_0x4c7c('0x1c')]?_0xa49f0d[_0x4c7c('0x1c')]['include']?_[_0x4c7c('0x1f')](_0xa49f0d[_0x4c7c('0x1c')][_0x4c7c('0x20')],function(_0x3bd211){return{'model':db[_0x3bd211['model']],'as':_0x3bd211['as'],'attributes':_0x3bd211['attributes'],'include':_0x3bd211[_0x4c7c('0x20')]?_[_0x4c7c('0x1f')](_0x3bd211[_0x4c7c('0x20')],function(_0x5ed28a){return{'model':db[_0x5ed28a[_0x4c7c('0x21')]],'as':_0x5ed28a['as'],'attributes':_0x5ed28a[_0x4c7c('0x1e')],'include':_0x5ed28a[_0x4c7c('0x20')]?_['map'](_0x5ed28a[_0x4c7c('0x20')],function(_0x4a9547){return{'model':db[_0x4a9547[_0x4c7c('0x21')]],'as':_0x4a9547['as'],'attributes':_0x4a9547[_0x4c7c('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f895c){logger[_0x4c7c('0x16')](_0x4c7c('0x19'),_0xa49f0d);logger[_0x4c7c('0x22')]('GetChatQueue',_0xa49f0d,JSON['stringify'](_0x1f895c));_0x5b5880(_0x1f895c);})['catch'](function(_0x1aeb0a){logger[_0x4c7c('0x14')](_0x4c7c('0x19'),_0x1aeb0a[_0x4c7c('0x15')],_0xa49f0d);_0x5774ef(_0x55642b[_0x4c7c('0x14')](0x1f4,_0x1aeb0a[_0x4c7c('0x15')]));});});};exports[_0x4c7c('0x23')]=function(_0x306524){var _0x2024d5=this;return new Promise(function(_0x194626,_0x200c6a){return db['ChatQueue'][_0x4c7c('0x24')]({'raw':_0x306524[_0x4c7c('0x1c')]?_0x306524[_0x4c7c('0x1c')][_0x4c7c('0x25')]===undefined?!![]:![]:!![],'where':_0x306524['options']?_0x306524['options'][_0x4c7c('0x1d')]||null:null,'attributes':_0x306524['options']?_0x306524[_0x4c7c('0x1c')]['attributes']||null:null,'include':_0x306524[_0x4c7c('0x1c')]?_0x306524[_0x4c7c('0x1c')][_0x4c7c('0x20')]?_[_0x4c7c('0x1f')](_0x306524[_0x4c7c('0x1c')]['include'],function(_0x32831d){return{'model':db[_0x32831d[_0x4c7c('0x21')]],'as':_0x32831d['as'],'attributes':_0x32831d['attributes'],'include':_0x32831d['include']?_[_0x4c7c('0x1f')](_0x32831d['include'],function(_0x43b2d6){return{'model':db[_0x43b2d6['model']],'as':_0x43b2d6['as'],'attributes':_0x43b2d6[_0x4c7c('0x1e')],'include':_0x43b2d6[_0x4c7c('0x20')]?_[_0x4c7c('0x1f')](_0x43b2d6[_0x4c7c('0x20')],function(_0x3c7c28){return{'model':db[_0x3c7c28[_0x4c7c('0x21')]],'as':_0x3c7c28['as'],'attributes':_0x3c7c28[_0x4c7c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4c7c('0xf')](function(_0xb55d79){logger[_0x4c7c('0x16')](_0x4c7c('0x23'),_0x306524);logger[_0x4c7c('0x22')](_0x4c7c('0x23'),_0x306524,JSON[_0x4c7c('0x13')](_0xb55d79));_0x194626(_0xb55d79);})[_0x4c7c('0x18')](function(_0xe57ca8){logger['error'](_0x4c7c('0x23'),_0xe57ca8[_0x4c7c('0x15')],_0x306524);_0x200c6a(_0x2024d5[_0x4c7c('0x14')](0x1f4,_0xe57ca8['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index ffa5362..df8917e 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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 ab7b2ca..abf82ca 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 _0x40c2=['multer','util','path','connect-timeout','Router','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports'];(function(_0x2b9d6e,_0x1d84b5){var _0x45504a=function(_0x2f59f9){while(--_0x2f59f9){_0x2b9d6e['push'](_0x2b9d6e['shift']());}};_0x45504a(++_0x1d84b5);}(_0x40c2,0x1dc));var _0x240c=function(_0x3d04d1,_0x184e1f){_0x3d04d1=_0x3d04d1-0x0;var _0x2acc03=_0x40c2[_0x3d04d1];return _0x2acc03;};'use strict';var multer=require(_0x240c('0x0'));var util=require(_0x240c('0x1'));var path=require(_0x240c('0x2'));var timeout=require(_0x240c('0x3'));var express=require('express');var router=express[_0x240c('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x240c('0x5'));var controller=require(_0x240c('0x6'));router[_0x240c('0x7')]('/',auth[_0x240c('0x8')](),controller[_0x240c('0x9')]);router[_0x240c('0x7')]('/describe',auth[_0x240c('0x8')](),controller[_0x240c('0xa')]);router[_0x240c('0x7')](_0x240c('0xb'),auth[_0x240c('0x8')](),controller[_0x240c('0xc')]);router[_0x240c('0x7')](_0x240c('0xd'),auth[_0x240c('0x8')](),controller['getMembers']);router[_0x240c('0x7')](_0x240c('0xe'),auth[_0x240c('0x8')](),controller[_0x240c('0xf')]);router[_0x240c('0x7')](_0x240c('0x10'),auth[_0x240c('0x8')](),controller[_0x240c('0x11')]);router[_0x240c('0x12')]('/',auth[_0x240c('0x8')](),controller[_0x240c('0x13')]);router[_0x240c('0x12')](_0x240c('0xe'),auth[_0x240c('0x8')](),controller[_0x240c('0x14')]);router[_0x240c('0x12')](_0x240c('0x10'),auth[_0x240c('0x8')](),controller[_0x240c('0x15')]);router[_0x240c('0x16')]('/:id',auth[_0x240c('0x8')](),controller[_0x240c('0x17')]);router[_0x240c('0x18')](_0x240c('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x240c('0x18')](_0x240c('0xe'),auth[_0x240c('0x8')](),controller[_0x240c('0x19')]);router['delete'](_0x240c('0x10'),auth[_0x240c('0x8')](),controller[_0x240c('0x1a')]);module[_0x240c('0x1b')]=router; \ No newline at end of file +var _0xccbe=['show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','put','delete','destroy','removeAgents','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id'];(function(_0xf26bf5,_0x3835fb){var _0x30e480=function(_0x27fdc6){while(--_0x27fdc6){_0xf26bf5['push'](_0xf26bf5['shift']());}};_0x30e480(++_0x3835fb);}(_0xccbe,0x1ce));var _0xeccb=function(_0x4702ee,_0xaf6a45){_0x4702ee=_0x4702ee-0x0;var _0x62ca7d=_0xccbe[_0x4702ee];return _0x62ca7d;};'use strict';var multer=require('multer');var util=require(_0xeccb('0x0'));var path=require(_0xeccb('0x1'));var timeout=require(_0xeccb('0x2'));var express=require(_0xeccb('0x3'));var router=express[_0xeccb('0x4')]();var auth=require(_0xeccb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xeccb('0x6'));var controller=require(_0xeccb('0x7'));router[_0xeccb('0x8')]('/',auth[_0xeccb('0x9')](),controller[_0xeccb('0xa')]);router[_0xeccb('0x8')]('/describe',auth[_0xeccb('0x9')](),controller[_0xeccb('0xb')]);router[_0xeccb('0x8')](_0xeccb('0xc'),auth['isAuthenticated'](),controller[_0xeccb('0xd')]);router[_0xeccb('0x8')](_0xeccb('0xe'),auth[_0xeccb('0x9')](),controller[_0xeccb('0xf')]);router['get'](_0xeccb('0x10'),auth[_0xeccb('0x9')](),controller['getTeams']);router[_0xeccb('0x8')](_0xeccb('0x11'),auth[_0xeccb('0x9')](),controller[_0xeccb('0x12')]);router[_0xeccb('0x13')]('/',auth[_0xeccb('0x9')](),controller['create']);router[_0xeccb('0x13')](_0xeccb('0x10'),auth[_0xeccb('0x9')](),controller[_0xeccb('0x14')]);router[_0xeccb('0x13')](_0xeccb('0x11'),auth[_0xeccb('0x9')](),controller['addAgents']);router[_0xeccb('0x15')](_0xeccb('0xc'),auth[_0xeccb('0x9')](),controller['update']);router[_0xeccb('0x16')]('/:id',auth[_0xeccb('0x9')](),controller[_0xeccb('0x17')]);router['delete'](_0xeccb('0x10'),auth['isAuthenticated'](),controller['removeTeams']);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xeccb('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 15bce8a..cb6fb07 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 _0xbb45=['STRING','DATE','sequelize','exports'];(function(_0x45d25f,_0x414062){var _0x5eedff=function(_0x3bd135){while(--_0x3bd135){_0x45d25f['push'](_0x45d25f['shift']());}};_0x5eedff(++_0x414062);}(_0xbb45,0x86));var _0x5bb4=function(_0x1d8014,_0x1b2cd7){_0x1d8014=_0x1d8014-0x0;var _0x5529c1=_0xbb45[_0x1d8014];return _0x5529c1;};'use strict';var moment=require('moment');var Sequelize=require(_0x5bb4('0x0'));module[_0x5bb4('0x1')]={'uniqueid':{'type':Sequelize[_0x5bb4('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5bb4('0x2')]},'joinAt':{'type':Sequelize[_0x5bb4('0x3')]},'leaveAt':{'type':Sequelize[_0x5bb4('0x3')]},'acceptAt':{'type':Sequelize[_0x5bb4('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x5bb4('0x2')]}}; \ No newline at end of file +var _0x1e1f=['exports','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1e1f,0xb4));var _0xf1e1=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x1e1f[_0x618414];return _0x21c19a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xf1e1('0x0')]={'uniqueid':{'type':Sequelize[_0xf1e1('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xf1e1('0x2')]},'leaveAt':{'type':Sequelize[_0xf1e1('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf1e1('0x2')]},'reason':{'type':Sequelize[_0xf1e1('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index e07bd50..e924df6 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 _0xca47=['intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','field','filter','merge','options','count','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','zip-dir','bluebird','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/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','apply','update','then','destroy','stack','name','send','index','ChatQueueReport','rawAttributes','model','keys','query','filters','attributes'];(function(_0x406876,_0x4e0b70){var _0x221ac7=function(_0x2a9d70){while(--_0x2a9d70){_0x406876['push'](_0x406876['shift']());}};_0x221ac7(++_0x4e0b70);}(_0xca47,0x12c));var _0x7ca4=function(_0x2f8aa9,_0x63e826){_0x2f8aa9=_0x2f8aa9-0x0;var _0x66e0c0=_0xca47[_0x2f8aa9];return _0x66e0c0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7ca4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7ca4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7ca4('0x2'));var Mustache=require(_0x7ca4('0x3'));var util=require(_0x7ca4('0x4'));var path=require(_0x7ca4('0x5'));var sox=require(_0x7ca4('0x6'));var csv=require(_0x7ca4('0x7'));var ejs=require(_0x7ca4('0x8'));var fs=require('fs');var _=require(_0x7ca4('0x9'));var squel=require(_0x7ca4('0xa'));var crypto=require(_0x7ca4('0xb'));var jsforce=require(_0x7ca4('0xc'));var deskjs=require(_0x7ca4('0xd'));var toCsv=require(_0x7ca4('0x7'));var querystring=require(_0x7ca4('0xe'));var Papa=require(_0x7ca4('0xf'));var Redis=require(_0x7ca4('0x10'));var authService=require(_0x7ca4('0x11'));var qs=require(_0x7ca4('0x12'));var hardwareService=require(_0x7ca4('0x13'));var logger=require(_0x7ca4('0x14'))(_0x7ca4('0x15'));var utils=require('../../config/utils');var config=require(_0x7ca4('0x16'));var db=require(_0x7ca4('0x17'))['db'];function respondWithStatusCode(_0x2a1089,_0x2a4075){_0x2a4075=_0x2a4075||0xcc;return function(_0x42173c){if(_0x42173c){return _0x2a1089[_0x7ca4('0x18')](_0x2a4075);}return _0x2a1089[_0x7ca4('0x19')](_0x2a4075)[_0x7ca4('0x1a')]();};}function respondWithResult(_0xc56002,_0x594760){_0x594760=_0x594760||0xc8;return function(_0x1974c8){if(_0x1974c8){return _0xc56002[_0x7ca4('0x19')](_0x594760)['json'](_0x1974c8);}};}function respondWithFilteredResult(_0x155e4c,_0x27dc7e){return function(_0x1eef5a){if(_0x1eef5a){var _0x2fde1d=_0x1eef5a['count'],_0x1c87ae=_0x27dc7e['offset'],_0x53fc5a=_0x27dc7e[_0x7ca4('0x1b')]+_0x27dc7e[_0x7ca4('0x1c')],_0x4b35cc;if(_0x53fc5a>=_0x2fde1d){_0x53fc5a=_0x2fde1d;_0x4b35cc=0xc8;}else{_0x4b35cc=0xce;}_0x155e4c['status'](_0x4b35cc);return _0x155e4c[_0x7ca4('0x1d')]('Content-Range',_0x1c87ae+'-'+_0x53fc5a+'/'+_0x2fde1d)['json'](_0x1eef5a);}return null;};}function patchUpdates(_0x4582e1){return function(_0x144923){try{jsonpatch[_0x7ca4('0x1e')](_0x144923,_0x4582e1,!![]);}catch(_0x5a8bd5){return BPromise['reject'](_0x5a8bd5);}return _0x144923['save']();};}function saveUpdates(_0x1a8586,_0x51e8e5){return function(_0x220708){if(_0x220708){return _0x220708[_0x7ca4('0x1f')](_0x1a8586)[_0x7ca4('0x20')](function(_0x44a994){return _0x44a994;});}return null;};}function removeEntity(_0x2044e5,_0x14f7d3){return function(_0xeea24f){if(_0xeea24f){return _0xeea24f[_0x7ca4('0x21')]()[_0x7ca4('0x20')](function(){_0x2044e5[_0x7ca4('0x19')](0xcc)[_0x7ca4('0x1a')]();});}};}function handleEntityNotFound(_0x186579,_0x275597){return function(_0x1aea8e){if(!_0x1aea8e){_0x186579[_0x7ca4('0x18')](0x194);}return _0x1aea8e;};}function handleError(_0x31eba8,_0x5cf085){_0x5cf085=_0x5cf085||0x1f4;return function(_0xb931ea){logger['error'](_0xb931ea[_0x7ca4('0x22')]);if(_0xb931ea[_0x7ca4('0x23')]){delete _0xb931ea[_0x7ca4('0x23')];}_0x31eba8[_0x7ca4('0x19')](_0x5cf085)[_0x7ca4('0x24')](_0xb931ea);};}exports[_0x7ca4('0x25')]=function(_0x4ba9f3,_0x176c73){var _0x1f977d={},_0x1ae7d6={},_0x5b070f={'count':0x0,'rows':[]};var _0x438300=db[_0x7ca4('0x26')][_0x7ca4('0x27')];_0x1ae7d6[_0x7ca4('0x28')]=_[_0x7ca4('0x29')](_0x438300);_0x1ae7d6[_0x7ca4('0x2a')]=_[_0x7ca4('0x29')](_0x4ba9f3[_0x7ca4('0x2a')]);_0x1ae7d6[_0x7ca4('0x2b')]=_['intersection'](_0x1ae7d6[_0x7ca4('0x28')],_0x1ae7d6['query']);_0x1f977d[_0x7ca4('0x2c')]=_[_0x7ca4('0x2d')](_0x1ae7d6[_0x7ca4('0x28')],qs[_0x7ca4('0x2e')](_0x4ba9f3[_0x7ca4('0x2a')][_0x7ca4('0x2e')]));_0x1f977d[_0x7ca4('0x2c')]=_0x1f977d[_0x7ca4('0x2c')][_0x7ca4('0x2f')]?_0x1f977d['attributes']:_0x1ae7d6['model'];if(!_0x4ba9f3['query'][_0x7ca4('0x30')](_0x7ca4('0x31'))){_0x1f977d[_0x7ca4('0x1c')]=qs[_0x7ca4('0x1c')](_0x4ba9f3[_0x7ca4('0x2a')][_0x7ca4('0x1c')]);_0x1f977d[_0x7ca4('0x1b')]=qs['offset'](_0x4ba9f3[_0x7ca4('0x2a')][_0x7ca4('0x1b')]);}_0x1f977d['order']=qs[_0x7ca4('0x32')](_0x4ba9f3[_0x7ca4('0x2a')]['sort']);_0x1f977d[_0x7ca4('0x33')]=qs[_0x7ca4('0x2b')](_[_0x7ca4('0x34')](_0x4ba9f3[_0x7ca4('0x2a')],_0x1ae7d6[_0x7ca4('0x2b')]));if(_0x4ba9f3[_0x7ca4('0x2a')]['filter']){_0x1f977d[_0x7ca4('0x33')]=_['merge'](_0x1f977d['where'],{'$or':_['map'](_0x438300,function(_0x4498ce){if(_0x4498ce['type']['key']!==_0x7ca4('0x35')){var _0x16a5c3={};_0x16a5c3[_0x4498ce[_0x7ca4('0x36')]]={'$like':'%'+_0x4ba9f3[_0x7ca4('0x2a')][_0x7ca4('0x37')]+'%'};return _0x16a5c3;}})});}_0x1f977d=_[_0x7ca4('0x38')]({},_0x1f977d,_0x4ba9f3[_0x7ca4('0x39')]);var _0xa391b5={'where':_0x1f977d['where']};return db[_0x7ca4('0x26')][_0x7ca4('0x3a')](_0xa391b5)['then'](function(_0x3c8d9d){_0x5b070f[_0x7ca4('0x3a')]=_0x3c8d9d;if(_0x4ba9f3['query'][_0x7ca4('0x3b')]){_0x1f977d[_0x7ca4('0x3c')]=[{'all':!![]}];}return db[_0x7ca4('0x26')][_0x7ca4('0x3d')](_0x1f977d);})[_0x7ca4('0x20')](function(_0xd26fec){_0x5b070f['rows']=_0xd26fec;return _0x5b070f;})['then'](respondWithFilteredResult(_0x176c73,_0x1f977d))[_0x7ca4('0x3e')](handleError(_0x176c73,null));};exports[_0x7ca4('0x3f')]=function(_0x3f7d0d,_0x9d41f1){var _0x472a6e={'raw':!![],'where':{'id':_0x3f7d0d[_0x7ca4('0x40')]['id']}},_0x4ece70={};_0x4ece70['model']=_[_0x7ca4('0x29')](db['ChatQueueReport'][_0x7ca4('0x27')]);_0x4ece70[_0x7ca4('0x2a')]=_['keys'](_0x3f7d0d[_0x7ca4('0x2a')]);_0x4ece70[_0x7ca4('0x2b')]=_[_0x7ca4('0x2d')](_0x4ece70[_0x7ca4('0x28')],_0x4ece70[_0x7ca4('0x2a')]);_0x472a6e[_0x7ca4('0x2c')]=_[_0x7ca4('0x2d')](_0x4ece70[_0x7ca4('0x28')],qs[_0x7ca4('0x2e')](_0x3f7d0d['query']['fields']));_0x472a6e[_0x7ca4('0x2c')]=_0x472a6e['attributes'][_0x7ca4('0x2f')]?_0x472a6e['attributes']:_0x4ece70['model'];if(_0x3f7d0d[_0x7ca4('0x2a')]['includeAll']){_0x472a6e[_0x7ca4('0x3c')]=[{'all':!![]}];}_0x472a6e=_[_0x7ca4('0x38')]({},_0x472a6e,_0x3f7d0d[_0x7ca4('0x39')]);return db[_0x7ca4('0x26')][_0x7ca4('0x41')](_0x472a6e)[_0x7ca4('0x20')](handleEntityNotFound(_0x9d41f1,null))['then'](respondWithResult(_0x9d41f1,null))['catch'](handleError(_0x9d41f1,null));};exports['create']=function(_0x10adda,_0x204f41){return db['ChatQueueReport'][_0x7ca4('0x42')](_0x10adda[_0x7ca4('0x43')],{})[_0x7ca4('0x20')](respondWithResult(_0x204f41,0xc9))[_0x7ca4('0x3e')](handleError(_0x204f41,null));};exports[_0x7ca4('0x1f')]=function(_0x14ce35,_0x3b060a){if(_0x14ce35[_0x7ca4('0x43')]['id']){delete _0x14ce35['body']['id'];}return db['ChatQueueReport'][_0x7ca4('0x41')]({'where':{'id':_0x14ce35[_0x7ca4('0x40')]['id']}})[_0x7ca4('0x20')](handleEntityNotFound(_0x3b060a,null))[_0x7ca4('0x20')](saveUpdates(_0x14ce35[_0x7ca4('0x43')],null))[_0x7ca4('0x20')](respondWithResult(_0x3b060a,null))[_0x7ca4('0x3e')](handleError(_0x3b060a,null));};exports[_0x7ca4('0x21')]=function(_0x5854b7,_0x4d5d67){return db[_0x7ca4('0x26')][_0x7ca4('0x41')]({'where':{'id':_0x5854b7[_0x7ca4('0x40')]['id']}})[_0x7ca4('0x20')](handleEntityNotFound(_0x4d5d67,null))[_0x7ca4('0x20')](removeEntity(_0x4d5d67,null))['catch'](handleError(_0x4d5d67,null));};exports['describe']=function(_0x4897db,_0x7b5f68){return db[_0x7ca4('0x26')][_0x7ca4('0x44')]()['then'](respondWithResult(_0x7b5f68,null))[_0x7ca4('0x3e')](handleError(_0x7b5f68,null));}; \ No newline at end of file +var _0x517b=['name','send','ChatQueueReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','field','options','include','findAll','rows','catch','params','includeAll','find','create','body','update','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','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','then','destroy','error','stack'];(function(_0x2e986d,_0x4b6b63){var _0x351c79=function(_0xf178c7){while(--_0xf178c7){_0x2e986d['push'](_0x2e986d['shift']());}};_0x351c79(++_0x4b6b63);}(_0x517b,0x132));var _0xb517=function(_0x31c0db,_0x9c5a04){_0x31c0db=_0x31c0db-0x0;var _0x4c7d16=_0x517b[_0x31c0db];return _0x4c7d16;};'use strict';var pdf=require(_0xb517('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb517('0x1'));var zipdir=require(_0xb517('0x2'));var jsonpatch=require(_0xb517('0x3'));var rp=require(_0xb517('0x4'));var moment=require('moment');var BPromise=require(_0xb517('0x5'));var Mustache=require(_0xb517('0x6'));var util=require('util');var path=require(_0xb517('0x7'));var sox=require('sox');var csv=require(_0xb517('0x8'));var ejs=require(_0xb517('0x9'));var fs=require('fs');var _=require(_0xb517('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb517('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb517('0xb'));var authService=require(_0xb517('0xc'));var qs=require(_0xb517('0xd'));var hardwareService=require(_0xb517('0xe'));var logger=require(_0xb517('0xf'))(_0xb517('0x10'));var utils=require(_0xb517('0x11'));var config=require(_0xb517('0x12'));var db=require(_0xb517('0x13'))['db'];function respondWithStatusCode(_0x1a3325,_0x8f0117){_0x8f0117=_0x8f0117||0xcc;return function(_0xbe610b){if(_0xbe610b){return _0x1a3325[_0xb517('0x14')](_0x8f0117);}return _0x1a3325[_0xb517('0x15')](_0x8f0117)[_0xb517('0x16')]();};}function respondWithResult(_0x194fe3,_0x1ebbc4){_0x1ebbc4=_0x1ebbc4||0xc8;return function(_0x1f97b2){if(_0x1f97b2){return _0x194fe3['status'](_0x1ebbc4)[_0xb517('0x17')](_0x1f97b2);}};}function respondWithFilteredResult(_0x3e9b08,_0x37babd){return function(_0x21b77f){if(_0x21b77f){var _0x50ae70=_0x21b77f[_0xb517('0x18')],_0x2baf5d=_0x37babd[_0xb517('0x19')],_0x296140=_0x37babd[_0xb517('0x19')]+_0x37babd[_0xb517('0x1a')],_0x5e9805;if(_0x296140>=_0x50ae70){_0x296140=_0x50ae70;_0x5e9805=0xc8;}else{_0x5e9805=0xce;}_0x3e9b08[_0xb517('0x15')](_0x5e9805);return _0x3e9b08[_0xb517('0x1b')](_0xb517('0x1c'),_0x2baf5d+'-'+_0x296140+'/'+_0x50ae70)['json'](_0x21b77f);}return null;};}function patchUpdates(_0x5c4122){return function(_0x4671d5){try{jsonpatch[_0xb517('0x1d')](_0x4671d5,_0x5c4122,!![]);}catch(_0x46c046){return BPromise['reject'](_0x46c046);}return _0x4671d5['save']();};}function saveUpdates(_0x451ea6,_0x1d533c){return function(_0x3a76fd){if(_0x3a76fd){return _0x3a76fd['update'](_0x451ea6)[_0xb517('0x1e')](function(_0x3c8fcb){return _0x3c8fcb;});}return null;};}function removeEntity(_0x32463c,_0x3dbf79){return function(_0x96d465){if(_0x96d465){return _0x96d465[_0xb517('0x1f')]()[_0xb517('0x1e')](function(){_0x32463c[_0xb517('0x15')](0xcc)[_0xb517('0x16')]();});}};}function handleEntityNotFound(_0x5a5ad5,_0x151f35){return function(_0x36696c){if(!_0x36696c){_0x5a5ad5[_0xb517('0x14')](0x194);}return _0x36696c;};}function handleError(_0x1e0dec,_0x2add63){_0x2add63=_0x2add63||0x1f4;return function(_0x5ab465){logger[_0xb517('0x20')](_0x5ab465[_0xb517('0x21')]);if(_0x5ab465[_0xb517('0x22')]){delete _0x5ab465[_0xb517('0x22')];}_0x1e0dec['status'](_0x2add63)[_0xb517('0x23')](_0x5ab465);};}exports['index']=function(_0x16e59c,_0x28b464){var _0x265d8f={},_0x157081={},_0xe216ff={'count':0x0,'rows':[]};var _0x1f8459=db[_0xb517('0x24')][_0xb517('0x25')];_0x157081[_0xb517('0x26')]=_[_0xb517('0x27')](_0x1f8459);_0x157081[_0xb517('0x28')]=_[_0xb517('0x27')](_0x16e59c[_0xb517('0x28')]);_0x157081[_0xb517('0x29')]=_['intersection'](_0x157081['model'],_0x157081['query']);_0x265d8f[_0xb517('0x2a')]=_[_0xb517('0x2b')](_0x157081[_0xb517('0x26')],qs['fields'](_0x16e59c[_0xb517('0x28')][_0xb517('0x2c')]));_0x265d8f['attributes']=_0x265d8f['attributes'][_0xb517('0x2d')]?_0x265d8f[_0xb517('0x2a')]:_0x157081['model'];if(!_0x16e59c[_0xb517('0x28')][_0xb517('0x2e')](_0xb517('0x2f'))){_0x265d8f['limit']=qs[_0xb517('0x1a')](_0x16e59c[_0xb517('0x28')]['limit']);_0x265d8f[_0xb517('0x19')]=qs[_0xb517('0x19')](_0x16e59c[_0xb517('0x28')]['offset']);}_0x265d8f[_0xb517('0x30')]=qs[_0xb517('0x31')](_0x16e59c[_0xb517('0x28')]['sort']);_0x265d8f[_0xb517('0x32')]=qs[_0xb517('0x29')](_[_0xb517('0x33')](_0x16e59c['query'],_0x157081['filters']));if(_0x16e59c['query'][_0xb517('0x34')]){_0x265d8f[_0xb517('0x32')]=_[_0xb517('0x35')](_0x265d8f[_0xb517('0x32')],{'$or':_[_0xb517('0x36')](_0x1f8459,function(_0x496080){if(_0x496080['type']['key']!=='VIRTUAL'){var _0x1d2e18={};_0x1d2e18[_0x496080[_0xb517('0x37')]]={'$like':'%'+_0x16e59c[_0xb517('0x28')][_0xb517('0x34')]+'%'};return _0x1d2e18;}})});}_0x265d8f=_[_0xb517('0x35')]({},_0x265d8f,_0x16e59c[_0xb517('0x38')]);var _0x165d70={'where':_0x265d8f[_0xb517('0x32')]};return db[_0xb517('0x24')]['count'](_0x165d70)[_0xb517('0x1e')](function(_0x35f1f8){_0xe216ff[_0xb517('0x18')]=_0x35f1f8;if(_0x16e59c['query']['includeAll']){_0x265d8f[_0xb517('0x39')]=[{'all':!![]}];}return db[_0xb517('0x24')][_0xb517('0x3a')](_0x265d8f);})['then'](function(_0x3eb2d7){_0xe216ff[_0xb517('0x3b')]=_0x3eb2d7;return _0xe216ff;})[_0xb517('0x1e')](respondWithFilteredResult(_0x28b464,_0x265d8f))[_0xb517('0x3c')](handleError(_0x28b464,null));};exports['show']=function(_0x801abd,_0x559152){var _0x1e7dcc={'raw':!![],'where':{'id':_0x801abd[_0xb517('0x3d')]['id']}},_0x124a93={};_0x124a93['model']=_[_0xb517('0x27')](db['ChatQueueReport']['rawAttributes']);_0x124a93[_0xb517('0x28')]=_[_0xb517('0x27')](_0x801abd[_0xb517('0x28')]);_0x124a93[_0xb517('0x29')]=_[_0xb517('0x2b')](_0x124a93['model'],_0x124a93[_0xb517('0x28')]);_0x1e7dcc[_0xb517('0x2a')]=_[_0xb517('0x2b')](_0x124a93[_0xb517('0x26')],qs[_0xb517('0x2c')](_0x801abd[_0xb517('0x28')]['fields']));_0x1e7dcc[_0xb517('0x2a')]=_0x1e7dcc[_0xb517('0x2a')]['length']?_0x1e7dcc[_0xb517('0x2a')]:_0x124a93['model'];if(_0x801abd['query'][_0xb517('0x3e')]){_0x1e7dcc[_0xb517('0x39')]=[{'all':!![]}];}_0x1e7dcc=_[_0xb517('0x35')]({},_0x1e7dcc,_0x801abd[_0xb517('0x38')]);return db[_0xb517('0x24')][_0xb517('0x3f')](_0x1e7dcc)[_0xb517('0x1e')](handleEntityNotFound(_0x559152,null))[_0xb517('0x1e')](respondWithResult(_0x559152,null))['catch'](handleError(_0x559152,null));};exports[_0xb517('0x40')]=function(_0x1641b6,_0xd77f1e){return db[_0xb517('0x24')][_0xb517('0x40')](_0x1641b6[_0xb517('0x41')],{})[_0xb517('0x1e')](respondWithResult(_0xd77f1e,0xc9))[_0xb517('0x3c')](handleError(_0xd77f1e,null));};exports[_0xb517('0x42')]=function(_0x16f063,_0x3262da){if(_0x16f063['body']['id']){delete _0x16f063[_0xb517('0x41')]['id'];}return db[_0xb517('0x24')][_0xb517('0x3f')]({'where':{'id':_0x16f063[_0xb517('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3262da,null))[_0xb517('0x1e')](saveUpdates(_0x16f063[_0xb517('0x41')],null))[_0xb517('0x1e')](respondWithResult(_0x3262da,null))[_0xb517('0x3c')](handleError(_0x3262da,null));};exports['destroy']=function(_0x5a9811,_0x4086df){return db[_0xb517('0x24')][_0xb517('0x3f')]({'where':{'id':_0x5a9811['params']['id']}})['then'](handleEntityNotFound(_0x4086df,null))['then'](removeEntity(_0x4086df,null))[_0xb517('0x3c')](handleError(_0x4086df,null));};exports['describe']=function(_0x2d6122,_0x518883){return db[_0xb517('0x24')][_0xb517('0x43')]()[_0xb517('0x1e')](respondWithResult(_0x518883,null))['catch'](handleError(_0x518883,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 6397781..0430408 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 _0xa869=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash'];(function(_0x596e91,_0x4f913e){var _0x5901b5=function(_0x531760){while(--_0x531760){_0x596e91['push'](_0x596e91['shift']());}};_0x5901b5(++_0x4f913e);}(_0xa869,0xe0));var _0x9a86=function(_0x1743d0,_0xae0649){_0x1743d0=_0x1743d0-0x0;var _0x58da54=_0xa869[_0x1743d0];return _0x58da54;};'use strict';var _=require(_0x9a86('0x0'));var util=require(_0x9a86('0x1'));var logger=require(_0x9a86('0x2'))(_0x9a86('0x3'));var moment=require('moment');var BPromise=require(_0x9a86('0x4'));var rp=require(_0x9a86('0x5'));var fs=require('fs');var path=require(_0x9a86('0x6'));var rimraf=require(_0x9a86('0x7'));var config=require(_0x9a86('0x8'));var attributes=require(_0x9a86('0x9'));module[_0x9a86('0xa')]=function(_0x310fe3,_0x5a705d){return _0x310fe3[_0x9a86('0xb')](_0x9a86('0xc'),attributes,{'tableName':_0x9a86('0xd'),'paranoid':![],'indexes':[{'name':_0x9a86('0xe'),'fields':[_0x9a86('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5965=['request-promise','path','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5965,0x7d));var _0x5596=function(_0xd0baeb,_0x4b3961){_0xd0baeb=_0xd0baeb-0x0;var _0x48862d=_0x5965[_0xd0baeb];return _0x48862d;};'use strict';var _=require(_0x5596('0x0'));var util=require('util');var logger=require(_0x5596('0x1'))(_0x5596('0x2'));var moment=require(_0x5596('0x3'));var BPromise=require(_0x5596('0x4'));var rp=require(_0x5596('0x5'));var fs=require('fs');var path=require(_0x5596('0x6'));var rimraf=require('rimraf');var config=require(_0x5596('0x7'));var attributes=require(_0x5596('0x8'));module[_0x5596('0x9')]=function(_0x2f1446,_0x147310){return _0x2f1446[_0x5596('0xa')](_0x5596('0xb'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5596('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 8ddb745..9afed44 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 _0xf1b3=['options','stringify','UpdateChatQueueReport','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateChatQueueReport','create','body'];(function(_0x4b54fb,_0x2150e4){var _0x375eb4=function(_0x461679){while(--_0x461679){_0x4b54fb['push'](_0x4b54fb['shift']());}};_0x375eb4(++_0x2150e4);}(_0xf1b3,0x150));var _0x3f1b=function(_0x445547,_0x7e4818){_0x445547=_0x445547-0x0;var _0x5ed6c6=_0xf1b3[_0x445547];return _0x5ed6c6;};'use strict';var _=require(_0x3f1b('0x0'));var util=require(_0x3f1b('0x1'));var moment=require(_0x3f1b('0x2'));var BPromise=require(_0x3f1b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f1b('0x4'));var db=require(_0x3f1b('0x5'))['db'];var utils=require(_0x3f1b('0x6'));var logger=require(_0x3f1b('0x7'))(_0x3f1b('0x8'));var config=require('../../config/environment');var jayson=require(_0x3f1b('0x9'));var client=jayson[_0x3f1b('0xa')][_0x3f1b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30d343,_0x24163e,_0x830861){return new BPromise(function(_0x5369cd,_0x4b9358){return client[_0x3f1b('0xc')](_0x30d343,_0x830861)[_0x3f1b('0xd')](function(_0x4ed887){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x24163e,'request\x20sent');logger[_0x3f1b('0xe')](_0x3f1b('0xf'),_0x24163e,_0x3f1b('0x10'),JSON['stringify'](_0x4ed887));if(_0x4ed887['error']){if(_0x4ed887[_0x3f1b('0x11')][_0x3f1b('0x12')]===0x1f4){logger[_0x3f1b('0x11')](_0x3f1b('0x13'),_0x24163e,_0x4ed887[_0x3f1b('0x11')][_0x3f1b('0x14')]);return _0x4b9358(_0x4ed887[_0x3f1b('0x11')][_0x3f1b('0x14')]);}logger['error'](_0x3f1b('0x13'),_0x24163e,_0x4ed887[_0x3f1b('0x11')][_0x3f1b('0x14')]);return _0x5369cd(_0x4ed887[_0x3f1b('0x11')][_0x3f1b('0x14')]);}else{logger[_0x3f1b('0x15')](_0x3f1b('0x13'),_0x24163e,_0x3f1b('0x10'));_0x5369cd(_0x4ed887[_0x3f1b('0x16')]['message']);}})[_0x3f1b('0x17')](function(_0xeb01b8){logger[_0x3f1b('0x11')](_0x3f1b('0x13'),_0x24163e,_0xeb01b8);_0x4b9358(_0xeb01b8);});});}exports[_0x3f1b('0x18')]=function(_0x2a4258){var _0x25e4db=this;return new Promise(function(_0x3538fe,_0x1b6fd5){return db['ChatQueueReport'][_0x3f1b('0x19')](_0x2a4258[_0x3f1b('0x1a')],{'raw':_0x2a4258[_0x3f1b('0x1b')]?_0x2a4258[_0x3f1b('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x3f1b('0xd')](function(_0xa83948){logger[_0x3f1b('0x15')](_0x3f1b('0x18'),_0x2a4258);logger[_0x3f1b('0xe')](_0x3f1b('0x18'),_0x2a4258,JSON[_0x3f1b('0x1c')](_0xa83948));_0x3538fe(_0xa83948);})[_0x3f1b('0x17')](function(_0x195941){logger[_0x3f1b('0x11')](_0x3f1b('0x18'),_0x195941[_0x3f1b('0x14')],_0x2a4258);_0x1b6fd5(_0x25e4db['error'](0x1f4,_0x195941[_0x3f1b('0x14')]));});});};exports[_0x3f1b('0x1d')]=function(_0xacfec8){var _0x6c6e6d=this;return new Promise(function(_0xb44258,_0x1b49e4){return db['ChatQueueReport']['update'](_0xacfec8[_0x3f1b('0x1a')],{'raw':_0xacfec8[_0x3f1b('0x1b')]?_0xacfec8[_0x3f1b('0x1b')][_0x3f1b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xacfec8['options']?_0xacfec8[_0x3f1b('0x1b')][_0x3f1b('0x1f')]||null:null,'attributes':_0xacfec8[_0x3f1b('0x1b')]?_0xacfec8[_0x3f1b('0x1b')]['attributes']||null:null,'limit':_0xacfec8[_0x3f1b('0x1b')]?_0xacfec8[_0x3f1b('0x1b')][_0x3f1b('0x20')]||null:null})['then'](function(_0x345369){logger[_0x3f1b('0x15')](_0x3f1b('0x1d'),_0xacfec8);logger[_0x3f1b('0xe')](_0x3f1b('0x1d'),_0xacfec8,JSON['stringify'](_0x345369));_0xb44258(_0x345369);})[_0x3f1b('0x17')](function(_0x435dea){logger[_0x3f1b('0x11')]('UpdateChatQueueReport',_0x435dea[_0x3f1b('0x14')],_0xacfec8);_0x1b49e4(_0x6c6e6d[_0x3f1b('0x11')](0x1f4,_0x435dea[_0x3f1b('0x14')]));});});}; \ No newline at end of file +var _0xb9e7=['body','options','raw','CreateChatQueueReport','stringify','update','where','attributes','limit','UpdateChatQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ChatQueueReport','create'];(function(_0x1b4b64,_0x2076e7){var _0x2d0ba3=function(_0x263a4a){while(--_0x263a4a){_0x1b4b64['push'](_0x1b4b64['shift']());}};_0x2d0ba3(++_0x2076e7);}(_0xb9e7,0x145));var _0x7b9e=function(_0xe896bf,_0x4f8e5e){_0xe896bf=_0xe896bf-0x0;var _0x4c7a8a=_0xb9e7[_0xe896bf];return _0x4c7a8a;};'use strict';var _=require(_0x7b9e('0x0'));var util=require(_0x7b9e('0x1'));var moment=require(_0x7b9e('0x2'));var BPromise=require('bluebird');var rs=require(_0x7b9e('0x3'));var fs=require('fs');var Redis=require(_0x7b9e('0x4'));var db=require(_0x7b9e('0x5'))['db'];var utils=require(_0x7b9e('0x6'));var logger=require(_0x7b9e('0x7'))(_0x7b9e('0x8'));var config=require('../../config/environment');var jayson=require(_0x7b9e('0x9'));var client=jayson[_0x7b9e('0xa')][_0x7b9e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26124f,_0x347523,_0x33fc20){return new BPromise(function(_0x588c99,_0x1d8fe9){return client['request'](_0x26124f,_0x33fc20)[_0x7b9e('0xc')](function(_0x413c83){logger[_0x7b9e('0xd')](_0x7b9e('0xe'),_0x347523,_0x7b9e('0xf'));logger[_0x7b9e('0x10')](_0x7b9e('0x11'),_0x347523,'request\x20sent',JSON['stringify'](_0x413c83));if(_0x413c83[_0x7b9e('0x12')]){if(_0x413c83[_0x7b9e('0x12')][_0x7b9e('0x13')]===0x1f4){logger[_0x7b9e('0x12')](_0x7b9e('0xe'),_0x347523,_0x413c83['error'][_0x7b9e('0x14')]);return _0x1d8fe9(_0x413c83['error']['message']);}logger[_0x7b9e('0x12')](_0x7b9e('0xe'),_0x347523,_0x413c83['error']['message']);return _0x588c99(_0x413c83[_0x7b9e('0x12')][_0x7b9e('0x14')]);}else{logger[_0x7b9e('0xd')](_0x7b9e('0xe'),_0x347523,_0x7b9e('0xf'));_0x588c99(_0x413c83[_0x7b9e('0x15')][_0x7b9e('0x14')]);}})[_0x7b9e('0x16')](function(_0x2f0067){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x347523,_0x2f0067);_0x1d8fe9(_0x2f0067);});});}exports['CreateChatQueueReport']=function(_0x36073c){var _0x131d0a=this;return new Promise(function(_0x57f8c4,_0x1493c9){return db[_0x7b9e('0x17')][_0x7b9e('0x18')](_0x36073c[_0x7b9e('0x19')],{'raw':_0x36073c[_0x7b9e('0x1a')]?_0x36073c['options'][_0x7b9e('0x1b')]===undefined?!![]:![]:!![]})[_0x7b9e('0xc')](function(_0x36b19c){logger['info'](_0x7b9e('0x1c'),_0x36073c);logger[_0x7b9e('0x10')](_0x7b9e('0x1c'),_0x36073c,JSON[_0x7b9e('0x1d')](_0x36b19c));_0x57f8c4(_0x36b19c);})['catch'](function(_0x4c7b4f){logger[_0x7b9e('0x12')](_0x7b9e('0x1c'),_0x4c7b4f[_0x7b9e('0x14')],_0x36073c);_0x1493c9(_0x131d0a[_0x7b9e('0x12')](0x1f4,_0x4c7b4f[_0x7b9e('0x14')]));});});};exports['UpdateChatQueueReport']=function(_0x5b5ab5){var _0x91f007=this;return new Promise(function(_0x142551,_0x577e3f){return db[_0x7b9e('0x17')][_0x7b9e('0x1e')](_0x5b5ab5[_0x7b9e('0x19')],{'raw':_0x5b5ab5[_0x7b9e('0x1a')]?_0x5b5ab5[_0x7b9e('0x1a')][_0x7b9e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b5ab5[_0x7b9e('0x1a')]?_0x5b5ab5[_0x7b9e('0x1a')][_0x7b9e('0x1f')]||null:null,'attributes':_0x5b5ab5['options']?_0x5b5ab5[_0x7b9e('0x1a')][_0x7b9e('0x20')]||null:null,'limit':_0x5b5ab5['options']?_0x5b5ab5[_0x7b9e('0x1a')][_0x7b9e('0x21')]||null:null})[_0x7b9e('0xc')](function(_0x17e2da){logger['info'](_0x7b9e('0x22'),_0x5b5ab5);logger['debug']('UpdateChatQueueReport',_0x5b5ab5,JSON[_0x7b9e('0x1d')](_0x17e2da));_0x142551(_0x17e2da);})[_0x7b9e('0x16')](function(_0x13eadb){logger[_0x7b9e('0x12')](_0x7b9e('0x22'),_0x13eadb[_0x7b9e('0x14')],_0x5b5ab5);_0x577e3f(_0x91f007['error'](0x1f4,_0x13eadb[_0x7b9e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index b0daf39..c2129a3 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 _0xa5c1=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','put','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x53b133,_0x176261){var _0x5647e0=function(_0x4c62b0){while(--_0x4c62b0){_0x53b133['push'](_0x53b133['shift']());}};_0x5647e0(++_0x176261);}(_0xa5c1,0x1b4));var _0x1a5c=function(_0x54fe33,_0x38e9e9){_0x54fe33=_0x54fe33-0x0;var _0x227092=_0xa5c1[_0x54fe33];return _0x227092;};'use strict';var multer=require('multer');var util=require(_0x1a5c('0x0'));var path=require(_0x1a5c('0x1'));var timeout=require('connect-timeout');var express=require(_0x1a5c('0x2'));var router=express[_0x1a5c('0x3')]();var auth=require(_0x1a5c('0x4'));var interaction=require(_0x1a5c('0x5'));var config=require(_0x1a5c('0x6'));var controller=require('./chatQueueReport.controller');router[_0x1a5c('0x7')]('/',auth[_0x1a5c('0x8')](),controller[_0x1a5c('0x9')]);router[_0x1a5c('0x7')](_0x1a5c('0xa'),auth[_0x1a5c('0x8')](),controller[_0x1a5c('0xb')]);router[_0x1a5c('0x7')](_0x1a5c('0xc'),auth[_0x1a5c('0x8')](),controller[_0x1a5c('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x1a5c('0xe')](_0x1a5c('0xc'),auth[_0x1a5c('0x8')](),controller['update']);router['delete'](_0x1a5c('0xc'),auth[_0x1a5c('0x8')](),controller[_0x1a5c('0xf')]);module[_0x1a5c('0x10')]=router; \ No newline at end of file +var _0xf769=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x492221,_0x9e2521){var _0x398bf9=function(_0x303c5b){while(--_0x303c5b){_0x492221['push'](_0x492221['shift']());}};_0x398bf9(++_0x9e2521);}(_0xf769,0x14d));var _0x9f76=function(_0x545a3a,_0x3123aa){_0x545a3a=_0x545a3a-0x0;var _0x5a5493=_0xf769[_0x545a3a];return _0x5a5493;};'use strict';var multer=require(_0x9f76('0x0'));var util=require(_0x9f76('0x1'));var path=require(_0x9f76('0x2'));var timeout=require(_0x9f76('0x3'));var express=require(_0x9f76('0x4'));var router=express[_0x9f76('0x5')]();var auth=require(_0x9f76('0x6'));var interaction=require(_0x9f76('0x7'));var config=require(_0x9f76('0x8'));var controller=require(_0x9f76('0x9'));router[_0x9f76('0xa')]('/',auth[_0x9f76('0xb')](),controller[_0x9f76('0xc')]);router[_0x9f76('0xa')](_0x9f76('0xd'),auth[_0x9f76('0xb')](),controller[_0x9f76('0xe')]);router[_0x9f76('0xa')](_0x9f76('0xf'),auth['isAuthenticated'](),controller[_0x9f76('0x10')]);router[_0x9f76('0x11')]('/',auth[_0x9f76('0xb')](),controller[_0x9f76('0x12')]);router[_0x9f76('0x13')]('/:id',auth[_0x9f76('0xb')](),controller[_0x9f76('0x14')]);router[_0x9f76('0x15')](_0x9f76('0xf'),auth[_0x9f76('0xb')](),controller[_0x9f76('0x16')]);module[_0x9f76('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index ea9941a..c33115f 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 _0x176d=['DATE','NOW','moment','sequelize','STRING','ENUM','account','agent','queue'];(function(_0x23a0ac,_0x4e4c50){var _0x43d7a3=function(_0x52ec28){while(--_0x52ec28){_0x23a0ac['push'](_0x23a0ac['shift']());}};_0x43d7a3(++_0x4e4c50);}(_0x176d,0x1b2));var _0xd176=function(_0x44b2d9,_0x22d945){_0x44b2d9=_0x44b2d9-0x0;var _0x4e4048=_0x176d[_0x44b2d9];return _0x4e4048;};'use strict';var moment=require(_0xd176('0x0'));var Sequelize=require(_0xd176('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xd176('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xd176('0x3')](_0xd176('0x4'),_0xd176('0x5'),_0xd176('0x6')),'allowNull':![],'defaultValue':_0xd176('0x6')},'transferredAt':{'type':Sequelize[_0xd176('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xd176('0x8')]}}; \ No newline at end of file +var _0xffd7=['agent','queue','DATE','NOW','sequelize','STRING','ENUM','account'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0xffd7,0x19c));var _0x7ffd=function(_0x24d818,_0x4fd57c){_0x24d818=_0x24d818-0x0;var _0x4ce181=_0xffd7[_0x24d818];return _0x4ce181;};'use strict';var moment=require('moment');var Sequelize=require(_0x7ffd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7ffd('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x7ffd('0x2')](_0x7ffd('0x3'),_0x7ffd('0x4'),_0x7ffd('0x5')),'allowNull':![],'defaultValue':_0x7ffd('0x5')},'transferredAt':{'type':Sequelize[_0x7ffd('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x7ffd('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 5dd1124..528b79a 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 _0x9fd4=['ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','ChatTransferReport','includeAll','findAll','show','params','fields','include','catch','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv'];(function(_0x57f970,_0x3d72a8){var _0x234975=function(_0x44a2a3){while(--_0x44a2a3){_0x57f970['push'](_0x57f970['shift']());}};_0x234975(++_0x3d72a8);}(_0x9fd4,0x16c));var _0x49fd=function(_0x557ba5,_0x55735b){_0x557ba5=_0x557ba5-0x0;var _0x4c7d96=_0x9fd4[_0x557ba5];return _0x4c7d96;};'use strict';var pdf=require(_0x49fd('0x0'));var emlformat=require(_0x49fd('0x1'));var rimraf=require(_0x49fd('0x2'));var zipdir=require(_0x49fd('0x3'));var jsonpatch=require(_0x49fd('0x4'));var rp=require(_0x49fd('0x5'));var moment=require(_0x49fd('0x6'));var BPromise=require(_0x49fd('0x7'));var Mustache=require(_0x49fd('0x8'));var util=require('util');var path=require('path');var sox=require(_0x49fd('0x9'));var csv=require(_0x49fd('0xa'));var ejs=require(_0x49fd('0xb'));var fs=require('fs');var _=require(_0x49fd('0xc'));var squel=require('squel');var crypto=require(_0x49fd('0xd'));var jsforce=require(_0x49fd('0xe'));var deskjs=require(_0x49fd('0xf'));var toCsv=require(_0x49fd('0xa'));var querystring=require(_0x49fd('0x10'));var Papa=require('papaparse');var Redis=require(_0x49fd('0x11'));var authService=require(_0x49fd('0x12'));var qs=require(_0x49fd('0x13'));var hardwareService=require(_0x49fd('0x14'));var logger=require(_0x49fd('0x15'))(_0x49fd('0x16'));var utils=require(_0x49fd('0x17'));var config=require('../../config/environment');var db=require(_0x49fd('0x18'))['db'];function respondWithStatusCode(_0x1a6ee5,_0x426109){_0x426109=_0x426109||0xcc;return function(_0x40d1b0){if(_0x40d1b0){return _0x1a6ee5[_0x49fd('0x19')](_0x426109);}return _0x1a6ee5[_0x49fd('0x1a')](_0x426109)[_0x49fd('0x1b')]();};}function respondWithResult(_0x3fa518,_0x1d900b){_0x1d900b=_0x1d900b||0xc8;return function(_0x652890){if(_0x652890){return _0x3fa518[_0x49fd('0x1a')](_0x1d900b)[_0x49fd('0x1c')](_0x652890);}};}function respondWithFilteredResult(_0x46760f,_0x1a9063){return function(_0x264ab1){if(_0x264ab1){var _0x201109=_0x264ab1[_0x49fd('0x1d')],_0x2859f2=_0x1a9063[_0x49fd('0x1e')],_0x3ca675=_0x1a9063[_0x49fd('0x1e')]+_0x1a9063[_0x49fd('0x1f')],_0x2f8d68;if(_0x3ca675>=_0x201109){_0x3ca675=_0x201109;_0x2f8d68=0xc8;}else{_0x2f8d68=0xce;}_0x46760f[_0x49fd('0x1a')](_0x2f8d68);return _0x46760f[_0x49fd('0x20')](_0x49fd('0x21'),_0x2859f2+'-'+_0x3ca675+'/'+_0x201109)['json'](_0x264ab1);}return null;};}function patchUpdates(_0x2dc611){return function(_0x3fd46b){try{jsonpatch['apply'](_0x3fd46b,_0x2dc611,!![]);}catch(_0x5c323a){return BPromise[_0x49fd('0x22')](_0x5c323a);}return _0x3fd46b['save']();};}function saveUpdates(_0x316e7c,_0xbb113b){return function(_0x599315){if(_0x599315){return _0x599315[_0x49fd('0x23')](_0x316e7c)[_0x49fd('0x24')](function(_0x5ae3bc){return _0x5ae3bc;});}return null;};}function removeEntity(_0x1ebdf7,_0x1165db){return function(_0x2e1c40){if(_0x2e1c40){return _0x2e1c40[_0x49fd('0x25')]()[_0x49fd('0x24')](function(){_0x1ebdf7[_0x49fd('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46019d,_0xd43815){return function(_0x8f202b){if(!_0x8f202b){_0x46019d['sendStatus'](0x194);}return _0x8f202b;};}function handleError(_0x3fa0c,_0x10de13){_0x10de13=_0x10de13||0x1f4;return function(_0x146d55){logger['error'](_0x146d55['stack']);if(_0x146d55['name']){delete _0x146d55[_0x49fd('0x26')];}_0x3fa0c[_0x49fd('0x1a')](_0x10de13)[_0x49fd('0x27')](_0x146d55);};}exports[_0x49fd('0x28')]=function(_0x9587b9,_0x293d2b){var _0x20873e={},_0x9afc1c={},_0x54c8bb={'count':0x0,'rows':[]};var _0x2b2710=db['ChatTransferReport'][_0x49fd('0x29')];_0x9afc1c[_0x49fd('0x2a')]=_['keys'](_0x2b2710);_0x9afc1c[_0x49fd('0x2b')]=_[_0x49fd('0x2c')](_0x9587b9[_0x49fd('0x2b')]);_0x9afc1c[_0x49fd('0x2d')]=_[_0x49fd('0x2e')](_0x9afc1c[_0x49fd('0x2a')],_0x9afc1c[_0x49fd('0x2b')]);_0x20873e[_0x49fd('0x2f')]=_['intersection'](_0x9afc1c[_0x49fd('0x2a')],qs['fields'](_0x9587b9[_0x49fd('0x2b')]['fields']));_0x20873e[_0x49fd('0x2f')]=_0x20873e[_0x49fd('0x2f')][_0x49fd('0x30')]?_0x20873e['attributes']:_0x9afc1c['model'];if(!_0x9587b9['query'][_0x49fd('0x31')](_0x49fd('0x32'))){_0x20873e['limit']=qs[_0x49fd('0x1f')](_0x9587b9['query']['limit']);_0x20873e[_0x49fd('0x1e')]=qs[_0x49fd('0x1e')](_0x9587b9[_0x49fd('0x2b')][_0x49fd('0x1e')]);}_0x20873e[_0x49fd('0x33')]=qs['sort'](_0x9587b9['query'][_0x49fd('0x34')]);_0x20873e[_0x49fd('0x35')]=qs[_0x49fd('0x2d')](_[_0x49fd('0x36')](_0x9587b9['query'],_0x9afc1c[_0x49fd('0x2d')]));if(_0x9587b9[_0x49fd('0x2b')][_0x49fd('0x37')]){_0x20873e[_0x49fd('0x35')]=_[_0x49fd('0x38')](_0x20873e[_0x49fd('0x35')],{'$or':_[_0x49fd('0x39')](_0x2b2710,function(_0x25b9c2){if(_0x25b9c2[_0x49fd('0x3a')][_0x49fd('0x3b')]!==_0x49fd('0x3c')){var _0x5502ca={};_0x5502ca[_0x25b9c2[_0x49fd('0x3d')]]={'$like':'%'+_0x9587b9[_0x49fd('0x2b')][_0x49fd('0x37')]+'%'};return _0x5502ca;}})});}_0x20873e=_[_0x49fd('0x38')]({},_0x20873e,_0x9587b9[_0x49fd('0x3e')]);var _0x44c7d5={'where':_0x20873e[_0x49fd('0x35')]};return db[_0x49fd('0x3f')][_0x49fd('0x1d')](_0x44c7d5)['then'](function(_0x246459){_0x54c8bb['count']=_0x246459;if(_0x9587b9[_0x49fd('0x2b')][_0x49fd('0x40')]){_0x20873e['include']=[{'all':!![]}];}return db[_0x49fd('0x3f')][_0x49fd('0x41')](_0x20873e);})['then'](function(_0x1f9a65){_0x54c8bb['rows']=_0x1f9a65;return _0x54c8bb;})['then'](respondWithFilteredResult(_0x293d2b,_0x20873e))['catch'](handleError(_0x293d2b,null));};exports[_0x49fd('0x42')]=function(_0x32982e,_0x36739b){var _0x3f73d3={'raw':!![],'where':{'id':_0x32982e[_0x49fd('0x43')]['id']}},_0x5424ab={};_0x5424ab[_0x49fd('0x2a')]=_[_0x49fd('0x2c')](db[_0x49fd('0x3f')][_0x49fd('0x29')]);_0x5424ab[_0x49fd('0x2b')]=_[_0x49fd('0x2c')](_0x32982e[_0x49fd('0x2b')]);_0x5424ab['filters']=_[_0x49fd('0x2e')](_0x5424ab[_0x49fd('0x2a')],_0x5424ab['query']);_0x3f73d3[_0x49fd('0x2f')]=_[_0x49fd('0x2e')](_0x5424ab['model'],qs[_0x49fd('0x44')](_0x32982e['query'][_0x49fd('0x44')]));_0x3f73d3[_0x49fd('0x2f')]=_0x3f73d3[_0x49fd('0x2f')][_0x49fd('0x30')]?_0x3f73d3['attributes']:_0x5424ab['model'];if(_0x32982e[_0x49fd('0x2b')]['includeAll']){_0x3f73d3[_0x49fd('0x45')]=[{'all':!![]}];}_0x3f73d3=_[_0x49fd('0x38')]({},_0x3f73d3,_0x32982e[_0x49fd('0x3e')]);return db[_0x49fd('0x3f')]['find'](_0x3f73d3)[_0x49fd('0x24')](handleEntityNotFound(_0x36739b,null))[_0x49fd('0x24')](respondWithResult(_0x36739b,null))[_0x49fd('0x46')](handleError(_0x36739b,null));};exports[_0x49fd('0x47')]=function(_0x24705e,_0x30937f){return db[_0x49fd('0x3f')][_0x49fd('0x47')](_0x24705e[_0x49fd('0x48')],{})[_0x49fd('0x24')](respondWithResult(_0x30937f,0xc9))[_0x49fd('0x46')](handleError(_0x30937f,null));};exports[_0x49fd('0x23')]=function(_0x16891a,_0x427209){if(_0x16891a['body']['id']){delete _0x16891a['body']['id'];}return db[_0x49fd('0x3f')][_0x49fd('0x49')]({'where':{'id':_0x16891a[_0x49fd('0x43')]['id']}})[_0x49fd('0x24')](handleEntityNotFound(_0x427209,null))['then'](saveUpdates(_0x16891a[_0x49fd('0x48')],null))[_0x49fd('0x24')](respondWithResult(_0x427209,null))['catch'](handleError(_0x427209,null));};exports[_0x49fd('0x25')]=function(_0x270360,_0xaac56f){return db[_0x49fd('0x3f')][_0x49fd('0x49')]({'where':{'id':_0x270360[_0x49fd('0x43')]['id']}})[_0x49fd('0x24')](handleEntityNotFound(_0xaac56f,null))[_0x49fd('0x24')](removeEntity(_0xaac56f,null))[_0x49fd('0x46')](handleError(_0xaac56f,null));};exports[_0x49fd('0x4a')]=function(_0x9edf73,_0x5e2532){return db[_0x49fd('0x3f')][_0x49fd('0x4a')]()[_0x49fd('0x24')](respondWithResult(_0x5e2532,null))[_0x49fd('0x46')](handleError(_0x5e2532,null));}; \ No newline at end of file +var _0x6f47=['../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','error','name','index','ChatTransferReport','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','then','rows','catch','show','params','rawAttributes','include','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs'];(function(_0x5aabcb,_0x219fbd){var _0x4b6e71=function(_0x1546ee){while(--_0x1546ee){_0x5aabcb['push'](_0x5aabcb['shift']());}};_0x4b6e71(++_0x219fbd);}(_0x6f47,0xc7));var _0x76f4=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x6f47[_0x1cb18a];return _0x22442e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x76f4('0x0'));var rimraf=require(_0x76f4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x76f4('0x2'));var rp=require('request-promise');var moment=require(_0x76f4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x76f4('0x4'));var util=require(_0x76f4('0x5'));var path=require(_0x76f4('0x6'));var sox=require(_0x76f4('0x7'));var csv=require('to-csv');var ejs=require(_0x76f4('0x8'));var fs=require('fs');var _=require(_0x76f4('0x9'));var squel=require(_0x76f4('0xa'));var crypto=require('crypto');var jsforce=require(_0x76f4('0xb'));var deskjs=require(_0x76f4('0xc'));var toCsv=require(_0x76f4('0xd'));var querystring=require(_0x76f4('0xe'));var Papa=require(_0x76f4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x76f4('0x10'));var hardwareService=require(_0x76f4('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x76f4('0x12'));var config=require(_0x76f4('0x13'));var db=require(_0x76f4('0x14'))['db'];function respondWithStatusCode(_0x1e6a30,_0x1aee7f){_0x1aee7f=_0x1aee7f||0xcc;return function(_0xafd21e){if(_0xafd21e){return _0x1e6a30[_0x76f4('0x15')](_0x1aee7f);}return _0x1e6a30[_0x76f4('0x16')](_0x1aee7f)[_0x76f4('0x17')]();};}function respondWithResult(_0x4b53ac,_0x41ba00){_0x41ba00=_0x41ba00||0xc8;return function(_0x30dabf){if(_0x30dabf){return _0x4b53ac['status'](_0x41ba00)['json'](_0x30dabf);}};}function respondWithFilteredResult(_0x5d6f8e,_0x1d7755){return function(_0x3dd240){if(_0x3dd240){var _0x979946=_0x3dd240[_0x76f4('0x18')],_0x40252d=_0x1d7755[_0x76f4('0x19')],_0x3d8f5a=_0x1d7755[_0x76f4('0x19')]+_0x1d7755[_0x76f4('0x1a')],_0x2b5e23;if(_0x3d8f5a>=_0x979946){_0x3d8f5a=_0x979946;_0x2b5e23=0xc8;}else{_0x2b5e23=0xce;}_0x5d6f8e[_0x76f4('0x16')](_0x2b5e23);return _0x5d6f8e[_0x76f4('0x1b')](_0x76f4('0x1c'),_0x40252d+'-'+_0x3d8f5a+'/'+_0x979946)[_0x76f4('0x1d')](_0x3dd240);}return null;};}function patchUpdates(_0x17625e){return function(_0x397360){try{jsonpatch[_0x76f4('0x1e')](_0x397360,_0x17625e,!![]);}catch(_0x3e809f){return BPromise[_0x76f4('0x1f')](_0x3e809f);}return _0x397360[_0x76f4('0x20')]();};}function saveUpdates(_0x46f057,_0x285232){return function(_0x5bf3d5){if(_0x5bf3d5){return _0x5bf3d5[_0x76f4('0x21')](_0x46f057)['then'](function(_0x13f3b1){return _0x13f3b1;});}return null;};}function removeEntity(_0x24ecac,_0xf8f722){return function(_0x517c00){if(_0x517c00){return _0x517c00['destroy']()['then'](function(){_0x24ecac[_0x76f4('0x16')](0xcc)[_0x76f4('0x17')]();});}};}function handleEntityNotFound(_0x14bfe5,_0x2b6d51){return function(_0x42ef70){if(!_0x42ef70){_0x14bfe5[_0x76f4('0x15')](0x194);}return _0x42ef70;};}function handleError(_0x3f4d11,_0x4dac8e){_0x4dac8e=_0x4dac8e||0x1f4;return function(_0x504aa8){logger[_0x76f4('0x22')](_0x504aa8['stack']);if(_0x504aa8[_0x76f4('0x23')]){delete _0x504aa8['name'];}_0x3f4d11['status'](_0x4dac8e)['send'](_0x504aa8);};}exports[_0x76f4('0x24')]=function(_0x38300d,_0xd368a2){var _0x1d1fe6={},_0x13d219={},_0x447dbc={'count':0x0,'rows':[]};var _0x5ca31f=db[_0x76f4('0x25')]['rawAttributes'];_0x13d219['model']=_['keys'](_0x5ca31f);_0x13d219[_0x76f4('0x26')]=_[_0x76f4('0x27')](_0x38300d[_0x76f4('0x26')]);_0x13d219[_0x76f4('0x28')]=_['intersection'](_0x13d219[_0x76f4('0x29')],_0x13d219['query']);_0x1d1fe6[_0x76f4('0x2a')]=_[_0x76f4('0x2b')](_0x13d219[_0x76f4('0x29')],qs[_0x76f4('0x2c')](_0x38300d[_0x76f4('0x26')]['fields']));_0x1d1fe6['attributes']=_0x1d1fe6[_0x76f4('0x2a')][_0x76f4('0x2d')]?_0x1d1fe6[_0x76f4('0x2a')]:_0x13d219[_0x76f4('0x29')];if(!_0x38300d[_0x76f4('0x26')][_0x76f4('0x2e')](_0x76f4('0x2f'))){_0x1d1fe6[_0x76f4('0x1a')]=qs[_0x76f4('0x1a')](_0x38300d[_0x76f4('0x26')][_0x76f4('0x1a')]);_0x1d1fe6[_0x76f4('0x19')]=qs['offset'](_0x38300d['query']['offset']);}_0x1d1fe6['order']=qs[_0x76f4('0x30')](_0x38300d[_0x76f4('0x26')][_0x76f4('0x30')]);_0x1d1fe6[_0x76f4('0x31')]=qs[_0x76f4('0x28')](_['pick'](_0x38300d[_0x76f4('0x26')],_0x13d219[_0x76f4('0x28')]));if(_0x38300d[_0x76f4('0x26')][_0x76f4('0x32')]){_0x1d1fe6[_0x76f4('0x31')]=_[_0x76f4('0x33')](_0x1d1fe6[_0x76f4('0x31')],{'$or':_[_0x76f4('0x34')](_0x5ca31f,function(_0x113469){if(_0x113469[_0x76f4('0x35')][_0x76f4('0x36')]!==_0x76f4('0x37')){var _0x2d744e={};_0x2d744e[_0x113469[_0x76f4('0x38')]]={'$like':'%'+_0x38300d[_0x76f4('0x26')][_0x76f4('0x32')]+'%'};return _0x2d744e;}})});}_0x1d1fe6=_[_0x76f4('0x33')]({},_0x1d1fe6,_0x38300d[_0x76f4('0x39')]);var _0x597119={'where':_0x1d1fe6[_0x76f4('0x31')]};return db[_0x76f4('0x25')][_0x76f4('0x18')](_0x597119)['then'](function(_0x597e83){_0x447dbc[_0x76f4('0x18')]=_0x597e83;if(_0x38300d['query'][_0x76f4('0x3a')]){_0x1d1fe6['include']=[{'all':!![]}];}return db[_0x76f4('0x25')][_0x76f4('0x3b')](_0x1d1fe6);})[_0x76f4('0x3c')](function(_0x378675){_0x447dbc[_0x76f4('0x3d')]=_0x378675;return _0x447dbc;})[_0x76f4('0x3c')](respondWithFilteredResult(_0xd368a2,_0x1d1fe6))[_0x76f4('0x3e')](handleError(_0xd368a2,null));};exports[_0x76f4('0x3f')]=function(_0x16779e,_0x80e29f){var _0x5340a9={'raw':!![],'where':{'id':_0x16779e[_0x76f4('0x40')]['id']}},_0x5b8d2d={};_0x5b8d2d[_0x76f4('0x29')]=_[_0x76f4('0x27')](db[_0x76f4('0x25')][_0x76f4('0x41')]);_0x5b8d2d[_0x76f4('0x26')]=_[_0x76f4('0x27')](_0x16779e[_0x76f4('0x26')]);_0x5b8d2d[_0x76f4('0x28')]=_['intersection'](_0x5b8d2d[_0x76f4('0x29')],_0x5b8d2d[_0x76f4('0x26')]);_0x5340a9['attributes']=_['intersection'](_0x5b8d2d[_0x76f4('0x29')],qs[_0x76f4('0x2c')](_0x16779e[_0x76f4('0x26')][_0x76f4('0x2c')]));_0x5340a9[_0x76f4('0x2a')]=_0x5340a9['attributes'][_0x76f4('0x2d')]?_0x5340a9[_0x76f4('0x2a')]:_0x5b8d2d[_0x76f4('0x29')];if(_0x16779e[_0x76f4('0x26')][_0x76f4('0x3a')]){_0x5340a9[_0x76f4('0x42')]=[{'all':!![]}];}_0x5340a9=_['merge']({},_0x5340a9,_0x16779e[_0x76f4('0x39')]);return db[_0x76f4('0x25')][_0x76f4('0x43')](_0x5340a9)['then'](handleEntityNotFound(_0x80e29f,null))['then'](respondWithResult(_0x80e29f,null))[_0x76f4('0x3e')](handleError(_0x80e29f,null));};exports[_0x76f4('0x44')]=function(_0x306cc2,_0x2bea6d){return db[_0x76f4('0x25')]['create'](_0x306cc2['body'],{})[_0x76f4('0x3c')](respondWithResult(_0x2bea6d,0xc9))['catch'](handleError(_0x2bea6d,null));};exports[_0x76f4('0x21')]=function(_0x3eaa0c,_0x4f1a1d){if(_0x3eaa0c['body']['id']){delete _0x3eaa0c[_0x76f4('0x45')]['id'];}return db[_0x76f4('0x25')][_0x76f4('0x43')]({'where':{'id':_0x3eaa0c[_0x76f4('0x40')]['id']}})['then'](handleEntityNotFound(_0x4f1a1d,null))[_0x76f4('0x3c')](saveUpdates(_0x3eaa0c[_0x76f4('0x45')],null))[_0x76f4('0x3c')](respondWithResult(_0x4f1a1d,null))['catch'](handleError(_0x4f1a1d,null));};exports[_0x76f4('0x46')]=function(_0x6bbcf2,_0x535eca){return db['ChatTransferReport'][_0x76f4('0x43')]({'where':{'id':_0x6bbcf2[_0x76f4('0x40')]['id']}})[_0x76f4('0x3c')](handleEntityNotFound(_0x535eca,null))[_0x76f4('0x3c')](removeEntity(_0x535eca,null))[_0x76f4('0x3e')](handleError(_0x535eca,null));};exports['describe']=function(_0xa3d139,_0x597de5){return db[_0x76f4('0x25')][_0x76f4('0x47')]()[_0x76f4('0x3c')](respondWithResult(_0x597de5,null))['catch'](handleError(_0x597de5,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index d88ff41..092d443 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 _0x991a=['ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define'];(function(_0x4441e2,_0x38893f){var _0x117035=function(_0x192756){while(--_0x192756){_0x4441e2['push'](_0x4441e2['shift']());}};_0x117035(++_0x38893f);}(_0x991a,0x12e));var _0xa991=function(_0x3b4834,_0x2050ab){_0x3b4834=_0x3b4834-0x0;var _0x5efa51=_0x991a[_0x3b4834];return _0x5efa51;};'use strict';var _=require('lodash');var util=require(_0xa991('0x0'));var logger=require(_0xa991('0x1'))(_0xa991('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa991('0x3'));var fs=require('fs');var path=require(_0xa991('0x4'));var rimraf=require(_0xa991('0x5'));var config=require(_0xa991('0x6'));var attributes=require(_0xa991('0x7'));module[_0xa991('0x8')]=function(_0x425ae2,_0x561c2f){return _0x425ae2[_0xa991('0x9')](_0xa991('0xa'),attributes,{'tableName':_0xa991('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa991('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb965=['define','report_chat_transfer','uniqueid','lodash','util','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xb965,0x9d));var _0x5b96=function(_0x2776db,_0xfb2eda){_0x2776db=_0x2776db-0x0;var _0x572930=_0xb965[_0x2776db];return _0x572930;};'use strict';var _=require(_0x5b96('0x0'));var util=require(_0x5b96('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5b96('0x2'));var BPromise=require(_0x5b96('0x3'));var rp=require(_0x5b96('0x4'));var fs=require('fs');var path=require(_0x5b96('0x5'));var rimraf=require(_0x5b96('0x6'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0x5b96('0x7')]=function(_0x3d9d78,_0x502072){return _0x3d9d78[_0x5b96('0x8')]('ChatTransferReport',attributes,{'tableName':_0x5b96('0x9'),'paranoid':![],'indexes':[{'name':_0x5b96('0xa'),'fields':[_0x5b96('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 2e7f246..4c63550 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 _0x8192=['info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0xd0c54f,_0x5910ba){var _0x533c19=function(_0x341a83){while(--_0x341a83){_0xd0c54f['push'](_0xd0c54f['shift']());}};_0x533c19(++_0x5910ba);}(_0x8192,0x82));var _0x2819=function(_0x30fbf9,_0x21c8d9){_0x30fbf9=_0x30fbf9-0x0;var _0x46d13c=_0x8192[_0x30fbf9];return _0x46d13c;};'use strict';var _=require(_0x2819('0x0'));var util=require(_0x2819('0x1'));var moment=require(_0x2819('0x2'));var BPromise=require(_0x2819('0x3'));var rs=require(_0x2819('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2819('0x5'))['db'];var utils=require(_0x2819('0x6'));var logger=require(_0x2819('0x7'))(_0x2819('0x8'));var config=require(_0x2819('0x9'));var jayson=require(_0x2819('0xa'));var client=jayson[_0x2819('0xb')][_0x2819('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x583c18,_0x3d68c8,_0x15437f){return new BPromise(function(_0x27f37e,_0x555a6b){return client['request'](_0x583c18,_0x15437f)[_0x2819('0xd')](function(_0x310875){logger[_0x2819('0xe')](_0x2819('0xf'),_0x3d68c8,_0x2819('0x10'));logger[_0x2819('0x11')](_0x2819('0x12'),_0x3d68c8,_0x2819('0x10'),JSON[_0x2819('0x13')](_0x310875));if(_0x310875[_0x2819('0x14')]){if(_0x310875[_0x2819('0x14')][_0x2819('0x15')]===0x1f4){logger[_0x2819('0x14')](_0x2819('0xf'),_0x3d68c8,_0x310875[_0x2819('0x14')][_0x2819('0x16')]);return _0x555a6b(_0x310875['error'][_0x2819('0x16')]);}logger[_0x2819('0x14')](_0x2819('0xf'),_0x3d68c8,_0x310875[_0x2819('0x14')]['message']);return _0x27f37e(_0x310875[_0x2819('0x14')][_0x2819('0x16')]);}else{logger[_0x2819('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x3d68c8,_0x2819('0x10'));_0x27f37e(_0x310875['result'][_0x2819('0x16')]);}})[_0x2819('0x17')](function(_0x3a731e){logger[_0x2819('0x14')](_0x2819('0xf'),_0x3d68c8,_0x3a731e);_0x555a6b(_0x3a731e);});});} \ No newline at end of file +var _0x2e3d=['stringify','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2e3d,0x1be));var _0xd2e3=function(_0x39bd3f,_0x9fa884){_0x39bd3f=_0x39bd3f-0x0;var _0x10b3e8=_0x2e3d[_0x39bd3f];return _0x10b3e8;};'use strict';var _=require(_0xd2e3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd2e3('0x1'));var rs=require(_0xd2e3('0x2'));var fs=require('fs');var Redis=require(_0xd2e3('0x3'));var db=require(_0xd2e3('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd2e3('0x5'));var config=require('../../config/environment');var jayson=require(_0xd2e3('0x6'));var client=jayson[_0xd2e3('0x7')][_0xd2e3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x471fd0,_0x42b70a,_0x1f4d8e){return new BPromise(function(_0x50dd17,_0x42da1f){return client[_0xd2e3('0x9')](_0x471fd0,_0x1f4d8e)[_0xd2e3('0xa')](function(_0x4122ea){logger[_0xd2e3('0xb')](_0xd2e3('0xc'),_0x42b70a,_0xd2e3('0xd'));logger[_0xd2e3('0xe')](_0xd2e3('0xf'),_0x42b70a,'request\x20sent',JSON[_0xd2e3('0x10')](_0x4122ea));if(_0x4122ea[_0xd2e3('0x11')]){if(_0x4122ea['error'][_0xd2e3('0x12')]===0x1f4){logger[_0xd2e3('0x11')](_0xd2e3('0xc'),_0x42b70a,_0x4122ea[_0xd2e3('0x11')][_0xd2e3('0x13')]);return _0x42da1f(_0x4122ea[_0xd2e3('0x11')]['message']);}logger[_0xd2e3('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x42b70a,_0x4122ea[_0xd2e3('0x11')][_0xd2e3('0x13')]);return _0x50dd17(_0x4122ea['error'][_0xd2e3('0x13')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x42b70a,_0xd2e3('0xd'));_0x50dd17(_0x4122ea[_0xd2e3('0x14')][_0xd2e3('0x13')]);}})['catch'](function(_0x4f7055){logger[_0xd2e3('0x11')](_0xd2e3('0xc'),_0x42b70a,_0x4f7055);_0x42da1f(_0x4f7055);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index ee974fc..e42a4c6 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 _0xc8f6=['destroy','exports','multer','util','connect-timeout','express','Router','../../config/environment','./chatTransferReport.controller','isAuthenticated','/describe','describe','get','/:id','show','create','put','update','delete'];(function(_0x466d37,_0x23ea34){var _0x21f0df=function(_0x40710a){while(--_0x40710a){_0x466d37['push'](_0x466d37['shift']());}};_0x21f0df(++_0x23ea34);}(_0xc8f6,0x1ca));var _0x6c8f=function(_0x2aedb4,_0x3c534b){_0x2aedb4=_0x2aedb4-0x0;var _0x39c439=_0xc8f6[_0x2aedb4];return _0x39c439;};'use strict';var multer=require(_0x6c8f('0x0'));var util=require(_0x6c8f('0x1'));var path=require('path');var timeout=require(_0x6c8f('0x2'));var express=require(_0x6c8f('0x3'));var router=express[_0x6c8f('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6c8f('0x5'));var controller=require(_0x6c8f('0x6'));router['get']('/',auth[_0x6c8f('0x7')](),controller['index']);router['get'](_0x6c8f('0x8'),auth['isAuthenticated'](),controller[_0x6c8f('0x9')]);router[_0x6c8f('0xa')](_0x6c8f('0xb'),auth['isAuthenticated'](),controller[_0x6c8f('0xc')]);router['post']('/',auth[_0x6c8f('0x7')](),controller[_0x6c8f('0xd')]);router[_0x6c8f('0xe')](_0x6c8f('0xb'),auth[_0x6c8f('0x7')](),controller[_0x6c8f('0xf')]);router[_0x6c8f('0x10')](_0x6c8f('0xb'),auth[_0x6c8f('0x7')](),controller[_0x6c8f('0x11')]);module[_0x6c8f('0x12')]=router; \ No newline at end of file +var _0x599f=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','destroy','multer'];(function(_0x5f00a7,_0x12dce6){var _0x35c392=function(_0x17e2d4){while(--_0x17e2d4){_0x5f00a7['push'](_0x5f00a7['shift']());}};_0x35c392(++_0x12dce6);}(_0x599f,0x1a1));var _0xf599=function(_0x1720c8,_0x49fabe){_0x1720c8=_0x1720c8-0x0;var _0x5cb5f6=_0x599f[_0x1720c8];return _0x5cb5f6;};'use strict';var multer=require(_0xf599('0x0'));var util=require(_0xf599('0x1'));var path=require(_0xf599('0x2'));var timeout=require(_0xf599('0x3'));var express=require(_0xf599('0x4'));var router=express[_0xf599('0x5')]();var auth=require(_0xf599('0x6'));var interaction=require(_0xf599('0x7'));var config=require(_0xf599('0x8'));var controller=require(_0xf599('0x9'));router[_0xf599('0xa')]('/',auth['isAuthenticated'](),controller[_0xf599('0xb')]);router[_0xf599('0xa')](_0xf599('0xc'),auth[_0xf599('0xd')](),controller[_0xf599('0xe')]);router[_0xf599('0xa')](_0xf599('0xf'),auth['isAuthenticated'](),controller[_0xf599('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf599('0x11')]);router['put'](_0xf599('0xf'),auth[_0xf599('0xd')](),controller['update']);router['delete'](_0xf599('0xf'),auth[_0xf599('0xd')](),controller[_0xf599('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 3b82ce9..4453d55 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 _0xf939=['Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','TEXT','input','name','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','exports','STRING','address','email','Agent','#9f946a','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','Note'];(function(_0x4e6eb2,_0x16a451){var _0x4e0c1c=function(_0x59f144){while(--_0x59f144){_0x4e6eb2['push'](_0x4e6eb2['shift']());}};_0x4e0c1c(++_0x16a451);}(_0xf939,0xd9));var _0x9f93=function(_0x2d5b95,_0x120077){_0x2d5b95=_0x2d5b95-0x0;var _0x2a5fd2=_0xf939[_0x2d5b95];return _0x2a5fd2;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x9f93('0x0')]={'name':{'type':Sequelize[_0x9f93('0x1')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9f93('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':_0x9f93('0x3')},'key':{'type':Sequelize[_0x9f93('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':_0x9f93('0x4')},'customerAlias':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9f93('0x1')],'allowNull':![],'defaultValue':_0x9f93('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x9f93('0x1')],'allowNull':![],'defaultValue':_0x9f93('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x9f93('0x1')],'allowNull':![],'defaultValue':_0x9f93('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x9f93('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x9f93('0x8')](_0x9f93('0x9'),_0x9f93('0xa')),'defaultValue':_0x9f93('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x9f93('0xb')},'start_chat_button':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':_0x9f93('0xc')},'offline_chat_button':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':_0x9f93('0xd')},'header_offline':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':_0x9f93('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x9f93('0xf')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':_0x9f93('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x9f93('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':_0x9f93('0x11')},'placeholderMessage':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':_0x9f93('0x12')},'closingMessage':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':_0x9f93('0x13')},'closingMessageButton':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x9f93('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x9f93('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9f93('0x7')],'defaultValue':![]},'ratingType':{'type':Sequelize[_0x9f93('0x8')](_0x9f93('0x15'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x9f93('0xf')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x9f93('0x16')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x9f93('0x17'),'variable':null,'config':{'placeholder':_0x9f93('0x18'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x9f93('0x17'),'props':{'title':_0x9f93('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x9f93('0x3'),'type':_0x9f93('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x9f93('0x19')](_0x9f93('0x1a'))?JSON[_0x9f93('0x1b')](this[_0x9f93('0x19')]('onlineForm')):{};},'set':function(_0x54532d){return this[_0x9f93('0x1c')]('onlineForm',JSON[_0x9f93('0x1d')](_0x54532d));}},'offlineForm':{'type':Sequelize[_0x9f93('0x16')],'defaultValue':function(){return JSON[_0x9f93('0x1d')]({'items':[{'type':_0x9f93('0x17'),'props':{'title':_0x9f93('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':_0x9f93('0x1e'),'config':{'placeholder':_0x9f93('0x1f')},'props':{'title':_0x9f93('0x1f'),'helpText':_0x9f93('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x9f93('0x19')](_0x9f93('0x21'))?JSON['parse'](this['getDataValue'](_0x9f93('0x21'))):{};},'set':function(_0x310e96){return this[_0x9f93('0x1c')]('offlineForm',JSON[_0x9f93('0x1d')](_0x310e96));}},'token':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':function(){return rs[_0x9f93('0x22')]();}},'autoclose':{'type':Sequelize[_0x9f93('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x9f93('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9f93('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x9f93('0x1')]},'forwardOffline':{'type':Sequelize[_0x9f93('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x9f93('0x1')]},'waitingTitle':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':_0x9f93('0x23')},'waitingMessage':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':_0x9f93('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':_0x9f93('0x25')},'offlineMessageBody':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x9f93('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':_0x9f93('0x26')},'skipUnmanaged':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x9f93('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9f93('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x9f93('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9f93('0x1')]},'notificationTemplate':{'type':Sequelize[_0x9f93('0x16')],'defaultValue':function(){return _0x9f93('0x27');}},'notificationSound':{'type':Sequelize[_0x9f93('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9f93('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x9f93('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':_0x9f93('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x9f93('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x9f93('0xf')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':_0x9f93('0x29')},'defaultTitle':{'type':Sequelize[_0x9f93('0x1')]},'customerAvatar':{'type':Sequelize[_0x9f93('0x16')]},'showCustomerAvatar':{'type':Sequelize[_0x9f93('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9f93('0x1')],'allowNull':![],'defaultValue':_0x9f93('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9f93('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9f93('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9f93('0x1')],'defaultValue':_0x9f93('0x2b')},'systemAvatar':{'type':Sequelize[_0x9f93('0x16')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9f93('0xf')],'comment':_0x9f93('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x9f93('0x7')],'defaultValue':![],'comment':_0x9f93('0x2d'),'set':function(_0x47de9c){if(!_0x47de9c)this['setDataValue'](_0x9f93('0x2e'),null);this[_0x9f93('0x1c')]('mandatoryDisposition',_0x47de9c);}}}; \ No newline at end of file +var _0xbc92=['TEXT','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Comments','offlineForm','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','email','Agent','#9f946a','INTEGER','rounded','squared','We\x20are\x20here!','Chat','Powered\x20by\x20xCALLY','BOOLEAN','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','ENUM','star','thumb'];(function(_0xaaab95,_0x49c52a){var _0x1e2348=function(_0x26f177){while(--_0x26f177){_0xaaab95['push'](_0xaaab95['shift']());}};_0x1e2348(++_0x49c52a);}(_0xbc92,0xfd));var _0x2bc9=function(_0x99868f,_0xbdb8e7){_0x99868f=_0x99868f-0x0;var _0x27a71b=_0xbc92[_0x99868f];return _0x27a71b;};'use strict';var Sequelize=require(_0x2bc9('0x0'));var rs=require('randomstring');module[_0x2bc9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x2bc9('0x2')],'defaultValue':_0x2bc9('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x2bc9('0x3')},'key':{'type':Sequelize[_0x2bc9('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x2bc9('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x2bc9('0x2')],'allowNull':![],'defaultValue':_0x2bc9('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2bc9('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x2bc9('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2bc9('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x2bc9('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x2bc9('0x7'),_0x2bc9('0x8')),'defaultValue':_0x2bc9('0x7')},'header_online':{'type':Sequelize[_0x2bc9('0x2')],'defaultValue':_0x2bc9('0x9')},'start_chat_button':{'type':Sequelize[_0x2bc9('0x2')],'defaultValue':_0x2bc9('0xa')},'offline_chat_button':{'type':Sequelize[_0x2bc9('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x2bc9('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x2bc9('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x2bc9('0x2')],'defaultValue':_0x2bc9('0xb')},'defaultWhiteLabel':{'type':Sequelize[_0x2bc9('0xc')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x2bc9('0x2')],'defaultValue':_0x2bc9('0xd')},'formSubmitSuccessMessage':{'type':Sequelize[_0x2bc9('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x2bc9('0x2')],'defaultValue':_0x2bc9('0xe')},'noteTitle':{'type':Sequelize[_0x2bc9('0x2')],'defaultValue':_0x2bc9('0xf')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2bc9('0x10')},'closingMessage':{'type':Sequelize[_0x2bc9('0x2')],'defaultValue':_0x2bc9('0x11')},'closingMessageButton':{'type':Sequelize[_0x2bc9('0x2')],'defaultValue':_0x2bc9('0x12')},'skipMessageButton':{'type':Sequelize[_0x2bc9('0x2')],'defaultValue':_0x2bc9('0x13')},'conditionAgreement':{'type':Sequelize[_0x2bc9('0xc')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x2bc9('0xc')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2bc9('0xc')],'defaultValue':![]},'ratingType':{'type':Sequelize[_0x2bc9('0x14')](_0x2bc9('0x15'),_0x2bc9('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x2bc9('0x17')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x2bc9('0x18'),'variable':null,'config':{'placeholder':_0x2bc9('0x19'),'type':_0x2bc9('0x1a'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x2bc9('0x18'),'props':{'title':_0x2bc9('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x2bc9('0x3'),'type':_0x2bc9('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x2bc9('0x1b')](_0x2bc9('0x1c'))?JSON[_0x2bc9('0x1d')](this[_0x2bc9('0x1b')]('onlineForm')):{};},'set':function(_0x24251b){return this[_0x2bc9('0x1e')](_0x2bc9('0x1c'),JSON[_0x2bc9('0x1f')](_0x24251b));}},'offlineForm':{'type':Sequelize[_0x2bc9('0x17')],'defaultValue':function(){return JSON[_0x2bc9('0x1f')]({'items':[{'type':_0x2bc9('0x18'),'props':{'title':_0x2bc9('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x2bc9('0x3')},'variable':null},{'type':_0x2bc9('0x20'),'config':{'placeholder':_0x2bc9('0x21')},'props':{'title':_0x2bc9('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x2bc9('0x1b')](_0x2bc9('0x22'))?JSON['parse'](this['getDataValue'](_0x2bc9('0x22'))):{};},'set':function(_0x1fb54e){return this[_0x2bc9('0x1e')](_0x2bc9('0x22'),JSON[_0x2bc9('0x1f')](_0x1fb54e));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x2bc9('0xc')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2bc9('0xc')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2bc9('0x2')]},'forwardOffline':{'type':Sequelize[_0x2bc9('0xc')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x2bc9('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x2bc9('0x2')],'defaultValue':_0x2bc9('0x23')},'offlineMessageSubject':{'type':Sequelize[_0x2bc9('0x2')],'defaultValue':_0x2bc9('0x24')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x2bc9('0x25')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x2bc9('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x2bc9('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x2bc9('0x12')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x2bc9('0xc')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x2bc9('0x17')]},'showAgentAvatar':{'type':Sequelize[_0x2bc9('0xc')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x2bc9('0x2')]},'notificationTemplate':{'type':Sequelize[_0x2bc9('0x17')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x2bc9('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x2bc9('0x26')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2bc9('0x2')],'defaultValue':_0x2bc9('0x27')},'verticalAlignment':{'type':Sequelize[_0x2bc9('0x6')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x2bc9('0x28')},'defaultTitle':{'type':Sequelize[_0x2bc9('0x2')]},'customerAvatar':{'type':Sequelize[_0x2bc9('0x17')]},'showCustomerAvatar':{'type':Sequelize[_0x2bc9('0xc')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2bc9('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x2bc9('0x2')],'allowNull':![],'defaultValue':_0x2bc9('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x2bc9('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2bc9('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2bc9('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2bc9('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x2bc9('0x2')],'defaultValue':_0x2bc9('0x2a')},'systemAvatar':{'type':Sequelize[_0x2bc9('0x17')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2bc9('0x6')],'comment':_0x2bc9('0x2b')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x157573){if(!_0x157573)this[_0x2bc9('0x1e')](_0x2bc9('0x2c'),null);this['setDataValue'](_0x2bc9('0x2d'),_0x157573);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 3529882..3b184ea 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 _0x2865=['getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','CmContact','ValidationError','difference','createdAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','List','Contacts','Applications','account','applications','list','asc','lastName','customerIp','referer','browser','version','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','type','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','firstName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','Start','startRouting','EventManager','offline','no\x20available\x20attributes','updatedAt','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','sendMail','format','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getLicense','virtual','License','chatLicenseExceeded','some','server/files/chat/iframe.js','remote','x-forwarded-for','x-real-ip','remoteAddress','replace','alignment','verticalAlignment','addApplications','sequelize','transaction','ChatApplication','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.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','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','ChatWebsites','UserProfileResource','destroy','end','stack','name','send','Pause','mandatoryDispositionPause','ChatWebsite','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','key','VIRTUAL','field','include','findAll','rows','catch','show','rawAttributes','length','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','ChatWebsiteId','Disposition','findOne','map','options','ids','CannedAnswer','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','addSystemAvatar','systemAvatar','root','../../config/license/util','custom','server/files/images/logos/','join','download','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','isNil','customerAvatar'];(function(_0x433e81,_0x367151){var _0x51999f=function(_0x3ab384){while(--_0x3ab384){_0x433e81['push'](_0x433e81['shift']());}};_0x51999f(++_0x367151);}(_0x2865,0x1b0));var _0x5286=function(_0x43b61b,_0x34f269){_0x43b61b=_0x43b61b-0x0;var _0x5430a4=_0x2865[_0x43b61b];return _0x5430a4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5286('0x0'));var rimraf=require(_0x5286('0x1'));var zipdir=require(_0x5286('0x2'));var jsonpatch=require(_0x5286('0x3'));var rp=require(_0x5286('0x4'));var moment=require(_0x5286('0x5'));var BPromise=require(_0x5286('0x6'));var Mustache=require(_0x5286('0x7'));var util=require('util');var path=require('path');var sox=require(_0x5286('0x8'));var csv=require(_0x5286('0x9'));var ejs=require(_0x5286('0xa'));var fs=require('fs');var _=require(_0x5286('0xb'));var squel=require('squel');var crypto=require(_0x5286('0xc'));var jsforce=require(_0x5286('0xd'));var deskjs=require(_0x5286('0xe'));var toCsv=require(_0x5286('0x9'));var querystring=require(_0x5286('0xf'));var Papa=require(_0x5286('0x10'));var Redis=require('ioredis');var authService=require(_0x5286('0x11'));var qs=require(_0x5286('0x12'));var hardwareService=require(_0x5286('0x13'));var logger=require('../../config/logger')(_0x5286('0x14'));var utils=require(_0x5286('0x15'));var config=require('../../config/environment');var db=require(_0x5286('0x16'))['db'];config[_0x5286('0x17')]=_[_0x5286('0x18')](config[_0x5286('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x5286('0x19'))(new Redis(config[_0x5286('0x17')]));require(_0x5286('0x1a'))[_0x5286('0x1b')](socket);var jayson=require(_0x5286('0x1c'));var client=jayson[_0x5286('0x1d')][_0x5286('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x5286('0x1e')]({'port':0x232a});var client9003=jayson[_0x5286('0x1d')][_0x5286('0x1e')]({'port':0x232b});function checkPasswordPattern(_0x36096c,_0x4f4916,_0x59a29f){if(_0x59a29f){var _0x47507d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x47507d[_0x5286('0x1f')](_0x4f4916)){return _0x36096c;}else{throw new Error(_0x5286('0x20'));}}else{return _0x36096c;}}function respondWithRpcPromise(_0x34662b,_0x2519da,_0x3498e7,_0xdda24f){return new BPromise(function(_0x617864,_0x3b019f){var _0x350988=_0xdda24f||client;return _0x350988[_0x5286('0x21')](_0x34662b,_0x3498e7)[_0x5286('0x22')](function(_0x194af3){logger['info'](_0x5286('0x23'),_0x2519da,'request\x20sent');logger[_0x5286('0x24')](_0x5286('0x25'),_0x2519da,'request\x20sent',JSON[_0x5286('0x26')](_0x194af3));if(_0x194af3[_0x5286('0x27')]){if(_0x194af3[_0x5286('0x27')][_0x5286('0x28')]===0x1f4){logger[_0x5286('0x27')](_0x5286('0x23'),_0x2519da,_0x194af3[_0x5286('0x27')]['message']);return _0x3b019f(_0x194af3[_0x5286('0x27')][_0x5286('0x29')]);}logger[_0x5286('0x27')](_0x5286('0x23'),_0x2519da,_0x194af3['error'][_0x5286('0x29')]);return _0x617864(_0x194af3[_0x5286('0x27')][_0x5286('0x29')]);}else{logger[_0x5286('0x2a')](_0x5286('0x23'),_0x2519da,'request\x20sent');_0x617864(_0x194af3[_0x5286('0x2b')][_0x5286('0x29')]);}})['catch'](function(_0xf3ec5b){logger[_0x5286('0x27')](_0x5286('0x23'),_0x2519da,_0xf3ec5b);_0x3b019f(_0xf3ec5b);});});}function respondWithStatusCode(_0x559fcd,_0x391a4c){_0x391a4c=_0x391a4c||0xcc;return function(_0x58c93a){if(_0x58c93a){return _0x559fcd['sendStatus'](_0x391a4c);}return _0x559fcd['status'](_0x391a4c)['end']();};}function respondWithResult(_0x542fd4,_0x1760d9){_0x1760d9=_0x1760d9||0xc8;return function(_0x2cbcdf){if(_0x2cbcdf){return _0x542fd4[_0x5286('0x2c')](_0x1760d9)[_0x5286('0x2d')](_0x2cbcdf);}};}function respondWithFilteredResult(_0xccbba8,_0xda0683){return function(_0x24ee12){if(_0x24ee12){var _0xcb11d4=_0x24ee12[_0x5286('0x2e')],_0xe2aa45=_0xda0683['offset'],_0x2847f3=_0xda0683[_0x5286('0x2f')]+_0xda0683[_0x5286('0x30')],_0x45b2c4;if(_0x2847f3>=_0xcb11d4){_0x2847f3=_0xcb11d4;_0x45b2c4=0xc8;}else{_0x45b2c4=0xce;}_0xccbba8[_0x5286('0x2c')](_0x45b2c4);return _0xccbba8[_0x5286('0x31')](_0x5286('0x32'),_0xe2aa45+'-'+_0x2847f3+'/'+_0xcb11d4)[_0x5286('0x2d')](_0x24ee12);}return null;};}function patchUpdates(_0x411141){return function(_0x344e97){try{jsonpatch[_0x5286('0x33')](_0x344e97,_0x411141,!![]);}catch(_0x31bca6){return BPromise[_0x5286('0x34')](_0x31bca6);}return _0x344e97[_0x5286('0x35')]();};}function saveUpdates(_0x190a59,_0x349b0a){return function(_0x23010c){if(_0x23010c){return _0x23010c[_0x5286('0x36')](_0x190a59)['then'](function(_0x4ff91e){return _0x4ff91e;});}return null;};}function removeEntity(_0x6d9496,_0x2b1017){return function(_0x1faebd){if(_0x1faebd){return _0x1faebd['destroy']()[_0x5286('0x22')](function(){var _0xa91db6=_0x1faebd['get']({'plain':!![]});var _0x17badd=_0x5286('0x37');return db[_0x5286('0x38')][_0x5286('0x39')]({'where':{'type':_0x17badd,'resourceId':_0xa91db6['id']}})[_0x5286('0x22')](function(){return _0x1faebd;});})[_0x5286('0x22')](function(){_0x6d9496[_0x5286('0x2c')](0xcc)[_0x5286('0x3a')]();});}};}function handleEntityNotFound(_0x2c3854,_0x56d85b){return function(_0x5a16c9){if(!_0x5a16c9){_0x2c3854['sendStatus'](0x194);}return _0x5a16c9;};}function handleError(_0x2dde45,_0x507d9b){_0x507d9b=_0x507d9b||0x1f4;return function(_0xf31e3a){logger['error'](_0xf31e3a[_0x5286('0x3b')]);if(_0xf31e3a[_0x5286('0x3c')]){delete _0xf31e3a[_0x5286('0x3c')];}_0x2dde45['status'](_0x507d9b)[_0x5286('0x3d')](_0xf31e3a);};}exports['index']=function(_0x54d44c,_0x3ac06a){var _0x47df4e={'include':[{'model':db[_0x5286('0x3e')],'as':_0x5286('0x3f')}]},_0x3b0598={},_0x491444={'count':0x0,'rows':[]};var _0x3e64d1=db[_0x5286('0x40')]['rawAttributes'];_0x3b0598[_0x5286('0x41')]=_[_0x5286('0x42')](_0x3e64d1);_0x3b0598[_0x5286('0x43')]=_[_0x5286('0x42')](_0x54d44c[_0x5286('0x43')]);_0x3b0598[_0x5286('0x44')]=_[_0x5286('0x45')](_0x3b0598[_0x5286('0x41')],_0x3b0598[_0x5286('0x43')]);_0x47df4e[_0x5286('0x46')]=_[_0x5286('0x45')](_0x3b0598[_0x5286('0x41')],qs[_0x5286('0x47')](_0x54d44c[_0x5286('0x43')]['fields']));_0x47df4e['attributes']=_0x47df4e[_0x5286('0x46')]['length']?_0x47df4e['attributes']:_0x3b0598[_0x5286('0x41')];if(!_0x54d44c['query'][_0x5286('0x48')](_0x5286('0x49'))){_0x47df4e[_0x5286('0x30')]=qs[_0x5286('0x30')](_0x54d44c[_0x5286('0x43')][_0x5286('0x30')]);_0x47df4e[_0x5286('0x2f')]=qs['offset'](_0x54d44c[_0x5286('0x43')][_0x5286('0x2f')]);}_0x47df4e[_0x5286('0x4a')]=qs[_0x5286('0x4b')](_0x54d44c['query'][_0x5286('0x4b')]);_0x47df4e[_0x5286('0x4c')]=qs[_0x5286('0x44')](_[_0x5286('0x4d')](_0x54d44c[_0x5286('0x43')],_0x3b0598[_0x5286('0x44')]));if(_0x54d44c[_0x5286('0x43')][_0x5286('0x4e')]){_0x47df4e['where']=_[_0x5286('0x4f')](_0x47df4e[_0x5286('0x4c')],{'$or':_['map'](_0x3e64d1,function(_0x368e7a){if(_0x368e7a['type'][_0x5286('0x50')]!==_0x5286('0x51')){var _0x585f87={};_0x585f87[_0x368e7a[_0x5286('0x52')]]={'$like':'%'+_0x54d44c[_0x5286('0x43')][_0x5286('0x4e')]+'%'};return _0x585f87;}})});}_0x47df4e=_[_0x5286('0x4f')]({},_0x47df4e,_0x54d44c['options']);var _0x519d68={'where':_0x47df4e[_0x5286('0x4c')]};return db[_0x5286('0x40')]['count'](_0x519d68)[_0x5286('0x22')](function(_0x344e76){_0x491444[_0x5286('0x2e')]=_0x344e76;if(_0x54d44c[_0x5286('0x43')]['includeAll']){_0x47df4e[_0x5286('0x53')]=[{'all':!![]}];}return db['ChatWebsite'][_0x5286('0x54')](_0x47df4e);})[_0x5286('0x22')](function(_0x4e810a){_0x491444[_0x5286('0x55')]=_0x4e810a;return _0x491444;})[_0x5286('0x22')](respondWithFilteredResult(_0x3ac06a,_0x47df4e))[_0x5286('0x56')](handleError(_0x3ac06a,null));};exports[_0x5286('0x57')]=function(_0x471970,_0x2d74c3){var _0x1bd456={'raw':![],'where':{'id':_0x471970['params']['id']},'include':[{'model':db[_0x5286('0x3e')],'as':_0x5286('0x3f')}]},_0x10e5e2={};_0x10e5e2['model']=_['keys'](db['ChatWebsite'][_0x5286('0x58')]);_0x10e5e2['query']=_[_0x5286('0x42')](_0x471970[_0x5286('0x43')]);_0x10e5e2[_0x5286('0x44')]=_['intersection'](_0x10e5e2[_0x5286('0x41')],_0x10e5e2['query']);_0x1bd456['attributes']=_[_0x5286('0x45')](_0x10e5e2[_0x5286('0x41')],qs[_0x5286('0x47')](_0x471970[_0x5286('0x43')][_0x5286('0x47')]));_0x1bd456[_0x5286('0x46')]=_0x1bd456[_0x5286('0x46')][_0x5286('0x59')]?_0x1bd456[_0x5286('0x46')]:_0x10e5e2[_0x5286('0x41')];if(_0x471970[_0x5286('0x43')][_0x5286('0x5a')]){_0x1bd456[_0x5286('0x53')]=[{'all':!![]}];}_0x1bd456=_[_0x5286('0x4f')]({},_0x1bd456,_0x471970['options']);return db[_0x5286('0x40')][_0x5286('0x5b')](_0x1bd456)[_0x5286('0x22')](handleEntityNotFound(_0x2d74c3,null))[_0x5286('0x22')](respondWithResult(_0x2d74c3,null))[_0x5286('0x56')](handleError(_0x2d74c3,null));};exports[_0x5286('0x5c')]=function(_0x1d4c0f,_0x272329){return db[_0x5286('0x40')][_0x5286('0x5c')](_0x1d4c0f['body'],{})['then'](function(_0x332a25){var _0x5bb72e=_0x1d4c0f[_0x5286('0x5d')][_0x5286('0x5e')]({'plain':!![]});if(!_0x5bb72e)throw new Error(_0x5286('0x5f'));if(_0x5bb72e['role']===_0x5286('0x5d')){var _0x206aa5=_0x332a25[_0x5286('0x5e')]({'plain':!![]});var _0x110606=_0x5286('0x37');return db['UserProfileSection'][_0x5286('0x5b')]({'where':{'name':_0x110606,'userProfileId':_0x5bb72e[_0x5286('0x60')]},'raw':!![]})[_0x5286('0x22')](function(_0x575788){if(_0x575788&&_0x575788[_0x5286('0x61')]===0x0){return db[_0x5286('0x38')][_0x5286('0x5c')]({'name':_0x206aa5[_0x5286('0x3c')],'resourceId':_0x206aa5['id'],'type':_0x575788['name'],'sectionId':_0x575788['id']},{})['then'](function(){return _0x332a25;});}else{return _0x332a25;}})['catch'](function(_0x6539f0){logger['error'](_0x5286('0x62'),_0x6539f0);throw _0x6539f0;});}return _0x332a25;})[_0x5286('0x22')](respondWithResult(_0x272329,0xc9))[_0x5286('0x56')](handleError(_0x272329,null));};exports['update']=function(_0x484632,_0x1b9de8){if(_0x484632['body']['id']){delete _0x484632['body']['id'];}return db[_0x5286('0x40')][_0x5286('0x5b')]({'where':{'id':_0x484632['params']['id']},'include':[{'model':db[_0x5286('0x3e')],'as':_0x5286('0x3f')}]})[_0x5286('0x22')](handleEntityNotFound(_0x1b9de8,null))[_0x5286('0x22')](saveUpdates(_0x484632[_0x5286('0x63')],null))[_0x5286('0x22')](respondWithResult(_0x1b9de8,null))[_0x5286('0x56')](handleError(_0x1b9de8,null));};exports[_0x5286('0x39')]=function(_0x76021d,_0x4fdce0){return db[_0x5286('0x40')][_0x5286('0x5b')]({'where':{'id':_0x76021d[_0x5286('0x64')]['id']}})['then'](handleEntityNotFound(_0x4fdce0,null))[_0x5286('0x22')](removeEntity(_0x4fdce0,null))[_0x5286('0x56')](handleError(_0x4fdce0,null));};exports[_0x5286('0x65')]=function(_0x3e036f,_0x803f26){return db['ChatWebsite'][_0x5286('0x65')]()['then'](respondWithResult(_0x803f26,null))[_0x5286('0x56')](handleError(_0x803f26,null));};exports[_0x5286('0x66')]=function(_0xa2a891,_0x4361d3,_0x3648f4){if(_0xa2a891['body']['id']){delete _0xa2a891[_0x5286('0x63')]['id'];}return db['ChatWebsite'][_0x5286('0x5b')]({'where':{'id':_0xa2a891['params']['id']}})[_0x5286('0x22')](handleEntityNotFound(_0x4361d3,null))[_0x5286('0x22')](function(_0x27e253){if(_0x27e253){_0xa2a891[_0x5286('0x63')][_0x5286('0x67')]=_0x27e253['id'];return db[_0x5286('0x68')]['create'](_0xa2a891[_0x5286('0x63')]);}})[_0x5286('0x22')](respondWithResult(_0x4361d3,null))['catch'](handleError(_0x4361d3,null));};exports['getDispositions']=function(_0x446d8c,_0x4f1405,_0x37f09a){var _0x140a97={'raw':![],'where':{}};var _0x21d1e8={};var _0x2c15bf={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5286('0x69')]({'where':{'id':_0x446d8c[_0x5286('0x64')]['id']}})['then'](handleEntityNotFound(_0x4f1405,null))[_0x5286('0x22')](function(_0x19ed22){if(_0x19ed22){_0x21d1e8[_0x5286('0x41')]=_['keys'](db[_0x5286('0x68')][_0x5286('0x58')]);_0x21d1e8[_0x5286('0x43')]=_[_0x5286('0x42')](_0x446d8c[_0x5286('0x43')]);_0x21d1e8[_0x5286('0x44')]=_[_0x5286('0x45')](_0x21d1e8['model'],_0x21d1e8[_0x5286('0x43')]);_0x140a97[_0x5286('0x46')]=_[_0x5286('0x45')](_0x21d1e8[_0x5286('0x41')],qs['fields'](_0x446d8c['query'][_0x5286('0x47')]));_0x140a97[_0x5286('0x46')]=_0x140a97[_0x5286('0x46')]['length']?_0x140a97[_0x5286('0x46')]:_0x21d1e8[_0x5286('0x41')];if(!_0x446d8c['query'][_0x5286('0x48')](_0x5286('0x49'))){_0x140a97[_0x5286('0x30')]=qs['limit'](_0x446d8c[_0x5286('0x43')]['limit']);_0x140a97['offset']=qs['offset'](_0x446d8c['query']['offset']);}_0x140a97['order']=qs[_0x5286('0x4b')](_0x446d8c[_0x5286('0x43')]['sort']);_0x140a97['where']=qs[_0x5286('0x44')](_['pick'](_0x446d8c[_0x5286('0x43')],_0x21d1e8[_0x5286('0x44')]));_0x140a97[_0x5286('0x4c')][_0x5286('0x67')]=_0x19ed22['id'];if(_0x446d8c[_0x5286('0x43')][_0x5286('0x4e')]){_0x140a97[_0x5286('0x4c')]=_[_0x5286('0x4f')](_0x140a97['where'],{'$or':_[_0x5286('0x6a')](_0x140a97[_0x5286('0x46')],function(_0x17a4a5){var _0x1ec15f={};_0x1ec15f[_0x17a4a5]={'$like':'%'+_0x446d8c[_0x5286('0x43')][_0x5286('0x4e')]+'%'};return _0x1ec15f;})});}_0x140a97=_[_0x5286('0x4f')]({},_0x140a97,_0x446d8c[_0x5286('0x6b')]);return db['Disposition'][_0x5286('0x2e')]({'where':_0x140a97['where']})['then'](function(_0x10d40c){_0x2c15bf[_0x5286('0x2e')]=_0x10d40c;if(_0x446d8c[_0x5286('0x43')]['includeAll']){_0x140a97[_0x5286('0x53')]=[{'all':!![]}];}return db['Disposition'][_0x5286('0x54')](_0x140a97);})[_0x5286('0x22')](function(_0x10797b){_0x2c15bf[_0x5286('0x55')]=_0x10797b;return _0x2c15bf;});}})[_0x5286('0x22')](respondWithFilteredResult(_0x4f1405,_0x140a97))['catch'](handleError(_0x4f1405,null));};exports['removeDispositions']=function(_0x4db9e4,_0x44f296,_0x438914){return db[_0x5286('0x40')][_0x5286('0x5b')]({'where':{'id':_0x4db9e4[_0x5286('0x64')]['id']}})['then'](handleEntityNotFound(_0x44f296,null))[_0x5286('0x22')](function(_0x260d4a){if(_0x260d4a){return _0x260d4a['removeDispositions'](_0x4db9e4['query'][_0x5286('0x6c')]);}})[_0x5286('0x22')](respondWithStatusCode(_0x44f296,null))[_0x5286('0x56')](handleError(_0x44f296,null));};exports['addAnswer']=function(_0x4fb5aa,_0x17f654,_0x4055f3){if(_0x4fb5aa[_0x5286('0x63')]['id']){delete _0x4fb5aa['body']['id'];}return db[_0x5286('0x40')]['find']({'where':{'id':_0x4fb5aa['params']['id']}})[_0x5286('0x22')](handleEntityNotFound(_0x17f654,null))['then'](function(_0x13d78c){if(_0x13d78c){_0x4fb5aa[_0x5286('0x63')][_0x5286('0x67')]=_0x13d78c['id'];return db[_0x5286('0x6d')][_0x5286('0x5c')](_0x4fb5aa[_0x5286('0x63')]);}})['then'](respondWithResult(_0x17f654,null))[_0x5286('0x56')](handleError(_0x17f654,null));};exports['getAnswers']=function(_0x281515,_0x3c6e8,_0x30c1a2){var _0x3636dd={'raw':![],'where':{}};var _0x3a4eef={};var _0x5d1d3d={'count':0x0,'rows':[]};return db[_0x5286('0x40')][_0x5286('0x69')]({'where':{'id':_0x281515[_0x5286('0x64')]['id']}})['then'](handleEntityNotFound(_0x3c6e8,null))[_0x5286('0x22')](function(_0x2676ca){if(_0x2676ca){_0x3a4eef[_0x5286('0x41')]=_['keys'](db[_0x5286('0x6d')][_0x5286('0x58')]);_0x3a4eef[_0x5286('0x43')]=_[_0x5286('0x42')](_0x281515[_0x5286('0x43')]);_0x3a4eef[_0x5286('0x44')]=_[_0x5286('0x45')](_0x3a4eef[_0x5286('0x41')],_0x3a4eef[_0x5286('0x43')]);_0x3636dd[_0x5286('0x46')]=_[_0x5286('0x45')](_0x3a4eef[_0x5286('0x41')],qs[_0x5286('0x47')](_0x281515[_0x5286('0x43')][_0x5286('0x47')]));_0x3636dd[_0x5286('0x46')]=_0x3636dd[_0x5286('0x46')]['length']?_0x3636dd[_0x5286('0x46')]:_0x3a4eef['model'];if(!_0x281515[_0x5286('0x43')]['hasOwnProperty'](_0x5286('0x49'))){_0x3636dd[_0x5286('0x30')]=qs[_0x5286('0x30')](_0x281515[_0x5286('0x43')][_0x5286('0x30')]);_0x3636dd['offset']=qs[_0x5286('0x2f')](_0x281515[_0x5286('0x43')][_0x5286('0x2f')]);}_0x3636dd['order']=qs[_0x5286('0x4b')](_0x281515[_0x5286('0x43')][_0x5286('0x4b')]);_0x3636dd['where']=qs['filters'](_[_0x5286('0x4d')](_0x281515[_0x5286('0x43')],_0x3a4eef[_0x5286('0x44')]));_0x3636dd[_0x5286('0x4c')][_0x5286('0x67')]=_0x2676ca['id'];if(_0x281515[_0x5286('0x43')][_0x5286('0x4e')]){_0x3636dd[_0x5286('0x4c')]=_[_0x5286('0x4f')](_0x3636dd[_0x5286('0x4c')],{'$or':_[_0x5286('0x6a')](_0x3636dd[_0x5286('0x46')],function(_0x2518aa){var _0x14d83b={};_0x14d83b[_0x2518aa]={'$like':'%'+_0x281515[_0x5286('0x43')][_0x5286('0x4e')]+'%'};return _0x14d83b;})});}_0x3636dd=_[_0x5286('0x4f')]({},_0x3636dd,_0x281515[_0x5286('0x6b')]);return db[_0x5286('0x6d')][_0x5286('0x2e')]({'where':_0x3636dd[_0x5286('0x4c')]})[_0x5286('0x22')](function(_0x3b5d19){_0x5d1d3d['count']=_0x3b5d19;if(_0x281515[_0x5286('0x43')][_0x5286('0x5a')]){_0x3636dd[_0x5286('0x53')]=[{'all':!![]}];}return db[_0x5286('0x6d')][_0x5286('0x54')](_0x3636dd);})[_0x5286('0x22')](function(_0x56fa52){_0x5d1d3d[_0x5286('0x55')]=_0x56fa52;return _0x5d1d3d;});}})[_0x5286('0x22')](respondWithFilteredResult(_0x3c6e8,_0x3636dd))[_0x5286('0x56')](handleError(_0x3c6e8,null));};exports['removeAnswers']=function(_0x536bed,_0x22d68b,_0x49f74b){return db[_0x5286('0x40')]['find']({'where':{'id':_0x536bed[_0x5286('0x64')]['id']}})[_0x5286('0x22')](handleEntityNotFound(_0x22d68b,null))['then'](function(_0x29316b){if(_0x29316b){return _0x29316b[_0x5286('0x6e')](_0x536bed[_0x5286('0x43')]['ids']);}})[_0x5286('0x22')](respondWithStatusCode(_0x22d68b,null))[_0x5286('0x56')](handleError(_0x22d68b,null));};exports[_0x5286('0x6f')]=function(_0x4c7a33,_0xe251f0,_0xca3859){_0x4c7a33[_0x5286('0x63')][_0x5286('0x70')]=_0x4c7a33[_0x5286('0x71')]['filename'];return db['ChatWebsite'][_0x5286('0x5b')]({'where':{'id':_0x4c7a33[_0x5286('0x64')]['id']}})[_0x5286('0x22')](handleEntityNotFound(_0xe251f0,null))['then'](saveUpdates(_0x4c7a33[_0x5286('0x63')],null))[_0x5286('0x22')](respondWithResult(_0xe251f0,null))[_0x5286('0x56')](handleError(_0xe251f0,null));};exports[_0x5286('0x72')]=function(_0x1382db,_0x82a8b0,_0xf1bfbc){_0x1382db[_0x5286('0x63')][_0x5286('0x73')]=_0x1382db[_0x5286('0x71')][_0x5286('0x74')];return db[_0x5286('0x40')][_0x5286('0x5b')]({'where':{'id':_0x1382db[_0x5286('0x64')]['id']}})[_0x5286('0x22')](handleEntityNotFound(_0x82a8b0,null))['then'](saveUpdates(_0x1382db['body'],null))[_0x5286('0x22')](respondWithResult(_0x82a8b0,null))[_0x5286('0x56')](handleError(_0x82a8b0,null));};exports[_0x5286('0x75')]=function(_0x410f76,_0x23423a,_0x236c33){_0x410f76[_0x5286('0x63')]['customerAvatar']=_0x410f76[_0x5286('0x71')]['filename'];return db[_0x5286('0x40')][_0x5286('0x5b')]({'where':{'id':_0x410f76['params']['id']}})[_0x5286('0x22')](handleEntityNotFound(_0x23423a,null))['then'](saveUpdates(_0x410f76['body'],null))[_0x5286('0x22')](respondWithResult(_0x23423a,null))[_0x5286('0x56')](handleError(_0x23423a,null));};exports[_0x5286('0x76')]=function(_0x400201,_0x1a048a,_0xe7b596){_0x400201['body'][_0x5286('0x77')]=_0x400201['file']['filename'];return db[_0x5286('0x40')][_0x5286('0x5b')]({'where':{'id':_0x400201[_0x5286('0x64')]['id']}})[_0x5286('0x22')](handleEntityNotFound(_0x1a048a,null))['then'](saveUpdates(_0x400201['body'],null))[_0x5286('0x22')](respondWithResult(_0x1a048a,null))[_0x5286('0x56')](handleError(_0x1a048a,null));};exports['getLogo']=function(_0x4bd63f,_0x5d03fb,_0x3c4743){var _0xd67126=path['join'](config[_0x5286('0x78')],'server/files/images/logos/default_logo.png');var _0x36dc60={'where':{'id':_0x4bd63f['params']['id']},'attributes':['id',_0x5286('0x70')],'raw':!![]};var _0x18f44d=![];return require(_0x5286('0x79'))['getLicense']()[_0x5286('0x22')](function(_0x556a0f){if(_0x556a0f){_0x18f44d=_0x556a0f[_0x5286('0x7a')];}})[_0x5286('0x22')](function(){return db[_0x5286('0x40')]['find'](_0x36dc60);})[_0x5286('0x22')](handleEntityNotFound(_0x5d03fb,null))['then'](function(_0x2e888f){if(_0x2e888f){if(!_['isNil'](_0x2e888f[_0x5286('0x70')])){if(fs['existsSync'](path['join'](config['root'],_0x5286('0x7b'),_0x2e888f[_0x5286('0x70')]))&&_0x18f44d){_0xd67126=path[_0x5286('0x7c')](config[_0x5286('0x78')],_0x5286('0x7b'),_0x2e888f[_0x5286('0x70')]);}}return _0x5d03fb[_0x5286('0x7d')](_0xd67126);}})['catch'](handleError(_0x5d03fb,null));};exports['getAvatar']=function(_0x3d4b95,_0x4b1537,_0x39960d){var _0x320840=path[_0x5286('0x7c')](config[_0x5286('0x78')],_0x5286('0x7e'));var _0x5dd1cd={'where':{'id':_0x3d4b95['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite'][_0x5286('0x5b')](_0x5dd1cd)['then'](handleEntityNotFound(_0x4b1537,null))['then'](function(_0x5eb1a4){if(_0x5eb1a4){if(!_['isNil'](_0x5eb1a4[_0x5286('0x73')])){if(fs[_0x5286('0x7f')](path['join'](config[_0x5286('0x78')],_0x5286('0x80'),_0x5eb1a4[_0x5286('0x73')]))){_0x320840=path['join'](config[_0x5286('0x78')],_0x5286('0x80'),_0x5eb1a4['agentAvatar']);}}return _0x4b1537[_0x5286('0x7d')](_0x320840);}})[_0x5286('0x56')](handleError(_0x4b1537,null));};exports[_0x5286('0x81')]=function(_0x415e5b,_0x1e646f,_0x4f9ef5){var _0x135595=path[_0x5286('0x7c')](config[_0x5286('0x78')],_0x5286('0x82'));var _0x5b8db4={'where':{'id':_0x415e5b[_0x5286('0x64')]['id']},'attributes':['id','customerAvatar',_0x5286('0x83')],'raw':!![]};return db['ChatWebsite'][_0x5286('0x5b')](_0x5b8db4)[_0x5286('0x22')](handleEntityNotFound(_0x1e646f,null))[_0x5286('0x22')](function(_0x7314e7){if(_0x7314e7){if(!_[_0x5286('0x84')](_0x7314e7[_0x5286('0x85')])){if(fs[_0x5286('0x7f')](path[_0x5286('0x7c')](config['root'],_0x5286('0x80'),_0x7314e7['customerAvatar']))&&_0x7314e7[_0x5286('0x83')]){_0x135595=path[_0x5286('0x7c')](config[_0x5286('0x78')],_0x5286('0x80'),_0x7314e7[_0x5286('0x85')]);}}return _0x1e646f[_0x5286('0x7d')](_0x135595);}})[_0x5286('0x56')](handleError(_0x1e646f,null));};exports[_0x5286('0x86')]=function(_0x2a3ecd,_0x279b66,_0xbcc982){var _0x27a602=path[_0x5286('0x7c')](config['root'],_0x5286('0x87'));var _0x2941a4={'where':{'id':_0x2a3ecd['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x5286('0x40')][_0x5286('0x5b')](_0x2941a4)[_0x5286('0x22')](handleEntityNotFound(_0x279b66,null))[_0x5286('0x22')](function(_0x206b64){if(_0x206b64){if(!_[_0x5286('0x84')](_0x206b64['systemAvatar'])){if(fs['existsSync'](path[_0x5286('0x7c')](config[_0x5286('0x78')],_0x5286('0x80'),_0x206b64['systemAvatar']))){_0x27a602=path[_0x5286('0x7c')](config[_0x5286('0x78')],_0x5286('0x80'),_0x206b64[_0x5286('0x77')]);}}return _0x279b66['download'](_0x27a602);}})['catch'](handleError(_0x279b66,null));};exports[_0x5286('0x88')]=function(_0x269bb7,_0x348a24,_0x260c9b){var _0x153337=require(_0x5286('0x89'));var _0x711edc=new _0x153337();var _0x157073=_0x711edc[_0x5286('0x8a')](_0x269bb7[_0x5286('0x8b')][_0x5286('0x8c')])[_0x5286('0x8d')]();var _0x48b07d={'body':_0x269bb7[_0x5286('0x63')],'channel':'chat'};var _0xe028f8=[];var _0x5d77c0=[];var _0x20f0c3={};var _0x1242c1=![];return db[_0x5286('0x8e')][_0x5286('0x65')]()[_0x5286('0x22')](function(_0x3bf556){if(!_0x3bf556){throw new db['Sequelize'][(_0x5286('0x8f'))]('no\x20available\x20attributes');}_0xe028f8=_[_0x5286('0x90')](_[_0x5286('0x42')](_0x3bf556),[_0x5286('0x91'),'updatedAt']);_0x5d77c0=_[_0x5286('0x90')](_[_0x5286('0x42')](_0x3bf556),['createdAt','updatedAt',_0x5286('0x92'),_0x5286('0x93')]);if(_0x269bb7['body']['id']){delete _0x269bb7[_0x5286('0x63')]['id'];}if(_[_0x5286('0x84')](_0x269bb7[_0x5286('0x63')][_0x5286('0x94')])){throw new db[(_0x5286('0x95'))][(_0x5286('0x8f'))](_0x5286('0x96'));}if(_[_0x5286('0x84')](_0x269bb7[_0x5286('0x63')][_0x5286('0x63')])||_0x269bb7[_0x5286('0x63')][_0x5286('0x63')]===''){throw new db[(_0x5286('0x95'))][(_0x5286('0x8f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5286('0x84')](_0x269bb7[_0x5286('0x63')]['mapKey'])){throw new db[(_0x5286('0x95'))][(_0x5286('0x8f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5d77c0);}if(!_[_0x5286('0x97')](_0x5d77c0,_0x269bb7[_0x5286('0x63')]['mapKey'])){throw new db[(_0x5286('0x95'))][(_0x5286('0x8f'))](_0x5286('0x98')+_0x5d77c0);}_0x20f0c3[_0x269bb7[_0x5286('0x63')][_0x5286('0x99')]]=_0x269bb7[_0x5286('0x63')][_0x5286('0x94')];})[_0x5286('0x22')](function(){return db[_0x5286('0x40')][_0x5286('0x5b')]({'where':{'id':_0x269bb7[_0x5286('0x64')]['id']},'include':[{'model':db[_0x5286('0x9a')],'as':_0x5286('0x9b'),'include':[{'model':db[_0x5286('0x8e')],'as':_0x5286('0x9c'),'where':_0x20f0c3,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['ChatApplication'],'as':_0x5286('0x9d')}]});})['then'](handleEntityNotFound(_0x348a24,null))[_0x5286('0x22')](function(_0x1f07a8){if(_0x1f07a8&&_0x1f07a8[_0x5286('0x9b')]){_0x48b07d[_0x5286('0x9e')]=_0x1f07a8;_0x48b07d[_0x5286('0x9f')]=_0x1f07a8[_0x5286('0x9d')];_0x48b07d[_0x5286('0xa0')]=_0x1f07a8['List'];_0x48b07d['applications']=_['orderBy'](_0x48b07d[_0x5286('0x9f')],['priority'],[_0x5286('0xa1')]);if(_0x48b07d['account'][_0x5286('0x9d')]){delete _0x48b07d['account'][_0x5286('0x9d')];}if(_0x48b07d[_0x5286('0x9e')][_0x5286('0x9b')]&&_0x48b07d[_0x5286('0x9e')][_0x5286('0x9b')]['Contacts'][_0x5286('0x59')]){return _0x48b07d[_0x5286('0x9e')][_0x5286('0x9b')]['Contacts'][0x0];}var _0x27a7be=_[_0x5286('0x18')](_0x269bb7['body'],{'firstName':_0x269bb7['body'][_0x5286('0x94')],'ListId':_0x1f07a8[_0x5286('0x93')]});_0x27a7be[_0x269bb7[_0x5286('0x63')]['mapKey']]=_0x269bb7[_0x5286('0x63')][_0x5286('0x94')];return db[_0x5286('0x8e')][_0x5286('0x5c')](_0x27a7be,{'fields':_0xe028f8,'raw':!![]});}})[_0x5286('0x22')](handleEntityNotFound(_0x348a24,null))[_0x5286('0x22')](function(_0x111928){_0x48b07d['contact']=_0x111928;if(_0x111928){var _0x5503bb={'ContactId':_0x111928['id'],'ChatWebsiteId':_0x269bb7[_0x5286('0x64')]['id'],'from':(_0x111928['firstName']||'')+'\x20'+(_0x111928[_0x5286('0xa2')]||''),'customerIp':_0x269bb7[_0x5286('0x63')][_0x5286('0xa3')],'referer':_0x269bb7[_0x5286('0x63')][_0x5286('0xa4')],'browserName':_0x157073[_0x5286('0xa5')]['name']&&_0x157073[_0x5286('0xa5')][_0x5286('0xa6')]?util['format'](_0x5286('0xa7'),_0x157073['browser'][_0x5286('0x3c')],_0x157073[_0x5286('0xa5')][_0x5286('0xa6')]):'unknown','browserVersion':_0x157073[_0x5286('0xa5')][_0x5286('0xa6')]||_0x5286('0xa8'),'osName':util['format'](_0x5286('0xa7'),_0x157073['os'][_0x5286('0x3c')],_0x157073['os'][_0x5286('0xa6')]),'osVersion':_0x157073['os'][_0x5286('0xa6')],'deviceModel':_0x157073[_0x5286('0xa9')]['model']&&_0x157073['device'][_0x5286('0xaa')]?util['format'](_0x5286('0xab'),_0x157073[_0x5286('0xa9')][_0x5286('0x41')],_0x157073['device'][_0x5286('0xaa')],_0x157073[_0x5286('0xa9')][_0x5286('0xac')]):null,'deviceVendor':_0x157073[_0x5286('0xa9')][_0x5286('0xaa')],'deviceType':_0x157073[_0x5286('0xa9')]['type'],'formData':JSON['stringify'](_0x269bb7['body'])};var _0x16b8bb={'ChatWebsiteId':_0x269bb7[_0x5286('0x64')]['id'],'closed':![]};if(_0x269bb7['body'][_0x5286('0xad')]){_0x16b8bb[_0x5286('0xad')]=_0x269bb7[_0x5286('0x63')][_0x5286('0xad')];return db[_0x5286('0xae')][_0x5286('0x5b')]({'where':_0x16b8bb})[_0x5286('0x22')](function(_0x5a7aff){if(_0x5a7aff){return[_0x5a7aff,![]];}_0x5503bb[_0x5286('0xad')]=_0x269bb7[_0x5286('0x63')][_0x5286('0xad')];_0x5503bb[_0x5286('0xaf')]=_0x269bb7[_0x5286('0x63')]['externalUrl'];return db['ChatInteraction']['create'](_0x5503bb)[_0x5286('0x22')](function(_0x4f0bdf){return[_0x4f0bdf,!![]];});});}_0x16b8bb[_0x5286('0xb0')]=_0x111928['id'];if(_0x269bb7[_0x5286('0x63')][_0x5286('0xb1')]&&_0x269bb7[_0x5286('0x63')][_0x5286('0xb1')]['id']){_0x16b8bb['id']=_0x269bb7[_0x5286('0x63')][_0x5286('0xb1')]['id'];return db['ChatInteraction'][_0x5286('0x5b')]({'where':_0x16b8bb})[_0x5286('0x22')](function(_0x481b9d){if(_0x481b9d){return[_0x481b9d,![]];}return db[_0x5286('0xae')][_0x5286('0x5c')](_0x5503bb)[_0x5286('0x22')](function(_0xd5c772){return[_0xd5c772,!![]];});});}return db[_0x5286('0xae')][_0x5286('0x5c')](_0x5503bb)[_0x5286('0x22')](function(_0x20ccd2){return[_0x20ccd2,!![]];});}})[_0x5286('0xb2')](function(_0x5aae14,_0x528512){if(_0x5aae14){_0x1242c1=_0x528512;if(!_0x528512){var _0x243739={'from':(_0x48b07d[_0x5286('0xb3')][_0x5286('0xb4')]||'')+'\x20'+(_0x48b07d[_0x5286('0xb3')][_0x5286('0xa2')]||'')};if(_0x269bb7[_0x5286('0x63')][_0x5286('0xad')]&&_0x269bb7['body'][_0x5286('0xb5')]&&_0x269bb7['body'][_0x5286('0xad')]!=_0x269bb7['body'][_0x5286('0xb5')]){_0x243739[_0x5286('0xad')]=_0x269bb7[_0x5286('0x63')][_0x5286('0xb5')];}return _0x5aae14[_0x5286('0x36')](_0x243739);}else{return _0x5aae14;}}})['then'](function(_0x57985a){_0x48b07d['interaction']=_0x57985a[_0x5286('0x5e')]({'plain':!![]});_0x48b07d['interaction'][_0x5286('0xb6')]=_0x1242c1;if(_0x48b07d[_0x5286('0xb1')]['created']){if(_0x48b07d[_0x5286('0x9e')][_0x5286('0xb7')]){_0x48b07d[_0x5286('0x9f')][_0x5286('0xb8')]({'id':0x0,'priority':_0x48b07d[_0x5286('0x9f')][_0x5286('0x59')]+0x1,'app':_0x5286('0xb9'),'appdata':_0x5286('0xba'),'interval':_0x5286('0xbb')});}}return db[_0x5286('0xbc')]['create']({'body':_0x269bb7[_0x5286('0x63')][_0x5286('0x63')],'ChatWebsiteId':_0x269bb7[_0x5286('0x64')]['id'],'ChatInteractionId':_0x57985a['id'],'direction':'in','ContactId':_0x48b07d[_0x5286('0xb3')]['id'],'AttachmentId':_0x269bb7[_0x5286('0x63')]['AttachmentId']});})['then'](function(_0x224bc2){_0x48b07d[_0x5286('0x29')]=_0x224bc2;if(_0x48b07d[_0x5286('0xb1')][_0x5286('0xbd')]){return db[_0x5286('0xbe')][_0x5286('0x5b')]({'attributes':['id',_0x5286('0x3c')],'where':{'id':_0x48b07d[_0x5286('0xb1')][_0x5286('0xbd')]}})[_0x5286('0x22')](function(_0x511267){if(_0x511267){_0x48b07d['applications'][_0x5286('0xbf')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x511267[_0x5286('0x3c')]+','+(_0x48b07d[_0x5286('0x9e')]['waitForTheAssignedAgent']||0xa),'interval':_0x5286('0xbb')});_0x48b07d['forcedOwnership']=!![];}return respondWithRpcPromise(_0x5286('0xc0'),'startRouting',_0x48b07d);});}return respondWithRpcPromise(_0x5286('0xc0'),_0x5286('0xc1'),_0x48b07d);})['then'](function(_0x1be20d){respondWithRpcPromise(_0x5286('0xc2'),'EventManager',{'event':_0x5286('0x88'),'message':_0x1be20d},client9002);return _0x1be20d;})[_0x5286('0x22')](respondWithResult(_0x348a24,null))[_0x5286('0x56')](handleError(_0x348a24,null));};exports[_0x5286('0xc3')]=function(_0x2c5de4,_0x407fce,_0x1450cb){var _0x16366a,_0x195f67,_0x48f89b;var _0x4bd61a=[];var _0xcf877c=[];var _0x54c986={};return db[_0x5286('0x8e')][_0x5286('0x65')]()[_0x5286('0x22')](function(_0x221f8a){if(!_0x221f8a){throw new db['Sequelize']['ValidationError'](_0x5286('0xc4'));}_0xcf877c=_[_0x5286('0x90')](_[_0x5286('0x42')](_0x221f8a),['createdAt','updatedAt']);_0x4bd61a=_['difference'](_[_0x5286('0x42')](_0x221f8a),[_0x5286('0x91'),_0x5286('0xc5'),_0x5286('0x92'),'ListId']);if(_0x2c5de4['body']['id']){delete _0x2c5de4[_0x5286('0x63')]['id'];}if(_[_0x5286('0x84')](_0x2c5de4[_0x5286('0x63')][_0x5286('0x94')])){throw _0x407fce[_0x5286('0x2c')](0x1f4)['send'](new db[(_0x5286('0x95'))][(_0x5286('0x8f'))]('from\x20is\x20mandatory'));}if(_[_0x5286('0x84')](_0x2c5de4[_0x5286('0x63')][_0x5286('0x63')])||_0x2c5de4[_0x5286('0x63')]['body']===''){throw _0x407fce[_0x5286('0x2c')](0x1f4)[_0x5286('0x3d')](new db[(_0x5286('0x95'))][(_0x5286('0x8f'))](_0x5286('0xc6')));}if(_[_0x5286('0x84')](_0x2c5de4['body'][_0x5286('0xc7')])){throw _0x407fce[_0x5286('0x2c')](0x1f4)[_0x5286('0x3d')](new db[(_0x5286('0x95'))][(_0x5286('0x8f'))](_0x5286('0xc8')+_0x4bd61a));}if(!_[_0x5286('0x97')](_0x4bd61a,_0x2c5de4[_0x5286('0x63')]['mapKeyOffline'])){throw _0x407fce['status'](0x1f4)[_0x5286('0x3d')](new db['Sequelize'][(_0x5286('0x8f'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4bd61a));}_0x54c986[_0x2c5de4[_0x5286('0x63')][_0x5286('0xc7')]]=_0x2c5de4[_0x5286('0x63')]['from'];})[_0x5286('0x22')](function(){return db[_0x5286('0x40')][_0x5286('0x5b')]({'where':{'id':_0x2c5de4['params']['id']},'include':[{'model':db['CmList'],'as':_0x5286('0x9b')}]});})['then'](handleEntityNotFound(_0x407fce,null))[_0x5286('0x22')](function(_0x2f3499){if(_0x2f3499&&_0x2f3499['List']){_0x195f67=_0x2f3499;var _0x27227d=_[_0x5286('0x18')](_0x2c5de4[_0x5286('0x63')],{'firstName':_0x2c5de4[_0x5286('0x63')][_0x5286('0x94')],'phone':_0x2c5de4[_0x5286('0x63')][_0x5286('0x94')],'ListId':_0x2f3499[_0x5286('0x93')]});_0x27227d[_0x2c5de4[_0x5286('0x63')][_0x5286('0xc7')]]=_0x2c5de4[_0x5286('0x63')][_0x5286('0x94')];return db[_0x5286('0x8e')][_0x5286('0xc9')]({'where':_0x54c986,'defaults':_0x27227d});}})[_0x5286('0xb2')](function(_0x391572){if(_0x391572){_0x48f89b=_0x391572;var _0x59f9a8=fs[_0x5286('0xca')](path[_0x5286('0x7c')](config[_0x5286('0x78')],_0x5286('0xcb')),_0x5286('0xcc'));var _0x5c1fc4=ejs[_0x5286('0xcd')](_0x59f9a8,{'body':_[_0x5286('0xce')](_0x2c5de4[_0x5286('0x63')]['body']),'bodyTitle':_0x195f67[_0x5286('0xcf')]});return db[_0x5286('0xd0')][_0x5286('0x5c')]({'body':_0x5c1fc4,'ContactId':_0x391572['id'],'ChatWebsiteId':_0x195f67['id']});}})[_0x5286('0x22')](function(_0x4ec15e){if(_0x4ec15e){_0x16366a=_0x4ec15e;return db[_0x5286('0xd1')][_0x5286('0x69')]({'where':{'service':!![]},'include':[{'model':db[_0x5286('0xd2')],'as':_0x5286('0xd3'),'raw':!![]}]});}})[_0x5286('0x22')](function(_0x3fb3c3){if(_0x3fb3c3&&_0x3fb3c3[_0x5286('0xd3')]&&_0x195f67['forwardOfflineAddress']){var _0x154b29={'tls':{'rejectUnauthorized':![]}};if(_0x3fb3c3['Smtp'][_0x5286('0xd4')]){_0x154b29[_0x5286('0xd4')]=_0x3fb3c3[_0x5286('0xd3')]['service'];}else{_0x154b29[_0x5286('0xd5')]=_0x3fb3c3[_0x5286('0xd3')][_0x5286('0xd5')];_0x154b29[_0x5286('0xd6')]=_0x3fb3c3['Smtp'][_0x5286('0xd6')];_0x154b29['secure']=_0x3fb3c3[_0x5286('0xd3')][_0x5286('0xd7')];}if(_0x3fb3c3[_0x5286('0xd3')][_0x5286('0xd8')]){_0x154b29['auth']={'user':_0x3fb3c3[_0x5286('0xd3')][_0x5286('0x5d')],'pass':_0x3fb3c3[_0x5286('0xd3')]['pass']};}return respondWithRpcPromise('SendMail',_0x5286('0xd9'),{'account':_0x154b29,'message':{'from':util[_0x5286('0xda')](_0x5286('0xdb'),_0x3fb3c3[_0x5286('0x3c')],_0x3fb3c3[_0x5286('0xdc')]||_0x3fb3c3[_0x5286('0xd3')][_0x5286('0x5d')]),'to':_0x195f67[_0x5286('0xdd')],'subject':_0x195f67[_0x5286('0xde')],'text':_0x16366a[_0x5286('0x63')]}},client9003)[_0x5286('0x22')](function(){return _0x16366a;})['catch'](function(_0x47b1ca){console[_0x5286('0x27')](_0x47b1ca);});}})[_0x5286('0x22')](function(){if(_0x16366a){return _0x16366a;}})[_0x5286('0x22')](respondWithResult(_0x407fce,null))[_0x5286('0x56')](handleError(_0x407fce,null));};exports[_0x5286('0xdf')]=function(_0x38ccf9,_0x3ec614,_0x23c575){return db[_0x5286('0xae')][_0x5286('0x5b')]({'where':{'id':_0x38ccf9[_0x5286('0x64')]['id']}})['then'](handleEntityNotFound(_0x3ec614,null))[_0x5286('0x22')](function(_0x57649a){if(_0x57649a){return _0x57649a[_0x5286('0xdf')](_0x38ccf9[_0x5286('0x63')][_0x5286('0x6c')],_[_0x5286('0xe0')](_0x38ccf9[_0x5286('0x63')],[_0x5286('0x6c'),'id'])||{});}})[_0x5286('0x22')](respondWithResult(_0x3ec614,null))['catch'](handleError(_0x3ec614,null));};exports[_0x5286('0xe1')]=function(_0x5b53a0,_0x1a00b1,_0x4b5efe){var _0x177bed={'raw':![],'where':{}};var _0x8b4b34={};var _0x2c20b6={'count':0x0,'rows':[]};return db[_0x5286('0x40')][_0x5286('0x69')]({'where':{'id':_0x5b53a0['params']['id']}})[_0x5286('0x22')](handleEntityNotFound(_0x1a00b1,null))[_0x5286('0x22')](function(_0x100c67){if(_0x100c67){_0x8b4b34[_0x5286('0x41')]=_['keys'](db[_0x5286('0xae')][_0x5286('0x58')]);_0x8b4b34[_0x5286('0x43')]=_[_0x5286('0x42')](_0x5b53a0[_0x5286('0x43')]);_0x8b4b34[_0x5286('0x44')]=_['intersection'](_0x8b4b34[_0x5286('0x41')],_0x8b4b34[_0x5286('0x43')]);_0x177bed[_0x5286('0x46')]=_[_0x5286('0x45')](_0x8b4b34[_0x5286('0x41')],qs['fields'](_0x5b53a0['query'][_0x5286('0x47')]));_0x177bed['attributes']=_0x177bed[_0x5286('0x46')]['length']?_0x177bed[_0x5286('0x46')]:_0x8b4b34[_0x5286('0x41')];if(!_0x5b53a0['query'][_0x5286('0x48')]('nolimit')){_0x177bed['limit']=qs[_0x5286('0x30')](_0x5b53a0[_0x5286('0x43')][_0x5286('0x30')]);_0x177bed[_0x5286('0x2f')]=qs[_0x5286('0x2f')](_0x5b53a0[_0x5286('0x43')][_0x5286('0x2f')]);}_0x177bed[_0x5286('0x4a')]=qs[_0x5286('0x4b')](_0x5b53a0[_0x5286('0x43')][_0x5286('0x4b')]);_0x177bed['where']=qs[_0x5286('0x44')](_[_0x5286('0x4d')](_0x5b53a0['query'],_0x8b4b34[_0x5286('0x44')]));_0x177bed[_0x5286('0x4c')][_0x5286('0x67')]=_0x100c67['id'];if(_0x5b53a0[_0x5286('0x43')][_0x5286('0x4e')]){_0x177bed[_0x5286('0x4c')]=_['merge'](_0x177bed[_0x5286('0x4c')],{'$or':_[_0x5286('0x6a')](_0x177bed[_0x5286('0x46')],function(_0x2b0352){var _0x53a68e={};_0x53a68e[_0x2b0352]={'$like':'%'+_0x5b53a0[_0x5286('0x43')]['filter']+'%'};return _0x53a68e;})});}_0x177bed=_[_0x5286('0x4f')]({},_0x177bed,_0x5b53a0[_0x5286('0x6b')]);return db['ChatInteraction'][_0x5286('0x2e')]({'where':_0x177bed['where']})['then'](function(_0x971183){_0x2c20b6[_0x5286('0x2e')]=_0x971183;if(_0x5b53a0['query'][_0x5286('0x5a')]){_0x177bed['include']=[{'model':db[_0x5286('0x8e')],'as':_0x5286('0xe2'),'required':![]},{'model':db['User'],'as':_0x5286('0xe3'),'attributes':[_0x5286('0x3c'),_0x5286('0xe4'),'internal'],'required':![]},{'model':db[_0x5286('0xe5')],'as':_0x5286('0xe6'),'attributes':['id',_0x5286('0x3c'),_0x5286('0xe7')],'where':_0x5b53a0[_0x5286('0x43')][_0x5286('0xe8')]?{'id':_0x5b53a0['query'][_0x5286('0xe8')]}:undefined,'required':_0x5b53a0[_0x5286('0x43')][_0x5286('0xe8')]?!![]:![]}];}return db['ChatInteraction'][_0x5286('0x54')](_0x177bed);})[_0x5286('0x22')](function(_0x2ff8f7){_0x2c20b6[_0x5286('0x55')]=_0x2ff8f7;return _0x2c20b6;});}})['then'](respondWithFilteredResult(_0x1a00b1,_0x177bed))[_0x5286('0x56')](handleError(_0x1a00b1,null));};function iftimePromise(_0x2aeee9,_0x24038e){return respondWithRpcPromise(_0x5286('0xe9'),_0x5286('0xea'),{'command':_0x24038e['timezone']?util['format'](_0x5286('0xeb'),_0x2aeee9[_0x5286('0xec')],_0x24038e[_0x5286('0xed')]):util[_0x5286('0xda')](_0x5286('0xee'),_0x2aeee9[_0x5286('0xec')])},client9002)[_0x5286('0x22')](function(_0x337d53){var _0x3491de=_0x337d53&&_0x337d53[_0x5286('0xef')](_0x5286('0xf0'))>=0x0?!![]:![];logger[_0x5286('0x2a')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x24038e['id'],_0x2aeee9['id'],_0x2aeee9['interval'],_0x3491de?'ONLINE':_0x5286('0xf1'),_0x24038e[_0x5286('0xed')]?_0x24038e[_0x5286('0xed')]:_0x5286('0xf2'));return _0x3491de;})[_0x5286('0x56')](function(_0x5efd2f){logger[_0x5286('0x27')](_0x5286('0xf3'),_0x24038e['id'],_0x2aeee9['id'],_0x2aeee9[_0x5286('0xec')],util[_0x5286('0xf4')](_0x5efd2f,{'showHidden':![],'depth':null}),_0x24038e[_0x5286('0xed')]?_0x24038e[_0x5286('0xed')]:_0x5286('0xf2'));return![];});}exports['getSnippet']=function(_0x31db7e,_0x27b8ab,_0x1dacaa){var _0x854770=0x0;var _0x54f667=0x0;var _0x5a63e5=![];var _0xc08bc2;var _0x57322e;return db['ChatWebsite'][_0x5286('0x5b')]({'where':{'id':_0x31db7e[_0x5286('0x64')]['id']},'include':[{'model':db['Interval'],'as':_0x5286('0xf5'),'include':[{'model':db[_0x5286('0xf5')],'as':_0x5286('0xf6'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x5286('0x22')](handleEntityNotFound(_0x27b8ab,null))['then'](function(_0x1ed60e){if(_0x1ed60e){_0xc08bc2=_0x1ed60e;return _0x1ed60e['getProactiveActions']({'raw':!![]});}})['then'](function(_0x5fb82a){if(_0xc08bc2){if(_0x5fb82a){_0x57322e=_0x5fb82a;}}return require(_0x5286('0x79'))[_0x5286('0xf7')]();})[_0x5286('0x22')](function(_0x451619){if(_0x451619){_0x54f667=_0x451619[_0x5286('0xf8')];_0x5a63e5=_0x451619[_0x5286('0x7a')];}})[_0x5286('0x22')](function(){return db['ChatInteraction'][_0x5286('0x2e')]({'where':{'closed':![]}});})[_0x5286('0x22')](function(_0x12077f){_0x854770=_0x12077f;if(_0x54f667&&_0x12077f>_0x54f667){return db[_0x5286('0xf9')][_0x5286('0x69')]({'where':{'id':0x1}})[_0x5286('0x22')](function(_0x14a132){if(_0x14a132){_0x14a132['increment'](_0x5286('0xfa'));}});}})[_0x5286('0x22')](function(){if(_0xc08bc2['Interval']&&_0xc08bc2[_0x5286('0xf5')]['Intervals']){var _0x52c21d=[];for(var _0x26973f=0x0;_0x26973f<_0xc08bc2['Interval'][_0x5286('0xf6')]['length'];_0x26973f++){var _0xf245ed=_0xc08bc2[_0x5286('0xf5')][_0x5286('0xf6')][_0x26973f][_0x5286('0x5e')]({'plain':!![]});_0x52c21d['push'](iftimePromise(_0xf245ed,_0xc08bc2));}return BPromise['all'](_0x52c21d)['then'](function(_0x551621){return _[_0x5286('0xfb')](_0x551621);});}else{return!![];}})['then'](function(_0x426d77){var _0x2966fc=fs[_0x5286('0xca')](path[_0x5286('0x7c')](config[_0x5286('0x78')],_0x5286('0xfc')),_0x5286('0xcc'));var _0x140b11={'remote':_0xc08bc2[_0x5286('0xfd')],'query':querystring[_0x5286('0x26')](_[_0x5286('0x4f')](_0xc08bc2[_0x5286('0x5e')]({'plain':!![]}),{'customerIp':_0x31db7e[_0x5286('0x8b')][_0x5286('0xfe')]||_0x31db7e[_0x5286('0x8b')][_0x5286('0xff')]||_0x31db7e['connection'][_0x5286('0x100')]||_0x31db7e['ip'],'referer':_0x31db7e[_0x5286('0x8b')][_0x5286('0xa4')],'openedInteractions':_0x854770,'maxInteractions':_0x54f667,'virtual':_0x5a63e5[_0x5286('0xf8')],'online':_0x426d77,'custom':_0x5a63e5}))[_0x5286('0x101')](/'/g,'\x5c\x27')};_0x27b8ab[_0x5286('0x3d')](ejs['render'](Mustache[_0x5286('0xcd')](_0x2966fc,_0x140b11),{'proactiveActions':_0x57322e,'alignment':_0xc08bc2[_0x5286('0x102')],'verticalAlignment':_0xc08bc2[_0x5286('0x103')]}));})['catch'](handleError(_0x27b8ab,null));};exports[_0x5286('0x104')]=function(_0xbcb6dc,_0x44bafc,_0x4cb779){return db[_0x5286('0x40')][_0x5286('0x69')]({'where':{'id':_0xbcb6dc[_0x5286('0x64')]['id']}})[_0x5286('0x22')](handleEntityNotFound(_0x44bafc,null))[_0x5286('0x22')](function(_0x35a2c9){if(_0x35a2c9){return db[_0x5286('0x105')][_0x5286('0x106')](function(_0x57c1ae){return db[_0x5286('0x107')][_0x5286('0x39')]({'where':{'ChatWebsiteId':_0xbcb6dc[_0x5286('0x64')]['id']},'transaction':_0x57c1ae})[_0x5286('0x22')](function(_0x3d4b3e){var _0xb3ff7b=_[_0x5286('0x6a')](_0xbcb6dc[_0x5286('0x63')],function(_0x563543){_0x563543[_0x5286('0x67')]=_0xbcb6dc['params']['id'];return _0x563543;});return db[_0x5286('0x107')]['bulkCreate'](_0xb3ff7b,{'transaction':_0x57c1ae});});})['then'](function(){return db[_0x5286('0x107')][_0x5286('0x108')]({'where':{'ChatWebsiteId':_0xbcb6dc['params']['id']},'order':'priority'});});}})[_0x5286('0x22')](respondWithResult(_0x44bafc,null))[_0x5286('0x56')](handleError(_0x44bafc,null));};exports[_0x5286('0x109')]=function(_0x4a466c,_0x24eea8,_0x2eb0c6){var _0xb5dfe7={};var _0x42dc00={};var _0x208f1e;var _0x3fecdc;return db['ChatWebsite'][_0x5286('0x69')]({'where':{'id':_0x4a466c['params']['id']}})['then'](handleEntityNotFound(_0x24eea8,null))[_0x5286('0x22')](function(_0x3f576a){if(_0x3f576a){_0x208f1e=_0x3f576a;_0x42dc00[_0x5286('0x41')]=_[_0x5286('0x42')](db[_0x5286('0x107')][_0x5286('0x58')]);_0x42dc00['query']=_[_0x5286('0x42')](_0x4a466c[_0x5286('0x43')]);_0x42dc00[_0x5286('0x44')]=_[_0x5286('0x45')](_0x42dc00['model'],_0x42dc00['query']);_0xb5dfe7['attributes']=_[_0x5286('0x45')](_0x42dc00['model'],qs[_0x5286('0x47')](_0x4a466c[_0x5286('0x43')][_0x5286('0x47')]));_0xb5dfe7['attributes']=_0xb5dfe7[_0x5286('0x46')][_0x5286('0x59')]?_0xb5dfe7[_0x5286('0x46')]:_0x42dc00[_0x5286('0x41')];_0xb5dfe7[_0x5286('0x4a')]=qs['sort'](_0x4a466c[_0x5286('0x43')][_0x5286('0x4b')]);_0xb5dfe7[_0x5286('0x4c')]=qs[_0x5286('0x44')](_[_0x5286('0x4d')](_0x4a466c[_0x5286('0x43')],_0x42dc00[_0x5286('0x44')]));if(_0x4a466c['query'][_0x5286('0x4e')]){_0xb5dfe7[_0x5286('0x4c')]=_[_0x5286('0x4f')](_0xb5dfe7[_0x5286('0x4c')],{'$or':_['map'](_0xb5dfe7[_0x5286('0x46')],function(_0x1152b8){var _0x3be91c={};_0x3be91c[_0x1152b8]={'$like':'%'+_0x4a466c[_0x5286('0x43')][_0x5286('0x4e')]+'%'};return _0x3be91c;})});}_0xb5dfe7=_['merge']({},_0xb5dfe7,_0x4a466c['options']);return _0x208f1e[_0x5286('0x109')](_0xb5dfe7);}})[_0x5286('0x22')](function(_0x1c6121){if(_0x1c6121){_0x3fecdc=_0x1c6121[_0x5286('0x59')];if(!_0x4a466c[_0x5286('0x43')]['hasOwnProperty']('nolimit')){_0xb5dfe7['limit']=qs[_0x5286('0x30')](_0x4a466c['query'][_0x5286('0x30')]);_0xb5dfe7[_0x5286('0x2f')]=qs[_0x5286('0x2f')](_0x4a466c[_0x5286('0x43')][_0x5286('0x2f')]);}return _0x208f1e[_0x5286('0x109')](_0xb5dfe7);}})[_0x5286('0x22')](function(_0x12b6de){if(_0x12b6de){return _0x12b6de?{'count':_0x3fecdc,'rows':_0x12b6de}:null;}})[_0x5286('0x22')](respondWithResult(_0x24eea8,null))[_0x5286('0x56')](handleError(_0x24eea8,null));};exports[_0x5286('0x10a')]=function(_0x274e59,_0x5b8e92,_0x371ab5){return db[_0x5286('0x10b')][_0x5286('0x5b')]({'where':{'id':_0x274e59[_0x5286('0x64')]['id']}})[_0x5286('0x22')](handleEntityNotFound(_0x5b8e92,null))['then'](function(_0x162ff2){if(_0x162ff2){return _0x162ff2[_0x5286('0x10a')](_0x274e59['body'][_0x5286('0x6c')],_[_0x5286('0xe0')](_0x274e59['body'],[_0x5286('0x6c'),'id'])||{});}})[_0x5286('0x22')](respondWithResult(_0x5b8e92,null))[_0x5286('0x56')](handleError(_0x5b8e92,null));};exports[_0x5286('0x10c')]=function(_0x29a422,_0xcdf2ee,_0x574773){var _0x2e658c={};var _0x3fa6fd={};var _0x5173cd;var _0x3061cb;return db[_0x5286('0x40')][_0x5286('0x69')]({'where':{'id':_0x29a422['params']['id']}})[_0x5286('0x22')](handleEntityNotFound(_0xcdf2ee,null))['then'](function(_0x482891){if(_0x482891){_0x5173cd=_0x482891;_0x3fa6fd[_0x5286('0x41')]=_[_0x5286('0x42')](db[_0x5286('0x10d')]['rawAttributes']);_0x3fa6fd[_0x5286('0x43')]=_[_0x5286('0x42')](_0x29a422[_0x5286('0x43')]);_0x3fa6fd['filters']=_['intersection'](_0x3fa6fd[_0x5286('0x41')],_0x3fa6fd[_0x5286('0x43')]);_0x2e658c[_0x5286('0x46')]=_[_0x5286('0x45')](_0x3fa6fd[_0x5286('0x41')],qs[_0x5286('0x47')](_0x29a422[_0x5286('0x43')]['fields']));_0x2e658c[_0x5286('0x46')]=_0x2e658c[_0x5286('0x46')][_0x5286('0x59')]?_0x2e658c[_0x5286('0x46')]:_0x3fa6fd['model'];_0x2e658c[_0x5286('0x4a')]=qs['sort'](_0x29a422[_0x5286('0x43')]['sort']);_0x2e658c[_0x5286('0x4c')]=qs[_0x5286('0x44')](_['pick'](_0x29a422[_0x5286('0x43')],_0x3fa6fd['filters']));if(_0x29a422['query']['filter']){_0x2e658c[_0x5286('0x4c')]=_[_0x5286('0x4f')](_0x2e658c[_0x5286('0x4c')],{'$or':_[_0x5286('0x6a')](_0x2e658c[_0x5286('0x46')],function(_0x468336){var _0x44782e={};_0x44782e[_0x468336]={'$like':'%'+_0x29a422['query'][_0x5286('0x4e')]+'%'};return _0x44782e;})});}_0x2e658c=_[_0x5286('0x4f')]({},_0x2e658c,_0x29a422['options']);return _0x5173cd[_0x5286('0x10c')](_0x2e658c);}})['then'](function(_0x4cb3dd){if(_0x4cb3dd){_0x3061cb=_0x4cb3dd[_0x5286('0x59')];if(!_0x29a422[_0x5286('0x43')][_0x5286('0x48')](_0x5286('0x49'))){_0x2e658c[_0x5286('0x30')]=qs[_0x5286('0x30')](_0x29a422['query']['limit']);_0x2e658c['offset']=qs[_0x5286('0x2f')](_0x29a422[_0x5286('0x43')][_0x5286('0x2f')]);}return _0x5173cd[_0x5286('0x10c')](_0x2e658c);}})[_0x5286('0x22')](function(_0x208c66){if(_0x208c66){return _0x208c66?{'count':_0x3061cb,'rows':_0x208c66}:null;}})[_0x5286('0x22')](respondWithResult(_0xcdf2ee,null))['catch'](handleError(_0xcdf2ee,null));};exports['getFields']=function(_0x367c22,_0x4f3c68,_0x247f34){var _0x2ede81=_0x367c22[_0x5286('0x43')][_0x5286('0x10e')]===_0x5286('0x10f')?_0x5286('0x110'):_0x5286('0x111');return db['ChatWebsite'][_0x5286('0x5b')]({'attributes':['id',_0x2ede81],'where':{'id':_0x367c22[_0x5286('0x64')]['id']}})[_0x5286('0x22')](handleEntityNotFound(_0x4f3c68,null))['then'](function(_0x5578c4){if(_0x5578c4){var _0x38de94=_0x5578c4[_0x2ede81];var _0x2756d1=_0x38de94&&_0x38de94[_0x5286('0x112')]?_0x38de94[_0x5286('0x112')]:[];_0x4f3c68[_0x5286('0x3d')]({'fromKey':_[_0x5286('0x84')](_0x38de94['fromKey'])?undefined:_0x38de94[_0x5286('0x113')],'count':_0x2756d1[_0x5286('0x59')],'rows':_0x2756d1});}})[_0x5286('0x56')](handleError(_0x4f3c68,null));};exports[_0x5286('0x114')]=function(_0x391501,_0x4add54,_0x32b68f){var _0x3b78dc={'raw':!![],'where':{}};var _0x9d136a={};var _0x31a134={'count':0x0,'rows':[]};return db[_0x5286('0x40')][_0x5286('0x69')]({'where':{'id':_0x391501['params']['id']}})[_0x5286('0x22')](handleEntityNotFound(_0x4add54,null))[_0x5286('0x22')](function(_0x488cde){if(_0x488cde){_0x9d136a[_0x5286('0x41')]=_[_0x5286('0x42')](db[_0x5286('0xd0')]['rawAttributes']);_0x9d136a[_0x5286('0x43')]=_['keys'](_0x391501[_0x5286('0x43')]);_0x9d136a[_0x5286('0x44')]=_[_0x5286('0x45')](_0x9d136a['model'],_0x9d136a[_0x5286('0x43')]);_0x3b78dc[_0x5286('0x46')]=_[_0x5286('0x45')](_0x9d136a[_0x5286('0x41')],qs[_0x5286('0x47')](_0x391501[_0x5286('0x43')][_0x5286('0x47')]));_0x3b78dc[_0x5286('0x46')]=_0x3b78dc['attributes'][_0x5286('0x59')]?_0x3b78dc[_0x5286('0x46')]:_0x9d136a[_0x5286('0x41')];if(!_0x391501[_0x5286('0x43')][_0x5286('0x48')](_0x5286('0x49'))){_0x3b78dc[_0x5286('0x30')]=qs[_0x5286('0x30')](_0x391501[_0x5286('0x43')][_0x5286('0x30')]);_0x3b78dc['offset']=qs[_0x5286('0x2f')](_0x391501[_0x5286('0x43')]['offset']);}_0x3b78dc[_0x5286('0x4a')]=qs[_0x5286('0x4b')](_0x391501[_0x5286('0x43')][_0x5286('0x4b')]);_0x3b78dc['where']=qs[_0x5286('0x44')](_['pick'](_0x391501[_0x5286('0x43')],_0x9d136a[_0x5286('0x44')]));_0x3b78dc[_0x5286('0x4c')]['ChatWebsiteId']=_0x488cde['id'];if(_0x391501[_0x5286('0x43')][_0x5286('0x4e')]){_0x3b78dc[_0x5286('0x4c')]=_['merge'](_0x3b78dc[_0x5286('0x4c')],{'$or':_[_0x5286('0x6a')](_0x3b78dc['attributes'],function(_0x13de78){var _0x10c66d={};_0x10c66d[_0x13de78]={'$like':'%'+_0x391501['query'][_0x5286('0x4e')]+'%'};return _0x10c66d;})});}_0x3b78dc=_['merge']({},_0x3b78dc,_0x391501[_0x5286('0x6b')]);return db[_0x5286('0xd0')][_0x5286('0x2e')]({'where':_0x3b78dc[_0x5286('0x4c')]})[_0x5286('0x22')](function(_0x153ef5){_0x31a134[_0x5286('0x2e')]=_0x153ef5;if(_0x391501['query'][_0x5286('0x5a')]){_0x3b78dc[_0x5286('0x53')]=[{'all':!![]}];}return db[_0x5286('0xd0')][_0x5286('0x54')](_0x3b78dc);})['then'](function(_0x3ac789){_0x31a134['rows']=_0x3ac789;return _0x31a134;});}})[_0x5286('0x22')](respondWithFilteredResult(_0x4add54,_0x3b78dc))['catch'](handleError(_0x4add54,null));};exports[_0x5286('0x115')]=function(_0x233f15,_0x50c159,_0x210232){return db[_0x5286('0x40')][_0x5286('0x5b')]({'where':{'id':_0x233f15[_0x5286('0x64')]['id']}})[_0x5286('0x22')](handleEntityNotFound(_0x50c159,null))[_0x5286('0x22')](function(_0xb7ea42){if(_0xb7ea42){return _0xb7ea42[_0x5286('0x115')](_0x233f15[_0x5286('0x63')][_0x5286('0x6c')],_[_0x5286('0xe0')](_0x233f15[_0x5286('0x63')],[_0x5286('0x6c'),'id'])||{})['spread'](function(_0x2fab2a){for(var _0x7f282f=0x0;_0x7f282f<_0x233f15[_0x5286('0x63')][_0x5286('0x6c')][_0x5286('0x59')];_0x7f282f+=0x1){socket[_0x5286('0x116')]('userChatWebsite:save',{'UserId':_0x233f15[_0x5286('0x63')][_0x5286('0x6c')][_0x7f282f],'ChatWebsiteId':_0x233f15[_0x5286('0x64')]['id']});}return _0x2fab2a;});}})[_0x5286('0x22')](respondWithResult(_0x50c159,null))[_0x5286('0x56')](handleError(_0x50c159,null));};exports[_0x5286('0x117')]=function(_0x3054a2,_0x3c3660,_0x1adc67){return db['ChatWebsite']['find']({'where':{'id':_0x3054a2['params']['id']}})['then'](handleEntityNotFound(_0x3c3660,null))[_0x5286('0x22')](function(_0x341ecf){if(_0x341ecf){return _0x341ecf[_0x5286('0x117')](_0x3054a2[_0x5286('0x43')][_0x5286('0x6c')])[_0x5286('0x22')](function(){if(_[_0x5286('0x118')](_0x3054a2[_0x5286('0x43')][_0x5286('0x6c')])){for(var _0x2e56c5=0x0;_0x2e56c5<_0x3054a2[_0x5286('0x43')]['ids'][_0x5286('0x59')];_0x2e56c5+=0x1){socket[_0x5286('0x116')](_0x5286('0x119'),{'UserId':Number(_0x3054a2[_0x5286('0x43')][_0x5286('0x6c')][_0x2e56c5]),'ChatWebsiteId':Number(_0x3054a2['params']['id'])});}}else{socket[_0x5286('0x116')](_0x5286('0x119'),{'UserId':Number(_0x3054a2[_0x5286('0x43')][_0x5286('0x6c')]),'ChatWebsiteId':Number(_0x3054a2[_0x5286('0x64')]['id'])});}});}})[_0x5286('0x22')](respondWithStatusCode(_0x3c3660,null))[_0x5286('0x56')](handleError(_0x3c3660,null));};exports[_0x5286('0x11a')]=function(_0x7a1b5f,_0x18253c,_0x3836c5){var _0x582bc2={};var _0x5412b6={};var _0x4c833b;var _0x294f61;return db[_0x5286('0x40')][_0x5286('0x69')]({'where':{'id':_0x7a1b5f['params']['id']}})[_0x5286('0x22')](handleEntityNotFound(_0x18253c,null))[_0x5286('0x22')](function(_0x3ddf98){if(_0x3ddf98){_0x4c833b=_0x3ddf98;_0x5412b6[_0x5286('0x41')]=_[_0x5286('0x42')](db['User']['rawAttributes']);_0x5412b6['query']=_['keys'](_0x7a1b5f[_0x5286('0x43')]);_0x5412b6[_0x5286('0x44')]=_[_0x5286('0x45')](_0x5412b6[_0x5286('0x41')],_0x5412b6[_0x5286('0x43')]);_0x582bc2[_0x5286('0x46')]=_[_0x5286('0x45')](_0x5412b6[_0x5286('0x41')],qs['fields'](_0x7a1b5f[_0x5286('0x43')]['fields']));_0x582bc2[_0x5286('0x46')]=_0x582bc2[_0x5286('0x46')][_0x5286('0x59')]?_0x582bc2[_0x5286('0x46')]:_0x5412b6[_0x5286('0x41')];_0x582bc2[_0x5286('0x4a')]=qs['sort'](_0x7a1b5f[_0x5286('0x43')][_0x5286('0x4b')]);_0x582bc2[_0x5286('0x4c')]=qs[_0x5286('0x44')](_[_0x5286('0x4d')](_0x7a1b5f['query'],_0x5412b6[_0x5286('0x44')]));if(_0x7a1b5f[_0x5286('0x43')][_0x5286('0x4e')]){_0x582bc2[_0x5286('0x4c')]=_[_0x5286('0x4f')](_0x582bc2['where'],{'$or':_[_0x5286('0x6a')](_0x582bc2['attributes'],function(_0x457551){var _0x991bf={};_0x991bf[_0x457551]={'$like':'%'+_0x7a1b5f[_0x5286('0x43')][_0x5286('0x4e')]+'%'};return _0x991bf;})});}_0x582bc2=_[_0x5286('0x4f')]({},_0x582bc2,_0x7a1b5f['options']);return _0x4c833b[_0x5286('0x11a')](_0x582bc2);}})[_0x5286('0x22')](function(_0x41a40){if(_0x41a40){_0x294f61=_0x41a40['length'];if(!_0x7a1b5f[_0x5286('0x43')]['hasOwnProperty']('nolimit')){_0x582bc2[_0x5286('0x30')]=qs[_0x5286('0x30')](_0x7a1b5f[_0x5286('0x43')][_0x5286('0x30')]);_0x582bc2['offset']=qs['offset'](_0x7a1b5f[_0x5286('0x43')][_0x5286('0x2f')]);}return _0x4c833b[_0x5286('0x11a')](_0x582bc2);}})[_0x5286('0x22')](function(_0x3ad62a){if(_0x3ad62a){return _0x3ad62a?{'count':_0x294f61,'rows':_0x3ad62a}:null;}})[_0x5286('0x22')](respondWithResult(_0x18253c,null))[_0x5286('0x56')](handleError(_0x18253c,null));}; \ No newline at end of file +var _0xa468=['catch','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','ChatWebsite','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','create','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','hasOwnProperty','sort','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.png','../../config/license/util','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','existsSync','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','from','Sequelize','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','account','applications','list','orderBy','asc','defaults','contact','firstName','lastName','customerIp','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','externalUrl','ChatInteraction','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','notify','offline','createdAt','from\x20is\x20mandatory','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','pass','SendMail','sendMail','email','addInteraction','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','iftime\x20%s','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','inspect','No\x20timezone','Interval','getProactiveActions','getLicense','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.js','x-real-ip','connection','remoteAddress','virtual','render','alignment','addApplications','sequelize','findAndCountAll','priority','getApplications','chatProactiveAction','addProactiveActions','omit','ChatProactiveAction','getFields','offlineForm','items','fromKey','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','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~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','result'];(function(_0x336275,_0xd26bb5){var _0x12ab42=function(_0x5c1877){while(--_0x5c1877){_0x336275['push'](_0x336275['shift']());}};_0x12ab42(++_0xd26bb5);}(_0xa468,0xf6));var _0x8a46=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa468[_0xbca1b1];return _0x4e1686;};'use strict';var pdf=require(_0x8a46('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8a46('0x1'));var jsonpatch=require(_0x8a46('0x2'));var rp=require(_0x8a46('0x3'));var moment=require(_0x8a46('0x4'));var BPromise=require(_0x8a46('0x5'));var Mustache=require(_0x8a46('0x6'));var util=require(_0x8a46('0x7'));var path=require(_0x8a46('0x8'));var sox=require(_0x8a46('0x9'));var csv=require(_0x8a46('0xa'));var ejs=require(_0x8a46('0xb'));var fs=require('fs');var _=require(_0x8a46('0xc'));var squel=require(_0x8a46('0xd'));var crypto=require('crypto');var jsforce=require(_0x8a46('0xe'));var deskjs=require(_0x8a46('0xf'));var toCsv=require(_0x8a46('0xa'));var querystring=require(_0x8a46('0x10'));var Papa=require(_0x8a46('0x11'));var Redis=require(_0x8a46('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8a46('0x13'));var hardwareService=require(_0x8a46('0x14'));var logger=require(_0x8a46('0x15'))('api');var utils=require(_0x8a46('0x16'));var config=require('../../config/environment');var db=require(_0x8a46('0x17'))['db'];config[_0x8a46('0x18')]=_['defaults'](config[_0x8a46('0x18')],{'host':_0x8a46('0x19'),'port':0x18eb});var socket=require(_0x8a46('0x1a'))(new Redis(config[_0x8a46('0x18')]));require(_0x8a46('0x1b'))[_0x8a46('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x8a46('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x8a46('0x1d')]({'port':0x232a});var client9003=jayson[_0x8a46('0x1e')][_0x8a46('0x1d')]({'port':0x232b});function checkPasswordPattern(_0x22a857,_0x4daf48,_0xff935a){if(_0xff935a){var _0x4a2432=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a2432['test'](_0x4daf48)){return _0x22a857;}else{throw new Error(_0x8a46('0x1f'));}}else{return _0x22a857;}}function respondWithRpcPromise(_0x297553,_0x3e954b,_0x310249,_0x1228ed){return new BPromise(function(_0x5dc458,_0x250e0b){var _0x3b1cc3=_0x1228ed||client;return _0x3b1cc3[_0x8a46('0x20')](_0x297553,_0x310249)[_0x8a46('0x21')](function(_0x592584){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x3e954b,_0x8a46('0x22'));logger[_0x8a46('0x23')](_0x8a46('0x24'),_0x3e954b,_0x8a46('0x22'),JSON['stringify'](_0x592584));if(_0x592584[_0x8a46('0x25')]){if(_0x592584[_0x8a46('0x25')][_0x8a46('0x26')]===0x1f4){logger[_0x8a46('0x25')]('ChatWebsite,\x20%s,\x20%s',_0x3e954b,_0x592584['error']['message']);return _0x250e0b(_0x592584[_0x8a46('0x25')]['message']);}logger['error'](_0x8a46('0x27'),_0x3e954b,_0x592584[_0x8a46('0x25')][_0x8a46('0x28')]);return _0x5dc458(_0x592584[_0x8a46('0x25')][_0x8a46('0x28')]);}else{logger['info'](_0x8a46('0x27'),_0x3e954b,_0x8a46('0x22'));_0x5dc458(_0x592584[_0x8a46('0x29')]['message']);}})[_0x8a46('0x2a')](function(_0x39d572){logger[_0x8a46('0x25')](_0x8a46('0x27'),_0x3e954b,_0x39d572);_0x250e0b(_0x39d572);});});}function respondWithStatusCode(_0x2749c8,_0x4a89c6){_0x4a89c6=_0x4a89c6||0xcc;return function(_0x317da4){if(_0x317da4){return _0x2749c8[_0x8a46('0x2b')](_0x4a89c6);}return _0x2749c8['status'](_0x4a89c6)[_0x8a46('0x2c')]();};}function respondWithResult(_0x22ec93,_0xc486e7){_0xc486e7=_0xc486e7||0xc8;return function(_0x447bdd){if(_0x447bdd){return _0x22ec93[_0x8a46('0x2d')](_0xc486e7)[_0x8a46('0x2e')](_0x447bdd);}};}function respondWithFilteredResult(_0x39b0d1,_0x30ea8f){return function(_0x25fcc2){if(_0x25fcc2){var _0x309af9=_0x25fcc2[_0x8a46('0x2f')],_0x3413b5=_0x30ea8f[_0x8a46('0x30')],_0x453445=_0x30ea8f[_0x8a46('0x30')]+_0x30ea8f[_0x8a46('0x31')],_0x3f9803;if(_0x453445>=_0x309af9){_0x453445=_0x309af9;_0x3f9803=0xc8;}else{_0x3f9803=0xce;}_0x39b0d1[_0x8a46('0x2d')](_0x3f9803);return _0x39b0d1[_0x8a46('0x32')]('Content-Range',_0x3413b5+'-'+_0x453445+'/'+_0x309af9)[_0x8a46('0x2e')](_0x25fcc2);}return null;};}function patchUpdates(_0x3ef61e){return function(_0x564993){try{jsonpatch[_0x8a46('0x33')](_0x564993,_0x3ef61e,!![]);}catch(_0x4146f6){return BPromise[_0x8a46('0x34')](_0x4146f6);}return _0x564993[_0x8a46('0x35')]();};}function saveUpdates(_0x23a5a6,_0x1e9e9a){return function(_0x1bb9db){if(_0x1bb9db){return _0x1bb9db[_0x8a46('0x36')](_0x23a5a6)[_0x8a46('0x21')](function(_0x3c0bf0){return _0x3c0bf0;});}return null;};}function removeEntity(_0x5d4bca,_0x14bd89){return function(_0xe94dbe){if(_0xe94dbe){return _0xe94dbe[_0x8a46('0x37')]()[_0x8a46('0x21')](function(){var _0x4e5e5e=_0xe94dbe[_0x8a46('0x38')]({'plain':!![]});var _0x306260='ChatWebsites';return db[_0x8a46('0x39')][_0x8a46('0x37')]({'where':{'type':_0x306260,'resourceId':_0x4e5e5e['id']}})[_0x8a46('0x21')](function(){return _0xe94dbe;});})['then'](function(){_0x5d4bca[_0x8a46('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3558a0,_0x1aed3d){return function(_0x51e0f5){if(!_0x51e0f5){_0x3558a0[_0x8a46('0x2b')](0x194);}return _0x51e0f5;};}function handleError(_0x39cb51,_0x9064ba){_0x9064ba=_0x9064ba||0x1f4;return function(_0x1a4049){logger[_0x8a46('0x25')](_0x1a4049[_0x8a46('0x3a')]);if(_0x1a4049[_0x8a46('0x3b')]){delete _0x1a4049['name'];}_0x39cb51[_0x8a46('0x2d')](_0x9064ba)[_0x8a46('0x3c')](_0x1a4049);};}exports[_0x8a46('0x3d')]=function(_0x5d34cb,_0x184f8d){var _0x4f57fc={'include':[{'model':db[_0x8a46('0x3e')],'as':'mandatoryDispositionPause'}]},_0x12a892={},_0x3c61cf={'count':0x0,'rows':[]};var _0x1b0f70=db[_0x8a46('0x3f')][_0x8a46('0x40')];_0x12a892[_0x8a46('0x41')]=_[_0x8a46('0x42')](_0x1b0f70);_0x12a892[_0x8a46('0x43')]=_[_0x8a46('0x42')](_0x5d34cb[_0x8a46('0x43')]);_0x12a892[_0x8a46('0x44')]=_[_0x8a46('0x45')](_0x12a892[_0x8a46('0x41')],_0x12a892[_0x8a46('0x43')]);_0x4f57fc[_0x8a46('0x46')]=_[_0x8a46('0x45')](_0x12a892[_0x8a46('0x41')],qs[_0x8a46('0x47')](_0x5d34cb[_0x8a46('0x43')][_0x8a46('0x47')]));_0x4f57fc[_0x8a46('0x46')]=_0x4f57fc[_0x8a46('0x46')][_0x8a46('0x48')]?_0x4f57fc[_0x8a46('0x46')]:_0x12a892[_0x8a46('0x41')];if(!_0x5d34cb['query']['hasOwnProperty'](_0x8a46('0x49'))){_0x4f57fc[_0x8a46('0x31')]=qs[_0x8a46('0x31')](_0x5d34cb[_0x8a46('0x43')][_0x8a46('0x31')]);_0x4f57fc[_0x8a46('0x30')]=qs[_0x8a46('0x30')](_0x5d34cb[_0x8a46('0x43')][_0x8a46('0x30')]);}_0x4f57fc[_0x8a46('0x4a')]=qs['sort'](_0x5d34cb[_0x8a46('0x43')]['sort']);_0x4f57fc[_0x8a46('0x4b')]=qs['filters'](_[_0x8a46('0x4c')](_0x5d34cb[_0x8a46('0x43')],_0x12a892[_0x8a46('0x44')]));if(_0x5d34cb['query'][_0x8a46('0x4d')]){_0x4f57fc[_0x8a46('0x4b')]=_['merge'](_0x4f57fc[_0x8a46('0x4b')],{'$or':_[_0x8a46('0x4e')](_0x1b0f70,function(_0x48ced1){if(_0x48ced1[_0x8a46('0x4f')][_0x8a46('0x50')]!==_0x8a46('0x51')){var _0x3b6be9={};_0x3b6be9[_0x48ced1[_0x8a46('0x52')]]={'$like':'%'+_0x5d34cb[_0x8a46('0x43')][_0x8a46('0x4d')]+'%'};return _0x3b6be9;}})});}_0x4f57fc=_[_0x8a46('0x53')]({},_0x4f57fc,_0x5d34cb[_0x8a46('0x54')]);var _0x58d411={'where':_0x4f57fc[_0x8a46('0x4b')]};return db[_0x8a46('0x3f')]['count'](_0x58d411)[_0x8a46('0x21')](function(_0x523636){_0x3c61cf[_0x8a46('0x2f')]=_0x523636;if(_0x5d34cb[_0x8a46('0x43')][_0x8a46('0x55')]){_0x4f57fc[_0x8a46('0x56')]=[{'all':!![]}];}return db['ChatWebsite'][_0x8a46('0x57')](_0x4f57fc);})[_0x8a46('0x21')](function(_0x3026e7){_0x3c61cf[_0x8a46('0x58')]=_0x3026e7;return _0x3c61cf;})[_0x8a46('0x21')](respondWithFilteredResult(_0x184f8d,_0x4f57fc))[_0x8a46('0x2a')](handleError(_0x184f8d,null));};exports[_0x8a46('0x59')]=function(_0x2e09ea,_0x5ed16c){var _0x1c12f9={'raw':![],'where':{'id':_0x2e09ea[_0x8a46('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0x8a46('0x5b')}]},_0x3ff2b6={};_0x3ff2b6[_0x8a46('0x41')]=_[_0x8a46('0x42')](db['ChatWebsite'][_0x8a46('0x40')]);_0x3ff2b6['query']=_['keys'](_0x2e09ea[_0x8a46('0x43')]);_0x3ff2b6[_0x8a46('0x44')]=_['intersection'](_0x3ff2b6[_0x8a46('0x41')],_0x3ff2b6[_0x8a46('0x43')]);_0x1c12f9['attributes']=_['intersection'](_0x3ff2b6[_0x8a46('0x41')],qs[_0x8a46('0x47')](_0x2e09ea[_0x8a46('0x43')][_0x8a46('0x47')]));_0x1c12f9[_0x8a46('0x46')]=_0x1c12f9['attributes'][_0x8a46('0x48')]?_0x1c12f9[_0x8a46('0x46')]:_0x3ff2b6[_0x8a46('0x41')];if(_0x2e09ea[_0x8a46('0x43')][_0x8a46('0x55')]){_0x1c12f9[_0x8a46('0x56')]=[{'all':!![]}];}_0x1c12f9=_[_0x8a46('0x53')]({},_0x1c12f9,_0x2e09ea['options']);return db[_0x8a46('0x3f')][_0x8a46('0x5c')](_0x1c12f9)[_0x8a46('0x21')](handleEntityNotFound(_0x5ed16c,null))['then'](respondWithResult(_0x5ed16c,null))[_0x8a46('0x2a')](handleError(_0x5ed16c,null));};exports['create']=function(_0x504582,_0x526cc0){return db[_0x8a46('0x3f')]['create'](_0x504582[_0x8a46('0x5d')],{})[_0x8a46('0x21')](function(_0x16ea4d){var _0xa24b3e=_0x504582['user']['get']({'plain':!![]});if(!_0xa24b3e)throw new Error(_0x8a46('0x5e'));if(_0xa24b3e[_0x8a46('0x5f')]===_0x8a46('0x60')){var _0x59534c=_0x16ea4d[_0x8a46('0x38')]({'plain':!![]});var _0x4b9c88=_0x8a46('0x61');return db[_0x8a46('0x62')][_0x8a46('0x5c')]({'where':{'name':_0x4b9c88,'userProfileId':_0xa24b3e[_0x8a46('0x63')]},'raw':!![]})['then'](function(_0x48695e){if(_0x48695e&&_0x48695e[_0x8a46('0x64')]===0x0){return db[_0x8a46('0x39')][_0x8a46('0x65')]({'name':_0x59534c[_0x8a46('0x3b')],'resourceId':_0x59534c['id'],'type':_0x48695e[_0x8a46('0x3b')],'sectionId':_0x48695e['id']},{})['then'](function(){return _0x16ea4d;});}else{return _0x16ea4d;}})[_0x8a46('0x2a')](function(_0x46302c){logger[_0x8a46('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46302c);throw _0x46302c;});}return _0x16ea4d;})[_0x8a46('0x21')](respondWithResult(_0x526cc0,0xc9))['catch'](handleError(_0x526cc0,null));};exports[_0x8a46('0x36')]=function(_0xd5a1d8,_0x1cdca6){if(_0xd5a1d8[_0x8a46('0x5d')]['id']){delete _0xd5a1d8[_0x8a46('0x5d')]['id'];}return db[_0x8a46('0x3f')][_0x8a46('0x5c')]({'where':{'id':_0xd5a1d8[_0x8a46('0x5a')]['id']},'include':[{'model':db[_0x8a46('0x3e')],'as':_0x8a46('0x5b')}]})['then'](handleEntityNotFound(_0x1cdca6,null))['then'](saveUpdates(_0xd5a1d8[_0x8a46('0x5d')],null))['then'](respondWithResult(_0x1cdca6,null))[_0x8a46('0x2a')](handleError(_0x1cdca6,null));};exports[_0x8a46('0x37')]=function(_0x4d6603,_0x21d364){return db['ChatWebsite'][_0x8a46('0x5c')]({'where':{'id':_0x4d6603[_0x8a46('0x5a')]['id']}})[_0x8a46('0x21')](handleEntityNotFound(_0x21d364,null))[_0x8a46('0x21')](removeEntity(_0x21d364,null))[_0x8a46('0x2a')](handleError(_0x21d364,null));};exports[_0x8a46('0x66')]=function(_0x31caf3,_0x4295ee){return db['ChatWebsite'][_0x8a46('0x66')]()['then'](respondWithResult(_0x4295ee,null))['catch'](handleError(_0x4295ee,null));};exports[_0x8a46('0x67')]=function(_0x5edfde,_0x26d8e9,_0x22fb64){if(_0x5edfde[_0x8a46('0x5d')]['id']){delete _0x5edfde[_0x8a46('0x5d')]['id'];}return db[_0x8a46('0x3f')][_0x8a46('0x5c')]({'where':{'id':_0x5edfde[_0x8a46('0x5a')]['id']}})[_0x8a46('0x21')](handleEntityNotFound(_0x26d8e9,null))['then'](function(_0x4d2605){if(_0x4d2605){_0x5edfde[_0x8a46('0x5d')][_0x8a46('0x68')]=_0x4d2605['id'];return db['Disposition'][_0x8a46('0x65')](_0x5edfde['body']);}})[_0x8a46('0x21')](respondWithResult(_0x26d8e9,null))[_0x8a46('0x2a')](handleError(_0x26d8e9,null));};exports[_0x8a46('0x69')]=function(_0x4f657c,_0x70cbea,_0x3c7898){var _0x28e772={'raw':![],'where':{}};var _0x17c813={};var _0x57c4bd={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8a46('0x6a')]({'where':{'id':_0x4f657c['params']['id']}})['then'](handleEntityNotFound(_0x70cbea,null))[_0x8a46('0x21')](function(_0x135795){if(_0x135795){_0x17c813['model']=_[_0x8a46('0x42')](db[_0x8a46('0x6b')][_0x8a46('0x40')]);_0x17c813[_0x8a46('0x43')]=_[_0x8a46('0x42')](_0x4f657c[_0x8a46('0x43')]);_0x17c813[_0x8a46('0x44')]=_[_0x8a46('0x45')](_0x17c813[_0x8a46('0x41')],_0x17c813[_0x8a46('0x43')]);_0x28e772[_0x8a46('0x46')]=_[_0x8a46('0x45')](_0x17c813[_0x8a46('0x41')],qs[_0x8a46('0x47')](_0x4f657c[_0x8a46('0x43')][_0x8a46('0x47')]));_0x28e772[_0x8a46('0x46')]=_0x28e772[_0x8a46('0x46')][_0x8a46('0x48')]?_0x28e772[_0x8a46('0x46')]:_0x17c813['model'];if(!_0x4f657c[_0x8a46('0x43')][_0x8a46('0x6c')](_0x8a46('0x49'))){_0x28e772[_0x8a46('0x31')]=qs['limit'](_0x4f657c[_0x8a46('0x43')][_0x8a46('0x31')]);_0x28e772[_0x8a46('0x30')]=qs['offset'](_0x4f657c['query'][_0x8a46('0x30')]);}_0x28e772[_0x8a46('0x4a')]=qs['sort'](_0x4f657c[_0x8a46('0x43')][_0x8a46('0x6d')]);_0x28e772['where']=qs[_0x8a46('0x44')](_[_0x8a46('0x4c')](_0x4f657c[_0x8a46('0x43')],_0x17c813[_0x8a46('0x44')]));_0x28e772['where']['ChatWebsiteId']=_0x135795['id'];if(_0x4f657c[_0x8a46('0x43')][_0x8a46('0x4d')]){_0x28e772[_0x8a46('0x4b')]=_[_0x8a46('0x53')](_0x28e772['where'],{'$or':_[_0x8a46('0x4e')](_0x28e772[_0x8a46('0x46')],function(_0x47350b){var _0x3463f0={};_0x3463f0[_0x47350b]={'$like':'%'+_0x4f657c[_0x8a46('0x43')][_0x8a46('0x4d')]+'%'};return _0x3463f0;})});}_0x28e772=_[_0x8a46('0x53')]({},_0x28e772,_0x4f657c['options']);return db[_0x8a46('0x6b')][_0x8a46('0x2f')]({'where':_0x28e772[_0x8a46('0x4b')]})['then'](function(_0x2ce0ed){_0x57c4bd[_0x8a46('0x2f')]=_0x2ce0ed;if(_0x4f657c['query'][_0x8a46('0x55')]){_0x28e772[_0x8a46('0x56')]=[{'all':!![]}];}return db['Disposition'][_0x8a46('0x57')](_0x28e772);})[_0x8a46('0x21')](function(_0x270f7a){_0x57c4bd[_0x8a46('0x58')]=_0x270f7a;return _0x57c4bd;});}})[_0x8a46('0x21')](respondWithFilteredResult(_0x70cbea,_0x28e772))[_0x8a46('0x2a')](handleError(_0x70cbea,null));};exports[_0x8a46('0x6e')]=function(_0x2e2f23,_0x3ab01b,_0x341060){return db[_0x8a46('0x3f')][_0x8a46('0x5c')]({'where':{'id':_0x2e2f23['params']['id']}})[_0x8a46('0x21')](handleEntityNotFound(_0x3ab01b,null))[_0x8a46('0x21')](function(_0x331383){if(_0x331383){return _0x331383[_0x8a46('0x6e')](_0x2e2f23[_0x8a46('0x43')][_0x8a46('0x6f')]);}})[_0x8a46('0x21')](respondWithStatusCode(_0x3ab01b,null))[_0x8a46('0x2a')](handleError(_0x3ab01b,null));};exports[_0x8a46('0x70')]=function(_0x28d847,_0x54af4e,_0x526e46){if(_0x28d847[_0x8a46('0x5d')]['id']){delete _0x28d847[_0x8a46('0x5d')]['id'];}return db[_0x8a46('0x3f')][_0x8a46('0x5c')]({'where':{'id':_0x28d847[_0x8a46('0x5a')]['id']}})[_0x8a46('0x21')](handleEntityNotFound(_0x54af4e,null))[_0x8a46('0x21')](function(_0x34e872){if(_0x34e872){_0x28d847[_0x8a46('0x5d')][_0x8a46('0x68')]=_0x34e872['id'];return db['CannedAnswer']['create'](_0x28d847[_0x8a46('0x5d')]);}})[_0x8a46('0x21')](respondWithResult(_0x54af4e,null))[_0x8a46('0x2a')](handleError(_0x54af4e,null));};exports['getAnswers']=function(_0x56f7f8,_0x255085,_0x204d4c){var _0x49860e={'raw':![],'where':{}};var _0x1dc1b1={};var _0x519da0={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8a46('0x6a')]({'where':{'id':_0x56f7f8[_0x8a46('0x5a')]['id']}})['then'](handleEntityNotFound(_0x255085,null))[_0x8a46('0x21')](function(_0x5cd455){if(_0x5cd455){_0x1dc1b1[_0x8a46('0x41')]=_[_0x8a46('0x42')](db[_0x8a46('0x71')][_0x8a46('0x40')]);_0x1dc1b1[_0x8a46('0x43')]=_[_0x8a46('0x42')](_0x56f7f8[_0x8a46('0x43')]);_0x1dc1b1['filters']=_[_0x8a46('0x45')](_0x1dc1b1['model'],_0x1dc1b1[_0x8a46('0x43')]);_0x49860e[_0x8a46('0x46')]=_[_0x8a46('0x45')](_0x1dc1b1[_0x8a46('0x41')],qs['fields'](_0x56f7f8[_0x8a46('0x43')][_0x8a46('0x47')]));_0x49860e[_0x8a46('0x46')]=_0x49860e[_0x8a46('0x46')][_0x8a46('0x48')]?_0x49860e['attributes']:_0x1dc1b1[_0x8a46('0x41')];if(!_0x56f7f8[_0x8a46('0x43')][_0x8a46('0x6c')](_0x8a46('0x49'))){_0x49860e[_0x8a46('0x31')]=qs[_0x8a46('0x31')](_0x56f7f8['query']['limit']);_0x49860e['offset']=qs[_0x8a46('0x30')](_0x56f7f8[_0x8a46('0x43')][_0x8a46('0x30')]);}_0x49860e[_0x8a46('0x4a')]=qs[_0x8a46('0x6d')](_0x56f7f8[_0x8a46('0x43')][_0x8a46('0x6d')]);_0x49860e['where']=qs[_0x8a46('0x44')](_[_0x8a46('0x4c')](_0x56f7f8[_0x8a46('0x43')],_0x1dc1b1[_0x8a46('0x44')]));_0x49860e[_0x8a46('0x4b')][_0x8a46('0x68')]=_0x5cd455['id'];if(_0x56f7f8['query'][_0x8a46('0x4d')]){_0x49860e['where']=_[_0x8a46('0x53')](_0x49860e[_0x8a46('0x4b')],{'$or':_['map'](_0x49860e[_0x8a46('0x46')],function(_0x12cd96){var _0x2b9acb={};_0x2b9acb[_0x12cd96]={'$like':'%'+_0x56f7f8[_0x8a46('0x43')]['filter']+'%'};return _0x2b9acb;})});}_0x49860e=_['merge']({},_0x49860e,_0x56f7f8[_0x8a46('0x54')]);return db[_0x8a46('0x71')]['count']({'where':_0x49860e['where']})[_0x8a46('0x21')](function(_0x4284c9){_0x519da0[_0x8a46('0x2f')]=_0x4284c9;if(_0x56f7f8['query'][_0x8a46('0x55')]){_0x49860e['include']=[{'all':!![]}];}return db[_0x8a46('0x71')][_0x8a46('0x57')](_0x49860e);})[_0x8a46('0x21')](function(_0x1c197e){_0x519da0[_0x8a46('0x58')]=_0x1c197e;return _0x519da0;});}})[_0x8a46('0x21')](respondWithFilteredResult(_0x255085,_0x49860e))[_0x8a46('0x2a')](handleError(_0x255085,null));};exports['removeAnswers']=function(_0x302f62,_0x51d736,_0x592048){return db[_0x8a46('0x3f')][_0x8a46('0x5c')]({'where':{'id':_0x302f62[_0x8a46('0x5a')]['id']}})[_0x8a46('0x21')](handleEntityNotFound(_0x51d736,null))[_0x8a46('0x21')](function(_0x15305c){if(_0x15305c){return _0x15305c[_0x8a46('0x72')](_0x302f62[_0x8a46('0x43')]['ids']);}})[_0x8a46('0x21')](respondWithStatusCode(_0x51d736,null))[_0x8a46('0x2a')](handleError(_0x51d736,null));};exports[_0x8a46('0x73')]=function(_0x5d4caa,_0x40bb71,_0xd67116){_0x5d4caa[_0x8a46('0x5d')][_0x8a46('0x74')]=_0x5d4caa[_0x8a46('0x75')]['filename'];return db[_0x8a46('0x3f')][_0x8a46('0x5c')]({'where':{'id':_0x5d4caa[_0x8a46('0x5a')]['id']}})[_0x8a46('0x21')](handleEntityNotFound(_0x40bb71,null))['then'](saveUpdates(_0x5d4caa[_0x8a46('0x5d')],null))[_0x8a46('0x21')](respondWithResult(_0x40bb71,null))['catch'](handleError(_0x40bb71,null));};exports[_0x8a46('0x76')]=function(_0x189fad,_0x417de0,_0x28e5f4){_0x189fad['body'][_0x8a46('0x77')]=_0x189fad[_0x8a46('0x75')][_0x8a46('0x78')];return db[_0x8a46('0x3f')][_0x8a46('0x5c')]({'where':{'id':_0x189fad[_0x8a46('0x5a')]['id']}})[_0x8a46('0x21')](handleEntityNotFound(_0x417de0,null))[_0x8a46('0x21')](saveUpdates(_0x189fad[_0x8a46('0x5d')],null))['then'](respondWithResult(_0x417de0,null))['catch'](handleError(_0x417de0,null));};exports[_0x8a46('0x79')]=function(_0x5b3665,_0x1ace22,_0x11ab57){_0x5b3665[_0x8a46('0x5d')][_0x8a46('0x7a')]=_0x5b3665['file'][_0x8a46('0x78')];return db[_0x8a46('0x3f')][_0x8a46('0x5c')]({'where':{'id':_0x5b3665[_0x8a46('0x5a')]['id']}})[_0x8a46('0x21')](handleEntityNotFound(_0x1ace22,null))[_0x8a46('0x21')](saveUpdates(_0x5b3665['body'],null))['then'](respondWithResult(_0x1ace22,null))[_0x8a46('0x2a')](handleError(_0x1ace22,null));};exports[_0x8a46('0x7b')]=function(_0x517690,_0x46c9e8,_0x370a9b){_0x517690[_0x8a46('0x5d')][_0x8a46('0x7c')]=_0x517690[_0x8a46('0x75')]['filename'];return db['ChatWebsite'][_0x8a46('0x5c')]({'where':{'id':_0x517690[_0x8a46('0x5a')]['id']}})[_0x8a46('0x21')](handleEntityNotFound(_0x46c9e8,null))[_0x8a46('0x21')](saveUpdates(_0x517690['body'],null))[_0x8a46('0x21')](respondWithResult(_0x46c9e8,null))[_0x8a46('0x2a')](handleError(_0x46c9e8,null));};exports['getLogo']=function(_0x3a9450,_0x4da5ea,_0x4b5684){var _0x408d14=path[_0x8a46('0x7d')](config[_0x8a46('0x7e')],_0x8a46('0x7f'));var _0x2dc1fe={'where':{'id':_0x3a9450[_0x8a46('0x5a')]['id']},'attributes':['id',_0x8a46('0x74')],'raw':!![]};var _0x21154b=![];return require(_0x8a46('0x80'))['getLicense']()['then'](function(_0x18be3d){if(_0x18be3d){_0x21154b=_0x18be3d[_0x8a46('0x81')];}})['then'](function(){return db[_0x8a46('0x3f')]['find'](_0x2dc1fe);})[_0x8a46('0x21')](handleEntityNotFound(_0x4da5ea,null))[_0x8a46('0x21')](function(_0x552a11){if(_0x552a11){if(!_[_0x8a46('0x82')](_0x552a11[_0x8a46('0x74')])){if(fs['existsSync'](path[_0x8a46('0x7d')](config[_0x8a46('0x7e')],'server/files/images/logos/',_0x552a11[_0x8a46('0x74')]))&&_0x21154b){_0x408d14=path[_0x8a46('0x7d')](config[_0x8a46('0x7e')],_0x8a46('0x83'),_0x552a11['sitepic']);}}return _0x4da5ea[_0x8a46('0x84')](_0x408d14);}})[_0x8a46('0x2a')](handleError(_0x4da5ea,null));};exports[_0x8a46('0x85')]=function(_0x331675,_0x31afa5,_0x1f30e4){var _0x7474fb=path[_0x8a46('0x7d')](config[_0x8a46('0x7e')],'server/files/images/avatars/default_avatar.png');var _0x58eda5={'where':{'id':_0x331675['params']['id']},'attributes':['id',_0x8a46('0x77')],'raw':!![]};return db[_0x8a46('0x3f')][_0x8a46('0x5c')](_0x58eda5)[_0x8a46('0x21')](handleEntityNotFound(_0x31afa5,null))[_0x8a46('0x21')](function(_0xda1b0f){if(_0xda1b0f){if(!_['isNil'](_0xda1b0f[_0x8a46('0x77')])){if(fs['existsSync'](path[_0x8a46('0x7d')](config[_0x8a46('0x7e')],_0x8a46('0x86'),_0xda1b0f['agentAvatar']))){_0x7474fb=path['join'](config[_0x8a46('0x7e')],_0x8a46('0x86'),_0xda1b0f[_0x8a46('0x77')]);}}return _0x31afa5[_0x8a46('0x84')](_0x7474fb);}})[_0x8a46('0x2a')](handleError(_0x31afa5,null));};exports[_0x8a46('0x87')]=function(_0x13b61f,_0x35b826,_0x2e11de){var _0x1d2291=path[_0x8a46('0x7d')](config[_0x8a46('0x7e')],_0x8a46('0x88'));var _0x524a40={'where':{'id':_0x13b61f['params']['id']},'attributes':['id',_0x8a46('0x7a'),_0x8a46('0x89')],'raw':!![]};return db['ChatWebsite'][_0x8a46('0x5c')](_0x524a40)[_0x8a46('0x21')](handleEntityNotFound(_0x35b826,null))[_0x8a46('0x21')](function(_0x2260c8){if(_0x2260c8){if(!_[_0x8a46('0x82')](_0x2260c8['customerAvatar'])){if(fs['existsSync'](path[_0x8a46('0x7d')](config['root'],_0x8a46('0x86'),_0x2260c8[_0x8a46('0x7a')]))&&_0x2260c8['showCustomerAvatar']){_0x1d2291=path[_0x8a46('0x7d')](config[_0x8a46('0x7e')],_0x8a46('0x86'),_0x2260c8[_0x8a46('0x7a')]);}}return _0x35b826[_0x8a46('0x84')](_0x1d2291);}})[_0x8a46('0x2a')](handleError(_0x35b826,null));};exports['getSystemAvatar']=function(_0x341294,_0x2d1286,_0x4cf561){var _0x5b6a40=path['join'](config[_0x8a46('0x7e')],_0x8a46('0x8a'));var _0x1c6bb5={'where':{'id':_0x341294[_0x8a46('0x5a')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0x8a46('0x5c')](_0x1c6bb5)[_0x8a46('0x21')](handleEntityNotFound(_0x2d1286,null))[_0x8a46('0x21')](function(_0x2cd39b){if(_0x2cd39b){if(!_[_0x8a46('0x82')](_0x2cd39b[_0x8a46('0x7c')])){if(fs[_0x8a46('0x8b')](path[_0x8a46('0x7d')](config[_0x8a46('0x7e')],_0x8a46('0x86'),_0x2cd39b[_0x8a46('0x7c')]))){_0x5b6a40=path[_0x8a46('0x7d')](config['root'],_0x8a46('0x86'),_0x2cd39b['systemAvatar']);}}return _0x2d1286[_0x8a46('0x84')](_0x5b6a40);}})['catch'](handleError(_0x2d1286,null));};exports['notify']=function(_0x3d0f5f,_0x3197e2,_0x1af1b9){var _0x2f7c98=require(_0x8a46('0x8c'));var _0x236ab8=new _0x2f7c98();var _0x10eb26=_0x236ab8[_0x8a46('0x8d')](_0x3d0f5f[_0x8a46('0x8e')][_0x8a46('0x8f')])[_0x8a46('0x90')]();var _0x2ab5fc={'body':_0x3d0f5f['body'],'channel':_0x8a46('0x91')};var _0x53f742=[];var _0x2d56c2=[];var _0x879fe3={};var _0x423c1a=![];return db[_0x8a46('0x92')][_0x8a46('0x66')]()['then'](function(_0x192585){if(!_0x192585){throw new db['Sequelize'][(_0x8a46('0x93'))](_0x8a46('0x94'));}_0x53f742=_[_0x8a46('0x95')](_[_0x8a46('0x42')](_0x192585),['createdAt',_0x8a46('0x96')]);_0x2d56c2=_[_0x8a46('0x95')](_[_0x8a46('0x42')](_0x192585),['createdAt',_0x8a46('0x96'),_0x8a46('0x97'),_0x8a46('0x98')]);if(_0x3d0f5f[_0x8a46('0x5d')]['id']){delete _0x3d0f5f[_0x8a46('0x5d')]['id'];}if(_[_0x8a46('0x82')](_0x3d0f5f[_0x8a46('0x5d')][_0x8a46('0x99')])){throw new db[(_0x8a46('0x9a'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x8a46('0x82')](_0x3d0f5f[_0x8a46('0x5d')][_0x8a46('0x5d')])||_0x3d0f5f[_0x8a46('0x5d')][_0x8a46('0x5d')]===''){throw new db[(_0x8a46('0x9a'))][(_0x8a46('0x93'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8a46('0x82')](_0x3d0f5f[_0x8a46('0x5d')][_0x8a46('0x9b')])){throw new db[(_0x8a46('0x9a'))][(_0x8a46('0x93'))](_0x8a46('0x9c')+_0x2d56c2);}if(!_[_0x8a46('0x9d')](_0x2d56c2,_0x3d0f5f[_0x8a46('0x5d')]['mapKey'])){throw new db[(_0x8a46('0x9a'))][(_0x8a46('0x93'))](_0x8a46('0x9e')+_0x2d56c2);}_0x879fe3[_0x3d0f5f[_0x8a46('0x5d')]['mapKey']]=_0x3d0f5f[_0x8a46('0x5d')]['from'];})[_0x8a46('0x21')](function(){return db[_0x8a46('0x3f')][_0x8a46('0x5c')]({'where':{'id':_0x3d0f5f[_0x8a46('0x5a')]['id']},'include':[{'model':db[_0x8a46('0x9f')],'as':'List','include':[{'model':db['CmContact'],'as':_0x8a46('0xa0'),'where':_0x879fe3,'limit':0x1,'order':[[_0x8a46('0x96'),_0x8a46('0xa1')]]}]},{'model':db[_0x8a46('0xa2')],'as':_0x8a46('0xa3')}]});})[_0x8a46('0x21')](handleEntityNotFound(_0x3197e2,null))[_0x8a46('0x21')](function(_0x353730){if(_0x353730&&_0x353730[_0x8a46('0xa4')]){_0x2ab5fc[_0x8a46('0xa5')]=_0x353730;_0x2ab5fc[_0x8a46('0xa6')]=_0x353730['Applications'];_0x2ab5fc[_0x8a46('0xa7')]=_0x353730[_0x8a46('0xa4')];_0x2ab5fc[_0x8a46('0xa6')]=_[_0x8a46('0xa8')](_0x2ab5fc[_0x8a46('0xa6')],['priority'],[_0x8a46('0xa9')]);if(_0x2ab5fc[_0x8a46('0xa5')][_0x8a46('0xa3')]){delete _0x2ab5fc[_0x8a46('0xa5')][_0x8a46('0xa3')];}if(_0x2ab5fc[_0x8a46('0xa5')][_0x8a46('0xa4')]&&_0x2ab5fc[_0x8a46('0xa5')][_0x8a46('0xa4')][_0x8a46('0xa0')][_0x8a46('0x48')]){return _0x2ab5fc[_0x8a46('0xa5')][_0x8a46('0xa4')][_0x8a46('0xa0')][0x0];}var _0x271f7b=_[_0x8a46('0xaa')](_0x3d0f5f[_0x8a46('0x5d')],{'firstName':_0x3d0f5f[_0x8a46('0x5d')][_0x8a46('0x99')],'ListId':_0x353730['ListId']});_0x271f7b[_0x3d0f5f[_0x8a46('0x5d')][_0x8a46('0x9b')]]=_0x3d0f5f[_0x8a46('0x5d')][_0x8a46('0x99')];return db[_0x8a46('0x92')]['create'](_0x271f7b,{'fields':_0x53f742,'raw':!![]});}})['then'](handleEntityNotFound(_0x3197e2,null))[_0x8a46('0x21')](function(_0x2fb90c){_0x2ab5fc[_0x8a46('0xab')]=_0x2fb90c;if(_0x2fb90c){var _0xbf8f59={'ContactId':_0x2fb90c['id'],'ChatWebsiteId':_0x3d0f5f['params']['id'],'from':(_0x2fb90c[_0x8a46('0xac')]||'')+'\x20'+(_0x2fb90c[_0x8a46('0xad')]||''),'customerIp':_0x3d0f5f[_0x8a46('0x5d')][_0x8a46('0xae')],'referer':_0x3d0f5f[_0x8a46('0x5d')][_0x8a46('0xaf')],'browserName':_0x10eb26[_0x8a46('0xb0')][_0x8a46('0x3b')]&&_0x10eb26[_0x8a46('0xb0')][_0x8a46('0xb1')]?util[_0x8a46('0xb2')](_0x8a46('0xb3'),_0x10eb26[_0x8a46('0xb0')][_0x8a46('0x3b')],_0x10eb26['browser'][_0x8a46('0xb1')]):_0x8a46('0xb4'),'browserVersion':_0x10eb26['browser'][_0x8a46('0xb1')]||_0x8a46('0xb4'),'osName':util[_0x8a46('0xb2')](_0x8a46('0xb3'),_0x10eb26['os'][_0x8a46('0x3b')],_0x10eb26['os'][_0x8a46('0xb1')]),'osVersion':_0x10eb26['os'][_0x8a46('0xb1')],'deviceModel':_0x10eb26[_0x8a46('0xb5')][_0x8a46('0x41')]&&_0x10eb26['device'][_0x8a46('0xb6')]?util[_0x8a46('0xb2')](_0x8a46('0xb7'),_0x10eb26[_0x8a46('0xb5')]['model'],_0x10eb26[_0x8a46('0xb5')][_0x8a46('0xb6')],_0x10eb26['device'][_0x8a46('0x4f')]):null,'deviceVendor':_0x10eb26[_0x8a46('0xb5')][_0x8a46('0xb6')],'deviceType':_0x10eb26[_0x8a46('0xb5')][_0x8a46('0x4f')],'formData':JSON[_0x8a46('0xb8')](_0x3d0f5f['body'])};var _0x24d26c={'ChatWebsiteId':_0x3d0f5f[_0x8a46('0x5a')]['id'],'closed':![]};if(_0x3d0f5f[_0x8a46('0x5d')][_0x8a46('0xb9')]){_0x24d26c['threadId']=_0x3d0f5f['body'][_0x8a46('0xb9')];return db['ChatInteraction'][_0x8a46('0x5c')]({'where':_0x24d26c})[_0x8a46('0x21')](function(_0x3b164d){if(_0x3b164d){return[_0x3b164d,![]];}_0xbf8f59[_0x8a46('0xb9')]=_0x3d0f5f['body'][_0x8a46('0xb9')];_0xbf8f59[_0x8a46('0xba')]=_0x3d0f5f['body']['externalUrl'];return db[_0x8a46('0xbb')]['create'](_0xbf8f59)['then'](function(_0x188fdb){return[_0x188fdb,!![]];});});}_0x24d26c[_0x8a46('0xbc')]=_0x2fb90c['id'];if(_0x3d0f5f[_0x8a46('0x5d')][_0x8a46('0xbd')]&&_0x3d0f5f[_0x8a46('0x5d')][_0x8a46('0xbd')]['id']){_0x24d26c['id']=_0x3d0f5f['body'][_0x8a46('0xbd')]['id'];return db['ChatInteraction'][_0x8a46('0x5c')]({'where':_0x24d26c})[_0x8a46('0x21')](function(_0x4a341d){if(_0x4a341d){return[_0x4a341d,![]];}return db['ChatInteraction'][_0x8a46('0x65')](_0xbf8f59)[_0x8a46('0x21')](function(_0x4440b0){return[_0x4440b0,!![]];});});}return db[_0x8a46('0xbb')]['create'](_0xbf8f59)[_0x8a46('0x21')](function(_0x88822a){return[_0x88822a,!![]];});}})['spread'](function(_0x1d355c,_0x541f12){if(_0x1d355c){_0x423c1a=_0x541f12;if(!_0x541f12){var _0x294f06={'from':(_0x2ab5fc['contact']['firstName']||'')+'\x20'+(_0x2ab5fc['contact'][_0x8a46('0xad')]||'')};if(_0x3d0f5f[_0x8a46('0x5d')][_0x8a46('0xb9')]&&_0x3d0f5f[_0x8a46('0x5d')][_0x8a46('0xbe')]&&_0x3d0f5f[_0x8a46('0x5d')][_0x8a46('0xb9')]!=_0x3d0f5f[_0x8a46('0x5d')][_0x8a46('0xbe')]){_0x294f06['threadId']=_0x3d0f5f['body']['messageId'];}return _0x1d355c[_0x8a46('0x36')](_0x294f06);}else{return _0x1d355c;}}})[_0x8a46('0x21')](function(_0x34642d){_0x2ab5fc[_0x8a46('0xbd')]=_0x34642d[_0x8a46('0x38')]({'plain':!![]});_0x2ab5fc[_0x8a46('0xbd')][_0x8a46('0xbf')]=_0x423c1a;if(_0x2ab5fc[_0x8a46('0xbd')][_0x8a46('0xbf')]){if(_0x2ab5fc[_0x8a46('0xa5')][_0x8a46('0xc0')]){_0x2ab5fc[_0x8a46('0xa6')][_0x8a46('0xc1')]({'id':0x0,'priority':_0x2ab5fc[_0x8a46('0xa6')][_0x8a46('0x48')]+0x1,'app':_0x8a46('0xc2'),'appdata':_0x8a46('0xc3'),'interval':_0x8a46('0xc4')});}}return db[_0x8a46('0xc5')][_0x8a46('0x65')]({'body':_0x3d0f5f[_0x8a46('0x5d')][_0x8a46('0x5d')],'ChatWebsiteId':_0x3d0f5f[_0x8a46('0x5a')]['id'],'ChatInteractionId':_0x34642d['id'],'direction':'in','ContactId':_0x2ab5fc[_0x8a46('0xab')]['id'],'AttachmentId':_0x3d0f5f[_0x8a46('0x5d')][_0x8a46('0xc6')]});})[_0x8a46('0x21')](function(_0x4e2785){_0x2ab5fc['message']=_0x4e2785;if(_0x2ab5fc[_0x8a46('0xbd')][_0x8a46('0xc7')]){return db[_0x8a46('0xc8')][_0x8a46('0x5c')]({'attributes':['id','name'],'where':{'id':_0x2ab5fc[_0x8a46('0xbd')]['UserId']}})[_0x8a46('0x21')](function(_0xaa2c49){if(_0xaa2c49){_0x2ab5fc['applications'][_0x8a46('0xc9')]({'id':0x0,'priority':0x0,'app':_0x8a46('0xca'),'appdata':_0xaa2c49[_0x8a46('0x3b')]+','+(_0x2ab5fc[_0x8a46('0xa5')]['waitForTheAssignedAgent']||0xa),'interval':_0x8a46('0xc4')});_0x2ab5fc[_0x8a46('0xcb')]=!![];}return respondWithRpcPromise(_0x8a46('0xcc'),_0x8a46('0xcd'),_0x2ab5fc);});}return respondWithRpcPromise(_0x8a46('0xcc'),_0x8a46('0xcd'),_0x2ab5fc);})[_0x8a46('0x21')](function(_0x20de3c){respondWithRpcPromise(_0x8a46('0xce'),'EventManager',{'event':_0x8a46('0xcf'),'message':_0x20de3c},client9002);return _0x20de3c;})[_0x8a46('0x21')](respondWithResult(_0x3197e2,null))['catch'](handleError(_0x3197e2,null));};exports[_0x8a46('0xd0')]=function(_0x3a6c4c,_0x5462a0,_0x478627){var _0x186a4c,_0x2876cf,_0x38e75f;var _0x295c77=[];var _0x4b7c26=[];var _0x5557d4={};return db[_0x8a46('0x92')][_0x8a46('0x66')]()[_0x8a46('0x21')](function(_0x294937){if(!_0x294937){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x4b7c26=_[_0x8a46('0x95')](_['keys'](_0x294937),['createdAt',_0x8a46('0x96')]);_0x295c77=_[_0x8a46('0x95')](_[_0x8a46('0x42')](_0x294937),[_0x8a46('0xd1'),'updatedAt','CompanyId',_0x8a46('0x98')]);if(_0x3a6c4c[_0x8a46('0x5d')]['id']){delete _0x3a6c4c[_0x8a46('0x5d')]['id'];}if(_['isNil'](_0x3a6c4c[_0x8a46('0x5d')][_0x8a46('0x99')])){throw _0x5462a0[_0x8a46('0x2d')](0x1f4)[_0x8a46('0x3c')](new db[(_0x8a46('0x9a'))][(_0x8a46('0x93'))](_0x8a46('0xd2')));}if(_['isNil'](_0x3a6c4c['body'][_0x8a46('0x5d')])||_0x3a6c4c[_0x8a46('0x5d')][_0x8a46('0x5d')]===''){throw _0x5462a0[_0x8a46('0x2d')](0x1f4)[_0x8a46('0x3c')](new db[(_0x8a46('0x9a'))][(_0x8a46('0x93'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x8a46('0x82')](_0x3a6c4c[_0x8a46('0x5d')]['mapKeyOffline'])){throw _0x5462a0[_0x8a46('0x2d')](0x1f4)['send'](new db['Sequelize'][(_0x8a46('0x93'))](_0x8a46('0xd3')+_0x295c77));}if(!_[_0x8a46('0x9d')](_0x295c77,_0x3a6c4c[_0x8a46('0x5d')]['mapKeyOffline'])){throw _0x5462a0[_0x8a46('0x2d')](0x1f4)['send'](new db['Sequelize'][(_0x8a46('0x93'))](_0x8a46('0xd4')+_0x295c77));}_0x5557d4[_0x3a6c4c[_0x8a46('0x5d')][_0x8a46('0xd5')]]=_0x3a6c4c['body']['from'];})[_0x8a46('0x21')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x3a6c4c[_0x8a46('0x5a')]['id']},'include':[{'model':db[_0x8a46('0x9f')],'as':_0x8a46('0xa4')}]});})[_0x8a46('0x21')](handleEntityNotFound(_0x5462a0,null))[_0x8a46('0x21')](function(_0x397ae8){if(_0x397ae8&&_0x397ae8[_0x8a46('0xa4')]){_0x2876cf=_0x397ae8;var _0x2a9bc6=_['defaults'](_0x3a6c4c[_0x8a46('0x5d')],{'firstName':_0x3a6c4c[_0x8a46('0x5d')][_0x8a46('0x99')],'phone':_0x3a6c4c['body'][_0x8a46('0x99')],'ListId':_0x397ae8['ListId']});_0x2a9bc6[_0x3a6c4c['body'][_0x8a46('0xd5')]]=_0x3a6c4c[_0x8a46('0x5d')][_0x8a46('0x99')];return db[_0x8a46('0x92')][_0x8a46('0xd6')]({'where':_0x5557d4,'defaults':_0x2a9bc6});}})['spread'](function(_0x28c229){if(_0x28c229){_0x38e75f=_0x28c229;var _0x216a79=fs[_0x8a46('0xd7')](path['join'](config[_0x8a46('0x7e')],_0x8a46('0xd8')),_0x8a46('0xd9'));var _0x498eec=ejs['render'](_0x216a79,{'body':_[_0x8a46('0xda')](_0x3a6c4c[_0x8a46('0x5d')][_0x8a46('0x5d')]),'bodyTitle':_0x2876cf['offlineMessageBody']});return db['ChatOfflineMessage'][_0x8a46('0x65')]({'body':_0x498eec,'ContactId':_0x28c229['id'],'ChatWebsiteId':_0x2876cf['id']});}})[_0x8a46('0x21')](function(_0x317f18){if(_0x317f18){_0x186a4c=_0x317f18;return db[_0x8a46('0xdb')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x8a46('0xdc')],'as':_0x8a46('0xdd'),'raw':!![]}]});}})[_0x8a46('0x21')](function(_0x196c09){if(_0x196c09&&_0x196c09[_0x8a46('0xdd')]&&_0x2876cf['forwardOfflineAddress']){var _0x44648a={'tls':{'rejectUnauthorized':![]}};if(_0x196c09[_0x8a46('0xdd')][_0x8a46('0xde')]){_0x44648a[_0x8a46('0xde')]=_0x196c09['Smtp'][_0x8a46('0xde')];}else{_0x44648a[_0x8a46('0xdf')]=_0x196c09['Smtp'][_0x8a46('0xdf')];_0x44648a[_0x8a46('0xe0')]=_0x196c09[_0x8a46('0xdd')]['port'];_0x44648a[_0x8a46('0xe1')]=_0x196c09[_0x8a46('0xdd')][_0x8a46('0xe1')];}if(_0x196c09[_0x8a46('0xdd')]['authentication']){_0x44648a[_0x8a46('0xe2')]={'user':_0x196c09[_0x8a46('0xdd')][_0x8a46('0x60')],'pass':_0x196c09[_0x8a46('0xdd')][_0x8a46('0xe3')]};}return respondWithRpcPromise(_0x8a46('0xe4'),_0x8a46('0xe5'),{'account':_0x44648a,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x196c09[_0x8a46('0x3b')],_0x196c09[_0x8a46('0xe6')]||_0x196c09[_0x8a46('0xdd')][_0x8a46('0x60')]),'to':_0x2876cf['forwardOfflineAddress'],'subject':_0x2876cf['offlineMessageSubject'],'text':_0x186a4c[_0x8a46('0x5d')]}},client9003)[_0x8a46('0x21')](function(){return _0x186a4c;})['catch'](function(_0x3df56a){console[_0x8a46('0x25')](_0x3df56a);});}})[_0x8a46('0x21')](function(){if(_0x186a4c){return _0x186a4c;}})[_0x8a46('0x21')](respondWithResult(_0x5462a0,null))['catch'](handleError(_0x5462a0,null));};exports[_0x8a46('0xe7')]=function(_0x29b639,_0x1ba24d,_0x3e0e09){return db[_0x8a46('0xbb')][_0x8a46('0x5c')]({'where':{'id':_0x29b639[_0x8a46('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1ba24d,null))[_0x8a46('0x21')](function(_0x594adc){if(_0x594adc){return _0x594adc[_0x8a46('0xe7')](_0x29b639[_0x8a46('0x5d')][_0x8a46('0x6f')],_['omit'](_0x29b639[_0x8a46('0x5d')],[_0x8a46('0x6f'),'id'])||{});}})['then'](respondWithResult(_0x1ba24d,null))[_0x8a46('0x2a')](handleError(_0x1ba24d,null));};exports[_0x8a46('0xe8')]=function(_0x15312b,_0x7c19f9,_0x420e2f){var _0x3a5443={'raw':![],'where':{}};var _0xa450b0={};var _0x2f88cd={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8a46('0x6a')]({'where':{'id':_0x15312b[_0x8a46('0x5a')]['id']}})['then'](handleEntityNotFound(_0x7c19f9,null))[_0x8a46('0x21')](function(_0x38860b){if(_0x38860b){_0xa450b0[_0x8a46('0x41')]=_[_0x8a46('0x42')](db[_0x8a46('0xbb')][_0x8a46('0x40')]);_0xa450b0[_0x8a46('0x43')]=_['keys'](_0x15312b[_0x8a46('0x43')]);_0xa450b0[_0x8a46('0x44')]=_[_0x8a46('0x45')](_0xa450b0[_0x8a46('0x41')],_0xa450b0[_0x8a46('0x43')]);_0x3a5443[_0x8a46('0x46')]=_[_0x8a46('0x45')](_0xa450b0[_0x8a46('0x41')],qs['fields'](_0x15312b[_0x8a46('0x43')][_0x8a46('0x47')]));_0x3a5443[_0x8a46('0x46')]=_0x3a5443[_0x8a46('0x46')][_0x8a46('0x48')]?_0x3a5443['attributes']:_0xa450b0['model'];if(!_0x15312b[_0x8a46('0x43')]['hasOwnProperty'](_0x8a46('0x49'))){_0x3a5443[_0x8a46('0x31')]=qs[_0x8a46('0x31')](_0x15312b['query'][_0x8a46('0x31')]);_0x3a5443[_0x8a46('0x30')]=qs[_0x8a46('0x30')](_0x15312b[_0x8a46('0x43')][_0x8a46('0x30')]);}_0x3a5443[_0x8a46('0x4a')]=qs[_0x8a46('0x6d')](_0x15312b['query'][_0x8a46('0x6d')]);_0x3a5443[_0x8a46('0x4b')]=qs[_0x8a46('0x44')](_['pick'](_0x15312b[_0x8a46('0x43')],_0xa450b0[_0x8a46('0x44')]));_0x3a5443[_0x8a46('0x4b')][_0x8a46('0x68')]=_0x38860b['id'];if(_0x15312b[_0x8a46('0x43')]['filter']){_0x3a5443[_0x8a46('0x4b')]=_[_0x8a46('0x53')](_0x3a5443['where'],{'$or':_[_0x8a46('0x4e')](_0x3a5443[_0x8a46('0x46')],function(_0x2941ce){var _0x1a45d3={};_0x1a45d3[_0x2941ce]={'$like':'%'+_0x15312b[_0x8a46('0x43')]['filter']+'%'};return _0x1a45d3;})});}_0x3a5443=_[_0x8a46('0x53')]({},_0x3a5443,_0x15312b[_0x8a46('0x54')]);return db[_0x8a46('0xbb')]['count']({'where':_0x3a5443['where']})[_0x8a46('0x21')](function(_0x4dcde8){_0x2f88cd['count']=_0x4dcde8;if(_0x15312b[_0x8a46('0x43')][_0x8a46('0x55')]){_0x3a5443[_0x8a46('0x56')]=[{'model':db[_0x8a46('0x92')],'as':_0x8a46('0xe9'),'required':![]},{'model':db[_0x8a46('0xc8')],'as':_0x8a46('0xea'),'attributes':[_0x8a46('0x3b'),_0x8a46('0xeb'),'internal'],'required':![]},{'model':db[_0x8a46('0xec')],'as':_0x8a46('0xed'),'attributes':['id','name',_0x8a46('0xee')],'where':_0x15312b['query'][_0x8a46('0xef')]?{'id':_0x15312b[_0x8a46('0x43')][_0x8a46('0xef')]}:undefined,'required':_0x15312b[_0x8a46('0x43')][_0x8a46('0xef')]?!![]:![]}];}return db['ChatInteraction'][_0x8a46('0x57')](_0x3a5443);})[_0x8a46('0x21')](function(_0x4cb1b7){_0x2f88cd['rows']=_0x4cb1b7;return _0x2f88cd;});}})[_0x8a46('0x21')](respondWithFilteredResult(_0x7c19f9,_0x3a5443))[_0x8a46('0x2a')](handleError(_0x7c19f9,null));};function iftimePromise(_0x3ced6a,_0x1f88a2){return respondWithRpcPromise(_0x8a46('0xf0'),_0x8a46('0xf1'),{'command':_0x1f88a2[_0x8a46('0xf2')]?util[_0x8a46('0xb2')]('iftime\x20%s,%s',_0x3ced6a[_0x8a46('0xf3')],_0x1f88a2['timezone']):util[_0x8a46('0xb2')](_0x8a46('0xf4'),_0x3ced6a[_0x8a46('0xf3')])},client9002)[_0x8a46('0x21')](function(_0x4589cd){var _0x144821=_0x4589cd&&_0x4589cd['indexOf'](_0x8a46('0xf5'))>=0x0?!![]:![];logger[_0x8a46('0xf6')](_0x8a46('0xf7'),_0x1f88a2['id'],_0x3ced6a['id'],_0x3ced6a[_0x8a46('0xf3')],_0x144821?'ONLINE':_0x8a46('0xf8'),_0x1f88a2[_0x8a46('0xf2')]?_0x1f88a2[_0x8a46('0xf2')]:'No\x20timezone');return _0x144821;})[_0x8a46('0x2a')](function(_0x12facf){logger['error'](_0x8a46('0xf7'),_0x1f88a2['id'],_0x3ced6a['id'],_0x3ced6a['interval'],util[_0x8a46('0xf9')](_0x12facf,{'showHidden':![],'depth':null}),_0x1f88a2[_0x8a46('0xf2')]?_0x1f88a2['timezone']:_0x8a46('0xfa'));return![];});}exports[_0x8a46('0xf1')]=function(_0x4bf2e7,_0x577ae5,_0x45c0ad){var _0x13fcc1=0x0;var _0x478be2=0x0;var _0x1fca9c=![];var _0x638554;var _0x4360a5;return db['ChatWebsite'][_0x8a46('0x5c')]({'where':{'id':_0x4bf2e7[_0x8a46('0x5a')]['id']},'include':[{'model':db[_0x8a46('0xfb')],'as':'Interval','include':[{'model':db[_0x8a46('0xfb')],'as':'Intervals','attributes':['id',_0x8a46('0xf3')],'raw':!![]}]}]})[_0x8a46('0x21')](handleEntityNotFound(_0x577ae5,null))[_0x8a46('0x21')](function(_0x54368e){if(_0x54368e){_0x638554=_0x54368e;return _0x54368e[_0x8a46('0xfc')]({'raw':!![]});}})[_0x8a46('0x21')](function(_0x493409){if(_0x638554){if(_0x493409){_0x4360a5=_0x493409;}}return require(_0x8a46('0x80'))[_0x8a46('0xfd')]();})[_0x8a46('0x21')](function(_0x247fcb){if(_0x247fcb){_0x478be2=_0x247fcb['virtual'];_0x1fca9c=_0x247fcb[_0x8a46('0x81')];}})[_0x8a46('0x21')](function(){return db['ChatInteraction'][_0x8a46('0x2f')]({'where':{'closed':![]}});})[_0x8a46('0x21')](function(_0x4d4661){_0x13fcc1=_0x4d4661;if(_0x478be2&&_0x4d4661>_0x478be2){return db[_0x8a46('0xfe')][_0x8a46('0x6a')]({'where':{'id':0x1}})[_0x8a46('0x21')](function(_0x4086ab){if(_0x4086ab){_0x4086ab[_0x8a46('0xff')](_0x8a46('0x100'));}});}})[_0x8a46('0x21')](function(){if(_0x638554[_0x8a46('0xfb')]&&_0x638554[_0x8a46('0xfb')]['Intervals']){var _0x516a20=[];for(var _0x190a0d=0x0;_0x190a0d<_0x638554[_0x8a46('0xfb')][_0x8a46('0x101')][_0x8a46('0x48')];_0x190a0d++){var _0x22fd8=_0x638554[_0x8a46('0xfb')][_0x8a46('0x101')][_0x190a0d]['get']({'plain':!![]});_0x516a20[_0x8a46('0xc1')](iftimePromise(_0x22fd8,_0x638554));}return BPromise[_0x8a46('0x102')](_0x516a20)[_0x8a46('0x21')](function(_0x5a8873){return _[_0x8a46('0x103')](_0x5a8873);});}else{return!![];}})[_0x8a46('0x21')](function(_0x4b80a3){var _0x110907=fs[_0x8a46('0xd7')](path[_0x8a46('0x7d')](config['root'],_0x8a46('0x104')),_0x8a46('0xd9'));var _0x809be3={'remote':_0x638554['remote'],'query':querystring[_0x8a46('0xb8')](_['merge'](_0x638554[_0x8a46('0x38')]({'plain':!![]}),{'customerIp':_0x4bf2e7[_0x8a46('0x8e')]['x-forwarded-for']||_0x4bf2e7[_0x8a46('0x8e')][_0x8a46('0x105')]||_0x4bf2e7[_0x8a46('0x106')][_0x8a46('0x107')]||_0x4bf2e7['ip'],'referer':_0x4bf2e7[_0x8a46('0x8e')]['referer'],'openedInteractions':_0x13fcc1,'maxInteractions':_0x478be2,'virtual':_0x1fca9c[_0x8a46('0x108')],'online':_0x4b80a3,'custom':_0x1fca9c}))['replace'](/'/g,'\x5c\x27')};_0x577ae5[_0x8a46('0x3c')](ejs[_0x8a46('0x109')](Mustache[_0x8a46('0x109')](_0x110907,_0x809be3),{'proactiveActions':_0x4360a5,'alignment':_0x638554[_0x8a46('0x10a')],'verticalAlignment':_0x638554['verticalAlignment']}));})[_0x8a46('0x2a')](handleError(_0x577ae5,null));};exports[_0x8a46('0x10b')]=function(_0x40a2ed,_0x49f2a7,_0x407a2e){return db['ChatWebsite'][_0x8a46('0x6a')]({'where':{'id':_0x40a2ed[_0x8a46('0x5a')]['id']}})[_0x8a46('0x21')](handleEntityNotFound(_0x49f2a7,null))[_0x8a46('0x21')](function(_0x561b91){if(_0x561b91){return db[_0x8a46('0x10c')]['transaction'](function(_0x5ece5c){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x40a2ed[_0x8a46('0x5a')]['id']},'transaction':_0x5ece5c})[_0x8a46('0x21')](function(_0x599ae4){var _0x6ac32d=_['map'](_0x40a2ed[_0x8a46('0x5d')],function(_0x3bf2eb){_0x3bf2eb[_0x8a46('0x68')]=_0x40a2ed['params']['id'];return _0x3bf2eb;});return db[_0x8a46('0xa2')]['bulkCreate'](_0x6ac32d,{'transaction':_0x5ece5c});});})['then'](function(){return db['ChatApplication'][_0x8a46('0x10d')]({'where':{'ChatWebsiteId':_0x40a2ed[_0x8a46('0x5a')]['id']},'order':_0x8a46('0x10e')});});}})[_0x8a46('0x21')](respondWithResult(_0x49f2a7,null))[_0x8a46('0x2a')](handleError(_0x49f2a7,null));};exports[_0x8a46('0x10f')]=function(_0x31e3b9,_0x41c0a3,_0x31318d){var _0x53a2c9={};var _0x3ba2f7={};var _0x552b64;var _0x44a2f2;return db[_0x8a46('0x3f')][_0x8a46('0x6a')]({'where':{'id':_0x31e3b9[_0x8a46('0x5a')]['id']}})[_0x8a46('0x21')](handleEntityNotFound(_0x41c0a3,null))['then'](function(_0x30c41a){if(_0x30c41a){_0x552b64=_0x30c41a;_0x3ba2f7['model']=_[_0x8a46('0x42')](db[_0x8a46('0xa2')][_0x8a46('0x40')]);_0x3ba2f7[_0x8a46('0x43')]=_[_0x8a46('0x42')](_0x31e3b9['query']);_0x3ba2f7['filters']=_[_0x8a46('0x45')](_0x3ba2f7['model'],_0x3ba2f7[_0x8a46('0x43')]);_0x53a2c9['attributes']=_[_0x8a46('0x45')](_0x3ba2f7[_0x8a46('0x41')],qs['fields'](_0x31e3b9['query'][_0x8a46('0x47')]));_0x53a2c9['attributes']=_0x53a2c9[_0x8a46('0x46')][_0x8a46('0x48')]?_0x53a2c9['attributes']:_0x3ba2f7[_0x8a46('0x41')];_0x53a2c9[_0x8a46('0x4a')]=qs['sort'](_0x31e3b9[_0x8a46('0x43')]['sort']);_0x53a2c9[_0x8a46('0x4b')]=qs['filters'](_[_0x8a46('0x4c')](_0x31e3b9[_0x8a46('0x43')],_0x3ba2f7[_0x8a46('0x44')]));if(_0x31e3b9[_0x8a46('0x43')]['filter']){_0x53a2c9[_0x8a46('0x4b')]=_[_0x8a46('0x53')](_0x53a2c9[_0x8a46('0x4b')],{'$or':_[_0x8a46('0x4e')](_0x53a2c9[_0x8a46('0x46')],function(_0x5f40cd){var _0x3eb757={};_0x3eb757[_0x5f40cd]={'$like':'%'+_0x31e3b9['query'][_0x8a46('0x4d')]+'%'};return _0x3eb757;})});}_0x53a2c9=_['merge']({},_0x53a2c9,_0x31e3b9[_0x8a46('0x54')]);return _0x552b64[_0x8a46('0x10f')](_0x53a2c9);}})[_0x8a46('0x21')](function(_0x219a23){if(_0x219a23){_0x44a2f2=_0x219a23[_0x8a46('0x48')];if(!_0x31e3b9[_0x8a46('0x43')][_0x8a46('0x6c')]('nolimit')){_0x53a2c9[_0x8a46('0x31')]=qs[_0x8a46('0x31')](_0x31e3b9[_0x8a46('0x43')][_0x8a46('0x31')]);_0x53a2c9[_0x8a46('0x30')]=qs[_0x8a46('0x30')](_0x31e3b9[_0x8a46('0x43')][_0x8a46('0x30')]);}return _0x552b64[_0x8a46('0x10f')](_0x53a2c9);}})[_0x8a46('0x21')](function(_0x45e48d){if(_0x45e48d){return _0x45e48d?{'count':_0x44a2f2,'rows':_0x45e48d}:null;}})['then'](respondWithResult(_0x41c0a3,null))[_0x8a46('0x2a')](handleError(_0x41c0a3,null));};exports['addProactiveActions']=function(_0x841d0d,_0x59c343,_0x24e51c){return db[_0x8a46('0x110')]['find']({'where':{'id':_0x841d0d[_0x8a46('0x5a')]['id']}})[_0x8a46('0x21')](handleEntityNotFound(_0x59c343,null))[_0x8a46('0x21')](function(_0x5ed34b){if(_0x5ed34b){return _0x5ed34b[_0x8a46('0x111')](_0x841d0d['body'][_0x8a46('0x6f')],_[_0x8a46('0x112')](_0x841d0d[_0x8a46('0x5d')],['ids','id'])||{});}})[_0x8a46('0x21')](respondWithResult(_0x59c343,null))[_0x8a46('0x2a')](handleError(_0x59c343,null));};exports[_0x8a46('0xfc')]=function(_0xba6872,_0xfa5c94,_0x3917a2){var _0x62d2fe={};var _0x5ca9aa={};var _0x4577e0;var _0x441578;return db[_0x8a46('0x3f')][_0x8a46('0x6a')]({'where':{'id':_0xba6872[_0x8a46('0x5a')]['id']}})[_0x8a46('0x21')](handleEntityNotFound(_0xfa5c94,null))[_0x8a46('0x21')](function(_0x3bcd25){if(_0x3bcd25){_0x4577e0=_0x3bcd25;_0x5ca9aa['model']=_[_0x8a46('0x42')](db[_0x8a46('0x113')][_0x8a46('0x40')]);_0x5ca9aa[_0x8a46('0x43')]=_['keys'](_0xba6872[_0x8a46('0x43')]);_0x5ca9aa[_0x8a46('0x44')]=_[_0x8a46('0x45')](_0x5ca9aa[_0x8a46('0x41')],_0x5ca9aa[_0x8a46('0x43')]);_0x62d2fe['attributes']=_[_0x8a46('0x45')](_0x5ca9aa[_0x8a46('0x41')],qs[_0x8a46('0x47')](_0xba6872[_0x8a46('0x43')]['fields']));_0x62d2fe[_0x8a46('0x46')]=_0x62d2fe[_0x8a46('0x46')][_0x8a46('0x48')]?_0x62d2fe[_0x8a46('0x46')]:_0x5ca9aa['model'];_0x62d2fe[_0x8a46('0x4a')]=qs[_0x8a46('0x6d')](_0xba6872[_0x8a46('0x43')][_0x8a46('0x6d')]);_0x62d2fe[_0x8a46('0x4b')]=qs[_0x8a46('0x44')](_[_0x8a46('0x4c')](_0xba6872[_0x8a46('0x43')],_0x5ca9aa['filters']));if(_0xba6872[_0x8a46('0x43')][_0x8a46('0x4d')]){_0x62d2fe['where']=_['merge'](_0x62d2fe[_0x8a46('0x4b')],{'$or':_[_0x8a46('0x4e')](_0x62d2fe['attributes'],function(_0x14dbf9){var _0x3cfb90={};_0x3cfb90[_0x14dbf9]={'$like':'%'+_0xba6872['query'][_0x8a46('0x4d')]+'%'};return _0x3cfb90;})});}_0x62d2fe=_[_0x8a46('0x53')]({},_0x62d2fe,_0xba6872[_0x8a46('0x54')]);return _0x4577e0['getProactiveActions'](_0x62d2fe);}})[_0x8a46('0x21')](function(_0x2035b0){if(_0x2035b0){_0x441578=_0x2035b0['length'];if(!_0xba6872['query'][_0x8a46('0x6c')](_0x8a46('0x49'))){_0x62d2fe[_0x8a46('0x31')]=qs['limit'](_0xba6872[_0x8a46('0x43')][_0x8a46('0x31')]);_0x62d2fe[_0x8a46('0x30')]=qs['offset'](_0xba6872[_0x8a46('0x43')][_0x8a46('0x30')]);}return _0x4577e0[_0x8a46('0xfc')](_0x62d2fe);}})[_0x8a46('0x21')](function(_0x442911){if(_0x442911){return _0x442911?{'count':_0x441578,'rows':_0x442911}:null;}})['then'](respondWithResult(_0xfa5c94,null))[_0x8a46('0x2a')](handleError(_0xfa5c94,null));};exports[_0x8a46('0x114')]=function(_0x4e059d,_0x379240,_0x44cae2){var _0xc5d7d5=_0x4e059d[_0x8a46('0x43')]['online']==='false'?_0x8a46('0x115'):'onlineForm';return db['ChatWebsite'][_0x8a46('0x5c')]({'attributes':['id',_0xc5d7d5],'where':{'id':_0x4e059d[_0x8a46('0x5a')]['id']}})[_0x8a46('0x21')](handleEntityNotFound(_0x379240,null))[_0x8a46('0x21')](function(_0x31b5c0){if(_0x31b5c0){var _0x2acf0e=_0x31b5c0[_0xc5d7d5];var _0x33a6fb=_0x2acf0e&&_0x2acf0e[_0x8a46('0x116')]?_0x2acf0e['items']:[];_0x379240[_0x8a46('0x3c')]({'fromKey':_['isNil'](_0x2acf0e[_0x8a46('0x117')])?undefined:_0x2acf0e[_0x8a46('0x117')],'count':_0x33a6fb[_0x8a46('0x48')],'rows':_0x33a6fb});}})['catch'](handleError(_0x379240,null));};exports['getOfflineMessages']=function(_0x5d1e00,_0x1093ae,_0x4fbd94){var _0x3c4092={'raw':!![],'where':{}};var _0x244a67={};var _0x1d6a14={'count':0x0,'rows':[]};return db[_0x8a46('0x3f')][_0x8a46('0x6a')]({'where':{'id':_0x5d1e00[_0x8a46('0x5a')]['id']}})[_0x8a46('0x21')](handleEntityNotFound(_0x1093ae,null))[_0x8a46('0x21')](function(_0x38a5cb){if(_0x38a5cb){_0x244a67[_0x8a46('0x41')]=_['keys'](db[_0x8a46('0x118')]['rawAttributes']);_0x244a67[_0x8a46('0x43')]=_['keys'](_0x5d1e00['query']);_0x244a67[_0x8a46('0x44')]=_['intersection'](_0x244a67[_0x8a46('0x41')],_0x244a67[_0x8a46('0x43')]);_0x3c4092[_0x8a46('0x46')]=_[_0x8a46('0x45')](_0x244a67[_0x8a46('0x41')],qs[_0x8a46('0x47')](_0x5d1e00[_0x8a46('0x43')][_0x8a46('0x47')]));_0x3c4092[_0x8a46('0x46')]=_0x3c4092[_0x8a46('0x46')][_0x8a46('0x48')]?_0x3c4092[_0x8a46('0x46')]:_0x244a67[_0x8a46('0x41')];if(!_0x5d1e00['query'][_0x8a46('0x6c')](_0x8a46('0x49'))){_0x3c4092[_0x8a46('0x31')]=qs[_0x8a46('0x31')](_0x5d1e00['query'][_0x8a46('0x31')]);_0x3c4092['offset']=qs['offset'](_0x5d1e00[_0x8a46('0x43')][_0x8a46('0x30')]);}_0x3c4092[_0x8a46('0x4a')]=qs['sort'](_0x5d1e00[_0x8a46('0x43')]['sort']);_0x3c4092[_0x8a46('0x4b')]=qs['filters'](_['pick'](_0x5d1e00[_0x8a46('0x43')],_0x244a67['filters']));_0x3c4092[_0x8a46('0x4b')][_0x8a46('0x68')]=_0x38a5cb['id'];if(_0x5d1e00[_0x8a46('0x43')][_0x8a46('0x4d')]){_0x3c4092[_0x8a46('0x4b')]=_[_0x8a46('0x53')](_0x3c4092[_0x8a46('0x4b')],{'$or':_['map'](_0x3c4092[_0x8a46('0x46')],function(_0x3dad24){var _0x22141e={};_0x22141e[_0x3dad24]={'$like':'%'+_0x5d1e00[_0x8a46('0x43')][_0x8a46('0x4d')]+'%'};return _0x22141e;})});}_0x3c4092=_[_0x8a46('0x53')]({},_0x3c4092,_0x5d1e00[_0x8a46('0x54')]);return db[_0x8a46('0x118')]['count']({'where':_0x3c4092['where']})[_0x8a46('0x21')](function(_0x3a7235){_0x1d6a14[_0x8a46('0x2f')]=_0x3a7235;if(_0x5d1e00[_0x8a46('0x43')][_0x8a46('0x55')]){_0x3c4092[_0x8a46('0x56')]=[{'all':!![]}];}return db[_0x8a46('0x118')][_0x8a46('0x57')](_0x3c4092);})[_0x8a46('0x21')](function(_0x5bef01){_0x1d6a14[_0x8a46('0x58')]=_0x5bef01;return _0x1d6a14;});}})[_0x8a46('0x21')](respondWithFilteredResult(_0x1093ae,_0x3c4092))['catch'](handleError(_0x1093ae,null));};exports[_0x8a46('0x119')]=function(_0xd68d26,_0x28d2e0,_0x546bee){return db[_0x8a46('0x3f')][_0x8a46('0x5c')]({'where':{'id':_0xd68d26['params']['id']}})[_0x8a46('0x21')](handleEntityNotFound(_0x28d2e0,null))[_0x8a46('0x21')](function(_0xfb8cf2){if(_0xfb8cf2){return _0xfb8cf2[_0x8a46('0x119')](_0xd68d26[_0x8a46('0x5d')][_0x8a46('0x6f')],_[_0x8a46('0x112')](_0xd68d26[_0x8a46('0x5d')],[_0x8a46('0x6f'),'id'])||{})['spread'](function(_0x1492e1){for(var _0x503af3=0x0;_0x503af3<_0xd68d26[_0x8a46('0x5d')][_0x8a46('0x6f')][_0x8a46('0x48')];_0x503af3+=0x1){socket[_0x8a46('0x11a')](_0x8a46('0x11b'),{'UserId':_0xd68d26[_0x8a46('0x5d')][_0x8a46('0x6f')][_0x503af3],'ChatWebsiteId':_0xd68d26['params']['id']});}return _0x1492e1;});}})[_0x8a46('0x21')](respondWithResult(_0x28d2e0,null))['catch'](handleError(_0x28d2e0,null));};exports[_0x8a46('0x11c')]=function(_0x46a7a0,_0x357c00,_0x1ea889){return db[_0x8a46('0x3f')][_0x8a46('0x5c')]({'where':{'id':_0x46a7a0[_0x8a46('0x5a')]['id']}})[_0x8a46('0x21')](handleEntityNotFound(_0x357c00,null))[_0x8a46('0x21')](function(_0x5aa4e8){if(_0x5aa4e8){return _0x5aa4e8[_0x8a46('0x11c')](_0x46a7a0[_0x8a46('0x43')]['ids'])[_0x8a46('0x21')](function(){if(_[_0x8a46('0x11d')](_0x46a7a0[_0x8a46('0x43')]['ids'])){for(var _0x340932=0x0;_0x340932<_0x46a7a0[_0x8a46('0x43')][_0x8a46('0x6f')][_0x8a46('0x48')];_0x340932+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x46a7a0['query']['ids'][_0x340932]),'ChatWebsiteId':Number(_0x46a7a0['params']['id'])});}}else{socket['emit'](_0x8a46('0x11e'),{'UserId':Number(_0x46a7a0['query'][_0x8a46('0x6f')]),'ChatWebsiteId':Number(_0x46a7a0['params']['id'])});}});}})[_0x8a46('0x21')](respondWithStatusCode(_0x357c00,null))[_0x8a46('0x2a')](handleError(_0x357c00,null));};exports[_0x8a46('0x11f')]=function(_0x29e0f7,_0x551b50,_0x16bcea){var _0x54af08={};var _0x2fad19={};var _0x3bc013;var _0x1cedd5;return db[_0x8a46('0x3f')][_0x8a46('0x6a')]({'where':{'id':_0x29e0f7[_0x8a46('0x5a')]['id']}})[_0x8a46('0x21')](handleEntityNotFound(_0x551b50,null))[_0x8a46('0x21')](function(_0x4ed429){if(_0x4ed429){_0x3bc013=_0x4ed429;_0x2fad19['model']=_[_0x8a46('0x42')](db[_0x8a46('0xc8')][_0x8a46('0x40')]);_0x2fad19['query']=_[_0x8a46('0x42')](_0x29e0f7[_0x8a46('0x43')]);_0x2fad19[_0x8a46('0x44')]=_['intersection'](_0x2fad19[_0x8a46('0x41')],_0x2fad19[_0x8a46('0x43')]);_0x54af08[_0x8a46('0x46')]=_[_0x8a46('0x45')](_0x2fad19[_0x8a46('0x41')],qs[_0x8a46('0x47')](_0x29e0f7['query'][_0x8a46('0x47')]));_0x54af08[_0x8a46('0x46')]=_0x54af08[_0x8a46('0x46')][_0x8a46('0x48')]?_0x54af08['attributes']:_0x2fad19[_0x8a46('0x41')];_0x54af08['order']=qs[_0x8a46('0x6d')](_0x29e0f7[_0x8a46('0x43')]['sort']);_0x54af08[_0x8a46('0x4b')]=qs[_0x8a46('0x44')](_['pick'](_0x29e0f7[_0x8a46('0x43')],_0x2fad19[_0x8a46('0x44')]));if(_0x29e0f7[_0x8a46('0x43')][_0x8a46('0x4d')]){_0x54af08[_0x8a46('0x4b')]=_[_0x8a46('0x53')](_0x54af08['where'],{'$or':_['map'](_0x54af08['attributes'],function(_0x19e1e0){var _0x54839b={};_0x54839b[_0x19e1e0]={'$like':'%'+_0x29e0f7[_0x8a46('0x43')][_0x8a46('0x4d')]+'%'};return _0x54839b;})});}_0x54af08=_['merge']({},_0x54af08,_0x29e0f7['options']);return _0x3bc013[_0x8a46('0x11f')](_0x54af08);}})['then'](function(_0x26d0ed){if(_0x26d0ed){_0x1cedd5=_0x26d0ed['length'];if(!_0x29e0f7['query'][_0x8a46('0x6c')](_0x8a46('0x49'))){_0x54af08[_0x8a46('0x31')]=qs['limit'](_0x29e0f7[_0x8a46('0x43')][_0x8a46('0x31')]);_0x54af08[_0x8a46('0x30')]=qs[_0x8a46('0x30')](_0x29e0f7[_0x8a46('0x43')][_0x8a46('0x30')]);}return _0x3bc013['getAgents'](_0x54af08);}})[_0x8a46('0x21')](function(_0x146ff1){if(_0x146ff1){return _0x146ff1?{'count':_0x1cedd5,'rows':_0x146ff1}:null;}})[_0x8a46('0x21')](respondWithResult(_0x551b50,null))['catch'](handleError(_0x551b50,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index b9d9d33..b369167 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 _0x5adb=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x5adb,0x143));var _0xb5ad=function(_0x4af6a0,_0x522121){_0x4af6a0=_0x4af6a0-0x0;var _0x4c2b23=_0x5adb[_0x4af6a0];return _0x4c2b23;};'use strict';var EventEmitter=require(_0xb5ad('0x0'));var ChatWebsite=require(_0xb5ad('0x1'))['db'][_0xb5ad('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb5ad('0x3')](0x0);var events={'afterCreate':_0xb5ad('0x4'),'afterUpdate':_0xb5ad('0x5'),'afterDestroy':_0xb5ad('0x6')};function emitEvent(_0x5ad75d){return function(_0x5d16ea,_0x8163b4,_0x50558e){ChatWebsiteEvents['emit'](_0x5ad75d+':'+_0x5d16ea['id'],_0x5d16ea);ChatWebsiteEvents[_0xb5ad('0x7')](_0x5ad75d,_0x5d16ea);_0x50558e(null);};}for(var e in events){if(events[_0xb5ad('0x8')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xb5ad('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0xfa7a=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite'];(function(_0x45ad09,_0x521ab1){var _0x2084fd=function(_0x6fd212){while(--_0x6fd212){_0x45ad09['push'](_0x45ad09['shift']());}};_0x2084fd(++_0x521ab1);}(_0xfa7a,0x16e));var _0xafa7=function(_0x440891,_0xcea1c1){_0x440891=_0x440891-0x0;var _0xd05e68=_0xfa7a[_0x440891];return _0xd05e68;};'use strict';var EventEmitter=require(_0xafa7('0x0'));var ChatWebsite=require(_0xafa7('0x1'))['db'][_0xafa7('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xafa7('0x3'),'afterDestroy':_0xafa7('0x4')};function emitEvent(_0x2c99da){return function(_0x2fe671,_0x2a1e7c,_0x47ef49){ChatWebsiteEvents[_0xafa7('0x5')](_0x2c99da+':'+_0x2fe671['id'],_0x2fe671);ChatWebsiteEvents[_0xafa7('0x5')](_0x2c99da,_0x2fe671);_0x47ef49(null);};}for(var e in events){if(events[_0xafa7('0x6')](e)){var event=events[e];ChatWebsite[_0xafa7('0x7')](e,emitEvent(event));}}module[_0xafa7('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 db55032..343dd85 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 _0x321d=['ChatWebsite','chat_websites','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x1728a0,_0x3291f1){var _0x4e39e9=function(_0x5aa24a){while(--_0x5aa24a){_0x1728a0['push'](_0x1728a0['shift']());}};_0x4e39e9(++_0x3291f1);}(_0x321d,0x12b));var _0xd321=function(_0x32c547,_0x195f9b){_0x32c547=_0x32c547-0x0;var _0x4b9421=_0x321d[_0x32c547];return _0x4b9421;};'use strict';var _=require('lodash');var util=require(_0xd321('0x0'));var logger=require(_0xd321('0x1'))('api');var moment=require(_0xd321('0x2'));var BPromise=require(_0xd321('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd321('0x4'));var config=require(_0xd321('0x5'));var attributes=require(_0xd321('0x6'));module['exports']=function(_0x1defec,_0x5653f3){return _0x1defec['define'](_0xd321('0x7'),attributes,{'tableName':_0xd321('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e64=['chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','ChatWebsite'];(function(_0x4605a6,_0x4ee25f){var _0x18bc7a=function(_0x2f1228){while(--_0x2f1228){_0x4605a6['push'](_0x4605a6['shift']());}};_0x18bc7a(++_0x4ee25f);}(_0x4e64,0x83));var _0x44e6=function(_0x418305,_0xcf9d75){_0x418305=_0x418305-0x0;var _0x39a433=_0x4e64[_0x418305];return _0x39a433;};'use strict';var _=require(_0x44e6('0x0'));var util=require(_0x44e6('0x1'));var logger=require(_0x44e6('0x2'))(_0x44e6('0x3'));var moment=require(_0x44e6('0x4'));var BPromise=require(_0x44e6('0x5'));var rp=require(_0x44e6('0x6'));var fs=require('fs');var path=require(_0x44e6('0x7'));var rimraf=require(_0x44e6('0x8'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0x44e6('0x9')]=function(_0xa5cc97,_0x2149fb){return _0xa5cc97[_0x44e6('0xa')](_0x44e6('0xb'),attributes,{'tableName':_0x44e6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 513934e..ed4e2c0 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 _0x15bd=['socket.io-emitter','request','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x30755e,_0x4d06f8){var _0x3ef4b1=function(_0x6c9409){while(--_0x6c9409){_0x30755e['push'](_0x30755e['shift']());}};_0x3ef4b1(++_0x4d06f8);}(_0x15bd,0x6f));var _0xd15b=function(_0x462999,_0x24d200){_0x462999=_0x462999-0x0;var _0x4b1366=_0x15bd[_0x462999];return _0x4b1366;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd15b('0x0'));var rs=require(_0xd15b('0x1'));var fs=require('fs');var Redis=require(_0xd15b('0x2'));var db=require(_0xd15b('0x3'))['db'];var utils=require(_0xd15b('0x4'));var logger=require(_0xd15b('0x5'))(_0xd15b('0x6'));var config=require(_0xd15b('0x7'));var jayson=require(_0xd15b('0x8'));var client=jayson[_0xd15b('0x9')][_0xd15b('0xa')]({'port':0x232a});config[_0xd15b('0xb')]=_[_0xd15b('0xc')](config[_0xd15b('0xb')],{'host':_0xd15b('0xd'),'port':0x18eb});var socket=require(_0xd15b('0xe'))(new Redis(config[_0xd15b('0xb')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x112b2c,_0x254489,_0x25e94c){return new BPromise(function(_0xd63e27,_0x51bdb5){return client[_0xd15b('0xf')](_0x112b2c,_0x25e94c)['then'](function(_0x1f6863){logger[_0xd15b('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x254489,'request\x20sent');logger[_0xd15b('0x11')](_0xd15b('0x12'),_0x254489,'request\x20sent',JSON[_0xd15b('0x13')](_0x1f6863));if(_0x1f6863[_0xd15b('0x14')]){if(_0x1f6863['error']['code']===0x1f4){logger['error'](_0xd15b('0x15'),_0x254489,_0x1f6863['error'][_0xd15b('0x16')]);return _0x51bdb5(_0x1f6863[_0xd15b('0x14')][_0xd15b('0x16')]);}logger['error'](_0xd15b('0x15'),_0x254489,_0x1f6863[_0xd15b('0x14')][_0xd15b('0x16')]);return _0xd63e27(_0x1f6863[_0xd15b('0x14')]['message']);}else{logger[_0xd15b('0x10')](_0xd15b('0x15'),_0x254489,'request\x20sent');_0xd63e27(_0x1f6863[_0xd15b('0x17')][_0xd15b('0x16')]);}})[_0xd15b('0x18')](function(_0x1aa9c5){logger[_0xd15b('0x14')](_0xd15b('0x15'),_0x254489,_0x1aa9c5);_0x51bdb5(_0x1aa9c5);});});} \ No newline at end of file +var _0x54d5=['ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x54d5,0x1c9));var _0x554d=function(_0x5302fc,_0x2b2002){_0x5302fc=_0x5302fc-0x0;var _0x10bc8c=_0x54d5[_0x5302fc];return _0x10bc8c;};'use strict';var _=require(_0x554d('0x0'));var util=require(_0x554d('0x1'));var moment=require(_0x554d('0x2'));var BPromise=require(_0x554d('0x3'));var rs=require(_0x554d('0x4'));var fs=require('fs');var Redis=require(_0x554d('0x5'));var db=require(_0x554d('0x6'))['db'];var utils=require(_0x554d('0x7'));var logger=require(_0x554d('0x8'))(_0x554d('0x9'));var config=require(_0x554d('0xa'));var jayson=require(_0x554d('0xb'));var client=jayson[_0x554d('0xc')][_0x554d('0xd')]({'port':0x232a});config[_0x554d('0xe')]=_[_0x554d('0xf')](config[_0x554d('0xe')],{'host':_0x554d('0x10'),'port':0x18eb});var socket=require(_0x554d('0x11'))(new Redis(config[_0x554d('0xe')]));require(_0x554d('0x12'))[_0x554d('0x13')](socket);function respondWithRpcPromise(_0x1a59b0,_0x2c4e2c,_0x1fd27a){return new BPromise(function(_0x5e387a,_0x3912e6){return client[_0x554d('0x14')](_0x1a59b0,_0x1fd27a)[_0x554d('0x15')](function(_0x563535){logger[_0x554d('0x16')](_0x554d('0x17'),_0x2c4e2c,'request\x20sent');logger[_0x554d('0x18')](_0x554d('0x19'),_0x2c4e2c,'request\x20sent',JSON[_0x554d('0x1a')](_0x563535));if(_0x563535[_0x554d('0x1b')]){if(_0x563535['error']['code']===0x1f4){logger[_0x554d('0x1b')](_0x554d('0x17'),_0x2c4e2c,_0x563535[_0x554d('0x1b')][_0x554d('0x1c')]);return _0x3912e6(_0x563535['error'][_0x554d('0x1c')]);}logger[_0x554d('0x1b')](_0x554d('0x17'),_0x2c4e2c,_0x563535[_0x554d('0x1b')][_0x554d('0x1c')]);return _0x5e387a(_0x563535[_0x554d('0x1b')][_0x554d('0x1c')]);}else{logger[_0x554d('0x16')](_0x554d('0x17'),_0x2c4e2c,'request\x20sent');_0x5e387a(_0x563535[_0x554d('0x1d')][_0x554d('0x1c')]);}})['catch'](function(_0x54cc47){logger['error'](_0x554d('0x17'),_0x2c4e2c,_0x54cc47);_0x3912e6(_0x54cc47);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 46de166..617b254 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 _0xd663=['update','emit','chatWebsite:','./chatWebsite.events','save'];(function(_0x339fdf,_0x3460cc){var _0x16b408=function(_0x4cde50){while(--_0x4cde50){_0x339fdf['push'](_0x339fdf['shift']());}};_0x16b408(++_0x3460cc);}(_0xd663,0x1ed));var _0x3d66=function(_0x46e420,_0xf13eaa){_0x46e420=_0x46e420-0x0;var _0x1eaa81=_0xd663[_0x46e420];return _0x1eaa81;};'use strict';var ChatWebsiteEvents=require(_0x3d66('0x0'));var events=[_0x3d66('0x1'),'remove',_0x3d66('0x2')];function createListener(_0xc857f9,_0x2750c7){return function(_0x1fedf6){_0x2750c7[_0x3d66('0x3')](_0xc857f9,_0x1fedf6);};}function removeListener(_0x4e9001,_0x28d76b){return function(){ChatWebsiteEvents['removeListener'](_0x4e9001,_0x28d76b);};}exports['register']=function(_0x5b7bf3){for(var _0x4f2b7a=0x0,_0x2783f6=events['length'];_0x4f2b7a<_0x2783f6;_0x4f2b7a++){var _0x50a1aa=events[_0x4f2b7a];var _0x3b6a81=createListener(_0x3d66('0x4')+_0x50a1aa,_0x5b7bf3);ChatWebsiteEvents['on'](_0x50a1aa,_0x3b6a81);}}; \ No newline at end of file +var _0x695c=['update','emit','removeListener','register','length','chatWebsite:'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x695c,0x1bc));var _0xc695=function(_0x285429,_0x287440){_0x285429=_0x285429-0x0;var _0x3e0065=_0x695c[_0x285429];return _0x3e0065;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save','remove',_0xc695('0x0')];function createListener(_0x5bcfd1,_0x3fad61){return function(_0x552e3d){_0x3fad61[_0xc695('0x1')](_0x5bcfd1,_0x552e3d);};}function removeListener(_0x4fca4f,_0x2f22d2){return function(){ChatWebsiteEvents[_0xc695('0x2')](_0x4fca4f,_0x2f22d2);};}exports[_0xc695('0x3')]=function(_0x5793ca){for(var _0x1177c8=0x0,_0x554d02=events[_0xc695('0x4')];_0x1177c8<_0x554d02;_0x1177c8++){var _0xe27d58=events[_0x1177c8];var _0x467d51=createListener(_0xc695('0x5')+_0xe27d58,_0x5793ca);ChatWebsiteEvents['on'](_0xe27d58,_0x467d51);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 649edb0..4343c7a 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 _0x89c4=['multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','/:id/customer_avatar','getSystemAvatar','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','diskStorage','join','server/files/images/logos/','%s-%s','now','originalname','single','addLogo','server/files/images/avatars/','format','file','addAvatar','root','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','notify','/:id/offline','offline','addApplications','addProactiveActions','addAgents','put','/:id','update','delete','destroy','removeAnswers','removeAgents','exports'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x89c4,0x82));var _0x489c=function(_0x48af78,_0x1364f5){_0x48af78=_0x48af78-0x0;var _0x53b01c=_0x89c4[_0x48af78];return _0x53b01c;};'use strict';var multer=require(_0x489c('0x0'));var util=require(_0x489c('0x1'));var path=require('path');var timeout=require(_0x489c('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x489c('0x3'));var interaction=require(_0x489c('0x4'));var config=require(_0x489c('0x5'));var controller=require(_0x489c('0x6'));router[_0x489c('0x7')]('/',auth[_0x489c('0x8')](),controller[_0x489c('0x9')]);router['get'](_0x489c('0xa'),auth[_0x489c('0x8')](),controller[_0x489c('0xb')]);router[_0x489c('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x489c('0xc')]);router['get'](_0x489c('0xd'),auth[_0x489c('0x8')](),controller[_0x489c('0xe')]);router[_0x489c('0x7')](_0x489c('0xf'),auth[_0x489c('0x8')](),controller[_0x489c('0x10')]);router[_0x489c('0x7')]('/:id/logo',controller[_0x489c('0x11')]);router['get'](_0x489c('0x12'),controller['getAvatar']);router['get'](_0x489c('0x13'),controller['getCustomerAvatar']);router[_0x489c('0x7')]('/:id/system_avatar',controller[_0x489c('0x14')]);router[_0x489c('0x7')]('/:id/interactions',auth[_0x489c('0x8')](),controller[_0x489c('0x15')]);router['get']('/:id/snippet',controller[_0x489c('0x16')]);router['get'](_0x489c('0x17'),auth[_0x489c('0x8')](),controller[_0x489c('0x18')]);router[_0x489c('0x7')](_0x489c('0x19'),auth[_0x489c('0x8')](),controller[_0x489c('0x1a')]);router[_0x489c('0x7')](_0x489c('0x1b'),controller[_0x489c('0x1c')]);router[_0x489c('0x7')](_0x489c('0x1d'),auth[_0x489c('0x8')](),controller[_0x489c('0x1e')]);router[_0x489c('0x7')](_0x489c('0x1f'),auth[_0x489c('0x8')](),controller[_0x489c('0x20')]);router['post']('/',auth[_0x489c('0x8')](),controller[_0x489c('0x21')]);router[_0x489c('0x22')](_0x489c('0xd'),auth[_0x489c('0x8')](),controller['addDisposition']);router[_0x489c('0x22')](_0x489c('0xf'),auth[_0x489c('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x489c('0x23')]({'destination':function(_0x1de4bf,_0x4e9838,_0x28eb70){_0x28eb70(null,path[_0x489c('0x24')](config['root'],_0x489c('0x25')));},'filename':function(_0x4cb1ae,_0x3aab5b,_0x1c1ad5){_0x1c1ad5(null,util['format'](_0x489c('0x26'),Date[_0x489c('0x27')](),_0x3aab5b[_0x489c('0x28')]));}})});router[_0x489c('0x22')]('/:id/logo',upload[_0x489c('0x29')]('file'),controller[_0x489c('0x2a')]);var upload=multer({'storage':multer[_0x489c('0x23')]({'destination':function(_0x3b8f79,_0x2fdb69,_0x36d812){_0x36d812(null,path[_0x489c('0x24')](config['root'],_0x489c('0x2b')));},'filename':function(_0x6f51c9,_0x4f72a8,_0x445d7d){_0x445d7d(null,util[_0x489c('0x2c')]('%s-%s',Date[_0x489c('0x27')](),_0x4f72a8[_0x489c('0x28')]));}})});router[_0x489c('0x22')](_0x489c('0x12'),upload['single'](_0x489c('0x2d')),controller[_0x489c('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x22250d,_0x13bb3e,_0x360f62){_0x360f62(null,path['join'](config[_0x489c('0x2f')],_0x489c('0x2b')));},'filename':function(_0x25a77e,_0x157760,_0x1a6dd9){_0x1a6dd9(null,util[_0x489c('0x2c')](_0x489c('0x26'),Date[_0x489c('0x27')](),_0x157760['originalname']));}})});router[_0x489c('0x22')](_0x489c('0x13'),upload[_0x489c('0x29')](_0x489c('0x2d')),controller[_0x489c('0x30')]);var upload=multer({'storage':multer[_0x489c('0x23')]({'destination':function(_0x2d5182,_0x306e5d,_0x3980a5){_0x3980a5(null,path[_0x489c('0x24')](config['root'],_0x489c('0x2b')));},'filename':function(_0x4b998e,_0x315d65,_0x3a66ce){_0x3a66ce(null,util[_0x489c('0x2c')](_0x489c('0x26'),Date['now'](),_0x315d65[_0x489c('0x28')]));}})});router[_0x489c('0x22')](_0x489c('0x31'),upload[_0x489c('0x29')](_0x489c('0x2d')),controller[_0x489c('0x32')]);router[_0x489c('0x22')]('/:id/notify',controller[_0x489c('0x33')]);router[_0x489c('0x22')](_0x489c('0x34'),controller[_0x489c('0x35')]);router[_0x489c('0x22')]('/:id/interactions',auth[_0x489c('0x8')](),controller['addInteraction']);router[_0x489c('0x22')]('/:id/applications',auth[_0x489c('0x8')](),controller[_0x489c('0x36')]);router[_0x489c('0x22')](_0x489c('0x19'),auth[_0x489c('0x8')](),controller[_0x489c('0x37')]);router[_0x489c('0x22')](_0x489c('0x1f'),auth[_0x489c('0x8')](),controller[_0x489c('0x38')]);router[_0x489c('0x39')](_0x489c('0x3a'),auth[_0x489c('0x8')](),controller[_0x489c('0x3b')]);router[_0x489c('0x3c')]('/:id',auth['isAuthenticated'](),controller[_0x489c('0x3d')]);router[_0x489c('0x3c')](_0x489c('0xd'),auth[_0x489c('0x8')](),controller['removeDispositions']);router[_0x489c('0x3c')](_0x489c('0xf'),auth['isAuthenticated'](),controller[_0x489c('0x3e')]);router['delete'](_0x489c('0x1f'),auth['isAuthenticated'](),controller[_0x489c('0x3f')]);module[_0x489c('0x40')]=router; \ No newline at end of file +var _0x2f38=['root','format','%s-%s','originalname','file','addLogo','diskStorage','server/files/images/avatars/','now','single','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','/:id/offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','getOfflineMessages','getAgents','post','create','addDisposition','/:id/canned_answers','join'];(function(_0x39269b,_0x216b3d){var _0x9cac2b=function(_0x1e1ee7){while(--_0x1e1ee7){_0x39269b['push'](_0x39269b['shift']());}};_0x9cac2b(++_0x216b3d);}(_0x2f38,0x1a7));var _0x82f3=function(_0x4b61ff,_0x27847d){_0x4b61ff=_0x4b61ff-0x0;var _0x3e7ee1=_0x2f38[_0x4b61ff];return _0x3e7ee1;};'use strict';var multer=require('multer');var util=require(_0x82f3('0x0'));var path=require('path');var timeout=require(_0x82f3('0x1'));var express=require(_0x82f3('0x2'));var router=express[_0x82f3('0x3')]();var auth=require(_0x82f3('0x4'));var interaction=require(_0x82f3('0x5'));var config=require(_0x82f3('0x6'));var controller=require('./chatWebsite.controller');router[_0x82f3('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x82f3('0x7')](_0x82f3('0x8'),auth[_0x82f3('0x9')](),controller[_0x82f3('0xa')]);router[_0x82f3('0x7')](_0x82f3('0xb'),auth[_0x82f3('0x9')](),controller[_0x82f3('0xc')]);router[_0x82f3('0x7')](_0x82f3('0xd'),auth[_0x82f3('0x9')](),controller[_0x82f3('0xe')]);router[_0x82f3('0x7')]('/:id/canned_answers',auth[_0x82f3('0x9')](),controller[_0x82f3('0xf')]);router[_0x82f3('0x7')](_0x82f3('0x10'),controller[_0x82f3('0x11')]);router[_0x82f3('0x7')](_0x82f3('0x12'),controller['getAvatar']);router['get'](_0x82f3('0x13'),controller[_0x82f3('0x14')]);router['get'](_0x82f3('0x15'),controller[_0x82f3('0x16')]);router[_0x82f3('0x7')](_0x82f3('0x17'),auth[_0x82f3('0x9')](),controller[_0x82f3('0x18')]);router['get'](_0x82f3('0x19'),controller[_0x82f3('0x1a')]);router[_0x82f3('0x7')](_0x82f3('0x1b'),auth[_0x82f3('0x9')](),controller[_0x82f3('0x1c')]);router['get']('/:id/proactive_actions',auth[_0x82f3('0x9')](),controller[_0x82f3('0x1d')]);router[_0x82f3('0x7')](_0x82f3('0x1e'),controller[_0x82f3('0x1f')]);router[_0x82f3('0x7')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x82f3('0x20')]);router[_0x82f3('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0x82f3('0x21')]);router[_0x82f3('0x22')]('/',auth[_0x82f3('0x9')](),controller[_0x82f3('0x23')]);router[_0x82f3('0x22')](_0x82f3('0xd'),auth[_0x82f3('0x9')](),controller[_0x82f3('0x24')]);router['post'](_0x82f3('0x25'),auth[_0x82f3('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2144a7,_0x5a3982,_0x144c24){_0x144c24(null,path[_0x82f3('0x26')](config[_0x82f3('0x27')],'server/files/images/logos/'));},'filename':function(_0x402bff,_0xcd0d7,_0xe66683){_0xe66683(null,util[_0x82f3('0x28')](_0x82f3('0x29'),Date['now'](),_0xcd0d7[_0x82f3('0x2a')]));}})});router[_0x82f3('0x22')](_0x82f3('0x10'),upload['single'](_0x82f3('0x2b')),controller[_0x82f3('0x2c')]);var upload=multer({'storage':multer[_0x82f3('0x2d')]({'destination':function(_0x2352ab,_0xf98e7f,_0x11141f){_0x11141f(null,path[_0x82f3('0x26')](config[_0x82f3('0x27')],_0x82f3('0x2e')));},'filename':function(_0x3bdc31,_0x3da974,_0x365630){_0x365630(null,util[_0x82f3('0x28')](_0x82f3('0x29'),Date[_0x82f3('0x2f')](),_0x3da974[_0x82f3('0x2a')]));}})});router[_0x82f3('0x22')](_0x82f3('0x12'),upload[_0x82f3('0x30')]('file'),controller[_0x82f3('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x328062,_0x33e188,_0x108419){_0x108419(null,path[_0x82f3('0x26')](config[_0x82f3('0x27')],'server/files/images/avatars/'));},'filename':function(_0x1d4d29,_0x3e082a,_0xd51103){_0xd51103(null,util[_0x82f3('0x28')](_0x82f3('0x29'),Date['now'](),_0x3e082a[_0x82f3('0x2a')]));}})});router['post'](_0x82f3('0x13'),upload['single'](_0x82f3('0x2b')),controller[_0x82f3('0x32')]);var upload=multer({'storage':multer[_0x82f3('0x2d')]({'destination':function(_0x561239,_0x503c77,_0x517862){_0x517862(null,path[_0x82f3('0x26')](config[_0x82f3('0x27')],_0x82f3('0x2e')));},'filename':function(_0x39403a,_0x9f69b5,_0x36d707){_0x36d707(null,util[_0x82f3('0x28')](_0x82f3('0x29'),Date['now'](),_0x9f69b5[_0x82f3('0x2a')]));}})});router[_0x82f3('0x22')](_0x82f3('0x15'),upload['single'](_0x82f3('0x2b')),controller[_0x82f3('0x33')]);router[_0x82f3('0x22')](_0x82f3('0x34'),controller['notify']);router[_0x82f3('0x22')](_0x82f3('0x35'),controller['offline']);router[_0x82f3('0x22')]('/:id/interactions',auth[_0x82f3('0x9')](),controller[_0x82f3('0x36')]);router[_0x82f3('0x22')](_0x82f3('0x1b'),auth[_0x82f3('0x9')](),controller[_0x82f3('0x37')]);router[_0x82f3('0x22')](_0x82f3('0x38'),auth['isAuthenticated'](),controller[_0x82f3('0x39')]);router['post']('/:id/users',auth[_0x82f3('0x9')](),controller[_0x82f3('0x3a')]);router[_0x82f3('0x3b')]('/:id',auth[_0x82f3('0x9')](),controller[_0x82f3('0x3c')]);router[_0x82f3('0x3d')](_0x82f3('0xb'),auth[_0x82f3('0x9')](),controller['destroy']);router[_0x82f3('0x3d')](_0x82f3('0xd'),auth[_0x82f3('0x9')](),controller[_0x82f3('0x3e')]);router[_0x82f3('0x3d')](_0x82f3('0x25'),auth[_0x82f3('0x9')](),controller[_0x82f3('0x3f')]);router[_0x82f3('0x3d')]('/:id/users',auth[_0x82f3('0x9')](),controller[_0x82f3('0x40')]);module[_0x82f3('0x41')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 22dd590..bdd938f 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 _0xec56=['getDataValue','split','INTEGER','BOOLEAN','sequelize','STRING','FLOAT','saFiscalMessage','join'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xec56,0x1bd));var _0x6ec5=function(_0x400572,_0x27e546){_0x400572=_0x400572-0x0;var _0x3ac6e9=_0xec56[_0x400572];return _0x3ac6e9;};'use strict';var Sequelize=require(_0x6ec5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x6ec5('0x1')]},'website':{'type':Sequelize[_0x6ec5('0x1')]},'phone':{'type':Sequelize[_0x6ec5('0x1')]},'fax':{'type':Sequelize[_0x6ec5('0x1')]},'type':{'type':Sequelize[_0x6ec5('0x1')]},'street':{'type':Sequelize[_0x6ec5('0x1')]},'postalCode':{'type':Sequelize[_0x6ec5('0x1')]},'city':{'type':Sequelize[_0x6ec5('0x1')]},'country':{'type':Sequelize[_0x6ec5('0x1')]},'email':{'type':Sequelize[_0x6ec5('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x6ec5('0x1')]},'sStreet':{'type':Sequelize[_0x6ec5('0x1')]},'sPostalCode':{'type':Sequelize[_0x6ec5('0x1')]},'sCity':{'type':Sequelize[_0x6ec5('0x1')]},'sCountry':{'type':Sequelize[_0x6ec5('0x1')]},'description':{'type':Sequelize[_0x6ec5('0x1')]},'flatDiscount':{'type':Sequelize[_0x6ec5('0x2')]},'saStreet':{'type':Sequelize[_0x6ec5('0x1')]},'saPostalCode':{'type':Sequelize[_0x6ec5('0x1')]},'saCity':{'type':Sequelize['STRING']},'saCountry':{'type':Sequelize[_0x6ec5('0x1')]},'saISOCode':{'type':Sequelize[_0x6ec5('0x1')](0x3)},'saFiscalCode':{'type':Sequelize[_0x6ec5('0x1')](0x32)},'saPIVA':{'type':Sequelize[_0x6ec5('0x1')](0x32)},'saSDICode':{'type':Sequelize[_0x6ec5('0x1')](0x15)},'saFiscalMessage':{'type':Sequelize[_0x6ec5('0x1')],'set':function(_0x1d5b76){this['setDataValue'](_0x6ec5('0x3'),_0x1d5b76?_0x1d5b76[_0x6ec5('0x4')](','):null);},'get':function(){return this[_0x6ec5('0x5')](_0x6ec5('0x3'))?this[_0x6ec5('0x5')](_0x6ec5('0x3'))[_0x6ec5('0x6')](','):[];}},'saExpiryDay':{'type':Sequelize[_0x6ec5('0x7')]},'saEurope':{'type':Sequelize['BOOLEAN']},'saSocCap':{'type':Sequelize[_0x6ec5('0x1')](0xff)},'saPaymentMethod':{'type':Sequelize['INTEGER']},'defaultEntry':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'vat':{'type':Sequelize[_0x6ec5('0x1')](0xff)}}; \ No newline at end of file +var _0x153f=['FLOAT','saFiscalMessage','join','getDataValue','split','INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x1f5169,_0x50224c){var _0x28989f=function(_0x1fa67b){while(--_0x1fa67b){_0x1f5169['push'](_0x1f5169['shift']());}};_0x28989f(++_0x50224c);}(_0x153f,0x15b));var _0xf153=function(_0x1c0644,_0x4cf470){_0x1c0644=_0x1c0644-0x0;var _0x5ef1e2=_0x153f[_0x1c0644];return _0x5ef1e2;};'use strict';var Sequelize=require(_0xf153('0x0'));module[_0xf153('0x1')]={'name':{'type':Sequelize[_0xf153('0x2')]},'companyId':{'type':Sequelize[_0xf153('0x2')]},'website':{'type':Sequelize[_0xf153('0x2')]},'phone':{'type':Sequelize[_0xf153('0x2')]},'fax':{'type':Sequelize[_0xf153('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xf153('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf153('0x2')]},'country':{'type':Sequelize[_0xf153('0x2')]},'email':{'type':Sequelize[_0xf153('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf153('0x2')]},'sStreet':{'type':Sequelize[_0xf153('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xf153('0x2')]},'sCountry':{'type':Sequelize[_0xf153('0x2')]},'description':{'type':Sequelize[_0xf153('0x2')]},'flatDiscount':{'type':Sequelize[_0xf153('0x3')]},'saStreet':{'type':Sequelize[_0xf153('0x2')]},'saPostalCode':{'type':Sequelize[_0xf153('0x2')]},'saCity':{'type':Sequelize[_0xf153('0x2')]},'saCountry':{'type':Sequelize[_0xf153('0x2')]},'saISOCode':{'type':Sequelize[_0xf153('0x2')](0x3)},'saFiscalCode':{'type':Sequelize[_0xf153('0x2')](0x32)},'saPIVA':{'type':Sequelize['STRING'](0x32)},'saSDICode':{'type':Sequelize[_0xf153('0x2')](0x15)},'saFiscalMessage':{'type':Sequelize[_0xf153('0x2')],'set':function(_0x2bea70){this['setDataValue'](_0xf153('0x4'),_0x2bea70?_0x2bea70[_0xf153('0x5')](','):null);},'get':function(){return this[_0xf153('0x6')](_0xf153('0x4'))?this[_0xf153('0x6')](_0xf153('0x4'))[_0xf153('0x7')](','):[];}},'saExpiryDay':{'type':Sequelize[_0xf153('0x8')]},'saEurope':{'type':Sequelize[_0xf153('0x9')]},'saSocCap':{'type':Sequelize['STRING'](0xff)},'saPaymentMethod':{'type':Sequelize[_0xf153('0x8')]},'defaultEntry':{'type':Sequelize[_0xf153('0x9')],'defaultValue':![]},'vat':{'type':Sequelize[_0xf153('0x2')](0xff)}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index eee5326..a79c93d 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 _0x6051=['get','Companies','UserProfileResource','destroy','error','name','index','CmCompany','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','intersection','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','omit','getContacts','findOne','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','path','to-csv','lodash','squel','crypto','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','json','apply','reject','save','update','then'];(function(_0xf6e75d,_0xc70967){var _0x27514d=function(_0xc2c6dd){while(--_0xc2c6dd){_0xf6e75d['push'](_0xf6e75d['shift']());}};_0x27514d(++_0xc70967);}(_0x6051,0xd0));var _0x1605=function(_0x36a0a4,_0x7178d6){_0x36a0a4=_0x36a0a4-0x0;var _0x32d0b6=_0x6051[_0x36a0a4];return _0x32d0b6;};'use strict';var pdf=require(_0x1605('0x0'));var emlformat=require(_0x1605('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1605('0x2'));var rp=require(_0x1605('0x3'));var moment=require('moment');var BPromise=require(_0x1605('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1605('0x5'));var sox=require('sox');var csv=require(_0x1605('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1605('0x7'));var squel=require(_0x1605('0x8'));var crypto=require(_0x1605('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1605('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1605('0xa'));var authService=require(_0x1605('0xb'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x1605('0xc'));var logger=require(_0x1605('0xd'))('api');var utils=require(_0x1605('0xe'));var config=require(_0x1605('0xf'));var db=require(_0x1605('0x10'))['db'];function respondWithStatusCode(_0x4fb04d,_0x538928){_0x538928=_0x538928||0xcc;return function(_0x52a244){if(_0x52a244){return _0x4fb04d[_0x1605('0x11')](_0x538928);}return _0x4fb04d[_0x1605('0x12')](_0x538928)[_0x1605('0x13')]();};}function respondWithResult(_0x4ef669,_0x11a758){_0x11a758=_0x11a758||0xc8;return function(_0x15f606){if(_0x15f606){return _0x4ef669['status'](_0x11a758)['json'](_0x15f606);}};}function respondWithFilteredResult(_0x31526d,_0x13572d){return function(_0x35b8d1){if(_0x35b8d1){var _0x13feac=_0x35b8d1['count'],_0x179e74=_0x13572d[_0x1605('0x14')],_0x326fe0=_0x13572d[_0x1605('0x14')]+_0x13572d['limit'],_0x5c1af0;if(_0x326fe0>=_0x13feac){_0x326fe0=_0x13feac;_0x5c1af0=0xc8;}else{_0x5c1af0=0xce;}_0x31526d['status'](_0x5c1af0);return _0x31526d[_0x1605('0x15')](_0x1605('0x16'),_0x179e74+'-'+_0x326fe0+'/'+_0x13feac)[_0x1605('0x17')](_0x35b8d1);}return null;};}function patchUpdates(_0x556b86){return function(_0x28df5f){try{jsonpatch[_0x1605('0x18')](_0x28df5f,_0x556b86,!![]);}catch(_0x566cca){return BPromise[_0x1605('0x19')](_0x566cca);}return _0x28df5f[_0x1605('0x1a')]();};}function saveUpdates(_0x4f65ee,_0x283c51){return function(_0x4e4e2e){if(_0x4e4e2e){return _0x4e4e2e[_0x1605('0x1b')](_0x4f65ee)[_0x1605('0x1c')](function(_0x1e4b51){return _0x1e4b51;});}return null;};}function removeEntity(_0x5a1856,_0x376647){return function(_0x3c3760){if(_0x3c3760){return _0x3c3760['destroy']()[_0x1605('0x1c')](function(){var _0x2a4e6d=_0x3c3760[_0x1605('0x1d')]({'plain':!![]});var _0x59d013=_0x1605('0x1e');return db[_0x1605('0x1f')][_0x1605('0x20')]({'where':{'type':_0x59d013,'resourceId':_0x2a4e6d['id']}})[_0x1605('0x1c')](function(){return _0x3c3760;});})[_0x1605('0x1c')](function(){_0x5a1856[_0x1605('0x12')](0xcc)[_0x1605('0x13')]();});}};}function handleEntityNotFound(_0x1ffd47,_0x1c6e0f){return function(_0x3d741a){if(!_0x3d741a){_0x1ffd47[_0x1605('0x11')](0x194);}return _0x3d741a;};}function handleError(_0x950c6a,_0x48dacb){_0x48dacb=_0x48dacb||0x1f4;return function(_0x1ae048){logger[_0x1605('0x21')](_0x1ae048['stack']);if(_0x1ae048[_0x1605('0x22')]){delete _0x1ae048[_0x1605('0x22')];}_0x950c6a['status'](_0x48dacb)['send'](_0x1ae048);};}exports[_0x1605('0x23')]=function(_0x2fab7f,_0x931656){var _0x196421={},_0x23c16a={},_0x5597cc={'count':0x0,'rows':[]};var _0x377e6a=db[_0x1605('0x24')][_0x1605('0x25')];_0x23c16a[_0x1605('0x26')]=_[_0x1605('0x27')](_0x377e6a);_0x23c16a[_0x1605('0x28')]=_[_0x1605('0x27')](_0x2fab7f[_0x1605('0x28')]);_0x23c16a[_0x1605('0x29')]=_['intersection'](_0x23c16a[_0x1605('0x26')],_0x23c16a[_0x1605('0x28')]);_0x196421[_0x1605('0x2a')]=_['intersection'](_0x23c16a['model'],qs[_0x1605('0x2b')](_0x2fab7f[_0x1605('0x28')][_0x1605('0x2b')]));_0x196421[_0x1605('0x2a')]=_0x196421['attributes'][_0x1605('0x2c')]?_0x196421[_0x1605('0x2a')]:_0x23c16a[_0x1605('0x26')];if(!_0x2fab7f['query'][_0x1605('0x2d')](_0x1605('0x2e'))){_0x196421[_0x1605('0x2f')]=qs[_0x1605('0x2f')](_0x2fab7f['query'][_0x1605('0x2f')]);_0x196421[_0x1605('0x14')]=qs[_0x1605('0x14')](_0x2fab7f[_0x1605('0x28')][_0x1605('0x14')]);}_0x196421[_0x1605('0x30')]=qs['sort'](_0x2fab7f[_0x1605('0x28')][_0x1605('0x31')]);_0x196421[_0x1605('0x32')]=qs[_0x1605('0x29')](_[_0x1605('0x33')](_0x2fab7f[_0x1605('0x28')],_0x23c16a[_0x1605('0x29')]));if(_0x2fab7f[_0x1605('0x28')][_0x1605('0x34')]){_0x196421[_0x1605('0x32')]=_[_0x1605('0x35')](_0x196421[_0x1605('0x32')],{'$or':_[_0x1605('0x36')](_0x377e6a,function(_0x3916ef){if(_0x3916ef[_0x1605('0x37')]['key']!==_0x1605('0x38')){var _0x4f3a72={};_0x4f3a72[_0x3916ef[_0x1605('0x39')]]={'$like':'%'+_0x2fab7f[_0x1605('0x28')][_0x1605('0x34')]+'%'};return _0x4f3a72;}})});}_0x196421=_[_0x1605('0x35')]({},_0x196421,_0x2fab7f[_0x1605('0x3a')]);var _0x4eb3a2={'where':_0x196421[_0x1605('0x32')]};return db[_0x1605('0x24')]['count'](_0x4eb3a2)[_0x1605('0x1c')](function(_0x45d7c5){_0x5597cc['count']=_0x45d7c5;if(_0x2fab7f[_0x1605('0x28')][_0x1605('0x3b')]){_0x196421[_0x1605('0x3c')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x196421);})[_0x1605('0x1c')](function(_0x95f9e9){_0x5597cc[_0x1605('0x3d')]=_0x95f9e9;return _0x5597cc;})['then'](respondWithFilteredResult(_0x931656,_0x196421))[_0x1605('0x3e')](handleError(_0x931656,null));};exports[_0x1605('0x3f')]=function(_0x138011,_0x3112e3){var _0x4623c5={'raw':![],'where':{'id':_0x138011[_0x1605('0x40')]['id']}},_0x3d5352={};_0x3d5352['model']=_['keys'](db[_0x1605('0x24')]['rawAttributes']);_0x3d5352['query']=_[_0x1605('0x27')](_0x138011[_0x1605('0x28')]);_0x3d5352['filters']=_[_0x1605('0x41')](_0x3d5352[_0x1605('0x26')],_0x3d5352[_0x1605('0x28')]);_0x4623c5[_0x1605('0x2a')]=_[_0x1605('0x41')](_0x3d5352[_0x1605('0x26')],qs[_0x1605('0x2b')](_0x138011[_0x1605('0x28')][_0x1605('0x2b')]));_0x4623c5[_0x1605('0x2a')]=_0x4623c5[_0x1605('0x2a')]['length']?_0x4623c5['attributes']:_0x3d5352[_0x1605('0x26')];if(_0x138011[_0x1605('0x28')]['includeAll']){_0x4623c5[_0x1605('0x3c')]=[{'all':!![]}];}_0x4623c5=_[_0x1605('0x35')]({},_0x4623c5,_0x138011[_0x1605('0x3a')]);return db[_0x1605('0x24')][_0x1605('0x42')](_0x4623c5)[_0x1605('0x1c')](handleEntityNotFound(_0x3112e3,null))[_0x1605('0x1c')](respondWithResult(_0x3112e3,null))[_0x1605('0x3e')](handleError(_0x3112e3,null));};exports[_0x1605('0x43')]=function(_0x35749b,_0x12403c){return db['CmCompany'][_0x1605('0x43')](_0x35749b[_0x1605('0x44')],{})[_0x1605('0x1c')](function(_0x1bb3e9){var _0x31acc8=_0x35749b['user'][_0x1605('0x1d')]({'plain':!![]});if(!_0x31acc8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31acc8['role']===_0x1605('0x45')){var _0x420bd1=_0x1bb3e9[_0x1605('0x1d')]({'plain':!![]});var _0x135dea=_0x1605('0x1e');return db[_0x1605('0x46')]['find']({'where':{'name':_0x135dea,'userProfileId':_0x31acc8[_0x1605('0x47')]},'raw':!![]})['then'](function(_0x3a7079){if(_0x3a7079&&_0x3a7079[_0x1605('0x48')]===0x0){return db[_0x1605('0x1f')][_0x1605('0x43')]({'name':_0x420bd1[_0x1605('0x22')],'resourceId':_0x420bd1['id'],'type':_0x3a7079[_0x1605('0x22')],'sectionId':_0x3a7079['id']},{})[_0x1605('0x1c')](function(){return _0x1bb3e9;});}else{return _0x1bb3e9;}})[_0x1605('0x3e')](function(_0x4ee7ea){logger[_0x1605('0x21')](_0x1605('0x49'),_0x4ee7ea);throw _0x4ee7ea;});}return _0x1bb3e9;})[_0x1605('0x1c')](respondWithResult(_0x12403c,0xc9))[_0x1605('0x3e')](handleError(_0x12403c,null));};exports[_0x1605('0x1b')]=function(_0x3744d0,_0x3edf13){if(_0x3744d0[_0x1605('0x44')]['id']){delete _0x3744d0[_0x1605('0x44')]['id'];}return db[_0x1605('0x24')][_0x1605('0x42')]({'where':{'id':_0x3744d0['params']['id']}})[_0x1605('0x1c')](handleEntityNotFound(_0x3edf13,null))[_0x1605('0x1c')](saveUpdates(_0x3744d0['body'],null))['then'](respondWithResult(_0x3edf13,null))['catch'](handleError(_0x3edf13,null));};exports['destroy']=function(_0xca8a04,_0x1fea92){return db[_0x1605('0x24')][_0x1605('0x42')]({'where':{'id':_0xca8a04[_0x1605('0x40')]['id']}})[_0x1605('0x1c')](handleEntityNotFound(_0x1fea92,null))['then'](removeEntity(_0x1fea92,null))['catch'](handleError(_0x1fea92,null));};exports[_0x1605('0x4a')]=function(_0x22adaf,_0x4703e7,_0x158fc5){return db[_0x1605('0x4b')][_0x1605('0x42')]({'where':{'id':_0x22adaf[_0x1605('0x40')]['id']}})[_0x1605('0x1c')](handleEntityNotFound(_0x4703e7,null))[_0x1605('0x1c')](function(_0xd1154e){if(_0xd1154e){return _0xd1154e[_0x1605('0x4a')](_0x22adaf[_0x1605('0x44')]['ids'],_[_0x1605('0x4c')](_0x22adaf['body'],['ids','id'])||{});}})[_0x1605('0x1c')](respondWithResult(_0x4703e7,null))['catch'](handleError(_0x4703e7,null));};exports[_0x1605('0x4d')]=function(_0x11faf9,_0x166d63,_0x1a6202){var _0xdb2782={};var _0x2c1395={};var _0x5e1896;var _0x382235;return db['CmCompany'][_0x1605('0x4e')]({'where':{'id':_0x11faf9[_0x1605('0x40')]['id']}})[_0x1605('0x1c')](handleEntityNotFound(_0x166d63,null))[_0x1605('0x1c')](function(_0x2476b0){if(_0x2476b0){_0x5e1896=_0x2476b0;_0x2c1395['model']=_[_0x1605('0x27')](db[_0x1605('0x4b')][_0x1605('0x25')]);_0x2c1395[_0x1605('0x28')]=_['keys'](_0x11faf9['query']);_0x2c1395[_0x1605('0x29')]=_[_0x1605('0x41')](_0x2c1395[_0x1605('0x26')],_0x2c1395['query']);_0xdb2782[_0x1605('0x2a')]=_[_0x1605('0x41')](_0x2c1395[_0x1605('0x26')],qs[_0x1605('0x2b')](_0x11faf9['query'][_0x1605('0x2b')]));_0xdb2782['attributes']=_0xdb2782['attributes'][_0x1605('0x2c')]?_0xdb2782[_0x1605('0x2a')]:_0x2c1395[_0x1605('0x26')];_0xdb2782[_0x1605('0x30')]=qs['sort'](_0x11faf9[_0x1605('0x28')][_0x1605('0x31')]);_0xdb2782[_0x1605('0x32')]=qs[_0x1605('0x29')](_[_0x1605('0x33')](_0x11faf9[_0x1605('0x28')],_0x2c1395[_0x1605('0x29')]));if(_0x11faf9[_0x1605('0x28')][_0x1605('0x34')]){_0xdb2782[_0x1605('0x32')]=_['merge'](_0xdb2782['where'],{'$or':_['map'](_0xdb2782[_0x1605('0x2a')],function(_0x1057b0){var _0x1a3e60={};_0x1a3e60[_0x1057b0]={'$like':'%'+_0x11faf9['query'][_0x1605('0x34')]+'%'};return _0x1a3e60;})});}_0xdb2782=_['merge']({},_0xdb2782,_0x11faf9[_0x1605('0x3a')]);return _0x5e1896[_0x1605('0x4d')](_0xdb2782);}})[_0x1605('0x1c')](function(_0x45213b){if(_0x45213b){_0x382235=_0x45213b[_0x1605('0x2c')];if(!_0x11faf9[_0x1605('0x28')][_0x1605('0x2d')]('nolimit')){_0xdb2782[_0x1605('0x2f')]=qs[_0x1605('0x2f')](_0x11faf9[_0x1605('0x28')][_0x1605('0x2f')]);_0xdb2782['offset']=qs[_0x1605('0x14')](_0x11faf9[_0x1605('0x28')][_0x1605('0x14')]);}return _0x5e1896[_0x1605('0x4d')](_0xdb2782);}})['then'](function(_0x5ae46d){if(_0x5ae46d){return _0x5ae46d?{'count':_0x382235,'rows':_0x5ae46d}:null;}})['then'](respondWithResult(_0x166d63,null))[_0x1605('0x3e')](handleError(_0x166d63,null));}; \ No newline at end of file +var _0x24bf=['stack','name','send','CmCompany','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','where','pick','filter','merge','map','type','VIRTUAL','field','options','include','show','params','rawAttributes','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','findOne','getContacts','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','Companies','UserProfileResource','sendStatus','error'];(function(_0xba6506,_0x46cee1){var _0x35d610=function(_0x454cba){while(--_0x454cba){_0xba6506['push'](_0xba6506['shift']());}};_0x35d610(++_0x46cee1);}(_0x24bf,0x7d));var _0xf24b=function(_0xca5fbd,_0x479c8e){_0xca5fbd=_0xca5fbd-0x0;var _0x5ee881=_0x24bf[_0xca5fbd];return _0x5ee881;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf24b('0x0'));var rimraf=require(_0xf24b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf24b('0x2'));var rp=require(_0xf24b('0x3'));var moment=require(_0xf24b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf24b('0x5'));var util=require('util');var path=require(_0xf24b('0x6'));var sox=require('sox');var csv=require(_0xf24b('0x7'));var ejs=require(_0xf24b('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf24b('0x9'));var deskjs=require(_0xf24b('0xa'));var toCsv=require(_0xf24b('0x7'));var querystring=require('querystring');var Papa=require(_0xf24b('0xb'));var Redis=require(_0xf24b('0xc'));var authService=require(_0xf24b('0xd'));var qs=require(_0xf24b('0xe'));var hardwareService=require(_0xf24b('0xf'));var logger=require('../../config/logger')(_0xf24b('0x10'));var utils=require(_0xf24b('0x11'));var config=require(_0xf24b('0x12'));var db=require(_0xf24b('0x13'))['db'];function respondWithStatusCode(_0x4d8d45,_0x17d7c6){_0x17d7c6=_0x17d7c6||0xcc;return function(_0x204e0d){if(_0x204e0d){return _0x4d8d45['sendStatus'](_0x17d7c6);}return _0x4d8d45[_0xf24b('0x14')](_0x17d7c6)[_0xf24b('0x15')]();};}function respondWithResult(_0x3644e0,_0x4e720f){_0x4e720f=_0x4e720f||0xc8;return function(_0x1b5efd){if(_0x1b5efd){return _0x3644e0[_0xf24b('0x14')](_0x4e720f)[_0xf24b('0x16')](_0x1b5efd);}};}function respondWithFilteredResult(_0x5bb955,_0x680a10){return function(_0x4b897c){if(_0x4b897c){var _0x511402=_0x4b897c[_0xf24b('0x17')],_0x513c95=_0x680a10['offset'],_0x821c74=_0x680a10[_0xf24b('0x18')]+_0x680a10['limit'],_0x3c5026;if(_0x821c74>=_0x511402){_0x821c74=_0x511402;_0x3c5026=0xc8;}else{_0x3c5026=0xce;}_0x5bb955[_0xf24b('0x14')](_0x3c5026);return _0x5bb955[_0xf24b('0x19')](_0xf24b('0x1a'),_0x513c95+'-'+_0x821c74+'/'+_0x511402)[_0xf24b('0x16')](_0x4b897c);}return null;};}function patchUpdates(_0x55a5b7){return function(_0x2a685d){try{jsonpatch[_0xf24b('0x1b')](_0x2a685d,_0x55a5b7,!![]);}catch(_0x218436){return BPromise[_0xf24b('0x1c')](_0x218436);}return _0x2a685d[_0xf24b('0x1d')]();};}function saveUpdates(_0xcc1186,_0x4e5e82){return function(_0x24dfb1){if(_0x24dfb1){return _0x24dfb1[_0xf24b('0x1e')](_0xcc1186)[_0xf24b('0x1f')](function(_0x5999c1){return _0x5999c1;});}return null;};}function removeEntity(_0x4affd6,_0x54e0a3){return function(_0x538492){if(_0x538492){return _0x538492[_0xf24b('0x20')]()[_0xf24b('0x1f')](function(){var _0x29773d=_0x538492['get']({'plain':!![]});var _0x22508d=_0xf24b('0x21');return db[_0xf24b('0x22')][_0xf24b('0x20')]({'where':{'type':_0x22508d,'resourceId':_0x29773d['id']}})['then'](function(){return _0x538492;});})[_0xf24b('0x1f')](function(){_0x4affd6[_0xf24b('0x14')](0xcc)[_0xf24b('0x15')]();});}};}function handleEntityNotFound(_0x818ab4,_0x3b886b){return function(_0x3505e8){if(!_0x3505e8){_0x818ab4[_0xf24b('0x23')](0x194);}return _0x3505e8;};}function handleError(_0x58e6ec,_0x4e4052){_0x4e4052=_0x4e4052||0x1f4;return function(_0x1824c8){logger[_0xf24b('0x24')](_0x1824c8[_0xf24b('0x25')]);if(_0x1824c8[_0xf24b('0x26')]){delete _0x1824c8[_0xf24b('0x26')];}_0x58e6ec[_0xf24b('0x14')](_0x4e4052)[_0xf24b('0x27')](_0x1824c8);};}exports['index']=function(_0x47d8d2,_0x2a9283){var _0x364f35={},_0x3c5012={},_0x24e2db={'count':0x0,'rows':[]};var _0x3c229d=db[_0xf24b('0x28')]['rawAttributes'];_0x3c5012[_0xf24b('0x29')]=_[_0xf24b('0x2a')](_0x3c229d);_0x3c5012['query']=_[_0xf24b('0x2a')](_0x47d8d2[_0xf24b('0x2b')]);_0x3c5012[_0xf24b('0x2c')]=_[_0xf24b('0x2d')](_0x3c5012['model'],_0x3c5012['query']);_0x364f35['attributes']=_[_0xf24b('0x2d')](_0x3c5012[_0xf24b('0x29')],qs[_0xf24b('0x2e')](_0x47d8d2['query'][_0xf24b('0x2e')]));_0x364f35[_0xf24b('0x2f')]=_0x364f35['attributes'][_0xf24b('0x30')]?_0x364f35[_0xf24b('0x2f')]:_0x3c5012[_0xf24b('0x29')];if(!_0x47d8d2[_0xf24b('0x2b')][_0xf24b('0x31')](_0xf24b('0x32'))){_0x364f35[_0xf24b('0x33')]=qs[_0xf24b('0x33')](_0x47d8d2[_0xf24b('0x2b')]['limit']);_0x364f35[_0xf24b('0x18')]=qs[_0xf24b('0x18')](_0x47d8d2['query'][_0xf24b('0x18')]);}_0x364f35['order']=qs['sort'](_0x47d8d2[_0xf24b('0x2b')]['sort']);_0x364f35[_0xf24b('0x34')]=qs[_0xf24b('0x2c')](_[_0xf24b('0x35')](_0x47d8d2[_0xf24b('0x2b')],_0x3c5012[_0xf24b('0x2c')]));if(_0x47d8d2[_0xf24b('0x2b')][_0xf24b('0x36')]){_0x364f35[_0xf24b('0x34')]=_[_0xf24b('0x37')](_0x364f35[_0xf24b('0x34')],{'$or':_[_0xf24b('0x38')](_0x3c229d,function(_0x1f5b05){if(_0x1f5b05[_0xf24b('0x39')]['key']!==_0xf24b('0x3a')){var _0x50768f={};_0x50768f[_0x1f5b05[_0xf24b('0x3b')]]={'$like':'%'+_0x47d8d2[_0xf24b('0x2b')]['filter']+'%'};return _0x50768f;}})});}_0x364f35=_[_0xf24b('0x37')]({},_0x364f35,_0x47d8d2[_0xf24b('0x3c')]);var _0x1aa1f3={'where':_0x364f35[_0xf24b('0x34')]};return db['CmCompany'][_0xf24b('0x17')](_0x1aa1f3)[_0xf24b('0x1f')](function(_0x2879b0){_0x24e2db[_0xf24b('0x17')]=_0x2879b0;if(_0x47d8d2[_0xf24b('0x2b')]['includeAll']){_0x364f35[_0xf24b('0x3d')]=[{'all':!![]}];}return db[_0xf24b('0x28')]['findAll'](_0x364f35);})[_0xf24b('0x1f')](function(_0x3a5ad6){_0x24e2db['rows']=_0x3a5ad6;return _0x24e2db;})[_0xf24b('0x1f')](respondWithFilteredResult(_0x2a9283,_0x364f35))['catch'](handleError(_0x2a9283,null));};exports[_0xf24b('0x3e')]=function(_0x4d74e6,_0x45d521){var _0x94f53={'raw':![],'where':{'id':_0x4d74e6[_0xf24b('0x3f')]['id']}},_0x16523f={};_0x16523f['model']=_['keys'](db[_0xf24b('0x28')][_0xf24b('0x40')]);_0x16523f[_0xf24b('0x2b')]=_['keys'](_0x4d74e6[_0xf24b('0x2b')]);_0x16523f[_0xf24b('0x2c')]=_[_0xf24b('0x2d')](_0x16523f[_0xf24b('0x29')],_0x16523f[_0xf24b('0x2b')]);_0x94f53[_0xf24b('0x2f')]=_[_0xf24b('0x2d')](_0x16523f[_0xf24b('0x29')],qs[_0xf24b('0x2e')](_0x4d74e6['query'][_0xf24b('0x2e')]));_0x94f53[_0xf24b('0x2f')]=_0x94f53[_0xf24b('0x2f')][_0xf24b('0x30')]?_0x94f53[_0xf24b('0x2f')]:_0x16523f['model'];if(_0x4d74e6['query']['includeAll']){_0x94f53['include']=[{'all':!![]}];}_0x94f53=_[_0xf24b('0x37')]({},_0x94f53,_0x4d74e6['options']);return db[_0xf24b('0x28')][_0xf24b('0x41')](_0x94f53)[_0xf24b('0x1f')](handleEntityNotFound(_0x45d521,null))[_0xf24b('0x1f')](respondWithResult(_0x45d521,null))[_0xf24b('0x42')](handleError(_0x45d521,null));};exports[_0xf24b('0x43')]=function(_0x565aea,_0x4f1b25){return db[_0xf24b('0x28')]['create'](_0x565aea[_0xf24b('0x44')],{})['then'](function(_0x2e1f73){var _0x25127c=_0x565aea[_0xf24b('0x45')][_0xf24b('0x46')]({'plain':!![]});if(!_0x25127c)throw new Error(_0xf24b('0x47'));if(_0x25127c['role']===_0xf24b('0x45')){var _0x2c2a95=_0x2e1f73[_0xf24b('0x46')]({'plain':!![]});var _0x4b6bf0=_0xf24b('0x21');return db[_0xf24b('0x48')][_0xf24b('0x41')]({'where':{'name':_0x4b6bf0,'userProfileId':_0x25127c[_0xf24b('0x49')]},'raw':!![]})[_0xf24b('0x1f')](function(_0x444f7d){if(_0x444f7d&&_0x444f7d[_0xf24b('0x4a')]===0x0){return db[_0xf24b('0x22')][_0xf24b('0x43')]({'name':_0x2c2a95[_0xf24b('0x26')],'resourceId':_0x2c2a95['id'],'type':_0x444f7d[_0xf24b('0x26')],'sectionId':_0x444f7d['id']},{})['then'](function(){return _0x2e1f73;});}else{return _0x2e1f73;}})[_0xf24b('0x42')](function(_0x5c45c0){logger[_0xf24b('0x24')](_0xf24b('0x4b'),_0x5c45c0);throw _0x5c45c0;});}return _0x2e1f73;})[_0xf24b('0x1f')](respondWithResult(_0x4f1b25,0xc9))[_0xf24b('0x42')](handleError(_0x4f1b25,null));};exports[_0xf24b('0x1e')]=function(_0x1b01a0,_0x19428d){if(_0x1b01a0[_0xf24b('0x44')]['id']){delete _0x1b01a0[_0xf24b('0x44')]['id'];}return db[_0xf24b('0x28')][_0xf24b('0x41')]({'where':{'id':_0x1b01a0[_0xf24b('0x3f')]['id']}})[_0xf24b('0x1f')](handleEntityNotFound(_0x19428d,null))['then'](saveUpdates(_0x1b01a0[_0xf24b('0x44')],null))[_0xf24b('0x1f')](respondWithResult(_0x19428d,null))[_0xf24b('0x42')](handleError(_0x19428d,null));};exports[_0xf24b('0x20')]=function(_0x3e7d93,_0xb73771){return db['CmCompany']['find']({'where':{'id':_0x3e7d93['params']['id']}})[_0xf24b('0x1f')](handleEntityNotFound(_0xb73771,null))[_0xf24b('0x1f')](removeEntity(_0xb73771,null))[_0xf24b('0x42')](handleError(_0xb73771,null));};exports[_0xf24b('0x4c')]=function(_0x446d89,_0x205afb,_0x2ea8d4){return db[_0xf24b('0x4d')][_0xf24b('0x41')]({'where':{'id':_0x446d89[_0xf24b('0x3f')]['id']}})[_0xf24b('0x1f')](handleEntityNotFound(_0x205afb,null))[_0xf24b('0x1f')](function(_0x29b67c){if(_0x29b67c){return _0x29b67c[_0xf24b('0x4c')](_0x446d89[_0xf24b('0x44')]['ids'],_['omit'](_0x446d89['body'],[_0xf24b('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x205afb,null))[_0xf24b('0x42')](handleError(_0x205afb,null));};exports['getContacts']=function(_0x5d4fce,_0x1bb5d2,_0x1ec3f1){var _0xfaaa84={};var _0x1cb0bf={};var _0x333ed8;var _0x650f9d;return db[_0xf24b('0x28')][_0xf24b('0x4f')]({'where':{'id':_0x5d4fce[_0xf24b('0x3f')]['id']}})[_0xf24b('0x1f')](handleEntityNotFound(_0x1bb5d2,null))['then'](function(_0x447092){if(_0x447092){_0x333ed8=_0x447092;_0x1cb0bf[_0xf24b('0x29')]=_[_0xf24b('0x2a')](db[_0xf24b('0x4d')]['rawAttributes']);_0x1cb0bf[_0xf24b('0x2b')]=_[_0xf24b('0x2a')](_0x5d4fce['query']);_0x1cb0bf[_0xf24b('0x2c')]=_[_0xf24b('0x2d')](_0x1cb0bf['model'],_0x1cb0bf[_0xf24b('0x2b')]);_0xfaaa84[_0xf24b('0x2f')]=_[_0xf24b('0x2d')](_0x1cb0bf['model'],qs[_0xf24b('0x2e')](_0x5d4fce[_0xf24b('0x2b')]['fields']));_0xfaaa84[_0xf24b('0x2f')]=_0xfaaa84[_0xf24b('0x2f')][_0xf24b('0x30')]?_0xfaaa84[_0xf24b('0x2f')]:_0x1cb0bf[_0xf24b('0x29')];_0xfaaa84['order']=qs['sort'](_0x5d4fce[_0xf24b('0x2b')]['sort']);_0xfaaa84[_0xf24b('0x34')]=qs['filters'](_[_0xf24b('0x35')](_0x5d4fce[_0xf24b('0x2b')],_0x1cb0bf[_0xf24b('0x2c')]));if(_0x5d4fce['query'][_0xf24b('0x36')]){_0xfaaa84[_0xf24b('0x34')]=_[_0xf24b('0x37')](_0xfaaa84['where'],{'$or':_['map'](_0xfaaa84[_0xf24b('0x2f')],function(_0x249f3e){var _0x47b3e6={};_0x47b3e6[_0x249f3e]={'$like':'%'+_0x5d4fce[_0xf24b('0x2b')][_0xf24b('0x36')]+'%'};return _0x47b3e6;})});}_0xfaaa84=_[_0xf24b('0x37')]({},_0xfaaa84,_0x5d4fce[_0xf24b('0x3c')]);return _0x333ed8[_0xf24b('0x50')](_0xfaaa84);}})[_0xf24b('0x1f')](function(_0x8a8c38){if(_0x8a8c38){_0x650f9d=_0x8a8c38[_0xf24b('0x30')];if(!_0x5d4fce['query'][_0xf24b('0x31')]('nolimit')){_0xfaaa84[_0xf24b('0x33')]=qs[_0xf24b('0x33')](_0x5d4fce[_0xf24b('0x2b')][_0xf24b('0x33')]);_0xfaaa84[_0xf24b('0x18')]=qs[_0xf24b('0x18')](_0x5d4fce[_0xf24b('0x2b')]['offset']);}return _0x333ed8[_0xf24b('0x50')](_0xfaaa84);}})[_0xf24b('0x1f')](function(_0x445e0c){if(_0x445e0c){return _0x445e0c?{'count':_0x650f9d,'rows':_0x445e0c}:null;}})[_0xf24b('0x1f')](respondWithResult(_0x1bb5d2,null))['catch'](handleError(_0x1bb5d2,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 4d4960b..961925c 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 _0xe820=['exports','define','CmCompany','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment'];(function(_0x41cee2,_0x545eb8){var _0x4b0cca=function(_0x38d22b){while(--_0x38d22b){_0x41cee2['push'](_0x41cee2['shift']());}};_0x4b0cca(++_0x545eb8);}(_0xe820,0xd2));var _0x0e82=function(_0x50ab5d,_0x36203f){_0x50ab5d=_0x50ab5d-0x0;var _0x8aa615=_0xe820[_0x50ab5d];return _0x8aa615;};'use strict';var _=require(_0x0e82('0x0'));var util=require('util');var logger=require(_0x0e82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0e82('0x2'));var rp=require(_0x0e82('0x3'));var fs=require('fs');var path=require(_0x0e82('0x4'));var rimraf=require('rimraf');var config=require(_0x0e82('0x5'));var attributes=require('./cmCompany.attributes');module[_0x0e82('0x6')]=function(_0x105e3c,_0x69e27f){return _0x105e3c[_0x0e82('0x7')](_0x0e82('0x8'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7708=['../../config/environment','exports','define','CmCompany','cm_companies','lodash','util','api','rimraf'];(function(_0x58878a,_0x4d7636){var _0x1dd9a6=function(_0x16f33f){while(--_0x16f33f){_0x58878a['push'](_0x58878a['shift']());}};_0x1dd9a6(++_0x4d7636);}(_0x7708,0x188));var _0x8770=function(_0x421e36,_0x18776e){_0x421e36=_0x421e36-0x0;var _0x20b3e3=_0x7708[_0x421e36];return _0x20b3e3;};'use strict';var _=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var logger=require('../../config/logger')(_0x8770('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var attributes=require('./cmCompany.attributes');module[_0x8770('0x5')]=function(_0x50bab7,_0x31390d){return _0x50bab7[_0x8770('0x6')](_0x8770('0x7'),attributes,{'tableName':_0x8770('0x8'),'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 3ae2e26..0e94568 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 _0x15a8=['result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x15a8,0x7a));var _0x815a=function(_0xd36ebc,_0x135565){_0xd36ebc=_0xd36ebc-0x0;var _0x4d0035=_0x15a8[_0xd36ebc];return _0x4d0035;};'use strict';var _=require(_0x815a('0x0'));var util=require('util');var moment=require(_0x815a('0x1'));var BPromise=require('bluebird');var rs=require(_0x815a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x815a('0x3'))['db'];var utils=require(_0x815a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x815a('0x5'));var jayson=require(_0x815a('0x6'));var client=jayson[_0x815a('0x7')][_0x815a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4dc0a2,_0x39f205,_0x3bb60e){return new BPromise(function(_0x1ac219,_0x2638f1){return client['request'](_0x4dc0a2,_0x3bb60e)['then'](function(_0x2b0190){logger[_0x815a('0x9')](_0x815a('0xa'),_0x39f205,_0x815a('0xb'));logger[_0x815a('0xc')](_0x815a('0xd'),_0x39f205,_0x815a('0xb'),JSON[_0x815a('0xe')](_0x2b0190));if(_0x2b0190[_0x815a('0xf')]){if(_0x2b0190['error'][_0x815a('0x10')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x39f205,_0x2b0190[_0x815a('0xf')][_0x815a('0x11')]);return _0x2638f1(_0x2b0190[_0x815a('0xf')]['message']);}logger[_0x815a('0xf')]('CmCompany,\x20%s,\x20%s',_0x39f205,_0x2b0190['error']['message']);return _0x1ac219(_0x2b0190[_0x815a('0xf')][_0x815a('0x11')]);}else{logger[_0x815a('0x9')](_0x815a('0xa'),_0x39f205,'request\x20sent');_0x1ac219(_0x2b0190[_0x815a('0x12')][_0x815a('0x11')]);}})[_0x815a('0x13')](function(_0x417bc2){logger[_0x815a('0xf')](_0x815a('0xa'),_0x39f205,_0x417bc2);_0x2638f1(_0x417bc2);});});} \ No newline at end of file +var _0xa927=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xa927,0x1ab));var _0x7a92=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa927[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7a92('0x0'));var util=require(_0x7a92('0x1'));var moment=require(_0x7a92('0x2'));var BPromise=require('bluebird');var rs=require(_0x7a92('0x3'));var fs=require('fs');var Redis=require(_0x7a92('0x4'));var db=require(_0x7a92('0x5'))['db'];var utils=require(_0x7a92('0x6'));var logger=require(_0x7a92('0x7'))(_0x7a92('0x8'));var config=require(_0x7a92('0x9'));var jayson=require(_0x7a92('0xa'));var client=jayson[_0x7a92('0xb')][_0x7a92('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3b7e08,_0x3894e2,_0x407119){return new BPromise(function(_0x53346d,_0x4670d5){return client[_0x7a92('0xd')](_0x3b7e08,_0x407119)[_0x7a92('0xe')](function(_0x342066){logger['info'](_0x7a92('0xf'),_0x3894e2,_0x7a92('0x10'));logger['debug'](_0x7a92('0x11'),_0x3894e2,_0x7a92('0x10'),JSON['stringify'](_0x342066));if(_0x342066['error']){if(_0x342066[_0x7a92('0x12')][_0x7a92('0x13')]===0x1f4){logger[_0x7a92('0x12')](_0x7a92('0xf'),_0x3894e2,_0x342066[_0x7a92('0x12')]['message']);return _0x4670d5(_0x342066[_0x7a92('0x12')][_0x7a92('0x14')]);}logger[_0x7a92('0x12')](_0x7a92('0xf'),_0x3894e2,_0x342066[_0x7a92('0x12')][_0x7a92('0x14')]);return _0x53346d(_0x342066['error']['message']);}else{logger[_0x7a92('0x15')](_0x7a92('0xf'),_0x3894e2,_0x7a92('0x10'));_0x53346d(_0x342066[_0x7a92('0x16')]['message']);}})[_0x7a92('0x17')](function(_0xe2fe0b){logger['error'](_0x7a92('0xf'),_0x3894e2,_0xe2fe0b);_0x4670d5(_0xe2fe0b);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 9f19339..5a5d017 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 _0x4b24=['create','addContacts','put','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','isAuthenticated','get','/:id','show','/:id/contacts','post'];(function(_0x5a8225,_0x358770){var _0x395522=function(_0x4c9d48){while(--_0x4c9d48){_0x5a8225['push'](_0x5a8225['shift']());}};_0x395522(++_0x358770);}(_0x4b24,0x8a));var _0x44b2=function(_0x182f74,_0x48cfe5){_0x182f74=_0x182f74-0x0;var _0x3e5b04=_0x4b24[_0x182f74];return _0x3e5b04;};'use strict';var multer=require(_0x44b2('0x0'));var util=require(_0x44b2('0x1'));var path=require(_0x44b2('0x2'));var timeout=require(_0x44b2('0x3'));var express=require(_0x44b2('0x4'));var router=express['Router']();var auth=require(_0x44b2('0x5'));var interaction=require(_0x44b2('0x6'));var config=require('../../config/environment');var controller=require(_0x44b2('0x7'));router['get']('/',auth[_0x44b2('0x8')](),controller['index']);router[_0x44b2('0x9')](_0x44b2('0xa'),auth[_0x44b2('0x8')](),controller[_0x44b2('0xb')]);router['get'](_0x44b2('0xc'),auth[_0x44b2('0x8')](),controller['getContacts']);router[_0x44b2('0xd')]('/',auth[_0x44b2('0x8')](),controller[_0x44b2('0xe')]);router[_0x44b2('0xd')](_0x44b2('0xc'),auth[_0x44b2('0x8')](),controller[_0x44b2('0xf')]);router[_0x44b2('0x10')](_0x44b2('0xa'),auth[_0x44b2('0x8')](),controller['update']);router['delete'](_0x44b2('0xa'),auth['isAuthenticated'](),controller[_0x44b2('0x11')]);module[_0x44b2('0x12')]=router; \ No newline at end of file +var _0xbea5=['express','Router','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','/:id/contacts','getContacts','addContacts','put','/:id','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x4c6b9e,_0x467af9){var _0x339fbb=function(_0x50fac3){while(--_0x50fac3){_0x4c6b9e['push'](_0x4c6b9e['shift']());}};_0x339fbb(++_0x467af9);}(_0xbea5,0x177));var _0x5bea=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbea5[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x5bea('0x0'));var util=require(_0x5bea('0x1'));var path=require('path');var timeout=require(_0x5bea('0x2'));var express=require(_0x5bea('0x3'));var router=express[_0x5bea('0x4')]();var auth=require(_0x5bea('0x5'));var interaction=require(_0x5bea('0x6'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x5bea('0x7')]('/',auth['isAuthenticated'](),controller[_0x5bea('0x8')]);router['get']('/:id',auth[_0x5bea('0x9')](),controller['show']);router['get'](_0x5bea('0xa'),auth[_0x5bea('0x9')](),controller[_0x5bea('0xb')]);router['post']('/',auth[_0x5bea('0x9')](),controller['create']);router['post'](_0x5bea('0xa'),auth[_0x5bea('0x9')](),controller[_0x5bea('0xc')]);router[_0x5bea('0xd')](_0x5bea('0xe'),auth[_0x5bea('0x9')](),controller['update']);router[_0x5bea('0xf')](_0x5bea('0xe'),auth['isAuthenticated'](),controller[_0x5bea('0x10')]);module[_0x5bea('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index a7d5610..6ea8fc7 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 _0x2766=['lodash','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x4b7b9b,_0xa4aff9){var _0x3be710=function(_0x5b64fa){while(--_0x5b64fa){_0x4b7b9b['push'](_0x4b7b9b['shift']());}};_0x3be710(++_0xa4aff9);}(_0x2766,0x9c));var _0x6276=function(_0x523031,_0x355d4f){_0x523031=_0x523031-0x0;var _0x2c0acc=_0x2766[_0x523031];return _0x2c0acc;};'use strict';var _=require(_0x6276('0x0'));var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize[_0x6276('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0x6276('0x1')]},'street':{'type':Sequelize[_0x6276('0x1')]},'postalCode':{'type':Sequelize[_0x6276('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6276('0x2')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x6276('0x1')]},'fax':{'type':Sequelize[_0x6276('0x1')]},'email':{'type':Sequelize[_0x6276('0x1')]},'url':{'type':Sequelize[_0x6276('0x1')]},'facebook':{'type':Sequelize[_0x6276('0x1')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x6276('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x6276('0x1')]},'wechat':{'type':Sequelize[_0x6276('0x1')]},'telegram':{'type':Sequelize[_0x6276('0x1')]},'UserId':{'type':Sequelize[_0x6276('0x3')]},'priority':{'type':Sequelize[_0x6276('0x3')](0x2)[_0x6276('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x6276('0x5')]}}; \ No newline at end of file +var _0x465c=['TEXT','INTEGER','UNSIGNED','DATE','NOW','sequelize','exports','STRING'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x465c,0x16d));var _0xc465=function(_0x5448a9,_0x325db1){_0x5448a9=_0x5448a9-0x0;var _0xb38d1c=_0x465c[_0x5448a9];return _0xb38d1c;};'use strict';var _=require('lodash');var Sequelize=require(_0xc465('0x0'));module[_0xc465('0x1')]={'firstName':{'type':Sequelize[_0xc465('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xc465('0x2')]},'postalCode':{'type':Sequelize[_0xc465('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xc465('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc465('0x3')]},'phone':{'type':Sequelize[_0xc465('0x2')]},'mobile':{'type':Sequelize[_0xc465('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xc465('0x2')]},'url':{'type':Sequelize[_0xc465('0x2')]},'facebook':{'type':Sequelize[_0xc465('0x2')]},'fb_data':{'type':Sequelize[_0xc465('0x2')]},'twitter':{'type':Sequelize[_0xc465('0x2')]},'skype':{'type':Sequelize[_0xc465('0x2')]},'teams':{'type':Sequelize[_0xc465('0x2')]},'viber':{'type':Sequelize[_0xc465('0x2')]},'line':{'type':Sequelize[_0xc465('0x2')]},'wechat':{'type':Sequelize[_0xc465('0x2')]},'telegram':{'type':Sequelize[_0xc465('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xc465('0x4')](0x2)[_0xc465('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xc465('0x6')],'defaultValue':Sequelize[_0xc465('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 4ba9fa1..de28c97 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 _0x436b=['isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','DESC','group','c.id','Sequelize','SELECT','clone','COUNT(*)','tag','having','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','sequelize','keyBy','toString','count','merge','c.*','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','split','catch','find','params','describe','startsWith','cf_','columnName','displayName','findAll','alias','custom','values','body','get','mergeWith','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailMessage','MailInteraction','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','each','duplicates','$or','push','findOrCreate','Tag','$and','CmCustomField','format','cf_%d','table','setFields','id\x20=\x20?','toParam','phone','findOne','rawAttributes','options','nolimit','getTags','setTags','ids','getHoppers','ContactId','rows','getHopperHistories','includeAll','include','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','child_process','../../components/import/cm/csv','CompanyId','json','pid','upload','createReadStream','meta','import','binding','fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','jsforce','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','status','offset','limit','apply','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','CmContact','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','field','color','select','from','cm_contacts','c.deletedAt\x20IS\x20NULL','expr','advancedFilter','parse','condition','isArray','value','and','\x20IN\x20?','tableAlias','\x20=\x20?','LIKE','\x20LIKE\x20?','\x20>\x20?','\x20<\x20?','map','filter','isNil','isEmpty','forEach','ListId','concat','replace','\x27\x27\x27\x27'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x436b,0x164));var _0xb436=function(_0x475993,_0x844c92){_0x475993=_0x475993-0x0;var _0x237a25=_0x436b[_0x475993];return _0x237a25;};'use strict';var pdf=require(_0xb436('0x0'));var emlformat=require(_0xb436('0x1'));var rimraf=require(_0xb436('0x2'));var zipdir=require(_0xb436('0x3'));var jsonpatch=require(_0xb436('0x4'));var rp=require(_0xb436('0x5'));var moment=require(_0xb436('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xb436('0x7'));var util=require(_0xb436('0x8'));var path=require(_0xb436('0x9'));var sox=require(_0xb436('0xa'));var csv=require(_0xb436('0xb'));var ejs=require(_0xb436('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb436('0xd'));var crypto=require('crypto');var jsforce=require(_0xb436('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb436('0xb'));var querystring=require('querystring');var Papa=require(_0xb436('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb436('0x10'));var hardwareService=require(_0xb436('0x11'));var logger=require(_0xb436('0x12'))('api');var utils=require(_0xb436('0x13'));var config=require('../../config/environment');var db=require(_0xb436('0x14'))['db'];config[_0xb436('0x15')]=_[_0xb436('0x16')](config[_0xb436('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xb436('0x17'))(new Redis(config[_0xb436('0x15')]));require('./cmContact.socket')['register'](socket);function respondWithStatusCode(_0x3ed15b,_0x5c6baa){_0x5c6baa=_0x5c6baa||0xcc;return function(_0x22e597){if(_0x22e597){return _0x3ed15b['sendStatus'](_0x5c6baa);}return _0x3ed15b[_0xb436('0x18')](_0x5c6baa)['end']();};}function respondWithResult(_0xdd9dc6,_0x5b486e){_0x5b486e=_0x5b486e||0xc8;return function(_0x342c43){if(_0x342c43){return _0xdd9dc6['status'](_0x5b486e)['json'](_0x342c43);}};}function respondWithFilteredResult(_0x2a79e2,_0x23cf41){return function(_0x492cb4){if(_0x492cb4){var _0x15d3c4=_0x492cb4['count'],_0x28f61b=_0x23cf41[_0xb436('0x19')],_0x2ee490=_0x23cf41[_0xb436('0x19')]+_0x23cf41[_0xb436('0x1a')],_0x5a5d72;if(_0x2ee490>=_0x15d3c4){_0x2ee490=_0x15d3c4;_0x5a5d72=0xc8;}else{_0x5a5d72=0xce;}_0x2a79e2[_0xb436('0x18')](_0x5a5d72);return _0x2a79e2['set']('Content-Range',_0x28f61b+'-'+_0x2ee490+'/'+_0x15d3c4)['json'](_0x492cb4);}return null;};}function patchUpdates(_0x373223){return function(_0x4b38de){try{jsonpatch[_0xb436('0x1b')](_0x4b38de,_0x373223,!![]);}catch(_0x423639){return BPromise['reject'](_0x423639);}return _0x4b38de[_0xb436('0x1c')]();};}function saveUpdates(_0x5d90da,_0x5ad57b){return function(_0xdc1f40){if(_0xdc1f40){return _0xdc1f40[_0xb436('0x1d')](_0x5d90da)['then'](function(_0x45816d){return _0x45816d;});}return null;};}function removeEntity(_0x8a3d50,_0x989ca3){return function(_0x207a6f){if(_0x207a6f){return _0x207a6f[_0xb436('0x1e')]()[_0xb436('0x1f')](function(){_0x8a3d50[_0xb436('0x18')](0xcc)[_0xb436('0x20')]();});}};}function handleEntityNotFound(_0x1ee877,_0x1eb840){return function(_0x5adc81){if(!_0x5adc81){_0x1ee877[_0xb436('0x21')](0x194);}return _0x5adc81;};}function handleError(_0x3cb33a,_0x20cb40){_0x20cb40=_0x20cb40||0x1f4;return function(_0x1e5df9){logger[_0xb436('0x22')](_0x1e5df9[_0xb436('0x23')]);if(_0x1e5df9[_0xb436('0x24')]){delete _0x1e5df9[_0xb436('0x24')];}_0x3cb33a['status'](_0x20cb40)[_0xb436('0x25')](_0x1e5df9);};}exports[_0xb436('0x26')]=function(_0x477929,_0x18969b){var _0xfb32b0={},_0x1dfbc7={},_0x46aa75={'count':0x0,'rows':[]};return db[_0xb436('0x27')]['describe']()['then'](function(_0x40c5c0){_0x1dfbc7[_0xb436('0x28')]=_['keys'](_0x40c5c0);_0x1dfbc7['query']=_[_0xb436('0x29')](_0x477929[_0xb436('0x2a')]);_0x1dfbc7[_0xb436('0x2b')]=_[_0xb436('0x2c')](_0x1dfbc7[_0xb436('0x28')],_0x1dfbc7[_0xb436('0x2a')]);_0xfb32b0['attributes']=_[_0xb436('0x2c')](_0x1dfbc7['model'],qs['fields'](_0x477929[_0xb436('0x2a')][_0xb436('0x2d')]));_0xfb32b0[_0xb436('0x2e')]=_0xfb32b0[_0xb436('0x2e')][_0xb436('0x2f')]?_0xfb32b0[_0xb436('0x2e')]:_0x1dfbc7[_0xb436('0x28')];if(!_0x477929[_0xb436('0x2a')][_0xb436('0x30')]('nolimit')){_0xfb32b0[_0xb436('0x1a')]=qs[_0xb436('0x1a')](_0x477929[_0xb436('0x2a')][_0xb436('0x1a')]);_0xfb32b0[_0xb436('0x19')]=qs[_0xb436('0x19')](_0x477929[_0xb436('0x2a')][_0xb436('0x19')]);}_0xfb32b0[_0xb436('0x31')]=qs[_0xb436('0x32')](_0x477929[_0xb436('0x2a')][_0xb436('0x32')]);_0xfb32b0[_0xb436('0x33')]=qs[_0xb436('0x2b')](_[_0xb436('0x34')](_0x477929[_0xb436('0x2a')],_0x1dfbc7['filters']));var _0x1bb556=[];var _0x2a8c36=squel['select']()[_0xb436('0x35')]('id')['field']('name')[_0xb436('0x35')](_0xb436('0x36'))['from']('tools_tags');var _0x366af5=squel[_0xb436('0x37')]()[_0xb436('0x38')](_0xb436('0x39'),'c')[_0xb436('0x33')](_0xb436('0x3a'));var _0x5f17b1=squel[_0xb436('0x3b')]();if(_0x477929[_0xb436('0x2a')][_0xb436('0x3c')]){var _0x1cc9ef=JSON[_0xb436('0x3d')](_0x477929['query']['advancedFilter']);_[_0xb436('0x29')](_0x1cc9ef)['forEach'](function(_0xdbcccf){var _0x25160d=_0x1cc9ef[_0xdbcccf];switch(_0x25160d[_0xb436('0x3e')]){case'IS':if(_[_0xb436('0x3f')](_0x25160d[_0xb436('0x40')])&&_0x25160d[_0xb436('0x40')][_0xb436('0x2f')]>0x1){_0x5f17b1[_0xb436('0x41')](_0x25160d['tableAlias']+'.'+_0xdbcccf+_0xb436('0x42'),_0x25160d['value']);}else{_0x5f17b1[_0xb436('0x41')](_0x25160d[_0xb436('0x43')]+'.'+_0xdbcccf+_0xb436('0x44'),_0x25160d['value'][0x0]);}break;case'=':_0x5f17b1['and'](_0x25160d[_0xb436('0x43')]+'.'+_0xdbcccf+_0xb436('0x44'),_0x25160d[_0xb436('0x40')]);break;case _0xb436('0x45'):_0x5f17b1[_0xb436('0x41')](_0x25160d['tableAlias']+'.'+_0xdbcccf+_0xb436('0x46'),'%'+_0x25160d[_0xb436('0x40')]+'%');break;case'>':_0x5f17b1[_0xb436('0x41')](_0x25160d[_0xb436('0x43')]+'.'+_0xdbcccf+_0xb436('0x47'),_0x25160d['value']);break;case'<':_0x5f17b1['and'](_0x25160d[_0xb436('0x43')]+'.'+_0xdbcccf+_0xb436('0x48'),_0x25160d[_0xb436('0x40')]);break;}});}else{var _0x5a4db2=_(Object['keys'](_0x477929[_0xb436('0x2a')]))[_0xb436('0x49')](function(_0x8e838b){return _0x40c5c0[_0xb436('0x30')](_0x8e838b)?_0x8e838b:undefined;})[_0xb436('0x4a')](function(_0x3a1c28){return!_[_0xb436('0x4b')](_0x3a1c28);})['value']();if(!_[_0xb436('0x4c')](_0x5a4db2)){_0x5a4db2[_0xb436('0x4d')](function(_0x14332c){if(_0x14332c===_0xb436('0x4e')){_0x366af5['where']('c.ListId\x20IN\x20?',[][_0xb436('0x4f')](_0x477929[_0xb436('0x2a')][_0x14332c]));}else{_0x366af5['where']('c.'+_0x14332c+'\x20=\x20?',_0x477929[_0xb436('0x2a')][_0x14332c]);}});}if(_0x477929[_0xb436('0x2a')][_0xb436('0x4a')]){var _0x5f33aa=_0x477929[_0xb436('0x2a')]['filter'][_0xb436('0x50')]('\x5c','\x5c\x5c')[_0xb436('0x50')]('\x27\x27',_0xb436('0x51'));if(qs[_0xb436('0x52')](_0x5f33aa)){_0x5f17b1['or'](_0xb436('0x53'),_0x5f33aa+'%');_0x5f17b1['or'](_0xb436('0x54'),_0x5f33aa+'%');_0x5f17b1['or'](_0xb436('0x55'),_0x5f33aa+'%');_0x5f17b1['or'](_0xb436('0x56'),_0x5f33aa+'%');}else if(qs['isEmail'](_0x5f33aa)){_0x5f17b1['or'](_0xb436('0x57'),_0x5f33aa+'%');}else{_0x5f17b1['or'](_0xb436('0x57'),_0x5f33aa+'%');_0x5f17b1['or'](_0xb436('0x58'),_0x5f33aa+'%');_0x5f17b1['or'](_0xb436('0x59'),_0x5f33aa+'%');}}}_0x366af5['where'](_0x5f17b1);if(_0xfb32b0['order']){_0xfb32b0[_0xb436('0x31')][_0xb436('0x4d')](function(_0x373a0f){_0x366af5[_0xb436('0x31')]('c.'+_0x373a0f[0x0],_0x373a0f[0x1]===_0xb436('0x5a')?![]:!![]);});}_0x366af5[_0xb436('0x5b')](_0xb436('0x5c'));var _0xd00aea={'type':db[_0xb436('0x5d')]['QueryTypes'][_0xb436('0x5e')],'raw':!![]};var _0x277029=_0x366af5[_0xb436('0x5f')]()[_0xb436('0x35')](_0xb436('0x60'));if(!_0x477929[_0xb436('0x2a')][_0xb436('0x3c')]){if(_0x477929[_0xb436('0x2a')]['tag']){var _0x21342e=_[_0xb436('0x3f')](_0x477929[_0xb436('0x2a')][_0xb436('0x61')])?_0x477929[_0xb436('0x2a')]['tag']:new Array(_0x477929[_0xb436('0x2a')]['tag']);var _0x522985=squel[_0xb436('0x3b')]();_0x21342e['forEach'](function(_0x4d1a46){_0x522985['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4d1a46+',%');});_0x366af5[_0xb436('0x62')](_0x522985);_0x277029[_0xb436('0x63')](_0xb436('0x64'),'ct',_0xb436('0x65'));_0x277029[_0xb436('0x63')](_0xb436('0x66'),'t',_0xb436('0x67'));_0x277029['where']('t.id\x20IN\x20?',_0x21342e);}}db[_0xb436('0x68')][_0xb436('0x2a')](_0x2a8c36['toString'](),_0xd00aea)[_0xb436('0x1f')](function(_0x3fa29b){_0x1bb556=_[_0xb436('0x69')](_0x3fa29b,'id');return db['sequelize']['query'](_0x277029[_0xb436('0x6a')](),_0xd00aea);})['then'](function(_0x52a9e5){_0x46aa75[_0xb436('0x6b')]=_0x52a9e5[_0xb436('0x2f')];_0xd00aea=_[_0xb436('0x6c')](_0xd00aea,{'model':db[_0xb436('0x27')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x366af5[_0xb436('0x35')](_0xb436('0x6d'));_0x366af5[_0xb436('0x35')](_0xb436('0x6e'),_0xb436('0x6f'));_0x366af5['left_join']('cm_contact_has_tags','ct',_0xb436('0x65'));_0x366af5[_0xb436('0x63')]('tools_tags','t',_0xb436('0x67'));if(_0xfb32b0[_0xb436('0x1a')]){_0x366af5['limit'](_0xfb32b0[_0xb436('0x1a')]);}if(_0xfb32b0[_0xb436('0x19')]){_0x366af5[_0xb436('0x19')](_0xfb32b0[_0xb436('0x19')]);}db[_0xb436('0x68')][_0xb436('0x2a')](_0x366af5['toString'](),_0xd00aea)[_0xb436('0x1f')](function(_0x5c07b2){_0x5c07b2[_0xb436('0x4d')](function(_0x65a352){if(_0x65a352[_0xb436('0x6f')]){_0x65a352[_0xb436('0x70')]=[];_0x65a352[_0xb436('0x6f')][_0xb436('0x71')](',')[_0xb436('0x4d')](function(_0x5f2600){_0x65a352[_0xb436('0x70')]['push'](_0x1bb556[_0x5f2600]);});}delete _0x65a352[_0xb436('0x6f')];});_0x46aa75['rows']=_0x5c07b2;return _0x46aa75;})[_0xb436('0x1f')](respondWithFilteredResult(_0x18969b,_0xfb32b0))[_0xb436('0x72')](handleError(_0x18969b,null));});});};exports['destroy']=function(_0x211c35,_0x223d24){return db[_0xb436('0x27')][_0xb436('0x73')]({'where':{'id':_0x211c35[_0xb436('0x74')]['id']}})[_0xb436('0x1f')](handleEntityNotFound(_0x223d24,null))[_0xb436('0x1f')](removeEntity(_0x223d24,null))[_0xb436('0x72')](handleError(_0x223d24,null));};exports[_0xb436('0x75')]=function(_0x3aad54,_0x8451bd){return db[_0xb436('0x27')][_0xb436('0x75')]()[_0xb436('0x1f')](function(_0x12cd63){for(var _0x5c860b=0x0;_0x5c860b\x20?','\x20<\x20?','keys','map','filter','isNil','ListId','c.ListId\x20IN\x20?','concat','replace','\x27\x27\x27\x27','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','DESC','c.id','Sequelize','QueryTypes','SELECT','clone','COUNT(*)','isArray','tag','having','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','left_join','t.id\x20=\x20ct.TagId','t.id\x20IN\x20?','sequelize','keyBy','toString','merge','c.*','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','split','push','rows','catch','destroy','find','params','startsWith','displayName','CmCustomField','findAll','cf_','columnName','alias','type','body','get','mergeWith','tags','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','join','bulkCreate','each','duplicates','$or','findOrCreate','Tag','$and','cf_%d','omit','format','isEmpty','table','setFields','id\x20=\x20?','text','values','phone','CmHopper','options','getTags','setTags','getHoppers','findOne','rawAttributes'];(function(_0x5abeeb,_0x3cb886){var _0x18b695=function(_0x11c92c){while(--_0x11c92c){_0x5abeeb['push'](_0x5abeeb['shift']());}};_0x18b695(++_0x3cb886);}(_0xb11b,0x1d3));var _0xbb11=function(_0x69062,_0x231f82){_0x69062=_0x69062-0x0;var _0x3dabab=_0xb11b[_0x69062];return _0x3dabab;};'use strict';var pdf=require(_0xbb11('0x0'));var emlformat=require(_0xbb11('0x1'));var rimraf=require(_0xbb11('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbb11('0x3'));var moment=require(_0xbb11('0x4'));var BPromise=require(_0xbb11('0x5'));var Mustache=require('mustache');var util=require(_0xbb11('0x6'));var path=require(_0xbb11('0x7'));var sox=require(_0xbb11('0x8'));var csv=require(_0xbb11('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbb11('0xa'));var squel=require(_0xbb11('0xb'));var crypto=require(_0xbb11('0xc'));var jsforce=require(_0xbb11('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbb11('0x9'));var querystring=require('querystring');var Papa=require(_0xbb11('0xe'));var Redis=require(_0xbb11('0xf'));var authService=require(_0xbb11('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb11('0x11'))(_0xbb11('0x12'));var utils=require(_0xbb11('0x13'));var config=require(_0xbb11('0x14'));var db=require('../../mysqldb')['db'];config[_0xbb11('0x15')]=_[_0xbb11('0x16')](config[_0xbb11('0x15')],{'host':_0xbb11('0x17'),'port':0x18eb});var socket=require(_0xbb11('0x18'))(new Redis(config[_0xbb11('0x15')]));require('./cmContact.socket')[_0xbb11('0x19')](socket);function respondWithStatusCode(_0x2d7c58,_0x281557){_0x281557=_0x281557||0xcc;return function(_0x3173a5){if(_0x3173a5){return _0x2d7c58[_0xbb11('0x1a')](_0x281557);}return _0x2d7c58[_0xbb11('0x1b')](_0x281557)[_0xbb11('0x1c')]();};}function respondWithResult(_0x388091,_0x592d2d){_0x592d2d=_0x592d2d||0xc8;return function(_0x2f2765){if(_0x2f2765){return _0x388091['status'](_0x592d2d)[_0xbb11('0x1d')](_0x2f2765);}};}function respondWithFilteredResult(_0x3f34ff,_0x406039){return function(_0x5aca79){if(_0x5aca79){var _0x1a9cb7=_0x5aca79[_0xbb11('0x1e')],_0x3da5a2=_0x406039[_0xbb11('0x1f')],_0x31ba66=_0x406039[_0xbb11('0x1f')]+_0x406039[_0xbb11('0x20')],_0x1a26e4;if(_0x31ba66>=_0x1a9cb7){_0x31ba66=_0x1a9cb7;_0x1a26e4=0xc8;}else{_0x1a26e4=0xce;}_0x3f34ff[_0xbb11('0x1b')](_0x1a26e4);return _0x3f34ff[_0xbb11('0x21')](_0xbb11('0x22'),_0x3da5a2+'-'+_0x31ba66+'/'+_0x1a9cb7)[_0xbb11('0x1d')](_0x5aca79);}return null;};}function patchUpdates(_0x2510a2){return function(_0x12c6e0){try{jsonpatch[_0xbb11('0x23')](_0x12c6e0,_0x2510a2,!![]);}catch(_0x2a2e10){return BPromise[_0xbb11('0x24')](_0x2a2e10);}return _0x12c6e0[_0xbb11('0x25')]();};}function saveUpdates(_0x2a306c,_0x463e9a){return function(_0x1f5ce3){if(_0x1f5ce3){return _0x1f5ce3[_0xbb11('0x26')](_0x2a306c)['then'](function(_0xb1a32){return _0xb1a32;});}return null;};}function removeEntity(_0x5bb4c3,_0x4c1c8e){return function(_0x3cf88a){if(_0x3cf88a){return _0x3cf88a['destroy']()[_0xbb11('0x27')](function(){_0x5bb4c3[_0xbb11('0x1b')](0xcc)[_0xbb11('0x1c')]();});}};}function handleEntityNotFound(_0x3d55d0,_0x397ec4){return function(_0x44cf82){if(!_0x44cf82){_0x3d55d0[_0xbb11('0x1a')](0x194);}return _0x44cf82;};}function handleError(_0x66c81,_0x1f3338){_0x1f3338=_0x1f3338||0x1f4;return function(_0x1fa92c){logger[_0xbb11('0x28')](_0x1fa92c['stack']);if(_0x1fa92c[_0xbb11('0x29')]){delete _0x1fa92c[_0xbb11('0x29')];}_0x66c81['status'](_0x1f3338)['send'](_0x1fa92c);};}exports['index']=function(_0x151702,_0x158385){var _0x3e198e={},_0xbf5771={},_0x30a0e0={'count':0x0,'rows':[]};return db[_0xbb11('0x2a')][_0xbb11('0x2b')]()[_0xbb11('0x27')](function(_0x43134f){_0xbf5771['model']=_['keys'](_0x43134f);_0xbf5771[_0xbb11('0x2c')]=_['keys'](_0x151702[_0xbb11('0x2c')]);_0xbf5771['filters']=_[_0xbb11('0x2d')](_0xbf5771[_0xbb11('0x2e')],_0xbf5771[_0xbb11('0x2c')]);_0x3e198e['attributes']=_['intersection'](_0xbf5771[_0xbb11('0x2e')],qs[_0xbb11('0x2f')](_0x151702['query']['fields']));_0x3e198e['attributes']=_0x3e198e[_0xbb11('0x30')][_0xbb11('0x31')]?_0x3e198e[_0xbb11('0x30')]:_0xbf5771[_0xbb11('0x2e')];if(!_0x151702[_0xbb11('0x2c')][_0xbb11('0x32')](_0xbb11('0x33'))){_0x3e198e['limit']=qs['limit'](_0x151702[_0xbb11('0x2c')][_0xbb11('0x20')]);_0x3e198e[_0xbb11('0x1f')]=qs['offset'](_0x151702[_0xbb11('0x2c')][_0xbb11('0x1f')]);}_0x3e198e[_0xbb11('0x34')]=qs[_0xbb11('0x35')](_0x151702[_0xbb11('0x2c')][_0xbb11('0x35')]);_0x3e198e[_0xbb11('0x36')]=qs[_0xbb11('0x37')](_[_0xbb11('0x38')](_0x151702[_0xbb11('0x2c')],_0xbf5771[_0xbb11('0x37')]));var _0x5141f8=[];var _0x45fe77=squel[_0xbb11('0x39')]()[_0xbb11('0x3a')]('id')[_0xbb11('0x3a')](_0xbb11('0x29'))[_0xbb11('0x3a')](_0xbb11('0x3b'))[_0xbb11('0x3c')](_0xbb11('0x3d'));var _0xe4b707=squel[_0xbb11('0x39')]()[_0xbb11('0x3c')](_0xbb11('0x3e'),'c')['where'](_0xbb11('0x3f'));var _0x27b25f=squel[_0xbb11('0x40')]();if(_0x151702[_0xbb11('0x2c')][_0xbb11('0x41')]){var _0x3ceb69=JSON[_0xbb11('0x42')](_0x151702[_0xbb11('0x2c')][_0xbb11('0x41')]);_['keys'](_0x3ceb69)[_0xbb11('0x43')](function(_0x31a0d4){var _0x1a566e=_0x3ceb69[_0x31a0d4];switch(_0x1a566e[_0xbb11('0x44')]){case'IS':if(_['isArray'](_0x1a566e[_0xbb11('0x45')])&&_0x1a566e[_0xbb11('0x45')][_0xbb11('0x31')]>0x1){_0x27b25f[_0xbb11('0x46')](_0x1a566e['tableAlias']+'.'+_0x31a0d4+_0xbb11('0x47'),_0x1a566e[_0xbb11('0x45')]);}else{_0x27b25f[_0xbb11('0x46')](_0x1a566e[_0xbb11('0x48')]+'.'+_0x31a0d4+'\x20=\x20?',_0x1a566e['value'][0x0]);}break;case'=':_0x27b25f[_0xbb11('0x46')](_0x1a566e['tableAlias']+'.'+_0x31a0d4+_0xbb11('0x49'),_0x1a566e['value']);break;case _0xbb11('0x4a'):_0x27b25f[_0xbb11('0x46')](_0x1a566e[_0xbb11('0x48')]+'.'+_0x31a0d4+_0xbb11('0x4b'),'%'+_0x1a566e[_0xbb11('0x45')]+'%');break;case'>':_0x27b25f[_0xbb11('0x46')](_0x1a566e[_0xbb11('0x48')]+'.'+_0x31a0d4+_0xbb11('0x4c'),_0x1a566e[_0xbb11('0x45')]);break;case'<':_0x27b25f[_0xbb11('0x46')](_0x1a566e['tableAlias']+'.'+_0x31a0d4+_0xbb11('0x4d'),_0x1a566e[_0xbb11('0x45')]);break;}});}else{var _0x3eec95=_(Object[_0xbb11('0x4e')](_0x151702[_0xbb11('0x2c')]))[_0xbb11('0x4f')](function(_0x27d659){return _0x43134f[_0xbb11('0x32')](_0x27d659)?_0x27d659:undefined;})[_0xbb11('0x50')](function(_0x349af5){return!_[_0xbb11('0x51')](_0x349af5);})['value']();if(!_['isEmpty'](_0x3eec95)){_0x3eec95['forEach'](function(_0x483ee0){if(_0x483ee0===_0xbb11('0x52')){_0xe4b707[_0xbb11('0x36')](_0xbb11('0x53'),[][_0xbb11('0x54')](_0x151702[_0xbb11('0x2c')][_0x483ee0]));}else{_0xe4b707[_0xbb11('0x36')]('c.'+_0x483ee0+'\x20=\x20?',_0x151702['query'][_0x483ee0]);}});}if(_0x151702['query']['filter']){var _0x2fff49=_0x151702[_0xbb11('0x2c')]['filter'][_0xbb11('0x55')]('\x5c','\x5c\x5c')[_0xbb11('0x55')]('\x27\x27',_0xbb11('0x56'));if(qs[_0xbb11('0x57')](_0x2fff49)){_0x27b25f['or'](_0xbb11('0x58'),_0x2fff49+'%');_0x27b25f['or'](_0xbb11('0x59'),_0x2fff49+'%');_0x27b25f['or']('c.mobile\x20LIKE\x20?',_0x2fff49+'%');_0x27b25f['or'](_0xbb11('0x5a'),_0x2fff49+'%');}else if(qs[_0xbb11('0x5b')](_0x2fff49)){_0x27b25f['or'](_0xbb11('0x5c'),_0x2fff49+'%');}else{_0x27b25f['or'](_0xbb11('0x5c'),_0x2fff49+'%');_0x27b25f['or'](_0xbb11('0x5d'),_0x2fff49+'%');_0x27b25f['or'](_0xbb11('0x5e'),_0x2fff49+'%');}}}_0xe4b707[_0xbb11('0x36')](_0x27b25f);if(_0x3e198e[_0xbb11('0x34')]){_0x3e198e[_0xbb11('0x34')]['forEach'](function(_0x57e522){_0xe4b707[_0xbb11('0x34')]('c.'+_0x57e522[0x0],_0x57e522[0x1]===_0xbb11('0x5f')?![]:!![]);});}_0xe4b707['group'](_0xbb11('0x60'));var _0x56157a={'type':db[_0xbb11('0x61')][_0xbb11('0x62')][_0xbb11('0x63')],'raw':!![]};var _0x284194=_0xe4b707[_0xbb11('0x64')]()[_0xbb11('0x3a')](_0xbb11('0x65'));if(!_0x151702[_0xbb11('0x2c')][_0xbb11('0x41')]){if(_0x151702['query']['tag']){var _0x52de2f=_[_0xbb11('0x66')](_0x151702[_0xbb11('0x2c')][_0xbb11('0x67')])?_0x151702['query'][_0xbb11('0x67')]:new Array(_0x151702[_0xbb11('0x2c')][_0xbb11('0x67')]);var _0x28fe0e=squel['expr']();_0x52de2f[_0xbb11('0x43')](function(_0x43cdcf){_0x28fe0e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x43cdcf+',%');});_0xe4b707[_0xbb11('0x68')](_0x28fe0e);_0x284194['left_join'](_0xbb11('0x69'),'ct',_0xbb11('0x6a'));_0x284194[_0xbb11('0x6b')]('tools_tags','t',_0xbb11('0x6c'));_0x284194['where'](_0xbb11('0x6d'),_0x52de2f);}}db[_0xbb11('0x6e')]['query'](_0x45fe77['toString'](),_0x56157a)[_0xbb11('0x27')](function(_0x573687){_0x5141f8=_[_0xbb11('0x6f')](_0x573687,'id');return db['sequelize'][_0xbb11('0x2c')](_0x284194[_0xbb11('0x70')](),_0x56157a);})['then'](function(_0x2ac9df){_0x30a0e0[_0xbb11('0x1e')]=_0x2ac9df[_0xbb11('0x31')];_0x56157a=_[_0xbb11('0x71')](_0x56157a,{'model':db[_0xbb11('0x2a')],'mapToModel':!![],'raw':!![],'nest':!![]});_0xe4b707[_0xbb11('0x3a')](_0xbb11('0x72'));_0xe4b707['field'](_0xbb11('0x73'),'TagIds');_0xe4b707[_0xbb11('0x6b')](_0xbb11('0x69'),'ct',_0xbb11('0x6a'));_0xe4b707[_0xbb11('0x6b')](_0xbb11('0x3d'),'t',_0xbb11('0x6c'));if(_0x3e198e[_0xbb11('0x20')]){_0xe4b707['limit'](_0x3e198e[_0xbb11('0x20')]);}if(_0x3e198e[_0xbb11('0x1f')]){_0xe4b707[_0xbb11('0x1f')](_0x3e198e[_0xbb11('0x1f')]);}db[_0xbb11('0x6e')][_0xbb11('0x2c')](_0xe4b707[_0xbb11('0x70')](),_0x56157a)[_0xbb11('0x27')](function(_0x3947f2){_0x3947f2[_0xbb11('0x43')](function(_0x4b404c){if(_0x4b404c[_0xbb11('0x74')]){_0x4b404c[_0xbb11('0x75')]=[];_0x4b404c[_0xbb11('0x74')][_0xbb11('0x76')](',')[_0xbb11('0x43')](function(_0x4ca4dd){_0x4b404c['Tags'][_0xbb11('0x77')](_0x5141f8[_0x4ca4dd]);});}delete _0x4b404c[_0xbb11('0x74')];});_0x30a0e0[_0xbb11('0x78')]=_0x3947f2;return _0x30a0e0;})['then'](respondWithFilteredResult(_0x158385,_0x3e198e))[_0xbb11('0x79')](handleError(_0x158385,null));});});};exports[_0xbb11('0x7a')]=function(_0x5ec5f5,_0x20a6df){return db[_0xbb11('0x2a')][_0xbb11('0x7b')]({'where':{'id':_0x5ec5f5[_0xbb11('0x7c')]['id']}})[_0xbb11('0x27')](handleEntityNotFound(_0x20a6df,null))['then'](removeEntity(_0x20a6df,null))['catch'](handleError(_0x20a6df,null));};exports[_0xbb11('0x2b')]=function(_0x5ca6a7,_0x420824){return db['CmContact']['describe']()[_0xbb11('0x27')](function(_0x1fd195){for(var _0xf89e85=0x0;_0xf89e85{}\s\\|]/g,'-');_0x33339c(null,util[_0xd156('0x1f')](_0xd156('0x20'),path[_0xd156('0x21')](_0x13be04[_0xd156('0x1d')],path[_0xd156('0x22')](_0x13be04[_0xd156('0x1d')])),Date[_0xd156('0x23')](),path[_0xd156('0x22')](_0x13be04[_0xd156('0x1d')])));}})});router['post'](_0xd156('0x24'),upload[_0xd156('0x25')](_0xd156('0x26')),controller[_0xd156('0x27')]);var upload=multer({'storage':multer[_0xd156('0x1a')]({'destination':function(_0x3a6b5e,_0x44945c,_0x19f49c){_0x19f49c(null,path['join'](config[_0xd156('0x1b')],_0xd156('0x1c')));},'filename':function(_0x472360,_0x2e91e4,_0x1bc4e5){_0x2e91e4[_0xd156('0x1d')]=_0x2e91e4[_0xd156('0x1d')][_0xd156('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1bc4e5(null,util[_0xd156('0x1f')](_0xd156('0x20'),path['basename'](_0x2e91e4['originalname'],path[_0xd156('0x22')](_0x2e91e4[_0xd156('0x1d')])),Date[_0xd156('0x23')](),path['extname'](_0x2e91e4[_0xd156('0x1d')])));}})});router[_0xd156('0x13')](_0xd156('0x28'),upload['single'](_0xd156('0x26')),controller[_0xd156('0x29')]);router[_0xd156('0x13')]('/upload/:id',auth[_0xd156('0xb')](),controller[_0xd156('0x2a')]);router[_0xd156('0x2b')](_0xd156('0xd'),auth[_0xd156('0xb')](),controller[_0xd156('0x2c')]);router[_0xd156('0x2d')](_0xd156('0xd'),auth[_0xd156('0xb')](),controller[_0xd156('0x2e')]);module[_0xd156('0x2f')]=router; \ No newline at end of file +var _0x6d5a=['./cmContact.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/tags','/:id/hoppers','getHopperHistories','/:id/hopper_finals','/:id/jscripty_sessions','getJscriptySessions','merge','create','post','bulkCreate','diskStorage','root','originalname','replace','%s-%s%s','basename','extname','now','single','file','uploadCsv','join','/upload','upload','/upload/:id','import','put','update','delete','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6d5a,0x107));var _0xa6d5=function(_0x4f8b84,_0x14df97){_0x4f8b84=_0x4f8b84-0x0;var _0x87dc9a=_0x6d5a[_0x4f8b84];return _0x87dc9a;};'use strict';var multer=require(_0xa6d5('0x0'));var util=require(_0xa6d5('0x1'));var path=require('path');var timeout=require(_0xa6d5('0x2'));var express=require(_0xa6d5('0x3'));var router=express['Router']();var auth=require(_0xa6d5('0x4'));var interaction=require(_0xa6d5('0x5'));var config=require(_0xa6d5('0x6'));var controller=require(_0xa6d5('0x7'));router[_0xa6d5('0x8')]('/',auth[_0xa6d5('0x9')](),controller[_0xa6d5('0xa')]);router[_0xa6d5('0x8')](_0xa6d5('0xb'),auth['isAuthenticated'](),controller[_0xa6d5('0xc')]);router[_0xa6d5('0x8')](_0xa6d5('0xd'),auth[_0xa6d5('0x9')](),controller[_0xa6d5('0xe')]);router['get'](_0xa6d5('0xf'),auth[_0xa6d5('0x9')](),controller['getTags']);router[_0xa6d5('0x8')](_0xa6d5('0x10'),auth[_0xa6d5('0x9')](),controller['getHoppers']);router[_0xa6d5('0x8')]('/:id/hopper_histories',auth[_0xa6d5('0x9')](),controller[_0xa6d5('0x11')]);router['get'](_0xa6d5('0x12'),auth[_0xa6d5('0x9')](),controller['getHopperFinals']);router['get'](_0xa6d5('0x13'),auth[_0xa6d5('0x9')](),controller[_0xa6d5('0x14')]);router['post']('/merge',auth['isAuthenticated'](),controller[_0xa6d5('0x15')]);router['post']('/',auth[_0xa6d5('0x9')](),controller[_0xa6d5('0x16')]);router[_0xa6d5('0x17')]('/create_many',auth[_0xa6d5('0x9')](),controller[_0xa6d5('0x18')]);router['post']('/:id/tags',auth[_0xa6d5('0x9')](),controller['setTags']);var upload=multer({'storage':multer[_0xa6d5('0x19')]({'destination':function(_0x2ffd39,_0x4eaf33,_0x5d37ad){_0x5d37ad(null,path['join'](config[_0xa6d5('0x1a')],'server/files/tmp'));},'filename':function(_0x388049,_0x438a45,_0x56a485){_0x438a45[_0xa6d5('0x1b')]=_0x438a45[_0xa6d5('0x1b')][_0xa6d5('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x56a485(null,util['format'](_0xa6d5('0x1d'),path[_0xa6d5('0x1e')](_0x438a45[_0xa6d5('0x1b')],path[_0xa6d5('0x1f')](_0x438a45['originalname'])),Date[_0xa6d5('0x20')](),path[_0xa6d5('0x1f')](_0x438a45['originalname'])));}})});router[_0xa6d5('0x17')]('/csv',upload[_0xa6d5('0x21')](_0xa6d5('0x22')),controller[_0xa6d5('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2dfcb5,_0x5c676f,_0x2df42a){_0x2df42a(null,path[_0xa6d5('0x24')](config['root'],'server/files/tmp'));},'filename':function(_0x2fa1f3,_0x56ce51,_0x3a7efe){_0x56ce51[_0xa6d5('0x1b')]=_0x56ce51[_0xa6d5('0x1b')][_0xa6d5('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3a7efe(null,util['format']('%s-%s%s',path[_0xa6d5('0x1e')](_0x56ce51['originalname'],path[_0xa6d5('0x1f')](_0x56ce51[_0xa6d5('0x1b')])),Date[_0xa6d5('0x20')](),path[_0xa6d5('0x1f')](_0x56ce51[_0xa6d5('0x1b')])));}})});router['post'](_0xa6d5('0x25'),upload['single'](_0xa6d5('0x22')),controller[_0xa6d5('0x26')]);router[_0xa6d5('0x17')](_0xa6d5('0x27'),auth[_0xa6d5('0x9')](),controller[_0xa6d5('0x28')]);router[_0xa6d5('0x29')]('/:id',auth[_0xa6d5('0x9')](),controller[_0xa6d5('0x2a')]);router[_0xa6d5('0x2b')]('/:id',auth[_0xa6d5('0x9')](),controller[_0xa6d5('0x2c')]);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 4349c64..e1a92be 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 _0xca6e=['parse','values','isArray','stringify','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','TEXT','long','select'];(function(_0x415413,_0x1b9f9d){var _0x1c50f4=function(_0x296e58){while(--_0x296e58){_0x415413['push'](_0x415413['shift']());}};_0x1c50f4(++_0x1b9f9d);}(_0xca6e,0x130));var _0xeca6=function(_0x50aee8,_0x1168e0){_0x50aee8=_0x50aee8-0x0;var _0x430a2b=_0xca6e[_0x50aee8];return _0x430a2b;};'use strict';var Sequelize=require(_0xeca6('0x0'));var _=require(_0xeca6('0x1'));module[_0xeca6('0x2')]={'name':{'type':Sequelize[_0xeca6('0x3')],'get':function(_0x50d6f3){return this[_0xeca6('0x4')](_0xeca6('0x5'));}},'alias':{'type':Sequelize[_0xeca6('0x6')],'allowNull':![],'set':function(_0x10f7fc){this[_0xeca6('0x7')](_0xeca6('0x5'),_0x10f7fc?_0x10f7fc:this[_0xeca6('0x4')]('name'));}},'type':{'type':Sequelize[_0xeca6('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0xeca6('0x8')](_0xeca6('0x9')),'get':function(){if(this[_0xeca6('0x4')]('type')===_0xeca6('0xa')){return JSON[_0xeca6('0xb')](this['getDataValue'](_0xeca6('0xc')));}else{return this[_0xeca6('0x4')](_0xeca6('0xc'));}},'set':function(_0x3817fe){if(Array[_0xeca6('0xd')](_0x3817fe)){this[_0xeca6('0x7')]('values',JSON[_0xeca6('0xe')](_0x3817fe));}else{this[_0xeca6('0x7')](_0xeca6('0xc'),_0x3817fe);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xf539=['sequelize','lodash','exports','VIRTUAL','STRING','setDataValue','alias','TEXT','long','type','parse','getDataValue','values','isArray','BOOLEAN'];(function(_0x4ef346,_0x44f560){var _0x3da47d=function(_0x1e0214){while(--_0x1e0214){_0x4ef346['push'](_0x4ef346['shift']());}};_0x3da47d(++_0x44f560);}(_0xf539,0x1ef));var _0x9f53=function(_0x204cfc,_0x4beef3){_0x204cfc=_0x204cfc-0x0;var _0x1fc2fb=_0xf539[_0x204cfc];return _0x1fc2fb;};'use strict';var Sequelize=require(_0x9f53('0x0'));var _=require(_0x9f53('0x1'));module[_0x9f53('0x2')]={'name':{'type':Sequelize[_0x9f53('0x3')],'get':function(_0x257009){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0x9f53('0x4')],'allowNull':![],'set':function(_0x9a389d){this[_0x9f53('0x5')](_0x9f53('0x6'),_0x9a389d?_0x9a389d:this['getDataValue']('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x9f53('0x7')](_0x9f53('0x8')),'get':function(){if(this['getDataValue'](_0x9f53('0x9'))==='select'){return JSON[_0x9f53('0xa')](this[_0x9f53('0xb')](_0x9f53('0xc')));}else{return this[_0x9f53('0xb')]('values');}},'set':function(_0x147443){if(Array[_0x9f53('0xd')](_0x147443)){this['setDataValue'](_0x9f53('0xc'),JSON['stringify'](_0x147443));}else{this[_0x9f53('0x5')](_0x9f53('0xc'),_0x147443);}}},'required':{'type':Sequelize[_0x9f53('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index aab1655..05aa702 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=['rows','catch','params','includeAll','include','find','sequelize','transaction','create','body','destroy','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','CmCustomField','rawAttributes','model','differenceBy','keys','name','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','map','type','merge','options','findAll'];(function(_0x153dd3,_0x36f74f){var _0x38be09=function(_0xac5cc0){while(--_0xac5cc0){_0x153dd3['push'](_0x153dd3['shift']());}};_0x38be09(++_0x36f74f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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['create']=function(_0x117c99,_0x138b8b){return db[_0x0a9e('0x41')][_0x0a9e('0x42')](function(_0x2e8caf){return db[_0x0a9e('0x24')][_0x0a9e('0x43')](_0x117c99[_0x0a9e('0x44')],{'transaction':_0x2e8caf});})['then'](respondWithResult(_0x138b8b,0xc9))[_0x0a9e('0x3c')](handleError(_0x138b8b,null));};exports['update']=function(_0x473dc8,_0x476688){if(_0x473dc8[_0x0a9e('0x44')]['id']){delete _0x473dc8['body']['id'];}return db[_0x0a9e('0x24')][_0x0a9e('0x40')]({'where':{'id':_0x473dc8[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x476688,null))[_0x0a9e('0x1f')](saveUpdates(_0x473dc8[_0x0a9e('0x44')],null))[_0x0a9e('0x1f')](respondWithResult(_0x476688,null))['catch'](handleError(_0x476688,null));};exports[_0x0a9e('0x45')]=function(_0x1bde3c,_0x1b5e80){return db[_0x0a9e('0x24')][_0x0a9e('0x40')]({'where':{'id':_0x1bde3c[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x1b5e80,null))[_0x0a9e('0x1f')](removeEntity(_0x1b5e80,null))[_0x0a9e('0x3c')](handleError(_0x1b5e80,null));}; \ No newline at end of file +var _0xb10b=['ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','send','index','CmCustomField','rawAttributes','differenceBy','keys','name','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','map','type','key','VIRTUAL','field','count','includeAll','include','findAll','rows','catch','show','length','merge','options','find','create','transaction','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x3b08de,_0x63ddd0){var _0x53fbe4=function(_0x16eea2){while(--_0x16eea2){_0x3b08de['push'](_0x3b08de['shift']());}};_0x53fbe4(++_0x63ddd0);}(_0xb10b,0x12a));var _0xbb10=function(_0x3eff47,_0x2796a1){_0x3eff47=_0x3eff47-0x0;var _0x8c1be2=_0xb10b[_0x3eff47];return _0x8c1be2;};'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'];function respondWithStatusCode(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xcc;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x18')](_0x44fb19);}return _0x5be7e0[_0xbb10('0x19')](_0x44fb19)[_0xbb10('0x1a')]();};}function respondWithResult(_0x147230,_0x58a612){_0x58a612=_0x58a612||0xc8;return function(_0x26e021){if(_0x26e021){return _0x147230[_0xbb10('0x19')](_0x58a612)[_0xbb10('0x1b')](_0x26e021);}};}function respondWithFilteredResult(_0x17fd46,_0x3df17b){return function(_0x2f2ebf){if(_0x2f2ebf){var _0x24a57b=_0x2f2ebf['count'],_0x36b5e8=_0x3df17b[_0xbb10('0x1c')],_0x3e26f4=_0x3df17b[_0xbb10('0x1c')]+_0x3df17b[_0xbb10('0x1d')],_0x2b184e;if(_0x3e26f4>=_0x24a57b){_0x3e26f4=_0x24a57b;_0x2b184e=0xc8;}else{_0x2b184e=0xce;}_0x17fd46[_0xbb10('0x19')](_0x2b184e);return _0x17fd46[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x36b5e8+'-'+_0x3e26f4+'/'+_0x24a57b)[_0xbb10('0x1b')](_0x2f2ebf);}return null;};}function patchUpdates(_0x30efc6){return function(_0xbf2906){try{jsonpatch[_0xbb10('0x20')](_0xbf2906,_0x30efc6,!![]);}catch(_0x48b6e9){return BPromise[_0xbb10('0x21')](_0x48b6e9);}return _0xbf2906[_0xbb10('0x22')]();};}function saveUpdates(_0x388fab,_0x109908){return function(_0xdf237d){if(_0xdf237d){return _0xdf237d[_0xbb10('0x23')](_0x388fab)['then'](function(_0x12f888){return _0x12f888;});}return null;};}function removeEntity(_0x12ef77,_0x50aea1){return function(_0x4c4b0d){if(_0x4c4b0d){return _0x4c4b0d[_0xbb10('0x24')]()[_0xbb10('0x25')](function(){_0x12ef77[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x445761,_0x1824b7){return function(_0x407cb4){if(!_0x407cb4){_0x445761[_0xbb10('0x18')](0x194);}return _0x407cb4;};}function handleError(_0x7f2377,_0x395404){_0x395404=_0x395404||0x1f4;return function(_0x3ba6cd){logger[_0xbb10('0x26')](_0x3ba6cd['stack']);if(_0x3ba6cd['name']){delete _0x3ba6cd['name'];}_0x7f2377[_0xbb10('0x19')](_0x395404)[_0xbb10('0x27')](_0x3ba6cd);};}exports[_0xbb10('0x28')]=function(_0x4e25ff,_0x2fdde9){var _0x24d586={},_0x6ed43b={},_0x1d5e95={'count':0x0,'rows':[]};var _0x1acce9=db[_0xbb10('0x29')][_0xbb10('0x2a')];_0x6ed43b['model']=_[_0xbb10('0x2b')](_[_0xbb10('0x2c')](_0x1acce9),[_0xbb10('0x2d')]);_0x6ed43b[_0xbb10('0x2e')]=_[_0xbb10('0x2c')](_0x4e25ff[_0xbb10('0x2e')]);_0x6ed43b['filters']=_[_0xbb10('0x2f')](_0x6ed43b['model'],_0x6ed43b[_0xbb10('0x2e')]);_0x24d586['attributes']=_[_0xbb10('0x2f')](_0x6ed43b[_0xbb10('0x30')],qs[_0xbb10('0x31')](_0x4e25ff['query']['fields']));_0x24d586[_0xbb10('0x32')]=_0x24d586[_0xbb10('0x32')]['length']?_0x24d586[_0xbb10('0x32')]:_0x6ed43b[_0xbb10('0x30')];if(!_0x4e25ff[_0xbb10('0x2e')][_0xbb10('0x33')](_0xbb10('0x34'))){_0x24d586[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x4e25ff['query'][_0xbb10('0x1d')]);_0x24d586[_0xbb10('0x1c')]=qs[_0xbb10('0x1c')](_0x4e25ff[_0xbb10('0x2e')][_0xbb10('0x1c')]);}_0x24d586[_0xbb10('0x35')]=qs[_0xbb10('0x36')](_0x4e25ff[_0xbb10('0x2e')][_0xbb10('0x36')]);_0x24d586['where']=qs[_0xbb10('0x37')](_[_0xbb10('0x38')](_0x4e25ff[_0xbb10('0x2e')],_0x6ed43b[_0xbb10('0x37')]));if(_0x4e25ff['query'][_0xbb10('0x39')]){_0x24d586['where']=_['merge'](_0x24d586[_0xbb10('0x3a')],{'$or':_[_0xbb10('0x3b')](_0x1acce9,function(_0x26e76a){if(_0x26e76a[_0xbb10('0x3c')][_0xbb10('0x3d')]!==_0xbb10('0x3e')){var _0x547062={};_0x547062[_0x26e76a[_0xbb10('0x3f')]]={'$like':'%'+_0x4e25ff[_0xbb10('0x2e')]['filter']+'%'};return _0x547062;}})});}_0x24d586=_['merge']({},_0x24d586,_0x4e25ff['options']);var _0x31bee3={'where':_0x24d586[_0xbb10('0x3a')]};return db[_0xbb10('0x29')]['count'](_0x31bee3)[_0xbb10('0x25')](function(_0x3e8538){_0x1d5e95[_0xbb10('0x40')]=_0x3e8538;if(_0x4e25ff['query'][_0xbb10('0x41')]){_0x24d586[_0xbb10('0x42')]=[{'all':!![]}];}return db[_0xbb10('0x29')][_0xbb10('0x43')](_0x24d586);})['then'](function(_0xd238e9){_0x1d5e95[_0xbb10('0x44')]=_0xd238e9;return _0x1d5e95;})['then'](respondWithFilteredResult(_0x2fdde9,_0x24d586))[_0xbb10('0x45')](handleError(_0x2fdde9,null));};exports[_0xbb10('0x46')]=function(_0x44d6ae,_0x3a9934){var _0x2dd35a={'raw':!![],'where':{'id':_0x44d6ae['params']['id']}},_0x185a52={};_0x185a52[_0xbb10('0x30')]=_[_0xbb10('0x2c')](db[_0xbb10('0x29')][_0xbb10('0x2a')]);_0x185a52['query']=_[_0xbb10('0x2c')](_0x44d6ae[_0xbb10('0x2e')]);_0x185a52[_0xbb10('0x37')]=_[_0xbb10('0x2f')](_0x185a52['model'],_0x185a52[_0xbb10('0x2e')]);_0x2dd35a[_0xbb10('0x32')]=_['intersection'](_0x185a52['model'],qs[_0xbb10('0x31')](_0x44d6ae['query'][_0xbb10('0x31')]));_0x2dd35a[_0xbb10('0x32')]=_0x2dd35a['attributes'][_0xbb10('0x47')]?_0x2dd35a[_0xbb10('0x32')]:_0x185a52[_0xbb10('0x30')];if(_0x44d6ae['query'][_0xbb10('0x41')]){_0x2dd35a[_0xbb10('0x42')]=[{'all':!![]}];}_0x2dd35a=_[_0xbb10('0x48')]({},_0x2dd35a,_0x44d6ae[_0xbb10('0x49')]);return db[_0xbb10('0x29')][_0xbb10('0x4a')](_0x2dd35a)[_0xbb10('0x25')](handleEntityNotFound(_0x3a9934,null))[_0xbb10('0x25')](respondWithResult(_0x3a9934,null))[_0xbb10('0x45')](handleError(_0x3a9934,null));};exports[_0xbb10('0x4b')]=function(_0x197871,_0x1eadd2){return db['sequelize'][_0xbb10('0x4c')](function(_0x41bbf8){return db['CmCustomField'][_0xbb10('0x4b')](_0x197871[_0xbb10('0x4d')],{'transaction':_0x41bbf8});})[_0xbb10('0x25')](respondWithResult(_0x1eadd2,0xc9))[_0xbb10('0x45')](handleError(_0x1eadd2,null));};exports[_0xbb10('0x23')]=function(_0x39f0de,_0x3e06b0){if(_0x39f0de['body']['id']){delete _0x39f0de['body']['id'];}return db[_0xbb10('0x29')][_0xbb10('0x4a')]({'where':{'id':_0x39f0de[_0xbb10('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3e06b0,null))['then'](saveUpdates(_0x39f0de[_0xbb10('0x4d')],null))[_0xbb10('0x25')](respondWithResult(_0x3e06b0,null))[_0xbb10('0x45')](handleError(_0x3e06b0,null));};exports[_0xbb10('0x24')]=function(_0x10159b,_0x22b315){return db[_0xbb10('0x29')][_0xbb10('0x4a')]({'where':{'id':_0x10159b[_0xbb10('0x4e')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x22b315,null))['then'](removeEntity(_0x22b315,null))['catch'](handleError(_0x22b315,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 8c4133e..a3c1e34 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 _0x9124=['get','TEXT','type','text','number','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','format','cf_%d','lodash','util','path','rimraf','../../config/environment','exports','define','CmCustomField','cm_custom_fields'];(function(_0x15e472,_0x1b28a0){var _0x1a441b=function(_0x330566){while(--_0x330566){_0x15e472['push'](_0x15e472['shift']());}};_0x1a441b(++_0x1b28a0);}(_0x9124,0x108));var _0x4912=function(_0x6d3e17,_0x3954e4){_0x6d3e17=_0x6d3e17-0x0;var _0x366c53=_0x9124[_0x6d3e17];return _0x366c53;};'use strict';var _=require(_0x4912('0x0'));var util=require(_0x4912('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4912('0x2'));var rimraf=require(_0x4912('0x3'));var config=require(_0x4912('0x4'));var attributes=require('./cmCustomField.attributes');module[_0x4912('0x5')]=function(_0x35904e,_0xa1c159){return _0x35904e[_0x4912('0x6')](_0x4912('0x7'),attributes,{'tableName':_0x4912('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x363222,_0x3a2ef3,_0x50dacd){var _0x4fe421=_0x363222[_0x4912('0x9')]({'plain':!![]});var _0x34b46c={'type':_0xa1c159[_0x4912('0xa')],'transaction':_0x3a2ef3['transaction']};switch(_0x4fe421[_0x4912('0xb')]){case _0x4912('0xc'):_0x34b46c[_0x4912('0xb')]=_0xa1c159[_0x4912('0xa')];break;case _0x4912('0xd'):_0x34b46c[_0x4912('0xb')]=_0xa1c159['INTEGER'];break;case _0x4912('0xe'):_0x34b46c[_0x4912('0xb')]=_0xa1c159[_0x4912('0xf')];_0x34b46c[_0x4912('0x10')]=![];break;}_0x35904e[_0x4912('0x11')]['addColumn'](_0x4912('0x12'),util[_0x4912('0x13')](_0x4912('0x14'),_0x4fe421['id']),_0x34b46c);_0x50dacd();}}});}; \ No newline at end of file +var _0x531f=['lodash','../../config/logger','bluebird','path','rimraf','./cmCustomField.attributes','exports','define','cm_custom_fields','TEXT','transaction','type','number','INTEGER','switch','defaultValue','addColumn','cm_contacts','format','cf_%d'];(function(_0x5e99ba,_0x2aab87){var _0x5570fe=function(_0x4fb8b8){while(--_0x4fb8b8){_0x5e99ba['push'](_0x5e99ba['shift']());}};_0x5570fe(++_0x2aab87);}(_0x531f,0xf0));var _0xf531=function(_0x2dbac1,_0x44db3b){_0x2dbac1=_0x2dbac1-0x0;var _0x8c4e86=_0x531f[_0x2dbac1];return _0x8c4e86;};'use strict';var _=require(_0xf531('0x0'));var util=require('util');var logger=require(_0xf531('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf531('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf531('0x3'));var rimraf=require(_0xf531('0x4'));var config=require('../../config/environment');var attributes=require(_0xf531('0x5'));module[_0xf531('0x6')]=function(_0x3c275c,_0x425821){return _0x3c275c[_0xf531('0x7')]('CmCustomField',attributes,{'tableName':_0xf531('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2941c2,_0x4735d0,_0x3af326){var _0x1f022a=_0x2941c2['get']({'plain':!![]});var _0x5c3d38={'type':_0x425821[_0xf531('0x9')],'transaction':_0x4735d0[_0xf531('0xa')]};switch(_0x1f022a[_0xf531('0xb')]){case'text':_0x5c3d38[_0xf531('0xb')]=_0x425821[_0xf531('0x9')];break;case _0xf531('0xc'):_0x5c3d38[_0xf531('0xb')]=_0x425821[_0xf531('0xd')];break;case _0xf531('0xe'):_0x5c3d38[_0xf531('0xb')]=_0x425821['BOOLEAN'];_0x5c3d38[_0xf531('0xf')]=![];break;}_0x3c275c['queryInterface'][_0xf531('0x10')](_0xf531('0x11'),util[_0xf531('0x12')](_0xf531('0x13'),_0x1f022a['id']),_0x5c3d38);_0x3af326();}}});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 2d97d59..32c810f 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 _0x4b8b=['client','http','request','then','info','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','CmCustomField,\x20%s,\x20%s','result','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x810add,_0x4cae73){var _0x30ae44=function(_0x3ba170){while(--_0x3ba170){_0x810add['push'](_0x810add['shift']());}};_0x30ae44(++_0x4cae73);}(_0x4b8b,0x7b));var _0xb4b8=function(_0x245d40,_0x455ece){_0x245d40=_0x245d40-0x0;var _0x245534=_0x4b8b[_0x245d40];return _0x245534;};'use strict';var _=require(_0xb4b8('0x0'));var util=require(_0xb4b8('0x1'));var moment=require(_0xb4b8('0x2'));var BPromise=require('bluebird');var rs=require(_0xb4b8('0x3'));var fs=require('fs');var Redis=require(_0xb4b8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb4b8('0x5'));var logger=require(_0xb4b8('0x6'))('rpc');var config=require(_0xb4b8('0x7'));var jayson=require(_0xb4b8('0x8'));var client=jayson[_0xb4b8('0x9')][_0xb4b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46d35d,_0x25588b,_0x45716f){return new BPromise(function(_0x4ea482,_0x394d41){return client[_0xb4b8('0xb')](_0x46d35d,_0x45716f)[_0xb4b8('0xc')](function(_0x118358){logger[_0xb4b8('0xd')]('CmCustomField,\x20%s,\x20%s',_0x25588b,_0xb4b8('0xe'));logger['debug'](_0xb4b8('0xf'),_0x25588b,_0xb4b8('0xe'),JSON['stringify'](_0x118358));if(_0x118358[_0xb4b8('0x10')]){if(_0x118358[_0xb4b8('0x10')][_0xb4b8('0x11')]===0x1f4){logger[_0xb4b8('0x10')](_0xb4b8('0x12'),_0x25588b,_0x118358[_0xb4b8('0x10')]['message']);return _0x394d41(_0x118358['error']['message']);}logger[_0xb4b8('0x10')]('CmCustomField,\x20%s,\x20%s',_0x25588b,_0x118358['error']['message']);return _0x4ea482(_0x118358[_0xb4b8('0x10')]['message']);}else{logger[_0xb4b8('0xd')]('CmCustomField,\x20%s,\x20%s',_0x25588b,'request\x20sent');_0x4ea482(_0x118358[_0xb4b8('0x13')][_0xb4b8('0x14')]);}})[_0xb4b8('0x15')](function(_0x3008ca){logger[_0xb4b8('0x10')](_0xb4b8('0x12'),_0x25588b,_0x3008ca);_0x394d41(_0x3008ca);});});} \ No newline at end of file +var _0xf7b0=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','CmCustomField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x4cce65,_0x40021e){var _0x4d1b45=function(_0x54d290){while(--_0x54d290){_0x4cce65['push'](_0x4cce65['shift']());}};_0x4d1b45(++_0x40021e);}(_0xf7b0,0x10a));var _0x0f7b=function(_0xec194d,_0x1e2e6a){_0xec194d=_0xec194d-0x0;var _0x1b1a72=_0xf7b0[_0xec194d];return _0x1b1a72;};'use strict';var _=require(_0x0f7b('0x0'));var util=require(_0x0f7b('0x1'));var moment=require(_0x0f7b('0x2'));var BPromise=require('bluebird');var rs=require(_0x0f7b('0x3'));var fs=require('fs');var Redis=require(_0x0f7b('0x4'));var db=require(_0x0f7b('0x5'))['db'];var utils=require(_0x0f7b('0x6'));var logger=require('../../config/logger')(_0x0f7b('0x7'));var config=require(_0x0f7b('0x8'));var jayson=require(_0x0f7b('0x9'));var client=jayson['client'][_0x0f7b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x96d2,_0x5825b2,_0x35adf9){return new BPromise(function(_0x1dee93,_0x36e7fa){return client[_0x0f7b('0xb')](_0x96d2,_0x35adf9)[_0x0f7b('0xc')](function(_0x18dbbe){logger['info'](_0x0f7b('0xd'),_0x5825b2,'request\x20sent');logger[_0x0f7b('0xe')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x5825b2,_0x0f7b('0xf'),JSON[_0x0f7b('0x10')](_0x18dbbe));if(_0x18dbbe['error']){if(_0x18dbbe[_0x0f7b('0x11')][_0x0f7b('0x12')]===0x1f4){logger[_0x0f7b('0x11')](_0x0f7b('0xd'),_0x5825b2,_0x18dbbe['error'][_0x0f7b('0x13')]);return _0x36e7fa(_0x18dbbe[_0x0f7b('0x11')][_0x0f7b('0x13')]);}logger[_0x0f7b('0x11')]('CmCustomField,\x20%s,\x20%s',_0x5825b2,_0x18dbbe['error'][_0x0f7b('0x13')]);return _0x1dee93(_0x18dbbe['error'][_0x0f7b('0x13')]);}else{logger['info'](_0x0f7b('0xd'),_0x5825b2,'request\x20sent');_0x1dee93(_0x18dbbe[_0x0f7b('0x14')]['message']);}})[_0x0f7b('0x15')](function(_0x540f5a){logger[_0x0f7b('0x11')]('CmCustomField,\x20%s,\x20%s',_0x5825b2,_0x540f5a);_0x36e7fa(_0x540f5a);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 9336fa0..e13a361 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 _0x2054=['exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy'];(function(_0x1be643,_0x647506){var _0x5aa339=function(_0xca8b18){while(--_0xca8b18){_0x1be643['push'](_0x1be643['shift']());}};_0x5aa339(++_0x647506);}(_0x2054,0x155));var _0x4205=function(_0x11d830,_0x116d43){_0x11d830=_0x11d830-0x0;var _0x4868e7=_0x2054[_0x11d830];return _0x4868e7;};'use strict';var multer=require(_0x4205('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4205('0x1'));var express=require(_0x4205('0x2'));var router=express[_0x4205('0x3')]();var auth=require(_0x4205('0x4'));var interaction=require(_0x4205('0x5'));var config=require('../../config/environment');var controller=require(_0x4205('0x6'));router[_0x4205('0x7')]('/',auth[_0x4205('0x8')](),controller['index']);router[_0x4205('0x7')](_0x4205('0x9'),auth[_0x4205('0x8')](),controller[_0x4205('0xa')]);router['post']('/',auth[_0x4205('0x8')](),controller[_0x4205('0xb')]);router[_0x4205('0xc')]('/:id',auth[_0x4205('0x8')](),controller[_0x4205('0xd')]);router[_0x4205('0xe')](_0x4205('0x9'),auth['isAuthenticated'](),controller[_0x4205('0xf')]);module[_0x4205('0x10')]=router; \ No newline at end of file +var _0xaac9=['show','post','isAuthenticated','create','put','update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','index','/:id'];(function(_0x458dab,_0x989a40){var _0x214ad9=function(_0x416914){while(--_0x416914){_0x458dab['push'](_0x458dab['shift']());}};_0x214ad9(++_0x989a40);}(_0xaac9,0x171));var _0x9aac=function(_0x1406ae,_0x292395){_0x1406ae=_0x1406ae-0x0;var _0x23a076=_0xaac9[_0x1406ae];return _0x23a076;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9aac('0x0'));var timeout=require('connect-timeout');var express=require(_0x9aac('0x1'));var router=express[_0x9aac('0x2')]();var auth=require(_0x9aac('0x3'));var interaction=require(_0x9aac('0x4'));var config=require(_0x9aac('0x5'));var controller=require(_0x9aac('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x9aac('0x7')]);router['get'](_0x9aac('0x8'),auth['isAuthenticated'](),controller[_0x9aac('0x9')]);router[_0x9aac('0xa')]('/',auth[_0x9aac('0xb')](),controller[_0x9aac('0xc')]);router[_0x9aac('0xd')](_0x9aac('0x8'),auth['isAuthenticated'](),controller[_0x9aac('0xe')]);router[_0x9aac('0xf')](_0x9aac('0x8'),auth[_0x9aac('0xb')](),controller[_0x9aac('0x10')]);module[_0x9aac('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 54b78ee..5588f56 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 _0x8635=['format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','UNSIGNED','contactListQueue','moment','sequelize','exports','BOOLEAN','DATE'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x8635,0x187));var _0x5863=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x8635[_0xd1d19a];return _0x52a79d;};'use strict';var moment=require(_0x5863('0x0'));var Sequelize=require(_0x5863('0x1'));module[_0x5863('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x5863('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x5863('0x4')],'defaultValue':moment()[_0x5863('0x5')](_0x5863('0x6'))},'countbusyretry':{'type':Sequelize[_0x5863('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5863('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5863('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x5863('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5863('0x8')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x5863('0x7')](0x2)[_0x5863('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x5863('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x5863('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x5863('0x7')],'unique':_0x5863('0xa')},'UserId':{'type':Sequelize[_0x5863('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x5863('0x7')],'unique':_0x5863('0xa')},'CampaignId':{'type':Sequelize[_0x5863('0x7')]}}; \ No newline at end of file +var _0x1652=['moment','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','DATE','UNSIGNED','contactListQueue'];(function(_0x9e530d,_0x374aef){var _0x178e38=function(_0x54d214){while(--_0x54d214){_0x9e530d['push'](_0x9e530d['shift']());}};_0x178e38(++_0x374aef);}(_0x1652,0x129));var _0x2165=function(_0x473b41,_0x1c320f){_0x473b41=_0x473b41-0x0;var _0x4e521d=_0x1652[_0x473b41];return _0x4e521d;};'use strict';var moment=require(_0x2165('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x2165('0x1')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x2165('0x2')](_0x2165('0x3'))},'countbusyretry':{'type':Sequelize[_0x2165('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2165('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2165('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x2165('0x1')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2165('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2165('0x6')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x2165('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x2165('0x1')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x2165('0x4')],'unique':_0x2165('0x8')},'ListId':{'type':Sequelize[_0x2165('0x4')],'unique':_0x2165('0x8')},'UserId':{'type':Sequelize[_0x2165('0x4')]},'VoiceQueueId':{'type':Sequelize[_0x2165('0x4')],'unique':_0x2165('0x8')},'CampaignId':{'type':Sequelize[_0x2165('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index a89d159..c8f3706 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 _0x24ca=['bluebird','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','end','status','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','CmHopper','rawAttributes','model','keys','query','filters','intersection','concat','$and','$or','$gt','$lt','$lte','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$contained','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','dataValues','updatedAt','state','statedesc','deleted','campaign','membername','user','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','getPreview','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getVoiceQueues','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','html-pdf','zip-dir','request-promise','moment'];(function(_0x2a5d5c,_0xa829ca){var _0x1feaae=function(_0x67e616){while(--_0x67e616){_0x2a5d5c['push'](_0x2a5d5c['shift']());}};_0x1feaae(++_0xa829ca);}(_0x24ca,0x8c));var _0xa24c=function(_0x5ebc04,_0x14a363){_0x5ebc04=_0x5ebc04-0x0;var _0x17845c=_0x24ca[_0x5ebc04];return _0x17845c;};'use strict';var pdf=require(_0xa24c('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa24c('0x2'));var moment=require(_0xa24c('0x3'));var BPromise=require(_0xa24c('0x4'));var Mustache=require('mustache');var util=require(_0xa24c('0x5'));var path=require(_0xa24c('0x6'));var sox=require(_0xa24c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xa24c('0x8'));var crypto=require(_0xa24c('0x9'));var jsforce=require(_0xa24c('0xa'));var deskjs=require(_0xa24c('0xb'));var toCsv=require(_0xa24c('0xc'));var querystring=require(_0xa24c('0xd'));var Papa=require('papaparse');var Redis=require(_0xa24c('0xe'));var authService=require(_0xa24c('0xf'));var qs=require(_0xa24c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa24c('0x11'));var utils=require(_0xa24c('0x12'));var config=require(_0xa24c('0x13'));var db=require(_0xa24c('0x14'))['db'];function respondWithStatusCode(_0xbaf0be,_0x1d06da){_0x1d06da=_0x1d06da||0xcc;return function(_0x566313){if(_0x566313){return _0xbaf0be['sendStatus'](_0x1d06da);}return _0xbaf0be['status'](_0x1d06da)[_0xa24c('0x15')]();};}function respondWithResult(_0x23bd58,_0x337c8a){_0x337c8a=_0x337c8a||0xc8;return function(_0x9fe9e3){if(_0x9fe9e3){return _0x23bd58[_0xa24c('0x16')](_0x337c8a)['json'](_0x9fe9e3);}};}function respondWithFilteredResult(_0x13076d,_0x488a78){return function(_0x493bcb){if(_0x493bcb){var _0x588acf=_0x493bcb[_0xa24c('0x17')],_0x2e8dc9=_0x488a78[_0xa24c('0x18')],_0x2a4270=_0x488a78[_0xa24c('0x18')]+_0x488a78[_0xa24c('0x19')],_0x3f762e;if(_0x2a4270>=_0x588acf){_0x2a4270=_0x588acf;_0x3f762e=0xc8;}else{_0x3f762e=0xce;}_0x13076d[_0xa24c('0x16')](_0x3f762e);return _0x13076d[_0xa24c('0x1a')](_0xa24c('0x1b'),_0x2e8dc9+'-'+_0x2a4270+'/'+_0x588acf)[_0xa24c('0x1c')](_0x493bcb);}return null;};}function patchUpdates(_0x1a667b){return function(_0x278cce){try{jsonpatch[_0xa24c('0x1d')](_0x278cce,_0x1a667b,!![]);}catch(_0x5276b6){return BPromise[_0xa24c('0x1e')](_0x5276b6);}return _0x278cce['save']();};}function saveUpdates(_0x98802d,_0xf9f8bd){return function(_0x8c3949){if(_0x8c3949){return _0x8c3949[_0xa24c('0x1f')](_0x98802d)[_0xa24c('0x20')](function(_0x416dea){return _0x416dea;});}return null;};}function removeEntity(_0x38dfdc,_0x432c15){return function(_0xba710){if(_0xba710){return _0xba710[_0xa24c('0x21')]()[_0xa24c('0x20')](function(){_0x38dfdc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x10fa25,_0xdd32a8){return function(_0x316a68){if(!_0x316a68){_0x10fa25[_0xa24c('0x22')](0x194);}return _0x316a68;};}function handleError(_0x375c83,_0xfb13c0){_0xfb13c0=_0xfb13c0||0x1f4;return function(_0x16bd20){logger[_0xa24c('0x23')](_0x16bd20[_0xa24c('0x24')]);if(_0x16bd20['name']){delete _0x16bd20[_0xa24c('0x25')];}_0x375c83['status'](_0xfb13c0)[_0xa24c('0x26')](_0x16bd20);};}exports[_0xa24c('0x27')]=function(_0x471421,_0x1a0769){var _0x54b8a6={},_0x58ff62={},_0x4c86c6={'count':0x0,'rows':[]};var _0x4e5d2c=db[_0xa24c('0x28')][_0xa24c('0x29')];_0x58ff62[_0xa24c('0x2a')]=_[_0xa24c('0x2b')](_0x4e5d2c);_0x58ff62[_0xa24c('0x2c')]=_['keys'](_0x471421['query']);_0x58ff62[_0xa24c('0x2d')]=_[_0xa24c('0x2e')](_0x58ff62[_0xa24c('0x2a')],_0x58ff62[_0xa24c('0x2c')]);_0x58ff62[_0xa24c('0x2d')]=_[_0xa24c('0x2f')](_0x58ff62[_0xa24c('0x2d')],[_0xa24c('0x30'),_0xa24c('0x31'),_0xa24c('0x32'),'$gte',_0xa24c('0x33'),_0xa24c('0x34'),'$ne',_0xa24c('0x35'),_0xa24c('0x36'),_0xa24c('0x37'),_0xa24c('0x38'),_0xa24c('0x39'),_0xa24c('0x3a'),_0xa24c('0x3b'),_0xa24c('0x3c'),_0xa24c('0x3d'),_0xa24c('0x3e'),'$like','$overlap','$contains',_0xa24c('0x3f'),'$any']);_0x54b8a6[_0xa24c('0x40')]=_[_0xa24c('0x2e')](_0x58ff62[_0xa24c('0x2a')],qs['fields'](_0x471421[_0xa24c('0x2c')][_0xa24c('0x41')]));_0x54b8a6[_0xa24c('0x40')]=_0x54b8a6['attributes'][_0xa24c('0x42')]?_0x54b8a6[_0xa24c('0x40')]:_0x58ff62['model'];if(!_0x471421[_0xa24c('0x2c')][_0xa24c('0x43')](_0xa24c('0x44'))){_0x54b8a6['limit']=qs[_0xa24c('0x19')](_0x471421[_0xa24c('0x2c')][_0xa24c('0x19')]);_0x54b8a6[_0xa24c('0x18')]=qs[_0xa24c('0x18')](_0x471421['query'][_0xa24c('0x18')]);}_0x54b8a6[_0xa24c('0x45')]=qs['sort'](_0x471421[_0xa24c('0x2c')][_0xa24c('0x46')]);_0x54b8a6[_0xa24c('0x47')]=qs['filters'](_['pick'](_0x471421[_0xa24c('0x2c')],_0x58ff62[_0xa24c('0x2d')]));if(_0x471421[_0xa24c('0x2c')][_0xa24c('0x48')]){_0x54b8a6[_0xa24c('0x47')]=_[_0xa24c('0x49')](_0x54b8a6['where'],{'$or':_[_0xa24c('0x4a')](_0x4e5d2c,function(_0x3835ea){if(_0x3835ea[_0xa24c('0x4b')][_0xa24c('0x4c')]!=='VIRTUAL'){var _0x34026c={};_0x34026c[_0x3835ea[_0xa24c('0x4d')]]={'$like':'%'+_0x471421[_0xa24c('0x2c')][_0xa24c('0x48')]+'%'};return _0x34026c;}})});}_0x54b8a6=_[_0xa24c('0x49')]({},_0x54b8a6,_0x471421[_0xa24c('0x4e')]);var _0x16cd65={'where':_0x54b8a6['where']};return db['CmHopper'][_0xa24c('0x17')](_0x16cd65)['then'](function(_0x295616){_0x4c86c6['count']=_0x295616;if(_0x471421[_0xa24c('0x2c')][_0xa24c('0x4f')]){_0x54b8a6[_0xa24c('0x50')]=[{'all':!![]}];}return db[_0xa24c('0x28')][_0xa24c('0x51')](_0x54b8a6);})[_0xa24c('0x20')](function(_0x302bce){_0x4c86c6[_0xa24c('0x52')]=_0x302bce;return _0x4c86c6;})[_0xa24c('0x20')](respondWithFilteredResult(_0x1a0769,_0x54b8a6))[_0xa24c('0x53')](handleError(_0x1a0769,null));};exports[_0xa24c('0x54')]=function(_0x1f87b7,_0x2e2f06){var _0x3d7de0={'raw':!![],'where':{'id':_0x1f87b7[_0xa24c('0x55')]['id']}},_0x2c60cd={};_0x2c60cd['model']=_[_0xa24c('0x2b')](db[_0xa24c('0x28')][_0xa24c('0x29')]);_0x2c60cd['query']=_[_0xa24c('0x2b')](_0x1f87b7[_0xa24c('0x2c')]);_0x2c60cd[_0xa24c('0x2d')]=_[_0xa24c('0x2e')](_0x2c60cd['model'],_0x2c60cd[_0xa24c('0x2c')]);_0x3d7de0[_0xa24c('0x40')]=_[_0xa24c('0x2e')](_0x2c60cd[_0xa24c('0x2a')],qs[_0xa24c('0x41')](_0x1f87b7[_0xa24c('0x2c')][_0xa24c('0x41')]));_0x3d7de0[_0xa24c('0x40')]=_0x3d7de0[_0xa24c('0x40')][_0xa24c('0x42')]?_0x3d7de0[_0xa24c('0x40')]:_0x2c60cd[_0xa24c('0x2a')];if(_0x1f87b7[_0xa24c('0x2c')]['includeAll']){_0x3d7de0[_0xa24c('0x50')]=[{'all':!![]}];}_0x3d7de0=_['merge']({},_0x3d7de0,_0x1f87b7[_0xa24c('0x4e')]);return db[_0xa24c('0x28')][_0xa24c('0x56')](_0x3d7de0)[_0xa24c('0x20')](handleEntityNotFound(_0x2e2f06,null))[_0xa24c('0x20')](respondWithResult(_0x2e2f06,null))[_0xa24c('0x53')](handleError(_0x2e2f06,null));};exports[_0xa24c('0x57')]=function(_0x4f1024,_0x1fb972){return db[_0xa24c('0x28')][_0xa24c('0x57')](_0x4f1024[_0xa24c('0x58')],{})[_0xa24c('0x20')](respondWithResult(_0x1fb972,0xc9))['catch'](handleError(_0x1fb972,null));};exports[_0xa24c('0x1f')]=function(_0x3e21c4,_0x3875fb){if(_0x3e21c4[_0xa24c('0x58')]['id']){delete _0x3e21c4['body']['id'];}return db[_0xa24c('0x28')][_0xa24c('0x56')]({'where':{'id':_0x3e21c4[_0xa24c('0x55')]['id']}})['then'](handleEntityNotFound(_0x3875fb,null))['then'](saveUpdates(_0x3e21c4[_0xa24c('0x58')],null))[_0xa24c('0x20')](respondWithResult(_0x3875fb,null))['catch'](handleError(_0x3875fb,null));};exports[_0xa24c('0x59')]=function(_0xeed9fe,_0x48f878){return db[_0xa24c('0x28')]['describe']()['then'](respondWithResult(_0x48f878,null))[_0xa24c('0x53')](handleError(_0x48f878,null));};exports['destroy']=function(_0x2b3d1f,_0x16f156){var _0x5c036a;return db[_0xa24c('0x28')][_0xa24c('0x56')]({'where':{'id':_0x2b3d1f[_0xa24c('0x55')]['id']}})[_0xa24c('0x20')](handleEntityNotFound(_0x16f156,null))['then'](function(_0x28a26e){if(_0x28a26e){return _0x28a26e['destroy']()[_0xa24c('0x20')](function(_0x291145){return _0x291145;});}})['then'](function(_0x49ee3f){_0x5c036a=_0x49ee3f;if(_0x49ee3f){if(_0x49ee3f[_0xa24c('0x5a')]||_0x49ee3f[_0xa24c('0x5b')]){return db[_0x49ee3f[_0xa24c('0x5a')]?_0xa24c('0x5c'):_0xa24c('0x5d')]['find']({'where':{'id':_0x49ee3f[_0xa24c('0x5a')]?_0x49ee3f['VoiceQueueId']:_0x49ee3f[_0xa24c('0x5b')]},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x583578){var _0x3fc3d9={};if(_0x583578){_['merge'](_0x3fc3d9,_['omit'](_0x5c036a[_0xa24c('0x5e')],['createdAt',_0xa24c('0x5f'),'id']));_0x3fc3d9[_0xa24c('0x60')]=0x15;_0x3fc3d9[_0xa24c('0x61')]=_0xa24c('0x62');_0x3fc3d9[_0xa24c('0x63')]=_0x583578[_0xa24c('0x25')];_0x3fc3d9[_0xa24c('0x64')]=_0x2b3d1f[_0xa24c('0x65')]['name'];_0x3fc3d9['UserId']=_0x2b3d1f[_0xa24c('0x65')]['id'];_0x3fc3d9[_0xa24c('0x62')]=!![];_0x3fc3d9['deletedat']=moment()[_0xa24c('0x66')](_0xa24c('0x67'));_0x3fc3d9['calleridnum']=_0x5c036a[_0xa24c('0x68')];_0x3fc3d9[_0xa24c('0x69')]=_0x5c036a[_0xa24c('0x5a')]?'queue':_0xa24c('0x6a');return db[_0xa24c('0x6b')]['find']({'where':{'id':_0x3fc3d9[_0xa24c('0x6c')]},'attributes':['firstName',_0xa24c('0x6d')]})[_0xa24c('0x20')](function(_0x11d30b){if(!_[_0xa24c('0x6e')](_0x16f156)&&!_[_0xa24c('0x6e')](_0x11d30b[_0xa24c('0x6f')])){_0x3fc3d9[_0xa24c('0x70')]=_0x11d30b[_0xa24c('0x6f')];if(!_[_0xa24c('0x6e')](_0x11d30b[_0xa24c('0x6d')])){_0x3fc3d9[_0xa24c('0x70')]+='\x20'+_0x11d30b[_0xa24c('0x6d')];}}})[_0xa24c('0x71')](function(){return db[_0xa24c('0x72')][_0xa24c('0x57')](_0x3fc3d9);});}})[_0xa24c('0x20')](function(){return _0x16f156[_0xa24c('0x16')](0xcc)[_0xa24c('0x15')]();})['catch'](handleError(_0x16f156,null));};exports[_0xa24c('0x73')]=function(_0x535acb,_0x267bd7,_0xc5353e){var _0xe54de4=[];return db[_0xa24c('0x6b')]['describe']()['then'](function(_0x256987){_0xe54de4=_[_0xa24c('0x2b')](_0x256987);return _0x535acb[_0xa24c('0x65')]['getVoiceQueues']({'where':{'type':_0xa24c('0x74'),'dialActive':!![],'dialMethod':_0xa24c('0x75')},'attributes':['id',_0xa24c('0x76')],'raw':!![]});})[_0xa24c('0x20')](function(_0x37b00c){if(_0x37b00c&&_0x37b00c[_0xa24c('0x42')]){return db[_0xa24c('0x77')][_0xa24c('0x78')](function(_0x26d04f){var _0xb113c3={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa24c('0x66')](_0xa24c('0x67'))},'VoiceQueueId':{'$in':_[_0xa24c('0x4a')](_0x37b00c,'id')},'$or':[{'UserId':null},{'UserId':_0x535acb[_0xa24c('0x65')]['id']}]};var _0x34acae=[];if(_0x535acb[_0xa24c('0x58')][_0xa24c('0x79')]&&_0x535acb[_0xa24c('0x58')][_0xa24c('0x79')]===_0xa24c('0x7a')){if(!_[_0xa24c('0x7b')](_0x535acb[_0xa24c('0x58')][_0xa24c('0x7c')])){_0xb113c3['id']={'$in':_0x535acb[_0xa24c('0x58')][_0xa24c('0x7c')]};}_0x34acae=[[_0xa24c('0x7d'),_0xa24c('0x7e')],[_0xa24c('0x7f'),_0x37b00c[0x0][_0xa24c('0x76')]===_0xa24c('0x7e')?'DESC':_0xa24c('0x7e')],db['sequelize'][_0xa24c('0x80')](_0xa24c('0x81')),['id',_0xa24c('0x82')]];}else{if(!_[_0xa24c('0x7b')](_0x535acb['body'][_0xa24c('0x7c')])){_0xb113c3['id']={'$notIn':_0x535acb[_0xa24c('0x58')][_0xa24c('0x7c')]};}_0x34acae=[['priority',_0xa24c('0x82')],['scheduledAt',_0x37b00c[0x0][_0xa24c('0x76')]],db[_0xa24c('0x77')][_0xa24c('0x80')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xa24c('0x7e')]];}return db[_0xa24c('0x28')]['findOne']({'attributes':['id',_0xa24c('0x83')],'where':_0xb113c3,'order':_0x34acae,'transaction':_0x26d04f,'lock':_0x26d04f[_0xa24c('0x84')][_0xa24c('0x85')],'include':[{'model':db[_0xa24c('0x6b')],'as':_0xa24c('0x86'),'attributes':_0xe54de4,'include':[{'model':db[_0xa24c('0x87')],'as':_0xa24c('0x88'),'attributes':['id',_0xa24c('0x25')]}]},{'model':db[_0xa24c('0x89')],'as':_0xa24c('0x8a'),'attributes':['id',_0xa24c('0x25')]},{'model':db[_0xa24c('0x5c')],'as':_0xa24c('0x8b'),'attributes':['id',_0xa24c('0x25'),_0xa24c('0x8c')]}]})[_0xa24c('0x20')](function(_0x58fb81){if(_0x58fb81){return _0x58fb81[_0xa24c('0x1f')]({'UserId':_0x535acb[_0xa24c('0x65')]['id']},{'transaction':_0x26d04f});}});});}})[_0xa24c('0x20')](handleEntityNotFound(_0x267bd7,null))[_0xa24c('0x20')](respondWithResult(_0x267bd7,null))[_0xa24c('0x53')](handleError(_0x267bd7,null));};exports['getOpenContacts']=function(_0x5cb30c,_0x18c89a,_0x3436c3){return _0x5cb30c[_0xa24c('0x65')][_0xa24c('0x8d')]({'where':{'type':_0xa24c('0x74'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0xa24c('0x20')](function(_0x365eeb){if(_0x365eeb&&_0x365eeb[_0xa24c('0x42')]){return db['CmHopper'][_0xa24c('0x17')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x365eeb,'id')},'$or':[{'UserId':null},{'UserId':_0x5cb30c[_0xa24c('0x65')]['id']}]}});}return 0x0;})[_0xa24c('0x20')](function(_0x83bfa6){if(!_[_0xa24c('0x6e')](_0x83bfa6)&&_['isNumber'](_0x83bfa6)){return _0x18c89a[_0xa24c('0x16')](0xc8)[_0xa24c('0x1c')]({'contacts':_0x83bfa6});}else{logger[_0xa24c('0x23')](_0xa24c('0x8e'),_0xa24c('0x8f'),0x194,'entity\x20not\x20found');_0x18c89a[_0xa24c('0x22')](0x194);}})[_0xa24c('0x53')](handleError(_0x18c89a,null));}; \ No newline at end of file +var _0xb903=['rawAttributes','keys','query','filters','intersection','model','concat','$or','$gt','$gte','$lt','$eq','$not','$between','$in','$notLike','$iLike','$like','$overlap','$contains','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','count','includeAll','findAll','params','include','find','catch','create','body','describe','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','outbound','dialOrderByScheduledAt','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','dialActive','getVoiceQueues','length','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','CmHopper'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0xb903,0x185));var _0x3b90=function(_0x176a46,_0x49942c){_0x176a46=_0x176a46-0x0;var _0x44cb5b=_0xb903[_0x176a46];return _0x44cb5b;};'use strict';var pdf=require(_0x3b90('0x0'));var emlformat=require(_0x3b90('0x1'));var rimraf=require(_0x3b90('0x2'));var zipdir=require(_0x3b90('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b90('0x4'));var moment=require(_0x3b90('0x5'));var BPromise=require(_0x3b90('0x6'));var Mustache=require(_0x3b90('0x7'));var util=require(_0x3b90('0x8'));var path=require(_0x3b90('0x9'));var sox=require(_0x3b90('0xa'));var csv=require('to-csv');var ejs=require(_0x3b90('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3b90('0xc'));var jsforce=require(_0x3b90('0xd'));var deskjs=require(_0x3b90('0xe'));var toCsv=require(_0x3b90('0xf'));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(_0x3b90('0x10'))(_0x3b90('0x11'));var utils=require('../../config/utils');var config=require(_0x3b90('0x12'));var db=require(_0x3b90('0x13'))['db'];function respondWithStatusCode(_0x4bb8f4,_0x45b75f){_0x45b75f=_0x45b75f||0xcc;return function(_0x174c0d){if(_0x174c0d){return _0x4bb8f4[_0x3b90('0x14')](_0x45b75f);}return _0x4bb8f4['status'](_0x45b75f)['end']();};}function respondWithResult(_0x58c4d1,_0x542cb3){_0x542cb3=_0x542cb3||0xc8;return function(_0x492d39){if(_0x492d39){return _0x58c4d1[_0x3b90('0x15')](_0x542cb3)[_0x3b90('0x16')](_0x492d39);}};}function respondWithFilteredResult(_0x4824f9,_0x51fb66){return function(_0x3725b9){if(_0x3725b9){var _0x1b6349=_0x3725b9['count'],_0x381a9e=_0x51fb66['offset'],_0x1af265=_0x51fb66[_0x3b90('0x17')]+_0x51fb66[_0x3b90('0x18')],_0x1efe01;if(_0x1af265>=_0x1b6349){_0x1af265=_0x1b6349;_0x1efe01=0xc8;}else{_0x1efe01=0xce;}_0x4824f9['status'](_0x1efe01);return _0x4824f9[_0x3b90('0x19')](_0x3b90('0x1a'),_0x381a9e+'-'+_0x1af265+'/'+_0x1b6349)[_0x3b90('0x16')](_0x3725b9);}return null;};}function patchUpdates(_0x131f3f){return function(_0x4f388b){try{jsonpatch[_0x3b90('0x1b')](_0x4f388b,_0x131f3f,!![]);}catch(_0x5d140f){return BPromise[_0x3b90('0x1c')](_0x5d140f);}return _0x4f388b[_0x3b90('0x1d')]();};}function saveUpdates(_0x535894,_0x39ae7c){return function(_0x12e1cf){if(_0x12e1cf){return _0x12e1cf[_0x3b90('0x1e')](_0x535894)[_0x3b90('0x1f')](function(_0xc74d57){return _0xc74d57;});}return null;};}function removeEntity(_0x43deca,_0x3bc7d5){return function(_0x2f4270){if(_0x2f4270){return _0x2f4270[_0x3b90('0x20')]()[_0x3b90('0x1f')](function(){_0x43deca['status'](0xcc)[_0x3b90('0x21')]();});}};}function handleEntityNotFound(_0x36b93e,_0x175b42){return function(_0x7faee){if(!_0x7faee){_0x36b93e[_0x3b90('0x14')](0x194);}return _0x7faee;};}function handleError(_0x93b8e7,_0x58fa12){_0x58fa12=_0x58fa12||0x1f4;return function(_0x4b308c){logger[_0x3b90('0x22')](_0x4b308c[_0x3b90('0x23')]);if(_0x4b308c[_0x3b90('0x24')]){delete _0x4b308c[_0x3b90('0x24')];}_0x93b8e7['status'](_0x58fa12)[_0x3b90('0x25')](_0x4b308c);};}exports[_0x3b90('0x26')]=function(_0x1787d1,_0x4caead){var _0x14752c={},_0x138d79={},_0x17ec7f={'count':0x0,'rows':[]};var _0x33c07a=db[_0x3b90('0x27')][_0x3b90('0x28')];_0x138d79['model']=_[_0x3b90('0x29')](_0x33c07a);_0x138d79['query']=_[_0x3b90('0x29')](_0x1787d1[_0x3b90('0x2a')]);_0x138d79[_0x3b90('0x2b')]=_[_0x3b90('0x2c')](_0x138d79[_0x3b90('0x2d')],_0x138d79[_0x3b90('0x2a')]);_0x138d79[_0x3b90('0x2b')]=_[_0x3b90('0x2e')](_0x138d79['filters'],['$and',_0x3b90('0x2f'),_0x3b90('0x30'),_0x3b90('0x31'),_0x3b90('0x32'),'$lte','$ne',_0x3b90('0x33'),_0x3b90('0x34'),_0x3b90('0x35'),'$notBetween',_0x3b90('0x36'),'$notIn','$like',_0x3b90('0x37'),_0x3b90('0x38'),'$notILike',_0x3b90('0x39'),_0x3b90('0x3a'),_0x3b90('0x3b'),'$contained','$any']);_0x14752c[_0x3b90('0x3c')]=_[_0x3b90('0x2c')](_0x138d79[_0x3b90('0x2d')],qs[_0x3b90('0x3d')](_0x1787d1['query']['fields']));_0x14752c[_0x3b90('0x3c')]=_0x14752c[_0x3b90('0x3c')]['length']?_0x14752c['attributes']:_0x138d79[_0x3b90('0x2d')];if(!_0x1787d1[_0x3b90('0x2a')][_0x3b90('0x3e')](_0x3b90('0x3f'))){_0x14752c['limit']=qs[_0x3b90('0x18')](_0x1787d1['query'][_0x3b90('0x18')]);_0x14752c[_0x3b90('0x17')]=qs[_0x3b90('0x17')](_0x1787d1[_0x3b90('0x2a')][_0x3b90('0x17')]);}_0x14752c[_0x3b90('0x40')]=qs[_0x3b90('0x41')](_0x1787d1['query'][_0x3b90('0x41')]);_0x14752c[_0x3b90('0x42')]=qs[_0x3b90('0x2b')](_[_0x3b90('0x43')](_0x1787d1[_0x3b90('0x2a')],_0x138d79[_0x3b90('0x2b')]));if(_0x1787d1[_0x3b90('0x2a')][_0x3b90('0x44')]){_0x14752c[_0x3b90('0x42')]=_['merge'](_0x14752c[_0x3b90('0x42')],{'$or':_[_0x3b90('0x45')](_0x33c07a,function(_0x40ce3a){if(_0x40ce3a[_0x3b90('0x46')][_0x3b90('0x47')]!==_0x3b90('0x48')){var _0x1a76cb={};_0x1a76cb[_0x40ce3a[_0x3b90('0x49')]]={'$like':'%'+_0x1787d1[_0x3b90('0x2a')][_0x3b90('0x44')]+'%'};return _0x1a76cb;}})});}_0x14752c=_[_0x3b90('0x4a')]({},_0x14752c,_0x1787d1[_0x3b90('0x4b')]);var _0x39c61c={'where':_0x14752c[_0x3b90('0x42')]};return db[_0x3b90('0x27')][_0x3b90('0x4c')](_0x39c61c)[_0x3b90('0x1f')](function(_0xe4559f){_0x17ec7f[_0x3b90('0x4c')]=_0xe4559f;if(_0x1787d1[_0x3b90('0x2a')][_0x3b90('0x4d')]){_0x14752c['include']=[{'all':!![]}];}return db[_0x3b90('0x27')][_0x3b90('0x4e')](_0x14752c);})[_0x3b90('0x1f')](function(_0x1b4631){_0x17ec7f['rows']=_0x1b4631;return _0x17ec7f;})[_0x3b90('0x1f')](respondWithFilteredResult(_0x4caead,_0x14752c))['catch'](handleError(_0x4caead,null));};exports['show']=function(_0x283419,_0x2644ec){var _0x49187d={'raw':!![],'where':{'id':_0x283419[_0x3b90('0x4f')]['id']}},_0x1412b3={};_0x1412b3[_0x3b90('0x2d')]=_[_0x3b90('0x29')](db[_0x3b90('0x27')][_0x3b90('0x28')]);_0x1412b3[_0x3b90('0x2a')]=_[_0x3b90('0x29')](_0x283419[_0x3b90('0x2a')]);_0x1412b3['filters']=_[_0x3b90('0x2c')](_0x1412b3[_0x3b90('0x2d')],_0x1412b3['query']);_0x49187d[_0x3b90('0x3c')]=_[_0x3b90('0x2c')](_0x1412b3[_0x3b90('0x2d')],qs[_0x3b90('0x3d')](_0x283419[_0x3b90('0x2a')]['fields']));_0x49187d['attributes']=_0x49187d[_0x3b90('0x3c')]['length']?_0x49187d[_0x3b90('0x3c')]:_0x1412b3[_0x3b90('0x2d')];if(_0x283419[_0x3b90('0x2a')][_0x3b90('0x4d')]){_0x49187d[_0x3b90('0x50')]=[{'all':!![]}];}_0x49187d=_['merge']({},_0x49187d,_0x283419['options']);return db[_0x3b90('0x27')][_0x3b90('0x51')](_0x49187d)[_0x3b90('0x1f')](handleEntityNotFound(_0x2644ec,null))['then'](respondWithResult(_0x2644ec,null))[_0x3b90('0x52')](handleError(_0x2644ec,null));};exports[_0x3b90('0x53')]=function(_0x18d59b,_0x1aaa2b){return db[_0x3b90('0x27')][_0x3b90('0x53')](_0x18d59b[_0x3b90('0x54')],{})[_0x3b90('0x1f')](respondWithResult(_0x1aaa2b,0xc9))[_0x3b90('0x52')](handleError(_0x1aaa2b,null));};exports['update']=function(_0xcc2f56,_0x407784){if(_0xcc2f56[_0x3b90('0x54')]['id']){delete _0xcc2f56['body']['id'];}return db[_0x3b90('0x27')]['find']({'where':{'id':_0xcc2f56[_0x3b90('0x4f')]['id']}})[_0x3b90('0x1f')](handleEntityNotFound(_0x407784,null))[_0x3b90('0x1f')](saveUpdates(_0xcc2f56['body'],null))[_0x3b90('0x1f')](respondWithResult(_0x407784,null))[_0x3b90('0x52')](handleError(_0x407784,null));};exports['describe']=function(_0x499ec1,_0x9ff1f4){return db[_0x3b90('0x27')][_0x3b90('0x55')]()[_0x3b90('0x1f')](respondWithResult(_0x9ff1f4,null))['catch'](handleError(_0x9ff1f4,null));};exports['destroy']=function(_0x2b348f,_0x4698ac){var _0x15ed71;return db[_0x3b90('0x27')][_0x3b90('0x51')]({'where':{'id':_0x2b348f[_0x3b90('0x4f')]['id']}})[_0x3b90('0x1f')](handleEntityNotFound(_0x4698ac,null))[_0x3b90('0x1f')](function(_0x30f446){if(_0x30f446){return _0x30f446['destroy']()[_0x3b90('0x1f')](function(_0x13427d){return _0x13427d;});}})['then'](function(_0x1d211a){_0x15ed71=_0x1d211a;if(_0x1d211a){if(_0x1d211a[_0x3b90('0x56')]||_0x1d211a['CampaignId']){return db[_0x1d211a[_0x3b90('0x56')]?_0x3b90('0x57'):_0x3b90('0x58')][_0x3b90('0x51')]({'where':{'id':_0x1d211a[_0x3b90('0x56')]?_0x1d211a[_0x3b90('0x56')]:_0x1d211a[_0x3b90('0x59')]},'attributes':['id','name'],'raw':!![]});}}})[_0x3b90('0x1f')](function(_0x3f5e1d){var _0x32a179={};if(_0x3f5e1d){_[_0x3b90('0x4a')](_0x32a179,_[_0x3b90('0x5a')](_0x15ed71[_0x3b90('0x5b')],[_0x3b90('0x5c'),_0x3b90('0x5d'),'id']));_0x32a179[_0x3b90('0x5e')]=0x15;_0x32a179[_0x3b90('0x5f')]=_0x3b90('0x60');_0x32a179[_0x3b90('0x61')]=_0x3f5e1d[_0x3b90('0x24')];_0x32a179[_0x3b90('0x62')]=_0x2b348f[_0x3b90('0x63')]['name'];_0x32a179[_0x3b90('0x64')]=_0x2b348f['user']['id'];_0x32a179[_0x3b90('0x60')]=!![];_0x32a179[_0x3b90('0x65')]=moment()[_0x3b90('0x66')](_0x3b90('0x67'));_0x32a179[_0x3b90('0x68')]=_0x15ed71[_0x3b90('0x69')];_0x32a179['campaigntype']=_0x15ed71[_0x3b90('0x56')]?_0x3b90('0x6a'):_0x3b90('0x6b');return db[_0x3b90('0x6c')][_0x3b90('0x51')]({'where':{'id':_0x32a179[_0x3b90('0x6d')]},'attributes':['firstName',_0x3b90('0x6e')]})[_0x3b90('0x1f')](function(_0xb41920){if(!_['isNil'](_0x4698ac)&&!_[_0x3b90('0x6f')](_0xb41920[_0x3b90('0x70')])){_0x32a179[_0x3b90('0x71')]=_0xb41920[_0x3b90('0x70')];if(!_[_0x3b90('0x6f')](_0xb41920[_0x3b90('0x6e')])){_0x32a179[_0x3b90('0x71')]+='\x20'+_0xb41920[_0x3b90('0x6e')];}}})[_0x3b90('0x72')](function(){return db['CmHopperFinal'][_0x3b90('0x53')](_0x32a179);});}})['then'](function(){return _0x4698ac['status'](0xcc)[_0x3b90('0x21')]();})[_0x3b90('0x52')](handleError(_0x4698ac,null));};exports['getPreview']=function(_0x13dd30,_0x1a2592,_0x287be4){var _0x1842f9=[];return db[_0x3b90('0x6c')][_0x3b90('0x55')]()[_0x3b90('0x1f')](function(_0x5441c4){_0x1842f9=_['keys'](_0x5441c4);return _0x13dd30[_0x3b90('0x63')]['getVoiceQueues']({'where':{'type':_0x3b90('0x73'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x3b90('0x74')],'raw':!![]});})['then'](function(_0x532e98){if(_0x532e98&&_0x532e98['length']){return db[_0x3b90('0x75')][_0x3b90('0x76')](function(_0x33fca6){var _0x2d8a4b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x3b90('0x66')](_0x3b90('0x67'))},'VoiceQueueId':{'$in':_[_0x3b90('0x45')](_0x532e98,'id')},'$or':[{'UserId':null},{'UserId':_0x13dd30['user']['id']}]};var _0x5acf97=[];if(_0x13dd30['body'][_0x3b90('0x77')]&&_0x13dd30[_0x3b90('0x54')]['direction']===_0x3b90('0x78')){if(!_[_0x3b90('0x79')](_0x13dd30[_0x3b90('0x54')][_0x3b90('0x7a')])){_0x2d8a4b['id']={'$in':_0x13dd30[_0x3b90('0x54')][_0x3b90('0x7a')]};}_0x5acf97=[[_0x3b90('0x7b'),_0x3b90('0x7c')],[_0x3b90('0x7d'),_0x532e98[0x0]['dialOrderByScheduledAt']===_0x3b90('0x7c')?'DESC':_0x3b90('0x7c')],db[_0x3b90('0x75')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x3b90('0x7e')]];}else{if(!_[_0x3b90('0x79')](_0x13dd30[_0x3b90('0x54')][_0x3b90('0x7a')])){_0x2d8a4b['id']={'$notIn':_0x13dd30[_0x3b90('0x54')][_0x3b90('0x7a')]};}_0x5acf97=[['priority',_0x3b90('0x7e')],[_0x3b90('0x7d'),_0x532e98[0x0][_0x3b90('0x74')]],db['sequelize'][_0x3b90('0x7f')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x3b90('0x7c')]];}return db[_0x3b90('0x27')][_0x3b90('0x80')]({'attributes':['id',_0x3b90('0x81')],'where':_0x2d8a4b,'order':_0x5acf97,'transaction':_0x33fca6,'lock':_0x33fca6[_0x3b90('0x82')][_0x3b90('0x83')],'include':[{'model':db['CmContact'],'as':_0x3b90('0x84'),'attributes':_0x1842f9,'include':[{'model':db[_0x3b90('0x85')],'as':_0x3b90('0x86'),'attributes':['id',_0x3b90('0x24')]}]},{'model':db[_0x3b90('0x87')],'as':_0x3b90('0x88'),'attributes':['id',_0x3b90('0x24')]},{'model':db[_0x3b90('0x57')],'as':'Queue','attributes':['id',_0x3b90('0x24'),_0x3b90('0x89')]}]})[_0x3b90('0x1f')](function(_0x27ea71){if(_0x27ea71){return _0x27ea71[_0x3b90('0x1e')]({'UserId':_0x13dd30[_0x3b90('0x63')]['id']},{'transaction':_0x33fca6});}});});}})[_0x3b90('0x1f')](handleEntityNotFound(_0x1a2592,null))[_0x3b90('0x1f')](respondWithResult(_0x1a2592,null))['catch'](handleError(_0x1a2592,null));};exports['getOpenContacts']=function(_0x3d0fde,_0x1f05a9,_0x7d9bf5){return _0x3d0fde['user'][_0x3b90('0x8a')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x3b90('0x1f')](function(_0x300d72){if(_0x300d72&&_0x300d72[_0x3b90('0x8b')]){return db[_0x3b90('0x27')][_0x3b90('0x4c')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x3b90('0x66')](_0x3b90('0x67'))},'VoiceQueueId':{'$in':_[_0x3b90('0x45')](_0x300d72,'id')},'$or':[{'UserId':null},{'UserId':_0x3d0fde[_0x3b90('0x63')]['id']}]}});}return 0x0;})[_0x3b90('0x1f')](function(_0x1c4424){if(!_[_0x3b90('0x6f')](_0x1c4424)&&_[_0x3b90('0x8c')](_0x1c4424)){return _0x1f05a9[_0x3b90('0x15')](0xc8)[_0x3b90('0x16')]({'contacts':_0x1c4424});}else{logger['error'](_0x3b90('0x8d'),_0x3b90('0x8e'),0x194,'entity\x20not\x20found');_0x1f05a9[_0x3b90('0x14')](0x194);}})['catch'](handleError(_0x1f05a9,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index eb9b08f..455a1b9 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 _0xe605=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','cm_hopper','phone','priority','lodash','util','api','moment'];(function(_0x1a8a3c,_0x211e1c){var _0x5724d7=function(_0x3ff915){while(--_0x3ff915){_0x1a8a3c['push'](_0x1a8a3c['shift']());}};_0x5724d7(++_0x211e1c);}(_0xe605,0x92));var _0x5e60=function(_0x1862e3,_0x2eef93){_0x1862e3=_0x1862e3-0x0;var _0xd9aaac=_0xe605[_0x1862e3];return _0xd9aaac;};'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')]('CmHopper',attributes,{'tableName':_0x5e60('0xc'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':['scheduledat']},{'name':'phone','fields':[_0x5e60('0xd')]},{'name':_0x5e60('0xe'),'fields':[_0x5e60('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0102=['util','../../config/logger','api','moment','./cmHopper.attributes','exports','CmHopper','scheduledat','phone','priority'];(function(_0x887c1e,_0x269a52){var _0x5ce07f=function(_0x3dc50b){while(--_0x3dc50b){_0x887c1e['push'](_0x887c1e['shift']());}};_0x5ce07f(++_0x269a52);}(_0x0102,0x186));var _0x2010=function(_0x4afa50,_0x5163cb){_0x4afa50=_0x4afa50-0x0;var _0x5c12b9=_0x0102[_0x4afa50];return _0x5c12b9;};'use strict';var _=require('lodash');var util=require(_0x2010('0x0'));var logger=require(_0x2010('0x1'))(_0x2010('0x2'));var moment=require(_0x2010('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(_0x2010('0x4'));module[_0x2010('0x5')]=function(_0x130725,_0x304264){return _0x130725['define'](_0x2010('0x6'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x2010('0x7'),'fields':[_0x2010('0x7')]},{'name':'phone','fields':[_0x2010('0x8')]},{'name':_0x2010('0x9'),'fields':[_0x2010('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 79f04fd..dc67539 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 _0xdc28=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCmHopper','findAll','options','where','attributes','limit','include','map','model','ShowCmHopper','CmHopper','find','raw','create','body','CreateCmHopper','update','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','sequelize','order','LOCK','UPDATE','Contact','push','all','MoveContactManagedDialer','transaction','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','CmContact','UserId','length','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x59293b,_0x1a2817){var _0x576069=function(_0x2ba7db){while(--_0x2ba7db){_0x59293b['push'](_0x59293b['shift']());}};_0x576069(++_0x1a2817);}(_0xdc28,0x190));var _0x8dc2=function(_0x1677bf,_0x10fccf){_0x1677bf=_0x1677bf-0x0;var _0x7cab18=_0xdc28[_0x1677bf];return _0x7cab18;};'use strict';var _=require(_0x8dc2('0x0'));var util=require(_0x8dc2('0x1'));var moment=require(_0x8dc2('0x2'));var BPromise=require(_0x8dc2('0x3'));var rs=require(_0x8dc2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8dc2('0x5'))['db'];var utils=require(_0x8dc2('0x6'));var logger=require(_0x8dc2('0x7'))(_0x8dc2('0x8'));var config=require(_0x8dc2('0x9'));var jayson=require(_0x8dc2('0xa'));var client=jayson[_0x8dc2('0xb')][_0x8dc2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x528807,_0x18c7f8,_0x424e3a){return new BPromise(function(_0x2f2d71,_0x5cff1c){return client[_0x8dc2('0xd')](_0x528807,_0x424e3a)[_0x8dc2('0xe')](function(_0xc59770){logger[_0x8dc2('0xf')](_0x8dc2('0x10'),_0x18c7f8,_0x8dc2('0x11'));logger[_0x8dc2('0x12')](_0x8dc2('0x13'),_0x18c7f8,_0x8dc2('0x11'),JSON[_0x8dc2('0x14')](_0xc59770));if(_0xc59770[_0x8dc2('0x15')]){if(_0xc59770[_0x8dc2('0x15')][_0x8dc2('0x16')]===0x1f4){logger['error']('CmHopper,\x20%s,\x20%s',_0x18c7f8,_0xc59770[_0x8dc2('0x15')][_0x8dc2('0x17')]);return _0x5cff1c(_0xc59770[_0x8dc2('0x15')][_0x8dc2('0x17')]);}logger['error']('CmHopper,\x20%s,\x20%s',_0x18c7f8,_0xc59770[_0x8dc2('0x15')][_0x8dc2('0x17')]);return _0x2f2d71(_0xc59770[_0x8dc2('0x15')][_0x8dc2('0x17')]);}else{logger['info'](_0x8dc2('0x10'),_0x18c7f8,'request\x20sent');_0x2f2d71(_0xc59770['result']['message']);}})[_0x8dc2('0x18')](function(_0x4bd21f){logger['error']('CmHopper,\x20%s,\x20%s',_0x18c7f8,_0x4bd21f);_0x5cff1c(_0x4bd21f);});});}exports[_0x8dc2('0x19')]=function(_0x44734b){var _0x1e606d=this;return new Promise(function(_0x151978,_0x15a15f){return db['CmHopper'][_0x8dc2('0x1a')]({'raw':_0x44734b[_0x8dc2('0x1b')]?_0x44734b[_0x8dc2('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x44734b[_0x8dc2('0x1b')]?_0x44734b[_0x8dc2('0x1b')][_0x8dc2('0x1c')]||null:null,'attributes':_0x44734b[_0x8dc2('0x1b')]?_0x44734b[_0x8dc2('0x1b')][_0x8dc2('0x1d')]||null:null,'limit':_0x44734b[_0x8dc2('0x1b')]?_0x44734b[_0x8dc2('0x1b')][_0x8dc2('0x1e')]||null:null,'include':_0x44734b[_0x8dc2('0x1b')]?_0x44734b[_0x8dc2('0x1b')][_0x8dc2('0x1f')]?_[_0x8dc2('0x20')](_0x44734b['options']['include'],function(_0x4f7785){return{'model':db[_0x4f7785[_0x8dc2('0x21')]],'as':_0x4f7785['as'],'attributes':_0x4f7785['attributes'],'include':_0x4f7785['include']?_[_0x8dc2('0x20')](_0x4f7785[_0x8dc2('0x1f')],function(_0x4e5b32){return{'model':db[_0x4e5b32['model']],'as':_0x4e5b32['as'],'attributes':_0x4e5b32[_0x8dc2('0x1d')],'include':_0x4e5b32[_0x8dc2('0x1f')]?_[_0x8dc2('0x20')](_0x4e5b32[_0x8dc2('0x1f')],function(_0x1ab5a5){return{'model':db[_0x1ab5a5[_0x8dc2('0x21')]],'as':_0x1ab5a5['as'],'attributes':_0x1ab5a5[_0x8dc2('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x516279){logger[_0x8dc2('0xf')](_0x8dc2('0x19'),_0x44734b);logger[_0x8dc2('0x12')]('GetCmHopper',_0x44734b,JSON[_0x8dc2('0x14')](_0x516279));_0x151978(_0x516279);})[_0x8dc2('0x18')](function(_0x327b20){logger[_0x8dc2('0x15')]('GetCmHopper',_0x327b20['message'],_0x44734b);_0x15a15f(_0x1e606d[_0x8dc2('0x15')](0x1f4,_0x327b20[_0x8dc2('0x17')]));});});};exports[_0x8dc2('0x22')]=function(_0x259daf){var _0x5787f8=this;return new Promise(function(_0x3e335a,_0x10c38f){return db[_0x8dc2('0x23')][_0x8dc2('0x24')]({'raw':_0x259daf[_0x8dc2('0x1b')]?_0x259daf['options'][_0x8dc2('0x25')]===undefined?!![]:![]:!![],'where':_0x259daf[_0x8dc2('0x1b')]?_0x259daf[_0x8dc2('0x1b')][_0x8dc2('0x1c')]||null:null,'attributes':_0x259daf['options']?_0x259daf[_0x8dc2('0x1b')][_0x8dc2('0x1d')]||null:null,'include':_0x259daf[_0x8dc2('0x1b')]?_0x259daf[_0x8dc2('0x1b')][_0x8dc2('0x1f')]?_[_0x8dc2('0x20')](_0x259daf[_0x8dc2('0x1b')][_0x8dc2('0x1f')],function(_0x278692){return{'model':db[_0x278692[_0x8dc2('0x21')]],'as':_0x278692['as'],'attributes':_0x278692[_0x8dc2('0x1d')],'include':_0x278692[_0x8dc2('0x1f')]?_[_0x8dc2('0x20')](_0x278692[_0x8dc2('0x1f')],function(_0x4f7b86){return{'model':db[_0x4f7b86['model']],'as':_0x4f7b86['as'],'attributes':_0x4f7b86[_0x8dc2('0x1d')],'include':_0x4f7b86['include']?_[_0x8dc2('0x20')](_0x4f7b86[_0x8dc2('0x1f')],function(_0x4a3d1c){return{'model':db[_0x4a3d1c[_0x8dc2('0x21')]],'as':_0x4a3d1c['as'],'attributes':_0x4a3d1c['attributes']};}):[]};}):[]};}):[]:[]})[_0x8dc2('0xe')](function(_0x280544){logger[_0x8dc2('0xf')](_0x8dc2('0x22'),_0x259daf);logger[_0x8dc2('0x12')](_0x8dc2('0x22'),_0x259daf,JSON['stringify'](_0x280544));_0x3e335a(_0x280544);})[_0x8dc2('0x18')](function(_0x3d4b2f){logger['error'](_0x8dc2('0x22'),_0x3d4b2f[_0x8dc2('0x17')],_0x259daf);_0x10c38f(_0x5787f8['error'](0x1f4,_0x3d4b2f['message']));});});};exports['CreateCmHopper']=function(_0x448b0e){var _0x11e409=this;return new Promise(function(_0x251ff7,_0x31c6f1){return db['CmHopper'][_0x8dc2('0x26')](_0x448b0e[_0x8dc2('0x27')],{'raw':_0x448b0e[_0x8dc2('0x1b')]?_0x448b0e[_0x8dc2('0x1b')][_0x8dc2('0x25')]===undefined?!![]:![]:!![]})[_0x8dc2('0xe')](function(_0x581080){logger[_0x8dc2('0xf')](_0x8dc2('0x28'),_0x448b0e);logger[_0x8dc2('0x12')]('CreateCmHopper',_0x448b0e,JSON[_0x8dc2('0x14')](_0x581080));_0x251ff7(_0x581080);})['catch'](function(_0x36c2eb){logger[_0x8dc2('0x15')](_0x8dc2('0x28'),_0x36c2eb['message'],_0x448b0e);_0x31c6f1(_0x11e409[_0x8dc2('0x15')](0x1f4,_0x36c2eb[_0x8dc2('0x17')]));});});};exports['UpdateCmHopper']=function(_0x35b85d){var _0x53b7a8=this;return new Promise(function(_0x999882,_0x356e26){return db[_0x8dc2('0x23')][_0x8dc2('0x29')](_0x35b85d[_0x8dc2('0x27')],{'raw':_0x35b85d['options']?_0x35b85d['options'][_0x8dc2('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35b85d[_0x8dc2('0x1b')]?_0x35b85d[_0x8dc2('0x1b')][_0x8dc2('0x1c')]||null:null,'attributes':_0x35b85d[_0x8dc2('0x1b')]?_0x35b85d[_0x8dc2('0x1b')]['attributes']||null:null,'limit':_0x35b85d[_0x8dc2('0x1b')]?_0x35b85d[_0x8dc2('0x1b')][_0x8dc2('0x1e')]||null:null})[_0x8dc2('0xe')](function(_0x23504b){logger[_0x8dc2('0xf')]('UpdateCmHopper',_0x35b85d);logger[_0x8dc2('0x12')]('UpdateCmHopper',_0x35b85d,JSON[_0x8dc2('0x14')](_0x23504b));_0x999882(_0x23504b);})['catch'](function(_0x335f47){logger[_0x8dc2('0x15')](_0x8dc2('0x2a'),_0x335f47[_0x8dc2('0x17')],_0x35b85d);_0x356e26(_0x53b7a8[_0x8dc2('0x15')](0x1f4,_0x335f47[_0x8dc2('0x17')]));});});};exports['DestroyCmHopper']=function(_0xbe82e4){var _0x3ee415=this;return new Promise(function(_0x258c51,_0x417c25){return db['CmHopper'][_0x8dc2('0x2b')]({'where':_0xbe82e4[_0x8dc2('0x1b')]?_0xbe82e4[_0x8dc2('0x1b')][_0x8dc2('0x1c')]||null:null})[_0x8dc2('0xe')](function(_0x290f22){logger[_0x8dc2('0xf')](_0x8dc2('0x2c'),_0xbe82e4);logger['debug'](_0x8dc2('0x2c'),_0xbe82e4,JSON[_0x8dc2('0x14')](_0x290f22));_0x258c51(_0x290f22);})[_0x8dc2('0x18')](function(_0x4cbab6){logger[_0x8dc2('0x15')]('DestroyCmHopper',_0x4cbab6[_0x8dc2('0x17')],_0xbe82e4);_0x417c25(_0x3ee415[_0x8dc2('0x15')](0x1f4,_0x4cbab6[_0x8dc2('0x17')]));});});};exports[_0x8dc2('0x2d')]=function(_0x284238){var _0x26f2dd=this;return new Promise(function(_0x3a013f,_0x30ed27){return db['CmContact']['describe']()[_0x8dc2('0xe')](function(_0x34afc8){return db[_0x8dc2('0x2e')]['transaction'](function(_0x3cfa4d){return db[_0x8dc2('0x23')][_0x8dc2('0x1a')]({'where':_0x284238[_0x8dc2('0x1b')]?_0x284238[_0x8dc2('0x1b')][_0x8dc2('0x1c')]||null:null,'attributes':_0x284238['options']?_0x284238[_0x8dc2('0x1b')]['attributes']||null:null,'limit':_0x284238[_0x8dc2('0x1b')]?_0x284238['options'][_0x8dc2('0x1e')]||null:null,'order':_0x284238['options']?_0x284238['options'][_0x8dc2('0x2f')]||null:null,'transaction':_0x3cfa4d,'lock':_0x3cfa4d[_0x8dc2('0x30')][_0x8dc2('0x31')],'include':[{'model':db['CmContact'],'as':_0x8dc2('0x32'),'attributes':_['keys'](_0x34afc8)}]})[_0x8dc2('0xe')](function(_0x3ed517){var _0x170d3d=[];for(var _0xb0f55f=0x0;_0xb0f55f<_0x3ed517['length'];_0xb0f55f+=0x1){_0x170d3d[_0x8dc2('0x33')](_0x3ed517[_0xb0f55f]['update'](_0x284238['body'],{'transaction':_0x3cfa4d}));}return BPromise[_0x8dc2('0x34')](_0x170d3d);});})[_0x8dc2('0xe')](function(_0x1c73f6){logger[_0x8dc2('0xf')](_0x8dc2('0x2d'),_0x284238);logger['debug'](_0x8dc2('0x2d'),_0x284238,JSON['stringify'](_0x1c73f6));_0x3a013f(_0x1c73f6);})['catch'](function(_0x5edaf9){logger[_0x8dc2('0x15')]('GetContactDialer',_0x5edaf9['message'],_0x284238);_0x30ed27(_0x26f2dd[_0x8dc2('0x15')](0x1f4,_0x5edaf9['message']));});});});};exports[_0x8dc2('0x35')]=function(_0x32bc5b){var _0x44dc90=this;return new Promise(function(_0x3db080,_0xf4df3f){return db[_0x8dc2('0x2e')][_0x8dc2('0x36')](function(_0x595033){return db['CmHopperFinal'][_0x8dc2('0x26')](_0x32bc5b['body'],{'raw':_0x32bc5b[_0x8dc2('0x1b')]?_0x32bc5b['options'][_0x8dc2('0x25')]===undefined?!![]:![]:!![],'transaction':_0x595033})[_0x8dc2('0xe')](function(){return db[_0x8dc2('0x23')]['destroy']({'where':_0x32bc5b[_0x8dc2('0x1b')]?_0x32bc5b['options'][_0x8dc2('0x1c')]||null:null,'transaction':_0x595033});});})[_0x8dc2('0xe')](function(_0x31c03c){logger[_0x8dc2('0xf')]('MoveContactManagedDialer',_0x32bc5b);logger[_0x8dc2('0x12')](_0x8dc2('0x35'),_0x32bc5b,JSON[_0x8dc2('0x14')](_0x31c03c));_0x3db080(_0x31c03c);})[_0x8dc2('0x18')](function(_0x52c70e){logger[_0x8dc2('0x15')](_0x8dc2('0x35'),_0x52c70e[_0x8dc2('0x17')],_0x32bc5b);_0xf4df3f(_0x44dc90[_0x8dc2('0x15')](0x1f4,_0x52c70e[_0x8dc2('0x17')]));});});};exports['CountReScheduled']=function(_0x3fce55){var _0x22b24a=this;return new Promise(function(_0x51651d,_0x58485b){return db['CmHopper'][_0x8dc2('0x1a')]({'raw':_0x3fce55[_0x8dc2('0x1b')]?_0x3fce55[_0x8dc2('0x1b')][_0x8dc2('0x25')]===undefined?!![]:![]:!![],'where':_0x3fce55[_0x8dc2('0x1b')]?_0x3fce55[_0x8dc2('0x1b')][_0x8dc2('0x1c')]||null:null,'attributes':[[db[_0x8dc2('0x2e')]['fn'](_0x8dc2('0x37'),db['sequelize']['fn']('IF',db['sequelize'][_0x8dc2('0x38')](_0x8dc2('0x39')+util['format'](_0x8dc2('0x3a'),moment()[_0x8dc2('0x3b')](_0x8dc2('0x3c')))+_0x8dc2('0x3d')))),_0x8dc2('0x3e')]]})[_0x8dc2('0xe')](function(_0x398751){logger[_0x8dc2('0xf')]('CountReScheduled',_0x3fce55);logger[_0x8dc2('0x12')]('CountReScheduled',_0x3fce55,JSON[_0x8dc2('0x14')](_0x398751));_0x51651d(_0x398751);})[_0x8dc2('0x18')](function(_0x48cfaa){logger[_0x8dc2('0x15')](_0x8dc2('0x3f'),_0x48cfaa[_0x8dc2('0x17')],_0x3fce55);_0x58485b(_0x22b24a[_0x8dc2('0x15')](0x1f4,_0x48cfaa['message']));});});};exports[_0x8dc2('0x40')]=function(_0x5f1f7d){var _0xb64662=this;return new Promise(function(_0x3992d9,_0x358283){return db[_0x8dc2('0x41')]['describe']()[_0x8dc2('0xe')](function(_0x47e2af){return db['sequelize'][_0x8dc2('0x36')](function(_0xd435bf){return db[_0x8dc2('0x23')]['findAll']({'where':_0x5f1f7d[_0x8dc2('0x1b')]?_0x5f1f7d[_0x8dc2('0x1b')][_0x8dc2('0x1c')]||null:null,'attributes':_0x5f1f7d[_0x8dc2('0x1b')]?_0x5f1f7d[_0x8dc2('0x1b')]['attributes']||null:null,'limit':0x1,'order':_0x5f1f7d[_0x8dc2('0x1b')]?_0x5f1f7d[_0x8dc2('0x1b')]['order']||null:null,'group':db['CmHopper'][_0x8dc2('0x42')],'transaction':_0xd435bf,'lock':_0xd435bf[_0x8dc2('0x30')][_0x8dc2('0x31')],'include':_0x5f1f7d['options']?_0x5f1f7d[_0x8dc2('0x1b')][_0x8dc2('0x1f')]?_[_0x8dc2('0x20')](_0x5f1f7d[_0x8dc2('0x1b')][_0x8dc2('0x1f')],function(_0xe196d6){return{'model':db[_0xe196d6['model']],'as':_0xe196d6['as'],'attributes':_0xe196d6[_0x8dc2('0x1d')],'include':_0xe196d6['include']?_[_0x8dc2('0x20')](_0xe196d6[_0x8dc2('0x1f')],function(_0x2abdfc){return{'model':db[_0x2abdfc['model']],'as':_0x2abdfc['as'],'attributes':_0x2abdfc[_0x8dc2('0x1d')],'include':_0x2abdfc[_0x8dc2('0x1f')]?_[_0x8dc2('0x20')](_0x2abdfc[_0x8dc2('0x1f')],function(_0x1adeaa){return{'model':db[_0x1adeaa['model']],'as':_0x1adeaa['as'],'attributes':_0x1adeaa['attributes']};}):[]};}):[]};}):[]:[]})[_0x8dc2('0xe')](function(_0x420916){var _0x1c5041=[];for(var _0x2008f7=0x0;_0x2008f7<_0x420916[_0x8dc2('0x43')];_0x2008f7+=0x1){_0x1c5041['push'](_0x420916[_0x2008f7][_0x8dc2('0x29')](_0x5f1f7d[_0x8dc2('0x27')],{'transaction':_0xd435bf}));}return BPromise[_0x8dc2('0x34')](_0x1c5041);});})[_0x8dc2('0xe')](function(_0x40539b){logger[_0x8dc2('0xf')](_0x8dc2('0x40'),_0x5f1f7d);logger[_0x8dc2('0x12')](_0x8dc2('0x40'),_0x5f1f7d,JSON[_0x8dc2('0x14')](_0x40539b));_0x3992d9(_0x40539b);})[_0x8dc2('0x18')](function(_0x128cd9){logger[_0x8dc2('0x15')]('GetContactRecallMe',_0x128cd9[_0x8dc2('0x17')],_0x5f1f7d);_0x358283(_0xb64662[_0x8dc2('0x15')](0x1f4,_0x128cd9[_0x8dc2('0x17')]));});});});}; \ No newline at end of file +var _0x25f6=['CountReScheduled','findAll','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','UserId','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetCmHopper','options','raw','attributes','limit','include','model','map','catch','ShowCmHopper','CmHopper','find','where','CreateCmHopper','create','body','UpdateCmHopper','DestroyCmHopper','GetContactDialer','CmContact','order','LOCK','UPDATE','Contact','keys','length','push','update','all','MoveContactManagedDialer','transaction','CmHopperFinal','destroy'];(function(_0x4b0c3e,_0xb2f570){var _0x110920=function(_0x53eac0){while(--_0x53eac0){_0x4b0c3e['push'](_0x4b0c3e['shift']());}};_0x110920(++_0xb2f570);}(_0x25f6,0xd3));var _0x625f=function(_0x504575,_0x1ad9e0){_0x504575=_0x504575-0x0;var _0x4484cc=_0x25f6[_0x504575];return _0x4484cc;};'use strict';var _=require(_0x625f('0x0'));var util=require(_0x625f('0x1'));var moment=require('moment');var BPromise=require(_0x625f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x625f('0x3'));var db=require(_0x625f('0x4'))['db'];var utils=require(_0x625f('0x5'));var logger=require(_0x625f('0x6'))(_0x625f('0x7'));var config=require(_0x625f('0x8'));var jayson=require(_0x625f('0x9'));var client=jayson[_0x625f('0xa')][_0x625f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x442a1f,_0x139705,_0xbd6be4){return new BPromise(function(_0x2f2e34,_0x1ccf15){return client[_0x625f('0xc')](_0x442a1f,_0xbd6be4)[_0x625f('0xd')](function(_0x49b4a4){logger['info'](_0x625f('0xe'),_0x139705,_0x625f('0xf'));logger[_0x625f('0x10')](_0x625f('0x11'),_0x139705,_0x625f('0xf'),JSON[_0x625f('0x12')](_0x49b4a4));if(_0x49b4a4['error']){if(_0x49b4a4[_0x625f('0x13')][_0x625f('0x14')]===0x1f4){logger[_0x625f('0x13')](_0x625f('0xe'),_0x139705,_0x49b4a4[_0x625f('0x13')][_0x625f('0x15')]);return _0x1ccf15(_0x49b4a4[_0x625f('0x13')][_0x625f('0x15')]);}logger[_0x625f('0x13')](_0x625f('0xe'),_0x139705,_0x49b4a4[_0x625f('0x13')][_0x625f('0x15')]);return _0x2f2e34(_0x49b4a4['error'][_0x625f('0x15')]);}else{logger[_0x625f('0x16')](_0x625f('0xe'),_0x139705,_0x625f('0xf'));_0x2f2e34(_0x49b4a4[_0x625f('0x17')][_0x625f('0x15')]);}})['catch'](function(_0x5ea930){logger['error'](_0x625f('0xe'),_0x139705,_0x5ea930);_0x1ccf15(_0x5ea930);});});}exports[_0x625f('0x18')]=function(_0x1161a0){var _0x351f44=this;return new Promise(function(_0x4e930a,_0x51236b){return db['CmHopper']['findAll']({'raw':_0x1161a0[_0x625f('0x19')]?_0x1161a0[_0x625f('0x19')][_0x625f('0x1a')]===undefined?!![]:![]:!![],'where':_0x1161a0[_0x625f('0x19')]?_0x1161a0[_0x625f('0x19')]['where']||null:null,'attributes':_0x1161a0[_0x625f('0x19')]?_0x1161a0[_0x625f('0x19')][_0x625f('0x1b')]||null:null,'limit':_0x1161a0['options']?_0x1161a0[_0x625f('0x19')][_0x625f('0x1c')]||null:null,'include':_0x1161a0[_0x625f('0x19')]?_0x1161a0[_0x625f('0x19')][_0x625f('0x1d')]?_['map'](_0x1161a0[_0x625f('0x19')]['include'],function(_0x2302cd){return{'model':db[_0x2302cd[_0x625f('0x1e')]],'as':_0x2302cd['as'],'attributes':_0x2302cd['attributes'],'include':_0x2302cd[_0x625f('0x1d')]?_[_0x625f('0x1f')](_0x2302cd[_0x625f('0x1d')],function(_0x5202e2){return{'model':db[_0x5202e2[_0x625f('0x1e')]],'as':_0x5202e2['as'],'attributes':_0x5202e2[_0x625f('0x1b')],'include':_0x5202e2[_0x625f('0x1d')]?_[_0x625f('0x1f')](_0x5202e2[_0x625f('0x1d')],function(_0x311b11){return{'model':db[_0x311b11[_0x625f('0x1e')]],'as':_0x311b11['as'],'attributes':_0x311b11[_0x625f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x625f('0xd')](function(_0xbcb167){logger[_0x625f('0x16')](_0x625f('0x18'),_0x1161a0);logger[_0x625f('0x10')](_0x625f('0x18'),_0x1161a0,JSON[_0x625f('0x12')](_0xbcb167));_0x4e930a(_0xbcb167);})[_0x625f('0x20')](function(_0xea2c9a){logger[_0x625f('0x13')]('GetCmHopper',_0xea2c9a[_0x625f('0x15')],_0x1161a0);_0x51236b(_0x351f44[_0x625f('0x13')](0x1f4,_0xea2c9a[_0x625f('0x15')]));});});};exports[_0x625f('0x21')]=function(_0x3ab5bd){var _0x1d6c87=this;return new Promise(function(_0x411b48,_0x2a99c8){return db[_0x625f('0x22')][_0x625f('0x23')]({'raw':_0x3ab5bd[_0x625f('0x19')]?_0x3ab5bd[_0x625f('0x19')][_0x625f('0x1a')]===undefined?!![]:![]:!![],'where':_0x3ab5bd[_0x625f('0x19')]?_0x3ab5bd[_0x625f('0x19')][_0x625f('0x24')]||null:null,'attributes':_0x3ab5bd[_0x625f('0x19')]?_0x3ab5bd[_0x625f('0x19')][_0x625f('0x1b')]||null:null,'include':_0x3ab5bd[_0x625f('0x19')]?_0x3ab5bd['options'][_0x625f('0x1d')]?_[_0x625f('0x1f')](_0x3ab5bd[_0x625f('0x19')][_0x625f('0x1d')],function(_0x331bdf){return{'model':db[_0x331bdf[_0x625f('0x1e')]],'as':_0x331bdf['as'],'attributes':_0x331bdf[_0x625f('0x1b')],'include':_0x331bdf['include']?_['map'](_0x331bdf['include'],function(_0x91b15a){return{'model':db[_0x91b15a['model']],'as':_0x91b15a['as'],'attributes':_0x91b15a[_0x625f('0x1b')],'include':_0x91b15a['include']?_[_0x625f('0x1f')](_0x91b15a[_0x625f('0x1d')],function(_0x2b385c){return{'model':db[_0x2b385c[_0x625f('0x1e')]],'as':_0x2b385c['as'],'attributes':_0x2b385c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ee4f9){logger[_0x625f('0x16')]('ShowCmHopper',_0x3ab5bd);logger['debug']('ShowCmHopper',_0x3ab5bd,JSON[_0x625f('0x12')](_0x1ee4f9));_0x411b48(_0x1ee4f9);})[_0x625f('0x20')](function(_0x3e629c){logger[_0x625f('0x13')](_0x625f('0x21'),_0x3e629c[_0x625f('0x15')],_0x3ab5bd);_0x2a99c8(_0x1d6c87['error'](0x1f4,_0x3e629c[_0x625f('0x15')]));});});};exports[_0x625f('0x25')]=function(_0x23b8a9){var _0x5d2010=this;return new Promise(function(_0x3206a7,_0x177f51){return db['CmHopper'][_0x625f('0x26')](_0x23b8a9[_0x625f('0x27')],{'raw':_0x23b8a9[_0x625f('0x19')]?_0x23b8a9[_0x625f('0x19')][_0x625f('0x1a')]===undefined?!![]:![]:!![]})[_0x625f('0xd')](function(_0x396934){logger['info'](_0x625f('0x25'),_0x23b8a9);logger[_0x625f('0x10')](_0x625f('0x25'),_0x23b8a9,JSON[_0x625f('0x12')](_0x396934));_0x3206a7(_0x396934);})['catch'](function(_0x52464f){logger[_0x625f('0x13')](_0x625f('0x25'),_0x52464f[_0x625f('0x15')],_0x23b8a9);_0x177f51(_0x5d2010[_0x625f('0x13')](0x1f4,_0x52464f['message']));});});};exports[_0x625f('0x28')]=function(_0x370841){var _0x44489b=this;return new Promise(function(_0x3ebb4b,_0x14c2bd){return db[_0x625f('0x22')]['update'](_0x370841[_0x625f('0x27')],{'raw':_0x370841[_0x625f('0x19')]?_0x370841[_0x625f('0x19')][_0x625f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x370841['options']?_0x370841[_0x625f('0x19')][_0x625f('0x24')]||null:null,'attributes':_0x370841['options']?_0x370841['options'][_0x625f('0x1b')]||null:null,'limit':_0x370841[_0x625f('0x19')]?_0x370841[_0x625f('0x19')][_0x625f('0x1c')]||null:null})[_0x625f('0xd')](function(_0x31cf64){logger[_0x625f('0x16')](_0x625f('0x28'),_0x370841);logger[_0x625f('0x10')](_0x625f('0x28'),_0x370841,JSON[_0x625f('0x12')](_0x31cf64));_0x3ebb4b(_0x31cf64);})[_0x625f('0x20')](function(_0x5b6164){logger[_0x625f('0x13')]('UpdateCmHopper',_0x5b6164[_0x625f('0x15')],_0x370841);_0x14c2bd(_0x44489b['error'](0x1f4,_0x5b6164[_0x625f('0x15')]));});});};exports[_0x625f('0x29')]=function(_0x431d8f){var _0x351e15=this;return new Promise(function(_0x23b6d2,_0x22054c){return db['CmHopper']['destroy']({'where':_0x431d8f['options']?_0x431d8f[_0x625f('0x19')]['where']||null:null})['then'](function(_0x39af0d){logger[_0x625f('0x16')](_0x625f('0x29'),_0x431d8f);logger['debug'](_0x625f('0x29'),_0x431d8f,JSON[_0x625f('0x12')](_0x39af0d));_0x23b6d2(_0x39af0d);})[_0x625f('0x20')](function(_0x4262be){logger[_0x625f('0x13')](_0x625f('0x29'),_0x4262be[_0x625f('0x15')],_0x431d8f);_0x22054c(_0x351e15[_0x625f('0x13')](0x1f4,_0x4262be[_0x625f('0x15')]));});});};exports[_0x625f('0x2a')]=function(_0x2992eb){var _0x58f296=this;return new Promise(function(_0x57a76d,_0x384ff2){return db[_0x625f('0x2b')]['describe']()[_0x625f('0xd')](function(_0x38ab94){return db['sequelize']['transaction'](function(_0x37d104){return db[_0x625f('0x22')]['findAll']({'where':_0x2992eb[_0x625f('0x19')]?_0x2992eb[_0x625f('0x19')][_0x625f('0x24')]||null:null,'attributes':_0x2992eb[_0x625f('0x19')]?_0x2992eb[_0x625f('0x19')][_0x625f('0x1b')]||null:null,'limit':_0x2992eb[_0x625f('0x19')]?_0x2992eb[_0x625f('0x19')][_0x625f('0x1c')]||null:null,'order':_0x2992eb[_0x625f('0x19')]?_0x2992eb['options'][_0x625f('0x2c')]||null:null,'transaction':_0x37d104,'lock':_0x37d104[_0x625f('0x2d')][_0x625f('0x2e')],'include':[{'model':db[_0x625f('0x2b')],'as':_0x625f('0x2f'),'attributes':_[_0x625f('0x30')](_0x38ab94)}]})['then'](function(_0x56730e){var _0x501ac2=[];for(var _0x58d29a=0x0;_0x58d29a<_0x56730e[_0x625f('0x31')];_0x58d29a+=0x1){_0x501ac2[_0x625f('0x32')](_0x56730e[_0x58d29a][_0x625f('0x33')](_0x2992eb[_0x625f('0x27')],{'transaction':_0x37d104}));}return BPromise[_0x625f('0x34')](_0x501ac2);});})[_0x625f('0xd')](function(_0x4e55c3){logger['info'](_0x625f('0x2a'),_0x2992eb);logger[_0x625f('0x10')](_0x625f('0x2a'),_0x2992eb,JSON['stringify'](_0x4e55c3));_0x57a76d(_0x4e55c3);})[_0x625f('0x20')](function(_0x5d84b5){logger[_0x625f('0x13')](_0x625f('0x2a'),_0x5d84b5[_0x625f('0x15')],_0x2992eb);_0x384ff2(_0x58f296[_0x625f('0x13')](0x1f4,_0x5d84b5['message']));});});});};exports[_0x625f('0x35')]=function(_0x1595a5){var _0x4401ba=this;return new Promise(function(_0x53ee9f,_0x19a8fb){return db['sequelize'][_0x625f('0x36')](function(_0x5da098){return db[_0x625f('0x37')][_0x625f('0x26')](_0x1595a5[_0x625f('0x27')],{'raw':_0x1595a5[_0x625f('0x19')]?_0x1595a5[_0x625f('0x19')][_0x625f('0x1a')]===undefined?!![]:![]:!![],'transaction':_0x5da098})[_0x625f('0xd')](function(){return db['CmHopper'][_0x625f('0x38')]({'where':_0x1595a5['options']?_0x1595a5[_0x625f('0x19')][_0x625f('0x24')]||null:null,'transaction':_0x5da098});});})[_0x625f('0xd')](function(_0x1911f0){logger[_0x625f('0x16')]('MoveContactManagedDialer',_0x1595a5);logger[_0x625f('0x10')](_0x625f('0x35'),_0x1595a5,JSON[_0x625f('0x12')](_0x1911f0));_0x53ee9f(_0x1911f0);})[_0x625f('0x20')](function(_0x156899){logger['error']('MoveContactManagedDialer',_0x156899[_0x625f('0x15')],_0x1595a5);_0x19a8fb(_0x4401ba['error'](0x1f4,_0x156899[_0x625f('0x15')]));});});};exports[_0x625f('0x39')]=function(_0x29baa5){var _0x268975=this;return new Promise(function(_0x38c009,_0x507889){return db[_0x625f('0x22')][_0x625f('0x3a')]({'raw':_0x29baa5[_0x625f('0x19')]?_0x29baa5[_0x625f('0x19')][_0x625f('0x1a')]===undefined?!![]:![]:!![],'where':_0x29baa5[_0x625f('0x19')]?_0x29baa5[_0x625f('0x19')][_0x625f('0x24')]||null:null,'attributes':[[db['sequelize']['fn'](_0x625f('0x3b'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x625f('0x3c')+util[_0x625f('0x3d')](_0x625f('0x3e'),moment()[_0x625f('0x3d')](_0x625f('0x3f')))+'\x20,\x201,\x20null'))),_0x625f('0x40')]]})[_0x625f('0xd')](function(_0x1601f4){logger[_0x625f('0x16')]('CountReScheduled',_0x29baa5);logger['debug'](_0x625f('0x39'),_0x29baa5,JSON[_0x625f('0x12')](_0x1601f4));_0x38c009(_0x1601f4);})[_0x625f('0x20')](function(_0x214b77){logger['error'](_0x625f('0x39'),_0x214b77[_0x625f('0x15')],_0x29baa5);_0x507889(_0x268975['error'](0x1f4,_0x214b77[_0x625f('0x15')]));});});};exports[_0x625f('0x41')]=function(_0x264a21){var _0x56294e=this;return new Promise(function(_0x4237f6,_0x19dc04){return db[_0x625f('0x2b')]['describe']()[_0x625f('0xd')](function(_0x37ac61){return db['sequelize'][_0x625f('0x36')](function(_0x427610){return db[_0x625f('0x22')]['findAll']({'where':_0x264a21[_0x625f('0x19')]?_0x264a21[_0x625f('0x19')][_0x625f('0x24')]||null:null,'attributes':_0x264a21[_0x625f('0x19')]?_0x264a21[_0x625f('0x19')][_0x625f('0x1b')]||null:null,'limit':0x1,'order':_0x264a21[_0x625f('0x19')]?_0x264a21['options'][_0x625f('0x2c')]||null:null,'group':db[_0x625f('0x22')][_0x625f('0x42')],'transaction':_0x427610,'lock':_0x427610['LOCK']['UPDATE'],'include':_0x264a21[_0x625f('0x19')]?_0x264a21[_0x625f('0x19')][_0x625f('0x1d')]?_[_0x625f('0x1f')](_0x264a21[_0x625f('0x19')][_0x625f('0x1d')],function(_0x883b8b){return{'model':db[_0x883b8b[_0x625f('0x1e')]],'as':_0x883b8b['as'],'attributes':_0x883b8b[_0x625f('0x1b')],'include':_0x883b8b['include']?_['map'](_0x883b8b[_0x625f('0x1d')],function(_0x44b097){return{'model':db[_0x44b097[_0x625f('0x1e')]],'as':_0x44b097['as'],'attributes':_0x44b097[_0x625f('0x1b')],'include':_0x44b097[_0x625f('0x1d')]?_['map'](_0x44b097[_0x625f('0x1d')],function(_0x4a1a6a){return{'model':db[_0x4a1a6a[_0x625f('0x1e')]],'as':_0x4a1a6a['as'],'attributes':_0x4a1a6a[_0x625f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x625f('0xd')](function(_0x53a008){var _0x2c9562=[];for(var _0x14429d=0x0;_0x14429d<_0x53a008['length'];_0x14429d+=0x1){_0x2c9562['push'](_0x53a008[_0x14429d][_0x625f('0x33')](_0x264a21[_0x625f('0x27')],{'transaction':_0x427610}));}return BPromise['all'](_0x2c9562);});})[_0x625f('0xd')](function(_0x43f785){logger['info']('GetContactRecallMe',_0x264a21);logger['debug'](_0x625f('0x41'),_0x264a21,JSON[_0x625f('0x12')](_0x43f785));_0x4237f6(_0x43f785);})[_0x625f('0x20')](function(_0x431b45){logger['error'](_0x625f('0x41'),_0x431b45[_0x625f('0x15')],_0x264a21);_0x19dc04(_0x56294e[_0x625f('0x13')](0x1f4,_0x431b45[_0x625f('0x15')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index db6dd7f..eb21255 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 _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(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./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 +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(_0x5af3ad,_0x2b7c30){var _0x2e0c15=function(_0x59b811){while(--_0x59b811){_0x5af3ad['push'](_0x5af3ad['shift']());}};_0x2e0c15(++_0x2b7c30);}(_0x7a54,0x106));var _0x47a5=function(_0x418c96,_0x1582c0){_0x418c96=_0x418c96-0x0;var _0x1e08c5=_0x7a54[_0x418c96];return _0x1e08c5;};'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 diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index a158339..2d29df4 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 _0x079c=['moment','sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x347f04,_0x34de33){var _0x5ef7d3=function(_0x34e848){while(--_0x34e848){_0x347f04['push'](_0x347f04['shift']());}};_0x5ef7d3(++_0x34de33);}(_0x079c,0xd2));var _0xc079=function(_0x197f72,_0xc78dc2){_0x197f72=_0x197f72-0x0;var _0x295274=_0x079c[_0x197f72];return _0x295274;};'use strict';var moment=require(_0xc079('0x0'));var Sequelize=require(_0xc079('0x1'));module[_0xc079('0x2')]={'phone':{'type':Sequelize[_0xc079('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xc079('0x4')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xc079('0x4')],'unique':_0xc079('0x5')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xc079('0x5')}}; \ No newline at end of file +var _0x97a5=['INTEGER','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x389c42,_0x5163d0){var _0x207906=function(_0x307532){while(--_0x307532){_0x389c42['push'](_0x389c42['shift']());}};_0x207906(++_0x5163d0);}(_0x97a5,0xda));var _0x597a=function(_0x4487e3,_0x1cd4cd){_0x4487e3=_0x4487e3-0x0;var _0x56a60a=_0x97a5[_0x4487e3];return _0x56a60a;};'use strict';var moment=require(_0x597a('0x0'));var Sequelize=require(_0x597a('0x1'));module[_0x597a('0x2')]={'phone':{'type':Sequelize[_0x597a('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x597a('0x4')],'unique':_0x597a('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x597a('0x5')},'VoiceQueueId':{'type':Sequelize[_0x597a('0x4')],'unique':_0x597a('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 6a85f5d..2de6dd4 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 _0xc2f9=['stack','name','send','index','CmHopperBlack','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','catch','params','find','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','save','destroy','then','sendStatus','error'];(function(_0x1415ef,_0x5c219e){var _0x234acc=function(_0x2dbfca){while(--_0x2dbfca){_0x1415ef['push'](_0x1415ef['shift']());}};_0x234acc(++_0x5c219e);}(_0xc2f9,0x1c1));var _0x9c2f=function(_0x2b9b35,_0x23db3b){_0x2b9b35=_0x2b9b35-0x0;var _0x1d605e=_0xc2f9[_0x2b9b35];return _0x1d605e;};'use strict';var pdf=require(_0x9c2f('0x0'));var emlformat=require(_0x9c2f('0x1'));var rimraf=require(_0x9c2f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9c2f('0x3'));var rp=require(_0x9c2f('0x4'));var moment=require(_0x9c2f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9c2f('0x6'));var util=require(_0x9c2f('0x7'));var path=require(_0x9c2f('0x8'));var sox=require(_0x9c2f('0x9'));var csv=require('to-csv');var ejs=require(_0x9c2f('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9c2f('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9c2f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9c2f('0xd'));var Papa=require(_0x9c2f('0xe'));var Redis=require(_0x9c2f('0xf'));var authService=require(_0x9c2f('0x10'));var qs=require(_0x9c2f('0x11'));var hardwareService=require(_0x9c2f('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x9c2f('0x13'));var config=require('../../config/environment');var db=require(_0x9c2f('0x14'))['db'];function respondWithStatusCode(_0x35cf8d,_0x16150d){_0x16150d=_0x16150d||0xcc;return function(_0x2479cf){if(_0x2479cf){return _0x35cf8d['sendStatus'](_0x16150d);}return _0x35cf8d[_0x9c2f('0x15')](_0x16150d)[_0x9c2f('0x16')]();};}function respondWithResult(_0x5e2397,_0x4e5775){_0x4e5775=_0x4e5775||0xc8;return function(_0x274279){if(_0x274279){return _0x5e2397[_0x9c2f('0x15')](_0x4e5775)[_0x9c2f('0x17')](_0x274279);}};}function respondWithFilteredResult(_0x1fc1c0,_0x8fd619){return function(_0x16363f){if(_0x16363f){var _0x48da14=_0x16363f[_0x9c2f('0x18')],_0x256084=_0x8fd619['offset'],_0x4618f1=_0x8fd619[_0x9c2f('0x19')]+_0x8fd619[_0x9c2f('0x1a')],_0x3a3828;if(_0x4618f1>=_0x48da14){_0x4618f1=_0x48da14;_0x3a3828=0xc8;}else{_0x3a3828=0xce;}_0x1fc1c0[_0x9c2f('0x15')](_0x3a3828);return _0x1fc1c0['set'](_0x9c2f('0x1b'),_0x256084+'-'+_0x4618f1+'/'+_0x48da14)[_0x9c2f('0x17')](_0x16363f);}return null;};}function patchUpdates(_0x296283){return function(_0x4164eb){try{jsonpatch[_0x9c2f('0x1c')](_0x4164eb,_0x296283,!![]);}catch(_0x16603a){return BPromise['reject'](_0x16603a);}return _0x4164eb[_0x9c2f('0x1d')]();};}function saveUpdates(_0x66d8c7,_0x281938){return function(_0x36200b){if(_0x36200b){return _0x36200b['update'](_0x66d8c7)['then'](function(_0x587ebd){return _0x587ebd;});}return null;};}function removeEntity(_0x328cbd,_0x344f09){return function(_0x56c485){if(_0x56c485){return _0x56c485[_0x9c2f('0x1e')]()[_0x9c2f('0x1f')](function(){_0x328cbd[_0x9c2f('0x15')](0xcc)[_0x9c2f('0x16')]();});}};}function handleEntityNotFound(_0x4cbddd,_0x305886){return function(_0x57e2ce){if(!_0x57e2ce){_0x4cbddd[_0x9c2f('0x20')](0x194);}return _0x57e2ce;};}function handleError(_0x51ad67,_0xe822b0){_0xe822b0=_0xe822b0||0x1f4;return function(_0x1dfc00){logger[_0x9c2f('0x21')](_0x1dfc00[_0x9c2f('0x22')]);if(_0x1dfc00['name']){delete _0x1dfc00[_0x9c2f('0x23')];}_0x51ad67[_0x9c2f('0x15')](_0xe822b0)[_0x9c2f('0x24')](_0x1dfc00);};}exports[_0x9c2f('0x25')]=function(_0x4373e5,_0x1a0e48){var _0x26e082={},_0x500a96={},_0x58bd61={'count':0x0,'rows':[]};var _0x4db8bf=db[_0x9c2f('0x26')][_0x9c2f('0x27')];_0x500a96[_0x9c2f('0x28')]=_[_0x9c2f('0x29')](_0x4db8bf);_0x500a96[_0x9c2f('0x2a')]=_[_0x9c2f('0x29')](_0x4373e5['query']);_0x500a96[_0x9c2f('0x2b')]=_['intersection'](_0x500a96[_0x9c2f('0x28')],_0x500a96[_0x9c2f('0x2a')]);_0x26e082[_0x9c2f('0x2c')]=_[_0x9c2f('0x2d')](_0x500a96[_0x9c2f('0x28')],qs[_0x9c2f('0x2e')](_0x4373e5[_0x9c2f('0x2a')][_0x9c2f('0x2e')]));_0x26e082['attributes']=_0x26e082[_0x9c2f('0x2c')][_0x9c2f('0x2f')]?_0x26e082['attributes']:_0x500a96['model'];if(!_0x4373e5[_0x9c2f('0x2a')]['hasOwnProperty'](_0x9c2f('0x30'))){_0x26e082[_0x9c2f('0x1a')]=qs[_0x9c2f('0x1a')](_0x4373e5[_0x9c2f('0x2a')][_0x9c2f('0x1a')]);_0x26e082['offset']=qs['offset'](_0x4373e5['query'][_0x9c2f('0x19')]);}_0x26e082[_0x9c2f('0x31')]=qs[_0x9c2f('0x32')](_0x4373e5[_0x9c2f('0x2a')][_0x9c2f('0x32')]);_0x26e082[_0x9c2f('0x33')]=qs[_0x9c2f('0x2b')](_[_0x9c2f('0x34')](_0x4373e5['query'],_0x500a96[_0x9c2f('0x2b')]));if(_0x4373e5[_0x9c2f('0x2a')][_0x9c2f('0x35')]){_0x26e082[_0x9c2f('0x33')]=_[_0x9c2f('0x36')](_0x26e082[_0x9c2f('0x33')],{'$or':_[_0x9c2f('0x37')](_0x4db8bf,function(_0x4119a3){if(_0x4119a3[_0x9c2f('0x38')][_0x9c2f('0x39')]!=='VIRTUAL'){var _0x3a5473={};_0x3a5473[_0x4119a3[_0x9c2f('0x3a')]]={'$like':'%'+_0x4373e5['query'][_0x9c2f('0x35')]+'%'};return _0x3a5473;}})});}_0x26e082=_[_0x9c2f('0x36')]({},_0x26e082,_0x4373e5[_0x9c2f('0x3b')]);var _0x358c03={'where':_0x26e082[_0x9c2f('0x33')]};return db[_0x9c2f('0x26')][_0x9c2f('0x18')](_0x358c03)[_0x9c2f('0x1f')](function(_0x4379fa){_0x58bd61['count']=_0x4379fa;if(_0x4373e5['query'][_0x9c2f('0x3c')]){_0x26e082[_0x9c2f('0x3d')]=[{'all':!![]}];}return db[_0x9c2f('0x26')][_0x9c2f('0x3e')](_0x26e082);})[_0x9c2f('0x1f')](function(_0x580a5c){_0x58bd61[_0x9c2f('0x3f')]=_0x580a5c;return _0x58bd61;})['then'](respondWithFilteredResult(_0x1a0e48,_0x26e082))[_0x9c2f('0x40')](handleError(_0x1a0e48,null));};exports['show']=function(_0x240939,_0x530e2b){var _0x40e301={'raw':!![],'where':{'id':_0x240939[_0x9c2f('0x41')]['id']}},_0x49b954={};_0x49b954[_0x9c2f('0x28')]=_[_0x9c2f('0x29')](db[_0x9c2f('0x26')]['rawAttributes']);_0x49b954[_0x9c2f('0x2a')]=_[_0x9c2f('0x29')](_0x240939[_0x9c2f('0x2a')]);_0x49b954[_0x9c2f('0x2b')]=_[_0x9c2f('0x2d')](_0x49b954[_0x9c2f('0x28')],_0x49b954[_0x9c2f('0x2a')]);_0x40e301[_0x9c2f('0x2c')]=_['intersection'](_0x49b954['model'],qs['fields'](_0x240939[_0x9c2f('0x2a')][_0x9c2f('0x2e')]));_0x40e301['attributes']=_0x40e301[_0x9c2f('0x2c')][_0x9c2f('0x2f')]?_0x40e301[_0x9c2f('0x2c')]:_0x49b954[_0x9c2f('0x28')];if(_0x240939[_0x9c2f('0x2a')][_0x9c2f('0x3c')]){_0x40e301[_0x9c2f('0x3d')]=[{'all':!![]}];}_0x40e301=_[_0x9c2f('0x36')]({},_0x40e301,_0x240939[_0x9c2f('0x3b')]);return db[_0x9c2f('0x26')][_0x9c2f('0x42')](_0x40e301)[_0x9c2f('0x1f')](handleEntityNotFound(_0x530e2b,null))['then'](respondWithResult(_0x530e2b,null))['catch'](handleError(_0x530e2b,null));};exports['update']=function(_0x4849e0,_0x884b57){if(_0x4849e0[_0x9c2f('0x43')]['id']){delete _0x4849e0[_0x9c2f('0x43')]['id'];}return db['CmHopperBlack'][_0x9c2f('0x42')]({'where':{'id':_0x4849e0[_0x9c2f('0x41')]['id']}})[_0x9c2f('0x1f')](handleEntityNotFound(_0x884b57,null))['then'](saveUpdates(_0x4849e0[_0x9c2f('0x43')],null))['then'](respondWithResult(_0x884b57,null))[_0x9c2f('0x40')](handleError(_0x884b57,null));};exports['destroy']=function(_0x41c6a2,_0x4f04b6){return db[_0x9c2f('0x26')]['find']({'where':{'id':_0x41c6a2[_0x9c2f('0x41')]['id']}})['then'](handleEntityNotFound(_0x4f04b6,null))[_0x9c2f('0x1f')](removeEntity(_0x4f04b6,null))['catch'](handleError(_0x4f04b6,null));};exports[_0x9c2f('0x44')]=function(_0x4bf280,_0x1c6608){return db[_0x9c2f('0x26')][_0x9c2f('0x44')]()[_0x9c2f('0x1f')](respondWithResult(_0x1c6608,null))[_0x9c2f('0x40')](handleError(_0x1c6608,null));}; \ No newline at end of file +var _0xab84=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','count','limit','set','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','CmHopperBlack','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','body','describe','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce'];(function(_0x34136c,_0x503203){var _0xeee0f0=function(_0x2433c0){while(--_0x2433c0){_0x34136c['push'](_0x34136c['shift']());}};_0xeee0f0(++_0x503203);}(_0xab84,0xcf));var _0x4ab8=function(_0x338903,_0xe484ae){_0x338903=_0x338903-0x0;var _0x299f31=_0xab84[_0x338903];return _0x299f31;};'use strict';var pdf=require(_0x4ab8('0x0'));var emlformat=require(_0x4ab8('0x1'));var rimraf=require(_0x4ab8('0x2'));var zipdir=require(_0x4ab8('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4ab8('0x4'));var BPromise=require(_0x4ab8('0x5'));var Mustache=require(_0x4ab8('0x6'));var util=require(_0x4ab8('0x7'));var path=require(_0x4ab8('0x8'));var sox=require(_0x4ab8('0x9'));var csv=require(_0x4ab8('0xa'));var ejs=require(_0x4ab8('0xb'));var fs=require('fs');var _=require(_0x4ab8('0xc'));var squel=require(_0x4ab8('0xd'));var crypto=require('crypto');var jsforce=require(_0x4ab8('0xe'));var deskjs=require(_0x4ab8('0xf'));var toCsv=require(_0x4ab8('0xa'));var querystring=require('querystring');var Papa=require(_0x4ab8('0x10'));var Redis=require(_0x4ab8('0x11'));var authService=require(_0x4ab8('0x12'));var qs=require(_0x4ab8('0x13'));var hardwareService=require(_0x4ab8('0x14'));var logger=require(_0x4ab8('0x15'))(_0x4ab8('0x16'));var utils=require(_0x4ab8('0x17'));var config=require('../../config/environment');var db=require(_0x4ab8('0x18'))['db'];function respondWithStatusCode(_0x2862c0,_0x2aa566){_0x2aa566=_0x2aa566||0xcc;return function(_0xdce28e){if(_0xdce28e){return _0x2862c0['sendStatus'](_0x2aa566);}return _0x2862c0[_0x4ab8('0x19')](_0x2aa566)['end']();};}function respondWithResult(_0x3d8fbd,_0x1516f3){_0x1516f3=_0x1516f3||0xc8;return function(_0x106841){if(_0x106841){return _0x3d8fbd[_0x4ab8('0x19')](_0x1516f3)[_0x4ab8('0x1a')](_0x106841);}};}function respondWithFilteredResult(_0x2a270b,_0x51607d){return function(_0x3ad4f0){if(_0x3ad4f0){var _0x4d2ba0=_0x3ad4f0[_0x4ab8('0x1b')],_0x1f9661=_0x51607d['offset'],_0x40173a=_0x51607d['offset']+_0x51607d[_0x4ab8('0x1c')],_0x2d9c79;if(_0x40173a>=_0x4d2ba0){_0x40173a=_0x4d2ba0;_0x2d9c79=0xc8;}else{_0x2d9c79=0xce;}_0x2a270b[_0x4ab8('0x19')](_0x2d9c79);return _0x2a270b[_0x4ab8('0x1d')]('Content-Range',_0x1f9661+'-'+_0x40173a+'/'+_0x4d2ba0)['json'](_0x3ad4f0);}return null;};}function patchUpdates(_0x587b14){return function(_0x57b11e){try{jsonpatch[_0x4ab8('0x1e')](_0x57b11e,_0x587b14,!![]);}catch(_0x5ce4e5){return BPromise[_0x4ab8('0x1f')](_0x5ce4e5);}return _0x57b11e[_0x4ab8('0x20')]();};}function saveUpdates(_0xfe82dc,_0x3b6493){return function(_0x47cf16){if(_0x47cf16){return _0x47cf16[_0x4ab8('0x21')](_0xfe82dc)[_0x4ab8('0x22')](function(_0x6a8275){return _0x6a8275;});}return null;};}function removeEntity(_0x38a9c0,_0x2214e5){return function(_0x478bc7){if(_0x478bc7){return _0x478bc7[_0x4ab8('0x23')]()[_0x4ab8('0x22')](function(){_0x38a9c0['status'](0xcc)[_0x4ab8('0x24')]();});}};}function handleEntityNotFound(_0x318c75,_0x4ae5f0){return function(_0x3f5837){if(!_0x3f5837){_0x318c75[_0x4ab8('0x25')](0x194);}return _0x3f5837;};}function handleError(_0x49d5a9,_0x58bfba){_0x58bfba=_0x58bfba||0x1f4;return function(_0x4b5235){logger['error'](_0x4b5235[_0x4ab8('0x26')]);if(_0x4b5235[_0x4ab8('0x27')]){delete _0x4b5235['name'];}_0x49d5a9[_0x4ab8('0x19')](_0x58bfba)[_0x4ab8('0x28')](_0x4b5235);};}exports[_0x4ab8('0x29')]=function(_0x4b2bf2,_0x2e7e1b){var _0x1da85b={},_0x5cd8eb={},_0x5812dd={'count':0x0,'rows':[]};var _0x576985=db[_0x4ab8('0x2a')][_0x4ab8('0x2b')];_0x5cd8eb['model']=_[_0x4ab8('0x2c')](_0x576985);_0x5cd8eb[_0x4ab8('0x2d')]=_[_0x4ab8('0x2c')](_0x4b2bf2[_0x4ab8('0x2d')]);_0x5cd8eb[_0x4ab8('0x2e')]=_[_0x4ab8('0x2f')](_0x5cd8eb[_0x4ab8('0x30')],_0x5cd8eb[_0x4ab8('0x2d')]);_0x1da85b[_0x4ab8('0x31')]=_[_0x4ab8('0x2f')](_0x5cd8eb['model'],qs[_0x4ab8('0x32')](_0x4b2bf2[_0x4ab8('0x2d')]['fields']));_0x1da85b[_0x4ab8('0x31')]=_0x1da85b['attributes'][_0x4ab8('0x33')]?_0x1da85b[_0x4ab8('0x31')]:_0x5cd8eb[_0x4ab8('0x30')];if(!_0x4b2bf2['query'][_0x4ab8('0x34')](_0x4ab8('0x35'))){_0x1da85b[_0x4ab8('0x1c')]=qs['limit'](_0x4b2bf2['query'][_0x4ab8('0x1c')]);_0x1da85b['offset']=qs[_0x4ab8('0x36')](_0x4b2bf2[_0x4ab8('0x2d')]['offset']);}_0x1da85b[_0x4ab8('0x37')]=qs[_0x4ab8('0x38')](_0x4b2bf2['query'][_0x4ab8('0x38')]);_0x1da85b[_0x4ab8('0x39')]=qs[_0x4ab8('0x2e')](_[_0x4ab8('0x3a')](_0x4b2bf2[_0x4ab8('0x2d')],_0x5cd8eb[_0x4ab8('0x2e')]));if(_0x4b2bf2[_0x4ab8('0x2d')]['filter']){_0x1da85b[_0x4ab8('0x39')]=_['merge'](_0x1da85b[_0x4ab8('0x39')],{'$or':_[_0x4ab8('0x3b')](_0x576985,function(_0x56462f){if(_0x56462f[_0x4ab8('0x3c')][_0x4ab8('0x3d')]!==_0x4ab8('0x3e')){var _0x116e6f={};_0x116e6f[_0x56462f['field']]={'$like':'%'+_0x4b2bf2[_0x4ab8('0x2d')]['filter']+'%'};return _0x116e6f;}})});}_0x1da85b=_['merge']({},_0x1da85b,_0x4b2bf2[_0x4ab8('0x3f')]);var _0x441159={'where':_0x1da85b['where']};return db[_0x4ab8('0x2a')][_0x4ab8('0x1b')](_0x441159)['then'](function(_0x524ad6){_0x5812dd[_0x4ab8('0x1b')]=_0x524ad6;if(_0x4b2bf2[_0x4ab8('0x2d')][_0x4ab8('0x40')]){_0x1da85b[_0x4ab8('0x41')]=[{'all':!![]}];}return db[_0x4ab8('0x2a')][_0x4ab8('0x42')](_0x1da85b);})[_0x4ab8('0x22')](function(_0x1b53da){_0x5812dd[_0x4ab8('0x43')]=_0x1b53da;return _0x5812dd;})['then'](respondWithFilteredResult(_0x2e7e1b,_0x1da85b))[_0x4ab8('0x44')](handleError(_0x2e7e1b,null));};exports[_0x4ab8('0x45')]=function(_0x203ba3,_0x138da0){var _0x32144c={'raw':!![],'where':{'id':_0x203ba3[_0x4ab8('0x46')]['id']}},_0x20c909={};_0x20c909[_0x4ab8('0x30')]=_[_0x4ab8('0x2c')](db[_0x4ab8('0x2a')][_0x4ab8('0x2b')]);_0x20c909[_0x4ab8('0x2d')]=_[_0x4ab8('0x2c')](_0x203ba3[_0x4ab8('0x2d')]);_0x20c909[_0x4ab8('0x2e')]=_[_0x4ab8('0x2f')](_0x20c909['model'],_0x20c909[_0x4ab8('0x2d')]);_0x32144c['attributes']=_[_0x4ab8('0x2f')](_0x20c909[_0x4ab8('0x30')],qs['fields'](_0x203ba3[_0x4ab8('0x2d')]['fields']));_0x32144c[_0x4ab8('0x31')]=_0x32144c[_0x4ab8('0x31')]['length']?_0x32144c[_0x4ab8('0x31')]:_0x20c909['model'];if(_0x203ba3[_0x4ab8('0x2d')][_0x4ab8('0x40')]){_0x32144c['include']=[{'all':!![]}];}_0x32144c=_[_0x4ab8('0x47')]({},_0x32144c,_0x203ba3[_0x4ab8('0x3f')]);return db[_0x4ab8('0x2a')]['find'](_0x32144c)[_0x4ab8('0x22')](handleEntityNotFound(_0x138da0,null))['then'](respondWithResult(_0x138da0,null))[_0x4ab8('0x44')](handleError(_0x138da0,null));};exports['update']=function(_0xefebef,_0x4bb8a5){if(_0xefebef[_0x4ab8('0x48')]['id']){delete _0xefebef[_0x4ab8('0x48')]['id'];}return db[_0x4ab8('0x2a')]['find']({'where':{'id':_0xefebef[_0x4ab8('0x46')]['id']}})[_0x4ab8('0x22')](handleEntityNotFound(_0x4bb8a5,null))[_0x4ab8('0x22')](saveUpdates(_0xefebef[_0x4ab8('0x48')],null))[_0x4ab8('0x22')](respondWithResult(_0x4bb8a5,null))[_0x4ab8('0x44')](handleError(_0x4bb8a5,null));};exports['destroy']=function(_0x50a325,_0x5732f2){return db[_0x4ab8('0x2a')]['find']({'where':{'id':_0x50a325['params']['id']}})[_0x4ab8('0x22')](handleEntityNotFound(_0x5732f2,null))[_0x4ab8('0x22')](removeEntity(_0x5732f2,null))['catch'](handleError(_0x5732f2,null));};exports[_0x4ab8('0x49')]=function(_0x299833,_0x2074e7){return db['CmHopperBlack'][_0x4ab8('0x49')]()[_0x4ab8('0x22')](respondWithResult(_0x2074e7,null))['catch'](handleError(_0x2074e7,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 5268408..230d729 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 _0x81bd=['../../config/environment','./cmHopperBlack.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x82b358,_0x32bc9b){var _0x118ae0=function(_0x416885){while(--_0x416885){_0x82b358['push'](_0x82b358['shift']());}};_0x118ae0(++_0x32bc9b);}(_0x81bd,0x7c));var _0xd81b=function(_0x14686a,_0x540f0d){_0x14686a=_0x14686a-0x0;var _0xeafc86=_0x81bd[_0x14686a];return _0xeafc86;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var logger=require(_0xd81b('0x2'))(_0xd81b('0x3'));var moment=require(_0xd81b('0x4'));var BPromise=require(_0xd81b('0x5'));var rp=require(_0xd81b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd81b('0x7'));var config=require(_0xd81b('0x8'));var attributes=require(_0xd81b('0x9'));module['exports']=function(_0x42a0aa,_0x34eb73){return _0x42a0aa[_0xd81b('0xa')]('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb43b=['rimraf','../../config/environment','./cmHopperBlack.attributes','CmHopperBlack','cm_hopper_black','lodash','util','api','moment','bluebird','path'];(function(_0x1e1873,_0x314523){var _0x10fc38=function(_0x23d101){while(--_0x23d101){_0x1e1873['push'](_0x1e1873['shift']());}};_0x10fc38(++_0x314523);}(_0xb43b,0x1b2));var _0xbb43=function(_0x28812f,_0x112b1d){_0x28812f=_0x28812f-0x0;var _0x491a27=_0xb43b[_0x28812f];return _0x491a27;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var moment=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb43('0x5'));var rimraf=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var attributes=require(_0xbb43('0x8'));module['exports']=function(_0x491fb9,_0x378df5){return _0x491fb9['define'](_0xbb43('0x9'),attributes,{'tableName':_0xbb43('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 497516b..f6595b6 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 _0x0250=['include','map','model','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','raw','options','where','attributes','limit'];(function(_0x1a2f72,_0x9c3745){var _0x2bbbcf=function(_0x241873){while(--_0x241873){_0x1a2f72['push'](_0x1a2f72['shift']());}};_0x2bbbcf(++_0x9c3745);}(_0x0250,0x170));var _0x0025=function(_0x163d3a,_0x4e81bf){_0x163d3a=_0x163d3a-0x0;var _0xc15245=_0x0250[_0x163d3a];return _0xc15245;};'use strict';var _=require(_0x0025('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0025('0x1'));var rs=require(_0x0025('0x2'));var fs=require('fs');var Redis=require(_0x0025('0x3'));var db=require(_0x0025('0x4'))['db'];var utils=require(_0x0025('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0025('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1be740,_0xbd64c0,_0x4110f5){return new BPromise(function(_0x3840f6,_0x47d0a4){return client[_0x0025('0x7')](_0x1be740,_0x4110f5)[_0x0025('0x8')](function(_0x152b07){logger['info'](_0x0025('0x9'),_0xbd64c0,_0x0025('0xa'));logger[_0x0025('0xb')](_0x0025('0xc'),_0xbd64c0,_0x0025('0xa'),JSON[_0x0025('0xd')](_0x152b07));if(_0x152b07[_0x0025('0xe')]){if(_0x152b07[_0x0025('0xe')][_0x0025('0xf')]===0x1f4){logger['error'](_0x0025('0x9'),_0xbd64c0,_0x152b07[_0x0025('0xe')]['message']);return _0x47d0a4(_0x152b07[_0x0025('0xe')]['message']);}logger[_0x0025('0xe')](_0x0025('0x9'),_0xbd64c0,_0x152b07[_0x0025('0xe')][_0x0025('0x10')]);return _0x3840f6(_0x152b07[_0x0025('0xe')][_0x0025('0x10')]);}else{logger[_0x0025('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0xbd64c0,_0x0025('0xa'));_0x3840f6(_0x152b07[_0x0025('0x12')][_0x0025('0x10')]);}})[_0x0025('0x13')](function(_0x236ca2){logger[_0x0025('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0xbd64c0,_0x236ca2);_0x47d0a4(_0x236ca2);});});}exports[_0x0025('0x14')]=function(_0x5018e1){var _0x5a12a6=this;return new Promise(function(_0x1af1fa,_0x922591){return db[_0x0025('0x15')][_0x0025('0x16')]({'raw':_0x5018e1['options']?_0x5018e1['options'][_0x0025('0x17')]===undefined?!![]:![]:!![],'where':_0x5018e1[_0x0025('0x18')]?_0x5018e1['options'][_0x0025('0x19')]||null:null,'attributes':_0x5018e1[_0x0025('0x18')]?_0x5018e1['options'][_0x0025('0x1a')]||null:null,'limit':_0x5018e1[_0x0025('0x18')]?_0x5018e1['options'][_0x0025('0x1b')]||null:null,'include':_0x5018e1[_0x0025('0x18')]?_0x5018e1[_0x0025('0x18')][_0x0025('0x1c')]?_[_0x0025('0x1d')](_0x5018e1[_0x0025('0x18')][_0x0025('0x1c')],function(_0x29ecca){return{'model':db[_0x29ecca[_0x0025('0x1e')]],'as':_0x29ecca['as'],'attributes':_0x29ecca[_0x0025('0x1a')],'include':_0x29ecca['include']?_['map'](_0x29ecca[_0x0025('0x1c')],function(_0x5ccd86){return{'model':db[_0x5ccd86[_0x0025('0x1e')]],'as':_0x5ccd86['as'],'attributes':_0x5ccd86[_0x0025('0x1a')],'include':_0x5ccd86['include']?_['map'](_0x5ccd86[_0x0025('0x1c')],function(_0x1376fc){return{'model':db[_0x1376fc['model']],'as':_0x1376fc['as'],'attributes':_0x1376fc['attributes']};}):[]};}):[]};}):[]:[]})[_0x0025('0x8')](function(_0x330d1b){logger[_0x0025('0x11')](_0x0025('0x14'),_0x5018e1);logger['debug']('GetCmHopperBlack',_0x5018e1,JSON[_0x0025('0xd')](_0x330d1b));_0x1af1fa(_0x330d1b);})[_0x0025('0x13')](function(_0x4296d7){logger[_0x0025('0xe')]('GetCmHopperBlack',_0x4296d7[_0x0025('0x10')],_0x5018e1);_0x922591(_0x5a12a6['error'](0x1f4,_0x4296d7['message']));});});};exports[_0x0025('0x1f')]=function(_0xa048b9){var _0x35c9cd=this;return new Promise(function(_0x196ac1,_0x1975da){return db[_0x0025('0x15')][_0x0025('0x20')](_0xa048b9[_0x0025('0x21')],{'raw':_0xa048b9[_0x0025('0x18')]?_0xa048b9['options'][_0x0025('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa048b9[_0x0025('0x18')]?_0xa048b9[_0x0025('0x18')]['where']||null:null,'attributes':_0xa048b9[_0x0025('0x18')]?_0xa048b9[_0x0025('0x18')][_0x0025('0x1a')]||null:null,'limit':_0xa048b9['options']?_0xa048b9[_0x0025('0x18')][_0x0025('0x1b')]||null:null})[_0x0025('0x8')](function(_0x28e6f2){logger[_0x0025('0x11')](_0x0025('0x1f'),_0xa048b9);logger['debug'](_0x0025('0x1f'),_0xa048b9,JSON['stringify'](_0x28e6f2));_0x196ac1(_0x28e6f2);})[_0x0025('0x13')](function(_0x3c53bb){logger[_0x0025('0xe')](_0x0025('0x1f'),_0x3c53bb['message'],_0xa048b9);_0x1975da(_0x35c9cd[_0x0025('0xe')](0x1f4,_0x3c53bb[_0x0025('0x10')]));});});};exports[_0x0025('0x22')]=function(_0x381613){var _0x439250=this;return new Promise(function(_0x5b3ee6,_0x535061){return db[_0x0025('0x15')][_0x0025('0x23')]({'where':_0x381613[_0x0025('0x18')]?_0x381613[_0x0025('0x18')][_0x0025('0x19')]||null:null})[_0x0025('0x8')](function(_0x171790){logger[_0x0025('0x11')](_0x0025('0x22'),_0x381613);logger['debug'](_0x0025('0x22'),_0x381613,JSON[_0x0025('0xd')](_0x171790));_0x5b3ee6(_0x171790);})[_0x0025('0x13')](function(_0x2ae752){logger[_0x0025('0xe')](_0x0025('0x22'),_0x2ae752['message'],_0x381613);_0x535061(_0x439250[_0x0025('0xe')](0x1f4,_0x2ae752[_0x0025('0x10')]));});});}; \ No newline at end of file +var _0xdb49=['raw','limit','include','map','model','attributes','GetCmHopperBlack','debug','catch','update','body','where','DestroyCmHopperBlack','destroy','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CmHopperBlack','findAll','options'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xdb49,0x136));var _0x9db4=function(_0x1258df,_0x5ac9cf){_0x1258df=_0x1258df-0x0;var _0x1bc196=_0xdb49[_0x1258df];return _0x1bc196;};'use strict';var _=require(_0x9db4('0x0'));var util=require(_0x9db4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9db4('0x2'));var fs=require('fs');var Redis=require(_0x9db4('0x3'));var db=require(_0x9db4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9db4('0x5'))(_0x9db4('0x6'));var config=require(_0x9db4('0x7'));var jayson=require(_0x9db4('0x8'));var client=jayson['client'][_0x9db4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x495756,_0xb28b73,_0x3b90bd){return new BPromise(function(_0xbc22b6,_0x57a32a){return client['request'](_0x495756,_0x3b90bd)[_0x9db4('0xa')](function(_0x9f951e){logger[_0x9db4('0xb')](_0x9db4('0xc'),_0xb28b73,_0x9db4('0xd'));logger['debug'](_0x9db4('0xe'),_0xb28b73,_0x9db4('0xd'),JSON[_0x9db4('0xf')](_0x9f951e));if(_0x9f951e[_0x9db4('0x10')]){if(_0x9f951e['error'][_0x9db4('0x11')]===0x1f4){logger[_0x9db4('0x10')](_0x9db4('0xc'),_0xb28b73,_0x9f951e['error']['message']);return _0x57a32a(_0x9f951e[_0x9db4('0x10')][_0x9db4('0x12')]);}logger[_0x9db4('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0xb28b73,_0x9f951e[_0x9db4('0x10')][_0x9db4('0x12')]);return _0xbc22b6(_0x9f951e[_0x9db4('0x10')]['message']);}else{logger[_0x9db4('0xb')](_0x9db4('0xc'),_0xb28b73,_0x9db4('0xd'));_0xbc22b6(_0x9f951e[_0x9db4('0x13')][_0x9db4('0x12')]);}})['catch'](function(_0x5251a2){logger[_0x9db4('0x10')](_0x9db4('0xc'),_0xb28b73,_0x5251a2);_0x57a32a(_0x5251a2);});});}exports['GetCmHopperBlack']=function(_0x5648c8){var _0x2466e9=this;return new Promise(function(_0x1e01a3,_0x56bd8e){return db[_0x9db4('0x14')][_0x9db4('0x15')]({'raw':_0x5648c8[_0x9db4('0x16')]?_0x5648c8[_0x9db4('0x16')][_0x9db4('0x17')]===undefined?!![]:![]:!![],'where':_0x5648c8[_0x9db4('0x16')]?_0x5648c8[_0x9db4('0x16')]['where']||null:null,'attributes':_0x5648c8[_0x9db4('0x16')]?_0x5648c8[_0x9db4('0x16')]['attributes']||null:null,'limit':_0x5648c8['options']?_0x5648c8['options'][_0x9db4('0x18')]||null:null,'include':_0x5648c8['options']?_0x5648c8[_0x9db4('0x16')][_0x9db4('0x19')]?_[_0x9db4('0x1a')](_0x5648c8[_0x9db4('0x16')]['include'],function(_0x3b76af){return{'model':db[_0x3b76af['model']],'as':_0x3b76af['as'],'attributes':_0x3b76af['attributes'],'include':_0x3b76af[_0x9db4('0x19')]?_[_0x9db4('0x1a')](_0x3b76af[_0x9db4('0x19')],function(_0x3a4e11){return{'model':db[_0x3a4e11[_0x9db4('0x1b')]],'as':_0x3a4e11['as'],'attributes':_0x3a4e11[_0x9db4('0x1c')],'include':_0x3a4e11[_0x9db4('0x19')]?_[_0x9db4('0x1a')](_0x3a4e11[_0x9db4('0x19')],function(_0x245df3){return{'model':db[_0x245df3[_0x9db4('0x1b')]],'as':_0x245df3['as'],'attributes':_0x245df3[_0x9db4('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e3dc3){logger[_0x9db4('0xb')](_0x9db4('0x1d'),_0x5648c8);logger[_0x9db4('0x1e')]('GetCmHopperBlack',_0x5648c8,JSON['stringify'](_0x1e3dc3));_0x1e01a3(_0x1e3dc3);})[_0x9db4('0x1f')](function(_0xafb504){logger[_0x9db4('0x10')]('GetCmHopperBlack',_0xafb504['message'],_0x5648c8);_0x56bd8e(_0x2466e9[_0x9db4('0x10')](0x1f4,_0xafb504[_0x9db4('0x12')]));});});};exports['UpdateCmHopperBlack']=function(_0x38a74b){var _0x111e08=this;return new Promise(function(_0x14af24,_0x255510){return db[_0x9db4('0x14')][_0x9db4('0x20')](_0x38a74b[_0x9db4('0x21')],{'raw':_0x38a74b[_0x9db4('0x16')]?_0x38a74b[_0x9db4('0x16')][_0x9db4('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38a74b[_0x9db4('0x16')]?_0x38a74b[_0x9db4('0x16')][_0x9db4('0x22')]||null:null,'attributes':_0x38a74b['options']?_0x38a74b[_0x9db4('0x16')][_0x9db4('0x1c')]||null:null,'limit':_0x38a74b[_0x9db4('0x16')]?_0x38a74b['options'][_0x9db4('0x18')]||null:null})[_0x9db4('0xa')](function(_0x3c549c){logger[_0x9db4('0xb')]('UpdateCmHopperBlack',_0x38a74b);logger[_0x9db4('0x1e')]('UpdateCmHopperBlack',_0x38a74b,JSON[_0x9db4('0xf')](_0x3c549c));_0x14af24(_0x3c549c);})[_0x9db4('0x1f')](function(_0xef8b46){logger[_0x9db4('0x10')]('UpdateCmHopperBlack',_0xef8b46[_0x9db4('0x12')],_0x38a74b);_0x255510(_0x111e08[_0x9db4('0x10')](0x1f4,_0xef8b46['message']));});});};exports[_0x9db4('0x23')]=function(_0x59e322){var _0x5cc8fa=this;return new Promise(function(_0x1b306f,_0x513586){return db['CmHopperBlack'][_0x9db4('0x24')]({'where':_0x59e322[_0x9db4('0x16')]?_0x59e322[_0x9db4('0x16')][_0x9db4('0x22')]||null:null})[_0x9db4('0xa')](function(_0x5b8608){logger[_0x9db4('0xb')]('DestroyCmHopperBlack',_0x59e322);logger[_0x9db4('0x1e')](_0x9db4('0x23'),_0x59e322,JSON[_0x9db4('0xf')](_0x5b8608));_0x1b306f(_0x5b8608);})[_0x9db4('0x1f')](function(_0xc3fc50){logger['error'](_0x9db4('0x23'),_0xc3fc50[_0x9db4('0x12')],_0x59e322);_0x513586(_0x5cc8fa[_0x9db4('0x10')](0x1f4,_0xc3fc50[_0x9db4('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 07fa0bc..8944a93 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 _0x6921=['exports','util','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','update','delete','destroy'];(function(_0x365b01,_0x4d1cb4){var _0x4235f5=function(_0x5927db){while(--_0x5927db){_0x365b01['push'](_0x365b01['shift']());}};_0x4235f5(++_0x4d1cb4);}(_0x6921,0x1d1));var _0x1692=function(_0x30c1cc,_0x17dfbc){_0x30c1cc=_0x30c1cc-0x0;var _0x471870=_0x6921[_0x30c1cc];return _0x471870;};'use strict';var multer=require('multer');var util=require(_0x1692('0x0'));var path=require('path');var timeout=require(_0x1692('0x1'));var express=require('express');var router=express[_0x1692('0x2')]();var auth=require(_0x1692('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1692('0x4'));var controller=require('./cmHopperBlack.controller');router[_0x1692('0x5')]('/',auth[_0x1692('0x6')](),controller[_0x1692('0x7')]);router[_0x1692('0x5')](_0x1692('0x8'),auth[_0x1692('0x6')](),controller[_0x1692('0x9')]);router[_0x1692('0x5')](_0x1692('0xa'),auth[_0x1692('0x6')](),controller[_0x1692('0xb')]);router['put'](_0x1692('0xa'),auth['isAuthenticated'](),controller[_0x1692('0xc')]);router[_0x1692('0xd')](_0x1692('0xa'),auth[_0x1692('0x6')](),controller[_0x1692('0xe')]);module[_0x1692('0xf')]=router; \ No newline at end of file +var _0x53f3=['isAuthenticated','index','/describe','/:id','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get'];(function(_0x467d96,_0x372ca0){var _0x559136=function(_0x21ece5){while(--_0x21ece5){_0x467d96['push'](_0x467d96['shift']());}};_0x559136(++_0x372ca0);}(_0x53f3,0xe0));var _0x353f=function(_0x2bd0d5,_0x4ace31){_0x2bd0d5=_0x2bd0d5-0x0;var _0x3a963e=_0x53f3[_0x2bd0d5];return _0x3a963e;};'use strict';var multer=require(_0x353f('0x0'));var util=require(_0x353f('0x1'));var path=require(_0x353f('0x2'));var timeout=require(_0x353f('0x3'));var express=require('express');var router=express[_0x353f('0x4')]();var auth=require(_0x353f('0x5'));var interaction=require(_0x353f('0x6'));var config=require(_0x353f('0x7'));var controller=require(_0x353f('0x8'));router[_0x353f('0x9')]('/',auth[_0x353f('0xa')](),controller[_0x353f('0xb')]);router[_0x353f('0x9')](_0x353f('0xc'),auth[_0x353f('0xa')](),controller['describe']);router[_0x353f('0x9')](_0x353f('0xd'),auth[_0x353f('0xa')](),controller['show']);router[_0x353f('0xe')](_0x353f('0xd'),auth[_0x353f('0xa')](),controller[_0x353f('0xf')]);router['delete'](_0x353f('0xd'),auth[_0x353f('0xa')](),controller[_0x353f('0x10')]);module[_0x353f('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index d9a41f5..36c140a 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 _0x2721=['endtime','setDataValue','diff','seconds','dispositionat','BOOLEAN','moment','INTEGER','STRING','DATE','getDataValue'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x2721,0x192));var _0x1272=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x2721[_0x42bdad];return _0x122626;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1272('0x0'));module['exports']={'state':{'type':Sequelize[_0x1272('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x1272('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x1272('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1272('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1272('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x1272('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1272('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x1272('0x2')]},'originatecalleridname':{'type':Sequelize[_0x1272('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x1272('0x2')]},'starttime':{'type':Sequelize[_0x1272('0x3')]},'responsetime':{'type':Sequelize[_0x1272('0x3')]},'answertime':{'type':Sequelize[_0x1272('0x3')]},'droptime':{'type':Sequelize[_0x1272('0x3')]},'endtime':{'type':Sequelize[_0x1272('0x3')]},'ringtime':{'type':Sequelize[_0x1272('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1272('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1272('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x1272('0x2')]},'campaign':{'type':Sequelize[_0x1272('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x1272('0x2')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x1272('0x3')],'set':function(_0x5a0d59){var _0x272e9e=this[_0x1272('0x4')](_0x1272('0x5'));if(_0x272e9e&&_0x5a0d59){this[_0x1272('0x6')]('followuptime',moment(_0x5a0d59)[_0x1272('0x7')](moment(_0x272e9e),_0x1272('0x8')));}return this[_0x1272('0x6')](_0x1272('0x9'),_0x5a0d59);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x1272('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x1272('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x1272('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1272('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x1272('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x1272('0x3')]}}; \ No newline at end of file +var _0xdcd8=['getDataValue','endtime','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x51f815,_0x1615c1){var _0x54a804=function(_0x3c3e9c){while(--_0x3c3e9c){_0x51f815['push'](_0x51f815['shift']());}};_0x54a804(++_0x1615c1);}(_0xdcd8,0x140));var _0x8dcd=function(_0xf1293b,_0x465909){_0xf1293b=_0xf1293b-0x0;var _0x5e71d7=_0xdcd8[_0xf1293b];return _0x5e71d7;};'use strict';var Sequelize=require(_0x8dcd('0x0'));var moment=require('moment');module[_0x8dcd('0x1')]={'state':{'type':Sequelize[_0x8dcd('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x8dcd('0x3')]},'scheduledat':{'type':Sequelize[_0x8dcd('0x4')]},'countbusyretry':{'type':Sequelize[_0x8dcd('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8dcd('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x8dcd('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8dcd('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x8dcd('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x8dcd('0x3')]},'calleridname':{'type':Sequelize[_0x8dcd('0x3')]},'starttime':{'type':Sequelize[_0x8dcd('0x4')]},'responsetime':{'type':Sequelize[_0x8dcd('0x4')]},'answertime':{'type':Sequelize[_0x8dcd('0x4')]},'droptime':{'type':Sequelize[_0x8dcd('0x4')]},'endtime':{'type':Sequelize[_0x8dcd('0x4')]},'ringtime':{'type':Sequelize[_0x8dcd('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8dcd('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8dcd('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x8dcd('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8dcd('0x3')]},'reason':{'type':Sequelize[_0x8dcd('0x3')]},'disposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x8dcd('0x4')],'set':function(_0x18bc07){var _0x39524e=this[_0x8dcd('0x5')](_0x8dcd('0x6'));if(_0x39524e&&_0x18bc07){this[_0x8dcd('0x7')](_0x8dcd('0x8'),moment(_0x18bc07)[_0x8dcd('0x9')](moment(_0x39524e),_0x8dcd('0xa')));}return this[_0x8dcd('0x7')](_0x8dcd('0xb'),_0x18bc07);}},'amd':{'type':Sequelize[_0x8dcd('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x8dcd('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x8dcd('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x8dcd('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8dcd('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8dcd('0x4')]},'deleted':{'type':Sequelize[_0x8dcd('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x8dcd('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 6453e6a..ded71b3 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 _0xf0f9=['ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','end','send','index','CmHopperFinal','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','`state`\x20=\x205,\x201,\x20null','dropContacts','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','field','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','NOW()','createdAt','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','state\x20=\x204','group','ContactId','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(calleridnum)','calleridnum\x20IS\x20NOT\x20NULL','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0xf0f9,0x1ea));var _0x9f0f=function(_0x25ed72,_0x1a4cf8){_0x25ed72=_0x25ed72-0x0;var _0x1f3b23=_0xf0f9[_0x25ed72];return _0x1f3b23;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9f0f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9f0f('0x1'));var jsonpatch=require(_0x9f0f('0x2'));var rp=require('request-promise');var moment=require(_0x9f0f('0x3'));var BPromise=require(_0x9f0f('0x4'));var Mustache=require(_0x9f0f('0x5'));var util=require(_0x9f0f('0x6'));var path=require(_0x9f0f('0x7'));var sox=require(_0x9f0f('0x8'));var csv=require(_0x9f0f('0x9'));var ejs=require(_0x9f0f('0xa'));var fs=require('fs');var _=require(_0x9f0f('0xb'));var squel=require(_0x9f0f('0xc'));var crypto=require(_0x9f0f('0xd'));var jsforce=require(_0x9f0f('0xe'));var deskjs=require(_0x9f0f('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9f0f('0x10'));var Redis=require(_0x9f0f('0x11'));var authService=require(_0x9f0f('0x12'));var qs=require(_0x9f0f('0x13'));var hardwareService=require(_0x9f0f('0x14'));var logger=require('../../config/logger')(_0x9f0f('0x15'));var utils=require(_0x9f0f('0x16'));var config=require('../../config/environment');var db=require(_0x9f0f('0x17'))['db'];function respondWithStatusCode(_0x1a3bbf,_0xb36fff){_0xb36fff=_0xb36fff||0xcc;return function(_0x201fbc){if(_0x201fbc){return _0x1a3bbf[_0x9f0f('0x18')](_0xb36fff);}return _0x1a3bbf[_0x9f0f('0x19')](_0xb36fff)['end']();};}function respondWithResult(_0x1825ec,_0x55adfe){_0x55adfe=_0x55adfe||0xc8;return function(_0xb09027){if(_0xb09027){return _0x1825ec['status'](_0x55adfe)[_0x9f0f('0x1a')](_0xb09027);}};}function respondWithFilteredResult(_0x52b127,_0x181c86){return function(_0x593f83){if(_0x593f83){var _0x28d14a=_0x593f83[_0x9f0f('0x1b')],_0x5bceeb=_0x181c86['offset'],_0x3db68e=_0x181c86[_0x9f0f('0x1c')]+_0x181c86[_0x9f0f('0x1d')],_0x360a7a;if(_0x3db68e>=_0x28d14a){_0x3db68e=_0x28d14a;_0x360a7a=0xc8;}else{_0x360a7a=0xce;}_0x52b127[_0x9f0f('0x19')](_0x360a7a);return _0x52b127[_0x9f0f('0x1e')](_0x9f0f('0x1f'),_0x5bceeb+'-'+_0x3db68e+'/'+_0x28d14a)[_0x9f0f('0x1a')](_0x593f83);}return null;};}function patchUpdates(_0x2d88b5){return function(_0x5ef1d8){try{jsonpatch[_0x9f0f('0x20')](_0x5ef1d8,_0x2d88b5,!![]);}catch(_0x451566){return BPromise[_0x9f0f('0x21')](_0x451566);}return _0x5ef1d8['save']();};}function saveUpdates(_0x148030,_0x26bc01){return function(_0x1e1aa9){if(_0x1e1aa9){return _0x1e1aa9[_0x9f0f('0x22')](_0x148030)['then'](function(_0x5f6f41){return _0x5f6f41;});}return null;};}function removeEntity(_0x3dd83d,_0x585ad6){return function(_0x398c29){if(_0x398c29){return _0x398c29['destroy']()['then'](function(){_0x3dd83d[_0x9f0f('0x19')](0xcc)[_0x9f0f('0x23')]();});}};}function handleEntityNotFound(_0x4acff4,_0x51a8fd){return function(_0x1a6a75){if(!_0x1a6a75){_0x4acff4[_0x9f0f('0x18')](0x194);}return _0x1a6a75;};}function handleError(_0x265075,_0x1e3180){_0x1e3180=_0x1e3180||0x1f4;return function(_0x17bd9f){logger['error'](_0x17bd9f['stack']);if(_0x17bd9f['name']){delete _0x17bd9f['name'];}_0x265075[_0x9f0f('0x19')](_0x1e3180)[_0x9f0f('0x24')](_0x17bd9f);};}exports[_0x9f0f('0x25')]=function(_0x34914b,_0x310903){var _0x311397={},_0x47ab52={},_0x125615={'count':0x0,'rows':[]};var _0x39c287=db[_0x9f0f('0x26')][_0x9f0f('0x27')];_0x47ab52['model']=_[_0x9f0f('0x28')](_0x39c287);_0x47ab52[_0x9f0f('0x29')]=_['keys'](_0x34914b[_0x9f0f('0x29')]);_0x47ab52[_0x9f0f('0x2a')]=_[_0x9f0f('0x2b')](_0x47ab52[_0x9f0f('0x2c')],_0x47ab52[_0x9f0f('0x29')]);_0x311397[_0x9f0f('0x2d')]=_[_0x9f0f('0x2b')](_0x47ab52[_0x9f0f('0x2c')],qs[_0x9f0f('0x2e')](_0x34914b[_0x9f0f('0x29')][_0x9f0f('0x2e')]));_0x311397[_0x9f0f('0x2d')]=_0x311397[_0x9f0f('0x2d')][_0x9f0f('0x2f')]?_0x311397['attributes']:_0x47ab52[_0x9f0f('0x2c')];if(!_0x34914b[_0x9f0f('0x29')][_0x9f0f('0x30')](_0x9f0f('0x31'))){_0x311397['limit']=qs[_0x9f0f('0x1d')](_0x34914b['query'][_0x9f0f('0x1d')]);_0x311397[_0x9f0f('0x1c')]=qs[_0x9f0f('0x1c')](_0x34914b[_0x9f0f('0x29')]['offset']);}_0x311397[_0x9f0f('0x32')]=qs[_0x9f0f('0x33')](_0x34914b[_0x9f0f('0x29')][_0x9f0f('0x33')]);_0x311397['where']=qs[_0x9f0f('0x2a')](_[_0x9f0f('0x34')](_0x34914b[_0x9f0f('0x29')],_0x47ab52[_0x9f0f('0x2a')]));if(_0x34914b[_0x9f0f('0x29')][_0x9f0f('0x35')]){_0x311397[_0x9f0f('0x36')]=_[_0x9f0f('0x37')](_0x311397[_0x9f0f('0x36')],{'$or':_[_0x9f0f('0x38')](_0x39c287,function(_0x3d42a1){if(_0x3d42a1[_0x9f0f('0x39')]['key']!==_0x9f0f('0x3a')){var _0x30243b={};_0x30243b[_0x3d42a1['field']]={'$like':'%'+_0x34914b['query'][_0x9f0f('0x35')]+'%'};return _0x30243b;}})});}_0x311397=_[_0x9f0f('0x37')]({},_0x311397,_0x34914b[_0x9f0f('0x3b')]);var _0x1cba90={'where':_0x311397[_0x9f0f('0x36')]};return db[_0x9f0f('0x26')][_0x9f0f('0x1b')](_0x1cba90)[_0x9f0f('0x3c')](function(_0x3f3868){_0x125615[_0x9f0f('0x1b')]=_0x3f3868;if(_0x34914b[_0x9f0f('0x29')][_0x9f0f('0x3d')]){_0x311397[_0x9f0f('0x3e')]=[{'all':!![]}];}return db[_0x9f0f('0x26')][_0x9f0f('0x3f')](_0x311397);})[_0x9f0f('0x3c')](function(_0x3a9e93){_0x125615[_0x9f0f('0x40')]=_0x3a9e93;return _0x125615;})[_0x9f0f('0x3c')](respondWithFilteredResult(_0x310903,_0x311397))[_0x9f0f('0x41')](handleError(_0x310903,null));};exports[_0x9f0f('0x42')]=function(_0x4024e9,_0x4e9e8e){var _0x229553={'raw':!![],'where':{'id':_0x4024e9[_0x9f0f('0x43')]['id']}},_0x499b80={};_0x499b80[_0x9f0f('0x2c')]=_['keys'](db[_0x9f0f('0x26')]['rawAttributes']);_0x499b80[_0x9f0f('0x29')]=_['keys'](_0x4024e9['query']);_0x499b80[_0x9f0f('0x2a')]=_[_0x9f0f('0x2b')](_0x499b80['model'],_0x499b80[_0x9f0f('0x29')]);_0x229553[_0x9f0f('0x2d')]=_[_0x9f0f('0x2b')](_0x499b80[_0x9f0f('0x2c')],qs[_0x9f0f('0x2e')](_0x4024e9[_0x9f0f('0x29')][_0x9f0f('0x2e')]));_0x229553['attributes']=_0x229553[_0x9f0f('0x2d')][_0x9f0f('0x2f')]?_0x229553['attributes']:_0x499b80[_0x9f0f('0x2c')];if(_0x4024e9[_0x9f0f('0x29')][_0x9f0f('0x3d')]){_0x229553[_0x9f0f('0x3e')]=[{'all':!![]}];}_0x229553=_[_0x9f0f('0x37')]({},_0x229553,_0x4024e9[_0x9f0f('0x3b')]);return db[_0x9f0f('0x26')][_0x9f0f('0x44')](_0x229553)[_0x9f0f('0x3c')](handleEntityNotFound(_0x4e9e8e,null))[_0x9f0f('0x3c')](respondWithResult(_0x4e9e8e,null))[_0x9f0f('0x41')](handleError(_0x4e9e8e,null));};exports[_0x9f0f('0x45')]=function(_0x21c887,_0x1b22bf){return db['CmHopperFinal']['describe']()[_0x9f0f('0x3c')](respondWithResult(_0x1b22bf,null))[_0x9f0f('0x41')](handleError(_0x1b22bf,null));};exports[_0x9f0f('0x22')]=function(_0x4abe24,_0x1d2d5b){if(_0x4abe24[_0x9f0f('0x46')][_0x9f0f('0x47')]){delete _0x4abe24[_0x9f0f('0x46')]['uniqueid'];}return db[_0x9f0f('0x26')][_0x9f0f('0x44')]({'where':{'uniqueid':_0x4abe24[_0x9f0f('0x43')]['id']}})[_0x9f0f('0x3c')](handleEntityNotFound(_0x1d2d5b,null))[_0x9f0f('0x3c')](saveUpdates(_0x4abe24[_0x9f0f('0x46')],null))[_0x9f0f('0x3c')](respondWithResult(_0x1d2d5b,null))[_0x9f0f('0x41')](handleError(_0x1d2d5b,null));};exports[_0x9f0f('0x48')]=function(_0x1c54cf,_0x5e2ea8,_0x5e796c){return db[_0x9f0f('0x26')][_0x9f0f('0x3f')]({'raw':![],'where':{'VoiceQueueId':_0x1c54cf[_0x9f0f('0x43')]['id']},'attributes':[[db[_0x9f0f('0x49')]['fn'](_0x9f0f('0x4a'),db[_0x9f0f('0x49')]['fn']('IF',db[_0x9f0f('0x49')][_0x9f0f('0x4b')](_0x9f0f('0x4c')))),'noSuchContacts'],[db[_0x9f0f('0x49')]['fn'](_0x9f0f('0x4a'),db['sequelize']['fn']('IF',db[_0x9f0f('0x49')][_0x9f0f('0x4b')]('`state`\x20=\x203,\x201,\x20null'))),_0x9f0f('0x4d')],[db['sequelize']['fn']('COUNT',db[_0x9f0f('0x49')]['fn']('IF',db[_0x9f0f('0x49')][_0x9f0f('0x4b')]('`state`\x20=\x205,\x201,\x20null'))),_0x9f0f('0x4e')],[db[_0x9f0f('0x49')]['fn'](_0x9f0f('0x4a'),db[_0x9f0f('0x49')]['fn']('IF',db[_0x9f0f('0x49')][_0x9f0f('0x4b')](_0x9f0f('0x4f')))),_0x9f0f('0x50')],[db[_0x9f0f('0x49')]['fn'](_0x9f0f('0x4a'),db['sequelize']['fn']('IF',db[_0x9f0f('0x49')][_0x9f0f('0x4b')](_0x9f0f('0x51')))),'dropContacts'],[db[_0x9f0f('0x49')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x9f0f('0x49')]['literal'](_0x9f0f('0x52')))),'abandonedContacts'],[db['sequelize']['fn'](_0x9f0f('0x4a'),db[_0x9f0f('0x49')]['fn']('IF',db[_0x9f0f('0x49')]['literal'](_0x9f0f('0x53')))),_0x9f0f('0x54')],[db[_0x9f0f('0x49')]['fn']('COUNT',db[_0x9f0f('0x49')]['fn']('IF',db['sequelize'][_0x9f0f('0x4b')](_0x9f0f('0x55')))),_0x9f0f('0x56')]]})['then'](handleEntityNotFound(_0x5e2ea8,null))['then'](respondWithResult(_0x5e2ea8,null))[_0x9f0f('0x41')](handleError(_0x5e2ea8,null));};exports[_0x9f0f('0x57')]=function(_0x2695d8,_0x378fed,_0x4f9662){return db[_0x9f0f('0x26')][_0x9f0f('0x3f')]({'raw':![],'where':{'CampaignId':_0x2695d8[_0x9f0f('0x43')]['id']},'attributes':[[db['sequelize']['fn']('COUNT',db[_0x9f0f('0x49')]['fn']('IF',db[_0x9f0f('0x49')][_0x9f0f('0x4b')]('`state`\x20=\x200,\x201,\x20null'))),_0x9f0f('0x58')],[db[_0x9f0f('0x49')]['fn'](_0x9f0f('0x4a'),db[_0x9f0f('0x49')]['fn']('IF',db[_0x9f0f('0x49')][_0x9f0f('0x4b')]('`state`\x20=\x203,\x201,\x20null'))),_0x9f0f('0x4d')],[db[_0x9f0f('0x49')]['fn'](_0x9f0f('0x4a'),db[_0x9f0f('0x49')]['fn']('IF',db[_0x9f0f('0x49')][_0x9f0f('0x4b')](_0x9f0f('0x59')))),_0x9f0f('0x4e')],[db['sequelize']['fn']('COUNT',db[_0x9f0f('0x49')]['fn']('IF',db[_0x9f0f('0x49')][_0x9f0f('0x4b')](_0x9f0f('0x4f')))),_0x9f0f('0x50')],[db[_0x9f0f('0x49')]['fn']('COUNT',db[_0x9f0f('0x49')]['fn']('IF',db[_0x9f0f('0x49')][_0x9f0f('0x4b')](_0x9f0f('0x51')))),_0x9f0f('0x5a')],[db[_0x9f0f('0x49')]['fn'](_0x9f0f('0x4a'),db[_0x9f0f('0x49')]['fn']('IF',db[_0x9f0f('0x49')][_0x9f0f('0x4b')](_0x9f0f('0x52')))),'abandonedContacts'],[db['sequelize']['fn'](_0x9f0f('0x4a'),db[_0x9f0f('0x49')]['fn']('IF',db['sequelize']['literal'](_0x9f0f('0x53')))),_0x9f0f('0x54')],[db[_0x9f0f('0x49')]['fn'](_0x9f0f('0x4a'),db[_0x9f0f('0x49')]['fn']('IF',db[_0x9f0f('0x49')][_0x9f0f('0x4b')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})['then'](handleEntityNotFound(_0x378fed,null))[_0x9f0f('0x3c')](respondWithResult(_0x378fed,null))[_0x9f0f('0x41')](handleError(_0x378fed,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0xe2ebda,_0x49ba9d,_0x589c99){return db['VoiceQueue'][_0x9f0f('0x44')]({'where':{'id':_0xe2ebda[_0x9f0f('0x43')]['id']}})[_0x9f0f('0x3c')](handleEntityNotFound(_0x49ba9d,null))[_0x9f0f('0x3c')](function(_0xbafe37){var _0x28e3de;if(_0xbafe37){_0x28e3de=squel[_0x9f0f('0x5b')]()[_0x9f0f('0x5c')](_0x9f0f('0x5d'))[_0x9f0f('0x5e')]([_0x9f0f('0x5f'),_0x9f0f('0x60'),'ContactId',_0x9f0f('0x61'),_0x9f0f('0x62'),'createdAt','updatedAt'],squel['select']()[_0x9f0f('0x63')]('ANY_VALUE(calleridnum)',_0x9f0f('0x5f'))[_0x9f0f('0x63')]('NOW()',_0x9f0f('0x60'))['field'](_0x9f0f('0x64'),'ContactId')['field'](_0x9f0f('0x65'),'ListId')[_0x9f0f('0x63')]('ANY_VALUE(VoiceQueueId)',_0x9f0f('0x62'))[_0x9f0f('0x63')](_0x9f0f('0x66'),_0x9f0f('0x67'))[_0x9f0f('0x63')](_0x9f0f('0x66'),_0x9f0f('0x68'))[_0x9f0f('0x69')](_0x9f0f('0x6a'))[_0x9f0f('0x36')](_0x9f0f('0x6b'),_0xe2ebda[_0x9f0f('0x43')]['id'][_0x9f0f('0x6c')]())[_0x9f0f('0x36')](_0x9f0f('0x6d'),_0xe2ebda[_0x9f0f('0x46')][_0x9f0f('0x6e')][_0x9f0f('0x6c')]())[_0x9f0f('0x36')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x9f0f('0x36')](_0x9f0f('0x6f'),squel[_0x9f0f('0x70')]()[_0x9f0f('0x63')]('phone')['from']('cm_hopper')[_0x9f0f('0x36')](_0x9f0f('0x6b'),_0xe2ebda['params']['id']['toString']()))[_0x9f0f('0x36')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x9f0f('0x70')]()[_0x9f0f('0x63')](_0x9f0f('0x71'))[_0x9f0f('0x69')]('cm_hopper_final')[_0x9f0f('0x36')](_0x9f0f('0x6b'),_0xe2ebda['params']['id']['toString']())[_0x9f0f('0x36')](_0x9f0f('0x72')))[_0x9f0f('0x73')](_0x9f0f('0x74')))[_0x9f0f('0x6c')]();return db[_0x9f0f('0x49')][_0x9f0f('0x29')](_0x28e3de);}return[];})['then'](respondWithResult(_0x49ba9d,null))[_0x9f0f('0x41')](handleError(_0x49ba9d,null));};exports[_0x9f0f('0x75')]=function(_0x5cc733,_0x46f984,_0x4e1f4c){return db[_0x9f0f('0x76')][_0x9f0f('0x44')]({'where':{'id':_0x5cc733[_0x9f0f('0x43')]['id']}})['then'](handleEntityNotFound(_0x46f984,null))[_0x9f0f('0x3c')](function(_0x5a43c8){var _0x2f7332;if(_0x5a43c8){_0x2f7332=squel[_0x9f0f('0x5b')]()['into'](_0x9f0f('0x5d'))[_0x9f0f('0x5e')]([_0x9f0f('0x5f'),'scheduledAt',_0x9f0f('0x74'),_0x9f0f('0x61'),_0x9f0f('0x77'),_0x9f0f('0x67'),_0x9f0f('0x68')],squel[_0x9f0f('0x70')]()['field'](_0x9f0f('0x78'),_0x9f0f('0x5f'))['field'](_0x9f0f('0x66'),_0x9f0f('0x60'))[_0x9f0f('0x63')](_0x9f0f('0x64'),'ContactId')[_0x9f0f('0x63')](_0x9f0f('0x65'),'ListId')[_0x9f0f('0x63')]('ANY_VALUE(CampaignId)','CampaignId')[_0x9f0f('0x63')](_0x9f0f('0x66'),'createdAt')['field']('NOW()',_0x9f0f('0x68'))['from'](_0x9f0f('0x6a'))[_0x9f0f('0x36')]('CampaignId\x20=\x20?',_0x5cc733[_0x9f0f('0x43')]['id']['toString']())[_0x9f0f('0x36')](_0x9f0f('0x6d'),_0x5cc733['body'][_0x9f0f('0x6e')][_0x9f0f('0x6c')]())[_0x9f0f('0x36')](_0x9f0f('0x79'))[_0x9f0f('0x36')](_0x9f0f('0x6f'),squel[_0x9f0f('0x70')]()[_0x9f0f('0x63')]('phone')['from'](_0x9f0f('0x5d'))[_0x9f0f('0x36')](_0x9f0f('0x7a'),_0x5cc733[_0x9f0f('0x43')]['id'][_0x9f0f('0x6c')]()))[_0x9f0f('0x36')](_0x9f0f('0x6f'),squel['select']()[_0x9f0f('0x63')](_0x9f0f('0x71'))[_0x9f0f('0x69')](_0x9f0f('0x6a'))['where']('CampaignId\x20=\x20?',_0x5cc733[_0x9f0f('0x43')]['id'][_0x9f0f('0x6c')]())[_0x9f0f('0x36')](_0x9f0f('0x72')))['group'](_0x9f0f('0x74')))[_0x9f0f('0x6c')]();return db[_0x9f0f('0x49')][_0x9f0f('0x29')](_0x2f7332);}return[];})['then'](respondWithResult(_0x46f984,null))['catch'](handleError(_0x46f984,null));};exports[_0x9f0f('0x7b')]=function(_0x2e1f59,_0x5b2e17,_0x892c1){return db['CmHopper'][_0x9f0f('0x7c')]({'where':{'VoiceQueueId':_0x2e1f59[_0x9f0f('0x46')][_0x9f0f('0x62')],'CampaignId':_0x2e1f59[_0x9f0f('0x46')][_0x9f0f('0x77')],'ContactId':_0x2e1f59[_0x9f0f('0x46')][_0x9f0f('0x74')]}})[_0x9f0f('0x3c')](handleEntityNotFound(_0x5b2e17,null))[_0x9f0f('0x3c')](function(_0x11e480){if(_0x11e480){return _0x11e480;}return null;})[_0x9f0f('0x3c')](respondWithResult(_0x5b2e17,null))['catch'](handleError(_0x5b2e17,null));}; \ No newline at end of file +var _0x9b25=['moveContactsIvrCampaignHopperFinal','Campaign','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','group','CampaignId','html-pdf','eml-format','zip-dir','request-promise','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','save','update','then','destroy','stack','name','index','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','map','type','key','VIRTUAL','field','options','CmHopperFinal','includeAll','include','findAll','rows','catch','show','params','merge','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','noAnswerContacts','busyContacts','dropContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ListId)','ListId','from','cm_hopper_final','toString','state','calleridnum\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','calleridnum','state\x20=\x204'];(function(_0x13ae1e,_0xadc7d8){var _0xea00a8=function(_0x5af29e){while(--_0x5af29e){_0x13ae1e['push'](_0x13ae1e['shift']());}};_0xea00a8(++_0xadc7d8);}(_0x9b25,0x1eb));var _0x59b2=function(_0x1409cf,_0x13cd42){_0x1409cf=_0x1409cf-0x0;var _0x2ae0c7=_0x9b25[_0x1409cf];return _0x2ae0c7;};'use strict';var pdf=require(_0x59b2('0x0'));var emlformat=require(_0x59b2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x59b2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x59b2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x59b2('0x4'));var util=require(_0x59b2('0x5'));var path=require('path');var sox=require(_0x59b2('0x6'));var csv=require(_0x59b2('0x7'));var ejs=require(_0x59b2('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x59b2('0x9'));var crypto=require(_0x59b2('0xa'));var jsforce=require(_0x59b2('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x59b2('0x7'));var querystring=require(_0x59b2('0xc'));var Papa=require(_0x59b2('0xd'));var Redis=require('ioredis');var authService=require(_0x59b2('0xe'));var qs=require(_0x59b2('0xf'));var hardwareService=require(_0x59b2('0x10'));var logger=require('../../config/logger')(_0x59b2('0x11'));var utils=require(_0x59b2('0x12'));var config=require(_0x59b2('0x13'));var db=require(_0x59b2('0x14'))['db'];function respondWithStatusCode(_0x83d20c,_0x2fb38a){_0x2fb38a=_0x2fb38a||0xcc;return function(_0x49e4e9){if(_0x49e4e9){return _0x83d20c[_0x59b2('0x15')](_0x2fb38a);}return _0x83d20c[_0x59b2('0x16')](_0x2fb38a)[_0x59b2('0x17')]();};}function respondWithResult(_0x1e2340,_0x574ee2){_0x574ee2=_0x574ee2||0xc8;return function(_0x7d238b){if(_0x7d238b){return _0x1e2340['status'](_0x574ee2)['json'](_0x7d238b);}};}function respondWithFilteredResult(_0x2d3d1b,_0x388906){return function(_0x114fb9){if(_0x114fb9){var _0x37c28c=_0x114fb9[_0x59b2('0x18')],_0x6d5d9=_0x388906['offset'],_0x33c977=_0x388906[_0x59b2('0x19')]+_0x388906[_0x59b2('0x1a')],_0x3c1d36;if(_0x33c977>=_0x37c28c){_0x33c977=_0x37c28c;_0x3c1d36=0xc8;}else{_0x3c1d36=0xce;}_0x2d3d1b[_0x59b2('0x16')](_0x3c1d36);return _0x2d3d1b[_0x59b2('0x1b')](_0x59b2('0x1c'),_0x6d5d9+'-'+_0x33c977+'/'+_0x37c28c)[_0x59b2('0x1d')](_0x114fb9);}return null;};}function patchUpdates(_0x25360e){return function(_0x2b3033){try{jsonpatch['apply'](_0x2b3033,_0x25360e,!![]);}catch(_0x5c2062){return BPromise['reject'](_0x5c2062);}return _0x2b3033[_0x59b2('0x1e')]();};}function saveUpdates(_0x4f3420,_0x2991d3){return function(_0x50644f){if(_0x50644f){return _0x50644f[_0x59b2('0x1f')](_0x4f3420)[_0x59b2('0x20')](function(_0xb969c2){return _0xb969c2;});}return null;};}function removeEntity(_0x813b71,_0x5abffb){return function(_0x537f20){if(_0x537f20){return _0x537f20[_0x59b2('0x21')]()[_0x59b2('0x20')](function(){_0x813b71[_0x59b2('0x16')](0xcc)[_0x59b2('0x17')]();});}};}function handleEntityNotFound(_0x1d074b,_0x17ff70){return function(_0x29e768){if(!_0x29e768){_0x1d074b[_0x59b2('0x15')](0x194);}return _0x29e768;};}function handleError(_0x598121,_0x36d54b){_0x36d54b=_0x36d54b||0x1f4;return function(_0x5a968d){logger['error'](_0x5a968d[_0x59b2('0x22')]);if(_0x5a968d[_0x59b2('0x23')]){delete _0x5a968d[_0x59b2('0x23')];}_0x598121[_0x59b2('0x16')](_0x36d54b)['send'](_0x5a968d);};}exports[_0x59b2('0x24')]=function(_0x50c153,_0x9ace46){var _0x332e3d={},_0x562073={},_0x2c22ee={'count':0x0,'rows':[]};var _0x105cbd=db['CmHopperFinal'][_0x59b2('0x25')];_0x562073[_0x59b2('0x26')]=_[_0x59b2('0x27')](_0x105cbd);_0x562073[_0x59b2('0x28')]=_[_0x59b2('0x27')](_0x50c153[_0x59b2('0x28')]);_0x562073['filters']=_['intersection'](_0x562073[_0x59b2('0x26')],_0x562073[_0x59b2('0x28')]);_0x332e3d['attributes']=_[_0x59b2('0x29')](_0x562073[_0x59b2('0x26')],qs[_0x59b2('0x2a')](_0x50c153[_0x59b2('0x28')]['fields']));_0x332e3d[_0x59b2('0x2b')]=_0x332e3d[_0x59b2('0x2b')][_0x59b2('0x2c')]?_0x332e3d[_0x59b2('0x2b')]:_0x562073[_0x59b2('0x26')];if(!_0x50c153[_0x59b2('0x28')][_0x59b2('0x2d')](_0x59b2('0x2e'))){_0x332e3d[_0x59b2('0x1a')]=qs['limit'](_0x50c153[_0x59b2('0x28')][_0x59b2('0x1a')]);_0x332e3d[_0x59b2('0x19')]=qs[_0x59b2('0x19')](_0x50c153[_0x59b2('0x28')][_0x59b2('0x19')]);}_0x332e3d[_0x59b2('0x2f')]=qs[_0x59b2('0x30')](_0x50c153[_0x59b2('0x28')]['sort']);_0x332e3d[_0x59b2('0x31')]=qs[_0x59b2('0x32')](_['pick'](_0x50c153[_0x59b2('0x28')],_0x562073[_0x59b2('0x32')]));if(_0x50c153[_0x59b2('0x28')][_0x59b2('0x33')]){_0x332e3d[_0x59b2('0x31')]=_['merge'](_0x332e3d[_0x59b2('0x31')],{'$or':_[_0x59b2('0x34')](_0x105cbd,function(_0x5cc713){if(_0x5cc713[_0x59b2('0x35')][_0x59b2('0x36')]!==_0x59b2('0x37')){var _0x42f8d5={};_0x42f8d5[_0x5cc713[_0x59b2('0x38')]]={'$like':'%'+_0x50c153['query'][_0x59b2('0x33')]+'%'};return _0x42f8d5;}})});}_0x332e3d=_['merge']({},_0x332e3d,_0x50c153[_0x59b2('0x39')]);var _0x2b8800={'where':_0x332e3d[_0x59b2('0x31')]};return db[_0x59b2('0x3a')]['count'](_0x2b8800)['then'](function(_0x30fb51){_0x2c22ee['count']=_0x30fb51;if(_0x50c153[_0x59b2('0x28')][_0x59b2('0x3b')]){_0x332e3d[_0x59b2('0x3c')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x59b2('0x3d')](_0x332e3d);})[_0x59b2('0x20')](function(_0x329260){_0x2c22ee[_0x59b2('0x3e')]=_0x329260;return _0x2c22ee;})[_0x59b2('0x20')](respondWithFilteredResult(_0x9ace46,_0x332e3d))[_0x59b2('0x3f')](handleError(_0x9ace46,null));};exports[_0x59b2('0x40')]=function(_0x510929,_0x486139){var _0x587990={'raw':!![],'where':{'id':_0x510929[_0x59b2('0x41')]['id']}},_0x54915c={};_0x54915c[_0x59b2('0x26')]=_[_0x59b2('0x27')](db['CmHopperFinal'][_0x59b2('0x25')]);_0x54915c[_0x59b2('0x28')]=_[_0x59b2('0x27')](_0x510929[_0x59b2('0x28')]);_0x54915c[_0x59b2('0x32')]=_['intersection'](_0x54915c[_0x59b2('0x26')],_0x54915c['query']);_0x587990[_0x59b2('0x2b')]=_[_0x59b2('0x29')](_0x54915c['model'],qs[_0x59b2('0x2a')](_0x510929[_0x59b2('0x28')]['fields']));_0x587990[_0x59b2('0x2b')]=_0x587990[_0x59b2('0x2b')]['length']?_0x587990[_0x59b2('0x2b')]:_0x54915c[_0x59b2('0x26')];if(_0x510929[_0x59b2('0x28')]['includeAll']){_0x587990[_0x59b2('0x3c')]=[{'all':!![]}];}_0x587990=_[_0x59b2('0x42')]({},_0x587990,_0x510929['options']);return db['CmHopperFinal'][_0x59b2('0x43')](_0x587990)[_0x59b2('0x20')](handleEntityNotFound(_0x486139,null))[_0x59b2('0x20')](respondWithResult(_0x486139,null))[_0x59b2('0x3f')](handleError(_0x486139,null));};exports['describe']=function(_0x45850c,_0x27fda7){return db[_0x59b2('0x3a')][_0x59b2('0x44')]()[_0x59b2('0x20')](respondWithResult(_0x27fda7,null))[_0x59b2('0x3f')](handleError(_0x27fda7,null));};exports['update']=function(_0x5ee71f,_0x4ed9af){if(_0x5ee71f['body']['uniqueid']){delete _0x5ee71f[_0x59b2('0x45')][_0x59b2('0x46')];}return db[_0x59b2('0x3a')][_0x59b2('0x43')]({'where':{'uniqueid':_0x5ee71f[_0x59b2('0x41')]['id']}})['then'](handleEntityNotFound(_0x4ed9af,null))[_0x59b2('0x20')](saveUpdates(_0x5ee71f[_0x59b2('0x45')],null))['then'](respondWithResult(_0x4ed9af,null))[_0x59b2('0x3f')](handleError(_0x4ed9af,null));};exports[_0x59b2('0x47')]=function(_0x51bf28,_0x5b7902,_0x2cb1f1){return db[_0x59b2('0x3a')][_0x59b2('0x3d')]({'raw':![],'where':{'VoiceQueueId':_0x51bf28[_0x59b2('0x41')]['id']},'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x59b2('0x48')]['literal']('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db['sequelize']['fn'](_0x59b2('0x49'),db['sequelize']['fn']('IF',db[_0x59b2('0x48')][_0x59b2('0x4a')](_0x59b2('0x4b')))),'noAnswerContacts'],[db[_0x59b2('0x48')]['fn']('COUNT',db[_0x59b2('0x48')]['fn']('IF',db[_0x59b2('0x48')][_0x59b2('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0x59b2('0x48')]['fn'](_0x59b2('0x49'),db[_0x59b2('0x48')]['fn']('IF',db[_0x59b2('0x48')][_0x59b2('0x4a')](_0x59b2('0x4c')))),_0x59b2('0x4d')],[db[_0x59b2('0x48')]['fn'](_0x59b2('0x49'),db[_0x59b2('0x48')]['fn']('IF',db[_0x59b2('0x48')][_0x59b2('0x4a')](_0x59b2('0x4e')))),'dropContacts'],[db[_0x59b2('0x48')]['fn'](_0x59b2('0x49'),db[_0x59b2('0x48')]['fn']('IF',db[_0x59b2('0x48')][_0x59b2('0x4a')](_0x59b2('0x4f')))),_0x59b2('0x50')],[db[_0x59b2('0x48')]['fn']('COUNT',db[_0x59b2('0x48')]['fn']('IF',db[_0x59b2('0x48')][_0x59b2('0x4a')](_0x59b2('0x51')))),_0x59b2('0x52')],[db[_0x59b2('0x48')]['fn'](_0x59b2('0x49'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x59b2('0x53')))),_0x59b2('0x54')]]})[_0x59b2('0x20')](handleEntityNotFound(_0x5b7902,null))[_0x59b2('0x20')](respondWithResult(_0x5b7902,null))['catch'](handleError(_0x5b7902,null));};exports[_0x59b2('0x55')]=function(_0x49a16c,_0x3804ee,_0x5482c0){return db['CmHopperFinal'][_0x59b2('0x3d')]({'raw':![],'where':{'CampaignId':_0x49a16c[_0x59b2('0x41')]['id']},'attributes':[[db[_0x59b2('0x48')]['fn'](_0x59b2('0x49'),db[_0x59b2('0x48')]['fn']('IF',db[_0x59b2('0x48')][_0x59b2('0x4a')]('`state`\x20=\x200,\x201,\x20null'))),_0x59b2('0x56')],[db[_0x59b2('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x59b2('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0x59b2('0x57')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x59b2('0x48')][_0x59b2('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0x59b2('0x58')],[db['sequelize']['fn'](_0x59b2('0x49'),db[_0x59b2('0x48')]['fn']('IF',db[_0x59b2('0x48')][_0x59b2('0x4a')](_0x59b2('0x4c')))),_0x59b2('0x4d')],[db[_0x59b2('0x48')]['fn'](_0x59b2('0x49'),db[_0x59b2('0x48')]['fn']('IF',db[_0x59b2('0x48')]['literal'](_0x59b2('0x4e')))),_0x59b2('0x59')],[db[_0x59b2('0x48')]['fn'](_0x59b2('0x49'),db[_0x59b2('0x48')]['fn']('IF',db[_0x59b2('0x48')][_0x59b2('0x4a')](_0x59b2('0x4f')))),_0x59b2('0x50')],[db[_0x59b2('0x48')]['fn']('COUNT',db[_0x59b2('0x48')]['fn']('IF',db['sequelize']['literal'](_0x59b2('0x51')))),_0x59b2('0x52')],[db[_0x59b2('0x48')]['fn'](_0x59b2('0x49'),db[_0x59b2('0x48')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0x59b2('0x54')]]})['then'](handleEntityNotFound(_0x3804ee,null))['then'](respondWithResult(_0x3804ee,null))[_0x59b2('0x3f')](handleError(_0x3804ee,null));};exports[_0x59b2('0x5a')]=function(_0x26a71d,_0x5eebee,_0xee50a){return db['VoiceQueue'][_0x59b2('0x43')]({'where':{'id':_0x26a71d[_0x59b2('0x41')]['id']}})[_0x59b2('0x20')](handleEntityNotFound(_0x5eebee,null))[_0x59b2('0x20')](function(_0x28fc2a){var _0x4bef45;if(_0x28fc2a){_0x4bef45=squel[_0x59b2('0x5b')]()[_0x59b2('0x5c')](_0x59b2('0x5d'))[_0x59b2('0x5e')]([_0x59b2('0x5f'),_0x59b2('0x60'),_0x59b2('0x61'),'ListId',_0x59b2('0x62'),_0x59b2('0x63'),_0x59b2('0x64')],squel[_0x59b2('0x65')]()[_0x59b2('0x38')](_0x59b2('0x66'),'phone')[_0x59b2('0x38')](_0x59b2('0x67'),_0x59b2('0x60'))[_0x59b2('0x38')]('ANY_VALUE(ContactId)',_0x59b2('0x61'))[_0x59b2('0x38')](_0x59b2('0x68'),_0x59b2('0x69'))[_0x59b2('0x38')]('ANY_VALUE(VoiceQueueId)',_0x59b2('0x62'))[_0x59b2('0x38')](_0x59b2('0x67'),_0x59b2('0x63'))[_0x59b2('0x38')](_0x59b2('0x67'),_0x59b2('0x64'))[_0x59b2('0x6a')](_0x59b2('0x6b'))[_0x59b2('0x31')]('VoiceQueueId\x20=\x20?',_0x26a71d[_0x59b2('0x41')]['id'][_0x59b2('0x6c')]())[_0x59b2('0x31')]('state\x20=\x20?',_0x26a71d[_0x59b2('0x45')][_0x59b2('0x6d')][_0x59b2('0x6c')]())[_0x59b2('0x31')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x59b2('0x31')](_0x59b2('0x6e'),squel['select']()[_0x59b2('0x38')]('phone')[_0x59b2('0x6a')](_0x59b2('0x5d'))[_0x59b2('0x31')](_0x59b2('0x6f'),_0x26a71d['params']['id'][_0x59b2('0x6c')]()))[_0x59b2('0x31')](_0x59b2('0x6e'),squel['select']()[_0x59b2('0x38')](_0x59b2('0x70'))[_0x59b2('0x6a')](_0x59b2('0x6b'))['where']('VoiceQueueId\x20=\x20?',_0x26a71d['params']['id'][_0x59b2('0x6c')]())[_0x59b2('0x31')](_0x59b2('0x71')))['group'](_0x59b2('0x61')))[_0x59b2('0x6c')]();return db[_0x59b2('0x48')][_0x59b2('0x28')](_0x4bef45);}return[];})['then'](respondWithResult(_0x5eebee,null))[_0x59b2('0x3f')](handleError(_0x5eebee,null));};exports[_0x59b2('0x72')]=function(_0xcc54a5,_0x141d4f,_0x5734d6){return db[_0x59b2('0x73')][_0x59b2('0x43')]({'where':{'id':_0xcc54a5[_0x59b2('0x41')]['id']}})[_0x59b2('0x20')](handleEntityNotFound(_0x141d4f,null))[_0x59b2('0x20')](function(_0x418eb8){var _0x270425;if(_0x418eb8){_0x270425=squel[_0x59b2('0x5b')]()[_0x59b2('0x5c')](_0x59b2('0x5d'))[_0x59b2('0x5e')]([_0x59b2('0x5f'),_0x59b2('0x60'),'ContactId','ListId','CampaignId',_0x59b2('0x63'),_0x59b2('0x64')],squel[_0x59b2('0x65')]()[_0x59b2('0x38')](_0x59b2('0x66'),_0x59b2('0x5f'))[_0x59b2('0x38')](_0x59b2('0x67'),_0x59b2('0x60'))['field'](_0x59b2('0x74'),_0x59b2('0x61'))[_0x59b2('0x38')](_0x59b2('0x68'),'ListId')[_0x59b2('0x38')](_0x59b2('0x75'),'CampaignId')[_0x59b2('0x38')]('NOW()',_0x59b2('0x63'))['field'](_0x59b2('0x67'),_0x59b2('0x64'))[_0x59b2('0x6a')](_0x59b2('0x6b'))['where'](_0x59b2('0x76'),_0xcc54a5[_0x59b2('0x41')]['id']['toString']())[_0x59b2('0x31')]('state\x20=\x20?',_0xcc54a5[_0x59b2('0x45')]['state']['toString']())[_0x59b2('0x31')]('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x59b2('0x65')]()[_0x59b2('0x38')]('phone')[_0x59b2('0x6a')](_0x59b2('0x5d'))[_0x59b2('0x31')](_0x59b2('0x76'),_0xcc54a5['params']['id'][_0x59b2('0x6c')]()))[_0x59b2('0x31')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x59b2('0x65')]()[_0x59b2('0x38')]('calleridnum')['from'](_0x59b2('0x6b'))[_0x59b2('0x31')](_0x59b2('0x76'),_0xcc54a5[_0x59b2('0x41')]['id'][_0x59b2('0x6c')]())[_0x59b2('0x31')]('state\x20=\x204'))[_0x59b2('0x77')](_0x59b2('0x61')))[_0x59b2('0x6c')]();return db[_0x59b2('0x48')][_0x59b2('0x28')](_0x270425);}return[];})[_0x59b2('0x20')](respondWithResult(_0x141d4f,null))[_0x59b2('0x3f')](handleError(_0x141d4f,null));};exports['checkContactHopper']=function(_0x23f532,_0x201e71,_0x478def){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x23f532[_0x59b2('0x45')][_0x59b2('0x62')],'CampaignId':_0x23f532['body'][_0x59b2('0x78')],'ContactId':_0x23f532['body']['ContactId']}})['then'](handleEntityNotFound(_0x201e71,null))[_0x59b2('0x20')](function(_0x5a9a55){if(_0x5a9a55){return _0x5a9a55;}return null;})[_0x59b2('0x20')](respondWithResult(_0x201e71,null))[_0x59b2('0x3f')](handleError(_0x201e71,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index f44c018..c185de8 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 _0xc507=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid'];(function(_0x31b5a5,_0x44376a){var _0x364cc9=function(_0x4e5f95){while(--_0x4e5f95){_0x31b5a5['push'](_0x31b5a5['shift']());}};_0x364cc9(++_0x44376a);}(_0xc507,0xc0));var _0x7c50=function(_0x3a4f18,_0x1af741){_0x3a4f18=_0x3a4f18-0x0;var _0x4c20fc=_0xc507[_0x3a4f18];return _0x4c20fc;};'use strict';var _=require(_0x7c50('0x0'));var util=require(_0x7c50('0x1'));var logger=require(_0x7c50('0x2'))(_0x7c50('0x3'));var moment=require(_0x7c50('0x4'));var BPromise=require(_0x7c50('0x5'));var rp=require(_0x7c50('0x6'));var fs=require('fs');var path=require(_0x7c50('0x7'));var rimraf=require(_0x7c50('0x8'));var config=require(_0x7c50('0x9'));var attributes=require(_0x7c50('0xa'));module['exports']=function(_0xd5e9ce,_0x47dca7){return _0xd5e9ce[_0x7c50('0xb')](_0x7c50('0xc'),attributes,{'tableName':_0x7c50('0xd'),'paranoid':![],'indexes':[{'name':_0x7c50('0xe'),'fields':[_0x7c50('0xe')]},{'name':_0x7c50('0xf'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbd1f=['define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports'];(function(_0x3d0366,_0x50211a){var _0x5ce75e=function(_0xc70777){while(--_0xc70777){_0x3d0366['push'](_0x3d0366['shift']());}};_0x5ce75e(++_0x50211a);}(_0xbd1f,0x145));var _0xfbd1=function(_0x5a6ef9,_0x1c56d3){_0x5a6ef9=_0x5a6ef9-0x0;var _0x133ba2=_0xbd1f[_0x5a6ef9];return _0x133ba2;};'use strict';var _=require(_0xfbd1('0x0'));var util=require(_0xfbd1('0x1'));var logger=require(_0xfbd1('0x2'))(_0xfbd1('0x3'));var moment=require(_0xfbd1('0x4'));var BPromise=require(_0xfbd1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfbd1('0x6'));var rimraf=require(_0xfbd1('0x7'));var config=require(_0xfbd1('0x8'));var attributes=require(_0xfbd1('0x9'));module[_0xfbd1('0xa')]=function(_0x33ce33,_0x492785){return _0x33ce33[_0xfbd1('0xb')](_0xfbd1('0xc'),attributes,{'tableName':_0xfbd1('0xd'),'paranoid':![],'indexes':[{'name':_0xfbd1('0xe'),'fields':[_0xfbd1('0xe')]},{'name':_0xfbd1('0xf'),'fields':[_0xfbd1('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 87c1d93..40b97f0 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 _0xcea2=['../../config/logger','rpc','../../config/environment','client','request','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','CmHopperFinal','create','options','raw','then','CreateCmHopperFinal','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcea2,0x15a));var _0x2cea=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xcea2[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x2cea('0x0'));var util=require('util');var moment=require(_0x2cea('0x1'));var BPromise=require('bluebird');var rs=require(_0x2cea('0x2'));var fs=require('fs');var Redis=require(_0x2cea('0x3'));var db=require(_0x2cea('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2cea('0x5'))(_0x2cea('0x6'));var config=require(_0x2cea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2cea('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d69ff,_0xc04963,_0x805a1b){return new BPromise(function(_0x160cca,_0x11c5c0){return client[_0x2cea('0x9')](_0x2d69ff,_0x805a1b)['then'](function(_0x1f4d90){logger[_0x2cea('0xa')](_0x2cea('0xb'),_0xc04963,_0x2cea('0xc'));logger[_0x2cea('0xd')](_0x2cea('0xe'),_0xc04963,_0x2cea('0xc'),JSON[_0x2cea('0xf')](_0x1f4d90));if(_0x1f4d90['error']){if(_0x1f4d90['error'][_0x2cea('0x10')]===0x1f4){logger[_0x2cea('0x11')]('CmHopperFinal,\x20%s,\x20%s',_0xc04963,_0x1f4d90['error'][_0x2cea('0x12')]);return _0x11c5c0(_0x1f4d90['error'][_0x2cea('0x12')]);}logger[_0x2cea('0x11')](_0x2cea('0xb'),_0xc04963,_0x1f4d90['error']['message']);return _0x160cca(_0x1f4d90['error'][_0x2cea('0x12')]);}else{logger['info'](_0x2cea('0xb'),_0xc04963,_0x2cea('0xc'));_0x160cca(_0x1f4d90[_0x2cea('0x13')][_0x2cea('0x12')]);}})[_0x2cea('0x14')](function(_0x1bbfdb){logger[_0x2cea('0x11')](_0x2cea('0xb'),_0xc04963,_0x1bbfdb);_0x11c5c0(_0x1bbfdb);});});}exports['CreateCmHopperFinal']=function(_0x19927a){var _0x464f7d=this;return new Promise(function(_0x20c46c,_0x43ae15){return db[_0x2cea('0x15')][_0x2cea('0x16')](_0x19927a['body'],{'raw':_0x19927a[_0x2cea('0x17')]?_0x19927a['options'][_0x2cea('0x18')]===undefined?!![]:![]:!![]})[_0x2cea('0x19')](function(_0xa73bea){logger['info'](_0x2cea('0x1a'),_0x19927a);logger[_0x2cea('0xd')](_0x2cea('0x1a'),_0x19927a,JSON[_0x2cea('0xf')](_0xa73bea));_0x20c46c(_0xa73bea);})[_0x2cea('0x14')](function(_0x3f6f0e){logger[_0x2cea('0x11')]('CreateCmHopperFinal',_0x3f6f0e[_0x2cea('0x12')],_0x19927a);_0x43ae15(_0x464f7d['error'](0x1f4,_0x3f6f0e[_0x2cea('0x12')]));});});}; \ No newline at end of file +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(_0x2ccdf0,_0x5ffb50){var _0x87e808=function(_0x323d06){while(--_0x323d06){_0x2ccdf0['push'](_0x2ccdf0['shift']());}};_0x87e808(++_0x5ffb50);}(_0xb688,0xcf));var _0x8b68=function(_0x23e9fd,_0x5b6638){_0x23e9fd=_0x23e9fd-0x0;var _0x4ceca7=_0xb688[_0x23e9fd];return _0x4ceca7;};'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 diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 53ecf4a..6ab93cf 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 _0x3e74=['isAuthenticated','index','describe','/:id','countContactsQueueCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','update','exports','multer','path','connect-timeout','express','../../components/interaction/service','./cmHopperFinal.controller','get'];(function(_0x211bc3,_0x5860c8){var _0x34c9a2=function(_0x4bfa37){while(--_0x4bfa37){_0x211bc3['push'](_0x211bc3['shift']());}};_0x34c9a2(++_0x5860c8);}(_0x3e74,0x175));var _0x43e7=function(_0x354541,_0x3fd49a){_0x354541=_0x354541-0x0;var _0x574b28=_0x3e74[_0x354541];return _0x574b28;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/describe',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['show']);router[_0x43e7('0x6')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0x43e7('0xb')]);router[_0x43e7('0x6')]('/campaign/countAttributes/:id',auth[_0x43e7('0x7')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x43e7('0xc')](_0x43e7('0xd'),auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xc')](_0x43e7('0xf'),auth[_0x43e7('0x7')](),controller['moveContactsIvrCampaignHopperFinal']);router['post'](_0x43e7('0x10'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x11')]);router['put']('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x12')]);module[_0x43e7('0x13')]=router; \ No newline at end of file +var _0x3e74=['isAuthenticated','index','describe','/:id','countContactsQueueCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','update','exports','multer','path','connect-timeout','express','../../components/interaction/service','./cmHopperFinal.controller','get'];(function(_0x2f6f50,_0x1d21a7){var _0x2cf365=function(_0x1c40a7){while(--_0x1c40a7){_0x2f6f50['push'](_0x2f6f50['shift']());}};_0x2cf365(++_0x1d21a7);}(_0x3e74,0x175));var _0x43e7=function(_0x1f17d6,_0xad6195){_0x1f17d6=_0x1f17d6-0x0;var _0x6584c9=_0x3e74[_0x1f17d6];return _0x6584c9;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/describe',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['show']);router[_0x43e7('0x6')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0x43e7('0xb')]);router[_0x43e7('0x6')]('/campaign/countAttributes/:id',auth[_0x43e7('0x7')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x43e7('0xc')](_0x43e7('0xd'),auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xc')](_0x43e7('0xf'),auth[_0x43e7('0x7')](),controller['moveContactsIvrCampaignHopperFinal']);router['post'](_0x43e7('0x10'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x11')]);router['put']('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x12')]);module[_0x43e7('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index b6862bd..8217bab 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 _0xc474=['sequelize','exports','INTEGER','DATE','STRING','BOOLEAN'];(function(_0x2e14bf,_0x3af516){var _0x1f7d7b=function(_0x1a8a6e){while(--_0x1a8a6e){_0x2e14bf['push'](_0x2e14bf['shift']());}};_0x1f7d7b(++_0x3af516);}(_0xc474,0xfc));var _0x4c47=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc474[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x4c47('0x0'));module[_0x4c47('0x1')]={'state':{'type':Sequelize[_0x4c47('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x4c47('0x3')]},'countbusyretry':{'type':Sequelize[_0x4c47('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4c47('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4c47('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x4c47('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x4c47('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x4c47('0x4')]},'originatecalleridname':{'type':Sequelize[_0x4c47('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x4c47('0x3')]},'responsetime':{'type':Sequelize[_0x4c47('0x3')]},'answertime':{'type':Sequelize[_0x4c47('0x3')]},'droptime':{'type':Sequelize[_0x4c47('0x3')]},'endtime':{'type':Sequelize[_0x4c47('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4c47('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x4c47('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x4c47('0x4')]},'campaign':{'type':Sequelize[_0x4c47('0x4')]},'campaigntype':{'type':Sequelize[_0x4c47('0x4')]},'membername':{'type':Sequelize[_0x4c47('0x4')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x4c47('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x4c47('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4c47('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4c47('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x4c47('0x3')]},'edited':{'type':Sequelize[_0x4c47('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0xd9ef=['exports','STRING','INTEGER','DATE','BOOLEAN','sequelize'];(function(_0xbf6f32,_0x3d793a){var _0x1d3ecc=function(_0x2f236e){while(--_0x2f236e){_0xbf6f32['push'](_0xbf6f32['shift']());}};_0x1d3ecc(++_0x3d793a);}(_0xd9ef,0x95));var _0xfd9e=function(_0x1e386f,_0xc43470){_0x1e386f=_0x1e386f-0x0;var _0x44bda8=_0xd9ef[_0x1e386f];return _0x44bda8;};'use strict';var Sequelize=require(_0xfd9e('0x0'));module[_0xfd9e('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xfd9e('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xfd9e('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xfd9e('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xfd9e('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xfd9e('0x2')]},'originatecalleridname':{'type':Sequelize[_0xfd9e('0x2')]},'calleridnum':{'type':Sequelize[_0xfd9e('0x2')]},'calleridname':{'type':Sequelize[_0xfd9e('0x2')]},'starttime':{'type':Sequelize[_0xfd9e('0x4')]},'responsetime':{'type':Sequelize[_0xfd9e('0x4')]},'answertime':{'type':Sequelize[_0xfd9e('0x4')]},'droptime':{'type':Sequelize[_0xfd9e('0x4')]},'endtime':{'type':Sequelize[_0xfd9e('0x4')]},'ringtime':{'type':Sequelize[_0xfd9e('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xfd9e('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xfd9e('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xfd9e('0x2')]},'campaigntype':{'type':Sequelize[_0xfd9e('0x2')]},'membername':{'type':Sequelize[_0xfd9e('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xfd9e('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xfd9e('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xfd9e('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xfd9e('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xfd9e('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xfd9e('0x4')]},'edited':{'type':Sequelize[_0xfd9e('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 76d0a69..de78a30 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 _0xc4aa=['order','sort','where','merge','map','type','key','field','options','findAll','rows','catch','show','params','includeAll','find','create','describe','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','CmHopperHistory','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit'];(function(_0x2ad361,_0xb28126){var _0x318693=function(_0x51105f){while(--_0x51105f){_0x2ad361['push'](_0x2ad361['shift']());}};_0x318693(++_0xb28126);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc4aa[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x9'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var hardwareService=require(_0xac4a('0x12'));var logger=require('../../config/logger')(_0xac4a('0x13'));var utils=require('../../config/utils');var config=require(_0xac4a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x333ca5,_0x2a0776){_0x2a0776=_0x2a0776||0xcc;return function(_0x24291d){if(_0x24291d){return _0x333ca5['sendStatus'](_0x2a0776);}return _0x333ca5[_0xac4a('0x15')](_0x2a0776)[_0xac4a('0x16')]();};}function respondWithResult(_0x247b78,_0x6e00d4){_0x6e00d4=_0x6e00d4||0xc8;return function(_0x1b4313){if(_0x1b4313){return _0x247b78[_0xac4a('0x15')](_0x6e00d4)[_0xac4a('0x17')](_0x1b4313);}};}function respondWithFilteredResult(_0x33c287,_0x190418){return function(_0x42c7fc){if(_0x42c7fc){var _0x11e101=_0x42c7fc[_0xac4a('0x18')],_0x26dbb8=_0x190418[_0xac4a('0x19')],_0x4a2119=_0x190418[_0xac4a('0x19')]+_0x190418[_0xac4a('0x1a')],_0x402fff;if(_0x4a2119>=_0x11e101){_0x4a2119=_0x11e101;_0x402fff=0xc8;}else{_0x402fff=0xce;}_0x33c287[_0xac4a('0x15')](_0x402fff);return _0x33c287[_0xac4a('0x1b')](_0xac4a('0x1c'),_0x26dbb8+'-'+_0x4a2119+'/'+_0x11e101)['json'](_0x42c7fc);}return null;};}function patchUpdates(_0x5ac21e){return function(_0x21a729){try{jsonpatch[_0xac4a('0x1d')](_0x21a729,_0x5ac21e,!![]);}catch(_0x39b691){return BPromise['reject'](_0x39b691);}return _0x21a729[_0xac4a('0x1e')]();};}function saveUpdates(_0x15c223,_0x3752e4){return function(_0x3a3cdb){if(_0x3a3cdb){return _0x3a3cdb[_0xac4a('0x1f')](_0x15c223)[_0xac4a('0x20')](function(_0xe38996){return _0xe38996;});}return null;};}function removeEntity(_0x3ca790,_0x534092){return function(_0x3d8f0a){if(_0x3d8f0a){return _0x3d8f0a[_0xac4a('0x21')]()['then'](function(){_0x3ca790[_0xac4a('0x15')](0xcc)[_0xac4a('0x16')]();});}};}function handleEntityNotFound(_0x3eacd3,_0x947d8e){return function(_0x4d2d6c){if(!_0x4d2d6c){_0x3eacd3[_0xac4a('0x22')](0x194);}return _0x4d2d6c;};}function handleError(_0x2503d8,_0x15435c){_0x15435c=_0x15435c||0x1f4;return function(_0x412494){logger[_0xac4a('0x23')](_0x412494[_0xac4a('0x24')]);if(_0x412494[_0xac4a('0x25')]){delete _0x412494[_0xac4a('0x25')];}_0x2503d8[_0xac4a('0x15')](_0x15435c)[_0xac4a('0x26')](_0x412494);};}exports[_0xac4a('0x27')]=function(_0x215a31,_0x14832b){var _0x472c57={},_0x1c13dc={},_0x20202c={'count':0x0,'rows':[]};var _0x4e17ce=db[_0xac4a('0x28')][_0xac4a('0x29')];_0x1c13dc[_0xac4a('0x2a')]=_[_0xac4a('0x2b')](_0x4e17ce);_0x1c13dc[_0xac4a('0x2c')]=_['keys'](_0x215a31['query']);_0x1c13dc[_0xac4a('0x2d')]=_[_0xac4a('0x2e')](_0x1c13dc[_0xac4a('0x2a')],_0x1c13dc['query']);_0x472c57['attributes']=_[_0xac4a('0x2e')](_0x1c13dc[_0xac4a('0x2a')],qs[_0xac4a('0x2f')](_0x215a31[_0xac4a('0x2c')][_0xac4a('0x2f')]));_0x472c57['attributes']=_0x472c57[_0xac4a('0x30')]['length']?_0x472c57[_0xac4a('0x30')]:_0x1c13dc['model'];if(!_0x215a31[_0xac4a('0x2c')][_0xac4a('0x31')](_0xac4a('0x32'))){_0x472c57[_0xac4a('0x1a')]=qs[_0xac4a('0x1a')](_0x215a31[_0xac4a('0x2c')][_0xac4a('0x1a')]);_0x472c57[_0xac4a('0x19')]=qs[_0xac4a('0x19')](_0x215a31[_0xac4a('0x2c')][_0xac4a('0x19')]);}_0x472c57[_0xac4a('0x33')]=qs[_0xac4a('0x34')](_0x215a31[_0xac4a('0x2c')]['sort']);_0x472c57[_0xac4a('0x35')]=qs[_0xac4a('0x2d')](_['pick'](_0x215a31[_0xac4a('0x2c')],_0x1c13dc[_0xac4a('0x2d')]));if(_0x215a31['query']['filter']){_0x472c57[_0xac4a('0x35')]=_[_0xac4a('0x36')](_0x472c57[_0xac4a('0x35')],{'$or':_[_0xac4a('0x37')](_0x4e17ce,function(_0x4f5986){if(_0x4f5986[_0xac4a('0x38')][_0xac4a('0x39')]!=='VIRTUAL'){var _0x37f2ee={};_0x37f2ee[_0x4f5986[_0xac4a('0x3a')]]={'$like':'%'+_0x215a31[_0xac4a('0x2c')]['filter']+'%'};return _0x37f2ee;}})});}_0x472c57=_[_0xac4a('0x36')]({},_0x472c57,_0x215a31[_0xac4a('0x3b')]);var _0x1b5427={'where':_0x472c57['where']};return db[_0xac4a('0x28')][_0xac4a('0x18')](_0x1b5427)['then'](function(_0x59bebf){_0x20202c[_0xac4a('0x18')]=_0x59bebf;if(_0x215a31['query']['includeAll']){_0x472c57['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xac4a('0x3c')](_0x472c57);})[_0xac4a('0x20')](function(_0x37834b){_0x20202c[_0xac4a('0x3d')]=_0x37834b;return _0x20202c;})[_0xac4a('0x20')](respondWithFilteredResult(_0x14832b,_0x472c57))[_0xac4a('0x3e')](handleError(_0x14832b,null));};exports[_0xac4a('0x3f')]=function(_0x2b16f0,_0x28292c){var _0x1f7721={'raw':!![],'where':{'id':_0x2b16f0[_0xac4a('0x40')]['id']}},_0x14f7d5={};_0x14f7d5['model']=_['keys'](db['CmHopperHistory'][_0xac4a('0x29')]);_0x14f7d5[_0xac4a('0x2c')]=_[_0xac4a('0x2b')](_0x2b16f0[_0xac4a('0x2c')]);_0x14f7d5[_0xac4a('0x2d')]=_[_0xac4a('0x2e')](_0x14f7d5[_0xac4a('0x2a')],_0x14f7d5[_0xac4a('0x2c')]);_0x1f7721[_0xac4a('0x30')]=_[_0xac4a('0x2e')](_0x14f7d5['model'],qs[_0xac4a('0x2f')](_0x2b16f0[_0xac4a('0x2c')][_0xac4a('0x2f')]));_0x1f7721[_0xac4a('0x30')]=_0x1f7721[_0xac4a('0x30')]['length']?_0x1f7721[_0xac4a('0x30')]:_0x14f7d5[_0xac4a('0x2a')];if(_0x2b16f0['query'][_0xac4a('0x41')]){_0x1f7721['include']=[{'all':!![]}];}_0x1f7721=_[_0xac4a('0x36')]({},_0x1f7721,_0x2b16f0[_0xac4a('0x3b')]);return db[_0xac4a('0x28')][_0xac4a('0x42')](_0x1f7721)[_0xac4a('0x20')](handleEntityNotFound(_0x28292c,null))[_0xac4a('0x20')](respondWithResult(_0x28292c,null))[_0xac4a('0x3e')](handleError(_0x28292c,null));};exports[_0xac4a('0x43')]=function(_0x98e0c4,_0xcb002b){return db[_0xac4a('0x28')][_0xac4a('0x43')](_0x98e0c4['body'],{})[_0xac4a('0x20')](respondWithResult(_0xcb002b,0xc9))[_0xac4a('0x3e')](handleError(_0xcb002b,null));};exports[_0xac4a('0x44')]=function(_0x58759a,_0x1764bf){return db[_0xac4a('0x28')]['describe']()[_0xac4a('0x20')](respondWithResult(_0x1764bf,null))['catch'](handleError(_0x1764bf,null));};exports[_0xac4a('0x1f')]=function(_0xe620f6,_0x136a65){if(_0xe620f6['body']['uniqueid']){delete _0xe620f6[_0xac4a('0x45')]['uniqueid'];}return db[_0xac4a('0x28')]['find']({'where':{'uniqueid':_0xe620f6[_0xac4a('0x40')]['id']}})['then'](handleEntityNotFound(_0x136a65,null))[_0xac4a('0x20')](saveUpdates(_0xe620f6[_0xac4a('0x45')],null))[_0xac4a('0x20')](respondWithResult(_0x136a65,null))[_0xac4a('0x3e')](handleError(_0x136a65,null));}; \ No newline at end of file +var _0xc4aa=['order','sort','where','merge','map','type','key','field','options','findAll','rows','catch','show','params','includeAll','find','create','describe','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','CmHopperHistory','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit'];(function(_0x184150,_0xbf93a7){var _0x25c714=function(_0x4ad062){while(--_0x4ad062){_0x184150['push'](_0x184150['shift']());}};_0x25c714(++_0xbf93a7);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xc4aa[_0x1caf6a];return _0x1bf493;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x9'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var hardwareService=require(_0xac4a('0x12'));var logger=require('../../config/logger')(_0xac4a('0x13'));var utils=require('../../config/utils');var config=require(_0xac4a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x333ca5,_0x2a0776){_0x2a0776=_0x2a0776||0xcc;return function(_0x24291d){if(_0x24291d){return _0x333ca5['sendStatus'](_0x2a0776);}return _0x333ca5[_0xac4a('0x15')](_0x2a0776)[_0xac4a('0x16')]();};}function respondWithResult(_0x247b78,_0x6e00d4){_0x6e00d4=_0x6e00d4||0xc8;return function(_0x1b4313){if(_0x1b4313){return _0x247b78[_0xac4a('0x15')](_0x6e00d4)[_0xac4a('0x17')](_0x1b4313);}};}function respondWithFilteredResult(_0x33c287,_0x190418){return function(_0x42c7fc){if(_0x42c7fc){var _0x11e101=_0x42c7fc[_0xac4a('0x18')],_0x26dbb8=_0x190418[_0xac4a('0x19')],_0x4a2119=_0x190418[_0xac4a('0x19')]+_0x190418[_0xac4a('0x1a')],_0x402fff;if(_0x4a2119>=_0x11e101){_0x4a2119=_0x11e101;_0x402fff=0xc8;}else{_0x402fff=0xce;}_0x33c287[_0xac4a('0x15')](_0x402fff);return _0x33c287[_0xac4a('0x1b')](_0xac4a('0x1c'),_0x26dbb8+'-'+_0x4a2119+'/'+_0x11e101)['json'](_0x42c7fc);}return null;};}function patchUpdates(_0x5ac21e){return function(_0x21a729){try{jsonpatch[_0xac4a('0x1d')](_0x21a729,_0x5ac21e,!![]);}catch(_0x39b691){return BPromise['reject'](_0x39b691);}return _0x21a729[_0xac4a('0x1e')]();};}function saveUpdates(_0x15c223,_0x3752e4){return function(_0x3a3cdb){if(_0x3a3cdb){return _0x3a3cdb[_0xac4a('0x1f')](_0x15c223)[_0xac4a('0x20')](function(_0xe38996){return _0xe38996;});}return null;};}function removeEntity(_0x3ca790,_0x534092){return function(_0x3d8f0a){if(_0x3d8f0a){return _0x3d8f0a[_0xac4a('0x21')]()['then'](function(){_0x3ca790[_0xac4a('0x15')](0xcc)[_0xac4a('0x16')]();});}};}function handleEntityNotFound(_0x3eacd3,_0x947d8e){return function(_0x4d2d6c){if(!_0x4d2d6c){_0x3eacd3[_0xac4a('0x22')](0x194);}return _0x4d2d6c;};}function handleError(_0x2503d8,_0x15435c){_0x15435c=_0x15435c||0x1f4;return function(_0x412494){logger[_0xac4a('0x23')](_0x412494[_0xac4a('0x24')]);if(_0x412494[_0xac4a('0x25')]){delete _0x412494[_0xac4a('0x25')];}_0x2503d8[_0xac4a('0x15')](_0x15435c)[_0xac4a('0x26')](_0x412494);};}exports[_0xac4a('0x27')]=function(_0x215a31,_0x14832b){var _0x472c57={},_0x1c13dc={},_0x20202c={'count':0x0,'rows':[]};var _0x4e17ce=db[_0xac4a('0x28')][_0xac4a('0x29')];_0x1c13dc[_0xac4a('0x2a')]=_[_0xac4a('0x2b')](_0x4e17ce);_0x1c13dc[_0xac4a('0x2c')]=_['keys'](_0x215a31['query']);_0x1c13dc[_0xac4a('0x2d')]=_[_0xac4a('0x2e')](_0x1c13dc[_0xac4a('0x2a')],_0x1c13dc['query']);_0x472c57['attributes']=_[_0xac4a('0x2e')](_0x1c13dc[_0xac4a('0x2a')],qs[_0xac4a('0x2f')](_0x215a31[_0xac4a('0x2c')][_0xac4a('0x2f')]));_0x472c57['attributes']=_0x472c57[_0xac4a('0x30')]['length']?_0x472c57[_0xac4a('0x30')]:_0x1c13dc['model'];if(!_0x215a31[_0xac4a('0x2c')][_0xac4a('0x31')](_0xac4a('0x32'))){_0x472c57[_0xac4a('0x1a')]=qs[_0xac4a('0x1a')](_0x215a31[_0xac4a('0x2c')][_0xac4a('0x1a')]);_0x472c57[_0xac4a('0x19')]=qs[_0xac4a('0x19')](_0x215a31[_0xac4a('0x2c')][_0xac4a('0x19')]);}_0x472c57[_0xac4a('0x33')]=qs[_0xac4a('0x34')](_0x215a31[_0xac4a('0x2c')]['sort']);_0x472c57[_0xac4a('0x35')]=qs[_0xac4a('0x2d')](_['pick'](_0x215a31[_0xac4a('0x2c')],_0x1c13dc[_0xac4a('0x2d')]));if(_0x215a31['query']['filter']){_0x472c57[_0xac4a('0x35')]=_[_0xac4a('0x36')](_0x472c57[_0xac4a('0x35')],{'$or':_[_0xac4a('0x37')](_0x4e17ce,function(_0x4f5986){if(_0x4f5986[_0xac4a('0x38')][_0xac4a('0x39')]!=='VIRTUAL'){var _0x37f2ee={};_0x37f2ee[_0x4f5986[_0xac4a('0x3a')]]={'$like':'%'+_0x215a31[_0xac4a('0x2c')]['filter']+'%'};return _0x37f2ee;}})});}_0x472c57=_[_0xac4a('0x36')]({},_0x472c57,_0x215a31[_0xac4a('0x3b')]);var _0x1b5427={'where':_0x472c57['where']};return db[_0xac4a('0x28')][_0xac4a('0x18')](_0x1b5427)['then'](function(_0x59bebf){_0x20202c[_0xac4a('0x18')]=_0x59bebf;if(_0x215a31['query']['includeAll']){_0x472c57['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xac4a('0x3c')](_0x472c57);})[_0xac4a('0x20')](function(_0x37834b){_0x20202c[_0xac4a('0x3d')]=_0x37834b;return _0x20202c;})[_0xac4a('0x20')](respondWithFilteredResult(_0x14832b,_0x472c57))[_0xac4a('0x3e')](handleError(_0x14832b,null));};exports[_0xac4a('0x3f')]=function(_0x2b16f0,_0x28292c){var _0x1f7721={'raw':!![],'where':{'id':_0x2b16f0[_0xac4a('0x40')]['id']}},_0x14f7d5={};_0x14f7d5['model']=_['keys'](db['CmHopperHistory'][_0xac4a('0x29')]);_0x14f7d5[_0xac4a('0x2c')]=_[_0xac4a('0x2b')](_0x2b16f0[_0xac4a('0x2c')]);_0x14f7d5[_0xac4a('0x2d')]=_[_0xac4a('0x2e')](_0x14f7d5[_0xac4a('0x2a')],_0x14f7d5[_0xac4a('0x2c')]);_0x1f7721[_0xac4a('0x30')]=_[_0xac4a('0x2e')](_0x14f7d5['model'],qs[_0xac4a('0x2f')](_0x2b16f0[_0xac4a('0x2c')][_0xac4a('0x2f')]));_0x1f7721[_0xac4a('0x30')]=_0x1f7721[_0xac4a('0x30')]['length']?_0x1f7721[_0xac4a('0x30')]:_0x14f7d5[_0xac4a('0x2a')];if(_0x2b16f0['query'][_0xac4a('0x41')]){_0x1f7721['include']=[{'all':!![]}];}_0x1f7721=_[_0xac4a('0x36')]({},_0x1f7721,_0x2b16f0[_0xac4a('0x3b')]);return db[_0xac4a('0x28')][_0xac4a('0x42')](_0x1f7721)[_0xac4a('0x20')](handleEntityNotFound(_0x28292c,null))[_0xac4a('0x20')](respondWithResult(_0x28292c,null))[_0xac4a('0x3e')](handleError(_0x28292c,null));};exports[_0xac4a('0x43')]=function(_0x98e0c4,_0xcb002b){return db[_0xac4a('0x28')][_0xac4a('0x43')](_0x98e0c4['body'],{})[_0xac4a('0x20')](respondWithResult(_0xcb002b,0xc9))[_0xac4a('0x3e')](handleError(_0xcb002b,null));};exports[_0xac4a('0x44')]=function(_0x58759a,_0x1764bf){return db[_0xac4a('0x28')]['describe']()[_0xac4a('0x20')](respondWithResult(_0x1764bf,null))['catch'](handleError(_0x1764bf,null));};exports[_0xac4a('0x1f')]=function(_0xe620f6,_0x136a65){if(_0xe620f6['body']['uniqueid']){delete _0xe620f6[_0xac4a('0x45')]['uniqueid'];}return db[_0xac4a('0x28')]['find']({'where':{'uniqueid':_0xe620f6[_0xac4a('0x40')]['id']}})['then'](handleEntityNotFound(_0x136a65,null))[_0xac4a('0x20')](saveUpdates(_0xe620f6[_0xac4a('0x45')],null))[_0xac4a('0x20')](respondWithResult(_0x136a65,null))[_0xac4a('0x3e')](handleError(_0x136a65,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 6928ef0..fb38b14 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 _0x34e8=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid'];(function(_0x30dd5e,_0x514bc3){var _0x4c30f9=function(_0x43b76e){while(--_0x43b76e){_0x30dd5e['push'](_0x30dd5e['shift']());}};_0x4c30f9(++_0x514bc3);}(_0x34e8,0x12c));var _0x834e=function(_0x4467f7,_0x166e02){_0x4467f7=_0x4467f7-0x0;var _0x31d5f4=_0x34e8[_0x4467f7];return _0x31d5f4;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[{'name':_0x834e('0xd'),'fields':[_0x834e('0xd')]},{'name':_0x834e('0xe'),'fields':[_0x834e('0xe')]}],'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(_0x5c31d0,_0x49b16a){var _0x32ddbe=function(_0x4abfc3){while(--_0x4abfc3){_0x5c31d0['push'](_0x5c31d0['shift']());}};_0x32ddbe(++_0x49b16a);}(_0xe706,0xa3));var _0x6e70=function(_0x559434,_0x2f9870){_0x559434=_0x559434-0x0;var _0x252834=_0xe706[_0x559434];return _0x252834;};'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 aa5f537..10fa787 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 _0xbc23=['CmHopperHistory,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','CreateCmHopperHistory','CmHopperHistory','create','body','options','catch','AvgHandleTime','findAll','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request','then'];(function(_0x335394,_0x42527f){var _0x910edb=function(_0x368267){while(--_0x368267){_0x335394['push'](_0x335394['shift']());}};_0x910edb(++_0x42527f);}(_0xbc23,0x1bd));var _0x3bc2=function(_0x3cd681,_0x13b8fd){_0x3cd681=_0x3cd681-0x0;var _0x33abe7=_0xbc23[_0x3cd681];return _0x33abe7;};'use strict';var _=require(_0x3bc2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3bc2('0x1'));var rs=require(_0x3bc2('0x2'));var fs=require('fs');var Redis=require(_0x3bc2('0x3'));var db=require(_0x3bc2('0x4'))['db'];var utils=require(_0x3bc2('0x5'));var logger=require(_0x3bc2('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3bc2('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5addfc,_0x12e582,_0x3d80ae){return new BPromise(function(_0x96349e,_0x115135){return client[_0x3bc2('0x8')](_0x5addfc,_0x3d80ae)[_0x3bc2('0x9')](function(_0x319b5d){logger['info'](_0x3bc2('0xa'),_0x12e582,'request\x20sent');logger[_0x3bc2('0xb')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x12e582,_0x3bc2('0xc'),JSON[_0x3bc2('0xd')](_0x319b5d));if(_0x319b5d[_0x3bc2('0xe')]){if(_0x319b5d[_0x3bc2('0xe')]['code']===0x1f4){logger[_0x3bc2('0xe')](_0x3bc2('0xa'),_0x12e582,_0x319b5d[_0x3bc2('0xe')][_0x3bc2('0xf')]);return _0x115135(_0x319b5d['error'][_0x3bc2('0xf')]);}logger['error'](_0x3bc2('0xa'),_0x12e582,_0x319b5d[_0x3bc2('0xe')]['message']);return _0x96349e(_0x319b5d[_0x3bc2('0xe')][_0x3bc2('0xf')]);}else{logger[_0x3bc2('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x12e582,_0x3bc2('0xc'));_0x96349e(_0x319b5d['result'][_0x3bc2('0xf')]);}})['catch'](function(_0x12b3c6){logger[_0x3bc2('0xe')](_0x3bc2('0xa'),_0x12e582,_0x12b3c6);_0x115135(_0x12b3c6);});});}exports[_0x3bc2('0x11')]=function(_0x1f4253){var _0x52be7b=this;return new Promise(function(_0x5ecfe4,_0x3ba6d4){return db[_0x3bc2('0x12')][_0x3bc2('0x13')](_0x1f4253[_0x3bc2('0x14')],{'raw':_0x1f4253[_0x3bc2('0x15')]?_0x1f4253[_0x3bc2('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x3bc2('0x9')](function(_0x388cd3){logger['info']('CreateCmHopperHistory',_0x1f4253);logger[_0x3bc2('0xb')]('CreateCmHopperHistory',_0x1f4253,JSON['stringify'](_0x388cd3));_0x5ecfe4(_0x388cd3);})[_0x3bc2('0x16')](function(_0x580ee2){logger['error']('CreateCmHopperHistory',_0x580ee2['message'],_0x1f4253);_0x3ba6d4(_0x52be7b[_0x3bc2('0xe')](0x1f4,_0x580ee2[_0x3bc2('0xf')]));});});};exports[_0x3bc2('0x17')]=function(_0x1b00d0){var _0x7b8689=this;return new Promise(function(_0x1e605e,_0x591e45){return db[_0x3bc2('0x12')][_0x3bc2('0x18')]({'raw':_0x1b00d0[_0x3bc2('0x15')]?_0x1b00d0[_0x3bc2('0x15')][_0x3bc2('0x19')]===undefined?!![]:![]:!![],'where':_0x1b00d0[_0x3bc2('0x15')]?_0x1b00d0[_0x3bc2('0x15')][_0x3bc2('0x1a')]||null:null,'attributes':[[db[_0x3bc2('0x1b')]['fn'](_0x3bc2('0x1c'),db[_0x3bc2('0x1b')][_0x3bc2('0x1d')]('id')),_0x3bc2('0x1e')],[db[_0x3bc2('0x1b')]['fn']('COUNT',db[_0x3bc2('0x1b')]['fn']('IF',db[_0x3bc2('0x1b')][_0x3bc2('0x1f')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0x3bc2('0x1b')]['fn'](_0x3bc2('0x1c'),db['sequelize']['fn']('IF',db[_0x3bc2('0x1b')][_0x3bc2('0x1f')]('`state`\x20=\x2010,\x201,\x20null'))),_0x3bc2('0x20')],[db[_0x3bc2('0x1b')]['fn'](_0x3bc2('0x1c'),db[_0x3bc2('0x1b')]['fn']('IF',db[_0x3bc2('0x1b')][_0x3bc2('0x1f')](_0x3bc2('0x21')))),_0x3bc2('0x22')],[db[_0x3bc2('0x1b')]['fn']('AVG',db[_0x3bc2('0x1b')]['fn']('IF',db[_0x3bc2('0x1b')][_0x3bc2('0x1f')](_0x3bc2('0x23')))),_0x3bc2('0x24')],[db[_0x3bc2('0x1b')]['fn'](_0x3bc2('0x25'),db['sequelize']['fn']('IF',db[_0x3bc2('0x1b')]['literal'](_0x3bc2('0x26')))),_0x3bc2('0x27')]]})['then'](function(_0x857ee7){logger[_0x3bc2('0x10')]('AvgHandleTime',_0x1b00d0);logger['debug'](_0x3bc2('0x17'),_0x1b00d0,JSON[_0x3bc2('0xd')](_0x857ee7));_0x1e605e(_0x857ee7);})[_0x3bc2('0x16')](function(_0x53f3da){logger[_0x3bc2('0xe')](_0x3bc2('0x17'),_0x53f3da[_0x3bc2('0xf')],_0x1b00d0);_0x591e45(_0x7b8689['error'](0x1f4,_0x53f3da[_0x3bc2('0xf')]));});});};exports[_0x3bc2('0x28')]=function(_0x21523d){var _0x15f263=this;return new Promise(function(_0x30d772,_0x1c5523){return db[_0x3bc2('0x12')][_0x3bc2('0x18')]({'raw':_0x21523d[_0x3bc2('0x15')]?_0x21523d[_0x3bc2('0x15')][_0x3bc2('0x19')]===undefined?!![]:![]:!![],'where':_0x21523d[_0x3bc2('0x15')]?_0x21523d[_0x3bc2('0x15')][_0x3bc2('0x1a')]||null:null,'attributes':[[_0x3bc2('0x29'),_0x3bc2('0x2a')],[db['sequelize']['fn']('COUNT',db[_0x3bc2('0x1b')]['fn']('IF',db[_0x3bc2('0x1b')][_0x3bc2('0x1f')](_0x3bc2('0x2b')))),_0x3bc2('0x2c')],[db[_0x3bc2('0x1b')]['fn'](_0x3bc2('0x1c'),db[_0x3bc2('0x1b')]['fn']('IF',db[_0x3bc2('0x1b')]['literal'](_0x3bc2('0x2d')))),'outboundNoAnswerCallsDay'],[db[_0x3bc2('0x1b')]['fn'](_0x3bc2('0x1c'),db[_0x3bc2('0x1b')]['fn']('IF',db[_0x3bc2('0x1b')][_0x3bc2('0x1f')](_0x3bc2('0x2e')))),_0x3bc2('0x2f')],[db['sequelize']['fn'](_0x3bc2('0x1c'),db[_0x3bc2('0x1b')]['fn']('IF',db[_0x3bc2('0x1b')][_0x3bc2('0x1f')]('`state`\x20=\x205,\x201,\x20null'))),_0x3bc2('0x30')],[db[_0x3bc2('0x1b')]['fn'](_0x3bc2('0x1c'),db[_0x3bc2('0x1b')]['fn']('IF',db['sequelize'][_0x3bc2('0x1f')](_0x3bc2('0x31')))),_0x3bc2('0x32')],[db[_0x3bc2('0x1b')]['fn'](_0x3bc2('0x1c'),db[_0x3bc2('0x1b')]['fn']('IF',db['sequelize'][_0x3bc2('0x1f')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x3bc2('0x33')],[db[_0x3bc2('0x1b')]['fn'](_0x3bc2('0x1c'),db[_0x3bc2('0x1b')]['fn']('IF',db[_0x3bc2('0x1b')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0x3bc2('0x1b')]['fn'](_0x3bc2('0x1c'),db[_0x3bc2('0x1b')]['fn']('IF',db[_0x3bc2('0x1b')][_0x3bc2('0x1f')]('`state`\x20=\x2012,\x201,\x20null'))),_0x3bc2('0x34')],[db[_0x3bc2('0x1b')]['fn'](_0x3bc2('0x1c'),db[_0x3bc2('0x1b')]['fn']('IF',db[_0x3bc2('0x1b')][_0x3bc2('0x1f')](_0x3bc2('0x35')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn'](_0x3bc2('0x1c'),db[_0x3bc2('0x1b')]['fn']('IF',db[_0x3bc2('0x1b')]['literal'](_0x3bc2('0x36')))),_0x3bc2('0x37')],[db[_0x3bc2('0x1b')]['fn'](_0x3bc2('0x1c'),db[_0x3bc2('0x1b')]['fn']('IF',db[_0x3bc2('0x1b')][_0x3bc2('0x1f')](_0x3bc2('0x38')))),_0x3bc2('0x39')],[db['sequelize']['fn'](_0x3bc2('0x1c'),db[_0x3bc2('0x1b')]['fn']('IF',db[_0x3bc2('0x1b')][_0x3bc2('0x1f')](_0x3bc2('0x3a')))),_0x3bc2('0x3b')],[db['sequelize']['fn'](_0x3bc2('0x1c'),db[_0x3bc2('0x1b')]['fn']('IF',db[_0x3bc2('0x1b')][_0x3bc2('0x1f')](_0x3bc2('0x3c')))),_0x3bc2('0x39')],[db['sequelize']['fn'](_0x3bc2('0x1c'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x3bc2('0x3d')))),'outboundReCallsDay']],'group':[_0x3bc2('0x29')]})['then'](function(_0x1c99a9){logger[_0x3bc2('0x10')](_0x3bc2('0x28'),_0x21523d);logger['debug'](_0x3bc2('0x28'),_0x21523d,JSON['stringify'](_0x1c99a9));_0x30d772(_0x1c99a9);})[_0x3bc2('0x16')](function(_0x4da621){logger['error'](_0x3bc2('0x28'),_0x4da621[_0x3bc2('0xf')],_0x21523d);_0x1c5523(_0x15f263[_0x3bc2('0xe')](0x1f4,_0x4da621[_0x3bc2('0xf')]));});});};exports[_0x3bc2('0x3e')]=function(_0x2ad06d){var _0x1db0aa=this;return new Promise(function(_0x348f5d,_0x324b2d){return db['CmHopperHistory'][_0x3bc2('0x18')]({'raw':_0x2ad06d[_0x3bc2('0x15')]?_0x2ad06d[_0x3bc2('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2ad06d[_0x3bc2('0x15')]?_0x2ad06d[_0x3bc2('0x15')][_0x3bc2('0x1a')]||null:null,'attributes':[[_0x3bc2('0x29'),'name'],[db[_0x3bc2('0x1b')]['fn'](_0x3bc2('0x1c'),db[_0x3bc2('0x1b')][_0x3bc2('0x1d')]('id')),_0x3bc2('0x3f')],[db[_0x3bc2('0x1b')]['fn'](_0x3bc2('0x1c'),db[_0x3bc2('0x1b')]['fn']('IF',db[_0x3bc2('0x1b')][_0x3bc2('0x1f')]('`state`\x20=\x204,\x201,\x20null'))),_0x3bc2('0x40')]],'group':[_0x3bc2('0x29')]})[_0x3bc2('0x9')](function(_0x522ea9){logger[_0x3bc2('0x10')](_0x3bc2('0x3e'),_0x2ad06d);logger[_0x3bc2('0xb')](_0x3bc2('0x3e'),_0x2ad06d,JSON[_0x3bc2('0xd')](_0x522ea9));_0x348f5d(_0x522ea9);})[_0x3bc2('0x16')](function(_0x5defb4){logger['error'](_0x3bc2('0x3e'),_0x5defb4['message'],_0x2ad06d);_0x324b2d(_0x1db0aa['error'](0x1f4,_0x5defb4['message']));});});}; \ No newline at end of file +var _0x705f=['create','body','options','raw','CreateCmHopperHistory','AvgHandleTime','findAll','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','CmHopperHistory','where','campaign','name','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0x2384bb,_0x39682f){var _0x299201=function(_0x22c20d){while(--_0x22c20d){_0x2384bb['push'](_0x2384bb['shift']());}};_0x299201(++_0x39682f);}(_0x705f,0x75));var _0xf705=function(_0x191b2d,_0x15f3d9){_0x191b2d=_0x191b2d-0x0;var _0x364d36=_0x705f[_0x191b2d];return _0x364d36;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf705('0x0'));var BPromise=require('bluebird');var rs=require(_0xf705('0x1'));var fs=require('fs');var Redis=require(_0xf705('0x2'));var db=require(_0xf705('0x3'))['db'];var utils=require(_0xf705('0x4'));var logger=require(_0xf705('0x5'))(_0xf705('0x6'));var config=require(_0xf705('0x7'));var jayson=require(_0xf705('0x8'));var client=jayson[_0xf705('0x9')][_0xf705('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32c99d,_0x48eb92,_0x51fda8){return new BPromise(function(_0xc244e3,_0x58cae9){return client[_0xf705('0xb')](_0x32c99d,_0x51fda8)[_0xf705('0xc')](function(_0x4f3226){logger['info'](_0xf705('0xd'),_0x48eb92,_0xf705('0xe'));logger[_0xf705('0xf')](_0xf705('0x10'),_0x48eb92,_0xf705('0xe'),JSON[_0xf705('0x11')](_0x4f3226));if(_0x4f3226[_0xf705('0x12')]){if(_0x4f3226[_0xf705('0x12')]['code']===0x1f4){logger[_0xf705('0x12')](_0xf705('0xd'),_0x48eb92,_0x4f3226[_0xf705('0x12')][_0xf705('0x13')]);return _0x58cae9(_0x4f3226[_0xf705('0x12')]['message']);}logger['error'](_0xf705('0xd'),_0x48eb92,_0x4f3226[_0xf705('0x12')][_0xf705('0x13')]);return _0xc244e3(_0x4f3226[_0xf705('0x12')]['message']);}else{logger[_0xf705('0x14')](_0xf705('0xd'),_0x48eb92,_0xf705('0xe'));_0xc244e3(_0x4f3226[_0xf705('0x15')]['message']);}})[_0xf705('0x16')](function(_0x479b31){logger[_0xf705('0x12')](_0xf705('0xd'),_0x48eb92,_0x479b31);_0x58cae9(_0x479b31);});});}exports['CreateCmHopperHistory']=function(_0xa9a2ca){var _0x5cb9e1=this;return new Promise(function(_0x425cd6,_0x5c05ae){return db['CmHopperHistory'][_0xf705('0x17')](_0xa9a2ca[_0xf705('0x18')],{'raw':_0xa9a2ca[_0xf705('0x19')]?_0xa9a2ca['options'][_0xf705('0x1a')]===undefined?!![]:![]:!![]})[_0xf705('0xc')](function(_0x8d5b49){logger['info'](_0xf705('0x1b'),_0xa9a2ca);logger['debug']('CreateCmHopperHistory',_0xa9a2ca,JSON[_0xf705('0x11')](_0x8d5b49));_0x425cd6(_0x8d5b49);})[_0xf705('0x16')](function(_0x2a2fb7){logger[_0xf705('0x12')](_0xf705('0x1b'),_0x2a2fb7[_0xf705('0x13')],_0xa9a2ca);_0x5c05ae(_0x5cb9e1[_0xf705('0x12')](0x1f4,_0x2a2fb7[_0xf705('0x13')]));});});};exports[_0xf705('0x1c')]=function(_0x39dddb){var _0x2b5717=this;return new Promise(function(_0x55f5b9,_0x1bb7f8){return db['CmHopperHistory'][_0xf705('0x1d')]({'raw':_0x39dddb['options']?_0x39dddb['options'][_0xf705('0x1a')]===undefined?!![]:![]:!![],'where':_0x39dddb[_0xf705('0x19')]?_0x39dddb['options']['where']||null:null,'attributes':[[db[_0xf705('0x1e')]['fn'](_0xf705('0x1f'),db[_0xf705('0x1e')][_0xf705('0x20')]('id')),_0xf705('0x21')],[db['sequelize']['fn'](_0xf705('0x1f'),db[_0xf705('0x1e')]['fn']('IF',db[_0xf705('0x1e')]['literal']('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn'](_0xf705('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0xf705('0x22')](_0xf705('0x23')))),_0xf705('0x24')],[db[_0xf705('0x1e')]['fn'](_0xf705('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0xf705('0x22')](_0xf705('0x25')))),_0xf705('0x26')],[db[_0xf705('0x1e')]['fn'](_0xf705('0x27'),db[_0xf705('0x1e')]['fn']('IF',db[_0xf705('0x1e')][_0xf705('0x22')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xf705('0x28')],[db['sequelize']['fn'](_0xf705('0x27'),db['sequelize']['fn']('IF',db[_0xf705('0x1e')][_0xf705('0x22')](_0xf705('0x29')))),_0xf705('0x2a')]]})[_0xf705('0xc')](function(_0x33fe89){logger[_0xf705('0x14')]('AvgHandleTime',_0x39dddb);logger[_0xf705('0xf')](_0xf705('0x1c'),_0x39dddb,JSON[_0xf705('0x11')](_0x33fe89));_0x55f5b9(_0x33fe89);})['catch'](function(_0x5e20bf){logger[_0xf705('0x12')]('AvgHandleTime',_0x5e20bf[_0xf705('0x13')],_0x39dddb);_0x1bb7f8(_0x2b5717[_0xf705('0x12')](0x1f4,_0x5e20bf[_0xf705('0x13')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x1406a2){var _0x4835c0=this;return new Promise(function(_0x5ba49b,_0x147e17){return db[_0xf705('0x2b')]['findAll']({'raw':_0x1406a2[_0xf705('0x19')]?_0x1406a2['options'][_0xf705('0x1a')]===undefined?!![]:![]:!![],'where':_0x1406a2[_0xf705('0x19')]?_0x1406a2[_0xf705('0x19')][_0xf705('0x2c')]||null:null,'attributes':[[_0xf705('0x2d'),_0xf705('0x2e')],[db['sequelize']['fn'](_0xf705('0x1f'),db[_0xf705('0x1e')]['fn']('IF',db[_0xf705('0x1e')][_0xf705('0x22')]('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db[_0xf705('0x1e')]['fn'](_0xf705('0x1f'),db['sequelize']['fn']('IF',db[_0xf705('0x1e')][_0xf705('0x22')](_0xf705('0x2f')))),'outboundNoAnswerCallsDay'],[db[_0xf705('0x1e')]['fn'](_0xf705('0x1f'),db['sequelize']['fn']('IF',db[_0xf705('0x1e')][_0xf705('0x22')](_0xf705('0x30')))),_0xf705('0x31')],[db[_0xf705('0x1e')]['fn'](_0xf705('0x1f'),db[_0xf705('0x1e')]['fn']('IF',db[_0xf705('0x1e')][_0xf705('0x22')](_0xf705('0x32')))),_0xf705('0x33')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf705('0x1e')][_0xf705('0x22')](_0xf705('0x34')))),'outboundCongestionCallsDay'],[db[_0xf705('0x1e')]['fn'](_0xf705('0x1f'),db[_0xf705('0x1e')]['fn']('IF',db[_0xf705('0x1e')][_0xf705('0x22')](_0xf705('0x35')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn'](_0xf705('0x1f'),db[_0xf705('0x1e')]['fn']('IF',db['sequelize'][_0xf705('0x22')](_0xf705('0x36')))),_0xf705('0x37')],[db[_0xf705('0x1e')]['fn']('COUNT',db[_0xf705('0x1e')]['fn']('IF',db[_0xf705('0x1e')]['literal'](_0xf705('0x38')))),_0xf705('0x39')],[db[_0xf705('0x1e')]['fn'](_0xf705('0x1f'),db[_0xf705('0x1e')]['fn']('IF',db[_0xf705('0x1e')][_0xf705('0x22')](_0xf705('0x3a')))),_0xf705('0x3b')],[db['sequelize']['fn']('COUNT',db[_0xf705('0x1e')]['fn']('IF',db[_0xf705('0x1e')]['literal'](_0xf705('0x3c')))),_0xf705('0x3d')],[db[_0xf705('0x1e')]['fn'](_0xf705('0x1f'),db[_0xf705('0x1e')]['fn']('IF',db[_0xf705('0x1e')]['literal']('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0xf705('0x1e')]['fn'](_0xf705('0x1f'),db[_0xf705('0x1e')]['fn']('IF',db['sequelize'][_0xf705('0x22')](_0xf705('0x3e')))),_0xf705('0x3f')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf705('0x1e')][_0xf705('0x22')](_0xf705('0x40')))),_0xf705('0x41')],[db[_0xf705('0x1e')]['fn'](_0xf705('0x1f'),db['sequelize']['fn']('IF',db[_0xf705('0x1e')][_0xf705('0x22')](_0xf705('0x42')))),_0xf705('0x43')]],'group':[_0xf705('0x2d')]})[_0xf705('0xc')](function(_0x5148be){logger['info'](_0xf705('0x44'),_0x1406a2);logger[_0xf705('0xf')](_0xf705('0x44'),_0x1406a2,JSON[_0xf705('0x11')](_0x5148be));_0x5ba49b(_0x5148be);})['catch'](function(_0x2a02c6){logger[_0xf705('0x12')](_0xf705('0x44'),_0x2a02c6[_0xf705('0x13')],_0x1406a2);_0x147e17(_0x4835c0[_0xf705('0x12')](0x1f4,_0x2a02c6[_0xf705('0x13')]));});});};exports[_0xf705('0x45')]=function(_0x2e65e3){var _0x7df03b=this;return new Promise(function(_0x2a5b8f,_0xba917b){return db['CmHopperHistory'][_0xf705('0x1d')]({'raw':_0x2e65e3[_0xf705('0x19')]?_0x2e65e3[_0xf705('0x19')][_0xf705('0x1a')]===undefined?!![]:![]:!![],'where':_0x2e65e3[_0xf705('0x19')]?_0x2e65e3[_0xf705('0x19')][_0xf705('0x2c')]||null:null,'attributes':[[_0xf705('0x2d'),_0xf705('0x2e')],[db[_0xf705('0x1e')]['fn'](_0xf705('0x1f'),db[_0xf705('0x1e')][_0xf705('0x20')]('id')),'ivrTotalCallsDays'],[db[_0xf705('0x1e')]['fn'](_0xf705('0x1f'),db[_0xf705('0x1e')]['fn']('IF',db[_0xf705('0x1e')][_0xf705('0x22')](_0xf705('0x30')))),'ivrAnswerCallsDay']],'group':[_0xf705('0x2d')]})[_0xf705('0xc')](function(_0x539398){logger['info'](_0xf705('0x45'),_0x2e65e3);logger[_0xf705('0xf')](_0xf705('0x45'),_0x2e65e3,JSON['stringify'](_0x539398));_0x2a5b8f(_0x539398);})[_0xf705('0x16')](function(_0xef945d){logger['error'](_0xf705('0x45'),_0xef945d['message'],_0x2e65e3);_0xba917b(_0x7df03b[_0xf705('0x12')](0x1f4,_0xef945d['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 11db26c..1bc7375 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 _0xff16=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update'];(function(_0x17c189,_0x50a594){var _0x27ce7d=function(_0x31d952){while(--_0x31d952){_0x17c189['push'](_0x17c189['shift']());}};_0x27ce7d(++_0x50a594);}(_0xff16,0x7f));var _0x6ff1=function(_0x5921de,_0x441a7b){_0x5921de=_0x5921de-0x0;var _0x7017d8=_0xff16[_0x5921de];return _0x7017d8;};'use strict';var multer=require(_0x6ff1('0x0'));var util=require(_0x6ff1('0x1'));var path=require('path');var timeout=require(_0x6ff1('0x2'));var express=require(_0x6ff1('0x3'));var router=express[_0x6ff1('0x4')]();var auth=require(_0x6ff1('0x5'));var interaction=require(_0x6ff1('0x6'));var config=require(_0x6ff1('0x7'));var controller=require(_0x6ff1('0x8'));router[_0x6ff1('0x9')]('/',auth['isAuthenticated'](),controller[_0x6ff1('0xa')]);router['get'](_0x6ff1('0xb'),auth[_0x6ff1('0xc')](),controller[_0x6ff1('0xd')]);router[_0x6ff1('0x9')](_0x6ff1('0xe'),auth[_0x6ff1('0xc')](),controller[_0x6ff1('0xf')]);router[_0x6ff1('0x10')]('/',auth['isAuthenticated'](),controller[_0x6ff1('0x11')]);router[_0x6ff1('0x12')](_0x6ff1('0xe'),auth[_0x6ff1('0xc')](),controller[_0x6ff1('0x13')]);module[_0x6ff1('0x14')]=router; \ No newline at end of file +var _0xfb8f=['describe','/:id','show','create','put','update','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x9891c0,_0xad3fb8){var _0x2a7dc7=function(_0x2dc74e){while(--_0x2dc74e){_0x9891c0['push'](_0x9891c0['shift']());}};_0x2a7dc7(++_0xad3fb8);}(_0xfb8f,0x18c));var _0xffb8=function(_0x3c0ed7,_0x52c6ff){_0x3c0ed7=_0x3c0ed7-0x0;var _0x2973e6=_0xfb8f[_0x3c0ed7];return _0x2973e6;};'use strict';var multer=require('multer');var util=require(_0xffb8('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xffb8('0x1'));var router=express[_0xffb8('0x2')]();var auth=require(_0xffb8('0x3'));var interaction=require(_0xffb8('0x4'));var config=require(_0xffb8('0x5'));var controller=require('./cmHopperHistory.controller');router[_0xffb8('0x6')]('/',auth[_0xffb8('0x7')](),controller[_0xffb8('0x8')]);router[_0xffb8('0x6')]('/describe',auth['isAuthenticated'](),controller[_0xffb8('0x9')]);router[_0xffb8('0x6')](_0xffb8('0xa'),auth[_0xffb8('0x7')](),controller[_0xffb8('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xffb8('0xc')]);router[_0xffb8('0xd')](_0xffb8('0xa'),auth[_0xffb8('0x7')](),controller[_0xffb8('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 8522e5f..208aacd 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 _0x6aa7=['name','sequelize','STRING'];(function(_0x296d9f,_0x5b5296){var _0x1104a4=function(_0x5276bf){while(--_0x5276bf){_0x296d9f['push'](_0x296d9f['shift']());}};_0x1104a4(++_0x5b5296);}(_0x6aa7,0x178));var _0x76aa=function(_0x2ae507,_0x65d855){_0x2ae507=_0x2ae507-0x0;var _0xf610c=_0x6aa7[_0x2ae507];return _0xf610c;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'name':{'type':Sequelize[_0x76aa('0x1')],'unique':_0x76aa('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x76aa('0x1')]},'dialPrefix':{'type':Sequelize[_0x76aa('0x1')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','name','sequelize'];(function(_0x4af0ed,_0x4abe14){var _0x5ed6fd=function(_0x2fcce0){while(--_0x2fcce0){_0x4af0ed['push'](_0x4af0ed['shift']());}};_0x5ed6fd(++_0x4abe14);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'unique':_0x7995('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 4c1dafd..dd72f30 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 _0x0bb5=['each','CmContact','omit','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','map','format','getContactsCsv','cf_%d','raw','now','writeFileSync','setHeader','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','findOne','sequelize','addCustomFields','Sequelize','TEXT','text','type','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','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','../../config/environment','../../mysqldb','redis','socket.io-emitter','./cmList.socket','status','json','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','Lists','sendStatus','error','stack','name','send','index','CmList','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','filters','pick','filter','where','merge','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','update','describe','ListId','getDispositions','Disposition','removeDispositions','ids','addContacts','tags','isArray','push'];(function(_0x37f5a1,_0x461925){var _0x3a97a5=function(_0x11f158){while(--_0x11f158){_0x37f5a1['push'](_0x37f5a1['shift']());}};_0x3a97a5(++_0x461925);}(_0x0bb5,0x148));var _0x50bb=function(_0x1d0b8b,_0x42b6e0){_0x1d0b8b=_0x1d0b8b-0x0;var _0x40e38d=_0x0bb5[_0x1d0b8b];return _0x40e38d;};'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'];config[_0x50bb('0x18')]=_['defaults'](config[_0x50bb('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x50bb('0x19'))(new Redis(config[_0x50bb('0x18')]));require(_0x50bb('0x1a'))['register'](socket);function respondWithStatusCode(_0x17007f,_0x309986){_0x309986=_0x309986||0xcc;return function(_0x3094f2){if(_0x3094f2){return _0x17007f['sendStatus'](_0x309986);}return _0x17007f[_0x50bb('0x1b')](_0x309986)['end']();};}function respondWithResult(_0x21befa,_0x3e1a51){_0x3e1a51=_0x3e1a51||0xc8;return function(_0x253073){if(_0x253073){return _0x21befa[_0x50bb('0x1b')](_0x3e1a51)[_0x50bb('0x1c')](_0x253073);}};}function respondWithFilteredResult(_0x4f2897,_0x10a191){return function(_0x174065){if(_0x174065){var _0x4b1f5f=_0x174065[_0x50bb('0x1d')],_0x24ba19=_0x10a191['offset'],_0x4796ec=_0x10a191['offset']+_0x10a191[_0x50bb('0x1e')],_0x301f61;if(_0x4796ec>=_0x4b1f5f){_0x4796ec=_0x4b1f5f;_0x301f61=0xc8;}else{_0x301f61=0xce;}_0x4f2897[_0x50bb('0x1b')](_0x301f61);return _0x4f2897[_0x50bb('0x1f')](_0x50bb('0x20'),_0x24ba19+'-'+_0x4796ec+'/'+_0x4b1f5f)['json'](_0x174065);}return null;};}function patchUpdates(_0x19dc5d){return function(_0x32bfc3){try{jsonpatch[_0x50bb('0x21')](_0x32bfc3,_0x19dc5d,!![]);}catch(_0x597e95){return BPromise[_0x50bb('0x22')](_0x597e95);}return _0x32bfc3[_0x50bb('0x23')]();};}function saveUpdates(_0x1344ec,_0x4825f8){return function(_0x1dbba2){if(_0x1dbba2){return _0x1dbba2['update'](_0x1344ec)[_0x50bb('0x24')](function(_0x3391da){return _0x3391da;});}return null;};}function removeEntity(_0x1a2a0b,_0x2ee87a){return function(_0x846311){if(_0x846311){return _0x846311[_0x50bb('0x25')]()['then'](function(){var _0xad17ac=_0x846311[_0x50bb('0x26')]({'plain':!![]});var _0x284a76=_0x50bb('0x27');return db['UserProfileResource'][_0x50bb('0x25')]({'where':{'type':_0x284a76,'resourceId':_0xad17ac['id']}})['then'](function(){return _0x846311;});})['then'](function(){_0x1a2a0b[_0x50bb('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cfe4b,_0x41fd89){return function(_0x12ee2c){if(!_0x12ee2c){_0x5cfe4b[_0x50bb('0x28')](0x194);}return _0x12ee2c;};}function handleError(_0x1b74f9,_0x17c158){_0x17c158=_0x17c158||0x1f4;return function(_0x269479){logger[_0x50bb('0x29')](_0x269479[_0x50bb('0x2a')]);if(_0x269479['name']){delete _0x269479[_0x50bb('0x2b')];}_0x1b74f9[_0x50bb('0x1b')](_0x17c158)[_0x50bb('0x2c')](_0x269479);};}exports[_0x50bb('0x2d')]=function(_0x560b07,_0x13dc3c){var _0x1a62fb={},_0xc38da5={},_0xb3c3ba={'count':0x0,'rows':[]};var _0x3fd5f6=db[_0x50bb('0x2e')][_0x50bb('0x2f')];_0xc38da5[_0x50bb('0x30')]=_[_0x50bb('0x31')](_0x3fd5f6);_0xc38da5[_0x50bb('0x32')]=_[_0x50bb('0x31')](_0x560b07[_0x50bb('0x32')]);_0xc38da5['filters']=_[_0x50bb('0x33')](_0xc38da5[_0x50bb('0x30')],_0xc38da5[_0x50bb('0x32')]);_0x1a62fb[_0x50bb('0x34')]=_[_0x50bb('0x33')](_0xc38da5[_0x50bb('0x30')],qs[_0x50bb('0x35')](_0x560b07[_0x50bb('0x32')][_0x50bb('0x35')]));_0x1a62fb[_0x50bb('0x34')]=_0x1a62fb[_0x50bb('0x34')]['length']?_0x1a62fb[_0x50bb('0x34')]:_0xc38da5[_0x50bb('0x30')];if(!_0x560b07[_0x50bb('0x32')][_0x50bb('0x36')](_0x50bb('0x37'))){_0x1a62fb[_0x50bb('0x1e')]=qs['limit'](_0x560b07['query'][_0x50bb('0x1e')]);_0x1a62fb['offset']=qs[_0x50bb('0x38')](_0x560b07[_0x50bb('0x32')][_0x50bb('0x38')]);}_0x1a62fb[_0x50bb('0x39')]=qs[_0x50bb('0x3a')](_0x560b07['query'][_0x50bb('0x3a')]);_0x1a62fb['where']=qs[_0x50bb('0x3b')](_[_0x50bb('0x3c')](_0x560b07[_0x50bb('0x32')],_0xc38da5['filters']));if(_0x560b07['query'][_0x50bb('0x3d')]){_0x1a62fb[_0x50bb('0x3e')]=_[_0x50bb('0x3f')](_0x1a62fb[_0x50bb('0x3e')],{'$or':_['map'](_0x3fd5f6,function(_0x3c273b){if(_0x3c273b['type']['key']!==_0x50bb('0x40')){var _0x4c437a={};_0x4c437a[_0x3c273b[_0x50bb('0x41')]]={'$like':'%'+_0x560b07[_0x50bb('0x32')][_0x50bb('0x3d')]+'%'};return _0x4c437a;}})});}_0x1a62fb=_[_0x50bb('0x3f')]({},_0x1a62fb,_0x560b07[_0x50bb('0x42')]);var _0x437524={'where':_0x1a62fb[_0x50bb('0x3e')]};return db[_0x50bb('0x2e')][_0x50bb('0x1d')](_0x437524)[_0x50bb('0x24')](function(_0x594f16){_0xb3c3ba['count']=_0x594f16;if(_0x560b07[_0x50bb('0x32')][_0x50bb('0x43')]){_0x1a62fb[_0x50bb('0x44')]=[{'all':!![]}];}return db[_0x50bb('0x2e')]['findAll'](_0x1a62fb);})[_0x50bb('0x24')](function(_0x4d34f5){_0xb3c3ba[_0x50bb('0x45')]=_0x4d34f5;return _0xb3c3ba;})[_0x50bb('0x24')](respondWithFilteredResult(_0x13dc3c,_0x1a62fb))[_0x50bb('0x46')](handleError(_0x13dc3c,null));};exports[_0x50bb('0x47')]=function(_0x1c438b,_0x355726){var _0x3b1918={'raw':![],'where':{'id':_0x1c438b[_0x50bb('0x48')]['id']}},_0x1a3735={};_0x1a3735[_0x50bb('0x30')]=_[_0x50bb('0x31')](db[_0x50bb('0x2e')][_0x50bb('0x2f')]);_0x1a3735[_0x50bb('0x32')]=_[_0x50bb('0x31')](_0x1c438b[_0x50bb('0x32')]);_0x1a3735['filters']=_[_0x50bb('0x33')](_0x1a3735['model'],_0x1a3735[_0x50bb('0x32')]);_0x3b1918[_0x50bb('0x34')]=_[_0x50bb('0x33')](_0x1a3735[_0x50bb('0x30')],qs[_0x50bb('0x35')](_0x1c438b[_0x50bb('0x32')][_0x50bb('0x35')]));_0x3b1918[_0x50bb('0x34')]=_0x3b1918[_0x50bb('0x34')][_0x50bb('0x49')]?_0x3b1918[_0x50bb('0x34')]:_0x1a3735[_0x50bb('0x30')];if(_0x1c438b[_0x50bb('0x32')][_0x50bb('0x43')]){_0x3b1918['include']=[{'all':!![]}];}_0x3b1918=_[_0x50bb('0x3f')]({},_0x3b1918,_0x1c438b['options']);return db[_0x50bb('0x2e')][_0x50bb('0x4a')](_0x3b1918)[_0x50bb('0x24')](handleEntityNotFound(_0x355726,null))[_0x50bb('0x24')](respondWithResult(_0x355726,null))[_0x50bb('0x46')](handleError(_0x355726,null));};exports[_0x50bb('0x4b')]=function(_0x133dd9,_0x358b3a){return db['CmList'][_0x50bb('0x4b')](_0x133dd9[_0x50bb('0x4c')],{})[_0x50bb('0x24')](function(_0x13afe2){var _0x3659c4=_0x133dd9['user'][_0x50bb('0x26')]({'plain':!![]});if(!_0x3659c4)throw new Error(_0x50bb('0x4d'));if(_0x3659c4[_0x50bb('0x4e')]===_0x50bb('0x4f')){var _0x77f534=_0x13afe2['get']({'plain':!![]});var _0x498dc7=_0x50bb('0x27');return db['UserProfileSection'][_0x50bb('0x4a')]({'where':{'name':_0x498dc7,'userProfileId':_0x3659c4['userProfileId']},'raw':!![]})[_0x50bb('0x24')](function(_0x24c9f3){if(_0x24c9f3&&_0x24c9f3[_0x50bb('0x50')]===0x0){return db['UserProfileResource'][_0x50bb('0x4b')]({'name':_0x77f534[_0x50bb('0x2b')],'resourceId':_0x77f534['id'],'type':_0x24c9f3['name'],'sectionId':_0x24c9f3['id']},{})[_0x50bb('0x24')](function(){return _0x13afe2;});}else{return _0x13afe2;}})[_0x50bb('0x46')](function(_0x8d62af){logger[_0x50bb('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8d62af);throw _0x8d62af;});}return _0x13afe2;})[_0x50bb('0x24')](respondWithResult(_0x358b3a,0xc9))[_0x50bb('0x46')](handleError(_0x358b3a,null));};exports[_0x50bb('0x51')]=function(_0x460d93,_0x12bb89){if(_0x460d93['body']['id']){delete _0x460d93[_0x50bb('0x4c')]['id'];}return db['CmList'][_0x50bb('0x4a')]({'where':{'id':_0x460d93['params']['id']}})['then'](handleEntityNotFound(_0x12bb89,null))[_0x50bb('0x24')](saveUpdates(_0x460d93['body'],null))['then'](respondWithResult(_0x12bb89,null))[_0x50bb('0x46')](handleError(_0x12bb89,null));};exports[_0x50bb('0x25')]=function(_0x33ef5a,_0x1bbebc){return db[_0x50bb('0x2e')][_0x50bb('0x4a')]({'where':{'id':_0x33ef5a[_0x50bb('0x48')]['id']}})[_0x50bb('0x24')](handleEntityNotFound(_0x1bbebc,null))['then'](removeEntity(_0x1bbebc,null))['catch'](handleError(_0x1bbebc,null));};exports[_0x50bb('0x52')]=function(_0x345bb5,_0x1d8bf9){return db[_0x50bb('0x2e')][_0x50bb('0x52')]()[_0x50bb('0x24')](respondWithResult(_0x1d8bf9,null))[_0x50bb('0x46')](handleError(_0x1d8bf9,null));};exports['addDisposition']=function(_0x3be83b,_0x31cfca,_0x640fd1){if(_0x3be83b[_0x50bb('0x4c')]['id']){delete _0x3be83b[_0x50bb('0x4c')]['id'];}return db['CmList'][_0x50bb('0x4a')]({'where':{'id':_0x3be83b[_0x50bb('0x48')]['id']}})[_0x50bb('0x24')](handleEntityNotFound(_0x31cfca,null))[_0x50bb('0x24')](function(_0x2ba758){if(_0x2ba758){_0x3be83b['body'][_0x50bb('0x53')]=_0x2ba758['id'];return db['Disposition']['create'](_0x3be83b[_0x50bb('0x4c')]);}})[_0x50bb('0x24')](respondWithResult(_0x31cfca,null))[_0x50bb('0x46')](handleError(_0x31cfca,null));};exports[_0x50bb('0x54')]=function(_0x431d71,_0x20e35a,_0x15aaf8){var _0xd5e871={'raw':![],'where':{}};var _0x330299={};var _0xb0ebeb={'count':0x0,'rows':[]};return db[_0x50bb('0x2e')]['findOne']({'where':{'id':_0x431d71[_0x50bb('0x48')]['id']}})['then'](handleEntityNotFound(_0x20e35a,null))[_0x50bb('0x24')](function(_0x2b9deb){if(_0x2b9deb){_0x330299['model']=_[_0x50bb('0x31')](db[_0x50bb('0x55')][_0x50bb('0x2f')]);_0x330299[_0x50bb('0x32')]=_[_0x50bb('0x31')](_0x431d71[_0x50bb('0x32')]);_0x330299[_0x50bb('0x3b')]=_[_0x50bb('0x33')](_0x330299['model'],_0x330299[_0x50bb('0x32')]);_0xd5e871[_0x50bb('0x34')]=_[_0x50bb('0x33')](_0x330299['model'],qs[_0x50bb('0x35')](_0x431d71[_0x50bb('0x32')][_0x50bb('0x35')]));_0xd5e871[_0x50bb('0x34')]=_0xd5e871[_0x50bb('0x34')][_0x50bb('0x49')]?_0xd5e871['attributes']:_0x330299[_0x50bb('0x30')];if(!_0x431d71[_0x50bb('0x32')][_0x50bb('0x36')](_0x50bb('0x37'))){_0xd5e871[_0x50bb('0x1e')]=qs[_0x50bb('0x1e')](_0x431d71['query'][_0x50bb('0x1e')]);_0xd5e871[_0x50bb('0x38')]=qs[_0x50bb('0x38')](_0x431d71[_0x50bb('0x32')][_0x50bb('0x38')]);}_0xd5e871[_0x50bb('0x39')]=qs[_0x50bb('0x3a')](_0x431d71[_0x50bb('0x32')][_0x50bb('0x3a')]);_0xd5e871['where']=qs[_0x50bb('0x3b')](_[_0x50bb('0x3c')](_0x431d71[_0x50bb('0x32')],_0x330299[_0x50bb('0x3b')]));_0xd5e871[_0x50bb('0x3e')][_0x50bb('0x53')]=_0x2b9deb['id'];if(_0x431d71[_0x50bb('0x32')][_0x50bb('0x3d')]){_0xd5e871[_0x50bb('0x3e')]=_['merge'](_0xd5e871['where'],{'$or':_['map'](_0xd5e871[_0x50bb('0x34')],function(_0x5ba597){var _0x49c5eb={};_0x49c5eb[_0x5ba597]={'$like':'%'+_0x431d71[_0x50bb('0x32')][_0x50bb('0x3d')]+'%'};return _0x49c5eb;})});}_0xd5e871=_[_0x50bb('0x3f')]({},_0xd5e871,_0x431d71[_0x50bb('0x42')]);return db['Disposition'][_0x50bb('0x1d')]({'where':_0xd5e871[_0x50bb('0x3e')]})['then'](function(_0x13310d){_0xb0ebeb['count']=_0x13310d;if(_0x431d71[_0x50bb('0x32')][_0x50bb('0x43')]){_0xd5e871['include']=[{'all':!![]}];}return db[_0x50bb('0x55')]['findAll'](_0xd5e871);})[_0x50bb('0x24')](function(_0x29c740){_0xb0ebeb['rows']=_0x29c740;return _0xb0ebeb;});}})[_0x50bb('0x24')](respondWithFilteredResult(_0x20e35a,_0xd5e871))[_0x50bb('0x46')](handleError(_0x20e35a,null));};exports[_0x50bb('0x56')]=function(_0x51142c,_0x1b4898,_0x12c4ee){return db[_0x50bb('0x2e')][_0x50bb('0x4a')]({'where':{'id':_0x51142c['params']['id']}})[_0x50bb('0x24')](handleEntityNotFound(_0x1b4898,null))[_0x50bb('0x24')](function(_0x5f3990){if(_0x5f3990){return _0x5f3990['removeDispositions'](_0x51142c[_0x50bb('0x32')][_0x50bb('0x57')]);}})['then'](respondWithStatusCode(_0x1b4898,null))[_0x50bb('0x46')](handleError(_0x1b4898,null));};exports[_0x50bb('0x58')]=function(_0x5fd8eb,_0x3f2b0b,_0x197798){return db['CmList']['find']({'where':{'id':_0x5fd8eb[_0x50bb('0x48')]['id']}})[_0x50bb('0x24')](handleEntityNotFound(_0x3f2b0b,null))[_0x50bb('0x24')](function(_0x20ef93){if(_0x20ef93){var _0x4b51d4=[];var _0x1975f7={'success':[],'errors':[]};return db['CmContact'][_0x50bb('0x52')]()[_0x50bb('0x24')](function(_0x98d984){if(_0x5fd8eb[_0x50bb('0x4c')][_0x50bb('0x59')]&&_[_0x50bb('0x5a')](_0x5fd8eb[_0x50bb('0x4c')]['tags'])){if(_0x5fd8eb[_0x50bb('0x4c')][_0x50bb('0x59')][_0x50bb('0x49')]){_0x5fd8eb[_0x50bb('0x4c')][_0x50bb('0x59')]=_0x5fd8eb[_0x50bb('0x4c')][_0x50bb('0x59')]['join'](';')+';';}else{_0x5fd8eb[_0x50bb('0x4c')][_0x50bb('0x59')]=null;}}else{_0x5fd8eb[_0x50bb('0x4c')][_0x50bb('0x59')]=null;}if(_0x5fd8eb[_0x50bb('0x4c')]&&_['isArray'](_0x5fd8eb['body'])){for(var _0x145cf8=0x0;_0x145cf8<_0x5fd8eb['body'][_0x50bb('0x49')];_0x145cf8+=0x1){_0x5fd8eb[_0x50bb('0x4c')][_0x145cf8]['ListId']=_0x5fd8eb['params']['id'];_0x4b51d4[_0x50bb('0x5b')](_0x5fd8eb[_0x50bb('0x4c')][_0x145cf8]);}return BPromise[_0x50bb('0x5c')](_0x4b51d4,function(_0x486f34){return db[_0x50bb('0x5d')][_0x50bb('0x4b')](_[_0x50bb('0x5e')](_0x486f34,[_0x50bb('0x57'),'id'])||{},{'fields':_[_0x50bb('0x31')](_0x98d984),'raw':!![]})[_0x50bb('0x24')](function(_0xaf41dd){_0x1975f7['success']['push'](_0xaf41dd[_0x50bb('0x5f')]);})[_0x50bb('0x46')](function(_0x232388){_0x1975f7[_0x50bb('0x60')][_0x50bb('0x5b')]({'data':_0x486f34,'error':_0x232388[_0x50bb('0x61')]});});})[_0x50bb('0x24')](function(_0x21ffe8){return _0x1975f7;})[_0x50bb('0x46')](function(_0x2d01ec){return _0x2d01ec;});}else{_0x3f2b0b['status'](0x190)[_0x50bb('0x1c')]({'message':_0x50bb('0x62')});}});}})[_0x50bb('0x24')](respondWithResult(_0x3f2b0b,null))[_0x50bb('0x46')](handleError(_0x3f2b0b,null));};exports[_0x50bb('0x63')]=function(_0x1d8117,_0x34af5f,_0x265356){var _0x376337;return db[_0x50bb('0x2e')][_0x50bb('0x4a')]({'where':{'id':_0x1d8117[_0x50bb('0x48')]['id']},'include':[{'model':db[_0x50bb('0x64')],'as':_0x50bb('0x65')}]})[_0x50bb('0x24')](handleEntityNotFound(_0x34af5f,null))['then'](function(_0x1253a2){if(_0x1253a2){_0x376337=_0x1253a2;return db[_0x50bb('0x5d')][_0x50bb('0x2f')];}})['then'](function(_0xcd752){if(_0xcd752){var _0x2a3376={};var _0x310525={};_0x310525[_0x50bb('0x30')]=_[_0x50bb('0x66')](_[_0x50bb('0x31')](_0xcd752),_[_0x50bb('0x67')](_0x376337[_0x50bb('0x65')],function(_0x383ad2){return util[_0x50bb('0x68')]('cf_%d',_0x383ad2['id']);}));_0x310525[_0x50bb('0x32')]=_[_0x50bb('0x31')](_0x1d8117[_0x50bb('0x32')]);_0x310525[_0x50bb('0x3b')]=_[_0x50bb('0x33')](_0x310525[_0x50bb('0x30')],_0x310525[_0x50bb('0x32')]);_0x2a3376[_0x50bb('0x34')]=_[_0x50bb('0x33')](_0x310525[_0x50bb('0x30')],qs[_0x50bb('0x35')](_0x1d8117['query'][_0x50bb('0x35')]));_0x2a3376[_0x50bb('0x34')]=_0x2a3376[_0x50bb('0x34')][_0x50bb('0x49')]?_0x2a3376[_0x50bb('0x34')]:_0x310525[_0x50bb('0x30')];if(!_0x1d8117['query'][_0x50bb('0x36')]('nolimit')){_0x2a3376[_0x50bb('0x1e')]=qs[_0x50bb('0x1e')](_0x1d8117['query']['limit']);_0x2a3376['offset']=qs[_0x50bb('0x38')](_0x1d8117[_0x50bb('0x32')][_0x50bb('0x38')]);}_0x2a3376[_0x50bb('0x39')]=qs[_0x50bb('0x3a')](_0x1d8117[_0x50bb('0x32')][_0x50bb('0x3a')]);_0x2a3376['where']=qs[_0x50bb('0x3b')](_['pick'](_0x1d8117[_0x50bb('0x32')],_0x310525[_0x50bb('0x3b')]));_0x2a3376['raw']=!![];if(_0x1d8117['query'][_0x50bb('0x3d')]){_0x2a3376['where']=_[_0x50bb('0x3f')](_0x2a3376[_0x50bb('0x3e')],{'$or':_[_0x50bb('0x67')](_0x2a3376[_0x50bb('0x34')],function(_0x547ef2){var _0xd6279b={};_0xd6279b[_0x547ef2]={'$like':'%'+_0x1d8117['query'][_0x50bb('0x3d')]+'%'};return _0xd6279b;})});}_0x2a3376=_[_0x50bb('0x3f')]({},_0x2a3376,_0x1d8117[_0x50bb('0x42')]);return _0x376337[_0x50bb('0x63')](_0x2a3376);}})[_0x50bb('0x24')](respondWithResult(_0x34af5f,null))[_0x50bb('0x46')](handleError(_0x34af5f,null));};exports[_0x50bb('0x69')]=function(_0xb6e335,_0x432e1a,_0x4d448a){var _0x5262be;return db['CmList'][_0x50bb('0x4a')]({'where':{'id':_0xb6e335[_0x50bb('0x48')]['id']},'include':[{'model':db[_0x50bb('0x64')],'as':'CustomFields'}]})[_0x50bb('0x24')](handleEntityNotFound(_0x432e1a,null))[_0x50bb('0x24')](function(_0x56d5a){if(_0x56d5a){_0x5262be=_0x56d5a;return db['CmContact'][_0x50bb('0x2f')];}})['then'](function(_0xcb1109){if(_0xcb1109){var _0x82ee88={};var _0x3a2b9a={};_0x3a2b9a[_0x50bb('0x30')]=_[_0x50bb('0x66')](_[_0x50bb('0x31')](_0xcb1109),_[_0x50bb('0x67')](_0x5262be['CustomFields'],function(_0x240636){return util['format'](_0x50bb('0x6a'),_0x240636['id']);}));_0x3a2b9a[_0x50bb('0x32')]=_[_0x50bb('0x31')](_0xb6e335[_0x50bb('0x32')]);_0x3a2b9a['filters']=_[_0x50bb('0x33')](_0x3a2b9a[_0x50bb('0x30')],_0x3a2b9a[_0x50bb('0x32')]);_0x82ee88[_0x50bb('0x34')]=_[_0x50bb('0x33')](_0x3a2b9a['model'],qs['fields'](_0xb6e335[_0x50bb('0x32')][_0x50bb('0x35')]));_0x82ee88[_0x50bb('0x34')]=_0x82ee88[_0x50bb('0x34')][_0x50bb('0x49')]?_0x82ee88[_0x50bb('0x34')]:_0x3a2b9a[_0x50bb('0x30')];if(!_0xb6e335[_0x50bb('0x32')][_0x50bb('0x36')]('nolimit')){_0x82ee88[_0x50bb('0x1e')]=qs[_0x50bb('0x1e')](_0xb6e335['query'][_0x50bb('0x1e')]);_0x82ee88[_0x50bb('0x38')]=qs[_0x50bb('0x38')](_0xb6e335['query'][_0x50bb('0x38')]);}_0x82ee88[_0x50bb('0x39')]=qs['sort'](_0xb6e335[_0x50bb('0x32')][_0x50bb('0x3a')]);_0x82ee88[_0x50bb('0x3e')]=qs[_0x50bb('0x3b')](_['pick'](_0xb6e335['query'],_0x3a2b9a['filters']));_0x82ee88[_0x50bb('0x6b')]=!![];if(_0xb6e335[_0x50bb('0x32')][_0x50bb('0x3d')]){_0x82ee88[_0x50bb('0x3e')]=_[_0x50bb('0x3f')](_0x82ee88['where'],{'$or':_[_0x50bb('0x67')](_0x82ee88[_0x50bb('0x34')],function(_0x5e9811){var _0x3b1b27={};_0x3b1b27[_0x5e9811]={'$like':'%'+_0xb6e335['query'][_0x50bb('0x3d')]+'%'};return _0x3b1b27;})});}_0x82ee88=_[_0x50bb('0x3f')]({},_0x82ee88,_0xb6e335[_0x50bb('0x42')]);return _0x5262be[_0x50bb('0x63')](_0x82ee88);}})[_0x50bb('0x24')](function(_0x10e4e5){if(!_['isEmpty'](_0x10e4e5)){var _0x3a3eed=toCsv(_0x10e4e5);var _0x1ef857=Date[_0x50bb('0x6c')]();fs[_0x50bb('0x6d')](util[_0x50bb('0x68')]('/tmp/list_%d_%s.csv',_0x5262be['id'],_0x1ef857),_0x3a3eed);_0x432e1a[_0x50bb('0x6e')]('Content-disposition','attachment;\x20filename='+util['format'](_0x50bb('0x6f'),_0x5262be['id'],_0x1ef857));_0x432e1a[_0x50bb('0x6e')](_0x50bb('0x70'),_0x50bb('0x71'));return _0x432e1a[_0x50bb('0x72')](util[_0x50bb('0x68')](_0x50bb('0x73'),_0x5262be['id'],_0x1ef857));}else{return _0x432e1a[_0x50bb('0x28')](0xcc);}})[_0x50bb('0x46')](handleError(_0x432e1a,null));};exports[_0x50bb('0x74')]=function(_0x238a38,_0x585519,_0x298a57){var _0x1e022f;delete _0x238a38['body']['id'];return db['CmList'][_0x50bb('0x75')]({'where':{'id':_0x238a38[_0x50bb('0x48')]['id']}})[_0x50bb('0x24')](handleEntityNotFound(_0x585519,null))[_0x50bb('0x24')](function(_0x451cbe){if(_0x451cbe){return db[_0x50bb('0x76')]['transaction'](function(_0x3cd240){return db['CmCustomField'][_0x50bb('0x4b')](_0x238a38[_0x50bb('0x4c')],{'transaction':_0x3cd240})['then'](function(_0x4210a3){_0x1e022f=_0x4210a3;return _0x451cbe[_0x50bb('0x77')](_0x4210a3,{'transaction':_0x3cd240});})[_0x50bb('0x24')](function(){var _0x41f7f0={'type':db[_0x50bb('0x78')][_0x50bb('0x79')],'transaction':_0x3cd240};switch(_0x238a38[_0x50bb('0x4c')]['type']){case _0x50bb('0x7a'):_0x41f7f0[_0x50bb('0x7b')]=db[_0x50bb('0x78')][_0x50bb('0x79')];break;case _0x50bb('0x7c'):_0x41f7f0[_0x50bb('0x7b')]=db[_0x50bb('0x78')][_0x50bb('0x7d')];break;case'switch':_0x41f7f0[_0x50bb('0x7b')]=db['Sequelize'][_0x50bb('0x7e')];_0x41f7f0[_0x50bb('0x7f')]=![];break;default:}return db[_0x50bb('0x76')][_0x50bb('0x80')][_0x50bb('0x81')](_0x50bb('0x82'),util['format']('cf_%s',_0x1e022f['id']),_0x41f7f0);})[_0x50bb('0x24')](function(){return _0x1e022f;});});}})[_0x50bb('0x24')](respondWithResult(_0x585519,null))[_0x50bb('0x46')](handleError(_0x585519,null));};exports[_0x50bb('0x83')]=function(_0x1ad320,_0x436bf9,_0x25724b){var _0x3314da={};var _0xedd33a={};var _0x49e12a;var _0x5d52dd;return db[_0x50bb('0x2e')][_0x50bb('0x75')]({'where':{'id':_0x1ad320[_0x50bb('0x48')]['id']}})[_0x50bb('0x24')](handleEntityNotFound(_0x436bf9,null))[_0x50bb('0x24')](function(_0x2f6e5d){if(_0x2f6e5d){_0x49e12a=_0x2f6e5d;_0xedd33a['model']=_[_0x50bb('0x31')](db[_0x50bb('0x64')][_0x50bb('0x2f')]);_0xedd33a[_0x50bb('0x32')]=_[_0x50bb('0x31')](_0x1ad320[_0x50bb('0x32')]);_0xedd33a['filters']=_['intersection'](_0xedd33a[_0x50bb('0x30')],_0xedd33a[_0x50bb('0x32')]);_0x3314da[_0x50bb('0x34')]=_[_0x50bb('0x33')](_0xedd33a['model'],qs[_0x50bb('0x35')](_0x1ad320['query'][_0x50bb('0x35')]));_0x3314da['attributes']=_0x3314da[_0x50bb('0x34')][_0x50bb('0x49')]?_0x3314da[_0x50bb('0x34')]:_0xedd33a[_0x50bb('0x30')];_0x3314da[_0x50bb('0x39')]=qs[_0x50bb('0x3a')](_0x1ad320['query'][_0x50bb('0x3a')]);_0x3314da[_0x50bb('0x3e')]=qs[_0x50bb('0x3b')](_[_0x50bb('0x3c')](_0x1ad320[_0x50bb('0x32')],_0xedd33a[_0x50bb('0x3b')]));_0x3314da['where']=_['merge'](_0x3314da['where'],{'$or':[{'ListId':_0x2f6e5d['id']},{'ListId':null}]});if(_0x1ad320['query'][_0x50bb('0x3d')]){_0x3314da[_0x50bb('0x3e')]=_['merge'](_0x3314da[_0x50bb('0x3e')],{'$or':_[_0x50bb('0x67')](_0x3314da[_0x50bb('0x34')],function(_0x1ab227){var _0x4be2c9={};_0x4be2c9[_0x1ab227]={'$like':'%'+_0x1ad320[_0x50bb('0x32')][_0x50bb('0x3d')]+'%'};return _0x4be2c9;})});}_0x3314da=_[_0x50bb('0x3f')]({},_0x3314da,_0x1ad320[_0x50bb('0x42')]);return db[_0x50bb('0x64')][_0x50bb('0x84')](_0x3314da);}})[_0x50bb('0x24')](respondWithResult(_0x436bf9,null))[_0x50bb('0x46')](handleError(_0x436bf9,null));};exports[_0x50bb('0x85')]=function(_0x2cf5f0,_0x184b15,_0x117563){return db['CmList'][_0x50bb('0x4a')]({'where':{'id':_0x2cf5f0[_0x50bb('0x48')]['id']}})[_0x50bb('0x24')](handleEntityNotFound(_0x184b15,null))[_0x50bb('0x24')](function(_0x59ab85){if(_0x59ab85){return _0x59ab85['addAgents'](_0x2cf5f0[_0x50bb('0x4c')][_0x50bb('0x57')],_[_0x50bb('0x5e')](_0x2cf5f0[_0x50bb('0x4c')],[_0x50bb('0x57'),'id'])||{})[_0x50bb('0x86')](function(_0x35e755){for(var _0x3a4828=0x0;_0x3a4828<_0x2cf5f0[_0x50bb('0x4c')]['ids'][_0x50bb('0x49')];_0x3a4828+=0x1){socket[_0x50bb('0x87')](_0x50bb('0x88'),{'UserId':_0x2cf5f0['body']['ids'][_0x3a4828],'CmListId':_0x2cf5f0[_0x50bb('0x48')]['id']});}return _0x35e755;});}})['then'](respondWithResult(_0x184b15,null))[_0x50bb('0x46')](handleError(_0x184b15,null));};exports[_0x50bb('0x89')]=function(_0x446ea0,_0x2486a0,_0x47d957){return db[_0x50bb('0x2e')]['find']({'where':{'id':_0x446ea0[_0x50bb('0x48')]['id']}})[_0x50bb('0x24')](handleEntityNotFound(_0x2486a0,null))[_0x50bb('0x24')](function(_0x1ab69){if(_0x1ab69){return _0x1ab69[_0x50bb('0x89')](_0x446ea0[_0x50bb('0x32')]['ids'])['then'](function(){if(_[_0x50bb('0x5a')](_0x446ea0[_0x50bb('0x32')][_0x50bb('0x57')])){for(var _0x505d7a=0x0;_0x505d7a<_0x446ea0[_0x50bb('0x32')][_0x50bb('0x57')][_0x50bb('0x49')];_0x505d7a+=0x1){socket[_0x50bb('0x87')](_0x50bb('0x8a'),{'UserId':Number(_0x446ea0['query'][_0x50bb('0x57')][_0x505d7a]),'CmListId':Number(_0x446ea0[_0x50bb('0x48')]['id'])});}}else{socket['emit']('userCmList:remove',{'UserId':Number(_0x446ea0[_0x50bb('0x32')][_0x50bb('0x57')]),'CmListId':Number(_0x446ea0['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2486a0,null))[_0x50bb('0x46')](handleError(_0x2486a0,null));};exports[_0x50bb('0x8b')]=function(_0x244b60,_0x378aa7,_0x9618c1){var _0x488d1f={};var _0xae319b={};var _0x354e69;var _0x10154c;return db[_0x50bb('0x2e')]['findOne']({'where':{'id':_0x244b60[_0x50bb('0x48')]['id']}})[_0x50bb('0x24')](handleEntityNotFound(_0x378aa7,null))[_0x50bb('0x24')](function(_0x343295){if(_0x343295){_0x354e69=_0x343295;_0xae319b[_0x50bb('0x30')]=_[_0x50bb('0x31')](db['User']['rawAttributes']);_0xae319b[_0x50bb('0x32')]=_['keys'](_0x244b60[_0x50bb('0x32')]);_0xae319b[_0x50bb('0x3b')]=_[_0x50bb('0x33')](_0xae319b[_0x50bb('0x30')],_0xae319b[_0x50bb('0x32')]);_0x488d1f[_0x50bb('0x34')]=_[_0x50bb('0x33')](_0xae319b[_0x50bb('0x30')],qs[_0x50bb('0x35')](_0x244b60[_0x50bb('0x32')][_0x50bb('0x35')]));_0x488d1f[_0x50bb('0x34')]=_0x488d1f[_0x50bb('0x34')][_0x50bb('0x49')]?_0x488d1f[_0x50bb('0x34')]:_0xae319b['model'];_0x488d1f['order']=qs[_0x50bb('0x3a')](_0x244b60[_0x50bb('0x32')][_0x50bb('0x3a')]);_0x488d1f[_0x50bb('0x3e')]=qs['filters'](_['pick'](_0x244b60[_0x50bb('0x32')],_0xae319b[_0x50bb('0x3b')]));if(_0x244b60[_0x50bb('0x32')][_0x50bb('0x3d')]){_0x488d1f[_0x50bb('0x3e')]=_[_0x50bb('0x3f')](_0x488d1f[_0x50bb('0x3e')],{'$or':_['map'](_0x488d1f['attributes'],function(_0x55354f){var _0x2f485f={};_0x2f485f[_0x55354f]={'$like':'%'+_0x244b60[_0x50bb('0x32')][_0x50bb('0x3d')]+'%'};return _0x2f485f;})});}_0x488d1f=_[_0x50bb('0x3f')]({},_0x488d1f,_0x244b60['options']);return _0x354e69[_0x50bb('0x8b')](_0x488d1f);}})[_0x50bb('0x24')](function(_0x3de6ea){if(_0x3de6ea){_0x10154c=_0x3de6ea['length'];if(!_0x244b60[_0x50bb('0x32')][_0x50bb('0x36')](_0x50bb('0x37'))){_0x488d1f[_0x50bb('0x1e')]=qs['limit'](_0x244b60[_0x50bb('0x32')][_0x50bb('0x1e')]);_0x488d1f['offset']=qs[_0x50bb('0x38')](_0x244b60['query'][_0x50bb('0x38')]);}return _0x354e69[_0x50bb('0x8b')](_0x488d1f);}})[_0x50bb('0x24')](function(_0x259c3d){if(_0x259c3d){return _0x259c3d?{'count':_0x10154c,'rows':_0x259c3d}:null;}})[_0x50bb('0x24')](respondWithResult(_0x378aa7,null))[_0x50bb('0x46')](handleError(_0x378aa7,null));}; \ No newline at end of file +var _0x9861=['attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','type','key','VIRTUAL','options','includeAll','include','CmList','rows','catch','show','params','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','describe','addDisposition','ListId','getDispositions','findOne','order','map','Disposition','removeDispositions','ids','addContacts','tags','isArray','join','push','each','omit','success','dataValues','errors','message','getContacts','CmCustomField','CmContact','concat','CustomFields','cf_%d','raw','getContactsCsv','format','writeFileSync','/tmp/list_%d_%s.csv','list_%d_%s.csv','setHeader','text/csv','download','sendStatus','addCustomField','sequelize','transaction','addCustomFields','Sequelize','text','number','switch','BOOLEAN','queryInterface','addColumn','getCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','Lists','UserProfileResource','error','name','index','rawAttributes','model','keys','query'];(function(_0x32cafa,_0x4afaf1){var _0x346be4=function(_0xc0cfa9){while(--_0xc0cfa9){_0x32cafa['push'](_0x32cafa['shift']());}};_0x346be4(++_0x4afaf1);}(_0x9861,0x176));var _0x1986=function(_0x26cbe3,_0x55691f){_0x26cbe3=_0x26cbe3-0x0;var _0x465b4d=_0x9861[_0x26cbe3];return _0x465b4d;};'use strict';var pdf=require(_0x1986('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1986('0x1'));var jsonpatch=require(_0x1986('0x2'));var rp=require(_0x1986('0x3'));var moment=require(_0x1986('0x4'));var BPromise=require(_0x1986('0x5'));var Mustache=require(_0x1986('0x6'));var util=require('util');var path=require(_0x1986('0x7'));var sox=require(_0x1986('0x8'));var csv=require(_0x1986('0x9'));var ejs=require(_0x1986('0xa'));var fs=require('fs');var _=require(_0x1986('0xb'));var squel=require(_0x1986('0xc'));var crypto=require(_0x1986('0xd'));var jsforce=require(_0x1986('0xe'));var deskjs=require(_0x1986('0xf'));var toCsv=require(_0x1986('0x9'));var querystring=require('querystring');var Papa=require(_0x1986('0x10'));var Redis=require(_0x1986('0x11'));var authService=require(_0x1986('0x12'));var qs=require(_0x1986('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1986('0x14'))(_0x1986('0x15'));var utils=require('../../config/utils');var config=require(_0x1986('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x1986('0x17')](config[_0x1986('0x18')],{'host':_0x1986('0x19'),'port':0x18eb});var socket=require(_0x1986('0x1a'))(new Redis(config[_0x1986('0x18')]));require(_0x1986('0x1b'))[_0x1986('0x1c')](socket);function respondWithStatusCode(_0x448717,_0x455e47){_0x455e47=_0x455e47||0xcc;return function(_0x3a8cca){if(_0x3a8cca){return _0x448717['sendStatus'](_0x455e47);}return _0x448717['status'](_0x455e47)[_0x1986('0x1d')]();};}function respondWithResult(_0x3d0207,_0x59228f){_0x59228f=_0x59228f||0xc8;return function(_0x3b4244){if(_0x3b4244){return _0x3d0207[_0x1986('0x1e')](_0x59228f)[_0x1986('0x1f')](_0x3b4244);}};}function respondWithFilteredResult(_0x462f14,_0x306a43){return function(_0x44fcf1){if(_0x44fcf1){var _0x386fc4=_0x44fcf1[_0x1986('0x20')],_0x15f7b9=_0x306a43[_0x1986('0x21')],_0x3b2715=_0x306a43[_0x1986('0x21')]+_0x306a43[_0x1986('0x22')],_0x7dec68;if(_0x3b2715>=_0x386fc4){_0x3b2715=_0x386fc4;_0x7dec68=0xc8;}else{_0x7dec68=0xce;}_0x462f14['status'](_0x7dec68);return _0x462f14[_0x1986('0x23')](_0x1986('0x24'),_0x15f7b9+'-'+_0x3b2715+'/'+_0x386fc4)['json'](_0x44fcf1);}return null;};}function patchUpdates(_0x3ab28e){return function(_0x693eb2){try{jsonpatch['apply'](_0x693eb2,_0x3ab28e,!![]);}catch(_0x569efa){return BPromise[_0x1986('0x25')](_0x569efa);}return _0x693eb2[_0x1986('0x26')]();};}function saveUpdates(_0x1450d5,_0x530aa1){return function(_0x3c7471){if(_0x3c7471){return _0x3c7471[_0x1986('0x27')](_0x1450d5)[_0x1986('0x28')](function(_0x4f6964){return _0x4f6964;});}return null;};}function removeEntity(_0x2e9bc9,_0xbde8e2){return function(_0x281989){if(_0x281989){return _0x281989[_0x1986('0x29')]()[_0x1986('0x28')](function(){var _0x502488=_0x281989[_0x1986('0x2a')]({'plain':!![]});var _0x518f3c=_0x1986('0x2b');return db[_0x1986('0x2c')]['destroy']({'where':{'type':_0x518f3c,'resourceId':_0x502488['id']}})[_0x1986('0x28')](function(){return _0x281989;});})[_0x1986('0x28')](function(){_0x2e9bc9[_0x1986('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e09d6,_0x20d5d6){return function(_0x3cff81){if(!_0x3cff81){_0x5e09d6['sendStatus'](0x194);}return _0x3cff81;};}function handleError(_0x2ff2c9,_0x1eb9b0){_0x1eb9b0=_0x1eb9b0||0x1f4;return function(_0x1dcd2c){logger[_0x1986('0x2d')](_0x1dcd2c['stack']);if(_0x1dcd2c[_0x1986('0x2e')]){delete _0x1dcd2c[_0x1986('0x2e')];}_0x2ff2c9[_0x1986('0x1e')](_0x1eb9b0)['send'](_0x1dcd2c);};}exports[_0x1986('0x2f')]=function(_0x10090c,_0x435218){var _0x13230a={},_0x260449={},_0x27911e={'count':0x0,'rows':[]};var _0x45e90c=db['CmList'][_0x1986('0x30')];_0x260449[_0x1986('0x31')]=_[_0x1986('0x32')](_0x45e90c);_0x260449['query']=_[_0x1986('0x32')](_0x10090c[_0x1986('0x33')]);_0x260449['filters']=_['intersection'](_0x260449[_0x1986('0x31')],_0x260449[_0x1986('0x33')]);_0x13230a[_0x1986('0x34')]=_[_0x1986('0x35')](_0x260449['model'],qs['fields'](_0x10090c[_0x1986('0x33')][_0x1986('0x36')]));_0x13230a['attributes']=_0x13230a['attributes'][_0x1986('0x37')]?_0x13230a[_0x1986('0x34')]:_0x260449['model'];if(!_0x10090c[_0x1986('0x33')][_0x1986('0x38')](_0x1986('0x39'))){_0x13230a[_0x1986('0x22')]=qs['limit'](_0x10090c[_0x1986('0x33')][_0x1986('0x22')]);_0x13230a[_0x1986('0x21')]=qs['offset'](_0x10090c['query'][_0x1986('0x21')]);}_0x13230a['order']=qs[_0x1986('0x3a')](_0x10090c[_0x1986('0x33')][_0x1986('0x3a')]);_0x13230a[_0x1986('0x3b')]=qs['filters'](_[_0x1986('0x3c')](_0x10090c[_0x1986('0x33')],_0x260449[_0x1986('0x3d')]));if(_0x10090c[_0x1986('0x33')][_0x1986('0x3e')]){_0x13230a[_0x1986('0x3b')]=_[_0x1986('0x3f')](_0x13230a[_0x1986('0x3b')],{'$or':_['map'](_0x45e90c,function(_0x406b06){if(_0x406b06[_0x1986('0x40')][_0x1986('0x41')]!==_0x1986('0x42')){var _0x296fea={};_0x296fea[_0x406b06['field']]={'$like':'%'+_0x10090c[_0x1986('0x33')]['filter']+'%'};return _0x296fea;}})});}_0x13230a=_['merge']({},_0x13230a,_0x10090c[_0x1986('0x43')]);var _0x4fb83c={'where':_0x13230a[_0x1986('0x3b')]};return db['CmList']['count'](_0x4fb83c)['then'](function(_0x324fde){_0x27911e[_0x1986('0x20')]=_0x324fde;if(_0x10090c[_0x1986('0x33')][_0x1986('0x44')]){_0x13230a[_0x1986('0x45')]=[{'all':!![]}];}return db[_0x1986('0x46')]['findAll'](_0x13230a);})[_0x1986('0x28')](function(_0x86a596){_0x27911e[_0x1986('0x47')]=_0x86a596;return _0x27911e;})['then'](respondWithFilteredResult(_0x435218,_0x13230a))[_0x1986('0x48')](handleError(_0x435218,null));};exports[_0x1986('0x49')]=function(_0x43b430,_0xbb3f86){var _0x2714f2={'raw':![],'where':{'id':_0x43b430[_0x1986('0x4a')]['id']}},_0x5b7c8b={};_0x5b7c8b[_0x1986('0x31')]=_['keys'](db['CmList'][_0x1986('0x30')]);_0x5b7c8b[_0x1986('0x33')]=_[_0x1986('0x32')](_0x43b430[_0x1986('0x33')]);_0x5b7c8b[_0x1986('0x3d')]=_[_0x1986('0x35')](_0x5b7c8b[_0x1986('0x31')],_0x5b7c8b[_0x1986('0x33')]);_0x2714f2[_0x1986('0x34')]=_[_0x1986('0x35')](_0x5b7c8b['model'],qs['fields'](_0x43b430[_0x1986('0x33')][_0x1986('0x36')]));_0x2714f2[_0x1986('0x34')]=_0x2714f2[_0x1986('0x34')]['length']?_0x2714f2['attributes']:_0x5b7c8b[_0x1986('0x31')];if(_0x43b430['query'][_0x1986('0x44')]){_0x2714f2[_0x1986('0x45')]=[{'all':!![]}];}_0x2714f2=_[_0x1986('0x3f')]({},_0x2714f2,_0x43b430[_0x1986('0x43')]);return db[_0x1986('0x46')][_0x1986('0x4b')](_0x2714f2)[_0x1986('0x28')](handleEntityNotFound(_0xbb3f86,null))['then'](respondWithResult(_0xbb3f86,null))[_0x1986('0x48')](handleError(_0xbb3f86,null));};exports[_0x1986('0x4c')]=function(_0x28bc40,_0xed9c09){return db[_0x1986('0x46')][_0x1986('0x4c')](_0x28bc40[_0x1986('0x4d')],{})[_0x1986('0x28')](function(_0x182ac9){var _0x360abe=_0x28bc40[_0x1986('0x4e')][_0x1986('0x2a')]({'plain':!![]});if(!_0x360abe)throw new Error(_0x1986('0x4f'));if(_0x360abe[_0x1986('0x50')]===_0x1986('0x4e')){var _0x43c9d9=_0x182ac9[_0x1986('0x2a')]({'plain':!![]});var _0x20d6e4='Lists';return db[_0x1986('0x51')]['find']({'where':{'name':_0x20d6e4,'userProfileId':_0x360abe[_0x1986('0x52')]},'raw':!![]})[_0x1986('0x28')](function(_0x18091b){if(_0x18091b&&_0x18091b[_0x1986('0x53')]===0x0){return db[_0x1986('0x2c')][_0x1986('0x4c')]({'name':_0x43c9d9[_0x1986('0x2e')],'resourceId':_0x43c9d9['id'],'type':_0x18091b[_0x1986('0x2e')],'sectionId':_0x18091b['id']},{})[_0x1986('0x28')](function(){return _0x182ac9;});}else{return _0x182ac9;}})[_0x1986('0x48')](function(_0x375db9){logger['error'](_0x1986('0x54'),_0x375db9);throw _0x375db9;});}return _0x182ac9;})['then'](respondWithResult(_0xed9c09,0xc9))[_0x1986('0x48')](handleError(_0xed9c09,null));};exports['update']=function(_0x1b113b,_0x2a88dd){if(_0x1b113b[_0x1986('0x4d')]['id']){delete _0x1b113b['body']['id'];}return db[_0x1986('0x46')][_0x1986('0x4b')]({'where':{'id':_0x1b113b[_0x1986('0x4a')]['id']}})[_0x1986('0x28')](handleEntityNotFound(_0x2a88dd,null))[_0x1986('0x28')](saveUpdates(_0x1b113b['body'],null))[_0x1986('0x28')](respondWithResult(_0x2a88dd,null))[_0x1986('0x48')](handleError(_0x2a88dd,null));};exports[_0x1986('0x29')]=function(_0x121aa5,_0x3dd6d5){return db['CmList'][_0x1986('0x4b')]({'where':{'id':_0x121aa5[_0x1986('0x4a')]['id']}})[_0x1986('0x28')](handleEntityNotFound(_0x3dd6d5,null))[_0x1986('0x28')](removeEntity(_0x3dd6d5,null))[_0x1986('0x48')](handleError(_0x3dd6d5,null));};exports['describe']=function(_0x268cc,_0x595a76){return db[_0x1986('0x46')][_0x1986('0x55')]()[_0x1986('0x28')](respondWithResult(_0x595a76,null))['catch'](handleError(_0x595a76,null));};exports[_0x1986('0x56')]=function(_0x39666d,_0x28fd21,_0x40bb09){if(_0x39666d[_0x1986('0x4d')]['id']){delete _0x39666d['body']['id'];}return db[_0x1986('0x46')][_0x1986('0x4b')]({'where':{'id':_0x39666d[_0x1986('0x4a')]['id']}})[_0x1986('0x28')](handleEntityNotFound(_0x28fd21,null))['then'](function(_0x2f52d8){if(_0x2f52d8){_0x39666d[_0x1986('0x4d')][_0x1986('0x57')]=_0x2f52d8['id'];return db['Disposition'][_0x1986('0x4c')](_0x39666d[_0x1986('0x4d')]);}})[_0x1986('0x28')](respondWithResult(_0x28fd21,null))['catch'](handleError(_0x28fd21,null));};exports[_0x1986('0x58')]=function(_0x3a4eae,_0x177572,_0x46baad){var _0x542a32={'raw':![],'where':{}};var _0x2ebe4b={};var _0x47d90f={'count':0x0,'rows':[]};return db[_0x1986('0x46')][_0x1986('0x59')]({'where':{'id':_0x3a4eae[_0x1986('0x4a')]['id']}})['then'](handleEntityNotFound(_0x177572,null))['then'](function(_0x48123b){if(_0x48123b){_0x2ebe4b[_0x1986('0x31')]=_[_0x1986('0x32')](db['Disposition'][_0x1986('0x30')]);_0x2ebe4b[_0x1986('0x33')]=_[_0x1986('0x32')](_0x3a4eae['query']);_0x2ebe4b[_0x1986('0x3d')]=_['intersection'](_0x2ebe4b[_0x1986('0x31')],_0x2ebe4b['query']);_0x542a32['attributes']=_['intersection'](_0x2ebe4b[_0x1986('0x31')],qs[_0x1986('0x36')](_0x3a4eae[_0x1986('0x33')][_0x1986('0x36')]));_0x542a32[_0x1986('0x34')]=_0x542a32[_0x1986('0x34')][_0x1986('0x37')]?_0x542a32[_0x1986('0x34')]:_0x2ebe4b['model'];if(!_0x3a4eae[_0x1986('0x33')][_0x1986('0x38')]('nolimit')){_0x542a32[_0x1986('0x22')]=qs[_0x1986('0x22')](_0x3a4eae['query'][_0x1986('0x22')]);_0x542a32[_0x1986('0x21')]=qs[_0x1986('0x21')](_0x3a4eae['query'][_0x1986('0x21')]);}_0x542a32[_0x1986('0x5a')]=qs[_0x1986('0x3a')](_0x3a4eae[_0x1986('0x33')]['sort']);_0x542a32[_0x1986('0x3b')]=qs[_0x1986('0x3d')](_[_0x1986('0x3c')](_0x3a4eae['query'],_0x2ebe4b[_0x1986('0x3d')]));_0x542a32[_0x1986('0x3b')]['ListId']=_0x48123b['id'];if(_0x3a4eae['query'][_0x1986('0x3e')]){_0x542a32[_0x1986('0x3b')]=_[_0x1986('0x3f')](_0x542a32[_0x1986('0x3b')],{'$or':_[_0x1986('0x5b')](_0x542a32[_0x1986('0x34')],function(_0x218bc2){var _0x47fc83={};_0x47fc83[_0x218bc2]={'$like':'%'+_0x3a4eae[_0x1986('0x33')][_0x1986('0x3e')]+'%'};return _0x47fc83;})});}_0x542a32=_['merge']({},_0x542a32,_0x3a4eae[_0x1986('0x43')]);return db[_0x1986('0x5c')][_0x1986('0x20')]({'where':_0x542a32[_0x1986('0x3b')]})[_0x1986('0x28')](function(_0xd1ce9d){_0x47d90f[_0x1986('0x20')]=_0xd1ce9d;if(_0x3a4eae[_0x1986('0x33')]['includeAll']){_0x542a32[_0x1986('0x45')]=[{'all':!![]}];}return db[_0x1986('0x5c')]['findAll'](_0x542a32);})[_0x1986('0x28')](function(_0x56f2ad){_0x47d90f[_0x1986('0x47')]=_0x56f2ad;return _0x47d90f;});}})['then'](respondWithFilteredResult(_0x177572,_0x542a32))[_0x1986('0x48')](handleError(_0x177572,null));};exports[_0x1986('0x5d')]=function(_0xb73fe4,_0x525e18,_0x3901f4){return db[_0x1986('0x46')]['find']({'where':{'id':_0xb73fe4['params']['id']}})['then'](handleEntityNotFound(_0x525e18,null))[_0x1986('0x28')](function(_0x47efd3){if(_0x47efd3){return _0x47efd3['removeDispositions'](_0xb73fe4[_0x1986('0x33')][_0x1986('0x5e')]);}})[_0x1986('0x28')](respondWithStatusCode(_0x525e18,null))[_0x1986('0x48')](handleError(_0x525e18,null));};exports[_0x1986('0x5f')]=function(_0xb9db88,_0x209a2b,_0x3777e1){return db[_0x1986('0x46')][_0x1986('0x4b')]({'where':{'id':_0xb9db88[_0x1986('0x4a')]['id']}})[_0x1986('0x28')](handleEntityNotFound(_0x209a2b,null))[_0x1986('0x28')](function(_0x5cb9eb){if(_0x5cb9eb){var _0x3d078e=[];var _0x4a2ed3={'success':[],'errors':[]};return db['CmContact'][_0x1986('0x55')]()[_0x1986('0x28')](function(_0x5d2954){if(_0xb9db88[_0x1986('0x4d')][_0x1986('0x60')]&&_[_0x1986('0x61')](_0xb9db88[_0x1986('0x4d')][_0x1986('0x60')])){if(_0xb9db88[_0x1986('0x4d')]['tags'][_0x1986('0x37')]){_0xb9db88['body']['tags']=_0xb9db88[_0x1986('0x4d')][_0x1986('0x60')][_0x1986('0x62')](';')+';';}else{_0xb9db88[_0x1986('0x4d')][_0x1986('0x60')]=null;}}else{_0xb9db88[_0x1986('0x4d')]['tags']=null;}if(_0xb9db88[_0x1986('0x4d')]&&_[_0x1986('0x61')](_0xb9db88[_0x1986('0x4d')])){for(var _0x5b0f43=0x0;_0x5b0f43<_0xb9db88[_0x1986('0x4d')][_0x1986('0x37')];_0x5b0f43+=0x1){_0xb9db88[_0x1986('0x4d')][_0x5b0f43][_0x1986('0x57')]=_0xb9db88[_0x1986('0x4a')]['id'];_0x3d078e[_0x1986('0x63')](_0xb9db88[_0x1986('0x4d')][_0x5b0f43]);}return BPromise[_0x1986('0x64')](_0x3d078e,function(_0x3ee71a){return db['CmContact'][_0x1986('0x4c')](_[_0x1986('0x65')](_0x3ee71a,[_0x1986('0x5e'),'id'])||{},{'fields':_['keys'](_0x5d2954),'raw':!![]})[_0x1986('0x28')](function(_0x39e65c){_0x4a2ed3[_0x1986('0x66')][_0x1986('0x63')](_0x39e65c[_0x1986('0x67')]);})[_0x1986('0x48')](function(_0x2732c4){_0x4a2ed3[_0x1986('0x68')][_0x1986('0x63')]({'data':_0x3ee71a,'error':_0x2732c4[_0x1986('0x69')]});});})[_0x1986('0x28')](function(_0x1d74b7){return _0x4a2ed3;})[_0x1986('0x48')](function(_0x377b38){return _0x377b38;});}else{_0x209a2b['status'](0x190)[_0x1986('0x1f')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x1986('0x28')](respondWithResult(_0x209a2b,null))['catch'](handleError(_0x209a2b,null));};exports[_0x1986('0x6a')]=function(_0x4d2296,_0x4bb9b0,_0x3f4151){var _0x1ab232;return db[_0x1986('0x46')][_0x1986('0x4b')]({'where':{'id':_0x4d2296[_0x1986('0x4a')]['id']},'include':[{'model':db[_0x1986('0x6b')],'as':'CustomFields'}]})[_0x1986('0x28')](handleEntityNotFound(_0x4bb9b0,null))[_0x1986('0x28')](function(_0x31774b){if(_0x31774b){_0x1ab232=_0x31774b;return db[_0x1986('0x6c')][_0x1986('0x30')];}})[_0x1986('0x28')](function(_0x2bce05){if(_0x2bce05){var _0x2f8b3f={};var _0x1e5df4={};_0x1e5df4[_0x1986('0x31')]=_[_0x1986('0x6d')](_[_0x1986('0x32')](_0x2bce05),_['map'](_0x1ab232[_0x1986('0x6e')],function(_0x32b197){return util['format'](_0x1986('0x6f'),_0x32b197['id']);}));_0x1e5df4[_0x1986('0x33')]=_[_0x1986('0x32')](_0x4d2296[_0x1986('0x33')]);_0x1e5df4[_0x1986('0x3d')]=_[_0x1986('0x35')](_0x1e5df4[_0x1986('0x31')],_0x1e5df4[_0x1986('0x33')]);_0x2f8b3f[_0x1986('0x34')]=_[_0x1986('0x35')](_0x1e5df4[_0x1986('0x31')],qs['fields'](_0x4d2296['query'][_0x1986('0x36')]));_0x2f8b3f[_0x1986('0x34')]=_0x2f8b3f[_0x1986('0x34')]['length']?_0x2f8b3f[_0x1986('0x34')]:_0x1e5df4['model'];if(!_0x4d2296[_0x1986('0x33')][_0x1986('0x38')](_0x1986('0x39'))){_0x2f8b3f[_0x1986('0x22')]=qs['limit'](_0x4d2296[_0x1986('0x33')][_0x1986('0x22')]);_0x2f8b3f[_0x1986('0x21')]=qs['offset'](_0x4d2296[_0x1986('0x33')][_0x1986('0x21')]);}_0x2f8b3f[_0x1986('0x5a')]=qs[_0x1986('0x3a')](_0x4d2296[_0x1986('0x33')][_0x1986('0x3a')]);_0x2f8b3f[_0x1986('0x3b')]=qs[_0x1986('0x3d')](_[_0x1986('0x3c')](_0x4d2296['query'],_0x1e5df4[_0x1986('0x3d')]));_0x2f8b3f[_0x1986('0x70')]=!![];if(_0x4d2296[_0x1986('0x33')][_0x1986('0x3e')]){_0x2f8b3f[_0x1986('0x3b')]=_[_0x1986('0x3f')](_0x2f8b3f[_0x1986('0x3b')],{'$or':_['map'](_0x2f8b3f[_0x1986('0x34')],function(_0x1a6850){var _0x1bcae6={};_0x1bcae6[_0x1a6850]={'$like':'%'+_0x4d2296['query'][_0x1986('0x3e')]+'%'};return _0x1bcae6;})});}_0x2f8b3f=_[_0x1986('0x3f')]({},_0x2f8b3f,_0x4d2296[_0x1986('0x43')]);return _0x1ab232[_0x1986('0x6a')](_0x2f8b3f);}})[_0x1986('0x28')](respondWithResult(_0x4bb9b0,null))[_0x1986('0x48')](handleError(_0x4bb9b0,null));};exports[_0x1986('0x71')]=function(_0x1d7bb4,_0x447e88,_0x52264c){var _0x12e2ba;return db[_0x1986('0x46')][_0x1986('0x4b')]({'where':{'id':_0x1d7bb4['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x1986('0x6e')}]})[_0x1986('0x28')](handleEntityNotFound(_0x447e88,null))['then'](function(_0x1adfc1){if(_0x1adfc1){_0x12e2ba=_0x1adfc1;return db[_0x1986('0x6c')][_0x1986('0x30')];}})[_0x1986('0x28')](function(_0x5a9acf){if(_0x5a9acf){var _0x50d101={};var _0x4d9f95={};_0x4d9f95['model']=_['concat'](_[_0x1986('0x32')](_0x5a9acf),_[_0x1986('0x5b')](_0x12e2ba[_0x1986('0x6e')],function(_0x5ee56f){return util[_0x1986('0x72')](_0x1986('0x6f'),_0x5ee56f['id']);}));_0x4d9f95[_0x1986('0x33')]=_['keys'](_0x1d7bb4[_0x1986('0x33')]);_0x4d9f95[_0x1986('0x3d')]=_[_0x1986('0x35')](_0x4d9f95['model'],_0x4d9f95[_0x1986('0x33')]);_0x50d101[_0x1986('0x34')]=_[_0x1986('0x35')](_0x4d9f95[_0x1986('0x31')],qs[_0x1986('0x36')](_0x1d7bb4[_0x1986('0x33')]['fields']));_0x50d101['attributes']=_0x50d101['attributes']['length']?_0x50d101['attributes']:_0x4d9f95['model'];if(!_0x1d7bb4[_0x1986('0x33')][_0x1986('0x38')](_0x1986('0x39'))){_0x50d101[_0x1986('0x22')]=qs['limit'](_0x1d7bb4[_0x1986('0x33')][_0x1986('0x22')]);_0x50d101[_0x1986('0x21')]=qs[_0x1986('0x21')](_0x1d7bb4[_0x1986('0x33')][_0x1986('0x21')]);}_0x50d101[_0x1986('0x5a')]=qs[_0x1986('0x3a')](_0x1d7bb4['query'][_0x1986('0x3a')]);_0x50d101[_0x1986('0x3b')]=qs[_0x1986('0x3d')](_[_0x1986('0x3c')](_0x1d7bb4[_0x1986('0x33')],_0x4d9f95['filters']));_0x50d101[_0x1986('0x70')]=!![];if(_0x1d7bb4[_0x1986('0x33')]['filter']){_0x50d101[_0x1986('0x3b')]=_['merge'](_0x50d101[_0x1986('0x3b')],{'$or':_[_0x1986('0x5b')](_0x50d101['attributes'],function(_0x4ab0cf){var _0x5e50a3={};_0x5e50a3[_0x4ab0cf]={'$like':'%'+_0x1d7bb4['query'][_0x1986('0x3e')]+'%'};return _0x5e50a3;})});}_0x50d101=_[_0x1986('0x3f')]({},_0x50d101,_0x1d7bb4[_0x1986('0x43')]);return _0x12e2ba[_0x1986('0x6a')](_0x50d101);}})[_0x1986('0x28')](function(_0x81c10d){if(!_['isEmpty'](_0x81c10d)){var _0x5c471f=toCsv(_0x81c10d);var _0x1e3117=Date['now']();fs[_0x1986('0x73')](util[_0x1986('0x72')](_0x1986('0x74'),_0x12e2ba['id'],_0x1e3117),_0x5c471f);_0x447e88['setHeader']('Content-disposition','attachment;\x20filename='+util[_0x1986('0x72')](_0x1986('0x75'),_0x12e2ba['id'],_0x1e3117));_0x447e88[_0x1986('0x76')]('Content-type',_0x1986('0x77'));return _0x447e88[_0x1986('0x78')](util[_0x1986('0x72')]('/tmp/list_%d_%s.csv',_0x12e2ba['id'],_0x1e3117));}else{return _0x447e88[_0x1986('0x79')](0xcc);}})[_0x1986('0x48')](handleError(_0x447e88,null));};exports[_0x1986('0x7a')]=function(_0x3cf01f,_0x373214,_0x2e62f8){var _0x43e54f;delete _0x3cf01f[_0x1986('0x4d')]['id'];return db[_0x1986('0x46')][_0x1986('0x59')]({'where':{'id':_0x3cf01f[_0x1986('0x4a')]['id']}})[_0x1986('0x28')](handleEntityNotFound(_0x373214,null))['then'](function(_0x8f7da5){if(_0x8f7da5){return db[_0x1986('0x7b')][_0x1986('0x7c')](function(_0x113869){return db[_0x1986('0x6b')][_0x1986('0x4c')](_0x3cf01f[_0x1986('0x4d')],{'transaction':_0x113869})[_0x1986('0x28')](function(_0x12c166){_0x43e54f=_0x12c166;return _0x8f7da5[_0x1986('0x7d')](_0x12c166,{'transaction':_0x113869});})[_0x1986('0x28')](function(){var _0x3c7164={'type':db[_0x1986('0x7e')]['TEXT'],'transaction':_0x113869};switch(_0x3cf01f[_0x1986('0x4d')][_0x1986('0x40')]){case _0x1986('0x7f'):_0x3c7164[_0x1986('0x40')]=db[_0x1986('0x7e')]['TEXT'];break;case _0x1986('0x80'):_0x3c7164[_0x1986('0x40')]=db[_0x1986('0x7e')]['INTEGER'];break;case _0x1986('0x81'):_0x3c7164[_0x1986('0x40')]=db[_0x1986('0x7e')][_0x1986('0x82')];_0x3c7164['defaultValue']=![];break;default:}return db['sequelize'][_0x1986('0x83')][_0x1986('0x84')]('cm_contacts',util[_0x1986('0x72')]('cf_%s',_0x43e54f['id']),_0x3c7164);})['then'](function(){return _0x43e54f;});});}})[_0x1986('0x28')](respondWithResult(_0x373214,null))['catch'](handleError(_0x373214,null));};exports[_0x1986('0x85')]=function(_0x13aaf0,_0x19ac77,_0x5d4c0e){var _0x48373e={};var _0x11b444={};var _0x2bd231;var _0x2a7667;return db[_0x1986('0x46')][_0x1986('0x59')]({'where':{'id':_0x13aaf0[_0x1986('0x4a')]['id']}})[_0x1986('0x28')](handleEntityNotFound(_0x19ac77,null))[_0x1986('0x28')](function(_0x40c5a6){if(_0x40c5a6){_0x2bd231=_0x40c5a6;_0x11b444[_0x1986('0x31')]=_[_0x1986('0x32')](db[_0x1986('0x6b')]['rawAttributes']);_0x11b444[_0x1986('0x33')]=_[_0x1986('0x32')](_0x13aaf0[_0x1986('0x33')]);_0x11b444[_0x1986('0x3d')]=_['intersection'](_0x11b444[_0x1986('0x31')],_0x11b444['query']);_0x48373e[_0x1986('0x34')]=_[_0x1986('0x35')](_0x11b444['model'],qs['fields'](_0x13aaf0['query']['fields']));_0x48373e[_0x1986('0x34')]=_0x48373e[_0x1986('0x34')][_0x1986('0x37')]?_0x48373e[_0x1986('0x34')]:_0x11b444['model'];_0x48373e[_0x1986('0x5a')]=qs[_0x1986('0x3a')](_0x13aaf0[_0x1986('0x33')][_0x1986('0x3a')]);_0x48373e[_0x1986('0x3b')]=qs[_0x1986('0x3d')](_['pick'](_0x13aaf0['query'],_0x11b444[_0x1986('0x3d')]));_0x48373e[_0x1986('0x3b')]=_[_0x1986('0x3f')](_0x48373e['where'],{'$or':[{'ListId':_0x40c5a6['id']},{'ListId':null}]});if(_0x13aaf0[_0x1986('0x33')][_0x1986('0x3e')]){_0x48373e[_0x1986('0x3b')]=_[_0x1986('0x3f')](_0x48373e[_0x1986('0x3b')],{'$or':_[_0x1986('0x5b')](_0x48373e['attributes'],function(_0x36c08f){var _0x2a9223={};_0x2a9223[_0x36c08f]={'$like':'%'+_0x13aaf0[_0x1986('0x33')][_0x1986('0x3e')]+'%'};return _0x2a9223;})});}_0x48373e=_[_0x1986('0x3f')]({},_0x48373e,_0x13aaf0['options']);return db['CmCustomField']['findAndCountAll'](_0x48373e);}})[_0x1986('0x28')](respondWithResult(_0x19ac77,null))[_0x1986('0x48')](handleError(_0x19ac77,null));};exports[_0x1986('0x86')]=function(_0x317ca3,_0x35b3fe,_0x2af479){return db[_0x1986('0x46')]['find']({'where':{'id':_0x317ca3['params']['id']}})[_0x1986('0x28')](handleEntityNotFound(_0x35b3fe,null))['then'](function(_0x45ff8a){if(_0x45ff8a){return _0x45ff8a[_0x1986('0x86')](_0x317ca3[_0x1986('0x4d')][_0x1986('0x5e')],_[_0x1986('0x65')](_0x317ca3['body'],[_0x1986('0x5e'),'id'])||{})[_0x1986('0x87')](function(_0x389f9a){for(var _0x595039=0x0;_0x595039<_0x317ca3[_0x1986('0x4d')][_0x1986('0x5e')][_0x1986('0x37')];_0x595039+=0x1){socket[_0x1986('0x88')](_0x1986('0x89'),{'UserId':_0x317ca3[_0x1986('0x4d')]['ids'][_0x595039],'CmListId':_0x317ca3['params']['id']});}return _0x389f9a;});}})[_0x1986('0x28')](respondWithResult(_0x35b3fe,null))[_0x1986('0x48')](handleError(_0x35b3fe,null));};exports['removeAgents']=function(_0x235f7f,_0x4e1170,_0x2c996e){return db[_0x1986('0x46')][_0x1986('0x4b')]({'where':{'id':_0x235f7f['params']['id']}})[_0x1986('0x28')](handleEntityNotFound(_0x4e1170,null))[_0x1986('0x28')](function(_0x3eb2a2){if(_0x3eb2a2){return _0x3eb2a2[_0x1986('0x8a')](_0x235f7f[_0x1986('0x33')][_0x1986('0x5e')])['then'](function(){if(_[_0x1986('0x61')](_0x235f7f[_0x1986('0x33')][_0x1986('0x5e')])){for(var _0x230606=0x0;_0x230606<_0x235f7f['query'][_0x1986('0x5e')][_0x1986('0x37')];_0x230606+=0x1){socket['emit'](_0x1986('0x8b'),{'UserId':Number(_0x235f7f[_0x1986('0x33')][_0x1986('0x5e')][_0x230606]),'CmListId':Number(_0x235f7f[_0x1986('0x4a')]['id'])});}}else{socket['emit'](_0x1986('0x8b'),{'UserId':Number(_0x235f7f['query'][_0x1986('0x5e')]),'CmListId':Number(_0x235f7f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4e1170,null))['catch'](handleError(_0x4e1170,null));};exports[_0x1986('0x8c')]=function(_0x5f50a7,_0x37a36a,_0x16100b){var _0x2a2b4d={};var _0x3b88f4={};var _0x219572;var _0x26c6b4;return db[_0x1986('0x46')][_0x1986('0x59')]({'where':{'id':_0x5f50a7[_0x1986('0x4a')]['id']}})[_0x1986('0x28')](handleEntityNotFound(_0x37a36a,null))[_0x1986('0x28')](function(_0x5d523a){if(_0x5d523a){_0x219572=_0x5d523a;_0x3b88f4[_0x1986('0x31')]=_[_0x1986('0x32')](db[_0x1986('0x8d')]['rawAttributes']);_0x3b88f4[_0x1986('0x33')]=_['keys'](_0x5f50a7['query']);_0x3b88f4[_0x1986('0x3d')]=_[_0x1986('0x35')](_0x3b88f4[_0x1986('0x31')],_0x3b88f4[_0x1986('0x33')]);_0x2a2b4d[_0x1986('0x34')]=_[_0x1986('0x35')](_0x3b88f4[_0x1986('0x31')],qs[_0x1986('0x36')](_0x5f50a7[_0x1986('0x33')][_0x1986('0x36')]));_0x2a2b4d['attributes']=_0x2a2b4d[_0x1986('0x34')][_0x1986('0x37')]?_0x2a2b4d[_0x1986('0x34')]:_0x3b88f4[_0x1986('0x31')];_0x2a2b4d[_0x1986('0x5a')]=qs['sort'](_0x5f50a7[_0x1986('0x33')][_0x1986('0x3a')]);_0x2a2b4d[_0x1986('0x3b')]=qs[_0x1986('0x3d')](_[_0x1986('0x3c')](_0x5f50a7[_0x1986('0x33')],_0x3b88f4['filters']));if(_0x5f50a7['query'][_0x1986('0x3e')]){_0x2a2b4d[_0x1986('0x3b')]=_['merge'](_0x2a2b4d[_0x1986('0x3b')],{'$or':_[_0x1986('0x5b')](_0x2a2b4d[_0x1986('0x34')],function(_0x5a1c5e){var _0x260e4a={};_0x260e4a[_0x5a1c5e]={'$like':'%'+_0x5f50a7[_0x1986('0x33')][_0x1986('0x3e')]+'%'};return _0x260e4a;})});}_0x2a2b4d=_[_0x1986('0x3f')]({},_0x2a2b4d,_0x5f50a7[_0x1986('0x43')]);return _0x219572[_0x1986('0x8c')](_0x2a2b4d);}})[_0x1986('0x28')](function(_0x4afd1d){if(_0x4afd1d){_0x26c6b4=_0x4afd1d[_0x1986('0x37')];if(!_0x5f50a7[_0x1986('0x33')][_0x1986('0x38')]('nolimit')){_0x2a2b4d[_0x1986('0x22')]=qs[_0x1986('0x22')](_0x5f50a7[_0x1986('0x33')][_0x1986('0x22')]);_0x2a2b4d[_0x1986('0x21')]=qs[_0x1986('0x21')](_0x5f50a7[_0x1986('0x33')][_0x1986('0x21')]);}return _0x219572[_0x1986('0x8c')](_0x2a2b4d);}})[_0x1986('0x28')](function(_0x17b006){if(_0x17b006){return _0x17b006?{'count':_0x26c6b4,'rows':_0x17b006}:null;}})[_0x1986('0x28')](respondWithResult(_0x37a36a,null))[_0x1986('0x48')](handleError(_0x37a36a,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 5b4223e..801b789 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 _0x1ed4=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x220afa,_0xf5f6cc){var _0x1b79d1=function(_0x178a39){while(--_0x178a39){_0x220afa['push'](_0x220afa['shift']());}};_0x1b79d1(++_0xf5f6cc);}(_0x1ed4,0x130));var _0x41ed=function(_0x5efefd,_0x22fc26){_0x5efefd=_0x5efefd-0x0;var _0x5f0578=_0x1ed4[_0x5efefd];return _0x5f0578;};'use strict';var EventEmitter=require(_0x41ed('0x0'));var CmList=require(_0x41ed('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x41ed('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x41ed('0x3'),'afterDestroy':_0x41ed('0x4')};function emitEvent(_0x21a546){return function(_0x122ddf,_0xccb2b2,_0x4727f6){CmListEvents['emit'](_0x21a546+':'+_0x122ddf['id'],_0x122ddf);CmListEvents[_0x41ed('0x5')](_0x21a546,_0x122ddf);_0x4727f6(null);};}for(var e in events){if(events[_0x41ed('0x6')](e)){var event=events[e];CmList[_0x41ed('0x7')](e,emitEvent(event));}}module[_0x41ed('0x8')]=CmListEvents; \ No newline at end of file +var _0x785f=['emit','hasOwnProperty','hook','events','../../mysqldb','CmList','setMaxListeners','save','update','remove'];(function(_0x6ec0cc,_0x5e0679){var _0x11c159=function(_0x39c471){while(--_0x39c471){_0x6ec0cc['push'](_0x6ec0cc['shift']());}};_0x11c159(++_0x5e0679);}(_0x785f,0x107));var _0xf785=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x785f[_0x4b369d];return _0x571a98;};'use strict';var EventEmitter=require(_0xf785('0x0'));var CmList=require(_0xf785('0x1'))['db'][_0xf785('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xf785('0x3')](0x0);var events={'afterCreate':_0xf785('0x4'),'afterUpdate':_0xf785('0x5'),'afterDestroy':_0xf785('0x6')};function emitEvent(_0x3d49ee){return function(_0x59c3cd,_0x1894da,_0x292e1f){CmListEvents[_0xf785('0x7')](_0x3d49ee+':'+_0x59c3cd['id'],_0x59c3cd);CmListEvents['emit'](_0x3d49ee,_0x59c3cd);_0x292e1f(null);};}for(var e in events){if(events[_0xf785('0x8')](e)){var event=events[e];CmList[_0xf785('0x9')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index d0602d2..c2438c3 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 _0x9e9b=['../../config/environment','exports','define','CmList','cm_lists','lodash','api','moment','bluebird','request-promise','rimraf'];(function(_0x358a0a,_0x4cffea){var _0x41a6ad=function(_0x3f78c0){while(--_0x3f78c0){_0x358a0a['push'](_0x358a0a['shift']());}};_0x41a6ad(++_0x4cffea);}(_0x9e9b,0x1a7));var _0xb9e9=function(_0x1177d5,_0x22b649){_0x1177d5=_0x1177d5-0x0;var _0xc3ddc2=_0x9e9b[_0x1177d5];return _0xc3ddc2;};'use strict';var _=require(_0xb9e9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb9e9('0x1'));var moment=require(_0xb9e9('0x2'));var BPromise=require(_0xb9e9('0x3'));var rp=require(_0xb9e9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb9e9('0x5'));var config=require(_0xb9e9('0x6'));var attributes=require('./cmList.attributes');module[_0xb9e9('0x7')]=function(_0x7b18d5,_0x3e4023){return _0x7b18d5[_0xb9e9('0x8')](_0xb9e9('0x9'),attributes,{'tableName':_0xb9e9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x12c9=['CmList','cm_lists','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmList.attributes','define'];(function(_0xf912a,_0x533423){var _0x348f59=function(_0x2c1aa4){while(--_0x2c1aa4){_0xf912a['push'](_0xf912a['shift']());}};_0x348f59(++_0x533423);}(_0x12c9,0x1c9));var _0x912c=function(_0x177db0,_0x2e1b8c){_0x177db0=_0x177db0-0x0;var _0x4138f6=_0x12c9[_0x177db0];return _0x4138f6;};'use strict';var _=require(_0x912c('0x0'));var util=require(_0x912c('0x1'));var logger=require(_0x912c('0x2'))(_0x912c('0x3'));var moment=require(_0x912c('0x4'));var BPromise=require('bluebird');var rp=require(_0x912c('0x5'));var fs=require('fs');var path=require(_0x912c('0x6'));var rimraf=require(_0x912c('0x7'));var config=require(_0x912c('0x8'));var attributes=require(_0x912c('0x9'));module['exports']=function(_0x584a27,_0xe29019){return _0x584a27[_0x912c('0xa')](_0x912c('0xb'),attributes,{'tableName':_0x912c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index acd163e..80accde 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 _0x5298=['register','request','then','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0x5298,0xcb));var _0x8529=function(_0x48bea3,_0x2f146c){_0x48bea3=_0x48bea3-0x0;var _0xff18f0=_0x5298[_0x48bea3];return _0xff18f0;};'use strict';var _=require(_0x8529('0x0'));var util=require(_0x8529('0x1'));var moment=require(_0x8529('0x2'));var BPromise=require('bluebird');var rs=require(_0x8529('0x3'));var fs=require('fs');var Redis=require(_0x8529('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8529('0x5'))(_0x8529('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8529('0x7')]({'port':0x232a});config[_0x8529('0x8')]=_[_0x8529('0x9')](config[_0x8529('0x8')],{'host':_0x8529('0xa'),'port':0x18eb});var socket=require(_0x8529('0xb'))(new Redis(config[_0x8529('0x8')]));require(_0x8529('0xc'))[_0x8529('0xd')](socket);function respondWithRpcPromise(_0x37d53e,_0x154570,_0x17da33){return new BPromise(function(_0x8771a8,_0x264cea){return client[_0x8529('0xe')](_0x37d53e,_0x17da33)[_0x8529('0xf')](function(_0x1a9320){logger['info'](_0x8529('0x10'),_0x154570,'request\x20sent');logger[_0x8529('0x11')](_0x8529('0x12'),_0x154570,_0x8529('0x13'),JSON['stringify'](_0x1a9320));if(_0x1a9320['error']){if(_0x1a9320['error']['code']===0x1f4){logger[_0x8529('0x14')](_0x8529('0x10'),_0x154570,_0x1a9320[_0x8529('0x14')][_0x8529('0x15')]);return _0x264cea(_0x1a9320[_0x8529('0x14')][_0x8529('0x15')]);}logger['error'](_0x8529('0x10'),_0x154570,_0x1a9320['error']['message']);return _0x8771a8(_0x1a9320['error'][_0x8529('0x15')]);}else{logger['info'](_0x8529('0x10'),_0x154570,_0x8529('0x13'));_0x8771a8(_0x1a9320[_0x8529('0x16')]['message']);}})[_0x8529('0x17')](function(_0x554d6b){logger['error'](_0x8529('0x10'),_0x154570,_0x554d6b);_0x264cea(_0x554d6b);});});} \ No newline at end of file +var _0x9274=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./cmList.socket','register','then','request\x20sent','debug','stringify','error','code','CmList,\x20%s,\x20%s','message','info','catch','util','moment','bluebird','randomstring'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x9274,0x10f));var _0x4927=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9274[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x4927('0x0'));var moment=require(_0x4927('0x1'));var BPromise=require(_0x4927('0x2'));var rs=require(_0x4927('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4927('0x4'))['db'];var utils=require(_0x4927('0x5'));var logger=require('../../config/logger')(_0x4927('0x6'));var config=require(_0x4927('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4927('0x8')][_0x4927('0x9')]({'port':0x232a});config[_0x4927('0xa')]=_[_0x4927('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4927('0xc'))(new Redis(config['redis']));require(_0x4927('0xd'))[_0x4927('0xe')](socket);function respondWithRpcPromise(_0x1bb627,_0x169268,_0x193564){return new BPromise(function(_0x5b689b,_0x24226a){return client['request'](_0x1bb627,_0x193564)[_0x4927('0xf')](function(_0x47f4ea){logger['info']('CmList,\x20%s,\x20%s',_0x169268,_0x4927('0x10'));logger[_0x4927('0x11')]('CmList,\x20%s,\x20%s,\x20%s',_0x169268,_0x4927('0x10'),JSON[_0x4927('0x12')](_0x47f4ea));if(_0x47f4ea[_0x4927('0x13')]){if(_0x47f4ea[_0x4927('0x13')][_0x4927('0x14')]===0x1f4){logger['error'](_0x4927('0x15'),_0x169268,_0x47f4ea[_0x4927('0x13')][_0x4927('0x16')]);return _0x24226a(_0x47f4ea[_0x4927('0x13')][_0x4927('0x16')]);}logger[_0x4927('0x13')](_0x4927('0x15'),_0x169268,_0x47f4ea[_0x4927('0x13')][_0x4927('0x16')]);return _0x5b689b(_0x47f4ea[_0x4927('0x13')][_0x4927('0x16')]);}else{logger[_0x4927('0x17')](_0x4927('0x15'),_0x169268,_0x4927('0x10'));_0x5b689b(_0x47f4ea['result'][_0x4927('0x16')]);}})[_0x4927('0x18')](function(_0x555e2b){logger['error']('CmList,\x20%s,\x20%s',_0x169268,_0x555e2b);_0x24226a(_0x555e2b);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 1b3f791..830a9f3 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 _0xa306=['emit','removeListener','register','length','cmList:','./cmList.events','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa306,0x1cc));var _0x6a30=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xa306[_0x1762b4];return _0x29beda;};'use strict';var CmListEvents=require(_0x6a30('0x0'));var events=['save','remove',_0x6a30('0x1')];function createListener(_0x1b92b0,_0x147b41){return function(_0x24168a){_0x147b41[_0x6a30('0x2')](_0x1b92b0,_0x24168a);};}function removeListener(_0x413fc0,_0x15ddec){return function(){CmListEvents[_0x6a30('0x3')](_0x413fc0,_0x15ddec);};}exports[_0x6a30('0x4')]=function(_0x422c3b){for(var _0x20790c=0x0,_0x2948d1=events[_0x6a30('0x5')];_0x20790c<_0x2948d1;_0x20790c++){var _0xd08184=events[_0x20790c];var _0x51ad88=createListener(_0x6a30('0x6')+_0xd08184,_0x422c3b);CmListEvents['on'](_0xd08184,_0x51ad88);}}; \ No newline at end of file +var _0x0f7f=['register','length','cmList:','save','remove','update'];(function(_0x49553f,_0x4aceca){var _0x50659c=function(_0x4f120c){while(--_0x4f120c){_0x49553f['push'](_0x49553f['shift']());}};_0x50659c(++_0x4aceca);}(_0x0f7f,0xbd));var _0xf0f7=function(_0x45d6f4,_0x21aa4a){_0x45d6f4=_0x45d6f4-0x0;var _0x2c9a3b=_0x0f7f[_0x45d6f4];return _0x2c9a3b;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xf0f7('0x0'),_0xf0f7('0x1'),_0xf0f7('0x2')];function createListener(_0x1202c7,_0x236ae3){return function(_0x17ea64){_0x236ae3['emit'](_0x1202c7,_0x17ea64);};}function removeListener(_0x46c1f6,_0x5a5c49){return function(){CmListEvents['removeListener'](_0x46c1f6,_0x5a5c49);};}exports[_0xf0f7('0x3')]=function(_0xe69f82){for(var _0xa82f7e=0x0,_0x4c5eb1=events[_0xf0f7('0x4')];_0xa82f7e<_0x4c5eb1;_0xa82f7e++){var _0x566e09=events[_0xa82f7e];var _0xdbfb65=createListener(_0xf0f7('0x5')+_0x566e09,_0xe69f82);CmListEvents['on'](_0x566e09,_0xdbfb65);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 2963908..66f097e 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 _0x63ec=['/:id/contacts','getContactsCsv','getCustomFields','/:id/users','getAgents','post','addContacts','/:id/fields','addCustomField','addAgents','put','delete','removeDispositions','removeAgents','multer','path','connect-timeout','express','../../config/environment','./cmList.controller','get','/describe','/:id','isAuthenticated','show','/:id/dispositions','getDispositions'];(function(_0xdd1f1b,_0x4a823f){var _0x3252b1=function(_0x2b87c6){while(--_0x2b87c6){_0xdd1f1b['push'](_0xdd1f1b['shift']());}};_0x3252b1(++_0x4a823f);}(_0x63ec,0x152));var _0xc63e=function(_0x17f35c,_0x4e3ca8){_0x17f35c=_0x17f35c-0x0;var _0x11ee16=_0x63ec[_0x17f35c];return _0x11ee16;};'use strict';var multer=require(_0xc63e('0x0'));var util=require('util');var path=require(_0xc63e('0x1'));var timeout=require(_0xc63e('0x2'));var express=require(_0xc63e('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc63e('0x4'));var controller=require(_0xc63e('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc63e('0x6')](_0xc63e('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0xc63e('0x6')](_0xc63e('0x8'),auth[_0xc63e('0x9')](),controller[_0xc63e('0xa')]);router[_0xc63e('0x6')](_0xc63e('0xb'),auth['isAuthenticated'](),controller[_0xc63e('0xc')]);router['get'](_0xc63e('0xd'),auth[_0xc63e('0x9')](),controller['getContacts']);router[_0xc63e('0x6')]('/:id/contacts/csv',auth[_0xc63e('0x9')](),controller[_0xc63e('0xe')]);router[_0xc63e('0x6')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc63e('0xf')]);router[_0xc63e('0x6')](_0xc63e('0x10'),auth['isAuthenticated'](),controller[_0xc63e('0x11')]);router[_0xc63e('0x12')]('/',auth[_0xc63e('0x9')](),controller['create']);router['post'](_0xc63e('0xb'),auth[_0xc63e('0x9')](),controller['addDisposition']);router[_0xc63e('0x12')](_0xc63e('0xd'),auth[_0xc63e('0x9')](),controller[_0xc63e('0x13')]);router[_0xc63e('0x12')](_0xc63e('0x14'),auth[_0xc63e('0x9')](),controller[_0xc63e('0x15')]);router[_0xc63e('0x12')](_0xc63e('0x10'),auth[_0xc63e('0x9')](),controller[_0xc63e('0x16')]);router[_0xc63e('0x17')](_0xc63e('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xc63e('0x18')](_0xc63e('0x8'),auth[_0xc63e('0x9')](),controller['destroy']);router[_0xc63e('0x18')](_0xc63e('0xb'),auth[_0xc63e('0x9')](),controller[_0xc63e('0x19')]);router['delete']('/:id/users',auth[_0xc63e('0x9')](),controller[_0xc63e('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xcc92=['update','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','getAgents','create','addDisposition','post','addContacts','/:id/fields','addAgents','put','/:id'];(function(_0x33d0aa,_0x1fcdf0){var _0x168ab3=function(_0x1f9983){while(--_0x1f9983){_0x33d0aa['push'](_0x33d0aa['shift']());}};_0x168ab3(++_0x1fcdf0);}(_0xcc92,0x1e6));var _0x2cc9=function(_0x49fcfb,_0x504dec){_0x49fcfb=_0x49fcfb-0x0;var _0x964926=_0xcc92[_0x49fcfb];return _0x964926;};'use strict';var multer=require(_0x2cc9('0x0'));var util=require(_0x2cc9('0x1'));var path=require(_0x2cc9('0x2'));var timeout=require(_0x2cc9('0x3'));var express=require(_0x2cc9('0x4'));var router=express[_0x2cc9('0x5')]();var auth=require(_0x2cc9('0x6'));var interaction=require(_0x2cc9('0x7'));var config=require(_0x2cc9('0x8'));var controller=require(_0x2cc9('0x9'));router[_0x2cc9('0xa')]('/',auth[_0x2cc9('0xb')](),controller[_0x2cc9('0xc')]);router[_0x2cc9('0xa')](_0x2cc9('0xd'),auth[_0x2cc9('0xb')](),controller[_0x2cc9('0xe')]);router['get']('/:id',auth[_0x2cc9('0xb')](),controller[_0x2cc9('0xf')]);router[_0x2cc9('0xa')](_0x2cc9('0x10'),auth[_0x2cc9('0xb')](),controller[_0x2cc9('0x11')]);router['get'](_0x2cc9('0x12'),auth[_0x2cc9('0xb')](),controller['getContacts']);router['get'](_0x2cc9('0x13'),auth[_0x2cc9('0xb')](),controller[_0x2cc9('0x14')]);router['get']('/:id/fields',auth[_0x2cc9('0xb')](),controller[_0x2cc9('0x15')]);router[_0x2cc9('0xa')](_0x2cc9('0x16'),auth[_0x2cc9('0xb')](),controller[_0x2cc9('0x17')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2cc9('0x18')]);router['post'](_0x2cc9('0x10'),auth['isAuthenticated'](),controller[_0x2cc9('0x19')]);router[_0x2cc9('0x1a')](_0x2cc9('0x12'),auth[_0x2cc9('0xb')](),controller[_0x2cc9('0x1b')]);router[_0x2cc9('0x1a')](_0x2cc9('0x1c'),auth[_0x2cc9('0xb')](),controller['addCustomField']);router[_0x2cc9('0x1a')]('/:id/users',auth[_0x2cc9('0xb')](),controller[_0x2cc9('0x1d')]);router[_0x2cc9('0x1e')](_0x2cc9('0x1f'),auth[_0x2cc9('0xb')](),controller[_0x2cc9('0x20')]);router[_0x2cc9('0x21')](_0x2cc9('0x1f'),auth[_0x2cc9('0xb')](),controller['destroy']);router['delete'](_0x2cc9('0x10'),auth[_0x2cc9('0xb')](),controller[_0x2cc9('0x22')]);router[_0x2cc9('0x21')](_0x2cc9('0x16'),auth['isAuthenticated'](),controller[_0x2cc9('0x23')]);module[_0x2cc9('0x24')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index c57ab03..f86f833 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 _0xcedf=['VIRTUAL','field','STRING','sequelize','exports'];(function(_0x1dfa63,_0x362bd4){var _0x26f2a9=function(_0x31cc52){while(--_0x31cc52){_0x1dfa63['push'](_0x1dfa63['shift']());}};_0x26f2a9(++_0x362bd4);}(_0xcedf,0x1b6));var _0xfced=function(_0x296315,_0x5355db){_0x296315=_0x296315-0x0;var _0x401873=_0xcedf[_0x296315];return _0x401873;};'use strict';var Sequelize=require(_0xfced('0x0'));module[_0xfced('0x1')]={'name':{'type':Sequelize[_0xfced('0x2')],'get':function(_0x157ed6){return this['getDataValue'](_0xfced('0x3'));}},'field':{'type':Sequelize[_0xfced('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x880f=['sequelize','exports','VIRTUAL','getDataValue','field','STRING'];(function(_0x458363,_0x1675db){var _0x4d0290=function(_0x22960f){while(--_0x22960f){_0x458363['push'](_0x458363['shift']());}};_0x4d0290(++_0x1675db);}(_0x880f,0xf0));var _0xf880=function(_0x359eb5,_0x4c4fb2){_0x359eb5=_0x359eb5-0x0;var _0x126797=_0x880f[_0x359eb5];return _0x126797;};'use strict';var Sequelize=require(_0xf880('0x0'));module[_0xf880('0x1')]={'name':{'type':Sequelize[_0xf880('0x2')],'get':function(_0x3c7f87){return this[_0xf880('0x3')](_0xf880('0x4'));}},'field':{'type':Sequelize[_0xf880('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0xf880('0x5')],'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 63b98a2..3f9b6a7 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 _0xf796=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','name','send','body','Condition','params','catch','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xf796,0x19b));var _0x6f79=function(_0x244a28,_0x47527e){_0x244a28=_0x244a28-0x0;var _0x2c932a=_0xf796[_0x244a28];return _0x2c932a;};'use strict';var pdf=require(_0x6f79('0x0'));var emlformat=require(_0x6f79('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6f79('0x2'));var jsonpatch=require(_0x6f79('0x3'));var rp=require(_0x6f79('0x4'));var moment=require('moment');var BPromise=require(_0x6f79('0x5'));var Mustache=require('mustache');var util=require(_0x6f79('0x6'));var path=require(_0x6f79('0x7'));var sox=require(_0x6f79('0x8'));var csv=require(_0x6f79('0x9'));var ejs=require(_0x6f79('0xa'));var fs=require('fs');var _=require(_0x6f79('0xb'));var squel=require(_0x6f79('0xc'));var crypto=require(_0x6f79('0xd'));var jsforce=require(_0x6f79('0xe'));var deskjs=require(_0x6f79('0xf'));var toCsv=require(_0x6f79('0x9'));var querystring=require(_0x6f79('0x10'));var Papa=require(_0x6f79('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6f79('0x12'));var logger=require(_0x6f79('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x6f79('0x14'));var db=require(_0x6f79('0x15'))['db'];function respondWithStatusCode(_0x274ffa,_0x2bbd29){_0x2bbd29=_0x2bbd29||0xcc;return function(_0x8fd241){if(_0x8fd241){return _0x274ffa[_0x6f79('0x16')](_0x2bbd29);}return _0x274ffa[_0x6f79('0x17')](_0x2bbd29)[_0x6f79('0x18')]();};}function respondWithResult(_0x4ae16f,_0x40fd81){_0x40fd81=_0x40fd81||0xc8;return function(_0x33a442){if(_0x33a442){return _0x4ae16f[_0x6f79('0x17')](_0x40fd81)[_0x6f79('0x19')](_0x33a442);}};}function respondWithFilteredResult(_0x59a656,_0x3dbc14){return function(_0x5c43d0){if(_0x5c43d0){var _0x47b91d=_0x5c43d0['count'],_0x185cce=_0x3dbc14[_0x6f79('0x1a')],_0x4b1dbe=_0x3dbc14['offset']+_0x3dbc14[_0x6f79('0x1b')],_0xd99ec0;if(_0x4b1dbe>=_0x47b91d){_0x4b1dbe=_0x47b91d;_0xd99ec0=0xc8;}else{_0xd99ec0=0xce;}_0x59a656[_0x6f79('0x17')](_0xd99ec0);return _0x59a656[_0x6f79('0x1c')](_0x6f79('0x1d'),_0x185cce+'-'+_0x4b1dbe+'/'+_0x47b91d)['json'](_0x5c43d0);}return null;};}function patchUpdates(_0x218661){return function(_0x570c3a){try{jsonpatch[_0x6f79('0x1e')](_0x570c3a,_0x218661,!![]);}catch(_0x16d0ec){return BPromise['reject'](_0x16d0ec);}return _0x570c3a[_0x6f79('0x1f')]();};}function saveUpdates(_0x49c2b1,_0x12a673){return function(_0x432ad6){if(_0x432ad6){return _0x432ad6[_0x6f79('0x20')](_0x49c2b1)[_0x6f79('0x21')](function(_0x173a60){return _0x173a60;});}return null;};}function removeEntity(_0x39772f,_0x4cfaef){return function(_0x390984){if(_0x390984){return _0x390984[_0x6f79('0x22')]()[_0x6f79('0x21')](function(){_0x39772f[_0x6f79('0x17')](0xcc)[_0x6f79('0x18')]();});}};}function handleEntityNotFound(_0x374451,_0x46ff8d){return function(_0x1cb5b2){if(!_0x1cb5b2){_0x374451[_0x6f79('0x16')](0x194);}return _0x1cb5b2;};}function handleError(_0x4f2887,_0x1154b7){_0x1154b7=_0x1154b7||0x1f4;return function(_0x3fef02){logger['error'](_0x3fef02['stack']);if(_0x3fef02[_0x6f79('0x23')]){delete _0x3fef02[_0x6f79('0x23')];}_0x4f2887[_0x6f79('0x17')](_0x1154b7)[_0x6f79('0x24')](_0x3fef02);};}exports[_0x6f79('0x20')]=function(_0x2dcadb,_0x1aa8e2){if(_0x2dcadb['body']['id']){delete _0x2dcadb[_0x6f79('0x25')]['id'];}return db[_0x6f79('0x26')]['find']({'where':{'id':_0x2dcadb[_0x6f79('0x27')]['id']}})[_0x6f79('0x21')](handleEntityNotFound(_0x1aa8e2,null))[_0x6f79('0x21')](saveUpdates(_0x2dcadb[_0x6f79('0x25')],null))['then'](respondWithResult(_0x1aa8e2,null))[_0x6f79('0x28')](handleError(_0x1aa8e2,null));};exports[_0x6f79('0x22')]=function(_0x2aea8d,_0xb0d4cf){return db[_0x6f79('0x26')][_0x6f79('0x29')]({'where':{'id':_0x2aea8d['params']['id']}})['then'](handleEntityNotFound(_0xb0d4cf,null))[_0x6f79('0x21')](removeEntity(_0xb0d4cf,null))[_0x6f79('0x28')](handleError(_0xb0d4cf,null));}; \ No newline at end of file +var _0xe789=['catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','count','offset','apply','save','update','then','destroy','end','error','name','send','body','Condition','find','params'];(function(_0x2f195e,_0x29b7c6){var _0x50ec7e=function(_0x4eab66){while(--_0x4eab66){_0x2f195e['push'](_0x2f195e['shift']());}};_0x50ec7e(++_0x29b7c6);}(_0xe789,0x1af));var _0x9e78=function(_0x21eb37,_0x5a63dc){_0x21eb37=_0x21eb37-0x0;var _0x12d423=_0xe789[_0x21eb37];return _0x12d423;};'use strict';var pdf=require(_0x9e78('0x0'));var emlformat=require(_0x9e78('0x1'));var rimraf=require(_0x9e78('0x2'));var zipdir=require(_0x9e78('0x3'));var jsonpatch=require(_0x9e78('0x4'));var rp=require(_0x9e78('0x5'));var moment=require(_0x9e78('0x6'));var BPromise=require(_0x9e78('0x7'));var Mustache=require('mustache');var util=require(_0x9e78('0x8'));var path=require(_0x9e78('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9e78('0xa'));var fs=require('fs');var _=require(_0x9e78('0xb'));var squel=require(_0x9e78('0xc'));var crypto=require(_0x9e78('0xd'));var jsforce=require(_0x9e78('0xe'));var deskjs=require(_0x9e78('0xf'));var toCsv=require(_0x9e78('0x10'));var querystring=require(_0x9e78('0x11'));var Papa=require('papaparse');var Redis=require(_0x9e78('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9e78('0x13'));var hardwareService=require(_0x9e78('0x14'));var logger=require(_0x9e78('0x15'))(_0x9e78('0x16'));var utils=require('../../config/utils');var config=require(_0x9e78('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7d5c3c,_0x265888){_0x265888=_0x265888||0xcc;return function(_0x39d82a){if(_0x39d82a){return _0x7d5c3c[_0x9e78('0x18')](_0x265888);}return _0x7d5c3c[_0x9e78('0x19')](_0x265888)['end']();};}function respondWithResult(_0x63ee3,_0x39e36f){_0x39e36f=_0x39e36f||0xc8;return function(_0x521e43){if(_0x521e43){return _0x63ee3[_0x9e78('0x19')](_0x39e36f)[_0x9e78('0x1a')](_0x521e43);}};}function respondWithFilteredResult(_0x598974,_0x1e54a4){return function(_0x1028d6){if(_0x1028d6){var _0x1f7da6=_0x1028d6[_0x9e78('0x1b')],_0x1706cc=_0x1e54a4[_0x9e78('0x1c')],_0x2c68f9=_0x1e54a4[_0x9e78('0x1c')]+_0x1e54a4['limit'],_0x2a3c36;if(_0x2c68f9>=_0x1f7da6){_0x2c68f9=_0x1f7da6;_0x2a3c36=0xc8;}else{_0x2a3c36=0xce;}_0x598974[_0x9e78('0x19')](_0x2a3c36);return _0x598974['set']('Content-Range',_0x1706cc+'-'+_0x2c68f9+'/'+_0x1f7da6)['json'](_0x1028d6);}return null;};}function patchUpdates(_0x28e249){return function(_0x3ea9f1){try{jsonpatch[_0x9e78('0x1d')](_0x3ea9f1,_0x28e249,!![]);}catch(_0x5303bc){return BPromise['reject'](_0x5303bc);}return _0x3ea9f1[_0x9e78('0x1e')]();};}function saveUpdates(_0x285cb2,_0x467a7){return function(_0x5ca3f7){if(_0x5ca3f7){return _0x5ca3f7[_0x9e78('0x1f')](_0x285cb2)[_0x9e78('0x20')](function(_0x79a514){return _0x79a514;});}return null;};}function removeEntity(_0x57b88e,_0x2c5d33){return function(_0x4ba311){if(_0x4ba311){return _0x4ba311[_0x9e78('0x21')]()[_0x9e78('0x20')](function(){_0x57b88e['status'](0xcc)[_0x9e78('0x22')]();});}};}function handleEntityNotFound(_0x410297,_0x535c8e){return function(_0x184412){if(!_0x184412){_0x410297[_0x9e78('0x18')](0x194);}return _0x184412;};}function handleError(_0x56e73b,_0x488266){_0x488266=_0x488266||0x1f4;return function(_0x53a580){logger[_0x9e78('0x23')](_0x53a580['stack']);if(_0x53a580[_0x9e78('0x24')]){delete _0x53a580['name'];}_0x56e73b[_0x9e78('0x19')](_0x488266)[_0x9e78('0x25')](_0x53a580);};}exports[_0x9e78('0x1f')]=function(_0x31f097,_0x50ba80){if(_0x31f097[_0x9e78('0x26')]['id']){delete _0x31f097[_0x9e78('0x26')]['id'];}return db[_0x9e78('0x27')][_0x9e78('0x28')]({'where':{'id':_0x31f097[_0x9e78('0x29')]['id']}})['then'](handleEntityNotFound(_0x50ba80,null))[_0x9e78('0x20')](saveUpdates(_0x31f097[_0x9e78('0x26')],null))[_0x9e78('0x20')](respondWithResult(_0x50ba80,null))[_0x9e78('0x2a')](handleError(_0x50ba80,null));};exports[_0x9e78('0x21')]=function(_0x2903c8,_0x52da66){return db[_0x9e78('0x27')][_0x9e78('0x28')]({'where':{'id':_0x2903c8[_0x9e78('0x29')]['id']}})[_0x9e78('0x20')](handleEntityNotFound(_0x52da66,null))[_0x9e78('0x20')](removeEntity(_0x52da66,null))[_0x9e78('0x2a')](handleError(_0x52da66,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index aa5eee0..5723099 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 _0x7ec5=['request-promise','rimraf','../../config/environment','exports','define','Condition','tools_conditions','lodash','api','bluebird'];(function(_0x15ccb8,_0x385a0c){var _0x56ef1e=function(_0x36c7b9){while(--_0x36c7b9){_0x15ccb8['push'](_0x15ccb8['shift']());}};_0x56ef1e(++_0x385a0c);}(_0x7ec5,0x147));var _0x57ec=function(_0x33be73,_0x59d750){_0x33be73=_0x33be73-0x0;var _0x2d1f91=_0x7ec5[_0x33be73];return _0x2d1f91;};'use strict';var _=require(_0x57ec('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x57ec('0x1'));var moment=require('moment');var BPromise=require(_0x57ec('0x2'));var rp=require(_0x57ec('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x57ec('0x4'));var config=require(_0x57ec('0x5'));var attributes=require('./condition.attributes');module[_0x57ec('0x6')]=function(_0x352bf4,_0x55cb0e){return _0x352bf4[_0x57ec('0x7')](_0x57ec('0x8'),attributes,{'tableName':_0x57ec('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ae1=['api','bluebird','path','rimraf','../../config/environment','./condition.attributes','exports','define','tools_conditions','../../config/logger'];(function(_0x2f1172,_0x5f5b26){var _0x58e374=function(_0x1a61fa){while(--_0x1a61fa){_0x2f1172['push'](_0x2f1172['shift']());}};_0x58e374(++_0x5f5b26);}(_0x1ae1,0xb3));var _0x11ae=function(_0xc1b307,_0x50f40e){_0xc1b307=_0xc1b307-0x0;var _0x274f17=_0x1ae1[_0xc1b307];return _0x274f17;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x11ae('0x0'))(_0x11ae('0x1'));var moment=require('moment');var BPromise=require(_0x11ae('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x11ae('0x3'));var rimraf=require(_0x11ae('0x4'));var config=require(_0x11ae('0x5'));var attributes=require(_0x11ae('0x6'));module[_0x11ae('0x7')]=function(_0x1d28da,_0x277a62){return _0x1d28da[_0x11ae('0x8')]('Condition',attributes,{'tableName':_0x11ae('0x9'),'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 859d3d8..d036715 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 _0x659f=['../../config/logger','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4962af,_0x34f373){var _0x40c66e=function(_0x458cd0){while(--_0x458cd0){_0x4962af['push'](_0x4962af['shift']());}};_0x40c66e(++_0x34f373);}(_0x659f,0x188));var _0xf659=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x659f[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xf659('0x0'));var util=require(_0xf659('0x1'));var moment=require(_0xf659('0x2'));var BPromise=require(_0xf659('0x3'));var rs=require(_0xf659('0x4'));var fs=require('fs');var Redis=require(_0xf659('0x5'));var db=require(_0xf659('0x6'))['db'];var utils=require(_0xf659('0x7'));var logger=require(_0xf659('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf659('0x9'));var client=jayson[_0xf659('0xa')][_0xf659('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c61aa,_0x2313c6,_0x51b4aa){return new BPromise(function(_0x306355,_0x3d50bc){return client[_0xf659('0xc')](_0x3c61aa,_0x51b4aa)[_0xf659('0xd')](function(_0x550f63){logger[_0xf659('0xe')](_0xf659('0xf'),_0x2313c6,_0xf659('0x10'));logger[_0xf659('0x11')](_0xf659('0x12'),_0x2313c6,_0xf659('0x10'),JSON[_0xf659('0x13')](_0x550f63));if(_0x550f63[_0xf659('0x14')]){if(_0x550f63[_0xf659('0x14')][_0xf659('0x15')]===0x1f4){logger['error'](_0xf659('0xf'),_0x2313c6,_0x550f63['error'][_0xf659('0x16')]);return _0x3d50bc(_0x550f63[_0xf659('0x14')][_0xf659('0x16')]);}logger['error'](_0xf659('0xf'),_0x2313c6,_0x550f63[_0xf659('0x14')][_0xf659('0x16')]);return _0x306355(_0x550f63[_0xf659('0x14')]['message']);}else{logger['info']('Condition,\x20%s,\x20%s',_0x2313c6,_0xf659('0x10'));_0x306355(_0x550f63[_0xf659('0x17')][_0xf659('0x16')]);}})[_0xf659('0x18')](function(_0x566b8d){logger[_0xf659('0x14')](_0xf659('0xf'),_0x2313c6,_0x566b8d);_0x3d50bc(_0x566b8d);});});} \ No newline at end of file +var _0xbafc=['Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x23f642,_0x3c8f66){var _0x4ba0d0=function(_0x507a88){while(--_0x507a88){_0x23f642['push'](_0x23f642['shift']());}};_0x4ba0d0(++_0x3c8f66);}(_0xbafc,0x1b6));var _0xcbaf=function(_0x59c1be,_0xba160a){_0x59c1be=_0x59c1be-0x0;var _0x47c031=_0xbafc[_0x59c1be];return _0x47c031;};'use strict';var _=require(_0xcbaf('0x0'));var util=require(_0xcbaf('0x1'));var moment=require(_0xcbaf('0x2'));var BPromise=require(_0xcbaf('0x3'));var rs=require(_0xcbaf('0x4'));var fs=require('fs');var Redis=require(_0xcbaf('0x5'));var db=require(_0xcbaf('0x6'))['db'];var utils=require(_0xcbaf('0x7'));var logger=require(_0xcbaf('0x8'))(_0xcbaf('0x9'));var config=require(_0xcbaf('0xa'));var jayson=require(_0xcbaf('0xb'));var client=jayson[_0xcbaf('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x369b13,_0x5d11a5,_0x440cc6){return new BPromise(function(_0x257fea,_0x5a80bb){return client['request'](_0x369b13,_0x440cc6)[_0xcbaf('0xd')](function(_0x15701b){logger[_0xcbaf('0xe')](_0xcbaf('0xf'),_0x5d11a5,_0xcbaf('0x10'));logger[_0xcbaf('0x11')](_0xcbaf('0x12'),_0x5d11a5,_0xcbaf('0x10'),JSON[_0xcbaf('0x13')](_0x15701b));if(_0x15701b[_0xcbaf('0x14')]){if(_0x15701b['error'][_0xcbaf('0x15')]===0x1f4){logger[_0xcbaf('0x14')](_0xcbaf('0xf'),_0x5d11a5,_0x15701b[_0xcbaf('0x14')][_0xcbaf('0x16')]);return _0x5a80bb(_0x15701b[_0xcbaf('0x14')]['message']);}logger[_0xcbaf('0x14')](_0xcbaf('0xf'),_0x5d11a5,_0x15701b[_0xcbaf('0x14')][_0xcbaf('0x16')]);return _0x257fea(_0x15701b[_0xcbaf('0x14')][_0xcbaf('0x16')]);}else{logger[_0xcbaf('0xe')](_0xcbaf('0xf'),_0x5d11a5,_0xcbaf('0x10'));_0x257fea(_0x15701b[_0xcbaf('0x17')]['message']);}})['catch'](function(_0x3b8956){logger['error'](_0xcbaf('0xf'),_0x5d11a5,_0x3b8956);_0x5a80bb(_0x3b8956);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 5f1a9c9..2e14c5d 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 _0xf57a=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./condition.controller','/:id','isAuthenticated','delete'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xf57a,0x1ae));var _0xaf57=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xf57a[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0xaf57('0x0'));var util=require(_0xaf57('0x1'));var path=require(_0xaf57('0x2'));var timeout=require(_0xaf57('0x3'));var express=require(_0xaf57('0x4'));var router=express[_0xaf57('0x5')]();var auth=require(_0xaf57('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xaf57('0x7'));var controller=require(_0xaf57('0x8'));router['put'](_0xaf57('0x9'),auth[_0xaf57('0xa')](),controller['update']);router[_0xaf57('0xb')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xaf57('0xc')]=router; \ No newline at end of file +var _0xe39c=['isAuthenticated','update','delete','destroy','multer','path','express','Router','../../components/auth/service','../../config/environment','./condition.controller','put','/:id'];(function(_0x9d34d4,_0x3e834c){var _0x247624=function(_0x403b5b){while(--_0x403b5b){_0x9d34d4['push'](_0x9d34d4['shift']());}};_0x247624(++_0x3e834c);}(_0xe39c,0x1d8));var _0xce39=function(_0x1ba6ad,_0x13e6e9){_0x1ba6ad=_0x1ba6ad-0x0;var _0x3cf481=_0xe39c[_0x1ba6ad];return _0x3cf481;};'use strict';var multer=require(_0xce39('0x0'));var util=require('util');var path=require(_0xce39('0x1'));var timeout=require('connect-timeout');var express=require(_0xce39('0x2'));var router=express[_0xce39('0x3')]();var auth=require(_0xce39('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xce39('0x5'));var controller=require(_0xce39('0x6'));router[_0xce39('0x7')](_0xce39('0x8'),auth[_0xce39('0x9')](),controller[_0xce39('0xa')]);router[_0xce39('0xb')](_0xce39('0x8'),auth['isAuthenticated'](),controller[_0xce39('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/crmActionsList/crmActionsList.attributes.js b/server/api/crmActionsList/crmActionsList.attributes.js index ae7ced2..5815d65 100644 --- a/server/api/crmActionsList/crmActionsList.attributes.js +++ b/server/api/crmActionsList/crmActionsList.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1245=['TEXT','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','INTEGER','STRING','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1245,0xd1));var _0x5124=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1245[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x5124('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'note':{'type':Sequelize[_0x5124('0x1')](_0x5124('0x2'))+_0x5124('0x3')},'ordersequence':{'type':Sequelize[_0x5124('0x4')],'allowNull':!![]},'action':{'type':Sequelize[_0x5124('0x5')]},'parameters':{'type':Sequelize[_0x5124('0x5')]}}; \ No newline at end of file +var _0x7412=['exports','STRING','long','INTEGER','sequelize'];(function(_0x26fd7c,_0x9b4852){var _0x2cdb00=function(_0x4cb573){while(--_0x4cb573){_0x26fd7c['push'](_0x26fd7c['shift']());}};_0x2cdb00(++_0x9b4852);}(_0x7412,0x1c1));var _0x2741=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7412[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x2741('0x0'));module[_0x2741('0x1')]={'name':{'type':Sequelize[_0x2741('0x2')],'allowNull':![],'unique':'name'},'note':{'type':Sequelize['TEXT'](_0x2741('0x3'))+'\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci'},'ordersequence':{'type':Sequelize[_0x2741('0x4')],'allowNull':!![]},'action':{'type':Sequelize[_0x2741('0x2')]},'parameters':{'type':Sequelize[_0x2741('0x2')]}}; \ No newline at end of file diff --git a/server/api/crmActionsList/crmActionsList.controller.js b/server/api/crmActionsList/crmActionsList.controller.js index c58f5fa..ca54c3f 100644 --- a/server/api/crmActionsList/crmActionsList.controller.js +++ b/server/api/crmActionsList/crmActionsList.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa41a=['Content-Range','reject','save','destroy','then','sendStatus','stack','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','key','VIRTUAL','options','CrmActionsList','includeAll','findAll','rows','catch','show','params','create','body','update','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set'];(function(_0x2a8d6c,_0xae1297){var _0x2a2541=function(_0x3d9d3d){while(--_0x3d9d3d){_0x2a8d6c['push'](_0x2a8d6c['shift']());}};_0x2a2541(++_0xae1297);}(_0xa41a,0x6b));var _0xaa41=function(_0x1d673b,_0x591117){_0x1d673b=_0x1d673b-0x0;var _0x11357f=_0xa41a[_0x1d673b];return _0x11357f;};'use strict';var pdf=require(_0xaa41('0x0'));var emlformat=require(_0xaa41('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xaa41('0x2'));var jsonpatch=require(_0xaa41('0x3'));var rp=require(_0xaa41('0x4'));var moment=require(_0xaa41('0x5'));var BPromise=require(_0xaa41('0x6'));var Mustache=require(_0xaa41('0x7'));var util=require(_0xaa41('0x8'));var path=require(_0xaa41('0x9'));var sox=require('sox');var csv=require(_0xaa41('0xa'));var ejs=require(_0xaa41('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xa'));var querystring=require(_0xaa41('0xe'));var Papa=require(_0xaa41('0xf'));var Redis=require(_0xaa41('0x10'));var authService=require(_0xaa41('0x11'));var qs=require(_0xaa41('0x12'));var hardwareService=require(_0xaa41('0x13'));var logger=require(_0xaa41('0x14'))(_0xaa41('0x15'));var utils=require('../../config/utils');var config=require(_0xaa41('0x16'));var db=require(_0xaa41('0x17'))['db'];function respondWithStatusCode(_0x524cab,_0x54827c){_0x54827c=_0x54827c||0xcc;return function(_0x1d0a54){if(_0x1d0a54){return _0x524cab['sendStatus'](_0x54827c);}return _0x524cab[_0xaa41('0x18')](_0x54827c)[_0xaa41('0x19')]();};}function respondWithResult(_0x2f64bc,_0x889d44){_0x889d44=_0x889d44||0xc8;return function(_0x6f9ade){if(_0x6f9ade){return _0x2f64bc['status'](_0x889d44)[_0xaa41('0x1a')](_0x6f9ade);}};}function respondWithFilteredResult(_0x178170,_0x1934e9){return function(_0x1ef7d9){if(_0x1ef7d9){var _0x2a6988=_0x1ef7d9[_0xaa41('0x1b')],_0x2005ae=_0x1934e9[_0xaa41('0x1c')],_0x1e1e02=_0x1934e9[_0xaa41('0x1c')]+_0x1934e9[_0xaa41('0x1d')],_0x550ad5;if(_0x1e1e02>=_0x2a6988){_0x1e1e02=_0x2a6988;_0x550ad5=0xc8;}else{_0x550ad5=0xce;}_0x178170[_0xaa41('0x18')](_0x550ad5);return _0x178170[_0xaa41('0x1e')](_0xaa41('0x1f'),_0x2005ae+'-'+_0x1e1e02+'/'+_0x2a6988)[_0xaa41('0x1a')](_0x1ef7d9);}return null;};}function patchUpdates(_0x150ddf){return function(_0x4fe1a4){try{jsonpatch['apply'](_0x4fe1a4,_0x150ddf,!![]);}catch(_0x1f502a){return BPromise[_0xaa41('0x20')](_0x1f502a);}return _0x4fe1a4[_0xaa41('0x21')]();};}function saveUpdates(_0x54c488,_0x2bf794){return function(_0x1f692b){if(_0x1f692b){return _0x1f692b['update'](_0x54c488)['then'](function(_0x1b1910){return _0x1b1910;});}return null;};}function removeEntity(_0x5d4374,_0xafd672){return function(_0x209c83){if(_0x209c83){return _0x209c83[_0xaa41('0x22')]()[_0xaa41('0x23')](function(){_0x5d4374[_0xaa41('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43c430,_0x43a85c){return function(_0x448a21){if(!_0x448a21){_0x43c430[_0xaa41('0x24')](0x194);}return _0x448a21;};}function handleError(_0x274630,_0xa1f024){_0xa1f024=_0xa1f024||0x1f4;return function(_0x5c3074){logger['error'](_0x5c3074[_0xaa41('0x25')]);if(_0x5c3074['name']){delete _0x5c3074['name'];}_0x274630[_0xaa41('0x18')](_0xa1f024)['send'](_0x5c3074);};}exports['index']=function(_0x2d0ac0,_0x9c8c21){var _0x392214={},_0x632fd2={},_0x3f5272={'count':0x0,'rows':[]};var _0xa7269f=db['CrmActionsList'][_0xaa41('0x26')];_0x632fd2[_0xaa41('0x27')]=_[_0xaa41('0x28')](_0xa7269f);_0x632fd2[_0xaa41('0x29')]=_[_0xaa41('0x28')](_0x2d0ac0[_0xaa41('0x29')]);_0x632fd2[_0xaa41('0x2a')]=_[_0xaa41('0x2b')](_0x632fd2['model'],_0x632fd2[_0xaa41('0x29')]);_0x392214['attributes']=_['intersection'](_0x632fd2[_0xaa41('0x27')],qs[_0xaa41('0x2c')](_0x2d0ac0['query'][_0xaa41('0x2c')]));_0x392214[_0xaa41('0x2d')]=_0x392214['attributes']['length']?_0x392214['attributes']:_0x632fd2[_0xaa41('0x27')];if(!_0x2d0ac0[_0xaa41('0x29')][_0xaa41('0x2e')](_0xaa41('0x2f'))){_0x392214['limit']=qs[_0xaa41('0x1d')](_0x2d0ac0[_0xaa41('0x29')][_0xaa41('0x1d')]);_0x392214['offset']=qs[_0xaa41('0x1c')](_0x2d0ac0[_0xaa41('0x29')][_0xaa41('0x1c')]);}_0x392214['order']=qs[_0xaa41('0x30')](_0x2d0ac0[_0xaa41('0x29')]['sort']);_0x392214[_0xaa41('0x31')]=qs[_0xaa41('0x2a')](_[_0xaa41('0x32')](_0x2d0ac0['query'],_0x632fd2[_0xaa41('0x2a')]));if(_0x2d0ac0['query'][_0xaa41('0x33')]){_0x392214[_0xaa41('0x31')]=_[_0xaa41('0x34')](_0x392214['where'],{'$or':_['map'](_0xa7269f,function(_0x4cdd42){if(_0x4cdd42[_0xaa41('0x35')][_0xaa41('0x36')]!==_0xaa41('0x37')){var _0x224eb3={};_0x224eb3[_0x4cdd42['field']]={'$like':'%'+_0x2d0ac0['query'][_0xaa41('0x33')]+'%'};return _0x224eb3;}})});}_0x392214=_[_0xaa41('0x34')]({},_0x392214,_0x2d0ac0[_0xaa41('0x38')]);var _0x4e8d2e={'where':_0x392214[_0xaa41('0x31')]};return db[_0xaa41('0x39')][_0xaa41('0x1b')](_0x4e8d2e)['then'](function(_0x3adc28){_0x3f5272[_0xaa41('0x1b')]=_0x3adc28;if(_0x2d0ac0[_0xaa41('0x29')][_0xaa41('0x3a')]){_0x392214['include']=[{'all':!![]}];}return db['CrmActionsList'][_0xaa41('0x3b')](_0x392214);})[_0xaa41('0x23')](function(_0x5eae08){_0x3f5272[_0xaa41('0x3c')]=_0x5eae08;return _0x3f5272;})['then'](respondWithFilteredResult(_0x9c8c21,_0x392214))[_0xaa41('0x3d')](handleError(_0x9c8c21,null));};exports[_0xaa41('0x3e')]=function(_0x1a2d11,_0x466eee){var _0x3e6cac={'raw':![],'where':{'id':_0x1a2d11[_0xaa41('0x3f')]['id']}},_0x12ba1a={};_0x12ba1a[_0xaa41('0x27')]=_['keys'](db[_0xaa41('0x39')][_0xaa41('0x26')]);_0x12ba1a[_0xaa41('0x29')]=_[_0xaa41('0x28')](_0x1a2d11[_0xaa41('0x29')]);_0x12ba1a[_0xaa41('0x2a')]=_['intersection'](_0x12ba1a['model'],_0x12ba1a[_0xaa41('0x29')]);_0x3e6cac['attributes']=_[_0xaa41('0x2b')](_0x12ba1a[_0xaa41('0x27')],qs[_0xaa41('0x2c')](_0x1a2d11[_0xaa41('0x29')][_0xaa41('0x2c')]));_0x3e6cac[_0xaa41('0x2d')]=_0x3e6cac[_0xaa41('0x2d')]['length']?_0x3e6cac[_0xaa41('0x2d')]:_0x12ba1a['model'];if(_0x1a2d11['query'][_0xaa41('0x3a')]){_0x3e6cac['include']=[{'all':!![]}];}_0x3e6cac=_['merge']({},_0x3e6cac,_0x1a2d11['options']);return db[_0xaa41('0x39')]['find'](_0x3e6cac)[_0xaa41('0x23')](handleEntityNotFound(_0x466eee,null))[_0xaa41('0x23')](respondWithResult(_0x466eee,null))['catch'](handleError(_0x466eee,null));};exports['create']=function(_0xe58f5e,_0x1b7b97){return db[_0xaa41('0x39')][_0xaa41('0x40')](_0xe58f5e[_0xaa41('0x41')],{})[_0xaa41('0x23')](respondWithResult(_0x1b7b97,0xc9))[_0xaa41('0x3d')](handleError(_0x1b7b97,null));};exports[_0xaa41('0x42')]=function(_0x2fa6ec,_0x4e1ac4){if(_0x2fa6ec[_0xaa41('0x41')]['id']){delete _0x2fa6ec[_0xaa41('0x41')]['id'];}return db[_0xaa41('0x39')][_0xaa41('0x43')]({'where':{'id':_0x2fa6ec[_0xaa41('0x3f')]['id']}})[_0xaa41('0x23')](handleEntityNotFound(_0x4e1ac4,null))['then'](saveUpdates(_0x2fa6ec[_0xaa41('0x41')],null))[_0xaa41('0x23')](respondWithResult(_0x4e1ac4,null))[_0xaa41('0x3d')](handleError(_0x4e1ac4,null));};exports[_0xaa41('0x22')]=function(_0x57d1f6,_0x23bc61){return db['CrmActionsList']['find']({'where':{'id':_0x57d1f6[_0xaa41('0x3f')]['id']}})[_0xaa41('0x23')](handleEntityNotFound(_0x23bc61,null))[_0xaa41('0x23')](removeEntity(_0x23bc61,null))['catch'](handleError(_0x23bc61,null));};exports[_0xaa41('0x44')]=function(_0x3e1a73,_0x853ccb){return db['CrmActionsList'][_0xaa41('0x44')]()[_0xaa41('0x23')](respondWithResult(_0x853ccb,null))[_0xaa41('0x3d')](handleError(_0x853ccb,null));}; \ No newline at end of file +var _0x7217=['query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','type','key','VIRTUAL','field','includeAll','findAll','rows','catch','show','params','include','merge','options','find','create','body','update','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','json','apply','reject','save','then','destroy','end','error','stack','name','send','index','CrmActionsList','rawAttributes','model','keys'];(function(_0x4259bd,_0x481c3e){var _0x246116=function(_0x472d5d){while(--_0x472d5d){_0x4259bd['push'](_0x4259bd['shift']());}};_0x246116(++_0x481c3e);}(_0x7217,0x19e));var _0x7721=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x7217[_0x3054be];return _0x3df150;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7721('0x14'));var logger=require(_0x7721('0x15'))(_0x7721('0x16'));var utils=require(_0x7721('0x17'));var config=require(_0x7721('0x18'));var db=require(_0x7721('0x19'))['db'];function respondWithStatusCode(_0x1e7fd7,_0x27b36b){_0x27b36b=_0x27b36b||0xcc;return function(_0x55b4ca){if(_0x55b4ca){return _0x1e7fd7[_0x7721('0x1a')](_0x27b36b);}return _0x1e7fd7[_0x7721('0x1b')](_0x27b36b)['end']();};}function respondWithResult(_0x109900,_0x30da54){_0x30da54=_0x30da54||0xc8;return function(_0x3f01c5){if(_0x3f01c5){return _0x109900[_0x7721('0x1b')](_0x30da54)['json'](_0x3f01c5);}};}function respondWithFilteredResult(_0x3cbce8,_0x25b1c0){return function(_0x534f1b){if(_0x534f1b){var _0x4e199a=_0x534f1b[_0x7721('0x1c')],_0x4b183e=_0x25b1c0[_0x7721('0x1d')],_0x5ed54=_0x25b1c0['offset']+_0x25b1c0[_0x7721('0x1e')],_0x25a628;if(_0x5ed54>=_0x4e199a){_0x5ed54=_0x4e199a;_0x25a628=0xc8;}else{_0x25a628=0xce;}_0x3cbce8['status'](_0x25a628);return _0x3cbce8[_0x7721('0x1f')]('Content-Range',_0x4b183e+'-'+_0x5ed54+'/'+_0x4e199a)[_0x7721('0x20')](_0x534f1b);}return null;};}function patchUpdates(_0x4e96fb){return function(_0x3ab5a5){try{jsonpatch[_0x7721('0x21')](_0x3ab5a5,_0x4e96fb,!![]);}catch(_0x2286e5){return BPromise[_0x7721('0x22')](_0x2286e5);}return _0x3ab5a5[_0x7721('0x23')]();};}function saveUpdates(_0x413263,_0x3b29ac){return function(_0xaeccc4){if(_0xaeccc4){return _0xaeccc4['update'](_0x413263)[_0x7721('0x24')](function(_0x2c1583){return _0x2c1583;});}return null;};}function removeEntity(_0x3a053f,_0xd8ad3c){return function(_0x57140c){if(_0x57140c){return _0x57140c[_0x7721('0x25')]()['then'](function(){_0x3a053f[_0x7721('0x1b')](0xcc)[_0x7721('0x26')]();});}};}function handleEntityNotFound(_0x3e8a4e,_0x1caad8){return function(_0x121cc4){if(!_0x121cc4){_0x3e8a4e[_0x7721('0x1a')](0x194);}return _0x121cc4;};}function handleError(_0x2c6b7b,_0x5b4d74){_0x5b4d74=_0x5b4d74||0x1f4;return function(_0x216f20){logger[_0x7721('0x27')](_0x216f20[_0x7721('0x28')]);if(_0x216f20[_0x7721('0x29')]){delete _0x216f20[_0x7721('0x29')];}_0x2c6b7b[_0x7721('0x1b')](_0x5b4d74)[_0x7721('0x2a')](_0x216f20);};}exports[_0x7721('0x2b')]=function(_0x40f367,_0x52316e){var _0x258ddf={},_0x5b0551={},_0x499b87={'count':0x0,'rows':[]};var _0x315202=db[_0x7721('0x2c')][_0x7721('0x2d')];_0x5b0551[_0x7721('0x2e')]=_[_0x7721('0x2f')](_0x315202);_0x5b0551[_0x7721('0x30')]=_[_0x7721('0x2f')](_0x40f367[_0x7721('0x30')]);_0x5b0551['filters']=_[_0x7721('0x31')](_0x5b0551[_0x7721('0x2e')],_0x5b0551['query']);_0x258ddf['attributes']=_[_0x7721('0x31')](_0x5b0551[_0x7721('0x2e')],qs['fields'](_0x40f367[_0x7721('0x30')][_0x7721('0x32')]));_0x258ddf[_0x7721('0x33')]=_0x258ddf['attributes'][_0x7721('0x34')]?_0x258ddf[_0x7721('0x33')]:_0x5b0551[_0x7721('0x2e')];if(!_0x40f367[_0x7721('0x30')][_0x7721('0x35')]('nolimit')){_0x258ddf[_0x7721('0x1e')]=qs[_0x7721('0x1e')](_0x40f367[_0x7721('0x30')]['limit']);_0x258ddf[_0x7721('0x1d')]=qs[_0x7721('0x1d')](_0x40f367['query'][_0x7721('0x1d')]);}_0x258ddf['order']=qs[_0x7721('0x36')](_0x40f367[_0x7721('0x30')][_0x7721('0x36')]);_0x258ddf[_0x7721('0x37')]=qs[_0x7721('0x38')](_[_0x7721('0x39')](_0x40f367[_0x7721('0x30')],_0x5b0551[_0x7721('0x38')]));if(_0x40f367[_0x7721('0x30')][_0x7721('0x3a')]){_0x258ddf[_0x7721('0x37')]=_['merge'](_0x258ddf[_0x7721('0x37')],{'$or':_['map'](_0x315202,function(_0x212384){if(_0x212384[_0x7721('0x3b')][_0x7721('0x3c')]!==_0x7721('0x3d')){var _0x3968f3={};_0x3968f3[_0x212384[_0x7721('0x3e')]]={'$like':'%'+_0x40f367['query']['filter']+'%'};return _0x3968f3;}})});}_0x258ddf=_['merge']({},_0x258ddf,_0x40f367['options']);var _0x18001c={'where':_0x258ddf[_0x7721('0x37')]};return db[_0x7721('0x2c')][_0x7721('0x1c')](_0x18001c)['then'](function(_0xa389fa){_0x499b87['count']=_0xa389fa;if(_0x40f367[_0x7721('0x30')][_0x7721('0x3f')]){_0x258ddf['include']=[{'all':!![]}];}return db[_0x7721('0x2c')][_0x7721('0x40')](_0x258ddf);})['then'](function(_0x4d0111){_0x499b87[_0x7721('0x41')]=_0x4d0111;return _0x499b87;})[_0x7721('0x24')](respondWithFilteredResult(_0x52316e,_0x258ddf))[_0x7721('0x42')](handleError(_0x52316e,null));};exports[_0x7721('0x43')]=function(_0x577af9,_0x2db173){var _0x120de9={'raw':![],'where':{'id':_0x577af9[_0x7721('0x44')]['id']}},_0x40ce8c={};_0x40ce8c[_0x7721('0x2e')]=_['keys'](db[_0x7721('0x2c')]['rawAttributes']);_0x40ce8c[_0x7721('0x30')]=_['keys'](_0x577af9[_0x7721('0x30')]);_0x40ce8c[_0x7721('0x38')]=_[_0x7721('0x31')](_0x40ce8c['model'],_0x40ce8c[_0x7721('0x30')]);_0x120de9[_0x7721('0x33')]=_[_0x7721('0x31')](_0x40ce8c['model'],qs[_0x7721('0x32')](_0x577af9[_0x7721('0x30')][_0x7721('0x32')]));_0x120de9[_0x7721('0x33')]=_0x120de9[_0x7721('0x33')][_0x7721('0x34')]?_0x120de9[_0x7721('0x33')]:_0x40ce8c['model'];if(_0x577af9['query'][_0x7721('0x3f')]){_0x120de9[_0x7721('0x45')]=[{'all':!![]}];}_0x120de9=_[_0x7721('0x46')]({},_0x120de9,_0x577af9[_0x7721('0x47')]);return db[_0x7721('0x2c')][_0x7721('0x48')](_0x120de9)[_0x7721('0x24')](handleEntityNotFound(_0x2db173,null))[_0x7721('0x24')](respondWithResult(_0x2db173,null))[_0x7721('0x42')](handleError(_0x2db173,null));};exports[_0x7721('0x49')]=function(_0x5460cd,_0x578867){return db[_0x7721('0x2c')][_0x7721('0x49')](_0x5460cd[_0x7721('0x4a')],{})[_0x7721('0x24')](respondWithResult(_0x578867,0xc9))['catch'](handleError(_0x578867,null));};exports[_0x7721('0x4b')]=function(_0x2d5a88,_0x56c3d9){if(_0x2d5a88[_0x7721('0x4a')]['id']){delete _0x2d5a88['body']['id'];}return db[_0x7721('0x2c')]['find']({'where':{'id':_0x2d5a88[_0x7721('0x44')]['id']}})[_0x7721('0x24')](handleEntityNotFound(_0x56c3d9,null))[_0x7721('0x24')](saveUpdates(_0x2d5a88['body'],null))[_0x7721('0x24')](respondWithResult(_0x56c3d9,null))[_0x7721('0x42')](handleError(_0x56c3d9,null));};exports['destroy']=function(_0x223d93,_0x1196c2){return db[_0x7721('0x2c')]['find']({'where':{'id':_0x223d93[_0x7721('0x44')]['id']}})['then'](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x24')](removeEntity(_0x1196c2,null))[_0x7721('0x42')](handleError(_0x1196c2,null));};exports[_0x7721('0x4c')]=function(_0x443503,_0x1c95d8){return db[_0x7721('0x2c')][_0x7721('0x4c')]()[_0x7721('0x24')](respondWithResult(_0x1c95d8,null))[_0x7721('0x42')](handleError(_0x1c95d8,null));}; \ No newline at end of file diff --git a/server/api/crmActionsList/crmActionsList.model.js b/server/api/crmActionsList/crmActionsList.model.js index 003f1ac..000c9fc 100644 --- a/server/api/crmActionsList/crmActionsList.model.js +++ b/server/api/crmActionsList/crmActionsList.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2d7=['../../config/logger','api','bluebird','path','../../config/environment','./crmActionsList.attributes','define','CrmActionsList','util'];(function(_0x346743,_0x9ee83d){var _0x3e7623=function(_0xca494e){while(--_0xca494e){_0x346743['push'](_0x346743['shift']());}};_0x3e7623(++_0x9ee83d);}(_0xc2d7,0x1ee));var _0x7c2d=function(_0x35a5c6,_0x35549b){_0x35a5c6=_0x35a5c6-0x0;var _0x43af1f=_0xc2d7[_0x35a5c6];return _0x43af1f;};'use strict';var _=require('lodash');var util=require(_0x7c2d('0x0'));var logger=require(_0x7c2d('0x1'))(_0x7c2d('0x2'));var moment=require('moment');var BPromise=require(_0x7c2d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c2d('0x4'));var rimraf=require('rimraf');var config=require(_0x7c2d('0x5'));var attributes=require(_0x7c2d('0x6'));module['exports']=function(_0x3a8a29,_0x2c0cf8){return _0x3a8a29[_0x7c2d('0x7')](_0x7c2d('0x8'),attributes,{'tableName':'crm_actions_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa041=['moment','request-promise','rimraf','../../config/environment','./crmActionsList.attributes','exports','define','CrmActionsList','../../config/logger'];(function(_0x1b624b,_0x4264ac){var _0x6f102c=function(_0x4e31b0){while(--_0x4e31b0){_0x1b624b['push'](_0x1b624b['shift']());}};_0x6f102c(++_0x4264ac);}(_0xa041,0x155));var _0x1a04=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xa041[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1a04('0x0'))('api');var moment=require(_0x1a04('0x1'));var BPromise=require('bluebird');var rp=require(_0x1a04('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1a04('0x3'));var config=require(_0x1a04('0x4'));var attributes=require(_0x1a04('0x5'));module[_0x1a04('0x6')]=function(_0x3aaa95,_0x451c7a){return _0x3aaa95[_0x1a04('0x7')](_0x1a04('0x8'),attributes,{'tableName':'crm_actions_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/crmActionsList/crmActionsList.rpc.js b/server/api/crmActionsList/crmActionsList.rpc.js index b606b4d..d1b7490 100644 --- a/server/api/crmActionsList/crmActionsList.rpc.js +++ b/server/api/crmActionsList/crmActionsList.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1103=['catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','CrmActionsList,\x20%s,\x20%s','request\x20sent','debug','CrmActionsList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x158ff0,_0x3409ba){var _0x5864e5=function(_0x8dae4f){while(--_0x8dae4f){_0x158ff0['push'](_0x158ff0['shift']());}};_0x5864e5(++_0x3409ba);}(_0x1103,0x191));var _0x3110=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1103[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3110('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3110('0x1'));var db=require(_0x3110('0x2'))['db'];var utils=require(_0x3110('0x3'));var logger=require(_0x3110('0x4'))('rpc');var config=require(_0x3110('0x5'));var jayson=require(_0x3110('0x6'));var client=jayson[_0x3110('0x7')][_0x3110('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x360594,_0x30a77a,_0x4b5cd6){return new BPromise(function(_0xd80d79,_0x500915){return client['request'](_0x360594,_0x4b5cd6)['then'](function(_0x2d485a){logger[_0x3110('0x9')](_0x3110('0xa'),_0x30a77a,_0x3110('0xb'));logger[_0x3110('0xc')](_0x3110('0xd'),_0x30a77a,_0x3110('0xb'),JSON[_0x3110('0xe')](_0x2d485a));if(_0x2d485a[_0x3110('0xf')]){if(_0x2d485a[_0x3110('0xf')][_0x3110('0x10')]===0x1f4){logger[_0x3110('0xf')](_0x3110('0xa'),_0x30a77a,_0x2d485a['error'][_0x3110('0x11')]);return _0x500915(_0x2d485a[_0x3110('0xf')][_0x3110('0x11')]);}logger[_0x3110('0xf')](_0x3110('0xa'),_0x30a77a,_0x2d485a['error']['message']);return _0xd80d79(_0x2d485a[_0x3110('0xf')][_0x3110('0x11')]);}else{logger[_0x3110('0x9')](_0x3110('0xa'),_0x30a77a,'request\x20sent');_0xd80d79(_0x2d485a[_0x3110('0x12')]['message']);}})[_0x3110('0x13')](function(_0x5ba386){logger['error'](_0x3110('0xa'),_0x30a77a,_0x5ba386);_0x500915(_0x5ba386);});});} \ No newline at end of file +var _0xaa86=['stringify','error','code','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','CrmActionsList,\x20%s,\x20%s','CrmActionsList,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2f9749,_0x263002){var _0x55979e=function(_0xe055dd){while(--_0xe055dd){_0x2f9749['push'](_0x2f9749['shift']());}};_0x55979e(++_0x263002);}(_0xaa86,0x1a5));var _0x6aa8=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xaa86[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6aa8('0x0'));var BPromise=require(_0x6aa8('0x1'));var rs=require(_0x6aa8('0x2'));var fs=require('fs');var Redis=require(_0x6aa8('0x3'));var db=require(_0x6aa8('0x4'))['db'];var utils=require(_0x6aa8('0x5'));var logger=require(_0x6aa8('0x6'))(_0x6aa8('0x7'));var config=require('../../config/environment');var jayson=require(_0x6aa8('0x8'));var client=jayson[_0x6aa8('0x9')][_0x6aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5dc6aa,_0x3e017d,_0x3aac2c){return new BPromise(function(_0x5afac5,_0x42d1f1){return client[_0x6aa8('0xb')](_0x5dc6aa,_0x3aac2c)[_0x6aa8('0xc')](function(_0x2542cd){logger['info'](_0x6aa8('0xd'),_0x3e017d,'request\x20sent');logger['debug'](_0x6aa8('0xe'),_0x3e017d,_0x6aa8('0xf'),JSON[_0x6aa8('0x10')](_0x2542cd));if(_0x2542cd[_0x6aa8('0x11')]){if(_0x2542cd[_0x6aa8('0x11')][_0x6aa8('0x12')]===0x1f4){logger[_0x6aa8('0x11')]('CrmActionsList,\x20%s,\x20%s',_0x3e017d,_0x2542cd[_0x6aa8('0x11')]['message']);return _0x42d1f1(_0x2542cd[_0x6aa8('0x11')][_0x6aa8('0x13')]);}logger[_0x6aa8('0x11')](_0x6aa8('0xd'),_0x3e017d,_0x2542cd[_0x6aa8('0x11')][_0x6aa8('0x13')]);return _0x5afac5(_0x2542cd[_0x6aa8('0x11')][_0x6aa8('0x13')]);}else{logger[_0x6aa8('0x14')](_0x6aa8('0xd'),_0x3e017d,_0x6aa8('0xf'));_0x5afac5(_0x2542cd[_0x6aa8('0x15')][_0x6aa8('0x13')]);}})[_0x6aa8('0x16')](function(_0xcbce0){logger[_0x6aa8('0x11')]('CrmActionsList,\x20%s,\x20%s',_0x3e017d,_0xcbce0);_0x42d1f1(_0xcbce0);});});} \ No newline at end of file diff --git a/server/api/crmActionsList/index.js b/server/api/crmActionsList/index.js index 120f9f3..0345056 100644 --- a/server/api/crmActionsList/index.js +++ b/server/api/crmActionsList/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x962e=['../../config/environment','./crmActionsList.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x430042,_0x5004b9){var _0x29a17a=function(_0x49d8e8){while(--_0x49d8e8){_0x430042['push'](_0x430042['shift']());}};_0x29a17a(++_0x5004b9);}(_0x962e,0xa2));var _0xe962=function(_0x4429e0,_0xee6f1f){_0x4429e0=_0x4429e0-0x0;var _0x51a5b3=_0x962e[_0x4429e0];return _0x51a5b3;};'use strict';var multer=require(_0xe962('0x0'));var util=require(_0xe962('0x1'));var path=require(_0xe962('0x2'));var timeout=require(_0xe962('0x3'));var express=require(_0xe962('0x4'));var router=express[_0xe962('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe962('0x6'));var controller=require(_0xe962('0x7'));router[_0xe962('0x8')]('/',auth[_0xe962('0x9')](),controller[_0xe962('0xa')]);router[_0xe962('0x8')](_0xe962('0xb'),auth[_0xe962('0x9')](),controller[_0xe962('0xc')]);router['get'](_0xe962('0xd'),auth[_0xe962('0x9')](),controller[_0xe962('0xe')]);router[_0xe962('0xf')]('/',auth['isAuthenticated'](),controller[_0xe962('0x10')]);router[_0xe962('0x11')](_0xe962('0xd'),auth['isAuthenticated'](),controller[_0xe962('0x12')]);router[_0xe962('0x13')]('/:id',auth[_0xe962('0x9')](),controller[_0xe962('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9dd=['util','express','Router','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','exports','multer'];(function(_0x264af8,_0x57be25){var _0x547c81=function(_0x1f316e){while(--_0x1f316e){_0x264af8['push'](_0x264af8['shift']());}};_0x547c81(++_0x57be25);}(_0xa9dd,0x1df));var _0xda9d=function(_0x483ab9,_0x419148){_0x483ab9=_0x483ab9-0x0;var _0x35043b=_0xa9dd[_0x483ab9];return _0x35043b;};'use strict';var multer=require(_0xda9d('0x0'));var util=require(_0xda9d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xda9d('0x2'));var router=express[_0xda9d('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xda9d('0x4'));var controller=require('./crmActionsList.controller');router[_0xda9d('0x5')]('/',auth[_0xda9d('0x6')](),controller[_0xda9d('0x7')]);router[_0xda9d('0x5')]('/describe',auth[_0xda9d('0x6')](),controller[_0xda9d('0x8')]);router[_0xda9d('0x5')](_0xda9d('0x9'),auth['isAuthenticated'](),controller[_0xda9d('0xa')]);router[_0xda9d('0xb')]('/',auth[_0xda9d('0x6')](),controller[_0xda9d('0xc')]);router[_0xda9d('0xd')]('/:id',auth[_0xda9d('0x6')](),controller[_0xda9d('0xe')]);router['delete'](_0xda9d('0x9'),auth[_0xda9d('0x6')](),controller['destroy']);module[_0xda9d('0xf')]=router; \ No newline at end of file diff --git a/server/api/crmMyCompanies/crmMyCompanies.attributes.js b/server/api/crmMyCompanies/crmMyCompanies.attributes.js index 655c669..fefc0c0 100644 --- a/server/api/crmMyCompanies/crmMyCompanies.attributes.js +++ b/server/api/crmMyCompanies/crmMyCompanies.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x77df=['STRING','exports'];(function(_0x22a140,_0x386afe){var _0xc7fc3f=function(_0x4b9543){while(--_0x4b9543){_0x22a140['push'](_0x22a140['shift']());}};_0xc7fc3f(++_0x386afe);}(_0x77df,0x19f));var _0xf77d=function(_0x3f14c3,_0x10d3de){_0x3f14c3=_0x3f14c3-0x0;var _0x3e86aa=_0x77df[_0x3f14c3];return _0x3e86aa;};'use strict';var Sequelize=require('sequelize');module[_0xf77d('0x0')]={'saName':{'type':Sequelize[_0xf77d('0x1')],'unique':'name','allowNull':![]},'saWebsite':{'type':Sequelize[_0xf77d('0x1')]},'saPhone':{'type':Sequelize[_0xf77d('0x1')]},'saFax':{'type':Sequelize[_0xf77d('0x1')]},'saEmail':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'saStreet':{'type':Sequelize['STRING']},'saPostalCode':{'type':Sequelize[_0xf77d('0x1')]},'saCity':{'type':Sequelize[_0xf77d('0x1')]},'saCountry':{'type':Sequelize['STRING']},'saISOCode':{'type':Sequelize['STRING'](0x3)},'saFiscalCode':{'type':Sequelize['STRING'](0x10)},'saPIVA':{'type':Sequelize[_0xf77d('0x1')](0xb)},'saSDICode':{'type':Sequelize[_0xf77d('0x1')](0x6)},'saFiscalMessage':{'type':Sequelize['STRING']},'saEurope':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0x0a7d=['STRING','BOOLEAN','sequelize','exports'];(function(_0x33f412,_0x52b348){var _0x2a3a39=function(_0x39b82c){while(--_0x39b82c){_0x33f412['push'](_0x33f412['shift']());}};_0x2a3a39(++_0x52b348);}(_0x0a7d,0xda));var _0xd0a7=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0x0a7d[_0x15b399];return _0x199f2d;};'use strict';var Sequelize=require(_0xd0a7('0x0'));module[_0xd0a7('0x1')]={'saName':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'saWebsite':{'type':Sequelize[_0xd0a7('0x2')]},'saPhone':{'type':Sequelize['STRING']},'saFax':{'type':Sequelize[_0xd0a7('0x2')]},'saEmail':{'type':Sequelize[_0xd0a7('0x2')],'validate':{'isEmail':!![]}},'saStreet':{'type':Sequelize[_0xd0a7('0x2')]},'saPostalCode':{'type':Sequelize['STRING']},'saCity':{'type':Sequelize[_0xd0a7('0x2')]},'saCountry':{'type':Sequelize['STRING']},'saISOCode':{'type':Sequelize[_0xd0a7('0x2')](0x3)},'saFiscalCode':{'type':Sequelize[_0xd0a7('0x2')](0x10)},'saPIVA':{'type':Sequelize[_0xd0a7('0x2')](0xb)},'saSDICode':{'type':Sequelize[_0xd0a7('0x2')](0x6)},'saFiscalMessage':{'type':Sequelize['STRING']},'saEurope':{'type':Sequelize[_0xd0a7('0x3')]}}; \ No newline at end of file diff --git a/server/api/crmMyCompanies/crmMyCompanies.controller.js b/server/api/crmMyCompanies/crmMyCompanies.controller.js index d6eafe3..31dcac9 100644 --- a/server/api/crmMyCompanies/crmMyCompanies.controller.js +++ b/server/api/crmMyCompanies/crmMyCompanies.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47c5=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','destroy','then','end','error','stack','name','send','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','day','add','merge','filter','where','map','crmMyCompany','includeAll','include','findAll','catch','show','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel'];(function(_0x58158c,_0x1b3466){var _0x2679fc=function(_0x2e356a){while(--_0x2e356a){_0x58158c['push'](_0x58158c['shift']());}};_0x2679fc(++_0x1b3466);}(_0x47c5,0x165));var _0x547c=function(_0xcf07d2,_0x34d380){_0xcf07d2=_0xcf07d2-0x0;var _0x2c141b=_0x47c5[_0xcf07d2];return _0x2c141b;};'use strict';var pdf=require(_0x547c('0x0'));var emlformat=require(_0x547c('0x1'));var rimraf=require(_0x547c('0x2'));var zipdir=require(_0x547c('0x3'));var jsonpatch=require(_0x547c('0x4'));var rp=require(_0x547c('0x5'));var moment=require('moment');var BPromise=require(_0x547c('0x6'));var Mustache=require(_0x547c('0x7'));var util=require('util');var path=require(_0x547c('0x8'));var sox=require(_0x547c('0x9'));var csv=require('to-csv');var ejs=require(_0x547c('0xa'));var fs=require('fs');var _=require(_0x547c('0xb'));var squel=require(_0x547c('0xc'));var crypto=require(_0x547c('0xd'));var jsforce=require(_0x547c('0xe'));var deskjs=require(_0x547c('0xf'));var toCsv=require(_0x547c('0x10'));var querystring=require(_0x547c('0x11'));var Papa=require(_0x547c('0x12'));var qs=require(_0x547c('0x13'));var logger=require(_0x547c('0x14'))(_0x547c('0x15'));var utils=require(_0x547c('0x16'));var config=require(_0x547c('0x17'));var db=require(_0x547c('0x18'))['db'];function respondWithStatusCode(_0x8addbe,_0x44ab17){_0x44ab17=_0x44ab17||0xcc;return function(_0x549bf0){if(_0x549bf0){return _0x8addbe[_0x547c('0x19')](_0x44ab17);}return _0x8addbe[_0x547c('0x1a')](_0x44ab17)['end']();};}function respondWithResult(_0x436c19,_0x201d95){_0x201d95=_0x201d95||0xc8;return function(_0x171ae4){if(_0x171ae4){return _0x436c19[_0x547c('0x1a')](_0x201d95)[_0x547c('0x1b')](_0x171ae4);}};}function respondWithFilteredResult(_0x150317,_0x2bc289){return function(_0xa3c7b0){if(_0xa3c7b0){var _0x255aa6=_0xa3c7b0[_0x547c('0x1c')],_0x161991=_0x2bc289[_0x547c('0x1d')],_0x240243=_0x2bc289[_0x547c('0x1d')]+_0x2bc289[_0x547c('0x1e')],_0x103455;if(_0x240243>=_0x255aa6){_0x240243=_0x255aa6;_0x103455=0xc8;}else{_0x103455=0xce;}_0x150317[_0x547c('0x1a')](_0x103455);return _0x150317[_0x547c('0x1f')]('Content-Range',_0x161991+'-'+_0x240243+'/'+_0x255aa6)['json'](_0xa3c7b0);}return null;};}function patchUpdates(_0x23fa9e){return function(_0x199e4f){try{jsonpatch[_0x547c('0x20')](_0x199e4f,_0x23fa9e,!![]);}catch(_0x4a8901){return BPromise[_0x547c('0x21')](_0x4a8901);}return _0x199e4f[_0x547c('0x22')]();};}function saveUpdates(_0x1ddbd3,_0x58ddc9){return function(_0x4511d3){if(_0x4511d3){return _0x4511d3[_0x547c('0x23')](_0x1ddbd3)['then'](function(_0x5453f9){return _0x5453f9;});}return null;};}function removeEntity(_0x35040a,_0x4ce2a6){return function(_0x4f20c1){if(_0x4f20c1){return _0x4f20c1[_0x547c('0x24')]()[_0x547c('0x25')](function(){_0x35040a['status'](0xcc)[_0x547c('0x26')]();});}};}function handleEntityNotFound(_0x17fd97,_0x436e67){return function(_0x4c718c){if(!_0x4c718c){_0x17fd97[_0x547c('0x19')](0x194);}return _0x4c718c;};}function handleError(_0x361c5c,_0x470694){_0x470694=_0x470694||0x1f4;return function(_0x26823c){logger[_0x547c('0x27')](_0x26823c[_0x547c('0x28')]);if(_0x26823c[_0x547c('0x29')]){delete _0x26823c[_0x547c('0x29')];}_0x361c5c['status'](_0x470694)[_0x547c('0x2a')](_0x26823c);};}exports['index']=function(_0x5b05f2,_0x4855fd){var _0x478f04={},_0x2c725d={},_0x4c5256={'count':0x0,'rows':[]};var _0x93985c=db['crmMyCompany'][_0x547c('0x2b')];_0x2c725d['model']=_[_0x547c('0x2c')](_0x93985c);var _0x1bb0a3={'dateStart':_0x5b05f2[_0x547c('0x2d')][_0x547c('0x2e')],'dateEnd':_0x5b05f2[_0x547c('0x2d')]['dateEnd']};delete _0x5b05f2['query'][_0x547c('0x2e')];delete _0x5b05f2['query'][_0x547c('0x2f')];_0x2c725d[_0x547c('0x2d')]=_[_0x547c('0x2c')](_0x5b05f2[_0x547c('0x2d')]);_0x2c725d[_0x547c('0x30')]=_[_0x547c('0x31')](_0x2c725d[_0x547c('0x32')],_0x2c725d['query']);_0x478f04['attributes']=_[_0x547c('0x31')](_0x2c725d[_0x547c('0x32')],qs[_0x547c('0x33')](_0x5b05f2[_0x547c('0x2d')][_0x547c('0x33')]));_0x478f04[_0x547c('0x34')]=_0x478f04[_0x547c('0x34')][_0x547c('0x35')]?_0x478f04[_0x547c('0x34')]:_0x2c725d[_0x547c('0x32')];if(!_0x5b05f2[_0x547c('0x2d')][_0x547c('0x36')](_0x547c('0x37'))){_0x478f04[_0x547c('0x1e')]=qs['limit'](_0x5b05f2[_0x547c('0x2d')]['limit']);_0x478f04['offset']=qs['offset'](_0x5b05f2[_0x547c('0x2d')][_0x547c('0x1d')]);}_0x478f04[_0x547c('0x38')]=qs[_0x547c('0x39')](_0x5b05f2[_0x547c('0x2d')][_0x547c('0x39')]);_0x478f04['where']=qs['filters'](_['pick'](_0x5b05f2[_0x547c('0x2d')],_0x2c725d[_0x547c('0x30')]));if(_0x1bb0a3[_0x547c('0x2e')]){if(_0x1bb0a3[_0x547c('0x2f')]){_0x1bb0a3[_0x547c('0x2f')]=moment(_0x1bb0a3[_0x547c('0x2f')])['add'](0x1,_0x547c('0x3a'));}else{_0x1bb0a3['dateEnd']=moment(_0x1bb0a3[_0x547c('0x2e')])[_0x547c('0x3b')](0x1,'day');}_[_0x547c('0x3c')](_0x478f04['where'],{'createdAt':{'$gte':_0x1bb0a3['dateStart'],'$lte':_0x1bb0a3[_0x547c('0x2f')]}});}if(_0x5b05f2[_0x547c('0x2d')][_0x547c('0x3d')]){_0x478f04[_0x547c('0x3e')]=_['merge'](_0x478f04['where'],{'$or':_[_0x547c('0x3f')](_0x478f04[_0x547c('0x34')],function(_0x411c6f){var _0x5c8ed0={};_0x5c8ed0[_0x411c6f]={'$like':'%'+_0x5b05f2[_0x547c('0x2d')][_0x547c('0x3d')]+'%'};return _0x5c8ed0;})});}_0x478f04=_[_0x547c('0x3c')]({},_0x478f04,_0x5b05f2['options']);var _0x40184f={'where':_0x478f04[_0x547c('0x3e')]};return db[_0x547c('0x40')]['count'](_0x40184f)[_0x547c('0x25')](function(_0xc28dc0){_0x4c5256['count']=_0xc28dc0;if(_0x5b05f2[_0x547c('0x2d')][_0x547c('0x41')]){_0x478f04[_0x547c('0x42')]=[{'all':!![]}];}return db['crmMyCompany'][_0x547c('0x43')](_0x478f04);})['then'](function(_0xd14f4e){_0x4c5256['rows']=_0xd14f4e;return _0x4c5256;})[_0x547c('0x25')](respondWithFilteredResult(_0x4855fd,_0x478f04))[_0x547c('0x44')](handleError(_0x4855fd,null));};exports[_0x547c('0x45')]=function(_0x3797d3,_0x139a61){var _0x3a2508={'raw':![],'where':{'id':_0x3797d3['params']['id']}},_0x5a271a={};_0x5a271a[_0x547c('0x32')]=_[_0x547c('0x2c')](db[_0x547c('0x40')]['rawAttributes']);_0x5a271a[_0x547c('0x2d')]=_[_0x547c('0x2c')](_0x3797d3[_0x547c('0x2d')]);_0x5a271a[_0x547c('0x30')]=_[_0x547c('0x31')](_0x5a271a[_0x547c('0x32')],_0x5a271a['query']);_0x3a2508[_0x547c('0x34')]=_[_0x547c('0x31')](_0x5a271a[_0x547c('0x32')],qs['fields'](_0x3797d3[_0x547c('0x2d')][_0x547c('0x33')]));_0x3a2508[_0x547c('0x34')]=_0x3a2508[_0x547c('0x34')]['length']?_0x3a2508[_0x547c('0x34')]:_0x5a271a['model'];if(_0x3797d3[_0x547c('0x2d')]['includeAll']){_0x3a2508[_0x547c('0x42')]=[{'all':!![]}];}_0x3a2508=_[_0x547c('0x3c')]({},_0x3a2508,_0x3797d3['options']);return db[_0x547c('0x40')][_0x547c('0x46')](_0x3a2508)[_0x547c('0x25')](handleEntityNotFound(_0x139a61,null))[_0x547c('0x25')](respondWithResult(_0x139a61,null))['catch'](handleError(_0x139a61,null));};exports[_0x547c('0x47')]=function(_0x484ede,_0x5649b6){return db[_0x547c('0x40')][_0x547c('0x47')](_0x484ede[_0x547c('0x48')],{})[_0x547c('0x25')](respondWithResult(_0x5649b6,0xc9))[_0x547c('0x44')](handleError(_0x5649b6,null));};exports[_0x547c('0x23')]=function(_0x153392,_0x444b2c){if(_0x153392[_0x547c('0x48')]['id']){delete _0x153392[_0x547c('0x48')]['id'];}return db[_0x547c('0x40')][_0x547c('0x46')]({'where':{'id':_0x153392['params']['id']}})['then'](handleEntityNotFound(_0x444b2c,null))[_0x547c('0x25')](saveUpdates(_0x153392[_0x547c('0x48')],null))['then'](respondWithResult(_0x444b2c,null))[_0x547c('0x44')](handleError(_0x444b2c,null));};exports[_0x547c('0x24')]=function(_0x3ab131,_0x4abae7){return db[_0x547c('0x40')][_0x547c('0x46')]({'where':{'id':_0x3ab131['params']['id']}})[_0x547c('0x25')](handleEntityNotFound(_0x4abae7,null))['then'](removeEntity(_0x4abae7,null))[_0x547c('0x44')](handleError(_0x4abae7,null));};exports[_0x547c('0x49')]=function(_0x1bdaf0,_0x49b5d3){return db[_0x547c('0x40')]['describe']()[_0x547c('0x25')](respondWithResult(_0x49b5d3,null))[_0x547c('0x44')](handleError(_0x49b5d3,null));}; \ No newline at end of file +var _0x583c=['length','hasOwnProperty','limit','order','where','pick','add','day','merge','filter','options','count','includeAll','crmMyCompany','findAll','rows','catch','include','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','set','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','rawAttributes','model','dateStart','query','dateEnd','keys','filters','intersection','fields','attributes'];(function(_0x138836,_0x229129){var _0x322688=function(_0x54b101){while(--_0x54b101){_0x138836['push'](_0x138836['shift']());}};_0x322688(++_0x229129);}(_0x583c,0x12b));var _0xc583=function(_0x1c3370,_0xf617e8){_0x1c3370=_0x1c3370-0x0;var _0xa9b358=_0x583c[_0x1c3370];return _0xa9b358;};'use strict';var pdf=require(_0xc583('0x0'));var emlformat=require(_0xc583('0x1'));var rimraf=require(_0xc583('0x2'));var zipdir=require(_0xc583('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc583('0x4'));var moment=require(_0xc583('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc583('0x6'));var path=require(_0xc583('0x7'));var sox=require('sox');var csv=require(_0xc583('0x8'));var ejs=require(_0xc583('0x9'));var fs=require('fs');var _=require(_0xc583('0xa'));var squel=require(_0xc583('0xb'));var crypto=require('crypto');var jsforce=require(_0xc583('0xc'));var deskjs=require(_0xc583('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc583('0xe'));var Papa=require(_0xc583('0xf'));var qs=require(_0xc583('0x10'));var logger=require(_0xc583('0x11'))(_0xc583('0x12'));var utils=require('../../config/utils');var config=require(_0xc583('0x13'));var db=require(_0xc583('0x14'))['db'];function respondWithStatusCode(_0x4decd8,_0x23c51a){_0x23c51a=_0x23c51a||0xcc;return function(_0x2994c5){if(_0x2994c5){return _0x4decd8['sendStatus'](_0x23c51a);}return _0x4decd8[_0xc583('0x15')](_0x23c51a)[_0xc583('0x16')]();};}function respondWithResult(_0x24343b,_0x267da0){_0x267da0=_0x267da0||0xc8;return function(_0x33c2c5){if(_0x33c2c5){return _0x24343b[_0xc583('0x15')](_0x267da0)[_0xc583('0x17')](_0x33c2c5);}};}function respondWithFilteredResult(_0xf81809,_0x1c6b79){return function(_0x5403a3){if(_0x5403a3){var _0x21cf25=_0x5403a3['count'],_0x51ecd7=_0x1c6b79[_0xc583('0x18')],_0x19f46a=_0x1c6b79[_0xc583('0x18')]+_0x1c6b79['limit'],_0x299fa1;if(_0x19f46a>=_0x21cf25){_0x19f46a=_0x21cf25;_0x299fa1=0xc8;}else{_0x299fa1=0xce;}_0xf81809[_0xc583('0x15')](_0x299fa1);return _0xf81809[_0xc583('0x19')]('Content-Range',_0x51ecd7+'-'+_0x19f46a+'/'+_0x21cf25)[_0xc583('0x17')](_0x5403a3);}return null;};}function patchUpdates(_0x8a2d84){return function(_0x12aac2){try{jsonpatch[_0xc583('0x1a')](_0x12aac2,_0x8a2d84,!![]);}catch(_0x5433ec){return BPromise[_0xc583('0x1b')](_0x5433ec);}return _0x12aac2['save']();};}function saveUpdates(_0x227ec2,_0x471db2){return function(_0xfd9a60){if(_0xfd9a60){return _0xfd9a60[_0xc583('0x1c')](_0x227ec2)[_0xc583('0x1d')](function(_0x12b910){return _0x12b910;});}return null;};}function removeEntity(_0x3ce81b,_0x26756c){return function(_0x37fcd4){if(_0x37fcd4){return _0x37fcd4[_0xc583('0x1e')]()[_0xc583('0x1d')](function(){_0x3ce81b[_0xc583('0x15')](0xcc)[_0xc583('0x16')]();});}};}function handleEntityNotFound(_0x478ee1,_0x542256){return function(_0x34b353){if(!_0x34b353){_0x478ee1[_0xc583('0x1f')](0x194);}return _0x34b353;};}function handleError(_0x8443dc,_0x5ceef1){_0x5ceef1=_0x5ceef1||0x1f4;return function(_0x1521e2){logger[_0xc583('0x20')](_0x1521e2[_0xc583('0x21')]);if(_0x1521e2[_0xc583('0x22')]){delete _0x1521e2[_0xc583('0x22')];}_0x8443dc['status'](_0x5ceef1)['send'](_0x1521e2);};}exports[_0xc583('0x23')]=function(_0x4f366b,_0x45ef74){var _0xcbe9b2={},_0xbabf24={},_0x1e7809={'count':0x0,'rows':[]};var _0x24aab5=db['crmMyCompany'][_0xc583('0x24')];_0xbabf24[_0xc583('0x25')]=_['keys'](_0x24aab5);var _0x162c85={'dateStart':_0x4f366b['query'][_0xc583('0x26')],'dateEnd':_0x4f366b[_0xc583('0x27')][_0xc583('0x28')]};delete _0x4f366b[_0xc583('0x27')][_0xc583('0x26')];delete _0x4f366b[_0xc583('0x27')][_0xc583('0x28')];_0xbabf24['query']=_[_0xc583('0x29')](_0x4f366b[_0xc583('0x27')]);_0xbabf24[_0xc583('0x2a')]=_[_0xc583('0x2b')](_0xbabf24[_0xc583('0x25')],_0xbabf24[_0xc583('0x27')]);_0xcbe9b2['attributes']=_[_0xc583('0x2b')](_0xbabf24['model'],qs['fields'](_0x4f366b[_0xc583('0x27')][_0xc583('0x2c')]));_0xcbe9b2[_0xc583('0x2d')]=_0xcbe9b2[_0xc583('0x2d')][_0xc583('0x2e')]?_0xcbe9b2['attributes']:_0xbabf24[_0xc583('0x25')];if(!_0x4f366b[_0xc583('0x27')][_0xc583('0x2f')]('nolimit')){_0xcbe9b2[_0xc583('0x30')]=qs['limit'](_0x4f366b[_0xc583('0x27')][_0xc583('0x30')]);_0xcbe9b2[_0xc583('0x18')]=qs[_0xc583('0x18')](_0x4f366b[_0xc583('0x27')]['offset']);}_0xcbe9b2[_0xc583('0x31')]=qs['sort'](_0x4f366b[_0xc583('0x27')]['sort']);_0xcbe9b2[_0xc583('0x32')]=qs[_0xc583('0x2a')](_[_0xc583('0x33')](_0x4f366b[_0xc583('0x27')],_0xbabf24[_0xc583('0x2a')]));if(_0x162c85[_0xc583('0x26')]){if(_0x162c85['dateEnd']){_0x162c85['dateEnd']=moment(_0x162c85[_0xc583('0x28')])[_0xc583('0x34')](0x1,'day');}else{_0x162c85[_0xc583('0x28')]=moment(_0x162c85[_0xc583('0x26')])[_0xc583('0x34')](0x1,_0xc583('0x35'));}_[_0xc583('0x36')](_0xcbe9b2[_0xc583('0x32')],{'createdAt':{'$gte':_0x162c85['dateStart'],'$lte':_0x162c85[_0xc583('0x28')]}});}if(_0x4f366b['query'][_0xc583('0x37')]){_0xcbe9b2[_0xc583('0x32')]=_[_0xc583('0x36')](_0xcbe9b2['where'],{'$or':_['map'](_0xcbe9b2['attributes'],function(_0x26a348){var _0x46b31f={};_0x46b31f[_0x26a348]={'$like':'%'+_0x4f366b[_0xc583('0x27')][_0xc583('0x37')]+'%'};return _0x46b31f;})});}_0xcbe9b2=_['merge']({},_0xcbe9b2,_0x4f366b[_0xc583('0x38')]);var _0x136776={'where':_0xcbe9b2['where']};return db['crmMyCompany'][_0xc583('0x39')](_0x136776)['then'](function(_0x254592){_0x1e7809[_0xc583('0x39')]=_0x254592;if(_0x4f366b[_0xc583('0x27')][_0xc583('0x3a')]){_0xcbe9b2['include']=[{'all':!![]}];}return db[_0xc583('0x3b')][_0xc583('0x3c')](_0xcbe9b2);})[_0xc583('0x1d')](function(_0x164133){_0x1e7809[_0xc583('0x3d')]=_0x164133;return _0x1e7809;})['then'](respondWithFilteredResult(_0x45ef74,_0xcbe9b2))[_0xc583('0x3e')](handleError(_0x45ef74,null));};exports['show']=function(_0x4b78df,_0x2f97a4){var _0x21e231={'raw':![],'where':{'id':_0x4b78df['params']['id']}},_0x5788c7={};_0x5788c7[_0xc583('0x25')]=_[_0xc583('0x29')](db[_0xc583('0x3b')][_0xc583('0x24')]);_0x5788c7['query']=_[_0xc583('0x29')](_0x4b78df['query']);_0x5788c7[_0xc583('0x2a')]=_['intersection'](_0x5788c7[_0xc583('0x25')],_0x5788c7[_0xc583('0x27')]);_0x21e231[_0xc583('0x2d')]=_[_0xc583('0x2b')](_0x5788c7[_0xc583('0x25')],qs['fields'](_0x4b78df[_0xc583('0x27')][_0xc583('0x2c')]));_0x21e231[_0xc583('0x2d')]=_0x21e231['attributes']['length']?_0x21e231['attributes']:_0x5788c7[_0xc583('0x25')];if(_0x4b78df['query'][_0xc583('0x3a')]){_0x21e231[_0xc583('0x3f')]=[{'all':!![]}];}_0x21e231=_[_0xc583('0x36')]({},_0x21e231,_0x4b78df[_0xc583('0x38')]);return db[_0xc583('0x3b')][_0xc583('0x40')](_0x21e231)[_0xc583('0x1d')](handleEntityNotFound(_0x2f97a4,null))[_0xc583('0x1d')](respondWithResult(_0x2f97a4,null))[_0xc583('0x3e')](handleError(_0x2f97a4,null));};exports[_0xc583('0x41')]=function(_0x174a14,_0x5a2c98){return db[_0xc583('0x3b')][_0xc583('0x41')](_0x174a14[_0xc583('0x42')],{})[_0xc583('0x1d')](respondWithResult(_0x5a2c98,0xc9))['catch'](handleError(_0x5a2c98,null));};exports[_0xc583('0x1c')]=function(_0x385da2,_0x17825e){if(_0x385da2[_0xc583('0x42')]['id']){delete _0x385da2[_0xc583('0x42')]['id'];}return db[_0xc583('0x3b')][_0xc583('0x40')]({'where':{'id':_0x385da2[_0xc583('0x43')]['id']}})[_0xc583('0x1d')](handleEntityNotFound(_0x17825e,null))['then'](saveUpdates(_0x385da2[_0xc583('0x42')],null))[_0xc583('0x1d')](respondWithResult(_0x17825e,null))[_0xc583('0x3e')](handleError(_0x17825e,null));};exports[_0xc583('0x1e')]=function(_0x3c442e,_0xc42b2a){return db[_0xc583('0x3b')][_0xc583('0x40')]({'where':{'id':_0x3c442e[_0xc583('0x43')]['id']}})[_0xc583('0x1d')](handleEntityNotFound(_0xc42b2a,null))[_0xc583('0x1d')](removeEntity(_0xc42b2a,null))[_0xc583('0x3e')](handleError(_0xc42b2a,null));};exports[_0xc583('0x44')]=function(_0x4c486b,_0xaf0ce6){return db[_0xc583('0x3b')][_0xc583('0x44')]()[_0xc583('0x1d')](respondWithResult(_0xaf0ce6,null))[_0xc583('0x3e')](handleError(_0xaf0ce6,null));}; \ No newline at end of file diff --git a/server/api/crmMyCompanies/crmMyCompanies.model.js b/server/api/crmMyCompanies/crmMyCompanies.model.js index e282783..cf1de2a 100644 --- a/server/api/crmMyCompanies/crmMyCompanies.model.js +++ b/server/api/crmMyCompanies/crmMyCompanies.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee26=['define','crmMyCompany','crm_maycompanies','util','../../config/logger','moment','bluebird','request-promise','exports'];(function(_0x241757,_0x403417){var _0x1c622d=function(_0x45173e){while(--_0x45173e){_0x241757['push'](_0x241757['shift']());}};_0x1c622d(++_0x403417);}(_0xee26,0x9c));var _0x6ee2=function(_0x368763,_0x4be8e9){_0x368763=_0x368763-0x0;var _0x103266=_0xee26[_0x368763];return _0x103266;};'use strict';var _=require('lodash');var util=require(_0x6ee2('0x0'));var logger=require(_0x6ee2('0x1'))('api');var moment=require(_0x6ee2('0x2'));var BPromise=require(_0x6ee2('0x3'));var rp=require(_0x6ee2('0x4'));var attributes=require('./crmMyCompanies.attributes');module[_0x6ee2('0x5')]=function(_0x53fca0,_0x20438e){return _0x53fca0[_0x6ee2('0x6')](_0x6ee2('0x7'),attributes,{'tableName':_0x6ee2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd143=['api','moment','bluebird','request-promise','./crmMyCompanies.attributes','exports','define','crm_maycompanies','lodash','../../config/logger'];(function(_0x2d1940,_0x11fa13){var _0x308dc1=function(_0x5ec05d){while(--_0x5ec05d){_0x2d1940['push'](_0x2d1940['shift']());}};_0x308dc1(++_0x11fa13);}(_0xd143,0xbc));var _0x3d14=function(_0x571491,_0x18714e){_0x571491=_0x571491-0x0;var _0x575206=_0xd143[_0x571491];return _0x575206;};'use strict';var _=require(_0x3d14('0x0'));var util=require('util');var logger=require(_0x3d14('0x1'))(_0x3d14('0x2'));var moment=require(_0x3d14('0x3'));var BPromise=require(_0x3d14('0x4'));var rp=require(_0x3d14('0x5'));var attributes=require(_0x3d14('0x6'));module[_0x3d14('0x7')]=function(_0xd1a14a,_0x4889b5){return _0xd1a14a[_0x3d14('0x8')]('crmMyCompany',attributes,{'tableName':_0x3d14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/crmMyCompanies/crmMyCompanies.rpc.js b/server/api/crmMyCompanies/crmMyCompanies.rpc.js index 165b94d..15836b9 100644 --- a/server/api/crmMyCompanies/crmMyCompanies.rpc.js +++ b/server/api/crmMyCompanies/crmMyCompanies.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8d6=['crmMyCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','crmMyCompany,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x459db4,_0x46812c){var _0x25bbb9=function(_0x428049){while(--_0x428049){_0x459db4['push'](_0x459db4['shift']());}};_0x25bbb9(++_0x46812c);}(_0xd8d6,0x70));var _0x6d8d=function(_0x5b1636,_0x560a6e){_0x5b1636=_0x5b1636-0x0;var _0x2982d8=_0xd8d6[_0x5b1636];return _0x2982d8;};'use strict';var _=require(_0x6d8d('0x0'));var util=require(_0x6d8d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require(_0x6d8d('0x2'))['db'];var utils=require(_0x6d8d('0x3'));var logger=require(_0x6d8d('0x4'))(_0x6d8d('0x5'));var config=require(_0x6d8d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6d8d('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x557e73,_0x20b573,_0x2750ea){return new BPromise(function(_0x27fd05,_0x597337){return client[_0x6d8d('0x8')](_0x557e73,_0x2750ea)[_0x6d8d('0x9')](function(_0x2f8693){logger[_0x6d8d('0xa')](_0x6d8d('0xb'),_0x20b573,_0x6d8d('0xc'));logger[_0x6d8d('0xd')](_0x6d8d('0xe'),_0x20b573,'request\x20sent',JSON[_0x6d8d('0xf')](_0x2f8693));if(_0x2f8693[_0x6d8d('0x10')]){if(_0x2f8693[_0x6d8d('0x10')][_0x6d8d('0x11')]===0x1f4){logger['error'](_0x6d8d('0xb'),_0x20b573,_0x2f8693[_0x6d8d('0x10')][_0x6d8d('0x12')]);return _0x597337(_0x2f8693[_0x6d8d('0x10')][_0x6d8d('0x12')]);}logger['error'](_0x6d8d('0xb'),_0x20b573,_0x2f8693[_0x6d8d('0x10')][_0x6d8d('0x12')]);return _0x27fd05(_0x2f8693[_0x6d8d('0x10')][_0x6d8d('0x12')]);}else{logger[_0x6d8d('0xa')](_0x6d8d('0xb'),_0x20b573,_0x6d8d('0xc'));_0x27fd05(_0x2f8693[_0x6d8d('0x13')][_0x6d8d('0x12')]);}})[_0x6d8d('0x14')](function(_0x1ad715){logger[_0x6d8d('0x10')](_0x6d8d('0xb'),_0x20b573,_0x1ad715);_0x597337(_0x1ad715);});});} \ No newline at end of file +var _0xcc94=['../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','crmMyCompany,\x20%s,\x20%s','request\x20sent','debug','crmMyCompany,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xcc94,0x10f));var _0x4cc9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcc94[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4cc9('0x0'));var util=require(_0x4cc9('0x1'));var moment=require(_0x4cc9('0x2'));var BPromise=require('bluebird');var rs=require(_0x4cc9('0x3'));var fs=require('fs');var db=require(_0x4cc9('0x4'))['db'];var utils=require(_0x4cc9('0x5'));var logger=require(_0x4cc9('0x6'))(_0x4cc9('0x7'));var config=require('../../config/environment');var jayson=require(_0x4cc9('0x8'));var client=jayson['client'][_0x4cc9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x541a90,_0x406289,_0x2bc338){return new BPromise(function(_0x61143d,_0x57fff8){return client[_0x4cc9('0xa')](_0x541a90,_0x2bc338)[_0x4cc9('0xb')](function(_0x43792c){logger[_0x4cc9('0xc')](_0x4cc9('0xd'),_0x406289,_0x4cc9('0xe'));logger[_0x4cc9('0xf')](_0x4cc9('0x10'),_0x406289,_0x4cc9('0xe'),JSON[_0x4cc9('0x11')](_0x43792c));if(_0x43792c['error']){if(_0x43792c['error'][_0x4cc9('0x12')]===0x1f4){logger[_0x4cc9('0x13')](_0x4cc9('0xd'),_0x406289,_0x43792c[_0x4cc9('0x13')][_0x4cc9('0x14')]);return _0x57fff8(_0x43792c[_0x4cc9('0x13')][_0x4cc9('0x14')]);}logger[_0x4cc9('0x13')](_0x4cc9('0xd'),_0x406289,_0x43792c[_0x4cc9('0x13')][_0x4cc9('0x14')]);return _0x61143d(_0x43792c[_0x4cc9('0x13')]['message']);}else{logger['info']('crmMyCompany,\x20%s,\x20%s',_0x406289,_0x4cc9('0xe'));_0x61143d(_0x43792c[_0x4cc9('0x15')][_0x4cc9('0x14')]);}})[_0x4cc9('0x16')](function(_0x491b00){logger[_0x4cc9('0x13')](_0x4cc9('0xd'),_0x406289,_0x491b00);_0x57fff8(_0x491b00);});});} \ No newline at end of file diff --git a/server/api/crmMyCompanies/index.js b/server/api/crmMyCompanies/index.js index 84fb13d..3ef4fca 100644 --- a/server/api/crmMyCompanies/index.js +++ b/server/api/crmMyCompanies/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84ff=['show','post','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./crmMyCompanies.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0x84ff,0x1ac));var _0xf84f=function(_0x1a7fd6,_0x3d03fc){_0x1a7fd6=_0x1a7fd6-0x0;var _0x5db905=_0x84ff[_0x1a7fd6];return _0x5db905;};'use strict';var multer=require('multer');var util=require(_0xf84f('0x0'));var path=require(_0xf84f('0x1'));var timeout=require(_0xf84f('0x2'));var express=require(_0xf84f('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xf84f('0x4'));var config=require(_0xf84f('0x5'));var controller=require(_0xf84f('0x6'));router[_0xf84f('0x7')]('/',auth[_0xf84f('0x8')](),controller[_0xf84f('0x9')]);router['get'](_0xf84f('0xa'),auth[_0xf84f('0x8')](),controller[_0xf84f('0xb')]);router[_0xf84f('0x7')]('/:id',auth[_0xf84f('0x8')](),controller[_0xf84f('0xc')]);router[_0xf84f('0xd')]('/',auth['isAuthenticated'](),controller[_0xf84f('0xe')]);router[_0xf84f('0xf')](_0xf84f('0x10'),auth['isAuthenticated'](),controller[_0xf84f('0x11')]);router[_0xf84f('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xf84f('0x13')]=router; \ No newline at end of file +var _0x5f63=['show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./crmMyCompanies.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5f63,0x117));var _0x35f6=function(_0x193f40,_0x17776a){_0x193f40=_0x193f40-0x0;var _0x4d55d2=_0x5f63[_0x193f40];return _0x4d55d2;};'use strict';var multer=require(_0x35f6('0x0'));var util=require(_0x35f6('0x1'));var path=require(_0x35f6('0x2'));var timeout=require(_0x35f6('0x3'));var express=require(_0x35f6('0x4'));var router=express[_0x35f6('0x5')]();var auth=require(_0x35f6('0x6'));var interaction=require(_0x35f6('0x7'));var config=require('../../config/environment');var controller=require(_0x35f6('0x8'));router[_0x35f6('0x9')]('/',auth[_0x35f6('0xa')](),controller[_0x35f6('0xb')]);router[_0x35f6('0x9')](_0x35f6('0xc'),auth['isAuthenticated'](),controller[_0x35f6('0xd')]);router[_0x35f6('0x9')](_0x35f6('0xe'),auth[_0x35f6('0xa')](),controller[_0x35f6('0xf')]);router[_0x35f6('0x10')]('/',auth[_0x35f6('0xa')](),controller['create']);router['put']('/:id',auth[_0x35f6('0xa')](),controller[_0x35f6('0x11')]);router[_0x35f6('0x12')]('/:id',auth[_0x35f6('0xa')](),controller[_0x35f6('0x13')]);module[_0x35f6('0x14')]=router; \ No newline at end of file diff --git a/server/api/crmNation/crmNation.attributes.js b/server/api/crmNation/crmNation.attributes.js index e39d92d..f77baf7 100644 --- a/server/api/crmNation/crmNation.attributes.js +++ b/server/api/crmNation/crmNation.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x20ef=['BOOLEAN','isoCode3','exports','STRING'];(function(_0x21e3b8,_0x23685a){var _0x3f9abd=function(_0x1ac8f1){while(--_0x1ac8f1){_0x21e3b8['push'](_0x21e3b8['shift']());}};_0x3f9abd(++_0x23685a);}(_0x20ef,0x9e));var _0xf20e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20ef[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xf20e('0x0')]={'name':{'type':Sequelize[_0xf20e('0x1')],'allowNull':![],'unique':'name'},'europe':{'type':Sequelize[_0xf20e('0x2')],'allowNull':![]},'isoCode3':{'type':Sequelize[_0xf20e('0x1')](0x3),'allowNull':![],'unique':_0xf20e('0x3')},'isoCode2':{'type':Sequelize[_0xf20e('0x1')](0x2),'allowNull':![],'unique':'isoCode2'}}; \ No newline at end of file +var _0x954a=['name','BOOLEAN','sequelize','STRING'];(function(_0x1aab74,_0x38a57b){var _0x396af2=function(_0x1c2e0d){while(--_0x1c2e0d){_0x1aab74['push'](_0x1aab74['shift']());}};_0x396af2(++_0x38a57b);}(_0x954a,0x66));var _0xa954=function(_0x391012,_0xf31c28){_0x391012=_0x391012-0x0;var _0x1827b4=_0x954a[_0x391012];return _0x1827b4;};'use strict';var Sequelize=require(_0xa954('0x0'));module['exports']={'name':{'type':Sequelize[_0xa954('0x1')],'allowNull':![],'unique':_0xa954('0x2')},'europe':{'type':Sequelize[_0xa954('0x3')],'allowNull':![]},'isoCode3':{'type':Sequelize[_0xa954('0x1')](0x3),'allowNull':![],'unique':'isoCode3'},'isoCode2':{'type':Sequelize[_0xa954('0x1')](0x2),'allowNull':![],'unique':'isoCode2'}}; \ No newline at end of file diff --git a/server/api/crmNation/crmNation.controller.js b/server/api/crmNation/crmNation.controller.js index d0cea82..61db0d5 100644 --- a/server/api/crmNation/crmNation.controller.js +++ b/server/api/crmNation/crmNation.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97b2=['sox','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','save','then','destroy','error','name','send','index','CrmNation','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','type','key','options','includeAll','include','findAll','rows','catch','show','params','find','create','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path'];(function(_0x1e9ce6,_0x26ed2e){var _0x1e02ed=function(_0x367763){while(--_0x367763){_0x1e9ce6['push'](_0x1e9ce6['shift']());}};_0x1e02ed(++_0x26ed2e);}(_0x97b2,0x1b7));var _0x297b=function(_0x207d2f,_0x44400f){_0x207d2f=_0x207d2f-0x0;var _0x3c3498=_0x97b2[_0x207d2f];return _0x3c3498;};'use strict';var pdf=require(_0x297b('0x0'));var emlformat=require(_0x297b('0x1'));var rimraf=require(_0x297b('0x2'));var zipdir=require(_0x297b('0x3'));var jsonpatch=require(_0x297b('0x4'));var rp=require(_0x297b('0x5'));var moment=require('moment');var BPromise=require(_0x297b('0x6'));var Mustache=require(_0x297b('0x7'));var util=require('util');var path=require(_0x297b('0x8'));var sox=require(_0x297b('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x297b('0xa'));var crypto=require(_0x297b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x297b('0xc'));var toCsv=require(_0x297b('0xd'));var querystring=require('querystring');var Papa=require(_0x297b('0xe'));var Redis=require('ioredis');var authService=require(_0x297b('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x297b('0x10'));var logger=require(_0x297b('0x11'))(_0x297b('0x12'));var utils=require(_0x297b('0x13'));var config=require(_0x297b('0x14'));var db=require(_0x297b('0x15'))['db'];function respondWithStatusCode(_0x3fcb02,_0x42c6b0){_0x42c6b0=_0x42c6b0||0xcc;return function(_0x17c231){if(_0x17c231){return _0x3fcb02[_0x297b('0x16')](_0x42c6b0);}return _0x3fcb02[_0x297b('0x17')](_0x42c6b0)[_0x297b('0x18')]();};}function respondWithResult(_0x16151d,_0x466abd){_0x466abd=_0x466abd||0xc8;return function(_0x27f44b){if(_0x27f44b){return _0x16151d['status'](_0x466abd)[_0x297b('0x19')](_0x27f44b);}};}function respondWithFilteredResult(_0x25e666,_0x5c2dad){return function(_0x376287){if(_0x376287){var _0x1a1434=_0x376287[_0x297b('0x1a')],_0x4455f3=_0x5c2dad['offset'],_0x241ff6=_0x5c2dad[_0x297b('0x1b')]+_0x5c2dad[_0x297b('0x1c')],_0x11469e;if(_0x241ff6>=_0x1a1434){_0x241ff6=_0x1a1434;_0x11469e=0xc8;}else{_0x11469e=0xce;}_0x25e666[_0x297b('0x17')](_0x11469e);return _0x25e666['set']('Content-Range',_0x4455f3+'-'+_0x241ff6+'/'+_0x1a1434)[_0x297b('0x19')](_0x376287);}return null;};}function patchUpdates(_0x5010ce){return function(_0x209b39){try{jsonpatch[_0x297b('0x1d')](_0x209b39,_0x5010ce,!![]);}catch(_0x2379dd){return BPromise[_0x297b('0x1e')](_0x2379dd);}return _0x209b39[_0x297b('0x1f')]();};}function saveUpdates(_0x48b92c,_0x478167){return function(_0x250b19){if(_0x250b19){return _0x250b19['update'](_0x48b92c)[_0x297b('0x20')](function(_0x367c09){return _0x367c09;});}return null;};}function removeEntity(_0x44af9a,_0x200eb9){return function(_0x4776e1){if(_0x4776e1){return _0x4776e1[_0x297b('0x21')]()[_0x297b('0x20')](function(){_0x44af9a['status'](0xcc)[_0x297b('0x18')]();});}};}function handleEntityNotFound(_0x19d8f3,_0x3df595){return function(_0x56ed4b){if(!_0x56ed4b){_0x19d8f3[_0x297b('0x16')](0x194);}return _0x56ed4b;};}function handleError(_0x2ca784,_0x1ed4cd){_0x1ed4cd=_0x1ed4cd||0x1f4;return function(_0x106782){logger[_0x297b('0x22')](_0x106782['stack']);if(_0x106782['name']){delete _0x106782[_0x297b('0x23')];}_0x2ca784[_0x297b('0x17')](_0x1ed4cd)[_0x297b('0x24')](_0x106782);};}exports[_0x297b('0x25')]=function(_0x3f63dc,_0x2bb038){var _0x25383f={'raw':!![]},_0x52bb5c={},_0x4ab68b={'count':0x0,'rows':[]};var _0x4c7d77=db[_0x297b('0x26')]['rawAttributes'];_0x52bb5c['model']=_[_0x297b('0x27')](_0x4c7d77);_0x52bb5c[_0x297b('0x28')]=_[_0x297b('0x27')](_0x3f63dc[_0x297b('0x28')]);_0x52bb5c[_0x297b('0x29')]=_[_0x297b('0x2a')](_0x52bb5c['model'],_0x52bb5c[_0x297b('0x28')]);_0x25383f['attributes']=_[_0x297b('0x2a')](_0x52bb5c[_0x297b('0x2b')],qs[_0x297b('0x2c')](_0x3f63dc[_0x297b('0x28')][_0x297b('0x2c')]));_0x25383f[_0x297b('0x2d')]=_0x25383f[_0x297b('0x2d')][_0x297b('0x2e')]?_0x25383f[_0x297b('0x2d')]:_0x52bb5c[_0x297b('0x2b')];if(!_0x3f63dc[_0x297b('0x28')][_0x297b('0x2f')]('nolimit')){_0x25383f['limit']=qs[_0x297b('0x1c')](_0x3f63dc[_0x297b('0x28')][_0x297b('0x1c')]);_0x25383f[_0x297b('0x1b')]=qs['offset'](_0x3f63dc[_0x297b('0x28')]['offset']);}_0x25383f['order']=qs[_0x297b('0x30')](_0x3f63dc[_0x297b('0x28')][_0x297b('0x30')]);_0x25383f[_0x297b('0x31')]=qs['filters'](_[_0x297b('0x32')](_0x3f63dc['query'],_0x52bb5c[_0x297b('0x29')]));if(_0x3f63dc[_0x297b('0x28')]['filter']){_0x25383f[_0x297b('0x31')]=_[_0x297b('0x33')](_0x25383f['where'],{'$or':_['map'](_0x4c7d77,function(_0x8e1844){if(_0x8e1844[_0x297b('0x34')][_0x297b('0x35')]!=='VIRTUAL'){var _0x156f95={};_0x156f95[_0x8e1844['field']]={'$like':'%'+_0x3f63dc[_0x297b('0x28')]['filter']+'%'};return _0x156f95;}})});}_0x25383f=_[_0x297b('0x33')]({},_0x25383f,_0x3f63dc[_0x297b('0x36')]);var _0x2baa3e={'where':_0x25383f[_0x297b('0x31')]};return db[_0x297b('0x26')]['count'](_0x2baa3e)[_0x297b('0x20')](function(_0x35c485){_0x4ab68b[_0x297b('0x1a')]=_0x35c485;if(_0x3f63dc['query'][_0x297b('0x37')]){_0x25383f[_0x297b('0x38')]=[{'all':!![]}];}return db[_0x297b('0x26')][_0x297b('0x39')](_0x25383f);})[_0x297b('0x20')](function(_0x32ce4c){_0x4ab68b[_0x297b('0x3a')]=_0x32ce4c;return _0x4ab68b;})[_0x297b('0x20')](respondWithFilteredResult(_0x2bb038,_0x25383f))[_0x297b('0x3b')](handleError(_0x2bb038,null));};exports[_0x297b('0x3c')]=function(_0x54ea17,_0x584faf){var _0x201e82={'raw':!![],'where':{'id':_0x54ea17[_0x297b('0x3d')]['id']}},_0x1a5607={};_0x1a5607[_0x297b('0x2b')]=_[_0x297b('0x27')](db[_0x297b('0x26')]['rawAttributes']);_0x1a5607[_0x297b('0x28')]=_[_0x297b('0x27')](_0x54ea17[_0x297b('0x28')]);_0x1a5607[_0x297b('0x29')]=_[_0x297b('0x2a')](_0x1a5607[_0x297b('0x2b')],_0x1a5607[_0x297b('0x28')]);_0x201e82[_0x297b('0x2d')]=_['intersection'](_0x1a5607[_0x297b('0x2b')],qs['fields'](_0x54ea17[_0x297b('0x28')][_0x297b('0x2c')]));_0x201e82[_0x297b('0x2d')]=_0x201e82[_0x297b('0x2d')][_0x297b('0x2e')]?_0x201e82[_0x297b('0x2d')]:_0x1a5607[_0x297b('0x2b')];if(_0x54ea17['query'][_0x297b('0x37')]){_0x201e82[_0x297b('0x38')]=[{'all':!![]}];}_0x201e82=_['merge']({},_0x201e82,_0x54ea17[_0x297b('0x36')]);return db[_0x297b('0x26')][_0x297b('0x3e')](_0x201e82)['then'](handleEntityNotFound(_0x584faf,null))[_0x297b('0x20')](respondWithResult(_0x584faf,null))[_0x297b('0x3b')](handleError(_0x584faf,null));};exports[_0x297b('0x3f')]=function(_0x590065,_0x2ab4ba){return db[_0x297b('0x26')][_0x297b('0x3f')](_0x590065['body'],{})[_0x297b('0x20')](respondWithResult(_0x2ab4ba,0xc9))[_0x297b('0x3b')](handleError(_0x2ab4ba,null));}; \ No newline at end of file +var _0xf417=['nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','findAll','rows','catch','show','params','include','options','create','body','eml-format','rimraf','zip-dir','request-promise','mustache','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','save','update','then','error','stack','send','index','CrmNation','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty'];(function(_0x11af0f,_0x234d70){var _0x5d4c91=function(_0x505da2){while(--_0x505da2){_0x11af0f['push'](_0x11af0f['shift']());}};_0x5d4c91(++_0x234d70);}(_0xf417,0x8f));var _0x7f41=function(_0x337651,_0x2af690){_0x337651=_0x337651-0x0;var _0x20893c=_0xf417[_0x337651];return _0x20893c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7f41('0x0'));var rimraf=require(_0x7f41('0x1'));var zipdir=require(_0x7f41('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7f41('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7f41('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7f41('0x5'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7f41('0x6'));var crypto=require(_0x7f41('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x7f41('0x8'));var toCsv=require('to-csv');var querystring=require(_0x7f41('0x9'));var Papa=require('papaparse');var Redis=require(_0x7f41('0xa'));var authService=require(_0x7f41('0xb'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f41('0xc'))('api');var utils=require('../../config/utils');var config=require(_0x7f41('0xd'));var db=require(_0x7f41('0xe'))['db'];function respondWithStatusCode(_0x45d9f8,_0x3407b2){_0x3407b2=_0x3407b2||0xcc;return function(_0x637b2d){if(_0x637b2d){return _0x45d9f8[_0x7f41('0xf')](_0x3407b2);}return _0x45d9f8[_0x7f41('0x10')](_0x3407b2)['end']();};}function respondWithResult(_0x513d36,_0x380ee0){_0x380ee0=_0x380ee0||0xc8;return function(_0x4f5b74){if(_0x4f5b74){return _0x513d36['status'](_0x380ee0)[_0x7f41('0x11')](_0x4f5b74);}};}function respondWithFilteredResult(_0x1ff483,_0x2d59af){return function(_0x5a517f){if(_0x5a517f){var _0x212b28=_0x5a517f[_0x7f41('0x12')],_0x5ef6a7=_0x2d59af['offset'],_0x27c0f6=_0x2d59af[_0x7f41('0x13')]+_0x2d59af[_0x7f41('0x14')],_0x51004d;if(_0x27c0f6>=_0x212b28){_0x27c0f6=_0x212b28;_0x51004d=0xc8;}else{_0x51004d=0xce;}_0x1ff483[_0x7f41('0x10')](_0x51004d);return _0x1ff483['set'](_0x7f41('0x15'),_0x5ef6a7+'-'+_0x27c0f6+'/'+_0x212b28)[_0x7f41('0x11')](_0x5a517f);}return null;};}function patchUpdates(_0x549ee8){return function(_0x98210f){try{jsonpatch[_0x7f41('0x16')](_0x98210f,_0x549ee8,!![]);}catch(_0x1f4af0){return BPromise['reject'](_0x1f4af0);}return _0x98210f[_0x7f41('0x17')]();};}function saveUpdates(_0x58c86e,_0x503239){return function(_0x3fe620){if(_0x3fe620){return _0x3fe620[_0x7f41('0x18')](_0x58c86e)[_0x7f41('0x19')](function(_0x21660b){return _0x21660b;});}return null;};}function removeEntity(_0x451efa,_0x3af3f7){return function(_0x5e0f8b){if(_0x5e0f8b){return _0x5e0f8b['destroy']()[_0x7f41('0x19')](function(){_0x451efa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb27d9c,_0x388946){return function(_0x4fdd78){if(!_0x4fdd78){_0xb27d9c[_0x7f41('0xf')](0x194);}return _0x4fdd78;};}function handleError(_0x2dae27,_0x43b936){_0x43b936=_0x43b936||0x1f4;return function(_0x39d287){logger[_0x7f41('0x1a')](_0x39d287[_0x7f41('0x1b')]);if(_0x39d287['name']){delete _0x39d287['name'];}_0x2dae27['status'](_0x43b936)[_0x7f41('0x1c')](_0x39d287);};}exports[_0x7f41('0x1d')]=function(_0x55a32a,_0xd0b56c){var _0x3d52f7={'raw':!![]},_0x5b5610={},_0x4a814e={'count':0x0,'rows':[]};var _0x51a935=db[_0x7f41('0x1e')]['rawAttributes'];_0x5b5610['model']=_['keys'](_0x51a935);_0x5b5610[_0x7f41('0x1f')]=_[_0x7f41('0x20')](_0x55a32a['query']);_0x5b5610[_0x7f41('0x21')]=_[_0x7f41('0x22')](_0x5b5610['model'],_0x5b5610[_0x7f41('0x1f')]);_0x3d52f7[_0x7f41('0x23')]=_[_0x7f41('0x22')](_0x5b5610['model'],qs['fields'](_0x55a32a['query'][_0x7f41('0x24')]));_0x3d52f7[_0x7f41('0x23')]=_0x3d52f7[_0x7f41('0x23')][_0x7f41('0x25')]?_0x3d52f7[_0x7f41('0x23')]:_0x5b5610[_0x7f41('0x26')];if(!_0x55a32a['query'][_0x7f41('0x27')](_0x7f41('0x28'))){_0x3d52f7[_0x7f41('0x14')]=qs['limit'](_0x55a32a[_0x7f41('0x1f')]['limit']);_0x3d52f7[_0x7f41('0x13')]=qs[_0x7f41('0x13')](_0x55a32a[_0x7f41('0x1f')]['offset']);}_0x3d52f7[_0x7f41('0x29')]=qs[_0x7f41('0x2a')](_0x55a32a[_0x7f41('0x1f')][_0x7f41('0x2a')]);_0x3d52f7[_0x7f41('0x2b')]=qs[_0x7f41('0x21')](_[_0x7f41('0x2c')](_0x55a32a[_0x7f41('0x1f')],_0x5b5610['filters']));if(_0x55a32a[_0x7f41('0x1f')][_0x7f41('0x2d')]){_0x3d52f7[_0x7f41('0x2b')]=_[_0x7f41('0x2e')](_0x3d52f7[_0x7f41('0x2b')],{'$or':_[_0x7f41('0x2f')](_0x51a935,function(_0x3448ef){if(_0x3448ef[_0x7f41('0x30')][_0x7f41('0x31')]!==_0x7f41('0x32')){var _0x12bdd7={};_0x12bdd7[_0x3448ef[_0x7f41('0x33')]]={'$like':'%'+_0x55a32a['query'][_0x7f41('0x2d')]+'%'};return _0x12bdd7;}})});}_0x3d52f7=_[_0x7f41('0x2e')]({},_0x3d52f7,_0x55a32a['options']);var _0x46bbc7={'where':_0x3d52f7['where']};return db[_0x7f41('0x1e')][_0x7f41('0x12')](_0x46bbc7)[_0x7f41('0x19')](function(_0x540e91){_0x4a814e[_0x7f41('0x12')]=_0x540e91;if(_0x55a32a[_0x7f41('0x1f')]['includeAll']){_0x3d52f7['include']=[{'all':!![]}];}return db[_0x7f41('0x1e')][_0x7f41('0x34')](_0x3d52f7);})[_0x7f41('0x19')](function(_0x33f9d5){_0x4a814e[_0x7f41('0x35')]=_0x33f9d5;return _0x4a814e;})[_0x7f41('0x19')](respondWithFilteredResult(_0xd0b56c,_0x3d52f7))[_0x7f41('0x36')](handleError(_0xd0b56c,null));};exports[_0x7f41('0x37')]=function(_0x2ea20d,_0x50b389){var _0x3b1a0e={'raw':!![],'where':{'id':_0x2ea20d[_0x7f41('0x38')]['id']}},_0x40a7c8={};_0x40a7c8[_0x7f41('0x26')]=_[_0x7f41('0x20')](db[_0x7f41('0x1e')]['rawAttributes']);_0x40a7c8[_0x7f41('0x1f')]=_[_0x7f41('0x20')](_0x2ea20d[_0x7f41('0x1f')]);_0x40a7c8[_0x7f41('0x21')]=_['intersection'](_0x40a7c8['model'],_0x40a7c8[_0x7f41('0x1f')]);_0x3b1a0e[_0x7f41('0x23')]=_[_0x7f41('0x22')](_0x40a7c8['model'],qs[_0x7f41('0x24')](_0x2ea20d[_0x7f41('0x1f')]['fields']));_0x3b1a0e[_0x7f41('0x23')]=_0x3b1a0e[_0x7f41('0x23')][_0x7f41('0x25')]?_0x3b1a0e[_0x7f41('0x23')]:_0x40a7c8['model'];if(_0x2ea20d[_0x7f41('0x1f')]['includeAll']){_0x3b1a0e[_0x7f41('0x39')]=[{'all':!![]}];}_0x3b1a0e=_[_0x7f41('0x2e')]({},_0x3b1a0e,_0x2ea20d[_0x7f41('0x3a')]);return db[_0x7f41('0x1e')]['find'](_0x3b1a0e)[_0x7f41('0x19')](handleEntityNotFound(_0x50b389,null))[_0x7f41('0x19')](respondWithResult(_0x50b389,null))[_0x7f41('0x36')](handleError(_0x50b389,null));};exports['create']=function(_0x37b7,_0x4bc834){return db['CrmNation'][_0x7f41('0x3b')](_0x37b7[_0x7f41('0x3c')],{})[_0x7f41('0x19')](respondWithResult(_0x4bc834,0xc9))[_0x7f41('0x36')](handleError(_0x4bc834,null));}; \ No newline at end of file diff --git a/server/api/crmNation/crmNation.model.js b/server/api/crmNation/crmNation.model.js index 2d9bf2a..f7dcb4d 100644 --- a/server/api/crmNation/crmNation.model.js +++ b/server/api/crmNation/crmNation.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe925=['path','rimraf','../../config/environment','./crmNation.attributes','exports','define','CrmNation','crm_nations','lodash','moment','bluebird','request-promise'];(function(_0x383f9d,_0xc989b1){var _0x283483=function(_0x34cafb){while(--_0x34cafb){_0x383f9d['push'](_0x383f9d['shift']());}};_0x283483(++_0xc989b1);}(_0xe925,0x1b8));var _0x5e92=function(_0x307a47,_0x467381){_0x307a47=_0x307a47-0x0;var _0x3c478d=_0xe925[_0x307a47];return _0x3c478d;};'use strict';var _=require(_0x5e92('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5e92('0x1'));var BPromise=require(_0x5e92('0x2'));var rp=require(_0x5e92('0x3'));var fs=require('fs');var path=require(_0x5e92('0x4'));var rimraf=require(_0x5e92('0x5'));var config=require(_0x5e92('0x6'));var attributes=require(_0x5e92('0x7'));module[_0x5e92('0x8')]=function(_0x532602,_0x460b8f){return _0x532602[_0x5e92('0x9')](_0x5e92('0xa'),attributes,{'tableName':_0x5e92('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc766=['define','CrmNation','crm_nations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./crmNation.attributes'];(function(_0x2ef8c1,_0x2f72f4){var _0x288305=function(_0x56244b){while(--_0x56244b){_0x2ef8c1['push'](_0x2ef8c1['shift']());}};_0x288305(++_0x2f72f4);}(_0xc766,0xd3));var _0x6c76=function(_0x47acd3,_0x26121e){_0x47acd3=_0x47acd3-0x0;var _0xa24438=_0xc766[_0x47acd3];return _0xa24438;};'use strict';var _=require(_0x6c76('0x0'));var util=require(_0x6c76('0x1'));var logger=require(_0x6c76('0x2'))(_0x6c76('0x3'));var moment=require('moment');var BPromise=require(_0x6c76('0x4'));var rp=require(_0x6c76('0x5'));var fs=require('fs');var path=require(_0x6c76('0x6'));var rimraf=require(_0x6c76('0x7'));var config=require(_0x6c76('0x8'));var attributes=require(_0x6c76('0x9'));module['exports']=function(_0x4c37fb,_0x4f7e5a){return _0x4c37fb[_0x6c76('0xa')](_0x6c76('0xb'),attributes,{'tableName':_0x6c76('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/crmNation/crmNation.rpc.js b/server/api/crmNation/crmNation.rpc.js index 2e83ccb..80e5305 100644 --- a/server/api/crmNation/crmNation.rpc.js +++ b/server/api/crmNation/crmNation.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x93c0=['request\x20sent','debug','CrmNation,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CrmNation,\x20%s,\x20%s'];(function(_0x2a1bc2,_0x4ad4b9){var _0x2ca785=function(_0x481a6a){while(--_0x481a6a){_0x2a1bc2['push'](_0x2a1bc2['shift']());}};_0x2ca785(++_0x4ad4b9);}(_0x93c0,0x161));var _0x093c=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x93c0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x093c('0x0'));var util=require(_0x093c('0x1'));var moment=require(_0x093c('0x2'));var BPromise=require(_0x093c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x093c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x093c('0x5'));var logger=require(_0x093c('0x6'))(_0x093c('0x7'));var config=require(_0x093c('0x8'));var jayson=require(_0x093c('0x9'));var client=jayson[_0x093c('0xa')][_0x093c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14decf,_0x3f2562,_0x1f32aa){return new BPromise(function(_0x115675,_0x2024fe){return client['request'](_0x14decf,_0x1f32aa)[_0x093c('0xc')](function(_0x3f9a7d){logger[_0x093c('0xd')](_0x093c('0xe'),_0x3f2562,_0x093c('0xf'));logger[_0x093c('0x10')](_0x093c('0x11'),_0x3f2562,'request\x20sent',JSON['stringify'](_0x3f9a7d));if(_0x3f9a7d[_0x093c('0x12')]){if(_0x3f9a7d[_0x093c('0x12')][_0x093c('0x13')]===0x1f4){logger[_0x093c('0x12')](_0x093c('0xe'),_0x3f2562,_0x3f9a7d[_0x093c('0x12')][_0x093c('0x14')]);return _0x2024fe(_0x3f9a7d[_0x093c('0x12')]['message']);}logger['error'](_0x093c('0xe'),_0x3f2562,_0x3f9a7d[_0x093c('0x12')][_0x093c('0x14')]);return _0x115675(_0x3f9a7d[_0x093c('0x12')][_0x093c('0x14')]);}else{logger[_0x093c('0xd')](_0x093c('0xe'),_0x3f2562,'request\x20sent');_0x115675(_0x3f9a7d[_0x093c('0x15')][_0x093c('0x14')]);}})[_0x093c('0x16')](function(_0x139ef4){logger['error'](_0x093c('0xe'),_0x3f2562,_0x139ef4);_0x2024fe(_0x139ef4);});});} \ No newline at end of file +var _0x867d=['../../config/logger','../../config/environment','jayson/promise','client','request','then','info','CrmNation,\x20%s,\x20%s','request\x20sent','CrmNation,\x20%s,\x20%s,\x20%s','error','message','result','util','moment','bluebird','randomstring','ioredis'];(function(_0x4a33c,_0x4c7d3e){var _0x2d30cd=function(_0x1f4b08){while(--_0x1f4b08){_0x4a33c['push'](_0x4a33c['shift']());}};_0x2d30cd(++_0x4c7d3e);}(_0x867d,0x1cf));var _0xd867=function(_0x1cd0de,_0x2a606d){_0x1cd0de=_0x1cd0de-0x0;var _0x16870e=_0x867d[_0x1cd0de];return _0x16870e;};'use strict';var _=require('lodash');var util=require(_0xd867('0x0'));var moment=require(_0xd867('0x1'));var BPromise=require(_0xd867('0x2'));var rs=require(_0xd867('0x3'));var fs=require('fs');var Redis=require(_0xd867('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd867('0x5'))('rpc');var config=require(_0xd867('0x6'));var jayson=require(_0xd867('0x7'));var client=jayson[_0xd867('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bec08,_0x586815,_0x135b30){return new BPromise(function(_0x3388f5,_0x174594){return client[_0xd867('0x9')](_0x1bec08,_0x135b30)[_0xd867('0xa')](function(_0xe73a34){logger[_0xd867('0xb')](_0xd867('0xc'),_0x586815,_0xd867('0xd'));logger['debug'](_0xd867('0xe'),_0x586815,_0xd867('0xd'),JSON['stringify'](_0xe73a34));if(_0xe73a34['error']){if(_0xe73a34[_0xd867('0xf')]['code']===0x1f4){logger[_0xd867('0xf')](_0xd867('0xc'),_0x586815,_0xe73a34[_0xd867('0xf')][_0xd867('0x10')]);return _0x174594(_0xe73a34[_0xd867('0xf')][_0xd867('0x10')]);}logger[_0xd867('0xf')](_0xd867('0xc'),_0x586815,_0xe73a34[_0xd867('0xf')][_0xd867('0x10')]);return _0x3388f5(_0xe73a34[_0xd867('0xf')][_0xd867('0x10')]);}else{logger[_0xd867('0xb')]('CrmNation,\x20%s,\x20%s',_0x586815,_0xd867('0xd'));_0x3388f5(_0xe73a34[_0xd867('0x11')]['message']);}})['catch'](function(_0x1edcbd){logger['error'](_0xd867('0xc'),_0x586815,_0x1edcbd);_0x174594(_0x1edcbd);});});} \ No newline at end of file diff --git a/server/api/crmNation/index.js b/server/api/crmNation/index.js index 869deef..640f87e 100644 --- a/server/api/crmNation/index.js +++ b/server/api/crmNation/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd397=['../../components/auth/service','../../config/environment','./crmNation.controller','get','isAuthenticated','index','/:id','create','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2dfd0c,_0x287c97){var _0x1ca498=function(_0x2fd764){while(--_0x2fd764){_0x2dfd0c['push'](_0x2dfd0c['shift']());}};_0x1ca498(++_0x287c97);}(_0xd397,0xae));var _0x7d39=function(_0x3245b4,_0x15b47a){_0x3245b4=_0x3245b4-0x0;var _0x1e9172=_0xd397[_0x3245b4];return _0x1e9172;};'use strict';var multer=require(_0x7d39('0x0'));var util=require(_0x7d39('0x1'));var path=require(_0x7d39('0x2'));var timeout=require(_0x7d39('0x3'));var express=require(_0x7d39('0x4'));var router=express[_0x7d39('0x5')]();var auth=require(_0x7d39('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7d39('0x7'));var controller=require(_0x7d39('0x8'));router[_0x7d39('0x9')]('/',auth[_0x7d39('0xa')](),controller[_0x7d39('0xb')]);router[_0x7d39('0x9')](_0x7d39('0xc'),auth[_0x7d39('0xa')](),controller['show']);router['post']('/',auth[_0x7d39('0xa')](),controller[_0x7d39('0xd')]);module[_0x7d39('0xe')]=router; \ No newline at end of file +var _0xe184=['Router','../../components/auth/service','./crmNation.controller','get','index','/:id','isAuthenticated','post','create','exports','multer','path','connect-timeout'];(function(_0x293866,_0x33ab3e){var _0x4b33c8=function(_0x26a041){while(--_0x26a041){_0x293866['push'](_0x293866['shift']());}};_0x4b33c8(++_0x33ab3e);}(_0xe184,0x8c));var _0x4e18=function(_0x14af87,_0x5015b0){_0x14af87=_0x14af87-0x0;var _0x4ff98c=_0xe184[_0x14af87];return _0x4ff98c;};'use strict';var multer=require(_0x4e18('0x0'));var util=require('util');var path=require(_0x4e18('0x1'));var timeout=require(_0x4e18('0x2'));var express=require('express');var router=express[_0x4e18('0x3')]();var auth=require(_0x4e18('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4e18('0x5'));router[_0x4e18('0x6')]('/',auth['isAuthenticated'](),controller[_0x4e18('0x7')]);router[_0x4e18('0x6')](_0x4e18('0x8'),auth[_0x4e18('0x9')](),controller['show']);router[_0x4e18('0xa')]('/',auth['isAuthenticated'](),controller[_0x4e18('0xb')]);module[_0x4e18('0xc')]=router; \ No newline at end of file diff --git a/server/api/crmTask/crmTask.attributes.js b/server/api/crmTask/crmTask.attributes.js index 395e05b..dbe993b 100644 --- a/server/api/crmTask/crmTask.attributes.js +++ b/server/api/crmTask/crmTask.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6025=['sequelize','STRING','name'];(function(_0x462a69,_0x23e3de){var _0x4ca69a=function(_0x429b50){while(--_0x429b50){_0x462a69['push'](_0x462a69['shift']());}};_0x4ca69a(++_0x23e3de);}(_0x6025,0x135));var _0x5602=function(_0x2fbffa,_0x45d3ac){_0x2fbffa=_0x2fbffa-0x0;var _0x5c6d8a=_0x6025[_0x2fbffa];return _0x5c6d8a;};'use strict';var Sequelize=require(_0x5602('0x0'));module['exports']={'name':{'type':Sequelize[_0x5602('0x1')],'allowNull':![],'unique':_0x5602('0x2')}}; \ No newline at end of file +var _0x728d=['STRING','name','sequelize','exports'];(function(_0x403ca6,_0x24e284){var _0x4e0e05=function(_0x3a76ba){while(--_0x3a76ba){_0x403ca6['push'](_0x403ca6['shift']());}};_0x4e0e05(++_0x24e284);}(_0x728d,0x1c2));var _0xd728=function(_0x290ef5,_0x32cfa7){_0x290ef5=_0x290ef5-0x0;var _0x450d92=_0x728d[_0x290ef5];return _0x450d92;};'use strict';var Sequelize=require(_0xd728('0x0'));module[_0xd728('0x1')]={'name':{'type':Sequelize[_0xd728('0x2')],'allowNull':![],'unique':_0xd728('0x3')}}; \ No newline at end of file diff --git a/server/api/crmTask/crmTask.controller.js b/server/api/crmTask/crmTask.controller.js index 9edf6bf..cb6dca0 100644 --- a/server/api/crmTask/crmTask.controller.js +++ b/server/api/crmTask/crmTask.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b48=['limit','status','Content-Range','reject','save','then','destroy','error','stack','name','send','index','CrmTask','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','where','filter','merge','VIRTUAL','field','options','include','findAll','rows','show','params','includeAll','catch','create','body','find','describe','zip-dir','request-promise','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset'];(function(_0x5a6ff5,_0x478faf){var _0xeeebe1=function(_0x1fff7a){while(--_0x1fff7a){_0x5a6ff5['push'](_0x5a6ff5['shift']());}};_0xeeebe1(++_0x478faf);}(_0x6b48,0xec));var _0x86b4=function(_0x2fff6b,_0x29752f){_0x2fff6b=_0x2fff6b-0x0;var _0xc562b2=_0x6b48[_0x2fff6b];return _0xc562b2;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x86b4('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x86b4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x86b4('0x2'));var util=require(_0x86b4('0x3'));var path=require(_0x86b4('0x4'));var sox=require(_0x86b4('0x5'));var csv=require('to-csv');var ejs=require(_0x86b4('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x86b4('0x7'));var crypto=require(_0x86b4('0x8'));var jsforce=require(_0x86b4('0x9'));var deskjs=require(_0x86b4('0xa'));var toCsv=require('to-csv');var querystring=require(_0x86b4('0xb'));var Papa=require('papaparse');var Redis=require(_0x86b4('0xc'));var authService=require(_0x86b4('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x86b4('0xe'));var logger=require(_0x86b4('0xf'))('api');var utils=require(_0x86b4('0x10'));var config=require(_0x86b4('0x11'));var db=require(_0x86b4('0x12'))['db'];function respondWithStatusCode(_0x346589,_0x1e1d6f){_0x1e1d6f=_0x1e1d6f||0xcc;return function(_0x7be495){if(_0x7be495){return _0x346589[_0x86b4('0x13')](_0x1e1d6f);}return _0x346589['status'](_0x1e1d6f)[_0x86b4('0x14')]();};}function respondWithResult(_0x4b5896,_0x1cad9b){_0x1cad9b=_0x1cad9b||0xc8;return function(_0x3ab625){if(_0x3ab625){return _0x4b5896['status'](_0x1cad9b)[_0x86b4('0x15')](_0x3ab625);}};}function respondWithFilteredResult(_0x21a328,_0x3f14bf){return function(_0x1270a0){if(_0x1270a0){var _0x3057a8=_0x1270a0[_0x86b4('0x16')],_0x2c23d3=_0x3f14bf[_0x86b4('0x17')],_0x19cd42=_0x3f14bf[_0x86b4('0x17')]+_0x3f14bf[_0x86b4('0x18')],_0x1dfd5c;if(_0x19cd42>=_0x3057a8){_0x19cd42=_0x3057a8;_0x1dfd5c=0xc8;}else{_0x1dfd5c=0xce;}_0x21a328[_0x86b4('0x19')](_0x1dfd5c);return _0x21a328['set'](_0x86b4('0x1a'),_0x2c23d3+'-'+_0x19cd42+'/'+_0x3057a8)['json'](_0x1270a0);}return null;};}function patchUpdates(_0x119430){return function(_0x31cd1a){try{jsonpatch['apply'](_0x31cd1a,_0x119430,!![]);}catch(_0x5039bf){return BPromise[_0x86b4('0x1b')](_0x5039bf);}return _0x31cd1a[_0x86b4('0x1c')]();};}function saveUpdates(_0xb94ffa,_0xa8b5c8){return function(_0x509ace){if(_0x509ace){return _0x509ace['update'](_0xb94ffa)[_0x86b4('0x1d')](function(_0x55631c){return _0x55631c;});}return null;};}function removeEntity(_0x5410b7,_0x36262d){return function(_0x3c032e){if(_0x3c032e){return _0x3c032e[_0x86b4('0x1e')]()[_0x86b4('0x1d')](function(){_0x5410b7[_0x86b4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dd79b,_0x2a214e){return function(_0x4f0d7a){if(!_0x4f0d7a){_0x5dd79b[_0x86b4('0x13')](0x194);}return _0x4f0d7a;};}function handleError(_0x10607a,_0x11e425){_0x11e425=_0x11e425||0x1f4;return function(_0x1a1aaf){logger[_0x86b4('0x1f')](_0x1a1aaf[_0x86b4('0x20')]);if(_0x1a1aaf[_0x86b4('0x21')]){delete _0x1a1aaf['name'];}_0x10607a[_0x86b4('0x19')](_0x11e425)[_0x86b4('0x22')](_0x1a1aaf);};}exports[_0x86b4('0x23')]=function(_0x1e78cc,_0x5e3322){var _0x7aa101={},_0x52f3d2={},_0x534f80={'count':0x0,'rows':[]};var _0x27c1d7=db[_0x86b4('0x24')][_0x86b4('0x25')];_0x52f3d2[_0x86b4('0x26')]=_[_0x86b4('0x27')](_0x27c1d7);_0x52f3d2['query']=_[_0x86b4('0x27')](_0x1e78cc[_0x86b4('0x28')]);_0x52f3d2[_0x86b4('0x29')]=_['intersection'](_0x52f3d2[_0x86b4('0x26')],_0x52f3d2['query']);_0x7aa101[_0x86b4('0x2a')]=_[_0x86b4('0x2b')](_0x52f3d2[_0x86b4('0x26')],qs[_0x86b4('0x2c')](_0x1e78cc['query'][_0x86b4('0x2c')]));_0x7aa101[_0x86b4('0x2a')]=_0x7aa101['attributes'][_0x86b4('0x2d')]?_0x7aa101['attributes']:_0x52f3d2[_0x86b4('0x26')];if(!_0x1e78cc[_0x86b4('0x28')]['hasOwnProperty'](_0x86b4('0x2e'))){_0x7aa101[_0x86b4('0x18')]=qs['limit'](_0x1e78cc['query'][_0x86b4('0x18')]);_0x7aa101[_0x86b4('0x17')]=qs[_0x86b4('0x17')](_0x1e78cc['query']['offset']);}_0x7aa101[_0x86b4('0x2f')]=qs['sort'](_0x1e78cc['query']['sort']);_0x7aa101[_0x86b4('0x30')]=qs['filters'](_['pick'](_0x1e78cc[_0x86b4('0x28')],_0x52f3d2[_0x86b4('0x29')]));if(_0x1e78cc[_0x86b4('0x28')][_0x86b4('0x31')]){_0x7aa101['where']=_[_0x86b4('0x32')](_0x7aa101[_0x86b4('0x30')],{'$or':_['map'](_0x27c1d7,function(_0x33ad09){if(_0x33ad09['type']['key']!==_0x86b4('0x33')){var _0x1a9a0b={};_0x1a9a0b[_0x33ad09[_0x86b4('0x34')]]={'$like':'%'+_0x1e78cc['query'][_0x86b4('0x31')]+'%'};return _0x1a9a0b;}})});}_0x7aa101=_['merge']({},_0x7aa101,_0x1e78cc[_0x86b4('0x35')]);var _0x34f03f={'where':_0x7aa101[_0x86b4('0x30')]};return db[_0x86b4('0x24')]['count'](_0x34f03f)[_0x86b4('0x1d')](function(_0x1ba5bc){_0x534f80[_0x86b4('0x16')]=_0x1ba5bc;if(_0x1e78cc[_0x86b4('0x28')]['includeAll']){_0x7aa101[_0x86b4('0x36')]=[{'all':!![]}];}return db[_0x86b4('0x24')][_0x86b4('0x37')](_0x7aa101);})[_0x86b4('0x1d')](function(_0x4caece){_0x534f80[_0x86b4('0x38')]=_0x4caece;return _0x534f80;})[_0x86b4('0x1d')](respondWithFilteredResult(_0x5e3322,_0x7aa101))['catch'](handleError(_0x5e3322,null));};exports[_0x86b4('0x39')]=function(_0x26a520,_0x4f5825){var _0x840ebf={'raw':![],'where':{'id':_0x26a520[_0x86b4('0x3a')]['id']}},_0xc1c735={};_0xc1c735[_0x86b4('0x26')]=_[_0x86b4('0x27')](db['CrmTask'][_0x86b4('0x25')]);_0xc1c735[_0x86b4('0x28')]=_[_0x86b4('0x27')](_0x26a520['query']);_0xc1c735['filters']=_[_0x86b4('0x2b')](_0xc1c735[_0x86b4('0x26')],_0xc1c735['query']);_0x840ebf[_0x86b4('0x2a')]=_[_0x86b4('0x2b')](_0xc1c735[_0x86b4('0x26')],qs['fields'](_0x26a520[_0x86b4('0x28')]['fields']));_0x840ebf[_0x86b4('0x2a')]=_0x840ebf[_0x86b4('0x2a')][_0x86b4('0x2d')]?_0x840ebf[_0x86b4('0x2a')]:_0xc1c735[_0x86b4('0x26')];if(_0x26a520[_0x86b4('0x28')][_0x86b4('0x3b')]){_0x840ebf[_0x86b4('0x36')]=[{'all':!![]}];}_0x840ebf=_[_0x86b4('0x32')]({},_0x840ebf,_0x26a520[_0x86b4('0x35')]);return db[_0x86b4('0x24')]['find'](_0x840ebf)[_0x86b4('0x1d')](handleEntityNotFound(_0x4f5825,null))[_0x86b4('0x1d')](respondWithResult(_0x4f5825,null))[_0x86b4('0x3c')](handleError(_0x4f5825,null));};exports[_0x86b4('0x3d')]=function(_0x31d3f2,_0x5b616f){return db[_0x86b4('0x24')]['create'](_0x31d3f2[_0x86b4('0x3e')],{})[_0x86b4('0x1d')](respondWithResult(_0x5b616f,0xc9))[_0x86b4('0x3c')](handleError(_0x5b616f,null));};exports['update']=function(_0xed0dab,_0x32532c){if(_0xed0dab[_0x86b4('0x3e')]['id']){delete _0xed0dab[_0x86b4('0x3e')]['id'];}return db['CrmTask']['find']({'where':{'id':_0xed0dab[_0x86b4('0x3a')]['id']}})[_0x86b4('0x1d')](handleEntityNotFound(_0x32532c,null))[_0x86b4('0x1d')](saveUpdates(_0xed0dab[_0x86b4('0x3e')],null))['then'](respondWithResult(_0x32532c,null))[_0x86b4('0x3c')](handleError(_0x32532c,null));};exports['destroy']=function(_0x1385bf,_0x4bb1c8){return db[_0x86b4('0x24')][_0x86b4('0x3f')]({'where':{'id':_0x1385bf['params']['id']}})[_0x86b4('0x1d')](handleEntityNotFound(_0x4bb1c8,null))[_0x86b4('0x1d')](removeEntity(_0x4bb1c8,null))[_0x86b4('0x3c')](handleError(_0x4bb1c8,null));};exports[_0x86b4('0x40')]=function(_0x53f589,_0x2e8790){return db['CrmTask'][_0x86b4('0x40')]()[_0x86b4('0x1d')](respondWithResult(_0x2e8790,null))['catch'](handleError(_0x2e8790,null));}; \ No newline at end of file +var _0x29a0=['describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','CrmTask','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','destroy'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0x29a0,0xdf));var _0x029a=function(_0x254dc1,_0x141fc4){_0x254dc1=_0x254dc1-0x0;var _0x1aa9fc=_0x29a0[_0x254dc1];return _0x1aa9fc;};'use strict';var pdf=require(_0x029a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x029a('0x1'));var zipdir=require(_0x029a('0x2'));var jsonpatch=require(_0x029a('0x3'));var rp=require(_0x029a('0x4'));var moment=require(_0x029a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x029a('0x6'));var util=require(_0x029a('0x7'));var path=require(_0x029a('0x8'));var sox=require(_0x029a('0x9'));var csv=require(_0x029a('0xa'));var ejs=require(_0x029a('0xb'));var fs=require('fs');var _=require(_0x029a('0xc'));var squel=require(_0x029a('0xd'));var crypto=require(_0x029a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x029a('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x029a('0x10'));var Redis=require(_0x029a('0x11'));var authService=require(_0x029a('0x12'));var qs=require(_0x029a('0x13'));var hardwareService=require(_0x029a('0x14'));var logger=require('../../config/logger')(_0x029a('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x029a('0x16'))['db'];function respondWithStatusCode(_0xdb9855,_0x3ee5ee){_0x3ee5ee=_0x3ee5ee||0xcc;return function(_0x5a181c){if(_0x5a181c){return _0xdb9855['sendStatus'](_0x3ee5ee);}return _0xdb9855[_0x029a('0x17')](_0x3ee5ee)[_0x029a('0x18')]();};}function respondWithResult(_0x50f2fb,_0x3cc332){_0x3cc332=_0x3cc332||0xc8;return function(_0x5856bd){if(_0x5856bd){return _0x50f2fb[_0x029a('0x17')](_0x3cc332)[_0x029a('0x19')](_0x5856bd);}};}function respondWithFilteredResult(_0xad531d,_0x1793db){return function(_0x48a403){if(_0x48a403){var _0x5eb951=_0x48a403[_0x029a('0x1a')],_0x5cea50=_0x1793db[_0x029a('0x1b')],_0x1da337=_0x1793db[_0x029a('0x1b')]+_0x1793db[_0x029a('0x1c')],_0x121a0b;if(_0x1da337>=_0x5eb951){_0x1da337=_0x5eb951;_0x121a0b=0xc8;}else{_0x121a0b=0xce;}_0xad531d[_0x029a('0x17')](_0x121a0b);return _0xad531d[_0x029a('0x1d')](_0x029a('0x1e'),_0x5cea50+'-'+_0x1da337+'/'+_0x5eb951)[_0x029a('0x19')](_0x48a403);}return null;};}function patchUpdates(_0x2db4f0){return function(_0x55aaf7){try{jsonpatch[_0x029a('0x1f')](_0x55aaf7,_0x2db4f0,!![]);}catch(_0x35f715){return BPromise[_0x029a('0x20')](_0x35f715);}return _0x55aaf7[_0x029a('0x21')]();};}function saveUpdates(_0x5880a7,_0x5ce6e4){return function(_0x143732){if(_0x143732){return _0x143732[_0x029a('0x22')](_0x5880a7)[_0x029a('0x23')](function(_0x6a9c0f){return _0x6a9c0f;});}return null;};}function removeEntity(_0x3d8ee0,_0xace1b9){return function(_0x197569){if(_0x197569){return _0x197569['destroy']()[_0x029a('0x23')](function(){_0x3d8ee0['status'](0xcc)[_0x029a('0x18')]();});}};}function handleEntityNotFound(_0x3a8d27,_0x1a3d2d){return function(_0x36cfe8){if(!_0x36cfe8){_0x3a8d27[_0x029a('0x24')](0x194);}return _0x36cfe8;};}function handleError(_0x540bf9,_0x3562ac){_0x3562ac=_0x3562ac||0x1f4;return function(_0x33c56f){logger[_0x029a('0x25')](_0x33c56f[_0x029a('0x26')]);if(_0x33c56f[_0x029a('0x27')]){delete _0x33c56f[_0x029a('0x27')];}_0x540bf9[_0x029a('0x17')](_0x3562ac)[_0x029a('0x28')](_0x33c56f);};}exports[_0x029a('0x29')]=function(_0x3a8b45,_0x358e22){var _0xb0b77={},_0x5d2e38={},_0x21c547={'count':0x0,'rows':[]};var _0x3b67d6=db[_0x029a('0x2a')]['rawAttributes'];_0x5d2e38['model']=_[_0x029a('0x2b')](_0x3b67d6);_0x5d2e38['query']=_['keys'](_0x3a8b45[_0x029a('0x2c')]);_0x5d2e38[_0x029a('0x2d')]=_[_0x029a('0x2e')](_0x5d2e38[_0x029a('0x2f')],_0x5d2e38['query']);_0xb0b77[_0x029a('0x30')]=_[_0x029a('0x2e')](_0x5d2e38[_0x029a('0x2f')],qs[_0x029a('0x31')](_0x3a8b45[_0x029a('0x2c')][_0x029a('0x31')]));_0xb0b77[_0x029a('0x30')]=_0xb0b77[_0x029a('0x30')][_0x029a('0x32')]?_0xb0b77['attributes']:_0x5d2e38[_0x029a('0x2f')];if(!_0x3a8b45[_0x029a('0x2c')]['hasOwnProperty'](_0x029a('0x33'))){_0xb0b77['limit']=qs['limit'](_0x3a8b45[_0x029a('0x2c')][_0x029a('0x1c')]);_0xb0b77[_0x029a('0x1b')]=qs['offset'](_0x3a8b45[_0x029a('0x2c')][_0x029a('0x1b')]);}_0xb0b77[_0x029a('0x34')]=qs['sort'](_0x3a8b45['query'][_0x029a('0x35')]);_0xb0b77[_0x029a('0x36')]=qs['filters'](_[_0x029a('0x37')](_0x3a8b45[_0x029a('0x2c')],_0x5d2e38[_0x029a('0x2d')]));if(_0x3a8b45[_0x029a('0x2c')][_0x029a('0x38')]){_0xb0b77[_0x029a('0x36')]=_[_0x029a('0x39')](_0xb0b77[_0x029a('0x36')],{'$or':_['map'](_0x3b67d6,function(_0x78c7e3){if(_0x78c7e3[_0x029a('0x3a')]['key']!==_0x029a('0x3b')){var _0x4ef344={};_0x4ef344[_0x78c7e3['field']]={'$like':'%'+_0x3a8b45[_0x029a('0x2c')]['filter']+'%'};return _0x4ef344;}})});}_0xb0b77=_['merge']({},_0xb0b77,_0x3a8b45[_0x029a('0x3c')]);var _0x2985c0={'where':_0xb0b77['where']};return db[_0x029a('0x2a')][_0x029a('0x1a')](_0x2985c0)[_0x029a('0x23')](function(_0x921e3f){_0x21c547['count']=_0x921e3f;if(_0x3a8b45[_0x029a('0x2c')]['includeAll']){_0xb0b77[_0x029a('0x3d')]=[{'all':!![]}];}return db[_0x029a('0x2a')][_0x029a('0x3e')](_0xb0b77);})[_0x029a('0x23')](function(_0x3b53de){_0x21c547[_0x029a('0x3f')]=_0x3b53de;return _0x21c547;})[_0x029a('0x23')](respondWithFilteredResult(_0x358e22,_0xb0b77))[_0x029a('0x40')](handleError(_0x358e22,null));};exports[_0x029a('0x41')]=function(_0x42bd07,_0x5c89d4){var _0x418f28={'raw':![],'where':{'id':_0x42bd07[_0x029a('0x42')]['id']}},_0x167253={};_0x167253[_0x029a('0x2f')]=_[_0x029a('0x2b')](db[_0x029a('0x2a')][_0x029a('0x43')]);_0x167253[_0x029a('0x2c')]=_[_0x029a('0x2b')](_0x42bd07[_0x029a('0x2c')]);_0x167253['filters']=_['intersection'](_0x167253['model'],_0x167253[_0x029a('0x2c')]);_0x418f28[_0x029a('0x30')]=_['intersection'](_0x167253['model'],qs[_0x029a('0x31')](_0x42bd07['query']['fields']));_0x418f28[_0x029a('0x30')]=_0x418f28[_0x029a('0x30')]['length']?_0x418f28[_0x029a('0x30')]:_0x167253[_0x029a('0x2f')];if(_0x42bd07[_0x029a('0x2c')][_0x029a('0x44')]){_0x418f28[_0x029a('0x3d')]=[{'all':!![]}];}_0x418f28=_[_0x029a('0x39')]({},_0x418f28,_0x42bd07[_0x029a('0x3c')]);return db['CrmTask'][_0x029a('0x45')](_0x418f28)[_0x029a('0x23')](handleEntityNotFound(_0x5c89d4,null))['then'](respondWithResult(_0x5c89d4,null))[_0x029a('0x40')](handleError(_0x5c89d4,null));};exports[_0x029a('0x46')]=function(_0x116ccd,_0x2e0965){return db['CrmTask'][_0x029a('0x46')](_0x116ccd[_0x029a('0x47')],{})[_0x029a('0x23')](respondWithResult(_0x2e0965,0xc9))[_0x029a('0x40')](handleError(_0x2e0965,null));};exports[_0x029a('0x22')]=function(_0x50cd23,_0x31ced4){if(_0x50cd23[_0x029a('0x47')]['id']){delete _0x50cd23[_0x029a('0x47')]['id'];}return db[_0x029a('0x2a')][_0x029a('0x45')]({'where':{'id':_0x50cd23[_0x029a('0x42')]['id']}})[_0x029a('0x23')](handleEntityNotFound(_0x31ced4,null))[_0x029a('0x23')](saveUpdates(_0x50cd23[_0x029a('0x47')],null))[_0x029a('0x23')](respondWithResult(_0x31ced4,null))[_0x029a('0x40')](handleError(_0x31ced4,null));};exports[_0x029a('0x48')]=function(_0x8a7b56,_0xc7e49e){return db[_0x029a('0x2a')][_0x029a('0x45')]({'where':{'id':_0x8a7b56[_0x029a('0x42')]['id']}})['then'](handleEntityNotFound(_0xc7e49e,null))[_0x029a('0x23')](removeEntity(_0xc7e49e,null))[_0x029a('0x40')](handleError(_0xc7e49e,null));};exports[_0x029a('0x49')]=function(_0xff13c,_0x1ac33b){return db['CrmTask'][_0x029a('0x49')]()[_0x029a('0x23')](respondWithResult(_0x1ac33b,null))['catch'](handleError(_0x1ac33b,null));}; \ No newline at end of file diff --git a/server/api/crmTask/crmTask.model.js b/server/api/crmTask/crmTask.model.js index 75eb52a..54eea65 100644 --- a/server/api/crmTask/crmTask.model.js +++ b/server/api/crmTask/crmTask.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./crmTask.attributes','exports','CrmTask','util'];(function(_0x11cc98,_0x215888){var _0x458513=function(_0x5ab069){while(--_0x5ab069){_0x11cc98['push'](_0x11cc98['shift']());}};_0x458513(++_0x215888);}(_0xedd9,0xfc));var _0x9edd=function(_0x42935c,_0x42da45){_0x42935c=_0x42935c-0x0;var _0x4758c7=_0xedd9[_0x42935c];return _0x4758c7;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'crm_tasks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb688=['exports','CrmTask','crm_tasks','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./crmTask.attributes'];(function(_0x13d3ea,_0x5b2d9e){var _0x4f437d=function(_0x27b6d5){while(--_0x27b6d5){_0x13d3ea['push'](_0x13d3ea['shift']());}};_0x4f437d(++_0x5b2d9e);}(_0xb688,0xcf));var _0x8b68=function(_0x4de05d,_0x46b6e1){_0x4de05d=_0x4de05d-0x0;var _0x50d860=_0xb688[_0x4de05d];return _0x50d860;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var logger=require(_0x8b68('0x1'))(_0x8b68('0x2'));var moment=require(_0x8b68('0x3'));var BPromise=require(_0x8b68('0x4'));var rp=require(_0x8b68('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var attributes=require(_0x8b68('0x8'));module[_0x8b68('0x9')]=function(_0x583d16,_0x34314e){return _0x583d16['define'](_0x8b68('0xa'),attributes,{'tableName':_0x8b68('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/crmTask/crmTask.rpc.js b/server/api/crmTask/crmTask.rpc.js index 21f9824..ee10905 100644 --- a/server/api/crmTask/crmTask.rpc.js +++ b/server/api/crmTask/crmTask.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbcd2=['CrmTask,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x12ee82,_0x613ddd){var _0x3f18c8=function(_0xd591a6){while(--_0xd591a6){_0x12ee82['push'](_0x12ee82['shift']());}};_0x3f18c8(++_0x613ddd);}(_0xbcd2,0x85));var _0x2bcd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcd2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x2bcd('0x0'));var rs=require(_0x2bcd('0x1'));var fs=require('fs');var Redis=require(_0x2bcd('0x2'));var db=require(_0x2bcd('0x3'))['db'];var utils=require(_0x2bcd('0x4'));var logger=require('../../config/logger')(_0x2bcd('0x5'));var config=require(_0x2bcd('0x6'));var jayson=require(_0x2bcd('0x7'));var client=jayson[_0x2bcd('0x8')][_0x2bcd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b2b63,_0x597930,_0x4ee743){return new BPromise(function(_0x583e0d,_0x5f1f1e){return client[_0x2bcd('0xa')](_0x4b2b63,_0x4ee743)['then'](function(_0x4bfd8c){logger['info'](_0x2bcd('0xb'),_0x597930,'request\x20sent');logger['debug']('CrmTask,\x20%s,\x20%s,\x20%s',_0x597930,_0x2bcd('0xc'),JSON[_0x2bcd('0xd')](_0x4bfd8c));if(_0x4bfd8c[_0x2bcd('0xe')]){if(_0x4bfd8c[_0x2bcd('0xe')][_0x2bcd('0xf')]===0x1f4){logger[_0x2bcd('0xe')](_0x2bcd('0xb'),_0x597930,_0x4bfd8c[_0x2bcd('0xe')]['message']);return _0x5f1f1e(_0x4bfd8c[_0x2bcd('0xe')][_0x2bcd('0x10')]);}logger['error'](_0x2bcd('0xb'),_0x597930,_0x4bfd8c[_0x2bcd('0xe')][_0x2bcd('0x10')]);return _0x583e0d(_0x4bfd8c[_0x2bcd('0xe')][_0x2bcd('0x10')]);}else{logger[_0x2bcd('0x11')]('CrmTask,\x20%s,\x20%s',_0x597930,'request\x20sent');_0x583e0d(_0x4bfd8c['result']['message']);}})['catch'](function(_0x3e04e9){logger['error'](_0x2bcd('0xb'),_0x597930,_0x3e04e9);_0x5f1f1e(_0x3e04e9);});});} \ No newline at end of file +var _0xfb68=['code','CrmTask,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x48fc57,_0x33dccb){var _0x12892d=function(_0x2ea9ae){while(--_0x2ea9ae){_0x48fc57['push'](_0x48fc57['shift']());}};_0x12892d(++_0x33dccb);}(_0xfb68,0x95));var _0x8fb6=function(_0x5b01e1,_0x380f05){_0x5b01e1=_0x5b01e1-0x0;var _0x1613d3=_0xfb68[_0x5b01e1];return _0x1613d3;};'use strict';var _=require(_0x8fb6('0x0'));var util=require('util');var moment=require(_0x8fb6('0x1'));var BPromise=require(_0x8fb6('0x2'));var rs=require(_0x8fb6('0x3'));var fs=require('fs');var Redis=require(_0x8fb6('0x4'));var db=require(_0x8fb6('0x5'))['db'];var utils=require(_0x8fb6('0x6'));var logger=require(_0x8fb6('0x7'))(_0x8fb6('0x8'));var config=require('../../config/environment');var jayson=require(_0x8fb6('0x9'));var client=jayson[_0x8fb6('0xa')][_0x8fb6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x123093,_0x3f629b,_0x89f864){return new BPromise(function(_0x5005f3,_0x13e7fa){return client[_0x8fb6('0xc')](_0x123093,_0x89f864)[_0x8fb6('0xd')](function(_0x3963a6){logger[_0x8fb6('0xe')]('CrmTask,\x20%s,\x20%s',_0x3f629b,_0x8fb6('0xf'));logger[_0x8fb6('0x10')]('CrmTask,\x20%s,\x20%s,\x20%s',_0x3f629b,'request\x20sent',JSON[_0x8fb6('0x11')](_0x3963a6));if(_0x3963a6[_0x8fb6('0x12')]){if(_0x3963a6[_0x8fb6('0x12')][_0x8fb6('0x13')]===0x1f4){logger[_0x8fb6('0x12')](_0x8fb6('0x14'),_0x3f629b,_0x3963a6[_0x8fb6('0x12')][_0x8fb6('0x15')]);return _0x13e7fa(_0x3963a6[_0x8fb6('0x12')][_0x8fb6('0x15')]);}logger[_0x8fb6('0x12')](_0x8fb6('0x14'),_0x3f629b,_0x3963a6['error'][_0x8fb6('0x15')]);return _0x5005f3(_0x3963a6['error'][_0x8fb6('0x15')]);}else{logger['info'](_0x8fb6('0x14'),_0x3f629b,_0x8fb6('0xf'));_0x5005f3(_0x3963a6[_0x8fb6('0x16')][_0x8fb6('0x15')]);}})[_0x8fb6('0x17')](function(_0x5843a6){logger[_0x8fb6('0x12')]('CrmTask,\x20%s,\x20%s',_0x3f629b,_0x5843a6);_0x13e7fa(_0x5843a6);});});} \ No newline at end of file diff --git a/server/api/crmTask/index.js b/server/api/crmTask/index.js index 82b336e..611c62f 100644 --- a/server/api/crmTask/index.js +++ b/server/api/crmTask/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x82b5=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./crmTask.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','util'];(function(_0x5067a9,_0x2d8451){var _0x421257=function(_0x28f749){while(--_0x28f749){_0x5067a9['push'](_0x5067a9['shift']());}};_0x421257(++_0x2d8451);}(_0x82b5,0x1a8));var _0x582b=function(_0x29f954,_0x24dd5a){_0x29f954=_0x29f954-0x0;var _0x132af5=_0x82b5[_0x29f954];return _0x132af5;};'use strict';var multer=require('multer');var util=require(_0x582b('0x0'));var path=require('path');var timeout=require(_0x582b('0x1'));var express=require(_0x582b('0x2'));var router=express[_0x582b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x582b('0x4'));var config=require(_0x582b('0x5'));var controller=require(_0x582b('0x6'));router[_0x582b('0x7')]('/',auth[_0x582b('0x8')](),controller[_0x582b('0x9')]);router[_0x582b('0x7')]('/describe',auth[_0x582b('0x8')](),controller['describe']);router[_0x582b('0x7')](_0x582b('0xa'),auth['isAuthenticated'](),controller[_0x582b('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x582b('0xc')](_0x582b('0xa'),auth[_0x582b('0x8')](),controller[_0x582b('0xd')]);router[_0x582b('0xe')](_0x582b('0xa'),auth[_0x582b('0x8')](),controller[_0x582b('0xf')]);module[_0x582b('0x10')]=router; \ No newline at end of file +var _0x9294=['delete','destroy','exports','multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put'];(function(_0x31c480,_0x13f64a){var _0x3687ce=function(_0x46fbc0){while(--_0x46fbc0){_0x31c480['push'](_0x31c480['shift']());}};_0x3687ce(++_0x13f64a);}(_0x9294,0x113));var _0x4929=function(_0x1d5a32,_0x47974a){_0x1d5a32=_0x1d5a32-0x0;var _0x361ca0=_0x9294[_0x1d5a32];return _0x361ca0;};'use strict';var multer=require(_0x4929('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4929('0x1')]();var auth=require(_0x4929('0x2'));var interaction=require(_0x4929('0x3'));var config=require(_0x4929('0x4'));var controller=require('./crmTask.controller');router[_0x4929('0x5')]('/',auth[_0x4929('0x6')](),controller[_0x4929('0x7')]);router[_0x4929('0x5')](_0x4929('0x8'),auth[_0x4929('0x6')](),controller[_0x4929('0x9')]);router[_0x4929('0x5')](_0x4929('0xa'),auth[_0x4929('0x6')](),controller[_0x4929('0xb')]);router['post']('/',auth[_0x4929('0x6')](),controller[_0x4929('0xc')]);router[_0x4929('0xd')](_0x4929('0xa'),auth[_0x4929('0x6')](),controller['update']);router[_0x4929('0xe')](_0x4929('0xa'),auth[_0x4929('0x6')](),controller[_0x4929('0xf')]);module[_0x4929('0x10')]=router; \ No newline at end of file diff --git a/server/api/crmWorkflow/crmWorkflow.attributes.js b/server/api/crmWorkflow/crmWorkflow.attributes.js index db93266..dcdcf9d 100644 --- a/server/api/crmWorkflow/crmWorkflow.attributes.js +++ b/server/api/crmWorkflow/crmWorkflow.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea49=['name','Free','sequelize','exports','STRING'];(function(_0x1ed354,_0x4bb5be){var _0x532757=function(_0x574f3e){while(--_0x574f3e){_0x1ed354['push'](_0x1ed354['shift']());}};_0x532757(++_0x4bb5be);}(_0xea49,0xfc));var _0x9ea4=function(_0x94cd9e,_0x2b50f2){_0x94cd9e=_0x94cd9e-0x0;var _0x1bf136=_0xea49[_0x94cd9e];return _0x1bf136;};'use strict';var Sequelize=require(_0x9ea4('0x0'));module[_0x9ea4('0x1')]={'name':{'type':Sequelize[_0x9ea4('0x2')],'allowNull':![],'unique':_0x9ea4('0x3')},'type':{'type':Sequelize['ENUM']('CRM','SalesAid',_0x9ea4('0x4')),'allowNull':![]}}; \ No newline at end of file +var _0x6966=['name','ENUM','CRM','Free','sequelize','exports','STRING'];(function(_0x57bc62,_0x327f18){var _0x5b8bd4=function(_0x1ea165){while(--_0x1ea165){_0x57bc62['push'](_0x57bc62['shift']());}};_0x5b8bd4(++_0x327f18);}(_0x6966,0x18c));var _0x6696=function(_0x2d33d7,_0x270d02){_0x2d33d7=_0x2d33d7-0x0;var _0x422d98=_0x6966[_0x2d33d7];return _0x422d98;};'use strict';var Sequelize=require(_0x6696('0x0'));module[_0x6696('0x1')]={'name':{'type':Sequelize[_0x6696('0x2')],'allowNull':![],'unique':_0x6696('0x3')},'type':{'type':Sequelize[_0x6696('0x4')](_0x6696('0x5'),'SalesAid',_0x6696('0x6')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/crmWorkflow/crmWorkflow.controller.js b/server/api/crmWorkflow/crmWorkflow.controller.js index 61e11f4..24e2fae 100644 --- a/server/api/crmWorkflow/crmWorkflow.controller.js +++ b/server/api/crmWorkflow/crmWorkflow.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1670=['../../config/utils','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','key','field','options','CrmWorkflow','includeAll','CrmWorkflowStep','CrmTask','CrmActionsList','CrmWorkflowNextStep','findAll','rows','show','params','include','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger'];(function(_0x575082,_0x1ad806){var _0x3b4ada=function(_0x34b08b){while(--_0x34b08b){_0x575082['push'](_0x575082['shift']());}};_0x3b4ada(++_0x1ad806);}(_0x1670,0x1b9));var _0x0167=function(_0x17a990,_0x1b91e2){_0x17a990=_0x17a990-0x0;var _0x16ebd3=_0x1670[_0x17a990];return _0x16ebd3;};'use strict';var pdf=require(_0x0167('0x0'));var emlformat=require(_0x0167('0x1'));var rimraf=require(_0x0167('0x2'));var zipdir=require(_0x0167('0x3'));var jsonpatch=require(_0x0167('0x4'));var rp=require(_0x0167('0x5'));var moment=require(_0x0167('0x6'));var BPromise=require(_0x0167('0x7'));var Mustache=require(_0x0167('0x8'));var util=require(_0x0167('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0x0167('0xa'));var ejs=require(_0x0167('0xb'));var fs=require('fs');var _=require(_0x0167('0xc'));var squel=require(_0x0167('0xd'));var crypto=require(_0x0167('0xe'));var jsforce=require(_0x0167('0xf'));var deskjs=require(_0x0167('0x10'));var toCsv=require(_0x0167('0xa'));var querystring=require(_0x0167('0x11'));var Papa=require(_0x0167('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x0167('0x13'));var logger=require(_0x0167('0x14'))('api');var utils=require(_0x0167('0x15'));var config=require('../../config/environment');var db=require(_0x0167('0x16'))['db'];function respondWithStatusCode(_0x35d14d,_0x41d20e){_0x41d20e=_0x41d20e||0xcc;return function(_0x52da99){if(_0x52da99){return _0x35d14d[_0x0167('0x17')](_0x41d20e);}return _0x35d14d['status'](_0x41d20e)[_0x0167('0x18')]();};}function respondWithResult(_0x411fdf,_0x55f49f){_0x55f49f=_0x55f49f||0xc8;return function(_0x4d84d9){if(_0x4d84d9){return _0x411fdf['status'](_0x55f49f)[_0x0167('0x19')](_0x4d84d9);}};}function respondWithFilteredResult(_0x22731f,_0x44f4ed){return function(_0x450db3){if(_0x450db3){var _0x5d3a49=_0x450db3[_0x0167('0x1a')],_0x2c3436=_0x44f4ed[_0x0167('0x1b')],_0x2174cd=_0x44f4ed[_0x0167('0x1b')]+_0x44f4ed[_0x0167('0x1c')],_0x4e1b4f;if(_0x2174cd>=_0x5d3a49){_0x2174cd=_0x5d3a49;_0x4e1b4f=0xc8;}else{_0x4e1b4f=0xce;}_0x22731f[_0x0167('0x1d')](_0x4e1b4f);return _0x22731f[_0x0167('0x1e')](_0x0167('0x1f'),_0x2c3436+'-'+_0x2174cd+'/'+_0x5d3a49)[_0x0167('0x19')](_0x450db3);}return null;};}function patchUpdates(_0x3d5a2c){return function(_0x4c8c4c){try{jsonpatch[_0x0167('0x20')](_0x4c8c4c,_0x3d5a2c,!![]);}catch(_0x425422){return BPromise['reject'](_0x425422);}return _0x4c8c4c[_0x0167('0x21')]();};}function saveUpdates(_0x55f39d,_0x5511d6){return function(_0x4312ac){if(_0x4312ac){return _0x4312ac[_0x0167('0x22')](_0x55f39d)[_0x0167('0x23')](function(_0x4f8619){return _0x4f8619;});}return null;};}function removeEntity(_0xeaf7be,_0x272c1d){return function(_0x54cd78){if(_0x54cd78){return _0x54cd78[_0x0167('0x24')]()[_0x0167('0x23')](function(){_0xeaf7be['status'](0xcc)[_0x0167('0x18')]();});}};}function handleEntityNotFound(_0x102795,_0x31929f){return function(_0x2b288b){if(!_0x2b288b){_0x102795[_0x0167('0x17')](0x194);}return _0x2b288b;};}function handleError(_0x299056,_0x17327e){_0x17327e=_0x17327e||0x1f4;return function(_0x32d906){logger['error'](_0x32d906[_0x0167('0x25')]);if(_0x32d906['name']){delete _0x32d906[_0x0167('0x26')];}_0x299056['status'](_0x17327e)[_0x0167('0x27')](_0x32d906);};}exports[_0x0167('0x28')]=function(_0x4cc2dc,_0x10572d){var _0x208412={},_0x1688a0={},_0x2ee5a4={'count':0x0,'rows':[]};var _0x25d46f=db['CrmWorkflow'][_0x0167('0x29')];_0x1688a0[_0x0167('0x2a')]=_[_0x0167('0x2b')](_0x25d46f);_0x1688a0['query']=_[_0x0167('0x2b')](_0x4cc2dc[_0x0167('0x2c')]);_0x1688a0[_0x0167('0x2d')]=_[_0x0167('0x2e')](_0x1688a0[_0x0167('0x2a')],_0x1688a0[_0x0167('0x2c')]);_0x208412['attributes']=_[_0x0167('0x2e')](_0x1688a0[_0x0167('0x2a')],qs[_0x0167('0x2f')](_0x4cc2dc[_0x0167('0x2c')]['fields']));_0x208412[_0x0167('0x30')]=_0x208412['attributes'][_0x0167('0x31')]?_0x208412['attributes']:_0x1688a0['model'];if(!_0x4cc2dc['query'][_0x0167('0x32')](_0x0167('0x33'))){_0x208412[_0x0167('0x1c')]=qs[_0x0167('0x1c')](_0x4cc2dc['query']['limit']);_0x208412[_0x0167('0x1b')]=qs[_0x0167('0x1b')](_0x4cc2dc['query'][_0x0167('0x1b')]);}_0x208412[_0x0167('0x34')]=qs[_0x0167('0x35')](_0x4cc2dc[_0x0167('0x2c')]['sort']);_0x208412['where']=qs[_0x0167('0x2d')](_[_0x0167('0x36')](_0x4cc2dc['query'],_0x1688a0[_0x0167('0x2d')]));if(_0x4cc2dc['query']['filter']){_0x208412[_0x0167('0x37')]=_[_0x0167('0x38')](_0x208412['where'],{'$or':_['map'](_0x25d46f,function(_0x1b671e){if(_0x1b671e[_0x0167('0x39')][_0x0167('0x3a')]!=='VIRTUAL'){var _0x69419c={};_0x69419c[_0x1b671e[_0x0167('0x3b')]]={'$like':'%'+_0x4cc2dc[_0x0167('0x2c')]['filter']+'%'};return _0x69419c;}})});}_0x208412=_[_0x0167('0x38')]({},_0x208412,_0x4cc2dc[_0x0167('0x3c')]);var _0x3707a2={'where':_0x208412[_0x0167('0x37')]};return db[_0x0167('0x3d')][_0x0167('0x1a')](_0x3707a2)[_0x0167('0x23')](function(_0xc7850b){_0x2ee5a4['count']=_0xc7850b;if(_0x4cc2dc[_0x0167('0x2c')][_0x0167('0x3e')]){_0x208412['include']=[{'model':db[_0x0167('0x3f')],'include':[{'model':db[_0x0167('0x40')],'include':[{'model':db[_0x0167('0x41')]}]},{'model':db[_0x0167('0x3f')],'as':_0x0167('0x42'),'through':{'attributes':[]}}]}];}return db[_0x0167('0x3d')][_0x0167('0x43')](_0x208412);})[_0x0167('0x23')](function(_0x905f6f){_0x2ee5a4[_0x0167('0x44')]=_0x905f6f;return _0x2ee5a4;})[_0x0167('0x23')](respondWithFilteredResult(_0x10572d,_0x208412))['catch'](handleError(_0x10572d,null));};exports[_0x0167('0x45')]=function(_0x5add02,_0x23bcc6){var _0x387ffa={'raw':![],'where':{'id':_0x5add02[_0x0167('0x46')]['id']}},_0x2e104d={};_0x2e104d[_0x0167('0x2a')]=_[_0x0167('0x2b')](db[_0x0167('0x3d')][_0x0167('0x29')]);_0x2e104d['query']=_[_0x0167('0x2b')](_0x5add02[_0x0167('0x2c')]);_0x2e104d[_0x0167('0x2d')]=_[_0x0167('0x2e')](_0x2e104d[_0x0167('0x2a')],_0x2e104d[_0x0167('0x2c')]);_0x387ffa[_0x0167('0x30')]=_[_0x0167('0x2e')](_0x2e104d[_0x0167('0x2a')],qs['fields'](_0x5add02[_0x0167('0x2c')][_0x0167('0x2f')]));_0x387ffa[_0x0167('0x30')]=_0x387ffa[_0x0167('0x30')][_0x0167('0x31')]?_0x387ffa[_0x0167('0x30')]:_0x2e104d['model'];if(_0x5add02[_0x0167('0x2c')][_0x0167('0x3e')]){_0x387ffa[_0x0167('0x47')]=[{'all':!![]}];}_0x387ffa=_[_0x0167('0x38')]({},_0x387ffa,_0x5add02[_0x0167('0x3c')]);return db[_0x0167('0x3d')][_0x0167('0x48')](_0x387ffa)[_0x0167('0x23')](handleEntityNotFound(_0x23bcc6,null))[_0x0167('0x23')](respondWithResult(_0x23bcc6,null))[_0x0167('0x49')](handleError(_0x23bcc6,null));};exports['create']=function(_0x4799c0,_0x12ffd2){return db[_0x0167('0x3d')][_0x0167('0x4a')](_0x4799c0[_0x0167('0x4b')],{})[_0x0167('0x23')](respondWithResult(_0x12ffd2,0xc9))[_0x0167('0x49')](handleError(_0x12ffd2,null));};exports[_0x0167('0x22')]=function(_0x9b736f,_0x10004f){if(_0x9b736f['body']['id']){delete _0x9b736f[_0x0167('0x4b')]['id'];}return db[_0x0167('0x3d')][_0x0167('0x48')]({'where':{'id':_0x9b736f['params']['id']}})[_0x0167('0x23')](handleEntityNotFound(_0x10004f,null))[_0x0167('0x23')](saveUpdates(_0x9b736f[_0x0167('0x4b')],null))[_0x0167('0x23')](respondWithResult(_0x10004f,null))['catch'](handleError(_0x10004f,null));};exports[_0x0167('0x24')]=function(_0xac5f4f,_0x38c68a){return db[_0x0167('0x3d')][_0x0167('0x48')]({'where':{'id':_0xac5f4f[_0x0167('0x46')]['id']}})[_0x0167('0x23')](handleEntityNotFound(_0x38c68a,null))[_0x0167('0x23')](removeEntity(_0x38c68a,null))['catch'](handleError(_0x38c68a,null));};exports['describe']=function(_0x1c19ad,_0x4b16ea){return db[_0x0167('0x3d')][_0x0167('0x4c')]()['then'](respondWithResult(_0x4b16ea,null))[_0x0167('0x49')](handleError(_0x4b16ea,null));}; \ No newline at end of file +var _0x9f8f=['show','include','find','create','body','params','html-pdf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','CrmWorkflow','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','map','type','key','VIRTUAL','field','filter','merge','options','includeAll','CrmWorkflowStep','CrmTask','CrmActionsList','CrmWorkflowNextStep','catch'];(function(_0x581eb6,_0x3058a4){var _0xb039d0=function(_0x3277f1){while(--_0x3277f1){_0x581eb6['push'](_0x581eb6['shift']());}};_0xb039d0(++_0x3058a4);}(_0x9f8f,0xea));var _0xf9f8=function(_0x3a9d39,_0x2dd758){_0x3a9d39=_0x3a9d39-0x0;var _0x14d880=_0x9f8f[_0x3a9d39];return _0x14d880;};'use strict';var pdf=require(_0xf9f8('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf9f8('0x1'));var rp=require(_0xf9f8('0x2'));var moment=require(_0xf9f8('0x3'));var BPromise=require(_0xf9f8('0x4'));var Mustache=require(_0xf9f8('0x5'));var util=require(_0xf9f8('0x6'));var path=require('path');var sox=require(_0xf9f8('0x7'));var csv=require(_0xf9f8('0x8'));var ejs=require(_0xf9f8('0x9'));var fs=require('fs');var _=require(_0xf9f8('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf9f8('0xb'));var deskjs=require(_0xf9f8('0xc'));var toCsv=require(_0xf9f8('0x8'));var querystring=require(_0xf9f8('0xd'));var Papa=require('papaparse');var Redis=require(_0xf9f8('0xe'));var authService=require(_0xf9f8('0xf'));var qs=require(_0xf9f8('0x10'));var hardwareService=require(_0xf9f8('0x11'));var logger=require(_0xf9f8('0x12'))(_0xf9f8('0x13'));var utils=require('../../config/utils');var config=require(_0xf9f8('0x14'));var db=require(_0xf9f8('0x15'))['db'];function respondWithStatusCode(_0x1250da,_0x363ca9){_0x363ca9=_0x363ca9||0xcc;return function(_0x2bc62a){if(_0x2bc62a){return _0x1250da[_0xf9f8('0x16')](_0x363ca9);}return _0x1250da[_0xf9f8('0x17')](_0x363ca9)[_0xf9f8('0x18')]();};}function respondWithResult(_0x3415aa,_0x568a7f){_0x568a7f=_0x568a7f||0xc8;return function(_0x598ab5){if(_0x598ab5){return _0x3415aa[_0xf9f8('0x17')](_0x568a7f)[_0xf9f8('0x19')](_0x598ab5);}};}function respondWithFilteredResult(_0x1d4d1b,_0x3d6278){return function(_0x30230b){if(_0x30230b){var _0xbec778=_0x30230b[_0xf9f8('0x1a')],_0x105e33=_0x3d6278['offset'],_0x3c8dc9=_0x3d6278[_0xf9f8('0x1b')]+_0x3d6278['limit'],_0x23deef;if(_0x3c8dc9>=_0xbec778){_0x3c8dc9=_0xbec778;_0x23deef=0xc8;}else{_0x23deef=0xce;}_0x1d4d1b[_0xf9f8('0x17')](_0x23deef);return _0x1d4d1b[_0xf9f8('0x1c')](_0xf9f8('0x1d'),_0x105e33+'-'+_0x3c8dc9+'/'+_0xbec778)[_0xf9f8('0x19')](_0x30230b);}return null;};}function patchUpdates(_0x379d76){return function(_0x2ebf1c){try{jsonpatch[_0xf9f8('0x1e')](_0x2ebf1c,_0x379d76,!![]);}catch(_0x26f07f){return BPromise[_0xf9f8('0x1f')](_0x26f07f);}return _0x2ebf1c[_0xf9f8('0x20')]();};}function saveUpdates(_0x565900,_0x4bb373){return function(_0x7ad331){if(_0x7ad331){return _0x7ad331[_0xf9f8('0x21')](_0x565900)[_0xf9f8('0x22')](function(_0x51ba4c){return _0x51ba4c;});}return null;};}function removeEntity(_0x40e678,_0x539fc8){return function(_0x1e9bf5){if(_0x1e9bf5){return _0x1e9bf5[_0xf9f8('0x23')]()['then'](function(){_0x40e678['status'](0xcc)[_0xf9f8('0x18')]();});}};}function handleEntityNotFound(_0x374b8a,_0x29b2cf){return function(_0x27852d){if(!_0x27852d){_0x374b8a[_0xf9f8('0x16')](0x194);}return _0x27852d;};}function handleError(_0x10f6ac,_0x5d43a6){_0x5d43a6=_0x5d43a6||0x1f4;return function(_0x124d19){logger['error'](_0x124d19['stack']);if(_0x124d19['name']){delete _0x124d19[_0xf9f8('0x24')];}_0x10f6ac[_0xf9f8('0x17')](_0x5d43a6)[_0xf9f8('0x25')](_0x124d19);};}exports[_0xf9f8('0x26')]=function(_0x5380a6,_0x5acedf){var _0x53e43b={},_0x135188={},_0x23abe5={'count':0x0,'rows':[]};var _0x3e88a1=db[_0xf9f8('0x27')][_0xf9f8('0x28')];_0x135188[_0xf9f8('0x29')]=_[_0xf9f8('0x2a')](_0x3e88a1);_0x135188[_0xf9f8('0x2b')]=_[_0xf9f8('0x2a')](_0x5380a6[_0xf9f8('0x2b')]);_0x135188[_0xf9f8('0x2c')]=_[_0xf9f8('0x2d')](_0x135188[_0xf9f8('0x29')],_0x135188[_0xf9f8('0x2b')]);_0x53e43b['attributes']=_['intersection'](_0x135188[_0xf9f8('0x29')],qs[_0xf9f8('0x2e')](_0x5380a6['query']['fields']));_0x53e43b[_0xf9f8('0x2f')]=_0x53e43b[_0xf9f8('0x2f')][_0xf9f8('0x30')]?_0x53e43b[_0xf9f8('0x2f')]:_0x135188[_0xf9f8('0x29')];if(!_0x5380a6['query'][_0xf9f8('0x31')](_0xf9f8('0x32'))){_0x53e43b[_0xf9f8('0x33')]=qs[_0xf9f8('0x33')](_0x5380a6['query'][_0xf9f8('0x33')]);_0x53e43b[_0xf9f8('0x1b')]=qs['offset'](_0x5380a6['query'][_0xf9f8('0x1b')]);}_0x53e43b[_0xf9f8('0x34')]=qs[_0xf9f8('0x35')](_0x5380a6[_0xf9f8('0x2b')][_0xf9f8('0x35')]);_0x53e43b[_0xf9f8('0x36')]=qs[_0xf9f8('0x2c')](_[_0xf9f8('0x37')](_0x5380a6[_0xf9f8('0x2b')],_0x135188[_0xf9f8('0x2c')]));if(_0x5380a6[_0xf9f8('0x2b')]['filter']){_0x53e43b[_0xf9f8('0x36')]=_['merge'](_0x53e43b[_0xf9f8('0x36')],{'$or':_[_0xf9f8('0x38')](_0x3e88a1,function(_0xd1ecaa){if(_0xd1ecaa[_0xf9f8('0x39')][_0xf9f8('0x3a')]!==_0xf9f8('0x3b')){var _0x57245e={};_0x57245e[_0xd1ecaa[_0xf9f8('0x3c')]]={'$like':'%'+_0x5380a6['query'][_0xf9f8('0x3d')]+'%'};return _0x57245e;}})});}_0x53e43b=_[_0xf9f8('0x3e')]({},_0x53e43b,_0x5380a6[_0xf9f8('0x3f')]);var _0x279f42={'where':_0x53e43b[_0xf9f8('0x36')]};return db[_0xf9f8('0x27')][_0xf9f8('0x1a')](_0x279f42)[_0xf9f8('0x22')](function(_0x564d61){_0x23abe5[_0xf9f8('0x1a')]=_0x564d61;if(_0x5380a6[_0xf9f8('0x2b')][_0xf9f8('0x40')]){_0x53e43b['include']=[{'model':db[_0xf9f8('0x41')],'include':[{'model':db[_0xf9f8('0x42')],'include':[{'model':db[_0xf9f8('0x43')]}]},{'model':db['CrmWorkflowStep'],'as':_0xf9f8('0x44'),'through':{'attributes':[]}}]}];}return db[_0xf9f8('0x27')]['findAll'](_0x53e43b);})[_0xf9f8('0x22')](function(_0x25eb64){_0x23abe5['rows']=_0x25eb64;return _0x23abe5;})['then'](respondWithFilteredResult(_0x5acedf,_0x53e43b))[_0xf9f8('0x45')](handleError(_0x5acedf,null));};exports[_0xf9f8('0x46')]=function(_0x36006e,_0x242de2){var _0x141974={'raw':![],'where':{'id':_0x36006e['params']['id']}},_0x2e0d97={};_0x2e0d97['model']=_['keys'](db[_0xf9f8('0x27')][_0xf9f8('0x28')]);_0x2e0d97['query']=_[_0xf9f8('0x2a')](_0x36006e[_0xf9f8('0x2b')]);_0x2e0d97['filters']=_[_0xf9f8('0x2d')](_0x2e0d97[_0xf9f8('0x29')],_0x2e0d97['query']);_0x141974[_0xf9f8('0x2f')]=_[_0xf9f8('0x2d')](_0x2e0d97[_0xf9f8('0x29')],qs[_0xf9f8('0x2e')](_0x36006e[_0xf9f8('0x2b')]['fields']));_0x141974[_0xf9f8('0x2f')]=_0x141974['attributes'][_0xf9f8('0x30')]?_0x141974[_0xf9f8('0x2f')]:_0x2e0d97[_0xf9f8('0x29')];if(_0x36006e[_0xf9f8('0x2b')][_0xf9f8('0x40')]){_0x141974[_0xf9f8('0x47')]=[{'all':!![]}];}_0x141974=_[_0xf9f8('0x3e')]({},_0x141974,_0x36006e[_0xf9f8('0x3f')]);return db['CrmWorkflow'][_0xf9f8('0x48')](_0x141974)['then'](handleEntityNotFound(_0x242de2,null))[_0xf9f8('0x22')](respondWithResult(_0x242de2,null))[_0xf9f8('0x45')](handleError(_0x242de2,null));};exports[_0xf9f8('0x49')]=function(_0x47019f,_0x242dce){return db[_0xf9f8('0x27')][_0xf9f8('0x49')](_0x47019f[_0xf9f8('0x4a')],{})[_0xf9f8('0x22')](respondWithResult(_0x242dce,0xc9))['catch'](handleError(_0x242dce,null));};exports[_0xf9f8('0x21')]=function(_0x11e3b7,_0x2195fa){if(_0x11e3b7[_0xf9f8('0x4a')]['id']){delete _0x11e3b7['body']['id'];}return db[_0xf9f8('0x27')][_0xf9f8('0x48')]({'where':{'id':_0x11e3b7[_0xf9f8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2195fa,null))[_0xf9f8('0x22')](saveUpdates(_0x11e3b7[_0xf9f8('0x4a')],null))['then'](respondWithResult(_0x2195fa,null))['catch'](handleError(_0x2195fa,null));};exports[_0xf9f8('0x23')]=function(_0x10e982,_0x10c7b2){return db['CrmWorkflow']['find']({'where':{'id':_0x10e982['params']['id']}})[_0xf9f8('0x22')](handleEntityNotFound(_0x10c7b2,null))[_0xf9f8('0x22')](removeEntity(_0x10c7b2,null))['catch'](handleError(_0x10c7b2,null));};exports['describe']=function(_0x11912a,_0x49524e){return db[_0xf9f8('0x27')]['describe']()['then'](respondWithResult(_0x49524e,null))[_0xf9f8('0x45')](handleError(_0x49524e,null));}; \ No newline at end of file diff --git a/server/api/crmWorkflow/crmWorkflow.model.js b/server/api/crmWorkflow/crmWorkflow.model.js index 0dc05be..ec39bea 100644 --- a/server/api/crmWorkflow/crmWorkflow.model.js +++ b/server/api/crmWorkflow/crmWorkflow.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6eb0=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./crmWorkflow.attributes','exports','define','crm_workflows','lodash'];(function(_0x1247ba,_0x2395ed){var _0x20edbc=function(_0x4845ed){while(--_0x4845ed){_0x1247ba['push'](_0x1247ba['shift']());}};_0x20edbc(++_0x2395ed);}(_0x6eb0,0x81));var _0x06eb=function(_0x3fe56e,_0x42c05f){_0x3fe56e=_0x3fe56e-0x0;var _0x4db59f=_0x6eb0[_0x3fe56e];return _0x4db59f;};'use strict';var _=require(_0x06eb('0x0'));var util=require('util');var logger=require(_0x06eb('0x1'))(_0x06eb('0x2'));var moment=require(_0x06eb('0x3'));var BPromise=require(_0x06eb('0x4'));var rp=require(_0x06eb('0x5'));var fs=require('fs');var path=require(_0x06eb('0x6'));var rimraf=require(_0x06eb('0x7'));var config=require(_0x06eb('0x8'));var attributes=require(_0x06eb('0x9'));module[_0x06eb('0xa')]=function(_0x3c2513,_0x500a8c){return _0x3c2513[_0x06eb('0xb')]('CrmWorkflow',attributes,{'tableName':_0x06eb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fd1=['../../config/logger','api','bluebird','path','../../config/environment','exports','crm_workflows','lodash','util'];(function(_0x44044a,_0x3a0097){var _0x43bb6e=function(_0x1afe12){while(--_0x1afe12){_0x44044a['push'](_0x44044a['shift']());}};_0x43bb6e(++_0x3a0097);}(_0x7fd1,0x6a));var _0x17fd=function(_0x5df8c0,_0x53f810){_0x5df8c0=_0x5df8c0-0x0;var _0x329b59=_0x7fd1[_0x5df8c0];return _0x329b59;};'use strict';var _=require(_0x17fd('0x0'));var util=require(_0x17fd('0x1'));var logger=require(_0x17fd('0x2'))(_0x17fd('0x3'));var moment=require('moment');var BPromise=require(_0x17fd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x17fd('0x5'));var rimraf=require('rimraf');var config=require(_0x17fd('0x6'));var attributes=require('./crmWorkflow.attributes');module[_0x17fd('0x7')]=function(_0x46c069,_0x1e8ce5){return _0x46c069['define']('CrmWorkflow',attributes,{'tableName':_0x17fd('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/crmWorkflow/crmWorkflow.rpc.js b/server/api/crmWorkflow/crmWorkflow.rpc.js index 7193be9..6abbbbf 100644 --- a/server/api/crmWorkflow/crmWorkflow.rpc.js +++ b/server/api/crmWorkflow/crmWorkflow.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa945=['stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../config/utils','rpc','jayson/promise','client','request','then','CrmWorkflow,\x20%s,\x20%s','request\x20sent','debug','CrmWorkflow,\x20%s,\x20%s,\x20%s'];(function(_0x1654d1,_0x3d5e4b){var _0x4a28ae=function(_0x2d6d66){while(--_0x2d6d66){_0x1654d1['push'](_0x1654d1['shift']());}};_0x4a28ae(++_0x3d5e4b);}(_0xa945,0x118));var _0x5a94=function(_0x409ea4,_0x53fea5){_0x409ea4=_0x409ea4-0x0;var _0x5b1196=_0xa945[_0x409ea4];return _0x5b1196;};'use strict';var _=require(_0x5a94('0x0'));var util=require(_0x5a94('0x1'));var moment=require(_0x5a94('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a94('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5a94('0x4'));var logger=require('../../config/logger')(_0x5a94('0x5'));var config=require('../../config/environment');var jayson=require(_0x5a94('0x6'));var client=jayson[_0x5a94('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36fe63,_0x14fa1a,_0x164363){return new BPromise(function(_0x4f2bf4,_0x10df15){return client[_0x5a94('0x8')](_0x36fe63,_0x164363)[_0x5a94('0x9')](function(_0x544257){logger['info'](_0x5a94('0xa'),_0x14fa1a,_0x5a94('0xb'));logger[_0x5a94('0xc')](_0x5a94('0xd'),_0x14fa1a,'request\x20sent',JSON[_0x5a94('0xe')](_0x544257));if(_0x544257[_0x5a94('0xf')]){if(_0x544257['error'][_0x5a94('0x10')]===0x1f4){logger[_0x5a94('0xf')](_0x5a94('0xa'),_0x14fa1a,_0x544257[_0x5a94('0xf')][_0x5a94('0x11')]);return _0x10df15(_0x544257[_0x5a94('0xf')][_0x5a94('0x11')]);}logger['error']('CrmWorkflow,\x20%s,\x20%s',_0x14fa1a,_0x544257[_0x5a94('0xf')]['message']);return _0x4f2bf4(_0x544257[_0x5a94('0xf')][_0x5a94('0x11')]);}else{logger[_0x5a94('0x12')](_0x5a94('0xa'),_0x14fa1a,_0x5a94('0xb'));_0x4f2bf4(_0x544257[_0x5a94('0x13')][_0x5a94('0x11')]);}})[_0x5a94('0x14')](function(_0x108d1c){logger[_0x5a94('0xf')]('CrmWorkflow,\x20%s,\x20%s',_0x14fa1a,_0x108d1c);_0x10df15(_0x108d1c);});});} \ No newline at end of file +var _0xf02c=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CrmWorkflow,\x20%s,\x20%s','debug','CrmWorkflow,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0xf02c,0x92));var _0xcf02=function(_0x54e334,_0x2980e9){_0x54e334=_0x54e334-0x0;var _0x28de88=_0xf02c[_0x54e334];return _0x28de88;};'use strict';var _=require(_0xcf02('0x0'));var util=require(_0xcf02('0x1'));var moment=require(_0xcf02('0x2'));var BPromise=require(_0xcf02('0x3'));var rs=require(_0xcf02('0x4'));var fs=require('fs');var Redis=require(_0xcf02('0x5'));var db=require(_0xcf02('0x6'))['db'];var utils=require(_0xcf02('0x7'));var logger=require(_0xcf02('0x8'))(_0xcf02('0x9'));var config=require(_0xcf02('0xa'));var jayson=require(_0xcf02('0xb'));var client=jayson[_0xcf02('0xc')][_0xcf02('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3569a1,_0x49ad8e,_0x45745e){return new BPromise(function(_0x56c3db,_0x5a255f){return client['request'](_0x3569a1,_0x45745e)[_0xcf02('0xe')](function(_0x2f1633){logger[_0xcf02('0xf')](_0xcf02('0x10'),_0x49ad8e,'request\x20sent');logger[_0xcf02('0x11')](_0xcf02('0x12'),_0x49ad8e,_0xcf02('0x13'),JSON['stringify'](_0x2f1633));if(_0x2f1633['error']){if(_0x2f1633[_0xcf02('0x14')][_0xcf02('0x15')]===0x1f4){logger[_0xcf02('0x14')](_0xcf02('0x10'),_0x49ad8e,_0x2f1633[_0xcf02('0x14')]['message']);return _0x5a255f(_0x2f1633[_0xcf02('0x14')][_0xcf02('0x16')]);}logger[_0xcf02('0x14')](_0xcf02('0x10'),_0x49ad8e,_0x2f1633[_0xcf02('0x14')][_0xcf02('0x16')]);return _0x56c3db(_0x2f1633[_0xcf02('0x14')]['message']);}else{logger[_0xcf02('0xf')](_0xcf02('0x10'),_0x49ad8e,_0xcf02('0x13'));_0x56c3db(_0x2f1633['result'][_0xcf02('0x16')]);}})[_0xcf02('0x17')](function(_0x59f337){logger[_0xcf02('0x14')]('CrmWorkflow,\x20%s,\x20%s',_0x49ad8e,_0x59f337);_0x5a255f(_0x59f337);});});} \ No newline at end of file diff --git a/server/api/crmWorkflow/index.js b/server/api/crmWorkflow/index.js index a86ce4e..7d38488 100644 --- a/server/api/crmWorkflow/index.js +++ b/server/api/crmWorkflow/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6343=['isAuthenticated','index','/describe','/:id','show','post','create','update','destroy','exports','path','connect-timeout','../../config/environment','./crmWorkflow.controller'];(function(_0x53ad58,_0x3fb489){var _0x554b03=function(_0x5769ba){while(--_0x5769ba){_0x53ad58['push'](_0x53ad58['shift']());}};_0x554b03(++_0x3fb489);}(_0x6343,0x168));var _0x3634=function(_0x1e89cd,_0x14ea91){_0x1e89cd=_0x1e89cd-0x0;var _0x502c06=_0x6343[_0x1e89cd];return _0x502c06;};'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')]('/',auth[_0x3634('0x4')](),controller[_0x3634('0xa')]);router['put']('/:id',auth[_0x3634('0x4')](),controller[_0x3634('0xb')]);router['delete'](_0x3634('0x7'),auth[_0x3634('0x4')](),controller[_0x3634('0xc')]);module[_0x3634('0xd')]=router; \ No newline at end of file +var _0x8135=['../../config/environment','./crmWorkflow.controller','get','index','describe','/:id','isAuthenticated','show','create','put','update','destroy','multer','util','connect-timeout','express','../../components/interaction/service'];(function(_0x30baa3,_0x3d12a8){var _0xcf1863=function(_0x43987d){while(--_0x43987d){_0x30baa3['push'](_0x30baa3['shift']());}};_0xcf1863(++_0x3d12a8);}(_0x8135,0x171));var _0x5813=function(_0x26ebb7,_0x31b4a9){_0x26ebb7=_0x26ebb7-0x0;var _0x1434a6=_0x8135[_0x26ebb7];return _0x1434a6;};'use strict';var multer=require(_0x5813('0x0'));var util=require(_0x5813('0x1'));var path=require('path');var timeout=require(_0x5813('0x2'));var express=require(_0x5813('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x5813('0x4'));var config=require(_0x5813('0x5'));var controller=require(_0x5813('0x6'));router[_0x5813('0x7')]('/',auth['isAuthenticated'](),controller[_0x5813('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x5813('0x9')]);router[_0x5813('0x7')](_0x5813('0xa'),auth[_0x5813('0xb')](),controller[_0x5813('0xc')]);router['post']('/',auth[_0x5813('0xb')](),controller[_0x5813('0xd')]);router[_0x5813('0xe')]('/:id',auth[_0x5813('0xb')](),controller[_0x5813('0xf')]);router['delete'](_0x5813('0xa'),auth[_0x5813('0xb')](),controller[_0x5813('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/crmWorkflowstep/crmWorkflowstep.attributes.js b/server/api/crmWorkflowstep/crmWorkflowstep.attributes.js index 5cc2308..0a06e95 100644 --- a/server/api/crmWorkflowstep/crmWorkflowstep.attributes.js +++ b/server/api/crmWorkflowstep/crmWorkflowstep.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb40b=['name','sequelize','STRING'];(function(_0x2d9fa6,_0x2b2cc8){var _0x4f6199=function(_0x391359){while(--_0x391359){_0x2d9fa6['push'](_0x2d9fa6['shift']());}};_0x4f6199(++_0x2b2cc8);}(_0xb40b,0x1cf));var _0xbb40=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xb40b[_0x5f09c5];return _0x426ad9;};'use strict';var Sequelize=require(_0xbb40('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb40('0x1')],'allowNull':![],'unique':_0xbb40('0x2')}}; \ No newline at end of file +var _0xf895=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf895,0xaf));var _0x5f89=function(_0x5cc275,_0x36b3b7){_0x5cc275=_0x5cc275-0x0;var _0x249a80=_0xf895[_0x5cc275];return _0x249a80;};'use strict';var Sequelize=require(_0x5f89('0x0'));module[_0x5f89('0x1')]={'name':{'type':Sequelize[_0x5f89('0x2')],'allowNull':![],'unique':'name'}}; \ No newline at end of file diff --git a/server/api/crmWorkflowstep/crmWorkflowstep.controller.js b/server/api/crmWorkflowstep/crmWorkflowstep.controller.js index 1073ce4..84bb1d8 100644 --- a/server/api/crmWorkflowstep/crmWorkflowstep.controller.js +++ b/server/api/crmWorkflowstep/crmWorkflowstep.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64f3=['merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','addCrmWorkflowNextStep','ids','omit','removeCrmWorkflowNextStep','getCrmWorkflowNextStep','findOne','map','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','error','stack','name','send','CrmWorkflowStep','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x64f3,0x149));var _0x364f=function(_0x190f15,_0x2516ab){_0x190f15=_0x190f15-0x0;var _0x1b306d=_0x64f3[_0x190f15];return _0x1b306d;};'use strict';var pdf=require(_0x364f('0x0'));var emlformat=require(_0x364f('0x1'));var rimraf=require(_0x364f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x364f('0x3'));var rp=require(_0x364f('0x4'));var moment=require(_0x364f('0x5'));var BPromise=require(_0x364f('0x6'));var Mustache=require('mustache');var util=require(_0x364f('0x7'));var path=require(_0x364f('0x8'));var sox=require(_0x364f('0x9'));var csv=require('to-csv');var ejs=require(_0x364f('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x364f('0xb'));var crypto=require('crypto');var jsforce=require(_0x364f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x364f('0xd'));var Redis=require(_0x364f('0xe'));var authService=require(_0x364f('0xf'));var qs=require(_0x364f('0x10'));var hardwareService=require(_0x364f('0x11'));var logger=require(_0x364f('0x12'))('api');var utils=require(_0x364f('0x13'));var config=require(_0x364f('0x14'));var db=require(_0x364f('0x15'))['db'];function respondWithStatusCode(_0x219b77,_0x285d1b){_0x285d1b=_0x285d1b||0xcc;return function(_0x56fa3c){if(_0x56fa3c){return _0x219b77[_0x364f('0x16')](_0x285d1b);}return _0x219b77[_0x364f('0x17')](_0x285d1b)[_0x364f('0x18')]();};}function respondWithResult(_0x242a3f,_0x41165d){_0x41165d=_0x41165d||0xc8;return function(_0x3c9fca){if(_0x3c9fca){return _0x242a3f['status'](_0x41165d)[_0x364f('0x19')](_0x3c9fca);}};}function respondWithFilteredResult(_0x1847a0,_0x2043bd){return function(_0x2c449e){if(_0x2c449e){var _0x2cc119=_0x2c449e[_0x364f('0x1a')],_0x105653=_0x2043bd[_0x364f('0x1b')],_0x2d6db2=_0x2043bd[_0x364f('0x1b')]+_0x2043bd[_0x364f('0x1c')],_0x52d2a7;if(_0x2d6db2>=_0x2cc119){_0x2d6db2=_0x2cc119;_0x52d2a7=0xc8;}else{_0x52d2a7=0xce;}_0x1847a0['status'](_0x52d2a7);return _0x1847a0[_0x364f('0x1d')]('Content-Range',_0x105653+'-'+_0x2d6db2+'/'+_0x2cc119)[_0x364f('0x19')](_0x2c449e);}return null;};}function patchUpdates(_0x1ab6d9){return function(_0x2ee651){try{jsonpatch[_0x364f('0x1e')](_0x2ee651,_0x1ab6d9,!![]);}catch(_0x5deaee){return BPromise[_0x364f('0x1f')](_0x5deaee);}return _0x2ee651['save']();};}function saveUpdates(_0x4ee87a,_0x2bfd3e){return function(_0x5e522c){if(_0x5e522c){return _0x5e522c[_0x364f('0x20')](_0x4ee87a)[_0x364f('0x21')](function(_0x16071a){return _0x16071a;});}return null;};}function removeEntity(_0x374c20,_0x49204b){return function(_0x6a602e){if(_0x6a602e){return _0x6a602e[_0x364f('0x22')]()[_0x364f('0x21')](function(){_0x374c20[_0x364f('0x17')](0xcc)[_0x364f('0x18')]();});}};}function handleEntityNotFound(_0x2d3b5f,_0x2b6aa1){return function(_0x3c8041){if(!_0x3c8041){_0x2d3b5f[_0x364f('0x16')](0x194);}return _0x3c8041;};}function handleError(_0x17df63,_0x4ad52c){_0x4ad52c=_0x4ad52c||0x1f4;return function(_0x9cab8c){logger[_0x364f('0x23')](_0x9cab8c[_0x364f('0x24')]);if(_0x9cab8c[_0x364f('0x25')]){delete _0x9cab8c[_0x364f('0x25')];}_0x17df63[_0x364f('0x17')](_0x4ad52c)[_0x364f('0x26')](_0x9cab8c);};}exports['index']=function(_0x1e66a0,_0x5aaf07){var _0x58ee08={},_0x5011b6={},_0x115fec={'count':0x0,'rows':[]};var _0x20dca2=db[_0x364f('0x27')][_0x364f('0x28')];_0x5011b6[_0x364f('0x29')]=_[_0x364f('0x2a')](_0x20dca2);_0x5011b6[_0x364f('0x2b')]=_[_0x364f('0x2a')](_0x1e66a0['query']);_0x5011b6['filters']=_[_0x364f('0x2c')](_0x5011b6[_0x364f('0x29')],_0x5011b6[_0x364f('0x2b')]);_0x58ee08[_0x364f('0x2d')]=_[_0x364f('0x2c')](_0x5011b6['model'],qs['fields'](_0x1e66a0[_0x364f('0x2b')][_0x364f('0x2e')]));_0x58ee08['attributes']=_0x58ee08['attributes'][_0x364f('0x2f')]?_0x58ee08['attributes']:_0x5011b6['model'];if(!_0x1e66a0['query'][_0x364f('0x30')](_0x364f('0x31'))){_0x58ee08[_0x364f('0x1c')]=qs['limit'](_0x1e66a0['query']['limit']);_0x58ee08['offset']=qs['offset'](_0x1e66a0[_0x364f('0x2b')][_0x364f('0x1b')]);}_0x58ee08[_0x364f('0x32')]=qs[_0x364f('0x33')](_0x1e66a0[_0x364f('0x2b')][_0x364f('0x33')]);_0x58ee08[_0x364f('0x34')]=qs[_0x364f('0x35')](_[_0x364f('0x36')](_0x1e66a0[_0x364f('0x2b')],_0x5011b6[_0x364f('0x35')]));if(_0x1e66a0[_0x364f('0x2b')][_0x364f('0x37')]){_0x58ee08[_0x364f('0x34')]=_[_0x364f('0x38')](_0x58ee08[_0x364f('0x34')],{'$or':_['map'](_0x20dca2,function(_0x4da118){if(_0x4da118[_0x364f('0x39')]['key']!=='VIRTUAL'){var _0x44195f={};_0x44195f[_0x4da118['field']]={'$like':'%'+_0x1e66a0[_0x364f('0x2b')][_0x364f('0x37')]+'%'};return _0x44195f;}})});}_0x58ee08=_[_0x364f('0x38')]({},_0x58ee08,_0x1e66a0[_0x364f('0x3a')]);var _0x5dd7f6={'where':_0x58ee08['where']};return db[_0x364f('0x27')][_0x364f('0x1a')](_0x5dd7f6)[_0x364f('0x21')](function(_0x5e8c5e){_0x115fec[_0x364f('0x1a')]=_0x5e8c5e;if(_0x1e66a0[_0x364f('0x2b')][_0x364f('0x3b')]){_0x58ee08[_0x364f('0x3c')]=[{'all':!![]}];}return db[_0x364f('0x27')][_0x364f('0x3d')](_0x58ee08);})['then'](function(_0x2362c4){_0x115fec[_0x364f('0x3e')]=_0x2362c4;return _0x115fec;})[_0x364f('0x21')](respondWithFilteredResult(_0x5aaf07,_0x58ee08))[_0x364f('0x3f')](handleError(_0x5aaf07,null));};exports[_0x364f('0x40')]=function(_0x1cd480,_0x590935){var _0x260d0b={'raw':![],'where':{'id':_0x1cd480[_0x364f('0x41')]['id']}},_0x36e6b2={};_0x36e6b2['model']=_[_0x364f('0x2a')](db[_0x364f('0x27')][_0x364f('0x28')]);_0x36e6b2[_0x364f('0x2b')]=_[_0x364f('0x2a')](_0x1cd480[_0x364f('0x2b')]);_0x36e6b2[_0x364f('0x35')]=_[_0x364f('0x2c')](_0x36e6b2[_0x364f('0x29')],_0x36e6b2['query']);_0x260d0b[_0x364f('0x2d')]=_['intersection'](_0x36e6b2[_0x364f('0x29')],qs[_0x364f('0x2e')](_0x1cd480[_0x364f('0x2b')][_0x364f('0x2e')]));_0x260d0b[_0x364f('0x2d')]=_0x260d0b['attributes'][_0x364f('0x2f')]?_0x260d0b[_0x364f('0x2d')]:_0x36e6b2[_0x364f('0x29')];if(_0x1cd480[_0x364f('0x2b')][_0x364f('0x3b')]){_0x260d0b[_0x364f('0x3c')]=[{'all':!![]}];}_0x260d0b=_[_0x364f('0x38')]({},_0x260d0b,_0x1cd480[_0x364f('0x3a')]);return db['CrmWorkflowStep'][_0x364f('0x42')](_0x260d0b)[_0x364f('0x21')](handleEntityNotFound(_0x590935,null))['then'](respondWithResult(_0x590935,null))[_0x364f('0x3f')](handleError(_0x590935,null));};exports[_0x364f('0x43')]=function(_0x197063,_0x2dd82e){return db['CrmWorkflowStep']['create'](_0x197063[_0x364f('0x44')],{})[_0x364f('0x21')](respondWithResult(_0x2dd82e,0xc9))['catch'](handleError(_0x2dd82e,null));};exports[_0x364f('0x20')]=function(_0x1b182a,_0x57e751){if(_0x1b182a[_0x364f('0x44')]['id']){delete _0x1b182a[_0x364f('0x44')]['id'];}return db['CrmWorkflowStep'][_0x364f('0x42')]({'where':{'id':_0x1b182a[_0x364f('0x41')]['id']}})[_0x364f('0x21')](handleEntityNotFound(_0x57e751,null))[_0x364f('0x21')](saveUpdates(_0x1b182a[_0x364f('0x44')],null))[_0x364f('0x21')](respondWithResult(_0x57e751,null))['catch'](handleError(_0x57e751,null));};exports[_0x364f('0x22')]=function(_0x57833f,_0x4b97ce){return db[_0x364f('0x27')][_0x364f('0x42')]({'where':{'id':_0x57833f['params']['id']}})[_0x364f('0x21')](handleEntityNotFound(_0x4b97ce,null))[_0x364f('0x21')](removeEntity(_0x4b97ce,null))[_0x364f('0x3f')](handleError(_0x4b97ce,null));};exports[_0x364f('0x45')]=function(_0x4f13fc,_0x31aa21){return db[_0x364f('0x27')][_0x364f('0x45')]()[_0x364f('0x21')](respondWithResult(_0x31aa21,null))['catch'](handleError(_0x31aa21,null));};exports[_0x364f('0x46')]=function(_0xc43d40,_0x4de5c4,_0x48825c){return db['CrmWorkflowStep'][_0x364f('0x42')]({'where':{'id':_0xc43d40[_0x364f('0x41')]['id']}})[_0x364f('0x21')](handleEntityNotFound(_0x4de5c4,null))[_0x364f('0x21')](function(_0x551652){if(_0x551652){return _0x551652['addCrmWorkflowNextStep'](_0xc43d40['body'][_0x364f('0x47')],_[_0x364f('0x48')](_0xc43d40[_0x364f('0x44')],[_0x364f('0x47'),'id'])||{});}})[_0x364f('0x21')](respondWithResult(_0x4de5c4,null))[_0x364f('0x3f')](handleError(_0x4de5c4,null));};exports[_0x364f('0x49')]=function(_0x1ad7c1,_0x1216a6,_0x34374e){return db['CrmWorkflowStep'][_0x364f('0x42')]({'where':{'id':_0x1ad7c1['params']['id']}})[_0x364f('0x21')](handleEntityNotFound(_0x1216a6,null))[_0x364f('0x21')](function(_0x2bcbde){if(_0x2bcbde){return _0x2bcbde[_0x364f('0x49')](_0x1ad7c1[_0x364f('0x2b')]['ids']);}})[_0x364f('0x21')](respondWithStatusCode(_0x1216a6,null))[_0x364f('0x3f')](handleError(_0x1216a6,null));};exports[_0x364f('0x4a')]=function(_0x167180,_0x1cabf1,_0xb12e7a){var _0x58576b={};var _0x241d02={};var _0xe5033d;var _0x590631;return db[_0x364f('0x27')][_0x364f('0x4b')]({'where':{'id':_0x167180['params']['id']}})[_0x364f('0x21')](handleEntityNotFound(_0x1cabf1,null))['then'](function(_0x159756){if(_0x159756){_0xe5033d=_0x159756;_0x241d02[_0x364f('0x29')]=_[_0x364f('0x2a')](db[_0x364f('0x27')][_0x364f('0x28')]);_0x241d02[_0x364f('0x2b')]=_[_0x364f('0x2a')](_0x167180[_0x364f('0x2b')]);_0x241d02[_0x364f('0x35')]=_['intersection'](_0x241d02['model'],_0x241d02['query']);_0x58576b[_0x364f('0x2d')]=_[_0x364f('0x2c')](_0x241d02[_0x364f('0x29')],qs[_0x364f('0x2e')](_0x167180[_0x364f('0x2b')][_0x364f('0x2e')]));_0x58576b[_0x364f('0x2d')]=_0x58576b[_0x364f('0x2d')][_0x364f('0x2f')]?_0x58576b[_0x364f('0x2d')]:_0x241d02[_0x364f('0x29')];_0x58576b[_0x364f('0x32')]=qs['sort'](_0x167180[_0x364f('0x2b')][_0x364f('0x33')]);_0x58576b['where']=qs[_0x364f('0x35')](_[_0x364f('0x36')](_0x167180[_0x364f('0x2b')],_0x241d02[_0x364f('0x35')]));if(_0x167180[_0x364f('0x2b')][_0x364f('0x37')]){_0x58576b[_0x364f('0x34')]=_[_0x364f('0x38')](_0x58576b[_0x364f('0x34')],{'$or':_[_0x364f('0x4c')](_0x58576b[_0x364f('0x2d')],function(_0x1fde2d){var _0x29bba0={};_0x29bba0[_0x1fde2d]={'$like':'%'+_0x167180[_0x364f('0x2b')]['filter']+'%'};return _0x29bba0;})});}_0x58576b=_[_0x364f('0x38')]({},_0x58576b,_0x167180[_0x364f('0x3a')]);return _0xe5033d[_0x364f('0x4a')](_0x58576b);}})['then'](function(_0x84068d){if(_0x84068d){_0x590631=_0x84068d[_0x364f('0x2f')];if(!_0x167180[_0x364f('0x2b')]['hasOwnProperty'](_0x364f('0x31'))){_0x58576b['limit']=qs[_0x364f('0x1c')](_0x167180[_0x364f('0x2b')]['limit']);_0x58576b[_0x364f('0x1b')]=qs[_0x364f('0x1b')](_0x167180[_0x364f('0x2b')]['offset']);}return _0xe5033d[_0x364f('0x4a')](_0x58576b);}})[_0x364f('0x21')](function(_0xab0bb8){if(_0xab0bb8){return _0xab0bb8?{'count':_0x590631,'rows':_0xab0bb8}:null;}})[_0x364f('0x21')](respondWithResult(_0x1cabf1,null))[_0x364f('0x3f')](handleError(_0x1cabf1,null));}; \ No newline at end of file +var _0x0060=['../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','error','name','send','index','CrmWorkflowStep','rawAttributes','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','field','include','rows','catch','show','params','length','options','find','create','body','destroy','describe','addCrmWorkflowNextStep','ids','omit','removeCrmWorkflowNextStep','getCrmWorkflowNextStep','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x58f99f,_0x439da9){var _0x10fd2e=function(_0x5873e1){while(--_0x5873e1){_0x58f99f['push'](_0x58f99f['shift']());}};_0x10fd2e(++_0x439da9);}(_0x0060,0x8a));var _0x0006=function(_0x4fc583,_0x1c9563){_0x4fc583=_0x4fc583-0x0;var _0x3b884d=_0x0060[_0x4fc583];return _0x3b884d;};'use strict';var pdf=require(_0x0006('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0006('0x1'));var zipdir=require(_0x0006('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0006('0x3'));var moment=require(_0x0006('0x4'));var BPromise=require(_0x0006('0x5'));var Mustache=require(_0x0006('0x6'));var util=require(_0x0006('0x7'));var path=require('path');var sox=require(_0x0006('0x8'));var csv=require(_0x0006('0x9'));var ejs=require(_0x0006('0xa'));var fs=require('fs');var _=require(_0x0006('0xb'));var squel=require(_0x0006('0xc'));var crypto=require('crypto');var jsforce=require(_0x0006('0xd'));var deskjs=require(_0x0006('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0006('0xf'));var Papa=require(_0x0006('0x10'));var Redis=require(_0x0006('0x11'));var authService=require(_0x0006('0x12'));var qs=require(_0x0006('0x13'));var hardwareService=require(_0x0006('0x14'));var logger=require(_0x0006('0x15'))(_0x0006('0x16'));var utils=require(_0x0006('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28b9d6,_0x1493b8){_0x1493b8=_0x1493b8||0xcc;return function(_0x4d41ab){if(_0x4d41ab){return _0x28b9d6[_0x0006('0x18')](_0x1493b8);}return _0x28b9d6[_0x0006('0x19')](_0x1493b8)['end']();};}function respondWithResult(_0x2b9906,_0x15a84f){_0x15a84f=_0x15a84f||0xc8;return function(_0x4b2b71){if(_0x4b2b71){return _0x2b9906[_0x0006('0x19')](_0x15a84f)[_0x0006('0x1a')](_0x4b2b71);}};}function respondWithFilteredResult(_0x11273a,_0x141773){return function(_0xdcd1d5){if(_0xdcd1d5){var _0x224ea6=_0xdcd1d5[_0x0006('0x1b')],_0x594189=_0x141773[_0x0006('0x1c')],_0x2c45a0=_0x141773['offset']+_0x141773[_0x0006('0x1d')],_0x5372af;if(_0x2c45a0>=_0x224ea6){_0x2c45a0=_0x224ea6;_0x5372af=0xc8;}else{_0x5372af=0xce;}_0x11273a[_0x0006('0x19')](_0x5372af);return _0x11273a[_0x0006('0x1e')](_0x0006('0x1f'),_0x594189+'-'+_0x2c45a0+'/'+_0x224ea6)[_0x0006('0x1a')](_0xdcd1d5);}return null;};}function patchUpdates(_0x458b61){return function(_0x46257d){try{jsonpatch[_0x0006('0x20')](_0x46257d,_0x458b61,!![]);}catch(_0x34556b){return BPromise[_0x0006('0x21')](_0x34556b);}return _0x46257d[_0x0006('0x22')]();};}function saveUpdates(_0x75a34b,_0x65887d){return function(_0x155014){if(_0x155014){return _0x155014[_0x0006('0x23')](_0x75a34b)[_0x0006('0x24')](function(_0x22b0ad){return _0x22b0ad;});}return null;};}function removeEntity(_0x24a49f,_0x558b23){return function(_0x599598){if(_0x599598){return _0x599598['destroy']()[_0x0006('0x24')](function(){_0x24a49f[_0x0006('0x19')](0xcc)[_0x0006('0x25')]();});}};}function handleEntityNotFound(_0x20aad0,_0x3daeff){return function(_0x286c96){if(!_0x286c96){_0x20aad0[_0x0006('0x18')](0x194);}return _0x286c96;};}function handleError(_0x51b139,_0x354894){_0x354894=_0x354894||0x1f4;return function(_0x2d023d){logger[_0x0006('0x26')](_0x2d023d['stack']);if(_0x2d023d['name']){delete _0x2d023d[_0x0006('0x27')];}_0x51b139[_0x0006('0x19')](_0x354894)[_0x0006('0x28')](_0x2d023d);};}exports[_0x0006('0x29')]=function(_0x3bcc51,_0x414a09){var _0x5282f5={},_0x42d1c1={},_0x52fd4a={'count':0x0,'rows':[]};var _0x29bf2a=db[_0x0006('0x2a')][_0x0006('0x2b')];_0x42d1c1[_0x0006('0x2c')]=_[_0x0006('0x2d')](_0x29bf2a);_0x42d1c1[_0x0006('0x2e')]=_[_0x0006('0x2d')](_0x3bcc51[_0x0006('0x2e')]);_0x42d1c1['filters']=_[_0x0006('0x2f')](_0x42d1c1[_0x0006('0x2c')],_0x42d1c1[_0x0006('0x2e')]);_0x5282f5['attributes']=_['intersection'](_0x42d1c1[_0x0006('0x2c')],qs[_0x0006('0x30')](_0x3bcc51[_0x0006('0x2e')]['fields']));_0x5282f5[_0x0006('0x31')]=_0x5282f5[_0x0006('0x31')]['length']?_0x5282f5[_0x0006('0x31')]:_0x42d1c1[_0x0006('0x2c')];if(!_0x3bcc51[_0x0006('0x2e')][_0x0006('0x32')](_0x0006('0x33'))){_0x5282f5['limit']=qs[_0x0006('0x1d')](_0x3bcc51[_0x0006('0x2e')][_0x0006('0x1d')]);_0x5282f5[_0x0006('0x1c')]=qs[_0x0006('0x1c')](_0x3bcc51[_0x0006('0x2e')][_0x0006('0x1c')]);}_0x5282f5[_0x0006('0x34')]=qs[_0x0006('0x35')](_0x3bcc51[_0x0006('0x2e')][_0x0006('0x35')]);_0x5282f5[_0x0006('0x36')]=qs[_0x0006('0x37')](_[_0x0006('0x38')](_0x3bcc51[_0x0006('0x2e')],_0x42d1c1[_0x0006('0x37')]));if(_0x3bcc51[_0x0006('0x2e')][_0x0006('0x39')]){_0x5282f5['where']=_[_0x0006('0x3a')](_0x5282f5[_0x0006('0x36')],{'$or':_[_0x0006('0x3b')](_0x29bf2a,function(_0x4b5c00){if(_0x4b5c00[_0x0006('0x3c')]['key']!=='VIRTUAL'){var _0x86083={};_0x86083[_0x4b5c00[_0x0006('0x3d')]]={'$like':'%'+_0x3bcc51[_0x0006('0x2e')][_0x0006('0x39')]+'%'};return _0x86083;}})});}_0x5282f5=_[_0x0006('0x3a')]({},_0x5282f5,_0x3bcc51['options']);var _0xda1cd1={'where':_0x5282f5[_0x0006('0x36')]};return db[_0x0006('0x2a')][_0x0006('0x1b')](_0xda1cd1)[_0x0006('0x24')](function(_0x273f30){_0x52fd4a[_0x0006('0x1b')]=_0x273f30;if(_0x3bcc51[_0x0006('0x2e')]['includeAll']){_0x5282f5[_0x0006('0x3e')]=[{'all':!![]}];}return db[_0x0006('0x2a')]['findAll'](_0x5282f5);})[_0x0006('0x24')](function(_0x3d85c3){_0x52fd4a[_0x0006('0x3f')]=_0x3d85c3;return _0x52fd4a;})['then'](respondWithFilteredResult(_0x414a09,_0x5282f5))[_0x0006('0x40')](handleError(_0x414a09,null));};exports[_0x0006('0x41')]=function(_0xe62836,_0x49a709){var _0xbf4b7d={'raw':![],'where':{'id':_0xe62836[_0x0006('0x42')]['id']}},_0x5eaa35={};_0x5eaa35[_0x0006('0x2c')]=_['keys'](db[_0x0006('0x2a')]['rawAttributes']);_0x5eaa35[_0x0006('0x2e')]=_[_0x0006('0x2d')](_0xe62836[_0x0006('0x2e')]);_0x5eaa35[_0x0006('0x37')]=_[_0x0006('0x2f')](_0x5eaa35[_0x0006('0x2c')],_0x5eaa35[_0x0006('0x2e')]);_0xbf4b7d['attributes']=_[_0x0006('0x2f')](_0x5eaa35[_0x0006('0x2c')],qs[_0x0006('0x30')](_0xe62836[_0x0006('0x2e')][_0x0006('0x30')]));_0xbf4b7d[_0x0006('0x31')]=_0xbf4b7d['attributes'][_0x0006('0x43')]?_0xbf4b7d['attributes']:_0x5eaa35[_0x0006('0x2c')];if(_0xe62836[_0x0006('0x2e')]['includeAll']){_0xbf4b7d[_0x0006('0x3e')]=[{'all':!![]}];}_0xbf4b7d=_['merge']({},_0xbf4b7d,_0xe62836[_0x0006('0x44')]);return db['CrmWorkflowStep'][_0x0006('0x45')](_0xbf4b7d)['then'](handleEntityNotFound(_0x49a709,null))[_0x0006('0x24')](respondWithResult(_0x49a709,null))[_0x0006('0x40')](handleError(_0x49a709,null));};exports[_0x0006('0x46')]=function(_0x4eef3e,_0x57e57c){return db[_0x0006('0x2a')][_0x0006('0x46')](_0x4eef3e[_0x0006('0x47')],{})[_0x0006('0x24')](respondWithResult(_0x57e57c,0xc9))['catch'](handleError(_0x57e57c,null));};exports[_0x0006('0x23')]=function(_0x3071b0,_0x36e4d2){if(_0x3071b0[_0x0006('0x47')]['id']){delete _0x3071b0['body']['id'];}return db[_0x0006('0x2a')][_0x0006('0x45')]({'where':{'id':_0x3071b0[_0x0006('0x42')]['id']}})[_0x0006('0x24')](handleEntityNotFound(_0x36e4d2,null))[_0x0006('0x24')](saveUpdates(_0x3071b0['body'],null))[_0x0006('0x24')](respondWithResult(_0x36e4d2,null))[_0x0006('0x40')](handleError(_0x36e4d2,null));};exports[_0x0006('0x48')]=function(_0x40cf1d,_0x49f596){return db['CrmWorkflowStep']['find']({'where':{'id':_0x40cf1d['params']['id']}})[_0x0006('0x24')](handleEntityNotFound(_0x49f596,null))[_0x0006('0x24')](removeEntity(_0x49f596,null))[_0x0006('0x40')](handleError(_0x49f596,null));};exports[_0x0006('0x49')]=function(_0x4fe453,_0x2fa0a2){return db[_0x0006('0x2a')][_0x0006('0x49')]()[_0x0006('0x24')](respondWithResult(_0x2fa0a2,null))[_0x0006('0x40')](handleError(_0x2fa0a2,null));};exports[_0x0006('0x4a')]=function(_0xfb3b80,_0x55531b,_0x402910){return db[_0x0006('0x2a')][_0x0006('0x45')]({'where':{'id':_0xfb3b80[_0x0006('0x42')]['id']}})['then'](handleEntityNotFound(_0x55531b,null))[_0x0006('0x24')](function(_0x3c8ce5){if(_0x3c8ce5){return _0x3c8ce5['addCrmWorkflowNextStep'](_0xfb3b80[_0x0006('0x47')][_0x0006('0x4b')],_[_0x0006('0x4c')](_0xfb3b80['body'],[_0x0006('0x4b'),'id'])||{});}})[_0x0006('0x24')](respondWithResult(_0x55531b,null))[_0x0006('0x40')](handleError(_0x55531b,null));};exports[_0x0006('0x4d')]=function(_0x489022,_0x42eb9b,_0x36f18f){return db[_0x0006('0x2a')][_0x0006('0x45')]({'where':{'id':_0x489022[_0x0006('0x42')]['id']}})[_0x0006('0x24')](handleEntityNotFound(_0x42eb9b,null))[_0x0006('0x24')](function(_0x166dcd){if(_0x166dcd){return _0x166dcd[_0x0006('0x4d')](_0x489022[_0x0006('0x2e')][_0x0006('0x4b')]);}})[_0x0006('0x24')](respondWithStatusCode(_0x42eb9b,null))[_0x0006('0x40')](handleError(_0x42eb9b,null));};exports[_0x0006('0x4e')]=function(_0x2abb84,_0x9f400e,_0x5b9d7c){var _0x27eed7={};var _0x4c924b={};var _0x588625;var _0x38baeb;return db[_0x0006('0x2a')]['findOne']({'where':{'id':_0x2abb84[_0x0006('0x42')]['id']}})['then'](handleEntityNotFound(_0x9f400e,null))[_0x0006('0x24')](function(_0x5b304c){if(_0x5b304c){_0x588625=_0x5b304c;_0x4c924b[_0x0006('0x2c')]=_[_0x0006('0x2d')](db['CrmWorkflowStep'][_0x0006('0x2b')]);_0x4c924b[_0x0006('0x2e')]=_['keys'](_0x2abb84[_0x0006('0x2e')]);_0x4c924b[_0x0006('0x37')]=_[_0x0006('0x2f')](_0x4c924b[_0x0006('0x2c')],_0x4c924b[_0x0006('0x2e')]);_0x27eed7[_0x0006('0x31')]=_[_0x0006('0x2f')](_0x4c924b[_0x0006('0x2c')],qs[_0x0006('0x30')](_0x2abb84[_0x0006('0x2e')][_0x0006('0x30')]));_0x27eed7[_0x0006('0x31')]=_0x27eed7[_0x0006('0x31')][_0x0006('0x43')]?_0x27eed7[_0x0006('0x31')]:_0x4c924b[_0x0006('0x2c')];_0x27eed7[_0x0006('0x34')]=qs['sort'](_0x2abb84[_0x0006('0x2e')][_0x0006('0x35')]);_0x27eed7['where']=qs[_0x0006('0x37')](_['pick'](_0x2abb84[_0x0006('0x2e')],_0x4c924b[_0x0006('0x37')]));if(_0x2abb84[_0x0006('0x2e')][_0x0006('0x39')]){_0x27eed7[_0x0006('0x36')]=_['merge'](_0x27eed7[_0x0006('0x36')],{'$or':_[_0x0006('0x3b')](_0x27eed7[_0x0006('0x31')],function(_0x5129be){var _0xbd5a42={};_0xbd5a42[_0x5129be]={'$like':'%'+_0x2abb84[_0x0006('0x2e')][_0x0006('0x39')]+'%'};return _0xbd5a42;})});}_0x27eed7=_['merge']({},_0x27eed7,_0x2abb84[_0x0006('0x44')]);return _0x588625[_0x0006('0x4e')](_0x27eed7);}})[_0x0006('0x24')](function(_0x2bf06c){if(_0x2bf06c){_0x38baeb=_0x2bf06c[_0x0006('0x43')];if(!_0x2abb84[_0x0006('0x2e')][_0x0006('0x32')](_0x0006('0x33'))){_0x27eed7['limit']=qs[_0x0006('0x1d')](_0x2abb84['query'][_0x0006('0x1d')]);_0x27eed7[_0x0006('0x1c')]=qs['offset'](_0x2abb84['query'][_0x0006('0x1c')]);}return _0x588625[_0x0006('0x4e')](_0x27eed7);}})['then'](function(_0x561690){if(_0x561690){return _0x561690?{'count':_0x38baeb,'rows':_0x561690}:null;}})[_0x0006('0x24')](respondWithResult(_0x9f400e,null))['catch'](handleError(_0x9f400e,null));}; \ No newline at end of file diff --git a/server/api/crmWorkflowstep/crmWorkflowstep.model.js b/server/api/crmWorkflowstep/crmWorkflowstep.model.js index 16daf25..76e0ec4 100644 --- a/server/api/crmWorkflowstep/crmWorkflowstep.model.js +++ b/server/api/crmWorkflowstep/crmWorkflowstep.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe585=['CrmWorkflowStep','crm_workflow_steps','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./crmWorkflowstep.attributes','exports','define'];(function(_0x5c4b53,_0x2eeada){var _0x5ef483=function(_0x1df7ea){while(--_0x1df7ea){_0x5c4b53['push'](_0x5c4b53['shift']());}};_0x5ef483(++_0x2eeada);}(_0xe585,0x113));var _0x5e58=function(_0x3a11c5,_0x54bcb1){_0x3a11c5=_0x3a11c5-0x0;var _0x40bee7=_0xe585[_0x3a11c5];return _0x40bee7;};'use strict';var _=require(_0x5e58('0x0'));var util=require(_0x5e58('0x1'));var logger=require(_0x5e58('0x2'))(_0x5e58('0x3'));var moment=require('moment');var BPromise=require(_0x5e58('0x4'));var rp=require(_0x5e58('0x5'));var fs=require('fs');var path=require(_0x5e58('0x6'));var rimraf=require(_0x5e58('0x7'));var config=require('../../config/environment');var attributes=require(_0x5e58('0x8'));module[_0x5e58('0x9')]=function(_0xa4c48a,_0x4a6a6b){return _0xa4c48a[_0x5e58('0xa')](_0x5e58('0xb'),attributes,{'tableName':_0x5e58('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x26ec=['./crmWorkflowstep.attributes','crm_workflow_steps','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1c1ae5,_0x2eaccf){var _0x15bf42=function(_0x122796){while(--_0x122796){_0x1c1ae5['push'](_0x1c1ae5['shift']());}};_0x15bf42(++_0x2eaccf);}(_0x26ec,0x158));var _0xc26e=function(_0x24584c,_0x1ed698){_0x24584c=_0x24584c-0x0;var _0x5886b2=_0x26ec[_0x24584c];return _0x5886b2;};'use strict';var _=require(_0xc26e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc26e('0x1'));var BPromise=require(_0xc26e('0x2'));var rp=require(_0xc26e('0x3'));var fs=require('fs');var path=require(_0xc26e('0x4'));var rimraf=require(_0xc26e('0x5'));var config=require(_0xc26e('0x6'));var attributes=require(_0xc26e('0x7'));module['exports']=function(_0x31d4fb,_0x118e25){return _0x31d4fb['define']('CrmWorkflowStep',attributes,{'tableName':_0xc26e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/crmWorkflowstep/crmWorkflowstep.rpc.js b/server/api/crmWorkflowstep/crmWorkflowstep.rpc.js index 009f7d7..bc1f625 100644 --- a/server/api/crmWorkflowstep/crmWorkflowstep.rpc.js +++ b/server/api/crmWorkflowstep/crmWorkflowstep.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9fd4=['then','debug','CrmWorkflowStep,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CrmWorkflowStep,\x20%s,\x20%s','message','info','result','catch','util','bluebird','randomstring','../../config/utils','../../config/environment','client','http','request'];(function(_0xcaae48,_0x38a00d){var _0x578cb9=function(_0x84da9d){while(--_0x84da9d){_0xcaae48['push'](_0xcaae48['shift']());}};_0x578cb9(++_0x38a00d);}(_0x9fd4,0xe8));var _0x49fd=function(_0x28562a,_0x200c8a){_0x28562a=_0x28562a-0x0;var _0x33d715=_0x9fd4[_0x28562a];return _0x33d715;};'use strict';var _=require('lodash');var util=require(_0x49fd('0x0'));var moment=require('moment');var BPromise=require(_0x49fd('0x1'));var rs=require(_0x49fd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x49fd('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x49fd('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x49fd('0x5')][_0x49fd('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x38cbd2,_0x2f08ba,_0x31fb5d){return new BPromise(function(_0x3fbb93,_0x37affb){return client[_0x49fd('0x7')](_0x38cbd2,_0x31fb5d)[_0x49fd('0x8')](function(_0x22117b){logger['info']('CrmWorkflowStep,\x20%s,\x20%s',_0x2f08ba,'request\x20sent');logger[_0x49fd('0x9')](_0x49fd('0xa'),_0x2f08ba,_0x49fd('0xb'),JSON[_0x49fd('0xc')](_0x22117b));if(_0x22117b[_0x49fd('0xd')]){if(_0x22117b['error'][_0x49fd('0xe')]===0x1f4){logger[_0x49fd('0xd')](_0x49fd('0xf'),_0x2f08ba,_0x22117b[_0x49fd('0xd')][_0x49fd('0x10')]);return _0x37affb(_0x22117b[_0x49fd('0xd')][_0x49fd('0x10')]);}logger[_0x49fd('0xd')](_0x49fd('0xf'),_0x2f08ba,_0x22117b['error'][_0x49fd('0x10')]);return _0x3fbb93(_0x22117b[_0x49fd('0xd')][_0x49fd('0x10')]);}else{logger[_0x49fd('0x11')](_0x49fd('0xf'),_0x2f08ba,'request\x20sent');_0x3fbb93(_0x22117b[_0x49fd('0x12')][_0x49fd('0x10')]);}})[_0x49fd('0x13')](function(_0x59aa98){logger[_0x49fd('0xd')](_0x49fd('0xf'),_0x2f08ba,_0x59aa98);_0x37affb(_0x59aa98);});});} \ No newline at end of file +var _0x3db9=['rpc','../../config/environment','jayson/promise','client','http','request','info','CrmWorkflowStep,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','util','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x268361,_0x4fe0c1){var _0x36806f=function(_0x4cbf05){while(--_0x4cbf05){_0x268361['push'](_0x268361['shift']());}};_0x36806f(++_0x4fe0c1);}(_0x3db9,0xcc));var _0x93db=function(_0xbf9846,_0x1ad050){_0xbf9846=_0xbf9846-0x0;var _0x27ea7c=_0x3db9[_0xbf9846];return _0x27ea7c;};'use strict';var _=require('lodash');var util=require(_0x93db('0x0'));var moment=require('moment');var BPromise=require(_0x93db('0x1'));var rs=require(_0x93db('0x2'));var fs=require('fs');var Redis=require(_0x93db('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x93db('0x4'))(_0x93db('0x5'));var config=require(_0x93db('0x6'));var jayson=require(_0x93db('0x7'));var client=jayson[_0x93db('0x8')][_0x93db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x337413,_0x1dcf6c,_0x8cc5da){return new BPromise(function(_0x83bfa9,_0x362349){return client[_0x93db('0xa')](_0x337413,_0x8cc5da)['then'](function(_0x311ca3){logger[_0x93db('0xb')](_0x93db('0xc'),_0x1dcf6c,_0x93db('0xd'));logger[_0x93db('0xe')]('CrmWorkflowStep,\x20%s,\x20%s,\x20%s',_0x1dcf6c,_0x93db('0xd'),JSON['stringify'](_0x311ca3));if(_0x311ca3[_0x93db('0xf')]){if(_0x311ca3[_0x93db('0xf')][_0x93db('0x10')]===0x1f4){logger[_0x93db('0xf')](_0x93db('0xc'),_0x1dcf6c,_0x311ca3[_0x93db('0xf')]['message']);return _0x362349(_0x311ca3[_0x93db('0xf')][_0x93db('0x11')]);}logger[_0x93db('0xf')](_0x93db('0xc'),_0x1dcf6c,_0x311ca3[_0x93db('0xf')][_0x93db('0x11')]);return _0x83bfa9(_0x311ca3[_0x93db('0xf')]['message']);}else{logger[_0x93db('0xb')]('CrmWorkflowStep,\x20%s,\x20%s',_0x1dcf6c,_0x93db('0xd'));_0x83bfa9(_0x311ca3[_0x93db('0x12')]['message']);}})['catch'](function(_0x88d6f8){logger[_0x93db('0xf')](_0x93db('0xc'),_0x1dcf6c,_0x88d6f8);_0x362349(_0x88d6f8);});});} \ No newline at end of file diff --git a/server/api/crmWorkflowstep/index.js b/server/api/crmWorkflowstep/index.js index 6a96b16..3b46465 100644 --- a/server/api/crmWorkflowstep/index.js +++ b/server/api/crmWorkflowstep/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['removeCrmWorkflowNextStep','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/steps','create','post','addCrmWorkflowNextStep','update','delete','destroy'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x2ef3,0xba));var _0x32ef=function(_0xa846cd,_0x2a8d4d){_0xa846cd=_0xa846cd-0x0;var _0x14611b=_0x2ef3[_0xa846cd];return _0x14611b;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var controller=require('./crmWorkflowstep.controller');router[_0x32ef('0x8')]('/',auth[_0x32ef('0x9')](),controller['index']);router['get'](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xb')]);router[_0x32ef('0x8')](_0x32ef('0xc'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xd')]);router[_0x32ef('0x8')](_0x32ef('0xe'),auth[_0x32ef('0x9')](),controller['getCrmWorkflowNextStep']);router['post']('/',auth[_0x32ef('0x9')](),controller[_0x32ef('0xf')]);router[_0x32ef('0x10')](_0x32ef('0xe'),auth['isAuthenticated'](),controller[_0x32ef('0x11')]);router['put'](_0x32ef('0xc'),auth['isAuthenticated'](),controller[_0x32ef('0x12')]);router[_0x32ef('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x32ef('0x14')]);router['delete'](_0x32ef('0xe'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x15')]);module[_0x32ef('0x16')]=router; \ No newline at end of file +var _0x5f66=['express','Router','../../components/auth/service','../../components/interaction/service','./crmWorkflowstep.controller','isAuthenticated','index','describe','get','/:id','show','getCrmWorkflowNextStep','post','addCrmWorkflowNextStep','update','delete','destroy','/:id/steps','removeCrmWorkflowNextStep','exports','util','connect-timeout'];(function(_0x45cc01,_0x2e635a){var _0x349d47=function(_0x78edc){while(--_0x78edc){_0x45cc01['push'](_0x45cc01['shift']());}};_0x349d47(++_0x2e635a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var auth=require(_0x65f6('0x4'));var interaction=require(_0x65f6('0x5'));var config=require('../../config/environment');var controller=require(_0x65f6('0x6'));router['get']('/',auth[_0x65f6('0x7')](),controller[_0x65f6('0x8')]);router['get']('/describe',auth[_0x65f6('0x7')](),controller[_0x65f6('0x9')]);router[_0x65f6('0xa')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller[_0x65f6('0xc')]);router['get']('/:id/steps',auth[_0x65f6('0x7')](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')]('/',auth[_0x65f6('0x7')](),controller['create']);router[_0x65f6('0xe')]('/:id/steps',auth['isAuthenticated'](),controller[_0x65f6('0xf')]);router['put'](_0x65f6('0xb'),auth['isAuthenticated'](),controller[_0x65f6('0x10')]);router[_0x65f6('0x11')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x12')]);router[_0x65f6('0x11')](_0x65f6('0x13'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x14')]);module[_0x65f6('0x15')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index e388569..0a222cf 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 _0x72fe=['exports','STRING','name','sequelize'];(function(_0x28acd7,_0x3abb0e){var _0x22c7d3=function(_0x574acd){while(--_0x574acd){_0x28acd7['push'](_0x28acd7['shift']());}};_0x22c7d3(++_0x3abb0e);}(_0x72fe,0x1d3));var _0xe72f=function(_0x4092a8,_0x4a56db){_0x4092a8=_0x4092a8-0x0;var _0x5892c1=_0x72fe[_0x4092a8];return _0x5892c1;};'use strict';var Sequelize=require(_0xe72f('0x0'));module[_0xe72f('0x1')]={'name':{'type':Sequelize[_0xe72f('0x2')],'allowNull':![],'unique':_0xe72f('0x3')},'description':{'type':Sequelize[_0xe72f('0x2')]}}; \ No newline at end of file +var _0x1e7e=['sequelize','exports','STRING','name'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x1e7e,0x70));var _0xe1e7=function(_0x3cb86b,_0x3c75f6){_0x3cb86b=_0x3cb86b-0x0;var _0x3c10a0=_0x1e7e[_0x3cb86b];return _0x3c10a0;};'use strict';var Sequelize=require(_0xe1e7('0x0'));module[_0xe1e7('0x1')]={'name':{'type':Sequelize[_0xe1e7('0x2')],'allowNull':![],'unique':_0xe1e7('0x3')},'description':{'type':Sequelize[_0xe1e7('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index ec94a8b..a1519d2 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 _0x56a6=['html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','CustomDashboards','UserProfileResource','error','stack','name','send','index','Dashboard','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','catch','rawAttributes','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','updatedAt','UserProfileSection','destroy','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrMetric','total','attrVoiceQueues','attrFontSize','pie-chart','attrSerie1','attrSerie3','attrReport','reportType','attrRefresh','addItem','DashboardId','getItems','findOne','DashboardItem','pick','hasOwnProperty'];(function(_0x2f7ef1,_0x5e7533){var _0x1a8716=function(_0x220639){while(--_0x220639){_0x2f7ef1['push'](_0x2f7ef1['shift']());}};_0x1a8716(++_0x5e7533);}(_0x56a6,0x171));var _0x656a=function(_0x169535,_0x45251a){_0x169535=_0x169535-0x0;var _0xa198e1=_0x56a6[_0x169535];return _0xa198e1;};'use strict';var pdf=require(_0x656a('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x656a('0x1'));var jsonpatch=require(_0x656a('0x2'));var rp=require(_0x656a('0x3'));var moment=require(_0x656a('0x4'));var BPromise=require(_0x656a('0x5'));var Mustache=require(_0x656a('0x6'));var util=require(_0x656a('0x7'));var path=require(_0x656a('0x8'));var sox=require(_0x656a('0x9'));var csv=require(_0x656a('0xa'));var ejs=require(_0x656a('0xb'));var fs=require('fs');var _=require(_0x656a('0xc'));var squel=require(_0x656a('0xd'));var crypto=require(_0x656a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x656a('0xf'));var toCsv=require(_0x656a('0xa'));var querystring=require(_0x656a('0x10'));var Papa=require('papaparse');var Redis=require(_0x656a('0x11'));var authService=require(_0x656a('0x12'));var qs=require(_0x656a('0x13'));var hardwareService=require(_0x656a('0x14'));var logger=require('../../config/logger')(_0x656a('0x15'));var utils=require(_0x656a('0x16'));var config=require(_0x656a('0x17'));var db=require(_0x656a('0x18'))['db'];config['redis']=_[_0x656a('0x19')](config[_0x656a('0x1a')],{'host':_0x656a('0x1b'),'port':0x18eb});var socket=require(_0x656a('0x1c'))(new Redis(config[_0x656a('0x1a')]));require(_0x656a('0x1d'))[_0x656a('0x1e')](socket);function respondWithStatusCode(_0x56d374,_0x2f5069){_0x2f5069=_0x2f5069||0xcc;return function(_0xc84f98){if(_0xc84f98){return _0x56d374[_0x656a('0x1f')](_0x2f5069);}return _0x56d374[_0x656a('0x20')](_0x2f5069)[_0x656a('0x21')]();};}function respondWithResult(_0x2330f7,_0x5e5c31){_0x5e5c31=_0x5e5c31||0xc8;return function(_0x52f87c){if(_0x52f87c){return _0x2330f7[_0x656a('0x20')](_0x5e5c31)[_0x656a('0x22')](_0x52f87c);}};}function respondWithFilteredResult(_0x22fb29,_0x2f5a13){return function(_0x203002){if(_0x203002){var _0xb7260e=_0x203002[_0x656a('0x23')],_0x5aab8b=_0x2f5a13[_0x656a('0x24')],_0x57844a=_0x2f5a13[_0x656a('0x24')]+_0x2f5a13[_0x656a('0x25')],_0x23adb8;if(_0x57844a>=_0xb7260e){_0x57844a=_0xb7260e;_0x23adb8=0xc8;}else{_0x23adb8=0xce;}_0x22fb29['status'](_0x23adb8);return _0x22fb29[_0x656a('0x26')](_0x656a('0x27'),_0x5aab8b+'-'+_0x57844a+'/'+_0xb7260e)[_0x656a('0x22')](_0x203002);}return null;};}function patchUpdates(_0x406eae){return function(_0x19c345){try{jsonpatch[_0x656a('0x28')](_0x19c345,_0x406eae,!![]);}catch(_0x1e6aca){return BPromise[_0x656a('0x29')](_0x1e6aca);}return _0x19c345[_0x656a('0x2a')]();};}function saveUpdates(_0x453a03,_0x30780f){return function(_0x47fca6){if(_0x47fca6){return _0x47fca6[_0x656a('0x2b')](_0x453a03)[_0x656a('0x2c')](function(_0x58131d){return _0x58131d;});}return null;};}function removeEntity(_0x1968d6,_0x125102){return function(_0x4153d4){if(_0x4153d4){return _0x4153d4['destroy']()[_0x656a('0x2c')](function(){var _0x88aff3=_0x4153d4[_0x656a('0x2d')]({'plain':!![]});var _0x392a22=_0x656a('0x2e');return db[_0x656a('0x2f')]['destroy']({'where':{'type':_0x392a22,'resourceId':_0x88aff3['id']}})['then'](function(){return _0x4153d4;});})[_0x656a('0x2c')](function(){_0x1968d6[_0x656a('0x20')](0xcc)[_0x656a('0x21')]();});}};}function handleEntityNotFound(_0x52d71a,_0x8b4f6e){return function(_0xcf804){if(!_0xcf804){_0x52d71a[_0x656a('0x1f')](0x194);}return _0xcf804;};}function handleError(_0x2a7285,_0x319254){_0x319254=_0x319254||0x1f4;return function(_0x58dbdb){logger[_0x656a('0x30')](_0x58dbdb[_0x656a('0x31')]);if(_0x58dbdb['name']){delete _0x58dbdb[_0x656a('0x32')];}_0x2a7285[_0x656a('0x20')](_0x319254)[_0x656a('0x33')](_0x58dbdb);};}exports[_0x656a('0x34')]=function(_0x462525,_0x5cd993){var _0xfc6a01={},_0x358e1a={},_0x536702={'count':0x0,'rows':[]};var _0x24275b=db[_0x656a('0x35')]['rawAttributes'];_0x358e1a[_0x656a('0x36')]=_['keys'](_0x24275b);_0x358e1a[_0x656a('0x37')]=_[_0x656a('0x38')](_0x462525[_0x656a('0x37')]);_0x358e1a[_0x656a('0x39')]=_['intersection'](_0x358e1a[_0x656a('0x36')],_0x358e1a['query']);_0xfc6a01[_0x656a('0x3a')]=_[_0x656a('0x3b')](_0x358e1a['model'],qs[_0x656a('0x3c')](_0x462525[_0x656a('0x37')][_0x656a('0x3c')]));_0xfc6a01[_0x656a('0x3a')]=_0xfc6a01[_0x656a('0x3a')][_0x656a('0x3d')]?_0xfc6a01['attributes']:_0x358e1a[_0x656a('0x36')];if(!_0x462525[_0x656a('0x37')]['hasOwnProperty'](_0x656a('0x3e'))){_0xfc6a01[_0x656a('0x25')]=qs['limit'](_0x462525[_0x656a('0x37')]['limit']);_0xfc6a01['offset']=qs[_0x656a('0x24')](_0x462525['query'][_0x656a('0x24')]);}_0xfc6a01[_0x656a('0x3f')]=qs[_0x656a('0x40')](_0x462525['query']['sort']);_0xfc6a01[_0x656a('0x41')]=qs[_0x656a('0x39')](_['pick'](_0x462525[_0x656a('0x37')],_0x358e1a[_0x656a('0x39')]));if(_0x462525[_0x656a('0x37')][_0x656a('0x42')]){_0xfc6a01[_0x656a('0x41')]=_['merge'](_0xfc6a01[_0x656a('0x41')],{'$or':_[_0x656a('0x43')](_0x24275b,function(_0x985889){if(_0x985889[_0x656a('0x44')][_0x656a('0x45')]!==_0x656a('0x46')){var _0x543712={};_0x543712[_0x985889[_0x656a('0x47')]]={'$like':'%'+_0x462525['query']['filter']+'%'};return _0x543712;}})});}_0xfc6a01=_['merge']({},_0xfc6a01,_0x462525[_0x656a('0x48')]);var _0x402739={'where':_0xfc6a01['where']};return db[_0x656a('0x35')][_0x656a('0x23')](_0x402739)[_0x656a('0x2c')](function(_0x4a6842){_0x536702[_0x656a('0x23')]=_0x4a6842;if(_0x462525[_0x656a('0x37')][_0x656a('0x49')]){_0xfc6a01[_0x656a('0x4a')]=[{'all':!![]}];}return db[_0x656a('0x35')][_0x656a('0x4b')](_0xfc6a01);})[_0x656a('0x2c')](function(_0x506ad2){_0x536702['rows']=_0x506ad2;return _0x536702;})[_0x656a('0x2c')](respondWithFilteredResult(_0x5cd993,_0xfc6a01))[_0x656a('0x4c')](handleError(_0x5cd993,null));};exports['show']=function(_0x4edc18,_0x529a49){var _0x3fb83e={'raw':![],'where':{'id':_0x4edc18['params']['id']}},_0x547303={};_0x547303[_0x656a('0x36')]=_[_0x656a('0x38')](db['Dashboard'][_0x656a('0x4d')]);_0x547303['query']=_[_0x656a('0x38')](_0x4edc18[_0x656a('0x37')]);_0x547303[_0x656a('0x39')]=_[_0x656a('0x3b')](_0x547303[_0x656a('0x36')],_0x547303[_0x656a('0x37')]);_0x3fb83e[_0x656a('0x3a')]=_[_0x656a('0x3b')](_0x547303[_0x656a('0x36')],qs[_0x656a('0x3c')](_0x4edc18['query'][_0x656a('0x3c')]));_0x3fb83e[_0x656a('0x3a')]=_0x3fb83e[_0x656a('0x3a')]['length']?_0x3fb83e[_0x656a('0x3a')]:_0x547303[_0x656a('0x36')];if(_0x4edc18[_0x656a('0x37')]['includeAll']){_0x3fb83e[_0x656a('0x4a')]=[{'all':!![]}];}_0x3fb83e=_[_0x656a('0x4e')]({},_0x3fb83e,_0x4edc18[_0x656a('0x48')]);return db['Dashboard']['find'](_0x3fb83e)[_0x656a('0x2c')](handleEntityNotFound(_0x529a49,null))[_0x656a('0x2c')](respondWithResult(_0x529a49,null))[_0x656a('0x4c')](handleError(_0x529a49,null));};exports[_0x656a('0x4f')]=function(_0x52b700,_0x4fd968){return db[_0x656a('0x35')][_0x656a('0x4f')](_0x52b700[_0x656a('0x50')],{})[_0x656a('0x2c')](function(_0x9c4e5f){var _0x2f7176=_0x52b700[_0x656a('0x51')][_0x656a('0x2d')]({'plain':!![]});if(!_0x2f7176)throw new Error(_0x656a('0x52'));if(_0x2f7176[_0x656a('0x53')]==='user'){var _0x6dd7c5=_0x9c4e5f['get']({'plain':!![]});var _0x32c16b=_0x656a('0x2e');return db['UserProfileSection'][_0x656a('0x54')]({'where':{'name':_0x32c16b,'userProfileId':_0x2f7176[_0x656a('0x55')]},'raw':!![]})[_0x656a('0x2c')](function(_0x24116e){if(_0x24116e&&_0x24116e[_0x656a('0x56')]===0x0){return db[_0x656a('0x2f')][_0x656a('0x4f')]({'name':_0x6dd7c5['name'],'resourceId':_0x6dd7c5['id'],'type':_0x24116e[_0x656a('0x32')],'sectionId':_0x24116e['id']},{})[_0x656a('0x2c')](function(){return _0x9c4e5f;});}else{return _0x9c4e5f;}})['catch'](function(_0x1e3b0d){logger[_0x656a('0x30')](_0x656a('0x57'),_0x1e3b0d);throw _0x1e3b0d;});}return _0x9c4e5f;})[_0x656a('0x2c')](respondWithResult(_0x4fd968,0xc9))[_0x656a('0x4c')](handleError(_0x4fd968,null));};exports[_0x656a('0x58')]=function(_0x4df02e,_0x3e9a22){var _0x2a7e59={'raw':![],'where':{'id':_0x4df02e[_0x656a('0x59')]['id']}},_0x7d63f8={};_0x7d63f8[_0x656a('0x36')]=_[_0x656a('0x38')](db[_0x656a('0x35')][_0x656a('0x4d')]);_0x2a7e59[_0x656a('0x3a')]=_[_0x656a('0x3b')](_0x7d63f8[_0x656a('0x36')],qs[_0x656a('0x3c')](_0x4df02e[_0x656a('0x37')][_0x656a('0x3c')]));_0x2a7e59[_0x656a('0x3a')]=_0x2a7e59[_0x656a('0x3a')]['length']?_0x2a7e59['attributes']:_0x7d63f8[_0x656a('0x36')];if(_0x4df02e['query'][_0x656a('0x49')]){_0x2a7e59[_0x656a('0x4a')]=[{'all':!![]}];}_0x2a7e59=_[_0x656a('0x4e')]({},_0x2a7e59,_0x4df02e[_0x656a('0x48')]);return db[_0x656a('0x35')][_0x656a('0x54')](_0x2a7e59)[_0x656a('0x2c')](handleEntityNotFound(_0x3e9a22,null))[_0x656a('0x2c')](function(_0x398ec8){if(_0x398ec8){var _0xbf11f3=_0x398ec8[_0x656a('0x2d')]({'plain':!![]});_0xbf11f3=qs[_0x656a('0x5a')](_0xbf11f3,['id','createdAt',_0x656a('0x5b')]);_0x4df02e[_0x656a('0x50')]=_[_0x656a('0x5a')](_0x4df02e[_0x656a('0x50')],['id','createdAt',_0x656a('0x5b')]);return db[_0x656a('0x35')][_0x656a('0x4f')](_['merge'](_0xbf11f3,_0x4df02e[_0x656a('0x50')]),{'include':_0x4df02e['query'][_0x656a('0x49')]?[{'all':!![]}]:undefined})['then'](function(_0x33d715){var _0x167239=_0x4df02e[_0x656a('0x51')][_0x656a('0x2d')]({'plain':!![]});if(!_0x167239)throw new Error(_0x656a('0x52'));if(_0x167239[_0x656a('0x53')]===_0x656a('0x51')){var _0x4512d7=_0x33d715[_0x656a('0x2d')]({'plain':!![]});var _0x35169e=_0x656a('0x2e');return db[_0x656a('0x5c')][_0x656a('0x54')]({'where':{'name':_0x35169e,'userProfileId':_0x167239['userProfileId']},'raw':!![]})[_0x656a('0x2c')](function(_0x535b1c){if(_0x535b1c&&_0x535b1c['autoAssociation']===0x0){return db[_0x656a('0x2f')][_0x656a('0x4f')]({'name':_0x4512d7[_0x656a('0x32')],'resourceId':_0x4512d7['id'],'type':_0x535b1c[_0x656a('0x32')],'sectionId':_0x535b1c['id']},{})[_0x656a('0x2c')](function(){return _0x33d715;});}else{return _0x33d715;}})[_0x656a('0x4c')](function(_0x3415c8){logger[_0x656a('0x30')](_0x656a('0x57'),_0x3415c8);throw _0x3415c8;});}return _0x33d715;});}})[_0x656a('0x2c')](respondWithResult(_0x3e9a22,0xc9))[_0x656a('0x4c')](handleError(_0x3e9a22,null));};exports[_0x656a('0x2b')]=function(_0x1333a4,_0x143786){if(_0x1333a4[_0x656a('0x50')]['id']){delete _0x1333a4['body']['id'];}return db[_0x656a('0x35')][_0x656a('0x54')]({'where':{'id':_0x1333a4[_0x656a('0x59')]['id']}})['then'](handleEntityNotFound(_0x143786,null))[_0x656a('0x2c')](saveUpdates(_0x1333a4['body'],null))[_0x656a('0x2c')](respondWithResult(_0x143786,null))[_0x656a('0x4c')](handleError(_0x143786,null));};exports[_0x656a('0x5d')]=function(_0x5beb7c,_0x45e04b){return db[_0x656a('0x35')]['find']({'where':{'id':_0x5beb7c['params']['id']}})['then'](handleEntityNotFound(_0x45e04b,null))[_0x656a('0x2c')](removeEntity(_0x45e04b,null))[_0x656a('0x4c')](handleError(_0x45e04b,null));};function widgetAttributes(_0x21d498){try{switch(_0x21d498[_0x656a('0x44')]){case _0x656a('0x5e'):return[{'name':_0x656a('0x5f'),'value':_0x21d498[_0x656a('0x5f')]||(_0x21d498[_0x656a('0x60')]&&_0x21d498[_0x656a('0x60')][0x0]?_0x21d498[_0x656a('0x60')][0x0]['value']:undefined)||_0x656a('0x61')}];case _0x656a('0x62'):return[{'name':_0x656a('0x63'),'value':_0x21d498[_0x656a('0x63')]||(_0x21d498['attrs']&&_0x21d498[_0x656a('0x60')][0x0]?_0x21d498[_0x656a('0x60')][0x0][_0x656a('0x64')]:undefined)||''}];case _0x656a('0x65'):return[{'name':_0x656a('0x66'),'value':_0x21d498[_0x656a('0x66')]||(_0x21d498[_0x656a('0x60')]&&_0x21d498[_0x656a('0x60')][0x0]?_0x21d498[_0x656a('0x60')][0x0][_0x656a('0x64')]:undefined)||_0x656a('0x67')},{'name':'attrTimezone','value':_0x21d498[_0x656a('0x68')]||(_0x21d498[_0x656a('0x60')]&&_0x21d498[_0x656a('0x60')][0x1]?_0x21d498[_0x656a('0x60')][0x1][_0x656a('0x64')]:undefined)||_0x656a('0x69')},{'name':'attrFontSize','value':_0x21d498['attrFontSize']||(_0x21d498[_0x656a('0x60')]&&_0x21d498[_0x656a('0x60')][0x2]?_0x21d498[_0x656a('0x60')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x656a('0x6a'),'value':_0x21d498[_0x656a('0x6a')]||(_0x21d498[_0x656a('0x60')]&&_0x21d498['attrs'][0x0]?_0x21d498['attrs'][0x0][_0x656a('0x64')]:undefined)||_0x656a('0x6b')},{'name':_0x656a('0x6c'),'value':_0x21d498['attrVoiceQueues']||(_0x21d498[_0x656a('0x60')]&&_0x21d498['attrs'][0x1]?_0x21d498[_0x656a('0x60')][0x1][_0x656a('0x64')]:undefined)||[]},{'name':_0x656a('0x6d'),'value':_0x21d498[_0x656a('0x6d')]||(_0x21d498[_0x656a('0x60')]&&_0x21d498['attrs'][0x2]?_0x21d498[_0x656a('0x60')][0x2][_0x656a('0x64')]:undefined)||0x14}];case'multibar-chart':case _0x656a('0x6e'):return[{'name':_0x656a('0x6f'),'value':_0x21d498[_0x656a('0x6f')]||(_0x21d498[_0x656a('0x60')]&&_0x21d498[_0x656a('0x60')][0x0]?_0x21d498[_0x656a('0x60')][0x0][_0x656a('0x64')]:undefined)||_0x656a('0x6b')},{'name':'attrSerie2','value':_0x21d498['attrSerie2']||(_0x21d498[_0x656a('0x60')]&&_0x21d498[_0x656a('0x60')][0x1]?_0x21d498[_0x656a('0x60')][0x1][_0x656a('0x64')]:undefined)||null},{'name':_0x656a('0x70'),'value':_0x21d498[_0x656a('0x70')]||(_0x21d498[_0x656a('0x60')]&&_0x21d498[_0x656a('0x60')][0x2]?_0x21d498[_0x656a('0x60')][0x2]['value']:undefined)||null},{'name':_0x656a('0x6c'),'value':_0x21d498[_0x656a('0x6c')]||(_0x21d498[_0x656a('0x60')]&&_0x21d498['attrs'][0x3]?_0x21d498[_0x656a('0x60')][0x3][_0x656a('0x64')]:undefined)||[]}];case'web-report':return[{'name':_0x656a('0x71'),'type':_0x21d498[_0x656a('0x72')]||(_0x21d498['attrs']&&_0x21d498[_0x656a('0x60')][0x0]?_0x21d498[_0x656a('0x60')][0x0]['type']:undefined)||null,'value':_0x21d498[_0x656a('0x71')]||(_0x21d498[_0x656a('0x60')]&&_0x21d498[_0x656a('0x60')][0x0]?_0x21d498[_0x656a('0x60')][0x0][_0x656a('0x64')]:undefined)||null},{'name':_0x656a('0x73'),'value':_0x21d498[_0x656a('0x73')]||(_0x21d498[_0x656a('0x60')]&&_0x21d498[_0x656a('0x60')][0x1]?_0x21d498[_0x656a('0x60')][0x1][_0x656a('0x64')]:undefined)||0x0}];default:return[];}}catch(_0x5cbd32){logger[_0x656a('0x30')]('widgetAttributes:\x20%s',JSON['stringify'](_0x5cbd32));return[];}}exports[_0x656a('0x74')]=function(_0x1f1075,_0x3ed2f2,_0x434718){if(_0x1f1075['body']['id']){delete _0x1f1075['body']['id'];}return db[_0x656a('0x35')][_0x656a('0x54')]({'where':{'id':_0x1f1075[_0x656a('0x59')]['id']}})[_0x656a('0x2c')](handleEntityNotFound(_0x3ed2f2,null))[_0x656a('0x2c')](function(_0x34e0a1){if(_0x34e0a1){_0x1f1075[_0x656a('0x50')][_0x656a('0x75')]=_0x34e0a1['id'];_0x1f1075[_0x656a('0x50')][_0x656a('0x60')]=widgetAttributes(_0x1f1075[_0x656a('0x50')]);return db['DashboardItem'][_0x656a('0x4f')](_0x1f1075['body']);}})[_0x656a('0x2c')](respondWithResult(_0x3ed2f2,null))[_0x656a('0x4c')](handleError(_0x3ed2f2,null));};exports[_0x656a('0x76')]=function(_0x2ab450,_0xc459d8,_0x111336){var _0x5ad057={};var _0x5a3037={};var _0x1ce645;var _0x4a39ee;return db[_0x656a('0x35')][_0x656a('0x77')]({'where':{'id':_0x2ab450[_0x656a('0x59')]['id']}})[_0x656a('0x2c')](handleEntityNotFound(_0xc459d8,null))[_0x656a('0x2c')](function(_0x504151){if(_0x504151){_0x1ce645=_0x504151;_0x5a3037[_0x656a('0x36')]=_[_0x656a('0x38')](db[_0x656a('0x78')]['rawAttributes']);_0x5a3037[_0x656a('0x37')]=_[_0x656a('0x38')](_0x2ab450[_0x656a('0x37')]);_0x5a3037['filters']=_['intersection'](_0x5a3037[_0x656a('0x36')],_0x5a3037[_0x656a('0x37')]);_0x5ad057[_0x656a('0x3a')]=_[_0x656a('0x3b')](_0x5a3037[_0x656a('0x36')],qs[_0x656a('0x3c')](_0x2ab450[_0x656a('0x37')][_0x656a('0x3c')]));_0x5ad057['attributes']=_0x5ad057[_0x656a('0x3a')][_0x656a('0x3d')]?_0x5ad057['attributes']:_0x5a3037[_0x656a('0x36')];_0x5ad057[_0x656a('0x3f')]=qs[_0x656a('0x40')](_0x2ab450['query'][_0x656a('0x40')]);_0x5ad057[_0x656a('0x41')]=qs[_0x656a('0x39')](_[_0x656a('0x79')](_0x2ab450['query'],_0x5a3037[_0x656a('0x39')]));if(_0x2ab450[_0x656a('0x37')]['filter']){_0x5ad057[_0x656a('0x41')]=_[_0x656a('0x4e')](_0x5ad057['where'],{'$or':_['map'](_0x5ad057[_0x656a('0x3a')],function(_0x3e95e3){var _0x3f2a7f={};_0x3f2a7f[_0x3e95e3]={'$like':'%'+_0x2ab450['query']['filter']+'%'};return _0x3f2a7f;})});}_0x5ad057=_['merge']({},_0x5ad057,_0x2ab450[_0x656a('0x48')]);return _0x1ce645[_0x656a('0x76')](_0x5ad057);}})[_0x656a('0x2c')](function(_0x3a4602){if(_0x3a4602){_0x4a39ee=_0x3a4602[_0x656a('0x3d')];if(!_0x2ab450[_0x656a('0x37')][_0x656a('0x7a')](_0x656a('0x3e'))){_0x5ad057['limit']=qs[_0x656a('0x25')](_0x2ab450[_0x656a('0x37')][_0x656a('0x25')]);_0x5ad057[_0x656a('0x24')]=qs['offset'](_0x2ab450[_0x656a('0x37')][_0x656a('0x24')]);}return _0x1ce645[_0x656a('0x76')](_0x5ad057);}})['then'](function(_0x43d7ec){if(_0x43d7ec){return _0x43d7ec?{'count':_0x4a39ee,'rows':_0x43d7ec}:null;}})[_0x656a('0x2c')](respondWithResult(_0xc459d8,null))[_0x656a('0x4c')](handleError(_0xc459d8,null));}; \ No newline at end of file +var _0x390c=['attrHourFormat','value','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','getItems','findOne','DashboardItem','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','get','CustomDashboards','destroy','error','name','send','index','Dashboard','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','include','rows','catch','show','params','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','update','iframe','attrUrl','attrs','https://','custom','attrPath'];(function(_0x1d4d2d,_0x254ecc){var _0x39ef5e=function(_0x184707){while(--_0x184707){_0x1d4d2d['push'](_0x1d4d2d['shift']());}};_0x39ef5e(++_0x254ecc);}(_0x390c,0x11a));var _0xc390=function(_0x1ae4c8,_0xc6e8d7){_0x1ae4c8=_0x1ae4c8-0x0;var _0x19cbab=_0x390c[_0x1ae4c8];return _0x19cbab;};'use strict';var pdf=require(_0xc390('0x0'));var emlformat=require(_0xc390('0x1'));var rimraf=require(_0xc390('0x2'));var zipdir=require(_0xc390('0x3'));var jsonpatch=require(_0xc390('0x4'));var rp=require(_0xc390('0x5'));var moment=require(_0xc390('0x6'));var BPromise=require(_0xc390('0x7'));var Mustache=require(_0xc390('0x8'));var util=require(_0xc390('0x9'));var path=require(_0xc390('0xa'));var sox=require(_0xc390('0xb'));var csv=require(_0xc390('0xc'));var ejs=require(_0xc390('0xd'));var fs=require('fs');var _=require(_0xc390('0xe'));var squel=require(_0xc390('0xf'));var crypto=require(_0xc390('0x10'));var jsforce=require(_0xc390('0x11'));var deskjs=require(_0xc390('0x12'));var toCsv=require(_0xc390('0xc'));var querystring=require(_0xc390('0x13'));var Papa=require(_0xc390('0x14'));var Redis=require(_0xc390('0x15'));var authService=require('../../components/auth/service');var qs=require(_0xc390('0x16'));var hardwareService=require(_0xc390('0x17'));var logger=require(_0xc390('0x18'))('api');var utils=require(_0xc390('0x19'));var config=require(_0xc390('0x1a'));var db=require(_0xc390('0x1b'))['db'];config[_0xc390('0x1c')]=_[_0xc390('0x1d')](config[_0xc390('0x1c')],{'host':_0xc390('0x1e'),'port':0x18eb});var socket=require(_0xc390('0x1f'))(new Redis(config[_0xc390('0x1c')]));require(_0xc390('0x20'))[_0xc390('0x21')](socket);function respondWithStatusCode(_0x2d607e,_0x67dc89){_0x67dc89=_0x67dc89||0xcc;return function(_0x483bf6){if(_0x483bf6){return _0x2d607e[_0xc390('0x22')](_0x67dc89);}return _0x2d607e[_0xc390('0x23')](_0x67dc89)[_0xc390('0x24')]();};}function respondWithResult(_0x507903,_0x2de9e2){_0x2de9e2=_0x2de9e2||0xc8;return function(_0x4c6077){if(_0x4c6077){return _0x507903['status'](_0x2de9e2)[_0xc390('0x25')](_0x4c6077);}};}function respondWithFilteredResult(_0xebb0d8,_0x540712){return function(_0x3cf17e){if(_0x3cf17e){var _0x910b4e=_0x3cf17e[_0xc390('0x26')],_0xbbe8fe=_0x540712[_0xc390('0x27')],_0x2a8557=_0x540712['offset']+_0x540712[_0xc390('0x28')],_0x5397e2;if(_0x2a8557>=_0x910b4e){_0x2a8557=_0x910b4e;_0x5397e2=0xc8;}else{_0x5397e2=0xce;}_0xebb0d8['status'](_0x5397e2);return _0xebb0d8[_0xc390('0x29')](_0xc390('0x2a'),_0xbbe8fe+'-'+_0x2a8557+'/'+_0x910b4e)[_0xc390('0x25')](_0x3cf17e);}return null;};}function patchUpdates(_0x4528db){return function(_0x14a07b){try{jsonpatch['apply'](_0x14a07b,_0x4528db,!![]);}catch(_0x5a0e61){return BPromise[_0xc390('0x2b')](_0x5a0e61);}return _0x14a07b[_0xc390('0x2c')]();};}function saveUpdates(_0x74c78f,_0x34bbab){return function(_0x1087f0){if(_0x1087f0){return _0x1087f0['update'](_0x74c78f)[_0xc390('0x2d')](function(_0x2fc350){return _0x2fc350;});}return null;};}function removeEntity(_0x359317,_0x4e40e1){return function(_0x966ef6){if(_0x966ef6){return _0x966ef6['destroy']()[_0xc390('0x2d')](function(){var _0x3f8201=_0x966ef6[_0xc390('0x2e')]({'plain':!![]});var _0x13dc6f=_0xc390('0x2f');return db['UserProfileResource'][_0xc390('0x30')]({'where':{'type':_0x13dc6f,'resourceId':_0x3f8201['id']}})[_0xc390('0x2d')](function(){return _0x966ef6;});})[_0xc390('0x2d')](function(){_0x359317[_0xc390('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x130193,_0x1341a1){return function(_0x27007a){if(!_0x27007a){_0x130193['sendStatus'](0x194);}return _0x27007a;};}function handleError(_0x28aeff,_0x3ec413){_0x3ec413=_0x3ec413||0x1f4;return function(_0x145303){logger[_0xc390('0x31')](_0x145303['stack']);if(_0x145303[_0xc390('0x32')]){delete _0x145303[_0xc390('0x32')];}_0x28aeff[_0xc390('0x23')](_0x3ec413)[_0xc390('0x33')](_0x145303);};}exports[_0xc390('0x34')]=function(_0x2ea278,_0x22504f){var _0x19c5b5={},_0x5f183d={},_0xa85bb7={'count':0x0,'rows':[]};var _0x5e19b6=db[_0xc390('0x35')]['rawAttributes'];_0x5f183d[_0xc390('0x36')]=_[_0xc390('0x37')](_0x5e19b6);_0x5f183d[_0xc390('0x38')]=_[_0xc390('0x37')](_0x2ea278['query']);_0x5f183d[_0xc390('0x39')]=_[_0xc390('0x3a')](_0x5f183d[_0xc390('0x36')],_0x5f183d[_0xc390('0x38')]);_0x19c5b5[_0xc390('0x3b')]=_['intersection'](_0x5f183d[_0xc390('0x36')],qs[_0xc390('0x3c')](_0x2ea278[_0xc390('0x38')][_0xc390('0x3c')]));_0x19c5b5[_0xc390('0x3b')]=_0x19c5b5[_0xc390('0x3b')][_0xc390('0x3d')]?_0x19c5b5['attributes']:_0x5f183d[_0xc390('0x36')];if(!_0x2ea278['query']['hasOwnProperty'](_0xc390('0x3e'))){_0x19c5b5[_0xc390('0x28')]=qs[_0xc390('0x28')](_0x2ea278[_0xc390('0x38')][_0xc390('0x28')]);_0x19c5b5[_0xc390('0x27')]=qs[_0xc390('0x27')](_0x2ea278[_0xc390('0x38')][_0xc390('0x27')]);}_0x19c5b5['order']=qs[_0xc390('0x3f')](_0x2ea278[_0xc390('0x38')][_0xc390('0x3f')]);_0x19c5b5[_0xc390('0x40')]=qs['filters'](_[_0xc390('0x41')](_0x2ea278['query'],_0x5f183d['filters']));if(_0x2ea278[_0xc390('0x38')]['filter']){_0x19c5b5['where']=_[_0xc390('0x42')](_0x19c5b5[_0xc390('0x40')],{'$or':_[_0xc390('0x43')](_0x5e19b6,function(_0x1f40b4){if(_0x1f40b4[_0xc390('0x44')][_0xc390('0x45')]!==_0xc390('0x46')){var _0x303fc9={};_0x303fc9[_0x1f40b4[_0xc390('0x47')]]={'$like':'%'+_0x2ea278[_0xc390('0x38')][_0xc390('0x48')]+'%'};return _0x303fc9;}})});}_0x19c5b5=_[_0xc390('0x42')]({},_0x19c5b5,_0x2ea278[_0xc390('0x49')]);var _0x1457a8={'where':_0x19c5b5[_0xc390('0x40')]};return db[_0xc390('0x35')]['count'](_0x1457a8)[_0xc390('0x2d')](function(_0x35af6f){_0xa85bb7['count']=_0x35af6f;if(_0x2ea278[_0xc390('0x38')]['includeAll']){_0x19c5b5[_0xc390('0x4a')]=[{'all':!![]}];}return db[_0xc390('0x35')]['findAll'](_0x19c5b5);})[_0xc390('0x2d')](function(_0x1b6406){_0xa85bb7[_0xc390('0x4b')]=_0x1b6406;return _0xa85bb7;})[_0xc390('0x2d')](respondWithFilteredResult(_0x22504f,_0x19c5b5))[_0xc390('0x4c')](handleError(_0x22504f,null));};exports[_0xc390('0x4d')]=function(_0xe5c3c3,_0x3fd237){var _0xf6e476={'raw':![],'where':{'id':_0xe5c3c3[_0xc390('0x4e')]['id']}},_0x38a2f6={};_0x38a2f6[_0xc390('0x36')]=_['keys'](db['Dashboard'][_0xc390('0x4f')]);_0x38a2f6[_0xc390('0x38')]=_[_0xc390('0x37')](_0xe5c3c3['query']);_0x38a2f6['filters']=_[_0xc390('0x3a')](_0x38a2f6[_0xc390('0x36')],_0x38a2f6[_0xc390('0x38')]);_0xf6e476[_0xc390('0x3b')]=_[_0xc390('0x3a')](_0x38a2f6[_0xc390('0x36')],qs[_0xc390('0x3c')](_0xe5c3c3['query'][_0xc390('0x3c')]));_0xf6e476[_0xc390('0x3b')]=_0xf6e476[_0xc390('0x3b')][_0xc390('0x3d')]?_0xf6e476[_0xc390('0x3b')]:_0x38a2f6[_0xc390('0x36')];if(_0xe5c3c3[_0xc390('0x38')][_0xc390('0x50')]){_0xf6e476[_0xc390('0x4a')]=[{'all':!![]}];}_0xf6e476=_[_0xc390('0x42')]({},_0xf6e476,_0xe5c3c3[_0xc390('0x49')]);return db[_0xc390('0x35')][_0xc390('0x51')](_0xf6e476)[_0xc390('0x2d')](handleEntityNotFound(_0x3fd237,null))['then'](respondWithResult(_0x3fd237,null))[_0xc390('0x4c')](handleError(_0x3fd237,null));};exports[_0xc390('0x52')]=function(_0x313ec1,_0xab9282){return db[_0xc390('0x35')][_0xc390('0x52')](_0x313ec1[_0xc390('0x53')],{})['then'](function(_0x13dddd){var _0x3793f3=_0x313ec1[_0xc390('0x54')][_0xc390('0x2e')]({'plain':!![]});if(!_0x3793f3)throw new Error(_0xc390('0x55'));if(_0x3793f3[_0xc390('0x56')]===_0xc390('0x54')){var _0x1fe2bb=_0x13dddd[_0xc390('0x2e')]({'plain':!![]});var _0xabb24='CustomDashboards';return db[_0xc390('0x57')][_0xc390('0x51')]({'where':{'name':_0xabb24,'userProfileId':_0x3793f3[_0xc390('0x58')]},'raw':!![]})[_0xc390('0x2d')](function(_0x59fe54){if(_0x59fe54&&_0x59fe54['autoAssociation']===0x0){return db[_0xc390('0x59')][_0xc390('0x52')]({'name':_0x1fe2bb[_0xc390('0x32')],'resourceId':_0x1fe2bb['id'],'type':_0x59fe54[_0xc390('0x32')],'sectionId':_0x59fe54['id']},{})['then'](function(){return _0x13dddd;});}else{return _0x13dddd;}})['catch'](function(_0x39b9fc){logger[_0xc390('0x31')](_0xc390('0x5a'),_0x39b9fc);throw _0x39b9fc;});}return _0x13dddd;})[_0xc390('0x2d')](respondWithResult(_0xab9282,0xc9))['catch'](handleError(_0xab9282,null));};exports[_0xc390('0x5b')]=function(_0x5ab714,_0x205875){var _0x462c47={'raw':![],'where':{'id':_0x5ab714[_0xc390('0x4e')]['id']}},_0x263f9d={};_0x263f9d[_0xc390('0x36')]=_[_0xc390('0x37')](db[_0xc390('0x35')]['rawAttributes']);_0x462c47['attributes']=_['intersection'](_0x263f9d[_0xc390('0x36')],qs['fields'](_0x5ab714[_0xc390('0x38')][_0xc390('0x3c')]));_0x462c47['attributes']=_0x462c47[_0xc390('0x3b')][_0xc390('0x3d')]?_0x462c47[_0xc390('0x3b')]:_0x263f9d[_0xc390('0x36')];if(_0x5ab714[_0xc390('0x38')][_0xc390('0x50')]){_0x462c47['include']=[{'all':!![]}];}_0x462c47=_['merge']({},_0x462c47,_0x5ab714[_0xc390('0x49')]);return db[_0xc390('0x35')][_0xc390('0x51')](_0x462c47)['then'](handleEntityNotFound(_0x205875,null))[_0xc390('0x2d')](function(_0x11b10a){if(_0x11b10a){var _0x10eb8c=_0x11b10a[_0xc390('0x2e')]({'plain':!![]});_0x10eb8c=qs[_0xc390('0x5c')](_0x10eb8c,['id',_0xc390('0x5d'),_0xc390('0x5e')]);_0x5ab714[_0xc390('0x53')]=_['omit'](_0x5ab714['body'],['id',_0xc390('0x5d'),_0xc390('0x5e')]);return db['Dashboard'][_0xc390('0x52')](_[_0xc390('0x42')](_0x10eb8c,_0x5ab714[_0xc390('0x53')]),{'include':_0x5ab714[_0xc390('0x38')][_0xc390('0x50')]?[{'all':!![]}]:undefined})[_0xc390('0x2d')](function(_0x551e4e){var _0x4d084c=_0x5ab714[_0xc390('0x54')][_0xc390('0x2e')]({'plain':!![]});if(!_0x4d084c)throw new Error(_0xc390('0x55'));if(_0x4d084c[_0xc390('0x56')]===_0xc390('0x54')){var _0x362b35=_0x551e4e[_0xc390('0x2e')]({'plain':!![]});var _0x56342e=_0xc390('0x2f');return db[_0xc390('0x57')][_0xc390('0x51')]({'where':{'name':_0x56342e,'userProfileId':_0x4d084c[_0xc390('0x58')]},'raw':!![]})[_0xc390('0x2d')](function(_0x199a09){if(_0x199a09&&_0x199a09['autoAssociation']===0x0){return db[_0xc390('0x59')][_0xc390('0x52')]({'name':_0x362b35['name'],'resourceId':_0x362b35['id'],'type':_0x199a09[_0xc390('0x32')],'sectionId':_0x199a09['id']},{})['then'](function(){return _0x551e4e;});}else{return _0x551e4e;}})['catch'](function(_0x4dcbdf){logger[_0xc390('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4dcbdf);throw _0x4dcbdf;});}return _0x551e4e;});}})[_0xc390('0x2d')](respondWithResult(_0x205875,0xc9))[_0xc390('0x4c')](handleError(_0x205875,null));};exports[_0xc390('0x5f')]=function(_0x16c57e,_0x3ab4d){if(_0x16c57e[_0xc390('0x53')]['id']){delete _0x16c57e[_0xc390('0x53')]['id'];}return db['Dashboard'][_0xc390('0x51')]({'where':{'id':_0x16c57e[_0xc390('0x4e')]['id']}})[_0xc390('0x2d')](handleEntityNotFound(_0x3ab4d,null))[_0xc390('0x2d')](saveUpdates(_0x16c57e[_0xc390('0x53')],null))[_0xc390('0x2d')](respondWithResult(_0x3ab4d,null))[_0xc390('0x4c')](handleError(_0x3ab4d,null));};exports[_0xc390('0x30')]=function(_0x1ef23d,_0x384c0c){return db[_0xc390('0x35')][_0xc390('0x51')]({'where':{'id':_0x1ef23d[_0xc390('0x4e')]['id']}})[_0xc390('0x2d')](handleEntityNotFound(_0x384c0c,null))['then'](removeEntity(_0x384c0c,null))[_0xc390('0x4c')](handleError(_0x384c0c,null));};function widgetAttributes(_0x2f51f7){try{switch(_0x2f51f7['type']){case _0xc390('0x60'):return[{'name':_0xc390('0x61'),'value':_0x2f51f7['attrUrl']||(_0x2f51f7[_0xc390('0x62')]&&_0x2f51f7[_0xc390('0x62')][0x0]?_0x2f51f7[_0xc390('0x62')][0x0]['value']:undefined)||_0xc390('0x63')}];case _0xc390('0x64'):return[{'name':_0xc390('0x65'),'value':_0x2f51f7[_0xc390('0x65')]||(_0x2f51f7[_0xc390('0x62')]&&_0x2f51f7['attrs'][0x0]?_0x2f51f7[_0xc390('0x62')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0xc390('0x66'),'value':_0x2f51f7['attrHourFormat']||(_0x2f51f7[_0xc390('0x62')]&&_0x2f51f7[_0xc390('0x62')][0x0]?_0x2f51f7[_0xc390('0x62')][0x0][_0xc390('0x67')]:undefined)||_0xc390('0x68')},{'name':_0xc390('0x69'),'value':_0x2f51f7['attrTimezone']||(_0x2f51f7[_0xc390('0x62')]&&_0x2f51f7[_0xc390('0x62')][0x1]?_0x2f51f7[_0xc390('0x62')][0x1][_0xc390('0x67')]:undefined)||_0xc390('0x6a')},{'name':_0xc390('0x6b'),'value':_0x2f51f7[_0xc390('0x6b')]||(_0x2f51f7['attrs']&&_0x2f51f7[_0xc390('0x62')][0x2]?_0x2f51f7[_0xc390('0x62')][0x2][_0xc390('0x67')]:undefined)||0xc}];case _0xc390('0x6c'):return[{'name':_0xc390('0x6d'),'value':_0x2f51f7[_0xc390('0x6d')]||(_0x2f51f7[_0xc390('0x62')]&&_0x2f51f7[_0xc390('0x62')][0x0]?_0x2f51f7[_0xc390('0x62')][0x0][_0xc390('0x67')]:undefined)||_0xc390('0x6e')},{'name':_0xc390('0x6f'),'value':_0x2f51f7[_0xc390('0x6f')]||(_0x2f51f7[_0xc390('0x62')]&&_0x2f51f7[_0xc390('0x62')][0x1]?_0x2f51f7[_0xc390('0x62')][0x1][_0xc390('0x67')]:undefined)||[]},{'name':_0xc390('0x6b'),'value':_0x2f51f7['attrFontSize']||(_0x2f51f7[_0xc390('0x62')]&&_0x2f51f7[_0xc390('0x62')][0x2]?_0x2f51f7['attrs'][0x2][_0xc390('0x67')]:undefined)||0x14}];case _0xc390('0x70'):case _0xc390('0x71'):return[{'name':_0xc390('0x72'),'value':_0x2f51f7[_0xc390('0x72')]||(_0x2f51f7[_0xc390('0x62')]&&_0x2f51f7[_0xc390('0x62')][0x0]?_0x2f51f7[_0xc390('0x62')][0x0][_0xc390('0x67')]:undefined)||_0xc390('0x6e')},{'name':'attrSerie2','value':_0x2f51f7['attrSerie2']||(_0x2f51f7[_0xc390('0x62')]&&_0x2f51f7[_0xc390('0x62')][0x1]?_0x2f51f7[_0xc390('0x62')][0x1]['value']:undefined)||null},{'name':_0xc390('0x73'),'value':_0x2f51f7[_0xc390('0x73')]||(_0x2f51f7[_0xc390('0x62')]&&_0x2f51f7[_0xc390('0x62')][0x2]?_0x2f51f7[_0xc390('0x62')][0x2][_0xc390('0x67')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x2f51f7[_0xc390('0x6f')]||(_0x2f51f7['attrs']&&_0x2f51f7[_0xc390('0x62')][0x3]?_0x2f51f7['attrs'][0x3][_0xc390('0x67')]:undefined)||[]}];case _0xc390('0x74'):return[{'name':_0xc390('0x75'),'type':_0x2f51f7[_0xc390('0x76')]||(_0x2f51f7[_0xc390('0x62')]&&_0x2f51f7['attrs'][0x0]?_0x2f51f7[_0xc390('0x62')][0x0][_0xc390('0x44')]:undefined)||null,'value':_0x2f51f7[_0xc390('0x75')]||(_0x2f51f7['attrs']&&_0x2f51f7['attrs'][0x0]?_0x2f51f7['attrs'][0x0][_0xc390('0x67')]:undefined)||null},{'name':_0xc390('0x77'),'value':_0x2f51f7[_0xc390('0x77')]||(_0x2f51f7['attrs']&&_0x2f51f7[_0xc390('0x62')][0x1]?_0x2f51f7[_0xc390('0x62')][0x1][_0xc390('0x67')]:undefined)||0x0}];default:return[];}}catch(_0x3fbf0e){logger[_0xc390('0x31')](_0xc390('0x78'),JSON[_0xc390('0x79')](_0x3fbf0e));return[];}}exports[_0xc390('0x7a')]=function(_0x501297,_0xc8b815,_0x213fc4){if(_0x501297[_0xc390('0x53')]['id']){delete _0x501297['body']['id'];}return db[_0xc390('0x35')]['find']({'where':{'id':_0x501297[_0xc390('0x4e')]['id']}})['then'](handleEntityNotFound(_0xc8b815,null))[_0xc390('0x2d')](function(_0x21a691){if(_0x21a691){_0x501297[_0xc390('0x53')][_0xc390('0x7b')]=_0x21a691['id'];_0x501297[_0xc390('0x53')][_0xc390('0x62')]=widgetAttributes(_0x501297[_0xc390('0x53')]);return db['DashboardItem'][_0xc390('0x52')](_0x501297['body']);}})[_0xc390('0x2d')](respondWithResult(_0xc8b815,null))[_0xc390('0x4c')](handleError(_0xc8b815,null));};exports[_0xc390('0x7c')]=function(_0x81d9d3,_0x4b71a8,_0x14f35f){var _0x38c290={};var _0x50ee8c={};var _0x5b4037;var _0x438a43;return db[_0xc390('0x35')][_0xc390('0x7d')]({'where':{'id':_0x81d9d3[_0xc390('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4b71a8,null))[_0xc390('0x2d')](function(_0x34df90){if(_0x34df90){_0x5b4037=_0x34df90;_0x50ee8c[_0xc390('0x36')]=_[_0xc390('0x37')](db[_0xc390('0x7e')]['rawAttributes']);_0x50ee8c['query']=_[_0xc390('0x37')](_0x81d9d3[_0xc390('0x38')]);_0x50ee8c[_0xc390('0x39')]=_[_0xc390('0x3a')](_0x50ee8c[_0xc390('0x36')],_0x50ee8c[_0xc390('0x38')]);_0x38c290[_0xc390('0x3b')]=_[_0xc390('0x3a')](_0x50ee8c['model'],qs[_0xc390('0x3c')](_0x81d9d3[_0xc390('0x38')][_0xc390('0x3c')]));_0x38c290[_0xc390('0x3b')]=_0x38c290['attributes'][_0xc390('0x3d')]?_0x38c290[_0xc390('0x3b')]:_0x50ee8c[_0xc390('0x36')];_0x38c290['order']=qs[_0xc390('0x3f')](_0x81d9d3[_0xc390('0x38')][_0xc390('0x3f')]);_0x38c290['where']=qs[_0xc390('0x39')](_[_0xc390('0x41')](_0x81d9d3[_0xc390('0x38')],_0x50ee8c['filters']));if(_0x81d9d3[_0xc390('0x38')][_0xc390('0x48')]){_0x38c290[_0xc390('0x40')]=_[_0xc390('0x42')](_0x38c290[_0xc390('0x40')],{'$or':_[_0xc390('0x43')](_0x38c290[_0xc390('0x3b')],function(_0xc49b8d){var _0x322df3={};_0x322df3[_0xc49b8d]={'$like':'%'+_0x81d9d3['query'][_0xc390('0x48')]+'%'};return _0x322df3;})});}_0x38c290=_['merge']({},_0x38c290,_0x81d9d3[_0xc390('0x49')]);return _0x5b4037[_0xc390('0x7c')](_0x38c290);}})['then'](function(_0x26fc1c){if(_0x26fc1c){_0x438a43=_0x26fc1c[_0xc390('0x3d')];if(!_0x81d9d3[_0xc390('0x38')][_0xc390('0x7f')](_0xc390('0x3e'))){_0x38c290['limit']=qs[_0xc390('0x28')](_0x81d9d3[_0xc390('0x38')]['limit']);_0x38c290['offset']=qs['offset'](_0x81d9d3[_0xc390('0x38')][_0xc390('0x27')]);}return _0x5b4037['getItems'](_0x38c290);}})[_0xc390('0x2d')](function(_0x3b3c49){if(_0x3b3c49){return _0x3b3c49?{'count':_0x438a43,'rows':_0x3b3c49}:null;}})[_0xc390('0x2d')](respondWithResult(_0x4b71a8,null))[_0xc390('0x4c')](handleError(_0x4b71a8,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 4a5ecfa..16084a8 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 _0xa0c8=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x549928,_0x363b7a){var _0x941e27=function(_0x280fe6){while(--_0x280fe6){_0x549928['push'](_0x549928['shift']());}};_0x941e27(++_0x363b7a);}(_0xa0c8,0xf2));var _0x8a0c=function(_0x5805d7,_0x3d584a){_0x5805d7=_0x5805d7-0x0;var _0x170fe4=_0xa0c8[_0x5805d7];return _0x170fe4;};'use strict';var EventEmitter=require(_0x8a0c('0x0'));var Dashboard=require(_0x8a0c('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8a0c('0x2')](0x0);var events={'afterCreate':_0x8a0c('0x3'),'afterUpdate':_0x8a0c('0x4'),'afterDestroy':_0x8a0c('0x5')};function emitEvent(_0x17c5b5){return function(_0x4e8bd9,_0x4987f0,_0x501d67){DashboardEvents[_0x8a0c('0x6')](_0x17c5b5+':'+_0x4e8bd9['id'],_0x4e8bd9);DashboardEvents[_0x8a0c('0x6')](_0x17c5b5,_0x4e8bd9);_0x501d67(null);};}for(var e in events){if(events[_0x8a0c('0x7')](e)){var event=events[e];Dashboard[_0x8a0c('0x8')](e,emitEvent(event));}}module[_0x8a0c('0x9')]=DashboardEvents; \ No newline at end of file +var _0xbecd=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','Dashboard'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbecd,0x6a));var _0xdbec=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbecd[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xdbec('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xdbec('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xdbec('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdbec('0x3'),'afterDestroy':_0xdbec('0x4')};function emitEvent(_0x343f68){return function(_0x31d770,_0x4586e7,_0x47313b){DashboardEvents[_0xdbec('0x5')](_0x343f68+':'+_0x31d770['id'],_0x31d770);DashboardEvents[_0xdbec('0x5')](_0x343f68,_0x31d770);_0x47313b(null);};}for(var e in events){if(events[_0xdbec('0x6')](e)){var event=events[e];Dashboard[_0xdbec('0x7')](e,emitEvent(event));}}module[_0xdbec('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 08b675d..ad7dd15 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 _0xde5f=['bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','Dashboard','lodash','util','../../config/logger','api','moment'];(function(_0x34efa6,_0x343fe2){var _0x469490=function(_0xc1d725){while(--_0xc1d725){_0x34efa6['push'](_0x34efa6['shift']());}};_0x469490(++_0x343fe2);}(_0xde5f,0x97));var _0xfde5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde5f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfde5('0x0'));var util=require(_0xfde5('0x1'));var logger=require(_0xfde5('0x2'))(_0xfde5('0x3'));var moment=require(_0xfde5('0x4'));var BPromise=require(_0xfde5('0x5'));var rp=require(_0xfde5('0x6'));var fs=require('fs');var path=require(_0xfde5('0x7'));var rimraf=require(_0xfde5('0x8'));var config=require(_0xfde5('0x9'));var attributes=require(_0xfde5('0xa'));module[_0xfde5('0xb')]=function(_0x41a682,_0x433e7b){return _0x41a682['define'](_0xfde5('0xc'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd730=['path','rimraf','../../config/environment','./dashboard.attributes','Dashboard','util','api','bluebird'];(function(_0x2cc569,_0x4e9568){var _0x1bfc2e=function(_0x5b8fcb){while(--_0x5b8fcb){_0x2cc569['push'](_0x2cc569['shift']());}};_0x1bfc2e(++_0x4e9568);}(_0xd730,0xfd));var _0x0d73=function(_0xdde56f,_0x5dfd99){_0xdde56f=_0xdde56f-0x0;var _0x2569a4=_0xd730[_0xdde56f];return _0x2569a4;};'use strict';var _=require('lodash');var util=require(_0x0d73('0x0'));var logger=require('../../config/logger')(_0x0d73('0x1'));var moment=require('moment');var BPromise=require(_0x0d73('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0d73('0x3'));var rimraf=require(_0x0d73('0x4'));var config=require(_0x0d73('0x5'));var attributes=require(_0x0d73('0x6'));module['exports']=function(_0xa4eeac,_0x1bb454){return _0xa4eeac['define'](_0x0d73('0x7'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index ced5486..e7f0fbc 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 _0xd8ab=['./dashboard.socket','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x46884f,_0x2b5c5a){var _0x78c6c0=function(_0x43ba0a){while(--_0x43ba0a){_0x46884f['push'](_0x46884f['shift']());}};_0x78c6c0(++_0x2b5c5a);}(_0xd8ab,0x1a4));var _0xbd8a=function(_0xfa4a8f,_0x2aaf51){_0xfa4a8f=_0xfa4a8f-0x0;var _0x24e692=_0xd8ab[_0xfa4a8f];return _0x24e692;};'use strict';var _=require('lodash');var util=require(_0xbd8a('0x0'));var moment=require(_0xbd8a('0x1'));var BPromise=require(_0xbd8a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd8a('0x3'))['db'];var utils=require(_0xbd8a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbd8a('0x5'));var jayson=require(_0xbd8a('0x6'));var client=jayson['client'][_0xbd8a('0x7')]({'port':0x232a});config[_0xbd8a('0x8')]=_[_0xbd8a('0x9')](config[_0xbd8a('0x8')],{'host':_0xbd8a('0xa'),'port':0x18eb});var socket=require(_0xbd8a('0xb'))(new Redis(config[_0xbd8a('0x8')]));require(_0xbd8a('0xc'))['register'](socket);function respondWithRpcPromise(_0x592c4a,_0x6a2c6,_0xa3196){return new BPromise(function(_0x406a50,_0x11e7d0){return client[_0xbd8a('0xd')](_0x592c4a,_0xa3196)[_0xbd8a('0xe')](function(_0x4ed5be){logger[_0xbd8a('0xf')](_0xbd8a('0x10'),_0x6a2c6,_0xbd8a('0x11'));logger['debug'](_0xbd8a('0x12'),_0x6a2c6,_0xbd8a('0x11'),JSON[_0xbd8a('0x13')](_0x4ed5be));if(_0x4ed5be[_0xbd8a('0x14')]){if(_0x4ed5be['error'][_0xbd8a('0x15')]===0x1f4){logger[_0xbd8a('0x14')](_0xbd8a('0x10'),_0x6a2c6,_0x4ed5be[_0xbd8a('0x14')][_0xbd8a('0x16')]);return _0x11e7d0(_0x4ed5be[_0xbd8a('0x14')]['message']);}logger['error']('Dashboard,\x20%s,\x20%s',_0x6a2c6,_0x4ed5be[_0xbd8a('0x14')][_0xbd8a('0x16')]);return _0x406a50(_0x4ed5be['error']['message']);}else{logger[_0xbd8a('0xf')]('Dashboard,\x20%s,\x20%s',_0x6a2c6,_0xbd8a('0x11'));_0x406a50(_0x4ed5be['result'][_0xbd8a('0x16')]);}})[_0xbd8a('0x17')](function(_0x32cbf1){logger[_0xbd8a('0x14')](_0xbd8a('0x10'),_0x6a2c6,_0x32cbf1);_0x11e7d0(_0x32cbf1);});});} \ No newline at end of file +var _0xb6be=['redis','localhost','socket.io-emitter','./dashboard.socket','register','request','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2002b3,_0x11e91c){var _0x2756f0=function(_0x4bf0b3){while(--_0x4bf0b3){_0x2002b3['push'](_0x2002b3['shift']());}};_0x2756f0(++_0x11e91c);}(_0xb6be,0x187));var _0xeb6b=function(_0x1526e1,_0x5ed5a5){_0x1526e1=_0x1526e1-0x0;var _0x249a1e=_0xb6be[_0x1526e1];return _0x249a1e;};'use strict';var _=require(_0xeb6b('0x0'));var util=require('util');var moment=require(_0xeb6b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb6b('0x2'));var db=require(_0xeb6b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xeb6b('0x4'))(_0xeb6b('0x5'));var config=require(_0xeb6b('0x6'));var jayson=require(_0xeb6b('0x7'));var client=jayson['client'][_0xeb6b('0x8')]({'port':0x232a});config[_0xeb6b('0x9')]=_['defaults'](config[_0xeb6b('0x9')],{'host':_0xeb6b('0xa'),'port':0x18eb});var socket=require(_0xeb6b('0xb'))(new Redis(config[_0xeb6b('0x9')]));require(_0xeb6b('0xc'))[_0xeb6b('0xd')](socket);function respondWithRpcPromise(_0x47cd90,_0x311348,_0x37ad83){return new BPromise(function(_0x4c4a6a,_0xdfa675){return client[_0xeb6b('0xe')](_0x47cd90,_0x37ad83)['then'](function(_0x57228f){logger['info'](_0xeb6b('0xf'),_0x311348,_0xeb6b('0x10'));logger[_0xeb6b('0x11')](_0xeb6b('0x12'),_0x311348,_0xeb6b('0x10'),JSON[_0xeb6b('0x13')](_0x57228f));if(_0x57228f[_0xeb6b('0x14')]){if(_0x57228f[_0xeb6b('0x14')][_0xeb6b('0x15')]===0x1f4){logger['error'](_0xeb6b('0xf'),_0x311348,_0x57228f[_0xeb6b('0x14')][_0xeb6b('0x16')]);return _0xdfa675(_0x57228f[_0xeb6b('0x14')][_0xeb6b('0x16')]);}logger[_0xeb6b('0x14')](_0xeb6b('0xf'),_0x311348,_0x57228f[_0xeb6b('0x14')][_0xeb6b('0x16')]);return _0x4c4a6a(_0x57228f[_0xeb6b('0x14')][_0xeb6b('0x16')]);}else{logger[_0xeb6b('0x17')](_0xeb6b('0xf'),_0x311348,_0xeb6b('0x10'));_0x4c4a6a(_0x57228f['result'][_0xeb6b('0x16')]);}})[_0xeb6b('0x18')](function(_0x3c16fd){logger['error'](_0xeb6b('0xf'),_0x311348,_0x3c16fd);_0xdfa675(_0x3c16fd);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 0e78187..8f8265d 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 _0x1b1a=['remove','update','emit','removeListener','register','length','dashboard:','./dashboard.events'];(function(_0x1fada8,_0x1d47c7){var _0x374425=function(_0xf4448e){while(--_0xf4448e){_0x1fada8['push'](_0x1fada8['shift']());}};_0x374425(++_0x1d47c7);}(_0x1b1a,0x1b7));var _0xa1b1=function(_0x1ac120,_0x3e7e45){_0x1ac120=_0x1ac120-0x0;var _0x19b703=_0x1b1a[_0x1ac120];return _0x19b703;};'use strict';var DashboardEvents=require(_0xa1b1('0x0'));var events=['save',_0xa1b1('0x1'),_0xa1b1('0x2')];function createListener(_0x3afb47,_0x4d5557){return function(_0xdd7390){_0x4d5557[_0xa1b1('0x3')](_0x3afb47,_0xdd7390);};}function removeListener(_0xe22774,_0x371015){return function(){DashboardEvents[_0xa1b1('0x4')](_0xe22774,_0x371015);};}exports[_0xa1b1('0x5')]=function(_0x5e91a0){for(var _0x208764=0x0,_0x3221cd=events[_0xa1b1('0x6')];_0x208764<_0x3221cd;_0x208764++){var _0x318738=events[_0x208764];var _0x1e16a7=createListener(_0xa1b1('0x7')+_0x318738,_0x5e91a0);DashboardEvents['on'](_0x318738,_0x1e16a7);}}; \ No newline at end of file +var _0x6e56=['./dashboard.events','save','remove','removeListener','register','length','dashboard:'];(function(_0x33775f,_0x496186){var _0x59a654=function(_0x5c6861){while(--_0x5c6861){_0x33775f['push'](_0x33775f['shift']());}};_0x59a654(++_0x496186);}(_0x6e56,0x165));var _0x66e5=function(_0x2431d6,_0x25189a){_0x2431d6=_0x2431d6-0x0;var _0x4d0f9b=_0x6e56[_0x2431d6];return _0x4d0f9b;};'use strict';var DashboardEvents=require(_0x66e5('0x0'));var events=[_0x66e5('0x1'),_0x66e5('0x2'),'update'];function createListener(_0x2d854c,_0x51b4b7){return function(_0x212f3d){_0x51b4b7['emit'](_0x2d854c,_0x212f3d);};}function removeListener(_0x21f1a3,_0x1f289d){return function(){DashboardEvents[_0x66e5('0x3')](_0x21f1a3,_0x1f289d);};}exports[_0x66e5('0x4')]=function(_0x2b12f3){for(var _0x467773=0x0,_0x4217e0=events[_0x66e5('0x5')];_0x467773<_0x4217e0;_0x467773++){var _0x1557c1=events[_0x467773];var _0x1927c7=createListener(_0x66e5('0x6')+_0x1557c1,_0x2b12f3);DashboardEvents['on'](_0x1557c1,_0x1927c7);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 50852be..e22dacf 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 _0xaa17=['../../components/interaction/service','./dashboard.controller','get','isAuthenticated','index','/:id','show','getItems','post','create','/:id/clone','clone','/:id/items','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x37853f,_0x227a06){var _0xd6f024=function(_0x2d8982){while(--_0x2d8982){_0x37853f['push'](_0x37853f['shift']());}};_0xd6f024(++_0x227a06);}(_0xaa17,0x6e));var _0x7aa1=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xaa17[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7aa1('0x0'));var util=require('util');var path=require(_0x7aa1('0x1'));var timeout=require(_0x7aa1('0x2'));var express=require(_0x7aa1('0x3'));var router=express[_0x7aa1('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x7aa1('0x5'));var config=require('../../config/environment');var controller=require(_0x7aa1('0x6'));router[_0x7aa1('0x7')]('/',auth[_0x7aa1('0x8')](),controller[_0x7aa1('0x9')]);router[_0x7aa1('0x7')](_0x7aa1('0xa'),auth[_0x7aa1('0x8')](),controller[_0x7aa1('0xb')]);router[_0x7aa1('0x7')]('/:id/items',auth[_0x7aa1('0x8')](),controller[_0x7aa1('0xc')]);router[_0x7aa1('0xd')]('/',auth[_0x7aa1('0x8')](),controller[_0x7aa1('0xe')]);router['post'](_0x7aa1('0xf'),auth['isAuthenticated'](),controller[_0x7aa1('0x10')]);router['post'](_0x7aa1('0x11'),auth[_0x7aa1('0x8')](),controller['addItem']);router[_0x7aa1('0x12')]('/:id',auth[_0x7aa1('0x8')](),controller[_0x7aa1('0x13')]);router[_0x7aa1('0x14')](_0x7aa1('0xa'),auth[_0x7aa1('0x8')](),controller[_0x7aa1('0x15')]);module[_0x7aa1('0x16')]=router; \ No newline at end of file +var _0xf9da=['clone','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','/:id','isAuthenticated','/:id/items','post','create','/:id/clone'];(function(_0x54c4de,_0x5231c2){var _0x2b32f3=function(_0x12ee1b){while(--_0x12ee1b){_0x54c4de['push'](_0x54c4de['shift']());}};_0x2b32f3(++_0x5231c2);}(_0xf9da,0x89));var _0xaf9d=function(_0x9be86d,_0x2ba56a){_0x9be86d=_0x9be86d-0x0;var _0x239f44=_0xf9da[_0x9be86d];return _0x239f44;};'use strict';var multer=require(_0xaf9d('0x0'));var util=require(_0xaf9d('0x1'));var path=require(_0xaf9d('0x2'));var timeout=require(_0xaf9d('0x3'));var express=require(_0xaf9d('0x4'));var router=express[_0xaf9d('0x5')]();var auth=require(_0xaf9d('0x6'));var interaction=require(_0xaf9d('0x7'));var config=require(_0xaf9d('0x8'));var controller=require(_0xaf9d('0x9'));router[_0xaf9d('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xaf9d('0xa')](_0xaf9d('0xb'),auth[_0xaf9d('0xc')](),controller['show']);router[_0xaf9d('0xa')](_0xaf9d('0xd'),auth[_0xaf9d('0xc')](),controller['getItems']);router[_0xaf9d('0xe')]('/',auth[_0xaf9d('0xc')](),controller[_0xaf9d('0xf')]);router['post'](_0xaf9d('0x10'),auth['isAuthenticated'](),controller[_0xaf9d('0x11')]);router[_0xaf9d('0xe')](_0xaf9d('0xd'),auth['isAuthenticated'](),controller['addItem']);router[_0xaf9d('0x12')]('/:id',auth[_0xaf9d('0xc')](),controller[_0xaf9d('0x13')]);router[_0xaf9d('0x14')]('/:id',auth[_0xaf9d('0xc')](),controller['destroy']);module[_0xaf9d('0x15')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index c6b47a8..9f90119 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 _0x44bc=['long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#2196f3','squel','lodash','exports','STRING'];(function(_0x4e3f7b,_0xde3247){var _0x2165d2=function(_0x2c99fc){while(--_0x2c99fc){_0x4e3f7b['push'](_0x4e3f7b['shift']());}};_0x2165d2(++_0xde3247);}(_0x44bc,0x110));var _0xc44b=function(_0x292b43,_0x11dcef){_0x292b43=_0x292b43-0x0;var _0x17a083=_0x44bc[_0x292b43];return _0x17a083;};'use strict';var Sequelize=require('sequelize');var squel=require(_0xc44b('0x0'));var _=require(_0xc44b('0x1'));module[_0xc44b('0x2')]={'title':{'type':Sequelize[_0xc44b('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc44b('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xc44b('0x4')),'get':function(){try{return JSON[_0xc44b('0x5')](this[_0xc44b('0x6')](_0xc44b('0x7')));}catch(_0x4ddc79){return[];}},'set':function(_0x6982ba){try{this[_0xc44b('0x8')](_0xc44b('0x7'),JSON[_0xc44b('0x9')](_0x6982ba));}catch(_0x115ce1){this[_0xc44b('0x8')]('attrs',JSON[_0xc44b('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xc44b('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xc44b('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xc44b('0xa')]},'col':{'type':Sequelize[_0xc44b('0xa')]},'background':{'type':Sequelize[_0xc44b('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xc44b('0x3')],'allowNull':![],'defaultValue':_0xc44b('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xc44b('0x3')]}}; \ No newline at end of file +var _0x8a56=['exports','STRING','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','#2196f3','sequelize','lodash'];(function(_0x5837c9,_0x3b0ede){var _0x8d140a=function(_0x58b26d){while(--_0x58b26d){_0x5837c9['push'](_0x5837c9['shift']());}};_0x8d140a(++_0x3b0ede);}(_0x8a56,0xfb));var _0x68a5=function(_0x609988,_0x507944){_0x609988=_0x609988-0x0;var _0x159984=_0x8a56[_0x609988];return _0x159984;};'use strict';var Sequelize=require(_0x68a5('0x0'));var squel=require('squel');var _=require(_0x68a5('0x1'));module[_0x68a5('0x2')]={'title':{'type':Sequelize[_0x68a5('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x68a5('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON['parse'](this[_0x68a5('0x4')](_0x68a5('0x5')));}catch(_0x24bd6b){return[];}},'set':function(_0x26bd56){try{this['setDataValue'](_0x68a5('0x5'),JSON[_0x68a5('0x6')](_0x26bd56));}catch(_0x17eec6){this[_0x68a5('0x7')](_0x68a5('0x5'),JSON[_0x68a5('0x6')]([]));}}},'sizeX':{'type':Sequelize[_0x68a5('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x68a5('0x8')]},'col':{'type':Sequelize[_0x68a5('0x8')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x68a5('0x9'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x68a5('0x3')],'allowNull':![],'defaultValue':_0x68a5('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x68a5('0x3')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 5787bf8..0757571 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 _0x98f1=['redis','defaults','localhost','./dashboardItem.socket','register','status','json','count','limit','apply','save','update','then','destroy','end','sendStatus','name','show','params','keys','rawAttributes','intersection','model','query','attributes','fields','length','includeAll','include','merge','options','DashboardItem','catch','find','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','error','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x98f1,0xe4));var _0x198f=function(_0x5e8e36,_0x46cace){_0x5e8e36=_0x5e8e36-0x0;var _0x308c60=_0x98f1[_0x5e8e36];return _0x308c60;};'use strict';var pdf=require(_0x198f('0x0'));var emlformat=require(_0x198f('0x1'));var rimraf=require(_0x198f('0x2'));var zipdir=require(_0x198f('0x3'));var jsonpatch=require(_0x198f('0x4'));var rp=require('request-promise');var moment=require(_0x198f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x198f('0x6'));var path=require(_0x198f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x198f('0x8'));var fs=require('fs');var _=require(_0x198f('0x9'));var squel=require('squel');var crypto=require(_0x198f('0xa'));var jsforce=require(_0x198f('0xb'));var deskjs=require(_0x198f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x198f('0xd'));var Papa=require('papaparse');var Redis=require(_0x198f('0xe'));var authService=require(_0x198f('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x198f('0x10'));var logger=require(_0x198f('0x11'))(_0x198f('0x12'));var utils=require('../../config/utils');var config=require(_0x198f('0x13'));var db=require(_0x198f('0x14'))['db'];config[_0x198f('0x15')]=_[_0x198f('0x16')](config[_0x198f('0x15')],{'host':_0x198f('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x198f('0x15')]));require(_0x198f('0x18'))[_0x198f('0x19')](socket);function respondWithStatusCode(_0x5f5c64,_0x570eca){_0x570eca=_0x570eca||0xcc;return function(_0x420b3a){if(_0x420b3a){return _0x5f5c64['sendStatus'](_0x570eca);}return _0x5f5c64[_0x198f('0x1a')](_0x570eca)['end']();};}function respondWithResult(_0x3f030b,_0x828592){_0x828592=_0x828592||0xc8;return function(_0x1205b9){if(_0x1205b9){return _0x3f030b['status'](_0x828592)[_0x198f('0x1b')](_0x1205b9);}};}function respondWithFilteredResult(_0x4a6f81,_0x767ca6){return function(_0x5265d3){if(_0x5265d3){var _0x3d0bfb=_0x5265d3[_0x198f('0x1c')],_0x3b837d=_0x767ca6['offset'],_0x550a54=_0x767ca6['offset']+_0x767ca6[_0x198f('0x1d')],_0x2ea0ca;if(_0x550a54>=_0x3d0bfb){_0x550a54=_0x3d0bfb;_0x2ea0ca=0xc8;}else{_0x2ea0ca=0xce;}_0x4a6f81['status'](_0x2ea0ca);return _0x4a6f81['set']('Content-Range',_0x3b837d+'-'+_0x550a54+'/'+_0x3d0bfb)[_0x198f('0x1b')](_0x5265d3);}return null;};}function patchUpdates(_0x3d806f){return function(_0x4b92bd){try{jsonpatch[_0x198f('0x1e')](_0x4b92bd,_0x3d806f,!![]);}catch(_0x3bbfd3){return BPromise['reject'](_0x3bbfd3);}return _0x4b92bd[_0x198f('0x1f')]();};}function saveUpdates(_0x7ad29,_0x5c5619){return function(_0x11dadf){if(_0x11dadf){return _0x11dadf[_0x198f('0x20')](_0x7ad29)[_0x198f('0x21')](function(_0x304343){return _0x304343;});}return null;};}function removeEntity(_0x3b68e3,_0x7d32bb){return function(_0x4e0993){if(_0x4e0993){return _0x4e0993[_0x198f('0x22')]()['then'](function(){_0x3b68e3['status'](0xcc)[_0x198f('0x23')]();});}};}function handleEntityNotFound(_0x256976,_0x1b965c){return function(_0x150333){if(!_0x150333){_0x256976[_0x198f('0x24')](0x194);}return _0x150333;};}function handleError(_0x51165e,_0x98c905){_0x98c905=_0x98c905||0x1f4;return function(_0x15d8e4){logger['error'](_0x15d8e4['stack']);if(_0x15d8e4['name']){delete _0x15d8e4[_0x198f('0x25')];}_0x51165e[_0x198f('0x1a')](_0x98c905)['send'](_0x15d8e4);};}exports[_0x198f('0x26')]=function(_0xe11501,_0x267b40){var _0x5d2d3a={'raw':![],'where':{'id':_0xe11501[_0x198f('0x27')]['id']}},_0x20963c={};_0x20963c['model']=_[_0x198f('0x28')](db['DashboardItem'][_0x198f('0x29')]);_0x20963c['query']=_[_0x198f('0x28')](_0xe11501['query']);_0x20963c['filters']=_[_0x198f('0x2a')](_0x20963c[_0x198f('0x2b')],_0x20963c[_0x198f('0x2c')]);_0x5d2d3a[_0x198f('0x2d')]=_[_0x198f('0x2a')](_0x20963c[_0x198f('0x2b')],qs['fields'](_0xe11501[_0x198f('0x2c')][_0x198f('0x2e')]));_0x5d2d3a[_0x198f('0x2d')]=_0x5d2d3a[_0x198f('0x2d')][_0x198f('0x2f')]?_0x5d2d3a[_0x198f('0x2d')]:_0x20963c[_0x198f('0x2b')];if(_0xe11501[_0x198f('0x2c')][_0x198f('0x30')]){_0x5d2d3a[_0x198f('0x31')]=[{'all':!![]}];}_0x5d2d3a=_[_0x198f('0x32')]({},_0x5d2d3a,_0xe11501[_0x198f('0x33')]);return db[_0x198f('0x34')]['find'](_0x5d2d3a)[_0x198f('0x21')](handleEntityNotFound(_0x267b40,null))['then'](respondWithResult(_0x267b40,null))[_0x198f('0x35')](handleError(_0x267b40,null));};exports['destroy']=function(_0x423d49,_0x4aebc3){return db['DashboardItem'][_0x198f('0x36')]({'where':{'id':_0x423d49[_0x198f('0x27')]['id']}})['then'](handleEntityNotFound(_0x4aebc3,null))['then'](removeEntity(_0x4aebc3,null))[_0x198f('0x35')](handleError(_0x4aebc3,null));};function widgetAttributes(_0x5de78d){try{switch(_0x5de78d[_0x198f('0x37')]){case _0x198f('0x38'):return[{'name':_0x198f('0x39'),'value':_0x5de78d[_0x198f('0x39')]||(_0x5de78d[_0x198f('0x3a')]&&_0x5de78d['attrs'][0x0]?_0x5de78d[_0x198f('0x3a')][0x0][_0x198f('0x3b')]:undefined)||_0x198f('0x3c')}];case _0x198f('0x3d'):return[{'name':_0x198f('0x3e'),'value':_0x5de78d[_0x198f('0x3e')]||(_0x5de78d[_0x198f('0x3a')]&&_0x5de78d[_0x198f('0x3a')][0x0]?_0x5de78d['attrs'][0x0][_0x198f('0x3b')]:undefined)||''}];case _0x198f('0x3f'):return[{'name':_0x198f('0x40'),'value':_0x5de78d[_0x198f('0x40')]||(_0x5de78d[_0x198f('0x3a')]&&_0x5de78d['attrs'][0x0]?_0x5de78d[_0x198f('0x3a')][0x0][_0x198f('0x3b')]:undefined)||_0x198f('0x41')},{'name':_0x198f('0x42'),'value':_0x5de78d[_0x198f('0x42')]||(_0x5de78d[_0x198f('0x3a')]&&_0x5de78d['attrs'][0x1]?_0x5de78d[_0x198f('0x3a')][0x1][_0x198f('0x3b')]:undefined)||'0.00'},{'name':_0x198f('0x43'),'value':_0x5de78d['attrFontSize']||(_0x5de78d[_0x198f('0x3a')]&&_0x5de78d['attrs'][0x2]?_0x5de78d[_0x198f('0x3a')][0x2][_0x198f('0x3b')]:undefined)||0xc}];case'counter':return[{'name':_0x198f('0x44'),'value':_0x5de78d['attrMetric']||(_0x5de78d[_0x198f('0x3a')]&&_0x5de78d[_0x198f('0x3a')][0x0]?_0x5de78d[_0x198f('0x3a')][0x0][_0x198f('0x3b')]:undefined)||_0x198f('0x45')},{'name':_0x198f('0x46'),'value':_0x5de78d['attrVoiceQueues']||(_0x5de78d[_0x198f('0x3a')]&&_0x5de78d[_0x198f('0x3a')][0x1]?_0x5de78d[_0x198f('0x3a')][0x1][_0x198f('0x3b')]:undefined)||[]},{'name':_0x198f('0x43'),'value':_0x5de78d[_0x198f('0x43')]||(_0x5de78d[_0x198f('0x3a')]&&_0x5de78d[_0x198f('0x3a')][0x2]?_0x5de78d[_0x198f('0x3a')][0x2][_0x198f('0x3b')]:undefined)||0x14}];case _0x198f('0x47'):case _0x198f('0x48'):return[{'name':_0x198f('0x49'),'value':_0x5de78d[_0x198f('0x49')]||(_0x5de78d[_0x198f('0x3a')]&&_0x5de78d[_0x198f('0x3a')][0x0]?_0x5de78d[_0x198f('0x3a')][0x0]['value']:undefined)||_0x198f('0x45')},{'name':'attrSerie2','value':_0x5de78d[_0x198f('0x4a')]||(_0x5de78d[_0x198f('0x3a')]&&_0x5de78d[_0x198f('0x3a')][0x1]?_0x5de78d[_0x198f('0x3a')][0x1][_0x198f('0x3b')]:undefined)||null},{'name':_0x198f('0x4b'),'value':_0x5de78d[_0x198f('0x4b')]||(_0x5de78d[_0x198f('0x3a')]&&_0x5de78d[_0x198f('0x3a')][0x2]?_0x5de78d[_0x198f('0x3a')][0x2][_0x198f('0x3b')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x5de78d[_0x198f('0x46')]||(_0x5de78d['attrs']&&_0x5de78d[_0x198f('0x3a')][0x3]?_0x5de78d[_0x198f('0x3a')][0x3][_0x198f('0x3b')]:undefined)||[]}];case _0x198f('0x4c'):return[{'name':_0x198f('0x4d'),'type':_0x5de78d[_0x198f('0x4e')]||(_0x5de78d['attrs']&&_0x5de78d['attrs'][0x0]?_0x5de78d[_0x198f('0x3a')][0x0][_0x198f('0x37')]:undefined)||null,'value':_0x5de78d[_0x198f('0x4d')]||(_0x5de78d[_0x198f('0x3a')]&&_0x5de78d[_0x198f('0x3a')][0x0]?_0x5de78d[_0x198f('0x3a')][0x0][_0x198f('0x3b')]:undefined)||null},{'name':_0x198f('0x4f'),'value':_0x5de78d[_0x198f('0x4f')]||(_0x5de78d[_0x198f('0x3a')]&&_0x5de78d[_0x198f('0x3a')][0x1]?_0x5de78d[_0x198f('0x3a')][0x1][_0x198f('0x3b')]:undefined)||0x0}];default:return[];}}catch(_0x2e632c){logger[_0x198f('0x50')]('widgetAttributes:\x20%s',JSON['stringify'](_0x2e632c));return[];}}exports[_0x198f('0x51')]=function(_0x1be70d,_0x34beb3){if(_0x1be70d[_0x198f('0x52')]){_0x1be70d[_0x198f('0x52')][_0x198f('0x3a')]=widgetAttributes(_0x1be70d[_0x198f('0x52')]);}return db[_0x198f('0x34')][_0x198f('0x51')](_0x1be70d['body'],{})['then'](respondWithResult(_0x34beb3,0xc9))[_0x198f('0x35')](handleError(_0x34beb3,null));};exports[_0x198f('0x20')]=function(_0x421b9a,_0x374db5){if(_0x421b9a[_0x198f('0x52')]['id']){delete _0x421b9a[_0x198f('0x52')]['id'];}_0x421b9a[_0x198f('0x52')][_0x198f('0x3a')]=widgetAttributes(_0x421b9a[_0x198f('0x52')]);return db['DashboardItem'][_0x198f('0x36')]({'where':{'id':_0x421b9a[_0x198f('0x27')]['id']}})[_0x198f('0x21')](handleEntityNotFound(_0x374db5,null))[_0x198f('0x21')](saveUpdates(_0x421b9a[_0x198f('0x52')],null))[_0x198f('0x21')](respondWithResult(_0x374db5,null))[_0x198f('0x35')](handleError(_0x374db5,null));}; \ No newline at end of file +var _0x0970=['querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','show','params','model','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','DashboardItem','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x0970,0x1c0));var _0x0097=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0970[_0x4a9fb1];return _0x348672;};'use strict';var pdf=require(_0x0097('0x0'));var emlformat=require(_0x0097('0x1'));var rimraf=require(_0x0097('0x2'));var zipdir=require(_0x0097('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0097('0x4'));var moment=require(_0x0097('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0097('0x6'));var util=require(_0x0097('0x7'));var path=require(_0x0097('0x8'));var sox=require(_0x0097('0x9'));var csv=require(_0x0097('0xa'));var ejs=require(_0x0097('0xb'));var fs=require('fs');var _=require(_0x0097('0xc'));var squel=require(_0x0097('0xd'));var crypto=require(_0x0097('0xe'));var jsforce=require(_0x0097('0xf'));var deskjs=require(_0x0097('0x10'));var toCsv=require(_0x0097('0xa'));var querystring=require(_0x0097('0x11'));var Papa=require(_0x0097('0x12'));var Redis=require(_0x0097('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0097('0x14'));var hardwareService=require(_0x0097('0x15'));var logger=require(_0x0097('0x16'))(_0x0097('0x17'));var utils=require(_0x0097('0x18'));var config=require(_0x0097('0x19'));var db=require(_0x0097('0x1a'))['db'];config['redis']=_[_0x0097('0x1b')](config[_0x0097('0x1c')],{'host':_0x0097('0x1d'),'port':0x18eb});var socket=require(_0x0097('0x1e'))(new Redis(config[_0x0097('0x1c')]));require('./dashboardItem.socket')[_0x0097('0x1f')](socket);function respondWithStatusCode(_0x31ac13,_0x2fca88){_0x2fca88=_0x2fca88||0xcc;return function(_0x171fd3){if(_0x171fd3){return _0x31ac13[_0x0097('0x20')](_0x2fca88);}return _0x31ac13[_0x0097('0x21')](_0x2fca88)['end']();};}function respondWithResult(_0x4dbb8e,_0x4f76d8){_0x4f76d8=_0x4f76d8||0xc8;return function(_0x23e069){if(_0x23e069){return _0x4dbb8e['status'](_0x4f76d8)[_0x0097('0x22')](_0x23e069);}};}function respondWithFilteredResult(_0x36e6e1,_0x2c888d){return function(_0x36fa0d){if(_0x36fa0d){var _0x5e8975=_0x36fa0d[_0x0097('0x23')],_0x3e7659=_0x2c888d[_0x0097('0x24')],_0x3e169d=_0x2c888d[_0x0097('0x24')]+_0x2c888d[_0x0097('0x25')],_0x161d5a;if(_0x3e169d>=_0x5e8975){_0x3e169d=_0x5e8975;_0x161d5a=0xc8;}else{_0x161d5a=0xce;}_0x36e6e1[_0x0097('0x21')](_0x161d5a);return _0x36e6e1[_0x0097('0x26')](_0x0097('0x27'),_0x3e7659+'-'+_0x3e169d+'/'+_0x5e8975)[_0x0097('0x22')](_0x36fa0d);}return null;};}function patchUpdates(_0x20b72c){return function(_0x426173){try{jsonpatch[_0x0097('0x28')](_0x426173,_0x20b72c,!![]);}catch(_0x37468e){return BPromise[_0x0097('0x29')](_0x37468e);}return _0x426173[_0x0097('0x2a')]();};}function saveUpdates(_0x5aae26,_0x25aa57){return function(_0x20d4b0){if(_0x20d4b0){return _0x20d4b0[_0x0097('0x2b')](_0x5aae26)[_0x0097('0x2c')](function(_0x156d03){return _0x156d03;});}return null;};}function removeEntity(_0x145923,_0x1b4538){return function(_0x333f28){if(_0x333f28){return _0x333f28[_0x0097('0x2d')]()[_0x0097('0x2c')](function(){_0x145923[_0x0097('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4477a8,_0x32a1b5){return function(_0x28598c){if(!_0x28598c){_0x4477a8[_0x0097('0x20')](0x194);}return _0x28598c;};}function handleError(_0x37efe4,_0x57bc32){_0x57bc32=_0x57bc32||0x1f4;return function(_0x4137e4){logger['error'](_0x4137e4['stack']);if(_0x4137e4[_0x0097('0x2e')]){delete _0x4137e4['name'];}_0x37efe4['status'](_0x57bc32)[_0x0097('0x2f')](_0x4137e4);};}exports[_0x0097('0x30')]=function(_0x45cd73,_0x472ac0){var _0x220410={'raw':![],'where':{'id':_0x45cd73[_0x0097('0x31')]['id']}},_0x409f43={};_0x409f43[_0x0097('0x32')]=_['keys'](db['DashboardItem'][_0x0097('0x33')]);_0x409f43['query']=_['keys'](_0x45cd73[_0x0097('0x34')]);_0x409f43[_0x0097('0x35')]=_[_0x0097('0x36')](_0x409f43[_0x0097('0x32')],_0x409f43[_0x0097('0x34')]);_0x220410[_0x0097('0x37')]=_[_0x0097('0x36')](_0x409f43[_0x0097('0x32')],qs['fields'](_0x45cd73['query'][_0x0097('0x38')]));_0x220410[_0x0097('0x37')]=_0x220410[_0x0097('0x37')][_0x0097('0x39')]?_0x220410[_0x0097('0x37')]:_0x409f43[_0x0097('0x32')];if(_0x45cd73[_0x0097('0x34')][_0x0097('0x3a')]){_0x220410[_0x0097('0x3b')]=[{'all':!![]}];}_0x220410=_['merge']({},_0x220410,_0x45cd73['options']);return db[_0x0097('0x3c')][_0x0097('0x3d')](_0x220410)[_0x0097('0x2c')](handleEntityNotFound(_0x472ac0,null))[_0x0097('0x2c')](respondWithResult(_0x472ac0,null))[_0x0097('0x3e')](handleError(_0x472ac0,null));};exports[_0x0097('0x2d')]=function(_0x1516bb,_0x4710e0){return db['DashboardItem'][_0x0097('0x3d')]({'where':{'id':_0x1516bb[_0x0097('0x31')]['id']}})['then'](handleEntityNotFound(_0x4710e0,null))[_0x0097('0x2c')](removeEntity(_0x4710e0,null))[_0x0097('0x3e')](handleError(_0x4710e0,null));};function widgetAttributes(_0x4e46b3){try{switch(_0x4e46b3[_0x0097('0x3f')]){case _0x0097('0x40'):return[{'name':_0x0097('0x41'),'value':_0x4e46b3['attrUrl']||(_0x4e46b3[_0x0097('0x42')]&&_0x4e46b3[_0x0097('0x42')][0x0]?_0x4e46b3[_0x0097('0x42')][0x0][_0x0097('0x43')]:undefined)||_0x0097('0x44')}];case _0x0097('0x45'):return[{'name':'attrPath','value':_0x4e46b3[_0x0097('0x46')]||(_0x4e46b3[_0x0097('0x42')]&&_0x4e46b3[_0x0097('0x42')][0x0]?_0x4e46b3[_0x0097('0x42')][0x0][_0x0097('0x43')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x4e46b3['attrHourFormat']||(_0x4e46b3[_0x0097('0x42')]&&_0x4e46b3[_0x0097('0x42')][0x0]?_0x4e46b3[_0x0097('0x42')][0x0][_0x0097('0x43')]:undefined)||_0x0097('0x47')},{'name':_0x0097('0x48'),'value':_0x4e46b3[_0x0097('0x48')]||(_0x4e46b3['attrs']&&_0x4e46b3['attrs'][0x1]?_0x4e46b3[_0x0097('0x42')][0x1][_0x0097('0x43')]:undefined)||_0x0097('0x49')},{'name':_0x0097('0x4a'),'value':_0x4e46b3['attrFontSize']||(_0x4e46b3[_0x0097('0x42')]&&_0x4e46b3['attrs'][0x2]?_0x4e46b3[_0x0097('0x42')][0x2][_0x0097('0x43')]:undefined)||0xc}];case _0x0097('0x4b'):return[{'name':_0x0097('0x4c'),'value':_0x4e46b3[_0x0097('0x4c')]||(_0x4e46b3[_0x0097('0x42')]&&_0x4e46b3[_0x0097('0x42')][0x0]?_0x4e46b3[_0x0097('0x42')][0x0][_0x0097('0x43')]:undefined)||_0x0097('0x4d')},{'name':'attrVoiceQueues','value':_0x4e46b3[_0x0097('0x4e')]||(_0x4e46b3[_0x0097('0x42')]&&_0x4e46b3['attrs'][0x1]?_0x4e46b3[_0x0097('0x42')][0x1][_0x0097('0x43')]:undefined)||[]},{'name':_0x0097('0x4a'),'value':_0x4e46b3[_0x0097('0x4a')]||(_0x4e46b3[_0x0097('0x42')]&&_0x4e46b3['attrs'][0x2]?_0x4e46b3[_0x0097('0x42')][0x2][_0x0097('0x43')]:undefined)||0x14}];case _0x0097('0x4f'):case _0x0097('0x50'):return[{'name':_0x0097('0x51'),'value':_0x4e46b3[_0x0097('0x51')]||(_0x4e46b3[_0x0097('0x42')]&&_0x4e46b3[_0x0097('0x42')][0x0]?_0x4e46b3['attrs'][0x0]['value']:undefined)||_0x0097('0x4d')},{'name':_0x0097('0x52'),'value':_0x4e46b3[_0x0097('0x52')]||(_0x4e46b3['attrs']&&_0x4e46b3[_0x0097('0x42')][0x1]?_0x4e46b3['attrs'][0x1][_0x0097('0x43')]:undefined)||null},{'name':_0x0097('0x53'),'value':_0x4e46b3[_0x0097('0x53')]||(_0x4e46b3['attrs']&&_0x4e46b3['attrs'][0x2]?_0x4e46b3[_0x0097('0x42')][0x2]['value']:undefined)||null},{'name':_0x0097('0x4e'),'value':_0x4e46b3[_0x0097('0x4e')]||(_0x4e46b3[_0x0097('0x42')]&&_0x4e46b3[_0x0097('0x42')][0x3]?_0x4e46b3['attrs'][0x3]['value']:undefined)||[]}];case _0x0097('0x54'):return[{'name':_0x0097('0x55'),'type':_0x4e46b3[_0x0097('0x56')]||(_0x4e46b3[_0x0097('0x42')]&&_0x4e46b3['attrs'][0x0]?_0x4e46b3[_0x0097('0x42')][0x0][_0x0097('0x3f')]:undefined)||null,'value':_0x4e46b3['attrReport']||(_0x4e46b3[_0x0097('0x42')]&&_0x4e46b3['attrs'][0x0]?_0x4e46b3[_0x0097('0x42')][0x0][_0x0097('0x43')]:undefined)||null},{'name':_0x0097('0x57'),'value':_0x4e46b3[_0x0097('0x57')]||(_0x4e46b3['attrs']&&_0x4e46b3[_0x0097('0x42')][0x1]?_0x4e46b3[_0x0097('0x42')][0x1][_0x0097('0x43')]:undefined)||0x0}];default:return[];}}catch(_0x588b56){logger[_0x0097('0x58')](_0x0097('0x59'),JSON[_0x0097('0x5a')](_0x588b56));return[];}}exports[_0x0097('0x5b')]=function(_0x36e0c0,_0x578b44){if(_0x36e0c0[_0x0097('0x5c')]){_0x36e0c0['body'][_0x0097('0x42')]=widgetAttributes(_0x36e0c0[_0x0097('0x5c')]);}return db[_0x0097('0x3c')]['create'](_0x36e0c0[_0x0097('0x5c')],{})[_0x0097('0x2c')](respondWithResult(_0x578b44,0xc9))[_0x0097('0x3e')](handleError(_0x578b44,null));};exports['update']=function(_0x39df8b,_0x25a602){if(_0x39df8b[_0x0097('0x5c')]['id']){delete _0x39df8b[_0x0097('0x5c')]['id'];}_0x39df8b['body']['attrs']=widgetAttributes(_0x39df8b['body']);return db['DashboardItem'][_0x0097('0x3d')]({'where':{'id':_0x39df8b[_0x0097('0x31')]['id']}})[_0x0097('0x2c')](handleEntityNotFound(_0x25a602,null))[_0x0097('0x2c')](saveUpdates(_0x39df8b[_0x0097('0x5c')],null))[_0x0097('0x2c')](respondWithResult(_0x25a602,null))[_0x0097('0x3e')](handleError(_0x25a602,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 851f5b3..e43a44b 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 _0xdf4d=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','DashboardItem','save','update'];(function(_0x175a55,_0x4082fd){var _0x167adf=function(_0x18ef07){while(--_0x18ef07){_0x175a55['push'](_0x175a55['shift']());}};_0x167adf(++_0x4082fd);}(_0xdf4d,0xcb));var _0xddf4=function(_0x39a80f,_0x99ff6d){_0x39a80f=_0x39a80f-0x0;var _0x4d84aa=_0xdf4d[_0x39a80f];return _0x4d84aa;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0xddf4('0x0'))['db'][_0xddf4('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xddf4('0x2'),'afterUpdate':_0xddf4('0x3'),'afterDestroy':_0xddf4('0x4')};function emitEvent(_0x126f5a){return function(_0x42a83d,_0x295556,_0x56a62f){DashboardItemEvents['emit'](_0x126f5a+':'+_0x42a83d['id'],_0x42a83d);DashboardItemEvents[_0xddf4('0x5')](_0x126f5a,_0x42a83d);_0x56a62f(null);};}for(var e in events){if(events[_0xddf4('0x6')](e)){var event=events[e];DashboardItem[_0xddf4('0x7')](e,emitEvent(event));}}module[_0xddf4('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x17a7=['hook','exports','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x5a13c0,_0x4dffa4){var _0x48fcae=function(_0x86ae57){while(--_0x86ae57){_0x5a13c0['push'](_0x5a13c0['shift']());}};_0x48fcae(++_0x4dffa4);}(_0x17a7,0xc2));var _0x717a=function(_0x2f7738,_0x5c8396){_0x2f7738=_0x2f7738-0x0;var _0x2a83d0=_0x17a7[_0x2f7738];return _0x2a83d0;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x717a('0x0')](0x0);var events={'afterCreate':_0x717a('0x1'),'afterUpdate':_0x717a('0x2'),'afterDestroy':_0x717a('0x3')};function emitEvent(_0x5cbc3c){return function(_0x3c6ac5,_0x49a603,_0x33c7ab){DashboardItemEvents[_0x717a('0x4')](_0x5cbc3c+':'+_0x3c6ac5['id'],_0x3c6ac5);DashboardItemEvents['emit'](_0x5cbc3c,_0x3c6ac5);_0x33c7ab(null);};}for(var e in events){if(events[_0x717a('0x5')](e)){var event=events[e];DashboardItem[_0x717a('0x6')](e,emitEvent(event));}}module[_0x717a('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 14f8551..91d83ba 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 _0x97d1=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger'];(function(_0x505ec3,_0x4d80c8){var _0x2b4695=function(_0x12f7ee){while(--_0x12f7ee){_0x505ec3['push'](_0x505ec3['shift']());}};_0x2b4695(++_0x4d80c8);}(_0x97d1,0x1b0));var _0x197d=function(_0x59b8ea,_0x311f9a){_0x59b8ea=_0x59b8ea-0x0;var _0x5c1c55=_0x97d1[_0x59b8ea];return _0x5c1c55;};'use strict';var _=require(_0x197d('0x0'));var util=require(_0x197d('0x1'));var logger=require(_0x197d('0x2'))(_0x197d('0x3'));var moment=require(_0x197d('0x4'));var BPromise=require(_0x197d('0x5'));var rp=require(_0x197d('0x6'));var fs=require('fs');var path=require(_0x197d('0x7'));var rimraf=require(_0x197d('0x8'));var config=require(_0x197d('0x9'));var attributes=require(_0x197d('0xa'));module[_0x197d('0xb')]=function(_0x521d3e,_0x232557){return _0x521d3e[_0x197d('0xc')](_0x197d('0xd'),attributes,{'tableName':_0x197d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x50ef=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','dashboard_items','util','../../config/logger'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x50ef,0xb2));var _0xf50e=function(_0x744c73,_0x546b49){_0x744c73=_0x744c73-0x0;var _0x5f0a58=_0x50ef[_0x744c73];return _0x5f0a58;};'use strict';var _=require('lodash');var util=require(_0xf50e('0x0'));var logger=require(_0xf50e('0x1'))('api');var moment=require(_0xf50e('0x2'));var BPromise=require(_0xf50e('0x3'));var rp=require(_0xf50e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf50e('0x5'));var config=require(_0xf50e('0x6'));var attributes=require('./dashboardItem.attributes');module[_0xf50e('0x7')]=function(_0x437476,_0x2d8b73){return _0x437476['define']('DashboardItem',attributes,{'tableName':_0xf50e('0x8'),'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 65f75b6..7a2f8b2 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 _0xc6bd=['then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket','request'];(function(_0x38941c,_0x8ab496){var _0x44aaae=function(_0x235318){while(--_0x235318){_0x38941c['push'](_0x38941c['shift']());}};_0x44aaae(++_0x8ab496);}(_0xc6bd,0x1e9));var _0xdc6b=function(_0x4f7a97,_0x14f986){_0x4f7a97=_0x4f7a97-0x0;var _0x2d97cb=_0xc6bd[_0x4f7a97];return _0x2d97cb;};'use strict';var _=require('lodash');var util=require(_0xdc6b('0x0'));var moment=require(_0xdc6b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc6b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc6b('0x3'));var logger=require(_0xdc6b('0x4'))(_0xdc6b('0x5'));var config=require(_0xdc6b('0x6'));var jayson=require(_0xdc6b('0x7'));var client=jayson[_0xdc6b('0x8')][_0xdc6b('0x9')]({'port':0x232a});config[_0xdc6b('0xa')]=_[_0xdc6b('0xb')](config[_0xdc6b('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xdc6b('0xc'))(new Redis(config[_0xdc6b('0xa')]));require(_0xdc6b('0xd'))['register'](socket);function respondWithRpcPromise(_0x446ab5,_0x3f104b,_0x405925){return new BPromise(function(_0x3d8b60,_0x5c5dbe){return client[_0xdc6b('0xe')](_0x446ab5,_0x405925)[_0xdc6b('0xf')](function(_0x2bdfd1){logger[_0xdc6b('0x10')](_0xdc6b('0x11'),_0x3f104b,'request\x20sent');logger[_0xdc6b('0x12')](_0xdc6b('0x13'),_0x3f104b,_0xdc6b('0x14'),JSON['stringify'](_0x2bdfd1));if(_0x2bdfd1['error']){if(_0x2bdfd1[_0xdc6b('0x15')]['code']===0x1f4){logger['error'](_0xdc6b('0x11'),_0x3f104b,_0x2bdfd1['error'][_0xdc6b('0x16')]);return _0x5c5dbe(_0x2bdfd1['error'][_0xdc6b('0x16')]);}logger[_0xdc6b('0x15')](_0xdc6b('0x11'),_0x3f104b,_0x2bdfd1[_0xdc6b('0x15')][_0xdc6b('0x16')]);return _0x3d8b60(_0x2bdfd1[_0xdc6b('0x15')][_0xdc6b('0x16')]);}else{logger[_0xdc6b('0x10')](_0xdc6b('0x11'),_0x3f104b,_0xdc6b('0x14'));_0x3d8b60(_0x2bdfd1['result'][_0xdc6b('0x16')]);}})[_0xdc6b('0x17')](function(_0x1f0b92){logger[_0xdc6b('0x15')](_0xdc6b('0x11'),_0x3f104b,_0x1f0b92);_0x5c5dbe(_0x1f0b92);});});} \ No newline at end of file +var _0x1f09=['DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s','debug'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x1f09,0x187));var _0x91f0=function(_0x50fa67,_0x3cb5c2){_0x50fa67=_0x50fa67-0x0;var _0x5c77c9=_0x1f09[_0x50fa67];return _0x5c77c9;};'use strict';var _=require(_0x91f0('0x0'));var util=require(_0x91f0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x91f0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x91f0('0x3'));var logger=require(_0x91f0('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x91f0('0x5'));var client=jayson[_0x91f0('0x6')]['http']({'port':0x232a});config[_0x91f0('0x7')]=_[_0x91f0('0x8')](config[_0x91f0('0x7')],{'host':_0x91f0('0x9'),'port':0x18eb});var socket=require(_0x91f0('0xa'))(new Redis(config[_0x91f0('0x7')]));require(_0x91f0('0xb'))[_0x91f0('0xc')](socket);function respondWithRpcPromise(_0x26bbd3,_0xd0b60,_0xbb75a7){return new BPromise(function(_0x9483eb,_0x1faf9b){return client[_0x91f0('0xd')](_0x26bbd3,_0xbb75a7)['then'](function(_0x236951){logger[_0x91f0('0xe')](_0x91f0('0xf'),_0xd0b60,'request\x20sent');logger[_0x91f0('0x10')](_0x91f0('0x11'),_0xd0b60,_0x91f0('0x12'),JSON['stringify'](_0x236951));if(_0x236951[_0x91f0('0x13')]){if(_0x236951[_0x91f0('0x13')][_0x91f0('0x14')]===0x1f4){logger[_0x91f0('0x13')]('DashboardItem,\x20%s,\x20%s',_0xd0b60,_0x236951[_0x91f0('0x13')][_0x91f0('0x15')]);return _0x1faf9b(_0x236951[_0x91f0('0x13')][_0x91f0('0x15')]);}logger[_0x91f0('0x13')](_0x91f0('0xf'),_0xd0b60,_0x236951[_0x91f0('0x13')][_0x91f0('0x15')]);return _0x9483eb(_0x236951[_0x91f0('0x13')][_0x91f0('0x15')]);}else{logger[_0x91f0('0xe')](_0x91f0('0xf'),_0xd0b60,_0x91f0('0x12'));_0x9483eb(_0x236951[_0x91f0('0x16')]['message']);}})[_0x91f0('0x17')](function(_0x502358){logger[_0x91f0('0x13')](_0x91f0('0xf'),_0xd0b60,_0x502358);_0x1faf9b(_0x502358);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 3e47238..b831f63 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(_0xa2b098,_0x461a08){var _0x29502e=function(_0x43291a){while(--_0x43291a){_0xa2b098['push'](_0xa2b098['shift']());}};_0x29502e(++_0x461a08);}(_0x34e8,0x12c));var _0x834e=function(_0x53d567,_0x4aa466){_0x53d567=_0x53d567-0x0;var _0x198280=_0x34e8[_0x53d567];return _0x198280;};'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 _0x55ca=['removeListener','register','./dashboardItem.events','save'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x55ca,0x126));var _0xa55c=function(_0x22a333,_0xb6f8){_0x22a333=_0x22a333-0x0;var _0x109061=_0x55ca[_0x22a333];return _0x109061;};'use strict';var DashboardItemEvents=require(_0xa55c('0x0'));var events=[_0xa55c('0x1'),'remove','update'];function createListener(_0x49875a,_0x1c6ec3){return function(_0x267ea0){_0x1c6ec3['emit'](_0x49875a,_0x267ea0);};}function removeListener(_0x3b478a,_0x2db02a){return function(){DashboardItemEvents[_0xa55c('0x2')](_0x3b478a,_0x2db02a);};}exports[_0xa55c('0x3')]=function(_0x3c97c8){for(var _0x279caa=0x0,_0x36b623=events['length'];_0x279caa<_0x36b623;_0x279caa++){var _0x2121fd=events[_0x279caa];var _0x2537f0=createListener('dashboardItem:'+_0x2121fd,_0x3c97c8);DashboardItemEvents['on'](_0x2121fd,_0x2537f0);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index db2d92c..98ad2b0 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 _0xbeb6=['update','delete','destroy','exports','multer','connect-timeout','express','Router','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create'];(function(_0x2525a,_0x40911f){var _0x1cc47b=function(_0x40de94){while(--_0x40de94){_0x2525a['push'](_0x2525a['shift']());}};_0x1cc47b(++_0x40911f);}(_0xbeb6,0xb4));var _0x6beb=function(_0x34b6e6,_0x2efab8){_0x34b6e6=_0x34b6e6-0x0;var _0x1b9766=_0xbeb6[_0x34b6e6];return _0x1b9766;};'use strict';var multer=require(_0x6beb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6beb('0x1'));var express=require(_0x6beb('0x2'));var router=express[_0x6beb('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6beb('0x4'));var controller=require(_0x6beb('0x5'));router[_0x6beb('0x6')](_0x6beb('0x7'),auth[_0x6beb('0x8')](),controller[_0x6beb('0x9')]);router[_0x6beb('0xa')]('/',auth['isAuthenticated'](),controller[_0x6beb('0xb')]);router['put'](_0x6beb('0x7'),auth[_0x6beb('0x8')](),controller[_0x6beb('0xc')]);router[_0x6beb('0xd')](_0x6beb('0x7'),auth[_0x6beb('0x8')](),controller[_0x6beb('0xe')]);module[_0x6beb('0xf')]=router; \ No newline at end of file +var _0x5ba2=['./dashboardItem.controller','/:id','isAuthenticated','show','create','put','update','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x5ba2,0x1cb));var _0x25ba=function(_0x44c935,_0x3653f0){_0x44c935=_0x44c935-0x0;var _0x465bee=_0x5ba2[_0x44c935];return _0x465bee;};'use strict';var multer=require(_0x25ba('0x0'));var util=require('util');var path=require(_0x25ba('0x1'));var timeout=require(_0x25ba('0x2'));var express=require(_0x25ba('0x3'));var router=express['Router']();var auth=require(_0x25ba('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x25ba('0x5'));var controller=require(_0x25ba('0x6'));router['get'](_0x25ba('0x7'),auth[_0x25ba('0x8')](),controller[_0x25ba('0x9')]);router['post']('/',auth[_0x25ba('0x8')](),controller[_0x25ba('0xa')]);router[_0x25ba('0xb')](_0x25ba('0x7'),auth[_0x25ba('0x8')](),controller[_0x25ba('0xc')]);router['delete'](_0x25ba('0x7'),auth[_0x25ba('0x8')](),controller[_0x25ba('0xd')]);module[_0x25ba('0xe')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 046cfd4..8ec8ebf 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 _0x7620=['sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7620,0x8a));var _0x0762=function(_0x5356c2,_0x4d9836){_0x5356c2=_0x5356c2-0x0;var _0x15bf08=_0x7620[_0x5356c2];return _0x15bf08;};'use strict';var Sequelize=require(_0x0762('0x0'));module[_0x0762('0x1')]={'name':{'type':Sequelize[_0x0762('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8642=['STRING','sequelize','exports'];(function(_0x5a1252,_0x5c436a){var _0x55888d=function(_0x45a5d9){while(--_0x45a5d9){_0x5a1252['push'](_0x5a1252['shift']());}};_0x55888d(++_0x5c436a);}(_0x8642,0x6a));var _0x2864=function(_0x1ebce2,_0x10e903){_0x1ebce2=_0x1ebce2-0x0;var _0x4a330c=_0x8642[_0x1ebce2];return _0x4a330c;};'use strict';var Sequelize=require(_0x2864('0x0'));module[_0x2864('0x1')]={'name':{'type':Sequelize[_0x2864('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index f9bba9a..1daf338 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 _0xb609=['pick','filter','where','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','catch','params','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','set','json','apply','reject','update','destroy','then','Dispositions','UserProfileResource','end','stack','name','send','index','Disposition','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort'];(function(_0x595bd0,_0x4b6793){var _0x2f3b47=function(_0x2e1e35){while(--_0x2e1e35){_0x595bd0['push'](_0x595bd0['shift']());}};_0x2f3b47(++_0x4b6793);}(_0xb609,0x10a));var _0x9b60=function(_0x3eebbf,_0x50556a){_0x3eebbf=_0x3eebbf-0x0;var _0x350702=_0xb609[_0x3eebbf];return _0x350702;};'use strict';var pdf=require(_0x9b60('0x0'));var emlformat=require(_0x9b60('0x1'));var rimraf=require(_0x9b60('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9b60('0x3'));var rp=require(_0x9b60('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9b60('0x5'));var util=require(_0x9b60('0x6'));var path=require(_0x9b60('0x7'));var sox=require(_0x9b60('0x8'));var csv=require(_0x9b60('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9b60('0xa'));var squel=require(_0x9b60('0xb'));var crypto=require(_0x9b60('0xc'));var jsforce=require(_0x9b60('0xd'));var deskjs=require(_0x9b60('0xe'));var toCsv=require(_0x9b60('0x9'));var querystring=require('querystring');var Papa=require(_0x9b60('0xf'));var Redis=require(_0x9b60('0x10'));var authService=require(_0x9b60('0x11'));var qs=require(_0x9b60('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b60('0x13'))('api');var utils=require(_0x9b60('0x14'));var config=require(_0x9b60('0x15'));var db=require(_0x9b60('0x16'))['db'];function respondWithStatusCode(_0x1d04fa,_0x1e85db){_0x1e85db=_0x1e85db||0xcc;return function(_0x46d5fb){if(_0x46d5fb){return _0x1d04fa[_0x9b60('0x17')](_0x1e85db);}return _0x1d04fa[_0x9b60('0x18')](_0x1e85db)['end']();};}function respondWithResult(_0x53c7dd,_0x418bd5){_0x418bd5=_0x418bd5||0xc8;return function(_0x25a2c4){if(_0x25a2c4){return _0x53c7dd[_0x9b60('0x18')](_0x418bd5)['json'](_0x25a2c4);}};}function respondWithFilteredResult(_0x475179,_0x115553){return function(_0x25199e){if(_0x25199e){var _0x3ef071=_0x25199e['count'],_0x2e7552=_0x115553[_0x9b60('0x19')],_0x3cf9af=_0x115553[_0x9b60('0x19')]+_0x115553['limit'],_0x2faf78;if(_0x3cf9af>=_0x3ef071){_0x3cf9af=_0x3ef071;_0x2faf78=0xc8;}else{_0x2faf78=0xce;}_0x475179[_0x9b60('0x18')](_0x2faf78);return _0x475179[_0x9b60('0x1a')]('Content-Range',_0x2e7552+'-'+_0x3cf9af+'/'+_0x3ef071)[_0x9b60('0x1b')](_0x25199e);}return null;};}function patchUpdates(_0x429d46){return function(_0xff632a){try{jsonpatch[_0x9b60('0x1c')](_0xff632a,_0x429d46,!![]);}catch(_0x360924){return BPromise[_0x9b60('0x1d')](_0x360924);}return _0xff632a['save']();};}function saveUpdates(_0x22f938,_0x12c2df){return function(_0x5511bf){if(_0x5511bf){return _0x5511bf[_0x9b60('0x1e')](_0x22f938)['then'](function(_0x461e2a){return _0x461e2a;});}return null;};}function removeEntity(_0xd3ee75,_0x495578){return function(_0x4d1b9a){if(_0x4d1b9a){return _0x4d1b9a[_0x9b60('0x1f')]()[_0x9b60('0x20')](function(){var _0x51fa3c=_0x4d1b9a['get']({'plain':!![]});var _0x24435e=_0x9b60('0x21');return db[_0x9b60('0x22')][_0x9b60('0x1f')]({'where':{'type':_0x24435e,'resourceId':_0x51fa3c['id']}})[_0x9b60('0x20')](function(){return _0x4d1b9a;});})[_0x9b60('0x20')](function(){_0xd3ee75[_0x9b60('0x18')](0xcc)[_0x9b60('0x23')]();});}};}function handleEntityNotFound(_0x3b20e4,_0x42f854){return function(_0x1b6704){if(!_0x1b6704){_0x3b20e4[_0x9b60('0x17')](0x194);}return _0x1b6704;};}function handleError(_0x4ac114,_0x153311){_0x153311=_0x153311||0x1f4;return function(_0x42bc0a){logger['error'](_0x42bc0a[_0x9b60('0x24')]);if(_0x42bc0a[_0x9b60('0x25')]){delete _0x42bc0a[_0x9b60('0x25')];}_0x4ac114[_0x9b60('0x18')](_0x153311)[_0x9b60('0x26')](_0x42bc0a);};}exports[_0x9b60('0x27')]=function(_0x4d1fe1,_0x124660){var _0x895944={},_0x518551={},_0x13b1bc={'count':0x0,'rows':[]};var _0x3e2a5a=db[_0x9b60('0x28')][_0x9b60('0x29')];_0x518551['model']=_['keys'](_0x3e2a5a);_0x518551['query']=_[_0x9b60('0x2a')](_0x4d1fe1[_0x9b60('0x2b')]);_0x518551[_0x9b60('0x2c')]=_[_0x9b60('0x2d')](_0x518551[_0x9b60('0x2e')],_0x518551[_0x9b60('0x2b')]);_0x895944[_0x9b60('0x2f')]=_[_0x9b60('0x2d')](_0x518551[_0x9b60('0x2e')],qs[_0x9b60('0x30')](_0x4d1fe1['query']['fields']));_0x895944[_0x9b60('0x2f')]=_0x895944[_0x9b60('0x2f')][_0x9b60('0x31')]?_0x895944[_0x9b60('0x2f')]:_0x518551[_0x9b60('0x2e')];if(!_0x4d1fe1['query']['hasOwnProperty'](_0x9b60('0x32'))){_0x895944[_0x9b60('0x33')]=qs[_0x9b60('0x33')](_0x4d1fe1[_0x9b60('0x2b')][_0x9b60('0x33')]);_0x895944['offset']=qs[_0x9b60('0x19')](_0x4d1fe1['query'][_0x9b60('0x19')]);}_0x895944[_0x9b60('0x34')]=qs[_0x9b60('0x35')](_0x4d1fe1[_0x9b60('0x2b')][_0x9b60('0x35')]);_0x895944['where']=qs[_0x9b60('0x2c')](_[_0x9b60('0x36')](_0x4d1fe1[_0x9b60('0x2b')],_0x518551[_0x9b60('0x2c')]));if(_0x4d1fe1[_0x9b60('0x2b')][_0x9b60('0x37')]){_0x895944[_0x9b60('0x38')]=_[_0x9b60('0x39')](_0x895944[_0x9b60('0x38')],{'$or':_[_0x9b60('0x3a')](_0x3e2a5a,function(_0x50be36){if(_0x50be36[_0x9b60('0x3b')][_0x9b60('0x3c')]!==_0x9b60('0x3d')){var _0x26986c={};_0x26986c[_0x50be36[_0x9b60('0x3e')]]={'$like':'%'+_0x4d1fe1[_0x9b60('0x2b')][_0x9b60('0x37')]+'%'};return _0x26986c;}})});}_0x895944=_[_0x9b60('0x39')]({},_0x895944,_0x4d1fe1[_0x9b60('0x3f')]);var _0x30da49={'where':_0x895944['where']};return db[_0x9b60('0x28')][_0x9b60('0x40')](_0x30da49)['then'](function(_0x5c512c){_0x13b1bc['count']=_0x5c512c;if(_0x4d1fe1[_0x9b60('0x2b')][_0x9b60('0x41')]){_0x895944[_0x9b60('0x42')]=[{'all':!![]}];}return db[_0x9b60('0x28')][_0x9b60('0x43')](_0x895944);})['then'](function(_0x1c5ee8){_0x13b1bc['rows']=_0x1c5ee8;return _0x13b1bc;})[_0x9b60('0x20')](respondWithFilteredResult(_0x124660,_0x895944))[_0x9b60('0x44')](handleError(_0x124660,null));};exports['show']=function(_0x37aef7,_0x1ce4cb){var _0x11b40f={'raw':!![],'where':{'id':_0x37aef7[_0x9b60('0x45')]['id']}},_0x251574={};_0x251574['model']=_[_0x9b60('0x2a')](db[_0x9b60('0x28')][_0x9b60('0x29')]);_0x251574[_0x9b60('0x2b')]=_[_0x9b60('0x2a')](_0x37aef7[_0x9b60('0x2b')]);_0x251574[_0x9b60('0x2c')]=_[_0x9b60('0x2d')](_0x251574[_0x9b60('0x2e')],_0x251574['query']);_0x11b40f['attributes']=_[_0x9b60('0x2d')](_0x251574['model'],qs['fields'](_0x37aef7[_0x9b60('0x2b')]['fields']));_0x11b40f[_0x9b60('0x2f')]=_0x11b40f[_0x9b60('0x2f')][_0x9b60('0x31')]?_0x11b40f[_0x9b60('0x2f')]:_0x251574[_0x9b60('0x2e')];if(_0x37aef7['query'][_0x9b60('0x41')]){_0x11b40f[_0x9b60('0x42')]=[{'all':!![]}];}_0x11b40f=_[_0x9b60('0x39')]({},_0x11b40f,_0x37aef7[_0x9b60('0x3f')]);return db[_0x9b60('0x28')][_0x9b60('0x46')](_0x11b40f)[_0x9b60('0x20')](handleEntityNotFound(_0x1ce4cb,null))['then'](respondWithResult(_0x1ce4cb,null))['catch'](handleError(_0x1ce4cb,null));};exports[_0x9b60('0x47')]=function(_0xd1d67c,_0x3d7624){return db['Disposition']['create'](_0xd1d67c[_0x9b60('0x48')],{})[_0x9b60('0x20')](function(_0x1a1291){var _0xf99ade=_0xd1d67c[_0x9b60('0x49')][_0x9b60('0x4a')]({'plain':!![]});if(!_0xf99ade)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf99ade[_0x9b60('0x4b')]===_0x9b60('0x49')){var _0x497689=_0x1a1291['get']({'plain':!![]});var _0x3f2bad=_0x9b60('0x21');return db[_0x9b60('0x4c')][_0x9b60('0x46')]({'where':{'name':_0x3f2bad,'userProfileId':_0xf99ade[_0x9b60('0x4d')]},'raw':!![]})['then'](function(_0x4a67a4){if(_0x4a67a4&&_0x4a67a4[_0x9b60('0x4e')]===0x0){return db[_0x9b60('0x22')][_0x9b60('0x47')]({'name':_0x497689[_0x9b60('0x25')],'resourceId':_0x497689['id'],'type':_0x4a67a4['name'],'sectionId':_0x4a67a4['id']},{})[_0x9b60('0x20')](function(){return _0x1a1291;});}else{return _0x1a1291;}})[_0x9b60('0x44')](function(_0x5c7c5e){logger['error'](_0x9b60('0x4f'),_0x5c7c5e);throw _0x5c7c5e;});}return _0x1a1291;})[_0x9b60('0x20')](respondWithResult(_0x3d7624,0xc9))['catch'](handleError(_0x3d7624,null));};exports[_0x9b60('0x1e')]=function(_0x2ee0b0,_0x1fc7c7){if(_0x2ee0b0[_0x9b60('0x48')]['id']){delete _0x2ee0b0[_0x9b60('0x48')]['id'];}return db['Disposition'][_0x9b60('0x46')]({'where':{'id':_0x2ee0b0[_0x9b60('0x45')]['id']}})[_0x9b60('0x20')](handleEntityNotFound(_0x1fc7c7,null))[_0x9b60('0x20')](saveUpdates(_0x2ee0b0[_0x9b60('0x48')],null))[_0x9b60('0x20')](respondWithResult(_0x1fc7c7,null))[_0x9b60('0x44')](handleError(_0x1fc7c7,null));};exports[_0x9b60('0x1f')]=function(_0x4a7402,_0x5a027f){return db[_0x9b60('0x28')]['find']({'where':{'id':_0x4a7402[_0x9b60('0x45')]['id']}})[_0x9b60('0x20')](handleEntityNotFound(_0x5a027f,null))['then'](removeEntity(_0x5a027f,null))[_0x9b60('0x44')](handleError(_0x5a027f,null));}; \ No newline at end of file +var _0x94d0=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','apply','reject','save','update','then','get','Dispositions','UserProfileResource','destroy','status','error','name','send','index','Disposition','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','show','params','length','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x56e89d,_0x8ddb11){var _0x3caa2d=function(_0x25e839){while(--_0x25e839){_0x56e89d['push'](_0x56e89d['shift']());}};_0x3caa2d(++_0x8ddb11);}(_0x94d0,0x185));var _0x094d=function(_0x296c7e,_0x534032){_0x296c7e=_0x296c7e-0x0;var _0x299a8f=_0x94d0[_0x296c7e];return _0x299a8f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x094d('0x0'));var rimraf=require(_0x094d('0x1'));var zipdir=require(_0x094d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x094d('0x3'));var util=require(_0x094d('0x4'));var path=require(_0x094d('0x5'));var sox=require('sox');var csv=require(_0x094d('0x6'));var ejs=require(_0x094d('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x094d('0x8'));var crypto=require(_0x094d('0x9'));var jsforce=require(_0x094d('0xa'));var deskjs=require(_0x094d('0xb'));var toCsv=require(_0x094d('0x6'));var querystring=require(_0x094d('0xc'));var Papa=require(_0x094d('0xd'));var Redis=require(_0x094d('0xe'));var authService=require(_0x094d('0xf'));var qs=require(_0x094d('0x10'));var hardwareService=require(_0x094d('0x11'));var logger=require(_0x094d('0x12'))(_0x094d('0x13'));var utils=require(_0x094d('0x14'));var config=require(_0x094d('0x15'));var db=require(_0x094d('0x16'))['db'];function respondWithStatusCode(_0x4c6153,_0x552678){_0x552678=_0x552678||0xcc;return function(_0x45c628){if(_0x45c628){return _0x4c6153[_0x094d('0x17')](_0x552678);}return _0x4c6153['status'](_0x552678)[_0x094d('0x18')]();};}function respondWithResult(_0x5d6789,_0x10feb4){_0x10feb4=_0x10feb4||0xc8;return function(_0x11aa9f){if(_0x11aa9f){return _0x5d6789['status'](_0x10feb4)[_0x094d('0x19')](_0x11aa9f);}};}function respondWithFilteredResult(_0xd88b1c,_0x41f923){return function(_0x4d5c10){if(_0x4d5c10){var _0x2752af=_0x4d5c10[_0x094d('0x1a')],_0x1ee1bf=_0x41f923[_0x094d('0x1b')],_0xc013f0=_0x41f923[_0x094d('0x1b')]+_0x41f923['limit'],_0xc1fc10;if(_0xc013f0>=_0x2752af){_0xc013f0=_0x2752af;_0xc1fc10=0xc8;}else{_0xc1fc10=0xce;}_0xd88b1c['status'](_0xc1fc10);return _0xd88b1c['set']('Content-Range',_0x1ee1bf+'-'+_0xc013f0+'/'+_0x2752af)['json'](_0x4d5c10);}return null;};}function patchUpdates(_0x584f98){return function(_0x3ed445){try{jsonpatch[_0x094d('0x1c')](_0x3ed445,_0x584f98,!![]);}catch(_0x3656d4){return BPromise[_0x094d('0x1d')](_0x3656d4);}return _0x3ed445[_0x094d('0x1e')]();};}function saveUpdates(_0x261efa,_0x4817d8){return function(_0x5bd1b6){if(_0x5bd1b6){return _0x5bd1b6[_0x094d('0x1f')](_0x261efa)[_0x094d('0x20')](function(_0x46a2d3){return _0x46a2d3;});}return null;};}function removeEntity(_0x5a3d88,_0x5a0102){return function(_0x64db81){if(_0x64db81){return _0x64db81['destroy']()[_0x094d('0x20')](function(){var _0x4c309d=_0x64db81[_0x094d('0x21')]({'plain':!![]});var _0x3b1c50=_0x094d('0x22');return db[_0x094d('0x23')][_0x094d('0x24')]({'where':{'type':_0x3b1c50,'resourceId':_0x4c309d['id']}})[_0x094d('0x20')](function(){return _0x64db81;});})[_0x094d('0x20')](function(){_0x5a3d88[_0x094d('0x25')](0xcc)[_0x094d('0x18')]();});}};}function handleEntityNotFound(_0x158618,_0x2f09e6){return function(_0x1dfff0){if(!_0x1dfff0){_0x158618[_0x094d('0x17')](0x194);}return _0x1dfff0;};}function handleError(_0x59cdb8,_0x2aaf39){_0x2aaf39=_0x2aaf39||0x1f4;return function(_0x4a4f95){logger[_0x094d('0x26')](_0x4a4f95['stack']);if(_0x4a4f95['name']){delete _0x4a4f95[_0x094d('0x27')];}_0x59cdb8['status'](_0x2aaf39)[_0x094d('0x28')](_0x4a4f95);};}exports[_0x094d('0x29')]=function(_0x17164f,_0x5ca4c1){var _0x153a66={},_0x106ad3={},_0x40e294={'count':0x0,'rows':[]};var _0x1cea28=db[_0x094d('0x2a')]['rawAttributes'];_0x106ad3['model']=_[_0x094d('0x2b')](_0x1cea28);_0x106ad3[_0x094d('0x2c')]=_['keys'](_0x17164f[_0x094d('0x2c')]);_0x106ad3[_0x094d('0x2d')]=_[_0x094d('0x2e')](_0x106ad3[_0x094d('0x2f')],_0x106ad3[_0x094d('0x2c')]);_0x153a66[_0x094d('0x30')]=_['intersection'](_0x106ad3[_0x094d('0x2f')],qs[_0x094d('0x31')](_0x17164f[_0x094d('0x2c')][_0x094d('0x31')]));_0x153a66[_0x094d('0x30')]=_0x153a66['attributes']['length']?_0x153a66[_0x094d('0x30')]:_0x106ad3[_0x094d('0x2f')];if(!_0x17164f['query'][_0x094d('0x32')](_0x094d('0x33'))){_0x153a66[_0x094d('0x34')]=qs[_0x094d('0x34')](_0x17164f[_0x094d('0x2c')][_0x094d('0x34')]);_0x153a66[_0x094d('0x1b')]=qs['offset'](_0x17164f[_0x094d('0x2c')][_0x094d('0x1b')]);}_0x153a66['order']=qs[_0x094d('0x35')](_0x17164f[_0x094d('0x2c')][_0x094d('0x35')]);_0x153a66[_0x094d('0x36')]=qs[_0x094d('0x2d')](_[_0x094d('0x37')](_0x17164f['query'],_0x106ad3[_0x094d('0x2d')]));if(_0x17164f[_0x094d('0x2c')][_0x094d('0x38')]){_0x153a66['where']=_[_0x094d('0x39')](_0x153a66[_0x094d('0x36')],{'$or':_[_0x094d('0x3a')](_0x1cea28,function(_0x5aca58){if(_0x5aca58[_0x094d('0x3b')][_0x094d('0x3c')]!==_0x094d('0x3d')){var _0x3d44e5={};_0x3d44e5[_0x5aca58[_0x094d('0x3e')]]={'$like':'%'+_0x17164f[_0x094d('0x2c')][_0x094d('0x38')]+'%'};return _0x3d44e5;}})});}_0x153a66=_['merge']({},_0x153a66,_0x17164f[_0x094d('0x3f')]);var _0x48b310={'where':_0x153a66[_0x094d('0x36')]};return db[_0x094d('0x2a')][_0x094d('0x1a')](_0x48b310)[_0x094d('0x20')](function(_0x2f49d5){_0x40e294['count']=_0x2f49d5;if(_0x17164f[_0x094d('0x2c')][_0x094d('0x40')]){_0x153a66[_0x094d('0x41')]=[{'all':!![]}];}return db[_0x094d('0x2a')][_0x094d('0x42')](_0x153a66);})[_0x094d('0x20')](function(_0x3931ae){_0x40e294['rows']=_0x3931ae;return _0x40e294;})[_0x094d('0x20')](respondWithFilteredResult(_0x5ca4c1,_0x153a66))['catch'](handleError(_0x5ca4c1,null));};exports[_0x094d('0x43')]=function(_0x52f07e,_0x3edd1c){var _0x7f0efd={'raw':!![],'where':{'id':_0x52f07e[_0x094d('0x44')]['id']}},_0x5c5675={};_0x5c5675[_0x094d('0x2f')]=_[_0x094d('0x2b')](db[_0x094d('0x2a')]['rawAttributes']);_0x5c5675[_0x094d('0x2c')]=_['keys'](_0x52f07e['query']);_0x5c5675[_0x094d('0x2d')]=_['intersection'](_0x5c5675[_0x094d('0x2f')],_0x5c5675[_0x094d('0x2c')]);_0x7f0efd['attributes']=_[_0x094d('0x2e')](_0x5c5675[_0x094d('0x2f')],qs[_0x094d('0x31')](_0x52f07e[_0x094d('0x2c')][_0x094d('0x31')]));_0x7f0efd[_0x094d('0x30')]=_0x7f0efd['attributes'][_0x094d('0x45')]?_0x7f0efd[_0x094d('0x30')]:_0x5c5675[_0x094d('0x2f')];if(_0x52f07e[_0x094d('0x2c')]['includeAll']){_0x7f0efd[_0x094d('0x41')]=[{'all':!![]}];}_0x7f0efd=_[_0x094d('0x39')]({},_0x7f0efd,_0x52f07e['options']);return db['Disposition'][_0x094d('0x46')](_0x7f0efd)['then'](handleEntityNotFound(_0x3edd1c,null))['then'](respondWithResult(_0x3edd1c,null))[_0x094d('0x47')](handleError(_0x3edd1c,null));};exports['create']=function(_0x793551,_0x56abc7){return db['Disposition']['create'](_0x793551[_0x094d('0x48')],{})[_0x094d('0x20')](function(_0xc71f8){var _0x5a63dd=_0x793551[_0x094d('0x49')][_0x094d('0x21')]({'plain':!![]});if(!_0x5a63dd)throw new Error(_0x094d('0x4a'));if(_0x5a63dd[_0x094d('0x4b')]===_0x094d('0x49')){var _0x3ac3f8=_0xc71f8[_0x094d('0x21')]({'plain':!![]});var _0x37fd62=_0x094d('0x22');return db[_0x094d('0x4c')][_0x094d('0x46')]({'where':{'name':_0x37fd62,'userProfileId':_0x5a63dd[_0x094d('0x4d')]},'raw':!![]})[_0x094d('0x20')](function(_0xc38107){if(_0xc38107&&_0xc38107[_0x094d('0x4e')]===0x0){return db[_0x094d('0x23')][_0x094d('0x4f')]({'name':_0x3ac3f8[_0x094d('0x27')],'resourceId':_0x3ac3f8['id'],'type':_0xc38107['name'],'sectionId':_0xc38107['id']},{})[_0x094d('0x20')](function(){return _0xc71f8;});}else{return _0xc71f8;}})[_0x094d('0x47')](function(_0x5823ac){logger['error'](_0x094d('0x50'),_0x5823ac);throw _0x5823ac;});}return _0xc71f8;})[_0x094d('0x20')](respondWithResult(_0x56abc7,0xc9))[_0x094d('0x47')](handleError(_0x56abc7,null));};exports[_0x094d('0x1f')]=function(_0x48432e,_0x13d0fd){if(_0x48432e[_0x094d('0x48')]['id']){delete _0x48432e[_0x094d('0x48')]['id'];}return db[_0x094d('0x2a')]['find']({'where':{'id':_0x48432e['params']['id']}})['then'](handleEntityNotFound(_0x13d0fd,null))[_0x094d('0x20')](saveUpdates(_0x48432e[_0x094d('0x48')],null))['then'](respondWithResult(_0x13d0fd,null))[_0x094d('0x47')](handleError(_0x13d0fd,null));};exports['destroy']=function(_0x3b6f6c,_0x4329a5){return db[_0x094d('0x2a')][_0x094d('0x46')]({'where':{'id':_0x3b6f6c[_0x094d('0x44')]['id']}})['then'](handleEntityNotFound(_0x4329a5,null))[_0x094d('0x20')](removeEntity(_0x4329a5,null))[_0x094d('0x47')](handleError(_0x4329a5,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 39d2ecd..4270a12 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 _0x73a1=['name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId'];(function(_0x3113d2,_0x3aa779){var _0x225145=function(_0xbc58ec){while(--_0xbc58ec){_0x3113d2['push'](_0x3113d2['shift']());}};_0x225145(++_0x3aa779);}(_0x73a1,0x1ae));var _0x173a=function(_0x438912,_0x3f7f74){_0x438912=_0x438912-0x0;var _0x18112f=_0x73a1[_0x438912];return _0x18112f;};'use strict';var _=require(_0x173a('0x0'));var util=require(_0x173a('0x1'));var logger=require(_0x173a('0x2'))(_0x173a('0x3'));var moment=require(_0x173a('0x4'));var BPromise=require(_0x173a('0x5'));var rp=require(_0x173a('0x6'));var fs=require('fs');var path=require(_0x173a('0x7'));var rimraf=require(_0x173a('0x8'));var config=require(_0x173a('0x9'));var attributes=require(_0x173a('0xa'));module[_0x173a('0xb')]=function(_0x56f62d,_0x3065d1){return _0x56f62d['define']('Disposition',attributes,{'tableName':_0x173a('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x173a('0xd'),'fields':[_0x173a('0xe'),_0x173a('0xf')]},{'unique':!![],'name':_0x173a('0x10'),'fields':[_0x173a('0xe'),_0x173a('0x11')]},{'unique':!![],'name':_0x173a('0x12'),'fields':[_0x173a('0xe'),_0x173a('0x13')]},{'unique':!![],'name':_0x173a('0x14'),'fields':[_0x173a('0xe'),_0x173a('0x15')]},{'unique':!![],'name':_0x173a('0x16'),'fields':[_0x173a('0xe'),'FaxAccountId']},{'unique':!![],'name':_0x173a('0x17'),'fields':['name',_0x173a('0x18')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe3f3=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./disposition.attributes','exports','Disposition','name_voice','name','ListId','name_chat','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','util'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xe3f3,0x11e));var _0x3e3f=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xe3f3[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0x3e3f('0x0'));var util=require(_0x3e3f('0x1'));var logger=require(_0x3e3f('0x2'))(_0x3e3f('0x3'));var moment=require(_0x3e3f('0x4'));var BPromise=require(_0x3e3f('0x5'));var rp=require(_0x3e3f('0x6'));var fs=require('fs');var path=require(_0x3e3f('0x7'));var rimraf=require('rimraf');var config=require(_0x3e3f('0x8'));var attributes=require(_0x3e3f('0x9'));module[_0x3e3f('0xa')]=function(_0x21959e,_0xfd12a3){return _0x21959e['define'](_0x3e3f('0xb'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x3e3f('0xc'),'fields':[_0x3e3f('0xd'),_0x3e3f('0xe')]},{'unique':!![],'name':_0x3e3f('0xf'),'fields':[_0x3e3f('0xd'),_0x3e3f('0x10')]},{'unique':!![],'name':'name_mail','fields':['name',_0x3e3f('0x11')]},{'unique':!![],'name':_0x3e3f('0x12'),'fields':[_0x3e3f('0xd'),_0x3e3f('0x13')]},{'unique':!![],'name':_0x3e3f('0x14'),'fields':['name',_0x3e3f('0x15')]},{'unique':!![],'name':_0x3e3f('0x16'),'fields':[_0x3e3f('0xd'),_0x3e3f('0x17')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index f31e7b4..1562a89 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 _0xed1f=['request','then','info','Disposition,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4cf6c5,_0x122acc){var _0x162745=function(_0x4bd6d8){while(--_0x4bd6d8){_0x4cf6c5['push'](_0x4cf6c5['shift']());}};_0x162745(++_0x122acc);}(_0xed1f,0x6a));var _0xfed1=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0xed1f[_0x4c445a];return _0x2f611c;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var moment=require(_0xfed1('0x2'));var BPromise=require(_0xfed1('0x3'));var rs=require(_0xfed1('0x4'));var fs=require('fs');var Redis=require(_0xfed1('0x5'));var db=require(_0xfed1('0x6'))['db'];var utils=require(_0xfed1('0x7'));var logger=require(_0xfed1('0x8'))(_0xfed1('0x9'));var config=require(_0xfed1('0xa'));var jayson=require(_0xfed1('0xb'));var client=jayson[_0xfed1('0xc')][_0xfed1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x380e18,_0x612b38,_0x2a6082){return new BPromise(function(_0x2967ef,_0x568d48){return client[_0xfed1('0xe')](_0x380e18,_0x2a6082)[_0xfed1('0xf')](function(_0x48862d){logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,'request\x20sent');logger[_0xfed1('0x12')]('Disposition,\x20%s,\x20%s,\x20%s',_0x612b38,_0xfed1('0x13'),JSON[_0xfed1('0x14')](_0x48862d));if(_0x48862d['error']){if(_0x48862d['error'][_0xfed1('0x15')]===0x1f4){logger[_0xfed1('0x16')]('Disposition,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x568d48(_0x48862d['error'][_0xfed1('0x17')]);}logger[_0xfed1('0x16')]('Disposition,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x2967ef(_0x48862d['error'][_0xfed1('0x17')]);}else{logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,_0xfed1('0x13'));_0x2967ef(_0x48862d['result'][_0xfed1('0x17')]);}})['catch'](function(_0x36ff34){logger[_0xfed1('0x16')]('Disposition,\x20%s,\x20%s',_0x612b38,_0x36ff34);_0x568d48(_0x36ff34);});});} \ No newline at end of file +var _0xf8b2=['code','Disposition,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','error'];(function(_0x10ce19,_0x183f9c){var _0x223284=function(_0x445fd5){while(--_0x445fd5){_0x10ce19['push'](_0x10ce19['shift']());}};_0x223284(++_0x183f9c);}(_0xf8b2,0x15e));var _0x2f8b=function(_0x205729,_0x3e7a6c){_0x205729=_0x205729-0x0;var _0x443679=_0xf8b2[_0x205729];return _0x443679;};'use strict';var _=require(_0x2f8b('0x0'));var util=require(_0x2f8b('0x1'));var moment=require(_0x2f8b('0x2'));var BPromise=require(_0x2f8b('0x3'));var rs=require(_0x2f8b('0x4'));var fs=require('fs');var Redis=require(_0x2f8b('0x5'));var db=require(_0x2f8b('0x6'))['db'];var utils=require(_0x2f8b('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x2f8b('0x8'));var jayson=require(_0x2f8b('0x9'));var client=jayson[_0x2f8b('0xa')][_0x2f8b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b0511,_0x2cc1e9,_0x449c86){return new BPromise(function(_0x24bd39,_0x366bac){return client['request'](_0x3b0511,_0x449c86)[_0x2f8b('0xc')](function(_0xb352e8){logger[_0x2f8b('0xd')]('Disposition,\x20%s,\x20%s',_0x2cc1e9,_0x2f8b('0xe'));logger[_0x2f8b('0xf')](_0x2f8b('0x10'),_0x2cc1e9,'request\x20sent',JSON['stringify'](_0xb352e8));if(_0xb352e8[_0x2f8b('0x11')]){if(_0xb352e8[_0x2f8b('0x11')][_0x2f8b('0x12')]===0x1f4){logger[_0x2f8b('0x11')](_0x2f8b('0x13'),_0x2cc1e9,_0xb352e8['error'][_0x2f8b('0x14')]);return _0x366bac(_0xb352e8['error'][_0x2f8b('0x14')]);}logger[_0x2f8b('0x11')](_0x2f8b('0x13'),_0x2cc1e9,_0xb352e8[_0x2f8b('0x11')][_0x2f8b('0x14')]);return _0x24bd39(_0xb352e8[_0x2f8b('0x11')][_0x2f8b('0x14')]);}else{logger[_0x2f8b('0xd')]('Disposition,\x20%s,\x20%s',_0x2cc1e9,_0x2f8b('0xe'));_0x24bd39(_0xb352e8[_0x2f8b('0x15')][_0x2f8b('0x14')]);}})[_0x2f8b('0x16')](function(_0xa79a7){logger[_0x2f8b('0x11')](_0x2f8b('0x13'),_0x2cc1e9,_0xa79a7);_0x366bac(_0xa79a7);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 24fd51a..8ed5f13 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 _0xace0=['show','post','create','put','delete','destroy','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id'];(function(_0x245ff8,_0x2e81f8){var _0x5a4faa=function(_0x26af9e){while(--_0x26af9e){_0x245ff8['push'](_0x245ff8['shift']());}};_0x5a4faa(++_0x2e81f8);}(_0xace0,0xf4));var _0x0ace=function(_0x109b6e,_0xbf489f){_0x109b6e=_0x109b6e-0x0;var _0x1e8595=_0xace0[_0x109b6e];return _0x1e8595;};'use strict';var multer=require('multer');var util=require(_0x0ace('0x0'));var path=require(_0x0ace('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x0ace('0x2'));var interaction=require(_0x0ace('0x3'));var config=require(_0x0ace('0x4'));var controller=require('./disposition.controller');router['get']('/',auth[_0x0ace('0x5')](),controller[_0x0ace('0x6')]);router['get'](_0x0ace('0x7'),auth['isAuthenticated'](),controller[_0x0ace('0x8')]);router[_0x0ace('0x9')]('/',auth[_0x0ace('0x5')](),controller[_0x0ace('0xa')]);router[_0x0ace('0xb')]('/:id',auth[_0x0ace('0x5')](),controller['update']);router[_0x0ace('0xc')](_0x0ace('0x7'),auth[_0x0ace('0x5')](),controller[_0x0ace('0xd')]);module['exports']=router; \ No newline at end of file +var _0x7bfe=['../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','/:id','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7bfe,0x12b));var _0xe7bf=function(_0xc75f9d,_0x506d32){_0xc75f9d=_0xc75f9d-0x0;var _0x101d81=_0x7bfe[_0xc75f9d];return _0x101d81;};'use strict';var multer=require(_0xe7bf('0x0'));var util=require(_0xe7bf('0x1'));var path=require(_0xe7bf('0x2'));var timeout=require(_0xe7bf('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xe7bf('0x4'));var interaction=require(_0xe7bf('0x5'));var config=require(_0xe7bf('0x6'));var controller=require(_0xe7bf('0x7'));router[_0xe7bf('0x8')]('/',auth[_0xe7bf('0x9')](),controller['index']);router[_0xe7bf('0x8')](_0xe7bf('0xa'),auth[_0xe7bf('0x9')](),controller['show']);router['post']('/',auth[_0xe7bf('0x9')](),controller['create']);router[_0xe7bf('0xb')](_0xe7bf('0xa'),auth[_0xe7bf('0x9')](),controller[_0xe7bf('0xc')]);router[_0xe7bf('0xd')](_0xe7bf('0xa'),auth['isAuthenticated'](),controller[_0xe7bf('0xe')]);module[_0xe7bf('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 2959912..32506db 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 _0x41bd=['12000','14400','v17,v27,v29','INTEGER','IAX','KHOMP','SIP','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x41bd,0xd2));var _0xd41b=function(_0x9749d1,_0xe8a1d9){_0x9749d1=_0x9749d1-0x0;var _0x4a356d=_0x41bd[_0x9749d1];return _0x4a356d;};'use strict';var Sequelize=require(_0xd41b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd41b('0x1')]},'ecm':{'type':Sequelize[_0xd41b('0x2')]('yes','no'),'defaultValue':_0xd41b('0x3')},'headerinfo':{'type':Sequelize[_0xd41b('0x1')],'defaultValue':_0xd41b('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xd41b('0x5')},'minrate':{'type':Sequelize[_0xd41b('0x2')](_0xd41b('0x6'),_0xd41b('0x7'),_0xd41b('0x8'),_0xd41b('0x9'),_0xd41b('0xa'),_0xd41b('0xb')),'defaultValue':_0xd41b('0x7')},'maxrate':{'type':Sequelize[_0xd41b('0x2')](_0xd41b('0x6'),_0xd41b('0x7'),_0xd41b('0x8'),_0xd41b('0x9'),'12000',_0xd41b('0xb')),'defaultValue':_0xd41b('0xb')},'modem':{'type':Sequelize[_0xd41b('0x1')],'defaultValue':_0xd41b('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xd41b('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xd41b('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xd41b('0x2')]('SIP',_0xd41b('0xe'),'DADHI',_0xd41b('0xf')),'defaultValue':_0xd41b('0x10')},'key':{'type':Sequelize[_0xd41b('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd41b('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd41b('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd41b('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd41b('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd41b('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd41b('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd41b('0xd')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xd41b('0x11')],'defaultValue':![],'comment':_0xd41b('0x12'),'set':function(_0x2d3097){if(!_0x2d3097)this[_0xd41b('0x13')](_0xd41b('0x14'),null);this['setDataValue'](_0xd41b('0x15'),_0x2d3097);}}}; \ No newline at end of file +var _0x0e73=['mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','7200','9600','12000','14400','4800','v17,v27,v29','INTEGER','IAX','KHOMP','SIP','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'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x0e73,0x115));var _0x30e7=function(_0x4ede04,_0x58132b){_0x4ede04=_0x4ede04-0x0;var _0x49ccfc=_0x0e73[_0x4ede04];return _0x49ccfc;};'use strict';var Sequelize=require('sequelize');module[_0x30e7('0x0')]={'name':{'type':Sequelize[_0x30e7('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x30e7('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0x30e7('0x2'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x30e7('0x1')],'defaultValue':_0x30e7('0x3')},'localstationid':{'type':Sequelize[_0x30e7('0x1')],'unique':_0x30e7('0x4')},'minrate':{'type':Sequelize[_0x30e7('0x5')](_0x30e7('0x6'),'4800',_0x30e7('0x7'),_0x30e7('0x8'),_0x30e7('0x9'),_0x30e7('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x30e7('0x5')]('2400',_0x30e7('0xb'),_0x30e7('0x7'),_0x30e7('0x8'),_0x30e7('0x9'),'14400'),'defaultValue':_0x30e7('0xa')},'modem':{'type':Sequelize[_0x30e7('0x1')],'defaultValue':_0x30e7('0xc')},'gateway':{'type':Sequelize[_0x30e7('0x1')],'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[_0x30e7('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x30e7('0x5')]('SIP',_0x30e7('0xe'),'DADHI',_0x30e7('0xf')),'defaultValue':_0x30e7('0x10')},'key':{'type':Sequelize[_0x30e7('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x30e7('0x11')],'defaultValue':function(){return _0x30e7('0x12');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x30e7('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x30e7('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x30e7('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x30e7('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x30e7('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x30e7('0x13')],'defaultValue':![],'comment':_0x30e7('0x15'),'set':function(_0x27cd51){if(!_0x27cd51)this[_0x30e7('0x16')](_0x30e7('0x17'),null);this[_0x30e7('0x16')](_0x30e7('0x18'),_0x27cd51);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index ae663a5..a3cfd34 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 _0xa6db=['omit','getInteractions','CmContact','Contact','User','Owner','internal','color','tag','addApplications','sequelize','transaction','FaxApplication','findAndCountAll','priority','getApplications','context','system','Fax\x20Extension','appdata','Answer','push','Set','localstationid','gateway','faxdetect','headerinfo','maxrate','minrate','modem','FAXOPT(','Wait','addAccountApplications','VoiceExtension','updateAccountApplications','bulkCreate','tech','createdAt','updatedAt','ListId','findById','getMessages','FaxMessage','$gte','split','format','Contacts','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','removeAgents','isArray','userFaxAccount:remove','emit','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./faxAccount.socket','register','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','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','FaxAccounts','stack','name','send','index','Pause','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','map','type','field','filter','options','FaxAccount','includeAll','include','findAll','params','mandatoryDispositionPause','keys','find','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addDisposition','FaxAccountId','Disposition','create','findOne','order','merge','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addInteraction','FaxInteraction'];(function(_0x34fcba,_0x2a0bee){var _0x5c4f41=function(_0x44b38b){while(--_0x44b38b){_0x34fcba['push'](_0x34fcba['shift']());}};_0x5c4f41(++_0x2a0bee);}(_0xa6db,0x104));var _0xba6d=function(_0x4ed991,_0x24b30a){_0x4ed991=_0x4ed991-0x0;var _0x15e642=_0xa6db[_0x4ed991];return _0x15e642;};'use strict';var pdf=require(_0xba6d('0x0'));var emlformat=require(_0xba6d('0x1'));var rimraf=require(_0xba6d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xba6d('0x3'));var rp=require(_0xba6d('0x4'));var moment=require(_0xba6d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xba6d('0x6'));var util=require('util');var path=require(_0xba6d('0x7'));var sox=require('sox');var csv=require(_0xba6d('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xba6d('0x9'));var squel=require(_0xba6d('0xa'));var crypto=require(_0xba6d('0xb'));var jsforce=require(_0xba6d('0xc'));var deskjs=require(_0xba6d('0xd'));var toCsv=require(_0xba6d('0x8'));var querystring=require(_0xba6d('0xe'));var Papa=require(_0xba6d('0xf'));var Redis=require(_0xba6d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xba6d('0x11'));var hardwareService=require(_0xba6d('0x12'));var logger=require('../../config/logger')(_0xba6d('0x13'));var utils=require(_0xba6d('0x14'));var config=require(_0xba6d('0x15'));var db=require(_0xba6d('0x16'))['db'];config[_0xba6d('0x17')]=_['defaults'](config[_0xba6d('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xba6d('0x18'))(new Redis(config[_0xba6d('0x17')]));require(_0xba6d('0x19'))[_0xba6d('0x1a')](socket);var jayson=require(_0xba6d('0x1b'));var client=jayson['client'][_0xba6d('0x1c')]({'port':0x232c});var client9002=jayson[_0xba6d('0x1d')][_0xba6d('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x17dfc5,_0x981580,_0x2461a7){if(_0x2461a7){var _0x2669a9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2669a9[_0xba6d('0x1e')](_0x981580)){return _0x17dfc5;}else{throw new Error(_0xba6d('0x1f'));}}else{return _0x17dfc5;}}function respondWithRpcPromise(_0x5b35a0,_0x262b7b,_0x27bda9,_0x1a09ed){return new BPromise(function(_0x512127,_0x4d7ac8){var _0x5c056f=_0x1a09ed||client;return _0x5c056f['request'](_0x5b35a0,_0x27bda9)[_0xba6d('0x20')](function(_0x4a1c64){logger[_0xba6d('0x21')](_0xba6d('0x22'),_0x262b7b,'request\x20sent');logger['debug'](_0xba6d('0x23'),_0x262b7b,_0xba6d('0x24'),JSON[_0xba6d('0x25')](_0x4a1c64));if(_0x4a1c64[_0xba6d('0x26')]){if(_0x4a1c64[_0xba6d('0x26')][_0xba6d('0x27')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x262b7b,_0x4a1c64[_0xba6d('0x26')][_0xba6d('0x28')]);return _0x4d7ac8(_0x4a1c64[_0xba6d('0x26')][_0xba6d('0x28')]);}logger['error'](_0xba6d('0x22'),_0x262b7b,_0x4a1c64[_0xba6d('0x26')][_0xba6d('0x28')]);return _0x512127(_0x4a1c64[_0xba6d('0x26')][_0xba6d('0x28')]);}else{logger[_0xba6d('0x21')](_0xba6d('0x22'),_0x262b7b,_0xba6d('0x24'));_0x512127(_0x4a1c64['result']['message']);}})[_0xba6d('0x29')](function(_0x2a434b){logger[_0xba6d('0x26')]('FaxAccount,\x20%s,\x20%s',_0x262b7b,_0x2a434b);_0x4d7ac8(_0x2a434b);});});}function respondWithStatusCode(_0xb0104f,_0x4d355d){_0x4d355d=_0x4d355d||0xcc;return function(_0x1434b8){if(_0x1434b8){return _0xb0104f[_0xba6d('0x2a')](_0x4d355d);}return _0xb0104f[_0xba6d('0x2b')](_0x4d355d)[_0xba6d('0x2c')]();};}function respondWithResult(_0x4365c3,_0x15e979){_0x15e979=_0x15e979||0xc8;return function(_0x120695){if(_0x120695){return _0x4365c3['status'](_0x15e979)[_0xba6d('0x2d')](_0x120695);}};}function respondWithFilteredResult(_0x436f40,_0x90a871){return function(_0x46ebfe){if(_0x46ebfe){var _0x5b0a57=_0x46ebfe[_0xba6d('0x2e')],_0x12c7df=_0x90a871[_0xba6d('0x2f')],_0x269bd9=_0x90a871['offset']+_0x90a871[_0xba6d('0x30')],_0x3b01c6;if(_0x269bd9>=_0x5b0a57){_0x269bd9=_0x5b0a57;_0x3b01c6=0xc8;}else{_0x3b01c6=0xce;}_0x436f40['status'](_0x3b01c6);return _0x436f40[_0xba6d('0x31')]('Content-Range',_0x12c7df+'-'+_0x269bd9+'/'+_0x5b0a57)[_0xba6d('0x2d')](_0x46ebfe);}return null;};}function patchUpdates(_0x4c7436){return function(_0x2f6d43){try{jsonpatch[_0xba6d('0x32')](_0x2f6d43,_0x4c7436,!![]);}catch(_0x62de25){return BPromise[_0xba6d('0x33')](_0x62de25);}return _0x2f6d43[_0xba6d('0x34')]();};}function saveUpdates(_0x18246e,_0x1d7339){return function(_0x404765){if(_0x404765){return _0x404765[_0xba6d('0x35')](_0x18246e)[_0xba6d('0x20')](function(_0x16caf3){return _0x16caf3;});}return null;};}function removeEntity(_0x11cb89,_0x3cc5ab){return function(_0x7ed8f8){if(_0x7ed8f8){return _0x7ed8f8[_0xba6d('0x36')]()[_0xba6d('0x20')](function(){var _0x1171b2=_0x7ed8f8['get']({'plain':!![]});var _0x63166e=_0xba6d('0x37');return db['UserProfileResource'][_0xba6d('0x36')]({'where':{'type':_0x63166e,'resourceId':_0x1171b2['id']}})[_0xba6d('0x20')](function(){return _0x7ed8f8;});})[_0xba6d('0x20')](function(){_0x11cb89['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x54b72a,_0x1721d9){return function(_0x55dff8){if(!_0x55dff8){_0x54b72a['sendStatus'](0x194);}return _0x55dff8;};}function handleError(_0x1816cb,_0x2cb45c){_0x2cb45c=_0x2cb45c||0x1f4;return function(_0x157165){logger['error'](_0x157165[_0xba6d('0x38')]);if(_0x157165['name']){delete _0x157165[_0xba6d('0x39')];}_0x1816cb[_0xba6d('0x2b')](_0x2cb45c)[_0xba6d('0x3a')](_0x157165);};}exports[_0xba6d('0x3b')]=function(_0x542e38,_0xab1fe4){var _0xaf73fc={'include':[{'model':db[_0xba6d('0x3c')],'as':'mandatoryDispositionPause'}]},_0x5108ba={},_0x3b34a9={'count':0x0,'rows':[]};var _0x29d94b=db['FaxAccount'][_0xba6d('0x3d')];_0x5108ba[_0xba6d('0x3e')]=_['keys'](_0x29d94b);_0x5108ba['query']=_['keys'](_0x542e38[_0xba6d('0x3f')]);_0x5108ba[_0xba6d('0x40')]=_[_0xba6d('0x41')](_0x5108ba[_0xba6d('0x3e')],_0x5108ba['query']);_0xaf73fc[_0xba6d('0x42')]=_[_0xba6d('0x41')](_0x5108ba[_0xba6d('0x3e')],qs[_0xba6d('0x43')](_0x542e38[_0xba6d('0x3f')][_0xba6d('0x43')]));_0xaf73fc[_0xba6d('0x42')]=_0xaf73fc[_0xba6d('0x42')][_0xba6d('0x44')]?_0xaf73fc['attributes']:_0x5108ba[_0xba6d('0x3e')];if(!_0x542e38[_0xba6d('0x3f')][_0xba6d('0x45')](_0xba6d('0x46'))){_0xaf73fc[_0xba6d('0x30')]=qs[_0xba6d('0x30')](_0x542e38[_0xba6d('0x3f')][_0xba6d('0x30')]);_0xaf73fc[_0xba6d('0x2f')]=qs['offset'](_0x542e38[_0xba6d('0x3f')][_0xba6d('0x2f')]);}_0xaf73fc['order']=qs['sort'](_0x542e38[_0xba6d('0x3f')][_0xba6d('0x47')]);_0xaf73fc['where']=qs[_0xba6d('0x40')](_[_0xba6d('0x48')](_0x542e38[_0xba6d('0x3f')],_0x5108ba[_0xba6d('0x40')]));if(_0x542e38[_0xba6d('0x3f')]['filter']){_0xaf73fc[_0xba6d('0x49')]=_['merge'](_0xaf73fc[_0xba6d('0x49')],{'$or':_[_0xba6d('0x4a')](_0x29d94b,function(_0x26557c){if(_0x26557c[_0xba6d('0x4b')]['key']!=='VIRTUAL'){var _0x14ea24={};_0x14ea24[_0x26557c[_0xba6d('0x4c')]]={'$like':'%'+_0x542e38[_0xba6d('0x3f')][_0xba6d('0x4d')]+'%'};return _0x14ea24;}})});}_0xaf73fc=_['merge']({},_0xaf73fc,_0x542e38[_0xba6d('0x4e')]);var _0x5cf6c4={'where':_0xaf73fc[_0xba6d('0x49')]};return db[_0xba6d('0x4f')][_0xba6d('0x2e')](_0x5cf6c4)[_0xba6d('0x20')](function(_0x4d1815){_0x3b34a9[_0xba6d('0x2e')]=_0x4d1815;if(_0x542e38[_0xba6d('0x3f')][_0xba6d('0x50')]){_0xaf73fc[_0xba6d('0x51')]=[{'all':!![]}];}return db[_0xba6d('0x4f')][_0xba6d('0x52')](_0xaf73fc);})['then'](function(_0x56e4d0){_0x3b34a9['rows']=_0x56e4d0;return _0x3b34a9;})[_0xba6d('0x20')](respondWithFilteredResult(_0xab1fe4,_0xaf73fc))[_0xba6d('0x29')](handleError(_0xab1fe4,null));};exports['show']=function(_0x1285df,_0x2fdccb){var _0x41f4df={'raw':![],'where':{'id':_0x1285df[_0xba6d('0x53')]['id']},'include':[{'model':db[_0xba6d('0x3c')],'as':_0xba6d('0x54')}]},_0x1d6ed0={};_0x1d6ed0[_0xba6d('0x3e')]=_['keys'](db[_0xba6d('0x4f')][_0xba6d('0x3d')]);_0x1d6ed0[_0xba6d('0x3f')]=_[_0xba6d('0x55')](_0x1285df[_0xba6d('0x3f')]);_0x1d6ed0['filters']=_[_0xba6d('0x41')](_0x1d6ed0['model'],_0x1d6ed0['query']);_0x41f4df['attributes']=_['intersection'](_0x1d6ed0['model'],qs[_0xba6d('0x43')](_0x1285df['query'][_0xba6d('0x43')]));_0x41f4df[_0xba6d('0x42')]=_0x41f4df[_0xba6d('0x42')][_0xba6d('0x44')]?_0x41f4df[_0xba6d('0x42')]:_0x1d6ed0[_0xba6d('0x3e')];if(_0x1285df[_0xba6d('0x3f')][_0xba6d('0x50')]){_0x41f4df[_0xba6d('0x51')]=[{'all':!![]}];}_0x41f4df=_['merge']({},_0x41f4df,_0x1285df[_0xba6d('0x4e')]);return db[_0xba6d('0x4f')][_0xba6d('0x56')](_0x41f4df)['then'](handleEntityNotFound(_0x2fdccb,null))[_0xba6d('0x20')](respondWithResult(_0x2fdccb,null))[_0xba6d('0x29')](handleError(_0x2fdccb,null));};exports['create']=function(_0x1dc3e9,_0x552712){return db[_0xba6d('0x4f')]['create'](_0x1dc3e9['body'],{})[_0xba6d('0x20')](function(_0x1957df){var _0x558e6b=_0x1dc3e9[_0xba6d('0x57')][_0xba6d('0x58')]({'plain':!![]});if(!_0x558e6b)throw new Error(_0xba6d('0x59'));if(_0x558e6b['role']===_0xba6d('0x57')){var _0x5d531c=_0x1957df['get']({'plain':!![]});var _0x4a0484=_0xba6d('0x37');return db[_0xba6d('0x5a')][_0xba6d('0x56')]({'where':{'name':_0x4a0484,'userProfileId':_0x558e6b[_0xba6d('0x5b')]},'raw':!![]})[_0xba6d('0x20')](function(_0x11fca8){if(_0x11fca8&&_0x11fca8[_0xba6d('0x5c')]===0x0){return db[_0xba6d('0x5d')]['create']({'name':_0x5d531c[_0xba6d('0x39')],'resourceId':_0x5d531c['id'],'type':_0x11fca8['name'],'sectionId':_0x11fca8['id']},{})['then'](function(){return _0x1957df;});}else{return _0x1957df;}})[_0xba6d('0x29')](function(_0x5435d0){logger[_0xba6d('0x26')](_0xba6d('0x5e'),_0x5435d0);throw _0x5435d0;});}return _0x1957df;})[_0xba6d('0x20')](respondWithResult(_0x552712,0xc9))[_0xba6d('0x29')](handleError(_0x552712,null));};exports[_0xba6d('0x35')]=function(_0x19c1da,_0x2d776f){if(_0x19c1da['body']['id']){delete _0x19c1da[_0xba6d('0x5f')]['id'];}return db[_0xba6d('0x4f')][_0xba6d('0x56')]({'where':{'id':_0x19c1da['params']['id']},'include':[{'model':db[_0xba6d('0x3c')],'as':_0xba6d('0x54')}]})[_0xba6d('0x20')](handleEntityNotFound(_0x2d776f,null))[_0xba6d('0x20')](saveUpdates(_0x19c1da[_0xba6d('0x5f')],null))['then'](respondWithResult(_0x2d776f,null))[_0xba6d('0x29')](handleError(_0x2d776f,null));};exports[_0xba6d('0x36')]=function(_0x55637d,_0xf48f12){return db[_0xba6d('0x4f')][_0xba6d('0x56')]({'where':{'id':_0x55637d[_0xba6d('0x53')]['id']}})[_0xba6d('0x20')](handleEntityNotFound(_0xf48f12,null))['then'](removeEntity(_0xf48f12,null))[_0xba6d('0x29')](handleError(_0xf48f12,null));};exports['describe']=function(_0x8776c6,_0x5e8fab){return db['FaxAccount']['describe']()[_0xba6d('0x20')](respondWithResult(_0x5e8fab,null))['catch'](handleError(_0x5e8fab,null));};exports[_0xba6d('0x60')]=function(_0x453b9a,_0xea6409,_0x335c06){if(_0x453b9a[_0xba6d('0x5f')]['id']){delete _0x453b9a['body']['id'];}return db[_0xba6d('0x4f')]['find']({'where':{'id':_0x453b9a[_0xba6d('0x53')]['id']}})[_0xba6d('0x20')](handleEntityNotFound(_0xea6409,null))[_0xba6d('0x20')](function(_0x467330){if(_0x467330){_0x453b9a[_0xba6d('0x5f')][_0xba6d('0x61')]=_0x467330['id'];return db[_0xba6d('0x62')][_0xba6d('0x63')](_0x453b9a[_0xba6d('0x5f')]);}})[_0xba6d('0x20')](respondWithResult(_0xea6409,null))[_0xba6d('0x29')](handleError(_0xea6409,null));};exports['getDispositions']=function(_0x24661d,_0x7e6ba9,_0x38e14d){var _0x50d721={'raw':![],'where':{}};var _0x47dfcb={};var _0x25b135={'count':0x0,'rows':[]};return db[_0xba6d('0x4f')][_0xba6d('0x64')]({'where':{'id':_0x24661d[_0xba6d('0x53')]['id']}})[_0xba6d('0x20')](handleEntityNotFound(_0x7e6ba9,null))['then'](function(_0x1fb370){if(_0x1fb370){_0x47dfcb[_0xba6d('0x3e')]=_[_0xba6d('0x55')](db[_0xba6d('0x62')]['rawAttributes']);_0x47dfcb[_0xba6d('0x3f')]=_[_0xba6d('0x55')](_0x24661d[_0xba6d('0x3f')]);_0x47dfcb[_0xba6d('0x40')]=_[_0xba6d('0x41')](_0x47dfcb[_0xba6d('0x3e')],_0x47dfcb['query']);_0x50d721[_0xba6d('0x42')]=_['intersection'](_0x47dfcb[_0xba6d('0x3e')],qs[_0xba6d('0x43')](_0x24661d['query']['fields']));_0x50d721['attributes']=_0x50d721['attributes']['length']?_0x50d721[_0xba6d('0x42')]:_0x47dfcb[_0xba6d('0x3e')];if(!_0x24661d[_0xba6d('0x3f')][_0xba6d('0x45')](_0xba6d('0x46'))){_0x50d721[_0xba6d('0x30')]=qs[_0xba6d('0x30')](_0x24661d[_0xba6d('0x3f')][_0xba6d('0x30')]);_0x50d721[_0xba6d('0x2f')]=qs['offset'](_0x24661d[_0xba6d('0x3f')][_0xba6d('0x2f')]);}_0x50d721[_0xba6d('0x65')]=qs[_0xba6d('0x47')](_0x24661d[_0xba6d('0x3f')]['sort']);_0x50d721[_0xba6d('0x49')]=qs[_0xba6d('0x40')](_['pick'](_0x24661d[_0xba6d('0x3f')],_0x47dfcb['filters']));_0x50d721[_0xba6d('0x49')][_0xba6d('0x61')]=_0x1fb370['id'];if(_0x24661d[_0xba6d('0x3f')]['filter']){_0x50d721[_0xba6d('0x49')]=_[_0xba6d('0x66')](_0x50d721['where'],{'$or':_['map'](_0x50d721[_0xba6d('0x42')],function(_0x4c6d37){var _0x345594={};_0x345594[_0x4c6d37]={'$like':'%'+_0x24661d[_0xba6d('0x3f')][_0xba6d('0x4d')]+'%'};return _0x345594;})});}_0x50d721=_['merge']({},_0x50d721,_0x24661d[_0xba6d('0x4e')]);return db[_0xba6d('0x62')]['count']({'where':_0x50d721[_0xba6d('0x49')]})[_0xba6d('0x20')](function(_0x204993){_0x25b135[_0xba6d('0x2e')]=_0x204993;if(_0x24661d[_0xba6d('0x3f')]['includeAll']){_0x50d721[_0xba6d('0x51')]=[{'all':!![]}];}return db['Disposition'][_0xba6d('0x52')](_0x50d721);})[_0xba6d('0x20')](function(_0x315e41){_0x25b135[_0xba6d('0x67')]=_0x315e41;return _0x25b135;});}})['then'](respondWithFilteredResult(_0x7e6ba9,_0x50d721))[_0xba6d('0x29')](handleError(_0x7e6ba9,null));};exports[_0xba6d('0x68')]=function(_0x368ed8,_0xf9bc3a,_0xc3943a){return db['FaxAccount'][_0xba6d('0x56')]({'where':{'id':_0x368ed8['params']['id']}})['then'](handleEntityNotFound(_0xf9bc3a,null))[_0xba6d('0x20')](function(_0x46e78a){if(_0x46e78a){return _0x46e78a[_0xba6d('0x68')](_0x368ed8[_0xba6d('0x3f')]['ids']);}})[_0xba6d('0x20')](respondWithStatusCode(_0xf9bc3a,null))[_0xba6d('0x29')](handleError(_0xf9bc3a,null));};exports[_0xba6d('0x69')]=function(_0x14a3df,_0x1bf4ea,_0x11db37){if(_0x14a3df[_0xba6d('0x5f')]['id']){delete _0x14a3df[_0xba6d('0x5f')]['id'];}return db[_0xba6d('0x4f')][_0xba6d('0x56')]({'where':{'id':_0x14a3df[_0xba6d('0x53')]['id']}})[_0xba6d('0x20')](handleEntityNotFound(_0x1bf4ea,null))[_0xba6d('0x20')](function(_0x28b887){if(_0x28b887){_0x14a3df['body'][_0xba6d('0x61')]=_0x28b887['id'];return db[_0xba6d('0x6a')]['create'](_0x14a3df[_0xba6d('0x5f')]);}})[_0xba6d('0x20')](respondWithResult(_0x1bf4ea,null))[_0xba6d('0x29')](handleError(_0x1bf4ea,null));};exports[_0xba6d('0x6b')]=function(_0x9e219,_0x3298a3,_0x19a584){var _0x46e92e={'raw':![],'where':{}};var _0x54446f={};var _0x25c231={'count':0x0,'rows':[]};return db[_0xba6d('0x4f')][_0xba6d('0x64')]({'where':{'id':_0x9e219[_0xba6d('0x53')]['id']}})['then'](handleEntityNotFound(_0x3298a3,null))[_0xba6d('0x20')](function(_0x48fcc0){if(_0x48fcc0){_0x54446f['model']=_['keys'](db['CannedAnswer'][_0xba6d('0x3d')]);_0x54446f[_0xba6d('0x3f')]=_[_0xba6d('0x55')](_0x9e219['query']);_0x54446f['filters']=_[_0xba6d('0x41')](_0x54446f[_0xba6d('0x3e')],_0x54446f['query']);_0x46e92e[_0xba6d('0x42')]=_[_0xba6d('0x41')](_0x54446f['model'],qs[_0xba6d('0x43')](_0x9e219[_0xba6d('0x3f')][_0xba6d('0x43')]));_0x46e92e[_0xba6d('0x42')]=_0x46e92e['attributes'][_0xba6d('0x44')]?_0x46e92e[_0xba6d('0x42')]:_0x54446f['model'];if(!_0x9e219['query'][_0xba6d('0x45')]('nolimit')){_0x46e92e[_0xba6d('0x30')]=qs[_0xba6d('0x30')](_0x9e219[_0xba6d('0x3f')]['limit']);_0x46e92e['offset']=qs[_0xba6d('0x2f')](_0x9e219[_0xba6d('0x3f')]['offset']);}_0x46e92e[_0xba6d('0x65')]=qs[_0xba6d('0x47')](_0x9e219[_0xba6d('0x3f')][_0xba6d('0x47')]);_0x46e92e[_0xba6d('0x49')]=qs[_0xba6d('0x40')](_[_0xba6d('0x48')](_0x9e219[_0xba6d('0x3f')],_0x54446f[_0xba6d('0x40')]));_0x46e92e[_0xba6d('0x49')][_0xba6d('0x61')]=_0x48fcc0['id'];if(_0x9e219['query'][_0xba6d('0x4d')]){_0x46e92e['where']=_[_0xba6d('0x66')](_0x46e92e[_0xba6d('0x49')],{'$or':_[_0xba6d('0x4a')](_0x46e92e[_0xba6d('0x42')],function(_0x12cef3){var _0x5bafd7={};_0x5bafd7[_0x12cef3]={'$like':'%'+_0x9e219[_0xba6d('0x3f')][_0xba6d('0x4d')]+'%'};return _0x5bafd7;})});}_0x46e92e=_[_0xba6d('0x66')]({},_0x46e92e,_0x9e219[_0xba6d('0x4e')]);return db[_0xba6d('0x6a')][_0xba6d('0x2e')]({'where':_0x46e92e['where']})[_0xba6d('0x20')](function(_0x5d2055){_0x25c231[_0xba6d('0x2e')]=_0x5d2055;if(_0x9e219['query'][_0xba6d('0x50')]){_0x46e92e[_0xba6d('0x51')]=[{'all':!![]}];}return db[_0xba6d('0x6a')][_0xba6d('0x52')](_0x46e92e);})[_0xba6d('0x20')](function(_0x336310){_0x25c231['rows']=_0x336310;return _0x25c231;});}})[_0xba6d('0x20')](respondWithFilteredResult(_0x3298a3,_0x46e92e))[_0xba6d('0x29')](handleError(_0x3298a3,null));};exports[_0xba6d('0x6c')]=function(_0x21656a,_0x2b423f,_0x5beb71){return db[_0xba6d('0x4f')][_0xba6d('0x56')]({'where':{'id':_0x21656a[_0xba6d('0x53')]['id']}})['then'](handleEntityNotFound(_0x2b423f,null))[_0xba6d('0x20')](function(_0x5b45e6){if(_0x5b45e6){return _0x5b45e6[_0xba6d('0x6c')](_0x21656a[_0xba6d('0x3f')][_0xba6d('0x6d')]);}})[_0xba6d('0x20')](respondWithStatusCode(_0x2b423f,null))[_0xba6d('0x29')](handleError(_0x2b423f,null));};exports[_0xba6d('0x6e')]=function(_0x23da72,_0x82a179,_0x181a0a){return db[_0xba6d('0x6f')][_0xba6d('0x56')]({'where':{'id':_0x23da72[_0xba6d('0x53')]['id']}})[_0xba6d('0x20')](handleEntityNotFound(_0x82a179,null))[_0xba6d('0x20')](function(_0x57903c){if(_0x57903c){return _0x57903c[_0xba6d('0x6e')](_0x23da72[_0xba6d('0x5f')][_0xba6d('0x6d')],_[_0xba6d('0x70')](_0x23da72[_0xba6d('0x5f')],['ids','id'])||{});}})[_0xba6d('0x20')](respondWithResult(_0x82a179,null))[_0xba6d('0x29')](handleError(_0x82a179,null));};exports[_0xba6d('0x71')]=function(_0x464611,_0x213f6a,_0x3a1baa){var _0x1422b2={'raw':![],'where':{}};var _0x10e798={};var _0xd07781={'count':0x0,'rows':[]};return db[_0xba6d('0x4f')][_0xba6d('0x64')]({'where':{'id':_0x464611[_0xba6d('0x53')]['id']}})[_0xba6d('0x20')](handleEntityNotFound(_0x213f6a,null))[_0xba6d('0x20')](function(_0x383950){if(_0x383950){_0x10e798[_0xba6d('0x3e')]=_[_0xba6d('0x55')](db[_0xba6d('0x6f')][_0xba6d('0x3d')]);_0x10e798[_0xba6d('0x3f')]=_[_0xba6d('0x55')](_0x464611[_0xba6d('0x3f')]);_0x10e798[_0xba6d('0x40')]=_[_0xba6d('0x41')](_0x10e798[_0xba6d('0x3e')],_0x10e798[_0xba6d('0x3f')]);_0x1422b2['attributes']=_['intersection'](_0x10e798[_0xba6d('0x3e')],qs[_0xba6d('0x43')](_0x464611['query']['fields']));_0x1422b2['attributes']=_0x1422b2[_0xba6d('0x42')][_0xba6d('0x44')]?_0x1422b2[_0xba6d('0x42')]:_0x10e798[_0xba6d('0x3e')];if(!_0x464611['query'][_0xba6d('0x45')](_0xba6d('0x46'))){_0x1422b2['limit']=qs['limit'](_0x464611[_0xba6d('0x3f')]['limit']);_0x1422b2[_0xba6d('0x2f')]=qs[_0xba6d('0x2f')](_0x464611['query']['offset']);}_0x1422b2[_0xba6d('0x65')]=qs[_0xba6d('0x47')](_0x464611[_0xba6d('0x3f')][_0xba6d('0x47')]);_0x1422b2[_0xba6d('0x49')]=qs[_0xba6d('0x40')](_[_0xba6d('0x48')](_0x464611[_0xba6d('0x3f')],_0x10e798[_0xba6d('0x40')]));_0x1422b2[_0xba6d('0x49')][_0xba6d('0x61')]=_0x383950['id'];if(_0x464611['query'][_0xba6d('0x4d')]){_0x1422b2[_0xba6d('0x49')]=_[_0xba6d('0x66')](_0x1422b2[_0xba6d('0x49')],{'$or':_[_0xba6d('0x4a')](_0x1422b2['attributes'],function(_0x2bc50a){var _0x27b910={};_0x27b910[_0x2bc50a]={'$like':'%'+_0x464611[_0xba6d('0x3f')][_0xba6d('0x4d')]+'%'};return _0x27b910;})});}_0x1422b2=_['merge']({},_0x1422b2,_0x464611[_0xba6d('0x4e')]);return db['FaxInteraction'][_0xba6d('0x2e')]({'where':_0x1422b2[_0xba6d('0x49')]})[_0xba6d('0x20')](function(_0x2ffdad){_0xd07781[_0xba6d('0x2e')]=_0x2ffdad;if(_0x464611['query'][_0xba6d('0x50')]){_0x1422b2[_0xba6d('0x51')]=[{'model':db[_0xba6d('0x72')],'as':_0xba6d('0x73'),'required':![]},{'model':db[_0xba6d('0x74')],'as':_0xba6d('0x75'),'attributes':['name','fullname',_0xba6d('0x76')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xba6d('0x39'),_0xba6d('0x77')],'where':_0x464611[_0xba6d('0x3f')][_0xba6d('0x78')]?{'id':_0x464611[_0xba6d('0x3f')]['tag']}:undefined,'required':_0x464611['query'][_0xba6d('0x78')]?!![]:![]}];}return db[_0xba6d('0x6f')][_0xba6d('0x52')](_0x1422b2);})['then'](function(_0x15bbc3){_0xd07781[_0xba6d('0x67')]=_0x15bbc3;return _0xd07781;});}})[_0xba6d('0x20')](respondWithFilteredResult(_0x213f6a,_0x1422b2))[_0xba6d('0x29')](handleError(_0x213f6a,null));};exports[_0xba6d('0x79')]=function(_0x58cef,_0x242f77,_0x4766d2){return db['FaxAccount'][_0xba6d('0x64')]({'where':{'id':_0x58cef[_0xba6d('0x53')]['id']}})['then'](handleEntityNotFound(_0x242f77,null))[_0xba6d('0x20')](function(_0x12a9ae){if(_0x12a9ae){return db[_0xba6d('0x7a')][_0xba6d('0x7b')](function(_0x114491){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0x58cef[_0xba6d('0x53')]['id']},'transaction':_0x114491})[_0xba6d('0x20')](function(_0x51d32b){var _0x369584=_[_0xba6d('0x4a')](_0x58cef[_0xba6d('0x5f')],function(_0x5c0e0a){_0x5c0e0a[_0xba6d('0x61')]=_0x58cef['params']['id'];return _0x5c0e0a;});return db[_0xba6d('0x7c')]['bulkCreate'](_0x369584,{'transaction':_0x114491});});})[_0xba6d('0x20')](function(){return db[_0xba6d('0x7c')][_0xba6d('0x7d')]({'where':{'FaxAccountId':_0x58cef[_0xba6d('0x53')]['id']},'order':_0xba6d('0x7e')});});}})[_0xba6d('0x20')](respondWithResult(_0x242f77,null))[_0xba6d('0x29')](handleError(_0x242f77,null));};exports['getApplications']=function(_0x5f582d,_0x13fc9f,_0x27a7b7){var _0x185b88={};var _0x2dc959={};var _0x49cf14;var _0x572abf;return db[_0xba6d('0x4f')][_0xba6d('0x64')]({'where':{'id':_0x5f582d[_0xba6d('0x53')]['id']}})[_0xba6d('0x20')](handleEntityNotFound(_0x13fc9f,null))[_0xba6d('0x20')](function(_0x52d7d3){if(_0x52d7d3){_0x49cf14=_0x52d7d3;_0x2dc959['model']=_[_0xba6d('0x55')](db[_0xba6d('0x7c')][_0xba6d('0x3d')]);_0x2dc959[_0xba6d('0x3f')]=_[_0xba6d('0x55')](_0x5f582d[_0xba6d('0x3f')]);_0x2dc959[_0xba6d('0x40')]=_[_0xba6d('0x41')](_0x2dc959[_0xba6d('0x3e')],_0x2dc959[_0xba6d('0x3f')]);_0x185b88[_0xba6d('0x42')]=_['intersection'](_0x2dc959['model'],qs[_0xba6d('0x43')](_0x5f582d[_0xba6d('0x3f')][_0xba6d('0x43')]));_0x185b88['attributes']=_0x185b88[_0xba6d('0x42')]['length']?_0x185b88[_0xba6d('0x42')]:_0x2dc959['model'];_0x185b88[_0xba6d('0x65')]=qs[_0xba6d('0x47')](_0x5f582d[_0xba6d('0x3f')][_0xba6d('0x47')]);_0x185b88['where']=qs[_0xba6d('0x40')](_['pick'](_0x5f582d[_0xba6d('0x3f')],_0x2dc959[_0xba6d('0x40')]));if(_0x5f582d[_0xba6d('0x3f')][_0xba6d('0x4d')]){_0x185b88[_0xba6d('0x49')]=_[_0xba6d('0x66')](_0x185b88[_0xba6d('0x49')],{'$or':_[_0xba6d('0x4a')](_0x185b88[_0xba6d('0x42')],function(_0x3f9c7c){var _0x1c361a={};_0x1c361a[_0x3f9c7c]={'$like':'%'+_0x5f582d[_0xba6d('0x3f')][_0xba6d('0x4d')]+'%'};return _0x1c361a;})});}_0x185b88=_[_0xba6d('0x66')]({},_0x185b88,_0x5f582d[_0xba6d('0x4e')]);return _0x49cf14['getApplications'](_0x185b88);}})['then'](function(_0x5abbb1){if(_0x5abbb1){_0x572abf=_0x5abbb1['length'];if(!_0x5f582d[_0xba6d('0x3f')]['hasOwnProperty']('nolimit')){_0x185b88[_0xba6d('0x30')]=qs['limit'](_0x5f582d[_0xba6d('0x3f')][_0xba6d('0x30')]);_0x185b88[_0xba6d('0x2f')]=qs['offset'](_0x5f582d[_0xba6d('0x3f')][_0xba6d('0x2f')]);}return _0x49cf14[_0xba6d('0x7f')](_0x185b88);}})[_0xba6d('0x20')](function(_0x43c92f){if(_0x43c92f){return _0x43c92f?{'count':_0x572abf,'rows':_0x43c92f}:null;}})[_0xba6d('0x20')](respondWithResult(_0x13fc9f,null))[_0xba6d('0x29')](handleError(_0x13fc9f,null));};function Extension(_0xccb9e2,_0x310e4e,_0x5e9344,_0xae43ab){this[_0xba6d('0x80')]='from-voip-provider';this['exten']=_0xccb9e2['localstationid'];this['app']=_0xae43ab;this[_0xba6d('0x4b')]=_0xba6d('0x81');this['description']=_0xba6d('0x82');this[_0xba6d('0x61')]=_0xccb9e2['id'];this[_0xba6d('0x7e')]=_0x310e4e;this[_0xba6d('0x83')]=_0x5e9344;}function createExtensionsReciveFax(_0x3e4971){var _0x1b8e2c=0x1;var _0x4e6640=[];_0x4e6640['push'](new Extension(_0x3e4971,_0x1b8e2c,'',_0xba6d('0x84')));_0x1b8e2c+=0x1;_0x4e6640[_0xba6d('0x85')](new Extension(_0x3e4971,_0x1b8e2c,'CDR(type)=inbound-fax',_0xba6d('0x86')));_0x1b8e2c+=0x1;for(var _0x3729e6 in _0x3e4971){if(_0x3e4971[_0xba6d('0x45')](_0x3729e6)&&(_0x3729e6==='ecm'||_0x3729e6===_0xba6d('0x87')||_0x3729e6===_0xba6d('0x88')||_0x3729e6===_0xba6d('0x89')||_0x3729e6===_0xba6d('0x8a')||_0x3729e6===_0xba6d('0x8b')||_0x3729e6===_0xba6d('0x8c')||_0x3729e6===_0xba6d('0x8d')||_0x3729e6==='t38timeout')){_0x4e6640['push'](new Extension(_0x3e4971,_0x1b8e2c,_0xba6d('0x8e')+_0x3729e6+')='+_0x3e4971[_0x3729e6],_0xba6d('0x86')));_0x1b8e2c+=0x1;}}_0x4e6640['push'](new Extension(_0x3e4971,_0x1b8e2c,'6',_0xba6d('0x8f')));_0x1b8e2c+=0x1;_0x4e6640[_0xba6d('0x85')](new Extension(_0x3e4971,_0x1b8e2c,'/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'));_0x1b8e2c=0x0;return _0x4e6640;}exports[_0xba6d('0x90')]=function(_0x28d78c,_0x17e449,_0x53f98e){var _0x176972;return db[_0xba6d('0x7a')][_0xba6d('0x7b')](function(_0x17c27f){return db[_0xba6d('0x4f')]['create'](_0x28d78c[_0xba6d('0x5f')],{'transaction':_0x17c27f})[_0xba6d('0x20')](function(_0x105820){_0x176972=_0x105820[_0xba6d('0x58')]({'plain':!![]});return db[_0xba6d('0x91')]['bulkCreate'](createExtensionsReciveFax(_0x176972),{'transaction':_0x17c27f});});})['then'](function(){return _0x176972;})['then'](respondWithResult(_0x17e449,null))[_0xba6d('0x29')](handleError(_0x17e449,null));};exports[_0xba6d('0x92')]=function(_0x2c9256,_0x582609,_0x11e016){var _0x15fb5e;return db[_0xba6d('0x7a')][_0xba6d('0x7b')](function(_0x15ac51){return db[_0xba6d('0x4f')]['update'](_0x2c9256[_0xba6d('0x5f')],{'where':{'id':_0x2c9256[_0xba6d('0x5f')]['id']},'transaction':_0x15ac51})[_0xba6d('0x20')](function(_0x11975d){return db['VoiceExtension'][_0xba6d('0x36')]({'where':{'FaxAccountId':_0x2c9256[_0xba6d('0x5f')]['id']},'transaction':_0x15ac51})['then'](function(_0x562894){return db[_0xba6d('0x91')][_0xba6d('0x93')](createExtensionsReciveFax(_[_0xba6d('0x70')](_0x2c9256[_0xba6d('0x5f')],[_0xba6d('0x94'),'key',_0xba6d('0x95'),_0xba6d('0x96'),'TrunkId',_0xba6d('0x97')])),{'transaction':_0x15ac51});});});})[_0xba6d('0x20')](function(){return db[_0xba6d('0x4f')][_0xba6d('0x98')](_0x2c9256[_0xba6d('0x5f')]['id']);})[_0xba6d('0x20')](respondWithResult(_0x582609,null))[_0xba6d('0x29')](handleError(_0x582609,null));};exports[_0xba6d('0x99')]=function(_0x400446,_0xd34095,_0xa2862a){var _0x294ead={'raw':!![],'where':{}};var _0x3987b={};var _0xf2127b={'count':0x0,'rows':[]};return db['FaxAccount'][_0xba6d('0x64')]({'where':{'id':_0x400446[_0xba6d('0x53')]['id']}})[_0xba6d('0x20')](handleEntityNotFound(_0xd34095,null))[_0xba6d('0x20')](function(_0x4583ea){if(_0x4583ea){_0x3987b[_0xba6d('0x3e')]=_[_0xba6d('0x55')](db[_0xba6d('0x9a')][_0xba6d('0x3d')]);_0x3987b[_0xba6d('0x3f')]=_[_0xba6d('0x55')](_0x400446[_0xba6d('0x3f')]);_0x3987b['filters']=_['intersection'](_0x3987b[_0xba6d('0x3e')],_0x3987b['query']);_0x294ead[_0xba6d('0x42')]=_['intersection'](_0x3987b['model'],qs[_0xba6d('0x43')](_0x400446[_0xba6d('0x3f')][_0xba6d('0x43')]));_0x294ead[_0xba6d('0x42')]=_0x294ead[_0xba6d('0x42')][_0xba6d('0x44')]?_0x294ead[_0xba6d('0x42')]:_0x3987b[_0xba6d('0x3e')];if(!_0x400446[_0xba6d('0x3f')][_0xba6d('0x45')]('nolimit')){_0x294ead[_0xba6d('0x30')]=qs['limit'](_0x400446[_0xba6d('0x3f')][_0xba6d('0x30')]);_0x294ead['offset']=qs['offset'](_0x400446[_0xba6d('0x3f')][_0xba6d('0x2f')]);}_0x294ead[_0xba6d('0x65')]=qs['sort'](_0x400446['query'][_0xba6d('0x47')]);_0x294ead[_0xba6d('0x49')]=qs[_0xba6d('0x40')](_[_0xba6d('0x48')](_0x400446[_0xba6d('0x3f')],_0x3987b[_0xba6d('0x40')]));_0x294ead[_0xba6d('0x49')][_0xba6d('0x61')]=_0x4583ea['id'];if(_0x400446[_0xba6d('0x3f')][_0xba6d('0x4d')]){_0x294ead['where']=_[_0xba6d('0x66')](_0x294ead['where'],{'$or':_[_0xba6d('0x4a')](_0x294ead[_0xba6d('0x42')],function(_0x5e1109){var _0x1c7c6e={};_0x1c7c6e[_0x5e1109]={'$like':'%'+_0x400446[_0xba6d('0x3f')]['filter']+'%'};return _0x1c7c6e;})});}if(_0x400446[_0xba6d('0x3f')][_0xba6d('0x9b')]){var _0x3197c4=_0x400446[_0xba6d('0x3f')][_0xba6d('0x9b')][_0xba6d('0x9c')](',');var _0x39eaf7={};_0x39eaf7[_0x3197c4[0x0]]={'$gte':moment(_0x3197c4[0x1])[_0xba6d('0x9d')]('YYYY-MM-DD\x20HH:mm:ss')};_0x294ead[_0xba6d('0x49')]=_[_0xba6d('0x66')](_0x294ead[_0xba6d('0x49')],_0x39eaf7);}_0x294ead=_[_0xba6d('0x66')]({},_0x294ead,_0x400446['options']);return db[_0xba6d('0x9a')][_0xba6d('0x2e')]({'where':_0x294ead[_0xba6d('0x49')]})[_0xba6d('0x20')](function(_0x2f2a72){_0xf2127b[_0xba6d('0x2e')]=_0x2f2a72;if(_0x400446['query']['includeAll']){_0x294ead[_0xba6d('0x51')]=[{'all':!![]}];}return db[_0xba6d('0x9a')][_0xba6d('0x52')](_0x294ead);})[_0xba6d('0x20')](function(_0x12aaa2){_0xf2127b[_0xba6d('0x67')]=_0x12aaa2;return _0xf2127b;});}})[_0xba6d('0x20')](respondWithFilteredResult(_0xd34095,_0x294ead))['catch'](handleError(_0xd34095,null));};exports[_0xba6d('0x3a')]=function(_0x448e9b,_0x9e4989,_0x3e07b0){var _0x5b7104,_0x3892be={},_0x208ff1;if(_0x448e9b[_0xba6d('0x5f')]['to']){_0x208ff1=_0x448e9b[_0xba6d('0x5f')]['to'][0x0];}return db[_0xba6d('0x4f')][_0xba6d('0x56')]({'where':{'id':_0x448e9b[_0xba6d('0x53')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xba6d('0x72')],'as':_0xba6d('0x9e'),'where':{'fax':_0x208ff1},'limit':0x1,'order':[[_0xba6d('0x96'),_0xba6d('0x9f')]]}]}]})[_0xba6d('0x20')](handleEntityNotFound(_0x9e4989,null))['then'](function(_0x437b7c){_0x5b7104=_0x437b7c;if(_0x448e9b[_0xba6d('0x5f')][_0xba6d('0xa0')]&&_0x448e9b['body']['attachments'][_0xba6d('0x44')]){for(var _0x587cf3=0x0;_0x587cf3<_0x448e9b[_0xba6d('0x5f')][_0xba6d('0xa0')][_0xba6d('0x44')];_0x587cf3+=0x1){_0x448e9b[_0xba6d('0x5f')][_0xba6d('0xa0')][_0x587cf3]={'filename':_0x448e9b[_0xba6d('0x5f')][_0xba6d('0xa0')][_0x587cf3]['name'],'id':_0x448e9b[_0xba6d('0x5f')][_0xba6d('0xa0')][_0x587cf3]['id'],'path':path[_0xba6d('0xa1')](config['root'],_0xba6d('0xa2'),_0x448e9b[_0xba6d('0x5f')][_0xba6d('0xa0')][_0x587cf3][_0xba6d('0xa3')])};}}return respondWithRpcPromise('CheckAfterSend',_0xba6d('0xa4'),{'FaxAccountId':_[_0xba6d('0xa5')](_0x448e9b[_0xba6d('0x53')]['id'])?undefined:_0x448e9b[_0xba6d('0x53')]['id'],'path':_[_0xba6d('0xa5')](_0x448e9b[_0xba6d('0x5f')][_0xba6d('0xa0')][0x0][_0xba6d('0x7')])?undefined:_0x448e9b[_0xba6d('0x5f')]['attachments'][0x0][_0xba6d('0x7')],'fax':_[_0xba6d('0xa5')](_0x448e9b[_0xba6d('0x5f')]['to'][0x0])?undefined:_0x448e9b[_0xba6d('0x5f')]['to'][0x0]},client9002);})[_0xba6d('0x20')](function(){if(_0x5b7104){if(_[_0xba6d('0xa5')](_0x448e9b['body'][_0xba6d('0xa6')])){_0x448e9b['body'][_0xba6d('0xa6')]=util[_0xba6d('0x9d')](_0xba6d('0xa7'),_0x5b7104['name'],_0x5b7104[_0xba6d('0xa8')]);}if(_0x5b7104[_0xba6d('0xa9')]){if(_0x5b7104[_0xba6d('0xa9')][_0xba6d('0x9e')][_0xba6d('0x44')]){return _0x5b7104[_0xba6d('0xa9')][_0xba6d('0x9e')][0x0];}else{return db['CmContact'][_0xba6d('0x63')](_['defaults'](_0x448e9b[_0xba6d('0x5f')],{'firstName':_0x448e9b[_0xba6d('0x5f')]['to'][0x0],'phone':_0x448e9b[_0xba6d('0x5f')]['to'][0x0],'fax':_0x448e9b['body']['to'][0x0],'ListId':_0x5b7104[_0xba6d('0x97')]}));}}else{throw new Error(_0xba6d('0xaa'));}}else{throw new Error(_0xba6d('0xab'));}})[_0xba6d('0x20')](function(_0x40410b){if(_0x40410b){return db[_0xba6d('0x6f')][_0xba6d('0x56')]({'where':{'ContactId':_0x40410b['id'],'closed':![],'FaxAccountId':_0x5b7104['id']}})[_0xba6d('0x20')](function(_0x2ab807){if(_0x2ab807){return[_0x2ab807,![]];}return db[_0xba6d('0x6f')][_0xba6d('0x63')]({'UserId':_0x448e9b['user']['id'],'ContactId':_0x40410b['id'],'FaxAccountId':_0x5b7104['id'],'fax':_0x448e9b[_0xba6d('0x5f')]['to'][0x0],'firstMsgDirection':_0xba6d('0xac'),'Messages':[_['merge'](_0x448e9b[_0xba6d('0x5f')],{'read':![],'body':_0x448e9b['body'][_0xba6d('0xa0')][0x0][_0xba6d('0xad')],'FaxAccountId':_0x5b7104['id'],'UserId':_0x448e9b[_0xba6d('0x57')]['id'],'ContactId':_0x40410b['id'],'AttachmentId':_0x448e9b[_0xba6d('0x5f')][_0xba6d('0xa0')][0x0]['id']})]},{'include':[{'model':db[_0xba6d('0x9a')],'as':_0xba6d('0xae')}]})['then'](function(_0x52902b){return[_0x52902b,!![]];});});}else{throw new Error(_0xba6d('0xaf'));}})[_0xba6d('0xb0')](function(_0x20cad6,_0x33d823){if(_0x33d823){return _0x20cad6;}return db[_0xba6d('0x9a')]['create']({'direction':_0xba6d('0xac'),'read':![],'body':_0x448e9b[_0xba6d('0x5f')][_0xba6d('0xa0')][0x0][_0xba6d('0xad')],'FaxAccountId':_0x5b7104['id'],'FaxInteractionId':_0x20cad6['id'],'UserId':_0x448e9b['user']['id'],'ContactId':_0x20cad6[_0xba6d('0xb1')],'AttachmentId':_0x448e9b['body']['attachments'][0x0]['id']})[_0xba6d('0x20')](function(_0x5f0168){_0x20cad6['dataValues'][_0xba6d('0xae')]=[];_0x20cad6[_0xba6d('0xb2')][_0xba6d('0xae')][_0xba6d('0x85')](_0x5f0168[_0xba6d('0xb2')]);return _0x20cad6;});})['then'](function(_0x52311d){respondWithRpcPromise(_0xba6d('0xb3'),_0xba6d('0xb3'),{'FaxAccountId':_[_0xba6d('0xa5')](_0x448e9b['params']['id'])?undefined:_0x448e9b['params']['id'],'path':_['isNil'](_0x448e9b[_0xba6d('0x5f')][_0xba6d('0xa0')][0x0][_0xba6d('0x7')])?undefined:_0x448e9b['body'][_0xba6d('0xa0')][0x0][_0xba6d('0x7')],'fax':_['isNil'](_0x448e9b[_0xba6d('0x5f')]['to'][0x0])?undefined:_0x448e9b[_0xba6d('0x5f')]['to'][0x0],'AttachmentId':_0x448e9b[_0xba6d('0x5f')][_0xba6d('0xa0')][0x0]['id']},client9002)[_0xba6d('0x20')](function(_0x9ed45e){logger[_0xba6d('0x21')](_0xba6d('0xb4'),_0x9ed45e);})[_0xba6d('0x29')](function(_0x4ca6bc){logger[_0xba6d('0x21')](_0xba6d('0xb4'),_0x4ca6bc);});return _0x52311d;})['then'](respondWithResult(_0x9e4989,null))['catch'](handleError(_0x9e4989,null));};exports['addAgents']=function(_0x3d7af6,_0x211f7b,_0x54759c){return db[_0xba6d('0x4f')][_0xba6d('0x56')]({'where':{'id':_0x3d7af6[_0xba6d('0x53')]['id']}})[_0xba6d('0x20')](handleEntityNotFound(_0x211f7b,null))[_0xba6d('0x20')](function(_0x4f8950){if(_0x4f8950){return _0x4f8950['addAgents'](_0x3d7af6[_0xba6d('0x5f')]['ids'],_[_0xba6d('0x70')](_0x3d7af6[_0xba6d('0x5f')],['ids','id'])||{})[_0xba6d('0xb0')](function(_0x9e4d95){for(var _0x58229e=0x0;_0x58229e<_0x3d7af6[_0xba6d('0x5f')][_0xba6d('0x6d')][_0xba6d('0x44')];_0x58229e+=0x1){socket['emit']('userFaxAccount:save',{'UserId':_0x3d7af6['body'][_0xba6d('0x6d')][_0x58229e],'FaxAccountId':_0x3d7af6[_0xba6d('0x53')]['id']});}return _0x9e4d95;});}})['then'](respondWithResult(_0x211f7b,null))[_0xba6d('0x29')](handleError(_0x211f7b,null));};exports[_0xba6d('0xb5')]=function(_0x1bc719,_0x5e7833,_0xc3782d){return db[_0xba6d('0x4f')][_0xba6d('0x56')]({'where':{'id':_0x1bc719[_0xba6d('0x53')]['id']}})[_0xba6d('0x20')](handleEntityNotFound(_0x5e7833,null))[_0xba6d('0x20')](function(_0x1495e4){if(_0x1495e4){return _0x1495e4['removeAgents'](_0x1bc719[_0xba6d('0x3f')][_0xba6d('0x6d')])[_0xba6d('0x20')](function(){if(_[_0xba6d('0xb6')](_0x1bc719['query'][_0xba6d('0x6d')])){for(var _0x3fd246=0x0;_0x3fd246<_0x1bc719['query']['ids'][_0xba6d('0x44')];_0x3fd246+=0x1){socket['emit'](_0xba6d('0xb7'),{'UserId':Number(_0x1bc719['query'][_0xba6d('0x6d')][_0x3fd246]),'FaxAccountId':Number(_0x1bc719[_0xba6d('0x53')]['id'])});}}else{socket[_0xba6d('0xb8')]('userFaxAccount:remove',{'UserId':Number(_0x1bc719[_0xba6d('0x3f')][_0xba6d('0x6d')]),'FaxAccountId':Number(_0x1bc719[_0xba6d('0x53')]['id'])});}});}})[_0xba6d('0x20')](respondWithStatusCode(_0x5e7833,null))['catch'](handleError(_0x5e7833,null));};exports['getAgents']=function(_0xe62768,_0x563bf3,_0xe44200){var _0x943181={};var _0x1e0a81={};var _0x3a1e5d;var _0x361356;return db[_0xba6d('0x4f')]['findOne']({'where':{'id':_0xe62768[_0xba6d('0x53')]['id']}})[_0xba6d('0x20')](handleEntityNotFound(_0x563bf3,null))[_0xba6d('0x20')](function(_0x8c7b5){if(_0x8c7b5){_0x3a1e5d=_0x8c7b5;_0x1e0a81[_0xba6d('0x3e')]=_[_0xba6d('0x55')](db[_0xba6d('0x74')]['rawAttributes']);_0x1e0a81[_0xba6d('0x3f')]=_[_0xba6d('0x55')](_0xe62768['query']);_0x1e0a81[_0xba6d('0x40')]=_[_0xba6d('0x41')](_0x1e0a81[_0xba6d('0x3e')],_0x1e0a81[_0xba6d('0x3f')]);_0x943181['attributes']=_['intersection'](_0x1e0a81[_0xba6d('0x3e')],qs[_0xba6d('0x43')](_0xe62768[_0xba6d('0x3f')][_0xba6d('0x43')]));_0x943181['attributes']=_0x943181[_0xba6d('0x42')]['length']?_0x943181[_0xba6d('0x42')]:_0x1e0a81[_0xba6d('0x3e')];_0x943181[_0xba6d('0x65')]=qs[_0xba6d('0x47')](_0xe62768['query'][_0xba6d('0x47')]);_0x943181[_0xba6d('0x49')]=qs['filters'](_[_0xba6d('0x48')](_0xe62768['query'],_0x1e0a81[_0xba6d('0x40')]));if(_0xe62768[_0xba6d('0x3f')]['filter']){_0x943181[_0xba6d('0x49')]=_[_0xba6d('0x66')](_0x943181['where'],{'$or':_[_0xba6d('0x4a')](_0x943181[_0xba6d('0x42')],function(_0x5ea119){var _0xdb6e0d={};_0xdb6e0d[_0x5ea119]={'$like':'%'+_0xe62768['query'][_0xba6d('0x4d')]+'%'};return _0xdb6e0d;})});}_0x943181=_[_0xba6d('0x66')]({},_0x943181,_0xe62768[_0xba6d('0x4e')]);return _0x3a1e5d[_0xba6d('0xb9')](_0x943181);}})[_0xba6d('0x20')](function(_0x30cf93){if(_0x30cf93){_0x361356=_0x30cf93[_0xba6d('0x44')];if(!_0xe62768['query']['hasOwnProperty'](_0xba6d('0x46'))){_0x943181[_0xba6d('0x30')]=qs[_0xba6d('0x30')](_0xe62768[_0xba6d('0x3f')]['limit']);_0x943181[_0xba6d('0x2f')]=qs[_0xba6d('0x2f')](_0xe62768['query'][_0xba6d('0x2f')]);}return _0x3a1e5d[_0xba6d('0xb9')](_0x943181);}})['then'](function(_0x4823c8){if(_0x4823c8){return _0x4823c8?{'count':_0x361356,'rows':_0x4823c8}:null;}})[_0xba6d('0x20')](respondWithResult(_0x563bf3,null))['catch'](handleError(_0x563bf3,null));}; \ No newline at end of file +var _0x9494=['/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','updateAccountApplications','update','VoiceExtension','tech','key','updatedAt','ListId','findById','getMessages','FaxMessage','$gte','split','format','send','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','Messages','spread','out','filename','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','./faxAccount.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~!@#$%^&-_=+[{]}.','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','end','status','json','count','offset','limit','apply','reject','save','destroy','get','FaxAccounts','sendStatus','stack','name','Pause','FaxAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','map','type','VIRTUAL','field','filter','merge','options','includeAll','include','catch','show','mandatoryDispositionPause','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','Disposition','getDispositions','FaxAccountId','findAll','rows','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','fullname','internal','Tag','Tags','color','tag','findOne','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','system','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','ecm','faxdetect','headerinfo','maxrate','t38timeout','FAXOPT(','Wait'];(function(_0x3b8e48,_0x5b0519){var _0x16d541=function(_0x6e3a47){while(--_0x6e3a47){_0x3b8e48['push'](_0x3b8e48['shift']());}};_0x16d541(++_0x5b0519);}(_0x9494,0x1a7));var _0x4949=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9494[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x4949('0x0'));var emlformat=require(_0x4949('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4949('0x2'));var jsonpatch=require(_0x4949('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4949('0x4'));var Mustache=require('mustache');var util=require(_0x4949('0x5'));var path=require('path');var sox=require(_0x4949('0x6'));var csv=require(_0x4949('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x4949('0x8'));var crypto=require(_0x4949('0x9'));var jsforce=require(_0x4949('0xa'));var deskjs=require(_0x4949('0xb'));var toCsv=require(_0x4949('0x7'));var querystring=require(_0x4949('0xc'));var Papa=require(_0x4949('0xd'));var Redis=require(_0x4949('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4949('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4949('0x10'))(_0x4949('0x11'));var utils=require(_0x4949('0x12'));var config=require('../../config/environment');var db=require(_0x4949('0x13'))['db'];config['redis']=_[_0x4949('0x14')](config['redis'],{'host':_0x4949('0x15'),'port':0x18eb});var socket=require(_0x4949('0x16'))(new Redis(config['redis']));require(_0x4949('0x17'))[_0x4949('0x18')](socket);var jayson=require(_0x4949('0x19'));var client=jayson[_0x4949('0x1a')][_0x4949('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0x4949('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x288000,_0x11537a,_0x3ae0af){if(_0x3ae0af){var _0x5c5745=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5c5745['test'](_0x11537a)){return _0x288000;}else{throw new Error(_0x4949('0x1c'));}}else{return _0x288000;}}function respondWithRpcPromise(_0x464790,_0x437f71,_0x311aaf,_0x243a73){return new BPromise(function(_0x16f287,_0x32dc71){var _0xe4f560=_0x243a73||client;return _0xe4f560['request'](_0x464790,_0x311aaf)[_0x4949('0x1d')](function(_0x7dbd75){logger[_0x4949('0x1e')](_0x4949('0x1f'),_0x437f71,_0x4949('0x20'));logger['debug'](_0x4949('0x21'),_0x437f71,_0x4949('0x20'),JSON[_0x4949('0x22')](_0x7dbd75));if(_0x7dbd75['error']){if(_0x7dbd75[_0x4949('0x23')]['code']===0x1f4){logger[_0x4949('0x23')](_0x4949('0x1f'),_0x437f71,_0x7dbd75[_0x4949('0x23')][_0x4949('0x24')]);return _0x32dc71(_0x7dbd75[_0x4949('0x23')][_0x4949('0x24')]);}logger[_0x4949('0x23')](_0x4949('0x1f'),_0x437f71,_0x7dbd75['error'][_0x4949('0x24')]);return _0x16f287(_0x7dbd75[_0x4949('0x23')][_0x4949('0x24')]);}else{logger[_0x4949('0x1e')](_0x4949('0x1f'),_0x437f71,_0x4949('0x20'));_0x16f287(_0x7dbd75[_0x4949('0x25')][_0x4949('0x24')]);}})['catch'](function(_0x3a43de){logger[_0x4949('0x23')](_0x4949('0x1f'),_0x437f71,_0x3a43de);_0x32dc71(_0x3a43de);});});}function respondWithStatusCode(_0x1a7d3e,_0x4dfe1b){_0x4dfe1b=_0x4dfe1b||0xcc;return function(_0x265e6f){if(_0x265e6f){return _0x1a7d3e['sendStatus'](_0x4dfe1b);}return _0x1a7d3e['status'](_0x4dfe1b)[_0x4949('0x26')]();};}function respondWithResult(_0x35af0b,_0x3782cf){_0x3782cf=_0x3782cf||0xc8;return function(_0x4c9bb3){if(_0x4c9bb3){return _0x35af0b[_0x4949('0x27')](_0x3782cf)[_0x4949('0x28')](_0x4c9bb3);}};}function respondWithFilteredResult(_0x3325d6,_0x2d158a){return function(_0x127e64){if(_0x127e64){var _0x42de57=_0x127e64[_0x4949('0x29')],_0x462d07=_0x2d158a[_0x4949('0x2a')],_0x54490f=_0x2d158a['offset']+_0x2d158a[_0x4949('0x2b')],_0x54239b;if(_0x54490f>=_0x42de57){_0x54490f=_0x42de57;_0x54239b=0xc8;}else{_0x54239b=0xce;}_0x3325d6[_0x4949('0x27')](_0x54239b);return _0x3325d6['set']('Content-Range',_0x462d07+'-'+_0x54490f+'/'+_0x42de57)[_0x4949('0x28')](_0x127e64);}return null;};}function patchUpdates(_0x57a4af){return function(_0x43940b){try{jsonpatch[_0x4949('0x2c')](_0x43940b,_0x57a4af,!![]);}catch(_0x4c7598){return BPromise[_0x4949('0x2d')](_0x4c7598);}return _0x43940b[_0x4949('0x2e')]();};}function saveUpdates(_0x3ee03e,_0x4f3dbb){return function(_0x59ebe2){if(_0x59ebe2){return _0x59ebe2['update'](_0x3ee03e)[_0x4949('0x1d')](function(_0x664d40){return _0x664d40;});}return null;};}function removeEntity(_0x2f0d97,_0x135d82){return function(_0x2cc5ee){if(_0x2cc5ee){return _0x2cc5ee[_0x4949('0x2f')]()[_0x4949('0x1d')](function(){var _0x2da40a=_0x2cc5ee[_0x4949('0x30')]({'plain':!![]});var _0x1d56f1=_0x4949('0x31');return db['UserProfileResource']['destroy']({'where':{'type':_0x1d56f1,'resourceId':_0x2da40a['id']}})[_0x4949('0x1d')](function(){return _0x2cc5ee;});})[_0x4949('0x1d')](function(){_0x2f0d97[_0x4949('0x27')](0xcc)[_0x4949('0x26')]();});}};}function handleEntityNotFound(_0x3d89f1,_0x34cd9e){return function(_0x727c72){if(!_0x727c72){_0x3d89f1[_0x4949('0x32')](0x194);}return _0x727c72;};}function handleError(_0x1b316b,_0x26343c){_0x26343c=_0x26343c||0x1f4;return function(_0x3dcf1c){logger['error'](_0x3dcf1c[_0x4949('0x33')]);if(_0x3dcf1c[_0x4949('0x34')]){delete _0x3dcf1c[_0x4949('0x34')];}_0x1b316b[_0x4949('0x27')](_0x26343c)['send'](_0x3dcf1c);};}exports['index']=function(_0x20186f,_0x46fb96){var _0x29207a={'include':[{'model':db[_0x4949('0x35')],'as':'mandatoryDispositionPause'}]},_0xd6ce71={},_0x3265bd={'count':0x0,'rows':[]};var _0x59508e=db[_0x4949('0x36')][_0x4949('0x37')];_0xd6ce71[_0x4949('0x38')]=_[_0x4949('0x39')](_0x59508e);_0xd6ce71[_0x4949('0x3a')]=_[_0x4949('0x39')](_0x20186f['query']);_0xd6ce71[_0x4949('0x3b')]=_[_0x4949('0x3c')](_0xd6ce71[_0x4949('0x38')],_0xd6ce71[_0x4949('0x3a')]);_0x29207a[_0x4949('0x3d')]=_[_0x4949('0x3c')](_0xd6ce71[_0x4949('0x38')],qs[_0x4949('0x3e')](_0x20186f['query'][_0x4949('0x3e')]));_0x29207a[_0x4949('0x3d')]=_0x29207a[_0x4949('0x3d')]['length']?_0x29207a[_0x4949('0x3d')]:_0xd6ce71[_0x4949('0x38')];if(!_0x20186f['query'][_0x4949('0x3f')](_0x4949('0x40'))){_0x29207a['limit']=qs['limit'](_0x20186f[_0x4949('0x3a')][_0x4949('0x2b')]);_0x29207a[_0x4949('0x2a')]=qs['offset'](_0x20186f[_0x4949('0x3a')][_0x4949('0x2a')]);}_0x29207a[_0x4949('0x41')]=qs['sort'](_0x20186f[_0x4949('0x3a')][_0x4949('0x42')]);_0x29207a[_0x4949('0x43')]=qs['filters'](_[_0x4949('0x44')](_0x20186f[_0x4949('0x3a')],_0xd6ce71[_0x4949('0x3b')]));if(_0x20186f['query']['filter']){_0x29207a[_0x4949('0x43')]=_['merge'](_0x29207a[_0x4949('0x43')],{'$or':_[_0x4949('0x45')](_0x59508e,function(_0xd60f50){if(_0xd60f50[_0x4949('0x46')]['key']!==_0x4949('0x47')){var _0x2f5371={};_0x2f5371[_0xd60f50[_0x4949('0x48')]]={'$like':'%'+_0x20186f[_0x4949('0x3a')][_0x4949('0x49')]+'%'};return _0x2f5371;}})});}_0x29207a=_[_0x4949('0x4a')]({},_0x29207a,_0x20186f[_0x4949('0x4b')]);var _0xc9209={'where':_0x29207a['where']};return db[_0x4949('0x36')][_0x4949('0x29')](_0xc9209)[_0x4949('0x1d')](function(_0x3a2dc3){_0x3265bd['count']=_0x3a2dc3;if(_0x20186f[_0x4949('0x3a')][_0x4949('0x4c')]){_0x29207a[_0x4949('0x4d')]=[{'all':!![]}];}return db[_0x4949('0x36')]['findAll'](_0x29207a);})[_0x4949('0x1d')](function(_0x326fb0){_0x3265bd['rows']=_0x326fb0;return _0x3265bd;})[_0x4949('0x1d')](respondWithFilteredResult(_0x46fb96,_0x29207a))[_0x4949('0x4e')](handleError(_0x46fb96,null));};exports[_0x4949('0x4f')]=function(_0x390d03,_0x2ea8ec){var _0x12643b={'raw':![],'where':{'id':_0x390d03['params']['id']},'include':[{'model':db['Pause'],'as':_0x4949('0x50')}]},_0x2c6f18={};_0x2c6f18[_0x4949('0x38')]=_[_0x4949('0x39')](db['FaxAccount'][_0x4949('0x37')]);_0x2c6f18['query']=_[_0x4949('0x39')](_0x390d03['query']);_0x2c6f18[_0x4949('0x3b')]=_['intersection'](_0x2c6f18[_0x4949('0x38')],_0x2c6f18['query']);_0x12643b['attributes']=_[_0x4949('0x3c')](_0x2c6f18['model'],qs[_0x4949('0x3e')](_0x390d03[_0x4949('0x3a')][_0x4949('0x3e')]));_0x12643b[_0x4949('0x3d')]=_0x12643b['attributes'][_0x4949('0x51')]?_0x12643b[_0x4949('0x3d')]:_0x2c6f18[_0x4949('0x38')];if(_0x390d03[_0x4949('0x3a')]['includeAll']){_0x12643b['include']=[{'all':!![]}];}_0x12643b=_[_0x4949('0x4a')]({},_0x12643b,_0x390d03['options']);return db[_0x4949('0x36')][_0x4949('0x52')](_0x12643b)[_0x4949('0x1d')](handleEntityNotFound(_0x2ea8ec,null))[_0x4949('0x1d')](respondWithResult(_0x2ea8ec,null))[_0x4949('0x4e')](handleError(_0x2ea8ec,null));};exports['create']=function(_0x4ce17c,_0x3b72ce){return db[_0x4949('0x36')][_0x4949('0x53')](_0x4ce17c['body'],{})['then'](function(_0x286dad){var _0x3e5a7f=_0x4ce17c[_0x4949('0x54')][_0x4949('0x30')]({'plain':!![]});if(!_0x3e5a7f)throw new Error(_0x4949('0x55'));if(_0x3e5a7f['role']==='user'){var _0x176d9d=_0x286dad[_0x4949('0x30')]({'plain':!![]});var _0x312ef1=_0x4949('0x31');return db['UserProfileSection']['find']({'where':{'name':_0x312ef1,'userProfileId':_0x3e5a7f[_0x4949('0x56')]},'raw':!![]})[_0x4949('0x1d')](function(_0x3647e1){if(_0x3647e1&&_0x3647e1[_0x4949('0x57')]===0x0){return db['UserProfileResource'][_0x4949('0x53')]({'name':_0x176d9d[_0x4949('0x34')],'resourceId':_0x176d9d['id'],'type':_0x3647e1[_0x4949('0x34')],'sectionId':_0x3647e1['id']},{})[_0x4949('0x1d')](function(){return _0x286dad;});}else{return _0x286dad;}})[_0x4949('0x4e')](function(_0x1eea32){logger[_0x4949('0x23')](_0x4949('0x58'),_0x1eea32);throw _0x1eea32;});}return _0x286dad;})['then'](respondWithResult(_0x3b72ce,0xc9))[_0x4949('0x4e')](handleError(_0x3b72ce,null));};exports['update']=function(_0x58f4a4,_0x5e33ea){if(_0x58f4a4[_0x4949('0x59')]['id']){delete _0x58f4a4[_0x4949('0x59')]['id'];}return db[_0x4949('0x36')]['find']({'where':{'id':_0x58f4a4['params']['id']},'include':[{'model':db[_0x4949('0x35')],'as':_0x4949('0x50')}]})[_0x4949('0x1d')](handleEntityNotFound(_0x5e33ea,null))['then'](saveUpdates(_0x58f4a4[_0x4949('0x59')],null))[_0x4949('0x1d')](respondWithResult(_0x5e33ea,null))[_0x4949('0x4e')](handleError(_0x5e33ea,null));};exports[_0x4949('0x2f')]=function(_0x59abf6,_0x14317c){return db[_0x4949('0x36')][_0x4949('0x52')]({'where':{'id':_0x59abf6[_0x4949('0x5a')]['id']}})[_0x4949('0x1d')](handleEntityNotFound(_0x14317c,null))[_0x4949('0x1d')](removeEntity(_0x14317c,null))[_0x4949('0x4e')](handleError(_0x14317c,null));};exports['describe']=function(_0x57913e,_0x6738c8){return db[_0x4949('0x36')][_0x4949('0x5b')]()[_0x4949('0x1d')](respondWithResult(_0x6738c8,null))['catch'](handleError(_0x6738c8,null));};exports[_0x4949('0x5c')]=function(_0x4a9907,_0x58a208,_0x5a9c60){if(_0x4a9907[_0x4949('0x59')]['id']){delete _0x4a9907[_0x4949('0x59')]['id'];}return db[_0x4949('0x36')]['find']({'where':{'id':_0x4a9907[_0x4949('0x5a')]['id']}})[_0x4949('0x1d')](handleEntityNotFound(_0x58a208,null))[_0x4949('0x1d')](function(_0x1173b1){if(_0x1173b1){_0x4a9907[_0x4949('0x59')]['FaxAccountId']=_0x1173b1['id'];return db[_0x4949('0x5d')][_0x4949('0x53')](_0x4a9907['body']);}})[_0x4949('0x1d')](respondWithResult(_0x58a208,null))[_0x4949('0x4e')](handleError(_0x58a208,null));};exports[_0x4949('0x5e')]=function(_0xf0f22c,_0x495efd,_0x202e0c){var _0x41b992={'raw':![],'where':{}};var _0x372702={};var _0x4b1f7c={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0xf0f22c[_0x4949('0x5a')]['id']}})[_0x4949('0x1d')](handleEntityNotFound(_0x495efd,null))['then'](function(_0x493594){if(_0x493594){_0x372702[_0x4949('0x38')]=_['keys'](db[_0x4949('0x5d')][_0x4949('0x37')]);_0x372702[_0x4949('0x3a')]=_[_0x4949('0x39')](_0xf0f22c[_0x4949('0x3a')]);_0x372702[_0x4949('0x3b')]=_[_0x4949('0x3c')](_0x372702[_0x4949('0x38')],_0x372702[_0x4949('0x3a')]);_0x41b992[_0x4949('0x3d')]=_[_0x4949('0x3c')](_0x372702[_0x4949('0x38')],qs[_0x4949('0x3e')](_0xf0f22c[_0x4949('0x3a')][_0x4949('0x3e')]));_0x41b992[_0x4949('0x3d')]=_0x41b992[_0x4949('0x3d')][_0x4949('0x51')]?_0x41b992['attributes']:_0x372702[_0x4949('0x38')];if(!_0xf0f22c[_0x4949('0x3a')][_0x4949('0x3f')](_0x4949('0x40'))){_0x41b992[_0x4949('0x2b')]=qs[_0x4949('0x2b')](_0xf0f22c[_0x4949('0x3a')]['limit']);_0x41b992[_0x4949('0x2a')]=qs['offset'](_0xf0f22c[_0x4949('0x3a')]['offset']);}_0x41b992['order']=qs[_0x4949('0x42')](_0xf0f22c[_0x4949('0x3a')][_0x4949('0x42')]);_0x41b992['where']=qs[_0x4949('0x3b')](_[_0x4949('0x44')](_0xf0f22c[_0x4949('0x3a')],_0x372702['filters']));_0x41b992['where'][_0x4949('0x5f')]=_0x493594['id'];if(_0xf0f22c['query']['filter']){_0x41b992[_0x4949('0x43')]=_[_0x4949('0x4a')](_0x41b992['where'],{'$or':_['map'](_0x41b992['attributes'],function(_0x31c550){var _0x5c0178={};_0x5c0178[_0x31c550]={'$like':'%'+_0xf0f22c['query'][_0x4949('0x49')]+'%'};return _0x5c0178;})});}_0x41b992=_[_0x4949('0x4a')]({},_0x41b992,_0xf0f22c[_0x4949('0x4b')]);return db[_0x4949('0x5d')]['count']({'where':_0x41b992[_0x4949('0x43')]})[_0x4949('0x1d')](function(_0x161245){_0x4b1f7c[_0x4949('0x29')]=_0x161245;if(_0xf0f22c['query'][_0x4949('0x4c')]){_0x41b992[_0x4949('0x4d')]=[{'all':!![]}];}return db['Disposition'][_0x4949('0x60')](_0x41b992);})[_0x4949('0x1d')](function(_0x13b636){_0x4b1f7c[_0x4949('0x61')]=_0x13b636;return _0x4b1f7c;});}})[_0x4949('0x1d')](respondWithFilteredResult(_0x495efd,_0x41b992))[_0x4949('0x4e')](handleError(_0x495efd,null));};exports[_0x4949('0x62')]=function(_0x1776a9,_0x590687,_0x2a17ac){return db['FaxAccount'][_0x4949('0x52')]({'where':{'id':_0x1776a9[_0x4949('0x5a')]['id']}})[_0x4949('0x1d')](handleEntityNotFound(_0x590687,null))['then'](function(_0x17abc2){if(_0x17abc2){return _0x17abc2[_0x4949('0x62')](_0x1776a9['query'][_0x4949('0x63')]);}})[_0x4949('0x1d')](respondWithStatusCode(_0x590687,null))['catch'](handleError(_0x590687,null));};exports['addAnswer']=function(_0x2e3eec,_0x28efce,_0x10fc6f){if(_0x2e3eec[_0x4949('0x59')]['id']){delete _0x2e3eec[_0x4949('0x59')]['id'];}return db[_0x4949('0x36')][_0x4949('0x52')]({'where':{'id':_0x2e3eec[_0x4949('0x5a')]['id']}})[_0x4949('0x1d')](handleEntityNotFound(_0x28efce,null))[_0x4949('0x1d')](function(_0x4f2dda){if(_0x4f2dda){_0x2e3eec[_0x4949('0x59')]['FaxAccountId']=_0x4f2dda['id'];return db['CannedAnswer'][_0x4949('0x53')](_0x2e3eec[_0x4949('0x59')]);}})[_0x4949('0x1d')](respondWithResult(_0x28efce,null))[_0x4949('0x4e')](handleError(_0x28efce,null));};exports[_0x4949('0x64')]=function(_0x48a100,_0x3edae9,_0x9bf16a){var _0x47a5f3={'raw':![],'where':{}};var _0x23db66={};var _0x4ccdd6={'count':0x0,'rows':[]};return db[_0x4949('0x36')]['findOne']({'where':{'id':_0x48a100[_0x4949('0x5a')]['id']}})[_0x4949('0x1d')](handleEntityNotFound(_0x3edae9,null))[_0x4949('0x1d')](function(_0x4a9b30){if(_0x4a9b30){_0x23db66[_0x4949('0x38')]=_['keys'](db[_0x4949('0x65')]['rawAttributes']);_0x23db66[_0x4949('0x3a')]=_[_0x4949('0x39')](_0x48a100['query']);_0x23db66[_0x4949('0x3b')]=_[_0x4949('0x3c')](_0x23db66[_0x4949('0x38')],_0x23db66[_0x4949('0x3a')]);_0x47a5f3[_0x4949('0x3d')]=_[_0x4949('0x3c')](_0x23db66['model'],qs[_0x4949('0x3e')](_0x48a100[_0x4949('0x3a')][_0x4949('0x3e')]));_0x47a5f3[_0x4949('0x3d')]=_0x47a5f3[_0x4949('0x3d')][_0x4949('0x51')]?_0x47a5f3[_0x4949('0x3d')]:_0x23db66[_0x4949('0x38')];if(!_0x48a100[_0x4949('0x3a')]['hasOwnProperty'](_0x4949('0x40'))){_0x47a5f3[_0x4949('0x2b')]=qs['limit'](_0x48a100['query']['limit']);_0x47a5f3[_0x4949('0x2a')]=qs[_0x4949('0x2a')](_0x48a100[_0x4949('0x3a')][_0x4949('0x2a')]);}_0x47a5f3[_0x4949('0x41')]=qs['sort'](_0x48a100['query'][_0x4949('0x42')]);_0x47a5f3['where']=qs[_0x4949('0x3b')](_['pick'](_0x48a100[_0x4949('0x3a')],_0x23db66[_0x4949('0x3b')]));_0x47a5f3[_0x4949('0x43')]['FaxAccountId']=_0x4a9b30['id'];if(_0x48a100[_0x4949('0x3a')][_0x4949('0x49')]){_0x47a5f3[_0x4949('0x43')]=_[_0x4949('0x4a')](_0x47a5f3[_0x4949('0x43')],{'$or':_[_0x4949('0x45')](_0x47a5f3[_0x4949('0x3d')],function(_0x1e36ae){var _0x5b6afe={};_0x5b6afe[_0x1e36ae]={'$like':'%'+_0x48a100[_0x4949('0x3a')][_0x4949('0x49')]+'%'};return _0x5b6afe;})});}_0x47a5f3=_[_0x4949('0x4a')]({},_0x47a5f3,_0x48a100[_0x4949('0x4b')]);return db[_0x4949('0x65')][_0x4949('0x29')]({'where':_0x47a5f3['where']})[_0x4949('0x1d')](function(_0x59c709){_0x4ccdd6['count']=_0x59c709;if(_0x48a100[_0x4949('0x3a')][_0x4949('0x4c')]){_0x47a5f3[_0x4949('0x4d')]=[{'all':!![]}];}return db[_0x4949('0x65')][_0x4949('0x60')](_0x47a5f3);})[_0x4949('0x1d')](function(_0x35d7fc){_0x4ccdd6[_0x4949('0x61')]=_0x35d7fc;return _0x4ccdd6;});}})[_0x4949('0x1d')](respondWithFilteredResult(_0x3edae9,_0x47a5f3))[_0x4949('0x4e')](handleError(_0x3edae9,null));};exports[_0x4949('0x66')]=function(_0x3f9709,_0x4d9a21,_0x14cd5a){return db[_0x4949('0x36')]['find']({'where':{'id':_0x3f9709['params']['id']}})[_0x4949('0x1d')](handleEntityNotFound(_0x4d9a21,null))['then'](function(_0x57f757){if(_0x57f757){return _0x57f757['removeAnswers'](_0x3f9709['query'][_0x4949('0x63')]);}})[_0x4949('0x1d')](respondWithStatusCode(_0x4d9a21,null))[_0x4949('0x4e')](handleError(_0x4d9a21,null));};exports[_0x4949('0x67')]=function(_0x1a5b3a,_0x39bbd8,_0x40fd7b){return db[_0x4949('0x68')]['find']({'where':{'id':_0x1a5b3a[_0x4949('0x5a')]['id']}})[_0x4949('0x1d')](handleEntityNotFound(_0x39bbd8,null))['then'](function(_0x3c8299){if(_0x3c8299){return _0x3c8299[_0x4949('0x67')](_0x1a5b3a['body'][_0x4949('0x63')],_[_0x4949('0x69')](_0x1a5b3a[_0x4949('0x59')],[_0x4949('0x63'),'id'])||{});}})[_0x4949('0x1d')](respondWithResult(_0x39bbd8,null))[_0x4949('0x4e')](handleError(_0x39bbd8,null));};exports[_0x4949('0x6a')]=function(_0x4bdbfd,_0x56a4f8,_0x3899d8){var _0x346b54={'raw':![],'where':{}};var _0x3988ea={};var _0x2986dd={'count':0x0,'rows':[]};return db[_0x4949('0x36')]['findOne']({'where':{'id':_0x4bdbfd['params']['id']}})[_0x4949('0x1d')](handleEntityNotFound(_0x56a4f8,null))['then'](function(_0x2c4c33){if(_0x2c4c33){_0x3988ea[_0x4949('0x38')]=_[_0x4949('0x39')](db[_0x4949('0x68')][_0x4949('0x37')]);_0x3988ea['query']=_[_0x4949('0x39')](_0x4bdbfd[_0x4949('0x3a')]);_0x3988ea['filters']=_['intersection'](_0x3988ea[_0x4949('0x38')],_0x3988ea[_0x4949('0x3a')]);_0x346b54[_0x4949('0x3d')]=_['intersection'](_0x3988ea[_0x4949('0x38')],qs[_0x4949('0x3e')](_0x4bdbfd[_0x4949('0x3a')]['fields']));_0x346b54[_0x4949('0x3d')]=_0x346b54['attributes'][_0x4949('0x51')]?_0x346b54['attributes']:_0x3988ea['model'];if(!_0x4bdbfd[_0x4949('0x3a')][_0x4949('0x3f')](_0x4949('0x40'))){_0x346b54['limit']=qs[_0x4949('0x2b')](_0x4bdbfd[_0x4949('0x3a')][_0x4949('0x2b')]);_0x346b54[_0x4949('0x2a')]=qs[_0x4949('0x2a')](_0x4bdbfd[_0x4949('0x3a')][_0x4949('0x2a')]);}_0x346b54['order']=qs[_0x4949('0x42')](_0x4bdbfd[_0x4949('0x3a')][_0x4949('0x42')]);_0x346b54[_0x4949('0x43')]=qs[_0x4949('0x3b')](_[_0x4949('0x44')](_0x4bdbfd['query'],_0x3988ea[_0x4949('0x3b')]));_0x346b54[_0x4949('0x43')][_0x4949('0x5f')]=_0x2c4c33['id'];if(_0x4bdbfd[_0x4949('0x3a')][_0x4949('0x49')]){_0x346b54[_0x4949('0x43')]=_[_0x4949('0x4a')](_0x346b54['where'],{'$or':_[_0x4949('0x45')](_0x346b54['attributes'],function(_0x567a5e){var _0x265ba9={};_0x265ba9[_0x567a5e]={'$like':'%'+_0x4bdbfd[_0x4949('0x3a')]['filter']+'%'};return _0x265ba9;})});}_0x346b54=_[_0x4949('0x4a')]({},_0x346b54,_0x4bdbfd[_0x4949('0x4b')]);return db['FaxInteraction'][_0x4949('0x29')]({'where':_0x346b54[_0x4949('0x43')]})[_0x4949('0x1d')](function(_0x3a5341){_0x2986dd[_0x4949('0x29')]=_0x3a5341;if(_0x4bdbfd['query'][_0x4949('0x4c')]){_0x346b54['include']=[{'model':db[_0x4949('0x6b')],'as':_0x4949('0x6c'),'required':![]},{'model':db[_0x4949('0x6d')],'as':'Owner','attributes':['name',_0x4949('0x6e'),_0x4949('0x6f')],'required':![]},{'model':db[_0x4949('0x70')],'as':_0x4949('0x71'),'attributes':['id','name',_0x4949('0x72')],'where':_0x4bdbfd[_0x4949('0x3a')][_0x4949('0x73')]?{'id':_0x4bdbfd[_0x4949('0x3a')][_0x4949('0x73')]}:undefined,'required':_0x4bdbfd[_0x4949('0x3a')][_0x4949('0x73')]?!![]:![]}];}return db[_0x4949('0x68')]['findAll'](_0x346b54);})['then'](function(_0xa1fa67){_0x2986dd[_0x4949('0x61')]=_0xa1fa67;return _0x2986dd;});}})[_0x4949('0x1d')](respondWithFilteredResult(_0x56a4f8,_0x346b54))[_0x4949('0x4e')](handleError(_0x56a4f8,null));};exports['addApplications']=function(_0x1dc922,_0x49880c,_0x1ef51b){return db[_0x4949('0x36')][_0x4949('0x74')]({'where':{'id':_0x1dc922[_0x4949('0x5a')]['id']}})['then'](handleEntityNotFound(_0x49880c,null))['then'](function(_0x14bd5f){if(_0x14bd5f){return db[_0x4949('0x75')][_0x4949('0x76')](function(_0x10c190){return db[_0x4949('0x77')][_0x4949('0x2f')]({'where':{'FaxAccountId':_0x1dc922[_0x4949('0x5a')]['id']},'transaction':_0x10c190})[_0x4949('0x1d')](function(_0x1aef9e){var _0xa93218=_['map'](_0x1dc922[_0x4949('0x59')],function(_0x163e44){_0x163e44[_0x4949('0x5f')]=_0x1dc922[_0x4949('0x5a')]['id'];return _0x163e44;});return db[_0x4949('0x77')][_0x4949('0x78')](_0xa93218,{'transaction':_0x10c190});});})['then'](function(){return db[_0x4949('0x77')][_0x4949('0x79')]({'where':{'FaxAccountId':_0x1dc922[_0x4949('0x5a')]['id']},'order':_0x4949('0x7a')});});}})[_0x4949('0x1d')](respondWithResult(_0x49880c,null))[_0x4949('0x4e')](handleError(_0x49880c,null));};exports[_0x4949('0x7b')]=function(_0x4b313d,_0x2b273a,_0x331d74){var _0x212235={};var _0x3e2e67={};var _0x5471d9;var _0x19a871;return db['FaxAccount'][_0x4949('0x74')]({'where':{'id':_0x4b313d[_0x4949('0x5a')]['id']}})[_0x4949('0x1d')](handleEntityNotFound(_0x2b273a,null))['then'](function(_0x3b6c93){if(_0x3b6c93){_0x5471d9=_0x3b6c93;_0x3e2e67['model']=_[_0x4949('0x39')](db[_0x4949('0x77')]['rawAttributes']);_0x3e2e67[_0x4949('0x3a')]=_[_0x4949('0x39')](_0x4b313d[_0x4949('0x3a')]);_0x3e2e67[_0x4949('0x3b')]=_['intersection'](_0x3e2e67[_0x4949('0x38')],_0x3e2e67['query']);_0x212235[_0x4949('0x3d')]=_[_0x4949('0x3c')](_0x3e2e67[_0x4949('0x38')],qs[_0x4949('0x3e')](_0x4b313d['query'][_0x4949('0x3e')]));_0x212235[_0x4949('0x3d')]=_0x212235[_0x4949('0x3d')][_0x4949('0x51')]?_0x212235[_0x4949('0x3d')]:_0x3e2e67[_0x4949('0x38')];_0x212235['order']=qs[_0x4949('0x42')](_0x4b313d[_0x4949('0x3a')][_0x4949('0x42')]);_0x212235[_0x4949('0x43')]=qs['filters'](_['pick'](_0x4b313d['query'],_0x3e2e67[_0x4949('0x3b')]));if(_0x4b313d[_0x4949('0x3a')][_0x4949('0x49')]){_0x212235[_0x4949('0x43')]=_['merge'](_0x212235['where'],{'$or':_[_0x4949('0x45')](_0x212235[_0x4949('0x3d')],function(_0x4bf7b5){var _0x58f320={};_0x58f320[_0x4bf7b5]={'$like':'%'+_0x4b313d[_0x4949('0x3a')][_0x4949('0x49')]+'%'};return _0x58f320;})});}_0x212235=_['merge']({},_0x212235,_0x4b313d[_0x4949('0x4b')]);return _0x5471d9['getApplications'](_0x212235);}})['then'](function(_0x439216){if(_0x439216){_0x19a871=_0x439216[_0x4949('0x51')];if(!_0x4b313d[_0x4949('0x3a')][_0x4949('0x3f')](_0x4949('0x40'))){_0x212235[_0x4949('0x2b')]=qs['limit'](_0x4b313d['query'][_0x4949('0x2b')]);_0x212235[_0x4949('0x2a')]=qs[_0x4949('0x2a')](_0x4b313d[_0x4949('0x3a')][_0x4949('0x2a')]);}return _0x5471d9[_0x4949('0x7b')](_0x212235);}})[_0x4949('0x1d')](function(_0x9ff238){if(_0x9ff238){return _0x9ff238?{'count':_0x19a871,'rows':_0x9ff238}:null;}})[_0x4949('0x1d')](respondWithResult(_0x2b273a,null))['catch'](handleError(_0x2b273a,null));};function Extension(_0x2d2aff,_0x520f4f,_0x171143,_0x2a3bb4){this[_0x4949('0x7c')]=_0x4949('0x7d');this[_0x4949('0x7e')]=_0x2d2aff[_0x4949('0x7f')];this['app']=_0x2a3bb4;this['type']=_0x4949('0x80');this[_0x4949('0x81')]=_0x4949('0x82');this['FaxAccountId']=_0x2d2aff['id'];this[_0x4949('0x7a')]=_0x520f4f;this[_0x4949('0x83')]=_0x171143;}function createExtensionsReciveFax(_0x1e595a){var _0x50e9b3=0x1;var _0x4cf9d6=[];_0x4cf9d6[_0x4949('0x84')](new Extension(_0x1e595a,_0x50e9b3,'','Answer'));_0x50e9b3+=0x1;_0x4cf9d6[_0x4949('0x84')](new Extension(_0x1e595a,_0x50e9b3,_0x4949('0x85'),'Set'));_0x50e9b3+=0x1;for(var _0x2507b1 in _0x1e595a){if(_0x1e595a[_0x4949('0x3f')](_0x2507b1)&&(_0x2507b1===_0x4949('0x86')||_0x2507b1==='localstationid'||_0x2507b1==='gateway'||_0x2507b1===_0x4949('0x87')||_0x2507b1===_0x4949('0x88')||_0x2507b1===_0x4949('0x89')||_0x2507b1==='minrate'||_0x2507b1==='modem'||_0x2507b1===_0x4949('0x8a'))){_0x4cf9d6[_0x4949('0x84')](new Extension(_0x1e595a,_0x50e9b3,_0x4949('0x8b')+_0x2507b1+')='+_0x1e595a[_0x2507b1],'Set'));_0x50e9b3+=0x1;}}_0x4cf9d6[_0x4949('0x84')](new Extension(_0x1e595a,_0x50e9b3,'6',_0x4949('0x8c')));_0x50e9b3+=0x1;_0x4cf9d6['push'](new Extension(_0x1e595a,_0x50e9b3,_0x4949('0x8d'),'ReceiveFax'));_0x50e9b3=0x0;return _0x4cf9d6;}exports[_0x4949('0x8e')]=function(_0x4890f6,_0x137376,_0x26225d){var _0x4e62e9;return db[_0x4949('0x75')][_0x4949('0x76')](function(_0x1f655c){return db[_0x4949('0x36')]['create'](_0x4890f6[_0x4949('0x59')],{'transaction':_0x1f655c})[_0x4949('0x1d')](function(_0x191810){_0x4e62e9=_0x191810[_0x4949('0x30')]({'plain':!![]});return db['VoiceExtension'][_0x4949('0x78')](createExtensionsReciveFax(_0x4e62e9),{'transaction':_0x1f655c});});})[_0x4949('0x1d')](function(){return _0x4e62e9;})[_0x4949('0x1d')](respondWithResult(_0x137376,null))[_0x4949('0x4e')](handleError(_0x137376,null));};exports[_0x4949('0x8f')]=function(_0xf245c3,_0x3392f4,_0x13432f){var _0x8aace6;return db[_0x4949('0x75')][_0x4949('0x76')](function(_0x3d9965){return db['FaxAccount'][_0x4949('0x90')](_0xf245c3[_0x4949('0x59')],{'where':{'id':_0xf245c3[_0x4949('0x59')]['id']},'transaction':_0x3d9965})['then'](function(_0x107c83){return db[_0x4949('0x91')][_0x4949('0x2f')]({'where':{'FaxAccountId':_0xf245c3[_0x4949('0x59')]['id']},'transaction':_0x3d9965})[_0x4949('0x1d')](function(_0x26d7d0){return db[_0x4949('0x91')][_0x4949('0x78')](createExtensionsReciveFax(_[_0x4949('0x69')](_0xf245c3[_0x4949('0x59')],[_0x4949('0x92'),_0x4949('0x93'),'createdAt',_0x4949('0x94'),'TrunkId',_0x4949('0x95')])),{'transaction':_0x3d9965});});});})[_0x4949('0x1d')](function(){return db[_0x4949('0x36')][_0x4949('0x96')](_0xf245c3[_0x4949('0x59')]['id']);})[_0x4949('0x1d')](respondWithResult(_0x3392f4,null))[_0x4949('0x4e')](handleError(_0x3392f4,null));};exports[_0x4949('0x97')]=function(_0x16a79f,_0x248206,_0x1cc1f3){var _0x227750={'raw':!![],'where':{}};var _0x193a37={};var _0x1bf774={'count':0x0,'rows':[]};return db[_0x4949('0x36')][_0x4949('0x74')]({'where':{'id':_0x16a79f[_0x4949('0x5a')]['id']}})[_0x4949('0x1d')](handleEntityNotFound(_0x248206,null))['then'](function(_0x4fa849){if(_0x4fa849){_0x193a37[_0x4949('0x38')]=_[_0x4949('0x39')](db[_0x4949('0x98')]['rawAttributes']);_0x193a37['query']=_[_0x4949('0x39')](_0x16a79f[_0x4949('0x3a')]);_0x193a37[_0x4949('0x3b')]=_[_0x4949('0x3c')](_0x193a37[_0x4949('0x38')],_0x193a37['query']);_0x227750[_0x4949('0x3d')]=_[_0x4949('0x3c')](_0x193a37[_0x4949('0x38')],qs[_0x4949('0x3e')](_0x16a79f['query']['fields']));_0x227750['attributes']=_0x227750['attributes'][_0x4949('0x51')]?_0x227750[_0x4949('0x3d')]:_0x193a37[_0x4949('0x38')];if(!_0x16a79f[_0x4949('0x3a')][_0x4949('0x3f')](_0x4949('0x40'))){_0x227750[_0x4949('0x2b')]=qs[_0x4949('0x2b')](_0x16a79f['query'][_0x4949('0x2b')]);_0x227750[_0x4949('0x2a')]=qs[_0x4949('0x2a')](_0x16a79f[_0x4949('0x3a')]['offset']);}_0x227750['order']=qs[_0x4949('0x42')](_0x16a79f[_0x4949('0x3a')][_0x4949('0x42')]);_0x227750[_0x4949('0x43')]=qs['filters'](_[_0x4949('0x44')](_0x16a79f['query'],_0x193a37[_0x4949('0x3b')]));_0x227750['where'][_0x4949('0x5f')]=_0x4fa849['id'];if(_0x16a79f['query']['filter']){_0x227750['where']=_['merge'](_0x227750[_0x4949('0x43')],{'$or':_[_0x4949('0x45')](_0x227750[_0x4949('0x3d')],function(_0x1851dd){var _0x3093b5={};_0x3093b5[_0x1851dd]={'$like':'%'+_0x16a79f['query']['filter']+'%'};return _0x3093b5;})});}if(_0x16a79f[_0x4949('0x3a')][_0x4949('0x99')]){var _0x48b8c3=_0x16a79f[_0x4949('0x3a')]['$gte'][_0x4949('0x9a')](',');var _0x517aa2={};_0x517aa2[_0x48b8c3[0x0]]={'$gte':moment(_0x48b8c3[0x1])[_0x4949('0x9b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x227750[_0x4949('0x43')]=_[_0x4949('0x4a')](_0x227750['where'],_0x517aa2);}_0x227750=_['merge']({},_0x227750,_0x16a79f[_0x4949('0x4b')]);return db[_0x4949('0x98')][_0x4949('0x29')]({'where':_0x227750[_0x4949('0x43')]})[_0x4949('0x1d')](function(_0x3bedc6){_0x1bf774[_0x4949('0x29')]=_0x3bedc6;if(_0x16a79f['query']['includeAll']){_0x227750[_0x4949('0x4d')]=[{'all':!![]}];}return db[_0x4949('0x98')][_0x4949('0x60')](_0x227750);})[_0x4949('0x1d')](function(_0x9726ab){_0x1bf774[_0x4949('0x61')]=_0x9726ab;return _0x1bf774;});}})[_0x4949('0x1d')](respondWithFilteredResult(_0x248206,_0x227750))['catch'](handleError(_0x248206,null));};exports[_0x4949('0x9c')]=function(_0x54beb3,_0x340838,_0x20ed80){var _0x4d3ac2,_0x4e041e={},_0x40cadc;if(_0x54beb3[_0x4949('0x59')]['to']){_0x40cadc=_0x54beb3[_0x4949('0x59')]['to'][0x0];}return db[_0x4949('0x36')][_0x4949('0x52')]({'where':{'id':_0x54beb3[_0x4949('0x5a')]['id']},'include':[{'model':db[_0x4949('0x9d')],'as':_0x4949('0x9e'),'include':[{'model':db['CmContact'],'as':_0x4949('0x9f'),'where':{'fax':_0x40cadc},'limit':0x1,'order':[['updatedAt',_0x4949('0xa0')]]}]}]})['then'](handleEntityNotFound(_0x340838,null))[_0x4949('0x1d')](function(_0x4e66d0){_0x4d3ac2=_0x4e66d0;if(_0x54beb3[_0x4949('0x59')][_0x4949('0xa1')]&&_0x54beb3[_0x4949('0x59')][_0x4949('0xa1')][_0x4949('0x51')]){for(var _0x1e77a7=0x0;_0x1e77a7<_0x54beb3[_0x4949('0x59')][_0x4949('0xa1')][_0x4949('0x51')];_0x1e77a7+=0x1){_0x54beb3[_0x4949('0x59')][_0x4949('0xa1')][_0x1e77a7]={'filename':_0x54beb3[_0x4949('0x59')][_0x4949('0xa1')][_0x1e77a7][_0x4949('0x34')],'id':_0x54beb3[_0x4949('0x59')][_0x4949('0xa1')][_0x1e77a7]['id'],'path':path[_0x4949('0xa2')](config[_0x4949('0xa3')],_0x4949('0xa4'),_0x54beb3[_0x4949('0x59')][_0x4949('0xa1')][_0x1e77a7][_0x4949('0xa5')])};}}return respondWithRpcPromise('CheckAfterSend',_0x4949('0xa6'),{'FaxAccountId':_['isNil'](_0x54beb3[_0x4949('0x5a')]['id'])?undefined:_0x54beb3[_0x4949('0x5a')]['id'],'path':_[_0x4949('0xa7')](_0x54beb3[_0x4949('0x59')][_0x4949('0xa1')][0x0][_0x4949('0xa8')])?undefined:_0x54beb3[_0x4949('0x59')][_0x4949('0xa1')][0x0][_0x4949('0xa8')],'fax':_[_0x4949('0xa7')](_0x54beb3['body']['to'][0x0])?undefined:_0x54beb3[_0x4949('0x59')]['to'][0x0]},client9002);})[_0x4949('0x1d')](function(){if(_0x4d3ac2){if(_['isNil'](_0x54beb3[_0x4949('0x59')]['from'])){_0x54beb3[_0x4949('0x59')][_0x4949('0xa9')]=util[_0x4949('0x9b')](_0x4949('0xaa'),_0x4d3ac2['name'],_0x4d3ac2[_0x4949('0xab')]);}if(_0x4d3ac2[_0x4949('0x9e')]){if(_0x4d3ac2[_0x4949('0x9e')][_0x4949('0x9f')][_0x4949('0x51')]){return _0x4d3ac2[_0x4949('0x9e')][_0x4949('0x9f')][0x0];}else{return db['CmContact'][_0x4949('0x53')](_[_0x4949('0x14')](_0x54beb3[_0x4949('0x59')],{'firstName':_0x54beb3[_0x4949('0x59')]['to'][0x0],'phone':_0x54beb3[_0x4949('0x59')]['to'][0x0],'fax':_0x54beb3[_0x4949('0x59')]['to'][0x0],'ListId':_0x4d3ac2['ListId']}));}}else{throw new Error(_0x4949('0xac'));}}else{throw new Error(_0x4949('0xad'));}})[_0x4949('0x1d')](function(_0x8005cc){if(_0x8005cc){return db['FaxInteraction'][_0x4949('0x52')]({'where':{'ContactId':_0x8005cc['id'],'closed':![],'FaxAccountId':_0x4d3ac2['id']}})[_0x4949('0x1d')](function(_0x124a30){if(_0x124a30){return[_0x124a30,![]];}return db[_0x4949('0x68')][_0x4949('0x53')]({'UserId':_0x54beb3['user']['id'],'ContactId':_0x8005cc['id'],'FaxAccountId':_0x4d3ac2['id'],'fax':_0x54beb3[_0x4949('0x59')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x4949('0x4a')](_0x54beb3[_0x4949('0x59')],{'read':![],'body':_0x54beb3[_0x4949('0x59')][_0x4949('0xa1')][0x0]['filename'],'FaxAccountId':_0x4d3ac2['id'],'UserId':_0x54beb3[_0x4949('0x54')]['id'],'ContactId':_0x8005cc['id'],'AttachmentId':_0x54beb3[_0x4949('0x59')][_0x4949('0xa1')][0x0]['id']})]},{'include':[{'model':db[_0x4949('0x98')],'as':_0x4949('0xae')}]})[_0x4949('0x1d')](function(_0x579620){return[_0x579620,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x4949('0xaf')](function(_0x29be37,_0x48f458){if(_0x48f458){return _0x29be37;}return db[_0x4949('0x98')]['create']({'direction':_0x4949('0xb0'),'read':![],'body':_0x54beb3[_0x4949('0x59')][_0x4949('0xa1')][0x0][_0x4949('0xb1')],'FaxAccountId':_0x4d3ac2['id'],'FaxInteractionId':_0x29be37['id'],'UserId':_0x54beb3['user']['id'],'ContactId':_0x29be37['ContactId'],'AttachmentId':_0x54beb3[_0x4949('0x59')]['attachments'][0x0]['id']})[_0x4949('0x1d')](function(_0x347537){_0x29be37['dataValues'][_0x4949('0xae')]=[];_0x29be37['dataValues'][_0x4949('0xae')][_0x4949('0x84')](_0x347537[_0x4949('0xb2')]);return _0x29be37;});})[_0x4949('0x1d')](function(_0x3a9279){respondWithRpcPromise(_0x4949('0xb3'),'SendFax',{'FaxAccountId':_['isNil'](_0x54beb3[_0x4949('0x5a')]['id'])?undefined:_0x54beb3[_0x4949('0x5a')]['id'],'path':_[_0x4949('0xa7')](_0x54beb3[_0x4949('0x59')][_0x4949('0xa1')][0x0][_0x4949('0xa8')])?undefined:_0x54beb3['body'][_0x4949('0xa1')][0x0][_0x4949('0xa8')],'fax':_[_0x4949('0xa7')](_0x54beb3['body']['to'][0x0])?undefined:_0x54beb3['body']['to'][0x0],'AttachmentId':_0x54beb3[_0x4949('0x59')][_0x4949('0xa1')][0x0]['id']},client9002)[_0x4949('0x1d')](function(_0x30e329){logger[_0x4949('0x1e')]('SendFaxRpc,\x20%s',_0x30e329);})[_0x4949('0x4e')](function(_0x5397c7){logger['info'](_0x4949('0xb4'),_0x5397c7);});return _0x3a9279;})[_0x4949('0x1d')](respondWithResult(_0x340838,null))['catch'](handleError(_0x340838,null));};exports['addAgents']=function(_0x49dfee,_0xba9d13,_0x20c3b9){return db[_0x4949('0x36')][_0x4949('0x52')]({'where':{'id':_0x49dfee['params']['id']}})[_0x4949('0x1d')](handleEntityNotFound(_0xba9d13,null))[_0x4949('0x1d')](function(_0x3bc5ed){if(_0x3bc5ed){return _0x3bc5ed[_0x4949('0xb5')](_0x49dfee[_0x4949('0x59')][_0x4949('0x63')],_[_0x4949('0x69')](_0x49dfee[_0x4949('0x59')],[_0x4949('0x63'),'id'])||{})[_0x4949('0xaf')](function(_0x376351){for(var _0x589393=0x0;_0x589393<_0x49dfee['body']['ids'][_0x4949('0x51')];_0x589393+=0x1){socket[_0x4949('0xb6')](_0x4949('0xb7'),{'UserId':_0x49dfee[_0x4949('0x59')][_0x4949('0x63')][_0x589393],'FaxAccountId':_0x49dfee['params']['id']});}return _0x376351;});}})[_0x4949('0x1d')](respondWithResult(_0xba9d13,null))['catch'](handleError(_0xba9d13,null));};exports[_0x4949('0xb8')]=function(_0x8bdaf,_0x19e00f,_0xeb295f){return db[_0x4949('0x36')][_0x4949('0x52')]({'where':{'id':_0x8bdaf[_0x4949('0x5a')]['id']}})[_0x4949('0x1d')](handleEntityNotFound(_0x19e00f,null))[_0x4949('0x1d')](function(_0x2964cb){if(_0x2964cb){return _0x2964cb[_0x4949('0xb8')](_0x8bdaf[_0x4949('0x3a')]['ids'])[_0x4949('0x1d')](function(){if(_[_0x4949('0xb9')](_0x8bdaf['query'][_0x4949('0x63')])){for(var _0x1d1bd5=0x0;_0x1d1bd5<_0x8bdaf['query'][_0x4949('0x63')][_0x4949('0x51')];_0x1d1bd5+=0x1){socket[_0x4949('0xb6')]('userFaxAccount:remove',{'UserId':Number(_0x8bdaf[_0x4949('0x3a')][_0x4949('0x63')][_0x1d1bd5]),'FaxAccountId':Number(_0x8bdaf['params']['id'])});}}else{socket[_0x4949('0xb6')](_0x4949('0xba'),{'UserId':Number(_0x8bdaf[_0x4949('0x3a')]['ids']),'FaxAccountId':Number(_0x8bdaf[_0x4949('0x5a')]['id'])});}});}})[_0x4949('0x1d')](respondWithStatusCode(_0x19e00f,null))[_0x4949('0x4e')](handleError(_0x19e00f,null));};exports[_0x4949('0xbb')]=function(_0x20099c,_0x5e4f5c,_0x172414){var _0x9f6b3d={};var _0x531e3f={};var _0x6c3eb5;var _0x2298b8;return db[_0x4949('0x36')][_0x4949('0x74')]({'where':{'id':_0x20099c[_0x4949('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5e4f5c,null))[_0x4949('0x1d')](function(_0xf64532){if(_0xf64532){_0x6c3eb5=_0xf64532;_0x531e3f['model']=_['keys'](db[_0x4949('0x6d')]['rawAttributes']);_0x531e3f['query']=_[_0x4949('0x39')](_0x20099c['query']);_0x531e3f[_0x4949('0x3b')]=_[_0x4949('0x3c')](_0x531e3f[_0x4949('0x38')],_0x531e3f[_0x4949('0x3a')]);_0x9f6b3d[_0x4949('0x3d')]=_[_0x4949('0x3c')](_0x531e3f[_0x4949('0x38')],qs[_0x4949('0x3e')](_0x20099c[_0x4949('0x3a')][_0x4949('0x3e')]));_0x9f6b3d[_0x4949('0x3d')]=_0x9f6b3d[_0x4949('0x3d')][_0x4949('0x51')]?_0x9f6b3d['attributes']:_0x531e3f[_0x4949('0x38')];_0x9f6b3d[_0x4949('0x41')]=qs[_0x4949('0x42')](_0x20099c[_0x4949('0x3a')][_0x4949('0x42')]);_0x9f6b3d['where']=qs[_0x4949('0x3b')](_['pick'](_0x20099c['query'],_0x531e3f[_0x4949('0x3b')]));if(_0x20099c['query']['filter']){_0x9f6b3d[_0x4949('0x43')]=_[_0x4949('0x4a')](_0x9f6b3d[_0x4949('0x43')],{'$or':_[_0x4949('0x45')](_0x9f6b3d[_0x4949('0x3d')],function(_0x1ee833){var _0x3eae94={};_0x3eae94[_0x1ee833]={'$like':'%'+_0x20099c[_0x4949('0x3a')]['filter']+'%'};return _0x3eae94;})});}_0x9f6b3d=_[_0x4949('0x4a')]({},_0x9f6b3d,_0x20099c[_0x4949('0x4b')]);return _0x6c3eb5[_0x4949('0xbb')](_0x9f6b3d);}})[_0x4949('0x1d')](function(_0x555178){if(_0x555178){_0x2298b8=_0x555178[_0x4949('0x51')];if(!_0x20099c[_0x4949('0x3a')][_0x4949('0x3f')]('nolimit')){_0x9f6b3d[_0x4949('0x2b')]=qs[_0x4949('0x2b')](_0x20099c[_0x4949('0x3a')][_0x4949('0x2b')]);_0x9f6b3d[_0x4949('0x2a')]=qs[_0x4949('0x2a')](_0x20099c[_0x4949('0x3a')][_0x4949('0x2a')]);}return _0x6c3eb5[_0x4949('0xbb')](_0x9f6b3d);}})['then'](function(_0xc7c2ea){if(_0xc7c2ea){return _0xc7c2ea?{'count':_0x2298b8,'rows':_0xc7c2ea}:null;}})[_0x4949('0x1d')](respondWithResult(_0x5e4f5c,null))['catch'](handleError(_0x5e4f5c,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 4c5fe03..3e06150 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 _0x2d10=['emit','hook','exports','../../mysqldb','setMaxListeners','save','remove'];(function(_0x31feec,_0x400f0a){var _0x4f58f8=function(_0xb88050){while(--_0xb88050){_0x31feec['push'](_0x31feec['shift']());}};_0x4f58f8(++_0x400f0a);}(_0x2d10,0x1ca));var _0x02d1=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x2d10[_0x2d34d6];return _0x1d3d12;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x02d1('0x0'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x02d1('0x1')](0x0);var events={'afterCreate':_0x02d1('0x2'),'afterUpdate':'update','afterDestroy':_0x02d1('0x3')};function emitEvent(_0x590017){return function(_0x59bd63,_0x325923,_0x120d06){FaxAccountEvents[_0x02d1('0x4')](_0x590017+':'+_0x59bd63['id'],_0x59bd63);FaxAccountEvents[_0x02d1('0x4')](_0x590017,_0x59bd63);_0x120d06(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x02d1('0x5')](e,emitEvent(event));}}module[_0x02d1('0x6')]=FaxAccountEvents; \ No newline at end of file +var _0xd3c0=['hook','exports','../../mysqldb','FaxAccount','setMaxListeners','update','emit'];(function(_0x4d4979,_0x1628c3){var _0x3fa237=function(_0x254b58){while(--_0x254b58){_0x4d4979['push'](_0x4d4979['shift']());}};_0x3fa237(++_0x1628c3);}(_0xd3c0,0x80));var _0x0d3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3c0[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x0d3c('0x0'))['db'][_0x0d3c('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x0d3c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0d3c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5bbb32){return function(_0x36f3ca,_0x299202,_0x2114bf){FaxAccountEvents['emit'](_0x5bbb32+':'+_0x36f3ca['id'],_0x36f3ca);FaxAccountEvents[_0x0d3c('0x4')](_0x5bbb32,_0x36f3ca);_0x2114bf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x0d3c('0x5')](e,emitEvent(event));}}module[_0x0d3c('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 b1cfbff..5bfa00f 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 _0x0e99=['fax_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount'];(function(_0x12795a,_0x2636f8){var _0x3328fb=function(_0x459ac4){while(--_0x459ac4){_0x12795a['push'](_0x12795a['shift']());}};_0x3328fb(++_0x2636f8);}(_0x0e99,0xeb));var _0x90e9=function(_0x308f79,_0x121c42){_0x308f79=_0x308f79-0x0;var _0x71490e=_0x0e99[_0x308f79];return _0x71490e;};'use strict';var _=require(_0x90e9('0x0'));var util=require(_0x90e9('0x1'));var logger=require(_0x90e9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x90e9('0x3'));var rp=require(_0x90e9('0x4'));var fs=require('fs');var path=require(_0x90e9('0x5'));var rimraf=require(_0x90e9('0x6'));var config=require(_0x90e9('0x7'));var attributes=require(_0x90e9('0x8'));module[_0x90e9('0x9')]=function(_0x3f3fd1,_0xc86496){return _0x3f3fd1[_0x90e9('0xa')](_0x90e9('0xb'),attributes,{'tableName':_0x90e9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x158e=['./faxAccount.attributes','define','FaxAccount','fax_accounts','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x41247e,_0x391be3){var _0x2bdc98=function(_0x447976){while(--_0x447976){_0x41247e['push'](_0x41247e['shift']());}};_0x2bdc98(++_0x391be3);}(_0x158e,0x1f0));var _0xe158=function(_0x3cc97f,_0x10cd91){_0x3cc97f=_0x3cc97f-0x0;var _0x155c28=_0x158e[_0x3cc97f];return _0x155c28;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe158('0x0'))(_0xe158('0x1'));var moment=require(_0xe158('0x2'));var BPromise=require(_0xe158('0x3'));var rp=require(_0xe158('0x4'));var fs=require('fs');var path=require(_0xe158('0x5'));var rimraf=require(_0xe158('0x6'));var config=require(_0xe158('0x7'));var attributes=require(_0xe158('0x8'));module['exports']=function(_0x26310a,_0x497a71){return _0x26310a[_0xe158('0x9')](_0xe158('0xa'),attributes,{'tableName':_0xe158('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 2e0edaf..7ad4837 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 _0x68bc=['interaction','FaxMessage','ContactId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','GetFaxAccount','FaxAccount','options','raw','where','attributes','limit','include','map','model','debug','catch','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','List','Contacts','DESC','FaxApplication','account','applications','list','orderBy','priority','asc','Applications','create','contact','FaxInteraction','spread','get','length','close','unmanaged','created'];(function(_0x87bfa1,_0x37bfe0){var _0x5609d6=function(_0x1d86fe){while(--_0x1d86fe){_0x87bfa1['push'](_0x87bfa1['shift']());}};_0x5609d6(++_0x37bfe0);}(_0x68bc,0xbc));var _0xc68b=function(_0x1aee2d,_0x2ec407){_0x1aee2d=_0x1aee2d-0x0;var _0x226351=_0x68bc[_0x1aee2d];return _0x226351;};'use strict';var _=require(_0xc68b('0x0'));var util=require('util');var moment=require(_0xc68b('0x1'));var BPromise=require('bluebird');var rs=require(_0xc68b('0x2'));var fs=require('fs');var Redis=require(_0xc68b('0x3'));var db=require(_0xc68b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc68b('0x5'))(_0xc68b('0x6'));var config=require(_0xc68b('0x7'));var jayson=require(_0xc68b('0x8'));var client=jayson['client'][_0xc68b('0x9')]({'port':0x232c});config[_0xc68b('0xa')]=_[_0xc68b('0xb')](config[_0xc68b('0xa')],{'host':_0xc68b('0xc'),'port':0x18eb});var socket=require(_0xc68b('0xd'))(new Redis(config[_0xc68b('0xa')]));require('./faxAccount.socket')[_0xc68b('0xe')](socket);function respondWithRpcPromise(_0x1098e4,_0x3a6b4d,_0x56131c){return new BPromise(function(_0x2bf193,_0x57c2b7){return client[_0xc68b('0xf')](_0x1098e4,_0x56131c)[_0xc68b('0x10')](function(_0x1ca641){logger['info'](_0xc68b('0x11'),_0x3a6b4d,_0xc68b('0x12'));logger['debug'](_0xc68b('0x13'),_0x3a6b4d,_0xc68b('0x12'),JSON['stringify'](_0x1ca641));if(_0x1ca641[_0xc68b('0x14')]){if(_0x1ca641[_0xc68b('0x14')][_0xc68b('0x15')]===0x1f4){logger['error'](_0xc68b('0x11'),_0x3a6b4d,_0x1ca641[_0xc68b('0x14')]['message']);return _0x57c2b7(_0x1ca641['error'][_0xc68b('0x16')]);}logger['error'](_0xc68b('0x11'),_0x3a6b4d,_0x1ca641[_0xc68b('0x14')][_0xc68b('0x16')]);return _0x2bf193(_0x1ca641[_0xc68b('0x14')][_0xc68b('0x16')]);}else{logger[_0xc68b('0x17')]('FaxAccount,\x20%s,\x20%s',_0x3a6b4d,_0xc68b('0x12'));_0x2bf193(_0x1ca641[_0xc68b('0x18')][_0xc68b('0x16')]);}})['catch'](function(_0x3bdbae){logger[_0xc68b('0x14')](_0xc68b('0x11'),_0x3a6b4d,_0x3bdbae);_0x57c2b7(_0x3bdbae);});});}exports[_0xc68b('0x19')]=function(_0x339307){var _0x23c62c=this;return new Promise(function(_0x4194a1,_0x4da806){return db[_0xc68b('0x1a')]['findAll']({'raw':_0x339307['options']?_0x339307[_0xc68b('0x1b')][_0xc68b('0x1c')]===undefined?!![]:![]:!![],'where':_0x339307[_0xc68b('0x1b')]?_0x339307[_0xc68b('0x1b')][_0xc68b('0x1d')]||null:null,'attributes':_0x339307[_0xc68b('0x1b')]?_0x339307['options'][_0xc68b('0x1e')]||null:null,'limit':_0x339307['options']?_0x339307[_0xc68b('0x1b')][_0xc68b('0x1f')]||null:null,'include':_0x339307[_0xc68b('0x1b')]?_0x339307['options'][_0xc68b('0x20')]?_[_0xc68b('0x21')](_0x339307[_0xc68b('0x1b')][_0xc68b('0x20')],function(_0x435a51){return{'model':db[_0x435a51['model']],'as':_0x435a51['as'],'attributes':_0x435a51[_0xc68b('0x1e')],'include':_0x435a51['include']?_[_0xc68b('0x21')](_0x435a51[_0xc68b('0x20')],function(_0x45f775){return{'model':db[_0x45f775[_0xc68b('0x22')]],'as':_0x45f775['as'],'attributes':_0x45f775[_0xc68b('0x1e')],'include':_0x45f775[_0xc68b('0x20')]?_[_0xc68b('0x21')](_0x45f775[_0xc68b('0x20')],function(_0x4637bb){return{'model':db[_0x4637bb['model']],'as':_0x4637bb['as'],'attributes':_0x4637bb[_0xc68b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc68b('0x10')](function(_0xca8036){logger[_0xc68b('0x17')](_0xc68b('0x19'),_0x339307);logger[_0xc68b('0x23')](_0xc68b('0x19'),_0x339307,JSON['stringify'](_0xca8036));_0x4194a1(_0xca8036);})[_0xc68b('0x24')](function(_0x412ce8){logger[_0xc68b('0x14')](_0xc68b('0x19'),_0x412ce8['message'],_0x339307);_0x4da806(_0x23c62c[_0xc68b('0x14')](0x1f4,_0x412ce8['message']));});});};exports[_0xc68b('0x25')]=function(_0x1a22b0,_0x5eefc0,_0xde973e){var _0x3a46b1=this;return new Promise(function(_0x8ed2a5,_0x139306){var _0x15387e={'body':_0x1a22b0[_0xc68b('0x26')],'channel':_0xc68b('0x27')};var _0x46488e=[];var _0xb0aba3=[];var _0x14f88a={};return db[_0xc68b('0x28')][_0xc68b('0x29')]()[_0xc68b('0x10')](function(_0x156e55){if(!_0x156e55){throw new db[(_0xc68b('0x2a'))][(_0xc68b('0x2b'))](_0xc68b('0x2c'));}_0x46488e=_[_0xc68b('0x2d')](_[_0xc68b('0x2e')](_0x156e55),[_0xc68b('0x2f'),_0xc68b('0x30')]);_0xb0aba3=_['difference'](_[_0xc68b('0x2e')](_0x156e55),['createdAt',_0xc68b('0x30'),_0xc68b('0x31'),_0xc68b('0x32')]);if(_0x1a22b0['body']['id']){delete _0x1a22b0[_0xc68b('0x26')]['id'];}if(_['isNil'](_0x1a22b0[_0xc68b('0x26')][_0xc68b('0x33')])){throw new db[(_0xc68b('0x2a'))][(_0xc68b('0x2b'))](_0xc68b('0x34'));}if(_[_0xc68b('0x35')](_0x1a22b0[_0xc68b('0x26')]['body'])||_0x1a22b0[_0xc68b('0x26')]['body']===''){throw new db[(_0xc68b('0x2a'))][(_0xc68b('0x2b'))](_0xc68b('0x36'));}if(_[_0xc68b('0x35')](_0x1a22b0['body'][_0xc68b('0x37')])){throw new db[(_0xc68b('0x2a'))][(_0xc68b('0x2b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xb0aba3);}if(!_[_0xc68b('0x38')](_0xb0aba3,_0x1a22b0['body']['mapKey'])){throw new db['Sequelize']['ValidationError'](_0xc68b('0x39')+_0xb0aba3);}_0x14f88a[_0x1a22b0['body'][_0xc68b('0x37')]]=_0x1a22b0[_0xc68b('0x26')][_0xc68b('0x33')];})[_0xc68b('0x10')](function(){return db['FaxAccount'][_0xc68b('0x3a')]({'where':{'id':_0x1a22b0['account']['id']},'include':[{'model':db['CmList'],'as':_0xc68b('0x3b'),'include':[{'model':db[_0xc68b('0x28')],'as':_0xc68b('0x3c'),'where':_0x14f88a,'limit':0x1,'order':[[_0xc68b('0x30'),_0xc68b('0x3d')]]}]},{'model':db[_0xc68b('0x3e')],'as':'Applications'}]});})[_0xc68b('0x10')](function(_0x281d15){if(_0x281d15&&_0x281d15[_0xc68b('0x3b')]){var _0x51eb02=_0x281d15['get']({'plain':!![]});_0x15387e[_0xc68b('0x3f')]=_0x51eb02;_0x15387e[_0xc68b('0x40')]=_0x51eb02['Applications'];_0x15387e[_0xc68b('0x41')]=_0x51eb02[_0xc68b('0x3b')];_0x15387e[_0xc68b('0x40')]=_[_0xc68b('0x42')](_0x15387e[_0xc68b('0x40')],[_0xc68b('0x43')],[_0xc68b('0x44')]);if(_0x15387e[_0xc68b('0x3f')]['Applications']){delete _0x15387e[_0xc68b('0x3f')][_0xc68b('0x45')];}if(_0x15387e[_0xc68b('0x3f')][_0xc68b('0x3b')]&&_0x15387e['account']['List'][_0xc68b('0x3c')]['length']){return _0x15387e[_0xc68b('0x3f')][_0xc68b('0x3b')][_0xc68b('0x3c')][0x0];}var _0x56187d=_[_0xc68b('0xb')](_0x1a22b0[_0xc68b('0x26')],{'firstName':_0x1a22b0['body'][_0xc68b('0x33')],'ListId':_0x51eb02['ListId']});_0x56187d[_0x1a22b0[_0xc68b('0x26')][_0xc68b('0x37')]]=_0x1a22b0[_0xc68b('0x26')][_0xc68b('0x33')];return db['CmContact'][_0xc68b('0x46')](_0x56187d,{'fields':_0x46488e,'raw':!![]});}})[_0xc68b('0x10')](function(_0x1c56b1){_0x15387e[_0xc68b('0x47')]=_0x1c56b1;if(_0x1c56b1){var _0x3c6f80={'ContactId':_0x1c56b1['id'],'FaxAccountId':_0x1a22b0['account']['id'],'fax':_0x1c56b1[_0xc68b('0x27')]};return db[_0xc68b('0x48')]['find']({'where':{'ContactId':_0x1c56b1['id'],'closed':![],'FaxAccountId':_0x1a22b0[_0xc68b('0x3f')]['id']}})[_0xc68b('0x10')](function(_0x4fb251){if(_0x4fb251){return[_0x4fb251,![]];}return db['FaxInteraction'][_0xc68b('0x46')](_0x3c6f80)[_0xc68b('0x10')](function(_0x209b69){return[_0x209b69,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xc68b('0x49')](function(_0x227845,_0xde9fd6){var _0x3b79e5=_0x227845[_0xc68b('0x4a')]({'plain':!![]});if(_0xde9fd6){if(_0x15387e[_0xc68b('0x3f')]['autoclose']){_0x15387e[_0xc68b('0x40')]['push']({'id':0x0,'priority':_0x15387e[_0xc68b('0x40')][_0xc68b('0x4b')]+0x1,'app':_0xc68b('0x4c'),'appdata':_0xc68b('0x4d'),'interval':'*,*,*,*'});}_0x3b79e5[_0xc68b('0x4e')]=!![];}else{_0x3b79e5[_0xc68b('0x4e')]=![];}_0x15387e[_0xc68b('0x4f')]=_0x3b79e5;return db[_0xc68b('0x50')]['create']({'body':_0x1a22b0[_0xc68b('0x26')]['body'],'FaxAccountId':_0x1a22b0[_0xc68b('0x3f')]['id'],'FaxInteractionId':_0x227845['id'],'direction':'in','ContactId':_0x227845[_0xc68b('0x51')],'AttachmentId':_0x1a22b0['body']['AttachmentId']});})[_0xc68b('0x10')](function(_0x3ad1cd){_0x15387e[_0xc68b('0x16')]=_0x3ad1cd;if(_0x15387e[_0xc68b('0x4f')][_0xc68b('0x52')]){return db[_0xc68b('0x53')][_0xc68b('0x3a')]({'attributes':['id',_0xc68b('0x54')],'where':{'id':_0x15387e[_0xc68b('0x4f')][_0xc68b('0x52')]}})['then'](function(_0x50750b){if(_0x50750b){_0x15387e['applications'][_0xc68b('0x55')]({'id':0x0,'priority':0x0,'app':_0xc68b('0x56'),'appdata':_0x50750b[_0xc68b('0x54')]+','+(_0x15387e[_0xc68b('0x3f')][_0xc68b('0x57')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xc68b('0x58'),'startRouting',_0x15387e);});}return respondWithRpcPromise(_0xc68b('0x58'),'startRouting',_0x15387e);})[_0xc68b('0x10')](function(_0x555cd6){_0x8ed2a5(_0x555cd6);})['catch'](function(_0x10cbcd){_0x139306(_0x3a46b1['error'](0x1f4,_0x10cbcd['message']));});});}; \ No newline at end of file +var _0x07a5=['info','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','include','map','model','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','asc','create','contact','FaxInteraction','find','Contact\x20not\x20found','spread','length','unmanaged','*,*,*,*','created','interaction','AttachmentId','User','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','util','moment','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x149dcf,_0xd50b61){var _0x200529=function(_0x42317a){while(--_0x42317a){_0x149dcf['push'](_0x149dcf['shift']());}};_0x200529(++_0xd50b61);}(_0x07a5,0x96));var _0x507a=function(_0x79cd47,_0x16102d){_0x79cd47=_0x79cd47-0x0;var _0x3b9484=_0x07a5[_0x79cd47];return _0x3b9484;};'use strict';var _=require('lodash');var util=require(_0x507a('0x0'));var moment=require(_0x507a('0x1'));var BPromise=require('bluebird');var rs=require(_0x507a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x507a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x507a('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x507a('0x5'));var client=jayson[_0x507a('0x6')][_0x507a('0x7')]({'port':0x232c});config[_0x507a('0x8')]=_[_0x507a('0x9')](config[_0x507a('0x8')],{'host':_0x507a('0xa'),'port':0x18eb});var socket=require(_0x507a('0xb'))(new Redis(config[_0x507a('0x8')]));require(_0x507a('0xc'))[_0x507a('0xd')](socket);function respondWithRpcPromise(_0x4ee197,_0x5884cc,_0x20a7d8){return new BPromise(function(_0x6992d9,_0x161796){return client[_0x507a('0xe')](_0x4ee197,_0x20a7d8)[_0x507a('0xf')](function(_0x1d465b){logger['info'](_0x507a('0x10'),_0x5884cc,_0x507a('0x11'));logger[_0x507a('0x12')](_0x507a('0x13'),_0x5884cc,'request\x20sent',JSON[_0x507a('0x14')](_0x1d465b));if(_0x1d465b[_0x507a('0x15')]){if(_0x1d465b[_0x507a('0x15')][_0x507a('0x16')]===0x1f4){logger['error'](_0x507a('0x10'),_0x5884cc,_0x1d465b[_0x507a('0x15')][_0x507a('0x17')]);return _0x161796(_0x1d465b[_0x507a('0x15')][_0x507a('0x17')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x5884cc,_0x1d465b[_0x507a('0x15')]['message']);return _0x6992d9(_0x1d465b[_0x507a('0x15')][_0x507a('0x17')]);}else{logger[_0x507a('0x18')](_0x507a('0x10'),_0x5884cc,_0x507a('0x11'));_0x6992d9(_0x1d465b[_0x507a('0x19')]['message']);}})[_0x507a('0x1a')](function(_0x33a5cb){logger[_0x507a('0x15')](_0x507a('0x10'),_0x5884cc,_0x33a5cb);_0x161796(_0x33a5cb);});});}exports[_0x507a('0x1b')]=function(_0x2b2c5e){var _0x19bd60=this;return new Promise(function(_0x239450,_0x38545b){return db[_0x507a('0x1c')][_0x507a('0x1d')]({'raw':_0x2b2c5e[_0x507a('0x1e')]?_0x2b2c5e[_0x507a('0x1e')][_0x507a('0x1f')]===undefined?!![]:![]:!![],'where':_0x2b2c5e[_0x507a('0x1e')]?_0x2b2c5e[_0x507a('0x1e')][_0x507a('0x20')]||null:null,'attributes':_0x2b2c5e[_0x507a('0x1e')]?_0x2b2c5e['options'][_0x507a('0x21')]||null:null,'limit':_0x2b2c5e[_0x507a('0x1e')]?_0x2b2c5e[_0x507a('0x1e')]['limit']||null:null,'include':_0x2b2c5e[_0x507a('0x1e')]?_0x2b2c5e['options'][_0x507a('0x22')]?_[_0x507a('0x23')](_0x2b2c5e['options'][_0x507a('0x22')],function(_0x50454f){return{'model':db[_0x50454f[_0x507a('0x24')]],'as':_0x50454f['as'],'attributes':_0x50454f['attributes'],'include':_0x50454f[_0x507a('0x22')]?_[_0x507a('0x23')](_0x50454f['include'],function(_0x5e8266){return{'model':db[_0x5e8266[_0x507a('0x24')]],'as':_0x5e8266['as'],'attributes':_0x5e8266['attributes'],'include':_0x5e8266[_0x507a('0x22')]?_['map'](_0x5e8266[_0x507a('0x22')],function(_0x2164eb){return{'model':db[_0x2164eb[_0x507a('0x24')]],'as':_0x2164eb['as'],'attributes':_0x2164eb[_0x507a('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x108425){logger['info'](_0x507a('0x1b'),_0x2b2c5e);logger[_0x507a('0x12')](_0x507a('0x1b'),_0x2b2c5e,JSON[_0x507a('0x14')](_0x108425));_0x239450(_0x108425);})[_0x507a('0x1a')](function(_0x3cd494){logger[_0x507a('0x15')]('GetFaxAccount',_0x3cd494[_0x507a('0x17')],_0x2b2c5e);_0x38545b(_0x19bd60['error'](0x1f4,_0x3cd494[_0x507a('0x17')]));});});};exports[_0x507a('0x25')]=function(_0x38c2b7,_0xd84480,_0x3d0873){var _0x52f8dc=this;return new Promise(function(_0x31f8c7,_0x3f9a6d){var _0x156ea6={'body':_0x38c2b7[_0x507a('0x26')],'channel':_0x507a('0x27')};var _0x590a78=[];var _0x4eef57=[];var _0xb7077e={};return db[_0x507a('0x28')][_0x507a('0x29')]()[_0x507a('0xf')](function(_0x19f8c9){if(!_0x19f8c9){throw new db[(_0x507a('0x2a'))][(_0x507a('0x2b'))](_0x507a('0x2c'));}_0x590a78=_[_0x507a('0x2d')](_[_0x507a('0x2e')](_0x19f8c9),['createdAt',_0x507a('0x2f')]);_0x4eef57=_['difference'](_[_0x507a('0x2e')](_0x19f8c9),[_0x507a('0x30'),_0x507a('0x2f'),_0x507a('0x31'),'ListId']);if(_0x38c2b7['body']['id']){delete _0x38c2b7['body']['id'];}if(_[_0x507a('0x32')](_0x38c2b7[_0x507a('0x26')][_0x507a('0x33')])){throw new db[(_0x507a('0x2a'))][(_0x507a('0x2b'))](_0x507a('0x34'));}if(_[_0x507a('0x32')](_0x38c2b7[_0x507a('0x26')][_0x507a('0x26')])||_0x38c2b7[_0x507a('0x26')][_0x507a('0x26')]===''){throw new db[(_0x507a('0x2a'))][(_0x507a('0x2b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x507a('0x32')](_0x38c2b7[_0x507a('0x26')][_0x507a('0x35')])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4eef57);}if(!_['includes'](_0x4eef57,_0x38c2b7[_0x507a('0x26')][_0x507a('0x35')])){throw new db[(_0x507a('0x2a'))]['ValidationError'](_0x507a('0x36')+_0x4eef57);}_0xb7077e[_0x38c2b7[_0x507a('0x26')][_0x507a('0x35')]]=_0x38c2b7[_0x507a('0x26')]['from'];})[_0x507a('0xf')](function(){return db[_0x507a('0x1c')]['find']({'where':{'id':_0x38c2b7[_0x507a('0x37')]['id']},'include':[{'model':db[_0x507a('0x38')],'as':_0x507a('0x39'),'include':[{'model':db[_0x507a('0x28')],'as':_0x507a('0x3a'),'where':_0xb7077e,'limit':0x1,'order':[[_0x507a('0x2f'),_0x507a('0x3b')]]}]},{'model':db[_0x507a('0x3c')],'as':_0x507a('0x3d')}]});})[_0x507a('0xf')](function(_0x59978d){if(_0x59978d&&_0x59978d[_0x507a('0x39')]){var _0x41eade=_0x59978d[_0x507a('0x3e')]({'plain':!![]});_0x156ea6[_0x507a('0x37')]=_0x41eade;_0x156ea6[_0x507a('0x3f')]=_0x41eade[_0x507a('0x3d')];_0x156ea6[_0x507a('0x40')]=_0x41eade['List'];_0x156ea6[_0x507a('0x3f')]=_[_0x507a('0x41')](_0x156ea6[_0x507a('0x3f')],['priority'],[_0x507a('0x42')]);if(_0x156ea6[_0x507a('0x37')][_0x507a('0x3d')]){delete _0x156ea6[_0x507a('0x37')][_0x507a('0x3d')];}if(_0x156ea6['account'][_0x507a('0x39')]&&_0x156ea6[_0x507a('0x37')][_0x507a('0x39')][_0x507a('0x3a')]['length']){return _0x156ea6[_0x507a('0x37')][_0x507a('0x39')][_0x507a('0x3a')][0x0];}var _0x382d6e=_['defaults'](_0x38c2b7[_0x507a('0x26')],{'firstName':_0x38c2b7['body'][_0x507a('0x33')],'ListId':_0x41eade['ListId']});_0x382d6e[_0x38c2b7[_0x507a('0x26')][_0x507a('0x35')]]=_0x38c2b7[_0x507a('0x26')][_0x507a('0x33')];return db[_0x507a('0x28')][_0x507a('0x43')](_0x382d6e,{'fields':_0x590a78,'raw':!![]});}})[_0x507a('0xf')](function(_0x203161){_0x156ea6[_0x507a('0x44')]=_0x203161;if(_0x203161){var _0x3ce1ff={'ContactId':_0x203161['id'],'FaxAccountId':_0x38c2b7[_0x507a('0x37')]['id'],'fax':_0x203161[_0x507a('0x27')]};return db[_0x507a('0x45')][_0x507a('0x46')]({'where':{'ContactId':_0x203161['id'],'closed':![],'FaxAccountId':_0x38c2b7[_0x507a('0x37')]['id']}})[_0x507a('0xf')](function(_0x36e19a){if(_0x36e19a){return[_0x36e19a,![]];}return db['FaxInteraction'][_0x507a('0x43')](_0x3ce1ff)[_0x507a('0xf')](function(_0x597415){return[_0x597415,!![]];});});}else{throw new Error(_0x507a('0x47'));}})[_0x507a('0x48')](function(_0x7ea683,_0x51a9d0){var _0x4250cd=_0x7ea683['get']({'plain':!![]});if(_0x51a9d0){if(_0x156ea6['account']['autoclose']){_0x156ea6[_0x507a('0x3f')]['push']({'id':0x0,'priority':_0x156ea6[_0x507a('0x3f')][_0x507a('0x49')]+0x1,'app':'close','appdata':_0x507a('0x4a'),'interval':_0x507a('0x4b')});}_0x4250cd[_0x507a('0x4c')]=!![];}else{_0x4250cd[_0x507a('0x4c')]=![];}_0x156ea6[_0x507a('0x4d')]=_0x4250cd;return db['FaxMessage'][_0x507a('0x43')]({'body':_0x38c2b7[_0x507a('0x26')][_0x507a('0x26')],'FaxAccountId':_0x38c2b7[_0x507a('0x37')]['id'],'FaxInteractionId':_0x7ea683['id'],'direction':'in','ContactId':_0x7ea683['ContactId'],'AttachmentId':_0x38c2b7[_0x507a('0x26')][_0x507a('0x4e')]});})[_0x507a('0xf')](function(_0x4be873){_0x156ea6[_0x507a('0x17')]=_0x4be873;if(_0x156ea6[_0x507a('0x4d')]['UserId']){return db[_0x507a('0x4f')][_0x507a('0x46')]({'attributes':['id',_0x507a('0x50')],'where':{'id':_0x156ea6[_0x507a('0x4d')][_0x507a('0x51')]}})[_0x507a('0xf')](function(_0x305024){if(_0x305024){_0x156ea6[_0x507a('0x3f')][_0x507a('0x52')]({'id':0x0,'priority':0x0,'app':_0x507a('0x53'),'appdata':_0x305024[_0x507a('0x50')]+','+(_0x156ea6[_0x507a('0x37')][_0x507a('0x54')]||0xa),'interval':_0x507a('0x4b')});}return respondWithRpcPromise(_0x507a('0x55'),'startRouting',_0x156ea6);});}return respondWithRpcPromise(_0x507a('0x55'),_0x507a('0x56'),_0x156ea6);})[_0x507a('0xf')](function(_0x22eb82){_0x31f8c7(_0x22eb82);})[_0x507a('0x1a')](function(_0x351ed2){_0x3f9a6d(_0x52f8dc[_0x507a('0x15')](0x1f4,_0x351ed2[_0x507a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index bd78aeb..a723a4d 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 _0xb9f5=['faxAccount:','./faxAccount.events','update','removeListener','register','length'];(function(_0x5ad086,_0x2f1993){var _0xd7405d=function(_0x3f5295){while(--_0x3f5295){_0x5ad086['push'](_0x5ad086['shift']());}};_0xd7405d(++_0x2f1993);}(_0xb9f5,0x91));var _0x5b9f=function(_0x156e60,_0x18ef4b){_0x156e60=_0x156e60-0x0;var _0xe8a8e3=_0xb9f5[_0x156e60];return _0xe8a8e3;};'use strict';var FaxAccountEvents=require(_0x5b9f('0x0'));var events=['save','remove',_0x5b9f('0x1')];function createListener(_0x139e94,_0x2ce13f){return function(_0x5ad2cd){_0x2ce13f['emit'](_0x139e94,_0x5ad2cd);};}function removeListener(_0x4f9f42,_0x3fb016){return function(){FaxAccountEvents[_0x5b9f('0x2')](_0x4f9f42,_0x3fb016);};}exports[_0x5b9f('0x3')]=function(_0x3484b5){for(var _0x17614e=0x0,_0x3aa076=events[_0x5b9f('0x4')];_0x17614e<_0x3aa076;_0x17614e++){var _0x5037e7=events[_0x17614e];var _0x4c552a=createListener(_0x5b9f('0x5')+_0x5037e7,_0x3484b5);FaxAccountEvents['on'](_0x5037e7,_0x4c552a);}}; \ No newline at end of file +var _0xa418=['removeListener','register','faxAccount:','./faxAccount.events','save','update'];(function(_0x438d82,_0x20e205){var _0x289719=function(_0x3752f7){while(--_0x3752f7){_0x438d82['push'](_0x438d82['shift']());}};_0x289719(++_0x20e205);}(_0xa418,0x81));var _0x8a41=function(_0x4f62d3,_0x5dd23f){_0x4f62d3=_0x4f62d3-0x0;var _0x5aa236=_0xa418[_0x4f62d3];return _0x5aa236;};'use strict';var FaxAccountEvents=require(_0x8a41('0x0'));var events=[_0x8a41('0x1'),'remove',_0x8a41('0x2')];function createListener(_0x3af675,_0x5aeea7){return function(_0x39a081){_0x5aeea7['emit'](_0x3af675,_0x39a081);};}function removeListener(_0x425cc4,_0x64f0b9){return function(){FaxAccountEvents[_0x8a41('0x3')](_0x425cc4,_0x64f0b9);};}exports[_0x8a41('0x4')]=function(_0x1776d9){for(var _0x3ebe69=0x0,_0x5bb780=events['length'];_0x3ebe69<_0x5bb780;_0x3ebe69++){var _0x3e2679=events[_0x3ebe69];var _0x59d7d7=createListener(_0x8a41('0x5')+_0x3e2679,_0x1776d9);FaxAccountEvents['on'](_0x3e2679,_0x59d7d7);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 994b8d6..45f18da 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 _0x6791=['index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','getApplications','/:id/messages','/:id/users','getAgents','post','create','addDisposition','addAnswer','addInteraction','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','send','put','update','delete','destroy','removeAgents','exports','util','connect-timeout','express','../../components/auth/service','./faxAccount.controller','get','isAuthenticated'];(function(_0x394e25,_0x4ea781){var _0x553a4c=function(_0x4f1b9f){while(--_0x4f1b9f){_0x394e25['push'](_0x394e25['shift']());}};_0x553a4c(++_0x4ea781);}(_0x6791,0x121));var _0x1679=function(_0x282530,_0x5a31b2){_0x282530=_0x282530-0x0;var _0x266c57=_0x6791[_0x282530];return _0x266c57;};'use strict';var multer=require('multer');var util=require(_0x1679('0x0'));var path=require('path');var timeout=require(_0x1679('0x1'));var express=require(_0x1679('0x2'));var router=express['Router']();var auth=require(_0x1679('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1679('0x4'));router[_0x1679('0x5')]('/',auth[_0x1679('0x6')](),controller[_0x1679('0x7')]);router['get'](_0x1679('0x8'),auth['isAuthenticated'](),controller[_0x1679('0x9')]);router[_0x1679('0x5')](_0x1679('0xa'),auth[_0x1679('0x6')](),controller[_0x1679('0xb')]);router[_0x1679('0x5')](_0x1679('0xc'),auth[_0x1679('0x6')](),controller['getDispositions']);router[_0x1679('0x5')](_0x1679('0xd'),auth[_0x1679('0x6')](),controller[_0x1679('0xe')]);router['get'](_0x1679('0xf'),auth[_0x1679('0x6')](),controller[_0x1679('0x10')]);router[_0x1679('0x5')]('/:id/applications',auth[_0x1679('0x6')](),controller[_0x1679('0x11')]);router['get'](_0x1679('0x12'),auth[_0x1679('0x6')](),controller['getMessages']);router['get'](_0x1679('0x13'),auth[_0x1679('0x6')](),controller[_0x1679('0x14')]);router[_0x1679('0x15')]('/',auth['isAuthenticated'](),controller[_0x1679('0x16')]);router[_0x1679('0x15')](_0x1679('0xc'),auth['isAuthenticated'](),controller[_0x1679('0x17')]);router['post'](_0x1679('0xd'),auth['isAuthenticated'](),controller[_0x1679('0x18')]);router[_0x1679('0x15')](_0x1679('0xf'),auth[_0x1679('0x6')](),controller[_0x1679('0x19')]);router[_0x1679('0x15')]('/:id/applications',auth[_0x1679('0x6')](),controller['addApplications']);router[_0x1679('0x15')](_0x1679('0x1a'),auth[_0x1679('0x6')](),controller[_0x1679('0x1b')]);router[_0x1679('0x15')](_0x1679('0x1c'),auth['isAuthenticated'](),controller[_0x1679('0x1d')]);router[_0x1679('0x15')]('/:id/send',auth[_0x1679('0x6')](),controller[_0x1679('0x1e')]);router[_0x1679('0x15')](_0x1679('0x13'),auth[_0x1679('0x6')](),controller['addAgents']);router[_0x1679('0x1f')](_0x1679('0xa'),auth[_0x1679('0x6')](),controller[_0x1679('0x20')]);router[_0x1679('0x21')]('/:id',auth[_0x1679('0x6')](),controller[_0x1679('0x22')]);router[_0x1679('0x21')](_0x1679('0xc'),auth[_0x1679('0x6')](),controller['removeDispositions']);router[_0x1679('0x21')]('/:id/canned_answers',auth[_0x1679('0x6')](),controller['removeAnswers']);router[_0x1679('0x21')]('/:id/users',auth[_0x1679('0x6')](),controller[_0x1679('0x23')]);module[_0x1679('0x24')]=router; \ No newline at end of file +var _0x4253=['removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','isAuthenticated','/describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/interactions','getInteractions','/:id/messages','/:id/users','post','create','addDisposition','addInteraction','/:id/applications','addApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','put','destroy','delete'];(function(_0x50e34a,_0x62a89b){var _0x8eb295=function(_0x547a9b){while(--_0x547a9b){_0x50e34a['push'](_0x50e34a['shift']());}};_0x8eb295(++_0x62a89b);}(_0x4253,0x180));var _0x3425=function(_0x251baf,_0x7ffd3e){_0x251baf=_0x251baf-0x0;var _0x5b22f0=_0x4253[_0x251baf];return _0x5b22f0;};'use strict';var multer=require(_0x3425('0x0'));var util=require('util');var path=require(_0x3425('0x1'));var timeout=require(_0x3425('0x2'));var express=require(_0x3425('0x3'));var router=express[_0x3425('0x4')]();var auth=require(_0x3425('0x5'));var interaction=require(_0x3425('0x6'));var config=require(_0x3425('0x7'));var controller=require(_0x3425('0x8'));router['get']('/',auth[_0x3425('0x9')](),controller['index']);router['get'](_0x3425('0xa'),auth[_0x3425('0x9')](),controller['describe']);router[_0x3425('0xb')](_0x3425('0xc'),auth[_0x3425('0x9')](),controller[_0x3425('0xd')]);router['get'](_0x3425('0xe'),auth[_0x3425('0x9')](),controller[_0x3425('0xf')]);router[_0x3425('0xb')](_0x3425('0x10'),auth[_0x3425('0x9')](),controller['getAnswers']);router[_0x3425('0xb')](_0x3425('0x11'),auth[_0x3425('0x9')](),controller[_0x3425('0x12')]);router[_0x3425('0xb')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x3425('0xb')](_0x3425('0x13'),auth[_0x3425('0x9')](),controller['getMessages']);router[_0x3425('0xb')](_0x3425('0x14'),auth[_0x3425('0x9')](),controller['getAgents']);router[_0x3425('0x15')]('/',auth[_0x3425('0x9')](),controller[_0x3425('0x16')]);router['post'](_0x3425('0xe'),auth[_0x3425('0x9')](),controller[_0x3425('0x17')]);router[_0x3425('0x15')](_0x3425('0x10'),auth[_0x3425('0x9')](),controller['addAnswer']);router[_0x3425('0x15')]('/:id/interactions',auth[_0x3425('0x9')](),controller[_0x3425('0x18')]);router[_0x3425('0x15')](_0x3425('0x19'),auth[_0x3425('0x9')](),controller[_0x3425('0x1a')]);router[_0x3425('0x15')]('/addaccountapplications',auth[_0x3425('0x9')](),controller['addAccountApplications']);router[_0x3425('0x15')](_0x3425('0x1b'),auth[_0x3425('0x9')](),controller[_0x3425('0x1c')]);router[_0x3425('0x15')](_0x3425('0x1d'),auth['isAuthenticated'](),controller[_0x3425('0x1e')]);router[_0x3425('0x15')](_0x3425('0x14'),auth[_0x3425('0x9')](),controller['addAgents']);router[_0x3425('0x1f')](_0x3425('0xc'),auth[_0x3425('0x9')](),controller['update']);router['delete']('/:id',auth[_0x3425('0x9')](),controller[_0x3425('0x20')]);router[_0x3425('0x21')]('/:id/dispositions',auth[_0x3425('0x9')](),controller[_0x3425('0x22')]);router['delete'](_0x3425('0x10'),auth[_0x3425('0x9')](),controller[_0x3425('0x23')]);router['delete'](_0x3425('0x14'),auth['isAuthenticated'](),controller[_0x3425('0x24')]);module[_0x3425('0x25')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index c54340e..fa8950a 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 _0xd545=['STRING','noop','*,*,*,*','sequelize'];(function(_0x11ab2c,_0x4ebf1c){var _0x41af3d=function(_0x406746){while(--_0x406746){_0x11ab2c['push'](_0x11ab2c['shift']());}};_0x41af3d(++_0x4ebf1c);}(_0xd545,0xff));var _0x5d54=function(_0x4b0edc,_0x2a4e25){_0x4b0edc=_0x4b0edc-0x0;var _0x46df73=_0xd545[_0x4b0edc];return _0x46df73;};'use strict';var Sequelize=require(_0x5d54('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5d54('0x1')],'allowNull':![],'defaultValue':_0x5d54('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x5d54('0x1')]},'interval':{'type':Sequelize[_0x5d54('0x1')],'defaultValue':_0x5d54('0x3')}}; \ No newline at end of file +var _0xdba3=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0x11538a,_0xe393e0){var _0x181122=function(_0x152e50){while(--_0x152e50){_0x11538a['push'](_0x11538a['shift']());}};_0x181122(++_0xe393e0);}(_0xdba3,0x19f));var _0x3dba=function(_0x135eaa,_0x5663ca){_0x135eaa=_0x135eaa-0x0;var _0x4da243=_0xdba3[_0x135eaa];return _0x4da243;};'use strict';var Sequelize=require(_0x3dba('0x0'));module[_0x3dba('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x3dba('0x2')],'allowNull':![],'defaultValue':_0x3dba('0x3')},'appdata':{'type':Sequelize[_0x3dba('0x4')]()},'description':{'type':Sequelize[_0x3dba('0x2')]},'interval':{'type':Sequelize[_0x3dba('0x2')],'defaultValue':_0x3dba('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 2f7f801..972b399 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 _0x7217=['send','index','FaxApplication','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','type','key','VIRTUAL','field','includeAll','findAll','rows','catch','show','params','include','merge','options','find','create','body','update','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','json','apply','reject','save','then','destroy','end','error','stack','name'];(function(_0x3fbebf,_0x496648){var _0x105cf7=function(_0x4c1d6a){while(--_0x4c1d6a){_0x3fbebf['push'](_0x3fbebf['shift']());}};_0x105cf7(++_0x496648);}(_0x7217,0x19e));var _0x7721=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x7217[_0x34bc30];return _0x5706de;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7721('0x14'));var logger=require(_0x7721('0x15'))(_0x7721('0x16'));var utils=require(_0x7721('0x17'));var config=require(_0x7721('0x18'));var db=require(_0x7721('0x19'))['db'];function respondWithStatusCode(_0x1e7fd7,_0x27b36b){_0x27b36b=_0x27b36b||0xcc;return function(_0x55b4ca){if(_0x55b4ca){return _0x1e7fd7[_0x7721('0x1a')](_0x27b36b);}return _0x1e7fd7[_0x7721('0x1b')](_0x27b36b)['end']();};}function respondWithResult(_0x109900,_0x30da54){_0x30da54=_0x30da54||0xc8;return function(_0x3f01c5){if(_0x3f01c5){return _0x109900[_0x7721('0x1b')](_0x30da54)['json'](_0x3f01c5);}};}function respondWithFilteredResult(_0x3cbce8,_0x25b1c0){return function(_0x534f1b){if(_0x534f1b){var _0x4e199a=_0x534f1b[_0x7721('0x1c')],_0x4b183e=_0x25b1c0[_0x7721('0x1d')],_0x5ed54=_0x25b1c0['offset']+_0x25b1c0[_0x7721('0x1e')],_0x25a628;if(_0x5ed54>=_0x4e199a){_0x5ed54=_0x4e199a;_0x25a628=0xc8;}else{_0x25a628=0xce;}_0x3cbce8['status'](_0x25a628);return _0x3cbce8[_0x7721('0x1f')]('Content-Range',_0x4b183e+'-'+_0x5ed54+'/'+_0x4e199a)[_0x7721('0x20')](_0x534f1b);}return null;};}function patchUpdates(_0x4e96fb){return function(_0x3ab5a5){try{jsonpatch[_0x7721('0x21')](_0x3ab5a5,_0x4e96fb,!![]);}catch(_0x2286e5){return BPromise[_0x7721('0x22')](_0x2286e5);}return _0x3ab5a5[_0x7721('0x23')]();};}function saveUpdates(_0x413263,_0x3b29ac){return function(_0xaeccc4){if(_0xaeccc4){return _0xaeccc4['update'](_0x413263)[_0x7721('0x24')](function(_0x2c1583){return _0x2c1583;});}return null;};}function removeEntity(_0x3a053f,_0xd8ad3c){return function(_0x57140c){if(_0x57140c){return _0x57140c[_0x7721('0x25')]()['then'](function(){_0x3a053f[_0x7721('0x1b')](0xcc)[_0x7721('0x26')]();});}};}function handleEntityNotFound(_0x3e8a4e,_0x1caad8){return function(_0x121cc4){if(!_0x121cc4){_0x3e8a4e[_0x7721('0x1a')](0x194);}return _0x121cc4;};}function handleError(_0x2c6b7b,_0x5b4d74){_0x5b4d74=_0x5b4d74||0x1f4;return function(_0x216f20){logger[_0x7721('0x27')](_0x216f20[_0x7721('0x28')]);if(_0x216f20[_0x7721('0x29')]){delete _0x216f20[_0x7721('0x29')];}_0x2c6b7b[_0x7721('0x1b')](_0x5b4d74)[_0x7721('0x2a')](_0x216f20);};}exports[_0x7721('0x2b')]=function(_0x40f367,_0x52316e){var _0x258ddf={},_0x5b0551={},_0x499b87={'count':0x0,'rows':[]};var _0x315202=db[_0x7721('0x2c')][_0x7721('0x2d')];_0x5b0551[_0x7721('0x2e')]=_[_0x7721('0x2f')](_0x315202);_0x5b0551[_0x7721('0x30')]=_[_0x7721('0x2f')](_0x40f367[_0x7721('0x30')]);_0x5b0551['filters']=_[_0x7721('0x31')](_0x5b0551[_0x7721('0x2e')],_0x5b0551['query']);_0x258ddf['attributes']=_[_0x7721('0x31')](_0x5b0551[_0x7721('0x2e')],qs['fields'](_0x40f367[_0x7721('0x30')][_0x7721('0x32')]));_0x258ddf[_0x7721('0x33')]=_0x258ddf['attributes'][_0x7721('0x34')]?_0x258ddf[_0x7721('0x33')]:_0x5b0551[_0x7721('0x2e')];if(!_0x40f367[_0x7721('0x30')][_0x7721('0x35')]('nolimit')){_0x258ddf[_0x7721('0x1e')]=qs[_0x7721('0x1e')](_0x40f367[_0x7721('0x30')]['limit']);_0x258ddf[_0x7721('0x1d')]=qs[_0x7721('0x1d')](_0x40f367['query'][_0x7721('0x1d')]);}_0x258ddf['order']=qs[_0x7721('0x36')](_0x40f367[_0x7721('0x30')][_0x7721('0x36')]);_0x258ddf[_0x7721('0x37')]=qs[_0x7721('0x38')](_[_0x7721('0x39')](_0x40f367[_0x7721('0x30')],_0x5b0551[_0x7721('0x38')]));if(_0x40f367[_0x7721('0x30')][_0x7721('0x3a')]){_0x258ddf[_0x7721('0x37')]=_['merge'](_0x258ddf[_0x7721('0x37')],{'$or':_['map'](_0x315202,function(_0x212384){if(_0x212384[_0x7721('0x3b')][_0x7721('0x3c')]!==_0x7721('0x3d')){var _0x3968f3={};_0x3968f3[_0x212384[_0x7721('0x3e')]]={'$like':'%'+_0x40f367['query']['filter']+'%'};return _0x3968f3;}})});}_0x258ddf=_['merge']({},_0x258ddf,_0x40f367['options']);var _0x18001c={'where':_0x258ddf[_0x7721('0x37')]};return db[_0x7721('0x2c')][_0x7721('0x1c')](_0x18001c)['then'](function(_0xa389fa){_0x499b87['count']=_0xa389fa;if(_0x40f367[_0x7721('0x30')][_0x7721('0x3f')]){_0x258ddf['include']=[{'all':!![]}];}return db[_0x7721('0x2c')][_0x7721('0x40')](_0x258ddf);})['then'](function(_0x4d0111){_0x499b87[_0x7721('0x41')]=_0x4d0111;return _0x499b87;})[_0x7721('0x24')](respondWithFilteredResult(_0x52316e,_0x258ddf))[_0x7721('0x42')](handleError(_0x52316e,null));};exports[_0x7721('0x43')]=function(_0x577af9,_0x2db173){var _0x120de9={'raw':!![],'where':{'id':_0x577af9[_0x7721('0x44')]['id']}},_0x40ce8c={};_0x40ce8c[_0x7721('0x2e')]=_['keys'](db[_0x7721('0x2c')]['rawAttributes']);_0x40ce8c[_0x7721('0x30')]=_['keys'](_0x577af9[_0x7721('0x30')]);_0x40ce8c[_0x7721('0x38')]=_[_0x7721('0x31')](_0x40ce8c['model'],_0x40ce8c[_0x7721('0x30')]);_0x120de9[_0x7721('0x33')]=_[_0x7721('0x31')](_0x40ce8c['model'],qs[_0x7721('0x32')](_0x577af9[_0x7721('0x30')][_0x7721('0x32')]));_0x120de9[_0x7721('0x33')]=_0x120de9[_0x7721('0x33')][_0x7721('0x34')]?_0x120de9[_0x7721('0x33')]:_0x40ce8c['model'];if(_0x577af9['query'][_0x7721('0x3f')]){_0x120de9[_0x7721('0x45')]=[{'all':!![]}];}_0x120de9=_[_0x7721('0x46')]({},_0x120de9,_0x577af9[_0x7721('0x47')]);return db[_0x7721('0x2c')][_0x7721('0x48')](_0x120de9)[_0x7721('0x24')](handleEntityNotFound(_0x2db173,null))[_0x7721('0x24')](respondWithResult(_0x2db173,null))[_0x7721('0x42')](handleError(_0x2db173,null));};exports[_0x7721('0x49')]=function(_0x5460cd,_0x578867){return db[_0x7721('0x2c')][_0x7721('0x49')](_0x5460cd[_0x7721('0x4a')],{})[_0x7721('0x24')](respondWithResult(_0x578867,0xc9))['catch'](handleError(_0x578867,null));};exports[_0x7721('0x4b')]=function(_0x2d5a88,_0x56c3d9){if(_0x2d5a88[_0x7721('0x4a')]['id']){delete _0x2d5a88['body']['id'];}return db[_0x7721('0x2c')]['find']({'where':{'id':_0x2d5a88[_0x7721('0x44')]['id']}})[_0x7721('0x24')](handleEntityNotFound(_0x56c3d9,null))[_0x7721('0x24')](saveUpdates(_0x2d5a88['body'],null))[_0x7721('0x24')](respondWithResult(_0x56c3d9,null))[_0x7721('0x42')](handleError(_0x56c3d9,null));};exports['destroy']=function(_0x223d93,_0x1196c2){return db[_0x7721('0x2c')]['find']({'where':{'id':_0x223d93[_0x7721('0x44')]['id']}})['then'](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x24')](removeEntity(_0x1196c2,null))[_0x7721('0x42')](handleError(_0x1196c2,null));}; \ No newline at end of file +var _0x34e8=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','set','Content-Range','apply','reject','save','update','then','stack','name','send','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','key','VIRTUAL','field','options','FaxApplication','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','params','destroy','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x34e8,0x12c));var _0x834e=function(_0xdfa81d,_0x57c506){_0xdfa81d=_0xdfa81d-0x0;var _0x81645e=_0x34e8[_0xdfa81d];return _0x81645e;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var Redis=require(_0x834e('0x13'));var authService=require(_0x834e('0x14'));var qs=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var db=require(_0x834e('0x1b'))['db'];function respondWithStatusCode(_0x2fd95c,_0x538bb3){_0x538bb3=_0x538bb3||0xcc;return function(_0x5e5b6d){if(_0x5e5b6d){return _0x2fd95c[_0x834e('0x1c')](_0x538bb3);}return _0x2fd95c['status'](_0x538bb3)[_0x834e('0x1d')]();};}function respondWithResult(_0x2d95f2,_0x28e659){_0x28e659=_0x28e659||0xc8;return function(_0x21cc0a){if(_0x21cc0a){return _0x2d95f2['status'](_0x28e659)[_0x834e('0x1e')](_0x21cc0a);}};}function respondWithFilteredResult(_0x302cbd,_0x57274a){return function(_0x316205){if(_0x316205){var _0x4a9cdc=_0x316205[_0x834e('0x1f')],_0x38a8cd=_0x57274a[_0x834e('0x20')],_0x36d443=_0x57274a[_0x834e('0x20')]+_0x57274a['limit'],_0x478afe;if(_0x36d443>=_0x4a9cdc){_0x36d443=_0x4a9cdc;_0x478afe=0xc8;}else{_0x478afe=0xce;}_0x302cbd[_0x834e('0x21')](_0x478afe);return _0x302cbd[_0x834e('0x22')](_0x834e('0x23'),_0x38a8cd+'-'+_0x36d443+'/'+_0x4a9cdc)[_0x834e('0x1e')](_0x316205);}return null;};}function patchUpdates(_0x237947){return function(_0x254677){try{jsonpatch[_0x834e('0x24')](_0x254677,_0x237947,!![]);}catch(_0x595515){return BPromise[_0x834e('0x25')](_0x595515);}return _0x254677[_0x834e('0x26')]();};}function saveUpdates(_0x113ff4,_0x325a99){return function(_0x4ab05d){if(_0x4ab05d){return _0x4ab05d[_0x834e('0x27')](_0x113ff4)[_0x834e('0x28')](function(_0x5a05c0){return _0x5a05c0;});}return null;};}function removeEntity(_0x1b4bdf,_0x28d687){return function(_0x8d406e){if(_0x8d406e){return _0x8d406e['destroy']()['then'](function(){_0x1b4bdf[_0x834e('0x21')](0xcc)[_0x834e('0x1d')]();});}};}function handleEntityNotFound(_0x589dde,_0x25ee1d){return function(_0x1dc1e0){if(!_0x1dc1e0){_0x589dde['sendStatus'](0x194);}return _0x1dc1e0;};}function handleError(_0x3bc4f7,_0x2e1983){_0x2e1983=_0x2e1983||0x1f4;return function(_0x338636){logger['error'](_0x338636[_0x834e('0x29')]);if(_0x338636[_0x834e('0x2a')]){delete _0x338636['name'];}_0x3bc4f7['status'](_0x2e1983)[_0x834e('0x2b')](_0x338636);};}exports['index']=function(_0x2826ec,_0x3f1b0b){var _0x3db026={},_0x2cc2eb={},_0x3cd928={'count':0x0,'rows':[]};var _0x130cc5=db['FaxApplication']['rawAttributes'];_0x2cc2eb['model']=_['keys'](_0x130cc5);_0x2cc2eb[_0x834e('0x2c')]=_[_0x834e('0x2d')](_0x2826ec[_0x834e('0x2c')]);_0x2cc2eb['filters']=_[_0x834e('0x2e')](_0x2cc2eb[_0x834e('0x2f')],_0x2cc2eb[_0x834e('0x2c')]);_0x3db026[_0x834e('0x30')]=_[_0x834e('0x2e')](_0x2cc2eb[_0x834e('0x2f')],qs[_0x834e('0x31')](_0x2826ec[_0x834e('0x2c')][_0x834e('0x31')]));_0x3db026['attributes']=_0x3db026[_0x834e('0x30')]['length']?_0x3db026[_0x834e('0x30')]:_0x2cc2eb[_0x834e('0x2f')];if(!_0x2826ec[_0x834e('0x2c')][_0x834e('0x32')](_0x834e('0x33'))){_0x3db026[_0x834e('0x34')]=qs[_0x834e('0x34')](_0x2826ec[_0x834e('0x2c')][_0x834e('0x34')]);_0x3db026[_0x834e('0x20')]=qs['offset'](_0x2826ec[_0x834e('0x2c')][_0x834e('0x20')]);}_0x3db026[_0x834e('0x35')]=qs[_0x834e('0x36')](_0x2826ec['query'][_0x834e('0x36')]);_0x3db026[_0x834e('0x37')]=qs['filters'](_['pick'](_0x2826ec['query'],_0x2cc2eb[_0x834e('0x38')]));if(_0x2826ec[_0x834e('0x2c')][_0x834e('0x39')]){_0x3db026[_0x834e('0x37')]=_[_0x834e('0x3a')](_0x3db026[_0x834e('0x37')],{'$or':_['map'](_0x130cc5,function(_0x2c2d94){if(_0x2c2d94['type'][_0x834e('0x3b')]!==_0x834e('0x3c')){var _0x47abed={};_0x47abed[_0x2c2d94[_0x834e('0x3d')]]={'$like':'%'+_0x2826ec[_0x834e('0x2c')]['filter']+'%'};return _0x47abed;}})});}_0x3db026=_['merge']({},_0x3db026,_0x2826ec[_0x834e('0x3e')]);var _0xd0d43a={'where':_0x3db026[_0x834e('0x37')]};return db[_0x834e('0x3f')][_0x834e('0x1f')](_0xd0d43a)['then'](function(_0x1c5ed6){_0x3cd928['count']=_0x1c5ed6;if(_0x2826ec['query'][_0x834e('0x40')]){_0x3db026['include']=[{'all':!![]}];}return db[_0x834e('0x3f')][_0x834e('0x41')](_0x3db026);})[_0x834e('0x28')](function(_0x3c59af){_0x3cd928[_0x834e('0x42')]=_0x3c59af;return _0x3cd928;})['then'](respondWithFilteredResult(_0x3f1b0b,_0x3db026))[_0x834e('0x43')](handleError(_0x3f1b0b,null));};exports[_0x834e('0x44')]=function(_0x38f266,_0x58c5fb){var _0x35380e={'raw':!![],'where':{'id':_0x38f266['params']['id']}},_0x16ac45={};_0x16ac45[_0x834e('0x2f')]=_['keys'](db[_0x834e('0x3f')][_0x834e('0x45')]);_0x16ac45['query']=_['keys'](_0x38f266[_0x834e('0x2c')]);_0x16ac45[_0x834e('0x38')]=_[_0x834e('0x2e')](_0x16ac45[_0x834e('0x2f')],_0x16ac45[_0x834e('0x2c')]);_0x35380e[_0x834e('0x30')]=_[_0x834e('0x2e')](_0x16ac45['model'],qs[_0x834e('0x31')](_0x38f266['query'][_0x834e('0x31')]));_0x35380e['attributes']=_0x35380e[_0x834e('0x30')]['length']?_0x35380e[_0x834e('0x30')]:_0x16ac45[_0x834e('0x2f')];if(_0x38f266['query'][_0x834e('0x40')]){_0x35380e[_0x834e('0x46')]=[{'all':!![]}];}_0x35380e=_[_0x834e('0x3a')]({},_0x35380e,_0x38f266[_0x834e('0x3e')]);return db[_0x834e('0x3f')][_0x834e('0x47')](_0x35380e)[_0x834e('0x28')](handleEntityNotFound(_0x58c5fb,null))[_0x834e('0x28')](respondWithResult(_0x58c5fb,null))[_0x834e('0x43')](handleError(_0x58c5fb,null));};exports[_0x834e('0x48')]=function(_0x5f3943,_0x3124be){return db[_0x834e('0x3f')]['create'](_0x5f3943[_0x834e('0x49')],{})[_0x834e('0x28')](respondWithResult(_0x3124be,0xc9))[_0x834e('0x43')](handleError(_0x3124be,null));};exports[_0x834e('0x27')]=function(_0x19b5ef,_0x4264b8){if(_0x19b5ef['body']['id']){delete _0x19b5ef['body']['id'];}return db[_0x834e('0x3f')][_0x834e('0x47')]({'where':{'id':_0x19b5ef[_0x834e('0x4a')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0x4264b8,null))[_0x834e('0x28')](saveUpdates(_0x19b5ef[_0x834e('0x49')],null))[_0x834e('0x28')](respondWithResult(_0x4264b8,null))[_0x834e('0x43')](handleError(_0x4264b8,null));};exports[_0x834e('0x4b')]=function(_0x390c45,_0xf02f0d){return db[_0x834e('0x3f')][_0x834e('0x47')]({'where':{'id':_0x390c45[_0x834e('0x4a')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x28')](removeEntity(_0xf02f0d,null))[_0x834e('0x43')](handleError(_0xf02f0d,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index ed43287..8e3a2f4 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 _0x34e8=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x65c903,_0x41e920){var _0x23e1d7=function(_0x4279cd){while(--_0x4279cd){_0x65c903['push'](_0x65c903['shift']());}};_0x23e1d7(++_0x41e920);}(_0x34e8,0x12c));var _0x834e=function(_0xa5e975,_0x39da96){_0xa5e975=_0xa5e975-0x0;var _0x4c33eb=_0x34e8[_0xa5e975];return _0x4c33eb;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x834e('0xd'),'collate':_0x834e('0xe')});}; \ No newline at end of file +var _0x0b78=['moment','request-promise','rimraf','../../config/environment','./faxApplication.attributes','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b78,0x1ad));var _0x80b7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0b78[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x80b7('0x0'));var util=require(_0x80b7('0x1'));var logger=require('../../config/logger')(_0x80b7('0x2'));var moment=require(_0x80b7('0x3'));var BPromise=require('bluebird');var rp=require(_0x80b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x80b7('0x5'));var config=require(_0x80b7('0x6'));var attributes=require(_0x80b7('0x7'));module['exports']=function(_0x49bc7f,_0x167ddd){return _0x49bc7f['define'](_0x80b7('0x8'),attributes,{'tableName':_0x80b7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x80b7('0xa'),'collate':_0x80b7('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 025ca65..6181d1b 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 _0x56b8=['message','result','UpdateFaxApplication','FaxApplication','update','body','options','raw','limit','then','stringify','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x32612e,_0x3e5f2b){var _0x2dbbac=function(_0x2a538e){while(--_0x2a538e){_0x32612e['push'](_0x32612e['shift']());}};_0x2dbbac(++_0x3e5f2b);}(_0x56b8,0x1ec));var _0x856b=function(_0x94f639,_0x4014a6){_0x94f639=_0x94f639-0x0;var _0x544c7a=_0x56b8[_0x94f639];return _0x544c7a;};'use strict';var _=require('lodash');var util=require(_0x856b('0x0'));var moment=require(_0x856b('0x1'));var BPromise=require(_0x856b('0x2'));var rs=require(_0x856b('0x3'));var fs=require('fs');var Redis=require(_0x856b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x856b('0x5'));var logger=require('../../config/logger')(_0x856b('0x6'));var config=require(_0x856b('0x7'));var jayson=require(_0x856b('0x8'));var client=jayson[_0x856b('0x9')][_0x856b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46456f,_0x1a2ece,_0xb0be83){return new BPromise(function(_0x3aeabb,_0x188cdc){return client['request'](_0x46456f,_0xb0be83)['then'](function(_0x140d59){logger[_0x856b('0xb')](_0x856b('0xc'),_0x1a2ece,_0x856b('0xd'));logger[_0x856b('0xe')](_0x856b('0xf'),_0x1a2ece,'request\x20sent',JSON['stringify'](_0x140d59));if(_0x140d59[_0x856b('0x10')]){if(_0x140d59['error'][_0x856b('0x11')]===0x1f4){logger['error'](_0x856b('0xc'),_0x1a2ece,_0x140d59[_0x856b('0x10')][_0x856b('0x12')]);return _0x188cdc(_0x140d59[_0x856b('0x10')][_0x856b('0x12')]);}logger[_0x856b('0x10')]('FaxApplication,\x20%s,\x20%s',_0x1a2ece,_0x140d59['error'][_0x856b('0x12')]);return _0x3aeabb(_0x140d59['error'][_0x856b('0x12')]);}else{logger[_0x856b('0xb')](_0x856b('0xc'),_0x1a2ece,_0x856b('0xd'));_0x3aeabb(_0x140d59[_0x856b('0x13')][_0x856b('0x12')]);}})['catch'](function(_0x505dd2){logger['error'](_0x856b('0xc'),_0x1a2ece,_0x505dd2);_0x188cdc(_0x505dd2);});});}exports[_0x856b('0x14')]=function(_0x27bccb){var _0x172804=this;return new Promise(function(_0x1ed6f4,_0x3134f6){return db[_0x856b('0x15')][_0x856b('0x16')](_0x27bccb[_0x856b('0x17')],{'raw':_0x27bccb[_0x856b('0x18')]?_0x27bccb[_0x856b('0x18')][_0x856b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27bccb[_0x856b('0x18')]?_0x27bccb[_0x856b('0x18')]['where']||null:null,'attributes':_0x27bccb['options']?_0x27bccb[_0x856b('0x18')]['attributes']||null:null,'limit':_0x27bccb['options']?_0x27bccb['options'][_0x856b('0x1a')]||null:null})[_0x856b('0x1b')](function(_0x3555f7){logger[_0x856b('0xb')]('UpdateFaxApplication',_0x27bccb);logger[_0x856b('0xe')]('UpdateFaxApplication',_0x27bccb,JSON[_0x856b('0x1c')](_0x3555f7));_0x1ed6f4(_0x3555f7);})[_0x856b('0x1d')](function(_0x4a6b7d){logger[_0x856b('0x10')](_0x856b('0x14'),_0x4a6b7d[_0x856b('0x12')],_0x27bccb);_0x3134f6(_0x172804[_0x856b('0x10')](0x1f4,_0x4a6b7d['message']));});});}; \ No newline at end of file +var _0x918a=['body','options','limit','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','UpdateFaxApplication'];(function(_0x365135,_0x21d6cd){var _0x5b00c0=function(_0x67fd9f){while(--_0x67fd9f){_0x365135['push'](_0x365135['shift']());}};_0x5b00c0(++_0x21d6cd);}(_0x918a,0x1e0));var _0xa918=function(_0x15e670,_0x9d789d){_0x15e670=_0x15e670-0x0;var _0x4c21ea=_0x918a[_0x15e670];return _0x4c21ea;};'use strict';var _=require('lodash');var util=require(_0xa918('0x0'));var moment=require(_0xa918('0x1'));var BPromise=require(_0xa918('0x2'));var rs=require(_0xa918('0x3'));var fs=require('fs');var Redis=require(_0xa918('0x4'));var db=require(_0xa918('0x5'))['db'];var utils=require(_0xa918('0x6'));var logger=require(_0xa918('0x7'))(_0xa918('0x8'));var config=require(_0xa918('0x9'));var jayson=require(_0xa918('0xa'));var client=jayson[_0xa918('0xb')][_0xa918('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x20807d,_0x1e29f8,_0x38f5bd){return new BPromise(function(_0x1f6871,_0x40d01f){return client[_0xa918('0xd')](_0x20807d,_0x38f5bd)['then'](function(_0x1bcf67){logger[_0xa918('0xe')](_0xa918('0xf'),_0x1e29f8,'request\x20sent');logger[_0xa918('0x10')](_0xa918('0x11'),_0x1e29f8,_0xa918('0x12'),JSON[_0xa918('0x13')](_0x1bcf67));if(_0x1bcf67[_0xa918('0x14')]){if(_0x1bcf67[_0xa918('0x14')]['code']===0x1f4){logger[_0xa918('0x14')](_0xa918('0xf'),_0x1e29f8,_0x1bcf67[_0xa918('0x14')][_0xa918('0x15')]);return _0x40d01f(_0x1bcf67['error'][_0xa918('0x15')]);}logger['error'](_0xa918('0xf'),_0x1e29f8,_0x1bcf67[_0xa918('0x14')]['message']);return _0x1f6871(_0x1bcf67['error'][_0xa918('0x15')]);}else{logger[_0xa918('0xe')](_0xa918('0xf'),_0x1e29f8,_0xa918('0x12'));_0x1f6871(_0x1bcf67['result']['message']);}})[_0xa918('0x16')](function(_0x3c1cd8){logger[_0xa918('0x14')](_0xa918('0xf'),_0x1e29f8,_0x3c1cd8);_0x40d01f(_0x3c1cd8);});});}exports[_0xa918('0x17')]=function(_0x53de51){var _0xc4c763=this;return new Promise(function(_0x2e4e03,_0x5169c1){return db['FaxApplication']['update'](_0x53de51[_0xa918('0x18')],{'raw':_0x53de51[_0xa918('0x19')]?_0x53de51['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53de51[_0xa918('0x19')]?_0x53de51[_0xa918('0x19')]['where']||null:null,'attributes':_0x53de51[_0xa918('0x19')]?_0x53de51[_0xa918('0x19')]['attributes']||null:null,'limit':_0x53de51['options']?_0x53de51[_0xa918('0x19')][_0xa918('0x1a')]||null:null})[_0xa918('0x1b')](function(_0x53b1ba){logger[_0xa918('0xe')](_0xa918('0x17'),_0x53de51);logger['debug'](_0xa918('0x17'),_0x53de51,JSON['stringify'](_0x53b1ba));_0x2e4e03(_0x53b1ba);})['catch'](function(_0x3f5a97){logger[_0xa918('0x14')](_0xa918('0x17'),_0x3f5a97[_0xa918('0x15')],_0x53de51);_0x5169c1(_0xc4c763[_0xa918('0x14')](0x1f4,_0x3f5a97['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 56c4897..2909e71 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 _0x1399=['isAuthenticated','post','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','/:id'];(function(_0x143cfd,_0x2912b3){var _0x4355a6=function(_0x493fc2){while(--_0x493fc2){_0x143cfd['push'](_0x143cfd['shift']());}};_0x4355a6(++_0x2912b3);}(_0x1399,0x16c));var _0x9139=function(_0x44ace6,_0x448496){_0x44ace6=_0x44ace6-0x0;var _0x1b5359=_0x1399[_0x44ace6];return _0x1b5359;};'use strict';var multer=require(_0x9139('0x0'));var util=require(_0x9139('0x1'));var path=require('path');var timeout=require(_0x9139('0x2'));var express=require('express');var router=express[_0x9139('0x3')]();var auth=require(_0x9139('0x4'));var interaction=require(_0x9139('0x5'));var config=require(_0x9139('0x6'));var controller=require(_0x9139('0x7'));router[_0x9139('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9139('0x8')](_0x9139('0x9'),auth[_0x9139('0xa')](),controller['show']);router[_0x9139('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9139('0xc')](_0x9139('0x9'),auth['isAuthenticated'](),controller[_0x9139('0xd')]);router[_0x9139('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x9139('0xf')]);module[_0x9139('0x10')]=router; \ No newline at end of file +var _0x5c00=['put','update','delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x21923b,_0x44380f){var _0x3ff466=function(_0x4cd098){while(--_0x4cd098){_0x21923b['push'](_0x21923b['shift']());}};_0x3ff466(++_0x44380f);}(_0x5c00,0x17e));var _0x05c0=function(_0x20e40d,_0x2a9f0f){_0x20e40d=_0x20e40d-0x0;var _0x558350=_0x5c00[_0x20e40d];return _0x558350;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var auth=require(_0x05c0('0x4'));var interaction=require(_0x05c0('0x5'));var config=require(_0x05c0('0x6'));var controller=require(_0x05c0('0x7'));router['get']('/',auth[_0x05c0('0x8')](),controller[_0x05c0('0x9')]);router[_0x05c0('0xa')](_0x05c0('0xb'),auth['isAuthenticated'](),controller[_0x05c0('0xc')]);router[_0x05c0('0xd')]('/',auth[_0x05c0('0x8')](),controller['create']);router[_0x05c0('0xe')](_0x05c0('0xb'),auth[_0x05c0('0x8')](),controller[_0x05c0('0xf')]);router[_0x05c0('0x10')](_0x05c0('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x05c0('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index d8132fa..87dd9cb 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 _0x1136=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x237073,_0x3b67c1){var _0x1066c5=function(_0x214a41){while(--_0x214a41){_0x237073['push'](_0x237073['shift']());}};_0x1066c5(++_0x3b67c1);}(_0x1136,0x191));var _0x6113=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1136[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x6113('0x0'));module[_0x6113('0x1')]={'closed':{'type':Sequelize[_0x6113('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6113('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x6113('0x3')]},'fax':{'type':Sequelize[_0x6113('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x6113('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6113('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x6113('0x5')]('in',_0x6113('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x1987=['exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x5951e1,_0x3343b9){var _0x192747=function(_0x1d4d5d){while(--_0x1d4d5d){_0x5951e1['push'](_0x5951e1['shift']());}};_0x192747(++_0x3343b9);}(_0x1987,0x140));var _0x7198=function(_0x497f4b,_0x1870ec){_0x497f4b=_0x497f4b-0x0;var _0x55314e=_0x1987[_0x497f4b];return _0x55314e;};'use strict';var Sequelize=require('sequelize');module[_0x7198('0x0')]={'closed':{'type':Sequelize[_0x7198('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7198('0x2')]},'disposition':{'type':Sequelize[_0x7198('0x3')]},'note':{'type':Sequelize[_0x7198('0x3')]},'read1stAt':{'type':Sequelize[_0x7198('0x2')]},'fax':{'type':Sequelize[_0x7198('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x7198('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7198('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x7198('0x4')]('in','out'),'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 dd75658..538dcac 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 _0x288a=['zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Users','map','TagIds','Tags','split','push','catch','FaxInteraction','rawAttributes','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','field','color','tools_tags','select','COUNT(*)','from','fax_messages','where','me.FaxInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','ui.FaxInteractionId','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','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','keys','value','dateStart','startOf','format','utc','day','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','forEach','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','TagId','unreadMessages','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','$lte','null','\x20IS\x20NULL','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','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?','fax_interaction_has_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','sequelize','toString','count','a.key','Account.key','Contact.firstName','Contact.lastName','Contact.phone','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','rows','params','includeAll','include','merge','options','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','FaxMessage','$gte','findAll','addTags','setTags','spread','Tag','emit','removeTags','download','join','root','server','files','attachments','tmp','interaction-%s.zip','Attachment','mkdirSync','basename','existsSync','createReadStream','createWriteStream','log','err','eml-format','rimraf'];(function(_0x296754,_0x5befe9){var _0x1d9f1d=function(_0x3f033e){while(--_0x3f033e){_0x296754['push'](_0x296754['shift']());}};_0x1d9f1d(++_0x5befe9);}(_0x288a,0x188));var _0xa288=function(_0x38c6cb,_0x578b0a){_0x38c6cb=_0x38c6cb-0x0;var _0x15600f=_0x288a[_0x38c6cb];return _0x15600f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa288('0x0'));var rimraf=require(_0xa288('0x1'));var zipdir=require(_0xa288('0x2'));var jsonpatch=require(_0xa288('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa288('0x4'));var Mustache=require('mustache');var util=require(_0xa288('0x5'));var path=require(_0xa288('0x6'));var sox=require(_0xa288('0x7'));var csv=require('to-csv');var ejs=require(_0xa288('0x8'));var fs=require('fs');var _=require(_0xa288('0x9'));var squel=require(_0xa288('0xa'));var crypto=require('crypto');var jsforce=require(_0xa288('0xb'));var deskjs=require(_0xa288('0xc'));var toCsv=require(_0xa288('0xd'));var querystring=require(_0xa288('0xe'));var Papa=require(_0xa288('0xf'));var Redis=require(_0xa288('0x10'));var authService=require(_0xa288('0x11'));var qs=require(_0xa288('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa288('0x13'));var config=require(_0xa288('0x14'));var db=require('../../mysqldb')['db'];config[_0xa288('0x15')]=_[_0xa288('0x16')](config[_0xa288('0x15')],{'host':_0xa288('0x17'),'port':0x18eb});var socket=require(_0xa288('0x18'))(new Redis(config[_0xa288('0x15')]));require(_0xa288('0x19'))[_0xa288('0x1a')](socket);function respondWithStatusCode(_0x3a529f,_0x687ba8){_0x687ba8=_0x687ba8||0xcc;return function(_0x43c808){if(_0x43c808){return _0x3a529f[_0xa288('0x1b')](_0x687ba8);}return _0x3a529f[_0xa288('0x1c')](_0x687ba8)[_0xa288('0x1d')]();};}function respondWithResult(_0x21ec88,_0x138b4e){_0x138b4e=_0x138b4e||0xc8;return function(_0x571259){if(_0x571259){return _0x21ec88[_0xa288('0x1c')](_0x138b4e)[_0xa288('0x1e')](_0x571259);}};}function respondWithFilteredResult(_0x299ede,_0xc7b694){return function(_0x45d1f1){if(_0x45d1f1){var _0x338d00=_0x45d1f1['count'],_0x49d93c=_0xc7b694['offset'],_0x2adc53=_0xc7b694[_0xa288('0x1f')]+_0xc7b694[_0xa288('0x20')],_0x3f14b7;if(_0x2adc53>=_0x338d00){_0x2adc53=_0x338d00;_0x3f14b7=0xc8;}else{_0x3f14b7=0xce;}_0x299ede[_0xa288('0x1c')](_0x3f14b7);return _0x299ede['set'](_0xa288('0x21'),_0x49d93c+'-'+_0x2adc53+'/'+_0x338d00)[_0xa288('0x1e')](_0x45d1f1);}return null;};}function patchUpdates(_0x1979d9){return function(_0x4c489e){try{jsonpatch[_0xa288('0x22')](_0x4c489e,_0x1979d9,!![]);}catch(_0x283523){return BPromise[_0xa288('0x23')](_0x283523);}return _0x4c489e[_0xa288('0x24')]();};}function saveUpdates(_0x32e47d,_0x51c835){return function(_0x56c43b){if(_0x56c43b){return _0x56c43b[_0xa288('0x25')](_0x32e47d)[_0xa288('0x26')](function(_0x37ff1a){return _0x37ff1a;});}return null;};}function removeEntity(_0x2f9465,_0x4895bb){return function(_0x21eebc){if(_0x21eebc){return _0x21eebc[_0xa288('0x27')]()[_0xa288('0x26')](function(){_0x2f9465[_0xa288('0x1c')](0xcc)[_0xa288('0x1d')]();});}};}function handleEntityNotFound(_0x23f7b8,_0x1ac3c3){return function(_0x19ad60){if(!_0x19ad60){_0x23f7b8[_0xa288('0x1b')](0x194);}return _0x19ad60;};}function handleError(_0x54a27b,_0x2cdd34){_0x2cdd34=_0x2cdd34||0x1f4;return function(_0xffc6b4){logger[_0xa288('0x28')](_0xffc6b4[_0xa288('0x29')]);if(_0xffc6b4[_0xa288('0x2a')]){delete _0xffc6b4['name'];}_0x54a27b['status'](_0x2cdd34)[_0xa288('0x2b')](_0xffc6b4);};}function getInteractionUsers(_0x41df47,_0x19f934){return new BPromise(function(_0x7ea039,_0x3b2d3e){try{if(_0x19f934[_0x41df47['id']]){_0x41df47[_0xa288('0x2c')]=_[_0xa288('0x2d')](_0x19f934[_0x41df47['id']],function(_0x382caf){return{'id':_0x382caf['id']};});}}catch(_0x30cfdf){_0x3b2d3e(_0x30cfdf);}_0x7ea039(_0x41df47);});}function getInteractionTags(_0x104290,_0x3cd2d1){return new BPromise(function(_0x638c78,_0xba620d){try{if(_0x104290[_0xa288('0x2e')]){_0x104290[_0xa288('0x2f')]=[];_0x104290[_0xa288('0x2e')][_0xa288('0x30')](',')['forEach'](function(_0xd4ec7d){_0x104290['Tags'][_0xa288('0x31')](_0x3cd2d1[_0xd4ec7d]);});}delete _0x104290[_0xa288('0x2e')];}catch(_0x12c471){_0xba620d(_0x12c471);}_0x638c78(_0x104290);});}function updateFaxInteraction(_0x535b82,_0x3f38bf,_0x244f9e){return new BPromise(function(_0x169bb2,_0x31e95f){return getInteractionUsers(_0x535b82,_0x244f9e)[_0xa288('0x26')](function(_0x31626b){return getInteractionTags(_0x31626b,_0x3f38bf);})[_0xa288('0x26')](function(_0x464593){_0x169bb2(_0x464593);})[_0xa288('0x32')](function(_0x5b37f8){_0x31e95f(_0x5b37f8);});});}exports['index']=function(_0x59bc1f,_0x3cba5d){var _0x499a43={},_0x37e37d={},_0x15f103={'count':0x0,'rows':[]};var _0x358059=db[_0xa288('0x33')][_0xa288('0x34')];_0x37e37d[_0xa288('0x35')]=_['keys'](_0x358059);_0x37e37d['query']=_['keys'](_0x59bc1f[_0xa288('0x36')]);_0x37e37d[_0xa288('0x37')]=_['intersection'](_0x37e37d[_0xa288('0x35')],_0x37e37d[_0xa288('0x36')]);_0x499a43['attributes']=_[_0xa288('0x38')](_0x37e37d[_0xa288('0x35')],qs[_0xa288('0x39')](_0x59bc1f[_0xa288('0x36')][_0xa288('0x39')]));_0x499a43[_0xa288('0x3a')]=_0x499a43['attributes'][_0xa288('0x3b')]?_0x499a43[_0xa288('0x3a')]:_0x37e37d[_0xa288('0x35')];if(!_0x59bc1f['query'][_0xa288('0x3c')](_0xa288('0x3d'))){_0x499a43[_0xa288('0x20')]=qs[_0xa288('0x20')](_0x59bc1f[_0xa288('0x36')][_0xa288('0x20')]);_0x499a43[_0xa288('0x1f')]=qs['offset'](_0x59bc1f[_0xa288('0x36')][_0xa288('0x1f')]);}_0x499a43[_0xa288('0x3e')]=qs['sort'](_0x59bc1f[_0xa288('0x36')][_0xa288('0x3f')]);_0x499a43['where']=qs[_0xa288('0x37')](_[_0xa288('0x40')](_0x59bc1f[_0xa288('0x36')],_0x37e37d['filters']));var _0x933982=[];var _0x2a4ead=squel['select']()[_0xa288('0x41')]('id')[_0xa288('0x41')](_0xa288('0x2a'))[_0xa288('0x41')](_0xa288('0x42'))['from'](_0xa288('0x43'));var _0x46bc3c=squel[_0xa288('0x44')]()[_0xa288('0x41')](_0xa288('0x45'))[_0xa288('0x46')](_0xa288('0x47'),'me')[_0xa288('0x48')](_0xa288('0x49'))[_0xa288('0x48')](_0xa288('0x4a'))['where']('me.read\x20=\x20false');var _0x79d282=squel[_0xa288('0x44')]()[_0xa288('0x41')]('u.id')['field'](_0xa288('0x4b'))[_0xa288('0x46')]('user_has_fax_interactions','ui')[_0xa288('0x4c')]('users','u','u.id\x20=\x20ui.UserId');var _0x279f12=squel[_0xa288('0x44')]()[_0xa288('0x46')]('fax_interactions','i')[_0xa288('0x4c')](_0xa288('0x4d'),'c',_0xa288('0x4e'))[_0xa288('0x4c')](_0xa288('0x4f'),'o',_0xa288('0x50'))['left_join'](_0xa288('0x51'),'a','a.id\x20=\x20i.FaxAccountId')[_0xa288('0x4c')](_0xa288('0x47'),'me',_0xa288('0x52'));var _0x246562=squel[_0xa288('0x53')]();if(_0x59bc1f[_0xa288('0x36')][_0xa288('0x54')]){var _0x1f1d46=JSON[_0xa288('0x55')](_0x59bc1f[_0xa288('0x36')][_0xa288('0x54')]);_[_0xa288('0x56')](_0x1f1d46)['forEach'](function(_0x1dc048){var _0x2bd373=_0x1f1d46[_0x1dc048];if(_0x1dc048==='createdAt'){var _0x4e4dff=moment(_0x2bd373[_0xa288('0x57')][_0xa288('0x58')])[_0xa288('0x59')]('day')['utc']()[_0xa288('0x5a')]();var _0x394e9c=moment(_0x394e9c)[_0xa288('0x5b')]()['endOf'](_0xa288('0x5c'))[_0xa288('0x5a')]();_0x246562[_0xa288('0x5d')](_0xa288('0x5e'),_0x4e4dff,_0x394e9c);}else{if(_[_0xa288('0x5f')](_0x2bd373['condition'])){_0x2bd373[_0xa288('0x60')][_0xa288('0x61')](function(_0x4c7368){switch(_0x2bd373[_0xa288('0x60')]['value']){case'IS':if(_0x1dc048!=='TagId'&&_0x1dc048!=='unreadMessages'){if(_[_0xa288('0x5f')](_0x2bd373[_0xa288('0x57')])&&_0x2bd373[_0xa288('0x57')][_0xa288('0x3b')]>0x1){_0x246562['and'](_0x2bd373[_0xa288('0x62')]+'.'+_0x1dc048+_0xa288('0x63'),_0x2bd373['value']);}else{_0x246562[_0xa288('0x5d')](_0x2bd373[_0xa288('0x62')]+'.'+_0x1dc048+_0xa288('0x64'),_0x2bd373[_0xa288('0x57')][0x0]);}}break;case'=':_0x246562[_0xa288('0x5d')](_0x2bd373[_0xa288('0x62')]+'.'+_0x1dc048+_0xa288('0x64'),_0x2bd373[_0xa288('0x57')]);break;case _0xa288('0x65'):if(_0x1dc048===_0xa288('0x66')){_0x246562[_0xa288('0x5d')](_0xa288('0x67')+_0xa288('0x68'),'%'+_0x2bd373[_0xa288('0x57')]+'%');_0x246562['or'](_0xa288('0x69')+_0xa288('0x68'),'%'+_0x2bd373['value']+'%');_0x246562['or'](_0xa288('0x6a')+'\x20LIKE\x20?','%'+_0x2bd373[_0xa288('0x57')]+'%');}else{_0x246562['and'](_0x2bd373[_0xa288('0x62')]+'.'+_0x1dc048+_0xa288('0x68'),'%'+_0x2bd373[_0xa288('0x57')]+'%');}break;case'>':_0x246562[_0xa288('0x5d')](_0x2bd373[_0xa288('0x62')]+'.'+_0x1dc048+_0xa288('0x6b'),_0x2bd373[_0xa288('0x57')]);break;case'<':_0x246562[_0xa288('0x5d')](_0x2bd373['tableAlias']+'.'+_0x1dc048+_0xa288('0x6c'),_0x2bd373[_0xa288('0x57')]);break;}});}else{switch(_0x2bd373[_0xa288('0x60')][_0xa288('0x57')]){case'IS':if(_0x1dc048!==_0xa288('0x6d')&&_0x1dc048!==_0xa288('0x6e')){if(_['isArray'](_0x2bd373[_0xa288('0x57')])&&_0x2bd373[_0xa288('0x57')][_0xa288('0x3b')]>0x1){_0x246562['and'](_0x2bd373[_0xa288('0x62')]+'.'+_0x1dc048+_0xa288('0x63'),_0x2bd373[_0xa288('0x57')]);}else{_0x246562['and'](_0x2bd373[_0xa288('0x62')]+'.'+_0x1dc048+_0xa288('0x64'),_0x2bd373['value'][0x0]);}}break;case'=':_0x246562[_0xa288('0x5d')](_0x2bd373['tableAlias']+'.'+_0x1dc048+'\x20=\x20?',_0x2bd373[_0xa288('0x57')]);break;case'LIKE':if(_0x1dc048===_0xa288('0x66')){_0x246562[_0xa288('0x5d')](_0xa288('0x67')+_0xa288('0x68'),'%'+_0x2bd373['value']+'%');_0x246562['or'](_0xa288('0x69')+_0xa288('0x68'),'%'+_0x2bd373[_0xa288('0x57')]+'%');_0x246562['or'](_0xa288('0x6a')+_0xa288('0x68'),'%'+_0x2bd373[_0xa288('0x57')]+'%');}else{_0x246562[_0xa288('0x5d')](_0x2bd373[_0xa288('0x62')]+'.'+_0x1dc048+'\x20LIKE\x20?','%'+_0x2bd373[_0xa288('0x57')]+'%');}break;case'>':_0x246562[_0xa288('0x5d')](_0x2bd373[_0xa288('0x62')]+'.'+_0x1dc048+'\x20>\x20?',_0x2bd373['value']);break;case'<':_0x246562[_0xa288('0x5d')](_0x2bd373[_0xa288('0x62')]+'.'+_0x1dc048+'\x20<\x20?',_0x2bd373['value']);break;}}}});}else{var _0x529e52=_(Object[_0xa288('0x56')](_0x59bc1f[_0xa288('0x36')]))[_0xa288('0x2d')](function(_0x586c08){return _0x358059[_0xa288('0x3c')](_0x586c08)?_0x586c08:undefined;})['filter'](function(_0x57d1fe){return!_['isNil'](_0x57d1fe);})[_0xa288('0x57')]();if(!_[_0xa288('0x6f')](_0x529e52)){_0x529e52[_0xa288('0x61')](function(_0x445d28){if(_0x445d28===_0xa288('0x70')){_0x279f12[_0xa288('0x48')](_0xa288('0x71'),[][_0xa288('0x72')](_0x59bc1f[_0xa288('0x36')][_0x445d28]));}else if(_0x445d28===_0xa288('0x73')){var _0x212839=JSON['parse'](_0x59bc1f[_0xa288('0x36')][_0x445d28])['$gte'];var _0x72d43d=JSON[_0xa288('0x55')](_0x59bc1f[_0xa288('0x36')][_0x445d28])[_0xa288('0x74')];_0x279f12[_0xa288('0x48')](_0xa288('0x5e'),_0x212839,_0x72d43d);}else{if(_0x59bc1f[_0xa288('0x36')][_0x445d28]===_0xa288('0x75')){_0x279f12[_0xa288('0x48')]('i.'+_0x445d28+_0xa288('0x76'));}else{_0x279f12[_0xa288('0x48')]('i.'+_0x445d28+_0xa288('0x64'),_0x59bc1f['query'][_0x445d28]);}}});}if(_0x59bc1f[_0xa288('0x36')]['filter']){var _0x2ed3c2=_0x59bc1f[_0xa288('0x36')][_0xa288('0x77')][_0xa288('0x78')]('\x5c','\x5c\x5c')[_0xa288('0x78')]('\x27\x27',_0xa288('0x79'));if(qs['isNumeric'](_0x2ed3c2)){_0x246562['or'](_0xa288('0x7a'),_0x2ed3c2+'%')['or']('i.fax\x20LIKE\x20?',_0x2ed3c2+'%');}_0x246562['or'](_0xa288('0x7b'),_0x2ed3c2+'%');}}_0x279f12['where'](_0x246562);if(_0x499a43[_0xa288('0x3e')]){_0x499a43[_0xa288('0x3e')][_0xa288('0x61')](function(_0x459a5d){_0x279f12[_0xa288('0x3e')]('i.'+_0x459a5d[0x0],_0x459a5d[0x1]===_0xa288('0x7c')?![]:!![]);});}_0x279f12[_0xa288('0x7d')](_0xa288('0x7e'));var _0x4b02dd={'type':db[_0xa288('0x7f')][_0xa288('0x80')][_0xa288('0x81')],'raw':!![]};var _0x17a8d9=_0x279f12[_0xa288('0x82')]()[_0xa288('0x41')](_0xa288('0x45'))[_0xa288('0x41')](_0xa288('0x83'),_0xa288('0x6e'));if(!_0x59bc1f[_0xa288('0x36')][_0xa288('0x54')]){if(_0x59bc1f[_0xa288('0x36')][_0xa288('0x84')]){if(_0x59bc1f[_0xa288('0x36')][_0xa288('0x84')]==0x1){_0x17a8d9[_0xa288('0x85')](_0xa288('0x86'));_0x279f12['having'](_0xa288('0x86'));}else{_0x17a8d9[_0xa288('0x85')]('`unreadMessages`\x20>\x200');_0x279f12['having'](_0xa288('0x87'));}}if(_0x59bc1f[_0xa288('0x36')]['tag']){var _0x33abcf=_[_0xa288('0x5f')](_0x59bc1f['query'][_0xa288('0x88')])?_0x59bc1f['query'][_0xa288('0x88')]:new Array(_0x59bc1f[_0xa288('0x36')]['tag']);var _0x46b7f4=squel[_0xa288('0x53')]();_0x33abcf['forEach'](function(_0x12454b){_0x46b7f4['or'](_0xa288('0x89'),'%,'+_0x12454b+',%');});_0x279f12['having'](_0x46b7f4);_0x17a8d9['left_join'](_0xa288('0x8a'),'it','it.FaxInteractionId\x20=\x20i.id');_0x17a8d9[_0xa288('0x4c')](_0xa288('0x43'),'t',_0xa288('0x8b'));_0x17a8d9[_0xa288('0x48')](_0xa288('0x8c'),_0x33abcf);}}else{var _0x1f1d46=JSON[_0xa288('0x55')](_0x59bc1f['query'][_0xa288('0x54')]);_[_0xa288('0x56')](_0x1f1d46)[_0xa288('0x61')](function(_0x3936e0){var _0x4e3d16=_0x1f1d46[_0x3936e0];if(_0x3936e0===_0xa288('0x6d')){var _0xa7b8ec=_0x4e3d16['value'];var _0x3125b6=squel[_0xa288('0x53')]();_0xa7b8ec[_0xa288('0x61')](function(_0x21ceb7){_0x3125b6['or'](_0xa288('0x89'),'%,'+_0x21ceb7+',%');});_0x279f12['having'](_0x3125b6);_0x17a8d9[_0xa288('0x4c')](_0xa288('0x8d'),'it',_0xa288('0x8e'));_0x17a8d9[_0xa288('0x4c')](_0xa288('0x43'),'t',_0xa288('0x8b'));_0x17a8d9[_0xa288('0x48')]('t.id\x20IN\x20?',_0xa7b8ec);}else if(_0x3936e0===_0xa288('0x6e')){if(_0x4e3d16[_0xa288('0x57')][_0xa288('0x3b')]===0x1){if(_0x4e3d16[_0xa288('0x57')][0x0]===0x1){_0x17a8d9[_0xa288('0x85')](_0xa288('0x86'));_0x279f12[_0xa288('0x85')](_0xa288('0x86'));}else{_0x17a8d9[_0xa288('0x85')](_0xa288('0x87'));_0x279f12[_0xa288('0x85')]('`unreadMessages`\x20>\x200');}}}});}db[_0xa288('0x8f')][_0xa288('0x36')](_0x17a8d9[_0xa288('0x90')](),_0x4b02dd)[_0xa288('0x26')](function(_0x123135){_0x15f103[_0xa288('0x91')]=_0x123135['length'];if(_0x15f103['count']===0x0)return[];return db[_0xa288('0x8f')][_0xa288('0x36')](_0x2a4ead[_0xa288('0x90')](),_0x4b02dd)[_0xa288('0x26')](function(_0x564114){_0x933982=_['keyBy'](_0x564114,'id');_0x4b02dd=_['merge'](_0x4b02dd,{'model':db[_0xa288('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x279f12[_0xa288('0x41')](_0xa288('0x83'),_0xa288('0x6e'));_0x279f12[_0xa288('0x41')](_0xa288('0x92'),_0xa288('0x93'));_0x279f12['field']('i.*');_0x279f12[_0xa288('0x41')]('c.firstName',_0xa288('0x94'));_0x279f12[_0xa288('0x41')](_0xa288('0x69'),_0xa288('0x95'));_0x279f12[_0xa288('0x41')](_0xa288('0x6a'),'Contact.email');_0x279f12[_0xa288('0x41')]('c.phone',_0xa288('0x96'));_0x279f12[_0xa288('0x41')]('c.mobile','Contact.mobile');_0x279f12[_0xa288('0x41')](_0xa288('0x97'),_0xa288('0x98'));_0x279f12[_0xa288('0x41')](_0xa288('0x99'),_0xa288('0x2e'));_0x279f12[_0xa288('0x4c')](_0xa288('0x8a'),'it','it.FaxInteractionId\x20=\x20i.id');_0x279f12[_0xa288('0x4c')](_0xa288('0x43'),'t','t.id\x20=\x20it.TagId');_0x279f12['limit'](_0x499a43[_0xa288('0x20')]);_0x279f12[_0xa288('0x1f')](_0x499a43['offset']);return db[_0xa288('0x8f')][_0xa288('0x36')](_0x279f12[_0xa288('0x90')](),_0x4b02dd);})[_0xa288('0x26')](function(_0x551553){_0x79d282[_0xa288('0x48')](_0xa288('0x9a'),_[_0xa288('0x2d')](_0x551553,'id'));return db['sequelize']['query'](_0x79d282[_0xa288('0x90')](),_0x4b02dd)['then'](function(_0x4e3333){var _0x3c49df=_['groupBy'](_0x4e3333,_0xa288('0x9b'));var _0x28c08f=[];_0x551553['forEach'](function(_0x4469bc){_0x28c08f['push'](updateFaxInteraction(_0x4469bc,_0x933982,_0x3c49df));});return BPromise[_0xa288('0x9c')](_0x28c08f);});});})[_0xa288('0x26')](function(_0xa30da){_0x15f103[_0xa288('0x9d')]=_0xa30da;return _0x15f103;})[_0xa288('0x26')](respondWithFilteredResult(_0x3cba5d,_0x499a43))[_0xa288('0x32')](handleError(_0x3cba5d,null));};exports['show']=function(_0x11b1d8,_0x5bbe12){var _0x5570ac={'raw':![],'where':{'id':_0x11b1d8[_0xa288('0x9e')]['id']}},_0x4dc67f={};_0x4dc67f[_0xa288('0x35')]=_[_0xa288('0x56')](db[_0xa288('0x33')][_0xa288('0x34')]);_0x4dc67f[_0xa288('0x36')]=_[_0xa288('0x56')](_0x11b1d8[_0xa288('0x36')]);_0x4dc67f[_0xa288('0x37')]=_[_0xa288('0x38')](_0x4dc67f['model'],_0x4dc67f['query']);_0x5570ac[_0xa288('0x3a')]=_[_0xa288('0x38')](_0x4dc67f['model'],qs['fields'](_0x11b1d8['query'][_0xa288('0x39')]));_0x5570ac[_0xa288('0x3a')]=_0x5570ac[_0xa288('0x3a')][_0xa288('0x3b')]?_0x5570ac[_0xa288('0x3a')]:_0x4dc67f[_0xa288('0x35')];if(_0x11b1d8['query'][_0xa288('0x9f')]){_0x5570ac[_0xa288('0xa0')]=[{'all':!![]}];}_0x5570ac=_[_0xa288('0xa1')]({},_0x5570ac,_0x11b1d8[_0xa288('0xa2')]);return db[_0xa288('0x33')][_0xa288('0xa3')](_0x5570ac)['then'](handleEntityNotFound(_0x5bbe12,null))[_0xa288('0x26')](respondWithResult(_0x5bbe12,null))[_0xa288('0x32')](handleError(_0x5bbe12,null));};exports[_0xa288('0xa4')]=function(_0x421e53,_0x422f0f){return db[_0xa288('0x33')][_0xa288('0xa4')](_0x421e53[_0xa288('0xa5')],{})[_0xa288('0x26')](respondWithResult(_0x422f0f,0xc9))['catch'](handleError(_0x422f0f,null));};exports[_0xa288('0x25')]=function(_0x1b6ff6,_0x111c5b){if(_0x1b6ff6['body']['id']){delete _0x1b6ff6[_0xa288('0xa5')]['id'];}return db[_0xa288('0x33')][_0xa288('0xa3')]({'where':{'id':_0x1b6ff6[_0xa288('0x9e')]['id']}})[_0xa288('0x26')](handleEntityNotFound(_0x111c5b,null))[_0xa288('0x26')](saveUpdates(_0x1b6ff6[_0xa288('0xa5')],null))[_0xa288('0x26')](respondWithResult(_0x111c5b,null))[_0xa288('0x32')](handleError(_0x111c5b,null));};exports[_0xa288('0x27')]=function(_0x2ec5d2,_0x28c779){return db[_0xa288('0x33')][_0xa288('0xa3')]({'where':{'id':_0x2ec5d2[_0xa288('0x9e')]['id']}})[_0xa288('0x26')](handleEntityNotFound(_0x28c779,null))[_0xa288('0x26')](removeEntity(_0x28c779,null))[_0xa288('0x32')](handleError(_0x28c779,null));};exports['describe']=function(_0xb243ea,_0x2c4342){return db[_0xa288('0x33')][_0xa288('0xa6')]()[_0xa288('0x26')](respondWithResult(_0x2c4342,null))[_0xa288('0x32')](handleError(_0x2c4342,null));};exports[_0xa288('0xa7')]=function(_0x287ae8,_0x390370,_0x481cd6){return db['FaxMessage']['find']({'where':{'id':_0x287ae8[_0xa288('0x9e')]['id']}})['then'](handleEntityNotFound(_0x390370,null))[_0xa288('0x26')](function(_0x4b575a){if(_0x4b575a){return _0x4b575a[_0xa288('0xa7')](_0x287ae8[_0xa288('0xa5')][_0xa288('0xa8')],_[_0xa288('0xa9')](_0x287ae8[_0xa288('0xa5')],[_0xa288('0xa8'),'id'])||{});}})['then'](respondWithResult(_0x390370,null))[_0xa288('0x32')](handleError(_0x390370,null));};exports[_0xa288('0xaa')]=function(_0x3d3a81,_0x4cf259,_0xbd30c3){var _0x333b75={'raw':![],'where':{}};var _0x458c63={};var _0x1a8209={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xa288('0xab')]({'where':{'id':_0x3d3a81[_0xa288('0x9e')]['id']}})[_0xa288('0x26')](handleEntityNotFound(_0x4cf259,null))['then'](function(_0x3811e5){if(_0x3811e5){_0x458c63[_0xa288('0x35')]=_[_0xa288('0x56')](db[_0xa288('0xac')][_0xa288('0x34')]);_0x458c63[_0xa288('0x36')]=_[_0xa288('0x56')](_0x3d3a81[_0xa288('0x36')]);_0x458c63[_0xa288('0x37')]=_[_0xa288('0x38')](_0x458c63[_0xa288('0x35')],_0x458c63['query']);_0x333b75[_0xa288('0x3a')]=_['intersection'](_0x458c63[_0xa288('0x35')],qs['fields'](_0x3d3a81['query']['fields']));_0x333b75[_0xa288('0x3a')]=_0x333b75['attributes'][_0xa288('0x3b')]?_0x333b75[_0xa288('0x3a')]:_0x458c63['model'];if(!_0x3d3a81[_0xa288('0x36')][_0xa288('0x3c')](_0xa288('0x3d'))){_0x333b75[_0xa288('0x20')]=qs[_0xa288('0x20')](_0x3d3a81['query']['limit']);_0x333b75[_0xa288('0x1f')]=qs['offset'](_0x3d3a81[_0xa288('0x36')]['offset']);}_0x333b75['order']=qs[_0xa288('0x3f')](_0x3d3a81[_0xa288('0x36')]['sort']);_0x333b75[_0xa288('0x48')]=qs[_0xa288('0x37')](_[_0xa288('0x40')](_0x3d3a81[_0xa288('0x36')],_0x458c63[_0xa288('0x37')]));_0x333b75[_0xa288('0x48')][_0xa288('0x9b')]=_0x3811e5['id'];if(_0x3d3a81[_0xa288('0x36')][_0xa288('0x77')]){_0x333b75[_0xa288('0x48')]=_['merge'](_0x333b75[_0xa288('0x48')],{'$or':_[_0xa288('0x2d')](_0x333b75['attributes'],function(_0x886977){var _0x40d77a={};_0x40d77a[_0x886977]={'$like':'%'+_0x3d3a81['query'][_0xa288('0x77')]+'%'};return _0x40d77a;})});}if(_0x3d3a81[_0xa288('0x36')][_0xa288('0xad')]){var _0x35a55c=_0x3d3a81[_0xa288('0x36')][_0xa288('0xad')]['split'](',');var _0x12d418={};_0x12d418[_0x35a55c[0x0]]={'$gte':moment(_0x35a55c[0x1])[_0xa288('0x5a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x333b75[_0xa288('0x48')]=_[_0xa288('0xa1')](_0x333b75['where'],_0x12d418);}_0x333b75=_['merge']({},_0x333b75,_0x3d3a81[_0xa288('0xa2')]);return db[_0xa288('0xac')][_0xa288('0x91')]({'where':_0x333b75[_0xa288('0x48')]})[_0xa288('0x26')](function(_0x2643c1){_0x1a8209['count']=_0x2643c1;if(_0x3d3a81[_0xa288('0x36')][_0xa288('0x9f')]){_0x333b75[_0xa288('0xa0')]=[{'all':!![]}];}return db[_0xa288('0xac')][_0xa288('0xae')](_0x333b75);})[_0xa288('0x26')](function(_0x72bec9){_0x1a8209['rows']=_0x72bec9;return _0x1a8209;});}})[_0xa288('0x26')](respondWithFilteredResult(_0x4cf259,_0x333b75))['catch'](handleError(_0x4cf259,null));};exports[_0xa288('0xaf')]=function(_0x3b3a56,_0x14e498,_0x58f179){return db[_0xa288('0x33')][_0xa288('0xa3')]({'where':{'id':_0x3b3a56[_0xa288('0x9e')]['id']}})['then'](handleEntityNotFound(_0x14e498,null))[_0xa288('0x26')](function(_0x4bbf60){if(_0x4bbf60){return _0x4bbf60[_0xa288('0xb0')](_0x3b3a56[_0xa288('0xa5')][_0xa288('0xa8')],_[_0xa288('0xa9')](_0x3b3a56['body'],[_0xa288('0xa8'),'id'])||{})[_0xa288('0xb1')](function(){return db[_0xa288('0xb2')][_0xa288('0xae')]({'attributes':['id',_0xa288('0x2a'),_0xa288('0x42')],'where':{'id':_0x3b3a56['body']['ids']}});})['then'](function(_0x39043e){socket[_0xa288('0xb3')]('faxInteractionTags:save',{'id':Number(_0x3b3a56[_0xa288('0x9e')]['id']),'tags':_0x39043e||[]});return{'id':Number(_0x3b3a56[_0xa288('0x9e')]['id']),'tags':_0x39043e||[]};});}})[_0xa288('0x26')](respondWithResult(_0x14e498,null))[_0xa288('0x32')](handleError(_0x14e498,null));};exports[_0xa288('0xb4')]=function(_0x1050c8,_0x48e3b0,_0x562b05){return db['FaxInteraction'][_0xa288('0xa3')]({'where':{'id':_0x1050c8['params']['id']}})[_0xa288('0x26')](handleEntityNotFound(_0x48e3b0,null))['then'](function(_0x130467){if(_0x130467){return _0x130467[_0xa288('0xb4')](_0x1050c8[_0xa288('0x36')][_0xa288('0xa8')]);}})['then'](respondWithStatusCode(_0x48e3b0,null))[_0xa288('0x32')](handleError(_0x48e3b0,null));};exports[_0xa288('0xb5')]=function(_0x244138,_0x1946f3){var _0x46d7b3=moment()['unix']()[_0xa288('0x90')]();var _0x2d2883=path[_0xa288('0xb6')](config[_0xa288('0xb7')],_0xa288('0xb8'),_0xa288('0xb9'),_0xa288('0xba'));var _0x3a318d=path['join'](config['root'],_0xa288('0xb8'),_0xa288('0xb9'),_0xa288('0xbb'));var _0x58ef82=path[_0xa288('0xb6')](_0x3a318d,_0x46d7b3);var _0x5d2d4d=util[_0xa288('0x5a')](_0xa288('0xbc'),_0x46d7b3);var _0x216c6d=path[_0xa288('0xb6')](_0x3a318d,_0x5d2d4d);var _0x1d346a=![];return db[_0xa288('0x33')][_0xa288('0xa3')]({'where':{'id':_0x244138[_0xa288('0x9e')]['id']}})[_0xa288('0x26')](handleEntityNotFound(_0x1946f3,null))['then'](function(_0x3be8e7){if(_0x3be8e7){return _0x3be8e7[_0xa288('0xaa')]({'attributes':['id',_0xa288('0xa5'),'createdAt'],'include':[{'model':db[_0xa288('0xbd')],'as':'Attachment'}]});}return[];})[_0xa288('0x26')](function(_0x84dc07){_0x1d346a=_0x84dc07[_0xa288('0x3b')];if(_0x84dc07[_0xa288('0x3b')]){fs[_0xa288('0xbe')](_0x58ef82);for(var _0x458d07=0x0;_0x458d07<_0x84dc07[_0xa288('0x3b')];_0x458d07++){var _0x24a1ad=_0x84dc07[_0x458d07];var _0x4209a0=_0x24a1ad[_0xa288('0xbd')];if(_0x4209a0){var _0x33e10f=path['join'](_0x2d2883,_0x4209a0[_0xa288('0xbf')]);if(fs[_0xa288('0xc0')](_0x33e10f)){fs[_0xa288('0xc1')](_0x33e10f)['pipe'](fs[_0xa288('0xc2')](path['join'](_0x58ef82,_0x4209a0['basename'])));}}}}})[_0xa288('0x26')](function(){if(_0x1d346a){return new BPromise(function(_0x3d974b,_0x566a7e){zipdir(_0x58ef82,{'saveTo':_0x216c6d},function(_0x4b0d36,_0x48cc1f){if(_0x4b0d36)return _0x566a7e(_0x4b0d36);return _0x3d974b(_0x48cc1f);});});}})[_0xa288('0x26')](function(){if(_0x1d346a){return new BPromise(function(_0x1e6649,_0x2656d1){rimraf(_0x58ef82,function(_0x453631){if(_0x453631)_0x2656d1(_0x453631);return _0x1e6649();});});}})['then'](function(){if(_0x1d346a){return _0x1946f3['download'](_0x216c6d,_0x5d2d4d,function(_0xfdc207){if(_0xfdc207){console[_0xa288('0xc3')](_0xa288('0xc4'),_0xfdc207);}else{fs['unlinkSync'](_0x216c6d);}});}else{return _0x1946f3[_0xa288('0x1b')](0xc8);}})[_0xa288('0x32')](handleError(_0x1946f3,null));}; \ No newline at end of file +var _0x5b47=['\x20IN\x20?','\x20=\x20?','LIKE','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','ContactId','c.firstName','filter','isNil','FaxAccountId','i.FaxAccountId\x20IN\x20?','parse','$gte','$lte','null','\x20IS\x20NULL','replace','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','group','i.id','Sequelize','QueryTypes','SELECT','clone','COUNT(*)','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','sequelize','toString','keyBy','merge','Account.key','Contact.firstName','Contact.lastName','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','map','groupBy','push','all','rows','catch','show','includeAll','include','options','find','params','body','describe','addMessage','ids','omit','getMessages','findOne','FaxMessage','rawAttributes','hasOwnProperty','FaxInteractionId','setTags','spread','Tag','findAll','emit','faxInteractionTags:save','removeTags','root','server','files','attachments','tmp','join','Attachment','createReadStream','pipe','basename','download','log','err','unlinkSync','html-pdf','eml-format','bluebird','mustache','util','path','sox','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','TagIds','split','forEach','Tags','index','FaxInteraction','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','field','color','from','tools_tags','select','fax_messages','me.FaxInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','advancedFilter','createdAt','value','dateStart','startOf','day','utc','endOf','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','unreadMessages','tableAlias'];(function(_0x36598a,_0x4b4547){var _0x562edd=function(_0x38f598){while(--_0x38f598){_0x36598a['push'](_0x36598a['shift']());}};_0x562edd(++_0x4b4547);}(_0x5b47,0x120));var _0x75b4=function(_0x2172ff,_0x30cc62){_0x2172ff=_0x2172ff-0x0;var _0x216456=_0x5b47[_0x2172ff];return _0x216456;};'use strict';var pdf=require(_0x75b4('0x0'));var emlformat=require(_0x75b4('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x75b4('0x2'));var Mustache=require(_0x75b4('0x3'));var util=require(_0x75b4('0x4'));var path=require(_0x75b4('0x5'));var sox=require(_0x75b4('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x75b4('0x7'));var crypto=require('crypto');var jsforce=require(_0x75b4('0x8'));var deskjs=require(_0x75b4('0x9'));var toCsv=require(_0x75b4('0xa'));var querystring=require(_0x75b4('0xb'));var Papa=require(_0x75b4('0xc'));var Redis=require(_0x75b4('0xd'));var authService=require(_0x75b4('0xe'));var qs=require(_0x75b4('0xf'));var hardwareService=require(_0x75b4('0x10'));var logger=require('../../config/logger')(_0x75b4('0x11'));var utils=require('../../config/utils');var config=require(_0x75b4('0x12'));var db=require(_0x75b4('0x13'))['db'];config[_0x75b4('0x14')]=_[_0x75b4('0x15')](config[_0x75b4('0x14')],{'host':_0x75b4('0x16'),'port':0x18eb});var socket=require(_0x75b4('0x17'))(new Redis(config[_0x75b4('0x14')]));require('./faxInteraction.socket')['register'](socket);function respondWithStatusCode(_0x50f3be,_0x1f9c76){_0x1f9c76=_0x1f9c76||0xcc;return function(_0x2bc1a7){if(_0x2bc1a7){return _0x50f3be['sendStatus'](_0x1f9c76);}return _0x50f3be[_0x75b4('0x18')](_0x1f9c76)[_0x75b4('0x19')]();};}function respondWithResult(_0x3977ca,_0x4d8345){_0x4d8345=_0x4d8345||0xc8;return function(_0x2cd583){if(_0x2cd583){return _0x3977ca[_0x75b4('0x18')](_0x4d8345)[_0x75b4('0x1a')](_0x2cd583);}};}function respondWithFilteredResult(_0xc7ce4f,_0x4d77cf){return function(_0xf3d73a){if(_0xf3d73a){var _0x1322b6=_0xf3d73a[_0x75b4('0x1b')],_0x254063=_0x4d77cf[_0x75b4('0x1c')],_0x7e396d=_0x4d77cf[_0x75b4('0x1c')]+_0x4d77cf[_0x75b4('0x1d')],_0x33d522;if(_0x7e396d>=_0x1322b6){_0x7e396d=_0x1322b6;_0x33d522=0xc8;}else{_0x33d522=0xce;}_0xc7ce4f[_0x75b4('0x18')](_0x33d522);return _0xc7ce4f[_0x75b4('0x1e')](_0x75b4('0x1f'),_0x254063+'-'+_0x7e396d+'/'+_0x1322b6)[_0x75b4('0x1a')](_0xf3d73a);}return null;};}function patchUpdates(_0x40afc5){return function(_0x3b226e){try{jsonpatch[_0x75b4('0x20')](_0x3b226e,_0x40afc5,!![]);}catch(_0x432a51){return BPromise[_0x75b4('0x21')](_0x432a51);}return _0x3b226e[_0x75b4('0x22')]();};}function saveUpdates(_0x391226,_0x1583b1){return function(_0x2f91a7){if(_0x2f91a7){return _0x2f91a7[_0x75b4('0x23')](_0x391226)[_0x75b4('0x24')](function(_0x4beeff){return _0x4beeff;});}return null;};}function removeEntity(_0x30d338,_0x59bab1){return function(_0x16348b){if(_0x16348b){return _0x16348b[_0x75b4('0x25')]()[_0x75b4('0x24')](function(){_0x30d338[_0x75b4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e0b93,_0x1644d6){return function(_0x3c526d){if(!_0x3c526d){_0x5e0b93['sendStatus'](0x194);}return _0x3c526d;};}function handleError(_0x35eb86,_0xd5b2cc){_0xd5b2cc=_0xd5b2cc||0x1f4;return function(_0x5943ec){logger['error'](_0x5943ec[_0x75b4('0x26')]);if(_0x5943ec[_0x75b4('0x27')]){delete _0x5943ec['name'];}_0x35eb86[_0x75b4('0x18')](_0xd5b2cc)[_0x75b4('0x28')](_0x5943ec);};}function getInteractionUsers(_0x1b1e1e,_0x3fc275){return new BPromise(function(_0xf30ad4,_0xe936b2){try{if(_0x3fc275[_0x1b1e1e['id']]){_0x1b1e1e['Users']=_['map'](_0x3fc275[_0x1b1e1e['id']],function(_0xc05d27){return{'id':_0xc05d27['id']};});}}catch(_0x1608a8){_0xe936b2(_0x1608a8);}_0xf30ad4(_0x1b1e1e);});}function getInteractionTags(_0x251f03,_0x476e67){return new BPromise(function(_0x477c6a,_0x228d17){try{if(_0x251f03[_0x75b4('0x29')]){_0x251f03['Tags']=[];_0x251f03[_0x75b4('0x29')][_0x75b4('0x2a')](',')[_0x75b4('0x2b')](function(_0x4e616f){_0x251f03[_0x75b4('0x2c')]['push'](_0x476e67[_0x4e616f]);});}delete _0x251f03[_0x75b4('0x29')];}catch(_0x5e9713){_0x228d17(_0x5e9713);}_0x477c6a(_0x251f03);});}function updateFaxInteraction(_0x2ebe39,_0x906041,_0xee6855){return new BPromise(function(_0x40e49f,_0x435323){return getInteractionUsers(_0x2ebe39,_0xee6855)[_0x75b4('0x24')](function(_0x5e3d95){return getInteractionTags(_0x5e3d95,_0x906041);})[_0x75b4('0x24')](function(_0x4d0872){_0x40e49f(_0x4d0872);})['catch'](function(_0x5e496d){_0x435323(_0x5e496d);});});}exports[_0x75b4('0x2d')]=function(_0x331bd7,_0x534d09){var _0x52e3ec={},_0x5b9bc9={},_0x532724={'count':0x0,'rows':[]};var _0x3c565a=db[_0x75b4('0x2e')]['rawAttributes'];_0x5b9bc9[_0x75b4('0x2f')]=_[_0x75b4('0x30')](_0x3c565a);_0x5b9bc9[_0x75b4('0x31')]=_[_0x75b4('0x30')](_0x331bd7[_0x75b4('0x31')]);_0x5b9bc9['filters']=_[_0x75b4('0x32')](_0x5b9bc9[_0x75b4('0x2f')],_0x5b9bc9[_0x75b4('0x31')]);_0x52e3ec[_0x75b4('0x33')]=_[_0x75b4('0x32')](_0x5b9bc9[_0x75b4('0x2f')],qs[_0x75b4('0x34')](_0x331bd7[_0x75b4('0x31')][_0x75b4('0x34')]));_0x52e3ec['attributes']=_0x52e3ec[_0x75b4('0x33')][_0x75b4('0x35')]?_0x52e3ec[_0x75b4('0x33')]:_0x5b9bc9[_0x75b4('0x2f')];if(!_0x331bd7[_0x75b4('0x31')]['hasOwnProperty'](_0x75b4('0x36'))){_0x52e3ec[_0x75b4('0x1d')]=qs['limit'](_0x331bd7[_0x75b4('0x31')]['limit']);_0x52e3ec[_0x75b4('0x1c')]=qs[_0x75b4('0x1c')](_0x331bd7[_0x75b4('0x31')]['offset']);}_0x52e3ec[_0x75b4('0x37')]=qs['sort'](_0x331bd7[_0x75b4('0x31')][_0x75b4('0x38')]);_0x52e3ec[_0x75b4('0x39')]=qs[_0x75b4('0x3a')](_[_0x75b4('0x3b')](_0x331bd7[_0x75b4('0x31')],_0x5b9bc9[_0x75b4('0x3a')]));var _0x1f5c87=[];var _0x55415c=squel['select']()['field']('id')[_0x75b4('0x3c')](_0x75b4('0x27'))[_0x75b4('0x3c')](_0x75b4('0x3d'))[_0x75b4('0x3e')](_0x75b4('0x3f'));var _0x4a4d83=squel[_0x75b4('0x40')]()['field']('COUNT(*)')[_0x75b4('0x3e')](_0x75b4('0x41'),'me')[_0x75b4('0x39')](_0x75b4('0x42'))[_0x75b4('0x39')](_0x75b4('0x43'))['where'](_0x75b4('0x44'));var _0x2ef62c=squel['select']()[_0x75b4('0x3c')](_0x75b4('0x45'))[_0x75b4('0x3c')](_0x75b4('0x46'))[_0x75b4('0x3e')](_0x75b4('0x47'),'ui')[_0x75b4('0x48')](_0x75b4('0x49'),'u','u.id\x20=\x20ui.UserId');var _0x245ecb=squel[_0x75b4('0x40')]()[_0x75b4('0x3e')]('fax_interactions','i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x75b4('0x48')]('users','o',_0x75b4('0x4a'))[_0x75b4('0x48')]('fax_accounts','a',_0x75b4('0x4b'))[_0x75b4('0x48')]('fax_messages','me','me.FaxInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false');var _0x4a1e01=squel['expr']();if(_0x331bd7[_0x75b4('0x31')][_0x75b4('0x4c')]){var _0xd912a5=JSON['parse'](_0x331bd7[_0x75b4('0x31')]['advancedFilter']);_[_0x75b4('0x30')](_0xd912a5)['forEach'](function(_0x4547dd){var _0x452b60=_0xd912a5[_0x4547dd];if(_0x4547dd===_0x75b4('0x4d')){var _0x5c2732=moment(_0x452b60[_0x75b4('0x4e')][_0x75b4('0x4f')])[_0x75b4('0x50')](_0x75b4('0x51'))[_0x75b4('0x52')]()['format']();var _0xcdae69=moment(_0xcdae69)['utc']()[_0x75b4('0x53')]('day')[_0x75b4('0x54')]();_0x4a1e01[_0x75b4('0x55')](_0x75b4('0x56'),_0x5c2732,_0xcdae69);}else{if(_[_0x75b4('0x57')](_0x452b60['condition'])){_0x452b60[_0x75b4('0x58')][_0x75b4('0x2b')](function(_0x25f355){switch(_0x452b60[_0x75b4('0x58')][_0x75b4('0x4e')]){case'IS':if(_0x4547dd!==_0x75b4('0x59')&&_0x4547dd!==_0x75b4('0x5a')){if(_[_0x75b4('0x57')](_0x452b60[_0x75b4('0x4e')])&&_0x452b60[_0x75b4('0x4e')][_0x75b4('0x35')]>0x1){_0x4a1e01[_0x75b4('0x55')](_0x452b60[_0x75b4('0x5b')]+'.'+_0x4547dd+_0x75b4('0x5c'),_0x452b60['value']);}else{_0x4a1e01[_0x75b4('0x55')](_0x452b60[_0x75b4('0x5b')]+'.'+_0x4547dd+'\x20=\x20?',_0x452b60[_0x75b4('0x4e')][0x0]);}}break;case'=':_0x4a1e01[_0x75b4('0x55')](_0x452b60[_0x75b4('0x5b')]+'.'+_0x4547dd+_0x75b4('0x5d'),_0x452b60[_0x75b4('0x4e')]);break;case _0x75b4('0x5e'):if(_0x4547dd==='ContactId'){_0x4a1e01[_0x75b4('0x55')]('c.firstName'+_0x75b4('0x5f'),'%'+_0x452b60[_0x75b4('0x4e')]+'%');_0x4a1e01['or'](_0x75b4('0x60')+_0x75b4('0x5f'),'%'+_0x452b60[_0x75b4('0x4e')]+'%');_0x4a1e01['or'](_0x75b4('0x61')+_0x75b4('0x5f'),'%'+_0x452b60['value']+'%');}else{_0x4a1e01[_0x75b4('0x55')](_0x452b60[_0x75b4('0x5b')]+'.'+_0x4547dd+_0x75b4('0x5f'),'%'+_0x452b60[_0x75b4('0x4e')]+'%');}break;case'>':_0x4a1e01['and'](_0x452b60[_0x75b4('0x5b')]+'.'+_0x4547dd+_0x75b4('0x62'),_0x452b60[_0x75b4('0x4e')]);break;case'<':_0x4a1e01[_0x75b4('0x55')](_0x452b60[_0x75b4('0x5b')]+'.'+_0x4547dd+_0x75b4('0x63'),_0x452b60['value']);break;}});}else{switch(_0x452b60[_0x75b4('0x58')][_0x75b4('0x4e')]){case'IS':if(_0x4547dd!==_0x75b4('0x59')&&_0x4547dd!==_0x75b4('0x5a')){if(_[_0x75b4('0x57')](_0x452b60[_0x75b4('0x4e')])&&_0x452b60['value'][_0x75b4('0x35')]>0x1){_0x4a1e01[_0x75b4('0x55')](_0x452b60['tableAlias']+'.'+_0x4547dd+_0x75b4('0x5c'),_0x452b60[_0x75b4('0x4e')]);}else{_0x4a1e01['and'](_0x452b60[_0x75b4('0x5b')]+'.'+_0x4547dd+_0x75b4('0x5d'),_0x452b60['value'][0x0]);}}break;case'=':_0x4a1e01[_0x75b4('0x55')](_0x452b60[_0x75b4('0x5b')]+'.'+_0x4547dd+'\x20=\x20?',_0x452b60[_0x75b4('0x4e')]);break;case _0x75b4('0x5e'):if(_0x4547dd===_0x75b4('0x64')){_0x4a1e01['and'](_0x75b4('0x65')+_0x75b4('0x5f'),'%'+_0x452b60['value']+'%');_0x4a1e01['or'](_0x75b4('0x60')+_0x75b4('0x5f'),'%'+_0x452b60[_0x75b4('0x4e')]+'%');_0x4a1e01['or']('c.email'+_0x75b4('0x5f'),'%'+_0x452b60[_0x75b4('0x4e')]+'%');}else{_0x4a1e01[_0x75b4('0x55')](_0x452b60[_0x75b4('0x5b')]+'.'+_0x4547dd+_0x75b4('0x5f'),'%'+_0x452b60[_0x75b4('0x4e')]+'%');}break;case'>':_0x4a1e01['and'](_0x452b60[_0x75b4('0x5b')]+'.'+_0x4547dd+_0x75b4('0x62'),_0x452b60['value']);break;case'<':_0x4a1e01[_0x75b4('0x55')](_0x452b60[_0x75b4('0x5b')]+'.'+_0x4547dd+_0x75b4('0x63'),_0x452b60[_0x75b4('0x4e')]);break;}}}});}else{var _0x706070=_(Object[_0x75b4('0x30')](_0x331bd7[_0x75b4('0x31')]))['map'](function(_0x167056){return _0x3c565a['hasOwnProperty'](_0x167056)?_0x167056:undefined;})[_0x75b4('0x66')](function(_0x497d26){return!_[_0x75b4('0x67')](_0x497d26);})[_0x75b4('0x4e')]();if(!_['isEmpty'](_0x706070)){_0x706070[_0x75b4('0x2b')](function(_0x44cad2){if(_0x44cad2===_0x75b4('0x68')){_0x245ecb[_0x75b4('0x39')](_0x75b4('0x69'),[]['concat'](_0x331bd7[_0x75b4('0x31')][_0x44cad2]));}else if(_0x44cad2===_0x75b4('0x4d')){var _0x5ac50f=JSON[_0x75b4('0x6a')](_0x331bd7[_0x75b4('0x31')][_0x44cad2])[_0x75b4('0x6b')];var _0x4ec928=JSON[_0x75b4('0x6a')](_0x331bd7['query'][_0x44cad2])[_0x75b4('0x6c')];_0x245ecb['where'](_0x75b4('0x56'),_0x5ac50f,_0x4ec928);}else{if(_0x331bd7['query'][_0x44cad2]===_0x75b4('0x6d')){_0x245ecb[_0x75b4('0x39')]('i.'+_0x44cad2+_0x75b4('0x6e'));}else{_0x245ecb[_0x75b4('0x39')]('i.'+_0x44cad2+_0x75b4('0x5d'),_0x331bd7[_0x75b4('0x31')][_0x44cad2]);}}});}if(_0x331bd7[_0x75b4('0x31')][_0x75b4('0x66')]){var _0x5333fc=_0x331bd7['query']['filter']['replace']('\x5c','\x5c\x5c')[_0x75b4('0x6f')]('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x5333fc)){_0x4a1e01['or']('i.id\x20LIKE\x20?',_0x5333fc+'%')['or']('i.fax\x20LIKE\x20?',_0x5333fc+'%');}_0x4a1e01['or'](_0x75b4('0x70'),_0x5333fc+'%');}}_0x245ecb['where'](_0x4a1e01);if(_0x52e3ec[_0x75b4('0x37')]){_0x52e3ec['order']['forEach'](function(_0x584e8f){_0x245ecb['order']('i.'+_0x584e8f[0x0],_0x584e8f[0x1]===_0x75b4('0x71')?![]:!![]);});}_0x245ecb[_0x75b4('0x72')](_0x75b4('0x73'));var _0xde7f16={'type':db[_0x75b4('0x74')][_0x75b4('0x75')][_0x75b4('0x76')],'raw':!![]};var _0x3a9a99=_0x245ecb[_0x75b4('0x77')]()[_0x75b4('0x3c')](_0x75b4('0x78'))[_0x75b4('0x3c')](_0x75b4('0x79'),_0x75b4('0x5a'));if(!_0x331bd7[_0x75b4('0x31')][_0x75b4('0x4c')]){if(_0x331bd7[_0x75b4('0x31')][_0x75b4('0x7a')]){if(_0x331bd7[_0x75b4('0x31')][_0x75b4('0x7a')]==0x1){_0x3a9a99[_0x75b4('0x7b')]('`unreadMessages`\x20=\x200');_0x245ecb[_0x75b4('0x7b')](_0x75b4('0x7c'));}else{_0x3a9a99['having'](_0x75b4('0x7d'));_0x245ecb[_0x75b4('0x7b')](_0x75b4('0x7d'));}}if(_0x331bd7[_0x75b4('0x31')][_0x75b4('0x7e')]){var _0x5c235f=_[_0x75b4('0x57')](_0x331bd7[_0x75b4('0x31')]['tag'])?_0x331bd7[_0x75b4('0x31')][_0x75b4('0x7e')]:new Array(_0x331bd7[_0x75b4('0x31')][_0x75b4('0x7e')]);var _0x320bf4=squel[_0x75b4('0x7f')]();_0x5c235f['forEach'](function(_0x56793c){_0x320bf4['or'](_0x75b4('0x80'),'%,'+_0x56793c+',%');});_0x245ecb[_0x75b4('0x7b')](_0x320bf4);_0x3a9a99[_0x75b4('0x48')](_0x75b4('0x81'),'it',_0x75b4('0x82'));_0x3a9a99[_0x75b4('0x48')](_0x75b4('0x3f'),'t',_0x75b4('0x83'));_0x3a9a99[_0x75b4('0x39')](_0x75b4('0x84'),_0x5c235f);}}else{var _0xd912a5=JSON[_0x75b4('0x6a')](_0x331bd7[_0x75b4('0x31')][_0x75b4('0x4c')]);_[_0x75b4('0x30')](_0xd912a5)['forEach'](function(_0x177fc7){var _0x155beb=_0xd912a5[_0x177fc7];if(_0x177fc7===_0x75b4('0x59')){var _0x415dc1=_0x155beb[_0x75b4('0x4e')];var _0x1264b3=squel[_0x75b4('0x7f')]();_0x415dc1[_0x75b4('0x2b')](function(_0x21dcc1){_0x1264b3['or'](_0x75b4('0x80'),'%,'+_0x21dcc1+',%');});_0x245ecb[_0x75b4('0x7b')](_0x1264b3);_0x3a9a99[_0x75b4('0x48')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id');_0x3a9a99[_0x75b4('0x48')](_0x75b4('0x3f'),'t',_0x75b4('0x83'));_0x3a9a99['where'](_0x75b4('0x84'),_0x415dc1);}else if(_0x177fc7==='unreadMessages'){if(_0x155beb['value']['length']===0x1){if(_0x155beb[_0x75b4('0x4e')][0x0]===0x1){_0x3a9a99[_0x75b4('0x7b')](_0x75b4('0x7c'));_0x245ecb[_0x75b4('0x7b')]('`unreadMessages`\x20=\x200');}else{_0x3a9a99['having'](_0x75b4('0x7d'));_0x245ecb['having']('`unreadMessages`\x20>\x200');}}}});}db[_0x75b4('0x85')][_0x75b4('0x31')](_0x3a9a99[_0x75b4('0x86')](),_0xde7f16)['then'](function(_0x24da96){_0x532724['count']=_0x24da96[_0x75b4('0x35')];if(_0x532724[_0x75b4('0x1b')]===0x0)return[];return db[_0x75b4('0x85')][_0x75b4('0x31')](_0x55415c['toString'](),_0xde7f16)['then'](function(_0x5065ee){_0x1f5c87=_[_0x75b4('0x87')](_0x5065ee,'id');_0xde7f16=_[_0x75b4('0x88')](_0xde7f16,{'model':db[_0x75b4('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x245ecb[_0x75b4('0x3c')](_0x75b4('0x79'),_0x75b4('0x5a'));_0x245ecb[_0x75b4('0x3c')]('a.key',_0x75b4('0x89'));_0x245ecb[_0x75b4('0x3c')]('i.*');_0x245ecb[_0x75b4('0x3c')](_0x75b4('0x65'),_0x75b4('0x8a'));_0x245ecb['field'](_0x75b4('0x60'),_0x75b4('0x8b'));_0x245ecb[_0x75b4('0x3c')](_0x75b4('0x61'),_0x75b4('0x8c'));_0x245ecb[_0x75b4('0x3c')]('c.phone',_0x75b4('0x8d'));_0x245ecb['field'](_0x75b4('0x8e'),'Contact.mobile');_0x245ecb[_0x75b4('0x3c')](_0x75b4('0x8f'),_0x75b4('0x90'));_0x245ecb[_0x75b4('0x3c')](_0x75b4('0x91'),_0x75b4('0x29'));_0x245ecb[_0x75b4('0x48')]('fax_interaction_has_tags','it',_0x75b4('0x82'));_0x245ecb[_0x75b4('0x48')](_0x75b4('0x3f'),'t','t.id\x20=\x20it.TagId');_0x245ecb[_0x75b4('0x1d')](_0x52e3ec[_0x75b4('0x1d')]);_0x245ecb[_0x75b4('0x1c')](_0x52e3ec[_0x75b4('0x1c')]);return db[_0x75b4('0x85')][_0x75b4('0x31')](_0x245ecb['toString'](),_0xde7f16);})[_0x75b4('0x24')](function(_0x298651){_0x2ef62c['where']('ui.FaxInteractionId\x20IN\x20?',_[_0x75b4('0x92')](_0x298651,'id'));return db[_0x75b4('0x85')][_0x75b4('0x31')](_0x2ef62c[_0x75b4('0x86')](),_0xde7f16)[_0x75b4('0x24')](function(_0x3deaab){var _0x39a10e=_[_0x75b4('0x93')](_0x3deaab,'FaxInteractionId');var _0x29ba4b=[];_0x298651[_0x75b4('0x2b')](function(_0x2e211f){_0x29ba4b[_0x75b4('0x94')](updateFaxInteraction(_0x2e211f,_0x1f5c87,_0x39a10e));});return BPromise[_0x75b4('0x95')](_0x29ba4b);});});})[_0x75b4('0x24')](function(_0x4b1ed4){_0x532724[_0x75b4('0x96')]=_0x4b1ed4;return _0x532724;})[_0x75b4('0x24')](respondWithFilteredResult(_0x534d09,_0x52e3ec))[_0x75b4('0x97')](handleError(_0x534d09,null));};exports[_0x75b4('0x98')]=function(_0x3709e7,_0x52ab5f){var _0x4d16fc={'raw':![],'where':{'id':_0x3709e7['params']['id']}},_0x3b917e={};_0x3b917e[_0x75b4('0x2f')]=_[_0x75b4('0x30')](db['FaxInteraction']['rawAttributes']);_0x3b917e[_0x75b4('0x31')]=_[_0x75b4('0x30')](_0x3709e7[_0x75b4('0x31')]);_0x3b917e[_0x75b4('0x3a')]=_[_0x75b4('0x32')](_0x3b917e[_0x75b4('0x2f')],_0x3b917e['query']);_0x4d16fc[_0x75b4('0x33')]=_[_0x75b4('0x32')](_0x3b917e[_0x75b4('0x2f')],qs[_0x75b4('0x34')](_0x3709e7[_0x75b4('0x31')][_0x75b4('0x34')]));_0x4d16fc['attributes']=_0x4d16fc['attributes']['length']?_0x4d16fc[_0x75b4('0x33')]:_0x3b917e[_0x75b4('0x2f')];if(_0x3709e7['query'][_0x75b4('0x99')]){_0x4d16fc[_0x75b4('0x9a')]=[{'all':!![]}];}_0x4d16fc=_[_0x75b4('0x88')]({},_0x4d16fc,_0x3709e7[_0x75b4('0x9b')]);return db[_0x75b4('0x2e')]['find'](_0x4d16fc)[_0x75b4('0x24')](handleEntityNotFound(_0x52ab5f,null))[_0x75b4('0x24')](respondWithResult(_0x52ab5f,null))[_0x75b4('0x97')](handleError(_0x52ab5f,null));};exports['create']=function(_0x90c117,_0x2b0cf6){return db[_0x75b4('0x2e')]['create'](_0x90c117['body'],{})[_0x75b4('0x24')](respondWithResult(_0x2b0cf6,0xc9))[_0x75b4('0x97')](handleError(_0x2b0cf6,null));};exports[_0x75b4('0x23')]=function(_0x1f2499,_0x4c669c){if(_0x1f2499['body']['id']){delete _0x1f2499['body']['id'];}return db[_0x75b4('0x2e')][_0x75b4('0x9c')]({'where':{'id':_0x1f2499[_0x75b4('0x9d')]['id']}})[_0x75b4('0x24')](handleEntityNotFound(_0x4c669c,null))[_0x75b4('0x24')](saveUpdates(_0x1f2499[_0x75b4('0x9e')],null))['then'](respondWithResult(_0x4c669c,null))['catch'](handleError(_0x4c669c,null));};exports[_0x75b4('0x25')]=function(_0x58b534,_0x3cb5f0){return db[_0x75b4('0x2e')]['find']({'where':{'id':_0x58b534[_0x75b4('0x9d')]['id']}})[_0x75b4('0x24')](handleEntityNotFound(_0x3cb5f0,null))['then'](removeEntity(_0x3cb5f0,null))['catch'](handleError(_0x3cb5f0,null));};exports[_0x75b4('0x9f')]=function(_0x172e72,_0x520aaa){return db['FaxInteraction'][_0x75b4('0x9f')]()[_0x75b4('0x24')](respondWithResult(_0x520aaa,null))['catch'](handleError(_0x520aaa,null));};exports[_0x75b4('0xa0')]=function(_0x2eec46,_0x29f62c,_0x5ecbf1){return db['FaxMessage'][_0x75b4('0x9c')]({'where':{'id':_0x2eec46[_0x75b4('0x9d')]['id']}})[_0x75b4('0x24')](handleEntityNotFound(_0x29f62c,null))[_0x75b4('0x24')](function(_0x9e0f12){if(_0x9e0f12){return _0x9e0f12[_0x75b4('0xa0')](_0x2eec46['body'][_0x75b4('0xa1')],_[_0x75b4('0xa2')](_0x2eec46[_0x75b4('0x9e')],[_0x75b4('0xa1'),'id'])||{});}})[_0x75b4('0x24')](respondWithResult(_0x29f62c,null))[_0x75b4('0x97')](handleError(_0x29f62c,null));};exports[_0x75b4('0xa3')]=function(_0x540995,_0x2649e2,_0x40ef60){var _0x4c1c23={'raw':![],'where':{}};var _0xf65569={};var _0x4050b4={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x75b4('0xa4')]({'where':{'id':_0x540995['params']['id']}})[_0x75b4('0x24')](handleEntityNotFound(_0x2649e2,null))['then'](function(_0x369080){if(_0x369080){_0xf65569[_0x75b4('0x2f')]=_[_0x75b4('0x30')](db[_0x75b4('0xa5')][_0x75b4('0xa6')]);_0xf65569['query']=_[_0x75b4('0x30')](_0x540995[_0x75b4('0x31')]);_0xf65569[_0x75b4('0x3a')]=_[_0x75b4('0x32')](_0xf65569[_0x75b4('0x2f')],_0xf65569['query']);_0x4c1c23[_0x75b4('0x33')]=_[_0x75b4('0x32')](_0xf65569[_0x75b4('0x2f')],qs[_0x75b4('0x34')](_0x540995[_0x75b4('0x31')]['fields']));_0x4c1c23[_0x75b4('0x33')]=_0x4c1c23[_0x75b4('0x33')][_0x75b4('0x35')]?_0x4c1c23[_0x75b4('0x33')]:_0xf65569['model'];if(!_0x540995[_0x75b4('0x31')][_0x75b4('0xa7')](_0x75b4('0x36'))){_0x4c1c23[_0x75b4('0x1d')]=qs[_0x75b4('0x1d')](_0x540995[_0x75b4('0x31')]['limit']);_0x4c1c23[_0x75b4('0x1c')]=qs[_0x75b4('0x1c')](_0x540995[_0x75b4('0x31')][_0x75b4('0x1c')]);}_0x4c1c23[_0x75b4('0x37')]=qs[_0x75b4('0x38')](_0x540995['query'][_0x75b4('0x38')]);_0x4c1c23[_0x75b4('0x39')]=qs[_0x75b4('0x3a')](_[_0x75b4('0x3b')](_0x540995['query'],_0xf65569[_0x75b4('0x3a')]));_0x4c1c23[_0x75b4('0x39')][_0x75b4('0xa8')]=_0x369080['id'];if(_0x540995[_0x75b4('0x31')]['filter']){_0x4c1c23[_0x75b4('0x39')]=_[_0x75b4('0x88')](_0x4c1c23[_0x75b4('0x39')],{'$or':_[_0x75b4('0x92')](_0x4c1c23[_0x75b4('0x33')],function(_0x4d5d9c){var _0x48dc96={};_0x48dc96[_0x4d5d9c]={'$like':'%'+_0x540995[_0x75b4('0x31')][_0x75b4('0x66')]+'%'};return _0x48dc96;})});}if(_0x540995[_0x75b4('0x31')][_0x75b4('0x6b')]){var _0x4f2a20=_0x540995[_0x75b4('0x31')][_0x75b4('0x6b')][_0x75b4('0x2a')](',');var _0x1967c0={};_0x1967c0[_0x4f2a20[0x0]]={'$gte':moment(_0x4f2a20[0x1])[_0x75b4('0x54')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4c1c23[_0x75b4('0x39')]=_['merge'](_0x4c1c23[_0x75b4('0x39')],_0x1967c0);}_0x4c1c23=_[_0x75b4('0x88')]({},_0x4c1c23,_0x540995[_0x75b4('0x9b')]);return db['FaxMessage']['count']({'where':_0x4c1c23[_0x75b4('0x39')]})[_0x75b4('0x24')](function(_0x1db750){_0x4050b4['count']=_0x1db750;if(_0x540995[_0x75b4('0x31')][_0x75b4('0x99')]){_0x4c1c23[_0x75b4('0x9a')]=[{'all':!![]}];}return db[_0x75b4('0xa5')]['findAll'](_0x4c1c23);})[_0x75b4('0x24')](function(_0x4a5458){_0x4050b4['rows']=_0x4a5458;return _0x4050b4;});}})['then'](respondWithFilteredResult(_0x2649e2,_0x4c1c23))[_0x75b4('0x97')](handleError(_0x2649e2,null));};exports['addTags']=function(_0x437331,_0x1744fd,_0x2f4e23){return db[_0x75b4('0x2e')][_0x75b4('0x9c')]({'where':{'id':_0x437331[_0x75b4('0x9d')]['id']}})[_0x75b4('0x24')](handleEntityNotFound(_0x1744fd,null))[_0x75b4('0x24')](function(_0x4e328d){if(_0x4e328d){return _0x4e328d[_0x75b4('0xa9')](_0x437331[_0x75b4('0x9e')]['ids'],_['omit'](_0x437331['body'],[_0x75b4('0xa1'),'id'])||{})[_0x75b4('0xaa')](function(){return db[_0x75b4('0xab')][_0x75b4('0xac')]({'attributes':['id',_0x75b4('0x27'),_0x75b4('0x3d')],'where':{'id':_0x437331[_0x75b4('0x9e')][_0x75b4('0xa1')]}});})[_0x75b4('0x24')](function(_0x5ee37e){socket[_0x75b4('0xad')](_0x75b4('0xae'),{'id':Number(_0x437331[_0x75b4('0x9d')]['id']),'tags':_0x5ee37e||[]});return{'id':Number(_0x437331['params']['id']),'tags':_0x5ee37e||[]};});}})[_0x75b4('0x24')](respondWithResult(_0x1744fd,null))['catch'](handleError(_0x1744fd,null));};exports[_0x75b4('0xaf')]=function(_0x2d789f,_0x232edf,_0x143024){return db[_0x75b4('0x2e')]['find']({'where':{'id':_0x2d789f[_0x75b4('0x9d')]['id']}})[_0x75b4('0x24')](handleEntityNotFound(_0x232edf,null))['then'](function(_0x572cc3){if(_0x572cc3){return _0x572cc3[_0x75b4('0xaf')](_0x2d789f[_0x75b4('0x31')][_0x75b4('0xa1')]);}})[_0x75b4('0x24')](respondWithStatusCode(_0x232edf,null))[_0x75b4('0x97')](handleError(_0x232edf,null));};exports['download']=function(_0x31a6ae,_0x3d3631){var _0x295def=moment()['unix']()[_0x75b4('0x86')]();var _0x2342a1=path['join'](config[_0x75b4('0xb0')],_0x75b4('0xb1'),_0x75b4('0xb2'),_0x75b4('0xb3'));var _0x427190=path['join'](config['root'],'server',_0x75b4('0xb2'),_0x75b4('0xb4'));var _0x5674a2=path['join'](_0x427190,_0x295def);var _0x4b4489=util[_0x75b4('0x54')]('interaction-%s.zip',_0x295def);var _0x310e4e=path[_0x75b4('0xb5')](_0x427190,_0x4b4489);var _0x1e4fc7=![];return db[_0x75b4('0x2e')][_0x75b4('0x9c')]({'where':{'id':_0x31a6ae[_0x75b4('0x9d')]['id']}})[_0x75b4('0x24')](handleEntityNotFound(_0x3d3631,null))['then'](function(_0x3e6ef9){if(_0x3e6ef9){return _0x3e6ef9['getMessages']({'attributes':['id',_0x75b4('0x9e'),_0x75b4('0x4d')],'include':[{'model':db[_0x75b4('0xb6')],'as':_0x75b4('0xb6')}]});}return[];})[_0x75b4('0x24')](function(_0x18020e){_0x1e4fc7=_0x18020e[_0x75b4('0x35')];if(_0x18020e['length']){fs['mkdirSync'](_0x5674a2);for(var _0x1361a7=0x0;_0x1361a7<_0x18020e[_0x75b4('0x35')];_0x1361a7++){var _0x1a66f7=_0x18020e[_0x1361a7];var _0x50fea8=_0x1a66f7['Attachment'];if(_0x50fea8){var _0x40c6f1=path[_0x75b4('0xb5')](_0x2342a1,_0x50fea8['basename']);if(fs['existsSync'](_0x40c6f1)){fs[_0x75b4('0xb7')](_0x40c6f1)[_0x75b4('0xb8')](fs['createWriteStream'](path[_0x75b4('0xb5')](_0x5674a2,_0x50fea8[_0x75b4('0xb9')])));}}}}})['then'](function(){if(_0x1e4fc7){return new BPromise(function(_0x406fb2,_0x42bfac){zipdir(_0x5674a2,{'saveTo':_0x310e4e},function(_0x157f6c,_0x445b95){if(_0x157f6c)return _0x42bfac(_0x157f6c);return _0x406fb2(_0x445b95);});});}})[_0x75b4('0x24')](function(){if(_0x1e4fc7){return new BPromise(function(_0x1d52c5,_0x26cddf){rimraf(_0x5674a2,function(_0x297292){if(_0x297292)_0x26cddf(_0x297292);return _0x1d52c5();});});}})[_0x75b4('0x24')](function(){if(_0x1e4fc7){return _0x3d3631[_0x75b4('0xba')](_0x310e4e,_0x4b4489,function(_0x28ac83){if(_0x28ac83){console[_0x75b4('0xbb')](_0x75b4('0xbc'),_0x28ac83);}else{fs[_0x75b4('0xbd')](_0x310e4e);}});}else{return _0x3d3631['sendStatus'](0xc8);}})[_0x75b4('0x97')](handleError(_0x3d3631,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 5551630..baf2295 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 _0xa812=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save'];(function(_0x249c68,_0x311580){var _0x316c89=function(_0x304ec5){while(--_0x304ec5){_0x249c68['push'](_0x249c68['shift']());}};_0x316c89(++_0x311580);}(_0xa812,0xd6));var _0x2a81=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xa812[_0x465a0c];return _0x1e202e;};'use strict';var EventEmitter=require(_0x2a81('0x0'));var FaxInteraction=require(_0x2a81('0x1'))['db'][_0x2a81('0x2')];var FaxMessage=require(_0x2a81('0x1'))['db'][_0x2a81('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x2a81('0x4')](0x0);var events={'afterCreate':_0x2a81('0x5'),'afterUpdate':_0x2a81('0x6'),'afterDestroy':_0x2a81('0x7')};function emitEvent(_0x4bb9e7){return function(_0x58fd6d,_0x4d5ea0,_0x3375a4){_0x58fd6d[_0x2a81('0x8')]({'attributes':['id'],'raw':!![]})[_0x2a81('0x9')](function(_0xe92c50){_0x58fd6d[_0x2a81('0xa')](_0x2a81('0xb'),_0xe92c50[_0x2a81('0xc')](function(_0x17b477){return{'id':_0x17b477['id']};}));return FaxMessage[_0x2a81('0xd')]({'where':{'FaxInteractionId':_0x58fd6d['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3fe21a){_0x58fd6d[_0x2a81('0xa')](_0x2a81('0xe'),_0x3fe21a['length']);FaxInteractionEvents[_0x2a81('0xf')](_0x4bb9e7+':'+_0x58fd6d['id'],_0x58fd6d);FaxInteractionEvents[_0x2a81('0xf')](_0x4bb9e7,_0x58fd6d);_0x3375a4(null);})[_0x2a81('0x10')](_0x3375a4(null));};}for(var e in events){if(events[_0x2a81('0x11')](e)){var event=events[e];FaxInteraction[_0x2a81('0x12')](e,emitEvent(event));}}module[_0x2a81('0x13')]=FaxInteractionEvents; \ No newline at end of file +var _0xd2e9=['emit','hook','exports','events','../../mysqldb','FaxMessage','save','update','remove','getUsers','then','setDataValue','findAll','unreadMessages'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd2e9,0xc7));var _0x9d2e=function(_0x1ee474,_0x6d6c6d){_0x1ee474=_0x1ee474-0x0;var _0x458ee7=_0xd2e9[_0x1ee474];return _0x458ee7;};'use strict';var EventEmitter=require(_0x9d2e('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0x9d2e('0x1'))['db'][_0x9d2e('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9d2e('0x3'),'afterUpdate':_0x9d2e('0x4'),'afterDestroy':_0x9d2e('0x5')};function emitEvent(_0x3f3482){return function(_0x2fb73b,_0x3eee88,_0x3f2885){_0x2fb73b[_0x9d2e('0x6')]({'attributes':['id'],'raw':!![]})[_0x9d2e('0x7')](function(_0x1df5c4){_0x2fb73b[_0x9d2e('0x8')]('Users',_0x1df5c4['map'](function(_0x22d15d){return{'id':_0x22d15d['id']};}));return FaxMessage[_0x9d2e('0x9')]({'where':{'FaxInteractionId':_0x2fb73b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9d2e('0x7')](function(_0x14d7b3){_0x2fb73b[_0x9d2e('0x8')](_0x9d2e('0xa'),_0x14d7b3['length']);FaxInteractionEvents[_0x9d2e('0xb')](_0x3f3482+':'+_0x2fb73b['id'],_0x2fb73b);FaxInteractionEvents['emit'](_0x3f3482,_0x2fb73b);_0x3f2885(null);})['catch'](_0x3f2885(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x9d2e('0xc')](e,emitEvent(event));}}module[_0x9d2e('0xd')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index a06845a..5b5dc82 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 _0x829f=['rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','changed','closed','format','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0xb8d9cf,_0x455825){var _0x5a2d3b=function(_0x3fc1a0){while(--_0x3fc1a0){_0xb8d9cf['push'](_0xb8d9cf['shift']());}};_0x5a2d3b(++_0x455825);}(_0x829f,0x129));var _0xf829=function(_0x4e0b51,_0x481121){_0x4e0b51=_0x4e0b51-0x0;var _0x483db9=_0x829f[_0x4e0b51];return _0x483db9;};'use strict';var _=require(_0xf829('0x0'));var util=require(_0xf829('0x1'));var logger=require('../../config/logger')(_0xf829('0x2'));var moment=require(_0xf829('0x3'));var BPromise=require(_0xf829('0x4'));var rp=require(_0xf829('0x5'));var fs=require('fs');var path=require(_0xf829('0x6'));var rimraf=require(_0xf829('0x7'));var config=require(_0xf829('0x8'));var attributes=require(_0xf829('0x9'));module[_0xf829('0xa')]=function(_0x57c282,_0xdcc70d){return _0x57c282[_0xf829('0xb')](_0xf829('0xc'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe77058,_0x2d79a4,_0x3c44ec){if(_0xe77058[_0xf829('0xd')](_0xf829('0xe'))){_0xe77058['closedAt']=moment()[_0xf829('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3c44ec(null,_0xe77058);}}});}; \ No newline at end of file +var _0x5db7=['FaxInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxInteraction.attributes','define'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5db7,0x1b5));var _0x75db=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x5db7[_0x59d89e];return _0x554e93;};'use strict';var _=require(_0x75db('0x0'));var util=require(_0x75db('0x1'));var logger=require(_0x75db('0x2'))(_0x75db('0x3'));var moment=require(_0x75db('0x4'));var BPromise=require(_0x75db('0x5'));var rp=require(_0x75db('0x6'));var fs=require('fs');var path=require(_0x75db('0x7'));var rimraf=require(_0x75db('0x8'));var config=require('../../config/environment');var attributes=require(_0x75db('0x9'));module['exports']=function(_0x137c7c,_0x174afe){return _0x137c7c[_0x75db('0xa')](_0x75db('0xb'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1d09d7,_0x3ca302,_0x48d22a){if(_0x1d09d7[_0x75db('0xc')](_0x75db('0xd'))){_0x1d09d7[_0x75db('0xe')]=moment()['format'](_0x75db('0xf'));}_0x48d22a(null,_0x1d09d7);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 2ea9e7a..af717c8 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 _0xbf3f=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','catch','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring'];(function(_0x366e99,_0x15d82d){var _0x180bbe=function(_0x282498){while(--_0x282498){_0x366e99['push'](_0x366e99['shift']());}};_0x180bbe(++_0x15d82d);}(_0xbf3f,0x129));var _0xfbf3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf3f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfbf3('0x0'));var util=require('util');var moment=require(_0xfbf3('0x1'));var BPromise=require(_0xfbf3('0x2'));var rs=require(_0xfbf3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfbf3('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfbf3('0x5'));var config=require(_0xfbf3('0x6'));var jayson=require(_0xfbf3('0x7'));var client=jayson[_0xfbf3('0x8')][_0xfbf3('0x9')]({'port':0x232a});config[_0xfbf3('0xa')]=_[_0xfbf3('0xb')](config[_0xfbf3('0xa')],{'host':_0xfbf3('0xc'),'port':0x18eb});var socket=require(_0xfbf3('0xd'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0xfbf3('0xe')](socket);function respondWithRpcPromise(_0x26b36a,_0x20b08b,_0x113568){return new BPromise(function(_0x24a36b,_0x5bfcc5){return client[_0xfbf3('0xf')](_0x26b36a,_0x113568)[_0xfbf3('0x10')](function(_0xfe7b1d){logger[_0xfbf3('0x11')](_0xfbf3('0x12'),_0x20b08b,_0xfbf3('0x13'));logger['debug'](_0xfbf3('0x14'),_0x20b08b,_0xfbf3('0x13'),JSON[_0xfbf3('0x15')](_0xfe7b1d));if(_0xfe7b1d[_0xfbf3('0x16')]){if(_0xfe7b1d[_0xfbf3('0x16')][_0xfbf3('0x17')]===0x1f4){logger['error'](_0xfbf3('0x12'),_0x20b08b,_0xfe7b1d[_0xfbf3('0x16')][_0xfbf3('0x18')]);return _0x5bfcc5(_0xfe7b1d['error']['message']);}logger[_0xfbf3('0x16')](_0xfbf3('0x12'),_0x20b08b,_0xfe7b1d[_0xfbf3('0x16')][_0xfbf3('0x18')]);return _0x24a36b(_0xfe7b1d[_0xfbf3('0x16')]['message']);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x20b08b,_0xfbf3('0x13'));_0x24a36b(_0xfe7b1d[_0xfbf3('0x19')][_0xfbf3('0x18')]);}})['catch'](function(_0x2451a6){logger[_0xfbf3('0x16')](_0xfbf3('0x12'),_0x20b08b,_0x2451a6);_0x5bfcc5(_0x2451a6);});});}exports[_0xfbf3('0x1a')]=function(_0x5b281d){var _0x1f7d48=this;return new Promise(function(_0x2165ca,_0x5cb5cc){return db[_0xfbf3('0x1b')][_0xfbf3('0x1c')](_0x5b281d[_0xfbf3('0x1d')],{'raw':_0x5b281d[_0xfbf3('0x1e')]?_0x5b281d['options'][_0xfbf3('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b281d[_0xfbf3('0x1e')]?_0x5b281d[_0xfbf3('0x1e')][_0xfbf3('0x20')]||null:null,'attributes':_0x5b281d['options']?_0x5b281d['options'][_0xfbf3('0x21')]||null:null,'limit':_0x5b281d[_0xfbf3('0x1e')]?_0x5b281d[_0xfbf3('0x1e')][_0xfbf3('0x22')]||null:null})[_0xfbf3('0x10')](function(_0x5425e2){logger[_0xfbf3('0x11')]('UpdateFaxInteraction',_0x5b281d);logger['debug']('UpdateFaxInteraction',_0x5b281d,JSON['stringify'](_0x5425e2));_0x2165ca(_0x5425e2);})[_0xfbf3('0x23')](function(_0x254530){logger[_0xfbf3('0x16')]('UpdateFaxInteraction',_0x254530[_0xfbf3('0x18')],_0x5b281d);_0x5cb5cc(_0x1f7d48['error'](0x1f4,_0x254530[_0xfbf3('0x18')]));});});};exports[_0xfbf3('0x24')]=function(_0x25da44){return new Promise(function(_0x3feb52,_0x5f112a){return db[_0xfbf3('0x1b')][_0xfbf3('0x25')]({'where':_0x25da44[_0xfbf3('0x1e')]?_0x25da44[_0xfbf3('0x1e')][_0xfbf3('0x20')]||null:null})[_0xfbf3('0x10')](function(_0x5b8162){if(_0x5b8162){return _0x5b8162[_0xfbf3('0x26')](_0x25da44[_0xfbf3('0x1d')][_0xfbf3('0x27')],_[_0xfbf3('0x28')](_0x25da44[_0xfbf3('0x1d')],[_0xfbf3('0x27'),'id'])||{});}})[_0xfbf3('0x29')](function(_0x521b64){logger[_0xfbf3('0x11')](_0xfbf3('0x2a'),_0x25da44);logger['debug'](_0xfbf3('0x2a'),_0x25da44,JSON[_0xfbf3('0x15')](_0x521b64));_0x3feb52(_0x521b64);})[_0xfbf3('0x23')](function(_0x358b77){logger[_0xfbf3('0x16')](_0xfbf3('0x2a'),_0x358b77[_0xfbf3('0x18')],_0x25da44);_0x5f112a(_this[_0xfbf3('0x16')](0x1f4,_0x358b77[_0xfbf3('0x18')]));});});}; \ No newline at end of file +var _0xf6d4=['ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','request\x20sent','debug','error','FaxInteraction,\x20%s,\x20%s','message','result','FaxInteraction','body','options','raw','where','attributes','limit','info','UpdateFaxInteraction','stringify','AddTagsToFaxInteraction','find','addTags'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xf6d4,0xd5));var _0x4f6d=function(_0x26ba55,_0x2cee01){_0x26ba55=_0x26ba55-0x0;var _0x1d4b17=_0xf6d4[_0x26ba55];return _0x1d4b17;};'use strict';var _=require(_0x4f6d('0x0'));var util=require(_0x4f6d('0x1'));var moment=require(_0x4f6d('0x2'));var BPromise=require(_0x4f6d('0x3'));var rs=require(_0x4f6d('0x4'));var fs=require('fs');var Redis=require(_0x4f6d('0x5'));var db=require(_0x4f6d('0x6'))['db'];var utils=require(_0x4f6d('0x7'));var logger=require('../../config/logger')(_0x4f6d('0x8'));var config=require(_0x4f6d('0x9'));var jayson=require(_0x4f6d('0xa'));var client=jayson['client'][_0x4f6d('0xb')]({'port':0x232a});config[_0x4f6d('0xc')]=_[_0x4f6d('0xd')](config[_0x4f6d('0xc')],{'host':_0x4f6d('0xe'),'port':0x18eb});var socket=require(_0x4f6d('0xf'))(new Redis(config[_0x4f6d('0xc')]));require(_0x4f6d('0x10'))[_0x4f6d('0x11')](socket);function respondWithRpcPromise(_0x1727a4,_0x2f5f29,_0x382c7b){return new BPromise(function(_0x2f217b,_0xd10950){return client[_0x4f6d('0x12')](_0x1727a4,_0x382c7b)[_0x4f6d('0x13')](function(_0x5a86df){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x2f5f29,_0x4f6d('0x14'));logger[_0x4f6d('0x15')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x2f5f29,'request\x20sent',JSON['stringify'](_0x5a86df));if(_0x5a86df[_0x4f6d('0x16')]){if(_0x5a86df[_0x4f6d('0x16')]['code']===0x1f4){logger['error'](_0x4f6d('0x17'),_0x2f5f29,_0x5a86df['error'][_0x4f6d('0x18')]);return _0xd10950(_0x5a86df[_0x4f6d('0x16')][_0x4f6d('0x18')]);}logger[_0x4f6d('0x16')](_0x4f6d('0x17'),_0x2f5f29,_0x5a86df[_0x4f6d('0x16')][_0x4f6d('0x18')]);return _0x2f217b(_0x5a86df['error'][_0x4f6d('0x18')]);}else{logger['info'](_0x4f6d('0x17'),_0x2f5f29,_0x4f6d('0x14'));_0x2f217b(_0x5a86df[_0x4f6d('0x19')][_0x4f6d('0x18')]);}})['catch'](function(_0x3574e0){logger[_0x4f6d('0x16')](_0x4f6d('0x17'),_0x2f5f29,_0x3574e0);_0xd10950(_0x3574e0);});});}exports['UpdateFaxInteraction']=function(_0x5736a7){var _0x4983d2=this;return new Promise(function(_0x3c44a5,_0x5744bf){return db[_0x4f6d('0x1a')]['update'](_0x5736a7[_0x4f6d('0x1b')],{'raw':_0x5736a7[_0x4f6d('0x1c')]?_0x5736a7[_0x4f6d('0x1c')][_0x4f6d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5736a7['options']?_0x5736a7[_0x4f6d('0x1c')][_0x4f6d('0x1e')]||null:null,'attributes':_0x5736a7[_0x4f6d('0x1c')]?_0x5736a7[_0x4f6d('0x1c')][_0x4f6d('0x1f')]||null:null,'limit':_0x5736a7[_0x4f6d('0x1c')]?_0x5736a7[_0x4f6d('0x1c')][_0x4f6d('0x20')]||null:null})[_0x4f6d('0x13')](function(_0x3ffd7f){logger[_0x4f6d('0x21')](_0x4f6d('0x22'),_0x5736a7);logger[_0x4f6d('0x15')](_0x4f6d('0x22'),_0x5736a7,JSON[_0x4f6d('0x23')](_0x3ffd7f));_0x3c44a5(_0x3ffd7f);})['catch'](function(_0x2e8186){logger[_0x4f6d('0x16')]('UpdateFaxInteraction',_0x2e8186['message'],_0x5736a7);_0x5744bf(_0x4983d2[_0x4f6d('0x16')](0x1f4,_0x2e8186['message']));});});};exports[_0x4f6d('0x24')]=function(_0x42de18){return new Promise(function(_0x14ef00,_0x121c28){return db[_0x4f6d('0x1a')][_0x4f6d('0x25')]({'where':_0x42de18['options']?_0x42de18[_0x4f6d('0x1c')][_0x4f6d('0x1e')]||null:null})[_0x4f6d('0x13')](function(_0x40ff84){if(_0x40ff84){return _0x40ff84[_0x4f6d('0x26')](_0x42de18[_0x4f6d('0x1b')][_0x4f6d('0x27')],_['omit'](_0x42de18[_0x4f6d('0x1b')],[_0x4f6d('0x27'),'id'])||{});}})[_0x4f6d('0x28')](function(_0x3c904d){logger['info'](_0x4f6d('0x29'),_0x42de18);logger[_0x4f6d('0x15')](_0x4f6d('0x29'),_0x42de18,JSON['stringify'](_0x3c904d));_0x14ef00(_0x3c904d);})['catch'](function(_0x27896c){logger[_0x4f6d('0x16')](_0x4f6d('0x29'),_0x27896c[_0x4f6d('0x18')],_0x42de18);_0x121c28(_this['error'](0x1f4,_0x27896c[_0x4f6d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index f559589..e2decd6 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 _0x922a=['remove','emit','removeListener','register','faxInteraction:','./faxInteraction.events','save'];(function(_0xda57b,_0x52773c){var _0x52282b=function(_0x426667){while(--_0x426667){_0xda57b['push'](_0xda57b['shift']());}};_0x52282b(++_0x52773c);}(_0x922a,0x108));var _0xa922=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x922a[_0x13e741];return _0x3f8bb3;};'use strict';var FaxInteractionEvents=require(_0xa922('0x0'));var events=[_0xa922('0x1'),_0xa922('0x2'),'update'];function createListener(_0x329cc5,_0x57192d){return function(_0x3a3c68){_0x57192d[_0xa922('0x3')](_0x329cc5,_0x3a3c68);};}function removeListener(_0x4177d4,_0x18ffce){return function(){FaxInteractionEvents[_0xa922('0x4')](_0x4177d4,_0x18ffce);};}exports[_0xa922('0x5')]=function(_0x42843e){for(var _0x1e3f81=0x0,_0x50751f=events['length'];_0x1e3f81<_0x50751f;_0x1e3f81++){var _0x1a3f21=events[_0x1e3f81];var _0x5e964c=createListener(_0xa922('0x6')+_0x1a3f21,_0x42843e);FaxInteractionEvents['on'](_0x1a3f21,_0x5e964c);}}; \ No newline at end of file +var _0x3065=['length','faxInteraction:','save','remove','update','emit','removeListener','register'];(function(_0x173505,_0x3ded9d){var _0x4c2ca8=function(_0x961349){while(--_0x961349){_0x173505['push'](_0x173505['shift']());}};_0x4c2ca8(++_0x3ded9d);}(_0x3065,0x92));var _0x5306=function(_0x13716a,_0x5c43fa){_0x13716a=_0x13716a-0x0;var _0x42b41e=_0x3065[_0x13716a];return _0x42b41e;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x5306('0x0'),_0x5306('0x1'),_0x5306('0x2')];function createListener(_0x4ddcdc,_0x311bce){return function(_0x2463c6){_0x311bce[_0x5306('0x3')](_0x4ddcdc,_0x2463c6);};}function removeListener(_0x5e413f,_0x227c06){return function(){FaxInteractionEvents[_0x5306('0x4')](_0x5e413f,_0x227c06);};}exports[_0x5306('0x5')]=function(_0x413f93){for(var _0xcd7fb9=0x0,_0x458686=events[_0x5306('0x6')];_0xcd7fb9<_0x458686;_0xcd7fb9++){var _0x2e5be5=events[_0xcd7fb9];var _0x3ab174=createListener(_0x5306('0x7')+_0x2e5be5,_0x413f93);FaxInteractionEvents['on'](_0x2e5be5,_0x3ab174);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 9044d6d..1ec990c 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 _0x0aab=['post','create','/:id/messages','addMessage','/:id/tags','tracked','fax','addTags','put','faxinteraction:update','delete','faxinteraction:destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','/:id/download','download'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0aab,0x12d));var _0xb0aa=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0x0aab[_0x152121];return _0x592a85;};'use strict';var multer=require(_0xb0aa('0x0'));var util=require(_0xb0aa('0x1'));var path=require(_0xb0aa('0x2'));var timeout=require('connect-timeout');var express=require(_0xb0aa('0x3'));var router=express[_0xb0aa('0x4')]();var auth=require(_0xb0aa('0x5'));var interaction=require(_0xb0aa('0x6'));var config=require(_0xb0aa('0x7'));var controller=require(_0xb0aa('0x8'));router[_0xb0aa('0x9')]('/',auth[_0xb0aa('0xa')](),controller[_0xb0aa('0xb')]);router[_0xb0aa('0x9')](_0xb0aa('0xc'),auth[_0xb0aa('0xa')](),controller[_0xb0aa('0xd')]);router[_0xb0aa('0x9')](_0xb0aa('0xe'),auth[_0xb0aa('0xa')](),controller[_0xb0aa('0xf')]);router[_0xb0aa('0x9')]('/:id/messages',auth[_0xb0aa('0xa')](),controller[_0xb0aa('0x10')]);router[_0xb0aa('0x9')](_0xb0aa('0x11'),auth['isAuthenticated'](),controller[_0xb0aa('0x12')]);router[_0xb0aa('0x13')]('/',auth[_0xb0aa('0xa')](),controller[_0xb0aa('0x14')]);router[_0xb0aa('0x13')](_0xb0aa('0x15'),auth[_0xb0aa('0xa')](),controller[_0xb0aa('0x16')]);router[_0xb0aa('0x13')](_0xb0aa('0x17'),auth[_0xb0aa('0xa')](),interaction[_0xb0aa('0x18')](_0xb0aa('0x19'),'faxinteraction:addtags'),controller[_0xb0aa('0x1a')]);router[_0xb0aa('0x1b')](_0xb0aa('0xe'),auth[_0xb0aa('0xa')](),interaction['tracked'](_0xb0aa('0x19'),_0xb0aa('0x1c')),controller['update']);router[_0xb0aa('0x1d')]('/:id',auth[_0xb0aa('0xa')](),interaction[_0xb0aa('0x18')](_0xb0aa('0x19'),_0xb0aa('0x1e')),controller['destroy']);router[_0xb0aa('0x1d')](_0xb0aa('0x17'),auth[_0xb0aa('0xa')](),controller['removeTags']);module[_0xb0aa('0x1f')]=router; \ No newline at end of file +var _0x8d95=['/:id/tags','tracked','fax','addTags','faxinteraction:update','update','delete','removeTags','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage'];(function(_0x3a512d,_0x3cc263){var _0x2c67b9=function(_0x4e5597){while(--_0x4e5597){_0x3a512d['push'](_0x3a512d['shift']());}};_0x2c67b9(++_0x3cc263);}(_0x8d95,0x85));var _0x58d9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8d95[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x58d9('0x0'));var util=require(_0x58d9('0x1'));var path=require(_0x58d9('0x2'));var timeout=require(_0x58d9('0x3'));var express=require(_0x58d9('0x4'));var router=express['Router']();var auth=require(_0x58d9('0x5'));var interaction=require(_0x58d9('0x6'));var config=require('../../config/environment');var controller=require(_0x58d9('0x7'));router['get']('/',auth[_0x58d9('0x8')](),controller[_0x58d9('0x9')]);router[_0x58d9('0xa')](_0x58d9('0xb'),auth[_0x58d9('0x8')](),controller[_0x58d9('0xc')]);router[_0x58d9('0xa')](_0x58d9('0xd'),auth[_0x58d9('0x8')](),controller[_0x58d9('0xe')]);router['get'](_0x58d9('0xf'),auth[_0x58d9('0x8')](),controller[_0x58d9('0x10')]);router[_0x58d9('0xa')](_0x58d9('0x11'),auth['isAuthenticated'](),controller[_0x58d9('0x12')]);router['post']('/',auth[_0x58d9('0x8')](),controller[_0x58d9('0x13')]);router[_0x58d9('0x14')](_0x58d9('0xf'),auth['isAuthenticated'](),controller[_0x58d9('0x15')]);router['post'](_0x58d9('0x16'),auth['isAuthenticated'](),interaction[_0x58d9('0x17')](_0x58d9('0x18'),'faxinteraction:addtags'),controller[_0x58d9('0x19')]);router['put'](_0x58d9('0xd'),auth[_0x58d9('0x8')](),interaction[_0x58d9('0x17')](_0x58d9('0x18'),_0x58d9('0x1a')),controller[_0x58d9('0x1b')]);router['delete']('/:id',auth[_0x58d9('0x8')](),interaction['tracked'](_0x58d9('0x18'),'faxinteraction:destroy'),controller['destroy']);router[_0x58d9('0x1c')](_0x58d9('0x16'),auth['isAuthenticated'](),controller[_0x58d9('0x1d')]);module[_0x58d9('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 8c87e8c..6db7d4d 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 _0xb471=['ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x5e3660,_0x105d23){var _0xd705e1=function(_0x584cfd){while(--_0x584cfd){_0x5e3660['push'](_0x5e3660['shift']());}};_0xd705e1(++_0x105d23);}(_0xb471,0x1ad));var _0x1b47=function(_0x2f639d,_0x209525){_0x2f639d=_0x2f639d-0x0;var _0x537253=_0xb471[_0x2f639d];return _0x537253;};'use strict';var Sequelize=require(_0x1b47('0x0'));module[_0x1b47('0x1')]={'body':{'type':Sequelize[_0x1b47('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x1b47('0x3')]('in','out'),'defaultValue':_0x1b47('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x1b47('0x5')]}}; \ No newline at end of file +var _0x6959=['TEXT','medium','ENUM','out','exports'];(function(_0x3e2d36,_0x360e3f){var _0x49e808=function(_0x455f12){while(--_0x455f12){_0x3e2d36['push'](_0x3e2d36['shift']());}};_0x49e808(++_0x360e3f);}(_0x6959,0x9a));var _0x9695=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6959[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x9695('0x0')]={'body':{'type':Sequelize[_0x9695('0x1')](_0x9695('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9695('0x3')]('in',_0x9695('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x9695('0x1')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index fc7d4f6..803969c 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 _0x6a28=['rawAttributes','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','map','key','merge','options','includeAll','include','findAll','rows','catch','show','params','find','body','describe','../../config/logger','fax-interactions','accept','fax','read','readAt','format','UserId','user','Contact','get','FaxInteraction','isNil','interaction','role','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','EventManager','acceptmessage','agent','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','rejectmessage','create','CmContact','ContactId','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','root','server','attachments','download','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','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~!@#$%^&-_=+[{]}.','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus','status','end','json','count','offset','apply','reject','save','update','destroy','name','send','index','FaxMessage'];(function(_0x114c34,_0x52b483){var _0x53e5f5=function(_0x18c714){while(--_0x18c714){_0x114c34['push'](_0x114c34['shift']());}};_0x53e5f5(++_0x52b483);}(_0x6a28,0x1da));var _0x86a2=function(_0x44538e,_0x1ed749){_0x44538e=_0x44538e-0x0;var _0x5d5a7d=_0x6a28[_0x44538e];return _0x5d5a7d;};'use strict';var pdf=require(_0x86a2('0x0'));var emlformat=require(_0x86a2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x86a2('0x2'));var jsonpatch=require(_0x86a2('0x3'));var rp=require(_0x86a2('0x4'));var moment=require(_0x86a2('0x5'));var BPromise=require(_0x86a2('0x6'));var Mustache=require(_0x86a2('0x7'));var util=require(_0x86a2('0x8'));var path=require(_0x86a2('0x9'));var sox=require(_0x86a2('0xa'));var csv=require(_0x86a2('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x86a2('0xc'));var crypto=require(_0x86a2('0xd'));var jsforce=require(_0x86a2('0xe'));var deskjs=require(_0x86a2('0xf'));var toCsv=require(_0x86a2('0xb'));var querystring=require(_0x86a2('0x10'));var Papa=require(_0x86a2('0x11'));var Redis=require(_0x86a2('0x12'));var authService=require(_0x86a2('0x13'));var qs=require(_0x86a2('0x14'));var hardwareService=require(_0x86a2('0x15'));var logger=require('../../config/logger')(_0x86a2('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x86a2('0x17')]=_[_0x86a2('0x18')](config[_0x86a2('0x17')],{'host':_0x86a2('0x19'),'port':0x18eb});var socket=require(_0x86a2('0x1a'))(new Redis(config[_0x86a2('0x17')]));require('./faxMessage.socket')[_0x86a2('0x1b')](socket);var jayson=require(_0x86a2('0x1c'));var client=jayson[_0x86a2('0x1d')][_0x86a2('0x1e')]({'port':0x232c});var client9002=jayson[_0x86a2('0x1d')][_0x86a2('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x5bd104,_0x38f0dd,_0x54656e){if(_0x54656e){var _0x440de3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x440de3[_0x86a2('0x1f')](_0x38f0dd)){return _0x5bd104;}else{throw new Error(_0x86a2('0x20'));}}else{return _0x5bd104;}}function respondWithRpcPromise(_0x2ed686,_0x4eb9d4,_0x3b0e24,_0x2632c3){return new BPromise(function(_0x441a63,_0x219ff1){var _0x1eb84e=_0x2632c3||client;return _0x1eb84e[_0x86a2('0x21')](_0x2ed686,_0x3b0e24)[_0x86a2('0x22')](function(_0x172f12){logger[_0x86a2('0x23')](_0x86a2('0x24'),_0x4eb9d4,'request\x20sent');logger[_0x86a2('0x25')](_0x86a2('0x26'),_0x4eb9d4,_0x86a2('0x27'),JSON[_0x86a2('0x28')](_0x172f12));if(_0x172f12[_0x86a2('0x29')]){if(_0x172f12[_0x86a2('0x29')]['code']===0x1f4){logger[_0x86a2('0x29')](_0x86a2('0x24'),_0x4eb9d4,_0x172f12[_0x86a2('0x29')][_0x86a2('0x2a')]);return _0x219ff1(_0x172f12[_0x86a2('0x29')][_0x86a2('0x2a')]);}logger[_0x86a2('0x29')](_0x86a2('0x24'),_0x4eb9d4,_0x172f12['error']['message']);return _0x441a63(_0x172f12[_0x86a2('0x29')][_0x86a2('0x2a')]);}else{logger[_0x86a2('0x23')]('FaxMessage,\x20%s,\x20%s',_0x4eb9d4,_0x86a2('0x27'));_0x441a63(_0x172f12['result'][_0x86a2('0x2a')]);}})['catch'](function(_0x19d292){logger[_0x86a2('0x29')](_0x86a2('0x24'),_0x4eb9d4,_0x19d292);_0x219ff1(_0x19d292);});});}function respondWithStatusCode(_0x3ed149,_0x329d8e){_0x329d8e=_0x329d8e||0xcc;return function(_0x4f25d1){if(_0x4f25d1){return _0x3ed149[_0x86a2('0x2b')](_0x329d8e);}return _0x3ed149[_0x86a2('0x2c')](_0x329d8e)[_0x86a2('0x2d')]();};}function respondWithResult(_0x36d194,_0x2835c7){_0x2835c7=_0x2835c7||0xc8;return function(_0x21a7ae){if(_0x21a7ae){return _0x36d194[_0x86a2('0x2c')](_0x2835c7)[_0x86a2('0x2e')](_0x21a7ae);}};}function respondWithFilteredResult(_0x5b57ec,_0x4e9e64){return function(_0x129868){if(_0x129868){var _0x593d74=_0x129868[_0x86a2('0x2f')],_0x220bc5=_0x4e9e64[_0x86a2('0x30')],_0x195967=_0x4e9e64[_0x86a2('0x30')]+_0x4e9e64['limit'],_0xf31cc2;if(_0x195967>=_0x593d74){_0x195967=_0x593d74;_0xf31cc2=0xc8;}else{_0xf31cc2=0xce;}_0x5b57ec['status'](_0xf31cc2);return _0x5b57ec['set']('Content-Range',_0x220bc5+'-'+_0x195967+'/'+_0x593d74)[_0x86a2('0x2e')](_0x129868);}return null;};}function patchUpdates(_0x147af2){return function(_0x1832d2){try{jsonpatch[_0x86a2('0x31')](_0x1832d2,_0x147af2,!![]);}catch(_0x4b2282){return BPromise[_0x86a2('0x32')](_0x4b2282);}return _0x1832d2[_0x86a2('0x33')]();};}function saveUpdates(_0x1f05d6,_0x429f80){return function(_0x2ecd30){if(_0x2ecd30){return _0x2ecd30[_0x86a2('0x34')](_0x1f05d6)['then'](function(_0xd60cb){return _0xd60cb;});}return null;};}function removeEntity(_0x415b1d,_0x1fe71b){return function(_0x11aaea){if(_0x11aaea){return _0x11aaea[_0x86a2('0x35')]()[_0x86a2('0x22')](function(){_0x415b1d[_0x86a2('0x2c')](0xcc)[_0x86a2('0x2d')]();});}};}function handleEntityNotFound(_0x2541cb,_0x2e13f7){return function(_0x2a3db6){if(!_0x2a3db6){_0x2541cb[_0x86a2('0x2b')](0x194);}return _0x2a3db6;};}function handleError(_0x114a32,_0x211b86){_0x211b86=_0x211b86||0x1f4;return function(_0x94689d){logger[_0x86a2('0x29')](_0x94689d['stack']);if(_0x94689d[_0x86a2('0x36')]){delete _0x94689d[_0x86a2('0x36')];}_0x114a32['status'](_0x211b86)[_0x86a2('0x37')](_0x94689d);};}exports[_0x86a2('0x38')]=function(_0x342ddf,_0x224e84){var _0x3e8bf6={},_0x3b43ce={},_0x2bcebc={'count':0x0,'rows':[]};var _0x5175f6=db[_0x86a2('0x39')][_0x86a2('0x3a')];_0x3b43ce['model']=_[_0x86a2('0x3b')](_0x5175f6);_0x3b43ce[_0x86a2('0x3c')]=_['keys'](_0x342ddf['query']);_0x3b43ce['filters']=_[_0x86a2('0x3d')](_0x3b43ce[_0x86a2('0x3e')],_0x3b43ce[_0x86a2('0x3c')]);_0x3e8bf6[_0x86a2('0x3f')]=_['intersection'](_0x3b43ce[_0x86a2('0x3e')],qs[_0x86a2('0x40')](_0x342ddf[_0x86a2('0x3c')][_0x86a2('0x40')]));_0x3e8bf6[_0x86a2('0x3f')]=_0x3e8bf6[_0x86a2('0x3f')][_0x86a2('0x41')]?_0x3e8bf6[_0x86a2('0x3f')]:_0x3b43ce[_0x86a2('0x3e')];if(!_0x342ddf[_0x86a2('0x3c')][_0x86a2('0x42')](_0x86a2('0x43'))){_0x3e8bf6['limit']=qs[_0x86a2('0x44')](_0x342ddf[_0x86a2('0x3c')][_0x86a2('0x44')]);_0x3e8bf6[_0x86a2('0x30')]=qs[_0x86a2('0x30')](_0x342ddf[_0x86a2('0x3c')][_0x86a2('0x30')]);}_0x3e8bf6['order']=qs[_0x86a2('0x45')](_0x342ddf[_0x86a2('0x3c')][_0x86a2('0x45')]);_0x3e8bf6[_0x86a2('0x46')]=qs[_0x86a2('0x47')](_[_0x86a2('0x48')](_0x342ddf[_0x86a2('0x3c')],_0x3b43ce[_0x86a2('0x47')]));if(_0x342ddf[_0x86a2('0x3c')][_0x86a2('0x49')]){_0x3e8bf6[_0x86a2('0x46')]=_['merge'](_0x3e8bf6['where'],{'$or':_[_0x86a2('0x4a')](_0x5175f6,function(_0x43e30d){if(_0x43e30d['type'][_0x86a2('0x4b')]!=='VIRTUAL'){var _0x23f998={};_0x23f998[_0x43e30d['field']]={'$like':'%'+_0x342ddf[_0x86a2('0x3c')][_0x86a2('0x49')]+'%'};return _0x23f998;}})});}_0x3e8bf6=_[_0x86a2('0x4c')]({},_0x3e8bf6,_0x342ddf[_0x86a2('0x4d')]);var _0x21c45d={'where':_0x3e8bf6['where']};return db[_0x86a2('0x39')][_0x86a2('0x2f')](_0x21c45d)[_0x86a2('0x22')](function(_0x1b200c){_0x2bcebc['count']=_0x1b200c;if(_0x342ddf['query'][_0x86a2('0x4e')]){_0x3e8bf6[_0x86a2('0x4f')]=[{'all':!![]}];}return db[_0x86a2('0x39')][_0x86a2('0x50')](_0x3e8bf6);})['then'](function(_0x3fee3d){_0x2bcebc[_0x86a2('0x51')]=_0x3fee3d;return _0x2bcebc;})[_0x86a2('0x22')](respondWithFilteredResult(_0x224e84,_0x3e8bf6))[_0x86a2('0x52')](handleError(_0x224e84,null));};exports[_0x86a2('0x53')]=function(_0x1b83ac,_0x2e1035){var _0x2d9af4={'raw':!![],'where':{'id':_0x1b83ac[_0x86a2('0x54')]['id']}},_0x2d3a82={};_0x2d3a82[_0x86a2('0x3e')]=_[_0x86a2('0x3b')](db[_0x86a2('0x39')]['rawAttributes']);_0x2d3a82['query']=_[_0x86a2('0x3b')](_0x1b83ac[_0x86a2('0x3c')]);_0x2d3a82['filters']=_['intersection'](_0x2d3a82[_0x86a2('0x3e')],_0x2d3a82[_0x86a2('0x3c')]);_0x2d9af4[_0x86a2('0x3f')]=_[_0x86a2('0x3d')](_0x2d3a82[_0x86a2('0x3e')],qs[_0x86a2('0x40')](_0x1b83ac['query'][_0x86a2('0x40')]));_0x2d9af4[_0x86a2('0x3f')]=_0x2d9af4[_0x86a2('0x3f')][_0x86a2('0x41')]?_0x2d9af4['attributes']:_0x2d3a82[_0x86a2('0x3e')];if(_0x1b83ac[_0x86a2('0x3c')]['includeAll']){_0x2d9af4[_0x86a2('0x4f')]=[{'all':!![]}];}_0x2d9af4=_[_0x86a2('0x4c')]({},_0x2d9af4,_0x1b83ac[_0x86a2('0x4d')]);return db['FaxMessage'][_0x86a2('0x55')](_0x2d9af4)[_0x86a2('0x22')](handleEntityNotFound(_0x2e1035,null))[_0x86a2('0x22')](respondWithResult(_0x2e1035,null))['catch'](handleError(_0x2e1035,null));};exports[_0x86a2('0x34')]=function(_0x4303a4,_0x52d2cc){if(_0x4303a4[_0x86a2('0x56')]['id']){delete _0x4303a4[_0x86a2('0x56')]['id'];}return db[_0x86a2('0x39')][_0x86a2('0x55')]({'where':{'id':_0x4303a4['params']['id']}})[_0x86a2('0x22')](handleEntityNotFound(_0x52d2cc,null))[_0x86a2('0x22')](saveUpdates(_0x4303a4['body'],null))[_0x86a2('0x22')](respondWithResult(_0x52d2cc,null))[_0x86a2('0x52')](handleError(_0x52d2cc,null));};exports[_0x86a2('0x35')]=function(_0x39b299,_0x56f35d){return db[_0x86a2('0x39')][_0x86a2('0x55')]({'where':{'id':_0x39b299[_0x86a2('0x54')]['id']}})['then'](handleEntityNotFound(_0x56f35d,null))[_0x86a2('0x22')](removeEntity(_0x56f35d,null))['catch'](handleError(_0x56f35d,null));};exports[_0x86a2('0x57')]=function(_0xe1a96a,_0x22a896){return db['FaxMessage'][_0x86a2('0x57')]()[_0x86a2('0x22')](respondWithResult(_0x22a896,null))[_0x86a2('0x52')](handleError(_0x22a896,null));};var interaction_log=require(_0x86a2('0x58'))(_0x86a2('0x59'));exports[_0x86a2('0x5a')]=function(_0x30af39,_0x397150,_0x2481f1){var _0x7f3d39={'channel':_0x86a2('0x5b')};if(_0x30af39[_0x86a2('0x56')]['id']){delete _0x30af39[_0x86a2('0x56')]['id'];}_0x30af39[_0x86a2('0x56')][_0x86a2('0x5c')]=!![];_0x30af39[_0x86a2('0x56')][_0x86a2('0x5d')]=moment()[_0x86a2('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x30af39[_0x86a2('0x56')][_0x86a2('0x5f')]=_0x30af39[_0x86a2('0x56')][_0x86a2('0x5f')]||_0x30af39[_0x86a2('0x60')]['id'];return db[_0x86a2('0x39')][_0x86a2('0x55')]({'where':{'id':_0x30af39[_0x86a2('0x54')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x86a2('0x61')}]})['then'](handleEntityNotFound(_0x397150,null))['then'](saveUpdates(_0x30af39[_0x86a2('0x56')],null))[_0x86a2('0x22')](function(_0x4acba8){if(_0x4acba8){_0x7f3d39[_0x86a2('0x2a')]=_0x4acba8[_0x86a2('0x62')]({'plain':!![]});return db[_0x86a2('0x63')][_0x86a2('0x55')]({'where':{'id':_0x4acba8['FaxInteractionId']}});}return null;})[_0x86a2('0x22')](handleEntityNotFound(_0x397150,null))['then'](function(_0x378e7a){if(_0x378e7a){return _0x378e7a[_0x86a2('0x34')]({'UserId':_0x30af39[_0x86a2('0x56')][_0x86a2('0x5f')],'read1stAt':_[_0x86a2('0x64')](_0x378e7a['read1stAt'])?moment()[_0x86a2('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x86a2('0x22')](function(_0x416088){if(_0x416088){_0x7f3d39[_0x86a2('0x65')]=_0x416088[_0x86a2('0x62')]({'plain':!![]});interaction_log[_0x86a2('0x23')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x30af39[_0x86a2('0x60')]['id'],_0x30af39[_0x86a2('0x60')][_0x86a2('0x36')],_0x30af39[_0x86a2('0x60')][_0x86a2('0x66')],_0x7f3d39['interaction']['id'],_0x30af39[_0x86a2('0x56')]?JSON['stringify'](_0x30af39[_0x86a2('0x56')]):_0x86a2('0x67'));return respondWithRpcPromise(_0x86a2('0x68'),_0x86a2('0x69'),_0x7f3d39);}return null;})[_0x86a2('0x22')](function(_0x45d0b8){if(_0x45d0b8){if(_0x30af39[_0x86a2('0x56')]['manual']){_0x7f3d39[_0x86a2('0x2a')][_0x86a2('0x6a')]=util['format'](_0x86a2('0x6b'),_0x30af39[_0x86a2('0x60')]['name']);_0x7f3d39[_0x86a2('0x2a')][_0x86a2('0x6c')]=_0x7f3d39[_0x86a2('0x6c')];_0x7f3d39[_0x86a2('0x2a')]['event']=_0x86a2('0x5a');return respondWithRpcPromise('EventManager',_0x86a2('0x6d'),{'event':_0x86a2('0x6e'),'message':_0x7f3d39[_0x86a2('0x2a')]},client9002)[_0x86a2('0x22')](function(){return _0x7f3d39;});}return _0x7f3d39;}return null;})['then'](respondWithResult(_0x397150,null))['catch'](handleError(_0x397150,null));};var interaction_log=require(_0x86a2('0x58'))(_0x86a2('0x59'));exports['reject']=function(_0x4f6947,_0xb35b99,_0x30ed43){var _0x406446={'agent':{},'channel':'fax'};if(_0x4f6947[_0x86a2('0x56')]['id']){delete _0x4f6947[_0x86a2('0x56')]['id'];}_0x4f6947[_0x86a2('0x56')][_0x86a2('0x5f')]=_0x4f6947['body'][_0x86a2('0x5f')]||_0x4f6947['user']['id'];_0x406446[_0x86a2('0x6f')]['id']=_0x4f6947[_0x86a2('0x56')][_0x86a2('0x5f')];return db[_0x86a2('0x39')][_0x86a2('0x55')]({'where':{'id':_0x4f6947[_0x86a2('0x54')]['id'],'UserId':null}})[_0x86a2('0x22')](handleEntityNotFound(_0xb35b99,null))[_0x86a2('0x22')](function(_0x21922a){if(_0x21922a){_0x406446[_0x86a2('0x2a')]=_0x21922a[_0x86a2('0x62')]({'plain':!![]});return db[_0x86a2('0x63')][_0x86a2('0x55')]({'where':{'id':_0x21922a[_0x86a2('0x70')]}});}return null;})[_0x86a2('0x22')](handleEntityNotFound(_0xb35b99,null))[_0x86a2('0x22')](function(_0x5e0b13){if(_0x5e0b13){_0x406446[_0x86a2('0x65')]=_0x5e0b13[_0x86a2('0x62')]({'plain':!![]});interaction_log[_0x86a2('0x23')](_0x86a2('0x71'),_0x4f6947[_0x86a2('0x60')]['id'],_0x4f6947[_0x86a2('0x60')]['name'],_0x4f6947[_0x86a2('0x60')]['role'],_0x406446[_0x86a2('0x65')]['id'],_0x4f6947[_0x86a2('0x56')]?JSON[_0x86a2('0x28')](_0x4f6947['body']):_0x86a2('0x67'));return respondWithRpcPromise(_0x86a2('0x72'),_0x86a2('0x73'),_0x406446);}return null;})[_0x86a2('0x22')](function(_0xe95f08){if(_0xe95f08){_0xe95f08[_0x86a2('0x2a')][_0x86a2('0x6a')]=util[_0x86a2('0x5e')](_0x86a2('0x6b'),_0x4f6947[_0x86a2('0x60')][_0x86a2('0x36')]);_0xe95f08[_0x86a2('0x2a')][_0x86a2('0x6c')]=_0x406446['channel'];_0xe95f08[_0x86a2('0x2a')][_0x86a2('0x74')]=_0x86a2('0x32');respondWithRpcPromise(_0x86a2('0x6d'),'EventManager',{'event':_0x86a2('0x75'),'message':_0xe95f08['message']},client9002);return _0x406446;}return null;})[_0x86a2('0x22')](respondWithResult(_0xb35b99,null))['catch'](handleError(_0xb35b99,null));};exports[_0x86a2('0x76')]=function(_0x56b236,_0x50426b){var _0x45598e;return db['FaxMessage'][_0x86a2('0x76')](_0x56b236[_0x86a2('0x56')],{})[_0x86a2('0x22')](function(_0x52feb5){_0x45598e=_0x52feb5;return db[_0x86a2('0x77')]['findOne']({'where':{'id':_0x45598e[_0x86a2('0x78')]}});})['then'](function(_0x333a9){if(_['isNil'](_0x333a9)){return;}else{_0x45598e[_0x86a2('0x5b')]=_0x333a9['fax'];return db[_0x86a2('0x79')][_0x86a2('0x7a')]({'where':{'id':_0x45598e[_0x86a2('0x7b')]}});}})[_0x86a2('0x22')](function(_0x55b6eb){return respondWithRpcPromise(_0x86a2('0x7c'),_0x86a2('0x7c'),{'FaxAccountId':_[_0x86a2('0x64')](_0x56b236[_0x86a2('0x56')])?undefined:_0x56b236[_0x86a2('0x56')][_0x86a2('0x7d')],'path':_[_0x86a2('0x64')](_0x55b6eb)?undefined:util[_0x86a2('0x5e')](_0x86a2('0x7e'),_0x55b6eb[_0x86a2('0x7f')]),'fax':_[_0x86a2('0x64')](_0x45598e['fax'])?undefined:_0x45598e[_0x86a2('0x5b')],'AttachmentId':_0x45598e['AttachmentId']},client9002);})[_0x86a2('0x22')](respondWithResult(_0x50426b,0xc9))[_0x86a2('0x52')](handleError(_0x50426b,null));};exports['download']=function(_0x154ca8,_0x2f83a3){var _0x30b862=path[_0x86a2('0x80')](config[_0x86a2('0x81')],_0x86a2('0x82'),'files',_0x86a2('0x83'));return db[_0x86a2('0x39')][_0x86a2('0x55')]({'where':{'id':_0x154ca8['params']['id']},'include':[{'model':db[_0x86a2('0x79')],'as':_0x86a2('0x79')}]})[_0x86a2('0x22')](handleEntityNotFound(_0x2f83a3,null))[_0x86a2('0x22')](function(_0x21ff32){if(_0x21ff32){return _0x2f83a3[_0x86a2('0x84')](path[_0x86a2('0x80')](_0x30b862,_0x21ff32[_0x86a2('0x79')][_0x86a2('0x7f')]));}})[_0x86a2('0x52')](handleError(_0x2f83a3,null));}; \ No newline at end of file +var _0x4f59=['basename','join','root','server','files','attachments','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','./faxMessage.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~!@#$%^&-_=+[{]}.','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','offset','set','Content-Range','reject','destroy','sendStatus','name','send','FaxMessage','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','map','type','key','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','show','params','body','find','describe','fax-interactions','fax','read','readAt','format','UserId','CmContact','Contact','get','FaxInteraction','update','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','user','role','interaction','stringify','null','acceptMessage','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','create','Attachment','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x4f59,0x89));var _0x94f5=function(_0x199bc4,_0x338105){_0x199bc4=_0x199bc4-0x0;var _0x136ffb=_0x4f59[_0x199bc4];return _0x136ffb;};'use strict';var pdf=require(_0x94f5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x94f5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x94f5('0x2'));var rp=require(_0x94f5('0x3'));var moment=require(_0x94f5('0x4'));var BPromise=require(_0x94f5('0x5'));var Mustache=require(_0x94f5('0x6'));var util=require(_0x94f5('0x7'));var path=require(_0x94f5('0x8'));var sox=require(_0x94f5('0x9'));var csv=require('to-csv');var ejs=require(_0x94f5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x94f5('0xb'));var crypto=require(_0x94f5('0xc'));var jsforce=require(_0x94f5('0xd'));var deskjs=require(_0x94f5('0xe'));var toCsv=require(_0x94f5('0xf'));var querystring=require(_0x94f5('0x10'));var Papa=require('papaparse');var Redis=require(_0x94f5('0x11'));var authService=require(_0x94f5('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x94f5('0x13'));var logger=require(_0x94f5('0x14'))(_0x94f5('0x15'));var utils=require(_0x94f5('0x16'));var config=require(_0x94f5('0x17'));var db=require('../../mysqldb')['db'];config[_0x94f5('0x18')]=_[_0x94f5('0x19')](config[_0x94f5('0x18')],{'host':_0x94f5('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x94f5('0x18')]));require(_0x94f5('0x1b'))[_0x94f5('0x1c')](socket);var jayson=require(_0x94f5('0x1d'));var client=jayson[_0x94f5('0x1e')][_0x94f5('0x1f')]({'port':0x232c});var client9002=jayson[_0x94f5('0x1e')][_0x94f5('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x399565,_0x3a1ba9,_0x4aa57b){if(_0x4aa57b){var _0x170750=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x170750['test'](_0x3a1ba9)){return _0x399565;}else{throw new Error(_0x94f5('0x20'));}}else{return _0x399565;}}function respondWithRpcPromise(_0x4b99f2,_0x473ae9,_0xde5a51,_0x3c4542){return new BPromise(function(_0x479c26,_0xc07113){var _0x185b55=_0x3c4542||client;return _0x185b55['request'](_0x4b99f2,_0xde5a51)[_0x94f5('0x21')](function(_0x28d689){logger[_0x94f5('0x22')](_0x94f5('0x23'),_0x473ae9,_0x94f5('0x24'));logger['debug'](_0x94f5('0x25'),_0x473ae9,_0x94f5('0x24'),JSON['stringify'](_0x28d689));if(_0x28d689[_0x94f5('0x26')]){if(_0x28d689[_0x94f5('0x26')][_0x94f5('0x27')]===0x1f4){logger[_0x94f5('0x26')]('FaxMessage,\x20%s,\x20%s',_0x473ae9,_0x28d689[_0x94f5('0x26')][_0x94f5('0x28')]);return _0xc07113(_0x28d689[_0x94f5('0x26')]['message']);}logger[_0x94f5('0x26')](_0x94f5('0x23'),_0x473ae9,_0x28d689[_0x94f5('0x26')][_0x94f5('0x28')]);return _0x479c26(_0x28d689[_0x94f5('0x26')]['message']);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x473ae9,_0x94f5('0x24'));_0x479c26(_0x28d689[_0x94f5('0x29')][_0x94f5('0x28')]);}})[_0x94f5('0x2a')](function(_0x1fee02){logger[_0x94f5('0x26')](_0x94f5('0x23'),_0x473ae9,_0x1fee02);_0xc07113(_0x1fee02);});});}function respondWithStatusCode(_0x7a2c9d,_0x48a8ec){_0x48a8ec=_0x48a8ec||0xcc;return function(_0x5f0eb9){if(_0x5f0eb9){return _0x7a2c9d['sendStatus'](_0x48a8ec);}return _0x7a2c9d[_0x94f5('0x2b')](_0x48a8ec)[_0x94f5('0x2c')]();};}function respondWithResult(_0x492f80,_0x877af3){_0x877af3=_0x877af3||0xc8;return function(_0x5d1221){if(_0x5d1221){return _0x492f80[_0x94f5('0x2b')](_0x877af3)[_0x94f5('0x2d')](_0x5d1221);}};}function respondWithFilteredResult(_0x1762e2,_0x34de8b){return function(_0x4f1d10){if(_0x4f1d10){var _0x479665=_0x4f1d10['count'],_0x12aa11=_0x34de8b[_0x94f5('0x2e')],_0x257441=_0x34de8b[_0x94f5('0x2e')]+_0x34de8b['limit'],_0x35a900;if(_0x257441>=_0x479665){_0x257441=_0x479665;_0x35a900=0xc8;}else{_0x35a900=0xce;}_0x1762e2[_0x94f5('0x2b')](_0x35a900);return _0x1762e2[_0x94f5('0x2f')](_0x94f5('0x30'),_0x12aa11+'-'+_0x257441+'/'+_0x479665)[_0x94f5('0x2d')](_0x4f1d10);}return null;};}function patchUpdates(_0x62441d){return function(_0x13efec){try{jsonpatch['apply'](_0x13efec,_0x62441d,!![]);}catch(_0x7488e9){return BPromise[_0x94f5('0x31')](_0x7488e9);}return _0x13efec['save']();};}function saveUpdates(_0x52bf01,_0x919daa){return function(_0x5942d4){if(_0x5942d4){return _0x5942d4['update'](_0x52bf01)['then'](function(_0x4dddf0){return _0x4dddf0;});}return null;};}function removeEntity(_0x310f65,_0x17b4c2){return function(_0x546656){if(_0x546656){return _0x546656[_0x94f5('0x32')]()[_0x94f5('0x21')](function(){_0x310f65[_0x94f5('0x2b')](0xcc)[_0x94f5('0x2c')]();});}};}function handleEntityNotFound(_0xec4e72,_0x2eda81){return function(_0x3717fe){if(!_0x3717fe){_0xec4e72[_0x94f5('0x33')](0x194);}return _0x3717fe;};}function handleError(_0x26a4d4,_0x7645d8){_0x7645d8=_0x7645d8||0x1f4;return function(_0x270b9a){logger[_0x94f5('0x26')](_0x270b9a['stack']);if(_0x270b9a[_0x94f5('0x34')]){delete _0x270b9a['name'];}_0x26a4d4['status'](_0x7645d8)[_0x94f5('0x35')](_0x270b9a);};}exports['index']=function(_0x58786e,_0x5a9f41){var _0x3681cb={},_0x353a55={},_0x1b6f3b={'count':0x0,'rows':[]};var _0x2f7e92=db[_0x94f5('0x36')][_0x94f5('0x37')];_0x353a55['model']=_[_0x94f5('0x38')](_0x2f7e92);_0x353a55['query']=_[_0x94f5('0x38')](_0x58786e[_0x94f5('0x39')]);_0x353a55[_0x94f5('0x3a')]=_[_0x94f5('0x3b')](_0x353a55[_0x94f5('0x3c')],_0x353a55[_0x94f5('0x39')]);_0x3681cb['attributes']=_[_0x94f5('0x3b')](_0x353a55[_0x94f5('0x3c')],qs[_0x94f5('0x3d')](_0x58786e['query'][_0x94f5('0x3d')]));_0x3681cb[_0x94f5('0x3e')]=_0x3681cb[_0x94f5('0x3e')][_0x94f5('0x3f')]?_0x3681cb[_0x94f5('0x3e')]:_0x353a55['model'];if(!_0x58786e[_0x94f5('0x39')][_0x94f5('0x40')](_0x94f5('0x41'))){_0x3681cb[_0x94f5('0x42')]=qs['limit'](_0x58786e[_0x94f5('0x39')][_0x94f5('0x42')]);_0x3681cb[_0x94f5('0x2e')]=qs[_0x94f5('0x2e')](_0x58786e[_0x94f5('0x39')][_0x94f5('0x2e')]);}_0x3681cb[_0x94f5('0x43')]=qs[_0x94f5('0x44')](_0x58786e['query']['sort']);_0x3681cb[_0x94f5('0x45')]=qs[_0x94f5('0x3a')](_[_0x94f5('0x46')](_0x58786e['query'],_0x353a55[_0x94f5('0x3a')]));if(_0x58786e[_0x94f5('0x39')]['filter']){_0x3681cb[_0x94f5('0x45')]=_['merge'](_0x3681cb[_0x94f5('0x45')],{'$or':_[_0x94f5('0x47')](_0x2f7e92,function(_0x360d83){if(_0x360d83[_0x94f5('0x48')][_0x94f5('0x49')]!==_0x94f5('0x4a')){var _0xf76358={};_0xf76358[_0x360d83['field']]={'$like':'%'+_0x58786e[_0x94f5('0x39')][_0x94f5('0x4b')]+'%'};return _0xf76358;}})});}_0x3681cb=_[_0x94f5('0x4c')]({},_0x3681cb,_0x58786e[_0x94f5('0x4d')]);var _0xda2619={'where':_0x3681cb[_0x94f5('0x45')]};return db[_0x94f5('0x36')][_0x94f5('0x4e')](_0xda2619)[_0x94f5('0x21')](function(_0x21175b){_0x1b6f3b[_0x94f5('0x4e')]=_0x21175b;if(_0x58786e[_0x94f5('0x39')][_0x94f5('0x4f')]){_0x3681cb[_0x94f5('0x50')]=[{'all':!![]}];}return db[_0x94f5('0x36')][_0x94f5('0x51')](_0x3681cb);})['then'](function(_0x58ab17){_0x1b6f3b['rows']=_0x58ab17;return _0x1b6f3b;})[_0x94f5('0x21')](respondWithFilteredResult(_0x5a9f41,_0x3681cb))[_0x94f5('0x2a')](handleError(_0x5a9f41,null));};exports[_0x94f5('0x52')]=function(_0x5ec8d9,_0x3ae027){var _0x232361={'raw':!![],'where':{'id':_0x5ec8d9[_0x94f5('0x53')]['id']}},_0x3c8a18={};_0x3c8a18[_0x94f5('0x3c')]=_[_0x94f5('0x38')](db[_0x94f5('0x36')][_0x94f5('0x37')]);_0x3c8a18[_0x94f5('0x39')]=_[_0x94f5('0x38')](_0x5ec8d9[_0x94f5('0x39')]);_0x3c8a18[_0x94f5('0x3a')]=_[_0x94f5('0x3b')](_0x3c8a18['model'],_0x3c8a18['query']);_0x232361['attributes']=_['intersection'](_0x3c8a18['model'],qs[_0x94f5('0x3d')](_0x5ec8d9['query'][_0x94f5('0x3d')]));_0x232361[_0x94f5('0x3e')]=_0x232361[_0x94f5('0x3e')][_0x94f5('0x3f')]?_0x232361[_0x94f5('0x3e')]:_0x3c8a18['model'];if(_0x5ec8d9['query']['includeAll']){_0x232361[_0x94f5('0x50')]=[{'all':!![]}];}_0x232361=_['merge']({},_0x232361,_0x5ec8d9['options']);return db[_0x94f5('0x36')]['find'](_0x232361)[_0x94f5('0x21')](handleEntityNotFound(_0x3ae027,null))['then'](respondWithResult(_0x3ae027,null))[_0x94f5('0x2a')](handleError(_0x3ae027,null));};exports['update']=function(_0x67b6a2,_0x4bfb49){if(_0x67b6a2[_0x94f5('0x54')]['id']){delete _0x67b6a2[_0x94f5('0x54')]['id'];}return db[_0x94f5('0x36')][_0x94f5('0x55')]({'where':{'id':_0x67b6a2[_0x94f5('0x53')]['id']}})[_0x94f5('0x21')](handleEntityNotFound(_0x4bfb49,null))[_0x94f5('0x21')](saveUpdates(_0x67b6a2['body'],null))[_0x94f5('0x21')](respondWithResult(_0x4bfb49,null))['catch'](handleError(_0x4bfb49,null));};exports[_0x94f5('0x32')]=function(_0x4709dc,_0x470db1){return db[_0x94f5('0x36')][_0x94f5('0x55')]({'where':{'id':_0x4709dc['params']['id']}})[_0x94f5('0x21')](handleEntityNotFound(_0x470db1,null))[_0x94f5('0x21')](removeEntity(_0x470db1,null))[_0x94f5('0x2a')](handleError(_0x470db1,null));};exports[_0x94f5('0x56')]=function(_0x3e2580,_0x3cbafc){return db[_0x94f5('0x36')]['describe']()[_0x94f5('0x21')](respondWithResult(_0x3cbafc,null))[_0x94f5('0x2a')](handleError(_0x3cbafc,null));};var interaction_log=require('../../config/logger')(_0x94f5('0x57'));exports['accept']=function(_0xf0fe22,_0x40aaaa,_0x23cbc5){var _0xed6cab={'channel':_0x94f5('0x58')};if(_0xf0fe22[_0x94f5('0x54')]['id']){delete _0xf0fe22['body']['id'];}_0xf0fe22[_0x94f5('0x54')][_0x94f5('0x59')]=!![];_0xf0fe22[_0x94f5('0x54')][_0x94f5('0x5a')]=moment()[_0x94f5('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0xf0fe22[_0x94f5('0x54')]['UserId']=_0xf0fe22['body'][_0x94f5('0x5c')]||_0xf0fe22['user']['id'];return db['FaxMessage'][_0x94f5('0x55')]({'where':{'id':_0xf0fe22[_0x94f5('0x53')]['id'],'UserId':null},'include':[{'model':db[_0x94f5('0x5d')],'as':_0x94f5('0x5e')}]})[_0x94f5('0x21')](handleEntityNotFound(_0x40aaaa,null))[_0x94f5('0x21')](saveUpdates(_0xf0fe22['body'],null))[_0x94f5('0x21')](function(_0x4d994e){if(_0x4d994e){_0xed6cab[_0x94f5('0x28')]=_0x4d994e[_0x94f5('0x5f')]({'plain':!![]});return db[_0x94f5('0x60')][_0x94f5('0x55')]({'where':{'id':_0x4d994e['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x40aaaa,null))[_0x94f5('0x21')](function(_0x1b818f){if(_0x1b818f){return _0x1b818f[_0x94f5('0x61')]({'UserId':_0xf0fe22['body'][_0x94f5('0x5c')],'read1stAt':_[_0x94f5('0x62')](_0x1b818f[_0x94f5('0x63')])?moment()[_0x94f5('0x5b')](_0x94f5('0x64')):undefined});}return null;})[_0x94f5('0x21')](function(_0x2c8ced){if(_0x2c8ced){_0xed6cab['interaction']=_0x2c8ced['get']({'plain':!![]});interaction_log[_0x94f5('0x22')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xf0fe22['user']['id'],_0xf0fe22[_0x94f5('0x65')][_0x94f5('0x34')],_0xf0fe22[_0x94f5('0x65')][_0x94f5('0x66')],_0xed6cab[_0x94f5('0x67')]['id'],_0xf0fe22[_0x94f5('0x54')]?JSON[_0x94f5('0x68')](_0xf0fe22[_0x94f5('0x54')]):_0x94f5('0x69'));return respondWithRpcPromise('AcceptMessage',_0x94f5('0x6a'),_0xed6cab);}return null;})['then'](function(_0x4f9639){if(_0x4f9639){if(_0xf0fe22['body'][_0x94f5('0x6b')]){_0xed6cab[_0x94f5('0x28')][_0x94f5('0x6c')]=util[_0x94f5('0x5b')](_0x94f5('0x6d'),_0xf0fe22[_0x94f5('0x65')][_0x94f5('0x34')]);_0xed6cab[_0x94f5('0x28')][_0x94f5('0x6e')]=_0xed6cab[_0x94f5('0x6e')];_0xed6cab[_0x94f5('0x28')][_0x94f5('0x6f')]=_0x94f5('0x70');return respondWithRpcPromise(_0x94f5('0x71'),_0x94f5('0x71'),{'event':_0x94f5('0x72'),'message':_0xed6cab['message']},client9002)[_0x94f5('0x21')](function(){return _0xed6cab;});}return _0xed6cab;}return null;})[_0x94f5('0x21')](respondWithResult(_0x40aaaa,null))[_0x94f5('0x2a')](handleError(_0x40aaaa,null));};var interaction_log=require(_0x94f5('0x14'))(_0x94f5('0x57'));exports[_0x94f5('0x31')]=function(_0x139e8e,_0x3a8670,_0x2eaf53){var _0x79dcb6={'agent':{},'channel':'fax'};if(_0x139e8e[_0x94f5('0x54')]['id']){delete _0x139e8e[_0x94f5('0x54')]['id'];}_0x139e8e[_0x94f5('0x54')][_0x94f5('0x5c')]=_0x139e8e[_0x94f5('0x54')][_0x94f5('0x5c')]||_0x139e8e[_0x94f5('0x65')]['id'];_0x79dcb6['agent']['id']=_0x139e8e[_0x94f5('0x54')][_0x94f5('0x5c')];return db[_0x94f5('0x36')][_0x94f5('0x55')]({'where':{'id':_0x139e8e[_0x94f5('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3a8670,null))[_0x94f5('0x21')](function(_0x4af317){if(_0x4af317){_0x79dcb6[_0x94f5('0x28')]=_0x4af317[_0x94f5('0x5f')]({'plain':!![]});return db[_0x94f5('0x60')][_0x94f5('0x55')]({'where':{'id':_0x4af317['FaxInteractionId']}});}return null;})[_0x94f5('0x21')](handleEntityNotFound(_0x3a8670,null))[_0x94f5('0x21')](function(_0x318ba1){if(_0x318ba1){_0x79dcb6[_0x94f5('0x67')]=_0x318ba1[_0x94f5('0x5f')]({'plain':!![]});interaction_log[_0x94f5('0x22')](_0x94f5('0x73'),_0x139e8e[_0x94f5('0x65')]['id'],_0x139e8e[_0x94f5('0x65')][_0x94f5('0x34')],_0x139e8e[_0x94f5('0x65')][_0x94f5('0x66')],_0x79dcb6[_0x94f5('0x67')]['id'],_0x139e8e[_0x94f5('0x54')]?JSON[_0x94f5('0x68')](_0x139e8e[_0x94f5('0x54')]):_0x94f5('0x69'));return respondWithRpcPromise(_0x94f5('0x74'),_0x94f5('0x75'),_0x79dcb6);}return null;})[_0x94f5('0x21')](function(_0xe9f68b){if(_0xe9f68b){_0xe9f68b[_0x94f5('0x28')][_0x94f5('0x6c')]=util[_0x94f5('0x5b')]('SIP/%s',_0x139e8e['user'][_0x94f5('0x34')]);_0xe9f68b[_0x94f5('0x28')][_0x94f5('0x6e')]=_0x79dcb6[_0x94f5('0x6e')];_0xe9f68b[_0x94f5('0x28')][_0x94f5('0x6f')]=_0x94f5('0x31');respondWithRpcPromise(_0x94f5('0x71'),'EventManager',{'event':_0x94f5('0x76'),'message':_0xe9f68b[_0x94f5('0x28')]},client9002);return _0x79dcb6;}return null;})[_0x94f5('0x21')](respondWithResult(_0x3a8670,null))[_0x94f5('0x2a')](handleError(_0x3a8670,null));};exports[_0x94f5('0x77')]=function(_0x51d566,_0x5ec76a){var _0x288c36;return db['FaxMessage'][_0x94f5('0x77')](_0x51d566[_0x94f5('0x54')],{})[_0x94f5('0x21')](function(_0x13d9fc){_0x288c36=_0x13d9fc;return db[_0x94f5('0x5d')]['findOne']({'where':{'id':_0x288c36['ContactId']}});})['then'](function(_0x1ad553){if(_['isNil'](_0x1ad553)){return;}else{_0x288c36[_0x94f5('0x58')]=_0x1ad553[_0x94f5('0x58')];return db[_0x94f5('0x78')][_0x94f5('0x79')]({'where':{'id':_0x288c36[_0x94f5('0x7a')]}});}})[_0x94f5('0x21')](function(_0x27cb9c){return respondWithRpcPromise(_0x94f5('0x7b'),_0x94f5('0x7b'),{'FaxAccountId':_['isNil'](_0x51d566[_0x94f5('0x54')])?undefined:_0x51d566['body']['FaxAccountId'],'path':_[_0x94f5('0x62')](_0x27cb9c)?undefined:util[_0x94f5('0x5b')](_0x94f5('0x7c'),_0x27cb9c[_0x94f5('0x7d')]),'fax':_[_0x94f5('0x62')](_0x288c36['fax'])?undefined:_0x288c36[_0x94f5('0x58')],'AttachmentId':_0x288c36[_0x94f5('0x7a')]},client9002);})['then'](respondWithResult(_0x5ec76a,0xc9))[_0x94f5('0x2a')](handleError(_0x5ec76a,null));};exports['download']=function(_0x23dc15,_0x4e56f8){var _0x36fd18=path[_0x94f5('0x7e')](config[_0x94f5('0x7f')],_0x94f5('0x80'),_0x94f5('0x81'),_0x94f5('0x82'));return db['FaxMessage'][_0x94f5('0x55')]({'where':{'id':_0x23dc15[_0x94f5('0x53')]['id']},'include':[{'model':db[_0x94f5('0x78')],'as':'Attachment'}]})[_0x94f5('0x21')](handleEntityNotFound(_0x4e56f8,null))[_0x94f5('0x21')](function(_0x145a7d){if(_0x145a7d){return _0x4e56f8['download'](path[_0x94f5('0x7e')](_0x36fd18,_0x145a7d[_0x94f5('0x78')][_0x94f5('0x7d')]));}})['catch'](handleError(_0x4e56f8,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index f1103f5..2ab91d2 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 _0xb588=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','FaxMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb588,0x184));var _0x8b58=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xb588[_0x502c7d];return _0x30b7ed;};'use strict';var EventEmitter=require(_0x8b58('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x8b58('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x8b58('0x2')](0x0);var events={'afterCreate':_0x8b58('0x3'),'afterUpdate':_0x8b58('0x4'),'afterDestroy':_0x8b58('0x5')};function emitEvent(_0xf75149){return function(_0x1a9b5f,_0x5a8691,_0x56a4a0){FaxMessageEvents[_0x8b58('0x6')](_0xf75149+':'+_0x1a9b5f['id'],_0x1a9b5f);FaxMessageEvents[_0x8b58('0x6')](_0xf75149,_0x1a9b5f);_0x56a4a0(null);};}for(var e in events){if(events[_0x8b58('0x7')](e)){var event=events[e];FaxMessage[_0x8b58('0x8')](e,emitEvent(event));}}module[_0x8b58('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0xab82=['../../mysqldb','setMaxListeners','save','remove','emit','hook','exports','events'];(function(_0x54d492,_0x22dfb4){var _0x3eca93=function(_0x6afa5e){while(--_0x6afa5e){_0x54d492['push'](_0x54d492['shift']());}};_0x3eca93(++_0x22dfb4);}(_0xab82,0x7f));var _0x2ab8=function(_0x1d96ab,_0x2b5cd1){_0x1d96ab=_0x1d96ab-0x0;var _0x24b6f8=_0xab82[_0x1d96ab];return _0x24b6f8;};'use strict';var EventEmitter=require(_0x2ab8('0x0'));var FaxMessage=require(_0x2ab8('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x2ab8('0x2')](0x0);var events={'afterCreate':_0x2ab8('0x3'),'afterUpdate':'update','afterDestroy':_0x2ab8('0x4')};function emitEvent(_0x5abb6e){return function(_0x153c9d,_0x14cc42,_0xb4a862){FaxMessageEvents[_0x2ab8('0x5')](_0x5abb6e+':'+_0x153c9d['id'],_0x153c9d);FaxMessageEvents[_0x2ab8('0x5')](_0x5abb6e,_0x153c9d);_0xb4a862(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x2ab8('0x6')](e,emitEvent(event));}}module[_0x2ab8('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index b9449a2..08bef8a 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 _0x286b=['define','FaxMessage','fax_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','FaxInteraction','findOne','update','createdAt','error','utf8mb4','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./faxMessage.attributes'];(function(_0x49bfc7,_0x28cc4c){var _0x2bc1fe=function(_0x2b3615){while(--_0x2b3615){_0x49bfc7['push'](_0x49bfc7['shift']());}};_0x2bc1fe(++_0x28cc4c);}(_0x286b,0x8e));var _0xb286=function(_0xeca10d,_0x4e94c2){_0xeca10d=_0xeca10d-0x0;var _0x59d5cd=_0x286b[_0xeca10d];return _0x59d5cd;};'use strict';var _=require('lodash');var util=require(_0xb286('0x0'));var logger=require(_0xb286('0x1'))(_0xb286('0x2'));var moment=require('moment');var BPromise=require(_0xb286('0x3'));var rp=require(_0xb286('0x4'));var fs=require('fs');var path=require(_0xb286('0x5'));var rimraf=require('rimraf');var config=require(_0xb286('0x6'));var attributes=require(_0xb286('0x7'));module['exports']=function(_0x2782d4,_0x1899e9){return _0x2782d4[_0xb286('0x8')](_0xb286('0x9'),attributes,{'tableName':_0xb286('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':['body'],'type':_0xb286('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x482256,_0x2faac4,_0x91d6e3){var _0x2b7788=_0x2782d4[_0xb286('0xc')];var _0x873875=_0x482256[_0xb286('0xd')]({'plain':!![]});if(_0x873875[_0xb286('0xe')][_0xb286('0xf')]()==='in'||_0x873875[_0xb286('0xe')][_0xb286('0xf')]()===_0xb286('0x10')&&!_0x873875['secret']&&!_[_0xb286('0x11')](_0x873875[_0xb286('0x12')])){_0x2b7788[_0xb286('0x13')][_0xb286('0x14')]({'where':{'id':_0x873875['FaxInteractionId']}})['then'](function(_0x2de581){if(_0x2de581){_0x2de581[_0xb286('0x15')]({'lastMsgAt':_0x873875[_0xb286('0x16')],'lastMsgDirection':_0x873875[_0xb286('0xe')][_0xb286('0xf')]()});}})['catch'](function(_0x2dd1a8){console[_0xb286('0x17')](_0x2dd1a8);});}_0x91d6e3();}},'charset':_0xb286('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xaa5b=['FaxInteraction','then','update','createdAt','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId'];(function(_0x217c2e,_0x358f06){var _0x22b7d8=function(_0x111c48){while(--_0x111c48){_0x217c2e['push'](_0x217c2e['shift']());}};_0x22b7d8(++_0x358f06);}(_0xaa5b,0xe6));var _0xbaa5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa5b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xbaa5('0x0'));var util=require(_0xbaa5('0x1'));var logger=require(_0xbaa5('0x2'))(_0xbaa5('0x3'));var moment=require(_0xbaa5('0x4'));var BPromise=require(_0xbaa5('0x5'));var rp=require(_0xbaa5('0x6'));var fs=require('fs');var path=require(_0xbaa5('0x7'));var rimraf=require(_0xbaa5('0x8'));var config=require(_0xbaa5('0x9'));var attributes=require(_0xbaa5('0xa'));module[_0xbaa5('0xb')]=function(_0x7bf657,_0x2d2529){return _0x7bf657[_0xbaa5('0xc')](_0xbaa5('0xd'),attributes,{'tableName':_0xbaa5('0xe'),'paranoid':![],'indexes':[{'name':_0xbaa5('0xf'),'fields':[_0xbaa5('0x10')],'type':_0xbaa5('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2f9db3,_0x45d3cb,_0x3f7d85){var _0xbcd5b9=_0x7bf657[_0xbaa5('0x12')];var _0x22953b=_0x2f9db3[_0xbaa5('0x13')]({'plain':!![]});if(_0x22953b[_0xbaa5('0x14')][_0xbaa5('0x15')]()==='in'||_0x22953b[_0xbaa5('0x14')]['toLowerCase']()===_0xbaa5('0x16')&&!_0x22953b[_0xbaa5('0x17')]&&!_[_0xbaa5('0x18')](_0x22953b[_0xbaa5('0x19')])){_0xbcd5b9[_0xbaa5('0x1a')]['findOne']({'where':{'id':_0x22953b['FaxInteractionId']}})[_0xbaa5('0x1b')](function(_0xfaf1bc){if(_0xfaf1bc){_0xfaf1bc[_0xbaa5('0x1c')]({'lastMsgAt':_0x22953b[_0xbaa5('0x1d')],'lastMsgDirection':_0x22953b['direction'][_0xbaa5('0x15')]()});}})['catch'](function(_0x64a4e2){console[_0xbaa5('0x1e')](_0x64a4e2);});}_0x3f7d85();}},'charset':_0xbaa5('0x1f'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index eea50c8..d4e1cde 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 _0x16a6=['socket.io-emitter','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateFaxMessage','options','raw','catch','UpdateFaxMessage','FaxMessage','update','body','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults'];(function(_0x2da3b9,_0x34705d){var _0x42eb65=function(_0x1c4d12){while(--_0x1c4d12){_0x2da3b9['push'](_0x2da3b9['shift']());}};_0x42eb65(++_0x34705d);}(_0x16a6,0x15c));var _0x616a=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x16a6[_0x3740fe];return _0x55492b;};'use strict';var _=require(_0x616a('0x0'));var util=require(_0x616a('0x1'));var moment=require('moment');var BPromise=require(_0x616a('0x2'));var rs=require(_0x616a('0x3'));var fs=require('fs');var Redis=require(_0x616a('0x4'));var db=require(_0x616a('0x5'))['db'];var utils=require(_0x616a('0x6'));var logger=require(_0x616a('0x7'))('rpc');var config=require(_0x616a('0x8'));var jayson=require(_0x616a('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x616a('0xa')]=_[_0x616a('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x616a('0xc'))(new Redis(config['redis']));require(_0x616a('0xd'))['register'](socket);function respondWithRpcPromise(_0x3256a1,_0x235970,_0x2a4984){return new BPromise(function(_0x57d339,_0x1ab052){return client[_0x616a('0xe')](_0x3256a1,_0x2a4984)[_0x616a('0xf')](function(_0x47674e){logger[_0x616a('0x10')](_0x616a('0x11'),_0x235970,_0x616a('0x12'));logger[_0x616a('0x13')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x235970,_0x616a('0x12'),JSON[_0x616a('0x14')](_0x47674e));if(_0x47674e[_0x616a('0x15')]){if(_0x47674e[_0x616a('0x15')][_0x616a('0x16')]===0x1f4){logger['error'](_0x616a('0x11'),_0x235970,_0x47674e[_0x616a('0x15')][_0x616a('0x17')]);return _0x1ab052(_0x47674e[_0x616a('0x15')][_0x616a('0x17')]);}logger['error'](_0x616a('0x11'),_0x235970,_0x47674e[_0x616a('0x15')]['message']);return _0x57d339(_0x47674e['error'][_0x616a('0x17')]);}else{logger[_0x616a('0x10')](_0x616a('0x11'),_0x235970,'request\x20sent');_0x57d339(_0x47674e[_0x616a('0x18')][_0x616a('0x17')]);}})['catch'](function(_0x535d2b){logger[_0x616a('0x15')](_0x616a('0x11'),_0x235970,_0x535d2b);_0x1ab052(_0x535d2b);});});}exports[_0x616a('0x19')]=function(_0x31b711){var _0x505b9f=this;return new Promise(function(_0x499132,_0x5568fd){return db['FaxMessage']['create'](_0x31b711['body'],{'raw':_0x31b711[_0x616a('0x1a')]?_0x31b711['options'][_0x616a('0x1b')]===undefined?!![]:![]:!![]})[_0x616a('0xf')](function(_0x4f5594){logger[_0x616a('0x10')](_0x616a('0x19'),_0x31b711);logger[_0x616a('0x13')](_0x616a('0x19'),_0x31b711,JSON['stringify'](_0x4f5594));_0x499132(_0x4f5594);})[_0x616a('0x1c')](function(_0x71e642){logger[_0x616a('0x15')](_0x616a('0x19'),_0x71e642['message'],_0x31b711);_0x5568fd(_0x505b9f[_0x616a('0x15')](0x1f4,_0x71e642['message']));});});};exports[_0x616a('0x1d')]=function(_0x397a69){var _0x5f1e6a=this;return new Promise(function(_0x55abc8,_0x50c6b8){return db[_0x616a('0x1e')][_0x616a('0x1f')](_0x397a69[_0x616a('0x20')],{'raw':_0x397a69[_0x616a('0x1a')]?_0x397a69['options'][_0x616a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x397a69[_0x616a('0x1a')]?_0x397a69[_0x616a('0x1a')][_0x616a('0x21')]||null:null,'attributes':_0x397a69[_0x616a('0x1a')]?_0x397a69[_0x616a('0x1a')][_0x616a('0x22')]||null:null,'limit':_0x397a69['options']?_0x397a69[_0x616a('0x1a')][_0x616a('0x23')]||null:null})['then'](function(_0x41f722){logger['info']('UpdateFaxMessage',_0x397a69);logger[_0x616a('0x13')](_0x616a('0x1d'),_0x397a69,JSON[_0x616a('0x14')](_0x41f722));_0x55abc8(_0x41f722);})['catch'](function(_0x1fd6f2){logger[_0x616a('0x15')](_0x616a('0x1d'),_0x1fd6f2[_0x616a('0x17')],_0x397a69);_0x50c6b8(_0x5f1e6a[_0x616a('0x15')](0x1f4,_0x1fd6f2[_0x616a('0x17')]));});});}; \ No newline at end of file +var _0x5b20=['body','options','raw','stringify','update','where','limit','UpdateFaxMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','FaxMessage,\x20%s,\x20%s','result','catch','CreateFaxMessage','FaxMessage','create'];(function(_0x232b30,_0x9229c6){var _0x5ccc98=function(_0x222dde){while(--_0x222dde){_0x232b30['push'](_0x232b30['shift']());}};_0x5ccc98(++_0x9229c6);}(_0x5b20,0x86));var _0x05b2=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x5b20[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x05b2('0x0'));var util=require(_0x05b2('0x1'));var moment=require(_0x05b2('0x2'));var BPromise=require(_0x05b2('0x3'));var rs=require(_0x05b2('0x4'));var fs=require('fs');var Redis=require(_0x05b2('0x5'));var db=require(_0x05b2('0x6'))['db'];var utils=require(_0x05b2('0x7'));var logger=require(_0x05b2('0x8'))(_0x05b2('0x9'));var config=require(_0x05b2('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x05b2('0xb')][_0x05b2('0xc')]({'port':0x232a});config['redis']=_[_0x05b2('0xd')](config[_0x05b2('0xe')],{'host':_0x05b2('0xf'),'port':0x18eb});var socket=require(_0x05b2('0x10'))(new Redis(config[_0x05b2('0xe')]));require(_0x05b2('0x11'))[_0x05b2('0x12')](socket);function respondWithRpcPromise(_0x3029eb,_0x2645ff,_0x2b10a5){return new BPromise(function(_0x9a7fd7,_0x2f2e4a){return client[_0x05b2('0x13')](_0x3029eb,_0x2b10a5)[_0x05b2('0x14')](function(_0x155644){logger[_0x05b2('0x15')]('FaxMessage,\x20%s,\x20%s',_0x2645ff,_0x05b2('0x16'));logger[_0x05b2('0x17')](_0x05b2('0x18'),_0x2645ff,_0x05b2('0x16'),JSON['stringify'](_0x155644));if(_0x155644[_0x05b2('0x19')]){if(_0x155644[_0x05b2('0x19')][_0x05b2('0x1a')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x2645ff,_0x155644[_0x05b2('0x19')][_0x05b2('0x1b')]);return _0x2f2e4a(_0x155644['error']['message']);}logger[_0x05b2('0x19')](_0x05b2('0x1c'),_0x2645ff,_0x155644[_0x05b2('0x19')][_0x05b2('0x1b')]);return _0x9a7fd7(_0x155644[_0x05b2('0x19')][_0x05b2('0x1b')]);}else{logger[_0x05b2('0x15')](_0x05b2('0x1c'),_0x2645ff,_0x05b2('0x16'));_0x9a7fd7(_0x155644[_0x05b2('0x1d')][_0x05b2('0x1b')]);}})[_0x05b2('0x1e')](function(_0x18eed9){logger[_0x05b2('0x19')](_0x05b2('0x1c'),_0x2645ff,_0x18eed9);_0x2f2e4a(_0x18eed9);});});}exports[_0x05b2('0x1f')]=function(_0x5a21a7){var _0x3671aa=this;return new Promise(function(_0x489768,_0xd1a576){return db[_0x05b2('0x20')][_0x05b2('0x21')](_0x5a21a7[_0x05b2('0x22')],{'raw':_0x5a21a7[_0x05b2('0x23')]?_0x5a21a7['options'][_0x05b2('0x24')]===undefined?!![]:![]:!![]})['then'](function(_0x2874e8){logger[_0x05b2('0x15')]('CreateFaxMessage',_0x5a21a7);logger[_0x05b2('0x17')](_0x05b2('0x1f'),_0x5a21a7,JSON[_0x05b2('0x25')](_0x2874e8));_0x489768(_0x2874e8);})[_0x05b2('0x1e')](function(_0xca0d6){logger[_0x05b2('0x19')](_0x05b2('0x1f'),_0xca0d6[_0x05b2('0x1b')],_0x5a21a7);_0xd1a576(_0x3671aa['error'](0x1f4,_0xca0d6['message']));});});};exports['UpdateFaxMessage']=function(_0x171fc2){var _0x4f0b2b=this;return new Promise(function(_0x5d79a2,_0x35b6ba){return db[_0x05b2('0x20')][_0x05b2('0x26')](_0x171fc2[_0x05b2('0x22')],{'raw':_0x171fc2[_0x05b2('0x23')]?_0x171fc2[_0x05b2('0x23')][_0x05b2('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x171fc2['options']?_0x171fc2[_0x05b2('0x23')][_0x05b2('0x27')]||null:null,'attributes':_0x171fc2[_0x05b2('0x23')]?_0x171fc2[_0x05b2('0x23')]['attributes']||null:null,'limit':_0x171fc2[_0x05b2('0x23')]?_0x171fc2['options'][_0x05b2('0x28')]||null:null})[_0x05b2('0x14')](function(_0x3a4ea9){logger[_0x05b2('0x15')]('UpdateFaxMessage',_0x171fc2);logger[_0x05b2('0x17')]('UpdateFaxMessage',_0x171fc2,JSON[_0x05b2('0x25')](_0x3a4ea9));_0x5d79a2(_0x3a4ea9);})['catch'](function(_0x27f699){logger[_0x05b2('0x19')](_0x05b2('0x29'),_0x27f699['message'],_0x171fc2);_0x35b6ba(_0x4f0b2b['error'](0x1f4,_0x27f699[_0x05b2('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 7975370..63ca04d 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 _0x7ec7=['remove','emit','removeListener','length','faxMessage:','./faxMessage.events','save'];(function(_0x111f8a,_0x2ffb07){var _0x51a0a4=function(_0x4dc40c){while(--_0x4dc40c){_0x111f8a['push'](_0x111f8a['shift']());}};_0x51a0a4(++_0x2ffb07);}(_0x7ec7,0x19b));var _0x77ec=function(_0x24c436,_0x13f545){_0x24c436=_0x24c436-0x0;var _0x2c0567=_0x7ec7[_0x24c436];return _0x2c0567;};'use strict';var FaxMessageEvents=require(_0x77ec('0x0'));var events=[_0x77ec('0x1'),_0x77ec('0x2'),'update'];function createListener(_0x293060,_0x54d63c){return function(_0x241df1){_0x54d63c[_0x77ec('0x3')](_0x293060,_0x241df1);};}function removeListener(_0x5a928f,_0x4c4fca){return function(){FaxMessageEvents[_0x77ec('0x4')](_0x5a928f,_0x4c4fca);};}exports['register']=function(_0x5b14da){for(var _0x20433a=0x0,_0x5a26bd=events[_0x77ec('0x5')];_0x20433a<_0x5a26bd;_0x20433a++){var _0x1db8da=events[_0x20433a];var _0x4cf080=createListener(_0x77ec('0x6')+_0x1db8da,_0x5b14da);FaxMessageEvents['on'](_0x1db8da,_0x4cf080);}}; \ No newline at end of file +var _0x34f8=['./faxMessage.events','save','remove','update','emit','removeListener','register','faxMessage:'];(function(_0x11a962,_0x3cc338){var _0x55d423=function(_0xf4b236){while(--_0xf4b236){_0x11a962['push'](_0x11a962['shift']());}};_0x55d423(++_0x3cc338);}(_0x34f8,0x80));var _0x834f=function(_0x4157d8,_0x5ebd3){_0x4157d8=_0x4157d8-0x0;var _0x5a73ee=_0x34f8[_0x4157d8];return _0x5a73ee;};'use strict';var FaxMessageEvents=require(_0x834f('0x0'));var events=[_0x834f('0x1'),_0x834f('0x2'),_0x834f('0x3')];function createListener(_0x2cf91a,_0x495ca8){return function(_0x521ceb){_0x495ca8[_0x834f('0x4')](_0x2cf91a,_0x521ceb);};}function removeListener(_0x92264b,_0x4d23b1){return function(){FaxMessageEvents[_0x834f('0x5')](_0x92264b,_0x4d23b1);};}exports[_0x834f('0x6')]=function(_0x9e052f){for(var _0x3498dd=0x0,_0x5378c4=events['length'];_0x3498dd<_0x5378c4;_0x3498dd++){var _0xf778e4=events[_0x3498dd];var _0x2597c6=createListener(_0x834f('0x7')+_0xf778e4,_0x9e052f);FaxMessageEvents['on'](_0xf778e4,_0x2597c6);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 452952e..6620915 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 _0x82c4=['tracked','fax','faxmessage:create','put','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','post'];(function(_0x457090,_0x7e4451){var _0x9fa3af=function(_0x427311){while(--_0x427311){_0x457090['push'](_0x457090['shift']());}};_0x9fa3af(++_0x7e4451);}(_0x82c4,0x1ca));var _0x482c=function(_0x5ddee2,_0x4cd138){_0x5ddee2=_0x5ddee2-0x0;var _0x432a1e=_0x82c4[_0x5ddee2];return _0x432a1e;};'use strict';var multer=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var path=require(_0x482c('0x2'));var timeout=require(_0x482c('0x3'));var express=require(_0x482c('0x4'));var router=express[_0x482c('0x5')]();var auth=require(_0x482c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x482c('0x7'));var controller=require('./faxMessage.controller');router[_0x482c('0x8')]('/',auth['isAuthenticated'](),controller[_0x482c('0x9')]);router['get'](_0x482c('0xa'),auth[_0x482c('0xb')](),controller[_0x482c('0xc')]);router[_0x482c('0x8')](_0x482c('0xd'),auth['isAuthenticated'](),controller[_0x482c('0xe')]);router[_0x482c('0x8')](_0x482c('0xf'),auth[_0x482c('0xb')](),controller[_0x482c('0x10')]);router[_0x482c('0x11')]('/',auth['isAuthenticated'](),interaction[_0x482c('0x12')](_0x482c('0x13'),_0x482c('0x14')),controller['create']);router[_0x482c('0x15')](_0x482c('0xd'),auth[_0x482c('0xb')](),controller['update']);router['put'](_0x482c('0x16'),auth[_0x482c('0xb')](),controller['accept']);router['put'](_0x482c('0x17'),auth[_0x482c('0xb')](),controller[_0x482c('0x18')]);router[_0x482c('0x19')](_0x482c('0xd'),auth[_0x482c('0xb')](),controller[_0x482c('0x1a')]);module[_0x482c('0x1b')]=router; \ No newline at end of file +var _0x3a6d=['./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','tracked','fax','faxmessage:create','create','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x28f867,_0x17976f){var _0x12ef2b=function(_0x1d85df){while(--_0x1d85df){_0x28f867['push'](_0x28f867['shift']());}};_0x12ef2b(++_0x17976f);}(_0x3a6d,0x143));var _0xd3a6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3a6d[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var path=require('path');var timeout=require(_0xd3a6('0x2'));var express=require(_0xd3a6('0x3'));var router=express[_0xd3a6('0x4')]();var auth=require(_0xd3a6('0x5'));var interaction=require(_0xd3a6('0x6'));var config=require('../../config/environment');var controller=require(_0xd3a6('0x7'));router[_0xd3a6('0x8')]('/',auth[_0xd3a6('0x9')](),controller[_0xd3a6('0xa')]);router[_0xd3a6('0x8')](_0xd3a6('0xb'),auth['isAuthenticated'](),controller[_0xd3a6('0xc')]);router[_0xd3a6('0x8')](_0xd3a6('0xd'),auth[_0xd3a6('0x9')](),controller[_0xd3a6('0xe')]);router[_0xd3a6('0x8')](_0xd3a6('0xf'),auth[_0xd3a6('0x9')](),controller[_0xd3a6('0x10')]);router['post']('/',auth[_0xd3a6('0x9')](),interaction[_0xd3a6('0x11')](_0xd3a6('0x12'),_0xd3a6('0x13')),controller[_0xd3a6('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd3a6('0x15')]);router[_0xd3a6('0x16')](_0xd3a6('0x17'),auth[_0xd3a6('0x9')](),controller[_0xd3a6('0x18')]);router[_0xd3a6('0x16')](_0xd3a6('0x19'),auth['isAuthenticated'](),controller[_0xd3a6('0x1a')]);router[_0xd3a6('0x1b')](_0xd3a6('0xd'),auth['isAuthenticated'](),controller[_0xd3a6('0x1c')]);module[_0xd3a6('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 48489fa..6702bd7 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 _0xa907=['exports','name','STRING','INTEGER','ENUM','beepall','roundrobin'];(function(_0x4aeb10,_0x5e392a){var _0x32903a=function(_0x8af38b){while(--_0x8af38b){_0x4aeb10['push'](_0x4aeb10['shift']());}};_0x32903a(++_0x5e392a);}(_0xa907,0xa1));var _0x7a90=function(_0x54ecf5,_0xeba5f3){_0x54ecf5=_0x54ecf5-0x0;var _0x440d91=_0xa907[_0x54ecf5];return _0x440d91;};'use strict';var Sequelize=require('sequelize');module[_0x7a90('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x7a90('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7a90('0x2')]},'timeout':{'type':Sequelize[_0x7a90('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7a90('0x4')]('rrmemory',_0x7a90('0x5'),_0x7a90('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x7a90('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6f32=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','STRING'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x6f32,0x11e));var _0x26f3=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x6f32[_0x2dadb9];return _0x2f0097;};'use strict';var Sequelize=require('sequelize');module[_0x26f3('0x0')]={'name':{'type':Sequelize[_0x26f3('0x1')],'unique':_0x26f3('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x26f3('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x26f3('0x4')](_0x26f3('0x5'),_0x26f3('0x6'),_0x26f3('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x26f3('0x3')],'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 8415972..a04c8d0 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 _0xaea7=['fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','field','FaxQueue','includeAll','findAll','catch','params','length','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','pick','FaxQueueId','map','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','ids','select','from','team_has_fax_queues','join','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','isArray','userFaxQueue:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./faxQueue.socket','register','status','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','end','sendStatus','error','name','send','index','rawAttributes','model','keys','query','filters','attributes','intersection'];(function(_0x1a3e44,_0x5cc37a){var _0x3d912b=function(_0x1ef4af){while(--_0x1ef4af){_0x1a3e44['push'](_0x1a3e44['shift']());}};_0x3d912b(++_0x5cc37a);}(_0xaea7,0x1dd));var _0x7aea=function(_0x764f98,_0x3b9947){_0x764f98=_0x764f98-0x0;var _0x128461=_0xaea7[_0x764f98];return _0x128461;};'use strict';var pdf=require(_0x7aea('0x0'));var emlformat=require(_0x7aea('0x1'));var rimraf=require(_0x7aea('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7aea('0x3'));var rp=require(_0x7aea('0x4'));var moment=require('moment');var BPromise=require(_0x7aea('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7aea('0x6'));var sox=require('sox');var csv=require(_0x7aea('0x7'));var ejs=require(_0x7aea('0x8'));var fs=require('fs');var _=require(_0x7aea('0x9'));var squel=require('squel');var crypto=require(_0x7aea('0xa'));var jsforce=require(_0x7aea('0xb'));var deskjs=require(_0x7aea('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7aea('0xd'));var Redis=require('ioredis');var authService=require(_0x7aea('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7aea('0xf'));var logger=require(_0x7aea('0x10'))('api');var utils=require(_0x7aea('0x11'));var config=require(_0x7aea('0x12'));var db=require(_0x7aea('0x13'))['db'];config['redis']=_[_0x7aea('0x14')](config[_0x7aea('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x7aea('0x16'))(new Redis(config[_0x7aea('0x15')]));require(_0x7aea('0x17'))[_0x7aea('0x18')](socket);function respondWithStatusCode(_0x58433e,_0x3af16d){_0x3af16d=_0x3af16d||0xcc;return function(_0x1a8646){if(_0x1a8646){return _0x58433e['sendStatus'](_0x3af16d);}return _0x58433e[_0x7aea('0x19')](_0x3af16d)['end']();};}function respondWithResult(_0x29a36b,_0x173ec2){_0x173ec2=_0x173ec2||0xc8;return function(_0x24dcf0){if(_0x24dcf0){return _0x29a36b[_0x7aea('0x19')](_0x173ec2)['json'](_0x24dcf0);}};}function respondWithFilteredResult(_0xcb3713,_0x315a47){return function(_0x162854){if(_0x162854){var _0x23db99=_0x162854[_0x7aea('0x1a')],_0x358761=_0x315a47[_0x7aea('0x1b')],_0xc7356e=_0x315a47['offset']+_0x315a47[_0x7aea('0x1c')],_0x518a60;if(_0xc7356e>=_0x23db99){_0xc7356e=_0x23db99;_0x518a60=0xc8;}else{_0x518a60=0xce;}_0xcb3713[_0x7aea('0x19')](_0x518a60);return _0xcb3713[_0x7aea('0x1d')](_0x7aea('0x1e'),_0x358761+'-'+_0xc7356e+'/'+_0x23db99)['json'](_0x162854);}return null;};}function patchUpdates(_0x4179de){return function(_0x31c033){try{jsonpatch[_0x7aea('0x1f')](_0x31c033,_0x4179de,!![]);}catch(_0xd335b7){return BPromise[_0x7aea('0x20')](_0xd335b7);}return _0x31c033['save']();};}function saveUpdates(_0x2b12e4,_0x1cc856){return function(_0x367038){if(_0x367038){return _0x367038[_0x7aea('0x21')](_0x2b12e4)[_0x7aea('0x22')](function(_0x638342){return _0x638342;});}return null;};}function removeEntity(_0x4e1a0f,_0x127246){return function(_0x2e8c1f){if(_0x2e8c1f){return _0x2e8c1f[_0x7aea('0x23')]()[_0x7aea('0x22')](function(){var _0x3f3b35=_0x2e8c1f[_0x7aea('0x24')]({'plain':!![]});var _0x2d69f5='FaxQueues';return db[_0x7aea('0x25')][_0x7aea('0x23')]({'where':{'type':_0x2d69f5,'resourceId':_0x3f3b35['id']}})[_0x7aea('0x22')](function(){return _0x2e8c1f;});})['then'](function(){_0x4e1a0f[_0x7aea('0x19')](0xcc)[_0x7aea('0x26')]();});}};}function handleEntityNotFound(_0x409f35,_0x175e77){return function(_0x4fb004){if(!_0x4fb004){_0x409f35[_0x7aea('0x27')](0x194);}return _0x4fb004;};}function handleError(_0x3e9189,_0x1e28bf){_0x1e28bf=_0x1e28bf||0x1f4;return function(_0x97b423){logger[_0x7aea('0x28')](_0x97b423['stack']);if(_0x97b423['name']){delete _0x97b423[_0x7aea('0x29')];}_0x3e9189['status'](_0x1e28bf)[_0x7aea('0x2a')](_0x97b423);};}exports[_0x7aea('0x2b')]=function(_0x470b36,_0xcdcf07){var _0x1ccbfd={},_0x3cc9fd={},_0x5d0439={'count':0x0,'rows':[]};var _0x3c562c=db['FaxQueue'][_0x7aea('0x2c')];_0x3cc9fd[_0x7aea('0x2d')]=_[_0x7aea('0x2e')](_0x3c562c);_0x3cc9fd['query']=_['keys'](_0x470b36[_0x7aea('0x2f')]);_0x3cc9fd[_0x7aea('0x30')]=_['intersection'](_0x3cc9fd[_0x7aea('0x2d')],_0x3cc9fd['query']);_0x1ccbfd[_0x7aea('0x31')]=_[_0x7aea('0x32')](_0x3cc9fd[_0x7aea('0x2d')],qs[_0x7aea('0x33')](_0x470b36[_0x7aea('0x2f')][_0x7aea('0x33')]));_0x1ccbfd[_0x7aea('0x31')]=_0x1ccbfd[_0x7aea('0x31')]['length']?_0x1ccbfd[_0x7aea('0x31')]:_0x3cc9fd[_0x7aea('0x2d')];if(!_0x470b36['query'][_0x7aea('0x34')](_0x7aea('0x35'))){_0x1ccbfd[_0x7aea('0x1c')]=qs[_0x7aea('0x1c')](_0x470b36[_0x7aea('0x2f')][_0x7aea('0x1c')]);_0x1ccbfd[_0x7aea('0x1b')]=qs[_0x7aea('0x1b')](_0x470b36[_0x7aea('0x2f')][_0x7aea('0x1b')]);}_0x1ccbfd[_0x7aea('0x36')]=qs[_0x7aea('0x37')](_0x470b36['query']['sort']);_0x1ccbfd[_0x7aea('0x38')]=qs[_0x7aea('0x30')](_['pick'](_0x470b36[_0x7aea('0x2f')],_0x3cc9fd[_0x7aea('0x30')]));if(_0x470b36['query'][_0x7aea('0x39')]){_0x1ccbfd['where']=_[_0x7aea('0x3a')](_0x1ccbfd['where'],{'$or':_['map'](_0x3c562c,function(_0x4a5535){if(_0x4a5535[_0x7aea('0x3b')][_0x7aea('0x3c')]!==_0x7aea('0x3d')){var _0x22cf9d={};_0x22cf9d[_0x4a5535[_0x7aea('0x3e')]]={'$like':'%'+_0x470b36['query']['filter']+'%'};return _0x22cf9d;}})});}_0x1ccbfd=_[_0x7aea('0x3a')]({},_0x1ccbfd,_0x470b36['options']);var _0x122507={'where':_0x1ccbfd[_0x7aea('0x38')]};return db[_0x7aea('0x3f')][_0x7aea('0x1a')](_0x122507)['then'](function(_0x16e1e6){_0x5d0439['count']=_0x16e1e6;if(_0x470b36[_0x7aea('0x2f')][_0x7aea('0x40')]){_0x1ccbfd['include']=[{'all':!![]}];}return db[_0x7aea('0x3f')][_0x7aea('0x41')](_0x1ccbfd);})[_0x7aea('0x22')](function(_0xcc45fc){_0x5d0439['rows']=_0xcc45fc;return _0x5d0439;})[_0x7aea('0x22')](respondWithFilteredResult(_0xcdcf07,_0x1ccbfd))[_0x7aea('0x42')](handleError(_0xcdcf07,null));};exports['show']=function(_0x561ef7,_0x297a28){var _0x29a803={'raw':!![],'where':{'id':_0x561ef7[_0x7aea('0x43')]['id']}},_0x122452={};_0x122452[_0x7aea('0x2d')]=_[_0x7aea('0x2e')](db[_0x7aea('0x3f')][_0x7aea('0x2c')]);_0x122452[_0x7aea('0x2f')]=_[_0x7aea('0x2e')](_0x561ef7[_0x7aea('0x2f')]);_0x122452[_0x7aea('0x30')]=_[_0x7aea('0x32')](_0x122452[_0x7aea('0x2d')],_0x122452['query']);_0x29a803[_0x7aea('0x31')]=_['intersection'](_0x122452['model'],qs['fields'](_0x561ef7[_0x7aea('0x2f')][_0x7aea('0x33')]));_0x29a803[_0x7aea('0x31')]=_0x29a803[_0x7aea('0x31')][_0x7aea('0x44')]?_0x29a803[_0x7aea('0x31')]:_0x122452[_0x7aea('0x2d')];if(_0x561ef7[_0x7aea('0x2f')][_0x7aea('0x40')]){_0x29a803[_0x7aea('0x45')]=[{'all':!![]}];}_0x29a803=_[_0x7aea('0x3a')]({},_0x29a803,_0x561ef7[_0x7aea('0x46')]);return db[_0x7aea('0x3f')][_0x7aea('0x47')](_0x29a803)[_0x7aea('0x22')](handleEntityNotFound(_0x297a28,null))['then'](respondWithResult(_0x297a28,null))[_0x7aea('0x42')](handleError(_0x297a28,null));};exports['create']=function(_0x3935e8,_0xcb614a){return db[_0x7aea('0x3f')][_0x7aea('0x48')](_0x3935e8[_0x7aea('0x49')],{})['then'](function(_0x47e4dc){var _0x5dbcb7=_0x3935e8['user'][_0x7aea('0x24')]({'plain':!![]});if(!_0x5dbcb7)throw new Error(_0x7aea('0x4a'));if(_0x5dbcb7['role']==='user'){var _0x1c2c63=_0x47e4dc[_0x7aea('0x24')]({'plain':!![]});var _0x1fb494='FaxQueues';return db[_0x7aea('0x4b')][_0x7aea('0x47')]({'where':{'name':_0x1fb494,'userProfileId':_0x5dbcb7[_0x7aea('0x4c')]},'raw':!![]})['then'](function(_0x320ceb){if(_0x320ceb&&_0x320ceb['autoAssociation']===0x0){return db[_0x7aea('0x25')]['create']({'name':_0x1c2c63[_0x7aea('0x29')],'resourceId':_0x1c2c63['id'],'type':_0x320ceb['name'],'sectionId':_0x320ceb['id']},{})[_0x7aea('0x22')](function(){return _0x47e4dc;});}else{return _0x47e4dc;}})[_0x7aea('0x42')](function(_0x5b333b){logger[_0x7aea('0x28')](_0x7aea('0x4d'),_0x5b333b);throw _0x5b333b;});}return _0x47e4dc;})[_0x7aea('0x22')](respondWithResult(_0xcb614a,0xc9))[_0x7aea('0x42')](handleError(_0xcb614a,null));};exports['update']=function(_0x4a1ac2,_0x172b2a){if(_0x4a1ac2[_0x7aea('0x49')]['id']){delete _0x4a1ac2[_0x7aea('0x49')]['id'];}return db[_0x7aea('0x3f')][_0x7aea('0x47')]({'where':{'id':_0x4a1ac2['params']['id']}})[_0x7aea('0x22')](handleEntityNotFound(_0x172b2a,null))[_0x7aea('0x22')](saveUpdates(_0x4a1ac2[_0x7aea('0x49')],null))['then'](respondWithResult(_0x172b2a,null))['catch'](handleError(_0x172b2a,null));};exports[_0x7aea('0x23')]=function(_0x18b8b9,_0x381f57){return db[_0x7aea('0x3f')][_0x7aea('0x47')]({'where':{'id':_0x18b8b9[_0x7aea('0x43')]['id']}})[_0x7aea('0x22')](handleEntityNotFound(_0x381f57,null))['then'](removeEntity(_0x381f57,null))[_0x7aea('0x42')](handleError(_0x381f57,null));};exports['describe']=function(_0x55f4f1,_0x3b191c){return db[_0x7aea('0x3f')][_0x7aea('0x4e')]()[_0x7aea('0x22')](respondWithResult(_0x3b191c,null))['catch'](handleError(_0x3b191c,null));};exports[_0x7aea('0x4f')]=function(_0x5847d5,_0x2526be,_0x569eb2){var _0xf64805={'raw':!![],'where':{}},_0x4eb70a={},_0x26e65b;return db[_0x7aea('0x3f')][_0x7aea('0x50')]({'where':{'id':_0x5847d5[_0x7aea('0x43')]['id']}})[_0x7aea('0x22')](handleEntityNotFound(_0x2526be,null))['then'](function(_0x29d3f2){if(_0x29d3f2){_0x26e65b=_0x29d3f2[_0x7aea('0x24')]({'plain':!![]});_0x4eb70a[_0x7aea('0x2d')]=_[_0x7aea('0x2e')](db[_0x7aea('0x51')]['rawAttributes']);_0x4eb70a[_0x7aea('0x2f')]=_[_0x7aea('0x2e')](_0x5847d5[_0x7aea('0x2f')]);_0x4eb70a[_0x7aea('0x30')]=_[_0x7aea('0x32')](_0x4eb70a[_0x7aea('0x2d')],_0x4eb70a[_0x7aea('0x2f')]);_0xf64805[_0x7aea('0x31')]=_['intersection'](_0x4eb70a[_0x7aea('0x2d')],qs[_0x7aea('0x33')](_0x5847d5[_0x7aea('0x2f')]['fields']));_0xf64805[_0x7aea('0x31')]=_0xf64805['attributes'][_0x7aea('0x44')]?_0xf64805[_0x7aea('0x31')]:_0x4eb70a[_0x7aea('0x2d')];if(!_0x5847d5[_0x7aea('0x2f')][_0x7aea('0x34')](_0x7aea('0x35'))){_0xf64805[_0x7aea('0x1c')]=qs[_0x7aea('0x1c')](_0x5847d5[_0x7aea('0x2f')][_0x7aea('0x1c')]);_0xf64805[_0x7aea('0x1b')]=qs['offset'](_0x5847d5[_0x7aea('0x2f')][_0x7aea('0x1b')]);}_0xf64805[_0x7aea('0x36')]=qs[_0x7aea('0x37')](_0x5847d5[_0x7aea('0x2f')][_0x7aea('0x37')]);_0xf64805['where']=qs[_0x7aea('0x30')](_[_0x7aea('0x52')](_0x5847d5[_0x7aea('0x2f')],_0x4eb70a[_0x7aea('0x30')]));_0xf64805[_0x7aea('0x38')][_0x7aea('0x53')]=_0x29d3f2['id'];if(_0x5847d5[_0x7aea('0x2f')][_0x7aea('0x39')]){_0xf64805[_0x7aea('0x38')]=_[_0x7aea('0x3a')](_0xf64805['where'],{'$or':_[_0x7aea('0x54')](_0xf64805['attributes'],function(_0x57fe49){var _0x540ed7={};_0x540ed7[_0x57fe49]={'$like':'%'+_0x5847d5[_0x7aea('0x2f')][_0x7aea('0x39')]+'%'};return _0x540ed7;})});}_0xf64805=_[_0x7aea('0x3a')]({},_0xf64805,_0x5847d5['options']);return db[_0x7aea('0x51')][_0x7aea('0x41')](_0xf64805);}})['then'](function(_0x17abef){if(_0x17abef){return db[_0x7aea('0x55')][_0x7aea('0x56')]({'where':{'id':_['map'](_0x17abef,_0x7aea('0x57')),'role':_0x7aea('0x58')},'attributes':['id',_0x7aea('0x29'),_0x7aea('0x59'),_0x7aea('0x5a'),_0x7aea('0x5b')]});}})[_0x7aea('0x22')](function(_0x5aa955){if(_0x5aa955){return{'count':_0x5aa955[_0x7aea('0x1a')],'rows':_[_0x7aea('0x54')](_0x5aa955['rows'],function(_0x14afdc){return{'membername':_0x14afdc[_0x7aea('0x29')],'UserId':_0x14afdc['id'],'queue_name':_0x26e65b[_0x7aea('0x29')],'FaxQueueId':_0x26e65b['id'],'interface':util[_0x7aea('0x5c')](_0x7aea('0x5d'),_0x7aea('0x5e'),_0x14afdc['name']),'penalty':0x0,'paused':_0x14afdc[_0x7aea('0x59')],'createdAt':_0x14afdc[_0x7aea('0x5b')],'updatedAt':_0x14afdc['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2526be,_0xf64805))['catch'](handleError(_0x2526be,null));};exports[_0x7aea('0x5f')]=function(_0x29c46d,_0x3d51d9,_0x3cca0a){var _0x29fd0d={};var _0x4d7c88={};var _0x1d2b86;var _0x458c5c;return db['FaxQueue'][_0x7aea('0x50')]({'where':{'id':_0x29c46d['params']['id']}})[_0x7aea('0x22')](handleEntityNotFound(_0x3d51d9,null))[_0x7aea('0x22')](function(_0x5d72af){if(_0x5d72af){_0x1d2b86=_0x5d72af;_0x4d7c88[_0x7aea('0x2d')]=_[_0x7aea('0x2e')](db[_0x7aea('0x60')][_0x7aea('0x2c')]);_0x4d7c88[_0x7aea('0x2f')]=_[_0x7aea('0x2e')](_0x29c46d[_0x7aea('0x2f')]);_0x4d7c88[_0x7aea('0x30')]=_[_0x7aea('0x32')](_0x4d7c88[_0x7aea('0x2d')],_0x4d7c88[_0x7aea('0x2f')]);_0x29fd0d[_0x7aea('0x31')]=_[_0x7aea('0x32')](_0x4d7c88['model'],qs[_0x7aea('0x33')](_0x29c46d[_0x7aea('0x2f')][_0x7aea('0x33')]));_0x29fd0d['attributes']=_0x29fd0d['attributes']['length']?_0x29fd0d['attributes']:_0x4d7c88[_0x7aea('0x2d')];_0x29fd0d[_0x7aea('0x36')]=qs[_0x7aea('0x37')](_0x29c46d[_0x7aea('0x2f')][_0x7aea('0x37')]);_0x29fd0d[_0x7aea('0x38')]=qs[_0x7aea('0x30')](_[_0x7aea('0x52')](_0x29c46d[_0x7aea('0x2f')],_0x4d7c88[_0x7aea('0x30')]));if(_0x29c46d[_0x7aea('0x2f')]['filter']){_0x29fd0d[_0x7aea('0x38')]=_[_0x7aea('0x3a')](_0x29fd0d[_0x7aea('0x38')],{'$or':_[_0x7aea('0x54')](_0x29fd0d[_0x7aea('0x31')],function(_0x45724e){var _0x1aae6b={};_0x1aae6b[_0x45724e]={'$like':'%'+_0x29c46d['query'][_0x7aea('0x39')]+'%'};return _0x1aae6b;})});}_0x29fd0d=_[_0x7aea('0x3a')]({},_0x29fd0d,_0x29c46d['options']);return _0x1d2b86[_0x7aea('0x5f')](_0x29fd0d);}})[_0x7aea('0x22')](function(_0x4559a7){if(_0x4559a7){_0x458c5c=_0x4559a7[_0x7aea('0x44')];if(!_0x29c46d[_0x7aea('0x2f')][_0x7aea('0x34')](_0x7aea('0x35'))){_0x29fd0d['limit']=qs[_0x7aea('0x1c')](_0x29c46d[_0x7aea('0x2f')][_0x7aea('0x1c')]);_0x29fd0d[_0x7aea('0x1b')]=qs['offset'](_0x29c46d[_0x7aea('0x2f')][_0x7aea('0x1b')]);}return _0x1d2b86[_0x7aea('0x5f')](_0x29fd0d);}})[_0x7aea('0x22')](function(_0x1668ca){if(_0x1668ca){return _0x1668ca?{'count':_0x458c5c,'rows':_0x1668ca}:null;}})[_0x7aea('0x22')](respondWithResult(_0x3d51d9,null))['catch'](handleError(_0x3d51d9,null));};exports[_0x7aea('0x61')]=function(_0x26402f,_0x3bedc8,_0xf86381){var _0x4cc679=_0x26402f[_0x7aea('0x49')]['teams'];return db['Team'][_0x7aea('0x41')]({'where':{'id':_['map'](_0x4cc679,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x7aea('0x62'),_0x7aea('0x63'),_0x7aea('0x64')],'raw':!![]}]})[_0x7aea('0x22')](function(_0x2df3d1){if(_0x2df3d1){var _0x1b854a=_[_0x7aea('0x65')](_0x2df3d1,function(_0x52f227){var _0x4dffb1=_0x52f227['get']({'plain':!![]});return _0x4dffb1[_0x7aea('0x66')];});return db['FaxQueue']['find']({'where':{'id':_0x26402f[_0x7aea('0x43')]['id']}})['then'](function(_0x2191f3){return db[_0x7aea('0x67')][_0x7aea('0x68')](function(_0x4b8bc2){return _0x2191f3['addTeams'](_[_0x7aea('0x54')](_0x4cc679,'id'),{'transaction':_0x4b8bc2})['then'](function(){return BPromise[_0x7aea('0x69')](_0x1b854a,function(_0x4fef87){return db[_0x7aea('0x51')][_0x7aea('0x6a')]({'where':{'UserId':_0x4fef87['id'],'FaxQueueId':_0x26402f[_0x7aea('0x43')]['id']},'transaction':_0x4b8bc2});});})[_0x7aea('0x22')](function(){_0x1b854a[_0x7aea('0x6b')](function(_0x8a5dfd){socket[_0x7aea('0x6c')](_0x7aea('0x6d'),{'UserId':_0x8a5dfd['id'],'FaxQueueId':_0x2191f3['id']});});});});});}})[_0x7aea('0x22')](respondWithStatusCode(_0x3bedc8,null))[_0x7aea('0x42')](handleError(_0x3bedc8,null));};exports[_0x7aea('0x6e')]=function(_0x5517dd,_0x46808e,_0x18d9ff){return db[_0x7aea('0x60')][_0x7aea('0x41')]({'where':{'id':_0x5517dd[_0x7aea('0x2f')][_0x7aea('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x7aea('0x55')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7aea('0x22')](handleEntityNotFound(_0x46808e,null))[_0x7aea('0x22')](function(_0x3a8c4e){var _0x27a0f9=_[_0x7aea('0x54')](_0x3a8c4e,'id');var _0x29f98f=[];var _0xdc059e=[];var _0x50478e=squel[_0x7aea('0x70')]();_0x50478e[_0x7aea('0x3e')]('tq.TeamId')[_0x7aea('0x71')](_0x7aea('0x72'),'tq')[_0x7aea('0x73')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7aea('0x38')]('FaxQueueId\x20=\x20?',_0x5517dd[_0x7aea('0x43')]['id']);for(var _0x2282cb=0x0;_0x2282cb<_0x3a8c4e['length'];_0x2282cb+=0x1){let _0xcae2a6=_0x3a8c4e[_0x2282cb];for(var _0x3a825f=0x0;_0x3a825f<_0xcae2a6[_0x7aea('0x66')]['length'];_0x3a825f+=0x1){let _0x118c12=_0xcae2a6[_0x7aea('0x66')][_0x3a825f];var _0x1195df=_0x50478e['clone']();_0x1195df[_0x7aea('0x38')](_0x7aea('0x74'),_0x118c12['id']);_0xdc059e[_0x7aea('0x75')](db['sequelize']['query'](_0x1195df[_0x7aea('0x76')](),{'type':db[_0x7aea('0x67')][_0x7aea('0x77')]['SELECT']})[_0x7aea('0x22')](function(_0x2b3435){if(_0x2b3435[_0x7aea('0x44')]===0x1){return _0x118c12['id'];}else{var _0x5c4609=_[_0x7aea('0x78')](_[_0x7aea('0x54')](_0x2b3435,'TeamId'),function(_0x42d7bb){return _['includes'](_0x27a0f9,_0x42d7bb);});if(_0x5c4609){return _0x118c12['id'];}}}));}}return BPromise[_0x7aea('0x79')](_0xdc059e)[_0x7aea('0x22')](function(_0x44877a){_0x29f98f=_(_0x29f98f)[_0x7aea('0x7a')](_0x44877a)[_0x7aea('0x7b')]()[_0x7aea('0x7c')]();return db[_0x7aea('0x3f')][_0x7aea('0x47')]({'where':{'id':_0x5517dd[_0x7aea('0x43')]['id']}})[_0x7aea('0x22')](function(_0x152e60){return db[_0x7aea('0x67')]['transaction'](function(_0x2a853d){return _0x152e60['removeTeams'](_0x5517dd[_0x7aea('0x2f')][_0x7aea('0x6f')],{'transaction':_0x2a853d})[_0x7aea('0x22')](function(){if(!_[_0x7aea('0x7d')](_0x29f98f)){return _0x152e60[_0x7aea('0x7e')](_0x29f98f,{'transaction':_0x2a853d});}})[_0x7aea('0x22')](function(){_0x29f98f['forEach'](function(_0x2aa5d0){socket[_0x7aea('0x6c')]('userFaxQueue:remove',{'UserId':_0x2aa5d0,'FaxQueueId':_0x152e60['id']});});});});});});})[_0x7aea('0x22')](respondWithStatusCode(_0x46808e,null))['catch'](handleError(_0x46808e,null));};exports[_0x7aea('0x7f')]=function(_0x1cc956,_0x1de64e,_0x33ebde){return db[_0x7aea('0x3f')][_0x7aea('0x47')]({'where':{'id':_0x1cc956['params']['id']}})['then'](handleEntityNotFound(_0x1de64e,null))[_0x7aea('0x22')](function(_0xe3c243){if(_0xe3c243){return _0xe3c243[_0x7aea('0x7f')](_0x1cc956['body'][_0x7aea('0x6f')],_[_0x7aea('0x80')](_0x1cc956[_0x7aea('0x49')],[_0x7aea('0x6f'),'id'])||{})['spread'](function(_0x57e35e){for(var _0x3bec8c=0x0;_0x3bec8c<_0x1cc956[_0x7aea('0x49')][_0x7aea('0x6f')][_0x7aea('0x44')];_0x3bec8c+=0x1){socket[_0x7aea('0x6c')](_0x7aea('0x6d'),{'UserId':_0x1cc956[_0x7aea('0x49')][_0x7aea('0x6f')][_0x3bec8c],'FaxQueueId':_0x1cc956[_0x7aea('0x43')]['id']});}return _0x57e35e;});}})['then'](respondWithResult(_0x1de64e,null))[_0x7aea('0x42')](handleError(_0x1de64e,null));};exports[_0x7aea('0x7e')]=function(_0x283462,_0x3afd20,_0x470ea9){return db['FaxQueue']['find']({'where':{'id':_0x283462['params']['id']}})[_0x7aea('0x22')](handleEntityNotFound(_0x3afd20,null))[_0x7aea('0x22')](function(_0x40102a){if(_0x40102a){return _0x40102a[_0x7aea('0x7e')](_0x283462[_0x7aea('0x2f')][_0x7aea('0x6f')])['then'](function(){if(_[_0x7aea('0x81')](_0x283462['query']['ids'])){for(var _0x4893f3=0x0;_0x4893f3<_0x283462[_0x7aea('0x2f')][_0x7aea('0x6f')][_0x7aea('0x44')];_0x4893f3+=0x1){socket[_0x7aea('0x6c')](_0x7aea('0x82'),{'UserId':Number(_0x283462[_0x7aea('0x2f')][_0x7aea('0x6f')][_0x4893f3]),'FaxQueueId':Number(_0x283462[_0x7aea('0x43')]['id'])});}}else{socket[_0x7aea('0x6c')]('userFaxQueue:remove',{'UserId':Number(_0x283462[_0x7aea('0x2f')][_0x7aea('0x6f')]),'FaxQueueId':Number(_0x283462[_0x7aea('0x43')]['id'])});}});}})[_0x7aea('0x22')](respondWithStatusCode(_0x3afd20,null))[_0x7aea('0x42')](handleError(_0x3afd20,null));};exports[_0x7aea('0x83')]=function(_0x401bda,_0x57fe9b,_0x2bb362){var _0x56c66c={};var _0x4fbf8a={};var _0x55d503;var _0xd0fcb8;return db[_0x7aea('0x3f')][_0x7aea('0x50')]({'where':{'id':_0x401bda[_0x7aea('0x43')]['id']}})[_0x7aea('0x22')](handleEntityNotFound(_0x57fe9b,null))[_0x7aea('0x22')](function(_0x2c207b){if(_0x2c207b){_0x55d503=_0x2c207b;_0x4fbf8a[_0x7aea('0x2d')]=_['keys'](db[_0x7aea('0x55')][_0x7aea('0x2c')]);_0x4fbf8a[_0x7aea('0x2f')]=_[_0x7aea('0x2e')](_0x401bda[_0x7aea('0x2f')]);_0x4fbf8a[_0x7aea('0x30')]=_['intersection'](_0x4fbf8a[_0x7aea('0x2d')],_0x4fbf8a['query']);_0x56c66c[_0x7aea('0x31')]=_[_0x7aea('0x32')](_0x4fbf8a[_0x7aea('0x2d')],qs['fields'](_0x401bda[_0x7aea('0x2f')][_0x7aea('0x33')]));_0x56c66c[_0x7aea('0x31')]=_0x56c66c[_0x7aea('0x31')][_0x7aea('0x44')]?_0x56c66c[_0x7aea('0x31')]:_0x4fbf8a[_0x7aea('0x2d')];_0x56c66c[_0x7aea('0x36')]=qs[_0x7aea('0x37')](_0x401bda[_0x7aea('0x2f')][_0x7aea('0x37')]);_0x56c66c[_0x7aea('0x38')]=qs[_0x7aea('0x30')](_[_0x7aea('0x52')](_0x401bda[_0x7aea('0x2f')],_0x4fbf8a[_0x7aea('0x30')]));if(_0x401bda[_0x7aea('0x2f')]['filter']){_0x56c66c[_0x7aea('0x38')]=_['merge'](_0x56c66c[_0x7aea('0x38')],{'$or':_[_0x7aea('0x54')](_0x56c66c[_0x7aea('0x31')],function(_0x52bc36){var _0xd18428={};_0xd18428[_0x52bc36]={'$like':'%'+_0x401bda[_0x7aea('0x2f')][_0x7aea('0x39')]+'%'};return _0xd18428;})});}_0x56c66c=_[_0x7aea('0x3a')]({},_0x56c66c,_0x401bda[_0x7aea('0x46')]);return _0x55d503['getAgents'](_0x56c66c);}})['then'](function(_0x101da9){if(_0x101da9){_0xd0fcb8=_0x101da9[_0x7aea('0x44')];if(!_0x401bda[_0x7aea('0x2f')]['hasOwnProperty'](_0x7aea('0x35'))){_0x56c66c[_0x7aea('0x1c')]=qs[_0x7aea('0x1c')](_0x401bda[_0x7aea('0x2f')]['limit']);_0x56c66c[_0x7aea('0x1b')]=qs[_0x7aea('0x1b')](_0x401bda['query'][_0x7aea('0x1b')]);}return _0x55d503[_0x7aea('0x83')](_0x56c66c);}})[_0x7aea('0x22')](function(_0x533d9f){if(_0x533d9f){return _0x533d9f?{'count':_0xd0fcb8,'rows':_0x533d9f}:null;}})[_0x7aea('0x22')](respondWithResult(_0x57fe9b,null))[_0x7aea('0x42')](handleError(_0x57fe9b,null));}; \ No newline at end of file +var _0xd864=['ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','ids','omit','spread','userFaxQueue:save','isArray','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxQueues','sendStatus','error','stack','index','FaxQueue','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','key','VIRTUAL','field','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','name','describe','getMembers','findOne','UserFaxQueue','User','findAndCountAll','agent','faxPause','createdAt','format','%s/%s','updatedAt','getTeams','Team','addTeams','Agents','online','flatMap','sequelize','transaction','forEach','emit','removeTeams','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?'];(function(_0x3e9d06,_0x30e68f){var _0x1f5e28=function(_0x5790f5){while(--_0x5790f5){_0x3e9d06['push'](_0x3e9d06['shift']());}};_0x1f5e28(++_0x30e68f);}(_0xd864,0xa1));var _0x4d86=function(_0x10e845,_0xecf569){_0x10e845=_0x10e845-0x0;var _0x2fb976=_0xd864[_0x10e845];return _0x2fb976;};'use strict';var pdf=require(_0x4d86('0x0'));var emlformat=require(_0x4d86('0x1'));var rimraf=require(_0x4d86('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d86('0x3'));var rp=require('request-promise');var moment=require(_0x4d86('0x4'));var BPromise=require(_0x4d86('0x5'));var Mustache=require(_0x4d86('0x6'));var util=require(_0x4d86('0x7'));var path=require(_0x4d86('0x8'));var sox=require(_0x4d86('0x9'));var csv=require(_0x4d86('0xa'));var ejs=require(_0x4d86('0xb'));var fs=require('fs');var _=require(_0x4d86('0xc'));var squel=require(_0x4d86('0xd'));var crypto=require(_0x4d86('0xe'));var jsforce=require(_0x4d86('0xf'));var deskjs=require(_0x4d86('0x10'));var toCsv=require(_0x4d86('0xa'));var querystring=require('querystring');var Papa=require(_0x4d86('0x11'));var Redis=require(_0x4d86('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d86('0x13'))(_0x4d86('0x14'));var utils=require(_0x4d86('0x15'));var config=require(_0x4d86('0x16'));var db=require(_0x4d86('0x17'))['db'];config[_0x4d86('0x18')]=_[_0x4d86('0x19')](config[_0x4d86('0x18')],{'host':_0x4d86('0x1a'),'port':0x18eb});var socket=require(_0x4d86('0x1b'))(new Redis(config['redis']));require(_0x4d86('0x1c'))[_0x4d86('0x1d')](socket);function respondWithStatusCode(_0x37d781,_0x339222){_0x339222=_0x339222||0xcc;return function(_0x2a7131){if(_0x2a7131){return _0x37d781['sendStatus'](_0x339222);}return _0x37d781[_0x4d86('0x1e')](_0x339222)['end']();};}function respondWithResult(_0x3e867f,_0x36a7df){_0x36a7df=_0x36a7df||0xc8;return function(_0x21553b){if(_0x21553b){return _0x3e867f[_0x4d86('0x1e')](_0x36a7df)[_0x4d86('0x1f')](_0x21553b);}};}function respondWithFilteredResult(_0x33e4f0,_0xed666d){return function(_0x19ed62){if(_0x19ed62){var _0x3c61fc=_0x19ed62[_0x4d86('0x20')],_0x2f27e2=_0xed666d[_0x4d86('0x21')],_0x3580be=_0xed666d[_0x4d86('0x21')]+_0xed666d[_0x4d86('0x22')],_0x399eff;if(_0x3580be>=_0x3c61fc){_0x3580be=_0x3c61fc;_0x399eff=0xc8;}else{_0x399eff=0xce;}_0x33e4f0[_0x4d86('0x1e')](_0x399eff);return _0x33e4f0[_0x4d86('0x23')](_0x4d86('0x24'),_0x2f27e2+'-'+_0x3580be+'/'+_0x3c61fc)[_0x4d86('0x1f')](_0x19ed62);}return null;};}function patchUpdates(_0x8d1d30){return function(_0x5ab7a7){try{jsonpatch[_0x4d86('0x25')](_0x5ab7a7,_0x8d1d30,!![]);}catch(_0x467675){return BPromise[_0x4d86('0x26')](_0x467675);}return _0x5ab7a7[_0x4d86('0x27')]();};}function saveUpdates(_0x7793cb,_0x9d789c){return function(_0x43956c){if(_0x43956c){return _0x43956c[_0x4d86('0x28')](_0x7793cb)[_0x4d86('0x29')](function(_0x27e3db){return _0x27e3db;});}return null;};}function removeEntity(_0x7a85c,_0x122b8b){return function(_0x57d742){if(_0x57d742){return _0x57d742[_0x4d86('0x2a')]()[_0x4d86('0x29')](function(){var _0x109ae2=_0x57d742[_0x4d86('0x2b')]({'plain':!![]});var _0x5aecec=_0x4d86('0x2c');return db['UserProfileResource'][_0x4d86('0x2a')]({'where':{'type':_0x5aecec,'resourceId':_0x109ae2['id']}})[_0x4d86('0x29')](function(){return _0x57d742;});})[_0x4d86('0x29')](function(){_0x7a85c[_0x4d86('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x509ac8,_0x4161d5){return function(_0x4d3158){if(!_0x4d3158){_0x509ac8[_0x4d86('0x2d')](0x194);}return _0x4d3158;};}function handleError(_0x4ed99e,_0x45f855){_0x45f855=_0x45f855||0x1f4;return function(_0x48e51f){logger[_0x4d86('0x2e')](_0x48e51f[_0x4d86('0x2f')]);if(_0x48e51f['name']){delete _0x48e51f['name'];}_0x4ed99e[_0x4d86('0x1e')](_0x45f855)['send'](_0x48e51f);};}exports[_0x4d86('0x30')]=function(_0x5d2e61,_0x6ed746){var _0x8f80c7={},_0x5e4c7c={},_0x3dfead={'count':0x0,'rows':[]};var _0x2aca5c=db[_0x4d86('0x31')]['rawAttributes'];_0x5e4c7c['model']=_[_0x4d86('0x32')](_0x2aca5c);_0x5e4c7c['query']=_[_0x4d86('0x32')](_0x5d2e61[_0x4d86('0x33')]);_0x5e4c7c[_0x4d86('0x34')]=_[_0x4d86('0x35')](_0x5e4c7c[_0x4d86('0x36')],_0x5e4c7c[_0x4d86('0x33')]);_0x8f80c7[_0x4d86('0x37')]=_['intersection'](_0x5e4c7c[_0x4d86('0x36')],qs[_0x4d86('0x38')](_0x5d2e61[_0x4d86('0x33')]['fields']));_0x8f80c7[_0x4d86('0x37')]=_0x8f80c7['attributes'][_0x4d86('0x39')]?_0x8f80c7[_0x4d86('0x37')]:_0x5e4c7c['model'];if(!_0x5d2e61['query'][_0x4d86('0x3a')](_0x4d86('0x3b'))){_0x8f80c7[_0x4d86('0x22')]=qs['limit'](_0x5d2e61[_0x4d86('0x33')][_0x4d86('0x22')]);_0x8f80c7['offset']=qs['offset'](_0x5d2e61['query']['offset']);}_0x8f80c7[_0x4d86('0x3c')]=qs[_0x4d86('0x3d')](_0x5d2e61['query']['sort']);_0x8f80c7[_0x4d86('0x3e')]=qs[_0x4d86('0x34')](_[_0x4d86('0x3f')](_0x5d2e61['query'],_0x5e4c7c[_0x4d86('0x34')]));if(_0x5d2e61[_0x4d86('0x33')]['filter']){_0x8f80c7[_0x4d86('0x3e')]=_[_0x4d86('0x40')](_0x8f80c7[_0x4d86('0x3e')],{'$or':_[_0x4d86('0x41')](_0x2aca5c,function(_0x204d94){if(_0x204d94['type'][_0x4d86('0x42')]!==_0x4d86('0x43')){var _0x37cb5a={};_0x37cb5a[_0x204d94[_0x4d86('0x44')]]={'$like':'%'+_0x5d2e61[_0x4d86('0x33')][_0x4d86('0x45')]+'%'};return _0x37cb5a;}})});}_0x8f80c7=_['merge']({},_0x8f80c7,_0x5d2e61[_0x4d86('0x46')]);var _0x1fc6ba={'where':_0x8f80c7['where']};return db['FaxQueue']['count'](_0x1fc6ba)['then'](function(_0xc82a05){_0x3dfead['count']=_0xc82a05;if(_0x5d2e61['query'][_0x4d86('0x47')]){_0x8f80c7['include']=[{'all':!![]}];}return db['FaxQueue'][_0x4d86('0x48')](_0x8f80c7);})[_0x4d86('0x29')](function(_0x5a321d){_0x3dfead[_0x4d86('0x49')]=_0x5a321d;return _0x3dfead;})[_0x4d86('0x29')](respondWithFilteredResult(_0x6ed746,_0x8f80c7))[_0x4d86('0x4a')](handleError(_0x6ed746,null));};exports[_0x4d86('0x4b')]=function(_0x42a61a,_0x3fe71d){var _0x287878={'raw':!![],'where':{'id':_0x42a61a[_0x4d86('0x4c')]['id']}},_0x256d51={};_0x256d51[_0x4d86('0x36')]=_[_0x4d86('0x32')](db[_0x4d86('0x31')][_0x4d86('0x4d')]);_0x256d51[_0x4d86('0x33')]=_[_0x4d86('0x32')](_0x42a61a[_0x4d86('0x33')]);_0x256d51[_0x4d86('0x34')]=_[_0x4d86('0x35')](_0x256d51[_0x4d86('0x36')],_0x256d51[_0x4d86('0x33')]);_0x287878[_0x4d86('0x37')]=_[_0x4d86('0x35')](_0x256d51[_0x4d86('0x36')],qs['fields'](_0x42a61a[_0x4d86('0x33')][_0x4d86('0x38')]));_0x287878[_0x4d86('0x37')]=_0x287878[_0x4d86('0x37')][_0x4d86('0x39')]?_0x287878['attributes']:_0x256d51[_0x4d86('0x36')];if(_0x42a61a[_0x4d86('0x33')][_0x4d86('0x47')]){_0x287878[_0x4d86('0x4e')]=[{'all':!![]}];}_0x287878=_[_0x4d86('0x40')]({},_0x287878,_0x42a61a[_0x4d86('0x46')]);return db[_0x4d86('0x31')][_0x4d86('0x4f')](_0x287878)[_0x4d86('0x29')](handleEntityNotFound(_0x3fe71d,null))[_0x4d86('0x29')](respondWithResult(_0x3fe71d,null))[_0x4d86('0x4a')](handleError(_0x3fe71d,null));};exports['create']=function(_0x55698e,_0x4f712a){return db[_0x4d86('0x31')][_0x4d86('0x50')](_0x55698e[_0x4d86('0x51')],{})[_0x4d86('0x29')](function(_0x3445d1){var _0x4b2bba=_0x55698e[_0x4d86('0x52')][_0x4d86('0x2b')]({'plain':!![]});if(!_0x4b2bba)throw new Error(_0x4d86('0x53'));if(_0x4b2bba[_0x4d86('0x54')]===_0x4d86('0x52')){var _0x3da1d0=_0x3445d1['get']({'plain':!![]});var _0x434dcb=_0x4d86('0x2c');return db[_0x4d86('0x55')][_0x4d86('0x4f')]({'where':{'name':_0x434dcb,'userProfileId':_0x4b2bba[_0x4d86('0x56')]},'raw':!![]})[_0x4d86('0x29')](function(_0x22815c){if(_0x22815c&&_0x22815c[_0x4d86('0x57')]===0x0){return db[_0x4d86('0x58')][_0x4d86('0x50')]({'name':_0x3da1d0[_0x4d86('0x59')],'resourceId':_0x3da1d0['id'],'type':_0x22815c['name'],'sectionId':_0x22815c['id']},{})[_0x4d86('0x29')](function(){return _0x3445d1;});}else{return _0x3445d1;}})[_0x4d86('0x4a')](function(_0x49960b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49960b);throw _0x49960b;});}return _0x3445d1;})[_0x4d86('0x29')](respondWithResult(_0x4f712a,0xc9))[_0x4d86('0x4a')](handleError(_0x4f712a,null));};exports['update']=function(_0x2c889f,_0x521d98){if(_0x2c889f['body']['id']){delete _0x2c889f[_0x4d86('0x51')]['id'];}return db[_0x4d86('0x31')][_0x4d86('0x4f')]({'where':{'id':_0x2c889f['params']['id']}})[_0x4d86('0x29')](handleEntityNotFound(_0x521d98,null))['then'](saveUpdates(_0x2c889f[_0x4d86('0x51')],null))[_0x4d86('0x29')](respondWithResult(_0x521d98,null))['catch'](handleError(_0x521d98,null));};exports[_0x4d86('0x2a')]=function(_0x2c6795,_0x4f9c6d){return db['FaxQueue'][_0x4d86('0x4f')]({'where':{'id':_0x2c6795[_0x4d86('0x4c')]['id']}})[_0x4d86('0x29')](handleEntityNotFound(_0x4f9c6d,null))['then'](removeEntity(_0x4f9c6d,null))[_0x4d86('0x4a')](handleError(_0x4f9c6d,null));};exports[_0x4d86('0x5a')]=function(_0x16abba,_0x5c36e4){return db[_0x4d86('0x31')]['describe']()['then'](respondWithResult(_0x5c36e4,null))[_0x4d86('0x4a')](handleError(_0x5c36e4,null));};exports[_0x4d86('0x5b')]=function(_0x51b1f5,_0x1d27c0,_0x657d33){var _0x3950ff={'raw':!![],'where':{}},_0x2c3fe4={},_0x1d4fe0;return db[_0x4d86('0x31')][_0x4d86('0x5c')]({'where':{'id':_0x51b1f5[_0x4d86('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1d27c0,null))[_0x4d86('0x29')](function(_0x28d707){if(_0x28d707){_0x1d4fe0=_0x28d707['get']({'plain':!![]});_0x2c3fe4[_0x4d86('0x36')]=_['keys'](db[_0x4d86('0x5d')][_0x4d86('0x4d')]);_0x2c3fe4[_0x4d86('0x33')]=_[_0x4d86('0x32')](_0x51b1f5[_0x4d86('0x33')]);_0x2c3fe4[_0x4d86('0x34')]=_[_0x4d86('0x35')](_0x2c3fe4[_0x4d86('0x36')],_0x2c3fe4[_0x4d86('0x33')]);_0x3950ff[_0x4d86('0x37')]=_[_0x4d86('0x35')](_0x2c3fe4[_0x4d86('0x36')],qs['fields'](_0x51b1f5['query'][_0x4d86('0x38')]));_0x3950ff[_0x4d86('0x37')]=_0x3950ff['attributes'][_0x4d86('0x39')]?_0x3950ff['attributes']:_0x2c3fe4['model'];if(!_0x51b1f5[_0x4d86('0x33')][_0x4d86('0x3a')](_0x4d86('0x3b'))){_0x3950ff[_0x4d86('0x22')]=qs[_0x4d86('0x22')](_0x51b1f5[_0x4d86('0x33')][_0x4d86('0x22')]);_0x3950ff[_0x4d86('0x21')]=qs['offset'](_0x51b1f5[_0x4d86('0x33')][_0x4d86('0x21')]);}_0x3950ff[_0x4d86('0x3c')]=qs[_0x4d86('0x3d')](_0x51b1f5['query']['sort']);_0x3950ff['where']=qs[_0x4d86('0x34')](_['pick'](_0x51b1f5[_0x4d86('0x33')],_0x2c3fe4[_0x4d86('0x34')]));_0x3950ff[_0x4d86('0x3e')]['FaxQueueId']=_0x28d707['id'];if(_0x51b1f5[_0x4d86('0x33')][_0x4d86('0x45')]){_0x3950ff['where']=_['merge'](_0x3950ff[_0x4d86('0x3e')],{'$or':_['map'](_0x3950ff[_0x4d86('0x37')],function(_0x1061e3){var _0xd646cb={};_0xd646cb[_0x1061e3]={'$like':'%'+_0x51b1f5[_0x4d86('0x33')]['filter']+'%'};return _0xd646cb;})});}_0x3950ff=_[_0x4d86('0x40')]({},_0x3950ff,_0x51b1f5[_0x4d86('0x46')]);return db[_0x4d86('0x5d')][_0x4d86('0x48')](_0x3950ff);}})[_0x4d86('0x29')](function(_0x197fb3){if(_0x197fb3){return db[_0x4d86('0x5e')][_0x4d86('0x5f')]({'where':{'id':_[_0x4d86('0x41')](_0x197fb3,'UserId'),'role':_0x4d86('0x60')},'attributes':['id','name',_0x4d86('0x61'),'updatedAt',_0x4d86('0x62')]});}})[_0x4d86('0x29')](function(_0x591101){if(_0x591101){return{'count':_0x591101['count'],'rows':_[_0x4d86('0x41')](_0x591101[_0x4d86('0x49')],function(_0x1b8793){return{'membername':_0x1b8793[_0x4d86('0x59')],'UserId':_0x1b8793['id'],'queue_name':_0x1d4fe0[_0x4d86('0x59')],'FaxQueueId':_0x1d4fe0['id'],'interface':util[_0x4d86('0x63')](_0x4d86('0x64'),'SIP',_0x1b8793['name']),'penalty':0x0,'paused':_0x1b8793[_0x4d86('0x61')],'createdAt':_0x1b8793['createdAt'],'updatedAt':_0x1b8793[_0x4d86('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4d86('0x29')](respondWithFilteredResult(_0x1d27c0,_0x3950ff))[_0x4d86('0x4a')](handleError(_0x1d27c0,null));};exports[_0x4d86('0x66')]=function(_0x449974,_0x15d89f,_0xf10b1){var _0x1377bc={};var _0x423719={};var _0x389052;var _0x15ceed;return db['FaxQueue'][_0x4d86('0x5c')]({'where':{'id':_0x449974[_0x4d86('0x4c')]['id']}})['then'](handleEntityNotFound(_0x15d89f,null))[_0x4d86('0x29')](function(_0x2e8e0d){if(_0x2e8e0d){_0x389052=_0x2e8e0d;_0x423719['model']=_[_0x4d86('0x32')](db[_0x4d86('0x67')][_0x4d86('0x4d')]);_0x423719[_0x4d86('0x33')]=_[_0x4d86('0x32')](_0x449974[_0x4d86('0x33')]);_0x423719[_0x4d86('0x34')]=_[_0x4d86('0x35')](_0x423719['model'],_0x423719[_0x4d86('0x33')]);_0x1377bc[_0x4d86('0x37')]=_['intersection'](_0x423719['model'],qs[_0x4d86('0x38')](_0x449974[_0x4d86('0x33')][_0x4d86('0x38')]));_0x1377bc[_0x4d86('0x37')]=_0x1377bc[_0x4d86('0x37')]['length']?_0x1377bc['attributes']:_0x423719[_0x4d86('0x36')];_0x1377bc['order']=qs['sort'](_0x449974[_0x4d86('0x33')][_0x4d86('0x3d')]);_0x1377bc[_0x4d86('0x3e')]=qs[_0x4d86('0x34')](_[_0x4d86('0x3f')](_0x449974[_0x4d86('0x33')],_0x423719[_0x4d86('0x34')]));if(_0x449974[_0x4d86('0x33')][_0x4d86('0x45')]){_0x1377bc[_0x4d86('0x3e')]=_[_0x4d86('0x40')](_0x1377bc[_0x4d86('0x3e')],{'$or':_[_0x4d86('0x41')](_0x1377bc['attributes'],function(_0x343d39){var _0x5c4848={};_0x5c4848[_0x343d39]={'$like':'%'+_0x449974['query'][_0x4d86('0x45')]+'%'};return _0x5c4848;})});}_0x1377bc=_[_0x4d86('0x40')]({},_0x1377bc,_0x449974['options']);return _0x389052['getTeams'](_0x1377bc);}})['then'](function(_0x1494d5){if(_0x1494d5){_0x15ceed=_0x1494d5['length'];if(!_0x449974['query']['hasOwnProperty'](_0x4d86('0x3b'))){_0x1377bc[_0x4d86('0x22')]=qs[_0x4d86('0x22')](_0x449974[_0x4d86('0x33')][_0x4d86('0x22')]);_0x1377bc['offset']=qs['offset'](_0x449974[_0x4d86('0x33')][_0x4d86('0x21')]);}return _0x389052[_0x4d86('0x66')](_0x1377bc);}})[_0x4d86('0x29')](function(_0x28c8d9){if(_0x28c8d9){return _0x28c8d9?{'count':_0x15ceed,'rows':_0x28c8d9}:null;}})[_0x4d86('0x29')](respondWithResult(_0x15d89f,null))[_0x4d86('0x4a')](handleError(_0x15d89f,null));};exports[_0x4d86('0x68')]=function(_0x154cd2,_0x50cb1f,_0x103789){var _0x13d460=_0x154cd2[_0x4d86('0x51')]['teams'];return db[_0x4d86('0x67')]['findAll']({'where':{'id':_[_0x4d86('0x41')](_0x13d460,'id')},'attributes':['id'],'include':[{'model':db[_0x4d86('0x5e')],'as':_0x4d86('0x69'),'attributes':['id','name',_0x4d86('0x6a'),'voicePause','interface'],'raw':!![]}]})[_0x4d86('0x29')](function(_0x53313b){if(_0x53313b){var _0x314b09=_[_0x4d86('0x6b')](_0x53313b,function(_0x4e129a){var _0x2f66e3=_0x4e129a[_0x4d86('0x2b')]({'plain':!![]});return _0x2f66e3[_0x4d86('0x69')];});return db[_0x4d86('0x31')][_0x4d86('0x4f')]({'where':{'id':_0x154cd2[_0x4d86('0x4c')]['id']}})[_0x4d86('0x29')](function(_0x4b012d){return db[_0x4d86('0x6c')][_0x4d86('0x6d')](function(_0x32b96f){return _0x4b012d[_0x4d86('0x68')](_['map'](_0x13d460,'id'),{'transaction':_0x32b96f})['then'](function(){return BPromise['each'](_0x314b09,function(_0x41b4f8){return db[_0x4d86('0x5d')]['findOrCreate']({'where':{'UserId':_0x41b4f8['id'],'FaxQueueId':_0x154cd2[_0x4d86('0x4c')]['id']},'transaction':_0x32b96f});});})[_0x4d86('0x29')](function(){_0x314b09[_0x4d86('0x6e')](function(_0x27e4e5){socket[_0x4d86('0x6f')]('userFaxQueue:save',{'UserId':_0x27e4e5['id'],'FaxQueueId':_0x4b012d['id']});});});});});}})[_0x4d86('0x29')](respondWithStatusCode(_0x50cb1f,null))[_0x4d86('0x4a')](handleError(_0x50cb1f,null));};exports[_0x4d86('0x70')]=function(_0x5db5af,_0x324304,_0x5bfa59){return db[_0x4d86('0x67')][_0x4d86('0x48')]({'where':{'id':_0x5db5af[_0x4d86('0x33')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4d86('0x5e')],'as':_0x4d86('0x69'),'attributes':['id'],'raw':!![]}]})[_0x4d86('0x29')](handleEntityNotFound(_0x324304,null))[_0x4d86('0x29')](function(_0x3748aa){var _0x487aec=_[_0x4d86('0x41')](_0x3748aa,'id');var _0x159f6e=[];var _0x3eaa8c=[];var _0x31c912=squel['select']();_0x31c912[_0x4d86('0x44')]('tq.TeamId')[_0x4d86('0x71')](_0x4d86('0x72'),'tq')[_0x4d86('0x73')](_0x4d86('0x74'),'ut',_0x4d86('0x75'))[_0x4d86('0x3e')](_0x4d86('0x76'),_0x5db5af[_0x4d86('0x4c')]['id']);for(var _0x56fffe=0x0;_0x56fffe<_0x3748aa['length'];_0x56fffe+=0x1){let _0x28e1f3=_0x3748aa[_0x56fffe];for(var _0x515640=0x0;_0x515640<_0x28e1f3[_0x4d86('0x69')]['length'];_0x515640+=0x1){let _0x39242e=_0x28e1f3['Agents'][_0x515640];var _0x4e9831=_0x31c912['clone']();_0x4e9831[_0x4d86('0x3e')](_0x4d86('0x77'),_0x39242e['id']);_0x3eaa8c[_0x4d86('0x78')](db['sequelize'][_0x4d86('0x33')](_0x4e9831[_0x4d86('0x79')](),{'type':db[_0x4d86('0x6c')][_0x4d86('0x7a')][_0x4d86('0x7b')]})[_0x4d86('0x29')](function(_0x19f4aa){if(_0x19f4aa['length']===0x1){return _0x39242e['id'];}else{var _0x2ff3a6=_[_0x4d86('0x7c')](_[_0x4d86('0x41')](_0x19f4aa,_0x4d86('0x7d')),function(_0x1b68f6){return _[_0x4d86('0x7e')](_0x487aec,_0x1b68f6);});if(_0x2ff3a6){return _0x39242e['id'];}}}));}}return BPromise[_0x4d86('0x7f')](_0x3eaa8c)[_0x4d86('0x29')](function(_0xa3fade){_0x159f6e=_(_0x159f6e)['union'](_0xa3fade)[_0x4d86('0x80')]()[_0x4d86('0x81')]();return db[_0x4d86('0x31')][_0x4d86('0x4f')]({'where':{'id':_0x5db5af[_0x4d86('0x4c')]['id']}})['then'](function(_0x40b732){return db[_0x4d86('0x6c')][_0x4d86('0x6d')](function(_0x523e5e){return _0x40b732[_0x4d86('0x70')](_0x5db5af[_0x4d86('0x33')]['ids'],{'transaction':_0x523e5e})['then'](function(){if(!_[_0x4d86('0x82')](_0x159f6e)){return _0x40b732[_0x4d86('0x83')](_0x159f6e,{'transaction':_0x523e5e});}})[_0x4d86('0x29')](function(){_0x159f6e[_0x4d86('0x6e')](function(_0x2f8600){socket[_0x4d86('0x6f')](_0x4d86('0x84'),{'UserId':_0x2f8600,'FaxQueueId':_0x40b732['id']});});});});});});})[_0x4d86('0x29')](respondWithStatusCode(_0x324304,null))['catch'](handleError(_0x324304,null));};exports[_0x4d86('0x85')]=function(_0x45fe80,_0x1bd889,_0x3884fe){return db[_0x4d86('0x31')][_0x4d86('0x4f')]({'where':{'id':_0x45fe80[_0x4d86('0x4c')]['id']}})[_0x4d86('0x29')](handleEntityNotFound(_0x1bd889,null))[_0x4d86('0x29')](function(_0x52bd6b){if(_0x52bd6b){return _0x52bd6b[_0x4d86('0x85')](_0x45fe80['body'][_0x4d86('0x86')],_[_0x4d86('0x87')](_0x45fe80[_0x4d86('0x51')],['ids','id'])||{})[_0x4d86('0x88')](function(_0xb22c7c){for(var _0x33108c=0x0;_0x33108c<_0x45fe80[_0x4d86('0x51')]['ids'][_0x4d86('0x39')];_0x33108c+=0x1){socket[_0x4d86('0x6f')](_0x4d86('0x89'),{'UserId':_0x45fe80[_0x4d86('0x51')][_0x4d86('0x86')][_0x33108c],'FaxQueueId':_0x45fe80[_0x4d86('0x4c')]['id']});}return _0xb22c7c;});}})[_0x4d86('0x29')](respondWithResult(_0x1bd889,null))[_0x4d86('0x4a')](handleError(_0x1bd889,null));};exports[_0x4d86('0x83')]=function(_0x49e6db,_0x205b2f,_0x3f8bac){return db['FaxQueue']['find']({'where':{'id':_0x49e6db[_0x4d86('0x4c')]['id']}})['then'](handleEntityNotFound(_0x205b2f,null))[_0x4d86('0x29')](function(_0x1b230c){if(_0x1b230c){return _0x1b230c[_0x4d86('0x83')](_0x49e6db[_0x4d86('0x33')][_0x4d86('0x86')])[_0x4d86('0x29')](function(){if(_[_0x4d86('0x8a')](_0x49e6db[_0x4d86('0x33')][_0x4d86('0x86')])){for(var _0xa4f27e=0x0;_0xa4f27e<_0x49e6db['query'][_0x4d86('0x86')][_0x4d86('0x39')];_0xa4f27e+=0x1){socket[_0x4d86('0x6f')](_0x4d86('0x84'),{'UserId':Number(_0x49e6db[_0x4d86('0x33')][_0x4d86('0x86')][_0xa4f27e]),'FaxQueueId':Number(_0x49e6db[_0x4d86('0x4c')]['id'])});}}else{socket[_0x4d86('0x6f')](_0x4d86('0x84'),{'UserId':Number(_0x49e6db[_0x4d86('0x33')]['ids']),'FaxQueueId':Number(_0x49e6db['params']['id'])});}});}})[_0x4d86('0x29')](respondWithStatusCode(_0x205b2f,null))[_0x4d86('0x4a')](handleError(_0x205b2f,null));};exports[_0x4d86('0x8b')]=function(_0x30985b,_0x2c6067,_0x12070a){var _0x5b81e1={};var _0x17b121={};var _0x38d4f5;var _0x2bfea5;return db['FaxQueue'][_0x4d86('0x5c')]({'where':{'id':_0x30985b[_0x4d86('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2c6067,null))[_0x4d86('0x29')](function(_0xdb44cc){if(_0xdb44cc){_0x38d4f5=_0xdb44cc;_0x17b121['model']=_['keys'](db[_0x4d86('0x5e')]['rawAttributes']);_0x17b121['query']=_[_0x4d86('0x32')](_0x30985b[_0x4d86('0x33')]);_0x17b121[_0x4d86('0x34')]=_['intersection'](_0x17b121[_0x4d86('0x36')],_0x17b121[_0x4d86('0x33')]);_0x5b81e1[_0x4d86('0x37')]=_['intersection'](_0x17b121[_0x4d86('0x36')],qs[_0x4d86('0x38')](_0x30985b[_0x4d86('0x33')][_0x4d86('0x38')]));_0x5b81e1['attributes']=_0x5b81e1[_0x4d86('0x37')][_0x4d86('0x39')]?_0x5b81e1['attributes']:_0x17b121[_0x4d86('0x36')];_0x5b81e1[_0x4d86('0x3c')]=qs[_0x4d86('0x3d')](_0x30985b['query']['sort']);_0x5b81e1['where']=qs[_0x4d86('0x34')](_['pick'](_0x30985b[_0x4d86('0x33')],_0x17b121[_0x4d86('0x34')]));if(_0x30985b[_0x4d86('0x33')][_0x4d86('0x45')]){_0x5b81e1['where']=_[_0x4d86('0x40')](_0x5b81e1['where'],{'$or':_[_0x4d86('0x41')](_0x5b81e1[_0x4d86('0x37')],function(_0x1c0c1b){var _0x3fb467={};_0x3fb467[_0x1c0c1b]={'$like':'%'+_0x30985b[_0x4d86('0x33')][_0x4d86('0x45')]+'%'};return _0x3fb467;})});}_0x5b81e1=_[_0x4d86('0x40')]({},_0x5b81e1,_0x30985b[_0x4d86('0x46')]);return _0x38d4f5[_0x4d86('0x8b')](_0x5b81e1);}})[_0x4d86('0x29')](function(_0x3df80e){if(_0x3df80e){_0x2bfea5=_0x3df80e[_0x4d86('0x39')];if(!_0x30985b[_0x4d86('0x33')][_0x4d86('0x3a')]('nolimit')){_0x5b81e1['limit']=qs[_0x4d86('0x22')](_0x30985b[_0x4d86('0x33')][_0x4d86('0x22')]);_0x5b81e1['offset']=qs[_0x4d86('0x21')](_0x30985b[_0x4d86('0x33')][_0x4d86('0x21')]);}return _0x38d4f5[_0x4d86('0x8b')](_0x5b81e1);}})['then'](function(_0x49ce8d){if(_0x49ce8d){return _0x49ce8d?{'count':_0x2bfea5,'rows':_0x49ce8d}:null;}})['then'](respondWithResult(_0x2c6067,null))['catch'](handleError(_0x2c6067,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 04a06ea..db329d5 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 _0xa5fa=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxQueue'];(function(_0x4fbaa4,_0x1c1d30){var _0x2b0fba=function(_0x4222c1){while(--_0x4222c1){_0x4fbaa4['push'](_0x4fbaa4['shift']());}};_0x2b0fba(++_0x1c1d30);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x3104f0,_0x4239da){_0x3104f0=_0x3104f0-0x0;var _0x4d4c80=_0xa5fa[_0x3104f0];return _0x4d4c80;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xaa5f('0x0'))['db'][_0xaa5f('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xaa5f('0x2')](0x0);var events={'afterCreate':_0xaa5f('0x3'),'afterUpdate':'update','afterDestroy':_0xaa5f('0x4')};function emitEvent(_0x106128){return function(_0x4d1c8b,_0x233cd6,_0x42450a){FaxQueueEvents[_0xaa5f('0x5')](_0x106128+':'+_0x4d1c8b['id'],_0x4d1c8b);FaxQueueEvents[_0xaa5f('0x5')](_0x106128,_0x4d1c8b);_0x42450a(null);};}for(var e in events){if(events[_0xaa5f('0x6')](e)){var event=events[e];FaxQueue[_0xaa5f('0x7')](e,emitEvent(event));}}module[_0xaa5f('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0x2750=['remove','emit','hasOwnProperty','hook','exports','events','FaxQueue','setMaxListeners','save','update'];(function(_0x203178,_0x4163ae){var _0x5d5e42=function(_0x12a8fe){while(--_0x12a8fe){_0x203178['push'](_0x203178['shift']());}};_0x5d5e42(++_0x4163ae);}(_0x2750,0x13b));var _0x0275=function(_0x51471d,_0x2602dc){_0x51471d=_0x51471d-0x0;var _0x2a60fb=_0x2750[_0x51471d];return _0x2a60fb;};'use strict';var EventEmitter=require(_0x0275('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x0275('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x0275('0x2')](0x0);var events={'afterCreate':_0x0275('0x3'),'afterUpdate':_0x0275('0x4'),'afterDestroy':_0x0275('0x5')};function emitEvent(_0x41ec06){return function(_0x20273d,_0x4960,_0x3d0c9c){FaxQueueEvents[_0x0275('0x6')](_0x41ec06+':'+_0x20273d['id'],_0x20273d);FaxQueueEvents['emit'](_0x41ec06,_0x20273d);_0x3d0c9c(null);};}for(var e in events){if(events[_0x0275('0x7')](e)){var event=events[e];FaxQueue[_0x0275('0x8')](e,emitEvent(event));}}module[_0x0275('0x9')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 3b6911d..bd5ee4c 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 _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','lodash','../../config/logger'];(function(_0x134058,_0x423995){var _0x14a1a9=function(_0x47a2c9){while(--_0x47a2c9){_0x134058['push'](_0x134058['shift']());}};_0x14a1a9(++_0x423995);}(_0xb10b,0x12a));var _0xbb10=function(_0x5d92c2,_0x26d815){_0x5d92c2=_0x5d92c2-0x0;var _0x415601=_0xb10b[_0x5d92c2];return _0x415601;};'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')]('FaxQueue',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xadb5=['bluebird','path','rimraf','../../config/environment','exports','define','FaxQueue','fax_queues','util','api','moment'];(function(_0x2d01a8,_0x19640f){var _0x4e749a=function(_0x274c4e){while(--_0x274c4e){_0x2d01a8['push'](_0x2d01a8['shift']());}};_0x4e749a(++_0x19640f);}(_0xadb5,0xad));var _0x5adb=function(_0x24b940,_0x44d906){_0x24b940=_0x24b940-0x0;var _0x4f7e34=_0xadb5[_0x24b940];return _0x4f7e34;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var logger=require('../../config/logger')(_0x5adb('0x1'));var moment=require(_0x5adb('0x2'));var BPromise=require(_0x5adb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5adb('0x4'));var rimraf=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var attributes=require('./faxQueue.attributes');module[_0x5adb('0x7')]=function(_0x168d89,_0x3e2555){return _0x168d89[_0x5adb('0x8')](_0x5adb('0x9'),attributes,{'tableName':_0x5adb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 1d2475d..d37f490 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 _0x8581=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxQueue.socket','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxQueue','FaxQueue','findAll','where','options','map','model','attributes','include','ShowFaxQueue','raw','lodash'];(function(_0x4dcd40,_0x4243b3){var _0x1efb59=function(_0xbbc23){while(--_0xbbc23){_0x4dcd40['push'](_0x4dcd40['shift']());}};_0x1efb59(++_0x4243b3);}(_0x8581,0x97));var _0x1858=function(_0x3cd949,_0x1eaf90){_0x3cd949=_0x3cd949-0x0;var _0x387347=_0x8581[_0x3cd949];return _0x387347;};'use strict';var _=require(_0x1858('0x0'));var util=require(_0x1858('0x1'));var moment=require(_0x1858('0x2'));var BPromise=require('bluebird');var rs=require(_0x1858('0x3'));var fs=require('fs');var Redis=require(_0x1858('0x4'));var db=require(_0x1858('0x5'))['db'];var utils=require(_0x1858('0x6'));var logger=require('../../config/logger')(_0x1858('0x7'));var config=require(_0x1858('0x8'));var jayson=require(_0x1858('0x9'));var client=jayson[_0x1858('0xa')][_0x1858('0xb')]({'port':0x232a});config[_0x1858('0xc')]=_[_0x1858('0xd')](config[_0x1858('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x1858('0xe'))(new Redis(config[_0x1858('0xc')]));require(_0x1858('0xf'))['register'](socket);function respondWithRpcPromise(_0x7aea62,_0x412233,_0x5b39a6){return new BPromise(function(_0x2f6c20,_0x2b39c4){return client['request'](_0x7aea62,_0x5b39a6)[_0x1858('0x10')](function(_0x2cb7d2){logger[_0x1858('0x11')](_0x1858('0x12'),_0x412233,_0x1858('0x13'));logger[_0x1858('0x14')](_0x1858('0x15'),_0x412233,_0x1858('0x13'),JSON[_0x1858('0x16')](_0x2cb7d2));if(_0x2cb7d2[_0x1858('0x17')]){if(_0x2cb7d2[_0x1858('0x17')][_0x1858('0x18')]===0x1f4){logger['error'](_0x1858('0x12'),_0x412233,_0x2cb7d2[_0x1858('0x17')][_0x1858('0x19')]);return _0x2b39c4(_0x2cb7d2[_0x1858('0x17')][_0x1858('0x19')]);}logger[_0x1858('0x17')]('FaxQueue,\x20%s,\x20%s',_0x412233,_0x2cb7d2[_0x1858('0x17')][_0x1858('0x19')]);return _0x2f6c20(_0x2cb7d2[_0x1858('0x17')][_0x1858('0x19')]);}else{logger['info'](_0x1858('0x12'),_0x412233,_0x1858('0x13'));_0x2f6c20(_0x2cb7d2['result']['message']);}})[_0x1858('0x1a')](function(_0x265afe){logger['error'](_0x1858('0x12'),_0x412233,_0x265afe);_0x2b39c4(_0x265afe);});});}exports[_0x1858('0x1b')]=function(_0x5c26e5){var _0x28c6be=this;return new Promise(function(_0x4c2c9a,_0x42d001){return db[_0x1858('0x1c')][_0x1858('0x1d')]({'raw':_0x5c26e5['options']?_0x5c26e5['options']['raw']===undefined?!![]:![]:!![],'where':_0x5c26e5['options']?_0x5c26e5['options'][_0x1858('0x1e')]||null:null,'attributes':_0x5c26e5[_0x1858('0x1f')]?_0x5c26e5[_0x1858('0x1f')]['attributes']||null:null,'limit':_0x5c26e5[_0x1858('0x1f')]?_0x5c26e5[_0x1858('0x1f')]['limit']||null:null,'include':_0x5c26e5[_0x1858('0x1f')]?_0x5c26e5[_0x1858('0x1f')]['include']?_[_0x1858('0x20')](_0x5c26e5[_0x1858('0x1f')]['include'],function(_0x572d74){return{'model':db[_0x572d74[_0x1858('0x21')]],'as':_0x572d74['as'],'attributes':_0x572d74[_0x1858('0x22')],'include':_0x572d74['include']?_[_0x1858('0x20')](_0x572d74[_0x1858('0x23')],function(_0x1954f2){return{'model':db[_0x1954f2[_0x1858('0x21')]],'as':_0x1954f2['as'],'attributes':_0x1954f2[_0x1858('0x22')],'include':_0x1954f2['include']?_['map'](_0x1954f2[_0x1858('0x23')],function(_0x2131ef){return{'model':db[_0x2131ef[_0x1858('0x21')]],'as':_0x2131ef['as'],'attributes':_0x2131ef[_0x1858('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1858('0x10')](function(_0x2305c3){logger[_0x1858('0x11')]('GetFaxQueue',_0x5c26e5);logger[_0x1858('0x14')]('GetFaxQueue',_0x5c26e5,JSON['stringify'](_0x2305c3));_0x4c2c9a(_0x2305c3);})[_0x1858('0x1a')](function(_0x1e2843){logger[_0x1858('0x17')](_0x1858('0x1b'),_0x1e2843['message'],_0x5c26e5);_0x42d001(_0x28c6be[_0x1858('0x17')](0x1f4,_0x1e2843[_0x1858('0x19')]));});});};exports[_0x1858('0x24')]=function(_0x3aed96){var _0x347e0b=this;return new Promise(function(_0x492015,_0x486d8f){return db['FaxQueue']['find']({'raw':_0x3aed96[_0x1858('0x1f')]?_0x3aed96['options'][_0x1858('0x25')]===undefined?!![]:![]:!![],'where':_0x3aed96['options']?_0x3aed96[_0x1858('0x1f')][_0x1858('0x1e')]||null:null,'attributes':_0x3aed96[_0x1858('0x1f')]?_0x3aed96[_0x1858('0x1f')][_0x1858('0x22')]||null:null,'include':_0x3aed96[_0x1858('0x1f')]?_0x3aed96[_0x1858('0x1f')][_0x1858('0x23')]?_[_0x1858('0x20')](_0x3aed96[_0x1858('0x1f')][_0x1858('0x23')],function(_0x151151){return{'model':db[_0x151151[_0x1858('0x21')]],'as':_0x151151['as'],'attributes':_0x151151[_0x1858('0x22')],'include':_0x151151[_0x1858('0x23')]?_[_0x1858('0x20')](_0x151151['include'],function(_0x316e4d){return{'model':db[_0x316e4d[_0x1858('0x21')]],'as':_0x316e4d['as'],'attributes':_0x316e4d[_0x1858('0x22')],'include':_0x316e4d['include']?_[_0x1858('0x20')](_0x316e4d[_0x1858('0x23')],function(_0x2a052f){return{'model':db[_0x2a052f[_0x1858('0x21')]],'as':_0x2a052f['as'],'attributes':_0x2a052f[_0x1858('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1858('0x10')](function(_0x329fb7){logger['info'](_0x1858('0x24'),_0x3aed96);logger['debug']('ShowFaxQueue',_0x3aed96,JSON[_0x1858('0x16')](_0x329fb7));_0x492015(_0x329fb7);})['catch'](function(_0x162978){logger['error'](_0x1858('0x24'),_0x162978['message'],_0x3aed96);_0x486d8f(_0x347e0b['error'](0x1f4,_0x162978[_0x1858('0x19')]));});});}; \ No newline at end of file +var _0x8b9f=['stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','attributes','limit','map','model','include','debug','ShowFaxQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./faxQueue.socket','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0xd68a7b,_0xba58b9){var _0x329cf8=function(_0x1f5a40){while(--_0x1f5a40){_0xd68a7b['push'](_0xd68a7b['shift']());}};_0x329cf8(++_0xba58b9);}(_0x8b9f,0x15c));var _0xf8b9=function(_0x4cc727,_0x3b3885){_0x4cc727=_0x4cc727-0x0;var _0x3ff76a=_0x8b9f[_0x4cc727];return _0x3ff76a;};'use strict';var _=require(_0xf8b9('0x0'));var util=require(_0xf8b9('0x1'));var moment=require(_0xf8b9('0x2'));var BPromise=require(_0xf8b9('0x3'));var rs=require(_0xf8b9('0x4'));var fs=require('fs');var Redis=require(_0xf8b9('0x5'));var db=require(_0xf8b9('0x6'))['db'];var utils=require(_0xf8b9('0x7'));var logger=require(_0xf8b9('0x8'))(_0xf8b9('0x9'));var config=require(_0xf8b9('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xf8b9('0xb')]['http']({'port':0x232a});config[_0xf8b9('0xc')]=_[_0xf8b9('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf8b9('0xe'))(new Redis(config[_0xf8b9('0xc')]));require(_0xf8b9('0xf'))['register'](socket);function respondWithRpcPromise(_0x41f8f7,_0x5ecce9,_0x1c09c9){return new BPromise(function(_0x330825,_0x191d7c){return client['request'](_0x41f8f7,_0x1c09c9)[_0xf8b9('0x10')](function(_0x3059e4){logger[_0xf8b9('0x11')](_0xf8b9('0x12'),_0x5ecce9,_0xf8b9('0x13'));logger['debug'](_0xf8b9('0x14'),_0x5ecce9,'request\x20sent',JSON[_0xf8b9('0x15')](_0x3059e4));if(_0x3059e4['error']){if(_0x3059e4[_0xf8b9('0x16')][_0xf8b9('0x17')]===0x1f4){logger['error'](_0xf8b9('0x12'),_0x5ecce9,_0x3059e4['error']['message']);return _0x191d7c(_0x3059e4[_0xf8b9('0x16')]['message']);}logger['error'](_0xf8b9('0x12'),_0x5ecce9,_0x3059e4[_0xf8b9('0x16')]['message']);return _0x330825(_0x3059e4[_0xf8b9('0x16')][_0xf8b9('0x18')]);}else{logger[_0xf8b9('0x11')](_0xf8b9('0x12'),_0x5ecce9,_0xf8b9('0x13'));_0x330825(_0x3059e4[_0xf8b9('0x19')][_0xf8b9('0x18')]);}})[_0xf8b9('0x1a')](function(_0x13749e){logger['error'](_0xf8b9('0x12'),_0x5ecce9,_0x13749e);_0x191d7c(_0x13749e);});});}exports[_0xf8b9('0x1b')]=function(_0x129c55){var _0x1cc0ca=this;return new Promise(function(_0x5e95f1,_0x32e91d){return db[_0xf8b9('0x1c')][_0xf8b9('0x1d')]({'raw':_0x129c55[_0xf8b9('0x1e')]?_0x129c55['options'][_0xf8b9('0x1f')]===undefined?!![]:![]:!![],'where':_0x129c55['options']?_0x129c55[_0xf8b9('0x1e')]['where']||null:null,'attributes':_0x129c55[_0xf8b9('0x1e')]?_0x129c55[_0xf8b9('0x1e')][_0xf8b9('0x20')]||null:null,'limit':_0x129c55[_0xf8b9('0x1e')]?_0x129c55['options'][_0xf8b9('0x21')]||null:null,'include':_0x129c55[_0xf8b9('0x1e')]?_0x129c55[_0xf8b9('0x1e')]['include']?_[_0xf8b9('0x22')](_0x129c55['options']['include'],function(_0x132c52){return{'model':db[_0x132c52[_0xf8b9('0x23')]],'as':_0x132c52['as'],'attributes':_0x132c52[_0xf8b9('0x20')],'include':_0x132c52[_0xf8b9('0x24')]?_[_0xf8b9('0x22')](_0x132c52[_0xf8b9('0x24')],function(_0x48f15c){return{'model':db[_0x48f15c['model']],'as':_0x48f15c['as'],'attributes':_0x48f15c['attributes'],'include':_0x48f15c[_0xf8b9('0x24')]?_[_0xf8b9('0x22')](_0x48f15c[_0xf8b9('0x24')],function(_0x4f758f){return{'model':db[_0x4f758f[_0xf8b9('0x23')]],'as':_0x4f758f['as'],'attributes':_0x4f758f['attributes']};}):[]};}):[]};}):[]:[]})[_0xf8b9('0x10')](function(_0x5bc6d9){logger[_0xf8b9('0x11')]('GetFaxQueue',_0x129c55);logger[_0xf8b9('0x25')](_0xf8b9('0x1b'),_0x129c55,JSON[_0xf8b9('0x15')](_0x5bc6d9));_0x5e95f1(_0x5bc6d9);})[_0xf8b9('0x1a')](function(_0x316006){logger[_0xf8b9('0x16')](_0xf8b9('0x1b'),_0x316006[_0xf8b9('0x18')],_0x129c55);_0x32e91d(_0x1cc0ca[_0xf8b9('0x16')](0x1f4,_0x316006[_0xf8b9('0x18')]));});});};exports[_0xf8b9('0x26')]=function(_0x21a97f){var _0x369d2c=this;return new Promise(function(_0xbebc3e,_0x496281){return db[_0xf8b9('0x1c')][_0xf8b9('0x27')]({'raw':_0x21a97f[_0xf8b9('0x1e')]?_0x21a97f['options'][_0xf8b9('0x1f')]===undefined?!![]:![]:!![],'where':_0x21a97f['options']?_0x21a97f[_0xf8b9('0x1e')][_0xf8b9('0x28')]||null:null,'attributes':_0x21a97f[_0xf8b9('0x1e')]?_0x21a97f['options']['attributes']||null:null,'include':_0x21a97f[_0xf8b9('0x1e')]?_0x21a97f[_0xf8b9('0x1e')][_0xf8b9('0x24')]?_[_0xf8b9('0x22')](_0x21a97f[_0xf8b9('0x1e')][_0xf8b9('0x24')],function(_0x3e8497){return{'model':db[_0x3e8497[_0xf8b9('0x23')]],'as':_0x3e8497['as'],'attributes':_0x3e8497[_0xf8b9('0x20')],'include':_0x3e8497[_0xf8b9('0x24')]?_[_0xf8b9('0x22')](_0x3e8497[_0xf8b9('0x24')],function(_0x2983a9){return{'model':db[_0x2983a9['model']],'as':_0x2983a9['as'],'attributes':_0x2983a9[_0xf8b9('0x20')],'include':_0x2983a9['include']?_[_0xf8b9('0x22')](_0x2983a9[_0xf8b9('0x24')],function(_0x98148c){return{'model':db[_0x98148c['model']],'as':_0x98148c['as'],'attributes':_0x98148c[_0xf8b9('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf8b9('0x10')](function(_0x3bc882){logger[_0xf8b9('0x11')](_0xf8b9('0x26'),_0x21a97f);logger[_0xf8b9('0x25')](_0xf8b9('0x26'),_0x21a97f,JSON['stringify'](_0x3bc882));_0xbebc3e(_0x3bc882);})[_0xf8b9('0x1a')](function(_0x34b670){logger[_0xf8b9('0x16')](_0xf8b9('0x26'),_0x34b670[_0xf8b9('0x18')],_0x21a97f);_0x496281(_0x369d2c['error'](0x1f4,_0x34b670[_0xf8b9('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index b82f739..8663a4e 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 _0xfe06=['removeListener','register','./faxQueue.events','save','remove','emit'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0xfe06,0x158));var _0x6fe0=function(_0x4341b0,_0x14bd8a){_0x4341b0=_0x4341b0-0x0;var _0x5c2ff5=_0xfe06[_0x4341b0];return _0x5c2ff5;};'use strict';var FaxQueueEvents=require(_0x6fe0('0x0'));var events=[_0x6fe0('0x1'),_0x6fe0('0x2'),'update'];function createListener(_0x12bdf3,_0x19e7ac){return function(_0x1ab1d6){_0x19e7ac[_0x6fe0('0x3')](_0x12bdf3,_0x1ab1d6);};}function removeListener(_0x278229,_0x41e201){return function(){FaxQueueEvents[_0x6fe0('0x4')](_0x278229,_0x41e201);};}exports[_0x6fe0('0x5')]=function(_0x3efc6d){for(var _0x4c3c85=0x0,_0x44f3ed=events['length'];_0x4c3c85<_0x44f3ed;_0x4c3c85++){var _0x13bd80=events[_0x4c3c85];var _0x5f305a=createListener('faxQueue:'+_0x13bd80,_0x3efc6d);FaxQueueEvents['on'](_0x13bd80,_0x5f305a);}}; \ No newline at end of file +var _0x838c=['remove','removeListener','register','faxQueue:','./faxQueue.events','save'];(function(_0x5e670b,_0x303aab){var _0x34b27a=function(_0x36e084){while(--_0x36e084){_0x5e670b['push'](_0x5e670b['shift']());}};_0x34b27a(++_0x303aab);}(_0x838c,0x8e));var _0xc838=function(_0x54cd83,_0x458e75){_0x54cd83=_0x54cd83-0x0;var _0x5e100c=_0x838c[_0x54cd83];return _0x5e100c;};'use strict';var FaxQueueEvents=require(_0xc838('0x0'));var events=[_0xc838('0x1'),_0xc838('0x2'),'update'];function createListener(_0x4ceec0,_0x5f40c5){return function(_0xf017d0){_0x5f40c5['emit'](_0x4ceec0,_0xf017d0);};}function removeListener(_0x31cec3,_0x50d716){return function(){FaxQueueEvents[_0xc838('0x3')](_0x31cec3,_0x50d716);};}exports[_0xc838('0x4')]=function(_0x42367a){for(var _0x5643cf=0x0,_0x316a5a=events['length'];_0x5643cf<_0x316a5a;_0x5643cf++){var _0x870b0e=events[_0x5643cf];var _0x383d43=createListener(_0xc838('0x5')+_0x870b0e,_0x42367a);FaxQueueEvents['on'](_0x870b0e,_0x383d43);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 1406a0e..28591bf 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 _0x5770=['destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','create','/:id/users','put','delete'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5770,0x74));var _0x0577=function(_0x238830,_0x545f75){_0x238830=_0x238830-0x0;var _0x5917f0=_0x5770[_0x238830];return _0x5917f0;};'use strict';var multer=require(_0x0577('0x0'));var util=require(_0x0577('0x1'));var path=require(_0x0577('0x2'));var timeout=require(_0x0577('0x3'));var express=require('express');var router=express[_0x0577('0x4')]();var auth=require(_0x0577('0x5'));var interaction=require(_0x0577('0x6'));var config=require(_0x0577('0x7'));var controller=require(_0x0577('0x8'));router[_0x0577('0x9')]('/',auth[_0x0577('0xa')](),controller['index']);router[_0x0577('0x9')](_0x0577('0xb'),auth[_0x0577('0xa')](),controller[_0x0577('0xc')]);router[_0x0577('0x9')](_0x0577('0xd'),auth[_0x0577('0xa')](),controller[_0x0577('0xe')]);router[_0x0577('0x9')]('/:id/members',auth['isAuthenticated'](),controller[_0x0577('0xf')]);router[_0x0577('0x9')](_0x0577('0x10'),auth['isAuthenticated'](),controller[_0x0577('0x11')]);router[_0x0577('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x0577('0x12')]);router[_0x0577('0x13')]('/',auth[_0x0577('0xa')](),controller[_0x0577('0x14')]);router[_0x0577('0x13')](_0x0577('0x10'),auth['isAuthenticated'](),controller['addTeams']);router[_0x0577('0x13')](_0x0577('0x15'),auth['isAuthenticated'](),controller['addAgents']);router[_0x0577('0x16')](_0x0577('0xd'),auth[_0x0577('0xa')](),controller['update']);router[_0x0577('0x17')](_0x0577('0xd'),auth['isAuthenticated'](),controller[_0x0577('0x18')]);router[_0x0577('0x17')]('/:id/teams',auth[_0x0577('0xa')](),controller[_0x0577('0x19')]);router[_0x0577('0x17')]('/:id/users',auth[_0x0577('0xa')](),controller[_0x0577('0x1a')]);module[_0x0577('0x1b')]=router; \ No newline at end of file +var _0xb0e3=['addTeams','addAgents','put','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create'];(function(_0x3e248b,_0x348af3){var _0x3ca823=function(_0x14176b){while(--_0x14176b){_0x3e248b['push'](_0x3e248b['shift']());}};_0x3ca823(++_0x348af3);}(_0xb0e3,0xa3));var _0x3b0e=function(_0xc6d688,_0x554d63){_0xc6d688=_0xc6d688-0x0;var _0x4fb1a9=_0xb0e3[_0xc6d688];return _0x4fb1a9;};'use strict';var multer=require(_0x3b0e('0x0'));var util=require(_0x3b0e('0x1'));var path=require(_0x3b0e('0x2'));var timeout=require(_0x3b0e('0x3'));var express=require(_0x3b0e('0x4'));var router=express[_0x3b0e('0x5')]();var auth=require(_0x3b0e('0x6'));var interaction=require(_0x3b0e('0x7'));var config=require(_0x3b0e('0x8'));var controller=require('./faxQueue.controller');router[_0x3b0e('0x9')]('/',auth[_0x3b0e('0xa')](),controller[_0x3b0e('0xb')]);router[_0x3b0e('0x9')](_0x3b0e('0xc'),auth[_0x3b0e('0xa')](),controller[_0x3b0e('0xd')]);router[_0x3b0e('0x9')](_0x3b0e('0xe'),auth[_0x3b0e('0xa')](),controller[_0x3b0e('0xf')]);router[_0x3b0e('0x9')](_0x3b0e('0x10'),auth[_0x3b0e('0xa')](),controller[_0x3b0e('0x11')]);router[_0x3b0e('0x9')](_0x3b0e('0x12'),auth[_0x3b0e('0xa')](),controller[_0x3b0e('0x13')]);router[_0x3b0e('0x9')](_0x3b0e('0x14'),auth['isAuthenticated'](),controller['getAgents']);router[_0x3b0e('0x15')]('/',auth[_0x3b0e('0xa')](),controller[_0x3b0e('0x16')]);router[_0x3b0e('0x15')]('/:id/teams',auth[_0x3b0e('0xa')](),controller[_0x3b0e('0x17')]);router['post'](_0x3b0e('0x14'),auth['isAuthenticated'](),controller[_0x3b0e('0x18')]);router[_0x3b0e('0x19')](_0x3b0e('0xe'),auth['isAuthenticated'](),controller[_0x3b0e('0x1a')]);router[_0x3b0e('0x1b')](_0x3b0e('0xe'),auth[_0x3b0e('0xa')](),controller[_0x3b0e('0x1c')]);router[_0x3b0e('0x1b')](_0x3b0e('0x12'),auth[_0x3b0e('0xa')](),controller[_0x3b0e('0x1d')]);router[_0x3b0e('0x1b')]('/:id/users',auth[_0x3b0e('0xa')](),controller['removeAgents']);module[_0x3b0e('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 d6012e0..1d87dc6 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 _0xb42c=['moment','sequelize','exports','STRING','DATE'];(function(_0x312e00,_0x423f1a){var _0x49f4a4=function(_0x2b6536){while(--_0x2b6536){_0x312e00['push'](_0x312e00['shift']());}};_0x49f4a4(++_0x423f1a);}(_0xb42c,0x190));var _0xcb42=function(_0xca606b,_0x2a1ad5){_0xca606b=_0xca606b-0x0;var _0xdaf7c7=_0xb42c[_0xca606b];return _0xdaf7c7;};'use strict';var moment=require(_0xcb42('0x0'));var Sequelize=require(_0xcb42('0x1'));module[_0xcb42('0x2')]={'uniqueid':{'type':Sequelize[_0xcb42('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xcb42('0x3')]},'joinAt':{'type':Sequelize[_0xcb42('0x4')]},'leaveAt':{'type':Sequelize[_0xcb42('0x4')]},'acceptAt':{'type':Sequelize[_0xcb42('0x4')]},'exitAt':{'type':Sequelize[_0xcb42('0x4')]},'reason':{'type':Sequelize[_0xcb42('0x3')]}}; \ No newline at end of file +var _0xf86f=['DATE','moment','sequelize','STRING'];(function(_0x3aaa52,_0xf1e356){var _0x3816e9=function(_0x452268){while(--_0x452268){_0x3aaa52['push'](_0x3aaa52['shift']());}};_0x3816e9(++_0xf1e356);}(_0xf86f,0x1b1));var _0xff86=function(_0x1d70db,_0x142b63){_0x1d70db=_0x1d70db-0x0;var _0x3060c6=_0xf86f[_0x1d70db];return _0x3060c6;};'use strict';var moment=require(_0xff86('0x0'));var Sequelize=require(_0xff86('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xff86('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xff86('0x2')]},'joinAt':{'type':Sequelize[_0xff86('0x3')]},'leaveAt':{'type':Sequelize[_0xff86('0x3')]},'acceptAt':{'type':Sequelize[_0xff86('0x3')]},'exitAt':{'type':Sequelize[_0xff86('0x3')]},'reason':{'type':Sequelize[_0xff86('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 6d0177c..6b758b4 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 _0x9ca0=['model','keys','filters','intersection','fields','attributes','length','hasOwnProperty','query','order','sort','where','filter','merge','map','key','field','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','FaxQueueReport','rawAttributes'];(function(_0x16154e,_0x365bdd){var _0x1ae0c4=function(_0x2e2da5){while(--_0x2e2da5){_0x16154e['push'](_0x16154e['shift']());}};_0x1ae0c4(++_0x365bdd);}(_0x9ca0,0x65));var _0x09ca=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x9ca0[_0x164eca];return _0x2ce562;};'use strict';var pdf=require(_0x09ca('0x0'));var emlformat=require(_0x09ca('0x1'));var rimraf=require(_0x09ca('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x09ca('0x3'));var rp=require(_0x09ca('0x4'));var moment=require('moment');var BPromise=require(_0x09ca('0x5'));var Mustache=require(_0x09ca('0x6'));var util=require('util');var path=require(_0x09ca('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x09ca('0x8'));var fs=require('fs');var _=require(_0x09ca('0x9'));var squel=require(_0x09ca('0xa'));var crypto=require(_0x09ca('0xb'));var jsforce=require(_0x09ca('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x09ca('0xd'));var Papa=require(_0x09ca('0xe'));var Redis=require('ioredis');var authService=require(_0x09ca('0xf'));var qs=require(_0x09ca('0x10'));var hardwareService=require(_0x09ca('0x11'));var logger=require(_0x09ca('0x12'))(_0x09ca('0x13'));var utils=require(_0x09ca('0x14'));var config=require('../../config/environment');var db=require(_0x09ca('0x15'))['db'];function respondWithStatusCode(_0x2e7368,_0x4afa1b){_0x4afa1b=_0x4afa1b||0xcc;return function(_0x16e164){if(_0x16e164){return _0x2e7368['sendStatus'](_0x4afa1b);}return _0x2e7368[_0x09ca('0x16')](_0x4afa1b)[_0x09ca('0x17')]();};}function respondWithResult(_0x4183aa,_0x4e1bae){_0x4e1bae=_0x4e1bae||0xc8;return function(_0x57eda0){if(_0x57eda0){return _0x4183aa[_0x09ca('0x16')](_0x4e1bae)[_0x09ca('0x18')](_0x57eda0);}};}function respondWithFilteredResult(_0x51c520,_0x1250b5){return function(_0xdb0c26){if(_0xdb0c26){var _0x32eb55=_0xdb0c26[_0x09ca('0x19')],_0x29621d=_0x1250b5[_0x09ca('0x1a')],_0xb387a5=_0x1250b5[_0x09ca('0x1a')]+_0x1250b5[_0x09ca('0x1b')],_0x19dbc1;if(_0xb387a5>=_0x32eb55){_0xb387a5=_0x32eb55;_0x19dbc1=0xc8;}else{_0x19dbc1=0xce;}_0x51c520[_0x09ca('0x16')](_0x19dbc1);return _0x51c520[_0x09ca('0x1c')]('Content-Range',_0x29621d+'-'+_0xb387a5+'/'+_0x32eb55)[_0x09ca('0x18')](_0xdb0c26);}return null;};}function patchUpdates(_0x23c9ea){return function(_0xcf0bc0){try{jsonpatch[_0x09ca('0x1d')](_0xcf0bc0,_0x23c9ea,!![]);}catch(_0x206fdb){return BPromise[_0x09ca('0x1e')](_0x206fdb);}return _0xcf0bc0[_0x09ca('0x1f')]();};}function saveUpdates(_0x425396,_0x55077a){return function(_0x26c2c3){if(_0x26c2c3){return _0x26c2c3[_0x09ca('0x20')](_0x425396)[_0x09ca('0x21')](function(_0x53a36b){return _0x53a36b;});}return null;};}function removeEntity(_0x32179f,_0x12c609){return function(_0xacdffd){if(_0xacdffd){return _0xacdffd[_0x09ca('0x22')]()['then'](function(){_0x32179f[_0x09ca('0x16')](0xcc)[_0x09ca('0x17')]();});}};}function handleEntityNotFound(_0x3115d0,_0x37288a){return function(_0x44f036){if(!_0x44f036){_0x3115d0[_0x09ca('0x23')](0x194);}return _0x44f036;};}function handleError(_0x1bb677,_0x4f4a8b){_0x4f4a8b=_0x4f4a8b||0x1f4;return function(_0x2558a3){logger[_0x09ca('0x24')](_0x2558a3[_0x09ca('0x25')]);if(_0x2558a3[_0x09ca('0x26')]){delete _0x2558a3[_0x09ca('0x26')];}_0x1bb677[_0x09ca('0x16')](_0x4f4a8b)[_0x09ca('0x27')](_0x2558a3);};}exports[_0x09ca('0x28')]=function(_0x576466,_0x3338b6){var _0x2a26c4={},_0x864eda={},_0x4b3da5={'count':0x0,'rows':[]};var _0x545a7e=db[_0x09ca('0x29')][_0x09ca('0x2a')];_0x864eda[_0x09ca('0x2b')]=_[_0x09ca('0x2c')](_0x545a7e);_0x864eda['query']=_[_0x09ca('0x2c')](_0x576466['query']);_0x864eda[_0x09ca('0x2d')]=_[_0x09ca('0x2e')](_0x864eda[_0x09ca('0x2b')],_0x864eda['query']);_0x2a26c4['attributes']=_[_0x09ca('0x2e')](_0x864eda[_0x09ca('0x2b')],qs['fields'](_0x576466['query'][_0x09ca('0x2f')]));_0x2a26c4[_0x09ca('0x30')]=_0x2a26c4[_0x09ca('0x30')][_0x09ca('0x31')]?_0x2a26c4[_0x09ca('0x30')]:_0x864eda[_0x09ca('0x2b')];if(!_0x576466['query'][_0x09ca('0x32')]('nolimit')){_0x2a26c4[_0x09ca('0x1b')]=qs[_0x09ca('0x1b')](_0x576466[_0x09ca('0x33')]['limit']);_0x2a26c4[_0x09ca('0x1a')]=qs['offset'](_0x576466[_0x09ca('0x33')]['offset']);}_0x2a26c4[_0x09ca('0x34')]=qs[_0x09ca('0x35')](_0x576466['query'][_0x09ca('0x35')]);_0x2a26c4[_0x09ca('0x36')]=qs[_0x09ca('0x2d')](_['pick'](_0x576466[_0x09ca('0x33')],_0x864eda[_0x09ca('0x2d')]));if(_0x576466[_0x09ca('0x33')][_0x09ca('0x37')]){_0x2a26c4['where']=_[_0x09ca('0x38')](_0x2a26c4[_0x09ca('0x36')],{'$or':_[_0x09ca('0x39')](_0x545a7e,function(_0x45bc48){if(_0x45bc48['type'][_0x09ca('0x3a')]!=='VIRTUAL'){var _0x49af4d={};_0x49af4d[_0x45bc48[_0x09ca('0x3b')]]={'$like':'%'+_0x576466['query'][_0x09ca('0x37')]+'%'};return _0x49af4d;}})});}_0x2a26c4=_[_0x09ca('0x38')]({},_0x2a26c4,_0x576466[_0x09ca('0x3c')]);var _0x1d2118={'where':_0x2a26c4['where']};return db[_0x09ca('0x29')]['count'](_0x1d2118)['then'](function(_0x365637){_0x4b3da5[_0x09ca('0x19')]=_0x365637;if(_0x576466['query'][_0x09ca('0x3d')]){_0x2a26c4[_0x09ca('0x3e')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x09ca('0x3f')](_0x2a26c4);})[_0x09ca('0x21')](function(_0x5306df){_0x4b3da5[_0x09ca('0x40')]=_0x5306df;return _0x4b3da5;})[_0x09ca('0x21')](respondWithFilteredResult(_0x3338b6,_0x2a26c4))[_0x09ca('0x41')](handleError(_0x3338b6,null));};exports[_0x09ca('0x42')]=function(_0x63a49d,_0x2cc8b7){var _0x26f7c2={'raw':!![],'where':{'id':_0x63a49d['params']['id']}},_0x3777f4={};_0x3777f4[_0x09ca('0x2b')]=_[_0x09ca('0x2c')](db[_0x09ca('0x29')][_0x09ca('0x2a')]);_0x3777f4[_0x09ca('0x33')]=_[_0x09ca('0x2c')](_0x63a49d[_0x09ca('0x33')]);_0x3777f4['filters']=_[_0x09ca('0x2e')](_0x3777f4['model'],_0x3777f4[_0x09ca('0x33')]);_0x26f7c2['attributes']=_[_0x09ca('0x2e')](_0x3777f4[_0x09ca('0x2b')],qs[_0x09ca('0x2f')](_0x63a49d[_0x09ca('0x33')][_0x09ca('0x2f')]));_0x26f7c2[_0x09ca('0x30')]=_0x26f7c2['attributes'][_0x09ca('0x31')]?_0x26f7c2[_0x09ca('0x30')]:_0x3777f4[_0x09ca('0x2b')];if(_0x63a49d[_0x09ca('0x33')][_0x09ca('0x3d')]){_0x26f7c2[_0x09ca('0x3e')]=[{'all':!![]}];}_0x26f7c2=_[_0x09ca('0x38')]({},_0x26f7c2,_0x63a49d[_0x09ca('0x3c')]);return db['FaxQueueReport'][_0x09ca('0x43')](_0x26f7c2)[_0x09ca('0x21')](handleEntityNotFound(_0x2cc8b7,null))[_0x09ca('0x21')](respondWithResult(_0x2cc8b7,null))[_0x09ca('0x41')](handleError(_0x2cc8b7,null));};exports[_0x09ca('0x44')]=function(_0x2a68d4,_0x582952){return db[_0x09ca('0x29')]['create'](_0x2a68d4[_0x09ca('0x45')],{})[_0x09ca('0x21')](respondWithResult(_0x582952,0xc9))[_0x09ca('0x41')](handleError(_0x582952,null));};exports[_0x09ca('0x20')]=function(_0x3dc483,_0xf741c0){if(_0x3dc483[_0x09ca('0x45')]['id']){delete _0x3dc483[_0x09ca('0x45')]['id'];}return db[_0x09ca('0x29')]['find']({'where':{'id':_0x3dc483[_0x09ca('0x46')]['id']}})[_0x09ca('0x21')](handleEntityNotFound(_0xf741c0,null))[_0x09ca('0x21')](saveUpdates(_0x3dc483[_0x09ca('0x45')],null))[_0x09ca('0x21')](respondWithResult(_0xf741c0,null))[_0x09ca('0x41')](handleError(_0xf741c0,null));};exports['destroy']=function(_0x2004ea,_0x3a2a3b){return db[_0x09ca('0x29')][_0x09ca('0x43')]({'where':{'id':_0x2004ea[_0x09ca('0x46')]['id']}})[_0x09ca('0x21')](handleEntityNotFound(_0x3a2a3b,null))[_0x09ca('0x21')](removeEntity(_0x3a2a3b,null))[_0x09ca('0x41')](handleError(_0x3a2a3b,null));};exports[_0x09ca('0x47')]=function(_0x1ca4c2,_0x311fc1){return db[_0x09ca('0x29')]['describe']()[_0x09ca('0x21')](respondWithResult(_0x311fc1,null))[_0x09ca('0x41')](handleError(_0x311fc1,null));}; \ No newline at end of file +var _0xa87e=['include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','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','../../config/environment','sendStatus','status','json','offset','limit','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','FaxQueueReport','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','key','VIRTUAL','options'];(function(_0x24127f,_0x4e254e){var _0x48414b=function(_0x3e0f61){while(--_0x3e0f61){_0x24127f['push'](_0x24127f['shift']());}};_0x48414b(++_0x4e254e);}(_0xa87e,0x1c2));var _0xea87=function(_0x1d6a92,_0x7eaf6d){_0x1d6a92=_0x1d6a92-0x0;var _0xeffe66=_0xa87e[_0x1d6a92];return _0xeffe66;};'use strict';var pdf=require(_0xea87('0x0'));var emlformat=require(_0xea87('0x1'));var rimraf=require(_0xea87('0x2'));var zipdir=require(_0xea87('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xea87('0x4'));var moment=require(_0xea87('0x5'));var BPromise=require(_0xea87('0x6'));var Mustache=require('mustache');var util=require(_0xea87('0x7'));var path=require(_0xea87('0x8'));var sox=require(_0xea87('0x9'));var csv=require(_0xea87('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xea87('0xb'));var squel=require(_0xea87('0xc'));var crypto=require(_0xea87('0xd'));var jsforce=require(_0xea87('0xe'));var deskjs=require(_0xea87('0xf'));var toCsv=require(_0xea87('0xa'));var querystring=require(_0xea87('0x10'));var Papa=require(_0xea87('0x11'));var Redis=require(_0xea87('0x12'));var authService=require(_0xea87('0x13'));var qs=require(_0xea87('0x14'));var hardwareService=require(_0xea87('0x15'));var logger=require('../../config/logger')(_0xea87('0x16'));var utils=require(_0xea87('0x17'));var config=require(_0xea87('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x140800,_0x47dc78){_0x47dc78=_0x47dc78||0xcc;return function(_0xcfefe4){if(_0xcfefe4){return _0x140800[_0xea87('0x19')](_0x47dc78);}return _0x140800[_0xea87('0x1a')](_0x47dc78)['end']();};}function respondWithResult(_0x33cf42,_0xc259cf){_0xc259cf=_0xc259cf||0xc8;return function(_0xe33198){if(_0xe33198){return _0x33cf42[_0xea87('0x1a')](_0xc259cf)[_0xea87('0x1b')](_0xe33198);}};}function respondWithFilteredResult(_0x156432,_0x36998c){return function(_0x488658){if(_0x488658){var _0x2f170f=_0x488658['count'],_0x4f3b7d=_0x36998c[_0xea87('0x1c')],_0x58622e=_0x36998c[_0xea87('0x1c')]+_0x36998c[_0xea87('0x1d')],_0x5bfe90;if(_0x58622e>=_0x2f170f){_0x58622e=_0x2f170f;_0x5bfe90=0xc8;}else{_0x5bfe90=0xce;}_0x156432['status'](_0x5bfe90);return _0x156432['set']('Content-Range',_0x4f3b7d+'-'+_0x58622e+'/'+_0x2f170f)[_0xea87('0x1b')](_0x488658);}return null;};}function patchUpdates(_0x303c65){return function(_0x83e816){try{jsonpatch[_0xea87('0x1e')](_0x83e816,_0x303c65,!![]);}catch(_0x4b42a1){return BPromise[_0xea87('0x1f')](_0x4b42a1);}return _0x83e816[_0xea87('0x20')]();};}function saveUpdates(_0x115c1c,_0x565eba){return function(_0x57ee13){if(_0x57ee13){return _0x57ee13[_0xea87('0x21')](_0x115c1c)[_0xea87('0x22')](function(_0x1f449f){return _0x1f449f;});}return null;};}function removeEntity(_0x1c401f,_0x282a07){return function(_0x41cf0c){if(_0x41cf0c){return _0x41cf0c[_0xea87('0x23')]()[_0xea87('0x22')](function(){_0x1c401f['status'](0xcc)[_0xea87('0x24')]();});}};}function handleEntityNotFound(_0x275a7a,_0x5a0ea1){return function(_0x233058){if(!_0x233058){_0x275a7a[_0xea87('0x19')](0x194);}return _0x233058;};}function handleError(_0x246652,_0x356267){_0x356267=_0x356267||0x1f4;return function(_0x5edc4f){logger[_0xea87('0x25')](_0x5edc4f[_0xea87('0x26')]);if(_0x5edc4f['name']){delete _0x5edc4f[_0xea87('0x27')];}_0x246652['status'](_0x356267)[_0xea87('0x28')](_0x5edc4f);};}exports[_0xea87('0x29')]=function(_0x417847,_0x20fbb0){var _0x476a90={},_0x2c2503={},_0x7a78b1={'count':0x0,'rows':[]};var _0x355070=db[_0xea87('0x2a')]['rawAttributes'];_0x2c2503['model']=_[_0xea87('0x2b')](_0x355070);_0x2c2503[_0xea87('0x2c')]=_[_0xea87('0x2b')](_0x417847[_0xea87('0x2c')]);_0x2c2503[_0xea87('0x2d')]=_[_0xea87('0x2e')](_0x2c2503[_0xea87('0x2f')],_0x2c2503[_0xea87('0x2c')]);_0x476a90['attributes']=_['intersection'](_0x2c2503[_0xea87('0x2f')],qs[_0xea87('0x30')](_0x417847['query'][_0xea87('0x30')]));_0x476a90[_0xea87('0x31')]=_0x476a90[_0xea87('0x31')][_0xea87('0x32')]?_0x476a90['attributes']:_0x2c2503[_0xea87('0x2f')];if(!_0x417847[_0xea87('0x2c')][_0xea87('0x33')]('nolimit')){_0x476a90['limit']=qs[_0xea87('0x1d')](_0x417847[_0xea87('0x2c')][_0xea87('0x1d')]);_0x476a90['offset']=qs[_0xea87('0x1c')](_0x417847[_0xea87('0x2c')][_0xea87('0x1c')]);}_0x476a90[_0xea87('0x34')]=qs[_0xea87('0x35')](_0x417847[_0xea87('0x2c')][_0xea87('0x35')]);_0x476a90['where']=qs[_0xea87('0x2d')](_[_0xea87('0x36')](_0x417847[_0xea87('0x2c')],_0x2c2503[_0xea87('0x2d')]));if(_0x417847[_0xea87('0x2c')][_0xea87('0x37')]){_0x476a90[_0xea87('0x38')]=_[_0xea87('0x39')](_0x476a90[_0xea87('0x38')],{'$or':_['map'](_0x355070,function(_0x303f8e){if(_0x303f8e['type'][_0xea87('0x3a')]!==_0xea87('0x3b')){var _0x54a62a={};_0x54a62a[_0x303f8e['field']]={'$like':'%'+_0x417847[_0xea87('0x2c')][_0xea87('0x37')]+'%'};return _0x54a62a;}})});}_0x476a90=_[_0xea87('0x39')]({},_0x476a90,_0x417847[_0xea87('0x3c')]);var _0xfda36={'where':_0x476a90[_0xea87('0x38')]};return db['FaxQueueReport']['count'](_0xfda36)['then'](function(_0x4eda02){_0x7a78b1['count']=_0x4eda02;if(_0x417847['query']['includeAll']){_0x476a90[_0xea87('0x3d')]=[{'all':!![]}];}return db['FaxQueueReport'][_0xea87('0x3e')](_0x476a90);})[_0xea87('0x22')](function(_0x4071dd){_0x7a78b1[_0xea87('0x3f')]=_0x4071dd;return _0x7a78b1;})['then'](respondWithFilteredResult(_0x20fbb0,_0x476a90))[_0xea87('0x40')](handleError(_0x20fbb0,null));};exports[_0xea87('0x41')]=function(_0x54ce57,_0x4c9138){var _0x59e7f0={'raw':!![],'where':{'id':_0x54ce57[_0xea87('0x42')]['id']}},_0x3f8a01={};_0x3f8a01['model']=_['keys'](db['FaxQueueReport'][_0xea87('0x43')]);_0x3f8a01['query']=_[_0xea87('0x2b')](_0x54ce57['query']);_0x3f8a01[_0xea87('0x2d')]=_[_0xea87('0x2e')](_0x3f8a01[_0xea87('0x2f')],_0x3f8a01[_0xea87('0x2c')]);_0x59e7f0[_0xea87('0x31')]=_[_0xea87('0x2e')](_0x3f8a01[_0xea87('0x2f')],qs[_0xea87('0x30')](_0x54ce57[_0xea87('0x2c')][_0xea87('0x30')]));_0x59e7f0[_0xea87('0x31')]=_0x59e7f0[_0xea87('0x31')][_0xea87('0x32')]?_0x59e7f0[_0xea87('0x31')]:_0x3f8a01[_0xea87('0x2f')];if(_0x54ce57[_0xea87('0x2c')][_0xea87('0x44')]){_0x59e7f0[_0xea87('0x3d')]=[{'all':!![]}];}_0x59e7f0=_[_0xea87('0x39')]({},_0x59e7f0,_0x54ce57['options']);return db[_0xea87('0x2a')][_0xea87('0x45')](_0x59e7f0)[_0xea87('0x22')](handleEntityNotFound(_0x4c9138,null))[_0xea87('0x22')](respondWithResult(_0x4c9138,null))['catch'](handleError(_0x4c9138,null));};exports[_0xea87('0x46')]=function(_0x3b8973,_0x2af5b2){return db[_0xea87('0x2a')][_0xea87('0x46')](_0x3b8973[_0xea87('0x47')],{})[_0xea87('0x22')](respondWithResult(_0x2af5b2,0xc9))[_0xea87('0x40')](handleError(_0x2af5b2,null));};exports[_0xea87('0x21')]=function(_0x245d40,_0x573e04){if(_0x245d40[_0xea87('0x47')]['id']){delete _0x245d40[_0xea87('0x47')]['id'];}return db[_0xea87('0x2a')][_0xea87('0x45')]({'where':{'id':_0x245d40['params']['id']}})[_0xea87('0x22')](handleEntityNotFound(_0x573e04,null))[_0xea87('0x22')](saveUpdates(_0x245d40[_0xea87('0x47')],null))[_0xea87('0x22')](respondWithResult(_0x573e04,null))[_0xea87('0x40')](handleError(_0x573e04,null));};exports[_0xea87('0x23')]=function(_0x790e2,_0x5df2c4){return db[_0xea87('0x2a')][_0xea87('0x45')]({'where':{'id':_0x790e2[_0xea87('0x42')]['id']}})['then'](handleEntityNotFound(_0x5df2c4,null))[_0xea87('0x22')](removeEntity(_0x5df2c4,null))[_0xea87('0x40')](handleError(_0x5df2c4,null));};exports[_0xea87('0x48')]=function(_0x1c4811,_0x4f8d2a){return db['FaxQueueReport'][_0xea87('0x48')]()[_0xea87('0x22')](respondWithResult(_0x4f8d2a,null))['catch'](handleError(_0x4f8d2a,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index c5f3eac..9609bb5 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 _0x7ba8=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport'];(function(_0x611fb3,_0x522c33){var _0x4b3b46=function(_0x27b485){while(--_0x27b485){_0x611fb3['push'](_0x611fb3['shift']());}};_0x4b3b46(++_0x522c33);}(_0x7ba8,0x153));var _0x87ba=function(_0x482b20,_0x1f2834){_0x482b20=_0x482b20-0x0;var _0xd93e33=_0x7ba8[_0x482b20];return _0xd93e33;};'use strict';var _=require(_0x87ba('0x0'));var util=require(_0x87ba('0x1'));var logger=require(_0x87ba('0x2'))(_0x87ba('0x3'));var moment=require(_0x87ba('0x4'));var BPromise=require(_0x87ba('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x87ba('0x6'));var rimraf=require(_0x87ba('0x7'));var config=require(_0x87ba('0x8'));var attributes=require(_0x87ba('0x9'));module['exports']=function(_0x3d5b0d,_0x3c3ea9){return _0x3d5b0d[_0x87ba('0xa')](_0x87ba('0xb'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x87ba('0xc'),'fields':[_0x87ba('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9322=['path','../../config/environment','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise'];(function(_0xc31458,_0x45ee76){var _0x1b4a90=function(_0x1a49b0){while(--_0x1a49b0){_0xc31458['push'](_0xc31458['shift']());}};_0x1b4a90(++_0x45ee76);}(_0x9322,0x89));var _0x2932=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9322[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x2932('0x0'));var util=require(_0x2932('0x1'));var logger=require('../../config/logger')(_0x2932('0x2'));var moment=require(_0x2932('0x3'));var BPromise=require(_0x2932('0x4'));var rp=require(_0x2932('0x5'));var fs=require('fs');var path=require(_0x2932('0x6'));var rimraf=require('rimraf');var config=require(_0x2932('0x7'));var attributes=require('./faxQueueReport.attributes');module[_0x2932('0x8')]=function(_0xbcbe1a,_0x5173ec){return _0xbcbe1a[_0x2932('0x9')](_0x2932('0xa'),attributes,{'tableName':_0x2932('0xb'),'paranoid':![],'indexes':[{'name':_0x2932('0xc'),'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 261a342..cea8fcd 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 _0xda3f=['code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','attributes','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xda3f,0xec));var _0xfda3=function(_0x57a71f,_0x399c13){_0x57a71f=_0x57a71f-0x0;var _0x2a1d71=_0xda3f[_0x57a71f];return _0x2a1d71;};'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});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});}exports[_0xfda3('0x14')]=function(_0x4680bf){var _0xc62ae6=this;return new Promise(function(_0x54a7c6,_0x15ddb9){return db[_0xfda3('0x15')][_0xfda3('0x16')](_0x4680bf[_0xfda3('0x17')],{'raw':_0x4680bf['options']?_0x4680bf[_0xfda3('0x18')][_0xfda3('0x19')]===undefined?!![]:![]:!![]})[_0xfda3('0x8')](function(_0x51e731){logger['info'](_0xfda3('0x14'),_0x4680bf);logger[_0xfda3('0xc')](_0xfda3('0x14'),_0x4680bf,JSON['stringify'](_0x51e731));_0x54a7c6(_0x51e731);})[_0xfda3('0x13')](function(_0xef2535){logger[_0xfda3('0xf')](_0xfda3('0x14'),_0xef2535[_0xfda3('0x11')],_0x4680bf);_0x15ddb9(_0xc62ae6[_0xfda3('0xf')](0x1f4,_0xef2535[_0xfda3('0x11')]));});});};exports[_0xfda3('0x1a')]=function(_0x16eaa6){var _0x5499f5=this;return new Promise(function(_0x82341b,_0x2d5b44){return db[_0xfda3('0x15')]['update'](_0x16eaa6[_0xfda3('0x17')],{'raw':_0x16eaa6[_0xfda3('0x18')]?_0x16eaa6[_0xfda3('0x18')][_0xfda3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16eaa6[_0xfda3('0x18')]?_0x16eaa6[_0xfda3('0x18')]['where']||null:null,'attributes':_0x16eaa6[_0xfda3('0x18')]?_0x16eaa6[_0xfda3('0x18')][_0xfda3('0x1b')]||null:null,'limit':_0x16eaa6[_0xfda3('0x18')]?_0x16eaa6[_0xfda3('0x18')]['limit']||null:null})[_0xfda3('0x8')](function(_0x4101b1){logger[_0xfda3('0x9')](_0xfda3('0x1a'),_0x16eaa6);logger[_0xfda3('0xc')](_0xfda3('0x1a'),_0x16eaa6,JSON[_0xfda3('0xe')](_0x4101b1));_0x82341b(_0x4101b1);})['catch'](function(_0x56ca3a){logger[_0xfda3('0xf')]('UpdateFaxQueueReport',_0x56ca3a['message'],_0x16eaa6);_0x2d5b44(_0x5499f5[_0xfda3('0xf')](0x1f4,_0x56ca3a[_0xfda3('0x11')]));});});}; \ No newline at end of file +var _0xe890=['FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','update','where','attributes','UpdateFaxQueueReport','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info'];(function(_0x151e04,_0x1d9110){var _0x12da30=function(_0x43168c){while(--_0x43168c){_0x151e04['push'](_0x151e04['shift']());}};_0x12da30(++_0x1d9110);}(_0xe890,0x1a6));var _0x0e89=function(_0x4e0763,_0x57c216){_0x4e0763=_0x4e0763-0x0;var _0x56e87d=_0xe890[_0x4e0763];return _0x56e87d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0e89('0x0'));var BPromise=require(_0x0e89('0x1'));var rs=require(_0x0e89('0x2'));var fs=require('fs');var Redis=require(_0x0e89('0x3'));var db=require(_0x0e89('0x4'))['db'];var utils=require(_0x0e89('0x5'));var logger=require(_0x0e89('0x6'))(_0x0e89('0x7'));var config=require(_0x0e89('0x8'));var jayson=require(_0x0e89('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x38ef9d,_0x4568a8,_0x50f325){return new BPromise(function(_0x17cf6a,_0x23655f){return client['request'](_0x38ef9d,_0x50f325)[_0x0e89('0xa')](function(_0x3f9333){logger[_0x0e89('0xb')](_0x0e89('0xc'),_0x4568a8,_0x0e89('0xd'));logger[_0x0e89('0xe')](_0x0e89('0xf'),_0x4568a8,_0x0e89('0xd'),JSON[_0x0e89('0x10')](_0x3f9333));if(_0x3f9333['error']){if(_0x3f9333['error']['code']===0x1f4){logger['error'](_0x0e89('0xc'),_0x4568a8,_0x3f9333[_0x0e89('0x11')][_0x0e89('0x12')]);return _0x23655f(_0x3f9333[_0x0e89('0x11')]['message']);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x4568a8,_0x3f9333[_0x0e89('0x11')][_0x0e89('0x12')]);return _0x17cf6a(_0x3f9333[_0x0e89('0x11')][_0x0e89('0x12')]);}else{logger[_0x0e89('0xb')](_0x0e89('0xc'),_0x4568a8,_0x0e89('0xd'));_0x17cf6a(_0x3f9333[_0x0e89('0x13')][_0x0e89('0x12')]);}})[_0x0e89('0x14')](function(_0x40f9a6){logger[_0x0e89('0x11')](_0x0e89('0xc'),_0x4568a8,_0x40f9a6);_0x23655f(_0x40f9a6);});});}exports[_0x0e89('0x15')]=function(_0x32de6d){var _0x9cf6c4=this;return new Promise(function(_0xac40ac,_0x40eb1d){return db[_0x0e89('0x16')][_0x0e89('0x17')](_0x32de6d[_0x0e89('0x18')],{'raw':_0x32de6d['options']?_0x32de6d[_0x0e89('0x19')][_0x0e89('0x1a')]===undefined?!![]:![]:!![]})[_0x0e89('0xa')](function(_0x2e83b6){logger[_0x0e89('0xb')](_0x0e89('0x15'),_0x32de6d);logger[_0x0e89('0xe')](_0x0e89('0x15'),_0x32de6d,JSON[_0x0e89('0x10')](_0x2e83b6));_0xac40ac(_0x2e83b6);})[_0x0e89('0x14')](function(_0x2c641d){logger[_0x0e89('0x11')](_0x0e89('0x15'),_0x2c641d[_0x0e89('0x12')],_0x32de6d);_0x40eb1d(_0x9cf6c4['error'](0x1f4,_0x2c641d['message']));});});};exports['UpdateFaxQueueReport']=function(_0x1ad62c){var _0x8d02e2=this;return new Promise(function(_0x368889,_0x28f84b){return db['FaxQueueReport'][_0x0e89('0x1b')](_0x1ad62c[_0x0e89('0x18')],{'raw':_0x1ad62c[_0x0e89('0x19')]?_0x1ad62c['options'][_0x0e89('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ad62c['options']?_0x1ad62c[_0x0e89('0x19')][_0x0e89('0x1c')]||null:null,'attributes':_0x1ad62c[_0x0e89('0x19')]?_0x1ad62c[_0x0e89('0x19')][_0x0e89('0x1d')]||null:null,'limit':_0x1ad62c[_0x0e89('0x19')]?_0x1ad62c[_0x0e89('0x19')]['limit']||null:null})[_0x0e89('0xa')](function(_0x14b857){logger[_0x0e89('0xb')](_0x0e89('0x1e'),_0x1ad62c);logger[_0x0e89('0xe')](_0x0e89('0x1e'),_0x1ad62c,JSON['stringify'](_0x14b857));_0x368889(_0x14b857);})[_0x0e89('0x14')](function(_0x13c4ce){logger[_0x0e89('0x11')]('UpdateFaxQueueReport',_0x13c4ce[_0x0e89('0x12')],_0x1ad62c);_0x28f84b(_0x8d02e2[_0x0e89('0x11')](0x1f4,_0x13c4ce[_0x0e89('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 12a02c0..714dc69 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 _0xe4de=['../../config/environment','get','isAuthenticated','describe','/:id','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x58238f,_0x3a35e9){var _0x5abc74=function(_0x15a2fe){while(--_0x15a2fe){_0x58238f['push'](_0x58238f['shift']());}};_0x5abc74(++_0x3a35e9);}(_0xe4de,0x1bb));var _0xee4d=function(_0x1ba6e8,_0x32e20e){_0x1ba6e8=_0x1ba6e8-0x0;var _0x458eaa=_0xe4de[_0x1ba6e8];return _0x458eaa;};'use strict';var multer=require(_0xee4d('0x0'));var util=require(_0xee4d('0x1'));var path=require(_0xee4d('0x2'));var timeout=require(_0xee4d('0x3'));var express=require('express');var router=express[_0xee4d('0x4')]();var auth=require(_0xee4d('0x5'));var interaction=require(_0xee4d('0x6'));var config=require(_0xee4d('0x7'));var controller=require('./faxQueueReport.controller');router[_0xee4d('0x8')]('/',auth[_0xee4d('0x9')](),controller['index']);router[_0xee4d('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xee4d('0xa')]);router[_0xee4d('0x8')](_0xee4d('0xb'),auth[_0xee4d('0x9')](),controller['show']);router[_0xee4d('0xc')]('/',auth[_0xee4d('0x9')](),controller[_0xee4d('0xd')]);router['put'](_0xee4d('0xb'),auth[_0xee4d('0x9')](),controller[_0xee4d('0xe')]);router[_0xee4d('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xee4d('0x10')]);module[_0xee4d('0x11')]=router; \ No newline at end of file +var _0xe0ec=['index','describe','/:id','show','post','create','update','exports','multer','util','path','express','../../config/environment','./faxQueueReport.controller','get','isAuthenticated'];(function(_0x28a266,_0xa1d8a4){var _0x3129c6=function(_0x1a9fbf){while(--_0x1a9fbf){_0x28a266['push'](_0x28a266['shift']());}};_0x3129c6(++_0xa1d8a4);}(_0xe0ec,0x78));var _0xce0e=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xe0ec[_0x5834bc];return _0x3e183a;};'use strict';var multer=require(_0xce0e('0x0'));var util=require(_0xce0e('0x1'));var path=require(_0xce0e('0x2'));var timeout=require('connect-timeout');var express=require(_0xce0e('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xce0e('0x4'));var controller=require(_0xce0e('0x5'));router[_0xce0e('0x6')]('/',auth[_0xce0e('0x7')](),controller[_0xce0e('0x8')]);router[_0xce0e('0x6')]('/describe',auth[_0xce0e('0x7')](),controller[_0xce0e('0x9')]);router['get'](_0xce0e('0xa'),auth[_0xce0e('0x7')](),controller[_0xce0e('0xb')]);router[_0xce0e('0xc')]('/',auth['isAuthenticated'](),controller[_0xce0e('0xd')]);router['put'](_0xce0e('0xa'),auth[_0xce0e('0x7')](),controller[_0xce0e('0xe')]);router['delete'](_0xce0e('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xce0e('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index a479892..3702737 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 _0x345a=['sequelize','exports','STRING','ENUM','queue','DATE','NOW'];(function(_0x1be658,_0x4cae36){var _0x47dcae=function(_0x12f0cf){while(--_0x12f0cf){_0x1be658['push'](_0x1be658['shift']());}};_0x47dcae(++_0x4cae36);}(_0x345a,0x1ce));var _0xa345=function(_0x110a18,_0x3425bd){_0x110a18=_0x110a18-0x0;var _0x44a702=_0x345a[_0x110a18];return _0x44a702;};'use strict';var moment=require('moment');var Sequelize=require(_0xa345('0x0'));module[_0xa345('0x1')]={'uniqueid':{'type':Sequelize[_0xa345('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa345('0x3')]('account','agent','queue'),'allowNull':![],'defaultValue':_0xa345('0x4')},'transferredAt':{'type':Sequelize[_0xa345('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xa345('0x6')]}}; \ No newline at end of file +var _0x04bd=['DATE','moment','sequelize','exports','ENUM','account','agent','queue'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x04bd,0x1a1));var _0xd04b=function(_0x5233cf,_0xc3f969){_0x5233cf=_0x5233cf-0x0;var _0x437e9c=_0x04bd[_0x5233cf];return _0x437e9c;};'use strict';var moment=require(_0xd04b('0x0'));var Sequelize=require(_0xd04b('0x1'));module[_0xd04b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xd04b('0x3')](_0xd04b('0x4'),_0xd04b('0x5'),_0xd04b('0x6')),'allowNull':![],'defaultValue':_0xd04b('0x6')},'transferredAt':{'type':Sequelize[_0xd04b('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 2b27cbc..d28e68d 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 _0xbe02=['error','stack','name','send','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','key','VIRTUAL','field','options','FaxTransferReport','include','findAll','rows','show','params','includeAll','find','catch','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xbe02,0x146));var _0x2be0=function(_0x504354,_0xee38c9){_0x504354=_0x504354-0x0;var _0x52551e=_0xbe02[_0x504354];return _0x52551e;};'use strict';var pdf=require(_0x2be0('0x0'));var emlformat=require(_0x2be0('0x1'));var rimraf=require(_0x2be0('0x2'));var zipdir=require(_0x2be0('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2be0('0x4'));var moment=require(_0x2be0('0x5'));var BPromise=require(_0x2be0('0x6'));var Mustache=require(_0x2be0('0x7'));var util=require(_0x2be0('0x8'));var path=require(_0x2be0('0x9'));var sox=require(_0x2be0('0xa'));var csv=require(_0x2be0('0xb'));var ejs=require(_0x2be0('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2be0('0xd'));var jsforce=require(_0x2be0('0xe'));var deskjs=require(_0x2be0('0xf'));var toCsv=require(_0x2be0('0xb'));var querystring=require(_0x2be0('0x10'));var Papa=require(_0x2be0('0x11'));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('../../config/logger')('api');var utils=require(_0x2be0('0x12'));var config=require(_0x2be0('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x88b5a2,_0x19c73a){_0x19c73a=_0x19c73a||0xcc;return function(_0x204a1f){if(_0x204a1f){return _0x88b5a2[_0x2be0('0x14')](_0x19c73a);}return _0x88b5a2[_0x2be0('0x15')](_0x19c73a)[_0x2be0('0x16')]();};}function respondWithResult(_0x4705a1,_0x3b47ab){_0x3b47ab=_0x3b47ab||0xc8;return function(_0x135d01){if(_0x135d01){return _0x4705a1[_0x2be0('0x15')](_0x3b47ab)['json'](_0x135d01);}};}function respondWithFilteredResult(_0x2d14d6,_0x422a66){return function(_0x5cda7b){if(_0x5cda7b){var _0x8bdce0=_0x5cda7b[_0x2be0('0x17')],_0x1e0c27=_0x422a66[_0x2be0('0x18')],_0x5bcbc5=_0x422a66[_0x2be0('0x18')]+_0x422a66[_0x2be0('0x19')],_0x334070;if(_0x5bcbc5>=_0x8bdce0){_0x5bcbc5=_0x8bdce0;_0x334070=0xc8;}else{_0x334070=0xce;}_0x2d14d6[_0x2be0('0x15')](_0x334070);return _0x2d14d6[_0x2be0('0x1a')](_0x2be0('0x1b'),_0x1e0c27+'-'+_0x5bcbc5+'/'+_0x8bdce0)[_0x2be0('0x1c')](_0x5cda7b);}return null;};}function patchUpdates(_0x35da90){return function(_0x1aaeec){try{jsonpatch[_0x2be0('0x1d')](_0x1aaeec,_0x35da90,!![]);}catch(_0x361f25){return BPromise[_0x2be0('0x1e')](_0x361f25);}return _0x1aaeec[_0x2be0('0x1f')]();};}function saveUpdates(_0x34a485,_0x3bf2ba){return function(_0x4c8afc){if(_0x4c8afc){return _0x4c8afc['update'](_0x34a485)[_0x2be0('0x20')](function(_0x53445b){return _0x53445b;});}return null;};}function removeEntity(_0x5d1a32,_0x40cc4d){return function(_0x4d2c62){if(_0x4d2c62){return _0x4d2c62[_0x2be0('0x21')]()[_0x2be0('0x20')](function(){_0x5d1a32[_0x2be0('0x15')](0xcc)[_0x2be0('0x16')]();});}};}function handleEntityNotFound(_0x105fa6,_0x72018a){return function(_0x494fb4){if(!_0x494fb4){_0x105fa6[_0x2be0('0x14')](0x194);}return _0x494fb4;};}function handleError(_0x498c62,_0x5e7fd2){_0x5e7fd2=_0x5e7fd2||0x1f4;return function(_0x2fd80f){logger[_0x2be0('0x22')](_0x2fd80f[_0x2be0('0x23')]);if(_0x2fd80f[_0x2be0('0x24')]){delete _0x2fd80f[_0x2be0('0x24')];}_0x498c62[_0x2be0('0x15')](_0x5e7fd2)[_0x2be0('0x25')](_0x2fd80f);};}exports['index']=function(_0x1c24be,_0x2a605b){var _0x559a66={},_0x5260d3={},_0x1fd3eb={'count':0x0,'rows':[]};var _0x20f866=db['FaxTransferReport'][_0x2be0('0x26')];_0x5260d3[_0x2be0('0x27')]=_[_0x2be0('0x28')](_0x20f866);_0x5260d3[_0x2be0('0x29')]=_[_0x2be0('0x28')](_0x1c24be[_0x2be0('0x29')]);_0x5260d3[_0x2be0('0x2a')]=_['intersection'](_0x5260d3[_0x2be0('0x27')],_0x5260d3['query']);_0x559a66[_0x2be0('0x2b')]=_[_0x2be0('0x2c')](_0x5260d3[_0x2be0('0x27')],qs[_0x2be0('0x2d')](_0x1c24be[_0x2be0('0x29')][_0x2be0('0x2d')]));_0x559a66[_0x2be0('0x2b')]=_0x559a66['attributes'][_0x2be0('0x2e')]?_0x559a66[_0x2be0('0x2b')]:_0x5260d3[_0x2be0('0x27')];if(!_0x1c24be[_0x2be0('0x29')][_0x2be0('0x2f')]('nolimit')){_0x559a66[_0x2be0('0x19')]=qs[_0x2be0('0x19')](_0x1c24be[_0x2be0('0x29')][_0x2be0('0x19')]);_0x559a66[_0x2be0('0x18')]=qs['offset'](_0x1c24be['query'][_0x2be0('0x18')]);}_0x559a66[_0x2be0('0x30')]=qs[_0x2be0('0x31')](_0x1c24be['query']['sort']);_0x559a66['where']=qs[_0x2be0('0x2a')](_[_0x2be0('0x32')](_0x1c24be[_0x2be0('0x29')],_0x5260d3[_0x2be0('0x2a')]));if(_0x1c24be[_0x2be0('0x29')][_0x2be0('0x33')]){_0x559a66[_0x2be0('0x34')]=_[_0x2be0('0x35')](_0x559a66[_0x2be0('0x34')],{'$or':_[_0x2be0('0x36')](_0x20f866,function(_0x44ad27){if(_0x44ad27['type'][_0x2be0('0x37')]!==_0x2be0('0x38')){var _0x42edd5={};_0x42edd5[_0x44ad27[_0x2be0('0x39')]]={'$like':'%'+_0x1c24be[_0x2be0('0x29')]['filter']+'%'};return _0x42edd5;}})});}_0x559a66=_[_0x2be0('0x35')]({},_0x559a66,_0x1c24be[_0x2be0('0x3a')]);var _0x2b646c={'where':_0x559a66['where']};return db[_0x2be0('0x3b')]['count'](_0x2b646c)[_0x2be0('0x20')](function(_0x52ae2f){_0x1fd3eb['count']=_0x52ae2f;if(_0x1c24be[_0x2be0('0x29')]['includeAll']){_0x559a66[_0x2be0('0x3c')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x2be0('0x3d')](_0x559a66);})['then'](function(_0x25c858){_0x1fd3eb[_0x2be0('0x3e')]=_0x25c858;return _0x1fd3eb;})[_0x2be0('0x20')](respondWithFilteredResult(_0x2a605b,_0x559a66))['catch'](handleError(_0x2a605b,null));};exports[_0x2be0('0x3f')]=function(_0x4a8d11,_0x103608){var _0x1a031d={'raw':!![],'where':{'id':_0x4a8d11[_0x2be0('0x40')]['id']}},_0x21683a={};_0x21683a[_0x2be0('0x27')]=_[_0x2be0('0x28')](db[_0x2be0('0x3b')][_0x2be0('0x26')]);_0x21683a[_0x2be0('0x29')]=_[_0x2be0('0x28')](_0x4a8d11[_0x2be0('0x29')]);_0x21683a[_0x2be0('0x2a')]=_[_0x2be0('0x2c')](_0x21683a[_0x2be0('0x27')],_0x21683a[_0x2be0('0x29')]);_0x1a031d['attributes']=_[_0x2be0('0x2c')](_0x21683a['model'],qs[_0x2be0('0x2d')](_0x4a8d11[_0x2be0('0x29')][_0x2be0('0x2d')]));_0x1a031d[_0x2be0('0x2b')]=_0x1a031d[_0x2be0('0x2b')][_0x2be0('0x2e')]?_0x1a031d[_0x2be0('0x2b')]:_0x21683a['model'];if(_0x4a8d11[_0x2be0('0x29')][_0x2be0('0x41')]){_0x1a031d[_0x2be0('0x3c')]=[{'all':!![]}];}_0x1a031d=_[_0x2be0('0x35')]({},_0x1a031d,_0x4a8d11[_0x2be0('0x3a')]);return db['FaxTransferReport'][_0x2be0('0x42')](_0x1a031d)['then'](handleEntityNotFound(_0x103608,null))[_0x2be0('0x20')](respondWithResult(_0x103608,null))[_0x2be0('0x43')](handleError(_0x103608,null));};exports[_0x2be0('0x44')]=function(_0x76038e,_0x2ce72b){return db[_0x2be0('0x3b')]['create'](_0x76038e[_0x2be0('0x45')],{})['then'](respondWithResult(_0x2ce72b,0xc9))[_0x2be0('0x43')](handleError(_0x2ce72b,null));};exports[_0x2be0('0x46')]=function(_0x5b78a1,_0x14e321){if(_0x5b78a1[_0x2be0('0x45')]['id']){delete _0x5b78a1[_0x2be0('0x45')]['id'];}return db[_0x2be0('0x3b')][_0x2be0('0x42')]({'where':{'id':_0x5b78a1['params']['id']}})['then'](handleEntityNotFound(_0x14e321,null))[_0x2be0('0x20')](saveUpdates(_0x5b78a1[_0x2be0('0x45')],null))['then'](respondWithResult(_0x14e321,null))['catch'](handleError(_0x14e321,null));};exports[_0x2be0('0x21')]=function(_0x3e6f94,_0x2d0ec3){return db[_0x2be0('0x3b')]['find']({'where':{'id':_0x3e6f94[_0x2be0('0x40')]['id']}})[_0x2be0('0x20')](handleEntityNotFound(_0x2d0ec3,null))[_0x2be0('0x20')](removeEntity(_0x2d0ec3,null))[_0x2be0('0x43')](handleError(_0x2d0ec3,null));};exports[_0x2be0('0x47')]=function(_0x36ac93,_0x10736d){return db['FaxTransferReport'][_0x2be0('0x47')]()[_0x2be0('0x20')](respondWithResult(_0x10736d,null))['catch'](handleError(_0x10736d,null));}; \ No newline at end of file +var _0x2ce1=['keys','find','create','body','catch','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','then','error','stack','name','FaxTransferReport','rawAttributes','model','query','filters','attributes','intersection','fields','length','nolimit','offset','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','rows','show','params'];(function(_0x243b04,_0x395fac){var _0x3928e4=function(_0x4e890c){while(--_0x4e890c){_0x243b04['push'](_0x243b04['shift']());}};_0x3928e4(++_0x395fac);}(_0x2ce1,0x8b));var _0x12ce=function(_0x24a653,_0x581ea3){_0x24a653=_0x24a653-0x0;var _0x1d6d25=_0x2ce1[_0x24a653];return _0x1d6d25;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x12ce('0x0'));var jsonpatch=require(_0x12ce('0x1'));var rp=require(_0x12ce('0x2'));var moment=require(_0x12ce('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x12ce('0x4'));var util=require(_0x12ce('0x5'));var path=require('path');var sox=require(_0x12ce('0x6'));var csv=require(_0x12ce('0x7'));var ejs=require(_0x12ce('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x12ce('0x9'));var crypto=require('crypto');var jsforce=require(_0x12ce('0xa'));var deskjs=require(_0x12ce('0xb'));var toCsv=require(_0x12ce('0x7'));var querystring=require('querystring');var Papa=require(_0x12ce('0xc'));var Redis=require(_0x12ce('0xd'));var authService=require(_0x12ce('0xe'));var qs=require(_0x12ce('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x12ce('0x10'))('api');var utils=require(_0x12ce('0x11'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd2cfb3,_0x210c8c){_0x210c8c=_0x210c8c||0xcc;return function(_0x3dcfb4){if(_0x3dcfb4){return _0xd2cfb3[_0x12ce('0x12')](_0x210c8c);}return _0xd2cfb3[_0x12ce('0x13')](_0x210c8c)[_0x12ce('0x14')]();};}function respondWithResult(_0x4d9178,_0x2e3b21){_0x2e3b21=_0x2e3b21||0xc8;return function(_0x5cabae){if(_0x5cabae){return _0x4d9178[_0x12ce('0x13')](_0x2e3b21)[_0x12ce('0x15')](_0x5cabae);}};}function respondWithFilteredResult(_0x302e3e,_0x4e3d27){return function(_0x2171d2){if(_0x2171d2){var _0x288cff=_0x2171d2[_0x12ce('0x16')],_0x2ac396=_0x4e3d27['offset'],_0x39e4ec=_0x4e3d27['offset']+_0x4e3d27[_0x12ce('0x17')],_0x134831;if(_0x39e4ec>=_0x288cff){_0x39e4ec=_0x288cff;_0x134831=0xc8;}else{_0x134831=0xce;}_0x302e3e['status'](_0x134831);return _0x302e3e[_0x12ce('0x18')](_0x12ce('0x19'),_0x2ac396+'-'+_0x39e4ec+'/'+_0x288cff)['json'](_0x2171d2);}return null;};}function patchUpdates(_0x22ac52){return function(_0x53d01b){try{jsonpatch[_0x12ce('0x1a')](_0x53d01b,_0x22ac52,!![]);}catch(_0x524b6b){return BPromise[_0x12ce('0x1b')](_0x524b6b);}return _0x53d01b['save']();};}function saveUpdates(_0x1a60e7,_0x4f5eab){return function(_0x3f031e){if(_0x3f031e){return _0x3f031e['update'](_0x1a60e7)['then'](function(_0x385687){return _0x385687;});}return null;};}function removeEntity(_0x1744d6,_0x1805b0){return function(_0x31656e){if(_0x31656e){return _0x31656e['destroy']()[_0x12ce('0x1c')](function(){_0x1744d6[_0x12ce('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6302d2,_0x4c86cd){return function(_0x45a79c){if(!_0x45a79c){_0x6302d2['sendStatus'](0x194);}return _0x45a79c;};}function handleError(_0x43c825,_0x796f93){_0x796f93=_0x796f93||0x1f4;return function(_0x1c245f){logger[_0x12ce('0x1d')](_0x1c245f[_0x12ce('0x1e')]);if(_0x1c245f[_0x12ce('0x1f')]){delete _0x1c245f[_0x12ce('0x1f')];}_0x43c825[_0x12ce('0x13')](_0x796f93)['send'](_0x1c245f);};}exports['index']=function(_0x12c75e,_0x9608af){var _0x10232e={},_0x1e222f={},_0x482422={'count':0x0,'rows':[]};var _0x32a7ec=db[_0x12ce('0x20')][_0x12ce('0x21')];_0x1e222f[_0x12ce('0x22')]=_['keys'](_0x32a7ec);_0x1e222f[_0x12ce('0x23')]=_['keys'](_0x12c75e[_0x12ce('0x23')]);_0x1e222f[_0x12ce('0x24')]=_['intersection'](_0x1e222f[_0x12ce('0x22')],_0x1e222f[_0x12ce('0x23')]);_0x10232e[_0x12ce('0x25')]=_[_0x12ce('0x26')](_0x1e222f[_0x12ce('0x22')],qs[_0x12ce('0x27')](_0x12c75e[_0x12ce('0x23')][_0x12ce('0x27')]));_0x10232e['attributes']=_0x10232e[_0x12ce('0x25')][_0x12ce('0x28')]?_0x10232e[_0x12ce('0x25')]:_0x1e222f[_0x12ce('0x22')];if(!_0x12c75e[_0x12ce('0x23')]['hasOwnProperty'](_0x12ce('0x29'))){_0x10232e[_0x12ce('0x17')]=qs['limit'](_0x12c75e['query']['limit']);_0x10232e[_0x12ce('0x2a')]=qs[_0x12ce('0x2a')](_0x12c75e[_0x12ce('0x23')][_0x12ce('0x2a')]);}_0x10232e[_0x12ce('0x2b')]=qs[_0x12ce('0x2c')](_0x12c75e['query'][_0x12ce('0x2c')]);_0x10232e[_0x12ce('0x2d')]=qs[_0x12ce('0x24')](_[_0x12ce('0x2e')](_0x12c75e[_0x12ce('0x23')],_0x1e222f[_0x12ce('0x24')]));if(_0x12c75e[_0x12ce('0x23')][_0x12ce('0x2f')]){_0x10232e['where']=_[_0x12ce('0x30')](_0x10232e[_0x12ce('0x2d')],{'$or':_[_0x12ce('0x31')](_0x32a7ec,function(_0x5e6e6d){if(_0x5e6e6d[_0x12ce('0x32')][_0x12ce('0x33')]!==_0x12ce('0x34')){var _0x4c3f04={};_0x4c3f04[_0x5e6e6d[_0x12ce('0x35')]]={'$like':'%'+_0x12c75e['query']['filter']+'%'};return _0x4c3f04;}})});}_0x10232e=_[_0x12ce('0x30')]({},_0x10232e,_0x12c75e['options']);var _0x20eb4d={'where':_0x10232e[_0x12ce('0x2d')]};return db[_0x12ce('0x20')]['count'](_0x20eb4d)[_0x12ce('0x1c')](function(_0x328980){_0x482422[_0x12ce('0x16')]=_0x328980;if(_0x12c75e[_0x12ce('0x23')][_0x12ce('0x36')]){_0x10232e[_0x12ce('0x37')]=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x10232e);})['then'](function(_0x25eb25){_0x482422[_0x12ce('0x38')]=_0x25eb25;return _0x482422;})[_0x12ce('0x1c')](respondWithFilteredResult(_0x9608af,_0x10232e))['catch'](handleError(_0x9608af,null));};exports[_0x12ce('0x39')]=function(_0x25e365,_0x80e31f){var _0x2ad863={'raw':!![],'where':{'id':_0x25e365[_0x12ce('0x3a')]['id']}},_0x313f6c={};_0x313f6c['model']=_[_0x12ce('0x3b')](db[_0x12ce('0x20')][_0x12ce('0x21')]);_0x313f6c['query']=_[_0x12ce('0x3b')](_0x25e365[_0x12ce('0x23')]);_0x313f6c[_0x12ce('0x24')]=_['intersection'](_0x313f6c['model'],_0x313f6c[_0x12ce('0x23')]);_0x2ad863[_0x12ce('0x25')]=_[_0x12ce('0x26')](_0x313f6c['model'],qs[_0x12ce('0x27')](_0x25e365[_0x12ce('0x23')][_0x12ce('0x27')]));_0x2ad863[_0x12ce('0x25')]=_0x2ad863[_0x12ce('0x25')][_0x12ce('0x28')]?_0x2ad863[_0x12ce('0x25')]:_0x313f6c[_0x12ce('0x22')];if(_0x25e365[_0x12ce('0x23')][_0x12ce('0x36')]){_0x2ad863[_0x12ce('0x37')]=[{'all':!![]}];}_0x2ad863=_['merge']({},_0x2ad863,_0x25e365['options']);return db[_0x12ce('0x20')][_0x12ce('0x3c')](_0x2ad863)[_0x12ce('0x1c')](handleEntityNotFound(_0x80e31f,null))['then'](respondWithResult(_0x80e31f,null))['catch'](handleError(_0x80e31f,null));};exports['create']=function(_0x8f36e4,_0x862bda){return db[_0x12ce('0x20')][_0x12ce('0x3d')](_0x8f36e4[_0x12ce('0x3e')],{})[_0x12ce('0x1c')](respondWithResult(_0x862bda,0xc9))[_0x12ce('0x3f')](handleError(_0x862bda,null));};exports['update']=function(_0x5de94d,_0x19d6e4){if(_0x5de94d['body']['id']){delete _0x5de94d[_0x12ce('0x3e')]['id'];}return db[_0x12ce('0x20')][_0x12ce('0x3c')]({'where':{'id':_0x5de94d[_0x12ce('0x3a')]['id']}})[_0x12ce('0x1c')](handleEntityNotFound(_0x19d6e4,null))[_0x12ce('0x1c')](saveUpdates(_0x5de94d['body'],null))[_0x12ce('0x1c')](respondWithResult(_0x19d6e4,null))['catch'](handleError(_0x19d6e4,null));};exports[_0x12ce('0x40')]=function(_0x38eea7,_0x3a5849){return db[_0x12ce('0x20')][_0x12ce('0x3c')]({'where':{'id':_0x38eea7[_0x12ce('0x3a')]['id']}})[_0x12ce('0x1c')](handleEntityNotFound(_0x3a5849,null))['then'](removeEntity(_0x3a5849,null))['catch'](handleError(_0x3a5849,null));};exports[_0x12ce('0x41')]=function(_0x1ef567,_0x490b9b){return db['FaxTransferReport'][_0x12ce('0x41')]()[_0x12ce('0x1c')](respondWithResult(_0x490b9b,null))[_0x12ce('0x3f')](handleError(_0x490b9b,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 0963243..4d6f182 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 _0x81a0=['define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x5c07fa,_0x12a2c4){var _0x50dae9=function(_0x340a29){while(--_0x340a29){_0x5c07fa['push'](_0x5c07fa['shift']());}};_0x50dae9(++_0x12a2c4);}(_0x81a0,0xd5));var _0x081a=function(_0xa37721,_0x8b7a95){_0xa37721=_0xa37721-0x0;var _0x53e79e=_0x81a0[_0xa37721];return _0x53e79e;};'use strict';var _=require(_0x081a('0x0'));var util=require(_0x081a('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x081a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x081a('0x3'));var rimraf=require(_0x081a('0x4'));var config=require(_0x081a('0x5'));var attributes=require('./faxTransferReport.attributes');module[_0x081a('0x6')]=function(_0xcd93a8,_0xdbb6dc){return _0xcd93a8[_0x081a('0x7')](_0x081a('0x8'),attributes,{'tableName':_0x081a('0x9'),'paranoid':![],'indexes':[{'name':_0x081a('0xa'),'fields':[_0x081a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xab3e=['./faxTransferReport.attributes','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','../../config/environment'];(function(_0x3ae208,_0x445e53){var _0x58419e=function(_0x5d7f59){while(--_0x5d7f59){_0x3ae208['push'](_0x3ae208['shift']());}};_0x58419e(++_0x445e53);}(_0xab3e,0x191));var _0xeab3=function(_0x324387,_0x5d7b6e){_0x324387=_0x324387-0x0;var _0x2d288d=_0xab3e[_0x324387];return _0x2d288d;};'use strict';var _=require(_0xeab3('0x0'));var util=require(_0xeab3('0x1'));var logger=require(_0xeab3('0x2'))(_0xeab3('0x3'));var moment=require(_0xeab3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xeab3('0x5'));var attributes=require(_0xeab3('0x6'));module['exports']=function(_0x472ec1,_0x1d8c4b){return _0x472ec1[_0xeab3('0x7')](_0xeab3('0x8'),attributes,{'tableName':_0xeab3('0x9'),'paranoid':![],'indexes':[{'name':_0xeab3('0xa'),'fields':[_0xeab3('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 78e8145..8fc68de 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 _0xb4a5=['jayson/promise','client','http','request','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1c4aa8,_0xcca9cb){var _0x3a4571=function(_0x58e2e8){while(--_0x58e2e8){_0x1c4aa8['push'](_0x1c4aa8['shift']());}};_0x3a4571(++_0xcca9cb);}(_0xb4a5,0xdc));var _0x5b4a=function(_0x44b1a2,_0x2517b4){_0x44b1a2=_0x44b1a2-0x0;var _0x501cd1=_0xb4a5[_0x44b1a2];return _0x501cd1;};'use strict';var _=require(_0x5b4a('0x0'));var util=require(_0x5b4a('0x1'));var moment=require(_0x5b4a('0x2'));var BPromise=require('bluebird');var rs=require(_0x5b4a('0x3'));var fs=require('fs');var Redis=require(_0x5b4a('0x4'));var db=require(_0x5b4a('0x5'))['db'];var utils=require(_0x5b4a('0x6'));var logger=require(_0x5b4a('0x7'))(_0x5b4a('0x8'));var config=require(_0x5b4a('0x9'));var jayson=require(_0x5b4a('0xa'));var client=jayson[_0x5b4a('0xb')][_0x5b4a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x389177,_0x4795ef,_0xd3ca6c){return new BPromise(function(_0x329afb,_0x308d19){return client[_0x5b4a('0xd')](_0x389177,_0xd3ca6c)['then'](function(_0x263152){logger['info'](_0x5b4a('0xe'),_0x4795ef,_0x5b4a('0xf'));logger['debug'](_0x5b4a('0x10'),_0x4795ef,_0x5b4a('0xf'),JSON[_0x5b4a('0x11')](_0x263152));if(_0x263152[_0x5b4a('0x12')]){if(_0x263152[_0x5b4a('0x12')]['code']===0x1f4){logger[_0x5b4a('0x12')](_0x5b4a('0xe'),_0x4795ef,_0x263152[_0x5b4a('0x12')][_0x5b4a('0x13')]);return _0x308d19(_0x263152['error'][_0x5b4a('0x13')]);}logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x4795ef,_0x263152[_0x5b4a('0x12')][_0x5b4a('0x13')]);return _0x329afb(_0x263152['error'][_0x5b4a('0x13')]);}else{logger[_0x5b4a('0x14')](_0x5b4a('0xe'),_0x4795ef,_0x5b4a('0xf'));_0x329afb(_0x263152[_0x5b4a('0x15')][_0x5b4a('0x13')]);}})[_0x5b4a('0x16')](function(_0x47c6d6){logger[_0x5b4a('0x12')](_0x5b4a('0xe'),_0x4795ef,_0x47c6d6);_0x308d19(_0x47c6d6);});});} \ No newline at end of file +var _0xe80c=['ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x277607,_0x345a06){var _0x15fe23=function(_0x336de7){while(--_0x336de7){_0x277607['push'](_0x277607['shift']());}};_0x15fe23(++_0x345a06);}(_0xe80c,0x15c));var _0xce80=function(_0x80d0ab,_0x1a91d8){_0x80d0ab=_0x80d0ab-0x0;var _0x319719=_0xe80c[_0x80d0ab];return _0x319719;};'use strict';var _=require('lodash');var util=require(_0xce80('0x0'));var moment=require(_0xce80('0x1'));var BPromise=require(_0xce80('0x2'));var rs=require(_0xce80('0x3'));var fs=require('fs');var Redis=require(_0xce80('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xce80('0x5'));var logger=require('../../config/logger')(_0xce80('0x6'));var config=require('../../config/environment');var jayson=require(_0xce80('0x7'));var client=jayson[_0xce80('0x8')][_0xce80('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x283d42,_0x29c3e6,_0x350b5f){return new BPromise(function(_0x5cc4f2,_0x423881){return client[_0xce80('0xa')](_0x283d42,_0x350b5f)[_0xce80('0xb')](function(_0x44b888){logger[_0xce80('0xc')](_0xce80('0xd'),_0x29c3e6,'request\x20sent');logger[_0xce80('0xe')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x29c3e6,_0xce80('0xf'),JSON[_0xce80('0x10')](_0x44b888));if(_0x44b888[_0xce80('0x11')]){if(_0x44b888[_0xce80('0x11')][_0xce80('0x12')]===0x1f4){logger[_0xce80('0x11')](_0xce80('0xd'),_0x29c3e6,_0x44b888['error']['message']);return _0x423881(_0x44b888[_0xce80('0x11')][_0xce80('0x13')]);}logger[_0xce80('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x29c3e6,_0x44b888[_0xce80('0x11')]['message']);return _0x5cc4f2(_0x44b888['error']['message']);}else{logger[_0xce80('0xc')](_0xce80('0xd'),_0x29c3e6,_0xce80('0xf'));_0x5cc4f2(_0x44b888[_0xce80('0x14')][_0xce80('0x13')]);}})[_0xce80('0x15')](function(_0x230eab){logger['error'](_0xce80('0xd'),_0x29c3e6,_0x230eab);_0x423881(_0x230eab);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 6d1b7ae..42a5bd6 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 _0x55ca=['describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x52d7a0,_0x3a896c){var _0x20dd8d=function(_0x53af62){while(--_0x53af62){_0x52d7a0['push'](_0x52d7a0['shift']());}};_0x20dd8d(++_0x3a896c);}(_0x55ca,0x126));var _0xa55c=function(_0x5e0e90,_0x1c8363){_0x5e0e90=_0x5e0e90-0x0;var _0x33cfe3=_0x55ca[_0x5e0e90];return _0x33cfe3;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var auth=require(_0xa55c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa55c('0x4'));var controller=require(_0xa55c('0x5'));router[_0xa55c('0x6')]('/',auth[_0xa55c('0x7')](),controller[_0xa55c('0x8')]);router[_0xa55c('0x6')](_0xa55c('0x9'),auth['isAuthenticated'](),controller[_0xa55c('0xa')]);router[_0xa55c('0x6')]('/:id',auth[_0xa55c('0x7')](),controller[_0xa55c('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x7')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x10')](_0xa55c('0xe'),auth[_0xa55c('0x7')](),controller[_0xa55c('0x11')]);module[_0xa55c('0x12')]=router; \ No newline at end of file +var _0x0e85=['../../config/environment','get','isAuthenticated','index','describe','/:id','show','create','put','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x0e85,0x7c));var _0x50e8=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x0e85[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var path=require('path');var timeout=require(_0x50e8('0x2'));var express=require(_0x50e8('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x50e8('0x4'));var controller=require('./faxTransferReport.controller');router[_0x50e8('0x5')]('/',auth[_0x50e8('0x6')](),controller[_0x50e8('0x7')]);router[_0x50e8('0x5')]('/describe',auth[_0x50e8('0x6')](),controller[_0x50e8('0x8')]);router[_0x50e8('0x5')](_0x50e8('0x9'),auth[_0x50e8('0x6')](),controller[_0x50e8('0xa')]);router['post']('/',auth[_0x50e8('0x6')](),controller[_0x50e8('0xb')]);router[_0x50e8('0xc')](_0x50e8('0x9'),auth[_0x50e8('0x6')](),controller[_0x50e8('0xd')]);router[_0x50e8('0xe')](_0x50e8('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x50e8('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 075a104..c099d68 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 _0x753d=['isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','delete','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x4117a4,_0x5edebd){var _0x1207fd=function(_0x54f4ea){while(--_0x54f4ea){_0x4117a4['push'](_0x4117a4['shift']());}};_0x1207fd(++_0x5edebd);}(_0x753d,0x1f3));var _0xd753=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x753d[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0xd753('0x0'));var path=require('path');var timeout=require(_0xd753('0x1'));var express=require(_0xd753('0x2'));var router=express['Router']();var auth=require(_0xd753('0x3'));var interaction=require(_0xd753('0x4'));var config=require(_0xd753('0x5'));var controller=require('./intDeskAccount.controller');router[_0xd753('0x6')]('/',auth[_0xd753('0x7')](),controller[_0xd753('0x8')]);router[_0xd753('0x6')](_0xd753('0x9'),auth[_0xd753('0x7')](),controller[_0xd753('0xa')]);router[_0xd753('0x6')]('/:id/configurations',auth[_0xd753('0x7')](),controller[_0xd753('0xb')]);router[_0xd753('0x6')](_0xd753('0xc'),auth[_0xd753('0x7')](),controller[_0xd753('0xd')]);router[_0xd753('0xe')]('/',auth[_0xd753('0x7')](),controller[_0xd753('0xf')]);router[_0xd753('0xe')](_0xd753('0x10'),auth[_0xd753('0x7')](),controller[_0xd753('0x11')]);router[_0xd753('0x12')](_0xd753('0x9'),auth[_0xd753('0x7')](),controller['update']);router[_0xd753('0x13')]('/:id',auth[_0xd753('0x7')](),controller[_0xd753('0x14')]);module[_0xd753('0x15')]=router; \ No newline at end of file +var _0xd9ce=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','/:id','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x42bd43,_0x59fb77){var _0x421e88=function(_0x485e11){while(--_0x485e11){_0x42bd43['push'](_0x42bd43['shift']());}};_0x421e88(++_0x59fb77);}(_0xd9ce,0x86));var _0xed9c=function(_0x323430,_0x3d2b6d){_0x323430=_0x323430-0x0;var _0x9eecd1=_0xd9ce[_0x323430];return _0x9eecd1;};'use strict';var multer=require(_0xed9c('0x0'));var util=require(_0xed9c('0x1'));var path=require(_0xed9c('0x2'));var timeout=require(_0xed9c('0x3'));var express=require(_0xed9c('0x4'));var router=express['Router']();var auth=require(_0xed9c('0x5'));var interaction=require(_0xed9c('0x6'));var config=require(_0xed9c('0x7'));var controller=require(_0xed9c('0x8'));router['get']('/',auth[_0xed9c('0x9')](),controller[_0xed9c('0xa')]);router[_0xed9c('0xb')](_0xed9c('0xc'),auth[_0xed9c('0x9')](),controller['show']);router[_0xed9c('0xb')](_0xed9c('0xd'),auth[_0xed9c('0x9')](),controller['getConfigurations']);router[_0xed9c('0xb')](_0xed9c('0xe'),auth['isAuthenticated'](),controller[_0xed9c('0xf')]);router[_0xed9c('0x10')]('/',auth[_0xed9c('0x9')](),controller[_0xed9c('0x11')]);router[_0xed9c('0x10')](_0xed9c('0xd'),auth[_0xed9c('0x9')](),controller[_0xed9c('0x12')]);router[_0xed9c('0x13')](_0xed9c('0xc'),auth[_0xed9c('0x9')](),controller[_0xed9c('0x14')]);router[_0xed9c('0x15')](_0xed9c('0xc'),auth[_0xed9c('0x9')](),controller[_0xed9c('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index e9710b3..de86367 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 _0xbff3=['STRING','basic','newTab','integrationTab','sequelize','exports'];(function(_0xef7eae,_0x25d58e){var _0x3fb949=function(_0x669d28){while(--_0x669d28){_0xef7eae['push'](_0xef7eae['shift']());}};_0x3fb949(++_0x25d58e);}(_0xbff3,0x18a));var _0x3bff=function(_0xbc9711,_0x23cb20){_0xbc9711=_0xbc9711-0x0;var _0x5bd8ee=_0xbff3[_0xbc9711];return _0x5bd8ee;};'use strict';var Sequelize=require(_0x3bff('0x0'));module[_0x3bff('0x1')]={'name':{'type':Sequelize[_0x3bff('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3bff('0x2')]},'remoteUri':{'type':Sequelize[_0x3bff('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x3bff('0x3')),'defaultValue':_0x3bff('0x3')},'password':{'type':Sequelize[_0x3bff('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x3bff('0x2')]},'token':{'type':Sequelize[_0x3bff('0x2')]},'tokenSecret':{'type':Sequelize[_0x3bff('0x2')]},'serverUrl':{'type':Sequelize[_0x3bff('0x2')]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x3bff('0x4')),'defaultValue':_0x3bff('0x5')}}; \ No newline at end of file +var _0x3db9=['integrationTab','newTab','sequelize','exports','STRING','ENUM'];(function(_0x1a7255,_0x357a68){var _0x5c2db8=function(_0x297bc){while(--_0x297bc){_0x1a7255['push'](_0x1a7255['shift']());}};_0x5c2db8(++_0x357a68);}(_0x3db9,0x182));var _0x93db=function(_0x45c694,_0x2d0814){_0x45c694=_0x45c694-0x0;var _0x184a94=_0x3db9[_0x45c694];return _0x184a94;};'use strict';var Sequelize=require(_0x93db('0x0'));module[_0x93db('0x1')]={'name':{'type':Sequelize[_0x93db('0x2')]},'description':{'type':Sequelize[_0x93db('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x93db('0x3')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0x93db('0x2')]},'consumerKey':{'type':Sequelize[_0x93db('0x2')]},'consumerSecret':{'type':Sequelize[_0x93db('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x93db('0x2')]},'serverUrl':{'type':Sequelize[_0x93db('0x2')]},'type':{'type':Sequelize['ENUM'](_0x93db('0x4'),_0x93db('0x5')),'defaultValue':_0x93db('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 236fdc3..2ad8860 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 _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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index e6d8c7c..4ada828 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 _0x1339=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1339,0x1ed));var _0x9133=function(_0x1c108c,_0x224952){_0x1c108c=_0x1c108c-0x0;var _0x3e6f92=_0x1339[_0x1c108c];return _0x3e6f92;};'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('./intDeskAccount.attributes');var integrations=require(_0x9133('0x8'));module[_0x9133('0x9')]=function(_0x379915,_0x539af6){return _0x379915[_0x9133('0xa')](_0x9133('0xb'),attributes,{'tableName':_0x9133('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f7a=['define','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x5acc02,_0x2781cd){_0x5acc02=_0x5acc02-0x0;var _0x5bf0fd=_0x6f7a[_0x5acc02];return _0x5bf0fd;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var logger=require(_0xa6f7('0x2'))(_0xa6f7('0x3'));var moment=require('moment');var BPromise=require(_0xa6f7('0x4'));var rp=require(_0xa6f7('0x5'));var fs=require('fs');var path=require(_0xa6f7('0x6'));var rimraf=require(_0xa6f7('0x7'));var config=require(_0xa6f7('0x8'));var attributes=require(_0xa6f7('0x9'));var integrations=require(_0xa6f7('0xa'));module[_0xa6f7('0xb')]=function(_0x1fdd5f,_0x335aaa){return _0x1fdd5f[_0xa6f7('0xc')]('DeskAccount',attributes,{'tableName':'int_desk_accounts','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 d9d97bc..17ff55c 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 _0xcd30=['error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','DeskAccount','findAll','options','where','limit','include','map','model','attributes','then','debug','ShowDeskAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1f93b9,_0x363975){var _0x58ed3d=function(_0x284a2e){while(--_0x284a2e){_0x1f93b9['push'](_0x1f93b9['shift']());}};_0x58ed3d(++_0x363975);}(_0xcd30,0x1e8));var _0x0cd3=function(_0x2a2766,_0x475265){_0x2a2766=_0x2a2766-0x0;var _0x30a56c=_0xcd30[_0x2a2766];return _0x30a56c;};'use strict';var _=require(_0x0cd3('0x0'));var util=require(_0x0cd3('0x1'));var moment=require(_0x0cd3('0x2'));var BPromise=require(_0x0cd3('0x3'));var rs=require(_0x0cd3('0x4'));var fs=require('fs');var Redis=require(_0x0cd3('0x5'));var db=require(_0x0cd3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0cd3('0x7'))(_0x0cd3('0x8'));var config=require(_0x0cd3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0cd3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe1ece5,_0x5442ec,_0x15ff66){return new BPromise(function(_0x18d6f3,_0x111edb){return client[_0x0cd3('0xb')](_0xe1ece5,_0x15ff66)['then'](function(_0x1716b1){logger[_0x0cd3('0xc')]('DeskAccount,\x20%s,\x20%s',_0x5442ec,_0x0cd3('0xd'));logger['debug'](_0x0cd3('0xe'),_0x5442ec,_0x0cd3('0xd'),JSON[_0x0cd3('0xf')](_0x1716b1));if(_0x1716b1[_0x0cd3('0x10')]){if(_0x1716b1[_0x0cd3('0x10')][_0x0cd3('0x11')]===0x1f4){logger[_0x0cd3('0x10')](_0x0cd3('0x12'),_0x5442ec,_0x1716b1[_0x0cd3('0x10')][_0x0cd3('0x13')]);return _0x111edb(_0x1716b1[_0x0cd3('0x10')][_0x0cd3('0x13')]);}logger[_0x0cd3('0x10')](_0x0cd3('0x12'),_0x5442ec,_0x1716b1[_0x0cd3('0x10')][_0x0cd3('0x13')]);return _0x18d6f3(_0x1716b1['error'][_0x0cd3('0x13')]);}else{logger[_0x0cd3('0xc')]('DeskAccount,\x20%s,\x20%s',_0x5442ec,_0x0cd3('0xd'));_0x18d6f3(_0x1716b1[_0x0cd3('0x14')][_0x0cd3('0x13')]);}})[_0x0cd3('0x15')](function(_0x2e6f84){logger[_0x0cd3('0x10')](_0x0cd3('0x12'),_0x5442ec,_0x2e6f84);_0x111edb(_0x2e6f84);});});}exports['GetDeskAccount']=function(_0xb95aa1){var _0x19bdb7=this;return new Promise(function(_0x16aae0,_0xc2697f){return db[_0x0cd3('0x16')][_0x0cd3('0x17')]({'raw':_0xb95aa1[_0x0cd3('0x18')]?_0xb95aa1[_0x0cd3('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xb95aa1['options']?_0xb95aa1[_0x0cd3('0x18')][_0x0cd3('0x19')]||null:null,'attributes':_0xb95aa1[_0x0cd3('0x18')]?_0xb95aa1[_0x0cd3('0x18')]['attributes']||null:null,'limit':_0xb95aa1['options']?_0xb95aa1[_0x0cd3('0x18')][_0x0cd3('0x1a')]||null:null,'include':_0xb95aa1[_0x0cd3('0x18')]?_0xb95aa1[_0x0cd3('0x18')][_0x0cd3('0x1b')]?_[_0x0cd3('0x1c')](_0xb95aa1['options']['include'],function(_0x127bb1){return{'model':db[_0x127bb1[_0x0cd3('0x1d')]],'as':_0x127bb1['as'],'attributes':_0x127bb1[_0x0cd3('0x1e')],'include':_0x127bb1['include']?_[_0x0cd3('0x1c')](_0x127bb1[_0x0cd3('0x1b')],function(_0x59e759){return{'model':db[_0x59e759[_0x0cd3('0x1d')]],'as':_0x59e759['as'],'attributes':_0x59e759[_0x0cd3('0x1e')],'include':_0x59e759['include']?_[_0x0cd3('0x1c')](_0x59e759[_0x0cd3('0x1b')],function(_0x596fde){return{'model':db[_0x596fde[_0x0cd3('0x1d')]],'as':_0x596fde['as'],'attributes':_0x596fde[_0x0cd3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0cd3('0x1f')](function(_0x468a13){logger['info']('GetDeskAccount',_0xb95aa1);logger[_0x0cd3('0x20')]('GetDeskAccount',_0xb95aa1,JSON[_0x0cd3('0xf')](_0x468a13));_0x16aae0(_0x468a13);})['catch'](function(_0x563a8a){logger[_0x0cd3('0x10')]('GetDeskAccount',_0x563a8a[_0x0cd3('0x13')],_0xb95aa1);_0xc2697f(_0x19bdb7[_0x0cd3('0x10')](0x1f4,_0x563a8a[_0x0cd3('0x13')]));});});};exports[_0x0cd3('0x21')]=function(_0x2b697e){var _0x385193=this;return new Promise(function(_0x88808b,_0x46e3e5){return db['DeskAccount'][_0x0cd3('0x22')]({'raw':_0x2b697e[_0x0cd3('0x18')]?_0x2b697e[_0x0cd3('0x18')][_0x0cd3('0x23')]===undefined?!![]:![]:!![],'where':_0x2b697e[_0x0cd3('0x18')]?_0x2b697e[_0x0cd3('0x18')][_0x0cd3('0x19')]||null:null,'attributes':_0x2b697e[_0x0cd3('0x18')]?_0x2b697e[_0x0cd3('0x18')][_0x0cd3('0x1e')]||null:null,'include':_0x2b697e['options']?_0x2b697e['options'][_0x0cd3('0x1b')]?_[_0x0cd3('0x1c')](_0x2b697e[_0x0cd3('0x18')][_0x0cd3('0x1b')],function(_0x204c36){return{'model':db[_0x204c36[_0x0cd3('0x1d')]],'as':_0x204c36['as'],'attributes':_0x204c36[_0x0cd3('0x1e')],'include':_0x204c36[_0x0cd3('0x1b')]?_[_0x0cd3('0x1c')](_0x204c36['include'],function(_0x4f2bcd){return{'model':db[_0x4f2bcd[_0x0cd3('0x1d')]],'as':_0x4f2bcd['as'],'attributes':_0x4f2bcd[_0x0cd3('0x1e')],'include':_0x4f2bcd['include']?_[_0x0cd3('0x1c')](_0x4f2bcd[_0x0cd3('0x1b')],function(_0x18545d){return{'model':db[_0x18545d[_0x0cd3('0x1d')]],'as':_0x18545d['as'],'attributes':_0x18545d[_0x0cd3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0cd3('0x1f')](function(_0x1c8631){logger['info'](_0x0cd3('0x21'),_0x2b697e);logger['debug'](_0x0cd3('0x21'),_0x2b697e,JSON[_0x0cd3('0xf')](_0x1c8631));_0x88808b(_0x1c8631);})[_0x0cd3('0x15')](function(_0x564eb7){logger['error'](_0x0cd3('0x21'),_0x564eb7[_0x0cd3('0x13')],_0x2b697e);_0x46e3e5(_0x385193[_0x0cd3('0x10')](0x1f4,_0x564eb7[_0x0cd3('0x13')]));});});}; \ No newline at end of file +var _0x62cf=['include','map','model','ShowDeskAccount','DeskAccount','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetDeskAccount','findAll','options','where','attributes'];(function(_0x5d8727,_0xdfdd0b){var _0x17e166=function(_0xcbbf3f){while(--_0xcbbf3f){_0x5d8727['push'](_0x5d8727['shift']());}};_0x17e166(++_0xdfdd0b);}(_0x62cf,0x81));var _0xf62c=function(_0x4ae277,_0x436908){_0x4ae277=_0x4ae277-0x0;var _0x24b67f=_0x62cf[_0x4ae277];return _0x24b67f;};'use strict';var _=require(_0xf62c('0x0'));var util=require('util');var moment=require(_0xf62c('0x1'));var BPromise=require('bluebird');var rs=require(_0xf62c('0x2'));var fs=require('fs');var Redis=require(_0xf62c('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf62c('0x4'))(_0xf62c('0x5'));var config=require(_0xf62c('0x6'));var jayson=require(_0xf62c('0x7'));var client=jayson[_0xf62c('0x8')][_0xf62c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45749c,_0x314609,_0x372f7b){return new BPromise(function(_0x54389e,_0x181f87){return client['request'](_0x45749c,_0x372f7b)[_0xf62c('0xa')](function(_0x8038ed){logger[_0xf62c('0xb')](_0xf62c('0xc'),_0x314609,_0xf62c('0xd'));logger[_0xf62c('0xe')](_0xf62c('0xf'),_0x314609,_0xf62c('0xd'),JSON[_0xf62c('0x10')](_0x8038ed));if(_0x8038ed[_0xf62c('0x11')]){if(_0x8038ed[_0xf62c('0x11')]['code']===0x1f4){logger[_0xf62c('0x11')]('DeskAccount,\x20%s,\x20%s',_0x314609,_0x8038ed['error'][_0xf62c('0x12')]);return _0x181f87(_0x8038ed[_0xf62c('0x11')]['message']);}logger[_0xf62c('0x11')](_0xf62c('0xc'),_0x314609,_0x8038ed['error'][_0xf62c('0x12')]);return _0x54389e(_0x8038ed['error'][_0xf62c('0x12')]);}else{logger[_0xf62c('0xb')]('DeskAccount,\x20%s,\x20%s',_0x314609,_0xf62c('0xd'));_0x54389e(_0x8038ed[_0xf62c('0x13')]['message']);}})[_0xf62c('0x14')](function(_0x14b26e){logger[_0xf62c('0x11')]('DeskAccount,\x20%s,\x20%s',_0x314609,_0x14b26e);_0x181f87(_0x14b26e);});});}exports[_0xf62c('0x15')]=function(_0xc7da63){var _0x8180f3=this;return new Promise(function(_0x329c3c,_0x32a7c3){return db['DeskAccount'][_0xf62c('0x16')]({'raw':_0xc7da63[_0xf62c('0x17')]?_0xc7da63[_0xf62c('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xc7da63['options']?_0xc7da63[_0xf62c('0x17')][_0xf62c('0x18')]||null:null,'attributes':_0xc7da63[_0xf62c('0x17')]?_0xc7da63[_0xf62c('0x17')][_0xf62c('0x19')]||null:null,'limit':_0xc7da63['options']?_0xc7da63['options']['limit']||null:null,'include':_0xc7da63[_0xf62c('0x17')]?_0xc7da63[_0xf62c('0x17')][_0xf62c('0x1a')]?_[_0xf62c('0x1b')](_0xc7da63[_0xf62c('0x17')][_0xf62c('0x1a')],function(_0x5c048f){return{'model':db[_0x5c048f[_0xf62c('0x1c')]],'as':_0x5c048f['as'],'attributes':_0x5c048f[_0xf62c('0x19')],'include':_0x5c048f[_0xf62c('0x1a')]?_['map'](_0x5c048f['include'],function(_0x48541f){return{'model':db[_0x48541f['model']],'as':_0x48541f['as'],'attributes':_0x48541f[_0xf62c('0x19')],'include':_0x48541f['include']?_[_0xf62c('0x1b')](_0x48541f['include'],function(_0x2e2e54){return{'model':db[_0x2e2e54['model']],'as':_0x2e2e54['as'],'attributes':_0x2e2e54[_0xf62c('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf62c('0xa')](function(_0x439f48){logger[_0xf62c('0xb')](_0xf62c('0x15'),_0xc7da63);logger['debug'](_0xf62c('0x15'),_0xc7da63,JSON[_0xf62c('0x10')](_0x439f48));_0x329c3c(_0x439f48);})[_0xf62c('0x14')](function(_0x358036){logger[_0xf62c('0x11')](_0xf62c('0x15'),_0x358036[_0xf62c('0x12')],_0xc7da63);_0x32a7c3(_0x8180f3[_0xf62c('0x11')](0x1f4,_0x358036[_0xf62c('0x12')]));});});};exports[_0xf62c('0x1d')]=function(_0x554fce){var _0x398d1c=this;return new Promise(function(_0x1aaeb9,_0x56ec5f){return db[_0xf62c('0x1e')]['find']({'raw':_0x554fce[_0xf62c('0x17')]?_0x554fce[_0xf62c('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x554fce['options']?_0x554fce[_0xf62c('0x17')][_0xf62c('0x18')]||null:null,'attributes':_0x554fce['options']?_0x554fce[_0xf62c('0x17')]['attributes']||null:null,'include':_0x554fce[_0xf62c('0x17')]?_0x554fce[_0xf62c('0x17')][_0xf62c('0x1a')]?_[_0xf62c('0x1b')](_0x554fce['options']['include'],function(_0x3f6726){return{'model':db[_0x3f6726['model']],'as':_0x3f6726['as'],'attributes':_0x3f6726[_0xf62c('0x19')],'include':_0x3f6726['include']?_[_0xf62c('0x1b')](_0x3f6726[_0xf62c('0x1a')],function(_0x337fec){return{'model':db[_0x337fec[_0xf62c('0x1c')]],'as':_0x337fec['as'],'attributes':_0x337fec['attributes'],'include':_0x337fec[_0xf62c('0x1a')]?_[_0xf62c('0x1b')](_0x337fec[_0xf62c('0x1a')],function(_0x459b09){return{'model':db[_0x459b09['model']],'as':_0x459b09['as'],'attributes':_0x459b09[_0xf62c('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf62c('0xa')](function(_0x4f2cc2){logger[_0xf62c('0xb')](_0xf62c('0x1d'),_0x554fce);logger[_0xf62c('0xe')](_0xf62c('0x1d'),_0x554fce,JSON[_0xf62c('0x10')](_0x4f2cc2));_0x1aaeb9(_0x4f2cc2);})[_0xf62c('0x14')](function(_0x317253){logger[_0xf62c('0x11')](_0xf62c('0x1d'),_0x317253[_0xf62c('0x12')],_0x554fce);_0x56ec5f(_0x398d1c[_0xf62c('0x11')](0x1f4,_0x317253[_0xf62c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index b56a6f7..e358ba4 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 _0x6179=['../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/:id','show','/:id/fields','getFields','get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','create','setTags','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1b6745,_0x415aa6){var _0x1e099b=function(_0x26d951){while(--_0x26d951){_0x1b6745['push'](_0x1b6745['shift']());}};_0x1e099b(++_0x415aa6);}(_0x6179,0xbc));var _0x9617=function(_0xae282f,_0x2d9368){_0xae282f=_0xae282f-0x0;var _0x5f46d4=_0x6179[_0xae282f];return _0x5f46d4;};'use strict';var multer=require(_0x9617('0x0'));var util=require(_0x9617('0x1'));var path=require(_0x9617('0x2'));var timeout=require(_0x9617('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x9617('0x4'));var interaction=require(_0x9617('0x5'));var config=require('../../config/environment');var controller=require('./intDeskConfiguration.controller');router['get']('/',auth[_0x9617('0x6')](),controller[_0x9617('0x7')]);router['get'](_0x9617('0x8'),auth[_0x9617('0x6')](),controller[_0x9617('0x9')]);router['get'](_0x9617('0xa'),auth[_0x9617('0x6')](),controller[_0x9617('0xb')]);router[_0x9617('0xc')](_0x9617('0xd'),auth['isAuthenticated'](),controller[_0x9617('0xe')]);router['get'](_0x9617('0xf'),auth[_0x9617('0x6')](),controller[_0x9617('0x10')]);router['get']('/:id/tags',auth[_0x9617('0x6')](),controller[_0x9617('0x11')]);router['post']('/',auth[_0x9617('0x6')](),controller[_0x9617('0x12')]);router['post']('/:id/tags',auth[_0x9617('0x6')](),controller[_0x9617('0x13')]);router[_0x9617('0x14')](_0x9617('0x8'),auth[_0x9617('0x6')](),controller['update']);router[_0x9617('0x15')](_0x9617('0x8'),auth[_0x9617('0x6')](),controller[_0x9617('0x16')]);module[_0x9617('0x17')]=router; \ No newline at end of file +var _0x4ab7=['update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','isAuthenticated','show','get','/:id/fields','getFields','/:id/subjects','/:id/descriptions','/:id/tags','getTags','post','create','setTags'];(function(_0x1f05d2,_0x58d418){var _0x5a44c5=function(_0x2a24bc){while(--_0x2a24bc){_0x1f05d2['push'](_0x1f05d2['shift']());}};_0x5a44c5(++_0x58d418);}(_0x4ab7,0x1a1));var _0x74ab=function(_0x585f01,_0x5a8e76){_0x585f01=_0x585f01-0x0;var _0x17b445=_0x4ab7[_0x585f01];return _0x17b445;};'use strict';var multer=require(_0x74ab('0x0'));var util=require(_0x74ab('0x1'));var path=require('path');var timeout=require(_0x74ab('0x2'));var express=require('express');var router=express[_0x74ab('0x3')]();var auth=require(_0x74ab('0x4'));var interaction=require(_0x74ab('0x5'));var config=require(_0x74ab('0x6'));var controller=require(_0x74ab('0x7'));router['get']('/',auth[_0x74ab('0x8')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x74ab('0x9')]);router[_0x74ab('0xa')](_0x74ab('0xb'),auth[_0x74ab('0x8')](),controller[_0x74ab('0xc')]);router[_0x74ab('0xa')](_0x74ab('0xd'),auth[_0x74ab('0x8')](),controller['getSubjects']);router['get'](_0x74ab('0xe'),auth[_0x74ab('0x8')](),controller['getDescriptions']);router[_0x74ab('0xa')](_0x74ab('0xf'),auth[_0x74ab('0x8')](),controller[_0x74ab('0x10')]);router[_0x74ab('0x11')]('/',auth['isAuthenticated'](),controller[_0x74ab('0x12')]);router[_0x74ab('0x11')](_0x74ab('0xf'),auth[_0x74ab('0x8')](),controller[_0x74ab('0x13')]);router['put']('/:id',auth[_0x74ab('0x8')](),controller[_0x74ab('0x14')]);router[_0x74ab('0x15')]('/:id',auth[_0x74ab('0x8')](),controller[_0x74ab('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 91d6175..24b7355 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 _0xeddc=['sequelize','exports','STRING'];(function(_0x413f26,_0x438a1d){var _0x3341f1=function(_0x3d1922){while(--_0x3d1922){_0x413f26['push'](_0x413f26['shift']());}};_0x3341f1(++_0x438a1d);}(_0xeddc,0xde));var _0xcedd=function(_0x21b5e6,_0x1b9b8a){_0x21b5e6=_0x21b5e6-0x0;var _0x346b20=_0xeddc[_0x21b5e6];return _0x346b20;};'use strict';var Sequelize=require(_0xcedd('0x0'));module[_0xcedd('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcedd('0x2')]}}; \ No newline at end of file +var _0x0dbd=['STRING','sequelize','exports'];(function(_0x3c23fd,_0x2018c2){var _0x3636a1=function(_0x1a041e){while(--_0x1a041e){_0x3c23fd['push'](_0x3c23fd['shift']());}};_0x3636a1(++_0x2018c2);}(_0x0dbd,0x121));var _0xd0db=function(_0x3ae536,_0x579389){_0x3ae536=_0x3ae536-0x0;var _0x35c956=_0x0dbd[_0x3ae536];return _0x35c956;};'use strict';var Sequelize=require(_0xd0db('0x0'));module[_0xd0db('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd0db('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 201c1ae..0b89b80 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 _0xc2e1=['papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../mysqldb','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','destroy','stack','name','send','index','DeskConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','catch','show','params','find','create','body','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js'];(function(_0x9d44eb,_0x16c76a){var _0x1a8d92=function(_0x47314c){while(--_0x47314c){_0x9d44eb['push'](_0x9d44eb['shift']());}};_0x1a8d92(++_0x16c76a);}(_0xc2e1,0x1b3));var _0x1c2e=function(_0xe0372e,_0x32ae8b){_0xe0372e=_0xe0372e-0x0;var _0x3c56ab=_0xc2e1[_0xe0372e];return _0x3c56ab;};'use strict';var pdf=require(_0x1c2e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1c2e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1c2e('0x2'));var moment=require(_0x1c2e('0x3'));var BPromise=require(_0x1c2e('0x4'));var Mustache=require(_0x1c2e('0x5'));var util=require(_0x1c2e('0x6'));var path=require(_0x1c2e('0x7'));var sox=require(_0x1c2e('0x8'));var csv=require(_0x1c2e('0x9'));var ejs=require(_0x1c2e('0xa'));var fs=require('fs');var _=require(_0x1c2e('0xb'));var squel=require('squel');var crypto=require(_0x1c2e('0xc'));var jsforce=require(_0x1c2e('0xd'));var deskjs=require(_0x1c2e('0xe'));var toCsv=require(_0x1c2e('0x9'));var querystring=require('querystring');var Papa=require(_0x1c2e('0xf'));var Redis=require(_0x1c2e('0x10'));var authService=require(_0x1c2e('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1c2e('0x12'))(_0x1c2e('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x1c2e('0x14'))['db'];var jayson=require(_0x1c2e('0x15'));var client=jayson['client'][_0x1c2e('0x16')]({'port':0x232a});function checkPasswordPattern(_0x28e33c,_0x291734,_0x2f8cad){if(_0x2f8cad){var _0x7af858=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x7af858['test'](_0x291734)){return _0x28e33c;}else{throw new Error(_0x1c2e('0x17'));}}else{return _0x28e33c;}}function respondWithRpcPromise(_0x32a6c0,_0x2e9709,_0x22d190,_0x581144){return new BPromise(function(_0xdcd657,_0x44ea76){var _0x2878b0=_0x581144||client;return _0x2878b0['request'](_0x32a6c0,_0x22d190)[_0x1c2e('0x18')](function(_0x5e24d5){logger['info'](_0x1c2e('0x19'),_0x2e9709,_0x1c2e('0x1a'));logger['debug'](_0x1c2e('0x1b'),_0x2e9709,_0x1c2e('0x1a'),JSON[_0x1c2e('0x1c')](_0x5e24d5));if(_0x5e24d5[_0x1c2e('0x1d')]){if(_0x5e24d5[_0x1c2e('0x1d')][_0x1c2e('0x1e')]===0x1f4){logger[_0x1c2e('0x1d')]('DeskConfiguration,\x20%s,\x20%s',_0x2e9709,_0x5e24d5['error']['message']);return _0x44ea76(_0x5e24d5[_0x1c2e('0x1d')][_0x1c2e('0x1f')]);}logger['error'](_0x1c2e('0x19'),_0x2e9709,_0x5e24d5[_0x1c2e('0x1d')][_0x1c2e('0x1f')]);return _0xdcd657(_0x5e24d5['error'][_0x1c2e('0x1f')]);}else{logger[_0x1c2e('0x20')]('DeskConfiguration,\x20%s,\x20%s',_0x2e9709,_0x1c2e('0x1a'));_0xdcd657(_0x5e24d5['result'][_0x1c2e('0x1f')]);}})['catch'](function(_0x542ae1){logger[_0x1c2e('0x1d')](_0x1c2e('0x19'),_0x2e9709,_0x542ae1);_0x44ea76(_0x542ae1);});});}function respondWithStatusCode(_0x32c552,_0x168d1e){_0x168d1e=_0x168d1e||0xcc;return function(_0x2334fa){if(_0x2334fa){return _0x32c552[_0x1c2e('0x21')](_0x168d1e);}return _0x32c552[_0x1c2e('0x22')](_0x168d1e)[_0x1c2e('0x23')]();};}function respondWithResult(_0x518c48,_0x4d7e76){_0x4d7e76=_0x4d7e76||0xc8;return function(_0x4877a3){if(_0x4877a3){return _0x518c48[_0x1c2e('0x22')](_0x4d7e76)[_0x1c2e('0x24')](_0x4877a3);}};}function respondWithFilteredResult(_0x4f5f8f,_0x100a28){return function(_0x16676e){if(_0x16676e){var _0x22c819=_0x16676e[_0x1c2e('0x25')],_0x516a92=_0x100a28[_0x1c2e('0x26')],_0x144ee2=_0x100a28['offset']+_0x100a28[_0x1c2e('0x27')],_0x3b0f83;if(_0x144ee2>=_0x22c819){_0x144ee2=_0x22c819;_0x3b0f83=0xc8;}else{_0x3b0f83=0xce;}_0x4f5f8f['status'](_0x3b0f83);return _0x4f5f8f['set'](_0x1c2e('0x28'),_0x516a92+'-'+_0x144ee2+'/'+_0x22c819)[_0x1c2e('0x24')](_0x16676e);}return null;};}function patchUpdates(_0x4dad71){return function(_0x57c34d){try{jsonpatch[_0x1c2e('0x29')](_0x57c34d,_0x4dad71,!![]);}catch(_0x1096ff){return BPromise[_0x1c2e('0x2a')](_0x1096ff);}return _0x57c34d[_0x1c2e('0x2b')]();};}function saveUpdates(_0x5ae066,_0x46d53b){return function(_0xa0e0cc){if(_0xa0e0cc){return _0xa0e0cc['update'](_0x5ae066)[_0x1c2e('0x18')](function(_0xdd0098){return _0xdd0098;});}return null;};}function removeEntity(_0x43938c,_0x51668d){return function(_0x87ce41){if(_0x87ce41){return _0x87ce41[_0x1c2e('0x2c')]()[_0x1c2e('0x18')](function(){_0x43938c[_0x1c2e('0x22')](0xcc)[_0x1c2e('0x23')]();});}};}function handleEntityNotFound(_0x24b5f1,_0xb986bc){return function(_0x37ccea){if(!_0x37ccea){_0x24b5f1[_0x1c2e('0x21')](0x194);}return _0x37ccea;};}function handleError(_0x50878d,_0x18af52){_0x18af52=_0x18af52||0x1f4;return function(_0x389bd0){logger[_0x1c2e('0x1d')](_0x389bd0[_0x1c2e('0x2d')]);if(_0x389bd0[_0x1c2e('0x2e')]){delete _0x389bd0[_0x1c2e('0x2e')];}_0x50878d[_0x1c2e('0x22')](_0x18af52)[_0x1c2e('0x2f')](_0x389bd0);};}exports[_0x1c2e('0x30')]=function(_0x55033b,_0x39aa8a){var _0x3adafd={},_0x34dea8={},_0x2efa0c={'count':0x0,'rows':[]};var _0x5bcf0a=db[_0x1c2e('0x31')][_0x1c2e('0x32')];_0x34dea8[_0x1c2e('0x33')]=_[_0x1c2e('0x34')](_0x5bcf0a);_0x34dea8[_0x1c2e('0x35')]=_[_0x1c2e('0x34')](_0x55033b[_0x1c2e('0x35')]);_0x34dea8[_0x1c2e('0x36')]=_[_0x1c2e('0x37')](_0x34dea8['model'],_0x34dea8[_0x1c2e('0x35')]);_0x3adafd[_0x1c2e('0x38')]=_[_0x1c2e('0x37')](_0x34dea8[_0x1c2e('0x33')],qs[_0x1c2e('0x39')](_0x55033b[_0x1c2e('0x35')]['fields']));_0x3adafd[_0x1c2e('0x38')]=_0x3adafd[_0x1c2e('0x38')][_0x1c2e('0x3a')]?_0x3adafd['attributes']:_0x34dea8[_0x1c2e('0x33')];if(!_0x55033b['query'][_0x1c2e('0x3b')](_0x1c2e('0x3c'))){_0x3adafd['limit']=qs['limit'](_0x55033b['query'][_0x1c2e('0x27')]);_0x3adafd[_0x1c2e('0x26')]=qs[_0x1c2e('0x26')](_0x55033b[_0x1c2e('0x35')][_0x1c2e('0x26')]);}_0x3adafd[_0x1c2e('0x3d')]=qs[_0x1c2e('0x3e')](_0x55033b[_0x1c2e('0x35')]['sort']);_0x3adafd[_0x1c2e('0x3f')]=qs[_0x1c2e('0x36')](_[_0x1c2e('0x40')](_0x55033b[_0x1c2e('0x35')],_0x34dea8[_0x1c2e('0x36')]));if(_0x55033b[_0x1c2e('0x35')][_0x1c2e('0x41')]){_0x3adafd[_0x1c2e('0x3f')]=_[_0x1c2e('0x42')](_0x3adafd['where'],{'$or':_[_0x1c2e('0x43')](_0x5bcf0a,function(_0x204875){if(_0x204875[_0x1c2e('0x44')][_0x1c2e('0x45')]!==_0x1c2e('0x46')){var _0x530fa5={};_0x530fa5[_0x204875[_0x1c2e('0x47')]]={'$like':'%'+_0x55033b[_0x1c2e('0x35')][_0x1c2e('0x41')]+'%'};return _0x530fa5;}})});}_0x3adafd=_[_0x1c2e('0x42')]({},_0x3adafd,_0x55033b[_0x1c2e('0x48')]);var _0x25f406={'where':_0x3adafd[_0x1c2e('0x3f')]};return db[_0x1c2e('0x31')][_0x1c2e('0x25')](_0x25f406)[_0x1c2e('0x18')](function(_0x15639b){_0x2efa0c['count']=_0x15639b;if(_0x55033b[_0x1c2e('0x35')][_0x1c2e('0x49')]){_0x3adafd[_0x1c2e('0x4a')]=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x3adafd);})['then'](function(_0xfbf6a2){_0x2efa0c['rows']=_0xfbf6a2;return _0x2efa0c;})[_0x1c2e('0x18')](respondWithFilteredResult(_0x39aa8a,_0x3adafd))[_0x1c2e('0x4b')](handleError(_0x39aa8a,null));};exports[_0x1c2e('0x4c')]=function(_0x198852,_0x11ce42){var _0x15e988={'raw':![],'where':{'id':_0x198852[_0x1c2e('0x4d')]['id']}},_0x516dd9={};_0x516dd9['model']=_[_0x1c2e('0x34')](db[_0x1c2e('0x31')]['rawAttributes']);_0x516dd9[_0x1c2e('0x35')]=_[_0x1c2e('0x34')](_0x198852[_0x1c2e('0x35')]);_0x516dd9['filters']=_['intersection'](_0x516dd9[_0x1c2e('0x33')],_0x516dd9[_0x1c2e('0x35')]);_0x15e988[_0x1c2e('0x38')]=_['intersection'](_0x516dd9[_0x1c2e('0x33')],qs[_0x1c2e('0x39')](_0x198852['query'][_0x1c2e('0x39')]));_0x15e988[_0x1c2e('0x38')]=_0x15e988[_0x1c2e('0x38')][_0x1c2e('0x3a')]?_0x15e988[_0x1c2e('0x38')]:_0x516dd9['model'];if(_0x198852[_0x1c2e('0x35')][_0x1c2e('0x49')]){_0x15e988[_0x1c2e('0x4a')]=[{'all':!![]}];}_0x15e988=_[_0x1c2e('0x42')]({},_0x15e988,_0x198852[_0x1c2e('0x48')]);return db[_0x1c2e('0x31')][_0x1c2e('0x4e')](_0x15e988)[_0x1c2e('0x18')](handleEntityNotFound(_0x11ce42,null))[_0x1c2e('0x18')](respondWithResult(_0x11ce42,null))[_0x1c2e('0x4b')](handleError(_0x11ce42,null));};exports[_0x1c2e('0x4f')]=function(_0x46ab1b,_0x4ac617){return db[_0x1c2e('0x31')][_0x1c2e('0x4f')](_0x46ab1b[_0x1c2e('0x50')],{})['then'](respondWithResult(_0x4ac617,0xc9))['catch'](handleError(_0x4ac617,null));};exports['update']=function(_0x12d025,_0x1c005d){if(_0x12d025[_0x1c2e('0x50')]['id']){delete _0x12d025['body']['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x12d025[_0x1c2e('0x4d')]['id']}})[_0x1c2e('0x18')](handleEntityNotFound(_0x1c005d,null))[_0x1c2e('0x18')](saveUpdates(_0x12d025[_0x1c2e('0x50')],null))['then'](respondWithResult(_0x1c005d,null))['catch'](handleError(_0x1c005d,null));};exports[_0x1c2e('0x2c')]=function(_0x382a15,_0x1bdc9f){return db[_0x1c2e('0x31')][_0x1c2e('0x4e')]({'where':{'id':_0x382a15[_0x1c2e('0x4d')]['id']}})[_0x1c2e('0x18')](handleEntityNotFound(_0x1bdc9f,null))['then'](removeEntity(_0x1bdc9f,null))[_0x1c2e('0x4b')](handleError(_0x1bdc9f,null));};exports[_0x1c2e('0x51')]=function(_0x1aab64,_0x4acb1a,_0x3983b8){var _0x35c2e7={};var _0xba0bae={};var _0x2a9374;var _0x4a72e3;return db[_0x1c2e('0x31')][_0x1c2e('0x52')]({'where':{'id':_0x1aab64['params']['id']}})['then'](handleEntityNotFound(_0x4acb1a,null))[_0x1c2e('0x18')](function(_0x56cba7){if(_0x56cba7){_0x2a9374=_0x56cba7;_0xba0bae[_0x1c2e('0x33')]=_['keys'](db[_0x1c2e('0x53')]['rawAttributes']);_0xba0bae['query']=_[_0x1c2e('0x34')](_0x1aab64['query']);_0xba0bae[_0x1c2e('0x36')]=_[_0x1c2e('0x37')](_0xba0bae[_0x1c2e('0x33')],_0xba0bae[_0x1c2e('0x35')]);_0x35c2e7[_0x1c2e('0x38')]=_['intersection'](_0xba0bae['model'],qs[_0x1c2e('0x39')](_0x1aab64['query']['fields']));_0x35c2e7[_0x1c2e('0x38')]=_0x35c2e7['attributes'][_0x1c2e('0x3a')]?_0x35c2e7[_0x1c2e('0x38')]:_0xba0bae[_0x1c2e('0x33')];_0x35c2e7[_0x1c2e('0x3d')]=qs[_0x1c2e('0x3e')](_0x1aab64[_0x1c2e('0x35')][_0x1c2e('0x3e')]);_0x35c2e7[_0x1c2e('0x3f')]=qs[_0x1c2e('0x36')](_[_0x1c2e('0x40')](_0x1aab64[_0x1c2e('0x35')],_0xba0bae[_0x1c2e('0x36')]));if(_0x1aab64[_0x1c2e('0x35')]['filter']){_0x35c2e7[_0x1c2e('0x3f')]=_[_0x1c2e('0x42')](_0x35c2e7[_0x1c2e('0x3f')],{'$or':_['map'](_0x35c2e7[_0x1c2e('0x38')],function(_0x289ded){var _0xfc758d={};_0xfc758d[_0x289ded]={'$like':'%'+_0x1aab64['query'][_0x1c2e('0x41')]+'%'};return _0xfc758d;})});}_0x35c2e7=_['merge']({},_0x35c2e7,_0x1aab64[_0x1c2e('0x48')]);return _0x2a9374[_0x1c2e('0x51')](_0x35c2e7);}})[_0x1c2e('0x18')](function(_0x2e2c1b){if(_0x2e2c1b){_0x4a72e3=_0x2e2c1b['length'];if(!_0x1aab64[_0x1c2e('0x35')][_0x1c2e('0x3b')](_0x1c2e('0x3c'))){_0x35c2e7[_0x1c2e('0x27')]=qs[_0x1c2e('0x27')](_0x1aab64[_0x1c2e('0x35')][_0x1c2e('0x27')]);_0x35c2e7[_0x1c2e('0x26')]=qs[_0x1c2e('0x26')](_0x1aab64[_0x1c2e('0x35')][_0x1c2e('0x26')]);}return _0x2a9374[_0x1c2e('0x51')](_0x35c2e7);}})[_0x1c2e('0x18')](function(_0x3d0f59){if(_0x3d0f59){return _0x3d0f59?{'count':_0x4a72e3,'rows':_0x3d0f59}:null;}})[_0x1c2e('0x18')](respondWithResult(_0x4acb1a,null))[_0x1c2e('0x4b')](handleError(_0x4acb1a,null));};exports[_0x1c2e('0x54')]=function(_0x13e915,_0x48b73e,_0x45b60b){var _0x449c6e={};var _0x35b1be={};var _0x339ce2;var _0x318e99;return db[_0x1c2e('0x31')][_0x1c2e('0x52')]({'where':{'id':_0x13e915[_0x1c2e('0x4d')]['id']}})[_0x1c2e('0x18')](handleEntityNotFound(_0x48b73e,null))[_0x1c2e('0x18')](function(_0x1e72ec){if(_0x1e72ec){_0x339ce2=_0x1e72ec;_0x35b1be[_0x1c2e('0x33')]=_[_0x1c2e('0x34')](db[_0x1c2e('0x53')]['rawAttributes']);_0x35b1be[_0x1c2e('0x35')]=_[_0x1c2e('0x34')](_0x13e915['query']);_0x35b1be[_0x1c2e('0x36')]=_[_0x1c2e('0x37')](_0x35b1be[_0x1c2e('0x33')],_0x35b1be[_0x1c2e('0x35')]);_0x449c6e['attributes']=_['intersection'](_0x35b1be[_0x1c2e('0x33')],qs[_0x1c2e('0x39')](_0x13e915['query'][_0x1c2e('0x39')]));_0x449c6e[_0x1c2e('0x38')]=_0x449c6e['attributes'][_0x1c2e('0x3a')]?_0x449c6e[_0x1c2e('0x38')]:_0x35b1be[_0x1c2e('0x33')];_0x449c6e[_0x1c2e('0x3d')]=qs[_0x1c2e('0x3e')](_0x13e915[_0x1c2e('0x35')][_0x1c2e('0x3e')]);_0x449c6e['where']=qs[_0x1c2e('0x36')](_['pick'](_0x13e915[_0x1c2e('0x35')],_0x35b1be[_0x1c2e('0x36')]));if(_0x13e915[_0x1c2e('0x35')]['filter']){_0x449c6e[_0x1c2e('0x3f')]=_[_0x1c2e('0x42')](_0x449c6e[_0x1c2e('0x3f')],{'$or':_[_0x1c2e('0x43')](_0x449c6e[_0x1c2e('0x38')],function(_0x10e07c){var _0x2379fb={};_0x2379fb[_0x10e07c]={'$like':'%'+_0x13e915['query'][_0x1c2e('0x41')]+'%'};return _0x2379fb;})});}_0x449c6e=_[_0x1c2e('0x42')]({},_0x449c6e,_0x13e915['options']);return _0x339ce2[_0x1c2e('0x54')](_0x449c6e);}})['then'](function(_0x26678e){if(_0x26678e){_0x318e99=_0x26678e[_0x1c2e('0x3a')];if(!_0x13e915[_0x1c2e('0x35')][_0x1c2e('0x3b')](_0x1c2e('0x3c'))){_0x449c6e[_0x1c2e('0x27')]=qs['limit'](_0x13e915[_0x1c2e('0x35')][_0x1c2e('0x27')]);_0x449c6e['offset']=qs[_0x1c2e('0x26')](_0x13e915[_0x1c2e('0x35')][_0x1c2e('0x26')]);}return _0x339ce2['getSubjects'](_0x449c6e);}})[_0x1c2e('0x18')](function(_0xf4cd77){if(_0xf4cd77){return _0xf4cd77?{'count':_0x318e99,'rows':_0xf4cd77}:null;}})[_0x1c2e('0x18')](respondWithResult(_0x48b73e,null))[_0x1c2e('0x4b')](handleError(_0x48b73e,null));};exports[_0x1c2e('0x55')]=function(_0x473a05,_0x4c8755,_0x2daa1b){var _0x1c1df1={};var _0x4df32c={};var _0x5e5bb0;var _0x2e460d;return db[_0x1c2e('0x31')][_0x1c2e('0x52')]({'where':{'id':_0x473a05[_0x1c2e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4c8755,null))[_0x1c2e('0x18')](function(_0x214166){if(_0x214166){_0x5e5bb0=_0x214166;_0x4df32c[_0x1c2e('0x33')]=_[_0x1c2e('0x34')](db[_0x1c2e('0x53')][_0x1c2e('0x32')]);_0x4df32c['query']=_['keys'](_0x473a05['query']);_0x4df32c[_0x1c2e('0x36')]=_['intersection'](_0x4df32c[_0x1c2e('0x33')],_0x4df32c[_0x1c2e('0x35')]);_0x1c1df1[_0x1c2e('0x38')]=_[_0x1c2e('0x37')](_0x4df32c[_0x1c2e('0x33')],qs[_0x1c2e('0x39')](_0x473a05['query'][_0x1c2e('0x39')]));_0x1c1df1[_0x1c2e('0x38')]=_0x1c1df1[_0x1c2e('0x38')][_0x1c2e('0x3a')]?_0x1c1df1[_0x1c2e('0x38')]:_0x4df32c['model'];_0x1c1df1[_0x1c2e('0x3d')]=qs[_0x1c2e('0x3e')](_0x473a05[_0x1c2e('0x35')][_0x1c2e('0x3e')]);_0x1c1df1['where']=qs[_0x1c2e('0x36')](_[_0x1c2e('0x40')](_0x473a05[_0x1c2e('0x35')],_0x4df32c[_0x1c2e('0x36')]));if(_0x473a05['query'][_0x1c2e('0x41')]){_0x1c1df1['where']=_[_0x1c2e('0x42')](_0x1c1df1['where'],{'$or':_['map'](_0x1c1df1[_0x1c2e('0x38')],function(_0x580c8a){var _0x26c908={};_0x26c908[_0x580c8a]={'$like':'%'+_0x473a05[_0x1c2e('0x35')][_0x1c2e('0x41')]+'%'};return _0x26c908;})});}_0x1c1df1=_[_0x1c2e('0x42')]({},_0x1c1df1,_0x473a05['options']);return _0x5e5bb0[_0x1c2e('0x55')](_0x1c1df1);}})[_0x1c2e('0x18')](function(_0x1ccbb2){if(_0x1ccbb2){_0x2e460d=_0x1ccbb2[_0x1c2e('0x3a')];if(!_0x473a05[_0x1c2e('0x35')][_0x1c2e('0x3b')](_0x1c2e('0x3c'))){_0x1c1df1[_0x1c2e('0x27')]=qs[_0x1c2e('0x27')](_0x473a05[_0x1c2e('0x35')][_0x1c2e('0x27')]);_0x1c1df1['offset']=qs[_0x1c2e('0x26')](_0x473a05[_0x1c2e('0x35')][_0x1c2e('0x26')]);}return _0x5e5bb0[_0x1c2e('0x55')](_0x1c1df1);}})['then'](function(_0x118065){if(_0x118065){return _0x118065?{'count':_0x2e460d,'rows':_0x118065}:null;}})[_0x1c2e('0x18')](respondWithResult(_0x4c8755,null))[_0x1c2e('0x4b')](handleError(_0x4c8755,null));};exports[_0x1c2e('0x56')]=function(_0xd7651c,_0x53c8d0,_0x22513a){var _0x89d642={};var _0x2b8117={};var _0x1d99ac;var _0x441820;return db[_0x1c2e('0x31')][_0x1c2e('0x52')]({'where':{'id':_0xd7651c[_0x1c2e('0x4d')]['id']}})[_0x1c2e('0x18')](handleEntityNotFound(_0x53c8d0,null))[_0x1c2e('0x18')](function(_0x3bf59a){if(_0x3bf59a){_0x1d99ac=_0x3bf59a;_0x2b8117['model']=_[_0x1c2e('0x34')](db[_0x1c2e('0x57')]['rawAttributes']);_0x2b8117['query']=_[_0x1c2e('0x34')](_0xd7651c[_0x1c2e('0x35')]);_0x2b8117[_0x1c2e('0x36')]=_[_0x1c2e('0x37')](_0x2b8117[_0x1c2e('0x33')],_0x2b8117[_0x1c2e('0x35')]);_0x89d642['attributes']=_['intersection'](_0x2b8117[_0x1c2e('0x33')],qs['fields'](_0xd7651c['query']['fields']));_0x89d642[_0x1c2e('0x38')]=_0x89d642[_0x1c2e('0x38')][_0x1c2e('0x3a')]?_0x89d642[_0x1c2e('0x38')]:_0x2b8117[_0x1c2e('0x33')];_0x89d642[_0x1c2e('0x3d')]=qs['sort'](_0xd7651c[_0x1c2e('0x35')]['sort']);_0x89d642['where']=qs[_0x1c2e('0x36')](_[_0x1c2e('0x40')](_0xd7651c['query'],_0x2b8117[_0x1c2e('0x36')]));if(_0xd7651c[_0x1c2e('0x35')][_0x1c2e('0x41')]){_0x89d642[_0x1c2e('0x3f')]=_['merge'](_0x89d642[_0x1c2e('0x3f')],{'$or':_['map'](_0x89d642[_0x1c2e('0x38')],function(_0x177ea2){var _0x539df3={};_0x539df3[_0x177ea2]={'$like':'%'+_0xd7651c[_0x1c2e('0x35')][_0x1c2e('0x41')]+'%'};return _0x539df3;})});}_0x89d642=_[_0x1c2e('0x42')]({},_0x89d642,_0xd7651c[_0x1c2e('0x48')]);return _0x1d99ac[_0x1c2e('0x56')](_0x89d642);}})[_0x1c2e('0x18')](function(_0x236298){if(_0x236298){_0x441820=_0x236298[_0x1c2e('0x3a')];if(!_0xd7651c[_0x1c2e('0x35')]['hasOwnProperty'](_0x1c2e('0x3c'))){_0x89d642[_0x1c2e('0x27')]=qs['limit'](_0xd7651c[_0x1c2e('0x35')][_0x1c2e('0x27')]);_0x89d642[_0x1c2e('0x26')]=qs[_0x1c2e('0x26')](_0xd7651c[_0x1c2e('0x35')][_0x1c2e('0x26')]);}return _0x1d99ac[_0x1c2e('0x56')](_0x89d642);}})[_0x1c2e('0x18')](function(_0x5d3b1b){if(_0x5d3b1b){return _0x5d3b1b?{'count':_0x441820,'rows':_0x5d3b1b}:null;}})[_0x1c2e('0x18')](respondWithResult(_0x53c8d0,null))[_0x1c2e('0x4b')](handleError(_0x53c8d0,null));};exports[_0x1c2e('0x58')]=function(_0x324b49,_0x1072aa,_0x1f9edb){if(_0x324b49[_0x1c2e('0x50')]['id']){delete _0x324b49['body']['id'];}return db['DeskConfiguration'][_0x1c2e('0x52')]({'where':{'id':_0x324b49[_0x1c2e('0x4d')]['id']}})[_0x1c2e('0x18')](handleEntityNotFound(_0x1072aa,null))[_0x1c2e('0x18')](function(_0x48da97){if(_0x48da97){return _0x48da97[_0x1c2e('0x58')](_0x324b49[_0x1c2e('0x50')][_0x1c2e('0x59')]||[]);}return null;})[_0x1c2e('0x18')](respondWithResult(_0x1072aa,null))[_0x1c2e('0x4b')](handleError(_0x1072aa,null));}; \ No newline at end of file +var _0xcd54=['lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','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~!@#$%^&-_=+[{]}.','request','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','status','end','json','count','offset','apply','save','update','then','destroy','sendStatus','stack','name','DeskConfiguration','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','getFields','findOne','DeskField','length','pick','options','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','moment','mustache','util','path','to-csv','ejs'];(function(_0x588a99,_0x36271b){var _0x1aaf30=function(_0x14ce24){while(--_0x14ce24){_0x588a99['push'](_0x588a99['shift']());}};_0x1aaf30(++_0x36271b);}(_0xcd54,0xaf));var _0x4cd5=function(_0x5710e6,_0x425eda){_0x5710e6=_0x5710e6-0x0;var _0x3f6350=_0xcd54[_0x5710e6];return _0x3f6350;};'use strict';var pdf=require(_0x4cd5('0x0'));var emlformat=require(_0x4cd5('0x1'));var rimraf=require(_0x4cd5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4cd5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4cd5('0x4'));var util=require(_0x4cd5('0x5'));var path=require(_0x4cd5('0x6'));var sox=require('sox');var csv=require(_0x4cd5('0x7'));var ejs=require(_0x4cd5('0x8'));var fs=require('fs');var _=require(_0x4cd5('0x9'));var squel=require(_0x4cd5('0xa'));var crypto=require(_0x4cd5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4cd5('0xc'));var toCsv=require(_0x4cd5('0x7'));var querystring=require(_0x4cd5('0xd'));var Papa=require(_0x4cd5('0xe'));var Redis=require('ioredis');var authService=require(_0x4cd5('0xf'));var qs=require(_0x4cd5('0x10'));var hardwareService=require(_0x4cd5('0x11'));var logger=require('../../config/logger')(_0x4cd5('0x12'));var utils=require(_0x4cd5('0x13'));var config=require(_0x4cd5('0x14'));var db=require(_0x4cd5('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x4cd5('0x16')][_0x4cd5('0x17')]({'port':0x232a});function checkPasswordPattern(_0x45791a,_0x4a0d59,_0x377e5a){if(_0x377e5a){var _0x3cb420=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3cb420[_0x4cd5('0x18')](_0x4a0d59)){return _0x45791a;}else{throw new Error(_0x4cd5('0x19'));}}else{return _0x45791a;}}function respondWithRpcPromise(_0x16580a,_0x404c8c,_0x1bd9c1,_0x33b466){return new BPromise(function(_0x410d9c,_0x57ce6d){var _0x157436=_0x33b466||client;return _0x157436[_0x4cd5('0x1a')](_0x16580a,_0x1bd9c1)['then'](function(_0x1c0af4){logger['info'](_0x4cd5('0x1b'),_0x404c8c,_0x4cd5('0x1c'));logger[_0x4cd5('0x1d')](_0x4cd5('0x1e'),_0x404c8c,_0x4cd5('0x1c'),JSON[_0x4cd5('0x1f')](_0x1c0af4));if(_0x1c0af4[_0x4cd5('0x20')]){if(_0x1c0af4['error'][_0x4cd5('0x21')]===0x1f4){logger[_0x4cd5('0x20')](_0x4cd5('0x1b'),_0x404c8c,_0x1c0af4['error']['message']);return _0x57ce6d(_0x1c0af4[_0x4cd5('0x20')][_0x4cd5('0x22')]);}logger[_0x4cd5('0x20')](_0x4cd5('0x1b'),_0x404c8c,_0x1c0af4[_0x4cd5('0x20')][_0x4cd5('0x22')]);return _0x410d9c(_0x1c0af4['error'][_0x4cd5('0x22')]);}else{logger[_0x4cd5('0x23')](_0x4cd5('0x1b'),_0x404c8c,_0x4cd5('0x1c'));_0x410d9c(_0x1c0af4[_0x4cd5('0x24')][_0x4cd5('0x22')]);}})['catch'](function(_0xa0481f){logger[_0x4cd5('0x20')](_0x4cd5('0x1b'),_0x404c8c,_0xa0481f);_0x57ce6d(_0xa0481f);});});}function respondWithStatusCode(_0x3ac858,_0x468fe9){_0x468fe9=_0x468fe9||0xcc;return function(_0xa86d5d){if(_0xa86d5d){return _0x3ac858['sendStatus'](_0x468fe9);}return _0x3ac858[_0x4cd5('0x25')](_0x468fe9)[_0x4cd5('0x26')]();};}function respondWithResult(_0xcfbdf2,_0x39a6d6){_0x39a6d6=_0x39a6d6||0xc8;return function(_0x27d7de){if(_0x27d7de){return _0xcfbdf2[_0x4cd5('0x25')](_0x39a6d6)[_0x4cd5('0x27')](_0x27d7de);}};}function respondWithFilteredResult(_0xb07446,_0x19bee3){return function(_0x5ad520){if(_0x5ad520){var _0x54885c=_0x5ad520[_0x4cd5('0x28')],_0x49b495=_0x19bee3[_0x4cd5('0x29')],_0x58cb5c=_0x19bee3[_0x4cd5('0x29')]+_0x19bee3['limit'],_0x299f5c;if(_0x58cb5c>=_0x54885c){_0x58cb5c=_0x54885c;_0x299f5c=0xc8;}else{_0x299f5c=0xce;}_0xb07446[_0x4cd5('0x25')](_0x299f5c);return _0xb07446['set']('Content-Range',_0x49b495+'-'+_0x58cb5c+'/'+_0x54885c)[_0x4cd5('0x27')](_0x5ad520);}return null;};}function patchUpdates(_0x2e1e0e){return function(_0x43de9f){try{jsonpatch[_0x4cd5('0x2a')](_0x43de9f,_0x2e1e0e,!![]);}catch(_0x1c80ef){return BPromise['reject'](_0x1c80ef);}return _0x43de9f[_0x4cd5('0x2b')]();};}function saveUpdates(_0x55edd8,_0x5ce84d){return function(_0x36e8dd){if(_0x36e8dd){return _0x36e8dd[_0x4cd5('0x2c')](_0x55edd8)[_0x4cd5('0x2d')](function(_0x2472b0){return _0x2472b0;});}return null;};}function removeEntity(_0x152971,_0xb6da57){return function(_0x3ce303){if(_0x3ce303){return _0x3ce303[_0x4cd5('0x2e')]()[_0x4cd5('0x2d')](function(){_0x152971['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x74b825,_0x405205){return function(_0x33c22c){if(!_0x33c22c){_0x74b825[_0x4cd5('0x2f')](0x194);}return _0x33c22c;};}function handleError(_0x382991,_0x2180d4){_0x2180d4=_0x2180d4||0x1f4;return function(_0x3085af){logger[_0x4cd5('0x20')](_0x3085af[_0x4cd5('0x30')]);if(_0x3085af[_0x4cd5('0x31')]){delete _0x3085af['name'];}_0x382991[_0x4cd5('0x25')](_0x2180d4)['send'](_0x3085af);};}exports['index']=function(_0x224d8d,_0xe1695d){var _0x3ad15a={},_0x51677b={},_0x4e7252={'count':0x0,'rows':[]};var _0x1a3d9e=db[_0x4cd5('0x32')]['rawAttributes'];_0x51677b[_0x4cd5('0x33')]=_[_0x4cd5('0x34')](_0x1a3d9e);_0x51677b['query']=_[_0x4cd5('0x34')](_0x224d8d[_0x4cd5('0x35')]);_0x51677b['filters']=_[_0x4cd5('0x36')](_0x51677b[_0x4cd5('0x33')],_0x51677b['query']);_0x3ad15a[_0x4cd5('0x37')]=_[_0x4cd5('0x36')](_0x51677b[_0x4cd5('0x33')],qs[_0x4cd5('0x38')](_0x224d8d['query'][_0x4cd5('0x38')]));_0x3ad15a[_0x4cd5('0x37')]=_0x3ad15a['attributes']['length']?_0x3ad15a[_0x4cd5('0x37')]:_0x51677b[_0x4cd5('0x33')];if(!_0x224d8d[_0x4cd5('0x35')][_0x4cd5('0x39')](_0x4cd5('0x3a'))){_0x3ad15a[_0x4cd5('0x3b')]=qs[_0x4cd5('0x3b')](_0x224d8d[_0x4cd5('0x35')][_0x4cd5('0x3b')]);_0x3ad15a[_0x4cd5('0x29')]=qs[_0x4cd5('0x29')](_0x224d8d['query']['offset']);}_0x3ad15a[_0x4cd5('0x3c')]=qs[_0x4cd5('0x3d')](_0x224d8d[_0x4cd5('0x35')][_0x4cd5('0x3d')]);_0x3ad15a[_0x4cd5('0x3e')]=qs[_0x4cd5('0x3f')](_['pick'](_0x224d8d[_0x4cd5('0x35')],_0x51677b[_0x4cd5('0x3f')]));if(_0x224d8d[_0x4cd5('0x35')][_0x4cd5('0x40')]){_0x3ad15a['where']=_[_0x4cd5('0x41')](_0x3ad15a['where'],{'$or':_[_0x4cd5('0x42')](_0x1a3d9e,function(_0x48aee8){if(_0x48aee8[_0x4cd5('0x43')][_0x4cd5('0x44')]!==_0x4cd5('0x45')){var _0x4730f9={};_0x4730f9[_0x48aee8[_0x4cd5('0x46')]]={'$like':'%'+_0x224d8d['query'][_0x4cd5('0x40')]+'%'};return _0x4730f9;}})});}_0x3ad15a=_[_0x4cd5('0x41')]({},_0x3ad15a,_0x224d8d['options']);var _0x543bf6={'where':_0x3ad15a[_0x4cd5('0x3e')]};return db[_0x4cd5('0x32')][_0x4cd5('0x28')](_0x543bf6)[_0x4cd5('0x2d')](function(_0x1dbfeb){_0x4e7252['count']=_0x1dbfeb;if(_0x224d8d[_0x4cd5('0x35')][_0x4cd5('0x47')]){_0x3ad15a[_0x4cd5('0x48')]=[{'all':!![]}];}return db[_0x4cd5('0x32')]['findAll'](_0x3ad15a);})['then'](function(_0x1ffdfa){_0x4e7252[_0x4cd5('0x49')]=_0x1ffdfa;return _0x4e7252;})['then'](respondWithFilteredResult(_0xe1695d,_0x3ad15a))[_0x4cd5('0x4a')](handleError(_0xe1695d,null));};exports[_0x4cd5('0x4b')]=function(_0x2e0268,_0x58b650){var _0x57841d={'raw':![],'where':{'id':_0x2e0268[_0x4cd5('0x4c')]['id']}},_0x442d4a={};_0x442d4a[_0x4cd5('0x33')]=_[_0x4cd5('0x34')](db['DeskConfiguration'][_0x4cd5('0x4d')]);_0x442d4a[_0x4cd5('0x35')]=_['keys'](_0x2e0268[_0x4cd5('0x35')]);_0x442d4a[_0x4cd5('0x3f')]=_[_0x4cd5('0x36')](_0x442d4a['model'],_0x442d4a[_0x4cd5('0x35')]);_0x57841d[_0x4cd5('0x37')]=_[_0x4cd5('0x36')](_0x442d4a[_0x4cd5('0x33')],qs['fields'](_0x2e0268[_0x4cd5('0x35')][_0x4cd5('0x38')]));_0x57841d[_0x4cd5('0x37')]=_0x57841d[_0x4cd5('0x37')]['length']?_0x57841d[_0x4cd5('0x37')]:_0x442d4a[_0x4cd5('0x33')];if(_0x2e0268[_0x4cd5('0x35')][_0x4cd5('0x47')]){_0x57841d[_0x4cd5('0x48')]=[{'all':!![]}];}_0x57841d=_['merge']({},_0x57841d,_0x2e0268['options']);return db['DeskConfiguration'][_0x4cd5('0x4e')](_0x57841d)[_0x4cd5('0x2d')](handleEntityNotFound(_0x58b650,null))[_0x4cd5('0x2d')](respondWithResult(_0x58b650,null))['catch'](handleError(_0x58b650,null));};exports['create']=function(_0x1094b7,_0x1d78a1){return db[_0x4cd5('0x32')][_0x4cd5('0x4f')](_0x1094b7[_0x4cd5('0x50')],{})[_0x4cd5('0x2d')](respondWithResult(_0x1d78a1,0xc9))[_0x4cd5('0x4a')](handleError(_0x1d78a1,null));};exports['update']=function(_0x25f7e3,_0x5c6375){if(_0x25f7e3[_0x4cd5('0x50')]['id']){delete _0x25f7e3[_0x4cd5('0x50')]['id'];}return db[_0x4cd5('0x32')][_0x4cd5('0x4e')]({'where':{'id':_0x25f7e3[_0x4cd5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5c6375,null))['then'](saveUpdates(_0x25f7e3[_0x4cd5('0x50')],null))['then'](respondWithResult(_0x5c6375,null))[_0x4cd5('0x4a')](handleError(_0x5c6375,null));};exports[_0x4cd5('0x2e')]=function(_0x22ba48,_0x54432d){return db[_0x4cd5('0x32')]['find']({'where':{'id':_0x22ba48[_0x4cd5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x54432d,null))[_0x4cd5('0x2d')](removeEntity(_0x54432d,null))[_0x4cd5('0x4a')](handleError(_0x54432d,null));};exports[_0x4cd5('0x51')]=function(_0x58d0a6,_0x5d6621,_0x283178){var _0x35adc3={};var _0x2f0bd4={};var _0x1d8fa5;var _0x238483;return db['DeskConfiguration'][_0x4cd5('0x52')]({'where':{'id':_0x58d0a6[_0x4cd5('0x4c')]['id']}})[_0x4cd5('0x2d')](handleEntityNotFound(_0x5d6621,null))['then'](function(_0x2daa94){if(_0x2daa94){_0x1d8fa5=_0x2daa94;_0x2f0bd4[_0x4cd5('0x33')]=_[_0x4cd5('0x34')](db[_0x4cd5('0x53')][_0x4cd5('0x4d')]);_0x2f0bd4['query']=_[_0x4cd5('0x34')](_0x58d0a6[_0x4cd5('0x35')]);_0x2f0bd4[_0x4cd5('0x3f')]=_[_0x4cd5('0x36')](_0x2f0bd4[_0x4cd5('0x33')],_0x2f0bd4[_0x4cd5('0x35')]);_0x35adc3['attributes']=_[_0x4cd5('0x36')](_0x2f0bd4[_0x4cd5('0x33')],qs['fields'](_0x58d0a6['query'][_0x4cd5('0x38')]));_0x35adc3['attributes']=_0x35adc3['attributes'][_0x4cd5('0x54')]?_0x35adc3[_0x4cd5('0x37')]:_0x2f0bd4[_0x4cd5('0x33')];_0x35adc3[_0x4cd5('0x3c')]=qs[_0x4cd5('0x3d')](_0x58d0a6[_0x4cd5('0x35')]['sort']);_0x35adc3[_0x4cd5('0x3e')]=qs[_0x4cd5('0x3f')](_[_0x4cd5('0x55')](_0x58d0a6[_0x4cd5('0x35')],_0x2f0bd4[_0x4cd5('0x3f')]));if(_0x58d0a6['query']['filter']){_0x35adc3[_0x4cd5('0x3e')]=_[_0x4cd5('0x41')](_0x35adc3[_0x4cd5('0x3e')],{'$or':_[_0x4cd5('0x42')](_0x35adc3['attributes'],function(_0x4d72fb){var _0x22ba2b={};_0x22ba2b[_0x4d72fb]={'$like':'%'+_0x58d0a6[_0x4cd5('0x35')][_0x4cd5('0x40')]+'%'};return _0x22ba2b;})});}_0x35adc3=_[_0x4cd5('0x41')]({},_0x35adc3,_0x58d0a6[_0x4cd5('0x56')]);return _0x1d8fa5['getFields'](_0x35adc3);}})['then'](function(_0x2ef7b4){if(_0x2ef7b4){_0x238483=_0x2ef7b4[_0x4cd5('0x54')];if(!_0x58d0a6[_0x4cd5('0x35')]['hasOwnProperty'](_0x4cd5('0x3a'))){_0x35adc3[_0x4cd5('0x3b')]=qs[_0x4cd5('0x3b')](_0x58d0a6['query'][_0x4cd5('0x3b')]);_0x35adc3[_0x4cd5('0x29')]=qs[_0x4cd5('0x29')](_0x58d0a6[_0x4cd5('0x35')][_0x4cd5('0x29')]);}return _0x1d8fa5[_0x4cd5('0x51')](_0x35adc3);}})[_0x4cd5('0x2d')](function(_0x3d16c9){if(_0x3d16c9){return _0x3d16c9?{'count':_0x238483,'rows':_0x3d16c9}:null;}})[_0x4cd5('0x2d')](respondWithResult(_0x5d6621,null))[_0x4cd5('0x4a')](handleError(_0x5d6621,null));};exports['getSubjects']=function(_0x2d8172,_0xa38345,_0x5735c3){var _0x4e74d9={};var _0x2d1216={};var _0x27820d;var _0x571cdf;return db['DeskConfiguration']['findOne']({'where':{'id':_0x2d8172[_0x4cd5('0x4c')]['id']}})[_0x4cd5('0x2d')](handleEntityNotFound(_0xa38345,null))[_0x4cd5('0x2d')](function(_0x277710){if(_0x277710){_0x27820d=_0x277710;_0x2d1216[_0x4cd5('0x33')]=_[_0x4cd5('0x34')](db['DeskField'][_0x4cd5('0x4d')]);_0x2d1216[_0x4cd5('0x35')]=_[_0x4cd5('0x34')](_0x2d8172['query']);_0x2d1216[_0x4cd5('0x3f')]=_['intersection'](_0x2d1216[_0x4cd5('0x33')],_0x2d1216[_0x4cd5('0x35')]);_0x4e74d9[_0x4cd5('0x37')]=_[_0x4cd5('0x36')](_0x2d1216[_0x4cd5('0x33')],qs[_0x4cd5('0x38')](_0x2d8172[_0x4cd5('0x35')][_0x4cd5('0x38')]));_0x4e74d9[_0x4cd5('0x37')]=_0x4e74d9[_0x4cd5('0x37')]['length']?_0x4e74d9['attributes']:_0x2d1216['model'];_0x4e74d9['order']=qs[_0x4cd5('0x3d')](_0x2d8172[_0x4cd5('0x35')][_0x4cd5('0x3d')]);_0x4e74d9[_0x4cd5('0x3e')]=qs[_0x4cd5('0x3f')](_['pick'](_0x2d8172[_0x4cd5('0x35')],_0x2d1216[_0x4cd5('0x3f')]));if(_0x2d8172[_0x4cd5('0x35')]['filter']){_0x4e74d9[_0x4cd5('0x3e')]=_[_0x4cd5('0x41')](_0x4e74d9[_0x4cd5('0x3e')],{'$or':_[_0x4cd5('0x42')](_0x4e74d9[_0x4cd5('0x37')],function(_0x88478c){var _0x4a588c={};_0x4a588c[_0x88478c]={'$like':'%'+_0x2d8172[_0x4cd5('0x35')][_0x4cd5('0x40')]+'%'};return _0x4a588c;})});}_0x4e74d9=_[_0x4cd5('0x41')]({},_0x4e74d9,_0x2d8172[_0x4cd5('0x56')]);return _0x27820d['getSubjects'](_0x4e74d9);}})[_0x4cd5('0x2d')](function(_0x4c81a4){if(_0x4c81a4){_0x571cdf=_0x4c81a4[_0x4cd5('0x54')];if(!_0x2d8172[_0x4cd5('0x35')][_0x4cd5('0x39')](_0x4cd5('0x3a'))){_0x4e74d9['limit']=qs['limit'](_0x2d8172[_0x4cd5('0x35')][_0x4cd5('0x3b')]);_0x4e74d9[_0x4cd5('0x29')]=qs['offset'](_0x2d8172[_0x4cd5('0x35')]['offset']);}return _0x27820d['getSubjects'](_0x4e74d9);}})[_0x4cd5('0x2d')](function(_0x18cbff){if(_0x18cbff){return _0x18cbff?{'count':_0x571cdf,'rows':_0x18cbff}:null;}})[_0x4cd5('0x2d')](respondWithResult(_0xa38345,null))['catch'](handleError(_0xa38345,null));};exports[_0x4cd5('0x57')]=function(_0xa4297e,_0x49f91e,_0x5937b5){var _0x2602af={};var _0x4ae459={};var _0x127c8b;var _0x511230;return db[_0x4cd5('0x32')][_0x4cd5('0x52')]({'where':{'id':_0xa4297e['params']['id']}})[_0x4cd5('0x2d')](handleEntityNotFound(_0x49f91e,null))[_0x4cd5('0x2d')](function(_0x12859a){if(_0x12859a){_0x127c8b=_0x12859a;_0x4ae459[_0x4cd5('0x33')]=_[_0x4cd5('0x34')](db['DeskField'][_0x4cd5('0x4d')]);_0x4ae459['query']=_[_0x4cd5('0x34')](_0xa4297e[_0x4cd5('0x35')]);_0x4ae459[_0x4cd5('0x3f')]=_[_0x4cd5('0x36')](_0x4ae459['model'],_0x4ae459[_0x4cd5('0x35')]);_0x2602af[_0x4cd5('0x37')]=_['intersection'](_0x4ae459['model'],qs['fields'](_0xa4297e['query']['fields']));_0x2602af[_0x4cd5('0x37')]=_0x2602af[_0x4cd5('0x37')][_0x4cd5('0x54')]?_0x2602af['attributes']:_0x4ae459[_0x4cd5('0x33')];_0x2602af['order']=qs[_0x4cd5('0x3d')](_0xa4297e[_0x4cd5('0x35')]['sort']);_0x2602af['where']=qs['filters'](_[_0x4cd5('0x55')](_0xa4297e[_0x4cd5('0x35')],_0x4ae459[_0x4cd5('0x3f')]));if(_0xa4297e[_0x4cd5('0x35')][_0x4cd5('0x40')]){_0x2602af[_0x4cd5('0x3e')]=_[_0x4cd5('0x41')](_0x2602af['where'],{'$or':_[_0x4cd5('0x42')](_0x2602af[_0x4cd5('0x37')],function(_0x449d7a){var _0x34cdeb={};_0x34cdeb[_0x449d7a]={'$like':'%'+_0xa4297e[_0x4cd5('0x35')][_0x4cd5('0x40')]+'%'};return _0x34cdeb;})});}_0x2602af=_[_0x4cd5('0x41')]({},_0x2602af,_0xa4297e['options']);return _0x127c8b[_0x4cd5('0x57')](_0x2602af);}})[_0x4cd5('0x2d')](function(_0x1fc3cc){if(_0x1fc3cc){_0x511230=_0x1fc3cc[_0x4cd5('0x54')];if(!_0xa4297e['query'][_0x4cd5('0x39')](_0x4cd5('0x3a'))){_0x2602af[_0x4cd5('0x3b')]=qs['limit'](_0xa4297e['query'][_0x4cd5('0x3b')]);_0x2602af[_0x4cd5('0x29')]=qs[_0x4cd5('0x29')](_0xa4297e[_0x4cd5('0x35')][_0x4cd5('0x29')]);}return _0x127c8b[_0x4cd5('0x57')](_0x2602af);}})[_0x4cd5('0x2d')](function(_0x58a9a4){if(_0x58a9a4){return _0x58a9a4?{'count':_0x511230,'rows':_0x58a9a4}:null;}})['then'](respondWithResult(_0x49f91e,null))[_0x4cd5('0x4a')](handleError(_0x49f91e,null));};exports[_0x4cd5('0x58')]=function(_0x2d153e,_0x226fe8,_0x334fa9){var _0x407ff1={};var _0x4c4062={};var _0x8fd3b;var _0x4338c5;return db[_0x4cd5('0x32')][_0x4cd5('0x52')]({'where':{'id':_0x2d153e['params']['id']}})['then'](handleEntityNotFound(_0x226fe8,null))[_0x4cd5('0x2d')](function(_0x2bdbaf){if(_0x2bdbaf){_0x8fd3b=_0x2bdbaf;_0x4c4062[_0x4cd5('0x33')]=_[_0x4cd5('0x34')](db[_0x4cd5('0x59')][_0x4cd5('0x4d')]);_0x4c4062[_0x4cd5('0x35')]=_[_0x4cd5('0x34')](_0x2d153e[_0x4cd5('0x35')]);_0x4c4062[_0x4cd5('0x3f')]=_[_0x4cd5('0x36')](_0x4c4062['model'],_0x4c4062[_0x4cd5('0x35')]);_0x407ff1[_0x4cd5('0x37')]=_[_0x4cd5('0x36')](_0x4c4062[_0x4cd5('0x33')],qs[_0x4cd5('0x38')](_0x2d153e[_0x4cd5('0x35')]['fields']));_0x407ff1['attributes']=_0x407ff1[_0x4cd5('0x37')]['length']?_0x407ff1[_0x4cd5('0x37')]:_0x4c4062[_0x4cd5('0x33')];_0x407ff1[_0x4cd5('0x3c')]=qs[_0x4cd5('0x3d')](_0x2d153e['query'][_0x4cd5('0x3d')]);_0x407ff1[_0x4cd5('0x3e')]=qs['filters'](_[_0x4cd5('0x55')](_0x2d153e[_0x4cd5('0x35')],_0x4c4062[_0x4cd5('0x3f')]));if(_0x2d153e['query'][_0x4cd5('0x40')]){_0x407ff1[_0x4cd5('0x3e')]=_[_0x4cd5('0x41')](_0x407ff1[_0x4cd5('0x3e')],{'$or':_[_0x4cd5('0x42')](_0x407ff1['attributes'],function(_0x223db8){var _0x2bf1f2={};_0x2bf1f2[_0x223db8]={'$like':'%'+_0x2d153e[_0x4cd5('0x35')][_0x4cd5('0x40')]+'%'};return _0x2bf1f2;})});}_0x407ff1=_[_0x4cd5('0x41')]({},_0x407ff1,_0x2d153e[_0x4cd5('0x56')]);return _0x8fd3b[_0x4cd5('0x58')](_0x407ff1);}})[_0x4cd5('0x2d')](function(_0x140504){if(_0x140504){_0x4338c5=_0x140504[_0x4cd5('0x54')];if(!_0x2d153e[_0x4cd5('0x35')]['hasOwnProperty'](_0x4cd5('0x3a'))){_0x407ff1[_0x4cd5('0x3b')]=qs[_0x4cd5('0x3b')](_0x2d153e[_0x4cd5('0x35')][_0x4cd5('0x3b')]);_0x407ff1[_0x4cd5('0x29')]=qs[_0x4cd5('0x29')](_0x2d153e[_0x4cd5('0x35')][_0x4cd5('0x29')]);}return _0x8fd3b[_0x4cd5('0x58')](_0x407ff1);}})[_0x4cd5('0x2d')](function(_0x5e3a8e){if(_0x5e3a8e){return _0x5e3a8e?{'count':_0x4338c5,'rows':_0x5e3a8e}:null;}})[_0x4cd5('0x2d')](respondWithResult(_0x226fe8,null))[_0x4cd5('0x4a')](handleError(_0x226fe8,null));};exports[_0x4cd5('0x5a')]=function(_0x403118,_0x556b89,_0x3b025d){if(_0x403118[_0x4cd5('0x50')]['id']){delete _0x403118['body']['id'];}return db[_0x4cd5('0x32')][_0x4cd5('0x52')]({'where':{'id':_0x403118[_0x4cd5('0x4c')]['id']}})[_0x4cd5('0x2d')](handleEntityNotFound(_0x556b89,null))['then'](function(_0x4d8194){if(_0x4d8194){return _0x4d8194['setTags'](_0x403118[_0x4cd5('0x50')][_0x4cd5('0x5b')]||[]);}return null;})[_0x4cd5('0x2d')](respondWithResult(_0x556b89,null))[_0x4cd5('0x4a')](handleError(_0x556b89,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 7007a29..a7a05bc 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 _0x91c7=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger'];(function(_0x24c8da,_0x39f34b){var _0x287cdb=function(_0x4eded8){while(--_0x4eded8){_0x24c8da['push'](_0x24c8da['shift']());}};_0x287cdb(++_0x39f34b);}(_0x91c7,0x10e));var _0x791c=function(_0x19b709,_0x373b44){_0x19b709=_0x19b709-0x0;var _0x29eb28=_0x91c7[_0x19b709];return _0x29eb28;};'use strict';var _=require(_0x791c('0x0'));var util=require(_0x791c('0x1'));var logger=require(_0x791c('0x2'))(_0x791c('0x3'));var moment=require(_0x791c('0x4'));var BPromise=require(_0x791c('0x5'));var rp=require(_0x791c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x791c('0x7'));var config=require(_0x791c('0x8'));var attributes=require('./intDeskConfiguration.attributes');module[_0x791c('0x9')]=function(_0x324672,_0x4ef636){return _0x324672[_0x791c('0xa')](_0x791c('0xb'),attributes,{'tableName':_0x791c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x38ed=['moment','bluebird','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','DeskConfiguration','lodash','util','../../config/logger','api'];(function(_0xbc1a4b,_0x4dfbe4){var _0x108b87=function(_0x409062){while(--_0x409062){_0xbc1a4b['push'](_0xbc1a4b['shift']());}};_0x108b87(++_0x4dfbe4);}(_0x38ed,0x96));var _0xd38e=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x38ed[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0xd38e('0x0'));var util=require(_0xd38e('0x1'));var logger=require(_0xd38e('0x2'))(_0xd38e('0x3'));var moment=require(_0xd38e('0x4'));var BPromise=require(_0xd38e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd38e('0x6'));var rimraf=require(_0xd38e('0x7'));var config=require(_0xd38e('0x8'));var attributes=require(_0xd38e('0x9'));module['exports']=function(_0x13da5b,_0xe07dd5){return _0x13da5b['define'](_0xd38e('0xa'),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 4d12bfb..ca60d56 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 _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x1cb9,0x14e));var _0x91cb=function(_0x373e35,_0x4e220c){_0x373e35=_0x373e35-0x0;var _0x4a73eb=_0x1cb9[_0x373e35];return _0x4a73eb;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file +var _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x39cfcd,_0x5e919d){var _0x2c2c22=function(_0x449705){while(--_0x449705){_0x39cfcd['push'](_0x39cfcd['shift']());}};_0x2c2c22(++_0x5e919d);}(_0x8ef6,0xf2));var _0x68ef=function(_0x3a4b9b,_0x45ba23){_0x3a4b9b=_0x3a4b9b-0x0;var _0x39b4ba=_0x8ef6[_0x3a4b9b];return _0x39b4ba;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 8c364df..d79f370 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 _0x0769=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x327c65,_0x56b97d){var _0x4d4e3e=function(_0x21437e){while(--_0x21437e){_0x327c65['push'](_0x327c65['shift']());}};_0x4d4e3e(++_0x56b97d);}(_0x0769,0x129));var _0x9076=function(_0x101d04,_0x4b5fa2){_0x101d04=_0x101d04-0x0;var _0x27f9f7=_0x0769[_0x101d04];return _0x27f9f7;};'use strict';var multer=require(_0x9076('0x0'));var util=require(_0x9076('0x1'));var path=require(_0x9076('0x2'));var timeout=require(_0x9076('0x3'));var express=require(_0x9076('0x4'));var router=express[_0x9076('0x5')]();var auth=require(_0x9076('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9076('0x7'));var controller=require('./intDeskField.controller');router[_0x9076('0x8')]('/',auth[_0x9076('0x9')](),controller[_0x9076('0xa')]);router[_0x9076('0x8')](_0x9076('0xb'),auth['isAuthenticated'](),controller[_0x9076('0xc')]);router[_0x9076('0xd')]('/',auth[_0x9076('0x9')](),controller[_0x9076('0xe')]);router[_0x9076('0xf')]('/:id',auth[_0x9076('0x9')](),controller[_0x9076('0x10')]);router[_0x9076('0x11')]('/:id',auth[_0x9076('0x9')](),controller[_0x9076('0x12')]);module[_0x9076('0x13')]=router; \ No newline at end of file +var _0x6a4c=['delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','put','update'];(function(_0x2762eb,_0x34b29b){var _0x5765f0=function(_0x38a77e){while(--_0x38a77e){_0x2762eb['push'](_0x2762eb['shift']());}};_0x5765f0(++_0x34b29b);}(_0x6a4c,0xed));var _0xc6a4=function(_0x325669,_0x1b1eaf){_0x325669=_0x325669-0x0;var _0x7cba08=_0x6a4c[_0x325669];return _0x7cba08;};'use strict';var multer=require(_0xc6a4('0x0'));var util=require(_0xc6a4('0x1'));var path=require(_0xc6a4('0x2'));var timeout=require('connect-timeout');var express=require(_0xc6a4('0x3'));var router=express[_0xc6a4('0x4')]();var auth=require(_0xc6a4('0x5'));var interaction=require(_0xc6a4('0x6'));var config=require(_0xc6a4('0x7'));var controller=require('./intDeskField.controller');router[_0xc6a4('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc6a4('0x8')](_0xc6a4('0x9'),auth[_0xc6a4('0xa')](),controller[_0xc6a4('0xb')]);router[_0xc6a4('0xc')]('/',auth[_0xc6a4('0xa')](),controller['create']);router[_0xc6a4('0xd')]('/:id',auth[_0xc6a4('0xa')](),controller[_0xc6a4('0xe')]);router[_0xc6a4('0xf')](_0xc6a4('0x9'),auth[_0xc6a4('0xa')](),controller[_0xc6a4('0x10')]);module[_0xc6a4('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index a9c2b91..3b20aff 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 _0x1339=['keyValue','STRING','BOOLEAN','ENUM','string','variable','customVariable'];(function(_0x5ea28c,_0x4baee5){var _0x2e7ac7=function(_0x36262e){while(--_0x36262e){_0x5ea28c['push'](_0x5ea28c['shift']());}};_0x2e7ac7(++_0x4baee5);}(_0x1339,0x1ed));var _0x9133=function(_0xa3f163,_0x2fc105){_0xa3f163=_0xa3f163-0x0;var _0x3f6835=_0x1339[_0xa3f163];return _0x3f6835;};'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 +var _0xe605=['STRING','ENUM','sequelize','exports','string','variable','customVariable','keyValue'];(function(_0x2073bb,_0x24b2b5){var _0x3f047e=function(_0x2b049e){while(--_0x2b049e){_0x2073bb['push'](_0x2073bb['shift']());}};_0x3f047e(++_0x24b2b5);}(_0xe605,0x92));var _0x5e60=function(_0x5c82ad,_0x3ff0b1){_0x5c82ad=_0x5c82ad-0x0;var _0x43c720=_0xe605[_0x5c82ad];return _0x43c720;};'use strict';var Sequelize=require(_0x5e60('0x0'));module[_0x5e60('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5e60('0x2'),_0x5e60('0x3'),_0x5e60('0x4'),_0x5e60('0x5')),'defaultValue':_0x5e60('0x2')},'content':{'type':Sequelize[_0x5e60('0x6')]},'key':{'type':Sequelize[_0x5e60('0x6')]},'keyType':{'type':Sequelize[_0x5e60('0x7')](_0x5e60('0x2'),_0x5e60('0x3'),_0x5e60('0x4'))},'keyContent':{'type':Sequelize[_0x5e60('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5e60('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'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 806a9bb..a426d28 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 _0x2a5a=['fast-json-patch','request-promise','bluebird','mustache','util','path','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../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','DeskField','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','VIRTUAL','merge','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','html-pdf','rimraf','zip-dir'];(function(_0xb510e5,_0x4eff6a){var _0x3d080=function(_0x40e5da){while(--_0x40e5da){_0xb510e5['push'](_0xb510e5['shift']());}};_0x3d080(++_0x4eff6a);}(_0x2a5a,0x87));var _0xa2a5=function(_0x436a68,_0x30b979){_0x436a68=_0x436a68-0x0;var _0xf6a19f=_0x2a5a[_0x436a68];return _0xf6a19f;};'use strict';var pdf=require(_0xa2a5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa2a5('0x1'));var zipdir=require(_0xa2a5('0x2'));var jsonpatch=require(_0xa2a5('0x3'));var rp=require(_0xa2a5('0x4'));var moment=require('moment');var BPromise=require(_0xa2a5('0x5'));var Mustache=require(_0xa2a5('0x6'));var util=require(_0xa2a5('0x7'));var path=require(_0xa2a5('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xa2a5('0x9'));var squel=require(_0xa2a5('0xa'));var crypto=require(_0xa2a5('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa2a5('0xc'));var Papa=require(_0xa2a5('0xd'));var Redis=require(_0xa2a5('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa2a5('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2a5('0x10'))('api');var utils=require(_0xa2a5('0x11'));var config=require(_0xa2a5('0x12'));var db=require(_0xa2a5('0x13'))['db'];function respondWithStatusCode(_0x34faba,_0x14073d){_0x14073d=_0x14073d||0xcc;return function(_0xb3f235){if(_0xb3f235){return _0x34faba['sendStatus'](_0x14073d);}return _0x34faba[_0xa2a5('0x14')](_0x14073d)[_0xa2a5('0x15')]();};}function respondWithResult(_0xbe995d,_0x2142ce){_0x2142ce=_0x2142ce||0xc8;return function(_0x906407){if(_0x906407){return _0xbe995d[_0xa2a5('0x14')](_0x2142ce)[_0xa2a5('0x16')](_0x906407);}};}function respondWithFilteredResult(_0x1cc761,_0x45a261){return function(_0x4b5919){if(_0x4b5919){var _0x1dcd82=_0x4b5919[_0xa2a5('0x17')],_0x17adae=_0x45a261[_0xa2a5('0x18')],_0x4b4de6=_0x45a261['offset']+_0x45a261[_0xa2a5('0x19')],_0xa82b26;if(_0x4b4de6>=_0x1dcd82){_0x4b4de6=_0x1dcd82;_0xa82b26=0xc8;}else{_0xa82b26=0xce;}_0x1cc761[_0xa2a5('0x14')](_0xa82b26);return _0x1cc761[_0xa2a5('0x1a')](_0xa2a5('0x1b'),_0x17adae+'-'+_0x4b4de6+'/'+_0x1dcd82)[_0xa2a5('0x16')](_0x4b5919);}return null;};}function patchUpdates(_0x139451){return function(_0x184a03){try{jsonpatch[_0xa2a5('0x1c')](_0x184a03,_0x139451,!![]);}catch(_0x578723){return BPromise[_0xa2a5('0x1d')](_0x578723);}return _0x184a03[_0xa2a5('0x1e')]();};}function saveUpdates(_0x218e11,_0x523a28){return function(_0x2c5bea){if(_0x2c5bea){return _0x2c5bea[_0xa2a5('0x1f')](_0x218e11)[_0xa2a5('0x20')](function(_0x9077ed){return _0x9077ed;});}return null;};}function removeEntity(_0x4fe38e,_0x952882){return function(_0x457458){if(_0x457458){return _0x457458[_0xa2a5('0x21')]()[_0xa2a5('0x20')](function(){_0x4fe38e[_0xa2a5('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x112e36,_0x423734){return function(_0x514314){if(!_0x514314){_0x112e36['sendStatus'](0x194);}return _0x514314;};}function handleError(_0x6ed894,_0x4d35d7){_0x4d35d7=_0x4d35d7||0x1f4;return function(_0x405c83){logger[_0xa2a5('0x22')](_0x405c83[_0xa2a5('0x23')]);if(_0x405c83[_0xa2a5('0x24')]){delete _0x405c83['name'];}_0x6ed894[_0xa2a5('0x14')](_0x4d35d7)[_0xa2a5('0x25')](_0x405c83);};}exports[_0xa2a5('0x26')]=function(_0x405ade,_0x21adb1){var _0x87feef={},_0x43b599={},_0x4add52={'count':0x0,'rows':[]};var _0x1746c5=db[_0xa2a5('0x27')][_0xa2a5('0x28')];_0x43b599['model']=_[_0xa2a5('0x29')](_0x1746c5);_0x43b599[_0xa2a5('0x2a')]=_['keys'](_0x405ade['query']);_0x43b599[_0xa2a5('0x2b')]=_[_0xa2a5('0x2c')](_0x43b599[_0xa2a5('0x2d')],_0x43b599[_0xa2a5('0x2a')]);_0x87feef[_0xa2a5('0x2e')]=_[_0xa2a5('0x2c')](_0x43b599[_0xa2a5('0x2d')],qs[_0xa2a5('0x2f')](_0x405ade['query']['fields']));_0x87feef['attributes']=_0x87feef[_0xa2a5('0x2e')][_0xa2a5('0x30')]?_0x87feef[_0xa2a5('0x2e')]:_0x43b599[_0xa2a5('0x2d')];if(!_0x405ade['query'][_0xa2a5('0x31')](_0xa2a5('0x32'))){_0x87feef[_0xa2a5('0x19')]=qs[_0xa2a5('0x19')](_0x405ade[_0xa2a5('0x2a')][_0xa2a5('0x19')]);_0x87feef[_0xa2a5('0x18')]=qs[_0xa2a5('0x18')](_0x405ade['query']['offset']);}_0x87feef[_0xa2a5('0x33')]=qs[_0xa2a5('0x34')](_0x405ade[_0xa2a5('0x2a')][_0xa2a5('0x34')]);_0x87feef[_0xa2a5('0x35')]=qs[_0xa2a5('0x2b')](_['pick'](_0x405ade['query'],_0x43b599[_0xa2a5('0x2b')]));if(_0x405ade[_0xa2a5('0x2a')][_0xa2a5('0x36')]){_0x87feef[_0xa2a5('0x35')]=_['merge'](_0x87feef[_0xa2a5('0x35')],{'$or':_[_0xa2a5('0x37')](_0x1746c5,function(_0x1d484c){if(_0x1d484c['type']['key']!==_0xa2a5('0x38')){var _0x1ec35f={};_0x1ec35f[_0x1d484c['field']]={'$like':'%'+_0x405ade['query'][_0xa2a5('0x36')]+'%'};return _0x1ec35f;}})});}_0x87feef=_[_0xa2a5('0x39')]({},_0x87feef,_0x405ade['options']);var _0x39f0e4={'where':_0x87feef[_0xa2a5('0x35')]};return db[_0xa2a5('0x27')][_0xa2a5('0x17')](_0x39f0e4)['then'](function(_0x45e4a1){_0x4add52['count']=_0x45e4a1;if(_0x405ade[_0xa2a5('0x2a')]['includeAll']){_0x87feef[_0xa2a5('0x3a')]=[{'all':!![]}];}return db[_0xa2a5('0x27')][_0xa2a5('0x3b')](_0x87feef);})[_0xa2a5('0x20')](function(_0x5b6a17){_0x4add52[_0xa2a5('0x3c')]=_0x5b6a17;return _0x4add52;})[_0xa2a5('0x20')](respondWithFilteredResult(_0x21adb1,_0x87feef))[_0xa2a5('0x3d')](handleError(_0x21adb1,null));};exports[_0xa2a5('0x3e')]=function(_0x340b6d,_0x542000){var _0x5a1001={'raw':!![],'where':{'id':_0x340b6d[_0xa2a5('0x3f')]['id']}},_0x3ea8e2={};_0x3ea8e2[_0xa2a5('0x2d')]=_[_0xa2a5('0x29')](db['DeskField'][_0xa2a5('0x28')]);_0x3ea8e2[_0xa2a5('0x2a')]=_[_0xa2a5('0x29')](_0x340b6d[_0xa2a5('0x2a')]);_0x3ea8e2['filters']=_[_0xa2a5('0x2c')](_0x3ea8e2[_0xa2a5('0x2d')],_0x3ea8e2[_0xa2a5('0x2a')]);_0x5a1001['attributes']=_['intersection'](_0x3ea8e2['model'],qs['fields'](_0x340b6d['query']['fields']));_0x5a1001['attributes']=_0x5a1001['attributes'][_0xa2a5('0x30')]?_0x5a1001[_0xa2a5('0x2e')]:_0x3ea8e2[_0xa2a5('0x2d')];if(_0x340b6d[_0xa2a5('0x2a')][_0xa2a5('0x40')]){_0x5a1001['include']=[{'all':!![]}];}_0x5a1001=_[_0xa2a5('0x39')]({},_0x5a1001,_0x340b6d[_0xa2a5('0x41')]);return db[_0xa2a5('0x27')][_0xa2a5('0x42')](_0x5a1001)[_0xa2a5('0x20')](handleEntityNotFound(_0x542000,null))[_0xa2a5('0x20')](respondWithResult(_0x542000,null))[_0xa2a5('0x3d')](handleError(_0x542000,null));};exports[_0xa2a5('0x43')]=function(_0x566dd4,_0x3e35bd){return db[_0xa2a5('0x27')][_0xa2a5('0x43')](_0x566dd4[_0xa2a5('0x44')],{})[_0xa2a5('0x20')](respondWithResult(_0x3e35bd,0xc9))[_0xa2a5('0x3d')](handleError(_0x3e35bd,null));};exports[_0xa2a5('0x1f')]=function(_0x5084e6,_0x299911){if(_0x5084e6[_0xa2a5('0x44')]['id']){delete _0x5084e6[_0xa2a5('0x44')]['id'];}return db[_0xa2a5('0x27')][_0xa2a5('0x42')]({'where':{'id':_0x5084e6[_0xa2a5('0x3f')]['id']}})[_0xa2a5('0x20')](handleEntityNotFound(_0x299911,null))['then'](saveUpdates(_0x5084e6[_0xa2a5('0x44')],null))[_0xa2a5('0x20')](respondWithResult(_0x299911,null))[_0xa2a5('0x3d')](handleError(_0x299911,null));};exports['destroy']=function(_0xb37c59,_0x2c934c){return db[_0xa2a5('0x27')][_0xa2a5('0x42')]({'where':{'id':_0xb37c59[_0xa2a5('0x3f')]['id']}})[_0xa2a5('0x20')](handleEntityNotFound(_0x2c934c,null))[_0xa2a5('0x20')](removeEntity(_0x2c934c,null))[_0xa2a5('0x3d')](handleError(_0x2c934c,null));}; \ No newline at end of file +var _0x538d=['stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','field','options','DeskField','count','includeAll','include','findAll','rows','params','length','find','catch','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','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','json','offset','status','set','Content-Range','apply','reject','save','update','then','error'];(function(_0x48a928,_0x430727){var _0x11c1e9=function(_0x338805){while(--_0x338805){_0x48a928['push'](_0x48a928['shift']());}};_0x11c1e9(++_0x430727);}(_0x538d,0x15e));var _0xd538=function(_0x32ccfc,_0x46576a){_0x32ccfc=_0x32ccfc-0x0;var _0x2e110a=_0x538d[_0x32ccfc];return _0x2e110a;};'use strict';var pdf=require(_0xd538('0x0'));var emlformat=require(_0xd538('0x1'));var rimraf=require(_0xd538('0x2'));var zipdir=require(_0xd538('0x3'));var jsonpatch=require(_0xd538('0x4'));var rp=require(_0xd538('0x5'));var moment=require(_0xd538('0x6'));var BPromise=require(_0xd538('0x7'));var Mustache=require(_0xd538('0x8'));var util=require(_0xd538('0x9'));var path=require(_0xd538('0xa'));var sox=require(_0xd538('0xb'));var csv=require('to-csv');var ejs=require(_0xd538('0xc'));var fs=require('fs');var _=require(_0xd538('0xd'));var squel=require(_0xd538('0xe'));var crypto=require(_0xd538('0xf'));var jsforce=require(_0xd538('0x10'));var deskjs=require(_0xd538('0x11'));var toCsv=require(_0xd538('0x12'));var querystring=require('querystring');var Papa=require(_0xd538('0x13'));var Redis=require(_0xd538('0x14'));var authService=require(_0xd538('0x15'));var qs=require(_0xd538('0x16'));var hardwareService=require(_0xd538('0x17'));var logger=require(_0xd538('0x18'))(_0xd538('0x19'));var utils=require(_0xd538('0x1a'));var config=require('../../config/environment');var db=require(_0xd538('0x1b'))['db'];function respondWithStatusCode(_0x22d98a,_0x56ffdf){_0x56ffdf=_0x56ffdf||0xcc;return function(_0x2ca0ba){if(_0x2ca0ba){return _0x22d98a[_0xd538('0x1c')](_0x56ffdf);}return _0x22d98a['status'](_0x56ffdf)['end']();};}function respondWithResult(_0x4142fa,_0x2e6819){_0x2e6819=_0x2e6819||0xc8;return function(_0x944d27){if(_0x944d27){return _0x4142fa['status'](_0x2e6819)[_0xd538('0x1d')](_0x944d27);}};}function respondWithFilteredResult(_0x586e52,_0x129081){return function(_0xf5a450){if(_0xf5a450){var _0x2dfc06=_0xf5a450['count'],_0x20ba86=_0x129081[_0xd538('0x1e')],_0x214803=_0x129081[_0xd538('0x1e')]+_0x129081['limit'],_0x57baac;if(_0x214803>=_0x2dfc06){_0x214803=_0x2dfc06;_0x57baac=0xc8;}else{_0x57baac=0xce;}_0x586e52[_0xd538('0x1f')](_0x57baac);return _0x586e52[_0xd538('0x20')](_0xd538('0x21'),_0x20ba86+'-'+_0x214803+'/'+_0x2dfc06)[_0xd538('0x1d')](_0xf5a450);}return null;};}function patchUpdates(_0x59f42b){return function(_0x10c31b){try{jsonpatch[_0xd538('0x22')](_0x10c31b,_0x59f42b,!![]);}catch(_0x44026c){return BPromise[_0xd538('0x23')](_0x44026c);}return _0x10c31b[_0xd538('0x24')]();};}function saveUpdates(_0x36dd89,_0x377bbe){return function(_0x3c597e){if(_0x3c597e){return _0x3c597e[_0xd538('0x25')](_0x36dd89)[_0xd538('0x26')](function(_0x3eb14b){return _0x3eb14b;});}return null;};}function removeEntity(_0xa03da,_0x55435a){return function(_0x3ff194){if(_0x3ff194){return _0x3ff194['destroy']()['then'](function(){_0xa03da[_0xd538('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x265a4c,_0x2fdbcc){return function(_0x31d576){if(!_0x31d576){_0x265a4c[_0xd538('0x1c')](0x194);}return _0x31d576;};}function handleError(_0x3da42b,_0x1a4e4e){_0x1a4e4e=_0x1a4e4e||0x1f4;return function(_0x258468){logger[_0xd538('0x27')](_0x258468[_0xd538('0x28')]);if(_0x258468[_0xd538('0x29')]){delete _0x258468[_0xd538('0x29')];}_0x3da42b['status'](_0x1a4e4e)[_0xd538('0x2a')](_0x258468);};}exports[_0xd538('0x2b')]=function(_0x25c338,_0x302c34){var _0x539d97={},_0x54c456={},_0x5c4c42={'count':0x0,'rows':[]};var _0x4b488b=db['DeskField'][_0xd538('0x2c')];_0x54c456[_0xd538('0x2d')]=_[_0xd538('0x2e')](_0x4b488b);_0x54c456[_0xd538('0x2f')]=_['keys'](_0x25c338['query']);_0x54c456[_0xd538('0x30')]=_[_0xd538('0x31')](_0x54c456[_0xd538('0x2d')],_0x54c456[_0xd538('0x2f')]);_0x539d97[_0xd538('0x32')]=_[_0xd538('0x31')](_0x54c456[_0xd538('0x2d')],qs[_0xd538('0x33')](_0x25c338[_0xd538('0x2f')][_0xd538('0x33')]));_0x539d97[_0xd538('0x32')]=_0x539d97[_0xd538('0x32')]['length']?_0x539d97['attributes']:_0x54c456[_0xd538('0x2d')];if(!_0x25c338[_0xd538('0x2f')]['hasOwnProperty'](_0xd538('0x34'))){_0x539d97[_0xd538('0x35')]=qs['limit'](_0x25c338[_0xd538('0x2f')][_0xd538('0x35')]);_0x539d97['offset']=qs[_0xd538('0x1e')](_0x25c338[_0xd538('0x2f')]['offset']);}_0x539d97[_0xd538('0x36')]=qs[_0xd538('0x37')](_0x25c338[_0xd538('0x2f')][_0xd538('0x37')]);_0x539d97[_0xd538('0x38')]=qs[_0xd538('0x30')](_[_0xd538('0x39')](_0x25c338[_0xd538('0x2f')],_0x54c456['filters']));if(_0x25c338[_0xd538('0x2f')][_0xd538('0x3a')]){_0x539d97[_0xd538('0x38')]=_[_0xd538('0x3b')](_0x539d97[_0xd538('0x38')],{'$or':_[_0xd538('0x3c')](_0x4b488b,function(_0x1ae236){if(_0x1ae236[_0xd538('0x3d')][_0xd538('0x3e')]!=='VIRTUAL'){var _0x55ff9c={};_0x55ff9c[_0x1ae236[_0xd538('0x3f')]]={'$like':'%'+_0x25c338[_0xd538('0x2f')][_0xd538('0x3a')]+'%'};return _0x55ff9c;}})});}_0x539d97=_[_0xd538('0x3b')]({},_0x539d97,_0x25c338[_0xd538('0x40')]);var _0x22728f={'where':_0x539d97['where']};return db[_0xd538('0x41')][_0xd538('0x42')](_0x22728f)[_0xd538('0x26')](function(_0xe377af){_0x5c4c42['count']=_0xe377af;if(_0x25c338[_0xd538('0x2f')][_0xd538('0x43')]){_0x539d97[_0xd538('0x44')]=[{'all':!![]}];}return db[_0xd538('0x41')][_0xd538('0x45')](_0x539d97);})[_0xd538('0x26')](function(_0x3e5778){_0x5c4c42[_0xd538('0x46')]=_0x3e5778;return _0x5c4c42;})['then'](respondWithFilteredResult(_0x302c34,_0x539d97))['catch'](handleError(_0x302c34,null));};exports['show']=function(_0x11844f,_0x273a4e){var _0x166c2a={'raw':!![],'where':{'id':_0x11844f[_0xd538('0x47')]['id']}},_0x86e746={};_0x86e746['model']=_[_0xd538('0x2e')](db['DeskField']['rawAttributes']);_0x86e746['query']=_[_0xd538('0x2e')](_0x11844f[_0xd538('0x2f')]);_0x86e746[_0xd538('0x30')]=_['intersection'](_0x86e746[_0xd538('0x2d')],_0x86e746[_0xd538('0x2f')]);_0x166c2a['attributes']=_[_0xd538('0x31')](_0x86e746['model'],qs['fields'](_0x11844f[_0xd538('0x2f')][_0xd538('0x33')]));_0x166c2a[_0xd538('0x32')]=_0x166c2a[_0xd538('0x32')][_0xd538('0x48')]?_0x166c2a['attributes']:_0x86e746[_0xd538('0x2d')];if(_0x11844f[_0xd538('0x2f')][_0xd538('0x43')]){_0x166c2a[_0xd538('0x44')]=[{'all':!![]}];}_0x166c2a=_['merge']({},_0x166c2a,_0x11844f['options']);return db[_0xd538('0x41')][_0xd538('0x49')](_0x166c2a)['then'](handleEntityNotFound(_0x273a4e,null))['then'](respondWithResult(_0x273a4e,null))[_0xd538('0x4a')](handleError(_0x273a4e,null));};exports[_0xd538('0x4b')]=function(_0x33c353,_0x2fa75f){return db[_0xd538('0x41')]['create'](_0x33c353[_0xd538('0x4c')],{})['then'](respondWithResult(_0x2fa75f,0xc9))[_0xd538('0x4a')](handleError(_0x2fa75f,null));};exports[_0xd538('0x25')]=function(_0x20d6a7,_0x2a80fb){if(_0x20d6a7[_0xd538('0x4c')]['id']){delete _0x20d6a7[_0xd538('0x4c')]['id'];}return db[_0xd538('0x41')][_0xd538('0x49')]({'where':{'id':_0x20d6a7[_0xd538('0x47')]['id']}})[_0xd538('0x26')](handleEntityNotFound(_0x2a80fb,null))[_0xd538('0x26')](saveUpdates(_0x20d6a7['body'],null))[_0xd538('0x26')](respondWithResult(_0x2a80fb,null))['catch'](handleError(_0x2a80fb,null));};exports[_0xd538('0x4d')]=function(_0x2dfdf1,_0x5810e4){return db[_0xd538('0x41')][_0xd538('0x49')]({'where':{'id':_0x2dfdf1[_0xd538('0x47')]['id']}})['then'](handleEntityNotFound(_0x5810e4,null))[_0xd538('0x26')](removeEntity(_0x5810e4,null))['catch'](handleError(_0x5810e4,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 8467cb3..fb3526d 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 _0xf634=['api','bluebird','request-promise','rimraf','./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','../../config/logger'];(function(_0x3bc022,_0x398082){var _0x4a19c6=function(_0x1e3281){while(--_0x1e3281){_0x3bc022['push'](_0x3bc022['shift']());}};_0x4a19c6(++_0x398082);}(_0xf634,0x12a));var _0x4f63=function(_0x582f51,_0x190959){_0x582f51=_0x582f51-0x0;var _0xf03c7d=_0xf634[_0x582f51];return _0xf03c7d;};'use strict';var _=require(_0x4f63('0x0'));var util=require('util');var logger=require(_0x4f63('0x1'))(_0x4f63('0x2'));var moment=require('moment');var BPromise=require(_0x4f63('0x3'));var rp=require(_0x4f63('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4f63('0x5'));var config=require('../../config/environment');var attributes=require(_0x4f63('0x6'));module[_0x4f63('0x7')]=function(_0x151bf0,_0x315451){return _0x151bf0['define'](_0x4f63('0x8'),attributes,{'tableName':_0x4f63('0x9'),'paranoid':![],'indexes':[{'name':_0x4f63('0xa'),'fields':['idField',_0x4f63('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1b04=['api','moment','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','FieldId','util','../../config/logger'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0x1b04,0x1c0));var _0x41b0=function(_0xd6a479,_0x1817cc){_0xd6a479=_0xd6a479-0x0;var _0x2a86d9=_0x1b04[_0xd6a479];return _0x2a86d9;};'use strict';var _=require('lodash');var util=require(_0x41b0('0x0'));var logger=require(_0x41b0('0x1'))(_0x41b0('0x2'));var moment=require(_0x41b0('0x3'));var BPromise=require('bluebird');var rp=require(_0x41b0('0x4'));var fs=require('fs');var path=require(_0x41b0('0x5'));var rimraf=require(_0x41b0('0x6'));var config=require(_0x41b0('0x7'));var attributes=require(_0x41b0('0x8'));module[_0x41b0('0x9')]=function(_0x4c90c6,_0x563574){return _0x4c90c6[_0x41b0('0xa')](_0x41b0('0xb'),attributes,{'tableName':_0x41b0('0xc'),'paranoid':![],'indexes':[{'name':_0x41b0('0xd'),'fields':['idField',_0x41b0('0xe')],'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 9292c7d..8e9a9e8 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 _0xd64b=['message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x56dc40,_0xb5b55a){var _0x2117f8=function(_0x599dc8){while(--_0x599dc8){_0x56dc40['push'](_0x56dc40['shift']());}};_0x2117f8(++_0xb5b55a);}(_0xd64b,0xc1));var _0xbd64=function(_0x3ff893,_0x53e2bd){_0x3ff893=_0x3ff893-0x0;var _0x246d70=_0xd64b[_0x3ff893];return _0x246d70;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var moment=require(_0xbd64('0x1'));var BPromise=require('bluebird');var rs=require(_0xbd64('0x2'));var fs=require('fs');var Redis=require(_0xbd64('0x3'));var db=require(_0xbd64('0x4'))['db'];var utils=require(_0xbd64('0x5'));var logger=require(_0xbd64('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbd64('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32995f,_0x3e700e,_0x38204e){return new BPromise(function(_0x3f1f17,_0x2b8543){return client[_0xbd64('0x8')](_0x32995f,_0x38204e)['then'](function(_0x5ae70c){logger[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0xbd64('0xb'));logger['debug'](_0xbd64('0xc'),_0x3e700e,_0xbd64('0xb'),JSON[_0xbd64('0xd')](_0x5ae70c));if(_0x5ae70c[_0xbd64('0xe')]){if(_0x5ae70c['error'][_0xbd64('0xf')]===0x1f4){logger['error'](_0xbd64('0xa'),_0x3e700e,_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);return _0x2b8543(_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);}logger[_0xbd64('0xe')](_0xbd64('0xa'),_0x3e700e,_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);return _0x3f1f17(_0x5ae70c['error'][_0xbd64('0x10')]);}else{logger[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0xbd64('0xb'));_0x3f1f17(_0x5ae70c[_0xbd64('0x11')]['message']);}})[_0xbd64('0x12')](function(_0x5332e0){logger[_0xbd64('0xe')](_0xbd64('0xa'),_0x3e700e,_0x5332e0);_0x2b8543(_0x5332e0);});});} \ No newline at end of file +var _0xd64b=['message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x216321,_0x4e3ef8){var _0x4254dd=function(_0x175d66){while(--_0x175d66){_0x216321['push'](_0x216321['shift']());}};_0x4254dd(++_0x4e3ef8);}(_0xd64b,0xc1));var _0xbd64=function(_0x3fd275,_0xf0cd7){_0x3fd275=_0x3fd275-0x0;var _0xe4f14f=_0xd64b[_0x3fd275];return _0xe4f14f;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var moment=require(_0xbd64('0x1'));var BPromise=require('bluebird');var rs=require(_0xbd64('0x2'));var fs=require('fs');var Redis=require(_0xbd64('0x3'));var db=require(_0xbd64('0x4'))['db'];var utils=require(_0xbd64('0x5'));var logger=require(_0xbd64('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbd64('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32995f,_0x3e700e,_0x38204e){return new BPromise(function(_0x3f1f17,_0x2b8543){return client[_0xbd64('0x8')](_0x32995f,_0x38204e)['then'](function(_0x5ae70c){logger[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0xbd64('0xb'));logger['debug'](_0xbd64('0xc'),_0x3e700e,_0xbd64('0xb'),JSON[_0xbd64('0xd')](_0x5ae70c));if(_0x5ae70c[_0xbd64('0xe')]){if(_0x5ae70c['error'][_0xbd64('0xf')]===0x1f4){logger['error'](_0xbd64('0xa'),_0x3e700e,_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);return _0x2b8543(_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);}logger[_0xbd64('0xe')](_0xbd64('0xa'),_0x3e700e,_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);return _0x3f1f17(_0x5ae70c['error'][_0xbd64('0x10')]);}else{logger[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0xbd64('0xb'));_0x3f1f17(_0x5ae70c[_0xbd64('0x11')]['message']);}})[_0xbd64('0x12')](function(_0x5332e0){logger[_0xbd64('0xe')](_0xbd64('0xa'),_0x3e700e,_0x5332e0);_0x2b8543(_0x5332e0);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index ff47906..03ba5d1 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 _0x54bf=['post','create','addConfiguration','put','update','delete','destroy','exports','multer','express','Router','get','index','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x54bf,0x120));var _0xf54b=function(_0x511fa1,_0xc625c1){_0x511fa1=_0x511fa1-0x0;var _0x422af0=_0x54bf[_0x511fa1];return _0x422af0;};'use strict';var multer=require(_0xf54b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf54b('0x1'));var router=express[_0xf54b('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router[_0xf54b('0x3')]('/',auth['isAuthenticated'](),controller[_0xf54b('0x4')]);router[_0xf54b('0x3')](_0xf54b('0x5'),auth['isAuthenticated'](),controller[_0xf54b('0x6')]);router[_0xf54b('0x3')](_0xf54b('0x7'),auth[_0xf54b('0x8')](),controller[_0xf54b('0x9')]);router[_0xf54b('0x3')](_0xf54b('0xa'),auth['isAuthenticated'](),controller[_0xf54b('0xb')]);router[_0xf54b('0xc')]('/',auth[_0xf54b('0x8')](),controller[_0xf54b('0xd')]);router['post'](_0xf54b('0x7'),auth[_0xf54b('0x8')](),controller[_0xf54b('0xe')]);router[_0xf54b('0xf')](_0xf54b('0x5'),auth[_0xf54b('0x8')](),controller[_0xf54b('0x10')]);router[_0xf54b('0x11')](_0xf54b('0x5'),auth[_0xf54b('0x8')](),controller[_0xf54b('0x12')]);module[_0xf54b('0x13')]=router; \ No newline at end of file +var _0xc52b=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','addConfiguration','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1034ee,_0x12998c){var _0x2922af=function(_0x13715a){while(--_0x13715a){_0x1034ee['push'](_0x1034ee['shift']());}};_0x2922af(++_0x12998c);}(_0xc52b,0x1c8));var _0xbc52=function(_0x348475,_0x12a278){_0x348475=_0x348475-0x0;var _0x35c266=_0xc52b[_0x348475];return _0x35c266;};'use strict';var multer=require(_0xbc52('0x0'));var util=require(_0xbc52('0x1'));var path=require(_0xbc52('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbc52('0x3')]();var auth=require(_0xbc52('0x4'));var interaction=require(_0xbc52('0x5'));var config=require(_0xbc52('0x6'));var controller=require('./intDynamics365Account.controller');router[_0xbc52('0x7')]('/',auth[_0xbc52('0x8')](),controller[_0xbc52('0x9')]);router[_0xbc52('0x7')](_0xbc52('0xa'),auth['isAuthenticated'](),controller[_0xbc52('0xb')]);router[_0xbc52('0x7')](_0xbc52('0xc'),auth[_0xbc52('0x8')](),controller[_0xbc52('0xd')]);router[_0xbc52('0x7')](_0xbc52('0xe'),auth[_0xbc52('0x8')](),controller[_0xbc52('0xf')]);router['post']('/',auth[_0xbc52('0x8')](),controller[_0xbc52('0x10')]);router['post']('/:id/configurations',auth[_0xbc52('0x8')](),controller[_0xbc52('0x11')]);router['put'](_0xbc52('0xa'),auth[_0xbc52('0x8')](),controller[_0xbc52('0x12')]);router[_0xbc52('0x13')](_0xbc52('0xa'),auth[_0xbc52('0x8')](),controller[_0xbc52('0x14')]);module[_0xbc52('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 3caccd0..a49453e 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 _0xf9a7=['sequelize','STRING'];(function(_0x42e94d,_0x2355e5){var _0x5b18c5=function(_0xe65968){while(--_0xe65968){_0x42e94d['push'](_0x42e94d['shift']());}};_0x5b18c5(++_0x2355e5);}(_0xf9a7,0x82));var _0x7f9a=function(_0x568ef1,_0x239152){_0x568ef1=_0x568ef1-0x0;var _0x209ed6=_0xf9a7[_0x568ef1];return _0x209ed6;};'use strict';var Sequelize=require(_0x7f9a('0x0'));module['exports']={'name':{'type':Sequelize[_0x7f9a('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x7f9a('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x7f9a('0x1')]},'clientId':{'type':Sequelize[_0x7f9a('0x1')]},'clientSecret':{'type':Sequelize[_0x7f9a('0x1')]},'serverUrl':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7f9a('0x1')]}}; \ No newline at end of file +var _0x8c50=['exports','STRING','sequelize'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0x8c50,0x146));var _0x08c5=function(_0x4510d1,_0x32adfb){_0x4510d1=_0x4510d1-0x0;var _0x4ef1b1=_0x8c50[_0x4510d1];return _0x4ef1b1;};'use strict';var Sequelize=require(_0x08c5('0x0'));module[_0x08c5('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x08c5('0x2')]},'password':{'type':Sequelize[_0x08c5('0x2')]},'remoteUri':{'type':Sequelize[_0x08c5('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x08c5('0x2')]},'clientSecret':{'type':Sequelize[_0x08c5('0x2')]},'serverUrl':{'type':Sequelize[_0x08c5('0x2')]},'description':{'type':Sequelize[_0x08c5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 472c7c5..95fdfda 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 _0xd2ba=['GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','forEach','@odata.type','PicklistAttributeMetadata','all','isNil','BooleanAttributeMetadata','push','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','UserLocalizedLabel','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','zip-dir','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','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','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','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','Dynamics365Account,\x20%s,\x20%s','catch','sendStatus','status','count','limit','set','json','apply','save','update','then','destroy','end','stack','name','send','rawAttributes','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','offset','sort','where','pick','filter','map','type','key','field','options','Dynamics365Account','includeAll','include','findAll','rows','show','params','keys','merge','find','create','body','getConfigurations','findOne','length','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridtype','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','tenantId','slice','substring','lastIndexOf','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','clientId','access_token'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xd2ba,0x108));var _0xad2b=function(_0x3eb540,_0x4e517a){_0x3eb540=_0x3eb540-0x0;var _0x2e88d8=_0xd2ba[_0x3eb540];return _0x2e88d8;};'use strict';var pdf=require(_0xad2b('0x0'));var emlformat=require(_0xad2b('0x1'));var rimraf=require(_0xad2b('0x2'));var zipdir=require(_0xad2b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xad2b('0x4'));var moment=require(_0xad2b('0x5'));var BPromise=require(_0xad2b('0x6'));var Mustache=require(_0xad2b('0x7'));var util=require(_0xad2b('0x8'));var path=require('path');var sox=require(_0xad2b('0x9'));var csv=require(_0xad2b('0xa'));var ejs=require(_0xad2b('0xb'));var fs=require('fs');var _=require(_0xad2b('0xc'));var squel=require(_0xad2b('0xd'));var crypto=require(_0xad2b('0xe'));var jsforce=require(_0xad2b('0xf'));var deskjs=require(_0xad2b('0x10'));var toCsv=require(_0xad2b('0xa'));var querystring=require(_0xad2b('0x11'));var Papa=require('papaparse');var Redis=require(_0xad2b('0x12'));var authService=require(_0xad2b('0x13'));var qs=require(_0xad2b('0x14'));var hardwareService=require(_0xad2b('0x15'));var logger=require(_0xad2b('0x16'))(_0xad2b('0x17'));var utils=require(_0xad2b('0x18'));var config=require(_0xad2b('0x19'));var db=require(_0xad2b('0x1a'))['db'];var integrations=require(_0xad2b('0x1b'));var jayson=require('jayson/promise');var client=jayson[_0xad2b('0x1c')][_0xad2b('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x372328,_0xfaaca6,_0x14511a){if(_0x14511a){var _0x6d430f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6d430f[_0xad2b('0x1e')](_0xfaaca6)){return _0x372328;}else{throw new Error(_0xad2b('0x1f'));}}else{return _0x372328;}}function respondWithRpcPromise(_0x514f6e,_0x58f3f3,_0x3888a3,_0x196736){return new BPromise(function(_0x443d79,_0x4bbbab){var _0x3b02a0=_0x196736||client;return _0x3b02a0[_0xad2b('0x20')](_0x514f6e,_0x3888a3)['then'](function(_0x441d99){logger[_0xad2b('0x21')]('Dynamics365Account,\x20%s,\x20%s',_0x58f3f3,_0xad2b('0x22'));logger[_0xad2b('0x23')](_0xad2b('0x24'),_0x58f3f3,_0xad2b('0x22'),JSON[_0xad2b('0x25')](_0x441d99));if(_0x441d99[_0xad2b('0x26')]){if(_0x441d99['error']['code']===0x1f4){logger[_0xad2b('0x26')]('Dynamics365Account,\x20%s,\x20%s',_0x58f3f3,_0x441d99[_0xad2b('0x26')][_0xad2b('0x27')]);return _0x4bbbab(_0x441d99['error'][_0xad2b('0x27')]);}logger[_0xad2b('0x26')](_0xad2b('0x28'),_0x58f3f3,_0x441d99['error'][_0xad2b('0x27')]);return _0x443d79(_0x441d99[_0xad2b('0x26')][_0xad2b('0x27')]);}else{logger[_0xad2b('0x21')](_0xad2b('0x28'),_0x58f3f3,_0xad2b('0x22'));_0x443d79(_0x441d99['result'][_0xad2b('0x27')]);}})[_0xad2b('0x29')](function(_0x2b46d){logger['error'](_0xad2b('0x28'),_0x58f3f3,_0x2b46d);_0x4bbbab(_0x2b46d);});});}function respondWithStatusCode(_0x193ba3,_0x1e973a){_0x1e973a=_0x1e973a||0xcc;return function(_0x5b2165){if(_0x5b2165){return _0x193ba3[_0xad2b('0x2a')](_0x1e973a);}return _0x193ba3[_0xad2b('0x2b')](_0x1e973a)['end']();};}function respondWithResult(_0x4a778e,_0x3f00ad){_0x3f00ad=_0x3f00ad||0xc8;return function(_0x559be5){if(_0x559be5){return _0x4a778e[_0xad2b('0x2b')](_0x3f00ad)['json'](_0x559be5);}};}function respondWithFilteredResult(_0x482272,_0xfff9ac){return function(_0x4b624a){if(_0x4b624a){var _0x1652e6=_0x4b624a[_0xad2b('0x2c')],_0x33c38a=_0xfff9ac['offset'],_0x3fd9dd=_0xfff9ac['offset']+_0xfff9ac[_0xad2b('0x2d')],_0x1dc090;if(_0x3fd9dd>=_0x1652e6){_0x3fd9dd=_0x1652e6;_0x1dc090=0xc8;}else{_0x1dc090=0xce;}_0x482272['status'](_0x1dc090);return _0x482272[_0xad2b('0x2e')]('Content-Range',_0x33c38a+'-'+_0x3fd9dd+'/'+_0x1652e6)[_0xad2b('0x2f')](_0x4b624a);}return null;};}function patchUpdates(_0x56a955){return function(_0x21a3ee){try{jsonpatch[_0xad2b('0x30')](_0x21a3ee,_0x56a955,!![]);}catch(_0x561c93){return BPromise['reject'](_0x561c93);}return _0x21a3ee[_0xad2b('0x31')]();};}function saveUpdates(_0x3e3465,_0x4844fb){return function(_0x4d7e4d){if(_0x4d7e4d){return _0x4d7e4d[_0xad2b('0x32')](_0x3e3465)[_0xad2b('0x33')](function(_0x2c8fd7){return _0x2c8fd7;});}return null;};}function removeEntity(_0x4a2405,_0x1b50a0){return function(_0x4549b3){if(_0x4549b3){return _0x4549b3[_0xad2b('0x34')]()[_0xad2b('0x33')](function(){_0x4a2405[_0xad2b('0x2b')](0xcc)[_0xad2b('0x35')]();});}};}function handleEntityNotFound(_0x579bf8,_0x1f1ea1){return function(_0x3ebed9){if(!_0x3ebed9){_0x579bf8[_0xad2b('0x2a')](0x194);}return _0x3ebed9;};}function handleError(_0x31b3a5,_0x336bb0){_0x336bb0=_0x336bb0||0x1f4;return function(_0x3a91a7){logger[_0xad2b('0x26')](_0x3a91a7[_0xad2b('0x36')]);if(_0x3a91a7[_0xad2b('0x37')]){delete _0x3a91a7[_0xad2b('0x37')];}_0x31b3a5['status'](_0x336bb0)[_0xad2b('0x38')](_0x3a91a7);};}exports['index']=function(_0x3dc1ed,_0x54f1bb){var _0xe03a35={},_0x48848a={},_0x5dd4b3={'count':0x0,'rows':[]};var _0x23cb38=db['Dynamics365Account'][_0xad2b('0x39')];_0x48848a[_0xad2b('0x3a')]=_['keys'](_0x23cb38);_0x48848a[_0xad2b('0x3b')]=_['keys'](_0x3dc1ed[_0xad2b('0x3b')]);_0x48848a[_0xad2b('0x3c')]=_[_0xad2b('0x3d')](_0x48848a['model'],_0x48848a['query']);_0xe03a35['attributes']=_[_0xad2b('0x3d')](_0x48848a[_0xad2b('0x3a')],qs[_0xad2b('0x3e')](_0x3dc1ed[_0xad2b('0x3b')]['fields']));_0xe03a35[_0xad2b('0x3f')]=_0xe03a35[_0xad2b('0x3f')]['length']?_0xe03a35[_0xad2b('0x3f')]:_0x48848a[_0xad2b('0x3a')];if(!_0x3dc1ed[_0xad2b('0x3b')][_0xad2b('0x40')](_0xad2b('0x41'))){_0xe03a35[_0xad2b('0x2d')]=qs[_0xad2b('0x2d')](_0x3dc1ed['query'][_0xad2b('0x2d')]);_0xe03a35[_0xad2b('0x42')]=qs['offset'](_0x3dc1ed['query'][_0xad2b('0x42')]);}_0xe03a35['order']=qs['sort'](_0x3dc1ed[_0xad2b('0x3b')][_0xad2b('0x43')]);_0xe03a35[_0xad2b('0x44')]=qs[_0xad2b('0x3c')](_[_0xad2b('0x45')](_0x3dc1ed[_0xad2b('0x3b')],_0x48848a[_0xad2b('0x3c')]));if(_0x3dc1ed[_0xad2b('0x3b')][_0xad2b('0x46')]){_0xe03a35[_0xad2b('0x44')]=_['merge'](_0xe03a35[_0xad2b('0x44')],{'$or':_[_0xad2b('0x47')](_0x23cb38,function(_0x42df1a){if(_0x42df1a[_0xad2b('0x48')][_0xad2b('0x49')]!=='VIRTUAL'){var _0x4166f={};_0x4166f[_0x42df1a[_0xad2b('0x4a')]]={'$like':'%'+_0x3dc1ed['query'][_0xad2b('0x46')]+'%'};return _0x4166f;}})});}_0xe03a35=_['merge']({},_0xe03a35,_0x3dc1ed[_0xad2b('0x4b')]);var _0x127042={'where':_0xe03a35[_0xad2b('0x44')]};return db[_0xad2b('0x4c')][_0xad2b('0x2c')](_0x127042)[_0xad2b('0x33')](function(_0x5dccde){_0x5dd4b3[_0xad2b('0x2c')]=_0x5dccde;if(_0x3dc1ed['query'][_0xad2b('0x4d')]){_0xe03a35[_0xad2b('0x4e')]=[{'all':!![]}];}return db[_0xad2b('0x4c')][_0xad2b('0x4f')](_0xe03a35);})[_0xad2b('0x33')](function(_0x583963){_0x5dd4b3[_0xad2b('0x50')]=_0x583963;return _0x5dd4b3;})[_0xad2b('0x33')](respondWithFilteredResult(_0x54f1bb,_0xe03a35))[_0xad2b('0x29')](handleError(_0x54f1bb,null));};exports[_0xad2b('0x51')]=function(_0x5703d1,_0x3d507e){var _0x27441a={'raw':![],'where':{'id':_0x5703d1[_0xad2b('0x52')]['id']}},_0x2d74b9={};_0x2d74b9[_0xad2b('0x3a')]=_[_0xad2b('0x53')](db[_0xad2b('0x4c')][_0xad2b('0x39')]);_0x2d74b9['query']=_['keys'](_0x5703d1['query']);_0x2d74b9[_0xad2b('0x3c')]=_['intersection'](_0x2d74b9[_0xad2b('0x3a')],_0x2d74b9[_0xad2b('0x3b')]);_0x27441a[_0xad2b('0x3f')]=_[_0xad2b('0x3d')](_0x2d74b9[_0xad2b('0x3a')],qs[_0xad2b('0x3e')](_0x5703d1[_0xad2b('0x3b')][_0xad2b('0x3e')]));_0x27441a[_0xad2b('0x3f')]=_0x27441a['attributes']['length']?_0x27441a[_0xad2b('0x3f')]:_0x2d74b9[_0xad2b('0x3a')];if(_0x5703d1[_0xad2b('0x3b')][_0xad2b('0x4d')]){_0x27441a[_0xad2b('0x4e')]=[{'all':!![]}];}_0x27441a=_[_0xad2b('0x54')]({},_0x27441a,_0x5703d1[_0xad2b('0x4b')]);return db[_0xad2b('0x4c')][_0xad2b('0x55')](_0x27441a)['then'](handleEntityNotFound(_0x3d507e,null))[_0xad2b('0x33')](respondWithResult(_0x3d507e,null))[_0xad2b('0x29')](handleError(_0x3d507e,null));};exports[_0xad2b('0x56')]=function(_0xc433d8,_0x35ddd4){return db[_0xad2b('0x4c')]['create'](_0xc433d8[_0xad2b('0x57')],{})[_0xad2b('0x33')](respondWithResult(_0x35ddd4,0xc9))[_0xad2b('0x29')](handleError(_0x35ddd4,null));};exports[_0xad2b('0x32')]=function(_0x18d919,_0x25b0c5){if(_0x18d919[_0xad2b('0x57')]['id']){delete _0x18d919[_0xad2b('0x57')]['id'];}return db[_0xad2b('0x4c')]['find']({'where':{'id':_0x18d919[_0xad2b('0x52')]['id']}})[_0xad2b('0x33')](handleEntityNotFound(_0x25b0c5,null))[_0xad2b('0x33')](saveUpdates(_0x18d919['body'],null))[_0xad2b('0x33')](respondWithResult(_0x25b0c5,null))[_0xad2b('0x29')](handleError(_0x25b0c5,null));};exports['destroy']=function(_0x1a3c52,_0x17f789){return db['Dynamics365Account'][_0xad2b('0x55')]({'where':{'id':_0x1a3c52[_0xad2b('0x52')]['id']}})[_0xad2b('0x33')](handleEntityNotFound(_0x17f789,null))[_0xad2b('0x33')](removeEntity(_0x17f789,null))[_0xad2b('0x29')](handleError(_0x17f789,null));};exports[_0xad2b('0x58')]=function(_0x26dbba,_0x445e82,_0x32860c){var _0x1cac83={};var _0x3baf15={};var _0x303993;var _0x526ad5;return db[_0xad2b('0x4c')][_0xad2b('0x59')]({'where':{'id':_0x26dbba[_0xad2b('0x52')]['id']}})[_0xad2b('0x33')](handleEntityNotFound(_0x445e82,null))[_0xad2b('0x33')](function(_0x29813c){if(_0x29813c){_0x303993=_0x29813c;_0x3baf15[_0xad2b('0x3a')]=_[_0xad2b('0x53')](db['Dynamics365Configuration'][_0xad2b('0x39')]);_0x3baf15[_0xad2b('0x3b')]=_[_0xad2b('0x53')](_0x26dbba[_0xad2b('0x3b')]);_0x3baf15[_0xad2b('0x3c')]=_[_0xad2b('0x3d')](_0x3baf15[_0xad2b('0x3a')],_0x3baf15[_0xad2b('0x3b')]);_0x1cac83['attributes']=_[_0xad2b('0x3d')](_0x3baf15[_0xad2b('0x3a')],qs[_0xad2b('0x3e')](_0x26dbba['query'][_0xad2b('0x3e')]));_0x1cac83[_0xad2b('0x3f')]=_0x1cac83[_0xad2b('0x3f')][_0xad2b('0x5a')]?_0x1cac83[_0xad2b('0x3f')]:_0x3baf15['model'];_0x1cac83[_0xad2b('0x5b')]=qs[_0xad2b('0x43')](_0x26dbba['query'][_0xad2b('0x43')]);_0x1cac83[_0xad2b('0x44')]=qs['filters'](_[_0xad2b('0x45')](_0x26dbba[_0xad2b('0x3b')],_0x3baf15[_0xad2b('0x3c')]));if(_0x26dbba[_0xad2b('0x3b')][_0xad2b('0x46')]){_0x1cac83[_0xad2b('0x44')]=_['merge'](_0x1cac83[_0xad2b('0x44')],{'$or':_['map'](_0x1cac83[_0xad2b('0x3f')],function(_0x27719d){var _0x501e7a={};_0x501e7a[_0x27719d]={'$like':'%'+_0x26dbba[_0xad2b('0x3b')][_0xad2b('0x46')]+'%'};return _0x501e7a;})});}_0x1cac83=_[_0xad2b('0x54')]({},_0x1cac83,_0x26dbba[_0xad2b('0x4b')]);return _0x303993[_0xad2b('0x58')](_0x1cac83);}})['then'](function(_0x42941c){if(_0x42941c){_0x526ad5=_0x42941c[_0xad2b('0x5a')];if(!_0x26dbba[_0xad2b('0x3b')][_0xad2b('0x40')]('nolimit')){_0x1cac83[_0xad2b('0x2d')]=qs[_0xad2b('0x2d')](_0x26dbba['query'][_0xad2b('0x2d')]);_0x1cac83[_0xad2b('0x42')]=qs['offset'](_0x26dbba[_0xad2b('0x3b')][_0xad2b('0x42')]);}return _0x303993[_0xad2b('0x58')](_0x1cac83);}})['then'](function(_0x138b0d){if(_0x138b0d){return _0x138b0d?{'count':_0x526ad5,'rows':_0x138b0d}:null;}})[_0xad2b('0x33')](respondWithResult(_0x445e82,null))[_0xad2b('0x29')](handleError(_0x445e82,null));};exports[_0xad2b('0x5c')]=function(_0x2b8cec,_0x399614,_0x46832e){if(_0x2b8cec[_0xad2b('0x57')]['id']){delete _0x2b8cec[_0xad2b('0x57')]['id'];}return db['Dynamics365Account'][_0xad2b('0x59')]({'where':{'id':_0x2b8cec['params']['id']}})['then'](handleEntityNotFound(_0x399614,null))[_0xad2b('0x33')](function(_0x5d8080){if(_0x5d8080){_0x2b8cec['body'][_0xad2b('0x5d')]=_0x5d8080['id'];_0x2b8cec[_0xad2b('0x57')][_0xad2b('0x5e')]=integrations[_0xad2b('0x5f')](_0x2b8cec['body'][_0xad2b('0x60')],_0x2b8cec['body'][_0xad2b('0x48')]);_0x2b8cec[_0xad2b('0x57')][_0xad2b('0x61')]=integrations[_0xad2b('0x62')](_0x2b8cec[_0xad2b('0x57')]['channel'],_0x2b8cec[_0xad2b('0x57')][_0xad2b('0x48')]);return db[_0xad2b('0x63')][_0xad2b('0x56')](_0x2b8cec['body'],{'include':[{'model':db[_0xad2b('0x64')],'as':_0xad2b('0x5e')},{'model':db['Dynamics365Field'],'as':_0xad2b('0x61')}]});}return null;})[_0xad2b('0x33')](respondWithResult(_0x399614,null))[_0xad2b('0x29')](handleError(_0x399614,null));};exports[_0xad2b('0x65')]=function(_0x5b26f5,_0x410cde,_0x14f6bc){var _0x521100=_0x5b26f5[_0xad2b('0x3b')][_0xad2b('0x66')];var _0x50d8b8=_0x521100===_0xad2b('0x67')?_0xad2b('0x68'):_0xad2b('0x69');var _0x2952da='';var _0x4dae98='';var _0x3625a6='';var _0x3e9f55='';var _0x1e85be='';var _0x187bc9='';var _0x586e58='';var _0x397642='';var _0x4e91fa=[_0xad2b('0x6a'),'description',_0xad2b('0x6b'),_0xad2b('0x6c'),_0xad2b('0x6d'),_0xad2b('0x6e'),_0xad2b('0x6f'),_0xad2b('0x70'),'directioncode',_0xad2b('0x71')];var _0x5426b5=[_0xad2b('0x72'),_0xad2b('0x73'),_0xad2b('0x74'),_0xad2b('0x75'),_0xad2b('0x76'),_0xad2b('0x77'),'contractdetailidname',_0xad2b('0x78'),_0xad2b('0x79'),_0xad2b('0x7a'),_0xad2b('0x7b'),_0xad2b('0x7c'),_0xad2b('0x7d'),'createdonbehalfbyname',_0xad2b('0x7e'),_0xad2b('0x7f'),_0xad2b('0x80'),'customeridyominame',_0xad2b('0x81'),_0xad2b('0x82'),_0xad2b('0x83'),_0xad2b('0x84'),_0xad2b('0x85'),_0xad2b('0x86'),_0xad2b('0x87'),'followupby',_0xad2b('0x88'),_0xad2b('0x89'),_0xad2b('0x8a'),_0xad2b('0x8b'),_0xad2b('0x8c'),_0xad2b('0x8d'),_0xad2b('0x8e'),'modifiedbyname',_0xad2b('0x8f'),_0xad2b('0x90'),_0xad2b('0x91'),_0xad2b('0x92'),'msdyn_incidenttypename',_0xad2b('0x93'),_0xad2b('0x94'),_0xad2b('0x95'),_0xad2b('0x96'),'owneridname',_0xad2b('0x97'),'owneridyominame','parentcaseidname',_0xad2b('0x98'),_0xad2b('0x99'),_0xad2b('0x9a'),_0xad2b('0x9b'),_0xad2b('0x9c'),'resolveby',_0xad2b('0x9d'),'responseby',_0xad2b('0x9e'),_0xad2b('0x9f'),_0xad2b('0xa0'),_0xad2b('0xa1'),_0xad2b('0xa2'),_0xad2b('0xa3'),_0xad2b('0xa4'),_0xad2b('0xa5'),_0xad2b('0xa6'),_0xad2b('0xa7'),_0xad2b('0xa8'),_0xad2b('0xa9'),_0xad2b('0xaa'),_0xad2b('0xab'),_0xad2b('0xac')];var _0x97613=_0x4e91fa[_0xad2b('0xad')](_0x5426b5);return db[_0xad2b('0x4c')][_0xad2b('0x59')]({'where':{'id':_0x5b26f5[_0xad2b('0x52')]['id']},'attributes':['id',_0xad2b('0xae'),_0xad2b('0xaf'),'remoteUri',_0xad2b('0xb0'),'clientId','clientSecret']})['then'](handleEntityNotFound(_0x410cde,null))[_0xad2b('0x33')](function(_0x488f6c){if(_0x488f6c){_0x397642=_0x488f6c['remoteUri'];var _0x5ea657=_0x397642[_0xad2b('0xb1')](-0x1);if(_0x5ea657==='/'){_0x397642=_0x397642[_0xad2b('0xb2')](0x0,_0x397642[_0xad2b('0xb3')](_0x5ea657));}_0x586e58=util['format'](_0xad2b('0xb4'),_0x397642);var _0x58fcd2={'method':_0xad2b('0xb5'),'uri':_0xad2b('0xb6')+_0x488f6c[_0xad2b('0xb0')]+_0xad2b('0xb7'),'form':{'client_id':_0x488f6c[_0xad2b('0xb8')],'resource':_0x397642,'username':_0x488f6c[_0xad2b('0xae')],'password':_0x488f6c[_0xad2b('0xaf')],'grant_type':_0xad2b('0xaf'),'client_secret':_0x488f6c['clientSecret']},'json':!![]};return rp(_0x58fcd2);}})[_0xad2b('0x33')](function(_0x383baf){_0x187bc9=_0x383baf[_0xad2b('0xb9')];var _0x474a72={'method':_0xad2b('0xba'),'uri':encodeURI(_0x586e58+_0xad2b('0xbb')+_0x50d8b8+'\x27'),'headers':{'Authorization':_0xad2b('0xbc')+_0x187bc9,'If-None-Match':null,'OData-Version':_0xad2b('0xbd')},'json':!![]};return rp(_0x474a72);})[_0xad2b('0x33')](function(_0x167f41){var _0x4b186b=_0x167f41[_0xad2b('0xbe')][0x0];var _0x2cf621=_0x4b186b[_0xad2b('0xbf')];var _0x4f0ee7={'method':'GET','uri':_0x586e58+_0xad2b('0xc0')+_0x2cf621+_0xad2b('0xc1'),'headers':{'Authorization':_0xad2b('0xbc')+_0x187bc9,'If-None-Match':null,'OData-Version':_0xad2b('0xbd')},'json':!![]};return rp(_0x4f0ee7);})[_0xad2b('0x33')](function(_0x128a26){_0x2952da=_0x128a26;_0x4dae98=_0x2952da[_0xad2b('0xc2')];_0x4dae98=_['remove'](_0x4dae98,function(_0x59a486){return!_0x97613['includes'](_0x59a486['LogicalName']);});var _0x918a64=[];var _0x567eca=[];_0x4dae98[_0xad2b('0xc3')](function(_0x47208e){if(_0x47208e[_0xad2b('0xc4')]){var _0xf71b31=_0x47208e[_0xad2b('0xc4')][_0xad2b('0xb2')](_0x47208e['@odata.type']['lastIndexOf']('.')+0x1);if(_0xf71b31===_0xad2b('0xc5')){_0x918a64['push'](getSelectList(_0x586e58,_0x521100,_0x567eca,_0x2952da[_0xad2b('0xbf')],_0x47208e['MetadataId'],_0x187bc9));}}});return Promise[_0xad2b('0xc6')](_0x918a64);})[_0xad2b('0x33')](function(_0x302ad1){_0x3625a6=_0x302ad1[0x0];var _0x30da18=[];var _0x3c9c91=[];_0x4dae98['forEach'](function(_0x421d7b){if(!_[_0xad2b('0xc7')](_0x421d7b[_0xad2b('0xc4')])){var _0x3c3184=_0x421d7b[_0xad2b('0xc4')]['substring'](_0x421d7b[_0xad2b('0xc4')][_0xad2b('0xb3')]('.')+0x1);if(_0x3c3184===_0xad2b('0xc8')){_0x30da18[_0xad2b('0xc9')](getBooleanList(_0x586e58,_0x521100,_0x3c9c91,_0x2952da[_0xad2b('0xbf')],_0x421d7b['MetadataId'],_0x187bc9));}}});return Promise[_0xad2b('0xc6')](_0x30da18);})[_0xad2b('0x33')](function(_0x3c2e21){_0x3e9f55=_0x3c2e21[0x0];var _0x444b79=[];var _0x15d41e=[];_0x4dae98[_0xad2b('0xc3')](function(_0x2dd58e){if(_0x2dd58e[_0xad2b('0xc4')]){var _0x1fb9e4=_0x2dd58e[_0xad2b('0xc4')][_0xad2b('0xb2')](_0x2dd58e[_0xad2b('0xc4')][_0xad2b('0xb3')]('.')+0x1);if(_0x1fb9e4==='StringAttributeMetadata'||_0x1fb9e4===_0xad2b('0xca')||_0x1fb9e4===_0xad2b('0xcb')||_0x1fb9e4==='IntegerAttributeMetadata'||_0x1fb9e4===_0xad2b('0xcc')||_0x1fb9e4==='DateTimeAttributeMetadata'||_0x1fb9e4===_0xad2b('0xcd')||_0x1fb9e4===_0xad2b('0xce')||_0x1fb9e4===_0xad2b('0xcf')||_0x1fb9e4===_0xad2b('0xd0')){_0x444b79[_0xad2b('0xc9')](getInputList(_0x586e58,_0x521100,_0x1fb9e4,_0x15d41e,_0x2952da['MetadataId'],_0x2dd58e[_0xad2b('0xbf')],_0x187bc9));}}});return Promise[_0xad2b('0xc6')](_0x444b79);})[_0xad2b('0x33')](function(_0x5d27d1){_0x1e85be=_0x5d27d1[0x0];var _0x3a432b=_0x3625a6[_0xad2b('0xad')](_0x3e9f55)[_0xad2b('0xad')](_0x1e85be);var _0x133568={'count':_0x3a432b['length'],'rows':_0x3a432b};return _0x133568;})['then'](respondWithResult(_0x410cde,null))[_0xad2b('0x29')](function(_0x573f2d){console['log']('Dynamics365\x20error:\x20'+_0x573f2d);var _0x380edb=_0x5b26f5['query'][_0xad2b('0x1e')]?0x1f4:_0x573f2d[_0xad2b('0xd1')]||0x1f4;logger[_0xad2b('0x26')](_0x573f2d[_0xad2b('0x36')]);delete _0x573f2d[_0xad2b('0x37')];if(_0x380edb===0x191){_0x380edb=0x190;}_0x410cde[_0xad2b('0x2b')](_0x380edb)[_0xad2b('0x38')](_0x5b26f5[_0xad2b('0x3b')]['test']?{'message':_0xad2b('0xd2'),'statusCode':_0x573f2d[_0xad2b('0xd1')]}:_0x573f2d);});};function getSelectList(_0x327313,_0xadc5a9,_0x3db2d5,_0x5d2523,_0x28c661,_0x3955a8){var _0x1a7ed6={'method':_0xad2b('0xba'),'uri':_0x327313+_0xad2b('0xc0')+_0x5d2523+_0xad2b('0xd3')+_0x28c661+_0xad2b('0xd4')+_0xad2b('0xd5'),'headers':{'Authorization':_0xad2b('0xbc')+_0x3955a8,'If-None-Match':null,'OData-Version':_0xad2b('0xbd')},'json':!![]};return rp(_0x1a7ed6)['then'](function(_0x59a592){var _0x4e9cbb=[];var _0x216411=_0x59a592[_0xad2b('0xd6')]['Options'];_0x216411['forEach'](function(_0x6235c6){_0x4e9cbb[_0xad2b('0xc9')]({'name':_0x6235c6[_0xad2b('0xd7')][_0xad2b('0xd8')]['Label'],'value':String(_0x6235c6['Value'])});});var _0x25a169={'id':_0xadc5a9+'_'+_0x59a592[_0xad2b('0xd9')],'name':_0x59a592[_0xad2b('0xda')][_0xad2b('0xd8')]['Label'],'custom':![],'options':_0x4e9cbb};_0x3db2d5[_0xad2b('0xc9')](_0x25a169);return _0x3db2d5;});}function getBooleanList(_0x14bb9a,_0xc7f2b4,_0x2430f0,_0x12b877,_0x232a76,_0xc34f90){var _0x2750e1={'method':_0xad2b('0xba'),'uri':_0x14bb9a+_0xad2b('0xc0')+_0x12b877+')/Attributes('+_0x232a76+_0xad2b('0xdb'),'headers':{'Authorization':_0xad2b('0xbc')+_0xc34f90,'If-None-Match':null,'OData-Version':_0xad2b('0xbd')},'json':!![]};return rp(_0x2750e1)['then'](function(_0x4f0513){var _0x187419=[];_0x187419['push']({'name':_0x4f0513[_0xad2b('0xd6')][_0xad2b('0xdc')][_0xad2b('0xd7')]['UserLocalizedLabel'][_0xad2b('0xd7')],'value':_0xad2b('0xdd')},{'name':_0x4f0513['OptionSet'][_0xad2b('0xde')][_0xad2b('0xd7')]['UserLocalizedLabel'][_0xad2b('0xd7')],'value':_0xad2b('0xdf')});var _0x54fe14={'id':_0xc7f2b4+'_'+_0x4f0513[_0xad2b('0xd9')],'name':_0x4f0513['DisplayName'][_0xad2b('0xd8')][_0xad2b('0xd7')],'custom':![],'options':_0x187419};_0x2430f0[_0xad2b('0xc9')](_0x54fe14);return _0x2430f0;});}function getInputList(_0x2545eb,_0x5e91b0,_0x532df8,_0x106960,_0xdd4653,_0xc6a82f,_0xda9edd){var _0x1e22e1={'method':_0xad2b('0xba'),'uri':_0x2545eb+_0xad2b('0xc0')+_0xdd4653+_0xad2b('0xd3')+_0xc6a82f+')/Microsoft.Dynamics.CRM.'+_0x532df8+_0xad2b('0xe0'),'headers':{'Authorization':'Bearer\x20'+_0xda9edd,'If-None-Match':null,'OData-Version':_0xad2b('0xbd')},'json':!![]};return rp(_0x1e22e1)['then'](function(_0x477d4e){var _0x1e87cf={'id':_0x5e91b0+'_'+_0x477d4e[_0xad2b('0xd9')],'name':_0x477d4e[_0xad2b('0xda')][_0xad2b('0xd8')]?_0x477d4e[_0xad2b('0xda')]['UserLocalizedLabel']['Label']:_0x477d4e[_0xad2b('0xd9')],'custom':![],'options':[]};_0x106960['push'](_0x1e87cf);return _0x106960;});} \ No newline at end of file +var _0xa4f9=['jayson/promise','client','http','test','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','destroy','stack','name','send','index','Dynamics365Account','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','params','rawAttributes','include','find','body','getConfigurations','findOne','Dynamics365Configuration','length','nolimit','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','firstresponsebykpiidname','followupby','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slaname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','utcconversiontimezonecode','versionnumber','concat','username','remoteUri','tenantId','clientId','clientSecret','slice','substring','format','%s/api/data/v9.0/','/oauth2/token','password','access_token','GET','Bearer\x20','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','forEach','@odata.type','lastIndexOf','all','isNil','push','MetadataId','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','Dynamics365\x20error:\x20','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false','LogicalName','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration'];(function(_0xfc762a,_0x4be002){var _0x114e20=function(_0x5f1d9a){while(--_0x5f1d9a){_0xfc762a['push'](_0xfc762a['shift']());}};_0x114e20(++_0x4be002);}(_0xa4f9,0xc2));var _0x9a4f=function(_0xd46479,_0x49fc29){_0xd46479=_0xd46479-0x0;var _0x18dbe5=_0xa4f9[_0xd46479];return _0x18dbe5;};'use strict';var pdf=require(_0x9a4f('0x0'));var emlformat=require(_0x9a4f('0x1'));var rimraf=require(_0x9a4f('0x2'));var zipdir=require(_0x9a4f('0x3'));var jsonpatch=require(_0x9a4f('0x4'));var rp=require('request-promise');var moment=require(_0x9a4f('0x5'));var BPromise=require(_0x9a4f('0x6'));var Mustache=require('mustache');var util=require(_0x9a4f('0x7'));var path=require(_0x9a4f('0x8'));var sox=require('sox');var csv=require(_0x9a4f('0x9'));var ejs=require(_0x9a4f('0xa'));var fs=require('fs');var _=require(_0x9a4f('0xb'));var squel=require(_0x9a4f('0xc'));var crypto=require(_0x9a4f('0xd'));var jsforce=require(_0x9a4f('0xe'));var deskjs=require(_0x9a4f('0xf'));var toCsv=require(_0x9a4f('0x9'));var querystring=require('querystring');var Papa=require(_0x9a4f('0x10'));var Redis=require(_0x9a4f('0x11'));var authService=require(_0x9a4f('0x12'));var qs=require(_0x9a4f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a4f('0x14'))(_0x9a4f('0x15'));var utils=require(_0x9a4f('0x16'));var config=require(_0x9a4f('0x17'));var db=require(_0x9a4f('0x18'))['db'];var integrations=require(_0x9a4f('0x19'));var jayson=require(_0x9a4f('0x1a'));var client=jayson[_0x9a4f('0x1b')][_0x9a4f('0x1c')]({'port':0x232a});function checkPasswordPattern(_0xa9fb19,_0x574bfc,_0x4ed12d){if(_0x4ed12d){var _0x1aedd5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1aedd5[_0x9a4f('0x1d')](_0x574bfc)){return _0xa9fb19;}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 _0xa9fb19;}}function respondWithRpcPromise(_0x26ad37,_0x3d6814,_0x392d74,_0x2c6e8b){return new BPromise(function(_0x30d6d8,_0x3f3172){var _0x443618=_0x2c6e8b||client;return _0x443618[_0x9a4f('0x1e')](_0x26ad37,_0x392d74)[_0x9a4f('0x1f')](function(_0x4099be){logger[_0x9a4f('0x20')](_0x9a4f('0x21'),_0x3d6814,'request\x20sent');logger[_0x9a4f('0x22')](_0x9a4f('0x23'),_0x3d6814,_0x9a4f('0x24'),JSON['stringify'](_0x4099be));if(_0x4099be[_0x9a4f('0x25')]){if(_0x4099be[_0x9a4f('0x25')]['code']===0x1f4){logger['error'](_0x9a4f('0x21'),_0x3d6814,_0x4099be[_0x9a4f('0x25')][_0x9a4f('0x26')]);return _0x3f3172(_0x4099be[_0x9a4f('0x25')]['message']);}logger[_0x9a4f('0x25')](_0x9a4f('0x21'),_0x3d6814,_0x4099be[_0x9a4f('0x25')][_0x9a4f('0x26')]);return _0x30d6d8(_0x4099be[_0x9a4f('0x25')][_0x9a4f('0x26')]);}else{logger['info'](_0x9a4f('0x21'),_0x3d6814,'request\x20sent');_0x30d6d8(_0x4099be[_0x9a4f('0x27')]['message']);}})[_0x9a4f('0x28')](function(_0x14035c){logger[_0x9a4f('0x25')]('Dynamics365Account,\x20%s,\x20%s',_0x3d6814,_0x14035c);_0x3f3172(_0x14035c);});});}function respondWithStatusCode(_0x1e61c4,_0x4681c5){_0x4681c5=_0x4681c5||0xcc;return function(_0x13feab){if(_0x13feab){return _0x1e61c4[_0x9a4f('0x29')](_0x4681c5);}return _0x1e61c4[_0x9a4f('0x2a')](_0x4681c5)[_0x9a4f('0x2b')]();};}function respondWithResult(_0x227d3f,_0x11c21e){_0x11c21e=_0x11c21e||0xc8;return function(_0x2531e5){if(_0x2531e5){return _0x227d3f[_0x9a4f('0x2a')](_0x11c21e)[_0x9a4f('0x2c')](_0x2531e5);}};}function respondWithFilteredResult(_0x1423e9,_0x428164){return function(_0x3e4549){if(_0x3e4549){var _0x5daea5=_0x3e4549[_0x9a4f('0x2d')],_0x58395f=_0x428164[_0x9a4f('0x2e')],_0x237d30=_0x428164[_0x9a4f('0x2e')]+_0x428164[_0x9a4f('0x2f')],_0x5e847f;if(_0x237d30>=_0x5daea5){_0x237d30=_0x5daea5;_0x5e847f=0xc8;}else{_0x5e847f=0xce;}_0x1423e9[_0x9a4f('0x2a')](_0x5e847f);return _0x1423e9[_0x9a4f('0x30')]('Content-Range',_0x58395f+'-'+_0x237d30+'/'+_0x5daea5)['json'](_0x3e4549);}return null;};}function patchUpdates(_0x5389fa){return function(_0xb80185){try{jsonpatch[_0x9a4f('0x31')](_0xb80185,_0x5389fa,!![]);}catch(_0x43e2d1){return BPromise[_0x9a4f('0x32')](_0x43e2d1);}return _0xb80185[_0x9a4f('0x33')]();};}function saveUpdates(_0x37b82f,_0x435d26){return function(_0x4eb3ac){if(_0x4eb3ac){return _0x4eb3ac['update'](_0x37b82f)[_0x9a4f('0x1f')](function(_0x56c686){return _0x56c686;});}return null;};}function removeEntity(_0x2453e1,_0x2a50e2){return function(_0x518728){if(_0x518728){return _0x518728[_0x9a4f('0x34')]()[_0x9a4f('0x1f')](function(){_0x2453e1[_0x9a4f('0x2a')](0xcc)[_0x9a4f('0x2b')]();});}};}function handleEntityNotFound(_0x5629b4,_0x4c5deb){return function(_0x41743c){if(!_0x41743c){_0x5629b4[_0x9a4f('0x29')](0x194);}return _0x41743c;};}function handleError(_0x184c2c,_0x22e568){_0x22e568=_0x22e568||0x1f4;return function(_0x4b30df){logger[_0x9a4f('0x25')](_0x4b30df[_0x9a4f('0x35')]);if(_0x4b30df[_0x9a4f('0x36')]){delete _0x4b30df[_0x9a4f('0x36')];}_0x184c2c[_0x9a4f('0x2a')](_0x22e568)[_0x9a4f('0x37')](_0x4b30df);};}exports[_0x9a4f('0x38')]=function(_0x107d29,_0x49b599){var _0x45f1b5={},_0x59ba04={},_0x7b8225={'count':0x0,'rows':[]};var _0x4fc387=db[_0x9a4f('0x39')]['rawAttributes'];_0x59ba04[_0x9a4f('0x3a')]=_[_0x9a4f('0x3b')](_0x4fc387);_0x59ba04[_0x9a4f('0x3c')]=_[_0x9a4f('0x3b')](_0x107d29[_0x9a4f('0x3c')]);_0x59ba04['filters']=_[_0x9a4f('0x3d')](_0x59ba04['model'],_0x59ba04[_0x9a4f('0x3c')]);_0x45f1b5[_0x9a4f('0x3e')]=_[_0x9a4f('0x3d')](_0x59ba04['model'],qs['fields'](_0x107d29['query'][_0x9a4f('0x3f')]));_0x45f1b5[_0x9a4f('0x3e')]=_0x45f1b5[_0x9a4f('0x3e')]['length']?_0x45f1b5[_0x9a4f('0x3e')]:_0x59ba04['model'];if(!_0x107d29[_0x9a4f('0x3c')][_0x9a4f('0x40')]('nolimit')){_0x45f1b5[_0x9a4f('0x2f')]=qs[_0x9a4f('0x2f')](_0x107d29[_0x9a4f('0x3c')][_0x9a4f('0x2f')]);_0x45f1b5[_0x9a4f('0x2e')]=qs[_0x9a4f('0x2e')](_0x107d29[_0x9a4f('0x3c')][_0x9a4f('0x2e')]);}_0x45f1b5[_0x9a4f('0x41')]=qs[_0x9a4f('0x42')](_0x107d29[_0x9a4f('0x3c')][_0x9a4f('0x42')]);_0x45f1b5[_0x9a4f('0x43')]=qs[_0x9a4f('0x44')](_[_0x9a4f('0x45')](_0x107d29[_0x9a4f('0x3c')],_0x59ba04[_0x9a4f('0x44')]));if(_0x107d29[_0x9a4f('0x3c')][_0x9a4f('0x46')]){_0x45f1b5[_0x9a4f('0x43')]=_[_0x9a4f('0x47')](_0x45f1b5['where'],{'$or':_[_0x9a4f('0x48')](_0x4fc387,function(_0xb758a0){if(_0xb758a0[_0x9a4f('0x49')][_0x9a4f('0x4a')]!==_0x9a4f('0x4b')){var _0x51980f={};_0x51980f[_0xb758a0[_0x9a4f('0x4c')]]={'$like':'%'+_0x107d29['query'][_0x9a4f('0x46')]+'%'};return _0x51980f;}})});}_0x45f1b5=_['merge']({},_0x45f1b5,_0x107d29[_0x9a4f('0x4d')]);var _0x947f90={'where':_0x45f1b5[_0x9a4f('0x43')]};return db[_0x9a4f('0x39')][_0x9a4f('0x2d')](_0x947f90)[_0x9a4f('0x1f')](function(_0x5487f6){_0x7b8225[_0x9a4f('0x2d')]=_0x5487f6;if(_0x107d29[_0x9a4f('0x3c')][_0x9a4f('0x4e')]){_0x45f1b5['include']=[{'all':!![]}];}return db[_0x9a4f('0x39')][_0x9a4f('0x4f')](_0x45f1b5);})['then'](function(_0x305672){_0x7b8225[_0x9a4f('0x50')]=_0x305672;return _0x7b8225;})[_0x9a4f('0x1f')](respondWithFilteredResult(_0x49b599,_0x45f1b5))[_0x9a4f('0x28')](handleError(_0x49b599,null));};exports['show']=function(_0x4ceb9c,_0x22d936){var _0xfe3fb3={'raw':![],'where':{'id':_0x4ceb9c[_0x9a4f('0x51')]['id']}},_0x5de6cb={};_0x5de6cb[_0x9a4f('0x3a')]=_['keys'](db[_0x9a4f('0x39')][_0x9a4f('0x52')]);_0x5de6cb[_0x9a4f('0x3c')]=_[_0x9a4f('0x3b')](_0x4ceb9c['query']);_0x5de6cb[_0x9a4f('0x44')]=_[_0x9a4f('0x3d')](_0x5de6cb[_0x9a4f('0x3a')],_0x5de6cb[_0x9a4f('0x3c')]);_0xfe3fb3[_0x9a4f('0x3e')]=_[_0x9a4f('0x3d')](_0x5de6cb[_0x9a4f('0x3a')],qs[_0x9a4f('0x3f')](_0x4ceb9c[_0x9a4f('0x3c')]['fields']));_0xfe3fb3['attributes']=_0xfe3fb3[_0x9a4f('0x3e')]['length']?_0xfe3fb3[_0x9a4f('0x3e')]:_0x5de6cb['model'];if(_0x4ceb9c[_0x9a4f('0x3c')]['includeAll']){_0xfe3fb3[_0x9a4f('0x53')]=[{'all':!![]}];}_0xfe3fb3=_['merge']({},_0xfe3fb3,_0x4ceb9c['options']);return db[_0x9a4f('0x39')][_0x9a4f('0x54')](_0xfe3fb3)[_0x9a4f('0x1f')](handleEntityNotFound(_0x22d936,null))[_0x9a4f('0x1f')](respondWithResult(_0x22d936,null))[_0x9a4f('0x28')](handleError(_0x22d936,null));};exports['create']=function(_0x1c08f7,_0x2fba23){return db[_0x9a4f('0x39')]['create'](_0x1c08f7[_0x9a4f('0x55')],{})[_0x9a4f('0x1f')](respondWithResult(_0x2fba23,0xc9))['catch'](handleError(_0x2fba23,null));};exports['update']=function(_0x507bfe,_0x554709){if(_0x507bfe[_0x9a4f('0x55')]['id']){delete _0x507bfe[_0x9a4f('0x55')]['id'];}return db[_0x9a4f('0x39')][_0x9a4f('0x54')]({'where':{'id':_0x507bfe['params']['id']}})[_0x9a4f('0x1f')](handleEntityNotFound(_0x554709,null))[_0x9a4f('0x1f')](saveUpdates(_0x507bfe[_0x9a4f('0x55')],null))[_0x9a4f('0x1f')](respondWithResult(_0x554709,null))['catch'](handleError(_0x554709,null));};exports[_0x9a4f('0x34')]=function(_0x3bfdf9,_0x55c561){return db['Dynamics365Account'][_0x9a4f('0x54')]({'where':{'id':_0x3bfdf9['params']['id']}})['then'](handleEntityNotFound(_0x55c561,null))[_0x9a4f('0x1f')](removeEntity(_0x55c561,null))['catch'](handleError(_0x55c561,null));};exports[_0x9a4f('0x56')]=function(_0x240445,_0x1ef23f,_0x2507a5){var _0x35c2a8={};var _0x26b485={};var _0x52132a;var _0x295177;return db['Dynamics365Account'][_0x9a4f('0x57')]({'where':{'id':_0x240445[_0x9a4f('0x51')]['id']}})['then'](handleEntityNotFound(_0x1ef23f,null))['then'](function(_0x5b6edc){if(_0x5b6edc){_0x52132a=_0x5b6edc;_0x26b485[_0x9a4f('0x3a')]=_[_0x9a4f('0x3b')](db[_0x9a4f('0x58')][_0x9a4f('0x52')]);_0x26b485[_0x9a4f('0x3c')]=_[_0x9a4f('0x3b')](_0x240445['query']);_0x26b485['filters']=_[_0x9a4f('0x3d')](_0x26b485[_0x9a4f('0x3a')],_0x26b485[_0x9a4f('0x3c')]);_0x35c2a8[_0x9a4f('0x3e')]=_[_0x9a4f('0x3d')](_0x26b485[_0x9a4f('0x3a')],qs['fields'](_0x240445['query'][_0x9a4f('0x3f')]));_0x35c2a8['attributes']=_0x35c2a8[_0x9a4f('0x3e')][_0x9a4f('0x59')]?_0x35c2a8[_0x9a4f('0x3e')]:_0x26b485[_0x9a4f('0x3a')];_0x35c2a8[_0x9a4f('0x41')]=qs[_0x9a4f('0x42')](_0x240445['query'][_0x9a4f('0x42')]);_0x35c2a8[_0x9a4f('0x43')]=qs[_0x9a4f('0x44')](_[_0x9a4f('0x45')](_0x240445[_0x9a4f('0x3c')],_0x26b485[_0x9a4f('0x44')]));if(_0x240445[_0x9a4f('0x3c')][_0x9a4f('0x46')]){_0x35c2a8[_0x9a4f('0x43')]=_[_0x9a4f('0x47')](_0x35c2a8['where'],{'$or':_[_0x9a4f('0x48')](_0x35c2a8[_0x9a4f('0x3e')],function(_0x9bd283){var _0xaddc54={};_0xaddc54[_0x9bd283]={'$like':'%'+_0x240445[_0x9a4f('0x3c')][_0x9a4f('0x46')]+'%'};return _0xaddc54;})});}_0x35c2a8=_[_0x9a4f('0x47')]({},_0x35c2a8,_0x240445[_0x9a4f('0x4d')]);return _0x52132a[_0x9a4f('0x56')](_0x35c2a8);}})[_0x9a4f('0x1f')](function(_0x1c661f){if(_0x1c661f){_0x295177=_0x1c661f['length'];if(!_0x240445[_0x9a4f('0x3c')]['hasOwnProperty'](_0x9a4f('0x5a'))){_0x35c2a8[_0x9a4f('0x2f')]=qs['limit'](_0x240445['query']['limit']);_0x35c2a8[_0x9a4f('0x2e')]=qs[_0x9a4f('0x2e')](_0x240445[_0x9a4f('0x3c')][_0x9a4f('0x2e')]);}return _0x52132a[_0x9a4f('0x56')](_0x35c2a8);}})[_0x9a4f('0x1f')](function(_0x4d1a3b){if(_0x4d1a3b){return _0x4d1a3b?{'count':_0x295177,'rows':_0x4d1a3b}:null;}})[_0x9a4f('0x1f')](respondWithResult(_0x1ef23f,null))[_0x9a4f('0x28')](handleError(_0x1ef23f,null));};exports['addConfiguration']=function(_0xf4d23c,_0x449baf,_0x13a92f){if(_0xf4d23c[_0x9a4f('0x55')]['id']){delete _0xf4d23c[_0x9a4f('0x55')]['id'];}return db[_0x9a4f('0x39')][_0x9a4f('0x57')]({'where':{'id':_0xf4d23c['params']['id']}})[_0x9a4f('0x1f')](handleEntityNotFound(_0x449baf,null))[_0x9a4f('0x1f')](function(_0x52a061){if(_0x52a061){_0xf4d23c['body'][_0x9a4f('0x5b')]=_0x52a061['id'];_0xf4d23c[_0x9a4f('0x55')][_0x9a4f('0x5c')]=integrations[_0x9a4f('0x5d')](_0xf4d23c['body'][_0x9a4f('0x5e')],_0xf4d23c[_0x9a4f('0x55')][_0x9a4f('0x49')]);_0xf4d23c[_0x9a4f('0x55')]['Descriptions']=integrations[_0x9a4f('0x5f')](_0xf4d23c[_0x9a4f('0x55')][_0x9a4f('0x5e')],_0xf4d23c['body'][_0x9a4f('0x49')]);return db[_0x9a4f('0x58')]['create'](_0xf4d23c[_0x9a4f('0x55')],{'include':[{'model':db[_0x9a4f('0x60')],'as':'Subjects'},{'model':db[_0x9a4f('0x60')],'as':_0x9a4f('0x61')}]});}return null;})[_0x9a4f('0x1f')](respondWithResult(_0x449baf,null))[_0x9a4f('0x28')](handleError(_0x449baf,null));};exports[_0x9a4f('0x62')]=function(_0x261cef,_0x28f428,_0x320bc8){var _0x34bc06=_0x261cef[_0x9a4f('0x3c')][_0x9a4f('0x63')];var _0x536c45=_0x34bc06===_0x9a4f('0x64')?_0x9a4f('0x65'):_0x9a4f('0x66');var _0x1a004f='';var _0x277673='';var _0x396c8d='';var _0x38b905='';var _0x10a75c='';var _0x5f149c='';var _0x5d9770='';var _0x2cd4dc='';var _0x5c248b=[_0x9a4f('0x67'),_0x9a4f('0x68'),_0x9a4f('0x69'),_0x9a4f('0x6a'),_0x9a4f('0x6b'),_0x9a4f('0x6c'),'phonenumber',_0x9a4f('0x6d'),_0x9a4f('0x6e'),_0x9a4f('0x6f')];var _0xf6aeb9=['accountidname',_0x9a4f('0x70'),_0x9a4f('0x71'),_0x9a4f('0x72'),_0x9a4f('0x73'),'contactidyominame',_0x9a4f('0x74'),_0x9a4f('0x75'),_0x9a4f('0x76'),_0x9a4f('0x77'),_0x9a4f('0x78'),'createdbyyominame',_0x9a4f('0x79'),_0x9a4f('0x7a'),_0x9a4f('0x7b'),_0x9a4f('0x7c'),_0x9a4f('0x7d'),'customeridyominame',_0x9a4f('0x7e'),_0x9a4f('0x7f'),_0x9a4f('0x80'),'entityimage_url','escalatedon','exchangerate',_0x9a4f('0x81'),_0x9a4f('0x82'),'importsequencenumber',_0x9a4f('0x83'),'kbarticleidname',_0x9a4f('0x84'),_0x9a4f('0x85'),_0x9a4f('0x86'),_0x9a4f('0x87'),'modifiedbyname',_0x9a4f('0x88'),_0x9a4f('0x89'),_0x9a4f('0x8a'),_0x9a4f('0x8b'),_0x9a4f('0x8c'),_0x9a4f('0x8d'),'numberofchildincidents',_0x9a4f('0x8e'),_0x9a4f('0x8f'),_0x9a4f('0x90'),_0x9a4f('0x91'),_0x9a4f('0x92'),_0x9a4f('0x93'),_0x9a4f('0x94'),_0x9a4f('0x95'),_0x9a4f('0x96'),_0x9a4f('0x97'),_0x9a4f('0x98'),_0x9a4f('0x99'),_0x9a4f('0x9a'),_0x9a4f('0x9b'),_0x9a4f('0x9c'),_0x9a4f('0x9d'),'sentimentvalue','slainvokedidname',_0x9a4f('0x9e'),'socialprofileidname',_0x9a4f('0x9f'),_0x9a4f('0xa0'),_0x9a4f('0xa1'),_0x9a4f('0xa2'),_0x9a4f('0xa3'),'transactioncurrencyidname','traversedpath',_0x9a4f('0xa4'),_0x9a4f('0xa5')];var _0x78f9f8=_0x5c248b[_0x9a4f('0xa6')](_0xf6aeb9);return db['Dynamics365Account']['findOne']({'where':{'id':_0x261cef[_0x9a4f('0x51')]['id']},'attributes':['id',_0x9a4f('0xa7'),'password',_0x9a4f('0xa8'),_0x9a4f('0xa9'),_0x9a4f('0xaa'),_0x9a4f('0xab')]})[_0x9a4f('0x1f')](handleEntityNotFound(_0x28f428,null))[_0x9a4f('0x1f')](function(_0x4fbfbd){if(_0x4fbfbd){_0x2cd4dc=_0x4fbfbd['remoteUri'];var _0x66b8f=_0x2cd4dc[_0x9a4f('0xac')](-0x1);if(_0x66b8f==='/'){_0x2cd4dc=_0x2cd4dc[_0x9a4f('0xad')](0x0,_0x2cd4dc['lastIndexOf'](_0x66b8f));}_0x5d9770=util[_0x9a4f('0xae')](_0x9a4f('0xaf'),_0x2cd4dc);var _0x4a3af3={'method':'POST','uri':'https://login.microsoftonline.com/'+_0x4fbfbd['tenantId']+_0x9a4f('0xb0'),'form':{'client_id':_0x4fbfbd['clientId'],'resource':_0x2cd4dc,'username':_0x4fbfbd[_0x9a4f('0xa7')],'password':_0x4fbfbd[_0x9a4f('0xb1')],'grant_type':'password','client_secret':_0x4fbfbd[_0x9a4f('0xab')]},'json':!![]};return rp(_0x4a3af3);}})[_0x9a4f('0x1f')](function(_0x3201ad){_0x5f149c=_0x3201ad[_0x9a4f('0xb2')];var _0x1cbb92={'method':_0x9a4f('0xb3'),'uri':encodeURI(_0x5d9770+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x536c45+'\x27'),'headers':{'Authorization':_0x9a4f('0xb4')+_0x5f149c,'If-None-Match':null,'OData-Version':_0x9a4f('0xb5')},'json':!![]};return rp(_0x1cbb92);})[_0x9a4f('0x1f')](function(_0x189979){var _0x46e340=_0x189979[_0x9a4f('0xb6')][0x0];var _0x164d6d=_0x46e340['MetadataId'];var _0x5c054b={'method':'GET','uri':_0x5d9770+_0x9a4f('0xb7')+_0x164d6d+_0x9a4f('0xb8'),'headers':{'Authorization':_0x9a4f('0xb4')+_0x5f149c,'If-None-Match':null,'OData-Version':_0x9a4f('0xb5')},'json':!![]};return rp(_0x5c054b);})[_0x9a4f('0x1f')](function(_0x626569){_0x1a004f=_0x626569;_0x277673=_0x1a004f[_0x9a4f('0xb9')];_0x277673=_[_0x9a4f('0xba')](_0x277673,function(_0x5b0dac){return!_0x78f9f8['includes'](_0x5b0dac['LogicalName']);});var _0x5441b8=[];var _0x52e312=[];_0x277673[_0x9a4f('0xbb')](function(_0xb3fec0){if(_0xb3fec0[_0x9a4f('0xbc')]){var _0x3c86aa=_0xb3fec0['@odata.type'][_0x9a4f('0xad')](_0xb3fec0[_0x9a4f('0xbc')][_0x9a4f('0xbd')]('.')+0x1);if(_0x3c86aa==='PicklistAttributeMetadata'){_0x5441b8['push'](getSelectList(_0x5d9770,_0x34bc06,_0x52e312,_0x1a004f['MetadataId'],_0xb3fec0['MetadataId'],_0x5f149c));}}});return Promise[_0x9a4f('0xbe')](_0x5441b8);})[_0x9a4f('0x1f')](function(_0x489327){_0x396c8d=_0x489327[0x0];var _0x8bdab3=[];var _0x3a127c=[];_0x277673['forEach'](function(_0x4fce8d){if(!_[_0x9a4f('0xbf')](_0x4fce8d[_0x9a4f('0xbc')])){var _0x167afd=_0x4fce8d[_0x9a4f('0xbc')][_0x9a4f('0xad')](_0x4fce8d['@odata.type'][_0x9a4f('0xbd')]('.')+0x1);if(_0x167afd==='BooleanAttributeMetadata'){_0x8bdab3[_0x9a4f('0xc0')](getBooleanList(_0x5d9770,_0x34bc06,_0x3a127c,_0x1a004f['MetadataId'],_0x4fce8d[_0x9a4f('0xc1')],_0x5f149c));}}});return Promise[_0x9a4f('0xbe')](_0x8bdab3);})[_0x9a4f('0x1f')](function(_0x2643c2){_0x38b905=_0x2643c2[0x0];var _0x423f05=[];var _0x4e3a1d=[];_0x277673[_0x9a4f('0xbb')](function(_0x2c6952){if(_0x2c6952[_0x9a4f('0xbc')]){var _0x49d8c8=_0x2c6952[_0x9a4f('0xbc')]['substring'](_0x2c6952[_0x9a4f('0xbc')][_0x9a4f('0xbd')]('.')+0x1);if(_0x49d8c8===_0x9a4f('0xc2')||_0x49d8c8===_0x9a4f('0xc3')||_0x49d8c8===_0x9a4f('0xc4')||_0x49d8c8===_0x9a4f('0xc5')||_0x49d8c8===_0x9a4f('0xc6')||_0x49d8c8==='DateTimeAttributeMetadata'||_0x49d8c8===_0x9a4f('0xc7')||_0x49d8c8===_0x9a4f('0xc8')||_0x49d8c8===_0x9a4f('0xc9')||_0x49d8c8===_0x9a4f('0xca')){_0x423f05[_0x9a4f('0xc0')](getInputList(_0x5d9770,_0x34bc06,_0x49d8c8,_0x4e3a1d,_0x1a004f[_0x9a4f('0xc1')],_0x2c6952[_0x9a4f('0xc1')],_0x5f149c));}}});return Promise[_0x9a4f('0xbe')](_0x423f05);})[_0x9a4f('0x1f')](function(_0x33fdaf){_0x10a75c=_0x33fdaf[0x0];var _0x111850=_0x396c8d[_0x9a4f('0xa6')](_0x38b905)['concat'](_0x10a75c);var _0x2b42d9={'count':_0x111850[_0x9a4f('0x59')],'rows':_0x111850};return _0x2b42d9;})[_0x9a4f('0x1f')](respondWithResult(_0x28f428,null))[_0x9a4f('0x28')](function(_0x49ba47){console['log'](_0x9a4f('0xcb')+_0x49ba47);var _0x511ed0=_0x261cef[_0x9a4f('0x3c')][_0x9a4f('0x1d')]?0x1f4:_0x49ba47[_0x9a4f('0xcc')]||0x1f4;logger[_0x9a4f('0x25')](_0x49ba47[_0x9a4f('0x35')]);delete _0x49ba47['name'];if(_0x511ed0===0x191){_0x511ed0=0x190;}_0x28f428[_0x9a4f('0x2a')](_0x511ed0)['send'](_0x261cef[_0x9a4f('0x3c')][_0x9a4f('0x1d')]?{'message':_0x9a4f('0xcd'),'statusCode':_0x49ba47[_0x9a4f('0xcc')]}:_0x49ba47);});};function getSelectList(_0xf51c1b,_0x4485a8,_0xa2dd4e,_0x4acd67,_0x2b31cd,_0x546fca){var _0x6fa3cb={'method':_0x9a4f('0xb3'),'uri':_0xf51c1b+_0x9a4f('0xb7')+_0x4acd67+_0x9a4f('0xce')+_0x2b31cd+_0x9a4f('0xcf')+_0x9a4f('0xd0'),'headers':{'Authorization':_0x9a4f('0xb4')+_0x546fca,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x6fa3cb)['then'](function(_0x3ff6dc){var _0x41ca34=[];var _0x1a0320=_0x3ff6dc[_0x9a4f('0xd1')][_0x9a4f('0xd2')];_0x1a0320['forEach'](function(_0x4dbf7f){_0x41ca34['push']({'name':_0x4dbf7f[_0x9a4f('0xd3')][_0x9a4f('0xd4')][_0x9a4f('0xd3')],'value':String(_0x4dbf7f[_0x9a4f('0xd5')])});});var _0x5832e4={'id':_0x4485a8+'_'+_0x3ff6dc['LogicalName'],'name':_0x3ff6dc[_0x9a4f('0xd6')][_0x9a4f('0xd4')][_0x9a4f('0xd3')],'custom':![],'options':_0x41ca34};_0xa2dd4e[_0x9a4f('0xc0')](_0x5832e4);return _0xa2dd4e;});}function getBooleanList(_0x2c3dda,_0x4c0246,_0x4f0a66,_0x46ba12,_0x4f709c,_0x230d28){var _0x4f0e17={'method':'GET','uri':_0x2c3dda+_0x9a4f('0xb7')+_0x46ba12+_0x9a4f('0xce')+_0x4f709c+_0x9a4f('0xd7'),'headers':{'Authorization':_0x9a4f('0xb4')+_0x230d28,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4f0e17)['then'](function(_0x6915c7){var _0x3c146a=[];_0x3c146a[_0x9a4f('0xc0')]({'name':_0x6915c7[_0x9a4f('0xd1')][_0x9a4f('0xd8')][_0x9a4f('0xd3')][_0x9a4f('0xd4')][_0x9a4f('0xd3')],'value':_0x9a4f('0xd9')},{'name':_0x6915c7[_0x9a4f('0xd1')]['FalseOption'][_0x9a4f('0xd3')]['UserLocalizedLabel'][_0x9a4f('0xd3')],'value':_0x9a4f('0xda')});var _0x40b28d={'id':_0x4c0246+'_'+_0x6915c7[_0x9a4f('0xdb')],'name':_0x6915c7[_0x9a4f('0xd6')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x3c146a};_0x4f0a66[_0x9a4f('0xc0')](_0x40b28d);return _0x4f0a66;});}function getInputList(_0x582eb3,_0x3bbba9,_0x2fcebd,_0x234607,_0x368c16,_0x2ec51e,_0x1479f2){var _0x3f9b33={'method':_0x9a4f('0xb3'),'uri':_0x582eb3+'EntityDefinitions('+_0x368c16+_0x9a4f('0xce')+_0x2ec51e+')/Microsoft.Dynamics.CRM.'+_0x2fcebd+'?$select=DisplayName,LogicalName','headers':{'Authorization':'Bearer\x20'+_0x1479f2,'If-None-Match':null,'OData-Version':_0x9a4f('0xb5')},'json':!![]};return rp(_0x3f9b33)[_0x9a4f('0x1f')](function(_0x58904b){var _0x5142ab={'id':_0x3bbba9+'_'+_0x58904b[_0x9a4f('0xdb')],'name':_0x58904b[_0x9a4f('0xd6')]['UserLocalizedLabel']?_0x58904b['DisplayName']['UserLocalizedLabel'][_0x9a4f('0xd3')]:_0x58904b[_0x9a4f('0xdb')],'custom':![],'options':[]};_0x234607[_0x9a4f('0xc0')](_0x5142ab);return _0x234607;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 8691157..d5d12b4 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 _0x9ec5=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','../../config/logger'];(function(_0xbfa61c,_0x4d9a1d){var _0x45cd82=function(_0x4d87c1){while(--_0x4d87c1){_0xbfa61c['push'](_0xbfa61c['shift']());}};_0x45cd82(++_0x4d9a1d);}(_0x9ec5,0xcf));var _0x59ec=function(_0x3f6c29,_0x370d86){_0x3f6c29=_0x3f6c29-0x0;var _0x4af959=_0x9ec5[_0x3f6c29];return _0x4af959;};'use strict';var _=require(_0x59ec('0x0'));var util=require(_0x59ec('0x1'));var logger=require(_0x59ec('0x2'))(_0x59ec('0x3'));var moment=require(_0x59ec('0x4'));var BPromise=require(_0x59ec('0x5'));var rp=require(_0x59ec('0x6'));var fs=require('fs');var path=require(_0x59ec('0x7'));var rimraf=require(_0x59ec('0x8'));var config=require(_0x59ec('0x9'));var attributes=require(_0x59ec('0xa'));var integrations=require('../../components/integrations/configuration');module[_0x59ec('0xb')]=function(_0x442bd3,_0x3bf6f2){return _0x442bd3['define'](_0x59ec('0xc'),attributes,{'tableName':_0x59ec('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b58=['rimraf','../../config/environment','./intDynamics365Account.attributes','exports','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','request-promise','path'];(function(_0x35b414,_0x500f38){var _0x271919=function(_0xb74257){while(--_0xb74257){_0x35b414['push'](_0x35b414['shift']());}};_0x271919(++_0x500f38);}(_0x4b58,0x119));var _0x84b5=function(_0x15251b,_0x1f22f0){_0x15251b=_0x15251b-0x0;var _0x181da3=_0x4b58[_0x15251b];return _0x181da3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x84b5('0x0'))(_0x84b5('0x1'));var moment=require(_0x84b5('0x2'));var BPromise=require('bluebird');var rp=require(_0x84b5('0x3'));var fs=require('fs');var path=require(_0x84b5('0x4'));var rimraf=require(_0x84b5('0x5'));var config=require(_0x84b5('0x6'));var attributes=require(_0x84b5('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x84b5('0x8')]=function(_0x516f77,_0x4a1db8){return _0x516f77['define'](_0x84b5('0x9'),attributes,{'tableName':_0x84b5('0xa'),'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 ad574e7..68c99bb 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 _0x6129=['include','model','map','GetDynamics365Account','ShowDynamics365Account','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Dynamics365Account','findAll','options','raw','where','attributes','limit'];(function(_0x354421,_0x2a354d){var _0x2fd01c=function(_0x34e307){while(--_0x34e307){_0x354421['push'](_0x354421['shift']());}};_0x2fd01c(++_0x2a354d);}(_0x6129,0x1a8));var _0x9612=function(_0x140c64,_0x4c4056){_0x140c64=_0x140c64-0x0;var _0x3f0c30=_0x6129[_0x140c64];return _0x3f0c30;};'use strict';var _=require(_0x9612('0x0'));var util=require(_0x9612('0x1'));var moment=require(_0x9612('0x2'));var BPromise=require('bluebird');var rs=require(_0x9612('0x3'));var fs=require('fs');var Redis=require(_0x9612('0x4'));var db=require(_0x9612('0x5'))['db'];var utils=require(_0x9612('0x6'));var logger=require(_0x9612('0x7'))(_0x9612('0x8'));var config=require(_0x9612('0x9'));var jayson=require(_0x9612('0xa'));var client=jayson[_0x9612('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x128637,_0x2ad0b4,_0x2f4748){return new BPromise(function(_0x1fa247,_0x5340eb){return client[_0x9612('0xc')](_0x128637,_0x2f4748)[_0x9612('0xd')](function(_0x2ed581){logger[_0x9612('0xe')](_0x9612('0xf'),_0x2ad0b4,_0x9612('0x10'));logger[_0x9612('0x11')](_0x9612('0x12'),_0x2ad0b4,'request\x20sent',JSON[_0x9612('0x13')](_0x2ed581));if(_0x2ed581['error']){if(_0x2ed581[_0x9612('0x14')][_0x9612('0x15')]===0x1f4){logger['error'](_0x9612('0xf'),_0x2ad0b4,_0x2ed581['error'][_0x9612('0x16')]);return _0x5340eb(_0x2ed581[_0x9612('0x14')][_0x9612('0x16')]);}logger[_0x9612('0x14')](_0x9612('0xf'),_0x2ad0b4,_0x2ed581['error'][_0x9612('0x16')]);return _0x1fa247(_0x2ed581['error'][_0x9612('0x16')]);}else{logger[_0x9612('0xe')](_0x9612('0xf'),_0x2ad0b4,'request\x20sent');_0x1fa247(_0x2ed581[_0x9612('0x17')]['message']);}})[_0x9612('0x18')](function(_0x1c9538){logger[_0x9612('0x14')](_0x9612('0xf'),_0x2ad0b4,_0x1c9538);_0x5340eb(_0x1c9538);});});}exports['GetDynamics365Account']=function(_0x1d5070){var _0x174c64=this;return new Promise(function(_0x3c2c92,_0xab3301){return db[_0x9612('0x19')][_0x9612('0x1a')]({'raw':_0x1d5070[_0x9612('0x1b')]?_0x1d5070['options'][_0x9612('0x1c')]===undefined?!![]:![]:!![],'where':_0x1d5070[_0x9612('0x1b')]?_0x1d5070['options'][_0x9612('0x1d')]||null:null,'attributes':_0x1d5070[_0x9612('0x1b')]?_0x1d5070[_0x9612('0x1b')][_0x9612('0x1e')]||null:null,'limit':_0x1d5070[_0x9612('0x1b')]?_0x1d5070['options'][_0x9612('0x1f')]||null:null,'include':_0x1d5070[_0x9612('0x1b')]?_0x1d5070[_0x9612('0x1b')][_0x9612('0x20')]?_['map'](_0x1d5070[_0x9612('0x1b')][_0x9612('0x20')],function(_0x1c38aa){return{'model':db[_0x1c38aa[_0x9612('0x21')]],'as':_0x1c38aa['as'],'attributes':_0x1c38aa[_0x9612('0x1e')],'include':_0x1c38aa[_0x9612('0x20')]?_[_0x9612('0x22')](_0x1c38aa[_0x9612('0x20')],function(_0x179c78){return{'model':db[_0x179c78['model']],'as':_0x179c78['as'],'attributes':_0x179c78[_0x9612('0x1e')],'include':_0x179c78[_0x9612('0x20')]?_['map'](_0x179c78[_0x9612('0x20')],function(_0x51c924){return{'model':db[_0x51c924['model']],'as':_0x51c924['as'],'attributes':_0x51c924[_0x9612('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f47d7){logger['info']('GetDynamics365Account',_0x1d5070);logger[_0x9612('0x11')](_0x9612('0x23'),_0x1d5070,JSON[_0x9612('0x13')](_0x2f47d7));_0x3c2c92(_0x2f47d7);})[_0x9612('0x18')](function(_0x5224c6){logger['error']('GetDynamics365Account',_0x5224c6[_0x9612('0x16')],_0x1d5070);_0xab3301(_0x174c64['error'](0x1f4,_0x5224c6['message']));});});};exports[_0x9612('0x24')]=function(_0x52f073){var _0x54e6dd=this;return new Promise(function(_0x4b95e2,_0x3384ae){return db['Dynamics365Account'][_0x9612('0x25')]({'raw':_0x52f073[_0x9612('0x1b')]?_0x52f073[_0x9612('0x1b')][_0x9612('0x1c')]===undefined?!![]:![]:!![],'where':_0x52f073[_0x9612('0x1b')]?_0x52f073[_0x9612('0x1b')][_0x9612('0x1d')]||null:null,'attributes':_0x52f073[_0x9612('0x1b')]?_0x52f073['options'][_0x9612('0x1e')]||null:null,'include':_0x52f073[_0x9612('0x1b')]?_0x52f073[_0x9612('0x1b')][_0x9612('0x20')]?_[_0x9612('0x22')](_0x52f073[_0x9612('0x1b')]['include'],function(_0x44dd2b){return{'model':db[_0x44dd2b['model']],'as':_0x44dd2b['as'],'attributes':_0x44dd2b[_0x9612('0x1e')],'include':_0x44dd2b[_0x9612('0x20')]?_['map'](_0x44dd2b['include'],function(_0x425f9a){return{'model':db[_0x425f9a[_0x9612('0x21')]],'as':_0x425f9a['as'],'attributes':_0x425f9a[_0x9612('0x1e')],'include':_0x425f9a[_0x9612('0x20')]?_['map'](_0x425f9a[_0x9612('0x20')],function(_0x2dd830){return{'model':db[_0x2dd830['model']],'as':_0x2dd830['as'],'attributes':_0x2dd830['attributes']};}):[]};}):[]};}):[]:[]})[_0x9612('0xd')](function(_0xe94430){logger[_0x9612('0xe')](_0x9612('0x24'),_0x52f073);logger[_0x9612('0x11')](_0x9612('0x24'),_0x52f073,JSON[_0x9612('0x13')](_0xe94430));_0x4b95e2(_0xe94430);})['catch'](function(_0x57a6a6){logger[_0x9612('0x14')](_0x9612('0x24'),_0x57a6a6['message'],_0x52f073);_0x3384ae(_0x54e6dd[_0x9612('0x14')](0x1f4,_0x57a6a6[_0x9612('0x16')]));});});}; \ No newline at end of file +var _0x3393=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Dynamics365Account','findAll','options','raw','attributes','limit','map','model','include','GetDynamics365Account','ShowDynamics365Account','find','where','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x236346,_0x117e18){var _0x4708ed=function(_0x281a7c){while(--_0x281a7c){_0x236346['push'](_0x236346['shift']());}};_0x4708ed(++_0x117e18);}(_0x3393,0x6a));var _0x3339=function(_0x26ca74,_0x5acf10){_0x26ca74=_0x26ca74-0x0;var _0x1c4655=_0x3393[_0x26ca74];return _0x1c4655;};'use strict';var _=require(_0x3339('0x0'));var util=require('util');var moment=require(_0x3339('0x1'));var BPromise=require(_0x3339('0x2'));var rs=require(_0x3339('0x3'));var fs=require('fs');var Redis=require(_0x3339('0x4'));var db=require(_0x3339('0x5'))['db'];var utils=require(_0x3339('0x6'));var logger=require(_0x3339('0x7'))('rpc');var config=require(_0x3339('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3339('0x9')][_0x3339('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2619a7,_0x5bdd20,_0x4ce251){return new BPromise(function(_0x4bb004,_0x5933ba){return client[_0x3339('0xb')](_0x2619a7,_0x4ce251)[_0x3339('0xc')](function(_0x213fbf){logger[_0x3339('0xd')](_0x3339('0xe'),_0x5bdd20,_0x3339('0xf'));logger[_0x3339('0x10')](_0x3339('0x11'),_0x5bdd20,_0x3339('0xf'),JSON[_0x3339('0x12')](_0x213fbf));if(_0x213fbf[_0x3339('0x13')]){if(_0x213fbf[_0x3339('0x13')][_0x3339('0x14')]===0x1f4){logger[_0x3339('0x13')]('Dynamics365Account,\x20%s,\x20%s',_0x5bdd20,_0x213fbf[_0x3339('0x13')][_0x3339('0x15')]);return _0x5933ba(_0x213fbf[_0x3339('0x13')]['message']);}logger[_0x3339('0x13')](_0x3339('0xe'),_0x5bdd20,_0x213fbf['error'][_0x3339('0x15')]);return _0x4bb004(_0x213fbf['error'][_0x3339('0x15')]);}else{logger[_0x3339('0xd')](_0x3339('0xe'),_0x5bdd20,_0x3339('0xf'));_0x4bb004(_0x213fbf[_0x3339('0x16')][_0x3339('0x15')]);}})[_0x3339('0x17')](function(_0xef02a2){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x5bdd20,_0xef02a2);_0x5933ba(_0xef02a2);});});}exports['GetDynamics365Account']=function(_0x2829fd){var _0x3b5e12=this;return new Promise(function(_0x41ac5b,_0x5f2763){return db[_0x3339('0x18')][_0x3339('0x19')]({'raw':_0x2829fd[_0x3339('0x1a')]?_0x2829fd[_0x3339('0x1a')][_0x3339('0x1b')]===undefined?!![]:![]:!![],'where':_0x2829fd[_0x3339('0x1a')]?_0x2829fd['options']['where']||null:null,'attributes':_0x2829fd[_0x3339('0x1a')]?_0x2829fd[_0x3339('0x1a')][_0x3339('0x1c')]||null:null,'limit':_0x2829fd['options']?_0x2829fd[_0x3339('0x1a')][_0x3339('0x1d')]||null:null,'include':_0x2829fd[_0x3339('0x1a')]?_0x2829fd[_0x3339('0x1a')]['include']?_[_0x3339('0x1e')](_0x2829fd[_0x3339('0x1a')]['include'],function(_0x323857){return{'model':db[_0x323857[_0x3339('0x1f')]],'as':_0x323857['as'],'attributes':_0x323857[_0x3339('0x1c')],'include':_0x323857[_0x3339('0x20')]?_[_0x3339('0x1e')](_0x323857['include'],function(_0x2a9d7a){return{'model':db[_0x2a9d7a[_0x3339('0x1f')]],'as':_0x2a9d7a['as'],'attributes':_0x2a9d7a[_0x3339('0x1c')],'include':_0x2a9d7a[_0x3339('0x20')]?_[_0x3339('0x1e')](_0x2a9d7a['include'],function(_0x1e2ae7){return{'model':db[_0x1e2ae7['model']],'as':_0x1e2ae7['as'],'attributes':_0x1e2ae7[_0x3339('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3339('0xc')](function(_0x6f06d5){logger[_0x3339('0xd')](_0x3339('0x21'),_0x2829fd);logger[_0x3339('0x10')](_0x3339('0x21'),_0x2829fd,JSON['stringify'](_0x6f06d5));_0x41ac5b(_0x6f06d5);})['catch'](function(_0x4a3e9e){logger[_0x3339('0x13')](_0x3339('0x21'),_0x4a3e9e[_0x3339('0x15')],_0x2829fd);_0x5f2763(_0x3b5e12[_0x3339('0x13')](0x1f4,_0x4a3e9e['message']));});});};exports[_0x3339('0x22')]=function(_0xdd4a4e){var _0x51d55c=this;return new Promise(function(_0x4dfad4,_0x45fbc1){return db['Dynamics365Account'][_0x3339('0x23')]({'raw':_0xdd4a4e[_0x3339('0x1a')]?_0xdd4a4e['options'][_0x3339('0x1b')]===undefined?!![]:![]:!![],'where':_0xdd4a4e['options']?_0xdd4a4e[_0x3339('0x1a')][_0x3339('0x24')]||null:null,'attributes':_0xdd4a4e[_0x3339('0x1a')]?_0xdd4a4e[_0x3339('0x1a')]['attributes']||null:null,'include':_0xdd4a4e['options']?_0xdd4a4e[_0x3339('0x1a')][_0x3339('0x20')]?_[_0x3339('0x1e')](_0xdd4a4e[_0x3339('0x1a')][_0x3339('0x20')],function(_0x4021bd){return{'model':db[_0x4021bd[_0x3339('0x1f')]],'as':_0x4021bd['as'],'attributes':_0x4021bd[_0x3339('0x1c')],'include':_0x4021bd[_0x3339('0x20')]?_['map'](_0x4021bd[_0x3339('0x20')],function(_0x1be4c2){return{'model':db[_0x1be4c2['model']],'as':_0x1be4c2['as'],'attributes':_0x1be4c2[_0x3339('0x1c')],'include':_0x1be4c2[_0x3339('0x20')]?_[_0x3339('0x1e')](_0x1be4c2['include'],function(_0x3ca932){return{'model':db[_0x3ca932[_0x3339('0x1f')]],'as':_0x3ca932['as'],'attributes':_0x3ca932[_0x3339('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2dcb2b){logger[_0x3339('0xd')](_0x3339('0x22'),_0xdd4a4e);logger['debug']('ShowDynamics365Account',_0xdd4a4e,JSON['stringify'](_0x2dcb2b));_0x4dfad4(_0x2dcb2b);})[_0x3339('0x17')](function(_0x5da485){logger[_0x3339('0x13')](_0x3339('0x22'),_0x5da485[_0x3339('0x15')],_0xdd4a4e);_0x45fbc1(_0x51d55c[_0x3339('0x13')](0x1f4,_0x5da485[_0x3339('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index dabc6cd..7dfac46 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 _0x0d53=['getDescriptions','post','put','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','get','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x13878f,_0x13b813){var _0x3928c6=function(_0x1a7dae){while(--_0x1a7dae){_0x13878f['push'](_0x13878f['shift']());}};_0x3928c6(++_0x13b813);}(_0x0d53,0x1d2));var _0x30d5=function(_0x469f5b,_0x323785){_0x469f5b=_0x469f5b-0x0;var _0x33dc6e=_0x0d53[_0x469f5b];return _0x33dc6e;};'use strict';var multer=require(_0x30d5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x30d5('0x1'));var express=require(_0x30d5('0x2'));var router=express['Router']();var auth=require(_0x30d5('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x30d5('0x4'));var controller=require(_0x30d5('0x5'));router['get']('/',auth[_0x30d5('0x6')](),controller['index']);router[_0x30d5('0x7')](_0x30d5('0x8'),auth[_0x30d5('0x6')](),controller['show']);router[_0x30d5('0x7')](_0x30d5('0x9'),auth['isAuthenticated'](),controller[_0x30d5('0xa')]);router[_0x30d5('0x7')](_0x30d5('0xb'),auth['isAuthenticated'](),controller[_0x30d5('0xc')]);router['get'](_0x30d5('0xd'),auth[_0x30d5('0x6')](),controller[_0x30d5('0xe')]);router[_0x30d5('0xf')]('/',auth[_0x30d5('0x6')](),controller['create']);router[_0x30d5('0x10')]('/:id',auth[_0x30d5('0x6')](),controller['update']);router[_0x30d5('0x11')](_0x30d5('0x8'),auth[_0x30d5('0x6')](),controller[_0x30d5('0x12')]);module[_0x30d5('0x13')]=router; \ No newline at end of file +var _0xbc3f=['/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x412b69,_0x19e9b7){var _0x2edc60=function(_0x21a7fe){while(--_0x21a7fe){_0x412b69['push'](_0x412b69['shift']());}};_0x2edc60(++_0x19e9b7);}(_0xbc3f,0x138));var _0xfbc3=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xbc3f[_0x164eca];return _0x2ce562;};'use strict';var multer=require(_0xfbc3('0x0'));var util=require(_0xfbc3('0x1'));var path=require('path');var timeout=require(_0xfbc3('0x2'));var express=require(_0xfbc3('0x3'));var router=express[_0xfbc3('0x4')]();var auth=require(_0xfbc3('0x5'));var interaction=require(_0xfbc3('0x6'));var config=require(_0xfbc3('0x7'));var controller=require('./intDynamics365Configuration.controller');router[_0xfbc3('0x8')]('/',auth[_0xfbc3('0x9')](),controller['index']);router[_0xfbc3('0x8')](_0xfbc3('0xa'),auth['isAuthenticated'](),controller[_0xfbc3('0xb')]);router[_0xfbc3('0x8')](_0xfbc3('0xc'),auth[_0xfbc3('0x9')](),controller[_0xfbc3('0xd')]);router['get'](_0xfbc3('0xe'),auth[_0xfbc3('0x9')](),controller[_0xfbc3('0xf')]);router[_0xfbc3('0x8')](_0xfbc3('0x10'),auth[_0xfbc3('0x9')](),controller[_0xfbc3('0x11')]);router['post']('/',auth[_0xfbc3('0x9')](),controller[_0xfbc3('0x12')]);router[_0xfbc3('0x13')](_0xfbc3('0xa'),auth[_0xfbc3('0x9')](),controller['update']);router[_0xfbc3('0x14')](_0xfbc3('0xa'),auth[_0xfbc3('0x9')](),controller[_0xfbc3('0x15')]);module[_0xfbc3('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index a145000..de8afdf 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 _0x8280=['exports','STRING','ENUM','incident','sequelize'];(function(_0x11ef9a,_0x18e03a){var _0x318576=function(_0x38162c){while(--_0x38162c){_0x11ef9a['push'](_0x11ef9a['shift']());}};_0x318576(++_0x18e03a);}(_0x8280,0x1ee));var _0x0828=function(_0x2dcb25,_0x281a9d){_0x2dcb25=_0x2dcb25-0x0;var _0x1b3e54=_0x8280[_0x2dcb25];return _0x1b3e54;};'use strict';var Sequelize=require(_0x0828('0x0'));module[_0x0828('0x1')]={'name':{'type':Sequelize[_0x0828('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x0828('0x3')](_0x0828('0x4'),'phonecall'),'defaultValue':_0x0828('0x4')}}; \ No newline at end of file +var _0x14d8=['sequelize','STRING','incident','phonecall'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x14d8,0x1bc));var _0x814d=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x14d8[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0x814d('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x814d('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x814d('0x2'),_0x814d('0x3')),'defaultValue':_0x814d('0x2')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 6e2672e..756712e 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 _0x945d=['getSubjects','Dynamics365Field','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','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','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','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','name','send','index','Dynamics365Configuration','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','pick','filter','where','type','key','VIRTUAL','field','options','include','findAll','rows','show','params','merge','find','create','body','findOne','order','map','getFields','nolimit'];(function(_0x2fe05c,_0x4ad250){var _0x9238be=function(_0x4e682c){while(--_0x4e682c){_0x2fe05c['push'](_0x2fe05c['shift']());}};_0x9238be(++_0x4ad250);}(_0x945d,0x1e3));var _0xd945=function(_0x25b2e6,_0x4eaa30){_0x25b2e6=_0x25b2e6-0x0;var _0x1f3365=_0x945d[_0x25b2e6];return _0x1f3365;};'use strict';var pdf=require(_0xd945('0x0'));var emlformat=require(_0xd945('0x1'));var rimraf=require(_0xd945('0x2'));var zipdir=require(_0xd945('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd945('0x4'));var moment=require(_0xd945('0x5'));var BPromise=require(_0xd945('0x6'));var Mustache=require(_0xd945('0x7'));var util=require(_0xd945('0x8'));var path=require(_0xd945('0x9'));var sox=require(_0xd945('0xa'));var csv=require(_0xd945('0xb'));var ejs=require(_0xd945('0xc'));var fs=require('fs');var _=require(_0xd945('0xd'));var squel=require(_0xd945('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd945('0xf'));var toCsv=require(_0xd945('0xb'));var querystring=require(_0xd945('0x10'));var Papa=require(_0xd945('0x11'));var Redis=require(_0xd945('0x12'));var authService=require(_0xd945('0x13'));var qs=require(_0xd945('0x14'));var hardwareService=require(_0xd945('0x15'));var logger=require('../../config/logger')(_0xd945('0x16'));var utils=require('../../config/utils');var config=require(_0xd945('0x17'));var db=require(_0xd945('0x18'))['db'];var jayson=require(_0xd945('0x19'));var client=jayson[_0xd945('0x1a')][_0xd945('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x542001,_0x4aec5e,_0x5d5605){if(_0x5d5605){var _0x49b174=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x49b174[_0xd945('0x1c')](_0x4aec5e)){return _0x542001;}else{throw new Error(_0xd945('0x1d'));}}else{return _0x542001;}}function respondWithRpcPromise(_0x47b456,_0x34ef1d,_0x57f1e5,_0x16f634){return new BPromise(function(_0x1f6931,_0x563798){var _0x568df2=_0x16f634||client;return _0x568df2[_0xd945('0x1e')](_0x47b456,_0x57f1e5)[_0xd945('0x1f')](function(_0x3af0e7){logger[_0xd945('0x20')](_0xd945('0x21'),_0x34ef1d,_0xd945('0x22'));logger[_0xd945('0x23')](_0xd945('0x24'),_0x34ef1d,_0xd945('0x22'),JSON['stringify'](_0x3af0e7));if(_0x3af0e7['error']){if(_0x3af0e7[_0xd945('0x25')][_0xd945('0x26')]===0x1f4){logger[_0xd945('0x25')](_0xd945('0x21'),_0x34ef1d,_0x3af0e7[_0xd945('0x25')][_0xd945('0x27')]);return _0x563798(_0x3af0e7[_0xd945('0x25')][_0xd945('0x27')]);}logger[_0xd945('0x25')](_0xd945('0x21'),_0x34ef1d,_0x3af0e7[_0xd945('0x25')][_0xd945('0x27')]);return _0x1f6931(_0x3af0e7['error'][_0xd945('0x27')]);}else{logger[_0xd945('0x20')]('Dynamics365Configuration,\x20%s,\x20%s',_0x34ef1d,_0xd945('0x22'));_0x1f6931(_0x3af0e7[_0xd945('0x28')][_0xd945('0x27')]);}})[_0xd945('0x29')](function(_0x4e9c38){logger[_0xd945('0x25')](_0xd945('0x21'),_0x34ef1d,_0x4e9c38);_0x563798(_0x4e9c38);});});}function respondWithStatusCode(_0x46e1b1,_0x48dee7){_0x48dee7=_0x48dee7||0xcc;return function(_0x34de99){if(_0x34de99){return _0x46e1b1[_0xd945('0x2a')](_0x48dee7);}return _0x46e1b1[_0xd945('0x2b')](_0x48dee7)[_0xd945('0x2c')]();};}function respondWithResult(_0x34e37c,_0x281c05){_0x281c05=_0x281c05||0xc8;return function(_0x4c820b){if(_0x4c820b){return _0x34e37c[_0xd945('0x2b')](_0x281c05)['json'](_0x4c820b);}};}function respondWithFilteredResult(_0x43271a,_0x21a580){return function(_0x4067ce){if(_0x4067ce){var _0x5702e2=_0x4067ce[_0xd945('0x2d')],_0x1e867c=_0x21a580[_0xd945('0x2e')],_0x2db04e=_0x21a580[_0xd945('0x2e')]+_0x21a580[_0xd945('0x2f')],_0x359b7d;if(_0x2db04e>=_0x5702e2){_0x2db04e=_0x5702e2;_0x359b7d=0xc8;}else{_0x359b7d=0xce;}_0x43271a[_0xd945('0x2b')](_0x359b7d);return _0x43271a[_0xd945('0x30')](_0xd945('0x31'),_0x1e867c+'-'+_0x2db04e+'/'+_0x5702e2)[_0xd945('0x32')](_0x4067ce);}return null;};}function patchUpdates(_0x2e0fbf){return function(_0x2c4899){try{jsonpatch[_0xd945('0x33')](_0x2c4899,_0x2e0fbf,!![]);}catch(_0x5b0c6c){return BPromise[_0xd945('0x34')](_0x5b0c6c);}return _0x2c4899[_0xd945('0x35')]();};}function saveUpdates(_0x109b80,_0x1dfd25){return function(_0x256fbd){if(_0x256fbd){return _0x256fbd[_0xd945('0x36')](_0x109b80)['then'](function(_0x63f189){return _0x63f189;});}return null;};}function removeEntity(_0x195a79,_0x178292){return function(_0x316bd5){if(_0x316bd5){return _0x316bd5[_0xd945('0x37')]()[_0xd945('0x1f')](function(){_0x195a79[_0xd945('0x2b')](0xcc)[_0xd945('0x2c')]();});}};}function handleEntityNotFound(_0x4ac81d,_0x2f6ee5){return function(_0x219ac9){if(!_0x219ac9){_0x4ac81d[_0xd945('0x2a')](0x194);}return _0x219ac9;};}function handleError(_0x33d200,_0x2c96f2){_0x2c96f2=_0x2c96f2||0x1f4;return function(_0x8719b5){logger[_0xd945('0x25')](_0x8719b5['stack']);if(_0x8719b5[_0xd945('0x38')]){delete _0x8719b5[_0xd945('0x38')];}_0x33d200[_0xd945('0x2b')](_0x2c96f2)[_0xd945('0x39')](_0x8719b5);};}exports[_0xd945('0x3a')]=function(_0x450093,_0x21a1b5){var _0x18b8db={},_0x35e619={},_0x535dfa={'count':0x0,'rows':[]};var _0x254e68=db[_0xd945('0x3b')][_0xd945('0x3c')];_0x35e619[_0xd945('0x3d')]=_[_0xd945('0x3e')](_0x254e68);_0x35e619[_0xd945('0x3f')]=_[_0xd945('0x3e')](_0x450093[_0xd945('0x3f')]);_0x35e619[_0xd945('0x40')]=_['intersection'](_0x35e619[_0xd945('0x3d')],_0x35e619[_0xd945('0x3f')]);_0x18b8db[_0xd945('0x41')]=_[_0xd945('0x42')](_0x35e619[_0xd945('0x3d')],qs[_0xd945('0x43')](_0x450093['query']['fields']));_0x18b8db['attributes']=_0x18b8db[_0xd945('0x41')][_0xd945('0x44')]?_0x18b8db['attributes']:_0x35e619[_0xd945('0x3d')];if(!_0x450093[_0xd945('0x3f')][_0xd945('0x45')]('nolimit')){_0x18b8db['limit']=qs[_0xd945('0x2f')](_0x450093[_0xd945('0x3f')][_0xd945('0x2f')]);_0x18b8db[_0xd945('0x2e')]=qs['offset'](_0x450093['query'][_0xd945('0x2e')]);}_0x18b8db['order']=qs[_0xd945('0x46')](_0x450093['query'][_0xd945('0x46')]);_0x18b8db['where']=qs[_0xd945('0x40')](_[_0xd945('0x47')](_0x450093['query'],_0x35e619[_0xd945('0x40')]));if(_0x450093[_0xd945('0x3f')][_0xd945('0x48')]){_0x18b8db['where']=_['merge'](_0x18b8db[_0xd945('0x49')],{'$or':_['map'](_0x254e68,function(_0x5508bc){if(_0x5508bc[_0xd945('0x4a')][_0xd945('0x4b')]!==_0xd945('0x4c')){var _0x5042ea={};_0x5042ea[_0x5508bc[_0xd945('0x4d')]]={'$like':'%'+_0x450093[_0xd945('0x3f')][_0xd945('0x48')]+'%'};return _0x5042ea;}})});}_0x18b8db=_['merge']({},_0x18b8db,_0x450093[_0xd945('0x4e')]);var _0x4963bd={'where':_0x18b8db[_0xd945('0x49')]};return db[_0xd945('0x3b')][_0xd945('0x2d')](_0x4963bd)[_0xd945('0x1f')](function(_0x39bd47){_0x535dfa[_0xd945('0x2d')]=_0x39bd47;if(_0x450093[_0xd945('0x3f')]['includeAll']){_0x18b8db[_0xd945('0x4f')]=[{'all':!![]}];}return db[_0xd945('0x3b')][_0xd945('0x50')](_0x18b8db);})['then'](function(_0x479427){_0x535dfa[_0xd945('0x51')]=_0x479427;return _0x535dfa;})['then'](respondWithFilteredResult(_0x21a1b5,_0x18b8db))[_0xd945('0x29')](handleError(_0x21a1b5,null));};exports[_0xd945('0x52')]=function(_0x3e7d2f,_0x4ad71b){var _0x96c8e7={'raw':![],'where':{'id':_0x3e7d2f[_0xd945('0x53')]['id']}},_0x466647={};_0x466647['model']=_[_0xd945('0x3e')](db[_0xd945('0x3b')][_0xd945('0x3c')]);_0x466647['query']=_[_0xd945('0x3e')](_0x3e7d2f[_0xd945('0x3f')]);_0x466647[_0xd945('0x40')]=_['intersection'](_0x466647[_0xd945('0x3d')],_0x466647[_0xd945('0x3f')]);_0x96c8e7['attributes']=_[_0xd945('0x42')](_0x466647[_0xd945('0x3d')],qs[_0xd945('0x43')](_0x3e7d2f[_0xd945('0x3f')][_0xd945('0x43')]));_0x96c8e7[_0xd945('0x41')]=_0x96c8e7['attributes'][_0xd945('0x44')]?_0x96c8e7[_0xd945('0x41')]:_0x466647['model'];if(_0x3e7d2f['query']['includeAll']){_0x96c8e7[_0xd945('0x4f')]=[{'all':!![]}];}_0x96c8e7=_[_0xd945('0x54')]({},_0x96c8e7,_0x3e7d2f[_0xd945('0x4e')]);return db[_0xd945('0x3b')][_0xd945('0x55')](_0x96c8e7)[_0xd945('0x1f')](handleEntityNotFound(_0x4ad71b,null))[_0xd945('0x1f')](respondWithResult(_0x4ad71b,null))[_0xd945('0x29')](handleError(_0x4ad71b,null));};exports[_0xd945('0x56')]=function(_0x5c97f6,_0x4a6af1){return db[_0xd945('0x3b')]['create'](_0x5c97f6[_0xd945('0x57')],{})[_0xd945('0x1f')](respondWithResult(_0x4a6af1,0xc9))[_0xd945('0x29')](handleError(_0x4a6af1,null));};exports[_0xd945('0x36')]=function(_0x4f274a,_0x294c24){if(_0x4f274a[_0xd945('0x57')]['id']){delete _0x4f274a[_0xd945('0x57')]['id'];}return db[_0xd945('0x3b')][_0xd945('0x55')]({'where':{'id':_0x4f274a[_0xd945('0x53')]['id']}})[_0xd945('0x1f')](handleEntityNotFound(_0x294c24,null))[_0xd945('0x1f')](saveUpdates(_0x4f274a[_0xd945('0x57')],null))[_0xd945('0x1f')](respondWithResult(_0x294c24,null))['catch'](handleError(_0x294c24,null));};exports['destroy']=function(_0x2662cf,_0x3b3c26){return db[_0xd945('0x3b')]['find']({'where':{'id':_0x2662cf[_0xd945('0x53')]['id']}})[_0xd945('0x1f')](handleEntityNotFound(_0x3b3c26,null))['then'](removeEntity(_0x3b3c26,null))[_0xd945('0x29')](handleError(_0x3b3c26,null));};exports['getFields']=function(_0x44a2ff,_0x38d226,_0x4927b5){var _0x3f493f={};var _0x20790c={};var _0xed5477;var _0x1b1692;return db['Dynamics365Configuration'][_0xd945('0x58')]({'where':{'id':_0x44a2ff['params']['id']}})[_0xd945('0x1f')](handleEntityNotFound(_0x38d226,null))[_0xd945('0x1f')](function(_0x296de1){if(_0x296de1){_0xed5477=_0x296de1;_0x20790c[_0xd945('0x3d')]=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x20790c[_0xd945('0x3f')]=_['keys'](_0x44a2ff[_0xd945('0x3f')]);_0x20790c['filters']=_['intersection'](_0x20790c[_0xd945('0x3d')],_0x20790c[_0xd945('0x3f')]);_0x3f493f[_0xd945('0x41')]=_['intersection'](_0x20790c[_0xd945('0x3d')],qs['fields'](_0x44a2ff[_0xd945('0x3f')][_0xd945('0x43')]));_0x3f493f[_0xd945('0x41')]=_0x3f493f['attributes'][_0xd945('0x44')]?_0x3f493f[_0xd945('0x41')]:_0x20790c[_0xd945('0x3d')];_0x3f493f[_0xd945('0x59')]=qs[_0xd945('0x46')](_0x44a2ff[_0xd945('0x3f')][_0xd945('0x46')]);_0x3f493f['where']=qs['filters'](_[_0xd945('0x47')](_0x44a2ff[_0xd945('0x3f')],_0x20790c[_0xd945('0x40')]));if(_0x44a2ff[_0xd945('0x3f')][_0xd945('0x48')]){_0x3f493f['where']=_[_0xd945('0x54')](_0x3f493f[_0xd945('0x49')],{'$or':_[_0xd945('0x5a')](_0x3f493f[_0xd945('0x41')],function(_0x40d2d3){var _0x3447cd={};_0x3447cd[_0x40d2d3]={'$like':'%'+_0x44a2ff[_0xd945('0x3f')]['filter']+'%'};return _0x3447cd;})});}_0x3f493f=_[_0xd945('0x54')]({},_0x3f493f,_0x44a2ff[_0xd945('0x4e')]);return _0xed5477[_0xd945('0x5b')](_0x3f493f);}})[_0xd945('0x1f')](function(_0x35c265){if(_0x35c265){_0x1b1692=_0x35c265[_0xd945('0x44')];if(!_0x44a2ff['query'][_0xd945('0x45')](_0xd945('0x5c'))){_0x3f493f[_0xd945('0x2f')]=qs[_0xd945('0x2f')](_0x44a2ff[_0xd945('0x3f')][_0xd945('0x2f')]);_0x3f493f[_0xd945('0x2e')]=qs['offset'](_0x44a2ff['query'][_0xd945('0x2e')]);}return _0xed5477[_0xd945('0x5b')](_0x3f493f);}})['then'](function(_0x3fb565){if(_0x3fb565){return _0x3fb565?{'count':_0x1b1692,'rows':_0x3fb565}:null;}})[_0xd945('0x1f')](respondWithResult(_0x38d226,null))['catch'](handleError(_0x38d226,null));};exports[_0xd945('0x5d')]=function(_0xe4c3c4,_0x45e49b,_0xa2cec0){var _0x51d6d4={};var _0x5e5e98={};var _0x3a2308;var _0x4263c5;return db[_0xd945('0x3b')][_0xd945('0x58')]({'where':{'id':_0xe4c3c4[_0xd945('0x53')]['id']}})[_0xd945('0x1f')](handleEntityNotFound(_0x45e49b,null))['then'](function(_0x3ed16e){if(_0x3ed16e){_0x3a2308=_0x3ed16e;_0x5e5e98[_0xd945('0x3d')]=_['keys'](db[_0xd945('0x5e')][_0xd945('0x3c')]);_0x5e5e98[_0xd945('0x3f')]=_['keys'](_0xe4c3c4[_0xd945('0x3f')]);_0x5e5e98[_0xd945('0x40')]=_[_0xd945('0x42')](_0x5e5e98['model'],_0x5e5e98[_0xd945('0x3f')]);_0x51d6d4[_0xd945('0x41')]=_[_0xd945('0x42')](_0x5e5e98[_0xd945('0x3d')],qs['fields'](_0xe4c3c4['query'][_0xd945('0x43')]));_0x51d6d4[_0xd945('0x41')]=_0x51d6d4[_0xd945('0x41')][_0xd945('0x44')]?_0x51d6d4[_0xd945('0x41')]:_0x5e5e98['model'];_0x51d6d4[_0xd945('0x59')]=qs[_0xd945('0x46')](_0xe4c3c4[_0xd945('0x3f')]['sort']);_0x51d6d4[_0xd945('0x49')]=qs['filters'](_[_0xd945('0x47')](_0xe4c3c4[_0xd945('0x3f')],_0x5e5e98['filters']));if(_0xe4c3c4['query'][_0xd945('0x48')]){_0x51d6d4[_0xd945('0x49')]=_[_0xd945('0x54')](_0x51d6d4['where'],{'$or':_['map'](_0x51d6d4[_0xd945('0x41')],function(_0xcb5c63){var _0x19e0b0={};_0x19e0b0[_0xcb5c63]={'$like':'%'+_0xe4c3c4['query'][_0xd945('0x48')]+'%'};return _0x19e0b0;})});}_0x51d6d4=_[_0xd945('0x54')]({},_0x51d6d4,_0xe4c3c4[_0xd945('0x4e')]);return _0x3a2308[_0xd945('0x5d')](_0x51d6d4);}})[_0xd945('0x1f')](function(_0x1fad7b){if(_0x1fad7b){_0x4263c5=_0x1fad7b[_0xd945('0x44')];if(!_0xe4c3c4[_0xd945('0x3f')][_0xd945('0x45')](_0xd945('0x5c'))){_0x51d6d4['limit']=qs[_0xd945('0x2f')](_0xe4c3c4[_0xd945('0x3f')][_0xd945('0x2f')]);_0x51d6d4[_0xd945('0x2e')]=qs['offset'](_0xe4c3c4[_0xd945('0x3f')][_0xd945('0x2e')]);}return _0x3a2308[_0xd945('0x5d')](_0x51d6d4);}})[_0xd945('0x1f')](function(_0x10879e){if(_0x10879e){return _0x10879e?{'count':_0x4263c5,'rows':_0x10879e}:null;}})[_0xd945('0x1f')](respondWithResult(_0x45e49b,null))['catch'](handleError(_0x45e49b,null));};exports[_0xd945('0x5f')]=function(_0x5be3e7,_0x80c9ca,_0x467ec1){var _0x5ebbcd={};var _0x11974b={};var _0x350c92;var _0x389bd3;return db[_0xd945('0x3b')][_0xd945('0x58')]({'where':{'id':_0x5be3e7['params']['id']}})[_0xd945('0x1f')](handleEntityNotFound(_0x80c9ca,null))['then'](function(_0x46802f){if(_0x46802f){_0x350c92=_0x46802f;_0x11974b['model']=_[_0xd945('0x3e')](db[_0xd945('0x5e')][_0xd945('0x3c')]);_0x11974b[_0xd945('0x3f')]=_[_0xd945('0x3e')](_0x5be3e7[_0xd945('0x3f')]);_0x11974b[_0xd945('0x40')]=_[_0xd945('0x42')](_0x11974b[_0xd945('0x3d')],_0x11974b['query']);_0x5ebbcd[_0xd945('0x41')]=_[_0xd945('0x42')](_0x11974b[_0xd945('0x3d')],qs[_0xd945('0x43')](_0x5be3e7[_0xd945('0x3f')][_0xd945('0x43')]));_0x5ebbcd['attributes']=_0x5ebbcd[_0xd945('0x41')][_0xd945('0x44')]?_0x5ebbcd[_0xd945('0x41')]:_0x11974b[_0xd945('0x3d')];_0x5ebbcd[_0xd945('0x59')]=qs[_0xd945('0x46')](_0x5be3e7['query'][_0xd945('0x46')]);_0x5ebbcd[_0xd945('0x49')]=qs[_0xd945('0x40')](_[_0xd945('0x47')](_0x5be3e7[_0xd945('0x3f')],_0x11974b[_0xd945('0x40')]));if(_0x5be3e7['query'][_0xd945('0x48')]){_0x5ebbcd[_0xd945('0x49')]=_[_0xd945('0x54')](_0x5ebbcd[_0xd945('0x49')],{'$or':_[_0xd945('0x5a')](_0x5ebbcd[_0xd945('0x41')],function(_0x4d8929){var _0x4be4a9={};_0x4be4a9[_0x4d8929]={'$like':'%'+_0x5be3e7[_0xd945('0x3f')][_0xd945('0x48')]+'%'};return _0x4be4a9;})});}_0x5ebbcd=_['merge']({},_0x5ebbcd,_0x5be3e7['options']);return _0x350c92[_0xd945('0x5f')](_0x5ebbcd);}})['then'](function(_0x2559a3){if(_0x2559a3){_0x389bd3=_0x2559a3['length'];if(!_0x5be3e7[_0xd945('0x3f')]['hasOwnProperty'](_0xd945('0x5c'))){_0x5ebbcd[_0xd945('0x2f')]=qs[_0xd945('0x2f')](_0x5be3e7[_0xd945('0x3f')][_0xd945('0x2f')]);_0x5ebbcd[_0xd945('0x2e')]=qs[_0xd945('0x2e')](_0x5be3e7[_0xd945('0x3f')]['offset']);}return _0x350c92[_0xd945('0x5f')](_0x5ebbcd);}})[_0xd945('0x1f')](function(_0x575e13){if(_0x575e13){return _0x575e13?{'count':_0x389bd3,'rows':_0x575e13}:null;}})[_0xd945('0x1f')](respondWithResult(_0x80c9ca,null))['catch'](handleError(_0x80c9ca,null));}; \ No newline at end of file +var _0xd201=['length','hasOwnProperty','offset','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','catch','show','params','rawAttributes','find','create','body','update','getFields','Dynamics365Field','getSubjects','findOne','nolimit','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../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','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','end','status','json','count','limit','set','apply','reject','save','then','destroy','sendStatus','stack','name','send','index','Dynamics365Configuration','keys','query','filters','intersection','model','attributes','fields'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0xd201,0x139));var _0x1d20=function(_0x1f3890,_0x2f9aad){_0x1f3890=_0x1f3890-0x0;var _0x4af351=_0xd201[_0x1f3890];return _0x4af351;};'use strict';var pdf=require(_0x1d20('0x0'));var emlformat=require(_0x1d20('0x1'));var rimraf=require(_0x1d20('0x2'));var zipdir=require(_0x1d20('0x3'));var jsonpatch=require(_0x1d20('0x4'));var rp=require('request-promise');var moment=require(_0x1d20('0x5'));var BPromise=require(_0x1d20('0x6'));var Mustache=require(_0x1d20('0x7'));var util=require(_0x1d20('0x8'));var path=require(_0x1d20('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1d20('0xa'));var fs=require('fs');var _=require(_0x1d20('0xb'));var squel=require(_0x1d20('0xc'));var crypto=require(_0x1d20('0xd'));var jsforce=require(_0x1d20('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1d20('0xf'));var Papa=require(_0x1d20('0x10'));var Redis=require('ioredis');var authService=require(_0x1d20('0x11'));var qs=require(_0x1d20('0x12'));var hardwareService=require(_0x1d20('0x13'));var logger=require(_0x1d20('0x14'))(_0x1d20('0x15'));var utils=require(_0x1d20('0x16'));var config=require(_0x1d20('0x17'));var db=require(_0x1d20('0x18'))['db'];var jayson=require(_0x1d20('0x19'));var client=jayson['client'][_0x1d20('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x21580e,_0x3f6870,_0x6f0639){if(_0x6f0639){var _0x41431e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x41431e[_0x1d20('0x1b')](_0x3f6870)){return _0x21580e;}else{throw new Error(_0x1d20('0x1c'));}}else{return _0x21580e;}}function respondWithRpcPromise(_0x50158a,_0x547889,_0x5e74d6,_0x26fc96){return new BPromise(function(_0x2d0ae1,_0x5a3790){var _0x5ed656=_0x26fc96||client;return _0x5ed656[_0x1d20('0x1d')](_0x50158a,_0x5e74d6)['then'](function(_0x64b3c7){logger[_0x1d20('0x1e')](_0x1d20('0x1f'),_0x547889,_0x1d20('0x20'));logger[_0x1d20('0x21')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x547889,_0x1d20('0x20'),JSON[_0x1d20('0x22')](_0x64b3c7));if(_0x64b3c7['error']){if(_0x64b3c7[_0x1d20('0x23')][_0x1d20('0x24')]===0x1f4){logger[_0x1d20('0x23')](_0x1d20('0x1f'),_0x547889,_0x64b3c7['error'][_0x1d20('0x25')]);return _0x5a3790(_0x64b3c7['error'][_0x1d20('0x25')]);}logger[_0x1d20('0x23')](_0x1d20('0x1f'),_0x547889,_0x64b3c7[_0x1d20('0x23')][_0x1d20('0x25')]);return _0x2d0ae1(_0x64b3c7['error'][_0x1d20('0x25')]);}else{logger['info'](_0x1d20('0x1f'),_0x547889,_0x1d20('0x20'));_0x2d0ae1(_0x64b3c7[_0x1d20('0x26')][_0x1d20('0x25')]);}})['catch'](function(_0x59790e){logger[_0x1d20('0x23')](_0x1d20('0x1f'),_0x547889,_0x59790e);_0x5a3790(_0x59790e);});});}function respondWithStatusCode(_0x290f1f,_0x109292){_0x109292=_0x109292||0xcc;return function(_0x2269fa){if(_0x2269fa){return _0x290f1f['sendStatus'](_0x109292);}return _0x290f1f['status'](_0x109292)[_0x1d20('0x27')]();};}function respondWithResult(_0x2db36e,_0x57a703){_0x57a703=_0x57a703||0xc8;return function(_0x32aaf0){if(_0x32aaf0){return _0x2db36e[_0x1d20('0x28')](_0x57a703)[_0x1d20('0x29')](_0x32aaf0);}};}function respondWithFilteredResult(_0x278402,_0x53f5c2){return function(_0x50ad9c){if(_0x50ad9c){var _0x4487fd=_0x50ad9c[_0x1d20('0x2a')],_0x12de4f=_0x53f5c2['offset'],_0x112aee=_0x53f5c2['offset']+_0x53f5c2[_0x1d20('0x2b')],_0x46bccd;if(_0x112aee>=_0x4487fd){_0x112aee=_0x4487fd;_0x46bccd=0xc8;}else{_0x46bccd=0xce;}_0x278402[_0x1d20('0x28')](_0x46bccd);return _0x278402[_0x1d20('0x2c')]('Content-Range',_0x12de4f+'-'+_0x112aee+'/'+_0x4487fd)['json'](_0x50ad9c);}return null;};}function patchUpdates(_0x920fe){return function(_0x437a04){try{jsonpatch[_0x1d20('0x2d')](_0x437a04,_0x920fe,!![]);}catch(_0x3081ef){return BPromise[_0x1d20('0x2e')](_0x3081ef);}return _0x437a04[_0x1d20('0x2f')]();};}function saveUpdates(_0x3dbad1,_0x423991){return function(_0x5c84b6){if(_0x5c84b6){return _0x5c84b6['update'](_0x3dbad1)[_0x1d20('0x30')](function(_0x3d3b4e){return _0x3d3b4e;});}return null;};}function removeEntity(_0x2dac8c,_0x4123e3){return function(_0x183e63){if(_0x183e63){return _0x183e63[_0x1d20('0x31')]()[_0x1d20('0x30')](function(){_0x2dac8c[_0x1d20('0x28')](0xcc)[_0x1d20('0x27')]();});}};}function handleEntityNotFound(_0x2f2af9,_0x4a4c32){return function(_0x1e0f65){if(!_0x1e0f65){_0x2f2af9[_0x1d20('0x32')](0x194);}return _0x1e0f65;};}function handleError(_0x300712,_0x1eee2b){_0x1eee2b=_0x1eee2b||0x1f4;return function(_0x51e4e1){logger[_0x1d20('0x23')](_0x51e4e1[_0x1d20('0x33')]);if(_0x51e4e1[_0x1d20('0x34')]){delete _0x51e4e1[_0x1d20('0x34')];}_0x300712[_0x1d20('0x28')](_0x1eee2b)[_0x1d20('0x35')](_0x51e4e1);};}exports[_0x1d20('0x36')]=function(_0x3f2f92,_0x28139c){var _0x5c1e19={},_0x51b03d={},_0x572abb={'count':0x0,'rows':[]};var _0x4c4851=db[_0x1d20('0x37')]['rawAttributes'];_0x51b03d['model']=_[_0x1d20('0x38')](_0x4c4851);_0x51b03d[_0x1d20('0x39')]=_[_0x1d20('0x38')](_0x3f2f92['query']);_0x51b03d[_0x1d20('0x3a')]=_[_0x1d20('0x3b')](_0x51b03d[_0x1d20('0x3c')],_0x51b03d[_0x1d20('0x39')]);_0x5c1e19[_0x1d20('0x3d')]=_[_0x1d20('0x3b')](_0x51b03d[_0x1d20('0x3c')],qs[_0x1d20('0x3e')](_0x3f2f92['query'][_0x1d20('0x3e')]));_0x5c1e19[_0x1d20('0x3d')]=_0x5c1e19['attributes'][_0x1d20('0x3f')]?_0x5c1e19[_0x1d20('0x3d')]:_0x51b03d['model'];if(!_0x3f2f92[_0x1d20('0x39')][_0x1d20('0x40')]('nolimit')){_0x5c1e19[_0x1d20('0x2b')]=qs[_0x1d20('0x2b')](_0x3f2f92['query'][_0x1d20('0x2b')]);_0x5c1e19[_0x1d20('0x41')]=qs['offset'](_0x3f2f92[_0x1d20('0x39')][_0x1d20('0x41')]);}_0x5c1e19[_0x1d20('0x42')]=qs[_0x1d20('0x43')](_0x3f2f92[_0x1d20('0x39')][_0x1d20('0x43')]);_0x5c1e19[_0x1d20('0x44')]=qs[_0x1d20('0x3a')](_[_0x1d20('0x45')](_0x3f2f92[_0x1d20('0x39')],_0x51b03d[_0x1d20('0x3a')]));if(_0x3f2f92[_0x1d20('0x39')][_0x1d20('0x46')]){_0x5c1e19[_0x1d20('0x44')]=_[_0x1d20('0x47')](_0x5c1e19[_0x1d20('0x44')],{'$or':_[_0x1d20('0x48')](_0x4c4851,function(_0x4a4794){if(_0x4a4794[_0x1d20('0x49')][_0x1d20('0x4a')]!==_0x1d20('0x4b')){var _0x25caed={};_0x25caed[_0x4a4794[_0x1d20('0x4c')]]={'$like':'%'+_0x3f2f92[_0x1d20('0x39')]['filter']+'%'};return _0x25caed;}})});}_0x5c1e19=_[_0x1d20('0x47')]({},_0x5c1e19,_0x3f2f92[_0x1d20('0x4d')]);var _0x3f915c={'where':_0x5c1e19['where']};return db[_0x1d20('0x37')][_0x1d20('0x2a')](_0x3f915c)[_0x1d20('0x30')](function(_0xfa6d9b){_0x572abb[_0x1d20('0x2a')]=_0xfa6d9b;if(_0x3f2f92[_0x1d20('0x39')][_0x1d20('0x4e')]){_0x5c1e19[_0x1d20('0x4f')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x5c1e19);})['then'](function(_0x33c1fa){_0x572abb['rows']=_0x33c1fa;return _0x572abb;})[_0x1d20('0x30')](respondWithFilteredResult(_0x28139c,_0x5c1e19))[_0x1d20('0x50')](handleError(_0x28139c,null));};exports[_0x1d20('0x51')]=function(_0x168480,_0x351a21){var _0x1f5f57={'raw':![],'where':{'id':_0x168480[_0x1d20('0x52')]['id']}},_0x5eb41f={};_0x5eb41f['model']=_[_0x1d20('0x38')](db[_0x1d20('0x37')][_0x1d20('0x53')]);_0x5eb41f['query']=_['keys'](_0x168480[_0x1d20('0x39')]);_0x5eb41f[_0x1d20('0x3a')]=_[_0x1d20('0x3b')](_0x5eb41f[_0x1d20('0x3c')],_0x5eb41f['query']);_0x1f5f57[_0x1d20('0x3d')]=_[_0x1d20('0x3b')](_0x5eb41f[_0x1d20('0x3c')],qs[_0x1d20('0x3e')](_0x168480[_0x1d20('0x39')][_0x1d20('0x3e')]));_0x1f5f57[_0x1d20('0x3d')]=_0x1f5f57[_0x1d20('0x3d')][_0x1d20('0x3f')]?_0x1f5f57[_0x1d20('0x3d')]:_0x5eb41f[_0x1d20('0x3c')];if(_0x168480[_0x1d20('0x39')][_0x1d20('0x4e')]){_0x1f5f57[_0x1d20('0x4f')]=[{'all':!![]}];}_0x1f5f57=_['merge']({},_0x1f5f57,_0x168480[_0x1d20('0x4d')]);return db[_0x1d20('0x37')][_0x1d20('0x54')](_0x1f5f57)[_0x1d20('0x30')](handleEntityNotFound(_0x351a21,null))[_0x1d20('0x30')](respondWithResult(_0x351a21,null))[_0x1d20('0x50')](handleError(_0x351a21,null));};exports[_0x1d20('0x55')]=function(_0x390310,_0x51d46a){return db[_0x1d20('0x37')][_0x1d20('0x55')](_0x390310[_0x1d20('0x56')],{})[_0x1d20('0x30')](respondWithResult(_0x51d46a,0xc9))[_0x1d20('0x50')](handleError(_0x51d46a,null));};exports[_0x1d20('0x57')]=function(_0x146773,_0x368cf6){if(_0x146773['body']['id']){delete _0x146773[_0x1d20('0x56')]['id'];}return db['Dynamics365Configuration'][_0x1d20('0x54')]({'where':{'id':_0x146773['params']['id']}})[_0x1d20('0x30')](handleEntityNotFound(_0x368cf6,null))[_0x1d20('0x30')](saveUpdates(_0x146773['body'],null))[_0x1d20('0x30')](respondWithResult(_0x368cf6,null))['catch'](handleError(_0x368cf6,null));};exports[_0x1d20('0x31')]=function(_0x22fcbd,_0x55c4b7){return db[_0x1d20('0x37')][_0x1d20('0x54')]({'where':{'id':_0x22fcbd[_0x1d20('0x52')]['id']}})[_0x1d20('0x30')](handleEntityNotFound(_0x55c4b7,null))[_0x1d20('0x30')](removeEntity(_0x55c4b7,null))[_0x1d20('0x50')](handleError(_0x55c4b7,null));};exports[_0x1d20('0x58')]=function(_0x1aeb51,_0x1a9a0a,_0x2e7068){var _0x41d4c3={};var _0x366475={};var _0x158598;var _0x4d9897;return db[_0x1d20('0x37')]['findOne']({'where':{'id':_0x1aeb51[_0x1d20('0x52')]['id']}})[_0x1d20('0x30')](handleEntityNotFound(_0x1a9a0a,null))[_0x1d20('0x30')](function(_0x543f82){if(_0x543f82){_0x158598=_0x543f82;_0x366475['model']=_[_0x1d20('0x38')](db[_0x1d20('0x59')]['rawAttributes']);_0x366475[_0x1d20('0x39')]=_['keys'](_0x1aeb51[_0x1d20('0x39')]);_0x366475[_0x1d20('0x3a')]=_[_0x1d20('0x3b')](_0x366475['model'],_0x366475[_0x1d20('0x39')]);_0x41d4c3[_0x1d20('0x3d')]=_[_0x1d20('0x3b')](_0x366475[_0x1d20('0x3c')],qs[_0x1d20('0x3e')](_0x1aeb51['query']['fields']));_0x41d4c3[_0x1d20('0x3d')]=_0x41d4c3[_0x1d20('0x3d')][_0x1d20('0x3f')]?_0x41d4c3[_0x1d20('0x3d')]:_0x366475['model'];_0x41d4c3[_0x1d20('0x42')]=qs['sort'](_0x1aeb51[_0x1d20('0x39')][_0x1d20('0x43')]);_0x41d4c3[_0x1d20('0x44')]=qs['filters'](_[_0x1d20('0x45')](_0x1aeb51[_0x1d20('0x39')],_0x366475[_0x1d20('0x3a')]));if(_0x1aeb51[_0x1d20('0x39')]['filter']){_0x41d4c3['where']=_[_0x1d20('0x47')](_0x41d4c3[_0x1d20('0x44')],{'$or':_[_0x1d20('0x48')](_0x41d4c3[_0x1d20('0x3d')],function(_0x3443f1){var _0x468d54={};_0x468d54[_0x3443f1]={'$like':'%'+_0x1aeb51['query'][_0x1d20('0x46')]+'%'};return _0x468d54;})});}_0x41d4c3=_['merge']({},_0x41d4c3,_0x1aeb51[_0x1d20('0x4d')]);return _0x158598[_0x1d20('0x58')](_0x41d4c3);}})[_0x1d20('0x30')](function(_0x322658){if(_0x322658){_0x4d9897=_0x322658[_0x1d20('0x3f')];if(!_0x1aeb51['query'][_0x1d20('0x40')]('nolimit')){_0x41d4c3[_0x1d20('0x2b')]=qs[_0x1d20('0x2b')](_0x1aeb51[_0x1d20('0x39')][_0x1d20('0x2b')]);_0x41d4c3[_0x1d20('0x41')]=qs[_0x1d20('0x41')](_0x1aeb51[_0x1d20('0x39')][_0x1d20('0x41')]);}return _0x158598[_0x1d20('0x58')](_0x41d4c3);}})[_0x1d20('0x30')](function(_0x5e288b){if(_0x5e288b){return _0x5e288b?{'count':_0x4d9897,'rows':_0x5e288b}:null;}})[_0x1d20('0x30')](respondWithResult(_0x1a9a0a,null))[_0x1d20('0x50')](handleError(_0x1a9a0a,null));};exports[_0x1d20('0x5a')]=function(_0x529c27,_0x41bb1f,_0x37b755){var _0x334427={};var _0xde75d8={};var _0xb2043e;var _0x208ebe;return db[_0x1d20('0x37')][_0x1d20('0x5b')]({'where':{'id':_0x529c27[_0x1d20('0x52')]['id']}})[_0x1d20('0x30')](handleEntityNotFound(_0x41bb1f,null))[_0x1d20('0x30')](function(_0xc84bed){if(_0xc84bed){_0xb2043e=_0xc84bed;_0xde75d8[_0x1d20('0x3c')]=_[_0x1d20('0x38')](db[_0x1d20('0x59')][_0x1d20('0x53')]);_0xde75d8[_0x1d20('0x39')]=_['keys'](_0x529c27[_0x1d20('0x39')]);_0xde75d8['filters']=_[_0x1d20('0x3b')](_0xde75d8[_0x1d20('0x3c')],_0xde75d8[_0x1d20('0x39')]);_0x334427[_0x1d20('0x3d')]=_[_0x1d20('0x3b')](_0xde75d8[_0x1d20('0x3c')],qs[_0x1d20('0x3e')](_0x529c27['query']['fields']));_0x334427[_0x1d20('0x3d')]=_0x334427[_0x1d20('0x3d')][_0x1d20('0x3f')]?_0x334427[_0x1d20('0x3d')]:_0xde75d8[_0x1d20('0x3c')];_0x334427['order']=qs['sort'](_0x529c27[_0x1d20('0x39')][_0x1d20('0x43')]);_0x334427['where']=qs[_0x1d20('0x3a')](_[_0x1d20('0x45')](_0x529c27[_0x1d20('0x39')],_0xde75d8[_0x1d20('0x3a')]));if(_0x529c27[_0x1d20('0x39')]['filter']){_0x334427[_0x1d20('0x44')]=_['merge'](_0x334427[_0x1d20('0x44')],{'$or':_[_0x1d20('0x48')](_0x334427[_0x1d20('0x3d')],function(_0x3f178d){var _0x3caccd={};_0x3caccd[_0x3f178d]={'$like':'%'+_0x529c27['query'][_0x1d20('0x46')]+'%'};return _0x3caccd;})});}_0x334427=_[_0x1d20('0x47')]({},_0x334427,_0x529c27['options']);return _0xb2043e[_0x1d20('0x5a')](_0x334427);}})[_0x1d20('0x30')](function(_0x4307db){if(_0x4307db){_0x208ebe=_0x4307db[_0x1d20('0x3f')];if(!_0x529c27[_0x1d20('0x39')][_0x1d20('0x40')](_0x1d20('0x5c'))){_0x334427[_0x1d20('0x2b')]=qs[_0x1d20('0x2b')](_0x529c27[_0x1d20('0x39')]['limit']);_0x334427[_0x1d20('0x41')]=qs['offset'](_0x529c27[_0x1d20('0x39')]['offset']);}return _0xb2043e[_0x1d20('0x5a')](_0x334427);}})[_0x1d20('0x30')](function(_0x429cdc){if(_0x429cdc){return _0x429cdc?{'count':_0x208ebe,'rows':_0x429cdc}:null;}})[_0x1d20('0x30')](respondWithResult(_0x41bb1f,null))[_0x1d20('0x50')](handleError(_0x41bb1f,null));};exports['getDescriptions']=function(_0x1ddd95,_0x1b7bdd,_0x13dc59){var _0x307be6={};var _0x2ab04b={};var _0x185750;var _0xc6fdbb;return db[_0x1d20('0x37')][_0x1d20('0x5b')]({'where':{'id':_0x1ddd95[_0x1d20('0x52')]['id']}})['then'](handleEntityNotFound(_0x1b7bdd,null))[_0x1d20('0x30')](function(_0x2a8459){if(_0x2a8459){_0x185750=_0x2a8459;_0x2ab04b[_0x1d20('0x3c')]=_['keys'](db[_0x1d20('0x59')][_0x1d20('0x53')]);_0x2ab04b[_0x1d20('0x39')]=_['keys'](_0x1ddd95[_0x1d20('0x39')]);_0x2ab04b[_0x1d20('0x3a')]=_[_0x1d20('0x3b')](_0x2ab04b[_0x1d20('0x3c')],_0x2ab04b['query']);_0x307be6[_0x1d20('0x3d')]=_['intersection'](_0x2ab04b[_0x1d20('0x3c')],qs['fields'](_0x1ddd95[_0x1d20('0x39')][_0x1d20('0x3e')]));_0x307be6[_0x1d20('0x3d')]=_0x307be6[_0x1d20('0x3d')][_0x1d20('0x3f')]?_0x307be6[_0x1d20('0x3d')]:_0x2ab04b[_0x1d20('0x3c')];_0x307be6[_0x1d20('0x42')]=qs[_0x1d20('0x43')](_0x1ddd95[_0x1d20('0x39')]['sort']);_0x307be6[_0x1d20('0x44')]=qs[_0x1d20('0x3a')](_['pick'](_0x1ddd95['query'],_0x2ab04b[_0x1d20('0x3a')]));if(_0x1ddd95[_0x1d20('0x39')][_0x1d20('0x46')]){_0x307be6[_0x1d20('0x44')]=_[_0x1d20('0x47')](_0x307be6[_0x1d20('0x44')],{'$or':_[_0x1d20('0x48')](_0x307be6[_0x1d20('0x3d')],function(_0x35f0bd){var _0x273599={};_0x273599[_0x35f0bd]={'$like':'%'+_0x1ddd95['query'][_0x1d20('0x46')]+'%'};return _0x273599;})});}_0x307be6=_[_0x1d20('0x47')]({},_0x307be6,_0x1ddd95[_0x1d20('0x4d')]);return _0x185750[_0x1d20('0x5d')](_0x307be6);}})[_0x1d20('0x30')](function(_0x30db0d){if(_0x30db0d){_0xc6fdbb=_0x30db0d['length'];if(!_0x1ddd95[_0x1d20('0x39')]['hasOwnProperty'](_0x1d20('0x5c'))){_0x307be6[_0x1d20('0x2b')]=qs[_0x1d20('0x2b')](_0x1ddd95[_0x1d20('0x39')][_0x1d20('0x2b')]);_0x307be6[_0x1d20('0x41')]=qs['offset'](_0x1ddd95[_0x1d20('0x39')][_0x1d20('0x41')]);}return _0x185750['getDescriptions'](_0x307be6);}})[_0x1d20('0x30')](function(_0x3b81af){if(_0x3b81af){return _0x3b81af?{'count':_0xc6fdbb,'rows':_0x3b81af}:null;}})[_0x1d20('0x30')](respondWithResult(_0x1b7bdd,null))[_0x1d20('0x50')](handleError(_0x1b7bdd,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 23668f1..5d72d84 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 _0x51bb=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util'];(function(_0x4b92b3,_0x54431e){var _0x1ac6f5=function(_0x1a3c00){while(--_0x1a3c00){_0x4b92b3['push'](_0x4b92b3['shift']());}};_0x1ac6f5(++_0x54431e);}(_0x51bb,0xe3));var _0xb51b=function(_0x40c083,_0x14a722){_0x40c083=_0x40c083-0x0;var _0x21a369=_0x51bb[_0x40c083];return _0x21a369;};'use strict';var _=require('lodash');var util=require(_0xb51b('0x0'));var logger=require(_0xb51b('0x1'))(_0xb51b('0x2'));var moment=require('moment');var BPromise=require(_0xb51b('0x3'));var rp=require(_0xb51b('0x4'));var fs=require('fs');var path=require(_0xb51b('0x5'));var rimraf=require('rimraf');var config=require(_0xb51b('0x6'));var attributes=require(_0xb51b('0x7'));module[_0xb51b('0x8')]=function(_0x1eb87e,_0x23a528){return _0x1eb87e[_0xb51b('0x9')](_0xb51b('0xa'),attributes,{'tableName':_0xb51b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e9d=['exports','define','int_dynamics365_configurations','lodash','util','../../config/logger','bluebird','path','../../config/environment'];(function(_0x302d0b,_0x2c7dbb){var _0x3b9e1d=function(_0x598beb){while(--_0x598beb){_0x302d0b['push'](_0x302d0b['shift']());}};_0x3b9e1d(++_0x2c7dbb);}(_0x0e9d,0x6f));var _0xd0e9=function(_0x347e98,_0x30161a){_0x347e98=_0x347e98-0x0;var _0x8b9ad6=_0x0e9d[_0x347e98];return _0x8b9ad6;};'use strict';var _=require(_0xd0e9('0x0'));var util=require(_0xd0e9('0x1'));var logger=require(_0xd0e9('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd0e9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd0e9('0x4'));var rimraf=require('rimraf');var config=require(_0xd0e9('0x5'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xd0e9('0x6')]=function(_0x172437,_0x5adbfb){return _0x172437[_0xd0e9('0x7')]('Dynamics365Configuration',attributes,{'tableName':_0xd0e9('0x8'),'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 28ab6fd..eb45abe 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 _0x99e8=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','ioredis','../../config/utils'];(function(_0x2c4658,_0x43d26a){var _0xfd3e5b=function(_0x5c8dc5){while(--_0x5c8dc5){_0x2c4658['push'](_0x2c4658['shift']());}};_0xfd3e5b(++_0x43d26a);}(_0x99e8,0xf3));var _0x899e=function(_0x320b0f,_0xed2d47){_0x320b0f=_0x320b0f-0x0;var _0x1915cc=_0x99e8[_0x320b0f];return _0x1915cc;};'use strict';var _=require(_0x899e('0x0'));var util=require(_0x899e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x899e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x899e('0x3'));var logger=require(_0x899e('0x4'))('rpc');var config=require(_0x899e('0x5'));var jayson=require(_0x899e('0x6'));var client=jayson[_0x899e('0x7')][_0x899e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7b9dd4,_0x2aa58c,_0x505a63){return new BPromise(function(_0x3dbef9,_0x3dfba7){return client[_0x899e('0x9')](_0x7b9dd4,_0x505a63)[_0x899e('0xa')](function(_0x299bbc){logger['info'](_0x899e('0xb'),_0x2aa58c,_0x899e('0xc'));logger[_0x899e('0xd')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x2aa58c,_0x899e('0xc'),JSON[_0x899e('0xe')](_0x299bbc));if(_0x299bbc[_0x899e('0xf')]){if(_0x299bbc['error'][_0x899e('0x10')]===0x1f4){logger[_0x899e('0xf')](_0x899e('0xb'),_0x2aa58c,_0x299bbc['error'][_0x899e('0x11')]);return _0x3dfba7(_0x299bbc[_0x899e('0xf')][_0x899e('0x11')]);}logger['error'](_0x899e('0xb'),_0x2aa58c,_0x299bbc[_0x899e('0xf')]['message']);return _0x3dbef9(_0x299bbc[_0x899e('0xf')]['message']);}else{logger['info'](_0x899e('0xb'),_0x2aa58c,_0x899e('0xc'));_0x3dbef9(_0x299bbc[_0x899e('0x12')][_0x899e('0x11')]);}})['catch'](function(_0x26194c){logger['error'](_0x899e('0xb'),_0x2aa58c,_0x26194c);_0x3dfba7(_0x26194c);});});} \ No newline at end of file +var _0xeec1=['util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xeec1,0x158));var _0x1eec=function(_0x382c64,_0x22d880){_0x382c64=_0x382c64-0x0;var _0x36591c=_0xeec1[_0x382c64];return _0x36591c;};'use strict';var _=require(_0x1eec('0x0'));var util=require(_0x1eec('0x1'));var moment=require(_0x1eec('0x2'));var BPromise=require(_0x1eec('0x3'));var rs=require(_0x1eec('0x4'));var fs=require('fs');var Redis=require(_0x1eec('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1eec('0x6'));var config=require(_0x1eec('0x7'));var jayson=require(_0x1eec('0x8'));var client=jayson['client'][_0x1eec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2178ec,_0x2435d3,_0x2bab53){return new BPromise(function(_0x223cd6,_0x2d9e8b){return client[_0x1eec('0xa')](_0x2178ec,_0x2bab53)[_0x1eec('0xb')](function(_0x521d31){logger[_0x1eec('0xc')](_0x1eec('0xd'),_0x2435d3,'request\x20sent');logger[_0x1eec('0xe')](_0x1eec('0xf'),_0x2435d3,_0x1eec('0x10'),JSON[_0x1eec('0x11')](_0x521d31));if(_0x521d31[_0x1eec('0x12')]){if(_0x521d31['error'][_0x1eec('0x13')]===0x1f4){logger[_0x1eec('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2435d3,_0x521d31['error'][_0x1eec('0x14')]);return _0x2d9e8b(_0x521d31[_0x1eec('0x12')]['message']);}logger['error'](_0x1eec('0xd'),_0x2435d3,_0x521d31[_0x1eec('0x12')][_0x1eec('0x14')]);return _0x223cd6(_0x521d31[_0x1eec('0x12')][_0x1eec('0x14')]);}else{logger[_0x1eec('0xc')](_0x1eec('0xd'),_0x2435d3,_0x1eec('0x10'));_0x223cd6(_0x521d31[_0x1eec('0x15')][_0x1eec('0x14')]);}})[_0x1eec('0x16')](function(_0x4bf955){logger[_0x1eec('0x12')](_0x1eec('0xd'),_0x2435d3,_0x4bf955);_0x2d9e8b(_0x4bf955);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 1beb909..18c12fb 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 _0x6a99=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','post','create','put','destroy','exports','util'];(function(_0x2c481d,_0x407fb3){var _0x59b8b9=function(_0xacba0d){while(--_0xacba0d){_0x2c481d['push'](_0x2c481d['shift']());}};_0x59b8b9(++_0x407fb3);}(_0x6a99,0x1db));var _0x96a9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6a99[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x96a9('0x0'));var path=require(_0x96a9('0x1'));var timeout=require(_0x96a9('0x2'));var express=require('express');var router=express[_0x96a9('0x3')]();var auth=require(_0x96a9('0x4'));var interaction=require(_0x96a9('0x5'));var config=require(_0x96a9('0x6'));var controller=require(_0x96a9('0x7'));router[_0x96a9('0x8')]('/',auth[_0x96a9('0x9')](),controller[_0x96a9('0xa')]);router[_0x96a9('0x8')](_0x96a9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x96a9('0xc')]('/',auth[_0x96a9('0x9')](),controller[_0x96a9('0xd')]);router[_0x96a9('0xe')](_0x96a9('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x96a9('0xb'),auth['isAuthenticated'](),controller[_0x96a9('0xf')]);module[_0x96a9('0x10')]=router; \ No newline at end of file +var _0x3e4d=['express','../../components/auth/service','../../config/environment','get','isAuthenticated','show','post','create','put','update','/:id','destroy','exports','multer','path','connect-timeout'];(function(_0x359498,_0x535bbb){var _0x327072=function(_0x235774){while(--_0x235774){_0x359498['push'](_0x359498['shift']());}};_0x327072(++_0x535bbb);}(_0x3e4d,0x16d));var _0xd3e4=function(_0x89d53e,_0x2ec2fd){_0x89d53e=_0x89d53e-0x0;var _0x455f6d=_0x3e4d[_0x89d53e];return _0x455f6d;};'use strict';var multer=require(_0xd3e4('0x0'));var util=require('util');var path=require(_0xd3e4('0x1'));var timeout=require(_0xd3e4('0x2'));var express=require(_0xd3e4('0x3'));var router=express['Router']();var auth=require(_0xd3e4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd3e4('0x5'));var controller=require('./intDynamics365Field.controller');router[_0xd3e4('0x6')]('/',auth[_0xd3e4('0x7')](),controller['index']);router[_0xd3e4('0x6')]('/:id',auth[_0xd3e4('0x7')](),controller[_0xd3e4('0x8')]);router[_0xd3e4('0x9')]('/',auth[_0xd3e4('0x7')](),controller[_0xd3e4('0xa')]);router[_0xd3e4('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xd3e4('0xc')]);router['delete'](_0xd3e4('0xd'),auth[_0xd3e4('0x7')](),controller[_0xd3e4('0xe')]);module[_0xd3e4('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index d036e6a..423f668 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 _0xee5b=['keyValue','STRING','variable','sequelize','ENUM','string','customVariable'];(function(_0x19cdfb,_0xf62e20){var _0x4f8bbb=function(_0x27b833){while(--_0x27b833){_0x19cdfb['push'](_0x19cdfb['shift']());}};_0x4f8bbb(++_0xf62e20);}(_0xee5b,0x1f4));var _0xbee5=function(_0x3426f6,_0x2396e6){_0x3426f6=_0x3426f6-0x0;var _0x220c90=_0xee5b[_0x3426f6];return _0x220c90;};'use strict';var Sequelize=require(_0xbee5('0x0'));module['exports']={'type':{'type':Sequelize[_0xbee5('0x1')](_0xbee5('0x2'),'variable',_0xbee5('0x3'),_0xbee5('0x4')),'defaultValue':_0xbee5('0x2')},'content':{'type':Sequelize[_0xbee5('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xbee5('0x2'),_0xbee5('0x6'),_0xbee5('0x3'))},'keyContent':{'type':Sequelize[_0xbee5('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x41bb=['exports','string','customVariable','keyValue','STRING','ENUM','variable','BOOLEAN','sequelize'];(function(_0x142be8,_0x3ccf0d){var _0x51c2a5=function(_0x5afbae){while(--_0x5afbae){_0x142be8['push'](_0x142be8['shift']());}};_0x51c2a5(++_0x3ccf0d);}(_0x41bb,0xc5));var _0xb41b=function(_0x8939d9,_0x517f30){_0x8939d9=_0x8939d9-0x0;var _0x523741=_0x41bb[_0x8939d9];return _0x523741;};'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/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index c93ba1d..2dfef16 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 _0xadb8=['limit','apply','reject','save','update','then','end','stack','name','send','index','Dynamics365Field','rawAttributes','keys','query','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','map','type','key','filter','options','includeAll','include','findAll','rows','catch','show','params','fields','merge','find','create','body','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset'];(function(_0x3539ea,_0x2f2043){var _0x15e9a8=function(_0x2e0685){while(--_0x2e0685){_0x3539ea['push'](_0x3539ea['shift']());}};_0x15e9a8(++_0x2f2043);}(_0xadb8,0x1d0));var _0x8adb=function(_0x400b6c,_0x4a6139){_0x400b6c=_0x400b6c-0x0;var _0x4c4e3e=_0xadb8[_0x400b6c];return _0x4c4e3e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x8adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8adb('0x1'));var rp=require(_0x8adb('0x2'));var moment=require(_0x8adb('0x3'));var BPromise=require(_0x8adb('0x4'));var Mustache=require(_0x8adb('0x5'));var util=require(_0x8adb('0x6'));var path=require(_0x8adb('0x7'));var sox=require('sox');var csv=require(_0x8adb('0x8'));var ejs=require(_0x8adb('0x9'));var fs=require('fs');var _=require(_0x8adb('0xa'));var squel=require(_0x8adb('0xb'));var crypto=require(_0x8adb('0xc'));var jsforce=require(_0x8adb('0xd'));var deskjs=require(_0x8adb('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8adb('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8adb('0x10'))(_0x8adb('0x11'));var utils=require(_0x8adb('0x12'));var config=require(_0x8adb('0x13'));var db=require(_0x8adb('0x14'))['db'];function respondWithStatusCode(_0x2d79b5,_0x2a6574){_0x2a6574=_0x2a6574||0xcc;return function(_0x2828f1){if(_0x2828f1){return _0x2d79b5[_0x8adb('0x15')](_0x2a6574);}return _0x2d79b5[_0x8adb('0x16')](_0x2a6574)['end']();};}function respondWithResult(_0x5f0de6,_0x5db6c1){_0x5db6c1=_0x5db6c1||0xc8;return function(_0x122b37){if(_0x122b37){return _0x5f0de6['status'](_0x5db6c1)[_0x8adb('0x17')](_0x122b37);}};}function respondWithFilteredResult(_0x43579e,_0x774bb3){return function(_0x52e1d9){if(_0x52e1d9){var _0x20add0=_0x52e1d9[_0x8adb('0x18')],_0x117054=_0x774bb3[_0x8adb('0x19')],_0x1096fb=_0x774bb3['offset']+_0x774bb3[_0x8adb('0x1a')],_0x3f1ca7;if(_0x1096fb>=_0x20add0){_0x1096fb=_0x20add0;_0x3f1ca7=0xc8;}else{_0x3f1ca7=0xce;}_0x43579e[_0x8adb('0x16')](_0x3f1ca7);return _0x43579e['set']('Content-Range',_0x117054+'-'+_0x1096fb+'/'+_0x20add0)[_0x8adb('0x17')](_0x52e1d9);}return null;};}function patchUpdates(_0x30ef5a){return function(_0xe1196d){try{jsonpatch[_0x8adb('0x1b')](_0xe1196d,_0x30ef5a,!![]);}catch(_0x46bce0){return BPromise[_0x8adb('0x1c')](_0x46bce0);}return _0xe1196d[_0x8adb('0x1d')]();};}function saveUpdates(_0x345768,_0x156ebf){return function(_0x2a322d){if(_0x2a322d){return _0x2a322d[_0x8adb('0x1e')](_0x345768)[_0x8adb('0x1f')](function(_0x4a1a84){return _0x4a1a84;});}return null;};}function removeEntity(_0x548317,_0x24b31d){return function(_0x3d37db){if(_0x3d37db){return _0x3d37db['destroy']()[_0x8adb('0x1f')](function(){_0x548317[_0x8adb('0x16')](0xcc)[_0x8adb('0x20')]();});}};}function handleEntityNotFound(_0x184c2a,_0x11c2e8){return function(_0x28d5cd){if(!_0x28d5cd){_0x184c2a['sendStatus'](0x194);}return _0x28d5cd;};}function handleError(_0x19ae18,_0x16f305){_0x16f305=_0x16f305||0x1f4;return function(_0x234ef2){logger['error'](_0x234ef2[_0x8adb('0x21')]);if(_0x234ef2[_0x8adb('0x22')]){delete _0x234ef2[_0x8adb('0x22')];}_0x19ae18[_0x8adb('0x16')](_0x16f305)[_0x8adb('0x23')](_0x234ef2);};}exports[_0x8adb('0x24')]=function(_0x486cdb,_0x37ad71){var _0x16f724={},_0x18f94e={},_0x44f242={'count':0x0,'rows':[]};var _0x42c6cc=db[_0x8adb('0x25')][_0x8adb('0x26')];_0x18f94e['model']=_[_0x8adb('0x27')](_0x42c6cc);_0x18f94e[_0x8adb('0x28')]=_[_0x8adb('0x27')](_0x486cdb[_0x8adb('0x28')]);_0x18f94e['filters']=_[_0x8adb('0x29')](_0x18f94e['model'],_0x18f94e[_0x8adb('0x28')]);_0x16f724[_0x8adb('0x2a')]=_[_0x8adb('0x29')](_0x18f94e[_0x8adb('0x2b')],qs['fields'](_0x486cdb[_0x8adb('0x28')]['fields']));_0x16f724[_0x8adb('0x2a')]=_0x16f724['attributes'][_0x8adb('0x2c')]?_0x16f724[_0x8adb('0x2a')]:_0x18f94e[_0x8adb('0x2b')];if(!_0x486cdb[_0x8adb('0x28')][_0x8adb('0x2d')](_0x8adb('0x2e'))){_0x16f724['limit']=qs['limit'](_0x486cdb[_0x8adb('0x28')][_0x8adb('0x1a')]);_0x16f724[_0x8adb('0x19')]=qs[_0x8adb('0x19')](_0x486cdb[_0x8adb('0x28')][_0x8adb('0x19')]);}_0x16f724[_0x8adb('0x2f')]=qs[_0x8adb('0x30')](_0x486cdb[_0x8adb('0x28')][_0x8adb('0x30')]);_0x16f724[_0x8adb('0x31')]=qs[_0x8adb('0x32')](_[_0x8adb('0x33')](_0x486cdb['query'],_0x18f94e[_0x8adb('0x32')]));if(_0x486cdb[_0x8adb('0x28')]['filter']){_0x16f724[_0x8adb('0x31')]=_['merge'](_0x16f724[_0x8adb('0x31')],{'$or':_[_0x8adb('0x34')](_0x42c6cc,function(_0x6c8b25){if(_0x6c8b25[_0x8adb('0x35')][_0x8adb('0x36')]!=='VIRTUAL'){var _0x7e3f1e={};_0x7e3f1e[_0x6c8b25['field']]={'$like':'%'+_0x486cdb[_0x8adb('0x28')][_0x8adb('0x37')]+'%'};return _0x7e3f1e;}})});}_0x16f724=_['merge']({},_0x16f724,_0x486cdb[_0x8adb('0x38')]);var _0x525afd={'where':_0x16f724[_0x8adb('0x31')]};return db['Dynamics365Field'][_0x8adb('0x18')](_0x525afd)[_0x8adb('0x1f')](function(_0x2c621b){_0x44f242['count']=_0x2c621b;if(_0x486cdb['query'][_0x8adb('0x39')]){_0x16f724[_0x8adb('0x3a')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x8adb('0x3b')](_0x16f724);})[_0x8adb('0x1f')](function(_0x2da037){_0x44f242[_0x8adb('0x3c')]=_0x2da037;return _0x44f242;})[_0x8adb('0x1f')](respondWithFilteredResult(_0x37ad71,_0x16f724))[_0x8adb('0x3d')](handleError(_0x37ad71,null));};exports[_0x8adb('0x3e')]=function(_0x264d53,_0x59b565){var _0x5b175f={'raw':!![],'where':{'id':_0x264d53[_0x8adb('0x3f')]['id']}},_0x3f69b3={};_0x3f69b3[_0x8adb('0x2b')]=_[_0x8adb('0x27')](db['Dynamics365Field'][_0x8adb('0x26')]);_0x3f69b3['query']=_[_0x8adb('0x27')](_0x264d53[_0x8adb('0x28')]);_0x3f69b3[_0x8adb('0x32')]=_[_0x8adb('0x29')](_0x3f69b3['model'],_0x3f69b3['query']);_0x5b175f[_0x8adb('0x2a')]=_['intersection'](_0x3f69b3[_0x8adb('0x2b')],qs['fields'](_0x264d53['query'][_0x8adb('0x40')]));_0x5b175f[_0x8adb('0x2a')]=_0x5b175f['attributes'][_0x8adb('0x2c')]?_0x5b175f[_0x8adb('0x2a')]:_0x3f69b3[_0x8adb('0x2b')];if(_0x264d53[_0x8adb('0x28')][_0x8adb('0x39')]){_0x5b175f['include']=[{'all':!![]}];}_0x5b175f=_[_0x8adb('0x41')]({},_0x5b175f,_0x264d53['options']);return db[_0x8adb('0x25')][_0x8adb('0x42')](_0x5b175f)['then'](handleEntityNotFound(_0x59b565,null))['then'](respondWithResult(_0x59b565,null))[_0x8adb('0x3d')](handleError(_0x59b565,null));};exports['create']=function(_0x466890,_0x1ade43){return db[_0x8adb('0x25')][_0x8adb('0x43')](_0x466890['body'],{})[_0x8adb('0x1f')](respondWithResult(_0x1ade43,0xc9))[_0x8adb('0x3d')](handleError(_0x1ade43,null));};exports['update']=function(_0x5ba7a5,_0x826c52){if(_0x5ba7a5[_0x8adb('0x44')]['id']){delete _0x5ba7a5[_0x8adb('0x44')]['id'];}return db['Dynamics365Field'][_0x8adb('0x42')]({'where':{'id':_0x5ba7a5[_0x8adb('0x3f')]['id']}})[_0x8adb('0x1f')](handleEntityNotFound(_0x826c52,null))[_0x8adb('0x1f')](saveUpdates(_0x5ba7a5[_0x8adb('0x44')],null))[_0x8adb('0x1f')](respondWithResult(_0x826c52,null))[_0x8adb('0x3d')](handleError(_0x826c52,null));};exports[_0x8adb('0x45')]=function(_0xc2861b,_0xe725e9){return db[_0x8adb('0x25')][_0x8adb('0x42')]({'where':{'id':_0xc2861b['params']['id']}})[_0x8adb('0x1f')](handleEntityNotFound(_0xe725e9,null))[_0x8adb('0x1f')](removeEntity(_0xe725e9,null))[_0x8adb('0x3d')](handleError(_0xe725e9,null));}; \ No newline at end of file +var _0x5c5f=['request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','Dynamics365Field','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','field','filter','options','count','include','findAll','rows','params','length','includeAll','find','catch','create','body','html-pdf','eml-format','zip-dir','fast-json-patch'];(function(_0x142f69,_0xe8d178){var _0x5ce841=function(_0x1b2a79){while(--_0x1b2a79){_0x142f69['push'](_0x142f69['shift']());}};_0x5ce841(++_0xe8d178);}(_0x5c5f,0x120));var _0xf5c5=function(_0x576adf,_0x32b849){_0x576adf=_0x576adf-0x0;var _0x31f9c5=_0x5c5f[_0x576adf];return _0x31f9c5;};'use strict';var pdf=require(_0xf5c5('0x0'));var emlformat=require(_0xf5c5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf5c5('0x2'));var jsonpatch=require(_0xf5c5('0x3'));var rp=require(_0xf5c5('0x4'));var moment=require(_0xf5c5('0x5'));var BPromise=require(_0xf5c5('0x6'));var Mustache=require(_0xf5c5('0x7'));var util=require('util');var path=require(_0xf5c5('0x8'));var sox=require(_0xf5c5('0x9'));var csv=require(_0xf5c5('0xa'));var ejs=require(_0xf5c5('0xb'));var fs=require('fs');var _=require(_0xf5c5('0xc'));var squel=require(_0xf5c5('0xd'));var crypto=require(_0xf5c5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf5c5('0xf'));var toCsv=require(_0xf5c5('0xa'));var querystring=require(_0xf5c5('0x10'));var Papa=require(_0xf5c5('0x11'));var Redis=require(_0xf5c5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf5c5('0x13'));var hardwareService=require(_0xf5c5('0x14'));var logger=require(_0xf5c5('0x15'))(_0xf5c5('0x16'));var utils=require(_0xf5c5('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57d44a,_0x859181){_0x859181=_0x859181||0xcc;return function(_0x13d732){if(_0x13d732){return _0x57d44a[_0xf5c5('0x18')](_0x859181);}return _0x57d44a[_0xf5c5('0x19')](_0x859181)['end']();};}function respondWithResult(_0x5bd23d,_0x14846c){_0x14846c=_0x14846c||0xc8;return function(_0x391e1b){if(_0x391e1b){return _0x5bd23d[_0xf5c5('0x19')](_0x14846c)[_0xf5c5('0x1a')](_0x391e1b);}};}function respondWithFilteredResult(_0x1f6bc0,_0x274f6c){return function(_0x4b23b4){if(_0x4b23b4){var _0x5cd00f=_0x4b23b4['count'],_0x36de38=_0x274f6c[_0xf5c5('0x1b')],_0x263ec4=_0x274f6c[_0xf5c5('0x1b')]+_0x274f6c[_0xf5c5('0x1c')],_0x949cb1;if(_0x263ec4>=_0x5cd00f){_0x263ec4=_0x5cd00f;_0x949cb1=0xc8;}else{_0x949cb1=0xce;}_0x1f6bc0['status'](_0x949cb1);return _0x1f6bc0[_0xf5c5('0x1d')](_0xf5c5('0x1e'),_0x36de38+'-'+_0x263ec4+'/'+_0x5cd00f)[_0xf5c5('0x1a')](_0x4b23b4);}return null;};}function patchUpdates(_0x10b859){return function(_0x2fdec){try{jsonpatch[_0xf5c5('0x1f')](_0x2fdec,_0x10b859,!![]);}catch(_0x2ef0a7){return BPromise[_0xf5c5('0x20')](_0x2ef0a7);}return _0x2fdec[_0xf5c5('0x21')]();};}function saveUpdates(_0x1c9555,_0x2293a5){return function(_0x49d083){if(_0x49d083){return _0x49d083[_0xf5c5('0x22')](_0x1c9555)['then'](function(_0x137bcc){return _0x137bcc;});}return null;};}function removeEntity(_0x97545b,_0x14307b){return function(_0x444bed){if(_0x444bed){return _0x444bed[_0xf5c5('0x23')]()[_0xf5c5('0x24')](function(){_0x97545b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x14ea32,_0x31288f){return function(_0x1fe148){if(!_0x1fe148){_0x14ea32['sendStatus'](0x194);}return _0x1fe148;};}function handleError(_0xf5dcf1,_0x5d49ef){_0x5d49ef=_0x5d49ef||0x1f4;return function(_0x23d107){logger[_0xf5c5('0x25')](_0x23d107[_0xf5c5('0x26')]);if(_0x23d107['name']){delete _0x23d107[_0xf5c5('0x27')];}_0xf5dcf1[_0xf5c5('0x19')](_0x5d49ef)[_0xf5c5('0x28')](_0x23d107);};}exports[_0xf5c5('0x29')]=function(_0x4de7e6,_0x12b4de){var _0x5185c4={},_0x4b1a67={},_0xee8551={'count':0x0,'rows':[]};var _0x3aa7ce=db[_0xf5c5('0x2a')][_0xf5c5('0x2b')];_0x4b1a67[_0xf5c5('0x2c')]=_['keys'](_0x3aa7ce);_0x4b1a67[_0xf5c5('0x2d')]=_[_0xf5c5('0x2e')](_0x4de7e6[_0xf5c5('0x2d')]);_0x4b1a67[_0xf5c5('0x2f')]=_[_0xf5c5('0x30')](_0x4b1a67['model'],_0x4b1a67['query']);_0x5185c4[_0xf5c5('0x31')]=_['intersection'](_0x4b1a67[_0xf5c5('0x2c')],qs[_0xf5c5('0x32')](_0x4de7e6[_0xf5c5('0x2d')][_0xf5c5('0x32')]));_0x5185c4[_0xf5c5('0x31')]=_0x5185c4[_0xf5c5('0x31')]['length']?_0x5185c4[_0xf5c5('0x31')]:_0x4b1a67[_0xf5c5('0x2c')];if(!_0x4de7e6[_0xf5c5('0x2d')][_0xf5c5('0x33')](_0xf5c5('0x34'))){_0x5185c4['limit']=qs[_0xf5c5('0x1c')](_0x4de7e6['query'][_0xf5c5('0x1c')]);_0x5185c4[_0xf5c5('0x1b')]=qs[_0xf5c5('0x1b')](_0x4de7e6[_0xf5c5('0x2d')][_0xf5c5('0x1b')]);}_0x5185c4['order']=qs[_0xf5c5('0x35')](_0x4de7e6[_0xf5c5('0x2d')][_0xf5c5('0x35')]);_0x5185c4[_0xf5c5('0x36')]=qs[_0xf5c5('0x2f')](_[_0xf5c5('0x37')](_0x4de7e6[_0xf5c5('0x2d')],_0x4b1a67[_0xf5c5('0x2f')]));if(_0x4de7e6[_0xf5c5('0x2d')]['filter']){_0x5185c4['where']=_[_0xf5c5('0x38')](_0x5185c4[_0xf5c5('0x36')],{'$or':_[_0xf5c5('0x39')](_0x3aa7ce,function(_0x27068e){if(_0x27068e['type']['key']!==_0xf5c5('0x3a')){var _0x19ca77={};_0x19ca77[_0x27068e[_0xf5c5('0x3b')]]={'$like':'%'+_0x4de7e6[_0xf5c5('0x2d')][_0xf5c5('0x3c')]+'%'};return _0x19ca77;}})});}_0x5185c4=_[_0xf5c5('0x38')]({},_0x5185c4,_0x4de7e6[_0xf5c5('0x3d')]);var _0x49d12e={'where':_0x5185c4['where']};return db[_0xf5c5('0x2a')]['count'](_0x49d12e)[_0xf5c5('0x24')](function(_0x107a74){_0xee8551[_0xf5c5('0x3e')]=_0x107a74;if(_0x4de7e6[_0xf5c5('0x2d')]['includeAll']){_0x5185c4[_0xf5c5('0x3f')]=[{'all':!![]}];}return db[_0xf5c5('0x2a')][_0xf5c5('0x40')](_0x5185c4);})[_0xf5c5('0x24')](function(_0x22d03d){_0xee8551[_0xf5c5('0x41')]=_0x22d03d;return _0xee8551;})[_0xf5c5('0x24')](respondWithFilteredResult(_0x12b4de,_0x5185c4))['catch'](handleError(_0x12b4de,null));};exports['show']=function(_0x19fc70,_0x514c5b){var _0x1b42b3={'raw':!![],'where':{'id':_0x19fc70[_0xf5c5('0x42')]['id']}},_0x5d1bce={};_0x5d1bce[_0xf5c5('0x2c')]=_[_0xf5c5('0x2e')](db[_0xf5c5('0x2a')][_0xf5c5('0x2b')]);_0x5d1bce['query']=_[_0xf5c5('0x2e')](_0x19fc70[_0xf5c5('0x2d')]);_0x5d1bce['filters']=_[_0xf5c5('0x30')](_0x5d1bce['model'],_0x5d1bce['query']);_0x1b42b3[_0xf5c5('0x31')]=_[_0xf5c5('0x30')](_0x5d1bce['model'],qs['fields'](_0x19fc70[_0xf5c5('0x2d')][_0xf5c5('0x32')]));_0x1b42b3[_0xf5c5('0x31')]=_0x1b42b3[_0xf5c5('0x31')][_0xf5c5('0x43')]?_0x1b42b3[_0xf5c5('0x31')]:_0x5d1bce[_0xf5c5('0x2c')];if(_0x19fc70[_0xf5c5('0x2d')][_0xf5c5('0x44')]){_0x1b42b3[_0xf5c5('0x3f')]=[{'all':!![]}];}_0x1b42b3=_[_0xf5c5('0x38')]({},_0x1b42b3,_0x19fc70[_0xf5c5('0x3d')]);return db[_0xf5c5('0x2a')][_0xf5c5('0x45')](_0x1b42b3)[_0xf5c5('0x24')](handleEntityNotFound(_0x514c5b,null))[_0xf5c5('0x24')](respondWithResult(_0x514c5b,null))[_0xf5c5('0x46')](handleError(_0x514c5b,null));};exports[_0xf5c5('0x47')]=function(_0x3eff33,_0x3db98b){return db[_0xf5c5('0x2a')]['create'](_0x3eff33[_0xf5c5('0x48')],{})[_0xf5c5('0x24')](respondWithResult(_0x3db98b,0xc9))[_0xf5c5('0x46')](handleError(_0x3db98b,null));};exports[_0xf5c5('0x22')]=function(_0x56678f,_0x2e48fa){if(_0x56678f[_0xf5c5('0x48')]['id']){delete _0x56678f[_0xf5c5('0x48')]['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x56678f[_0xf5c5('0x42')]['id']}})[_0xf5c5('0x24')](handleEntityNotFound(_0x2e48fa,null))[_0xf5c5('0x24')](saveUpdates(_0x56678f[_0xf5c5('0x48')],null))[_0xf5c5('0x24')](respondWithResult(_0x2e48fa,null))[_0xf5c5('0x46')](handleError(_0x2e48fa,null));};exports[_0xf5c5('0x23')]=function(_0x31741f,_0x27f644){return db[_0xf5c5('0x2a')][_0xf5c5('0x45')]({'where':{'id':_0x31741f['params']['id']}})[_0xf5c5('0x24')](handleEntityNotFound(_0x27f644,null))[_0xf5c5('0x24')](removeEntity(_0x27f644,null))[_0xf5c5('0x46')](handleError(_0x27f644,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 0e1ca67..d944f9e 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(_0x23e4de,_0xf99444){var _0x2442c4=function(_0x2dfb22){while(--_0x2dfb22){_0x23e4de['push'](_0x23e4de['shift']());}};_0x2442c4(++_0xf99444);}(_0xb10b,0x12a));var _0xbb10=function(_0x4ef7e2,_0x257e37){_0x4ef7e2=_0x4ef7e2-0x0;var _0x84fa8=_0xb10b[_0x4ef7e2];return _0x84fa8;};'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 _0x7a54=['int_dynamics365_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field'];(function(_0x12c6a9,_0x385375){var _0x221731=function(_0x3d48c9){while(--_0x3d48c9){_0x12c6a9['push'](_0x12c6a9['shift']());}};_0x221731(++_0x385375);}(_0x7a54,0x106));var _0x47a5=function(_0x3b37b4,_0x191e3e){_0x3b37b4=_0x3b37b4-0x0;var _0x2d1e9b=_0x7a54[_0x3b37b4];return _0x2d1e9b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'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 0a09cf2..70c7d2d 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 _0x6db4=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird'];(function(_0xd6b94b,_0x2b0078){var _0x138199=function(_0x1535c2){while(--_0x1535c2){_0xd6b94b['push'](_0xd6b94b['shift']());}};_0x138199(++_0x2b0078);}(_0x6db4,0x111));var _0x46db=function(_0x40c90f,_0x53cc08){_0x40c90f=_0x40c90f-0x0;var _0x329d3b=_0x6db4[_0x40c90f];return _0x329d3b;};'use strict';var _=require('lodash');var util=require(_0x46db('0x0'));var moment=require(_0x46db('0x1'));var BPromise=require(_0x46db('0x2'));var rs=require(_0x46db('0x3'));var fs=require('fs');var Redis=require(_0x46db('0x4'));var db=require(_0x46db('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x46db('0x6'))(_0x46db('0x7'));var config=require(_0x46db('0x8'));var jayson=require(_0x46db('0x9'));var client=jayson[_0x46db('0xa')][_0x46db('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23de32,_0x5409cd,_0x3a2dcb){return new BPromise(function(_0x2a597d,_0x27b949){return client[_0x46db('0xc')](_0x23de32,_0x3a2dcb)[_0x46db('0xd')](function(_0x427c62){logger[_0x46db('0xe')](_0x46db('0xf'),_0x5409cd,_0x46db('0x10'));logger[_0x46db('0x11')](_0x46db('0x12'),_0x5409cd,_0x46db('0x10'),JSON['stringify'](_0x427c62));if(_0x427c62[_0x46db('0x13')]){if(_0x427c62[_0x46db('0x13')][_0x46db('0x14')]===0x1f4){logger[_0x46db('0x13')](_0x46db('0xf'),_0x5409cd,_0x427c62[_0x46db('0x13')][_0x46db('0x15')]);return _0x27b949(_0x427c62[_0x46db('0x13')][_0x46db('0x15')]);}logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x5409cd,_0x427c62['error'][_0x46db('0x15')]);return _0x2a597d(_0x427c62[_0x46db('0x13')]['message']);}else{logger[_0x46db('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x5409cd,_0x46db('0x10'));_0x2a597d(_0x427c62['result'][_0x46db('0x15')]);}})[_0x46db('0x16')](function(_0x5a75fb){logger[_0x46db('0x13')](_0x46db('0xf'),_0x5409cd,_0x5a75fb);_0x27b949(_0x5a75fb);});});} \ No newline at end of file +var _0x6888=['../../config/utils','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Field,\x20%s,\x20%s','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x35c952,_0x4115b2){var _0x1e3fc9=function(_0x1ae9f1){while(--_0x1ae9f1){_0x35c952['push'](_0x35c952['shift']());}};_0x1e3fc9(++_0x4115b2);}(_0x6888,0xd2));var _0x8688=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x6888[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x8688('0x0'));var util=require('util');var moment=require(_0x8688('0x1'));var BPromise=require(_0x8688('0x2'));var rs=require(_0x8688('0x3'));var fs=require('fs');var Redis=require(_0x8688('0x4'));var db=require(_0x8688('0x5'))['db'];var utils=require(_0x8688('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8688('0x7'));var jayson=require(_0x8688('0x8'));var client=jayson[_0x8688('0x9')][_0x8688('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfa1a28,_0xcc92be,_0x5860a8){return new BPromise(function(_0x457991,_0x15f2b9){return client[_0x8688('0xb')](_0xfa1a28,_0x5860a8)[_0x8688('0xc')](function(_0x18723c){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0xcc92be,_0x8688('0xd'));logger[_0x8688('0xe')](_0x8688('0xf'),_0xcc92be,_0x8688('0xd'),JSON[_0x8688('0x10')](_0x18723c));if(_0x18723c[_0x8688('0x11')]){if(_0x18723c[_0x8688('0x11')][_0x8688('0x12')]===0x1f4){logger[_0x8688('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0xcc92be,_0x18723c[_0x8688('0x11')][_0x8688('0x13')]);return _0x15f2b9(_0x18723c[_0x8688('0x11')][_0x8688('0x13')]);}logger[_0x8688('0x11')](_0x8688('0x14'),_0xcc92be,_0x18723c[_0x8688('0x11')][_0x8688('0x13')]);return _0x457991(_0x18723c[_0x8688('0x11')][_0x8688('0x13')]);}else{logger[_0x8688('0x15')](_0x8688('0x14'),_0xcc92be,'request\x20sent');_0x457991(_0x18723c[_0x8688('0x16')][_0x8688('0x13')]);}})[_0x8688('0x17')](function(_0x5ef2e6){logger[_0x8688('0x11')](_0x8688('0x14'),_0xcc92be,_0x5ef2e6);_0x15f2b9(_0x5ef2e6);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index a6be3e2..fe2e310 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 _0x3fba=['getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations'];(function(_0x1a64ff,_0x4277ba){var _0x4dc23b=function(_0x5bd711){while(--_0x5bd711){_0x1a64ff['push'](_0x1a64ff['shift']());}};_0x4dc23b(++_0x4277ba);}(_0x3fba,0xb2));var _0xa3fb=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x3fba[_0x82129b];return _0x2ae5dc;};'use strict';var multer=require(_0xa3fb('0x0'));var util=require('util');var path=require(_0xa3fb('0x1'));var timeout=require(_0xa3fb('0x2'));var express=require(_0xa3fb('0x3'));var router=express[_0xa3fb('0x4')]();var auth=require(_0xa3fb('0x5'));var interaction=require(_0xa3fb('0x6'));var config=require(_0xa3fb('0x7'));var controller=require(_0xa3fb('0x8'));router[_0xa3fb('0x9')]('/',auth[_0xa3fb('0xa')](),controller[_0xa3fb('0xb')]);router[_0xa3fb('0x9')](_0xa3fb('0xc'),auth[_0xa3fb('0xa')](),controller['show']);router[_0xa3fb('0x9')](_0xa3fb('0xd'),auth[_0xa3fb('0xa')](),controller[_0xa3fb('0xe')]);router[_0xa3fb('0x9')](_0xa3fb('0xf'),auth[_0xa3fb('0xa')](),controller[_0xa3fb('0x10')]);router[_0xa3fb('0x11')]('/',auth[_0xa3fb('0xa')](),controller[_0xa3fb('0x12')]);router['post']('/:id/configurations',auth[_0xa3fb('0xa')](),controller[_0xa3fb('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xa3fb('0x14')]);router[_0xa3fb('0x15')](_0xa3fb('0xc'),auth['isAuthenticated'](),controller[_0xa3fb('0x16')]);module[_0xa3fb('0x17')]=router; \ No newline at end of file +var _0x55c1=['addConfiguration','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x2fb4eb,_0x11770d){var _0x2f7c0a=function(_0x5f4942){while(--_0x5f4942){_0x2fb4eb['push'](_0x2fb4eb['shift']());}};_0x2f7c0a(++_0x11770d);}(_0x55c1,0x16d));var _0x155c=function(_0x239650,_0x56aeda){_0x239650=_0x239650-0x0;var _0xee0bd6=_0x55c1[_0x239650];return _0xee0bd6;};'use strict';var multer=require(_0x155c('0x0'));var util=require('util');var path=require(_0x155c('0x1'));var timeout=require(_0x155c('0x2'));var express=require(_0x155c('0x3'));var router=express[_0x155c('0x4')]();var auth=require(_0x155c('0x5'));var interaction=require(_0x155c('0x6'));var config=require(_0x155c('0x7'));var controller=require('./intFreshdeskAccount.controller');router[_0x155c('0x8')]('/',auth[_0x155c('0x9')](),controller[_0x155c('0xa')]);router[_0x155c('0x8')](_0x155c('0xb'),auth[_0x155c('0x9')](),controller[_0x155c('0xc')]);router[_0x155c('0x8')](_0x155c('0xd'),auth[_0x155c('0x9')](),controller[_0x155c('0xe')]);router[_0x155c('0x8')](_0x155c('0xf'),auth['isAuthenticated'](),controller[_0x155c('0x10')]);router[_0x155c('0x11')]('/',auth[_0x155c('0x9')](),controller[_0x155c('0x12')]);router[_0x155c('0x11')](_0x155c('0xd'),auth[_0x155c('0x9')](),controller[_0x155c('0x13')]);router[_0x155c('0x14')](_0x155c('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x155c('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x155c('0x16')]);module[_0x155c('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 4b37219..4518ecd 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 _0x3de1=['STRING','username','exports'];(function(_0x380e75,_0x48177f){var _0x558259=function(_0x428429){while(--_0x428429){_0x380e75['push'](_0x380e75['shift']());}};_0x558259(++_0x48177f);}(_0x3de1,0xd1));var _0x13de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3de1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x13de('0x0')]={'name':{'type':Sequelize[_0x13de('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x13de('0x1')],'unique':_0x13de('0x2')},'apiKey':{'type':Sequelize[_0x13de('0x1')]},'remoteUri':{'type':Sequelize[_0x13de('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xaa9c=['sequelize','exports','STRING','username'];(function(_0x29a7f6,_0x20c9be){var _0x55bc3b=function(_0x1e95e3){while(--_0x1e95e3){_0x29a7f6['push'](_0x29a7f6['shift']());}};_0x55bc3b(++_0x20c9be);}(_0xaa9c,0x1f4));var _0xcaa9=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xaa9c[_0x12fc8d];return _0x3f9d04;};'use strict';var Sequelize=require(_0xcaa9('0x0'));module[_0xcaa9('0x1')]={'name':{'type':Sequelize[_0xcaa9('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xcaa9('0x2')],'unique':_0xcaa9('0x3')},'apiKey':{'type':Sequelize[_0xcaa9('0x2')]},'remoteUri':{'type':Sequelize[_0xcaa9('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xcaa9('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index ed1b2ba..ffe26a8 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 _0x33c5=['../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','field','merge','FreshdeskAccount','includeAll','include','findAll','show','params','options','create','body','find','getConfigurations','findOne','FreshdeskConfiguration','map','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','substring','GET','format','%s/%s','api/v2/ticket_fields','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','remove','includes','name','custom_text','custom_dropdown','label','default','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils'];(function(_0x1dbb77,_0x3ab4d9){var _0x161e1d=function(_0x2581c0){while(--_0x2581c0){_0x1dbb77['push'](_0x1dbb77['shift']());}};_0x161e1d(++_0x3ab4d9);}(_0x33c5,0xe6));var _0x533c=function(_0x29aefc,_0x4dcf53){_0x29aefc=_0x29aefc-0x0;var _0x11be36=_0x33c5[_0x29aefc];return _0x11be36;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x533c('0x0'));var rimraf=require(_0x533c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x533c('0x2'));var rp=require(_0x533c('0x3'));var moment=require(_0x533c('0x4'));var BPromise=require(_0x533c('0x5'));var Mustache=require(_0x533c('0x6'));var util=require('util');var path=require(_0x533c('0x7'));var sox=require(_0x533c('0x8'));var csv=require(_0x533c('0x9'));var ejs=require(_0x533c('0xa'));var fs=require('fs');var _=require(_0x533c('0xb'));var squel=require(_0x533c('0xc'));var crypto=require(_0x533c('0xd'));var jsforce=require(_0x533c('0xe'));var deskjs=require(_0x533c('0xf'));var toCsv=require(_0x533c('0x9'));var querystring=require(_0x533c('0x10'));var Papa=require(_0x533c('0x11'));var Redis=require(_0x533c('0x12'));var authService=require(_0x533c('0x13'));var qs=require(_0x533c('0x14'));var hardwareService=require(_0x533c('0x15'));var logger=require('../../config/logger')(_0x533c('0x16'));var utils=require(_0x533c('0x17'));var config=require(_0x533c('0x18'));var db=require(_0x533c('0x19'))['db'];var integrations=require(_0x533c('0x1a'));var jayson=require(_0x533c('0x1b'));var client=jayson['client'][_0x533c('0x1c')]({'port':0x232a});function checkPasswordPattern(_0xf93007,_0x300a63,_0x12ecae){if(_0x12ecae){var _0x2d5bc8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2d5bc8[_0x533c('0x1d')](_0x300a63)){return _0xf93007;}else{throw new Error(_0x533c('0x1e'));}}else{return _0xf93007;}}function respondWithRpcPromise(_0xa616ca,_0x59298d,_0x335f73,_0x7c1d33){return new BPromise(function(_0x3f4a5c,_0x3e544f){var _0x56dfb7=_0x7c1d33||client;return _0x56dfb7[_0x533c('0x1f')](_0xa616ca,_0x335f73)[_0x533c('0x20')](function(_0x41e22c){logger[_0x533c('0x21')](_0x533c('0x22'),_0x59298d,_0x533c('0x23'));logger[_0x533c('0x24')](_0x533c('0x25'),_0x59298d,_0x533c('0x23'),JSON[_0x533c('0x26')](_0x41e22c));if(_0x41e22c[_0x533c('0x27')]){if(_0x41e22c[_0x533c('0x27')][_0x533c('0x28')]===0x1f4){logger[_0x533c('0x27')](_0x533c('0x22'),_0x59298d,_0x41e22c[_0x533c('0x27')][_0x533c('0x29')]);return _0x3e544f(_0x41e22c[_0x533c('0x27')]['message']);}logger[_0x533c('0x27')]('FreshdeskAccount,\x20%s,\x20%s',_0x59298d,_0x41e22c['error'][_0x533c('0x29')]);return _0x3f4a5c(_0x41e22c[_0x533c('0x27')]['message']);}else{logger[_0x533c('0x21')](_0x533c('0x22'),_0x59298d,_0x533c('0x23'));_0x3f4a5c(_0x41e22c[_0x533c('0x2a')]['message']);}})[_0x533c('0x2b')](function(_0x42c87b){logger[_0x533c('0x27')](_0x533c('0x22'),_0x59298d,_0x42c87b);_0x3e544f(_0x42c87b);});});}function respondWithStatusCode(_0x25f6ef,_0x140269){_0x140269=_0x140269||0xcc;return function(_0xb51a5){if(_0xb51a5){return _0x25f6ef[_0x533c('0x2c')](_0x140269);}return _0x25f6ef[_0x533c('0x2d')](_0x140269)[_0x533c('0x2e')]();};}function respondWithResult(_0x4d47d0,_0x11d775){_0x11d775=_0x11d775||0xc8;return function(_0xfab4da){if(_0xfab4da){return _0x4d47d0['status'](_0x11d775)[_0x533c('0x2f')](_0xfab4da);}};}function respondWithFilteredResult(_0x4f9f4a,_0x21f58d){return function(_0x14d783){if(_0x14d783){var _0x4a0e86=_0x14d783[_0x533c('0x30')],_0x8dd7f1=_0x21f58d[_0x533c('0x31')],_0x425f60=_0x21f58d[_0x533c('0x31')]+_0x21f58d[_0x533c('0x32')],_0x146a8e;if(_0x425f60>=_0x4a0e86){_0x425f60=_0x4a0e86;_0x146a8e=0xc8;}else{_0x146a8e=0xce;}_0x4f9f4a[_0x533c('0x2d')](_0x146a8e);return _0x4f9f4a[_0x533c('0x33')]('Content-Range',_0x8dd7f1+'-'+_0x425f60+'/'+_0x4a0e86)[_0x533c('0x2f')](_0x14d783);}return null;};}function patchUpdates(_0x591499){return function(_0x3290de){try{jsonpatch[_0x533c('0x34')](_0x3290de,_0x591499,!![]);}catch(_0x39eda3){return BPromise[_0x533c('0x35')](_0x39eda3);}return _0x3290de[_0x533c('0x36')]();};}function saveUpdates(_0x397ad3,_0x41aba0){return function(_0x624d84){if(_0x624d84){return _0x624d84[_0x533c('0x37')](_0x397ad3)[_0x533c('0x20')](function(_0x1bbcb7){return _0x1bbcb7;});}return null;};}function removeEntity(_0x3ec4c8,_0x3f7ffc){return function(_0x14dd9d){if(_0x14dd9d){return _0x14dd9d[_0x533c('0x38')]()['then'](function(){_0x3ec4c8[_0x533c('0x2d')](0xcc)[_0x533c('0x2e')]();});}};}function handleEntityNotFound(_0x188223,_0x31129f){return function(_0x56694f){if(!_0x56694f){_0x188223[_0x533c('0x2c')](0x194);}return _0x56694f;};}function handleError(_0x31b4e4,_0x2350fe){_0x2350fe=_0x2350fe||0x1f4;return function(_0x40f077){logger[_0x533c('0x27')](_0x40f077['stack']);if(_0x40f077['name']){delete _0x40f077['name'];}_0x31b4e4['status'](_0x2350fe)['send'](_0x40f077);};}exports[_0x533c('0x39')]=function(_0x4b6c22,_0x42994d){var _0x55726a={},_0x34243d={},_0x3cd1e6={'count':0x0,'rows':[]};var _0x14c121=db['FreshdeskAccount'][_0x533c('0x3a')];_0x34243d[_0x533c('0x3b')]=_[_0x533c('0x3c')](_0x14c121);_0x34243d['query']=_[_0x533c('0x3c')](_0x4b6c22[_0x533c('0x3d')]);_0x34243d[_0x533c('0x3e')]=_['intersection'](_0x34243d[_0x533c('0x3b')],_0x34243d[_0x533c('0x3d')]);_0x55726a[_0x533c('0x3f')]=_[_0x533c('0x40')](_0x34243d[_0x533c('0x3b')],qs[_0x533c('0x41')](_0x4b6c22[_0x533c('0x3d')][_0x533c('0x41')]));_0x55726a[_0x533c('0x3f')]=_0x55726a[_0x533c('0x3f')][_0x533c('0x42')]?_0x55726a['attributes']:_0x34243d[_0x533c('0x3b')];if(!_0x4b6c22[_0x533c('0x3d')][_0x533c('0x43')](_0x533c('0x44'))){_0x55726a[_0x533c('0x32')]=qs[_0x533c('0x32')](_0x4b6c22['query'][_0x533c('0x32')]);_0x55726a[_0x533c('0x31')]=qs[_0x533c('0x31')](_0x4b6c22['query'][_0x533c('0x31')]);}_0x55726a[_0x533c('0x45')]=qs[_0x533c('0x46')](_0x4b6c22[_0x533c('0x3d')]['sort']);_0x55726a[_0x533c('0x47')]=qs['filters'](_[_0x533c('0x48')](_0x4b6c22[_0x533c('0x3d')],_0x34243d['filters']));if(_0x4b6c22[_0x533c('0x3d')][_0x533c('0x49')]){_0x55726a[_0x533c('0x47')]=_['merge'](_0x55726a['where'],{'$or':_['map'](_0x14c121,function(_0x5c4e1b){if(_0x5c4e1b[_0x533c('0x4a')]['key']!==_0x533c('0x4b')){var _0x503852={};_0x503852[_0x5c4e1b[_0x533c('0x4c')]]={'$like':'%'+_0x4b6c22['query'][_0x533c('0x49')]+'%'};return _0x503852;}})});}_0x55726a=_[_0x533c('0x4d')]({},_0x55726a,_0x4b6c22['options']);var _0x132e42={'where':_0x55726a[_0x533c('0x47')]};return db[_0x533c('0x4e')][_0x533c('0x30')](_0x132e42)[_0x533c('0x20')](function(_0x4ecf60){_0x3cd1e6[_0x533c('0x30')]=_0x4ecf60;if(_0x4b6c22[_0x533c('0x3d')][_0x533c('0x4f')]){_0x55726a[_0x533c('0x50')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x533c('0x51')](_0x55726a);})[_0x533c('0x20')](function(_0x55d033){_0x3cd1e6['rows']=_0x55d033;return _0x3cd1e6;})[_0x533c('0x20')](respondWithFilteredResult(_0x42994d,_0x55726a))['catch'](handleError(_0x42994d,null));};exports[_0x533c('0x52')]=function(_0x2a9186,_0x19878d){var _0x471c59={'raw':![],'where':{'id':_0x2a9186[_0x533c('0x53')]['id']}},_0xe9354a={};_0xe9354a[_0x533c('0x3b')]=_[_0x533c('0x3c')](db['FreshdeskAccount'][_0x533c('0x3a')]);_0xe9354a[_0x533c('0x3d')]=_[_0x533c('0x3c')](_0x2a9186['query']);_0xe9354a[_0x533c('0x3e')]=_[_0x533c('0x40')](_0xe9354a['model'],_0xe9354a[_0x533c('0x3d')]);_0x471c59['attributes']=_[_0x533c('0x40')](_0xe9354a[_0x533c('0x3b')],qs[_0x533c('0x41')](_0x2a9186[_0x533c('0x3d')][_0x533c('0x41')]));_0x471c59[_0x533c('0x3f')]=_0x471c59[_0x533c('0x3f')]['length']?_0x471c59[_0x533c('0x3f')]:_0xe9354a[_0x533c('0x3b')];if(_0x2a9186[_0x533c('0x3d')][_0x533c('0x4f')]){_0x471c59[_0x533c('0x50')]=[{'all':!![]}];}_0x471c59=_[_0x533c('0x4d')]({},_0x471c59,_0x2a9186[_0x533c('0x54')]);return db['FreshdeskAccount']['find'](_0x471c59)['then'](handleEntityNotFound(_0x19878d,null))['then'](respondWithResult(_0x19878d,null))[_0x533c('0x2b')](handleError(_0x19878d,null));};exports[_0x533c('0x55')]=function(_0x5c5dd0,_0xac086b){return db[_0x533c('0x4e')][_0x533c('0x55')](_0x5c5dd0['body'],{})[_0x533c('0x20')](respondWithResult(_0xac086b,0xc9))['catch'](handleError(_0xac086b,null));};exports['update']=function(_0x209b9f,_0x15a7d2){if(_0x209b9f[_0x533c('0x56')]['id']){delete _0x209b9f[_0x533c('0x56')]['id'];}return db[_0x533c('0x4e')][_0x533c('0x57')]({'where':{'id':_0x209b9f[_0x533c('0x53')]['id']}})['then'](handleEntityNotFound(_0x15a7d2,null))[_0x533c('0x20')](saveUpdates(_0x209b9f['body'],null))[_0x533c('0x20')](respondWithResult(_0x15a7d2,null))[_0x533c('0x2b')](handleError(_0x15a7d2,null));};exports[_0x533c('0x38')]=function(_0x2c7600,_0x416769){return db[_0x533c('0x4e')][_0x533c('0x57')]({'where':{'id':_0x2c7600[_0x533c('0x53')]['id']}})['then'](handleEntityNotFound(_0x416769,null))[_0x533c('0x20')](removeEntity(_0x416769,null))[_0x533c('0x2b')](handleError(_0x416769,null));};exports[_0x533c('0x58')]=function(_0x94063c,_0x37ea57,_0x25182f){var _0x534859={};var _0x123c8f={};var _0x554a9f;var _0x43383e;return db[_0x533c('0x4e')][_0x533c('0x59')]({'where':{'id':_0x94063c[_0x533c('0x53')]['id']}})[_0x533c('0x20')](handleEntityNotFound(_0x37ea57,null))[_0x533c('0x20')](function(_0x5cc8bc){if(_0x5cc8bc){_0x554a9f=_0x5cc8bc;_0x123c8f['model']=_[_0x533c('0x3c')](db[_0x533c('0x5a')][_0x533c('0x3a')]);_0x123c8f[_0x533c('0x3d')]=_['keys'](_0x94063c[_0x533c('0x3d')]);_0x123c8f[_0x533c('0x3e')]=_[_0x533c('0x40')](_0x123c8f[_0x533c('0x3b')],_0x123c8f[_0x533c('0x3d')]);_0x534859[_0x533c('0x3f')]=_[_0x533c('0x40')](_0x123c8f[_0x533c('0x3b')],qs[_0x533c('0x41')](_0x94063c[_0x533c('0x3d')][_0x533c('0x41')]));_0x534859[_0x533c('0x3f')]=_0x534859[_0x533c('0x3f')][_0x533c('0x42')]?_0x534859[_0x533c('0x3f')]:_0x123c8f[_0x533c('0x3b')];_0x534859[_0x533c('0x45')]=qs['sort'](_0x94063c[_0x533c('0x3d')]['sort']);_0x534859['where']=qs[_0x533c('0x3e')](_[_0x533c('0x48')](_0x94063c[_0x533c('0x3d')],_0x123c8f[_0x533c('0x3e')]));if(_0x94063c[_0x533c('0x3d')][_0x533c('0x49')]){_0x534859[_0x533c('0x47')]=_['merge'](_0x534859[_0x533c('0x47')],{'$or':_[_0x533c('0x5b')](_0x534859['attributes'],function(_0x1fbad2){var _0x1c1b8a={};_0x1c1b8a[_0x1fbad2]={'$like':'%'+_0x94063c[_0x533c('0x3d')][_0x533c('0x49')]+'%'};return _0x1c1b8a;})});}_0x534859=_['merge']({},_0x534859,_0x94063c[_0x533c('0x54')]);return _0x554a9f[_0x533c('0x58')](_0x534859);}})['then'](function(_0x1589b0){if(_0x1589b0){_0x43383e=_0x1589b0[_0x533c('0x42')];if(!_0x94063c['query'][_0x533c('0x43')](_0x533c('0x44'))){_0x534859['limit']=qs[_0x533c('0x32')](_0x94063c['query']['limit']);_0x534859[_0x533c('0x31')]=qs[_0x533c('0x31')](_0x94063c[_0x533c('0x3d')][_0x533c('0x31')]);}return _0x554a9f['getConfigurations'](_0x534859);}})[_0x533c('0x20')](function(_0x32fd4b){if(_0x32fd4b){return _0x32fd4b?{'count':_0x43383e,'rows':_0x32fd4b}:null;}})[_0x533c('0x20')](respondWithResult(_0x37ea57,null))[_0x533c('0x2b')](handleError(_0x37ea57,null));};exports[_0x533c('0x5c')]=function(_0x56e046,_0x309725,_0x4d5ad1){if(_0x56e046[_0x533c('0x56')]['id']){delete _0x56e046['body']['id'];}return db[_0x533c('0x4e')]['findOne']({'where':{'id':_0x56e046['params']['id']}})['then'](handleEntityNotFound(_0x309725,null))[_0x533c('0x20')](function(_0x3f3981){if(_0x3f3981){_0x56e046[_0x533c('0x56')]['AccountId']=_0x3f3981['id'];_0x56e046[_0x533c('0x56')][_0x533c('0x5d')]=integrations[_0x533c('0x5e')](_0x56e046[_0x533c('0x56')][_0x533c('0x5f')],_0x56e046['body']['type']);_0x56e046[_0x533c('0x56')][_0x533c('0x60')]=integrations[_0x533c('0x61')](_0x56e046[_0x533c('0x56')][_0x533c('0x5f')],_0x56e046[_0x533c('0x56')][_0x533c('0x4a')]);return db[_0x533c('0x5a')][_0x533c('0x55')](_0x56e046['body'],{'include':[{'model':db[_0x533c('0x62')],'as':_0x533c('0x5d')},{'model':db[_0x533c('0x62')],'as':_0x533c('0x60')}]});}return null;})[_0x533c('0x20')](respondWithResult(_0x309725,null))[_0x533c('0x2b')](handleError(_0x309725,null));};exports[_0x533c('0x63')]=function(_0x49d765,_0x13b6b7,_0x323481){var _0xfd598d='';return db[_0x533c('0x4e')][_0x533c('0x59')]({'where':{'id':_0x49d765[_0x533c('0x53')]['id']},'attributes':['id',_0x533c('0x64'),_0x533c('0x65')]})[_0x533c('0x20')](handleEntityNotFound(_0x13b6b7,null))['then'](function(_0x367eb4){if(_0x367eb4){_0xfd598d=_0x367eb4[_0x533c('0x64')];var _0x4a96da=_0xfd598d['slice'](-0x1);if(_0x4a96da==='/'){_0xfd598d=_0xfd598d[_0x533c('0x66')](0x0,_0xfd598d['lastIndexOf'](_0x4a96da));}return rp({'method':_0x533c('0x67'),'uri':util[_0x533c('0x68')](_0x533c('0x69'),_0xfd598d,_0x533c('0x6a')),'headers':{'Authorization':util[_0x533c('0x68')]('Basic\x20%s',new Buffer(util[_0x533c('0x68')](_0x533c('0x6b'),_0x367eb4[_0x533c('0x65')]))[_0x533c('0x6c')](_0x533c('0x6d')))},'json':!![]});}})[_0x533c('0x20')](function(_0x1aa938){if(_0x1aa938){var _0x248ede=[_0x533c('0x6e'),_0x533c('0x6f'),_0x533c('0x70'),_0x533c('0x71'),_0x533c('0x2d'),_0x533c('0x72'),_0x533c('0x73'),_0x533c('0x74'),_0x533c('0x75'),_0x533c('0x73'),'company'];_[_0x533c('0x76')](_0x1aa938,function(_0x15d09a){return _0x248ede[_0x533c('0x77')](_0x15d09a[_0x533c('0x78')])||!_0x15d09a['default']&&_0x15d09a[_0x533c('0x4a')]!==_0x533c('0x79')&&_0x15d09a['type']!==_0x533c('0x7a');});return{'count':_0x1aa938['length'],'rows':_[_0x533c('0x5b')](_0x1aa938,function(_0x4be94e){return{'id':_0x4be94e[_0x533c('0x78')],'name':_0x4be94e[_0x533c('0x7b')],'custom':!_0x4be94e[_0x533c('0x7c')],'options':_0x4be94e['choices']?_['map'](_0x4be94e['choices'],function(_0x1088f9){return{'name':_['capitalize'](_0x1088f9),'value':_0x1088f9};}):[]};})};}})[_0x533c('0x20')](respondWithResult(_0x13b6b7,null))[_0x533c('0x2b')](function(_0x445da2){var _0x450152=_0x49d765['query']['test']?0x1f4:_0x445da2[_0x533c('0x7d')]||0x1f4;logger['error'](_0x533c('0x7e'),_0x533c('0x63'),_0x450152,JSON[_0x533c('0x26')](_0x445da2));delete _0x445da2['name'];if(_0x450152===0x191){_0x450152=0x190;}_0x13b6b7[_0x533c('0x2d')](_0x450152)['send'](_0x49d765[_0x533c('0x3d')][_0x533c('0x1d')]?{'message':'Wrong\x20credentials','statusCode':_0x445da2[_0x533c('0x7d')]}:_0x445da2);});}; \ No newline at end of file +var _0x8c73=['FreshdeskField','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','Basic\x20%s','format','%s:X','toString','agent','description','group','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','client','http','test','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','merge','where','map','type','key','VIRTUAL','options','FreshdeskAccount','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','pick','nolimit','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel'];(function(_0x4c8fd0,_0x2ca884){var _0x3e522d=function(_0x22f102){while(--_0x22f102){_0x4c8fd0['push'](_0x4c8fd0['shift']());}};_0x3e522d(++_0x2ca884);}(_0x8c73,0x10d));var _0x38c7=function(_0x3bbbab,_0x33302f){_0x3bbbab=_0x3bbbab-0x0;var _0x44be3e=_0x8c73[_0x3bbbab];return _0x44be3e;};'use strict';var pdf=require(_0x38c7('0x0'));var emlformat=require(_0x38c7('0x1'));var rimraf=require(_0x38c7('0x2'));var zipdir=require(_0x38c7('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x38c7('0x4'));var moment=require('moment');var BPromise=require(_0x38c7('0x5'));var Mustache=require(_0x38c7('0x6'));var util=require(_0x38c7('0x7'));var path=require(_0x38c7('0x8'));var sox=require(_0x38c7('0x9'));var csv=require(_0x38c7('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x38c7('0xb'));var squel=require(_0x38c7('0xc'));var crypto=require(_0x38c7('0xd'));var jsforce=require(_0x38c7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x38c7('0xa'));var querystring=require(_0x38c7('0xf'));var Papa=require(_0x38c7('0x10'));var Redis=require(_0x38c7('0x11'));var authService=require(_0x38c7('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x38c7('0x13'));var logger=require('../../config/logger')(_0x38c7('0x14'));var utils=require(_0x38c7('0x15'));var config=require('../../config/environment');var db=require(_0x38c7('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0x38c7('0x17')][_0x38c7('0x18')]({'port':0x232a});function checkPasswordPattern(_0x11be34,_0x50f11e,_0x57be2c){if(_0x57be2c){var _0x462377=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x462377[_0x38c7('0x19')](_0x50f11e)){return _0x11be34;}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 _0x11be34;}}function respondWithRpcPromise(_0x239400,_0xbee7c7,_0x1c169d,_0x101d00){return new BPromise(function(_0x449b76,_0x57094d){var _0x5a0d67=_0x101d00||client;return _0x5a0d67[_0x38c7('0x1a')](_0x239400,_0x1c169d)[_0x38c7('0x1b')](function(_0x3ea879){logger[_0x38c7('0x1c')](_0x38c7('0x1d'),_0xbee7c7,'request\x20sent');logger[_0x38c7('0x1e')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0xbee7c7,_0x38c7('0x1f'),JSON[_0x38c7('0x20')](_0x3ea879));if(_0x3ea879[_0x38c7('0x21')]){if(_0x3ea879[_0x38c7('0x21')][_0x38c7('0x22')]===0x1f4){logger['error'](_0x38c7('0x1d'),_0xbee7c7,_0x3ea879[_0x38c7('0x21')]['message']);return _0x57094d(_0x3ea879[_0x38c7('0x21')][_0x38c7('0x23')]);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0xbee7c7,_0x3ea879[_0x38c7('0x21')][_0x38c7('0x23')]);return _0x449b76(_0x3ea879[_0x38c7('0x21')][_0x38c7('0x23')]);}else{logger[_0x38c7('0x1c')](_0x38c7('0x1d'),_0xbee7c7,_0x38c7('0x1f'));_0x449b76(_0x3ea879['result'][_0x38c7('0x23')]);}})[_0x38c7('0x24')](function(_0x3fbbb3){logger[_0x38c7('0x21')](_0x38c7('0x1d'),_0xbee7c7,_0x3fbbb3);_0x57094d(_0x3fbbb3);});});}function respondWithStatusCode(_0x82a361,_0x4b70b4){_0x4b70b4=_0x4b70b4||0xcc;return function(_0x5ca16e){if(_0x5ca16e){return _0x82a361[_0x38c7('0x25')](_0x4b70b4);}return _0x82a361[_0x38c7('0x26')](_0x4b70b4)[_0x38c7('0x27')]();};}function respondWithResult(_0x3684a1,_0x53a76c){_0x53a76c=_0x53a76c||0xc8;return function(_0x36361c){if(_0x36361c){return _0x3684a1[_0x38c7('0x26')](_0x53a76c)[_0x38c7('0x28')](_0x36361c);}};}function respondWithFilteredResult(_0x5580af,_0x4e7acb){return function(_0x5643de){if(_0x5643de){var _0x171d74=_0x5643de[_0x38c7('0x29')],_0xe9188f=_0x4e7acb['offset'],_0x92b1d2=_0x4e7acb[_0x38c7('0x2a')]+_0x4e7acb[_0x38c7('0x2b')],_0x7eb0bf;if(_0x92b1d2>=_0x171d74){_0x92b1d2=_0x171d74;_0x7eb0bf=0xc8;}else{_0x7eb0bf=0xce;}_0x5580af[_0x38c7('0x26')](_0x7eb0bf);return _0x5580af[_0x38c7('0x2c')](_0x38c7('0x2d'),_0xe9188f+'-'+_0x92b1d2+'/'+_0x171d74)[_0x38c7('0x28')](_0x5643de);}return null;};}function patchUpdates(_0x2486fa){return function(_0x5e1fbf){try{jsonpatch['apply'](_0x5e1fbf,_0x2486fa,!![]);}catch(_0x2dff4f){return BPromise[_0x38c7('0x2e')](_0x2dff4f);}return _0x5e1fbf['save']();};}function saveUpdates(_0x24a424,_0x116ba7){return function(_0x4a75ee){if(_0x4a75ee){return _0x4a75ee[_0x38c7('0x2f')](_0x24a424)['then'](function(_0x31bedc){return _0x31bedc;});}return null;};}function removeEntity(_0x4500ed,_0x3b47ba){return function(_0x28c573){if(_0x28c573){return _0x28c573[_0x38c7('0x30')]()[_0x38c7('0x1b')](function(){_0x4500ed['status'](0xcc)[_0x38c7('0x27')]();});}};}function handleEntityNotFound(_0x1277b8,_0x5551a4){return function(_0xe41919){if(!_0xe41919){_0x1277b8['sendStatus'](0x194);}return _0xe41919;};}function handleError(_0x1be301,_0x2a6bb2){_0x2a6bb2=_0x2a6bb2||0x1f4;return function(_0x4972b2){logger[_0x38c7('0x21')](_0x4972b2[_0x38c7('0x31')]);if(_0x4972b2[_0x38c7('0x32')]){delete _0x4972b2[_0x38c7('0x32')];}_0x1be301['status'](_0x2a6bb2)[_0x38c7('0x33')](_0x4972b2);};}exports[_0x38c7('0x34')]=function(_0x5ede2f,_0x41e9ec){var _0x556913={},_0x5b10bc={},_0x6cf011={'count':0x0,'rows':[]};var _0x267b49=db['FreshdeskAccount'][_0x38c7('0x35')];_0x5b10bc[_0x38c7('0x36')]=_[_0x38c7('0x37')](_0x267b49);_0x5b10bc[_0x38c7('0x38')]=_['keys'](_0x5ede2f[_0x38c7('0x38')]);_0x5b10bc[_0x38c7('0x39')]=_[_0x38c7('0x3a')](_0x5b10bc['model'],_0x5b10bc['query']);_0x556913[_0x38c7('0x3b')]=_[_0x38c7('0x3a')](_0x5b10bc[_0x38c7('0x36')],qs[_0x38c7('0x3c')](_0x5ede2f[_0x38c7('0x38')][_0x38c7('0x3c')]));_0x556913[_0x38c7('0x3b')]=_0x556913[_0x38c7('0x3b')][_0x38c7('0x3d')]?_0x556913[_0x38c7('0x3b')]:_0x5b10bc[_0x38c7('0x36')];if(!_0x5ede2f[_0x38c7('0x38')][_0x38c7('0x3e')]('nolimit')){_0x556913[_0x38c7('0x2b')]=qs[_0x38c7('0x2b')](_0x5ede2f['query']['limit']);_0x556913[_0x38c7('0x2a')]=qs[_0x38c7('0x2a')](_0x5ede2f[_0x38c7('0x38')][_0x38c7('0x2a')]);}_0x556913[_0x38c7('0x3f')]=qs[_0x38c7('0x40')](_0x5ede2f[_0x38c7('0x38')]['sort']);_0x556913['where']=qs['filters'](_['pick'](_0x5ede2f['query'],_0x5b10bc[_0x38c7('0x39')]));if(_0x5ede2f[_0x38c7('0x38')][_0x38c7('0x41')]){_0x556913['where']=_[_0x38c7('0x42')](_0x556913[_0x38c7('0x43')],{'$or':_[_0x38c7('0x44')](_0x267b49,function(_0xe3edab){if(_0xe3edab[_0x38c7('0x45')][_0x38c7('0x46')]!==_0x38c7('0x47')){var _0x16f246={};_0x16f246[_0xe3edab['field']]={'$like':'%'+_0x5ede2f[_0x38c7('0x38')]['filter']+'%'};return _0x16f246;}})});}_0x556913=_[_0x38c7('0x42')]({},_0x556913,_0x5ede2f[_0x38c7('0x48')]);var _0x915efe={'where':_0x556913['where']};return db[_0x38c7('0x49')][_0x38c7('0x29')](_0x915efe)[_0x38c7('0x1b')](function(_0x4eddb2){_0x6cf011['count']=_0x4eddb2;if(_0x5ede2f[_0x38c7('0x38')][_0x38c7('0x4a')]){_0x556913[_0x38c7('0x4b')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x38c7('0x4c')](_0x556913);})[_0x38c7('0x1b')](function(_0x1c5235){_0x6cf011[_0x38c7('0x4d')]=_0x1c5235;return _0x6cf011;})[_0x38c7('0x1b')](respondWithFilteredResult(_0x41e9ec,_0x556913))[_0x38c7('0x24')](handleError(_0x41e9ec,null));};exports[_0x38c7('0x4e')]=function(_0xdec995,_0x2ee179){var _0x20549b={'raw':![],'where':{'id':_0xdec995[_0x38c7('0x4f')]['id']}},_0x479e71={};_0x479e71[_0x38c7('0x36')]=_[_0x38c7('0x37')](db[_0x38c7('0x49')][_0x38c7('0x35')]);_0x479e71['query']=_[_0x38c7('0x37')](_0xdec995[_0x38c7('0x38')]);_0x479e71[_0x38c7('0x39')]=_[_0x38c7('0x3a')](_0x479e71[_0x38c7('0x36')],_0x479e71[_0x38c7('0x38')]);_0x20549b[_0x38c7('0x3b')]=_[_0x38c7('0x3a')](_0x479e71[_0x38c7('0x36')],qs[_0x38c7('0x3c')](_0xdec995['query'][_0x38c7('0x3c')]));_0x20549b['attributes']=_0x20549b[_0x38c7('0x3b')][_0x38c7('0x3d')]?_0x20549b[_0x38c7('0x3b')]:_0x479e71[_0x38c7('0x36')];if(_0xdec995[_0x38c7('0x38')][_0x38c7('0x4a')]){_0x20549b[_0x38c7('0x4b')]=[{'all':!![]}];}_0x20549b=_[_0x38c7('0x42')]({},_0x20549b,_0xdec995[_0x38c7('0x48')]);return db[_0x38c7('0x49')][_0x38c7('0x50')](_0x20549b)[_0x38c7('0x1b')](handleEntityNotFound(_0x2ee179,null))['then'](respondWithResult(_0x2ee179,null))[_0x38c7('0x24')](handleError(_0x2ee179,null));};exports[_0x38c7('0x51')]=function(_0x47a7e3,_0x15401d){return db[_0x38c7('0x49')][_0x38c7('0x51')](_0x47a7e3[_0x38c7('0x52')],{})[_0x38c7('0x1b')](respondWithResult(_0x15401d,0xc9))[_0x38c7('0x24')](handleError(_0x15401d,null));};exports[_0x38c7('0x2f')]=function(_0x14d9bb,_0x57952c){if(_0x14d9bb[_0x38c7('0x52')]['id']){delete _0x14d9bb[_0x38c7('0x52')]['id'];}return db[_0x38c7('0x49')][_0x38c7('0x50')]({'where':{'id':_0x14d9bb[_0x38c7('0x4f')]['id']}})[_0x38c7('0x1b')](handleEntityNotFound(_0x57952c,null))[_0x38c7('0x1b')](saveUpdates(_0x14d9bb[_0x38c7('0x52')],null))['then'](respondWithResult(_0x57952c,null))[_0x38c7('0x24')](handleError(_0x57952c,null));};exports[_0x38c7('0x30')]=function(_0x1901ac,_0x1c2e46){return db['FreshdeskAccount'][_0x38c7('0x50')]({'where':{'id':_0x1901ac['params']['id']}})[_0x38c7('0x1b')](handleEntityNotFound(_0x1c2e46,null))[_0x38c7('0x1b')](removeEntity(_0x1c2e46,null))[_0x38c7('0x24')](handleError(_0x1c2e46,null));};exports[_0x38c7('0x53')]=function(_0x1e6f1a,_0x514939,_0x47df4f){var _0x3efba2={};var _0x2730f5={};var _0x419e33;var _0x392243;return db[_0x38c7('0x49')][_0x38c7('0x54')]({'where':{'id':_0x1e6f1a['params']['id']}})[_0x38c7('0x1b')](handleEntityNotFound(_0x514939,null))['then'](function(_0x302efa){if(_0x302efa){_0x419e33=_0x302efa;_0x2730f5[_0x38c7('0x36')]=_[_0x38c7('0x37')](db[_0x38c7('0x55')]['rawAttributes']);_0x2730f5[_0x38c7('0x38')]=_['keys'](_0x1e6f1a['query']);_0x2730f5[_0x38c7('0x39')]=_[_0x38c7('0x3a')](_0x2730f5[_0x38c7('0x36')],_0x2730f5[_0x38c7('0x38')]);_0x3efba2['attributes']=_['intersection'](_0x2730f5[_0x38c7('0x36')],qs['fields'](_0x1e6f1a[_0x38c7('0x38')][_0x38c7('0x3c')]));_0x3efba2[_0x38c7('0x3b')]=_0x3efba2[_0x38c7('0x3b')]['length']?_0x3efba2['attributes']:_0x2730f5[_0x38c7('0x36')];_0x3efba2[_0x38c7('0x3f')]=qs[_0x38c7('0x40')](_0x1e6f1a[_0x38c7('0x38')][_0x38c7('0x40')]);_0x3efba2[_0x38c7('0x43')]=qs['filters'](_[_0x38c7('0x56')](_0x1e6f1a[_0x38c7('0x38')],_0x2730f5['filters']));if(_0x1e6f1a[_0x38c7('0x38')]['filter']){_0x3efba2['where']=_[_0x38c7('0x42')](_0x3efba2[_0x38c7('0x43')],{'$or':_[_0x38c7('0x44')](_0x3efba2[_0x38c7('0x3b')],function(_0x52a4d3){var _0x1e4741={};_0x1e4741[_0x52a4d3]={'$like':'%'+_0x1e6f1a['query'][_0x38c7('0x41')]+'%'};return _0x1e4741;})});}_0x3efba2=_[_0x38c7('0x42')]({},_0x3efba2,_0x1e6f1a[_0x38c7('0x48')]);return _0x419e33[_0x38c7('0x53')](_0x3efba2);}})[_0x38c7('0x1b')](function(_0x415a05){if(_0x415a05){_0x392243=_0x415a05['length'];if(!_0x1e6f1a['query']['hasOwnProperty'](_0x38c7('0x57'))){_0x3efba2['limit']=qs[_0x38c7('0x2b')](_0x1e6f1a[_0x38c7('0x38')][_0x38c7('0x2b')]);_0x3efba2['offset']=qs[_0x38c7('0x2a')](_0x1e6f1a[_0x38c7('0x38')][_0x38c7('0x2a')]);}return _0x419e33[_0x38c7('0x53')](_0x3efba2);}})['then'](function(_0xe81841){if(_0xe81841){return _0xe81841?{'count':_0x392243,'rows':_0xe81841}:null;}})['then'](respondWithResult(_0x514939,null))[_0x38c7('0x24')](handleError(_0x514939,null));};exports[_0x38c7('0x58')]=function(_0x1f2416,_0x1525ef,_0x6f71f3){if(_0x1f2416[_0x38c7('0x52')]['id']){delete _0x1f2416[_0x38c7('0x52')]['id'];}return db[_0x38c7('0x49')][_0x38c7('0x54')]({'where':{'id':_0x1f2416['params']['id']}})[_0x38c7('0x1b')](handleEntityNotFound(_0x1525ef,null))['then'](function(_0x193c22){if(_0x193c22){_0x1f2416[_0x38c7('0x52')][_0x38c7('0x59')]=_0x193c22['id'];_0x1f2416[_0x38c7('0x52')][_0x38c7('0x5a')]=integrations['getSubjects'](_0x1f2416[_0x38c7('0x52')]['channel'],_0x1f2416[_0x38c7('0x52')]['type']);_0x1f2416[_0x38c7('0x52')][_0x38c7('0x5b')]=integrations[_0x38c7('0x5c')](_0x1f2416[_0x38c7('0x52')][_0x38c7('0x5d')],_0x1f2416[_0x38c7('0x52')]['type']);return db[_0x38c7('0x55')][_0x38c7('0x51')](_0x1f2416[_0x38c7('0x52')],{'include':[{'model':db[_0x38c7('0x5e')],'as':_0x38c7('0x5a')},{'model':db[_0x38c7('0x5e')],'as':'Descriptions'}]});}return null;})[_0x38c7('0x1b')](respondWithResult(_0x1525ef,null))['catch'](handleError(_0x1525ef,null));};exports['getFields']=function(_0x27c826,_0x4ac39f,_0xd1e161){var _0x4804f4='';return db[_0x38c7('0x49')]['findOne']({'where':{'id':_0x27c826[_0x38c7('0x4f')]['id']},'attributes':['id',_0x38c7('0x5f'),_0x38c7('0x60')]})['then'](handleEntityNotFound(_0x4ac39f,null))[_0x38c7('0x1b')](function(_0x1082d7){if(_0x1082d7){_0x4804f4=_0x1082d7['remoteUri'];var _0xfb533b=_0x4804f4[_0x38c7('0x61')](-0x1);if(_0xfb533b==='/'){_0x4804f4=_0x4804f4[_0x38c7('0x62')](0x0,_0x4804f4[_0x38c7('0x63')](_0xfb533b));}return rp({'method':_0x38c7('0x64'),'uri':util['format'](_0x38c7('0x65'),_0x4804f4,_0x38c7('0x66')),'headers':{'Authorization':util['format'](_0x38c7('0x67'),new Buffer(util[_0x38c7('0x68')](_0x38c7('0x69'),_0x1082d7[_0x38c7('0x60')]))[_0x38c7('0x6a')]('base64'))},'json':!![]});}})[_0x38c7('0x1b')](function(_0x13529c){if(_0x13529c){var _0x4af855=['requester','subject',_0x38c7('0x6b'),_0x38c7('0x6c'),_0x38c7('0x26'),'priority',_0x38c7('0x6d'),'source',_0x38c7('0x6e'),_0x38c7('0x6d'),'company'];_[_0x38c7('0x6f')](_0x13529c,function(_0x1af3c0){return _0x4af855[_0x38c7('0x70')](_0x1af3c0[_0x38c7('0x32')])||!_0x1af3c0[_0x38c7('0x71')]&&_0x1af3c0[_0x38c7('0x45')]!==_0x38c7('0x72')&&_0x1af3c0[_0x38c7('0x45')]!==_0x38c7('0x73');});return{'count':_0x13529c[_0x38c7('0x3d')],'rows':_[_0x38c7('0x44')](_0x13529c,function(_0x600d5b){return{'id':_0x600d5b[_0x38c7('0x32')],'name':_0x600d5b[_0x38c7('0x74')],'custom':!_0x600d5b['default'],'options':_0x600d5b[_0x38c7('0x75')]?_[_0x38c7('0x44')](_0x600d5b[_0x38c7('0x75')],function(_0x4d55da){return{'name':_[_0x38c7('0x76')](_0x4d55da),'value':_0x4d55da};}):[]};})};}})[_0x38c7('0x1b')](respondWithResult(_0x4ac39f,null))[_0x38c7('0x24')](function(_0x28d37a){var _0x4a49d8=_0x27c826['query'][_0x38c7('0x19')]?0x1f4:_0x28d37a[_0x38c7('0x77')]||0x1f4;logger['error'](_0x38c7('0x78'),'getFields',_0x4a49d8,JSON['stringify'](_0x28d37a));delete _0x28d37a[_0x38c7('0x32')];if(_0x4a49d8===0x191){_0x4a49d8=0x190;}_0x4ac39f['status'](_0x4a49d8)[_0x38c7('0x33')](_0x27c826[_0x38c7('0x38')][_0x38c7('0x19')]?{'message':'Wrong\x20credentials','statusCode':_0x28d37a[_0x38c7('0x77')]}:_0x28d37a);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 616bce9..a4f28de 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 _0x4d82=['request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4d82,0xfc));var _0x24d8=function(_0x1d850e,_0x723bc4){_0x1d850e=_0x1d850e-0x0;var _0x2efd1f=_0x4d82[_0x1d850e];return _0x2efd1f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x24d8('0x0'));var BPromise=require('bluebird');var rp=require(_0x24d8('0x1'));var fs=require('fs');var path=require(_0x24d8('0x2'));var rimraf=require(_0x24d8('0x3'));var config=require(_0x24d8('0x4'));var attributes=require(_0x24d8('0x5'));var integrations=require(_0x24d8('0x6'));module[_0x24d8('0x7')]=function(_0x1c5c93,_0x2b97d0){return _0x1c5c93[_0x24d8('0x8')](_0x24d8('0x9'),attributes,{'tableName':_0x24d8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a71=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intFreshdeskAccount.attributes','exports','FreshdeskAccount','int_freshdesk_accounts'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4a71,0xa8));var _0x14a7=function(_0x51137b,_0x290050){_0x51137b=_0x51137b-0x0;var _0x53f6cd=_0x4a71[_0x51137b];return _0x53f6cd;};'use strict';var _=require(_0x14a7('0x0'));var util=require(_0x14a7('0x1'));var logger=require(_0x14a7('0x2'))(_0x14a7('0x3'));var moment=require(_0x14a7('0x4'));var BPromise=require(_0x14a7('0x5'));var rp=require(_0x14a7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x14a7('0x7'));var attributes=require(_0x14a7('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x14a7('0x9')]=function(_0xf4370f,_0x219441){return _0xf4370f['define'](_0x14a7('0xa'),attributes,{'tableName':_0x14a7('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 2eb6def..575232d 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 _0x449d=['debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','model','map','stringify','ShowFreshdeskAccount','find','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x1f3c56,_0x598757){var _0x569524=function(_0x345301){while(--_0x345301){_0x1f3c56['push'](_0x1f3c56['shift']());}};_0x569524(++_0x598757);}(_0x449d,0xdf));var _0xd449=function(_0x250b8b,_0x1d3b34){_0x250b8b=_0x250b8b-0x0;var _0x458585=_0x449d[_0x250b8b];return _0x458585;};'use strict';var _=require('lodash');var util=require(_0xd449('0x0'));var moment=require(_0xd449('0x1'));var BPromise=require(_0xd449('0x2'));var rs=require(_0xd449('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd449('0x4'));var logger=require(_0xd449('0x5'))(_0xd449('0x6'));var config=require(_0xd449('0x7'));var jayson=require(_0xd449('0x8'));var client=jayson[_0xd449('0x9')][_0xd449('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6f8848,_0x26cbd3,_0x98192a){return new BPromise(function(_0x92beba,_0x165252){return client['request'](_0x6f8848,_0x98192a)[_0xd449('0xb')](function(_0x232285){logger[_0xd449('0xc')](_0xd449('0xd'),_0x26cbd3,_0xd449('0xe'));logger[_0xd449('0xf')](_0xd449('0x10'),_0x26cbd3,_0xd449('0xe'),JSON['stringify'](_0x232285));if(_0x232285[_0xd449('0x11')]){if(_0x232285[_0xd449('0x11')]['code']===0x1f4){logger[_0xd449('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x26cbd3,_0x232285['error'][_0xd449('0x12')]);return _0x165252(_0x232285[_0xd449('0x11')][_0xd449('0x12')]);}logger[_0xd449('0x11')](_0xd449('0xd'),_0x26cbd3,_0x232285[_0xd449('0x11')][_0xd449('0x12')]);return _0x92beba(_0x232285[_0xd449('0x11')][_0xd449('0x12')]);}else{logger['info'](_0xd449('0xd'),_0x26cbd3,_0xd449('0xe'));_0x92beba(_0x232285['result']['message']);}})[_0xd449('0x13')](function(_0x33eddd){logger['error'](_0xd449('0xd'),_0x26cbd3,_0x33eddd);_0x165252(_0x33eddd);});});}exports[_0xd449('0x14')]=function(_0x3414dd){var _0x453859=this;return new Promise(function(_0x5bd0d6,_0x27a54b){return db[_0xd449('0x15')][_0xd449('0x16')]({'raw':_0x3414dd['options']?_0x3414dd[_0xd449('0x17')][_0xd449('0x18')]===undefined?!![]:![]:!![],'where':_0x3414dd[_0xd449('0x17')]?_0x3414dd['options'][_0xd449('0x19')]||null:null,'attributes':_0x3414dd[_0xd449('0x17')]?_0x3414dd[_0xd449('0x17')][_0xd449('0x1a')]||null:null,'limit':_0x3414dd[_0xd449('0x17')]?_0x3414dd[_0xd449('0x17')][_0xd449('0x1b')]||null:null,'include':_0x3414dd[_0xd449('0x17')]?_0x3414dd[_0xd449('0x17')][_0xd449('0x1c')]?_['map'](_0x3414dd['options'][_0xd449('0x1c')],function(_0x5cbb00){return{'model':db[_0x5cbb00[_0xd449('0x1d')]],'as':_0x5cbb00['as'],'attributes':_0x5cbb00[_0xd449('0x1a')],'include':_0x5cbb00[_0xd449('0x1c')]?_[_0xd449('0x1e')](_0x5cbb00[_0xd449('0x1c')],function(_0x2efde2){return{'model':db[_0x2efde2['model']],'as':_0x2efde2['as'],'attributes':_0x2efde2['attributes'],'include':_0x2efde2[_0xd449('0x1c')]?_[_0xd449('0x1e')](_0x2efde2[_0xd449('0x1c')],function(_0x188050){return{'model':db[_0x188050[_0xd449('0x1d')]],'as':_0x188050['as'],'attributes':_0x188050[_0xd449('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f52f9){logger[_0xd449('0xc')]('GetFreshdeskAccount',_0x3414dd);logger[_0xd449('0xf')](_0xd449('0x14'),_0x3414dd,JSON[_0xd449('0x1f')](_0x5f52f9));_0x5bd0d6(_0x5f52f9);})[_0xd449('0x13')](function(_0x543095){logger[_0xd449('0x11')]('GetFreshdeskAccount',_0x543095[_0xd449('0x12')],_0x3414dd);_0x27a54b(_0x453859[_0xd449('0x11')](0x1f4,_0x543095[_0xd449('0x12')]));});});};exports[_0xd449('0x20')]=function(_0x5b7b27){var _0x4dd694=this;return new Promise(function(_0x47ad9a,_0x13f4e5){return db['FreshdeskAccount'][_0xd449('0x21')]({'raw':_0x5b7b27['options']?_0x5b7b27[_0xd449('0x17')][_0xd449('0x18')]===undefined?!![]:![]:!![],'where':_0x5b7b27[_0xd449('0x17')]?_0x5b7b27[_0xd449('0x17')][_0xd449('0x19')]||null:null,'attributes':_0x5b7b27['options']?_0x5b7b27[_0xd449('0x17')][_0xd449('0x1a')]||null:null,'include':_0x5b7b27[_0xd449('0x17')]?_0x5b7b27[_0xd449('0x17')][_0xd449('0x1c')]?_[_0xd449('0x1e')](_0x5b7b27['options'][_0xd449('0x1c')],function(_0x2eb036){return{'model':db[_0x2eb036[_0xd449('0x1d')]],'as':_0x2eb036['as'],'attributes':_0x2eb036[_0xd449('0x1a')],'include':_0x2eb036[_0xd449('0x1c')]?_[_0xd449('0x1e')](_0x2eb036[_0xd449('0x1c')],function(_0x48e283){return{'model':db[_0x48e283[_0xd449('0x1d')]],'as':_0x48e283['as'],'attributes':_0x48e283[_0xd449('0x1a')],'include':_0x48e283[_0xd449('0x1c')]?_[_0xd449('0x1e')](_0x48e283[_0xd449('0x1c')],function(_0x578e91){return{'model':db[_0x578e91[_0xd449('0x1d')]],'as':_0x578e91['as'],'attributes':_0x578e91[_0xd449('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd449('0xb')](function(_0x7f94b){logger['info'](_0xd449('0x20'),_0x5b7b27);logger['debug'](_0xd449('0x20'),_0x5b7b27,JSON['stringify'](_0x7f94b));_0x47ad9a(_0x7f94b);})['catch'](function(_0x2db77e){logger['error'](_0xd449('0x20'),_0x2db77e[_0xd449('0x12')],_0x5b7b27);_0x13f4e5(_0x4dd694[_0xd449('0x11')](0x1f4,_0x2db77e['message']));});});}; \ No newline at end of file +var _0xd5cc=['ShowFreshdeskAccount','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','include','map','model','attributes','stringify','find','where','then'];(function(_0x101366,_0x1d7ce4){var _0x1e0668=function(_0x2b61c8){while(--_0x2b61c8){_0x101366['push'](_0x101366['shift']());}};_0x1e0668(++_0x1d7ce4);}(_0xd5cc,0x18e));var _0xcd5c=function(_0x431c22,_0x2e0bc5){_0x431c22=_0x431c22-0x0;var _0xfa7fab=_0xd5cc[_0x431c22];return _0xfa7fab;};'use strict';var _=require(_0xcd5c('0x0'));var util=require(_0xcd5c('0x1'));var moment=require(_0xcd5c('0x2'));var BPromise=require('bluebird');var rs=require(_0xcd5c('0x3'));var fs=require('fs');var Redis=require(_0xcd5c('0x4'));var db=require(_0xcd5c('0x5'))['db'];var utils=require(_0xcd5c('0x6'));var logger=require('../../config/logger')(_0xcd5c('0x7'));var config=require(_0xcd5c('0x8'));var jayson=require(_0xcd5c('0x9'));var client=jayson[_0xcd5c('0xa')][_0xcd5c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38e065,_0x1a3385,_0xdb1ee0){return new BPromise(function(_0x532e0b,_0x4338fd){return client['request'](_0x38e065,_0xdb1ee0)['then'](function(_0x227897){logger[_0xcd5c('0xc')](_0xcd5c('0xd'),_0x1a3385,'request\x20sent');logger[_0xcd5c('0xe')](_0xcd5c('0xf'),_0x1a3385,_0xcd5c('0x10'),JSON['stringify'](_0x227897));if(_0x227897['error']){if(_0x227897[_0xcd5c('0x11')][_0xcd5c('0x12')]===0x1f4){logger[_0xcd5c('0x11')](_0xcd5c('0xd'),_0x1a3385,_0x227897[_0xcd5c('0x11')][_0xcd5c('0x13')]);return _0x4338fd(_0x227897[_0xcd5c('0x11')][_0xcd5c('0x13')]);}logger[_0xcd5c('0x11')](_0xcd5c('0xd'),_0x1a3385,_0x227897[_0xcd5c('0x11')]['message']);return _0x532e0b(_0x227897['error']['message']);}else{logger['info'](_0xcd5c('0xd'),_0x1a3385,_0xcd5c('0x10'));_0x532e0b(_0x227897[_0xcd5c('0x14')][_0xcd5c('0x13')]);}})['catch'](function(_0x1af0f0){logger[_0xcd5c('0x11')](_0xcd5c('0xd'),_0x1a3385,_0x1af0f0);_0x4338fd(_0x1af0f0);});});}exports[_0xcd5c('0x15')]=function(_0x5c3332){var _0x46aa3a=this;return new Promise(function(_0x4efc53,_0x1a1ef9){return db[_0xcd5c('0x16')][_0xcd5c('0x17')]({'raw':_0x5c3332[_0xcd5c('0x18')]?_0x5c3332[_0xcd5c('0x18')][_0xcd5c('0x19')]===undefined?!![]:![]:!![],'where':_0x5c3332['options']?_0x5c3332['options']['where']||null:null,'attributes':_0x5c3332[_0xcd5c('0x18')]?_0x5c3332[_0xcd5c('0x18')]['attributes']||null:null,'limit':_0x5c3332[_0xcd5c('0x18')]?_0x5c3332[_0xcd5c('0x18')]['limit']||null:null,'include':_0x5c3332['options']?_0x5c3332[_0xcd5c('0x18')][_0xcd5c('0x1a')]?_[_0xcd5c('0x1b')](_0x5c3332[_0xcd5c('0x18')][_0xcd5c('0x1a')],function(_0x2393db){return{'model':db[_0x2393db[_0xcd5c('0x1c')]],'as':_0x2393db['as'],'attributes':_0x2393db[_0xcd5c('0x1d')],'include':_0x2393db[_0xcd5c('0x1a')]?_[_0xcd5c('0x1b')](_0x2393db['include'],function(_0x5858b7){return{'model':db[_0x5858b7[_0xcd5c('0x1c')]],'as':_0x5858b7['as'],'attributes':_0x5858b7[_0xcd5c('0x1d')],'include':_0x5858b7[_0xcd5c('0x1a')]?_['map'](_0x5858b7[_0xcd5c('0x1a')],function(_0x398639){return{'model':db[_0x398639[_0xcd5c('0x1c')]],'as':_0x398639['as'],'attributes':_0x398639[_0xcd5c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23b09a){logger[_0xcd5c('0xc')](_0xcd5c('0x15'),_0x5c3332);logger['debug']('GetFreshdeskAccount',_0x5c3332,JSON[_0xcd5c('0x1e')](_0x23b09a));_0x4efc53(_0x23b09a);})['catch'](function(_0x1bf288){logger['error']('GetFreshdeskAccount',_0x1bf288[_0xcd5c('0x13')],_0x5c3332);_0x1a1ef9(_0x46aa3a['error'](0x1f4,_0x1bf288['message']));});});};exports['ShowFreshdeskAccount']=function(_0x3dc7cd){var _0x134d2a=this;return new Promise(function(_0x3ba902,_0x274acc){return db[_0xcd5c('0x16')][_0xcd5c('0x1f')]({'raw':_0x3dc7cd[_0xcd5c('0x18')]?_0x3dc7cd[_0xcd5c('0x18')][_0xcd5c('0x19')]===undefined?!![]:![]:!![],'where':_0x3dc7cd[_0xcd5c('0x18')]?_0x3dc7cd[_0xcd5c('0x18')][_0xcd5c('0x20')]||null:null,'attributes':_0x3dc7cd['options']?_0x3dc7cd[_0xcd5c('0x18')][_0xcd5c('0x1d')]||null:null,'include':_0x3dc7cd['options']?_0x3dc7cd[_0xcd5c('0x18')][_0xcd5c('0x1a')]?_['map'](_0x3dc7cd['options'][_0xcd5c('0x1a')],function(_0x30c7c6){return{'model':db[_0x30c7c6[_0xcd5c('0x1c')]],'as':_0x30c7c6['as'],'attributes':_0x30c7c6['attributes'],'include':_0x30c7c6['include']?_[_0xcd5c('0x1b')](_0x30c7c6[_0xcd5c('0x1a')],function(_0x569610){return{'model':db[_0x569610['model']],'as':_0x569610['as'],'attributes':_0x569610[_0xcd5c('0x1d')],'include':_0x569610[_0xcd5c('0x1a')]?_[_0xcd5c('0x1b')](_0x569610['include'],function(_0x2ceb37){return{'model':db[_0x2ceb37[_0xcd5c('0x1c')]],'as':_0x2ceb37['as'],'attributes':_0x2ceb37[_0xcd5c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcd5c('0x21')](function(_0x4690e3){logger[_0xcd5c('0xc')](_0xcd5c('0x22'),_0x3dc7cd);logger['debug'](_0xcd5c('0x22'),_0x3dc7cd,JSON['stringify'](_0x4690e3));_0x3ba902(_0x4690e3);})[_0xcd5c('0x23')](function(_0x168a35){logger[_0xcd5c('0x11')](_0xcd5c('0x22'),_0x168a35[_0xcd5c('0x13')],_0x3dc7cd);_0x274acc(_0x134d2a[_0xcd5c('0x11')](0x1f4,_0x168a35[_0xcd5c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 11dc235..efbe414 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 _0x6c7b=['setTags','put','exports','multer','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post'];(function(_0x1afbfb,_0x112391){var _0x10af98=function(_0x964c87){while(--_0x964c87){_0x1afbfb['push'](_0x1afbfb['shift']());}};_0x10af98(++_0x112391);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x107d7c,_0x41fc1c){_0x107d7c=_0x107d7c-0x0;var _0x4857b3=_0x6c7b[_0x107d7c];return _0x4857b3;};'use strict';var multer=require(_0xb6c7('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb6c7('0x1'));var router=express['Router']();var auth=require(_0xb6c7('0x2'));var interaction=require(_0xb6c7('0x3'));var config=require(_0xb6c7('0x4'));var controller=require('./intFreshdeskConfiguration.controller');router[_0xb6c7('0x5')]('/',auth[_0xb6c7('0x6')](),controller[_0xb6c7('0x7')]);router[_0xb6c7('0x5')](_0xb6c7('0x8'),auth['isAuthenticated'](),controller[_0xb6c7('0x9')]);router[_0xb6c7('0x5')](_0xb6c7('0xa'),auth[_0xb6c7('0x6')](),controller[_0xb6c7('0xb')]);router[_0xb6c7('0x5')](_0xb6c7('0xc'),auth[_0xb6c7('0x6')](),controller['getSubjects']);router['get'](_0xb6c7('0xd'),auth[_0xb6c7('0x6')](),controller[_0xb6c7('0xe')]);router[_0xb6c7('0x5')](_0xb6c7('0xf'),auth[_0xb6c7('0x6')](),controller[_0xb6c7('0x10')]);router['post']('/',auth[_0xb6c7('0x6')](),controller[_0xb6c7('0x11')]);router[_0xb6c7('0x12')](_0xb6c7('0xf'),auth[_0xb6c7('0x6')](),controller[_0xb6c7('0x13')]);router[_0xb6c7('0x14')]('/:id',auth[_0xb6c7('0x6')](),controller['update']);router['delete']('/:id',auth[_0xb6c7('0x6')](),controller['destroy']);module[_0xb6c7('0x15')]=router; \ No newline at end of file +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(_0x4907dd,_0x2d6780){var _0x51eaa8=function(_0x3110eb){while(--_0x3110eb){_0x4907dd['push'](_0x4907dd['shift']());}};_0x51eaa8(++_0x2d6780);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x325462,_0x6573ba){_0x325462=_0x325462-0x0;var _0x3b4f42=_0x6b8f[_0x325462];return _0x3b4f42;};'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 diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index c16a929..cd00af6 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 _0xccf6=['STRING','sequelize'];(function(_0x59dd7d,_0x126583){var _0x12c9db=function(_0x5dd77f){while(--_0x5dd77f){_0x59dd7d['push'](_0x59dd7d['shift']());}};_0x12c9db(++_0x126583);}(_0xccf6,0x105));var _0x6ccf=function(_0x246148,_0x1358ee){_0x246148=_0x246148-0x0;var _0x453d94=_0xccf6[_0x246148];return _0x453d94;};'use strict';var Sequelize=require(_0x6ccf('0x0'));module['exports']={'name':{'type':Sequelize[_0x6ccf('0x1')]},'description':{'type':Sequelize[_0x6ccf('0x1')]}}; \ No newline at end of file +var _0x0a31=['sequelize','exports','STRING'];(function(_0xe40cbd,_0x7114b1){var _0x362362=function(_0x2d0b1f){while(--_0x2d0b1f){_0xe40cbd['push'](_0xe40cbd['shift']());}};_0x362362(++_0x7114b1);}(_0x0a31,0xcc));var _0x10a3=function(_0x1eed05,_0xb211af){_0x1eed05=_0x1eed05-0x0;var _0x134db9=_0x0a31[_0x1eed05];return _0x134db9;};'use strict';var Sequelize=require(_0x10a3('0x0'));module[_0x10a3('0x1')]={'name':{'type':Sequelize[_0x10a3('0x2')]},'description':{'type':Sequelize[_0x10a3('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 86d5c01..356fffb 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 _0xa9e0=['length','find','create','catch','body','params','findOne','FreshdeskField','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','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','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','update','then','destroy','end','stack','name','index','FreshdeskConfiguration','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'];(function(_0x1467a9,_0x130299){var _0x3031d8=function(_0x42625a){while(--_0x42625a){_0x1467a9['push'](_0x1467a9['shift']());}};_0x3031d8(++_0x130299);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var 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')]('FreshdeskConfiguration,\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['create']=function(_0x53975a,_0x39d77d){return db[_0x0a9e('0x32')][_0x0a9e('0x4f')](_0x53975a['body'],{})[_0x0a9e('0x2c')](respondWithResult(_0x39d77d,0xc9))[_0x0a9e('0x50')](handleError(_0x39d77d,null));};exports['update']=function(_0x5a88da,_0x2ef381){if(_0x5a88da['body']['id']){delete _0x5a88da[_0x0a9e('0x51')]['id'];}return db['FreshdeskConfiguration'][_0x0a9e('0x4e')]({'where':{'id':_0x5a88da[_0x0a9e('0x52')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x2ef381,null))['then'](saveUpdates(_0x5a88da[_0x0a9e('0x51')],null))[_0x0a9e('0x2c')](respondWithResult(_0x2ef381,null))['catch'](handleError(_0x2ef381,null));};exports['destroy']=function(_0x128aa6,_0x3aedd0){return db['FreshdeskConfiguration'][_0x0a9e('0x4e')]({'where':{'id':_0x128aa6['params']['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x3aedd0,null))['then'](removeEntity(_0x3aedd0,null))[_0x0a9e('0x50')](handleError(_0x3aedd0,null));};exports['getFields']=function(_0x5da27d,_0x5df0ad,_0x2da03c){var _0x47de4c={};var _0x2f7092={};var _0x65432;var _0x3cfd00;return db[_0x0a9e('0x32')][_0x0a9e('0x53')]({'where':{'id':_0x5da27d[_0x0a9e('0x52')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x5df0ad,null))[_0x0a9e('0x2c')](function(_0x4e67ab){if(_0x4e67ab){_0x65432=_0x4e67ab;_0x2f7092[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x54')][_0x0a9e('0x33')]);_0x2f7092[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x5da27d['query']);_0x2f7092[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2f7092['model'],_0x2f7092[_0x0a9e('0x34')]);_0x47de4c['attributes']=_[_0x0a9e('0x36')](_0x2f7092['model'],qs['fields'](_0x5da27d['query'][_0x0a9e('0x39')]));_0x47de4c['attributes']=_0x47de4c[_0x0a9e('0x38')][_0x0a9e('0x4d')]?_0x47de4c[_0x0a9e('0x38')]:_0x2f7092[_0x0a9e('0x37')];_0x47de4c[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x5da27d['query'][_0x0a9e('0x3d')]);_0x47de4c['where']=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3f')](_0x5da27d[_0x0a9e('0x34')],_0x2f7092['filters']));if(_0x5da27d[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x47de4c[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x47de4c['where'],{'$or':_[_0x0a9e('0x42')](_0x47de4c[_0x0a9e('0x38')],function(_0x54327c){var _0x797b45={};_0x797b45[_0x54327c]={'$like':'%'+_0x5da27d[_0x0a9e('0x34')][_0x0a9e('0x40')]+'%'};return _0x797b45;})});}_0x47de4c=_[_0x0a9e('0x41')]({},_0x47de4c,_0x5da27d[_0x0a9e('0x46')]);return _0x65432['getFields'](_0x47de4c);}})[_0x0a9e('0x2c')](function(_0x2937e0){if(_0x2937e0){_0x3cfd00=_0x2937e0[_0x0a9e('0x4d')];if(!_0x5da27d['query'][_0x0a9e('0x3a')]('nolimit')){_0x47de4c['limit']=qs[_0x0a9e('0x26')](_0x5da27d[_0x0a9e('0x34')][_0x0a9e('0x26')]);_0x47de4c[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x5da27d[_0x0a9e('0x34')][_0x0a9e('0x25')]);}return _0x65432[_0x0a9e('0x55')](_0x47de4c);}})[_0x0a9e('0x2c')](function(_0x1cc4f3){if(_0x1cc4f3){return _0x1cc4f3?{'count':_0x3cfd00,'rows':_0x1cc4f3}:null;}})[_0x0a9e('0x2c')](respondWithResult(_0x5df0ad,null))[_0x0a9e('0x50')](handleError(_0x5df0ad,null));};exports[_0x0a9e('0x56')]=function(_0x2b8192,_0x320898,_0x412a72){var _0x2a28c0={};var _0x4257c9={};var _0x5150a4;var _0x1b0b98;return db[_0x0a9e('0x32')][_0x0a9e('0x53')]({'where':{'id':_0x2b8192['params']['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x320898,null))[_0x0a9e('0x2c')](function(_0x4b341d){if(_0x4b341d){_0x5150a4=_0x4b341d;_0x4257c9[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x54')][_0x0a9e('0x33')]);_0x4257c9[_0x0a9e('0x34')]=_['keys'](_0x2b8192['query']);_0x4257c9['filters']=_[_0x0a9e('0x36')](_0x4257c9[_0x0a9e('0x37')],_0x4257c9[_0x0a9e('0x34')]);_0x2a28c0[_0x0a9e('0x38')]=_[_0x0a9e('0x36')](_0x4257c9[_0x0a9e('0x37')],qs[_0x0a9e('0x39')](_0x2b8192[_0x0a9e('0x34')]['fields']));_0x2a28c0[_0x0a9e('0x38')]=_0x2a28c0[_0x0a9e('0x38')][_0x0a9e('0x4d')]?_0x2a28c0['attributes']:_0x4257c9[_0x0a9e('0x37')];_0x2a28c0['order']=qs[_0x0a9e('0x3d')](_0x2b8192[_0x0a9e('0x34')]['sort']);_0x2a28c0[_0x0a9e('0x3e')]=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3f')](_0x2b8192[_0x0a9e('0x34')],_0x4257c9['filters']));if(_0x2b8192[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x2a28c0[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x2a28c0['where'],{'$or':_[_0x0a9e('0x42')](_0x2a28c0[_0x0a9e('0x38')],function(_0x2d5506){var _0x361b21={};_0x361b21[_0x2d5506]={'$like':'%'+_0x2b8192['query'][_0x0a9e('0x40')]+'%'};return _0x361b21;})});}_0x2a28c0=_[_0x0a9e('0x41')]({},_0x2a28c0,_0x2b8192[_0x0a9e('0x46')]);return _0x5150a4[_0x0a9e('0x56')](_0x2a28c0);}})[_0x0a9e('0x2c')](function(_0xdb98ca){if(_0xdb98ca){_0x1b0b98=_0xdb98ca[_0x0a9e('0x4d')];if(!_0x2b8192[_0x0a9e('0x34')][_0x0a9e('0x3a')](_0x0a9e('0x3b'))){_0x2a28c0[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x2b8192[_0x0a9e('0x34')][_0x0a9e('0x26')]);_0x2a28c0['offset']=qs[_0x0a9e('0x25')](_0x2b8192[_0x0a9e('0x34')][_0x0a9e('0x25')]);}return _0x5150a4['getSubjects'](_0x2a28c0);}})[_0x0a9e('0x2c')](function(_0x33dda0){if(_0x33dda0){return _0x33dda0?{'count':_0x1b0b98,'rows':_0x33dda0}:null;}})[_0x0a9e('0x2c')](respondWithResult(_0x320898,null))[_0x0a9e('0x50')](handleError(_0x320898,null));};exports['getDescriptions']=function(_0x541e80,_0x7ebea8,_0x2bbdb5){var _0x4c54fa={};var _0x45108c={};var _0x53a6a1;var _0x260f4b;return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x541e80[_0x0a9e('0x52')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x7ebea8,null))[_0x0a9e('0x2c')](function(_0x42b959){if(_0x42b959){_0x53a6a1=_0x42b959;_0x45108c[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x54')]['rawAttributes']);_0x45108c[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x541e80[_0x0a9e('0x34')]);_0x45108c[_0x0a9e('0x35')]=_['intersection'](_0x45108c[_0x0a9e('0x37')],_0x45108c[_0x0a9e('0x34')]);_0x4c54fa['attributes']=_[_0x0a9e('0x36')](_0x45108c['model'],qs[_0x0a9e('0x39')](_0x541e80[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x4c54fa[_0x0a9e('0x38')]=_0x4c54fa['attributes']['length']?_0x4c54fa[_0x0a9e('0x38')]:_0x45108c[_0x0a9e('0x37')];_0x4c54fa[_0x0a9e('0x3c')]=qs['sort'](_0x541e80[_0x0a9e('0x34')][_0x0a9e('0x3d')]);_0x4c54fa['where']=qs['filters'](_[_0x0a9e('0x3f')](_0x541e80['query'],_0x45108c['filters']));if(_0x541e80['query'][_0x0a9e('0x40')]){_0x4c54fa[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x4c54fa[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x42')](_0x4c54fa[_0x0a9e('0x38')],function(_0x5a8854){var _0x5fd5db={};_0x5fd5db[_0x5a8854]={'$like':'%'+_0x541e80['query'][_0x0a9e('0x40')]+'%'};return _0x5fd5db;})});}_0x4c54fa=_[_0x0a9e('0x41')]({},_0x4c54fa,_0x541e80[_0x0a9e('0x46')]);return _0x53a6a1[_0x0a9e('0x57')](_0x4c54fa);}})['then'](function(_0x46c9ac){if(_0x46c9ac){_0x260f4b=_0x46c9ac[_0x0a9e('0x4d')];if(!_0x541e80[_0x0a9e('0x34')]['hasOwnProperty'](_0x0a9e('0x3b'))){_0x4c54fa[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x541e80[_0x0a9e('0x34')][_0x0a9e('0x26')]);_0x4c54fa[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x541e80[_0x0a9e('0x34')]['offset']);}return _0x53a6a1[_0x0a9e('0x57')](_0x4c54fa);}})[_0x0a9e('0x2c')](function(_0x589ff3){if(_0x589ff3){return _0x589ff3?{'count':_0x260f4b,'rows':_0x589ff3}:null;}})[_0x0a9e('0x2c')](respondWithResult(_0x7ebea8,null))[_0x0a9e('0x50')](handleError(_0x7ebea8,null));};exports[_0x0a9e('0x58')]=function(_0x5a26c8,_0x96672f,_0x52ec10){var _0x8c8fbe={};var _0x2b5148={};var _0x558a87;var _0x1f29bd;return db[_0x0a9e('0x32')][_0x0a9e('0x53')]({'where':{'id':_0x5a26c8[_0x0a9e('0x52')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x96672f,null))['then'](function(_0x329d88){if(_0x329d88){_0x558a87=_0x329d88;_0x2b5148[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x59')][_0x0a9e('0x33')]);_0x2b5148[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x5a26c8[_0x0a9e('0x34')]);_0x2b5148[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2b5148[_0x0a9e('0x37')],_0x2b5148[_0x0a9e('0x34')]);_0x8c8fbe[_0x0a9e('0x38')]=_['intersection'](_0x2b5148[_0x0a9e('0x37')],qs[_0x0a9e('0x39')](_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x8c8fbe[_0x0a9e('0x38')]=_0x8c8fbe['attributes'][_0x0a9e('0x4d')]?_0x8c8fbe[_0x0a9e('0x38')]:_0x2b5148['model'];_0x8c8fbe[_0x0a9e('0x3c')]=qs['sort'](_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x3d')]);_0x8c8fbe[_0x0a9e('0x3e')]=qs[_0x0a9e('0x35')](_['pick'](_0x5a26c8[_0x0a9e('0x34')],_0x2b5148['filters']));if(_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x8c8fbe['where']=_[_0x0a9e('0x41')](_0x8c8fbe[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x42')](_0x8c8fbe['attributes'],function(_0x4c788f){var _0x1b82b7={};_0x1b82b7[_0x4c788f]={'$like':'%'+_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x40')]+'%'};return _0x1b82b7;})});}_0x8c8fbe=_[_0x0a9e('0x41')]({},_0x8c8fbe,_0x5a26c8[_0x0a9e('0x46')]);return _0x558a87[_0x0a9e('0x58')](_0x8c8fbe);}})[_0x0a9e('0x2c')](function(_0x3c75b9){if(_0x3c75b9){_0x1f29bd=_0x3c75b9[_0x0a9e('0x4d')];if(!_0x5a26c8['query'][_0x0a9e('0x3a')]('nolimit')){_0x8c8fbe[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x26')]);_0x8c8fbe[_0x0a9e('0x25')]=qs['offset'](_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x25')]);}return _0x558a87[_0x0a9e('0x58')](_0x8c8fbe);}})[_0x0a9e('0x2c')](function(_0x2263f1){if(_0x2263f1){return _0x2263f1?{'count':_0x1f29bd,'rows':_0x2263f1}:null;}})['then'](respondWithResult(_0x96672f,null))['catch'](handleError(_0x96672f,null));};exports[_0x0a9e('0x5a')]=function(_0x583662,_0x25eae0,_0x4658df){if(_0x583662[_0x0a9e('0x51')]['id']){delete _0x583662[_0x0a9e('0x51')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x53')]({'where':{'id':_0x583662['params']['id']}})['then'](handleEntityNotFound(_0x25eae0,null))[_0x0a9e('0x2c')](function(_0x5dfbe2){if(_0x5dfbe2){return _0x5dfbe2[_0x0a9e('0x5a')](_0x583662['body'][_0x0a9e('0x5b')]||[]);}return null;})['then'](respondWithResult(_0x25eae0,null))['catch'](handleError(_0x25eae0,null));}; \ No newline at end of file +var _0xa9e0=['length','find','create','catch','body','params','findOne','FreshdeskField','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','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','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','update','then','destroy','end','stack','name','index','FreshdeskConfiguration','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'];(function(_0x1e721d,_0x52c0de){var _0x3acbef=function(_0x48af5d){while(--_0x48af5d){_0x1e721d['push'](_0x1e721d['shift']());}};_0x3acbef(++_0x52c0de);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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')]('FreshdeskConfiguration,\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['create']=function(_0x53975a,_0x39d77d){return db[_0x0a9e('0x32')][_0x0a9e('0x4f')](_0x53975a['body'],{})[_0x0a9e('0x2c')](respondWithResult(_0x39d77d,0xc9))[_0x0a9e('0x50')](handleError(_0x39d77d,null));};exports['update']=function(_0x5a88da,_0x2ef381){if(_0x5a88da['body']['id']){delete _0x5a88da[_0x0a9e('0x51')]['id'];}return db['FreshdeskConfiguration'][_0x0a9e('0x4e')]({'where':{'id':_0x5a88da[_0x0a9e('0x52')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x2ef381,null))['then'](saveUpdates(_0x5a88da[_0x0a9e('0x51')],null))[_0x0a9e('0x2c')](respondWithResult(_0x2ef381,null))['catch'](handleError(_0x2ef381,null));};exports['destroy']=function(_0x128aa6,_0x3aedd0){return db['FreshdeskConfiguration'][_0x0a9e('0x4e')]({'where':{'id':_0x128aa6['params']['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x3aedd0,null))['then'](removeEntity(_0x3aedd0,null))[_0x0a9e('0x50')](handleError(_0x3aedd0,null));};exports['getFields']=function(_0x5da27d,_0x5df0ad,_0x2da03c){var _0x47de4c={};var _0x2f7092={};var _0x65432;var _0x3cfd00;return db[_0x0a9e('0x32')][_0x0a9e('0x53')]({'where':{'id':_0x5da27d[_0x0a9e('0x52')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x5df0ad,null))[_0x0a9e('0x2c')](function(_0x4e67ab){if(_0x4e67ab){_0x65432=_0x4e67ab;_0x2f7092[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x54')][_0x0a9e('0x33')]);_0x2f7092[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x5da27d['query']);_0x2f7092[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2f7092['model'],_0x2f7092[_0x0a9e('0x34')]);_0x47de4c['attributes']=_[_0x0a9e('0x36')](_0x2f7092['model'],qs['fields'](_0x5da27d['query'][_0x0a9e('0x39')]));_0x47de4c['attributes']=_0x47de4c[_0x0a9e('0x38')][_0x0a9e('0x4d')]?_0x47de4c[_0x0a9e('0x38')]:_0x2f7092[_0x0a9e('0x37')];_0x47de4c[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x5da27d['query'][_0x0a9e('0x3d')]);_0x47de4c['where']=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3f')](_0x5da27d[_0x0a9e('0x34')],_0x2f7092['filters']));if(_0x5da27d[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x47de4c[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x47de4c['where'],{'$or':_[_0x0a9e('0x42')](_0x47de4c[_0x0a9e('0x38')],function(_0x54327c){var _0x797b45={};_0x797b45[_0x54327c]={'$like':'%'+_0x5da27d[_0x0a9e('0x34')][_0x0a9e('0x40')]+'%'};return _0x797b45;})});}_0x47de4c=_[_0x0a9e('0x41')]({},_0x47de4c,_0x5da27d[_0x0a9e('0x46')]);return _0x65432['getFields'](_0x47de4c);}})[_0x0a9e('0x2c')](function(_0x2937e0){if(_0x2937e0){_0x3cfd00=_0x2937e0[_0x0a9e('0x4d')];if(!_0x5da27d['query'][_0x0a9e('0x3a')]('nolimit')){_0x47de4c['limit']=qs[_0x0a9e('0x26')](_0x5da27d[_0x0a9e('0x34')][_0x0a9e('0x26')]);_0x47de4c[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x5da27d[_0x0a9e('0x34')][_0x0a9e('0x25')]);}return _0x65432[_0x0a9e('0x55')](_0x47de4c);}})[_0x0a9e('0x2c')](function(_0x1cc4f3){if(_0x1cc4f3){return _0x1cc4f3?{'count':_0x3cfd00,'rows':_0x1cc4f3}:null;}})[_0x0a9e('0x2c')](respondWithResult(_0x5df0ad,null))[_0x0a9e('0x50')](handleError(_0x5df0ad,null));};exports[_0x0a9e('0x56')]=function(_0x2b8192,_0x320898,_0x412a72){var _0x2a28c0={};var _0x4257c9={};var _0x5150a4;var _0x1b0b98;return db[_0x0a9e('0x32')][_0x0a9e('0x53')]({'where':{'id':_0x2b8192['params']['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x320898,null))[_0x0a9e('0x2c')](function(_0x4b341d){if(_0x4b341d){_0x5150a4=_0x4b341d;_0x4257c9[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x54')][_0x0a9e('0x33')]);_0x4257c9[_0x0a9e('0x34')]=_['keys'](_0x2b8192['query']);_0x4257c9['filters']=_[_0x0a9e('0x36')](_0x4257c9[_0x0a9e('0x37')],_0x4257c9[_0x0a9e('0x34')]);_0x2a28c0[_0x0a9e('0x38')]=_[_0x0a9e('0x36')](_0x4257c9[_0x0a9e('0x37')],qs[_0x0a9e('0x39')](_0x2b8192[_0x0a9e('0x34')]['fields']));_0x2a28c0[_0x0a9e('0x38')]=_0x2a28c0[_0x0a9e('0x38')][_0x0a9e('0x4d')]?_0x2a28c0['attributes']:_0x4257c9[_0x0a9e('0x37')];_0x2a28c0['order']=qs[_0x0a9e('0x3d')](_0x2b8192[_0x0a9e('0x34')]['sort']);_0x2a28c0[_0x0a9e('0x3e')]=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3f')](_0x2b8192[_0x0a9e('0x34')],_0x4257c9['filters']));if(_0x2b8192[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x2a28c0[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x2a28c0['where'],{'$or':_[_0x0a9e('0x42')](_0x2a28c0[_0x0a9e('0x38')],function(_0x2d5506){var _0x361b21={};_0x361b21[_0x2d5506]={'$like':'%'+_0x2b8192['query'][_0x0a9e('0x40')]+'%'};return _0x361b21;})});}_0x2a28c0=_[_0x0a9e('0x41')]({},_0x2a28c0,_0x2b8192[_0x0a9e('0x46')]);return _0x5150a4[_0x0a9e('0x56')](_0x2a28c0);}})[_0x0a9e('0x2c')](function(_0xdb98ca){if(_0xdb98ca){_0x1b0b98=_0xdb98ca[_0x0a9e('0x4d')];if(!_0x2b8192[_0x0a9e('0x34')][_0x0a9e('0x3a')](_0x0a9e('0x3b'))){_0x2a28c0[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x2b8192[_0x0a9e('0x34')][_0x0a9e('0x26')]);_0x2a28c0['offset']=qs[_0x0a9e('0x25')](_0x2b8192[_0x0a9e('0x34')][_0x0a9e('0x25')]);}return _0x5150a4['getSubjects'](_0x2a28c0);}})[_0x0a9e('0x2c')](function(_0x33dda0){if(_0x33dda0){return _0x33dda0?{'count':_0x1b0b98,'rows':_0x33dda0}:null;}})[_0x0a9e('0x2c')](respondWithResult(_0x320898,null))[_0x0a9e('0x50')](handleError(_0x320898,null));};exports['getDescriptions']=function(_0x541e80,_0x7ebea8,_0x2bbdb5){var _0x4c54fa={};var _0x45108c={};var _0x53a6a1;var _0x260f4b;return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x541e80[_0x0a9e('0x52')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x7ebea8,null))[_0x0a9e('0x2c')](function(_0x42b959){if(_0x42b959){_0x53a6a1=_0x42b959;_0x45108c[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x54')]['rawAttributes']);_0x45108c[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x541e80[_0x0a9e('0x34')]);_0x45108c[_0x0a9e('0x35')]=_['intersection'](_0x45108c[_0x0a9e('0x37')],_0x45108c[_0x0a9e('0x34')]);_0x4c54fa['attributes']=_[_0x0a9e('0x36')](_0x45108c['model'],qs[_0x0a9e('0x39')](_0x541e80[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x4c54fa[_0x0a9e('0x38')]=_0x4c54fa['attributes']['length']?_0x4c54fa[_0x0a9e('0x38')]:_0x45108c[_0x0a9e('0x37')];_0x4c54fa[_0x0a9e('0x3c')]=qs['sort'](_0x541e80[_0x0a9e('0x34')][_0x0a9e('0x3d')]);_0x4c54fa['where']=qs['filters'](_[_0x0a9e('0x3f')](_0x541e80['query'],_0x45108c['filters']));if(_0x541e80['query'][_0x0a9e('0x40')]){_0x4c54fa[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x4c54fa[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x42')](_0x4c54fa[_0x0a9e('0x38')],function(_0x5a8854){var _0x5fd5db={};_0x5fd5db[_0x5a8854]={'$like':'%'+_0x541e80['query'][_0x0a9e('0x40')]+'%'};return _0x5fd5db;})});}_0x4c54fa=_[_0x0a9e('0x41')]({},_0x4c54fa,_0x541e80[_0x0a9e('0x46')]);return _0x53a6a1[_0x0a9e('0x57')](_0x4c54fa);}})['then'](function(_0x46c9ac){if(_0x46c9ac){_0x260f4b=_0x46c9ac[_0x0a9e('0x4d')];if(!_0x541e80[_0x0a9e('0x34')]['hasOwnProperty'](_0x0a9e('0x3b'))){_0x4c54fa[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x541e80[_0x0a9e('0x34')][_0x0a9e('0x26')]);_0x4c54fa[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x541e80[_0x0a9e('0x34')]['offset']);}return _0x53a6a1[_0x0a9e('0x57')](_0x4c54fa);}})[_0x0a9e('0x2c')](function(_0x589ff3){if(_0x589ff3){return _0x589ff3?{'count':_0x260f4b,'rows':_0x589ff3}:null;}})[_0x0a9e('0x2c')](respondWithResult(_0x7ebea8,null))[_0x0a9e('0x50')](handleError(_0x7ebea8,null));};exports[_0x0a9e('0x58')]=function(_0x5a26c8,_0x96672f,_0x52ec10){var _0x8c8fbe={};var _0x2b5148={};var _0x558a87;var _0x1f29bd;return db[_0x0a9e('0x32')][_0x0a9e('0x53')]({'where':{'id':_0x5a26c8[_0x0a9e('0x52')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x96672f,null))['then'](function(_0x329d88){if(_0x329d88){_0x558a87=_0x329d88;_0x2b5148[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x59')][_0x0a9e('0x33')]);_0x2b5148[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x5a26c8[_0x0a9e('0x34')]);_0x2b5148[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2b5148[_0x0a9e('0x37')],_0x2b5148[_0x0a9e('0x34')]);_0x8c8fbe[_0x0a9e('0x38')]=_['intersection'](_0x2b5148[_0x0a9e('0x37')],qs[_0x0a9e('0x39')](_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x8c8fbe[_0x0a9e('0x38')]=_0x8c8fbe['attributes'][_0x0a9e('0x4d')]?_0x8c8fbe[_0x0a9e('0x38')]:_0x2b5148['model'];_0x8c8fbe[_0x0a9e('0x3c')]=qs['sort'](_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x3d')]);_0x8c8fbe[_0x0a9e('0x3e')]=qs[_0x0a9e('0x35')](_['pick'](_0x5a26c8[_0x0a9e('0x34')],_0x2b5148['filters']));if(_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x8c8fbe['where']=_[_0x0a9e('0x41')](_0x8c8fbe[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x42')](_0x8c8fbe['attributes'],function(_0x4c788f){var _0x1b82b7={};_0x1b82b7[_0x4c788f]={'$like':'%'+_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x40')]+'%'};return _0x1b82b7;})});}_0x8c8fbe=_[_0x0a9e('0x41')]({},_0x8c8fbe,_0x5a26c8[_0x0a9e('0x46')]);return _0x558a87[_0x0a9e('0x58')](_0x8c8fbe);}})[_0x0a9e('0x2c')](function(_0x3c75b9){if(_0x3c75b9){_0x1f29bd=_0x3c75b9[_0x0a9e('0x4d')];if(!_0x5a26c8['query'][_0x0a9e('0x3a')]('nolimit')){_0x8c8fbe[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x26')]);_0x8c8fbe[_0x0a9e('0x25')]=qs['offset'](_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x25')]);}return _0x558a87[_0x0a9e('0x58')](_0x8c8fbe);}})[_0x0a9e('0x2c')](function(_0x2263f1){if(_0x2263f1){return _0x2263f1?{'count':_0x1f29bd,'rows':_0x2263f1}:null;}})['then'](respondWithResult(_0x96672f,null))['catch'](handleError(_0x96672f,null));};exports[_0x0a9e('0x5a')]=function(_0x583662,_0x25eae0,_0x4658df){if(_0x583662[_0x0a9e('0x51')]['id']){delete _0x583662[_0x0a9e('0x51')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x53')]({'where':{'id':_0x583662['params']['id']}})['then'](handleEntityNotFound(_0x25eae0,null))[_0x0a9e('0x2c')](function(_0x5dfbe2){if(_0x5dfbe2){return _0x5dfbe2[_0x0a9e('0x5a')](_0x583662['body'][_0x0a9e('0x5b')]||[]);}return null;})['then'](respondWithResult(_0x25eae0,null))['catch'](handleError(_0x25eae0,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index f703431..bfa9f62 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 _0xfb0b=['moment','bluebird','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','util','api'];(function(_0x51f20c,_0x118582){var _0xd37c5d=function(_0x433657){while(--_0x433657){_0x51f20c['push'](_0x51f20c['shift']());}};_0xd37c5d(++_0x118582);}(_0xfb0b,0xe4));var _0xbfb0=function(_0x367713,_0x271508){_0x367713=_0x367713-0x0;var _0x4ca501=_0xfb0b[_0x367713];return _0x4ca501;};'use strict';var _=require('lodash');var util=require(_0xbfb0('0x0'));var logger=require('../../config/logger')(_0xbfb0('0x1'));var moment=require(_0xbfb0('0x2'));var BPromise=require(_0xbfb0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbfb0('0x4'));var config=require(_0xbfb0('0x5'));var attributes=require(_0xbfb0('0x6'));module[_0xbfb0('0x7')]=function(_0x1148ae,_0x221918){return _0x1148ae[_0xbfb0('0x8')](_0xbfb0('0x9'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x13f4=['FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','moment','bluebird','request-promise','path','./intFreshdeskConfiguration.attributes','define'];(function(_0x444921,_0x19a074){var _0x1d1c5b=function(_0x4007e8){while(--_0x4007e8){_0x444921['push'](_0x444921['shift']());}};_0x1d1c5b(++_0x19a074);}(_0x13f4,0xa2));var _0x413f=function(_0x28fbe3,_0x4ac6f8){_0x28fbe3=_0x28fbe3-0x0;var _0x45db6a=_0x13f4[_0x28fbe3];return _0x45db6a;};'use strict';var _=require(_0x413f('0x0'));var util=require('util');var logger=require(_0x413f('0x1'))('api');var moment=require(_0x413f('0x2'));var BPromise=require(_0x413f('0x3'));var rp=require(_0x413f('0x4'));var fs=require('fs');var path=require(_0x413f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x413f('0x6'));module['exports']=function(_0x1b65da,_0x3539c9){return _0x1b65da[_0x413f('0x7')](_0x413f('0x8'),attributes,{'tableName':_0x413f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index e99f7b2..4f111c8 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 _0x0544=['request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s'];(function(_0x58ee19,_0xdf0765){var _0x49af25=function(_0x109b5e){while(--_0x109b5e){_0x58ee19['push'](_0x58ee19['shift']());}};_0x49af25(++_0xdf0765);}(_0x0544,0xc3));var _0x4054=function(_0x56e32e,_0x9eb2f6){_0x56e32e=_0x56e32e-0x0;var _0x2a757b=_0x0544[_0x56e32e];return _0x2a757b;};'use strict';var _=require(_0x4054('0x0'));var util=require('util');var moment=require(_0x4054('0x1'));var BPromise=require(_0x4054('0x2'));var rs=require(_0x4054('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4054('0x4'))['db'];var utils=require(_0x4054('0x5'));var logger=require('../../config/logger')(_0x4054('0x6'));var config=require(_0x4054('0x7'));var jayson=require(_0x4054('0x8'));var client=jayson[_0x4054('0x9')][_0x4054('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bf398,_0x55e162,_0x24e589){return new BPromise(function(_0x274856,_0x3f2273){return client[_0x4054('0xb')](_0x2bf398,_0x24e589)[_0x4054('0xc')](function(_0x5c8ffa){logger[_0x4054('0xd')](_0x4054('0xe'),_0x55e162,_0x4054('0xf'));logger['debug'](_0x4054('0x10'),_0x55e162,'request\x20sent',JSON['stringify'](_0x5c8ffa));if(_0x5c8ffa[_0x4054('0x11')]){if(_0x5c8ffa[_0x4054('0x11')]['code']===0x1f4){logger[_0x4054('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x55e162,_0x5c8ffa['error'][_0x4054('0x12')]);return _0x3f2273(_0x5c8ffa[_0x4054('0x11')][_0x4054('0x12')]);}logger['error'](_0x4054('0xe'),_0x55e162,_0x5c8ffa[_0x4054('0x11')][_0x4054('0x12')]);return _0x274856(_0x5c8ffa['error']['message']);}else{logger[_0x4054('0xd')](_0x4054('0xe'),_0x55e162,'request\x20sent');_0x274856(_0x5c8ffa[_0x4054('0x13')][_0x4054('0x12')]);}})[_0x4054('0x14')](function(_0x5d1aac){logger[_0x4054('0x11')](_0x4054('0xe'),_0x55e162,_0x5d1aac);_0x3f2273(_0x5d1aac);});});} \ No newline at end of file +var _0x96c7=['moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','lodash','util'];(function(_0x2beb51,_0x38fdcb){var _0x48e3f4=function(_0x55b661){while(--_0x55b661){_0x2beb51['push'](_0x2beb51['shift']());}};_0x48e3f4(++_0x38fdcb);}(_0x96c7,0x7c));var _0x796c=function(_0x33f2cf,_0x867143){_0x33f2cf=_0x33f2cf-0x0;var _0x45435c=_0x96c7[_0x33f2cf];return _0x45435c;};'use strict';var _=require(_0x796c('0x0'));var util=require(_0x796c('0x1'));var moment=require(_0x796c('0x2'));var BPromise=require(_0x796c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x796c('0x4'))(_0x796c('0x5'));var config=require(_0x796c('0x6'));var jayson=require(_0x796c('0x7'));var client=jayson[_0x796c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36a1ec,_0x260bd3,_0x4a82e4){return new BPromise(function(_0x2d0485,_0x450ceb){return client[_0x796c('0x9')](_0x36a1ec,_0x4a82e4)[_0x796c('0xa')](function(_0x53ee74){logger[_0x796c('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x260bd3,_0x796c('0xc'));logger[_0x796c('0xd')](_0x796c('0xe'),_0x260bd3,'request\x20sent',JSON[_0x796c('0xf')](_0x53ee74));if(_0x53ee74[_0x796c('0x10')]){if(_0x53ee74[_0x796c('0x10')][_0x796c('0x11')]===0x1f4){logger[_0x796c('0x10')](_0x796c('0x12'),_0x260bd3,_0x53ee74[_0x796c('0x10')][_0x796c('0x13')]);return _0x450ceb(_0x53ee74[_0x796c('0x10')][_0x796c('0x13')]);}logger[_0x796c('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x260bd3,_0x53ee74[_0x796c('0x10')][_0x796c('0x13')]);return _0x2d0485(_0x53ee74[_0x796c('0x10')][_0x796c('0x13')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x260bd3,'request\x20sent');_0x2d0485(_0x53ee74[_0x796c('0x14')][_0x796c('0x13')]);}})['catch'](function(_0x224d17){logger[_0x796c('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x260bd3,_0x224d17);_0x450ceb(_0x224d17);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 74ba696..b402bd3 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 _0xc474=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','multer','util'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xc474,0xe8));var _0x4c47=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xc474[_0x40220a];return _0x3903cc;};'use strict';var multer=require(_0x4c47('0x0'));var util=require(_0x4c47('0x1'));var path=require('path');var timeout=require(_0x4c47('0x2'));var express=require(_0x4c47('0x3'));var router=express[_0x4c47('0x4')]();var auth=require(_0x4c47('0x5'));var interaction=require(_0x4c47('0x6'));var config=require('../../config/environment');var controller=require(_0x4c47('0x7'));router[_0x4c47('0x8')]('/',auth[_0x4c47('0x9')](),controller[_0x4c47('0xa')]);router[_0x4c47('0x8')](_0x4c47('0xb'),auth[_0x4c47('0x9')](),controller[_0x4c47('0xc')]);router[_0x4c47('0xd')]('/',auth[_0x4c47('0x9')](),controller[_0x4c47('0xe')]);router[_0x4c47('0xf')](_0x4c47('0xb'),auth[_0x4c47('0x9')](),controller['update']);router[_0x4c47('0x10')](_0x4c47('0xb'),auth[_0x4c47('0x9')](),controller[_0x4c47('0x11')]);module['exports']=router; \ No newline at end of file +var _0xe3cf=['multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','index','isAuthenticated','show','post','create','/:id','delete','exports'];(function(_0x267d8d,_0xe90f65){var _0x11a98f=function(_0x5703c9){while(--_0x5703c9){_0x267d8d['push'](_0x267d8d['shift']());}};_0x11a98f(++_0xe90f65);}(_0xe3cf,0x187));var _0xfe3c=function(_0x45a4a9,_0x4d3d85){_0x45a4a9=_0x45a4a9-0x0;var _0x9a3522=_0xe3cf[_0x45a4a9];return _0x9a3522;};'use strict';var multer=require(_0xfe3c('0x0'));var util=require(_0xfe3c('0x1'));var path=require(_0xfe3c('0x2'));var timeout=require(_0xfe3c('0x3'));var express=require('express');var router=express[_0xfe3c('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xfe3c('0x5'));var config=require(_0xfe3c('0x6'));var controller=require(_0xfe3c('0x7'));router[_0xfe3c('0x8')]('/',auth['isAuthenticated'](),controller[_0xfe3c('0x9')]);router[_0xfe3c('0x8')]('/:id',auth[_0xfe3c('0xa')](),controller[_0xfe3c('0xb')]);router[_0xfe3c('0xc')]('/',auth['isAuthenticated'](),controller[_0xfe3c('0xd')]);router['put'](_0xfe3c('0xe'),auth[_0xfe3c('0xa')](),controller['update']);router[_0xfe3c('0xf')](_0xfe3c('0xe'),auth[_0xfe3c('0xa')](),controller['destroy']);module[_0xfe3c('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 88ed2f5..e71dd9e 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 _0x0bb5=['string','STRING','ENUM','BOOLEAN','sequelize','exports','variable','customVariable','keyValue'];(function(_0x3e8270,_0x293590){var _0x1ccde9=function(_0x213490){while(--_0x213490){_0x3e8270['push'](_0x3e8270['shift']());}};_0x1ccde9(++_0x293590);}(_0x0bb5,0x148));var _0x50bb=function(_0x21a995,_0x94ef6a){_0x21a995=_0x21a995-0x0;var _0x5c05c7=_0x0bb5[_0x21a995];return _0x5c05c7;};'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 +var _0x9354=['variable','customVariable','keyValue','string','STRING','BOOLEAN','exports','ENUM'];(function(_0x55c9ad,_0x336e0f){var _0x2acb5d=function(_0x54098e){while(--_0x54098e){_0x55c9ad['push'](_0x55c9ad['shift']());}};_0x2acb5d(++_0x336e0f);}(_0x9354,0x96));var _0x4935=function(_0x28fbe3,_0x4ac6f8){_0x28fbe3=_0x28fbe3-0x0;var _0x45db6a=_0x9354[_0x28fbe3];return _0x45db6a;};'use strict';var Sequelize=require('sequelize');module[_0x4935('0x0')]={'type':{'type':Sequelize[_0x4935('0x1')]('string',_0x4935('0x2'),_0x4935('0x3'),_0x4935('0x4')),'defaultValue':_0x4935('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4935('0x6')]},'keyType':{'type':Sequelize[_0x4935('0x1')](_0x4935('0x5'),_0x4935('0x2'),_0x4935('0x3'))},'keyContent':{'type':Sequelize[_0x4935('0x6')]},'idField':{'type':Sequelize[_0x4935('0x6')]},'nameField':{'type':Sequelize[_0x4935('0x6')]},'customField':{'type':Sequelize[_0x4935('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 02d81c4..b1c5f48 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 _0x4b0c=['filter','options','count','includeAll','include','findAll','catch','show','params','find','create','body','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','end','json','offset','limit','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','FreshdeskField','rawAttributes','model','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','pick','merge','map','type','key','VIRTUAL','field'];(function(_0x40acca,_0x497442){var _0x3b0ce3=function(_0x3adea4){while(--_0x3adea4){_0x40acca['push'](_0x40acca['shift']());}};_0x3b0ce3(++_0x497442);}(_0x4b0c,0x138));var _0xc4b0=function(_0x2ae970,_0x19e1d1){_0x2ae970=_0x2ae970-0x0;var _0x4ce6d2=_0x4b0c[_0x2ae970];return _0x4ce6d2;};'use strict';var pdf=require(_0xc4b0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc4b0('0x1'));var zipdir=require(_0xc4b0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc4b0('0x3'));var moment=require(_0xc4b0('0x4'));var BPromise=require(_0xc4b0('0x5'));var Mustache=require(_0xc4b0('0x6'));var util=require(_0xc4b0('0x7'));var path=require(_0xc4b0('0x8'));var sox=require(_0xc4b0('0x9'));var csv=require(_0xc4b0('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc4b0('0xb'));var squel=require(_0xc4b0('0xc'));var crypto=require(_0xc4b0('0xd'));var jsforce=require(_0xc4b0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc4b0('0xa'));var querystring=require(_0xc4b0('0xf'));var Papa=require(_0xc4b0('0x10'));var Redis=require(_0xc4b0('0x11'));var authService=require(_0xc4b0('0x12'));var qs=require(_0xc4b0('0x13'));var hardwareService=require(_0xc4b0('0x14'));var logger=require(_0xc4b0('0x15'))(_0xc4b0('0x16'));var utils=require(_0xc4b0('0x17'));var config=require(_0xc4b0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc47dd6,_0x57ca5c){_0x57ca5c=_0x57ca5c||0xcc;return function(_0x50ed91){if(_0x50ed91){return _0xc47dd6['sendStatus'](_0x57ca5c);}return _0xc47dd6['status'](_0x57ca5c)[_0xc4b0('0x19')]();};}function respondWithResult(_0x541a64,_0xc464dd){_0xc464dd=_0xc464dd||0xc8;return function(_0x5f74ef){if(_0x5f74ef){return _0x541a64['status'](_0xc464dd)[_0xc4b0('0x1a')](_0x5f74ef);}};}function respondWithFilteredResult(_0x47bd4f,_0x42df04){return function(_0x5ea045){if(_0x5ea045){var _0x3476e0=_0x5ea045['count'],_0xa08988=_0x42df04[_0xc4b0('0x1b')],_0x153ef1=_0x42df04[_0xc4b0('0x1b')]+_0x42df04[_0xc4b0('0x1c')],_0x277bd6;if(_0x153ef1>=_0x3476e0){_0x153ef1=_0x3476e0;_0x277bd6=0xc8;}else{_0x277bd6=0xce;}_0x47bd4f[_0xc4b0('0x1d')](_0x277bd6);return _0x47bd4f[_0xc4b0('0x1e')](_0xc4b0('0x1f'),_0xa08988+'-'+_0x153ef1+'/'+_0x3476e0)[_0xc4b0('0x1a')](_0x5ea045);}return null;};}function patchUpdates(_0x5eb6b8){return function(_0x5ab1c2){try{jsonpatch[_0xc4b0('0x20')](_0x5ab1c2,_0x5eb6b8,!![]);}catch(_0x236961){return BPromise[_0xc4b0('0x21')](_0x236961);}return _0x5ab1c2['save']();};}function saveUpdates(_0x28ecdc,_0x41ab32){return function(_0x548399){if(_0x548399){return _0x548399[_0xc4b0('0x22')](_0x28ecdc)[_0xc4b0('0x23')](function(_0x57e782){return _0x57e782;});}return null;};}function removeEntity(_0x1dc7a8,_0x384b48){return function(_0x3a9e29){if(_0x3a9e29){return _0x3a9e29[_0xc4b0('0x24')]()[_0xc4b0('0x23')](function(){_0x1dc7a8[_0xc4b0('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fb4e0,_0x1d714a){return function(_0xdd3af6){if(!_0xdd3af6){_0x1fb4e0['sendStatus'](0x194);}return _0xdd3af6;};}function handleError(_0x368d7a,_0x205794){_0x205794=_0x205794||0x1f4;return function(_0x3e109f){logger[_0xc4b0('0x25')](_0x3e109f[_0xc4b0('0x26')]);if(_0x3e109f[_0xc4b0('0x27')]){delete _0x3e109f[_0xc4b0('0x27')];}_0x368d7a[_0xc4b0('0x1d')](_0x205794)[_0xc4b0('0x28')](_0x3e109f);};}exports[_0xc4b0('0x29')]=function(_0x31379f,_0x23d40e){var _0x3905e7={},_0x4a02d5={},_0xbf2382={'count':0x0,'rows':[]};var _0x2e679b=db[_0xc4b0('0x2a')][_0xc4b0('0x2b')];_0x4a02d5[_0xc4b0('0x2c')]=_[_0xc4b0('0x2d')](_0x2e679b);_0x4a02d5[_0xc4b0('0x2e')]=_[_0xc4b0('0x2d')](_0x31379f[_0xc4b0('0x2e')]);_0x4a02d5[_0xc4b0('0x2f')]=_[_0xc4b0('0x30')](_0x4a02d5[_0xc4b0('0x2c')],_0x4a02d5[_0xc4b0('0x2e')]);_0x3905e7['attributes']=_[_0xc4b0('0x30')](_0x4a02d5[_0xc4b0('0x2c')],qs['fields'](_0x31379f[_0xc4b0('0x2e')][_0xc4b0('0x31')]));_0x3905e7['attributes']=_0x3905e7['attributes'][_0xc4b0('0x32')]?_0x3905e7[_0xc4b0('0x33')]:_0x4a02d5[_0xc4b0('0x2c')];if(!_0x31379f[_0xc4b0('0x2e')][_0xc4b0('0x34')]('nolimit')){_0x3905e7[_0xc4b0('0x1c')]=qs['limit'](_0x31379f[_0xc4b0('0x2e')][_0xc4b0('0x1c')]);_0x3905e7['offset']=qs[_0xc4b0('0x1b')](_0x31379f[_0xc4b0('0x2e')][_0xc4b0('0x1b')]);}_0x3905e7[_0xc4b0('0x35')]=qs[_0xc4b0('0x36')](_0x31379f[_0xc4b0('0x2e')]['sort']);_0x3905e7[_0xc4b0('0x37')]=qs[_0xc4b0('0x2f')](_[_0xc4b0('0x38')](_0x31379f[_0xc4b0('0x2e')],_0x4a02d5[_0xc4b0('0x2f')]));if(_0x31379f[_0xc4b0('0x2e')]['filter']){_0x3905e7[_0xc4b0('0x37')]=_[_0xc4b0('0x39')](_0x3905e7['where'],{'$or':_[_0xc4b0('0x3a')](_0x2e679b,function(_0x5cb687){if(_0x5cb687[_0xc4b0('0x3b')][_0xc4b0('0x3c')]!==_0xc4b0('0x3d')){var _0x75879a={};_0x75879a[_0x5cb687[_0xc4b0('0x3e')]]={'$like':'%'+_0x31379f[_0xc4b0('0x2e')][_0xc4b0('0x3f')]+'%'};return _0x75879a;}})});}_0x3905e7=_[_0xc4b0('0x39')]({},_0x3905e7,_0x31379f[_0xc4b0('0x40')]);var _0x4d809f={'where':_0x3905e7['where']};return db[_0xc4b0('0x2a')][_0xc4b0('0x41')](_0x4d809f)[_0xc4b0('0x23')](function(_0x2516f0){_0xbf2382[_0xc4b0('0x41')]=_0x2516f0;if(_0x31379f[_0xc4b0('0x2e')][_0xc4b0('0x42')]){_0x3905e7[_0xc4b0('0x43')]=[{'all':!![]}];}return db[_0xc4b0('0x2a')][_0xc4b0('0x44')](_0x3905e7);})[_0xc4b0('0x23')](function(_0x17bf8c){_0xbf2382['rows']=_0x17bf8c;return _0xbf2382;})[_0xc4b0('0x23')](respondWithFilteredResult(_0x23d40e,_0x3905e7))[_0xc4b0('0x45')](handleError(_0x23d40e,null));};exports[_0xc4b0('0x46')]=function(_0x5dff89,_0xe3aa5c){var _0x4443d9={'raw':!![],'where':{'id':_0x5dff89[_0xc4b0('0x47')]['id']}},_0x52b41b={};_0x52b41b['model']=_['keys'](db[_0xc4b0('0x2a')]['rawAttributes']);_0x52b41b[_0xc4b0('0x2e')]=_[_0xc4b0('0x2d')](_0x5dff89['query']);_0x52b41b[_0xc4b0('0x2f')]=_[_0xc4b0('0x30')](_0x52b41b[_0xc4b0('0x2c')],_0x52b41b[_0xc4b0('0x2e')]);_0x4443d9['attributes']=_[_0xc4b0('0x30')](_0x52b41b['model'],qs[_0xc4b0('0x31')](_0x5dff89[_0xc4b0('0x2e')]['fields']));_0x4443d9[_0xc4b0('0x33')]=_0x4443d9[_0xc4b0('0x33')][_0xc4b0('0x32')]?_0x4443d9[_0xc4b0('0x33')]:_0x52b41b[_0xc4b0('0x2c')];if(_0x5dff89[_0xc4b0('0x2e')][_0xc4b0('0x42')]){_0x4443d9['include']=[{'all':!![]}];}_0x4443d9=_[_0xc4b0('0x39')]({},_0x4443d9,_0x5dff89['options']);return db[_0xc4b0('0x2a')][_0xc4b0('0x48')](_0x4443d9)['then'](handleEntityNotFound(_0xe3aa5c,null))[_0xc4b0('0x23')](respondWithResult(_0xe3aa5c,null))[_0xc4b0('0x45')](handleError(_0xe3aa5c,null));};exports[_0xc4b0('0x49')]=function(_0x49bf3e,_0x4767a0){return db[_0xc4b0('0x2a')][_0xc4b0('0x49')](_0x49bf3e['body'],{})[_0xc4b0('0x23')](respondWithResult(_0x4767a0,0xc9))['catch'](handleError(_0x4767a0,null));};exports[_0xc4b0('0x22')]=function(_0x3d36a2,_0x52b5f4){if(_0x3d36a2['body']['id']){delete _0x3d36a2[_0xc4b0('0x4a')]['id'];}return db[_0xc4b0('0x2a')][_0xc4b0('0x48')]({'where':{'id':_0x3d36a2['params']['id']}})['then'](handleEntityNotFound(_0x52b5f4,null))[_0xc4b0('0x23')](saveUpdates(_0x3d36a2[_0xc4b0('0x4a')],null))['then'](respondWithResult(_0x52b5f4,null))[_0xc4b0('0x45')](handleError(_0x52b5f4,null));};exports['destroy']=function(_0x4a982b,_0x3291c0){return db[_0xc4b0('0x2a')][_0xc4b0('0x48')]({'where':{'id':_0x4a982b['params']['id']}})['then'](handleEntityNotFound(_0x3291c0,null))['then'](removeEntity(_0x3291c0,null))[_0xc4b0('0x45')](handleError(_0x3291c0,null));}; \ No newline at end of file +var _0xd13e=['bluebird','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','update','destroy','then','error','stack','name','send','index','rawAttributes','model','query','keys','intersection','attributes','fields','length','order','sort','filters','pick','filter','where','merge','map','type','key','FreshdeskField','include','findAll','catch','show','params','includeAll','options','body','find','html-pdf','eml-format','rimraf','zip-dir','request-promise'];(function(_0x59e7e0,_0x3ec148){var _0x26b058=function(_0x212ee2){while(--_0x212ee2){_0x59e7e0['push'](_0x59e7e0['shift']());}};_0x26b058(++_0x3ec148);}(_0xd13e,0x193));var _0xed13=function(_0x1db6f9,_0x4eafe7){_0x1db6f9=_0x1db6f9-0x0;var _0x282d19=_0xd13e[_0x1db6f9];return _0x282d19;};'use strict';var pdf=require(_0xed13('0x0'));var emlformat=require(_0xed13('0x1'));var rimraf=require(_0xed13('0x2'));var zipdir=require(_0xed13('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xed13('0x4'));var moment=require('moment');var BPromise=require(_0xed13('0x5'));var Mustache=require('mustache');var util=require(_0xed13('0x6'));var path=require(_0xed13('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xed13('0x8'));var squel=require(_0xed13('0x9'));var crypto=require(_0xed13('0xa'));var jsforce=require(_0xed13('0xb'));var deskjs=require(_0xed13('0xc'));var toCsv=require(_0xed13('0xd'));var querystring=require(_0xed13('0xe'));var Papa=require(_0xed13('0xf'));var Redis=require(_0xed13('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xed13('0x11'));var hardwareService=require(_0xed13('0x12'));var logger=require(_0xed13('0x13'))(_0xed13('0x14'));var utils=require(_0xed13('0x15'));var config=require('../../config/environment');var db=require(_0xed13('0x16'))['db'];function respondWithStatusCode(_0x18d7f9,_0x2c68db){_0x2c68db=_0x2c68db||0xcc;return function(_0x3c0b22){if(_0x3c0b22){return _0x18d7f9[_0xed13('0x17')](_0x2c68db);}return _0x18d7f9[_0xed13('0x18')](_0x2c68db)['end']();};}function respondWithResult(_0xdee482,_0x4a3ff4){_0x4a3ff4=_0x4a3ff4||0xc8;return function(_0x257074){if(_0x257074){return _0xdee482['status'](_0x4a3ff4)[_0xed13('0x19')](_0x257074);}};}function respondWithFilteredResult(_0x56108d,_0x1de882){return function(_0x4d5435){if(_0x4d5435){var _0x38901a=_0x4d5435[_0xed13('0x1a')],_0xf900d2=_0x1de882[_0xed13('0x1b')],_0x1d3d67=_0x1de882[_0xed13('0x1b')]+_0x1de882[_0xed13('0x1c')],_0xa260ed;if(_0x1d3d67>=_0x38901a){_0x1d3d67=_0x38901a;_0xa260ed=0xc8;}else{_0xa260ed=0xce;}_0x56108d[_0xed13('0x18')](_0xa260ed);return _0x56108d[_0xed13('0x1d')](_0xed13('0x1e'),_0xf900d2+'-'+_0x1d3d67+'/'+_0x38901a)[_0xed13('0x19')](_0x4d5435);}return null;};}function patchUpdates(_0x2893d2){return function(_0xaa6f5){try{jsonpatch[_0xed13('0x1f')](_0xaa6f5,_0x2893d2,!![]);}catch(_0x2f38c9){return BPromise['reject'](_0x2f38c9);}return _0xaa6f5['save']();};}function saveUpdates(_0x1f3646,_0xfd0dd5){return function(_0x4f455b){if(_0x4f455b){return _0x4f455b[_0xed13('0x20')](_0x1f3646)['then'](function(_0x4e9e3b){return _0x4e9e3b;});}return null;};}function removeEntity(_0x3b5b1e,_0x3a2b76){return function(_0x2d62cd){if(_0x2d62cd){return _0x2d62cd[_0xed13('0x21')]()[_0xed13('0x22')](function(){_0x3b5b1e[_0xed13('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c0daf,_0x5d7ae1){return function(_0x19d51b){if(!_0x19d51b){_0x5c0daf[_0xed13('0x17')](0x194);}return _0x19d51b;};}function handleError(_0x3f5b68,_0x3898d9){_0x3898d9=_0x3898d9||0x1f4;return function(_0x1a0458){logger[_0xed13('0x23')](_0x1a0458[_0xed13('0x24')]);if(_0x1a0458[_0xed13('0x25')]){delete _0x1a0458[_0xed13('0x25')];}_0x3f5b68[_0xed13('0x18')](_0x3898d9)[_0xed13('0x26')](_0x1a0458);};}exports[_0xed13('0x27')]=function(_0x2c6c33,_0x322fc3){var _0x4e03d1={},_0x5e399c={},_0x12a019={'count':0x0,'rows':[]};var _0x2ebdf6=db['FreshdeskField'][_0xed13('0x28')];_0x5e399c[_0xed13('0x29')]=_['keys'](_0x2ebdf6);_0x5e399c[_0xed13('0x2a')]=_[_0xed13('0x2b')](_0x2c6c33[_0xed13('0x2a')]);_0x5e399c['filters']=_[_0xed13('0x2c')](_0x5e399c[_0xed13('0x29')],_0x5e399c['query']);_0x4e03d1[_0xed13('0x2d')]=_[_0xed13('0x2c')](_0x5e399c['model'],qs[_0xed13('0x2e')](_0x2c6c33[_0xed13('0x2a')][_0xed13('0x2e')]));_0x4e03d1[_0xed13('0x2d')]=_0x4e03d1[_0xed13('0x2d')][_0xed13('0x2f')]?_0x4e03d1[_0xed13('0x2d')]:_0x5e399c['model'];if(!_0x2c6c33[_0xed13('0x2a')]['hasOwnProperty']('nolimit')){_0x4e03d1[_0xed13('0x1c')]=qs[_0xed13('0x1c')](_0x2c6c33[_0xed13('0x2a')]['limit']);_0x4e03d1[_0xed13('0x1b')]=qs[_0xed13('0x1b')](_0x2c6c33[_0xed13('0x2a')]['offset']);}_0x4e03d1[_0xed13('0x30')]=qs[_0xed13('0x31')](_0x2c6c33[_0xed13('0x2a')][_0xed13('0x31')]);_0x4e03d1['where']=qs[_0xed13('0x32')](_[_0xed13('0x33')](_0x2c6c33[_0xed13('0x2a')],_0x5e399c[_0xed13('0x32')]));if(_0x2c6c33[_0xed13('0x2a')][_0xed13('0x34')]){_0x4e03d1[_0xed13('0x35')]=_[_0xed13('0x36')](_0x4e03d1[_0xed13('0x35')],{'$or':_[_0xed13('0x37')](_0x2ebdf6,function(_0x5a09e4){if(_0x5a09e4[_0xed13('0x38')][_0xed13('0x39')]!=='VIRTUAL'){var _0x59218d={};_0x59218d[_0x5a09e4['field']]={'$like':'%'+_0x2c6c33[_0xed13('0x2a')][_0xed13('0x34')]+'%'};return _0x59218d;}})});}_0x4e03d1=_['merge']({},_0x4e03d1,_0x2c6c33['options']);var _0x1781c6={'where':_0x4e03d1[_0xed13('0x35')]};return db[_0xed13('0x3a')][_0xed13('0x1a')](_0x1781c6)[_0xed13('0x22')](function(_0x49bf50){_0x12a019['count']=_0x49bf50;if(_0x2c6c33[_0xed13('0x2a')]['includeAll']){_0x4e03d1[_0xed13('0x3b')]=[{'all':!![]}];}return db['FreshdeskField'][_0xed13('0x3c')](_0x4e03d1);})['then'](function(_0x4d6429){_0x12a019['rows']=_0x4d6429;return _0x12a019;})[_0xed13('0x22')](respondWithFilteredResult(_0x322fc3,_0x4e03d1))[_0xed13('0x3d')](handleError(_0x322fc3,null));};exports[_0xed13('0x3e')]=function(_0x42d5f7,_0x2d29aa){var _0x56ae05={'raw':!![],'where':{'id':_0x42d5f7[_0xed13('0x3f')]['id']}},_0xb52363={};_0xb52363[_0xed13('0x29')]=_[_0xed13('0x2b')](db[_0xed13('0x3a')]['rawAttributes']);_0xb52363[_0xed13('0x2a')]=_[_0xed13('0x2b')](_0x42d5f7[_0xed13('0x2a')]);_0xb52363[_0xed13('0x32')]=_[_0xed13('0x2c')](_0xb52363[_0xed13('0x29')],_0xb52363['query']);_0x56ae05[_0xed13('0x2d')]=_[_0xed13('0x2c')](_0xb52363[_0xed13('0x29')],qs[_0xed13('0x2e')](_0x42d5f7[_0xed13('0x2a')][_0xed13('0x2e')]));_0x56ae05[_0xed13('0x2d')]=_0x56ae05[_0xed13('0x2d')][_0xed13('0x2f')]?_0x56ae05[_0xed13('0x2d')]:_0xb52363[_0xed13('0x29')];if(_0x42d5f7[_0xed13('0x2a')][_0xed13('0x40')]){_0x56ae05[_0xed13('0x3b')]=[{'all':!![]}];}_0x56ae05=_['merge']({},_0x56ae05,_0x42d5f7[_0xed13('0x41')]);return db[_0xed13('0x3a')]['find'](_0x56ae05)[_0xed13('0x22')](handleEntityNotFound(_0x2d29aa,null))[_0xed13('0x22')](respondWithResult(_0x2d29aa,null))[_0xed13('0x3d')](handleError(_0x2d29aa,null));};exports['create']=function(_0x257d8b,_0x2afab0){return db[_0xed13('0x3a')]['create'](_0x257d8b['body'],{})[_0xed13('0x22')](respondWithResult(_0x2afab0,0xc9))[_0xed13('0x3d')](handleError(_0x2afab0,null));};exports['update']=function(_0x848f0f,_0x3c0dd9){if(_0x848f0f[_0xed13('0x42')]['id']){delete _0x848f0f[_0xed13('0x42')]['id'];}return db['FreshdeskField'][_0xed13('0x43')]({'where':{'id':_0x848f0f[_0xed13('0x3f')]['id']}})[_0xed13('0x22')](handleEntityNotFound(_0x3c0dd9,null))[_0xed13('0x22')](saveUpdates(_0x848f0f['body'],null))[_0xed13('0x22')](respondWithResult(_0x3c0dd9,null))['catch'](handleError(_0x3c0dd9,null));};exports[_0xed13('0x21')]=function(_0x50d12f,_0x5a0828){return db[_0xed13('0x3a')][_0xed13('0x43')]({'where':{'id':_0x50d12f['params']['id']}})[_0xed13('0x22')](handleEntityNotFound(_0x5a0828,null))[_0xed13('0x22')](removeEntity(_0x5a0828,null))[_0xed13('0x3d')](handleError(_0x5a0828,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 1bf60ba..a1adfb9 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 _0xdf5d=['int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField'];(function(_0x34b0bf,_0x29f321){var _0x21d3a0=function(_0x4471f5){while(--_0x4471f5){_0x34b0bf['push'](_0x34b0bf['shift']());}};_0x21d3a0(++_0x29f321);}(_0xdf5d,0x19a));var _0xddf5=function(_0x14e1f2,_0x52ac2e){_0x14e1f2=_0x14e1f2-0x0;var _0x2def6d=_0xdf5d[_0x14e1f2];return _0x2def6d;};'use strict';var _=require('lodash');var util=require(_0xddf5('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xddf5('0x1'));var BPromise=require(_0xddf5('0x2'));var rp=require(_0xddf5('0x3'));var fs=require('fs');var path=require(_0xddf5('0x4'));var rimraf=require(_0xddf5('0x5'));var config=require(_0xddf5('0x6'));var attributes=require(_0xddf5('0x7'));module['exports']=function(_0x2fdd64,_0x3e8451){return _0x2fdd64[_0xddf5('0x8')](_0xddf5('0x9'),attributes,{'tableName':_0xddf5('0xa'),'paranoid':![],'indexes':[{'name':_0xddf5('0xb'),'fields':[_0xddf5('0xc'),_0xddf5('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8a8d=['path','rimraf','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','idField','FieldId','lodash','api','moment','bluebird','request-promise'];(function(_0x40730a,_0x5de635){var _0x4a74c9=function(_0x5ad86e){while(--_0x5ad86e){_0x40730a['push'](_0x40730a['shift']());}};_0x4a74c9(++_0x5de635);}(_0x8a8d,0x79));var _0xd8a8=function(_0x454f25,_0x184ec5){_0x454f25=_0x454f25-0x0;var _0x37041a=_0x8a8d[_0x454f25];return _0x37041a;};'use strict';var _=require(_0xd8a8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd8a8('0x1'));var moment=require(_0xd8a8('0x2'));var BPromise=require(_0xd8a8('0x3'));var rp=require(_0xd8a8('0x4'));var fs=require('fs');var path=require(_0xd8a8('0x5'));var rimraf=require(_0xd8a8('0x6'));var config=require('../../config/environment');var attributes=require(_0xd8a8('0x7'));module[_0xd8a8('0x8')]=function(_0xd1437,_0x34bee6){return _0xd1437[_0xd8a8('0x9')](_0xd8a8('0xa'),attributes,{'tableName':_0xd8a8('0xb'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xd8a8('0xc'),_0xd8a8('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 3bdbae4..4e9a5ba 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 _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(_0x4b8080,_0x186445){var _0x4bbe8f=function(_0x24c8be){while(--_0x24c8be){_0x4b8080['push'](_0x4b8080['shift']());}};_0x4bbe8f(++_0x186445);}(_0x3140,0xaf));var _0x0314=function(_0x336ca2,_0x1a813a){_0x336ca2=_0x336ca2-0x0;var _0xda59a6=_0x3140[_0x336ca2];return _0xda59a6;};'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 +var _0xd691=['jayson/promise','client','http','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x514678,_0x878a85){var _0x512a63=function(_0x2ac61e){while(--_0x2ac61e){_0x514678['push'](_0x514678['shift']());}};_0x512a63(++_0x878a85);}(_0xd691,0xe6));var _0x1d69=function(_0x2a40b3,_0xe1c253){_0x2a40b3=_0x2a40b3-0x0;var _0x4ac6cb=_0xd691[_0x2a40b3];return _0x4ac6cb;};'use strict';var _=require(_0x1d69('0x0'));var util=require(_0x1d69('0x1'));var moment=require(_0x1d69('0x2'));var BPromise=require('bluebird');var rs=require(_0x1d69('0x3'));var fs=require('fs');var Redis=require(_0x1d69('0x4'));var db=require(_0x1d69('0x5'))['db'];var utils=require(_0x1d69('0x6'));var logger=require(_0x1d69('0x7'))(_0x1d69('0x8'));var config=require(_0x1d69('0x9'));var jayson=require(_0x1d69('0xa'));var client=jayson[_0x1d69('0xb')][_0x1d69('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a5b0c,_0x520acb,_0x267da3){return new BPromise(function(_0x49f008,_0x369d44){return client[_0x1d69('0xd')](_0x5a5b0c,_0x267da3)[_0x1d69('0xe')](function(_0x364061){logger['info'](_0x1d69('0xf'),_0x520acb,_0x1d69('0x10'));logger[_0x1d69('0x11')](_0x1d69('0x12'),_0x520acb,_0x1d69('0x10'),JSON['stringify'](_0x364061));if(_0x364061['error']){if(_0x364061[_0x1d69('0x13')][_0x1d69('0x14')]===0x1f4){logger[_0x1d69('0x13')](_0x1d69('0xf'),_0x520acb,_0x364061[_0x1d69('0x13')][_0x1d69('0x15')]);return _0x369d44(_0x364061[_0x1d69('0x13')][_0x1d69('0x15')]);}logger[_0x1d69('0x13')](_0x1d69('0xf'),_0x520acb,_0x364061[_0x1d69('0x13')][_0x1d69('0x15')]);return _0x49f008(_0x364061[_0x1d69('0x13')]['message']);}else{logger['info'](_0x1d69('0xf'),_0x520acb,_0x1d69('0x10'));_0x49f008(_0x364061[_0x1d69('0x16')][_0x1d69('0x15')]);}})[_0x1d69('0x17')](function(_0x383771){logger['error'](_0x1d69('0xf'),_0x520acb,_0x383771);_0x369d44(_0x383771);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 2e1373b..6695381 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 _0x8db6=['post','create','addConfiguration','/:id','update','destroy','exports','multer','util','path','express','../../components/auth/service','../../config/environment','./intSalesforceAccount.controller','isAuthenticated','index','show','getConfigurations','get','/:id/fields'];(function(_0x270b81,_0x5e6f16){var _0x244ac5=function(_0x5e6d17){while(--_0x5e6d17){_0x270b81['push'](_0x270b81['shift']());}};_0x244ac5(++_0x5e6f16);}(_0x8db6,0xf7));var _0x68db=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x8db6[_0x3e112d];return _0x531c31;};'use strict';var multer=require(_0x68db('0x0'));var util=require(_0x68db('0x1'));var path=require(_0x68db('0x2'));var timeout=require('connect-timeout');var express=require(_0x68db('0x3'));var router=express['Router']();var auth=require(_0x68db('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x68db('0x5'));var controller=require(_0x68db('0x6'));router['get']('/',auth[_0x68db('0x7')](),controller[_0x68db('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x68db('0x9')]);router['get']('/:id/configurations',auth[_0x68db('0x7')](),controller[_0x68db('0xa')]);router[_0x68db('0xb')](_0x68db('0xc'),auth[_0x68db('0x7')](),controller['getFields']);router[_0x68db('0xd')]('/',auth[_0x68db('0x7')](),controller[_0x68db('0xe')]);router['post']('/:id/configurations',auth[_0x68db('0x7')](),controller[_0x68db('0xf')]);router['put'](_0x68db('0x10'),auth[_0x68db('0x7')](),controller[_0x68db('0x11')]);router['delete'](_0x68db('0x10'),auth['isAuthenticated'](),controller[_0x68db('0x12')]);module[_0x68db('0x13')]=router; \ No newline at end of file +var _0xb0c1=['util','path','connect-timeout','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','exports'];(function(_0x1c2831,_0x3fca61){var _0x425ea1=function(_0x3f09bb){while(--_0x3f09bb){_0x1c2831['push'](_0x1c2831['shift']());}};_0x425ea1(++_0x3fca61);}(_0xb0c1,0x1ee));var _0x1b0c=function(_0x1c245b,_0x4ed3aa){_0x1c245b=_0x1c245b-0x0;var _0x3cfe57=_0xb0c1[_0x1c245b];return _0x3cfe57;};'use strict';var multer=require('multer');var util=require(_0x1b0c('0x0'));var path=require(_0x1b0c('0x1'));var timeout=require(_0x1b0c('0x2'));var express=require('express');var router=express[_0x1b0c('0x3')]();var auth=require(_0x1b0c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSalesforceAccount.controller');router[_0x1b0c('0x5')]('/',auth[_0x1b0c('0x6')](),controller[_0x1b0c('0x7')]);router[_0x1b0c('0x5')](_0x1b0c('0x8'),auth[_0x1b0c('0x6')](),controller[_0x1b0c('0x9')]);router[_0x1b0c('0x5')](_0x1b0c('0xa'),auth[_0x1b0c('0x6')](),controller['getConfigurations']);router[_0x1b0c('0x5')](_0x1b0c('0xb'),auth[_0x1b0c('0x6')](),controller[_0x1b0c('0xc')]);router[_0x1b0c('0xd')]('/',auth[_0x1b0c('0x6')](),controller[_0x1b0c('0xe')]);router['post'](_0x1b0c('0xa'),auth[_0x1b0c('0x6')](),controller[_0x1b0c('0xf')]);router[_0x1b0c('0x10')](_0x1b0c('0x8'),auth[_0x1b0c('0x6')](),controller['update']);router[_0x1b0c('0x11')](_0x1b0c('0x8'),auth[_0x1b0c('0x6')](),controller['destroy']);module[_0x1b0c('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 3521149..09be3e9 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 _0xa239=['STRING','username','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa239,0x1b7));var _0x9a23=function(_0x14a32b,_0x11df35){_0x14a32b=_0x14a32b-0x0;var _0x360a53=_0xa239[_0x14a32b];return _0x360a53;};'use strict';var Sequelize=require(_0x9a23('0x0'));module[_0x9a23('0x1')]={'name':{'type':Sequelize[_0x9a23('0x2')]},'description':{'type':Sequelize[_0x9a23('0x2')]},'username':{'type':Sequelize[_0x9a23('0x2')],'unique':_0x9a23('0x3')},'remoteUri':{'type':Sequelize[_0x9a23('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x9a23('0x2')]},'clientSecret':{'type':Sequelize[_0x9a23('0x2')]},'securityToken':{'type':Sequelize[_0x9a23('0x2')]},'serverUrl':{'type':Sequelize[_0x9a23('0x2')]},'type':{'type':Sequelize[_0x9a23('0x4')](_0x9a23('0x5'),_0x9a23('0x6')),'defaultValue':_0x9a23('0x5')}}; \ No newline at end of file +var _0x53ae=['exports','STRING','ENUM','integrationTab','newTab','sequelize'];(function(_0x5e94ec,_0x3dcc8a){var _0x516d10=function(_0x48c2f4){while(--_0x48c2f4){_0x5e94ec['push'](_0x5e94ec['shift']());}};_0x516d10(++_0x3dcc8a);}(_0x53ae,0x71));var _0xe53a=function(_0xef9e00,_0x24d903){_0xef9e00=_0xef9e00-0x0;var _0x38d071=_0x53ae[_0xef9e00];return _0x38d071;};'use strict';var Sequelize=require(_0xe53a('0x0'));module[_0xe53a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe53a('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0xe53a('0x2')]},'password':{'type':Sequelize[_0xe53a('0x2')]},'clientId':{'type':Sequelize[_0xe53a('0x2')]},'clientSecret':{'type':Sequelize[_0xe53a('0x2')]},'securityToken':{'type':Sequelize[_0xe53a('0x2')]},'serverUrl':{'type':Sequelize[_0xe53a('0x2')]},'type':{'type':Sequelize[_0xe53a('0x3')](_0xe53a('0x4'),_0xe53a('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 59a8b2c..62685fc 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 _0x8d97=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','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','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','limit','set','Content-Range','json','apply','reject','update','destroy','stack','name','send','index','SalesforceAccount','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','type','key','field','options','count','includeAll','include','catch','params','find','create','body','getConfigurations','findOne','SalesforceConfiguration','map','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','remoteUri','clientId','username','securityToken','lastIndexOf','Connection','clientSecret','concat','ticketType','sobject','describe','CallDisposition','CallDurationInSeconds','CallObject','CallType','IsArchived','Priority','Status','Type','isNil','Case','Reason','IsEscalated','SuppliedName','SuppliedCompany','label','custom','picklistValues','boolean','True','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode'];(function(_0x17d45b,_0x41abad){var _0x2755ca=function(_0x45879d){while(--_0x45879d){_0x17d45b['push'](_0x17d45b['shift']());}};_0x2755ca(++_0x41abad);}(_0x8d97,0x82));var _0x78d9=function(_0x31a65c,_0x39b23a){_0x31a65c=_0x31a65c-0x0;var _0x142ae4=_0x8d97[_0x31a65c];return _0x142ae4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x78d9('0x0'));var rimraf=require(_0x78d9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x78d9('0x2'));var rp=require(_0x78d9('0x3'));var moment=require(_0x78d9('0x4'));var BPromise=require(_0x78d9('0x5'));var Mustache=require(_0x78d9('0x6'));var util=require('util');var path=require(_0x78d9('0x7'));var sox=require(_0x78d9('0x8'));var csv=require(_0x78d9('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x78d9('0xa'));var jsforce=require(_0x78d9('0xb'));var deskjs=require(_0x78d9('0xc'));var toCsv=require(_0x78d9('0x9'));var querystring=require(_0x78d9('0xd'));var Papa=require(_0x78d9('0xe'));var Redis=require('ioredis');var authService=require(_0x78d9('0xf'));var qs=require(_0x78d9('0x10'));var hardwareService=require(_0x78d9('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x78d9('0x12'));var config=require(_0x78d9('0x13'));var db=require(_0x78d9('0x14'))['db'];var integrations=require(_0x78d9('0x15'));var jayson=require(_0x78d9('0x16'));var client=jayson[_0x78d9('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x8186eb,_0x431199,_0x30e158){if(_0x30e158){var _0x413ab3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x413ab3[_0x78d9('0x18')](_0x431199)){return _0x8186eb;}else{throw new Error(_0x78d9('0x19'));}}else{return _0x8186eb;}}function respondWithRpcPromise(_0x2b27a9,_0x3d8c2f,_0x118b37,_0x21cee0){return new BPromise(function(_0x826882,_0x38aa28){var _0x45934d=_0x21cee0||client;return _0x45934d[_0x78d9('0x1a')](_0x2b27a9,_0x118b37)[_0x78d9('0x1b')](function(_0x156981){logger[_0x78d9('0x1c')]('SalesforceAccount,\x20%s,\x20%s',_0x3d8c2f,_0x78d9('0x1d'));logger[_0x78d9('0x1e')](_0x78d9('0x1f'),_0x3d8c2f,_0x78d9('0x1d'),JSON[_0x78d9('0x20')](_0x156981));if(_0x156981[_0x78d9('0x21')]){if(_0x156981[_0x78d9('0x21')][_0x78d9('0x22')]===0x1f4){logger[_0x78d9('0x21')](_0x78d9('0x23'),_0x3d8c2f,_0x156981[_0x78d9('0x21')][_0x78d9('0x24')]);return _0x38aa28(_0x156981[_0x78d9('0x21')][_0x78d9('0x24')]);}logger[_0x78d9('0x21')](_0x78d9('0x23'),_0x3d8c2f,_0x156981['error'][_0x78d9('0x24')]);return _0x826882(_0x156981[_0x78d9('0x21')][_0x78d9('0x24')]);}else{logger[_0x78d9('0x1c')]('SalesforceAccount,\x20%s,\x20%s',_0x3d8c2f,_0x78d9('0x1d'));_0x826882(_0x156981[_0x78d9('0x25')][_0x78d9('0x24')]);}})['catch'](function(_0x51c4ce){logger[_0x78d9('0x21')]('SalesforceAccount,\x20%s,\x20%s',_0x3d8c2f,_0x51c4ce);_0x38aa28(_0x51c4ce);});});}function respondWithStatusCode(_0x47a331,_0x4802f4){_0x4802f4=_0x4802f4||0xcc;return function(_0x28b7e1){if(_0x28b7e1){return _0x47a331[_0x78d9('0x26')](_0x4802f4);}return _0x47a331[_0x78d9('0x27')](_0x4802f4)[_0x78d9('0x28')]();};}function respondWithResult(_0x18f58d,_0x17db22){_0x17db22=_0x17db22||0xc8;return function(_0x4e87cf){if(_0x4e87cf){return _0x18f58d[_0x78d9('0x27')](_0x17db22)['json'](_0x4e87cf);}};}function respondWithFilteredResult(_0x145c0c,_0x3d9a53){return function(_0x2e1dc1){if(_0x2e1dc1){var _0x507492=_0x2e1dc1['count'],_0x7ecc39=_0x3d9a53['offset'],_0x337816=_0x3d9a53['offset']+_0x3d9a53[_0x78d9('0x29')],_0x59b9d2;if(_0x337816>=_0x507492){_0x337816=_0x507492;_0x59b9d2=0xc8;}else{_0x59b9d2=0xce;}_0x145c0c[_0x78d9('0x27')](_0x59b9d2);return _0x145c0c[_0x78d9('0x2a')](_0x78d9('0x2b'),_0x7ecc39+'-'+_0x337816+'/'+_0x507492)[_0x78d9('0x2c')](_0x2e1dc1);}return null;};}function patchUpdates(_0x3fe42b){return function(_0x457cc9){try{jsonpatch[_0x78d9('0x2d')](_0x457cc9,_0x3fe42b,!![]);}catch(_0x198e36){return BPromise[_0x78d9('0x2e')](_0x198e36);}return _0x457cc9['save']();};}function saveUpdates(_0x1ef490,_0x5ce1fa){return function(_0x537178){if(_0x537178){return _0x537178[_0x78d9('0x2f')](_0x1ef490)[_0x78d9('0x1b')](function(_0x3ea15e){return _0x3ea15e;});}return null;};}function removeEntity(_0x62e9fc,_0x416937){return function(_0x3b29cc){if(_0x3b29cc){return _0x3b29cc[_0x78d9('0x30')]()['then'](function(){_0x62e9fc[_0x78d9('0x27')](0xcc)[_0x78d9('0x28')]();});}};}function handleEntityNotFound(_0x1d216d,_0x8300f7){return function(_0x4f3fbc){if(!_0x4f3fbc){_0x1d216d[_0x78d9('0x26')](0x194);}return _0x4f3fbc;};}function handleError(_0x5258f3,_0x4791cd){_0x4791cd=_0x4791cd||0x1f4;return function(_0x5a0986){logger['error'](_0x5a0986[_0x78d9('0x31')]);if(_0x5a0986[_0x78d9('0x32')]){delete _0x5a0986[_0x78d9('0x32')];}_0x5258f3[_0x78d9('0x27')](_0x4791cd)[_0x78d9('0x33')](_0x5a0986);};}exports[_0x78d9('0x34')]=function(_0x405773,_0x423edd){var _0x2e326c={},_0x216ae7={},_0x2ddd6f={'count':0x0,'rows':[]};var _0x5d9e0b=db[_0x78d9('0x35')][_0x78d9('0x36')];_0x216ae7[_0x78d9('0x37')]=_[_0x78d9('0x38')](_0x5d9e0b);_0x216ae7[_0x78d9('0x39')]=_[_0x78d9('0x38')](_0x405773['query']);_0x216ae7['filters']=_[_0x78d9('0x3a')](_0x216ae7[_0x78d9('0x37')],_0x216ae7[_0x78d9('0x39')]);_0x2e326c[_0x78d9('0x3b')]=_[_0x78d9('0x3a')](_0x216ae7[_0x78d9('0x37')],qs['fields'](_0x405773[_0x78d9('0x39')][_0x78d9('0x3c')]));_0x2e326c[_0x78d9('0x3b')]=_0x2e326c[_0x78d9('0x3b')][_0x78d9('0x3d')]?_0x2e326c['attributes']:_0x216ae7[_0x78d9('0x37')];if(!_0x405773[_0x78d9('0x39')][_0x78d9('0x3e')](_0x78d9('0x3f'))){_0x2e326c['limit']=qs[_0x78d9('0x29')](_0x405773[_0x78d9('0x39')][_0x78d9('0x29')]);_0x2e326c[_0x78d9('0x40')]=qs[_0x78d9('0x40')](_0x405773[_0x78d9('0x39')][_0x78d9('0x40')]);}_0x2e326c[_0x78d9('0x41')]=qs[_0x78d9('0x42')](_0x405773['query'][_0x78d9('0x42')]);_0x2e326c[_0x78d9('0x43')]=qs[_0x78d9('0x44')](_[_0x78d9('0x45')](_0x405773[_0x78d9('0x39')],_0x216ae7[_0x78d9('0x44')]));if(_0x405773[_0x78d9('0x39')][_0x78d9('0x46')]){_0x2e326c[_0x78d9('0x43')]=_[_0x78d9('0x47')](_0x2e326c[_0x78d9('0x43')],{'$or':_['map'](_0x5d9e0b,function(_0x4b874f){if(_0x4b874f[_0x78d9('0x48')][_0x78d9('0x49')]!=='VIRTUAL'){var _0x3d69a8={};_0x3d69a8[_0x4b874f[_0x78d9('0x4a')]]={'$like':'%'+_0x405773[_0x78d9('0x39')][_0x78d9('0x46')]+'%'};return _0x3d69a8;}})});}_0x2e326c=_[_0x78d9('0x47')]({},_0x2e326c,_0x405773[_0x78d9('0x4b')]);var _0x302aa4={'where':_0x2e326c[_0x78d9('0x43')]};return db[_0x78d9('0x35')][_0x78d9('0x4c')](_0x302aa4)['then'](function(_0x462fcb){_0x2ddd6f[_0x78d9('0x4c')]=_0x462fcb;if(_0x405773[_0x78d9('0x39')][_0x78d9('0x4d')]){_0x2e326c[_0x78d9('0x4e')]=[{'all':!![]}];}return db['SalesforceAccount']['findAll'](_0x2e326c);})[_0x78d9('0x1b')](function(_0x106869){_0x2ddd6f['rows']=_0x106869;return _0x2ddd6f;})['then'](respondWithFilteredResult(_0x423edd,_0x2e326c))[_0x78d9('0x4f')](handleError(_0x423edd,null));};exports['show']=function(_0x21495f,_0x62dd38){var _0x285211={'raw':![],'where':{'id':_0x21495f[_0x78d9('0x50')]['id']}},_0x8ac8fc={};_0x8ac8fc[_0x78d9('0x37')]=_[_0x78d9('0x38')](db[_0x78d9('0x35')][_0x78d9('0x36')]);_0x8ac8fc[_0x78d9('0x39')]=_[_0x78d9('0x38')](_0x21495f['query']);_0x8ac8fc[_0x78d9('0x44')]=_['intersection'](_0x8ac8fc[_0x78d9('0x37')],_0x8ac8fc[_0x78d9('0x39')]);_0x285211[_0x78d9('0x3b')]=_[_0x78d9('0x3a')](_0x8ac8fc['model'],qs[_0x78d9('0x3c')](_0x21495f['query']['fields']));_0x285211['attributes']=_0x285211[_0x78d9('0x3b')][_0x78d9('0x3d')]?_0x285211[_0x78d9('0x3b')]:_0x8ac8fc[_0x78d9('0x37')];if(_0x21495f[_0x78d9('0x39')]['includeAll']){_0x285211[_0x78d9('0x4e')]=[{'all':!![]}];}_0x285211=_['merge']({},_0x285211,_0x21495f[_0x78d9('0x4b')]);return db[_0x78d9('0x35')][_0x78d9('0x51')](_0x285211)[_0x78d9('0x1b')](handleEntityNotFound(_0x62dd38,null))['then'](respondWithResult(_0x62dd38,null))['catch'](handleError(_0x62dd38,null));};exports[_0x78d9('0x52')]=function(_0x443a15,_0x75ea31){return db[_0x78d9('0x35')][_0x78d9('0x52')](_0x443a15[_0x78d9('0x53')],{})[_0x78d9('0x1b')](respondWithResult(_0x75ea31,0xc9))[_0x78d9('0x4f')](handleError(_0x75ea31,null));};exports[_0x78d9('0x2f')]=function(_0x2ce17b,_0x468a4b){if(_0x2ce17b[_0x78d9('0x53')]['id']){delete _0x2ce17b['body']['id'];}return db[_0x78d9('0x35')][_0x78d9('0x51')]({'where':{'id':_0x2ce17b[_0x78d9('0x50')]['id']}})[_0x78d9('0x1b')](handleEntityNotFound(_0x468a4b,null))['then'](saveUpdates(_0x2ce17b[_0x78d9('0x53')],null))[_0x78d9('0x1b')](respondWithResult(_0x468a4b,null))['catch'](handleError(_0x468a4b,null));};exports[_0x78d9('0x30')]=function(_0x5a5262,_0x4f4628){return db[_0x78d9('0x35')][_0x78d9('0x51')]({'where':{'id':_0x5a5262[_0x78d9('0x50')]['id']}})['then'](handleEntityNotFound(_0x4f4628,null))[_0x78d9('0x1b')](removeEntity(_0x4f4628,null))[_0x78d9('0x4f')](handleError(_0x4f4628,null));};exports[_0x78d9('0x54')]=function(_0x4c370c,_0x62dcbf,_0x4fbc11){var _0x2716de={};var _0x4601a7={};var _0x20f545;var _0x49c017;return db['SalesforceAccount'][_0x78d9('0x55')]({'where':{'id':_0x4c370c[_0x78d9('0x50')]['id']}})[_0x78d9('0x1b')](handleEntityNotFound(_0x62dcbf,null))[_0x78d9('0x1b')](function(_0x5b7b3a){if(_0x5b7b3a){_0x20f545=_0x5b7b3a;_0x4601a7['model']=_[_0x78d9('0x38')](db[_0x78d9('0x56')][_0x78d9('0x36')]);_0x4601a7['query']=_['keys'](_0x4c370c[_0x78d9('0x39')]);_0x4601a7[_0x78d9('0x44')]=_[_0x78d9('0x3a')](_0x4601a7[_0x78d9('0x37')],_0x4601a7[_0x78d9('0x39')]);_0x2716de['attributes']=_[_0x78d9('0x3a')](_0x4601a7[_0x78d9('0x37')],qs['fields'](_0x4c370c[_0x78d9('0x39')][_0x78d9('0x3c')]));_0x2716de[_0x78d9('0x3b')]=_0x2716de[_0x78d9('0x3b')][_0x78d9('0x3d')]?_0x2716de[_0x78d9('0x3b')]:_0x4601a7[_0x78d9('0x37')];_0x2716de[_0x78d9('0x41')]=qs[_0x78d9('0x42')](_0x4c370c[_0x78d9('0x39')][_0x78d9('0x42')]);_0x2716de[_0x78d9('0x43')]=qs[_0x78d9('0x44')](_[_0x78d9('0x45')](_0x4c370c[_0x78d9('0x39')],_0x4601a7[_0x78d9('0x44')]));if(_0x4c370c[_0x78d9('0x39')][_0x78d9('0x46')]){_0x2716de[_0x78d9('0x43')]=_[_0x78d9('0x47')](_0x2716de['where'],{'$or':_[_0x78d9('0x57')](_0x2716de[_0x78d9('0x3b')],function(_0x4c7ecb){var _0x1779df={};_0x1779df[_0x4c7ecb]={'$like':'%'+_0x4c370c[_0x78d9('0x39')][_0x78d9('0x46')]+'%'};return _0x1779df;})});}_0x2716de=_[_0x78d9('0x47')]({},_0x2716de,_0x4c370c['options']);return _0x20f545[_0x78d9('0x54')](_0x2716de);}})['then'](function(_0x741ec){if(_0x741ec){_0x49c017=_0x741ec[_0x78d9('0x3d')];if(!_0x4c370c[_0x78d9('0x39')][_0x78d9('0x3e')](_0x78d9('0x3f'))){_0x2716de[_0x78d9('0x29')]=qs[_0x78d9('0x29')](_0x4c370c[_0x78d9('0x39')]['limit']);_0x2716de['offset']=qs[_0x78d9('0x40')](_0x4c370c['query'][_0x78d9('0x40')]);}return _0x20f545['getConfigurations'](_0x2716de);}})[_0x78d9('0x1b')](function(_0x1a5b76){if(_0x1a5b76){return _0x1a5b76?{'count':_0x49c017,'rows':_0x1a5b76}:null;}})['then'](respondWithResult(_0x62dcbf,null))[_0x78d9('0x4f')](handleError(_0x62dcbf,null));};exports[_0x78d9('0x58')]=function(_0x5861b8,_0x5b085b,_0x2aa82b){if(_0x5861b8[_0x78d9('0x53')]['id']){delete _0x5861b8['body']['id'];}return db[_0x78d9('0x35')][_0x78d9('0x55')]({'where':{'id':_0x5861b8[_0x78d9('0x50')]['id']}})[_0x78d9('0x1b')](handleEntityNotFound(_0x5b085b,null))['then'](function(_0x7b79f9){if(_0x7b79f9){_0x5861b8[_0x78d9('0x53')][_0x78d9('0x59')]=_0x7b79f9['id'];_0x5861b8[_0x78d9('0x53')][_0x78d9('0x5a')]=integrations[_0x78d9('0x5b')](_0x5861b8[_0x78d9('0x53')][_0x78d9('0x5c')],_0x5861b8[_0x78d9('0x53')]['type']);_0x5861b8['body'][_0x78d9('0x5d')]=integrations[_0x78d9('0x5e')](_0x5861b8[_0x78d9('0x53')][_0x78d9('0x5c')],_0x5861b8[_0x78d9('0x53')][_0x78d9('0x48')]);return db[_0x78d9('0x56')]['create'](_0x5861b8[_0x78d9('0x53')],{'include':[{'model':db[_0x78d9('0x5f')],'as':_0x78d9('0x5a')},{'model':db[_0x78d9('0x5f')],'as':_0x78d9('0x5d')}]});}return null;})[_0x78d9('0x1b')](respondWithResult(_0x5b085b,null))[_0x78d9('0x4f')](handleError(_0x5b085b,null));};exports[_0x78d9('0x60')]=function(_0x93fbe0,_0x4cca21,_0x14ef92){var _0x490006;var _0x3bc541='';var _0x577210='Task';return db[_0x78d9('0x35')][_0x78d9('0x55')]({'where':{'id':_0x93fbe0[_0x78d9('0x50')]['id']},'attributes':['id',_0x78d9('0x61'),_0x78d9('0x62'),'clientSecret',_0x78d9('0x63'),'password',_0x78d9('0x64')]})['then'](handleEntityNotFound(_0x4cca21,null))[_0x78d9('0x1b')](function(_0x4c9da3){if(_0x4c9da3){_0x3bc541=_0x4c9da3[_0x78d9('0x61')];var _0x30c2e6=_0x3bc541['slice'](-0x1);if(_0x30c2e6==='/'){_0x3bc541=_0x3bc541['substring'](0x0,_0x3bc541[_0x78d9('0x65')](_0x30c2e6));}_0x490006=new jsforce[(_0x78d9('0x66'))]({'oauth2':{'loginUrl':_0x3bc541,'clientId':_0x4c9da3[_0x78d9('0x62')],'clientSecret':_0x4c9da3[_0x78d9('0x67')]}});return _0x490006['login'](_0x4c9da3['username'],_0x4c9da3['password'][_0x78d9('0x68')](_0x4c9da3[_0x78d9('0x64')]));}})[_0x78d9('0x1b')](function(_0x25bf3b){if(_0x25bf3b){if(!_['isNil'](_0x93fbe0[_0x78d9('0x39')]['ticketType'])){_0x577210=_0x93fbe0['query'][_0x78d9('0x69')];}return _0x490006[_0x78d9('0x6a')](_0x577210)[_0x78d9('0x6b')]();}})[_0x78d9('0x1b')](function(_0x2d2c36){var _0x191e56=[_0x78d9('0x6c'),_0x78d9('0x6d'),_0x78d9('0x6e'),_0x78d9('0x6f'),_0x78d9('0x70'),_0x78d9('0x71'),_0x78d9('0x72'),_0x78d9('0x73')];if(!_[_0x78d9('0x74')](_0x93fbe0[_0x78d9('0x39')][_0x78d9('0x69')])&&_0x93fbe0[_0x78d9('0x39')][_0x78d9('0x69')]===_0x78d9('0x75')){_0x191e56=[_0x78d9('0x73'),'Origin',_0x78d9('0x76'),_0x78d9('0x72'),_0x78d9('0x71'),_0x78d9('0x77'),_0x78d9('0x78'),_0x78d9('0x79')];}if(_0x2d2c36){_['remove'](_0x2d2c36[_0x78d9('0x3c')],function(_0x442544){return _0x442544['custom']===![]&&!_0x191e56['includes'](_0x442544[_0x78d9('0x32')]);});return{'count':_0x2d2c36[_0x78d9('0x3c')][_0x78d9('0x3d')],'rows':_[_0x78d9('0x57')](_0x2d2c36['fields'],function(_0x83efd1){return{'id':_0x83efd1['name'],'name':_0x83efd1[_0x78d9('0x7a')],'custom':_0x83efd1[_0x78d9('0x7b')],'options':_0x83efd1[_0x78d9('0x7c')][_0x78d9('0x3d')]>0x0?_[_0x78d9('0x57')](_0x83efd1['picklistValues'],function(_0x20438b){return{'name':_0x20438b[_0x78d9('0x7a')],'value':_0x20438b['value']};}):_0x83efd1[_0x78d9('0x48')]==_0x78d9('0x7d')?[{'name':_0x78d9('0x7e'),'value':'true'},{'name':'False','value':'false'}]:[]};})};}})[_0x78d9('0x1b')](respondWithResult(_0x4cca21,null))['catch'](function(_0x4dffd1){var _0x473651=_0x93fbe0[_0x78d9('0x39')][_0x78d9('0x18')]?0x1f4:_0x4dffd1['statusCode']||0x1f4;logger['error'](_0x78d9('0x7f'),_0x78d9('0x60'),_0x473651,JSON['stringify'](_0x4dffd1));delete _0x4dffd1[_0x78d9('0x32')];if(_0x473651===0x191){_0x473651=0x190;}_0x4cca21[_0x78d9('0x27')](_0x473651)['send'](_0x93fbe0[_0x78d9('0x39')][_0x78d9('0x18')]?{'message':_0x78d9('0x80'),'statusCode':_0x4dffd1[_0x78d9('0x81')]}:_0x4dffd1);});}; \ No newline at end of file +var _0x7ee1=['remoteUri','substring','lastIndexOf','Connection','login','concat','securityToken','isNil','describe','CallDisposition','CallDurationInSeconds','CallObject','CallType','IsArchived','Status','ticketType','Case','Type','Origin','IsEscalated','SuppliedName','SuppliedCompany','remove','custom','includes','picklistValues','label','value','boolean','True','true','False','false','test','statusCode','stringify','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','destroy','stack','name','send','index','SalesforceAccount','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','create','update','body','order','pick','getConfigurations','addConfiguration','findOne','Subjects','getSubjects','channel','SalesforceField','getFields','Task','clientSecret','username','password'];(function(_0x280b74,_0x166a2c){var _0x5663c1=function(_0x33251f){while(--_0x33251f){_0x280b74['push'](_0x280b74['shift']());}};_0x5663c1(++_0x166a2c);}(_0x7ee1,0xab));var _0x17ee=function(_0x5baac2,_0xc68b77){_0x5baac2=_0x5baac2-0x0;var _0x5268f0=_0x7ee1[_0x5baac2];return _0x5268f0;};'use strict';var pdf=require(_0x17ee('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x17ee('0x1'));var zipdir=require(_0x17ee('0x2'));var jsonpatch=require(_0x17ee('0x3'));var rp=require(_0x17ee('0x4'));var moment=require(_0x17ee('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x17ee('0x6'));var util=require('util');var path=require('path');var sox=require(_0x17ee('0x7'));var csv=require(_0x17ee('0x8'));var ejs=require(_0x17ee('0x9'));var fs=require('fs');var _=require(_0x17ee('0xa'));var squel=require(_0x17ee('0xb'));var crypto=require('crypto');var jsforce=require(_0x17ee('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x17ee('0x8'));var querystring=require(_0x17ee('0xd'));var Papa=require('papaparse');var Redis=require(_0x17ee('0xe'));var authService=require(_0x17ee('0xf'));var qs=require(_0x17ee('0x10'));var hardwareService=require(_0x17ee('0x11'));var logger=require(_0x17ee('0x12'))(_0x17ee('0x13'));var utils=require(_0x17ee('0x14'));var config=require(_0x17ee('0x15'));var db=require(_0x17ee('0x16'))['db'];var integrations=require(_0x17ee('0x17'));var jayson=require(_0x17ee('0x18'));var client=jayson[_0x17ee('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x2a0f19,_0x3dc949,_0x4bdbdf){if(_0x4bdbdf){var _0x1b3857=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1b3857['test'](_0x3dc949)){return _0x2a0f19;}else{throw new Error(_0x17ee('0x1a'));}}else{return _0x2a0f19;}}function respondWithRpcPromise(_0x27447d,_0x16a1b5,_0x206f85,_0x5eebbc){return new BPromise(function(_0x3fa583,_0x749078){var _0x1b09a3=_0x5eebbc||client;return _0x1b09a3['request'](_0x27447d,_0x206f85)[_0x17ee('0x1b')](function(_0x47c346){logger[_0x17ee('0x1c')](_0x17ee('0x1d'),_0x16a1b5,_0x17ee('0x1e'));logger[_0x17ee('0x1f')](_0x17ee('0x20'),_0x16a1b5,'request\x20sent',JSON['stringify'](_0x47c346));if(_0x47c346[_0x17ee('0x21')]){if(_0x47c346[_0x17ee('0x21')][_0x17ee('0x22')]===0x1f4){logger[_0x17ee('0x21')]('SalesforceAccount,\x20%s,\x20%s',_0x16a1b5,_0x47c346[_0x17ee('0x21')][_0x17ee('0x23')]);return _0x749078(_0x47c346[_0x17ee('0x21')][_0x17ee('0x23')]);}logger['error'](_0x17ee('0x1d'),_0x16a1b5,_0x47c346[_0x17ee('0x21')][_0x17ee('0x23')]);return _0x3fa583(_0x47c346['error'][_0x17ee('0x23')]);}else{logger[_0x17ee('0x1c')](_0x17ee('0x1d'),_0x16a1b5,_0x17ee('0x1e'));_0x3fa583(_0x47c346[_0x17ee('0x24')]['message']);}})[_0x17ee('0x25')](function(_0xc01da5){logger[_0x17ee('0x21')](_0x17ee('0x1d'),_0x16a1b5,_0xc01da5);_0x749078(_0xc01da5);});});}function respondWithStatusCode(_0x88a4af,_0x16a0ea){_0x16a0ea=_0x16a0ea||0xcc;return function(_0x13e8ff){if(_0x13e8ff){return _0x88a4af[_0x17ee('0x26')](_0x16a0ea);}return _0x88a4af['status'](_0x16a0ea)[_0x17ee('0x27')]();};}function respondWithResult(_0x1e24bf,_0x34040a){_0x34040a=_0x34040a||0xc8;return function(_0x32b311){if(_0x32b311){return _0x1e24bf[_0x17ee('0x28')](_0x34040a)[_0x17ee('0x29')](_0x32b311);}};}function respondWithFilteredResult(_0x5b11c5,_0x4ba675){return function(_0x32548e){if(_0x32548e){var _0x400306=_0x32548e[_0x17ee('0x2a')],_0x390c04=_0x4ba675[_0x17ee('0x2b')],_0x5ea202=_0x4ba675['offset']+_0x4ba675[_0x17ee('0x2c')],_0x393231;if(_0x5ea202>=_0x400306){_0x5ea202=_0x400306;_0x393231=0xc8;}else{_0x393231=0xce;}_0x5b11c5[_0x17ee('0x28')](_0x393231);return _0x5b11c5[_0x17ee('0x2d')](_0x17ee('0x2e'),_0x390c04+'-'+_0x5ea202+'/'+_0x400306)['json'](_0x32548e);}return null;};}function patchUpdates(_0x3aa7fe){return function(_0x3e7b9b){try{jsonpatch[_0x17ee('0x2f')](_0x3e7b9b,_0x3aa7fe,!![]);}catch(_0x550175){return BPromise[_0x17ee('0x30')](_0x550175);}return _0x3e7b9b['save']();};}function saveUpdates(_0x9e6424,_0x1cf8b9){return function(_0x126f3a){if(_0x126f3a){return _0x126f3a['update'](_0x9e6424)[_0x17ee('0x1b')](function(_0x48a522){return _0x48a522;});}return null;};}function removeEntity(_0x264d6e,_0x316f22){return function(_0x32413e){if(_0x32413e){return _0x32413e[_0x17ee('0x31')]()['then'](function(){_0x264d6e[_0x17ee('0x28')](0xcc)[_0x17ee('0x27')]();});}};}function handleEntityNotFound(_0x15b09f,_0x57096e){return function(_0x64ca53){if(!_0x64ca53){_0x15b09f[_0x17ee('0x26')](0x194);}return _0x64ca53;};}function handleError(_0x4284cc,_0x5b338e){_0x5b338e=_0x5b338e||0x1f4;return function(_0x12a758){logger[_0x17ee('0x21')](_0x12a758[_0x17ee('0x32')]);if(_0x12a758[_0x17ee('0x33')]){delete _0x12a758[_0x17ee('0x33')];}_0x4284cc[_0x17ee('0x28')](_0x5b338e)[_0x17ee('0x34')](_0x12a758);};}exports[_0x17ee('0x35')]=function(_0x219db4,_0x466787){var _0x51e304={},_0x3c2846={},_0xe8f55c={'count':0x0,'rows':[]};var _0x1614fd=db[_0x17ee('0x36')][_0x17ee('0x37')];_0x3c2846[_0x17ee('0x38')]=_[_0x17ee('0x39')](_0x1614fd);_0x3c2846[_0x17ee('0x3a')]=_[_0x17ee('0x39')](_0x219db4[_0x17ee('0x3a')]);_0x3c2846[_0x17ee('0x3b')]=_['intersection'](_0x3c2846[_0x17ee('0x38')],_0x3c2846[_0x17ee('0x3a')]);_0x51e304['attributes']=_[_0x17ee('0x3c')](_0x3c2846[_0x17ee('0x38')],qs[_0x17ee('0x3d')](_0x219db4[_0x17ee('0x3a')][_0x17ee('0x3d')]));_0x51e304[_0x17ee('0x3e')]=_0x51e304['attributes']['length']?_0x51e304[_0x17ee('0x3e')]:_0x3c2846[_0x17ee('0x38')];if(!_0x219db4[_0x17ee('0x3a')][_0x17ee('0x3f')](_0x17ee('0x40'))){_0x51e304[_0x17ee('0x2c')]=qs['limit'](_0x219db4[_0x17ee('0x3a')][_0x17ee('0x2c')]);_0x51e304['offset']=qs[_0x17ee('0x2b')](_0x219db4['query'][_0x17ee('0x2b')]);}_0x51e304['order']=qs[_0x17ee('0x41')](_0x219db4[_0x17ee('0x3a')][_0x17ee('0x41')]);_0x51e304[_0x17ee('0x42')]=qs['filters'](_['pick'](_0x219db4['query'],_0x3c2846['filters']));if(_0x219db4[_0x17ee('0x3a')][_0x17ee('0x43')]){_0x51e304['where']=_[_0x17ee('0x44')](_0x51e304[_0x17ee('0x42')],{'$or':_[_0x17ee('0x45')](_0x1614fd,function(_0xcf486){if(_0xcf486[_0x17ee('0x46')][_0x17ee('0x47')]!==_0x17ee('0x48')){var _0x2bffff={};_0x2bffff[_0xcf486['field']]={'$like':'%'+_0x219db4[_0x17ee('0x3a')][_0x17ee('0x43')]+'%'};return _0x2bffff;}})});}_0x51e304=_['merge']({},_0x51e304,_0x219db4[_0x17ee('0x49')]);var _0x1a8bc5={'where':_0x51e304[_0x17ee('0x42')]};return db['SalesforceAccount']['count'](_0x1a8bc5)['then'](function(_0x5737fa){_0xe8f55c[_0x17ee('0x2a')]=_0x5737fa;if(_0x219db4[_0x17ee('0x3a')][_0x17ee('0x4a')]){_0x51e304[_0x17ee('0x4b')]=[{'all':!![]}];}return db[_0x17ee('0x36')][_0x17ee('0x4c')](_0x51e304);})[_0x17ee('0x1b')](function(_0x5d2e69){_0xe8f55c[_0x17ee('0x4d')]=_0x5d2e69;return _0xe8f55c;})[_0x17ee('0x1b')](respondWithFilteredResult(_0x466787,_0x51e304))[_0x17ee('0x25')](handleError(_0x466787,null));};exports[_0x17ee('0x4e')]=function(_0x2d9d89,_0x403e43){var _0x31343f={'raw':![],'where':{'id':_0x2d9d89[_0x17ee('0x4f')]['id']}},_0x4bb9b6={};_0x4bb9b6[_0x17ee('0x38')]=_[_0x17ee('0x39')](db[_0x17ee('0x36')]['rawAttributes']);_0x4bb9b6[_0x17ee('0x3a')]=_[_0x17ee('0x39')](_0x2d9d89[_0x17ee('0x3a')]);_0x4bb9b6[_0x17ee('0x3b')]=_['intersection'](_0x4bb9b6[_0x17ee('0x38')],_0x4bb9b6[_0x17ee('0x3a')]);_0x31343f[_0x17ee('0x3e')]=_[_0x17ee('0x3c')](_0x4bb9b6[_0x17ee('0x38')],qs[_0x17ee('0x3d')](_0x2d9d89[_0x17ee('0x3a')][_0x17ee('0x3d')]));_0x31343f['attributes']=_0x31343f['attributes'][_0x17ee('0x50')]?_0x31343f[_0x17ee('0x3e')]:_0x4bb9b6['model'];if(_0x2d9d89[_0x17ee('0x3a')][_0x17ee('0x4a')]){_0x31343f[_0x17ee('0x4b')]=[{'all':!![]}];}_0x31343f=_[_0x17ee('0x44')]({},_0x31343f,_0x2d9d89['options']);return db['SalesforceAccount'][_0x17ee('0x51')](_0x31343f)[_0x17ee('0x1b')](handleEntityNotFound(_0x403e43,null))['then'](respondWithResult(_0x403e43,null))['catch'](handleError(_0x403e43,null));};exports[_0x17ee('0x52')]=function(_0x58a142,_0x188e0d){return db['SalesforceAccount'][_0x17ee('0x52')](_0x58a142['body'],{})[_0x17ee('0x1b')](respondWithResult(_0x188e0d,0xc9))[_0x17ee('0x25')](handleError(_0x188e0d,null));};exports[_0x17ee('0x53')]=function(_0x52f0f8,_0x151b4d){if(_0x52f0f8['body']['id']){delete _0x52f0f8['body']['id'];}return db['SalesforceAccount'][_0x17ee('0x51')]({'where':{'id':_0x52f0f8[_0x17ee('0x4f')]['id']}})['then'](handleEntityNotFound(_0x151b4d,null))[_0x17ee('0x1b')](saveUpdates(_0x52f0f8[_0x17ee('0x54')],null))[_0x17ee('0x1b')](respondWithResult(_0x151b4d,null))[_0x17ee('0x25')](handleError(_0x151b4d,null));};exports[_0x17ee('0x31')]=function(_0x5ed38f,_0x163358){return db[_0x17ee('0x36')]['find']({'where':{'id':_0x5ed38f[_0x17ee('0x4f')]['id']}})['then'](handleEntityNotFound(_0x163358,null))[_0x17ee('0x1b')](removeEntity(_0x163358,null))[_0x17ee('0x25')](handleError(_0x163358,null));};exports['getConfigurations']=function(_0x473546,_0x8e7e69,_0x201c57){var _0xd413c={};var _0x542900={};var _0x4f6e0e;var _0x47ca5f;return db[_0x17ee('0x36')]['findOne']({'where':{'id':_0x473546[_0x17ee('0x4f')]['id']}})[_0x17ee('0x1b')](handleEntityNotFound(_0x8e7e69,null))['then'](function(_0x272ec3){if(_0x272ec3){_0x4f6e0e=_0x272ec3;_0x542900[_0x17ee('0x38')]=_[_0x17ee('0x39')](db['SalesforceConfiguration'][_0x17ee('0x37')]);_0x542900[_0x17ee('0x3a')]=_['keys'](_0x473546[_0x17ee('0x3a')]);_0x542900[_0x17ee('0x3b')]=_[_0x17ee('0x3c')](_0x542900[_0x17ee('0x38')],_0x542900[_0x17ee('0x3a')]);_0xd413c[_0x17ee('0x3e')]=_['intersection'](_0x542900['model'],qs[_0x17ee('0x3d')](_0x473546['query']['fields']));_0xd413c[_0x17ee('0x3e')]=_0xd413c[_0x17ee('0x3e')][_0x17ee('0x50')]?_0xd413c['attributes']:_0x542900['model'];_0xd413c[_0x17ee('0x55')]=qs[_0x17ee('0x41')](_0x473546[_0x17ee('0x3a')][_0x17ee('0x41')]);_0xd413c['where']=qs['filters'](_[_0x17ee('0x56')](_0x473546['query'],_0x542900['filters']));if(_0x473546[_0x17ee('0x3a')][_0x17ee('0x43')]){_0xd413c['where']=_[_0x17ee('0x44')](_0xd413c['where'],{'$or':_[_0x17ee('0x45')](_0xd413c[_0x17ee('0x3e')],function(_0x14921e){var _0x30cb36={};_0x30cb36[_0x14921e]={'$like':'%'+_0x473546['query'][_0x17ee('0x43')]+'%'};return _0x30cb36;})});}_0xd413c=_[_0x17ee('0x44')]({},_0xd413c,_0x473546[_0x17ee('0x49')]);return _0x4f6e0e[_0x17ee('0x57')](_0xd413c);}})[_0x17ee('0x1b')](function(_0x5d2818){if(_0x5d2818){_0x47ca5f=_0x5d2818['length'];if(!_0x473546[_0x17ee('0x3a')][_0x17ee('0x3f')](_0x17ee('0x40'))){_0xd413c[_0x17ee('0x2c')]=qs[_0x17ee('0x2c')](_0x473546[_0x17ee('0x3a')][_0x17ee('0x2c')]);_0xd413c[_0x17ee('0x2b')]=qs[_0x17ee('0x2b')](_0x473546[_0x17ee('0x3a')][_0x17ee('0x2b')]);}return _0x4f6e0e[_0x17ee('0x57')](_0xd413c);}})[_0x17ee('0x1b')](function(_0x5dabf4){if(_0x5dabf4){return _0x5dabf4?{'count':_0x47ca5f,'rows':_0x5dabf4}:null;}})[_0x17ee('0x1b')](respondWithResult(_0x8e7e69,null))[_0x17ee('0x25')](handleError(_0x8e7e69,null));};exports[_0x17ee('0x58')]=function(_0x5c607e,_0x5f447e,_0xa9d562){if(_0x5c607e['body']['id']){delete _0x5c607e[_0x17ee('0x54')]['id'];}return db[_0x17ee('0x36')][_0x17ee('0x59')]({'where':{'id':_0x5c607e[_0x17ee('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5f447e,null))['then'](function(_0x2c46c4){if(_0x2c46c4){_0x5c607e[_0x17ee('0x54')]['AccountId']=_0x2c46c4['id'];_0x5c607e[_0x17ee('0x54')][_0x17ee('0x5a')]=integrations[_0x17ee('0x5b')](_0x5c607e['body'][_0x17ee('0x5c')],_0x5c607e['body'][_0x17ee('0x46')]);_0x5c607e[_0x17ee('0x54')]['Descriptions']=integrations['getDescriptions'](_0x5c607e['body'][_0x17ee('0x5c')],_0x5c607e[_0x17ee('0x54')][_0x17ee('0x46')]);return db['SalesforceConfiguration']['create'](_0x5c607e[_0x17ee('0x54')],{'include':[{'model':db[_0x17ee('0x5d')],'as':_0x17ee('0x5a')},{'model':db[_0x17ee('0x5d')],'as':'Descriptions'}]});}return null;})[_0x17ee('0x1b')](respondWithResult(_0x5f447e,null))[_0x17ee('0x25')](handleError(_0x5f447e,null));};exports[_0x17ee('0x5e')]=function(_0x10a0a2,_0x2f795c,_0x23db4b){var _0x457479;var _0x5a1e02='';var _0x59a5c7=_0x17ee('0x5f');return db[_0x17ee('0x36')]['findOne']({'where':{'id':_0x10a0a2['params']['id']},'attributes':['id','remoteUri','clientId',_0x17ee('0x60'),_0x17ee('0x61'),_0x17ee('0x62'),'securityToken']})['then'](handleEntityNotFound(_0x2f795c,null))[_0x17ee('0x1b')](function(_0x5e43a6){if(_0x5e43a6){_0x5a1e02=_0x5e43a6[_0x17ee('0x63')];var _0x55ebf5=_0x5a1e02['slice'](-0x1);if(_0x55ebf5==='/'){_0x5a1e02=_0x5a1e02[_0x17ee('0x64')](0x0,_0x5a1e02[_0x17ee('0x65')](_0x55ebf5));}_0x457479=new jsforce[(_0x17ee('0x66'))]({'oauth2':{'loginUrl':_0x5a1e02,'clientId':_0x5e43a6['clientId'],'clientSecret':_0x5e43a6[_0x17ee('0x60')]}});return _0x457479[_0x17ee('0x67')](_0x5e43a6[_0x17ee('0x61')],_0x5e43a6[_0x17ee('0x62')][_0x17ee('0x68')](_0x5e43a6[_0x17ee('0x69')]));}})[_0x17ee('0x1b')](function(_0x25fc24){if(_0x25fc24){if(!_[_0x17ee('0x6a')](_0x10a0a2[_0x17ee('0x3a')]['ticketType'])){_0x59a5c7=_0x10a0a2[_0x17ee('0x3a')]['ticketType'];}return _0x457479['sobject'](_0x59a5c7)[_0x17ee('0x6b')]();}})['then'](function(_0x3fb4b7){var _0x54c799=[_0x17ee('0x6c'),_0x17ee('0x6d'),_0x17ee('0x6e'),_0x17ee('0x6f'),_0x17ee('0x70'),'Priority',_0x17ee('0x71'),'Type'];if(!_[_0x17ee('0x6a')](_0x10a0a2[_0x17ee('0x3a')][_0x17ee('0x72')])&&_0x10a0a2[_0x17ee('0x3a')][_0x17ee('0x72')]===_0x17ee('0x73')){_0x54c799=[_0x17ee('0x74'),_0x17ee('0x75'),'Reason',_0x17ee('0x71'),'Priority',_0x17ee('0x76'),_0x17ee('0x77'),_0x17ee('0x78')];}if(_0x3fb4b7){_[_0x17ee('0x79')](_0x3fb4b7['fields'],function(_0x8880e3){return _0x8880e3[_0x17ee('0x7a')]===![]&&!_0x54c799[_0x17ee('0x7b')](_0x8880e3[_0x17ee('0x33')]);});return{'count':_0x3fb4b7[_0x17ee('0x3d')][_0x17ee('0x50')],'rows':_[_0x17ee('0x45')](_0x3fb4b7['fields'],function(_0x20bd55){return{'id':_0x20bd55[_0x17ee('0x33')],'name':_0x20bd55['label'],'custom':_0x20bd55[_0x17ee('0x7a')],'options':_0x20bd55['picklistValues'][_0x17ee('0x50')]>0x0?_['map'](_0x20bd55[_0x17ee('0x7c')],function(_0x4f92ae){return{'name':_0x4f92ae[_0x17ee('0x7d')],'value':_0x4f92ae[_0x17ee('0x7e')]};}):_0x20bd55[_0x17ee('0x46')]==_0x17ee('0x7f')?[{'name':_0x17ee('0x80'),'value':_0x17ee('0x81')},{'name':_0x17ee('0x82'),'value':_0x17ee('0x83')}]:[]};})};}})[_0x17ee('0x1b')](respondWithResult(_0x2f795c,null))[_0x17ee('0x25')](function(_0x213c71){var _0x2b86df=_0x10a0a2[_0x17ee('0x3a')][_0x17ee('0x84')]?0x1f4:_0x213c71[_0x17ee('0x85')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x2b86df,JSON[_0x17ee('0x86')](_0x213c71));delete _0x213c71[_0x17ee('0x33')];if(_0x2b86df===0x191){_0x2b86df=0x190;}_0x2f795c[_0x17ee('0x28')](_0x2b86df)[_0x17ee('0x34')](_0x10a0a2[_0x17ee('0x3a')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x213c71['statusCode']}:_0x213c71);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 16f0ce7..4b39f4d 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 _0x0abf=['int_salesforce_accounts','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount'];(function(_0x5a9f19,_0x50e455){var _0x1d517d=function(_0x4d06de){while(--_0x4d06de){_0x5a9f19['push'](_0x5a9f19['shift']());}};_0x1d517d(++_0x50e455);}(_0x0abf,0xe8));var _0xf0ab=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x0abf[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var logger=require(_0xf0ab('0x1'))(_0xf0ab('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf0ab('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var attributes=require(_0xf0ab('0x6'));var integrations=require(_0xf0ab('0x7'));module[_0xf0ab('0x8')]=function(_0x4d2ea8,_0x233afe){return _0x4d2ea8['define'](_0xf0ab('0x9'),attributes,{'tableName':_0xf0ab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa478=['define','SalesforceAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration'];(function(_0x31a938,_0x4daec6){var _0x1bf341=function(_0x514261){while(--_0x514261){_0x31a938['push'](_0x31a938['shift']());}};_0x1bf341(++_0x4daec6);}(_0xa478,0x136));var _0x8a47=function(_0x18a81a,_0x4fc65b){_0x18a81a=_0x18a81a-0x0;var _0x114027=_0xa478[_0x18a81a];return _0x114027;};'use strict';var _=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var logger=require(_0x8a47('0x2'))(_0x8a47('0x3'));var moment=require(_0x8a47('0x4'));var BPromise=require(_0x8a47('0x5'));var rp=require(_0x8a47('0x6'));var fs=require('fs');var path=require(_0x8a47('0x7'));var rimraf=require(_0x8a47('0x8'));var config=require(_0x8a47('0x9'));var attributes=require(_0x8a47('0xa'));var integrations=require(_0x8a47('0xb'));module['exports']=function(_0x413787,_0x2d62a6){return _0x413787[_0x8a47('0xc')](_0x8a47('0xd'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 0fbc6de..c87ef8e 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 _0x9219=['info','result','catch','GetSalesforceAccount','SalesforceAccount','options','attributes','limit','include','map','model','find','raw','where','ShowSalesforceAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x32084d,_0x683810){var _0x37a46b=function(_0x4aac0e){while(--_0x4aac0e){_0x32084d['push'](_0x32084d['shift']());}};_0x37a46b(++_0x683810);}(_0x9219,0x1dd));var _0x9921=function(_0x4e549c,_0x172d1f){_0x4e549c=_0x4e549c-0x0;var _0x1b98e5=_0x9219[_0x4e549c];return _0x1b98e5;};'use strict';var _=require('lodash');var util=require(_0x9921('0x0'));var moment=require(_0x9921('0x1'));var BPromise=require(_0x9921('0x2'));var rs=require(_0x9921('0x3'));var fs=require('fs');var Redis=require(_0x9921('0x4'));var db=require(_0x9921('0x5'))['db'];var utils=require(_0x9921('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9921('0x7'));var client=jayson[_0x9921('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0244,_0x3071e5,_0x1d7fef){return new BPromise(function(_0x52f193,_0x295386){return client[_0x9921('0x9')](_0x2c0244,_0x1d7fef)[_0x9921('0xa')](function(_0x2585e0){logger['info'](_0x9921('0xb'),_0x3071e5,_0x9921('0xc'));logger[_0x9921('0xd')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x3071e5,_0x9921('0xc'),JSON[_0x9921('0xe')](_0x2585e0));if(_0x2585e0['error']){if(_0x2585e0[_0x9921('0xf')][_0x9921('0x10')]===0x1f4){logger['error'](_0x9921('0xb'),_0x3071e5,_0x2585e0['error']['message']);return _0x295386(_0x2585e0[_0x9921('0xf')]['message']);}logger['error'](_0x9921('0xb'),_0x3071e5,_0x2585e0[_0x9921('0xf')]['message']);return _0x52f193(_0x2585e0['error'][_0x9921('0x11')]);}else{logger[_0x9921('0x12')](_0x9921('0xb'),_0x3071e5,'request\x20sent');_0x52f193(_0x2585e0[_0x9921('0x13')][_0x9921('0x11')]);}})[_0x9921('0x14')](function(_0x9d6cf9){logger[_0x9921('0xf')](_0x9921('0xb'),_0x3071e5,_0x9d6cf9);_0x295386(_0x9d6cf9);});});}exports[_0x9921('0x15')]=function(_0x27c33e){var _0x3f567f=this;return new Promise(function(_0x3d6bdd,_0x17d126){return db[_0x9921('0x16')]['findAll']({'raw':_0x27c33e[_0x9921('0x17')]?_0x27c33e[_0x9921('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x27c33e[_0x9921('0x17')]?_0x27c33e[_0x9921('0x17')]['where']||null:null,'attributes':_0x27c33e[_0x9921('0x17')]?_0x27c33e['options'][_0x9921('0x18')]||null:null,'limit':_0x27c33e['options']?_0x27c33e[_0x9921('0x17')][_0x9921('0x19')]||null:null,'include':_0x27c33e['options']?_0x27c33e[_0x9921('0x17')][_0x9921('0x1a')]?_[_0x9921('0x1b')](_0x27c33e['options'][_0x9921('0x1a')],function(_0x5c5668){return{'model':db[_0x5c5668['model']],'as':_0x5c5668['as'],'attributes':_0x5c5668[_0x9921('0x18')],'include':_0x5c5668['include']?_[_0x9921('0x1b')](_0x5c5668[_0x9921('0x1a')],function(_0x1eae17){return{'model':db[_0x1eae17[_0x9921('0x1c')]],'as':_0x1eae17['as'],'attributes':_0x1eae17[_0x9921('0x18')],'include':_0x1eae17[_0x9921('0x1a')]?_['map'](_0x1eae17[_0x9921('0x1a')],function(_0x4db72a){return{'model':db[_0x4db72a[_0x9921('0x1c')]],'as':_0x4db72a['as'],'attributes':_0x4db72a[_0x9921('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9921('0xa')](function(_0x47934b){logger[_0x9921('0x12')]('GetSalesforceAccount',_0x27c33e);logger[_0x9921('0xd')]('GetSalesforceAccount',_0x27c33e,JSON[_0x9921('0xe')](_0x47934b));_0x3d6bdd(_0x47934b);})['catch'](function(_0x5afdbb){logger[_0x9921('0xf')](_0x9921('0x15'),_0x5afdbb[_0x9921('0x11')],_0x27c33e);_0x17d126(_0x3f567f[_0x9921('0xf')](0x1f4,_0x5afdbb[_0x9921('0x11')]));});});};exports['ShowSalesforceAccount']=function(_0x1ee5f0){var _0x4ec581=this;return new Promise(function(_0x56566f,_0x5c78e2){return db[_0x9921('0x16')][_0x9921('0x1d')]({'raw':_0x1ee5f0[_0x9921('0x17')]?_0x1ee5f0[_0x9921('0x17')][_0x9921('0x1e')]===undefined?!![]:![]:!![],'where':_0x1ee5f0[_0x9921('0x17')]?_0x1ee5f0[_0x9921('0x17')][_0x9921('0x1f')]||null:null,'attributes':_0x1ee5f0['options']?_0x1ee5f0['options'][_0x9921('0x18')]||null:null,'include':_0x1ee5f0[_0x9921('0x17')]?_0x1ee5f0[_0x9921('0x17')][_0x9921('0x1a')]?_[_0x9921('0x1b')](_0x1ee5f0[_0x9921('0x17')][_0x9921('0x1a')],function(_0x4a68c8){return{'model':db[_0x4a68c8[_0x9921('0x1c')]],'as':_0x4a68c8['as'],'attributes':_0x4a68c8[_0x9921('0x18')],'include':_0x4a68c8['include']?_[_0x9921('0x1b')](_0x4a68c8[_0x9921('0x1a')],function(_0x57aaf0){return{'model':db[_0x57aaf0[_0x9921('0x1c')]],'as':_0x57aaf0['as'],'attributes':_0x57aaf0[_0x9921('0x18')],'include':_0x57aaf0[_0x9921('0x1a')]?_[_0x9921('0x1b')](_0x57aaf0[_0x9921('0x1a')],function(_0x6884e9){return{'model':db[_0x6884e9['model']],'as':_0x6884e9['as'],'attributes':_0x6884e9[_0x9921('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x579b15){logger[_0x9921('0x12')](_0x9921('0x20'),_0x1ee5f0);logger[_0x9921('0xd')](_0x9921('0x20'),_0x1ee5f0,JSON['stringify'](_0x579b15));_0x56566f(_0x579b15);})[_0x9921('0x14')](function(_0x3af48f){logger[_0x9921('0xf')](_0x9921('0x20'),_0x3af48f[_0x9921('0x11')],_0x1ee5f0);_0x5c78e2(_0x4ec581[_0x9921('0xf')](0x1f4,_0x3af48f[_0x9921('0x11')]));});});}; \ No newline at end of file +var _0xc13d=['model','attributes','stringify','catch','find','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','GetSalesforceAccount','findAll','options','raw','where','limit','map','include'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc13d,0x92));var _0xdc13=function(_0x6df41c,_0x44cc7d){_0x6df41c=_0x6df41c-0x0;var _0x105b09=_0xc13d[_0x6df41c];return _0x105b09;};'use strict';var _=require(_0xdc13('0x0'));var util=require(_0xdc13('0x1'));var moment=require(_0xdc13('0x2'));var BPromise=require(_0xdc13('0x3'));var rs=require(_0xdc13('0x4'));var fs=require('fs');var Redis=require(_0xdc13('0x5'));var db=require(_0xdc13('0x6'))['db'];var utils=require(_0xdc13('0x7'));var logger=require(_0xdc13('0x8'))(_0xdc13('0x9'));var config=require(_0xdc13('0xa'));var jayson=require(_0xdc13('0xb'));var client=jayson['client'][_0xdc13('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e7600,_0x4e7dd7,_0x467d39){return new BPromise(function(_0x310187,_0x49d022){return client['request'](_0x2e7600,_0x467d39)[_0xdc13('0xd')](function(_0x2fe01d){logger[_0xdc13('0xe')](_0xdc13('0xf'),_0x4e7dd7,'request\x20sent');logger[_0xdc13('0x10')](_0xdc13('0x11'),_0x4e7dd7,'request\x20sent',JSON['stringify'](_0x2fe01d));if(_0x2fe01d[_0xdc13('0x12')]){if(_0x2fe01d['error'][_0xdc13('0x13')]===0x1f4){logger[_0xdc13('0x12')](_0xdc13('0xf'),_0x4e7dd7,_0x2fe01d[_0xdc13('0x12')]['message']);return _0x49d022(_0x2fe01d['error'][_0xdc13('0x14')]);}logger[_0xdc13('0x12')](_0xdc13('0xf'),_0x4e7dd7,_0x2fe01d[_0xdc13('0x12')][_0xdc13('0x14')]);return _0x310187(_0x2fe01d['error'][_0xdc13('0x14')]);}else{logger[_0xdc13('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x4e7dd7,'request\x20sent');_0x310187(_0x2fe01d['result'][_0xdc13('0x14')]);}})['catch'](function(_0x16943f){logger[_0xdc13('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x4e7dd7,_0x16943f);_0x49d022(_0x16943f);});});}exports[_0xdc13('0x15')]=function(_0x519d91){var _0x2b69d3=this;return new Promise(function(_0x28e015,_0x393887){return db['SalesforceAccount'][_0xdc13('0x16')]({'raw':_0x519d91[_0xdc13('0x17')]?_0x519d91[_0xdc13('0x17')][_0xdc13('0x18')]===undefined?!![]:![]:!![],'where':_0x519d91[_0xdc13('0x17')]?_0x519d91[_0xdc13('0x17')][_0xdc13('0x19')]||null:null,'attributes':_0x519d91[_0xdc13('0x17')]?_0x519d91[_0xdc13('0x17')]['attributes']||null:null,'limit':_0x519d91[_0xdc13('0x17')]?_0x519d91[_0xdc13('0x17')][_0xdc13('0x1a')]||null:null,'include':_0x519d91['options']?_0x519d91[_0xdc13('0x17')]['include']?_[_0xdc13('0x1b')](_0x519d91[_0xdc13('0x17')][_0xdc13('0x1c')],function(_0x2095a8){return{'model':db[_0x2095a8[_0xdc13('0x1d')]],'as':_0x2095a8['as'],'attributes':_0x2095a8[_0xdc13('0x1e')],'include':_0x2095a8[_0xdc13('0x1c')]?_['map'](_0x2095a8[_0xdc13('0x1c')],function(_0x5ebcd1){return{'model':db[_0x5ebcd1['model']],'as':_0x5ebcd1['as'],'attributes':_0x5ebcd1[_0xdc13('0x1e')],'include':_0x5ebcd1[_0xdc13('0x1c')]?_[_0xdc13('0x1b')](_0x5ebcd1[_0xdc13('0x1c')],function(_0xbf6f3){return{'model':db[_0xbf6f3[_0xdc13('0x1d')]],'as':_0xbf6f3['as'],'attributes':_0xbf6f3[_0xdc13('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdc13('0xd')](function(_0x161bde){logger[_0xdc13('0xe')]('GetSalesforceAccount',_0x519d91);logger[_0xdc13('0x10')]('GetSalesforceAccount',_0x519d91,JSON[_0xdc13('0x1f')](_0x161bde));_0x28e015(_0x161bde);})[_0xdc13('0x20')](function(_0x5f1f92){logger[_0xdc13('0x12')](_0xdc13('0x15'),_0x5f1f92[_0xdc13('0x14')],_0x519d91);_0x393887(_0x2b69d3[_0xdc13('0x12')](0x1f4,_0x5f1f92['message']));});});};exports['ShowSalesforceAccount']=function(_0x1611c1){var _0x1fbb97=this;return new Promise(function(_0x1dcbb7,_0x3e52d3){return db['SalesforceAccount'][_0xdc13('0x21')]({'raw':_0x1611c1[_0xdc13('0x17')]?_0x1611c1['options'][_0xdc13('0x18')]===undefined?!![]:![]:!![],'where':_0x1611c1[_0xdc13('0x17')]?_0x1611c1['options'][_0xdc13('0x19')]||null:null,'attributes':_0x1611c1[_0xdc13('0x17')]?_0x1611c1[_0xdc13('0x17')][_0xdc13('0x1e')]||null:null,'include':_0x1611c1[_0xdc13('0x17')]?_0x1611c1['options'][_0xdc13('0x1c')]?_[_0xdc13('0x1b')](_0x1611c1[_0xdc13('0x17')][_0xdc13('0x1c')],function(_0x36b00f){return{'model':db[_0x36b00f[_0xdc13('0x1d')]],'as':_0x36b00f['as'],'attributes':_0x36b00f[_0xdc13('0x1e')],'include':_0x36b00f['include']?_['map'](_0x36b00f[_0xdc13('0x1c')],function(_0x546c22){return{'model':db[_0x546c22['model']],'as':_0x546c22['as'],'attributes':_0x546c22[_0xdc13('0x1e')],'include':_0x546c22[_0xdc13('0x1c')]?_['map'](_0x546c22[_0xdc13('0x1c')],function(_0x1c8a24){return{'model':db[_0x1c8a24[_0xdc13('0x1d')]],'as':_0x1c8a24['as'],'attributes':_0x1c8a24['attributes']};}):[]};}):[]};}):[]:[]})[_0xdc13('0xd')](function(_0x1d0e9b){logger[_0xdc13('0xe')](_0xdc13('0x22'),_0x1611c1);logger['debug']('ShowSalesforceAccount',_0x1611c1,JSON[_0xdc13('0x1f')](_0x1d0e9b));_0x1dcbb7(_0x1d0e9b);})[_0xdc13('0x20')](function(_0x423691){logger[_0xdc13('0x12')](_0xdc13('0x22'),_0x423691[_0xdc13('0x14')],_0x1611c1);_0x3e52d3(_0x1fbb97[_0xdc13('0x12')](0x1f4,_0x423691[_0xdc13('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index cae5eb8..96a6d3e 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 _0xa395=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','getFields','getSubjects','/:id/descriptions','update','delete','/:id','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xa395,0x9b));var _0x5a39=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa395[_0x13ea00];return _0x1f7347;};'use strict';var multer=require('multer');var util=require(_0x5a39('0x0'));var path=require('path');var timeout=require(_0x5a39('0x1'));var express=require(_0x5a39('0x2'));var router=express[_0x5a39('0x3')]();var auth=require(_0x5a39('0x4'));var interaction=require(_0x5a39('0x5'));var config=require(_0x5a39('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5a39('0x7')]('/',auth[_0x5a39('0x8')](),controller[_0x5a39('0x9')]);router[_0x5a39('0x7')]('/:id',auth[_0x5a39('0x8')](),controller[_0x5a39('0xa')]);router[_0x5a39('0x7')](_0x5a39('0xb'),auth[_0x5a39('0x8')](),controller[_0x5a39('0xc')]);router[_0x5a39('0x7')]('/:id/subjects',auth[_0x5a39('0x8')](),controller[_0x5a39('0xd')]);router['get'](_0x5a39('0xe'),auth[_0x5a39('0x8')](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5a39('0xf')]);router[_0x5a39('0x10')](_0x5a39('0x11'),auth['isAuthenticated'](),controller[_0x5a39('0x12')]);module[_0x5a39('0x13')]=router; \ No newline at end of file +var _0x386a=['put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x12b853,_0x2c7f4e){var _0x7969a9=function(_0x43f9e8){while(--_0x43f9e8){_0x12b853['push'](_0x12b853['shift']());}};_0x7969a9(++_0x2c7f4e);}(_0x386a,0x1a8));var _0xa386=function(_0x48094e,_0x311796){_0x48094e=_0x48094e-0x0;var _0x31879d=_0x386a[_0x48094e];return _0x31879d;};'use strict';var multer=require(_0xa386('0x0'));var util=require(_0xa386('0x1'));var path=require(_0xa386('0x2'));var timeout=require(_0xa386('0x3'));var express=require(_0xa386('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa386('0x5'));var config=require(_0xa386('0x6'));var controller=require('./intSalesforceConfiguration.controller');router['get']('/',auth[_0xa386('0x7')](),controller[_0xa386('0x8')]);router[_0xa386('0x9')](_0xa386('0xa'),auth[_0xa386('0x7')](),controller['show']);router[_0xa386('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xa386('0xb')]);router[_0xa386('0x9')](_0xa386('0xc'),auth[_0xa386('0x7')](),controller['getSubjects']);router['get'](_0xa386('0xd'),auth[_0xa386('0x7')](),controller[_0xa386('0xe')]);router[_0xa386('0xf')]('/',auth[_0xa386('0x7')](),controller[_0xa386('0x10')]);router[_0xa386('0x11')](_0xa386('0xa'),auth[_0xa386('0x7')](),controller[_0xa386('0x12')]);router[_0xa386('0x13')]('/:id',auth[_0xa386('0x7')](),controller[_0xa386('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 6df8b9b..9b95ec1 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 _0x0ed2=['nothing','contact','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','lead'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x0ed2,0x124));var _0x20ed=function(_0x3c91dc,_0x355e8f){_0x3c91dc=_0x3c91dc-0x0;var _0x4666a9=_0x0ed2[_0x3c91dc];return _0x4666a9;};'use strict';var Sequelize=require(_0x20ed('0x0'));module[_0x20ed('0x1')]={'name':{'type':Sequelize[_0x20ed('0x2')]},'description':{'type':Sequelize[_0x20ed('0x2')]},'ticketType':{'type':Sequelize[_0x20ed('0x3')](_0x20ed('0x4'),_0x20ed('0x5')),'defaultValue':_0x20ed('0x4')},'moduleSearch':{'type':Sequelize[_0x20ed('0x3')](_0x20ed('0x6'),'contact',_0x20ed('0x7')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x20ed('0x3')](_0x20ed('0x8'),_0x20ed('0x9'),_0x20ed('0x7')),'defaultValue':'lead'}}; \ No newline at end of file +var _0x870d=['STRING','ENUM','Task','Case','contact_lead','contact','lead','nothing','sequelize','exports'];(function(_0x1d6fc6,_0x857c7){var _0x595a5a=function(_0x26ee91){while(--_0x26ee91){_0x1d6fc6['push'](_0x1d6fc6['shift']());}};_0x595a5a(++_0x857c7);}(_0x870d,0x94));var _0xd870=function(_0x451d08,_0x4bab9f){_0x451d08=_0x451d08-0x0;var _0x582884=_0x870d[_0x451d08];return _0x582884;};'use strict';var Sequelize=require(_0xd870('0x0'));module[_0xd870('0x1')]={'name':{'type':Sequelize[_0xd870('0x2')]},'description':{'type':Sequelize[_0xd870('0x2')]},'ticketType':{'type':Sequelize[_0xd870('0x3')](_0xd870('0x4'),_0xd870('0x5')),'defaultValue':_0xd870('0x4')},'moduleSearch':{'type':Sequelize[_0xd870('0x3')](_0xd870('0x6'),_0xd870('0x7'),_0xd870('0x8')),'defaultValue':_0xd870('0x6')},'moduleCreate':{'type':Sequelize['ENUM'](_0xd870('0x9'),_0xd870('0x7'),'lead'),'defaultValue':'lead'}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index e60cc0f..77f8ec6 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 _0xe076=['message','info','catch','sendStatus','status','json','count','limit','set','Content-Range','reject','save','update','end','stack','name','send','index','SalesforceConfiguration','rawAttributes','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','offset','sort','pick','filter','merge','where','map','type','key','VIRTUAL','field','options','findAll','rows','show','params','length','include','find','create','body','getFields','findOne','SalesforceField','order','getSubjects','nolimit','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4f8b22,_0x64ad96){var _0x17a61d=function(_0x1c6403){while(--_0x1c6403){_0x4f8b22['push'](_0x4f8b22['shift']());}};_0x17a61d(++_0x64ad96);}(_0xe076,0x92));var _0x6e07=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xe076[_0x30ae5e];return _0x1f2e93;};'use strict';var pdf=require(_0x6e07('0x0'));var emlformat=require(_0x6e07('0x1'));var rimraf=require(_0x6e07('0x2'));var zipdir=require(_0x6e07('0x3'));var jsonpatch=require(_0x6e07('0x4'));var rp=require(_0x6e07('0x5'));var moment=require('moment');var BPromise=require(_0x6e07('0x6'));var Mustache=require(_0x6e07('0x7'));var util=require(_0x6e07('0x8'));var path=require(_0x6e07('0x9'));var sox=require(_0x6e07('0xa'));var csv=require(_0x6e07('0xb'));var ejs=require(_0x6e07('0xc'));var fs=require('fs');var _=require(_0x6e07('0xd'));var squel=require(_0x6e07('0xe'));var crypto=require('crypto');var jsforce=require(_0x6e07('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6e07('0xb'));var querystring=require(_0x6e07('0x10'));var Papa=require(_0x6e07('0x11'));var Redis=require(_0x6e07('0x12'));var authService=require(_0x6e07('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6e07('0x14'));var logger=require('../../config/logger')(_0x6e07('0x15'));var utils=require(_0x6e07('0x16'));var config=require('../../config/environment');var db=require(_0x6e07('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x6e07('0x18')][_0x6e07('0x19')]({'port':0x232a});function checkPasswordPattern(_0x13613b,_0x32894b,_0x10a340){if(_0x10a340){var _0x55ba12=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x55ba12['test'](_0x32894b)){return _0x13613b;}else{throw new Error(_0x6e07('0x1a'));}}else{return _0x13613b;}}function respondWithRpcPromise(_0x3159be,_0x15e3c1,_0x104b0b,_0x55f268){return new BPromise(function(_0x5b104e,_0xa8658b){var _0x2f5b79=_0x55f268||client;return _0x2f5b79['request'](_0x3159be,_0x104b0b)[_0x6e07('0x1b')](function(_0x30f708){logger['info'](_0x6e07('0x1c'),_0x15e3c1,_0x6e07('0x1d'));logger['debug'](_0x6e07('0x1e'),_0x15e3c1,_0x6e07('0x1d'),JSON[_0x6e07('0x1f')](_0x30f708));if(_0x30f708[_0x6e07('0x20')]){if(_0x30f708[_0x6e07('0x20')][_0x6e07('0x21')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x15e3c1,_0x30f708['error'][_0x6e07('0x22')]);return _0xa8658b(_0x30f708[_0x6e07('0x20')][_0x6e07('0x22')]);}logger[_0x6e07('0x20')](_0x6e07('0x1c'),_0x15e3c1,_0x30f708['error'][_0x6e07('0x22')]);return _0x5b104e(_0x30f708[_0x6e07('0x20')][_0x6e07('0x22')]);}else{logger[_0x6e07('0x23')](_0x6e07('0x1c'),_0x15e3c1,'request\x20sent');_0x5b104e(_0x30f708['result']['message']);}})[_0x6e07('0x24')](function(_0x5bf881){logger['error'](_0x6e07('0x1c'),_0x15e3c1,_0x5bf881);_0xa8658b(_0x5bf881);});});}function respondWithStatusCode(_0x546052,_0x4b9f09){_0x4b9f09=_0x4b9f09||0xcc;return function(_0x18f636){if(_0x18f636){return _0x546052[_0x6e07('0x25')](_0x4b9f09);}return _0x546052['status'](_0x4b9f09)['end']();};}function respondWithResult(_0x12120c,_0x396de0){_0x396de0=_0x396de0||0xc8;return function(_0x26d5cd){if(_0x26d5cd){return _0x12120c[_0x6e07('0x26')](_0x396de0)[_0x6e07('0x27')](_0x26d5cd);}};}function respondWithFilteredResult(_0x189208,_0x69e958){return function(_0x94ea2b){if(_0x94ea2b){var _0x29bbb6=_0x94ea2b[_0x6e07('0x28')],_0xb017bf=_0x69e958['offset'],_0x2968ed=_0x69e958['offset']+_0x69e958[_0x6e07('0x29')],_0x469853;if(_0x2968ed>=_0x29bbb6){_0x2968ed=_0x29bbb6;_0x469853=0xc8;}else{_0x469853=0xce;}_0x189208['status'](_0x469853);return _0x189208[_0x6e07('0x2a')](_0x6e07('0x2b'),_0xb017bf+'-'+_0x2968ed+'/'+_0x29bbb6)[_0x6e07('0x27')](_0x94ea2b);}return null;};}function patchUpdates(_0x35f1bc){return function(_0x421d06){try{jsonpatch['apply'](_0x421d06,_0x35f1bc,!![]);}catch(_0x40d222){return BPromise[_0x6e07('0x2c')](_0x40d222);}return _0x421d06[_0x6e07('0x2d')]();};}function saveUpdates(_0x525198,_0x47d0d7){return function(_0x3dc74e){if(_0x3dc74e){return _0x3dc74e[_0x6e07('0x2e')](_0x525198)[_0x6e07('0x1b')](function(_0x7ee9c9){return _0x7ee9c9;});}return null;};}function removeEntity(_0x3214f0,_0x2d733b){return function(_0x27852d){if(_0x27852d){return _0x27852d['destroy']()['then'](function(){_0x3214f0[_0x6e07('0x26')](0xcc)[_0x6e07('0x2f')]();});}};}function handleEntityNotFound(_0x383849,_0xdb6316){return function(_0x166ece){if(!_0x166ece){_0x383849[_0x6e07('0x25')](0x194);}return _0x166ece;};}function handleError(_0x13202e,_0x4f0794){_0x4f0794=_0x4f0794||0x1f4;return function(_0x4ddebd){logger[_0x6e07('0x20')](_0x4ddebd[_0x6e07('0x30')]);if(_0x4ddebd[_0x6e07('0x31')]){delete _0x4ddebd[_0x6e07('0x31')];}_0x13202e[_0x6e07('0x26')](_0x4f0794)[_0x6e07('0x32')](_0x4ddebd);};}exports[_0x6e07('0x33')]=function(_0x401964,_0x2d6d78){var _0x416e0d={},_0x2f6161={},_0x1010b2={'count':0x0,'rows':[]};var _0x25aebd=db[_0x6e07('0x34')][_0x6e07('0x35')];_0x2f6161['model']=_[_0x6e07('0x36')](_0x25aebd);_0x2f6161[_0x6e07('0x37')]=_[_0x6e07('0x36')](_0x401964[_0x6e07('0x37')]);_0x2f6161[_0x6e07('0x38')]=_[_0x6e07('0x39')](_0x2f6161[_0x6e07('0x3a')],_0x2f6161['query']);_0x416e0d[_0x6e07('0x3b')]=_['intersection'](_0x2f6161['model'],qs[_0x6e07('0x3c')](_0x401964[_0x6e07('0x37')][_0x6e07('0x3c')]));_0x416e0d[_0x6e07('0x3b')]=_0x416e0d[_0x6e07('0x3b')]['length']?_0x416e0d[_0x6e07('0x3b')]:_0x2f6161[_0x6e07('0x3a')];if(!_0x401964['query'][_0x6e07('0x3d')]('nolimit')){_0x416e0d[_0x6e07('0x29')]=qs[_0x6e07('0x29')](_0x401964[_0x6e07('0x37')]['limit']);_0x416e0d['offset']=qs['offset'](_0x401964['query'][_0x6e07('0x3e')]);}_0x416e0d['order']=qs[_0x6e07('0x3f')](_0x401964[_0x6e07('0x37')][_0x6e07('0x3f')]);_0x416e0d['where']=qs[_0x6e07('0x38')](_[_0x6e07('0x40')](_0x401964['query'],_0x2f6161[_0x6e07('0x38')]));if(_0x401964[_0x6e07('0x37')][_0x6e07('0x41')]){_0x416e0d['where']=_[_0x6e07('0x42')](_0x416e0d[_0x6e07('0x43')],{'$or':_[_0x6e07('0x44')](_0x25aebd,function(_0x151c84){if(_0x151c84[_0x6e07('0x45')][_0x6e07('0x46')]!==_0x6e07('0x47')){var _0x506570={};_0x506570[_0x151c84[_0x6e07('0x48')]]={'$like':'%'+_0x401964[_0x6e07('0x37')]['filter']+'%'};return _0x506570;}})});}_0x416e0d=_[_0x6e07('0x42')]({},_0x416e0d,_0x401964[_0x6e07('0x49')]);var _0x451a27={'where':_0x416e0d[_0x6e07('0x43')]};return db[_0x6e07('0x34')][_0x6e07('0x28')](_0x451a27)['then'](function(_0x3bdac4){_0x1010b2[_0x6e07('0x28')]=_0x3bdac4;if(_0x401964[_0x6e07('0x37')]['includeAll']){_0x416e0d['include']=[{'all':!![]}];}return db[_0x6e07('0x34')][_0x6e07('0x4a')](_0x416e0d);})[_0x6e07('0x1b')](function(_0x18a940){_0x1010b2[_0x6e07('0x4b')]=_0x18a940;return _0x1010b2;})[_0x6e07('0x1b')](respondWithFilteredResult(_0x2d6d78,_0x416e0d))[_0x6e07('0x24')](handleError(_0x2d6d78,null));};exports[_0x6e07('0x4c')]=function(_0x25d1aa,_0x45cf0f){var _0x2d2318={'raw':![],'where':{'id':_0x25d1aa[_0x6e07('0x4d')]['id']}},_0x4abbda={};_0x4abbda['model']=_['keys'](db['SalesforceConfiguration'][_0x6e07('0x35')]);_0x4abbda[_0x6e07('0x37')]=_['keys'](_0x25d1aa[_0x6e07('0x37')]);_0x4abbda['filters']=_[_0x6e07('0x39')](_0x4abbda[_0x6e07('0x3a')],_0x4abbda[_0x6e07('0x37')]);_0x2d2318['attributes']=_[_0x6e07('0x39')](_0x4abbda['model'],qs['fields'](_0x25d1aa['query'][_0x6e07('0x3c')]));_0x2d2318[_0x6e07('0x3b')]=_0x2d2318['attributes'][_0x6e07('0x4e')]?_0x2d2318[_0x6e07('0x3b')]:_0x4abbda[_0x6e07('0x3a')];if(_0x25d1aa[_0x6e07('0x37')]['includeAll']){_0x2d2318[_0x6e07('0x4f')]=[{'all':!![]}];}_0x2d2318=_[_0x6e07('0x42')]({},_0x2d2318,_0x25d1aa[_0x6e07('0x49')]);return db[_0x6e07('0x34')][_0x6e07('0x50')](_0x2d2318)['then'](handleEntityNotFound(_0x45cf0f,null))[_0x6e07('0x1b')](respondWithResult(_0x45cf0f,null))[_0x6e07('0x24')](handleError(_0x45cf0f,null));};exports['create']=function(_0x1f36a8,_0x16aa1f){return db[_0x6e07('0x34')][_0x6e07('0x51')](_0x1f36a8['body'],{})[_0x6e07('0x1b')](respondWithResult(_0x16aa1f,0xc9))[_0x6e07('0x24')](handleError(_0x16aa1f,null));};exports['update']=function(_0x5aa7e4,_0x3ead7c){if(_0x5aa7e4[_0x6e07('0x52')]['id']){delete _0x5aa7e4[_0x6e07('0x52')]['id'];}return db[_0x6e07('0x34')]['find']({'where':{'id':_0x5aa7e4[_0x6e07('0x4d')]['id']}})[_0x6e07('0x1b')](handleEntityNotFound(_0x3ead7c,null))[_0x6e07('0x1b')](saveUpdates(_0x5aa7e4['body'],null))['then'](respondWithResult(_0x3ead7c,null))['catch'](handleError(_0x3ead7c,null));};exports['destroy']=function(_0x16941b,_0xd9eb0e){return db[_0x6e07('0x34')][_0x6e07('0x50')]({'where':{'id':_0x16941b['params']['id']}})['then'](handleEntityNotFound(_0xd9eb0e,null))[_0x6e07('0x1b')](removeEntity(_0xd9eb0e,null))[_0x6e07('0x24')](handleError(_0xd9eb0e,null));};exports[_0x6e07('0x53')]=function(_0x365c0f,_0x734753,_0x1cc27b){var _0x5977f0={};var _0x5431ea={};var _0x287c1d;var _0x2d345f;return db[_0x6e07('0x34')][_0x6e07('0x54')]({'where':{'id':_0x365c0f[_0x6e07('0x4d')]['id']}})['then'](handleEntityNotFound(_0x734753,null))[_0x6e07('0x1b')](function(_0x5dc8d1){if(_0x5dc8d1){_0x287c1d=_0x5dc8d1;_0x5431ea[_0x6e07('0x3a')]=_[_0x6e07('0x36')](db[_0x6e07('0x55')][_0x6e07('0x35')]);_0x5431ea['query']=_[_0x6e07('0x36')](_0x365c0f['query']);_0x5431ea[_0x6e07('0x38')]=_[_0x6e07('0x39')](_0x5431ea[_0x6e07('0x3a')],_0x5431ea[_0x6e07('0x37')]);_0x5977f0[_0x6e07('0x3b')]=_[_0x6e07('0x39')](_0x5431ea[_0x6e07('0x3a')],qs[_0x6e07('0x3c')](_0x365c0f[_0x6e07('0x37')][_0x6e07('0x3c')]));_0x5977f0['attributes']=_0x5977f0['attributes']['length']?_0x5977f0[_0x6e07('0x3b')]:_0x5431ea[_0x6e07('0x3a')];_0x5977f0[_0x6e07('0x56')]=qs[_0x6e07('0x3f')](_0x365c0f['query'][_0x6e07('0x3f')]);_0x5977f0[_0x6e07('0x43')]=qs[_0x6e07('0x38')](_[_0x6e07('0x40')](_0x365c0f[_0x6e07('0x37')],_0x5431ea[_0x6e07('0x38')]));if(_0x365c0f[_0x6e07('0x37')]['filter']){_0x5977f0[_0x6e07('0x43')]=_[_0x6e07('0x42')](_0x5977f0['where'],{'$or':_[_0x6e07('0x44')](_0x5977f0['attributes'],function(_0x5c6df8){var _0x4e66a1={};_0x4e66a1[_0x5c6df8]={'$like':'%'+_0x365c0f['query']['filter']+'%'};return _0x4e66a1;})});}_0x5977f0=_[_0x6e07('0x42')]({},_0x5977f0,_0x365c0f[_0x6e07('0x49')]);return _0x287c1d[_0x6e07('0x53')](_0x5977f0);}})[_0x6e07('0x1b')](function(_0x5bce8b){if(_0x5bce8b){_0x2d345f=_0x5bce8b[_0x6e07('0x4e')];if(!_0x365c0f['query'][_0x6e07('0x3d')]('nolimit')){_0x5977f0['limit']=qs[_0x6e07('0x29')](_0x365c0f[_0x6e07('0x37')]['limit']);_0x5977f0[_0x6e07('0x3e')]=qs[_0x6e07('0x3e')](_0x365c0f[_0x6e07('0x37')][_0x6e07('0x3e')]);}return _0x287c1d[_0x6e07('0x53')](_0x5977f0);}})[_0x6e07('0x1b')](function(_0x9c9f8d){if(_0x9c9f8d){return _0x9c9f8d?{'count':_0x2d345f,'rows':_0x9c9f8d}:null;}})[_0x6e07('0x1b')](respondWithResult(_0x734753,null))[_0x6e07('0x24')](handleError(_0x734753,null));};exports['getSubjects']=function(_0x5d7d52,_0x34257c,_0x6ac437){var _0xedad46={};var _0x414d8c={};var _0x420fff;var _0x113b28;return db[_0x6e07('0x34')][_0x6e07('0x54')]({'where':{'id':_0x5d7d52['params']['id']}})[_0x6e07('0x1b')](handleEntityNotFound(_0x34257c,null))['then'](function(_0x58d686){if(_0x58d686){_0x420fff=_0x58d686;_0x414d8c[_0x6e07('0x3a')]=_[_0x6e07('0x36')](db[_0x6e07('0x55')][_0x6e07('0x35')]);_0x414d8c[_0x6e07('0x37')]=_[_0x6e07('0x36')](_0x5d7d52['query']);_0x414d8c[_0x6e07('0x38')]=_['intersection'](_0x414d8c[_0x6e07('0x3a')],_0x414d8c['query']);_0xedad46[_0x6e07('0x3b')]=_[_0x6e07('0x39')](_0x414d8c[_0x6e07('0x3a')],qs['fields'](_0x5d7d52[_0x6e07('0x37')]['fields']));_0xedad46[_0x6e07('0x3b')]=_0xedad46[_0x6e07('0x3b')][_0x6e07('0x4e')]?_0xedad46[_0x6e07('0x3b')]:_0x414d8c['model'];_0xedad46[_0x6e07('0x56')]=qs[_0x6e07('0x3f')](_0x5d7d52[_0x6e07('0x37')][_0x6e07('0x3f')]);_0xedad46[_0x6e07('0x43')]=qs['filters'](_[_0x6e07('0x40')](_0x5d7d52['query'],_0x414d8c[_0x6e07('0x38')]));if(_0x5d7d52[_0x6e07('0x37')]['filter']){_0xedad46[_0x6e07('0x43')]=_[_0x6e07('0x42')](_0xedad46[_0x6e07('0x43')],{'$or':_[_0x6e07('0x44')](_0xedad46[_0x6e07('0x3b')],function(_0x586688){var _0x1dec06={};_0x1dec06[_0x586688]={'$like':'%'+_0x5d7d52[_0x6e07('0x37')]['filter']+'%'};return _0x1dec06;})});}_0xedad46=_[_0x6e07('0x42')]({},_0xedad46,_0x5d7d52[_0x6e07('0x49')]);return _0x420fff[_0x6e07('0x57')](_0xedad46);}})[_0x6e07('0x1b')](function(_0x256db0){if(_0x256db0){_0x113b28=_0x256db0[_0x6e07('0x4e')];if(!_0x5d7d52[_0x6e07('0x37')][_0x6e07('0x3d')](_0x6e07('0x58'))){_0xedad46[_0x6e07('0x29')]=qs['limit'](_0x5d7d52[_0x6e07('0x37')]['limit']);_0xedad46[_0x6e07('0x3e')]=qs['offset'](_0x5d7d52['query'][_0x6e07('0x3e')]);}return _0x420fff[_0x6e07('0x57')](_0xedad46);}})[_0x6e07('0x1b')](function(_0x22bc7c){if(_0x22bc7c){return _0x22bc7c?{'count':_0x113b28,'rows':_0x22bc7c}:null;}})[_0x6e07('0x1b')](respondWithResult(_0x34257c,null))[_0x6e07('0x24')](handleError(_0x34257c,null));};exports[_0x6e07('0x59')]=function(_0x566b77,_0x12fa71,_0x17fe13){var _0x28a885={};var _0x7fc8e5={};var _0xc810b5;var _0x5a9b59;return db[_0x6e07('0x34')]['findOne']({'where':{'id':_0x566b77[_0x6e07('0x4d')]['id']}})[_0x6e07('0x1b')](handleEntityNotFound(_0x12fa71,null))[_0x6e07('0x1b')](function(_0x5533ab){if(_0x5533ab){_0xc810b5=_0x5533ab;_0x7fc8e5[_0x6e07('0x3a')]=_[_0x6e07('0x36')](db['SalesforceField'][_0x6e07('0x35')]);_0x7fc8e5[_0x6e07('0x37')]=_[_0x6e07('0x36')](_0x566b77[_0x6e07('0x37')]);_0x7fc8e5[_0x6e07('0x38')]=_[_0x6e07('0x39')](_0x7fc8e5['model'],_0x7fc8e5[_0x6e07('0x37')]);_0x28a885[_0x6e07('0x3b')]=_[_0x6e07('0x39')](_0x7fc8e5[_0x6e07('0x3a')],qs[_0x6e07('0x3c')](_0x566b77[_0x6e07('0x37')][_0x6e07('0x3c')]));_0x28a885[_0x6e07('0x3b')]=_0x28a885[_0x6e07('0x3b')]['length']?_0x28a885[_0x6e07('0x3b')]:_0x7fc8e5['model'];_0x28a885[_0x6e07('0x56')]=qs[_0x6e07('0x3f')](_0x566b77[_0x6e07('0x37')][_0x6e07('0x3f')]);_0x28a885[_0x6e07('0x43')]=qs[_0x6e07('0x38')](_['pick'](_0x566b77[_0x6e07('0x37')],_0x7fc8e5[_0x6e07('0x38')]));if(_0x566b77[_0x6e07('0x37')]['filter']){_0x28a885['where']=_[_0x6e07('0x42')](_0x28a885[_0x6e07('0x43')],{'$or':_[_0x6e07('0x44')](_0x28a885['attributes'],function(_0x3dbb2a){var _0x436ba7={};_0x436ba7[_0x3dbb2a]={'$like':'%'+_0x566b77[_0x6e07('0x37')][_0x6e07('0x41')]+'%'};return _0x436ba7;})});}_0x28a885=_[_0x6e07('0x42')]({},_0x28a885,_0x566b77['options']);return _0xc810b5[_0x6e07('0x59')](_0x28a885);}})[_0x6e07('0x1b')](function(_0x422a9c){if(_0x422a9c){_0x5a9b59=_0x422a9c[_0x6e07('0x4e')];if(!_0x566b77[_0x6e07('0x37')][_0x6e07('0x3d')](_0x6e07('0x58'))){_0x28a885[_0x6e07('0x29')]=qs[_0x6e07('0x29')](_0x566b77[_0x6e07('0x37')]['limit']);_0x28a885[_0x6e07('0x3e')]=qs[_0x6e07('0x3e')](_0x566b77[_0x6e07('0x37')][_0x6e07('0x3e')]);}return _0xc810b5[_0x6e07('0x59')](_0x28a885);}})['then'](function(_0xde569d){if(_0xde569d){return _0xde569d?{'count':_0x5a9b59,'rows':_0xde569d}:null;}})[_0x6e07('0x1b')](respondWithResult(_0x12fa71,null))['catch'](handleError(_0x12fa71,null));}; \ No newline at end of file +var _0x7d2b=['code','message','result','catch','status','end','json','count','limit','set','reject','save','update','destroy','stack','name','send','index','SalesforceConfiguration','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','offset','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','params','length','find','create','body','getFields','SalesforceField','getSubjects','findOne','order','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3e9e15,_0x37c29b){var _0x592e84=function(_0x243bab){while(--_0x243bab){_0x3e9e15['push'](_0x3e9e15['shift']());}};_0x592e84(++_0x37c29b);}(_0x7d2b,0x19e));var _0xb7d2=function(_0x402993,_0x300e26){_0x402993=_0x402993-0x0;var _0x43c1f4=_0x7d2b[_0x402993];return _0x43c1f4;};'use strict';var pdf=require(_0xb7d2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb7d2('0x1'));var zipdir=require(_0xb7d2('0x2'));var jsonpatch=require(_0xb7d2('0x3'));var rp=require(_0xb7d2('0x4'));var moment=require(_0xb7d2('0x5'));var BPromise=require(_0xb7d2('0x6'));var Mustache=require(_0xb7d2('0x7'));var util=require(_0xb7d2('0x8'));var path=require('path');var sox=require(_0xb7d2('0x9'));var csv=require(_0xb7d2('0xa'));var ejs=require(_0xb7d2('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb7d2('0xc'));var crypto=require('crypto');var jsforce=require(_0xb7d2('0xd'));var deskjs=require(_0xb7d2('0xe'));var toCsv=require(_0xb7d2('0xa'));var querystring=require(_0xb7d2('0xf'));var Papa=require(_0xb7d2('0x10'));var Redis=require(_0xb7d2('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb7d2('0x12'));var logger=require(_0xb7d2('0x13'))(_0xb7d2('0x14'));var utils=require(_0xb7d2('0x15'));var config=require(_0xb7d2('0x16'));var db=require(_0xb7d2('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xb7d2('0x18')][_0xb7d2('0x19')]({'port':0x232a});function checkPasswordPattern(_0x34a424,_0x154cc8,_0x2f9884){if(_0x2f9884){var _0x33d496=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x33d496[_0xb7d2('0x1a')](_0x154cc8)){return _0x34a424;}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 _0x34a424;}}function respondWithRpcPromise(_0x19b4c7,_0x4b17b0,_0x48f30a,_0x54df78){return new BPromise(function(_0x5e80b8,_0x2ea0fa){var _0x247b11=_0x54df78||client;return _0x247b11[_0xb7d2('0x1b')](_0x19b4c7,_0x48f30a)[_0xb7d2('0x1c')](function(_0x4837ae){logger[_0xb7d2('0x1d')](_0xb7d2('0x1e'),_0x4b17b0,_0xb7d2('0x1f'));logger[_0xb7d2('0x20')](_0xb7d2('0x21'),_0x4b17b0,_0xb7d2('0x1f'),JSON[_0xb7d2('0x22')](_0x4837ae));if(_0x4837ae[_0xb7d2('0x23')]){if(_0x4837ae[_0xb7d2('0x23')][_0xb7d2('0x24')]===0x1f4){logger['error'](_0xb7d2('0x1e'),_0x4b17b0,_0x4837ae[_0xb7d2('0x23')][_0xb7d2('0x25')]);return _0x2ea0fa(_0x4837ae[_0xb7d2('0x23')][_0xb7d2('0x25')]);}logger[_0xb7d2('0x23')](_0xb7d2('0x1e'),_0x4b17b0,_0x4837ae[_0xb7d2('0x23')]['message']);return _0x5e80b8(_0x4837ae[_0xb7d2('0x23')]['message']);}else{logger[_0xb7d2('0x1d')](_0xb7d2('0x1e'),_0x4b17b0,_0xb7d2('0x1f'));_0x5e80b8(_0x4837ae[_0xb7d2('0x26')][_0xb7d2('0x25')]);}})[_0xb7d2('0x27')](function(_0x3f1a88){logger['error'](_0xb7d2('0x1e'),_0x4b17b0,_0x3f1a88);_0x2ea0fa(_0x3f1a88);});});}function respondWithStatusCode(_0x3defa0,_0xc92288){_0xc92288=_0xc92288||0xcc;return function(_0x25aa01){if(_0x25aa01){return _0x3defa0['sendStatus'](_0xc92288);}return _0x3defa0[_0xb7d2('0x28')](_0xc92288)[_0xb7d2('0x29')]();};}function respondWithResult(_0x52a235,_0x7fa9){_0x7fa9=_0x7fa9||0xc8;return function(_0x563300){if(_0x563300){return _0x52a235['status'](_0x7fa9)[_0xb7d2('0x2a')](_0x563300);}};}function respondWithFilteredResult(_0x145ed1,_0x3c3560){return function(_0x134a8f){if(_0x134a8f){var _0x250009=_0x134a8f[_0xb7d2('0x2b')],_0x1d7813=_0x3c3560['offset'],_0x249912=_0x3c3560['offset']+_0x3c3560[_0xb7d2('0x2c')],_0x506ec6;if(_0x249912>=_0x250009){_0x249912=_0x250009;_0x506ec6=0xc8;}else{_0x506ec6=0xce;}_0x145ed1[_0xb7d2('0x28')](_0x506ec6);return _0x145ed1[_0xb7d2('0x2d')]('Content-Range',_0x1d7813+'-'+_0x249912+'/'+_0x250009)[_0xb7d2('0x2a')](_0x134a8f);}return null;};}function patchUpdates(_0x3c0c7b){return function(_0x4784cb){try{jsonpatch['apply'](_0x4784cb,_0x3c0c7b,!![]);}catch(_0x27c5f6){return BPromise[_0xb7d2('0x2e')](_0x27c5f6);}return _0x4784cb[_0xb7d2('0x2f')]();};}function saveUpdates(_0x2c0ade,_0x2c2894){return function(_0x2dcc1b){if(_0x2dcc1b){return _0x2dcc1b[_0xb7d2('0x30')](_0x2c0ade)[_0xb7d2('0x1c')](function(_0x25b964){return _0x25b964;});}return null;};}function removeEntity(_0x4357a4,_0x14645e){return function(_0x109845){if(_0x109845){return _0x109845[_0xb7d2('0x31')]()[_0xb7d2('0x1c')](function(){_0x4357a4[_0xb7d2('0x28')](0xcc)[_0xb7d2('0x29')]();});}};}function handleEntityNotFound(_0x4cd602,_0x256579){return function(_0x287506){if(!_0x287506){_0x4cd602['sendStatus'](0x194);}return _0x287506;};}function handleError(_0x4d9482,_0x26614e){_0x26614e=_0x26614e||0x1f4;return function(_0x25bde3){logger[_0xb7d2('0x23')](_0x25bde3[_0xb7d2('0x32')]);if(_0x25bde3[_0xb7d2('0x33')]){delete _0x25bde3[_0xb7d2('0x33')];}_0x4d9482[_0xb7d2('0x28')](_0x26614e)[_0xb7d2('0x34')](_0x25bde3);};}exports[_0xb7d2('0x35')]=function(_0x230004,_0x4d032b){var _0xd1d7a8={},_0xd524f9={},_0x5f32b4={'count':0x0,'rows':[]};var _0xdb18e4=db[_0xb7d2('0x36')][_0xb7d2('0x37')];_0xd524f9[_0xb7d2('0x38')]=_[_0xb7d2('0x39')](_0xdb18e4);_0xd524f9[_0xb7d2('0x3a')]=_[_0xb7d2('0x39')](_0x230004['query']);_0xd524f9[_0xb7d2('0x3b')]=_['intersection'](_0xd524f9[_0xb7d2('0x38')],_0xd524f9[_0xb7d2('0x3a')]);_0xd1d7a8[_0xb7d2('0x3c')]=_[_0xb7d2('0x3d')](_0xd524f9[_0xb7d2('0x38')],qs['fields'](_0x230004[_0xb7d2('0x3a')][_0xb7d2('0x3e')]));_0xd1d7a8[_0xb7d2('0x3c')]=_0xd1d7a8['attributes']['length']?_0xd1d7a8[_0xb7d2('0x3c')]:_0xd524f9[_0xb7d2('0x38')];if(!_0x230004[_0xb7d2('0x3a')][_0xb7d2('0x3f')](_0xb7d2('0x40'))){_0xd1d7a8['limit']=qs[_0xb7d2('0x2c')](_0x230004[_0xb7d2('0x3a')][_0xb7d2('0x2c')]);_0xd1d7a8[_0xb7d2('0x41')]=qs['offset'](_0x230004[_0xb7d2('0x3a')][_0xb7d2('0x41')]);}_0xd1d7a8['order']=qs[_0xb7d2('0x42')](_0x230004[_0xb7d2('0x3a')]['sort']);_0xd1d7a8['where']=qs[_0xb7d2('0x3b')](_[_0xb7d2('0x43')](_0x230004[_0xb7d2('0x3a')],_0xd524f9['filters']));if(_0x230004[_0xb7d2('0x3a')][_0xb7d2('0x44')]){_0xd1d7a8[_0xb7d2('0x45')]=_[_0xb7d2('0x46')](_0xd1d7a8[_0xb7d2('0x45')],{'$or':_[_0xb7d2('0x47')](_0xdb18e4,function(_0x4ec293){if(_0x4ec293[_0xb7d2('0x48')][_0xb7d2('0x49')]!==_0xb7d2('0x4a')){var _0x1c0c66={};_0x1c0c66[_0x4ec293[_0xb7d2('0x4b')]]={'$like':'%'+_0x230004[_0xb7d2('0x3a')][_0xb7d2('0x44')]+'%'};return _0x1c0c66;}})});}_0xd1d7a8=_['merge']({},_0xd1d7a8,_0x230004[_0xb7d2('0x4c')]);var _0x3cf021={'where':_0xd1d7a8['where']};return db[_0xb7d2('0x36')][_0xb7d2('0x2b')](_0x3cf021)[_0xb7d2('0x1c')](function(_0x4264f5){_0x5f32b4[_0xb7d2('0x2b')]=_0x4264f5;if(_0x230004[_0xb7d2('0x3a')][_0xb7d2('0x4d')]){_0xd1d7a8[_0xb7d2('0x4e')]=[{'all':!![]}];}return db[_0xb7d2('0x36')]['findAll'](_0xd1d7a8);})[_0xb7d2('0x1c')](function(_0x4f202c){_0x5f32b4['rows']=_0x4f202c;return _0x5f32b4;})[_0xb7d2('0x1c')](respondWithFilteredResult(_0x4d032b,_0xd1d7a8))[_0xb7d2('0x27')](handleError(_0x4d032b,null));};exports['show']=function(_0x2ce3ed,_0x5602b0){var _0x2ea544={'raw':![],'where':{'id':_0x2ce3ed[_0xb7d2('0x4f')]['id']}},_0x497d1c={};_0x497d1c[_0xb7d2('0x38')]=_[_0xb7d2('0x39')](db[_0xb7d2('0x36')]['rawAttributes']);_0x497d1c[_0xb7d2('0x3a')]=_[_0xb7d2('0x39')](_0x2ce3ed['query']);_0x497d1c[_0xb7d2('0x3b')]=_['intersection'](_0x497d1c[_0xb7d2('0x38')],_0x497d1c[_0xb7d2('0x3a')]);_0x2ea544[_0xb7d2('0x3c')]=_[_0xb7d2('0x3d')](_0x497d1c[_0xb7d2('0x38')],qs[_0xb7d2('0x3e')](_0x2ce3ed[_0xb7d2('0x3a')][_0xb7d2('0x3e')]));_0x2ea544[_0xb7d2('0x3c')]=_0x2ea544[_0xb7d2('0x3c')][_0xb7d2('0x50')]?_0x2ea544[_0xb7d2('0x3c')]:_0x497d1c[_0xb7d2('0x38')];if(_0x2ce3ed[_0xb7d2('0x3a')][_0xb7d2('0x4d')]){_0x2ea544['include']=[{'all':!![]}];}_0x2ea544=_[_0xb7d2('0x46')]({},_0x2ea544,_0x2ce3ed[_0xb7d2('0x4c')]);return db[_0xb7d2('0x36')][_0xb7d2('0x51')](_0x2ea544)[_0xb7d2('0x1c')](handleEntityNotFound(_0x5602b0,null))[_0xb7d2('0x1c')](respondWithResult(_0x5602b0,null))[_0xb7d2('0x27')](handleError(_0x5602b0,null));};exports[_0xb7d2('0x52')]=function(_0x419104,_0x125193){return db[_0xb7d2('0x36')][_0xb7d2('0x52')](_0x419104[_0xb7d2('0x53')],{})['then'](respondWithResult(_0x125193,0xc9))[_0xb7d2('0x27')](handleError(_0x125193,null));};exports[_0xb7d2('0x30')]=function(_0xb6fb0b,_0x2e716e){if(_0xb6fb0b[_0xb7d2('0x53')]['id']){delete _0xb6fb0b[_0xb7d2('0x53')]['id'];}return db[_0xb7d2('0x36')]['find']({'where':{'id':_0xb6fb0b['params']['id']}})['then'](handleEntityNotFound(_0x2e716e,null))['then'](saveUpdates(_0xb6fb0b[_0xb7d2('0x53')],null))[_0xb7d2('0x1c')](respondWithResult(_0x2e716e,null))['catch'](handleError(_0x2e716e,null));};exports[_0xb7d2('0x31')]=function(_0x129126,_0x330945){return db[_0xb7d2('0x36')][_0xb7d2('0x51')]({'where':{'id':_0x129126[_0xb7d2('0x4f')]['id']}})[_0xb7d2('0x1c')](handleEntityNotFound(_0x330945,null))[_0xb7d2('0x1c')](removeEntity(_0x330945,null))[_0xb7d2('0x27')](handleError(_0x330945,null));};exports[_0xb7d2('0x54')]=function(_0x7c0312,_0x4fdea2,_0x2e182d){var _0x46f0ac={};var _0x1ff0de={};var _0x1f4f10;var _0x3c4c6b;return db[_0xb7d2('0x36')]['findOne']({'where':{'id':_0x7c0312[_0xb7d2('0x4f')]['id']}})[_0xb7d2('0x1c')](handleEntityNotFound(_0x4fdea2,null))[_0xb7d2('0x1c')](function(_0x2648ca){if(_0x2648ca){_0x1f4f10=_0x2648ca;_0x1ff0de[_0xb7d2('0x38')]=_['keys'](db[_0xb7d2('0x55')]['rawAttributes']);_0x1ff0de[_0xb7d2('0x3a')]=_['keys'](_0x7c0312[_0xb7d2('0x3a')]);_0x1ff0de[_0xb7d2('0x3b')]=_[_0xb7d2('0x3d')](_0x1ff0de[_0xb7d2('0x38')],_0x1ff0de[_0xb7d2('0x3a')]);_0x46f0ac[_0xb7d2('0x3c')]=_[_0xb7d2('0x3d')](_0x1ff0de[_0xb7d2('0x38')],qs['fields'](_0x7c0312[_0xb7d2('0x3a')][_0xb7d2('0x3e')]));_0x46f0ac[_0xb7d2('0x3c')]=_0x46f0ac[_0xb7d2('0x3c')][_0xb7d2('0x50')]?_0x46f0ac[_0xb7d2('0x3c')]:_0x1ff0de['model'];_0x46f0ac['order']=qs[_0xb7d2('0x42')](_0x7c0312[_0xb7d2('0x3a')][_0xb7d2('0x42')]);_0x46f0ac['where']=qs[_0xb7d2('0x3b')](_[_0xb7d2('0x43')](_0x7c0312[_0xb7d2('0x3a')],_0x1ff0de[_0xb7d2('0x3b')]));if(_0x7c0312[_0xb7d2('0x3a')][_0xb7d2('0x44')]){_0x46f0ac['where']=_[_0xb7d2('0x46')](_0x46f0ac[_0xb7d2('0x45')],{'$or':_[_0xb7d2('0x47')](_0x46f0ac[_0xb7d2('0x3c')],function(_0x14af2d){var _0x173c2a={};_0x173c2a[_0x14af2d]={'$like':'%'+_0x7c0312[_0xb7d2('0x3a')][_0xb7d2('0x44')]+'%'};return _0x173c2a;})});}_0x46f0ac=_['merge']({},_0x46f0ac,_0x7c0312[_0xb7d2('0x4c')]);return _0x1f4f10[_0xb7d2('0x54')](_0x46f0ac);}})[_0xb7d2('0x1c')](function(_0x163f4b){if(_0x163f4b){_0x3c4c6b=_0x163f4b[_0xb7d2('0x50')];if(!_0x7c0312['query'][_0xb7d2('0x3f')](_0xb7d2('0x40'))){_0x46f0ac[_0xb7d2('0x2c')]=qs[_0xb7d2('0x2c')](_0x7c0312[_0xb7d2('0x3a')][_0xb7d2('0x2c')]);_0x46f0ac[_0xb7d2('0x41')]=qs[_0xb7d2('0x41')](_0x7c0312[_0xb7d2('0x3a')][_0xb7d2('0x41')]);}return _0x1f4f10[_0xb7d2('0x54')](_0x46f0ac);}})['then'](function(_0x28f505){if(_0x28f505){return _0x28f505?{'count':_0x3c4c6b,'rows':_0x28f505}:null;}})[_0xb7d2('0x1c')](respondWithResult(_0x4fdea2,null))[_0xb7d2('0x27')](handleError(_0x4fdea2,null));};exports[_0xb7d2('0x56')]=function(_0x4b3372,_0x46772e,_0x284cdd){var _0x1c1ebc={};var _0x3c8a94={};var _0x4ccc25;var _0x52f219;return db['SalesforceConfiguration'][_0xb7d2('0x57')]({'where':{'id':_0x4b3372[_0xb7d2('0x4f')]['id']}})['then'](handleEntityNotFound(_0x46772e,null))[_0xb7d2('0x1c')](function(_0x43d488){if(_0x43d488){_0x4ccc25=_0x43d488;_0x3c8a94[_0xb7d2('0x38')]=_[_0xb7d2('0x39')](db['SalesforceField'][_0xb7d2('0x37')]);_0x3c8a94[_0xb7d2('0x3a')]=_[_0xb7d2('0x39')](_0x4b3372[_0xb7d2('0x3a')]);_0x3c8a94[_0xb7d2('0x3b')]=_[_0xb7d2('0x3d')](_0x3c8a94['model'],_0x3c8a94[_0xb7d2('0x3a')]);_0x1c1ebc[_0xb7d2('0x3c')]=_[_0xb7d2('0x3d')](_0x3c8a94[_0xb7d2('0x38')],qs['fields'](_0x4b3372[_0xb7d2('0x3a')][_0xb7d2('0x3e')]));_0x1c1ebc[_0xb7d2('0x3c')]=_0x1c1ebc['attributes'][_0xb7d2('0x50')]?_0x1c1ebc[_0xb7d2('0x3c')]:_0x3c8a94[_0xb7d2('0x38')];_0x1c1ebc[_0xb7d2('0x58')]=qs[_0xb7d2('0x42')](_0x4b3372[_0xb7d2('0x3a')][_0xb7d2('0x42')]);_0x1c1ebc[_0xb7d2('0x45')]=qs['filters'](_[_0xb7d2('0x43')](_0x4b3372[_0xb7d2('0x3a')],_0x3c8a94['filters']));if(_0x4b3372[_0xb7d2('0x3a')][_0xb7d2('0x44')]){_0x1c1ebc[_0xb7d2('0x45')]=_[_0xb7d2('0x46')](_0x1c1ebc[_0xb7d2('0x45')],{'$or':_[_0xb7d2('0x47')](_0x1c1ebc[_0xb7d2('0x3c')],function(_0x4f3e02){var _0x4811a8={};_0x4811a8[_0x4f3e02]={'$like':'%'+_0x4b3372[_0xb7d2('0x3a')][_0xb7d2('0x44')]+'%'};return _0x4811a8;})});}_0x1c1ebc=_[_0xb7d2('0x46')]({},_0x1c1ebc,_0x4b3372[_0xb7d2('0x4c')]);return _0x4ccc25[_0xb7d2('0x56')](_0x1c1ebc);}})[_0xb7d2('0x1c')](function(_0x57f1e1){if(_0x57f1e1){_0x52f219=_0x57f1e1['length'];if(!_0x4b3372[_0xb7d2('0x3a')][_0xb7d2('0x3f')](_0xb7d2('0x40'))){_0x1c1ebc[_0xb7d2('0x2c')]=qs[_0xb7d2('0x2c')](_0x4b3372[_0xb7d2('0x3a')][_0xb7d2('0x2c')]);_0x1c1ebc[_0xb7d2('0x41')]=qs[_0xb7d2('0x41')](_0x4b3372[_0xb7d2('0x3a')][_0xb7d2('0x41')]);}return _0x4ccc25[_0xb7d2('0x56')](_0x1c1ebc);}})[_0xb7d2('0x1c')](function(_0x382599){if(_0x382599){return _0x382599?{'count':_0x52f219,'rows':_0x382599}:null;}})['then'](respondWithResult(_0x46772e,null))[_0xb7d2('0x27')](handleError(_0x46772e,null));};exports[_0xb7d2('0x59')]=function(_0x348c10,_0x281b1d,_0x347443){var _0xc9b2f3={};var _0xb2d9fb={};var _0x3065d9;var _0x15319e;return db[_0xb7d2('0x36')][_0xb7d2('0x57')]({'where':{'id':_0x348c10[_0xb7d2('0x4f')]['id']}})[_0xb7d2('0x1c')](handleEntityNotFound(_0x281b1d,null))[_0xb7d2('0x1c')](function(_0x3e1a20){if(_0x3e1a20){_0x3065d9=_0x3e1a20;_0xb2d9fb['model']=_['keys'](db[_0xb7d2('0x55')][_0xb7d2('0x37')]);_0xb2d9fb[_0xb7d2('0x3a')]=_[_0xb7d2('0x39')](_0x348c10[_0xb7d2('0x3a')]);_0xb2d9fb[_0xb7d2('0x3b')]=_[_0xb7d2('0x3d')](_0xb2d9fb[_0xb7d2('0x38')],_0xb2d9fb['query']);_0xc9b2f3[_0xb7d2('0x3c')]=_[_0xb7d2('0x3d')](_0xb2d9fb[_0xb7d2('0x38')],qs['fields'](_0x348c10[_0xb7d2('0x3a')][_0xb7d2('0x3e')]));_0xc9b2f3[_0xb7d2('0x3c')]=_0xc9b2f3[_0xb7d2('0x3c')][_0xb7d2('0x50')]?_0xc9b2f3[_0xb7d2('0x3c')]:_0xb2d9fb[_0xb7d2('0x38')];_0xc9b2f3[_0xb7d2('0x58')]=qs['sort'](_0x348c10[_0xb7d2('0x3a')][_0xb7d2('0x42')]);_0xc9b2f3[_0xb7d2('0x45')]=qs[_0xb7d2('0x3b')](_[_0xb7d2('0x43')](_0x348c10[_0xb7d2('0x3a')],_0xb2d9fb['filters']));if(_0x348c10[_0xb7d2('0x3a')][_0xb7d2('0x44')]){_0xc9b2f3[_0xb7d2('0x45')]=_['merge'](_0xc9b2f3[_0xb7d2('0x45')],{'$or':_['map'](_0xc9b2f3[_0xb7d2('0x3c')],function(_0x56f463){var _0x5c08a1={};_0x5c08a1[_0x56f463]={'$like':'%'+_0x348c10['query'][_0xb7d2('0x44')]+'%'};return _0x5c08a1;})});}_0xc9b2f3=_['merge']({},_0xc9b2f3,_0x348c10[_0xb7d2('0x4c')]);return _0x3065d9[_0xb7d2('0x59')](_0xc9b2f3);}})[_0xb7d2('0x1c')](function(_0x7c7571){if(_0x7c7571){_0x15319e=_0x7c7571[_0xb7d2('0x50')];if(!_0x348c10['query'][_0xb7d2('0x3f')](_0xb7d2('0x40'))){_0xc9b2f3[_0xb7d2('0x2c')]=qs[_0xb7d2('0x2c')](_0x348c10[_0xb7d2('0x3a')][_0xb7d2('0x2c')]);_0xc9b2f3[_0xb7d2('0x41')]=qs[_0xb7d2('0x41')](_0x348c10[_0xb7d2('0x3a')]['offset']);}return _0x3065d9[_0xb7d2('0x59')](_0xc9b2f3);}})[_0xb7d2('0x1c')](function(_0x50f7ba){if(_0x50f7ba){return _0x50f7ba?{'count':_0x15319e,'rows':_0x50f7ba}:null;}})[_0xb7d2('0x1c')](respondWithResult(_0x281b1d,null))[_0xb7d2('0x27')](handleError(_0x281b1d,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 9171e24..e2a40aa 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 _0xa7e7=['int_salesforce_configurations','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration'];(function(_0x4b8ecc,_0x4cd01c){var _0x48c1b9=function(_0x308aa3){while(--_0x308aa3){_0x4b8ecc['push'](_0x4b8ecc['shift']());}};_0x48c1b9(++_0x4cd01c);}(_0xa7e7,0x177));var _0x7a7e=function(_0x105c36,_0x31b5d1){_0x105c36=_0x105c36-0x0;var _0x3e3a45=_0xa7e7[_0x105c36];return _0x3e3a45;};'use strict';var _=require(_0x7a7e('0x0'));var util=require(_0x7a7e('0x1'));var logger=require(_0x7a7e('0x2'))(_0x7a7e('0x3'));var moment=require('moment');var BPromise=require(_0x7a7e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7a7e('0x5'));var config=require(_0x7a7e('0x6'));var attributes=require(_0x7a7e('0x7'));module[_0x7a7e('0x8')]=function(_0x3079aa,_0x11c18b){return _0x3079aa['define'](_0x7a7e('0x9'),attributes,{'tableName':_0x7a7e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x69b8=['./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','lodash','util','../../config/logger','moment','rimraf','../../config/environment'];(function(_0x2964e2,_0x1dbe2d){var _0x4c16cc=function(_0x213d02){while(--_0x213d02){_0x2964e2['push'](_0x2964e2['shift']());}};_0x4c16cc(++_0x1dbe2d);}(_0x69b8,0x1a1));var _0x869b=function(_0x496bca,_0x3cd969){_0x496bca=_0x496bca-0x0;var _0x1a7a8a=_0x69b8[_0x496bca];return _0x1a7a8a;};'use strict';var _=require(_0x869b('0x0'));var util=require(_0x869b('0x1'));var logger=require(_0x869b('0x2'))('api');var moment=require(_0x869b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x869b('0x4'));var config=require(_0x869b('0x5'));var attributes=require(_0x869b('0x6'));module[_0x869b('0x7')]=function(_0x80d4b2,_0x28c376){return _0x80d4b2['define'](_0x869b('0x8'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 99dcb97..27085f7 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x27ea42,_0x428560){var _0x2b32bd=function(_0xeb757){while(--_0xeb757){_0x27ea42['push'](_0x27ea42['shift']());}};_0x2b32bd(++_0x428560);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xc4aa[_0x36c5b0];return _0xf19333;};'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')]('SalesforceConfiguration,\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 _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','SalesforceConfiguration,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x286ee3,_0x351d6f){var _0x36d7ce=function(_0x5eabbf){while(--_0x5eabbf){_0x286ee3['push'](_0x286ee3['shift']());}};_0x36d7ce(++_0x351d6f);}(_0x5fc3,0xa8));var _0x35fc=function(_0x496738,_0x3f1a9f){_0x496738=_0x496738-0x0;var _0xee1381=_0x5fc3[_0x496738];return _0xee1381;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index b16fab4..8d10613 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 _0xaf7f=['/:id','show','create','put','update','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf7f,0x18e));var _0xfaf7=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0xaf7f[_0x174ef5];return _0x1cc379;};'use strict';var multer=require('multer');var util=require(_0xfaf7('0x0'));var path=require(_0xfaf7('0x1'));var timeout=require(_0xfaf7('0x2'));var express=require('express');var router=express[_0xfaf7('0x3')]();var auth=require(_0xfaf7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfaf7('0x5'));var controller=require(_0xfaf7('0x6'));router[_0xfaf7('0x7')]('/',auth[_0xfaf7('0x8')](),controller[_0xfaf7('0x9')]);router['get'](_0xfaf7('0xa'),auth[_0xfaf7('0x8')](),controller[_0xfaf7('0xb')]);router['post']('/',auth[_0xfaf7('0x8')](),controller[_0xfaf7('0xc')]);router[_0xfaf7('0xd')](_0xfaf7('0xa'),auth[_0xfaf7('0x8')](),controller[_0xfaf7('0xe')]);router[_0xfaf7('0xf')](_0xfaf7('0xa'),auth[_0xfaf7('0x8')](),controller[_0xfaf7('0x10')]);module['exports']=router; \ No newline at end of file +var _0x1f54=['get','isAuthenticated','index','/:id','show','post','put','delete','exports','multer','util','path','express','Router','../../config/environment','./intSalesforceField.controller'];(function(_0x1a9b94,_0x4d763e){var _0x379102=function(_0x1d9e7c){while(--_0x1d9e7c){_0x1a9b94['push'](_0x1a9b94['shift']());}};_0x379102(++_0x4d763e);}(_0x1f54,0xc9));var _0x41f5=function(_0x24a654,_0x2ca441){_0x24a654=_0x24a654-0x0;var _0x458651=_0x1f54[_0x24a654];return _0x458651;};'use strict';var multer=require(_0x41f5('0x0'));var util=require(_0x41f5('0x1'));var path=require(_0x41f5('0x2'));var timeout=require('connect-timeout');var express=require(_0x41f5('0x3'));var router=express[_0x41f5('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x41f5('0x5'));var controller=require(_0x41f5('0x6'));router[_0x41f5('0x7')]('/',auth[_0x41f5('0x8')](),controller[_0x41f5('0x9')]);router[_0x41f5('0x7')](_0x41f5('0xa'),auth[_0x41f5('0x8')](),controller[_0x41f5('0xb')]);router[_0x41f5('0xc')]('/',auth[_0x41f5('0x8')](),controller['create']);router[_0x41f5('0xd')](_0x41f5('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x41f5('0xe')](_0x41f5('0xa'),auth[_0x41f5('0x8')](),controller['destroy']);module[_0x41f5('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 168df41..db66b55 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 _0x28a6=['customVariable','STRING','sequelize','exports','ENUM','string'];(function(_0x134320,_0x477194){var _0x1e12a7=function(_0x121b24){while(--_0x121b24){_0x134320['push'](_0x134320['shift']());}};_0x1e12a7(++_0x477194);}(_0x28a6,0xc8));var _0x628a=function(_0x1ee0a1,_0x51058e){_0x1ee0a1=_0x1ee0a1-0x0;var _0x1d2d5b=_0x28a6[_0x1ee0a1];return _0x1d2d5b;};'use strict';var Sequelize=require(_0x628a('0x0'));module[_0x628a('0x1')]={'type':{'type':Sequelize[_0x628a('0x2')](_0x628a('0x3'),'variable',_0x628a('0x4'),'keyValue'),'defaultValue':_0x628a('0x3')},'content':{'type':Sequelize[_0x628a('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x628a('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x628a('0x5')]},'idField':{'type':Sequelize[_0x628a('0x5')]},'variableName':{'type':Sequelize[_0x628a('0x5')]}}; \ No newline at end of file +var _0xc611=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xc611,0xc8));var _0x1c61=function(_0x5d5c33,_0x191c5c){_0x5d5c33=_0x5d5c33-0x0;var _0x5ccb0c=_0xc611[_0x5d5c33];return _0x5ccb0c;};'use strict';var Sequelize=require(_0x1c61('0x0'));module[_0x1c61('0x1')]={'type':{'type':Sequelize[_0x1c61('0x2')](_0x1c61('0x3'),_0x1c61('0x4'),_0x1c61('0x5'),_0x1c61('0x6')),'defaultValue':_0x1c61('0x3')},'content':{'type':Sequelize[_0x1c61('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x1c61('0x3'),_0x1c61('0x4'),_0x1c61('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x1c61('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 7e9684d..48fe41b 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 _0x1b65=['rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','field','filter','options','includeAll','rows','show','params','include','find','catch','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','error','name','send','SalesforceField'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1b65,0x1b4));var _0x51b6=function(_0x97877,_0x422052){_0x97877=_0x97877-0x0;var _0x5d9569=_0x1b65[_0x97877];return _0x5d9569;};'use strict';var pdf=require(_0x51b6('0x0'));var emlformat=require(_0x51b6('0x1'));var rimraf=require(_0x51b6('0x2'));var zipdir=require(_0x51b6('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x51b6('0x4'));var moment=require(_0x51b6('0x5'));var BPromise=require(_0x51b6('0x6'));var Mustache=require(_0x51b6('0x7'));var util=require(_0x51b6('0x8'));var path=require(_0x51b6('0x9'));var sox=require(_0x51b6('0xa'));var csv=require('to-csv');var ejs=require(_0x51b6('0xb'));var fs=require('fs');var _=require(_0x51b6('0xc'));var squel=require(_0x51b6('0xd'));var crypto=require(_0x51b6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x51b6('0xf'));var toCsv=require(_0x51b6('0x10'));var querystring=require('querystring');var Papa=require(_0x51b6('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x51b6('0x12'));var hardwareService=require(_0x51b6('0x13'));var logger=require(_0x51b6('0x14'))(_0x51b6('0x15'));var utils=require(_0x51b6('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44616b,_0x5df4a7){_0x5df4a7=_0x5df4a7||0xcc;return function(_0x4cd605){if(_0x4cd605){return _0x44616b[_0x51b6('0x17')](_0x5df4a7);}return _0x44616b['status'](_0x5df4a7)[_0x51b6('0x18')]();};}function respondWithResult(_0x48ab57,_0x41892f){_0x41892f=_0x41892f||0xc8;return function(_0x24a386){if(_0x24a386){return _0x48ab57[_0x51b6('0x19')](_0x41892f)[_0x51b6('0x1a')](_0x24a386);}};}function respondWithFilteredResult(_0x5049df,_0x29a458){return function(_0x4c6cd0){if(_0x4c6cd0){var _0x23549b=_0x4c6cd0[_0x51b6('0x1b')],_0x596863=_0x29a458['offset'],_0x39583d=_0x29a458[_0x51b6('0x1c')]+_0x29a458[_0x51b6('0x1d')],_0x4c99fb;if(_0x39583d>=_0x23549b){_0x39583d=_0x23549b;_0x4c99fb=0xc8;}else{_0x4c99fb=0xce;}_0x5049df[_0x51b6('0x19')](_0x4c99fb);return _0x5049df[_0x51b6('0x1e')](_0x51b6('0x1f'),_0x596863+'-'+_0x39583d+'/'+_0x23549b)[_0x51b6('0x1a')](_0x4c6cd0);}return null;};}function patchUpdates(_0x59a353){return function(_0x3d883e){try{jsonpatch['apply'](_0x3d883e,_0x59a353,!![]);}catch(_0x2974f0){return BPromise[_0x51b6('0x20')](_0x2974f0);}return _0x3d883e['save']();};}function saveUpdates(_0x3e2d90,_0x25b96d){return function(_0x3fee21){if(_0x3fee21){return _0x3fee21[_0x51b6('0x21')](_0x3e2d90)[_0x51b6('0x22')](function(_0x663b44){return _0x663b44;});}return null;};}function removeEntity(_0x3e3015,_0x1e70fc){return function(_0x4ab876){if(_0x4ab876){return _0x4ab876[_0x51b6('0x23')]()[_0x51b6('0x22')](function(){_0x3e3015[_0x51b6('0x19')](0xcc)[_0x51b6('0x18')]();});}};}function handleEntityNotFound(_0x53e709,_0x3d3456){return function(_0x3680af){if(!_0x3680af){_0x53e709[_0x51b6('0x17')](0x194);}return _0x3680af;};}function handleError(_0x5de6e3,_0x436b87){_0x436b87=_0x436b87||0x1f4;return function(_0x47499e){logger[_0x51b6('0x24')](_0x47499e['stack']);if(_0x47499e['name']){delete _0x47499e[_0x51b6('0x25')];}_0x5de6e3[_0x51b6('0x19')](_0x436b87)[_0x51b6('0x26')](_0x47499e);};}exports['index']=function(_0x2842b2,_0x3372b2){var _0x5a8a5b={},_0x2df2fa={},_0x3caf4f={'count':0x0,'rows':[]};var _0x265a6f=db[_0x51b6('0x27')][_0x51b6('0x28')];_0x2df2fa['model']=_[_0x51b6('0x29')](_0x265a6f);_0x2df2fa[_0x51b6('0x2a')]=_[_0x51b6('0x29')](_0x2842b2['query']);_0x2df2fa[_0x51b6('0x2b')]=_[_0x51b6('0x2c')](_0x2df2fa[_0x51b6('0x2d')],_0x2df2fa[_0x51b6('0x2a')]);_0x5a8a5b['attributes']=_[_0x51b6('0x2c')](_0x2df2fa['model'],qs[_0x51b6('0x2e')](_0x2842b2[_0x51b6('0x2a')]['fields']));_0x5a8a5b['attributes']=_0x5a8a5b[_0x51b6('0x2f')][_0x51b6('0x30')]?_0x5a8a5b['attributes']:_0x2df2fa[_0x51b6('0x2d')];if(!_0x2842b2[_0x51b6('0x2a')]['hasOwnProperty'](_0x51b6('0x31'))){_0x5a8a5b[_0x51b6('0x1d')]=qs[_0x51b6('0x1d')](_0x2842b2['query'][_0x51b6('0x1d')]);_0x5a8a5b['offset']=qs[_0x51b6('0x1c')](_0x2842b2[_0x51b6('0x2a')][_0x51b6('0x1c')]);}_0x5a8a5b[_0x51b6('0x32')]=qs[_0x51b6('0x33')](_0x2842b2[_0x51b6('0x2a')][_0x51b6('0x33')]);_0x5a8a5b[_0x51b6('0x34')]=qs['filters'](_[_0x51b6('0x35')](_0x2842b2[_0x51b6('0x2a')],_0x2df2fa['filters']));if(_0x2842b2[_0x51b6('0x2a')]['filter']){_0x5a8a5b[_0x51b6('0x34')]=_[_0x51b6('0x36')](_0x5a8a5b[_0x51b6('0x34')],{'$or':_['map'](_0x265a6f,function(_0x21a54b){if(_0x21a54b[_0x51b6('0x37')]['key']!==_0x51b6('0x38')){var _0x458659={};_0x458659[_0x21a54b[_0x51b6('0x39')]]={'$like':'%'+_0x2842b2[_0x51b6('0x2a')][_0x51b6('0x3a')]+'%'};return _0x458659;}})});}_0x5a8a5b=_[_0x51b6('0x36')]({},_0x5a8a5b,_0x2842b2[_0x51b6('0x3b')]);var _0xf24c74={'where':_0x5a8a5b[_0x51b6('0x34')]};return db[_0x51b6('0x27')][_0x51b6('0x1b')](_0xf24c74)[_0x51b6('0x22')](function(_0x157f6b){_0x3caf4f[_0x51b6('0x1b')]=_0x157f6b;if(_0x2842b2[_0x51b6('0x2a')][_0x51b6('0x3c')]){_0x5a8a5b['include']=[{'all':!![]}];}return db[_0x51b6('0x27')]['findAll'](_0x5a8a5b);})[_0x51b6('0x22')](function(_0x4ad444){_0x3caf4f[_0x51b6('0x3d')]=_0x4ad444;return _0x3caf4f;})[_0x51b6('0x22')](respondWithFilteredResult(_0x3372b2,_0x5a8a5b))['catch'](handleError(_0x3372b2,null));};exports[_0x51b6('0x3e')]=function(_0x2b6dd6,_0x496803){var _0x2e2ab2={'raw':!![],'where':{'id':_0x2b6dd6[_0x51b6('0x3f')]['id']}},_0x4570a8={};_0x4570a8[_0x51b6('0x2d')]=_[_0x51b6('0x29')](db['SalesforceField']['rawAttributes']);_0x4570a8['query']=_[_0x51b6('0x29')](_0x2b6dd6[_0x51b6('0x2a')]);_0x4570a8[_0x51b6('0x2b')]=_[_0x51b6('0x2c')](_0x4570a8[_0x51b6('0x2d')],_0x4570a8['query']);_0x2e2ab2['attributes']=_[_0x51b6('0x2c')](_0x4570a8[_0x51b6('0x2d')],qs[_0x51b6('0x2e')](_0x2b6dd6['query'][_0x51b6('0x2e')]));_0x2e2ab2['attributes']=_0x2e2ab2[_0x51b6('0x2f')]['length']?_0x2e2ab2[_0x51b6('0x2f')]:_0x4570a8[_0x51b6('0x2d')];if(_0x2b6dd6[_0x51b6('0x2a')]['includeAll']){_0x2e2ab2[_0x51b6('0x40')]=[{'all':!![]}];}_0x2e2ab2=_[_0x51b6('0x36')]({},_0x2e2ab2,_0x2b6dd6[_0x51b6('0x3b')]);return db[_0x51b6('0x27')][_0x51b6('0x41')](_0x2e2ab2)['then'](handleEntityNotFound(_0x496803,null))[_0x51b6('0x22')](respondWithResult(_0x496803,null))[_0x51b6('0x42')](handleError(_0x496803,null));};exports['create']=function(_0x4213ba,_0x1fe475){return db['SalesforceField']['create'](_0x4213ba['body'],{})['then'](respondWithResult(_0x1fe475,0xc9))['catch'](handleError(_0x1fe475,null));};exports['update']=function(_0x37ef99,_0x5d6a45){if(_0x37ef99[_0x51b6('0x43')]['id']){delete _0x37ef99[_0x51b6('0x43')]['id'];}return db[_0x51b6('0x27')][_0x51b6('0x41')]({'where':{'id':_0x37ef99[_0x51b6('0x3f')]['id']}})[_0x51b6('0x22')](handleEntityNotFound(_0x5d6a45,null))['then'](saveUpdates(_0x37ef99[_0x51b6('0x43')],null))['then'](respondWithResult(_0x5d6a45,null))[_0x51b6('0x42')](handleError(_0x5d6a45,null));};exports[_0x51b6('0x23')]=function(_0x594bb2,_0x44f9d4){return db[_0x51b6('0x27')][_0x51b6('0x41')]({'where':{'id':_0x594bb2[_0x51b6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x44f9d4,null))[_0x51b6('0x22')](removeEntity(_0x44f9d4,null))[_0x51b6('0x42')](handleError(_0x44f9d4,null));}; \ No newline at end of file +var _0x4672=['index','SalesforceField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','type','VIRTUAL','field','count','findAll','rows','catch','show','length','includeAll','create','body','update','find','params','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','set','Content-Range','apply','save','destroy','then','error','stack','name','send'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4672,0x18a));var _0x2467=function(_0x3975ac,_0x4d5e8a){_0x3975ac=_0x3975ac-0x0;var _0x2c06d5=_0x4672[_0x3975ac];return _0x2c06d5;};'use strict';var pdf=require(_0x2467('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2467('0x1'));var zipdir=require(_0x2467('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2467('0x3'));var moment=require('moment');var BPromise=require(_0x2467('0x4'));var Mustache=require(_0x2467('0x5'));var util=require(_0x2467('0x6'));var path=require(_0x2467('0x7'));var sox=require('sox');var csv=require(_0x2467('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2467('0x9'));var squel=require(_0x2467('0xa'));var crypto=require(_0x2467('0xb'));var jsforce=require(_0x2467('0xc'));var deskjs=require(_0x2467('0xd'));var toCsv=require(_0x2467('0x8'));var querystring=require(_0x2467('0xe'));var Papa=require(_0x2467('0xf'));var Redis=require(_0x2467('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2467('0x11'));var hardwareService=require(_0x2467('0x12'));var logger=require(_0x2467('0x13'))(_0x2467('0x14'));var utils=require('../../config/utils');var config=require(_0x2467('0x15'));var db=require(_0x2467('0x16'))['db'];function respondWithStatusCode(_0x597d39,_0x3cb0cc){_0x3cb0cc=_0x3cb0cc||0xcc;return function(_0x348f51){if(_0x348f51){return _0x597d39[_0x2467('0x17')](_0x3cb0cc);}return _0x597d39['status'](_0x3cb0cc)[_0x2467('0x18')]();};}function respondWithResult(_0x373ef2,_0x8a15e2){_0x8a15e2=_0x8a15e2||0xc8;return function(_0xa9966d){if(_0xa9966d){return _0x373ef2[_0x2467('0x19')](_0x8a15e2)[_0x2467('0x1a')](_0xa9966d);}};}function respondWithFilteredResult(_0x15aa74,_0x529337){return function(_0x520ad9){if(_0x520ad9){var _0x4eab72=_0x520ad9['count'],_0x2cab68=_0x529337[_0x2467('0x1b')],_0xe72566=_0x529337[_0x2467('0x1b')]+_0x529337['limit'],_0x239ef0;if(_0xe72566>=_0x4eab72){_0xe72566=_0x4eab72;_0x239ef0=0xc8;}else{_0x239ef0=0xce;}_0x15aa74[_0x2467('0x19')](_0x239ef0);return _0x15aa74[_0x2467('0x1c')](_0x2467('0x1d'),_0x2cab68+'-'+_0xe72566+'/'+_0x4eab72)[_0x2467('0x1a')](_0x520ad9);}return null;};}function patchUpdates(_0xf5e86){return function(_0x1beb02){try{jsonpatch[_0x2467('0x1e')](_0x1beb02,_0xf5e86,!![]);}catch(_0x5ecb91){return BPromise['reject'](_0x5ecb91);}return _0x1beb02[_0x2467('0x1f')]();};}function saveUpdates(_0x4ba37e,_0x285423){return function(_0xa16c1a){if(_0xa16c1a){return _0xa16c1a['update'](_0x4ba37e)['then'](function(_0x2d7061){return _0x2d7061;});}return null;};}function removeEntity(_0x9fee43,_0x5a2acc){return function(_0x1217e0){if(_0x1217e0){return _0x1217e0[_0x2467('0x20')]()[_0x2467('0x21')](function(){_0x9fee43[_0x2467('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ebd45,_0x51831c){return function(_0x5e5621){if(!_0x5e5621){_0x2ebd45[_0x2467('0x17')](0x194);}return _0x5e5621;};}function handleError(_0x48cb4b,_0x4cc041){_0x4cc041=_0x4cc041||0x1f4;return function(_0x592fd5){logger[_0x2467('0x22')](_0x592fd5[_0x2467('0x23')]);if(_0x592fd5['name']){delete _0x592fd5[_0x2467('0x24')];}_0x48cb4b[_0x2467('0x19')](_0x4cc041)[_0x2467('0x25')](_0x592fd5);};}exports[_0x2467('0x26')]=function(_0x18f045,_0x10e3cb){var _0x4aeb8b={},_0x39b8d5={},_0x3d1bc9={'count':0x0,'rows':[]};var _0x120b05=db[_0x2467('0x27')][_0x2467('0x28')];_0x39b8d5[_0x2467('0x29')]=_[_0x2467('0x2a')](_0x120b05);_0x39b8d5[_0x2467('0x2b')]=_['keys'](_0x18f045[_0x2467('0x2b')]);_0x39b8d5[_0x2467('0x2c')]=_[_0x2467('0x2d')](_0x39b8d5[_0x2467('0x29')],_0x39b8d5[_0x2467('0x2b')]);_0x4aeb8b[_0x2467('0x2e')]=_[_0x2467('0x2d')](_0x39b8d5['model'],qs[_0x2467('0x2f')](_0x18f045['query']['fields']));_0x4aeb8b[_0x2467('0x2e')]=_0x4aeb8b['attributes']['length']?_0x4aeb8b['attributes']:_0x39b8d5[_0x2467('0x29')];if(!_0x18f045[_0x2467('0x2b')][_0x2467('0x30')](_0x2467('0x31'))){_0x4aeb8b['limit']=qs[_0x2467('0x32')](_0x18f045[_0x2467('0x2b')][_0x2467('0x32')]);_0x4aeb8b['offset']=qs[_0x2467('0x1b')](_0x18f045['query']['offset']);}_0x4aeb8b[_0x2467('0x33')]=qs[_0x2467('0x34')](_0x18f045[_0x2467('0x2b')][_0x2467('0x34')]);_0x4aeb8b[_0x2467('0x35')]=qs['filters'](_['pick'](_0x18f045['query'],_0x39b8d5[_0x2467('0x2c')]));if(_0x18f045[_0x2467('0x2b')][_0x2467('0x36')]){_0x4aeb8b[_0x2467('0x35')]=_[_0x2467('0x37')](_0x4aeb8b[_0x2467('0x35')],{'$or':_[_0x2467('0x38')](_0x120b05,function(_0x22e56a){if(_0x22e56a[_0x2467('0x39')]['key']!==_0x2467('0x3a')){var _0x173fd2={};_0x173fd2[_0x22e56a[_0x2467('0x3b')]]={'$like':'%'+_0x18f045[_0x2467('0x2b')][_0x2467('0x36')]+'%'};return _0x173fd2;}})});}_0x4aeb8b=_[_0x2467('0x37')]({},_0x4aeb8b,_0x18f045['options']);var _0x5168be={'where':_0x4aeb8b[_0x2467('0x35')]};return db[_0x2467('0x27')][_0x2467('0x3c')](_0x5168be)[_0x2467('0x21')](function(_0x14f5be){_0x3d1bc9['count']=_0x14f5be;if(_0x18f045[_0x2467('0x2b')]['includeAll']){_0x4aeb8b['include']=[{'all':!![]}];}return db[_0x2467('0x27')][_0x2467('0x3d')](_0x4aeb8b);})[_0x2467('0x21')](function(_0x19e39c){_0x3d1bc9[_0x2467('0x3e')]=_0x19e39c;return _0x3d1bc9;})[_0x2467('0x21')](respondWithFilteredResult(_0x10e3cb,_0x4aeb8b))[_0x2467('0x3f')](handleError(_0x10e3cb,null));};exports[_0x2467('0x40')]=function(_0xe6bae3,_0x5e8ec3){var _0x277ceb={'raw':!![],'where':{'id':_0xe6bae3['params']['id']}},_0x5a8b60={};_0x5a8b60[_0x2467('0x29')]=_[_0x2467('0x2a')](db[_0x2467('0x27')]['rawAttributes']);_0x5a8b60['query']=_['keys'](_0xe6bae3[_0x2467('0x2b')]);_0x5a8b60['filters']=_[_0x2467('0x2d')](_0x5a8b60[_0x2467('0x29')],_0x5a8b60[_0x2467('0x2b')]);_0x277ceb[_0x2467('0x2e')]=_[_0x2467('0x2d')](_0x5a8b60[_0x2467('0x29')],qs[_0x2467('0x2f')](_0xe6bae3[_0x2467('0x2b')]['fields']));_0x277ceb[_0x2467('0x2e')]=_0x277ceb['attributes'][_0x2467('0x41')]?_0x277ceb[_0x2467('0x2e')]:_0x5a8b60['model'];if(_0xe6bae3[_0x2467('0x2b')][_0x2467('0x42')]){_0x277ceb['include']=[{'all':!![]}];}_0x277ceb=_[_0x2467('0x37')]({},_0x277ceb,_0xe6bae3['options']);return db[_0x2467('0x27')]['find'](_0x277ceb)['then'](handleEntityNotFound(_0x5e8ec3,null))[_0x2467('0x21')](respondWithResult(_0x5e8ec3,null))[_0x2467('0x3f')](handleError(_0x5e8ec3,null));};exports[_0x2467('0x43')]=function(_0x3cc8b5,_0x4581b9){return db[_0x2467('0x27')][_0x2467('0x43')](_0x3cc8b5[_0x2467('0x44')],{})[_0x2467('0x21')](respondWithResult(_0x4581b9,0xc9))[_0x2467('0x3f')](handleError(_0x4581b9,null));};exports[_0x2467('0x45')]=function(_0xc464de,_0x589905){if(_0xc464de['body']['id']){delete _0xc464de[_0x2467('0x44')]['id'];}return db[_0x2467('0x27')][_0x2467('0x46')]({'where':{'id':_0xc464de[_0x2467('0x47')]['id']}})[_0x2467('0x21')](handleEntityNotFound(_0x589905,null))[_0x2467('0x21')](saveUpdates(_0xc464de[_0x2467('0x44')],null))[_0x2467('0x21')](respondWithResult(_0x589905,null))['catch'](handleError(_0x589905,null));};exports[_0x2467('0x20')]=function(_0x42ca44,_0x554011){return db[_0x2467('0x27')]['find']({'where':{'id':_0x42ca44[_0x2467('0x47')]['id']}})[_0x2467('0x21')](handleEntityNotFound(_0x554011,null))[_0x2467('0x21')](removeEntity(_0x554011,null))[_0x2467('0x3f')](handleError(_0x554011,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 41b8a09..7c70e46 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 _0x6811=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','SalesforceField','int_salesforce_fields','idField','util'];(function(_0x3084a6,_0x47e126){var _0x2a4028=function(_0x15f305){while(--_0x15f305){_0x3084a6['push'](_0x3084a6['shift']());}};_0x2a4028(++_0x47e126);}(_0x6811,0x1e0));var _0x1681=function(_0x2f2a6d,_0x41b785){_0x2f2a6d=_0x2f2a6d-0x0;var _0x36f857=_0x6811[_0x2f2a6d];return _0x36f857;};'use strict';var _=require('lodash');var util=require(_0x1681('0x0'));var logger=require(_0x1681('0x1'))(_0x1681('0x2'));var moment=require(_0x1681('0x3'));var BPromise=require(_0x1681('0x4'));var rp=require(_0x1681('0x5'));var fs=require('fs');var path=require(_0x1681('0x6'));var rimraf=require(_0x1681('0x7'));var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0x1681('0x8')]=function(_0x5e4451,_0x6cd269){return _0x5e4451[_0x1681('0x9')](_0x1681('0xa'),attributes,{'tableName':_0x1681('0xb'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x1681('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaf76=['moment','bluebird','rimraf','../../config/environment','./intSalesforceField.attributes','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x33ac69,_0x12018d){var _0x4f294b=function(_0x44283e){while(--_0x44283e){_0x33ac69['push'](_0x33ac69['shift']());}};_0x4f294b(++_0x12018d);}(_0xaf76,0x123));var _0x6af7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaf76[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6af7('0x0'));var util=require(_0x6af7('0x1'));var logger=require(_0x6af7('0x2'))('api');var moment=require(_0x6af7('0x3'));var BPromise=require(_0x6af7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6af7('0x5'));var config=require(_0x6af7('0x6'));var attributes=require(_0x6af7('0x7'));module['exports']=function(_0x17efd6,_0x13afb4){return _0x17efd6[_0x6af7('0x8')](_0x6af7('0x9'),attributes,{'tableName':_0x6af7('0xa'),'paranoid':![],'indexes':[{'name':_0x6af7('0xb'),'fields':[_0x6af7('0xc'),_0x6af7('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 40e0eca..2094cb3 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 _0x3158=['code','SalesforceField,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','debug','error'];(function(_0x19e5f9,_0x211e15){var _0x188622=function(_0xf03ba4){while(--_0xf03ba4){_0x19e5f9['push'](_0x19e5f9['shift']());}};_0x188622(++_0x211e15);}(_0x3158,0xf5));var _0x8315=function(_0x50c4e9,_0xba7ee6){_0x50c4e9=_0x50c4e9-0x0;var _0x1c1333=_0x3158[_0x50c4e9];return _0x1c1333;};'use strict';var _=require(_0x8315('0x0'));var util=require(_0x8315('0x1'));var moment=require(_0x8315('0x2'));var BPromise=require(_0x8315('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8315('0x4'))['db'];var utils=require(_0x8315('0x5'));var logger=require(_0x8315('0x6'))(_0x8315('0x7'));var config=require(_0x8315('0x8'));var jayson=require(_0x8315('0x9'));var client=jayson[_0x8315('0xa')][_0x8315('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21564d,_0xf697a4,_0x1f2abe){return new BPromise(function(_0x1641c6,_0x623268){return client[_0x8315('0xc')](_0x21564d,_0x1f2abe)['then'](function(_0x427b54){logger['info']('SalesforceField,\x20%s,\x20%s',_0xf697a4,'request\x20sent');logger[_0x8315('0xd')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0xf697a4,'request\x20sent',JSON['stringify'](_0x427b54));if(_0x427b54['error']){if(_0x427b54[_0x8315('0xe')][_0x8315('0xf')]===0x1f4){logger[_0x8315('0xe')](_0x8315('0x10'),_0xf697a4,_0x427b54[_0x8315('0xe')]['message']);return _0x623268(_0x427b54[_0x8315('0xe')]['message']);}logger[_0x8315('0xe')]('SalesforceField,\x20%s,\x20%s',_0xf697a4,_0x427b54['error']['message']);return _0x1641c6(_0x427b54[_0x8315('0xe')][_0x8315('0x11')]);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0xf697a4,_0x8315('0x12'));_0x1641c6(_0x427b54[_0x8315('0x13')]['message']);}})['catch'](function(_0x355d7b){logger['error']('SalesforceField,\x20%s,\x20%s',_0xf697a4,_0x355d7b);_0x623268(_0x355d7b);});});} \ No newline at end of file +var _0x1f83=['SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','then','info','SalesforceField,\x20%s,\x20%s'];(function(_0x103279,_0x1b0609){var _0x41f2ca=function(_0x24bd39){while(--_0x24bd39){_0x103279['push'](_0x103279['shift']());}};_0x41f2ca(++_0x1b0609);}(_0x1f83,0x1bf));var _0x31f8=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x1f83[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require(_0x31f8('0x0'));var moment=require(_0x31f8('0x1'));var BPromise=require(_0x31f8('0x2'));var rs=require(_0x31f8('0x3'));var fs=require('fs');var Redis=require(_0x31f8('0x4'));var db=require(_0x31f8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x31f8('0x6'));var config=require(_0x31f8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x31f8('0x8')][_0x31f8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b5443,_0x243e68,_0x275dae){return new BPromise(function(_0x165c1d,_0x1b9fc2){return client['request'](_0x2b5443,_0x275dae)[_0x31f8('0xa')](function(_0x5b7682){logger[_0x31f8('0xb')](_0x31f8('0xc'),_0x243e68,'request\x20sent');logger['debug'](_0x31f8('0xd'),_0x243e68,'request\x20sent',JSON[_0x31f8('0xe')](_0x5b7682));if(_0x5b7682[_0x31f8('0xf')]){if(_0x5b7682[_0x31f8('0xf')][_0x31f8('0x10')]===0x1f4){logger[_0x31f8('0xf')](_0x31f8('0xc'),_0x243e68,_0x5b7682[_0x31f8('0xf')][_0x31f8('0x11')]);return _0x1b9fc2(_0x5b7682['error'][_0x31f8('0x11')]);}logger['error'](_0x31f8('0xc'),_0x243e68,_0x5b7682[_0x31f8('0xf')][_0x31f8('0x11')]);return _0x165c1d(_0x5b7682['error']['message']);}else{logger[_0x31f8('0xb')](_0x31f8('0xc'),_0x243e68,_0x31f8('0x12'));_0x165c1d(_0x5b7682[_0x31f8('0x13')][_0x31f8('0x11')]);}})['catch'](function(_0x545476){logger[_0x31f8('0xf')](_0x31f8('0xc'),_0x243e68,_0x545476);_0x1b9fc2(_0x545476);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 1820e32..99e9bf4 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 _0x13ed=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','index','get','/:id','show','getConfigurations','/:id/fields','post','create','/:id/configurations','delete','exports'];(function(_0x589f34,_0x1cfb19){var _0xa78b52=function(_0x320628){while(--_0x320628){_0x589f34['push'](_0x589f34['shift']());}};_0xa78b52(++_0x1cfb19);}(_0x13ed,0x1b8));var _0xd13e=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0x13ed[_0xc77819];return _0x1c9434;};'use strict';var multer=require('multer');var util=require(_0xd13e('0x0'));var path=require('path');var timeout=require(_0xd13e('0x1'));var express=require(_0xd13e('0x2'));var router=express[_0xd13e('0x3')]();var auth=require(_0xd13e('0x4'));var interaction=require(_0xd13e('0x5'));var config=require(_0xd13e('0x6'));var controller=require(_0xd13e('0x7'));router['get']('/',auth[_0xd13e('0x8')](),controller[_0xd13e('0x9')]);router[_0xd13e('0xa')](_0xd13e('0xb'),auth['isAuthenticated'](),controller[_0xd13e('0xc')]);router[_0xd13e('0xa')]('/:id/configurations',auth[_0xd13e('0x8')](),controller[_0xd13e('0xd')]);router['get'](_0xd13e('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0xd13e('0xf')]('/',auth[_0xd13e('0x8')](),controller[_0xd13e('0x10')]);router[_0xd13e('0xf')](_0xd13e('0x11'),auth[_0xd13e('0x8')](),controller['addConfiguration']);router['put'](_0xd13e('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xd13e('0x12')]('/:id',auth[_0xd13e('0x8')](),controller['destroy']);module[_0xd13e('0x13')]=router; \ No newline at end of file +var _0x4e86=['../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e86,0x11b));var _0x64e8=function(_0x4dd63b,_0x1bf52d){_0x4dd63b=_0x4dd63b-0x0;var _0x1a5ccd=_0x4e86[_0x4dd63b];return _0x1a5ccd;};'use strict';var multer=require(_0x64e8('0x0'));var util=require(_0x64e8('0x1'));var path=require(_0x64e8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x64e8('0x3'));var config=require(_0x64e8('0x4'));var controller=require(_0x64e8('0x5'));router[_0x64e8('0x6')]('/',auth[_0x64e8('0x7')](),controller[_0x64e8('0x8')]);router[_0x64e8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x64e8('0x9')]);router['get'](_0x64e8('0xa'),auth[_0x64e8('0x7')](),controller['getConfigurations']);router['get'](_0x64e8('0xb'),auth[_0x64e8('0x7')](),controller[_0x64e8('0xc')]);router['post']('/',auth[_0x64e8('0x7')](),controller[_0x64e8('0xd')]);router[_0x64e8('0xe')]('/:id/configurations',auth[_0x64e8('0x7')](),controller[_0x64e8('0xf')]);router[_0x64e8('0x10')](_0x64e8('0x11'),auth['isAuthenticated'](),controller[_0x64e8('0x12')]);router[_0x64e8('0x13')](_0x64e8('0x11'),auth[_0x64e8('0x7')](),controller[_0x64e8('0x14')]);module[_0x64e8('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 01fbc83..1d216e7 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 _0x4c6d=['exports','STRING','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x1fcf28,_0x4cc9ec){_0x1fcf28=_0x1fcf28-0x0;var _0x26771f=_0x4c6d[_0x1fcf28];return _0x26771f;};'use strict';var Sequelize=require(_0xd4c6('0x0'));module[_0xd4c6('0x1')]={'name':{'type':Sequelize[_0xd4c6('0x2')]},'description':{'type':Sequelize[_0xd4c6('0x2')]},'username':{'type':Sequelize[_0xd4c6('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xd4c6('0x2')]},'email':{'type':Sequelize[_0xd4c6('0x2')]},'remoteUri':{'type':Sequelize[_0xd4c6('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xd4c6('0x2')]}}; \ No newline at end of file +var _0x2bc6=['exports','STRING','remoteUri','sequelize'];(function(_0x5e96a3,_0x591c84){var _0x30fceb=function(_0x5a18dd){while(--_0x5a18dd){_0x5e96a3['push'](_0x5e96a3['shift']());}};_0x30fceb(++_0x591c84);}(_0x2bc6,0x163));var _0x62bc=function(_0x24d0a6,_0x48ff79){_0x24d0a6=_0x24d0a6-0x0;var _0xe6e137=_0x2bc6[_0x24d0a6];return _0xe6e137;};'use strict';var Sequelize=require(_0x62bc('0x0'));module[_0x62bc('0x1')]={'name':{'type':Sequelize[_0x62bc('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x62bc('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x62bc('0x3')},'serverUrl':{'type':Sequelize[_0x62bc('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 07ee3a4..a94d5dc 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 _0xdf41=['substring','lastIndexOf','format','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','remove','includes','forEach','internalType','label','push','all','statusCode','Wrong\x20credentials','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','reject','save','update','then','destroy','stack','name','send','index','ServicenowAccount','rawAttributes','keys','query','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','map','type','key','VIRTUAL','field','filter','merge','options','include','rows','show','params','intersection','includeAll','find','create','body','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','notify','incident_state','category','caused_by','upon_reject','approval_history','number','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','work_notes','close_code','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','activity_due','assigned_to','severity','comments','sla_due','comments_and_work_notes','sys_mod_count','reopen_count','escalation','upon_approval','correlation_id','location','password','email','serverUrl'];(function(_0x1114dc,_0x50aed4){var _0x164894=function(_0x40ec33){while(--_0x40ec33){_0x1114dc['push'](_0x1114dc['shift']());}};_0x164894(++_0x50aed4);}(_0xdf41,0x18b));var _0x1df4=function(_0x2341ab,_0x326a6c){_0x2341ab=_0x2341ab-0x0;var _0x54533e=_0xdf41[_0x2341ab];return _0x54533e;};'use strict';var pdf=require(_0x1df4('0x0'));var emlformat=require(_0x1df4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1df4('0x2'));var jsonpatch=require(_0x1df4('0x3'));var rp=require('request-promise');var moment=require(_0x1df4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1df4('0x5'));var util=require(_0x1df4('0x6'));var path=require(_0x1df4('0x7'));var sox=require(_0x1df4('0x8'));var csv=require(_0x1df4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1df4('0xa'));var squel=require(_0x1df4('0xb'));var crypto=require('crypto');var jsforce=require(_0x1df4('0xc'));var deskjs=require(_0x1df4('0xd'));var toCsv=require(_0x1df4('0x9'));var querystring=require(_0x1df4('0xe'));var Papa=require('papaparse');var Redis=require(_0x1df4('0xf'));var authService=require(_0x1df4('0x10'));var qs=require(_0x1df4('0x11'));var hardwareService=require(_0x1df4('0x12'));var logger=require(_0x1df4('0x13'))(_0x1df4('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x1df4('0x15'))['db'];var integrations=require(_0x1df4('0x16'));var jayson=require(_0x1df4('0x17'));var client=jayson[_0x1df4('0x18')][_0x1df4('0x19')]({'port':0x232a});function checkPasswordPattern(_0x5b8199,_0x4e3693,_0x4a3552){if(_0x4a3552){var _0x951f81=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x951f81[_0x1df4('0x1a')](_0x4e3693)){return _0x5b8199;}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 _0x5b8199;}}function respondWithRpcPromise(_0x7dc073,_0x1c98c5,_0x2a37df,_0x18c4fa){return new BPromise(function(_0x185066,_0x112c23){var _0x3a387d=_0x18c4fa||client;return _0x3a387d['request'](_0x7dc073,_0x2a37df)['then'](function(_0x307d1e){logger[_0x1df4('0x1b')](_0x1df4('0x1c'),_0x1c98c5,_0x1df4('0x1d'));logger['debug'](_0x1df4('0x1e'),_0x1c98c5,_0x1df4('0x1d'),JSON['stringify'](_0x307d1e));if(_0x307d1e[_0x1df4('0x1f')]){if(_0x307d1e['error'][_0x1df4('0x20')]===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x1c98c5,_0x307d1e[_0x1df4('0x1f')]['message']);return _0x112c23(_0x307d1e[_0x1df4('0x1f')][_0x1df4('0x21')]);}logger[_0x1df4('0x1f')](_0x1df4('0x1c'),_0x1c98c5,_0x307d1e[_0x1df4('0x1f')][_0x1df4('0x21')]);return _0x185066(_0x307d1e[_0x1df4('0x1f')][_0x1df4('0x21')]);}else{logger[_0x1df4('0x1b')]('ServicenowAccount,\x20%s,\x20%s',_0x1c98c5,'request\x20sent');_0x185066(_0x307d1e[_0x1df4('0x22')][_0x1df4('0x21')]);}})[_0x1df4('0x23')](function(_0x1c56d0){logger[_0x1df4('0x1f')](_0x1df4('0x1c'),_0x1c98c5,_0x1c56d0);_0x112c23(_0x1c56d0);});});}function respondWithStatusCode(_0x432626,_0x4f9de2){_0x4f9de2=_0x4f9de2||0xcc;return function(_0x12bc5d){if(_0x12bc5d){return _0x432626[_0x1df4('0x24')](_0x4f9de2);}return _0x432626[_0x1df4('0x25')](_0x4f9de2)[_0x1df4('0x26')]();};}function respondWithResult(_0x269f89,_0x2dde72){_0x2dde72=_0x2dde72||0xc8;return function(_0x11f474){if(_0x11f474){return _0x269f89['status'](_0x2dde72)[_0x1df4('0x27')](_0x11f474);}};}function respondWithFilteredResult(_0x241548,_0x452f7f){return function(_0x378e0a){if(_0x378e0a){var _0x505aab=_0x378e0a[_0x1df4('0x28')],_0x377e82=_0x452f7f[_0x1df4('0x29')],_0x58b8fa=_0x452f7f[_0x1df4('0x29')]+_0x452f7f['limit'],_0x4e95f8;if(_0x58b8fa>=_0x505aab){_0x58b8fa=_0x505aab;_0x4e95f8=0xc8;}else{_0x4e95f8=0xce;}_0x241548[_0x1df4('0x25')](_0x4e95f8);return _0x241548['set']('Content-Range',_0x377e82+'-'+_0x58b8fa+'/'+_0x505aab)[_0x1df4('0x27')](_0x378e0a);}return null;};}function patchUpdates(_0x5627bc){return function(_0xa22a3){try{jsonpatch['apply'](_0xa22a3,_0x5627bc,!![]);}catch(_0x673dec){return BPromise[_0x1df4('0x2a')](_0x673dec);}return _0xa22a3[_0x1df4('0x2b')]();};}function saveUpdates(_0x43dff2,_0x4cd320){return function(_0x3dc0ec){if(_0x3dc0ec){return _0x3dc0ec[_0x1df4('0x2c')](_0x43dff2)[_0x1df4('0x2d')](function(_0x1b7b62){return _0x1b7b62;});}return null;};}function removeEntity(_0x5b50d0,_0x1714b8){return function(_0x126d0f){if(_0x126d0f){return _0x126d0f[_0x1df4('0x2e')]()['then'](function(){_0x5b50d0[_0x1df4('0x25')](0xcc)[_0x1df4('0x26')]();});}};}function handleEntityNotFound(_0x5e5924,_0x254061){return function(_0x1c09c4){if(!_0x1c09c4){_0x5e5924[_0x1df4('0x24')](0x194);}return _0x1c09c4;};}function handleError(_0x160050,_0x139239){_0x139239=_0x139239||0x1f4;return function(_0x40b242){logger[_0x1df4('0x1f')](_0x40b242[_0x1df4('0x2f')]);if(_0x40b242[_0x1df4('0x30')]){delete _0x40b242['name'];}_0x160050['status'](_0x139239)[_0x1df4('0x31')](_0x40b242);};}exports[_0x1df4('0x32')]=function(_0x1d1b65,_0x16bce6){var _0x46dd6a={},_0x4d56a7={},_0xcccb84={'count':0x0,'rows':[]};var _0x3d66a0=db[_0x1df4('0x33')][_0x1df4('0x34')];_0x4d56a7['model']=_[_0x1df4('0x35')](_0x3d66a0);_0x4d56a7[_0x1df4('0x36')]=_['keys'](_0x1d1b65[_0x1df4('0x36')]);_0x4d56a7['filters']=_['intersection'](_0x4d56a7[_0x1df4('0x37')],_0x4d56a7[_0x1df4('0x36')]);_0x46dd6a[_0x1df4('0x38')]=_['intersection'](_0x4d56a7['model'],qs[_0x1df4('0x39')](_0x1d1b65[_0x1df4('0x36')][_0x1df4('0x39')]));_0x46dd6a['attributes']=_0x46dd6a[_0x1df4('0x38')][_0x1df4('0x3a')]?_0x46dd6a['attributes']:_0x4d56a7['model'];if(!_0x1d1b65[_0x1df4('0x36')][_0x1df4('0x3b')](_0x1df4('0x3c'))){_0x46dd6a['limit']=qs[_0x1df4('0x3d')](_0x1d1b65[_0x1df4('0x36')][_0x1df4('0x3d')]);_0x46dd6a[_0x1df4('0x29')]=qs[_0x1df4('0x29')](_0x1d1b65[_0x1df4('0x36')][_0x1df4('0x29')]);}_0x46dd6a[_0x1df4('0x3e')]=qs[_0x1df4('0x3f')](_0x1d1b65['query'][_0x1df4('0x3f')]);_0x46dd6a[_0x1df4('0x40')]=qs[_0x1df4('0x41')](_['pick'](_0x1d1b65[_0x1df4('0x36')],_0x4d56a7[_0x1df4('0x41')]));if(_0x1d1b65[_0x1df4('0x36')]['filter']){_0x46dd6a[_0x1df4('0x40')]=_['merge'](_0x46dd6a['where'],{'$or':_[_0x1df4('0x42')](_0x3d66a0,function(_0x5b9080){if(_0x5b9080[_0x1df4('0x43')][_0x1df4('0x44')]!==_0x1df4('0x45')){var _0x1cf9cc={};_0x1cf9cc[_0x5b9080[_0x1df4('0x46')]]={'$like':'%'+_0x1d1b65[_0x1df4('0x36')][_0x1df4('0x47')]+'%'};return _0x1cf9cc;}})});}_0x46dd6a=_[_0x1df4('0x48')]({},_0x46dd6a,_0x1d1b65[_0x1df4('0x49')]);var _0x91055e={'where':_0x46dd6a['where']};return db[_0x1df4('0x33')]['count'](_0x91055e)[_0x1df4('0x2d')](function(_0x32762d){_0xcccb84[_0x1df4('0x28')]=_0x32762d;if(_0x1d1b65['query']['includeAll']){_0x46dd6a[_0x1df4('0x4a')]=[{'all':!![]}];}return db[_0x1df4('0x33')]['findAll'](_0x46dd6a);})[_0x1df4('0x2d')](function(_0x2c9d7f){_0xcccb84[_0x1df4('0x4b')]=_0x2c9d7f;return _0xcccb84;})[_0x1df4('0x2d')](respondWithFilteredResult(_0x16bce6,_0x46dd6a))['catch'](handleError(_0x16bce6,null));};exports[_0x1df4('0x4c')]=function(_0x3146c7,_0x40a9ec){var _0x1585d5={'raw':![],'where':{'id':_0x3146c7[_0x1df4('0x4d')]['id']}},_0x2f576a={};_0x2f576a[_0x1df4('0x37')]=_['keys'](db[_0x1df4('0x33')][_0x1df4('0x34')]);_0x2f576a['query']=_[_0x1df4('0x35')](_0x3146c7[_0x1df4('0x36')]);_0x2f576a[_0x1df4('0x41')]=_[_0x1df4('0x4e')](_0x2f576a[_0x1df4('0x37')],_0x2f576a[_0x1df4('0x36')]);_0x1585d5[_0x1df4('0x38')]=_[_0x1df4('0x4e')](_0x2f576a[_0x1df4('0x37')],qs[_0x1df4('0x39')](_0x3146c7[_0x1df4('0x36')][_0x1df4('0x39')]));_0x1585d5[_0x1df4('0x38')]=_0x1585d5[_0x1df4('0x38')][_0x1df4('0x3a')]?_0x1585d5[_0x1df4('0x38')]:_0x2f576a[_0x1df4('0x37')];if(_0x3146c7[_0x1df4('0x36')][_0x1df4('0x4f')]){_0x1585d5[_0x1df4('0x4a')]=[{'all':!![]}];}_0x1585d5=_[_0x1df4('0x48')]({},_0x1585d5,_0x3146c7['options']);return db[_0x1df4('0x33')][_0x1df4('0x50')](_0x1585d5)[_0x1df4('0x2d')](handleEntityNotFound(_0x40a9ec,null))['then'](respondWithResult(_0x40a9ec,null))[_0x1df4('0x23')](handleError(_0x40a9ec,null));};exports['create']=function(_0x15e192,_0x558dbc){return db[_0x1df4('0x33')][_0x1df4('0x51')](_0x15e192[_0x1df4('0x52')],{})[_0x1df4('0x2d')](respondWithResult(_0x558dbc,0xc9))['catch'](handleError(_0x558dbc,null));};exports[_0x1df4('0x2c')]=function(_0x102825,_0x456176){if(_0x102825[_0x1df4('0x52')]['id']){delete _0x102825[_0x1df4('0x52')]['id'];}return db[_0x1df4('0x33')]['find']({'where':{'id':_0x102825[_0x1df4('0x4d')]['id']}})[_0x1df4('0x2d')](handleEntityNotFound(_0x456176,null))[_0x1df4('0x2d')](saveUpdates(_0x102825[_0x1df4('0x52')],null))[_0x1df4('0x2d')](respondWithResult(_0x456176,null))[_0x1df4('0x23')](handleError(_0x456176,null));};exports['destroy']=function(_0x308d1c,_0x2badd3){return db[_0x1df4('0x33')]['find']({'where':{'id':_0x308d1c[_0x1df4('0x4d')]['id']}})[_0x1df4('0x2d')](handleEntityNotFound(_0x2badd3,null))[_0x1df4('0x2d')](removeEntity(_0x2badd3,null))[_0x1df4('0x23')](handleError(_0x2badd3,null));};exports[_0x1df4('0x53')]=function(_0x2e0c15,_0x4f4668,_0x5860d3){var _0x432a8a={};var _0x1960cb={};var _0x37d74b;var _0x429697;return db[_0x1df4('0x33')][_0x1df4('0x54')]({'where':{'id':_0x2e0c15['params']['id']}})[_0x1df4('0x2d')](handleEntityNotFound(_0x4f4668,null))[_0x1df4('0x2d')](function(_0x107b3d){if(_0x107b3d){_0x37d74b=_0x107b3d;_0x1960cb[_0x1df4('0x37')]=_[_0x1df4('0x35')](db[_0x1df4('0x55')][_0x1df4('0x34')]);_0x1960cb[_0x1df4('0x36')]=_[_0x1df4('0x35')](_0x2e0c15[_0x1df4('0x36')]);_0x1960cb[_0x1df4('0x41')]=_[_0x1df4('0x4e')](_0x1960cb[_0x1df4('0x37')],_0x1960cb[_0x1df4('0x36')]);_0x432a8a[_0x1df4('0x38')]=_[_0x1df4('0x4e')](_0x1960cb['model'],qs['fields'](_0x2e0c15[_0x1df4('0x36')][_0x1df4('0x39')]));_0x432a8a['attributes']=_0x432a8a[_0x1df4('0x38')][_0x1df4('0x3a')]?_0x432a8a[_0x1df4('0x38')]:_0x1960cb['model'];_0x432a8a[_0x1df4('0x3e')]=qs[_0x1df4('0x3f')](_0x2e0c15[_0x1df4('0x36')][_0x1df4('0x3f')]);_0x432a8a[_0x1df4('0x40')]=qs['filters'](_['pick'](_0x2e0c15['query'],_0x1960cb[_0x1df4('0x41')]));if(_0x2e0c15[_0x1df4('0x36')][_0x1df4('0x47')]){_0x432a8a['where']=_[_0x1df4('0x48')](_0x432a8a['where'],{'$or':_[_0x1df4('0x42')](_0x432a8a[_0x1df4('0x38')],function(_0xd0d19e){var _0xb56f8f={};_0xb56f8f[_0xd0d19e]={'$like':'%'+_0x2e0c15['query']['filter']+'%'};return _0xb56f8f;})});}_0x432a8a=_['merge']({},_0x432a8a,_0x2e0c15[_0x1df4('0x49')]);return _0x37d74b[_0x1df4('0x53')](_0x432a8a);}})[_0x1df4('0x2d')](function(_0x41e47f){if(_0x41e47f){_0x429697=_0x41e47f[_0x1df4('0x3a')];if(!_0x2e0c15[_0x1df4('0x36')]['hasOwnProperty'](_0x1df4('0x3c'))){_0x432a8a[_0x1df4('0x3d')]=qs[_0x1df4('0x3d')](_0x2e0c15['query'][_0x1df4('0x3d')]);_0x432a8a['offset']=qs[_0x1df4('0x29')](_0x2e0c15[_0x1df4('0x36')][_0x1df4('0x29')]);}return _0x37d74b[_0x1df4('0x53')](_0x432a8a);}})[_0x1df4('0x2d')](function(_0x5d57fd){if(_0x5d57fd){return _0x5d57fd?{'count':_0x429697,'rows':_0x5d57fd}:null;}})['then'](respondWithResult(_0x4f4668,null))[_0x1df4('0x23')](handleError(_0x4f4668,null));};exports[_0x1df4('0x56')]=function(_0x317292,_0xdde456,_0x408201){if(_0x317292[_0x1df4('0x52')]['id']){delete _0x317292[_0x1df4('0x52')]['id'];}return db[_0x1df4('0x33')]['findOne']({'where':{'id':_0x317292[_0x1df4('0x4d')]['id']}})[_0x1df4('0x2d')](handleEntityNotFound(_0xdde456,null))[_0x1df4('0x2d')](function(_0x21959d){if(_0x21959d){_0x317292['body'][_0x1df4('0x57')]=_0x21959d['id'];_0x317292[_0x1df4('0x52')][_0x1df4('0x58')]=integrations[_0x1df4('0x59')](_0x317292[_0x1df4('0x52')]['channel'],_0x317292['body'][_0x1df4('0x43')]);_0x317292['body'][_0x1df4('0x5a')]=integrations['getDescriptions'](_0x317292[_0x1df4('0x52')][_0x1df4('0x5b')],_0x317292[_0x1df4('0x52')]['type']);return db['ServicenowConfiguration'][_0x1df4('0x51')](_0x317292[_0x1df4('0x52')],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db[_0x1df4('0x5c')],'as':_0x1df4('0x5a')}]});}return null;})[_0x1df4('0x2d')](respondWithResult(_0xdde456,null))[_0x1df4('0x23')](handleError(_0xdde456,null));};exports[_0x1df4('0x5d')]=function(_0x768b99,_0x38e78a,_0x22d3be){var _0xce97fb=[_0x1df4('0x5e'),_0x1df4('0x5f'),_0x1df4('0x60'),_0x1df4('0x61'),'close_code',_0x1df4('0x62'),_0x1df4('0x63'),'severity',_0x1df4('0x64')];var _0x2e795c=['parent',_0x1df4('0x5e'),_0x1df4('0x65'),'watch_list',_0x1df4('0x66'),'sys_updated_on','child_incidents',_0x1df4('0x5f'),_0x1df4('0x67'),_0x1df4('0x68'),_0x1df4('0x69'),_0x1df4('0x6a'),'opened_by',_0x1df4('0x6b'),_0x1df4('0x6c'),_0x1df4('0x6d'),_0x1df4('0x6e'),_0x1df4('0x6f'),_0x1df4('0x60'),_0x1df4('0x3e'),_0x1df4('0x70'),'closed_at',_0x1df4('0x71'),_0x1df4('0x72'),'impact',_0x1df4('0x73'),_0x1df4('0x74'),_0x1df4('0x75'),_0x1df4('0x76'),_0x1df4('0x77'),_0x1df4('0x78'),_0x1df4('0x79'),_0x1df4('0x7a'),_0x1df4('0x7b'),_0x1df4('0x7c'),_0x1df4('0x7d'),_0x1df4('0x7e'),_0x1df4('0x7f'),_0x1df4('0x80'),'caller_id','approval_set',_0x1df4('0x61'),_0x1df4('0x81'),'short_description',_0x1df4('0x82'),'correlation_display',_0x1df4('0x83'),_0x1df4('0x84'),_0x1df4('0x85'),_0x1df4('0x86'),_0x1df4('0x87'),_0x1df4('0x88'),_0x1df4('0x89'),_0x1df4('0x62'),_0x1df4('0x8a'),'close_notes',_0x1df4('0x8b'),_0x1df4('0x8c'),_0x1df4('0x8d'),_0x1df4('0x8e'),_0x1df4('0x8f'),_0x1df4('0x90'),_0x1df4('0x63'),_0x1df4('0x91'),_0x1df4('0x92'),_0x1df4('0x93'),'reassignment_count',_0x1df4('0x94'),_0x1df4('0x95'),_0x1df4('0x96'),_0x1df4('0x97'),_0x1df4('0x98'),'approval',_0x1df4('0x99'),'due_date',_0x1df4('0x9a'),_0x1df4('0x9b'),'sys_tags',_0x1df4('0x9c'),_0x1df4('0x9d'),_0x1df4('0x9e'),_0x1df4('0x9f'),_0x1df4('0x64')];var _0x1e5830='';var _0x48015c='';var _0x584f71=[];var _0x27c974='';var _0x4ddf73='';var _0x38d2c5=[];var _0x5e4eb0='';var _0x1b1e52='';var _0x163068={};var _0x5a11fc='';return db['ServicenowAccount'][_0x1df4('0x54')]({'where':{'id':_0x768b99['params']['id']},'attributes':['id','username',_0x1df4('0xa0'),_0x1df4('0xa1'),'remoteUri',_0x1df4('0xa2')]})[_0x1df4('0x2d')](handleEntityNotFound(_0x38e78a,null))[_0x1df4('0x2d')](function(_0x254404){if(_0x254404){_0x5a11fc=_0x254404['remoteUri'];var _0x2f367f=_0x5a11fc['slice'](-0x1);if(_0x2f367f==='/'){_0x5a11fc=_0x5a11fc[_0x1df4('0xa3')](0x0,_0x5a11fc[_0x1df4('0xa4')](_0x2f367f));}_0x1b1e52=util[_0x1df4('0xa5')]('%s/api/now/doc/table/schema/',_0x5a11fc);_0x5e4eb0=util[_0x1df4('0xa5')](_0x1df4('0xa6'),_0x5a11fc);_0x163068={'user':_0x254404[_0x1df4('0xa7')],'pass':_0x254404[_0x1df4('0xa0')]};var _0x5eeb46={'method':_0x1df4('0xa8'),'uri':_0x1b1e52+_0x1df4('0xa9'),'auth':_0x163068,'json':!![]};return rp(_0x5eeb46);}})[_0x1df4('0x2d')](function(_0x388614){if(_0x388614['result']['length']>0x0){_0x1e5830=_0x388614['result'];}console[_0x1df4('0xaa')](_0x1df4('0xab'),_0x1e5830);_0x38d2c5=[];_0x48015c=Object['assign']([],_0x1e5830);_[_0x1df4('0xac')](_0x48015c,function(_0x4dc84f){return!_0xce97fb[_0x1df4('0xad')](_0x4dc84f[_0x1df4('0x30')]);});_0x48015c[_0x1df4('0xae')](function(_0x1da822){var _0x1901b2=createFieldObject(_0x5e4eb0,_0x163068,_0x1da822[_0x1df4('0xaf')],_0x1da822['name'],_0x1da822[_0x1df4('0xb0')],![]);_0x38d2c5['push'](_0x1901b2);});return Promise['all'](_0x38d2c5);})[_0x1df4('0x2d')](function(_0x21d9d8){_0x584f71=_0x21d9d8;_0x27c974=Object['assign']([],_0x1e5830);console[_0x1df4('0xaa')]('TCL:\x20_object',_0x1e5830);_[_0x1df4('0xac')](_0x27c974,function(_0x1a0c2f){return _0x2e795c[_0x1df4('0xad')](_0x1a0c2f[_0x1df4('0x30')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x27c974);_0x38d2c5=[];_0x27c974[_0x1df4('0xae')](function(_0x51eb26){var _0x44173e=createFieldObject(_0x5e4eb0,_0x163068,_0x51eb26[_0x1df4('0xaf')],_0x51eb26[_0x1df4('0x30')],_0x51eb26[_0x1df4('0xb0')],!![]);_0x38d2c5[_0x1df4('0xb1')](_0x44173e);});return Promise[_0x1df4('0xb2')](_0x38d2c5);})[_0x1df4('0x2d')](function(_0x2a86d2){_0x4ddf73=_0x2a86d2;var _0x560fdd=_0x584f71['concat'](_0x4ddf73);return{'count':_0x560fdd[_0x1df4('0x3a')],'rows':_0x560fdd};})[_0x1df4('0x2d')](respondWithResult(_0x38e78a,null))[_0x1df4('0x23')](function(_0x1c9195){console[_0x1df4('0xaa')]('ServiceNow\x20error:\x20'+_0x1c9195);var _0x3d8337=_0x768b99[_0x1df4('0x36')][_0x1df4('0x1a')]?0x1f4:_0x1c9195[_0x1df4('0xb3')]||0x1f4;logger[_0x1df4('0x1f')](_0x1c9195[_0x1df4('0x2f')]);delete _0x1c9195[_0x1df4('0x30')];if(_0x3d8337===0x191){_0x3d8337=0x190;}_0x38e78a['status'](_0x3d8337)['send'](_0x768b99['query'][_0x1df4('0x1a')]?{'message':_0x1df4('0xb4'),'statusCode':_0x1c9195[_0x1df4('0xb3')]}:_0x1c9195);});};function createFieldObject(_0x18abbb,_0x29a4e7,_0x28c6ea,_0x394520,_0xfa8867,_0x29a987){return new Promise(function(_0x196dc7,_0x5a0c97){var _0x56e3d6={'id':_0x394520,'name':_0xfa8867,'custom':_0x29a987};if(_0x28c6ea==='boolean'){_0x56e3d6[_0x1df4('0x49')]=[{'name':'True','value':'true'},{'name':_0x1df4('0xb5'),'value':_0x1df4('0xb6')}];_0x196dc7(_0x56e3d6);}else{var _0x10065e={'method':_0x1df4('0xa8'),'uri':_0x18abbb+_0x1df4('0xb7')+_0x394520,'auth':_0x29a4e7,'json':!![]};return rp(_0x10065e)[_0x1df4('0x2d')](function(_0x6558f8){var _0x3349b9=[];if(_0x6558f8[_0x1df4('0x22')]['length']>0x0){_0x6558f8[_0x1df4('0x22')]['forEach'](function(_0x33b1ce){if(_0x33b1ce[_0x1df4('0xb8')]===_0x1df4('0xb6')){var _0x4a7123={'name':_0x33b1ce[_0x1df4('0xb0')],'value':_0x33b1ce[_0x1df4('0xb9')]};_0x3349b9['push'](_0x4a7123);}});}_0x56e3d6['options']=_0x3349b9;if(_0x56e3d6[_0x1df4('0x49')]['length']>0x0){_0x196dc7(_0x56e3d6);}else{if(_0x29a987==![]){_0x196dc7();}else{_0x196dc7(_0x56e3d6);}}});}});} \ No newline at end of file +var _0xf72a=['status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','name','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','merge','where','map','type','key','VIRTUAL','field','filter','options','ServicenowAccount','includeAll','findAll','rows','show','params','include','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowConfiguration','ServicenowField','Descriptions','getFields','hold_reason','subcategory','close_code','notify','category','parent','made_sla','caused_by','watch_list','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','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','business_service','priority','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','resolved_at','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','incident_state','urgency','problem_id','reassignment_count','activity_due','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','location','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','%s/api/now/table/','log','incident\x20table\x20objects','assign','remove','includes','forEach','label','push','all','TCL:\x20_object','internalType','concat','ServiceNow\x20error:\x20','statusCode','stack','send','test','True','False','sys_choice?sysparm_query=name=incident^element=','false','value','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','sendStatus'];(function(_0x360265,_0x406bf7){var _0xf31ead=function(_0x4cc025){while(--_0x4cc025){_0x360265['push'](_0x360265['shift']());}};_0xf31ead(++_0x406bf7);}(_0xf72a,0x9d));var _0xaf72=function(_0x444e7d,_0x567b8f){_0x444e7d=_0x444e7d-0x0;var _0x53d7d6=_0xf72a[_0x444e7d];return _0x53d7d6;};'use strict';var pdf=require(_0xaf72('0x0'));var emlformat=require(_0xaf72('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaf72('0x2'));var rp=require(_0xaf72('0x3'));var moment=require('moment');var BPromise=require(_0xaf72('0x4'));var Mustache=require('mustache');var util=require(_0xaf72('0x5'));var path=require(_0xaf72('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaf72('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xaf72('0x8'));var crypto=require(_0xaf72('0x9'));var jsforce=require(_0xaf72('0xa'));var deskjs=require(_0xaf72('0xb'));var toCsv=require(_0xaf72('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaf72('0xd'));var authService=require(_0xaf72('0xe'));var qs=require(_0xaf72('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf72('0x10'))('api');var utils=require(_0xaf72('0x11'));var config=require(_0xaf72('0x12'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xaf72('0x13'));var client=jayson[_0xaf72('0x14')][_0xaf72('0x15')]({'port':0x232a});function checkPasswordPattern(_0x51b64c,_0x189c15,_0x15d6b9){if(_0x15d6b9){var _0x116d84=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x116d84['test'](_0x189c15)){return _0x51b64c;}else{throw new Error(_0xaf72('0x16'));}}else{return _0x51b64c;}}function respondWithRpcPromise(_0x34b6c9,_0x3b073e,_0x413e57,_0x1bde53){return new BPromise(function(_0x14b650,_0x306519){var _0x3ea47c=_0x1bde53||client;return _0x3ea47c['request'](_0x34b6c9,_0x413e57)[_0xaf72('0x17')](function(_0x3a5f34){logger[_0xaf72('0x18')]('ServicenowAccount,\x20%s,\x20%s',_0x3b073e,_0xaf72('0x19'));logger[_0xaf72('0x1a')](_0xaf72('0x1b'),_0x3b073e,_0xaf72('0x19'),JSON[_0xaf72('0x1c')](_0x3a5f34));if(_0x3a5f34[_0xaf72('0x1d')]){if(_0x3a5f34[_0xaf72('0x1d')][_0xaf72('0x1e')]===0x1f4){logger[_0xaf72('0x1d')](_0xaf72('0x1f'),_0x3b073e,_0x3a5f34[_0xaf72('0x1d')]['message']);return _0x306519(_0x3a5f34[_0xaf72('0x1d')]['message']);}logger['error'](_0xaf72('0x1f'),_0x3b073e,_0x3a5f34[_0xaf72('0x1d')][_0xaf72('0x20')]);return _0x14b650(_0x3a5f34['error'][_0xaf72('0x20')]);}else{logger[_0xaf72('0x18')](_0xaf72('0x1f'),_0x3b073e,_0xaf72('0x19'));_0x14b650(_0x3a5f34[_0xaf72('0x21')]['message']);}})[_0xaf72('0x22')](function(_0x3e8a47){logger['error'](_0xaf72('0x1f'),_0x3b073e,_0x3e8a47);_0x306519(_0x3e8a47);});});}function respondWithStatusCode(_0x2a9128,_0x11e45e){_0x11e45e=_0x11e45e||0xcc;return function(_0x23f573){if(_0x23f573){return _0x2a9128[_0xaf72('0x23')](_0x11e45e);}return _0x2a9128[_0xaf72('0x24')](_0x11e45e)[_0xaf72('0x25')]();};}function respondWithResult(_0x1c2526,_0x2cd387){_0x2cd387=_0x2cd387||0xc8;return function(_0xeca59a){if(_0xeca59a){return _0x1c2526[_0xaf72('0x24')](_0x2cd387)[_0xaf72('0x26')](_0xeca59a);}};}function respondWithFilteredResult(_0x58ebfc,_0x296751){return function(_0x333c98){if(_0x333c98){var _0x5df7c7=_0x333c98[_0xaf72('0x27')],_0x3caf7e=_0x296751[_0xaf72('0x28')],_0x131343=_0x296751[_0xaf72('0x28')]+_0x296751['limit'],_0xf1e812;if(_0x131343>=_0x5df7c7){_0x131343=_0x5df7c7;_0xf1e812=0xc8;}else{_0xf1e812=0xce;}_0x58ebfc[_0xaf72('0x24')](_0xf1e812);return _0x58ebfc[_0xaf72('0x29')](_0xaf72('0x2a'),_0x3caf7e+'-'+_0x131343+'/'+_0x5df7c7)[_0xaf72('0x26')](_0x333c98);}return null;};}function patchUpdates(_0x26693a){return function(_0x360331){try{jsonpatch[_0xaf72('0x2b')](_0x360331,_0x26693a,!![]);}catch(_0x2b4434){return BPromise[_0xaf72('0x2c')](_0x2b4434);}return _0x360331[_0xaf72('0x2d')]();};}function saveUpdates(_0x38df87,_0x2b8639){return function(_0x2046f2){if(_0x2046f2){return _0x2046f2[_0xaf72('0x2e')](_0x38df87)[_0xaf72('0x17')](function(_0x287cdf){return _0x287cdf;});}return null;};}function removeEntity(_0x361f56,_0x58caf0){return function(_0x1332fe){if(_0x1332fe){return _0x1332fe[_0xaf72('0x2f')]()[_0xaf72('0x17')](function(){_0x361f56[_0xaf72('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4327d9,_0x4b5997){return function(_0x2e54ac){if(!_0x2e54ac){_0x4327d9[_0xaf72('0x23')](0x194);}return _0x2e54ac;};}function handleError(_0x4aecee,_0x4b5304){_0x4b5304=_0x4b5304||0x1f4;return function(_0x56c12b){logger[_0xaf72('0x1d')](_0x56c12b['stack']);if(_0x56c12b['name']){delete _0x56c12b[_0xaf72('0x30')];}_0x4aecee[_0xaf72('0x24')](_0x4b5304)['send'](_0x56c12b);};}exports['index']=function(_0x32656d,_0x487947){var _0x272175={},_0x275e08={},_0x303076={'count':0x0,'rows':[]};var _0x39fecb=db['ServicenowAccount'][_0xaf72('0x31')];_0x275e08[_0xaf72('0x32')]=_[_0xaf72('0x33')](_0x39fecb);_0x275e08['query']=_[_0xaf72('0x33')](_0x32656d[_0xaf72('0x34')]);_0x275e08[_0xaf72('0x35')]=_[_0xaf72('0x36')](_0x275e08[_0xaf72('0x32')],_0x275e08[_0xaf72('0x34')]);_0x272175['attributes']=_[_0xaf72('0x36')](_0x275e08[_0xaf72('0x32')],qs[_0xaf72('0x37')](_0x32656d[_0xaf72('0x34')][_0xaf72('0x37')]));_0x272175[_0xaf72('0x38')]=_0x272175[_0xaf72('0x38')][_0xaf72('0x39')]?_0x272175['attributes']:_0x275e08[_0xaf72('0x32')];if(!_0x32656d[_0xaf72('0x34')][_0xaf72('0x3a')](_0xaf72('0x3b'))){_0x272175[_0xaf72('0x3c')]=qs[_0xaf72('0x3c')](_0x32656d[_0xaf72('0x34')]['limit']);_0x272175[_0xaf72('0x28')]=qs['offset'](_0x32656d[_0xaf72('0x34')]['offset']);}_0x272175[_0xaf72('0x3d')]=qs[_0xaf72('0x3e')](_0x32656d['query'][_0xaf72('0x3e')]);_0x272175['where']=qs[_0xaf72('0x35')](_['pick'](_0x32656d[_0xaf72('0x34')],_0x275e08[_0xaf72('0x35')]));if(_0x32656d[_0xaf72('0x34')]['filter']){_0x272175['where']=_[_0xaf72('0x3f')](_0x272175[_0xaf72('0x40')],{'$or':_[_0xaf72('0x41')](_0x39fecb,function(_0x5d5264){if(_0x5d5264[_0xaf72('0x42')][_0xaf72('0x43')]!==_0xaf72('0x44')){var _0x986ba1={};_0x986ba1[_0x5d5264[_0xaf72('0x45')]]={'$like':'%'+_0x32656d[_0xaf72('0x34')][_0xaf72('0x46')]+'%'};return _0x986ba1;}})});}_0x272175=_[_0xaf72('0x3f')]({},_0x272175,_0x32656d[_0xaf72('0x47')]);var _0x41b173={'where':_0x272175[_0xaf72('0x40')]};return db[_0xaf72('0x48')][_0xaf72('0x27')](_0x41b173)[_0xaf72('0x17')](function(_0x470229){_0x303076[_0xaf72('0x27')]=_0x470229;if(_0x32656d['query'][_0xaf72('0x49')]){_0x272175['include']=[{'all':!![]}];}return db[_0xaf72('0x48')][_0xaf72('0x4a')](_0x272175);})[_0xaf72('0x17')](function(_0x572671){_0x303076[_0xaf72('0x4b')]=_0x572671;return _0x303076;})[_0xaf72('0x17')](respondWithFilteredResult(_0x487947,_0x272175))[_0xaf72('0x22')](handleError(_0x487947,null));};exports[_0xaf72('0x4c')]=function(_0x15ca4c,_0x425ba7){var _0x35e4ef={'raw':![],'where':{'id':_0x15ca4c[_0xaf72('0x4d')]['id']}},_0x45a741={};_0x45a741[_0xaf72('0x32')]=_[_0xaf72('0x33')](db['ServicenowAccount']['rawAttributes']);_0x45a741[_0xaf72('0x34')]=_[_0xaf72('0x33')](_0x15ca4c[_0xaf72('0x34')]);_0x45a741[_0xaf72('0x35')]=_[_0xaf72('0x36')](_0x45a741['model'],_0x45a741[_0xaf72('0x34')]);_0x35e4ef[_0xaf72('0x38')]=_['intersection'](_0x45a741[_0xaf72('0x32')],qs[_0xaf72('0x37')](_0x15ca4c[_0xaf72('0x34')][_0xaf72('0x37')]));_0x35e4ef['attributes']=_0x35e4ef[_0xaf72('0x38')]['length']?_0x35e4ef[_0xaf72('0x38')]:_0x45a741[_0xaf72('0x32')];if(_0x15ca4c[_0xaf72('0x34')][_0xaf72('0x49')]){_0x35e4ef[_0xaf72('0x4e')]=[{'all':!![]}];}_0x35e4ef=_[_0xaf72('0x3f')]({},_0x35e4ef,_0x15ca4c[_0xaf72('0x47')]);return db['ServicenowAccount'][_0xaf72('0x4f')](_0x35e4ef)[_0xaf72('0x17')](handleEntityNotFound(_0x425ba7,null))['then'](respondWithResult(_0x425ba7,null))[_0xaf72('0x22')](handleError(_0x425ba7,null));};exports[_0xaf72('0x50')]=function(_0x27b808,_0x4d634a){return db[_0xaf72('0x48')]['create'](_0x27b808[_0xaf72('0x51')],{})['then'](respondWithResult(_0x4d634a,0xc9))[_0xaf72('0x22')](handleError(_0x4d634a,null));};exports[_0xaf72('0x2e')]=function(_0x3019f8,_0x4cc0c6){if(_0x3019f8[_0xaf72('0x51')]['id']){delete _0x3019f8[_0xaf72('0x51')]['id'];}return db['ServicenowAccount'][_0xaf72('0x4f')]({'where':{'id':_0x3019f8[_0xaf72('0x4d')]['id']}})[_0xaf72('0x17')](handleEntityNotFound(_0x4cc0c6,null))[_0xaf72('0x17')](saveUpdates(_0x3019f8[_0xaf72('0x51')],null))[_0xaf72('0x17')](respondWithResult(_0x4cc0c6,null))[_0xaf72('0x22')](handleError(_0x4cc0c6,null));};exports[_0xaf72('0x2f')]=function(_0x359723,_0x1973a9){return db['ServicenowAccount'][_0xaf72('0x4f')]({'where':{'id':_0x359723['params']['id']}})[_0xaf72('0x17')](handleEntityNotFound(_0x1973a9,null))[_0xaf72('0x17')](removeEntity(_0x1973a9,null))['catch'](handleError(_0x1973a9,null));};exports[_0xaf72('0x52')]=function(_0x46fe23,_0x398168,_0x1d7c7f){var _0xeef5a={};var _0x477151={};var _0x55eb4e;var _0xfb62b5;return db['ServicenowAccount'][_0xaf72('0x53')]({'where':{'id':_0x46fe23[_0xaf72('0x4d')]['id']}})[_0xaf72('0x17')](handleEntityNotFound(_0x398168,null))[_0xaf72('0x17')](function(_0x192e19){if(_0x192e19){_0x55eb4e=_0x192e19;_0x477151[_0xaf72('0x32')]=_[_0xaf72('0x33')](db['ServicenowConfiguration'][_0xaf72('0x31')]);_0x477151['query']=_['keys'](_0x46fe23[_0xaf72('0x34')]);_0x477151[_0xaf72('0x35')]=_[_0xaf72('0x36')](_0x477151[_0xaf72('0x32')],_0x477151[_0xaf72('0x34')]);_0xeef5a[_0xaf72('0x38')]=_['intersection'](_0x477151[_0xaf72('0x32')],qs['fields'](_0x46fe23[_0xaf72('0x34')][_0xaf72('0x37')]));_0xeef5a[_0xaf72('0x38')]=_0xeef5a['attributes']['length']?_0xeef5a[_0xaf72('0x38')]:_0x477151[_0xaf72('0x32')];_0xeef5a[_0xaf72('0x3d')]=qs[_0xaf72('0x3e')](_0x46fe23[_0xaf72('0x34')][_0xaf72('0x3e')]);_0xeef5a[_0xaf72('0x40')]=qs[_0xaf72('0x35')](_['pick'](_0x46fe23[_0xaf72('0x34')],_0x477151[_0xaf72('0x35')]));if(_0x46fe23[_0xaf72('0x34')][_0xaf72('0x46')]){_0xeef5a['where']=_[_0xaf72('0x3f')](_0xeef5a['where'],{'$or':_[_0xaf72('0x41')](_0xeef5a[_0xaf72('0x38')],function(_0x5ca053){var _0x308d2f={};_0x308d2f[_0x5ca053]={'$like':'%'+_0x46fe23[_0xaf72('0x34')]['filter']+'%'};return _0x308d2f;})});}_0xeef5a=_[_0xaf72('0x3f')]({},_0xeef5a,_0x46fe23['options']);return _0x55eb4e[_0xaf72('0x52')](_0xeef5a);}})[_0xaf72('0x17')](function(_0x6145f2){if(_0x6145f2){_0xfb62b5=_0x6145f2[_0xaf72('0x39')];if(!_0x46fe23['query'][_0xaf72('0x3a')](_0xaf72('0x3b'))){_0xeef5a[_0xaf72('0x3c')]=qs[_0xaf72('0x3c')](_0x46fe23[_0xaf72('0x34')]['limit']);_0xeef5a[_0xaf72('0x28')]=qs[_0xaf72('0x28')](_0x46fe23[_0xaf72('0x34')][_0xaf72('0x28')]);}return _0x55eb4e[_0xaf72('0x52')](_0xeef5a);}})[_0xaf72('0x17')](function(_0x10ddf1){if(_0x10ddf1){return _0x10ddf1?{'count':_0xfb62b5,'rows':_0x10ddf1}:null;}})['then'](respondWithResult(_0x398168,null))[_0xaf72('0x22')](handleError(_0x398168,null));};exports[_0xaf72('0x54')]=function(_0x1e065e,_0x4e6304,_0x19c60c){if(_0x1e065e['body']['id']){delete _0x1e065e[_0xaf72('0x51')]['id'];}return db[_0xaf72('0x48')]['findOne']({'where':{'id':_0x1e065e['params']['id']}})[_0xaf72('0x17')](handleEntityNotFound(_0x4e6304,null))['then'](function(_0x278ebd){if(_0x278ebd){_0x1e065e[_0xaf72('0x51')][_0xaf72('0x55')]=_0x278ebd['id'];_0x1e065e[_0xaf72('0x51')][_0xaf72('0x56')]=integrations[_0xaf72('0x57')](_0x1e065e[_0xaf72('0x51')][_0xaf72('0x58')],_0x1e065e['body'][_0xaf72('0x42')]);_0x1e065e[_0xaf72('0x51')]['Descriptions']=integrations[_0xaf72('0x59')](_0x1e065e[_0xaf72('0x51')]['channel'],_0x1e065e['body'][_0xaf72('0x42')]);return db[_0xaf72('0x5a')][_0xaf72('0x50')](_0x1e065e[_0xaf72('0x51')],{'include':[{'model':db[_0xaf72('0x5b')],'as':_0xaf72('0x56')},{'model':db[_0xaf72('0x5b')],'as':_0xaf72('0x5c')}]});}return null;})[_0xaf72('0x17')](respondWithResult(_0x4e6304,null))[_0xaf72('0x22')](handleError(_0x4e6304,null));};exports[_0xaf72('0x5d')]=function(_0x2ee66f,_0x38e577,_0x4d37ee){var _0x52aa96=['made_sla',_0xaf72('0x5e'),'knowledge',_0xaf72('0x5f'),_0xaf72('0x60'),_0xaf72('0x61'),'incident_state','severity',_0xaf72('0x62')];var _0x4a04b5=[_0xaf72('0x63'),_0xaf72('0x64'),_0xaf72('0x65'),_0xaf72('0x66'),_0xaf72('0x67'),_0xaf72('0x68'),_0xaf72('0x69'),_0xaf72('0x5e'),_0xaf72('0x6a'),_0xaf72('0x6b'),_0xaf72('0x6c'),_0xaf72('0x6d'),'opened_by',_0xaf72('0x6e'),_0xaf72('0x6f'),_0xaf72('0x70'),_0xaf72('0x71'),_0xaf72('0x72'),_0xaf72('0x73'),'order',_0xaf72('0x74'),_0xaf72('0x75'),_0xaf72('0x76'),_0xaf72('0x77'),'impact',_0xaf72('0x78'),'work_notes_list',_0xaf72('0x79'),_0xaf72('0x7a'),'sys_domain_path',_0xaf72('0x7b'),_0xaf72('0x7c'),_0xaf72('0x7d'),_0xaf72('0x7e'),_0xaf72('0x7f'),_0xaf72('0x80'),_0xaf72('0x81'),'reopened_time',_0xaf72('0x82'),'caller_id','approval_set',_0xaf72('0x5f'),_0xaf72('0x83'),_0xaf72('0x84'),_0xaf72('0x60'),_0xaf72('0x85'),_0xaf72('0x86'),_0xaf72('0x87'),_0xaf72('0x88'),_0xaf72('0x89'),_0xaf72('0x8a'),_0xaf72('0x8b'),_0xaf72('0x8c'),_0xaf72('0x61'),_0xaf72('0x8d'),_0xaf72('0x8e'),_0xaf72('0x8f'),_0xaf72('0x90'),_0xaf72('0x91'),_0xaf72('0x92'),'contact_type',_0xaf72('0x93'),_0xaf72('0x94'),_0xaf72('0x95'),_0xaf72('0x96'),'company',_0xaf72('0x97'),_0xaf72('0x98'),'assigned_to','severity','comments',_0xaf72('0x99'),_0xaf72('0x9a'),_0xaf72('0x9b'),_0xaf72('0x9c'),_0xaf72('0x9d'),_0xaf72('0x9e'),_0xaf72('0x9f'),'escalation','upon_approval','correlation_id',_0xaf72('0xa0'),_0xaf72('0x62')];var _0x47c225='';var _0x403627='';var _0x3e881b=[];var _0x4bda7c='';var _0x561397='';var _0x48a9fe=[];var _0x2db6bb='';var _0x16a555='';var _0x3880d5={};var _0x111ffb='';return db['ServicenowAccount'][_0xaf72('0x53')]({'where':{'id':_0x2ee66f[_0xaf72('0x4d')]['id']},'attributes':['id',_0xaf72('0xa1'),_0xaf72('0xa2'),_0xaf72('0xa3'),_0xaf72('0xa4'),_0xaf72('0xa5')]})[_0xaf72('0x17')](handleEntityNotFound(_0x38e577,null))['then'](function(_0x5f27a2){if(_0x5f27a2){_0x111ffb=_0x5f27a2[_0xaf72('0xa4')];var _0x1d273c=_0x111ffb[_0xaf72('0xa6')](-0x1);if(_0x1d273c==='/'){_0x111ffb=_0x111ffb[_0xaf72('0xa7')](0x0,_0x111ffb[_0xaf72('0xa8')](_0x1d273c));}_0x16a555=util['format'](_0xaf72('0xa9'),_0x111ffb);_0x2db6bb=util['format'](_0xaf72('0xaa'),_0x111ffb);_0x3880d5={'user':_0x5f27a2[_0xaf72('0xa1')],'pass':_0x5f27a2[_0xaf72('0xa2')]};var _0x40bb1e={'method':'GET','uri':_0x16a555+'incident?sysparm_display_value=all','auth':_0x3880d5,'json':!![]};return rp(_0x40bb1e);}})[_0xaf72('0x17')](function(_0x76c04){if(_0x76c04[_0xaf72('0x21')][_0xaf72('0x39')]>0x0){_0x47c225=_0x76c04[_0xaf72('0x21')];}console[_0xaf72('0xab')](_0xaf72('0xac'),_0x47c225);_0x48a9fe=[];_0x403627=Object[_0xaf72('0xad')]([],_0x47c225);_[_0xaf72('0xae')](_0x403627,function(_0x49f5d1){return!_0x52aa96[_0xaf72('0xaf')](_0x49f5d1['name']);});_0x403627[_0xaf72('0xb0')](function(_0x3b60eb){var _0x22b31e=createFieldObject(_0x2db6bb,_0x3880d5,_0x3b60eb['internalType'],_0x3b60eb[_0xaf72('0x30')],_0x3b60eb[_0xaf72('0xb1')],![]);_0x48a9fe[_0xaf72('0xb2')](_0x22b31e);});return Promise[_0xaf72('0xb3')](_0x48a9fe);})['then'](function(_0x5bdaf3){_0x3e881b=_0x5bdaf3;_0x4bda7c=Object[_0xaf72('0xad')]([],_0x47c225);console[_0xaf72('0xab')](_0xaf72('0xb4'),_0x47c225);_['remove'](_0x4bda7c,function(_0xfb0a7e){return _0x4a04b5['includes'](_0xfb0a7e[_0xaf72('0x30')]);});console[_0xaf72('0xab')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x4bda7c);_0x48a9fe=[];_0x4bda7c[_0xaf72('0xb0')](function(_0x15c495){var _0x239a64=createFieldObject(_0x2db6bb,_0x3880d5,_0x15c495[_0xaf72('0xb5')],_0x15c495[_0xaf72('0x30')],_0x15c495[_0xaf72('0xb1')],!![]);_0x48a9fe[_0xaf72('0xb2')](_0x239a64);});return Promise[_0xaf72('0xb3')](_0x48a9fe);})[_0xaf72('0x17')](function(_0x39a11c){_0x561397=_0x39a11c;var _0x551afc=_0x3e881b[_0xaf72('0xb6')](_0x561397);return{'count':_0x551afc[_0xaf72('0x39')],'rows':_0x551afc};})['then'](respondWithResult(_0x38e577,null))[_0xaf72('0x22')](function(_0x1aa48b){console[_0xaf72('0xab')](_0xaf72('0xb7')+_0x1aa48b);var _0x2447ee=_0x2ee66f['query']['test']?0x1f4:_0x1aa48b[_0xaf72('0xb8')]||0x1f4;logger[_0xaf72('0x1d')](_0x1aa48b[_0xaf72('0xb9')]);delete _0x1aa48b[_0xaf72('0x30')];if(_0x2447ee===0x191){_0x2447ee=0x190;}_0x38e577[_0xaf72('0x24')](_0x2447ee)[_0xaf72('0xba')](_0x2ee66f['query'][_0xaf72('0xbb')]?{'message':'Wrong\x20credentials','statusCode':_0x1aa48b['statusCode']}:_0x1aa48b);});};function createFieldObject(_0x4f6db6,_0x2ebb2f,_0x3e44a5,_0x27bccd,_0x28d900,_0x3d3377){return new Promise(function(_0x59cddf,_0x288231){var _0x2a09fb={'id':_0x27bccd,'name':_0x28d900,'custom':_0x3d3377};if(_0x3e44a5==='boolean'){_0x2a09fb[_0xaf72('0x47')]=[{'name':_0xaf72('0xbc'),'value':'true'},{'name':_0xaf72('0xbd'),'value':'false'}];_0x59cddf(_0x2a09fb);}else{var _0x19ccbc={'method':'GET','uri':_0x4f6db6+_0xaf72('0xbe')+_0x27bccd,'auth':_0x2ebb2f,'json':!![]};return rp(_0x19ccbc)['then'](function(_0x5b2570){var _0x96a3a6=[];if(_0x5b2570[_0xaf72('0x21')][_0xaf72('0x39')]>0x0){_0x5b2570[_0xaf72('0x21')][_0xaf72('0xb0')](function(_0x15117c){if(_0x15117c['inactive']===_0xaf72('0xbf')){var _0x2e880f={'name':_0x15117c[_0xaf72('0xb1')],'value':_0x15117c[_0xaf72('0xc0')]};_0x96a3a6[_0xaf72('0xb2')](_0x2e880f);}});}_0x2a09fb[_0xaf72('0x47')]=_0x96a3a6;if(_0x2a09fb[_0xaf72('0x47')]['length']>0x0){_0x59cddf(_0x2a09fb);}else{if(_0x3d3377==![]){_0x59cddf();}else{_0x59cddf(_0x2a09fb);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 09665bc..cc023a2 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(_0xe039c,_0x10192a){var _0x450db7=function(_0x44e4ca){while(--_0x44e4ca){_0xe039c['push'](_0xe039c['shift']());}};_0x450db7(++_0x10192a);}(_0x814b,0x1a2));var _0xb814=function(_0x2bd88d,_0x2d5dc3){_0x2bd88d=_0x2bd88d-0x0;var _0x5516d4=_0x814b[_0x2bd88d];return _0x5516d4;};'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(_0x18f645,_0x2513d4){var _0x494d39=function(_0x49b37f){while(--_0x49b37f){_0x18f645['push'](_0x18f645['shift']());}};_0x494d39(++_0x2513d4);}(_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 39a6091..46d8023 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 _0xc1b1=['GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','limit','include','map','model','ShowServicenowAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch'];(function(_0x2ac81e,_0xb0f910){var _0x50ede5=function(_0x17da72){while(--_0x17da72){_0x2ac81e['push'](_0x2ac81e['shift']());}};_0x50ede5(++_0xb0f910);}(_0xc1b1,0xc0));var _0x1c1b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc1b1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1c1b('0x0'));var util=require(_0x1c1b('0x1'));var moment=require(_0x1c1b('0x2'));var BPromise=require(_0x1c1b('0x3'));var rs=require(_0x1c1b('0x4'));var fs=require('fs');var Redis=require(_0x1c1b('0x5'));var db=require(_0x1c1b('0x6'))['db'];var utils=require(_0x1c1b('0x7'));var logger=require('../../config/logger')(_0x1c1b('0x8'));var config=require(_0x1c1b('0x9'));var jayson=require(_0x1c1b('0xa'));var client=jayson[_0x1c1b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ed836,_0x2dbf98,_0x1ed6e7){return new BPromise(function(_0x3901bf,_0x4b4d95){return client[_0x1c1b('0xc')](_0x3ed836,_0x1ed6e7)[_0x1c1b('0xd')](function(_0x5efeab){logger[_0x1c1b('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x2dbf98,_0x1c1b('0xf'));logger[_0x1c1b('0x10')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x2dbf98,_0x1c1b('0xf'),JSON[_0x1c1b('0x11')](_0x5efeab));if(_0x5efeab[_0x1c1b('0x12')]){if(_0x5efeab[_0x1c1b('0x12')][_0x1c1b('0x13')]===0x1f4){logger[_0x1c1b('0x12')](_0x1c1b('0x14'),_0x2dbf98,_0x5efeab[_0x1c1b('0x12')][_0x1c1b('0x15')]);return _0x4b4d95(_0x5efeab[_0x1c1b('0x12')][_0x1c1b('0x15')]);}logger[_0x1c1b('0x12')](_0x1c1b('0x14'),_0x2dbf98,_0x5efeab['error'][_0x1c1b('0x15')]);return _0x3901bf(_0x5efeab['error'][_0x1c1b('0x15')]);}else{logger[_0x1c1b('0xe')](_0x1c1b('0x14'),_0x2dbf98,_0x1c1b('0xf'));_0x3901bf(_0x5efeab[_0x1c1b('0x16')][_0x1c1b('0x15')]);}})[_0x1c1b('0x17')](function(_0x2c6c55){logger['error'](_0x1c1b('0x14'),_0x2dbf98,_0x2c6c55);_0x4b4d95(_0x2c6c55);});});}exports[_0x1c1b('0x18')]=function(_0xa9a006){var _0x14bd53=this;return new Promise(function(_0x30eaee,_0x536e82){return db[_0x1c1b('0x19')]['findAll']({'raw':_0xa9a006[_0x1c1b('0x1a')]?_0xa9a006['options'][_0x1c1b('0x1b')]===undefined?!![]:![]:!![],'where':_0xa9a006['options']?_0xa9a006[_0x1c1b('0x1a')][_0x1c1b('0x1c')]||null:null,'attributes':_0xa9a006['options']?_0xa9a006[_0x1c1b('0x1a')][_0x1c1b('0x1d')]||null:null,'limit':_0xa9a006[_0x1c1b('0x1a')]?_0xa9a006[_0x1c1b('0x1a')][_0x1c1b('0x1e')]||null:null,'include':_0xa9a006[_0x1c1b('0x1a')]?_0xa9a006[_0x1c1b('0x1a')][_0x1c1b('0x1f')]?_['map'](_0xa9a006['options'][_0x1c1b('0x1f')],function(_0x10255e){return{'model':db[_0x10255e['model']],'as':_0x10255e['as'],'attributes':_0x10255e[_0x1c1b('0x1d')],'include':_0x10255e['include']?_[_0x1c1b('0x20')](_0x10255e[_0x1c1b('0x1f')],function(_0x4b9231){return{'model':db[_0x4b9231[_0x1c1b('0x21')]],'as':_0x4b9231['as'],'attributes':_0x4b9231[_0x1c1b('0x1d')],'include':_0x4b9231[_0x1c1b('0x1f')]?_[_0x1c1b('0x20')](_0x4b9231[_0x1c1b('0x1f')],function(_0x58834c){return{'model':db[_0x58834c['model']],'as':_0x58834c['as'],'attributes':_0x58834c['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c1b('0xd')](function(_0x5b47f8){logger['info']('GetServicenowAccount',_0xa9a006);logger[_0x1c1b('0x10')](_0x1c1b('0x18'),_0xa9a006,JSON[_0x1c1b('0x11')](_0x5b47f8));_0x30eaee(_0x5b47f8);})['catch'](function(_0x3f6a8b){logger[_0x1c1b('0x12')]('GetServicenowAccount',_0x3f6a8b[_0x1c1b('0x15')],_0xa9a006);_0x536e82(_0x14bd53[_0x1c1b('0x12')](0x1f4,_0x3f6a8b['message']));});});};exports[_0x1c1b('0x22')]=function(_0x53f50a){var _0x127048=this;return new Promise(function(_0x2e95f0,_0x1dd16b){return db[_0x1c1b('0x19')][_0x1c1b('0x23')]({'raw':_0x53f50a[_0x1c1b('0x1a')]?_0x53f50a['options'][_0x1c1b('0x1b')]===undefined?!![]:![]:!![],'where':_0x53f50a[_0x1c1b('0x1a')]?_0x53f50a[_0x1c1b('0x1a')][_0x1c1b('0x1c')]||null:null,'attributes':_0x53f50a[_0x1c1b('0x1a')]?_0x53f50a[_0x1c1b('0x1a')]['attributes']||null:null,'include':_0x53f50a[_0x1c1b('0x1a')]?_0x53f50a[_0x1c1b('0x1a')][_0x1c1b('0x1f')]?_['map'](_0x53f50a['options'][_0x1c1b('0x1f')],function(_0x12959e){return{'model':db[_0x12959e[_0x1c1b('0x21')]],'as':_0x12959e['as'],'attributes':_0x12959e[_0x1c1b('0x1d')],'include':_0x12959e[_0x1c1b('0x1f')]?_[_0x1c1b('0x20')](_0x12959e[_0x1c1b('0x1f')],function(_0x2e9ed9){return{'model':db[_0x2e9ed9['model']],'as':_0x2e9ed9['as'],'attributes':_0x2e9ed9[_0x1c1b('0x1d')],'include':_0x2e9ed9[_0x1c1b('0x1f')]?_[_0x1c1b('0x20')](_0x2e9ed9[_0x1c1b('0x1f')],function(_0x2c3d0c){return{'model':db[_0x2c3d0c[_0x1c1b('0x21')]],'as':_0x2c3d0c['as'],'attributes':_0x2c3d0c['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c1b('0xd')](function(_0x13687e){logger['info']('ShowServicenowAccount',_0x53f50a);logger[_0x1c1b('0x10')](_0x1c1b('0x22'),_0x53f50a,JSON['stringify'](_0x13687e));_0x2e95f0(_0x13687e);})[_0x1c1b('0x17')](function(_0x10dc63){logger[_0x1c1b('0x12')](_0x1c1b('0x22'),_0x10dc63[_0x1c1b('0x15')],_0x53f50a);_0x1dd16b(_0x127048[_0x1c1b('0x12')](0x1f4,_0x10dc63[_0x1c1b('0x15')]));});});}; \ No newline at end of file +var _0xc1ee=['request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','map','include','model','ShowServicenowAccount','find','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','ServicenowAccount,\x20%s,\x20%s'];(function(_0x1c6f6d,_0x29795b){var _0x81b3ee=function(_0x13121d){while(--_0x13121d){_0x1c6f6d['push'](_0x1c6f6d['shift']());}};_0x81b3ee(++_0x29795b);}(_0xc1ee,0x175));var _0xec1e=function(_0x5aac44,_0x7ce654){_0x5aac44=_0x5aac44-0x0;var _0x386ffc=_0xc1ee[_0x5aac44];return _0x386ffc;};'use strict';var _=require(_0xec1e('0x0'));var util=require(_0xec1e('0x1'));var moment=require(_0xec1e('0x2'));var BPromise=require('bluebird');var rs=require(_0xec1e('0x3'));var fs=require('fs');var Redis=require(_0xec1e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xec1e('0x5'));var logger=require(_0xec1e('0x6'))('rpc');var config=require(_0xec1e('0x7'));var jayson=require(_0xec1e('0x8'));var client=jayson['client'][_0xec1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15dfd7,_0x125a3c,_0x207e77){return new BPromise(function(_0x2c616e,_0xc81d80){return client['request'](_0x15dfd7,_0x207e77)[_0xec1e('0xa')](function(_0x4bfcc8){logger['info'](_0xec1e('0xb'),_0x125a3c,_0xec1e('0xc'));logger[_0xec1e('0xd')](_0xec1e('0xe'),_0x125a3c,_0xec1e('0xc'),JSON[_0xec1e('0xf')](_0x4bfcc8));if(_0x4bfcc8[_0xec1e('0x10')]){if(_0x4bfcc8[_0xec1e('0x10')][_0xec1e('0x11')]===0x1f4){logger[_0xec1e('0x10')](_0xec1e('0xb'),_0x125a3c,_0x4bfcc8['error'][_0xec1e('0x12')]);return _0xc81d80(_0x4bfcc8[_0xec1e('0x10')][_0xec1e('0x12')]);}logger['error'](_0xec1e('0xb'),_0x125a3c,_0x4bfcc8['error']['message']);return _0x2c616e(_0x4bfcc8[_0xec1e('0x10')][_0xec1e('0x12')]);}else{logger[_0xec1e('0x13')](_0xec1e('0xb'),_0x125a3c,'request\x20sent');_0x2c616e(_0x4bfcc8[_0xec1e('0x14')]['message']);}})[_0xec1e('0x15')](function(_0xf87055){logger[_0xec1e('0x10')](_0xec1e('0xb'),_0x125a3c,_0xf87055);_0xc81d80(_0xf87055);});});}exports[_0xec1e('0x16')]=function(_0x42380e){var _0x146882=this;return new Promise(function(_0x1a3323,_0x9eb2fb){return db[_0xec1e('0x17')][_0xec1e('0x18')]({'raw':_0x42380e['options']?_0x42380e[_0xec1e('0x19')][_0xec1e('0x1a')]===undefined?!![]:![]:!![],'where':_0x42380e['options']?_0x42380e['options'][_0xec1e('0x1b')]||null:null,'attributes':_0x42380e[_0xec1e('0x19')]?_0x42380e[_0xec1e('0x19')][_0xec1e('0x1c')]||null:null,'limit':_0x42380e['options']?_0x42380e[_0xec1e('0x19')][_0xec1e('0x1d')]||null:null,'include':_0x42380e[_0xec1e('0x19')]?_0x42380e[_0xec1e('0x19')]['include']?_[_0xec1e('0x1e')](_0x42380e[_0xec1e('0x19')][_0xec1e('0x1f')],function(_0x3a214c){return{'model':db[_0x3a214c[_0xec1e('0x20')]],'as':_0x3a214c['as'],'attributes':_0x3a214c['attributes'],'include':_0x3a214c[_0xec1e('0x1f')]?_[_0xec1e('0x1e')](_0x3a214c['include'],function(_0x2e128c){return{'model':db[_0x2e128c[_0xec1e('0x20')]],'as':_0x2e128c['as'],'attributes':_0x2e128c['attributes'],'include':_0x2e128c['include']?_[_0xec1e('0x1e')](_0x2e128c[_0xec1e('0x1f')],function(_0x5f3cc7){return{'model':db[_0x5f3cc7[_0xec1e('0x20')]],'as':_0x5f3cc7['as'],'attributes':_0x5f3cc7[_0xec1e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xec1e('0xa')](function(_0x43d136){logger['info'](_0xec1e('0x16'),_0x42380e);logger['debug'](_0xec1e('0x16'),_0x42380e,JSON[_0xec1e('0xf')](_0x43d136));_0x1a3323(_0x43d136);})[_0xec1e('0x15')](function(_0x21ce24){logger[_0xec1e('0x10')]('GetServicenowAccount',_0x21ce24[_0xec1e('0x12')],_0x42380e);_0x9eb2fb(_0x146882[_0xec1e('0x10')](0x1f4,_0x21ce24[_0xec1e('0x12')]));});});};exports[_0xec1e('0x21')]=function(_0x17e420){var _0xf3c25d=this;return new Promise(function(_0x580f90,_0x5356d2){return db[_0xec1e('0x17')][_0xec1e('0x22')]({'raw':_0x17e420['options']?_0x17e420[_0xec1e('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x17e420['options']?_0x17e420[_0xec1e('0x19')][_0xec1e('0x1b')]||null:null,'attributes':_0x17e420[_0xec1e('0x19')]?_0x17e420[_0xec1e('0x19')][_0xec1e('0x1c')]||null:null,'include':_0x17e420['options']?_0x17e420[_0xec1e('0x19')][_0xec1e('0x1f')]?_[_0xec1e('0x1e')](_0x17e420[_0xec1e('0x19')][_0xec1e('0x1f')],function(_0x463e13){return{'model':db[_0x463e13[_0xec1e('0x20')]],'as':_0x463e13['as'],'attributes':_0x463e13[_0xec1e('0x1c')],'include':_0x463e13[_0xec1e('0x1f')]?_['map'](_0x463e13[_0xec1e('0x1f')],function(_0x48dd1f){return{'model':db[_0x48dd1f[_0xec1e('0x20')]],'as':_0x48dd1f['as'],'attributes':_0x48dd1f[_0xec1e('0x1c')],'include':_0x48dd1f[_0xec1e('0x1f')]?_['map'](_0x48dd1f[_0xec1e('0x1f')],function(_0x2ffe98){return{'model':db[_0x2ffe98[_0xec1e('0x20')]],'as':_0x2ffe98['as'],'attributes':_0x2ffe98[_0xec1e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xec1e('0xa')](function(_0x14a299){logger[_0xec1e('0x13')](_0xec1e('0x21'),_0x17e420);logger['debug'](_0xec1e('0x21'),_0x17e420,JSON[_0xec1e('0xf')](_0x14a299));_0x580f90(_0x14a299);})[_0xec1e('0x15')](function(_0x1ceb3c){logger[_0xec1e('0x10')](_0xec1e('0x21'),_0x1ceb3c['message'],_0x17e420);_0x5356d2(_0xf3c25d['error'](0x1f4,_0x1ceb3c[_0xec1e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index adac890..1d42822 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 _0xa94a=['create','put','update','destroy','exports','util','path','Router','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x3b2a34,_0x55027c){var _0x3304cd=function(_0x22b55e){while(--_0x22b55e){_0x3b2a34['push'](_0x3b2a34['shift']());}};_0x3304cd(++_0x55027c);}(_0xa94a,0x181));var _0xaa94=function(_0x385423,_0x4a4881){_0x385423=_0x385423-0x0;var _0x4921f7=_0xa94a[_0x385423];return _0x4921f7;};'use strict';var multer=require('multer');var util=require(_0xaa94('0x0'));var path=require(_0xaa94('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaa94('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xaa94('0x3'));var config=require(_0xaa94('0x4'));var controller=require(_0xaa94('0x5'));router['get']('/',auth[_0xaa94('0x6')](),controller['index']);router['get']('/:id',auth[_0xaa94('0x6')](),controller['show']);router[_0xaa94('0x7')](_0xaa94('0x8'),auth[_0xaa94('0x6')](),controller[_0xaa94('0x9')]);router['get'](_0xaa94('0xa'),auth[_0xaa94('0x6')](),controller[_0xaa94('0xb')]);router[_0xaa94('0x7')](_0xaa94('0xc'),auth[_0xaa94('0x6')](),controller[_0xaa94('0xd')]);router[_0xaa94('0xe')]('/',auth[_0xaa94('0x6')](),controller[_0xaa94('0xf')]);router[_0xaa94('0x10')]('/:id',auth[_0xaa94('0x6')](),controller[_0xaa94('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xaa94('0x12')]);module[_0xaa94('0x13')]=router; \ No newline at end of file +var _0xfe40=['express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x16989c,_0x358e47){var _0x3ae85b=function(_0x50e01b){while(--_0x50e01b){_0x16989c['push'](_0x16989c['shift']());}};_0x3ae85b(++_0x358e47);}(_0xfe40,0x146));var _0x0fe4=function(_0x143427,_0x5da548){_0x143427=_0x143427-0x0;var _0x3fc835=_0xfe40[_0x143427];return _0x3fc835;};'use strict';var multer=require(_0x0fe4('0x0'));var util=require(_0x0fe4('0x1'));var path=require(_0x0fe4('0x2'));var timeout=require(_0x0fe4('0x3'));var express=require(_0x0fe4('0x4'));var router=express[_0x0fe4('0x5')]();var auth=require(_0x0fe4('0x6'));var interaction=require(_0x0fe4('0x7'));var config=require('../../config/environment');var controller=require(_0x0fe4('0x8'));router[_0x0fe4('0x9')]('/',auth[_0x0fe4('0xa')](),controller[_0x0fe4('0xb')]);router['get'](_0x0fe4('0xc'),auth[_0x0fe4('0xa')](),controller['show']);router[_0x0fe4('0x9')](_0x0fe4('0xd'),auth[_0x0fe4('0xa')](),controller[_0x0fe4('0xe')]);router[_0x0fe4('0x9')]('/:id/subjects',auth[_0x0fe4('0xa')](),controller[_0x0fe4('0xf')]);router[_0x0fe4('0x9')](_0x0fe4('0x10'),auth[_0x0fe4('0xa')](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller[_0x0fe4('0x11')]);router[_0x0fe4('0x12')](_0x0fe4('0xc'),auth[_0x0fe4('0xa')](),controller['update']);router[_0x0fe4('0x13')](_0x0fe4('0xc'),auth['isAuthenticated'](),controller[_0x0fe4('0x14')]);module[_0x0fe4('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 ba35285..6e58f7c 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 _0x9e96=['sequelize'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x9e96,0x1c1));var _0x69e9=function(_0x358389,_0x4be384){_0x358389=_0x358389-0x0;var _0x57dc34=_0x9e96[_0x358389];return _0x57dc34;};'use strict';var Sequelize=require(_0x69e9('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc5e1=['exports','STRING'];(function(_0xe18eeb,_0x5f4420){var _0x1be645=function(_0x51378e){while(--_0x51378e){_0xe18eeb['push'](_0xe18eeb['shift']());}};_0x1be645(++_0x5f4420);}(_0xc5e1,0xaa));var _0x1c5e=function(_0xb1f9fb,_0x1952e2){_0xb1f9fb=_0xb1f9fb-0x0;var _0x551c41=_0xc5e1[_0xb1f9fb];return _0x551c41;};'use strict';var Sequelize=require('sequelize');module[_0x1c5e('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1c5e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 87f18f8..99be077 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 _0x5fc3=['path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','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','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','status','count','offset','limit','set','Content-Range','apply','reject','save','update','end','stack','name','index','ServicenowConfiguration','rawAttributes','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','key','VIRTUAL','field','filter','include','findAll','keys','includeAll','find','create','body','params','findOne','map','options','getFields','getSubjects','getDescriptions','ServicenowField','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x1c4866,_0x255b66){var _0x4239e6=function(_0xb477fe){while(--_0xb477fe){_0x1c4866['push'](_0x1c4866['shift']());}};_0x4239e6(++_0x255b66);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5a19fc,_0x58f9f4){_0x5a19fc=_0x5a19fc-0x0;var _0x34b413=_0x5fc3[_0x5a19fc];return _0x34b413;};'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'];var jayson=require(_0x35fc('0x17'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x409357,_0x5d462a,_0x397738){if(_0x397738){var _0x22055e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x22055e[_0x35fc('0x18')](_0x5d462a)){return _0x409357;}else{throw new Error(_0x35fc('0x19'));}}else{return _0x409357;}}function respondWithRpcPromise(_0x38d9f2,_0x5cfe94,_0x59507a,_0x5eac0f){return new BPromise(function(_0x558364,_0x398b67){var _0x229d56=_0x5eac0f||client;return _0x229d56[_0x35fc('0x1a')](_0x38d9f2,_0x59507a)[_0x35fc('0x1b')](function(_0x227a49){logger[_0x35fc('0x1c')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5cfe94,_0x35fc('0x1d'));logger[_0x35fc('0x1e')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x5cfe94,_0x35fc('0x1d'),JSON[_0x35fc('0x1f')](_0x227a49));if(_0x227a49[_0x35fc('0x20')]){if(_0x227a49['error'][_0x35fc('0x21')]===0x1f4){logger[_0x35fc('0x20')](_0x35fc('0x22'),_0x5cfe94,_0x227a49['error'][_0x35fc('0x23')]);return _0x398b67(_0x227a49[_0x35fc('0x20')][_0x35fc('0x23')]);}logger[_0x35fc('0x20')](_0x35fc('0x22'),_0x5cfe94,_0x227a49[_0x35fc('0x20')][_0x35fc('0x23')]);return _0x558364(_0x227a49[_0x35fc('0x20')][_0x35fc('0x23')]);}else{logger[_0x35fc('0x1c')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5cfe94,_0x35fc('0x1d'));_0x558364(_0x227a49[_0x35fc('0x24')][_0x35fc('0x23')]);}})[_0x35fc('0x25')](function(_0x3b4743){logger['error'](_0x35fc('0x22'),_0x5cfe94,_0x3b4743);_0x398b67(_0x3b4743);});});}function respondWithStatusCode(_0x4c587a,_0x561bf8){_0x561bf8=_0x561bf8||0xcc;return function(_0x265324){if(_0x265324){return _0x4c587a[_0x35fc('0x26')](_0x561bf8);}return _0x4c587a[_0x35fc('0x27')](_0x561bf8)['end']();};}function respondWithResult(_0x4086e9,_0x598d7a){_0x598d7a=_0x598d7a||0xc8;return function(_0x1bf180){if(_0x1bf180){return _0x4086e9[_0x35fc('0x27')](_0x598d7a)['json'](_0x1bf180);}};}function respondWithFilteredResult(_0x519264,_0x47774c){return function(_0x58edb6){if(_0x58edb6){var _0x274208=_0x58edb6[_0x35fc('0x28')],_0x1a5d92=_0x47774c[_0x35fc('0x29')],_0x57001c=_0x47774c[_0x35fc('0x29')]+_0x47774c[_0x35fc('0x2a')],_0x26b7cb;if(_0x57001c>=_0x274208){_0x57001c=_0x274208;_0x26b7cb=0xc8;}else{_0x26b7cb=0xce;}_0x519264[_0x35fc('0x27')](_0x26b7cb);return _0x519264[_0x35fc('0x2b')](_0x35fc('0x2c'),_0x1a5d92+'-'+_0x57001c+'/'+_0x274208)['json'](_0x58edb6);}return null;};}function patchUpdates(_0x1cd1ae){return function(_0x220931){try{jsonpatch[_0x35fc('0x2d')](_0x220931,_0x1cd1ae,!![]);}catch(_0x52acc5){return BPromise[_0x35fc('0x2e')](_0x52acc5);}return _0x220931[_0x35fc('0x2f')]();};}function saveUpdates(_0x3822a8,_0xe6e4ba){return function(_0xd8a4ca){if(_0xd8a4ca){return _0xd8a4ca[_0x35fc('0x30')](_0x3822a8)[_0x35fc('0x1b')](function(_0x37b435){return _0x37b435;});}return null;};}function removeEntity(_0xf4dfab,_0x127bfc){return function(_0x57072d){if(_0x57072d){return _0x57072d['destroy']()[_0x35fc('0x1b')](function(){_0xf4dfab['status'](0xcc)[_0x35fc('0x31')]();});}};}function handleEntityNotFound(_0x39454e,_0x1c4b8b){return function(_0x227471){if(!_0x227471){_0x39454e[_0x35fc('0x26')](0x194);}return _0x227471;};}function handleError(_0x12e78f,_0x4e43b4){_0x4e43b4=_0x4e43b4||0x1f4;return function(_0x3fe193){logger[_0x35fc('0x20')](_0x3fe193[_0x35fc('0x32')]);if(_0x3fe193[_0x35fc('0x33')]){delete _0x3fe193[_0x35fc('0x33')];}_0x12e78f[_0x35fc('0x27')](_0x4e43b4)['send'](_0x3fe193);};}exports[_0x35fc('0x34')]=function(_0x38193d,_0x1fecdf){var _0x52f53d={},_0x2c657d={},_0x48d223={'count':0x0,'rows':[]};var _0x2ecb2e=db[_0x35fc('0x35')][_0x35fc('0x36')];_0x2c657d[_0x35fc('0x37')]=_['keys'](_0x2ecb2e);_0x2c657d['query']=_['keys'](_0x38193d[_0x35fc('0x38')]);_0x2c657d['filters']=_[_0x35fc('0x39')](_0x2c657d['model'],_0x2c657d[_0x35fc('0x38')]);_0x52f53d[_0x35fc('0x3a')]=_[_0x35fc('0x39')](_0x2c657d[_0x35fc('0x37')],qs[_0x35fc('0x3b')](_0x38193d[_0x35fc('0x38')][_0x35fc('0x3b')]));_0x52f53d['attributes']=_0x52f53d[_0x35fc('0x3a')][_0x35fc('0x3c')]?_0x52f53d['attributes']:_0x2c657d[_0x35fc('0x37')];if(!_0x38193d[_0x35fc('0x38')][_0x35fc('0x3d')](_0x35fc('0x3e'))){_0x52f53d[_0x35fc('0x2a')]=qs[_0x35fc('0x2a')](_0x38193d['query'][_0x35fc('0x2a')]);_0x52f53d[_0x35fc('0x29')]=qs[_0x35fc('0x29')](_0x38193d['query'][_0x35fc('0x29')]);}_0x52f53d[_0x35fc('0x3f')]=qs['sort'](_0x38193d[_0x35fc('0x38')][_0x35fc('0x40')]);_0x52f53d[_0x35fc('0x41')]=qs[_0x35fc('0x42')](_[_0x35fc('0x43')](_0x38193d[_0x35fc('0x38')],_0x2c657d[_0x35fc('0x42')]));if(_0x38193d[_0x35fc('0x38')]['filter']){_0x52f53d['where']=_[_0x35fc('0x44')](_0x52f53d[_0x35fc('0x41')],{'$or':_['map'](_0x2ecb2e,function(_0x5c2e5c){if(_0x5c2e5c['type'][_0x35fc('0x45')]!==_0x35fc('0x46')){var _0x4e56ed={};_0x4e56ed[_0x5c2e5c[_0x35fc('0x47')]]={'$like':'%'+_0x38193d[_0x35fc('0x38')][_0x35fc('0x48')]+'%'};return _0x4e56ed;}})});}_0x52f53d=_[_0x35fc('0x44')]({},_0x52f53d,_0x38193d['options']);var _0x57105c={'where':_0x52f53d['where']};return db['ServicenowConfiguration']['count'](_0x57105c)[_0x35fc('0x1b')](function(_0x27eabf){_0x48d223['count']=_0x27eabf;if(_0x38193d[_0x35fc('0x38')]['includeAll']){_0x52f53d[_0x35fc('0x49')]=[{'all':!![]}];}return db[_0x35fc('0x35')][_0x35fc('0x4a')](_0x52f53d);})[_0x35fc('0x1b')](function(_0x16f7c8){_0x48d223['rows']=_0x16f7c8;return _0x48d223;})[_0x35fc('0x1b')](respondWithFilteredResult(_0x1fecdf,_0x52f53d))[_0x35fc('0x25')](handleError(_0x1fecdf,null));};exports['show']=function(_0x18181b,_0x298b7b){var _0x2a8a09={'raw':![],'where':{'id':_0x18181b['params']['id']}},_0x211746={};_0x211746[_0x35fc('0x37')]=_['keys'](db['ServicenowConfiguration'][_0x35fc('0x36')]);_0x211746[_0x35fc('0x38')]=_[_0x35fc('0x4b')](_0x18181b[_0x35fc('0x38')]);_0x211746[_0x35fc('0x42')]=_[_0x35fc('0x39')](_0x211746[_0x35fc('0x37')],_0x211746[_0x35fc('0x38')]);_0x2a8a09['attributes']=_[_0x35fc('0x39')](_0x211746[_0x35fc('0x37')],qs[_0x35fc('0x3b')](_0x18181b[_0x35fc('0x38')][_0x35fc('0x3b')]));_0x2a8a09[_0x35fc('0x3a')]=_0x2a8a09[_0x35fc('0x3a')][_0x35fc('0x3c')]?_0x2a8a09[_0x35fc('0x3a')]:_0x211746[_0x35fc('0x37')];if(_0x18181b[_0x35fc('0x38')][_0x35fc('0x4c')]){_0x2a8a09[_0x35fc('0x49')]=[{'all':!![]}];}_0x2a8a09=_[_0x35fc('0x44')]({},_0x2a8a09,_0x18181b['options']);return db['ServicenowConfiguration'][_0x35fc('0x4d')](_0x2a8a09)[_0x35fc('0x1b')](handleEntityNotFound(_0x298b7b,null))[_0x35fc('0x1b')](respondWithResult(_0x298b7b,null))[_0x35fc('0x25')](handleError(_0x298b7b,null));};exports[_0x35fc('0x4e')]=function(_0x3e6494,_0x4a4798){return db['ServicenowConfiguration'][_0x35fc('0x4e')](_0x3e6494[_0x35fc('0x4f')],{})[_0x35fc('0x1b')](respondWithResult(_0x4a4798,0xc9))[_0x35fc('0x25')](handleError(_0x4a4798,null));};exports['update']=function(_0x467980,_0x13281f){if(_0x467980['body']['id']){delete _0x467980[_0x35fc('0x4f')]['id'];}return db[_0x35fc('0x35')]['find']({'where':{'id':_0x467980[_0x35fc('0x50')]['id']}})[_0x35fc('0x1b')](handleEntityNotFound(_0x13281f,null))[_0x35fc('0x1b')](saveUpdates(_0x467980[_0x35fc('0x4f')],null))['then'](respondWithResult(_0x13281f,null))['catch'](handleError(_0x13281f,null));};exports['destroy']=function(_0x240338,_0x2ea8d6){return db['ServicenowConfiguration'][_0x35fc('0x4d')]({'where':{'id':_0x240338[_0x35fc('0x50')]['id']}})[_0x35fc('0x1b')](handleEntityNotFound(_0x2ea8d6,null))[_0x35fc('0x1b')](removeEntity(_0x2ea8d6,null))[_0x35fc('0x25')](handleError(_0x2ea8d6,null));};exports['getFields']=function(_0x2d9d45,_0x757aa6,_0x39d470){var _0x509e77={};var _0x304dba={};var _0x1dbf5a;var _0x47fb1a;return db[_0x35fc('0x35')][_0x35fc('0x51')]({'where':{'id':_0x2d9d45[_0x35fc('0x50')]['id']}})[_0x35fc('0x1b')](handleEntityNotFound(_0x757aa6,null))[_0x35fc('0x1b')](function(_0x41453b){if(_0x41453b){_0x1dbf5a=_0x41453b;_0x304dba[_0x35fc('0x37')]=_[_0x35fc('0x4b')](db['ServicenowField'][_0x35fc('0x36')]);_0x304dba[_0x35fc('0x38')]=_[_0x35fc('0x4b')](_0x2d9d45['query']);_0x304dba[_0x35fc('0x42')]=_['intersection'](_0x304dba['model'],_0x304dba['query']);_0x509e77[_0x35fc('0x3a')]=_[_0x35fc('0x39')](_0x304dba[_0x35fc('0x37')],qs[_0x35fc('0x3b')](_0x2d9d45[_0x35fc('0x38')]['fields']));_0x509e77['attributes']=_0x509e77['attributes']['length']?_0x509e77['attributes']:_0x304dba[_0x35fc('0x37')];_0x509e77[_0x35fc('0x3f')]=qs[_0x35fc('0x40')](_0x2d9d45[_0x35fc('0x38')]['sort']);_0x509e77[_0x35fc('0x41')]=qs[_0x35fc('0x42')](_[_0x35fc('0x43')](_0x2d9d45[_0x35fc('0x38')],_0x304dba[_0x35fc('0x42')]));if(_0x2d9d45[_0x35fc('0x38')][_0x35fc('0x48')]){_0x509e77[_0x35fc('0x41')]=_[_0x35fc('0x44')](_0x509e77['where'],{'$or':_[_0x35fc('0x52')](_0x509e77['attributes'],function(_0xfbd737){var _0x9029e3={};_0x9029e3[_0xfbd737]={'$like':'%'+_0x2d9d45[_0x35fc('0x38')][_0x35fc('0x48')]+'%'};return _0x9029e3;})});}_0x509e77=_['merge']({},_0x509e77,_0x2d9d45[_0x35fc('0x53')]);return _0x1dbf5a['getFields'](_0x509e77);}})['then'](function(_0x5f1d4a){if(_0x5f1d4a){_0x47fb1a=_0x5f1d4a[_0x35fc('0x3c')];if(!_0x2d9d45['query'][_0x35fc('0x3d')]('nolimit')){_0x509e77[_0x35fc('0x2a')]=qs['limit'](_0x2d9d45[_0x35fc('0x38')][_0x35fc('0x2a')]);_0x509e77[_0x35fc('0x29')]=qs[_0x35fc('0x29')](_0x2d9d45['query'][_0x35fc('0x29')]);}return _0x1dbf5a[_0x35fc('0x54')](_0x509e77);}})[_0x35fc('0x1b')](function(_0x5df92d){if(_0x5df92d){return _0x5df92d?{'count':_0x47fb1a,'rows':_0x5df92d}:null;}})[_0x35fc('0x1b')](respondWithResult(_0x757aa6,null))[_0x35fc('0x25')](handleError(_0x757aa6,null));};exports[_0x35fc('0x55')]=function(_0x3c1b56,_0x1e4e15,_0x2c4309){var _0x2ee98b={};var _0x4464d5={};var _0x5159a0;var _0x28a44b;return db[_0x35fc('0x35')][_0x35fc('0x51')]({'where':{'id':_0x3c1b56['params']['id']}})[_0x35fc('0x1b')](handleEntityNotFound(_0x1e4e15,null))[_0x35fc('0x1b')](function(_0x586729){if(_0x586729){_0x5159a0=_0x586729;_0x4464d5['model']=_[_0x35fc('0x4b')](db['ServicenowField'][_0x35fc('0x36')]);_0x4464d5[_0x35fc('0x38')]=_[_0x35fc('0x4b')](_0x3c1b56[_0x35fc('0x38')]);_0x4464d5[_0x35fc('0x42')]=_[_0x35fc('0x39')](_0x4464d5[_0x35fc('0x37')],_0x4464d5[_0x35fc('0x38')]);_0x2ee98b[_0x35fc('0x3a')]=_[_0x35fc('0x39')](_0x4464d5[_0x35fc('0x37')],qs[_0x35fc('0x3b')](_0x3c1b56[_0x35fc('0x38')][_0x35fc('0x3b')]));_0x2ee98b[_0x35fc('0x3a')]=_0x2ee98b[_0x35fc('0x3a')][_0x35fc('0x3c')]?_0x2ee98b[_0x35fc('0x3a')]:_0x4464d5[_0x35fc('0x37')];_0x2ee98b[_0x35fc('0x3f')]=qs['sort'](_0x3c1b56[_0x35fc('0x38')]['sort']);_0x2ee98b[_0x35fc('0x41')]=qs[_0x35fc('0x42')](_[_0x35fc('0x43')](_0x3c1b56[_0x35fc('0x38')],_0x4464d5[_0x35fc('0x42')]));if(_0x3c1b56[_0x35fc('0x38')][_0x35fc('0x48')]){_0x2ee98b[_0x35fc('0x41')]=_[_0x35fc('0x44')](_0x2ee98b[_0x35fc('0x41')],{'$or':_[_0x35fc('0x52')](_0x2ee98b['attributes'],function(_0x446e87){var _0x4657de={};_0x4657de[_0x446e87]={'$like':'%'+_0x3c1b56[_0x35fc('0x38')][_0x35fc('0x48')]+'%'};return _0x4657de;})});}_0x2ee98b=_[_0x35fc('0x44')]({},_0x2ee98b,_0x3c1b56[_0x35fc('0x53')]);return _0x5159a0['getSubjects'](_0x2ee98b);}})[_0x35fc('0x1b')](function(_0x3353e0){if(_0x3353e0){_0x28a44b=_0x3353e0[_0x35fc('0x3c')];if(!_0x3c1b56[_0x35fc('0x38')][_0x35fc('0x3d')](_0x35fc('0x3e'))){_0x2ee98b[_0x35fc('0x2a')]=qs[_0x35fc('0x2a')](_0x3c1b56[_0x35fc('0x38')]['limit']);_0x2ee98b[_0x35fc('0x29')]=qs['offset'](_0x3c1b56[_0x35fc('0x38')][_0x35fc('0x29')]);}return _0x5159a0['getSubjects'](_0x2ee98b);}})[_0x35fc('0x1b')](function(_0x41002a){if(_0x41002a){return _0x41002a?{'count':_0x28a44b,'rows':_0x41002a}:null;}})[_0x35fc('0x1b')](respondWithResult(_0x1e4e15,null))[_0x35fc('0x25')](handleError(_0x1e4e15,null));};exports[_0x35fc('0x56')]=function(_0x1a765f,_0x42f87e,_0x452c10){var _0x25ee61={};var _0x5806bf={};var _0x4c70e2;var _0x4e7c7b;return db['ServicenowConfiguration'][_0x35fc('0x51')]({'where':{'id':_0x1a765f[_0x35fc('0x50')]['id']}})[_0x35fc('0x1b')](handleEntityNotFound(_0x42f87e,null))[_0x35fc('0x1b')](function(_0x35ef53){if(_0x35ef53){_0x4c70e2=_0x35ef53;_0x5806bf['model']=_[_0x35fc('0x4b')](db[_0x35fc('0x57')][_0x35fc('0x36')]);_0x5806bf[_0x35fc('0x38')]=_['keys'](_0x1a765f[_0x35fc('0x38')]);_0x5806bf[_0x35fc('0x42')]=_[_0x35fc('0x39')](_0x5806bf['model'],_0x5806bf[_0x35fc('0x38')]);_0x25ee61[_0x35fc('0x3a')]=_[_0x35fc('0x39')](_0x5806bf[_0x35fc('0x37')],qs[_0x35fc('0x3b')](_0x1a765f[_0x35fc('0x38')][_0x35fc('0x3b')]));_0x25ee61[_0x35fc('0x3a')]=_0x25ee61['attributes'][_0x35fc('0x3c')]?_0x25ee61[_0x35fc('0x3a')]:_0x5806bf[_0x35fc('0x37')];_0x25ee61[_0x35fc('0x3f')]=qs[_0x35fc('0x40')](_0x1a765f[_0x35fc('0x38')]['sort']);_0x25ee61[_0x35fc('0x41')]=qs['filters'](_['pick'](_0x1a765f[_0x35fc('0x38')],_0x5806bf['filters']));if(_0x1a765f[_0x35fc('0x38')][_0x35fc('0x48')]){_0x25ee61[_0x35fc('0x41')]=_['merge'](_0x25ee61[_0x35fc('0x41')],{'$or':_[_0x35fc('0x52')](_0x25ee61[_0x35fc('0x3a')],function(_0x1beb46){var _0x21f7e6={};_0x21f7e6[_0x1beb46]={'$like':'%'+_0x1a765f['query']['filter']+'%'};return _0x21f7e6;})});}_0x25ee61=_['merge']({},_0x25ee61,_0x1a765f[_0x35fc('0x53')]);return _0x4c70e2['getDescriptions'](_0x25ee61);}})[_0x35fc('0x1b')](function(_0x1824c2){if(_0x1824c2){_0x4e7c7b=_0x1824c2[_0x35fc('0x3c')];if(!_0x1a765f[_0x35fc('0x38')]['hasOwnProperty'](_0x35fc('0x3e'))){_0x25ee61[_0x35fc('0x2a')]=qs[_0x35fc('0x2a')](_0x1a765f['query'][_0x35fc('0x2a')]);_0x25ee61[_0x35fc('0x29')]=qs[_0x35fc('0x29')](_0x1a765f['query']['offset']);}return _0x4c70e2['getDescriptions'](_0x25ee61);}})[_0x35fc('0x1b')](function(_0x2edb1b){if(_0x2edb1b){return _0x2edb1b?{'count':_0x4e7c7b,'rows':_0x2edb1b}:null;}})[_0x35fc('0x1b')](respondWithResult(_0x42f87e,null))[_0x35fc('0x25')](handleError(_0x42f87e,null));}; \ No newline at end of file +var _0x1261=['util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../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~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','Content-Range','reject','save','update','name','send','ServicenowConfiguration','keys','query','intersection','attributes','model','fields','length','nolimit','limit','order','sort','filter','where','merge','type','key','options','includeAll','rows','params','include','find','create','body','destroy','getFields','findOne','ServicenowField','rawAttributes','filters','pick','map','hasOwnProperty','getSubjects','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x55f816,_0x23785d){var _0x4aa549=function(_0xcb75c){while(--_0xcb75c){_0x55f816['push'](_0x55f816['shift']());}};_0x4aa549(++_0x23785d);}(_0x1261,0x144));var _0x1126=function(_0xf973b7,_0x46699f){_0xf973b7=_0xf973b7-0x0;var _0x499087=_0x1261[_0xf973b7];return _0x499087;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1126('0x0'));var rimraf=require(_0x1126('0x1'));var zipdir=require(_0x1126('0x2'));var jsonpatch=require(_0x1126('0x3'));var rp=require(_0x1126('0x4'));var moment=require(_0x1126('0x5'));var BPromise=require(_0x1126('0x6'));var Mustache=require(_0x1126('0x7'));var util=require(_0x1126('0x8'));var path=require(_0x1126('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1126('0xa'));var fs=require('fs');var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1126('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1126('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x1126('0x16'));var client=jayson[_0x1126('0x17')][_0x1126('0x18')]({'port':0x232a});function checkPasswordPattern(_0x273896,_0xca0355,_0x3f10e9){if(_0x3f10e9){var _0xd8ca42=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xd8ca42[_0x1126('0x19')](_0xca0355)){return _0x273896;}else{throw new Error(_0x1126('0x1a'));}}else{return _0x273896;}}function respondWithRpcPromise(_0x53a8f0,_0x5de9a7,_0x1af673,_0x154e20){return new BPromise(function(_0x279455,_0x4be0c6){var _0x45149c=_0x154e20||client;return _0x45149c['request'](_0x53a8f0,_0x1af673)[_0x1126('0x1b')](function(_0x42f379){logger[_0x1126('0x1c')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5de9a7,_0x1126('0x1d'));logger[_0x1126('0x1e')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x5de9a7,'request\x20sent',JSON[_0x1126('0x1f')](_0x42f379));if(_0x42f379[_0x1126('0x20')]){if(_0x42f379['error']['code']===0x1f4){logger[_0x1126('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5de9a7,_0x42f379[_0x1126('0x20')][_0x1126('0x21')]);return _0x4be0c6(_0x42f379[_0x1126('0x20')]['message']);}logger[_0x1126('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5de9a7,_0x42f379['error'][_0x1126('0x21')]);return _0x279455(_0x42f379[_0x1126('0x20')][_0x1126('0x21')]);}else{logger[_0x1126('0x1c')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5de9a7,_0x1126('0x1d'));_0x279455(_0x42f379[_0x1126('0x22')]['message']);}})[_0x1126('0x23')](function(_0x59cd8e){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x5de9a7,_0x59cd8e);_0x4be0c6(_0x59cd8e);});});}function respondWithStatusCode(_0x2199d9,_0x15bcc3){_0x15bcc3=_0x15bcc3||0xcc;return function(_0x329914){if(_0x329914){return _0x2199d9[_0x1126('0x24')](_0x15bcc3);}return _0x2199d9[_0x1126('0x25')](_0x15bcc3)[_0x1126('0x26')]();};}function respondWithResult(_0xea0971,_0x38119d){_0x38119d=_0x38119d||0xc8;return function(_0x589725){if(_0x589725){return _0xea0971[_0x1126('0x25')](_0x38119d)[_0x1126('0x27')](_0x589725);}};}function respondWithFilteredResult(_0xa293f4,_0x5ddf63){return function(_0x541bc9){if(_0x541bc9){var _0xeb7d89=_0x541bc9[_0x1126('0x28')],_0x39bf0e=_0x5ddf63['offset'],_0x55e195=_0x5ddf63[_0x1126('0x29')]+_0x5ddf63['limit'],_0x2fb797;if(_0x55e195>=_0xeb7d89){_0x55e195=_0xeb7d89;_0x2fb797=0xc8;}else{_0x2fb797=0xce;}_0xa293f4[_0x1126('0x25')](_0x2fb797);return _0xa293f4['set'](_0x1126('0x2a'),_0x39bf0e+'-'+_0x55e195+'/'+_0xeb7d89)['json'](_0x541bc9);}return null;};}function patchUpdates(_0x378f4d){return function(_0x5f2611){try{jsonpatch['apply'](_0x5f2611,_0x378f4d,!![]);}catch(_0x4a53ab){return BPromise[_0x1126('0x2b')](_0x4a53ab);}return _0x5f2611[_0x1126('0x2c')]();};}function saveUpdates(_0x1cef48,_0x5b8bea){return function(_0x2a3055){if(_0x2a3055){return _0x2a3055[_0x1126('0x2d')](_0x1cef48)['then'](function(_0x3dd50e){return _0x3dd50e;});}return null;};}function removeEntity(_0x1e80aa,_0x2d8127){return function(_0x29fbfa){if(_0x29fbfa){return _0x29fbfa['destroy']()['then'](function(){_0x1e80aa[_0x1126('0x25')](0xcc)[_0x1126('0x26')]();});}};}function handleEntityNotFound(_0x2d9bd2,_0x2c67eb){return function(_0x55244a){if(!_0x55244a){_0x2d9bd2[_0x1126('0x24')](0x194);}return _0x55244a;};}function handleError(_0x6f4312,_0x313ebe){_0x313ebe=_0x313ebe||0x1f4;return function(_0x22436c){logger[_0x1126('0x20')](_0x22436c['stack']);if(_0x22436c[_0x1126('0x2e')]){delete _0x22436c[_0x1126('0x2e')];}_0x6f4312[_0x1126('0x25')](_0x313ebe)[_0x1126('0x2f')](_0x22436c);};}exports['index']=function(_0x4ca51c,_0x22827a){var _0x31d07c={},_0x511e6b={},_0xde37cf={'count':0x0,'rows':[]};var _0xf3c21b=db[_0x1126('0x30')]['rawAttributes'];_0x511e6b['model']=_[_0x1126('0x31')](_0xf3c21b);_0x511e6b[_0x1126('0x32')]=_[_0x1126('0x31')](_0x4ca51c[_0x1126('0x32')]);_0x511e6b['filters']=_[_0x1126('0x33')](_0x511e6b['model'],_0x511e6b[_0x1126('0x32')]);_0x31d07c[_0x1126('0x34')]=_[_0x1126('0x33')](_0x511e6b[_0x1126('0x35')],qs[_0x1126('0x36')](_0x4ca51c['query'][_0x1126('0x36')]));_0x31d07c[_0x1126('0x34')]=_0x31d07c[_0x1126('0x34')][_0x1126('0x37')]?_0x31d07c[_0x1126('0x34')]:_0x511e6b[_0x1126('0x35')];if(!_0x4ca51c[_0x1126('0x32')]['hasOwnProperty'](_0x1126('0x38'))){_0x31d07c[_0x1126('0x39')]=qs[_0x1126('0x39')](_0x4ca51c[_0x1126('0x32')][_0x1126('0x39')]);_0x31d07c['offset']=qs['offset'](_0x4ca51c[_0x1126('0x32')][_0x1126('0x29')]);}_0x31d07c[_0x1126('0x3a')]=qs[_0x1126('0x3b')](_0x4ca51c[_0x1126('0x32')][_0x1126('0x3b')]);_0x31d07c['where']=qs['filters'](_['pick'](_0x4ca51c[_0x1126('0x32')],_0x511e6b['filters']));if(_0x4ca51c[_0x1126('0x32')][_0x1126('0x3c')]){_0x31d07c[_0x1126('0x3d')]=_[_0x1126('0x3e')](_0x31d07c['where'],{'$or':_['map'](_0xf3c21b,function(_0x353042){if(_0x353042[_0x1126('0x3f')][_0x1126('0x40')]!=='VIRTUAL'){var _0x2f8551={};_0x2f8551[_0x353042['field']]={'$like':'%'+_0x4ca51c[_0x1126('0x32')]['filter']+'%'};return _0x2f8551;}})});}_0x31d07c=_[_0x1126('0x3e')]({},_0x31d07c,_0x4ca51c[_0x1126('0x41')]);var _0x1006fb={'where':_0x31d07c['where']};return db[_0x1126('0x30')][_0x1126('0x28')](_0x1006fb)[_0x1126('0x1b')](function(_0x48c694){_0xde37cf['count']=_0x48c694;if(_0x4ca51c['query'][_0x1126('0x42')]){_0x31d07c['include']=[{'all':!![]}];}return db[_0x1126('0x30')]['findAll'](_0x31d07c);})[_0x1126('0x1b')](function(_0x323499){_0xde37cf[_0x1126('0x43')]=_0x323499;return _0xde37cf;})[_0x1126('0x1b')](respondWithFilteredResult(_0x22827a,_0x31d07c))[_0x1126('0x23')](handleError(_0x22827a,null));};exports['show']=function(_0x198173,_0x512f60){var _0x5111d3={'raw':![],'where':{'id':_0x198173[_0x1126('0x44')]['id']}},_0x1a15f8={};_0x1a15f8['model']=_[_0x1126('0x31')](db[_0x1126('0x30')]['rawAttributes']);_0x1a15f8[_0x1126('0x32')]=_[_0x1126('0x31')](_0x198173[_0x1126('0x32')]);_0x1a15f8['filters']=_[_0x1126('0x33')](_0x1a15f8[_0x1126('0x35')],_0x1a15f8[_0x1126('0x32')]);_0x5111d3[_0x1126('0x34')]=_[_0x1126('0x33')](_0x1a15f8[_0x1126('0x35')],qs[_0x1126('0x36')](_0x198173[_0x1126('0x32')]['fields']));_0x5111d3[_0x1126('0x34')]=_0x5111d3['attributes'][_0x1126('0x37')]?_0x5111d3[_0x1126('0x34')]:_0x1a15f8['model'];if(_0x198173['query'][_0x1126('0x42')]){_0x5111d3[_0x1126('0x45')]=[{'all':!![]}];}_0x5111d3=_[_0x1126('0x3e')]({},_0x5111d3,_0x198173['options']);return db[_0x1126('0x30')][_0x1126('0x46')](_0x5111d3)[_0x1126('0x1b')](handleEntityNotFound(_0x512f60,null))[_0x1126('0x1b')](respondWithResult(_0x512f60,null))['catch'](handleError(_0x512f60,null));};exports[_0x1126('0x47')]=function(_0x46551f,_0x5c36b9){return db['ServicenowConfiguration']['create'](_0x46551f['body'],{})[_0x1126('0x1b')](respondWithResult(_0x5c36b9,0xc9))[_0x1126('0x23')](handleError(_0x5c36b9,null));};exports['update']=function(_0x16552b,_0x1c7a2b){if(_0x16552b[_0x1126('0x48')]['id']){delete _0x16552b[_0x1126('0x48')]['id'];}return db[_0x1126('0x30')]['find']({'where':{'id':_0x16552b[_0x1126('0x44')]['id']}})[_0x1126('0x1b')](handleEntityNotFound(_0x1c7a2b,null))['then'](saveUpdates(_0x16552b[_0x1126('0x48')],null))[_0x1126('0x1b')](respondWithResult(_0x1c7a2b,null))[_0x1126('0x23')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x49')]=function(_0xc8a0f,_0x59c3d0){return db[_0x1126('0x30')]['find']({'where':{'id':_0xc8a0f[_0x1126('0x44')]['id']}})[_0x1126('0x1b')](handleEntityNotFound(_0x59c3d0,null))[_0x1126('0x1b')](removeEntity(_0x59c3d0,null))['catch'](handleError(_0x59c3d0,null));};exports[_0x1126('0x4a')]=function(_0x2340f8,_0x5763b4,_0x30812d){var _0x25038f={};var _0x9bad53={};var _0x5a5340;var _0x2fe6dc;return db[_0x1126('0x30')][_0x1126('0x4b')]({'where':{'id':_0x2340f8[_0x1126('0x44')]['id']}})[_0x1126('0x1b')](handleEntityNotFound(_0x5763b4,null))[_0x1126('0x1b')](function(_0x30c848){if(_0x30c848){_0x5a5340=_0x30c848;_0x9bad53[_0x1126('0x35')]=_['keys'](db[_0x1126('0x4c')][_0x1126('0x4d')]);_0x9bad53[_0x1126('0x32')]=_[_0x1126('0x31')](_0x2340f8[_0x1126('0x32')]);_0x9bad53['filters']=_[_0x1126('0x33')](_0x9bad53[_0x1126('0x35')],_0x9bad53['query']);_0x25038f[_0x1126('0x34')]=_['intersection'](_0x9bad53[_0x1126('0x35')],qs[_0x1126('0x36')](_0x2340f8['query'][_0x1126('0x36')]));_0x25038f[_0x1126('0x34')]=_0x25038f[_0x1126('0x34')]['length']?_0x25038f[_0x1126('0x34')]:_0x9bad53['model'];_0x25038f['order']=qs[_0x1126('0x3b')](_0x2340f8[_0x1126('0x32')][_0x1126('0x3b')]);_0x25038f[_0x1126('0x3d')]=qs[_0x1126('0x4e')](_[_0x1126('0x4f')](_0x2340f8[_0x1126('0x32')],_0x9bad53['filters']));if(_0x2340f8[_0x1126('0x32')][_0x1126('0x3c')]){_0x25038f[_0x1126('0x3d')]=_[_0x1126('0x3e')](_0x25038f[_0x1126('0x3d')],{'$or':_[_0x1126('0x50')](_0x25038f['attributes'],function(_0x5b17d6){var _0x16a343={};_0x16a343[_0x5b17d6]={'$like':'%'+_0x2340f8[_0x1126('0x32')]['filter']+'%'};return _0x16a343;})});}_0x25038f=_['merge']({},_0x25038f,_0x2340f8['options']);return _0x5a5340['getFields'](_0x25038f);}})[_0x1126('0x1b')](function(_0x37b1ab){if(_0x37b1ab){_0x2fe6dc=_0x37b1ab[_0x1126('0x37')];if(!_0x2340f8['query'][_0x1126('0x51')](_0x1126('0x38'))){_0x25038f[_0x1126('0x39')]=qs[_0x1126('0x39')](_0x2340f8[_0x1126('0x32')][_0x1126('0x39')]);_0x25038f[_0x1126('0x29')]=qs['offset'](_0x2340f8[_0x1126('0x32')][_0x1126('0x29')]);}return _0x5a5340[_0x1126('0x4a')](_0x25038f);}})[_0x1126('0x1b')](function(_0x288b9b){if(_0x288b9b){return _0x288b9b?{'count':_0x2fe6dc,'rows':_0x288b9b}:null;}})['then'](respondWithResult(_0x5763b4,null))['catch'](handleError(_0x5763b4,null));};exports[_0x1126('0x52')]=function(_0x2643d7,_0x4f1b61,_0x3bf25d){var _0x1fb2f0={};var _0x366675={};var _0x6a41c0;var _0x2828d4;return db[_0x1126('0x30')][_0x1126('0x4b')]({'where':{'id':_0x2643d7[_0x1126('0x44')]['id']}})[_0x1126('0x1b')](handleEntityNotFound(_0x4f1b61,null))[_0x1126('0x1b')](function(_0x16e48a){if(_0x16e48a){_0x6a41c0=_0x16e48a;_0x366675[_0x1126('0x35')]=_[_0x1126('0x31')](db['ServicenowField'][_0x1126('0x4d')]);_0x366675[_0x1126('0x32')]=_[_0x1126('0x31')](_0x2643d7['query']);_0x366675['filters']=_[_0x1126('0x33')](_0x366675[_0x1126('0x35')],_0x366675[_0x1126('0x32')]);_0x1fb2f0[_0x1126('0x34')]=_['intersection'](_0x366675['model'],qs['fields'](_0x2643d7[_0x1126('0x32')][_0x1126('0x36')]));_0x1fb2f0[_0x1126('0x34')]=_0x1fb2f0[_0x1126('0x34')]['length']?_0x1fb2f0[_0x1126('0x34')]:_0x366675['model'];_0x1fb2f0[_0x1126('0x3a')]=qs[_0x1126('0x3b')](_0x2643d7[_0x1126('0x32')][_0x1126('0x3b')]);_0x1fb2f0[_0x1126('0x3d')]=qs[_0x1126('0x4e')](_[_0x1126('0x4f')](_0x2643d7['query'],_0x366675[_0x1126('0x4e')]));if(_0x2643d7['query'][_0x1126('0x3c')]){_0x1fb2f0[_0x1126('0x3d')]=_['merge'](_0x1fb2f0[_0x1126('0x3d')],{'$or':_[_0x1126('0x50')](_0x1fb2f0['attributes'],function(_0x29daa6){var _0x1442ab={};_0x1442ab[_0x29daa6]={'$like':'%'+_0x2643d7['query']['filter']+'%'};return _0x1442ab;})});}_0x1fb2f0=_[_0x1126('0x3e')]({},_0x1fb2f0,_0x2643d7[_0x1126('0x41')]);return _0x6a41c0[_0x1126('0x52')](_0x1fb2f0);}})['then'](function(_0x4d007b){if(_0x4d007b){_0x2828d4=_0x4d007b['length'];if(!_0x2643d7[_0x1126('0x32')]['hasOwnProperty']('nolimit')){_0x1fb2f0[_0x1126('0x39')]=qs['limit'](_0x2643d7[_0x1126('0x32')][_0x1126('0x39')]);_0x1fb2f0['offset']=qs[_0x1126('0x29')](_0x2643d7[_0x1126('0x32')][_0x1126('0x29')]);}return _0x6a41c0[_0x1126('0x52')](_0x1fb2f0);}})[_0x1126('0x1b')](function(_0x5e9872){if(_0x5e9872){return _0x5e9872?{'count':_0x2828d4,'rows':_0x5e9872}:null;}})[_0x1126('0x1b')](respondWithResult(_0x4f1b61,null))[_0x1126('0x23')](handleError(_0x4f1b61,null));};exports['getDescriptions']=function(_0xd182b1,_0x2d6fcf,_0x2c0908){var _0x2af2d0={};var _0x2598a7={};var _0x2cf3b9;var _0x59512b;return db[_0x1126('0x30')][_0x1126('0x4b')]({'where':{'id':_0xd182b1[_0x1126('0x44')]['id']}})[_0x1126('0x1b')](handleEntityNotFound(_0x2d6fcf,null))[_0x1126('0x1b')](function(_0x2010a9){if(_0x2010a9){_0x2cf3b9=_0x2010a9;_0x2598a7[_0x1126('0x35')]=_[_0x1126('0x31')](db[_0x1126('0x4c')]['rawAttributes']);_0x2598a7[_0x1126('0x32')]=_[_0x1126('0x31')](_0xd182b1[_0x1126('0x32')]);_0x2598a7[_0x1126('0x4e')]=_[_0x1126('0x33')](_0x2598a7['model'],_0x2598a7[_0x1126('0x32')]);_0x2af2d0['attributes']=_['intersection'](_0x2598a7[_0x1126('0x35')],qs[_0x1126('0x36')](_0xd182b1['query']['fields']));_0x2af2d0[_0x1126('0x34')]=_0x2af2d0[_0x1126('0x34')][_0x1126('0x37')]?_0x2af2d0[_0x1126('0x34')]:_0x2598a7[_0x1126('0x35')];_0x2af2d0[_0x1126('0x3a')]=qs[_0x1126('0x3b')](_0xd182b1[_0x1126('0x32')][_0x1126('0x3b')]);_0x2af2d0['where']=qs[_0x1126('0x4e')](_[_0x1126('0x4f')](_0xd182b1[_0x1126('0x32')],_0x2598a7[_0x1126('0x4e')]));if(_0xd182b1[_0x1126('0x32')][_0x1126('0x3c')]){_0x2af2d0['where']=_[_0x1126('0x3e')](_0x2af2d0[_0x1126('0x3d')],{'$or':_[_0x1126('0x50')](_0x2af2d0[_0x1126('0x34')],function(_0x12cdc6){var _0x1796eb={};_0x1796eb[_0x12cdc6]={'$like':'%'+_0xd182b1[_0x1126('0x32')][_0x1126('0x3c')]+'%'};return _0x1796eb;})});}_0x2af2d0=_[_0x1126('0x3e')]({},_0x2af2d0,_0xd182b1[_0x1126('0x41')]);return _0x2cf3b9['getDescriptions'](_0x2af2d0);}})['then'](function(_0x271d7c){if(_0x271d7c){_0x59512b=_0x271d7c['length'];if(!_0xd182b1[_0x1126('0x32')]['hasOwnProperty'](_0x1126('0x38'))){_0x2af2d0['limit']=qs[_0x1126('0x39')](_0xd182b1['query']['limit']);_0x2af2d0['offset']=qs[_0x1126('0x29')](_0xd182b1[_0x1126('0x32')]['offset']);}return _0x2cf3b9['getDescriptions'](_0x2af2d0);}})[_0x1126('0x1b')](function(_0xe2f82d){if(_0xe2f82d){return _0xe2f82d?{'count':_0x59512b,'rows':_0xe2f82d}:null;}})[_0x1126('0x1b')](respondWithResult(_0x2d6fcf,null))['catch'](handleError(_0x2d6fcf,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 4ecd013..e41fd93 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 _0x18b9=['rimraf','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','util','../../config/logger','api','moment','request-promise','path'];(function(_0x4d337e,_0x2f7eed){var _0x247963=function(_0x3d6564){while(--_0x3d6564){_0x4d337e['push'](_0x4d337e['shift']());}};_0x247963(++_0x2f7eed);}(_0x18b9,0x7c));var _0x918b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x18b9[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x918b('0x0'));var logger=require(_0x918b('0x1'))(_0x918b('0x2'));var moment=require(_0x918b('0x3'));var BPromise=require('bluebird');var rp=require(_0x918b('0x4'));var fs=require('fs');var path=require(_0x918b('0x5'));var rimraf=require(_0x918b('0x6'));var config=require('../../config/environment');var attributes=require(_0x918b('0x7'));module['exports']=function(_0x50e3a9,_0x52d1a2){return _0x50e3a9[_0x918b('0x8')](_0x918b('0x9'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ac5=['ServicenowConfiguration','int_servicenow_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0xfd6c26,_0x4b47b5){var _0x7cacc3=function(_0x1a47e9){while(--_0x1a47e9){_0xfd6c26['push'](_0xfd6c26['shift']());}};_0x7cacc3(++_0x4b47b5);}(_0x8ac5,0x176));var _0x58ac=function(_0x4f520f,_0x5ee221){_0x4f520f=_0x4f520f-0x0;var _0xd09b0a=_0x8ac5[_0x4f520f];return _0xd09b0a;};'use strict';var _=require('lodash');var util=require(_0x58ac('0x0'));var logger=require(_0x58ac('0x1'))(_0x58ac('0x2'));var moment=require(_0x58ac('0x3'));var BPromise=require(_0x58ac('0x4'));var rp=require(_0x58ac('0x5'));var fs=require('fs');var path=require(_0x58ac('0x6'));var rimraf=require(_0x58ac('0x7'));var config=require('../../config/environment');var attributes=require('./intServicenowConfiguration.attributes');module[_0x58ac('0x8')]=function(_0x55ba42,_0x2d1c46){return _0x55ba42[_0x58ac('0x9')](_0x58ac('0xa'),attributes,{'tableName':_0x58ac('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index e07eca8..8cebd56 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 _0x7c97=['debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x15899a,_0xad7647){var _0x37e636=function(_0x463f66){while(--_0x463f66){_0x15899a['push'](_0x15899a['shift']());}};_0x37e636(++_0xad7647);}(_0x7c97,0xa9));var _0x77c9=function(_0x18e18a,_0x388326){_0x18e18a=_0x18e18a-0x0;var _0x11839f=_0x7c97[_0x18e18a];return _0x11839f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x77c9('0x0'));var rs=require(_0x77c9('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x77c9('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x77c9('0x3'))('rpc');var config=require(_0x77c9('0x4'));var jayson=require(_0x77c9('0x5'));var client=jayson['client'][_0x77c9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x307c4b,_0x2c08af,_0xbb8e3c){return new BPromise(function(_0x462f3b,_0x57a550){return client[_0x77c9('0x7')](_0x307c4b,_0xbb8e3c)['then'](function(_0x3b21f3){logger[_0x77c9('0x8')](_0x77c9('0x9'),_0x2c08af,_0x77c9('0xa'));logger[_0x77c9('0xb')](_0x77c9('0xc'),_0x2c08af,'request\x20sent',JSON[_0x77c9('0xd')](_0x3b21f3));if(_0x3b21f3[_0x77c9('0xe')]){if(_0x3b21f3[_0x77c9('0xe')][_0x77c9('0xf')]===0x1f4){logger[_0x77c9('0xe')](_0x77c9('0x9'),_0x2c08af,_0x3b21f3[_0x77c9('0xe')][_0x77c9('0x10')]);return _0x57a550(_0x3b21f3['error'][_0x77c9('0x10')]);}logger[_0x77c9('0xe')](_0x77c9('0x9'),_0x2c08af,_0x3b21f3[_0x77c9('0xe')][_0x77c9('0x10')]);return _0x462f3b(_0x3b21f3['error'][_0x77c9('0x10')]);}else{logger['info'](_0x77c9('0x9'),_0x2c08af,_0x77c9('0xa'));_0x462f3b(_0x3b21f3[_0x77c9('0x11')]['message']);}})['catch'](function(_0x43de2b){logger[_0x77c9('0xe')](_0x77c9('0x9'),_0x2c08af,_0x43de2b);_0x57a550(_0x43de2b);});});} \ No newline at end of file +var _0x33b6=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x410037,_0x42c07a){var _0x388468=function(_0x23d60a){while(--_0x23d60a){_0x410037['push'](_0x410037['shift']());}};_0x388468(++_0x42c07a);}(_0x33b6,0x71));var _0x633b=function(_0x49fcfb,_0x504dec){_0x49fcfb=_0x49fcfb-0x0;var _0x964926=_0x33b6[_0x49fcfb];return _0x964926;};'use strict';var _=require(_0x633b('0x0'));var util=require('util');var moment=require(_0x633b('0x1'));var BPromise=require(_0x633b('0x2'));var rs=require(_0x633b('0x3'));var fs=require('fs');var Redis=require(_0x633b('0x4'));var db=require(_0x633b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x633b('0x6'))(_0x633b('0x7'));var config=require(_0x633b('0x8'));var jayson=require(_0x633b('0x9'));var client=jayson[_0x633b('0xa')][_0x633b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xfd7bab,_0x8b94c4,_0xdfab15){return new BPromise(function(_0x2c8b60,_0x319f36){return client[_0x633b('0xc')](_0xfd7bab,_0xdfab15)['then'](function(_0x998370){logger[_0x633b('0xd')](_0x633b('0xe'),_0x8b94c4,_0x633b('0xf'));logger[_0x633b('0x10')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x8b94c4,_0x633b('0xf'),JSON[_0x633b('0x11')](_0x998370));if(_0x998370['error']){if(_0x998370[_0x633b('0x12')][_0x633b('0x13')]===0x1f4){logger['error'](_0x633b('0xe'),_0x8b94c4,_0x998370[_0x633b('0x12')][_0x633b('0x14')]);return _0x319f36(_0x998370[_0x633b('0x12')][_0x633b('0x14')]);}logger[_0x633b('0x12')](_0x633b('0xe'),_0x8b94c4,_0x998370[_0x633b('0x12')]['message']);return _0x2c8b60(_0x998370[_0x633b('0x12')][_0x633b('0x14')]);}else{logger[_0x633b('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x8b94c4,'request\x20sent');_0x2c8b60(_0x998370[_0x633b('0x15')]['message']);}})[_0x633b('0x16')](function(_0x2ead33){logger[_0x633b('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x8b94c4,_0x2ead33);_0x319f36(_0x2ead33);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 9377bab..fb7be35 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 _0x2d3e=['isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x2d3e,0x188));var _0xe2d3=function(_0x258d28,_0x445dcd){_0x258d28=_0x258d28-0x0;var _0x3cc15d=_0x2d3e[_0x258d28];return _0x3cc15d;};'use strict';var multer=require(_0xe2d3('0x0'));var util=require(_0xe2d3('0x1'));var path=require(_0xe2d3('0x2'));var timeout=require(_0xe2d3('0x3'));var express=require(_0xe2d3('0x4'));var router=express[_0xe2d3('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xe2d3('0x6'));var config=require(_0xe2d3('0x7'));var controller=require('./intServicenowField.controller');router['get']('/',auth[_0xe2d3('0x8')](),controller[_0xe2d3('0x9')]);router[_0xe2d3('0xa')](_0xe2d3('0xb'),auth['isAuthenticated'](),controller[_0xe2d3('0xc')]);router[_0xe2d3('0xd')]('/',auth[_0xe2d3('0x8')](),controller[_0xe2d3('0xe')]);router[_0xe2d3('0xf')](_0xe2d3('0xb'),auth[_0xe2d3('0x8')](),controller[_0xe2d3('0x10')]);router[_0xe2d3('0x11')](_0xe2d3('0xb'),auth['isAuthenticated'](),controller[_0xe2d3('0x12')]);module[_0xe2d3('0x13')]=router; \ No newline at end of file +var _0x0afe=['express','../../components/auth/service','../../config/environment','./intServicenowField.controller','isAuthenticated','/:id','show','post','create','put','update','destroy','path','connect-timeout'];(function(_0x349bd3,_0x5ac717){var _0x27cd10=function(_0x29bd39){while(--_0x29bd39){_0x349bd3['push'](_0x349bd3['shift']());}};_0x27cd10(++_0x5ac717);}(_0x0afe,0xde));var _0xe0af=function(_0x5a03e5,_0x17a0b9){_0x5a03e5=_0x5a03e5-0x0;var _0xab718a=_0x0afe[_0x5a03e5];return _0xab718a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe0af('0x0'));var timeout=require(_0xe0af('0x1'));var express=require(_0xe0af('0x2'));var router=express['Router']();var auth=require(_0xe0af('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xe0af('0x4'));var controller=require(_0xe0af('0x5'));router['get']('/',auth[_0xe0af('0x6')](),controller['index']);router['get'](_0xe0af('0x7'),auth[_0xe0af('0x6')](),controller[_0xe0af('0x8')]);router[_0xe0af('0x9')]('/',auth[_0xe0af('0x6')](),controller[_0xe0af('0xa')]);router[_0xe0af('0xb')](_0xe0af('0x7'),auth[_0xe0af('0x6')](),controller[_0xe0af('0xc')]);router['delete']('/:id',auth[_0xe0af('0x6')](),controller[_0xe0af('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 52a6cde..aa33968 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 _0xec56=['customVariable','keyValue','STRING','ENUM','BOOLEAN','sequelize','string','variable'];(function(_0x438c41,_0x1bcc9f){var _0xdcacd9=function(_0x4ab9fe){while(--_0x4ab9fe){_0x438c41['push'](_0x438c41['shift']());}};_0xdcacd9(++_0x1bcc9f);}(_0xec56,0x1bd));var _0x6ec5=function(_0x473bed,_0xe1abfd){_0x473bed=_0x473bed-0x0;var _0xe655a8=_0xec56[_0x473bed];return _0xe655a8;};'use strict';var Sequelize=require(_0x6ec5('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x6ec5('0x1'),_0x6ec5('0x2'),_0x6ec5('0x3'),_0x6ec5('0x4')),'defaultValue':_0x6ec5('0x1')},'content':{'type':Sequelize[_0x6ec5('0x5')]},'key':{'type':Sequelize[_0x6ec5('0x5')]},'keyType':{'type':Sequelize[_0x6ec5('0x6')](_0x6ec5('0x1'),_0x6ec5('0x2'),_0x6ec5('0x3'))},'keyContent':{'type':Sequelize[_0x6ec5('0x5')]},'idField':{'type':Sequelize[_0x6ec5('0x5')]},'nameField':{'type':Sequelize[_0x6ec5('0x5')]},'customField':{'type':Sequelize[_0x6ec5('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6ec5('0x5')]}}; \ No newline at end of file +var _0xa74f=['keyValue','string','STRING','BOOLEAN','ENUM','customVariable'];(function(_0x3f8e79,_0x10bb69){var _0x69ded8=function(_0x6dfb41){while(--_0x6dfb41){_0x3f8e79['push'](_0x3f8e79['shift']());}};_0x69ded8(++_0x10bb69);}(_0xa74f,0x9a));var _0xfa74=function(_0xc0d9bc,_0x2bd6be){_0xc0d9bc=_0xc0d9bc-0x0;var _0x32ff73=_0xa74f[_0xc0d9bc];return _0x32ff73;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xfa74('0x0')]('string','variable',_0xfa74('0x1'),_0xfa74('0x2')),'defaultValue':_0xfa74('0x3')},'content':{'type':Sequelize[_0xfa74('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xfa74('0x0')]('string','variable',_0xfa74('0x1'))},'keyContent':{'type':Sequelize[_0xfa74('0x4')]},'idField':{'type':Sequelize[_0xfa74('0x4')]},'nameField':{'type':Sequelize[_0xfa74('0x4')]},'customField':{'type':Sequelize[_0xfa74('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfa74('0x4')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 002fd77..e83ebe7 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 _0x581a=['nolimit','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','filters','find','create','body','rimraf','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','set','apply','save','update','then','destroy','error','stack','name','send','index','ServicenowField','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x64386c,_0x14b1ec){var _0x120533=function(_0x491b9f){while(--_0x491b9f){_0x64386c['push'](_0x64386c['shift']());}};_0x120533(++_0x14b1ec);}(_0x581a,0x1b0));var _0xa581=function(_0x24c45d,_0x225dfa){_0x24c45d=_0x24c45d-0x0;var _0x4fae92=_0x581a[_0x24c45d];return _0x4fae92;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xa581('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa581('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xa581('0x2'));var util=require(_0xa581('0x3'));var path=require(_0xa581('0x4'));var sox=require(_0xa581('0x5'));var csv=require(_0xa581('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa581('0x7'));var squel=require(_0xa581('0x8'));var crypto=require(_0xa581('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xa581('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa581('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa581('0xc'));var hardwareService=require(_0xa581('0xd'));var logger=require(_0xa581('0xe'))(_0xa581('0xf'));var utils=require(_0xa581('0x10'));var config=require(_0xa581('0x11'));var db=require(_0xa581('0x12'))['db'];function respondWithStatusCode(_0x3eabf7,_0x5704ab){_0x5704ab=_0x5704ab||0xcc;return function(_0x109de2){if(_0x109de2){return _0x3eabf7[_0xa581('0x13')](_0x5704ab);}return _0x3eabf7[_0xa581('0x14')](_0x5704ab)['end']();};}function respondWithResult(_0x27ce7c,_0x1ea5fa){_0x1ea5fa=_0x1ea5fa||0xc8;return function(_0x25fcc9){if(_0x25fcc9){return _0x27ce7c['status'](_0x1ea5fa)['json'](_0x25fcc9);}};}function respondWithFilteredResult(_0x51c8fb,_0x2ab639){return function(_0x4d9eca){if(_0x4d9eca){var _0x1c0588=_0x4d9eca['count'],_0x5bdc08=_0x2ab639['offset'],_0x1e0947=_0x2ab639[_0xa581('0x15')]+_0x2ab639[_0xa581('0x16')],_0x51b40b;if(_0x1e0947>=_0x1c0588){_0x1e0947=_0x1c0588;_0x51b40b=0xc8;}else{_0x51b40b=0xce;}_0x51c8fb[_0xa581('0x14')](_0x51b40b);return _0x51c8fb[_0xa581('0x17')]('Content-Range',_0x5bdc08+'-'+_0x1e0947+'/'+_0x1c0588)['json'](_0x4d9eca);}return null;};}function patchUpdates(_0x4e7781){return function(_0x390e77){try{jsonpatch[_0xa581('0x18')](_0x390e77,_0x4e7781,!![]);}catch(_0x4e78ff){return BPromise['reject'](_0x4e78ff);}return _0x390e77[_0xa581('0x19')]();};}function saveUpdates(_0x55426d,_0x4a3014){return function(_0x3a53bc){if(_0x3a53bc){return _0x3a53bc[_0xa581('0x1a')](_0x55426d)[_0xa581('0x1b')](function(_0x56b3bc){return _0x56b3bc;});}return null;};}function removeEntity(_0x555f18,_0x41becd){return function(_0x2ff068){if(_0x2ff068){return _0x2ff068[_0xa581('0x1c')]()[_0xa581('0x1b')](function(){_0x555f18[_0xa581('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc2fb42,_0x404d61){return function(_0x4ec98a){if(!_0x4ec98a){_0xc2fb42[_0xa581('0x13')](0x194);}return _0x4ec98a;};}function handleError(_0x39e8c3,_0x1315cb){_0x1315cb=_0x1315cb||0x1f4;return function(_0x2dac91){logger[_0xa581('0x1d')](_0x2dac91[_0xa581('0x1e')]);if(_0x2dac91['name']){delete _0x2dac91[_0xa581('0x1f')];}_0x39e8c3['status'](_0x1315cb)[_0xa581('0x20')](_0x2dac91);};}exports[_0xa581('0x21')]=function(_0x4fd022,_0x3cc304){var _0x562912={},_0x10bc10={},_0x37bc92={'count':0x0,'rows':[]};var _0x5a7a4c=db[_0xa581('0x22')][_0xa581('0x23')];_0x10bc10[_0xa581('0x24')]=_['keys'](_0x5a7a4c);_0x10bc10['query']=_[_0xa581('0x25')](_0x4fd022[_0xa581('0x26')]);_0x10bc10['filters']=_['intersection'](_0x10bc10[_0xa581('0x24')],_0x10bc10[_0xa581('0x26')]);_0x562912[_0xa581('0x27')]=_[_0xa581('0x28')](_0x10bc10[_0xa581('0x24')],qs[_0xa581('0x29')](_0x4fd022[_0xa581('0x26')][_0xa581('0x29')]));_0x562912[_0xa581('0x27')]=_0x562912[_0xa581('0x27')][_0xa581('0x2a')]?_0x562912[_0xa581('0x27')]:_0x10bc10[_0xa581('0x24')];if(!_0x4fd022[_0xa581('0x26')][_0xa581('0x2b')](_0xa581('0x2c'))){_0x562912[_0xa581('0x16')]=qs[_0xa581('0x16')](_0x4fd022[_0xa581('0x26')][_0xa581('0x16')]);_0x562912[_0xa581('0x15')]=qs[_0xa581('0x15')](_0x4fd022[_0xa581('0x26')][_0xa581('0x15')]);}_0x562912['order']=qs[_0xa581('0x2d')](_0x4fd022[_0xa581('0x26')]['sort']);_0x562912['where']=qs['filters'](_[_0xa581('0x2e')](_0x4fd022['query'],_0x10bc10['filters']));if(_0x4fd022[_0xa581('0x26')][_0xa581('0x2f')]){_0x562912[_0xa581('0x30')]=_[_0xa581('0x31')](_0x562912[_0xa581('0x30')],{'$or':_[_0xa581('0x32')](_0x5a7a4c,function(_0x170a03){if(_0x170a03[_0xa581('0x33')][_0xa581('0x34')]!==_0xa581('0x35')){var _0x5ead7f={};_0x5ead7f[_0x170a03[_0xa581('0x36')]]={'$like':'%'+_0x4fd022[_0xa581('0x26')][_0xa581('0x2f')]+'%'};return _0x5ead7f;}})});}_0x562912=_['merge']({},_0x562912,_0x4fd022[_0xa581('0x37')]);var _0xec7456={'where':_0x562912['where']};return db[_0xa581('0x22')][_0xa581('0x38')](_0xec7456)['then'](function(_0x503654){_0x37bc92['count']=_0x503654;if(_0x4fd022['query'][_0xa581('0x39')]){_0x562912[_0xa581('0x3a')]=[{'all':!![]}];}return db[_0xa581('0x22')][_0xa581('0x3b')](_0x562912);})['then'](function(_0x22cb32){_0x37bc92[_0xa581('0x3c')]=_0x22cb32;return _0x37bc92;})[_0xa581('0x1b')](respondWithFilteredResult(_0x3cc304,_0x562912))[_0xa581('0x3d')](handleError(_0x3cc304,null));};exports[_0xa581('0x3e')]=function(_0x1b3f8f,_0x4b1921){var _0x297019={'raw':!![],'where':{'id':_0x1b3f8f[_0xa581('0x3f')]['id']}},_0x3ea9e5={};_0x3ea9e5[_0xa581('0x24')]=_[_0xa581('0x25')](db[_0xa581('0x22')][_0xa581('0x23')]);_0x3ea9e5[_0xa581('0x26')]=_['keys'](_0x1b3f8f[_0xa581('0x26')]);_0x3ea9e5[_0xa581('0x40')]=_[_0xa581('0x28')](_0x3ea9e5[_0xa581('0x24')],_0x3ea9e5[_0xa581('0x26')]);_0x297019['attributes']=_[_0xa581('0x28')](_0x3ea9e5[_0xa581('0x24')],qs['fields'](_0x1b3f8f['query']['fields']));_0x297019['attributes']=_0x297019['attributes'][_0xa581('0x2a')]?_0x297019[_0xa581('0x27')]:_0x3ea9e5[_0xa581('0x24')];if(_0x1b3f8f[_0xa581('0x26')]['includeAll']){_0x297019[_0xa581('0x3a')]=[{'all':!![]}];}_0x297019=_[_0xa581('0x31')]({},_0x297019,_0x1b3f8f[_0xa581('0x37')]);return db[_0xa581('0x22')][_0xa581('0x41')](_0x297019)[_0xa581('0x1b')](handleEntityNotFound(_0x4b1921,null))['then'](respondWithResult(_0x4b1921,null))[_0xa581('0x3d')](handleError(_0x4b1921,null));};exports[_0xa581('0x42')]=function(_0x3e6593,_0x158bfb){return db['ServicenowField']['create'](_0x3e6593[_0xa581('0x43')],{})[_0xa581('0x1b')](respondWithResult(_0x158bfb,0xc9))[_0xa581('0x3d')](handleError(_0x158bfb,null));};exports[_0xa581('0x1a')]=function(_0x5cc68f,_0x486d7d){if(_0x5cc68f[_0xa581('0x43')]['id']){delete _0x5cc68f[_0xa581('0x43')]['id'];}return db[_0xa581('0x22')]['find']({'where':{'id':_0x5cc68f['params']['id']}})[_0xa581('0x1b')](handleEntityNotFound(_0x486d7d,null))['then'](saveUpdates(_0x5cc68f[_0xa581('0x43')],null))[_0xa581('0x1b')](respondWithResult(_0x486d7d,null))[_0xa581('0x3d')](handleError(_0x486d7d,null));};exports[_0xa581('0x1c')]=function(_0x146fda,_0x2ed426){return db[_0xa581('0x22')][_0xa581('0x41')]({'where':{'id':_0x146fda[_0xa581('0x3f')]['id']}})[_0xa581('0x1b')](handleEntityNotFound(_0x2ed426,null))[_0xa581('0x1b')](removeEntity(_0x2ed426,null))[_0xa581('0x3d')](handleError(_0x2ed426,null));}; \ No newline at end of file +var _0xd76f=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','destroy','stack','name','send','ServicenowField','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','then','findAll','rows','show','includeAll','catch','create','body','find','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x57fa7e,_0xd0b5ce){var _0x320671=function(_0x3392cc){while(--_0x3392cc){_0x57fa7e['push'](_0x57fa7e['shift']());}};_0x320671(++_0xd0b5ce);}(_0xd76f,0x159));var _0xfd76=function(_0x4687df,_0x12099c){_0x4687df=_0x4687df-0x0;var _0x32eaef=_0xd76f[_0x4687df];return _0x32eaef;};'use strict';var pdf=require(_0xfd76('0x0'));var emlformat=require(_0xfd76('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xfd76('0x2'));var jsonpatch=require(_0xfd76('0x3'));var rp=require(_0xfd76('0x4'));var moment=require('moment');var BPromise=require(_0xfd76('0x5'));var Mustache=require(_0xfd76('0x6'));var util=require(_0xfd76('0x7'));var path=require('path');var sox=require(_0xfd76('0x8'));var csv=require(_0xfd76('0x9'));var ejs=require(_0xfd76('0xa'));var fs=require('fs');var _=require(_0xfd76('0xb'));var squel=require(_0xfd76('0xc'));var crypto=require(_0xfd76('0xd'));var jsforce=require(_0xfd76('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xfd76('0x9'));var querystring=require(_0xfd76('0xf'));var Papa=require(_0xfd76('0x10'));var Redis=require(_0xfd76('0x11'));var authService=require(_0xfd76('0x12'));var qs=require(_0xfd76('0x13'));var hardwareService=require(_0xfd76('0x14'));var logger=require(_0xfd76('0x15'))(_0xfd76('0x16'));var utils=require(_0xfd76('0x17'));var config=require(_0xfd76('0x18'));var db=require(_0xfd76('0x19'))['db'];function respondWithStatusCode(_0x1f8fbf,_0x571a94){_0x571a94=_0x571a94||0xcc;return function(_0x54bfcf){if(_0x54bfcf){return _0x1f8fbf[_0xfd76('0x1a')](_0x571a94);}return _0x1f8fbf[_0xfd76('0x1b')](_0x571a94)[_0xfd76('0x1c')]();};}function respondWithResult(_0x2247ae,_0x56341c){_0x56341c=_0x56341c||0xc8;return function(_0x4d98ed){if(_0x4d98ed){return _0x2247ae[_0xfd76('0x1b')](_0x56341c)[_0xfd76('0x1d')](_0x4d98ed);}};}function respondWithFilteredResult(_0x128e95,_0x334b5f){return function(_0x1974b7){if(_0x1974b7){var _0x533ee7=_0x1974b7[_0xfd76('0x1e')],_0x335e90=_0x334b5f['offset'],_0x38e505=_0x334b5f[_0xfd76('0x1f')]+_0x334b5f[_0xfd76('0x20')],_0xb78c04;if(_0x38e505>=_0x533ee7){_0x38e505=_0x533ee7;_0xb78c04=0xc8;}else{_0xb78c04=0xce;}_0x128e95[_0xfd76('0x1b')](_0xb78c04);return _0x128e95['set'](_0xfd76('0x21'),_0x335e90+'-'+_0x38e505+'/'+_0x533ee7)['json'](_0x1974b7);}return null;};}function patchUpdates(_0x39d6dc){return function(_0x351f06){try{jsonpatch[_0xfd76('0x22')](_0x351f06,_0x39d6dc,!![]);}catch(_0x10295b){return BPromise['reject'](_0x10295b);}return _0x351f06[_0xfd76('0x23')]();};}function saveUpdates(_0x91fc6,_0x58b323){return function(_0x2856d6){if(_0x2856d6){return _0x2856d6[_0xfd76('0x24')](_0x91fc6)['then'](function(_0x5dd94e){return _0x5dd94e;});}return null;};}function removeEntity(_0xbb116f,_0x53d276){return function(_0x18d7cd){if(_0x18d7cd){return _0x18d7cd[_0xfd76('0x25')]()['then'](function(){_0xbb116f[_0xfd76('0x1b')](0xcc)[_0xfd76('0x1c')]();});}};}function handleEntityNotFound(_0x5653b5,_0x34f637){return function(_0x585c93){if(!_0x585c93){_0x5653b5[_0xfd76('0x1a')](0x194);}return _0x585c93;};}function handleError(_0x460f8f,_0xeecdbc){_0xeecdbc=_0xeecdbc||0x1f4;return function(_0x1a636b){logger['error'](_0x1a636b[_0xfd76('0x26')]);if(_0x1a636b[_0xfd76('0x27')]){delete _0x1a636b[_0xfd76('0x27')];}_0x460f8f[_0xfd76('0x1b')](_0xeecdbc)[_0xfd76('0x28')](_0x1a636b);};}exports['index']=function(_0x31191b,_0x56b98f){var _0x30b29b={},_0xc3b91b={},_0xa8ed31={'count':0x0,'rows':[]};var _0x2bce1a=db[_0xfd76('0x29')][_0xfd76('0x2a')];_0xc3b91b['model']=_[_0xfd76('0x2b')](_0x2bce1a);_0xc3b91b[_0xfd76('0x2c')]=_['keys'](_0x31191b[_0xfd76('0x2c')]);_0xc3b91b[_0xfd76('0x2d')]=_[_0xfd76('0x2e')](_0xc3b91b[_0xfd76('0x2f')],_0xc3b91b[_0xfd76('0x2c')]);_0x30b29b[_0xfd76('0x30')]=_[_0xfd76('0x2e')](_0xc3b91b[_0xfd76('0x2f')],qs[_0xfd76('0x31')](_0x31191b[_0xfd76('0x2c')][_0xfd76('0x31')]));_0x30b29b[_0xfd76('0x30')]=_0x30b29b['attributes'][_0xfd76('0x32')]?_0x30b29b[_0xfd76('0x30')]:_0xc3b91b['model'];if(!_0x31191b[_0xfd76('0x2c')]['hasOwnProperty']('nolimit')){_0x30b29b[_0xfd76('0x20')]=qs[_0xfd76('0x20')](_0x31191b[_0xfd76('0x2c')][_0xfd76('0x20')]);_0x30b29b[_0xfd76('0x1f')]=qs[_0xfd76('0x1f')](_0x31191b[_0xfd76('0x2c')][_0xfd76('0x1f')]);}_0x30b29b['order']=qs[_0xfd76('0x33')](_0x31191b[_0xfd76('0x2c')][_0xfd76('0x33')]);_0x30b29b[_0xfd76('0x34')]=qs[_0xfd76('0x2d')](_[_0xfd76('0x35')](_0x31191b[_0xfd76('0x2c')],_0xc3b91b['filters']));if(_0x31191b[_0xfd76('0x2c')][_0xfd76('0x36')]){_0x30b29b['where']=_['merge'](_0x30b29b['where'],{'$or':_[_0xfd76('0x37')](_0x2bce1a,function(_0x1281ba){if(_0x1281ba[_0xfd76('0x38')][_0xfd76('0x39')]!==_0xfd76('0x3a')){var _0x3eeb65={};_0x3eeb65[_0x1281ba[_0xfd76('0x3b')]]={'$like':'%'+_0x31191b['query'][_0xfd76('0x36')]+'%'};return _0x3eeb65;}})});}_0x30b29b=_[_0xfd76('0x3c')]({},_0x30b29b,_0x31191b[_0xfd76('0x3d')]);var _0x3228f5={'where':_0x30b29b[_0xfd76('0x34')]};return db[_0xfd76('0x29')][_0xfd76('0x1e')](_0x3228f5)[_0xfd76('0x3e')](function(_0x1698de){_0xa8ed31['count']=_0x1698de;if(_0x31191b[_0xfd76('0x2c')]['includeAll']){_0x30b29b['include']=[{'all':!![]}];}return db[_0xfd76('0x29')][_0xfd76('0x3f')](_0x30b29b);})[_0xfd76('0x3e')](function(_0x30f758){_0xa8ed31[_0xfd76('0x40')]=_0x30f758;return _0xa8ed31;})[_0xfd76('0x3e')](respondWithFilteredResult(_0x56b98f,_0x30b29b))['catch'](handleError(_0x56b98f,null));};exports[_0xfd76('0x41')]=function(_0x35b366,_0x2dde67){var _0x287bfc={'raw':!![],'where':{'id':_0x35b366['params']['id']}},_0x401a57={};_0x401a57[_0xfd76('0x2f')]=_[_0xfd76('0x2b')](db[_0xfd76('0x29')][_0xfd76('0x2a')]);_0x401a57['query']=_[_0xfd76('0x2b')](_0x35b366[_0xfd76('0x2c')]);_0x401a57[_0xfd76('0x2d')]=_[_0xfd76('0x2e')](_0x401a57[_0xfd76('0x2f')],_0x401a57[_0xfd76('0x2c')]);_0x287bfc[_0xfd76('0x30')]=_[_0xfd76('0x2e')](_0x401a57['model'],qs[_0xfd76('0x31')](_0x35b366['query']['fields']));_0x287bfc[_0xfd76('0x30')]=_0x287bfc[_0xfd76('0x30')][_0xfd76('0x32')]?_0x287bfc[_0xfd76('0x30')]:_0x401a57[_0xfd76('0x2f')];if(_0x35b366[_0xfd76('0x2c')][_0xfd76('0x42')]){_0x287bfc['include']=[{'all':!![]}];}_0x287bfc=_['merge']({},_0x287bfc,_0x35b366[_0xfd76('0x3d')]);return db['ServicenowField']['find'](_0x287bfc)[_0xfd76('0x3e')](handleEntityNotFound(_0x2dde67,null))[_0xfd76('0x3e')](respondWithResult(_0x2dde67,null))[_0xfd76('0x43')](handleError(_0x2dde67,null));};exports[_0xfd76('0x44')]=function(_0x1cc46d,_0x25cefa){return db[_0xfd76('0x29')][_0xfd76('0x44')](_0x1cc46d[_0xfd76('0x45')],{})[_0xfd76('0x3e')](respondWithResult(_0x25cefa,0xc9))[_0xfd76('0x43')](handleError(_0x25cefa,null));};exports[_0xfd76('0x24')]=function(_0x4e3021,_0x2c972c){if(_0x4e3021[_0xfd76('0x45')]['id']){delete _0x4e3021['body']['id'];}return db[_0xfd76('0x29')][_0xfd76('0x46')]({'where':{'id':_0x4e3021['params']['id']}})[_0xfd76('0x3e')](handleEntityNotFound(_0x2c972c,null))[_0xfd76('0x3e')](saveUpdates(_0x4e3021['body'],null))[_0xfd76('0x3e')](respondWithResult(_0x2c972c,null))[_0xfd76('0x43')](handleError(_0x2c972c,null));};exports['destroy']=function(_0x2053be,_0x5a2673){return db[_0xfd76('0x29')][_0xfd76('0x46')]({'where':{'id':_0x2053be[_0xfd76('0x47')]['id']}})['then'](handleEntityNotFound(_0x5a2673,null))[_0xfd76('0x3e')](removeEntity(_0x5a2673,null))[_0xfd76('0x43')](handleError(_0x5a2673,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 292ddb8..ac37156 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 _0xeda7=['define','ServicenowField','int_servicenow_fields','servicenow_unique_index','FieldId','api','bluebird','path','./intServicenowField.attributes','exports'];(function(_0x4b4aaf,_0x19656c){var _0x2d3774=function(_0x1e9167){while(--_0x1e9167){_0x4b4aaf['push'](_0x4b4aaf['shift']());}};_0x2d3774(++_0x19656c);}(_0xeda7,0x7d));var _0x7eda=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xeda7[_0x257642];return _0x3d813b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7eda('0x0'));var moment=require('moment');var BPromise=require(_0x7eda('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7eda('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7eda('0x3'));module[_0x7eda('0x4')]=function(_0x572e7f,_0x38e526){return _0x572e7f[_0x7eda('0x5')](_0x7eda('0x6'),attributes,{'tableName':_0x7eda('0x7'),'paranoid':![],'indexes':[{'name':_0x7eda('0x8'),'fields':['idField',_0x7eda('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xee7a=['servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intServicenowField.attributes','define','ServicenowField','int_servicenow_fields'];(function(_0x2fdf82,_0x322e7c){var _0x2382f5=function(_0x4d6951){while(--_0x4d6951){_0x2fdf82['push'](_0x2fdf82['shift']());}};_0x2382f5(++_0x322e7c);}(_0xee7a,0x14d));var _0xaee7=function(_0x24e02c,_0x4a8f27){_0x24e02c=_0x24e02c-0x0;var _0x413ca7=_0xee7a[_0x24e02c];return _0x413ca7;};'use strict';var _=require(_0xaee7('0x0'));var util=require(_0xaee7('0x1'));var logger=require(_0xaee7('0x2'))(_0xaee7('0x3'));var moment=require('moment');var BPromise=require(_0xaee7('0x4'));var rp=require(_0xaee7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaee7('0x6'));var config=require(_0xaee7('0x7'));var attributes=require(_0xaee7('0x8'));module['exports']=function(_0x486dc2,_0x457177){return _0x486dc2[_0xaee7('0x9')](_0xaee7('0xa'),attributes,{'tableName':_0xaee7('0xb'),'paranoid':![],'indexes':[{'name':_0xaee7('0xc'),'fields':[_0xaee7('0xd'),_0xaee7('0xe')],'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 26ab3b3..71a44ec 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 _0x955f=['ServicenowField,\x20%s,\x20%s','request\x20sent','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','then','info'];(function(_0x4e9e88,_0x19f8e6){var _0x2d535a=function(_0x59c559){while(--_0x59c559){_0x4e9e88['push'](_0x4e9e88['shift']());}};_0x2d535a(++_0x19f8e6);}(_0x955f,0x1eb));var _0xf955=function(_0x3a29ca,_0x2ed3dc){_0x3a29ca=_0x3a29ca-0x0;var _0x4fd656=_0x955f[_0x3a29ca];return _0x4fd656;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var moment=require(_0xf955('0x2'));var BPromise=require(_0xf955('0x3'));var rs=require(_0xf955('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf955('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf955('0x6'));var config=require('../../config/environment');var jayson=require(_0xf955('0x7'));var client=jayson[_0xf955('0x8')][_0xf955('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59d5b3,_0x18432f,_0x20c096){return new BPromise(function(_0x4f58fb,_0x254b38){return client[_0xf955('0xa')](_0x59d5b3,_0x20c096)[_0xf955('0xb')](function(_0x38b190){logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,_0xf955('0xe'));logger['debug'](_0xf955('0xf'),_0x18432f,'request\x20sent',JSON[_0xf955('0x10')](_0x38b190));if(_0x38b190[_0xf955('0x11')]){if(_0x38b190[_0xf955('0x11')]['code']===0x1f4){logger[_0xf955('0x11')]('ServicenowField,\x20%s,\x20%s',_0x18432f,_0x38b190[_0xf955('0x11')]['message']);return _0x254b38(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);return _0x4f58fb(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}else{logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,'request\x20sent');_0x4f58fb(_0x38b190[_0xf955('0x13')]['message']);}})[_0xf955('0x14')](function(_0x3a814f){logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x3a814f);_0x254b38(_0x3a814f);});});} \ No newline at end of file +var _0x6d38=['request','then','ServicenowField,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x2b2d86,_0xd80c06){var _0x1690e2=function(_0x3e3ce1){while(--_0x3e3ce1){_0x2b2d86['push'](_0x2b2d86['shift']());}};_0x1690e2(++_0xd80c06);}(_0x6d38,0x1ef));var _0x86d3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6d38[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('ServicenowField,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 69e0aab..db3f7c7 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 _0x171c=['post','/:id/configurations','put','destroy','exports','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x171c,0x148));var _0xc171=function(_0x1b6e96,_0xb20aa5){_0x1b6e96=_0x1b6e96-0x0;var _0x21c450=_0x171c[_0x1b6e96];return _0x21c450;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xc171('0x0'));var express=require(_0xc171('0x1'));var router=express['Router']();var auth=require(_0xc171('0x2'));var interaction=require(_0xc171('0x3'));var config=require(_0xc171('0x4'));var controller=require(_0xc171('0x5'));router[_0xc171('0x6')]('/',auth['isAuthenticated'](),controller[_0xc171('0x7')]);router['get'](_0xc171('0x8'),auth[_0xc171('0x9')](),controller[_0xc171('0xa')]);router[_0xc171('0x6')]('/:id/configurations',auth[_0xc171('0x9')](),controller['getConfigurations']);router['get'](_0xc171('0xb'),auth[_0xc171('0x9')](),controller[_0xc171('0xc')]);router['post']('/',auth[_0xc171('0x9')](),controller[_0xc171('0xd')]);router[_0xc171('0xe')](_0xc171('0xf'),auth[_0xc171('0x9')](),controller['addConfiguration']);router[_0xc171('0x10')]('/:id',auth[_0xc171('0x9')](),controller['update']);router['delete'](_0xc171('0x8'),auth[_0xc171('0x9')](),controller[_0xc171('0x11')]);module[_0xc171('0x12')]=router; \ No newline at end of file +var _0x209b=['destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intSugarcrmAccount.controller','isAuthenticated','index','get','/:id','show','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','put','update'];(function(_0x54ac1b,_0x291232){var _0x47524f=function(_0x137fad){while(--_0x137fad){_0x54ac1b['push'](_0x54ac1b['shift']());}};_0x47524f(++_0x291232);}(_0x209b,0xe8));var _0xb209=function(_0xa6dfcb,_0x4d3529){_0xa6dfcb=_0xa6dfcb-0x0;var _0x5e7adc=_0x209b[_0xa6dfcb];return _0x5e7adc;};'use strict';var multer=require(_0xb209('0x0'));var util=require(_0xb209('0x1'));var path=require(_0xb209('0x2'));var timeout=require(_0xb209('0x3'));var express=require(_0xb209('0x4'));var router=express['Router']();var auth=require(_0xb209('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb209('0x6'));var controller=require(_0xb209('0x7'));router['get']('/',auth[_0xb209('0x8')](),controller[_0xb209('0x9')]);router[_0xb209('0xa')](_0xb209('0xb'),auth['isAuthenticated'](),controller[_0xb209('0xc')]);router[_0xb209('0xa')]('/:id/configurations',auth[_0xb209('0x8')](),controller[_0xb209('0xd')]);router[_0xb209('0xa')]('/:id/fields',auth[_0xb209('0x8')](),controller[_0xb209('0xe')]);router[_0xb209('0xf')]('/',auth[_0xb209('0x8')](),controller[_0xb209('0x10')]);router['post'](_0xb209('0x11'),auth[_0xb209('0x8')](),controller[_0xb209('0x12')]);router[_0xb209('0x13')](_0xb209('0xb'),auth['isAuthenticated'](),controller[_0xb209('0x14')]);router['delete'](_0xb209('0xb'),auth[_0xb209('0x8')](),controller[_0xb209('0x15')]);module[_0xb209('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index ea43c33..1276bf1 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 _0x7d91=['STRING','username','remoteUri','exports'];(function(_0x1aa13e,_0x12a40b){var _0x1144bd=function(_0x5f5cae){while(--_0x5f5cae){_0x1aa13e['push'](_0x1aa13e['shift']());}};_0x1144bd(++_0x12a40b);}(_0x7d91,0x10f));var _0x17d9=function(_0x4ae3dc,_0x58314b){_0x4ae3dc=_0x4ae3dc-0x0;var _0x3f96f9=_0x7d91[_0x4ae3dc];return _0x3f96f9;};'use strict';var Sequelize=require('sequelize');module[_0x17d9('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x17d9('0x1')]},'username':{'type':Sequelize[_0x17d9('0x1')],'unique':_0x17d9('0x2')},'password':{'type':Sequelize[_0x17d9('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x17d9('0x3')},'serverUrl':{'type':Sequelize[_0x17d9('0x1')]}}; \ No newline at end of file +var _0x3275=['STRING','username','sequelize','exports'];(function(_0x21fded,_0x203183){var _0x5927de=function(_0x1e5762){while(--_0x1e5762){_0x21fded['push'](_0x21fded['shift']());}};_0x5927de(++_0x203183);}(_0x3275,0xe2));var _0x5327=function(_0x4b0f0e,_0x57d1f0){_0x4b0f0e=_0x4b0f0e-0x0;var _0x36acb4=_0x3275[_0x4b0f0e];return _0x36acb4;};'use strict';var Sequelize=require(_0x5327('0x0'));module[_0x5327('0x1')]={'name':{'type':Sequelize[_0x5327('0x2')]},'description':{'type':Sequelize[_0x5327('0x2')]},'username':{'type':Sequelize[_0x5327('0x2')],'unique':_0x5327('0x3')},'password':{'type':Sequelize[_0x5327('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 389f522..30a4d1f 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 _0x7046=['json','reject','save','update','destroy','stack','send','index','SugarcrmAccount','rawAttributes','model','keys','query','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','filters','key','VIRTUAL','field','filter','merge','options','count','include','findAll','params','includeAll','find','create','body','map','getConfigurations','hasOwnProperty','findOne','Subjects','getSubjects','channel','type','SugarcrmConfiguration','SugarcrmField','Descriptions','getFields','name','assigned_user_id','duration_hours','duration_minutes','parent_name','direction','password','remoteUri','slice','substring','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','get_module_fields','values','module_fields','remove','includes','endsWith','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','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','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset'];(function(_0x16d2f3,_0x46d83f){var _0x1472f7=function(_0x2b9f7b){while(--_0x2b9f7b){_0x16d2f3['push'](_0x16d2f3['shift']());}};_0x1472f7(++_0x46d83f);}(_0x7046,0x144));var _0x6704=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7046[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0x6704('0x0'));var emlformat=require(_0x6704('0x1'));var rimraf=require(_0x6704('0x2'));var zipdir=require(_0x6704('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6704('0x4'));var moment=require(_0x6704('0x5'));var BPromise=require(_0x6704('0x6'));var Mustache=require('mustache');var util=require(_0x6704('0x7'));var path=require(_0x6704('0x8'));var sox=require(_0x6704('0x9'));var csv=require(_0x6704('0xa'));var ejs=require(_0x6704('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6704('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6704('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6704('0xe'));var Redis=require(_0x6704('0xf'));var authService=require(_0x6704('0x10'));var qs=require(_0x6704('0x11'));var hardwareService=require(_0x6704('0x12'));var logger=require(_0x6704('0x13'))(_0x6704('0x14'));var utils=require(_0x6704('0x15'));var config=require('../../config/environment');var db=require(_0x6704('0x16'))['db'];var integrations=require(_0x6704('0x17'));var jayson=require('jayson/promise');var client=jayson[_0x6704('0x18')][_0x6704('0x19')]({'port':0x232a});function checkPasswordPattern(_0x327e03,_0x13b8f4,_0x34a538){if(_0x34a538){var _0x1ec91e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ec91e[_0x6704('0x1a')](_0x13b8f4)){return _0x327e03;}else{throw new Error(_0x6704('0x1b'));}}else{return _0x327e03;}}function respondWithRpcPromise(_0x24ece3,_0x49048f,_0x168258,_0x1752bc){return new BPromise(function(_0x35082b,_0x4fef80){var _0x11782a=_0x1752bc||client;return _0x11782a[_0x6704('0x1c')](_0x24ece3,_0x168258)[_0x6704('0x1d')](function(_0x29fa46){logger[_0x6704('0x1e')]('SugarcrmAccount,\x20%s,\x20%s',_0x49048f,_0x6704('0x1f'));logger[_0x6704('0x20')](_0x6704('0x21'),_0x49048f,_0x6704('0x1f'),JSON[_0x6704('0x22')](_0x29fa46));if(_0x29fa46['error']){if(_0x29fa46[_0x6704('0x23')][_0x6704('0x24')]===0x1f4){logger[_0x6704('0x23')](_0x6704('0x25'),_0x49048f,_0x29fa46[_0x6704('0x23')][_0x6704('0x26')]);return _0x4fef80(_0x29fa46[_0x6704('0x23')]['message']);}logger[_0x6704('0x23')](_0x6704('0x25'),_0x49048f,_0x29fa46[_0x6704('0x23')]['message']);return _0x35082b(_0x29fa46['error'][_0x6704('0x26')]);}else{logger[_0x6704('0x1e')](_0x6704('0x25'),_0x49048f,_0x6704('0x1f'));_0x35082b(_0x29fa46[_0x6704('0x27')]['message']);}})[_0x6704('0x28')](function(_0xabb97a){logger[_0x6704('0x23')](_0x6704('0x25'),_0x49048f,_0xabb97a);_0x4fef80(_0xabb97a);});});}function respondWithStatusCode(_0x16b6b9,_0x2476d6){_0x2476d6=_0x2476d6||0xcc;return function(_0x2acafd){if(_0x2acafd){return _0x16b6b9[_0x6704('0x29')](_0x2476d6);}return _0x16b6b9[_0x6704('0x2a')](_0x2476d6)[_0x6704('0x2b')]();};}function respondWithResult(_0x36bea4,_0x1bdfee){_0x1bdfee=_0x1bdfee||0xc8;return function(_0x118d93){if(_0x118d93){return _0x36bea4['status'](_0x1bdfee)['json'](_0x118d93);}};}function respondWithFilteredResult(_0x167312,_0xf875dc){return function(_0x86fc1d){if(_0x86fc1d){var _0x38f9fe=_0x86fc1d['count'],_0x4a9c3e=_0xf875dc['offset'],_0x1def46=_0xf875dc[_0x6704('0x2c')]+_0xf875dc['limit'],_0x18cd98;if(_0x1def46>=_0x38f9fe){_0x1def46=_0x38f9fe;_0x18cd98=0xc8;}else{_0x18cd98=0xce;}_0x167312[_0x6704('0x2a')](_0x18cd98);return _0x167312['set']('Content-Range',_0x4a9c3e+'-'+_0x1def46+'/'+_0x38f9fe)[_0x6704('0x2d')](_0x86fc1d);}return null;};}function patchUpdates(_0x115514){return function(_0x45a286){try{jsonpatch['apply'](_0x45a286,_0x115514,!![]);}catch(_0x1c7132){return BPromise[_0x6704('0x2e')](_0x1c7132);}return _0x45a286[_0x6704('0x2f')]();};}function saveUpdates(_0x1c35ab,_0x920914){return function(_0x34c346){if(_0x34c346){return _0x34c346[_0x6704('0x30')](_0x1c35ab)[_0x6704('0x1d')](function(_0x1197e0){return _0x1197e0;});}return null;};}function removeEntity(_0xa151eb,_0xe90860){return function(_0x454885){if(_0x454885){return _0x454885[_0x6704('0x31')]()[_0x6704('0x1d')](function(){_0xa151eb[_0x6704('0x2a')](0xcc)[_0x6704('0x2b')]();});}};}function handleEntityNotFound(_0x159a0a,_0x1215ff){return function(_0x219494){if(!_0x219494){_0x159a0a[_0x6704('0x29')](0x194);}return _0x219494;};}function handleError(_0x1c0aa1,_0x43b22b){_0x43b22b=_0x43b22b||0x1f4;return function(_0x12ba0d){logger[_0x6704('0x23')](_0x12ba0d[_0x6704('0x32')]);if(_0x12ba0d['name']){delete _0x12ba0d['name'];}_0x1c0aa1['status'](_0x43b22b)[_0x6704('0x33')](_0x12ba0d);};}exports[_0x6704('0x34')]=function(_0x18222f,_0x544ba6){var _0x1c3cd9={},_0x5ecbee={},_0x15da25={'count':0x0,'rows':[]};var _0x3c3060=db[_0x6704('0x35')][_0x6704('0x36')];_0x5ecbee[_0x6704('0x37')]=_[_0x6704('0x38')](_0x3c3060);_0x5ecbee[_0x6704('0x39')]=_[_0x6704('0x38')](_0x18222f['query']);_0x5ecbee['filters']=_[_0x6704('0x3a')](_0x5ecbee[_0x6704('0x37')],_0x5ecbee['query']);_0x1c3cd9['attributes']=_[_0x6704('0x3a')](_0x5ecbee['model'],qs[_0x6704('0x3b')](_0x18222f[_0x6704('0x39')][_0x6704('0x3b')]));_0x1c3cd9[_0x6704('0x3c')]=_0x1c3cd9['attributes'][_0x6704('0x3d')]?_0x1c3cd9[_0x6704('0x3c')]:_0x5ecbee['model'];if(!_0x18222f[_0x6704('0x39')]['hasOwnProperty'](_0x6704('0x3e'))){_0x1c3cd9[_0x6704('0x3f')]=qs[_0x6704('0x3f')](_0x18222f['query'][_0x6704('0x3f')]);_0x1c3cd9[_0x6704('0x2c')]=qs[_0x6704('0x2c')](_0x18222f['query'][_0x6704('0x2c')]);}_0x1c3cd9[_0x6704('0x40')]=qs[_0x6704('0x41')](_0x18222f[_0x6704('0x39')]['sort']);_0x1c3cd9[_0x6704('0x42')]=qs['filters'](_[_0x6704('0x43')](_0x18222f[_0x6704('0x39')],_0x5ecbee[_0x6704('0x44')]));if(_0x18222f[_0x6704('0x39')]['filter']){_0x1c3cd9['where']=_['merge'](_0x1c3cd9[_0x6704('0x42')],{'$or':_['map'](_0x3c3060,function(_0xd05c47){if(_0xd05c47['type'][_0x6704('0x45')]!==_0x6704('0x46')){var _0x56a344={};_0x56a344[_0xd05c47[_0x6704('0x47')]]={'$like':'%'+_0x18222f[_0x6704('0x39')][_0x6704('0x48')]+'%'};return _0x56a344;}})});}_0x1c3cd9=_[_0x6704('0x49')]({},_0x1c3cd9,_0x18222f[_0x6704('0x4a')]);var _0x5ca5a5={'where':_0x1c3cd9[_0x6704('0x42')]};return db[_0x6704('0x35')][_0x6704('0x4b')](_0x5ca5a5)[_0x6704('0x1d')](function(_0x269a30){_0x15da25['count']=_0x269a30;if(_0x18222f[_0x6704('0x39')]['includeAll']){_0x1c3cd9[_0x6704('0x4c')]=[{'all':!![]}];}return db[_0x6704('0x35')][_0x6704('0x4d')](_0x1c3cd9);})[_0x6704('0x1d')](function(_0x3c23a3){_0x15da25['rows']=_0x3c23a3;return _0x15da25;})[_0x6704('0x1d')](respondWithFilteredResult(_0x544ba6,_0x1c3cd9))[_0x6704('0x28')](handleError(_0x544ba6,null));};exports['show']=function(_0x1b9d36,_0x17a98a){var _0x3fc9be={'raw':![],'where':{'id':_0x1b9d36[_0x6704('0x4e')]['id']}},_0x282a46={};_0x282a46[_0x6704('0x37')]=_['keys'](db[_0x6704('0x35')]['rawAttributes']);_0x282a46[_0x6704('0x39')]=_['keys'](_0x1b9d36[_0x6704('0x39')]);_0x282a46['filters']=_['intersection'](_0x282a46[_0x6704('0x37')],_0x282a46[_0x6704('0x39')]);_0x3fc9be[_0x6704('0x3c')]=_[_0x6704('0x3a')](_0x282a46[_0x6704('0x37')],qs[_0x6704('0x3b')](_0x1b9d36['query']['fields']));_0x3fc9be[_0x6704('0x3c')]=_0x3fc9be[_0x6704('0x3c')][_0x6704('0x3d')]?_0x3fc9be[_0x6704('0x3c')]:_0x282a46[_0x6704('0x37')];if(_0x1b9d36[_0x6704('0x39')][_0x6704('0x4f')]){_0x3fc9be[_0x6704('0x4c')]=[{'all':!![]}];}_0x3fc9be=_[_0x6704('0x49')]({},_0x3fc9be,_0x1b9d36[_0x6704('0x4a')]);return db[_0x6704('0x35')][_0x6704('0x50')](_0x3fc9be)[_0x6704('0x1d')](handleEntityNotFound(_0x17a98a,null))[_0x6704('0x1d')](respondWithResult(_0x17a98a,null))[_0x6704('0x28')](handleError(_0x17a98a,null));};exports[_0x6704('0x51')]=function(_0x2c3a9b,_0x493083){return db['SugarcrmAccount'][_0x6704('0x51')](_0x2c3a9b[_0x6704('0x52')],{})[_0x6704('0x1d')](respondWithResult(_0x493083,0xc9))[_0x6704('0x28')](handleError(_0x493083,null));};exports['update']=function(_0x1cd145,_0x2670de){if(_0x1cd145[_0x6704('0x52')]['id']){delete _0x1cd145[_0x6704('0x52')]['id'];}return db['SugarcrmAccount'][_0x6704('0x50')]({'where':{'id':_0x1cd145[_0x6704('0x4e')]['id']}})[_0x6704('0x1d')](handleEntityNotFound(_0x2670de,null))[_0x6704('0x1d')](saveUpdates(_0x1cd145['body'],null))['then'](respondWithResult(_0x2670de,null))[_0x6704('0x28')](handleError(_0x2670de,null));};exports[_0x6704('0x31')]=function(_0x1ba23f,_0xe9ae9a){return db[_0x6704('0x35')][_0x6704('0x50')]({'where':{'id':_0x1ba23f['params']['id']}})[_0x6704('0x1d')](handleEntityNotFound(_0xe9ae9a,null))['then'](removeEntity(_0xe9ae9a,null))[_0x6704('0x28')](handleError(_0xe9ae9a,null));};exports['getConfigurations']=function(_0x5034be,_0x2e23d3,_0x2d1603){var _0x18003e={};var _0xedf7ac={};var _0x1514c5;var _0x340287;return db['SugarcrmAccount']['findOne']({'where':{'id':_0x5034be[_0x6704('0x4e')]['id']}})[_0x6704('0x1d')](handleEntityNotFound(_0x2e23d3,null))[_0x6704('0x1d')](function(_0x1fdc85){if(_0x1fdc85){_0x1514c5=_0x1fdc85;_0xedf7ac[_0x6704('0x37')]=_[_0x6704('0x38')](db['SugarcrmConfiguration'][_0x6704('0x36')]);_0xedf7ac[_0x6704('0x39')]=_[_0x6704('0x38')](_0x5034be[_0x6704('0x39')]);_0xedf7ac[_0x6704('0x44')]=_[_0x6704('0x3a')](_0xedf7ac[_0x6704('0x37')],_0xedf7ac['query']);_0x18003e['attributes']=_[_0x6704('0x3a')](_0xedf7ac[_0x6704('0x37')],qs[_0x6704('0x3b')](_0x5034be['query']['fields']));_0x18003e[_0x6704('0x3c')]=_0x18003e[_0x6704('0x3c')][_0x6704('0x3d')]?_0x18003e[_0x6704('0x3c')]:_0xedf7ac['model'];_0x18003e[_0x6704('0x40')]=qs[_0x6704('0x41')](_0x5034be['query']['sort']);_0x18003e[_0x6704('0x42')]=qs[_0x6704('0x44')](_[_0x6704('0x43')](_0x5034be[_0x6704('0x39')],_0xedf7ac[_0x6704('0x44')]));if(_0x5034be[_0x6704('0x39')][_0x6704('0x48')]){_0x18003e['where']=_[_0x6704('0x49')](_0x18003e[_0x6704('0x42')],{'$or':_[_0x6704('0x53')](_0x18003e[_0x6704('0x3c')],function(_0x1ea6b2){var _0x283f22={};_0x283f22[_0x1ea6b2]={'$like':'%'+_0x5034be[_0x6704('0x39')][_0x6704('0x48')]+'%'};return _0x283f22;})});}_0x18003e=_[_0x6704('0x49')]({},_0x18003e,_0x5034be[_0x6704('0x4a')]);return _0x1514c5[_0x6704('0x54')](_0x18003e);}})[_0x6704('0x1d')](function(_0x3683c2){if(_0x3683c2){_0x340287=_0x3683c2[_0x6704('0x3d')];if(!_0x5034be[_0x6704('0x39')][_0x6704('0x55')](_0x6704('0x3e'))){_0x18003e[_0x6704('0x3f')]=qs[_0x6704('0x3f')](_0x5034be['query'][_0x6704('0x3f')]);_0x18003e[_0x6704('0x2c')]=qs[_0x6704('0x2c')](_0x5034be[_0x6704('0x39')]['offset']);}return _0x1514c5['getConfigurations'](_0x18003e);}})[_0x6704('0x1d')](function(_0x5b48a4){if(_0x5b48a4){return _0x5b48a4?{'count':_0x340287,'rows':_0x5b48a4}:null;}})['then'](respondWithResult(_0x2e23d3,null))[_0x6704('0x28')](handleError(_0x2e23d3,null));};exports['addConfiguration']=function(_0x3738ff,_0x574d48,_0xe9e169){if(_0x3738ff['body']['id']){delete _0x3738ff[_0x6704('0x52')]['id'];}return db[_0x6704('0x35')][_0x6704('0x56')]({'where':{'id':_0x3738ff['params']['id']}})['then'](handleEntityNotFound(_0x574d48,null))[_0x6704('0x1d')](function(_0x4edd74){if(_0x4edd74){_0x3738ff[_0x6704('0x52')]['AccountId']=_0x4edd74['id'];_0x3738ff[_0x6704('0x52')][_0x6704('0x57')]=integrations[_0x6704('0x58')](_0x3738ff[_0x6704('0x52')][_0x6704('0x59')],_0x3738ff[_0x6704('0x52')][_0x6704('0x5a')]);_0x3738ff[_0x6704('0x52')]['Descriptions']=integrations['getDescriptions'](_0x3738ff[_0x6704('0x52')][_0x6704('0x59')],_0x3738ff[_0x6704('0x52')][_0x6704('0x5a')]);return db[_0x6704('0x5b')]['create'](_0x3738ff[_0x6704('0x52')],{'include':[{'model':db[_0x6704('0x5c')],'as':_0x6704('0x57')},{'model':db[_0x6704('0x5c')],'as':_0x6704('0x5d')}]});}return null;})['then'](respondWithResult(_0x574d48,null))[_0x6704('0x28')](handleError(_0x574d48,null));};exports[_0x6704('0x5e')]=function(_0x17f66d,_0x53b1a7,_0x4f946a){var _0x2d25b3='';var _0x649254=['id',_0x6704('0x5f'),_0x6704('0x60'),'created_by','description','date_start',_0x6704('0x61'),_0x6704('0x62'),'parent_id','parent_type',_0x6704('0x63'),_0x6704('0x64')];return db[_0x6704('0x35')][_0x6704('0x56')]({'where':{'id':_0x17f66d[_0x6704('0x4e')]['id']},'attributes':['id','username',_0x6704('0x65'),_0x6704('0x66')]})[_0x6704('0x1d')](handleEntityNotFound(_0x53b1a7,null))[_0x6704('0x1d')](function(_0xdc2121){if(_0xdc2121){_0x2d25b3=_0xdc2121[_0x6704('0x66')];var _0x2f667e=_0x2d25b3[_0x6704('0x67')](-0x1);if(_0x2f667e==='/'){_0x2d25b3=_0x2d25b3[_0x6704('0x68')](0x0,_0x2d25b3['lastIndexOf'](_0x2f667e));}return rp({'method':_0x6704('0x69'),'uri':util[_0x6704('0x6a')](_0x6704('0x6b'),_0x2d25b3,_0x6704('0x6c')),'json':!![],'form':{'method':_0x6704('0x6d'),'input_type':'JSON','response_type':_0x6704('0x6e'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0xdc2121[_0x6704('0x6f')],'password':_0xdc2121[_0x6704('0x65')],'encryption':_0x6704('0x70')},'application':_0x6704('0x71')})}});}})[_0x6704('0x1d')](function(_0x2e2961){if(_0x2e2961&&_0x2e2961[_0x6704('0x5f')]!==_0x6704('0x72')&&_0x2e2961['name']!=='Password\x20Expired'){return rp({'method':_0x6704('0x69'),'uri':util[_0x6704('0x6a')](_0x6704('0x6b'),_0x2d25b3,_0x6704('0x6c')),'json':!![],'form':{'method':_0x6704('0x73'),'input_type':_0x6704('0x6e'),'response_type':'JSON','rest_data':JSON[_0x6704('0x22')]({'session':_0x2e2961['id'],'module_name':'Calls'})}})[_0x6704('0x1d')](function(_0x1ec0cc){if(_0x1ec0cc){var _0x174a1b=_[_0x6704('0x74')](_0x1ec0cc[_0x6704('0x75')]);_[_0x6704('0x76')](_0x174a1b,function(_0x35bbef){return _0x649254[_0x6704('0x77')](_0x35bbef[_0x6704('0x5f')]);});return{'count':_0x174a1b['length'],'rows':_[_0x6704('0x53')](_0x174a1b,function(_0x44f19f){return{'id':_0x44f19f[_0x6704('0x5f')],'name':_0x44f19f['label'],'custom':_[_0x6704('0x78')](_0x44f19f[_0x6704('0x5f')],'_c')?!![]:![],'options':_0x44f19f[_0x6704('0x4a')]?_[_0x6704('0x53')](_['values'](_0x44f19f['options']),function(_0x5ab147){return{'name':_0x5ab147['value'],'value':_0x5ab147[_0x6704('0x5f')]};}):[]};})};}})[_0x6704('0x1d')](respondWithResult(_0x53b1a7,null))[_0x6704('0x28')](function(_0x4fb5e2){var _0x35f9d5=_0x17f66d['query'][_0x6704('0x1a')]?0x1f4:_0x4fb5e2[_0x6704('0x79')]||0x1f4;logger[_0x6704('0x23')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x35f9d5,JSON['stringify'](_0x4fb5e2));delete _0x4fb5e2[_0x6704('0x5f')];if(_0x35f9d5===0x191){_0x35f9d5=0x190;}_0x53b1a7[_0x6704('0x2a')](_0x35f9d5)[_0x6704('0x33')](_0x17f66d['query'][_0x6704('0x1a')]?{'message':'Wrong\x20credentials','statusCode':_0x4fb5e2[_0x6704('0x79')]}:_0x4fb5e2);});}else{var _0x4d795e=0x1f4;_0x53b1a7[_0x6704('0x2a')](_0x4d795e)['send']({'message':_0x6704('0x7a'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xa498=['to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','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','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','apply','save','update','destroy','then','sendStatus','stack','name','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','SugarcrmAccount','findAll','rows','show','params','includeAll','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','AccountId','Subjects','getSubjects','channel','SugarcrmField','Descriptions','assigned_user_id','created_by','description','duration_hours','parent_id','parent_type','parent_name','direction','username','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','getFields','Wrong\x20credentials','send','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox'];(function(_0x4eb8e1,_0x52fb85){var _0x3a9f0a=function(_0x3b07fe){while(--_0x3b07fe){_0x4eb8e1['push'](_0x4eb8e1['shift']());}};_0x3a9f0a(++_0x52fb85);}(_0xa498,0x179));var _0x8a49=function(_0x409deb,_0x2b731){_0x409deb=_0x409deb-0x0;var _0x15a4f7=_0xa498[_0x409deb];return _0x15a4f7;};'use strict';var pdf=require(_0x8a49('0x0'));var emlformat=require(_0x8a49('0x1'));var rimraf=require(_0x8a49('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8a49('0x3'));var rp=require(_0x8a49('0x4'));var moment=require('moment');var BPromise=require(_0x8a49('0x5'));var Mustache=require(_0x8a49('0x6'));var util=require(_0x8a49('0x7'));var path=require(_0x8a49('0x8'));var sox=require(_0x8a49('0x9'));var csv=require(_0x8a49('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8a49('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8a49('0xc'));var deskjs=require(_0x8a49('0xd'));var toCsv=require(_0x8a49('0xa'));var querystring=require(_0x8a49('0xe'));var Papa=require(_0x8a49('0xf'));var Redis=require(_0x8a49('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8a49('0x11'));var hardwareService=require(_0x8a49('0x12'));var logger=require(_0x8a49('0x13'))(_0x8a49('0x14'));var utils=require(_0x8a49('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x8a49('0x16'));var client=jayson['client'][_0x8a49('0x17')]({'port':0x232a});function checkPasswordPattern(_0x5c7d24,_0x5afcb6,_0x6c9f58){if(_0x6c9f58){var _0x3091b5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3091b5['test'](_0x5afcb6)){return _0x5c7d24;}else{throw new Error(_0x8a49('0x18'));}}else{return _0x5c7d24;}}function respondWithRpcPromise(_0x3e4e73,_0x5dfabc,_0x212ae3,_0x424925){return new BPromise(function(_0x4a6aec,_0x1fdaf4){var _0x50a72d=_0x424925||client;return _0x50a72d[_0x8a49('0x19')](_0x3e4e73,_0x212ae3)['then'](function(_0x4db44c){logger['info'](_0x8a49('0x1a'),_0x5dfabc,_0x8a49('0x1b'));logger['debug'](_0x8a49('0x1c'),_0x5dfabc,_0x8a49('0x1b'),JSON[_0x8a49('0x1d')](_0x4db44c));if(_0x4db44c[_0x8a49('0x1e')]){if(_0x4db44c[_0x8a49('0x1e')][_0x8a49('0x1f')]===0x1f4){logger['error'](_0x8a49('0x1a'),_0x5dfabc,_0x4db44c['error'][_0x8a49('0x20')]);return _0x1fdaf4(_0x4db44c[_0x8a49('0x1e')]['message']);}logger['error'](_0x8a49('0x1a'),_0x5dfabc,_0x4db44c[_0x8a49('0x1e')][_0x8a49('0x20')]);return _0x4a6aec(_0x4db44c[_0x8a49('0x1e')][_0x8a49('0x20')]);}else{logger['info'](_0x8a49('0x1a'),_0x5dfabc,_0x8a49('0x1b'));_0x4a6aec(_0x4db44c[_0x8a49('0x21')][_0x8a49('0x20')]);}})[_0x8a49('0x22')](function(_0x19431c){logger[_0x8a49('0x1e')](_0x8a49('0x1a'),_0x5dfabc,_0x19431c);_0x1fdaf4(_0x19431c);});});}function respondWithStatusCode(_0x18189b,_0x3f9ea6){_0x3f9ea6=_0x3f9ea6||0xcc;return function(_0x493380){if(_0x493380){return _0x18189b['sendStatus'](_0x3f9ea6);}return _0x18189b[_0x8a49('0x23')](_0x3f9ea6)[_0x8a49('0x24')]();};}function respondWithResult(_0x5de9a2,_0x385a06){_0x385a06=_0x385a06||0xc8;return function(_0x1a8e0b){if(_0x1a8e0b){return _0x5de9a2[_0x8a49('0x23')](_0x385a06)[_0x8a49('0x25')](_0x1a8e0b);}};}function respondWithFilteredResult(_0x4d133e,_0x3e2788){return function(_0x1db3f5){if(_0x1db3f5){var _0x31f697=_0x1db3f5[_0x8a49('0x26')],_0x468bb6=_0x3e2788[_0x8a49('0x27')],_0x59e4a9=_0x3e2788[_0x8a49('0x27')]+_0x3e2788[_0x8a49('0x28')],_0x1dc14a;if(_0x59e4a9>=_0x31f697){_0x59e4a9=_0x31f697;_0x1dc14a=0xc8;}else{_0x1dc14a=0xce;}_0x4d133e[_0x8a49('0x23')](_0x1dc14a);return _0x4d133e[_0x8a49('0x29')]('Content-Range',_0x468bb6+'-'+_0x59e4a9+'/'+_0x31f697)['json'](_0x1db3f5);}return null;};}function patchUpdates(_0x37df1e){return function(_0x2855a0){try{jsonpatch[_0x8a49('0x2a')](_0x2855a0,_0x37df1e,!![]);}catch(_0x2c4ff1){return BPromise['reject'](_0x2c4ff1);}return _0x2855a0[_0x8a49('0x2b')]();};}function saveUpdates(_0x2dbf51,_0x38ca1e){return function(_0x1f8651){if(_0x1f8651){return _0x1f8651[_0x8a49('0x2c')](_0x2dbf51)['then'](function(_0x410756){return _0x410756;});}return null;};}function removeEntity(_0x53858c,_0x1d34e0){return function(_0x20b5ca){if(_0x20b5ca){return _0x20b5ca[_0x8a49('0x2d')]()[_0x8a49('0x2e')](function(){_0x53858c['status'](0xcc)[_0x8a49('0x24')]();});}};}function handleEntityNotFound(_0xf618f9,_0x11ec8a){return function(_0x3b8ecf){if(!_0x3b8ecf){_0xf618f9[_0x8a49('0x2f')](0x194);}return _0x3b8ecf;};}function handleError(_0x5e51e2,_0x2220cb){_0x2220cb=_0x2220cb||0x1f4;return function(_0x2ed4d6){logger[_0x8a49('0x1e')](_0x2ed4d6[_0x8a49('0x30')]);if(_0x2ed4d6['name']){delete _0x2ed4d6[_0x8a49('0x31')];}_0x5e51e2[_0x8a49('0x23')](_0x2220cb)['send'](_0x2ed4d6);};}exports['index']=function(_0x27aebc,_0x257def){var _0x4433a4={},_0x11f616={},_0x5f31b7={'count':0x0,'rows':[]};var _0x239ad5=db['SugarcrmAccount'][_0x8a49('0x32')];_0x11f616[_0x8a49('0x33')]=_[_0x8a49('0x34')](_0x239ad5);_0x11f616[_0x8a49('0x35')]=_[_0x8a49('0x34')](_0x27aebc[_0x8a49('0x35')]);_0x11f616[_0x8a49('0x36')]=_[_0x8a49('0x37')](_0x11f616[_0x8a49('0x33')],_0x11f616[_0x8a49('0x35')]);_0x4433a4['attributes']=_[_0x8a49('0x37')](_0x11f616[_0x8a49('0x33')],qs[_0x8a49('0x38')](_0x27aebc[_0x8a49('0x35')][_0x8a49('0x38')]));_0x4433a4[_0x8a49('0x39')]=_0x4433a4[_0x8a49('0x39')][_0x8a49('0x3a')]?_0x4433a4[_0x8a49('0x39')]:_0x11f616[_0x8a49('0x33')];if(!_0x27aebc[_0x8a49('0x35')]['hasOwnProperty'](_0x8a49('0x3b'))){_0x4433a4['limit']=qs[_0x8a49('0x28')](_0x27aebc[_0x8a49('0x35')][_0x8a49('0x28')]);_0x4433a4[_0x8a49('0x27')]=qs[_0x8a49('0x27')](_0x27aebc[_0x8a49('0x35')][_0x8a49('0x27')]);}_0x4433a4[_0x8a49('0x3c')]=qs[_0x8a49('0x3d')](_0x27aebc[_0x8a49('0x35')][_0x8a49('0x3d')]);_0x4433a4[_0x8a49('0x3e')]=qs[_0x8a49('0x36')](_[_0x8a49('0x3f')](_0x27aebc[_0x8a49('0x35')],_0x11f616['filters']));if(_0x27aebc['query'][_0x8a49('0x40')]){_0x4433a4[_0x8a49('0x3e')]=_[_0x8a49('0x41')](_0x4433a4['where'],{'$or':_[_0x8a49('0x42')](_0x239ad5,function(_0x549c52){if(_0x549c52[_0x8a49('0x43')][_0x8a49('0x44')]!==_0x8a49('0x45')){var _0x24cbe9={};_0x24cbe9[_0x549c52[_0x8a49('0x46')]]={'$like':'%'+_0x27aebc[_0x8a49('0x35')][_0x8a49('0x40')]+'%'};return _0x24cbe9;}})});}_0x4433a4=_[_0x8a49('0x41')]({},_0x4433a4,_0x27aebc[_0x8a49('0x47')]);var _0x1c7292={'where':_0x4433a4[_0x8a49('0x3e')]};return db['SugarcrmAccount'][_0x8a49('0x26')](_0x1c7292)[_0x8a49('0x2e')](function(_0x36c1d5){_0x5f31b7[_0x8a49('0x26')]=_0x36c1d5;if(_0x27aebc[_0x8a49('0x35')]['includeAll']){_0x4433a4[_0x8a49('0x48')]=[{'all':!![]}];}return db[_0x8a49('0x49')][_0x8a49('0x4a')](_0x4433a4);})['then'](function(_0x540879){_0x5f31b7[_0x8a49('0x4b')]=_0x540879;return _0x5f31b7;})[_0x8a49('0x2e')](respondWithFilteredResult(_0x257def,_0x4433a4))['catch'](handleError(_0x257def,null));};exports[_0x8a49('0x4c')]=function(_0x34aeb9,_0x3c7b36){var _0x191578={'raw':![],'where':{'id':_0x34aeb9[_0x8a49('0x4d')]['id']}},_0x9703d6={};_0x9703d6[_0x8a49('0x33')]=_[_0x8a49('0x34')](db[_0x8a49('0x49')][_0x8a49('0x32')]);_0x9703d6['query']=_['keys'](_0x34aeb9[_0x8a49('0x35')]);_0x9703d6[_0x8a49('0x36')]=_[_0x8a49('0x37')](_0x9703d6[_0x8a49('0x33')],_0x9703d6[_0x8a49('0x35')]);_0x191578[_0x8a49('0x39')]=_[_0x8a49('0x37')](_0x9703d6[_0x8a49('0x33')],qs[_0x8a49('0x38')](_0x34aeb9[_0x8a49('0x35')][_0x8a49('0x38')]));_0x191578[_0x8a49('0x39')]=_0x191578[_0x8a49('0x39')][_0x8a49('0x3a')]?_0x191578[_0x8a49('0x39')]:_0x9703d6['model'];if(_0x34aeb9[_0x8a49('0x35')][_0x8a49('0x4e')]){_0x191578[_0x8a49('0x48')]=[{'all':!![]}];}_0x191578=_[_0x8a49('0x41')]({},_0x191578,_0x34aeb9[_0x8a49('0x47')]);return db[_0x8a49('0x49')][_0x8a49('0x4f')](_0x191578)['then'](handleEntityNotFound(_0x3c7b36,null))['then'](respondWithResult(_0x3c7b36,null))['catch'](handleError(_0x3c7b36,null));};exports[_0x8a49('0x50')]=function(_0x4bc570,_0x3b19bb){return db[_0x8a49('0x49')][_0x8a49('0x50')](_0x4bc570[_0x8a49('0x51')],{})['then'](respondWithResult(_0x3b19bb,0xc9))['catch'](handleError(_0x3b19bb,null));};exports[_0x8a49('0x2c')]=function(_0x1cff38,_0x129a0b){if(_0x1cff38[_0x8a49('0x51')]['id']){delete _0x1cff38[_0x8a49('0x51')]['id'];}return db[_0x8a49('0x49')][_0x8a49('0x4f')]({'where':{'id':_0x1cff38['params']['id']}})[_0x8a49('0x2e')](handleEntityNotFound(_0x129a0b,null))[_0x8a49('0x2e')](saveUpdates(_0x1cff38['body'],null))[_0x8a49('0x2e')](respondWithResult(_0x129a0b,null))[_0x8a49('0x22')](handleError(_0x129a0b,null));};exports[_0x8a49('0x2d')]=function(_0x4c5d04,_0x4e2847){return db[_0x8a49('0x49')][_0x8a49('0x4f')]({'where':{'id':_0x4c5d04[_0x8a49('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4e2847,null))['then'](removeEntity(_0x4e2847,null))[_0x8a49('0x22')](handleError(_0x4e2847,null));};exports[_0x8a49('0x52')]=function(_0x267bad,_0xf802a0,_0x4c1c6b){var _0x3b1764={};var _0x24ed54={};var _0x157dd8;var _0x2e0696;return db[_0x8a49('0x49')][_0x8a49('0x53')]({'where':{'id':_0x267bad[_0x8a49('0x4d')]['id']}})[_0x8a49('0x2e')](handleEntityNotFound(_0xf802a0,null))[_0x8a49('0x2e')](function(_0x582019){if(_0x582019){_0x157dd8=_0x582019;_0x24ed54[_0x8a49('0x33')]=_[_0x8a49('0x34')](db[_0x8a49('0x54')][_0x8a49('0x32')]);_0x24ed54[_0x8a49('0x35')]=_[_0x8a49('0x34')](_0x267bad[_0x8a49('0x35')]);_0x24ed54['filters']=_[_0x8a49('0x37')](_0x24ed54[_0x8a49('0x33')],_0x24ed54['query']);_0x3b1764[_0x8a49('0x39')]=_[_0x8a49('0x37')](_0x24ed54[_0x8a49('0x33')],qs['fields'](_0x267bad[_0x8a49('0x35')][_0x8a49('0x38')]));_0x3b1764[_0x8a49('0x39')]=_0x3b1764[_0x8a49('0x39')][_0x8a49('0x3a')]?_0x3b1764[_0x8a49('0x39')]:_0x24ed54[_0x8a49('0x33')];_0x3b1764[_0x8a49('0x3c')]=qs['sort'](_0x267bad['query'][_0x8a49('0x3d')]);_0x3b1764[_0x8a49('0x3e')]=qs[_0x8a49('0x36')](_['pick'](_0x267bad['query'],_0x24ed54[_0x8a49('0x36')]));if(_0x267bad['query']['filter']){_0x3b1764[_0x8a49('0x3e')]=_[_0x8a49('0x41')](_0x3b1764[_0x8a49('0x3e')],{'$or':_['map'](_0x3b1764[_0x8a49('0x39')],function(_0x594387){var _0x30b493={};_0x30b493[_0x594387]={'$like':'%'+_0x267bad[_0x8a49('0x35')]['filter']+'%'};return _0x30b493;})});}_0x3b1764=_['merge']({},_0x3b1764,_0x267bad[_0x8a49('0x47')]);return _0x157dd8['getConfigurations'](_0x3b1764);}})[_0x8a49('0x2e')](function(_0x46a470){if(_0x46a470){_0x2e0696=_0x46a470['length'];if(!_0x267bad[_0x8a49('0x35')]['hasOwnProperty'](_0x8a49('0x3b'))){_0x3b1764[_0x8a49('0x28')]=qs[_0x8a49('0x28')](_0x267bad[_0x8a49('0x35')]['limit']);_0x3b1764[_0x8a49('0x27')]=qs['offset'](_0x267bad[_0x8a49('0x35')][_0x8a49('0x27')]);}return _0x157dd8[_0x8a49('0x52')](_0x3b1764);}})['then'](function(_0x3504b7){if(_0x3504b7){return _0x3504b7?{'count':_0x2e0696,'rows':_0x3504b7}:null;}})[_0x8a49('0x2e')](respondWithResult(_0xf802a0,null))[_0x8a49('0x22')](handleError(_0xf802a0,null));};exports['addConfiguration']=function(_0x1ca743,_0x28b13d,_0x8d06ae){if(_0x1ca743['body']['id']){delete _0x1ca743[_0x8a49('0x51')]['id'];}return db[_0x8a49('0x49')][_0x8a49('0x53')]({'where':{'id':_0x1ca743[_0x8a49('0x4d')]['id']}})['then'](handleEntityNotFound(_0x28b13d,null))['then'](function(_0x4bb73c){if(_0x4bb73c){_0x1ca743['body'][_0x8a49('0x55')]=_0x4bb73c['id'];_0x1ca743['body'][_0x8a49('0x56')]=integrations[_0x8a49('0x57')](_0x1ca743[_0x8a49('0x51')]['channel'],_0x1ca743[_0x8a49('0x51')][_0x8a49('0x43')]);_0x1ca743[_0x8a49('0x51')]['Descriptions']=integrations['getDescriptions'](_0x1ca743['body'][_0x8a49('0x58')],_0x1ca743[_0x8a49('0x51')][_0x8a49('0x43')]);return db[_0x8a49('0x54')][_0x8a49('0x50')](_0x1ca743[_0x8a49('0x51')],{'include':[{'model':db[_0x8a49('0x59')],'as':'Subjects'},{'model':db[_0x8a49('0x59')],'as':_0x8a49('0x5a')}]});}return null;})[_0x8a49('0x2e')](respondWithResult(_0x28b13d,null))[_0x8a49('0x22')](handleError(_0x28b13d,null));};exports['getFields']=function(_0x41292b,_0x2a81cf,_0x4bd041){var _0x40b0fd='';var _0xb03729=['id',_0x8a49('0x31'),_0x8a49('0x5b'),_0x8a49('0x5c'),_0x8a49('0x5d'),'date_start',_0x8a49('0x5e'),'duration_minutes',_0x8a49('0x5f'),_0x8a49('0x60'),_0x8a49('0x61'),_0x8a49('0x62')];return db[_0x8a49('0x49')]['findOne']({'where':{'id':_0x41292b[_0x8a49('0x4d')]['id']},'attributes':['id',_0x8a49('0x63'),'password','remoteUri']})[_0x8a49('0x2e')](handleEntityNotFound(_0x2a81cf,null))[_0x8a49('0x2e')](function(_0x3ce928){if(_0x3ce928){_0x40b0fd=_0x3ce928[_0x8a49('0x64')];var _0x433ef2=_0x40b0fd[_0x8a49('0x65')](-0x1);if(_0x433ef2==='/'){_0x40b0fd=_0x40b0fd[_0x8a49('0x66')](0x0,_0x40b0fd[_0x8a49('0x67')](_0x433ef2));}return rp({'method':_0x8a49('0x68'),'uri':util[_0x8a49('0x69')](_0x8a49('0x6a'),_0x40b0fd,_0x8a49('0x6b')),'json':!![],'form':{'method':_0x8a49('0x6c'),'input_type':_0x8a49('0x6d'),'response_type':_0x8a49('0x6d'),'rest_data':JSON[_0x8a49('0x1d')]({'user_auth':{'user_name':_0x3ce928['username'],'password':_0x3ce928[_0x8a49('0x6e')],'encryption':_0x8a49('0x6f')},'application':_0x8a49('0x70')})}});}})[_0x8a49('0x2e')](function(_0x481371){if(_0x481371&&_0x481371[_0x8a49('0x31')]!==_0x8a49('0x71')&&_0x481371[_0x8a49('0x31')]!==_0x8a49('0x72')){return rp({'method':_0x8a49('0x68'),'uri':util[_0x8a49('0x69')](_0x8a49('0x6a'),_0x40b0fd,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x8a49('0x73'),'input_type':'JSON','response_type':_0x8a49('0x6d'),'rest_data':JSON[_0x8a49('0x1d')]({'session':_0x481371['id'],'module_name':_0x8a49('0x74')})}})[_0x8a49('0x2e')](function(_0x1cc2ac){if(_0x1cc2ac){var _0x392112=_[_0x8a49('0x75')](_0x1cc2ac[_0x8a49('0x76')]);_[_0x8a49('0x77')](_0x392112,function(_0x2da358){return _0xb03729[_0x8a49('0x78')](_0x2da358[_0x8a49('0x31')]);});return{'count':_0x392112[_0x8a49('0x3a')],'rows':_['map'](_0x392112,function(_0xd3e19){return{'id':_0xd3e19[_0x8a49('0x31')],'name':_0xd3e19[_0x8a49('0x79')],'custom':_[_0x8a49('0x7a')](_0xd3e19[_0x8a49('0x31')],'_c')?!![]:![],'options':_0xd3e19[_0x8a49('0x47')]?_[_0x8a49('0x42')](_[_0x8a49('0x75')](_0xd3e19[_0x8a49('0x47')]),function(_0x6c248){return{'name':_0x6c248[_0x8a49('0x7b')],'value':_0x6c248['name']};}):[]};})};}})['then'](respondWithResult(_0x2a81cf,null))[_0x8a49('0x22')](function(_0x31e495){var _0x24fc82=_0x41292b[_0x8a49('0x35')][_0x8a49('0x7c')]?0x1f4:_0x31e495[_0x8a49('0x7d')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x8a49('0x7e'),_0x24fc82,JSON[_0x8a49('0x1d')](_0x31e495));delete _0x31e495[_0x8a49('0x31')];if(_0x24fc82===0x191){_0x24fc82=0x190;}_0x2a81cf[_0x8a49('0x23')](_0x24fc82)['send'](_0x41292b[_0x8a49('0x35')][_0x8a49('0x7c')]?{'message':_0x8a49('0x7f'),'statusCode':_0x31e495[_0x8a49('0x7d')]}:_0x31e495);});}else{var _0x359f37=0x1f4;_0x2a81cf[_0x8a49('0x23')](_0x359f37)[_0x8a49('0x80')]({'message':_0x8a49('0x7f'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index e4f1cee..5a74a61 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 _0xb13e=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount','util'];(function(_0x588567,_0x14dd60){var _0x9420fb=function(_0x140e2b){while(--_0x140e2b){_0x588567['push'](_0x588567['shift']());}};_0x9420fb(++_0x14dd60);}(_0xb13e,0x107));var _0xeb13=function(_0x5d1b6c,_0xcdc41a){_0x5d1b6c=_0x5d1b6c-0x0;var _0x3cb9a5=_0xb13e[_0x5d1b6c];return _0x3cb9a5;};'use strict';var _=require('lodash');var util=require(_0xeb13('0x0'));var logger=require(_0xeb13('0x1'))('api');var moment=require(_0xeb13('0x2'));var BPromise=require(_0xeb13('0x3'));var rp=require(_0xeb13('0x4'));var fs=require('fs');var path=require(_0xeb13('0x5'));var rimraf=require(_0xeb13('0x6'));var config=require(_0xeb13('0x7'));var attributes=require(_0xeb13('0x8'));var integrations=require(_0xeb13('0x9'));module[_0xeb13('0xa')]=function(_0x2df3be,_0x52aca0){return _0x2df3be['define'](_0xeb13('0xb'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2e5=['SugarcrmAccount','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0xa4b2cf,_0x68a28){var _0xf1584a=function(_0x30e8e6){while(--_0x30e8e6){_0xa4b2cf['push'](_0xa4b2cf['shift']());}};_0xf1584a(++_0x68a28);}(_0xd2e5,0xe7));var _0x5d2e=function(_0x23347e,_0x350e6c){_0x23347e=_0x23347e-0x0;var _0x24efed=_0xd2e5[_0x23347e];return _0x24efed;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5d2e('0x0'));var BPromise=require(_0x5d2e('0x1'));var rp=require(_0x5d2e('0x2'));var fs=require('fs');var path=require(_0x5d2e('0x3'));var rimraf=require('rimraf');var config=require(_0x5d2e('0x4'));var attributes=require(_0x5d2e('0x5'));var integrations=require(_0x5d2e('0x6'));module[_0x5d2e('0x7')]=function(_0x329c5f,_0x147e33){return _0x329c5f[_0x5d2e('0x8')](_0x5d2e('0x9'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 9be6100..3e25d4e 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 _0xe458=['SugarcrmAccount','ShowSugarcrmAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SugarcrmAccount,\x20%s,\x20%s','info','result','catch','GetSugarcrmAccount','findAll','options','raw','where','attributes','include','map','model','then'];(function(_0x4f83e4,_0x483a7f){var _0x3a4c13=function(_0x3f94d9){while(--_0x3f94d9){_0x4f83e4['push'](_0x4f83e4['shift']());}};_0x3a4c13(++_0x483a7f);}(_0xe458,0x160));var _0x8e45=function(_0x446c12,_0x4091be){_0x446c12=_0x446c12-0x0;var _0x5f0fb6=_0xe458[_0x446c12];return _0x5f0fb6;};'use strict';var _=require(_0x8e45('0x0'));var util=require(_0x8e45('0x1'));var moment=require('moment');var BPromise=require(_0x8e45('0x2'));var rs=require(_0x8e45('0x3'));var fs=require('fs');var Redis=require(_0x8e45('0x4'));var db=require(_0x8e45('0x5'))['db'];var utils=require(_0x8e45('0x6'));var logger=require(_0x8e45('0x7'))(_0x8e45('0x8'));var config=require(_0x8e45('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8e45('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a92a1,_0x3a646f,_0x37cde4){return new BPromise(function(_0x27433a,_0x1f60da){return client[_0x8e45('0xb')](_0x3a92a1,_0x37cde4)['then'](function(_0x59886a){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x3a646f,_0x8e45('0xc'));logger[_0x8e45('0xd')](_0x8e45('0xe'),_0x3a646f,'request\x20sent',JSON[_0x8e45('0xf')](_0x59886a));if(_0x59886a[_0x8e45('0x10')]){if(_0x59886a['error'][_0x8e45('0x11')]===0x1f4){logger[_0x8e45('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x3a646f,_0x59886a[_0x8e45('0x10')][_0x8e45('0x12')]);return _0x1f60da(_0x59886a['error'][_0x8e45('0x12')]);}logger[_0x8e45('0x10')](_0x8e45('0x13'),_0x3a646f,_0x59886a['error'][_0x8e45('0x12')]);return _0x27433a(_0x59886a[_0x8e45('0x10')][_0x8e45('0x12')]);}else{logger[_0x8e45('0x14')](_0x8e45('0x13'),_0x3a646f,_0x8e45('0xc'));_0x27433a(_0x59886a[_0x8e45('0x15')][_0x8e45('0x12')]);}})[_0x8e45('0x16')](function(_0x23071d){logger[_0x8e45('0x10')](_0x8e45('0x13'),_0x3a646f,_0x23071d);_0x1f60da(_0x23071d);});});}exports[_0x8e45('0x17')]=function(_0x3521ff){var _0x88e7e3=this;return new Promise(function(_0x402848,_0xfca7b5){return db['SugarcrmAccount'][_0x8e45('0x18')]({'raw':_0x3521ff[_0x8e45('0x19')]?_0x3521ff[_0x8e45('0x19')][_0x8e45('0x1a')]===undefined?!![]:![]:!![],'where':_0x3521ff[_0x8e45('0x19')]?_0x3521ff['options'][_0x8e45('0x1b')]||null:null,'attributes':_0x3521ff[_0x8e45('0x19')]?_0x3521ff[_0x8e45('0x19')][_0x8e45('0x1c')]||null:null,'limit':_0x3521ff['options']?_0x3521ff[_0x8e45('0x19')]['limit']||null:null,'include':_0x3521ff[_0x8e45('0x19')]?_0x3521ff[_0x8e45('0x19')][_0x8e45('0x1d')]?_[_0x8e45('0x1e')](_0x3521ff[_0x8e45('0x19')][_0x8e45('0x1d')],function(_0x135b8d){return{'model':db[_0x135b8d[_0x8e45('0x1f')]],'as':_0x135b8d['as'],'attributes':_0x135b8d[_0x8e45('0x1c')],'include':_0x135b8d[_0x8e45('0x1d')]?_[_0x8e45('0x1e')](_0x135b8d[_0x8e45('0x1d')],function(_0x224695){return{'model':db[_0x224695['model']],'as':_0x224695['as'],'attributes':_0x224695[_0x8e45('0x1c')],'include':_0x224695[_0x8e45('0x1d')]?_[_0x8e45('0x1e')](_0x224695[_0x8e45('0x1d')],function(_0x33f40b){return{'model':db[_0x33f40b[_0x8e45('0x1f')]],'as':_0x33f40b['as'],'attributes':_0x33f40b[_0x8e45('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8e45('0x20')](function(_0x3be24d){logger['info'](_0x8e45('0x17'),_0x3521ff);logger['debug'](_0x8e45('0x17'),_0x3521ff,JSON[_0x8e45('0xf')](_0x3be24d));_0x402848(_0x3be24d);})['catch'](function(_0x185021){logger[_0x8e45('0x10')](_0x8e45('0x17'),_0x185021[_0x8e45('0x12')],_0x3521ff);_0xfca7b5(_0x88e7e3[_0x8e45('0x10')](0x1f4,_0x185021[_0x8e45('0x12')]));});});};exports['ShowSugarcrmAccount']=function(_0x330cba){var _0x313d41=this;return new Promise(function(_0x572a98,_0x58aa8b){return db[_0x8e45('0x21')]['find']({'raw':_0x330cba['options']?_0x330cba['options']['raw']===undefined?!![]:![]:!![],'where':_0x330cba[_0x8e45('0x19')]?_0x330cba['options'][_0x8e45('0x1b')]||null:null,'attributes':_0x330cba[_0x8e45('0x19')]?_0x330cba[_0x8e45('0x19')][_0x8e45('0x1c')]||null:null,'include':_0x330cba[_0x8e45('0x19')]?_0x330cba[_0x8e45('0x19')][_0x8e45('0x1d')]?_[_0x8e45('0x1e')](_0x330cba[_0x8e45('0x19')][_0x8e45('0x1d')],function(_0x292323){return{'model':db[_0x292323['model']],'as':_0x292323['as'],'attributes':_0x292323[_0x8e45('0x1c')],'include':_0x292323[_0x8e45('0x1d')]?_[_0x8e45('0x1e')](_0x292323['include'],function(_0x1375ec){return{'model':db[_0x1375ec[_0x8e45('0x1f')]],'as':_0x1375ec['as'],'attributes':_0x1375ec[_0x8e45('0x1c')],'include':_0x1375ec[_0x8e45('0x1d')]?_[_0x8e45('0x1e')](_0x1375ec[_0x8e45('0x1d')],function(_0x386c19){return{'model':db[_0x386c19[_0x8e45('0x1f')]],'as':_0x386c19['as'],'attributes':_0x386c19[_0x8e45('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d3f90){logger[_0x8e45('0x14')](_0x8e45('0x22'),_0x330cba);logger[_0x8e45('0xd')]('ShowSugarcrmAccount',_0x330cba,JSON['stringify'](_0x4d3f90));_0x572a98(_0x4d3f90);})[_0x8e45('0x16')](function(_0x26290b){logger[_0x8e45('0x10')](_0x8e45('0x22'),_0x26290b[_0x8e45('0x12')],_0x330cba);_0x58aa8b(_0x313d41[_0x8e45('0x10')](0x1f4,_0x26290b[_0x8e45('0x12')]));});});}; \ No newline at end of file +var _0x8913=['code','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','limit','include','map','model','stringify','catch','ShowSugarcrmAccount','find','raw','debug','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error'];(function(_0x1478c4,_0x221222){var _0xa2f2d1=function(_0x130c9c){while(--_0x130c9c){_0x1478c4['push'](_0x1478c4['shift']());}};_0xa2f2d1(++_0x221222);}(_0x8913,0x123));var _0x3891=function(_0x33546f,_0x543484){_0x33546f=_0x33546f-0x0;var _0x349647=_0x8913[_0x33546f];return _0x349647;};'use strict';var _=require(_0x3891('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3891('0x1'));var rs=require(_0x3891('0x2'));var fs=require('fs');var Redis=require(_0x3891('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3891('0x4'))(_0x3891('0x5'));var config=require(_0x3891('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3891('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d0554,_0x4c6569,_0x5be23f){return new BPromise(function(_0x4028cb,_0xe99e8c){return client[_0x3891('0x8')](_0x3d0554,_0x5be23f)[_0x3891('0x9')](function(_0x71328f){logger[_0x3891('0xa')](_0x3891('0xb'),_0x4c6569,_0x3891('0xc'));logger['debug'](_0x3891('0xd'),_0x4c6569,_0x3891('0xc'),JSON['stringify'](_0x71328f));if(_0x71328f[_0x3891('0xe')]){if(_0x71328f[_0x3891('0xe')][_0x3891('0xf')]===0x1f4){logger[_0x3891('0xe')](_0x3891('0xb'),_0x4c6569,_0x71328f['error'][_0x3891('0x10')]);return _0xe99e8c(_0x71328f[_0x3891('0xe')][_0x3891('0x10')]);}logger['error'](_0x3891('0xb'),_0x4c6569,_0x71328f[_0x3891('0xe')][_0x3891('0x10')]);return _0x4028cb(_0x71328f[_0x3891('0xe')][_0x3891('0x10')]);}else{logger[_0x3891('0xa')](_0x3891('0xb'),_0x4c6569,'request\x20sent');_0x4028cb(_0x71328f[_0x3891('0x11')][_0x3891('0x10')]);}})['catch'](function(_0x22b73c){logger[_0x3891('0xe')](_0x3891('0xb'),_0x4c6569,_0x22b73c);_0xe99e8c(_0x22b73c);});});}exports[_0x3891('0x12')]=function(_0x502a13){var _0x582300=this;return new Promise(function(_0x1419df,_0x1abb11){return db[_0x3891('0x13')][_0x3891('0x14')]({'raw':_0x502a13[_0x3891('0x15')]?_0x502a13[_0x3891('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x502a13[_0x3891('0x15')]?_0x502a13[_0x3891('0x15')][_0x3891('0x16')]||null:null,'attributes':_0x502a13[_0x3891('0x15')]?_0x502a13[_0x3891('0x15')][_0x3891('0x17')]||null:null,'limit':_0x502a13['options']?_0x502a13[_0x3891('0x15')][_0x3891('0x18')]||null:null,'include':_0x502a13['options']?_0x502a13[_0x3891('0x15')][_0x3891('0x19')]?_[_0x3891('0x1a')](_0x502a13[_0x3891('0x15')][_0x3891('0x19')],function(_0x27f2ec){return{'model':db[_0x27f2ec['model']],'as':_0x27f2ec['as'],'attributes':_0x27f2ec['attributes'],'include':_0x27f2ec[_0x3891('0x19')]?_[_0x3891('0x1a')](_0x27f2ec[_0x3891('0x19')],function(_0x98e78){return{'model':db[_0x98e78[_0x3891('0x1b')]],'as':_0x98e78['as'],'attributes':_0x98e78['attributes'],'include':_0x98e78[_0x3891('0x19')]?_[_0x3891('0x1a')](_0x98e78[_0x3891('0x19')],function(_0x579234){return{'model':db[_0x579234[_0x3891('0x1b')]],'as':_0x579234['as'],'attributes':_0x579234[_0x3891('0x17')]};}):[]};}):[]};}):[]:[]})[_0x3891('0x9')](function(_0x98b8f0){logger[_0x3891('0xa')](_0x3891('0x12'),_0x502a13);logger['debug'](_0x3891('0x12'),_0x502a13,JSON[_0x3891('0x1c')](_0x98b8f0));_0x1419df(_0x98b8f0);})[_0x3891('0x1d')](function(_0x2f99a6){logger[_0x3891('0xe')](_0x3891('0x12'),_0x2f99a6[_0x3891('0x10')],_0x502a13);_0x1abb11(_0x582300[_0x3891('0xe')](0x1f4,_0x2f99a6['message']));});});};exports[_0x3891('0x1e')]=function(_0x4c0b1b){var _0x4b099f=this;return new Promise(function(_0x8306ad,_0x1b3072){return db[_0x3891('0x13')][_0x3891('0x1f')]({'raw':_0x4c0b1b['options']?_0x4c0b1b[_0x3891('0x15')][_0x3891('0x20')]===undefined?!![]:![]:!![],'where':_0x4c0b1b[_0x3891('0x15')]?_0x4c0b1b[_0x3891('0x15')][_0x3891('0x16')]||null:null,'attributes':_0x4c0b1b[_0x3891('0x15')]?_0x4c0b1b[_0x3891('0x15')][_0x3891('0x17')]||null:null,'include':_0x4c0b1b[_0x3891('0x15')]?_0x4c0b1b['options'][_0x3891('0x19')]?_['map'](_0x4c0b1b[_0x3891('0x15')][_0x3891('0x19')],function(_0x54d059){return{'model':db[_0x54d059[_0x3891('0x1b')]],'as':_0x54d059['as'],'attributes':_0x54d059[_0x3891('0x17')],'include':_0x54d059['include']?_[_0x3891('0x1a')](_0x54d059[_0x3891('0x19')],function(_0xd55191){return{'model':db[_0xd55191[_0x3891('0x1b')]],'as':_0xd55191['as'],'attributes':_0xd55191[_0x3891('0x17')],'include':_0xd55191['include']?_['map'](_0xd55191['include'],function(_0x457c60){return{'model':db[_0x457c60['model']],'as':_0x457c60['as'],'attributes':_0x457c60[_0x3891('0x17')]};}):[]};}):[]};}):[]:[]})[_0x3891('0x9')](function(_0x2c1ed6){logger[_0x3891('0xa')](_0x3891('0x1e'),_0x4c0b1b);logger[_0x3891('0x21')](_0x3891('0x1e'),_0x4c0b1b,JSON[_0x3891('0x1c')](_0x2c1ed6));_0x8306ad(_0x2c1ed6);})[_0x3891('0x1d')](function(_0x2b8838){logger[_0x3891('0xe')](_0x3891('0x1e'),_0x2b8838[_0x3891('0x10')],_0x4c0b1b);_0x1b3072(_0x4b099f['error'](0x1f4,_0x2b8838['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 15ecefa..90afaa6 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 _0x6efe=['destroy','util','connect-timeout','express','Router','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','get','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','/:id'];(function(_0x806f92,_0x26c99a){var _0x470e6c=function(_0x3322d6){while(--_0x3322d6){_0x806f92['push'](_0x806f92['shift']());}};_0x470e6c(++_0x26c99a);}(_0x6efe,0x1a5));var _0xe6ef=function(_0x2a9b1b,_0x18dbd7){_0x2a9b1b=_0x2a9b1b-0x0;var _0x3d9552=_0x6efe[_0x2a9b1b];return _0x3d9552;};'use strict';var multer=require('multer');var util=require(_0xe6ef('0x0'));var path=require('path');var timeout=require(_0xe6ef('0x1'));var express=require(_0xe6ef('0x2'));var router=express[_0xe6ef('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe6ef('0x4'));var controller=require(_0xe6ef('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xe6ef('0x6')](),controller['show']);router[_0xe6ef('0x7')](_0xe6ef('0x8'),auth['isAuthenticated'](),controller['getFields']);router[_0xe6ef('0x7')](_0xe6ef('0x9'),auth[_0xe6ef('0x6')](),controller[_0xe6ef('0xa')]);router['get'](_0xe6ef('0xb'),auth[_0xe6ef('0x6')](),controller[_0xe6ef('0xc')]);router[_0xe6ef('0xd')]('/',auth['isAuthenticated'](),controller[_0xe6ef('0xe')]);router[_0xe6ef('0xf')]('/:id',auth[_0xe6ef('0x6')](),controller[_0xe6ef('0x10')]);router[_0xe6ef('0x11')](_0xe6ef('0x12'),auth['isAuthenticated'](),controller[_0xe6ef('0x13')]);module['exports']=router; \ No newline at end of file +var _0x8ba1=['../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','put','update','destroy','exports','util','path','express','Router'];(function(_0x41bfbe,_0x5eebff){var _0x470d5c=function(_0x2bd839){while(--_0x2bd839){_0x41bfbe['push'](_0x41bfbe['shift']());}};_0x470d5c(++_0x5eebff);}(_0x8ba1,0x19e));var _0x18ba=function(_0x1da52a,_0x5ddec3){_0x1da52a=_0x1da52a-0x0;var _0x2f3dc9=_0x8ba1[_0x1da52a];return _0x2f3dc9;};'use strict';var multer=require('multer');var util=require(_0x18ba('0x0'));var path=require(_0x18ba('0x1'));var timeout=require('connect-timeout');var express=require(_0x18ba('0x2'));var router=express[_0x18ba('0x3')]();var auth=require(_0x18ba('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x18ba('0x5'));var controller=require(_0x18ba('0x6'));router['get']('/',auth[_0x18ba('0x7')](),controller[_0x18ba('0x8')]);router[_0x18ba('0x9')](_0x18ba('0xa'),auth[_0x18ba('0x7')](),controller[_0x18ba('0xb')]);router[_0x18ba('0x9')](_0x18ba('0xc'),auth['isAuthenticated'](),controller[_0x18ba('0xd')]);router[_0x18ba('0x9')](_0x18ba('0xe'),auth[_0x18ba('0x7')](),controller[_0x18ba('0xf')]);router[_0x18ba('0x9')](_0x18ba('0x10'),auth[_0x18ba('0x7')](),controller['getDescriptions']);router[_0x18ba('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x18ba('0x12')](_0x18ba('0xa'),auth[_0x18ba('0x7')](),controller[_0x18ba('0x13')]);router['delete'](_0x18ba('0xa'),auth[_0x18ba('0x7')](),controller[_0x18ba('0x14')]);module[_0x18ba('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 1d34c70..797a1f0 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 _0x89f6=['STRING','sequelize','exports'];(function(_0x4f270b,_0x1a70da){var _0x35090a=function(_0x2c6964){while(--_0x2c6964){_0x4f270b['push'](_0x4f270b['shift']());}};_0x35090a(++_0x1a70da);}(_0x89f6,0xe5));var _0x689f=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x89f6[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x689f('0x0'));module[_0x689f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x689f('0x2')]}}; \ No newline at end of file +var _0x1fe3=['STRING','sequelize','exports'];(function(_0x4ccbc8,_0x1c17e7){var _0x111b32=function(_0x8bde49){while(--_0x8bde49){_0x4ccbc8['push'](_0x4ccbc8['shift']());}};_0x111b32(++_0x1c17e7);}(_0x1fe3,0x19f));var _0x31fe=function(_0x5c73fb,_0x4ed02c){_0x5c73fb=_0x5c73fb-0x0;var _0x5b320d=_0x1fe3[_0x5c73fb];return _0x5b320d;};'use strict';var Sequelize=require(_0x31fe('0x0'));module[_0x31fe('0x1')]={'name':{'type':Sequelize[_0x31fe('0x2')]},'description':{'type':Sequelize[_0x31fe('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index cbbe94b..8873766 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 _0x31f8=['squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','stack','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','key','VIRTUAL','field','merge','options','SugarcrmConfiguration','count','includeAll','include','findAll','params','find','catch','create','body','destroy','getFields','findOne','SugarcrmField','map','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x537be1,_0x35870f){var _0xa7590a=function(_0x53bdb0){while(--_0x53bdb0){_0x537be1['push'](_0x537be1['shift']());}};_0xa7590a(++_0x35870f);}(_0x31f8,0x101));var _0x831f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x31f8[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x831f('0x0'));var emlformat=require(_0x831f('0x1'));var rimraf=require(_0x831f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x831f('0x3'));var rp=require('request-promise');var moment=require(_0x831f('0x4'));var BPromise=require(_0x831f('0x5'));var Mustache=require(_0x831f('0x6'));var util=require('util');var path=require(_0x831f('0x7'));var sox=require(_0x831f('0x8'));var csv=require(_0x831f('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x831f('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x831f('0xb'));var toCsv=require(_0x831f('0x9'));var querystring=require(_0x831f('0xc'));var Papa=require('papaparse');var Redis=require(_0x831f('0xd'));var authService=require(_0x831f('0xe'));var qs=require(_0x831f('0xf'));var hardwareService=require(_0x831f('0x10'));var logger=require(_0x831f('0x11'))('api');var utils=require(_0x831f('0x12'));var config=require(_0x831f('0x13'));var db=require(_0x831f('0x14'))['db'];var jayson=require(_0x831f('0x15'));var client=jayson['client'][_0x831f('0x16')]({'port':0x232a});function checkPasswordPattern(_0x5536d4,_0x1da153,_0xabd784){if(_0xabd784){var _0x37bf68=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x37bf68['test'](_0x1da153)){return _0x5536d4;}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 _0x5536d4;}}function respondWithRpcPromise(_0x45d418,_0x26ef25,_0x962f81,_0x1b04e3){return new BPromise(function(_0x4a3f48,_0x495c53){var _0xde94da=_0x1b04e3||client;return _0xde94da[_0x831f('0x17')](_0x45d418,_0x962f81)['then'](function(_0x45b62b){logger[_0x831f('0x18')](_0x831f('0x19'),_0x26ef25,'request\x20sent');logger[_0x831f('0x1a')](_0x831f('0x1b'),_0x26ef25,_0x831f('0x1c'),JSON[_0x831f('0x1d')](_0x45b62b));if(_0x45b62b[_0x831f('0x1e')]){if(_0x45b62b['error'][_0x831f('0x1f')]===0x1f4){logger[_0x831f('0x1e')](_0x831f('0x19'),_0x26ef25,_0x45b62b['error'][_0x831f('0x20')]);return _0x495c53(_0x45b62b[_0x831f('0x1e')][_0x831f('0x20')]);}logger[_0x831f('0x1e')](_0x831f('0x19'),_0x26ef25,_0x45b62b['error']['message']);return _0x4a3f48(_0x45b62b['error'][_0x831f('0x20')]);}else{logger[_0x831f('0x18')](_0x831f('0x19'),_0x26ef25,'request\x20sent');_0x4a3f48(_0x45b62b[_0x831f('0x21')][_0x831f('0x20')]);}})['catch'](function(_0x512109){logger['error'](_0x831f('0x19'),_0x26ef25,_0x512109);_0x495c53(_0x512109);});});}function respondWithStatusCode(_0x2b33bf,_0x41fd6f){_0x41fd6f=_0x41fd6f||0xcc;return function(_0x3f04bc){if(_0x3f04bc){return _0x2b33bf[_0x831f('0x22')](_0x41fd6f);}return _0x2b33bf[_0x831f('0x23')](_0x41fd6f)[_0x831f('0x24')]();};}function respondWithResult(_0x50ed5d,_0xab8f5a){_0xab8f5a=_0xab8f5a||0xc8;return function(_0x1946fa){if(_0x1946fa){return _0x50ed5d[_0x831f('0x23')](_0xab8f5a)[_0x831f('0x25')](_0x1946fa);}};}function respondWithFilteredResult(_0x5b3925,_0x3c1cd0){return function(_0x48f159){if(_0x48f159){var _0x236aca=_0x48f159['count'],_0x3bea26=_0x3c1cd0[_0x831f('0x26')],_0x51c837=_0x3c1cd0[_0x831f('0x26')]+_0x3c1cd0[_0x831f('0x27')],_0x778f2d;if(_0x51c837>=_0x236aca){_0x51c837=_0x236aca;_0x778f2d=0xc8;}else{_0x778f2d=0xce;}_0x5b3925[_0x831f('0x23')](_0x778f2d);return _0x5b3925[_0x831f('0x28')](_0x831f('0x29'),_0x3bea26+'-'+_0x51c837+'/'+_0x236aca)[_0x831f('0x25')](_0x48f159);}return null;};}function patchUpdates(_0x2af445){return function(_0x312b51){try{jsonpatch[_0x831f('0x2a')](_0x312b51,_0x2af445,!![]);}catch(_0x45c139){return BPromise[_0x831f('0x2b')](_0x45c139);}return _0x312b51[_0x831f('0x2c')]();};}function saveUpdates(_0x1e3a06,_0x58f238){return function(_0xa464be){if(_0xa464be){return _0xa464be[_0x831f('0x2d')](_0x1e3a06)[_0x831f('0x2e')](function(_0x49b69f){return _0x49b69f;});}return null;};}function removeEntity(_0x1c8182,_0x366d86){return function(_0x25dd9a){if(_0x25dd9a){return _0x25dd9a['destroy']()[_0x831f('0x2e')](function(){_0x1c8182['status'](0xcc)[_0x831f('0x24')]();});}};}function handleEntityNotFound(_0x34358c,_0x3ddfe8){return function(_0x3e7510){if(!_0x3e7510){_0x34358c[_0x831f('0x22')](0x194);}return _0x3e7510;};}function handleError(_0x9df815,_0x3d6b24){_0x3d6b24=_0x3d6b24||0x1f4;return function(_0x13e61d){logger['error'](_0x13e61d[_0x831f('0x2f')]);if(_0x13e61d[_0x831f('0x30')]){delete _0x13e61d[_0x831f('0x30')];}_0x9df815[_0x831f('0x23')](_0x3d6b24)['send'](_0x13e61d);};}exports[_0x831f('0x31')]=function(_0x44fd2e,_0x5053c2){var _0x51c591={},_0xcc97c3={},_0x273855={'count':0x0,'rows':[]};var _0x120849=db['SugarcrmConfiguration'][_0x831f('0x32')];_0xcc97c3[_0x831f('0x33')]=_[_0x831f('0x34')](_0x120849);_0xcc97c3['query']=_[_0x831f('0x34')](_0x44fd2e[_0x831f('0x35')]);_0xcc97c3[_0x831f('0x36')]=_[_0x831f('0x37')](_0xcc97c3[_0x831f('0x33')],_0xcc97c3['query']);_0x51c591[_0x831f('0x38')]=_[_0x831f('0x37')](_0xcc97c3[_0x831f('0x33')],qs[_0x831f('0x39')](_0x44fd2e[_0x831f('0x35')][_0x831f('0x39')]));_0x51c591[_0x831f('0x38')]=_0x51c591[_0x831f('0x38')][_0x831f('0x3a')]?_0x51c591[_0x831f('0x38')]:_0xcc97c3[_0x831f('0x33')];if(!_0x44fd2e[_0x831f('0x35')][_0x831f('0x3b')](_0x831f('0x3c'))){_0x51c591['limit']=qs[_0x831f('0x27')](_0x44fd2e[_0x831f('0x35')]['limit']);_0x51c591[_0x831f('0x26')]=qs[_0x831f('0x26')](_0x44fd2e[_0x831f('0x35')][_0x831f('0x26')]);}_0x51c591[_0x831f('0x3d')]=qs[_0x831f('0x3e')](_0x44fd2e[_0x831f('0x35')]['sort']);_0x51c591[_0x831f('0x3f')]=qs[_0x831f('0x36')](_[_0x831f('0x40')](_0x44fd2e[_0x831f('0x35')],_0xcc97c3[_0x831f('0x36')]));if(_0x44fd2e[_0x831f('0x35')][_0x831f('0x41')]){_0x51c591[_0x831f('0x3f')]=_['merge'](_0x51c591[_0x831f('0x3f')],{'$or':_['map'](_0x120849,function(_0x4af239){if(_0x4af239[_0x831f('0x42')][_0x831f('0x43')]!==_0x831f('0x44')){var _0x33d99f={};_0x33d99f[_0x4af239[_0x831f('0x45')]]={'$like':'%'+_0x44fd2e[_0x831f('0x35')][_0x831f('0x41')]+'%'};return _0x33d99f;}})});}_0x51c591=_[_0x831f('0x46')]({},_0x51c591,_0x44fd2e[_0x831f('0x47')]);var _0x2f6126={'where':_0x51c591[_0x831f('0x3f')]};return db[_0x831f('0x48')][_0x831f('0x49')](_0x2f6126)[_0x831f('0x2e')](function(_0x2c36d2){_0x273855['count']=_0x2c36d2;if(_0x44fd2e['query'][_0x831f('0x4a')]){_0x51c591[_0x831f('0x4b')]=[{'all':!![]}];}return db[_0x831f('0x48')][_0x831f('0x4c')](_0x51c591);})[_0x831f('0x2e')](function(_0x53ff3c){_0x273855['rows']=_0x53ff3c;return _0x273855;})[_0x831f('0x2e')](respondWithFilteredResult(_0x5053c2,_0x51c591))['catch'](handleError(_0x5053c2,null));};exports['show']=function(_0x302170,_0x171c10){var _0x442798={'raw':![],'where':{'id':_0x302170[_0x831f('0x4d')]['id']}},_0x504d82={};_0x504d82[_0x831f('0x33')]=_[_0x831f('0x34')](db['SugarcrmConfiguration'][_0x831f('0x32')]);_0x504d82[_0x831f('0x35')]=_[_0x831f('0x34')](_0x302170['query']);_0x504d82[_0x831f('0x36')]=_[_0x831f('0x37')](_0x504d82['model'],_0x504d82[_0x831f('0x35')]);_0x442798[_0x831f('0x38')]=_[_0x831f('0x37')](_0x504d82[_0x831f('0x33')],qs['fields'](_0x302170[_0x831f('0x35')][_0x831f('0x39')]));_0x442798[_0x831f('0x38')]=_0x442798[_0x831f('0x38')][_0x831f('0x3a')]?_0x442798[_0x831f('0x38')]:_0x504d82[_0x831f('0x33')];if(_0x302170[_0x831f('0x35')][_0x831f('0x4a')]){_0x442798[_0x831f('0x4b')]=[{'all':!![]}];}_0x442798=_[_0x831f('0x46')]({},_0x442798,_0x302170[_0x831f('0x47')]);return db[_0x831f('0x48')][_0x831f('0x4e')](_0x442798)[_0x831f('0x2e')](handleEntityNotFound(_0x171c10,null))[_0x831f('0x2e')](respondWithResult(_0x171c10,null))[_0x831f('0x4f')](handleError(_0x171c10,null));};exports[_0x831f('0x50')]=function(_0x25d885,_0x1396cb){return db['SugarcrmConfiguration'][_0x831f('0x50')](_0x25d885[_0x831f('0x51')],{})[_0x831f('0x2e')](respondWithResult(_0x1396cb,0xc9))[_0x831f('0x4f')](handleError(_0x1396cb,null));};exports['update']=function(_0x43e7ed,_0x3e6688){if(_0x43e7ed[_0x831f('0x51')]['id']){delete _0x43e7ed[_0x831f('0x51')]['id'];}return db[_0x831f('0x48')][_0x831f('0x4e')]({'where':{'id':_0x43e7ed['params']['id']}})[_0x831f('0x2e')](handleEntityNotFound(_0x3e6688,null))[_0x831f('0x2e')](saveUpdates(_0x43e7ed[_0x831f('0x51')],null))[_0x831f('0x2e')](respondWithResult(_0x3e6688,null))[_0x831f('0x4f')](handleError(_0x3e6688,null));};exports[_0x831f('0x52')]=function(_0x35d140,_0x247b36){return db['SugarcrmConfiguration'][_0x831f('0x4e')]({'where':{'id':_0x35d140['params']['id']}})['then'](handleEntityNotFound(_0x247b36,null))[_0x831f('0x2e')](removeEntity(_0x247b36,null))[_0x831f('0x4f')](handleError(_0x247b36,null));};exports[_0x831f('0x53')]=function(_0x1d1546,_0xc57205,_0x23473b){var _0x22ae65={};var _0x4c31d0={};var _0x413a92;var _0x2e9e15;return db[_0x831f('0x48')][_0x831f('0x54')]({'where':{'id':_0x1d1546[_0x831f('0x4d')]['id']}})['then'](handleEntityNotFound(_0xc57205,null))[_0x831f('0x2e')](function(_0x3c6e0b){if(_0x3c6e0b){_0x413a92=_0x3c6e0b;_0x4c31d0['model']=_[_0x831f('0x34')](db[_0x831f('0x55')][_0x831f('0x32')]);_0x4c31d0['query']=_['keys'](_0x1d1546['query']);_0x4c31d0['filters']=_[_0x831f('0x37')](_0x4c31d0['model'],_0x4c31d0[_0x831f('0x35')]);_0x22ae65[_0x831f('0x38')]=_[_0x831f('0x37')](_0x4c31d0[_0x831f('0x33')],qs[_0x831f('0x39')](_0x1d1546[_0x831f('0x35')][_0x831f('0x39')]));_0x22ae65[_0x831f('0x38')]=_0x22ae65[_0x831f('0x38')]['length']?_0x22ae65[_0x831f('0x38')]:_0x4c31d0[_0x831f('0x33')];_0x22ae65['order']=qs['sort'](_0x1d1546[_0x831f('0x35')][_0x831f('0x3e')]);_0x22ae65[_0x831f('0x3f')]=qs[_0x831f('0x36')](_['pick'](_0x1d1546[_0x831f('0x35')],_0x4c31d0[_0x831f('0x36')]));if(_0x1d1546['query'][_0x831f('0x41')]){_0x22ae65['where']=_[_0x831f('0x46')](_0x22ae65['where'],{'$or':_[_0x831f('0x56')](_0x22ae65[_0x831f('0x38')],function(_0x38abcc){var _0x237fcb={};_0x237fcb[_0x38abcc]={'$like':'%'+_0x1d1546[_0x831f('0x35')][_0x831f('0x41')]+'%'};return _0x237fcb;})});}_0x22ae65=_[_0x831f('0x46')]({},_0x22ae65,_0x1d1546[_0x831f('0x47')]);return _0x413a92[_0x831f('0x53')](_0x22ae65);}})[_0x831f('0x2e')](function(_0x99e10){if(_0x99e10){_0x2e9e15=_0x99e10['length'];if(!_0x1d1546['query'][_0x831f('0x3b')](_0x831f('0x3c'))){_0x22ae65[_0x831f('0x27')]=qs['limit'](_0x1d1546[_0x831f('0x35')][_0x831f('0x27')]);_0x22ae65[_0x831f('0x26')]=qs[_0x831f('0x26')](_0x1d1546['query'][_0x831f('0x26')]);}return _0x413a92[_0x831f('0x53')](_0x22ae65);}})[_0x831f('0x2e')](function(_0x378b86){if(_0x378b86){return _0x378b86?{'count':_0x2e9e15,'rows':_0x378b86}:null;}})[_0x831f('0x2e')](respondWithResult(_0xc57205,null))[_0x831f('0x4f')](handleError(_0xc57205,null));};exports[_0x831f('0x57')]=function(_0x483fa7,_0x197b65,_0x4f4799){var _0x461df4={};var _0x1fdd9f={};var _0x653ecd;var _0x10d62e;return db[_0x831f('0x48')][_0x831f('0x54')]({'where':{'id':_0x483fa7['params']['id']}})[_0x831f('0x2e')](handleEntityNotFound(_0x197b65,null))[_0x831f('0x2e')](function(_0xf3e769){if(_0xf3e769){_0x653ecd=_0xf3e769;_0x1fdd9f[_0x831f('0x33')]=_['keys'](db[_0x831f('0x55')][_0x831f('0x32')]);_0x1fdd9f['query']=_['keys'](_0x483fa7[_0x831f('0x35')]);_0x1fdd9f[_0x831f('0x36')]=_[_0x831f('0x37')](_0x1fdd9f[_0x831f('0x33')],_0x1fdd9f[_0x831f('0x35')]);_0x461df4[_0x831f('0x38')]=_['intersection'](_0x1fdd9f[_0x831f('0x33')],qs['fields'](_0x483fa7[_0x831f('0x35')][_0x831f('0x39')]));_0x461df4['attributes']=_0x461df4[_0x831f('0x38')][_0x831f('0x3a')]?_0x461df4['attributes']:_0x1fdd9f[_0x831f('0x33')];_0x461df4[_0x831f('0x3d')]=qs['sort'](_0x483fa7[_0x831f('0x35')][_0x831f('0x3e')]);_0x461df4[_0x831f('0x3f')]=qs['filters'](_[_0x831f('0x40')](_0x483fa7[_0x831f('0x35')],_0x1fdd9f[_0x831f('0x36')]));if(_0x483fa7[_0x831f('0x35')][_0x831f('0x41')]){_0x461df4[_0x831f('0x3f')]=_[_0x831f('0x46')](_0x461df4[_0x831f('0x3f')],{'$or':_['map'](_0x461df4[_0x831f('0x38')],function(_0x48d3de){var _0x483841={};_0x483841[_0x48d3de]={'$like':'%'+_0x483fa7[_0x831f('0x35')]['filter']+'%'};return _0x483841;})});}_0x461df4=_[_0x831f('0x46')]({},_0x461df4,_0x483fa7[_0x831f('0x47')]);return _0x653ecd[_0x831f('0x57')](_0x461df4);}})[_0x831f('0x2e')](function(_0x289cb0){if(_0x289cb0){_0x10d62e=_0x289cb0[_0x831f('0x3a')];if(!_0x483fa7[_0x831f('0x35')][_0x831f('0x3b')]('nolimit')){_0x461df4[_0x831f('0x27')]=qs[_0x831f('0x27')](_0x483fa7[_0x831f('0x35')]['limit']);_0x461df4[_0x831f('0x26')]=qs[_0x831f('0x26')](_0x483fa7[_0x831f('0x35')][_0x831f('0x26')]);}return _0x653ecd[_0x831f('0x57')](_0x461df4);}})[_0x831f('0x2e')](function(_0x223d7d){if(_0x223d7d){return _0x223d7d?{'count':_0x10d62e,'rows':_0x223d7d}:null;}})[_0x831f('0x2e')](respondWithResult(_0x197b65,null))[_0x831f('0x4f')](handleError(_0x197b65,null));};exports['getDescriptions']=function(_0x462e53,_0x4f07ec,_0x5a775b){var _0x44e136={};var _0x553146={};var _0x4bd4b5;var _0x4dcb6d;return db['SugarcrmConfiguration'][_0x831f('0x54')]({'where':{'id':_0x462e53['params']['id']}})[_0x831f('0x2e')](handleEntityNotFound(_0x4f07ec,null))['then'](function(_0x468345){if(_0x468345){_0x4bd4b5=_0x468345;_0x553146[_0x831f('0x33')]=_['keys'](db[_0x831f('0x55')][_0x831f('0x32')]);_0x553146[_0x831f('0x35')]=_[_0x831f('0x34')](_0x462e53['query']);_0x553146[_0x831f('0x36')]=_[_0x831f('0x37')](_0x553146['model'],_0x553146[_0x831f('0x35')]);_0x44e136[_0x831f('0x38')]=_[_0x831f('0x37')](_0x553146[_0x831f('0x33')],qs[_0x831f('0x39')](_0x462e53[_0x831f('0x35')]['fields']));_0x44e136[_0x831f('0x38')]=_0x44e136[_0x831f('0x38')]['length']?_0x44e136[_0x831f('0x38')]:_0x553146[_0x831f('0x33')];_0x44e136['order']=qs[_0x831f('0x3e')](_0x462e53['query'][_0x831f('0x3e')]);_0x44e136[_0x831f('0x3f')]=qs['filters'](_[_0x831f('0x40')](_0x462e53[_0x831f('0x35')],_0x553146['filters']));if(_0x462e53[_0x831f('0x35')][_0x831f('0x41')]){_0x44e136[_0x831f('0x3f')]=_['merge'](_0x44e136[_0x831f('0x3f')],{'$or':_[_0x831f('0x56')](_0x44e136[_0x831f('0x38')],function(_0x1b4c0f){var _0x5cc61a={};_0x5cc61a[_0x1b4c0f]={'$like':'%'+_0x462e53[_0x831f('0x35')][_0x831f('0x41')]+'%'};return _0x5cc61a;})});}_0x44e136=_[_0x831f('0x46')]({},_0x44e136,_0x462e53[_0x831f('0x47')]);return _0x4bd4b5['getDescriptions'](_0x44e136);}})['then'](function(_0x3bc05d){if(_0x3bc05d){_0x4dcb6d=_0x3bc05d[_0x831f('0x3a')];if(!_0x462e53[_0x831f('0x35')][_0x831f('0x3b')](_0x831f('0x3c'))){_0x44e136[_0x831f('0x27')]=qs[_0x831f('0x27')](_0x462e53[_0x831f('0x35')]['limit']);_0x44e136['offset']=qs['offset'](_0x462e53['query'][_0x831f('0x26')]);}return _0x4bd4b5[_0x831f('0x58')](_0x44e136);}})[_0x831f('0x2e')](function(_0x5c511b){if(_0x5c511b){return _0x5c511b?{'count':_0x4dcb6d,'rows':_0x5c511b}:null;}})[_0x831f('0x2e')](respondWithResult(_0x4f07ec,null))[_0x831f('0x4f')](handleError(_0x4f07ec,null));}; \ No newline at end of file +var _0x8648=['to-csv','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','stack','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','count','includeAll','SugarcrmConfiguration','findAll','rows','show','find','create','body','update','params','destroy','getFields','SugarcrmField','getSubjects','options','getDescriptions','findOne','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x181062,_0x40387d){var _0x43f0f7=function(_0x1059f0){while(--_0x1059f0){_0x181062['push'](_0x181062['shift']());}};_0x43f0f7(++_0x40387d);}(_0x8648,0xa5));var _0x8864=function(_0x367b82,_0x5583dd){_0x367b82=_0x367b82-0x0;var _0x30276c=_0x8648[_0x367b82];return _0x30276c;};'use strict';var pdf=require(_0x8864('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8864('0x1'));var zipdir=require(_0x8864('0x2'));var jsonpatch=require(_0x8864('0x3'));var rp=require(_0x8864('0x4'));var moment=require(_0x8864('0x5'));var BPromise=require(_0x8864('0x6'));var Mustache=require(_0x8864('0x7'));var util=require(_0x8864('0x8'));var path=require(_0x8864('0x9'));var sox=require(_0x8864('0xa'));var csv=require('to-csv');var ejs=require(_0x8864('0xb'));var fs=require('fs');var _=require(_0x8864('0xc'));var squel=require(_0x8864('0xd'));var crypto=require(_0x8864('0xe'));var jsforce=require(_0x8864('0xf'));var deskjs=require(_0x8864('0x10'));var toCsv=require(_0x8864('0x11'));var querystring=require('querystring');var Papa=require(_0x8864('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8864('0x13'));var hardwareService=require(_0x8864('0x14'));var logger=require(_0x8864('0x15'))(_0x8864('0x16'));var utils=require('../../config/utils');var config=require(_0x8864('0x17'));var db=require(_0x8864('0x18'))['db'];var jayson=require(_0x8864('0x19'));var client=jayson[_0x8864('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x490870,_0x2efae3,_0x2aad79){if(_0x2aad79){var _0x38ca69=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x38ca69[_0x8864('0x1b')](_0x2efae3)){return _0x490870;}else{throw new Error(_0x8864('0x1c'));}}else{return _0x490870;}}function respondWithRpcPromise(_0x1aaf78,_0x2dc9b3,_0x12ceaf,_0x4246d1){return new BPromise(function(_0x503ae0,_0x5d837e){var _0x54c961=_0x4246d1||client;return _0x54c961['request'](_0x1aaf78,_0x12ceaf)[_0x8864('0x1d')](function(_0x2cbda7){logger[_0x8864('0x1e')](_0x8864('0x1f'),_0x2dc9b3,_0x8864('0x20'));logger[_0x8864('0x21')](_0x8864('0x22'),_0x2dc9b3,'request\x20sent',JSON[_0x8864('0x23')](_0x2cbda7));if(_0x2cbda7[_0x8864('0x24')]){if(_0x2cbda7[_0x8864('0x24')][_0x8864('0x25')]===0x1f4){logger['error'](_0x8864('0x1f'),_0x2dc9b3,_0x2cbda7['error']['message']);return _0x5d837e(_0x2cbda7[_0x8864('0x24')]['message']);}logger[_0x8864('0x24')](_0x8864('0x1f'),_0x2dc9b3,_0x2cbda7[_0x8864('0x24')]['message']);return _0x503ae0(_0x2cbda7['error'][_0x8864('0x26')]);}else{logger[_0x8864('0x1e')](_0x8864('0x1f'),_0x2dc9b3,_0x8864('0x20'));_0x503ae0(_0x2cbda7[_0x8864('0x27')][_0x8864('0x26')]);}})[_0x8864('0x28')](function(_0x1ee644){logger[_0x8864('0x24')](_0x8864('0x1f'),_0x2dc9b3,_0x1ee644);_0x5d837e(_0x1ee644);});});}function respondWithStatusCode(_0x122048,_0x3dfc21){_0x3dfc21=_0x3dfc21||0xcc;return function(_0x216230){if(_0x216230){return _0x122048[_0x8864('0x29')](_0x3dfc21);}return _0x122048[_0x8864('0x2a')](_0x3dfc21)[_0x8864('0x2b')]();};}function respondWithResult(_0x330266,_0x2bb0d3){_0x2bb0d3=_0x2bb0d3||0xc8;return function(_0x40d377){if(_0x40d377){return _0x330266[_0x8864('0x2a')](_0x2bb0d3)[_0x8864('0x2c')](_0x40d377);}};}function respondWithFilteredResult(_0x3bd42c,_0x7a53f8){return function(_0x8381a1){if(_0x8381a1){var _0x9d028b=_0x8381a1['count'],_0x315aed=_0x7a53f8[_0x8864('0x2d')],_0x30fac8=_0x7a53f8[_0x8864('0x2d')]+_0x7a53f8[_0x8864('0x2e')],_0x1f5a3b;if(_0x30fac8>=_0x9d028b){_0x30fac8=_0x9d028b;_0x1f5a3b=0xc8;}else{_0x1f5a3b=0xce;}_0x3bd42c['status'](_0x1f5a3b);return _0x3bd42c[_0x8864('0x2f')](_0x8864('0x30'),_0x315aed+'-'+_0x30fac8+'/'+_0x9d028b)[_0x8864('0x2c')](_0x8381a1);}return null;};}function patchUpdates(_0x4faf34){return function(_0x594295){try{jsonpatch[_0x8864('0x31')](_0x594295,_0x4faf34,!![]);}catch(_0x467f88){return BPromise[_0x8864('0x32')](_0x467f88);}return _0x594295['save']();};}function saveUpdates(_0x47f7b4,_0xbd4b62){return function(_0x3f6666){if(_0x3f6666){return _0x3f6666['update'](_0x47f7b4)['then'](function(_0x419906){return _0x419906;});}return null;};}function removeEntity(_0x178222,_0xd20aeb){return function(_0x59de5f){if(_0x59de5f){return _0x59de5f['destroy']()[_0x8864('0x1d')](function(){_0x178222['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3df489,_0x30ad7b){return function(_0xa9ca16){if(!_0xa9ca16){_0x3df489[_0x8864('0x29')](0x194);}return _0xa9ca16;};}function handleError(_0x57253d,_0xbc5ec){_0xbc5ec=_0xbc5ec||0x1f4;return function(_0x5cb6fe){logger[_0x8864('0x24')](_0x5cb6fe[_0x8864('0x33')]);if(_0x5cb6fe[_0x8864('0x34')]){delete _0x5cb6fe[_0x8864('0x34')];}_0x57253d[_0x8864('0x2a')](_0xbc5ec)[_0x8864('0x35')](_0x5cb6fe);};}exports['index']=function(_0x5079f5,_0x3cbd65){var _0x6aef6e={},_0xf94497={},_0x51b7fe={'count':0x0,'rows':[]};var _0x3f74e6=db['SugarcrmConfiguration'][_0x8864('0x36')];_0xf94497[_0x8864('0x37')]=_[_0x8864('0x38')](_0x3f74e6);_0xf94497[_0x8864('0x39')]=_['keys'](_0x5079f5[_0x8864('0x39')]);_0xf94497[_0x8864('0x3a')]=_[_0x8864('0x3b')](_0xf94497[_0x8864('0x37')],_0xf94497['query']);_0x6aef6e[_0x8864('0x3c')]=_[_0x8864('0x3b')](_0xf94497['model'],qs['fields'](_0x5079f5[_0x8864('0x39')][_0x8864('0x3d')]));_0x6aef6e[_0x8864('0x3c')]=_0x6aef6e[_0x8864('0x3c')][_0x8864('0x3e')]?_0x6aef6e['attributes']:_0xf94497[_0x8864('0x37')];if(!_0x5079f5['query'][_0x8864('0x3f')](_0x8864('0x40'))){_0x6aef6e['limit']=qs[_0x8864('0x2e')](_0x5079f5[_0x8864('0x39')][_0x8864('0x2e')]);_0x6aef6e[_0x8864('0x2d')]=qs[_0x8864('0x2d')](_0x5079f5['query']['offset']);}_0x6aef6e[_0x8864('0x41')]=qs[_0x8864('0x42')](_0x5079f5[_0x8864('0x39')][_0x8864('0x42')]);_0x6aef6e[_0x8864('0x43')]=qs[_0x8864('0x3a')](_[_0x8864('0x44')](_0x5079f5['query'],_0xf94497['filters']));if(_0x5079f5[_0x8864('0x39')][_0x8864('0x45')]){_0x6aef6e[_0x8864('0x43')]=_[_0x8864('0x46')](_0x6aef6e[_0x8864('0x43')],{'$or':_[_0x8864('0x47')](_0x3f74e6,function(_0x43d846){if(_0x43d846['type']['key']!==_0x8864('0x48')){var _0x1ab271={};_0x1ab271[_0x43d846['field']]={'$like':'%'+_0x5079f5[_0x8864('0x39')][_0x8864('0x45')]+'%'};return _0x1ab271;}})});}_0x6aef6e=_[_0x8864('0x46')]({},_0x6aef6e,_0x5079f5['options']);var _0xa8d7b2={'where':_0x6aef6e[_0x8864('0x43')]};return db['SugarcrmConfiguration'][_0x8864('0x49')](_0xa8d7b2)['then'](function(_0x122d35){_0x51b7fe[_0x8864('0x49')]=_0x122d35;if(_0x5079f5[_0x8864('0x39')][_0x8864('0x4a')]){_0x6aef6e['include']=[{'all':!![]}];}return db[_0x8864('0x4b')][_0x8864('0x4c')](_0x6aef6e);})['then'](function(_0x58ca8c){_0x51b7fe[_0x8864('0x4d')]=_0x58ca8c;return _0x51b7fe;})[_0x8864('0x1d')](respondWithFilteredResult(_0x3cbd65,_0x6aef6e))[_0x8864('0x28')](handleError(_0x3cbd65,null));};exports[_0x8864('0x4e')]=function(_0x2d0bd5,_0x3873ab){var _0x44462d={'raw':![],'where':{'id':_0x2d0bd5['params']['id']}},_0x434bd7={};_0x434bd7[_0x8864('0x37')]=_['keys'](db[_0x8864('0x4b')][_0x8864('0x36')]);_0x434bd7[_0x8864('0x39')]=_[_0x8864('0x38')](_0x2d0bd5[_0x8864('0x39')]);_0x434bd7['filters']=_[_0x8864('0x3b')](_0x434bd7[_0x8864('0x37')],_0x434bd7[_0x8864('0x39')]);_0x44462d[_0x8864('0x3c')]=_[_0x8864('0x3b')](_0x434bd7['model'],qs['fields'](_0x2d0bd5[_0x8864('0x39')]['fields']));_0x44462d['attributes']=_0x44462d[_0x8864('0x3c')][_0x8864('0x3e')]?_0x44462d[_0x8864('0x3c')]:_0x434bd7[_0x8864('0x37')];if(_0x2d0bd5[_0x8864('0x39')][_0x8864('0x4a')]){_0x44462d['include']=[{'all':!![]}];}_0x44462d=_[_0x8864('0x46')]({},_0x44462d,_0x2d0bd5['options']);return db[_0x8864('0x4b')][_0x8864('0x4f')](_0x44462d)[_0x8864('0x1d')](handleEntityNotFound(_0x3873ab,null))['then'](respondWithResult(_0x3873ab,null))[_0x8864('0x28')](handleError(_0x3873ab,null));};exports[_0x8864('0x50')]=function(_0x55e3bc,_0x50682d){return db[_0x8864('0x4b')][_0x8864('0x50')](_0x55e3bc[_0x8864('0x51')],{})[_0x8864('0x1d')](respondWithResult(_0x50682d,0xc9))[_0x8864('0x28')](handleError(_0x50682d,null));};exports[_0x8864('0x52')]=function(_0x56a135,_0x512657){if(_0x56a135[_0x8864('0x51')]['id']){delete _0x56a135['body']['id'];}return db[_0x8864('0x4b')]['find']({'where':{'id':_0x56a135[_0x8864('0x53')]['id']}})[_0x8864('0x1d')](handleEntityNotFound(_0x512657,null))[_0x8864('0x1d')](saveUpdates(_0x56a135[_0x8864('0x51')],null))['then'](respondWithResult(_0x512657,null))['catch'](handleError(_0x512657,null));};exports[_0x8864('0x54')]=function(_0x328c10,_0x2917f2){return db['SugarcrmConfiguration'][_0x8864('0x4f')]({'where':{'id':_0x328c10[_0x8864('0x53')]['id']}})[_0x8864('0x1d')](handleEntityNotFound(_0x2917f2,null))[_0x8864('0x1d')](removeEntity(_0x2917f2,null))['catch'](handleError(_0x2917f2,null));};exports[_0x8864('0x55')]=function(_0x22cdcc,_0x28a777,_0xea5dcb){var _0x39bf1e={};var _0x4d052c={};var _0x53a6e0;var _0x173cf4;return db[_0x8864('0x4b')]['findOne']({'where':{'id':_0x22cdcc[_0x8864('0x53')]['id']}})['then'](handleEntityNotFound(_0x28a777,null))[_0x8864('0x1d')](function(_0x3c0452){if(_0x3c0452){_0x53a6e0=_0x3c0452;_0x4d052c[_0x8864('0x37')]=_[_0x8864('0x38')](db[_0x8864('0x56')][_0x8864('0x36')]);_0x4d052c[_0x8864('0x39')]=_[_0x8864('0x38')](_0x22cdcc[_0x8864('0x39')]);_0x4d052c['filters']=_['intersection'](_0x4d052c['model'],_0x4d052c[_0x8864('0x39')]);_0x39bf1e['attributes']=_['intersection'](_0x4d052c[_0x8864('0x37')],qs[_0x8864('0x3d')](_0x22cdcc[_0x8864('0x39')]['fields']));_0x39bf1e[_0x8864('0x3c')]=_0x39bf1e['attributes'][_0x8864('0x3e')]?_0x39bf1e[_0x8864('0x3c')]:_0x4d052c['model'];_0x39bf1e['order']=qs[_0x8864('0x42')](_0x22cdcc[_0x8864('0x39')][_0x8864('0x42')]);_0x39bf1e[_0x8864('0x43')]=qs[_0x8864('0x3a')](_[_0x8864('0x44')](_0x22cdcc[_0x8864('0x39')],_0x4d052c[_0x8864('0x3a')]));if(_0x22cdcc['query']['filter']){_0x39bf1e[_0x8864('0x43')]=_[_0x8864('0x46')](_0x39bf1e['where'],{'$or':_[_0x8864('0x47')](_0x39bf1e[_0x8864('0x3c')],function(_0x37c293){var _0x52f64b={};_0x52f64b[_0x37c293]={'$like':'%'+_0x22cdcc[_0x8864('0x39')]['filter']+'%'};return _0x52f64b;})});}_0x39bf1e=_['merge']({},_0x39bf1e,_0x22cdcc['options']);return _0x53a6e0[_0x8864('0x55')](_0x39bf1e);}})['then'](function(_0x4c7506){if(_0x4c7506){_0x173cf4=_0x4c7506[_0x8864('0x3e')];if(!_0x22cdcc['query'][_0x8864('0x3f')](_0x8864('0x40'))){_0x39bf1e[_0x8864('0x2e')]=qs[_0x8864('0x2e')](_0x22cdcc[_0x8864('0x39')]['limit']);_0x39bf1e['offset']=qs['offset'](_0x22cdcc[_0x8864('0x39')][_0x8864('0x2d')]);}return _0x53a6e0['getFields'](_0x39bf1e);}})[_0x8864('0x1d')](function(_0x5c7d86){if(_0x5c7d86){return _0x5c7d86?{'count':_0x173cf4,'rows':_0x5c7d86}:null;}})[_0x8864('0x1d')](respondWithResult(_0x28a777,null))[_0x8864('0x28')](handleError(_0x28a777,null));};exports[_0x8864('0x57')]=function(_0x26b1ea,_0x4e7e14,_0x3587db){var _0x48e49d={};var _0x679401={};var _0x16f225;var _0x178657;return db[_0x8864('0x4b')]['findOne']({'where':{'id':_0x26b1ea[_0x8864('0x53')]['id']}})[_0x8864('0x1d')](handleEntityNotFound(_0x4e7e14,null))[_0x8864('0x1d')](function(_0x2d5677){if(_0x2d5677){_0x16f225=_0x2d5677;_0x679401[_0x8864('0x37')]=_[_0x8864('0x38')](db[_0x8864('0x56')][_0x8864('0x36')]);_0x679401[_0x8864('0x39')]=_[_0x8864('0x38')](_0x26b1ea[_0x8864('0x39')]);_0x679401[_0x8864('0x3a')]=_[_0x8864('0x3b')](_0x679401['model'],_0x679401[_0x8864('0x39')]);_0x48e49d['attributes']=_[_0x8864('0x3b')](_0x679401[_0x8864('0x37')],qs['fields'](_0x26b1ea[_0x8864('0x39')][_0x8864('0x3d')]));_0x48e49d[_0x8864('0x3c')]=_0x48e49d['attributes']['length']?_0x48e49d[_0x8864('0x3c')]:_0x679401['model'];_0x48e49d[_0x8864('0x41')]=qs['sort'](_0x26b1ea['query'][_0x8864('0x42')]);_0x48e49d[_0x8864('0x43')]=qs[_0x8864('0x3a')](_[_0x8864('0x44')](_0x26b1ea[_0x8864('0x39')],_0x679401[_0x8864('0x3a')]));if(_0x26b1ea[_0x8864('0x39')][_0x8864('0x45')]){_0x48e49d[_0x8864('0x43')]=_[_0x8864('0x46')](_0x48e49d['where'],{'$or':_[_0x8864('0x47')](_0x48e49d[_0x8864('0x3c')],function(_0x504c8e){var _0x2b651c={};_0x2b651c[_0x504c8e]={'$like':'%'+_0x26b1ea[_0x8864('0x39')]['filter']+'%'};return _0x2b651c;})});}_0x48e49d=_['merge']({},_0x48e49d,_0x26b1ea[_0x8864('0x58')]);return _0x16f225['getSubjects'](_0x48e49d);}})['then'](function(_0x2e9c10){if(_0x2e9c10){_0x178657=_0x2e9c10[_0x8864('0x3e')];if(!_0x26b1ea[_0x8864('0x39')]['hasOwnProperty'](_0x8864('0x40'))){_0x48e49d['limit']=qs['limit'](_0x26b1ea[_0x8864('0x39')][_0x8864('0x2e')]);_0x48e49d[_0x8864('0x2d')]=qs[_0x8864('0x2d')](_0x26b1ea[_0x8864('0x39')][_0x8864('0x2d')]);}return _0x16f225[_0x8864('0x57')](_0x48e49d);}})['then'](function(_0x2179eb){if(_0x2179eb){return _0x2179eb?{'count':_0x178657,'rows':_0x2179eb}:null;}})[_0x8864('0x1d')](respondWithResult(_0x4e7e14,null))[_0x8864('0x28')](handleError(_0x4e7e14,null));};exports[_0x8864('0x59')]=function(_0x47ca89,_0x3191bc,_0xb4902b){var _0x256b9e={};var _0x41a144={};var _0xe79739;var _0x28749c;return db[_0x8864('0x4b')][_0x8864('0x5a')]({'where':{'id':_0x47ca89[_0x8864('0x53')]['id']}})[_0x8864('0x1d')](handleEntityNotFound(_0x3191bc,null))[_0x8864('0x1d')](function(_0x15eebc){if(_0x15eebc){_0xe79739=_0x15eebc;_0x41a144[_0x8864('0x37')]=_['keys'](db[_0x8864('0x56')]['rawAttributes']);_0x41a144[_0x8864('0x39')]=_['keys'](_0x47ca89[_0x8864('0x39')]);_0x41a144[_0x8864('0x3a')]=_[_0x8864('0x3b')](_0x41a144[_0x8864('0x37')],_0x41a144[_0x8864('0x39')]);_0x256b9e[_0x8864('0x3c')]=_[_0x8864('0x3b')](_0x41a144['model'],qs['fields'](_0x47ca89['query'][_0x8864('0x3d')]));_0x256b9e[_0x8864('0x3c')]=_0x256b9e[_0x8864('0x3c')][_0x8864('0x3e')]?_0x256b9e[_0x8864('0x3c')]:_0x41a144[_0x8864('0x37')];_0x256b9e[_0x8864('0x41')]=qs[_0x8864('0x42')](_0x47ca89[_0x8864('0x39')][_0x8864('0x42')]);_0x256b9e[_0x8864('0x43')]=qs[_0x8864('0x3a')](_[_0x8864('0x44')](_0x47ca89['query'],_0x41a144[_0x8864('0x3a')]));if(_0x47ca89[_0x8864('0x39')]['filter']){_0x256b9e[_0x8864('0x43')]=_[_0x8864('0x46')](_0x256b9e[_0x8864('0x43')],{'$or':_[_0x8864('0x47')](_0x256b9e['attributes'],function(_0x4c077){var _0x1e4f16={};_0x1e4f16[_0x4c077]={'$like':'%'+_0x47ca89[_0x8864('0x39')][_0x8864('0x45')]+'%'};return _0x1e4f16;})});}_0x256b9e=_[_0x8864('0x46')]({},_0x256b9e,_0x47ca89[_0x8864('0x58')]);return _0xe79739[_0x8864('0x59')](_0x256b9e);}})['then'](function(_0x294051){if(_0x294051){_0x28749c=_0x294051[_0x8864('0x3e')];if(!_0x47ca89[_0x8864('0x39')][_0x8864('0x3f')](_0x8864('0x40'))){_0x256b9e['limit']=qs[_0x8864('0x2e')](_0x47ca89['query'][_0x8864('0x2e')]);_0x256b9e[_0x8864('0x2d')]=qs[_0x8864('0x2d')](_0x47ca89[_0x8864('0x39')][_0x8864('0x2d')]);}return _0xe79739['getDescriptions'](_0x256b9e);}})['then'](function(_0x238e4f){if(_0x238e4f){return _0x238e4f?{'count':_0x28749c,'rows':_0x238e4f}:null;}})[_0x8864('0x1d')](respondWithResult(_0x3191bc,null))[_0x8864('0x28')](handleError(_0x3191bc,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index a62bdd7..af01b87 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 _0xb2d2=['./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','lodash','util','../../config/logger','moment','rimraf','../../config/environment'];(function(_0x10df79,_0x44f860){var _0x260e7d=function(_0x4fe0f0){while(--_0x4fe0f0){_0x10df79['push'](_0x10df79['shift']());}};_0x260e7d(++_0x44f860);}(_0xb2d2,0x158));var _0x2b2d=function(_0x1780d2,_0x1555d2){_0x1780d2=_0x1780d2-0x0;var _0x5bfdf3=_0xb2d2[_0x1780d2];return _0x5bfdf3;};'use strict';var _=require(_0x2b2d('0x0'));var util=require(_0x2b2d('0x1'));var logger=require(_0x2b2d('0x2'))('api');var moment=require(_0x2b2d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2b2d('0x4'));var config=require(_0x2b2d('0x5'));var attributes=require(_0x2b2d('0x6'));module[_0x2b2d('0x7')]=function(_0x5965ff,_0x170723){return _0x5965ff[_0x2b2d('0x8')]('SugarcrmConfiguration',attributes,{'tableName':_0x2b2d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05fe=['util','moment','bluebird','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','lodash'];(function(_0x5ebb34,_0x30bcfa){var _0x2a1a18=function(_0x474e26){while(--_0x474e26){_0x5ebb34['push'](_0x5ebb34['shift']());}};_0x2a1a18(++_0x30bcfa);}(_0x05fe,0x15f));var _0xe05f=function(_0x3c1913,_0x4f628b){_0x3c1913=_0x3c1913-0x0;var _0x5dd1da=_0x05fe[_0x3c1913];return _0x5dd1da;};'use strict';var _=require(_0xe05f('0x0'));var util=require(_0xe05f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe05f('0x2'));var BPromise=require(_0xe05f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe05f('0x4'));var config=require(_0xe05f('0x5'));var attributes=require(_0xe05f('0x6'));module[_0xe05f('0x7')]=function(_0x5cf05e,_0xd88fa8){return _0x5cf05e['define']('SugarcrmConfiguration',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 7fc47ba..af10ee9 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 _0xf27a=['result','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0xd79293,_0x44a40b){var _0x15bd2d=function(_0x396ea6){while(--_0x396ea6){_0xd79293['push'](_0xd79293['shift']());}};_0x15bd2d(++_0x44a40b);}(_0xf27a,0x1b6));var _0xaf27=function(_0x101cc5,_0x8c524f){_0x101cc5=_0x101cc5-0x0;var _0x1c4e46=_0xf27a[_0x101cc5];return _0x1c4e46;};'use strict';var _=require(_0xaf27('0x0'));var util=require(_0xaf27('0x1'));var moment=require(_0xaf27('0x2'));var BPromise=require(_0xaf27('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf27('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xaf27('0x5'));var config=require(_0xaf27('0x6'));var jayson=require(_0xaf27('0x7'));var client=jayson['client'][_0xaf27('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1dd3d2,_0x27e70a,_0x4215e7){return new BPromise(function(_0x50c70c,_0x395df5){return client[_0xaf27('0x9')](_0x1dd3d2,_0x4215e7)[_0xaf27('0xa')](function(_0x111529){logger[_0xaf27('0xb')](_0xaf27('0xc'),_0x27e70a,_0xaf27('0xd'));logger['debug'](_0xaf27('0xe'),_0x27e70a,'request\x20sent',JSON[_0xaf27('0xf')](_0x111529));if(_0x111529[_0xaf27('0x10')]){if(_0x111529[_0xaf27('0x10')]['code']===0x1f4){logger['error'](_0xaf27('0xc'),_0x27e70a,_0x111529['error'][_0xaf27('0x11')]);return _0x395df5(_0x111529[_0xaf27('0x10')][_0xaf27('0x11')]);}logger['error'](_0xaf27('0xc'),_0x27e70a,_0x111529[_0xaf27('0x10')]['message']);return _0x50c70c(_0x111529[_0xaf27('0x10')][_0xaf27('0x11')]);}else{logger[_0xaf27('0xb')](_0xaf27('0xc'),_0x27e70a,_0xaf27('0xd'));_0x50c70c(_0x111529[_0xaf27('0x12')][_0xaf27('0x11')]);}})['catch'](function(_0x4babd8){logger['error'](_0xaf27('0xc'),_0x27e70a,_0x4babd8);_0x395df5(_0x4babd8);});});} \ No newline at end of file +var _0x174f=['http','request','then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SugarcrmConfiguration,\x20%s,\x20%s','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x291e85,_0x2c6059){var _0x538ba2=function(_0x69c44a){while(--_0x69c44a){_0x291e85['push'](_0x291e85['shift']());}};_0x538ba2(++_0x2c6059);}(_0x174f,0x194));var _0xf174=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x174f[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0xf174('0x0'));var util=require('util');var moment=require(_0xf174('0x1'));var BPromise=require('bluebird');var rs=require(_0xf174('0x2'));var fs=require('fs');var Redis=require(_0xf174('0x3'));var db=require(_0xf174('0x4'))['db'];var utils=require(_0xf174('0x5'));var logger=require(_0xf174('0x6'))(_0xf174('0x7'));var config=require('../../config/environment');var jayson=require(_0xf174('0x8'));var client=jayson[_0xf174('0x9')][_0xf174('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x145a5b,_0x238ebe,_0x4b2045){return new BPromise(function(_0x855534,_0x3bb120){return client[_0xf174('0xb')](_0x145a5b,_0x4b2045)[_0xf174('0xc')](function(_0x4c748d){logger[_0xf174('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x238ebe,_0xf174('0xe'));logger[_0xf174('0xf')](_0xf174('0x10'),_0x238ebe,_0xf174('0xe'),JSON[_0xf174('0x11')](_0x4c748d));if(_0x4c748d['error']){if(_0x4c748d[_0xf174('0x12')][_0xf174('0x13')]===0x1f4){logger[_0xf174('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x238ebe,_0x4c748d[_0xf174('0x12')][_0xf174('0x14')]);return _0x3bb120(_0x4c748d['error'][_0xf174('0x14')]);}logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x238ebe,_0x4c748d['error'][_0xf174('0x14')]);return _0x855534(_0x4c748d[_0xf174('0x12')][_0xf174('0x14')]);}else{logger['info'](_0xf174('0x15'),_0x238ebe,_0xf174('0xe'));_0x855534(_0x4c748d['result']['message']);}})[_0xf174('0x16')](function(_0x515b38){logger[_0xf174('0x12')](_0xf174('0x15'),_0x238ebe,_0x515b38);_0x3bb120(_0x515b38);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 2251235..119c796 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 _0x9d13=['isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller'];(function(_0x24943c,_0x13f51a){var _0x3f231f=function(_0x15b40b){while(--_0x15b40b){_0x24943c['push'](_0x24943c['shift']());}};_0x3f231f(++_0x13f51a);}(_0x9d13,0xe8));var _0x39d1=function(_0x2e7819,_0x794572){_0x2e7819=_0x2e7819-0x0;var _0x232b3b=_0x9d13[_0x2e7819];return _0x232b3b;};'use strict';var multer=require(_0x39d1('0x0'));var util=require(_0x39d1('0x1'));var path=require(_0x39d1('0x2'));var timeout=require(_0x39d1('0x3'));var express=require(_0x39d1('0x4'));var router=express[_0x39d1('0x5')]();var auth=require(_0x39d1('0x6'));var interaction=require(_0x39d1('0x7'));var config=require(_0x39d1('0x8'));var controller=require(_0x39d1('0x9'));router['get']('/',auth[_0x39d1('0xa')](),controller[_0x39d1('0xb')]);router[_0x39d1('0xc')](_0x39d1('0xd'),auth[_0x39d1('0xa')](),controller[_0x39d1('0xe')]);router[_0x39d1('0xf')]('/',auth[_0x39d1('0xa')](),controller[_0x39d1('0x10')]);router[_0x39d1('0x11')](_0x39d1('0xd'),auth[_0x39d1('0xa')](),controller[_0x39d1('0x12')]);router[_0x39d1('0x13')](_0x39d1('0xd'),auth[_0x39d1('0xa')](),controller[_0x39d1('0x14')]);module[_0x39d1('0x15')]=router; \ No newline at end of file +var _0xf01a=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index'];(function(_0x439083,_0x18f6e2){var _0x54c089=function(_0x40de42){while(--_0x40de42){_0x439083['push'](_0x439083['shift']());}};_0x54c089(++_0x18f6e2);}(_0xf01a,0x159));var _0xaf01=function(_0xd60217,_0x28050e){_0xd60217=_0xd60217-0x0;var _0x45d520=_0xf01a[_0xd60217];return _0x45d520;};'use strict';var multer=require(_0xaf01('0x0'));var util=require(_0xaf01('0x1'));var path=require('path');var timeout=require(_0xaf01('0x2'));var express=require(_0xaf01('0x3'));var router=express[_0xaf01('0x4')]();var auth=require(_0xaf01('0x5'));var interaction=require(_0xaf01('0x6'));var config=require(_0xaf01('0x7'));var controller=require(_0xaf01('0x8'));router[_0xaf01('0x9')]('/',auth[_0xaf01('0xa')](),controller[_0xaf01('0xb')]);router[_0xaf01('0x9')](_0xaf01('0xc'),auth[_0xaf01('0xa')](),controller[_0xaf01('0xd')]);router[_0xaf01('0xe')]('/',auth[_0xaf01('0xa')](),controller[_0xaf01('0xf')]);router[_0xaf01('0x10')](_0xaf01('0xc'),auth[_0xaf01('0xa')](),controller[_0xaf01('0x11')]);router[_0xaf01('0x12')]('/:id',auth[_0xaf01('0xa')](),controller[_0xaf01('0x13')]);module[_0xaf01('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 3faebe1..58a653b 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 _0x22fb=['string','STRING','BOOLEAN','ENUM','variable','customVariable','keyValue'];(function(_0x5a31ba,_0x4a4460){var _0x364259=function(_0x329bd5){while(--_0x329bd5){_0x5a31ba['push'](_0x5a31ba['shift']());}};_0x364259(++_0x4a4460);}(_0x22fb,0x192));var _0xb22f=function(_0x833c68,_0x8255b5){_0x833c68=_0x833c68-0x0;var _0x4acda3=_0x22fb[_0x833c68];return _0x4acda3;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xb22f('0x0')]('string',_0xb22f('0x1'),_0xb22f('0x2'),_0xb22f('0x3')),'defaultValue':_0xb22f('0x4')},'content':{'type':Sequelize[_0xb22f('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb22f('0x0')](_0xb22f('0x4'),_0xb22f('0x1'),_0xb22f('0x2'))},'keyContent':{'type':Sequelize[_0xb22f('0x5')]},'idField':{'type':Sequelize[_0xb22f('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb22f('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb22f('0x5')]}}; \ No newline at end of file +var _0xf4eb=['string','variable','sequelize','customVariable','STRING','ENUM'];(function(_0x11dfeb,_0x46c3b4){var _0x3817af=function(_0x167e89){while(--_0x167e89){_0x11dfeb['push'](_0x11dfeb['shift']());}};_0x3817af(++_0x46c3b4);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4d8e3c,_0x3fa571){_0x4d8e3c=_0x4d8e3c-0x0;var _0x56db15=_0xf4eb[_0x4d8e3c];return _0x56db15;};'use strict';var Sequelize=require(_0xbf4e('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string','variable',_0xbf4e('0x1'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0xbf4e('0x2')]},'key':{'type':Sequelize[_0xbf4e('0x2')]},'keyType':{'type':Sequelize[_0xbf4e('0x3')](_0xbf4e('0x4'),_0xbf4e('0x5'),_0xbf4e('0x1'))},'keyContent':{'type':Sequelize[_0xbf4e('0x2')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xbf4e('0x2')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 90dec16..69370c6 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 _0x35e7=['VIRTUAL','field','options','includeAll','include','show','params','rawAttributes','length','merge','find','catch','create','update','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','apply','reject','save','destroy','then','error','stack','name','send','SugarcrmField','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','map','type'];(function(_0x5333d8,_0x4cbe38){var _0x3e8edb=function(_0x26fc36){while(--_0x26fc36){_0x5333d8['push'](_0x5333d8['shift']());}};_0x3e8edb(++_0x4cbe38);}(_0x35e7,0x16d));var _0x735e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x35e7[_0x502c7d];return _0x30b7ed;};'use strict';var pdf=require(_0x735e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x735e('0x1'));var zipdir=require(_0x735e('0x2'));var jsonpatch=require(_0x735e('0x3'));var rp=require(_0x735e('0x4'));var moment=require(_0x735e('0x5'));var BPromise=require(_0x735e('0x6'));var Mustache=require(_0x735e('0x7'));var util=require(_0x735e('0x8'));var path=require(_0x735e('0x9'));var sox=require(_0x735e('0xa'));var csv=require(_0x735e('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x735e('0xc'));var squel=require(_0x735e('0xd'));var crypto=require(_0x735e('0xe'));var jsforce=require(_0x735e('0xf'));var deskjs=require(_0x735e('0x10'));var toCsv=require(_0x735e('0xb'));var querystring=require('querystring');var Papa=require(_0x735e('0x11'));var Redis=require('ioredis');var authService=require(_0x735e('0x12'));var qs=require(_0x735e('0x13'));var hardwareService=require(_0x735e('0x14'));var logger=require(_0x735e('0x15'))('api');var utils=require(_0x735e('0x16'));var config=require(_0x735e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d073a,_0x4f6bb1){_0x4f6bb1=_0x4f6bb1||0xcc;return function(_0x4bc267){if(_0x4bc267){return _0x3d073a[_0x735e('0x18')](_0x4f6bb1);}return _0x3d073a[_0x735e('0x19')](_0x4f6bb1)[_0x735e('0x1a')]();};}function respondWithResult(_0x4e84d0,_0x397e38){_0x397e38=_0x397e38||0xc8;return function(_0x2cdda2){if(_0x2cdda2){return _0x4e84d0['status'](_0x397e38)[_0x735e('0x1b')](_0x2cdda2);}};}function respondWithFilteredResult(_0xf31dc2,_0x20e07c){return function(_0x5117df){if(_0x5117df){var _0x34ecb1=_0x5117df[_0x735e('0x1c')],_0x1cffbb=_0x20e07c[_0x735e('0x1d')],_0x324fd4=_0x20e07c['offset']+_0x20e07c[_0x735e('0x1e')],_0x292bbf;if(_0x324fd4>=_0x34ecb1){_0x324fd4=_0x34ecb1;_0x292bbf=0xc8;}else{_0x292bbf=0xce;}_0xf31dc2[_0x735e('0x19')](_0x292bbf);return _0xf31dc2['set']('Content-Range',_0x1cffbb+'-'+_0x324fd4+'/'+_0x34ecb1)[_0x735e('0x1b')](_0x5117df);}return null;};}function patchUpdates(_0x394bd2){return function(_0x4ca28d){try{jsonpatch[_0x735e('0x1f')](_0x4ca28d,_0x394bd2,!![]);}catch(_0x3d70c6){return BPromise[_0x735e('0x20')](_0x3d70c6);}return _0x4ca28d[_0x735e('0x21')]();};}function saveUpdates(_0x4a3881,_0x46442b){return function(_0x331d9d){if(_0x331d9d){return _0x331d9d['update'](_0x4a3881)['then'](function(_0x168c87){return _0x168c87;});}return null;};}function removeEntity(_0x12fdbe,_0x47d109){return function(_0x346dea){if(_0x346dea){return _0x346dea[_0x735e('0x22')]()[_0x735e('0x23')](function(){_0x12fdbe[_0x735e('0x19')](0xcc)[_0x735e('0x1a')]();});}};}function handleEntityNotFound(_0x587f67,_0x4c4fa0){return function(_0x3e5c4c){if(!_0x3e5c4c){_0x587f67[_0x735e('0x18')](0x194);}return _0x3e5c4c;};}function handleError(_0x5c488f,_0x3dd5d6){_0x3dd5d6=_0x3dd5d6||0x1f4;return function(_0x1526c4){logger[_0x735e('0x24')](_0x1526c4[_0x735e('0x25')]);if(_0x1526c4[_0x735e('0x26')]){delete _0x1526c4[_0x735e('0x26')];}_0x5c488f[_0x735e('0x19')](_0x3dd5d6)[_0x735e('0x27')](_0x1526c4);};}exports['index']=function(_0x57f99a,_0xf9034e){var _0x166b1d={},_0xd1799a={},_0x439c7b={'count':0x0,'rows':[]};var _0x58b57d=db[_0x735e('0x28')]['rawAttributes'];_0xd1799a[_0x735e('0x29')]=_[_0x735e('0x2a')](_0x58b57d);_0xd1799a[_0x735e('0x2b')]=_[_0x735e('0x2a')](_0x57f99a['query']);_0xd1799a[_0x735e('0x2c')]=_[_0x735e('0x2d')](_0xd1799a[_0x735e('0x29')],_0xd1799a[_0x735e('0x2b')]);_0x166b1d[_0x735e('0x2e')]=_[_0x735e('0x2d')](_0xd1799a['model'],qs[_0x735e('0x2f')](_0x57f99a[_0x735e('0x2b')][_0x735e('0x2f')]));_0x166b1d[_0x735e('0x2e')]=_0x166b1d['attributes']['length']?_0x166b1d[_0x735e('0x2e')]:_0xd1799a[_0x735e('0x29')];if(!_0x57f99a[_0x735e('0x2b')][_0x735e('0x30')]('nolimit')){_0x166b1d[_0x735e('0x1e')]=qs[_0x735e('0x1e')](_0x57f99a[_0x735e('0x2b')]['limit']);_0x166b1d[_0x735e('0x1d')]=qs[_0x735e('0x1d')](_0x57f99a[_0x735e('0x2b')][_0x735e('0x1d')]);}_0x166b1d['order']=qs[_0x735e('0x31')](_0x57f99a[_0x735e('0x2b')][_0x735e('0x31')]);_0x166b1d[_0x735e('0x32')]=qs[_0x735e('0x2c')](_[_0x735e('0x33')](_0x57f99a['query'],_0xd1799a[_0x735e('0x2c')]));if(_0x57f99a[_0x735e('0x2b')][_0x735e('0x34')]){_0x166b1d[_0x735e('0x32')]=_['merge'](_0x166b1d[_0x735e('0x32')],{'$or':_[_0x735e('0x35')](_0x58b57d,function(_0xc0ea9a){if(_0xc0ea9a[_0x735e('0x36')]['key']!==_0x735e('0x37')){var _0x2ec1b2={};_0x2ec1b2[_0xc0ea9a[_0x735e('0x38')]]={'$like':'%'+_0x57f99a[_0x735e('0x2b')]['filter']+'%'};return _0x2ec1b2;}})});}_0x166b1d=_['merge']({},_0x166b1d,_0x57f99a[_0x735e('0x39')]);var _0x5d2f64={'where':_0x166b1d[_0x735e('0x32')]};return db[_0x735e('0x28')][_0x735e('0x1c')](_0x5d2f64)['then'](function(_0x3b1bba){_0x439c7b[_0x735e('0x1c')]=_0x3b1bba;if(_0x57f99a[_0x735e('0x2b')][_0x735e('0x3a')]){_0x166b1d[_0x735e('0x3b')]=[{'all':!![]}];}return db[_0x735e('0x28')]['findAll'](_0x166b1d);})[_0x735e('0x23')](function(_0x5d1647){_0x439c7b['rows']=_0x5d1647;return _0x439c7b;})[_0x735e('0x23')](respondWithFilteredResult(_0xf9034e,_0x166b1d))['catch'](handleError(_0xf9034e,null));};exports[_0x735e('0x3c')]=function(_0x7e1200,_0x3bb5e0){var _0x1e930d={'raw':!![],'where':{'id':_0x7e1200[_0x735e('0x3d')]['id']}},_0x37a41e={};_0x37a41e[_0x735e('0x29')]=_[_0x735e('0x2a')](db[_0x735e('0x28')][_0x735e('0x3e')]);_0x37a41e[_0x735e('0x2b')]=_[_0x735e('0x2a')](_0x7e1200[_0x735e('0x2b')]);_0x37a41e[_0x735e('0x2c')]=_[_0x735e('0x2d')](_0x37a41e[_0x735e('0x29')],_0x37a41e[_0x735e('0x2b')]);_0x1e930d[_0x735e('0x2e')]=_[_0x735e('0x2d')](_0x37a41e[_0x735e('0x29')],qs['fields'](_0x7e1200[_0x735e('0x2b')][_0x735e('0x2f')]));_0x1e930d[_0x735e('0x2e')]=_0x1e930d[_0x735e('0x2e')][_0x735e('0x3f')]?_0x1e930d[_0x735e('0x2e')]:_0x37a41e['model'];if(_0x7e1200['query'][_0x735e('0x3a')]){_0x1e930d['include']=[{'all':!![]}];}_0x1e930d=_[_0x735e('0x40')]({},_0x1e930d,_0x7e1200[_0x735e('0x39')]);return db[_0x735e('0x28')][_0x735e('0x41')](_0x1e930d)[_0x735e('0x23')](handleEntityNotFound(_0x3bb5e0,null))[_0x735e('0x23')](respondWithResult(_0x3bb5e0,null))[_0x735e('0x42')](handleError(_0x3bb5e0,null));};exports[_0x735e('0x43')]=function(_0x25d2f9,_0x10207d){return db['SugarcrmField'][_0x735e('0x43')](_0x25d2f9['body'],{})[_0x735e('0x23')](respondWithResult(_0x10207d,0xc9))['catch'](handleError(_0x10207d,null));};exports[_0x735e('0x44')]=function(_0x570a8e,_0x55a011){if(_0x570a8e['body']['id']){delete _0x570a8e[_0x735e('0x45')]['id'];}return db[_0x735e('0x28')][_0x735e('0x41')]({'where':{'id':_0x570a8e[_0x735e('0x3d')]['id']}})[_0x735e('0x23')](handleEntityNotFound(_0x55a011,null))[_0x735e('0x23')](saveUpdates(_0x570a8e['body'],null))[_0x735e('0x23')](respondWithResult(_0x55a011,null))[_0x735e('0x42')](handleError(_0x55a011,null));};exports['destroy']=function(_0x4bcdcb,_0xa219ee){return db['SugarcrmField']['find']({'where':{'id':_0x4bcdcb[_0x735e('0x3d')]['id']}})[_0x735e('0x23')](handleEntityNotFound(_0xa219ee,null))['then'](removeEntity(_0xa219ee,null))['catch'](handleError(_0xa219ee,null));}; \ No newline at end of file +var _0x8411=['path','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','SugarcrmField','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','count','includeAll','include','findAll','rows','params','rawAttributes','catch','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x8411,0x168));var _0x1841=function(_0x4d8d71,_0x40eb11){_0x4d8d71=_0x4d8d71-0x0;var _0x1d250d=_0x8411[_0x4d8d71];return _0x1d250d;};'use strict';var pdf=require(_0x1841('0x0'));var emlformat=require(_0x1841('0x1'));var rimraf=require(_0x1841('0x2'));var zipdir=require(_0x1841('0x3'));var jsonpatch=require(_0x1841('0x4'));var rp=require(_0x1841('0x5'));var moment=require(_0x1841('0x6'));var BPromise=require(_0x1841('0x7'));var Mustache=require(_0x1841('0x8'));var util=require(_0x1841('0x9'));var path=require(_0x1841('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1841('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1841('0xc'));var crypto=require(_0x1841('0xd'));var jsforce=require(_0x1841('0xe'));var deskjs=require(_0x1841('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1841('0x10'));var Redis=require(_0x1841('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x1841('0x12'));var logger=require(_0x1841('0x13'))(_0x1841('0x14'));var utils=require(_0x1841('0x15'));var config=require(_0x1841('0x16'));var db=require(_0x1841('0x17'))['db'];function respondWithStatusCode(_0x202890,_0x11ccf8){_0x11ccf8=_0x11ccf8||0xcc;return function(_0x37ff1c){if(_0x37ff1c){return _0x202890[_0x1841('0x18')](_0x11ccf8);}return _0x202890[_0x1841('0x19')](_0x11ccf8)[_0x1841('0x1a')]();};}function respondWithResult(_0x5d1c2b,_0x11effa){_0x11effa=_0x11effa||0xc8;return function(_0x549252){if(_0x549252){return _0x5d1c2b[_0x1841('0x19')](_0x11effa)[_0x1841('0x1b')](_0x549252);}};}function respondWithFilteredResult(_0x393ff7,_0x57311b){return function(_0x568428){if(_0x568428){var _0x2c50f6=_0x568428['count'],_0x543aff=_0x57311b['offset'],_0x5b42a6=_0x57311b[_0x1841('0x1c')]+_0x57311b[_0x1841('0x1d')],_0x58bf5c;if(_0x5b42a6>=_0x2c50f6){_0x5b42a6=_0x2c50f6;_0x58bf5c=0xc8;}else{_0x58bf5c=0xce;}_0x393ff7[_0x1841('0x19')](_0x58bf5c);return _0x393ff7['set'](_0x1841('0x1e'),_0x543aff+'-'+_0x5b42a6+'/'+_0x2c50f6)[_0x1841('0x1b')](_0x568428);}return null;};}function patchUpdates(_0x148493){return function(_0x1d0f9a){try{jsonpatch[_0x1841('0x1f')](_0x1d0f9a,_0x148493,!![]);}catch(_0x3e258c){return BPromise[_0x1841('0x20')](_0x3e258c);}return _0x1d0f9a[_0x1841('0x21')]();};}function saveUpdates(_0x4104fc,_0x58f98a){return function(_0x52b216){if(_0x52b216){return _0x52b216[_0x1841('0x22')](_0x4104fc)[_0x1841('0x23')](function(_0x4f08e0){return _0x4f08e0;});}return null;};}function removeEntity(_0x97cd01,_0x1b0546){return function(_0x88793d){if(_0x88793d){return _0x88793d[_0x1841('0x24')]()[_0x1841('0x23')](function(){_0x97cd01[_0x1841('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x264970,_0x199418){return function(_0x3ad75a){if(!_0x3ad75a){_0x264970[_0x1841('0x18')](0x194);}return _0x3ad75a;};}function handleError(_0x3c26ab,_0x19db92){_0x19db92=_0x19db92||0x1f4;return function(_0xcd1d5d){logger[_0x1841('0x25')](_0xcd1d5d[_0x1841('0x26')]);if(_0xcd1d5d[_0x1841('0x27')]){delete _0xcd1d5d[_0x1841('0x27')];}_0x3c26ab['status'](_0x19db92)[_0x1841('0x28')](_0xcd1d5d);};}exports[_0x1841('0x29')]=function(_0xf83ce5,_0x32fe43){var _0x227513={},_0x3a2fd3={},_0x1c7372={'count':0x0,'rows':[]};var _0x3ae506=db[_0x1841('0x2a')]['rawAttributes'];_0x3a2fd3['model']=_[_0x1841('0x2b')](_0x3ae506);_0x3a2fd3[_0x1841('0x2c')]=_[_0x1841('0x2b')](_0xf83ce5['query']);_0x3a2fd3[_0x1841('0x2d')]=_[_0x1841('0x2e')](_0x3a2fd3[_0x1841('0x2f')],_0x3a2fd3[_0x1841('0x2c')]);_0x227513[_0x1841('0x30')]=_[_0x1841('0x2e')](_0x3a2fd3[_0x1841('0x2f')],qs[_0x1841('0x31')](_0xf83ce5['query'][_0x1841('0x31')]));_0x227513[_0x1841('0x30')]=_0x227513[_0x1841('0x30')][_0x1841('0x32')]?_0x227513[_0x1841('0x30')]:_0x3a2fd3[_0x1841('0x2f')];if(!_0xf83ce5[_0x1841('0x2c')][_0x1841('0x33')](_0x1841('0x34'))){_0x227513[_0x1841('0x1d')]=qs[_0x1841('0x1d')](_0xf83ce5[_0x1841('0x2c')][_0x1841('0x1d')]);_0x227513['offset']=qs[_0x1841('0x1c')](_0xf83ce5[_0x1841('0x2c')][_0x1841('0x1c')]);}_0x227513['order']=qs[_0x1841('0x35')](_0xf83ce5['query'][_0x1841('0x35')]);_0x227513[_0x1841('0x36')]=qs['filters'](_[_0x1841('0x37')](_0xf83ce5[_0x1841('0x2c')],_0x3a2fd3[_0x1841('0x2d')]));if(_0xf83ce5['query'][_0x1841('0x38')]){_0x227513['where']=_[_0x1841('0x39')](_0x227513[_0x1841('0x36')],{'$or':_[_0x1841('0x3a')](_0x3ae506,function(_0x485c26){if(_0x485c26[_0x1841('0x3b')][_0x1841('0x3c')]!==_0x1841('0x3d')){var _0x4a6ecd={};_0x4a6ecd[_0x485c26['field']]={'$like':'%'+_0xf83ce5['query'][_0x1841('0x38')]+'%'};return _0x4a6ecd;}})});}_0x227513=_[_0x1841('0x39')]({},_0x227513,_0xf83ce5[_0x1841('0x3e')]);var _0x418e72={'where':_0x227513[_0x1841('0x36')]};return db[_0x1841('0x2a')][_0x1841('0x3f')](_0x418e72)[_0x1841('0x23')](function(_0x531a9a){_0x1c7372[_0x1841('0x3f')]=_0x531a9a;if(_0xf83ce5[_0x1841('0x2c')][_0x1841('0x40')]){_0x227513[_0x1841('0x41')]=[{'all':!![]}];}return db[_0x1841('0x2a')][_0x1841('0x42')](_0x227513);})[_0x1841('0x23')](function(_0x1b939a){_0x1c7372[_0x1841('0x43')]=_0x1b939a;return _0x1c7372;})[_0x1841('0x23')](respondWithFilteredResult(_0x32fe43,_0x227513))['catch'](handleError(_0x32fe43,null));};exports['show']=function(_0x5afad3,_0x260e3d){var _0x7f74b5={'raw':!![],'where':{'id':_0x5afad3[_0x1841('0x44')]['id']}},_0x266b7a={};_0x266b7a['model']=_[_0x1841('0x2b')](db[_0x1841('0x2a')][_0x1841('0x45')]);_0x266b7a[_0x1841('0x2c')]=_['keys'](_0x5afad3[_0x1841('0x2c')]);_0x266b7a['filters']=_[_0x1841('0x2e')](_0x266b7a['model'],_0x266b7a['query']);_0x7f74b5['attributes']=_[_0x1841('0x2e')](_0x266b7a[_0x1841('0x2f')],qs[_0x1841('0x31')](_0x5afad3[_0x1841('0x2c')][_0x1841('0x31')]));_0x7f74b5[_0x1841('0x30')]=_0x7f74b5[_0x1841('0x30')]['length']?_0x7f74b5[_0x1841('0x30')]:_0x266b7a[_0x1841('0x2f')];if(_0x5afad3['query'][_0x1841('0x40')]){_0x7f74b5[_0x1841('0x41')]=[{'all':!![]}];}_0x7f74b5=_[_0x1841('0x39')]({},_0x7f74b5,_0x5afad3[_0x1841('0x3e')]);return db['SugarcrmField']['find'](_0x7f74b5)[_0x1841('0x23')](handleEntityNotFound(_0x260e3d,null))['then'](respondWithResult(_0x260e3d,null))[_0x1841('0x46')](handleError(_0x260e3d,null));};exports[_0x1841('0x47')]=function(_0x3fb77f,_0x394754){return db[_0x1841('0x2a')][_0x1841('0x47')](_0x3fb77f[_0x1841('0x48')],{})[_0x1841('0x23')](respondWithResult(_0x394754,0xc9))[_0x1841('0x46')](handleError(_0x394754,null));};exports['update']=function(_0x11faf7,_0x201fea){if(_0x11faf7[_0x1841('0x48')]['id']){delete _0x11faf7[_0x1841('0x48')]['id'];}return db[_0x1841('0x2a')][_0x1841('0x49')]({'where':{'id':_0x11faf7[_0x1841('0x44')]['id']}})[_0x1841('0x23')](handleEntityNotFound(_0x201fea,null))[_0x1841('0x23')](saveUpdates(_0x11faf7[_0x1841('0x48')],null))['then'](respondWithResult(_0x201fea,null))[_0x1841('0x46')](handleError(_0x201fea,null));};exports[_0x1841('0x24')]=function(_0xbad811,_0x29e63d){return db['SugarcrmField'][_0x1841('0x49')]({'where':{'id':_0xbad811['params']['id']}})[_0x1841('0x23')](handleEntityNotFound(_0x29e63d,null))[_0x1841('0x23')](removeEntity(_0x29e63d,null))[_0x1841('0x46')](handleError(_0x29e63d,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 5e48e96..406148c 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 _0xebb2=['path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','../../config/logger','moment','bluebird'];(function(_0x57041d,_0x3c34ad){var _0x5c5372=function(_0x248f05){while(--_0x248f05){_0x57041d['push'](_0x57041d['shift']());}};_0x5c5372(++_0x3c34ad);}(_0xebb2,0x173));var _0x2ebb=function(_0x147ab2,_0x29c39e){_0x147ab2=_0x147ab2-0x0;var _0x41577a=_0xebb2[_0x147ab2];return _0x41577a;};'use strict';var _=require(_0x2ebb('0x0'));var util=require('util');var logger=require(_0x2ebb('0x1'))('api');var moment=require(_0x2ebb('0x2'));var BPromise=require(_0x2ebb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2ebb('0x4'));var rimraf=require(_0x2ebb('0x5'));var config=require(_0x2ebb('0x6'));var attributes=require(_0x2ebb('0x7'));module[_0x2ebb('0x8')]=function(_0x4ff023,_0x4fddc){return _0x4ff023[_0x2ebb('0x9')](_0x2ebb('0xa'),attributes,{'tableName':_0x2ebb('0xb'),'paranoid':![],'indexes':[{'name':_0x2ebb('0xc'),'fields':[_0x2ebb('0xd'),_0x2ebb('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6d7e=['./intSugarcrmField.attributes','exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x514a64,_0x329b10){var _0x524009=function(_0x515641){while(--_0x515641){_0x514a64['push'](_0x514a64['shift']());}};_0x524009(++_0x329b10);}(_0x6d7e,0xaf));var _0xe6d7=function(_0x15d9bd,_0x291835){_0x15d9bd=_0x15d9bd-0x0;var _0x42346b=_0x6d7e[_0x15d9bd];return _0x42346b;};'use strict';var _=require('lodash');var util=require(_0xe6d7('0x0'));var logger=require('../../config/logger')(_0xe6d7('0x1'));var moment=require('moment');var BPromise=require(_0xe6d7('0x2'));var rp=require(_0xe6d7('0x3'));var fs=require('fs');var path=require(_0xe6d7('0x4'));var rimraf=require(_0xe6d7('0x5'));var config=require(_0xe6d7('0x6'));var attributes=require(_0xe6d7('0x7'));module[_0xe6d7('0x8')]=function(_0xfd9169,_0x4352d1){return _0xfd9169['define'](_0xe6d7('0x9'),attributes,{'tableName':_0xe6d7('0xa'),'paranoid':![],'indexes':[{'name':_0xe6d7('0xb'),'fields':[_0xe6d7('0xc'),'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 40bb0fa..cd7ec4a 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 _0x6680=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SugarcrmField,\x20%s,\x20%s','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6680,0x135));var _0x0668=function(_0x56db28,_0x95952b){_0x56db28=_0x56db28-0x0;var _0x255efc=_0x6680[_0x56db28];return _0x255efc;};'use strict';var _=require(_0x0668('0x0'));var util=require(_0x0668('0x1'));var moment=require(_0x0668('0x2'));var BPromise=require(_0x0668('0x3'));var rs=require(_0x0668('0x4'));var fs=require('fs');var Redis=require(_0x0668('0x5'));var db=require(_0x0668('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0668('0x7'));var config=require(_0x0668('0x8'));var jayson=require(_0x0668('0x9'));var client=jayson[_0x0668('0xa')][_0x0668('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ac705,_0x1281b8,_0xf534a3){return new BPromise(function(_0x22eef6,_0x2aafc8){return client[_0x0668('0xc')](_0x1ac705,_0xf534a3)[_0x0668('0xd')](function(_0x35a7e4){logger[_0x0668('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x1281b8,'request\x20sent');logger['debug'](_0x0668('0xf'),_0x1281b8,_0x0668('0x10'),JSON[_0x0668('0x11')](_0x35a7e4));if(_0x35a7e4[_0x0668('0x12')]){if(_0x35a7e4[_0x0668('0x12')]['code']===0x1f4){logger[_0x0668('0x12')](_0x0668('0x13'),_0x1281b8,_0x35a7e4['error']['message']);return _0x2aafc8(_0x35a7e4['error'][_0x0668('0x14')]);}logger[_0x0668('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x1281b8,_0x35a7e4[_0x0668('0x12')][_0x0668('0x14')]);return _0x22eef6(_0x35a7e4[_0x0668('0x12')][_0x0668('0x14')]);}else{logger['info']('SugarcrmField,\x20%s,\x20%s',_0x1281b8,_0x0668('0x10'));_0x22eef6(_0x35a7e4[_0x0668('0x15')][_0x0668('0x14')]);}})['catch'](function(_0x3e4cd3){logger[_0x0668('0x12')](_0x0668('0x13'),_0x1281b8,_0x3e4cd3);_0x2aafc8(_0x3e4cd3);});});} \ No newline at end of file +var _0xa532=['code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error'];(function(_0x51eaa4,_0x599324){var _0x183ebb=function(_0x400cee){while(--_0x400cee){_0x51eaa4['push'](_0x51eaa4['shift']());}};_0x183ebb(++_0x599324);}(_0xa532,0x17a));var _0x2a53=function(_0x485952,_0x8fb6b1){_0x485952=_0x485952-0x0;var _0x11b491=_0xa532[_0x485952];return _0x11b491;};'use strict';var _=require(_0x2a53('0x0'));var util=require('util');var moment=require(_0x2a53('0x1'));var BPromise=require(_0x2a53('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a53('0x3'));var db=require(_0x2a53('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2a53('0x5'))(_0x2a53('0x6'));var config=require(_0x2a53('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2a53('0x8')][_0x2a53('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3139af,_0x343d15,_0x4b2c78){return new BPromise(function(_0x584c2a,_0x35504a){return client[_0x2a53('0xa')](_0x3139af,_0x4b2c78)[_0x2a53('0xb')](function(_0x333e68){logger[_0x2a53('0xc')](_0x2a53('0xd'),_0x343d15,_0x2a53('0xe'));logger[_0x2a53('0xf')](_0x2a53('0x10'),_0x343d15,_0x2a53('0xe'),JSON['stringify'](_0x333e68));if(_0x333e68[_0x2a53('0x11')]){if(_0x333e68['error'][_0x2a53('0x12')]===0x1f4){logger[_0x2a53('0x11')](_0x2a53('0xd'),_0x343d15,_0x333e68[_0x2a53('0x11')][_0x2a53('0x13')]);return _0x35504a(_0x333e68[_0x2a53('0x11')][_0x2a53('0x13')]);}logger['error'](_0x2a53('0xd'),_0x343d15,_0x333e68[_0x2a53('0x11')][_0x2a53('0x13')]);return _0x584c2a(_0x333e68['error']['message']);}else{logger[_0x2a53('0xc')](_0x2a53('0xd'),_0x343d15,_0x2a53('0xe'));_0x584c2a(_0x333e68[_0x2a53('0x14')][_0x2a53('0x13')]);}})[_0x2a53('0x15')](function(_0x55bbc5){logger['error'](_0x2a53('0xd'),_0x343d15,_0x55bbc5);_0x35504a(_0x55bbc5);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index e0dba26..653252c 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 _0xd39a=['getFields','post','create','addConfiguration','put','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x2c8857,_0x466084){var _0x499bf0=function(_0x30d07b){while(--_0x30d07b){_0x2c8857['push'](_0x2c8857['shift']());}};_0x499bf0(++_0x466084);}(_0xd39a,0x125));var _0xad39=function(_0x5b89a0,_0x315a2a){_0x5b89a0=_0x5b89a0-0x0;var _0x44d81a=_0xd39a[_0x5b89a0];return _0x44d81a;};'use strict';var multer=require(_0xad39('0x0'));var util=require(_0xad39('0x1'));var path=require('path');var timeout=require(_0xad39('0x2'));var express=require(_0xad39('0x3'));var router=express[_0xad39('0x4')]();var auth=require(_0xad39('0x5'));var interaction=require(_0xad39('0x6'));var config=require('../../config/environment');var controller=require(_0xad39('0x7'));router[_0xad39('0x8')]('/',auth[_0xad39('0x9')](),controller[_0xad39('0xa')]);router[_0xad39('0x8')](_0xad39('0xb'),auth[_0xad39('0x9')](),controller['show']);router['get'](_0xad39('0xc'),auth['isAuthenticated'](),controller[_0xad39('0xd')]);router[_0xad39('0x8')](_0xad39('0xe'),auth[_0xad39('0x9')](),controller[_0xad39('0xf')]);router[_0xad39('0x10')]('/',auth[_0xad39('0x9')](),controller[_0xad39('0x11')]);router[_0xad39('0x10')](_0xad39('0xc'),auth[_0xad39('0x9')](),controller[_0xad39('0x12')]);router[_0xad39('0x13')](_0xad39('0xb'),auth[_0xad39('0x9')](),controller['update']);router[_0xad39('0x14')](_0xad39('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xad39('0x15')]=router; \ No newline at end of file +var _0xe611=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','update','multer','util','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe611,0x1e0));var _0x1e61=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xe611[_0x273c39];return _0x46d6b5;};'use strict';var multer=require(_0x1e61('0x0'));var util=require(_0x1e61('0x1'));var path=require('path');var timeout=require(_0x1e61('0x2'));var express=require(_0x1e61('0x3'));var router=express[_0x1e61('0x4')]();var auth=require(_0x1e61('0x5'));var interaction=require(_0x1e61('0x6'));var config=require(_0x1e61('0x7'));var controller=require(_0x1e61('0x8'));router[_0x1e61('0x9')]('/',auth[_0x1e61('0xa')](),controller[_0x1e61('0xb')]);router[_0x1e61('0x9')](_0x1e61('0xc'),auth[_0x1e61('0xa')](),controller[_0x1e61('0xd')]);router[_0x1e61('0x9')]('/:id/configurations',auth[_0x1e61('0xa')](),controller[_0x1e61('0xe')]);router['get'](_0x1e61('0xf'),auth[_0x1e61('0xa')](),controller[_0x1e61('0x10')]);router['post']('/',auth[_0x1e61('0xa')](),controller['create']);router[_0x1e61('0x11')](_0x1e61('0x12'),auth[_0x1e61('0xa')](),controller[_0x1e61('0x13')]);router[_0x1e61('0x14')]('/:id',auth[_0x1e61('0xa')](),controller[_0x1e61('0x15')]);router['delete'](_0x1e61('0xc'),auth[_0x1e61('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 8ec9a8e..2fd59eb 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 _0x072b=['HelpDesk','sequelize','exports','STRING'];(function(_0x49c362,_0x49597b){var _0xc25dfc=function(_0x392fcc){while(--_0x392fcc){_0x49c362['push'](_0x49c362['shift']());}};_0xc25dfc(++_0x49597b);}(_0x072b,0x151));var _0xb072=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x072b[_0x45783c];return _0x1161da;};'use strict';var Sequelize=require(_0xb072('0x0'));module[_0xb072('0x1')]={'name':{'type':Sequelize[_0xb072('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb072('0x2')]},'username':{'type':Sequelize[_0xb072('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xb072('0x2')],'allowNull':![],'defaultValue':_0xb072('0x3')},'remoteUri':{'type':Sequelize[_0xb072('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xb072('0x2')]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x5912=['exports','STRING','sequelize'];(function(_0x3b4b79,_0x395e10){var _0x5d48b9=function(_0x48aaa6){while(--_0x48aaa6){_0x3b4b79['push'](_0x3b4b79['shift']());}};_0x5d48b9(++_0x395e10);}(_0x5912,0xa4));var _0x2591=function(_0x29aae2,_0x178a7b){_0x29aae2=_0x29aae2-0x0;var _0xb9f5b=_0x5912[_0x29aae2];return _0xb9f5b;};'use strict';var Sequelize=require(_0x2591('0x0'));module[_0x2591('0x1')]={'name':{'type':Sequelize[_0x2591('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x2591('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x2591('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING']},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 0e92658..9477f68 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 _0x9350=['picklist','picklistValues','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','destroy','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','merge','where','type','field','VtigerAccount','includeAll','include','findAll','rows','params','length','options','find','create','body','getConfigurations','order','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','VtigerConfiguration','VtigerField','getFields','findOne','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','%s/webservice.php','GET','success','POST','login','token','describe','reference','owner','remove','includes','editable','map','label','startsWith','cf_'];(function(_0x3b7029,_0x32df22){var _0x273101=function(_0x4ec451){while(--_0x4ec451){_0x3b7029['push'](_0x3b7029['shift']());}};_0x273101(++_0x32df22);}(_0x9350,0x182));var _0x0935=function(_0xba1760,_0x191969){_0xba1760=_0xba1760-0x0;var _0x1f3143=_0x9350[_0xba1760];return _0x1f3143;};'use strict';var pdf=require(_0x0935('0x0'));var emlformat=require(_0x0935('0x1'));var rimraf=require(_0x0935('0x2'));var zipdir=require(_0x0935('0x3'));var jsonpatch=require(_0x0935('0x4'));var rp=require('request-promise');var moment=require(_0x0935('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0935('0x6'));var csv=require(_0x0935('0x7'));var ejs=require(_0x0935('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0935('0x9'));var crypto=require('crypto');var jsforce=require(_0x0935('0xa'));var deskjs=require(_0x0935('0xb'));var toCsv=require(_0x0935('0x7'));var querystring=require(_0x0935('0xc'));var Papa=require(_0x0935('0xd'));var Redis=require(_0x0935('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x0935('0xf'));var logger=require(_0x0935('0x10'))(_0x0935('0x11'));var utils=require(_0x0935('0x12'));var config=require('../../config/environment');var db=require(_0x0935('0x13'))['db'];var integrations=require(_0x0935('0x14'));var jayson=require(_0x0935('0x15'));var client=jayson[_0x0935('0x16')][_0x0935('0x17')]({'port':0x232a});function checkPasswordPattern(_0x52738d,_0x585123,_0x170984){if(_0x170984){var _0x4771e4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4771e4['test'](_0x585123)){return _0x52738d;}else{throw new Error(_0x0935('0x18'));}}else{return _0x52738d;}}function respondWithRpcPromise(_0x2dd9ed,_0x320838,_0xf21245,_0x33bce0){return new BPromise(function(_0x4fcb31,_0x3da1aa){var _0x5e7a69=_0x33bce0||client;return _0x5e7a69[_0x0935('0x19')](_0x2dd9ed,_0xf21245)[_0x0935('0x1a')](function(_0x22315b){logger[_0x0935('0x1b')](_0x0935('0x1c'),_0x320838,_0x0935('0x1d'));logger[_0x0935('0x1e')](_0x0935('0x1f'),_0x320838,_0x0935('0x1d'),JSON[_0x0935('0x20')](_0x22315b));if(_0x22315b[_0x0935('0x21')]){if(_0x22315b[_0x0935('0x21')][_0x0935('0x22')]===0x1f4){logger[_0x0935('0x21')](_0x0935('0x1c'),_0x320838,_0x22315b[_0x0935('0x21')][_0x0935('0x23')]);return _0x3da1aa(_0x22315b[_0x0935('0x21')][_0x0935('0x23')]);}logger[_0x0935('0x21')](_0x0935('0x1c'),_0x320838,_0x22315b[_0x0935('0x21')][_0x0935('0x23')]);return _0x4fcb31(_0x22315b[_0x0935('0x21')][_0x0935('0x23')]);}else{logger[_0x0935('0x1b')](_0x0935('0x1c'),_0x320838,'request\x20sent');_0x4fcb31(_0x22315b[_0x0935('0x24')][_0x0935('0x23')]);}})[_0x0935('0x25')](function(_0x30e9f5){logger[_0x0935('0x21')](_0x0935('0x1c'),_0x320838,_0x30e9f5);_0x3da1aa(_0x30e9f5);});});}function respondWithStatusCode(_0xfc6c7,_0x83f055){_0x83f055=_0x83f055||0xcc;return function(_0xa3be92){if(_0xa3be92){return _0xfc6c7[_0x0935('0x26')](_0x83f055);}return _0xfc6c7['status'](_0x83f055)[_0x0935('0x27')]();};}function respondWithResult(_0x23e17c,_0x2279e5){_0x2279e5=_0x2279e5||0xc8;return function(_0x3b5787){if(_0x3b5787){return _0x23e17c[_0x0935('0x28')](_0x2279e5)[_0x0935('0x29')](_0x3b5787);}};}function respondWithFilteredResult(_0x17348e,_0x579507){return function(_0x7c0695){if(_0x7c0695){var _0x9324e5=_0x7c0695[_0x0935('0x2a')],_0x509849=_0x579507['offset'],_0x377138=_0x579507[_0x0935('0x2b')]+_0x579507[_0x0935('0x2c')],_0x23644d;if(_0x377138>=_0x9324e5){_0x377138=_0x9324e5;_0x23644d=0xc8;}else{_0x23644d=0xce;}_0x17348e[_0x0935('0x28')](_0x23644d);return _0x17348e[_0x0935('0x2d')]('Content-Range',_0x509849+'-'+_0x377138+'/'+_0x9324e5)[_0x0935('0x29')](_0x7c0695);}return null;};}function patchUpdates(_0x2ae1bb){return function(_0x2f4f2e){try{jsonpatch[_0x0935('0x2e')](_0x2f4f2e,_0x2ae1bb,!![]);}catch(_0x4d5a3e){return BPromise[_0x0935('0x2f')](_0x4d5a3e);}return _0x2f4f2e[_0x0935('0x30')]();};}function saveUpdates(_0x1dd3b3,_0x20d604){return function(_0x4de777){if(_0x4de777){return _0x4de777[_0x0935('0x31')](_0x1dd3b3)[_0x0935('0x1a')](function(_0x20a456){return _0x20a456;});}return null;};}function removeEntity(_0xc10c41,_0x5670bb){return function(_0x4e3139){if(_0x4e3139){return _0x4e3139[_0x0935('0x32')]()[_0x0935('0x1a')](function(){_0xc10c41[_0x0935('0x28')](0xcc)[_0x0935('0x27')]();});}};}function handleEntityNotFound(_0x130afb,_0x3884eb){return function(_0x1a459e){if(!_0x1a459e){_0x130afb[_0x0935('0x26')](0x194);}return _0x1a459e;};}function handleError(_0x22e27c,_0x35b6ac){_0x35b6ac=_0x35b6ac||0x1f4;return function(_0x344503){logger[_0x0935('0x21')](_0x344503['stack']);if(_0x344503['name']){delete _0x344503[_0x0935('0x33')];}_0x22e27c['status'](_0x35b6ac)[_0x0935('0x34')](_0x344503);};}exports[_0x0935('0x35')]=function(_0x45b538,_0x58747a){var _0x50a187={},_0x1d5919={},_0x1d3a71={'count':0x0,'rows':[]};var _0x28b31d=db['VtigerAccount'][_0x0935('0x36')];_0x1d5919[_0x0935('0x37')]=_[_0x0935('0x38')](_0x28b31d);_0x1d5919['query']=_['keys'](_0x45b538[_0x0935('0x39')]);_0x1d5919[_0x0935('0x3a')]=_[_0x0935('0x3b')](_0x1d5919[_0x0935('0x37')],_0x1d5919[_0x0935('0x39')]);_0x50a187[_0x0935('0x3c')]=_[_0x0935('0x3b')](_0x1d5919[_0x0935('0x37')],qs[_0x0935('0x3d')](_0x45b538[_0x0935('0x39')][_0x0935('0x3d')]));_0x50a187['attributes']=_0x50a187[_0x0935('0x3c')]['length']?_0x50a187[_0x0935('0x3c')]:_0x1d5919[_0x0935('0x37')];if(!_0x45b538[_0x0935('0x39')][_0x0935('0x3e')](_0x0935('0x3f'))){_0x50a187[_0x0935('0x2c')]=qs[_0x0935('0x2c')](_0x45b538[_0x0935('0x39')][_0x0935('0x2c')]);_0x50a187['offset']=qs[_0x0935('0x2b')](_0x45b538[_0x0935('0x39')][_0x0935('0x2b')]);}_0x50a187['order']=qs['sort'](_0x45b538[_0x0935('0x39')][_0x0935('0x40')]);_0x50a187['where']=qs[_0x0935('0x3a')](_[_0x0935('0x41')](_0x45b538[_0x0935('0x39')],_0x1d5919['filters']));if(_0x45b538[_0x0935('0x39')][_0x0935('0x42')]){_0x50a187['where']=_[_0x0935('0x43')](_0x50a187[_0x0935('0x44')],{'$or':_['map'](_0x28b31d,function(_0x16a567){if(_0x16a567[_0x0935('0x45')]['key']!=='VIRTUAL'){var _0x3215cd={};_0x3215cd[_0x16a567[_0x0935('0x46')]]={'$like':'%'+_0x45b538['query'][_0x0935('0x42')]+'%'};return _0x3215cd;}})});}_0x50a187=_[_0x0935('0x43')]({},_0x50a187,_0x45b538['options']);var _0x574508={'where':_0x50a187['where']};return db[_0x0935('0x47')]['count'](_0x574508)[_0x0935('0x1a')](function(_0x1f17e2){_0x1d3a71[_0x0935('0x2a')]=_0x1f17e2;if(_0x45b538[_0x0935('0x39')][_0x0935('0x48')]){_0x50a187[_0x0935('0x49')]=[{'all':!![]}];}return db[_0x0935('0x47')][_0x0935('0x4a')](_0x50a187);})[_0x0935('0x1a')](function(_0x4e5656){_0x1d3a71[_0x0935('0x4b')]=_0x4e5656;return _0x1d3a71;})[_0x0935('0x1a')](respondWithFilteredResult(_0x58747a,_0x50a187))['catch'](handleError(_0x58747a,null));};exports['show']=function(_0x4f5aaa,_0x523c22){var _0x159f2f={'raw':![],'where':{'id':_0x4f5aaa[_0x0935('0x4c')]['id']}},_0x1bc68e={};_0x1bc68e[_0x0935('0x37')]=_[_0x0935('0x38')](db[_0x0935('0x47')][_0x0935('0x36')]);_0x1bc68e[_0x0935('0x39')]=_[_0x0935('0x38')](_0x4f5aaa[_0x0935('0x39')]);_0x1bc68e[_0x0935('0x3a')]=_[_0x0935('0x3b')](_0x1bc68e['model'],_0x1bc68e[_0x0935('0x39')]);_0x159f2f['attributes']=_['intersection'](_0x1bc68e[_0x0935('0x37')],qs['fields'](_0x4f5aaa['query'][_0x0935('0x3d')]));_0x159f2f[_0x0935('0x3c')]=_0x159f2f[_0x0935('0x3c')][_0x0935('0x4d')]?_0x159f2f[_0x0935('0x3c')]:_0x1bc68e[_0x0935('0x37')];if(_0x4f5aaa['query']['includeAll']){_0x159f2f['include']=[{'all':!![]}];}_0x159f2f=_['merge']({},_0x159f2f,_0x4f5aaa[_0x0935('0x4e')]);return db[_0x0935('0x47')][_0x0935('0x4f')](_0x159f2f)[_0x0935('0x1a')](handleEntityNotFound(_0x523c22,null))['then'](respondWithResult(_0x523c22,null))[_0x0935('0x25')](handleError(_0x523c22,null));};exports['create']=function(_0x302910,_0x2cfc8a){return db[_0x0935('0x47')][_0x0935('0x50')](_0x302910['body'],{})[_0x0935('0x1a')](respondWithResult(_0x2cfc8a,0xc9))[_0x0935('0x25')](handleError(_0x2cfc8a,null));};exports[_0x0935('0x31')]=function(_0x23f26d,_0x9fa24b){if(_0x23f26d[_0x0935('0x51')]['id']){delete _0x23f26d[_0x0935('0x51')]['id'];}return db[_0x0935('0x47')][_0x0935('0x4f')]({'where':{'id':_0x23f26d['params']['id']}})['then'](handleEntityNotFound(_0x9fa24b,null))[_0x0935('0x1a')](saveUpdates(_0x23f26d[_0x0935('0x51')],null))[_0x0935('0x1a')](respondWithResult(_0x9fa24b,null))['catch'](handleError(_0x9fa24b,null));};exports[_0x0935('0x32')]=function(_0x4488d2,_0x3140f6){return db[_0x0935('0x47')]['find']({'where':{'id':_0x4488d2[_0x0935('0x4c')]['id']}})[_0x0935('0x1a')](handleEntityNotFound(_0x3140f6,null))[_0x0935('0x1a')](removeEntity(_0x3140f6,null))[_0x0935('0x25')](handleError(_0x3140f6,null));};exports[_0x0935('0x52')]=function(_0x59979f,_0x88bc50,_0x5b5c47){var _0x20f416={};var _0x26fa70={};var _0x218fcd;var _0x665099;return db[_0x0935('0x47')]['findOne']({'where':{'id':_0x59979f[_0x0935('0x4c')]['id']}})[_0x0935('0x1a')](handleEntityNotFound(_0x88bc50,null))[_0x0935('0x1a')](function(_0x4bc466){if(_0x4bc466){_0x218fcd=_0x4bc466;_0x26fa70[_0x0935('0x37')]=_['keys'](db['VtigerConfiguration']['rawAttributes']);_0x26fa70[_0x0935('0x39')]=_[_0x0935('0x38')](_0x59979f['query']);_0x26fa70['filters']=_[_0x0935('0x3b')](_0x26fa70[_0x0935('0x37')],_0x26fa70[_0x0935('0x39')]);_0x20f416['attributes']=_[_0x0935('0x3b')](_0x26fa70[_0x0935('0x37')],qs[_0x0935('0x3d')](_0x59979f['query']['fields']));_0x20f416[_0x0935('0x3c')]=_0x20f416[_0x0935('0x3c')][_0x0935('0x4d')]?_0x20f416['attributes']:_0x26fa70[_0x0935('0x37')];_0x20f416[_0x0935('0x53')]=qs['sort'](_0x59979f['query'][_0x0935('0x40')]);_0x20f416['where']=qs[_0x0935('0x3a')](_[_0x0935('0x41')](_0x59979f[_0x0935('0x39')],_0x26fa70[_0x0935('0x3a')]));if(_0x59979f[_0x0935('0x39')]['filter']){_0x20f416['where']=_[_0x0935('0x43')](_0x20f416['where'],{'$or':_['map'](_0x20f416[_0x0935('0x3c')],function(_0x20fe36){var _0x36258b={};_0x36258b[_0x20fe36]={'$like':'%'+_0x59979f[_0x0935('0x39')][_0x0935('0x42')]+'%'};return _0x36258b;})});}_0x20f416=_[_0x0935('0x43')]({},_0x20f416,_0x59979f[_0x0935('0x4e')]);return _0x218fcd['getConfigurations'](_0x20f416);}})['then'](function(_0x522c60){if(_0x522c60){_0x665099=_0x522c60[_0x0935('0x4d')];if(!_0x59979f['query'][_0x0935('0x3e')](_0x0935('0x3f'))){_0x20f416[_0x0935('0x2c')]=qs[_0x0935('0x2c')](_0x59979f[_0x0935('0x39')][_0x0935('0x2c')]);_0x20f416[_0x0935('0x2b')]=qs[_0x0935('0x2b')](_0x59979f[_0x0935('0x39')]['offset']);}return _0x218fcd['getConfigurations'](_0x20f416);}})[_0x0935('0x1a')](function(_0x5f221c){if(_0x5f221c){return _0x5f221c?{'count':_0x665099,'rows':_0x5f221c}:null;}})[_0x0935('0x1a')](respondWithResult(_0x88bc50,null))[_0x0935('0x25')](handleError(_0x88bc50,null));};exports[_0x0935('0x54')]=function(_0x49e9b5,_0x54ba85,_0x8fbfbc){if(_0x49e9b5[_0x0935('0x51')]['id']){delete _0x49e9b5[_0x0935('0x51')]['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x49e9b5['params']['id']}})['then'](handleEntityNotFound(_0x54ba85,null))[_0x0935('0x1a')](function(_0x32cd35){if(_0x32cd35){_0x49e9b5[_0x0935('0x51')][_0x0935('0x55')]=_0x32cd35['id'];_0x49e9b5['body'][_0x0935('0x56')]=integrations[_0x0935('0x57')](_0x49e9b5[_0x0935('0x51')]['channel'],_0x49e9b5['body'][_0x0935('0x45')]);_0x49e9b5[_0x0935('0x51')][_0x0935('0x58')]=integrations['getDescriptions'](_0x49e9b5[_0x0935('0x51')][_0x0935('0x59')],_0x49e9b5['body']['type']);return db[_0x0935('0x5a')][_0x0935('0x50')](_0x49e9b5[_0x0935('0x51')],{'include':[{'model':db[_0x0935('0x5b')],'as':_0x0935('0x56')},{'model':db['VtigerField'],'as':_0x0935('0x58')}]});}return null;})[_0x0935('0x1a')](respondWithResult(_0x54ba85,null))['catch'](handleError(_0x54ba85,null));};var md5=require('md5');exports[_0x0935('0x5c')]=function(_0x210055,_0x158e62,_0x28a0e6){var _0x2f7f7b=null;var _0x2401f3=null;var _0x4fe940=null;var _0x323f05=null;var _0x140b8b='';return db[_0x0935('0x47')][_0x0935('0x5d')]({'where':{'id':_0x210055['params']['id']},'attributes':['id','name',_0x0935('0x5e'),_0x0935('0x5f'),_0x0935('0x60'),_0x0935('0x61'),_0x0935('0x62'),_0x0935('0x63')]})[_0x0935('0x1a')](handleEntityNotFound(_0x158e62,null))[_0x0935('0x1a')](function(_0x27c6dd){if(_0x27c6dd){_0x2f7f7b=_0x27c6dd['username'];_0x2401f3=_0x27c6dd[_0x0935('0x63')];_0x4fe940=_0x27c6dd[_0x0935('0x60')];_0x140b8b=_0x27c6dd['remoteUri'];var _0x5f1810=_0x140b8b[_0x0935('0x64')](-0x1);if(_0x5f1810==='/'){_0x140b8b=_0x140b8b[_0x0935('0x65')](0x0,_0x140b8b['lastIndexOf'](_0x5f1810));}_0x323f05=util['format'](_0x0935('0x66'),_0x140b8b);var _0x45719b={'method':_0x0935('0x67'),'uri':_0x323f05,'qs':{'operation':'getchallenge','username':_0x27c6dd[_0x0935('0x5e')]},'json':!![]};return rp(_0x45719b);}})[_0x0935('0x1a')](function(_0x4e8639){if(_0x4e8639[_0x0935('0x68')]){var _0x20ea75={'method':_0x0935('0x69'),'uri':_0x323f05,'form':{'operation':_0x0935('0x6a'),'username':_0x2f7f7b,'accessKey':md5(_0x4e8639[_0x0935('0x24')][_0x0935('0x6b')]+_0x2401f3)},'json':!![]};return rp(_0x20ea75);}})[_0x0935('0x1a')](function(_0x2c03be){if(_0x2c03be[_0x0935('0x68')]){var _0x5a47bd={'method':_0x0935('0x67'),'uri':_0x323f05,'qs':{'operation':_0x0935('0x6c'),'username':_0x2f7f7b,'sessionName':_0x2c03be['result']['sessionName'],'elementType':_0x4fe940},'json':!![]};return rp(_0x5a47bd);}})['then'](function(_0x55e39d){if(_0x55e39d[_0x0935('0x68')]){var _0x1f2bb7=['autogenerated',_0x0935('0x6d'),_0x0935('0x6e')];_[_0x0935('0x6f')](_0x55e39d['result'][_0x0935('0x3d')],function(_0x4a9041){return _0x1f2bb7[_0x0935('0x70')](_0x4a9041[_0x0935('0x45')][_0x0935('0x33')]);});_[_0x0935('0x6f')](_0x55e39d[_0x0935('0x24')][_0x0935('0x3d')],function(_0x278732){return _0x278732[_0x0935('0x71')]==='false';});return{'count':_0x55e39d[_0x0935('0x24')][_0x0935('0x3d')][_0x0935('0x4d')],'rows':_[_0x0935('0x72')](_0x55e39d['result']['fields'],function(_0x19b60f){return{'id':_0x19b60f['name'],'name':_0x19b60f[_0x0935('0x73')],'custom':_[_0x0935('0x74')](_0x19b60f[_0x0935('0x33')],_0x0935('0x75'))?!![]:![],'options':_0x19b60f[_0x0935('0x45')][_0x0935('0x33')]===_0x0935('0x76')&&_0x19b60f[_0x0935('0x45')][_0x0935('0x77')][_0x0935('0x4d')]>0x0?_[_0x0935('0x72')](_0x19b60f[_0x0935('0x45')][_0x0935('0x77')],function(_0x18c5f6){return{'name':_0x18c5f6[_0x0935('0x73')],'value':_0x18c5f6['value']};}):[]};})};}})[_0x0935('0x1a')](respondWithResult(_0x158e62,null))[_0x0935('0x25')](function(_0x452192){console[_0x0935('0x78')](_0x0935('0x79')+_0x452192);var _0x49033f=_0x210055['query'][_0x0935('0x7a')]?0x1f4:_0x452192[_0x0935('0x7b')]||0x1f4;logger[_0x0935('0x21')](_0x0935('0x7c'),_0x0935('0x5c'),_0x49033f,JSON[_0x0935('0x20')](_0x452192));delete _0x452192[_0x0935('0x33')];if(_0x49033f===0x191){_0x49033f=0x190;}_0x158e62[_0x0935('0x28')](_0x49033f)[_0x0935('0x34')](_0x210055[_0x0935('0x39')][_0x0935('0x7a')]?{'message':_0x0935('0x7d'),'statusCode':_0x452192[_0x0935('0x7b')]}:_0x452192);});}; \ No newline at end of file +var _0x9abe=['getSubjects','Descriptions','channel','VtigerField','md5','getFields','username','description','moduleName','remoteUri','accessKey','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','sessionName','autogenerated','reference','owner','remove','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','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','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','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~!@#$%^&-_=+[{]}.','info','request\x20sent','debug','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','count','offset','set','Content-Range','apply','save','update','then','end','name','send','index','VtigerAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','where','pick','filter','merge','map','type','key','field','include','findAll','rows','params','includeAll','options','create','body','destroy','find','getConfigurations','findOne','VtigerConfiguration','sort','addConfiguration','Subjects'];(function(_0x357702,_0x203968){var _0x4dd94a=function(_0x11bc16){while(--_0x11bc16){_0x357702['push'](_0x357702['shift']());}};_0x4dd94a(++_0x203968);}(_0x9abe,0x12c));var _0xe9ab=function(_0x27c053,_0x227c26){_0x27c053=_0x27c053-0x0;var _0x53aab5=_0x9abe[_0x27c053];return _0x53aab5;};'use strict';var pdf=require(_0xe9ab('0x0'));var emlformat=require(_0xe9ab('0x1'));var rimraf=require(_0xe9ab('0x2'));var zipdir=require(_0xe9ab('0x3'));var jsonpatch=require(_0xe9ab('0x4'));var rp=require(_0xe9ab('0x5'));var moment=require('moment');var BPromise=require(_0xe9ab('0x6'));var Mustache=require(_0xe9ab('0x7'));var util=require(_0xe9ab('0x8'));var path=require(_0xe9ab('0x9'));var sox=require(_0xe9ab('0xa'));var csv=require(_0xe9ab('0xb'));var ejs=require(_0xe9ab('0xc'));var fs=require('fs');var _=require(_0xe9ab('0xd'));var squel=require(_0xe9ab('0xe'));var crypto=require(_0xe9ab('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xe9ab('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe9ab('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe9ab('0x12'));var hardwareService=require(_0xe9ab('0x13'));var logger=require(_0xe9ab('0x14'))(_0xe9ab('0x15'));var utils=require(_0xe9ab('0x16'));var config=require(_0xe9ab('0x17'));var db=require(_0xe9ab('0x18'))['db'];var integrations=require(_0xe9ab('0x19'));var jayson=require(_0xe9ab('0x1a'));var client=jayson[_0xe9ab('0x1b')][_0xe9ab('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x597429,_0x3b9ece,_0x62014d){if(_0x62014d){var _0x579c44=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x579c44[_0xe9ab('0x1d')](_0x3b9ece)){return _0x597429;}else{throw new Error(_0xe9ab('0x1e'));}}else{return _0x597429;}}function respondWithRpcPromise(_0x3ffef5,_0x55e83d,_0x30f575,_0x48b851){return new BPromise(function(_0x43e822,_0x52a488){var _0x367e4f=_0x48b851||client;return _0x367e4f['request'](_0x3ffef5,_0x30f575)['then'](function(_0xaf987b){logger[_0xe9ab('0x1f')]('VtigerAccount,\x20%s,\x20%s',_0x55e83d,_0xe9ab('0x20'));logger[_0xe9ab('0x21')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x55e83d,_0xe9ab('0x20'),JSON[_0xe9ab('0x22')](_0xaf987b));if(_0xaf987b[_0xe9ab('0x23')]){if(_0xaf987b[_0xe9ab('0x23')][_0xe9ab('0x24')]===0x1f4){logger[_0xe9ab('0x23')](_0xe9ab('0x25'),_0x55e83d,_0xaf987b[_0xe9ab('0x23')][_0xe9ab('0x26')]);return _0x52a488(_0xaf987b['error']['message']);}logger['error'](_0xe9ab('0x25'),_0x55e83d,_0xaf987b[_0xe9ab('0x23')][_0xe9ab('0x26')]);return _0x43e822(_0xaf987b[_0xe9ab('0x23')][_0xe9ab('0x26')]);}else{logger[_0xe9ab('0x1f')]('VtigerAccount,\x20%s,\x20%s',_0x55e83d,_0xe9ab('0x20'));_0x43e822(_0xaf987b[_0xe9ab('0x27')]['message']);}})[_0xe9ab('0x28')](function(_0x2ae6e6){logger[_0xe9ab('0x23')](_0xe9ab('0x25'),_0x55e83d,_0x2ae6e6);_0x52a488(_0x2ae6e6);});});}function respondWithStatusCode(_0x340660,_0x501f8e){_0x501f8e=_0x501f8e||0xcc;return function(_0x465f68){if(_0x465f68){return _0x340660[_0xe9ab('0x29')](_0x501f8e);}return _0x340660['status'](_0x501f8e)['end']();};}function respondWithResult(_0x1ee6be,_0x449fd6){_0x449fd6=_0x449fd6||0xc8;return function(_0x1fd3e4){if(_0x1fd3e4){return _0x1ee6be[_0xe9ab('0x2a')](_0x449fd6)[_0xe9ab('0x2b')](_0x1fd3e4);}};}function respondWithFilteredResult(_0x2dea1b,_0x148709){return function(_0x12eb91){if(_0x12eb91){var _0x246248=_0x12eb91[_0xe9ab('0x2c')],_0x36e78d=_0x148709[_0xe9ab('0x2d')],_0x250d68=_0x148709[_0xe9ab('0x2d')]+_0x148709['limit'],_0x3c3635;if(_0x250d68>=_0x246248){_0x250d68=_0x246248;_0x3c3635=0xc8;}else{_0x3c3635=0xce;}_0x2dea1b[_0xe9ab('0x2a')](_0x3c3635);return _0x2dea1b[_0xe9ab('0x2e')](_0xe9ab('0x2f'),_0x36e78d+'-'+_0x250d68+'/'+_0x246248)['json'](_0x12eb91);}return null;};}function patchUpdates(_0x326b84){return function(_0x44eb8c){try{jsonpatch[_0xe9ab('0x30')](_0x44eb8c,_0x326b84,!![]);}catch(_0x505250){return BPromise['reject'](_0x505250);}return _0x44eb8c[_0xe9ab('0x31')]();};}function saveUpdates(_0x1e6175,_0x382ce7){return function(_0x18abdf){if(_0x18abdf){return _0x18abdf[_0xe9ab('0x32')](_0x1e6175)[_0xe9ab('0x33')](function(_0x26c188){return _0x26c188;});}return null;};}function removeEntity(_0x1c377a,_0x443a52){return function(_0x46ae76){if(_0x46ae76){return _0x46ae76['destroy']()['then'](function(){_0x1c377a[_0xe9ab('0x2a')](0xcc)[_0xe9ab('0x34')]();});}};}function handleEntityNotFound(_0x213fbc,_0x1f9159){return function(_0x4e5e37){if(!_0x4e5e37){_0x213fbc['sendStatus'](0x194);}return _0x4e5e37;};}function handleError(_0x535052,_0xd2a8c7){_0xd2a8c7=_0xd2a8c7||0x1f4;return function(_0x246a81){logger[_0xe9ab('0x23')](_0x246a81['stack']);if(_0x246a81[_0xe9ab('0x35')]){delete _0x246a81[_0xe9ab('0x35')];}_0x535052[_0xe9ab('0x2a')](_0xd2a8c7)[_0xe9ab('0x36')](_0x246a81);};}exports[_0xe9ab('0x37')]=function(_0x3e5795,_0x2b3a7e){var _0x304c9a={},_0x5dcda8={},_0x397c13={'count':0x0,'rows':[]};var _0x5edd1b=db[_0xe9ab('0x38')][_0xe9ab('0x39')];_0x5dcda8[_0xe9ab('0x3a')]=_['keys'](_0x5edd1b);_0x5dcda8['query']=_[_0xe9ab('0x3b')](_0x3e5795[_0xe9ab('0x3c')]);_0x5dcda8[_0xe9ab('0x3d')]=_[_0xe9ab('0x3e')](_0x5dcda8[_0xe9ab('0x3a')],_0x5dcda8[_0xe9ab('0x3c')]);_0x304c9a[_0xe9ab('0x3f')]=_[_0xe9ab('0x3e')](_0x5dcda8[_0xe9ab('0x3a')],qs[_0xe9ab('0x40')](_0x3e5795[_0xe9ab('0x3c')][_0xe9ab('0x40')]));_0x304c9a[_0xe9ab('0x3f')]=_0x304c9a[_0xe9ab('0x3f')][_0xe9ab('0x41')]?_0x304c9a['attributes']:_0x5dcda8[_0xe9ab('0x3a')];if(!_0x3e5795[_0xe9ab('0x3c')]['hasOwnProperty'](_0xe9ab('0x42'))){_0x304c9a[_0xe9ab('0x43')]=qs[_0xe9ab('0x43')](_0x3e5795[_0xe9ab('0x3c')][_0xe9ab('0x43')]);_0x304c9a[_0xe9ab('0x2d')]=qs[_0xe9ab('0x2d')](_0x3e5795[_0xe9ab('0x3c')]['offset']);}_0x304c9a[_0xe9ab('0x44')]=qs['sort'](_0x3e5795[_0xe9ab('0x3c')]['sort']);_0x304c9a[_0xe9ab('0x45')]=qs[_0xe9ab('0x3d')](_[_0xe9ab('0x46')](_0x3e5795[_0xe9ab('0x3c')],_0x5dcda8['filters']));if(_0x3e5795[_0xe9ab('0x3c')][_0xe9ab('0x47')]){_0x304c9a[_0xe9ab('0x45')]=_[_0xe9ab('0x48')](_0x304c9a[_0xe9ab('0x45')],{'$or':_[_0xe9ab('0x49')](_0x5edd1b,function(_0x3d7194){if(_0x3d7194[_0xe9ab('0x4a')][_0xe9ab('0x4b')]!=='VIRTUAL'){var _0x94f195={};_0x94f195[_0x3d7194[_0xe9ab('0x4c')]]={'$like':'%'+_0x3e5795[_0xe9ab('0x3c')][_0xe9ab('0x47')]+'%'};return _0x94f195;}})});}_0x304c9a=_[_0xe9ab('0x48')]({},_0x304c9a,_0x3e5795['options']);var _0x775879={'where':_0x304c9a[_0xe9ab('0x45')]};return db[_0xe9ab('0x38')]['count'](_0x775879)[_0xe9ab('0x33')](function(_0x5ba446){_0x397c13[_0xe9ab('0x2c')]=_0x5ba446;if(_0x3e5795[_0xe9ab('0x3c')]['includeAll']){_0x304c9a[_0xe9ab('0x4d')]=[{'all':!![]}];}return db[_0xe9ab('0x38')][_0xe9ab('0x4e')](_0x304c9a);})['then'](function(_0x354855){_0x397c13[_0xe9ab('0x4f')]=_0x354855;return _0x397c13;})[_0xe9ab('0x33')](respondWithFilteredResult(_0x2b3a7e,_0x304c9a))[_0xe9ab('0x28')](handleError(_0x2b3a7e,null));};exports['show']=function(_0x312027,_0xd517b0){var _0x9eee59={'raw':![],'where':{'id':_0x312027[_0xe9ab('0x50')]['id']}},_0x4c1791={};_0x4c1791[_0xe9ab('0x3a')]=_[_0xe9ab('0x3b')](db[_0xe9ab('0x38')]['rawAttributes']);_0x4c1791[_0xe9ab('0x3c')]=_[_0xe9ab('0x3b')](_0x312027[_0xe9ab('0x3c')]);_0x4c1791[_0xe9ab('0x3d')]=_[_0xe9ab('0x3e')](_0x4c1791[_0xe9ab('0x3a')],_0x4c1791['query']);_0x9eee59[_0xe9ab('0x3f')]=_['intersection'](_0x4c1791[_0xe9ab('0x3a')],qs[_0xe9ab('0x40')](_0x312027['query'][_0xe9ab('0x40')]));_0x9eee59['attributes']=_0x9eee59['attributes'][_0xe9ab('0x41')]?_0x9eee59[_0xe9ab('0x3f')]:_0x4c1791['model'];if(_0x312027[_0xe9ab('0x3c')][_0xe9ab('0x51')]){_0x9eee59[_0xe9ab('0x4d')]=[{'all':!![]}];}_0x9eee59=_['merge']({},_0x9eee59,_0x312027[_0xe9ab('0x52')]);return db[_0xe9ab('0x38')]['find'](_0x9eee59)[_0xe9ab('0x33')](handleEntityNotFound(_0xd517b0,null))[_0xe9ab('0x33')](respondWithResult(_0xd517b0,null))[_0xe9ab('0x28')](handleError(_0xd517b0,null));};exports[_0xe9ab('0x53')]=function(_0xa8ba8d,_0x36a867){return db[_0xe9ab('0x38')][_0xe9ab('0x53')](_0xa8ba8d['body'],{})[_0xe9ab('0x33')](respondWithResult(_0x36a867,0xc9))[_0xe9ab('0x28')](handleError(_0x36a867,null));};exports['update']=function(_0x37a936,_0x44cca6){if(_0x37a936[_0xe9ab('0x54')]['id']){delete _0x37a936[_0xe9ab('0x54')]['id'];}return db[_0xe9ab('0x38')]['find']({'where':{'id':_0x37a936[_0xe9ab('0x50')]['id']}})[_0xe9ab('0x33')](handleEntityNotFound(_0x44cca6,null))['then'](saveUpdates(_0x37a936[_0xe9ab('0x54')],null))['then'](respondWithResult(_0x44cca6,null))['catch'](handleError(_0x44cca6,null));};exports[_0xe9ab('0x55')]=function(_0x14a71f,_0x4823ea){return db[_0xe9ab('0x38')][_0xe9ab('0x56')]({'where':{'id':_0x14a71f['params']['id']}})[_0xe9ab('0x33')](handleEntityNotFound(_0x4823ea,null))[_0xe9ab('0x33')](removeEntity(_0x4823ea,null))[_0xe9ab('0x28')](handleError(_0x4823ea,null));};exports[_0xe9ab('0x57')]=function(_0x2a2d9a,_0x303952,_0x5d3723){var _0x3b6699={};var _0x1d4b3c={};var _0x15ab22;var _0x46a438;return db[_0xe9ab('0x38')][_0xe9ab('0x58')]({'where':{'id':_0x2a2d9a[_0xe9ab('0x50')]['id']}})['then'](handleEntityNotFound(_0x303952,null))['then'](function(_0x2b55a5){if(_0x2b55a5){_0x15ab22=_0x2b55a5;_0x1d4b3c[_0xe9ab('0x3a')]=_['keys'](db[_0xe9ab('0x59')][_0xe9ab('0x39')]);_0x1d4b3c['query']=_[_0xe9ab('0x3b')](_0x2a2d9a[_0xe9ab('0x3c')]);_0x1d4b3c[_0xe9ab('0x3d')]=_[_0xe9ab('0x3e')](_0x1d4b3c[_0xe9ab('0x3a')],_0x1d4b3c[_0xe9ab('0x3c')]);_0x3b6699[_0xe9ab('0x3f')]=_[_0xe9ab('0x3e')](_0x1d4b3c[_0xe9ab('0x3a')],qs[_0xe9ab('0x40')](_0x2a2d9a[_0xe9ab('0x3c')]['fields']));_0x3b6699[_0xe9ab('0x3f')]=_0x3b6699[_0xe9ab('0x3f')][_0xe9ab('0x41')]?_0x3b6699[_0xe9ab('0x3f')]:_0x1d4b3c['model'];_0x3b6699[_0xe9ab('0x44')]=qs[_0xe9ab('0x5a')](_0x2a2d9a[_0xe9ab('0x3c')][_0xe9ab('0x5a')]);_0x3b6699[_0xe9ab('0x45')]=qs[_0xe9ab('0x3d')](_[_0xe9ab('0x46')](_0x2a2d9a['query'],_0x1d4b3c[_0xe9ab('0x3d')]));if(_0x2a2d9a[_0xe9ab('0x3c')][_0xe9ab('0x47')]){_0x3b6699[_0xe9ab('0x45')]=_[_0xe9ab('0x48')](_0x3b6699[_0xe9ab('0x45')],{'$or':_['map'](_0x3b6699['attributes'],function(_0x8c04ca){var _0x1d21ca={};_0x1d21ca[_0x8c04ca]={'$like':'%'+_0x2a2d9a[_0xe9ab('0x3c')][_0xe9ab('0x47')]+'%'};return _0x1d21ca;})});}_0x3b6699=_['merge']({},_0x3b6699,_0x2a2d9a[_0xe9ab('0x52')]);return _0x15ab22[_0xe9ab('0x57')](_0x3b6699);}})[_0xe9ab('0x33')](function(_0x2c8052){if(_0x2c8052){_0x46a438=_0x2c8052[_0xe9ab('0x41')];if(!_0x2a2d9a[_0xe9ab('0x3c')]['hasOwnProperty'](_0xe9ab('0x42'))){_0x3b6699['limit']=qs[_0xe9ab('0x43')](_0x2a2d9a[_0xe9ab('0x3c')][_0xe9ab('0x43')]);_0x3b6699[_0xe9ab('0x2d')]=qs['offset'](_0x2a2d9a[_0xe9ab('0x3c')][_0xe9ab('0x2d')]);}return _0x15ab22[_0xe9ab('0x57')](_0x3b6699);}})[_0xe9ab('0x33')](function(_0x5da405){if(_0x5da405){return _0x5da405?{'count':_0x46a438,'rows':_0x5da405}:null;}})['then'](respondWithResult(_0x303952,null))[_0xe9ab('0x28')](handleError(_0x303952,null));};exports[_0xe9ab('0x5b')]=function(_0x2bee9c,_0x19e736,_0x839724){if(_0x2bee9c[_0xe9ab('0x54')]['id']){delete _0x2bee9c[_0xe9ab('0x54')]['id'];}return db['VtigerAccount'][_0xe9ab('0x58')]({'where':{'id':_0x2bee9c[_0xe9ab('0x50')]['id']}})['then'](handleEntityNotFound(_0x19e736,null))[_0xe9ab('0x33')](function(_0x19a0fa){if(_0x19a0fa){_0x2bee9c[_0xe9ab('0x54')]['AccountId']=_0x19a0fa['id'];_0x2bee9c[_0xe9ab('0x54')][_0xe9ab('0x5c')]=integrations[_0xe9ab('0x5d')](_0x2bee9c['body']['channel'],_0x2bee9c[_0xe9ab('0x54')][_0xe9ab('0x4a')]);_0x2bee9c[_0xe9ab('0x54')][_0xe9ab('0x5e')]=integrations['getDescriptions'](_0x2bee9c['body'][_0xe9ab('0x5f')],_0x2bee9c[_0xe9ab('0x54')][_0xe9ab('0x4a')]);return db[_0xe9ab('0x59')][_0xe9ab('0x53')](_0x2bee9c[_0xe9ab('0x54')],{'include':[{'model':db[_0xe9ab('0x60')],'as':_0xe9ab('0x5c')},{'model':db['VtigerField'],'as':_0xe9ab('0x5e')}]});}return null;})['then'](respondWithResult(_0x19e736,null))[_0xe9ab('0x28')](handleError(_0x19e736,null));};var md5=require(_0xe9ab('0x61'));exports[_0xe9ab('0x62')]=function(_0x596b55,_0x5c4c9e,_0x52c5f7){var _0x4e93aa=null;var _0x593920=null;var _0x36f7b6=null;var _0x3870eb=null;var _0x18d674='';return db[_0xe9ab('0x38')]['findOne']({'where':{'id':_0x596b55[_0xe9ab('0x50')]['id']},'attributes':['id',_0xe9ab('0x35'),_0xe9ab('0x63'),_0xe9ab('0x64'),_0xe9ab('0x65'),_0xe9ab('0x66'),'serverUrl',_0xe9ab('0x67')]})[_0xe9ab('0x33')](handleEntityNotFound(_0x5c4c9e,null))['then'](function(_0x310db6){if(_0x310db6){_0x4e93aa=_0x310db6[_0xe9ab('0x63')];_0x593920=_0x310db6[_0xe9ab('0x67')];_0x36f7b6=_0x310db6[_0xe9ab('0x65')];_0x18d674=_0x310db6[_0xe9ab('0x66')];var _0x175600=_0x18d674['slice'](-0x1);if(_0x175600==='/'){_0x18d674=_0x18d674[_0xe9ab('0x68')](0x0,_0x18d674[_0xe9ab('0x69')](_0x175600));}_0x3870eb=util[_0xe9ab('0x6a')](_0xe9ab('0x6b'),_0x18d674);var _0xa7f1da={'method':_0xe9ab('0x6c'),'uri':_0x3870eb,'qs':{'operation':_0xe9ab('0x6d'),'username':_0x310db6[_0xe9ab('0x63')]},'json':!![]};return rp(_0xa7f1da);}})[_0xe9ab('0x33')](function(_0xe376c7){if(_0xe376c7[_0xe9ab('0x6e')]){var _0x5f46ec={'method':_0xe9ab('0x6f'),'uri':_0x3870eb,'form':{'operation':_0xe9ab('0x70'),'username':_0x4e93aa,'accessKey':md5(_0xe376c7['result']['token']+_0x593920)},'json':!![]};return rp(_0x5f46ec);}})[_0xe9ab('0x33')](function(_0x4b0a4e){if(_0x4b0a4e['success']){var _0x91f4de={'method':_0xe9ab('0x6c'),'uri':_0x3870eb,'qs':{'operation':'describe','username':_0x4e93aa,'sessionName':_0x4b0a4e[_0xe9ab('0x27')][_0xe9ab('0x71')],'elementType':_0x36f7b6},'json':!![]};return rp(_0x91f4de);}})[_0xe9ab('0x33')](function(_0x5d2428){if(_0x5d2428[_0xe9ab('0x6e')]){var _0x1f1572=[_0xe9ab('0x72'),_0xe9ab('0x73'),_0xe9ab('0x74')];_['remove'](_0x5d2428[_0xe9ab('0x27')]['fields'],function(_0x5ea13a){return _0x1f1572['includes'](_0x5ea13a['type']['name']);});_[_0xe9ab('0x75')](_0x5d2428[_0xe9ab('0x27')]['fields'],function(_0x33ac65){return _0x33ac65[_0xe9ab('0x76')]===_0xe9ab('0x77');});return{'count':_0x5d2428['result'][_0xe9ab('0x40')]['length'],'rows':_[_0xe9ab('0x49')](_0x5d2428[_0xe9ab('0x27')]['fields'],function(_0x475465){return{'id':_0x475465[_0xe9ab('0x35')],'name':_0x475465[_0xe9ab('0x78')],'custom':_[_0xe9ab('0x79')](_0x475465['name'],_0xe9ab('0x7a'))?!![]:![],'options':_0x475465['type'][_0xe9ab('0x35')]===_0xe9ab('0x7b')&&_0x475465[_0xe9ab('0x4a')][_0xe9ab('0x7c')][_0xe9ab('0x41')]>0x0?_['map'](_0x475465[_0xe9ab('0x4a')][_0xe9ab('0x7c')],function(_0x4c1559){return{'name':_0x4c1559[_0xe9ab('0x78')],'value':_0x4c1559[_0xe9ab('0x7d')]};}):[]};})};}})[_0xe9ab('0x33')](respondWithResult(_0x5c4c9e,null))['catch'](function(_0x412345){console[_0xe9ab('0x7e')](_0xe9ab('0x7f')+_0x412345);var _0x2eb3d1=_0x596b55[_0xe9ab('0x3c')][_0xe9ab('0x1d')]?0x1f4:_0x412345[_0xe9ab('0x80')]||0x1f4;logger[_0xe9ab('0x23')](_0xe9ab('0x81'),_0xe9ab('0x62'),_0x2eb3d1,JSON[_0xe9ab('0x22')](_0x412345));delete _0x412345['name'];if(_0x2eb3d1===0x191){_0x2eb3d1=0x190;}_0x5c4c9e[_0xe9ab('0x2a')](_0x2eb3d1)[_0xe9ab('0x36')](_0x596b55[_0xe9ab('0x3c')][_0xe9ab('0x1d')]?{'message':_0xe9ab('0x82'),'statusCode':_0x412345[_0xe9ab('0x80')]}:_0x412345);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 8a18590..7b80465 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 _0x0b7f=['VtigerAccount','int_vtiger_accounts','lodash','util','api','bluebird','request-promise','path','./intVtigerAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x25abbe,_0x53b462){var _0x55c770=function(_0x164dbf){while(--_0x164dbf){_0x25abbe['push'](_0x25abbe['shift']());}};_0x55c770(++_0x53b462);}(_0x0b7f,0x115));var _0xf0b7=function(_0x1639be,_0x4ac980){_0x1639be=_0x1639be-0x0;var _0x4af3e1=_0x0b7f[_0x1639be];return _0x4af3e1;};'use strict';var _=require(_0xf0b7('0x0'));var util=require(_0xf0b7('0x1'));var logger=require('../../config/logger')(_0xf0b7('0x2'));var moment=require('moment');var BPromise=require(_0xf0b7('0x3'));var rp=require(_0xf0b7('0x4'));var fs=require('fs');var path=require(_0xf0b7('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf0b7('0x6'));var integrations=require(_0xf0b7('0x7'));module[_0xf0b7('0x8')]=function(_0x41c63d,_0x2b2de8){return _0x41c63d['define'](_0xf0b7('0x9'),attributes,{'tableName':_0xf0b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc0d7=['rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','api','moment','bluebird','request-promise','path'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x3f1c66,_0xa3d0a4){_0x3f1c66=_0x3f1c66-0x0;var _0x39f8ec=_0xc0d7[_0x3f1c66];return _0x39f8ec;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7c0d('0x0'));var moment=require(_0x7c0d('0x1'));var BPromise=require(_0x7c0d('0x2'));var rp=require(_0x7c0d('0x3'));var fs=require('fs');var path=require(_0x7c0d('0x4'));var rimraf=require(_0x7c0d('0x5'));var config=require(_0x7c0d('0x6'));var attributes=require(_0x7c0d('0x7'));var integrations=require(_0x7c0d('0x8'));module['exports']=function(_0x507bc0,_0x14f205){return _0x507bc0[_0x7c0d('0x9')](_0x7c0d('0xa'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 30041a1..f799387 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 _0x59b0=['../../config/environment','jayson/promise','http','request','info','VtigerAccount,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','GetVtigerAccount','findAll','options','where','attributes','map','include','model','then','stringify','ShowVtigerAccount','VtigerAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x5daa04,_0x2bb0fa){var _0x2cf68c=function(_0x5a0bfd){while(--_0x5a0bfd){_0x5daa04['push'](_0x5daa04['shift']());}};_0x2cf68c(++_0x2bb0fa);}(_0x59b0,0x190));var _0x059b=function(_0x3b9d5f,_0x2e9039){_0x3b9d5f=_0x3b9d5f-0x0;var _0x39924e=_0x59b0[_0x3b9d5f];return _0x39924e;};'use strict';var _=require(_0x059b('0x0'));var util=require(_0x059b('0x1'));var moment=require(_0x059b('0x2'));var BPromise=require(_0x059b('0x3'));var rs=require(_0x059b('0x4'));var fs=require('fs');var Redis=require(_0x059b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x059b('0x6'));var logger=require('../../config/logger')(_0x059b('0x7'));var config=require(_0x059b('0x8'));var jayson=require(_0x059b('0x9'));var client=jayson['client'][_0x059b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fcfc1,_0x1736c6,_0x172590){return new BPromise(function(_0x19a9d9,_0x52124b){return client[_0x059b('0xb')](_0x4fcfc1,_0x172590)['then'](function(_0x17c1dd){logger[_0x059b('0xc')](_0x059b('0xd'),_0x1736c6,'request\x20sent');logger[_0x059b('0xe')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x1736c6,_0x059b('0xf'),JSON['stringify'](_0x17c1dd));if(_0x17c1dd[_0x059b('0x10')]){if(_0x17c1dd[_0x059b('0x10')]['code']===0x1f4){logger[_0x059b('0x10')](_0x059b('0xd'),_0x1736c6,_0x17c1dd[_0x059b('0x10')][_0x059b('0x11')]);return _0x52124b(_0x17c1dd[_0x059b('0x10')][_0x059b('0x11')]);}logger['error'](_0x059b('0xd'),_0x1736c6,_0x17c1dd[_0x059b('0x10')][_0x059b('0x11')]);return _0x19a9d9(_0x17c1dd[_0x059b('0x10')][_0x059b('0x11')]);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x1736c6,_0x059b('0xf'));_0x19a9d9(_0x17c1dd[_0x059b('0x12')][_0x059b('0x11')]);}})[_0x059b('0x13')](function(_0x19564d){logger[_0x059b('0x10')](_0x059b('0xd'),_0x1736c6,_0x19564d);_0x52124b(_0x19564d);});});}exports[_0x059b('0x14')]=function(_0x4b1f25){var _0x41901b=this;return new Promise(function(_0x3afd88,_0x1c1c4c){return db['VtigerAccount'][_0x059b('0x15')]({'raw':_0x4b1f25[_0x059b('0x16')]?_0x4b1f25[_0x059b('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4b1f25[_0x059b('0x16')]?_0x4b1f25['options'][_0x059b('0x17')]||null:null,'attributes':_0x4b1f25[_0x059b('0x16')]?_0x4b1f25[_0x059b('0x16')][_0x059b('0x18')]||null:null,'limit':_0x4b1f25[_0x059b('0x16')]?_0x4b1f25[_0x059b('0x16')]['limit']||null:null,'include':_0x4b1f25[_0x059b('0x16')]?_0x4b1f25[_0x059b('0x16')]['include']?_[_0x059b('0x19')](_0x4b1f25['options']['include'],function(_0x569675){return{'model':db[_0x569675['model']],'as':_0x569675['as'],'attributes':_0x569675[_0x059b('0x18')],'include':_0x569675['include']?_['map'](_0x569675[_0x059b('0x1a')],function(_0x52bc48){return{'model':db[_0x52bc48[_0x059b('0x1b')]],'as':_0x52bc48['as'],'attributes':_0x52bc48[_0x059b('0x18')],'include':_0x52bc48[_0x059b('0x1a')]?_[_0x059b('0x19')](_0x52bc48[_0x059b('0x1a')],function(_0x1c838a){return{'model':db[_0x1c838a['model']],'as':_0x1c838a['as'],'attributes':_0x1c838a[_0x059b('0x18')]};}):[]};}):[]};}):[]:[]})[_0x059b('0x1c')](function(_0x42c49e){logger['info'](_0x059b('0x14'),_0x4b1f25);logger[_0x059b('0xe')](_0x059b('0x14'),_0x4b1f25,JSON[_0x059b('0x1d')](_0x42c49e));_0x3afd88(_0x42c49e);})[_0x059b('0x13')](function(_0x184957){logger[_0x059b('0x10')](_0x059b('0x14'),_0x184957[_0x059b('0x11')],_0x4b1f25);_0x1c1c4c(_0x41901b[_0x059b('0x10')](0x1f4,_0x184957['message']));});});};exports[_0x059b('0x1e')]=function(_0x292cba){var _0x2a898f=this;return new Promise(function(_0x4246ba,_0x59dfcd){return db[_0x059b('0x1f')][_0x059b('0x20')]({'raw':_0x292cba[_0x059b('0x16')]?_0x292cba['options'][_0x059b('0x21')]===undefined?!![]:![]:!![],'where':_0x292cba[_0x059b('0x16')]?_0x292cba[_0x059b('0x16')][_0x059b('0x17')]||null:null,'attributes':_0x292cba[_0x059b('0x16')]?_0x292cba[_0x059b('0x16')][_0x059b('0x18')]||null:null,'include':_0x292cba[_0x059b('0x16')]?_0x292cba['options']['include']?_[_0x059b('0x19')](_0x292cba[_0x059b('0x16')]['include'],function(_0x14fc9e){return{'model':db[_0x14fc9e[_0x059b('0x1b')]],'as':_0x14fc9e['as'],'attributes':_0x14fc9e[_0x059b('0x18')],'include':_0x14fc9e['include']?_['map'](_0x14fc9e['include'],function(_0x21ec97){return{'model':db[_0x21ec97[_0x059b('0x1b')]],'as':_0x21ec97['as'],'attributes':_0x21ec97[_0x059b('0x18')],'include':_0x21ec97['include']?_[_0x059b('0x19')](_0x21ec97[_0x059b('0x1a')],function(_0x4e3e45){return{'model':db[_0x4e3e45[_0x059b('0x1b')]],'as':_0x4e3e45['as'],'attributes':_0x4e3e45[_0x059b('0x18')]};}):[]};}):[]};}):[]:[]})[_0x059b('0x1c')](function(_0x188bdb){logger[_0x059b('0xc')](_0x059b('0x1e'),_0x292cba);logger['debug']('ShowVtigerAccount',_0x292cba,JSON[_0x059b('0x1d')](_0x188bdb));_0x4246ba(_0x188bdb);})[_0x059b('0x13')](function(_0x200394){logger['error'](_0x059b('0x1e'),_0x200394[_0x059b('0x11')],_0x292cba);_0x59dfcd(_0x2a898f[_0x059b('0x10')](0x1f4,_0x200394['message']));});});}; \ No newline at end of file +var _0x3060=['then','ShowVtigerAccount','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','VtigerAccount,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','limit','map','include','model','attributes'];(function(_0x332632,_0xf7ad49){var _0x199ffb=function(_0x3e3357){while(--_0x3e3357){_0x332632['push'](_0x332632['shift']());}};_0x199ffb(++_0xf7ad49);}(_0x3060,0x6d));var _0x0306=function(_0x334d1e,_0x28a488){_0x334d1e=_0x334d1e-0x0;var _0x3b33ba=_0x3060[_0x334d1e];return _0x3b33ba;};'use strict';var _=require('lodash');var util=require(_0x0306('0x0'));var moment=require(_0x0306('0x1'));var BPromise=require(_0x0306('0x2'));var rs=require(_0x0306('0x3'));var fs=require('fs');var Redis=require(_0x0306('0x4'));var db=require(_0x0306('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0306('0x6'))(_0x0306('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0306('0x8')][_0x0306('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc33546,_0x31aa80,_0x11cca9){return new BPromise(function(_0xd72dd0,_0x2d4108){return client[_0x0306('0xa')](_0xc33546,_0x11cca9)['then'](function(_0x258a5e){logger['info'](_0x0306('0xb'),_0x31aa80,'request\x20sent');logger[_0x0306('0xc')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x31aa80,'request\x20sent',JSON[_0x0306('0xd')](_0x258a5e));if(_0x258a5e[_0x0306('0xe')]){if(_0x258a5e[_0x0306('0xe')][_0x0306('0xf')]===0x1f4){logger['error'](_0x0306('0xb'),_0x31aa80,_0x258a5e[_0x0306('0xe')]['message']);return _0x2d4108(_0x258a5e[_0x0306('0xe')][_0x0306('0x10')]);}logger['error'](_0x0306('0xb'),_0x31aa80,_0x258a5e[_0x0306('0xe')][_0x0306('0x10')]);return _0xd72dd0(_0x258a5e[_0x0306('0xe')][_0x0306('0x10')]);}else{logger[_0x0306('0x11')](_0x0306('0xb'),_0x31aa80,_0x0306('0x12'));_0xd72dd0(_0x258a5e[_0x0306('0x13')][_0x0306('0x10')]);}})[_0x0306('0x14')](function(_0x2f87a0){logger['error'](_0x0306('0xb'),_0x31aa80,_0x2f87a0);_0x2d4108(_0x2f87a0);});});}exports[_0x0306('0x15')]=function(_0x255921){var _0x354e1d=this;return new Promise(function(_0x5a0b1f,_0x3c9a63){return db[_0x0306('0x16')][_0x0306('0x17')]({'raw':_0x255921[_0x0306('0x18')]?_0x255921[_0x0306('0x18')][_0x0306('0x19')]===undefined?!![]:![]:!![],'where':_0x255921[_0x0306('0x18')]?_0x255921['options']['where']||null:null,'attributes':_0x255921['options']?_0x255921[_0x0306('0x18')]['attributes']||null:null,'limit':_0x255921[_0x0306('0x18')]?_0x255921[_0x0306('0x18')][_0x0306('0x1a')]||null:null,'include':_0x255921['options']?_0x255921[_0x0306('0x18')]['include']?_[_0x0306('0x1b')](_0x255921[_0x0306('0x18')][_0x0306('0x1c')],function(_0x155f29){return{'model':db[_0x155f29[_0x0306('0x1d')]],'as':_0x155f29['as'],'attributes':_0x155f29[_0x0306('0x1e')],'include':_0x155f29[_0x0306('0x1c')]?_[_0x0306('0x1b')](_0x155f29[_0x0306('0x1c')],function(_0x28579e){return{'model':db[_0x28579e[_0x0306('0x1d')]],'as':_0x28579e['as'],'attributes':_0x28579e[_0x0306('0x1e')],'include':_0x28579e[_0x0306('0x1c')]?_[_0x0306('0x1b')](_0x28579e['include'],function(_0xfc7d77){return{'model':db[_0xfc7d77[_0x0306('0x1d')]],'as':_0xfc7d77['as'],'attributes':_0xfc7d77[_0x0306('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0306('0x1f')](function(_0x22bdb8){logger[_0x0306('0x11')](_0x0306('0x15'),_0x255921);logger[_0x0306('0xc')](_0x0306('0x15'),_0x255921,JSON[_0x0306('0xd')](_0x22bdb8));_0x5a0b1f(_0x22bdb8);})['catch'](function(_0xaa6aa8){logger[_0x0306('0xe')](_0x0306('0x15'),_0xaa6aa8[_0x0306('0x10')],_0x255921);_0x3c9a63(_0x354e1d[_0x0306('0xe')](0x1f4,_0xaa6aa8[_0x0306('0x10')]));});});};exports[_0x0306('0x20')]=function(_0x46a935){var _0x5705e2=this;return new Promise(function(_0x18d16c,_0xd92b7){return db[_0x0306('0x16')][_0x0306('0x21')]({'raw':_0x46a935['options']?_0x46a935[_0x0306('0x18')][_0x0306('0x19')]===undefined?!![]:![]:!![],'where':_0x46a935[_0x0306('0x18')]?_0x46a935[_0x0306('0x18')][_0x0306('0x22')]||null:null,'attributes':_0x46a935[_0x0306('0x18')]?_0x46a935[_0x0306('0x18')]['attributes']||null:null,'include':_0x46a935[_0x0306('0x18')]?_0x46a935[_0x0306('0x18')][_0x0306('0x1c')]?_[_0x0306('0x1b')](_0x46a935[_0x0306('0x18')][_0x0306('0x1c')],function(_0x34b72e){return{'model':db[_0x34b72e[_0x0306('0x1d')]],'as':_0x34b72e['as'],'attributes':_0x34b72e[_0x0306('0x1e')],'include':_0x34b72e[_0x0306('0x1c')]?_['map'](_0x34b72e[_0x0306('0x1c')],function(_0x40545e){return{'model':db[_0x40545e[_0x0306('0x1d')]],'as':_0x40545e['as'],'attributes':_0x40545e[_0x0306('0x1e')],'include':_0x40545e[_0x0306('0x1c')]?_['map'](_0x40545e[_0x0306('0x1c')],function(_0x398167){return{'model':db[_0x398167['model']],'as':_0x398167['as'],'attributes':_0x398167[_0x0306('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0306('0x1f')](function(_0x1724c6){logger[_0x0306('0x11')](_0x0306('0x20'),_0x46a935);logger[_0x0306('0xc')](_0x0306('0x20'),_0x46a935,JSON[_0x0306('0xd')](_0x1724c6));_0x18d16c(_0x1724c6);})[_0x0306('0x14')](function(_0x510947){logger[_0x0306('0xe')](_0x0306('0x20'),_0x510947[_0x0306('0x10')],_0x46a935);_0xd92b7(_0x5705e2[_0x0306('0xe')](0x1f4,_0x510947['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 3327531..1cacff9 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(_0x316708,_0x30fa38){var _0x11cd4c=function(_0x36911e){while(--_0x36911e){_0x316708['push'](_0x316708['shift']());}};_0x11cd4c(++_0x30fa38);}(_0x757a,0xde));var _0xa757=function(_0xea53a5,_0x2bf600){_0xea53a5=_0xea53a5-0x0;var _0x231db1=_0x757a[_0xea53a5];return _0x231db1;};'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 _0x0713=['post','create','put','update','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x2e3f7d,_0x137b7e){var _0x3f7397=function(_0x3fbd1f){while(--_0x3fbd1f){_0x2e3f7d['push'](_0x2e3f7d['shift']());}};_0x3f7397(++_0x137b7e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var auth=require(_0x3071('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3071('0x5'));var controller=require(_0x3071('0x6'));router[_0x3071('0x7')]('/',auth[_0x3071('0x8')](),controller[_0x3071('0x9')]);router[_0x3071('0x7')](_0x3071('0xa'),auth[_0x3071('0x8')](),controller[_0x3071('0xb')]);router[_0x3071('0x7')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0xd')]);router['get'](_0x3071('0xe'),auth[_0x3071('0x8')](),controller[_0x3071('0xf')]);router[_0x3071('0x7')](_0x3071('0x10'),auth['isAuthenticated'](),controller[_0x3071('0x11')]);router[_0x3071('0x12')]('/',auth[_0x3071('0x8')](),controller[_0x3071('0x13')]);router[_0x3071('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x3071('0x15')]);router['delete'](_0x3071('0xa'),auth[_0x3071('0x8')](),controller['destroy']);module[_0x3071('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 5d3cac5..6f74350 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 _0x3196=['exports','STRING'];(function(_0x804767,_0x4df31b){var _0x505680=function(_0xb2a2bf){while(--_0xb2a2bf){_0x804767['push'](_0x804767['shift']());}};_0x505680(++_0x4df31b);}(_0x3196,0x96));var _0x6319=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3196[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x6319('0x0')]={'name':{'type':Sequelize[_0x6319('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xced3=['exports','STRING','sequelize'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0xced3,0xe3));var _0x3ced=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xced3[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0x3ced('0x0'));module[_0x3ced('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3ced('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 1ad68bb..9be5dbb 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 _0x0a9a=['name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','map','key','VIRTUAL','field','merge','options','VtigerConfiguration','includeAll','include','findAll','show','params','find','create','update','body','findOne','order','pick','getFields','VtigerField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','client','test','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','destroy','then','stack'];(function(_0x5338fe,_0x5e71d1){var _0xf0a1be=function(_0x306a01){while(--_0x306a01){_0x5338fe['push'](_0x5338fe['shift']());}};_0xf0a1be(++_0x5e71d1);}(_0x0a9a,0x183));var _0xa0a9=function(_0x250356,_0x3ee331){_0x250356=_0x250356-0x0;var _0x7cf748=_0x0a9a[_0x250356];return _0x7cf748;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa0a9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa0a9('0x1'));var jsonpatch=require(_0xa0a9('0x2'));var rp=require(_0xa0a9('0x3'));var moment=require(_0xa0a9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa0a9('0x5'));var util=require(_0xa0a9('0x6'));var path=require('path');var sox=require(_0xa0a9('0x7'));var csv=require(_0xa0a9('0x8'));var ejs=require(_0xa0a9('0x9'));var fs=require('fs');var _=require(_0xa0a9('0xa'));var squel=require('squel');var crypto=require(_0xa0a9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa0a9('0xc'));var toCsv=require(_0xa0a9('0x8'));var querystring=require(_0xa0a9('0xd'));var Papa=require(_0xa0a9('0xe'));var Redis=require('ioredis');var authService=require(_0xa0a9('0xf'));var qs=require(_0xa0a9('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa0a9('0x11'));var utils=require(_0xa0a9('0x12'));var config=require('../../config/environment');var db=require(_0xa0a9('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xa0a9('0x14')]['http']({'port':0x232a});function checkPasswordPattern(_0xb87a94,_0x1ae2a7,_0xa10656){if(_0xa10656){var _0x35e7cd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x35e7cd[_0xa0a9('0x15')](_0x1ae2a7)){return _0xb87a94;}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 _0xb87a94;}}function respondWithRpcPromise(_0x1f3f23,_0x9ef979,_0x31e716,_0x25ac6d){return new BPromise(function(_0x2f8b3c,_0x1a7b8a){var _0x5a6693=_0x25ac6d||client;return _0x5a6693[_0xa0a9('0x16')](_0x1f3f23,_0x31e716)['then'](function(_0x4a57dd){logger[_0xa0a9('0x17')](_0xa0a9('0x18'),_0x9ef979,_0xa0a9('0x19'));logger[_0xa0a9('0x1a')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x9ef979,_0xa0a9('0x19'),JSON[_0xa0a9('0x1b')](_0x4a57dd));if(_0x4a57dd[_0xa0a9('0x1c')]){if(_0x4a57dd[_0xa0a9('0x1c')][_0xa0a9('0x1d')]===0x1f4){logger[_0xa0a9('0x1c')]('VtigerConfiguration,\x20%s,\x20%s',_0x9ef979,_0x4a57dd[_0xa0a9('0x1c')][_0xa0a9('0x1e')]);return _0x1a7b8a(_0x4a57dd['error']['message']);}logger[_0xa0a9('0x1c')](_0xa0a9('0x18'),_0x9ef979,_0x4a57dd[_0xa0a9('0x1c')]['message']);return _0x2f8b3c(_0x4a57dd[_0xa0a9('0x1c')]['message']);}else{logger[_0xa0a9('0x17')]('VtigerConfiguration,\x20%s,\x20%s',_0x9ef979,_0xa0a9('0x19'));_0x2f8b3c(_0x4a57dd[_0xa0a9('0x1f')][_0xa0a9('0x1e')]);}})[_0xa0a9('0x20')](function(_0x4938da){logger[_0xa0a9('0x1c')]('VtigerConfiguration,\x20%s,\x20%s',_0x9ef979,_0x4938da);_0x1a7b8a(_0x4938da);});});}function respondWithStatusCode(_0x20b318,_0x1f78e1){_0x1f78e1=_0x1f78e1||0xcc;return function(_0x1f5fd8){if(_0x1f5fd8){return _0x20b318[_0xa0a9('0x21')](_0x1f78e1);}return _0x20b318['status'](_0x1f78e1)[_0xa0a9('0x22')]();};}function respondWithResult(_0xe49d3b,_0x384cd5){_0x384cd5=_0x384cd5||0xc8;return function(_0x3f4bea){if(_0x3f4bea){return _0xe49d3b['status'](_0x384cd5)[_0xa0a9('0x23')](_0x3f4bea);}};}function respondWithFilteredResult(_0x38e454,_0x2eae30){return function(_0x5c446e){if(_0x5c446e){var _0x54125d=_0x5c446e[_0xa0a9('0x24')],_0x2b3cbb=_0x2eae30[_0xa0a9('0x25')],_0x3ba07e=_0x2eae30[_0xa0a9('0x25')]+_0x2eae30[_0xa0a9('0x26')],_0x10bbfd;if(_0x3ba07e>=_0x54125d){_0x3ba07e=_0x54125d;_0x10bbfd=0xc8;}else{_0x10bbfd=0xce;}_0x38e454[_0xa0a9('0x27')](_0x10bbfd);return _0x38e454[_0xa0a9('0x28')](_0xa0a9('0x29'),_0x2b3cbb+'-'+_0x3ba07e+'/'+_0x54125d)[_0xa0a9('0x23')](_0x5c446e);}return null;};}function patchUpdates(_0x554191){return function(_0x1f6178){try{jsonpatch[_0xa0a9('0x2a')](_0x1f6178,_0x554191,!![]);}catch(_0x4fc94a){return BPromise[_0xa0a9('0x2b')](_0x4fc94a);}return _0x1f6178[_0xa0a9('0x2c')]();};}function saveUpdates(_0x49c3d4,_0x47c19b){return function(_0x45374e){if(_0x45374e){return _0x45374e['update'](_0x49c3d4)['then'](function(_0x2ba1e3){return _0x2ba1e3;});}return null;};}function removeEntity(_0x104936,_0x347cbf){return function(_0x1e83ac){if(_0x1e83ac){return _0x1e83ac[_0xa0a9('0x2d')]()[_0xa0a9('0x2e')](function(){_0x104936[_0xa0a9('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x366ba9,_0x1b2f64){return function(_0x539807){if(!_0x539807){_0x366ba9[_0xa0a9('0x21')](0x194);}return _0x539807;};}function handleError(_0x2f98f6,_0x2363e6){_0x2363e6=_0x2363e6||0x1f4;return function(_0x578ee3){logger['error'](_0x578ee3[_0xa0a9('0x2f')]);if(_0x578ee3[_0xa0a9('0x30')]){delete _0x578ee3[_0xa0a9('0x30')];}_0x2f98f6[_0xa0a9('0x27')](_0x2363e6)['send'](_0x578ee3);};}exports[_0xa0a9('0x31')]=function(_0x19a122,_0x459485){var _0x5b094b={},_0x2a4587={},_0x3c74ea={'count':0x0,'rows':[]};var _0x4e121e=db['VtigerConfiguration'][_0xa0a9('0x32')];_0x2a4587[_0xa0a9('0x33')]=_[_0xa0a9('0x34')](_0x4e121e);_0x2a4587[_0xa0a9('0x35')]=_[_0xa0a9('0x34')](_0x19a122[_0xa0a9('0x35')]);_0x2a4587[_0xa0a9('0x36')]=_[_0xa0a9('0x37')](_0x2a4587[_0xa0a9('0x33')],_0x2a4587[_0xa0a9('0x35')]);_0x5b094b[_0xa0a9('0x38')]=_[_0xa0a9('0x37')](_0x2a4587[_0xa0a9('0x33')],qs[_0xa0a9('0x39')](_0x19a122[_0xa0a9('0x35')][_0xa0a9('0x39')]));_0x5b094b[_0xa0a9('0x38')]=_0x5b094b['attributes'][_0xa0a9('0x3a')]?_0x5b094b[_0xa0a9('0x38')]:_0x2a4587[_0xa0a9('0x33')];if(!_0x19a122['query'][_0xa0a9('0x3b')](_0xa0a9('0x3c'))){_0x5b094b[_0xa0a9('0x26')]=qs[_0xa0a9('0x26')](_0x19a122['query'][_0xa0a9('0x26')]);_0x5b094b[_0xa0a9('0x25')]=qs[_0xa0a9('0x25')](_0x19a122[_0xa0a9('0x35')][_0xa0a9('0x25')]);}_0x5b094b['order']=qs[_0xa0a9('0x3d')](_0x19a122[_0xa0a9('0x35')][_0xa0a9('0x3d')]);_0x5b094b[_0xa0a9('0x3e')]=qs[_0xa0a9('0x36')](_['pick'](_0x19a122[_0xa0a9('0x35')],_0x2a4587[_0xa0a9('0x36')]));if(_0x19a122[_0xa0a9('0x35')][_0xa0a9('0x3f')]){_0x5b094b[_0xa0a9('0x3e')]=_['merge'](_0x5b094b[_0xa0a9('0x3e')],{'$or':_[_0xa0a9('0x40')](_0x4e121e,function(_0x5081cf){if(_0x5081cf['type'][_0xa0a9('0x41')]!==_0xa0a9('0x42')){var _0x8d69b4={};_0x8d69b4[_0x5081cf[_0xa0a9('0x43')]]={'$like':'%'+_0x19a122['query'][_0xa0a9('0x3f')]+'%'};return _0x8d69b4;}})});}_0x5b094b=_[_0xa0a9('0x44')]({},_0x5b094b,_0x19a122[_0xa0a9('0x45')]);var _0x3c1932={'where':_0x5b094b[_0xa0a9('0x3e')]};return db[_0xa0a9('0x46')][_0xa0a9('0x24')](_0x3c1932)[_0xa0a9('0x2e')](function(_0xbdce0e){_0x3c74ea[_0xa0a9('0x24')]=_0xbdce0e;if(_0x19a122[_0xa0a9('0x35')][_0xa0a9('0x47')]){_0x5b094b[_0xa0a9('0x48')]=[{'all':!![]}];}return db[_0xa0a9('0x46')][_0xa0a9('0x49')](_0x5b094b);})[_0xa0a9('0x2e')](function(_0x1bd660){_0x3c74ea['rows']=_0x1bd660;return _0x3c74ea;})[_0xa0a9('0x2e')](respondWithFilteredResult(_0x459485,_0x5b094b))['catch'](handleError(_0x459485,null));};exports[_0xa0a9('0x4a')]=function(_0x1fa515,_0x15002c){var _0x132eca={'raw':![],'where':{'id':_0x1fa515[_0xa0a9('0x4b')]['id']}},_0x221466={};_0x221466[_0xa0a9('0x33')]=_[_0xa0a9('0x34')](db[_0xa0a9('0x46')]['rawAttributes']);_0x221466[_0xa0a9('0x35')]=_[_0xa0a9('0x34')](_0x1fa515[_0xa0a9('0x35')]);_0x221466['filters']=_[_0xa0a9('0x37')](_0x221466[_0xa0a9('0x33')],_0x221466[_0xa0a9('0x35')]);_0x132eca['attributes']=_[_0xa0a9('0x37')](_0x221466[_0xa0a9('0x33')],qs[_0xa0a9('0x39')](_0x1fa515[_0xa0a9('0x35')]['fields']));_0x132eca[_0xa0a9('0x38')]=_0x132eca[_0xa0a9('0x38')][_0xa0a9('0x3a')]?_0x132eca[_0xa0a9('0x38')]:_0x221466[_0xa0a9('0x33')];if(_0x1fa515[_0xa0a9('0x35')][_0xa0a9('0x47')]){_0x132eca['include']=[{'all':!![]}];}_0x132eca=_[_0xa0a9('0x44')]({},_0x132eca,_0x1fa515[_0xa0a9('0x45')]);return db['VtigerConfiguration'][_0xa0a9('0x4c')](_0x132eca)[_0xa0a9('0x2e')](handleEntityNotFound(_0x15002c,null))[_0xa0a9('0x2e')](respondWithResult(_0x15002c,null))['catch'](handleError(_0x15002c,null));};exports['create']=function(_0xb952fc,_0x2074b7){return db[_0xa0a9('0x46')][_0xa0a9('0x4d')](_0xb952fc['body'],{})['then'](respondWithResult(_0x2074b7,0xc9))[_0xa0a9('0x20')](handleError(_0x2074b7,null));};exports[_0xa0a9('0x4e')]=function(_0x4bc39c,_0x5a02ae){if(_0x4bc39c[_0xa0a9('0x4f')]['id']){delete _0x4bc39c[_0xa0a9('0x4f')]['id'];}return db[_0xa0a9('0x46')][_0xa0a9('0x4c')]({'where':{'id':_0x4bc39c[_0xa0a9('0x4b')]['id']}})[_0xa0a9('0x2e')](handleEntityNotFound(_0x5a02ae,null))[_0xa0a9('0x2e')](saveUpdates(_0x4bc39c[_0xa0a9('0x4f')],null))[_0xa0a9('0x2e')](respondWithResult(_0x5a02ae,null))[_0xa0a9('0x20')](handleError(_0x5a02ae,null));};exports[_0xa0a9('0x2d')]=function(_0x52d34c,_0x39070f){return db[_0xa0a9('0x46')][_0xa0a9('0x4c')]({'where':{'id':_0x52d34c['params']['id']}})[_0xa0a9('0x2e')](handleEntityNotFound(_0x39070f,null))[_0xa0a9('0x2e')](removeEntity(_0x39070f,null))[_0xa0a9('0x20')](handleError(_0x39070f,null));};exports['getFields']=function(_0x132e1f,_0x18893f,_0xe2d6f2){var _0x16c230={};var _0x3d47b3={};var _0x47107f;var _0x12f97d;return db['VtigerConfiguration'][_0xa0a9('0x50')]({'where':{'id':_0x132e1f[_0xa0a9('0x4b')]['id']}})[_0xa0a9('0x2e')](handleEntityNotFound(_0x18893f,null))[_0xa0a9('0x2e')](function(_0x19dfef){if(_0x19dfef){_0x47107f=_0x19dfef;_0x3d47b3[_0xa0a9('0x33')]=_[_0xa0a9('0x34')](db['VtigerField']['rawAttributes']);_0x3d47b3['query']=_[_0xa0a9('0x34')](_0x132e1f['query']);_0x3d47b3[_0xa0a9('0x36')]=_['intersection'](_0x3d47b3[_0xa0a9('0x33')],_0x3d47b3[_0xa0a9('0x35')]);_0x16c230[_0xa0a9('0x38')]=_[_0xa0a9('0x37')](_0x3d47b3[_0xa0a9('0x33')],qs[_0xa0a9('0x39')](_0x132e1f[_0xa0a9('0x35')][_0xa0a9('0x39')]));_0x16c230['attributes']=_0x16c230['attributes'][_0xa0a9('0x3a')]?_0x16c230['attributes']:_0x3d47b3[_0xa0a9('0x33')];_0x16c230[_0xa0a9('0x51')]=qs[_0xa0a9('0x3d')](_0x132e1f['query'][_0xa0a9('0x3d')]);_0x16c230['where']=qs[_0xa0a9('0x36')](_[_0xa0a9('0x52')](_0x132e1f[_0xa0a9('0x35')],_0x3d47b3['filters']));if(_0x132e1f[_0xa0a9('0x35')]['filter']){_0x16c230[_0xa0a9('0x3e')]=_['merge'](_0x16c230[_0xa0a9('0x3e')],{'$or':_['map'](_0x16c230[_0xa0a9('0x38')],function(_0x4725ab){var _0x258aa4={};_0x258aa4[_0x4725ab]={'$like':'%'+_0x132e1f[_0xa0a9('0x35')][_0xa0a9('0x3f')]+'%'};return _0x258aa4;})});}_0x16c230=_[_0xa0a9('0x44')]({},_0x16c230,_0x132e1f['options']);return _0x47107f[_0xa0a9('0x53')](_0x16c230);}})[_0xa0a9('0x2e')](function(_0x2e6d3f){if(_0x2e6d3f){_0x12f97d=_0x2e6d3f['length'];if(!_0x132e1f[_0xa0a9('0x35')][_0xa0a9('0x3b')](_0xa0a9('0x3c'))){_0x16c230[_0xa0a9('0x26')]=qs[_0xa0a9('0x26')](_0x132e1f['query'][_0xa0a9('0x26')]);_0x16c230[_0xa0a9('0x25')]=qs[_0xa0a9('0x25')](_0x132e1f[_0xa0a9('0x35')][_0xa0a9('0x25')]);}return _0x47107f[_0xa0a9('0x53')](_0x16c230);}})[_0xa0a9('0x2e')](function(_0x442956){if(_0x442956){return _0x442956?{'count':_0x12f97d,'rows':_0x442956}:null;}})[_0xa0a9('0x2e')](respondWithResult(_0x18893f,null))[_0xa0a9('0x20')](handleError(_0x18893f,null));};exports['getSubjects']=function(_0x1d9d6a,_0x1bae56,_0x183d4b){var _0x2d9b5c={};var _0x1c7917={};var _0x278cad;var _0x1f47c;return db[_0xa0a9('0x46')][_0xa0a9('0x50')]({'where':{'id':_0x1d9d6a[_0xa0a9('0x4b')]['id']}})[_0xa0a9('0x2e')](handleEntityNotFound(_0x1bae56,null))[_0xa0a9('0x2e')](function(_0x27cdcc){if(_0x27cdcc){_0x278cad=_0x27cdcc;_0x1c7917[_0xa0a9('0x33')]=_[_0xa0a9('0x34')](db[_0xa0a9('0x54')]['rawAttributes']);_0x1c7917[_0xa0a9('0x35')]=_['keys'](_0x1d9d6a[_0xa0a9('0x35')]);_0x1c7917['filters']=_[_0xa0a9('0x37')](_0x1c7917[_0xa0a9('0x33')],_0x1c7917[_0xa0a9('0x35')]);_0x2d9b5c[_0xa0a9('0x38')]=_[_0xa0a9('0x37')](_0x1c7917[_0xa0a9('0x33')],qs[_0xa0a9('0x39')](_0x1d9d6a['query'][_0xa0a9('0x39')]));_0x2d9b5c[_0xa0a9('0x38')]=_0x2d9b5c[_0xa0a9('0x38')][_0xa0a9('0x3a')]?_0x2d9b5c[_0xa0a9('0x38')]:_0x1c7917[_0xa0a9('0x33')];_0x2d9b5c[_0xa0a9('0x51')]=qs[_0xa0a9('0x3d')](_0x1d9d6a[_0xa0a9('0x35')]['sort']);_0x2d9b5c[_0xa0a9('0x3e')]=qs[_0xa0a9('0x36')](_[_0xa0a9('0x52')](_0x1d9d6a[_0xa0a9('0x35')],_0x1c7917[_0xa0a9('0x36')]));if(_0x1d9d6a[_0xa0a9('0x35')][_0xa0a9('0x3f')]){_0x2d9b5c[_0xa0a9('0x3e')]=_['merge'](_0x2d9b5c[_0xa0a9('0x3e')],{'$or':_[_0xa0a9('0x40')](_0x2d9b5c['attributes'],function(_0x1328b6){var _0x3c542a={};_0x3c542a[_0x1328b6]={'$like':'%'+_0x1d9d6a[_0xa0a9('0x35')][_0xa0a9('0x3f')]+'%'};return _0x3c542a;})});}_0x2d9b5c=_[_0xa0a9('0x44')]({},_0x2d9b5c,_0x1d9d6a[_0xa0a9('0x45')]);return _0x278cad[_0xa0a9('0x55')](_0x2d9b5c);}})[_0xa0a9('0x2e')](function(_0x8a5178){if(_0x8a5178){_0x1f47c=_0x8a5178[_0xa0a9('0x3a')];if(!_0x1d9d6a[_0xa0a9('0x35')][_0xa0a9('0x3b')](_0xa0a9('0x3c'))){_0x2d9b5c['limit']=qs['limit'](_0x1d9d6a[_0xa0a9('0x35')]['limit']);_0x2d9b5c['offset']=qs[_0xa0a9('0x25')](_0x1d9d6a[_0xa0a9('0x35')]['offset']);}return _0x278cad[_0xa0a9('0x55')](_0x2d9b5c);}})[_0xa0a9('0x2e')](function(_0x20ec47){if(_0x20ec47){return _0x20ec47?{'count':_0x1f47c,'rows':_0x20ec47}:null;}})[_0xa0a9('0x2e')](respondWithResult(_0x1bae56,null))[_0xa0a9('0x20')](handleError(_0x1bae56,null));};exports[_0xa0a9('0x56')]=function(_0x1064f0,_0x50b8fa,_0x30da2a){var _0x529170={};var _0x5c6164={};var _0x59ca76;var _0x39a9f9;return db[_0xa0a9('0x46')]['findOne']({'where':{'id':_0x1064f0[_0xa0a9('0x4b')]['id']}})[_0xa0a9('0x2e')](handleEntityNotFound(_0x50b8fa,null))[_0xa0a9('0x2e')](function(_0x384dec){if(_0x384dec){_0x59ca76=_0x384dec;_0x5c6164[_0xa0a9('0x33')]=_[_0xa0a9('0x34')](db[_0xa0a9('0x54')]['rawAttributes']);_0x5c6164[_0xa0a9('0x35')]=_['keys'](_0x1064f0[_0xa0a9('0x35')]);_0x5c6164[_0xa0a9('0x36')]=_[_0xa0a9('0x37')](_0x5c6164[_0xa0a9('0x33')],_0x5c6164['query']);_0x529170['attributes']=_[_0xa0a9('0x37')](_0x5c6164[_0xa0a9('0x33')],qs[_0xa0a9('0x39')](_0x1064f0[_0xa0a9('0x35')][_0xa0a9('0x39')]));_0x529170[_0xa0a9('0x38')]=_0x529170['attributes']['length']?_0x529170[_0xa0a9('0x38')]:_0x5c6164[_0xa0a9('0x33')];_0x529170[_0xa0a9('0x51')]=qs[_0xa0a9('0x3d')](_0x1064f0[_0xa0a9('0x35')][_0xa0a9('0x3d')]);_0x529170[_0xa0a9('0x3e')]=qs['filters'](_[_0xa0a9('0x52')](_0x1064f0[_0xa0a9('0x35')],_0x5c6164['filters']));if(_0x1064f0[_0xa0a9('0x35')][_0xa0a9('0x3f')]){_0x529170['where']=_[_0xa0a9('0x44')](_0x529170[_0xa0a9('0x3e')],{'$or':_['map'](_0x529170['attributes'],function(_0x5c0b1e){var _0x34ea60={};_0x34ea60[_0x5c0b1e]={'$like':'%'+_0x1064f0['query'][_0xa0a9('0x3f')]+'%'};return _0x34ea60;})});}_0x529170=_[_0xa0a9('0x44')]({},_0x529170,_0x1064f0[_0xa0a9('0x45')]);return _0x59ca76['getDescriptions'](_0x529170);}})['then'](function(_0x51aa68){if(_0x51aa68){_0x39a9f9=_0x51aa68[_0xa0a9('0x3a')];if(!_0x1064f0[_0xa0a9('0x35')]['hasOwnProperty']('nolimit')){_0x529170['limit']=qs[_0xa0a9('0x26')](_0x1064f0[_0xa0a9('0x35')][_0xa0a9('0x26')]);_0x529170[_0xa0a9('0x25')]=qs['offset'](_0x1064f0[_0xa0a9('0x35')][_0xa0a9('0x25')]);}return _0x59ca76['getDescriptions'](_0x529170);}})[_0xa0a9('0x2e')](function(_0x1c7631){if(_0x1c7631){return _0x1c7631?{'count':_0x39a9f9,'rows':_0x1c7631}:null;}})[_0xa0a9('0x2e')](respondWithResult(_0x50b8fa,null))['catch'](handleError(_0x50b8fa,null));}; \ No newline at end of file +var _0x430e=['../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','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\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','VtigerConfiguration,\x20%s,\x20%s','message','info','result','sendStatus','status','end','offset','limit','set','Content-Range','apply','save','update','destroy','then','stack','name','send','index','VtigerConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','map','type','key','VIRTUAL','field','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','options','find','body','getFields','length','getSubjects','findOne','VtigerField','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x7f08ae,_0x4cc524){var _0x2367e8=function(_0x24f57a){while(--_0x24f57a){_0x7f08ae['push'](_0x7f08ae['shift']());}};_0x2367e8(++_0x4cc524);}(_0x430e,0x105));var _0xe430=function(_0x31c5e9,_0x30e373){_0x31c5e9=_0x31c5e9-0x0;var _0x517a8d=_0x430e[_0x31c5e9];return _0x517a8d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe430('0x0'));var rimraf=require(_0xe430('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe430('0x2'));var rp=require(_0xe430('0x3'));var moment=require(_0xe430('0x4'));var BPromise=require(_0xe430('0x5'));var Mustache=require('mustache');var util=require(_0xe430('0x6'));var path=require(_0xe430('0x7'));var sox=require(_0xe430('0x8'));var csv=require(_0xe430('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe430('0xa'));var squel=require(_0xe430('0xb'));var crypto=require(_0xe430('0xc'));var jsforce=require(_0xe430('0xd'));var deskjs=require(_0xe430('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe430('0xf'));var Papa=require(_0xe430('0x10'));var Redis=require(_0xe430('0x11'));var authService=require(_0xe430('0x12'));var qs=require(_0xe430('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe430('0x14'))(_0xe430('0x15'));var utils=require(_0xe430('0x16'));var config=require(_0xe430('0x17'));var db=require(_0xe430('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe430('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x53d365,_0x40f53a,_0x2f9aa0){if(_0x2f9aa0){var _0x26f411=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x26f411[_0xe430('0x1a')](_0x40f53a)){return _0x53d365;}else{throw new Error(_0xe430('0x1b'));}}else{return _0x53d365;}}function respondWithRpcPromise(_0x3c8205,_0x24e898,_0x4aa52d,_0x45f90b){return new BPromise(function(_0xe36466,_0x9e577b){var _0x1d96bd=_0x45f90b||client;return _0x1d96bd['request'](_0x3c8205,_0x4aa52d)['then'](function(_0x982792){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x24e898,_0xe430('0x1c'));logger[_0xe430('0x1d')](_0xe430('0x1e'),_0x24e898,_0xe430('0x1c'),JSON[_0xe430('0x1f')](_0x982792));if(_0x982792['error']){if(_0x982792['error'][_0xe430('0x20')]===0x1f4){logger[_0xe430('0x21')](_0xe430('0x22'),_0x24e898,_0x982792['error']['message']);return _0x9e577b(_0x982792['error'][_0xe430('0x23')]);}logger[_0xe430('0x21')](_0xe430('0x22'),_0x24e898,_0x982792['error'][_0xe430('0x23')]);return _0xe36466(_0x982792['error']['message']);}else{logger[_0xe430('0x24')](_0xe430('0x22'),_0x24e898,'request\x20sent');_0xe36466(_0x982792[_0xe430('0x25')]['message']);}})['catch'](function(_0x5359b1){logger[_0xe430('0x21')](_0xe430('0x22'),_0x24e898,_0x5359b1);_0x9e577b(_0x5359b1);});});}function respondWithStatusCode(_0x30058a,_0x11f050){_0x11f050=_0x11f050||0xcc;return function(_0x191c57){if(_0x191c57){return _0x30058a[_0xe430('0x26')](_0x11f050);}return _0x30058a[_0xe430('0x27')](_0x11f050)[_0xe430('0x28')]();};}function respondWithResult(_0xeb346d,_0x5ea31d){_0x5ea31d=_0x5ea31d||0xc8;return function(_0x10cf3b){if(_0x10cf3b){return _0xeb346d[_0xe430('0x27')](_0x5ea31d)['json'](_0x10cf3b);}};}function respondWithFilteredResult(_0x1b02b5,_0x418c5a){return function(_0x2f93d1){if(_0x2f93d1){var _0x4d82bc=_0x2f93d1['count'],_0x4c6769=_0x418c5a[_0xe430('0x29')],_0x2e7ed5=_0x418c5a['offset']+_0x418c5a[_0xe430('0x2a')],_0x13214d;if(_0x2e7ed5>=_0x4d82bc){_0x2e7ed5=_0x4d82bc;_0x13214d=0xc8;}else{_0x13214d=0xce;}_0x1b02b5[_0xe430('0x27')](_0x13214d);return _0x1b02b5[_0xe430('0x2b')](_0xe430('0x2c'),_0x4c6769+'-'+_0x2e7ed5+'/'+_0x4d82bc)['json'](_0x2f93d1);}return null;};}function patchUpdates(_0x1763d4){return function(_0x371cd7){try{jsonpatch[_0xe430('0x2d')](_0x371cd7,_0x1763d4,!![]);}catch(_0x29663a){return BPromise['reject'](_0x29663a);}return _0x371cd7[_0xe430('0x2e')]();};}function saveUpdates(_0x41b8c7,_0x347be4){return function(_0x538fb3){if(_0x538fb3){return _0x538fb3[_0xe430('0x2f')](_0x41b8c7)['then'](function(_0x3d922e){return _0x3d922e;});}return null;};}function removeEntity(_0x5b6d3f,_0x5bb355){return function(_0x199b31){if(_0x199b31){return _0x199b31[_0xe430('0x30')]()[_0xe430('0x31')](function(){_0x5b6d3f[_0xe430('0x27')](0xcc)[_0xe430('0x28')]();});}};}function handleEntityNotFound(_0x3d35ab,_0x3ffdcf){return function(_0x22d797){if(!_0x22d797){_0x3d35ab[_0xe430('0x26')](0x194);}return _0x22d797;};}function handleError(_0x2f8e78,_0x489e22){_0x489e22=_0x489e22||0x1f4;return function(_0x597edb){logger[_0xe430('0x21')](_0x597edb[_0xe430('0x32')]);if(_0x597edb[_0xe430('0x33')]){delete _0x597edb[_0xe430('0x33')];}_0x2f8e78[_0xe430('0x27')](_0x489e22)[_0xe430('0x34')](_0x597edb);};}exports[_0xe430('0x35')]=function(_0x137175,_0x4f09e9){var _0x3089ae={},_0x277448={},_0x2daf00={'count':0x0,'rows':[]};var _0x3f6a4c=db[_0xe430('0x36')][_0xe430('0x37')];_0x277448[_0xe430('0x38')]=_[_0xe430('0x39')](_0x3f6a4c);_0x277448[_0xe430('0x3a')]=_[_0xe430('0x39')](_0x137175['query']);_0x277448[_0xe430('0x3b')]=_[_0xe430('0x3c')](_0x277448[_0xe430('0x38')],_0x277448[_0xe430('0x3a')]);_0x3089ae[_0xe430('0x3d')]=_[_0xe430('0x3c')](_0x277448[_0xe430('0x38')],qs[_0xe430('0x3e')](_0x137175['query']['fields']));_0x3089ae['attributes']=_0x3089ae[_0xe430('0x3d')]['length']?_0x3089ae['attributes']:_0x277448[_0xe430('0x38')];if(!_0x137175['query'][_0xe430('0x3f')](_0xe430('0x40'))){_0x3089ae[_0xe430('0x2a')]=qs['limit'](_0x137175['query'][_0xe430('0x2a')]);_0x3089ae[_0xe430('0x29')]=qs[_0xe430('0x29')](_0x137175[_0xe430('0x3a')]['offset']);}_0x3089ae[_0xe430('0x41')]=qs[_0xe430('0x42')](_0x137175[_0xe430('0x3a')]['sort']);_0x3089ae[_0xe430('0x43')]=qs[_0xe430('0x3b')](_[_0xe430('0x44')](_0x137175['query'],_0x277448['filters']));if(_0x137175[_0xe430('0x3a')]['filter']){_0x3089ae[_0xe430('0x43')]=_['merge'](_0x3089ae['where'],{'$or':_[_0xe430('0x45')](_0x3f6a4c,function(_0x1fa925){if(_0x1fa925[_0xe430('0x46')][_0xe430('0x47')]!==_0xe430('0x48')){var _0x5c0e50={};_0x5c0e50[_0x1fa925[_0xe430('0x49')]]={'$like':'%'+_0x137175[_0xe430('0x3a')][_0xe430('0x4a')]+'%'};return _0x5c0e50;}})});}_0x3089ae=_[_0xe430('0x4b')]({},_0x3089ae,_0x137175['options']);var _0x52cba3={'where':_0x3089ae[_0xe430('0x43')]};return db[_0xe430('0x36')][_0xe430('0x4c')](_0x52cba3)[_0xe430('0x31')](function(_0x1aed85){_0x2daf00[_0xe430('0x4c')]=_0x1aed85;if(_0x137175[_0xe430('0x3a')][_0xe430('0x4d')]){_0x3089ae[_0xe430('0x4e')]=[{'all':!![]}];}return db[_0xe430('0x36')][_0xe430('0x4f')](_0x3089ae);})[_0xe430('0x31')](function(_0x11d0f3){_0x2daf00[_0xe430('0x50')]=_0x11d0f3;return _0x2daf00;})['then'](respondWithFilteredResult(_0x4f09e9,_0x3089ae))[_0xe430('0x51')](handleError(_0x4f09e9,null));};exports[_0xe430('0x52')]=function(_0x2d0599,_0x10ff01){var _0x5316bc={'raw':![],'where':{'id':_0x2d0599[_0xe430('0x53')]['id']}},_0x3bb535={};_0x3bb535[_0xe430('0x38')]=_[_0xe430('0x39')](db['VtigerConfiguration']['rawAttributes']);_0x3bb535[_0xe430('0x3a')]=_['keys'](_0x2d0599[_0xe430('0x3a')]);_0x3bb535[_0xe430('0x3b')]=_[_0xe430('0x3c')](_0x3bb535[_0xe430('0x38')],_0x3bb535[_0xe430('0x3a')]);_0x5316bc[_0xe430('0x3d')]=_[_0xe430('0x3c')](_0x3bb535[_0xe430('0x38')],qs[_0xe430('0x3e')](_0x2d0599[_0xe430('0x3a')][_0xe430('0x3e')]));_0x5316bc[_0xe430('0x3d')]=_0x5316bc[_0xe430('0x3d')]['length']?_0x5316bc['attributes']:_0x3bb535[_0xe430('0x38')];if(_0x2d0599[_0xe430('0x3a')][_0xe430('0x4d')]){_0x5316bc[_0xe430('0x4e')]=[{'all':!![]}];}_0x5316bc=_[_0xe430('0x4b')]({},_0x5316bc,_0x2d0599[_0xe430('0x54')]);return db[_0xe430('0x36')][_0xe430('0x55')](_0x5316bc)[_0xe430('0x31')](handleEntityNotFound(_0x10ff01,null))[_0xe430('0x31')](respondWithResult(_0x10ff01,null))[_0xe430('0x51')](handleError(_0x10ff01,null));};exports['create']=function(_0x5a5171,_0x5e59d7){return db[_0xe430('0x36')]['create'](_0x5a5171[_0xe430('0x56')],{})[_0xe430('0x31')](respondWithResult(_0x5e59d7,0xc9))['catch'](handleError(_0x5e59d7,null));};exports[_0xe430('0x2f')]=function(_0x438685,_0x5553f4){if(_0x438685[_0xe430('0x56')]['id']){delete _0x438685[_0xe430('0x56')]['id'];}return db[_0xe430('0x36')][_0xe430('0x55')]({'where':{'id':_0x438685[_0xe430('0x53')]['id']}})['then'](handleEntityNotFound(_0x5553f4,null))[_0xe430('0x31')](saveUpdates(_0x438685[_0xe430('0x56')],null))[_0xe430('0x31')](respondWithResult(_0x5553f4,null))[_0xe430('0x51')](handleError(_0x5553f4,null));};exports['destroy']=function(_0x41000c,_0x3de10c){return db['VtigerConfiguration']['find']({'where':{'id':_0x41000c[_0xe430('0x53')]['id']}})[_0xe430('0x31')](handleEntityNotFound(_0x3de10c,null))[_0xe430('0x31')](removeEntity(_0x3de10c,null))[_0xe430('0x51')](handleError(_0x3de10c,null));};exports[_0xe430('0x57')]=function(_0x17982c,_0x21ef11,_0x2b9d6d){var _0x2657c6={};var _0x18a702={};var _0x4ae12f;var _0x360dd8;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x17982c[_0xe430('0x53')]['id']}})[_0xe430('0x31')](handleEntityNotFound(_0x21ef11,null))['then'](function(_0x29d1df){if(_0x29d1df){_0x4ae12f=_0x29d1df;_0x18a702[_0xe430('0x38')]=_['keys'](db['VtigerField'][_0xe430('0x37')]);_0x18a702[_0xe430('0x3a')]=_['keys'](_0x17982c['query']);_0x18a702[_0xe430('0x3b')]=_['intersection'](_0x18a702[_0xe430('0x38')],_0x18a702[_0xe430('0x3a')]);_0x2657c6[_0xe430('0x3d')]=_[_0xe430('0x3c')](_0x18a702[_0xe430('0x38')],qs[_0xe430('0x3e')](_0x17982c[_0xe430('0x3a')][_0xe430('0x3e')]));_0x2657c6[_0xe430('0x3d')]=_0x2657c6['attributes'][_0xe430('0x58')]?_0x2657c6[_0xe430('0x3d')]:_0x18a702['model'];_0x2657c6[_0xe430('0x41')]=qs[_0xe430('0x42')](_0x17982c['query'][_0xe430('0x42')]);_0x2657c6[_0xe430('0x43')]=qs['filters'](_['pick'](_0x17982c['query'],_0x18a702['filters']));if(_0x17982c[_0xe430('0x3a')]['filter']){_0x2657c6[_0xe430('0x43')]=_[_0xe430('0x4b')](_0x2657c6[_0xe430('0x43')],{'$or':_[_0xe430('0x45')](_0x2657c6['attributes'],function(_0x194779){var _0x250d25={};_0x250d25[_0x194779]={'$like':'%'+_0x17982c[_0xe430('0x3a')][_0xe430('0x4a')]+'%'};return _0x250d25;})});}_0x2657c6=_[_0xe430('0x4b')]({},_0x2657c6,_0x17982c[_0xe430('0x54')]);return _0x4ae12f['getFields'](_0x2657c6);}})['then'](function(_0x3f5281){if(_0x3f5281){_0x360dd8=_0x3f5281[_0xe430('0x58')];if(!_0x17982c[_0xe430('0x3a')][_0xe430('0x3f')](_0xe430('0x40'))){_0x2657c6[_0xe430('0x2a')]=qs[_0xe430('0x2a')](_0x17982c['query'][_0xe430('0x2a')]);_0x2657c6[_0xe430('0x29')]=qs[_0xe430('0x29')](_0x17982c[_0xe430('0x3a')][_0xe430('0x29')]);}return _0x4ae12f[_0xe430('0x57')](_0x2657c6);}})['then'](function(_0x1c3d2c){if(_0x1c3d2c){return _0x1c3d2c?{'count':_0x360dd8,'rows':_0x1c3d2c}:null;}})[_0xe430('0x31')](respondWithResult(_0x21ef11,null))[_0xe430('0x51')](handleError(_0x21ef11,null));};exports[_0xe430('0x59')]=function(_0x4c93b0,_0x75f825,_0x565fdb){var _0x41d2e4={};var _0xd377b9={};var _0x40eaeb;var _0x323f9d;return db['VtigerConfiguration'][_0xe430('0x5a')]({'where':{'id':_0x4c93b0[_0xe430('0x53')]['id']}})['then'](handleEntityNotFound(_0x75f825,null))['then'](function(_0x2d9e7c){if(_0x2d9e7c){_0x40eaeb=_0x2d9e7c;_0xd377b9[_0xe430('0x38')]=_[_0xe430('0x39')](db[_0xe430('0x5b')][_0xe430('0x37')]);_0xd377b9[_0xe430('0x3a')]=_['keys'](_0x4c93b0[_0xe430('0x3a')]);_0xd377b9['filters']=_[_0xe430('0x3c')](_0xd377b9[_0xe430('0x38')],_0xd377b9[_0xe430('0x3a')]);_0x41d2e4[_0xe430('0x3d')]=_[_0xe430('0x3c')](_0xd377b9[_0xe430('0x38')],qs[_0xe430('0x3e')](_0x4c93b0[_0xe430('0x3a')][_0xe430('0x3e')]));_0x41d2e4[_0xe430('0x3d')]=_0x41d2e4[_0xe430('0x3d')][_0xe430('0x58')]?_0x41d2e4['attributes']:_0xd377b9[_0xe430('0x38')];_0x41d2e4[_0xe430('0x41')]=qs[_0xe430('0x42')](_0x4c93b0[_0xe430('0x3a')]['sort']);_0x41d2e4[_0xe430('0x43')]=qs[_0xe430('0x3b')](_['pick'](_0x4c93b0['query'],_0xd377b9['filters']));if(_0x4c93b0[_0xe430('0x3a')][_0xe430('0x4a')]){_0x41d2e4[_0xe430('0x43')]=_[_0xe430('0x4b')](_0x41d2e4[_0xe430('0x43')],{'$or':_[_0xe430('0x45')](_0x41d2e4[_0xe430('0x3d')],function(_0x367659){var _0x2bbb2e={};_0x2bbb2e[_0x367659]={'$like':'%'+_0x4c93b0['query'][_0xe430('0x4a')]+'%'};return _0x2bbb2e;})});}_0x41d2e4=_[_0xe430('0x4b')]({},_0x41d2e4,_0x4c93b0[_0xe430('0x54')]);return _0x40eaeb[_0xe430('0x59')](_0x41d2e4);}})['then'](function(_0x28f47d){if(_0x28f47d){_0x323f9d=_0x28f47d[_0xe430('0x58')];if(!_0x4c93b0['query'][_0xe430('0x3f')]('nolimit')){_0x41d2e4[_0xe430('0x2a')]=qs['limit'](_0x4c93b0[_0xe430('0x3a')]['limit']);_0x41d2e4[_0xe430('0x29')]=qs['offset'](_0x4c93b0['query']['offset']);}return _0x40eaeb[_0xe430('0x59')](_0x41d2e4);}})[_0xe430('0x31')](function(_0x36fa6d){if(_0x36fa6d){return _0x36fa6d?{'count':_0x323f9d,'rows':_0x36fa6d}:null;}})['then'](respondWithResult(_0x75f825,null))[_0xe430('0x51')](handleError(_0x75f825,null));};exports['getDescriptions']=function(_0x4084bb,_0xed111b,_0x3975b0){var _0x1406cd={};var _0x2e02f4={};var _0xff3e7d;var _0x38e539;return db[_0xe430('0x36')][_0xe430('0x5a')]({'where':{'id':_0x4084bb[_0xe430('0x53')]['id']}})[_0xe430('0x31')](handleEntityNotFound(_0xed111b,null))[_0xe430('0x31')](function(_0x583106){if(_0x583106){_0xff3e7d=_0x583106;_0x2e02f4[_0xe430('0x38')]=_[_0xe430('0x39')](db[_0xe430('0x5b')][_0xe430('0x37')]);_0x2e02f4[_0xe430('0x3a')]=_[_0xe430('0x39')](_0x4084bb[_0xe430('0x3a')]);_0x2e02f4['filters']=_[_0xe430('0x3c')](_0x2e02f4[_0xe430('0x38')],_0x2e02f4[_0xe430('0x3a')]);_0x1406cd[_0xe430('0x3d')]=_[_0xe430('0x3c')](_0x2e02f4[_0xe430('0x38')],qs['fields'](_0x4084bb[_0xe430('0x3a')]['fields']));_0x1406cd['attributes']=_0x1406cd['attributes'][_0xe430('0x58')]?_0x1406cd['attributes']:_0x2e02f4[_0xe430('0x38')];_0x1406cd[_0xe430('0x41')]=qs[_0xe430('0x42')](_0x4084bb[_0xe430('0x3a')][_0xe430('0x42')]);_0x1406cd['where']=qs[_0xe430('0x3b')](_['pick'](_0x4084bb[_0xe430('0x3a')],_0x2e02f4['filters']));if(_0x4084bb[_0xe430('0x3a')][_0xe430('0x4a')]){_0x1406cd['where']=_[_0xe430('0x4b')](_0x1406cd[_0xe430('0x43')],{'$or':_['map'](_0x1406cd[_0xe430('0x3d')],function(_0x16465e){var _0xe942c2={};_0xe942c2[_0x16465e]={'$like':'%'+_0x4084bb[_0xe430('0x3a')][_0xe430('0x4a')]+'%'};return _0xe942c2;})});}_0x1406cd=_['merge']({},_0x1406cd,_0x4084bb[_0xe430('0x54')]);return _0xff3e7d[_0xe430('0x5c')](_0x1406cd);}})['then'](function(_0x3900db){if(_0x3900db){_0x38e539=_0x3900db['length'];if(!_0x4084bb['query'][_0xe430('0x3f')](_0xe430('0x40'))){_0x1406cd[_0xe430('0x2a')]=qs[_0xe430('0x2a')](_0x4084bb['query'][_0xe430('0x2a')]);_0x1406cd[_0xe430('0x29')]=qs[_0xe430('0x29')](_0x4084bb['query'][_0xe430('0x29')]);}return _0xff3e7d[_0xe430('0x5c')](_0x1406cd);}})['then'](function(_0x30618f){if(_0x30618f){return _0x30618f?{'count':_0x38e539,'rows':_0x30618f}:null;}})[_0xe430('0x31')](respondWithResult(_0xed111b,null))[_0xe430('0x51')](handleError(_0xed111b,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 33778fb..3eaba74 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(_0x379ceb,_0x2491d1){var _0x45df3c=function(_0xd9c767){while(--_0xd9c767){_0x379ceb['push'](_0x379ceb['shift']());}};_0x45df3c(++_0x2491d1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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(_0x3f7cab,_0x57ba3d){var _0x4a5ff7=function(_0x320a54){while(--_0x320a54){_0x3f7cab['push'](_0x3f7cab['shift']());}};_0x4a5ff7(++_0x57ba3d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 b3b6226..2efaaee 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 _0x0b6e=['lodash','util','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x0b6e,0x64));var _0xe0b6=function(_0x56cf98,_0x133af0){_0x56cf98=_0x56cf98-0x0;var _0x52998c=_0x0b6e[_0x56cf98];return _0x52998c;};'use strict';var _=require(_0xe0b6('0x0'));var util=require(_0xe0b6('0x1'));var moment=require('moment');var BPromise=require(_0xe0b6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0b6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe0b6('0x4'));var logger=require('../../config/logger')(_0xe0b6('0x5'));var config=require('../../config/environment');var jayson=require(_0xe0b6('0x6'));var client=jayson[_0xe0b6('0x7')][_0xe0b6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7818df,_0x50a258,_0x556979){return new BPromise(function(_0x2d54ae,_0x3a60a5){return client[_0xe0b6('0x9')](_0x7818df,_0x556979)[_0xe0b6('0xa')](function(_0x38ccf8){logger[_0xe0b6('0xb')](_0xe0b6('0xc'),_0x50a258,_0xe0b6('0xd'));logger['debug'](_0xe0b6('0xe'),_0x50a258,_0xe0b6('0xd'),JSON[_0xe0b6('0xf')](_0x38ccf8));if(_0x38ccf8[_0xe0b6('0x10')]){if(_0x38ccf8[_0xe0b6('0x10')][_0xe0b6('0x11')]===0x1f4){logger['error'](_0xe0b6('0xc'),_0x50a258,_0x38ccf8[_0xe0b6('0x10')][_0xe0b6('0x12')]);return _0x3a60a5(_0x38ccf8[_0xe0b6('0x10')][_0xe0b6('0x12')]);}logger[_0xe0b6('0x10')](_0xe0b6('0xc'),_0x50a258,_0x38ccf8[_0xe0b6('0x10')][_0xe0b6('0x12')]);return _0x2d54ae(_0x38ccf8[_0xe0b6('0x10')]['message']);}else{logger[_0xe0b6('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x50a258,_0xe0b6('0xd'));_0x2d54ae(_0x38ccf8['result'][_0xe0b6('0x12')]);}})[_0xe0b6('0x13')](function(_0x4741bf){logger[_0xe0b6('0x10')](_0xe0b6('0xc'),_0x50a258,_0x4741bf);_0x3a60a5(_0x4741bf);});});} \ No newline at end of file +var _0x92ee=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x92ee,0xc2));var _0xe92e=function(_0x4c5c97,_0x4f85bf){_0x4c5c97=_0x4c5c97-0x0;var _0xd5d2cb=_0x92ee[_0x4c5c97];return _0xd5d2cb;};'use strict';var _=require(_0xe92e('0x0'));var util=require(_0xe92e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe92e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe92e('0x3'))['db'];var utils=require(_0xe92e('0x4'));var logger=require('../../config/logger')(_0xe92e('0x5'));var config=require(_0xe92e('0x6'));var jayson=require(_0xe92e('0x7'));var client=jayson[_0xe92e('0x8')][_0xe92e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a7f83,_0x45b073,_0x1c7f57){return new BPromise(function(_0x384f74,_0x3ad36c){return client[_0xe92e('0xa')](_0x1a7f83,_0x1c7f57)[_0xe92e('0xb')](function(_0x3a8b87){logger[_0xe92e('0xc')](_0xe92e('0xd'),_0x45b073,_0xe92e('0xe'));logger[_0xe92e('0xf')](_0xe92e('0x10'),_0x45b073,_0xe92e('0xe'),JSON['stringify'](_0x3a8b87));if(_0x3a8b87['error']){if(_0x3a8b87[_0xe92e('0x11')][_0xe92e('0x12')]===0x1f4){logger['error'](_0xe92e('0xd'),_0x45b073,_0x3a8b87['error'][_0xe92e('0x13')]);return _0x3ad36c(_0x3a8b87[_0xe92e('0x11')][_0xe92e('0x13')]);}logger[_0xe92e('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x45b073,_0x3a8b87[_0xe92e('0x11')]['message']);return _0x384f74(_0x3a8b87[_0xe92e('0x11')]['message']);}else{logger[_0xe92e('0xc')](_0xe92e('0xd'),_0x45b073,_0xe92e('0xe'));_0x384f74(_0x3a8b87[_0xe92e('0x14')][_0xe92e('0x13')]);}})[_0xe92e('0x15')](function(_0x2b9407){logger['error'](_0xe92e('0xd'),_0x45b073,_0x2b9407);_0x3ad36c(_0x2b9407);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 098c05a..096758c 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 _0xa0cf=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','index','get','/:id','post','create','put','update','destroy','exports','multer'];(function(_0x2f69d0,_0x499cc5){var _0x461c13=function(_0x5bb4d0){while(--_0x5bb4d0){_0x2f69d0['push'](_0x2f69d0['shift']());}};_0x461c13(++_0x499cc5);}(_0xa0cf,0xb3));var _0xfa0c=function(_0x2c6484,_0x4fe72c){_0x2c6484=_0x2c6484-0x0;var _0x3b9d94=_0xa0cf[_0x2c6484];return _0x3b9d94;};'use strict';var multer=require(_0xfa0c('0x0'));var util=require(_0xfa0c('0x1'));var path=require(_0xfa0c('0x2'));var timeout=require(_0xfa0c('0x3'));var express=require(_0xfa0c('0x4'));var router=express[_0xfa0c('0x5')]();var auth=require(_0xfa0c('0x6'));var interaction=require(_0xfa0c('0x7'));var config=require(_0xfa0c('0x8'));var controller=require(_0xfa0c('0x9'));router['get']('/',auth[_0xfa0c('0xa')](),controller[_0xfa0c('0xb')]);router[_0xfa0c('0xc')](_0xfa0c('0xd'),auth[_0xfa0c('0xa')](),controller['show']);router[_0xfa0c('0xe')]('/',auth[_0xfa0c('0xa')](),controller[_0xfa0c('0xf')]);router[_0xfa0c('0x10')](_0xfa0c('0xd'),auth[_0xfa0c('0xa')](),controller[_0xfa0c('0x11')]);router['delete'](_0xfa0c('0xd'),auth[_0xfa0c('0xa')](),controller[_0xfa0c('0x12')]);module[_0xfa0c('0x13')]=router; \ No newline at end of file +var _0xa4e8=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','show','post','put','delete','/:id','path'];(function(_0x52ecb7,_0x3b7be9){var _0x81156c=function(_0x3173af){while(--_0x3173af){_0x52ecb7['push'](_0x52ecb7['shift']());}};_0x81156c(++_0x3b7be9);}(_0xa4e8,0xc3));var _0x8a4e=function(_0x549ecd,_0xc8532){_0x549ecd=_0x549ecd-0x0;var _0x5b59e=_0xa4e8[_0x549ecd];return _0x5b59e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8a4e('0x0'));var timeout=require(_0x8a4e('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x8a4e('0x2'));var interaction=require(_0x8a4e('0x3'));var config=require(_0x8a4e('0x4'));var controller=require(_0x8a4e('0x5'));router[_0x8a4e('0x6')]('/',auth[_0x8a4e('0x7')](),controller[_0x8a4e('0x8')]);router[_0x8a4e('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x8a4e('0x9')]);router[_0x8a4e('0xa')]('/',auth[_0x8a4e('0x7')](),controller['create']);router[_0x8a4e('0xb')]('/:id',auth[_0x8a4e('0x7')](),controller['update']);router[_0x8a4e('0xc')](_0x8a4e('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 8f95b1e..d95e7af 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 _0x1be1=['STRING','variable','BOOLEAN','ENUM','string','customVariable','keyValue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1be1,0x192));var _0x11be=function(_0x257cc8,_0xb42691){_0x257cc8=_0x257cc8-0x0;var _0x5a08ed=_0x1be1[_0x257cc8];return _0x5a08ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x11be('0x0')](_0x11be('0x1'),'variable',_0x11be('0x2'),_0x11be('0x3')),'defaultValue':_0x11be('0x1')},'content':{'type':Sequelize[_0x11be('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x11be('0x0')](_0x11be('0x1'),_0x11be('0x5'),'customVariable')},'keyContent':{'type':Sequelize[_0x11be('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x11be('0x4')]},'customField':{'type':Sequelize[_0x11be('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x11be('0x4')]}}; \ No newline at end of file +var _0xb43b=['ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable','STRING'];(function(_0x26721d,_0x448ba5){var _0x1035c5=function(_0x1c1b86){while(--_0x1c1b86){_0x26721d['push'](_0x26721d['shift']());}};_0x1035c5(++_0x448ba5);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4d1a89,_0x6364d7){_0x4d1a89=_0x4d1a89-0x0;var _0x55de6f=_0xb43b[_0x4d1a89];return _0x55de6f;};'use strict';var Sequelize=require(_0xbb43('0x0'));module[_0xbb43('0x1')]={'type':{'type':Sequelize['ENUM'](_0xbb43('0x2'),_0xbb43('0x3'),_0xbb43('0x4'),'keyValue'),'defaultValue':_0xbb43('0x2')},'content':{'type':Sequelize[_0xbb43('0x5')]},'key':{'type':Sequelize[_0xbb43('0x5')]},'keyType':{'type':Sequelize[_0xbb43('0x6')]('string','variable',_0xbb43('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xbb43('0x5')]},'nameField':{'type':Sequelize[_0xbb43('0x5')]},'customField':{'type':Sequelize[_0xbb43('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbb43('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index d8c4d17..ac50fba 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 _0x9de7=['eml-format','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/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','VtigerField','rawAttributes','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','rows','show','params','find','create','body','catch'];(function(_0x5b21c9,_0x4352ef){var _0x241785=function(_0x407bc2){while(--_0x407bc2){_0x5b21c9['push'](_0x5b21c9['shift']());}};_0x241785(++_0x4352ef);}(_0x9de7,0x90));var _0x79de=function(_0x4c4042,_0x1ea485){_0x4c4042=_0x4c4042-0x0;var _0xbd10dc=_0x9de7[_0x4c4042];return _0xbd10dc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x79de('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x79de('0x1'));var moment=require(_0x79de('0x2'));var BPromise=require(_0x79de('0x3'));var Mustache=require(_0x79de('0x4'));var util=require(_0x79de('0x5'));var path=require(_0x79de('0x6'));var sox=require(_0x79de('0x7'));var csv=require(_0x79de('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x79de('0x9'));var squel=require(_0x79de('0xa'));var crypto=require(_0x79de('0xb'));var jsforce=require(_0x79de('0xc'));var deskjs=require(_0x79de('0xd'));var toCsv=require(_0x79de('0x8'));var querystring=require(_0x79de('0xe'));var Papa=require(_0x79de('0xf'));var Redis=require(_0x79de('0x10'));var authService=require(_0x79de('0x11'));var qs=require(_0x79de('0x12'));var hardwareService=require(_0x79de('0x13'));var logger=require(_0x79de('0x14'))(_0x79de('0x15'));var utils=require('../../config/utils');var config=require(_0x79de('0x16'));var db=require(_0x79de('0x17'))['db'];function respondWithStatusCode(_0x4da47a,_0x45a195){_0x45a195=_0x45a195||0xcc;return function(_0x168b76){if(_0x168b76){return _0x4da47a['sendStatus'](_0x45a195);}return _0x4da47a[_0x79de('0x18')](_0x45a195)['end']();};}function respondWithResult(_0x47c169,_0x4c5a5e){_0x4c5a5e=_0x4c5a5e||0xc8;return function(_0x332d32){if(_0x332d32){return _0x47c169[_0x79de('0x18')](_0x4c5a5e)[_0x79de('0x19')](_0x332d32);}};}function respondWithFilteredResult(_0x2048aa,_0x59a2ad){return function(_0x5a1230){if(_0x5a1230){var _0x4142af=_0x5a1230[_0x79de('0x1a')],_0x17c12c=_0x59a2ad[_0x79de('0x1b')],_0x29cfa3=_0x59a2ad[_0x79de('0x1b')]+_0x59a2ad[_0x79de('0x1c')],_0x404cdd;if(_0x29cfa3>=_0x4142af){_0x29cfa3=_0x4142af;_0x404cdd=0xc8;}else{_0x404cdd=0xce;}_0x2048aa[_0x79de('0x18')](_0x404cdd);return _0x2048aa[_0x79de('0x1d')](_0x79de('0x1e'),_0x17c12c+'-'+_0x29cfa3+'/'+_0x4142af)[_0x79de('0x19')](_0x5a1230);}return null;};}function patchUpdates(_0x272d0f){return function(_0x3ccf62){try{jsonpatch[_0x79de('0x1f')](_0x3ccf62,_0x272d0f,!![]);}catch(_0x29f5dc){return BPromise[_0x79de('0x20')](_0x29f5dc);}return _0x3ccf62[_0x79de('0x21')]();};}function saveUpdates(_0x13d70d,_0x4551fe){return function(_0x14a72d){if(_0x14a72d){return _0x14a72d[_0x79de('0x22')](_0x13d70d)[_0x79de('0x23')](function(_0x5d93ca){return _0x5d93ca;});}return null;};}function removeEntity(_0x379118,_0x2ad26e){return function(_0x654b8){if(_0x654b8){return _0x654b8[_0x79de('0x24')]()[_0x79de('0x23')](function(){_0x379118[_0x79de('0x18')](0xcc)[_0x79de('0x25')]();});}};}function handleEntityNotFound(_0x162324,_0x1ff803){return function(_0xddd0dd){if(!_0xddd0dd){_0x162324['sendStatus'](0x194);}return _0xddd0dd;};}function handleError(_0x3c758c,_0x4489c0){_0x4489c0=_0x4489c0||0x1f4;return function(_0x266313){logger[_0x79de('0x26')](_0x266313['stack']);if(_0x266313[_0x79de('0x27')]){delete _0x266313[_0x79de('0x27')];}_0x3c758c[_0x79de('0x18')](_0x4489c0)[_0x79de('0x28')](_0x266313);};}exports['index']=function(_0x5371f5,_0x207e3b){var _0xc7ad7d={},_0x3ea928={},_0x581be6={'count':0x0,'rows':[]};var _0x434574=db[_0x79de('0x29')][_0x79de('0x2a')];_0x3ea928['model']=_[_0x79de('0x2b')](_0x434574);_0x3ea928['query']=_[_0x79de('0x2b')](_0x5371f5['query']);_0x3ea928[_0x79de('0x2c')]=_[_0x79de('0x2d')](_0x3ea928['model'],_0x3ea928[_0x79de('0x2e')]);_0xc7ad7d[_0x79de('0x2f')]=_[_0x79de('0x2d')](_0x3ea928[_0x79de('0x30')],qs[_0x79de('0x31')](_0x5371f5[_0x79de('0x2e')][_0x79de('0x31')]));_0xc7ad7d[_0x79de('0x2f')]=_0xc7ad7d[_0x79de('0x2f')][_0x79de('0x32')]?_0xc7ad7d[_0x79de('0x2f')]:_0x3ea928[_0x79de('0x30')];if(!_0x5371f5['query'][_0x79de('0x33')](_0x79de('0x34'))){_0xc7ad7d[_0x79de('0x1c')]=qs[_0x79de('0x1c')](_0x5371f5[_0x79de('0x2e')][_0x79de('0x1c')]);_0xc7ad7d[_0x79de('0x1b')]=qs[_0x79de('0x1b')](_0x5371f5[_0x79de('0x2e')][_0x79de('0x1b')]);}_0xc7ad7d['order']=qs[_0x79de('0x35')](_0x5371f5[_0x79de('0x2e')][_0x79de('0x35')]);_0xc7ad7d[_0x79de('0x36')]=qs[_0x79de('0x2c')](_[_0x79de('0x37')](_0x5371f5[_0x79de('0x2e')],_0x3ea928[_0x79de('0x2c')]));if(_0x5371f5[_0x79de('0x2e')][_0x79de('0x38')]){_0xc7ad7d[_0x79de('0x36')]=_[_0x79de('0x39')](_0xc7ad7d['where'],{'$or':_['map'](_0x434574,function(_0x51f990){if(_0x51f990[_0x79de('0x3a')][_0x79de('0x3b')]!==_0x79de('0x3c')){var _0x510b3={};_0x510b3[_0x51f990[_0x79de('0x3d')]]={'$like':'%'+_0x5371f5[_0x79de('0x2e')][_0x79de('0x38')]+'%'};return _0x510b3;}})});}_0xc7ad7d=_[_0x79de('0x39')]({},_0xc7ad7d,_0x5371f5[_0x79de('0x3e')]);var _0x3e52ef={'where':_0xc7ad7d[_0x79de('0x36')]};return db[_0x79de('0x29')]['count'](_0x3e52ef)[_0x79de('0x23')](function(_0x1245fe){_0x581be6['count']=_0x1245fe;if(_0x5371f5[_0x79de('0x2e')][_0x79de('0x3f')]){_0xc7ad7d[_0x79de('0x40')]=[{'all':!![]}];}return db[_0x79de('0x29')]['findAll'](_0xc7ad7d);})[_0x79de('0x23')](function(_0xb375f){_0x581be6[_0x79de('0x41')]=_0xb375f;return _0x581be6;})[_0x79de('0x23')](respondWithFilteredResult(_0x207e3b,_0xc7ad7d))['catch'](handleError(_0x207e3b,null));};exports[_0x79de('0x42')]=function(_0x36ed2d,_0x3f9f3d){var _0x4896fa={'raw':!![],'where':{'id':_0x36ed2d[_0x79de('0x43')]['id']}},_0x5b816b={};_0x5b816b[_0x79de('0x30')]=_[_0x79de('0x2b')](db[_0x79de('0x29')][_0x79de('0x2a')]);_0x5b816b['query']=_[_0x79de('0x2b')](_0x36ed2d[_0x79de('0x2e')]);_0x5b816b['filters']=_['intersection'](_0x5b816b[_0x79de('0x30')],_0x5b816b[_0x79de('0x2e')]);_0x4896fa[_0x79de('0x2f')]=_[_0x79de('0x2d')](_0x5b816b[_0x79de('0x30')],qs[_0x79de('0x31')](_0x36ed2d[_0x79de('0x2e')]['fields']));_0x4896fa[_0x79de('0x2f')]=_0x4896fa['attributes']['length']?_0x4896fa[_0x79de('0x2f')]:_0x5b816b['model'];if(_0x36ed2d[_0x79de('0x2e')][_0x79de('0x3f')]){_0x4896fa[_0x79de('0x40')]=[{'all':!![]}];}_0x4896fa=_[_0x79de('0x39')]({},_0x4896fa,_0x36ed2d['options']);return db[_0x79de('0x29')][_0x79de('0x44')](_0x4896fa)['then'](handleEntityNotFound(_0x3f9f3d,null))[_0x79de('0x23')](respondWithResult(_0x3f9f3d,null))['catch'](handleError(_0x3f9f3d,null));};exports['create']=function(_0x3444f0,_0x1c2fa9){return db[_0x79de('0x29')][_0x79de('0x45')](_0x3444f0[_0x79de('0x46')],{})[_0x79de('0x23')](respondWithResult(_0x1c2fa9,0xc9))[_0x79de('0x47')](handleError(_0x1c2fa9,null));};exports[_0x79de('0x22')]=function(_0x32fa96,_0x2905cd){if(_0x32fa96[_0x79de('0x46')]['id']){delete _0x32fa96[_0x79de('0x46')]['id'];}return db[_0x79de('0x29')]['find']({'where':{'id':_0x32fa96[_0x79de('0x43')]['id']}})[_0x79de('0x23')](handleEntityNotFound(_0x2905cd,null))[_0x79de('0x23')](saveUpdates(_0x32fa96[_0x79de('0x46')],null))[_0x79de('0x23')](respondWithResult(_0x2905cd,null))['catch'](handleError(_0x2905cd,null));};exports[_0x79de('0x24')]=function(_0x474ec7,_0x184b2d){return db[_0x79de('0x29')][_0x79de('0x44')]({'where':{'id':_0x474ec7[_0x79de('0x43')]['id']}})[_0x79de('0x23')](handleEntityNotFound(_0x184b2d,null))[_0x79de('0x23')](removeEntity(_0x184b2d,null))[_0x79de('0x47')](handleError(_0x184b2d,null));}; \ No newline at end of file +var _0xc1ca=['squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','save','then','error','stack','send','VtigerField','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','type','VIRTUAL','field','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','html-pdf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash'];(function(_0x2f32c4,_0x531dc6){var _0x3f3018=function(_0x406998){while(--_0x406998){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x3f3018(++_0x531dc6);}(_0xc1ca,0x188));var _0xac1c=function(_0x55c1e0,_0x1cb6b7){_0x55c1e0=_0x55c1e0-0x0;var _0x1067d2=_0xc1ca[_0x55c1e0];return _0x1067d2;};'use strict';var pdf=require(_0xac1c('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xac1c('0x1'));var moment=require(_0xac1c('0x2'));var BPromise=require(_0xac1c('0x3'));var Mustache=require(_0xac1c('0x4'));var util=require(_0xac1c('0x5'));var path=require(_0xac1c('0x6'));var sox=require('sox');var csv=require(_0xac1c('0x7'));var ejs=require(_0xac1c('0x8'));var fs=require('fs');var _=require(_0xac1c('0x9'));var squel=require(_0xac1c('0xa'));var crypto=require('crypto');var jsforce=require(_0xac1c('0xb'));var deskjs=require(_0xac1c('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xac1c('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xac1c('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac1c('0xf'))(_0xac1c('0x10'));var utils=require(_0xac1c('0x11'));var config=require(_0xac1c('0x12'));var db=require(_0xac1c('0x13'))['db'];function respondWithStatusCode(_0xce2b96,_0x3b0ae8){_0x3b0ae8=_0x3b0ae8||0xcc;return function(_0x2370c1){if(_0x2370c1){return _0xce2b96[_0xac1c('0x14')](_0x3b0ae8);}return _0xce2b96['status'](_0x3b0ae8)[_0xac1c('0x15')]();};}function respondWithResult(_0x1716ed,_0x1c67fa){_0x1c67fa=_0x1c67fa||0xc8;return function(_0x2f41cd){if(_0x2f41cd){return _0x1716ed[_0xac1c('0x16')](_0x1c67fa)[_0xac1c('0x17')](_0x2f41cd);}};}function respondWithFilteredResult(_0xace7c5,_0x567f4e){return function(_0x2d4208){if(_0x2d4208){var _0x178941=_0x2d4208[_0xac1c('0x18')],_0x6203f4=_0x567f4e[_0xac1c('0x19')],_0x5f2281=_0x567f4e[_0xac1c('0x19')]+_0x567f4e['limit'],_0xfc3c3e;if(_0x5f2281>=_0x178941){_0x5f2281=_0x178941;_0xfc3c3e=0xc8;}else{_0xfc3c3e=0xce;}_0xace7c5[_0xac1c('0x16')](_0xfc3c3e);return _0xace7c5[_0xac1c('0x1a')](_0xac1c('0x1b'),_0x6203f4+'-'+_0x5f2281+'/'+_0x178941)[_0xac1c('0x17')](_0x2d4208);}return null;};}function patchUpdates(_0x25999e){return function(_0x4fedd4){try{jsonpatch[_0xac1c('0x1c')](_0x4fedd4,_0x25999e,!![]);}catch(_0x321256){return BPromise['reject'](_0x321256);}return _0x4fedd4[_0xac1c('0x1d')]();};}function saveUpdates(_0x1a907f,_0x1d8f00){return function(_0x18cb8a){if(_0x18cb8a){return _0x18cb8a['update'](_0x1a907f)[_0xac1c('0x1e')](function(_0x2626d6){return _0x2626d6;});}return null;};}function removeEntity(_0x3f1b5b,_0x25e359){return function(_0x96c8be){if(_0x96c8be){return _0x96c8be['destroy']()['then'](function(){_0x3f1b5b[_0xac1c('0x16')](0xcc)[_0xac1c('0x15')]();});}};}function handleEntityNotFound(_0x19ede4,_0x2b6336){return function(_0x4c9af0){if(!_0x4c9af0){_0x19ede4[_0xac1c('0x14')](0x194);}return _0x4c9af0;};}function handleError(_0x3f2eb8,_0x71573c){_0x71573c=_0x71573c||0x1f4;return function(_0x5c5724){logger[_0xac1c('0x1f')](_0x5c5724[_0xac1c('0x20')]);if(_0x5c5724['name']){delete _0x5c5724['name'];}_0x3f2eb8[_0xac1c('0x16')](_0x71573c)[_0xac1c('0x21')](_0x5c5724);};}exports['index']=function(_0x3d9020,_0x1d043d){var _0x4de08c={},_0x29e85d={},_0x2c0347={'count':0x0,'rows':[]};var _0x21276a=db[_0xac1c('0x22')][_0xac1c('0x23')];_0x29e85d[_0xac1c('0x24')]=_[_0xac1c('0x25')](_0x21276a);_0x29e85d[_0xac1c('0x26')]=_[_0xac1c('0x25')](_0x3d9020[_0xac1c('0x26')]);_0x29e85d[_0xac1c('0x27')]=_[_0xac1c('0x28')](_0x29e85d['model'],_0x29e85d[_0xac1c('0x26')]);_0x4de08c['attributes']=_[_0xac1c('0x28')](_0x29e85d[_0xac1c('0x24')],qs['fields'](_0x3d9020[_0xac1c('0x26')][_0xac1c('0x29')]));_0x4de08c['attributes']=_0x4de08c[_0xac1c('0x2a')][_0xac1c('0x2b')]?_0x4de08c[_0xac1c('0x2a')]:_0x29e85d[_0xac1c('0x24')];if(!_0x3d9020[_0xac1c('0x26')][_0xac1c('0x2c')](_0xac1c('0x2d'))){_0x4de08c[_0xac1c('0x2e')]=qs[_0xac1c('0x2e')](_0x3d9020[_0xac1c('0x26')][_0xac1c('0x2e')]);_0x4de08c[_0xac1c('0x19')]=qs['offset'](_0x3d9020[_0xac1c('0x26')][_0xac1c('0x19')]);}_0x4de08c['order']=qs[_0xac1c('0x2f')](_0x3d9020[_0xac1c('0x26')]['sort']);_0x4de08c[_0xac1c('0x30')]=qs[_0xac1c('0x27')](_[_0xac1c('0x31')](_0x3d9020[_0xac1c('0x26')],_0x29e85d[_0xac1c('0x27')]));if(_0x3d9020[_0xac1c('0x26')][_0xac1c('0x32')]){_0x4de08c[_0xac1c('0x30')]=_[_0xac1c('0x33')](_0x4de08c[_0xac1c('0x30')],{'$or':_[_0xac1c('0x34')](_0x21276a,function(_0x3e35e0){if(_0x3e35e0[_0xac1c('0x35')]['key']!==_0xac1c('0x36')){var _0x2152ef={};_0x2152ef[_0x3e35e0[_0xac1c('0x37')]]={'$like':'%'+_0x3d9020[_0xac1c('0x26')][_0xac1c('0x32')]+'%'};return _0x2152ef;}})});}_0x4de08c=_[_0xac1c('0x33')]({},_0x4de08c,_0x3d9020['options']);var _0x4ddbeb={'where':_0x4de08c[_0xac1c('0x30')]};return db['VtigerField']['count'](_0x4ddbeb)['then'](function(_0x109503){_0x2c0347[_0xac1c('0x18')]=_0x109503;if(_0x3d9020['query'][_0xac1c('0x38')]){_0x4de08c[_0xac1c('0x39')]=[{'all':!![]}];}return db[_0xac1c('0x22')][_0xac1c('0x3a')](_0x4de08c);})[_0xac1c('0x1e')](function(_0x925cb9){_0x2c0347[_0xac1c('0x3b')]=_0x925cb9;return _0x2c0347;})[_0xac1c('0x1e')](respondWithFilteredResult(_0x1d043d,_0x4de08c))['catch'](handleError(_0x1d043d,null));};exports[_0xac1c('0x3c')]=function(_0x405549,_0x105451){var _0x42e2df={'raw':!![],'where':{'id':_0x405549[_0xac1c('0x3d')]['id']}},_0x215326={};_0x215326['model']=_['keys'](db[_0xac1c('0x22')][_0xac1c('0x23')]);_0x215326['query']=_[_0xac1c('0x25')](_0x405549[_0xac1c('0x26')]);_0x215326[_0xac1c('0x27')]=_[_0xac1c('0x28')](_0x215326[_0xac1c('0x24')],_0x215326[_0xac1c('0x26')]);_0x42e2df[_0xac1c('0x2a')]=_[_0xac1c('0x28')](_0x215326[_0xac1c('0x24')],qs[_0xac1c('0x29')](_0x405549[_0xac1c('0x26')][_0xac1c('0x29')]));_0x42e2df[_0xac1c('0x2a')]=_0x42e2df['attributes']['length']?_0x42e2df[_0xac1c('0x2a')]:_0x215326[_0xac1c('0x24')];if(_0x405549[_0xac1c('0x26')][_0xac1c('0x38')]){_0x42e2df['include']=[{'all':!![]}];}_0x42e2df=_[_0xac1c('0x33')]({},_0x42e2df,_0x405549[_0xac1c('0x3e')]);return db[_0xac1c('0x22')][_0xac1c('0x3f')](_0x42e2df)[_0xac1c('0x1e')](handleEntityNotFound(_0x105451,null))[_0xac1c('0x1e')](respondWithResult(_0x105451,null))[_0xac1c('0x40')](handleError(_0x105451,null));};exports['create']=function(_0x247594,_0x2f7f53){return db[_0xac1c('0x22')][_0xac1c('0x41')](_0x247594[_0xac1c('0x42')],{})['then'](respondWithResult(_0x2f7f53,0xc9))['catch'](handleError(_0x2f7f53,null));};exports['update']=function(_0x57e5b5,_0x8bc666){if(_0x57e5b5['body']['id']){delete _0x57e5b5['body']['id'];}return db['VtigerField'][_0xac1c('0x3f')]({'where':{'id':_0x57e5b5[_0xac1c('0x3d')]['id']}})[_0xac1c('0x1e')](handleEntityNotFound(_0x8bc666,null))[_0xac1c('0x1e')](saveUpdates(_0x57e5b5[_0xac1c('0x42')],null))[_0xac1c('0x1e')](respondWithResult(_0x8bc666,null))['catch'](handleError(_0x8bc666,null));};exports['destroy']=function(_0x3b4c76,_0x1bd411){return db[_0xac1c('0x22')][_0xac1c('0x3f')]({'where':{'id':_0x3b4c76['params']['id']}})[_0xac1c('0x1e')](handleEntityNotFound(_0x1bd411,null))[_0xac1c('0x1e')](removeEntity(_0x1bd411,null))[_0xac1c('0x40')](handleError(_0x1bd411,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index adc08c3..480b753 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 _0x7066=['idField','FieldId','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','int_vtiger_fields','vtiger_unique_index'];(function(_0x31598b,_0x10064d){var _0x38e2ec=function(_0x55515e){while(--_0x55515e){_0x31598b['push'](_0x31598b['shift']());}};_0x38e2ec(++_0x10064d);}(_0x7066,0x188));var _0x6706=function(_0x43dd67,_0x181bff){_0x43dd67=_0x43dd67-0x0;var _0x36d9bd=_0x7066[_0x43dd67];return _0x36d9bd;};'use strict';var _=require('lodash');var util=require(_0x6706('0x0'));var logger=require(_0x6706('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6706('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6706('0x3'));var rimraf=require(_0x6706('0x4'));var config=require(_0x6706('0x5'));var attributes=require(_0x6706('0x6'));module[_0x6706('0x7')]=function(_0x3168b2,_0x300a76){return _0x3168b2[_0x6706('0x8')]('VtigerField',attributes,{'tableName':_0x6706('0x9'),'paranoid':![],'indexes':[{'name':_0x6706('0xa'),'fields':[_0x6706('0xb'),_0x6706('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9e35=['VtigerField','vtiger_unique_index','idField','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','define'];(function(_0x44532f,_0x2dac86){var _0x11e878=function(_0x1cb557){while(--_0x1cb557){_0x44532f['push'](_0x44532f['shift']());}};_0x11e878(++_0x2dac86);}(_0x9e35,0x153));var _0x59e3=function(_0x404b2e,_0x12c3f5){_0x404b2e=_0x404b2e-0x0;var _0x9d0cb8=_0x9e35[_0x404b2e];return _0x9d0cb8;};'use strict';var _=require('lodash');var util=require(_0x59e3('0x0'));var logger=require('../../config/logger')(_0x59e3('0x1'));var moment=require('moment');var BPromise=require(_0x59e3('0x2'));var rp=require(_0x59e3('0x3'));var fs=require('fs');var path=require(_0x59e3('0x4'));var rimraf=require(_0x59e3('0x5'));var config=require(_0x59e3('0x6'));var attributes=require(_0x59e3('0x7'));module['exports']=function(_0x1d3815,_0x2749f5){return _0x1d3815[_0x59e3('0x8')](_0x59e3('0x9'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x59e3('0xa'),'fields':[_0x59e3('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 8ab1cc4..a433177 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 _0x1fde=['request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','http'];(function(_0x5ce778,_0xc153cd){var _0x1742fb=function(_0x505322){while(--_0x505322){_0x5ce778['push'](_0x5ce778['shift']());}};_0x1742fb(++_0xc153cd);}(_0x1fde,0x1d2));var _0xe1fd=function(_0x189c9e,_0x1c3b55){_0x189c9e=_0x189c9e-0x0;var _0x3f38ca=_0x1fde[_0x189c9e];return _0x3f38ca;};'use strict';var _=require(_0xe1fd('0x0'));var util=require(_0xe1fd('0x1'));var moment=require(_0xe1fd('0x2'));var BPromise=require(_0xe1fd('0x3'));var rs=require(_0xe1fd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe1fd('0x5'))['db'];var utils=require(_0xe1fd('0x6'));var logger=require(_0xe1fd('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe1fd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x58d35e,_0x1eb3f3,_0x3e2803){return new BPromise(function(_0x178470,_0x5d917b){return client[_0xe1fd('0x9')](_0x58d35e,_0x3e2803)[_0xe1fd('0xa')](function(_0x3b225c){logger[_0xe1fd('0xb')](_0xe1fd('0xc'),_0x1eb3f3,_0xe1fd('0xd'));logger['debug'](_0xe1fd('0xe'),_0x1eb3f3,_0xe1fd('0xd'),JSON[_0xe1fd('0xf')](_0x3b225c));if(_0x3b225c['error']){if(_0x3b225c['error']['code']===0x1f4){logger[_0xe1fd('0x10')](_0xe1fd('0xc'),_0x1eb3f3,_0x3b225c[_0xe1fd('0x10')][_0xe1fd('0x11')]);return _0x5d917b(_0x3b225c[_0xe1fd('0x10')][_0xe1fd('0x11')]);}logger[_0xe1fd('0x10')](_0xe1fd('0xc'),_0x1eb3f3,_0x3b225c[_0xe1fd('0x10')]['message']);return _0x178470(_0x3b225c[_0xe1fd('0x10')][_0xe1fd('0x11')]);}else{logger[_0xe1fd('0xb')]('VtigerField,\x20%s,\x20%s',_0x1eb3f3,'request\x20sent');_0x178470(_0x3b225c['result']['message']);}})[_0xe1fd('0x12')](function(_0x4196a9){logger[_0xe1fd('0x10')](_0xe1fd('0xc'),_0x1eb3f3,_0x4196a9);_0x5d917b(_0x4196a9);});});} \ No newline at end of file +var _0xb9bc=['debug','VtigerField,\x20%s,\x20%s,\x20%s','error','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent'];(function(_0x21014e,_0x147635){var _0x24e053=function(_0x52f82b){while(--_0x52f82b){_0x21014e['push'](_0x21014e['shift']());}};_0x24e053(++_0x147635);}(_0xb9bc,0xa1));var _0xcb9b=function(_0x3c2b2e,_0x3e6e53){_0x3c2b2e=_0x3c2b2e-0x0;var _0x27a338=_0xb9bc[_0x3c2b2e];return _0x27a338;};'use strict';var _=require(_0xcb9b('0x0'));var util=require(_0xcb9b('0x1'));var moment=require(_0xcb9b('0x2'));var BPromise=require(_0xcb9b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb9b('0x4'))['db'];var utils=require(_0xcb9b('0x5'));var logger=require(_0xcb9b('0x6'))(_0xcb9b('0x7'));var config=require(_0xcb9b('0x8'));var jayson=require(_0xcb9b('0x9'));var client=jayson[_0xcb9b('0xa')][_0xcb9b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36ab00,_0x14962e,_0x3c8d0e){return new BPromise(function(_0x2b2969,_0x40c518){return client[_0xcb9b('0xc')](_0x36ab00,_0x3c8d0e)['then'](function(_0x54c3a9){logger[_0xcb9b('0xd')]('VtigerField,\x20%s,\x20%s',_0x14962e,_0xcb9b('0xe'));logger[_0xcb9b('0xf')](_0xcb9b('0x10'),_0x14962e,'request\x20sent',JSON['stringify'](_0x54c3a9));if(_0x54c3a9[_0xcb9b('0x11')]){if(_0x54c3a9[_0xcb9b('0x11')]['code']===0x1f4){logger[_0xcb9b('0x11')](_0xcb9b('0x12'),_0x14962e,_0x54c3a9[_0xcb9b('0x11')][_0xcb9b('0x13')]);return _0x40c518(_0x54c3a9[_0xcb9b('0x11')][_0xcb9b('0x13')]);}logger['error'](_0xcb9b('0x12'),_0x14962e,_0x54c3a9[_0xcb9b('0x11')][_0xcb9b('0x13')]);return _0x2b2969(_0x54c3a9[_0xcb9b('0x11')][_0xcb9b('0x13')]);}else{logger['info'](_0xcb9b('0x12'),_0x14962e,_0xcb9b('0xe'));_0x2b2969(_0x54c3a9[_0xcb9b('0x14')][_0xcb9b('0x13')]);}})[_0xcb9b('0x15')](function(_0x2f570f){logger[_0xcb9b('0x11')]('VtigerField,\x20%s,\x20%s',_0x14962e,_0x2f570f);_0x40c518(_0x2f570f);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 5fcdc47..f475187 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 _0x7565=['isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','post','create','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller'];(function(_0x5c942a,_0x4c8872){var _0x21c584=function(_0x5af6b2){while(--_0x5af6b2){_0x5c942a['push'](_0x5c942a['shift']());}};_0x21c584(++_0x4c8872);}(_0x7565,0xad));var _0x5756=function(_0x1c6a3f,_0x2a8f48){_0x1c6a3f=_0x1c6a3f-0x0;var _0x3e5c27=_0x7565[_0x1c6a3f];return _0x3e5c27;};'use strict';var multer=require(_0x5756('0x0'));var util=require(_0x5756('0x1'));var path=require(_0x5756('0x2'));var timeout=require(_0x5756('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x5756('0x4'));var interaction=require(_0x5756('0x5'));var config=require('../../config/environment');var controller=require(_0x5756('0x6'));router['get']('/',auth[_0x5756('0x7')](),controller['index']);router[_0x5756('0x8')](_0x5756('0x9'),auth[_0x5756('0x7')](),controller[_0x5756('0xa')]);router[_0x5756('0x8')](_0x5756('0xb'),auth[_0x5756('0x7')](),controller[_0x5756('0xc')]);router[_0x5756('0x8')]('/:id/fields',auth[_0x5756('0x7')](),controller['getFields']);router[_0x5756('0xd')]('/',auth[_0x5756('0x7')](),controller[_0x5756('0xe')]);router[_0x5756('0xd')](_0x5756('0xb'),auth[_0x5756('0x7')](),controller[_0x5756('0xf')]);router[_0x5756('0x10')]('/:id',auth[_0x5756('0x7')](),controller['update']);router[_0x5756('0x11')](_0x5756('0x9'),auth[_0x5756('0x7')](),controller[_0x5756('0x12')]);module[_0x5756('0x13')]=router; \ No newline at end of file +var _0x9cfb=['put','update','delete','destroy','multer','path','express','Router','../../components/auth/service','index','/:id','isAuthenticated','show','get','/:id/configurations','/:id/fields','create','post','addConfiguration'];(function(_0x43c824,_0x42a984){var _0xd86f7c=function(_0x3462c1){while(--_0x3462c1){_0x43c824['push'](_0x43c824['shift']());}};_0xd86f7c(++_0x42a984);}(_0x9cfb,0x193));var _0xb9cf=function(_0x441c7b,_0x5c9878){_0x441c7b=_0x441c7b-0x0;var _0x4ae64b=_0x9cfb[_0x441c7b];return _0x4ae64b;};'use strict';var multer=require(_0xb9cf('0x0'));var util=require('util');var path=require(_0xb9cf('0x1'));var timeout=require('connect-timeout');var express=require(_0xb9cf('0x2'));var router=express[_0xb9cf('0x3')]();var auth=require(_0xb9cf('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb9cf('0x5')]);router['get'](_0xb9cf('0x6'),auth[_0xb9cf('0x7')](),controller[_0xb9cf('0x8')]);router[_0xb9cf('0x9')](_0xb9cf('0xa'),auth[_0xb9cf('0x7')](),controller['getConfigurations']);router['get'](_0xb9cf('0xb'),auth[_0xb9cf('0x7')](),controller['getFields']);router['post']('/',auth[_0xb9cf('0x7')](),controller[_0xb9cf('0xc')]);router[_0xb9cf('0xd')](_0xb9cf('0xa'),auth['isAuthenticated'](),controller[_0xb9cf('0xe')]);router[_0xb9cf('0xf')](_0xb9cf('0x6'),auth[_0xb9cf('0x7')](),controller[_0xb9cf('0x10')]);router[_0xb9cf('0x11')]('/:id',auth[_0xb9cf('0x7')](),controller[_0xb9cf('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 5159a36..fe3d3cf 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 _0x8fc1=['ENUM','integrationTab','newTab','sequelize','exports','STRING','username','remoteUri'];(function(_0x248c76,_0x326ee2){var _0x4f1a01=function(_0x1f8e58){while(--_0x1f8e58){_0x248c76['push'](_0x248c76['shift']());}};_0x4f1a01(++_0x326ee2);}(_0x8fc1,0x193));var _0x18fc=function(_0x120521,_0x5d4130){_0x120521=_0x120521-0x0;var _0x231157=_0x8fc1[_0x120521];return _0x231157;};'use strict';var Sequelize=require(_0x18fc('0x0'));module[_0x18fc('0x1')]={'name':{'type':Sequelize[_0x18fc('0x2')]},'description':{'type':Sequelize[_0x18fc('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x18fc('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x18fc('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x18fc('0x4')},'authType':{'type':Sequelize[_0x18fc('0x5')]('password','token'),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x18fc('0x2')]},'type':{'type':Sequelize['ENUM'](_0x18fc('0x6'),_0x18fc('0x7')),'defaultValue':_0x18fc('0x6')}}; \ No newline at end of file +var _0xb10f=['integrationTab','newTab','STRING','username','ENUM','password','token'];(function(_0x16c204,_0x5af1d6){var _0x18ad55=function(_0x1cadad){while(--_0x1cadad){_0x16c204['push'](_0x16c204['shift']());}};_0x18ad55(++_0x5af1d6);}(_0xb10f,0xe9));var _0xfb10=function(_0x549eab,_0x34fa84){_0x549eab=_0x549eab-0x0;var _0x47c811=_0xb10f[_0x549eab];return _0x47c811;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfb10('0x0')]},'username':{'type':Sequelize['STRING'],'unique':_0xfb10('0x1')},'password':{'type':Sequelize[_0xfb10('0x0')]},'token':{'type':Sequelize[_0xfb10('0x0')]},'remoteUri':{'type':Sequelize[_0xfb10('0x0')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xfb10('0x2')](_0xfb10('0x3'),_0xfb10('0x4')),'defaultValue':_0xfb10('0x3')},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xfb10('0x2')](_0xfb10('0x5'),_0xfb10('0x6')),'defaultValue':_0xfb10('0x5')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index eaabf2c..8cc03c7 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 _0xbfc6=['getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','html-pdf','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','../../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','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','sendStatus','end','status','count','offset','set','json','apply','save','destroy','stack','name','send','ZendeskAccount','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','field','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','find','findOne','ZendeskConfiguration','getConfigurations','nolimit','addConfiguration','AccountId','getSubjects','type','Descriptions','getDescriptions','ZendeskField','Subjects','getFields','username','password','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','%s:%s','toString','base64','token','headers','Basic\x20%s','Sequelize','ValidationError','assignee','includes','position','title','system_field_options','custom_field_options'];(function(_0x1e0b23,_0x447f13){var _0x9e049c=function(_0x41f9e3){while(--_0x41f9e3){_0x1e0b23['push'](_0x1e0b23['shift']());}};_0x9e049c(++_0x447f13);}(_0xbfc6,0x104));var _0x6bfc=function(_0x3b1f59,_0x5fb62){_0x3b1f59=_0x3b1f59-0x0;var _0x53f3a4=_0xbfc6[_0x3b1f59];return _0x53f3a4;};'use strict';var pdf=require(_0x6bfc('0x0'));var emlformat=require(_0x6bfc('0x1'));var rimraf=require(_0x6bfc('0x2'));var zipdir=require(_0x6bfc('0x3'));var jsonpatch=require(_0x6bfc('0x4'));var rp=require(_0x6bfc('0x5'));var moment=require(_0x6bfc('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x6bfc('0x7'));var util=require(_0x6bfc('0x8'));var path=require(_0x6bfc('0x9'));var sox=require(_0x6bfc('0xa'));var csv=require(_0x6bfc('0xb'));var ejs=require(_0x6bfc('0xc'));var fs=require('fs');var _=require(_0x6bfc('0xd'));var squel=require(_0x6bfc('0xe'));var crypto=require(_0x6bfc('0xf'));var jsforce=require(_0x6bfc('0x10'));var deskjs=require(_0x6bfc('0x11'));var toCsv=require(_0x6bfc('0xb'));var querystring=require(_0x6bfc('0x12'));var Papa=require(_0x6bfc('0x13'));var Redis=require(_0x6bfc('0x14'));var authService=require(_0x6bfc('0x15'));var qs=require(_0x6bfc('0x16'));var hardwareService=require(_0x6bfc('0x17'));var logger=require(_0x6bfc('0x18'))(_0x6bfc('0x19'));var utils=require(_0x6bfc('0x1a'));var config=require(_0x6bfc('0x1b'));var db=require(_0x6bfc('0x1c'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x6bfc('0x1d'));var client=jayson[_0x6bfc('0x1e')][_0x6bfc('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x305317,_0x322698,_0x3d7d5b){if(_0x3d7d5b){var _0x4b0d35=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4b0d35[_0x6bfc('0x20')](_0x322698)){return _0x305317;}else{throw new Error(_0x6bfc('0x21'));}}else{return _0x305317;}}function respondWithRpcPromise(_0xfdb0b4,_0x4c5b04,_0x2785df,_0x1c0d4b){return new BPromise(function(_0x3dae77,_0xac96e1){var _0x2deb19=_0x1c0d4b||client;return _0x2deb19['request'](_0xfdb0b4,_0x2785df)[_0x6bfc('0x22')](function(_0x4e575f){logger[_0x6bfc('0x23')](_0x6bfc('0x24'),_0x4c5b04,'request\x20sent');logger[_0x6bfc('0x25')](_0x6bfc('0x26'),_0x4c5b04,'request\x20sent',JSON['stringify'](_0x4e575f));if(_0x4e575f['error']){if(_0x4e575f[_0x6bfc('0x27')]['code']===0x1f4){logger[_0x6bfc('0x27')](_0x6bfc('0x24'),_0x4c5b04,_0x4e575f[_0x6bfc('0x27')][_0x6bfc('0x28')]);return _0xac96e1(_0x4e575f[_0x6bfc('0x27')][_0x6bfc('0x28')]);}logger[_0x6bfc('0x27')](_0x6bfc('0x24'),_0x4c5b04,_0x4e575f[_0x6bfc('0x27')][_0x6bfc('0x28')]);return _0x3dae77(_0x4e575f[_0x6bfc('0x27')]['message']);}else{logger[_0x6bfc('0x23')](_0x6bfc('0x24'),_0x4c5b04,_0x6bfc('0x29'));_0x3dae77(_0x4e575f[_0x6bfc('0x2a')][_0x6bfc('0x28')]);}})['catch'](function(_0x22e637){logger['error'](_0x6bfc('0x24'),_0x4c5b04,_0x22e637);_0xac96e1(_0x22e637);});});}function respondWithStatusCode(_0x2b63d4,_0x367c72){_0x367c72=_0x367c72||0xcc;return function(_0x139a63){if(_0x139a63){return _0x2b63d4[_0x6bfc('0x2b')](_0x367c72);}return _0x2b63d4['status'](_0x367c72)[_0x6bfc('0x2c')]();};}function respondWithResult(_0x5df844,_0x2b6f57){_0x2b6f57=_0x2b6f57||0xc8;return function(_0x8aa2b3){if(_0x8aa2b3){return _0x5df844[_0x6bfc('0x2d')](_0x2b6f57)['json'](_0x8aa2b3);}};}function respondWithFilteredResult(_0x316513,_0x3a49ef){return function(_0x2c872c){if(_0x2c872c){var _0x500444=_0x2c872c[_0x6bfc('0x2e')],_0x3e032a=_0x3a49ef[_0x6bfc('0x2f')],_0x1ddf33=_0x3a49ef[_0x6bfc('0x2f')]+_0x3a49ef['limit'],_0x1b5ae8;if(_0x1ddf33>=_0x500444){_0x1ddf33=_0x500444;_0x1b5ae8=0xc8;}else{_0x1b5ae8=0xce;}_0x316513[_0x6bfc('0x2d')](_0x1b5ae8);return _0x316513[_0x6bfc('0x30')]('Content-Range',_0x3e032a+'-'+_0x1ddf33+'/'+_0x500444)[_0x6bfc('0x31')](_0x2c872c);}return null;};}function patchUpdates(_0x624498){return function(_0x172aed){try{jsonpatch[_0x6bfc('0x32')](_0x172aed,_0x624498,!![]);}catch(_0x391ae8){return BPromise['reject'](_0x391ae8);}return _0x172aed[_0x6bfc('0x33')]();};}function saveUpdates(_0x2b4e55,_0x1b4062){return function(_0x175a47){if(_0x175a47){return _0x175a47['update'](_0x2b4e55)[_0x6bfc('0x22')](function(_0x45c777){return _0x45c777;});}return null;};}function removeEntity(_0x3f73de,_0x474cd3){return function(_0x2f3f55){if(_0x2f3f55){return _0x2f3f55[_0x6bfc('0x34')]()[_0x6bfc('0x22')](function(){_0x3f73de[_0x6bfc('0x2d')](0xcc)[_0x6bfc('0x2c')]();});}};}function handleEntityNotFound(_0x4929bf,_0x305da6){return function(_0xf1c5dc){if(!_0xf1c5dc){_0x4929bf[_0x6bfc('0x2b')](0x194);}return _0xf1c5dc;};}function handleError(_0x578106,_0x15fc41){_0x15fc41=_0x15fc41||0x1f4;return function(_0x235681){logger[_0x6bfc('0x27')](_0x235681[_0x6bfc('0x35')]);if(_0x235681[_0x6bfc('0x36')]){delete _0x235681['name'];}_0x578106['status'](_0x15fc41)[_0x6bfc('0x37')](_0x235681);};}exports['index']=function(_0x378855,_0x1cced6){var _0x5962be={},_0x20e483={},_0x3a59fa={'count':0x0,'rows':[]};var _0xdaed9f=db[_0x6bfc('0x38')]['rawAttributes'];_0x20e483['model']=_[_0x6bfc('0x39')](_0xdaed9f);_0x20e483[_0x6bfc('0x3a')]=_['keys'](_0x378855['query']);_0x20e483[_0x6bfc('0x3b')]=_['intersection'](_0x20e483[_0x6bfc('0x3c')],_0x20e483[_0x6bfc('0x3a')]);_0x5962be['attributes']=_[_0x6bfc('0x3d')](_0x20e483[_0x6bfc('0x3c')],qs[_0x6bfc('0x3e')](_0x378855['query'][_0x6bfc('0x3e')]));_0x5962be[_0x6bfc('0x3f')]=_0x5962be[_0x6bfc('0x3f')][_0x6bfc('0x40')]?_0x5962be[_0x6bfc('0x3f')]:_0x20e483[_0x6bfc('0x3c')];if(!_0x378855[_0x6bfc('0x3a')][_0x6bfc('0x41')]('nolimit')){_0x5962be[_0x6bfc('0x42')]=qs[_0x6bfc('0x42')](_0x378855[_0x6bfc('0x3a')][_0x6bfc('0x42')]);_0x5962be[_0x6bfc('0x2f')]=qs[_0x6bfc('0x2f')](_0x378855['query'][_0x6bfc('0x2f')]);}_0x5962be[_0x6bfc('0x43')]=qs[_0x6bfc('0x44')](_0x378855[_0x6bfc('0x3a')]['sort']);_0x5962be[_0x6bfc('0x45')]=qs[_0x6bfc('0x3b')](_[_0x6bfc('0x46')](_0x378855[_0x6bfc('0x3a')],_0x20e483[_0x6bfc('0x3b')]));if(_0x378855[_0x6bfc('0x3a')][_0x6bfc('0x47')]){_0x5962be[_0x6bfc('0x45')]=_[_0x6bfc('0x48')](_0x5962be[_0x6bfc('0x45')],{'$or':_[_0x6bfc('0x49')](_0xdaed9f,function(_0x10dc3b){if(_0x10dc3b['type']['key']!=='VIRTUAL'){var _0x2cd8b4={};_0x2cd8b4[_0x10dc3b[_0x6bfc('0x4a')]]={'$like':'%'+_0x378855[_0x6bfc('0x3a')][_0x6bfc('0x47')]+'%'};return _0x2cd8b4;}})});}_0x5962be=_['merge']({},_0x5962be,_0x378855[_0x6bfc('0x4b')]);var _0x5f0fc5={'where':_0x5962be[_0x6bfc('0x45')]};return db[_0x6bfc('0x38')][_0x6bfc('0x2e')](_0x5f0fc5)[_0x6bfc('0x22')](function(_0x5c6f13){_0x3a59fa[_0x6bfc('0x2e')]=_0x5c6f13;if(_0x378855[_0x6bfc('0x3a')][_0x6bfc('0x4c')]){_0x5962be[_0x6bfc('0x4d')]=[{'all':!![]}];}return db[_0x6bfc('0x38')]['findAll'](_0x5962be);})[_0x6bfc('0x22')](function(_0x26e278){_0x3a59fa[_0x6bfc('0x4e')]=_0x26e278;return _0x3a59fa;})[_0x6bfc('0x22')](respondWithFilteredResult(_0x1cced6,_0x5962be))[_0x6bfc('0x4f')](handleError(_0x1cced6,null));};exports[_0x6bfc('0x50')]=function(_0x5214a0,_0x315e07){var _0x5a41d7={'raw':![],'where':{'id':_0x5214a0[_0x6bfc('0x51')]['id']}},_0xc39faf={};_0xc39faf[_0x6bfc('0x3c')]=_[_0x6bfc('0x39')](db[_0x6bfc('0x38')][_0x6bfc('0x52')]);_0xc39faf[_0x6bfc('0x3a')]=_[_0x6bfc('0x39')](_0x5214a0['query']);_0xc39faf[_0x6bfc('0x3b')]=_[_0x6bfc('0x3d')](_0xc39faf[_0x6bfc('0x3c')],_0xc39faf[_0x6bfc('0x3a')]);_0x5a41d7[_0x6bfc('0x3f')]=_['intersection'](_0xc39faf[_0x6bfc('0x3c')],qs[_0x6bfc('0x3e')](_0x5214a0[_0x6bfc('0x3a')]['fields']));_0x5a41d7[_0x6bfc('0x3f')]=_0x5a41d7[_0x6bfc('0x3f')][_0x6bfc('0x40')]?_0x5a41d7['attributes']:_0xc39faf[_0x6bfc('0x3c')];if(_0x5214a0['query'][_0x6bfc('0x4c')]){_0x5a41d7[_0x6bfc('0x4d')]=[{'all':!![]}];}_0x5a41d7=_[_0x6bfc('0x48')]({},_0x5a41d7,_0x5214a0[_0x6bfc('0x4b')]);return db[_0x6bfc('0x38')]['find'](_0x5a41d7)[_0x6bfc('0x22')](handleEntityNotFound(_0x315e07,null))['then'](respondWithResult(_0x315e07,null))[_0x6bfc('0x4f')](handleError(_0x315e07,null));};exports[_0x6bfc('0x53')]=function(_0x59b33e,_0x2c7f05){return db[_0x6bfc('0x38')][_0x6bfc('0x53')](_0x59b33e['body'],{})['then'](respondWithResult(_0x2c7f05,0xc9))[_0x6bfc('0x4f')](handleError(_0x2c7f05,null));};exports['update']=function(_0x519885,_0x52c5a8){if(_0x519885[_0x6bfc('0x54')]['id']){delete _0x519885['body']['id'];}return db[_0x6bfc('0x38')][_0x6bfc('0x55')]({'where':{'id':_0x519885[_0x6bfc('0x51')]['id']}})['then'](handleEntityNotFound(_0x52c5a8,null))[_0x6bfc('0x22')](saveUpdates(_0x519885[_0x6bfc('0x54')],null))[_0x6bfc('0x22')](respondWithResult(_0x52c5a8,null))[_0x6bfc('0x4f')](handleError(_0x52c5a8,null));};exports[_0x6bfc('0x34')]=function(_0x3fbdf1,_0x574d47){return db[_0x6bfc('0x38')]['find']({'where':{'id':_0x3fbdf1['params']['id']}})[_0x6bfc('0x22')](handleEntityNotFound(_0x574d47,null))['then'](removeEntity(_0x574d47,null))[_0x6bfc('0x4f')](handleError(_0x574d47,null));};exports['getConfigurations']=function(_0x2e6216,_0x2d1b51,_0x12a442){var _0x4128f4={};var _0x1ae515={};var _0x4b16f;var _0x28f148;return db[_0x6bfc('0x38')][_0x6bfc('0x56')]({'where':{'id':_0x2e6216[_0x6bfc('0x51')]['id']}})[_0x6bfc('0x22')](handleEntityNotFound(_0x2d1b51,null))['then'](function(_0x2b13d8){if(_0x2b13d8){_0x4b16f=_0x2b13d8;_0x1ae515['model']=_[_0x6bfc('0x39')](db[_0x6bfc('0x57')][_0x6bfc('0x52')]);_0x1ae515['query']=_['keys'](_0x2e6216[_0x6bfc('0x3a')]);_0x1ae515[_0x6bfc('0x3b')]=_[_0x6bfc('0x3d')](_0x1ae515[_0x6bfc('0x3c')],_0x1ae515[_0x6bfc('0x3a')]);_0x4128f4[_0x6bfc('0x3f')]=_[_0x6bfc('0x3d')](_0x1ae515['model'],qs[_0x6bfc('0x3e')](_0x2e6216[_0x6bfc('0x3a')]['fields']));_0x4128f4[_0x6bfc('0x3f')]=_0x4128f4[_0x6bfc('0x3f')]['length']?_0x4128f4[_0x6bfc('0x3f')]:_0x1ae515['model'];_0x4128f4[_0x6bfc('0x43')]=qs['sort'](_0x2e6216[_0x6bfc('0x3a')][_0x6bfc('0x44')]);_0x4128f4['where']=qs[_0x6bfc('0x3b')](_[_0x6bfc('0x46')](_0x2e6216['query'],_0x1ae515[_0x6bfc('0x3b')]));if(_0x2e6216[_0x6bfc('0x3a')][_0x6bfc('0x47')]){_0x4128f4[_0x6bfc('0x45')]=_['merge'](_0x4128f4['where'],{'$or':_[_0x6bfc('0x49')](_0x4128f4[_0x6bfc('0x3f')],function(_0x236744){var _0x297c87={};_0x297c87[_0x236744]={'$like':'%'+_0x2e6216[_0x6bfc('0x3a')][_0x6bfc('0x47')]+'%'};return _0x297c87;})});}_0x4128f4=_['merge']({},_0x4128f4,_0x2e6216[_0x6bfc('0x4b')]);return _0x4b16f[_0x6bfc('0x58')](_0x4128f4);}})['then'](function(_0x1c5138){if(_0x1c5138){_0x28f148=_0x1c5138['length'];if(!_0x2e6216[_0x6bfc('0x3a')][_0x6bfc('0x41')](_0x6bfc('0x59'))){_0x4128f4['limit']=qs[_0x6bfc('0x42')](_0x2e6216[_0x6bfc('0x3a')][_0x6bfc('0x42')]);_0x4128f4[_0x6bfc('0x2f')]=qs['offset'](_0x2e6216['query'][_0x6bfc('0x2f')]);}return _0x4b16f[_0x6bfc('0x58')](_0x4128f4);}})[_0x6bfc('0x22')](function(_0x482fd8){if(_0x482fd8){return _0x482fd8?{'count':_0x28f148,'rows':_0x482fd8}:null;}})[_0x6bfc('0x22')](respondWithResult(_0x2d1b51,null))[_0x6bfc('0x4f')](handleError(_0x2d1b51,null));};exports[_0x6bfc('0x5a')]=function(_0xa2ddce,_0x582d65,_0x1e9fe1){if(_0xa2ddce[_0x6bfc('0x54')]['id']){delete _0xa2ddce[_0x6bfc('0x54')]['id'];}return db[_0x6bfc('0x38')][_0x6bfc('0x56')]({'where':{'id':_0xa2ddce[_0x6bfc('0x51')]['id']}})[_0x6bfc('0x22')](handleEntityNotFound(_0x582d65,null))[_0x6bfc('0x22')](function(_0x5a31c2){if(_0x5a31c2){_0xa2ddce['body'][_0x6bfc('0x5b')]=_0x5a31c2['id'];_0xa2ddce[_0x6bfc('0x54')]['Subjects']=integrations[_0x6bfc('0x5c')](_0xa2ddce[_0x6bfc('0x54')]['channel'],_0xa2ddce['body'][_0x6bfc('0x5d')]);_0xa2ddce[_0x6bfc('0x54')][_0x6bfc('0x5e')]=integrations[_0x6bfc('0x5f')](_0xa2ddce['body']['channel'],_0xa2ddce[_0x6bfc('0x54')]['type']);return db[_0x6bfc('0x57')][_0x6bfc('0x53')](_0xa2ddce[_0x6bfc('0x54')],{'include':[{'model':db[_0x6bfc('0x60')],'as':_0x6bfc('0x61')},{'model':db['ZendeskField'],'as':_0x6bfc('0x5e')}]});}return null;})['then'](respondWithResult(_0x582d65,null))[_0x6bfc('0x4f')](handleError(_0x582d65,null));};exports[_0x6bfc('0x62')]=function(_0x203d01,_0x259acb,_0x4626a2){var _0x2c8319='';return db['ZendeskAccount'][_0x6bfc('0x56')]({'where':{'id':_0x203d01[_0x6bfc('0x51')]['id']},'attributes':['id',_0x6bfc('0x63'),_0x6bfc('0x64'),'token',_0x6bfc('0x65'),'remoteUri']})[_0x6bfc('0x22')](handleEntityNotFound(_0x259acb,null))[_0x6bfc('0x22')](function(_0xfdcfe0){if(_0xfdcfe0){_0x2c8319=_0xfdcfe0[_0x6bfc('0x66')];var _0x52d589=_0x2c8319[_0x6bfc('0x67')](-0x1);if(_0x52d589==='/'){_0x2c8319=_0x2c8319[_0x6bfc('0x68')](0x0,_0x2c8319[_0x6bfc('0x69')](_0x52d589));}var _0x2eff62={'method':_0x6bfc('0x6a'),'uri':util[_0x6bfc('0x6b')](_0x6bfc('0x6c'),_0x2c8319,_0x6bfc('0x6d')),'json':!![]};switch(_0xfdcfe0[_0x6bfc('0x65')]){case _0x6bfc('0x64'):_0x2eff62['headers']={'Authorization':util[_0x6bfc('0x6b')]('Basic\x20%s',new Buffer(util[_0x6bfc('0x6b')](_0x6bfc('0x6e'),_0xfdcfe0[_0x6bfc('0x63')],_0xfdcfe0['password']))[_0x6bfc('0x6f')](_0x6bfc('0x70')))};break;case _0x6bfc('0x71'):_0x2eff62[_0x6bfc('0x72')]={'Authorization':util[_0x6bfc('0x6b')](_0x6bfc('0x73'),new Buffer(util['format']('%s/token:%s',_0xfdcfe0[_0x6bfc('0x63')],_0xfdcfe0[_0x6bfc('0x71')]))['toString'](_0x6bfc('0x70')))};break;default:throw new db[(_0x6bfc('0x74'))][(_0x6bfc('0x75'))]('Unknown\x20authentication\x20type');}return rp(_0x2eff62);}})[_0x6bfc('0x22')](function(_0x3ad213){if(_0x3ad213){var _0x1569c7=['subject','description','group',_0x6bfc('0x76')];_['remove'](_0x3ad213['ticket_fields'],function(_0x23fe4a){return _0x1569c7[_0x6bfc('0x77')](_0x23fe4a[_0x6bfc('0x5d')]);});return{'count':_0x3ad213[_0x6bfc('0x6d')]['length'],'rows':_[_0x6bfc('0x49')](_0x3ad213[_0x6bfc('0x6d')],function(_0x2039ab){return{'id':_0x2039ab['id'],'name':_0x2039ab[_0x6bfc('0x78')]>0x7?_0x2039ab[_0x6bfc('0x79')]:_0x2039ab[_0x6bfc('0x5d')],'custom':_0x2039ab[_0x6bfc('0x78')]>0x7?!![]:![],'options':_0x2039ab['system_field_options']?_0x2039ab[_0x6bfc('0x7a')]:_0x2039ab[_0x6bfc('0x7b')]?_0x2039ab[_0x6bfc('0x7b')]:[]};})};}})[_0x6bfc('0x22')](respondWithResult(_0x259acb,null))[_0x6bfc('0x4f')](function(_0x14ec6a){var _0x4b25fe=_0x203d01[_0x6bfc('0x3a')][_0x6bfc('0x20')]?0x1f4:_0x14ec6a['statusCode']||0x1f4;logger[_0x6bfc('0x27')](_0x6bfc('0x7c'),'getFields',_0x4b25fe,JSON[_0x6bfc('0x7d')](_0x14ec6a));delete _0x14ec6a['name'];if(_0x4b25fe===0x191){_0x4b25fe=0x190;}_0x259acb['status'](_0x4b25fe)['send'](_0x203d01[_0x6bfc('0x3a')]['test']?{'message':_0x6bfc('0x7e'),'statusCode':_0x14ec6a[_0x6bfc('0x7f')]}:_0x14ec6a);});}; \ No newline at end of file +var _0xaee1=['Subjects','Descriptions','getDescriptions','ZendeskField','getFields','username','password','substring','lastIndexOf','GET','format','%s/%s','authType','headers','Basic\x20%s','toString','base64','token','%s/token:%s','Sequelize','Unknown\x20authentication\x20type','description','group','ticket_fields','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','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','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','count','offset','limit','set','save','update','destroy','end','stack','name','send','index','ZendeskAccount','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','include','rows','show','params','length','find','create','body','findOne','ZendeskConfiguration','getConfigurations','addConfiguration','AccountId'];(function(_0x29e388,_0x3a9ea8){var _0x5c0057=function(_0x4cc8fd){while(--_0x4cc8fd){_0x29e388['push'](_0x29e388['shift']());}};_0x5c0057(++_0x3a9ea8);}(_0xaee1,0x9a));var _0x1aee=function(_0xf3deb9,_0x2ceb29){_0xf3deb9=_0xf3deb9-0x0;var _0x36845f=_0xaee1[_0xf3deb9];return _0x36845f;};'use strict';var pdf=require(_0x1aee('0x0'));var emlformat=require(_0x1aee('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1aee('0x2'));var rp=require(_0x1aee('0x3'));var moment=require(_0x1aee('0x4'));var BPromise=require(_0x1aee('0x5'));var Mustache=require('mustache');var util=require(_0x1aee('0x6'));var path=require('path');var sox=require(_0x1aee('0x7'));var csv=require(_0x1aee('0x8'));var ejs=require(_0x1aee('0x9'));var fs=require('fs');var _=require(_0x1aee('0xa'));var squel=require(_0x1aee('0xb'));var crypto=require(_0x1aee('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1aee('0x8'));var querystring=require(_0x1aee('0xd'));var Papa=require(_0x1aee('0xe'));var Redis=require(_0x1aee('0xf'));var authService=require(_0x1aee('0x10'));var qs=require(_0x1aee('0x11'));var hardwareService=require(_0x1aee('0x12'));var logger=require('../../config/logger')(_0x1aee('0x13'));var utils=require(_0x1aee('0x14'));var config=require('../../config/environment');var db=require(_0x1aee('0x15'))['db'];var integrations=require(_0x1aee('0x16'));var jayson=require('jayson/promise');var client=jayson[_0x1aee('0x17')][_0x1aee('0x18')]({'port':0x232a});function checkPasswordPattern(_0x223be3,_0x5d2f92,_0x17f3da){if(_0x17f3da){var _0x1f7e9a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1f7e9a[_0x1aee('0x19')](_0x5d2f92)){return _0x223be3;}else{throw new Error(_0x1aee('0x1a'));}}else{return _0x223be3;}}function respondWithRpcPromise(_0x410836,_0x5e7af2,_0x4fb8da,_0x4383ab){return new BPromise(function(_0x4d4ec3,_0x3dfff4){var _0xe75015=_0x4383ab||client;return _0xe75015['request'](_0x410836,_0x4fb8da)[_0x1aee('0x1b')](function(_0xe6f7e8){logger[_0x1aee('0x1c')]('ZendeskAccount,\x20%s,\x20%s',_0x5e7af2,_0x1aee('0x1d'));logger[_0x1aee('0x1e')](_0x1aee('0x1f'),_0x5e7af2,'request\x20sent',JSON[_0x1aee('0x20')](_0xe6f7e8));if(_0xe6f7e8[_0x1aee('0x21')]){if(_0xe6f7e8[_0x1aee('0x21')][_0x1aee('0x22')]===0x1f4){logger[_0x1aee('0x21')](_0x1aee('0x23'),_0x5e7af2,_0xe6f7e8[_0x1aee('0x21')][_0x1aee('0x24')]);return _0x3dfff4(_0xe6f7e8[_0x1aee('0x21')][_0x1aee('0x24')]);}logger['error'](_0x1aee('0x23'),_0x5e7af2,_0xe6f7e8[_0x1aee('0x21')][_0x1aee('0x24')]);return _0x4d4ec3(_0xe6f7e8[_0x1aee('0x21')]['message']);}else{logger[_0x1aee('0x1c')](_0x1aee('0x23'),_0x5e7af2,_0x1aee('0x1d'));_0x4d4ec3(_0xe6f7e8[_0x1aee('0x25')][_0x1aee('0x24')]);}})[_0x1aee('0x26')](function(_0xfdb6e7){logger['error'](_0x1aee('0x23'),_0x5e7af2,_0xfdb6e7);_0x3dfff4(_0xfdb6e7);});});}function respondWithStatusCode(_0x548a4d,_0x471e6e){_0x471e6e=_0x471e6e||0xcc;return function(_0x20809a){if(_0x20809a){return _0x548a4d[_0x1aee('0x27')](_0x471e6e);}return _0x548a4d[_0x1aee('0x28')](_0x471e6e)['end']();};}function respondWithResult(_0x4235c8,_0x15dd69){_0x15dd69=_0x15dd69||0xc8;return function(_0x4654be){if(_0x4654be){return _0x4235c8[_0x1aee('0x28')](_0x15dd69)[_0x1aee('0x29')](_0x4654be);}};}function respondWithFilteredResult(_0x41091a,_0x4c3b65){return function(_0x4ff7cd){if(_0x4ff7cd){var _0x364648=_0x4ff7cd[_0x1aee('0x2a')],_0x29135f=_0x4c3b65[_0x1aee('0x2b')],_0x2e7079=_0x4c3b65['offset']+_0x4c3b65[_0x1aee('0x2c')],_0x5052cc;if(_0x2e7079>=_0x364648){_0x2e7079=_0x364648;_0x5052cc=0xc8;}else{_0x5052cc=0xce;}_0x41091a['status'](_0x5052cc);return _0x41091a[_0x1aee('0x2d')]('Content-Range',_0x29135f+'-'+_0x2e7079+'/'+_0x364648)[_0x1aee('0x29')](_0x4ff7cd);}return null;};}function patchUpdates(_0x3aa4fc){return function(_0x1197f3){try{jsonpatch['apply'](_0x1197f3,_0x3aa4fc,!![]);}catch(_0x207db4){return BPromise['reject'](_0x207db4);}return _0x1197f3[_0x1aee('0x2e')]();};}function saveUpdates(_0x5f01f6,_0x382bf2){return function(_0x3d7b0d){if(_0x3d7b0d){return _0x3d7b0d[_0x1aee('0x2f')](_0x5f01f6)[_0x1aee('0x1b')](function(_0x4ee162){return _0x4ee162;});}return null;};}function removeEntity(_0x2e61e0,_0xa1d825){return function(_0xda2092){if(_0xda2092){return _0xda2092[_0x1aee('0x30')]()[_0x1aee('0x1b')](function(){_0x2e61e0['status'](0xcc)[_0x1aee('0x31')]();});}};}function handleEntityNotFound(_0x3a9867,_0xd7ea27){return function(_0x479ee8){if(!_0x479ee8){_0x3a9867[_0x1aee('0x27')](0x194);}return _0x479ee8;};}function handleError(_0x3413f2,_0x4820bd){_0x4820bd=_0x4820bd||0x1f4;return function(_0x2ffcbe){logger[_0x1aee('0x21')](_0x2ffcbe[_0x1aee('0x32')]);if(_0x2ffcbe[_0x1aee('0x33')]){delete _0x2ffcbe[_0x1aee('0x33')];}_0x3413f2[_0x1aee('0x28')](_0x4820bd)[_0x1aee('0x34')](_0x2ffcbe);};}exports[_0x1aee('0x35')]=function(_0x4e5fe1,_0x586404){var _0x298e2b={},_0x11c37c={},_0x134e3a={'count':0x0,'rows':[]};var _0x4f073c=db[_0x1aee('0x36')][_0x1aee('0x37')];_0x11c37c[_0x1aee('0x38')]=_[_0x1aee('0x39')](_0x4f073c);_0x11c37c[_0x1aee('0x3a')]=_['keys'](_0x4e5fe1[_0x1aee('0x3a')]);_0x11c37c[_0x1aee('0x3b')]=_['intersection'](_0x11c37c['model'],_0x11c37c['query']);_0x298e2b[_0x1aee('0x3c')]=_[_0x1aee('0x3d')](_0x11c37c[_0x1aee('0x38')],qs[_0x1aee('0x3e')](_0x4e5fe1[_0x1aee('0x3a')][_0x1aee('0x3e')]));_0x298e2b[_0x1aee('0x3c')]=_0x298e2b['attributes']['length']?_0x298e2b['attributes']:_0x11c37c['model'];if(!_0x4e5fe1[_0x1aee('0x3a')][_0x1aee('0x3f')](_0x1aee('0x40'))){_0x298e2b[_0x1aee('0x2c')]=qs[_0x1aee('0x2c')](_0x4e5fe1['query']['limit']);_0x298e2b[_0x1aee('0x2b')]=qs[_0x1aee('0x2b')](_0x4e5fe1['query']['offset']);}_0x298e2b[_0x1aee('0x41')]=qs[_0x1aee('0x42')](_0x4e5fe1[_0x1aee('0x3a')]['sort']);_0x298e2b[_0x1aee('0x43')]=qs[_0x1aee('0x3b')](_[_0x1aee('0x44')](_0x4e5fe1[_0x1aee('0x3a')],_0x11c37c[_0x1aee('0x3b')]));if(_0x4e5fe1[_0x1aee('0x3a')]['filter']){_0x298e2b[_0x1aee('0x43')]=_[_0x1aee('0x45')](_0x298e2b[_0x1aee('0x43')],{'$or':_[_0x1aee('0x46')](_0x4f073c,function(_0x271b2b){if(_0x271b2b[_0x1aee('0x47')][_0x1aee('0x48')]!==_0x1aee('0x49')){var _0x2316d6={};_0x2316d6[_0x271b2b[_0x1aee('0x4a')]]={'$like':'%'+_0x4e5fe1['query'][_0x1aee('0x4b')]+'%'};return _0x2316d6;}})});}_0x298e2b=_[_0x1aee('0x45')]({},_0x298e2b,_0x4e5fe1[_0x1aee('0x4c')]);var _0x293b20={'where':_0x298e2b[_0x1aee('0x43')]};return db[_0x1aee('0x36')][_0x1aee('0x2a')](_0x293b20)[_0x1aee('0x1b')](function(_0x392a46){_0x134e3a[_0x1aee('0x2a')]=_0x392a46;if(_0x4e5fe1['query']['includeAll']){_0x298e2b[_0x1aee('0x4d')]=[{'all':!![]}];}return db[_0x1aee('0x36')]['findAll'](_0x298e2b);})[_0x1aee('0x1b')](function(_0x536f10){_0x134e3a[_0x1aee('0x4e')]=_0x536f10;return _0x134e3a;})[_0x1aee('0x1b')](respondWithFilteredResult(_0x586404,_0x298e2b))[_0x1aee('0x26')](handleError(_0x586404,null));};exports[_0x1aee('0x4f')]=function(_0x3de6e9,_0x177ab0){var _0x246b0f={'raw':![],'where':{'id':_0x3de6e9[_0x1aee('0x50')]['id']}},_0x45b2c5={};_0x45b2c5[_0x1aee('0x38')]=_['keys'](db[_0x1aee('0x36')][_0x1aee('0x37')]);_0x45b2c5[_0x1aee('0x3a')]=_[_0x1aee('0x39')](_0x3de6e9[_0x1aee('0x3a')]);_0x45b2c5[_0x1aee('0x3b')]=_[_0x1aee('0x3d')](_0x45b2c5[_0x1aee('0x38')],_0x45b2c5[_0x1aee('0x3a')]);_0x246b0f[_0x1aee('0x3c')]=_[_0x1aee('0x3d')](_0x45b2c5[_0x1aee('0x38')],qs[_0x1aee('0x3e')](_0x3de6e9[_0x1aee('0x3a')]['fields']));_0x246b0f['attributes']=_0x246b0f[_0x1aee('0x3c')][_0x1aee('0x51')]?_0x246b0f[_0x1aee('0x3c')]:_0x45b2c5[_0x1aee('0x38')];if(_0x3de6e9[_0x1aee('0x3a')]['includeAll']){_0x246b0f[_0x1aee('0x4d')]=[{'all':!![]}];}_0x246b0f=_[_0x1aee('0x45')]({},_0x246b0f,_0x3de6e9[_0x1aee('0x4c')]);return db['ZendeskAccount'][_0x1aee('0x52')](_0x246b0f)[_0x1aee('0x1b')](handleEntityNotFound(_0x177ab0,null))['then'](respondWithResult(_0x177ab0,null))[_0x1aee('0x26')](handleError(_0x177ab0,null));};exports['create']=function(_0x40f34d,_0x30c6c4){return db['ZendeskAccount'][_0x1aee('0x53')](_0x40f34d[_0x1aee('0x54')],{})[_0x1aee('0x1b')](respondWithResult(_0x30c6c4,0xc9))['catch'](handleError(_0x30c6c4,null));};exports['update']=function(_0x7ada13,_0x107ff5){if(_0x7ada13[_0x1aee('0x54')]['id']){delete _0x7ada13['body']['id'];}return db['ZendeskAccount'][_0x1aee('0x52')]({'where':{'id':_0x7ada13['params']['id']}})[_0x1aee('0x1b')](handleEntityNotFound(_0x107ff5,null))['then'](saveUpdates(_0x7ada13['body'],null))[_0x1aee('0x1b')](respondWithResult(_0x107ff5,null))['catch'](handleError(_0x107ff5,null));};exports[_0x1aee('0x30')]=function(_0x3ae7d9,_0x3b9b60){return db['ZendeskAccount'][_0x1aee('0x52')]({'where':{'id':_0x3ae7d9[_0x1aee('0x50')]['id']}})[_0x1aee('0x1b')](handleEntityNotFound(_0x3b9b60,null))[_0x1aee('0x1b')](removeEntity(_0x3b9b60,null))[_0x1aee('0x26')](handleError(_0x3b9b60,null));};exports['getConfigurations']=function(_0x4f0a73,_0x55da41,_0x172af2){var _0x45ccfd={};var _0x2357e4={};var _0x3643a6;var _0x2be895;return db['ZendeskAccount'][_0x1aee('0x55')]({'where':{'id':_0x4f0a73[_0x1aee('0x50')]['id']}})['then'](handleEntityNotFound(_0x55da41,null))[_0x1aee('0x1b')](function(_0x5c2b05){if(_0x5c2b05){_0x3643a6=_0x5c2b05;_0x2357e4[_0x1aee('0x38')]=_[_0x1aee('0x39')](db[_0x1aee('0x56')]['rawAttributes']);_0x2357e4[_0x1aee('0x3a')]=_[_0x1aee('0x39')](_0x4f0a73[_0x1aee('0x3a')]);_0x2357e4[_0x1aee('0x3b')]=_[_0x1aee('0x3d')](_0x2357e4[_0x1aee('0x38')],_0x2357e4[_0x1aee('0x3a')]);_0x45ccfd['attributes']=_[_0x1aee('0x3d')](_0x2357e4['model'],qs[_0x1aee('0x3e')](_0x4f0a73[_0x1aee('0x3a')][_0x1aee('0x3e')]));_0x45ccfd['attributes']=_0x45ccfd[_0x1aee('0x3c')][_0x1aee('0x51')]?_0x45ccfd[_0x1aee('0x3c')]:_0x2357e4[_0x1aee('0x38')];_0x45ccfd['order']=qs[_0x1aee('0x42')](_0x4f0a73['query'][_0x1aee('0x42')]);_0x45ccfd[_0x1aee('0x43')]=qs[_0x1aee('0x3b')](_[_0x1aee('0x44')](_0x4f0a73[_0x1aee('0x3a')],_0x2357e4[_0x1aee('0x3b')]));if(_0x4f0a73[_0x1aee('0x3a')][_0x1aee('0x4b')]){_0x45ccfd['where']=_['merge'](_0x45ccfd[_0x1aee('0x43')],{'$or':_[_0x1aee('0x46')](_0x45ccfd[_0x1aee('0x3c')],function(_0x14e1bb){var _0x5b4cf2={};_0x5b4cf2[_0x14e1bb]={'$like':'%'+_0x4f0a73['query'][_0x1aee('0x4b')]+'%'};return _0x5b4cf2;})});}_0x45ccfd=_[_0x1aee('0x45')]({},_0x45ccfd,_0x4f0a73['options']);return _0x3643a6['getConfigurations'](_0x45ccfd);}})['then'](function(_0x1f87df){if(_0x1f87df){_0x2be895=_0x1f87df[_0x1aee('0x51')];if(!_0x4f0a73['query'][_0x1aee('0x3f')](_0x1aee('0x40'))){_0x45ccfd[_0x1aee('0x2c')]=qs[_0x1aee('0x2c')](_0x4f0a73['query'][_0x1aee('0x2c')]);_0x45ccfd[_0x1aee('0x2b')]=qs[_0x1aee('0x2b')](_0x4f0a73[_0x1aee('0x3a')][_0x1aee('0x2b')]);}return _0x3643a6[_0x1aee('0x57')](_0x45ccfd);}})[_0x1aee('0x1b')](function(_0x4e6dae){if(_0x4e6dae){return _0x4e6dae?{'count':_0x2be895,'rows':_0x4e6dae}:null;}})[_0x1aee('0x1b')](respondWithResult(_0x55da41,null))[_0x1aee('0x26')](handleError(_0x55da41,null));};exports[_0x1aee('0x58')]=function(_0xa40636,_0x31e037,_0x2bd707){if(_0xa40636['body']['id']){delete _0xa40636[_0x1aee('0x54')]['id'];}return db[_0x1aee('0x36')][_0x1aee('0x55')]({'where':{'id':_0xa40636[_0x1aee('0x50')]['id']}})[_0x1aee('0x1b')](handleEntityNotFound(_0x31e037,null))[_0x1aee('0x1b')](function(_0x501cea){if(_0x501cea){_0xa40636['body'][_0x1aee('0x59')]=_0x501cea['id'];_0xa40636[_0x1aee('0x54')][_0x1aee('0x5a')]=integrations['getSubjects'](_0xa40636[_0x1aee('0x54')]['channel'],_0xa40636['body'][_0x1aee('0x47')]);_0xa40636[_0x1aee('0x54')][_0x1aee('0x5b')]=integrations[_0x1aee('0x5c')](_0xa40636['body']['channel'],_0xa40636[_0x1aee('0x54')][_0x1aee('0x47')]);return db[_0x1aee('0x56')][_0x1aee('0x53')](_0xa40636[_0x1aee('0x54')],{'include':[{'model':db[_0x1aee('0x5d')],'as':_0x1aee('0x5a')},{'model':db[_0x1aee('0x5d')],'as':'Descriptions'}]});}return null;})[_0x1aee('0x1b')](respondWithResult(_0x31e037,null))[_0x1aee('0x26')](handleError(_0x31e037,null));};exports[_0x1aee('0x5e')]=function(_0x291be1,_0x452a9c,_0x3ba9be){var _0x462ed9='';return db[_0x1aee('0x36')][_0x1aee('0x55')]({'where':{'id':_0x291be1[_0x1aee('0x50')]['id']},'attributes':['id',_0x1aee('0x5f'),_0x1aee('0x60'),'token','authType','remoteUri']})[_0x1aee('0x1b')](handleEntityNotFound(_0x452a9c,null))[_0x1aee('0x1b')](function(_0xebe3ac){if(_0xebe3ac){_0x462ed9=_0xebe3ac['remoteUri'];var _0x3a63a2=_0x462ed9['slice'](-0x1);if(_0x3a63a2==='/'){_0x462ed9=_0x462ed9[_0x1aee('0x61')](0x0,_0x462ed9[_0x1aee('0x62')](_0x3a63a2));}var _0xf9111f={'method':_0x1aee('0x63'),'uri':util[_0x1aee('0x64')](_0x1aee('0x65'),_0x462ed9,'ticket_fields'),'json':!![]};switch(_0xebe3ac[_0x1aee('0x66')]){case _0x1aee('0x60'):_0xf9111f[_0x1aee('0x67')]={'Authorization':util[_0x1aee('0x64')](_0x1aee('0x68'),new Buffer(util[_0x1aee('0x64')]('%s:%s',_0xebe3ac[_0x1aee('0x5f')],_0xebe3ac[_0x1aee('0x60')]))[_0x1aee('0x69')](_0x1aee('0x6a')))};break;case _0x1aee('0x6b'):_0xf9111f[_0x1aee('0x67')]={'Authorization':util['format'](_0x1aee('0x68'),new Buffer(util[_0x1aee('0x64')](_0x1aee('0x6c'),_0xebe3ac[_0x1aee('0x5f')],_0xebe3ac[_0x1aee('0x6b')]))[_0x1aee('0x69')](_0x1aee('0x6a')))};break;default:throw new db[(_0x1aee('0x6d'))]['ValidationError'](_0x1aee('0x6e'));}return rp(_0xf9111f);}})[_0x1aee('0x1b')](function(_0x42aa87){if(_0x42aa87){var _0x234389=['subject',_0x1aee('0x6f'),_0x1aee('0x70'),'assignee'];_['remove'](_0x42aa87[_0x1aee('0x71')],function(_0x214172){return _0x234389[_0x1aee('0x72')](_0x214172[_0x1aee('0x47')]);});return{'count':_0x42aa87[_0x1aee('0x71')][_0x1aee('0x51')],'rows':_[_0x1aee('0x46')](_0x42aa87['ticket_fields'],function(_0x1e4f46){return{'id':_0x1e4f46['id'],'name':_0x1e4f46[_0x1aee('0x73')]>0x7?_0x1e4f46[_0x1aee('0x74')]:_0x1e4f46[_0x1aee('0x47')],'custom':_0x1e4f46['position']>0x7?!![]:![],'options':_0x1e4f46[_0x1aee('0x75')]?_0x1e4f46['system_field_options']:_0x1e4f46[_0x1aee('0x76')]?_0x1e4f46[_0x1aee('0x76')]:[]};})};}})[_0x1aee('0x1b')](respondWithResult(_0x452a9c,null))['catch'](function(_0x1cd290){var _0x1408bf=_0x291be1[_0x1aee('0x3a')][_0x1aee('0x19')]?0x1f4:_0x1cd290[_0x1aee('0x77')]||0x1f4;logger[_0x1aee('0x21')](_0x1aee('0x78'),_0x1aee('0x5e'),_0x1408bf,JSON[_0x1aee('0x20')](_0x1cd290));delete _0x1cd290['name'];if(_0x1408bf===0x191){_0x1408bf=0x190;}_0x452a9c[_0x1aee('0x28')](_0x1408bf)[_0x1aee('0x34')](_0x291be1['query'][_0x1aee('0x19')]?{'message':_0x1aee('0x79'),'statusCode':_0x1cd290[_0x1aee('0x77')]}:_0x1cd290);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 97d0287..c73182d 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 _0xf03d=['path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','ZendeskAccount','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0xc9f49b,_0x156c0c){var _0x389ca4=function(_0x9c4c34){while(--_0x9c4c34){_0xc9f49b['push'](_0xc9f49b['shift']());}};_0x389ca4(++_0x156c0c);}(_0xf03d,0x1a7));var _0xdf03=function(_0xb96e0f,_0x2cc42e){_0xb96e0f=_0xb96e0f-0x0;var _0x293b9e=_0xf03d[_0xb96e0f];return _0x293b9e;};'use strict';var _=require(_0xdf03('0x0'));var util=require(_0xdf03('0x1'));var logger=require(_0xdf03('0x2'))('api');var moment=require(_0xdf03('0x3'));var BPromise=require(_0xdf03('0x4'));var rp=require(_0xdf03('0x5'));var fs=require('fs');var path=require(_0xdf03('0x6'));var rimraf=require(_0xdf03('0x7'));var config=require(_0xdf03('0x8'));var attributes=require(_0xdf03('0x9'));var integrations=require(_0xdf03('0xa'));module[_0xdf03('0xb')]=function(_0x4a4a97,_0xe47081){return _0x4a4a97['define'](_0xdf03('0xc'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f44=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','define','lodash','util'];(function(_0x3faa54,_0x47d437){var _0x5c703c=function(_0x5c7353){while(--_0x5c7353){_0x3faa54['push'](_0x3faa54['shift']());}};_0x5c703c(++_0x47d437);}(_0x6f44,0x1ea));var _0x46f4=function(_0x15c160,_0x1aa4d3){_0x15c160=_0x15c160-0x0;var _0x1a7be7=_0x6f44[_0x15c160];return _0x1a7be7;};'use strict';var _=require(_0x46f4('0x0'));var util=require(_0x46f4('0x1'));var logger=require('../../config/logger')(_0x46f4('0x2'));var moment=require(_0x46f4('0x3'));var BPromise=require(_0x46f4('0x4'));var rp=require(_0x46f4('0x5'));var fs=require('fs');var path=require(_0x46f4('0x6'));var rimraf=require(_0x46f4('0x7'));var config=require(_0x46f4('0x8'));var attributes=require(_0x46f4('0x9'));var integrations=require(_0x46f4('0xa'));module['exports']=function(_0x169a5a,_0x2a50b1){return _0x169a5a[_0x46f4('0xb')]('ZendeskAccount',attributes,{'tableName':'int_zendesk_accounts','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 f77e137..dcfbede 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 _0xdf10=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','ZendeskAccount','findAll','options','raw','where','attributes','include','map','model','GetZendeskAccount','debug','catch','ShowZendeskAccount','find'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xdf10,0x8c));var _0x0df1=function(_0x2d90b2,_0x42d6d7){_0x2d90b2=_0x2d90b2-0x0;var _0x4f928c=_0xdf10[_0x2d90b2];return _0x4f928c;};'use strict';var _=require(_0x0df1('0x0'));var util=require(_0x0df1('0x1'));var moment=require(_0x0df1('0x2'));var BPromise=require(_0x0df1('0x3'));var rs=require(_0x0df1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0df1('0x5'))['db'];var utils=require(_0x0df1('0x6'));var logger=require(_0x0df1('0x7'))(_0x0df1('0x8'));var config=require(_0x0df1('0x9'));var jayson=require(_0x0df1('0xa'));var client=jayson[_0x0df1('0xb')][_0x0df1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x175d1e,_0x4c8a2d,_0x5ad5e6){return new BPromise(function(_0x41bb76,_0x1c1bc4){return client[_0x0df1('0xd')](_0x175d1e,_0x5ad5e6)[_0x0df1('0xe')](function(_0x1b962f){logger[_0x0df1('0xf')](_0x0df1('0x10'),_0x4c8a2d,_0x0df1('0x11'));logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x4c8a2d,_0x0df1('0x11'),JSON[_0x0df1('0x12')](_0x1b962f));if(_0x1b962f['error']){if(_0x1b962f[_0x0df1('0x13')]['code']===0x1f4){logger['error'](_0x0df1('0x10'),_0x4c8a2d,_0x1b962f[_0x0df1('0x13')][_0x0df1('0x14')]);return _0x1c1bc4(_0x1b962f[_0x0df1('0x13')][_0x0df1('0x14')]);}logger['error'](_0x0df1('0x10'),_0x4c8a2d,_0x1b962f[_0x0df1('0x13')][_0x0df1('0x14')]);return _0x41bb76(_0x1b962f[_0x0df1('0x13')]['message']);}else{logger['info'](_0x0df1('0x10'),_0x4c8a2d,_0x0df1('0x11'));_0x41bb76(_0x1b962f['result'][_0x0df1('0x14')]);}})['catch'](function(_0xdc93de){logger[_0x0df1('0x13')](_0x0df1('0x10'),_0x4c8a2d,_0xdc93de);_0x1c1bc4(_0xdc93de);});});}exports['GetZendeskAccount']=function(_0x136f14){var _0x46a0ee=this;return new Promise(function(_0x19c78e,_0x491cb8){return db[_0x0df1('0x15')][_0x0df1('0x16')]({'raw':_0x136f14[_0x0df1('0x17')]?_0x136f14[_0x0df1('0x17')][_0x0df1('0x18')]===undefined?!![]:![]:!![],'where':_0x136f14[_0x0df1('0x17')]?_0x136f14['options'][_0x0df1('0x19')]||null:null,'attributes':_0x136f14[_0x0df1('0x17')]?_0x136f14[_0x0df1('0x17')][_0x0df1('0x1a')]||null:null,'limit':_0x136f14[_0x0df1('0x17')]?_0x136f14[_0x0df1('0x17')]['limit']||null:null,'include':_0x136f14['options']?_0x136f14['options'][_0x0df1('0x1b')]?_[_0x0df1('0x1c')](_0x136f14[_0x0df1('0x17')][_0x0df1('0x1b')],function(_0x457f74){return{'model':db[_0x457f74[_0x0df1('0x1d')]],'as':_0x457f74['as'],'attributes':_0x457f74[_0x0df1('0x1a')],'include':_0x457f74[_0x0df1('0x1b')]?_['map'](_0x457f74[_0x0df1('0x1b')],function(_0x387ac9){return{'model':db[_0x387ac9[_0x0df1('0x1d')]],'as':_0x387ac9['as'],'attributes':_0x387ac9[_0x0df1('0x1a')],'include':_0x387ac9[_0x0df1('0x1b')]?_['map'](_0x387ac9['include'],function(_0x20317d){return{'model':db[_0x20317d[_0x0df1('0x1d')]],'as':_0x20317d['as'],'attributes':_0x20317d[_0x0df1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0df1('0xe')](function(_0x8f6448){logger[_0x0df1('0xf')](_0x0df1('0x1e'),_0x136f14);logger[_0x0df1('0x1f')](_0x0df1('0x1e'),_0x136f14,JSON[_0x0df1('0x12')](_0x8f6448));_0x19c78e(_0x8f6448);})[_0x0df1('0x20')](function(_0x3d1e37){logger[_0x0df1('0x13')](_0x0df1('0x1e'),_0x3d1e37[_0x0df1('0x14')],_0x136f14);_0x491cb8(_0x46a0ee[_0x0df1('0x13')](0x1f4,_0x3d1e37[_0x0df1('0x14')]));});});};exports[_0x0df1('0x21')]=function(_0x133e5a){var _0x333a49=this;return new Promise(function(_0x35d22e,_0x6176d6){return db['ZendeskAccount'][_0x0df1('0x22')]({'raw':_0x133e5a['options']?_0x133e5a[_0x0df1('0x17')][_0x0df1('0x18')]===undefined?!![]:![]:!![],'where':_0x133e5a['options']?_0x133e5a['options'][_0x0df1('0x19')]||null:null,'attributes':_0x133e5a[_0x0df1('0x17')]?_0x133e5a[_0x0df1('0x17')]['attributes']||null:null,'include':_0x133e5a[_0x0df1('0x17')]?_0x133e5a[_0x0df1('0x17')][_0x0df1('0x1b')]?_[_0x0df1('0x1c')](_0x133e5a[_0x0df1('0x17')][_0x0df1('0x1b')],function(_0x547816){return{'model':db[_0x547816[_0x0df1('0x1d')]],'as':_0x547816['as'],'attributes':_0x547816['attributes'],'include':_0x547816[_0x0df1('0x1b')]?_[_0x0df1('0x1c')](_0x547816[_0x0df1('0x1b')],function(_0x41e739){return{'model':db[_0x41e739[_0x0df1('0x1d')]],'as':_0x41e739['as'],'attributes':_0x41e739[_0x0df1('0x1a')],'include':_0x41e739['include']?_['map'](_0x41e739['include'],function(_0x283167){return{'model':db[_0x283167['model']],'as':_0x283167['as'],'attributes':_0x283167[_0x0df1('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x383423){logger['info'](_0x0df1('0x21'),_0x133e5a);logger[_0x0df1('0x1f')]('ShowZendeskAccount',_0x133e5a,JSON['stringify'](_0x383423));_0x35d22e(_0x383423);})['catch'](function(_0x1be361){logger[_0x0df1('0x13')](_0x0df1('0x21'),_0x1be361[_0x0df1('0x14')],_0x133e5a);_0x6176d6(_0x333a49[_0x0df1('0x13')](0x1f4,_0x1be361[_0x0df1('0x14')]));});});}; \ No newline at end of file +var _0xbe41=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','limit','include','map','attributes','model','debug','ShowZendeskAccount','find','then','lodash','util','moment'];(function(_0x54d980,_0x835a70){var _0x519567=function(_0x19d030){while(--_0x19d030){_0x54d980['push'](_0x54d980['shift']());}};_0x519567(++_0x835a70);}(_0xbe41,0x1b9));var _0x1be4=function(_0x111522,_0x4ae79f){_0x111522=_0x111522-0x0;var _0x1423d5=_0xbe41[_0x111522];return _0x1423d5;};'use strict';var _=require(_0x1be4('0x0'));var util=require(_0x1be4('0x1'));var moment=require(_0x1be4('0x2'));var BPromise=require(_0x1be4('0x3'));var rs=require(_0x1be4('0x4'));var fs=require('fs');var Redis=require(_0x1be4('0x5'));var db=require(_0x1be4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1be4('0x7'))(_0x1be4('0x8'));var config=require(_0x1be4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1be4('0xa')][_0x1be4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x313492,_0x118bef,_0x3c4573){return new BPromise(function(_0x5daf08,_0x4feda0){return client['request'](_0x313492,_0x3c4573)['then'](function(_0x2dfd84){logger[_0x1be4('0xc')](_0x1be4('0xd'),_0x118bef,_0x1be4('0xe'));logger['debug'](_0x1be4('0xf'),_0x118bef,_0x1be4('0xe'),JSON[_0x1be4('0x10')](_0x2dfd84));if(_0x2dfd84[_0x1be4('0x11')]){if(_0x2dfd84[_0x1be4('0x11')][_0x1be4('0x12')]===0x1f4){logger[_0x1be4('0x11')](_0x1be4('0xd'),_0x118bef,_0x2dfd84[_0x1be4('0x11')][_0x1be4('0x13')]);return _0x4feda0(_0x2dfd84[_0x1be4('0x11')]['message']);}logger['error'](_0x1be4('0xd'),_0x118bef,_0x2dfd84[_0x1be4('0x11')][_0x1be4('0x13')]);return _0x5daf08(_0x2dfd84[_0x1be4('0x11')][_0x1be4('0x13')]);}else{logger[_0x1be4('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x118bef,_0x1be4('0xe'));_0x5daf08(_0x2dfd84[_0x1be4('0x14')]['message']);}})[_0x1be4('0x15')](function(_0x4d650c){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x118bef,_0x4d650c);_0x4feda0(_0x4d650c);});});}exports[_0x1be4('0x16')]=function(_0x150571){var _0x552b0f=this;return new Promise(function(_0xbf9372,_0xab5dec){return db[_0x1be4('0x17')][_0x1be4('0x18')]({'raw':_0x150571[_0x1be4('0x19')]?_0x150571[_0x1be4('0x19')][_0x1be4('0x1a')]===undefined?!![]:![]:!![],'where':_0x150571[_0x1be4('0x19')]?_0x150571[_0x1be4('0x19')][_0x1be4('0x1b')]||null:null,'attributes':_0x150571[_0x1be4('0x19')]?_0x150571[_0x1be4('0x19')]['attributes']||null:null,'limit':_0x150571[_0x1be4('0x19')]?_0x150571[_0x1be4('0x19')][_0x1be4('0x1c')]||null:null,'include':_0x150571['options']?_0x150571[_0x1be4('0x19')][_0x1be4('0x1d')]?_[_0x1be4('0x1e')](_0x150571['options'][_0x1be4('0x1d')],function(_0x34cbba){return{'model':db[_0x34cbba['model']],'as':_0x34cbba['as'],'attributes':_0x34cbba[_0x1be4('0x1f')],'include':_0x34cbba[_0x1be4('0x1d')]?_[_0x1be4('0x1e')](_0x34cbba[_0x1be4('0x1d')],function(_0x2c7a19){return{'model':db[_0x2c7a19[_0x1be4('0x20')]],'as':_0x2c7a19['as'],'attributes':_0x2c7a19[_0x1be4('0x1f')],'include':_0x2c7a19[_0x1be4('0x1d')]?_['map'](_0x2c7a19[_0x1be4('0x1d')],function(_0x4577a2){return{'model':db[_0x4577a2[_0x1be4('0x20')]],'as':_0x4577a2['as'],'attributes':_0x4577a2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a798a){logger[_0x1be4('0xc')]('GetZendeskAccount',_0x150571);logger[_0x1be4('0x21')](_0x1be4('0x16'),_0x150571,JSON[_0x1be4('0x10')](_0x3a798a));_0xbf9372(_0x3a798a);})[_0x1be4('0x15')](function(_0x302003){logger[_0x1be4('0x11')](_0x1be4('0x16'),_0x302003['message'],_0x150571);_0xab5dec(_0x552b0f[_0x1be4('0x11')](0x1f4,_0x302003[_0x1be4('0x13')]));});});};exports[_0x1be4('0x22')]=function(_0x2bbfd7){var _0x57fd6f=this;return new Promise(function(_0x26f392,_0x426c18){return db[_0x1be4('0x17')][_0x1be4('0x23')]({'raw':_0x2bbfd7[_0x1be4('0x19')]?_0x2bbfd7[_0x1be4('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2bbfd7[_0x1be4('0x19')]?_0x2bbfd7[_0x1be4('0x19')][_0x1be4('0x1b')]||null:null,'attributes':_0x2bbfd7[_0x1be4('0x19')]?_0x2bbfd7[_0x1be4('0x19')][_0x1be4('0x1f')]||null:null,'include':_0x2bbfd7['options']?_0x2bbfd7[_0x1be4('0x19')][_0x1be4('0x1d')]?_[_0x1be4('0x1e')](_0x2bbfd7[_0x1be4('0x19')]['include'],function(_0x59945a){return{'model':db[_0x59945a[_0x1be4('0x20')]],'as':_0x59945a['as'],'attributes':_0x59945a[_0x1be4('0x1f')],'include':_0x59945a[_0x1be4('0x1d')]?_[_0x1be4('0x1e')](_0x59945a[_0x1be4('0x1d')],function(_0x3c96cc){return{'model':db[_0x3c96cc[_0x1be4('0x20')]],'as':_0x3c96cc['as'],'attributes':_0x3c96cc[_0x1be4('0x1f')],'include':_0x3c96cc[_0x1be4('0x1d')]?_[_0x1be4('0x1e')](_0x3c96cc[_0x1be4('0x1d')],function(_0x219cfe){return{'model':db[_0x219cfe[_0x1be4('0x20')]],'as':_0x219cfe['as'],'attributes':_0x219cfe[_0x1be4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1be4('0x24')](function(_0x2926c5){logger[_0x1be4('0xc')](_0x1be4('0x22'),_0x2bbfd7);logger['debug'](_0x1be4('0x22'),_0x2bbfd7,JSON[_0x1be4('0x10')](_0x2926c5));_0x26f392(_0x2926c5);})[_0x1be4('0x15')](function(_0x1be7c8){logger[_0x1be4('0x11')](_0x1be4('0x22'),_0x1be7c8['message'],_0x2bbfd7);_0x426c18(_0x57fd6f['error'](0x1f4,_0x1be7c8[_0x1be4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 45738ac..5e2b1ec 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 _0x05cc=['/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','destroy','exports','multer','util','express','Router','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index'];(function(_0x4f3ef2,_0x445930){var _0x2dcfd5=function(_0x2a254a){while(--_0x2a254a){_0x4f3ef2['push'](_0x4f3ef2['shift']());}};_0x2dcfd5(++_0x445930);}(_0x05cc,0xb7));var _0xc05c=function(_0x393b3c,_0x56aa1b){_0x393b3c=_0x393b3c-0x0;var _0x10172a=_0x05cc[_0x393b3c];return _0x10172a;};'use strict';var multer=require(_0xc05c('0x0'));var util=require(_0xc05c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc05c('0x2'));var router=express[_0xc05c('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc05c('0x4'));var controller=require(_0xc05c('0x5'));router[_0xc05c('0x6')]('/',auth[_0xc05c('0x7')](),controller[_0xc05c('0x8')]);router[_0xc05c('0x6')](_0xc05c('0x9'),auth[_0xc05c('0x7')](),controller['show']);router[_0xc05c('0x6')]('/:id/fields',auth[_0xc05c('0x7')](),controller[_0xc05c('0xa')]);router[_0xc05c('0x6')](_0xc05c('0xb'),auth[_0xc05c('0x7')](),controller[_0xc05c('0xc')]);router[_0xc05c('0x6')](_0xc05c('0xd'),auth[_0xc05c('0x7')](),controller[_0xc05c('0xe')]);router[_0xc05c('0x6')](_0xc05c('0xf'),auth[_0xc05c('0x7')](),controller[_0xc05c('0x10')]);router[_0xc05c('0x11')]('/',auth[_0xc05c('0x7')](),controller[_0xc05c('0x12')]);router['post'](_0xc05c('0xf'),auth[_0xc05c('0x7')](),controller[_0xc05c('0x13')]);router[_0xc05c('0x14')]('/:id',auth[_0xc05c('0x7')](),controller[_0xc05c('0x15')]);router['delete'](_0xc05c('0x9'),auth['isAuthenticated'](),controller[_0xc05c('0x16')]);module[_0xc05c('0x17')]=router; \ No newline at end of file +var _0x1948=['./intZendeskConfiguration.controller','index','/:id','isAuthenticated','show','get','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','post','setTags','put','update','delete','destroy','exports','multer','path','express','../../components/auth/service'];(function(_0x35294d,_0x328948){var _0x526b2f=function(_0x19164a){while(--_0x19164a){_0x35294d['push'](_0x35294d['shift']());}};_0x526b2f(++_0x328948);}(_0x1948,0x1b4));var _0x8194=function(_0x14ccd6,_0x7aad54){_0x14ccd6=_0x14ccd6-0x0;var _0x3d0e69=_0x1948[_0x14ccd6];return _0x3d0e69;};'use strict';var multer=require(_0x8194('0x0'));var util=require('util');var path=require(_0x8194('0x1'));var timeout=require('connect-timeout');var express=require(_0x8194('0x2'));var router=express['Router']();var auth=require(_0x8194('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8194('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x8194('0x5')]);router['get'](_0x8194('0x6'),auth[_0x8194('0x7')](),controller[_0x8194('0x8')]);router[_0x8194('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x8194('0xa')]);router[_0x8194('0x9')](_0x8194('0xb'),auth[_0x8194('0x7')](),controller[_0x8194('0xc')]);router[_0x8194('0x9')]('/:id/descriptions',auth[_0x8194('0x7')](),controller['getDescriptions']);router[_0x8194('0x9')](_0x8194('0xd'),auth[_0x8194('0x7')](),controller[_0x8194('0xe')]);router['post']('/',auth[_0x8194('0x7')](),controller['create']);router[_0x8194('0xf')](_0x8194('0xd'),auth['isAuthenticated'](),controller[_0x8194('0x10')]);router[_0x8194('0x11')]('/:id',auth[_0x8194('0x7')](),controller[_0x8194('0x12')]);router[_0x8194('0x13')]('/:id',auth[_0x8194('0x7')](),controller[_0x8194('0x14')]);module[_0x8194('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 633beb0..289ddd1 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 _0x3038=['exports','STRING','sequelize'];(function(_0x5246f5,_0x493816){var _0x2e64c0=function(_0x498353){while(--_0x498353){_0x5246f5['push'](_0x5246f5['shift']());}};_0x2e64c0(++_0x493816);}(_0x3038,0x125));var _0x8303=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x3038[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require(_0x8303('0x0'));module[_0x8303('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8303('0x2')]}}; \ No newline at end of file +var _0x6e17=['STRING'];(function(_0x2ff238,_0x1811d2){var _0x204a56=function(_0x5bf2e1){while(--_0x5bf2e1){_0x2ff238['push'](_0x2ff238['shift']());}};_0x204a56(++_0x1811d2);}(_0x6e17,0x8f));var _0x76e1=function(_0x5a4c73,_0x1fb644){_0x5a4c73=_0x5a4c73-0x0;var _0x4f6f42=_0x6e17[_0x5a4c73];return _0x4f6f42;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x76e1('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 4f7c0ed..5be4a42 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 _0xa9e0=['length','find','create','catch','body','params','findOne','ZendeskField','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','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','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','update','then','destroy','end','stack','name','index','ZendeskConfiguration','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'];(function(_0x534f59,_0x415730){var _0x176626=function(_0xac7036){while(--_0xac7036){_0x534f59['push'](_0x534f59['shift']());}};_0x176626(++_0x415730);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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')]('ZendeskConfiguration,\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['create']=function(_0x53975a,_0x39d77d){return db[_0x0a9e('0x32')][_0x0a9e('0x4f')](_0x53975a['body'],{})[_0x0a9e('0x2c')](respondWithResult(_0x39d77d,0xc9))[_0x0a9e('0x50')](handleError(_0x39d77d,null));};exports['update']=function(_0x5a88da,_0x2ef381){if(_0x5a88da['body']['id']){delete _0x5a88da[_0x0a9e('0x51')]['id'];}return db['ZendeskConfiguration'][_0x0a9e('0x4e')]({'where':{'id':_0x5a88da[_0x0a9e('0x52')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x2ef381,null))['then'](saveUpdates(_0x5a88da[_0x0a9e('0x51')],null))[_0x0a9e('0x2c')](respondWithResult(_0x2ef381,null))['catch'](handleError(_0x2ef381,null));};exports['destroy']=function(_0x128aa6,_0x3aedd0){return db['ZendeskConfiguration'][_0x0a9e('0x4e')]({'where':{'id':_0x128aa6['params']['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x3aedd0,null))['then'](removeEntity(_0x3aedd0,null))[_0x0a9e('0x50')](handleError(_0x3aedd0,null));};exports['getFields']=function(_0x5da27d,_0x5df0ad,_0x2da03c){var _0x47de4c={};var _0x2f7092={};var _0x65432;var _0x3cfd00;return db[_0x0a9e('0x32')][_0x0a9e('0x53')]({'where':{'id':_0x5da27d[_0x0a9e('0x52')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x5df0ad,null))[_0x0a9e('0x2c')](function(_0x4e67ab){if(_0x4e67ab){_0x65432=_0x4e67ab;_0x2f7092[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x54')][_0x0a9e('0x33')]);_0x2f7092[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x5da27d['query']);_0x2f7092[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2f7092['model'],_0x2f7092[_0x0a9e('0x34')]);_0x47de4c['attributes']=_[_0x0a9e('0x36')](_0x2f7092['model'],qs['fields'](_0x5da27d['query'][_0x0a9e('0x39')]));_0x47de4c['attributes']=_0x47de4c[_0x0a9e('0x38')][_0x0a9e('0x4d')]?_0x47de4c[_0x0a9e('0x38')]:_0x2f7092[_0x0a9e('0x37')];_0x47de4c[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x5da27d['query'][_0x0a9e('0x3d')]);_0x47de4c['where']=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3f')](_0x5da27d[_0x0a9e('0x34')],_0x2f7092['filters']));if(_0x5da27d[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x47de4c[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x47de4c['where'],{'$or':_[_0x0a9e('0x42')](_0x47de4c[_0x0a9e('0x38')],function(_0x54327c){var _0x797b45={};_0x797b45[_0x54327c]={'$like':'%'+_0x5da27d[_0x0a9e('0x34')][_0x0a9e('0x40')]+'%'};return _0x797b45;})});}_0x47de4c=_[_0x0a9e('0x41')]({},_0x47de4c,_0x5da27d[_0x0a9e('0x46')]);return _0x65432['getFields'](_0x47de4c);}})[_0x0a9e('0x2c')](function(_0x2937e0){if(_0x2937e0){_0x3cfd00=_0x2937e0[_0x0a9e('0x4d')];if(!_0x5da27d['query'][_0x0a9e('0x3a')]('nolimit')){_0x47de4c['limit']=qs[_0x0a9e('0x26')](_0x5da27d[_0x0a9e('0x34')][_0x0a9e('0x26')]);_0x47de4c[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x5da27d[_0x0a9e('0x34')][_0x0a9e('0x25')]);}return _0x65432[_0x0a9e('0x55')](_0x47de4c);}})[_0x0a9e('0x2c')](function(_0x1cc4f3){if(_0x1cc4f3){return _0x1cc4f3?{'count':_0x3cfd00,'rows':_0x1cc4f3}:null;}})[_0x0a9e('0x2c')](respondWithResult(_0x5df0ad,null))[_0x0a9e('0x50')](handleError(_0x5df0ad,null));};exports[_0x0a9e('0x56')]=function(_0x2b8192,_0x320898,_0x412a72){var _0x2a28c0={};var _0x4257c9={};var _0x5150a4;var _0x1b0b98;return db[_0x0a9e('0x32')][_0x0a9e('0x53')]({'where':{'id':_0x2b8192['params']['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x320898,null))[_0x0a9e('0x2c')](function(_0x4b341d){if(_0x4b341d){_0x5150a4=_0x4b341d;_0x4257c9[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x54')][_0x0a9e('0x33')]);_0x4257c9[_0x0a9e('0x34')]=_['keys'](_0x2b8192['query']);_0x4257c9['filters']=_[_0x0a9e('0x36')](_0x4257c9[_0x0a9e('0x37')],_0x4257c9[_0x0a9e('0x34')]);_0x2a28c0[_0x0a9e('0x38')]=_[_0x0a9e('0x36')](_0x4257c9[_0x0a9e('0x37')],qs[_0x0a9e('0x39')](_0x2b8192[_0x0a9e('0x34')]['fields']));_0x2a28c0[_0x0a9e('0x38')]=_0x2a28c0[_0x0a9e('0x38')][_0x0a9e('0x4d')]?_0x2a28c0['attributes']:_0x4257c9[_0x0a9e('0x37')];_0x2a28c0['order']=qs[_0x0a9e('0x3d')](_0x2b8192[_0x0a9e('0x34')]['sort']);_0x2a28c0[_0x0a9e('0x3e')]=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3f')](_0x2b8192[_0x0a9e('0x34')],_0x4257c9['filters']));if(_0x2b8192[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x2a28c0[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x2a28c0['where'],{'$or':_[_0x0a9e('0x42')](_0x2a28c0[_0x0a9e('0x38')],function(_0x2d5506){var _0x361b21={};_0x361b21[_0x2d5506]={'$like':'%'+_0x2b8192['query'][_0x0a9e('0x40')]+'%'};return _0x361b21;})});}_0x2a28c0=_[_0x0a9e('0x41')]({},_0x2a28c0,_0x2b8192[_0x0a9e('0x46')]);return _0x5150a4[_0x0a9e('0x56')](_0x2a28c0);}})[_0x0a9e('0x2c')](function(_0xdb98ca){if(_0xdb98ca){_0x1b0b98=_0xdb98ca[_0x0a9e('0x4d')];if(!_0x2b8192[_0x0a9e('0x34')][_0x0a9e('0x3a')](_0x0a9e('0x3b'))){_0x2a28c0[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x2b8192[_0x0a9e('0x34')][_0x0a9e('0x26')]);_0x2a28c0['offset']=qs[_0x0a9e('0x25')](_0x2b8192[_0x0a9e('0x34')][_0x0a9e('0x25')]);}return _0x5150a4['getSubjects'](_0x2a28c0);}})[_0x0a9e('0x2c')](function(_0x33dda0){if(_0x33dda0){return _0x33dda0?{'count':_0x1b0b98,'rows':_0x33dda0}:null;}})[_0x0a9e('0x2c')](respondWithResult(_0x320898,null))[_0x0a9e('0x50')](handleError(_0x320898,null));};exports['getDescriptions']=function(_0x541e80,_0x7ebea8,_0x2bbdb5){var _0x4c54fa={};var _0x45108c={};var _0x53a6a1;var _0x260f4b;return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x541e80[_0x0a9e('0x52')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x7ebea8,null))[_0x0a9e('0x2c')](function(_0x42b959){if(_0x42b959){_0x53a6a1=_0x42b959;_0x45108c[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x54')]['rawAttributes']);_0x45108c[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x541e80[_0x0a9e('0x34')]);_0x45108c[_0x0a9e('0x35')]=_['intersection'](_0x45108c[_0x0a9e('0x37')],_0x45108c[_0x0a9e('0x34')]);_0x4c54fa['attributes']=_[_0x0a9e('0x36')](_0x45108c['model'],qs[_0x0a9e('0x39')](_0x541e80[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x4c54fa[_0x0a9e('0x38')]=_0x4c54fa['attributes']['length']?_0x4c54fa[_0x0a9e('0x38')]:_0x45108c[_0x0a9e('0x37')];_0x4c54fa[_0x0a9e('0x3c')]=qs['sort'](_0x541e80[_0x0a9e('0x34')][_0x0a9e('0x3d')]);_0x4c54fa['where']=qs['filters'](_[_0x0a9e('0x3f')](_0x541e80['query'],_0x45108c['filters']));if(_0x541e80['query'][_0x0a9e('0x40')]){_0x4c54fa[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x4c54fa[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x42')](_0x4c54fa[_0x0a9e('0x38')],function(_0x5a8854){var _0x5fd5db={};_0x5fd5db[_0x5a8854]={'$like':'%'+_0x541e80['query'][_0x0a9e('0x40')]+'%'};return _0x5fd5db;})});}_0x4c54fa=_[_0x0a9e('0x41')]({},_0x4c54fa,_0x541e80[_0x0a9e('0x46')]);return _0x53a6a1[_0x0a9e('0x57')](_0x4c54fa);}})['then'](function(_0x46c9ac){if(_0x46c9ac){_0x260f4b=_0x46c9ac[_0x0a9e('0x4d')];if(!_0x541e80[_0x0a9e('0x34')]['hasOwnProperty'](_0x0a9e('0x3b'))){_0x4c54fa[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x541e80[_0x0a9e('0x34')][_0x0a9e('0x26')]);_0x4c54fa[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x541e80[_0x0a9e('0x34')]['offset']);}return _0x53a6a1[_0x0a9e('0x57')](_0x4c54fa);}})[_0x0a9e('0x2c')](function(_0x589ff3){if(_0x589ff3){return _0x589ff3?{'count':_0x260f4b,'rows':_0x589ff3}:null;}})[_0x0a9e('0x2c')](respondWithResult(_0x7ebea8,null))[_0x0a9e('0x50')](handleError(_0x7ebea8,null));};exports[_0x0a9e('0x58')]=function(_0x5a26c8,_0x96672f,_0x52ec10){var _0x8c8fbe={};var _0x2b5148={};var _0x558a87;var _0x1f29bd;return db[_0x0a9e('0x32')][_0x0a9e('0x53')]({'where':{'id':_0x5a26c8[_0x0a9e('0x52')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x96672f,null))['then'](function(_0x329d88){if(_0x329d88){_0x558a87=_0x329d88;_0x2b5148[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x59')][_0x0a9e('0x33')]);_0x2b5148[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x5a26c8[_0x0a9e('0x34')]);_0x2b5148[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2b5148[_0x0a9e('0x37')],_0x2b5148[_0x0a9e('0x34')]);_0x8c8fbe[_0x0a9e('0x38')]=_['intersection'](_0x2b5148[_0x0a9e('0x37')],qs[_0x0a9e('0x39')](_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x8c8fbe[_0x0a9e('0x38')]=_0x8c8fbe['attributes'][_0x0a9e('0x4d')]?_0x8c8fbe[_0x0a9e('0x38')]:_0x2b5148['model'];_0x8c8fbe[_0x0a9e('0x3c')]=qs['sort'](_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x3d')]);_0x8c8fbe[_0x0a9e('0x3e')]=qs[_0x0a9e('0x35')](_['pick'](_0x5a26c8[_0x0a9e('0x34')],_0x2b5148['filters']));if(_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x8c8fbe['where']=_[_0x0a9e('0x41')](_0x8c8fbe[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x42')](_0x8c8fbe['attributes'],function(_0x4c788f){var _0x1b82b7={};_0x1b82b7[_0x4c788f]={'$like':'%'+_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x40')]+'%'};return _0x1b82b7;})});}_0x8c8fbe=_[_0x0a9e('0x41')]({},_0x8c8fbe,_0x5a26c8[_0x0a9e('0x46')]);return _0x558a87[_0x0a9e('0x58')](_0x8c8fbe);}})[_0x0a9e('0x2c')](function(_0x3c75b9){if(_0x3c75b9){_0x1f29bd=_0x3c75b9[_0x0a9e('0x4d')];if(!_0x5a26c8['query'][_0x0a9e('0x3a')]('nolimit')){_0x8c8fbe[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x26')]);_0x8c8fbe[_0x0a9e('0x25')]=qs['offset'](_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x25')]);}return _0x558a87[_0x0a9e('0x58')](_0x8c8fbe);}})[_0x0a9e('0x2c')](function(_0x2263f1){if(_0x2263f1){return _0x2263f1?{'count':_0x1f29bd,'rows':_0x2263f1}:null;}})['then'](respondWithResult(_0x96672f,null))['catch'](handleError(_0x96672f,null));};exports[_0x0a9e('0x5a')]=function(_0x583662,_0x25eae0,_0x4658df){if(_0x583662[_0x0a9e('0x51')]['id']){delete _0x583662[_0x0a9e('0x51')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x53')]({'where':{'id':_0x583662['params']['id']}})['then'](handleEntityNotFound(_0x25eae0,null))[_0x0a9e('0x2c')](function(_0x5dfbe2){if(_0x5dfbe2){return _0x5dfbe2[_0x0a9e('0x5a')](_0x583662['body'][_0x0a9e('0x5b')]||[]);}return null;})['then'](respondWithResult(_0x25eae0,null))['catch'](handleError(_0x25eae0,null));}; \ No newline at end of file +var _0x34e8=['html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../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','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','send','index','ZendeskConfiguration','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','count','includeAll','findAll','rows','params','include','find','create','body','getFields','ZendeskField','hasOwnProperty','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x34e8,0x12c));var _0x834e=function(_0x22a25c,_0x208909){_0x22a25c=_0x22a25c-0x0;var _0x54f7cb=_0x34e8[_0x22a25c];return _0x54f7cb;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var Redis=require(_0x834e('0x13'));var authService=require(_0x834e('0x14'));var qs=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var db=require(_0x834e('0x1b'))['db'];var jayson=require(_0x834e('0x1c'));var client=jayson['client'][_0x834e('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x6cd9b9,_0x58a27e,_0x23848e){if(_0x23848e){var _0x2d95f2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2d95f2[_0x834e('0x1e')](_0x58a27e)){return _0x6cd9b9;}else{throw new Error(_0x834e('0x1f'));}}else{return _0x6cd9b9;}}function respondWithRpcPromise(_0x50e860,_0x43156c,_0x302cbd,_0x57274a){return new BPromise(function(_0x316205,_0x4a9cdc){var _0x38a8cd=_0x57274a||client;return _0x38a8cd[_0x834e('0x20')](_0x50e860,_0x302cbd)['then'](function(_0x43ac41){logger[_0x834e('0x21')](_0x834e('0x22'),_0x43156c,'request\x20sent');logger[_0x834e('0x23')](_0x834e('0x24'),_0x43156c,_0x834e('0x25'),JSON[_0x834e('0x26')](_0x43ac41));if(_0x43ac41[_0x834e('0x27')]){if(_0x43ac41[_0x834e('0x27')][_0x834e('0x28')]===0x1f4){logger['error'](_0x834e('0x22'),_0x43156c,_0x43ac41[_0x834e('0x27')][_0x834e('0x29')]);return _0x4a9cdc(_0x43ac41[_0x834e('0x27')]['message']);}logger[_0x834e('0x27')](_0x834e('0x22'),_0x43156c,_0x43ac41['error'][_0x834e('0x29')]);return _0x316205(_0x43ac41[_0x834e('0x27')][_0x834e('0x29')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x43156c,_0x834e('0x25'));_0x316205(_0x43ac41[_0x834e('0x2a')]['message']);}})[_0x834e('0x2b')](function(_0x1dc1e0){logger['error'](_0x834e('0x22'),_0x43156c,_0x1dc1e0);_0x4a9cdc(_0x1dc1e0);});});}function respondWithStatusCode(_0x2e1983,_0x338636){_0x338636=_0x338636||0xcc;return function(_0x561cd2){if(_0x561cd2){return _0x2e1983[_0x834e('0x2c')](_0x338636);}return _0x2e1983[_0x834e('0x2d')](_0x338636)['end']();};}function respondWithResult(_0x5bef62,_0x1e713a){_0x1e713a=_0x1e713a||0xc8;return function(_0x508a1d){if(_0x508a1d){return _0x5bef62[_0x834e('0x2d')](_0x1e713a)[_0x834e('0x2e')](_0x508a1d);}};}function respondWithFilteredResult(_0x3db026,_0x2cc2eb){return function(_0x3cd928){if(_0x3cd928){var _0x130cc5=_0x3cd928['count'],_0x491919=_0x2cc2eb[_0x834e('0x2f')],_0x510780=_0x2cc2eb[_0x834e('0x2f')]+_0x2cc2eb[_0x834e('0x30')],_0x4dc64a;if(_0x510780>=_0x130cc5){_0x510780=_0x130cc5;_0x4dc64a=0xc8;}else{_0x4dc64a=0xce;}_0x3db026['status'](_0x4dc64a);return _0x3db026[_0x834e('0x31')](_0x834e('0x32'),_0x491919+'-'+_0x510780+'/'+_0x130cc5)[_0x834e('0x2e')](_0x3cd928);}return null;};}function patchUpdates(_0x1e026a){return function(_0x4551f5){try{jsonpatch[_0x834e('0x33')](_0x4551f5,_0x1e026a,!![]);}catch(_0x3d149d){return BPromise[_0x834e('0x34')](_0x3d149d);}return _0x4551f5[_0x834e('0x35')]();};}function saveUpdates(_0x493289,_0xef9ec2){return function(_0x5cad11){if(_0x5cad11){return _0x5cad11[_0x834e('0x36')](_0x493289)[_0x834e('0x37')](function(_0x9ab921){return _0x9ab921;});}return null;};}function removeEntity(_0x2b3418,_0x444366){return function(_0x4689c2){if(_0x4689c2){return _0x4689c2[_0x834e('0x38')]()[_0x834e('0x37')](function(){_0x2b3418[_0x834e('0x2d')](0xcc)[_0x834e('0x39')]();});}};}function handleEntityNotFound(_0x5bd232,_0x2a3c7f){return function(_0x2f408a){if(!_0x2f408a){_0x5bd232[_0x834e('0x2c')](0x194);}return _0x2f408a;};}function handleError(_0xaf01f4,_0x595cc0){_0x595cc0=_0x595cc0||0x1f4;return function(_0x3f88ad){logger[_0x834e('0x27')](_0x3f88ad['stack']);if(_0x3f88ad['name']){delete _0x3f88ad['name'];}_0xaf01f4[_0x834e('0x2d')](_0x595cc0)[_0x834e('0x3a')](_0x3f88ad);};}exports[_0x834e('0x3b')]=function(_0x34fefb,_0x339e28){var _0x1b76dd={},_0x4c2ef6={},_0x2c2d94={'count':0x0,'rows':[]};var _0x513f36=db[_0x834e('0x3c')][_0x834e('0x3d')];_0x4c2ef6['model']=_[_0x834e('0x3e')](_0x513f36);_0x4c2ef6[_0x834e('0x3f')]=_['keys'](_0x34fefb['query']);_0x4c2ef6[_0x834e('0x40')]=_[_0x834e('0x41')](_0x4c2ef6[_0x834e('0x42')],_0x4c2ef6[_0x834e('0x3f')]);_0x1b76dd[_0x834e('0x43')]=_['intersection'](_0x4c2ef6[_0x834e('0x42')],qs['fields'](_0x34fefb['query'][_0x834e('0x44')]));_0x1b76dd['attributes']=_0x1b76dd[_0x834e('0x43')][_0x834e('0x45')]?_0x1b76dd[_0x834e('0x43')]:_0x4c2ef6[_0x834e('0x42')];if(!_0x34fefb[_0x834e('0x3f')]['hasOwnProperty'](_0x834e('0x46'))){_0x1b76dd[_0x834e('0x30')]=qs[_0x834e('0x30')](_0x34fefb['query'][_0x834e('0x30')]);_0x1b76dd[_0x834e('0x2f')]=qs['offset'](_0x34fefb[_0x834e('0x3f')]['offset']);}_0x1b76dd[_0x834e('0x47')]=qs[_0x834e('0x48')](_0x34fefb['query']['sort']);_0x1b76dd[_0x834e('0x49')]=qs[_0x834e('0x40')](_[_0x834e('0x4a')](_0x34fefb[_0x834e('0x3f')],_0x4c2ef6[_0x834e('0x40')]));if(_0x34fefb[_0x834e('0x3f')][_0x834e('0x4b')]){_0x1b76dd['where']=_[_0x834e('0x4c')](_0x1b76dd['where'],{'$or':_[_0x834e('0x4d')](_0x513f36,function(_0x540685){if(_0x540685[_0x834e('0x4e')]['key']!==_0x834e('0x4f')){var _0x2da464={};_0x2da464[_0x540685['field']]={'$like':'%'+_0x34fefb[_0x834e('0x3f')][_0x834e('0x4b')]+'%'};return _0x2da464;}})});}_0x1b76dd=_[_0x834e('0x4c')]({},_0x1b76dd,_0x34fefb[_0x834e('0x50')]);var _0x252ea0={'where':_0x1b76dd[_0x834e('0x49')]};return db[_0x834e('0x3c')][_0x834e('0x51')](_0x252ea0)[_0x834e('0x37')](function(_0x279ea1){_0x2c2d94['count']=_0x279ea1;if(_0x34fefb[_0x834e('0x3f')][_0x834e('0x52')]){_0x1b76dd['include']=[{'all':!![]}];}return db[_0x834e('0x3c')][_0x834e('0x53')](_0x1b76dd);})[_0x834e('0x37')](function(_0x2112d5){_0x2c2d94[_0x834e('0x54')]=_0x2112d5;return _0x2c2d94;})[_0x834e('0x37')](respondWithFilteredResult(_0x339e28,_0x1b76dd))['catch'](handleError(_0x339e28,null));};exports['show']=function(_0x954d4b,_0x1a5444){var _0x30568e={'raw':![],'where':{'id':_0x954d4b[_0x834e('0x55')]['id']}},_0x40ff5a={};_0x40ff5a[_0x834e('0x42')]=_[_0x834e('0x3e')](db[_0x834e('0x3c')][_0x834e('0x3d')]);_0x40ff5a[_0x834e('0x3f')]=_[_0x834e('0x3e')](_0x954d4b[_0x834e('0x3f')]);_0x40ff5a[_0x834e('0x40')]=_[_0x834e('0x41')](_0x40ff5a[_0x834e('0x42')],_0x40ff5a[_0x834e('0x3f')]);_0x30568e[_0x834e('0x43')]=_[_0x834e('0x41')](_0x40ff5a[_0x834e('0x42')],qs[_0x834e('0x44')](_0x954d4b['query'][_0x834e('0x44')]));_0x30568e[_0x834e('0x43')]=_0x30568e['attributes'][_0x834e('0x45')]?_0x30568e[_0x834e('0x43')]:_0x40ff5a['model'];if(_0x954d4b[_0x834e('0x3f')][_0x834e('0x52')]){_0x30568e[_0x834e('0x56')]=[{'all':!![]}];}_0x30568e=_[_0x834e('0x4c')]({},_0x30568e,_0x954d4b[_0x834e('0x50')]);return db[_0x834e('0x3c')][_0x834e('0x57')](_0x30568e)['then'](handleEntityNotFound(_0x1a5444,null))[_0x834e('0x37')](respondWithResult(_0x1a5444,null))[_0x834e('0x2b')](handleError(_0x1a5444,null));};exports[_0x834e('0x58')]=function(_0x363675,_0x86ad2b){return db[_0x834e('0x3c')][_0x834e('0x58')](_0x363675[_0x834e('0x59')],{})['then'](respondWithResult(_0x86ad2b,0xc9))[_0x834e('0x2b')](handleError(_0x86ad2b,null));};exports['update']=function(_0x2f4bde,_0x53a9ee){if(_0x2f4bde[_0x834e('0x59')]['id']){delete _0x2f4bde['body']['id'];}return db['ZendeskConfiguration'][_0x834e('0x57')]({'where':{'id':_0x2f4bde[_0x834e('0x55')]['id']}})['then'](handleEntityNotFound(_0x53a9ee,null))['then'](saveUpdates(_0x2f4bde[_0x834e('0x59')],null))[_0x834e('0x37')](respondWithResult(_0x53a9ee,null))[_0x834e('0x2b')](handleError(_0x53a9ee,null));};exports[_0x834e('0x38')]=function(_0x21c417,_0x315858){return db[_0x834e('0x3c')][_0x834e('0x57')]({'where':{'id':_0x21c417['params']['id']}})[_0x834e('0x37')](handleEntityNotFound(_0x315858,null))[_0x834e('0x37')](removeEntity(_0x315858,null))['catch'](handleError(_0x315858,null));};exports[_0x834e('0x5a')]=function(_0x4e2b22,_0x3e58ef,_0x45eceb){var _0x5160c4={};var _0x41ef86={};var _0x37ee0e;var _0x2de29a;return db[_0x834e('0x3c')]['findOne']({'where':{'id':_0x4e2b22[_0x834e('0x55')]['id']}})[_0x834e('0x37')](handleEntityNotFound(_0x3e58ef,null))[_0x834e('0x37')](function(_0x5925ef){if(_0x5925ef){_0x37ee0e=_0x5925ef;_0x41ef86[_0x834e('0x42')]=_[_0x834e('0x3e')](db[_0x834e('0x5b')][_0x834e('0x3d')]);_0x41ef86[_0x834e('0x3f')]=_[_0x834e('0x3e')](_0x4e2b22[_0x834e('0x3f')]);_0x41ef86[_0x834e('0x40')]=_[_0x834e('0x41')](_0x41ef86[_0x834e('0x42')],_0x41ef86[_0x834e('0x3f')]);_0x5160c4[_0x834e('0x43')]=_[_0x834e('0x41')](_0x41ef86[_0x834e('0x42')],qs[_0x834e('0x44')](_0x4e2b22[_0x834e('0x3f')][_0x834e('0x44')]));_0x5160c4[_0x834e('0x43')]=_0x5160c4[_0x834e('0x43')][_0x834e('0x45')]?_0x5160c4[_0x834e('0x43')]:_0x41ef86[_0x834e('0x42')];_0x5160c4['order']=qs[_0x834e('0x48')](_0x4e2b22[_0x834e('0x3f')][_0x834e('0x48')]);_0x5160c4[_0x834e('0x49')]=qs['filters'](_[_0x834e('0x4a')](_0x4e2b22['query'],_0x41ef86['filters']));if(_0x4e2b22[_0x834e('0x3f')][_0x834e('0x4b')]){_0x5160c4[_0x834e('0x49')]=_[_0x834e('0x4c')](_0x5160c4[_0x834e('0x49')],{'$or':_[_0x834e('0x4d')](_0x5160c4[_0x834e('0x43')],function(_0xe5c8f6){var _0x525ed3={};_0x525ed3[_0xe5c8f6]={'$like':'%'+_0x4e2b22[_0x834e('0x3f')]['filter']+'%'};return _0x525ed3;})});}_0x5160c4=_[_0x834e('0x4c')]({},_0x5160c4,_0x4e2b22[_0x834e('0x50')]);return _0x37ee0e['getFields'](_0x5160c4);}})['then'](function(_0x4a4def){if(_0x4a4def){_0x2de29a=_0x4a4def[_0x834e('0x45')];if(!_0x4e2b22[_0x834e('0x3f')][_0x834e('0x5c')](_0x834e('0x46'))){_0x5160c4['limit']=qs[_0x834e('0x30')](_0x4e2b22[_0x834e('0x3f')][_0x834e('0x30')]);_0x5160c4[_0x834e('0x2f')]=qs[_0x834e('0x2f')](_0x4e2b22[_0x834e('0x3f')][_0x834e('0x2f')]);}return _0x37ee0e[_0x834e('0x5a')](_0x5160c4);}})[_0x834e('0x37')](function(_0x324f67){if(_0x324f67){return _0x324f67?{'count':_0x2de29a,'rows':_0x324f67}:null;}})['then'](respondWithResult(_0x3e58ef,null))[_0x834e('0x2b')](handleError(_0x3e58ef,null));};exports[_0x834e('0x5d')]=function(_0x42fc96,_0x5b5d6f,_0x51cfab){var _0x46fa0d={};var _0x4ac5f2={};var _0x5ce8b0;var _0x55d7ae;return db[_0x834e('0x3c')][_0x834e('0x5e')]({'where':{'id':_0x42fc96['params']['id']}})[_0x834e('0x37')](handleEntityNotFound(_0x5b5d6f,null))[_0x834e('0x37')](function(_0x4d4477){if(_0x4d4477){_0x5ce8b0=_0x4d4477;_0x4ac5f2[_0x834e('0x42')]=_[_0x834e('0x3e')](db['ZendeskField']['rawAttributes']);_0x4ac5f2[_0x834e('0x3f')]=_[_0x834e('0x3e')](_0x42fc96[_0x834e('0x3f')]);_0x4ac5f2[_0x834e('0x40')]=_[_0x834e('0x41')](_0x4ac5f2['model'],_0x4ac5f2[_0x834e('0x3f')]);_0x46fa0d['attributes']=_[_0x834e('0x41')](_0x4ac5f2[_0x834e('0x42')],qs[_0x834e('0x44')](_0x42fc96['query'][_0x834e('0x44')]));_0x46fa0d[_0x834e('0x43')]=_0x46fa0d['attributes'][_0x834e('0x45')]?_0x46fa0d[_0x834e('0x43')]:_0x4ac5f2[_0x834e('0x42')];_0x46fa0d['order']=qs[_0x834e('0x48')](_0x42fc96[_0x834e('0x3f')][_0x834e('0x48')]);_0x46fa0d[_0x834e('0x49')]=qs[_0x834e('0x40')](_[_0x834e('0x4a')](_0x42fc96[_0x834e('0x3f')],_0x4ac5f2[_0x834e('0x40')]));if(_0x42fc96[_0x834e('0x3f')][_0x834e('0x4b')]){_0x46fa0d['where']=_['merge'](_0x46fa0d['where'],{'$or':_[_0x834e('0x4d')](_0x46fa0d[_0x834e('0x43')],function(_0x313c03){var _0x37fa2c={};_0x37fa2c[_0x313c03]={'$like':'%'+_0x42fc96[_0x834e('0x3f')]['filter']+'%'};return _0x37fa2c;})});}_0x46fa0d=_['merge']({},_0x46fa0d,_0x42fc96[_0x834e('0x50')]);return _0x5ce8b0[_0x834e('0x5d')](_0x46fa0d);}})[_0x834e('0x37')](function(_0x18ddac){if(_0x18ddac){_0x55d7ae=_0x18ddac[_0x834e('0x45')];if(!_0x42fc96['query'][_0x834e('0x5c')](_0x834e('0x46'))){_0x46fa0d[_0x834e('0x30')]=qs['limit'](_0x42fc96[_0x834e('0x3f')][_0x834e('0x30')]);_0x46fa0d[_0x834e('0x2f')]=qs[_0x834e('0x2f')](_0x42fc96[_0x834e('0x3f')]['offset']);}return _0x5ce8b0['getSubjects'](_0x46fa0d);}})[_0x834e('0x37')](function(_0x40a872){if(_0x40a872){return _0x40a872?{'count':_0x55d7ae,'rows':_0x40a872}:null;}})['then'](respondWithResult(_0x5b5d6f,null))[_0x834e('0x2b')](handleError(_0x5b5d6f,null));};exports['getDescriptions']=function(_0x40c401,_0x3fa2fe,_0x451a8e){var _0x53012d={};var _0x155c0f={};var _0x49e721;var _0x5b2621;return db['ZendeskConfiguration'][_0x834e('0x5e')]({'where':{'id':_0x40c401[_0x834e('0x55')]['id']}})[_0x834e('0x37')](handleEntityNotFound(_0x3fa2fe,null))[_0x834e('0x37')](function(_0x3b18d0){if(_0x3b18d0){_0x49e721=_0x3b18d0;_0x155c0f[_0x834e('0x42')]=_[_0x834e('0x3e')](db[_0x834e('0x5b')][_0x834e('0x3d')]);_0x155c0f['query']=_[_0x834e('0x3e')](_0x40c401['query']);_0x155c0f[_0x834e('0x40')]=_[_0x834e('0x41')](_0x155c0f[_0x834e('0x42')],_0x155c0f[_0x834e('0x3f')]);_0x53012d[_0x834e('0x43')]=_[_0x834e('0x41')](_0x155c0f['model'],qs['fields'](_0x40c401[_0x834e('0x3f')][_0x834e('0x44')]));_0x53012d['attributes']=_0x53012d[_0x834e('0x43')][_0x834e('0x45')]?_0x53012d[_0x834e('0x43')]:_0x155c0f[_0x834e('0x42')];_0x53012d[_0x834e('0x47')]=qs['sort'](_0x40c401[_0x834e('0x3f')][_0x834e('0x48')]);_0x53012d['where']=qs['filters'](_['pick'](_0x40c401[_0x834e('0x3f')],_0x155c0f[_0x834e('0x40')]));if(_0x40c401['query'][_0x834e('0x4b')]){_0x53012d[_0x834e('0x49')]=_['merge'](_0x53012d[_0x834e('0x49')],{'$or':_['map'](_0x53012d['attributes'],function(_0x41dfd9){var _0x26042d={};_0x26042d[_0x41dfd9]={'$like':'%'+_0x40c401[_0x834e('0x3f')][_0x834e('0x4b')]+'%'};return _0x26042d;})});}_0x53012d=_['merge']({},_0x53012d,_0x40c401[_0x834e('0x50')]);return _0x49e721[_0x834e('0x5f')](_0x53012d);}})[_0x834e('0x37')](function(_0x1b0b41){if(_0x1b0b41){_0x5b2621=_0x1b0b41[_0x834e('0x45')];if(!_0x40c401[_0x834e('0x3f')][_0x834e('0x5c')](_0x834e('0x46'))){_0x53012d[_0x834e('0x30')]=qs[_0x834e('0x30')](_0x40c401[_0x834e('0x3f')][_0x834e('0x30')]);_0x53012d[_0x834e('0x2f')]=qs[_0x834e('0x2f')](_0x40c401[_0x834e('0x3f')][_0x834e('0x2f')]);}return _0x49e721[_0x834e('0x5f')](_0x53012d);}})[_0x834e('0x37')](function(_0x2db7b7){if(_0x2db7b7){return _0x2db7b7?{'count':_0x5b2621,'rows':_0x2db7b7}:null;}})[_0x834e('0x37')](respondWithResult(_0x3fa2fe,null))[_0x834e('0x2b')](handleError(_0x3fa2fe,null));};exports[_0x834e('0x60')]=function(_0x483815,_0x325ce1,_0x126b83){var _0x9ab45e={};var _0x2dab75={};var _0x14b603;var _0x3bcdcd;return db[_0x834e('0x3c')][_0x834e('0x5e')]({'where':{'id':_0x483815[_0x834e('0x55')]['id']}})['then'](handleEntityNotFound(_0x325ce1,null))['then'](function(_0x5549f8){if(_0x5549f8){_0x14b603=_0x5549f8;_0x2dab75[_0x834e('0x42')]=_['keys'](db[_0x834e('0x61')][_0x834e('0x3d')]);_0x2dab75[_0x834e('0x3f')]=_['keys'](_0x483815[_0x834e('0x3f')]);_0x2dab75[_0x834e('0x40')]=_[_0x834e('0x41')](_0x2dab75[_0x834e('0x42')],_0x2dab75[_0x834e('0x3f')]);_0x9ab45e[_0x834e('0x43')]=_['intersection'](_0x2dab75[_0x834e('0x42')],qs[_0x834e('0x44')](_0x483815[_0x834e('0x3f')][_0x834e('0x44')]));_0x9ab45e[_0x834e('0x43')]=_0x9ab45e['attributes']['length']?_0x9ab45e['attributes']:_0x2dab75['model'];_0x9ab45e[_0x834e('0x47')]=qs[_0x834e('0x48')](_0x483815['query'][_0x834e('0x48')]);_0x9ab45e[_0x834e('0x49')]=qs['filters'](_[_0x834e('0x4a')](_0x483815[_0x834e('0x3f')],_0x2dab75[_0x834e('0x40')]));if(_0x483815[_0x834e('0x3f')][_0x834e('0x4b')]){_0x9ab45e[_0x834e('0x49')]=_['merge'](_0x9ab45e['where'],{'$or':_[_0x834e('0x4d')](_0x9ab45e[_0x834e('0x43')],function(_0x1d2e12){var _0x58bdd6={};_0x58bdd6[_0x1d2e12]={'$like':'%'+_0x483815[_0x834e('0x3f')][_0x834e('0x4b')]+'%'};return _0x58bdd6;})});}_0x9ab45e=_['merge']({},_0x9ab45e,_0x483815[_0x834e('0x50')]);return _0x14b603[_0x834e('0x60')](_0x9ab45e);}})[_0x834e('0x37')](function(_0x30e3aa){if(_0x30e3aa){_0x3bcdcd=_0x30e3aa['length'];if(!_0x483815[_0x834e('0x3f')]['hasOwnProperty']('nolimit')){_0x9ab45e[_0x834e('0x30')]=qs[_0x834e('0x30')](_0x483815[_0x834e('0x3f')][_0x834e('0x30')]);_0x9ab45e[_0x834e('0x2f')]=qs[_0x834e('0x2f')](_0x483815['query']['offset']);}return _0x14b603[_0x834e('0x60')](_0x9ab45e);}})[_0x834e('0x37')](function(_0x321c4f){if(_0x321c4f){return _0x321c4f?{'count':_0x3bcdcd,'rows':_0x321c4f}:null;}})[_0x834e('0x37')](respondWithResult(_0x325ce1,null))[_0x834e('0x2b')](handleError(_0x325ce1,null));};exports[_0x834e('0x62')]=function(_0x3e4fe2,_0x596031,_0x435a75){if(_0x3e4fe2[_0x834e('0x59')]['id']){delete _0x3e4fe2['body']['id'];}return db[_0x834e('0x3c')][_0x834e('0x5e')]({'where':{'id':_0x3e4fe2[_0x834e('0x55')]['id']}})[_0x834e('0x37')](handleEntityNotFound(_0x596031,null))[_0x834e('0x37')](function(_0x37c5f3){if(_0x37c5f3){return _0x37c5f3[_0x834e('0x62')](_0x3e4fe2[_0x834e('0x59')][_0x834e('0x63')]||[]);}return null;})[_0x834e('0x37')](respondWithResult(_0x596031,null))[_0x834e('0x2b')](handleError(_0x596031,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 15b181f..b0a86eb 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 _0x4c6a=['lodash','util','api','bluebird','request-promise','path','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x2b9c17,_0xc8ac81){var _0x28711d=function(_0x135903){while(--_0x135903){_0x2b9c17['push'](_0x2b9c17['shift']());}};_0x28711d(++_0xc8ac81);}(_0x4c6a,0xb4));var _0xa4c6=function(_0x5db8fa,_0x224d28){_0x5db8fa=_0x5db8fa-0x0;var _0x36de73=_0x4c6a[_0x5db8fa];return _0x36de73;};'use strict';var _=require(_0xa4c6('0x0'));var util=require(_0xa4c6('0x1'));var logger=require('../../config/logger')(_0xa4c6('0x2'));var moment=require('moment');var BPromise=require(_0xa4c6('0x3'));var rp=require(_0xa4c6('0x4'));var fs=require('fs');var path=require(_0xa4c6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module[_0xa4c6('0x6')]=function(_0x25881e,_0x4b9b00){return _0x25881e[_0xa4c6('0x7')](_0xa4c6('0x8'),attributes,{'tableName':_0xa4c6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a07=['exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes'];(function(_0x13b544,_0x41c402){var _0x50e831=function(_0x2714e3){while(--_0x2714e3){_0x13b544['push'](_0x13b544['shift']());}};_0x50e831(++_0x41c402);}(_0x2a07,0x74));var _0x72a0=function(_0x215acd,_0x410e3d){_0x215acd=_0x215acd-0x0;var _0x42739c=_0x2a07[_0x215acd];return _0x42739c;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var logger=require(_0x72a0('0x2'))(_0x72a0('0x3'));var moment=require(_0x72a0('0x4'));var BPromise=require('bluebird');var rp=require(_0x72a0('0x5'));var fs=require('fs');var path=require(_0x72a0('0x6'));var rimraf=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var attributes=require(_0x72a0('0x9'));module[_0x72a0('0xa')]=function(_0x3ccf6d,_0x20dab9){return _0x3ccf6d[_0x72a0('0xb')](_0x72a0('0xc'),attributes,{'tableName':_0x72a0('0xd'),'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 2900f23..55772de 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 _0x662f=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x662f,0x11d));var _0xf662=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x662f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xf662('0x0'));var moment=require('moment');var BPromise=require(_0xf662('0x1'));var rs=require(_0xf662('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf662('0x3'))['db'];var utils=require(_0xf662('0x4'));var logger=require('../../config/logger')(_0xf662('0x5'));var config=require(_0xf662('0x6'));var jayson=require(_0xf662('0x7'));var client=jayson[_0xf662('0x8')][_0xf662('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4204ed,_0x26b53c,_0x1ceca9){return new BPromise(function(_0x2ddcb6,_0x186880){return client['request'](_0x4204ed,_0x1ceca9)[_0xf662('0xa')](function(_0x1d4d3a){logger['info'](_0xf662('0xb'),_0x26b53c,_0xf662('0xc'));logger[_0xf662('0xd')](_0xf662('0xe'),_0x26b53c,_0xf662('0xc'),JSON[_0xf662('0xf')](_0x1d4d3a));if(_0x1d4d3a[_0xf662('0x10')]){if(_0x1d4d3a[_0xf662('0x10')][_0xf662('0x11')]===0x1f4){logger['error'](_0xf662('0xb'),_0x26b53c,_0x1d4d3a['error'][_0xf662('0x12')]);return _0x186880(_0x1d4d3a[_0xf662('0x10')]['message']);}logger[_0xf662('0x10')](_0xf662('0xb'),_0x26b53c,_0x1d4d3a['error'][_0xf662('0x12')]);return _0x2ddcb6(_0x1d4d3a['error'][_0xf662('0x12')]);}else{logger[_0xf662('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x26b53c,_0xf662('0xc'));_0x2ddcb6(_0x1d4d3a[_0xf662('0x14')][_0xf662('0x12')]);}})[_0xf662('0x15')](function(_0x479661){logger['error'](_0xf662('0xb'),_0x26b53c,_0x479661);_0x186880(_0x479661);});});} \ No newline at end of file +var _0x4fbe=['lodash','util','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x36c763,_0x75b98f){var _0xa4de94=function(_0x149dc1){while(--_0x149dc1){_0x36c763['push'](_0x36c763['shift']());}};_0xa4de94(++_0x75b98f);}(_0x4fbe,0x165));var _0xe4fb=function(_0x221351,_0x3fa3a7){_0x221351=_0x221351-0x0;var _0x18945c=_0x4fbe[_0x221351];return _0x18945c;};'use strict';var _=require(_0xe4fb('0x0'));var util=require(_0xe4fb('0x1'));var moment=require('moment');var BPromise=require(_0xe4fb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe4fb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe4fb('0x4'));var logger=require('../../config/logger')(_0xe4fb('0x5'));var config=require('../../config/environment');var jayson=require(_0xe4fb('0x6'));var client=jayson[_0xe4fb('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcde8e4,_0x20b940,_0x5a0b62){return new BPromise(function(_0x430ea0,_0x3e9631){return client['request'](_0xcde8e4,_0x5a0b62)['then'](function(_0x360f5a){logger['info'](_0xe4fb('0x8'),_0x20b940,_0xe4fb('0x9'));logger[_0xe4fb('0xa')](_0xe4fb('0xb'),_0x20b940,_0xe4fb('0x9'),JSON[_0xe4fb('0xc')](_0x360f5a));if(_0x360f5a['error']){if(_0x360f5a[_0xe4fb('0xd')]['code']===0x1f4){logger[_0xe4fb('0xd')](_0xe4fb('0x8'),_0x20b940,_0x360f5a[_0xe4fb('0xd')][_0xe4fb('0xe')]);return _0x3e9631(_0x360f5a['error'][_0xe4fb('0xe')]);}logger['error'](_0xe4fb('0x8'),_0x20b940,_0x360f5a[_0xe4fb('0xd')][_0xe4fb('0xe')]);return _0x430ea0(_0x360f5a[_0xe4fb('0xd')][_0xe4fb('0xe')]);}else{logger[_0xe4fb('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x20b940,'request\x20sent');_0x430ea0(_0x360f5a[_0xe4fb('0x10')][_0xe4fb('0xe')]);}})['catch'](function(_0x203962){logger[_0xe4fb('0xd')](_0xe4fb('0x8'),_0x20b940,_0x203962);_0x3e9631(_0x203962);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 8bd7c2e..e805a16 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(_0x207b89,_0x5d0d8e){var _0x2917fd=function(_0xe14f09){while(--_0xe14f09){_0x207b89['push'](_0x207b89['shift']());}};_0x2917fd(++_0x5d0d8e);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 _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(_0x43775d,_0x5415c7){var _0x28b54a=function(_0x943eca){while(--_0x943eca){_0x43775d['push'](_0x43775d['shift']());}};_0x28b54a(++_0x5415c7);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./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 diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index ffaf9da..3fa5d6d 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 _0xb58b=['BOOLEAN','exports','ENUM','string','customVariable','keyValue','STRING','variable'];(function(_0x37e9c1,_0x20ff2a){var _0x3b12bd=function(_0x4d42ae){while(--_0x4d42ae){_0x37e9c1['push'](_0x37e9c1['shift']());}};_0x3b12bd(++_0x20ff2a);}(_0xb58b,0x1f1));var _0xbb58=function(_0x22515d,_0x45fd88){_0x22515d=_0x22515d-0x0;var _0x28c8b6=_0xb58b[_0x22515d];return _0x28c8b6;};'use strict';var Sequelize=require('sequelize');module[_0xbb58('0x0')]={'type':{'type':Sequelize[_0xbb58('0x1')](_0xbb58('0x2'),'variable',_0xbb58('0x3'),_0xbb58('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xbb58('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xbb58('0x1')](_0xbb58('0x2'),_0xbb58('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xbb58('0x5')]},'idField':{'type':Sequelize[_0xbb58('0x5')]},'nameField':{'type':Sequelize[_0xbb58('0x5')]},'customField':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbb58('0x5')]}}; \ No newline at end of file +var _0x750a=['customVariable','keyValue','string','STRING','ENUM','exports','variable'];(function(_0x37c1da,_0xcaa6f1){var _0x33b19f=function(_0x50e82f){while(--_0x50e82f){_0x37c1da['push'](_0x37c1da['shift']());}};_0x33b19f(++_0xcaa6f1);}(_0x750a,0x140));var _0xa750=function(_0x2cbd58,_0x278e75){_0x2cbd58=_0x2cbd58-0x0;var _0x42ef2a=_0x750a[_0x2cbd58];return _0x42ef2a;};'use strict';var Sequelize=require('sequelize');module[_0xa750('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0xa750('0x1'),_0xa750('0x2'),_0xa750('0x3')),'defaultValue':_0xa750('0x4')},'content':{'type':Sequelize[_0xa750('0x5')]},'key':{'type':Sequelize[_0xa750('0x5')]},'keyType':{'type':Sequelize[_0xa750('0x6')](_0xa750('0x4'),_0xa750('0x1'),_0xa750('0x2'))},'keyContent':{'type':Sequelize[_0xa750('0x5')]},'idField':{'type':Sequelize[_0xa750('0x5')]},'nameField':{'type':Sequelize[_0xa750('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'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 a7524aa..192a244 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 _0xc818=['fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','map','type','key','VIRTUAL','filter','include','findAll','rows','show','includeAll','options','find','catch','create','body','update','params','destroy','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','Content-Range','apply','reject','then','error','stack','name','send','index','ZendeskField','rawAttributes','model','keys','query','filters','intersection','attributes'];(function(_0x4085bf,_0x4f1f96){var _0x311b27=function(_0x138452){while(--_0x138452){_0x4085bf['push'](_0x4085bf['shift']());}};_0x311b27(++_0x4f1f96);}(_0xc818,0x1e3));var _0x8c81=function(_0x1bbc21,_0x155098){_0x1bbc21=_0x1bbc21-0x0;var _0x526ba8=_0xc818[_0x1bbc21];return _0x526ba8;};'use strict';var pdf=require(_0x8c81('0x0'));var emlformat=require(_0x8c81('0x1'));var rimraf=require(_0x8c81('0x2'));var zipdir=require(_0x8c81('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8c81('0x4'));var moment=require(_0x8c81('0x5'));var BPromise=require(_0x8c81('0x6'));var Mustache=require(_0x8c81('0x7'));var util=require(_0x8c81('0x8'));var path=require(_0x8c81('0x9'));var sox=require(_0x8c81('0xa'));var csv=require('to-csv');var ejs=require(_0x8c81('0xb'));var fs=require('fs');var _=require(_0x8c81('0xc'));var squel=require(_0x8c81('0xd'));var crypto=require(_0x8c81('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8c81('0xf'));var toCsv=require(_0x8c81('0x10'));var querystring=require(_0x8c81('0x11'));var Papa=require(_0x8c81('0x12'));var Redis=require(_0x8c81('0x13'));var authService=require(_0x8c81('0x14'));var qs=require(_0x8c81('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c81('0x16'))(_0x8c81('0x17'));var utils=require(_0x8c81('0x18'));var config=require(_0x8c81('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a2d9e,_0x3cdd27){_0x3cdd27=_0x3cdd27||0xcc;return function(_0x63f11f){if(_0x63f11f){return _0x5a2d9e[_0x8c81('0x1a')](_0x3cdd27);}return _0x5a2d9e[_0x8c81('0x1b')](_0x3cdd27)[_0x8c81('0x1c')]();};}function respondWithResult(_0x1b7b1b,_0xd04a1){_0xd04a1=_0xd04a1||0xc8;return function(_0x1500cc){if(_0x1500cc){return _0x1b7b1b['status'](_0xd04a1)['json'](_0x1500cc);}};}function respondWithFilteredResult(_0x1db769,_0x1df3ac){return function(_0x238ce5){if(_0x238ce5){var _0x4fa5=_0x238ce5[_0x8c81('0x1d')],_0xf1682e=_0x1df3ac[_0x8c81('0x1e')],_0x3e59e3=_0x1df3ac[_0x8c81('0x1e')]+_0x1df3ac[_0x8c81('0x1f')],_0x4f7180;if(_0x3e59e3>=_0x4fa5){_0x3e59e3=_0x4fa5;_0x4f7180=0xc8;}else{_0x4f7180=0xce;}_0x1db769[_0x8c81('0x1b')](_0x4f7180);return _0x1db769['set'](_0x8c81('0x20'),_0xf1682e+'-'+_0x3e59e3+'/'+_0x4fa5)['json'](_0x238ce5);}return null;};}function patchUpdates(_0x492d24){return function(_0x49b51b){try{jsonpatch[_0x8c81('0x21')](_0x49b51b,_0x492d24,!![]);}catch(_0x13e312){return BPromise[_0x8c81('0x22')](_0x13e312);}return _0x49b51b['save']();};}function saveUpdates(_0x2bf715,_0x2312d5){return function(_0x348d79){if(_0x348d79){return _0x348d79['update'](_0x2bf715)[_0x8c81('0x23')](function(_0x16c71a){return _0x16c71a;});}return null;};}function removeEntity(_0x56ca80,_0x35d61a){return function(_0x31c4a2){if(_0x31c4a2){return _0x31c4a2['destroy']()['then'](function(){_0x56ca80[_0x8c81('0x1b')](0xcc)[_0x8c81('0x1c')]();});}};}function handleEntityNotFound(_0xfaf3d9,_0x49cedc){return function(_0x8c399c){if(!_0x8c399c){_0xfaf3d9[_0x8c81('0x1a')](0x194);}return _0x8c399c;};}function handleError(_0x2ccd2f,_0xa0f0f7){_0xa0f0f7=_0xa0f0f7||0x1f4;return function(_0x703dba){logger[_0x8c81('0x24')](_0x703dba[_0x8c81('0x25')]);if(_0x703dba[_0x8c81('0x26')]){delete _0x703dba['name'];}_0x2ccd2f['status'](_0xa0f0f7)[_0x8c81('0x27')](_0x703dba);};}exports[_0x8c81('0x28')]=function(_0x2b9df6,_0x21bf77){var _0x3e5ed1={},_0x1f9608={},_0x2e7ba2={'count':0x0,'rows':[]};var _0x1d30d5=db[_0x8c81('0x29')][_0x8c81('0x2a')];_0x1f9608[_0x8c81('0x2b')]=_[_0x8c81('0x2c')](_0x1d30d5);_0x1f9608[_0x8c81('0x2d')]=_['keys'](_0x2b9df6[_0x8c81('0x2d')]);_0x1f9608[_0x8c81('0x2e')]=_[_0x8c81('0x2f')](_0x1f9608[_0x8c81('0x2b')],_0x1f9608[_0x8c81('0x2d')]);_0x3e5ed1[_0x8c81('0x30')]=_[_0x8c81('0x2f')](_0x1f9608[_0x8c81('0x2b')],qs[_0x8c81('0x31')](_0x2b9df6['query'][_0x8c81('0x31')]));_0x3e5ed1[_0x8c81('0x30')]=_0x3e5ed1[_0x8c81('0x30')][_0x8c81('0x32')]?_0x3e5ed1[_0x8c81('0x30')]:_0x1f9608['model'];if(!_0x2b9df6[_0x8c81('0x2d')][_0x8c81('0x33')](_0x8c81('0x34'))){_0x3e5ed1[_0x8c81('0x1f')]=qs[_0x8c81('0x1f')](_0x2b9df6['query']['limit']);_0x3e5ed1[_0x8c81('0x1e')]=qs[_0x8c81('0x1e')](_0x2b9df6[_0x8c81('0x2d')]['offset']);}_0x3e5ed1[_0x8c81('0x35')]=qs[_0x8c81('0x36')](_0x2b9df6[_0x8c81('0x2d')][_0x8c81('0x36')]);_0x3e5ed1['where']=qs[_0x8c81('0x2e')](_[_0x8c81('0x37')](_0x2b9df6['query'],_0x1f9608[_0x8c81('0x2e')]));if(_0x2b9df6['query']['filter']){_0x3e5ed1[_0x8c81('0x38')]=_[_0x8c81('0x39')](_0x3e5ed1[_0x8c81('0x38')],{'$or':_[_0x8c81('0x3a')](_0x1d30d5,function(_0x4ced33){if(_0x4ced33[_0x8c81('0x3b')][_0x8c81('0x3c')]!==_0x8c81('0x3d')){var _0x5dc5cf={};_0x5dc5cf[_0x4ced33['field']]={'$like':'%'+_0x2b9df6[_0x8c81('0x2d')][_0x8c81('0x3e')]+'%'};return _0x5dc5cf;}})});}_0x3e5ed1=_[_0x8c81('0x39')]({},_0x3e5ed1,_0x2b9df6['options']);var _0x195cb2={'where':_0x3e5ed1['where']};return db['ZendeskField']['count'](_0x195cb2)[_0x8c81('0x23')](function(_0x562342){_0x2e7ba2[_0x8c81('0x1d')]=_0x562342;if(_0x2b9df6['query']['includeAll']){_0x3e5ed1[_0x8c81('0x3f')]=[{'all':!![]}];}return db[_0x8c81('0x29')][_0x8c81('0x40')](_0x3e5ed1);})[_0x8c81('0x23')](function(_0x1e070d){_0x2e7ba2[_0x8c81('0x41')]=_0x1e070d;return _0x2e7ba2;})[_0x8c81('0x23')](respondWithFilteredResult(_0x21bf77,_0x3e5ed1))['catch'](handleError(_0x21bf77,null));};exports[_0x8c81('0x42')]=function(_0x15e499,_0x2fec95){var _0x41f9d2={'raw':!![],'where':{'id':_0x15e499['params']['id']}},_0xfbec47={};_0xfbec47[_0x8c81('0x2b')]=_[_0x8c81('0x2c')](db[_0x8c81('0x29')][_0x8c81('0x2a')]);_0xfbec47[_0x8c81('0x2d')]=_[_0x8c81('0x2c')](_0x15e499[_0x8c81('0x2d')]);_0xfbec47[_0x8c81('0x2e')]=_[_0x8c81('0x2f')](_0xfbec47[_0x8c81('0x2b')],_0xfbec47[_0x8c81('0x2d')]);_0x41f9d2[_0x8c81('0x30')]=_['intersection'](_0xfbec47['model'],qs[_0x8c81('0x31')](_0x15e499[_0x8c81('0x2d')][_0x8c81('0x31')]));_0x41f9d2[_0x8c81('0x30')]=_0x41f9d2[_0x8c81('0x30')][_0x8c81('0x32')]?_0x41f9d2[_0x8c81('0x30')]:_0xfbec47['model'];if(_0x15e499['query'][_0x8c81('0x43')]){_0x41f9d2[_0x8c81('0x3f')]=[{'all':!![]}];}_0x41f9d2=_[_0x8c81('0x39')]({},_0x41f9d2,_0x15e499[_0x8c81('0x44')]);return db[_0x8c81('0x29')][_0x8c81('0x45')](_0x41f9d2)[_0x8c81('0x23')](handleEntityNotFound(_0x2fec95,null))['then'](respondWithResult(_0x2fec95,null))[_0x8c81('0x46')](handleError(_0x2fec95,null));};exports[_0x8c81('0x47')]=function(_0x41cbc2,_0x331c74){return db['ZendeskField']['create'](_0x41cbc2[_0x8c81('0x48')],{})[_0x8c81('0x23')](respondWithResult(_0x331c74,0xc9))[_0x8c81('0x46')](handleError(_0x331c74,null));};exports[_0x8c81('0x49')]=function(_0x52704a,_0x26365f){if(_0x52704a[_0x8c81('0x48')]['id']){delete _0x52704a[_0x8c81('0x48')]['id'];}return db[_0x8c81('0x29')][_0x8c81('0x45')]({'where':{'id':_0x52704a[_0x8c81('0x4a')]['id']}})[_0x8c81('0x23')](handleEntityNotFound(_0x26365f,null))[_0x8c81('0x23')](saveUpdates(_0x52704a[_0x8c81('0x48')],null))[_0x8c81('0x23')](respondWithResult(_0x26365f,null))[_0x8c81('0x46')](handleError(_0x26365f,null));};exports[_0x8c81('0x4b')]=function(_0x25b569,_0x39dbc8){return db[_0x8c81('0x29')][_0x8c81('0x45')]({'where':{'id':_0x25b569['params']['id']}})[_0x8c81('0x23')](handleEntityNotFound(_0x39dbc8,null))[_0x8c81('0x23')](removeEntity(_0x39dbc8,null))['catch'](handleError(_0x39dbc8,null));}; \ No newline at end of file +var _0x16cc=['find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','status','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','end','error','name','send','rawAttributes','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','ZendeskField','includeAll','include','findAll','rows','catch','show'];(function(_0x17b0cd,_0x1b40fd){var _0x5a9631=function(_0x23f844){while(--_0x23f844){_0x17b0cd['push'](_0x17b0cd['shift']());}};_0x5a9631(++_0x1b40fd);}(_0x16cc,0x120));var _0xc16c=function(_0x53fe83,_0x20c538){_0x53fe83=_0x53fe83-0x0;var _0x49cb24=_0x16cc[_0x53fe83];return _0x49cb24;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc16c('0x0'));var rimraf=require(_0xc16c('0x1'));var zipdir=require(_0xc16c('0x2'));var jsonpatch=require(_0xc16c('0x3'));var rp=require(_0xc16c('0x4'));var moment=require(_0xc16c('0x5'));var BPromise=require(_0xc16c('0x6'));var Mustache=require('mustache');var util=require(_0xc16c('0x7'));var path=require(_0xc16c('0x8'));var sox=require(_0xc16c('0x9'));var csv=require(_0xc16c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc16c('0xb'));var squel=require('squel');var crypto=require(_0xc16c('0xc'));var jsforce=require(_0xc16c('0xd'));var deskjs=require(_0xc16c('0xe'));var toCsv=require(_0xc16c('0xa'));var querystring=require('querystring');var Papa=require(_0xc16c('0xf'));var Redis=require(_0xc16c('0x10'));var authService=require(_0xc16c('0x11'));var qs=require(_0xc16c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc16c('0x13'))(_0xc16c('0x14'));var utils=require(_0xc16c('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x333748,_0x2cf236){_0x2cf236=_0x2cf236||0xcc;return function(_0x62b43c){if(_0x62b43c){return _0x333748['sendStatus'](_0x2cf236);}return _0x333748['status'](_0x2cf236)['end']();};}function respondWithResult(_0x21108f,_0x3f406e){_0x3f406e=_0x3f406e||0xc8;return function(_0x440d6e){if(_0x440d6e){return _0x21108f[_0xc16c('0x16')](_0x3f406e)[_0xc16c('0x17')](_0x440d6e);}};}function respondWithFilteredResult(_0x24028d,_0x47ea69){return function(_0x32b7cd){if(_0x32b7cd){var _0x200ec0=_0x32b7cd[_0xc16c('0x18')],_0x304303=_0x47ea69[_0xc16c('0x19')],_0x244e4c=_0x47ea69[_0xc16c('0x19')]+_0x47ea69['limit'],_0xcc4850;if(_0x244e4c>=_0x200ec0){_0x244e4c=_0x200ec0;_0xcc4850=0xc8;}else{_0xcc4850=0xce;}_0x24028d['status'](_0xcc4850);return _0x24028d[_0xc16c('0x1a')](_0xc16c('0x1b'),_0x304303+'-'+_0x244e4c+'/'+_0x200ec0)[_0xc16c('0x17')](_0x32b7cd);}return null;};}function patchUpdates(_0x3d7ad6){return function(_0x432a0a){try{jsonpatch[_0xc16c('0x1c')](_0x432a0a,_0x3d7ad6,!![]);}catch(_0x6cf644){return BPromise[_0xc16c('0x1d')](_0x6cf644);}return _0x432a0a['save']();};}function saveUpdates(_0x4770d2,_0x37afc3){return function(_0x121da2){if(_0x121da2){return _0x121da2[_0xc16c('0x1e')](_0x4770d2)[_0xc16c('0x1f')](function(_0x13284f){return _0x13284f;});}return null;};}function removeEntity(_0x264c24,_0x264a3a){return function(_0x41f7c3){if(_0x41f7c3){return _0x41f7c3[_0xc16c('0x20')]()[_0xc16c('0x1f')](function(){_0x264c24[_0xc16c('0x16')](0xcc)[_0xc16c('0x21')]();});}};}function handleEntityNotFound(_0x3a8b0f,_0x2d6727){return function(_0x534a87){if(!_0x534a87){_0x3a8b0f['sendStatus'](0x194);}return _0x534a87;};}function handleError(_0xf7a884,_0x5911cf){_0x5911cf=_0x5911cf||0x1f4;return function(_0xfd31a7){logger[_0xc16c('0x22')](_0xfd31a7['stack']);if(_0xfd31a7[_0xc16c('0x23')]){delete _0xfd31a7['name'];}_0xf7a884[_0xc16c('0x16')](_0x5911cf)[_0xc16c('0x24')](_0xfd31a7);};}exports['index']=function(_0xf41dcf,_0x29fe0b){var _0x323b60={},_0x536bf1={},_0x403c67={'count':0x0,'rows':[]};var _0x29c413=db['ZendeskField'][_0xc16c('0x25')];_0x536bf1[_0xc16c('0x26')]=_['keys'](_0x29c413);_0x536bf1['query']=_[_0xc16c('0x27')](_0xf41dcf['query']);_0x536bf1[_0xc16c('0x28')]=_[_0xc16c('0x29')](_0x536bf1[_0xc16c('0x26')],_0x536bf1['query']);_0x323b60[_0xc16c('0x2a')]=_[_0xc16c('0x29')](_0x536bf1[_0xc16c('0x26')],qs[_0xc16c('0x2b')](_0xf41dcf[_0xc16c('0x2c')][_0xc16c('0x2b')]));_0x323b60[_0xc16c('0x2a')]=_0x323b60[_0xc16c('0x2a')][_0xc16c('0x2d')]?_0x323b60[_0xc16c('0x2a')]:_0x536bf1[_0xc16c('0x26')];if(!_0xf41dcf[_0xc16c('0x2c')][_0xc16c('0x2e')](_0xc16c('0x2f'))){_0x323b60['limit']=qs[_0xc16c('0x30')](_0xf41dcf[_0xc16c('0x2c')][_0xc16c('0x30')]);_0x323b60['offset']=qs['offset'](_0xf41dcf['query'][_0xc16c('0x19')]);}_0x323b60[_0xc16c('0x31')]=qs[_0xc16c('0x32')](_0xf41dcf[_0xc16c('0x2c')][_0xc16c('0x32')]);_0x323b60[_0xc16c('0x33')]=qs[_0xc16c('0x28')](_[_0xc16c('0x34')](_0xf41dcf[_0xc16c('0x2c')],_0x536bf1['filters']));if(_0xf41dcf['query'][_0xc16c('0x35')]){_0x323b60[_0xc16c('0x33')]=_[_0xc16c('0x36')](_0x323b60[_0xc16c('0x33')],{'$or':_[_0xc16c('0x37')](_0x29c413,function(_0x13885f){if(_0x13885f['type'][_0xc16c('0x38')]!==_0xc16c('0x39')){var _0x46b0d4={};_0x46b0d4[_0x13885f[_0xc16c('0x3a')]]={'$like':'%'+_0xf41dcf['query'][_0xc16c('0x35')]+'%'};return _0x46b0d4;}})});}_0x323b60=_[_0xc16c('0x36')]({},_0x323b60,_0xf41dcf[_0xc16c('0x3b')]);var _0x325d9e={'where':_0x323b60[_0xc16c('0x33')]};return db[_0xc16c('0x3c')]['count'](_0x325d9e)[_0xc16c('0x1f')](function(_0x42eb93){_0x403c67[_0xc16c('0x18')]=_0x42eb93;if(_0xf41dcf[_0xc16c('0x2c')][_0xc16c('0x3d')]){_0x323b60[_0xc16c('0x3e')]=[{'all':!![]}];}return db[_0xc16c('0x3c')][_0xc16c('0x3f')](_0x323b60);})[_0xc16c('0x1f')](function(_0x274d87){_0x403c67[_0xc16c('0x40')]=_0x274d87;return _0x403c67;})[_0xc16c('0x1f')](respondWithFilteredResult(_0x29fe0b,_0x323b60))[_0xc16c('0x41')](handleError(_0x29fe0b,null));};exports[_0xc16c('0x42')]=function(_0x215056,_0x2330c4){var _0x241618={'raw':!![],'where':{'id':_0x215056['params']['id']}},_0x42a1de={};_0x42a1de[_0xc16c('0x26')]=_[_0xc16c('0x27')](db[_0xc16c('0x3c')]['rawAttributes']);_0x42a1de[_0xc16c('0x2c')]=_[_0xc16c('0x27')](_0x215056[_0xc16c('0x2c')]);_0x42a1de['filters']=_[_0xc16c('0x29')](_0x42a1de['model'],_0x42a1de[_0xc16c('0x2c')]);_0x241618[_0xc16c('0x2a')]=_[_0xc16c('0x29')](_0x42a1de[_0xc16c('0x26')],qs[_0xc16c('0x2b')](_0x215056[_0xc16c('0x2c')]['fields']));_0x241618[_0xc16c('0x2a')]=_0x241618['attributes'][_0xc16c('0x2d')]?_0x241618['attributes']:_0x42a1de[_0xc16c('0x26')];if(_0x215056['query'][_0xc16c('0x3d')]){_0x241618[_0xc16c('0x3e')]=[{'all':!![]}];}_0x241618=_[_0xc16c('0x36')]({},_0x241618,_0x215056['options']);return db[_0xc16c('0x3c')][_0xc16c('0x43')](_0x241618)[_0xc16c('0x1f')](handleEntityNotFound(_0x2330c4,null))[_0xc16c('0x1f')](respondWithResult(_0x2330c4,null))[_0xc16c('0x41')](handleError(_0x2330c4,null));};exports[_0xc16c('0x44')]=function(_0x2b7ee5,_0x4bf6f1){return db['ZendeskField'][_0xc16c('0x44')](_0x2b7ee5['body'],{})[_0xc16c('0x1f')](respondWithResult(_0x4bf6f1,0xc9))[_0xc16c('0x41')](handleError(_0x4bf6f1,null));};exports['update']=function(_0xbdc0c7,_0x483fc1){if(_0xbdc0c7[_0xc16c('0x45')]['id']){delete _0xbdc0c7[_0xc16c('0x45')]['id'];}return db[_0xc16c('0x3c')][_0xc16c('0x43')]({'where':{'id':_0xbdc0c7[_0xc16c('0x46')]['id']}})[_0xc16c('0x1f')](handleEntityNotFound(_0x483fc1,null))['then'](saveUpdates(_0xbdc0c7[_0xc16c('0x45')],null))['then'](respondWithResult(_0x483fc1,null))[_0xc16c('0x41')](handleError(_0x483fc1,null));};exports['destroy']=function(_0x4f2f2b,_0x15ff96){return db[_0xc16c('0x3c')]['find']({'where':{'id':_0x4f2f2b['params']['id']}})['then'](handleEntityNotFound(_0x15ff96,null))['then'](removeEntity(_0x15ff96,null))[_0xc16c('0x41')](handleError(_0x15ff96,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index c01f343..3f98103 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 _0x3b57=['ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','bluebird','./intZendeskField.attributes','define'];(function(_0x50c492,_0x5c1e67){var _0x3505a8=function(_0x2f7937){while(--_0x2f7937){_0x50c492['push'](_0x50c492['shift']());}};_0x3505a8(++_0x5c1e67);}(_0x3b57,0xa5));var _0x73b5=function(_0x45bf48,_0x5dd33e){_0x45bf48=_0x45bf48-0x0;var _0x5299a0=_0x3b57[_0x45bf48];return _0x5299a0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x73b5('0x0'));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(_0x73b5('0x1'));module['exports']=function(_0x3b526e,_0x371d16){return _0x3b526e[_0x73b5('0x2')](_0x73b5('0x3'),attributes,{'tableName':_0x73b5('0x4'),'paranoid':![],'indexes':[{'name':_0x73b5('0x5'),'fields':[_0x73b5('0x6'),_0x73b5('0x7')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6db2=['api','moment','bluebird','request-promise','path','rimraf','ZendeskField','int_zendesk_fields','idField','FieldId','util'];(function(_0x3a4d09,_0x341a19){var _0x39ff52=function(_0x44e15f){while(--_0x44e15f){_0x3a4d09['push'](_0x3a4d09['shift']());}};_0x39ff52(++_0x341a19);}(_0x6db2,0x16a));var _0x26db=function(_0x1526a9,_0x48fb64){_0x1526a9=_0x1526a9-0x0;var _0x9f4049=_0x6db2[_0x1526a9];return _0x9f4049;};'use strict';var _=require('lodash');var util=require(_0x26db('0x0'));var logger=require('../../config/logger')(_0x26db('0x1'));var moment=require(_0x26db('0x2'));var BPromise=require(_0x26db('0x3'));var rp=require(_0x26db('0x4'));var fs=require('fs');var path=require(_0x26db('0x5'));var rimraf=require(_0x26db('0x6'));var config=require('../../config/environment');var attributes=require('./intZendeskField.attributes');module['exports']=function(_0x2dbe3a,_0x179b70){return _0x2dbe3a['define'](_0x26db('0x7'),attributes,{'tableName':_0x26db('0x8'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x26db('0x9'),_0x26db('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 98284af..dd39525 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 _0x26f9=['jayson/promise','client','http','then','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x26f9,0x16f));var _0x926f=function(_0x15b1cd,_0x2db0c5){_0x15b1cd=_0x15b1cd-0x0;var _0x73f160=_0x26f9[_0x15b1cd];return _0x73f160;};'use strict';var _=require(_0x926f('0x0'));var util=require(_0x926f('0x1'));var moment=require('moment');var BPromise=require(_0x926f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x926f('0x3'))['db'];var utils=require(_0x926f('0x4'));var logger=require('../../config/logger')(_0x926f('0x5'));var config=require(_0x926f('0x6'));var jayson=require(_0x926f('0x7'));var client=jayson[_0x926f('0x8')][_0x926f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d2ded,_0xf56fcb,_0x1e455d){return new BPromise(function(_0x41a7ed,_0x2af11e){return client['request'](_0x3d2ded,_0x1e455d)[_0x926f('0xa')](function(_0x593c13){logger[_0x926f('0xb')](_0x926f('0xc'),_0xf56fcb,'request\x20sent');logger[_0x926f('0xd')](_0x926f('0xe'),_0xf56fcb,_0x926f('0xf'),JSON[_0x926f('0x10')](_0x593c13));if(_0x593c13[_0x926f('0x11')]){if(_0x593c13['error'][_0x926f('0x12')]===0x1f4){logger[_0x926f('0x11')](_0x926f('0xc'),_0xf56fcb,_0x593c13[_0x926f('0x11')][_0x926f('0x13')]);return _0x2af11e(_0x593c13[_0x926f('0x11')][_0x926f('0x13')]);}logger['error']('ZendeskField,\x20%s,\x20%s',_0xf56fcb,_0x593c13['error'][_0x926f('0x13')]);return _0x41a7ed(_0x593c13[_0x926f('0x11')][_0x926f('0x13')]);}else{logger[_0x926f('0xb')]('ZendeskField,\x20%s,\x20%s',_0xf56fcb,_0x926f('0xf'));_0x41a7ed(_0x593c13[_0x926f('0x14')]['message']);}})[_0x926f('0x15')](function(_0x52865b){logger[_0x926f('0x11')]('ZendeskField,\x20%s,\x20%s',_0xf56fcb,_0x52865b);_0x2af11e(_0x52865b);});});} \ No newline at end of file +var _0x9ffd=['ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ZendeskField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x1e22d6,_0x25605f){var _0x397cc4=function(_0x4339fa){while(--_0x4339fa){_0x1e22d6['push'](_0x1e22d6['shift']());}};_0x397cc4(++_0x25605f);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x45dade,_0x148dd2){_0x45dade=_0x45dade-0x0;var _0x47df61=_0x9ffd[_0x45dade];return _0x47df61;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('ZendeskField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('ZendeskField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('ZendeskField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 19adb22..91e2675 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 _0x1775=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports'];(function(_0x1bb286,_0x2accb2){var _0x28d2ca=function(_0x40a739){while(--_0x40a739){_0x1bb286['push'](_0x1bb286['shift']());}};_0x28d2ca(++_0x2accb2);}(_0x1775,0x1db));var _0x5177=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1775[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x5177('0x0'));var path=require(_0x5177('0x1'));var timeout=require(_0x5177('0x2'));var express=require(_0x5177('0x3'));var router=express[_0x5177('0x4')]();var auth=require(_0x5177('0x5'));var interaction=require(_0x5177('0x6'));var config=require(_0x5177('0x7'));var controller=require(_0x5177('0x8'));router[_0x5177('0x9')]('/',auth[_0x5177('0xa')](),controller[_0x5177('0xb')]);router[_0x5177('0x9')](_0x5177('0xc'),auth[_0x5177('0xa')](),controller[_0x5177('0xd')]);router[_0x5177('0x9')](_0x5177('0xe'),auth[_0x5177('0xa')](),controller[_0x5177('0xf')]);router[_0x5177('0x9')](_0x5177('0x10'),auth['isAuthenticated'](),controller['getFields']);router[_0x5177('0x11')]('/',auth[_0x5177('0xa')](),controller[_0x5177('0x12')]);router[_0x5177('0x11')](_0x5177('0xe'),auth['isAuthenticated'](),controller[_0x5177('0x13')]);router[_0x5177('0x14')](_0x5177('0xc'),auth[_0x5177('0xa')](),controller[_0x5177('0x15')]);router[_0x5177('0x16')](_0x5177('0xc'),auth[_0x5177('0xa')](),controller[_0x5177('0x17')]);module[_0x5177('0x18')]=router; \ No newline at end of file +var _0xf7b4=['express','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','update','delete','destroy','exports','multer','connect-timeout'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xf7b4,0x152));var _0x4f7b=function(_0x4cbca9,_0x1018ee){_0x4cbca9=_0x4cbca9-0x0;var _0x511c83=_0xf7b4[_0x4cbca9];return _0x511c83;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f7b('0x1'));var express=require(_0x4f7b('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4f7b('0x3'));var config=require(_0x4f7b('0x4'));var controller=require(_0x4f7b('0x5'));router[_0x4f7b('0x6')]('/',auth[_0x4f7b('0x7')](),controller[_0x4f7b('0x8')]);router[_0x4f7b('0x6')](_0x4f7b('0x9'),auth[_0x4f7b('0x7')](),controller[_0x4f7b('0xa')]);router[_0x4f7b('0x6')](_0x4f7b('0xb'),auth[_0x4f7b('0x7')](),controller['getConfigurations']);router[_0x4f7b('0x6')](_0x4f7b('0xc'),auth['isAuthenticated'](),controller[_0x4f7b('0xd')]);router[_0x4f7b('0xe')]('/',auth[_0x4f7b('0x7')](),controller[_0x4f7b('0xf')]);router[_0x4f7b('0xe')]('/:id/configurations',auth[_0x4f7b('0x7')](),controller['addConfiguration']);router['put'](_0x4f7b('0x9'),auth[_0x4f7b('0x7')](),controller[_0x4f7b('0x10')]);router[_0x4f7b('0x11')]('/:id',auth[_0x4f7b('0x7')](),controller[_0x4f7b('0x12')]);module[_0x4f7b('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 6ba0bfd..af0178e 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 _0x7c55=['sequelize','exports','STRING'];(function(_0xc45f86,_0x420606){var _0x963e03=function(_0x3ccff5){while(--_0x3ccff5){_0xc45f86['push'](_0xc45f86['shift']());}};_0x963e03(++_0x420606);}(_0x7c55,0x1cb));var _0x57c5=function(_0x5a131f,_0x508107){_0x5a131f=_0x5a131f-0x0;var _0x17c832=_0x7c55[_0x5a131f];return _0x17c832;};'use strict';var Sequelize=require(_0x57c5('0x0'));module[_0x57c5('0x1')]={'name':{'type':Sequelize[_0x57c5('0x2')]},'description':{'type':Sequelize[_0x57c5('0x2')]},'authToken':{'type':Sequelize[_0x57c5('0x2')]},'host':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x57c5('0x2')]}}; \ No newline at end of file +var _0x5aac=['STRING'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x5aac,0x17f));var _0xc5aa=function(_0x17ed2c,_0x48eddd){_0x17ed2c=_0x17ed2c-0x0;var _0x1905be=_0x5aac[_0x17ed2c];return _0x1905be;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc5aa('0x0')]},'description':{'type':Sequelize[_0xc5aa('0x0')]},'authToken':{'type':Sequelize[_0xc5aa('0x0')]},'host':{'type':Sequelize[_0xc5aa('0x0')]},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index bc07772..55a900a 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 _0xbb47=['addConfiguration','Subjects','getSubjects','channel','Descriptions','getFields','host','authToken','slice','substring','GET','format','https://crm.%s/crm/private/json/Calls/getFields','crmapi','response','Calls','section','Call\x20Purpose','includes','push','label','customfield','true','Pick\x20List','val','statusCode','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','count','offset','limit','apply','reject','save','update','destroy','end','sendStatus','name','send','index','ZohoAccount','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','show','params','find','create','body','getConfigurations','findOne','ZohoConfiguration','nolimit'];(function(_0x2b0e82,_0x2e2103){var _0x53d84d=function(_0x148a99){while(--_0x148a99){_0x2b0e82['push'](_0x2b0e82['shift']());}};_0x53d84d(++_0x2e2103);}(_0xbb47,0x1de));var _0x7bb4=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xbb47[_0x3b5250];return _0xc844a1;};'use strict';var pdf=require(_0x7bb4('0x0'));var emlformat=require(_0x7bb4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7bb4('0x2'));var jsonpatch=require(_0x7bb4('0x3'));var rp=require(_0x7bb4('0x4'));var moment=require(_0x7bb4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7bb4('0x6'));var util=require(_0x7bb4('0x7'));var path=require(_0x7bb4('0x8'));var sox=require(_0x7bb4('0x9'));var csv=require(_0x7bb4('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x7bb4('0xb'));var crypto=require(_0x7bb4('0xc'));var jsforce=require(_0x7bb4('0xd'));var deskjs=require(_0x7bb4('0xe'));var toCsv=require(_0x7bb4('0xa'));var querystring=require('querystring');var Papa=require(_0x7bb4('0xf'));var Redis=require(_0x7bb4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7bb4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7bb4('0x12'));var utils=require(_0x7bb4('0x13'));var config=require('../../config/environment');var db=require(_0x7bb4('0x14'))['db'];var integrations=require(_0x7bb4('0x15'));var jayson=require(_0x7bb4('0x16'));var client=jayson['client'][_0x7bb4('0x17')]({'port':0x232a});function checkPasswordPattern(_0x527048,_0x1230b2,_0x4d0f93){if(_0x4d0f93){var _0x296df9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x296df9[_0x7bb4('0x18')](_0x1230b2)){return _0x527048;}else{throw new Error(_0x7bb4('0x19'));}}else{return _0x527048;}}function respondWithRpcPromise(_0x45b2e2,_0x2662ec,_0x517812,_0x5b4d09){return new BPromise(function(_0x26c3d5,_0x40c865){var _0x519a7e=_0x5b4d09||client;return _0x519a7e[_0x7bb4('0x1a')](_0x45b2e2,_0x517812)[_0x7bb4('0x1b')](function(_0x28fd49){logger[_0x7bb4('0x1c')](_0x7bb4('0x1d'),_0x2662ec,_0x7bb4('0x1e'));logger[_0x7bb4('0x1f')](_0x7bb4('0x20'),_0x2662ec,_0x7bb4('0x1e'),JSON[_0x7bb4('0x21')](_0x28fd49));if(_0x28fd49[_0x7bb4('0x22')]){if(_0x28fd49[_0x7bb4('0x22')][_0x7bb4('0x23')]===0x1f4){logger[_0x7bb4('0x22')]('ZohoAccount,\x20%s,\x20%s',_0x2662ec,_0x28fd49['error'][_0x7bb4('0x24')]);return _0x40c865(_0x28fd49[_0x7bb4('0x22')][_0x7bb4('0x24')]);}logger[_0x7bb4('0x22')](_0x7bb4('0x1d'),_0x2662ec,_0x28fd49['error'][_0x7bb4('0x24')]);return _0x26c3d5(_0x28fd49[_0x7bb4('0x22')][_0x7bb4('0x24')]);}else{logger[_0x7bb4('0x1c')]('ZohoAccount,\x20%s,\x20%s',_0x2662ec,_0x7bb4('0x1e'));_0x26c3d5(_0x28fd49['result']['message']);}})[_0x7bb4('0x25')](function(_0x4b482e){logger['error'](_0x7bb4('0x1d'),_0x2662ec,_0x4b482e);_0x40c865(_0x4b482e);});});}function respondWithStatusCode(_0x22e86d,_0x21b7ad){_0x21b7ad=_0x21b7ad||0xcc;return function(_0xfb69e3){if(_0xfb69e3){return _0x22e86d['sendStatus'](_0x21b7ad);}return _0x22e86d[_0x7bb4('0x26')](_0x21b7ad)['end']();};}function respondWithResult(_0x576f85,_0x895fe){_0x895fe=_0x895fe||0xc8;return function(_0x5d8934){if(_0x5d8934){return _0x576f85['status'](_0x895fe)[_0x7bb4('0x27')](_0x5d8934);}};}function respondWithFilteredResult(_0x10b9d0,_0xbbf48c){return function(_0x5eb363){if(_0x5eb363){var _0x5cc31c=_0x5eb363[_0x7bb4('0x28')],_0xd06aca=_0xbbf48c[_0x7bb4('0x29')],_0xf53154=_0xbbf48c[_0x7bb4('0x29')]+_0xbbf48c[_0x7bb4('0x2a')],_0x5b780a;if(_0xf53154>=_0x5cc31c){_0xf53154=_0x5cc31c;_0x5b780a=0xc8;}else{_0x5b780a=0xce;}_0x10b9d0[_0x7bb4('0x26')](_0x5b780a);return _0x10b9d0['set']('Content-Range',_0xd06aca+'-'+_0xf53154+'/'+_0x5cc31c)['json'](_0x5eb363);}return null;};}function patchUpdates(_0x2f094a){return function(_0x5f03b4){try{jsonpatch[_0x7bb4('0x2b')](_0x5f03b4,_0x2f094a,!![]);}catch(_0x37be8f){return BPromise[_0x7bb4('0x2c')](_0x37be8f);}return _0x5f03b4[_0x7bb4('0x2d')]();};}function saveUpdates(_0x400df7,_0x29b105){return function(_0x4c6b2b){if(_0x4c6b2b){return _0x4c6b2b[_0x7bb4('0x2e')](_0x400df7)[_0x7bb4('0x1b')](function(_0x14fcf4){return _0x14fcf4;});}return null;};}function removeEntity(_0x588b80,_0x2d87f7){return function(_0x4e7d32){if(_0x4e7d32){return _0x4e7d32[_0x7bb4('0x2f')]()['then'](function(){_0x588b80[_0x7bb4('0x26')](0xcc)[_0x7bb4('0x30')]();});}};}function handleEntityNotFound(_0x359bdc,_0x425dd1){return function(_0x424740){if(!_0x424740){_0x359bdc[_0x7bb4('0x31')](0x194);}return _0x424740;};}function handleError(_0x388a7f,_0xe9da13){_0xe9da13=_0xe9da13||0x1f4;return function(_0x513428){logger['error'](_0x513428['stack']);if(_0x513428[_0x7bb4('0x32')]){delete _0x513428[_0x7bb4('0x32')];}_0x388a7f[_0x7bb4('0x26')](_0xe9da13)[_0x7bb4('0x33')](_0x513428);};}exports[_0x7bb4('0x34')]=function(_0x1bf594,_0x3ec1db){var _0x21145a={},_0x587aa7={},_0x40f4f6={'count':0x0,'rows':[]};var _0xbdf5dc=db[_0x7bb4('0x35')][_0x7bb4('0x36')];_0x587aa7['model']=_[_0x7bb4('0x37')](_0xbdf5dc);_0x587aa7[_0x7bb4('0x38')]=_['keys'](_0x1bf594[_0x7bb4('0x38')]);_0x587aa7[_0x7bb4('0x39')]=_[_0x7bb4('0x3a')](_0x587aa7[_0x7bb4('0x3b')],_0x587aa7[_0x7bb4('0x38')]);_0x21145a['attributes']=_[_0x7bb4('0x3a')](_0x587aa7['model'],qs['fields'](_0x1bf594[_0x7bb4('0x38')][_0x7bb4('0x3c')]));_0x21145a[_0x7bb4('0x3d')]=_0x21145a[_0x7bb4('0x3d')][_0x7bb4('0x3e')]?_0x21145a[_0x7bb4('0x3d')]:_0x587aa7[_0x7bb4('0x3b')];if(!_0x1bf594[_0x7bb4('0x38')][_0x7bb4('0x3f')]('nolimit')){_0x21145a[_0x7bb4('0x2a')]=qs['limit'](_0x1bf594[_0x7bb4('0x38')][_0x7bb4('0x2a')]);_0x21145a[_0x7bb4('0x29')]=qs['offset'](_0x1bf594[_0x7bb4('0x38')][_0x7bb4('0x29')]);}_0x21145a[_0x7bb4('0x40')]=qs[_0x7bb4('0x41')](_0x1bf594[_0x7bb4('0x38')][_0x7bb4('0x41')]);_0x21145a[_0x7bb4('0x42')]=qs[_0x7bb4('0x39')](_[_0x7bb4('0x43')](_0x1bf594['query'],_0x587aa7[_0x7bb4('0x39')]));if(_0x1bf594['query'][_0x7bb4('0x44')]){_0x21145a['where']=_[_0x7bb4('0x45')](_0x21145a[_0x7bb4('0x42')],{'$or':_[_0x7bb4('0x46')](_0xbdf5dc,function(_0x1e444c){if(_0x1e444c[_0x7bb4('0x47')]['key']!==_0x7bb4('0x48')){var _0x3b4dfe={};_0x3b4dfe[_0x1e444c[_0x7bb4('0x49')]]={'$like':'%'+_0x1bf594[_0x7bb4('0x38')][_0x7bb4('0x44')]+'%'};return _0x3b4dfe;}})});}_0x21145a=_[_0x7bb4('0x45')]({},_0x21145a,_0x1bf594[_0x7bb4('0x4a')]);var _0x2eb776={'where':_0x21145a[_0x7bb4('0x42')]};return db[_0x7bb4('0x35')]['count'](_0x2eb776)[_0x7bb4('0x1b')](function(_0x25f015){_0x40f4f6[_0x7bb4('0x28')]=_0x25f015;if(_0x1bf594['query'][_0x7bb4('0x4b')]){_0x21145a[_0x7bb4('0x4c')]=[{'all':!![]}];}return db[_0x7bb4('0x35')]['findAll'](_0x21145a);})['then'](function(_0x32f9a0){_0x40f4f6[_0x7bb4('0x4d')]=_0x32f9a0;return _0x40f4f6;})['then'](respondWithFilteredResult(_0x3ec1db,_0x21145a))[_0x7bb4('0x25')](handleError(_0x3ec1db,null));};exports[_0x7bb4('0x4e')]=function(_0x16f9d4,_0x5aad0d){var _0x529bb6={'raw':![],'where':{'id':_0x16f9d4[_0x7bb4('0x4f')]['id']}},_0x5554b7={};_0x5554b7[_0x7bb4('0x3b')]=_[_0x7bb4('0x37')](db['ZohoAccount'][_0x7bb4('0x36')]);_0x5554b7['query']=_[_0x7bb4('0x37')](_0x16f9d4[_0x7bb4('0x38')]);_0x5554b7[_0x7bb4('0x39')]=_[_0x7bb4('0x3a')](_0x5554b7['model'],_0x5554b7[_0x7bb4('0x38')]);_0x529bb6[_0x7bb4('0x3d')]=_[_0x7bb4('0x3a')](_0x5554b7['model'],qs[_0x7bb4('0x3c')](_0x16f9d4['query'][_0x7bb4('0x3c')]));_0x529bb6['attributes']=_0x529bb6[_0x7bb4('0x3d')]['length']?_0x529bb6[_0x7bb4('0x3d')]:_0x5554b7[_0x7bb4('0x3b')];if(_0x16f9d4[_0x7bb4('0x38')][_0x7bb4('0x4b')]){_0x529bb6[_0x7bb4('0x4c')]=[{'all':!![]}];}_0x529bb6=_[_0x7bb4('0x45')]({},_0x529bb6,_0x16f9d4[_0x7bb4('0x4a')]);return db[_0x7bb4('0x35')][_0x7bb4('0x50')](_0x529bb6)[_0x7bb4('0x1b')](handleEntityNotFound(_0x5aad0d,null))[_0x7bb4('0x1b')](respondWithResult(_0x5aad0d,null))[_0x7bb4('0x25')](handleError(_0x5aad0d,null));};exports['create']=function(_0x4cd17f,_0x5a5f7c){return db[_0x7bb4('0x35')][_0x7bb4('0x51')](_0x4cd17f[_0x7bb4('0x52')],{})[_0x7bb4('0x1b')](respondWithResult(_0x5a5f7c,0xc9))['catch'](handleError(_0x5a5f7c,null));};exports[_0x7bb4('0x2e')]=function(_0xe68e49,_0x177653){if(_0xe68e49[_0x7bb4('0x52')]['id']){delete _0xe68e49[_0x7bb4('0x52')]['id'];}return db[_0x7bb4('0x35')][_0x7bb4('0x50')]({'where':{'id':_0xe68e49['params']['id']}})['then'](handleEntityNotFound(_0x177653,null))['then'](saveUpdates(_0xe68e49[_0x7bb4('0x52')],null))[_0x7bb4('0x1b')](respondWithResult(_0x177653,null))[_0x7bb4('0x25')](handleError(_0x177653,null));};exports[_0x7bb4('0x2f')]=function(_0x2bd1c8,_0x5b5a88){return db[_0x7bb4('0x35')][_0x7bb4('0x50')]({'where':{'id':_0x2bd1c8['params']['id']}})['then'](handleEntityNotFound(_0x5b5a88,null))[_0x7bb4('0x1b')](removeEntity(_0x5b5a88,null))[_0x7bb4('0x25')](handleError(_0x5b5a88,null));};exports[_0x7bb4('0x53')]=function(_0x1dbe71,_0x287bae,_0x1dd6f1){var _0x11b975={};var _0x37a89d={};var _0x4609a7;var _0x5df33d;return db[_0x7bb4('0x35')][_0x7bb4('0x54')]({'where':{'id':_0x1dbe71[_0x7bb4('0x4f')]['id']}})[_0x7bb4('0x1b')](handleEntityNotFound(_0x287bae,null))[_0x7bb4('0x1b')](function(_0x3c0f41){if(_0x3c0f41){_0x4609a7=_0x3c0f41;_0x37a89d[_0x7bb4('0x3b')]=_['keys'](db[_0x7bb4('0x55')][_0x7bb4('0x36')]);_0x37a89d[_0x7bb4('0x38')]=_[_0x7bb4('0x37')](_0x1dbe71[_0x7bb4('0x38')]);_0x37a89d['filters']=_[_0x7bb4('0x3a')](_0x37a89d[_0x7bb4('0x3b')],_0x37a89d[_0x7bb4('0x38')]);_0x11b975[_0x7bb4('0x3d')]=_[_0x7bb4('0x3a')](_0x37a89d[_0x7bb4('0x3b')],qs[_0x7bb4('0x3c')](_0x1dbe71['query'][_0x7bb4('0x3c')]));_0x11b975['attributes']=_0x11b975[_0x7bb4('0x3d')]['length']?_0x11b975[_0x7bb4('0x3d')]:_0x37a89d[_0x7bb4('0x3b')];_0x11b975['order']=qs[_0x7bb4('0x41')](_0x1dbe71[_0x7bb4('0x38')][_0x7bb4('0x41')]);_0x11b975['where']=qs[_0x7bb4('0x39')](_[_0x7bb4('0x43')](_0x1dbe71[_0x7bb4('0x38')],_0x37a89d['filters']));if(_0x1dbe71[_0x7bb4('0x38')][_0x7bb4('0x44')]){_0x11b975['where']=_[_0x7bb4('0x45')](_0x11b975[_0x7bb4('0x42')],{'$or':_[_0x7bb4('0x46')](_0x11b975[_0x7bb4('0x3d')],function(_0x5123fb){var _0x456faa={};_0x456faa[_0x5123fb]={'$like':'%'+_0x1dbe71[_0x7bb4('0x38')][_0x7bb4('0x44')]+'%'};return _0x456faa;})});}_0x11b975=_[_0x7bb4('0x45')]({},_0x11b975,_0x1dbe71[_0x7bb4('0x4a')]);return _0x4609a7[_0x7bb4('0x53')](_0x11b975);}})[_0x7bb4('0x1b')](function(_0x284834){if(_0x284834){_0x5df33d=_0x284834['length'];if(!_0x1dbe71['query']['hasOwnProperty'](_0x7bb4('0x56'))){_0x11b975[_0x7bb4('0x2a')]=qs[_0x7bb4('0x2a')](_0x1dbe71[_0x7bb4('0x38')][_0x7bb4('0x2a')]);_0x11b975[_0x7bb4('0x29')]=qs[_0x7bb4('0x29')](_0x1dbe71[_0x7bb4('0x38')]['offset']);}return _0x4609a7[_0x7bb4('0x53')](_0x11b975);}})[_0x7bb4('0x1b')](function(_0x5f5cdc){if(_0x5f5cdc){return _0x5f5cdc?{'count':_0x5df33d,'rows':_0x5f5cdc}:null;}})[_0x7bb4('0x1b')](respondWithResult(_0x287bae,null))['catch'](handleError(_0x287bae,null));};exports[_0x7bb4('0x57')]=function(_0xe45003,_0x362f9d,_0x307d94){if(_0xe45003['body']['id']){delete _0xe45003['body']['id'];}return db[_0x7bb4('0x35')]['findOne']({'where':{'id':_0xe45003[_0x7bb4('0x4f')]['id']}})['then'](handleEntityNotFound(_0x362f9d,null))[_0x7bb4('0x1b')](function(_0xff249e){if(_0xff249e){_0xe45003[_0x7bb4('0x52')]['AccountId']=_0xff249e['id'];_0xe45003[_0x7bb4('0x52')][_0x7bb4('0x58')]=integrations[_0x7bb4('0x59')](_0xe45003['body'][_0x7bb4('0x5a')],_0xe45003['body'][_0x7bb4('0x47')]);_0xe45003[_0x7bb4('0x52')][_0x7bb4('0x5b')]=integrations['getDescriptions'](_0xe45003[_0x7bb4('0x52')][_0x7bb4('0x5a')],_0xe45003[_0x7bb4('0x52')]['type']);return db[_0x7bb4('0x55')][_0x7bb4('0x51')](_0xe45003[_0x7bb4('0x52')],{'include':[{'model':db['ZohoField'],'as':_0x7bb4('0x58')},{'model':db['ZohoField'],'as':_0x7bb4('0x5b')}]});}return null;})['then'](respondWithResult(_0x362f9d,null))[_0x7bb4('0x25')](handleError(_0x362f9d,null));};exports[_0x7bb4('0x5c')]=function(_0x172621,_0x43ff69,_0x4c4793){var _0x532564='';return db['ZohoAccount'][_0x7bb4('0x54')]({'where':{'id':_0x172621[_0x7bb4('0x4f')]['id']},'attributes':['id',_0x7bb4('0x5d'),_0x7bb4('0x5e')]})[_0x7bb4('0x1b')](handleEntityNotFound(_0x43ff69,null))[_0x7bb4('0x1b')](function(_0x23c580){if(_0x23c580){_0x532564=_0x23c580['host'];var _0x4d984c=_0x532564[_0x7bb4('0x5f')](-0x1);if(_0x4d984c==='/'){_0x532564=_0x532564[_0x7bb4('0x60')](0x0,_0x532564['lastIndexOf'](_0x4d984c));}return rp({'method':_0x7bb4('0x61'),'uri':util[_0x7bb4('0x62')](_0x7bb4('0x63'),_0x532564),'qs':{'authtoken':_0x23c580[_0x7bb4('0x5e')],'scope':_0x7bb4('0x64')},'json':!![]});}})[_0x7bb4('0x1b')](function(_0x3b3de6){if(_0x3b3de6){if(_0x3b3de6['response']&&_0x3b3de6[_0x7bb4('0x65')][_0x7bb4('0x22')]){throw new Error(_0x3b3de6[_0x7bb4('0x65')][_0x7bb4('0x22')][_0x7bb4('0x24')]);}var _0x28d5ca=[];if(_0x3b3de6[_0x7bb4('0x66')]&&_0x3b3de6['Calls'][_0x7bb4('0x67')]){if(_0x3b3de6[_0x7bb4('0x66')][_0x7bb4('0x67')]['FL']){var _0x529544=[_0x7bb4('0x68')];for(var _0x25b021=0x0,_0x58b8f1=_0x3b3de6[_0x7bb4('0x66')][_0x7bb4('0x67')]['FL'][_0x7bb4('0x3e')];_0x25b021<_0x58b8f1;_0x25b021++){if(_[_0x7bb4('0x69')](_0x529544,_0x3b3de6['Calls']['section']['FL'][_0x25b021]['dv'])){_0x28d5ca[_0x7bb4('0x6a')]({'id':_0x3b3de6['Calls'][_0x7bb4('0x67')]['FL'][_0x25b021]['dv'],'name':_0x3b3de6[_0x7bb4('0x66')]['section']['FL'][_0x25b021][_0x7bb4('0x6b')],'custom':_0x3b3de6[_0x7bb4('0x66')][_0x7bb4('0x67')]['FL'][_0x25b021][_0x7bb4('0x6c')]===_0x7bb4('0x6d')?!![]:![],'options':_0x3b3de6[_0x7bb4('0x66')][_0x7bb4('0x67')]['FL'][_0x25b021][_0x7bb4('0x47')]===_0x7bb4('0x6e')&&_0x3b3de6[_0x7bb4('0x66')][_0x7bb4('0x67')]['FL'][_0x25b021][_0x7bb4('0x6f')]?_[_0x7bb4('0x46')](_0x3b3de6[_0x7bb4('0x66')]['section']['FL'][_0x25b021][_0x7bb4('0x6f')],function(_0xcef511){return{'name':_0xcef511,'value':_0xcef511};}):[]});}}}}return{'count':_0x28d5ca['length'],'rows':_0x28d5ca};}})[_0x7bb4('0x1b')](respondWithResult(_0x43ff69,null))[_0x7bb4('0x25')](function(_0xd29b07){var _0x276e02=_0x172621['query'][_0x7bb4('0x18')]?0x1f4:_0xd29b07[_0x7bb4('0x70')]||0x1f4;logger[_0x7bb4('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0x7bb4('0x5c'),_0x276e02,JSON['stringify'](_0xd29b07));delete _0xd29b07[_0x7bb4('0x32')];if(_0x276e02===0x191){_0x276e02=0x190;}_0x43ff69['status'](_0x276e02)['send'](_0x172621['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0xd29b07[_0x7bb4('0x70')]}:_0xd29b07);});}; \ No newline at end of file +var _0xab5c=['ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','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','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','status','end','json','count','set','Content-Range','apply','save','update','destroy','stack','name','send','index','ZohoAccount','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','offset','order','sort','pick','filter','where','merge','map','type','key','options','includeAll','findAll','rows','show','include','find','create','body','params','getConfigurations','findOne','ZohoConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','getFields','host','lastIndexOf','GET','https://crm.%s/crm/private/json/Calls/getFields','authToken','crmapi','response','Calls','Call\x20Purpose','section','label','customfield','true','Pick\x20List','val','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','squel','to-csv','querystring','papaparse'];(function(_0x566a62,_0x2c50f5){var _0x490904=function(_0x3bcc1e){while(--_0x3bcc1e){_0x566a62['push'](_0x566a62['shift']());}};_0x490904(++_0x2c50f5);}(_0xab5c,0x67));var _0xcab5=function(_0x1cb5fd,_0x19cb29){_0x1cb5fd=_0x1cb5fd-0x0;var _0x5f406e=_0xab5c[_0x1cb5fd];return _0x5f406e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcab5('0x0'));var rimraf=require(_0xcab5('0x1'));var zipdir=require(_0xcab5('0x2'));var jsonpatch=require(_0xcab5('0x3'));var rp=require('request-promise');var moment=require(_0xcab5('0x4'));var BPromise=require(_0xcab5('0x5'));var Mustache=require(_0xcab5('0x6'));var util=require('util');var path=require(_0xcab5('0x7'));var sox=require(_0xcab5('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xcab5('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcab5('0xa'));var querystring=require(_0xcab5('0xb'));var Papa=require(_0xcab5('0xc'));var Redis=require(_0xcab5('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xcab5('0xe'));var hardwareService=require(_0xcab5('0xf'));var logger=require(_0xcab5('0x10'))(_0xcab5('0x11'));var utils=require(_0xcab5('0x12'));var config=require(_0xcab5('0x13'));var db=require(_0xcab5('0x14'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xcab5('0x15'));var client=jayson[_0xcab5('0x16')][_0xcab5('0x17')]({'port':0x232a});function checkPasswordPattern(_0x38c8c2,_0x1e9add,_0xf228e9){if(_0xf228e9){var _0x4fcef3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4fcef3['test'](_0x1e9add)){return _0x38c8c2;}else{throw new Error(_0xcab5('0x18'));}}else{return _0x38c8c2;}}function respondWithRpcPromise(_0x273676,_0x27c439,_0x58f980,_0x399a3a){return new BPromise(function(_0x394646,_0xdd9547){var _0x5a188c=_0x399a3a||client;return _0x5a188c[_0xcab5('0x19')](_0x273676,_0x58f980)[_0xcab5('0x1a')](function(_0x40051f){logger[_0xcab5('0x1b')](_0xcab5('0x1c'),_0x27c439,'request\x20sent');logger[_0xcab5('0x1d')](_0xcab5('0x1e'),_0x27c439,'request\x20sent',JSON[_0xcab5('0x1f')](_0x40051f));if(_0x40051f[_0xcab5('0x20')]){if(_0x40051f[_0xcab5('0x20')][_0xcab5('0x21')]===0x1f4){logger[_0xcab5('0x20')](_0xcab5('0x1c'),_0x27c439,_0x40051f[_0xcab5('0x20')][_0xcab5('0x22')]);return _0xdd9547(_0x40051f[_0xcab5('0x20')][_0xcab5('0x22')]);}logger['error'](_0xcab5('0x1c'),_0x27c439,_0x40051f[_0xcab5('0x20')][_0xcab5('0x22')]);return _0x394646(_0x40051f[_0xcab5('0x20')][_0xcab5('0x22')]);}else{logger[_0xcab5('0x1b')](_0xcab5('0x1c'),_0x27c439,_0xcab5('0x23'));_0x394646(_0x40051f[_0xcab5('0x24')][_0xcab5('0x22')]);}})[_0xcab5('0x25')](function(_0x1f6112){logger[_0xcab5('0x20')]('ZohoAccount,\x20%s,\x20%s',_0x27c439,_0x1f6112);_0xdd9547(_0x1f6112);});});}function respondWithStatusCode(_0x56865d,_0x195467){_0x195467=_0x195467||0xcc;return function(_0x2ad21e){if(_0x2ad21e){return _0x56865d['sendStatus'](_0x195467);}return _0x56865d[_0xcab5('0x26')](_0x195467)[_0xcab5('0x27')]();};}function respondWithResult(_0x3486da,_0xa387f5){_0xa387f5=_0xa387f5||0xc8;return function(_0x3f9af5){if(_0x3f9af5){return _0x3486da[_0xcab5('0x26')](_0xa387f5)[_0xcab5('0x28')](_0x3f9af5);}};}function respondWithFilteredResult(_0x4d7b17,_0x159f87){return function(_0x14f642){if(_0x14f642){var _0xf3de9a=_0x14f642[_0xcab5('0x29')],_0x2b94c1=_0x159f87['offset'],_0x48a4c0=_0x159f87['offset']+_0x159f87['limit'],_0x55e0bd;if(_0x48a4c0>=_0xf3de9a){_0x48a4c0=_0xf3de9a;_0x55e0bd=0xc8;}else{_0x55e0bd=0xce;}_0x4d7b17[_0xcab5('0x26')](_0x55e0bd);return _0x4d7b17[_0xcab5('0x2a')](_0xcab5('0x2b'),_0x2b94c1+'-'+_0x48a4c0+'/'+_0xf3de9a)[_0xcab5('0x28')](_0x14f642);}return null;};}function patchUpdates(_0xf2603c){return function(_0x410221){try{jsonpatch[_0xcab5('0x2c')](_0x410221,_0xf2603c,!![]);}catch(_0x14972f){return BPromise['reject'](_0x14972f);}return _0x410221[_0xcab5('0x2d')]();};}function saveUpdates(_0x5a26e5,_0x180add){return function(_0x2473dd){if(_0x2473dd){return _0x2473dd[_0xcab5('0x2e')](_0x5a26e5)['then'](function(_0x50db38){return _0x50db38;});}return null;};}function removeEntity(_0xdfb685,_0xe7b447){return function(_0x183cd6){if(_0x183cd6){return _0x183cd6[_0xcab5('0x2f')]()[_0xcab5('0x1a')](function(){_0xdfb685[_0xcab5('0x26')](0xcc)[_0xcab5('0x27')]();});}};}function handleEntityNotFound(_0x2bd3c9,_0x36b43a){return function(_0x3a5b31){if(!_0x3a5b31){_0x2bd3c9['sendStatus'](0x194);}return _0x3a5b31;};}function handleError(_0x2b6175,_0x43029e){_0x43029e=_0x43029e||0x1f4;return function(_0x4e854d){logger[_0xcab5('0x20')](_0x4e854d[_0xcab5('0x30')]);if(_0x4e854d[_0xcab5('0x31')]){delete _0x4e854d[_0xcab5('0x31')];}_0x2b6175['status'](_0x43029e)[_0xcab5('0x32')](_0x4e854d);};}exports[_0xcab5('0x33')]=function(_0x2ab262,_0x5eb6ae){var _0x11ebe5={},_0x4bf0da={},_0x21166f={'count':0x0,'rows':[]};var _0x1d840e=db[_0xcab5('0x34')][_0xcab5('0x35')];_0x4bf0da['model']=_[_0xcab5('0x36')](_0x1d840e);_0x4bf0da[_0xcab5('0x37')]=_[_0xcab5('0x36')](_0x2ab262[_0xcab5('0x37')]);_0x4bf0da[_0xcab5('0x38')]=_[_0xcab5('0x39')](_0x4bf0da[_0xcab5('0x3a')],_0x4bf0da[_0xcab5('0x37')]);_0x11ebe5['attributes']=_[_0xcab5('0x39')](_0x4bf0da[_0xcab5('0x3a')],qs[_0xcab5('0x3b')](_0x2ab262[_0xcab5('0x37')]['fields']));_0x11ebe5[_0xcab5('0x3c')]=_0x11ebe5['attributes'][_0xcab5('0x3d')]?_0x11ebe5[_0xcab5('0x3c')]:_0x4bf0da[_0xcab5('0x3a')];if(!_0x2ab262['query'][_0xcab5('0x3e')]('nolimit')){_0x11ebe5[_0xcab5('0x3f')]=qs[_0xcab5('0x3f')](_0x2ab262['query'][_0xcab5('0x3f')]);_0x11ebe5[_0xcab5('0x40')]=qs[_0xcab5('0x40')](_0x2ab262[_0xcab5('0x37')][_0xcab5('0x40')]);}_0x11ebe5[_0xcab5('0x41')]=qs[_0xcab5('0x42')](_0x2ab262[_0xcab5('0x37')][_0xcab5('0x42')]);_0x11ebe5['where']=qs[_0xcab5('0x38')](_[_0xcab5('0x43')](_0x2ab262[_0xcab5('0x37')],_0x4bf0da[_0xcab5('0x38')]));if(_0x2ab262[_0xcab5('0x37')][_0xcab5('0x44')]){_0x11ebe5[_0xcab5('0x45')]=_[_0xcab5('0x46')](_0x11ebe5[_0xcab5('0x45')],{'$or':_[_0xcab5('0x47')](_0x1d840e,function(_0x287452){if(_0x287452[_0xcab5('0x48')][_0xcab5('0x49')]!=='VIRTUAL'){var _0x298aae={};_0x298aae[_0x287452['field']]={'$like':'%'+_0x2ab262['query'][_0xcab5('0x44')]+'%'};return _0x298aae;}})});}_0x11ebe5=_[_0xcab5('0x46')]({},_0x11ebe5,_0x2ab262[_0xcab5('0x4a')]);var _0x3ae25c={'where':_0x11ebe5[_0xcab5('0x45')]};return db[_0xcab5('0x34')][_0xcab5('0x29')](_0x3ae25c)['then'](function(_0x3b3f1e){_0x21166f['count']=_0x3b3f1e;if(_0x2ab262[_0xcab5('0x37')][_0xcab5('0x4b')]){_0x11ebe5['include']=[{'all':!![]}];}return db[_0xcab5('0x34')][_0xcab5('0x4c')](_0x11ebe5);})[_0xcab5('0x1a')](function(_0xf86b28){_0x21166f[_0xcab5('0x4d')]=_0xf86b28;return _0x21166f;})[_0xcab5('0x1a')](respondWithFilteredResult(_0x5eb6ae,_0x11ebe5))[_0xcab5('0x25')](handleError(_0x5eb6ae,null));};exports[_0xcab5('0x4e')]=function(_0x2ad87e,_0x5b9e89){var _0x4c728f={'raw':![],'where':{'id':_0x2ad87e['params']['id']}},_0x5d4690={};_0x5d4690[_0xcab5('0x3a')]=_[_0xcab5('0x36')](db[_0xcab5('0x34')][_0xcab5('0x35')]);_0x5d4690[_0xcab5('0x37')]=_['keys'](_0x2ad87e['query']);_0x5d4690['filters']=_[_0xcab5('0x39')](_0x5d4690['model'],_0x5d4690[_0xcab5('0x37')]);_0x4c728f[_0xcab5('0x3c')]=_['intersection'](_0x5d4690[_0xcab5('0x3a')],qs[_0xcab5('0x3b')](_0x2ad87e[_0xcab5('0x37')]['fields']));_0x4c728f[_0xcab5('0x3c')]=_0x4c728f['attributes']['length']?_0x4c728f[_0xcab5('0x3c')]:_0x5d4690[_0xcab5('0x3a')];if(_0x2ad87e[_0xcab5('0x37')][_0xcab5('0x4b')]){_0x4c728f[_0xcab5('0x4f')]=[{'all':!![]}];}_0x4c728f=_[_0xcab5('0x46')]({},_0x4c728f,_0x2ad87e[_0xcab5('0x4a')]);return db[_0xcab5('0x34')][_0xcab5('0x50')](_0x4c728f)[_0xcab5('0x1a')](handleEntityNotFound(_0x5b9e89,null))[_0xcab5('0x1a')](respondWithResult(_0x5b9e89,null))[_0xcab5('0x25')](handleError(_0x5b9e89,null));};exports['create']=function(_0x4e6afd,_0x103972){return db['ZohoAccount'][_0xcab5('0x51')](_0x4e6afd[_0xcab5('0x52')],{})['then'](respondWithResult(_0x103972,0xc9))[_0xcab5('0x25')](handleError(_0x103972,null));};exports['update']=function(_0x3b2008,_0x23ead0){if(_0x3b2008[_0xcab5('0x52')]['id']){delete _0x3b2008['body']['id'];}return db['ZohoAccount']['find']({'where':{'id':_0x3b2008['params']['id']}})[_0xcab5('0x1a')](handleEntityNotFound(_0x23ead0,null))[_0xcab5('0x1a')](saveUpdates(_0x3b2008['body'],null))[_0xcab5('0x1a')](respondWithResult(_0x23ead0,null))[_0xcab5('0x25')](handleError(_0x23ead0,null));};exports[_0xcab5('0x2f')]=function(_0x5ecf75,_0x2dbbc0){return db[_0xcab5('0x34')]['find']({'where':{'id':_0x5ecf75[_0xcab5('0x53')]['id']}})[_0xcab5('0x1a')](handleEntityNotFound(_0x2dbbc0,null))['then'](removeEntity(_0x2dbbc0,null))[_0xcab5('0x25')](handleError(_0x2dbbc0,null));};exports[_0xcab5('0x54')]=function(_0x31f6b8,_0x4e0fab,_0x46c0f4){var _0x7d3ab4={};var _0x305ab2={};var _0x4c2020;var _0x5e0e49;return db[_0xcab5('0x34')][_0xcab5('0x55')]({'where':{'id':_0x31f6b8[_0xcab5('0x53')]['id']}})[_0xcab5('0x1a')](handleEntityNotFound(_0x4e0fab,null))[_0xcab5('0x1a')](function(_0x46c80e){if(_0x46c80e){_0x4c2020=_0x46c80e;_0x305ab2[_0xcab5('0x3a')]=_[_0xcab5('0x36')](db[_0xcab5('0x56')]['rawAttributes']);_0x305ab2['query']=_[_0xcab5('0x36')](_0x31f6b8[_0xcab5('0x37')]);_0x305ab2[_0xcab5('0x38')]=_[_0xcab5('0x39')](_0x305ab2['model'],_0x305ab2[_0xcab5('0x37')]);_0x7d3ab4[_0xcab5('0x3c')]=_['intersection'](_0x305ab2['model'],qs[_0xcab5('0x3b')](_0x31f6b8[_0xcab5('0x37')][_0xcab5('0x3b')]));_0x7d3ab4[_0xcab5('0x3c')]=_0x7d3ab4[_0xcab5('0x3c')][_0xcab5('0x3d')]?_0x7d3ab4['attributes']:_0x305ab2['model'];_0x7d3ab4[_0xcab5('0x41')]=qs[_0xcab5('0x42')](_0x31f6b8['query'][_0xcab5('0x42')]);_0x7d3ab4['where']=qs['filters'](_[_0xcab5('0x43')](_0x31f6b8[_0xcab5('0x37')],_0x305ab2['filters']));if(_0x31f6b8[_0xcab5('0x37')][_0xcab5('0x44')]){_0x7d3ab4[_0xcab5('0x45')]=_[_0xcab5('0x46')](_0x7d3ab4[_0xcab5('0x45')],{'$or':_[_0xcab5('0x47')](_0x7d3ab4[_0xcab5('0x3c')],function(_0x45cdc1){var _0x13a41c={};_0x13a41c[_0x45cdc1]={'$like':'%'+_0x31f6b8[_0xcab5('0x37')][_0xcab5('0x44')]+'%'};return _0x13a41c;})});}_0x7d3ab4=_[_0xcab5('0x46')]({},_0x7d3ab4,_0x31f6b8['options']);return _0x4c2020[_0xcab5('0x54')](_0x7d3ab4);}})[_0xcab5('0x1a')](function(_0x3fd748){if(_0x3fd748){_0x5e0e49=_0x3fd748[_0xcab5('0x3d')];if(!_0x31f6b8['query'][_0xcab5('0x3e')](_0xcab5('0x57'))){_0x7d3ab4['limit']=qs[_0xcab5('0x3f')](_0x31f6b8['query'][_0xcab5('0x3f')]);_0x7d3ab4[_0xcab5('0x40')]=qs[_0xcab5('0x40')](_0x31f6b8[_0xcab5('0x37')][_0xcab5('0x40')]);}return _0x4c2020[_0xcab5('0x54')](_0x7d3ab4);}})[_0xcab5('0x1a')](function(_0x476013){if(_0x476013){return _0x476013?{'count':_0x5e0e49,'rows':_0x476013}:null;}})[_0xcab5('0x1a')](respondWithResult(_0x4e0fab,null))[_0xcab5('0x25')](handleError(_0x4e0fab,null));};exports[_0xcab5('0x58')]=function(_0x250337,_0x265bcc,_0x631669){if(_0x250337[_0xcab5('0x52')]['id']){delete _0x250337[_0xcab5('0x52')]['id'];}return db[_0xcab5('0x34')][_0xcab5('0x55')]({'where':{'id':_0x250337[_0xcab5('0x53')]['id']}})[_0xcab5('0x1a')](handleEntityNotFound(_0x265bcc,null))[_0xcab5('0x1a')](function(_0x3beb31){if(_0x3beb31){_0x250337[_0xcab5('0x52')][_0xcab5('0x59')]=_0x3beb31['id'];_0x250337[_0xcab5('0x52')][_0xcab5('0x5a')]=integrations[_0xcab5('0x5b')](_0x250337[_0xcab5('0x52')][_0xcab5('0x5c')],_0x250337[_0xcab5('0x52')][_0xcab5('0x48')]);_0x250337['body'][_0xcab5('0x5d')]=integrations[_0xcab5('0x5e')](_0x250337[_0xcab5('0x52')]['channel'],_0x250337[_0xcab5('0x52')][_0xcab5('0x48')]);return db[_0xcab5('0x56')][_0xcab5('0x51')](_0x250337[_0xcab5('0x52')],{'include':[{'model':db[_0xcab5('0x5f')],'as':'Subjects'},{'model':db[_0xcab5('0x5f')],'as':_0xcab5('0x5d')}]});}return null;})[_0xcab5('0x1a')](respondWithResult(_0x265bcc,null))['catch'](handleError(_0x265bcc,null));};exports[_0xcab5('0x60')]=function(_0x4599da,_0x5e4c37,_0x698765){var _0x5c3c6d='';return db[_0xcab5('0x34')]['findOne']({'where':{'id':_0x4599da['params']['id']},'attributes':['id',_0xcab5('0x61'),'authToken']})[_0xcab5('0x1a')](handleEntityNotFound(_0x5e4c37,null))[_0xcab5('0x1a')](function(_0xb27ad7){if(_0xb27ad7){_0x5c3c6d=_0xb27ad7['host'];var _0x5c60a1=_0x5c3c6d['slice'](-0x1);if(_0x5c60a1==='/'){_0x5c3c6d=_0x5c3c6d['substring'](0x0,_0x5c3c6d[_0xcab5('0x62')](_0x5c60a1));}return rp({'method':_0xcab5('0x63'),'uri':util['format'](_0xcab5('0x64'),_0x5c3c6d),'qs':{'authtoken':_0xb27ad7[_0xcab5('0x65')],'scope':_0xcab5('0x66')},'json':!![]});}})[_0xcab5('0x1a')](function(_0x2b28ad){if(_0x2b28ad){if(_0x2b28ad['response']&&_0x2b28ad[_0xcab5('0x67')]['error']){throw new Error(_0x2b28ad[_0xcab5('0x67')][_0xcab5('0x20')]['message']);}var _0x4858a5=[];if(_0x2b28ad[_0xcab5('0x68')]&&_0x2b28ad[_0xcab5('0x68')]['section']){if(_0x2b28ad[_0xcab5('0x68')]['section']['FL']){var _0x4567f8=[_0xcab5('0x69')];for(var _0x52c921=0x0,_0x22d4da=_0x2b28ad[_0xcab5('0x68')][_0xcab5('0x6a')]['FL'][_0xcab5('0x3d')];_0x52c921<_0x22d4da;_0x52c921++){if(_['includes'](_0x4567f8,_0x2b28ad[_0xcab5('0x68')][_0xcab5('0x6a')]['FL'][_0x52c921]['dv'])){_0x4858a5['push']({'id':_0x2b28ad['Calls'][_0xcab5('0x6a')]['FL'][_0x52c921]['dv'],'name':_0x2b28ad[_0xcab5('0x68')]['section']['FL'][_0x52c921][_0xcab5('0x6b')],'custom':_0x2b28ad[_0xcab5('0x68')][_0xcab5('0x6a')]['FL'][_0x52c921][_0xcab5('0x6c')]===_0xcab5('0x6d')?!![]:![],'options':_0x2b28ad[_0xcab5('0x68')]['section']['FL'][_0x52c921][_0xcab5('0x48')]===_0xcab5('0x6e')&&_0x2b28ad[_0xcab5('0x68')][_0xcab5('0x6a')]['FL'][_0x52c921][_0xcab5('0x6f')]?_[_0xcab5('0x47')](_0x2b28ad['Calls']['section']['FL'][_0x52c921][_0xcab5('0x6f')],function(_0x591ca0){return{'name':_0x591ca0,'value':_0x591ca0};}):[]});}}}}return{'count':_0x4858a5[_0xcab5('0x3d')],'rows':_0x4858a5};}})[_0xcab5('0x1a')](respondWithResult(_0x5e4c37,null))[_0xcab5('0x25')](function(_0x19b82e){var _0x31bf67=_0x4599da[_0xcab5('0x37')][_0xcab5('0x70')]?0x1f4:_0x19b82e[_0xcab5('0x71')]||0x1f4;logger[_0xcab5('0x20')](_0xcab5('0x72'),_0xcab5('0x60'),_0x31bf67,JSON[_0xcab5('0x1f')](_0x19b82e));delete _0x19b82e[_0xcab5('0x31')];if(_0x31bf67===0x191){_0x31bf67=0x190;}_0x5e4c37[_0xcab5('0x26')](_0x31bf67)[_0xcab5('0x32')](_0x4599da[_0xcab5('0x37')][_0xcab5('0x70')]?{'message':_0xcab5('0x73'),'statusCode':_0x19b82e['statusCode']}:_0x19b82e);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 3905e19..4684d97 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 _0xb745=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','int_zoho_accounts'];(function(_0xc434f9,_0x57799b){var _0x3950b2=function(_0xd307){while(--_0xd307){_0xc434f9['push'](_0xc434f9['shift']());}};_0x3950b2(++_0x57799b);}(_0xb745,0x198));var _0x5b74=function(_0x422994,_0x99047b){_0x422994=_0x422994-0x0;var _0x43ad8f=_0xb745[_0x422994];return _0x43ad8f;};'use strict';var _=require(_0x5b74('0x0'));var util=require(_0x5b74('0x1'));var logger=require(_0x5b74('0x2'))(_0x5b74('0x3'));var moment=require(_0x5b74('0x4'));var BPromise=require(_0x5b74('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5b74('0x6'));var config=require('../../config/environment');var attributes=require(_0x5b74('0x7'));var integrations=require(_0x5b74('0x8'));module[_0x5b74('0x9')]=function(_0x5356ea,_0x54428d){return _0x5356ea[_0x5b74('0xa')]('ZohoAccount',attributes,{'tableName':_0x5b74('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b12=['util','../../config/logger','api','moment','define','ZohoAccount','int_zoho_accounts','lodash'];(function(_0x2bc4bd,_0x52f9a1){var _0x105ce9=function(_0x5e814c){while(--_0x5e814c){_0x2bc4bd['push'](_0x2bc4bd['shift']());}};_0x105ce9(++_0x52f9a1);}(_0x6b12,0x17f));var _0x26b1=function(_0x3fcee9,_0x2584d8){_0x3fcee9=_0x3fcee9-0x0;var _0x58cc4f=_0x6b12[_0x3fcee9];return _0x58cc4f;};'use strict';var _=require(_0x26b1('0x0'));var util=require(_0x26b1('0x1'));var logger=require(_0x26b1('0x2'))(_0x26b1('0x3'));var moment=require(_0x26b1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x5c0ae1,_0x376d62){return _0x5c0ae1[_0x26b1('0x5')](_0x26b1('0x6'),attributes,{'tableName':_0x26b1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index e245be0..ca3989b 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 _0xca3a=['attributes','limit','include','model','map','then','GetZohoAccount','catch','ShowZohoAccount','find','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','result','message','ZohoAccount','options','where'];(function(_0x736499,_0xef1230){var _0x1634de=function(_0x3d4fcd){while(--_0x3d4fcd){_0x736499['push'](_0x736499['shift']());}};_0x1634de(++_0xef1230);}(_0xca3a,0x78));var _0xaca3=function(_0x411b9e,_0x20040d){_0x411b9e=_0x411b9e-0x0;var _0x101932=_0xca3a[_0x411b9e];return _0x101932;};'use strict';var _=require(_0xaca3('0x0'));var util=require(_0xaca3('0x1'));var moment=require(_0xaca3('0x2'));var BPromise=require(_0xaca3('0x3'));var rs=require(_0xaca3('0x4'));var fs=require('fs');var Redis=require(_0xaca3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xaca3('0x6'));var logger=require(_0xaca3('0x7'))(_0xaca3('0x8'));var config=require(_0xaca3('0x9'));var jayson=require(_0xaca3('0xa'));var client=jayson[_0xaca3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26e28f,_0x1091c6,_0x3865ef){return new BPromise(function(_0x582d69,_0x2e9e64){return client[_0xaca3('0xc')](_0x26e28f,_0x3865ef)['then'](function(_0x3ed40e){logger[_0xaca3('0xd')](_0xaca3('0xe'),_0x1091c6,'request\x20sent');logger['debug'](_0xaca3('0xf'),_0x1091c6,_0xaca3('0x10'),JSON[_0xaca3('0x11')](_0x3ed40e));if(_0x3ed40e['error']){if(_0x3ed40e[_0xaca3('0x12')]['code']===0x1f4){logger['error'](_0xaca3('0xe'),_0x1091c6,_0x3ed40e[_0xaca3('0x12')]['message']);return _0x2e9e64(_0x3ed40e[_0xaca3('0x12')]['message']);}logger['error'](_0xaca3('0xe'),_0x1091c6,_0x3ed40e[_0xaca3('0x12')]['message']);return _0x582d69(_0x3ed40e[_0xaca3('0x12')]['message']);}else{logger['info'](_0xaca3('0xe'),_0x1091c6,'request\x20sent');_0x582d69(_0x3ed40e[_0xaca3('0x13')][_0xaca3('0x14')]);}})['catch'](function(_0x5d9f45){logger[_0xaca3('0x12')](_0xaca3('0xe'),_0x1091c6,_0x5d9f45);_0x2e9e64(_0x5d9f45);});});}exports['GetZohoAccount']=function(_0x3db45f){var _0x2f9cb1=this;return new Promise(function(_0x14ddf8,_0x535462){return db[_0xaca3('0x15')]['findAll']({'raw':_0x3db45f['options']?_0x3db45f[_0xaca3('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3db45f[_0xaca3('0x16')]?_0x3db45f[_0xaca3('0x16')][_0xaca3('0x17')]||null:null,'attributes':_0x3db45f[_0xaca3('0x16')]?_0x3db45f[_0xaca3('0x16')][_0xaca3('0x18')]||null:null,'limit':_0x3db45f['options']?_0x3db45f[_0xaca3('0x16')][_0xaca3('0x19')]||null:null,'include':_0x3db45f[_0xaca3('0x16')]?_0x3db45f[_0xaca3('0x16')][_0xaca3('0x1a')]?_['map'](_0x3db45f['options'][_0xaca3('0x1a')],function(_0x12284f){return{'model':db[_0x12284f[_0xaca3('0x1b')]],'as':_0x12284f['as'],'attributes':_0x12284f['attributes'],'include':_0x12284f[_0xaca3('0x1a')]?_[_0xaca3('0x1c')](_0x12284f[_0xaca3('0x1a')],function(_0xcac4db){return{'model':db[_0xcac4db['model']],'as':_0xcac4db['as'],'attributes':_0xcac4db[_0xaca3('0x18')],'include':_0xcac4db[_0xaca3('0x1a')]?_[_0xaca3('0x1c')](_0xcac4db[_0xaca3('0x1a')],function(_0x52b37a){return{'model':db[_0x52b37a['model']],'as':_0x52b37a['as'],'attributes':_0x52b37a[_0xaca3('0x18')]};}):[]};}):[]};}):[]:[]})[_0xaca3('0x1d')](function(_0x5aa200){logger['info'](_0xaca3('0x1e'),_0x3db45f);logger['debug'](_0xaca3('0x1e'),_0x3db45f,JSON[_0xaca3('0x11')](_0x5aa200));_0x14ddf8(_0x5aa200);})[_0xaca3('0x1f')](function(_0x58b416){logger['error']('GetZohoAccount',_0x58b416['message'],_0x3db45f);_0x535462(_0x2f9cb1['error'](0x1f4,_0x58b416[_0xaca3('0x14')]));});});};exports[_0xaca3('0x20')]=function(_0x512973){var _0x3cc26c=this;return new Promise(function(_0x2181f9,_0x40eaa4){return db[_0xaca3('0x15')][_0xaca3('0x21')]({'raw':_0x512973[_0xaca3('0x16')]?_0x512973[_0xaca3('0x16')][_0xaca3('0x22')]===undefined?!![]:![]:!![],'where':_0x512973['options']?_0x512973[_0xaca3('0x16')][_0xaca3('0x17')]||null:null,'attributes':_0x512973[_0xaca3('0x16')]?_0x512973[_0xaca3('0x16')][_0xaca3('0x18')]||null:null,'include':_0x512973[_0xaca3('0x16')]?_0x512973['options'][_0xaca3('0x1a')]?_['map'](_0x512973[_0xaca3('0x16')][_0xaca3('0x1a')],function(_0x3fe220){return{'model':db[_0x3fe220[_0xaca3('0x1b')]],'as':_0x3fe220['as'],'attributes':_0x3fe220[_0xaca3('0x18')],'include':_0x3fe220[_0xaca3('0x1a')]?_[_0xaca3('0x1c')](_0x3fe220[_0xaca3('0x1a')],function(_0xa059a1){return{'model':db[_0xa059a1['model']],'as':_0xa059a1['as'],'attributes':_0xa059a1[_0xaca3('0x18')],'include':_0xa059a1[_0xaca3('0x1a')]?_['map'](_0xa059a1[_0xaca3('0x1a')],function(_0x4c6a16){return{'model':db[_0x4c6a16[_0xaca3('0x1b')]],'as':_0x4c6a16['as'],'attributes':_0x4c6a16[_0xaca3('0x18')]};}):[]};}):[]};}):[]:[]})[_0xaca3('0x1d')](function(_0x502433){logger[_0xaca3('0xd')](_0xaca3('0x20'),_0x512973);logger[_0xaca3('0x23')]('ShowZohoAccount',_0x512973,JSON[_0xaca3('0x11')](_0x502433));_0x2181f9(_0x502433);})[_0xaca3('0x1f')](function(_0x2c432d){logger[_0xaca3('0x12')]('ShowZohoAccount',_0x2c432d[_0xaca3('0x14')],_0x512973);_0x40eaa4(_0x3cc26c['error'](0x1f4,_0x2c432d[_0xaca3('0x14')]));});});}; \ No newline at end of file +var _0x76a7=['where','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','attributes','limit','map','include','model','ShowZohoAccount'];(function(_0x4f5607,_0x5a51e4){var _0x5a7446=function(_0x487274){while(--_0x487274){_0x4f5607['push'](_0x4f5607['shift']());}};_0x5a7446(++_0x5a51e4);}(_0x76a7,0x14b));var _0x776a=function(_0x2fc7c6,_0x4db464){_0x2fc7c6=_0x2fc7c6-0x0;var _0x10b531=_0x76a7[_0x2fc7c6];return _0x10b531;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x776a('0x0'));var BPromise=require('bluebird');var rs=require(_0x776a('0x1'));var fs=require('fs');var Redis=require(_0x776a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x776a('0x3'));var logger=require(_0x776a('0x4'))('rpc');var config=require(_0x776a('0x5'));var jayson=require(_0x776a('0x6'));var client=jayson[_0x776a('0x7')][_0x776a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23ae72,_0xa3ee1a,_0x22810c){return new BPromise(function(_0x3afa9d,_0x5621b0){return client[_0x776a('0x9')](_0x23ae72,_0x22810c)[_0x776a('0xa')](function(_0x3d4e39){logger['info'](_0x776a('0xb'),_0xa3ee1a,_0x776a('0xc'));logger[_0x776a('0xd')](_0x776a('0xe'),_0xa3ee1a,_0x776a('0xc'),JSON[_0x776a('0xf')](_0x3d4e39));if(_0x3d4e39[_0x776a('0x10')]){if(_0x3d4e39[_0x776a('0x10')]['code']===0x1f4){logger[_0x776a('0x10')](_0x776a('0xb'),_0xa3ee1a,_0x3d4e39[_0x776a('0x10')][_0x776a('0x11')]);return _0x5621b0(_0x3d4e39[_0x776a('0x10')][_0x776a('0x11')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0xa3ee1a,_0x3d4e39[_0x776a('0x10')]['message']);return _0x3afa9d(_0x3d4e39[_0x776a('0x10')][_0x776a('0x11')]);}else{logger[_0x776a('0x12')](_0x776a('0xb'),_0xa3ee1a,_0x776a('0xc'));_0x3afa9d(_0x3d4e39[_0x776a('0x13')][_0x776a('0x11')]);}})[_0x776a('0x14')](function(_0x30a628){logger['error']('ZohoAccount,\x20%s,\x20%s',_0xa3ee1a,_0x30a628);_0x5621b0(_0x30a628);});});}exports[_0x776a('0x15')]=function(_0x3d5ff8){var _0x5e61f8=this;return new Promise(function(_0x24184a,_0x268932){return db[_0x776a('0x16')][_0x776a('0x17')]({'raw':_0x3d5ff8['options']?_0x3d5ff8[_0x776a('0x18')][_0x776a('0x19')]===undefined?!![]:![]:!![],'where':_0x3d5ff8['options']?_0x3d5ff8[_0x776a('0x18')]['where']||null:null,'attributes':_0x3d5ff8[_0x776a('0x18')]?_0x3d5ff8[_0x776a('0x18')][_0x776a('0x1a')]||null:null,'limit':_0x3d5ff8[_0x776a('0x18')]?_0x3d5ff8['options'][_0x776a('0x1b')]||null:null,'include':_0x3d5ff8[_0x776a('0x18')]?_0x3d5ff8['options']['include']?_[_0x776a('0x1c')](_0x3d5ff8[_0x776a('0x18')][_0x776a('0x1d')],function(_0x11b1b3){return{'model':db[_0x11b1b3['model']],'as':_0x11b1b3['as'],'attributes':_0x11b1b3[_0x776a('0x1a')],'include':_0x11b1b3[_0x776a('0x1d')]?_[_0x776a('0x1c')](_0x11b1b3[_0x776a('0x1d')],function(_0x533af9){return{'model':db[_0x533af9[_0x776a('0x1e')]],'as':_0x533af9['as'],'attributes':_0x533af9['attributes'],'include':_0x533af9[_0x776a('0x1d')]?_['map'](_0x533af9[_0x776a('0x1d')],function(_0x511c61){return{'model':db[_0x511c61[_0x776a('0x1e')]],'as':_0x511c61['as'],'attributes':_0x511c61[_0x776a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x776a('0xa')](function(_0x222b2e){logger['info'](_0x776a('0x15'),_0x3d5ff8);logger['debug'](_0x776a('0x15'),_0x3d5ff8,JSON['stringify'](_0x222b2e));_0x24184a(_0x222b2e);})[_0x776a('0x14')](function(_0x8ca207){logger[_0x776a('0x10')](_0x776a('0x15'),_0x8ca207['message'],_0x3d5ff8);_0x268932(_0x5e61f8[_0x776a('0x10')](0x1f4,_0x8ca207['message']));});});};exports[_0x776a('0x1f')]=function(_0x4eb422){var _0x19e649=this;return new Promise(function(_0x55d26c,_0x58029d){return db['ZohoAccount']['find']({'raw':_0x4eb422['options']?_0x4eb422[_0x776a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4eb422['options']?_0x4eb422['options'][_0x776a('0x20')]||null:null,'attributes':_0x4eb422[_0x776a('0x18')]?_0x4eb422[_0x776a('0x18')][_0x776a('0x1a')]||null:null,'include':_0x4eb422[_0x776a('0x18')]?_0x4eb422[_0x776a('0x18')][_0x776a('0x1d')]?_[_0x776a('0x1c')](_0x4eb422[_0x776a('0x18')][_0x776a('0x1d')],function(_0x299c92){return{'model':db[_0x299c92[_0x776a('0x1e')]],'as':_0x299c92['as'],'attributes':_0x299c92[_0x776a('0x1a')],'include':_0x299c92[_0x776a('0x1d')]?_[_0x776a('0x1c')](_0x299c92[_0x776a('0x1d')],function(_0x3ac7f9){return{'model':db[_0x3ac7f9[_0x776a('0x1e')]],'as':_0x3ac7f9['as'],'attributes':_0x3ac7f9['attributes'],'include':_0x3ac7f9[_0x776a('0x1d')]?_['map'](_0x3ac7f9[_0x776a('0x1d')],function(_0x55889b){return{'model':db[_0x55889b['model']],'as':_0x55889b['as'],'attributes':_0x55889b[_0x776a('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ab074){logger[_0x776a('0x12')]('ShowZohoAccount',_0x4eb422);logger[_0x776a('0xd')](_0x776a('0x1f'),_0x4eb422,JSON[_0x776a('0xf')](_0x2ab074));_0x55d26c(_0x2ab074);})[_0x776a('0x14')](function(_0x24636d){logger[_0x776a('0x10')](_0x776a('0x1f'),_0x24636d[_0x776a('0x11')],_0x4eb422);_0x58029d(_0x19e649[_0x776a('0x10')](0x1f4,_0x24636d[_0x776a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index a865c40..d571e7d 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 _0xd4d1=['/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','index'];(function(_0x5d8e3a,_0x46a735){var _0x20678d=function(_0x130c23){while(--_0x130c23){_0x5d8e3a['push'](_0x5d8e3a['shift']());}};_0x20678d(++_0x46a735);}(_0xd4d1,0x123));var _0x1d4d=function(_0xbd6761,_0x2f0645){_0xbd6761=_0xbd6761-0x0;var _0x29c24f=_0xd4d1[_0xbd6761];return _0x29c24f;};'use strict';var multer=require(_0x1d4d('0x0'));var util=require(_0x1d4d('0x1'));var path=require(_0x1d4d('0x2'));var timeout=require(_0x1d4d('0x3'));var express=require(_0x1d4d('0x4'));var router=express['Router']();var auth=require(_0x1d4d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1d4d('0x6'));var controller=require('./intZohoConfiguration.controller');router[_0x1d4d('0x7')]('/',auth['isAuthenticated'](),controller[_0x1d4d('0x8')]);router[_0x1d4d('0x7')](_0x1d4d('0x9'),auth['isAuthenticated'](),controller[_0x1d4d('0xa')]);router['get'](_0x1d4d('0xb'),auth['isAuthenticated'](),controller[_0x1d4d('0xc')]);router[_0x1d4d('0x7')](_0x1d4d('0xd'),auth['isAuthenticated'](),controller[_0x1d4d('0xe')]);router[_0x1d4d('0x7')](_0x1d4d('0xf'),auth['isAuthenticated'](),controller[_0x1d4d('0x10')]);router[_0x1d4d('0x11')]('/',auth[_0x1d4d('0x12')](),controller[_0x1d4d('0x13')]);router[_0x1d4d('0x14')](_0x1d4d('0x9'),auth[_0x1d4d('0x12')](),controller[_0x1d4d('0x15')]);router[_0x1d4d('0x16')](_0x1d4d('0x9'),auth['isAuthenticated'](),controller[_0x1d4d('0x17')]);module[_0x1d4d('0x18')]=router; \ No newline at end of file +var _0x5735=['delete','exports','multer','connect-timeout','express','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','post','create','put','update'];(function(_0x44cb92,_0x59afa3){var _0x56b9e6=function(_0x2841e0){while(--_0x2841e0){_0x44cb92['push'](_0x44cb92['shift']());}};_0x56b9e6(++_0x59afa3);}(_0x5735,0x16a));var _0x5573=function(_0x13ea36,_0x2805ad){_0x13ea36=_0x13ea36-0x0;var _0x312066=_0x5735[_0x13ea36];return _0x312066;};'use strict';var multer=require(_0x5573('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5573('0x1'));var express=require(_0x5573('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5573('0x3'));var controller=require(_0x5573('0x4'));router[_0x5573('0x5')]('/',auth[_0x5573('0x6')](),controller['index']);router[_0x5573('0x5')](_0x5573('0x7'),auth[_0x5573('0x6')](),controller[_0x5573('0x8')]);router[_0x5573('0x5')](_0x5573('0x9'),auth['isAuthenticated'](),controller['getFields']);router[_0x5573('0x5')](_0x5573('0xa'),auth[_0x5573('0x6')](),controller[_0x5573('0xb')]);router['get']('/:id/descriptions',auth[_0x5573('0x6')](),controller['getDescriptions']);router[_0x5573('0xc')]('/',auth[_0x5573('0x6')](),controller[_0x5573('0xd')]);router[_0x5573('0xe')](_0x5573('0x7'),auth[_0x5573('0x6')](),controller[_0x5573('0xf')]);router[_0x5573('0x10')](_0x5573('0x7'),auth[_0x5573('0x6')](),controller['destroy']);module[_0x5573('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 9ff1703..9dce659 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 _0xe432=['sequelize','STRING'];(function(_0x398fe9,_0x8b73d6){var _0x418908=function(_0x4c2a39){while(--_0x4c2a39){_0x398fe9['push'](_0x398fe9['shift']());}};_0x418908(++_0x8b73d6);}(_0xe432,0x16a));var _0x2e43=function(_0x3233cb,_0x45ce67){_0x3233cb=_0x3233cb-0x0;var _0xd6adbe=_0xe432[_0x3233cb];return _0xd6adbe;};'use strict';var Sequelize=require(_0x2e43('0x0'));module['exports']={'name':{'type':Sequelize[_0x2e43('0x1')]},'description':{'type':Sequelize[_0x2e43('0x1')]}}; \ No newline at end of file +var _0x1b01=['exports','STRING'];(function(_0x93bf84,_0x6939a0){var _0x18bef2=function(_0x376549){while(--_0x376549){_0x93bf84['push'](_0x93bf84['shift']());}};_0x18bef2(++_0x6939a0);}(_0x1b01,0x19c));var _0x11b0=function(_0x49678a,_0x5b3c22){_0x49678a=_0x49678a-0x0;var _0x50d38a=_0x1b01[_0x49678a];return _0x50d38a;};'use strict';var Sequelize=require('sequelize');module[_0x11b0('0x0')]={'name':{'type':Sequelize[_0x11b0('0x1')]},'description':{'type':Sequelize[_0x11b0('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index c33464d..8f4b88c 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 _0x6aa7=['find','create','body','params','getFields','findOne','ZohoField','pick','hasOwnProperty','nolimit','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','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','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','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','ZohoConfiguration','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','order','sort','where','map','type','key','field','filter','merge','count','includeAll','include','findAll','rows','options'];(function(_0x3e50a,_0x24e73e){var _0x55a236=function(_0x397726){while(--_0x397726){_0x3e50a['push'](_0x3e50a['shift']());}};_0x55a236(++_0x24e73e);}(_0x6aa7,0x178));var _0x76aa=function(_0x3bbe17,_0x48f256){_0x3bbe17=_0x3bbe17-0x0;var _0x5bf4fc=_0x6aa7[_0x3bbe17];return _0x5bf4fc;};'use strict';var pdf=require(_0x76aa('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x76aa('0x1'));var zipdir=require(_0x76aa('0x2'));var jsonpatch=require(_0x76aa('0x3'));var rp=require(_0x76aa('0x4'));var moment=require('moment');var BPromise=require(_0x76aa('0x5'));var Mustache=require(_0x76aa('0x6'));var util=require(_0x76aa('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x76aa('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0x8'));var querystring=require(_0x76aa('0xd'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xe'));var authService=require(_0x76aa('0xf'));var qs=require(_0x76aa('0x10'));var hardwareService=require(_0x76aa('0x11'));var logger=require(_0x76aa('0x12'))(_0x76aa('0x13'));var utils=require(_0x76aa('0x14'));var config=require(_0x76aa('0x15'));var db=require(_0x76aa('0x16'))['db'];var jayson=require(_0x76aa('0x17'));var client=jayson['client'][_0x76aa('0x18')]({'port':0x232a});function checkPasswordPattern(_0x5df49c,_0x226536,_0x12dde0){if(_0x12dde0){var _0x3f8f6b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3f8f6b[_0x76aa('0x19')](_0x226536)){return _0x5df49c;}else{throw new Error(_0x76aa('0x1a'));}}else{return _0x5df49c;}}function respondWithRpcPromise(_0x4e309f,_0x5f5b59,_0x2b3b4f,_0x4cfc34){return new BPromise(function(_0x180d92,_0x319bf1){var _0x5cf594=_0x4cfc34||client;return _0x5cf594[_0x76aa('0x1b')](_0x4e309f,_0x2b3b4f)['then'](function(_0x328381){logger['info'](_0x76aa('0x1c'),_0x5f5b59,_0x76aa('0x1d'));logger[_0x76aa('0x1e')](_0x76aa('0x1f'),_0x5f5b59,_0x76aa('0x1d'),JSON[_0x76aa('0x20')](_0x328381));if(_0x328381['error']){if(_0x328381['error'][_0x76aa('0x21')]===0x1f4){logger[_0x76aa('0x22')](_0x76aa('0x1c'),_0x5f5b59,_0x328381[_0x76aa('0x22')][_0x76aa('0x23')]);return _0x319bf1(_0x328381[_0x76aa('0x22')][_0x76aa('0x23')]);}logger[_0x76aa('0x22')](_0x76aa('0x1c'),_0x5f5b59,_0x328381['error'][_0x76aa('0x23')]);return _0x180d92(_0x328381[_0x76aa('0x22')][_0x76aa('0x23')]);}else{logger['info'](_0x76aa('0x1c'),_0x5f5b59,_0x76aa('0x1d'));_0x180d92(_0x328381[_0x76aa('0x24')][_0x76aa('0x23')]);}})[_0x76aa('0x25')](function(_0xc1044c){logger[_0x76aa('0x22')](_0x76aa('0x1c'),_0x5f5b59,_0xc1044c);_0x319bf1(_0xc1044c);});});}function respondWithStatusCode(_0x32bf9f,_0x2cba6d){_0x2cba6d=_0x2cba6d||0xcc;return function(_0x37f1ab){if(_0x37f1ab){return _0x32bf9f[_0x76aa('0x26')](_0x2cba6d);}return _0x32bf9f[_0x76aa('0x27')](_0x2cba6d)['end']();};}function respondWithResult(_0xb5e8a9,_0x1d6d15){_0x1d6d15=_0x1d6d15||0xc8;return function(_0x25c614){if(_0x25c614){return _0xb5e8a9[_0x76aa('0x27')](_0x1d6d15)[_0x76aa('0x28')](_0x25c614);}};}function respondWithFilteredResult(_0x2f9316,_0x25a803){return function(_0x282d0a){if(_0x282d0a){var _0xd12a99=_0x282d0a['count'],_0x1bdc3d=_0x25a803[_0x76aa('0x29')],_0x545b06=_0x25a803[_0x76aa('0x29')]+_0x25a803[_0x76aa('0x2a')],_0x3fcb7f;if(_0x545b06>=_0xd12a99){_0x545b06=_0xd12a99;_0x3fcb7f=0xc8;}else{_0x3fcb7f=0xce;}_0x2f9316[_0x76aa('0x27')](_0x3fcb7f);return _0x2f9316[_0x76aa('0x2b')](_0x76aa('0x2c'),_0x1bdc3d+'-'+_0x545b06+'/'+_0xd12a99)[_0x76aa('0x28')](_0x282d0a);}return null;};}function patchUpdates(_0x3827ec){return function(_0x19fd4f){try{jsonpatch[_0x76aa('0x2d')](_0x19fd4f,_0x3827ec,!![]);}catch(_0x5edcd8){return BPromise[_0x76aa('0x2e')](_0x5edcd8);}return _0x19fd4f[_0x76aa('0x2f')]();};}function saveUpdates(_0x1851d6,_0x928ccf){return function(_0x458ac3){if(_0x458ac3){return _0x458ac3[_0x76aa('0x30')](_0x1851d6)[_0x76aa('0x31')](function(_0x4eb57a){return _0x4eb57a;});}return null;};}function removeEntity(_0x258624,_0x25a11f){return function(_0x5a0f72){if(_0x5a0f72){return _0x5a0f72[_0x76aa('0x32')]()['then'](function(){_0x258624[_0x76aa('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8479a3,_0x5653e0){return function(_0x58f135){if(!_0x58f135){_0x8479a3[_0x76aa('0x26')](0x194);}return _0x58f135;};}function handleError(_0x282c56,_0x198fcb){_0x198fcb=_0x198fcb||0x1f4;return function(_0x37dfab){logger['error'](_0x37dfab['stack']);if(_0x37dfab[_0x76aa('0x33')]){delete _0x37dfab[_0x76aa('0x33')];}_0x282c56[_0x76aa('0x27')](_0x198fcb)[_0x76aa('0x34')](_0x37dfab);};}exports[_0x76aa('0x35')]=function(_0x5b57d8,_0x9ce5f4){var _0x5c77f1={},_0x5086f5={},_0x4fdbde={'count':0x0,'rows':[]};var _0x36d64e=db[_0x76aa('0x36')][_0x76aa('0x37')];_0x5086f5['model']=_[_0x76aa('0x38')](_0x36d64e);_0x5086f5[_0x76aa('0x39')]=_[_0x76aa('0x38')](_0x5b57d8['query']);_0x5086f5[_0x76aa('0x3a')]=_[_0x76aa('0x3b')](_0x5086f5[_0x76aa('0x3c')],_0x5086f5[_0x76aa('0x39')]);_0x5c77f1[_0x76aa('0x3d')]=_[_0x76aa('0x3b')](_0x5086f5[_0x76aa('0x3c')],qs[_0x76aa('0x3e')](_0x5b57d8[_0x76aa('0x39')]['fields']));_0x5c77f1[_0x76aa('0x3d')]=_0x5c77f1[_0x76aa('0x3d')][_0x76aa('0x3f')]?_0x5c77f1[_0x76aa('0x3d')]:_0x5086f5[_0x76aa('0x3c')];if(!_0x5b57d8[_0x76aa('0x39')]['hasOwnProperty']('nolimit')){_0x5c77f1[_0x76aa('0x2a')]=qs[_0x76aa('0x2a')](_0x5b57d8[_0x76aa('0x39')][_0x76aa('0x2a')]);_0x5c77f1['offset']=qs[_0x76aa('0x29')](_0x5b57d8[_0x76aa('0x39')][_0x76aa('0x29')]);}_0x5c77f1[_0x76aa('0x40')]=qs[_0x76aa('0x41')](_0x5b57d8['query'][_0x76aa('0x41')]);_0x5c77f1['where']=qs[_0x76aa('0x3a')](_['pick'](_0x5b57d8['query'],_0x5086f5['filters']));if(_0x5b57d8[_0x76aa('0x39')]['filter']){_0x5c77f1['where']=_['merge'](_0x5c77f1[_0x76aa('0x42')],{'$or':_[_0x76aa('0x43')](_0x36d64e,function(_0x116dc5){if(_0x116dc5[_0x76aa('0x44')][_0x76aa('0x45')]!=='VIRTUAL'){var _0x715e7a={};_0x715e7a[_0x116dc5[_0x76aa('0x46')]]={'$like':'%'+_0x5b57d8[_0x76aa('0x39')][_0x76aa('0x47')]+'%'};return _0x715e7a;}})});}_0x5c77f1=_[_0x76aa('0x48')]({},_0x5c77f1,_0x5b57d8['options']);var _0x2f695c={'where':_0x5c77f1[_0x76aa('0x42')]};return db['ZohoConfiguration'][_0x76aa('0x49')](_0x2f695c)['then'](function(_0x3aa858){_0x4fdbde[_0x76aa('0x49')]=_0x3aa858;if(_0x5b57d8[_0x76aa('0x39')][_0x76aa('0x4a')]){_0x5c77f1[_0x76aa('0x4b')]=[{'all':!![]}];}return db[_0x76aa('0x36')][_0x76aa('0x4c')](_0x5c77f1);})[_0x76aa('0x31')](function(_0xb8d052){_0x4fdbde[_0x76aa('0x4d')]=_0xb8d052;return _0x4fdbde;})['then'](respondWithFilteredResult(_0x9ce5f4,_0x5c77f1))[_0x76aa('0x25')](handleError(_0x9ce5f4,null));};exports['show']=function(_0x288417,_0x3d3332){var _0x5e95f5={'raw':![],'where':{'id':_0x288417['params']['id']}},_0x156d4e={};_0x156d4e['model']=_[_0x76aa('0x38')](db['ZohoConfiguration'][_0x76aa('0x37')]);_0x156d4e[_0x76aa('0x39')]=_[_0x76aa('0x38')](_0x288417[_0x76aa('0x39')]);_0x156d4e[_0x76aa('0x3a')]=_[_0x76aa('0x3b')](_0x156d4e['model'],_0x156d4e['query']);_0x5e95f5[_0x76aa('0x3d')]=_[_0x76aa('0x3b')](_0x156d4e[_0x76aa('0x3c')],qs[_0x76aa('0x3e')](_0x288417[_0x76aa('0x39')][_0x76aa('0x3e')]));_0x5e95f5['attributes']=_0x5e95f5[_0x76aa('0x3d')][_0x76aa('0x3f')]?_0x5e95f5[_0x76aa('0x3d')]:_0x156d4e['model'];if(_0x288417[_0x76aa('0x39')]['includeAll']){_0x5e95f5[_0x76aa('0x4b')]=[{'all':!![]}];}_0x5e95f5=_['merge']({},_0x5e95f5,_0x288417[_0x76aa('0x4e')]);return db[_0x76aa('0x36')][_0x76aa('0x4f')](_0x5e95f5)[_0x76aa('0x31')](handleEntityNotFound(_0x3d3332,null))[_0x76aa('0x31')](respondWithResult(_0x3d3332,null))[_0x76aa('0x25')](handleError(_0x3d3332,null));};exports[_0x76aa('0x50')]=function(_0x4f2c2b,_0x186654){return db['ZohoConfiguration'][_0x76aa('0x50')](_0x4f2c2b[_0x76aa('0x51')],{})[_0x76aa('0x31')](respondWithResult(_0x186654,0xc9))[_0x76aa('0x25')](handleError(_0x186654,null));};exports[_0x76aa('0x30')]=function(_0x28f8aa,_0x336024){if(_0x28f8aa['body']['id']){delete _0x28f8aa[_0x76aa('0x51')]['id'];}return db[_0x76aa('0x36')][_0x76aa('0x4f')]({'where':{'id':_0x28f8aa[_0x76aa('0x52')]['id']}})['then'](handleEntityNotFound(_0x336024,null))[_0x76aa('0x31')](saveUpdates(_0x28f8aa[_0x76aa('0x51')],null))[_0x76aa('0x31')](respondWithResult(_0x336024,null))[_0x76aa('0x25')](handleError(_0x336024,null));};exports[_0x76aa('0x32')]=function(_0xf7732,_0x4e6c09){return db[_0x76aa('0x36')][_0x76aa('0x4f')]({'where':{'id':_0xf7732[_0x76aa('0x52')]['id']}})[_0x76aa('0x31')](handleEntityNotFound(_0x4e6c09,null))[_0x76aa('0x31')](removeEntity(_0x4e6c09,null))[_0x76aa('0x25')](handleError(_0x4e6c09,null));};exports[_0x76aa('0x53')]=function(_0x51893b,_0x4910fb,_0x2c59a6){var _0x3b0d8a={};var _0x5713e7={};var _0x3d7802;var _0x1e6f3c;return db['ZohoConfiguration'][_0x76aa('0x54')]({'where':{'id':_0x51893b[_0x76aa('0x52')]['id']}})[_0x76aa('0x31')](handleEntityNotFound(_0x4910fb,null))[_0x76aa('0x31')](function(_0x24662d){if(_0x24662d){_0x3d7802=_0x24662d;_0x5713e7[_0x76aa('0x3c')]=_[_0x76aa('0x38')](db[_0x76aa('0x55')][_0x76aa('0x37')]);_0x5713e7['query']=_[_0x76aa('0x38')](_0x51893b['query']);_0x5713e7[_0x76aa('0x3a')]=_[_0x76aa('0x3b')](_0x5713e7[_0x76aa('0x3c')],_0x5713e7[_0x76aa('0x39')]);_0x3b0d8a[_0x76aa('0x3d')]=_[_0x76aa('0x3b')](_0x5713e7[_0x76aa('0x3c')],qs[_0x76aa('0x3e')](_0x51893b[_0x76aa('0x39')]['fields']));_0x3b0d8a[_0x76aa('0x3d')]=_0x3b0d8a[_0x76aa('0x3d')][_0x76aa('0x3f')]?_0x3b0d8a[_0x76aa('0x3d')]:_0x5713e7[_0x76aa('0x3c')];_0x3b0d8a[_0x76aa('0x40')]=qs[_0x76aa('0x41')](_0x51893b[_0x76aa('0x39')]['sort']);_0x3b0d8a[_0x76aa('0x42')]=qs['filters'](_[_0x76aa('0x56')](_0x51893b[_0x76aa('0x39')],_0x5713e7[_0x76aa('0x3a')]));if(_0x51893b[_0x76aa('0x39')][_0x76aa('0x47')]){_0x3b0d8a[_0x76aa('0x42')]=_[_0x76aa('0x48')](_0x3b0d8a['where'],{'$or':_[_0x76aa('0x43')](_0x3b0d8a[_0x76aa('0x3d')],function(_0x543c1d){var _0x54334b={};_0x54334b[_0x543c1d]={'$like':'%'+_0x51893b[_0x76aa('0x39')][_0x76aa('0x47')]+'%'};return _0x54334b;})});}_0x3b0d8a=_['merge']({},_0x3b0d8a,_0x51893b[_0x76aa('0x4e')]);return _0x3d7802[_0x76aa('0x53')](_0x3b0d8a);}})[_0x76aa('0x31')](function(_0x5b460e){if(_0x5b460e){_0x1e6f3c=_0x5b460e[_0x76aa('0x3f')];if(!_0x51893b['query'][_0x76aa('0x57')](_0x76aa('0x58'))){_0x3b0d8a[_0x76aa('0x2a')]=qs[_0x76aa('0x2a')](_0x51893b['query']['limit']);_0x3b0d8a[_0x76aa('0x29')]=qs['offset'](_0x51893b[_0x76aa('0x39')][_0x76aa('0x29')]);}return _0x3d7802[_0x76aa('0x53')](_0x3b0d8a);}})[_0x76aa('0x31')](function(_0x2dd320){if(_0x2dd320){return _0x2dd320?{'count':_0x1e6f3c,'rows':_0x2dd320}:null;}})[_0x76aa('0x31')](respondWithResult(_0x4910fb,null))[_0x76aa('0x25')](handleError(_0x4910fb,null));};exports[_0x76aa('0x59')]=function(_0xa19c1c,_0x54390f,_0x7d02e7){var _0x1eadee={};var _0xc6f48d={};var _0x45ae9f;var _0x4eb2e7;return db['ZohoConfiguration']['findOne']({'where':{'id':_0xa19c1c[_0x76aa('0x52')]['id']}})['then'](handleEntityNotFound(_0x54390f,null))[_0x76aa('0x31')](function(_0x256195){if(_0x256195){_0x45ae9f=_0x256195;_0xc6f48d[_0x76aa('0x3c')]=_[_0x76aa('0x38')](db['ZohoField'][_0x76aa('0x37')]);_0xc6f48d['query']=_[_0x76aa('0x38')](_0xa19c1c[_0x76aa('0x39')]);_0xc6f48d[_0x76aa('0x3a')]=_[_0x76aa('0x3b')](_0xc6f48d[_0x76aa('0x3c')],_0xc6f48d['query']);_0x1eadee[_0x76aa('0x3d')]=_[_0x76aa('0x3b')](_0xc6f48d[_0x76aa('0x3c')],qs[_0x76aa('0x3e')](_0xa19c1c[_0x76aa('0x39')][_0x76aa('0x3e')]));_0x1eadee[_0x76aa('0x3d')]=_0x1eadee[_0x76aa('0x3d')]['length']?_0x1eadee[_0x76aa('0x3d')]:_0xc6f48d[_0x76aa('0x3c')];_0x1eadee['order']=qs[_0x76aa('0x41')](_0xa19c1c[_0x76aa('0x39')][_0x76aa('0x41')]);_0x1eadee[_0x76aa('0x42')]=qs[_0x76aa('0x3a')](_[_0x76aa('0x56')](_0xa19c1c[_0x76aa('0x39')],_0xc6f48d['filters']));if(_0xa19c1c[_0x76aa('0x39')]['filter']){_0x1eadee['where']=_[_0x76aa('0x48')](_0x1eadee[_0x76aa('0x42')],{'$or':_['map'](_0x1eadee['attributes'],function(_0x36da4d){var _0x14b5a2={};_0x14b5a2[_0x36da4d]={'$like':'%'+_0xa19c1c[_0x76aa('0x39')]['filter']+'%'};return _0x14b5a2;})});}_0x1eadee=_['merge']({},_0x1eadee,_0xa19c1c[_0x76aa('0x4e')]);return _0x45ae9f[_0x76aa('0x59')](_0x1eadee);}})[_0x76aa('0x31')](function(_0x5d65ec){if(_0x5d65ec){_0x4eb2e7=_0x5d65ec[_0x76aa('0x3f')];if(!_0xa19c1c['query'][_0x76aa('0x57')](_0x76aa('0x58'))){_0x1eadee[_0x76aa('0x2a')]=qs[_0x76aa('0x2a')](_0xa19c1c[_0x76aa('0x39')]['limit']);_0x1eadee['offset']=qs[_0x76aa('0x29')](_0xa19c1c[_0x76aa('0x39')][_0x76aa('0x29')]);}return _0x45ae9f['getSubjects'](_0x1eadee);}})[_0x76aa('0x31')](function(_0x3b6e44){if(_0x3b6e44){return _0x3b6e44?{'count':_0x4eb2e7,'rows':_0x3b6e44}:null;}})[_0x76aa('0x31')](respondWithResult(_0x54390f,null))[_0x76aa('0x25')](handleError(_0x54390f,null));};exports[_0x76aa('0x5a')]=function(_0x490c63,_0x7a1e76,_0x5d2b9d){var _0x213f7f={};var _0xca8769={};var _0x2785e4;var _0x2d9f60;return db[_0x76aa('0x36')][_0x76aa('0x54')]({'where':{'id':_0x490c63['params']['id']}})['then'](handleEntityNotFound(_0x7a1e76,null))['then'](function(_0x47dd29){if(_0x47dd29){_0x2785e4=_0x47dd29;_0xca8769['model']=_[_0x76aa('0x38')](db[_0x76aa('0x55')]['rawAttributes']);_0xca8769['query']=_['keys'](_0x490c63[_0x76aa('0x39')]);_0xca8769[_0x76aa('0x3a')]=_[_0x76aa('0x3b')](_0xca8769['model'],_0xca8769['query']);_0x213f7f[_0x76aa('0x3d')]=_[_0x76aa('0x3b')](_0xca8769[_0x76aa('0x3c')],qs[_0x76aa('0x3e')](_0x490c63[_0x76aa('0x39')]['fields']));_0x213f7f['attributes']=_0x213f7f[_0x76aa('0x3d')]['length']?_0x213f7f['attributes']:_0xca8769['model'];_0x213f7f[_0x76aa('0x40')]=qs[_0x76aa('0x41')](_0x490c63['query'][_0x76aa('0x41')]);_0x213f7f[_0x76aa('0x42')]=qs['filters'](_[_0x76aa('0x56')](_0x490c63[_0x76aa('0x39')],_0xca8769[_0x76aa('0x3a')]));if(_0x490c63[_0x76aa('0x39')][_0x76aa('0x47')]){_0x213f7f[_0x76aa('0x42')]=_[_0x76aa('0x48')](_0x213f7f[_0x76aa('0x42')],{'$or':_[_0x76aa('0x43')](_0x213f7f['attributes'],function(_0x84bc91){var _0xc877b1={};_0xc877b1[_0x84bc91]={'$like':'%'+_0x490c63['query'][_0x76aa('0x47')]+'%'};return _0xc877b1;})});}_0x213f7f=_[_0x76aa('0x48')]({},_0x213f7f,_0x490c63[_0x76aa('0x4e')]);return _0x2785e4['getDescriptions'](_0x213f7f);}})[_0x76aa('0x31')](function(_0x1ae1ab){if(_0x1ae1ab){_0x2d9f60=_0x1ae1ab['length'];if(!_0x490c63[_0x76aa('0x39')][_0x76aa('0x57')](_0x76aa('0x58'))){_0x213f7f['limit']=qs[_0x76aa('0x2a')](_0x490c63[_0x76aa('0x39')]['limit']);_0x213f7f['offset']=qs['offset'](_0x490c63[_0x76aa('0x39')][_0x76aa('0x29')]);}return _0x2785e4[_0x76aa('0x5a')](_0x213f7f);}})[_0x76aa('0x31')](function(_0x5d18b6){if(_0x5d18b6){return _0x5d18b6?{'count':_0x2d9f60,'rows':_0x5d18b6}:null;}})['then'](respondWithResult(_0x7a1e76,null))['catch'](handleError(_0x7a1e76,null));}; \ No newline at end of file +var _0xedd9=['../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','ZohoConfiguration','rows','params','length','includeAll','options','find','create','body','getFields','findOne','ZohoField','order','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xedd9,0xfc));var _0x9edd=function(_0x55ed28,_0x19783f){_0x55ed28=_0x55ed28-0x0;var _0x15daa9=_0xedd9[_0x55ed28];return _0x15daa9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9edd('0x0'));var rimraf=require(_0x9edd('0x1'));var zipdir=require(_0x9edd('0x2'));var jsonpatch=require(_0x9edd('0x3'));var rp=require(_0x9edd('0x4'));var moment=require(_0x9edd('0x5'));var BPromise=require(_0x9edd('0x6'));var Mustache=require(_0x9edd('0x7'));var util=require('util');var path=require(_0x9edd('0x8'));var sox=require(_0x9edd('0x9'));var csv=require(_0x9edd('0xa'));var ejs=require(_0x9edd('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0xa'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var hardwareService=require(_0x9edd('0x12'));var logger=require('../../config/logger')(_0x9edd('0x13'));var utils=require(_0x9edd('0x14'));var config=require('../../config/environment');var db=require(_0x9edd('0x15'))['db'];var jayson=require(_0x9edd('0x16'));var client=jayson[_0x9edd('0x17')][_0x9edd('0x18')]({'port':0x232a});function checkPasswordPattern(_0x287ddd,_0x3a7b84,_0xfca576){if(_0xfca576){var _0xef5498=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xef5498['test'](_0x3a7b84)){return _0x287ddd;}else{throw new Error(_0x9edd('0x19'));}}else{return _0x287ddd;}}function respondWithRpcPromise(_0x44fc7c,_0x891832,_0x4d9a7,_0x13b6b6){return new BPromise(function(_0x338f3c,_0x1042aa){var _0x75a4ab=_0x13b6b6||client;return _0x75a4ab['request'](_0x44fc7c,_0x4d9a7)[_0x9edd('0x1a')](function(_0x448996){logger[_0x9edd('0x1b')]('ZohoConfiguration,\x20%s,\x20%s',_0x891832,_0x9edd('0x1c'));logger[_0x9edd('0x1d')](_0x9edd('0x1e'),_0x891832,'request\x20sent',JSON[_0x9edd('0x1f')](_0x448996));if(_0x448996['error']){if(_0x448996[_0x9edd('0x20')][_0x9edd('0x21')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x891832,_0x448996[_0x9edd('0x20')]['message']);return _0x1042aa(_0x448996[_0x9edd('0x20')]['message']);}logger['error'](_0x9edd('0x22'),_0x891832,_0x448996[_0x9edd('0x20')]['message']);return _0x338f3c(_0x448996['error'][_0x9edd('0x23')]);}else{logger[_0x9edd('0x1b')](_0x9edd('0x22'),_0x891832,'request\x20sent');_0x338f3c(_0x448996[_0x9edd('0x24')][_0x9edd('0x23')]);}})[_0x9edd('0x25')](function(_0x2ca65f){logger[_0x9edd('0x20')]('ZohoConfiguration,\x20%s,\x20%s',_0x891832,_0x2ca65f);_0x1042aa(_0x2ca65f);});});}function respondWithStatusCode(_0x46c383,_0xeaf55a){_0xeaf55a=_0xeaf55a||0xcc;return function(_0x3a1ea5){if(_0x3a1ea5){return _0x46c383[_0x9edd('0x26')](_0xeaf55a);}return _0x46c383[_0x9edd('0x27')](_0xeaf55a)['end']();};}function respondWithResult(_0x4b3d1b,_0x3276ee){_0x3276ee=_0x3276ee||0xc8;return function(_0xfeca7b){if(_0xfeca7b){return _0x4b3d1b[_0x9edd('0x27')](_0x3276ee)[_0x9edd('0x28')](_0xfeca7b);}};}function respondWithFilteredResult(_0x3c2227,_0x4fe471){return function(_0x57a2cc){if(_0x57a2cc){var _0x214d0a=_0x57a2cc[_0x9edd('0x29')],_0x257a26=_0x4fe471[_0x9edd('0x2a')],_0x1c762c=_0x4fe471[_0x9edd('0x2a')]+_0x4fe471[_0x9edd('0x2b')],_0x52746a;if(_0x1c762c>=_0x214d0a){_0x1c762c=_0x214d0a;_0x52746a=0xc8;}else{_0x52746a=0xce;}_0x3c2227['status'](_0x52746a);return _0x3c2227[_0x9edd('0x2c')](_0x9edd('0x2d'),_0x257a26+'-'+_0x1c762c+'/'+_0x214d0a)[_0x9edd('0x28')](_0x57a2cc);}return null;};}function patchUpdates(_0x12c1bc){return function(_0xbbf08f){try{jsonpatch[_0x9edd('0x2e')](_0xbbf08f,_0x12c1bc,!![]);}catch(_0x209aba){return BPromise[_0x9edd('0x2f')](_0x209aba);}return _0xbbf08f[_0x9edd('0x30')]();};}function saveUpdates(_0x1c2e2b,_0x4fd03f){return function(_0x138002){if(_0x138002){return _0x138002[_0x9edd('0x31')](_0x1c2e2b)[_0x9edd('0x1a')](function(_0x1a6c23){return _0x1a6c23;});}return null;};}function removeEntity(_0x5af178,_0x1453d2){return function(_0x259259){if(_0x259259){return _0x259259[_0x9edd('0x32')]()['then'](function(){_0x5af178[_0x9edd('0x27')](0xcc)[_0x9edd('0x33')]();});}};}function handleEntityNotFound(_0xde9b13,_0x38a7be){return function(_0x21bc30){if(!_0x21bc30){_0xde9b13[_0x9edd('0x26')](0x194);}return _0x21bc30;};}function handleError(_0x473068,_0x438a5d){_0x438a5d=_0x438a5d||0x1f4;return function(_0xd0fd74){logger[_0x9edd('0x20')](_0xd0fd74[_0x9edd('0x34')]);if(_0xd0fd74[_0x9edd('0x35')]){delete _0xd0fd74[_0x9edd('0x35')];}_0x473068[_0x9edd('0x27')](_0x438a5d)['send'](_0xd0fd74);};}exports[_0x9edd('0x36')]=function(_0x5ed62d,_0x968303){var _0x148630={},_0x10d6fd={},_0x434d26={'count':0x0,'rows':[]};var _0x16770e=db['ZohoConfiguration'][_0x9edd('0x37')];_0x10d6fd[_0x9edd('0x38')]=_[_0x9edd('0x39')](_0x16770e);_0x10d6fd[_0x9edd('0x3a')]=_[_0x9edd('0x39')](_0x5ed62d[_0x9edd('0x3a')]);_0x10d6fd[_0x9edd('0x3b')]=_[_0x9edd('0x3c')](_0x10d6fd[_0x9edd('0x38')],_0x10d6fd[_0x9edd('0x3a')]);_0x148630['attributes']=_[_0x9edd('0x3c')](_0x10d6fd['model'],qs[_0x9edd('0x3d')](_0x5ed62d['query'][_0x9edd('0x3d')]));_0x148630[_0x9edd('0x3e')]=_0x148630[_0x9edd('0x3e')]['length']?_0x148630[_0x9edd('0x3e')]:_0x10d6fd[_0x9edd('0x38')];if(!_0x5ed62d[_0x9edd('0x3a')]['hasOwnProperty'](_0x9edd('0x3f'))){_0x148630['limit']=qs[_0x9edd('0x2b')](_0x5ed62d[_0x9edd('0x3a')]['limit']);_0x148630[_0x9edd('0x2a')]=qs[_0x9edd('0x2a')](_0x5ed62d[_0x9edd('0x3a')][_0x9edd('0x2a')]);}_0x148630['order']=qs[_0x9edd('0x40')](_0x5ed62d['query'][_0x9edd('0x40')]);_0x148630[_0x9edd('0x41')]=qs['filters'](_[_0x9edd('0x42')](_0x5ed62d['query'],_0x10d6fd['filters']));if(_0x5ed62d[_0x9edd('0x3a')][_0x9edd('0x43')]){_0x148630[_0x9edd('0x41')]=_[_0x9edd('0x44')](_0x148630[_0x9edd('0x41')],{'$or':_[_0x9edd('0x45')](_0x16770e,function(_0x3ff512){if(_0x3ff512[_0x9edd('0x46')][_0x9edd('0x47')]!==_0x9edd('0x48')){var _0x37a263={};_0x37a263[_0x3ff512[_0x9edd('0x49')]]={'$like':'%'+_0x5ed62d[_0x9edd('0x3a')][_0x9edd('0x43')]+'%'};return _0x37a263;}})});}_0x148630=_[_0x9edd('0x44')]({},_0x148630,_0x5ed62d['options']);var _0x13197d={'where':_0x148630[_0x9edd('0x41')]};return db[_0x9edd('0x4a')][_0x9edd('0x29')](_0x13197d)[_0x9edd('0x1a')](function(_0x3ecdfd){_0x434d26[_0x9edd('0x29')]=_0x3ecdfd;if(_0x5ed62d['query']['includeAll']){_0x148630['include']=[{'all':!![]}];}return db[_0x9edd('0x4a')]['findAll'](_0x148630);})[_0x9edd('0x1a')](function(_0x19b56b){_0x434d26[_0x9edd('0x4b')]=_0x19b56b;return _0x434d26;})[_0x9edd('0x1a')](respondWithFilteredResult(_0x968303,_0x148630))[_0x9edd('0x25')](handleError(_0x968303,null));};exports['show']=function(_0x387fb8,_0x35e63c){var _0x40e33d={'raw':![],'where':{'id':_0x387fb8[_0x9edd('0x4c')]['id']}},_0x4a89ae={};_0x4a89ae[_0x9edd('0x38')]=_[_0x9edd('0x39')](db[_0x9edd('0x4a')][_0x9edd('0x37')]);_0x4a89ae[_0x9edd('0x3a')]=_['keys'](_0x387fb8[_0x9edd('0x3a')]);_0x4a89ae[_0x9edd('0x3b')]=_['intersection'](_0x4a89ae[_0x9edd('0x38')],_0x4a89ae[_0x9edd('0x3a')]);_0x40e33d['attributes']=_[_0x9edd('0x3c')](_0x4a89ae[_0x9edd('0x38')],qs[_0x9edd('0x3d')](_0x387fb8['query'][_0x9edd('0x3d')]));_0x40e33d[_0x9edd('0x3e')]=_0x40e33d[_0x9edd('0x3e')][_0x9edd('0x4d')]?_0x40e33d['attributes']:_0x4a89ae[_0x9edd('0x38')];if(_0x387fb8[_0x9edd('0x3a')][_0x9edd('0x4e')]){_0x40e33d['include']=[{'all':!![]}];}_0x40e33d=_[_0x9edd('0x44')]({},_0x40e33d,_0x387fb8[_0x9edd('0x4f')]);return db['ZohoConfiguration'][_0x9edd('0x50')](_0x40e33d)['then'](handleEntityNotFound(_0x35e63c,null))[_0x9edd('0x1a')](respondWithResult(_0x35e63c,null))[_0x9edd('0x25')](handleError(_0x35e63c,null));};exports[_0x9edd('0x51')]=function(_0x3fcdf5,_0x1e3c19){return db[_0x9edd('0x4a')][_0x9edd('0x51')](_0x3fcdf5[_0x9edd('0x52')],{})[_0x9edd('0x1a')](respondWithResult(_0x1e3c19,0xc9))[_0x9edd('0x25')](handleError(_0x1e3c19,null));};exports[_0x9edd('0x31')]=function(_0x5a3b1d,_0x161bea){if(_0x5a3b1d[_0x9edd('0x52')]['id']){delete _0x5a3b1d[_0x9edd('0x52')]['id'];}return db['ZohoConfiguration'][_0x9edd('0x50')]({'where':{'id':_0x5a3b1d['params']['id']}})['then'](handleEntityNotFound(_0x161bea,null))['then'](saveUpdates(_0x5a3b1d[_0x9edd('0x52')],null))[_0x9edd('0x1a')](respondWithResult(_0x161bea,null))[_0x9edd('0x25')](handleError(_0x161bea,null));};exports[_0x9edd('0x32')]=function(_0x48a900,_0x56b38b){return db['ZohoConfiguration'][_0x9edd('0x50')]({'where':{'id':_0x48a900[_0x9edd('0x4c')]['id']}})[_0x9edd('0x1a')](handleEntityNotFound(_0x56b38b,null))[_0x9edd('0x1a')](removeEntity(_0x56b38b,null))[_0x9edd('0x25')](handleError(_0x56b38b,null));};exports[_0x9edd('0x53')]=function(_0x25906c,_0x1e3087,_0x4eb780){var _0x16dfdc={};var _0x49d0ce={};var _0x421e82;var _0x6a1cfc;return db['ZohoConfiguration'][_0x9edd('0x54')]({'where':{'id':_0x25906c[_0x9edd('0x4c')]['id']}})[_0x9edd('0x1a')](handleEntityNotFound(_0x1e3087,null))['then'](function(_0xc648c4){if(_0xc648c4){_0x421e82=_0xc648c4;_0x49d0ce[_0x9edd('0x38')]=_[_0x9edd('0x39')](db[_0x9edd('0x55')][_0x9edd('0x37')]);_0x49d0ce[_0x9edd('0x3a')]=_['keys'](_0x25906c['query']);_0x49d0ce[_0x9edd('0x3b')]=_['intersection'](_0x49d0ce[_0x9edd('0x38')],_0x49d0ce[_0x9edd('0x3a')]);_0x16dfdc[_0x9edd('0x3e')]=_[_0x9edd('0x3c')](_0x49d0ce['model'],qs[_0x9edd('0x3d')](_0x25906c['query'][_0x9edd('0x3d')]));_0x16dfdc[_0x9edd('0x3e')]=_0x16dfdc[_0x9edd('0x3e')]['length']?_0x16dfdc[_0x9edd('0x3e')]:_0x49d0ce['model'];_0x16dfdc[_0x9edd('0x56')]=qs[_0x9edd('0x40')](_0x25906c['query'][_0x9edd('0x40')]);_0x16dfdc['where']=qs[_0x9edd('0x3b')](_[_0x9edd('0x42')](_0x25906c[_0x9edd('0x3a')],_0x49d0ce['filters']));if(_0x25906c[_0x9edd('0x3a')][_0x9edd('0x43')]){_0x16dfdc[_0x9edd('0x41')]=_[_0x9edd('0x44')](_0x16dfdc[_0x9edd('0x41')],{'$or':_['map'](_0x16dfdc['attributes'],function(_0x2e1a96){var _0x211526={};_0x211526[_0x2e1a96]={'$like':'%'+_0x25906c['query']['filter']+'%'};return _0x211526;})});}_0x16dfdc=_['merge']({},_0x16dfdc,_0x25906c[_0x9edd('0x4f')]);return _0x421e82['getFields'](_0x16dfdc);}})['then'](function(_0x3ef9c9){if(_0x3ef9c9){_0x6a1cfc=_0x3ef9c9[_0x9edd('0x4d')];if(!_0x25906c['query'][_0x9edd('0x57')](_0x9edd('0x3f'))){_0x16dfdc[_0x9edd('0x2b')]=qs['limit'](_0x25906c[_0x9edd('0x3a')]['limit']);_0x16dfdc[_0x9edd('0x2a')]=qs[_0x9edd('0x2a')](_0x25906c['query'][_0x9edd('0x2a')]);}return _0x421e82[_0x9edd('0x53')](_0x16dfdc);}})['then'](function(_0x2bd6d1){if(_0x2bd6d1){return _0x2bd6d1?{'count':_0x6a1cfc,'rows':_0x2bd6d1}:null;}})[_0x9edd('0x1a')](respondWithResult(_0x1e3087,null))[_0x9edd('0x25')](handleError(_0x1e3087,null));};exports[_0x9edd('0x58')]=function(_0x5ce70b,_0x366b04,_0x58330c){var _0x1a618c={};var _0x1a5cdb={};var _0xf6c8aa;var _0x5ad6f4;return db[_0x9edd('0x4a')][_0x9edd('0x54')]({'where':{'id':_0x5ce70b[_0x9edd('0x4c')]['id']}})[_0x9edd('0x1a')](handleEntityNotFound(_0x366b04,null))[_0x9edd('0x1a')](function(_0x14e2e5){if(_0x14e2e5){_0xf6c8aa=_0x14e2e5;_0x1a5cdb[_0x9edd('0x38')]=_['keys'](db['ZohoField'][_0x9edd('0x37')]);_0x1a5cdb[_0x9edd('0x3a')]=_[_0x9edd('0x39')](_0x5ce70b[_0x9edd('0x3a')]);_0x1a5cdb[_0x9edd('0x3b')]=_['intersection'](_0x1a5cdb[_0x9edd('0x38')],_0x1a5cdb[_0x9edd('0x3a')]);_0x1a618c[_0x9edd('0x3e')]=_['intersection'](_0x1a5cdb[_0x9edd('0x38')],qs[_0x9edd('0x3d')](_0x5ce70b['query'][_0x9edd('0x3d')]));_0x1a618c[_0x9edd('0x3e')]=_0x1a618c['attributes'][_0x9edd('0x4d')]?_0x1a618c[_0x9edd('0x3e')]:_0x1a5cdb['model'];_0x1a618c[_0x9edd('0x56')]=qs['sort'](_0x5ce70b['query'][_0x9edd('0x40')]);_0x1a618c[_0x9edd('0x41')]=qs[_0x9edd('0x3b')](_['pick'](_0x5ce70b[_0x9edd('0x3a')],_0x1a5cdb[_0x9edd('0x3b')]));if(_0x5ce70b['query'][_0x9edd('0x43')]){_0x1a618c[_0x9edd('0x41')]=_[_0x9edd('0x44')](_0x1a618c[_0x9edd('0x41')],{'$or':_['map'](_0x1a618c['attributes'],function(_0x1129b7){var _0x5bb28c={};_0x5bb28c[_0x1129b7]={'$like':'%'+_0x5ce70b[_0x9edd('0x3a')][_0x9edd('0x43')]+'%'};return _0x5bb28c;})});}_0x1a618c=_[_0x9edd('0x44')]({},_0x1a618c,_0x5ce70b[_0x9edd('0x4f')]);return _0xf6c8aa[_0x9edd('0x58')](_0x1a618c);}})[_0x9edd('0x1a')](function(_0x1eabcd){if(_0x1eabcd){_0x5ad6f4=_0x1eabcd[_0x9edd('0x4d')];if(!_0x5ce70b[_0x9edd('0x3a')]['hasOwnProperty'](_0x9edd('0x3f'))){_0x1a618c[_0x9edd('0x2b')]=qs[_0x9edd('0x2b')](_0x5ce70b[_0x9edd('0x3a')][_0x9edd('0x2b')]);_0x1a618c[_0x9edd('0x2a')]=qs[_0x9edd('0x2a')](_0x5ce70b['query'][_0x9edd('0x2a')]);}return _0xf6c8aa[_0x9edd('0x58')](_0x1a618c);}})['then'](function(_0x26c11a){if(_0x26c11a){return _0x26c11a?{'count':_0x5ad6f4,'rows':_0x26c11a}:null;}})[_0x9edd('0x1a')](respondWithResult(_0x366b04,null))['catch'](handleError(_0x366b04,null));};exports[_0x9edd('0x59')]=function(_0x3d6d7a,_0xfd1b61,_0x55d112){var _0x41cd76={};var _0x191c3e={};var _0x3f04d3;var _0x5a7de3;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x3d6d7a['params']['id']}})[_0x9edd('0x1a')](handleEntityNotFound(_0xfd1b61,null))[_0x9edd('0x1a')](function(_0x179b7f){if(_0x179b7f){_0x3f04d3=_0x179b7f;_0x191c3e['model']=_['keys'](db['ZohoField'][_0x9edd('0x37')]);_0x191c3e[_0x9edd('0x3a')]=_[_0x9edd('0x39')](_0x3d6d7a[_0x9edd('0x3a')]);_0x191c3e[_0x9edd('0x3b')]=_[_0x9edd('0x3c')](_0x191c3e[_0x9edd('0x38')],_0x191c3e[_0x9edd('0x3a')]);_0x41cd76[_0x9edd('0x3e')]=_[_0x9edd('0x3c')](_0x191c3e[_0x9edd('0x38')],qs[_0x9edd('0x3d')](_0x3d6d7a['query'][_0x9edd('0x3d')]));_0x41cd76[_0x9edd('0x3e')]=_0x41cd76[_0x9edd('0x3e')][_0x9edd('0x4d')]?_0x41cd76[_0x9edd('0x3e')]:_0x191c3e[_0x9edd('0x38')];_0x41cd76[_0x9edd('0x56')]=qs[_0x9edd('0x40')](_0x3d6d7a['query']['sort']);_0x41cd76[_0x9edd('0x41')]=qs['filters'](_[_0x9edd('0x42')](_0x3d6d7a['query'],_0x191c3e[_0x9edd('0x3b')]));if(_0x3d6d7a[_0x9edd('0x3a')]['filter']){_0x41cd76[_0x9edd('0x41')]=_[_0x9edd('0x44')](_0x41cd76['where'],{'$or':_[_0x9edd('0x45')](_0x41cd76[_0x9edd('0x3e')],function(_0x42d546){var _0xa36fa1={};_0xa36fa1[_0x42d546]={'$like':'%'+_0x3d6d7a[_0x9edd('0x3a')]['filter']+'%'};return _0xa36fa1;})});}_0x41cd76=_[_0x9edd('0x44')]({},_0x41cd76,_0x3d6d7a[_0x9edd('0x4f')]);return _0x3f04d3[_0x9edd('0x59')](_0x41cd76);}})[_0x9edd('0x1a')](function(_0xe898ec){if(_0xe898ec){_0x5a7de3=_0xe898ec['length'];if(!_0x3d6d7a['query']['hasOwnProperty']('nolimit')){_0x41cd76['limit']=qs[_0x9edd('0x2b')](_0x3d6d7a['query']['limit']);_0x41cd76[_0x9edd('0x2a')]=qs[_0x9edd('0x2a')](_0x3d6d7a[_0x9edd('0x3a')][_0x9edd('0x2a')]);}return _0x3f04d3[_0x9edd('0x59')](_0x41cd76);}})[_0x9edd('0x1a')](function(_0x23e213){if(_0x23e213){return _0x23e213?{'count':_0x5a7de3,'rows':_0x23e213}:null;}})[_0x9edd('0x1a')](respondWithResult(_0xfd1b61,null))[_0x9edd('0x25')](handleError(_0xfd1b61,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index c421d47..bf9f06a 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 _0xbdb7=['request-promise','path','rimraf','./intZohoConfiguration.attributes','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x56db28,_0x95952b){_0x56db28=_0x56db28-0x0;var _0x255efc=_0xbdb7[_0x56db28];return _0x255efc;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var moment=require(_0x7bdb('0x4'));var BPromise=require(_0x7bdb('0x5'));var rp=require(_0x7bdb('0x6'));var fs=require('fs');var path=require(_0x7bdb('0x7'));var rimraf=require(_0x7bdb('0x8'));var config=require('../../config/environment');var attributes=require(_0x7bdb('0x9'));module['exports']=function(_0x4b5fff,_0xffdc86){return _0x4b5fff[_0x7bdb('0xa')]('ZohoConfiguration',attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xefda=['../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','api','moment','request-promise','path','rimraf'];(function(_0x154a33,_0x49bc50){var _0x135af0=function(_0x487309){while(--_0x487309){_0x154a33['push'](_0x154a33['shift']());}};_0x135af0(++_0x49bc50);}(_0xefda,0x96));var _0xaefd=function(_0x1d88f0,_0x4cefd2){_0x1d88f0=_0x1d88f0-0x0;var _0xfc07ee=_0xefda[_0x1d88f0];return _0xfc07ee;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaefd('0x1'));var moment=require(_0xaefd('0x2'));var BPromise=require('bluebird');var rp=require(_0xaefd('0x3'));var fs=require('fs');var path=require(_0xaefd('0x4'));var rimraf=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var attributes=require(_0xaefd('0x7'));module[_0xaefd('0x8')]=function(_0x497258,_0x3677ea){return _0x497258[_0xaefd('0x9')](_0xaefd('0xa'),attributes,{'tableName':_0xaefd('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 c7465dd..555a537 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 _0x6429=['jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x368742,_0x37349f){var _0x480741=function(_0x47881c){while(--_0x47881c){_0x368742['push'](_0x368742['shift']());}};_0x480741(++_0x37349f);}(_0x6429,0x184));var _0x9642=function(_0x2f3782,_0x150f14){_0x2f3782=_0x2f3782-0x0;var _0x40a8c4=_0x6429[_0x2f3782];return _0x40a8c4;};'use strict';var _=require(_0x9642('0x0'));var util=require(_0x9642('0x1'));var moment=require(_0x9642('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9642('0x3'))['db'];var utils=require(_0x9642('0x4'));var logger=require(_0x9642('0x5'))(_0x9642('0x6'));var config=require(_0x9642('0x7'));var jayson=require(_0x9642('0x8'));var client=jayson[_0x9642('0x9')][_0x9642('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x115577,_0x288a43,_0x36e548){return new BPromise(function(_0x3f8d1b,_0x4f6ebd){return client[_0x9642('0xb')](_0x115577,_0x36e548)['then'](function(_0x3d2026){logger[_0x9642('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x288a43,_0x9642('0xd'));logger[_0x9642('0xe')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x288a43,'request\x20sent',JSON[_0x9642('0xf')](_0x3d2026));if(_0x3d2026[_0x9642('0x10')]){if(_0x3d2026[_0x9642('0x10')][_0x9642('0x11')]===0x1f4){logger[_0x9642('0x10')](_0x9642('0x12'),_0x288a43,_0x3d2026[_0x9642('0x10')][_0x9642('0x13')]);return _0x4f6ebd(_0x3d2026[_0x9642('0x10')][_0x9642('0x13')]);}logger[_0x9642('0x10')](_0x9642('0x12'),_0x288a43,_0x3d2026[_0x9642('0x10')]['message']);return _0x3f8d1b(_0x3d2026[_0x9642('0x10')][_0x9642('0x13')]);}else{logger[_0x9642('0xc')](_0x9642('0x12'),_0x288a43,_0x9642('0xd'));_0x3f8d1b(_0x3d2026[_0x9642('0x14')][_0x9642('0x13')]);}})[_0x9642('0x15')](function(_0x3a7cc7){logger[_0x9642('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x288a43,_0x3a7cc7);_0x4f6ebd(_0x3a7cc7);});});} \ No newline at end of file +var _0xb559=['error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x16995f,_0x326c0f){var _0x37931a=function(_0x1b6393){while(--_0x1b6393){_0x16995f['push'](_0x16995f['shift']());}};_0x37931a(++_0x326c0f);}(_0xb559,0x149));var _0x9b55=function(_0x1c36a8,_0x49c835){_0x1c36a8=_0x1c36a8-0x0;var _0xb622c5=_0xb559[_0x1c36a8];return _0xb622c5;};'use strict';var _=require(_0x9b55('0x0'));var util=require(_0x9b55('0x1'));var moment=require(_0x9b55('0x2'));var BPromise=require('bluebird');var rs=require(_0x9b55('0x3'));var fs=require('fs');var Redis=require(_0x9b55('0x4'));var db=require(_0x9b55('0x5'))['db'];var utils=require(_0x9b55('0x6'));var logger=require(_0x9b55('0x7'))(_0x9b55('0x8'));var config=require(_0x9b55('0x9'));var jayson=require(_0x9b55('0xa'));var client=jayson[_0x9b55('0xb')][_0x9b55('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3ca137,_0xde712e,_0x5a85eb){return new BPromise(function(_0x2ceb9f,_0x311bfc){return client[_0x9b55('0xd')](_0x3ca137,_0x5a85eb)[_0x9b55('0xe')](function(_0x3cf317){logger[_0x9b55('0xf')](_0x9b55('0x10'),_0xde712e,_0x9b55('0x11'));logger[_0x9b55('0x12')](_0x9b55('0x13'),_0xde712e,_0x9b55('0x11'),JSON[_0x9b55('0x14')](_0x3cf317));if(_0x3cf317[_0x9b55('0x15')]){if(_0x3cf317['error']['code']===0x1f4){logger[_0x9b55('0x15')](_0x9b55('0x10'),_0xde712e,_0x3cf317['error']['message']);return _0x311bfc(_0x3cf317[_0x9b55('0x15')][_0x9b55('0x16')]);}logger[_0x9b55('0x15')](_0x9b55('0x10'),_0xde712e,_0x3cf317[_0x9b55('0x15')][_0x9b55('0x16')]);return _0x2ceb9f(_0x3cf317[_0x9b55('0x15')]['message']);}else{logger[_0x9b55('0xf')](_0x9b55('0x10'),_0xde712e,_0x9b55('0x11'));_0x2ceb9f(_0x3cf317[_0x9b55('0x17')][_0x9b55('0x16')]);}})[_0x9b55('0x18')](function(_0x23d75e){logger[_0x9b55('0x15')](_0x9b55('0x10'),_0xde712e,_0x23d75e);_0x311bfc(_0x23d75e);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index f4b9635..81ac07d 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 _0x848f=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','get','/:id','post','create','put','update','delete','destroy','exports','multer'];(function(_0x4dfddc,_0x159aa2){var _0x45dcea=function(_0x181a3){while(--_0x181a3){_0x4dfddc['push'](_0x4dfddc['shift']());}};_0x45dcea(++_0x159aa2);}(_0x848f,0x9f));var _0xf848=function(_0x40036d,_0x354007){_0x40036d=_0x40036d-0x0;var _0x476278=_0x848f[_0x40036d];return _0x476278;};'use strict';var multer=require(_0xf848('0x0'));var util=require(_0xf848('0x1'));var path=require(_0xf848('0x2'));var timeout=require(_0xf848('0x3'));var express=require(_0xf848('0x4'));var router=express[_0xf848('0x5')]();var auth=require(_0xf848('0x6'));var interaction=require(_0xf848('0x7'));var config=require(_0xf848('0x8'));var controller=require(_0xf848('0x9'));router['get']('/',auth[_0xf848('0xa')](),controller['index']);router[_0xf848('0xb')](_0xf848('0xc'),auth[_0xf848('0xa')](),controller['show']);router[_0xf848('0xd')]('/',auth[_0xf848('0xa')](),controller[_0xf848('0xe')]);router[_0xf848('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xf848('0x10')]);router[_0xf848('0x11')](_0xf848('0xc'),auth[_0xf848('0xa')](),controller[_0xf848('0x12')]);module[_0xf848('0x13')]=router; \ No newline at end of file +var _0x4dcd=['delete','destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id','create','put','update'];(function(_0xd9c3a4,_0x59d54e){var _0x1c8944=function(_0x2edb5b){while(--_0x2edb5b){_0xd9c3a4['push'](_0xd9c3a4['shift']());}};_0x1c8944(++_0x59d54e);}(_0x4dcd,0xe3));var _0xd4dc=function(_0x1c5ac2,_0x3d6b32){_0x1c5ac2=_0x1c5ac2-0x0;var _0xd41d6=_0x4dcd[_0x1c5ac2];return _0xd41d6;};'use strict';var multer=require(_0xd4dc('0x0'));var util=require('util');var path=require(_0xd4dc('0x1'));var timeout=require('connect-timeout');var express=require(_0xd4dc('0x2'));var router=express['Router']();var auth=require(_0xd4dc('0x3'));var interaction=require(_0xd4dc('0x4'));var config=require('../../config/environment');var controller=require(_0xd4dc('0x5'));router[_0xd4dc('0x6')]('/',auth[_0xd4dc('0x7')](),controller[_0xd4dc('0x8')]);router['get'](_0xd4dc('0x9'),auth[_0xd4dc('0x7')](),controller['show']);router['post']('/',auth[_0xd4dc('0x7')](),controller[_0xd4dc('0xa')]);router[_0xd4dc('0xb')](_0xd4dc('0x9'),auth[_0xd4dc('0x7')](),controller[_0xd4dc('0xc')]);router[_0xd4dc('0xd')](_0xd4dc('0x9'),auth[_0xd4dc('0x7')](),controller[_0xd4dc('0xe')]);module[_0xd4dc('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 94927ec..64fcf3e 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 _0xd64b=['BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x2ef5ce,_0x158394){var _0x41b91b=function(_0x43d0f3){while(--_0x43d0f3){_0x2ef5ce['push'](_0x2ef5ce['shift']());}};_0x41b91b(++_0x158394);}(_0xd64b,0xc1));var _0xbd64=function(_0x206de1,_0x42247b){_0x206de1=_0x206de1-0x0;var _0x5bd6a8=_0xd64b[_0x206de1];return _0x5bd6a8;};'use strict';var Sequelize=require(_0xbd64('0x0'));module['exports']={'type':{'type':Sequelize[_0xbd64('0x1')]('string',_0xbd64('0x2'),_0xbd64('0x3'),_0xbd64('0x4')),'defaultValue':_0xbd64('0x5')},'content':{'type':Sequelize[_0xbd64('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xbd64('0x3'))},'keyContent':{'type':Sequelize[_0xbd64('0x6')]},'idField':{'type':Sequelize[_0xbd64('0x6')]},'nameField':{'type':Sequelize[_0xbd64('0x6')]},'customField':{'type':Sequelize[_0xbd64('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbd64('0x6')]}}; \ No newline at end of file +var _0x96cc=['keyValue','string','STRING','BOOLEAN','sequelize','ENUM','variable','customVariable'];(function(_0x19655b,_0x37375b){var _0x10314d=function(_0x40bc5e){while(--_0x40bc5e){_0x19655b['push'](_0x19655b['shift']());}};_0x10314d(++_0x37375b);}(_0x96cc,0x16c));var _0xc96c=function(_0x208df0,_0x42ecdf){_0x208df0=_0x208df0-0x0;var _0x2ad4df=_0x96cc[_0x208df0];return _0x2ad4df;};'use strict';var Sequelize=require(_0xc96c('0x0'));module['exports']={'type':{'type':Sequelize[_0xc96c('0x1')]('string',_0xc96c('0x2'),_0xc96c('0x3'),_0xc96c('0x4')),'defaultValue':_0xc96c('0x5')},'content':{'type':Sequelize[_0xc96c('0x6')]},'key':{'type':Sequelize[_0xc96c('0x6')]},'keyType':{'type':Sequelize[_0xc96c('0x1')](_0xc96c('0x5'),_0xc96c('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xc96c('0x6')]},'idField':{'type':Sequelize[_0xc96c('0x6')]},'nameField':{'type':Sequelize[_0xc96c('0x6')]},'customField':{'type':Sequelize[_0xc96c('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc96c('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 95fe4e4..e207d4f 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 _0x1261=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','sendStatus','status','end','count','offset','limit','json','save','update','destroy','error','stack','name','send','ZohoField','model','keys','filters','attributes','query','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','key','field','filter','then','includeAll','include','findAll','rows','catch','show','rawAttributes','intersection','options','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv'];(function(_0x208699,_0x243546){var _0x13b873=function(_0x381c56){while(--_0x381c56){_0x208699['push'](_0x208699['shift']());}};_0x13b873(++_0x243546);}(_0x1261,0x144));var _0x1126=function(_0x4706a6,_0x5a1c63){_0x4706a6=_0x4706a6-0x0;var _0x1bb705=_0x1261[_0x4706a6];return _0x1bb705;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1126('0x0'));var rimraf=require(_0x1126('0x1'));var zipdir=require(_0x1126('0x2'));var jsonpatch=require(_0x1126('0x3'));var rp=require(_0x1126('0x4'));var moment=require(_0x1126('0x5'));var BPromise=require(_0x1126('0x6'));var Mustache=require(_0x1126('0x7'));var util=require(_0x1126('0x8'));var path=require(_0x1126('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1126('0xa'));var fs=require('fs');var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1126('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1126('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15e89b,_0x1b364a){_0x1b364a=_0x1b364a||0xcc;return function(_0xd26a32){if(_0xd26a32){return _0x15e89b[_0x1126('0x16')](_0x1b364a);}return _0x15e89b[_0x1126('0x17')](_0x1b364a)[_0x1126('0x18')]();};}function respondWithResult(_0xd8ca42,_0x2048ad){_0x2048ad=_0x2048ad||0xc8;return function(_0x43850b){if(_0x43850b){return _0xd8ca42['status'](_0x2048ad)['json'](_0x43850b);}};}function respondWithFilteredResult(_0x1af673,_0x154e20){return function(_0x279455){if(_0x279455){var _0x4be0c6=_0x279455[_0x1126('0x19')],_0x45149c=_0x154e20[_0x1126('0x1a')],_0x4794a7=_0x154e20['offset']+_0x154e20[_0x1126('0x1b')],_0x35fe9f;if(_0x4794a7>=_0x4be0c6){_0x4794a7=_0x4be0c6;_0x35fe9f=0xc8;}else{_0x35fe9f=0xce;}_0x1af673[_0x1126('0x17')](_0x35fe9f);return _0x1af673['set']('Content-Range',_0x45149c+'-'+_0x4794a7+'/'+_0x4be0c6)[_0x1126('0x1c')](_0x279455);}return null;};}function patchUpdates(_0x2b2487){return function(_0x58d11a){try{jsonpatch['apply'](_0x58d11a,_0x2b2487,!![]);}catch(_0x4564c0){return BPromise['reject'](_0x4564c0);}return _0x58d11a[_0x1126('0x1d')]();};}function saveUpdates(_0x1d6d19,_0x2f70ac){return function(_0x54400a){if(_0x54400a){return _0x54400a[_0x1126('0x1e')](_0x1d6d19)['then'](function(_0x56efeb){return _0x56efeb;});}return null;};}function removeEntity(_0x30f6b3,_0x3a9bed){return function(_0x25b24b){if(_0x25b24b){return _0x25b24b[_0x1126('0x1f')]()['then'](function(){_0x30f6b3[_0x1126('0x17')](0xcc)[_0x1126('0x18')]();});}};}function handleEntityNotFound(_0x48a08d,_0x2175fa){return function(_0x59cd8e){if(!_0x59cd8e){_0x48a08d['sendStatus'](0x194);}return _0x59cd8e;};}function handleError(_0x4b57ab,_0x2199d9){_0x2199d9=_0x2199d9||0x1f4;return function(_0x15bcc3){logger[_0x1126('0x20')](_0x15bcc3[_0x1126('0x21')]);if(_0x15bcc3[_0x1126('0x22')]){delete _0x15bcc3[_0x1126('0x22')];}_0x4b57ab[_0x1126('0x17')](_0x2199d9)[_0x1126('0x23')](_0x15bcc3);};}exports['index']=function(_0x35eec3,_0x375e59){var _0xa293f4={},_0x5ddf63={},_0x541bc9={'count':0x0,'rows':[]};var _0xeb7d89=db[_0x1126('0x24')]['rawAttributes'];_0x5ddf63[_0x1126('0x25')]=_[_0x1126('0x26')](_0xeb7d89);_0x5ddf63['query']=_[_0x1126('0x26')](_0x35eec3['query']);_0x5ddf63[_0x1126('0x27')]=_['intersection'](_0x5ddf63[_0x1126('0x25')],_0x5ddf63['query']);_0xa293f4[_0x1126('0x28')]=_['intersection'](_0x5ddf63['model'],qs['fields'](_0x35eec3[_0x1126('0x29')][_0x1126('0x2a')]));_0xa293f4[_0x1126('0x28')]=_0xa293f4['attributes'][_0x1126('0x2b')]?_0xa293f4[_0x1126('0x28')]:_0x5ddf63['model'];if(!_0x35eec3[_0x1126('0x29')][_0x1126('0x2c')](_0x1126('0x2d'))){_0xa293f4[_0x1126('0x1b')]=qs['limit'](_0x35eec3['query'][_0x1126('0x1b')]);_0xa293f4[_0x1126('0x1a')]=qs[_0x1126('0x1a')](_0x35eec3[_0x1126('0x29')]['offset']);}_0xa293f4[_0x1126('0x2e')]=qs[_0x1126('0x2f')](_0x35eec3[_0x1126('0x29')][_0x1126('0x2f')]);_0xa293f4[_0x1126('0x30')]=qs['filters'](_[_0x1126('0x31')](_0x35eec3[_0x1126('0x29')],_0x5ddf63[_0x1126('0x27')]));if(_0x35eec3[_0x1126('0x29')]['filter']){_0xa293f4['where']=_[_0x1126('0x32')](_0xa293f4[_0x1126('0x30')],{'$or':_['map'](_0xeb7d89,function(_0xde37cf){if(_0xde37cf[_0x1126('0x33')][_0x1126('0x34')]!=='VIRTUAL'){var _0x4b3859={};_0x4b3859[_0xde37cf[_0x1126('0x35')]]={'$like':'%'+_0x35eec3[_0x1126('0x29')][_0x1126('0x36')]+'%'};return _0x4b3859;}})});}_0xa293f4=_[_0x1126('0x32')]({},_0xa293f4,_0x35eec3['options']);var _0x428d3d={'where':_0xa293f4['where']};return db[_0x1126('0x24')][_0x1126('0x19')](_0x428d3d)[_0x1126('0x37')](function(_0x1ea702){_0x541bc9[_0x1126('0x19')]=_0x1ea702;if(_0x35eec3['query'][_0x1126('0x38')]){_0xa293f4[_0x1126('0x39')]=[{'all':!![]}];}return db[_0x1126('0x24')][_0x1126('0x3a')](_0xa293f4);})[_0x1126('0x37')](function(_0x3442b8){_0x541bc9[_0x1126('0x3b')]=_0x3442b8;return _0x541bc9;})['then'](respondWithFilteredResult(_0x375e59,_0xa293f4))[_0x1126('0x3c')](handleError(_0x375e59,null));};exports[_0x1126('0x3d')]=function(_0x227a6b,_0xf3a0bd){var _0xcf0483={'raw':!![],'where':{'id':_0x227a6b['params']['id']}},_0x518de1={};_0x518de1[_0x1126('0x25')]=_[_0x1126('0x26')](db[_0x1126('0x24')][_0x1126('0x3e')]);_0x518de1[_0x1126('0x29')]=_[_0x1126('0x26')](_0x227a6b['query']);_0x518de1['filters']=_['intersection'](_0x518de1[_0x1126('0x25')],_0x518de1['query']);_0xcf0483[_0x1126('0x28')]=_[_0x1126('0x3f')](_0x518de1[_0x1126('0x25')],qs[_0x1126('0x2a')](_0x227a6b['query']['fields']));_0xcf0483[_0x1126('0x28')]=_0xcf0483[_0x1126('0x28')][_0x1126('0x2b')]?_0xcf0483['attributes']:_0x518de1[_0x1126('0x25')];if(_0x227a6b['query'][_0x1126('0x38')]){_0xcf0483['include']=[{'all':!![]}];}_0xcf0483=_[_0x1126('0x32')]({},_0xcf0483,_0x227a6b[_0x1126('0x40')]);return db[_0x1126('0x24')]['find'](_0xcf0483)[_0x1126('0x37')](handleEntityNotFound(_0xf3a0bd,null))[_0x1126('0x37')](respondWithResult(_0xf3a0bd,null))[_0x1126('0x3c')](handleError(_0xf3a0bd,null));};exports['create']=function(_0x58ff3a,_0x4dd7f5){return db[_0x1126('0x24')]['create'](_0x58ff3a[_0x1126('0x41')],{})['then'](respondWithResult(_0x4dd7f5,0xc9))[_0x1126('0x3c')](handleError(_0x4dd7f5,null));};exports[_0x1126('0x1e')]=function(_0x146066,_0x120de1){if(_0x146066[_0x1126('0x41')]['id']){delete _0x146066['body']['id'];}return db[_0x1126('0x24')][_0x1126('0x42')]({'where':{'id':_0x146066['params']['id']}})[_0x1126('0x37')](handleEntityNotFound(_0x120de1,null))[_0x1126('0x37')](saveUpdates(_0x146066['body'],null))[_0x1126('0x37')](respondWithResult(_0x120de1,null))[_0x1126('0x3c')](handleError(_0x120de1,null));};exports['destroy']=function(_0x3e4eeb,_0xbdde58){return db[_0x1126('0x24')]['find']({'where':{'id':_0x3e4eeb[_0x1126('0x43')]['id']}})[_0x1126('0x37')](handleEntityNotFound(_0xbdde58,null))[_0x1126('0x37')](removeEntity(_0xbdde58,null))[_0x1126('0x3c')](handleError(_0xbdde58,null));}; \ No newline at end of file +var _0xdb28=['count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','ZohoField','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','merge','map','type','key','filter','options','include','findAll','rows','catch','show','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json'];(function(_0x2765dd,_0x2bb952){var _0x3a2dae=function(_0x570c9f){while(--_0x570c9f){_0x2765dd['push'](_0x2765dd['shift']());}};_0x3a2dae(++_0x2bb952);}(_0xdb28,0x106));var _0x8db2=function(_0x2afe3a,_0x39b91b){_0x2afe3a=_0x2afe3a-0x0;var _0x4afe42=_0xdb28[_0x2afe3a];return _0x4afe42;};'use strict';var pdf=require(_0x8db2('0x0'));var emlformat=require(_0x8db2('0x1'));var rimraf=require(_0x8db2('0x2'));var zipdir=require(_0x8db2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8db2('0x4'));var moment=require(_0x8db2('0x5'));var BPromise=require(_0x8db2('0x6'));var Mustache=require(_0x8db2('0x7'));var util=require(_0x8db2('0x8'));var path=require('path');var sox=require(_0x8db2('0x9'));var csv=require(_0x8db2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0xa'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var hardwareService=require(_0x8db2('0x13'));var logger=require('../../config/logger')(_0x8db2('0x14'));var utils=require(_0x8db2('0x15'));var config=require('../../config/environment');var db=require(_0x8db2('0x16'))['db'];function respondWithStatusCode(_0x3b2faa,_0x1349f6){_0x1349f6=_0x1349f6||0xcc;return function(_0x204f49){if(_0x204f49){return _0x3b2faa[_0x8db2('0x17')](_0x1349f6);}return _0x3b2faa['status'](_0x1349f6)['end']();};}function respondWithResult(_0x15070d,_0x15e87c){_0x15e87c=_0x15e87c||0xc8;return function(_0x350d61){if(_0x350d61){return _0x15070d[_0x8db2('0x18')](_0x15e87c)[_0x8db2('0x19')](_0x350d61);}};}function respondWithFilteredResult(_0xfa285b,_0x2f177a){return function(_0x3c96a7){if(_0x3c96a7){var _0x131252=_0x3c96a7[_0x8db2('0x1a')],_0x16c8c2=_0x2f177a['offset'],_0x5489a9=_0x2f177a[_0x8db2('0x1b')]+_0x2f177a[_0x8db2('0x1c')],_0x13b0f5;if(_0x5489a9>=_0x131252){_0x5489a9=_0x131252;_0x13b0f5=0xc8;}else{_0x13b0f5=0xce;}_0xfa285b[_0x8db2('0x18')](_0x13b0f5);return _0xfa285b[_0x8db2('0x1d')](_0x8db2('0x1e'),_0x16c8c2+'-'+_0x5489a9+'/'+_0x131252)[_0x8db2('0x19')](_0x3c96a7);}return null;};}function patchUpdates(_0x51d60d){return function(_0x5df464){try{jsonpatch[_0x8db2('0x1f')](_0x5df464,_0x51d60d,!![]);}catch(_0x104e33){return BPromise[_0x8db2('0x20')](_0x104e33);}return _0x5df464[_0x8db2('0x21')]();};}function saveUpdates(_0x58562e,_0x431d60){return function(_0x36a9ff){if(_0x36a9ff){return _0x36a9ff[_0x8db2('0x22')](_0x58562e)[_0x8db2('0x23')](function(_0x3dbe8e){return _0x3dbe8e;});}return null;};}function removeEntity(_0x597260,_0x124467){return function(_0x3e30e6){if(_0x3e30e6){return _0x3e30e6[_0x8db2('0x24')]()[_0x8db2('0x23')](function(){_0x597260[_0x8db2('0x18')](0xcc)[_0x8db2('0x25')]();});}};}function handleEntityNotFound(_0x796ec1,_0x5c6614){return function(_0x256202){if(!_0x256202){_0x796ec1['sendStatus'](0x194);}return _0x256202;};}function handleError(_0x5725f0,_0x52a9ca){_0x52a9ca=_0x52a9ca||0x1f4;return function(_0x4d923c){logger[_0x8db2('0x26')](_0x4d923c[_0x8db2('0x27')]);if(_0x4d923c[_0x8db2('0x28')]){delete _0x4d923c[_0x8db2('0x28')];}_0x5725f0[_0x8db2('0x18')](_0x52a9ca)[_0x8db2('0x29')](_0x4d923c);};}exports['index']=function(_0x3544ba,_0x372311){var _0x430dd5={},_0x8b7cec={},_0x483aee={'count':0x0,'rows':[]};var _0x2e0691=db[_0x8db2('0x2a')][_0x8db2('0x2b')];_0x8b7cec[_0x8db2('0x2c')]=_[_0x8db2('0x2d')](_0x2e0691);_0x8b7cec[_0x8db2('0x2e')]=_[_0x8db2('0x2d')](_0x3544ba[_0x8db2('0x2e')]);_0x8b7cec[_0x8db2('0x2f')]=_['intersection'](_0x8b7cec[_0x8db2('0x2c')],_0x8b7cec['query']);_0x430dd5['attributes']=_[_0x8db2('0x30')](_0x8b7cec[_0x8db2('0x2c')],qs[_0x8db2('0x31')](_0x3544ba['query'][_0x8db2('0x31')]));_0x430dd5['attributes']=_0x430dd5[_0x8db2('0x32')][_0x8db2('0x33')]?_0x430dd5[_0x8db2('0x32')]:_0x8b7cec['model'];if(!_0x3544ba['query'][_0x8db2('0x34')](_0x8db2('0x35'))){_0x430dd5['limit']=qs['limit'](_0x3544ba[_0x8db2('0x2e')][_0x8db2('0x1c')]);_0x430dd5[_0x8db2('0x1b')]=qs[_0x8db2('0x1b')](_0x3544ba[_0x8db2('0x2e')][_0x8db2('0x1b')]);}_0x430dd5[_0x8db2('0x36')]=qs[_0x8db2('0x37')](_0x3544ba[_0x8db2('0x2e')][_0x8db2('0x37')]);_0x430dd5['where']=qs[_0x8db2('0x2f')](_[_0x8db2('0x38')](_0x3544ba['query'],_0x8b7cec[_0x8db2('0x2f')]));if(_0x3544ba[_0x8db2('0x2e')]['filter']){_0x430dd5['where']=_[_0x8db2('0x39')](_0x430dd5['where'],{'$or':_[_0x8db2('0x3a')](_0x2e0691,function(_0x264696){if(_0x264696[_0x8db2('0x3b')][_0x8db2('0x3c')]!=='VIRTUAL'){var _0x2d3e98={};_0x2d3e98[_0x264696['field']]={'$like':'%'+_0x3544ba[_0x8db2('0x2e')][_0x8db2('0x3d')]+'%'};return _0x2d3e98;}})});}_0x430dd5=_[_0x8db2('0x39')]({},_0x430dd5,_0x3544ba[_0x8db2('0x3e')]);var _0x50e88a={'where':_0x430dd5['where']};return db[_0x8db2('0x2a')][_0x8db2('0x1a')](_0x50e88a)['then'](function(_0x2bac57){_0x483aee[_0x8db2('0x1a')]=_0x2bac57;if(_0x3544ba[_0x8db2('0x2e')]['includeAll']){_0x430dd5[_0x8db2('0x3f')]=[{'all':!![]}];}return db[_0x8db2('0x2a')][_0x8db2('0x40')](_0x430dd5);})[_0x8db2('0x23')](function(_0x2e6f0c){_0x483aee[_0x8db2('0x41')]=_0x2e6f0c;return _0x483aee;})[_0x8db2('0x23')](respondWithFilteredResult(_0x372311,_0x430dd5))[_0x8db2('0x42')](handleError(_0x372311,null));};exports[_0x8db2('0x43')]=function(_0x63c561,_0x21cf7c){var _0x20bf0b={'raw':!![],'where':{'id':_0x63c561['params']['id']}},_0x1d9025={};_0x1d9025[_0x8db2('0x2c')]=_[_0x8db2('0x2d')](db['ZohoField']['rawAttributes']);_0x1d9025[_0x8db2('0x2e')]=_['keys'](_0x63c561[_0x8db2('0x2e')]);_0x1d9025[_0x8db2('0x2f')]=_[_0x8db2('0x30')](_0x1d9025[_0x8db2('0x2c')],_0x1d9025[_0x8db2('0x2e')]);_0x20bf0b[_0x8db2('0x32')]=_[_0x8db2('0x30')](_0x1d9025['model'],qs[_0x8db2('0x31')](_0x63c561[_0x8db2('0x2e')][_0x8db2('0x31')]));_0x20bf0b[_0x8db2('0x32')]=_0x20bf0b['attributes'][_0x8db2('0x33')]?_0x20bf0b[_0x8db2('0x32')]:_0x1d9025[_0x8db2('0x2c')];if(_0x63c561[_0x8db2('0x2e')]['includeAll']){_0x20bf0b[_0x8db2('0x3f')]=[{'all':!![]}];}_0x20bf0b=_['merge']({},_0x20bf0b,_0x63c561[_0x8db2('0x3e')]);return db[_0x8db2('0x2a')][_0x8db2('0x44')](_0x20bf0b)['then'](handleEntityNotFound(_0x21cf7c,null))['then'](respondWithResult(_0x21cf7c,null))[_0x8db2('0x42')](handleError(_0x21cf7c,null));};exports['create']=function(_0x173cc7,_0x467866){return db[_0x8db2('0x2a')][_0x8db2('0x45')](_0x173cc7[_0x8db2('0x46')],{})[_0x8db2('0x23')](respondWithResult(_0x467866,0xc9))[_0x8db2('0x42')](handleError(_0x467866,null));};exports[_0x8db2('0x22')]=function(_0x4291e3,_0x12a1ef){if(_0x4291e3[_0x8db2('0x46')]['id']){delete _0x4291e3[_0x8db2('0x46')]['id'];}return db['ZohoField'][_0x8db2('0x44')]({'where':{'id':_0x4291e3[_0x8db2('0x47')]['id']}})[_0x8db2('0x23')](handleEntityNotFound(_0x12a1ef,null))[_0x8db2('0x23')](saveUpdates(_0x4291e3['body'],null))['then'](respondWithResult(_0x12a1ef,null))[_0x8db2('0x42')](handleError(_0x12a1ef,null));};exports[_0x8db2('0x24')]=function(_0x164020,_0x4c66e5){return db['ZohoField']['find']({'where':{'id':_0x164020[_0x8db2('0x47')]['id']}})[_0x8db2('0x23')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x23')](removeEntity(_0x4c66e5,null))[_0x8db2('0x42')](handleError(_0x4c66e5,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index b0a6709..d381231 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 _0x516a=['util','api','moment','bluebird','request-promise','../../config/environment','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId'];(function(_0x200550,_0x35b6f0){var _0x492ea1=function(_0x174a7a){while(--_0x174a7a){_0x200550['push'](_0x200550['shift']());}};_0x492ea1(++_0x35b6f0);}(_0x516a,0x75));var _0xa516=function(_0x5cfbc5,_0xd2f722){_0x5cfbc5=_0x5cfbc5-0x0;var _0x157175=_0x516a[_0x5cfbc5];return _0x157175;};'use strict';var _=require('lodash');var util=require(_0xa516('0x0'));var logger=require('../../config/logger')(_0xa516('0x1'));var moment=require(_0xa516('0x2'));var BPromise=require(_0xa516('0x3'));var rp=require(_0xa516('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa516('0x5'));var attributes=require('./intZohoField.attributes');module[_0xa516('0x6')]=function(_0x595285,_0xdf7be8){return _0x595285[_0xa516('0x7')](_0xa516('0x8'),attributes,{'tableName':_0xa516('0x9'),'paranoid':![],'indexes':[{'name':_0xa516('0xa'),'fields':[_0xa516('0xb'),_0xa516('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4ff3=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','int_zoho_fields','zoho_unique_index','idField','FieldId'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x4ff3,0x126));var _0x34ff=function(_0x54cf7,_0x24ae00){_0x54cf7=_0x54cf7-0x0;var _0x4cb268=_0x4ff3[_0x54cf7];return _0x4cb268;};'use strict';var _=require('lodash');var util=require(_0x34ff('0x0'));var logger=require(_0x34ff('0x1'))(_0x34ff('0x2'));var moment=require(_0x34ff('0x3'));var BPromise=require(_0x34ff('0x4'));var rp=require(_0x34ff('0x5'));var fs=require('fs');var path=require(_0x34ff('0x6'));var rimraf=require(_0x34ff('0x7'));var config=require(_0x34ff('0x8'));var attributes=require(_0x34ff('0x9'));module['exports']=function(_0x187c9d,_0x186ad3){return _0x187c9d['define']('ZohoField',attributes,{'tableName':_0x34ff('0xa'),'paranoid':![],'indexes':[{'name':_0x34ff('0xb'),'fields':[_0x34ff('0xc'),_0x34ff('0xd')],'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 ec535dd..c1405b1 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 _0x8f42=['client','http','request','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoField,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x117f3d,_0x4470f7){var _0x4313a8=function(_0x44b4e7){while(--_0x44b4e7){_0x117f3d['push'](_0x117f3d['shift']());}};_0x4313a8(++_0x4470f7);}(_0x8f42,0xe7));var _0x28f4=function(_0x1660b5,_0x173f5a){_0x1660b5=_0x1660b5-0x0;var _0x57172c=_0x8f42[_0x1660b5];return _0x57172c;};'use strict';var _=require(_0x28f4('0x0'));var util=require('util');var moment=require(_0x28f4('0x1'));var BPromise=require(_0x28f4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x28f4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x28f4('0x4'));var logger=require(_0x28f4('0x5'))(_0x28f4('0x6'));var config=require(_0x28f4('0x7'));var jayson=require(_0x28f4('0x8'));var client=jayson[_0x28f4('0x9')][_0x28f4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x309e28,_0x52655d,_0x473a1b){return new BPromise(function(_0x1382d0,_0x335af2){return client[_0x28f4('0xb')](_0x309e28,_0x473a1b)[_0x28f4('0xc')](function(_0x40039f){logger[_0x28f4('0xd')]('ZohoField,\x20%s,\x20%s',_0x52655d,_0x28f4('0xe'));logger[_0x28f4('0xf')](_0x28f4('0x10'),_0x52655d,'request\x20sent',JSON[_0x28f4('0x11')](_0x40039f));if(_0x40039f[_0x28f4('0x12')]){if(_0x40039f[_0x28f4('0x12')][_0x28f4('0x13')]===0x1f4){logger[_0x28f4('0x12')]('ZohoField,\x20%s,\x20%s',_0x52655d,_0x40039f[_0x28f4('0x12')][_0x28f4('0x14')]);return _0x335af2(_0x40039f['error'][_0x28f4('0x14')]);}logger[_0x28f4('0x12')](_0x28f4('0x15'),_0x52655d,_0x40039f[_0x28f4('0x12')][_0x28f4('0x14')]);return _0x1382d0(_0x40039f[_0x28f4('0x12')]['message']);}else{logger[_0x28f4('0xd')]('ZohoField,\x20%s,\x20%s',_0x52655d,_0x28f4('0xe'));_0x1382d0(_0x40039f[_0x28f4('0x16')][_0x28f4('0x14')]);}})[_0x28f4('0x17')](function(_0x106bb2){logger[_0x28f4('0x12')](_0x28f4('0x15'),_0x52655d,_0x106bb2);_0x335af2(_0x106bb2);});});} \ No newline at end of file +var _0x3a3a=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3c4109,_0x2ced61){var _0x52b568=function(_0x40b112){while(--_0x40b112){_0x3c4109['push'](_0x3c4109['shift']());}};_0x52b568(++_0x2ced61);}(_0x3a3a,0x121));var _0xa3a3=function(_0x46be94,_0x41cb70){_0x46be94=_0x46be94-0x0;var _0x4ee16d=_0x3a3a[_0x46be94];return _0x4ee16d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa3a3('0x0'));var BPromise=require(_0xa3a3('0x1'));var rs=require(_0xa3a3('0x2'));var fs=require('fs');var Redis=require(_0xa3a3('0x3'));var db=require(_0xa3a3('0x4'))['db'];var utils=require(_0xa3a3('0x5'));var logger=require(_0xa3a3('0x6'))(_0xa3a3('0x7'));var config=require(_0xa3a3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa3a3('0x9')][_0xa3a3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41ae59,_0x477207,_0xed92e0){return new BPromise(function(_0x41a9f8,_0x516570){return client[_0xa3a3('0xb')](_0x41ae59,_0xed92e0)[_0xa3a3('0xc')](function(_0x273f7f){logger['info'](_0xa3a3('0xd'),_0x477207,_0xa3a3('0xe'));logger[_0xa3a3('0xf')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x477207,_0xa3a3('0xe'),JSON['stringify'](_0x273f7f));if(_0x273f7f[_0xa3a3('0x10')]){if(_0x273f7f[_0xa3a3('0x10')][_0xa3a3('0x11')]===0x1f4){logger['error'](_0xa3a3('0xd'),_0x477207,_0x273f7f[_0xa3a3('0x10')][_0xa3a3('0x12')]);return _0x516570(_0x273f7f[_0xa3a3('0x10')]['message']);}logger[_0xa3a3('0x10')]('ZohoField,\x20%s,\x20%s',_0x477207,_0x273f7f[_0xa3a3('0x10')]['message']);return _0x41a9f8(_0x273f7f['error'][_0xa3a3('0x12')]);}else{logger[_0xa3a3('0x13')](_0xa3a3('0xd'),_0x477207,'request\x20sent');_0x41a9f8(_0x273f7f['result'][_0xa3a3('0x12')]);}})[_0xa3a3('0x14')](function(_0x4e73cd){logger['error'](_0xa3a3('0xd'),_0x477207,_0x4e73cd);_0x516570(_0x4e73cd);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 97f2288..fc2078b 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 _0x0f80=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','exports'];(function(_0x4a690d,_0x51473d){var _0x31e44c=function(_0x442593){while(--_0x442593){_0x4a690d['push'](_0x4a690d['shift']());}};_0x31e44c(++_0x51473d);}(_0x0f80,0x108));var _0x00f8=function(_0xfbdaad,_0x5c902f){_0xfbdaad=_0xfbdaad-0x0;var _0x15292a=_0x0f80[_0xfbdaad];return _0x15292a;};'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 _0xed54=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x464e72,_0x1da538){var _0x2533b2=function(_0x4d07e7){while(--_0x4d07e7){_0x464e72['push'](_0x464e72['shift']());}};_0x2533b2(++_0x1da538);}(_0xed54,0xfc));var _0x4ed5=function(_0x5e7470,_0x37bb32){_0x5e7470=_0x5e7470-0x0;var _0x122e4a=_0xed54[_0x5e7470];return _0x122e4a;};'use strict';var multer=require('multer');var util=require(_0x4ed5('0x0'));var path=require(_0x4ed5('0x1'));var timeout=require(_0x4ed5('0x2'));var express=require(_0x4ed5('0x3'));var router=express['Router']();var auth=require(_0x4ed5('0x4'));var interaction=require(_0x4ed5('0x5'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index c395911..80f7fa6 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 _0xfbbb=['app.js','INTEGER','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xfbbb,0xb4));var _0xbfbb=function(_0x36c42f,_0x1eb081){_0x36c42f=_0x36c42f-0x0;var _0x208ed3=_0xfbbb[_0x36c42f];return _0x208ed3;};'use strict';var Sequelize=require(_0xbfbb('0x0'));module[_0xbfbb('0x1')]={'name':{'type':Sequelize[_0xbfbb('0x2')],'allowNull':![],'unique':_0xbfbb('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbfbb('0x3')},'main':{'type':Sequelize[_0xbfbb('0x2')],'defaultValue':_0xbfbb('0x4')},'filename':{'type':Sequelize[_0xbfbb('0x2')]},'path':{'type':Sequelize[_0xbfbb('0x2')]},'type':{'type':Sequelize[_0xbfbb('0x2')]},'size':{'type':Sequelize[_0xbfbb('0x5')]},'active':{'type':Sequelize[_0xbfbb('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xbfbb('0x2')]},'logo':{'type':Sequelize[_0xbfbb('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0xbfbb('0x7')},'description':{'type':Sequelize[_0xbfbb('0x2')]},'title':{'type':Sequelize[_0xbfbb('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0xe800=['STRING','app.js','BOOLEAN','state','exports','unique_name_and_version'];(function(_0x20c2a6,_0xb73c92){var _0x12ba11=function(_0x5549ae){while(--_0x5549ae){_0x20c2a6['push'](_0x20c2a6['shift']());}};_0x12ba11(++_0xb73c92);}(_0xe800,0x1d8));var _0x0e80=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xe800[_0x2b5eae];return _0x5f3ac9;};'use strict';var Sequelize=require('sequelize');module[_0x0e80('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0e80('0x1')},'version':{'type':Sequelize[_0x0e80('0x2')],'allowNull':![],'unique':_0x0e80('0x1')},'main':{'type':Sequelize[_0x0e80('0x2')],'defaultValue':_0x0e80('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x0e80('0x2')]},'type':{'type':Sequelize[_0x0e80('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x0e80('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x0e80('0x2')]},'logo':{'type':Sequelize[_0x0e80('0x2')]},'state':{'type':Sequelize[_0x0e80('0x2')],'unique':_0x0e80('0x5')},'description':{'type':Sequelize[_0x0e80('0x2')]},'title':{'type':Sequelize[_0x0e80('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x0e80('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index b137ddf..51373ae 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 _0xa9e0=['fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','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','Integration','rawAttributes','model','keys','query','filters','attributes','intersection'];(function(_0x1f37bf,_0x3f91e4){var _0x565262=function(_0x5f2c54){while(--_0x5f2c54){_0x1f37bf['push'](_0x1f37bf['shift']());}};_0x565262(++_0x3f91e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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['Integration'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['Integration']['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){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['Integration'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));}; \ No newline at end of file +var _0xa9e0=['fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','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','Integration','rawAttributes','model','keys','query','filters','attributes','intersection'];(function(_0x513fe7,_0x52156d){var _0x18cc29=function(_0x1061fd){while(--_0x1061fd){_0x513fe7['push'](_0x513fe7['shift']());}};_0x18cc29(++_0x52156d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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['Integration'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['Integration']['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){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['Integration'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 7e4c64f..49356d3 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 _0x7ab3=['path','rimraf','../../config/environment','define','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5e0731,_0x821fb4){var _0x20ddc3=function(_0x17c74c){while(--_0x17c74c){_0x5e0731['push'](_0x5e0731['shift']());}};_0x20ddc3(++_0x821fb4);}(_0x7ab3,0x158));var _0x37ab=function(_0x16337a,_0x4789a1){_0x16337a=_0x16337a-0x0;var _0x422365=_0x7ab3[_0x16337a];return _0x422365;};'use strict';var _=require(_0x37ab('0x0'));var util=require(_0x37ab('0x1'));var logger=require(_0x37ab('0x2'))(_0x37ab('0x3'));var moment=require(_0x37ab('0x4'));var BPromise=require(_0x37ab('0x5'));var rp=require(_0x37ab('0x6'));var fs=require('fs');var path=require(_0x37ab('0x7'));var rimraf=require(_0x37ab('0x8'));var config=require(_0x37ab('0x9'));var attributes=require('./integration.attributes');module['exports']=function(_0x307617,_0x56bd5c){return _0x307617[_0x37ab('0xa')](_0x37ab('0xb'),attributes,{'tableName':_0x37ab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d2a=['Integration','integrations','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x3af40d,_0x5f38f6){var _0x363acb=function(_0x2ed0f8){while(--_0x2ed0f8){_0x3af40d['push'](_0x3af40d['shift']());}};_0x363acb(++_0x5f38f6);}(_0x5d2a,0xaa));var _0xa5d2=function(_0x5f55e4,_0x3778bb){_0x5f55e4=_0x5f55e4-0x0;var _0x4ba10f=_0x5d2a[_0x5f55e4];return _0x4ba10f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa5d2('0x0'))(_0xa5d2('0x1'));var moment=require(_0xa5d2('0x2'));var BPromise=require(_0xa5d2('0x3'));var rp=require(_0xa5d2('0x4'));var fs=require('fs');var path=require(_0xa5d2('0x5'));var rimraf=require(_0xa5d2('0x6'));var config=require(_0xa5d2('0x7'));var attributes=require('./integration.attributes');module[_0xa5d2('0x8')]=function(_0x307e87,_0x539ae9){return _0x307e87[_0xa5d2('0x9')](_0xa5d2('0xa'),attributes,{'tableName':_0xa5d2('0xb'),'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 1b63dc8..ac50198 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 _0x235a=['request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x235a,0x1d9));var _0xa235=function(_0x12581e,_0x3204be){_0x12581e=_0x12581e-0x0;var _0x2c12c7=_0x235a[_0x12581e];return _0x2c12c7;};'use strict';var _=require(_0xa235('0x0'));var util=require(_0xa235('0x1'));var moment=require(_0xa235('0x2'));var BPromise=require(_0xa235('0x3'));var rs=require(_0xa235('0x4'));var fs=require('fs');var Redis=require(_0xa235('0x5'));var db=require(_0xa235('0x6'))['db'];var utils=require(_0xa235('0x7'));var logger=require('../../config/logger')(_0xa235('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa235('0x9')][_0xa235('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x270842,_0x1a6179,_0x58988d){return new BPromise(function(_0x411b78,_0x3af4c6){return client[_0xa235('0xb')](_0x270842,_0x58988d)[_0xa235('0xc')](function(_0x1b8904){logger[_0xa235('0xd')](_0xa235('0xe'),_0x1a6179,_0xa235('0xf'));logger[_0xa235('0x10')]('Integration,\x20%s,\x20%s,\x20%s',_0x1a6179,'request\x20sent',JSON[_0xa235('0x11')](_0x1b8904));if(_0x1b8904[_0xa235('0x12')]){if(_0x1b8904[_0xa235('0x12')][_0xa235('0x13')]===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x1a6179,_0x1b8904[_0xa235('0x12')][_0xa235('0x14')]);return _0x3af4c6(_0x1b8904[_0xa235('0x12')]['message']);}logger[_0xa235('0x12')](_0xa235('0xe'),_0x1a6179,_0x1b8904[_0xa235('0x12')][_0xa235('0x14')]);return _0x411b78(_0x1b8904[_0xa235('0x12')]['message']);}else{logger[_0xa235('0xd')](_0xa235('0xe'),_0x1a6179,'request\x20sent');_0x411b78(_0x1b8904['result'][_0xa235('0x14')]);}})[_0xa235('0x15')](function(_0x416271){logger[_0xa235('0x12')](_0xa235('0xe'),_0x1a6179,_0x416271);_0x3af4c6(_0x416271);});});} \ No newline at end of file +var _0xd1b6=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','error','message'];(function(_0x48dcf7,_0x31b70e){var _0xafed0b=function(_0x32fef4){while(--_0x32fef4){_0x48dcf7['push'](_0x48dcf7['shift']());}};_0xafed0b(++_0x31b70e);}(_0xd1b6,0x117));var _0x6d1b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd1b6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6d1b('0x0'));var util=require(_0x6d1b('0x1'));var moment=require(_0x6d1b('0x2'));var BPromise=require(_0x6d1b('0x3'));var rs=require(_0x6d1b('0x4'));var fs=require('fs');var Redis=require(_0x6d1b('0x5'));var db=require(_0x6d1b('0x6'))['db'];var utils=require(_0x6d1b('0x7'));var logger=require(_0x6d1b('0x8'))(_0x6d1b('0x9'));var config=require('../../config/environment');var jayson=require(_0x6d1b('0xa'));var client=jayson[_0x6d1b('0xb')][_0x6d1b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c6fb8,_0x5ded7d,_0x5e1d35){return new BPromise(function(_0x51ca77,_0x4db583){return client[_0x6d1b('0xd')](_0x4c6fb8,_0x5e1d35)[_0x6d1b('0xe')](function(_0x146e6b){logger['info'](_0x6d1b('0xf'),_0x5ded7d,_0x6d1b('0x10'));logger[_0x6d1b('0x11')]('Integration,\x20%s,\x20%s,\x20%s',_0x5ded7d,_0x6d1b('0x10'),JSON['stringify'](_0x146e6b));if(_0x146e6b['error']){if(_0x146e6b[_0x6d1b('0x12')]['code']===0x1f4){logger[_0x6d1b('0x12')](_0x6d1b('0xf'),_0x5ded7d,_0x146e6b[_0x6d1b('0x12')][_0x6d1b('0x13')]);return _0x4db583(_0x146e6b[_0x6d1b('0x12')][_0x6d1b('0x13')]);}logger[_0x6d1b('0x12')](_0x6d1b('0xf'),_0x5ded7d,_0x146e6b[_0x6d1b('0x12')][_0x6d1b('0x13')]);return _0x51ca77(_0x146e6b['error'][_0x6d1b('0x13')]);}else{logger[_0x6d1b('0x14')](_0x6d1b('0xf'),_0x5ded7d,_0x6d1b('0x10'));_0x51ca77(_0x146e6b[_0x6d1b('0x15')][_0x6d1b('0x13')]);}})[_0x6d1b('0x16')](function(_0x5512e1){logger['error'](_0x6d1b('0xf'),_0x5ded7d,_0x5512e1);_0x4db583(_0x5512e1);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 25346a8..869b8e5 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 _0xac9e=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','put','delete','destroy','exports','path'];(function(_0x4b732e,_0x42add5){var _0x21d4d4=function(_0x1b6f73){while(--_0x1b6f73){_0x4b732e['push'](_0x4b732e['shift']());}};_0x21d4d4(++_0x42add5);}(_0xac9e,0x1b9));var _0xeac9=function(_0x6f022c,_0x5b1036){_0x6f022c=_0x6f022c-0x0;var _0x408b4b=_0xac9e[_0x6f022c];return _0x408b4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xeac9('0x0'));var timeout=require(_0xeac9('0x1'));var express=require(_0xeac9('0x2'));var router=express[_0xeac9('0x3')]();var auth=require(_0xeac9('0x4'));var interaction=require(_0xeac9('0x5'));var config=require('../../config/environment');var controller=require('./integrationReport.controller');router[_0xeac9('0x6')]('/',auth[_0xeac9('0x7')](),controller[_0xeac9('0x8')]);router['get'](_0xeac9('0x9'),auth[_0xeac9('0x7')](),controller[_0xeac9('0xa')]);router['get'](_0xeac9('0xb'),auth[_0xeac9('0x7')](),controller[_0xeac9('0xc')]);router['post']('/',auth[_0xeac9('0x7')](),controller['create']);router[_0xeac9('0xd')](_0xeac9('0xb'),auth[_0xeac9('0x7')](),controller['update']);router[_0xeac9('0xe')](_0xeac9('0xb'),auth['isAuthenticated'](),controller[_0xeac9('0xf')]);module[_0xeac9('0x10')]=router; \ No newline at end of file +var _0x0447=['express','Router','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','index','isAuthenticated','describe','show','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2b05bf,_0x1cc994){var _0x47ae39=function(_0x12d2bb){while(--_0x12d2bb){_0x2b05bf['push'](_0x2b05bf['shift']());}};_0x47ae39(++_0x1cc994);}(_0x0447,0x1f0));var _0x7044=function(_0x45ce1a,_0x4f8ea5){_0x45ce1a=_0x45ce1a-0x0;var _0x4926d8=_0x0447[_0x45ce1a];return _0x4926d8;};'use strict';var multer=require(_0x7044('0x0'));var util=require(_0x7044('0x1'));var path=require(_0x7044('0x2'));var timeout=require(_0x7044('0x3'));var express=require(_0x7044('0x4'));var router=express[_0x7044('0x5')]();var auth=require(_0x7044('0x6'));var interaction=require(_0x7044('0x7'));var config=require('../../config/environment');var controller=require(_0x7044('0x8'));router[_0x7044('0x9')]('/',auth['isAuthenticated'](),controller[_0x7044('0xa')]);router[_0x7044('0x9')]('/describe',auth[_0x7044('0xb')](),controller[_0x7044('0xc')]);router[_0x7044('0x9')]('/:id',auth[_0x7044('0xb')](),controller[_0x7044('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7044('0xe')]);router['put'](_0x7044('0xf'),auth[_0x7044('0xb')](),controller[_0x7044('0x10')]);router[_0x7044('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x7044('0x12')]);module[_0x7044('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index cf238e6..7aa721a 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 _0x5b38=['TEXT','ENUM','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x688379,_0xf8cb05){var _0x10ec21=function(_0x5808d6){while(--_0x5808d6){_0x688379['push'](_0x688379['shift']());}};_0x10ec21(++_0xf8cb05);}(_0x5b38,0x68));var _0x85b3=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x5b38[_0xea8947];return _0x2455e9;};'use strict';var Sequelize=require(_0x85b3('0x0'));module[_0x85b3('0x1')]={'integration':{'type':Sequelize[_0x85b3('0x2')]},'eventChannel':{'type':Sequelize[_0x85b3('0x2')]},'exitStatus':{'type':Sequelize[_0x85b3('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x85b3('0x3')]},'contacts':{'type':Sequelize[_0x85b3('0x2')]},'uniqueid':{'type':Sequelize[_0x85b3('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x85b3('0x2')]},'queue':{'type':Sequelize[_0x85b3('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x85b3('0x2')]},'agentcalledAt':{'type':Sequelize[_0x85b3('0x4')]},'agentconnectAt':{'type':Sequelize[_0x85b3('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x85b3('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x85b3('0x4')]},'talktime':{'type':Sequelize[_0x85b3('0x3')]},'agentacw':{'type':Sequelize[_0x85b3('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x85b3('0x3')]},'reason':{'type':Sequelize[_0x85b3('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x85b3('0x4')]},'agentdump':{'type':Sequelize[_0x85b3('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x85b3('0x4')]},'lastevent':{'type':Sequelize[_0x85b3('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x85b3('0x3')]},'channelstatedesc':{'type':Sequelize[_0x85b3('0x2')]},'connectedlinenum':{'type':Sequelize[_0x85b3('0x2')]},'connectedlinename':{'type':Sequelize[_0x85b3('0x2')]},'language':{'type':Sequelize[_0x85b3('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x85b3('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x85b3('0x2')]},'destchannel':{'type':Sequelize[_0x85b3('0x2')]},'destchannelstate':{'type':Sequelize[_0x85b3('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x85b3('0x2')]},'destcalleridnum':{'type':Sequelize[_0x85b3('0x2')]},'destcalleridname':{'type':Sequelize[_0x85b3('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x85b3('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x85b3('0x2')]},'destlanguage':{'type':Sequelize[_0x85b3('0x2')]},'destaccountcode':{'type':Sequelize[_0x85b3('0x2')]},'destcontext':{'type':Sequelize[_0x85b3('0x2')]},'destexten':{'type':Sequelize[_0x85b3('0x2')]},'destpriority':{'type':Sequelize[_0x85b3('0x2')]},'destuniqueid':{'type':Sequelize[_0x85b3('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x85b3('0x2')]},'from':{'type':Sequelize[_0x85b3('0x2')]},'to':{'type':Sequelize[_0x85b3('0x2')]},'cc':{'type':Sequelize[_0x85b3('0x2')]},'attachment':{'type':Sequelize[_0x85b3('0x6')]},'html':{'type':Sequelize[_0x85b3('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x85b3('0x7')]('SENT','SENDING',_0x85b3('0x8'),_0x85b3('0x9'))},'url':{'type':Sequelize[_0x85b3('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x85b3('0x2')]},'projectId':{'type':Sequelize[_0x85b3('0x3')]}}; \ No newline at end of file +var _0xf443=['TEXT','ENUM','SENT','SENDING','RECEIVED','STRING','INTEGER','BOOLEAN','DATE'];(function(_0x1c5950,_0x49e128){var _0x2b720a=function(_0x4454f1){while(--_0x4454f1){_0x1c5950['push'](_0x1c5950['shift']());}};_0x2b720a(++_0x49e128);}(_0xf443,0x1e2));var _0x3f44=function(_0x400d7b,_0x54e52b){_0x400d7b=_0x400d7b-0x0;var _0x12417f=_0xf443[_0x400d7b];return _0x12417f;};'use strict';var Sequelize=require('sequelize');module['exports']={'integration':{'type':Sequelize[_0x3f44('0x0')]},'eventChannel':{'type':Sequelize[_0x3f44('0x0')]},'exitStatus':{'type':Sequelize[_0x3f44('0x0')]},'ticketId':{'type':Sequelize[_0x3f44('0x0')]},'integrationId':{'type':Sequelize[_0x3f44('0x1')]},'contacts':{'type':Sequelize[_0x3f44('0x0')]},'uniqueid':{'type':Sequelize[_0x3f44('0x0')]},'calleridnum':{'type':Sequelize[_0x3f44('0x0')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x3f44('0x0')]},'interface':{'type':Sequelize[_0x3f44('0x0')]},'membername':{'type':Sequelize[_0x3f44('0x0')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x3f44('0x1')]},'agentcomplete':{'type':Sequelize[_0x3f44('0x2')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x3f44('0x3')]},'talktime':{'type':Sequelize[_0x3f44('0x1')]},'agentacw':{'type':Sequelize[_0x3f44('0x2')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x3f44('0x0')]},'agentringnoanswer':{'type':Sequelize[_0x3f44('0x2')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x3f44('0x3')]},'agentdump':{'type':Sequelize[_0x3f44('0x2')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x3f44('0x3')]},'lastevent':{'type':Sequelize[_0x3f44('0x0')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x3f44('0x1')]},'channelstatedesc':{'type':Sequelize[_0x3f44('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x3f44('0x0')]},'accountcode':{'type':Sequelize[_0x3f44('0x0')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3f44('0x0')]},'priority':{'type':Sequelize[_0x3f44('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x3f44('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x3f44('0x0')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x3f44('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0x3f44('0x0')]},'destconnectedlinename':{'type':Sequelize[_0x3f44('0x0')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x3f44('0x0')]},'destcontext':{'type':Sequelize[_0x3f44('0x0')]},'destexten':{'type':Sequelize[_0x3f44('0x0')]},'destpriority':{'type':Sequelize[_0x3f44('0x0')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x3f44('0x0')]},'inReplyTo':{'type':Sequelize[_0x3f44('0x0')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x3f44('0x0')]},'cc':{'type':Sequelize[_0x3f44('0x0')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x3f44('0x4')]},'status':{'type':Sequelize[_0x3f44('0x5')](_0x3f44('0x6'),_0x3f44('0x7'),_0x3f44('0x8'),'FAILED')},'url':{'type':Sequelize[_0x3f44('0x0')]},'app':{'type':Sequelize[_0x3f44('0x0')]},'appdata':{'type':Sequelize[_0x3f44('0x0')]},'projectId':{'type':Sequelize[_0x3f44('0x1')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 6064517..60cd4d3 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 _0xa1d6=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','set','apply','reject','save','update','then','destroy','end','sendStatus','name','send','index','IntegrationReport','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','where','merge','type','key','VIRTUAL','field','filter','include','findAll','rows','catch','rawAttributes','fields','length','options','find','create','body','params','describe'];(function(_0x35aca3,_0x54fe6a){var _0x56efc3=function(_0x3b4df5){while(--_0x3b4df5){_0x35aca3['push'](_0x35aca3['shift']());}};_0x56efc3(++_0x54fe6a);}(_0xa1d6,0x19e));var _0x6a1d=function(_0x38b193,_0x362e62){_0x38b193=_0x38b193-0x0;var _0xeec64e=_0xa1d6[_0x38b193];return _0xeec64e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6a1d('0x0'));var rimraf=require(_0x6a1d('0x1'));var zipdir=require(_0x6a1d('0x2'));var jsonpatch=require(_0x6a1d('0x3'));var rp=require(_0x6a1d('0x4'));var moment=require(_0x6a1d('0x5'));var BPromise=require(_0x6a1d('0x6'));var Mustache=require('mustache');var util=require(_0x6a1d('0x7'));var path=require(_0x6a1d('0x8'));var sox=require(_0x6a1d('0x9'));var csv=require(_0x6a1d('0xa'));var ejs=require(_0x6a1d('0xb'));var fs=require('fs');var _=require(_0x6a1d('0xc'));var squel=require(_0x6a1d('0xd'));var crypto=require(_0x6a1d('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6a1d('0xa'));var querystring=require(_0x6a1d('0xf'));var Papa=require(_0x6a1d('0x10'));var Redis=require(_0x6a1d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6a1d('0x12'));var logger=require('../../config/logger')(_0x6a1d('0x13'));var utils=require(_0x6a1d('0x14'));var config=require(_0x6a1d('0x15'));var db=require(_0x6a1d('0x16'))['db'];function respondWithStatusCode(_0x10c50f,_0x1d75e8){_0x1d75e8=_0x1d75e8||0xcc;return function(_0x4270b2){if(_0x4270b2){return _0x10c50f['sendStatus'](_0x1d75e8);}return _0x10c50f[_0x6a1d('0x17')](_0x1d75e8)['end']();};}function respondWithResult(_0x544b13,_0xb8f9ef){_0xb8f9ef=_0xb8f9ef||0xc8;return function(_0x4014f1){if(_0x4014f1){return _0x544b13[_0x6a1d('0x17')](_0xb8f9ef)[_0x6a1d('0x18')](_0x4014f1);}};}function respondWithFilteredResult(_0x53fb32,_0x584c36){return function(_0x5bf321){if(_0x5bf321){var _0x10fb5f=_0x5bf321['count'],_0x5f4734=_0x584c36[_0x6a1d('0x19')],_0x4b6203=_0x584c36[_0x6a1d('0x19')]+_0x584c36[_0x6a1d('0x1a')],_0x20912c;if(_0x4b6203>=_0x10fb5f){_0x4b6203=_0x10fb5f;_0x20912c=0xc8;}else{_0x20912c=0xce;}_0x53fb32[_0x6a1d('0x17')](_0x20912c);return _0x53fb32[_0x6a1d('0x1b')]('Content-Range',_0x5f4734+'-'+_0x4b6203+'/'+_0x10fb5f)['json'](_0x5bf321);}return null;};}function patchUpdates(_0x2d8c81){return function(_0x4d0a71){try{jsonpatch[_0x6a1d('0x1c')](_0x4d0a71,_0x2d8c81,!![]);}catch(_0x912ad0){return BPromise[_0x6a1d('0x1d')](_0x912ad0);}return _0x4d0a71[_0x6a1d('0x1e')]();};}function saveUpdates(_0x379960,_0x36233c){return function(_0x496567){if(_0x496567){return _0x496567[_0x6a1d('0x1f')](_0x379960)[_0x6a1d('0x20')](function(_0x160711){return _0x160711;});}return null;};}function removeEntity(_0x554d9c,_0x57fd02){return function(_0x44f587){if(_0x44f587){return _0x44f587[_0x6a1d('0x21')]()[_0x6a1d('0x20')](function(){_0x554d9c[_0x6a1d('0x17')](0xcc)[_0x6a1d('0x22')]();});}};}function handleEntityNotFound(_0x42e41a,_0x1e2969){return function(_0x524568){if(!_0x524568){_0x42e41a[_0x6a1d('0x23')](0x194);}return _0x524568;};}function handleError(_0x28d322,_0x582a20){_0x582a20=_0x582a20||0x1f4;return function(_0x18ae44){logger['error'](_0x18ae44['stack']);if(_0x18ae44[_0x6a1d('0x24')]){delete _0x18ae44[_0x6a1d('0x24')];}_0x28d322[_0x6a1d('0x17')](_0x582a20)[_0x6a1d('0x25')](_0x18ae44);};}exports[_0x6a1d('0x26')]=function(_0x269839,_0x35e4c4){var _0x23aff7={},_0xb260e3={},_0x588555={'count':0x0,'rows':[]};var _0x24e580=db[_0x6a1d('0x27')]['rawAttributes'];_0xb260e3[_0x6a1d('0x28')]=_[_0x6a1d('0x29')](_0x24e580);_0xb260e3[_0x6a1d('0x2a')]=_[_0x6a1d('0x29')](_0x269839[_0x6a1d('0x2a')]);_0xb260e3[_0x6a1d('0x2b')]=_[_0x6a1d('0x2c')](_0xb260e3[_0x6a1d('0x28')],_0xb260e3[_0x6a1d('0x2a')]);_0x23aff7[_0x6a1d('0x2d')]=_[_0x6a1d('0x2c')](_0xb260e3[_0x6a1d('0x28')],qs['fields'](_0x269839['query']['fields']));_0x23aff7[_0x6a1d('0x2d')]=_0x23aff7[_0x6a1d('0x2d')]['length']?_0x23aff7[_0x6a1d('0x2d')]:_0xb260e3['model'];if(!_0x269839[_0x6a1d('0x2a')][_0x6a1d('0x2e')](_0x6a1d('0x2f'))){_0x23aff7[_0x6a1d('0x1a')]=qs[_0x6a1d('0x1a')](_0x269839[_0x6a1d('0x2a')][_0x6a1d('0x1a')]);_0x23aff7[_0x6a1d('0x19')]=qs[_0x6a1d('0x19')](_0x269839['query'][_0x6a1d('0x19')]);}_0x23aff7[_0x6a1d('0x30')]=qs['sort'](_0x269839[_0x6a1d('0x2a')]['sort']);_0x23aff7[_0x6a1d('0x31')]=qs['filters'](_['pick'](_0x269839[_0x6a1d('0x2a')],_0xb260e3[_0x6a1d('0x2b')]));if(_0x269839['query']['filter']){_0x23aff7[_0x6a1d('0x31')]=_[_0x6a1d('0x32')](_0x23aff7['where'],{'$or':_['map'](_0x24e580,function(_0x26f525){if(_0x26f525[_0x6a1d('0x33')][_0x6a1d('0x34')]!==_0x6a1d('0x35')){var _0x16a658={};_0x16a658[_0x26f525[_0x6a1d('0x36')]]={'$like':'%'+_0x269839[_0x6a1d('0x2a')][_0x6a1d('0x37')]+'%'};return _0x16a658;}})});}_0x23aff7=_[_0x6a1d('0x32')]({},_0x23aff7,_0x269839['options']);var _0x1a1bce={'where':_0x23aff7[_0x6a1d('0x31')]};return db[_0x6a1d('0x27')]['count'](_0x1a1bce)['then'](function(_0x3fcca2){_0x588555['count']=_0x3fcca2;if(_0x269839[_0x6a1d('0x2a')]['includeAll']){_0x23aff7[_0x6a1d('0x38')]=[{'all':!![]}];}return db[_0x6a1d('0x27')][_0x6a1d('0x39')](_0x23aff7);})['then'](function(_0x470243){_0x588555[_0x6a1d('0x3a')]=_0x470243;return _0x588555;})[_0x6a1d('0x20')](respondWithFilteredResult(_0x35e4c4,_0x23aff7))[_0x6a1d('0x3b')](handleError(_0x35e4c4,null));};exports['show']=function(_0x482ca6,_0x2e6080){var _0x4a152e={'raw':![],'where':{'id':_0x482ca6['params']['id']}},_0x584ed7={};_0x584ed7[_0x6a1d('0x28')]=_[_0x6a1d('0x29')](db[_0x6a1d('0x27')][_0x6a1d('0x3c')]);_0x584ed7['query']=_[_0x6a1d('0x29')](_0x482ca6['query']);_0x584ed7['filters']=_['intersection'](_0x584ed7[_0x6a1d('0x28')],_0x584ed7[_0x6a1d('0x2a')]);_0x4a152e[_0x6a1d('0x2d')]=_[_0x6a1d('0x2c')](_0x584ed7[_0x6a1d('0x28')],qs[_0x6a1d('0x3d')](_0x482ca6[_0x6a1d('0x2a')][_0x6a1d('0x3d')]));_0x4a152e[_0x6a1d('0x2d')]=_0x4a152e[_0x6a1d('0x2d')][_0x6a1d('0x3e')]?_0x4a152e[_0x6a1d('0x2d')]:_0x584ed7[_0x6a1d('0x28')];if(_0x482ca6[_0x6a1d('0x2a')]['includeAll']){_0x4a152e['include']=[{'all':!![]}];}_0x4a152e=_[_0x6a1d('0x32')]({},_0x4a152e,_0x482ca6[_0x6a1d('0x3f')]);return db['IntegrationReport'][_0x6a1d('0x40')](_0x4a152e)[_0x6a1d('0x20')](handleEntityNotFound(_0x2e6080,null))[_0x6a1d('0x20')](respondWithResult(_0x2e6080,null))[_0x6a1d('0x3b')](handleError(_0x2e6080,null));};exports[_0x6a1d('0x41')]=function(_0x36856d,_0x305970){return db['IntegrationReport'][_0x6a1d('0x41')](_0x36856d[_0x6a1d('0x42')],{})[_0x6a1d('0x20')](respondWithResult(_0x305970,0xc9))[_0x6a1d('0x3b')](handleError(_0x305970,null));};exports[_0x6a1d('0x1f')]=function(_0x2646c3,_0x1807c4){if(_0x2646c3['body']['id']){delete _0x2646c3['body']['id'];}return db[_0x6a1d('0x27')][_0x6a1d('0x40')]({'where':{'id':_0x2646c3[_0x6a1d('0x43')]['id']}})[_0x6a1d('0x20')](handleEntityNotFound(_0x1807c4,null))[_0x6a1d('0x20')](saveUpdates(_0x2646c3[_0x6a1d('0x42')],null))['then'](respondWithResult(_0x1807c4,null))[_0x6a1d('0x3b')](handleError(_0x1807c4,null));};exports['destroy']=function(_0x5651b5,_0x48bfc9){return db[_0x6a1d('0x27')]['find']({'where':{'id':_0x5651b5['params']['id']}})[_0x6a1d('0x20')](handleEntityNotFound(_0x48bfc9,null))[_0x6a1d('0x20')](removeEntity(_0x48bfc9,null))[_0x6a1d('0x3b')](handleError(_0x48bfc9,null));};exports[_0x6a1d('0x44')]=function(_0x3df2e0,_0x10e6ba){return db[_0x6a1d('0x27')][_0x6a1d('0x44')]()['then'](respondWithResult(_0x10e6ba,null))['catch'](handleError(_0x10e6ba,null));}; \ No newline at end of file +var _0x1c81=['bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','reject','save','update','then','destroy','end','error','name','index','IntegrationReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','key','options','include','findAll','catch','show','params','find','create','body','describe','html-pdf','fast-json-patch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c81,0xc7));var _0x11c8=function(_0x19bd86,_0xe3916f){_0x19bd86=_0x19bd86-0x0;var _0x197a2b=_0x1c81[_0x19bd86];return _0x197a2b;};'use strict';var pdf=require(_0x11c8('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x11c8('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x11c8('0x2'));var Mustache=require('mustache');var util=require(_0x11c8('0x3'));var path=require(_0x11c8('0x4'));var sox=require(_0x11c8('0x5'));var csv=require(_0x11c8('0x6'));var ejs=require(_0x11c8('0x7'));var fs=require('fs');var _=require(_0x11c8('0x8'));var squel=require(_0x11c8('0x9'));var crypto=require(_0x11c8('0xa'));var jsforce=require(_0x11c8('0xb'));var deskjs=require(_0x11c8('0xc'));var toCsv=require(_0x11c8('0x6'));var querystring=require(_0x11c8('0xd'));var Papa=require(_0x11c8('0xe'));var Redis=require(_0x11c8('0xf'));var authService=require(_0x11c8('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x11c8('0x11'));var logger=require(_0x11c8('0x12'))(_0x11c8('0x13'));var utils=require('../../config/utils');var config=require(_0x11c8('0x14'));var db=require(_0x11c8('0x15'))['db'];function respondWithStatusCode(_0x38a127,_0x150ff0){_0x150ff0=_0x150ff0||0xcc;return function(_0xa59af6){if(_0xa59af6){return _0x38a127[_0x11c8('0x16')](_0x150ff0);}return _0x38a127[_0x11c8('0x17')](_0x150ff0)['end']();};}function respondWithResult(_0x29f012,_0x59f1ce){_0x59f1ce=_0x59f1ce||0xc8;return function(_0x2a137e){if(_0x2a137e){return _0x29f012[_0x11c8('0x17')](_0x59f1ce)[_0x11c8('0x18')](_0x2a137e);}};}function respondWithFilteredResult(_0xc5fdc1,_0x34aee9){return function(_0x39d484){if(_0x39d484){var _0x468ecd=_0x39d484[_0x11c8('0x19')],_0x35ad15=_0x34aee9[_0x11c8('0x1a')],_0x1f732a=_0x34aee9[_0x11c8('0x1a')]+_0x34aee9['limit'],_0x11605d;if(_0x1f732a>=_0x468ecd){_0x1f732a=_0x468ecd;_0x11605d=0xc8;}else{_0x11605d=0xce;}_0xc5fdc1[_0x11c8('0x17')](_0x11605d);return _0xc5fdc1[_0x11c8('0x1b')](_0x11c8('0x1c'),_0x35ad15+'-'+_0x1f732a+'/'+_0x468ecd)[_0x11c8('0x18')](_0x39d484);}return null;};}function patchUpdates(_0x2d57cb){return function(_0x4b14a7){try{jsonpatch['apply'](_0x4b14a7,_0x2d57cb,!![]);}catch(_0x43846a){return BPromise[_0x11c8('0x1d')](_0x43846a);}return _0x4b14a7[_0x11c8('0x1e')]();};}function saveUpdates(_0x5d46f0,_0x179864){return function(_0x128d93){if(_0x128d93){return _0x128d93[_0x11c8('0x1f')](_0x5d46f0)[_0x11c8('0x20')](function(_0x38b53b){return _0x38b53b;});}return null;};}function removeEntity(_0x2f6e6d,_0x33b1e6){return function(_0x5c46b2){if(_0x5c46b2){return _0x5c46b2[_0x11c8('0x21')]()[_0x11c8('0x20')](function(){_0x2f6e6d[_0x11c8('0x17')](0xcc)[_0x11c8('0x22')]();});}};}function handleEntityNotFound(_0x284617,_0xf3ba69){return function(_0x3e3706){if(!_0x3e3706){_0x284617['sendStatus'](0x194);}return _0x3e3706;};}function handleError(_0x4f0021,_0x51bcf1){_0x51bcf1=_0x51bcf1||0x1f4;return function(_0x4b00c4){logger[_0x11c8('0x23')](_0x4b00c4['stack']);if(_0x4b00c4['name']){delete _0x4b00c4[_0x11c8('0x24')];}_0x4f0021[_0x11c8('0x17')](_0x51bcf1)['send'](_0x4b00c4);};}exports[_0x11c8('0x25')]=function(_0x7a9afe,_0x1a2c77){var _0x580b5a={},_0xbc2ba8={},_0x23324d={'count':0x0,'rows':[]};var _0x2941f6=db[_0x11c8('0x26')][_0x11c8('0x27')];_0xbc2ba8[_0x11c8('0x28')]=_[_0x11c8('0x29')](_0x2941f6);_0xbc2ba8[_0x11c8('0x2a')]=_[_0x11c8('0x29')](_0x7a9afe[_0x11c8('0x2a')]);_0xbc2ba8[_0x11c8('0x2b')]=_[_0x11c8('0x2c')](_0xbc2ba8['model'],_0xbc2ba8[_0x11c8('0x2a')]);_0x580b5a[_0x11c8('0x2d')]=_[_0x11c8('0x2c')](_0xbc2ba8['model'],qs[_0x11c8('0x2e')](_0x7a9afe['query']['fields']));_0x580b5a[_0x11c8('0x2d')]=_0x580b5a[_0x11c8('0x2d')][_0x11c8('0x2f')]?_0x580b5a[_0x11c8('0x2d')]:_0xbc2ba8[_0x11c8('0x28')];if(!_0x7a9afe[_0x11c8('0x2a')][_0x11c8('0x30')](_0x11c8('0x31'))){_0x580b5a[_0x11c8('0x32')]=qs[_0x11c8('0x32')](_0x7a9afe[_0x11c8('0x2a')][_0x11c8('0x32')]);_0x580b5a[_0x11c8('0x1a')]=qs[_0x11c8('0x1a')](_0x7a9afe[_0x11c8('0x2a')][_0x11c8('0x1a')]);}_0x580b5a[_0x11c8('0x33')]=qs[_0x11c8('0x34')](_0x7a9afe[_0x11c8('0x2a')][_0x11c8('0x34')]);_0x580b5a[_0x11c8('0x35')]=qs[_0x11c8('0x2b')](_['pick'](_0x7a9afe[_0x11c8('0x2a')],_0xbc2ba8['filters']));if(_0x7a9afe[_0x11c8('0x2a')][_0x11c8('0x36')]){_0x580b5a[_0x11c8('0x35')]=_[_0x11c8('0x37')](_0x580b5a[_0x11c8('0x35')],{'$or':_['map'](_0x2941f6,function(_0x2b35ef){if(_0x2b35ef['type'][_0x11c8('0x38')]!=='VIRTUAL'){var _0x186e12={};_0x186e12[_0x2b35ef['field']]={'$like':'%'+_0x7a9afe[_0x11c8('0x2a')][_0x11c8('0x36')]+'%'};return _0x186e12;}})});}_0x580b5a=_[_0x11c8('0x37')]({},_0x580b5a,_0x7a9afe[_0x11c8('0x39')]);var _0x4484de={'where':_0x580b5a[_0x11c8('0x35')]};return db[_0x11c8('0x26')][_0x11c8('0x19')](_0x4484de)['then'](function(_0x1ea112){_0x23324d[_0x11c8('0x19')]=_0x1ea112;if(_0x7a9afe[_0x11c8('0x2a')]['includeAll']){_0x580b5a[_0x11c8('0x3a')]=[{'all':!![]}];}return db[_0x11c8('0x26')][_0x11c8('0x3b')](_0x580b5a);})[_0x11c8('0x20')](function(_0x2fca99){_0x23324d['rows']=_0x2fca99;return _0x23324d;})['then'](respondWithFilteredResult(_0x1a2c77,_0x580b5a))[_0x11c8('0x3c')](handleError(_0x1a2c77,null));};exports[_0x11c8('0x3d')]=function(_0x3c9eb7,_0x4f80f3){var _0x19271c={'raw':![],'where':{'id':_0x3c9eb7[_0x11c8('0x3e')]['id']}},_0x18a2f4={};_0x18a2f4[_0x11c8('0x28')]=_[_0x11c8('0x29')](db['IntegrationReport'][_0x11c8('0x27')]);_0x18a2f4[_0x11c8('0x2a')]=_[_0x11c8('0x29')](_0x3c9eb7['query']);_0x18a2f4[_0x11c8('0x2b')]=_[_0x11c8('0x2c')](_0x18a2f4[_0x11c8('0x28')],_0x18a2f4[_0x11c8('0x2a')]);_0x19271c[_0x11c8('0x2d')]=_[_0x11c8('0x2c')](_0x18a2f4['model'],qs['fields'](_0x3c9eb7['query'][_0x11c8('0x2e')]));_0x19271c[_0x11c8('0x2d')]=_0x19271c[_0x11c8('0x2d')][_0x11c8('0x2f')]?_0x19271c[_0x11c8('0x2d')]:_0x18a2f4[_0x11c8('0x28')];if(_0x3c9eb7['query']['includeAll']){_0x19271c[_0x11c8('0x3a')]=[{'all':!![]}];}_0x19271c=_[_0x11c8('0x37')]({},_0x19271c,_0x3c9eb7['options']);return db[_0x11c8('0x26')][_0x11c8('0x3f')](_0x19271c)['then'](handleEntityNotFound(_0x4f80f3,null))['then'](respondWithResult(_0x4f80f3,null))[_0x11c8('0x3c')](handleError(_0x4f80f3,null));};exports[_0x11c8('0x40')]=function(_0x140cea,_0x4eff66){return db['IntegrationReport'][_0x11c8('0x40')](_0x140cea[_0x11c8('0x41')],{})[_0x11c8('0x20')](respondWithResult(_0x4eff66,0xc9))[_0x11c8('0x3c')](handleError(_0x4eff66,null));};exports[_0x11c8('0x1f')]=function(_0x43671a,_0x2872c5){if(_0x43671a['body']['id']){delete _0x43671a[_0x11c8('0x41')]['id'];}return db[_0x11c8('0x26')][_0x11c8('0x3f')]({'where':{'id':_0x43671a[_0x11c8('0x3e')]['id']}})[_0x11c8('0x20')](handleEntityNotFound(_0x2872c5,null))['then'](saveUpdates(_0x43671a['body'],null))[_0x11c8('0x20')](respondWithResult(_0x2872c5,null))['catch'](handleError(_0x2872c5,null));};exports[_0x11c8('0x21')]=function(_0x1d76d6,_0x1ec622){return db[_0x11c8('0x26')][_0x11c8('0x3f')]({'where':{'id':_0x1d76d6['params']['id']}})[_0x11c8('0x20')](handleEntityNotFound(_0x1ec622,null))[_0x11c8('0x20')](removeEntity(_0x1ec622,null))[_0x11c8('0x3c')](handleError(_0x1ec622,null));};exports[_0x11c8('0x42')]=function(_0x182332,_0x2f1257){return db['IntegrationReport'][_0x11c8('0x42')]()[_0x11c8('0x20')](respondWithResult(_0x2f1257,null))[_0x11c8('0x3c')](handleError(_0x2f1257,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 0d790e8..dcc98c5 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 _0x9b67=['path','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x509554,_0x289f75){var _0x483a9e=function(_0xe0ed14){while(--_0xe0ed14){_0x509554['push'](_0x509554['shift']());}};_0x483a9e(++_0x289f75);}(_0x9b67,0xf6));var _0x79b6=function(_0x5cb911,_0x24fa7f){_0x5cb911=_0x5cb911-0x0;var _0x5edaed=_0x9b67[_0x5cb911];return _0x5edaed;};'use strict';var _=require(_0x79b6('0x0'));var util=require(_0x79b6('0x1'));var logger=require(_0x79b6('0x2'))(_0x79b6('0x3'));var moment=require(_0x79b6('0x4'));var BPromise=require('bluebird');var rp=require(_0x79b6('0x5'));var fs=require('fs');var path=require(_0x79b6('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x79b6('0x7'));module[_0x79b6('0x8')]=function(_0x258103,_0xec367e){return _0x258103[_0x79b6('0x9')](_0x79b6('0xa'),attributes,{'tableName':_0x79b6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6075=['path','rimraf','../../config/environment','exports','report_integration','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x6075,0x191));var _0x5607=function(_0x4ae014,_0x404168){_0x4ae014=_0x4ae014-0x0;var _0x3feb13=_0x6075[_0x4ae014];return _0x3feb13;};'use strict';var _=require('lodash');var util=require(_0x5607('0x0'));var logger=require(_0x5607('0x1'))(_0x5607('0x2'));var moment=require(_0x5607('0x3'));var BPromise=require(_0x5607('0x4'));var rp=require(_0x5607('0x5'));var fs=require('fs');var path=require(_0x5607('0x6'));var rimraf=require(_0x5607('0x7'));var config=require(_0x5607('0x8'));var attributes=require('./integrationReport.attributes');module[_0x5607('0x9')]=function(_0xabf691,_0x14b9f4){return _0xabf691['define']('IntegrationReport',attributes,{'tableName':_0x5607('0xa'),'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 1081248..1d46290 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 _0x4f8f=['util','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x338c4c,_0x2c664d){var _0x264521=function(_0x204f04){while(--_0x204f04){_0x338c4c['push'](_0x338c4c['shift']());}};_0x264521(++_0x2c664d);}(_0x4f8f,0x90));var _0xf4f8=function(_0x4af40f,_0x5b5214){_0x4af40f=_0x4af40f-0x0;var _0x5ba7df=_0x4f8f[_0x4af40f];return _0x5ba7df;};'use strict';var _=require('lodash');var util=require(_0xf4f8('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf4f8('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf4f8('0x2'))['db'];var utils=require(_0xf4f8('0x3'));var logger=require(_0xf4f8('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf4f8('0x5')][_0xf4f8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2646ac,_0x41e542,_0x5f2772){return new BPromise(function(_0x23337b,_0x1850b5){return client[_0xf4f8('0x7')](_0x2646ac,_0x5f2772)['then'](function(_0x5e930a){logger[_0xf4f8('0x8')](_0xf4f8('0x9'),_0x41e542,_0xf4f8('0xa'));logger[_0xf4f8('0xb')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x41e542,_0xf4f8('0xa'),JSON[_0xf4f8('0xc')](_0x5e930a));if(_0x5e930a[_0xf4f8('0xd')]){if(_0x5e930a[_0xf4f8('0xd')][_0xf4f8('0xe')]===0x1f4){logger[_0xf4f8('0xd')](_0xf4f8('0x9'),_0x41e542,_0x5e930a[_0xf4f8('0xd')][_0xf4f8('0xf')]);return _0x1850b5(_0x5e930a[_0xf4f8('0xd')][_0xf4f8('0xf')]);}logger['error']('IntegrationReport,\x20%s,\x20%s',_0x41e542,_0x5e930a[_0xf4f8('0xd')]['message']);return _0x23337b(_0x5e930a['error'][_0xf4f8('0xf')]);}else{logger['info'](_0xf4f8('0x9'),_0x41e542,_0xf4f8('0xa'));_0x23337b(_0x5e930a[_0xf4f8('0x10')][_0xf4f8('0xf')]);}})[_0xf4f8('0x11')](function(_0x30fe4b){logger['error'](_0xf4f8('0x9'),_0x41e542,_0x30fe4b);_0x1850b5(_0x30fe4b);});});} \ No newline at end of file +var _0xa337=['catch','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x51308d,_0x42cf02){var _0x37cde8=function(_0x527de4){while(--_0x527de4){_0x51308d['push'](_0x51308d['shift']());}};_0x37cde8(++_0x42cf02);}(_0xa337,0xdd));var _0x7a33=function(_0x2652e2,_0x3db1c1){_0x2652e2=_0x2652e2-0x0;var _0x1c00ec=_0xa337[_0x2652e2];return _0x1c00ec;};'use strict';var _=require('lodash');var util=require(_0x7a33('0x0'));var moment=require(_0x7a33('0x1'));var BPromise=require(_0x7a33('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a33('0x3'));var db=require(_0x7a33('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7a33('0x5'));var config=require('../../config/environment');var jayson=require(_0x7a33('0x6'));var client=jayson[_0x7a33('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ffeb4,_0x2fb1fd,_0x294364){return new BPromise(function(_0x495646,_0x10d723){return client['request'](_0x2ffeb4,_0x294364)[_0x7a33('0x8')](function(_0x2f9e40){logger[_0x7a33('0x9')](_0x7a33('0xa'),_0x2fb1fd,_0x7a33('0xb'));logger[_0x7a33('0xc')](_0x7a33('0xd'),_0x2fb1fd,_0x7a33('0xb'),JSON[_0x7a33('0xe')](_0x2f9e40));if(_0x2f9e40[_0x7a33('0xf')]){if(_0x2f9e40['error'][_0x7a33('0x10')]===0x1f4){logger[_0x7a33('0xf')](_0x7a33('0xa'),_0x2fb1fd,_0x2f9e40['error'][_0x7a33('0x11')]);return _0x10d723(_0x2f9e40[_0x7a33('0xf')][_0x7a33('0x11')]);}logger[_0x7a33('0xf')](_0x7a33('0xa'),_0x2fb1fd,_0x2f9e40[_0x7a33('0xf')]['message']);return _0x495646(_0x2f9e40[_0x7a33('0xf')][_0x7a33('0x11')]);}else{logger['info']('IntegrationReport,\x20%s,\x20%s',_0x2fb1fd,_0x7a33('0xb'));_0x495646(_0x2f9e40[_0x7a33('0x12')]['message']);}})[_0x7a33('0x13')](function(_0x204ae6){logger[_0x7a33('0xf')](_0x7a33('0xa'),_0x2fb1fd,_0x204ae6);_0x10d723(_0x204ae6);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 8fd0a2a..37a9ab1 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 _0xac35=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id/sub_intervals','getIntervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x188054,_0x239d4f){var _0x3f244f=function(_0x1d6224){while(--_0x1d6224){_0x188054['push'](_0x188054['shift']());}};_0x3f244f(++_0x239d4f);}(_0xac35,0x141));var _0x5ac3=function(_0xbd18d0,_0x15ac4a){_0xbd18d0=_0xbd18d0-0x0;var _0x359bb1=_0xac35[_0xbd18d0];return _0x359bb1;};'use strict';var multer=require(_0x5ac3('0x0'));var util=require(_0x5ac3('0x1'));var path=require(_0x5ac3('0x2'));var timeout=require(_0x5ac3('0x3'));var express=require(_0x5ac3('0x4'));var router=express[_0x5ac3('0x5')]();var auth=require(_0x5ac3('0x6'));var interaction=require(_0x5ac3('0x7'));var config=require(_0x5ac3('0x8'));var controller=require(_0x5ac3('0x9'));router[_0x5ac3('0xa')]('/',auth[_0x5ac3('0xb')](),controller[_0x5ac3('0xc')]);router[_0x5ac3('0xa')]('/:id',auth[_0x5ac3('0xb')](),controller['show']);router[_0x5ac3('0xa')](_0x5ac3('0xd'),auth[_0x5ac3('0xb')](),controller[_0x5ac3('0xe')]);router[_0x5ac3('0xf')]('/',auth[_0x5ac3('0xb')](),controller['create']);router[_0x5ac3('0xf')]('/:id/sub_intervals',auth[_0x5ac3('0xb')](),controller[_0x5ac3('0x10')]);router[_0x5ac3('0xf')](_0x5ac3('0x11'),auth[_0x5ac3('0xb')](),controller[_0x5ac3('0x12')]);router[_0x5ac3('0x13')]('/:id',auth[_0x5ac3('0xb')](),controller[_0x5ac3('0x14')]);router[_0x5ac3('0x15')](_0x5ac3('0x16'),auth[_0x5ac3('0xb')](),controller[_0x5ac3('0x17')]);module[_0x5ac3('0x18')]=router; \ No newline at end of file +var _0xfbf1=['get','isAuthenticated','index','/:id','getIntervals','post','/:id/sub_intervals','/:id/sub_intervals/create_many','addIntervals','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xfbf1,0x10b));var _0x1fbf=function(_0x2347db,_0x3e3306){_0x2347db=_0x2347db-0x0;var _0x2f0f47=_0xfbf1[_0x2347db];return _0x2f0f47;};'use strict';var multer=require('multer');var util=require(_0x1fbf('0x0'));var path=require('path');var timeout=require(_0x1fbf('0x1'));var express=require('express');var router=express[_0x1fbf('0x2')]();var auth=require(_0x1fbf('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1fbf('0x4'));var controller=require('./interval.controller');router[_0x1fbf('0x5')]('/',auth[_0x1fbf('0x6')](),controller[_0x1fbf('0x7')]);router[_0x1fbf('0x5')](_0x1fbf('0x8'),auth[_0x1fbf('0x6')](),controller['show']);router[_0x1fbf('0x5')]('/:id/sub_intervals',auth[_0x1fbf('0x6')](),controller[_0x1fbf('0x9')]);router[_0x1fbf('0xa')]('/',auth[_0x1fbf('0x6')](),controller['create']);router['post'](_0x1fbf('0xb'),auth['isAuthenticated'](),controller['addInterval']);router['post'](_0x1fbf('0xc'),auth['isAuthenticated'](),controller[_0x1fbf('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x1fbf('0x8'),auth[_0x1fbf('0x6')](),controller[_0x1fbf('0xe')]);module[_0x1fbf('0xf')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 67ca39d..e5548b3 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 _0x194f=['exports','STRING'];(function(_0x119b43,_0x94edc0){var _0x590b3c=function(_0x1ae36f){while(--_0x1ae36f){_0x119b43['push'](_0x119b43['shift']());}};_0x590b3c(++_0x94edc0);}(_0x194f,0x1b0));var _0xf194=function(_0x3104ae,_0x1e5ea8){_0x3104ae=_0x3104ae-0x0;var _0x1c3462=_0x194f[_0x3104ae];return _0x1c3462;};'use strict';var Sequelize=require('sequelize');module[_0xf194('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf194('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x23a6=['exports','STRING'];(function(_0x220d2a,_0x5334f4){var _0x28aa6b=function(_0x48f3d0){while(--_0x48f3d0){_0x220d2a['push'](_0x220d2a['shift']());}};_0x28aa6b(++_0x5334f4);}(_0x23a6,0xdc));var _0x623a=function(_0x2ce8d5,_0x2d0cd2){_0x2ce8d5=_0x2ce8d5-0x0;var _0x20a695=_0x23a6[_0x2ce8d5];return _0x20a695;};'use strict';var Sequelize=require('sequelize');module[_0x623a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x623a('0x1')]},'interval':{'type':Sequelize[_0x623a('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index aa3993a..5719a5e 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 _0xe4fa=['sequelize','transaction','bulkCreate','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','get','Intervals','error','stack','name','send','index','rawAttributes','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','type','VIRTUAL','field','filter','options','Interval','include','findAll','rows','params','includeAll','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','find','IntervalId','getIntervals','findOne'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xe4fa,0x1ca));var _0xae4f=function(_0x549b49,_0x10f7dc){_0x549b49=_0x549b49-0x0;var _0x221e0e=_0xe4fa[_0x549b49];return _0x221e0e;};'use strict';var pdf=require(_0xae4f('0x0'));var emlformat=require(_0xae4f('0x1'));var rimraf=require(_0xae4f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xae4f('0x3'));var rp=require(_0xae4f('0x4'));var moment=require('moment');var BPromise=require(_0xae4f('0x5'));var Mustache=require(_0xae4f('0x6'));var util=require(_0xae4f('0x7'));var path=require(_0xae4f('0x8'));var sox=require(_0xae4f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xae4f('0xa'));var crypto=require(_0xae4f('0xb'));var jsforce=require(_0xae4f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xae4f('0xd'));var Papa=require(_0xae4f('0xe'));var Redis=require('ioredis');var authService=require(_0xae4f('0xf'));var qs=require(_0xae4f('0x10'));var hardwareService=require(_0xae4f('0x11'));var logger=require(_0xae4f('0x12'))(_0xae4f('0x13'));var utils=require(_0xae4f('0x14'));var config=require(_0xae4f('0x15'));var db=require(_0xae4f('0x16'))['db'];var extensions=require(_0xae4f('0x17'));function respondWithStatusCode(_0x272eff,_0x2dcc87){_0x2dcc87=_0x2dcc87||0xcc;return function(_0x5790fd){if(_0x5790fd){return _0x272eff[_0xae4f('0x18')](_0x2dcc87);}return _0x272eff[_0xae4f('0x19')](_0x2dcc87)[_0xae4f('0x1a')]();};}function respondWithResult(_0x57d984,_0x275fe7){_0x275fe7=_0x275fe7||0xc8;return function(_0x460f1d){if(_0x460f1d){return _0x57d984[_0xae4f('0x19')](_0x275fe7)['json'](_0x460f1d);}};}function respondWithFilteredResult(_0xafd84a,_0x267334){return function(_0x1f8166){if(_0x1f8166){var _0x2991f4=_0x1f8166[_0xae4f('0x1b')],_0x4d9473=_0x267334[_0xae4f('0x1c')],_0x565067=_0x267334['offset']+_0x267334[_0xae4f('0x1d')],_0x3e8863;if(_0x565067>=_0x2991f4){_0x565067=_0x2991f4;_0x3e8863=0xc8;}else{_0x3e8863=0xce;}_0xafd84a['status'](_0x3e8863);return _0xafd84a[_0xae4f('0x1e')](_0xae4f('0x1f'),_0x4d9473+'-'+_0x565067+'/'+_0x2991f4)[_0xae4f('0x20')](_0x1f8166);}return null;};}function patchUpdates(_0x297d22){return function(_0x103400){try{jsonpatch['apply'](_0x103400,_0x297d22,!![]);}catch(_0x26a574){return BPromise[_0xae4f('0x21')](_0x26a574);}return _0x103400[_0xae4f('0x22')]();};}function saveUpdates(_0x417706,_0x2eb5c6){return function(_0x5160b7){if(_0x5160b7){return _0x5160b7[_0xae4f('0x23')](_0x417706)[_0xae4f('0x24')](function(_0x3c79bc){return _0x3c79bc;});}return null;};}function removeEntity(_0x594e34,_0x29b58a){return function(_0x34ec78){if(_0x34ec78){return _0x34ec78[_0xae4f('0x25')]()[_0xae4f('0x24')](function(){var _0x12ddd4=_0x34ec78[_0xae4f('0x26')]({'plain':!![]});var _0x24d98e=_0xae4f('0x27');return db['UserProfileResource'][_0xae4f('0x25')]({'where':{'type':_0x24d98e,'resourceId':_0x12ddd4['id']}})[_0xae4f('0x24')](function(){return _0x34ec78;});})['then'](function(){_0x594e34[_0xae4f('0x19')](0xcc)[_0xae4f('0x1a')]();});}};}function handleEntityNotFound(_0x51228d,_0x1ab478){return function(_0x26994a){if(!_0x26994a){_0x51228d['sendStatus'](0x194);}return _0x26994a;};}function handleError(_0x538189,_0xd44821){_0xd44821=_0xd44821||0x1f4;return function(_0x531415){logger[_0xae4f('0x28')](_0x531415[_0xae4f('0x29')]);if(_0x531415[_0xae4f('0x2a')]){delete _0x531415[_0xae4f('0x2a')];}_0x538189[_0xae4f('0x19')](_0xd44821)[_0xae4f('0x2b')](_0x531415);};}exports[_0xae4f('0x2c')]=function(_0x4ce4d0,_0x3b220c){var _0x1a4326={},_0x19df43={},_0x444544={'count':0x0,'rows':[]};var _0x14f0a8=db['Interval'][_0xae4f('0x2d')];_0x19df43['model']=_[_0xae4f('0x2e')](_0x14f0a8);_0x19df43[_0xae4f('0x2f')]=_[_0xae4f('0x2e')](_0x4ce4d0[_0xae4f('0x2f')]);_0x19df43['filters']=_[_0xae4f('0x30')](_0x19df43[_0xae4f('0x31')],_0x19df43[_0xae4f('0x2f')]);_0x1a4326[_0xae4f('0x32')]=_[_0xae4f('0x30')](_0x19df43[_0xae4f('0x31')],qs[_0xae4f('0x33')](_0x4ce4d0[_0xae4f('0x2f')][_0xae4f('0x33')]));_0x1a4326[_0xae4f('0x32')]=_0x1a4326[_0xae4f('0x32')][_0xae4f('0x34')]?_0x1a4326[_0xae4f('0x32')]:_0x19df43[_0xae4f('0x31')];if(!_0x4ce4d0[_0xae4f('0x2f')][_0xae4f('0x35')](_0xae4f('0x36'))){_0x1a4326['limit']=qs[_0xae4f('0x1d')](_0x4ce4d0[_0xae4f('0x2f')][_0xae4f('0x1d')]);_0x1a4326[_0xae4f('0x1c')]=qs[_0xae4f('0x1c')](_0x4ce4d0['query'][_0xae4f('0x1c')]);}_0x1a4326[_0xae4f('0x37')]=qs[_0xae4f('0x38')](_0x4ce4d0['query'][_0xae4f('0x38')]);_0x1a4326[_0xae4f('0x39')]=qs[_0xae4f('0x3a')](_[_0xae4f('0x3b')](_0x4ce4d0[_0xae4f('0x2f')],_0x19df43[_0xae4f('0x3a')]));if(_0x4ce4d0[_0xae4f('0x2f')]['filter']){_0x1a4326[_0xae4f('0x39')]=_[_0xae4f('0x3c')](_0x1a4326[_0xae4f('0x39')],{'$or':_[_0xae4f('0x3d')](_0x14f0a8,function(_0xfb6447){if(_0xfb6447[_0xae4f('0x3e')]['key']!==_0xae4f('0x3f')){var _0x452166={};_0x452166[_0xfb6447[_0xae4f('0x40')]]={'$like':'%'+_0x4ce4d0[_0xae4f('0x2f')][_0xae4f('0x41')]+'%'};return _0x452166;}})});}_0x1a4326=_['merge']({},_0x1a4326,_0x4ce4d0[_0xae4f('0x42')]);var _0x243a5d={'where':_0x1a4326[_0xae4f('0x39')]};return db[_0xae4f('0x43')]['count'](_0x243a5d)['then'](function(_0x3d53a6){_0x444544[_0xae4f('0x1b')]=_0x3d53a6;if(_0x4ce4d0[_0xae4f('0x2f')]['includeAll']){_0x1a4326[_0xae4f('0x44')]=[{'all':!![]}];}return db[_0xae4f('0x43')][_0xae4f('0x45')](_0x1a4326);})[_0xae4f('0x24')](function(_0x50a976){_0x444544[_0xae4f('0x46')]=_0x50a976;return _0x444544;})[_0xae4f('0x24')](respondWithFilteredResult(_0x3b220c,_0x1a4326))['catch'](handleError(_0x3b220c,null));};exports['show']=function(_0x5b4125,_0x285792){var _0x3c3435={'raw':!![],'where':{'id':_0x5b4125[_0xae4f('0x47')]['id']}},_0x38eaa1={};_0x38eaa1[_0xae4f('0x31')]=_[_0xae4f('0x2e')](db[_0xae4f('0x43')][_0xae4f('0x2d')]);_0x38eaa1[_0xae4f('0x2f')]=_[_0xae4f('0x2e')](_0x5b4125[_0xae4f('0x2f')]);_0x38eaa1['filters']=_['intersection'](_0x38eaa1[_0xae4f('0x31')],_0x38eaa1['query']);_0x3c3435[_0xae4f('0x32')]=_[_0xae4f('0x30')](_0x38eaa1['model'],qs['fields'](_0x5b4125[_0xae4f('0x2f')][_0xae4f('0x33')]));_0x3c3435['attributes']=_0x3c3435[_0xae4f('0x32')][_0xae4f('0x34')]?_0x3c3435[_0xae4f('0x32')]:_0x38eaa1['model'];if(_0x5b4125[_0xae4f('0x2f')][_0xae4f('0x48')]){_0x3c3435[_0xae4f('0x44')]=[{'all':!![]}];}_0x3c3435=_[_0xae4f('0x3c')]({},_0x3c3435,_0x5b4125[_0xae4f('0x42')]);return db[_0xae4f('0x43')]['find'](_0x3c3435)[_0xae4f('0x24')](handleEntityNotFound(_0x285792,null))[_0xae4f('0x24')](respondWithResult(_0x285792,null))[_0xae4f('0x49')](handleError(_0x285792,null));};exports['create']=function(_0x20f1c2,_0x58d63b){return db[_0xae4f('0x43')][_0xae4f('0x4a')](_0x20f1c2['body'],{})[_0xae4f('0x24')](function(_0x53f424){var _0x15138b=_0x20f1c2['user'][_0xae4f('0x26')]({'plain':!![]});if(!_0x15138b)throw new Error(_0xae4f('0x4b'));if(_0x15138b[_0xae4f('0x4c')]===_0xae4f('0x4d')){var _0x273871=_0x53f424[_0xae4f('0x26')]({'plain':!![]});var _0x7c2b7c=_0xae4f('0x27');return db[_0xae4f('0x4e')]['find']({'where':{'name':_0x7c2b7c,'userProfileId':_0x15138b[_0xae4f('0x4f')]},'raw':!![]})[_0xae4f('0x24')](function(_0x19d3d0){if(_0x19d3d0&&_0x19d3d0[_0xae4f('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x273871[_0xae4f('0x2a')],'resourceId':_0x273871['id'],'type':_0x19d3d0[_0xae4f('0x2a')],'sectionId':_0x19d3d0['id']},{})['then'](function(){return _0x53f424;});}else{return _0x53f424;}})[_0xae4f('0x49')](function(_0x2b1174){logger[_0xae4f('0x28')](_0xae4f('0x51'),_0x2b1174);throw _0x2b1174;});}return _0x53f424;})['then'](respondWithResult(_0x58d63b,0xc9))[_0xae4f('0x49')](handleError(_0x58d63b,null));};exports[_0xae4f('0x23')]=function(_0x385664,_0xf95405){if(_0x385664[_0xae4f('0x52')]['id']){delete _0x385664[_0xae4f('0x52')]['id'];}return db[_0xae4f('0x43')]['find']({'where':{'id':_0x385664[_0xae4f('0x47')]['id']}})['then'](handleEntityNotFound(_0xf95405,null))[_0xae4f('0x24')](saveUpdates(_0x385664[_0xae4f('0x52')],null))[_0xae4f('0x24')](respondWithResult(_0xf95405,null))[_0xae4f('0x49')](handleError(_0xf95405,null));};exports['destroy']=function(_0x38315c,_0x5b844f){return db[_0xae4f('0x43')]['find']({'where':{'id':_0x38315c[_0xae4f('0x47')]['id']}})[_0xae4f('0x24')](handleEntityNotFound(_0x5b844f,null))['then'](removeEntity(_0x5b844f,null))['catch'](handleError(_0x5b844f,null));};exports[_0xae4f('0x53')]=function(_0x10f9a2,_0xc323e1,_0x236a46){if(_0x10f9a2[_0xae4f('0x52')]['id']){delete _0x10f9a2[_0xae4f('0x52')]['id'];}return db[_0xae4f('0x43')][_0xae4f('0x54')]({'where':{'id':_0x10f9a2[_0xae4f('0x47')]['id']}})[_0xae4f('0x24')](handleEntityNotFound(_0xc323e1,null))['then'](function(_0x1bb200){if(_0x1bb200){_0x10f9a2[_0xae4f('0x52')][_0xae4f('0x55')]=_0x1bb200['id'];return db['Interval'][_0xae4f('0x4a')](_0x10f9a2[_0xae4f('0x52')]);}})[_0xae4f('0x24')](respondWithResult(_0xc323e1,null))[_0xae4f('0x49')](handleError(_0xc323e1,null));};exports[_0xae4f('0x56')]=function(_0x280016,_0x3c4035,_0x278903){var _0x28a1a0={};var _0x395e5a={};var _0x4b5730;var _0xe11fbe;return db[_0xae4f('0x43')][_0xae4f('0x57')]({'where':{'id':_0x280016['params']['id']}})[_0xae4f('0x24')](handleEntityNotFound(_0x3c4035,null))[_0xae4f('0x24')](function(_0x120772){if(_0x120772){_0x4b5730=_0x120772;_0x395e5a[_0xae4f('0x31')]=_[_0xae4f('0x2e')](db[_0xae4f('0x43')][_0xae4f('0x2d')]);_0x395e5a[_0xae4f('0x2f')]=_[_0xae4f('0x2e')](_0x280016[_0xae4f('0x2f')]);_0x395e5a[_0xae4f('0x3a')]=_['intersection'](_0x395e5a['model'],_0x395e5a['query']);_0x28a1a0[_0xae4f('0x32')]=_[_0xae4f('0x30')](_0x395e5a[_0xae4f('0x31')],qs[_0xae4f('0x33')](_0x280016['query'][_0xae4f('0x33')]));_0x28a1a0[_0xae4f('0x32')]=_0x28a1a0[_0xae4f('0x32')][_0xae4f('0x34')]?_0x28a1a0[_0xae4f('0x32')]:_0x395e5a[_0xae4f('0x31')];_0x28a1a0['order']=qs[_0xae4f('0x38')](_0x280016['query'][_0xae4f('0x38')]);_0x28a1a0[_0xae4f('0x39')]=qs[_0xae4f('0x3a')](_[_0xae4f('0x3b')](_0x280016[_0xae4f('0x2f')],_0x395e5a[_0xae4f('0x3a')]));if(_0x280016[_0xae4f('0x2f')][_0xae4f('0x41')]){_0x28a1a0['where']=_[_0xae4f('0x3c')](_0x28a1a0[_0xae4f('0x39')],{'$or':_[_0xae4f('0x3d')](_0x28a1a0[_0xae4f('0x32')],function(_0x4c211d){var _0x13db8c={};_0x13db8c[_0x4c211d]={'$like':'%'+_0x280016[_0xae4f('0x2f')][_0xae4f('0x41')]+'%'};return _0x13db8c;})});}_0x28a1a0=_[_0xae4f('0x3c')]({},_0x28a1a0,_0x280016[_0xae4f('0x42')]);return _0x4b5730['getIntervals'](_0x28a1a0);}})[_0xae4f('0x24')](function(_0x4bc1c2){if(_0x4bc1c2){_0xe11fbe=_0x4bc1c2[_0xae4f('0x34')];if(!_0x280016[_0xae4f('0x2f')][_0xae4f('0x35')](_0xae4f('0x36'))){_0x28a1a0[_0xae4f('0x1d')]=qs['limit'](_0x280016[_0xae4f('0x2f')][_0xae4f('0x1d')]);_0x28a1a0['offset']=qs[_0xae4f('0x1c')](_0x280016['query'][_0xae4f('0x1c')]);}return _0x4b5730['getIntervals'](_0x28a1a0);}})['then'](function(_0x5c0c3b){if(_0x5c0c3b){return _0x5c0c3b?{'count':_0xe11fbe,'rows':_0x5c0c3b}:null;}})[_0xae4f('0x24')](respondWithResult(_0x3c4035,null))[_0xae4f('0x49')](handleError(_0x3c4035,null));};exports['addIntervals']=function(_0x1fb44f,_0x298e8a,_0x320cf5){return db[_0xae4f('0x43')][_0xae4f('0x57')]({'where':{'id':_0x1fb44f[_0xae4f('0x47')]['id']}})['then'](handleEntityNotFound(_0x298e8a,null))['then'](function(_0x58ddc0){if(_0x58ddc0){return db[_0xae4f('0x58')][_0xae4f('0x59')](function(_0x1068ee){return db['Interval'][_0xae4f('0x25')]({'where':{'IntervalId':_0x1fb44f[_0xae4f('0x47')]['id']},'transaction':_0x1068ee})[_0xae4f('0x24')](function(_0x3ad7f7){var _0x396970=_['map'](_0x1fb44f['body'],function(_0x22fb23){delete _0x22fb23['id'];_0x22fb23[_0xae4f('0x55')]=_0x1fb44f['params']['id'];return _0x22fb23;});return db[_0xae4f('0x43')][_0xae4f('0x5a')](_0x396970,{'transaction':_0x1068ee});});})[_0xae4f('0x24')](function(){return db[_0xae4f('0x43')][_0xae4f('0x45')]({'where':{'IntervalId':_0x1fb44f[_0xae4f('0x47')]['id']}});});}})[_0xae4f('0x24')](respondWithResult(_0x298e8a,null))[_0xae4f('0x49')](handleError(_0x298e8a,null));}; \ No newline at end of file +var _0x4d94=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','status','end','count','offset','limit','set','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','sendStatus','stack','name','send','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','field','options','Interval','includeAll','findAll','show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','IntervalId','getIntervals','findOne','order','map','nolimit','addIntervals','sequelize','transaction','bulkCreate','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','papaparse','ioredis','../../components/auth/service'];(function(_0x41795d,_0x5ee43c){var _0x2ab57c=function(_0xa2b72){while(--_0xa2b72){_0x41795d['push'](_0x41795d['shift']());}};_0x2ab57c(++_0x5ee43c);}(_0x4d94,0xfd));var _0x44d9=function(_0x4362c4,_0x57b51f){_0x4362c4=_0x4362c4-0x0;var _0x4e2876=_0x4d94[_0x4362c4];return _0x4e2876;};'use strict';var pdf=require(_0x44d9('0x0'));var emlformat=require(_0x44d9('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x44d9('0x2'));var jsonpatch=require(_0x44d9('0x3'));var rp=require(_0x44d9('0x4'));var moment=require(_0x44d9('0x5'));var BPromise=require(_0x44d9('0x6'));var Mustache=require(_0x44d9('0x7'));var util=require(_0x44d9('0x8'));var path=require(_0x44d9('0x9'));var sox=require(_0x44d9('0xa'));var csv=require(_0x44d9('0xb'));var ejs=require(_0x44d9('0xc'));var fs=require('fs');var _=require(_0x44d9('0xd'));var squel=require(_0x44d9('0xe'));var crypto=require('crypto');var jsforce=require(_0x44d9('0xf'));var deskjs=require(_0x44d9('0x10'));var toCsv=require(_0x44d9('0xb'));var querystring=require('querystring');var Papa=require(_0x44d9('0x11'));var Redis=require(_0x44d9('0x12'));var authService=require(_0x44d9('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x44d9('0x14'));var logger=require('../../config/logger')(_0x44d9('0x15'));var utils=require(_0x44d9('0x16'));var config=require(_0x44d9('0x17'));var db=require(_0x44d9('0x18'))['db'];var extensions=require(_0x44d9('0x19'));function respondWithStatusCode(_0x3fa4c8,_0x290d82){_0x290d82=_0x290d82||0xcc;return function(_0x11a272){if(_0x11a272){return _0x3fa4c8['sendStatus'](_0x290d82);}return _0x3fa4c8[_0x44d9('0x1a')](_0x290d82)[_0x44d9('0x1b')]();};}function respondWithResult(_0x573342,_0x376aa3){_0x376aa3=_0x376aa3||0xc8;return function(_0x52028a){if(_0x52028a){return _0x573342[_0x44d9('0x1a')](_0x376aa3)['json'](_0x52028a);}};}function respondWithFilteredResult(_0x3092eb,_0x271e2c){return function(_0x4ba4c3){if(_0x4ba4c3){var _0x3addf4=_0x4ba4c3[_0x44d9('0x1c')],_0x23f80a=_0x271e2c[_0x44d9('0x1d')],_0x1a7877=_0x271e2c['offset']+_0x271e2c[_0x44d9('0x1e')],_0x3f9c61;if(_0x1a7877>=_0x3addf4){_0x1a7877=_0x3addf4;_0x3f9c61=0xc8;}else{_0x3f9c61=0xce;}_0x3092eb[_0x44d9('0x1a')](_0x3f9c61);return _0x3092eb[_0x44d9('0x1f')]('Content-Range',_0x23f80a+'-'+_0x1a7877+'/'+_0x3addf4)['json'](_0x4ba4c3);}return null;};}function patchUpdates(_0x283bf9){return function(_0x34757e){try{jsonpatch[_0x44d9('0x20')](_0x34757e,_0x283bf9,!![]);}catch(_0x23e0b1){return BPromise[_0x44d9('0x21')](_0x23e0b1);}return _0x34757e[_0x44d9('0x22')]();};}function saveUpdates(_0x146ce3,_0x5d0b86){return function(_0x10f49c){if(_0x10f49c){return _0x10f49c[_0x44d9('0x23')](_0x146ce3)[_0x44d9('0x24')](function(_0x3fd7a5){return _0x3fd7a5;});}return null;};}function removeEntity(_0x656221,_0x1cdb0e){return function(_0x5d29c4){if(_0x5d29c4){return _0x5d29c4[_0x44d9('0x25')]()[_0x44d9('0x24')](function(){var _0x1185f8=_0x5d29c4[_0x44d9('0x26')]({'plain':!![]});var _0x48ba76=_0x44d9('0x27');return db[_0x44d9('0x28')][_0x44d9('0x25')]({'where':{'type':_0x48ba76,'resourceId':_0x1185f8['id']}})['then'](function(){return _0x5d29c4;});})[_0x44d9('0x24')](function(){_0x656221[_0x44d9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c9525,_0x66acf2){return function(_0x19022c){if(!_0x19022c){_0x1c9525[_0x44d9('0x29')](0x194);}return _0x19022c;};}function handleError(_0x8af429,_0x43c22f){_0x43c22f=_0x43c22f||0x1f4;return function(_0x15b18f){logger['error'](_0x15b18f[_0x44d9('0x2a')]);if(_0x15b18f[_0x44d9('0x2b')]){delete _0x15b18f['name'];}_0x8af429[_0x44d9('0x1a')](_0x43c22f)[_0x44d9('0x2c')](_0x15b18f);};}exports['index']=function(_0x442b8c,_0x4ada51){var _0x4e9cab={},_0x283902={},_0x144a00={'count':0x0,'rows':[]};var _0x323466=db['Interval'][_0x44d9('0x2d')];_0x283902['model']=_[_0x44d9('0x2e')](_0x323466);_0x283902[_0x44d9('0x2f')]=_['keys'](_0x442b8c[_0x44d9('0x2f')]);_0x283902[_0x44d9('0x30')]=_[_0x44d9('0x31')](_0x283902[_0x44d9('0x32')],_0x283902[_0x44d9('0x2f')]);_0x4e9cab[_0x44d9('0x33')]=_[_0x44d9('0x31')](_0x283902[_0x44d9('0x32')],qs[_0x44d9('0x34')](_0x442b8c['query'][_0x44d9('0x34')]));_0x4e9cab['attributes']=_0x4e9cab['attributes'][_0x44d9('0x35')]?_0x4e9cab[_0x44d9('0x33')]:_0x283902[_0x44d9('0x32')];if(!_0x442b8c[_0x44d9('0x2f')][_0x44d9('0x36')]('nolimit')){_0x4e9cab[_0x44d9('0x1e')]=qs['limit'](_0x442b8c[_0x44d9('0x2f')]['limit']);_0x4e9cab[_0x44d9('0x1d')]=qs[_0x44d9('0x1d')](_0x442b8c[_0x44d9('0x2f')]['offset']);}_0x4e9cab['order']=qs[_0x44d9('0x37')](_0x442b8c['query'][_0x44d9('0x37')]);_0x4e9cab[_0x44d9('0x38')]=qs['filters'](_[_0x44d9('0x39')](_0x442b8c['query'],_0x283902[_0x44d9('0x30')]));if(_0x442b8c[_0x44d9('0x2f')][_0x44d9('0x3a')]){_0x4e9cab[_0x44d9('0x38')]=_[_0x44d9('0x3b')](_0x4e9cab['where'],{'$or':_['map'](_0x323466,function(_0x1565fa){if(_0x1565fa[_0x44d9('0x3c')]['key']!==_0x44d9('0x3d')){var _0x44c7bd={};_0x44c7bd[_0x1565fa[_0x44d9('0x3e')]]={'$like':'%'+_0x442b8c['query'][_0x44d9('0x3a')]+'%'};return _0x44c7bd;}})});}_0x4e9cab=_[_0x44d9('0x3b')]({},_0x4e9cab,_0x442b8c[_0x44d9('0x3f')]);var _0x2f1fab={'where':_0x4e9cab['where']};return db[_0x44d9('0x40')][_0x44d9('0x1c')](_0x2f1fab)[_0x44d9('0x24')](function(_0x57cf05){_0x144a00[_0x44d9('0x1c')]=_0x57cf05;if(_0x442b8c[_0x44d9('0x2f')][_0x44d9('0x41')]){_0x4e9cab['include']=[{'all':!![]}];}return db['Interval'][_0x44d9('0x42')](_0x4e9cab);})[_0x44d9('0x24')](function(_0x396d01){_0x144a00['rows']=_0x396d01;return _0x144a00;})[_0x44d9('0x24')](respondWithFilteredResult(_0x4ada51,_0x4e9cab))['catch'](handleError(_0x4ada51,null));};exports[_0x44d9('0x43')]=function(_0x2881e2,_0x5a29bf){var _0x5a16fd={'raw':!![],'where':{'id':_0x2881e2[_0x44d9('0x44')]['id']}},_0x471821={};_0x471821[_0x44d9('0x32')]=_[_0x44d9('0x2e')](db['Interval']['rawAttributes']);_0x471821[_0x44d9('0x2f')]=_[_0x44d9('0x2e')](_0x2881e2[_0x44d9('0x2f')]);_0x471821[_0x44d9('0x30')]=_[_0x44d9('0x31')](_0x471821[_0x44d9('0x32')],_0x471821[_0x44d9('0x2f')]);_0x5a16fd[_0x44d9('0x33')]=_[_0x44d9('0x31')](_0x471821[_0x44d9('0x32')],qs['fields'](_0x2881e2['query'][_0x44d9('0x34')]));_0x5a16fd[_0x44d9('0x33')]=_0x5a16fd[_0x44d9('0x33')][_0x44d9('0x35')]?_0x5a16fd['attributes']:_0x471821[_0x44d9('0x32')];if(_0x2881e2[_0x44d9('0x2f')][_0x44d9('0x41')]){_0x5a16fd['include']=[{'all':!![]}];}_0x5a16fd=_[_0x44d9('0x3b')]({},_0x5a16fd,_0x2881e2[_0x44d9('0x3f')]);return db[_0x44d9('0x40')][_0x44d9('0x45')](_0x5a16fd)['then'](handleEntityNotFound(_0x5a29bf,null))[_0x44d9('0x24')](respondWithResult(_0x5a29bf,null))[_0x44d9('0x46')](handleError(_0x5a29bf,null));};exports[_0x44d9('0x47')]=function(_0x5ebe73,_0x354e15){return db[_0x44d9('0x40')][_0x44d9('0x47')](_0x5ebe73['body'],{})['then'](function(_0x23621d){var _0xd05513=_0x5ebe73[_0x44d9('0x48')][_0x44d9('0x26')]({'plain':!![]});if(!_0xd05513)throw new Error(_0x44d9('0x49'));if(_0xd05513[_0x44d9('0x4a')]===_0x44d9('0x48')){var _0x148c75=_0x23621d[_0x44d9('0x26')]({'plain':!![]});var _0x481821=_0x44d9('0x27');return db[_0x44d9('0x4b')][_0x44d9('0x45')]({'where':{'name':_0x481821,'userProfileId':_0xd05513[_0x44d9('0x4c')]},'raw':!![]})['then'](function(_0x4bdfa5){if(_0x4bdfa5&&_0x4bdfa5[_0x44d9('0x4d')]===0x0){return db[_0x44d9('0x28')][_0x44d9('0x47')]({'name':_0x148c75[_0x44d9('0x2b')],'resourceId':_0x148c75['id'],'type':_0x4bdfa5['name'],'sectionId':_0x4bdfa5['id']},{})[_0x44d9('0x24')](function(){return _0x23621d;});}else{return _0x23621d;}})['catch'](function(_0x499782){logger[_0x44d9('0x4e')](_0x44d9('0x4f'),_0x499782);throw _0x499782;});}return _0x23621d;})['then'](respondWithResult(_0x354e15,0xc9))[_0x44d9('0x46')](handleError(_0x354e15,null));};exports[_0x44d9('0x23')]=function(_0x1f4815,_0x20e6bc){if(_0x1f4815[_0x44d9('0x50')]['id']){delete _0x1f4815[_0x44d9('0x50')]['id'];}return db['Interval']['find']({'where':{'id':_0x1f4815[_0x44d9('0x44')]['id']}})[_0x44d9('0x24')](handleEntityNotFound(_0x20e6bc,null))['then'](saveUpdates(_0x1f4815[_0x44d9('0x50')],null))[_0x44d9('0x24')](respondWithResult(_0x20e6bc,null))[_0x44d9('0x46')](handleError(_0x20e6bc,null));};exports[_0x44d9('0x25')]=function(_0x16a6fe,_0x123569){return db['Interval'][_0x44d9('0x45')]({'where':{'id':_0x16a6fe[_0x44d9('0x44')]['id']}})[_0x44d9('0x24')](handleEntityNotFound(_0x123569,null))['then'](removeEntity(_0x123569,null))['catch'](handleError(_0x123569,null));};exports['addInterval']=function(_0x523e13,_0x11cc19,_0x2b6ec1){if(_0x523e13[_0x44d9('0x50')]['id']){delete _0x523e13[_0x44d9('0x50')]['id'];}return db[_0x44d9('0x40')][_0x44d9('0x45')]({'where':{'id':_0x523e13[_0x44d9('0x44')]['id']}})[_0x44d9('0x24')](handleEntityNotFound(_0x11cc19,null))[_0x44d9('0x24')](function(_0xdb254f){if(_0xdb254f){_0x523e13['body'][_0x44d9('0x51')]=_0xdb254f['id'];return db[_0x44d9('0x40')][_0x44d9('0x47')](_0x523e13[_0x44d9('0x50')]);}})[_0x44d9('0x24')](respondWithResult(_0x11cc19,null))[_0x44d9('0x46')](handleError(_0x11cc19,null));};exports[_0x44d9('0x52')]=function(_0x1d1a73,_0x2570d5,_0x422c1c){var _0x18fd53={};var _0x2b5ad9={};var _0x1970b7;var _0x2b1855;return db['Interval'][_0x44d9('0x53')]({'where':{'id':_0x1d1a73['params']['id']}})['then'](handleEntityNotFound(_0x2570d5,null))['then'](function(_0x182bd3){if(_0x182bd3){_0x1970b7=_0x182bd3;_0x2b5ad9[_0x44d9('0x32')]=_[_0x44d9('0x2e')](db['Interval']['rawAttributes']);_0x2b5ad9['query']=_[_0x44d9('0x2e')](_0x1d1a73[_0x44d9('0x2f')]);_0x2b5ad9[_0x44d9('0x30')]=_[_0x44d9('0x31')](_0x2b5ad9[_0x44d9('0x32')],_0x2b5ad9[_0x44d9('0x2f')]);_0x18fd53[_0x44d9('0x33')]=_[_0x44d9('0x31')](_0x2b5ad9[_0x44d9('0x32')],qs[_0x44d9('0x34')](_0x1d1a73[_0x44d9('0x2f')]['fields']));_0x18fd53['attributes']=_0x18fd53[_0x44d9('0x33')]['length']?_0x18fd53[_0x44d9('0x33')]:_0x2b5ad9[_0x44d9('0x32')];_0x18fd53[_0x44d9('0x54')]=qs['sort'](_0x1d1a73[_0x44d9('0x2f')][_0x44d9('0x37')]);_0x18fd53['where']=qs[_0x44d9('0x30')](_[_0x44d9('0x39')](_0x1d1a73[_0x44d9('0x2f')],_0x2b5ad9[_0x44d9('0x30')]));if(_0x1d1a73['query']['filter']){_0x18fd53[_0x44d9('0x38')]=_['merge'](_0x18fd53[_0x44d9('0x38')],{'$or':_[_0x44d9('0x55')](_0x18fd53[_0x44d9('0x33')],function(_0x3a9143){var _0x971f20={};_0x971f20[_0x3a9143]={'$like':'%'+_0x1d1a73[_0x44d9('0x2f')]['filter']+'%'};return _0x971f20;})});}_0x18fd53=_[_0x44d9('0x3b')]({},_0x18fd53,_0x1d1a73[_0x44d9('0x3f')]);return _0x1970b7['getIntervals'](_0x18fd53);}})[_0x44d9('0x24')](function(_0x1e287c){if(_0x1e287c){_0x2b1855=_0x1e287c[_0x44d9('0x35')];if(!_0x1d1a73[_0x44d9('0x2f')][_0x44d9('0x36')](_0x44d9('0x56'))){_0x18fd53[_0x44d9('0x1e')]=qs[_0x44d9('0x1e')](_0x1d1a73[_0x44d9('0x2f')]['limit']);_0x18fd53[_0x44d9('0x1d')]=qs[_0x44d9('0x1d')](_0x1d1a73[_0x44d9('0x2f')]['offset']);}return _0x1970b7[_0x44d9('0x52')](_0x18fd53);}})['then'](function(_0x1d6807){if(_0x1d6807){return _0x1d6807?{'count':_0x2b1855,'rows':_0x1d6807}:null;}})[_0x44d9('0x24')](respondWithResult(_0x2570d5,null))[_0x44d9('0x46')](handleError(_0x2570d5,null));};exports[_0x44d9('0x57')]=function(_0x727e74,_0xca711a,_0x2519cc){return db[_0x44d9('0x40')]['findOne']({'where':{'id':_0x727e74['params']['id']}})['then'](handleEntityNotFound(_0xca711a,null))[_0x44d9('0x24')](function(_0x5a2e90){if(_0x5a2e90){return db[_0x44d9('0x58')][_0x44d9('0x59')](function(_0x526a2c){return db[_0x44d9('0x40')][_0x44d9('0x25')]({'where':{'IntervalId':_0x727e74[_0x44d9('0x44')]['id']},'transaction':_0x526a2c})[_0x44d9('0x24')](function(_0x5bfa5c){var _0x125c61=_[_0x44d9('0x55')](_0x727e74[_0x44d9('0x50')],function(_0xcb8be6){delete _0xcb8be6['id'];_0xcb8be6[_0x44d9('0x51')]=_0x727e74[_0x44d9('0x44')]['id'];return _0xcb8be6;});return db[_0x44d9('0x40')][_0x44d9('0x5a')](_0x125c61,{'transaction':_0x526a2c});});})[_0x44d9('0x24')](function(){return db[_0x44d9('0x40')][_0x44d9('0x42')]({'where':{'IntervalId':_0x727e74[_0x44d9('0x44')]['id']}});});}})[_0x44d9('0x24')](respondWithResult(_0xca711a,null))['catch'](handleError(_0xca711a,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 8461861..273ed5b 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 _0xab50=['api','path','rimraf','../../components/extensions/rewrite','define','Interval','tools_intervals','rewrite','util','../../config/logger'];(function(_0x478dbb,_0x48b454){var _0x3ff700=function(_0x95f597){while(--_0x95f597){_0x478dbb['push'](_0x478dbb['shift']());}};_0x3ff700(++_0x48b454);}(_0xab50,0x10c));var _0x0ab5=function(_0x414813,_0x22cdff){_0x414813=_0x414813-0x0;var _0x536de0=_0xab50[_0x414813];return _0x536de0;};'use strict';var _=require('lodash');var util=require(_0x0ab5('0x0'));var logger=require(_0x0ab5('0x1'))(_0x0ab5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ab5('0x3'));var rimraf=require(_0x0ab5('0x4'));var config=require('../../config/environment');var attributes=require('./interval.attributes');var extensions=require(_0x0ab5('0x5'));module['exports']=function(_0x2d23c7,_0x92a0e8){return _0x2d23c7[_0x0ab5('0x6')](_0x0ab5('0x7'),attributes,{'tableName':_0x0ab5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x59258c,_0xd650b9){extensions['rewrite'](_0x2d23c7,_0x59258c);},'afterBulkCreate':function(_0x29336b,_0x3cb3d0,_0x37d4c5){_0x37d4c5();extensions['rewrite'](_0x2d23c7,_0x29336b[0x0]);},'afterUpdate':function(_0xe0d388,_0x4d552c){extensions[_0x0ab5('0x9')](_0x2d23c7,_0xe0d388);},'afterDestroy':function(_0x59618f,_0x4d1a5f){extensions[_0x0ab5('0x9')](_0x2d23c7,_0x59618f);}}});}; \ No newline at end of file +var _0x3041=['tools_intervals','rewrite','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval'];(function(_0x57ff3d,_0x551fbd){var _0xf4ab01=function(_0x82ffcb){while(--_0x82ffcb){_0x57ff3d['push'](_0x57ff3d['shift']());}};_0xf4ab01(++_0x551fbd);}(_0x3041,0xb6));var _0x1304=function(_0x387603,_0x5a2d1){_0x387603=_0x387603-0x0;var _0x55ea9e=_0x3041[_0x387603];return _0x55ea9e;};'use strict';var _=require('lodash');var util=require(_0x1304('0x0'));var logger=require(_0x1304('0x1'))('api');var moment=require(_0x1304('0x2'));var BPromise=require(_0x1304('0x3'));var rp=require(_0x1304('0x4'));var fs=require('fs');var path=require(_0x1304('0x5'));var rimraf=require(_0x1304('0x6'));var config=require(_0x1304('0x7'));var attributes=require(_0x1304('0x8'));var extensions=require(_0x1304('0x9'));module[_0x1304('0xa')]=function(_0x36474e,_0x26f166){return _0x36474e[_0x1304('0xb')](_0x1304('0xc'),attributes,{'tableName':_0x1304('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4f30e4,_0x102399){extensions['rewrite'](_0x36474e,_0x4f30e4);},'afterBulkCreate':function(_0x5b6b1c,_0x43d75e,_0x36c6ff){_0x36c6ff();extensions[_0x1304('0xe')](_0x36474e,_0x5b6b1c[0x0]);},'afterUpdate':function(_0x14290b,_0x57c88f){extensions[_0x1304('0xe')](_0x36474e,_0x14290b);},'afterDestroy':function(_0x5f2c8a,_0x4aade4){extensions['rewrite'](_0x36474e,_0x5f2c8a);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index beab4bf..effeaaf 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 _0x277c=['where','attributes','limit','include','map','model','debug','find','ShowInterval','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','Interval,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetInterval','Interval','findAll','options','raw'];(function(_0x54f6b1,_0x2dde5c){var _0x3d3a74=function(_0x43b1db){while(--_0x43b1db){_0x54f6b1['push'](_0x54f6b1['shift']());}};_0x3d3a74(++_0x2dde5c);}(_0x277c,0x153));var _0xc277=function(_0x36104f,_0x2ff6c2){_0x36104f=_0x36104f-0x0;var _0x4d47a1=_0x277c[_0x36104f];return _0x4d47a1;};'use strict';var _=require(_0xc277('0x0'));var util=require('util');var moment=require(_0xc277('0x1'));var BPromise=require(_0xc277('0x2'));var rs=require(_0xc277('0x3'));var fs=require('fs');var Redis=require(_0xc277('0x4'));var db=require(_0xc277('0x5'))['db'];var utils=require(_0xc277('0x6'));var logger=require(_0xc277('0x7'))(_0xc277('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc277('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x77e168,_0x54d634,_0x378158){return new BPromise(function(_0x17a2fe,_0x55be1f){return client[_0xc277('0xa')](_0x77e168,_0x378158)[_0xc277('0xb')](function(_0xfdf694){logger[_0xc277('0xc')](_0xc277('0xd'),_0x54d634,_0xc277('0xe'));logger['debug']('Interval,\x20%s,\x20%s,\x20%s',_0x54d634,_0xc277('0xe'),JSON[_0xc277('0xf')](_0xfdf694));if(_0xfdf694[_0xc277('0x10')]){if(_0xfdf694[_0xc277('0x10')]['code']===0x1f4){logger[_0xc277('0x10')]('Interval,\x20%s,\x20%s',_0x54d634,_0xfdf694[_0xc277('0x10')][_0xc277('0x11')]);return _0x55be1f(_0xfdf694[_0xc277('0x10')][_0xc277('0x11')]);}logger['error'](_0xc277('0xd'),_0x54d634,_0xfdf694[_0xc277('0x10')][_0xc277('0x11')]);return _0x17a2fe(_0xfdf694['error']['message']);}else{logger[_0xc277('0xc')]('Interval,\x20%s,\x20%s',_0x54d634,_0xc277('0xe'));_0x17a2fe(_0xfdf694['result'][_0xc277('0x11')]);}})[_0xc277('0x12')](function(_0x15f560){logger['error']('Interval,\x20%s,\x20%s',_0x54d634,_0x15f560);_0x55be1f(_0x15f560);});});}exports[_0xc277('0x13')]=function(_0x4d23a7){var _0x4d8351=this;return new Promise(function(_0x1e1a9b,_0xba31f6){return db[_0xc277('0x14')][_0xc277('0x15')]({'raw':_0x4d23a7[_0xc277('0x16')]?_0x4d23a7[_0xc277('0x16')][_0xc277('0x17')]===undefined?!![]:![]:!![],'where':_0x4d23a7['options']?_0x4d23a7['options'][_0xc277('0x18')]||null:null,'attributes':_0x4d23a7[_0xc277('0x16')]?_0x4d23a7[_0xc277('0x16')][_0xc277('0x19')]||null:null,'limit':_0x4d23a7[_0xc277('0x16')]?_0x4d23a7[_0xc277('0x16')][_0xc277('0x1a')]||null:null,'include':_0x4d23a7[_0xc277('0x16')]?_0x4d23a7[_0xc277('0x16')][_0xc277('0x1b')]?_[_0xc277('0x1c')](_0x4d23a7['options'][_0xc277('0x1b')],function(_0x21af1b){return{'model':db[_0x21af1b['model']],'as':_0x21af1b['as'],'attributes':_0x21af1b[_0xc277('0x19')],'include':_0x21af1b['include']?_['map'](_0x21af1b[_0xc277('0x1b')],function(_0x57b03){return{'model':db[_0x57b03[_0xc277('0x1d')]],'as':_0x57b03['as'],'attributes':_0x57b03[_0xc277('0x19')],'include':_0x57b03[_0xc277('0x1b')]?_[_0xc277('0x1c')](_0x57b03[_0xc277('0x1b')],function(_0x9ad1c5){return{'model':db[_0x9ad1c5[_0xc277('0x1d')]],'as':_0x9ad1c5['as'],'attributes':_0x9ad1c5[_0xc277('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc277('0xb')](function(_0x5e480e){logger['info'](_0xc277('0x13'),_0x4d23a7);logger[_0xc277('0x1e')]('GetInterval',_0x4d23a7,JSON['stringify'](_0x5e480e));_0x1e1a9b(_0x5e480e);})[_0xc277('0x12')](function(_0x3bc773){logger[_0xc277('0x10')](_0xc277('0x13'),_0x3bc773[_0xc277('0x11')],_0x4d23a7);_0xba31f6(_0x4d8351['error'](0x1f4,_0x3bc773[_0xc277('0x11')]));});});};exports['ShowInterval']=function(_0x12c2f9){var _0x74ff17=this;return new Promise(function(_0x4348d9,_0x881e70){return db['Interval'][_0xc277('0x1f')]({'raw':_0x12c2f9['options']?_0x12c2f9[_0xc277('0x16')][_0xc277('0x17')]===undefined?!![]:![]:!![],'where':_0x12c2f9[_0xc277('0x16')]?_0x12c2f9[_0xc277('0x16')]['where']||null:null,'attributes':_0x12c2f9[_0xc277('0x16')]?_0x12c2f9[_0xc277('0x16')]['attributes']||null:null,'include':_0x12c2f9[_0xc277('0x16')]?_0x12c2f9['options'][_0xc277('0x1b')]?_[_0xc277('0x1c')](_0x12c2f9[_0xc277('0x16')][_0xc277('0x1b')],function(_0x2cc28d){return{'model':db[_0x2cc28d[_0xc277('0x1d')]],'as':_0x2cc28d['as'],'attributes':_0x2cc28d[_0xc277('0x19')],'include':_0x2cc28d[_0xc277('0x1b')]?_[_0xc277('0x1c')](_0x2cc28d[_0xc277('0x1b')],function(_0xdc94a1){return{'model':db[_0xdc94a1['model']],'as':_0xdc94a1['as'],'attributes':_0xdc94a1[_0xc277('0x19')],'include':_0xdc94a1[_0xc277('0x1b')]?_[_0xc277('0x1c')](_0xdc94a1['include'],function(_0x380e45){return{'model':db[_0x380e45[_0xc277('0x1d')]],'as':_0x380e45['as'],'attributes':_0x380e45[_0xc277('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc277('0xb')](function(_0x3522ee){logger['info']('ShowInterval',_0x12c2f9);logger[_0xc277('0x1e')]('ShowInterval',_0x12c2f9,JSON[_0xc277('0xf')](_0x3522ee));_0x4348d9(_0x3522ee);})[_0xc277('0x12')](function(_0x112a89){logger[_0xc277('0x10')](_0xc277('0x20'),_0x112a89[_0xc277('0x11')],_0x12c2f9);_0x881e70(_0x74ff17[_0xc277('0x10')](0x1f4,_0x112a89[_0xc277('0x11')]));});});}; \ No newline at end of file +var _0x7c09=['../../config/logger','rpc','../../config/environment','then','info','Interval,\x20%s,\x20%s','Interval,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Interval','findAll','options','raw','attributes','limit','include','map','model','GetInterval','debug','ShowInterval','where','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4496be,_0x50aa16){var _0x35d9fe=function(_0x321f91){while(--_0x321f91){_0x4496be['push'](_0x4496be['shift']());}};_0x35d9fe(++_0x50aa16);}(_0x7c09,0x102));var _0x97c0=function(_0x2e22c6,_0x174c88){_0x2e22c6=_0x2e22c6-0x0;var _0x345027=_0x7c09[_0x2e22c6];return _0x345027;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var moment=require(_0x97c0('0x1'));var BPromise=require('bluebird');var rs=require(_0x97c0('0x2'));var fs=require('fs');var Redis=require(_0x97c0('0x3'));var db=require(_0x97c0('0x4'))['db'];var utils=require(_0x97c0('0x5'));var logger=require(_0x97c0('0x6'))(_0x97c0('0x7'));var config=require(_0x97c0('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46fdd9,_0x42c6c7,_0x2c19fa){return new BPromise(function(_0x109bc8,_0x293785){return client['request'](_0x46fdd9,_0x2c19fa)[_0x97c0('0x9')](function(_0x4ac5f1){logger[_0x97c0('0xa')](_0x97c0('0xb'),_0x42c6c7,'request\x20sent');logger['debug'](_0x97c0('0xc'),_0x42c6c7,_0x97c0('0xd'),JSON[_0x97c0('0xe')](_0x4ac5f1));if(_0x4ac5f1[_0x97c0('0xf')]){if(_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x10')]===0x1f4){logger[_0x97c0('0xf')](_0x97c0('0xb'),_0x42c6c7,_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);return _0x293785(_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);}logger[_0x97c0('0xf')]('Interval,\x20%s,\x20%s',_0x42c6c7,_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);return _0x109bc8(_0x4ac5f1[_0x97c0('0xf')]['message']);}else{logger[_0x97c0('0xa')](_0x97c0('0xb'),_0x42c6c7,_0x97c0('0xd'));_0x109bc8(_0x4ac5f1[_0x97c0('0x12')][_0x97c0('0x11')]);}})[_0x97c0('0x13')](function(_0x49c0d9){logger[_0x97c0('0xf')](_0x97c0('0xb'),_0x42c6c7,_0x49c0d9);_0x293785(_0x49c0d9);});});}exports['GetInterval']=function(_0x560ac0){var _0x16918b=this;return new Promise(function(_0x179d43,_0xe81408){return db[_0x97c0('0x14')][_0x97c0('0x15')]({'raw':_0x560ac0[_0x97c0('0x16')]?_0x560ac0[_0x97c0('0x16')][_0x97c0('0x17')]===undefined?!![]:![]:!![],'where':_0x560ac0[_0x97c0('0x16')]?_0x560ac0['options']['where']||null:null,'attributes':_0x560ac0[_0x97c0('0x16')]?_0x560ac0[_0x97c0('0x16')][_0x97c0('0x18')]||null:null,'limit':_0x560ac0['options']?_0x560ac0[_0x97c0('0x16')][_0x97c0('0x19')]||null:null,'include':_0x560ac0[_0x97c0('0x16')]?_0x560ac0[_0x97c0('0x16')][_0x97c0('0x1a')]?_[_0x97c0('0x1b')](_0x560ac0[_0x97c0('0x16')]['include'],function(_0x60ab00){return{'model':db[_0x60ab00[_0x97c0('0x1c')]],'as':_0x60ab00['as'],'attributes':_0x60ab00[_0x97c0('0x18')],'include':_0x60ab00[_0x97c0('0x1a')]?_['map'](_0x60ab00[_0x97c0('0x1a')],function(_0x14cada){return{'model':db[_0x14cada['model']],'as':_0x14cada['as'],'attributes':_0x14cada[_0x97c0('0x18')],'include':_0x14cada[_0x97c0('0x1a')]?_[_0x97c0('0x1b')](_0x14cada['include'],function(_0x4f11ba){return{'model':db[_0x4f11ba['model']],'as':_0x4f11ba['as'],'attributes':_0x4f11ba[_0x97c0('0x18')]};}):[]};}):[]};}):[]:[]})[_0x97c0('0x9')](function(_0x3a744c){logger[_0x97c0('0xa')](_0x97c0('0x1d'),_0x560ac0);logger[_0x97c0('0x1e')]('GetInterval',_0x560ac0,JSON[_0x97c0('0xe')](_0x3a744c));_0x179d43(_0x3a744c);})[_0x97c0('0x13')](function(_0x325090){logger['error'](_0x97c0('0x1d'),_0x325090[_0x97c0('0x11')],_0x560ac0);_0xe81408(_0x16918b[_0x97c0('0xf')](0x1f4,_0x325090[_0x97c0('0x11')]));});});};exports[_0x97c0('0x1f')]=function(_0x5c4e4e){var _0x59abbb=this;return new Promise(function(_0x29ad98,_0x353fc9){return db[_0x97c0('0x14')]['find']({'raw':_0x5c4e4e[_0x97c0('0x16')]?_0x5c4e4e[_0x97c0('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5c4e4e[_0x97c0('0x16')]?_0x5c4e4e[_0x97c0('0x16')][_0x97c0('0x20')]||null:null,'attributes':_0x5c4e4e[_0x97c0('0x16')]?_0x5c4e4e[_0x97c0('0x16')][_0x97c0('0x18')]||null:null,'include':_0x5c4e4e[_0x97c0('0x16')]?_0x5c4e4e[_0x97c0('0x16')][_0x97c0('0x1a')]?_[_0x97c0('0x1b')](_0x5c4e4e[_0x97c0('0x16')][_0x97c0('0x1a')],function(_0x1de938){return{'model':db[_0x1de938[_0x97c0('0x1c')]],'as':_0x1de938['as'],'attributes':_0x1de938[_0x97c0('0x18')],'include':_0x1de938['include']?_[_0x97c0('0x1b')](_0x1de938[_0x97c0('0x1a')],function(_0x2b7f9a){return{'model':db[_0x2b7f9a[_0x97c0('0x1c')]],'as':_0x2b7f9a['as'],'attributes':_0x2b7f9a[_0x97c0('0x18')],'include':_0x2b7f9a[_0x97c0('0x1a')]?_[_0x97c0('0x1b')](_0x2b7f9a[_0x97c0('0x1a')],function(_0x582828){return{'model':db[_0x582828[_0x97c0('0x1c')]],'as':_0x582828['as'],'attributes':_0x582828['attributes']};}):[]};}):[]};}):[]:[]})[_0x97c0('0x9')](function(_0x20291){logger[_0x97c0('0xa')](_0x97c0('0x1f'),_0x5c4e4e);logger[_0x97c0('0x1e')](_0x97c0('0x1f'),_0x5c4e4e,JSON[_0x97c0('0xe')](_0x20291));_0x29ad98(_0x20291);})[_0x97c0('0x13')](function(_0x38f37a){logger[_0x97c0('0xf')](_0x97c0('0x1f'),_0x38f37a['message'],_0x5c4e4e);_0x353fc9(_0x59abbb[_0x97c0('0xf')](0x1f4,_0x38f37a[_0x97c0('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 57246c9..b06d1ee 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(_0x46c9a5,_0x1cb9e7){var _0x5e3eec=function(_0x24105a){while(--_0x24105a){_0x46c9a5['push'](_0x46c9a5['shift']());}};_0x5e3eec(++_0x1cb9e7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x352a96,_0x1e941b){_0x352a96=_0x352a96-0x0;var _0x50def3=_0x5f2f[_0x352a96];return _0x50def3;};'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 _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x197cad,_0x1f5984){var _0x3bfae3=function(_0x13f8c5){while(--_0x13f8c5){_0x197cad['push'](_0x197cad['shift']());}};_0x3bfae3(++_0x1f5984);}(_0xdb28,0x106));var _0x8db2=function(_0x4e73c7,_0x496f58){_0x4e73c7=_0x4e73c7-0x0;var _0x34f645=_0xdb28[_0x4e73c7];return _0x34f645;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index af27791..9936e14 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 _0xcb91=['summary','\x20from\x20','description','issuetype','Bug','customfield_11500','customfield_11501','oldToken','fields','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','toString','base64','stringify','setEncoding','utf8','data','end','status','parse','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','x-forwarded-for','connection','remoteAddress','socket','body','../../config/logger','api','support','3eAmWpBVP0','MOTGUI'];(function(_0x40d728,_0x190ef2){var _0x207740=function(_0x116913){while(--_0x116913){_0x40d728['push'](_0x40d728['shift']());}};_0x207740(++_0x190ef2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3df9dd,_0x26f5cd){_0x3df9dd=_0x3df9dd-0x0;var _0x4f11e4=_0xcb91[_0x3df9dd];return _0x4f11e4;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var USERNAME=_0x1cb9('0x2');var PASSWORD=_0x1cb9('0x3');function openIssue(_0x4c37e8,_0x8c392f){var _0x2c17b8={'fields':{'project':{'key':_0x4c37e8['key']||_0x1cb9('0x4')},'summary':(_0x4c37e8[_0x1cb9('0x5')]||'Report')+_0x1cb9('0x6')+_0x4c37e8['ip'],'description':_0x4c37e8[_0x1cb9('0x7')]||JSON['stringify'](_0x4c37e8),'issuetype':{'name':_0x4c37e8[_0x1cb9('0x8')]||_0x1cb9('0x9')}}};_0x2c17b8['fields'][_0x1cb9('0xa')]=_0x4c37e8['email'];_0x2c17b8['fields'][_0x1cb9('0xb')]=_0x4c37e8[_0x1cb9('0xc')];_0x2c17b8[_0x1cb9('0xd')][_0x1cb9('0xe')]=_0x4c37e8[_0x1cb9('0xf')];_0x2c17b8['fields'][_0x1cb9('0x10')]=_0x4c37e8[_0x1cb9('0x11')];_0x2c17b8[_0x1cb9('0xd')][_0x1cb9('0x12')]=_0x4c37e8[_0x1cb9('0x13')];_0x2c17b8['fields']['customfield_10102']=_0x4c37e8['ip'];var _0x59dec3={'host':_0x1cb9('0x14'),'port':0x1bb,'path':_0x1cb9('0x15'),'method':_0x1cb9('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x1cb9('0x17'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x1cb9('0x18')](_0x1cb9('0x19'))}};var _0x1b3cd7=JSON[_0x1cb9('0x1a')](_0x2c17b8);var _0x3e2d11=https['request'](_0x59dec3,function(_0x5572cb){_0x5572cb[_0x1cb9('0x1b')](_0x1cb9('0x1c'));var _0x3904b7='';_0x5572cb['on'](_0x1cb9('0x1d'),function(_0x3e21e0){_0x3904b7+=_0x3e21e0;});_0x5572cb['on'](_0x1cb9('0x1e'),function(){if(_0x8c392f){return _0x8c392f[_0x1cb9('0x1f')](_0x5572cb['statusCode'])['json'](JSON[_0x1cb9('0x20')](_0x3904b7));}});});_0x3e2d11['on'](_0x1cb9('0x21'),function(_0x2b2669){if(_0x8c392f){return _0x8c392f[_0x1cb9('0x1f')](0x1f4)[_0x1cb9('0x22')]({'errors':[{'message':_0x1cb9('0x23'),'type':_0x1cb9('0x24')}]});}});_0x3e2d11['write'](_0x1b3cd7);_0x3e2d11['end']();}exports[_0x1cb9('0x25')]=openIssue;exports['send']=function(_0x4750b1,_0x2265ea){_0x4750b1['body']['ip']=_0x4750b1['headers'][_0x1cb9('0x26')]||_0x4750b1[_0x1cb9('0x27')][_0x1cb9('0x28')]||_0x4750b1[_0x1cb9('0x29')][_0x1cb9('0x28')]||_0x4750b1[_0x1cb9('0x27')]['socket']['remoteAddress'];return openIssue(_0x4750b1[_0x1cb9('0x2a')],_0x2265ea);}; \ No newline at end of file +var _0xcb91=['summary','\x20from\x20','description','issuetype','Bug','customfield_11500','customfield_11501','oldToken','fields','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','toString','base64','stringify','setEncoding','utf8','data','end','status','parse','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','x-forwarded-for','connection','remoteAddress','socket','body','../../config/logger','api','support','3eAmWpBVP0','MOTGUI'];(function(_0x49fffd,_0x534844){var _0x4c90ed=function(_0x3c997a){while(--_0x3c997a){_0x49fffd['push'](_0x49fffd['shift']());}};_0x4c90ed(++_0x534844);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x355ce8,_0x5f1d0a){_0x355ce8=_0x355ce8-0x0;var _0x1db8b8=_0xcb91[_0x355ce8];return _0x1db8b8;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var USERNAME=_0x1cb9('0x2');var PASSWORD=_0x1cb9('0x3');function openIssue(_0x4c37e8,_0x8c392f){var _0x2c17b8={'fields':{'project':{'key':_0x4c37e8['key']||_0x1cb9('0x4')},'summary':(_0x4c37e8[_0x1cb9('0x5')]||'Report')+_0x1cb9('0x6')+_0x4c37e8['ip'],'description':_0x4c37e8[_0x1cb9('0x7')]||JSON['stringify'](_0x4c37e8),'issuetype':{'name':_0x4c37e8[_0x1cb9('0x8')]||_0x1cb9('0x9')}}};_0x2c17b8['fields'][_0x1cb9('0xa')]=_0x4c37e8['email'];_0x2c17b8['fields'][_0x1cb9('0xb')]=_0x4c37e8[_0x1cb9('0xc')];_0x2c17b8[_0x1cb9('0xd')][_0x1cb9('0xe')]=_0x4c37e8[_0x1cb9('0xf')];_0x2c17b8['fields'][_0x1cb9('0x10')]=_0x4c37e8[_0x1cb9('0x11')];_0x2c17b8[_0x1cb9('0xd')][_0x1cb9('0x12')]=_0x4c37e8[_0x1cb9('0x13')];_0x2c17b8['fields']['customfield_10102']=_0x4c37e8['ip'];var _0x59dec3={'host':_0x1cb9('0x14'),'port':0x1bb,'path':_0x1cb9('0x15'),'method':_0x1cb9('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x1cb9('0x17'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x1cb9('0x18')](_0x1cb9('0x19'))}};var _0x1b3cd7=JSON[_0x1cb9('0x1a')](_0x2c17b8);var _0x3e2d11=https['request'](_0x59dec3,function(_0x5572cb){_0x5572cb[_0x1cb9('0x1b')](_0x1cb9('0x1c'));var _0x3904b7='';_0x5572cb['on'](_0x1cb9('0x1d'),function(_0x3e21e0){_0x3904b7+=_0x3e21e0;});_0x5572cb['on'](_0x1cb9('0x1e'),function(){if(_0x8c392f){return _0x8c392f[_0x1cb9('0x1f')](_0x5572cb['statusCode'])['json'](JSON[_0x1cb9('0x20')](_0x3904b7));}});});_0x3e2d11['on'](_0x1cb9('0x21'),function(_0x2b2669){if(_0x8c392f){return _0x8c392f[_0x1cb9('0x1f')](0x1f4)[_0x1cb9('0x22')]({'errors':[{'message':_0x1cb9('0x23'),'type':_0x1cb9('0x24')}]});}});_0x3e2d11['write'](_0x1b3cd7);_0x3e2d11['end']();}exports[_0x1cb9('0x25')]=openIssue;exports['send']=function(_0x4750b1,_0x2265ea){_0x4750b1['body']['ip']=_0x4750b1['headers'][_0x1cb9('0x26')]||_0x4750b1[_0x1cb9('0x27')][_0x1cb9('0x28')]||_0x4750b1[_0x1cb9('0x29')][_0x1cb9('0x28')]||_0x4750b1[_0x1cb9('0x27')]['socket']['remoteAddress'];return openIssue(_0x4750b1[_0x1cb9('0x2a')],_0x2265ea);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index e07a0ef..0c64d3c 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 _0xb937=['post','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','/describe','isAuthenticated','/:id','show'];(function(_0x3416d2,_0x474cbd){var _0x3b5f1e=function(_0xf72ec5){while(--_0xf72ec5){_0x3416d2['push'](_0x3416d2['shift']());}};_0x3b5f1e(++_0x474cbd);}(_0xb937,0x184));var _0x7b93=function(_0x3ae56d,_0x392e85){_0x3ae56d=_0x3ae56d-0x0;var _0x38f39f=_0xb937[_0x3ae56d];return _0x38f39f;};'use strict';var multer=require(_0x7b93('0x0'));var util=require(_0x7b93('0x1'));var path=require(_0x7b93('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7b93('0x3')]();var auth=require(_0x7b93('0x4'));var interaction=require(_0x7b93('0x5'));var config=require('../../config/environment');var controller=require(_0x7b93('0x6'));router[_0x7b93('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7b93('0x8'),auth[_0x7b93('0x9')](),controller['describe']);router[_0x7b93('0x7')](_0x7b93('0xa'),auth[_0x7b93('0x9')](),controller[_0x7b93('0xb')]);router[_0x7b93('0xc')]('/',auth[_0x7b93('0x9')](),controller['create']);router['put'](_0x7b93('0xa'),auth[_0x7b93('0x9')](),controller['update']);router[_0x7b93('0xd')]('/:id',auth[_0x7b93('0x9')](),controller[_0x7b93('0xe')]);module[_0x7b93('0xf')]=router; \ No newline at end of file +var _0x1039=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x522199,_0xf4aa84){var _0x37f909=function(_0x12d12f){while(--_0x12d12f){_0x522199['push'](_0x522199['shift']());}};_0x37f909(++_0xf4aa84);}(_0x1039,0x16c));var _0x9103=function(_0x98576f,_0x45afe8){_0x98576f=_0x98576f-0x0;var _0x44671b=_0x1039[_0x98576f];return _0x44671b;};'use strict';var multer=require(_0x9103('0x0'));var util=require(_0x9103('0x1'));var path=require(_0x9103('0x2'));var timeout=require(_0x9103('0x3'));var express=require(_0x9103('0x4'));var router=express[_0x9103('0x5')]();var auth=require(_0x9103('0x6'));var interaction=require(_0x9103('0x7'));var config=require(_0x9103('0x8'));var controller=require(_0x9103('0x9'));router[_0x9103('0xa')]('/',auth['isAuthenticated'](),controller[_0x9103('0xb')]);router['get'](_0x9103('0xc'),auth[_0x9103('0xd')](),controller[_0x9103('0xe')]);router[_0x9103('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x9103('0xf')]);router[_0x9103('0x10')]('/',auth['isAuthenticated'](),controller[_0x9103('0x11')]);router[_0x9103('0x12')](_0x9103('0x13'),auth[_0x9103('0xd')](),controller[_0x9103('0x14')]);router[_0x9103('0x15')]('/:id',auth[_0x9103('0xd')](),controller['destroy']);module[_0x9103('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 7a094e5..b466a02 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 _0x1a5c=['sequelize','exports','STRING','TEXT','long'];(function(_0x1259c1,_0x3b503b){var _0x3be2a9=function(_0x4603df){while(--_0x4603df){_0x1259c1['push'](_0x1259c1['shift']());}};_0x3be2a9(++_0x3b503b);}(_0x1a5c,0x12c));var _0xc1a5=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x1a5c[_0x1c8c28];return _0x1f59b4;};'use strict';var Sequelize=require(_0xc1a5('0x0'));module[_0xc1a5('0x1')]={'question':{'type':Sequelize[_0xc1a5('0x2')]},'answer':{'type':Sequelize[_0xc1a5('0x3')](_0xc1a5('0x4'))},'membername':{'type':Sequelize[_0xc1a5('0x2')]},'projectname':{'type':Sequelize[_0xc1a5('0x2')]},'queue':{'type':Sequelize[_0xc1a5('0x2')]},'uniqueid':{'type':Sequelize[_0xc1a5('0x2')]},'calleridname':{'type':Sequelize[_0xc1a5('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0xc1a5('0x2')]}}; \ No newline at end of file +var _0xb32d=['exports','STRING','TEXT','long','sequelize'];(function(_0xc5d96d,_0x382513){var _0x14869c=function(_0x39cdcd){while(--_0x39cdcd){_0xc5d96d['push'](_0xc5d96d['shift']());}};_0x14869c(++_0x382513);}(_0xb32d,0x1da));var _0xdb32=function(_0x200aa5,_0x197802){_0x200aa5=_0x200aa5-0x0;var _0x458200=_0xb32d[_0x200aa5];return _0x458200;};'use strict';var Sequelize=require(_0xdb32('0x0'));module[_0xdb32('0x1')]={'question':{'type':Sequelize[_0xdb32('0x2')]},'answer':{'type':Sequelize[_0xdb32('0x3')](_0xdb32('0x4'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xdb32('0x2')]},'uniqueid':{'type':Sequelize[_0xdb32('0x2')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xdb32('0x2')]},'questionId':{'type':Sequelize[_0xdb32('0x2')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 30d5f3a..a2b8053 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 _0x25bd=['send','index','rawAttributes','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','JscriptyAnswerReport','includeAll','include','rows','params','find','catch','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','stack','name'];(function(_0x10dfb0,_0x5e2011){var _0x59428d=function(_0x5e274f){while(--_0x5e274f){_0x10dfb0['push'](_0x10dfb0['shift']());}};_0x59428d(++_0x5e2011);}(_0x25bd,0x14e));var _0xd25b=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x25bd[_0x53ccf2];return _0x5a2964;};'use strict';var pdf=require(_0xd25b('0x0'));var emlformat=require(_0xd25b('0x1'));var rimraf=require(_0xd25b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd25b('0x3'));var rp=require(_0xd25b('0x4'));var moment=require(_0xd25b('0x5'));var BPromise=require(_0xd25b('0x6'));var Mustache=require(_0xd25b('0x7'));var util=require(_0xd25b('0x8'));var path=require(_0xd25b('0x9'));var sox=require(_0xd25b('0xa'));var csv=require(_0xd25b('0xb'));var ejs=require(_0xd25b('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd25b('0xd'));var crypto=require(_0xd25b('0xe'));var jsforce=require(_0xd25b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd25b('0xb'));var querystring=require('querystring');var Papa=require(_0xd25b('0x10'));var Redis=require(_0xd25b('0x11'));var authService=require(_0xd25b('0x12'));var qs=require(_0xd25b('0x13'));var hardwareService=require(_0xd25b('0x14'));var logger=require(_0xd25b('0x15'))(_0xd25b('0x16'));var utils=require(_0xd25b('0x17'));var config=require(_0xd25b('0x18'));var db=require(_0xd25b('0x19'))['db'];function respondWithStatusCode(_0x5df9e0,_0x5079cb){_0x5079cb=_0x5079cb||0xcc;return function(_0x33a96a){if(_0x33a96a){return _0x5df9e0[_0xd25b('0x1a')](_0x5079cb);}return _0x5df9e0['status'](_0x5079cb)[_0xd25b('0x1b')]();};}function respondWithResult(_0x5d9d66,_0xdd16aa){_0xdd16aa=_0xdd16aa||0xc8;return function(_0x3b1ce5){if(_0x3b1ce5){return _0x5d9d66[_0xd25b('0x1c')](_0xdd16aa)[_0xd25b('0x1d')](_0x3b1ce5);}};}function respondWithFilteredResult(_0x1ee993,_0x362c3c){return function(_0x191559){if(_0x191559){var _0x4f8002=_0x191559[_0xd25b('0x1e')],_0x13c1b5=_0x362c3c[_0xd25b('0x1f')],_0x1266b3=_0x362c3c[_0xd25b('0x1f')]+_0x362c3c['limit'],_0x5aa59b;if(_0x1266b3>=_0x4f8002){_0x1266b3=_0x4f8002;_0x5aa59b=0xc8;}else{_0x5aa59b=0xce;}_0x1ee993[_0xd25b('0x1c')](_0x5aa59b);return _0x1ee993['set'](_0xd25b('0x20'),_0x13c1b5+'-'+_0x1266b3+'/'+_0x4f8002)[_0xd25b('0x1d')](_0x191559);}return null;};}function patchUpdates(_0x54b99c){return function(_0x379eda){try{jsonpatch[_0xd25b('0x21')](_0x379eda,_0x54b99c,!![]);}catch(_0xa7f396){return BPromise[_0xd25b('0x22')](_0xa7f396);}return _0x379eda[_0xd25b('0x23')]();};}function saveUpdates(_0x90ee1e,_0x45e84b){return function(_0x469144){if(_0x469144){return _0x469144[_0xd25b('0x24')](_0x90ee1e)[_0xd25b('0x25')](function(_0x44c6d4){return _0x44c6d4;});}return null;};}function removeEntity(_0x46c8df,_0x2dab5c){return function(_0x5f3a58){if(_0x5f3a58){return _0x5f3a58[_0xd25b('0x26')]()[_0xd25b('0x25')](function(){_0x46c8df[_0xd25b('0x1c')](0xcc)[_0xd25b('0x1b')]();});}};}function handleEntityNotFound(_0x1c1343,_0x31e342){return function(_0x11e104){if(!_0x11e104){_0x1c1343[_0xd25b('0x1a')](0x194);}return _0x11e104;};}function handleError(_0x3a1a2,_0x57c628){_0x57c628=_0x57c628||0x1f4;return function(_0x4975fb){logger['error'](_0x4975fb[_0xd25b('0x27')]);if(_0x4975fb['name']){delete _0x4975fb[_0xd25b('0x28')];}_0x3a1a2[_0xd25b('0x1c')](_0x57c628)[_0xd25b('0x29')](_0x4975fb);};}exports[_0xd25b('0x2a')]=function(_0x538963,_0x2a148b){var _0x3816e0={},_0x7377dc={},_0x399986={'count':0x0,'rows':[]};var _0x52c426=db['JscriptyAnswerReport'][_0xd25b('0x2b')];_0x7377dc['model']=_['keys'](_0x52c426);_0x7377dc[_0xd25b('0x2c')]=_[_0xd25b('0x2d')](_0x538963[_0xd25b('0x2c')]);_0x7377dc['filters']=_[_0xd25b('0x2e')](_0x7377dc[_0xd25b('0x2f')],_0x7377dc[_0xd25b('0x2c')]);_0x3816e0['attributes']=_[_0xd25b('0x2e')](_0x7377dc['model'],qs[_0xd25b('0x30')](_0x538963[_0xd25b('0x2c')][_0xd25b('0x30')]));_0x3816e0[_0xd25b('0x31')]=_0x3816e0[_0xd25b('0x31')]['length']?_0x3816e0[_0xd25b('0x31')]:_0x7377dc[_0xd25b('0x2f')];if(!_0x538963[_0xd25b('0x2c')][_0xd25b('0x32')](_0xd25b('0x33'))){_0x3816e0['limit']=qs[_0xd25b('0x34')](_0x538963[_0xd25b('0x2c')][_0xd25b('0x34')]);_0x3816e0[_0xd25b('0x1f')]=qs[_0xd25b('0x1f')](_0x538963[_0xd25b('0x2c')]['offset']);}_0x3816e0['order']=qs[_0xd25b('0x35')](_0x538963[_0xd25b('0x2c')]['sort']);_0x3816e0[_0xd25b('0x36')]=qs[_0xd25b('0x37')](_[_0xd25b('0x38')](_0x538963[_0xd25b('0x2c')],_0x7377dc[_0xd25b('0x37')]));if(_0x538963[_0xd25b('0x2c')][_0xd25b('0x39')]){_0x3816e0[_0xd25b('0x36')]=_[_0xd25b('0x3a')](_0x3816e0['where'],{'$or':_[_0xd25b('0x3b')](_0x52c426,function(_0x136dda){if(_0x136dda[_0xd25b('0x3c')][_0xd25b('0x3d')]!==_0xd25b('0x3e')){var _0x4eb135={};_0x4eb135[_0x136dda[_0xd25b('0x3f')]]={'$like':'%'+_0x538963[_0xd25b('0x2c')][_0xd25b('0x39')]+'%'};return _0x4eb135;}})});}_0x3816e0=_[_0xd25b('0x3a')]({},_0x3816e0,_0x538963[_0xd25b('0x40')]);var _0x3734c2={'where':_0x3816e0['where']};return db[_0xd25b('0x41')][_0xd25b('0x1e')](_0x3734c2)[_0xd25b('0x25')](function(_0xbf0889){_0x399986['count']=_0xbf0889;if(_0x538963[_0xd25b('0x2c')][_0xd25b('0x42')]){_0x3816e0[_0xd25b('0x43')]=[{'all':!![]}];}return db[_0xd25b('0x41')]['findAll'](_0x3816e0);})[_0xd25b('0x25')](function(_0xb11725){_0x399986[_0xd25b('0x44')]=_0xb11725;return _0x399986;})[_0xd25b('0x25')](respondWithFilteredResult(_0x2a148b,_0x3816e0))['catch'](handleError(_0x2a148b,null));};exports['show']=function(_0x195db4,_0x42d62a){var _0x497d98={'raw':!![],'where':{'id':_0x195db4[_0xd25b('0x45')]['id']}},_0x4c29d9={};_0x4c29d9[_0xd25b('0x2f')]=_[_0xd25b('0x2d')](db[_0xd25b('0x41')][_0xd25b('0x2b')]);_0x4c29d9[_0xd25b('0x2c')]=_[_0xd25b('0x2d')](_0x195db4[_0xd25b('0x2c')]);_0x4c29d9[_0xd25b('0x37')]=_['intersection'](_0x4c29d9[_0xd25b('0x2f')],_0x4c29d9[_0xd25b('0x2c')]);_0x497d98[_0xd25b('0x31')]=_[_0xd25b('0x2e')](_0x4c29d9[_0xd25b('0x2f')],qs[_0xd25b('0x30')](_0x195db4[_0xd25b('0x2c')][_0xd25b('0x30')]));_0x497d98[_0xd25b('0x31')]=_0x497d98[_0xd25b('0x31')]['length']?_0x497d98['attributes']:_0x4c29d9['model'];if(_0x195db4[_0xd25b('0x2c')][_0xd25b('0x42')]){_0x497d98[_0xd25b('0x43')]=[{'all':!![]}];}_0x497d98=_['merge']({},_0x497d98,_0x195db4[_0xd25b('0x40')]);return db[_0xd25b('0x41')][_0xd25b('0x46')](_0x497d98)[_0xd25b('0x25')](handleEntityNotFound(_0x42d62a,null))[_0xd25b('0x25')](respondWithResult(_0x42d62a,null))[_0xd25b('0x47')](handleError(_0x42d62a,null));};exports[_0xd25b('0x48')]=function(_0x4d1e51,_0x3f80a0){return db[_0xd25b('0x41')][_0xd25b('0x48')](_0x4d1e51[_0xd25b('0x49')],{})[_0xd25b('0x25')](respondWithResult(_0x3f80a0,0xc9))[_0xd25b('0x47')](handleError(_0x3f80a0,null));};exports['update']=function(_0x52e089,_0x5d8a53){if(_0x52e089['body']['id']){delete _0x52e089[_0xd25b('0x49')]['id'];}return db[_0xd25b('0x41')][_0xd25b('0x46')]({'where':{'id':_0x52e089['params']['id']}})[_0xd25b('0x25')](handleEntityNotFound(_0x5d8a53,null))['then'](saveUpdates(_0x52e089[_0xd25b('0x49')],null))['then'](respondWithResult(_0x5d8a53,null))[_0xd25b('0x47')](handleError(_0x5d8a53,null));};exports['destroy']=function(_0x7f8fb3,_0x50b3c6){return db[_0xd25b('0x41')][_0xd25b('0x46')]({'where':{'id':_0x7f8fb3['params']['id']}})[_0xd25b('0x25')](handleEntityNotFound(_0x50b3c6,null))[_0xd25b('0x25')](removeEntity(_0x50b3c6,null))[_0xd25b('0x47')](handleError(_0x50b3c6,null));};exports[_0xd25b('0x4a')]=function(_0x2480a7,_0x568ccb){return db[_0xd25b('0x41')][_0xd25b('0x4a')]()[_0xd25b('0x25')](respondWithResult(_0x568ccb,null))['catch'](handleError(_0x568ccb,null));}; \ No newline at end of file +var _0x80c7=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../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','save','then','destroy','error','stack','name','send','JscriptyAnswerReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','pick','filter','merge','where','type','key','VIRTUAL','field','options','includeAll','findAll','catch','show','params','length','include','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','util'];(function(_0x3167bf,_0x1f2bca){var _0x400e91=function(_0x13a88c){while(--_0x13a88c){_0x3167bf['push'](_0x3167bf['shift']());}};_0x400e91(++_0x1f2bca);}(_0x80c7,0x8d));var _0x780c=function(_0x55dba7,_0x44bcf1){_0x55dba7=_0x55dba7-0x0;var _0x5136f1=_0x80c7[_0x55dba7];return _0x5136f1;};'use strict';var pdf=require(_0x780c('0x0'));var emlformat=require(_0x780c('0x1'));var rimraf=require(_0x780c('0x2'));var zipdir=require(_0x780c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x780c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x780c('0x5'));var util=require(_0x780c('0x6'));var path=require(_0x780c('0x7'));var sox=require(_0x780c('0x8'));var csv=require(_0x780c('0x9'));var ejs=require(_0x780c('0xa'));var fs=require('fs');var _=require(_0x780c('0xb'));var squel=require(_0x780c('0xc'));var crypto=require(_0x780c('0xd'));var jsforce=require(_0x780c('0xe'));var deskjs=require(_0x780c('0xf'));var toCsv=require('to-csv');var querystring=require(_0x780c('0x10'));var Papa=require(_0x780c('0x11'));var Redis=require('ioredis');var authService=require(_0x780c('0x12'));var qs=require(_0x780c('0x13'));var hardwareService=require(_0x780c('0x14'));var logger=require('../../config/logger')(_0x780c('0x15'));var utils=require(_0x780c('0x16'));var config=require(_0x780c('0x17'));var db=require(_0x780c('0x18'))['db'];function respondWithStatusCode(_0x97e1de,_0x3b6cf6){_0x3b6cf6=_0x3b6cf6||0xcc;return function(_0x2b09af){if(_0x2b09af){return _0x97e1de[_0x780c('0x19')](_0x3b6cf6);}return _0x97e1de[_0x780c('0x1a')](_0x3b6cf6)[_0x780c('0x1b')]();};}function respondWithResult(_0x422e33,_0x24dc45){_0x24dc45=_0x24dc45||0xc8;return function(_0x5576e9){if(_0x5576e9){return _0x422e33['status'](_0x24dc45)[_0x780c('0x1c')](_0x5576e9);}};}function respondWithFilteredResult(_0x394822,_0x4a98c0){return function(_0x5b74fb){if(_0x5b74fb){var _0x2c8c23=_0x5b74fb[_0x780c('0x1d')],_0xccd8c=_0x4a98c0[_0x780c('0x1e')],_0x21b69b=_0x4a98c0['offset']+_0x4a98c0[_0x780c('0x1f')],_0x2f99d8;if(_0x21b69b>=_0x2c8c23){_0x21b69b=_0x2c8c23;_0x2f99d8=0xc8;}else{_0x2f99d8=0xce;}_0x394822[_0x780c('0x1a')](_0x2f99d8);return _0x394822[_0x780c('0x20')](_0x780c('0x21'),_0xccd8c+'-'+_0x21b69b+'/'+_0x2c8c23)['json'](_0x5b74fb);}return null;};}function patchUpdates(_0xcd171e){return function(_0x2449b7){try{jsonpatch[_0x780c('0x22')](_0x2449b7,_0xcd171e,!![]);}catch(_0x3d5269){return BPromise['reject'](_0x3d5269);}return _0x2449b7[_0x780c('0x23')]();};}function saveUpdates(_0x6ab4c9,_0x48ccb9){return function(_0x4f665d){if(_0x4f665d){return _0x4f665d['update'](_0x6ab4c9)[_0x780c('0x24')](function(_0xe4e284){return _0xe4e284;});}return null;};}function removeEntity(_0x105c5f,_0x2935d4){return function(_0x444905){if(_0x444905){return _0x444905[_0x780c('0x25')]()[_0x780c('0x24')](function(){_0x105c5f[_0x780c('0x1a')](0xcc)[_0x780c('0x1b')]();});}};}function handleEntityNotFound(_0x21b68a,_0x1d0c8a){return function(_0x55fc81){if(!_0x55fc81){_0x21b68a[_0x780c('0x19')](0x194);}return _0x55fc81;};}function handleError(_0x252127,_0x1c6686){_0x1c6686=_0x1c6686||0x1f4;return function(_0x54d835){logger[_0x780c('0x26')](_0x54d835[_0x780c('0x27')]);if(_0x54d835[_0x780c('0x28')]){delete _0x54d835[_0x780c('0x28')];}_0x252127[_0x780c('0x1a')](_0x1c6686)[_0x780c('0x29')](_0x54d835);};}exports['index']=function(_0x1cb65e,_0x481ecf){var _0x207dc8={},_0x56ca81={},_0x2d9702={'count':0x0,'rows':[]};var _0xcfc565=db[_0x780c('0x2a')][_0x780c('0x2b')];_0x56ca81[_0x780c('0x2c')]=_[_0x780c('0x2d')](_0xcfc565);_0x56ca81[_0x780c('0x2e')]=_[_0x780c('0x2d')](_0x1cb65e[_0x780c('0x2e')]);_0x56ca81[_0x780c('0x2f')]=_[_0x780c('0x30')](_0x56ca81[_0x780c('0x2c')],_0x56ca81[_0x780c('0x2e')]);_0x207dc8[_0x780c('0x31')]=_['intersection'](_0x56ca81[_0x780c('0x2c')],qs[_0x780c('0x32')](_0x1cb65e[_0x780c('0x2e')][_0x780c('0x32')]));_0x207dc8[_0x780c('0x31')]=_0x207dc8[_0x780c('0x31')]['length']?_0x207dc8[_0x780c('0x31')]:_0x56ca81[_0x780c('0x2c')];if(!_0x1cb65e[_0x780c('0x2e')][_0x780c('0x33')]('nolimit')){_0x207dc8['limit']=qs[_0x780c('0x1f')](_0x1cb65e[_0x780c('0x2e')]['limit']);_0x207dc8['offset']=qs['offset'](_0x1cb65e[_0x780c('0x2e')][_0x780c('0x1e')]);}_0x207dc8[_0x780c('0x34')]=qs['sort'](_0x1cb65e[_0x780c('0x2e')]['sort']);_0x207dc8['where']=qs[_0x780c('0x2f')](_[_0x780c('0x35')](_0x1cb65e[_0x780c('0x2e')],_0x56ca81[_0x780c('0x2f')]));if(_0x1cb65e[_0x780c('0x2e')][_0x780c('0x36')]){_0x207dc8['where']=_[_0x780c('0x37')](_0x207dc8[_0x780c('0x38')],{'$or':_['map'](_0xcfc565,function(_0x5c3f8e){if(_0x5c3f8e[_0x780c('0x39')][_0x780c('0x3a')]!==_0x780c('0x3b')){var _0x201dd8={};_0x201dd8[_0x5c3f8e[_0x780c('0x3c')]]={'$like':'%'+_0x1cb65e[_0x780c('0x2e')][_0x780c('0x36')]+'%'};return _0x201dd8;}})});}_0x207dc8=_[_0x780c('0x37')]({},_0x207dc8,_0x1cb65e[_0x780c('0x3d')]);var _0x2ea276={'where':_0x207dc8['where']};return db[_0x780c('0x2a')][_0x780c('0x1d')](_0x2ea276)['then'](function(_0x871e0a){_0x2d9702[_0x780c('0x1d')]=_0x871e0a;if(_0x1cb65e['query'][_0x780c('0x3e')]){_0x207dc8['include']=[{'all':!![]}];}return db[_0x780c('0x2a')][_0x780c('0x3f')](_0x207dc8);})[_0x780c('0x24')](function(_0x5b2dfb){_0x2d9702['rows']=_0x5b2dfb;return _0x2d9702;})[_0x780c('0x24')](respondWithFilteredResult(_0x481ecf,_0x207dc8))[_0x780c('0x40')](handleError(_0x481ecf,null));};exports[_0x780c('0x41')]=function(_0x71748b,_0x461d4a){var _0x476283={'raw':!![],'where':{'id':_0x71748b[_0x780c('0x42')]['id']}},_0x35631a={};_0x35631a['model']=_[_0x780c('0x2d')](db[_0x780c('0x2a')]['rawAttributes']);_0x35631a[_0x780c('0x2e')]=_[_0x780c('0x2d')](_0x71748b[_0x780c('0x2e')]);_0x35631a['filters']=_[_0x780c('0x30')](_0x35631a[_0x780c('0x2c')],_0x35631a[_0x780c('0x2e')]);_0x476283['attributes']=_['intersection'](_0x35631a[_0x780c('0x2c')],qs[_0x780c('0x32')](_0x71748b[_0x780c('0x2e')][_0x780c('0x32')]));_0x476283[_0x780c('0x31')]=_0x476283[_0x780c('0x31')][_0x780c('0x43')]?_0x476283['attributes']:_0x35631a['model'];if(_0x71748b[_0x780c('0x2e')][_0x780c('0x3e')]){_0x476283[_0x780c('0x44')]=[{'all':!![]}];}_0x476283=_[_0x780c('0x37')]({},_0x476283,_0x71748b[_0x780c('0x3d')]);return db[_0x780c('0x2a')][_0x780c('0x45')](_0x476283)[_0x780c('0x24')](handleEntityNotFound(_0x461d4a,null))['then'](respondWithResult(_0x461d4a,null))[_0x780c('0x40')](handleError(_0x461d4a,null));};exports[_0x780c('0x46')]=function(_0x21f150,_0x57fca1){return db['JscriptyAnswerReport'][_0x780c('0x46')](_0x21f150[_0x780c('0x47')],{})[_0x780c('0x24')](respondWithResult(_0x57fca1,0xc9))[_0x780c('0x40')](handleError(_0x57fca1,null));};exports[_0x780c('0x48')]=function(_0x4979b8,_0x1ebb9a){if(_0x4979b8[_0x780c('0x47')]['id']){delete _0x4979b8['body']['id'];}return db['JscriptyAnswerReport'][_0x780c('0x45')]({'where':{'id':_0x4979b8['params']['id']}})['then'](handleEntityNotFound(_0x1ebb9a,null))['then'](saveUpdates(_0x4979b8[_0x780c('0x47')],null))['then'](respondWithResult(_0x1ebb9a,null))[_0x780c('0x40')](handleError(_0x1ebb9a,null));};exports['destroy']=function(_0x2deec6,_0x4eda4f){return db[_0x780c('0x2a')][_0x780c('0x45')]({'where':{'id':_0x2deec6[_0x780c('0x42')]['id']}})[_0x780c('0x24')](handleEntityNotFound(_0x4eda4f,null))[_0x780c('0x24')](removeEntity(_0x4eda4f,null))[_0x780c('0x40')](handleError(_0x4eda4f,null));};exports[_0x780c('0x49')]=function(_0x1624c1,_0x59c269){return db[_0x780c('0x2a')][_0x780c('0x49')]()[_0x780c('0x24')](respondWithResult(_0x59c269,null))['catch'](handleError(_0x59c269,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 800d077..bed25fa 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 _0x9e22=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','define','report_jscripty_answers','util','../../config/logger'];(function(_0xc1d14c,_0x414ced){var _0x5855a2=function(_0xcd89c7){while(--_0xcd89c7){_0xc1d14c['push'](_0xc1d14c['shift']());}};_0x5855a2(++_0x414ced);}(_0x9e22,0x98));var _0x29e2=function(_0xd511d,_0x3546b9){_0xd511d=_0xd511d-0x0;var _0x3f148e=_0x9e22[_0xd511d];return _0x3f148e;};'use strict';var _=require('lodash');var util=require(_0x29e2('0x0'));var logger=require(_0x29e2('0x1'))('api');var moment=require(_0x29e2('0x2'));var BPromise=require(_0x29e2('0x3'));var rp=require(_0x29e2('0x4'));var fs=require('fs');var path=require(_0x29e2('0x5'));var rimraf=require(_0x29e2('0x6'));var config=require(_0x29e2('0x7'));var attributes=require(_0x29e2('0x8'));module['exports']=function(_0x59dbc4,_0x2b1355){return _0x59dbc4[_0x29e2('0x9')]('JscriptyAnswerReport',attributes,{'tableName':_0x29e2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3919=['path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','report_jscripty_answers','../../config/logger','api','moment','request-promise'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x3919,0x1b4));var _0x9391=function(_0x5f25fa,_0x19c57f){_0x5f25fa=_0x5f25fa-0x0;var _0x352811=_0x3919[_0x5f25fa];return _0x352811;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9391('0x0'))(_0x9391('0x1'));var moment=require(_0x9391('0x2'));var BPromise=require('bluebird');var rp=require(_0x9391('0x3'));var fs=require('fs');var path=require(_0x9391('0x4'));var rimraf=require(_0x9391('0x5'));var config=require(_0x9391('0x6'));var attributes=require(_0x9391('0x7'));module['exports']=function(_0x4666f9,_0x5cefa9){return _0x4666f9[_0x9391('0x8')](_0x9391('0x9'),attributes,{'tableName':_0x9391('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 a0f731d..eb52f8e 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 _0x713c=['request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x58ae8a,_0x3c619e){var _0x2f0b6b=function(_0x6db940){while(--_0x6db940){_0x58ae8a['push'](_0x58ae8a['shift']());}};_0x2f0b6b(++_0x3c619e);}(_0x713c,0x1e1));var _0xc713=function(_0x1268aa,_0x3b319f){_0x1268aa=_0x1268aa-0x0;var _0x19b589=_0x713c[_0x1268aa];return _0x19b589;};'use strict';var _=require(_0xc713('0x0'));var util=require(_0xc713('0x1'));var moment=require(_0xc713('0x2'));var BPromise=require(_0xc713('0x3'));var rs=require(_0xc713('0x4'));var fs=require('fs');var Redis=require(_0xc713('0x5'));var db=require(_0xc713('0x6'))['db'];var utils=require(_0xc713('0x7'));var logger=require(_0xc713('0x8'))(_0xc713('0x9'));var config=require('../../config/environment');var jayson=require(_0xc713('0xa'));var client=jayson[_0xc713('0xb')][_0xc713('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5da6c4,_0x1c289e,_0x16d8ea){return new BPromise(function(_0x2655a1,_0x36fe59){return client[_0xc713('0xd')](_0x5da6c4,_0x16d8ea)[_0xc713('0xe')](function(_0x5fadfe){logger['info'](_0xc713('0xf'),_0x1c289e,_0xc713('0x10'));logger[_0xc713('0x11')](_0xc713('0x12'),_0x1c289e,_0xc713('0x10'),JSON[_0xc713('0x13')](_0x5fadfe));if(_0x5fadfe[_0xc713('0x14')]){if(_0x5fadfe['error'][_0xc713('0x15')]===0x1f4){logger[_0xc713('0x14')](_0xc713('0xf'),_0x1c289e,_0x5fadfe[_0xc713('0x14')]['message']);return _0x36fe59(_0x5fadfe['error'][_0xc713('0x16')]);}logger[_0xc713('0x14')](_0xc713('0xf'),_0x1c289e,_0x5fadfe[_0xc713('0x14')]['message']);return _0x2655a1(_0x5fadfe[_0xc713('0x14')][_0xc713('0x16')]);}else{logger[_0xc713('0x17')](_0xc713('0xf'),_0x1c289e,_0xc713('0x10'));_0x2655a1(_0x5fadfe[_0xc713('0x18')]['message']);}})[_0xc713('0x19')](function(_0x546b64){logger[_0xc713('0x14')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1c289e,_0x546b64);_0x36fe59(_0x546b64);});});} \ No newline at end of file +var _0x7cd0=['randomstring','ioredis','../../config/utils','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','request\x20sent','error','message','result','lodash','moment'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x7cd0,0xb9));var _0x07cd=function(_0x3a205f,_0x3dbfb3){_0x3a205f=_0x3a205f-0x0;var _0x1eb189=_0x7cd0[_0x3a205f];return _0x1eb189;};'use strict';var _=require(_0x07cd('0x0'));var util=require('util');var moment=require(_0x07cd('0x1'));var BPromise=require('bluebird');var rs=require(_0x07cd('0x2'));var fs=require('fs');var Redis=require(_0x07cd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x07cd('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x07cd('0x5'));var client=jayson[_0x07cd('0x6')][_0x07cd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5768ee,_0x324451,_0x2b413d){return new BPromise(function(_0x53bee1,_0x3dd389){return client[_0x07cd('0x8')](_0x5768ee,_0x2b413d)[_0x07cd('0x9')](function(_0x413528){logger[_0x07cd('0xa')](_0x07cd('0xb'),_0x324451,'request\x20sent');logger[_0x07cd('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x324451,_0x07cd('0xd'),JSON['stringify'](_0x413528));if(_0x413528[_0x07cd('0xe')]){if(_0x413528['error']['code']===0x1f4){logger[_0x07cd('0xe')](_0x07cd('0xb'),_0x324451,_0x413528[_0x07cd('0xe')]['message']);return _0x3dd389(_0x413528[_0x07cd('0xe')][_0x07cd('0xf')]);}logger[_0x07cd('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x324451,_0x413528[_0x07cd('0xe')]['message']);return _0x53bee1(_0x413528[_0x07cd('0xe')][_0x07cd('0xf')]);}else{logger[_0x07cd('0xa')](_0x07cd('0xb'),_0x324451,_0x07cd('0xd'));_0x53bee1(_0x413528[_0x07cd('0x10')][_0x07cd('0xf')]);}})['catch'](function(_0x103ec4){logger['error'](_0x07cd('0xb'),_0x324451,_0x103ec4);_0x3dd389(_0x103ec4);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index ea9015a..85304b5 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 _0x0f03=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sessions','/:id/answers','getAnswers','/:id/summary','getSummary','post','clone','put','update','destroy','multer'];(function(_0x13ae91,_0x42ec71){var _0x5084c1=function(_0x492fd4){while(--_0x492fd4){_0x13ae91['push'](_0x13ae91['shift']());}};_0x5084c1(++_0x42ec71);}(_0x0f03,0x113));var _0x30f0=function(_0x341da0,_0x2e19bf){_0x341da0=_0x341da0-0x0;var _0x41fa60=_0x0f03[_0x341da0];return _0x41fa60;};'use strict';var multer=require(_0x30f0('0x0'));var util=require('util');var path=require(_0x30f0('0x1'));var timeout=require(_0x30f0('0x2'));var express=require(_0x30f0('0x3'));var router=express[_0x30f0('0x4')]();var auth=require(_0x30f0('0x5'));var interaction=require(_0x30f0('0x6'));var config=require(_0x30f0('0x7'));var controller=require('./jscriptyProject.controller');router[_0x30f0('0x8')]('/',auth[_0x30f0('0x9')](),controller[_0x30f0('0xa')]);router['get'](_0x30f0('0xb'),auth[_0x30f0('0x9')](),controller[_0x30f0('0xc')]);router[_0x30f0('0x8')](_0x30f0('0xd'),auth[_0x30f0('0x9')](),controller['getSessions']);router['get'](_0x30f0('0xe'),auth['isAuthenticated'](),controller[_0x30f0('0xf')]);router[_0x30f0('0x8')](_0x30f0('0x10'),auth[_0x30f0('0x9')](),timeout('30s'),controller[_0x30f0('0x11')]);router['post']('/',auth[_0x30f0('0x9')](),controller['create']);router[_0x30f0('0x12')]('/:id/clone',auth[_0x30f0('0x9')](),controller[_0x30f0('0x13')]);router[_0x30f0('0x14')](_0x30f0('0xb'),auth[_0x30f0('0x9')](),controller[_0x30f0('0x15')]);router['delete'](_0x30f0('0xb'),auth[_0x30f0('0x9')](),controller[_0x30f0('0x16')]);module['exports']=router; \ No newline at end of file +var _0x8ac5=['./jscriptyProject.controller','isAuthenticated','index','get','/:id','show','/:id/sessions','getSessions','/:id/answers','/:id/summary','getSummary','post','create','clone','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8ac5,0x105));var _0x58ac=function(_0x240aaf,_0x2b8d86){_0x240aaf=_0x240aaf-0x0;var _0x280f83=_0x8ac5[_0x240aaf];return _0x280f83;};'use strict';var multer=require(_0x58ac('0x0'));var util=require(_0x58ac('0x1'));var path=require(_0x58ac('0x2'));var timeout=require(_0x58ac('0x3'));var express=require(_0x58ac('0x4'));var router=express[_0x58ac('0x5')]();var auth=require(_0x58ac('0x6'));var interaction=require(_0x58ac('0x7'));var config=require(_0x58ac('0x8'));var controller=require(_0x58ac('0x9'));router['get']('/',auth[_0x58ac('0xa')](),controller[_0x58ac('0xb')]);router[_0x58ac('0xc')](_0x58ac('0xd'),auth[_0x58ac('0xa')](),controller[_0x58ac('0xe')]);router[_0x58ac('0xc')](_0x58ac('0xf'),auth[_0x58ac('0xa')](),controller[_0x58ac('0x10')]);router[_0x58ac('0xc')](_0x58ac('0x11'),auth[_0x58ac('0xa')](),controller['getAnswers']);router[_0x58ac('0xc')](_0x58ac('0x12'),auth['isAuthenticated'](),timeout('30s'),controller[_0x58ac('0x13')]);router[_0x58ac('0x14')]('/',auth[_0x58ac('0xa')](),controller[_0x58ac('0x15')]);router[_0x58ac('0x14')]('/:id/clone',auth[_0x58ac('0xa')](),controller[_0x58ac('0x16')]);router[_0x58ac('0x17')](_0x58ac('0xd'),auth[_0x58ac('0xa')](),controller[_0x58ac('0x18')]);router['delete'](_0x58ac('0xd'),auth[_0x58ac('0xa')](),controller[_0x58ac('0x19')]);module[_0x58ac('0x1a')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 4d43df9..fb5e927 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 _0xa865=['exports','name','STRING','TEXT','long','setDataValue','formData','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','lodash','util'];(function(_0x260e4c,_0x522453){var _0x4a02ce=function(_0x82d9f1){while(--_0x82d9f1){_0x260e4c['push'](_0x260e4c['shift']());}};_0x4a02ce(++_0x522453);}(_0xa865,0xd0));var _0x5a86=function(_0x46019b,_0x3b4ca3){_0x46019b=_0x46019b-0x0;var _0x53b79a=_0xa865[_0x46019b];return _0x53b79a;};'use strict';var Sequelize=require('sequelize');var _=require(_0x5a86('0x0'));var util=require(_0x5a86('0x1'));module[_0x5a86('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x5a86('0x3')},'description':{'type':Sequelize[_0x5a86('0x4')]},'formData':{'type':Sequelize[_0x5a86('0x5')](_0x5a86('0x6')),'set':function(_0x2ca108){if(_['isObjectLike'](_0x2ca108)){this[_0x5a86('0x7')](_0x5a86('0x8'),JSON['stringify'](_0x2ca108));}else if(_[_0x5a86('0x9')](_0x2ca108)){this['setDataValue']('formData',_0x2ca108);}else{this[_0x5a86('0x7')]('formData',util['format'](_0x5a86('0xa'),this[_0x5a86('0xb')]('name')||'',this[_0x5a86('0xb')](_0x5a86('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x5a86('0xd')],'defaultValue':!![]}}; \ No newline at end of file +var _0x06cb=['sequelize','lodash','util','exports','STRING','TEXT','long','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN'];(function(_0x44ca6e,_0x5e2c91){var _0x2edab2=function(_0x3afa91){while(--_0x3afa91){_0x44ca6e['push'](_0x44ca6e['shift']());}};_0x2edab2(++_0x5e2c91);}(_0x06cb,0xbb));var _0xb06c=function(_0x315384,_0x3b190b){_0x315384=_0x315384-0x0;var _0xe4c681=_0x06cb[_0x315384];return _0xe4c681;};'use strict';var Sequelize=require(_0xb06c('0x0'));var _=require(_0xb06c('0x1'));var util=require(_0xb06c('0x2'));module[_0xb06c('0x3')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xb06c('0x4')]},'formData':{'type':Sequelize[_0xb06c('0x5')](_0xb06c('0x6')),'set':function(_0x496c6c){if(_['isObjectLike'](_0x496c6c)){this[_0xb06c('0x7')](_0xb06c('0x8'),JSON[_0xb06c('0x9')](_0x496c6c));}else if(_[_0xb06c('0xa')](_0x496c6c)){this[_0xb06c('0x7')](_0xb06c('0x8'),_0x496c6c);}else{this['setDataValue']('formData',util[_0xb06c('0xb')](_0xb06c('0xc'),this[_0xb06c('0xd')](_0xb06c('0xe'))||'',this[_0xb06c('0xd')](_0xb06c('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xb06c('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 f046f70..93356d2 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 _0xda33=['now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','get','destroy','error','stack','index','JscriptyProject','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','updatedAt','omit','createdAt','userProfileId','findOne','JscriptySessionReport','hasOwnProperty','order','ProjectId','rows','getAnswers','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','getSummary','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','push','isEmpty'];(function(_0xaff155,_0x13be68){var _0x2e6dbe=function(_0x201303){while(--_0x201303){_0xaff155['push'](_0xaff155['shift']());}};_0x2e6dbe(++_0x13be68);}(_0xda33,0x1d4));var _0x3da3=function(_0x143467,_0x374606){_0x143467=_0x143467-0x0;var _0x190957=_0xda33[_0x143467];return _0x190957;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3da3('0x0'));var rimraf=require(_0x3da3('0x1'));var zipdir=require(_0x3da3('0x2'));var jsonpatch=require(_0x3da3('0x3'));var rp=require(_0x3da3('0x4'));var moment=require(_0x3da3('0x5'));var BPromise=require(_0x3da3('0x6'));var Mustache=require(_0x3da3('0x7'));var util=require(_0x3da3('0x8'));var path=require('path');var sox=require(_0x3da3('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x3da3('0xa'));var squel=require(_0x3da3('0xb'));var crypto=require(_0x3da3('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3da3('0xd'));var querystring=require(_0x3da3('0xe'));var Papa=require('papaparse');var Redis=require(_0x3da3('0xf'));var authService=require(_0x3da3('0x10'));var qs=require(_0x3da3('0x11'));var hardwareService=require(_0x3da3('0x12'));var logger=require(_0x3da3('0x13'))(_0x3da3('0x14'));var utils=require(_0x3da3('0x15'));var config=require(_0x3da3('0x16'));var db=require(_0x3da3('0x17'))['db'];function respondWithStatusCode(_0x1fb003,_0x1db7b6){_0x1db7b6=_0x1db7b6||0xcc;return function(_0x4429f7){if(_0x4429f7){return _0x1fb003[_0x3da3('0x18')](_0x1db7b6);}return _0x1fb003[_0x3da3('0x19')](_0x1db7b6)['end']();};}function respondWithResult(_0x27685c,_0x506f2c){_0x506f2c=_0x506f2c||0xc8;return function(_0x29b44){if(_0x29b44){return _0x27685c[_0x3da3('0x19')](_0x506f2c)[_0x3da3('0x1a')](_0x29b44);}};}function respondWithFilteredResult(_0x46dda7,_0x58a7e9){return function(_0x3d635b){if(_0x3d635b){var _0x1bcc0b=_0x3d635b[_0x3da3('0x1b')],_0x1dd21a=_0x58a7e9[_0x3da3('0x1c')],_0x5254af=_0x58a7e9[_0x3da3('0x1c')]+_0x58a7e9[_0x3da3('0x1d')],_0x1beb05;if(_0x5254af>=_0x1bcc0b){_0x5254af=_0x1bcc0b;_0x1beb05=0xc8;}else{_0x1beb05=0xce;}_0x46dda7['status'](_0x1beb05);return _0x46dda7[_0x3da3('0x1e')](_0x3da3('0x1f'),_0x1dd21a+'-'+_0x5254af+'/'+_0x1bcc0b)['json'](_0x3d635b);}return null;};}function patchUpdates(_0x1a9c11){return function(_0x3ef484){try{jsonpatch['apply'](_0x3ef484,_0x1a9c11,!![]);}catch(_0x2083f5){return BPromise[_0x3da3('0x20')](_0x2083f5);}return _0x3ef484[_0x3da3('0x21')]();};}function saveUpdates(_0x40771b,_0xfed898){return function(_0x50466e){if(_0x50466e){return _0x50466e[_0x3da3('0x22')](_0x40771b)[_0x3da3('0x23')](function(_0x2ff6c8){return _0x2ff6c8;});}return null;};}function removeEntity(_0x216ed6,_0x537557){return function(_0x3f763a){if(_0x3f763a){return _0x3f763a['destroy']()[_0x3da3('0x23')](function(){var _0x1123d2=_0x3f763a[_0x3da3('0x24')]({'plain':!![]});var _0x25bada='Projects';return db['UserProfileResource'][_0x3da3('0x25')]({'where':{'type':_0x25bada,'resourceId':_0x1123d2['id']}})[_0x3da3('0x23')](function(){return _0x3f763a;});})[_0x3da3('0x23')](function(){_0x216ed6[_0x3da3('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x352f68,_0x2b910b){return function(_0x2e0a4c){if(!_0x2e0a4c){_0x352f68[_0x3da3('0x18')](0x194);}return _0x2e0a4c;};}function handleError(_0x4f38b6,_0x3cefb5){_0x3cefb5=_0x3cefb5||0x1f4;return function(_0x30b5f2){logger[_0x3da3('0x26')](_0x30b5f2[_0x3da3('0x27')]);if(_0x30b5f2['name']){delete _0x30b5f2['name'];}_0x4f38b6[_0x3da3('0x19')](_0x3cefb5)['send'](_0x30b5f2);};}exports[_0x3da3('0x28')]=function(_0x4e4257,_0x359057){var _0x1e0b03={},_0x18c15e={},_0x26bc0c={'count':0x0,'rows':[]};var _0x614070=db[_0x3da3('0x29')][_0x3da3('0x2a')];_0x18c15e['model']=_[_0x3da3('0x2b')](_0x614070);_0x18c15e[_0x3da3('0x2c')]=_[_0x3da3('0x2b')](_0x4e4257['query']);_0x18c15e[_0x3da3('0x2d')]=_['intersection'](_0x18c15e[_0x3da3('0x2e')],_0x18c15e['query']);_0x1e0b03[_0x3da3('0x2f')]=_[_0x3da3('0x30')](_0x18c15e[_0x3da3('0x2e')],qs[_0x3da3('0x31')](_0x4e4257['query'][_0x3da3('0x31')]));_0x1e0b03[_0x3da3('0x2f')]=_0x1e0b03[_0x3da3('0x2f')][_0x3da3('0x32')]?_0x1e0b03[_0x3da3('0x2f')]:_0x18c15e['model'];if(!_0x4e4257[_0x3da3('0x2c')]['hasOwnProperty'](_0x3da3('0x33'))){_0x1e0b03[_0x3da3('0x1d')]=qs[_0x3da3('0x1d')](_0x4e4257[_0x3da3('0x2c')][_0x3da3('0x1d')]);_0x1e0b03[_0x3da3('0x1c')]=qs[_0x3da3('0x1c')](_0x4e4257['query']['offset']);}_0x1e0b03['order']=qs[_0x3da3('0x34')](_0x4e4257[_0x3da3('0x2c')][_0x3da3('0x34')]);_0x1e0b03[_0x3da3('0x35')]=qs['filters'](_[_0x3da3('0x36')](_0x4e4257[_0x3da3('0x2c')],_0x18c15e[_0x3da3('0x2d')]));if(_0x4e4257[_0x3da3('0x2c')][_0x3da3('0x37')]){_0x1e0b03[_0x3da3('0x35')]=_[_0x3da3('0x38')](_0x1e0b03[_0x3da3('0x35')],{'$or':_[_0x3da3('0x39')](_0x614070,function(_0x28f9fb){if(_0x28f9fb[_0x3da3('0x3a')][_0x3da3('0x3b')]!==_0x3da3('0x3c')){var _0x1fba1b={};_0x1fba1b[_0x28f9fb[_0x3da3('0x3d')]]={'$like':'%'+_0x4e4257[_0x3da3('0x2c')][_0x3da3('0x37')]+'%'};return _0x1fba1b;}})});}_0x1e0b03=_['merge']({},_0x1e0b03,_0x4e4257[_0x3da3('0x3e')]);var _0x21250d={'where':_0x1e0b03['where']};return db[_0x3da3('0x29')]['count'](_0x21250d)[_0x3da3('0x23')](function(_0x59c005){_0x26bc0c[_0x3da3('0x1b')]=_0x59c005;if(_0x4e4257['query']['includeAll']){_0x1e0b03[_0x3da3('0x3f')]=[{'all':!![]}];}return db[_0x3da3('0x29')][_0x3da3('0x40')](_0x1e0b03);})['then'](function(_0x4c0938){_0x26bc0c['rows']=_0x4c0938;return _0x26bc0c;})['then'](respondWithFilteredResult(_0x359057,_0x1e0b03))[_0x3da3('0x41')](handleError(_0x359057,null));};exports[_0x3da3('0x42')]=function(_0x6ff987,_0x18bd96){var _0x5b0933={'raw':![],'where':{'id':_0x6ff987[_0x3da3('0x43')]['id']}},_0x265402={};_0x265402[_0x3da3('0x2e')]=_[_0x3da3('0x2b')](db[_0x3da3('0x29')]['rawAttributes']);_0x265402[_0x3da3('0x2c')]=_[_0x3da3('0x2b')](_0x6ff987[_0x3da3('0x2c')]);_0x265402[_0x3da3('0x2d')]=_[_0x3da3('0x30')](_0x265402[_0x3da3('0x2e')],_0x265402[_0x3da3('0x2c')]);_0x5b0933['attributes']=_[_0x3da3('0x30')](_0x265402[_0x3da3('0x2e')],qs[_0x3da3('0x31')](_0x6ff987['query']['fields']));_0x5b0933['attributes']=_0x5b0933[_0x3da3('0x2f')]['length']?_0x5b0933[_0x3da3('0x2f')]:_0x265402[_0x3da3('0x2e')];if(_0x6ff987['query']['includeAll']){_0x5b0933['include']=[{'all':!![]}];}_0x5b0933=_[_0x3da3('0x38')]({},_0x5b0933,_0x6ff987[_0x3da3('0x3e')]);return db[_0x3da3('0x29')]['find'](_0x5b0933)[_0x3da3('0x23')](handleEntityNotFound(_0x18bd96,null))[_0x3da3('0x23')](respondWithResult(_0x18bd96,null))[_0x3da3('0x41')](handleError(_0x18bd96,null));};exports['create']=function(_0x1fb45d,_0x4d4287){return db['JscriptyProject'][_0x3da3('0x44')](_0x1fb45d[_0x3da3('0x45')],{})[_0x3da3('0x23')](function(_0x3ad2a3){var _0x2193c4=_0x1fb45d[_0x3da3('0x46')][_0x3da3('0x24')]({'plain':!![]});if(!_0x2193c4)throw new Error(_0x3da3('0x47'));if(_0x2193c4[_0x3da3('0x48')]===_0x3da3('0x46')){var _0x571099=_0x3ad2a3[_0x3da3('0x24')]({'plain':!![]});var _0x189baf='Projects';return db[_0x3da3('0x49')][_0x3da3('0x4a')]({'where':{'name':_0x189baf,'userProfileId':_0x2193c4['userProfileId']},'raw':!![]})['then'](function(_0x429637){if(_0x429637&&_0x429637[_0x3da3('0x4b')]===0x0){return db[_0x3da3('0x4c')][_0x3da3('0x44')]({'name':_0x571099[_0x3da3('0x4d')],'resourceId':_0x571099['id'],'type':_0x429637['name'],'sectionId':_0x429637['id']},{})['then'](function(){return _0x3ad2a3;});}else{return _0x3ad2a3;}})[_0x3da3('0x41')](function(_0x5a68d5){logger[_0x3da3('0x26')](_0x3da3('0x4e'),_0x5a68d5);throw _0x5a68d5;});}return _0x3ad2a3;})[_0x3da3('0x23')](respondWithResult(_0x4d4287,0xc9))[_0x3da3('0x41')](handleError(_0x4d4287,null));};exports['clone']=function(_0x25dcd3,_0x482e09){var _0x3aadb2={'raw':![],'where':{'id':_0x25dcd3[_0x3da3('0x43')]['id']}},_0x35e5ce={};_0x35e5ce[_0x3da3('0x2e')]=_[_0x3da3('0x2b')](db['JscriptyProject'][_0x3da3('0x2a')]);_0x3aadb2[_0x3da3('0x2f')]=_[_0x3da3('0x30')](_0x35e5ce[_0x3da3('0x2e')],qs[_0x3da3('0x31')](_0x25dcd3[_0x3da3('0x2c')]['fields']));_0x3aadb2[_0x3da3('0x2f')]=_0x3aadb2[_0x3da3('0x2f')][_0x3da3('0x32')]?_0x3aadb2[_0x3da3('0x2f')]:_0x35e5ce['model'];if(_0x25dcd3[_0x3da3('0x2c')]['includeAll']){_0x3aadb2[_0x3da3('0x3f')]=[{'all':!![]}];}_0x3aadb2=_[_0x3da3('0x38')]({},_0x3aadb2,_0x25dcd3[_0x3da3('0x3e')]);return db['JscriptyProject'][_0x3da3('0x4a')](_0x3aadb2)[_0x3da3('0x23')](handleEntityNotFound(_0x482e09,null))[_0x3da3('0x23')](function(_0x23f7bd){if(_0x23f7bd){var _0x44db47=_0x23f7bd['get']({'plain':!![]});_0x44db47=qs['omit'](_0x44db47,['id','createdAt',_0x3da3('0x4f')]);_0x25dcd3[_0x3da3('0x45')]=_[_0x3da3('0x50')](_0x25dcd3['body'],['id',_0x3da3('0x51'),_0x3da3('0x4f')]);return db[_0x3da3('0x29')][_0x3da3('0x44')](_[_0x3da3('0x38')](_0x44db47,_0x25dcd3[_0x3da3('0x45')]),{'include':_0x25dcd3[_0x3da3('0x2c')]['includeAll']?[{'all':!![]}]:undefined})[_0x3da3('0x23')](function(_0x24c05c){var _0x2762b3=_0x25dcd3[_0x3da3('0x46')]['get']({'plain':!![]});if(!_0x2762b3)throw new Error(_0x3da3('0x47'));if(_0x2762b3[_0x3da3('0x48')]===_0x3da3('0x46')){var _0x371328=_0x24c05c[_0x3da3('0x24')]({'plain':!![]});var _0x45f1f5='Projects';return db[_0x3da3('0x49')][_0x3da3('0x4a')]({'where':{'name':_0x45f1f5,'userProfileId':_0x2762b3[_0x3da3('0x52')]},'raw':!![]})[_0x3da3('0x23')](function(_0x4bd3a4){if(_0x4bd3a4&&_0x4bd3a4['autoAssociation']===0x0){return db[_0x3da3('0x4c')][_0x3da3('0x44')]({'name':_0x371328[_0x3da3('0x4d')],'resourceId':_0x371328['id'],'type':_0x4bd3a4[_0x3da3('0x4d')],'sectionId':_0x4bd3a4['id']},{})[_0x3da3('0x23')](function(){return _0x24c05c;});}else{return _0x24c05c;}})[_0x3da3('0x41')](function(_0x3c7f2c){logger[_0x3da3('0x26')](_0x3da3('0x4e'),_0x3c7f2c);throw _0x3c7f2c;});}return _0x24c05c;});}})['then'](respondWithResult(_0x482e09,0xc9))['catch'](handleError(_0x482e09,null));};exports[_0x3da3('0x22')]=function(_0x2704fa,_0x3c7105){if(_0x2704fa['body']['id']){delete _0x2704fa[_0x3da3('0x45')]['id'];}return db[_0x3da3('0x29')][_0x3da3('0x4a')]({'where':{'id':_0x2704fa['params']['id']}})[_0x3da3('0x23')](handleEntityNotFound(_0x3c7105,null))[_0x3da3('0x23')](saveUpdates(_0x2704fa[_0x3da3('0x45')],null))['then'](respondWithResult(_0x3c7105,null))['catch'](handleError(_0x3c7105,null));};exports[_0x3da3('0x25')]=function(_0x398230,_0x413417){return db[_0x3da3('0x29')][_0x3da3('0x4a')]({'where':{'id':_0x398230['params']['id']}})[_0x3da3('0x23')](handleEntityNotFound(_0x413417,null))[_0x3da3('0x23')](removeEntity(_0x413417,null))[_0x3da3('0x41')](handleError(_0x413417,null));};exports['getSessions']=function(_0x42f79a,_0x33a3f7,_0x2879f9){var _0x559182={'raw':!![],'where':{}};var _0x24dee5={};var _0x2c4fcd={'count':0x0,'rows':[]};return db[_0x3da3('0x29')][_0x3da3('0x53')]({'where':{'id':_0x42f79a[_0x3da3('0x43')]['id']}})[_0x3da3('0x23')](handleEntityNotFound(_0x33a3f7,null))['then'](function(_0x1c2ed7){if(_0x1c2ed7){_0x24dee5[_0x3da3('0x2e')]=_[_0x3da3('0x2b')](db[_0x3da3('0x54')]['rawAttributes']);_0x24dee5[_0x3da3('0x2c')]=_[_0x3da3('0x2b')](_0x42f79a['query']);_0x24dee5[_0x3da3('0x2d')]=_['intersection'](_0x24dee5[_0x3da3('0x2e')],_0x24dee5['query']);_0x559182[_0x3da3('0x2f')]=_[_0x3da3('0x30')](_0x24dee5[_0x3da3('0x2e')],qs[_0x3da3('0x31')](_0x42f79a[_0x3da3('0x2c')][_0x3da3('0x31')]));_0x559182[_0x3da3('0x2f')]=_0x559182['attributes'][_0x3da3('0x32')]?_0x559182['attributes']:_0x24dee5['model'];if(!_0x42f79a[_0x3da3('0x2c')][_0x3da3('0x55')](_0x3da3('0x33'))){_0x559182[_0x3da3('0x1d')]=qs['limit'](_0x42f79a['query'][_0x3da3('0x1d')]);_0x559182[_0x3da3('0x1c')]=qs['offset'](_0x42f79a[_0x3da3('0x2c')][_0x3da3('0x1c')]);}_0x559182[_0x3da3('0x56')]=qs[_0x3da3('0x34')](_0x42f79a[_0x3da3('0x2c')]['sort']);_0x559182[_0x3da3('0x35')]=qs[_0x3da3('0x2d')](_[_0x3da3('0x36')](_0x42f79a[_0x3da3('0x2c')],_0x24dee5[_0x3da3('0x2d')]));_0x559182[_0x3da3('0x35')][_0x3da3('0x57')]=_0x1c2ed7['id'];if(_0x42f79a['query'][_0x3da3('0x37')]){_0x559182[_0x3da3('0x35')]=_['merge'](_0x559182[_0x3da3('0x35')],{'$or':_['map'](_0x559182['attributes'],function(_0x2c0b67){var _0x588f70={};_0x588f70[_0x2c0b67]={'$like':'%'+_0x42f79a[_0x3da3('0x2c')][_0x3da3('0x37')]+'%'};return _0x588f70;})});}_0x559182=_[_0x3da3('0x38')]({},_0x559182,_0x42f79a['options']);return db[_0x3da3('0x54')][_0x3da3('0x1b')]({'where':_0x559182['where']})[_0x3da3('0x23')](function(_0x44f3cf){_0x2c4fcd[_0x3da3('0x1b')]=_0x44f3cf;if(_0x42f79a[_0x3da3('0x2c')]['includeAll']){_0x559182[_0x3da3('0x3f')]=[{'all':!![]}];}return db[_0x3da3('0x54')][_0x3da3('0x40')](_0x559182);})['then'](function(_0x1aea51){_0x2c4fcd[_0x3da3('0x58')]=_0x1aea51;return _0x2c4fcd;});}})[_0x3da3('0x23')](respondWithFilteredResult(_0x33a3f7,_0x559182))['catch'](handleError(_0x33a3f7,null));};exports[_0x3da3('0x59')]=function(_0x99d15c,_0x2f8baa,_0x2a6760){var _0x343ce0={'raw':!![],'where':{}};var _0x56521d={};var _0x3fff89={'count':0x0,'rows':[]};return db[_0x3da3('0x29')][_0x3da3('0x53')]({'where':{'id':_0x99d15c[_0x3da3('0x43')]['id']}})['then'](handleEntityNotFound(_0x2f8baa,null))[_0x3da3('0x23')](function(_0x2a99f6){if(_0x2a99f6){_0x56521d['model']=_[_0x3da3('0x2b')](db[_0x3da3('0x5a')][_0x3da3('0x2a')]);_0x56521d[_0x3da3('0x2c')]=_[_0x3da3('0x2b')](_0x99d15c[_0x3da3('0x2c')]);_0x56521d[_0x3da3('0x2d')]=_[_0x3da3('0x30')](_0x56521d[_0x3da3('0x2e')],_0x56521d[_0x3da3('0x2c')]);_0x343ce0['attributes']=_[_0x3da3('0x30')](_0x56521d['model'],qs[_0x3da3('0x31')](_0x99d15c[_0x3da3('0x2c')][_0x3da3('0x31')]));_0x343ce0[_0x3da3('0x2f')]=_0x343ce0[_0x3da3('0x2f')][_0x3da3('0x32')]?_0x343ce0[_0x3da3('0x2f')]:_0x56521d[_0x3da3('0x2e')];if(!_0x99d15c[_0x3da3('0x2c')][_0x3da3('0x55')]('nolimit')){_0x343ce0['limit']=qs[_0x3da3('0x1d')](_0x99d15c['query']['limit']);_0x343ce0[_0x3da3('0x1c')]=qs[_0x3da3('0x1c')](_0x99d15c['query'][_0x3da3('0x1c')]);}_0x343ce0[_0x3da3('0x56')]=qs[_0x3da3('0x34')](_0x99d15c[_0x3da3('0x2c')]['sort']);_0x343ce0['where']=qs['filters'](_[_0x3da3('0x36')](_0x99d15c['query'],_0x56521d[_0x3da3('0x2d')]));_0x343ce0[_0x3da3('0x35')][_0x3da3('0x57')]=_0x2a99f6['id'];if(_0x99d15c[_0x3da3('0x2c')][_0x3da3('0x37')]){_0x343ce0[_0x3da3('0x35')]=_['merge'](_0x343ce0[_0x3da3('0x35')],{'$or':_[_0x3da3('0x39')](_0x343ce0[_0x3da3('0x2f')],function(_0x3515b2){var _0x5c26f8={};_0x5c26f8[_0x3515b2]={'$like':'%'+_0x99d15c[_0x3da3('0x2c')][_0x3da3('0x37')]+'%'};return _0x5c26f8;})});}_0x343ce0=_['merge']({},_0x343ce0,_0x99d15c[_0x3da3('0x3e')]);return db[_0x3da3('0x5a')][_0x3da3('0x1b')]({'where':_0x343ce0[_0x3da3('0x35')]})[_0x3da3('0x23')](function(_0xf1384a){_0x3fff89[_0x3da3('0x1b')]=_0xf1384a;if(_0x99d15c[_0x3da3('0x2c')]['includeAll']){_0x343ce0[_0x3da3('0x3f')]=[{'all':!![]}];}return db[_0x3da3('0x5a')]['findAll'](_0x343ce0);})[_0x3da3('0x23')](function(_0x42bee3){_0x3fff89[_0x3da3('0x58')]=_0x42bee3;return _0x3fff89;});}})[_0x3da3('0x23')](respondWithFilteredResult(_0x2f8baa,_0x343ce0))['catch'](handleError(_0x2f8baa,null));};function char(_0x44c2b6){return _0x3da3('0x5b')===typeof _0x44c2b6?String[_0x3da3('0x5c')][_0x3da3('0x5d')](null,arguments):_0x44c2b6;}function needsEncapsulation(_0x3e8080){return!!_0x3e8080&&(_0x3e8080[_0x3da3('0x5e')]()[_0x3da3('0x5f')](char(0xd))>=0x0||_0x3e8080[_0x3da3('0x5e')]()['indexOf'](char(0xa))>=0x0||_0x3e8080[_0x3da3('0x5e')]()[_0x3da3('0x5f')](char(0x2c))>=0x0||_0x3e8080[_0x3da3('0x5e')]()[_0x3da3('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x33b6f3){var _0x3d0f8c=char(0x22),_0x553d7a='\x5c'+char(0x22),_0x3c1274=_0x33b6f3[_0x3da3('0x5e')]()['replace'](new RegExp(_0x3d0f8c,'g'),_0x553d7a);return _0x3d0f8c+_0x3c1274+_0x3d0f8c;}exports[_0x3da3('0x60')]=function(_0x2fa4dd,_0x8deda0,_0x39a367){var _0x54126e,_0x1fa80c;var _0x34a864={'where':{'ProjectId':_0x2fa4dd[_0x3da3('0x43')]['id']}};if(_0x2fa4dd[_0x3da3('0x2c')][_0x3da3('0x61')]){_0x34a864[_0x3da3('0x35')][_0x3da3('0x62')]=JSON['parse'](_0x2fa4dd['query']['startTime']);}return db['JscriptySessionReport'][_0x3da3('0x40')](_0x34a864)[_0x3da3('0x23')](handleEntityNotFound(_0x8deda0,null))['then'](function(_0x2c2f57){if(_0x2c2f57){_0x54126e=_0x2c2f57;return db[_0x3da3('0x63')]['findAll']({'where':{'SessionId':{'$in':_['map'](_0x54126e,'id')},'ProjectId':_0x2fa4dd[_0x3da3('0x43')]['id']},'order':_0x3da3('0x64')});}})[_0x3da3('0x23')](handleEntityNotFound(_0x8deda0,null))[_0x3da3('0x23')](function(_0x26e230){if(_0x26e230){_0x1fa80c=_0x26e230;var _0x1fd598={};for(var _0x443693=0x0,_0x4204e6=_0x1fa80c[_0x3da3('0x32')];_0x443693<_0x4204e6;_0x443693++){if(!_0x1fd598['hasOwnProperty'](_0x1fa80c[_0x443693][_0x3da3('0x65')])){_0x1fd598[_0x1fa80c[_0x443693][_0x3da3('0x65')]]=needsEncapsulation(_0x1fa80c[_0x443693][_0x3da3('0x66')])?encapsulate(_0x1fa80c[_0x443693]['question']):_0x1fa80c[_0x443693][_0x3da3('0x66')];}}var _0x2741f9=[],_0x20f73={};for(var _0xf0e5d0=0x0,_0x4b3d04=_0x54126e[_0x3da3('0x32')];_0xf0e5d0<_0x4b3d04;_0xf0e5d0++){_0x20f73={'ProjectId':_0x2fa4dd['params']['id'],'SessionId':_0x54126e[_0xf0e5d0]['id'],'StartTime':moment(_0x54126e[_0xf0e5d0]['starttime'])[_0x3da3('0x67')](_0x3da3('0x68'))};for(var _0x3d0c29=0x0,_0x5afeed=_0x1fa80c[_0x3da3('0x32')];_0x3d0c29<_0x5afeed;_0x3d0c29++){if(_0x1fa80c[_0x3d0c29]['SessionId']==_0x54126e[_0xf0e5d0]['id']&&_0x1fd598[_0x3da3('0x55')](_0x1fa80c[_0x3d0c29][_0x3da3('0x65')])){_0x20f73[_0x1fd598[_0x1fa80c[_0x3d0c29][_0x3da3('0x65')]]]=_0x1fa80c[_0x3d0c29]['answer'];}}for(var _0x235ec8 in _0x1fd598){if(!_0x20f73['hasOwnProperty'](_0x1fd598[_0x235ec8])){_0x20f73[_0x1fd598[_0x235ec8]]=null;}}_0x2741f9[_0x3da3('0x69')](_0x20f73);}return _0x2741f9;}})[_0x3da3('0x23')](function(_0x5291a5){if(!_[_0x3da3('0x6a')](_0x5291a5)){var _0x13ee70=toCsv(_0x5291a5);var _0xb81b4c=Date[_0x3da3('0x6b')]();fs[_0x3da3('0x6c')](util[_0x3da3('0x67')](_0x3da3('0x6d'),_0x2fa4dd[_0x3da3('0x43')]['id'],_0xb81b4c),_0x13ee70);_0x8deda0[_0x3da3('0x6e')](_0x3da3('0x6f'),_0x3da3('0x70')+util[_0x3da3('0x67')](_0x3da3('0x71'),_0x2fa4dd['params']['id'],_0xb81b4c));_0x8deda0[_0x3da3('0x6e')](_0x3da3('0x72'),'text/csv');return _0x8deda0['download'](util['format'](_0x3da3('0x6d'),_0x2fa4dd[_0x3da3('0x43')]['id'],_0xb81b4c));}else{return _0x8deda0[_0x3da3('0x18')](0xcc);}})[_0x3da3('0x41')](handleError(_0x8deda0,null));}; \ No newline at end of file +var _0x1b96=['create','body','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','clone','createdAt','omit','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','JscriptySessionReport','getAnswers','JscriptyAnswerReport','ProjectId','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','text/csv','download','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','get','Projects','error','stack','name','JscriptyProject','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find'];(function(_0x464cde,_0x106f0c){var _0x3b3a35=function(_0x22a683){while(--_0x22a683){_0x464cde['push'](_0x464cde['shift']());}};_0x3b3a35(++_0x106f0c);}(_0x1b96,0x11b));var _0x61b9=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x1b96[_0x397e5f];return _0x5302b8;};'use strict';var pdf=require(_0x61b9('0x0'));var emlformat=require(_0x61b9('0x1'));var rimraf=require(_0x61b9('0x2'));var zipdir=require(_0x61b9('0x3'));var jsonpatch=require(_0x61b9('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x61b9('0x5'));var Mustache=require(_0x61b9('0x6'));var util=require(_0x61b9('0x7'));var path=require(_0x61b9('0x8'));var sox=require(_0x61b9('0x9'));var csv=require(_0x61b9('0xa'));var ejs=require(_0x61b9('0xb'));var fs=require('fs');var _=require(_0x61b9('0xc'));var squel=require(_0x61b9('0xd'));var crypto=require(_0x61b9('0xe'));var jsforce=require(_0x61b9('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x61b9('0x10'));var Papa=require(_0x61b9('0x11'));var Redis=require('ioredis');var authService=require(_0x61b9('0x12'));var qs=require(_0x61b9('0x13'));var hardwareService=require(_0x61b9('0x14'));var logger=require(_0x61b9('0x15'))(_0x61b9('0x16'));var utils=require(_0x61b9('0x17'));var config=require('../../config/environment');var db=require(_0x61b9('0x18'))['db'];function respondWithStatusCode(_0x453e51,_0x5d7fba){_0x5d7fba=_0x5d7fba||0xcc;return function(_0x5eb898){if(_0x5eb898){return _0x453e51[_0x61b9('0x19')](_0x5d7fba);}return _0x453e51[_0x61b9('0x1a')](_0x5d7fba)[_0x61b9('0x1b')]();};}function respondWithResult(_0x1d1d12,_0x683e6f){_0x683e6f=_0x683e6f||0xc8;return function(_0x535b5d){if(_0x535b5d){return _0x1d1d12['status'](_0x683e6f)[_0x61b9('0x1c')](_0x535b5d);}};}function respondWithFilteredResult(_0x53ebad,_0x24facf){return function(_0x296d1b){if(_0x296d1b){var _0xd8c8ca=_0x296d1b[_0x61b9('0x1d')],_0x4eb994=_0x24facf[_0x61b9('0x1e')],_0x33a348=_0x24facf[_0x61b9('0x1e')]+_0x24facf[_0x61b9('0x1f')],_0x4a0bee;if(_0x33a348>=_0xd8c8ca){_0x33a348=_0xd8c8ca;_0x4a0bee=0xc8;}else{_0x4a0bee=0xce;}_0x53ebad['status'](_0x4a0bee);return _0x53ebad[_0x61b9('0x20')]('Content-Range',_0x4eb994+'-'+_0x33a348+'/'+_0xd8c8ca)[_0x61b9('0x1c')](_0x296d1b);}return null;};}function patchUpdates(_0x15ac4c){return function(_0x2a2019){try{jsonpatch[_0x61b9('0x21')](_0x2a2019,_0x15ac4c,!![]);}catch(_0x4ecc1f){return BPromise[_0x61b9('0x22')](_0x4ecc1f);}return _0x2a2019[_0x61b9('0x23')]();};}function saveUpdates(_0x344e5d,_0x508223){return function(_0x2bf1d3){if(_0x2bf1d3){return _0x2bf1d3[_0x61b9('0x24')](_0x344e5d)[_0x61b9('0x25')](function(_0x2a1dc3){return _0x2a1dc3;});}return null;};}function removeEntity(_0x2de56d,_0x327753){return function(_0x32861c){if(_0x32861c){return _0x32861c['destroy']()[_0x61b9('0x25')](function(){var _0x56dfb2=_0x32861c[_0x61b9('0x26')]({'plain':!![]});var _0x11e234=_0x61b9('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x11e234,'resourceId':_0x56dfb2['id']}})[_0x61b9('0x25')](function(){return _0x32861c;});})[_0x61b9('0x25')](function(){_0x2de56d[_0x61b9('0x1a')](0xcc)[_0x61b9('0x1b')]();});}};}function handleEntityNotFound(_0x36a62b,_0x4541b5){return function(_0x4b121b){if(!_0x4b121b){_0x36a62b[_0x61b9('0x19')](0x194);}return _0x4b121b;};}function handleError(_0x17e639,_0x4d9903){_0x4d9903=_0x4d9903||0x1f4;return function(_0x1cc6ad){logger[_0x61b9('0x28')](_0x1cc6ad[_0x61b9('0x29')]);if(_0x1cc6ad[_0x61b9('0x2a')]){delete _0x1cc6ad['name'];}_0x17e639[_0x61b9('0x1a')](_0x4d9903)['send'](_0x1cc6ad);};}exports['index']=function(_0x454d66,_0x23fff5){var _0x5abe0f={},_0x4325e1={},_0xe90bc7={'count':0x0,'rows':[]};var _0x45da7e=db[_0x61b9('0x2b')]['rawAttributes'];_0x4325e1['model']=_[_0x61b9('0x2c')](_0x45da7e);_0x4325e1['query']=_[_0x61b9('0x2c')](_0x454d66[_0x61b9('0x2d')]);_0x4325e1[_0x61b9('0x2e')]=_[_0x61b9('0x2f')](_0x4325e1[_0x61b9('0x30')],_0x4325e1['query']);_0x5abe0f[_0x61b9('0x31')]=_[_0x61b9('0x2f')](_0x4325e1[_0x61b9('0x30')],qs['fields'](_0x454d66[_0x61b9('0x2d')][_0x61b9('0x32')]));_0x5abe0f[_0x61b9('0x31')]=_0x5abe0f[_0x61b9('0x31')][_0x61b9('0x33')]?_0x5abe0f[_0x61b9('0x31')]:_0x4325e1[_0x61b9('0x30')];if(!_0x454d66[_0x61b9('0x2d')][_0x61b9('0x34')](_0x61b9('0x35'))){_0x5abe0f[_0x61b9('0x1f')]=qs[_0x61b9('0x1f')](_0x454d66[_0x61b9('0x2d')]['limit']);_0x5abe0f[_0x61b9('0x1e')]=qs[_0x61b9('0x1e')](_0x454d66[_0x61b9('0x2d')]['offset']);}_0x5abe0f[_0x61b9('0x36')]=qs[_0x61b9('0x37')](_0x454d66[_0x61b9('0x2d')][_0x61b9('0x37')]);_0x5abe0f[_0x61b9('0x38')]=qs[_0x61b9('0x2e')](_[_0x61b9('0x39')](_0x454d66[_0x61b9('0x2d')],_0x4325e1['filters']));if(_0x454d66['query'][_0x61b9('0x3a')]){_0x5abe0f[_0x61b9('0x38')]=_[_0x61b9('0x3b')](_0x5abe0f[_0x61b9('0x38')],{'$or':_[_0x61b9('0x3c')](_0x45da7e,function(_0x51955a){if(_0x51955a['type'][_0x61b9('0x3d')]!==_0x61b9('0x3e')){var _0xb48aa6={};_0xb48aa6[_0x51955a[_0x61b9('0x3f')]]={'$like':'%'+_0x454d66[_0x61b9('0x2d')][_0x61b9('0x3a')]+'%'};return _0xb48aa6;}})});}_0x5abe0f=_[_0x61b9('0x3b')]({},_0x5abe0f,_0x454d66[_0x61b9('0x40')]);var _0x46a138={'where':_0x5abe0f['where']};return db[_0x61b9('0x2b')][_0x61b9('0x1d')](_0x46a138)[_0x61b9('0x25')](function(_0x3a1a26){_0xe90bc7[_0x61b9('0x1d')]=_0x3a1a26;if(_0x454d66['query'][_0x61b9('0x41')]){_0x5abe0f[_0x61b9('0x42')]=[{'all':!![]}];}return db['JscriptyProject'][_0x61b9('0x43')](_0x5abe0f);})[_0x61b9('0x25')](function(_0x4793fc){_0xe90bc7[_0x61b9('0x44')]=_0x4793fc;return _0xe90bc7;})[_0x61b9('0x25')](respondWithFilteredResult(_0x23fff5,_0x5abe0f))[_0x61b9('0x45')](handleError(_0x23fff5,null));};exports[_0x61b9('0x46')]=function(_0x2df94c,_0x4e1f7f){var _0xb572d7={'raw':![],'where':{'id':_0x2df94c[_0x61b9('0x47')]['id']}},_0x38908d={};_0x38908d['model']=_[_0x61b9('0x2c')](db['JscriptyProject'][_0x61b9('0x48')]);_0x38908d[_0x61b9('0x2d')]=_[_0x61b9('0x2c')](_0x2df94c[_0x61b9('0x2d')]);_0x38908d[_0x61b9('0x2e')]=_['intersection'](_0x38908d[_0x61b9('0x30')],_0x38908d['query']);_0xb572d7['attributes']=_['intersection'](_0x38908d['model'],qs[_0x61b9('0x32')](_0x2df94c[_0x61b9('0x2d')][_0x61b9('0x32')]));_0xb572d7['attributes']=_0xb572d7[_0x61b9('0x31')][_0x61b9('0x33')]?_0xb572d7['attributes']:_0x38908d[_0x61b9('0x30')];if(_0x2df94c[_0x61b9('0x2d')][_0x61b9('0x41')]){_0xb572d7['include']=[{'all':!![]}];}_0xb572d7=_[_0x61b9('0x3b')]({},_0xb572d7,_0x2df94c['options']);return db[_0x61b9('0x2b')][_0x61b9('0x49')](_0xb572d7)['then'](handleEntityNotFound(_0x4e1f7f,null))[_0x61b9('0x25')](respondWithResult(_0x4e1f7f,null))['catch'](handleError(_0x4e1f7f,null));};exports['create']=function(_0xf500cd,_0x21fd20){return db['JscriptyProject'][_0x61b9('0x4a')](_0xf500cd[_0x61b9('0x4b')],{})['then'](function(_0x8e2e31){var _0x5ef8af=_0xf500cd[_0x61b9('0x4c')][_0x61b9('0x26')]({'plain':!![]});if(!_0x5ef8af)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ef8af['role']===_0x61b9('0x4c')){var _0x5ea090=_0x8e2e31[_0x61b9('0x26')]({'plain':!![]});var _0x100372=_0x61b9('0x27');return db[_0x61b9('0x4d')][_0x61b9('0x49')]({'where':{'name':_0x100372,'userProfileId':_0x5ef8af[_0x61b9('0x4e')]},'raw':!![]})[_0x61b9('0x25')](function(_0x16cc3a){if(_0x16cc3a&&_0x16cc3a[_0x61b9('0x4f')]===0x0){return db[_0x61b9('0x50')][_0x61b9('0x4a')]({'name':_0x5ea090[_0x61b9('0x2a')],'resourceId':_0x5ea090['id'],'type':_0x16cc3a[_0x61b9('0x2a')],'sectionId':_0x16cc3a['id']},{})['then'](function(){return _0x8e2e31;});}else{return _0x8e2e31;}})[_0x61b9('0x45')](function(_0x52a3e9){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52a3e9);throw _0x52a3e9;});}return _0x8e2e31;})[_0x61b9('0x25')](respondWithResult(_0x21fd20,0xc9))['catch'](handleError(_0x21fd20,null));};exports[_0x61b9('0x51')]=function(_0x40f386,_0x1a496f){var _0x24c5b0={'raw':![],'where':{'id':_0x40f386['params']['id']}},_0x13b6b8={};_0x13b6b8[_0x61b9('0x30')]=_[_0x61b9('0x2c')](db['JscriptyProject']['rawAttributes']);_0x24c5b0[_0x61b9('0x31')]=_['intersection'](_0x13b6b8[_0x61b9('0x30')],qs[_0x61b9('0x32')](_0x40f386['query'][_0x61b9('0x32')]));_0x24c5b0[_0x61b9('0x31')]=_0x24c5b0[_0x61b9('0x31')][_0x61b9('0x33')]?_0x24c5b0[_0x61b9('0x31')]:_0x13b6b8[_0x61b9('0x30')];if(_0x40f386[_0x61b9('0x2d')][_0x61b9('0x41')]){_0x24c5b0['include']=[{'all':!![]}];}_0x24c5b0=_[_0x61b9('0x3b')]({},_0x24c5b0,_0x40f386['options']);return db[_0x61b9('0x2b')]['find'](_0x24c5b0)[_0x61b9('0x25')](handleEntityNotFound(_0x1a496f,null))['then'](function(_0x4e2517){if(_0x4e2517){var _0x47f2f6=_0x4e2517[_0x61b9('0x26')]({'plain':!![]});_0x47f2f6=qs['omit'](_0x47f2f6,['id',_0x61b9('0x52'),'updatedAt']);_0x40f386[_0x61b9('0x4b')]=_[_0x61b9('0x53')](_0x40f386['body'],['id',_0x61b9('0x52'),_0x61b9('0x54')]);return db[_0x61b9('0x2b')]['create'](_[_0x61b9('0x3b')](_0x47f2f6,_0x40f386[_0x61b9('0x4b')]),{'include':_0x40f386[_0x61b9('0x2d')][_0x61b9('0x41')]?[{'all':!![]}]:undefined})[_0x61b9('0x25')](function(_0x1a67de){var _0x2f81b0=_0x40f386['user']['get']({'plain':!![]});if(!_0x2f81b0)throw new Error(_0x61b9('0x55'));if(_0x2f81b0['role']===_0x61b9('0x4c')){var _0x488710=_0x1a67de[_0x61b9('0x26')]({'plain':!![]});var _0x2e9789=_0x61b9('0x27');return db[_0x61b9('0x4d')][_0x61b9('0x49')]({'where':{'name':_0x2e9789,'userProfileId':_0x2f81b0[_0x61b9('0x4e')]},'raw':!![]})[_0x61b9('0x25')](function(_0x1addea){if(_0x1addea&&_0x1addea[_0x61b9('0x4f')]===0x0){return db['UserProfileResource'][_0x61b9('0x4a')]({'name':_0x488710['name'],'resourceId':_0x488710['id'],'type':_0x1addea[_0x61b9('0x2a')],'sectionId':_0x1addea['id']},{})[_0x61b9('0x25')](function(){return _0x1a67de;});}else{return _0x1a67de;}})['catch'](function(_0x3c5275){logger[_0x61b9('0x28')](_0x61b9('0x56'),_0x3c5275);throw _0x3c5275;});}return _0x1a67de;});}})[_0x61b9('0x25')](respondWithResult(_0x1a496f,0xc9))[_0x61b9('0x45')](handleError(_0x1a496f,null));};exports[_0x61b9('0x24')]=function(_0x2c1cf4,_0x1c7764){if(_0x2c1cf4[_0x61b9('0x4b')]['id']){delete _0x2c1cf4[_0x61b9('0x4b')]['id'];}return db[_0x61b9('0x2b')]['find']({'where':{'id':_0x2c1cf4['params']['id']}})['then'](handleEntityNotFound(_0x1c7764,null))[_0x61b9('0x25')](saveUpdates(_0x2c1cf4[_0x61b9('0x4b')],null))[_0x61b9('0x25')](respondWithResult(_0x1c7764,null))[_0x61b9('0x45')](handleError(_0x1c7764,null));};exports['destroy']=function(_0x33d871,_0x3318c4){return db[_0x61b9('0x2b')][_0x61b9('0x49')]({'where':{'id':_0x33d871[_0x61b9('0x47')]['id']}})[_0x61b9('0x25')](handleEntityNotFound(_0x3318c4,null))[_0x61b9('0x25')](removeEntity(_0x3318c4,null))[_0x61b9('0x45')](handleError(_0x3318c4,null));};exports['getSessions']=function(_0x31bcbb,_0x33b7d0,_0x517324){var _0x500df7={'raw':!![],'where':{}};var _0x2f3069={};var _0x4abb9e={'count':0x0,'rows':[]};return db[_0x61b9('0x2b')][_0x61b9('0x57')]({'where':{'id':_0x31bcbb[_0x61b9('0x47')]['id']}})[_0x61b9('0x25')](handleEntityNotFound(_0x33b7d0,null))['then'](function(_0x2a1e3f){if(_0x2a1e3f){_0x2f3069[_0x61b9('0x30')]=_[_0x61b9('0x2c')](db[_0x61b9('0x58')][_0x61b9('0x48')]);_0x2f3069[_0x61b9('0x2d')]=_[_0x61b9('0x2c')](_0x31bcbb[_0x61b9('0x2d')]);_0x2f3069[_0x61b9('0x2e')]=_['intersection'](_0x2f3069[_0x61b9('0x30')],_0x2f3069[_0x61b9('0x2d')]);_0x500df7[_0x61b9('0x31')]=_['intersection'](_0x2f3069[_0x61b9('0x30')],qs['fields'](_0x31bcbb[_0x61b9('0x2d')]['fields']));_0x500df7[_0x61b9('0x31')]=_0x500df7[_0x61b9('0x31')][_0x61b9('0x33')]?_0x500df7['attributes']:_0x2f3069['model'];if(!_0x31bcbb[_0x61b9('0x2d')]['hasOwnProperty'](_0x61b9('0x35'))){_0x500df7['limit']=qs[_0x61b9('0x1f')](_0x31bcbb[_0x61b9('0x2d')][_0x61b9('0x1f')]);_0x500df7[_0x61b9('0x1e')]=qs[_0x61b9('0x1e')](_0x31bcbb[_0x61b9('0x2d')][_0x61b9('0x1e')]);}_0x500df7[_0x61b9('0x36')]=qs[_0x61b9('0x37')](_0x31bcbb[_0x61b9('0x2d')]['sort']);_0x500df7[_0x61b9('0x38')]=qs['filters'](_[_0x61b9('0x39')](_0x31bcbb[_0x61b9('0x2d')],_0x2f3069[_0x61b9('0x2e')]));_0x500df7[_0x61b9('0x38')]['ProjectId']=_0x2a1e3f['id'];if(_0x31bcbb[_0x61b9('0x2d')][_0x61b9('0x3a')]){_0x500df7['where']=_['merge'](_0x500df7['where'],{'$or':_[_0x61b9('0x3c')](_0x500df7[_0x61b9('0x31')],function(_0x8e85a8){var _0x582d03={};_0x582d03[_0x8e85a8]={'$like':'%'+_0x31bcbb['query'][_0x61b9('0x3a')]+'%'};return _0x582d03;})});}_0x500df7=_[_0x61b9('0x3b')]({},_0x500df7,_0x31bcbb[_0x61b9('0x40')]);return db[_0x61b9('0x58')][_0x61b9('0x1d')]({'where':_0x500df7[_0x61b9('0x38')]})['then'](function(_0x2d8491){_0x4abb9e[_0x61b9('0x1d')]=_0x2d8491;if(_0x31bcbb[_0x61b9('0x2d')][_0x61b9('0x41')]){_0x500df7[_0x61b9('0x42')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x500df7);})['then'](function(_0x2cfdc4){_0x4abb9e[_0x61b9('0x44')]=_0x2cfdc4;return _0x4abb9e;});}})[_0x61b9('0x25')](respondWithFilteredResult(_0x33b7d0,_0x500df7))[_0x61b9('0x45')](handleError(_0x33b7d0,null));};exports[_0x61b9('0x59')]=function(_0x21b766,_0x2dc1df,_0x265cba){var _0x5df153={'raw':!![],'where':{}};var _0x43cf79={};var _0x27d988={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x61b9('0x57')]({'where':{'id':_0x21b766[_0x61b9('0x47')]['id']}})['then'](handleEntityNotFound(_0x2dc1df,null))[_0x61b9('0x25')](function(_0x7de7ed){if(_0x7de7ed){_0x43cf79[_0x61b9('0x30')]=_[_0x61b9('0x2c')](db[_0x61b9('0x5a')]['rawAttributes']);_0x43cf79[_0x61b9('0x2d')]=_['keys'](_0x21b766[_0x61b9('0x2d')]);_0x43cf79['filters']=_[_0x61b9('0x2f')](_0x43cf79['model'],_0x43cf79[_0x61b9('0x2d')]);_0x5df153['attributes']=_[_0x61b9('0x2f')](_0x43cf79[_0x61b9('0x30')],qs[_0x61b9('0x32')](_0x21b766[_0x61b9('0x2d')]['fields']));_0x5df153[_0x61b9('0x31')]=_0x5df153[_0x61b9('0x31')][_0x61b9('0x33')]?_0x5df153[_0x61b9('0x31')]:_0x43cf79[_0x61b9('0x30')];if(!_0x21b766[_0x61b9('0x2d')][_0x61b9('0x34')](_0x61b9('0x35'))){_0x5df153[_0x61b9('0x1f')]=qs[_0x61b9('0x1f')](_0x21b766[_0x61b9('0x2d')][_0x61b9('0x1f')]);_0x5df153['offset']=qs['offset'](_0x21b766['query']['offset']);}_0x5df153[_0x61b9('0x36')]=qs[_0x61b9('0x37')](_0x21b766[_0x61b9('0x2d')]['sort']);_0x5df153[_0x61b9('0x38')]=qs['filters'](_[_0x61b9('0x39')](_0x21b766[_0x61b9('0x2d')],_0x43cf79[_0x61b9('0x2e')]));_0x5df153['where'][_0x61b9('0x5b')]=_0x7de7ed['id'];if(_0x21b766[_0x61b9('0x2d')][_0x61b9('0x3a')]){_0x5df153['where']=_[_0x61b9('0x3b')](_0x5df153['where'],{'$or':_[_0x61b9('0x3c')](_0x5df153[_0x61b9('0x31')],function(_0x2efe61){var _0x3cc3b4={};_0x3cc3b4[_0x2efe61]={'$like':'%'+_0x21b766[_0x61b9('0x2d')]['filter']+'%'};return _0x3cc3b4;})});}_0x5df153=_['merge']({},_0x5df153,_0x21b766['options']);return db[_0x61b9('0x5a')][_0x61b9('0x1d')]({'where':_0x5df153[_0x61b9('0x38')]})[_0x61b9('0x25')](function(_0x1d7b48){_0x27d988['count']=_0x1d7b48;if(_0x21b766['query'][_0x61b9('0x41')]){_0x5df153[_0x61b9('0x42')]=[{'all':!![]}];}return db[_0x61b9('0x5a')]['findAll'](_0x5df153);})[_0x61b9('0x25')](function(_0x54a31e){_0x27d988['rows']=_0x54a31e;return _0x27d988;});}})['then'](respondWithFilteredResult(_0x2dc1df,_0x5df153))[_0x61b9('0x45')](handleError(_0x2dc1df,null));};function char(_0x5d645c){return _0x61b9('0x5c')===typeof _0x5d645c?String[_0x61b9('0x5d')]['apply'](null,arguments):_0x5d645c;}function needsEncapsulation(_0x3acc7e){return!!_0x3acc7e&&(_0x3acc7e[_0x61b9('0x5e')]()[_0x61b9('0x5f')](char(0xd))>=0x0||_0x3acc7e['toString']()[_0x61b9('0x5f')](char(0xa))>=0x0||_0x3acc7e['toString']()['indexOf'](char(0x2c))>=0x0||_0x3acc7e['toString']()[_0x61b9('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x157e26){var _0x514f55=char(0x22),_0x431a66='\x5c'+char(0x22),_0x3b337e=_0x157e26[_0x61b9('0x5e')]()[_0x61b9('0x60')](new RegExp(_0x514f55,'g'),_0x431a66);return _0x514f55+_0x3b337e+_0x514f55;}exports[_0x61b9('0x61')]=function(_0x1f08b2,_0x1df544,_0x57b467){var _0x289f6c,_0x2fdefb;var _0x243987={'where':{'ProjectId':_0x1f08b2[_0x61b9('0x47')]['id']}};if(_0x1f08b2['query'][_0x61b9('0x62')]){_0x243987[_0x61b9('0x38')][_0x61b9('0x63')]=JSON[_0x61b9('0x64')](_0x1f08b2[_0x61b9('0x2d')][_0x61b9('0x62')]);}return db[_0x61b9('0x58')]['findAll'](_0x243987)[_0x61b9('0x25')](handleEntityNotFound(_0x1df544,null))[_0x61b9('0x25')](function(_0x3f94a7){if(_0x3f94a7){_0x289f6c=_0x3f94a7;return db[_0x61b9('0x65')][_0x61b9('0x43')]({'where':{'SessionId':{'$in':_[_0x61b9('0x3c')](_0x289f6c,'id')},'ProjectId':_0x1f08b2[_0x61b9('0x47')]['id']},'order':_0x61b9('0x66')});}})[_0x61b9('0x25')](handleEntityNotFound(_0x1df544,null))[_0x61b9('0x25')](function(_0x226f50){if(_0x226f50){_0x2fdefb=_0x226f50;var _0x551e35={};for(var _0x12d760=0x0,_0x4ce142=_0x2fdefb[_0x61b9('0x33')];_0x12d760<_0x4ce142;_0x12d760++){if(!_0x551e35[_0x61b9('0x34')](_0x2fdefb[_0x12d760][_0x61b9('0x67')])){_0x551e35[_0x2fdefb[_0x12d760][_0x61b9('0x67')]]=needsEncapsulation(_0x2fdefb[_0x12d760][_0x61b9('0x68')])?encapsulate(_0x2fdefb[_0x12d760][_0x61b9('0x68')]):_0x2fdefb[_0x12d760][_0x61b9('0x68')];}}var _0x3870c4=[],_0x487292={};for(var _0x3a75d6=0x0,_0x52a969=_0x289f6c['length'];_0x3a75d6<_0x52a969;_0x3a75d6++){_0x487292={'ProjectId':_0x1f08b2[_0x61b9('0x47')]['id'],'SessionId':_0x289f6c[_0x3a75d6]['id'],'StartTime':moment(_0x289f6c[_0x3a75d6][_0x61b9('0x63')])[_0x61b9('0x69')](_0x61b9('0x6a'))};for(var _0x22910b=0x0,_0x48b885=_0x2fdefb['length'];_0x22910b<_0x48b885;_0x22910b++){if(_0x2fdefb[_0x22910b][_0x61b9('0x6b')]==_0x289f6c[_0x3a75d6]['id']&&_0x551e35[_0x61b9('0x34')](_0x2fdefb[_0x22910b][_0x61b9('0x67')])){_0x487292[_0x551e35[_0x2fdefb[_0x22910b][_0x61b9('0x67')]]]=_0x2fdefb[_0x22910b][_0x61b9('0x6c')];}}for(var _0x12fd78 in _0x551e35){if(!_0x487292[_0x61b9('0x34')](_0x551e35[_0x12fd78])){_0x487292[_0x551e35[_0x12fd78]]=null;}}_0x3870c4[_0x61b9('0x6d')](_0x487292);}return _0x3870c4;}})[_0x61b9('0x25')](function(_0x1acc19){if(!_[_0x61b9('0x6e')](_0x1acc19)){var _0x361704=toCsv(_0x1acc19);var _0x3e70c8=Date['now']();fs[_0x61b9('0x6f')](util[_0x61b9('0x69')](_0x61b9('0x70'),_0x1f08b2[_0x61b9('0x47')]['id'],_0x3e70c8),_0x361704);_0x1df544['setHeader'](_0x61b9('0x71'),_0x61b9('0x72')+util['format'](_0x61b9('0x73'),_0x1f08b2['params']['id'],_0x3e70c8));_0x1df544[_0x61b9('0x74')]('Content-type',_0x61b9('0x75'));return _0x1df544[_0x61b9('0x76')](util['format'](_0x61b9('0x70'),_0x1f08b2[_0x61b9('0x47')]['id'],_0x3e70c8));}else{return _0x1df544[_0x61b9('0x19')](0xcc);}})['catch'](handleError(_0x1df544,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index b073dc7..dc500ee 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 _0xd4f0=['lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define'];(function(_0x3fd750,_0x120661){var _0x4f15d9=function(_0x3181b8){while(--_0x3181b8){_0x3fd750['push'](_0x3fd750['shift']());}};_0x4f15d9(++_0x120661);}(_0xd4f0,0x122));var _0x0d4f=function(_0x9307ea,_0x38968a){_0x9307ea=_0x9307ea-0x0;var _0x295554=_0xd4f0[_0x9307ea];return _0x295554;};'use strict';var _=require(_0x0d4f('0x0'));var util=require(_0x0d4f('0x1'));var logger=require(_0x0d4f('0x2'))(_0x0d4f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0d4f('0x4'));var rimraf=require(_0x0d4f('0x5'));var config=require(_0x0d4f('0x6'));var attributes=require(_0x0d4f('0x7'));module[_0x0d4f('0x8')]=function(_0x5bfa2a,_0x2984af){return _0x5bfa2a[_0x0d4f('0x9')]('JscriptyProject',attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc51e=['util','../../config/logger','api','bluebird','request-promise','rimraf','exports','JscriptyProject'];(function(_0x560b41,_0x1fa071){var _0xddba81=function(_0x4203a7){while(--_0x4203a7){_0x560b41['push'](_0x560b41['shift']());}};_0xddba81(++_0x1fa071);}(_0xc51e,0x1a0));var _0xec51=function(_0x568ae7,_0x2b5fa3){_0x568ae7=_0x568ae7-0x0;var _0x257050=_0xc51e[_0x568ae7];return _0x257050;};'use strict';var _=require('lodash');var util=require(_0xec51('0x0'));var logger=require(_0xec51('0x1'))(_0xec51('0x2'));var moment=require('moment');var BPromise=require(_0xec51('0x3'));var rp=require(_0xec51('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xec51('0x5'));var config=require('../../config/environment');var attributes=require('./jscriptyProject.attributes');module[_0xec51('0x6')]=function(_0x1603d1,_0x43c3ce){return _0x1603d1['define'](_0xec51('0x7'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 7b3a43c..7f63ae5 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 _0x15fe=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x15fe,0x16a));var _0xe15f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x15fe[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xe15f('0x0'));var util=require(_0xe15f('0x1'));var moment=require('moment');var BPromise=require(_0xe15f('0x2'));var rs=require(_0xe15f('0x3'));var fs=require('fs');var Redis=require(_0xe15f('0x4'));var db=require(_0xe15f('0x5'))['db'];var utils=require(_0xe15f('0x6'));var logger=require('../../config/logger')(_0xe15f('0x7'));var config=require(_0xe15f('0x8'));var jayson=require(_0xe15f('0x9'));var client=jayson[_0xe15f('0xa')][_0xe15f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b08b6,_0x4cb306,_0x168af8){return new BPromise(function(_0x1eb0cf,_0x27f2bd){return client[_0xe15f('0xc')](_0x2b08b6,_0x168af8)[_0xe15f('0xd')](function(_0x18f5dc){logger[_0xe15f('0xe')](_0xe15f('0xf'),_0x4cb306,'request\x20sent');logger['debug'](_0xe15f('0x10'),_0x4cb306,'request\x20sent',JSON[_0xe15f('0x11')](_0x18f5dc));if(_0x18f5dc[_0xe15f('0x12')]){if(_0x18f5dc[_0xe15f('0x12')]['code']===0x1f4){logger['error'](_0xe15f('0xf'),_0x4cb306,_0x18f5dc['error'][_0xe15f('0x13')]);return _0x27f2bd(_0x18f5dc[_0xe15f('0x12')][_0xe15f('0x13')]);}logger[_0xe15f('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x4cb306,_0x18f5dc[_0xe15f('0x12')]['message']);return _0x1eb0cf(_0x18f5dc[_0xe15f('0x12')][_0xe15f('0x13')]);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x4cb306,_0xe15f('0x14'));_0x1eb0cf(_0x18f5dc[_0xe15f('0x15')]['message']);}})[_0xe15f('0x16')](function(_0x344b91){logger['error'](_0xe15f('0xf'),_0x4cb306,_0x344b91);_0x27f2bd(_0x344b91);});});} \ No newline at end of file +var _0x201d=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyProject,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment'];(function(_0x355f4c,_0x594479){var _0x32def2=function(_0x101d6d){while(--_0x101d6d){_0x355f4c['push'](_0x355f4c['shift']());}};_0x32def2(++_0x594479);}(_0x201d,0x184));var _0xd201=function(_0x73d844,_0x481d2e){_0x73d844=_0x73d844-0x0;var _0x402ae9=_0x201d[_0x73d844];return _0x402ae9;};'use strict';var _=require(_0xd201('0x0'));var util=require(_0xd201('0x1'));var moment=require(_0xd201('0x2'));var BPromise=require(_0xd201('0x3'));var rs=require(_0xd201('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd201('0x5'));var logger=require(_0xd201('0x6'))(_0xd201('0x7'));var config=require('../../config/environment');var jayson=require(_0xd201('0x8'));var client=jayson[_0xd201('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x415be4,_0x25e3f2,_0x14c946){return new BPromise(function(_0x262bc5,_0x8a26e0){return client[_0xd201('0xa')](_0x415be4,_0x14c946)[_0xd201('0xb')](function(_0x2d80f7){logger['info']('JscriptyProject,\x20%s,\x20%s',_0x25e3f2,_0xd201('0xc'));logger[_0xd201('0xd')](_0xd201('0xe'),_0x25e3f2,_0xd201('0xc'),JSON[_0xd201('0xf')](_0x2d80f7));if(_0x2d80f7[_0xd201('0x10')]){if(_0x2d80f7[_0xd201('0x10')][_0xd201('0x11')]===0x1f4){logger[_0xd201('0x10')](_0xd201('0x12'),_0x25e3f2,_0x2d80f7[_0xd201('0x10')][_0xd201('0x13')]);return _0x8a26e0(_0x2d80f7[_0xd201('0x10')][_0xd201('0x13')]);}logger[_0xd201('0x10')](_0xd201('0x12'),_0x25e3f2,_0x2d80f7[_0xd201('0x10')][_0xd201('0x13')]);return _0x262bc5(_0x2d80f7[_0xd201('0x10')][_0xd201('0x13')]);}else{logger[_0xd201('0x14')](_0xd201('0x12'),_0x25e3f2,_0xd201('0xc'));_0x262bc5(_0x2d80f7[_0xd201('0x15')][_0xd201('0x13')]);}})[_0xd201('0x16')](function(_0x3769ca){logger['error'](_0xd201('0x12'),_0x25e3f2,_0x3769ca);_0x8a26e0(_0x3769ca);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 01aef19..0943af9 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 _0x8c3b=['get','isAuthenticated','index','describe','show','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller'];(function(_0x548d7d,_0x2d41fc){var _0xb1c878=function(_0x570f09){while(--_0x570f09){_0x548d7d['push'](_0x548d7d['shift']());}};_0xb1c878(++_0x2d41fc);}(_0x8c3b,0x174));var _0xb8c3=function(_0x452f34,_0x299be5){_0x452f34=_0x452f34-0x0;var _0x5394a3=_0x8c3b[_0x452f34];return _0x5394a3;};'use strict';var multer=require('multer');var util=require(_0xb8c3('0x0'));var path=require('path');var timeout=require(_0xb8c3('0x1'));var express=require(_0xb8c3('0x2'));var router=express['Router']();var auth=require(_0xb8c3('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xb8c3('0x4'));var controller=require(_0xb8c3('0x5'));router[_0xb8c3('0x6')]('/',auth[_0xb8c3('0x7')](),controller[_0xb8c3('0x8')]);router[_0xb8c3('0x6')]('/describe',auth[_0xb8c3('0x7')](),controller[_0xb8c3('0x9')]);router['get']('/:id',auth[_0xb8c3('0x7')](),controller[_0xb8c3('0xa')]);router['post']('/',auth[_0xb8c3('0x7')](),controller[_0xb8c3('0xb')]);router[_0xb8c3('0xc')](_0xb8c3('0xd'),auth[_0xb8c3('0x7')](),controller[_0xb8c3('0xe')]);router[_0xb8c3('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xb8c3('0x10')]);module[_0xb8c3('0x11')]=router; \ No newline at end of file +var _0x7c03=['/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','/describe','isAuthenticated','describe','post','create','put'];(function(_0x475b7d,_0x3e1f95){var _0x2ad527=function(_0x191883){while(--_0x191883){_0x475b7d['push'](_0x475b7d['shift']());}};_0x2ad527(++_0x3e1f95);}(_0x7c03,0x193));var _0x37c0=function(_0x305665,_0x43c173){_0x305665=_0x305665-0x0;var _0x24da8c=_0x7c03[_0x305665];return _0x24da8c;};'use strict';var multer=require(_0x37c0('0x0'));var util=require(_0x37c0('0x1'));var path=require(_0x37c0('0x2'));var timeout=require(_0x37c0('0x3'));var express=require(_0x37c0('0x4'));var router=express[_0x37c0('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x37c0('0x6'));var config=require(_0x37c0('0x7'));var controller=require(_0x37c0('0x8'));router[_0x37c0('0x9')]('/',auth['isAuthenticated'](),controller[_0x37c0('0xa')]);router[_0x37c0('0x9')](_0x37c0('0xb'),auth[_0x37c0('0xc')](),controller[_0x37c0('0xd')]);router[_0x37c0('0x9')]('/:id',auth[_0x37c0('0xc')](),controller['show']);router[_0x37c0('0xe')]('/',auth[_0x37c0('0xc')](),controller[_0x37c0('0xf')]);router[_0x37c0('0x10')](_0x37c0('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x37c0('0x12')](_0x37c0('0x11'),auth[_0x37c0('0xc')](),controller[_0x37c0('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 c3a6e8d..4c25d77 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 _0x2242=['exports','STRING','long','sequelize'];(function(_0x4d9403,_0x33c5f0){var _0x5eef11=function(_0x50bb5c){while(--_0x50bb5c){_0x4d9403['push'](_0x4d9403['shift']());}};_0x5eef11(++_0x33c5f0);}(_0x2242,0x1a3));var _0x2224=function(_0x5d3060,_0x11ebda){_0x5d3060=_0x5d3060-0x0;var _0x37bde5=_0x2242[_0x5d3060];return _0x37bde5;};'use strict';var Sequelize=require(_0x2224('0x0'));module[_0x2224('0x1')]={'question':{'type':Sequelize[_0x2224('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x2224('0x3'))},'membername':{'type':Sequelize[_0x2224('0x2')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x2224('0x2')]},'uniqueid':{'type':Sequelize[_0x2224('0x2')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x2224('0x2')]},'questionId':{'type':Sequelize[_0x2224('0x2')]}}; \ No newline at end of file +var _0x7914=['TEXT','long','STRING','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7914,0x107));var _0x4791=function(_0x146c96,_0x53409f){_0x146c96=_0x146c96-0x0;var _0xa9b210=_0x7914[_0x146c96];return _0xa9b210;};'use strict';var Sequelize=require(_0x4791('0x0'));module[_0x4791('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0x4791('0x2')](_0x4791('0x3'))},'membername':{'type':Sequelize[_0x4791('0x4')]},'projectname':{'type':Sequelize[_0x4791('0x4')]},'queue':{'type':Sequelize[_0x4791('0x4')]},'uniqueid':{'type':Sequelize[_0x4791('0x4')]},'calleridname':{'type':Sequelize[_0x4791('0x4')]},'calleridnum':{'type':Sequelize[_0x4791('0x4')]},'questionId':{'type':Sequelize[_0x4791('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index e6e3544..7d4e1b8 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 _0x1e0b=['where','merge','map','key','VIRTUAL','field','options','findAll','rows','catch','params','includeAll','include','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','util','to-csv','ejs','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','save','update','then','sendStatus','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','filter'];(function(_0x14a8c8,_0x3541c4){var _0x1678e9=function(_0x4489b9){while(--_0x4489b9){_0x14a8c8['push'](_0x14a8c8['shift']());}};_0x1678e9(++_0x3541c4);}(_0x1e0b,0x19c));var _0xb1e0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1e0b[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require(_0xb1e0('0x0'));var emlformat=require(_0xb1e0('0x1'));var rimraf=require(_0xb1e0('0x2'));var zipdir=require(_0xb1e0('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb1e0('0x4'));var BPromise=require(_0xb1e0('0x5'));var Mustache=require('mustache');var util=require(_0xb1e0('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb1e0('0x7'));var ejs=require(_0xb1e0('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb1e0('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb1e0('0xa'));var toCsv=require(_0xb1e0('0x7'));var querystring=require('querystring');var Papa=require(_0xb1e0('0xb'));var Redis=require(_0xb1e0('0xc'));var authService=require(_0xb1e0('0xd'));var qs=require(_0xb1e0('0xe'));var hardwareService=require(_0xb1e0('0xf'));var logger=require(_0xb1e0('0x10'))(_0xb1e0('0x11'));var utils=require('../../config/utils');var config=require(_0xb1e0('0x12'));var db=require(_0xb1e0('0x13'))['db'];function respondWithStatusCode(_0x45476b,_0x4199f4){_0x4199f4=_0x4199f4||0xcc;return function(_0x2a59bf){if(_0x2a59bf){return _0x45476b['sendStatus'](_0x4199f4);}return _0x45476b[_0xb1e0('0x14')](_0x4199f4)[_0xb1e0('0x15')]();};}function respondWithResult(_0x2d2b6c,_0xb4734){_0xb4734=_0xb4734||0xc8;return function(_0x317364){if(_0x317364){return _0x2d2b6c[_0xb1e0('0x14')](_0xb4734)[_0xb1e0('0x16')](_0x317364);}};}function respondWithFilteredResult(_0x177fcd,_0x2b5fc3){return function(_0x5aef3c){if(_0x5aef3c){var _0x505a28=_0x5aef3c[_0xb1e0('0x17')],_0x3942aa=_0x2b5fc3['offset'],_0x2dd422=_0x2b5fc3[_0xb1e0('0x18')]+_0x2b5fc3[_0xb1e0('0x19')],_0x1e5953;if(_0x2dd422>=_0x505a28){_0x2dd422=_0x505a28;_0x1e5953=0xc8;}else{_0x1e5953=0xce;}_0x177fcd['status'](_0x1e5953);return _0x177fcd[_0xb1e0('0x1a')](_0xb1e0('0x1b'),_0x3942aa+'-'+_0x2dd422+'/'+_0x505a28)[_0xb1e0('0x16')](_0x5aef3c);}return null;};}function patchUpdates(_0x32fc2b){return function(_0x47879c){try{jsonpatch['apply'](_0x47879c,_0x32fc2b,!![]);}catch(_0x5c9f7f){return BPromise['reject'](_0x5c9f7f);}return _0x47879c[_0xb1e0('0x1c')]();};}function saveUpdates(_0x507ad6,_0x32ea83){return function(_0xe8326f){if(_0xe8326f){return _0xe8326f[_0xb1e0('0x1d')](_0x507ad6)[_0xb1e0('0x1e')](function(_0x1e5fca){return _0x1e5fca;});}return null;};}function removeEntity(_0x104644,_0x1a36f0){return function(_0x1fc757){if(_0x1fc757){return _0x1fc757['destroy']()[_0xb1e0('0x1e')](function(){_0x104644[_0xb1e0('0x14')](0xcc)[_0xb1e0('0x15')]();});}};}function handleEntityNotFound(_0x55e342,_0x50fbc9){return function(_0xd469c5){if(!_0xd469c5){_0x55e342[_0xb1e0('0x1f')](0x194);}return _0xd469c5;};}function handleError(_0xd10a13,_0x3d2559){_0x3d2559=_0x3d2559||0x1f4;return function(_0x20afc7){logger[_0xb1e0('0x20')](_0x20afc7[_0xb1e0('0x21')]);if(_0x20afc7[_0xb1e0('0x22')]){delete _0x20afc7[_0xb1e0('0x22')];}_0xd10a13['status'](_0x3d2559)[_0xb1e0('0x23')](_0x20afc7);};}exports[_0xb1e0('0x24')]=function(_0x408237,_0x52da7e){var _0x3aab07={},_0x5852a8={},_0xf7f54a={'count':0x0,'rows':[]};var _0x1601dc=db[_0xb1e0('0x25')][_0xb1e0('0x26')];_0x5852a8[_0xb1e0('0x27')]=_[_0xb1e0('0x28')](_0x1601dc);_0x5852a8[_0xb1e0('0x29')]=_[_0xb1e0('0x28')](_0x408237['query']);_0x5852a8[_0xb1e0('0x2a')]=_[_0xb1e0('0x2b')](_0x5852a8[_0xb1e0('0x27')],_0x5852a8[_0xb1e0('0x29')]);_0x3aab07[_0xb1e0('0x2c')]=_[_0xb1e0('0x2b')](_0x5852a8[_0xb1e0('0x27')],qs[_0xb1e0('0x2d')](_0x408237[_0xb1e0('0x29')]['fields']));_0x3aab07[_0xb1e0('0x2c')]=_0x3aab07[_0xb1e0('0x2c')][_0xb1e0('0x2e')]?_0x3aab07[_0xb1e0('0x2c')]:_0x5852a8[_0xb1e0('0x27')];if(!_0x408237[_0xb1e0('0x29')]['hasOwnProperty'](_0xb1e0('0x2f'))){_0x3aab07['limit']=qs[_0xb1e0('0x19')](_0x408237[_0xb1e0('0x29')][_0xb1e0('0x19')]);_0x3aab07[_0xb1e0('0x18')]=qs[_0xb1e0('0x18')](_0x408237[_0xb1e0('0x29')]['offset']);}_0x3aab07['order']=qs[_0xb1e0('0x30')](_0x408237[_0xb1e0('0x29')][_0xb1e0('0x30')]);_0x3aab07['where']=qs[_0xb1e0('0x2a')](_['pick'](_0x408237[_0xb1e0('0x29')],_0x5852a8[_0xb1e0('0x2a')]));if(_0x408237[_0xb1e0('0x29')][_0xb1e0('0x31')]){_0x3aab07[_0xb1e0('0x32')]=_[_0xb1e0('0x33')](_0x3aab07[_0xb1e0('0x32')],{'$or':_[_0xb1e0('0x34')](_0x1601dc,function(_0x30e203){if(_0x30e203['type'][_0xb1e0('0x35')]!==_0xb1e0('0x36')){var _0x56d85a={};_0x56d85a[_0x30e203[_0xb1e0('0x37')]]={'$like':'%'+_0x408237[_0xb1e0('0x29')][_0xb1e0('0x31')]+'%'};return _0x56d85a;}})});}_0x3aab07=_['merge']({},_0x3aab07,_0x408237[_0xb1e0('0x38')]);var _0x3ecdb5={'where':_0x3aab07['where']};return db[_0xb1e0('0x25')]['count'](_0x3ecdb5)[_0xb1e0('0x1e')](function(_0x4f8d5b){_0xf7f54a[_0xb1e0('0x17')]=_0x4f8d5b;if(_0x408237['query']['includeAll']){_0x3aab07['include']=[{'all':!![]}];}return db[_0xb1e0('0x25')][_0xb1e0('0x39')](_0x3aab07);})[_0xb1e0('0x1e')](function(_0x2e5ebf){_0xf7f54a[_0xb1e0('0x3a')]=_0x2e5ebf;return _0xf7f54a;})[_0xb1e0('0x1e')](respondWithFilteredResult(_0x52da7e,_0x3aab07))[_0xb1e0('0x3b')](handleError(_0x52da7e,null));};exports['show']=function(_0x25b8ca,_0x177ca5){var _0x4aa9be={'raw':!![],'where':{'id':_0x25b8ca[_0xb1e0('0x3c')]['id']}},_0x3f2c15={};_0x3f2c15['model']=_[_0xb1e0('0x28')](db[_0xb1e0('0x25')][_0xb1e0('0x26')]);_0x3f2c15[_0xb1e0('0x29')]=_[_0xb1e0('0x28')](_0x25b8ca[_0xb1e0('0x29')]);_0x3f2c15[_0xb1e0('0x2a')]=_['intersection'](_0x3f2c15[_0xb1e0('0x27')],_0x3f2c15['query']);_0x4aa9be[_0xb1e0('0x2c')]=_[_0xb1e0('0x2b')](_0x3f2c15[_0xb1e0('0x27')],qs['fields'](_0x25b8ca[_0xb1e0('0x29')]['fields']));_0x4aa9be['attributes']=_0x4aa9be['attributes'][_0xb1e0('0x2e')]?_0x4aa9be['attributes']:_0x3f2c15['model'];if(_0x25b8ca[_0xb1e0('0x29')][_0xb1e0('0x3d')]){_0x4aa9be[_0xb1e0('0x3e')]=[{'all':!![]}];}_0x4aa9be=_[_0xb1e0('0x33')]({},_0x4aa9be,_0x25b8ca[_0xb1e0('0x38')]);return db['JscriptyQuestionReport']['find'](_0x4aa9be)['then'](handleEntityNotFound(_0x177ca5,null))[_0xb1e0('0x1e')](respondWithResult(_0x177ca5,null))[_0xb1e0('0x3b')](handleError(_0x177ca5,null));};exports[_0xb1e0('0x3f')]=function(_0x4053e1,_0x1bd7fc){return db[_0xb1e0('0x25')][_0xb1e0('0x3f')](_0x4053e1[_0xb1e0('0x40')],{})['then'](respondWithResult(_0x1bd7fc,0xc9))[_0xb1e0('0x3b')](handleError(_0x1bd7fc,null));};exports[_0xb1e0('0x1d')]=function(_0x48b99e,_0x13cb69){if(_0x48b99e['body']['id']){delete _0x48b99e[_0xb1e0('0x40')]['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0x48b99e[_0xb1e0('0x3c')]['id']}})[_0xb1e0('0x1e')](handleEntityNotFound(_0x13cb69,null))[_0xb1e0('0x1e')](saveUpdates(_0x48b99e[_0xb1e0('0x40')],null))[_0xb1e0('0x1e')](respondWithResult(_0x13cb69,null))[_0xb1e0('0x3b')](handleError(_0x13cb69,null));};exports['destroy']=function(_0x563ecf,_0x15c41b){return db[_0xb1e0('0x25')]['find']({'where':{'id':_0x563ecf['params']['id']}})[_0xb1e0('0x1e')](handleEntityNotFound(_0x15c41b,null))[_0xb1e0('0x1e')](removeEntity(_0x15c41b,null))[_0xb1e0('0x3b')](handleError(_0x15c41b,null));};exports[_0xb1e0('0x41')]=function(_0x5dc9c4,_0x336733){return db[_0xb1e0('0x25')][_0xb1e0('0x41')]()[_0xb1e0('0x1e')](respondWithResult(_0x336733,null))[_0xb1e0('0x3b')](handleError(_0x336733,null));}; \ No newline at end of file +var _0xf2e0=['api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','Content-Range','apply','reject','update','destroy','then','end','stack','name','JscriptyQuestionReport','keys','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','where','filters','pick','merge','map','type','key','VIRTUAL','field','includeAll','catch','show','params','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger'];(function(_0x3a060a,_0xf8626d){var _0x45a20c=function(_0xa73fce){while(--_0xa73fce){_0x3a060a['push'](_0x3a060a['shift']());}};_0x45a20c(++_0xf8626d);}(_0xf2e0,0x143));var _0x0f2e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xf2e0[_0x5447fd];return _0x15b28a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0f2e('0x0'));var rimraf=require(_0x0f2e('0x1'));var zipdir=require(_0x0f2e('0x2'));var jsonpatch=require(_0x0f2e('0x3'));var rp=require(_0x0f2e('0x4'));var moment=require(_0x0f2e('0x5'));var BPromise=require(_0x0f2e('0x6'));var Mustache=require(_0x0f2e('0x7'));var util=require(_0x0f2e('0x8'));var path=require(_0x0f2e('0x9'));var sox=require('sox');var csv=require(_0x0f2e('0xa'));var ejs=require(_0x0f2e('0xb'));var fs=require('fs');var _=require(_0x0f2e('0xc'));var squel=require(_0x0f2e('0xd'));var crypto=require(_0x0f2e('0xe'));var jsforce=require(_0x0f2e('0xf'));var deskjs=require(_0x0f2e('0x10'));var toCsv=require(_0x0f2e('0xa'));var querystring=require(_0x0f2e('0x11'));var Papa=require(_0x0f2e('0x12'));var Redis=require('ioredis');var authService=require(_0x0f2e('0x13'));var qs=require(_0x0f2e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f2e('0x15'))(_0x0f2e('0x16'));var utils=require(_0x0f2e('0x17'));var config=require(_0x0f2e('0x18'));var db=require(_0x0f2e('0x19'))['db'];function respondWithStatusCode(_0x5ee93b,_0x73ef9a){_0x73ef9a=_0x73ef9a||0xcc;return function(_0x14bada){if(_0x14bada){return _0x5ee93b['sendStatus'](_0x73ef9a);}return _0x5ee93b[_0x0f2e('0x1a')](_0x73ef9a)['end']();};}function respondWithResult(_0x38aa77,_0x5544f8){_0x5544f8=_0x5544f8||0xc8;return function(_0x3a7aae){if(_0x3a7aae){return _0x38aa77[_0x0f2e('0x1a')](_0x5544f8)[_0x0f2e('0x1b')](_0x3a7aae);}};}function respondWithFilteredResult(_0x187cd4,_0xa609be){return function(_0x5c6c22){if(_0x5c6c22){var _0xf40a74=_0x5c6c22[_0x0f2e('0x1c')],_0x4b983a=_0xa609be[_0x0f2e('0x1d')],_0x381fb2=_0xa609be[_0x0f2e('0x1d')]+_0xa609be[_0x0f2e('0x1e')],_0x4a9e54;if(_0x381fb2>=_0xf40a74){_0x381fb2=_0xf40a74;_0x4a9e54=0xc8;}else{_0x4a9e54=0xce;}_0x187cd4[_0x0f2e('0x1a')](_0x4a9e54);return _0x187cd4['set'](_0x0f2e('0x1f'),_0x4b983a+'-'+_0x381fb2+'/'+_0xf40a74)[_0x0f2e('0x1b')](_0x5c6c22);}return null;};}function patchUpdates(_0x4c5a6e){return function(_0x4bd9e4){try{jsonpatch[_0x0f2e('0x20')](_0x4bd9e4,_0x4c5a6e,!![]);}catch(_0x571062){return BPromise[_0x0f2e('0x21')](_0x571062);}return _0x4bd9e4['save']();};}function saveUpdates(_0x5c6511,_0x196334){return function(_0x186693){if(_0x186693){return _0x186693[_0x0f2e('0x22')](_0x5c6511)['then'](function(_0x26c274){return _0x26c274;});}return null;};}function removeEntity(_0x5d13df,_0x3b25cd){return function(_0x12856f){if(_0x12856f){return _0x12856f[_0x0f2e('0x23')]()[_0x0f2e('0x24')](function(){_0x5d13df[_0x0f2e('0x1a')](0xcc)[_0x0f2e('0x25')]();});}};}function handleEntityNotFound(_0x24d07f,_0x1b9f7d){return function(_0x43c37f){if(!_0x43c37f){_0x24d07f['sendStatus'](0x194);}return _0x43c37f;};}function handleError(_0x5597a4,_0x3e394c){_0x3e394c=_0x3e394c||0x1f4;return function(_0x3530ee){logger['error'](_0x3530ee[_0x0f2e('0x26')]);if(_0x3530ee[_0x0f2e('0x27')]){delete _0x3530ee[_0x0f2e('0x27')];}_0x5597a4[_0x0f2e('0x1a')](_0x3e394c)['send'](_0x3530ee);};}exports['index']=function(_0x29c15e,_0x4f6742){var _0xeb7bd8={},_0x2436fb={},_0x5d92e0={'count':0x0,'rows':[]};var _0x24a919=db[_0x0f2e('0x28')]['rawAttributes'];_0x2436fb['model']=_[_0x0f2e('0x29')](_0x24a919);_0x2436fb[_0x0f2e('0x2a')]=_[_0x0f2e('0x29')](_0x29c15e[_0x0f2e('0x2a')]);_0x2436fb['filters']=_[_0x0f2e('0x2b')](_0x2436fb[_0x0f2e('0x2c')],_0x2436fb[_0x0f2e('0x2a')]);_0xeb7bd8['attributes']=_[_0x0f2e('0x2b')](_0x2436fb[_0x0f2e('0x2c')],qs['fields'](_0x29c15e['query'][_0x0f2e('0x2d')]));_0xeb7bd8['attributes']=_0xeb7bd8[_0x0f2e('0x2e')]['length']?_0xeb7bd8['attributes']:_0x2436fb['model'];if(!_0x29c15e['query'][_0x0f2e('0x2f')](_0x0f2e('0x30'))){_0xeb7bd8[_0x0f2e('0x1e')]=qs[_0x0f2e('0x1e')](_0x29c15e[_0x0f2e('0x2a')]['limit']);_0xeb7bd8['offset']=qs['offset'](_0x29c15e[_0x0f2e('0x2a')][_0x0f2e('0x1d')]);}_0xeb7bd8[_0x0f2e('0x31')]=qs['sort'](_0x29c15e['query']['sort']);_0xeb7bd8[_0x0f2e('0x32')]=qs[_0x0f2e('0x33')](_[_0x0f2e('0x34')](_0x29c15e[_0x0f2e('0x2a')],_0x2436fb['filters']));if(_0x29c15e['query']['filter']){_0xeb7bd8[_0x0f2e('0x32')]=_[_0x0f2e('0x35')](_0xeb7bd8[_0x0f2e('0x32')],{'$or':_[_0x0f2e('0x36')](_0x24a919,function(_0x31f8aa){if(_0x31f8aa[_0x0f2e('0x37')][_0x0f2e('0x38')]!==_0x0f2e('0x39')){var _0x282d51={};_0x282d51[_0x31f8aa[_0x0f2e('0x3a')]]={'$like':'%'+_0x29c15e['query']['filter']+'%'};return _0x282d51;}})});}_0xeb7bd8=_['merge']({},_0xeb7bd8,_0x29c15e['options']);var _0x449407={'where':_0xeb7bd8[_0x0f2e('0x32')]};return db['JscriptyQuestionReport']['count'](_0x449407)[_0x0f2e('0x24')](function(_0x44b45c){_0x5d92e0[_0x0f2e('0x1c')]=_0x44b45c;if(_0x29c15e['query'][_0x0f2e('0x3b')]){_0xeb7bd8['include']=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0xeb7bd8);})[_0x0f2e('0x24')](function(_0x5da726){_0x5d92e0['rows']=_0x5da726;return _0x5d92e0;})['then'](respondWithFilteredResult(_0x4f6742,_0xeb7bd8))[_0x0f2e('0x3c')](handleError(_0x4f6742,null));};exports[_0x0f2e('0x3d')]=function(_0x6539cf,_0x4bb2b5){var _0x2c076c={'raw':!![],'where':{'id':_0x6539cf[_0x0f2e('0x3e')]['id']}},_0x1c70e1={};_0x1c70e1['model']=_[_0x0f2e('0x29')](db[_0x0f2e('0x28')]['rawAttributes']);_0x1c70e1[_0x0f2e('0x2a')]=_[_0x0f2e('0x29')](_0x6539cf['query']);_0x1c70e1[_0x0f2e('0x33')]=_[_0x0f2e('0x2b')](_0x1c70e1[_0x0f2e('0x2c')],_0x1c70e1[_0x0f2e('0x2a')]);_0x2c076c['attributes']=_[_0x0f2e('0x2b')](_0x1c70e1[_0x0f2e('0x2c')],qs[_0x0f2e('0x2d')](_0x6539cf[_0x0f2e('0x2a')]['fields']));_0x2c076c[_0x0f2e('0x2e')]=_0x2c076c[_0x0f2e('0x2e')]['length']?_0x2c076c[_0x0f2e('0x2e')]:_0x1c70e1[_0x0f2e('0x2c')];if(_0x6539cf['query'][_0x0f2e('0x3b')]){_0x2c076c[_0x0f2e('0x3f')]=[{'all':!![]}];}_0x2c076c=_[_0x0f2e('0x35')]({},_0x2c076c,_0x6539cf[_0x0f2e('0x40')]);return db['JscriptyQuestionReport'][_0x0f2e('0x41')](_0x2c076c)[_0x0f2e('0x24')](handleEntityNotFound(_0x4bb2b5,null))['then'](respondWithResult(_0x4bb2b5,null))[_0x0f2e('0x3c')](handleError(_0x4bb2b5,null));};exports[_0x0f2e('0x42')]=function(_0x565774,_0x288152){return db[_0x0f2e('0x28')][_0x0f2e('0x42')](_0x565774[_0x0f2e('0x43')],{})[_0x0f2e('0x24')](respondWithResult(_0x288152,0xc9))[_0x0f2e('0x3c')](handleError(_0x288152,null));};exports[_0x0f2e('0x22')]=function(_0xc71fda,_0x2675ba){if(_0xc71fda[_0x0f2e('0x43')]['id']){delete _0xc71fda[_0x0f2e('0x43')]['id'];}return db['JscriptyQuestionReport'][_0x0f2e('0x41')]({'where':{'id':_0xc71fda[_0x0f2e('0x3e')]['id']}})[_0x0f2e('0x24')](handleEntityNotFound(_0x2675ba,null))[_0x0f2e('0x24')](saveUpdates(_0xc71fda[_0x0f2e('0x43')],null))[_0x0f2e('0x24')](respondWithResult(_0x2675ba,null))['catch'](handleError(_0x2675ba,null));};exports[_0x0f2e('0x23')]=function(_0x3fe302,_0x31d180){return db[_0x0f2e('0x28')]['find']({'where':{'id':_0x3fe302['params']['id']}})[_0x0f2e('0x24')](handleEntityNotFound(_0x31d180,null))[_0x0f2e('0x24')](removeEntity(_0x31d180,null))[_0x0f2e('0x3c')](handleError(_0x31d180,null));};exports[_0x0f2e('0x44')]=function(_0x524ca3,_0x10f45d){return db['JscriptyQuestionReport']['describe']()['then'](respondWithResult(_0x10f45d,null))[_0x0f2e('0x3c')](handleError(_0x10f45d,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index e9ba9e8..06a94ec 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 _0x81ad=['path','rimraf','../../config/environment','exports','define','JscriptyQuestionReport','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x39e14f,_0x240ee4){var _0x16f8fa=function(_0x3fe532){while(--_0x3fe532){_0x39e14f['push'](_0x39e14f['shift']());}};_0x16f8fa(++_0x240ee4);}(_0x81ad,0xab));var _0xd81a=function(_0x39bc44,_0x1d4373){_0x39bc44=_0x39bc44-0x0;var _0x2916d8=_0x81ad[_0x39bc44];return _0x2916d8;};'use strict';var _=require(_0xd81a('0x0'));var util=require(_0xd81a('0x1'));var logger=require(_0xd81a('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd81a('0x3'));var rp=require(_0xd81a('0x4'));var fs=require('fs');var path=require(_0xd81a('0x5'));var rimraf=require(_0xd81a('0x6'));var config=require(_0xd81a('0x7'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xd81a('0x8')]=function(_0x559aff,_0x791a0c){return _0x559aff[_0xd81a('0x9')](_0xd81a('0xa'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2931=['JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x2931,0x115));var _0x1293=function(_0x460ede,_0x50c01d){_0x460ede=_0x460ede-0x0;var _0x3f64e7=_0x2931[_0x460ede];return _0x3f64e7;};'use strict';var _=require(_0x1293('0x0'));var util=require(_0x1293('0x1'));var logger=require(_0x1293('0x2'))('api');var moment=require(_0x1293('0x3'));var BPromise=require('bluebird');var rp=require(_0x1293('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1293('0x5'));var config=require(_0x1293('0x6'));var attributes=require(_0x1293('0x7'));module[_0x1293('0x8')]=function(_0x1000ad,_0x2d261d){return _0x1000ad['define'](_0x1293('0x9'),attributes,{'tableName':_0x1293('0xa'),'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 a06f5bc..6af229b 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 _0xd65a=['../../config/environment','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x147398,_0x5c425a){var _0x48e268=function(_0x2abd5d){while(--_0x2abd5d){_0x147398['push'](_0x147398['shift']());}};_0x48e268(++_0x5c425a);}(_0xd65a,0xb7));var _0xad65=function(_0x586aa0,_0x538856){_0x586aa0=_0x586aa0-0x0;var _0x333010=_0xd65a[_0x586aa0];return _0x333010;};'use strict';var _=require(_0xad65('0x0'));var util=require(_0xad65('0x1'));var moment=require(_0xad65('0x2'));var BPromise=require(_0xad65('0x3'));var rs=require(_0xad65('0x4'));var fs=require('fs');var Redis=require(_0xad65('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xad65('0x6'));var logger=require(_0xad65('0x7'))(_0xad65('0x8'));var config=require(_0xad65('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xad65('0xa')][_0xad65('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c357f,_0x1e1426,_0x2176f1){return new BPromise(function(_0x4b73b4,_0x17cdbd){return client[_0xad65('0xc')](_0x1c357f,_0x2176f1)[_0xad65('0xd')](function(_0x4aa35a){logger['info'](_0xad65('0xe'),_0x1e1426,_0xad65('0xf'));logger[_0xad65('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x1e1426,_0xad65('0xf'),JSON[_0xad65('0x11')](_0x4aa35a));if(_0x4aa35a[_0xad65('0x12')]){if(_0x4aa35a[_0xad65('0x12')][_0xad65('0x13')]===0x1f4){logger[_0xad65('0x12')](_0xad65('0xe'),_0x1e1426,_0x4aa35a[_0xad65('0x12')][_0xad65('0x14')]);return _0x17cdbd(_0x4aa35a[_0xad65('0x12')]['message']);}logger[_0xad65('0x12')](_0xad65('0xe'),_0x1e1426,_0x4aa35a[_0xad65('0x12')][_0xad65('0x14')]);return _0x4b73b4(_0x4aa35a['error'][_0xad65('0x14')]);}else{logger[_0xad65('0x15')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1e1426,_0xad65('0xf'));_0x4b73b4(_0x4aa35a[_0xad65('0x16')][_0xad65('0x14')]);}})[_0xad65('0x17')](function(_0x210d73){logger[_0xad65('0x12')](_0xad65('0xe'),_0x1e1426,_0x210d73);_0x17cdbd(_0x210d73);});});} \ No newline at end of file +var _0x1f5b=['message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptyQuestionReport,\x20%s,\x20%s'];(function(_0x45b5ab,_0x5f2cfc){var _0x3392ea=function(_0x588f83){while(--_0x588f83){_0x45b5ab['push'](_0x45b5ab['shift']());}};_0x3392ea(++_0x5f2cfc);}(_0x1f5b,0x133));var _0xb1f5=function(_0x26211e,_0x2b75fa){_0x26211e=_0x26211e-0x0;var _0x5e2598=_0x1f5b[_0x26211e];return _0x5e2598;};'use strict';var _=require(_0xb1f5('0x0'));var util=require(_0xb1f5('0x1'));var moment=require('moment');var BPromise=require(_0xb1f5('0x2'));var rs=require(_0xb1f5('0x3'));var fs=require('fs');var Redis=require(_0xb1f5('0x4'));var db=require(_0xb1f5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb1f5('0x6'))(_0xb1f5('0x7'));var config=require(_0xb1f5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb1f5('0x9')][_0xb1f5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x97396e,_0x3c64a5,_0xb2865a){return new BPromise(function(_0x448359,_0x48a085){return client[_0xb1f5('0xb')](_0x97396e,_0xb2865a)['then'](function(_0x171c23){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x3c64a5,'request\x20sent');logger[_0xb1f5('0xc')](_0xb1f5('0xd'),_0x3c64a5,'request\x20sent',JSON['stringify'](_0x171c23));if(_0x171c23[_0xb1f5('0xe')]){if(_0x171c23[_0xb1f5('0xe')][_0xb1f5('0xf')]===0x1f4){logger[_0xb1f5('0xe')](_0xb1f5('0x10'),_0x3c64a5,_0x171c23[_0xb1f5('0xe')][_0xb1f5('0x11')]);return _0x48a085(_0x171c23[_0xb1f5('0xe')][_0xb1f5('0x11')]);}logger[_0xb1f5('0xe')](_0xb1f5('0x10'),_0x3c64a5,_0x171c23['error']['message']);return _0x448359(_0x171c23[_0xb1f5('0xe')][_0xb1f5('0x11')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x3c64a5,'request\x20sent');_0x448359(_0x171c23['result'][_0xb1f5('0x11')]);}})['catch'](function(_0x267e5a){logger[_0xb1f5('0xe')](_0xb1f5('0x10'),_0x3c64a5,_0x267e5a);_0x48a085(_0x267e5a);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 9998855..2c3c9a8 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 _0x101c=['path','connect-timeout','express','Router','../../components/auth/service','./jscriptySessionReport.controller','isAuthenticated','index','get','/:id','show','getQuestions','post','put','destroy','exports','multer','util'];(function(_0x2a143b,_0x3c1ed7){var _0x1a7607=function(_0x3aa9e8){while(--_0x3aa9e8){_0x2a143b['push'](_0x2a143b['shift']());}};_0x1a7607(++_0x3c1ed7);}(_0x101c,0xe8));var _0xc101=function(_0x5b1aed,_0x322c17){_0x5b1aed=_0x5b1aed-0x0;var _0x26add8=_0x101c[_0x5b1aed];return _0x26add8;};'use strict';var multer=require(_0xc101('0x0'));var util=require(_0xc101('0x1'));var path=require(_0xc101('0x2'));var timeout=require(_0xc101('0x3'));var express=require(_0xc101('0x4'));var router=express[_0xc101('0x5')]();var auth=require(_0xc101('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc101('0x7'));router['get']('/',auth[_0xc101('0x8')](),controller[_0xc101('0x9')]);router[_0xc101('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xc101('0xa')](_0xc101('0xb'),auth[_0xc101('0x8')](),controller[_0xc101('0xc')]);router[_0xc101('0xa')]('/:id/questions',auth['isAuthenticated'](),controller[_0xc101('0xd')]);router[_0xc101('0xe')]('/',auth[_0xc101('0x8')](),controller['create']);router[_0xc101('0xf')](_0xc101('0xb'),auth[_0xc101('0x8')](),controller['update']);router['delete'](_0xc101('0xb'),auth[_0xc101('0x8')](),controller[_0xc101('0x10')]);module[_0xc101('0x11')]=router; \ No newline at end of file +var _0x7c77=['/:id/questions','getQuestions','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7c77,0x1bd));var _0x77c7=function(_0x29dee4,_0x4f8573){_0x29dee4=_0x29dee4-0x0;var _0x303e61=_0x7c77[_0x29dee4];return _0x303e61;};'use strict';var multer=require(_0x77c7('0x0'));var util=require(_0x77c7('0x1'));var path=require(_0x77c7('0x2'));var timeout=require(_0x77c7('0x3'));var express=require(_0x77c7('0x4'));var router=express[_0x77c7('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x77c7('0x6'));var config=require(_0x77c7('0x7'));var controller=require('./jscriptySessionReport.controller');router[_0x77c7('0x8')]('/',auth[_0x77c7('0x9')](),controller[_0x77c7('0xa')]);router[_0x77c7('0x8')](_0x77c7('0xb'),auth['isAuthenticated'](),controller[_0x77c7('0xc')]);router[_0x77c7('0x8')](_0x77c7('0xd'),auth[_0x77c7('0x9')](),controller[_0x77c7('0xe')]);router[_0x77c7('0x8')](_0x77c7('0xf'),auth[_0x77c7('0x9')](),controller[_0x77c7('0x10')]);router[_0x77c7('0x11')]('/',auth['isAuthenticated'](),controller[_0x77c7('0x12')]);router['put']('/:id',auth[_0x77c7('0x9')](),controller[_0x77c7('0x13')]);router[_0x77c7('0x14')](_0x77c7('0xd'),auth[_0x77c7('0x9')](),controller[_0x77c7('0x15')]);module[_0x77c7('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index a75b1dd..9d2a4d5 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 _0xd086=['STRING','BOOLEAN','sequelize','exports','DATE','setDataValue','starttime','endtime','format'];(function(_0x343e70,_0xe5f373){var _0x2742fd=function(_0x27e56e){while(--_0x27e56e){_0x343e70['push'](_0x343e70['shift']());}};_0x2742fd(++_0xe5f373);}(_0xd086,0x1df));var _0x6d08=function(_0x38bc1a,_0x1e0da3){_0x38bc1a=_0x38bc1a-0x0;var _0x3ef1c9=_0xd086[_0x38bc1a];return _0x3ef1c9;};'use strict';var moment=require('moment');var Sequelize=require(_0x6d08('0x0'));module[_0x6d08('0x1')]={'starttime':{'type':Sequelize[_0x6d08('0x2')],'set':function(_0x2c75e4){this[_0x6d08('0x3')](_0x6d08('0x4'),_0x2c75e4);this[_0x6d08('0x3')](_0x6d08('0x5'),moment()[_0x6d08('0x6')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x6d08('0x7')]},'projectname':{'type':Sequelize[_0x6d08('0x7')]},'queue':{'type':Sequelize[_0x6d08('0x7')]},'uniqueid':{'type':Sequelize[_0x6d08('0x7')]},'calleridname':{'type':Sequelize[_0x6d08('0x7')]},'calleridnum':{'type':Sequelize[_0x6d08('0x7')]},'completed':{'type':Sequelize[_0x6d08('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0xe7c3=['YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','moment','sequelize','exports','setDataValue','endtime','format'];(function(_0x3541e4,_0x4dcf9a){var _0x3ca5d9=function(_0x3eaac2){while(--_0x3eaac2){_0x3541e4['push'](_0x3541e4['shift']());}};_0x3ca5d9(++_0x4dcf9a);}(_0xe7c3,0x1a8));var _0x3e7c=function(_0x2b4736,_0x5079b7){_0x2b4736=_0x2b4736-0x0;var _0x357cd0=_0xe7c3[_0x2b4736];return _0x357cd0;};'use strict';var moment=require(_0x3e7c('0x0'));var Sequelize=require(_0x3e7c('0x1'));module[_0x3e7c('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x561867){this[_0x3e7c('0x3')]('starttime',_0x561867);this['setDataValue'](_0x3e7c('0x4'),moment()[_0x3e7c('0x5')](_0x3e7c('0x6')));}},'endtime':{'type':Sequelize[_0x3e7c('0x7')]},'membername':{'type':Sequelize[_0x3e7c('0x8')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x3e7c('0x8')]},'calleridnum':{'type':Sequelize[_0x3e7c('0x8')]},'completed':{'type':Sequelize[_0x3e7c('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 75c5ccf..842fb9e 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 _0xc0d2=['intersection','includeAll','options','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','json','reject','update','then','destroy','end','stack','send','JscriptySessionReport','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','field','filter','include','findAll','rows','catch','show','params'];(function(_0x1d4e21,_0x4e8096){var _0x178fef=function(_0x515879){while(--_0x515879){_0x1d4e21['push'](_0x1d4e21['shift']());}};_0x178fef(++_0x4e8096);}(_0xc0d2,0x98));var _0x2c0d=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xc0d2[_0x580576];return _0x3f55a0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2c0d('0x0'));var rimraf=require(_0x2c0d('0x1'));var zipdir=require(_0x2c0d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2c0d('0x3'));var BPromise=require(_0x2c0d('0x4'));var Mustache=require('mustache');var util=require(_0x2c0d('0x5'));var path=require('path');var sox=require(_0x2c0d('0x6'));var csv=require(_0x2c0d('0x7'));var ejs=require(_0x2c0d('0x8'));var fs=require('fs');var _=require(_0x2c0d('0x9'));var squel=require(_0x2c0d('0xa'));var crypto=require(_0x2c0d('0xb'));var jsforce=require(_0x2c0d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2c0d('0x7'));var querystring=require('querystring');var Papa=require(_0x2c0d('0xd'));var Redis=require(_0x2c0d('0xe'));var authService=require(_0x2c0d('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c0d('0x10'))('api');var utils=require(_0x2c0d('0x11'));var config=require(_0x2c0d('0x12'));var db=require(_0x2c0d('0x13'))['db'];function respondWithStatusCode(_0x162aef,_0x282b5d){_0x282b5d=_0x282b5d||0xcc;return function(_0x495564){if(_0x495564){return _0x162aef[_0x2c0d('0x14')](_0x282b5d);}return _0x162aef[_0x2c0d('0x15')](_0x282b5d)['end']();};}function respondWithResult(_0xd8bc08,_0x1c76df){_0x1c76df=_0x1c76df||0xc8;return function(_0x2c4038){if(_0x2c4038){return _0xd8bc08[_0x2c0d('0x15')](_0x1c76df)['json'](_0x2c4038);}};}function respondWithFilteredResult(_0x38292e,_0xace6a0){return function(_0x500f73){if(_0x500f73){var _0x26ccd5=_0x500f73[_0x2c0d('0x16')],_0xbc5c39=_0xace6a0['offset'],_0x2ba65a=_0xace6a0[_0x2c0d('0x17')]+_0xace6a0[_0x2c0d('0x18')],_0x1f089c;if(_0x2ba65a>=_0x26ccd5){_0x2ba65a=_0x26ccd5;_0x1f089c=0xc8;}else{_0x1f089c=0xce;}_0x38292e[_0x2c0d('0x15')](_0x1f089c);return _0x38292e[_0x2c0d('0x19')]('Content-Range',_0xbc5c39+'-'+_0x2ba65a+'/'+_0x26ccd5)[_0x2c0d('0x1a')](_0x500f73);}return null;};}function patchUpdates(_0x787d1){return function(_0x1416f3){try{jsonpatch['apply'](_0x1416f3,_0x787d1,!![]);}catch(_0x5897b9){return BPromise[_0x2c0d('0x1b')](_0x5897b9);}return _0x1416f3['save']();};}function saveUpdates(_0x389f4d,_0x576653){return function(_0x395e75){if(_0x395e75){return _0x395e75[_0x2c0d('0x1c')](_0x389f4d)[_0x2c0d('0x1d')](function(_0xdf7cf8){return _0xdf7cf8;});}return null;};}function removeEntity(_0x359525,_0x49d183){return function(_0x5820a8){if(_0x5820a8){return _0x5820a8[_0x2c0d('0x1e')]()[_0x2c0d('0x1d')](function(){_0x359525['status'](0xcc)[_0x2c0d('0x1f')]();});}};}function handleEntityNotFound(_0x23f320,_0x19b105){return function(_0x475d2c){if(!_0x475d2c){_0x23f320['sendStatus'](0x194);}return _0x475d2c;};}function handleError(_0x333569,_0xac5202){_0xac5202=_0xac5202||0x1f4;return function(_0x30dbf0){logger['error'](_0x30dbf0[_0x2c0d('0x20')]);if(_0x30dbf0['name']){delete _0x30dbf0['name'];}_0x333569[_0x2c0d('0x15')](_0xac5202)[_0x2c0d('0x21')](_0x30dbf0);};}exports['index']=function(_0x4cdebc,_0x4a9dc2){var _0x5660bd={},_0x391507={},_0x5218f1={'count':0x0,'rows':[]};var _0x19d8c8=db[_0x2c0d('0x22')][_0x2c0d('0x23')];_0x391507[_0x2c0d('0x24')]=_[_0x2c0d('0x25')](_0x19d8c8);_0x391507[_0x2c0d('0x26')]=_[_0x2c0d('0x25')](_0x4cdebc[_0x2c0d('0x26')]);_0x391507[_0x2c0d('0x27')]=_['intersection'](_0x391507[_0x2c0d('0x24')],_0x391507[_0x2c0d('0x26')]);_0x5660bd[_0x2c0d('0x28')]=_['intersection'](_0x391507[_0x2c0d('0x24')],qs[_0x2c0d('0x29')](_0x4cdebc['query'][_0x2c0d('0x29')]));_0x5660bd['attributes']=_0x5660bd['attributes'][_0x2c0d('0x2a')]?_0x5660bd[_0x2c0d('0x28')]:_0x391507[_0x2c0d('0x24')];if(!_0x4cdebc['query'][_0x2c0d('0x2b')](_0x2c0d('0x2c'))){_0x5660bd[_0x2c0d('0x18')]=qs[_0x2c0d('0x18')](_0x4cdebc[_0x2c0d('0x26')][_0x2c0d('0x18')]);_0x5660bd[_0x2c0d('0x17')]=qs[_0x2c0d('0x17')](_0x4cdebc[_0x2c0d('0x26')][_0x2c0d('0x17')]);}_0x5660bd[_0x2c0d('0x2d')]=qs[_0x2c0d('0x2e')](_0x4cdebc[_0x2c0d('0x26')][_0x2c0d('0x2e')]);_0x5660bd[_0x2c0d('0x2f')]=qs[_0x2c0d('0x27')](_[_0x2c0d('0x30')](_0x4cdebc[_0x2c0d('0x26')],_0x391507[_0x2c0d('0x27')]));if(_0x4cdebc[_0x2c0d('0x26')]['filter']){_0x5660bd[_0x2c0d('0x2f')]=_[_0x2c0d('0x31')](_0x5660bd[_0x2c0d('0x2f')],{'$or':_[_0x2c0d('0x32')](_0x19d8c8,function(_0x446487){if(_0x446487[_0x2c0d('0x33')][_0x2c0d('0x34')]!=='VIRTUAL'){var _0x48c11e={};_0x48c11e[_0x446487[_0x2c0d('0x35')]]={'$like':'%'+_0x4cdebc[_0x2c0d('0x26')][_0x2c0d('0x36')]+'%'};return _0x48c11e;}})});}_0x5660bd=_['merge']({},_0x5660bd,_0x4cdebc['options']);var _0x110d26={'where':_0x5660bd[_0x2c0d('0x2f')]};return db['JscriptySessionReport']['count'](_0x110d26)[_0x2c0d('0x1d')](function(_0x5d40ee){_0x5218f1['count']=_0x5d40ee;if(_0x4cdebc[_0x2c0d('0x26')]['includeAll']){_0x5660bd[_0x2c0d('0x37')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x2c0d('0x38')](_0x5660bd);})[_0x2c0d('0x1d')](function(_0x13a77e){_0x5218f1[_0x2c0d('0x39')]=_0x13a77e;return _0x5218f1;})[_0x2c0d('0x1d')](respondWithFilteredResult(_0x4a9dc2,_0x5660bd))[_0x2c0d('0x3a')](handleError(_0x4a9dc2,null));};exports[_0x2c0d('0x3b')]=function(_0x30e41a,_0x4ece19){var _0x4b8364={'raw':!![],'where':{'id':_0x30e41a[_0x2c0d('0x3c')]['id']}},_0x454ab9={};_0x454ab9[_0x2c0d('0x24')]=_[_0x2c0d('0x25')](db[_0x2c0d('0x22')][_0x2c0d('0x23')]);_0x454ab9[_0x2c0d('0x26')]=_['keys'](_0x30e41a[_0x2c0d('0x26')]);_0x454ab9['filters']=_[_0x2c0d('0x3d')](_0x454ab9[_0x2c0d('0x24')],_0x454ab9[_0x2c0d('0x26')]);_0x4b8364[_0x2c0d('0x28')]=_[_0x2c0d('0x3d')](_0x454ab9[_0x2c0d('0x24')],qs[_0x2c0d('0x29')](_0x30e41a[_0x2c0d('0x26')][_0x2c0d('0x29')]));_0x4b8364[_0x2c0d('0x28')]=_0x4b8364[_0x2c0d('0x28')]['length']?_0x4b8364[_0x2c0d('0x28')]:_0x454ab9[_0x2c0d('0x24')];if(_0x30e41a[_0x2c0d('0x26')][_0x2c0d('0x3e')]){_0x4b8364[_0x2c0d('0x37')]=[{'all':!![]}];}_0x4b8364=_[_0x2c0d('0x31')]({},_0x4b8364,_0x30e41a[_0x2c0d('0x3f')]);return db[_0x2c0d('0x22')][_0x2c0d('0x40')](_0x4b8364)[_0x2c0d('0x1d')](handleEntityNotFound(_0x4ece19,null))[_0x2c0d('0x1d')](respondWithResult(_0x4ece19,null))[_0x2c0d('0x3a')](handleError(_0x4ece19,null));};exports[_0x2c0d('0x41')]=function(_0xb5c825,_0xc7c793){return db['JscriptySessionReport'][_0x2c0d('0x41')](_0xb5c825['body'],{})[_0x2c0d('0x1d')](respondWithResult(_0xc7c793,0xc9))[_0x2c0d('0x3a')](handleError(_0xc7c793,null));};exports[_0x2c0d('0x1c')]=function(_0x272ede,_0x1ad0a8){if(_0x272ede[_0x2c0d('0x42')]['id']){delete _0x272ede[_0x2c0d('0x42')]['id'];}return db[_0x2c0d('0x22')][_0x2c0d('0x40')]({'where':{'id':_0x272ede[_0x2c0d('0x3c')]['id']}})[_0x2c0d('0x1d')](handleEntityNotFound(_0x1ad0a8,null))['then'](saveUpdates(_0x272ede[_0x2c0d('0x42')],null))['then'](respondWithResult(_0x1ad0a8,null))['catch'](handleError(_0x1ad0a8,null));};exports['destroy']=function(_0x46f80b,_0x4f2219){return db[_0x2c0d('0x22')][_0x2c0d('0x40')]({'where':{'id':_0x46f80b[_0x2c0d('0x3c')]['id']}})[_0x2c0d('0x1d')](handleEntityNotFound(_0x4f2219,null))['then'](removeEntity(_0x4f2219,null))[_0x2c0d('0x3a')](handleError(_0x4f2219,null));};exports[_0x2c0d('0x43')]=function(_0x55601e,_0xcd22ae){return db[_0x2c0d('0x22')]['describe']()[_0x2c0d('0x1d')](respondWithResult(_0xcd22ae,null))[_0x2c0d('0x3a')](handleError(_0xcd22ae,null));};exports[_0x2c0d('0x44')]=function(_0xb17895,_0x358bb2,_0x233c71){var _0x20c729={'raw':!![],'where':{}};var _0x180013={};var _0x1e0ea2={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x2c0d('0x45')]({'where':{'id':_0xb17895[_0x2c0d('0x3c')]['id']}})[_0x2c0d('0x1d')](handleEntityNotFound(_0x358bb2,null))[_0x2c0d('0x1d')](function(_0x5c17a7){if(_0x5c17a7){_0x180013['model']=_[_0x2c0d('0x25')](db[_0x2c0d('0x46')][_0x2c0d('0x23')]);_0x180013[_0x2c0d('0x26')]=_[_0x2c0d('0x25')](_0xb17895[_0x2c0d('0x26')]);_0x180013[_0x2c0d('0x27')]=_[_0x2c0d('0x3d')](_0x180013[_0x2c0d('0x24')],_0x180013[_0x2c0d('0x26')]);_0x20c729[_0x2c0d('0x28')]=_[_0x2c0d('0x3d')](_0x180013['model'],qs[_0x2c0d('0x29')](_0xb17895['query']['fields']));_0x20c729[_0x2c0d('0x28')]=_0x20c729[_0x2c0d('0x28')][_0x2c0d('0x2a')]?_0x20c729[_0x2c0d('0x28')]:_0x180013[_0x2c0d('0x24')];if(!_0xb17895[_0x2c0d('0x26')][_0x2c0d('0x2b')]('nolimit')){_0x20c729[_0x2c0d('0x18')]=qs[_0x2c0d('0x18')](_0xb17895['query'][_0x2c0d('0x18')]);_0x20c729[_0x2c0d('0x17')]=qs[_0x2c0d('0x17')](_0xb17895[_0x2c0d('0x26')]['offset']);}_0x20c729['order']=qs['sort'](_0xb17895['query'][_0x2c0d('0x2e')]);_0x20c729[_0x2c0d('0x2f')]=qs[_0x2c0d('0x27')](_[_0x2c0d('0x30')](_0xb17895[_0x2c0d('0x26')],_0x180013[_0x2c0d('0x27')]));_0x20c729['where']['SessionId']=_0x5c17a7['id'];if(_0xb17895[_0x2c0d('0x26')][_0x2c0d('0x36')]){_0x20c729[_0x2c0d('0x2f')]=_[_0x2c0d('0x31')](_0x20c729[_0x2c0d('0x2f')],{'$or':_[_0x2c0d('0x32')](_0x20c729['attributes'],function(_0x197c0d){var _0x513f52={};_0x513f52[_0x197c0d]={'$like':'%'+_0xb17895[_0x2c0d('0x26')][_0x2c0d('0x36')]+'%'};return _0x513f52;})});}_0x20c729=_[_0x2c0d('0x31')]({},_0x20c729,_0xb17895[_0x2c0d('0x3f')]);return db[_0x2c0d('0x46')][_0x2c0d('0x16')]({'where':_0x20c729['where']})[_0x2c0d('0x1d')](function(_0x3ea52e){_0x1e0ea2[_0x2c0d('0x16')]=_0x3ea52e;if(_0xb17895[_0x2c0d('0x26')]['includeAll']){_0x20c729[_0x2c0d('0x37')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x2c0d('0x38')](_0x20c729);})[_0x2c0d('0x1d')](function(_0x2c5ab5){_0x1e0ea2[_0x2c0d('0x39')]=_0x2c5ab5;return _0x1e0ea2;});}})[_0x2c0d('0x1d')](respondWithFilteredResult(_0x358bb2,_0x20c729))['catch'](handleError(_0x358bb2,null));}; \ No newline at end of file +var _0x4beb=['lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','name','send','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','type','key','VIRTUAL','field','merge','options','count','includeAll','include','JscriptySessionReport','findAll','rows','catch','show','length','find','create','body','params','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','pick','SessionId','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs'];(function(_0x190229,_0x577389){var _0xb6208a=function(_0x48a301){while(--_0x48a301){_0x190229['push'](_0x190229['shift']());}};_0xb6208a(++_0x577389);}(_0x4beb,0x17b));var _0xb4be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4beb[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xb4be('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb4be('0x1'));var zipdir=require(_0xb4be('0x2'));var jsonpatch=require(_0xb4be('0x3'));var rp=require(_0xb4be('0x4'));var moment=require(_0xb4be('0x5'));var BPromise=require(_0xb4be('0x6'));var Mustache=require('mustache');var util=require(_0xb4be('0x7'));var path=require('path');var sox=require(_0xb4be('0x8'));var csv=require(_0xb4be('0x9'));var ejs=require(_0xb4be('0xa'));var fs=require('fs');var _=require(_0xb4be('0xb'));var squel=require('squel');var crypto=require(_0xb4be('0xc'));var jsforce=require(_0xb4be('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb4be('0x9'));var querystring=require(_0xb4be('0xe'));var Papa=require(_0xb4be('0xf'));var Redis=require(_0xb4be('0x10'));var authService=require(_0xb4be('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb4be('0x12'));var logger=require(_0xb4be('0x13'))(_0xb4be('0x14'));var utils=require('../../config/utils');var config=require(_0xb4be('0x15'));var db=require(_0xb4be('0x16'))['db'];function respondWithStatusCode(_0x58ede6,_0x1cd14b){_0x1cd14b=_0x1cd14b||0xcc;return function(_0x5b182e){if(_0x5b182e){return _0x58ede6[_0xb4be('0x17')](_0x1cd14b);}return _0x58ede6[_0xb4be('0x18')](_0x1cd14b)[_0xb4be('0x19')]();};}function respondWithResult(_0x32dd0a,_0x4c72d6){_0x4c72d6=_0x4c72d6||0xc8;return function(_0x564dae){if(_0x564dae){return _0x32dd0a['status'](_0x4c72d6)[_0xb4be('0x1a')](_0x564dae);}};}function respondWithFilteredResult(_0x5e814f,_0x47b765){return function(_0x576360){if(_0x576360){var _0x4b7689=_0x576360['count'],_0xaad87d=_0x47b765[_0xb4be('0x1b')],_0x4b7ba7=_0x47b765['offset']+_0x47b765[_0xb4be('0x1c')],_0x3c39e4;if(_0x4b7ba7>=_0x4b7689){_0x4b7ba7=_0x4b7689;_0x3c39e4=0xc8;}else{_0x3c39e4=0xce;}_0x5e814f[_0xb4be('0x18')](_0x3c39e4);return _0x5e814f['set'](_0xb4be('0x1d'),_0xaad87d+'-'+_0x4b7ba7+'/'+_0x4b7689)[_0xb4be('0x1a')](_0x576360);}return null;};}function patchUpdates(_0x4484e6){return function(_0x31d4d8){try{jsonpatch[_0xb4be('0x1e')](_0x31d4d8,_0x4484e6,!![]);}catch(_0xd4aed){return BPromise[_0xb4be('0x1f')](_0xd4aed);}return _0x31d4d8[_0xb4be('0x20')]();};}function saveUpdates(_0x496e3b,_0x5e2f8f){return function(_0x492241){if(_0x492241){return _0x492241[_0xb4be('0x21')](_0x496e3b)[_0xb4be('0x22')](function(_0xd7e148){return _0xd7e148;});}return null;};}function removeEntity(_0x5f1ef5,_0x212a47){return function(_0xf0495){if(_0xf0495){return _0xf0495['destroy']()[_0xb4be('0x22')](function(){_0x5f1ef5[_0xb4be('0x18')](0xcc)[_0xb4be('0x19')]();});}};}function handleEntityNotFound(_0x4db24f,_0x16b38c){return function(_0x4878fe){if(!_0x4878fe){_0x4db24f[_0xb4be('0x17')](0x194);}return _0x4878fe;};}function handleError(_0x1e61ec,_0x5119a6){_0x5119a6=_0x5119a6||0x1f4;return function(_0x2f022d){logger['error'](_0x2f022d['stack']);if(_0x2f022d['name']){delete _0x2f022d[_0xb4be('0x23')];}_0x1e61ec['status'](_0x5119a6)[_0xb4be('0x24')](_0x2f022d);};}exports[_0xb4be('0x25')]=function(_0x5b9955,_0x5ef3cc){var _0x87d9b0={},_0x121463={},_0x32ce96={'count':0x0,'rows':[]};var _0x5df2de=db['JscriptySessionReport'][_0xb4be('0x26')];_0x121463[_0xb4be('0x27')]=_[_0xb4be('0x28')](_0x5df2de);_0x121463[_0xb4be('0x29')]=_[_0xb4be('0x28')](_0x5b9955[_0xb4be('0x29')]);_0x121463[_0xb4be('0x2a')]=_['intersection'](_0x121463[_0xb4be('0x27')],_0x121463[_0xb4be('0x29')]);_0x87d9b0[_0xb4be('0x2b')]=_[_0xb4be('0x2c')](_0x121463[_0xb4be('0x27')],qs[_0xb4be('0x2d')](_0x5b9955[_0xb4be('0x29')][_0xb4be('0x2d')]));_0x87d9b0[_0xb4be('0x2b')]=_0x87d9b0['attributes']['length']?_0x87d9b0['attributes']:_0x121463[_0xb4be('0x27')];if(!_0x5b9955[_0xb4be('0x29')][_0xb4be('0x2e')](_0xb4be('0x2f'))){_0x87d9b0['limit']=qs[_0xb4be('0x1c')](_0x5b9955[_0xb4be('0x29')][_0xb4be('0x1c')]);_0x87d9b0['offset']=qs[_0xb4be('0x1b')](_0x5b9955[_0xb4be('0x29')][_0xb4be('0x1b')]);}_0x87d9b0[_0xb4be('0x30')]=qs[_0xb4be('0x31')](_0x5b9955[_0xb4be('0x29')][_0xb4be('0x31')]);_0x87d9b0[_0xb4be('0x32')]=qs[_0xb4be('0x2a')](_['pick'](_0x5b9955[_0xb4be('0x29')],_0x121463[_0xb4be('0x2a')]));if(_0x5b9955[_0xb4be('0x29')][_0xb4be('0x33')]){_0x87d9b0[_0xb4be('0x32')]=_['merge'](_0x87d9b0[_0xb4be('0x32')],{'$or':_['map'](_0x5df2de,function(_0x380e48){if(_0x380e48[_0xb4be('0x34')][_0xb4be('0x35')]!==_0xb4be('0x36')){var _0x16fbd5={};_0x16fbd5[_0x380e48[_0xb4be('0x37')]]={'$like':'%'+_0x5b9955[_0xb4be('0x29')][_0xb4be('0x33')]+'%'};return _0x16fbd5;}})});}_0x87d9b0=_[_0xb4be('0x38')]({},_0x87d9b0,_0x5b9955[_0xb4be('0x39')]);var _0xd4ef0e={'where':_0x87d9b0[_0xb4be('0x32')]};return db['JscriptySessionReport'][_0xb4be('0x3a')](_0xd4ef0e)[_0xb4be('0x22')](function(_0x4f6e3e){_0x32ce96['count']=_0x4f6e3e;if(_0x5b9955[_0xb4be('0x29')][_0xb4be('0x3b')]){_0x87d9b0[_0xb4be('0x3c')]=[{'all':!![]}];}return db[_0xb4be('0x3d')][_0xb4be('0x3e')](_0x87d9b0);})[_0xb4be('0x22')](function(_0x15786f){_0x32ce96[_0xb4be('0x3f')]=_0x15786f;return _0x32ce96;})[_0xb4be('0x22')](respondWithFilteredResult(_0x5ef3cc,_0x87d9b0))[_0xb4be('0x40')](handleError(_0x5ef3cc,null));};exports[_0xb4be('0x41')]=function(_0x54b294,_0x2b5f5a){var _0x14db4e={'raw':!![],'where':{'id':_0x54b294['params']['id']}},_0x18519e={};_0x18519e[_0xb4be('0x27')]=_['keys'](db[_0xb4be('0x3d')][_0xb4be('0x26')]);_0x18519e['query']=_[_0xb4be('0x28')](_0x54b294['query']);_0x18519e['filters']=_[_0xb4be('0x2c')](_0x18519e[_0xb4be('0x27')],_0x18519e[_0xb4be('0x29')]);_0x14db4e['attributes']=_[_0xb4be('0x2c')](_0x18519e['model'],qs['fields'](_0x54b294[_0xb4be('0x29')]['fields']));_0x14db4e[_0xb4be('0x2b')]=_0x14db4e[_0xb4be('0x2b')][_0xb4be('0x42')]?_0x14db4e[_0xb4be('0x2b')]:_0x18519e[_0xb4be('0x27')];if(_0x54b294['query'][_0xb4be('0x3b')]){_0x14db4e['include']=[{'all':!![]}];}_0x14db4e=_[_0xb4be('0x38')]({},_0x14db4e,_0x54b294[_0xb4be('0x39')]);return db[_0xb4be('0x3d')][_0xb4be('0x43')](_0x14db4e)['then'](handleEntityNotFound(_0x2b5f5a,null))[_0xb4be('0x22')](respondWithResult(_0x2b5f5a,null))[_0xb4be('0x40')](handleError(_0x2b5f5a,null));};exports[_0xb4be('0x44')]=function(_0xe03366,_0x4eb111){return db['JscriptySessionReport']['create'](_0xe03366[_0xb4be('0x45')],{})[_0xb4be('0x22')](respondWithResult(_0x4eb111,0xc9))[_0xb4be('0x40')](handleError(_0x4eb111,null));};exports[_0xb4be('0x21')]=function(_0x25c41,_0x26b809){if(_0x25c41[_0xb4be('0x45')]['id']){delete _0x25c41[_0xb4be('0x45')]['id'];}return db[_0xb4be('0x3d')][_0xb4be('0x43')]({'where':{'id':_0x25c41[_0xb4be('0x46')]['id']}})[_0xb4be('0x22')](handleEntityNotFound(_0x26b809,null))[_0xb4be('0x22')](saveUpdates(_0x25c41['body'],null))[_0xb4be('0x22')](respondWithResult(_0x26b809,null))[_0xb4be('0x40')](handleError(_0x26b809,null));};exports[_0xb4be('0x47')]=function(_0x43713b,_0x33b4ee){return db[_0xb4be('0x3d')][_0xb4be('0x43')]({'where':{'id':_0x43713b[_0xb4be('0x46')]['id']}})[_0xb4be('0x22')](handleEntityNotFound(_0x33b4ee,null))[_0xb4be('0x22')](removeEntity(_0x33b4ee,null))['catch'](handleError(_0x33b4ee,null));};exports[_0xb4be('0x48')]=function(_0x455dff,_0x50772b){return db[_0xb4be('0x3d')]['describe']()[_0xb4be('0x22')](respondWithResult(_0x50772b,null))[_0xb4be('0x40')](handleError(_0x50772b,null));};exports[_0xb4be('0x49')]=function(_0x44e63e,_0x34fd58,_0x33d546){var _0x3d7ad8={'raw':!![],'where':{}};var _0x2e9678={};var _0x5839a8={'count':0x0,'rows':[]};return db[_0xb4be('0x3d')][_0xb4be('0x4a')]({'where':{'id':_0x44e63e[_0xb4be('0x46')]['id']}})[_0xb4be('0x22')](handleEntityNotFound(_0x34fd58,null))['then'](function(_0x229926){if(_0x229926){_0x2e9678[_0xb4be('0x27')]=_[_0xb4be('0x28')](db[_0xb4be('0x4b')][_0xb4be('0x26')]);_0x2e9678[_0xb4be('0x29')]=_[_0xb4be('0x28')](_0x44e63e[_0xb4be('0x29')]);_0x2e9678[_0xb4be('0x2a')]=_[_0xb4be('0x2c')](_0x2e9678[_0xb4be('0x27')],_0x2e9678['query']);_0x3d7ad8['attributes']=_[_0xb4be('0x2c')](_0x2e9678[_0xb4be('0x27')],qs[_0xb4be('0x2d')](_0x44e63e[_0xb4be('0x29')][_0xb4be('0x2d')]));_0x3d7ad8[_0xb4be('0x2b')]=_0x3d7ad8[_0xb4be('0x2b')][_0xb4be('0x42')]?_0x3d7ad8[_0xb4be('0x2b')]:_0x2e9678[_0xb4be('0x27')];if(!_0x44e63e['query'][_0xb4be('0x2e')](_0xb4be('0x2f'))){_0x3d7ad8[_0xb4be('0x1c')]=qs[_0xb4be('0x1c')](_0x44e63e['query'][_0xb4be('0x1c')]);_0x3d7ad8[_0xb4be('0x1b')]=qs[_0xb4be('0x1b')](_0x44e63e[_0xb4be('0x29')]['offset']);}_0x3d7ad8[_0xb4be('0x30')]=qs[_0xb4be('0x31')](_0x44e63e['query'][_0xb4be('0x31')]);_0x3d7ad8['where']=qs['filters'](_[_0xb4be('0x4c')](_0x44e63e[_0xb4be('0x29')],_0x2e9678[_0xb4be('0x2a')]));_0x3d7ad8['where'][_0xb4be('0x4d')]=_0x229926['id'];if(_0x44e63e['query'][_0xb4be('0x33')]){_0x3d7ad8[_0xb4be('0x32')]=_['merge'](_0x3d7ad8[_0xb4be('0x32')],{'$or':_['map'](_0x3d7ad8[_0xb4be('0x2b')],function(_0x4a0424){var _0x580b0d={};_0x580b0d[_0x4a0424]={'$like':'%'+_0x44e63e[_0xb4be('0x29')][_0xb4be('0x33')]+'%'};return _0x580b0d;})});}_0x3d7ad8=_[_0xb4be('0x38')]({},_0x3d7ad8,_0x44e63e['options']);return db[_0xb4be('0x4b')][_0xb4be('0x3a')]({'where':_0x3d7ad8[_0xb4be('0x32')]})['then'](function(_0x29e8ae){_0x5839a8['count']=_0x29e8ae;if(_0x44e63e[_0xb4be('0x29')]['includeAll']){_0x3d7ad8[_0xb4be('0x3c')]=[{'all':!![]}];}return db[_0xb4be('0x4b')][_0xb4be('0x3e')](_0x3d7ad8);})['then'](function(_0x3e314a){_0x5839a8[_0xb4be('0x3f')]=_0x3e314a;return _0x5839a8;});}})[_0xb4be('0x22')](respondWithFilteredResult(_0x34fd58,_0x3d7ad8))['catch'](handleError(_0x34fd58,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 399495f..be9df8f 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 _0x5819=['report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport'];(function(_0x107f5e,_0x1b1729){var _0x47d004=function(_0x983e58){while(--_0x983e58){_0x107f5e['push'](_0x107f5e['shift']());}};_0x47d004(++_0x1b1729);}(_0x5819,0x1e2));var _0x9581=function(_0x319d84,_0x5d00a9){_0x319d84=_0x319d84-0x0;var _0x51f7cc=_0x5819[_0x319d84];return _0x51f7cc;};'use strict';var _=require(_0x9581('0x0'));var util=require(_0x9581('0x1'));var logger=require(_0x9581('0x2'))(_0x9581('0x3'));var moment=require(_0x9581('0x4'));var BPromise=require(_0x9581('0x5'));var rp=require(_0x9581('0x6'));var fs=require('fs');var path=require(_0x9581('0x7'));var rimraf=require('rimraf');var config=require(_0x9581('0x8'));var attributes=require(_0x9581('0x9'));module[_0x9581('0xa')]=function(_0x213b85,_0x52f264){return _0x213b85['define'](_0x9581('0xb'),attributes,{'tableName':_0x9581('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3d9=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','JscriptySessionReport','report_jscripty_sessions','lodash','util'];(function(_0x587a82,_0x571786){var _0xd9e8c4=function(_0x3699d3){while(--_0x3699d3){_0x587a82['push'](_0x587a82['shift']());}};_0xd9e8c4(++_0x571786);}(_0xb3d9,0x77));var _0x9b3d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb3d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9b3d('0x0'));var util=require(_0x9b3d('0x1'));var logger=require(_0x9b3d('0x2'))(_0x9b3d('0x3'));var moment=require(_0x9b3d('0x4'));var BPromise=require(_0x9b3d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9b3d('0x6'));var config=require(_0x9b3d('0x7'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x2a1875,_0x110cf2){return _0x2a1875[_0x9b3d('0x8')](_0x9b3d('0x9'),attributes,{'tableName':_0x9b3d('0xa'),'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 0fb407c..17520f4 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 _0x0f9f=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1c7d08,_0x4417e1){var _0x4ff616=function(_0x39dabd){while(--_0x39dabd){_0x1c7d08['push'](_0x1c7d08['shift']());}};_0x4ff616(++_0x4417e1);}(_0x0f9f,0xae));var _0xf0f9=function(_0x5804c8,_0x57af4d){_0x5804c8=_0x5804c8-0x0;var _0x33d432=_0x0f9f[_0x5804c8];return _0x33d432;};'use strict';var _=require(_0xf0f9('0x0'));var util=require(_0xf0f9('0x1'));var moment=require(_0xf0f9('0x2'));var BPromise=require(_0xf0f9('0x3'));var rs=require(_0xf0f9('0x4'));var fs=require('fs');var Redis=require(_0xf0f9('0x5'));var db=require(_0xf0f9('0x6'))['db'];var utils=require(_0xf0f9('0x7'));var logger=require(_0xf0f9('0x8'))(_0xf0f9('0x9'));var config=require(_0xf0f9('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xf0f9('0xb')][_0xf0f9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53d1e7,_0x2569f,_0x2d327a){return new BPromise(function(_0x2ce622,_0x59b433){return client[_0xf0f9('0xd')](_0x53d1e7,_0x2d327a)[_0xf0f9('0xe')](function(_0x4ec2a9){logger[_0xf0f9('0xf')](_0xf0f9('0x10'),_0x2569f,_0xf0f9('0x11'));logger[_0xf0f9('0x12')](_0xf0f9('0x13'),_0x2569f,_0xf0f9('0x11'),JSON[_0xf0f9('0x14')](_0x4ec2a9));if(_0x4ec2a9[_0xf0f9('0x15')]){if(_0x4ec2a9['error'][_0xf0f9('0x16')]===0x1f4){logger[_0xf0f9('0x15')](_0xf0f9('0x10'),_0x2569f,_0x4ec2a9[_0xf0f9('0x15')]['message']);return _0x59b433(_0x4ec2a9[_0xf0f9('0x15')][_0xf0f9('0x17')]);}logger['error'](_0xf0f9('0x10'),_0x2569f,_0x4ec2a9['error']['message']);return _0x2ce622(_0x4ec2a9[_0xf0f9('0x15')]['message']);}else{logger[_0xf0f9('0xf')]('JscriptySessionReport,\x20%s,\x20%s',_0x2569f,_0xf0f9('0x11'));_0x2ce622(_0x4ec2a9[_0xf0f9('0x18')][_0xf0f9('0x17')]);}})[_0xf0f9('0x19')](function(_0x236cbd){logger[_0xf0f9('0x15')](_0xf0f9('0x10'),_0x2569f,_0x236cbd);_0x59b433(_0x236cbd);});});} \ No newline at end of file +var _0xc6ac=['http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x92f9e7,_0x5aac7d){var _0x704f35=function(_0x30485a){while(--_0x30485a){_0x92f9e7['push'](_0x92f9e7['shift']());}};_0x704f35(++_0x5aac7d);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x3809bb,_0x58ee06){_0x3809bb=_0x3809bb-0x0;var _0x561d5a=_0xc6ac[_0x3809bb];return _0x561d5a;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 02db7d9..8451e23 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 _0x0db8=['connect-timeout','Router','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','isAuthenticated','update','exports','multer','util','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0db8,0x169));var _0x80db=function(_0x42d156,_0x46996e){_0x42d156=_0x42d156-0x0;var _0x111e43=_0x0db8[_0x42d156];return _0x111e43;};'use strict';var multer=require(_0x80db('0x0'));var util=require(_0x80db('0x1'));var path=require(_0x80db('0x2'));var timeout=require(_0x80db('0x3'));var express=require('express');var router=express[_0x80db('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x80db('0x5'));var config=require(_0x80db('0x6'));var controller=require(_0x80db('0x7'));router[_0x80db('0x8')]('/',controller[_0x80db('0x9')]);router[_0x80db('0xa')]('/:id',auth[_0x80db('0xb')](),controller[_0x80db('0xc')]);module[_0x80db('0xd')]=router; \ No newline at end of file +var _0xf6e9=['../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','multer','util','path','connect-timeout','express','Router'];(function(_0x2202e1,_0x7b3c17){var _0xa30f2b=function(_0xef1908){while(--_0xef1908){_0x2202e1['push'](_0x2202e1['shift']());}};_0xa30f2b(++_0x7b3c17);}(_0xf6e9,0xea));var _0x9f6e=function(_0x155ced,_0x5f2eac){_0x155ced=_0x155ced-0x0;var _0x162723=_0xf6e9[_0x155ced];return _0x162723;};'use strict';var multer=require(_0x9f6e('0x0'));var util=require(_0x9f6e('0x1'));var path=require(_0x9f6e('0x2'));var timeout=require(_0x9f6e('0x3'));var express=require(_0x9f6e('0x4'));var router=express[_0x9f6e('0x5')]();var auth=require(_0x9f6e('0x6'));var interaction=require(_0x9f6e('0x7'));var config=require(_0x9f6e('0x8'));var controller=require('./license.controller');router['get']('/',controller[_0x9f6e('0x9')]);router['put'](_0x9f6e('0xa'),auth[_0x9f6e('0xb')](),controller['update']);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 3aa2172..4143b31 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 _0xca67=['sequelize','exports','TEXT','STRING','INTEGER'];(function(_0x31fbf8,_0x5ea3aa){var _0x14d901=function(_0x301339){while(--_0x301339){_0x31fbf8['push'](_0x31fbf8['shift']());}};_0x14d901(++_0x5ea3aa);}(_0xca67,0x91));var _0x7ca6=function(_0x1248b4,_0x50ff8e){_0x1248b4=_0x1248b4-0x0;var _0x2f8bac=_0xca67[_0x1248b4];return _0x2f8bac;};'use strict';var Sequelize=require(_0x7ca6('0x0'));module[_0x7ca6('0x1')]={'license':{'type':Sequelize[_0x7ca6('0x2')]},'data1':{'type':Sequelize[_0x7ca6('0x3')]},'data2':{'type':Sequelize[_0x7ca6('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x7ca6('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6dd0=['sequelize','exports','TEXT','STRING','INTEGER'];(function(_0x3caa9b,_0x4a9287){var _0xf1216d=function(_0x29cc93){while(--_0x29cc93){_0x3caa9b['push'](_0x3caa9b['shift']());}};_0xf1216d(++_0x4a9287);}(_0x6dd0,0xc8));var _0x06dd=function(_0x2e9c97,_0x389b8e){_0x2e9c97=_0x2e9c97-0x0;var _0x50af0a=_0x6dd0[_0x2e9c97];return _0x50af0a;};'use strict';var Sequelize=require(_0x06dd('0x0'));module[_0x06dd('0x1')]={'license':{'type':Sequelize[_0x06dd('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x06dd('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x06dd('0x4')],'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 d85b78f..ff3ae86 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 _0xd7c3=['sendStatus','status','end','json','offset','set','Content-Range','apply','reject','update','then','error','stack','name','send','../../config/license/util','model','keys','License','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','body','find','get','key','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','lodash','squel','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'];(function(_0x9e370a,_0x3e9483){var _0x219a1a=function(_0xcd851a){while(--_0xcd851a){_0x9e370a['push'](_0x9e370a['shift']());}};_0x219a1a(++_0x3e9483);}(_0xd7c3,0x1c5));var _0x3d7c=function(_0x5b26f5,_0x4f89d8){_0x5b26f5=_0x5b26f5-0x0;var _0xfd2c0=_0xd7c3[_0x5b26f5];return _0xfd2c0;};'use strict';var pdf=require(_0x3d7c('0x0'));var emlformat=require(_0x3d7c('0x1'));var rimraf=require(_0x3d7c('0x2'));var zipdir=require(_0x3d7c('0x3'));var jsonpatch=require(_0x3d7c('0x4'));var rp=require(_0x3d7c('0x5'));var moment=require(_0x3d7c('0x6'));var BPromise=require(_0x3d7c('0x7'));var Mustache=require(_0x3d7c('0x8'));var util=require('util');var path=require(_0x3d7c('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x3d7c('0xa'));var squel=require(_0x3d7c('0xb'));var crypto=require(_0x3d7c('0xc'));var jsforce=require(_0x3d7c('0xd'));var deskjs=require(_0x3d7c('0xe'));var toCsv=require(_0x3d7c('0xf'));var querystring=require(_0x3d7c('0x10'));var Papa=require(_0x3d7c('0x11'));var Redis=require(_0x3d7c('0x12'));var authService=require(_0x3d7c('0x13'));var qs=require(_0x3d7c('0x14'));var hardwareService=require(_0x3d7c('0x15'));var logger=require(_0x3d7c('0x16'))(_0x3d7c('0x17'));var utils=require(_0x3d7c('0x18'));var config=require(_0x3d7c('0x19'));var db=require(_0x3d7c('0x1a'))['db'];function respondWithStatusCode(_0x1ba019,_0x4f5aee){_0x4f5aee=_0x4f5aee||0xcc;return function(_0x20148f){if(_0x20148f){return _0x1ba019[_0x3d7c('0x1b')](_0x4f5aee);}return _0x1ba019[_0x3d7c('0x1c')](_0x4f5aee)[_0x3d7c('0x1d')]();};}function respondWithResult(_0x159f13,_0x2d7c11){_0x2d7c11=_0x2d7c11||0xc8;return function(_0x4728dc){if(_0x4728dc){return _0x159f13[_0x3d7c('0x1c')](_0x2d7c11)[_0x3d7c('0x1e')](_0x4728dc);}};}function respondWithFilteredResult(_0x36e28d,_0x46f402){return function(_0x37122a){if(_0x37122a){var _0x1ba7ee=_0x37122a['count'],_0xf0a186=_0x46f402[_0x3d7c('0x1f')],_0x9d0305=_0x46f402[_0x3d7c('0x1f')]+_0x46f402['limit'],_0x1e7872;if(_0x9d0305>=_0x1ba7ee){_0x9d0305=_0x1ba7ee;_0x1e7872=0xc8;}else{_0x1e7872=0xce;}_0x36e28d['status'](_0x1e7872);return _0x36e28d[_0x3d7c('0x20')](_0x3d7c('0x21'),_0xf0a186+'-'+_0x9d0305+'/'+_0x1ba7ee)[_0x3d7c('0x1e')](_0x37122a);}return null;};}function patchUpdates(_0x34f1d5){return function(_0x591455){try{jsonpatch[_0x3d7c('0x22')](_0x591455,_0x34f1d5,!![]);}catch(_0x328851){return BPromise[_0x3d7c('0x23')](_0x328851);}return _0x591455['save']();};}function saveUpdates(_0x1308ef,_0x38207e){return function(_0x3a99fd){if(_0x3a99fd){return _0x3a99fd[_0x3d7c('0x24')](_0x1308ef)[_0x3d7c('0x25')](function(_0x22f9f6){return _0x22f9f6;});}return null;};}function removeEntity(_0x457b78,_0xdc158f){return function(_0xa4fbe9){if(_0xa4fbe9){return _0xa4fbe9['destroy']()[_0x3d7c('0x25')](function(){_0x457b78[_0x3d7c('0x1c')](0xcc)[_0x3d7c('0x1d')]();});}};}function handleEntityNotFound(_0x81a5a3,_0x553df1){return function(_0x4a7966){if(!_0x4a7966){_0x81a5a3[_0x3d7c('0x1b')](0x194);}return _0x4a7966;};}function handleError(_0x3f9d26,_0x37d3a0){_0x37d3a0=_0x37d3a0||0x1f4;return function(_0x238998){logger[_0x3d7c('0x26')](_0x238998[_0x3d7c('0x27')]);if(_0x238998[_0x3d7c('0x28')]){delete _0x238998[_0x3d7c('0x28')];}_0x3f9d26[_0x3d7c('0x1c')](_0x37d3a0)[_0x3d7c('0x29')](_0x238998);};}var utilLicense=require(_0x3d7c('0x2a'));exports['index']=function(_0x5e7d0a,_0x316c7c){var _0x21137a={'raw':!![],'where':{'id':0x1}},_0x551db1={};_0x551db1[_0x3d7c('0x2b')]=_[_0x3d7c('0x2c')](db[_0x3d7c('0x2d')]['rawAttributes']);_0x551db1[_0x3d7c('0x2e')]=_[_0x3d7c('0x2c')](_0x5e7d0a[_0x3d7c('0x2e')]);_0x551db1[_0x3d7c('0x2f')]=_[_0x3d7c('0x30')](_0x551db1['model'],_0x551db1[_0x3d7c('0x2e')]);_0x21137a[_0x3d7c('0x31')]=_[_0x3d7c('0x30')](_0x551db1['model'],qs[_0x3d7c('0x32')](_0x5e7d0a[_0x3d7c('0x2e')][_0x3d7c('0x32')]));_0x21137a[_0x3d7c('0x31')]=_0x21137a[_0x3d7c('0x31')][_0x3d7c('0x33')]?_0x21137a['attributes']:_0x551db1['model'];_0x21137a=_[_0x3d7c('0x34')]({},_0x21137a,_0x5e7d0a[_0x3d7c('0x35')]);return utilLicense[_0x3d7c('0x36')](_0x21137a)[_0x3d7c('0x25')](respondWithResult(_0x316c7c,null))[_0x3d7c('0x37')](handleError(_0x316c7c,null));};exports[_0x3d7c('0x24')]=function(_0x58804d,_0x42d289){if(_0x58804d[_0x3d7c('0x38')]['id']){delete _0x58804d[_0x3d7c('0x38')]['id'];}return db['License'][_0x3d7c('0x39')]({'where':{'id':_0x58804d['params']['id']}})['then'](handleEntityNotFound(_0x42d289,null))[_0x3d7c('0x25')](function(_0x182dda){var _0x7dde89=_0x182dda[_0x3d7c('0x3a')]({'plain':!![]});return utilLicense['checkLicense'](_0x7dde89,_0x58804d[_0x3d7c('0x38')][_0x3d7c('0x3b')]);})['then'](function(_0x1a63d9){if(!_0x1a63d9['demo']){return saveUpdates(_0x58804d[_0x3d7c('0x38')],null);}return _0x1a63d9;})[_0x3d7c('0x25')](respondWithResult(_0x42d289,null))[_0x3d7c('0x37')](handleError(_0x42d289,null));}; \ No newline at end of file +var _0x8c46=['../../components/auth/service','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','json','apply','reject','save','then','stack','name','send','index','model','keys','rawAttributes','query','intersection','attributes','fields','length','merge','options','getLicense','catch','update','body','License','find','params','checkLicense','key','demo','html-pdf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0x8c46,0x171));var _0x68c4=function(_0x4c4deb,_0x4d82ad){_0x4c4deb=_0x4c4deb-0x0;var _0x4896dc=_0x8c46[_0x4c4deb];return _0x4896dc;};'use strict';var pdf=require(_0x68c4('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x68c4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x68c4('0x2'));var BPromise=require(_0x68c4('0x3'));var Mustache=require(_0x68c4('0x4'));var util=require(_0x68c4('0x5'));var path=require(_0x68c4('0x6'));var sox=require(_0x68c4('0x7'));var csv=require(_0x68c4('0x8'));var ejs=require(_0x68c4('0x9'));var fs=require('fs');var _=require(_0x68c4('0xa'));var squel=require(_0x68c4('0xb'));var crypto=require('crypto');var jsforce=require(_0x68c4('0xc'));var deskjs=require(_0x68c4('0xd'));var toCsv=require(_0x68c4('0x8'));var querystring=require('querystring');var Papa=require(_0x68c4('0xe'));var Redis=require(_0x68c4('0xf'));var authService=require(_0x68c4('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x68c4('0x11'))(_0x68c4('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x68c4('0x13'))['db'];function respondWithStatusCode(_0x1f7cb2,_0x2796c8){_0x2796c8=_0x2796c8||0xcc;return function(_0x48783b){if(_0x48783b){return _0x1f7cb2[_0x68c4('0x14')](_0x2796c8);}return _0x1f7cb2[_0x68c4('0x15')](_0x2796c8)[_0x68c4('0x16')]();};}function respondWithResult(_0x56e361,_0x11eb66){_0x11eb66=_0x11eb66||0xc8;return function(_0x14919c){if(_0x14919c){return _0x56e361[_0x68c4('0x15')](_0x11eb66)['json'](_0x14919c);}};}function respondWithFilteredResult(_0x211793,_0x38fd57){return function(_0x5be0de){if(_0x5be0de){var _0xc25f7b=_0x5be0de['count'],_0x4ea2a4=_0x38fd57[_0x68c4('0x17')],_0x1a7045=_0x38fd57[_0x68c4('0x17')]+_0x38fd57['limit'],_0x556aa6;if(_0x1a7045>=_0xc25f7b){_0x1a7045=_0xc25f7b;_0x556aa6=0xc8;}else{_0x556aa6=0xce;}_0x211793[_0x68c4('0x15')](_0x556aa6);return _0x211793[_0x68c4('0x18')](_0x68c4('0x19'),_0x4ea2a4+'-'+_0x1a7045+'/'+_0xc25f7b)[_0x68c4('0x1a')](_0x5be0de);}return null;};}function patchUpdates(_0x3a6300){return function(_0x10f0a7){try{jsonpatch[_0x68c4('0x1b')](_0x10f0a7,_0x3a6300,!![]);}catch(_0x415ef2){return BPromise[_0x68c4('0x1c')](_0x415ef2);}return _0x10f0a7[_0x68c4('0x1d')]();};}function saveUpdates(_0x29cb55,_0x58f87d){return function(_0x398a71){if(_0x398a71){return _0x398a71['update'](_0x29cb55)['then'](function(_0x34d3a6){return _0x34d3a6;});}return null;};}function removeEntity(_0x1355f1,_0x154897){return function(_0x42f0bc){if(_0x42f0bc){return _0x42f0bc['destroy']()[_0x68c4('0x1e')](function(){_0x1355f1[_0x68c4('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x201742,_0x392ccf){return function(_0x45f9be){if(!_0x45f9be){_0x201742[_0x68c4('0x14')](0x194);}return _0x45f9be;};}function handleError(_0x12ecd1,_0x20e78b){_0x20e78b=_0x20e78b||0x1f4;return function(_0x37e9a9){logger['error'](_0x37e9a9[_0x68c4('0x1f')]);if(_0x37e9a9['name']){delete _0x37e9a9[_0x68c4('0x20')];}_0x12ecd1[_0x68c4('0x15')](_0x20e78b)[_0x68c4('0x21')](_0x37e9a9);};}var utilLicense=require('../../config/license/util');exports[_0x68c4('0x22')]=function(_0x126064,_0x496f4d){var _0x31e177={'raw':!![],'where':{'id':0x1}},_0x3b62a3={};_0x3b62a3[_0x68c4('0x23')]=_[_0x68c4('0x24')](db['License'][_0x68c4('0x25')]);_0x3b62a3['query']=_[_0x68c4('0x24')](_0x126064[_0x68c4('0x26')]);_0x3b62a3['filters']=_[_0x68c4('0x27')](_0x3b62a3[_0x68c4('0x23')],_0x3b62a3['query']);_0x31e177[_0x68c4('0x28')]=_[_0x68c4('0x27')](_0x3b62a3[_0x68c4('0x23')],qs[_0x68c4('0x29')](_0x126064[_0x68c4('0x26')][_0x68c4('0x29')]));_0x31e177[_0x68c4('0x28')]=_0x31e177[_0x68c4('0x28')][_0x68c4('0x2a')]?_0x31e177[_0x68c4('0x28')]:_0x3b62a3[_0x68c4('0x23')];_0x31e177=_[_0x68c4('0x2b')]({},_0x31e177,_0x126064[_0x68c4('0x2c')]);return utilLicense[_0x68c4('0x2d')](_0x31e177)[_0x68c4('0x1e')](respondWithResult(_0x496f4d,null))[_0x68c4('0x2e')](handleError(_0x496f4d,null));};exports[_0x68c4('0x2f')]=function(_0x106d6e,_0x4837b4){if(_0x106d6e[_0x68c4('0x30')]['id']){delete _0x106d6e[_0x68c4('0x30')]['id'];}return db[_0x68c4('0x31')][_0x68c4('0x32')]({'where':{'id':_0x106d6e[_0x68c4('0x33')]['id']}})['then'](handleEntityNotFound(_0x4837b4,null))[_0x68c4('0x1e')](function(_0x4f4672){var _0x586e9c=_0x4f4672['get']({'plain':!![]});return utilLicense[_0x68c4('0x34')](_0x586e9c,_0x106d6e[_0x68c4('0x30')][_0x68c4('0x35')]);})[_0x68c4('0x1e')](function(_0x5953cc){if(!_0x5953cc[_0x68c4('0x36')]){return saveUpdates(_0x106d6e[_0x68c4('0x30')],null);}return _0x5953cc;})[_0x68c4('0x1e')](respondWithResult(_0x4837b4,null))['catch'](handleError(_0x4837b4,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index f1819d8..79b0397 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 _0x4d46=['./license.attributes','exports','define','License','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x5e9850,_0x291edf){var _0x2d3d96=function(_0x28f972){while(--_0x28f972){_0x5e9850['push'](_0x5e9850['shift']());}};_0x2d3d96(++_0x291edf);}(_0x4d46,0x197));var _0x64d4=function(_0xb265cb,_0x404496){_0xb265cb=_0xb265cb-0x0;var _0x1ae08c=_0x4d46[_0xb265cb];return _0x1ae08c;};'use strict';var _=require(_0x64d4('0x0'));var util=require(_0x64d4('0x1'));var logger=require(_0x64d4('0x2'))(_0x64d4('0x3'));var moment=require(_0x64d4('0x4'));var BPromise=require(_0x64d4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x64d4('0x6'));var rimraf=require(_0x64d4('0x7'));var config=require(_0x64d4('0x8'));var attributes=require(_0x64d4('0x9'));module[_0x64d4('0xa')]=function(_0x3b8932,_0x4d9222){return _0x3b8932[_0x64d4('0xb')](_0x64d4('0xc'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd404=['util','api','moment','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','license','lodash'];(function(_0x147497,_0x43e433){var _0x35f45=function(_0x584421){while(--_0x584421){_0x147497['push'](_0x147497['shift']());}};_0x35f45(++_0x43e433);}(_0xd404,0x15b));var _0x4d40=function(_0x5ad8aa,_0x407701){_0x5ad8aa=_0x5ad8aa-0x0;var _0x2b08f6=_0xd404[_0x5ad8aa];return _0x2b08f6;};'use strict';var _=require(_0x4d40('0x0'));var util=require(_0x4d40('0x1'));var logger=require('../../config/logger')(_0x4d40('0x2'));var moment=require(_0x4d40('0x3'));var BPromise=require('bluebird');var rp=require(_0x4d40('0x4'));var fs=require('fs');var path=require(_0x4d40('0x5'));var rimraf=require(_0x4d40('0x6'));var config=require(_0x4d40('0x7'));var attributes=require(_0x4d40('0x8'));module[_0x4d40('0x9')]=function(_0xc2a9db,_0x24a237){return _0xc2a9db[_0x4d40('0xa')]('License',attributes,{'tableName':_0x4d40('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 1598198..5818a20 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 _0x48ff=['../../config/environment','client','http','then','info','License,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x55cffc,_0x96dbf5){var _0x4fd082=function(_0x358eb7){while(--_0x358eb7){_0x55cffc['push'](_0x55cffc['shift']());}};_0x4fd082(++_0x96dbf5);}(_0x48ff,0x1e1));var _0xf48f=function(_0x4861be,_0x248171){_0x4861be=_0x4861be-0x0;var _0x481d8c=_0x48ff[_0x4861be];return _0x481d8c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf48f('0x0'));var fs=require('fs');var Redis=require(_0xf48f('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xf48f('0x2'));var logger=require(_0xf48f('0x3'))(_0xf48f('0x4'));var config=require(_0xf48f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf48f('0x6')][_0xf48f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xa0f095,_0x39281e,_0x454539){return new BPromise(function(_0xeff2fc,_0x2674e5){return client['request'](_0xa0f095,_0x454539)[_0xf48f('0x8')](function(_0x547b2b){logger[_0xf48f('0x9')](_0xf48f('0xa'),_0x39281e,'request\x20sent');logger[_0xf48f('0xb')]('License,\x20%s,\x20%s,\x20%s',_0x39281e,_0xf48f('0xc'),JSON[_0xf48f('0xd')](_0x547b2b));if(_0x547b2b[_0xf48f('0xe')]){if(_0x547b2b[_0xf48f('0xe')][_0xf48f('0xf')]===0x1f4){logger[_0xf48f('0xe')](_0xf48f('0xa'),_0x39281e,_0x547b2b[_0xf48f('0xe')][_0xf48f('0x10')]);return _0x2674e5(_0x547b2b[_0xf48f('0xe')][_0xf48f('0x10')]);}logger[_0xf48f('0xe')]('License,\x20%s,\x20%s',_0x39281e,_0x547b2b[_0xf48f('0xe')]['message']);return _0xeff2fc(_0x547b2b[_0xf48f('0xe')][_0xf48f('0x10')]);}else{logger['info']('License,\x20%s,\x20%s',_0x39281e,_0xf48f('0xc'));_0xeff2fc(_0x547b2b[_0xf48f('0x11')][_0xf48f('0x10')]);}})['catch'](function(_0x1b3797){logger[_0xf48f('0xe')]('License,\x20%s,\x20%s',_0x39281e,_0x1b3797);_0x2674e5(_0x1b3797);});});} \ No newline at end of file +var _0x4aec=['debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','randomstring','ioredis','rpc','../../config/environment','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent'];(function(_0x71cd05,_0x36ac11){var _0x59c9e7=function(_0x5472cd){while(--_0x5472cd){_0x71cd05['push'](_0x71cd05['shift']());}};_0x59c9e7(++_0x36ac11);}(_0x4aec,0x123));var _0xc4ae=function(_0x1ea717,_0x5f0a7d){_0x1ea717=_0x1ea717-0x0;var _0x10f950=_0x4aec[_0x1ea717];return _0x10f950;};'use strict';var _=require(_0xc4ae('0x0'));var util=require('util');var moment=require(_0xc4ae('0x1'));var BPromise=require('bluebird');var rs=require(_0xc4ae('0x2'));var fs=require('fs');var Redis=require(_0xc4ae('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc4ae('0x4'));var config=require(_0xc4ae('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xc4ae('0x6')][_0xc4ae('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x37614c,_0xc076ae,_0x3c882c){return new BPromise(function(_0x47e187,_0x83ff2b){return client[_0xc4ae('0x8')](_0x37614c,_0x3c882c)[_0xc4ae('0x9')](function(_0x40746b){logger[_0xc4ae('0xa')](_0xc4ae('0xb'),_0xc076ae,_0xc4ae('0xc'));logger[_0xc4ae('0xd')](_0xc4ae('0xe'),_0xc076ae,'request\x20sent',JSON[_0xc4ae('0xf')](_0x40746b));if(_0x40746b[_0xc4ae('0x10')]){if(_0x40746b[_0xc4ae('0x10')]['code']===0x1f4){logger['error'](_0xc4ae('0xb'),_0xc076ae,_0x40746b[_0xc4ae('0x10')][_0xc4ae('0x11')]);return _0x83ff2b(_0x40746b[_0xc4ae('0x10')][_0xc4ae('0x11')]);}logger[_0xc4ae('0x10')]('License,\x20%s,\x20%s',_0xc076ae,_0x40746b['error'][_0xc4ae('0x11')]);return _0x47e187(_0x40746b[_0xc4ae('0x10')][_0xc4ae('0x11')]);}else{logger[_0xc4ae('0xa')]('License,\x20%s,\x20%s',_0xc076ae,_0xc4ae('0xc'));_0x47e187(_0x40746b['result'][_0xc4ae('0x11')]);}})[_0xc4ae('0x12')](function(_0xe640e1){logger[_0xc4ae('0x10')](_0xc4ae('0xb'),_0xc076ae,_0xe640e1);_0x83ff2b(_0xe640e1);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 61327ef..326fd12 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 _0xcd72=['delete','removeDispositions','removeAnswers','removeImap','destroy','removeAgents','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','index','get','/describe','describe','/:id','isAuthenticated','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/verify','verifySmtp','getAgents','post','addDisposition','addAnswer','addSmtp','addInteraction','addApplications','/:id/send','send','/:id/users','put'];(function(_0x53ed5f,_0x3d5a61){var _0x2ca18d=function(_0x2d0812){while(--_0x2d0812){_0x53ed5f['push'](_0x53ed5f['shift']());}};_0x2ca18d(++_0x3d5a61);}(_0xcd72,0x1c9));var _0x2cd7=function(_0x264b9b,_0xa1181e){_0x264b9b=_0x264b9b-0x0;var _0x4c7a0e=_0xcd72[_0x264b9b];return _0x4c7a0e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2cd7('0x0'));var timeout=require(_0x2cd7('0x1'));var express=require(_0x2cd7('0x2'));var router=express['Router']();var auth=require(_0x2cd7('0x3'));var interaction=require(_0x2cd7('0x4'));var config=require(_0x2cd7('0x5'));var controller=require(_0x2cd7('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x2cd7('0x7')]);router[_0x2cd7('0x8')](_0x2cd7('0x9'),auth['isAuthenticated'](),controller[_0x2cd7('0xa')]);router[_0x2cd7('0x8')](_0x2cd7('0xb'),auth[_0x2cd7('0xc')](),controller['show']);router[_0x2cd7('0x8')](_0x2cd7('0xd'),auth[_0x2cd7('0xc')](),controller[_0x2cd7('0xe')]);router['get'](_0x2cd7('0xf'),auth[_0x2cd7('0xc')](),controller[_0x2cd7('0x10')]);router[_0x2cd7('0x8')](_0x2cd7('0x11'),auth[_0x2cd7('0xc')](),controller[_0x2cd7('0x12')]);router[_0x2cd7('0x8')](_0x2cd7('0x13'),auth[_0x2cd7('0xc')](),controller[_0x2cd7('0x14')]);router['get']('/:id/interactions',auth[_0x2cd7('0xc')](),controller[_0x2cd7('0x15')]);router['get'](_0x2cd7('0x16'),auth[_0x2cd7('0xc')](),controller[_0x2cd7('0x17')]);router[_0x2cd7('0x8')](_0x2cd7('0x18'),auth[_0x2cd7('0xc')](),controller['getMessages']);router['get'](_0x2cd7('0x19'),auth[_0x2cd7('0xc')](),controller[_0x2cd7('0x1a')]);router[_0x2cd7('0x8')]('/:id/users',auth[_0x2cd7('0xc')](),controller[_0x2cd7('0x1b')]);router[_0x2cd7('0x1c')](_0x2cd7('0xd'),auth[_0x2cd7('0xc')](),controller[_0x2cd7('0x1d')]);router[_0x2cd7('0x1c')](_0x2cd7('0xf'),auth['isAuthenticated'](),controller[_0x2cd7('0x1e')]);router[_0x2cd7('0x1c')]('/',auth[_0x2cd7('0xc')](),controller['create']);router[_0x2cd7('0x1c')](_0x2cd7('0x11'),auth['isAuthenticated'](),controller['addImap']);router['post'](_0x2cd7('0x13'),auth['isAuthenticated'](),controller[_0x2cd7('0x1f')]);router['post']('/:id/interactions',auth[_0x2cd7('0xc')](),controller[_0x2cd7('0x20')]);router[_0x2cd7('0x1c')](_0x2cd7('0x16'),auth['isAuthenticated'](),controller[_0x2cd7('0x21')]);router[_0x2cd7('0x1c')](_0x2cd7('0x22'),auth[_0x2cd7('0xc')](),controller[_0x2cd7('0x23')]);router[_0x2cd7('0x1c')](_0x2cd7('0x24'),auth[_0x2cd7('0xc')](),controller['addAgents']);router[_0x2cd7('0x25')]('/:id',auth[_0x2cd7('0xc')](),controller['update']);router[_0x2cd7('0x26')](_0x2cd7('0xd'),auth[_0x2cd7('0xc')](),controller[_0x2cd7('0x27')]);router[_0x2cd7('0x26')](_0x2cd7('0xf'),auth[_0x2cd7('0xc')](),controller[_0x2cd7('0x28')]);router[_0x2cd7('0x26')](_0x2cd7('0x11'),auth[_0x2cd7('0xc')](),controller[_0x2cd7('0x29')]);router[_0x2cd7('0x26')]('/:id/out_servers',auth[_0x2cd7('0xc')](),controller['removeSmtp']);router[_0x2cd7('0x26')](_0x2cd7('0xb'),auth[_0x2cd7('0xc')](),controller[_0x2cd7('0x2a')]);router[_0x2cd7('0x26')](_0x2cd7('0x24'),auth[_0x2cd7('0xc')](),controller[_0x2cd7('0x2b')]);module[_0x2cd7('0x2c')]=router; \ No newline at end of file +var _0xfc7d=['removeSmtp','destroy','/:id/users','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','getDispositions','/:id/canned_answers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','/:id/verify','getAgents','post','/:id/dispositions','addDisposition','addAnswer','addImap','addSmtp','addInteraction','/:id/applications','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers'];(function(_0x28d15d,_0xb7b2cf){var _0x1fe972=function(_0x153f73){while(--_0x153f73){_0x28d15d['push'](_0x28d15d['shift']());}};_0x1fe972(++_0xb7b2cf);}(_0xfc7d,0x146));var _0xdfc7=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfc7d[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0xdfc7('0x0'));var util=require(_0xdfc7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdfc7('0x2'));var router=express[_0xdfc7('0x3')]();var auth=require(_0xdfc7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xdfc7('0x5'));var controller=require(_0xdfc7('0x6'));router[_0xdfc7('0x7')]('/',auth[_0xdfc7('0x8')](),controller[_0xdfc7('0x9')]);router[_0xdfc7('0x7')](_0xdfc7('0xa'),auth[_0xdfc7('0x8')](),controller[_0xdfc7('0xb')]);router[_0xdfc7('0x7')](_0xdfc7('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xdfc7('0x7')]('/:id/dispositions',auth[_0xdfc7('0x8')](),controller[_0xdfc7('0xd')]);router[_0xdfc7('0x7')](_0xdfc7('0xe'),auth[_0xdfc7('0x8')](),controller['getAnswers']);router[_0xdfc7('0x7')](_0xdfc7('0xf'),auth[_0xdfc7('0x8')](),controller['getImap']);router[_0xdfc7('0x7')](_0xdfc7('0x10'),auth['isAuthenticated'](),controller[_0xdfc7('0x11')]);router['get'](_0xdfc7('0x12'),auth[_0xdfc7('0x8')](),controller[_0xdfc7('0x13')]);router[_0xdfc7('0x7')]('/:id/applications',auth[_0xdfc7('0x8')](),controller[_0xdfc7('0x14')]);router[_0xdfc7('0x7')](_0xdfc7('0x15'),auth[_0xdfc7('0x8')](),controller[_0xdfc7('0x16')]);router['get'](_0xdfc7('0x17'),auth[_0xdfc7('0x8')](),controller['verifySmtp']);router['get']('/:id/users',auth[_0xdfc7('0x8')](),controller[_0xdfc7('0x18')]);router[_0xdfc7('0x19')](_0xdfc7('0x1a'),auth[_0xdfc7('0x8')](),controller[_0xdfc7('0x1b')]);router[_0xdfc7('0x19')](_0xdfc7('0xe'),auth[_0xdfc7('0x8')](),controller[_0xdfc7('0x1c')]);router[_0xdfc7('0x19')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdfc7('0x19')](_0xdfc7('0xf'),auth[_0xdfc7('0x8')](),controller[_0xdfc7('0x1d')]);router[_0xdfc7('0x19')](_0xdfc7('0x10'),auth['isAuthenticated'](),controller[_0xdfc7('0x1e')]);router[_0xdfc7('0x19')](_0xdfc7('0x12'),auth[_0xdfc7('0x8')](),controller[_0xdfc7('0x1f')]);router[_0xdfc7('0x19')](_0xdfc7('0x20'),auth[_0xdfc7('0x8')](),controller[_0xdfc7('0x21')]);router[_0xdfc7('0x19')](_0xdfc7('0x22'),auth[_0xdfc7('0x8')](),controller[_0xdfc7('0x23')]);router[_0xdfc7('0x19')]('/:id/users',auth[_0xdfc7('0x8')](),controller[_0xdfc7('0x24')]);router[_0xdfc7('0x25')](_0xdfc7('0xc'),auth[_0xdfc7('0x8')](),controller[_0xdfc7('0x26')]);router[_0xdfc7('0x27')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xdfc7('0x28')]);router[_0xdfc7('0x27')](_0xdfc7('0xe'),auth[_0xdfc7('0x8')](),controller[_0xdfc7('0x29')]);router['delete'](_0xdfc7('0xf'),auth[_0xdfc7('0x8')](),controller['removeImap']);router['delete'](_0xdfc7('0x10'),auth[_0xdfc7('0x8')](),controller[_0xdfc7('0x2a')]);router[_0xdfc7('0x27')](_0xdfc7('0xc'),auth[_0xdfc7('0x8')](),controller[_0xdfc7('0x2b')]);router[_0xdfc7('0x27')](_0xdfc7('0x2c'),auth[_0xdfc7('0x8')](),controller['removeAgents']);module[_0xdfc7('0x2d')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index f8342d9..9c17211 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 _0xcdb0=['TEXT','INTEGER','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN'];(function(_0x149acc,_0x2467d3){var _0x3d02fb=function(_0x1d55f6){while(--_0x1d55f6){_0x149acc['push'](_0x149acc['shift']());}};_0x3d02fb(++_0x2467d3);}(_0xcdb0,0x1b4));var _0x0cdb=function(_0x17c502,_0x347b26){_0x17c502=_0x17c502-0x0;var _0x3e992a=_0xcdb0[_0x17c502];return _0x3e992a;};'use strict';var Sequelize=require(_0x0cdb('0x0'));module[_0x0cdb('0x1')]={'description':{'type':Sequelize[_0x0cdb('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x0cdb('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x0cdb('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x0cdb('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x0cdb('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x0cdb('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x0cdb('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x0cdb('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x0cdb('0x4')],'defaultValue':function(){return _0x0cdb('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0cdb('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0cdb('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0cdb('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0cdb('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0cdb('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0cdb('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0cdb('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x0cdb('0x3')],'defaultValue':![],'comment':_0x0cdb('0x7'),'set':function(_0x350ccb){if(!_0x350ccb)this[_0x0cdb('0x8')](_0x0cdb('0x9'),null);this[_0x0cdb('0x8')](_0x0cdb('0xa'),_0x350ccb);}}}; \ No newline at end of file +var _0x2478=['TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x2478,0x110));var _0x8247=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x2478[_0x243b59];return _0x3e1676;};'use strict';var Sequelize=require(_0x8247('0x0'));module[_0x8247('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x8247('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x8247('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x8247('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x8247('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x8247('0x4')]},'markAsUnread':{'type':Sequelize[_0x8247('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x8247('0x2')],'allowNull':![],'defaultValue':_0x8247('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x8247('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x8247('0x4')],'defaultValue':function(){return _0x8247('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8247('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8247('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8247('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8247('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8247('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8247('0x8')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x8247('0x3')],'defaultValue':![],'comment':_0x8247('0x9'),'set':function(_0x550080){if(!_0x550080)this[_0x8247('0xa')]('mandatoryDispositionPauseId',null);this[_0x8247('0xa')](_0x8247('0xb'),_0x550080);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 4c2623a..2f13d0d 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 _0x0d87=['MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','CmList','List','CmContact','Contacts','updatedAt','DESC','from','attachments','root','basename','pass','secure','auth','List\x20not\x20found','subject','attach','out','messageId','Interaction','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./mailAccount.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~!@#$%^&-_=+[{]}.','then','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','result','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','get','UserProfileResource','destroy','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','mandatoryDispositionPause','MailAccount','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','map','type','key','VIRTUAL','field','includeAll','findAll','rows','catch','show','params','Pause','rawAttributes','include','merge','options','find','update','body','describe','MailAccountId','Disposition','create','getDispositions','findOne','nolimit','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','email','ListId','isNil','active','cservice','cauthentication','user','cuser','password','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','Contact','User','Owner','fullname','internal','color','tag','sequelize','transaction'];(function(_0x300c75,_0x26cbb3){var _0x3337a5=function(_0x3e06ba){while(--_0x3e06ba){_0x300c75['push'](_0x300c75['shift']());}};_0x3337a5(++_0x26cbb3);}(_0x0d87,0xe6));var _0x70d8=function(_0x434d8f,_0x2cabd9){_0x434d8f=_0x434d8f-0x0;var _0x1d1ab3=_0x0d87[_0x434d8f];return _0x1d1ab3;};'use strict';var pdf=require(_0x70d8('0x0'));var emlformat=require(_0x70d8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x70d8('0x2'));var jsonpatch=require(_0x70d8('0x3'));var rp=require('request-promise');var moment=require(_0x70d8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x70d8('0x5'));var util=require(_0x70d8('0x6'));var path=require('path');var sox=require(_0x70d8('0x7'));var csv=require(_0x70d8('0x8'));var ejs=require(_0x70d8('0x9'));var fs=require('fs');var _=require(_0x70d8('0xa'));var squel=require(_0x70d8('0xb'));var crypto=require(_0x70d8('0xc'));var jsforce=require(_0x70d8('0xd'));var deskjs=require(_0x70d8('0xe'));var toCsv=require(_0x70d8('0x8'));var querystring=require(_0x70d8('0xf'));var Papa=require('papaparse');var Redis=require(_0x70d8('0x10'));var authService=require(_0x70d8('0x11'));var qs=require(_0x70d8('0x12'));var hardwareService=require(_0x70d8('0x13'));var logger=require(_0x70d8('0x14'))(_0x70d8('0x15'));var utils=require('../../config/utils');var config=require(_0x70d8('0x16'));var db=require(_0x70d8('0x17'))['db'];config['redis']=_[_0x70d8('0x18')](config['redis'],{'host':_0x70d8('0x19'),'port':0x18eb});var socket=require(_0x70d8('0x1a'))(new Redis(config[_0x70d8('0x1b')]));require(_0x70d8('0x1c'))['register'](socket);var jayson=require(_0x70d8('0x1d'));var client=jayson[_0x70d8('0x1e')][_0x70d8('0x1f')]({'port':0x232b});function checkPasswordPattern(_0x39f552,_0x4b4692,_0x1979f1){if(_0x1979f1){var _0x5e7277=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e7277['test'](_0x4b4692)){return _0x39f552;}else{throw new Error(_0x70d8('0x20'));}}else{return _0x39f552;}}function respondWithRpcPromise(_0x1872f8,_0x345b0d,_0x396421,_0x3ac548){return new BPromise(function(_0x1628cb,_0x5e01f1){var _0x31c276=_0x3ac548||client;return _0x31c276['request'](_0x1872f8,_0x396421)[_0x70d8('0x21')](function(_0x576237){logger[_0x70d8('0x22')]('MailAccount,\x20%s,\x20%s',_0x345b0d,_0x70d8('0x23'));logger['debug'](_0x70d8('0x24'),_0x345b0d,_0x70d8('0x23'),JSON['stringify'](_0x576237));if(_0x576237[_0x70d8('0x25')]){if(_0x576237[_0x70d8('0x25')][_0x70d8('0x26')]===0x1f4){logger[_0x70d8('0x25')](_0x70d8('0x27'),_0x345b0d,_0x576237[_0x70d8('0x25')][_0x70d8('0x28')]);return _0x5e01f1(_0x576237[_0x70d8('0x25')][_0x70d8('0x28')]);}logger[_0x70d8('0x25')]('MailAccount,\x20%s,\x20%s',_0x345b0d,_0x576237[_0x70d8('0x25')][_0x70d8('0x28')]);return _0x1628cb(_0x576237[_0x70d8('0x25')][_0x70d8('0x28')]);}else{logger[_0x70d8('0x22')](_0x70d8('0x27'),_0x345b0d,_0x70d8('0x23'));_0x1628cb(_0x576237[_0x70d8('0x29')][_0x70d8('0x28')]);}})['catch'](function(_0x516569){logger[_0x70d8('0x25')](_0x70d8('0x27'),_0x345b0d,_0x516569);_0x5e01f1(_0x516569);});});}function respondWithStatusCode(_0x2e0f0e,_0x347eaf){_0x347eaf=_0x347eaf||0xcc;return function(_0x11eb85){if(_0x11eb85){return _0x2e0f0e[_0x70d8('0x2a')](_0x347eaf);}return _0x2e0f0e['status'](_0x347eaf)[_0x70d8('0x2b')]();};}function respondWithResult(_0x31089e,_0x407339){_0x407339=_0x407339||0xc8;return function(_0x79cc7d){if(_0x79cc7d){return _0x31089e[_0x70d8('0x2c')](_0x407339)[_0x70d8('0x2d')](_0x79cc7d);}};}function respondWithFilteredResult(_0x4a7b81,_0x355da0){return function(_0x420d2f){if(_0x420d2f){var _0x2e39fb=_0x420d2f[_0x70d8('0x2e')],_0x207939=_0x355da0[_0x70d8('0x2f')],_0x21c09d=_0x355da0[_0x70d8('0x2f')]+_0x355da0[_0x70d8('0x30')],_0x1eea61;if(_0x21c09d>=_0x2e39fb){_0x21c09d=_0x2e39fb;_0x1eea61=0xc8;}else{_0x1eea61=0xce;}_0x4a7b81[_0x70d8('0x2c')](_0x1eea61);return _0x4a7b81[_0x70d8('0x31')](_0x70d8('0x32'),_0x207939+'-'+_0x21c09d+'/'+_0x2e39fb)[_0x70d8('0x2d')](_0x420d2f);}return null;};}function patchUpdates(_0x1b4284){return function(_0x3620d8){try{jsonpatch[_0x70d8('0x33')](_0x3620d8,_0x1b4284,!![]);}catch(_0x1e46b9){return BPromise['reject'](_0x1e46b9);}return _0x3620d8[_0x70d8('0x34')]();};}function saveUpdates(_0x54f413,_0xe25cb3){return function(_0x12ca34){if(_0x12ca34){return _0x12ca34['update'](_0x54f413)[_0x70d8('0x21')](function(_0x1941e1){return _0x1941e1;});}return null;};}function removeEntity(_0x42d2b1,_0x41763a){return function(_0x39206e){if(_0x39206e){return _0x39206e['destroy']()[_0x70d8('0x21')](function(){var _0x562310=_0x39206e[_0x70d8('0x35')]({'plain':!![]});var _0x228579='MailAccounts';return db[_0x70d8('0x36')][_0x70d8('0x37')]({'where':{'type':_0x228579,'resourceId':_0x562310['id']}})[_0x70d8('0x21')](function(){return _0x39206e;});})[_0x70d8('0x21')](function(){_0x42d2b1[_0x70d8('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9cc508,_0x14dfd8){return function(_0x27b434){if(!_0x27b434){_0x9cc508[_0x70d8('0x2a')](0x194);}return _0x27b434;};}function handleError(_0x1ceace,_0x47f940){_0x47f940=_0x47f940||0x1f4;return function(_0x443e2d){logger['error'](_0x443e2d['stack']);if(_0x443e2d['name']){delete _0x443e2d[_0x70d8('0x38')];}_0x1ceace[_0x70d8('0x2c')](_0x47f940)[_0x70d8('0x39')](_0x443e2d);};}exports[_0x70d8('0x3a')]=function(_0x8350d6,_0x10e571){var _0x2b74ac={'include':[{'model':db[_0x70d8('0x3b')],'as':_0x70d8('0x3c')},{'model':db[_0x70d8('0x3d')],'as':_0x70d8('0x3e')},{'model':db['Pause'],'as':_0x70d8('0x3f')}]},_0xd95667={},_0x31cef0={'count':0x0,'rows':[]};var _0x251e0f=db[_0x70d8('0x40')]['rawAttributes'];_0xd95667[_0x70d8('0x41')]=_[_0x70d8('0x42')](_0x251e0f);_0xd95667[_0x70d8('0x43')]=_[_0x70d8('0x42')](_0x8350d6[_0x70d8('0x43')]);_0xd95667['filters']=_[_0x70d8('0x44')](_0xd95667[_0x70d8('0x41')],_0xd95667[_0x70d8('0x43')]);_0x2b74ac[_0x70d8('0x45')]=_[_0x70d8('0x44')](_0xd95667[_0x70d8('0x41')],qs[_0x70d8('0x46')](_0x8350d6[_0x70d8('0x43')][_0x70d8('0x46')]));_0x2b74ac['attributes']=_0x2b74ac[_0x70d8('0x45')][_0x70d8('0x47')]?_0x2b74ac[_0x70d8('0x45')]:_0xd95667['model'];if(!_0x8350d6[_0x70d8('0x43')][_0x70d8('0x48')]('nolimit')){_0x2b74ac['limit']=qs[_0x70d8('0x30')](_0x8350d6[_0x70d8('0x43')][_0x70d8('0x30')]);_0x2b74ac[_0x70d8('0x2f')]=qs['offset'](_0x8350d6[_0x70d8('0x43')][_0x70d8('0x2f')]);}_0x2b74ac[_0x70d8('0x49')]=qs['sort'](_0x8350d6[_0x70d8('0x43')][_0x70d8('0x4a')]);_0x2b74ac[_0x70d8('0x4b')]=qs[_0x70d8('0x4c')](_[_0x70d8('0x4d')](_0x8350d6[_0x70d8('0x43')],_0xd95667[_0x70d8('0x4c')]));if(_0x8350d6['query'][_0x70d8('0x4e')]){_0x2b74ac[_0x70d8('0x4b')]=_['merge'](_0x2b74ac[_0x70d8('0x4b')],{'$or':_[_0x70d8('0x4f')](_0x251e0f,function(_0x9e51b){if(_0x9e51b[_0x70d8('0x50')][_0x70d8('0x51')]!==_0x70d8('0x52')){var _0x5c574d={};_0x5c574d[_0x9e51b[_0x70d8('0x53')]]={'$like':'%'+_0x8350d6['query'][_0x70d8('0x4e')]+'%'};return _0x5c574d;}})});}_0x2b74ac=_['merge']({},_0x2b74ac,_0x8350d6['options']);var _0x910224={'where':_0x2b74ac[_0x70d8('0x4b')]};return db[_0x70d8('0x40')][_0x70d8('0x2e')](_0x910224)['then'](function(_0x1ff45d){_0x31cef0[_0x70d8('0x2e')]=_0x1ff45d;if(_0x8350d6[_0x70d8('0x43')][_0x70d8('0x54')]){_0x2b74ac['include']=[{'all':!![]}];}return db[_0x70d8('0x40')][_0x70d8('0x55')](_0x2b74ac);})['then'](function(_0x23bc1c){_0x31cef0[_0x70d8('0x56')]=_0x23bc1c;return _0x31cef0;})[_0x70d8('0x21')](respondWithFilteredResult(_0x10e571,_0x2b74ac))[_0x70d8('0x57')](handleError(_0x10e571,null));};exports[_0x70d8('0x58')]=function(_0x500856,_0x12536f){var _0x32931b={'raw':![],'where':{'id':_0x500856[_0x70d8('0x59')]['id']},'include':[{'model':db[_0x70d8('0x3b')],'as':_0x70d8('0x3c')},{'model':db[_0x70d8('0x3d')],'as':'Smtp'},{'model':db[_0x70d8('0x5a')],'as':_0x70d8('0x3f')}]},_0x228261={};_0x228261['model']=_['keys'](db[_0x70d8('0x40')][_0x70d8('0x5b')]);_0x228261[_0x70d8('0x43')]=_[_0x70d8('0x42')](_0x500856[_0x70d8('0x43')]);_0x228261[_0x70d8('0x4c')]=_[_0x70d8('0x44')](_0x228261[_0x70d8('0x41')],_0x228261[_0x70d8('0x43')]);_0x32931b[_0x70d8('0x45')]=_[_0x70d8('0x44')](_0x228261[_0x70d8('0x41')],qs[_0x70d8('0x46')](_0x500856[_0x70d8('0x43')]['fields']));_0x32931b['attributes']=_0x32931b['attributes']['length']?_0x32931b[_0x70d8('0x45')]:_0x228261[_0x70d8('0x41')];if(_0x500856['query'][_0x70d8('0x54')]){_0x32931b[_0x70d8('0x5c')]=[{'all':!![]}];}_0x32931b=_[_0x70d8('0x5d')]({},_0x32931b,_0x500856[_0x70d8('0x5e')]);return db[_0x70d8('0x40')][_0x70d8('0x5f')](_0x32931b)[_0x70d8('0x21')](handleEntityNotFound(_0x12536f,null))['then'](respondWithResult(_0x12536f,null))[_0x70d8('0x57')](handleError(_0x12536f,null));};exports[_0x70d8('0x60')]=function(_0x47607d,_0x23d0f0){if(_0x47607d[_0x70d8('0x61')]['id']){delete _0x47607d[_0x70d8('0x61')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x47607d[_0x70d8('0x59')]['id']},'include':[{'model':db[_0x70d8('0x3b')],'as':_0x70d8('0x3c')},{'model':db[_0x70d8('0x3d')],'as':'Smtp'},{'model':db[_0x70d8('0x5a')],'as':_0x70d8('0x3f')}]})[_0x70d8('0x21')](handleEntityNotFound(_0x23d0f0,null))[_0x70d8('0x21')](saveUpdates(_0x47607d[_0x70d8('0x61')],null))['then'](function(_0xb7687e){if(_0xb7687e&&_0x47607d[_0x70d8('0x61')][_0x70d8('0x3c')]){return db[_0x70d8('0x3b')][_0x70d8('0x60')](_0x47607d[_0x70d8('0x61')][_0x70d8('0x3c')],{'where':{'MailAccountId':_0xb7687e['id']}})[_0x70d8('0x21')](function(){return _0xb7687e;});}return _0xb7687e;})['then'](function(_0x44d18e){if(_0x44d18e&&_0x47607d[_0x70d8('0x61')]['Smtp']){return db[_0x70d8('0x3d')][_0x70d8('0x60')](_0x47607d[_0x70d8('0x61')]['Smtp'],{'where':{'MailAccountId':_0x44d18e['id']}})['then'](function(){return _0x44d18e;});}return _0x44d18e;})[_0x70d8('0x21')](respondWithResult(_0x23d0f0,null))['catch'](handleError(_0x23d0f0,null));};exports[_0x70d8('0x62')]=function(_0x30b1b,_0x11b3ab){return db[_0x70d8('0x40')][_0x70d8('0x62')]()[_0x70d8('0x21')](respondWithResult(_0x11b3ab,null))[_0x70d8('0x57')](handleError(_0x11b3ab,null));};exports['addDisposition']=function(_0x5d9d70,_0x340500,_0x180b41){if(_0x5d9d70['body']['id']){delete _0x5d9d70[_0x70d8('0x61')]['id'];}return db['MailAccount'][_0x70d8('0x5f')]({'where':{'id':_0x5d9d70['params']['id']}})[_0x70d8('0x21')](handleEntityNotFound(_0x340500,null))[_0x70d8('0x21')](function(_0x248f5b){if(_0x248f5b){_0x5d9d70[_0x70d8('0x61')][_0x70d8('0x63')]=_0x248f5b['id'];return db[_0x70d8('0x64')][_0x70d8('0x65')](_0x5d9d70[_0x70d8('0x61')]);}})[_0x70d8('0x21')](respondWithResult(_0x340500,null))[_0x70d8('0x57')](handleError(_0x340500,null));};exports[_0x70d8('0x66')]=function(_0x34038a,_0xad356d,_0x509bfd){var _0x256a0a={'raw':![],'where':{}};var _0x59ff95={};var _0x415a38={'count':0x0,'rows':[]};return db[_0x70d8('0x40')][_0x70d8('0x67')]({'where':{'id':_0x34038a['params']['id']}})[_0x70d8('0x21')](handleEntityNotFound(_0xad356d,null))['then'](function(_0x72478c){if(_0x72478c){_0x59ff95[_0x70d8('0x41')]=_['keys'](db['Disposition'][_0x70d8('0x5b')]);_0x59ff95[_0x70d8('0x43')]=_[_0x70d8('0x42')](_0x34038a['query']);_0x59ff95[_0x70d8('0x4c')]=_[_0x70d8('0x44')](_0x59ff95['model'],_0x59ff95[_0x70d8('0x43')]);_0x256a0a['attributes']=_['intersection'](_0x59ff95[_0x70d8('0x41')],qs['fields'](_0x34038a[_0x70d8('0x43')][_0x70d8('0x46')]));_0x256a0a[_0x70d8('0x45')]=_0x256a0a['attributes'][_0x70d8('0x47')]?_0x256a0a['attributes']:_0x59ff95['model'];if(!_0x34038a[_0x70d8('0x43')]['hasOwnProperty'](_0x70d8('0x68'))){_0x256a0a[_0x70d8('0x30')]=qs[_0x70d8('0x30')](_0x34038a['query'][_0x70d8('0x30')]);_0x256a0a['offset']=qs[_0x70d8('0x2f')](_0x34038a[_0x70d8('0x43')]['offset']);}_0x256a0a[_0x70d8('0x49')]=qs[_0x70d8('0x4a')](_0x34038a['query'][_0x70d8('0x4a')]);_0x256a0a[_0x70d8('0x4b')]=qs[_0x70d8('0x4c')](_[_0x70d8('0x4d')](_0x34038a[_0x70d8('0x43')],_0x59ff95[_0x70d8('0x4c')]));_0x256a0a[_0x70d8('0x4b')]['MailAccountId']=_0x72478c['id'];if(_0x34038a[_0x70d8('0x43')][_0x70d8('0x4e')]){_0x256a0a[_0x70d8('0x4b')]=_['merge'](_0x256a0a[_0x70d8('0x4b')],{'$or':_[_0x70d8('0x4f')](_0x256a0a[_0x70d8('0x45')],function(_0x3b3ef3){var _0x500dd8={};_0x500dd8[_0x3b3ef3]={'$like':'%'+_0x34038a['query'][_0x70d8('0x4e')]+'%'};return _0x500dd8;})});}_0x256a0a=_[_0x70d8('0x5d')]({},_0x256a0a,_0x34038a[_0x70d8('0x5e')]);return db[_0x70d8('0x64')][_0x70d8('0x2e')]({'where':_0x256a0a['where']})['then'](function(_0x383cae){_0x415a38[_0x70d8('0x2e')]=_0x383cae;if(_0x34038a[_0x70d8('0x43')][_0x70d8('0x54')]){_0x256a0a[_0x70d8('0x5c')]=[{'all':!![]}];}return db['Disposition'][_0x70d8('0x55')](_0x256a0a);})['then'](function(_0x93244b){_0x415a38[_0x70d8('0x56')]=_0x93244b;return _0x415a38;});}})['then'](respondWithFilteredResult(_0xad356d,_0x256a0a))[_0x70d8('0x57')](handleError(_0xad356d,null));};exports[_0x70d8('0x69')]=function(_0x3b3386,_0x3d79b6,_0x397537){return db[_0x70d8('0x40')][_0x70d8('0x5f')]({'where':{'id':_0x3b3386['params']['id']}})[_0x70d8('0x21')](handleEntityNotFound(_0x3d79b6,null))['then'](function(_0x441db2){if(_0x441db2){return _0x441db2[_0x70d8('0x69')](_0x3b3386[_0x70d8('0x43')][_0x70d8('0x6a')]);}})[_0x70d8('0x21')](respondWithStatusCode(_0x3d79b6,null))['catch'](handleError(_0x3d79b6,null));};exports['addAnswer']=function(_0x3428b3,_0x359af8,_0x3b759d){if(_0x3428b3[_0x70d8('0x61')]['id']){delete _0x3428b3[_0x70d8('0x61')]['id'];}return db['MailAccount'][_0x70d8('0x5f')]({'where':{'id':_0x3428b3[_0x70d8('0x59')]['id']}})[_0x70d8('0x21')](handleEntityNotFound(_0x359af8,null))['then'](function(_0x3a1d6b){if(_0x3a1d6b){_0x3428b3[_0x70d8('0x61')][_0x70d8('0x63')]=_0x3a1d6b['id'];return db[_0x70d8('0x6b')]['create'](_0x3428b3[_0x70d8('0x61')]);}})[_0x70d8('0x21')](respondWithResult(_0x359af8,null))[_0x70d8('0x57')](handleError(_0x359af8,null));};exports[_0x70d8('0x6c')]=function(_0x579d8f,_0x310663,_0x1477bd){var _0x4ad4ea={'raw':![],'where':{}};var _0x423f7c={};var _0x4fb935={'count':0x0,'rows':[]};return db[_0x70d8('0x40')][_0x70d8('0x67')]({'where':{'id':_0x579d8f[_0x70d8('0x59')]['id']}})[_0x70d8('0x21')](handleEntityNotFound(_0x310663,null))[_0x70d8('0x21')](function(_0x4e497c){if(_0x4e497c){_0x423f7c[_0x70d8('0x41')]=_[_0x70d8('0x42')](db[_0x70d8('0x6b')][_0x70d8('0x5b')]);_0x423f7c[_0x70d8('0x43')]=_[_0x70d8('0x42')](_0x579d8f[_0x70d8('0x43')]);_0x423f7c[_0x70d8('0x4c')]=_[_0x70d8('0x44')](_0x423f7c[_0x70d8('0x41')],_0x423f7c[_0x70d8('0x43')]);_0x4ad4ea[_0x70d8('0x45')]=_[_0x70d8('0x44')](_0x423f7c[_0x70d8('0x41')],qs['fields'](_0x579d8f[_0x70d8('0x43')][_0x70d8('0x46')]));_0x4ad4ea[_0x70d8('0x45')]=_0x4ad4ea['attributes'][_0x70d8('0x47')]?_0x4ad4ea[_0x70d8('0x45')]:_0x423f7c[_0x70d8('0x41')];if(!_0x579d8f[_0x70d8('0x43')]['hasOwnProperty']('nolimit')){_0x4ad4ea[_0x70d8('0x30')]=qs[_0x70d8('0x30')](_0x579d8f[_0x70d8('0x43')][_0x70d8('0x30')]);_0x4ad4ea['offset']=qs[_0x70d8('0x2f')](_0x579d8f[_0x70d8('0x43')][_0x70d8('0x2f')]);}_0x4ad4ea[_0x70d8('0x49')]=qs[_0x70d8('0x4a')](_0x579d8f[_0x70d8('0x43')]['sort']);_0x4ad4ea[_0x70d8('0x4b')]=qs['filters'](_[_0x70d8('0x4d')](_0x579d8f[_0x70d8('0x43')],_0x423f7c[_0x70d8('0x4c')]));_0x4ad4ea[_0x70d8('0x4b')][_0x70d8('0x63')]=_0x4e497c['id'];if(_0x579d8f[_0x70d8('0x43')][_0x70d8('0x4e')]){_0x4ad4ea['where']=_[_0x70d8('0x5d')](_0x4ad4ea['where'],{'$or':_['map'](_0x4ad4ea[_0x70d8('0x45')],function(_0x4ece8b){var _0xd9485b={};_0xd9485b[_0x4ece8b]={'$like':'%'+_0x579d8f[_0x70d8('0x43')]['filter']+'%'};return _0xd9485b;})});}_0x4ad4ea=_[_0x70d8('0x5d')]({},_0x4ad4ea,_0x579d8f[_0x70d8('0x5e')]);return db['CannedAnswer']['count']({'where':_0x4ad4ea[_0x70d8('0x4b')]})[_0x70d8('0x21')](function(_0xb8a90d){_0x4fb935['count']=_0xb8a90d;if(_0x579d8f['query'][_0x70d8('0x54')]){_0x4ad4ea['include']=[{'all':!![]}];}return db[_0x70d8('0x6b')][_0x70d8('0x55')](_0x4ad4ea);})[_0x70d8('0x21')](function(_0x401dc6){_0x4fb935[_0x70d8('0x56')]=_0x401dc6;return _0x4fb935;});}})[_0x70d8('0x21')](respondWithFilteredResult(_0x310663,_0x4ad4ea))[_0x70d8('0x57')](handleError(_0x310663,null));};exports[_0x70d8('0x6d')]=function(_0xad0dca,_0x4a65cd,_0x272d05){return db[_0x70d8('0x40')][_0x70d8('0x5f')]({'where':{'id':_0xad0dca[_0x70d8('0x59')]['id']}})[_0x70d8('0x21')](handleEntityNotFound(_0x4a65cd,null))['then'](function(_0x45dc80){if(_0x45dc80){return _0x45dc80['removeAnswers'](_0xad0dca[_0x70d8('0x43')][_0x70d8('0x6a')]);}})[_0x70d8('0x21')](respondWithStatusCode(_0x4a65cd,null))['catch'](handleError(_0x4a65cd,null));};exports[_0x70d8('0x65')]=function(_0x162a87,_0x16e9bc){var _0x246c96={'name':_0x162a87[_0x70d8('0x61')][_0x70d8('0x38')],'key':_0x162a87[_0x70d8('0x61')]['key'],'email':_0x162a87[_0x70d8('0x61')][_0x70d8('0x6e')],'ListId':_0x162a87['body'][_0x70d8('0x6f')],'active':!_[_0x70d8('0x70')](_0x162a87[_0x70d8('0x61')][_0x70d8('0x71')])?_0x162a87[_0x70d8('0x61')][_0x70d8('0x71')]:!![],'description':_0x162a87[_0x70d8('0x61')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0x70d8('0x70')](_0x162a87[_0x70d8('0x61')][_0x70d8('0x72')])){if(_0x162a87['body'][_0x70d8('0x73')]){_0x246c96[_0x70d8('0x3c')][_0x70d8('0x74')]=_0x246c96['Smtp'][_0x70d8('0x74')]=_0x162a87[_0x70d8('0x61')][_0x70d8('0x75')];_0x246c96[_0x70d8('0x3c')][_0x70d8('0x76')]=_0x246c96['Smtp']['pass']=_0x162a87[_0x70d8('0x61')][_0x70d8('0x77')];}else{_0x246c96['Imap'][_0x70d8('0x78')]=_0x246c96[_0x70d8('0x3e')][_0x70d8('0x78')]=![];}_0x246c96[_0x70d8('0x3c')][_0x70d8('0x79')]=_0x162a87[_0x70d8('0x61')][_0x70d8('0x3c')][_0x70d8('0x79')];_0x246c96[_0x70d8('0x3c')]['port']=_0x162a87['body'][_0x70d8('0x3c')][_0x70d8('0x7a')];_0x246c96['Smtp'][_0x70d8('0x79')]=_0x162a87[_0x70d8('0x61')][_0x70d8('0x3e')][_0x70d8('0x79')];_0x246c96[_0x70d8('0x3e')][_0x70d8('0x7a')]=_0x162a87[_0x70d8('0x61')][_0x70d8('0x3e')][_0x70d8('0x7a')];}else{_0x246c96['Imap'][_0x70d8('0x7b')]=_0x246c96[_0x70d8('0x3e')][_0x70d8('0x7b')]=_0x162a87[_0x70d8('0x61')]['cservice'];_0x246c96['Imap'][_0x70d8('0x74')]=_0x246c96[_0x70d8('0x3e')]['user']=_0x162a87[_0x70d8('0x61')]['cuser'];_0x246c96['Imap'][_0x70d8('0x76')]=_0x246c96[_0x70d8('0x3e')]['pass']=_0x162a87['body'][_0x70d8('0x77')];}return db[_0x70d8('0x40')][_0x70d8('0x65')](_0x246c96,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x70d8('0x3b')],'as':_0x70d8('0x3c')}]})[_0x70d8('0x21')](function(_0x3748b2){var _0x6658dd=_0x162a87[_0x70d8('0x74')][_0x70d8('0x35')]({'plain':!![]});if(!_0x6658dd)throw new Error(_0x70d8('0x7c'));if(_0x6658dd[_0x70d8('0x7d')]===_0x70d8('0x74')){var _0x5d4142=_0x3748b2[_0x70d8('0x35')]({'plain':!![]});return db[_0x70d8('0x7e')][_0x70d8('0x5f')]({'where':{'name':_0x70d8('0x7f'),'userProfileId':_0x6658dd[_0x70d8('0x80')]},'raw':!![]})[_0x70d8('0x21')](function(_0x19ef9f){if(_0x19ef9f&&_0x19ef9f[_0x70d8('0x81')]===0x0){return db[_0x70d8('0x36')]['create']({'name':_0x5d4142[_0x70d8('0x38')],'resourceId':_0x5d4142['id'],'type':_0x19ef9f[_0x70d8('0x38')],'sectionId':_0x19ef9f['id']},{})['then'](function(){return _0x3748b2;});}else{return _0x3748b2;}})[_0x70d8('0x57')](function(_0x68f627){logger[_0x70d8('0x25')](_0x70d8('0x82'),_0x68f627);throw _0x68f627;});}return _0x3748b2;})[_0x70d8('0x21')](respondWithResult(_0x16e9bc,0xc9))[_0x70d8('0x57')](handleError(_0x16e9bc,null));};exports[_0x70d8('0x83')]=function(_0x2f25ba,_0x55d6fa,_0x2748a7){return db[_0x70d8('0x40')][_0x70d8('0x67')]({'where':{'id':_0x2f25ba[_0x70d8('0x59')]['id']}})['then'](handleEntityNotFound(_0x55d6fa,null))[_0x70d8('0x21')](function(_0x2f35aa){if(_0x2f35aa){return _0x2f35aa[_0x70d8('0x83')]();}return null;})[_0x70d8('0x21')](respondWithResult(_0x55d6fa,null))[_0x70d8('0x57')](handleError(_0x55d6fa,null));};exports[_0x70d8('0x84')]=function(_0x206b10,_0x3e788f,_0x4fc3ef){if(_0x206b10[_0x70d8('0x61')]['id']){delete _0x206b10[_0x70d8('0x61')]['id'];}return db[_0x70d8('0x40')][_0x70d8('0x5f')]({'where':{'id':_0x206b10[_0x70d8('0x59')]['id']}})[_0x70d8('0x21')](handleEntityNotFound(_0x3e788f,null))[_0x70d8('0x21')](function(_0x422003){if(_0x422003){_0x206b10[_0x70d8('0x61')][_0x70d8('0x63')]=_0x422003['id'];return db[_0x70d8('0x3b')][_0x70d8('0x65')](_0x206b10[_0x70d8('0x61')]);}})['then'](respondWithResult(_0x3e788f,null))['catch'](handleError(_0x3e788f,null));};exports[_0x70d8('0x85')]=function(_0x1f4bab,_0x5e1eba,_0x1f49e7){return db[_0x70d8('0x40')][_0x70d8('0x67')]({'where':{'id':_0x1f4bab[_0x70d8('0x59')]['id']}})['then'](handleEntityNotFound(_0x5e1eba,null))['then'](function(_0x52eae4){if(_0x52eae4){return _0x52eae4[_0x70d8('0x86')](null);}return null;})[_0x70d8('0x21')](respondWithStatusCode(_0x5e1eba,null))[_0x70d8('0x57')](handleError(_0x5e1eba,null));};exports[_0x70d8('0x87')]=function(_0x179132,_0x256a48,_0x37b9b2){return db[_0x70d8('0x40')][_0x70d8('0x67')]({'where':{'id':_0x179132[_0x70d8('0x59')]['id']}})[_0x70d8('0x21')](handleEntityNotFound(_0x256a48,null))['then'](function(_0x49611c){if(_0x49611c){return _0x49611c[_0x70d8('0x87')]();}return null;})[_0x70d8('0x21')](respondWithResult(_0x256a48,null))[_0x70d8('0x57')](handleError(_0x256a48,null));};exports[_0x70d8('0x88')]=function(_0x34af0c,_0x3296d5,_0x3d7c78){if(_0x34af0c[_0x70d8('0x61')]['id']){delete _0x34af0c['body']['id'];}return db[_0x70d8('0x40')][_0x70d8('0x5f')]({'where':{'id':_0x34af0c[_0x70d8('0x59')]['id']}})[_0x70d8('0x21')](handleEntityNotFound(_0x3296d5,null))[_0x70d8('0x21')](function(_0x182518){if(_0x182518){_0x34af0c[_0x70d8('0x61')][_0x70d8('0x63')]=_0x182518['id'];return db[_0x70d8('0x3d')][_0x70d8('0x65')](_0x34af0c['body']);}})[_0x70d8('0x21')](respondWithResult(_0x3296d5,null))[_0x70d8('0x57')](handleError(_0x3296d5,null));};exports['removeSmtp']=function(_0x337895,_0x34b8fc,_0x30fe8e){return db[_0x70d8('0x40')][_0x70d8('0x67')]({'where':{'id':_0x337895['params']['id']}})[_0x70d8('0x21')](handleEntityNotFound(_0x34b8fc,null))[_0x70d8('0x21')](function(_0x4f122e){if(_0x4f122e){return _0x4f122e[_0x70d8('0x89')](null);}return null;})['then'](respondWithStatusCode(_0x34b8fc,null))['catch'](handleError(_0x34b8fc,null));};exports[_0x70d8('0x8a')]=function(_0x170a64,_0x457145,_0x5a353e){return db[_0x70d8('0x8b')][_0x70d8('0x5f')]({'where':{'id':_0x170a64[_0x70d8('0x59')]['id']}})[_0x70d8('0x21')](handleEntityNotFound(_0x457145,null))[_0x70d8('0x21')](function(_0x38f4d6){if(_0x38f4d6){return _0x38f4d6[_0x70d8('0x8a')](_0x170a64[_0x70d8('0x61')][_0x70d8('0x6a')],_['omit'](_0x170a64[_0x70d8('0x61')],[_0x70d8('0x6a'),'id'])||{});}})[_0x70d8('0x21')](respondWithResult(_0x457145,null))[_0x70d8('0x57')](handleError(_0x457145,null));};exports[_0x70d8('0x8c')]=function(_0x34694f,_0x1f7b6a,_0x1bc892){var _0x4234cb={'raw':![],'where':{}};var _0x4d00dc={};var _0x5b7a0a={'count':0x0,'rows':[]};return db[_0x70d8('0x40')][_0x70d8('0x67')]({'where':{'id':_0x34694f[_0x70d8('0x59')]['id']}})[_0x70d8('0x21')](handleEntityNotFound(_0x1f7b6a,null))[_0x70d8('0x21')](function(_0x1ceef9){if(_0x1ceef9){_0x4d00dc[_0x70d8('0x41')]=_['keys'](db[_0x70d8('0x8b')][_0x70d8('0x5b')]);_0x4d00dc[_0x70d8('0x43')]=_[_0x70d8('0x42')](_0x34694f['query']);_0x4d00dc[_0x70d8('0x4c')]=_[_0x70d8('0x44')](_0x4d00dc[_0x70d8('0x41')],_0x4d00dc['query']);_0x4234cb[_0x70d8('0x45')]=_[_0x70d8('0x44')](_0x4d00dc[_0x70d8('0x41')],qs['fields'](_0x34694f[_0x70d8('0x43')][_0x70d8('0x46')]));_0x4234cb[_0x70d8('0x45')]=_0x4234cb[_0x70d8('0x45')][_0x70d8('0x47')]?_0x4234cb[_0x70d8('0x45')]:_0x4d00dc[_0x70d8('0x41')];if(!_0x34694f['query'][_0x70d8('0x48')](_0x70d8('0x68'))){_0x4234cb[_0x70d8('0x30')]=qs['limit'](_0x34694f[_0x70d8('0x43')]['limit']);_0x4234cb[_0x70d8('0x2f')]=qs[_0x70d8('0x2f')](_0x34694f[_0x70d8('0x43')][_0x70d8('0x2f')]);}_0x4234cb[_0x70d8('0x49')]=qs[_0x70d8('0x4a')](_0x34694f['query'][_0x70d8('0x4a')]);_0x4234cb[_0x70d8('0x4b')]=qs[_0x70d8('0x4c')](_['pick'](_0x34694f[_0x70d8('0x43')],_0x4d00dc['filters']));_0x4234cb[_0x70d8('0x4b')][_0x70d8('0x63')]=_0x1ceef9['id'];if(_0x34694f[_0x70d8('0x43')][_0x70d8('0x4e')]){_0x4234cb[_0x70d8('0x4b')]=_['merge'](_0x4234cb['where'],{'$or':_[_0x70d8('0x4f')](_0x4234cb[_0x70d8('0x45')],function(_0x4dc202){var _0x35816a={};_0x35816a[_0x4dc202]={'$like':'%'+_0x34694f[_0x70d8('0x43')]['filter']+'%'};return _0x35816a;})});}_0x4234cb=_[_0x70d8('0x5d')]({},_0x4234cb,_0x34694f['options']);return db[_0x70d8('0x8b')][_0x70d8('0x2e')]({'where':_0x4234cb[_0x70d8('0x4b')]})[_0x70d8('0x21')](function(_0x365ed7){_0x5b7a0a['count']=_0x365ed7;if(_0x34694f[_0x70d8('0x43')][_0x70d8('0x54')]){_0x4234cb[_0x70d8('0x5c')]=[{'model':db['CmContact'],'as':_0x70d8('0x8d'),'required':![]},{'model':db[_0x70d8('0x8e')],'as':_0x70d8('0x8f'),'attributes':[_0x70d8('0x38'),_0x70d8('0x90'),_0x70d8('0x91')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x70d8('0x38'),_0x70d8('0x92')],'where':_0x34694f[_0x70d8('0x43')]['tag']?{'id':_0x34694f[_0x70d8('0x43')][_0x70d8('0x93')]}:undefined,'required':_0x34694f[_0x70d8('0x43')][_0x70d8('0x93')]?!![]:![]}];}return db['MailInteraction']['findAll'](_0x4234cb);})['then'](function(_0x39f22d){_0x5b7a0a[_0x70d8('0x56')]=_0x39f22d;return _0x5b7a0a;});}})[_0x70d8('0x21')](respondWithFilteredResult(_0x1f7b6a,_0x4234cb))[_0x70d8('0x57')](handleError(_0x1f7b6a,null));};exports['addApplications']=function(_0x111656,_0x2df1a5,_0x6436b3){return db[_0x70d8('0x40')][_0x70d8('0x67')]({'where':{'id':_0x111656[_0x70d8('0x59')]['id']}})[_0x70d8('0x21')](handleEntityNotFound(_0x2df1a5,null))[_0x70d8('0x21')](function(_0x835dcd){if(_0x835dcd){return db[_0x70d8('0x94')][_0x70d8('0x95')](function(_0x52f62c){return db['MailApplication'][_0x70d8('0x37')]({'where':{'MailAccountId':_0x111656[_0x70d8('0x59')]['id']},'transaction':_0x52f62c})[_0x70d8('0x21')](function(_0x6e477d){var _0x4e9628=_['map'](_0x111656[_0x70d8('0x61')],function(_0x3ff800){_0x3ff800[_0x70d8('0x63')]=_0x111656[_0x70d8('0x59')]['id'];return _0x3ff800;});return db[_0x70d8('0x96')][_0x70d8('0x97')](_0x4e9628,{'transaction':_0x52f62c});});})['then'](function(){return db[_0x70d8('0x96')][_0x70d8('0x98')]({'where':{'MailAccountId':_0x111656['params']['id']},'order':_0x70d8('0x99')});});}})[_0x70d8('0x21')](respondWithResult(_0x2df1a5,null))[_0x70d8('0x57')](handleError(_0x2df1a5,null));};exports[_0x70d8('0x9a')]=function(_0x2b4b4b,_0x4db7c1,_0x20e748){var _0x144a77={};var _0x486936={};var _0x15bf23;var _0x41ba74;return db['MailAccount'][_0x70d8('0x67')]({'where':{'id':_0x2b4b4b[_0x70d8('0x59')]['id']}})[_0x70d8('0x21')](handleEntityNotFound(_0x4db7c1,null))[_0x70d8('0x21')](function(_0x418a14){if(_0x418a14){_0x15bf23=_0x418a14;_0x486936[_0x70d8('0x41')]=_[_0x70d8('0x42')](db[_0x70d8('0x96')][_0x70d8('0x5b')]);_0x486936[_0x70d8('0x43')]=_[_0x70d8('0x42')](_0x2b4b4b[_0x70d8('0x43')]);_0x486936[_0x70d8('0x4c')]=_['intersection'](_0x486936[_0x70d8('0x41')],_0x486936[_0x70d8('0x43')]);_0x144a77['attributes']=_[_0x70d8('0x44')](_0x486936[_0x70d8('0x41')],qs['fields'](_0x2b4b4b[_0x70d8('0x43')][_0x70d8('0x46')]));_0x144a77[_0x70d8('0x45')]=_0x144a77['attributes'][_0x70d8('0x47')]?_0x144a77[_0x70d8('0x45')]:_0x486936[_0x70d8('0x41')];_0x144a77[_0x70d8('0x49')]=qs[_0x70d8('0x4a')](_0x2b4b4b[_0x70d8('0x43')]['sort']);_0x144a77['where']=qs[_0x70d8('0x4c')](_[_0x70d8('0x4d')](_0x2b4b4b[_0x70d8('0x43')],_0x486936['filters']));if(_0x2b4b4b[_0x70d8('0x43')]['filter']){_0x144a77[_0x70d8('0x4b')]=_[_0x70d8('0x5d')](_0x144a77[_0x70d8('0x4b')],{'$or':_[_0x70d8('0x4f')](_0x144a77[_0x70d8('0x45')],function(_0x18ab2a){var _0x457fe3={};_0x457fe3[_0x18ab2a]={'$like':'%'+_0x2b4b4b['query'][_0x70d8('0x4e')]+'%'};return _0x457fe3;})});}_0x144a77=_[_0x70d8('0x5d')]({},_0x144a77,_0x2b4b4b['options']);return _0x15bf23[_0x70d8('0x9a')](_0x144a77);}})['then'](function(_0x169cee){if(_0x169cee){_0x41ba74=_0x169cee[_0x70d8('0x47')];if(!_0x2b4b4b[_0x70d8('0x43')][_0x70d8('0x48')](_0x70d8('0x68'))){_0x144a77[_0x70d8('0x30')]=qs['limit'](_0x2b4b4b[_0x70d8('0x43')][_0x70d8('0x30')]);_0x144a77[_0x70d8('0x2f')]=qs['offset'](_0x2b4b4b[_0x70d8('0x43')][_0x70d8('0x2f')]);}return _0x15bf23['getApplications'](_0x144a77);}})[_0x70d8('0x21')](function(_0xdf0e44){if(_0xdf0e44){return _0xdf0e44?{'count':_0x41ba74,'rows':_0xdf0e44}:null;}})[_0x70d8('0x21')](respondWithResult(_0x4db7c1,null))[_0x70d8('0x57')](handleError(_0x4db7c1,null));};exports[_0x70d8('0x9b')]=function(_0x291251,_0x5c8615,_0x3c504f){var _0x49485e={'raw':!![],'where':{}};var _0x26d505={};var _0x1a64e5={'count':0x0,'rows':[]};return db[_0x70d8('0x40')][_0x70d8('0x67')]({'where':{'id':_0x291251[_0x70d8('0x59')]['id']}})[_0x70d8('0x21')](handleEntityNotFound(_0x5c8615,null))['then'](function(_0x53a904){if(_0x53a904){_0x26d505[_0x70d8('0x41')]=_[_0x70d8('0x42')](db[_0x70d8('0x9c')][_0x70d8('0x5b')]);_0x26d505[_0x70d8('0x43')]=_[_0x70d8('0x42')](_0x291251['query']);_0x26d505['filters']=_['intersection'](_0x26d505[_0x70d8('0x41')],_0x26d505[_0x70d8('0x43')]);_0x49485e[_0x70d8('0x45')]=_['intersection'](_0x26d505[_0x70d8('0x41')],qs[_0x70d8('0x46')](_0x291251['query'][_0x70d8('0x46')]));_0x49485e[_0x70d8('0x45')]=_0x49485e[_0x70d8('0x45')][_0x70d8('0x47')]?_0x49485e[_0x70d8('0x45')]:_0x26d505[_0x70d8('0x41')];if(!_0x291251[_0x70d8('0x43')][_0x70d8('0x48')](_0x70d8('0x68'))){_0x49485e[_0x70d8('0x30')]=qs[_0x70d8('0x30')](_0x291251[_0x70d8('0x43')][_0x70d8('0x30')]);_0x49485e[_0x70d8('0x2f')]=qs[_0x70d8('0x2f')](_0x291251[_0x70d8('0x43')][_0x70d8('0x2f')]);}_0x49485e[_0x70d8('0x49')]=qs['sort'](_0x291251[_0x70d8('0x43')][_0x70d8('0x4a')]);_0x49485e['where']=qs[_0x70d8('0x4c')](_[_0x70d8('0x4d')](_0x291251[_0x70d8('0x43')],_0x26d505[_0x70d8('0x4c')]));_0x49485e[_0x70d8('0x4b')][_0x70d8('0x63')]=_0x53a904['id'];if(_0x291251[_0x70d8('0x43')]['filter']){_0x49485e[_0x70d8('0x4b')]=_[_0x70d8('0x5d')](_0x49485e[_0x70d8('0x4b')],{'$or':_[_0x70d8('0x4f')](_0x49485e[_0x70d8('0x45')],function(_0x20eb1c){var _0x14f267={};_0x14f267[_0x20eb1c]={'$like':'%'+_0x291251[_0x70d8('0x43')][_0x70d8('0x4e')]+'%'};return _0x14f267;})});}if(_0x291251[_0x70d8('0x43')][_0x70d8('0x9d')]){var _0x3bcad2=_0x291251[_0x70d8('0x43')][_0x70d8('0x9d')][_0x70d8('0x9e')](',');var _0x26eb71={};_0x26eb71[_0x3bcad2[0x0]]={'$gte':moment(_0x3bcad2[0x1])[_0x70d8('0x9f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x49485e[_0x70d8('0x4b')]=_[_0x70d8('0x5d')](_0x49485e[_0x70d8('0x4b')],_0x26eb71);}_0x49485e=_[_0x70d8('0x5d')]({},_0x49485e,_0x291251[_0x70d8('0x5e')]);return db[_0x70d8('0x9c')][_0x70d8('0x2e')]({'where':_0x49485e['where']})[_0x70d8('0x21')](function(_0x3e7beb){_0x1a64e5['count']=_0x3e7beb;if(_0x291251[_0x70d8('0x43')][_0x70d8('0x54')]){_0x49485e[_0x70d8('0x5c')]=[{'all':!![]}];}return db[_0x70d8('0x9c')]['findAll'](_0x49485e);})[_0x70d8('0x21')](function(_0xdfba00){_0x1a64e5['rows']=_0xdfba00;return _0x1a64e5;});}})[_0x70d8('0x21')](respondWithFilteredResult(_0x5c8615,_0x49485e))[_0x70d8('0x57')](handleError(_0x5c8615,null));};exports['send']=function(_0x5877e0,_0x1d1714,_0x201b55){var _0x2ece23,_0x1168ad={},_0x473b3f;if(_0x5877e0[_0x70d8('0x61')]['to']){_0x473b3f=_0x5877e0['body']['to'][_0x70d8('0x9e')](',')[0x0];}return db[_0x70d8('0x40')][_0x70d8('0x5f')]({'where':{'id':_0x5877e0[_0x70d8('0x59')]['id']},'include':[{'model':db[_0x70d8('0xa0')],'as':_0x70d8('0xa1'),'include':[{'model':db[_0x70d8('0xa2')],'as':_0x70d8('0xa3'),'where':{'email':_0x473b3f},'limit':0x1,'order':[[_0x70d8('0xa4'),_0x70d8('0xa5')]]}]},{'model':db[_0x70d8('0x3d')],'as':'Smtp','raw':!![]}]})[_0x70d8('0x21')](handleEntityNotFound(_0x1d1714,null))['then'](function(_0xd1198){if(_0xd1198){_0x2ece23=_0xd1198;if(_0xd1198['Smtp']){if(_[_0x70d8('0x70')](_0x5877e0['body'][_0x70d8('0xa6')])){_0x5877e0['body'][_0x70d8('0xa6')]=util[_0x70d8('0x9f')]('%s\x20<%s>',_0xd1198['name'],_0xd1198['email']||_0xd1198[_0x70d8('0x3e')][_0x70d8('0x74')]);}if(_0x5877e0['body'][_0x70d8('0xa7')]&&_0x5877e0[_0x70d8('0x61')][_0x70d8('0xa7')][_0x70d8('0x47')]){for(var _0x168da2=0x0;_0x168da2<_0x5877e0[_0x70d8('0x61')][_0x70d8('0xa7')]['length'];_0x168da2+=0x1){_0x5877e0['body'][_0x70d8('0xa7')][_0x168da2]={'filename':_0x5877e0[_0x70d8('0x61')]['attachments'][_0x168da2]['name'],'path':path['join'](config[_0x70d8('0xa8')],'server/files/attachments',_0x5877e0[_0x70d8('0x61')][_0x70d8('0xa7')][_0x168da2][_0x70d8('0xa9')])};}}var _0x18e01b={'tls':{'rejectUnauthorized':![]}};if(_[_0x70d8('0x70')](_0xd1198[_0x70d8('0x3e')][_0x70d8('0x7b')])){if(_0xd1198[_0x70d8('0x3e')]['authentication']){_0x18e01b['auth']={'user':_0xd1198[_0x70d8('0x3e')][_0x70d8('0x74')],'pass':_0xd1198[_0x70d8('0x3e')][_0x70d8('0xaa')]};}_0x18e01b['host']=_0xd1198[_0x70d8('0x3e')][_0x70d8('0x79')];_0x18e01b[_0x70d8('0x7a')]=_0xd1198[_0x70d8('0x3e')][_0x70d8('0x7a')];_0x18e01b['secure']=_0xd1198[_0x70d8('0x3e')][_0x70d8('0xab')];}else{_0x18e01b[_0x70d8('0x7b')]=_0xd1198[_0x70d8('0x3e')][_0x70d8('0x7b')];_0x18e01b[_0x70d8('0xac')]={'user':_0xd1198[_0x70d8('0x3e')][_0x70d8('0x74')],'pass':_0xd1198[_0x70d8('0x3e')][_0x70d8('0xaa')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x18e01b,'message':_0x5877e0['body']});}else{throw new Error(_0x70d8('0xad'));}}})[_0x70d8('0x21')](function(_0x267794){if(_0x267794){_0x1168ad=_0x267794;if(_0x2ece23[_0x70d8('0xa1')]){if(_0x2ece23[_0x70d8('0xa1')]['Contacts'][_0x70d8('0x47')]){return _0x2ece23[_0x70d8('0xa1')][_0x70d8('0xa3')][0x0];}else{return db[_0x70d8('0xa2')][_0x70d8('0x65')](_[_0x70d8('0x18')](_0x5877e0[_0x70d8('0x61')],{'firstName':_0x5877e0[_0x70d8('0x61')]['to'],'email':_0x5877e0['body']['to'],'phone':_0x5877e0[_0x70d8('0x61')]['to'],'ListId':_0x2ece23['ListId']}));}}else{throw new Error('List\x20not\x20found');}}})[_0x70d8('0x21')](function(_0x1da668){if(_0x1da668){var _0x34020f={'UserId':_0x5877e0[_0x70d8('0x74')]['id'],'ContactId':_0x1da668['id'],'MailAccountId':_0x2ece23['id'],'inReplyTo':_0x1168ad['messageId'],'to':_0x5877e0[_0x70d8('0x61')][_0x70d8('0xa6')],'cc':_0x5877e0['body']['cc'],'subject':_0x5877e0[_0x70d8('0x61')][_0x70d8('0xae')],'attach':_0x5877e0[_0x70d8('0x61')][_0x70d8('0xaf')],'firstMsgDirection':_0x70d8('0xb0'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x70d8('0xb0'),'lastMsgBody':_0x5877e0[_0x70d8('0x61')][_0x70d8('0x61')],'Messages':[_[_0x70d8('0x5d')](_0x5877e0[_0x70d8('0x61')],{'messageId':_0x1168ad[_0x70d8('0xb1')],'sentAt':moment()[_0x70d8('0x9f')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x2ece23['id'],'UserId':_0x5877e0[_0x70d8('0x74')]['id'],'ContactId':_0x1da668['id']})]};if(_0x5877e0[_0x70d8('0x61')]['Interaction']){_0x34020f=_[_0x70d8('0x5d')](_0x34020f,_0x5877e0[_0x70d8('0x61')][_0x70d8('0xb2')]);}return db[_0x70d8('0x8b')][_0x70d8('0x65')](_0x34020f,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});}})[_0x70d8('0x21')](respondWithResult(_0x1d1714,null))[_0x70d8('0x57')](handleError(_0x1d1714,null));};exports[_0x70d8('0xb3')]=function(_0xfc747c,_0x2d543f,_0x195153){return db[_0x70d8('0x40')][_0x70d8('0x5f')]({'where':{'id':_0xfc747c[_0x70d8('0x59')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x70d8('0x3e'),'raw':!![]}]})[_0x70d8('0x21')](handleEntityNotFound(_0x2d543f,null))[_0x70d8('0x21')](function(_0x5bf18b){if(_0x5bf18b&&_0x5bf18b[_0x70d8('0x3e')]){var _0x210989={'id':_0x5bf18b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5bf18b['Smtp'][_0x70d8('0x7b')]){_0x210989[_0x70d8('0x7b')]=_0x5bf18b['Smtp'][_0x70d8('0x7b')];}else{_0x210989['host']=_0x5bf18b[_0x70d8('0x3e')][_0x70d8('0x79')];_0x210989[_0x70d8('0x7a')]=_0x5bf18b[_0x70d8('0x3e')]['port'];_0x210989[_0x70d8('0xab')]=_0x5bf18b[_0x70d8('0x3e')][_0x70d8('0xab')];}if(_0x5bf18b[_0x70d8('0x3e')][_0x70d8('0x78')]){_0x210989[_0x70d8('0xac')]={'user':_0x5bf18b[_0x70d8('0x3e')][_0x70d8('0x74')],'pass':_0x5bf18b['Smtp'][_0x70d8('0xaa')]};}return respondWithRpcPromise(_0x70d8('0xb4'),_0x70d8('0xb3'),{'account':_0x210989});}})['then'](respondWithResult(_0x2d543f,null))['catch'](handleError(_0x2d543f,null));};exports[_0x70d8('0x37')]=function(_0x53eca8,_0x43aa0c){return db[_0x70d8('0x40')][_0x70d8('0x5f')]({'where':{'id':_0x53eca8['params']['id']}})[_0x70d8('0x21')](handleEntityNotFound(_0x43aa0c,null))['then'](function(_0x3d23e4){if(_0x3d23e4&&_0x3d23e4['service']){throw new db[(_0x70d8('0xb5'))]['ValidationError'](_0x70d8('0xb6'));}return _0x3d23e4;})[_0x70d8('0x21')](removeEntity(_0x43aa0c,null))[_0x70d8('0x57')](handleError(_0x43aa0c,null));};exports[_0x70d8('0xb7')]=function(_0x2e0b61,_0xeb3c89,_0x23da77){return db[_0x70d8('0x40')][_0x70d8('0x5f')]({'where':{'id':_0x2e0b61[_0x70d8('0x59')]['id']}})[_0x70d8('0x21')](handleEntityNotFound(_0xeb3c89,null))[_0x70d8('0x21')](function(_0x42b41c){if(_0x42b41c){return _0x42b41c[_0x70d8('0xb7')](_0x2e0b61[_0x70d8('0x61')]['ids'],_['omit'](_0x2e0b61['body'],[_0x70d8('0x6a'),'id'])||{})[_0x70d8('0xb8')](function(_0xf88d4f){for(var _0x16d4ec=0x0;_0x16d4ec<_0x2e0b61[_0x70d8('0x61')][_0x70d8('0x6a')]['length'];_0x16d4ec+=0x1){socket[_0x70d8('0xb9')](_0x70d8('0xba'),{'UserId':_0x2e0b61[_0x70d8('0x61')][_0x70d8('0x6a')][_0x16d4ec],'MailAccountId':_0x2e0b61[_0x70d8('0x59')]['id']});}return _0xf88d4f;});}})['then'](respondWithResult(_0xeb3c89,null))[_0x70d8('0x57')](handleError(_0xeb3c89,null));};exports[_0x70d8('0xbb')]=function(_0xccee71,_0x7db3f9,_0x12a363){return db[_0x70d8('0x40')][_0x70d8('0x5f')]({'where':{'id':_0xccee71[_0x70d8('0x59')]['id']}})['then'](handleEntityNotFound(_0x7db3f9,null))['then'](function(_0x2f614d){if(_0x2f614d){return _0x2f614d['removeAgents'](_0xccee71['query'][_0x70d8('0x6a')])[_0x70d8('0x21')](function(){if(_['isArray'](_0xccee71[_0x70d8('0x43')]['ids'])){for(var _0x271e83=0x0;_0x271e83<_0xccee71[_0x70d8('0x43')]['ids'][_0x70d8('0x47')];_0x271e83+=0x1){socket[_0x70d8('0xb9')](_0x70d8('0xbc'),{'UserId':Number(_0xccee71[_0x70d8('0x43')]['ids'][_0x271e83]),'MailAccountId':Number(_0xccee71[_0x70d8('0x59')]['id'])});}}else{socket[_0x70d8('0xb9')]('userMailAccount:remove',{'UserId':Number(_0xccee71['query'][_0x70d8('0x6a')]),'MailAccountId':Number(_0xccee71[_0x70d8('0x59')]['id'])});}});}})[_0x70d8('0x21')](respondWithStatusCode(_0x7db3f9,null))[_0x70d8('0x57')](handleError(_0x7db3f9,null));};exports['getAgents']=function(_0x63e5b6,_0x4f2b5b,_0x4159d2){var _0x5a9803={};var _0x1481e2={};var _0x1091b0;var _0x499d7c;return db[_0x70d8('0x40')][_0x70d8('0x67')]({'where':{'id':_0x63e5b6[_0x70d8('0x59')]['id']}})[_0x70d8('0x21')](handleEntityNotFound(_0x4f2b5b,null))[_0x70d8('0x21')](function(_0x445410){if(_0x445410){_0x1091b0=_0x445410;_0x1481e2[_0x70d8('0x41')]=_[_0x70d8('0x42')](db[_0x70d8('0x8e')]['rawAttributes']);_0x1481e2[_0x70d8('0x43')]=_[_0x70d8('0x42')](_0x63e5b6[_0x70d8('0x43')]);_0x1481e2[_0x70d8('0x4c')]=_[_0x70d8('0x44')](_0x1481e2[_0x70d8('0x41')],_0x1481e2[_0x70d8('0x43')]);_0x5a9803[_0x70d8('0x45')]=_['intersection'](_0x1481e2['model'],qs[_0x70d8('0x46')](_0x63e5b6[_0x70d8('0x43')][_0x70d8('0x46')]));_0x5a9803[_0x70d8('0x45')]=_0x5a9803[_0x70d8('0x45')]['length']?_0x5a9803['attributes']:_0x1481e2['model'];_0x5a9803['order']=qs[_0x70d8('0x4a')](_0x63e5b6[_0x70d8('0x43')][_0x70d8('0x4a')]);_0x5a9803[_0x70d8('0x4b')]=qs[_0x70d8('0x4c')](_[_0x70d8('0x4d')](_0x63e5b6['query'],_0x1481e2[_0x70d8('0x4c')]));if(_0x63e5b6[_0x70d8('0x43')]['filter']){_0x5a9803['where']=_['merge'](_0x5a9803['where'],{'$or':_[_0x70d8('0x4f')](_0x5a9803[_0x70d8('0x45')],function(_0x44a020){var _0x23613c={};_0x23613c[_0x44a020]={'$like':'%'+_0x63e5b6[_0x70d8('0x43')][_0x70d8('0x4e')]+'%'};return _0x23613c;})});}_0x5a9803=_[_0x70d8('0x5d')]({},_0x5a9803,_0x63e5b6[_0x70d8('0x5e')]);return _0x1091b0[_0x70d8('0xbd')](_0x5a9803);}})[_0x70d8('0x21')](function(_0x5793bf){if(_0x5793bf){_0x499d7c=_0x5793bf['length'];if(!_0x63e5b6[_0x70d8('0x43')][_0x70d8('0x48')](_0x70d8('0x68'))){_0x5a9803[_0x70d8('0x30')]=qs[_0x70d8('0x30')](_0x63e5b6[_0x70d8('0x43')]['limit']);_0x5a9803[_0x70d8('0x2f')]=qs[_0x70d8('0x2f')](_0x63e5b6[_0x70d8('0x43')][_0x70d8('0x2f')]);}return _0x1091b0[_0x70d8('0xbd')](_0x5a9803);}})['then'](function(_0x596400){if(_0x596400){return _0x596400?{'count':_0x499d7c,'rows':_0x596400}:null;}})[_0x70d8('0x21')](respondWithResult(_0x4f2b5b,null))[_0x70d8('0x57')](handleError(_0x4f2b5b,null));}; \ No newline at end of file +var _0xae31=['updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','service','auth','secure','SendMail','sendMail','List\x20not\x20found','defaults','subject','attach','out','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','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','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','test','request','then','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','info','result','sendStatus','status','end','count','offset','limit','set','json','apply','save','update','destroy','MailAccounts','name','index','Smtp','mandatoryDispositionPause','MailAccount','rawAttributes','model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','options','include','findAll','rows','catch','show','params','MailServerIn','Imap','MailServerOut','Pause','length','includeAll','find','body','describe','addDisposition','MailAccountId','create','getDispositions','findOne','hasOwnProperty','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','isNil','active','description','cservice','cauthentication','user','cuser','pass','cpassword','authentication','host','port','password','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','Contact','User','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','findAndCountAll','getApplications','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','split','CmList','List','CmContact','Contacts'];(function(_0x5b1072,_0x422d9f){var _0x352a6e=function(_0x4d1248){while(--_0x4d1248){_0x5b1072['push'](_0x5b1072['shift']());}};_0x352a6e(++_0x422d9f);}(_0xae31,0xe4));var _0x1ae3=function(_0x1e79b9,_0x223ef3){_0x1e79b9=_0x1e79b9-0x0;var _0x2c2d29=_0xae31[_0x1e79b9];return _0x2c2d29;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1ae3('0x0'));var rimraf=require(_0x1ae3('0x1'));var zipdir=require(_0x1ae3('0x2'));var jsonpatch=require(_0x1ae3('0x3'));var rp=require('request-promise');var moment=require(_0x1ae3('0x4'));var BPromise=require(_0x1ae3('0x5'));var Mustache=require(_0x1ae3('0x6'));var util=require('util');var path=require('path');var sox=require(_0x1ae3('0x7'));var csv=require('to-csv');var ejs=require(_0x1ae3('0x8'));var fs=require('fs');var _=require(_0x1ae3('0x9'));var squel=require(_0x1ae3('0xa'));var crypto=require(_0x1ae3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1ae3('0xc'));var toCsv=require(_0x1ae3('0xd'));var querystring=require(_0x1ae3('0xe'));var Papa=require(_0x1ae3('0xf'));var Redis=require(_0x1ae3('0x10'));var authService=require(_0x1ae3('0x11'));var qs=require(_0x1ae3('0x12'));var hardwareService=require(_0x1ae3('0x13'));var logger=require(_0x1ae3('0x14'))(_0x1ae3('0x15'));var utils=require(_0x1ae3('0x16'));var config=require(_0x1ae3('0x17'));var db=require('../../mysqldb')['db'];config[_0x1ae3('0x18')]=_['defaults'](config[_0x1ae3('0x18')],{'host':_0x1ae3('0x19'),'port':0x18eb});var socket=require(_0x1ae3('0x1a'))(new Redis(config[_0x1ae3('0x18')]));require(_0x1ae3('0x1b'))[_0x1ae3('0x1c')](socket);var jayson=require(_0x1ae3('0x1d'));var client=jayson[_0x1ae3('0x1e')][_0x1ae3('0x1f')]({'port':0x232b});function checkPasswordPattern(_0xe68c3f,_0x48c728,_0x32890d){if(_0x32890d){var _0x126db5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x126db5[_0x1ae3('0x20')](_0x48c728)){return _0xe68c3f;}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 _0xe68c3f;}}function respondWithRpcPromise(_0x3b55b0,_0x5361c6,_0x434aee,_0x27b09a){return new BPromise(function(_0x469ba8,_0x59e6c4){var _0x403718=_0x27b09a||client;return _0x403718[_0x1ae3('0x21')](_0x3b55b0,_0x434aee)[_0x1ae3('0x22')](function(_0x440ab9){logger['info']('MailAccount,\x20%s,\x20%s',_0x5361c6,_0x1ae3('0x23'));logger[_0x1ae3('0x24')](_0x1ae3('0x25'),_0x5361c6,_0x1ae3('0x23'),JSON['stringify'](_0x440ab9));if(_0x440ab9[_0x1ae3('0x26')]){if(_0x440ab9[_0x1ae3('0x26')][_0x1ae3('0x27')]===0x1f4){logger[_0x1ae3('0x26')](_0x1ae3('0x28'),_0x5361c6,_0x440ab9['error']['message']);return _0x59e6c4(_0x440ab9[_0x1ae3('0x26')][_0x1ae3('0x29')]);}logger['error'](_0x1ae3('0x28'),_0x5361c6,_0x440ab9[_0x1ae3('0x26')][_0x1ae3('0x29')]);return _0x469ba8(_0x440ab9[_0x1ae3('0x26')][_0x1ae3('0x29')]);}else{logger[_0x1ae3('0x2a')](_0x1ae3('0x28'),_0x5361c6,_0x1ae3('0x23'));_0x469ba8(_0x440ab9[_0x1ae3('0x2b')][_0x1ae3('0x29')]);}})['catch'](function(_0x20140a){logger[_0x1ae3('0x26')](_0x1ae3('0x28'),_0x5361c6,_0x20140a);_0x59e6c4(_0x20140a);});});}function respondWithStatusCode(_0x4fa822,_0x2b575f){_0x2b575f=_0x2b575f||0xcc;return function(_0x19d77d){if(_0x19d77d){return _0x4fa822[_0x1ae3('0x2c')](_0x2b575f);}return _0x4fa822[_0x1ae3('0x2d')](_0x2b575f)[_0x1ae3('0x2e')]();};}function respondWithResult(_0x596ee2,_0x94ca54){_0x94ca54=_0x94ca54||0xc8;return function(_0x234801){if(_0x234801){return _0x596ee2[_0x1ae3('0x2d')](_0x94ca54)['json'](_0x234801);}};}function respondWithFilteredResult(_0x53eedd,_0x3cb444){return function(_0x3fd6db){if(_0x3fd6db){var _0x1d0073=_0x3fd6db[_0x1ae3('0x2f')],_0xaf72d=_0x3cb444[_0x1ae3('0x30')],_0x1cb1a3=_0x3cb444[_0x1ae3('0x30')]+_0x3cb444[_0x1ae3('0x31')],_0x5e3d14;if(_0x1cb1a3>=_0x1d0073){_0x1cb1a3=_0x1d0073;_0x5e3d14=0xc8;}else{_0x5e3d14=0xce;}_0x53eedd[_0x1ae3('0x2d')](_0x5e3d14);return _0x53eedd[_0x1ae3('0x32')]('Content-Range',_0xaf72d+'-'+_0x1cb1a3+'/'+_0x1d0073)[_0x1ae3('0x33')](_0x3fd6db);}return null;};}function patchUpdates(_0x89a13d){return function(_0x5e0037){try{jsonpatch[_0x1ae3('0x34')](_0x5e0037,_0x89a13d,!![]);}catch(_0x57bdec){return BPromise['reject'](_0x57bdec);}return _0x5e0037[_0x1ae3('0x35')]();};}function saveUpdates(_0x3e8ccb,_0x1ed2d8){return function(_0xf148a3){if(_0xf148a3){return _0xf148a3[_0x1ae3('0x36')](_0x3e8ccb)[_0x1ae3('0x22')](function(_0x38b544){return _0x38b544;});}return null;};}function removeEntity(_0x915242,_0x21c343){return function(_0x4e9451){if(_0x4e9451){return _0x4e9451[_0x1ae3('0x37')]()[_0x1ae3('0x22')](function(){var _0x7afc8f=_0x4e9451['get']({'plain':!![]});var _0x11b905=_0x1ae3('0x38');return db['UserProfileResource']['destroy']({'where':{'type':_0x11b905,'resourceId':_0x7afc8f['id']}})[_0x1ae3('0x22')](function(){return _0x4e9451;});})[_0x1ae3('0x22')](function(){_0x915242[_0x1ae3('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f20a9,_0x2a2609){return function(_0x10f76c){if(!_0x10f76c){_0x2f20a9['sendStatus'](0x194);}return _0x10f76c;};}function handleError(_0x18c969,_0xd9b9ad){_0xd9b9ad=_0xd9b9ad||0x1f4;return function(_0x4d74d1){logger[_0x1ae3('0x26')](_0x4d74d1['stack']);if(_0x4d74d1['name']){delete _0x4d74d1[_0x1ae3('0x39')];}_0x18c969[_0x1ae3('0x2d')](_0xd9b9ad)['send'](_0x4d74d1);};}exports[_0x1ae3('0x3a')]=function(_0x52be1e,_0x403192){var _0x361eef={'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x1ae3('0x3b')},{'model':db['Pause'],'as':_0x1ae3('0x3c')}]},_0x5d26ca={},_0x50692f={'count':0x0,'rows':[]};var _0x3b76ab=db[_0x1ae3('0x3d')][_0x1ae3('0x3e')];_0x5d26ca[_0x1ae3('0x3f')]=_[_0x1ae3('0x40')](_0x3b76ab);_0x5d26ca[_0x1ae3('0x41')]=_[_0x1ae3('0x40')](_0x52be1e['query']);_0x5d26ca[_0x1ae3('0x42')]=_[_0x1ae3('0x43')](_0x5d26ca['model'],_0x5d26ca['query']);_0x361eef['attributes']=_['intersection'](_0x5d26ca['model'],qs['fields'](_0x52be1e[_0x1ae3('0x41')][_0x1ae3('0x44')]));_0x361eef[_0x1ae3('0x45')]=_0x361eef[_0x1ae3('0x45')]['length']?_0x361eef[_0x1ae3('0x45')]:_0x5d26ca[_0x1ae3('0x3f')];if(!_0x52be1e[_0x1ae3('0x41')]['hasOwnProperty'](_0x1ae3('0x46'))){_0x361eef[_0x1ae3('0x31')]=qs[_0x1ae3('0x31')](_0x52be1e[_0x1ae3('0x41')]['limit']);_0x361eef[_0x1ae3('0x30')]=qs[_0x1ae3('0x30')](_0x52be1e[_0x1ae3('0x41')]['offset']);}_0x361eef[_0x1ae3('0x47')]=qs[_0x1ae3('0x48')](_0x52be1e[_0x1ae3('0x41')][_0x1ae3('0x48')]);_0x361eef[_0x1ae3('0x49')]=qs[_0x1ae3('0x42')](_[_0x1ae3('0x4a')](_0x52be1e['query'],_0x5d26ca['filters']));if(_0x52be1e[_0x1ae3('0x41')][_0x1ae3('0x4b')]){_0x361eef[_0x1ae3('0x49')]=_[_0x1ae3('0x4c')](_0x361eef[_0x1ae3('0x49')],{'$or':_[_0x1ae3('0x4d')](_0x3b76ab,function(_0x490f97){if(_0x490f97[_0x1ae3('0x4e')][_0x1ae3('0x4f')]!=='VIRTUAL'){var _0x7e02f={};_0x7e02f[_0x490f97[_0x1ae3('0x50')]]={'$like':'%'+_0x52be1e[_0x1ae3('0x41')]['filter']+'%'};return _0x7e02f;}})});}_0x361eef=_[_0x1ae3('0x4c')]({},_0x361eef,_0x52be1e[_0x1ae3('0x51')]);var _0x33fd11={'where':_0x361eef['where']};return db[_0x1ae3('0x3d')][_0x1ae3('0x2f')](_0x33fd11)[_0x1ae3('0x22')](function(_0x206605){_0x50692f['count']=_0x206605;if(_0x52be1e['query']['includeAll']){_0x361eef[_0x1ae3('0x52')]=[{'all':!![]}];}return db['MailAccount'][_0x1ae3('0x53')](_0x361eef);})[_0x1ae3('0x22')](function(_0x2b1a68){_0x50692f[_0x1ae3('0x54')]=_0x2b1a68;return _0x50692f;})[_0x1ae3('0x22')](respondWithFilteredResult(_0x403192,_0x361eef))[_0x1ae3('0x55')](handleError(_0x403192,null));};exports[_0x1ae3('0x56')]=function(_0x1985d5,_0x5eb07a){var _0x4b4880={'raw':![],'where':{'id':_0x1985d5[_0x1ae3('0x57')]['id']},'include':[{'model':db[_0x1ae3('0x58')],'as':_0x1ae3('0x59')},{'model':db[_0x1ae3('0x5a')],'as':_0x1ae3('0x3b')},{'model':db[_0x1ae3('0x5b')],'as':'mandatoryDispositionPause'}]},_0x1a0e62={};_0x1a0e62[_0x1ae3('0x3f')]=_[_0x1ae3('0x40')](db[_0x1ae3('0x3d')][_0x1ae3('0x3e')]);_0x1a0e62[_0x1ae3('0x41')]=_[_0x1ae3('0x40')](_0x1985d5[_0x1ae3('0x41')]);_0x1a0e62['filters']=_[_0x1ae3('0x43')](_0x1a0e62[_0x1ae3('0x3f')],_0x1a0e62[_0x1ae3('0x41')]);_0x4b4880[_0x1ae3('0x45')]=_[_0x1ae3('0x43')](_0x1a0e62[_0x1ae3('0x3f')],qs[_0x1ae3('0x44')](_0x1985d5[_0x1ae3('0x41')]['fields']));_0x4b4880[_0x1ae3('0x45')]=_0x4b4880['attributes'][_0x1ae3('0x5c')]?_0x4b4880[_0x1ae3('0x45')]:_0x1a0e62[_0x1ae3('0x3f')];if(_0x1985d5[_0x1ae3('0x41')][_0x1ae3('0x5d')]){_0x4b4880[_0x1ae3('0x52')]=[{'all':!![]}];}_0x4b4880=_[_0x1ae3('0x4c')]({},_0x4b4880,_0x1985d5[_0x1ae3('0x51')]);return db['MailAccount'][_0x1ae3('0x5e')](_0x4b4880)['then'](handleEntityNotFound(_0x5eb07a,null))[_0x1ae3('0x22')](respondWithResult(_0x5eb07a,null))[_0x1ae3('0x55')](handleError(_0x5eb07a,null));};exports['update']=function(_0x3e5cd7,_0x34b9c4){if(_0x3e5cd7[_0x1ae3('0x5f')]['id']){delete _0x3e5cd7[_0x1ae3('0x5f')]['id'];}return db[_0x1ae3('0x3d')][_0x1ae3('0x5e')]({'where':{'id':_0x3e5cd7[_0x1ae3('0x57')]['id']},'include':[{'model':db[_0x1ae3('0x58')],'as':_0x1ae3('0x59')},{'model':db[_0x1ae3('0x5a')],'as':_0x1ae3('0x3b')},{'model':db[_0x1ae3('0x5b')],'as':_0x1ae3('0x3c')}]})[_0x1ae3('0x22')](handleEntityNotFound(_0x34b9c4,null))[_0x1ae3('0x22')](saveUpdates(_0x3e5cd7['body'],null))[_0x1ae3('0x22')](function(_0x27cfd5){if(_0x27cfd5&&_0x3e5cd7[_0x1ae3('0x5f')][_0x1ae3('0x59')]){return db['MailServerIn'][_0x1ae3('0x36')](_0x3e5cd7[_0x1ae3('0x5f')][_0x1ae3('0x59')],{'where':{'MailAccountId':_0x27cfd5['id']}})[_0x1ae3('0x22')](function(){return _0x27cfd5;});}return _0x27cfd5;})[_0x1ae3('0x22')](function(_0x2f1a39){if(_0x2f1a39&&_0x3e5cd7['body']['Smtp']){return db[_0x1ae3('0x5a')][_0x1ae3('0x36')](_0x3e5cd7[_0x1ae3('0x5f')][_0x1ae3('0x3b')],{'where':{'MailAccountId':_0x2f1a39['id']}})[_0x1ae3('0x22')](function(){return _0x2f1a39;});}return _0x2f1a39;})[_0x1ae3('0x22')](respondWithResult(_0x34b9c4,null))[_0x1ae3('0x55')](handleError(_0x34b9c4,null));};exports[_0x1ae3('0x60')]=function(_0x32f31b,_0x37a225){return db[_0x1ae3('0x3d')]['describe']()[_0x1ae3('0x22')](respondWithResult(_0x37a225,null))['catch'](handleError(_0x37a225,null));};exports[_0x1ae3('0x61')]=function(_0x22d281,_0x36c91b,_0x12cb6e){if(_0x22d281['body']['id']){delete _0x22d281[_0x1ae3('0x5f')]['id'];}return db[_0x1ae3('0x3d')][_0x1ae3('0x5e')]({'where':{'id':_0x22d281[_0x1ae3('0x57')]['id']}})['then'](handleEntityNotFound(_0x36c91b,null))[_0x1ae3('0x22')](function(_0x210b5d){if(_0x210b5d){_0x22d281[_0x1ae3('0x5f')][_0x1ae3('0x62')]=_0x210b5d['id'];return db['Disposition'][_0x1ae3('0x63')](_0x22d281[_0x1ae3('0x5f')]);}})[_0x1ae3('0x22')](respondWithResult(_0x36c91b,null))[_0x1ae3('0x55')](handleError(_0x36c91b,null));};exports[_0x1ae3('0x64')]=function(_0x13130a,_0x43edb2,_0x50bf8b){var _0xa5fac7={'raw':![],'where':{}};var _0x112c1b={};var _0x4e5bf8={'count':0x0,'rows':[]};return db[_0x1ae3('0x3d')][_0x1ae3('0x65')]({'where':{'id':_0x13130a['params']['id']}})['then'](handleEntityNotFound(_0x43edb2,null))[_0x1ae3('0x22')](function(_0x3a6e71){if(_0x3a6e71){_0x112c1b[_0x1ae3('0x3f')]=_[_0x1ae3('0x40')](db['Disposition'][_0x1ae3('0x3e')]);_0x112c1b[_0x1ae3('0x41')]=_['keys'](_0x13130a[_0x1ae3('0x41')]);_0x112c1b[_0x1ae3('0x42')]=_['intersection'](_0x112c1b[_0x1ae3('0x3f')],_0x112c1b[_0x1ae3('0x41')]);_0xa5fac7[_0x1ae3('0x45')]=_[_0x1ae3('0x43')](_0x112c1b[_0x1ae3('0x3f')],qs[_0x1ae3('0x44')](_0x13130a[_0x1ae3('0x41')][_0x1ae3('0x44')]));_0xa5fac7[_0x1ae3('0x45')]=_0xa5fac7[_0x1ae3('0x45')][_0x1ae3('0x5c')]?_0xa5fac7['attributes']:_0x112c1b[_0x1ae3('0x3f')];if(!_0x13130a[_0x1ae3('0x41')][_0x1ae3('0x66')](_0x1ae3('0x46'))){_0xa5fac7[_0x1ae3('0x31')]=qs[_0x1ae3('0x31')](_0x13130a[_0x1ae3('0x41')][_0x1ae3('0x31')]);_0xa5fac7['offset']=qs[_0x1ae3('0x30')](_0x13130a[_0x1ae3('0x41')][_0x1ae3('0x30')]);}_0xa5fac7[_0x1ae3('0x47')]=qs[_0x1ae3('0x48')](_0x13130a[_0x1ae3('0x41')]['sort']);_0xa5fac7[_0x1ae3('0x49')]=qs['filters'](_[_0x1ae3('0x4a')](_0x13130a[_0x1ae3('0x41')],_0x112c1b['filters']));_0xa5fac7[_0x1ae3('0x49')][_0x1ae3('0x62')]=_0x3a6e71['id'];if(_0x13130a[_0x1ae3('0x41')][_0x1ae3('0x4b')]){_0xa5fac7['where']=_[_0x1ae3('0x4c')](_0xa5fac7[_0x1ae3('0x49')],{'$or':_[_0x1ae3('0x4d')](_0xa5fac7[_0x1ae3('0x45')],function(_0x2da8e1){var _0x4a0afd={};_0x4a0afd[_0x2da8e1]={'$like':'%'+_0x13130a['query'][_0x1ae3('0x4b')]+'%'};return _0x4a0afd;})});}_0xa5fac7=_[_0x1ae3('0x4c')]({},_0xa5fac7,_0x13130a['options']);return db[_0x1ae3('0x67')][_0x1ae3('0x2f')]({'where':_0xa5fac7['where']})[_0x1ae3('0x22')](function(_0x4e6e10){_0x4e5bf8[_0x1ae3('0x2f')]=_0x4e6e10;if(_0x13130a[_0x1ae3('0x41')][_0x1ae3('0x5d')]){_0xa5fac7[_0x1ae3('0x52')]=[{'all':!![]}];}return db[_0x1ae3('0x67')]['findAll'](_0xa5fac7);})[_0x1ae3('0x22')](function(_0x215ffe){_0x4e5bf8[_0x1ae3('0x54')]=_0x215ffe;return _0x4e5bf8;});}})[_0x1ae3('0x22')](respondWithFilteredResult(_0x43edb2,_0xa5fac7))['catch'](handleError(_0x43edb2,null));};exports['removeDispositions']=function(_0x3240c9,_0x9acdb2,_0x1fe987){return db[_0x1ae3('0x3d')][_0x1ae3('0x5e')]({'where':{'id':_0x3240c9['params']['id']}})[_0x1ae3('0x22')](handleEntityNotFound(_0x9acdb2,null))[_0x1ae3('0x22')](function(_0x271596){if(_0x271596){return _0x271596[_0x1ae3('0x68')](_0x3240c9[_0x1ae3('0x41')][_0x1ae3('0x69')]);}})['then'](respondWithStatusCode(_0x9acdb2,null))[_0x1ae3('0x55')](handleError(_0x9acdb2,null));};exports[_0x1ae3('0x6a')]=function(_0x3e5dc9,_0x5c5a09,_0x3262bd){if(_0x3e5dc9[_0x1ae3('0x5f')]['id']){delete _0x3e5dc9[_0x1ae3('0x5f')]['id'];}return db[_0x1ae3('0x3d')][_0x1ae3('0x5e')]({'where':{'id':_0x3e5dc9['params']['id']}})[_0x1ae3('0x22')](handleEntityNotFound(_0x5c5a09,null))['then'](function(_0x8607b5){if(_0x8607b5){_0x3e5dc9[_0x1ae3('0x5f')][_0x1ae3('0x62')]=_0x8607b5['id'];return db[_0x1ae3('0x6b')][_0x1ae3('0x63')](_0x3e5dc9['body']);}})[_0x1ae3('0x22')](respondWithResult(_0x5c5a09,null))[_0x1ae3('0x55')](handleError(_0x5c5a09,null));};exports[_0x1ae3('0x6c')]=function(_0x58a9e3,_0x5636ef,_0x3f83ae){var _0x50d48f={'raw':![],'where':{}};var _0x42d3cb={};var _0x48b511={'count':0x0,'rows':[]};return db[_0x1ae3('0x3d')][_0x1ae3('0x65')]({'where':{'id':_0x58a9e3[_0x1ae3('0x57')]['id']}})[_0x1ae3('0x22')](handleEntityNotFound(_0x5636ef,null))[_0x1ae3('0x22')](function(_0x551cc9){if(_0x551cc9){_0x42d3cb[_0x1ae3('0x3f')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x42d3cb[_0x1ae3('0x41')]=_[_0x1ae3('0x40')](_0x58a9e3[_0x1ae3('0x41')]);_0x42d3cb['filters']=_[_0x1ae3('0x43')](_0x42d3cb[_0x1ae3('0x3f')],_0x42d3cb[_0x1ae3('0x41')]);_0x50d48f[_0x1ae3('0x45')]=_[_0x1ae3('0x43')](_0x42d3cb[_0x1ae3('0x3f')],qs[_0x1ae3('0x44')](_0x58a9e3[_0x1ae3('0x41')]['fields']));_0x50d48f[_0x1ae3('0x45')]=_0x50d48f[_0x1ae3('0x45')][_0x1ae3('0x5c')]?_0x50d48f['attributes']:_0x42d3cb[_0x1ae3('0x3f')];if(!_0x58a9e3[_0x1ae3('0x41')][_0x1ae3('0x66')]('nolimit')){_0x50d48f[_0x1ae3('0x31')]=qs[_0x1ae3('0x31')](_0x58a9e3[_0x1ae3('0x41')]['limit']);_0x50d48f[_0x1ae3('0x30')]=qs['offset'](_0x58a9e3[_0x1ae3('0x41')][_0x1ae3('0x30')]);}_0x50d48f[_0x1ae3('0x47')]=qs['sort'](_0x58a9e3[_0x1ae3('0x41')][_0x1ae3('0x48')]);_0x50d48f['where']=qs['filters'](_[_0x1ae3('0x4a')](_0x58a9e3[_0x1ae3('0x41')],_0x42d3cb[_0x1ae3('0x42')]));_0x50d48f[_0x1ae3('0x49')]['MailAccountId']=_0x551cc9['id'];if(_0x58a9e3[_0x1ae3('0x41')][_0x1ae3('0x4b')]){_0x50d48f[_0x1ae3('0x49')]=_['merge'](_0x50d48f[_0x1ae3('0x49')],{'$or':_[_0x1ae3('0x4d')](_0x50d48f[_0x1ae3('0x45')],function(_0x7dd258){var _0x78bcda={};_0x78bcda[_0x7dd258]={'$like':'%'+_0x58a9e3[_0x1ae3('0x41')][_0x1ae3('0x4b')]+'%'};return _0x78bcda;})});}_0x50d48f=_['merge']({},_0x50d48f,_0x58a9e3['options']);return db[_0x1ae3('0x6b')][_0x1ae3('0x2f')]({'where':_0x50d48f[_0x1ae3('0x49')]})[_0x1ae3('0x22')](function(_0x17ef3c){_0x48b511[_0x1ae3('0x2f')]=_0x17ef3c;if(_0x58a9e3[_0x1ae3('0x41')][_0x1ae3('0x5d')]){_0x50d48f['include']=[{'all':!![]}];}return db[_0x1ae3('0x6b')][_0x1ae3('0x53')](_0x50d48f);})['then'](function(_0x124d73){_0x48b511[_0x1ae3('0x54')]=_0x124d73;return _0x48b511;});}})[_0x1ae3('0x22')](respondWithFilteredResult(_0x5636ef,_0x50d48f))['catch'](handleError(_0x5636ef,null));};exports[_0x1ae3('0x6d')]=function(_0x1d4f75,_0x100e42,_0x23ec1b){return db[_0x1ae3('0x3d')][_0x1ae3('0x5e')]({'where':{'id':_0x1d4f75['params']['id']}})[_0x1ae3('0x22')](handleEntityNotFound(_0x100e42,null))[_0x1ae3('0x22')](function(_0x16040c){if(_0x16040c){return _0x16040c[_0x1ae3('0x6d')](_0x1d4f75['query'][_0x1ae3('0x69')]);}})[_0x1ae3('0x22')](respondWithStatusCode(_0x100e42,null))['catch'](handleError(_0x100e42,null));};exports[_0x1ae3('0x63')]=function(_0x269124,_0xc401cb){var _0x348cf6={'name':_0x269124['body']['name'],'key':_0x269124['body'][_0x1ae3('0x4f')],'email':_0x269124[_0x1ae3('0x5f')][_0x1ae3('0x6e')],'ListId':_0x269124[_0x1ae3('0x5f')][_0x1ae3('0x6f')],'active':!_[_0x1ae3('0x70')](_0x269124[_0x1ae3('0x5f')][_0x1ae3('0x71')])?_0x269124['body'][_0x1ae3('0x71')]:!![],'description':_0x269124['body'][_0x1ae3('0x72')]||null,'Imap':{},'Smtp':{}};if(_[_0x1ae3('0x70')](_0x269124['body'][_0x1ae3('0x73')])){if(_0x269124[_0x1ae3('0x5f')][_0x1ae3('0x74')]){_0x348cf6['Imap'][_0x1ae3('0x75')]=_0x348cf6[_0x1ae3('0x3b')][_0x1ae3('0x75')]=_0x269124[_0x1ae3('0x5f')][_0x1ae3('0x76')];_0x348cf6[_0x1ae3('0x59')]['password']=_0x348cf6['Smtp'][_0x1ae3('0x77')]=_0x269124[_0x1ae3('0x5f')][_0x1ae3('0x78')];}else{_0x348cf6['Imap'][_0x1ae3('0x79')]=_0x348cf6[_0x1ae3('0x3b')][_0x1ae3('0x79')]=![];}_0x348cf6['Imap'][_0x1ae3('0x7a')]=_0x269124['body'][_0x1ae3('0x59')][_0x1ae3('0x7a')];_0x348cf6[_0x1ae3('0x59')]['port']=_0x269124[_0x1ae3('0x5f')][_0x1ae3('0x59')][_0x1ae3('0x7b')];_0x348cf6[_0x1ae3('0x3b')]['host']=_0x269124['body'][_0x1ae3('0x3b')][_0x1ae3('0x7a')];_0x348cf6[_0x1ae3('0x3b')][_0x1ae3('0x7b')]=_0x269124['body'][_0x1ae3('0x3b')][_0x1ae3('0x7b')];}else{_0x348cf6[_0x1ae3('0x59')]['service']=_0x348cf6['Smtp']['service']=_0x269124[_0x1ae3('0x5f')][_0x1ae3('0x73')];_0x348cf6[_0x1ae3('0x59')][_0x1ae3('0x75')]=_0x348cf6[_0x1ae3('0x3b')][_0x1ae3('0x75')]=_0x269124[_0x1ae3('0x5f')][_0x1ae3('0x76')];_0x348cf6[_0x1ae3('0x59')][_0x1ae3('0x7c')]=_0x348cf6['Smtp'][_0x1ae3('0x77')]=_0x269124[_0x1ae3('0x5f')][_0x1ae3('0x78')];}return db[_0x1ae3('0x3d')][_0x1ae3('0x63')](_0x348cf6,{'include':[{'model':db['MailServerOut'],'as':_0x1ae3('0x3b')},{'model':db['MailServerIn'],'as':_0x1ae3('0x59')}]})[_0x1ae3('0x22')](function(_0x85f05b){var _0x547f33=_0x269124['user'][_0x1ae3('0x7d')]({'plain':!![]});if(!_0x547f33)throw new Error(_0x1ae3('0x7e'));if(_0x547f33['role']===_0x1ae3('0x75')){var _0x42ba53=_0x85f05b['get']({'plain':!![]});return db[_0x1ae3('0x7f')][_0x1ae3('0x5e')]({'where':{'name':_0x1ae3('0x38'),'userProfileId':_0x547f33['userProfileId']},'raw':!![]})[_0x1ae3('0x22')](function(_0x22db0b){if(_0x22db0b&&_0x22db0b['autoAssociation']===0x0){return db[_0x1ae3('0x80')][_0x1ae3('0x63')]({'name':_0x42ba53[_0x1ae3('0x39')],'resourceId':_0x42ba53['id'],'type':_0x22db0b['name'],'sectionId':_0x22db0b['id']},{})[_0x1ae3('0x22')](function(){return _0x85f05b;});}else{return _0x85f05b;}})['catch'](function(_0x3fcdae){logger[_0x1ae3('0x26')](_0x1ae3('0x81'),_0x3fcdae);throw _0x3fcdae;});}return _0x85f05b;})['then'](respondWithResult(_0xc401cb,0xc9))[_0x1ae3('0x55')](handleError(_0xc401cb,null));};exports['getImap']=function(_0x5252b2,_0x326211,_0x166855){return db[_0x1ae3('0x3d')][_0x1ae3('0x65')]({'where':{'id':_0x5252b2[_0x1ae3('0x57')]['id']}})[_0x1ae3('0x22')](handleEntityNotFound(_0x326211,null))[_0x1ae3('0x22')](function(_0x1284d0){if(_0x1284d0){return _0x1284d0[_0x1ae3('0x82')]();}return null;})[_0x1ae3('0x22')](respondWithResult(_0x326211,null))['catch'](handleError(_0x326211,null));};exports['addImap']=function(_0x21ec2b,_0x13b112,_0x762421){if(_0x21ec2b['body']['id']){delete _0x21ec2b['body']['id'];}return db[_0x1ae3('0x3d')][_0x1ae3('0x5e')]({'where':{'id':_0x21ec2b[_0x1ae3('0x57')]['id']}})[_0x1ae3('0x22')](handleEntityNotFound(_0x13b112,null))[_0x1ae3('0x22')](function(_0xefce27){if(_0xefce27){_0x21ec2b[_0x1ae3('0x5f')][_0x1ae3('0x62')]=_0xefce27['id'];return db[_0x1ae3('0x58')][_0x1ae3('0x63')](_0x21ec2b[_0x1ae3('0x5f')]);}})[_0x1ae3('0x22')](respondWithResult(_0x13b112,null))['catch'](handleError(_0x13b112,null));};exports[_0x1ae3('0x83')]=function(_0x5ef511,_0x238e83,_0x329f2e){return db[_0x1ae3('0x3d')][_0x1ae3('0x65')]({'where':{'id':_0x5ef511['params']['id']}})['then'](handleEntityNotFound(_0x238e83,null))[_0x1ae3('0x22')](function(_0x2598b8){if(_0x2598b8){return _0x2598b8['setImap'](null);}return null;})['then'](respondWithStatusCode(_0x238e83,null))[_0x1ae3('0x55')](handleError(_0x238e83,null));};exports['getSmtp']=function(_0x1624ed,_0x5c61eb,_0x43d35d){return db[_0x1ae3('0x3d')][_0x1ae3('0x65')]({'where':{'id':_0x1624ed[_0x1ae3('0x57')]['id']}})[_0x1ae3('0x22')](handleEntityNotFound(_0x5c61eb,null))[_0x1ae3('0x22')](function(_0x12acac){if(_0x12acac){return _0x12acac[_0x1ae3('0x84')]();}return null;})[_0x1ae3('0x22')](respondWithResult(_0x5c61eb,null))['catch'](handleError(_0x5c61eb,null));};exports[_0x1ae3('0x85')]=function(_0x440591,_0x43f78c,_0x19c088){if(_0x440591[_0x1ae3('0x5f')]['id']){delete _0x440591[_0x1ae3('0x5f')]['id'];}return db[_0x1ae3('0x3d')][_0x1ae3('0x5e')]({'where':{'id':_0x440591[_0x1ae3('0x57')]['id']}})['then'](handleEntityNotFound(_0x43f78c,null))['then'](function(_0x5d093a){if(_0x5d093a){_0x440591[_0x1ae3('0x5f')][_0x1ae3('0x62')]=_0x5d093a['id'];return db[_0x1ae3('0x5a')][_0x1ae3('0x63')](_0x440591[_0x1ae3('0x5f')]);}})[_0x1ae3('0x22')](respondWithResult(_0x43f78c,null))[_0x1ae3('0x55')](handleError(_0x43f78c,null));};exports[_0x1ae3('0x86')]=function(_0x94e0e3,_0x52f0f7,_0x22586a){return db[_0x1ae3('0x3d')][_0x1ae3('0x65')]({'where':{'id':_0x94e0e3[_0x1ae3('0x57')]['id']}})[_0x1ae3('0x22')](handleEntityNotFound(_0x52f0f7,null))[_0x1ae3('0x22')](function(_0x558b91){if(_0x558b91){return _0x558b91[_0x1ae3('0x87')](null);}return null;})[_0x1ae3('0x22')](respondWithStatusCode(_0x52f0f7,null))[_0x1ae3('0x55')](handleError(_0x52f0f7,null));};exports[_0x1ae3('0x88')]=function(_0x4dc27c,_0x387125,_0x1d40e8){return db[_0x1ae3('0x89')]['find']({'where':{'id':_0x4dc27c[_0x1ae3('0x57')]['id']}})[_0x1ae3('0x22')](handleEntityNotFound(_0x387125,null))[_0x1ae3('0x22')](function(_0x38f408){if(_0x38f408){return _0x38f408[_0x1ae3('0x88')](_0x4dc27c[_0x1ae3('0x5f')][_0x1ae3('0x69')],_['omit'](_0x4dc27c['body'],[_0x1ae3('0x69'),'id'])||{});}})[_0x1ae3('0x22')](respondWithResult(_0x387125,null))[_0x1ae3('0x55')](handleError(_0x387125,null));};exports['getInteractions']=function(_0x29f1b4,_0x5aac82,_0x643ed4){var _0x5f33af={'raw':![],'where':{}};var _0x4b1263={};var _0x17dd7f={'count':0x0,'rows':[]};return db['MailAccount'][_0x1ae3('0x65')]({'where':{'id':_0x29f1b4['params']['id']}})['then'](handleEntityNotFound(_0x5aac82,null))['then'](function(_0x27f3bd){if(_0x27f3bd){_0x4b1263[_0x1ae3('0x3f')]=_[_0x1ae3('0x40')](db[_0x1ae3('0x89')][_0x1ae3('0x3e')]);_0x4b1263[_0x1ae3('0x41')]=_[_0x1ae3('0x40')](_0x29f1b4['query']);_0x4b1263[_0x1ae3('0x42')]=_[_0x1ae3('0x43')](_0x4b1263[_0x1ae3('0x3f')],_0x4b1263[_0x1ae3('0x41')]);_0x5f33af['attributes']=_[_0x1ae3('0x43')](_0x4b1263[_0x1ae3('0x3f')],qs[_0x1ae3('0x44')](_0x29f1b4[_0x1ae3('0x41')][_0x1ae3('0x44')]));_0x5f33af[_0x1ae3('0x45')]=_0x5f33af[_0x1ae3('0x45')]['length']?_0x5f33af[_0x1ae3('0x45')]:_0x4b1263[_0x1ae3('0x3f')];if(!_0x29f1b4[_0x1ae3('0x41')][_0x1ae3('0x66')](_0x1ae3('0x46'))){_0x5f33af['limit']=qs[_0x1ae3('0x31')](_0x29f1b4['query'][_0x1ae3('0x31')]);_0x5f33af[_0x1ae3('0x30')]=qs[_0x1ae3('0x30')](_0x29f1b4['query']['offset']);}_0x5f33af[_0x1ae3('0x47')]=qs[_0x1ae3('0x48')](_0x29f1b4[_0x1ae3('0x41')][_0x1ae3('0x48')]);_0x5f33af[_0x1ae3('0x49')]=qs[_0x1ae3('0x42')](_[_0x1ae3('0x4a')](_0x29f1b4[_0x1ae3('0x41')],_0x4b1263['filters']));_0x5f33af[_0x1ae3('0x49')][_0x1ae3('0x62')]=_0x27f3bd['id'];if(_0x29f1b4['query'][_0x1ae3('0x4b')]){_0x5f33af[_0x1ae3('0x49')]=_[_0x1ae3('0x4c')](_0x5f33af[_0x1ae3('0x49')],{'$or':_[_0x1ae3('0x4d')](_0x5f33af[_0x1ae3('0x45')],function(_0x712164){var _0xd74537={};_0xd74537[_0x712164]={'$like':'%'+_0x29f1b4[_0x1ae3('0x41')]['filter']+'%'};return _0xd74537;})});}_0x5f33af=_[_0x1ae3('0x4c')]({},_0x5f33af,_0x29f1b4[_0x1ae3('0x51')]);return db[_0x1ae3('0x89')][_0x1ae3('0x2f')]({'where':_0x5f33af['where']})[_0x1ae3('0x22')](function(_0x340d9f){_0x17dd7f[_0x1ae3('0x2f')]=_0x340d9f;if(_0x29f1b4[_0x1ae3('0x41')][_0x1ae3('0x5d')]){_0x5f33af['include']=[{'model':db['CmContact'],'as':_0x1ae3('0x8a'),'required':![]},{'model':db[_0x1ae3('0x8b')],'as':_0x1ae3('0x8c'),'attributes':[_0x1ae3('0x39'),'fullname',_0x1ae3('0x8d')],'required':![]},{'model':db[_0x1ae3('0x8e')],'as':_0x1ae3('0x8f'),'attributes':['id',_0x1ae3('0x39'),_0x1ae3('0x90')],'where':_0x29f1b4['query'][_0x1ae3('0x91')]?{'id':_0x29f1b4['query'][_0x1ae3('0x91')]}:undefined,'required':_0x29f1b4[_0x1ae3('0x41')]['tag']?!![]:![]}];}return db[_0x1ae3('0x89')][_0x1ae3('0x53')](_0x5f33af);})[_0x1ae3('0x22')](function(_0x41bfa8){_0x17dd7f[_0x1ae3('0x54')]=_0x41bfa8;return _0x17dd7f;});}})[_0x1ae3('0x22')](respondWithFilteredResult(_0x5aac82,_0x5f33af))['catch'](handleError(_0x5aac82,null));};exports[_0x1ae3('0x92')]=function(_0x2c15e0,_0xb5fb1b,_0x3342c2){return db[_0x1ae3('0x3d')][_0x1ae3('0x65')]({'where':{'id':_0x2c15e0[_0x1ae3('0x57')]['id']}})[_0x1ae3('0x22')](handleEntityNotFound(_0xb5fb1b,null))[_0x1ae3('0x22')](function(_0x36a4e4){if(_0x36a4e4){return db[_0x1ae3('0x93')][_0x1ae3('0x94')](function(_0x5a8837){return db[_0x1ae3('0x95')][_0x1ae3('0x37')]({'where':{'MailAccountId':_0x2c15e0[_0x1ae3('0x57')]['id']},'transaction':_0x5a8837})[_0x1ae3('0x22')](function(_0x593c2f){var _0x5b1329=_[_0x1ae3('0x4d')](_0x2c15e0[_0x1ae3('0x5f')],function(_0x27f0c1){_0x27f0c1[_0x1ae3('0x62')]=_0x2c15e0['params']['id'];return _0x27f0c1;});return db['MailApplication']['bulkCreate'](_0x5b1329,{'transaction':_0x5a8837});});})[_0x1ae3('0x22')](function(){return db[_0x1ae3('0x95')][_0x1ae3('0x96')]({'where':{'MailAccountId':_0x2c15e0[_0x1ae3('0x57')]['id']},'order':'priority'});});}})[_0x1ae3('0x22')](respondWithResult(_0xb5fb1b,null))[_0x1ae3('0x55')](handleError(_0xb5fb1b,null));};exports[_0x1ae3('0x97')]=function(_0x18b413,_0x202e7a,_0x57013e){var _0x45c574={};var _0x143459={};var _0x2b0cae;var _0x17b3ec;return db[_0x1ae3('0x3d')]['findOne']({'where':{'id':_0x18b413[_0x1ae3('0x57')]['id']}})[_0x1ae3('0x22')](handleEntityNotFound(_0x202e7a,null))['then'](function(_0x54c7ac){if(_0x54c7ac){_0x2b0cae=_0x54c7ac;_0x143459[_0x1ae3('0x3f')]=_[_0x1ae3('0x40')](db[_0x1ae3('0x95')][_0x1ae3('0x3e')]);_0x143459[_0x1ae3('0x41')]=_[_0x1ae3('0x40')](_0x18b413['query']);_0x143459[_0x1ae3('0x42')]=_[_0x1ae3('0x43')](_0x143459[_0x1ae3('0x3f')],_0x143459['query']);_0x45c574[_0x1ae3('0x45')]=_[_0x1ae3('0x43')](_0x143459[_0x1ae3('0x3f')],qs['fields'](_0x18b413[_0x1ae3('0x41')][_0x1ae3('0x44')]));_0x45c574[_0x1ae3('0x45')]=_0x45c574[_0x1ae3('0x45')]['length']?_0x45c574[_0x1ae3('0x45')]:_0x143459[_0x1ae3('0x3f')];_0x45c574[_0x1ae3('0x47')]=qs[_0x1ae3('0x48')](_0x18b413[_0x1ae3('0x41')]['sort']);_0x45c574[_0x1ae3('0x49')]=qs['filters'](_['pick'](_0x18b413[_0x1ae3('0x41')],_0x143459[_0x1ae3('0x42')]));if(_0x18b413[_0x1ae3('0x41')][_0x1ae3('0x4b')]){_0x45c574['where']=_[_0x1ae3('0x4c')](_0x45c574[_0x1ae3('0x49')],{'$or':_['map'](_0x45c574['attributes'],function(_0x2aa224){var _0x13f9a8={};_0x13f9a8[_0x2aa224]={'$like':'%'+_0x18b413['query'][_0x1ae3('0x4b')]+'%'};return _0x13f9a8;})});}_0x45c574=_[_0x1ae3('0x4c')]({},_0x45c574,_0x18b413[_0x1ae3('0x51')]);return _0x2b0cae[_0x1ae3('0x97')](_0x45c574);}})[_0x1ae3('0x22')](function(_0x3885f0){if(_0x3885f0){_0x17b3ec=_0x3885f0['length'];if(!_0x18b413[_0x1ae3('0x41')]['hasOwnProperty']('nolimit')){_0x45c574[_0x1ae3('0x31')]=qs[_0x1ae3('0x31')](_0x18b413[_0x1ae3('0x41')]['limit']);_0x45c574[_0x1ae3('0x30')]=qs[_0x1ae3('0x30')](_0x18b413[_0x1ae3('0x41')][_0x1ae3('0x30')]);}return _0x2b0cae[_0x1ae3('0x97')](_0x45c574);}})[_0x1ae3('0x22')](function(_0x11b270){if(_0x11b270){return _0x11b270?{'count':_0x17b3ec,'rows':_0x11b270}:null;}})[_0x1ae3('0x22')](respondWithResult(_0x202e7a,null))[_0x1ae3('0x55')](handleError(_0x202e7a,null));};exports[_0x1ae3('0x98')]=function(_0x51dbd8,_0x523c9a,_0x3995c1){var _0x226846={'raw':!![],'where':{}};var _0x19ceab={};var _0x3a9a0c={'count':0x0,'rows':[]};return db[_0x1ae3('0x3d')][_0x1ae3('0x65')]({'where':{'id':_0x51dbd8['params']['id']}})['then'](handleEntityNotFound(_0x523c9a,null))['then'](function(_0x56de8f){if(_0x56de8f){_0x19ceab['model']=_[_0x1ae3('0x40')](db[_0x1ae3('0x99')][_0x1ae3('0x3e')]);_0x19ceab[_0x1ae3('0x41')]=_[_0x1ae3('0x40')](_0x51dbd8[_0x1ae3('0x41')]);_0x19ceab['filters']=_[_0x1ae3('0x43')](_0x19ceab[_0x1ae3('0x3f')],_0x19ceab[_0x1ae3('0x41')]);_0x226846[_0x1ae3('0x45')]=_[_0x1ae3('0x43')](_0x19ceab[_0x1ae3('0x3f')],qs[_0x1ae3('0x44')](_0x51dbd8[_0x1ae3('0x41')][_0x1ae3('0x44')]));_0x226846[_0x1ae3('0x45')]=_0x226846[_0x1ae3('0x45')][_0x1ae3('0x5c')]?_0x226846[_0x1ae3('0x45')]:_0x19ceab[_0x1ae3('0x3f')];if(!_0x51dbd8[_0x1ae3('0x41')][_0x1ae3('0x66')]('nolimit')){_0x226846[_0x1ae3('0x31')]=qs[_0x1ae3('0x31')](_0x51dbd8[_0x1ae3('0x41')]['limit']);_0x226846[_0x1ae3('0x30')]=qs[_0x1ae3('0x30')](_0x51dbd8['query'][_0x1ae3('0x30')]);}_0x226846[_0x1ae3('0x47')]=qs[_0x1ae3('0x48')](_0x51dbd8[_0x1ae3('0x41')][_0x1ae3('0x48')]);_0x226846[_0x1ae3('0x49')]=qs[_0x1ae3('0x42')](_[_0x1ae3('0x4a')](_0x51dbd8['query'],_0x19ceab[_0x1ae3('0x42')]));_0x226846['where']['MailAccountId']=_0x56de8f['id'];if(_0x51dbd8[_0x1ae3('0x41')][_0x1ae3('0x4b')]){_0x226846[_0x1ae3('0x49')]=_['merge'](_0x226846['where'],{'$or':_[_0x1ae3('0x4d')](_0x226846[_0x1ae3('0x45')],function(_0x66a6d1){var _0x8a173={};_0x8a173[_0x66a6d1]={'$like':'%'+_0x51dbd8[_0x1ae3('0x41')][_0x1ae3('0x4b')]+'%'};return _0x8a173;})});}if(_0x51dbd8[_0x1ae3('0x41')][_0x1ae3('0x9a')]){var _0x263d4c=_0x51dbd8[_0x1ae3('0x41')]['$gte']['split'](',');var _0x4e91b5={};_0x4e91b5[_0x263d4c[0x0]]={'$gte':moment(_0x263d4c[0x1])[_0x1ae3('0x9b')](_0x1ae3('0x9c'))};_0x226846[_0x1ae3('0x49')]=_[_0x1ae3('0x4c')](_0x226846[_0x1ae3('0x49')],_0x4e91b5);}_0x226846=_['merge']({},_0x226846,_0x51dbd8[_0x1ae3('0x51')]);return db[_0x1ae3('0x99')]['count']({'where':_0x226846['where']})[_0x1ae3('0x22')](function(_0x1542c0){_0x3a9a0c[_0x1ae3('0x2f')]=_0x1542c0;if(_0x51dbd8[_0x1ae3('0x41')][_0x1ae3('0x5d')]){_0x226846[_0x1ae3('0x52')]=[{'all':!![]}];}return db['MailMessage'][_0x1ae3('0x53')](_0x226846);})['then'](function(_0x390067){_0x3a9a0c['rows']=_0x390067;return _0x3a9a0c;});}})[_0x1ae3('0x22')](respondWithFilteredResult(_0x523c9a,_0x226846))[_0x1ae3('0x55')](handleError(_0x523c9a,null));};exports['send']=function(_0x135a48,_0x14894b,_0x5efd2d){var _0x30e8d7,_0x4049a7={},_0x26aff9;if(_0x135a48[_0x1ae3('0x5f')]['to']){_0x26aff9=_0x135a48[_0x1ae3('0x5f')]['to'][_0x1ae3('0x9d')](',')[0x0];}return db[_0x1ae3('0x3d')][_0x1ae3('0x5e')]({'where':{'id':_0x135a48[_0x1ae3('0x57')]['id']},'include':[{'model':db[_0x1ae3('0x9e')],'as':_0x1ae3('0x9f'),'include':[{'model':db[_0x1ae3('0xa0')],'as':_0x1ae3('0xa1'),'where':{'email':_0x26aff9},'limit':0x1,'order':[[_0x1ae3('0xa2'),_0x1ae3('0xa3')]]}]},{'model':db[_0x1ae3('0x5a')],'as':'Smtp','raw':!![]}]})[_0x1ae3('0x22')](handleEntityNotFound(_0x14894b,null))[_0x1ae3('0x22')](function(_0x3e7fdb){if(_0x3e7fdb){_0x30e8d7=_0x3e7fdb;if(_0x3e7fdb[_0x1ae3('0x3b')]){if(_[_0x1ae3('0x70')](_0x135a48[_0x1ae3('0x5f')][_0x1ae3('0xa4')])){_0x135a48[_0x1ae3('0x5f')]['from']=util[_0x1ae3('0x9b')](_0x1ae3('0xa5'),_0x3e7fdb['name'],_0x3e7fdb[_0x1ae3('0x6e')]||_0x3e7fdb['Smtp'][_0x1ae3('0x75')]);}if(_0x135a48[_0x1ae3('0x5f')]['attachments']&&_0x135a48[_0x1ae3('0x5f')][_0x1ae3('0xa6')]['length']){for(var _0x314fce=0x0;_0x314fce<_0x135a48['body']['attachments'][_0x1ae3('0x5c')];_0x314fce+=0x1){_0x135a48[_0x1ae3('0x5f')][_0x1ae3('0xa6')][_0x314fce]={'filename':_0x135a48['body']['attachments'][_0x314fce][_0x1ae3('0x39')],'path':path[_0x1ae3('0xa7')](config[_0x1ae3('0xa8')],_0x1ae3('0xa9'),_0x135a48[_0x1ae3('0x5f')][_0x1ae3('0xa6')][_0x314fce][_0x1ae3('0xaa')])};}}var _0x2a945a={'tls':{'rejectUnauthorized':![]}};if(_[_0x1ae3('0x70')](_0x3e7fdb['Smtp'][_0x1ae3('0xab')])){if(_0x3e7fdb[_0x1ae3('0x3b')]['authentication']){_0x2a945a[_0x1ae3('0xac')]={'user':_0x3e7fdb[_0x1ae3('0x3b')][_0x1ae3('0x75')],'pass':_0x3e7fdb[_0x1ae3('0x3b')]['pass']};}_0x2a945a[_0x1ae3('0x7a')]=_0x3e7fdb['Smtp'][_0x1ae3('0x7a')];_0x2a945a['port']=_0x3e7fdb[_0x1ae3('0x3b')][_0x1ae3('0x7b')];_0x2a945a[_0x1ae3('0xad')]=_0x3e7fdb[_0x1ae3('0x3b')]['secure'];}else{_0x2a945a[_0x1ae3('0xab')]=_0x3e7fdb['Smtp'][_0x1ae3('0xab')];_0x2a945a['auth']={'user':_0x3e7fdb[_0x1ae3('0x3b')]['user'],'pass':_0x3e7fdb[_0x1ae3('0x3b')]['pass']};}return respondWithRpcPromise(_0x1ae3('0xae'),_0x1ae3('0xaf'),{'account':_0x2a945a,'message':_0x135a48[_0x1ae3('0x5f')]});}else{throw new Error(_0x1ae3('0xb0'));}}})['then'](function(_0x4ba503){if(_0x4ba503){_0x4049a7=_0x4ba503;if(_0x30e8d7[_0x1ae3('0x9f')]){if(_0x30e8d7[_0x1ae3('0x9f')][_0x1ae3('0xa1')]['length']){return _0x30e8d7[_0x1ae3('0x9f')]['Contacts'][0x0];}else{return db[_0x1ae3('0xa0')][_0x1ae3('0x63')](_[_0x1ae3('0xb1')](_0x135a48[_0x1ae3('0x5f')],{'firstName':_0x135a48[_0x1ae3('0x5f')]['to'],'email':_0x135a48[_0x1ae3('0x5f')]['to'],'phone':_0x135a48['body']['to'],'ListId':_0x30e8d7['ListId']}));}}else{throw new Error(_0x1ae3('0xb0'));}}})[_0x1ae3('0x22')](function(_0x34e3be){if(_0x34e3be){var _0x40dc6b={'UserId':_0x135a48[_0x1ae3('0x75')]['id'],'ContactId':_0x34e3be['id'],'MailAccountId':_0x30e8d7['id'],'inReplyTo':_0x4049a7['messageId'],'to':_0x135a48['body'][_0x1ae3('0xa4')],'cc':_0x135a48['body']['cc'],'subject':_0x135a48['body'][_0x1ae3('0xb2')],'attach':_0x135a48[_0x1ae3('0x5f')][_0x1ae3('0xb3')],'firstMsgDirection':_0x1ae3('0xb4'),'lastMsgAt':moment()[_0x1ae3('0x9b')](_0x1ae3('0x9c')),'lastMsgDirection':_0x1ae3('0xb4'),'lastMsgBody':_0x135a48[_0x1ae3('0x5f')][_0x1ae3('0x5f')],'Messages':[_[_0x1ae3('0x4c')](_0x135a48[_0x1ae3('0x5f')],{'messageId':_0x4049a7['messageId'],'sentAt':moment()['format'](_0x1ae3('0x9c')),'read':!![],'MailAccountId':_0x30e8d7['id'],'UserId':_0x135a48[_0x1ae3('0x75')]['id'],'ContactId':_0x34e3be['id']})]};if(_0x135a48[_0x1ae3('0x5f')]['Interaction']){_0x40dc6b=_[_0x1ae3('0x4c')](_0x40dc6b,_0x135a48[_0x1ae3('0x5f')]['Interaction']);}return db[_0x1ae3('0x89')][_0x1ae3('0x63')](_0x40dc6b,{'include':[{'model':db[_0x1ae3('0x99')],'as':_0x1ae3('0xb5')}]});}})[_0x1ae3('0x22')](respondWithResult(_0x14894b,null))[_0x1ae3('0x55')](handleError(_0x14894b,null));};exports[_0x1ae3('0xb6')]=function(_0x4e27a2,_0x56ac5b,_0x9c4e59){return db[_0x1ae3('0x3d')][_0x1ae3('0x5e')]({'where':{'id':_0x4e27a2[_0x1ae3('0x57')]['id']},'include':[{'model':db[_0x1ae3('0x5a')],'as':'Smtp','raw':!![]}]})[_0x1ae3('0x22')](handleEntityNotFound(_0x56ac5b,null))[_0x1ae3('0x22')](function(_0x7ae993){if(_0x7ae993&&_0x7ae993[_0x1ae3('0x3b')]){var _0x27eddb={'id':_0x7ae993['id'],'tls':{'rejectUnauthorized':![]}};if(_0x7ae993['Smtp']['service']){_0x27eddb[_0x1ae3('0xab')]=_0x7ae993[_0x1ae3('0x3b')][_0x1ae3('0xab')];}else{_0x27eddb[_0x1ae3('0x7a')]=_0x7ae993[_0x1ae3('0x3b')][_0x1ae3('0x7a')];_0x27eddb[_0x1ae3('0x7b')]=_0x7ae993[_0x1ae3('0x3b')]['port'];_0x27eddb[_0x1ae3('0xad')]=_0x7ae993['Smtp'][_0x1ae3('0xad')];}if(_0x7ae993['Smtp'][_0x1ae3('0x79')]){_0x27eddb[_0x1ae3('0xac')]={'user':_0x7ae993[_0x1ae3('0x3b')][_0x1ae3('0x75')],'pass':_0x7ae993[_0x1ae3('0x3b')]['pass']};}return respondWithRpcPromise(_0x1ae3('0xb7'),_0x1ae3('0xb6'),{'account':_0x27eddb});}})[_0x1ae3('0x22')](respondWithResult(_0x56ac5b,null))[_0x1ae3('0x55')](handleError(_0x56ac5b,null));};exports['destroy']=function(_0x341aa4,_0x5e29a3){return db[_0x1ae3('0x3d')][_0x1ae3('0x5e')]({'where':{'id':_0x341aa4[_0x1ae3('0x57')]['id']}})[_0x1ae3('0x22')](handleEntityNotFound(_0x5e29a3,null))['then'](function(_0x24081d){if(_0x24081d&&_0x24081d[_0x1ae3('0xab')]){throw new db[(_0x1ae3('0xb8'))][(_0x1ae3('0xb9'))](_0x1ae3('0xba'));}return _0x24081d;})[_0x1ae3('0x22')](removeEntity(_0x5e29a3,null))[_0x1ae3('0x55')](handleError(_0x5e29a3,null));};exports['addAgents']=function(_0x2361bf,_0x44972f,_0x503124){return db[_0x1ae3('0x3d')]['find']({'where':{'id':_0x2361bf[_0x1ae3('0x57')]['id']}})[_0x1ae3('0x22')](handleEntityNotFound(_0x44972f,null))[_0x1ae3('0x22')](function(_0x22eb2d){if(_0x22eb2d){return _0x22eb2d[_0x1ae3('0xbb')](_0x2361bf['body'][_0x1ae3('0x69')],_[_0x1ae3('0xbc')](_0x2361bf[_0x1ae3('0x5f')],[_0x1ae3('0x69'),'id'])||{})[_0x1ae3('0xbd')](function(_0xb953ae){for(var _0x447b34=0x0;_0x447b34<_0x2361bf[_0x1ae3('0x5f')][_0x1ae3('0x69')][_0x1ae3('0x5c')];_0x447b34+=0x1){socket[_0x1ae3('0xbe')](_0x1ae3('0xbf'),{'UserId':_0x2361bf[_0x1ae3('0x5f')][_0x1ae3('0x69')][_0x447b34],'MailAccountId':_0x2361bf[_0x1ae3('0x57')]['id']});}return _0xb953ae;});}})['then'](respondWithResult(_0x44972f,null))['catch'](handleError(_0x44972f,null));};exports[_0x1ae3('0xc0')]=function(_0xf827b4,_0x30a2e2,_0x20a5b9){return db['MailAccount'][_0x1ae3('0x5e')]({'where':{'id':_0xf827b4[_0x1ae3('0x57')]['id']}})['then'](handleEntityNotFound(_0x30a2e2,null))['then'](function(_0x4e35ea){if(_0x4e35ea){return _0x4e35ea[_0x1ae3('0xc0')](_0xf827b4['query'][_0x1ae3('0x69')])[_0x1ae3('0x22')](function(){if(_['isArray'](_0xf827b4[_0x1ae3('0x41')][_0x1ae3('0x69')])){for(var _0x43a300=0x0;_0x43a300<_0xf827b4[_0x1ae3('0x41')][_0x1ae3('0x69')][_0x1ae3('0x5c')];_0x43a300+=0x1){socket[_0x1ae3('0xbe')](_0x1ae3('0xc1'),{'UserId':Number(_0xf827b4['query']['ids'][_0x43a300]),'MailAccountId':Number(_0xf827b4[_0x1ae3('0x57')]['id'])});}}else{socket[_0x1ae3('0xbe')](_0x1ae3('0xc1'),{'UserId':Number(_0xf827b4[_0x1ae3('0x41')][_0x1ae3('0x69')]),'MailAccountId':Number(_0xf827b4[_0x1ae3('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x30a2e2,null))[_0x1ae3('0x55')](handleError(_0x30a2e2,null));};exports[_0x1ae3('0xc2')]=function(_0x2045d1,_0x54d840,_0x412aca){var _0x1b299d={};var _0x864db4={};var _0x524a88;var _0x1a7971;return db['MailAccount'][_0x1ae3('0x65')]({'where':{'id':_0x2045d1['params']['id']}})[_0x1ae3('0x22')](handleEntityNotFound(_0x54d840,null))[_0x1ae3('0x22')](function(_0x5a5cd8){if(_0x5a5cd8){_0x524a88=_0x5a5cd8;_0x864db4[_0x1ae3('0x3f')]=_[_0x1ae3('0x40')](db[_0x1ae3('0x8b')][_0x1ae3('0x3e')]);_0x864db4[_0x1ae3('0x41')]=_['keys'](_0x2045d1['query']);_0x864db4[_0x1ae3('0x42')]=_['intersection'](_0x864db4[_0x1ae3('0x3f')],_0x864db4['query']);_0x1b299d[_0x1ae3('0x45')]=_[_0x1ae3('0x43')](_0x864db4[_0x1ae3('0x3f')],qs[_0x1ae3('0x44')](_0x2045d1[_0x1ae3('0x41')][_0x1ae3('0x44')]));_0x1b299d['attributes']=_0x1b299d['attributes'][_0x1ae3('0x5c')]?_0x1b299d[_0x1ae3('0x45')]:_0x864db4[_0x1ae3('0x3f')];_0x1b299d['order']=qs[_0x1ae3('0x48')](_0x2045d1[_0x1ae3('0x41')]['sort']);_0x1b299d[_0x1ae3('0x49')]=qs[_0x1ae3('0x42')](_[_0x1ae3('0x4a')](_0x2045d1[_0x1ae3('0x41')],_0x864db4[_0x1ae3('0x42')]));if(_0x2045d1['query']['filter']){_0x1b299d[_0x1ae3('0x49')]=_[_0x1ae3('0x4c')](_0x1b299d['where'],{'$or':_[_0x1ae3('0x4d')](_0x1b299d[_0x1ae3('0x45')],function(_0x232e1e){var _0x2c7cd5={};_0x2c7cd5[_0x232e1e]={'$like':'%'+_0x2045d1[_0x1ae3('0x41')][_0x1ae3('0x4b')]+'%'};return _0x2c7cd5;})});}_0x1b299d=_[_0x1ae3('0x4c')]({},_0x1b299d,_0x2045d1[_0x1ae3('0x51')]);return _0x524a88[_0x1ae3('0xc2')](_0x1b299d);}})[_0x1ae3('0x22')](function(_0x130201){if(_0x130201){_0x1a7971=_0x130201[_0x1ae3('0x5c')];if(!_0x2045d1['query'][_0x1ae3('0x66')](_0x1ae3('0x46'))){_0x1b299d[_0x1ae3('0x31')]=qs[_0x1ae3('0x31')](_0x2045d1[_0x1ae3('0x41')][_0x1ae3('0x31')]);_0x1b299d[_0x1ae3('0x30')]=qs[_0x1ae3('0x30')](_0x2045d1[_0x1ae3('0x41')][_0x1ae3('0x30')]);}return _0x524a88['getAgents'](_0x1b299d);}})[_0x1ae3('0x22')](function(_0x1f6644){if(_0x1f6644){return _0x1f6644?{'count':_0x1a7971,'rows':_0x1f6644}:null;}})[_0x1ae3('0x22')](respondWithResult(_0x54d840,null))[_0x1ae3('0x55')](handleError(_0x54d840,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index faa0acb..2f47a7c 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(_0x30bd66,_0x36a93d){var _0x74c9dd=function(_0x2cd660){while(--_0x2cd660){_0x30bd66['push'](_0x30bd66['shift']());}};_0x74c9dd(++_0x36a93d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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(_0xb833b1,_0x1c3d3f){var _0x1ab87a=function(_0x1c9f6c){while(--_0x1c9f6c){_0xb833b1['push'](_0xb833b1['shift']());}};_0x1ab87a(++_0x1c3d3f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 929e368..aa829c5 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 _0x887b=['path','rimraf','./mailAccount.attributes','define','MailAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5c83fc,_0x2aaa1e){var _0x26614e=function(_0x15753d){while(--_0x15753d){_0x5c83fc['push'](_0x5c83fc['shift']());}};_0x26614e(++_0x2aaa1e);}(_0x887b,0x185));var _0xb887=function(_0x2697b2,_0x244378){_0x2697b2=_0x2697b2-0x0;var _0x2cd037=_0x887b[_0x2697b2];return _0x2cd037;};'use strict';var _=require(_0xb887('0x0'));var util=require(_0xb887('0x1'));var logger=require(_0xb887('0x2'))(_0xb887('0x3'));var moment=require(_0xb887('0x4'));var BPromise=require(_0xb887('0x5'));var rp=require(_0xb887('0x6'));var fs=require('fs');var path=require(_0xb887('0x7'));var rimraf=require(_0xb887('0x8'));var config=require('../../config/environment');var attributes=require(_0xb887('0x9'));module['exports']=function(_0x4bafed,_0x48f83b){return _0x4bafed[_0xb887('0xa')](_0xb887('0xb'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8cad=['MailAccount','mail_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports'];(function(_0xcfd4ca,_0x362a89){var _0x4aaeab=function(_0x406f6e){while(--_0x406f6e){_0xcfd4ca['push'](_0xcfd4ca['shift']());}};_0x4aaeab(++_0x362a89);}(_0x8cad,0xfe));var _0xd8ca=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x8cad[_0x3740fe];return _0x55492b;};'use strict';var _=require(_0xd8ca('0x0'));var util=require(_0xd8ca('0x1'));var logger=require(_0xd8ca('0x2'))(_0xd8ca('0x3'));var moment=require(_0xd8ca('0x4'));var BPromise=require(_0xd8ca('0x5'));var rp=require(_0xd8ca('0x6'));var fs=require('fs');var path=require(_0xd8ca('0x7'));var rimraf=require(_0xd8ca('0x8'));var config=require(_0xd8ca('0x9'));var attributes=require(_0xd8ca('0xa'));module[_0xd8ca('0xb')]=function(_0x14c73e,_0x6d5070){return _0x14c73e['define'](_0xd8ca('0xc'),attributes,{'tableName':_0xd8ca('0xd'),'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 0c1cb40..5cdb036 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 _0xeb4f=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./mailAccount.socket','register','then','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','catch','GetMailAccount','findAll','options','raw','attributes','limit','include','map','model','ShowMailAccount','MailAccount','find','debug','NotifyMailAccount','body','difference','keys','CmContact','rawAttributes','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','Contacts','MailApplication','MailServerOut','Smtp','List','get','omit','Applications','applications','list','priority','asc','autoclose','push','length','close','create','List\x20not\x20found','messageId','generate','subject','attach','format','MailInteraction','MailMessage','inReplyTo','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','created','contact','originTo','originCc','bcc','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting'];(function(_0x3d561b,_0x4d0660){var _0x213c21=function(_0x34d6a4){while(--_0x34d6a4){_0x3d561b['push'](_0x3d561b['shift']());}};_0x213c21(++_0x4d0660);}(_0xeb4f,0x68));var _0xfeb4=function(_0x19793c,_0x181498){_0x19793c=_0x19793c-0x0;var _0x1bbc60=_0xeb4f[_0x19793c];return _0x1bbc60;};'use strict';var _=require(_0xfeb4('0x0'));var util=require(_0xfeb4('0x1'));var moment=require(_0xfeb4('0x2'));var BPromise=require(_0xfeb4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfeb4('0x4'));var db=require(_0xfeb4('0x5'))['db'];var utils=require(_0xfeb4('0x6'));var logger=require(_0xfeb4('0x7'))(_0xfeb4('0x8'));var config=require(_0xfeb4('0x9'));var jayson=require(_0xfeb4('0xa'));var client=jayson['client'][_0xfeb4('0xb')]({'port':0x232c});config[_0xfeb4('0xc')]=_[_0xfeb4('0xd')](config[_0xfeb4('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xfeb4('0xe'))(new Redis(config[_0xfeb4('0xc')]));require(_0xfeb4('0xf'))[_0xfeb4('0x10')](socket);function respondWithRpcPromise(_0x185a82,_0x368a0d,_0xa1f809){return new BPromise(function(_0x148a7e,_0xef408a){return client['request'](_0x185a82,_0xa1f809)[_0xfeb4('0x11')](function(_0x5e1b95){logger[_0xfeb4('0x12')]('MailAccount,\x20%s,\x20%s',_0x368a0d,_0xfeb4('0x13'));logger['debug'](_0xfeb4('0x14'),_0x368a0d,'request\x20sent',JSON[_0xfeb4('0x15')](_0x5e1b95));if(_0x5e1b95[_0xfeb4('0x16')]){if(_0x5e1b95['error'][_0xfeb4('0x17')]===0x1f4){logger[_0xfeb4('0x16')](_0xfeb4('0x18'),_0x368a0d,_0x5e1b95['error'][_0xfeb4('0x19')]);return _0xef408a(_0x5e1b95[_0xfeb4('0x16')][_0xfeb4('0x19')]);}logger[_0xfeb4('0x16')]('MailAccount,\x20%s,\x20%s',_0x368a0d,_0x5e1b95['error'][_0xfeb4('0x19')]);return _0x148a7e(_0x5e1b95['error'][_0xfeb4('0x19')]);}else{logger[_0xfeb4('0x12')](_0xfeb4('0x18'),_0x368a0d,_0xfeb4('0x13'));_0x148a7e(_0x5e1b95['result'][_0xfeb4('0x19')]);}})[_0xfeb4('0x1a')](function(_0x4d0b08){logger['error'](_0xfeb4('0x18'),_0x368a0d,_0x4d0b08);_0xef408a(_0x4d0b08);});});}exports[_0xfeb4('0x1b')]=function(_0x29fbbf){var _0x2f246b=this;return new Promise(function(_0x1e62d4,_0x143b30){return db['MailAccount'][_0xfeb4('0x1c')]({'raw':_0x29fbbf[_0xfeb4('0x1d')]?_0x29fbbf[_0xfeb4('0x1d')][_0xfeb4('0x1e')]===undefined?!![]:![]:!![],'where':_0x29fbbf[_0xfeb4('0x1d')]?_0x29fbbf[_0xfeb4('0x1d')]['where']||null:null,'attributes':_0x29fbbf[_0xfeb4('0x1d')]?_0x29fbbf[_0xfeb4('0x1d')][_0xfeb4('0x1f')]||null:null,'limit':_0x29fbbf['options']?_0x29fbbf['options'][_0xfeb4('0x20')]||null:null,'include':_0x29fbbf[_0xfeb4('0x1d')]?_0x29fbbf[_0xfeb4('0x1d')][_0xfeb4('0x21')]?_[_0xfeb4('0x22')](_0x29fbbf[_0xfeb4('0x1d')]['include'],function(_0x49de2e){return{'model':db[_0x49de2e[_0xfeb4('0x23')]],'as':_0x49de2e['as'],'attributes':_0x49de2e[_0xfeb4('0x1f')],'include':_0x49de2e[_0xfeb4('0x21')]?_['map'](_0x49de2e[_0xfeb4('0x21')],function(_0x187163){return{'model':db[_0x187163[_0xfeb4('0x23')]],'as':_0x187163['as'],'attributes':_0x187163[_0xfeb4('0x1f')],'include':_0x187163[_0xfeb4('0x21')]?_[_0xfeb4('0x22')](_0x187163[_0xfeb4('0x21')],function(_0x1704c3){return{'model':db[_0x1704c3['model']],'as':_0x1704c3['as'],'attributes':_0x1704c3[_0xfeb4('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb88c7e){logger['info'](_0xfeb4('0x1b'),_0x29fbbf);logger['debug'](_0xfeb4('0x1b'),_0x29fbbf,JSON[_0xfeb4('0x15')](_0xb88c7e));_0x1e62d4(_0xb88c7e);})[_0xfeb4('0x1a')](function(_0x12d14b){logger[_0xfeb4('0x16')]('GetMailAccount',_0x12d14b['message'],_0x29fbbf);_0x143b30(_0x2f246b[_0xfeb4('0x16')](0x1f4,_0x12d14b[_0xfeb4('0x19')]));});});};exports[_0xfeb4('0x24')]=function(_0x285487){var _0x544a89=this;return new Promise(function(_0x595a8e,_0x4e19bd){return db[_0xfeb4('0x25')][_0xfeb4('0x26')]({'raw':_0x285487[_0xfeb4('0x1d')]?_0x285487[_0xfeb4('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x285487[_0xfeb4('0x1d')]?_0x285487[_0xfeb4('0x1d')]['where']||null:null,'attributes':_0x285487[_0xfeb4('0x1d')]?_0x285487[_0xfeb4('0x1d')]['attributes']||null:null,'include':_0x285487['options']?_0x285487[_0xfeb4('0x1d')][_0xfeb4('0x21')]?_[_0xfeb4('0x22')](_0x285487['options'][_0xfeb4('0x21')],function(_0x58c78f){return{'model':db[_0x58c78f[_0xfeb4('0x23')]],'as':_0x58c78f['as'],'attributes':_0x58c78f['attributes'],'include':_0x58c78f[_0xfeb4('0x21')]?_['map'](_0x58c78f[_0xfeb4('0x21')],function(_0x3ab278){return{'model':db[_0x3ab278[_0xfeb4('0x23')]],'as':_0x3ab278['as'],'attributes':_0x3ab278[_0xfeb4('0x1f')],'include':_0x3ab278[_0xfeb4('0x21')]?_[_0xfeb4('0x22')](_0x3ab278['include'],function(_0x155b61){return{'model':db[_0x155b61[_0xfeb4('0x23')]],'as':_0x155b61['as'],'attributes':_0x155b61['attributes']};}):[]};}):[]};}):[]:[]})[_0xfeb4('0x11')](function(_0x1f8bdc){logger[_0xfeb4('0x12')](_0xfeb4('0x24'),_0x285487);logger[_0xfeb4('0x27')](_0xfeb4('0x24'),_0x285487,JSON[_0xfeb4('0x15')](_0x1f8bdc));_0x595a8e(_0x1f8bdc);})[_0xfeb4('0x1a')](function(_0x1dd51b){logger[_0xfeb4('0x16')]('ShowMailAccount',_0x1dd51b[_0xfeb4('0x19')],_0x285487);_0x4e19bd(_0x544a89['error'](0x1f4,_0x1dd51b[_0xfeb4('0x19')]));});});};exports[_0xfeb4('0x28')]=function(_0x3e9c69){var _0x418bac=this;return new Promise(function(_0x3d7507,_0x7ebda6){var _0x4a005b={'body':_0x3e9c69[_0xfeb4('0x29')],'channel':'mail'};var _0x1c661c=_[_0xfeb4('0x2a')](_[_0xfeb4('0x2b')](db[_0xfeb4('0x2c')][_0xfeb4('0x2d')]),['createdAt',_0xfeb4('0x2e'),_0xfeb4('0x2f'),_0xfeb4('0x30')]);var _0x121e54=![];if(_0x3e9c69[_0xfeb4('0x29')]['id']){delete _0x3e9c69[_0xfeb4('0x29')]['id'];}if(_[_0xfeb4('0x31')](_0x3e9c69['body'][_0xfeb4('0x32')])){return _0x7ebda6(_0x418bac[_0xfeb4('0x16')](0x1f4,_0xfeb4('0x33')));}if(_[_0xfeb4('0x31')](_0x3e9c69['body']['body'])||_0x3e9c69[_0xfeb4('0x29')]['body']===''){return _0x7ebda6(_0x418bac[_0xfeb4('0x16')](0x1f4,_0xfeb4('0x34')));}if(_[_0xfeb4('0x31')](_0x3e9c69['body'][_0xfeb4('0x35')])){return _0x7ebda6(_0x418bac[_0xfeb4('0x16')](0x1f4,_0xfeb4('0x36')+_0x1c661c));}if(!_['includes'](_0x1c661c,_0x3e9c69[_0xfeb4('0x29')]['mapKey'])){return _0x7ebda6(_0x418bac[_0xfeb4('0x16')](0x1f4,_0xfeb4('0x37')+_0x1c661c));}var _0x32b93b={};_0x32b93b[_0x3e9c69[_0xfeb4('0x29')][_0xfeb4('0x35')]]=_0x3e9c69[_0xfeb4('0x29')][_0xfeb4('0x32')];return db[_0xfeb4('0x25')][_0xfeb4('0x26')]({'where':{'id':_0x3e9c69[_0xfeb4('0x38')]['id']},'include':[{'model':db[_0xfeb4('0x39')],'as':'List','include':[{'model':db[_0xfeb4('0x2c')],'as':_0xfeb4('0x3a'),'where':_0x32b93b,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xfeb4('0x3b')],'as':'Applications'},{'model':db[_0xfeb4('0x3c')],'as':_0xfeb4('0x3d')}]})[_0xfeb4('0x11')](function(_0x5ace4d){if(_0x5ace4d&&_0x5ace4d[_0xfeb4('0x3e')]){var _0x40d936=_0x5ace4d[_0xfeb4('0x3f')]({'plain':!![]});_0x4a005b[_0xfeb4('0x38')]=_[_0xfeb4('0x40')](_0x40d936,[_0xfeb4('0x41'),_0xfeb4('0x3e')]);_0x4a005b[_0xfeb4('0x42')]=_0x40d936[_0xfeb4('0x41')];_0x4a005b[_0xfeb4('0x43')]=_0x40d936[_0xfeb4('0x3e')];_0x4a005b[_0xfeb4('0x42')]=_['orderBy'](_0x4a005b[_0xfeb4('0x42')],[_0xfeb4('0x44')],[_0xfeb4('0x45')]);if(_0x4a005b[_0xfeb4('0x38')]&&_0x4a005b[_0xfeb4('0x38')][_0xfeb4('0x46')]){_0x4a005b['applications'][_0xfeb4('0x47')]({'id':0x0,'priority':_0x4a005b['applications'][_0xfeb4('0x48')]+0x1,'app':_0xfeb4('0x49'),'appdata':_0xfeb4('0x46'),'interval':'*,*,*,*'});}if(_0x4a005b[_0xfeb4('0x38')]['Applications']){delete _0x4a005b[_0xfeb4('0x38')][_0xfeb4('0x41')];}if(_0x4a005b[_0xfeb4('0x38')][_0xfeb4('0x3e')]){delete _0x4a005b['account'][_0xfeb4('0x3e')];}if(_0x40d936[_0xfeb4('0x3e')][_0xfeb4('0x3a')][_0xfeb4('0x48')]){return _0x40d936[_0xfeb4('0x3e')]['Contacts'][0x0];}var _0x28dec8=_[_0xfeb4('0xd')](_0x3e9c69['body'],{'firstName':_0x3e9c69[_0xfeb4('0x29')][_0xfeb4('0x32')],'ListId':_0x40d936['ListId']});_0x28dec8[_0x3e9c69['body'][_0xfeb4('0x35')]]=_0x3e9c69['body'][_0xfeb4('0x32')];return db['CmContact'][_0xfeb4('0x4a')](_0x28dec8);}else{throw new Error(_0xfeb4('0x4b'));}})[_0xfeb4('0x11')](function(_0x2cc7c7){_0x4a005b['contact']=_0x2cc7c7;if(_0x2cc7c7){if(!_0x3e9c69[_0xfeb4('0x29')][_0xfeb4('0x19')][_0xfeb4('0x4c')]){_0x3e9c69[_0xfeb4('0x29')][_0xfeb4('0x19')]['messageId']=rs[_0xfeb4('0x4d')]()+'\x20'+_0x3e9c69[_0xfeb4('0x29')][_0xfeb4('0x19')]['from'];}var _0x47d234={'ContactId':_0x2cc7c7['id'],'MailAccountId':_0x3e9c69['account']['id'],'inReplyTo':_0x3e9c69[_0xfeb4('0x29')]['message'][_0xfeb4('0x4c')],'to':_0x3e9c69[_0xfeb4('0x29')][_0xfeb4('0x19')]['from'],'cc':_0x3e9c69[_0xfeb4('0x29')][_0xfeb4('0x19')]['cc'],'subject':_0x3e9c69['body'][_0xfeb4('0x19')][_0xfeb4('0x4e')],'attach':_0x3e9c69[_0xfeb4('0x29')][_0xfeb4('0x19')][_0xfeb4('0x4f')],'lastMsgAt':moment()[_0xfeb4('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x3e9c69['body'][_0xfeb4('0x29')]};return db[_0xfeb4('0x51')]['find']({'where':{'closed':![],'MailAccountId':_0x3e9c69[_0xfeb4('0x38')]['id']},'include':[{'model':db[_0xfeb4('0x52')],'as':'Messages','attributes':[_0xfeb4('0x4c')],'where':{'messageId':_0x3e9c69[_0xfeb4('0x29')][_0xfeb4('0x19')][_0xfeb4('0x53')]}}]})[_0xfeb4('0x11')](function(_0x29fb65){if(_0x29fb65){return[_0x29fb65,![]];}return db[_0xfeb4('0x51')][_0xfeb4('0x4a')](_0x47d234)[_0xfeb4('0x11')](function(_0x3f11c6){return[_0x3f11c6,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xfeb4('0x54')](function(_0x4a9731,_0xad34c0){if(_0x4a9731){_0x121e54=_0xad34c0;if(!_0xad34c0){return _0x4a9731[_0xfeb4('0x55')]({'inReplyTo':_0x3e9c69['body'][_0xfeb4('0x19')][_0xfeb4('0x4c')],'to':_0x3e9c69[_0xfeb4('0x29')][_0xfeb4('0x19')][_0xfeb4('0x32')],'cc':_0x3e9c69[_0xfeb4('0x29')][_0xfeb4('0x19')]['cc'],'subject':_0x3e9c69[_0xfeb4('0x29')][_0xfeb4('0x19')]['subject'],'attach':_0x4a9731[_0xfeb4('0x4f')]?_0x4a9731[_0xfeb4('0x4f')]:_0x3e9c69[_0xfeb4('0x29')][_0xfeb4('0x19')][_0xfeb4('0x4f')],'substatus':null,'substatusAt':moment()[_0xfeb4('0x50')](_0xfeb4('0x56')),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x3e9c69[_0xfeb4('0x29')][_0xfeb4('0x29')]});}else{return _0x4a9731;}}})['then'](function(_0xbbab25){_0x4a005b[_0xfeb4('0x57')]=_0xbbab25[_0xfeb4('0x3f')]({'plain':!![]});_0x4a005b['interaction'][_0xfeb4('0x58')]=_0x121e54;return db[_0xfeb4('0x52')]['create']({'body':_0x3e9c69[_0xfeb4('0x29')][_0xfeb4('0x29')],'MailAccountId':_0x3e9c69[_0xfeb4('0x38')]['id'],'MailInteractionId':_0xbbab25['id'],'direction':'in','ContactId':_0x4a005b[_0xfeb4('0x59')]['id'],'messageId':_0x3e9c69['body']['message'][_0xfeb4('0x4c')],'from':_0x3e9c69[_0xfeb4('0x29')][_0xfeb4('0x19')][_0xfeb4('0x32')],'to':_0x3e9c69['body'][_0xfeb4('0x19')]['to'],'cc':_0x3e9c69[_0xfeb4('0x29')][_0xfeb4('0x19')]['cc'],'subject':_0x3e9c69[_0xfeb4('0x29')][_0xfeb4('0x19')]['subject'],'attach':_0x3e9c69['body'][_0xfeb4('0x19')][_0xfeb4('0x4f')],'Attachments':_0x3e9c69[_0xfeb4('0x29')]['message']['attachments'],'originTo':_0x3e9c69[_0xfeb4('0x29')]['message'][_0xfeb4('0x5a')],'originCc':_0x3e9c69['body']['message'][_0xfeb4('0x5b')],'bcc':_0x3e9c69[_0xfeb4('0x29')]['message'][_0xfeb4('0x5c')]},{'include':[{'model':db[_0xfeb4('0x5d')],'as':_0xfeb4('0x5e')}]});})[_0xfeb4('0x11')](function(_0x358f48){_0x4a005b[_0xfeb4('0x19')]=_0x358f48;if(_0x4a005b[_0xfeb4('0x57')][_0xfeb4('0x5f')]){return db[_0xfeb4('0x60')]['find']({'attributes':['id',_0xfeb4('0x61')],'where':{'id':_0x4a005b['interaction']['UserId']}})[_0xfeb4('0x11')](function(_0x3ccd13){if(_0x3ccd13){_0x4a005b[_0xfeb4('0x42')][_0xfeb4('0x62')]({'id':0x0,'priority':0x0,'app':_0xfeb4('0x63'),'appdata':_0x3ccd13[_0xfeb4('0x61')]+','+(_0x4a005b[_0xfeb4('0x38')][_0xfeb4('0x64')]||0xa),'interval':_0xfeb4('0x65')});}return respondWithRpcPromise(_0xfeb4('0x66'),_0xfeb4('0x67'),_0x4a005b);});}return respondWithRpcPromise(_0xfeb4('0x66'),_0xfeb4('0x67'),_0x4a005b);})[_0xfeb4('0x11')](function(_0x5b4b4e){_0x3d7507(_0x5b4b4e);})['catch'](function(_0x6d8a33){_0x7ebda6(_0x418bac['error'](0x1f4,_0x6d8a33[_0xfeb4('0x19')]));});});}; \ No newline at end of file +var _0x3c7e=['includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','Contacts','updatedAt','DESC','List','get','omit','Applications','applications','orderBy','priority','asc','account','autoclose','push','length','*,*,*,*','create','List\x20not\x20found','contact','generate','messageId','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','spread','update','subject','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originCc','bcc','Attachment','User','name','unshift','waitForTheAssignedAgent','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailAccount.socket','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','MailAccount','options','raw','where','limit','map','include','attributes','model','GetMailAccount','find','ShowMailAccount','catch','NotifyMailAccount','body','mail','difference','rawAttributes','CompanyId','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'];(function(_0x25baa8,_0x1b3b65){var _0x2d8309=function(_0x1623fc){while(--_0x1623fc){_0x25baa8['push'](_0x25baa8['shift']());}};_0x2d8309(++_0x1b3b65);}(_0x3c7e,0xf6));var _0xe3c7=function(_0xf2f332,_0x299fbf){_0xf2f332=_0xf2f332-0x0;var _0x56cce3=_0x3c7e[_0xf2f332];return _0x56cce3;};'use strict';var _=require(_0xe3c7('0x0'));var util=require(_0xe3c7('0x1'));var moment=require(_0xe3c7('0x2'));var BPromise=require('bluebird');var rs=require(_0xe3c7('0x3'));var fs=require('fs');var Redis=require(_0xe3c7('0x4'));var db=require(_0xe3c7('0x5'))['db'];var utils=require(_0xe3c7('0x6'));var logger=require(_0xe3c7('0x7'))(_0xe3c7('0x8'));var config=require(_0xe3c7('0x9'));var jayson=require(_0xe3c7('0xa'));var client=jayson[_0xe3c7('0xb')][_0xe3c7('0xc')]({'port':0x232c});config[_0xe3c7('0xd')]=_[_0xe3c7('0xe')](config[_0xe3c7('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xe3c7('0xf'))(new Redis(config[_0xe3c7('0xd')]));require(_0xe3c7('0x10'))['register'](socket);function respondWithRpcPromise(_0x560060,_0x465ad5,_0x518e51){return new BPromise(function(_0x11e5d1,_0xb4bde6){return client[_0xe3c7('0x11')](_0x560060,_0x518e51)[_0xe3c7('0x12')](function(_0x51d4dd){logger[_0xe3c7('0x13')](_0xe3c7('0x14'),_0x465ad5,'request\x20sent');logger[_0xe3c7('0x15')](_0xe3c7('0x16'),_0x465ad5,'request\x20sent',JSON[_0xe3c7('0x17')](_0x51d4dd));if(_0x51d4dd['error']){if(_0x51d4dd[_0xe3c7('0x18')][_0xe3c7('0x19')]===0x1f4){logger[_0xe3c7('0x18')](_0xe3c7('0x14'),_0x465ad5,_0x51d4dd[_0xe3c7('0x18')][_0xe3c7('0x1a')]);return _0xb4bde6(_0x51d4dd[_0xe3c7('0x18')][_0xe3c7('0x1a')]);}logger[_0xe3c7('0x18')]('MailAccount,\x20%s,\x20%s',_0x465ad5,_0x51d4dd[_0xe3c7('0x18')]['message']);return _0x11e5d1(_0x51d4dd[_0xe3c7('0x18')]['message']);}else{logger['info'](_0xe3c7('0x14'),_0x465ad5,_0xe3c7('0x1b'));_0x11e5d1(_0x51d4dd[_0xe3c7('0x1c')]['message']);}})['catch'](function(_0x3f2b24){logger[_0xe3c7('0x18')](_0xe3c7('0x14'),_0x465ad5,_0x3f2b24);_0xb4bde6(_0x3f2b24);});});}exports['GetMailAccount']=function(_0x2e63a4){var _0x1499de=this;return new Promise(function(_0x433282,_0x4444af){return db[_0xe3c7('0x1d')]['findAll']({'raw':_0x2e63a4['options']?_0x2e63a4[_0xe3c7('0x1e')][_0xe3c7('0x1f')]===undefined?!![]:![]:!![],'where':_0x2e63a4[_0xe3c7('0x1e')]?_0x2e63a4['options'][_0xe3c7('0x20')]||null:null,'attributes':_0x2e63a4[_0xe3c7('0x1e')]?_0x2e63a4['options']['attributes']||null:null,'limit':_0x2e63a4[_0xe3c7('0x1e')]?_0x2e63a4[_0xe3c7('0x1e')][_0xe3c7('0x21')]||null:null,'include':_0x2e63a4[_0xe3c7('0x1e')]?_0x2e63a4['options']['include']?_[_0xe3c7('0x22')](_0x2e63a4['options'][_0xe3c7('0x23')],function(_0x56bb78){return{'model':db[_0x56bb78['model']],'as':_0x56bb78['as'],'attributes':_0x56bb78[_0xe3c7('0x24')],'include':_0x56bb78[_0xe3c7('0x23')]?_[_0xe3c7('0x22')](_0x56bb78[_0xe3c7('0x23')],function(_0x4b5293){return{'model':db[_0x4b5293[_0xe3c7('0x25')]],'as':_0x4b5293['as'],'attributes':_0x4b5293[_0xe3c7('0x24')],'include':_0x4b5293[_0xe3c7('0x23')]?_[_0xe3c7('0x22')](_0x4b5293['include'],function(_0x3dea4f){return{'model':db[_0x3dea4f['model']],'as':_0x3dea4f['as'],'attributes':_0x3dea4f['attributes']};}):[]};}):[]};}):[]:[]})[_0xe3c7('0x12')](function(_0x55f19a){logger[_0xe3c7('0x13')](_0xe3c7('0x26'),_0x2e63a4);logger[_0xe3c7('0x15')](_0xe3c7('0x26'),_0x2e63a4,JSON[_0xe3c7('0x17')](_0x55f19a));_0x433282(_0x55f19a);})['catch'](function(_0x57d35e){logger[_0xe3c7('0x18')](_0xe3c7('0x26'),_0x57d35e[_0xe3c7('0x1a')],_0x2e63a4);_0x4444af(_0x1499de[_0xe3c7('0x18')](0x1f4,_0x57d35e['message']));});});};exports['ShowMailAccount']=function(_0x56aada){var _0x52ebbb=this;return new Promise(function(_0x40872f,_0x1521bf){return db[_0xe3c7('0x1d')][_0xe3c7('0x27')]({'raw':_0x56aada[_0xe3c7('0x1e')]?_0x56aada[_0xe3c7('0x1e')][_0xe3c7('0x1f')]===undefined?!![]:![]:!![],'where':_0x56aada[_0xe3c7('0x1e')]?_0x56aada['options'][_0xe3c7('0x20')]||null:null,'attributes':_0x56aada[_0xe3c7('0x1e')]?_0x56aada[_0xe3c7('0x1e')][_0xe3c7('0x24')]||null:null,'include':_0x56aada[_0xe3c7('0x1e')]?_0x56aada[_0xe3c7('0x1e')]['include']?_[_0xe3c7('0x22')](_0x56aada[_0xe3c7('0x1e')]['include'],function(_0x11cfa7){return{'model':db[_0x11cfa7[_0xe3c7('0x25')]],'as':_0x11cfa7['as'],'attributes':_0x11cfa7[_0xe3c7('0x24')],'include':_0x11cfa7[_0xe3c7('0x23')]?_[_0xe3c7('0x22')](_0x11cfa7[_0xe3c7('0x23')],function(_0x460edf){return{'model':db[_0x460edf['model']],'as':_0x460edf['as'],'attributes':_0x460edf[_0xe3c7('0x24')],'include':_0x460edf[_0xe3c7('0x23')]?_['map'](_0x460edf[_0xe3c7('0x23')],function(_0x550665){return{'model':db[_0x550665['model']],'as':_0x550665['as'],'attributes':_0x550665[_0xe3c7('0x24')]};}):[]};}):[]};}):[]:[]})[_0xe3c7('0x12')](function(_0x54e9ba){logger['info'](_0xe3c7('0x28'),_0x56aada);logger['debug'](_0xe3c7('0x28'),_0x56aada,JSON[_0xe3c7('0x17')](_0x54e9ba));_0x40872f(_0x54e9ba);})[_0xe3c7('0x29')](function(_0x4f7388){logger[_0xe3c7('0x18')]('ShowMailAccount',_0x4f7388[_0xe3c7('0x1a')],_0x56aada);_0x1521bf(_0x52ebbb[_0xe3c7('0x18')](0x1f4,_0x4f7388['message']));});});};exports[_0xe3c7('0x2a')]=function(_0x2295c0){var _0x48b35d=this;return new Promise(function(_0x57baf8,_0x315a67){var _0x4849e7={'body':_0x2295c0[_0xe3c7('0x2b')],'channel':_0xe3c7('0x2c')};var _0x38a908=_[_0xe3c7('0x2d')](_['keys'](db['CmContact'][_0xe3c7('0x2e')]),['createdAt','updatedAt',_0xe3c7('0x2f'),_0xe3c7('0x30')]);var _0x3012b2=![];if(_0x2295c0[_0xe3c7('0x2b')]['id']){delete _0x2295c0[_0xe3c7('0x2b')]['id'];}if(_['isNil'](_0x2295c0[_0xe3c7('0x2b')]['from'])){return _0x315a67(_0x48b35d['error'](0x1f4,_0xe3c7('0x31')));}if(_['isNil'](_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x2b')])||_0x2295c0['body']['body']===''){return _0x315a67(_0x48b35d['error'](0x1f4,_0xe3c7('0x32')));}if(_[_0xe3c7('0x33')](_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x34')])){return _0x315a67(_0x48b35d[_0xe3c7('0x18')](0x1f4,_0xe3c7('0x35')+_0x38a908));}if(!_[_0xe3c7('0x36')](_0x38a908,_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x34')])){return _0x315a67(_0x48b35d[_0xe3c7('0x18')](0x1f4,_0xe3c7('0x37')+_0x38a908));}var _0x1ff52b={};_0x1ff52b[_0x2295c0['body'][_0xe3c7('0x34')]]=_0x2295c0['body'][_0xe3c7('0x38')];return db['MailAccount'][_0xe3c7('0x27')]({'where':{'id':_0x2295c0['account']['id']},'include':[{'model':db[_0xe3c7('0x39')],'as':'List','include':[{'model':db['CmContact'],'as':_0xe3c7('0x3a'),'where':_0x1ff52b,'limit':0x1,'order':[[_0xe3c7('0x3b'),_0xe3c7('0x3c')]]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db['MailServerOut'],'as':'Smtp'}]})['then'](function(_0x2544fe){if(_0x2544fe&&_0x2544fe[_0xe3c7('0x3d')]){var _0x536a5d=_0x2544fe[_0xe3c7('0x3e')]({'plain':!![]});_0x4849e7['account']=_[_0xe3c7('0x3f')](_0x536a5d,[_0xe3c7('0x40'),'List']);_0x4849e7['applications']=_0x536a5d[_0xe3c7('0x40')];_0x4849e7['list']=_0x536a5d[_0xe3c7('0x3d')];_0x4849e7[_0xe3c7('0x41')]=_[_0xe3c7('0x42')](_0x4849e7[_0xe3c7('0x41')],[_0xe3c7('0x43')],[_0xe3c7('0x44')]);if(_0x4849e7[_0xe3c7('0x45')]&&_0x4849e7['account'][_0xe3c7('0x46')]){_0x4849e7['applications'][_0xe3c7('0x47')]({'id':0x0,'priority':_0x4849e7[_0xe3c7('0x41')][_0xe3c7('0x48')]+0x1,'app':'close','appdata':'autoclose','interval':_0xe3c7('0x49')});}if(_0x4849e7['account'][_0xe3c7('0x40')]){delete _0x4849e7[_0xe3c7('0x45')][_0xe3c7('0x40')];}if(_0x4849e7[_0xe3c7('0x45')][_0xe3c7('0x3d')]){delete _0x4849e7['account'][_0xe3c7('0x3d')];}if(_0x536a5d[_0xe3c7('0x3d')]['Contacts'][_0xe3c7('0x48')]){return _0x536a5d[_0xe3c7('0x3d')]['Contacts'][0x0];}var _0x21fb04=_['defaults'](_0x2295c0['body'],{'firstName':_0x2295c0[_0xe3c7('0x2b')]['from'],'ListId':_0x536a5d['ListId']});_0x21fb04[_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x34')]]=_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x38')];return db['CmContact'][_0xe3c7('0x4a')](_0x21fb04);}else{throw new Error(_0xe3c7('0x4b'));}})[_0xe3c7('0x12')](function(_0xc19b90){_0x4849e7[_0xe3c7('0x4c')]=_0xc19b90;if(_0xc19b90){if(!_0x2295c0[_0xe3c7('0x2b')]['message']['messageId']){_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x1a')]['messageId']=rs[_0xe3c7('0x4d')]()+'\x20'+_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x1a')][_0xe3c7('0x38')];}var _0x425e8b={'ContactId':_0xc19b90['id'],'MailAccountId':_0x2295c0[_0xe3c7('0x45')]['id'],'inReplyTo':_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x1a')][_0xe3c7('0x4e')],'to':_0x2295c0['body']['message']['from'],'cc':_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x1a')]['cc'],'subject':_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x1a')]['subject'],'attach':_0x2295c0[_0xe3c7('0x2b')]['message'][_0xe3c7('0x4f')],'lastMsgAt':moment()[_0xe3c7('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x2295c0[_0xe3c7('0x2b')]['body']};return db[_0xe3c7('0x51')][_0xe3c7('0x27')]({'where':{'closed':![],'MailAccountId':_0x2295c0['account']['id']},'include':[{'model':db[_0xe3c7('0x52')],'as':_0xe3c7('0x53'),'attributes':[_0xe3c7('0x4e')],'where':{'messageId':_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x1a')][_0xe3c7('0x54')]}}]})[_0xe3c7('0x12')](function(_0x2e4bb4){if(_0x2e4bb4){return[_0x2e4bb4,![]];}return db[_0xe3c7('0x51')][_0xe3c7('0x4a')](_0x425e8b)[_0xe3c7('0x12')](function(_0x36faf3){return[_0x36faf3,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xe3c7('0x55')](function(_0x41f502,_0x84ffa3){if(_0x41f502){_0x3012b2=_0x84ffa3;if(!_0x84ffa3){return _0x41f502[_0xe3c7('0x56')]({'inReplyTo':_0x2295c0['body'][_0xe3c7('0x1a')][_0xe3c7('0x4e')],'to':_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x1a')][_0xe3c7('0x38')],'cc':_0x2295c0[_0xe3c7('0x2b')]['message']['cc'],'subject':_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x1a')][_0xe3c7('0x57')],'attach':_0x41f502[_0xe3c7('0x4f')]?_0x41f502['attach']:_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x1a')][_0xe3c7('0x4f')],'substatus':null,'substatusAt':moment()['format'](_0xe3c7('0x58')),'lastMsgAt':moment()[_0xe3c7('0x50')](_0xe3c7('0x58')),'lastMsgDirection':'in','lastMsgBody':_0x2295c0['body'][_0xe3c7('0x2b')]});}else{return _0x41f502;}}})[_0xe3c7('0x12')](function(_0x5e6bb1){_0x4849e7[_0xe3c7('0x59')]=_0x5e6bb1[_0xe3c7('0x3e')]({'plain':!![]});_0x4849e7[_0xe3c7('0x59')][_0xe3c7('0x5a')]=_0x3012b2;return db[_0xe3c7('0x52')][_0xe3c7('0x4a')]({'body':_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x2b')],'MailAccountId':_0x2295c0[_0xe3c7('0x45')]['id'],'MailInteractionId':_0x5e6bb1['id'],'direction':'in','ContactId':_0x4849e7[_0xe3c7('0x4c')]['id'],'messageId':_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x1a')]['messageId'],'from':_0x2295c0['body'][_0xe3c7('0x1a')]['from'],'to':_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x1a')]['to'],'cc':_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x1a')]['cc'],'subject':_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x1a')][_0xe3c7('0x57')],'attach':_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x1a')][_0xe3c7('0x4f')],'Attachments':_0x2295c0['body']['message'][_0xe3c7('0x5b')],'originTo':_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x1a')]['originTo'],'originCc':_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x1a')][_0xe3c7('0x5c')],'bcc':_0x2295c0[_0xe3c7('0x2b')][_0xe3c7('0x1a')][_0xe3c7('0x5d')]},{'include':[{'model':db[_0xe3c7('0x5e')],'as':'Attachments'}]});})[_0xe3c7('0x12')](function(_0x5b6df0){_0x4849e7[_0xe3c7('0x1a')]=_0x5b6df0;if(_0x4849e7[_0xe3c7('0x59')]['UserId']){return db[_0xe3c7('0x5f')][_0xe3c7('0x27')]({'attributes':['id',_0xe3c7('0x60')],'where':{'id':_0x4849e7[_0xe3c7('0x59')]['UserId']}})[_0xe3c7('0x12')](function(_0x1fd050){if(_0x1fd050){_0x4849e7[_0xe3c7('0x41')][_0xe3c7('0x61')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1fd050[_0xe3c7('0x60')]+','+(_0x4849e7['account'][_0xe3c7('0x62')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xe3c7('0x63'),_0x4849e7);});}return respondWithRpcPromise('Start','startRouting',_0x4849e7);})[_0xe3c7('0x12')](function(_0x5ee30c){_0x57baf8(_0x5ee30c);})['catch'](function(_0xf160ac){_0x315a67(_0x48b35d['error'](0x1f4,_0xf160ac[_0xe3c7('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index bf2d5c3..5055b66 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 _0xb14e=['mailAccount:','./mailAccount.events','save','remove','update','emit','register','length'];(function(_0x4ee6e0,_0xdcdc3a){var _0x56948a=function(_0xf90e47){while(--_0xf90e47){_0x4ee6e0['push'](_0x4ee6e0['shift']());}};_0x56948a(++_0xdcdc3a);}(_0xb14e,0x191));var _0xeb14=function(_0x173ef3,_0x5a139b){_0x173ef3=_0x173ef3-0x0;var _0x217ae1=_0xb14e[_0x173ef3];return _0x217ae1;};'use strict';var MailAccountEvents=require(_0xeb14('0x0'));var events=[_0xeb14('0x1'),_0xeb14('0x2'),_0xeb14('0x3')];function createListener(_0x5ae246,_0x15afb1){return function(_0x40bb5c){_0x15afb1[_0xeb14('0x4')](_0x5ae246,_0x40bb5c);};}function removeListener(_0x22c333,_0x2d2683){return function(){MailAccountEvents['removeListener'](_0x22c333,_0x2d2683);};}exports[_0xeb14('0x5')]=function(_0xee890a){for(var _0x54fa3a=0x0,_0x46098f=events[_0xeb14('0x6')];_0x54fa3a<_0x46098f;_0x54fa3a++){var _0x1d41d9=events[_0x54fa3a];var _0x47696b=createListener(_0xeb14('0x7')+_0x1d41d9,_0xee890a);MailAccountEvents['on'](_0x1d41d9,_0x47696b);}}; \ No newline at end of file +var _0x604d=['register','length','mailAccount:','save','remove','update','removeListener'];(function(_0x3ff332,_0x145564){var _0x5a2264=function(_0x36e730){while(--_0x36e730){_0x3ff332['push'](_0x3ff332['shift']());}};_0x5a2264(++_0x145564);}(_0x604d,0x1f4));var _0xd604=function(_0x2b3324,_0x3ebd49){_0x2b3324=_0x2b3324-0x0;var _0x58710c=_0x604d[_0x2b3324];return _0x58710c;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xd604('0x0'),_0xd604('0x1'),_0xd604('0x2')];function createListener(_0x1adb08,_0x3cb6e3){return function(_0x132fb9){_0x3cb6e3['emit'](_0x1adb08,_0x132fb9);};}function removeListener(_0x3108b8,_0x1d03aa){return function(){MailAccountEvents[_0xd604('0x3')](_0x3108b8,_0x1d03aa);};}exports[_0xd604('0x4')]=function(_0x44e310){for(var _0x336c3a=0x0,_0x67cc34=events[_0xd604('0x5')];_0x336c3a<_0x67cc34;_0x336c3a++){var _0xd9316f=events[_0x336c3a];var _0x1495af=createListener(_0xd604('0x6')+_0xd9316f,_0x44e310);MailAccountEvents['on'](_0xd9316f,_0x1495af);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index e56fb1b..d3550af 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 _0x6a24=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','isAuthenticated','show','update','/:id','destroy','multer'];(function(_0x2815e2,_0x3fb49b){var _0x530eda=function(_0x354c1b){while(--_0x354c1b){_0x2815e2['push'](_0x2815e2['shift']());}};_0x530eda(++_0x3fb49b);}(_0x6a24,0xd1));var _0x46a2=function(_0x36a42c,_0x2ca71b){_0x36a42c=_0x36a42c-0x0;var _0x2752f7=_0x6a24[_0x36a42c];return _0x2752f7;};'use strict';var multer=require(_0x46a2('0x0'));var util=require(_0x46a2('0x1'));var path=require('path');var timeout=require(_0x46a2('0x2'));var express=require(_0x46a2('0x3'));var router=express[_0x46a2('0x4')]();var auth=require(_0x46a2('0x5'));var interaction=require(_0x46a2('0x6'));var config=require('../../config/environment');var controller=require(_0x46a2('0x7'));router[_0x46a2('0x8')]('/:id',auth[_0x46a2('0x9')](),controller[_0x46a2('0xa')]);router['put']('/:id',auth[_0x46a2('0x9')](),controller[_0x46a2('0xb')]);router['delete'](_0x46a2('0xc'),auth['isAuthenticated'](),controller[_0x46a2('0xd')]);module['exports']=router; \ No newline at end of file +var _0xb717=['delete','destroy','multer','path','express','Router','../../components/auth/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','put','update'];(function(_0x49acf0,_0x4263f9){var _0x20c210=function(_0xf134bc){while(--_0xf134bc){_0x49acf0['push'](_0x49acf0['shift']());}};_0x20c210(++_0x4263f9);}(_0xb717,0x1b4));var _0x7b71=function(_0x1e28ef,_0x359f1b){_0x1e28ef=_0x1e28ef-0x0;var _0x2a197a=_0xb717[_0x1e28ef];return _0x2a197a;};'use strict';var multer=require(_0x7b71('0x0'));var util=require('util');var path=require(_0x7b71('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b71('0x2'));var router=express[_0x7b71('0x3')]();var auth=require(_0x7b71('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7b71('0x5'));var controller=require(_0x7b71('0x6'));router[_0x7b71('0x7')](_0x7b71('0x8'),auth[_0x7b71('0x9')](),controller['show']);router[_0x7b71('0xa')](_0x7b71('0x8'),auth[_0x7b71('0x9')](),controller[_0x7b71('0xb')]);router[_0x7b71('0xc')]('/:id',auth[_0x7b71('0x9')](),controller[_0x7b71('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 0f5d798..bfe0398 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 _0x1aab=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x48bb7f,_0x248996){var _0x2cc494=function(_0x566a0d){while(--_0x566a0d){_0x48bb7f['push'](_0x48bb7f['shift']());}};_0x2cc494(++_0x248996);}(_0x1aab,0x122));var _0xb1aa=function(_0x4bf1ba,_0x11a219){_0x4bf1ba=_0x4bf1ba-0x0;var _0x41c698=_0x1aab[_0x4bf1ba];return _0x41c698;};'use strict';var Sequelize=require(_0xb1aa('0x0'));module[_0xb1aa('0x1')]={'priority':{'type':Sequelize[_0xb1aa('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb1aa('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xb1aa('0x4')]},'interval':{'type':Sequelize[_0xb1aa('0x4')],'defaultValue':_0xb1aa('0x5')}}; \ No newline at end of file +var _0x9f37=['*,*,*,*','sequelize','exports','STRING'];(function(_0x1f32cc,_0x253fd4){var _0x1da18d=function(_0x2ff9cc){while(--_0x2ff9cc){_0x1f32cc['push'](_0x1f32cc['shift']());}};_0x1da18d(++_0x253fd4);}(_0x9f37,0xd1));var _0x79f3=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x9f37[_0x5d4607];return _0x5e4a86;};'use strict';var Sequelize=require(_0x79f3('0x0'));module[_0x79f3('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x79f3('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x79f3('0x2')]},'interval':{'type':Sequelize[_0x79f3('0x2')],'defaultValue':_0x79f3('0x3')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 2384585..9ef7e16 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 _0x2c06=['../../config/utils','../../config/environment','../../mysqldb','json','count','offset','limit','status','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','show','model','keys','MailApplication','query','filters','attributes','intersection','fields','length','includeAll','merge','options','catch','body','params','html-pdf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x2c06,0x1dc));var _0x62c0=function(_0x4117ad,_0xcd426a){_0x4117ad=_0x4117ad-0x0;var _0x20062d=_0x2c06[_0x4117ad];return _0x20062d;};'use strict';var pdf=require(_0x62c0('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x62c0('0x1'));var jsonpatch=require(_0x62c0('0x2'));var rp=require('request-promise');var moment=require(_0x62c0('0x3'));var BPromise=require(_0x62c0('0x4'));var Mustache=require('mustache');var util=require(_0x62c0('0x5'));var path=require(_0x62c0('0x6'));var sox=require(_0x62c0('0x7'));var csv=require(_0x62c0('0x8'));var ejs=require(_0x62c0('0x9'));var fs=require('fs');var _=require(_0x62c0('0xa'));var squel=require(_0x62c0('0xb'));var crypto=require(_0x62c0('0xc'));var jsforce=require(_0x62c0('0xd'));var deskjs=require(_0x62c0('0xe'));var toCsv=require(_0x62c0('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x62c0('0xf'));var authService=require(_0x62c0('0x10'));var qs=require(_0x62c0('0x11'));var hardwareService=require(_0x62c0('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x62c0('0x13'));var config=require(_0x62c0('0x14'));var db=require(_0x62c0('0x15'))['db'];function respondWithStatusCode(_0x315240,_0x368327){_0x368327=_0x368327||0xcc;return function(_0x436c42){if(_0x436c42){return _0x315240['sendStatus'](_0x368327);}return _0x315240['status'](_0x368327)['end']();};}function respondWithResult(_0x13d7c2,_0x1fd1e2){_0x1fd1e2=_0x1fd1e2||0xc8;return function(_0x221cf8){if(_0x221cf8){return _0x13d7c2['status'](_0x1fd1e2)[_0x62c0('0x16')](_0x221cf8);}};}function respondWithFilteredResult(_0xf1bf3a,_0x93beb){return function(_0x1c6fd8){if(_0x1c6fd8){var _0x3daf30=_0x1c6fd8[_0x62c0('0x17')],_0x5bc116=_0x93beb[_0x62c0('0x18')],_0x439478=_0x93beb[_0x62c0('0x18')]+_0x93beb[_0x62c0('0x19')],_0x3fa3a8;if(_0x439478>=_0x3daf30){_0x439478=_0x3daf30;_0x3fa3a8=0xc8;}else{_0x3fa3a8=0xce;}_0xf1bf3a[_0x62c0('0x1a')](_0x3fa3a8);return _0xf1bf3a[_0x62c0('0x1b')]('Content-Range',_0x5bc116+'-'+_0x439478+'/'+_0x3daf30)[_0x62c0('0x16')](_0x1c6fd8);}return null;};}function patchUpdates(_0x10a7fb){return function(_0x381a19){try{jsonpatch[_0x62c0('0x1c')](_0x381a19,_0x10a7fb,!![]);}catch(_0x5210b3){return BPromise['reject'](_0x5210b3);}return _0x381a19[_0x62c0('0x1d')]();};}function saveUpdates(_0x75ec77,_0x4ea9ba){return function(_0x12f2e3){if(_0x12f2e3){return _0x12f2e3[_0x62c0('0x1e')](_0x75ec77)[_0x62c0('0x1f')](function(_0x1475c7){return _0x1475c7;});}return null;};}function removeEntity(_0x224bdc,_0xacc43){return function(_0x427f51){if(_0x427f51){return _0x427f51[_0x62c0('0x20')]()[_0x62c0('0x1f')](function(){_0x224bdc[_0x62c0('0x1a')](0xcc)[_0x62c0('0x21')]();});}};}function handleEntityNotFound(_0x5725fb,_0x3afd8b){return function(_0x56e9e3){if(!_0x56e9e3){_0x5725fb[_0x62c0('0x22')](0x194);}return _0x56e9e3;};}function handleError(_0x262627,_0x555c0b){_0x555c0b=_0x555c0b||0x1f4;return function(_0x4b6e61){logger[_0x62c0('0x23')](_0x4b6e61[_0x62c0('0x24')]);if(_0x4b6e61['name']){delete _0x4b6e61[_0x62c0('0x25')];}_0x262627[_0x62c0('0x1a')](_0x555c0b)[_0x62c0('0x26')](_0x4b6e61);};}exports[_0x62c0('0x27')]=function(_0x13c361,_0x47eb14){var _0x2a074b={'raw':!![],'where':{'id':_0x13c361['params']['id']}},_0x4623f6={};_0x4623f6[_0x62c0('0x28')]=_[_0x62c0('0x29')](db[_0x62c0('0x2a')]['rawAttributes']);_0x4623f6['query']=_[_0x62c0('0x29')](_0x13c361[_0x62c0('0x2b')]);_0x4623f6[_0x62c0('0x2c')]=_['intersection'](_0x4623f6[_0x62c0('0x28')],_0x4623f6[_0x62c0('0x2b')]);_0x2a074b[_0x62c0('0x2d')]=_[_0x62c0('0x2e')](_0x4623f6[_0x62c0('0x28')],qs['fields'](_0x13c361[_0x62c0('0x2b')][_0x62c0('0x2f')]));_0x2a074b[_0x62c0('0x2d')]=_0x2a074b[_0x62c0('0x2d')][_0x62c0('0x30')]?_0x2a074b[_0x62c0('0x2d')]:_0x4623f6[_0x62c0('0x28')];if(_0x13c361[_0x62c0('0x2b')][_0x62c0('0x31')]){_0x2a074b['include']=[{'all':!![]}];}_0x2a074b=_[_0x62c0('0x32')]({},_0x2a074b,_0x13c361[_0x62c0('0x33')]);return db[_0x62c0('0x2a')]['find'](_0x2a074b)[_0x62c0('0x1f')](handleEntityNotFound(_0x47eb14,null))['then'](respondWithResult(_0x47eb14,null))[_0x62c0('0x34')](handleError(_0x47eb14,null));};exports[_0x62c0('0x1e')]=function(_0x266309,_0x37e1d7){if(_0x266309[_0x62c0('0x35')]['id']){delete _0x266309[_0x62c0('0x35')]['id'];}return db[_0x62c0('0x2a')]['find']({'where':{'id':_0x266309[_0x62c0('0x36')]['id']}})[_0x62c0('0x1f')](handleEntityNotFound(_0x37e1d7,null))['then'](saveUpdates(_0x266309['body'],null))[_0x62c0('0x1f')](respondWithResult(_0x37e1d7,null))['catch'](handleError(_0x37e1d7,null));};exports['destroy']=function(_0x5e4f70,_0x6b71ce){return db['MailApplication']['find']({'where':{'id':_0x5e4f70[_0x62c0('0x36')]['id']}})[_0x62c0('0x1f')](handleEntityNotFound(_0x6b71ce,null))[_0x62c0('0x1f')](removeEntity(_0x6b71ce,null))[_0x62c0('0x34')](handleError(_0x6b71ce,null));}; \ No newline at end of file +var _0xbb8b=['set','Content-Range','json','apply','reject','save','update','then','status','error','name','send','show','params','model','rawAttributes','keys','query','filters','intersection','attributes','fields','includeAll','merge','options','MailApplication','catch','body','find','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','count','offset','limit'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0xbb8b,0x101));var _0xbbb8=function(_0x109726,_0x2a24fc){_0x109726=_0x109726-0x0;var _0x601b22=_0xbb8b[_0x109726];return _0x601b22;};'use strict';var pdf=require(_0xbbb8('0x0'));var emlformat=require(_0xbbb8('0x1'));var rimraf=require(_0xbbb8('0x2'));var zipdir=require(_0xbbb8('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbbb8('0x4'));var moment=require(_0xbbb8('0x5'));var BPromise=require(_0xbbb8('0x6'));var Mustache=require(_0xbbb8('0x7'));var util=require(_0xbbb8('0x8'));var path=require('path');var sox=require(_0xbbb8('0x9'));var csv=require(_0xbbb8('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbbb8('0xb'));var squel=require(_0xbbb8('0xc'));var crypto=require(_0xbbb8('0xd'));var jsforce=require(_0xbbb8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbbb8('0xa'));var querystring=require('querystring');var Papa=require(_0xbbb8('0xf'));var Redis=require('ioredis');var authService=require(_0xbbb8('0x10'));var qs=require(_0xbbb8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbbb8('0x12'))(_0xbbb8('0x13'));var utils=require(_0xbbb8('0x14'));var config=require(_0xbbb8('0x15'));var db=require(_0xbbb8('0x16'))['db'];function respondWithStatusCode(_0x1017dd,_0x152719){_0x152719=_0x152719||0xcc;return function(_0x274b32){if(_0x274b32){return _0x1017dd[_0xbbb8('0x17')](_0x152719);}return _0x1017dd['status'](_0x152719)[_0xbbb8('0x18')]();};}function respondWithResult(_0x576af2,_0x52a22e){_0x52a22e=_0x52a22e||0xc8;return function(_0x4dd897){if(_0x4dd897){return _0x576af2['status'](_0x52a22e)['json'](_0x4dd897);}};}function respondWithFilteredResult(_0x1d07e8,_0x3d3a43){return function(_0x1103c6){if(_0x1103c6){var _0xa5703f=_0x1103c6[_0xbbb8('0x19')],_0x19594e=_0x3d3a43[_0xbbb8('0x1a')],_0x2c719c=_0x3d3a43['offset']+_0x3d3a43[_0xbbb8('0x1b')],_0xb6d593;if(_0x2c719c>=_0xa5703f){_0x2c719c=_0xa5703f;_0xb6d593=0xc8;}else{_0xb6d593=0xce;}_0x1d07e8['status'](_0xb6d593);return _0x1d07e8[_0xbbb8('0x1c')](_0xbbb8('0x1d'),_0x19594e+'-'+_0x2c719c+'/'+_0xa5703f)[_0xbbb8('0x1e')](_0x1103c6);}return null;};}function patchUpdates(_0x18eabf){return function(_0x1811e1){try{jsonpatch[_0xbbb8('0x1f')](_0x1811e1,_0x18eabf,!![]);}catch(_0x418850){return BPromise[_0xbbb8('0x20')](_0x418850);}return _0x1811e1[_0xbbb8('0x21')]();};}function saveUpdates(_0x780214,_0xc76632){return function(_0x34935f){if(_0x34935f){return _0x34935f[_0xbbb8('0x22')](_0x780214)[_0xbbb8('0x23')](function(_0x590ab3){return _0x590ab3;});}return null;};}function removeEntity(_0x27a17e,_0x48506b){return function(_0x2806fc){if(_0x2806fc){return _0x2806fc['destroy']()['then'](function(){_0x27a17e[_0xbbb8('0x24')](0xcc)[_0xbbb8('0x18')]();});}};}function handleEntityNotFound(_0x3ef008,_0x5d2015){return function(_0x1abdde){if(!_0x1abdde){_0x3ef008[_0xbbb8('0x17')](0x194);}return _0x1abdde;};}function handleError(_0x3b98f2,_0xcd2a53){_0xcd2a53=_0xcd2a53||0x1f4;return function(_0x11e277){logger[_0xbbb8('0x25')](_0x11e277['stack']);if(_0x11e277[_0xbbb8('0x26')]){delete _0x11e277['name'];}_0x3b98f2['status'](_0xcd2a53)[_0xbbb8('0x27')](_0x11e277);};}exports[_0xbbb8('0x28')]=function(_0x53268e,_0xa4252f){var _0xc4a671={'raw':!![],'where':{'id':_0x53268e[_0xbbb8('0x29')]['id']}},_0x25069d={};_0x25069d[_0xbbb8('0x2a')]=_['keys'](db['MailApplication'][_0xbbb8('0x2b')]);_0x25069d['query']=_[_0xbbb8('0x2c')](_0x53268e[_0xbbb8('0x2d')]);_0x25069d[_0xbbb8('0x2e')]=_[_0xbbb8('0x2f')](_0x25069d['model'],_0x25069d[_0xbbb8('0x2d')]);_0xc4a671[_0xbbb8('0x30')]=_['intersection'](_0x25069d[_0xbbb8('0x2a')],qs['fields'](_0x53268e['query'][_0xbbb8('0x31')]));_0xc4a671[_0xbbb8('0x30')]=_0xc4a671[_0xbbb8('0x30')]['length']?_0xc4a671['attributes']:_0x25069d[_0xbbb8('0x2a')];if(_0x53268e[_0xbbb8('0x2d')][_0xbbb8('0x32')]){_0xc4a671['include']=[{'all':!![]}];}_0xc4a671=_[_0xbbb8('0x33')]({},_0xc4a671,_0x53268e[_0xbbb8('0x34')]);return db[_0xbbb8('0x35')]['find'](_0xc4a671)['then'](handleEntityNotFound(_0xa4252f,null))[_0xbbb8('0x23')](respondWithResult(_0xa4252f,null))[_0xbbb8('0x36')](handleError(_0xa4252f,null));};exports['update']=function(_0x4d2ef5,_0x147c20){if(_0x4d2ef5[_0xbbb8('0x37')]['id']){delete _0x4d2ef5[_0xbbb8('0x37')]['id'];}return db[_0xbbb8('0x35')][_0xbbb8('0x38')]({'where':{'id':_0x4d2ef5[_0xbbb8('0x29')]['id']}})[_0xbbb8('0x23')](handleEntityNotFound(_0x147c20,null))[_0xbbb8('0x23')](saveUpdates(_0x4d2ef5[_0xbbb8('0x37')],null))[_0xbbb8('0x23')](respondWithResult(_0x147c20,null))[_0xbbb8('0x36')](handleError(_0x147c20,null));};exports['destroy']=function(_0x552072,_0x230a50){return db[_0xbbb8('0x35')][_0xbbb8('0x38')]({'where':{'id':_0x552072['params']['id']}})[_0xbbb8('0x23')](handleEntityNotFound(_0x230a50,null))['then'](removeEntity(_0x230a50,null))[_0xbbb8('0x36')](handleError(_0x230a50,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index a433949..cc23062 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 _0xb0ca=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x6e4739,_0x122a3b){var _0x316b7f=function(_0x10d87a){while(--_0x10d87a){_0x6e4739['push'](_0x6e4739['shift']());}};_0x316b7f(++_0x122a3b);}(_0xb0ca,0x1b2));var _0xab0c=function(_0x232538,_0x4e68b9){_0x232538=_0x232538-0x0;var _0x49de9f=_0xb0ca[_0x232538];return _0x49de9f;};'use strict';var _=require('lodash');var util=require(_0xab0c('0x0'));var logger=require('../../config/logger')(_0xab0c('0x1'));var moment=require(_0xab0c('0x2'));var BPromise=require(_0xab0c('0x3'));var rp=require(_0xab0c('0x4'));var fs=require('fs');var path=require(_0xab0c('0x5'));var rimraf=require(_0xab0c('0x6'));var config=require(_0xab0c('0x7'));var attributes=require('./mailApplication.attributes');module[_0xab0c('0x8')]=function(_0x14c9dc,_0x1c4dcf){return _0x14c9dc[_0xab0c('0x9')](_0xab0c('0xa'),attributes,{'tableName':_0xab0c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xab0c('0xc'),'collate':_0xab0c('0xd')});}; \ No newline at end of file +var _0x7a40=['utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./mailApplication.attributes','exports','define','mail_applications','utf8mb4'];(function(_0xbebf50,_0x44ec09){var _0xce1496=function(_0x1bf94d){while(--_0x1bf94d){_0xbebf50['push'](_0xbebf50['shift']());}};_0xce1496(++_0x44ec09);}(_0x7a40,0x197));var _0x07a4=function(_0x56428b,_0x36495e){_0x56428b=_0x56428b-0x0;var _0x302e90=_0x7a40[_0x56428b];return _0x302e90;};'use strict';var _=require(_0x07a4('0x0'));var util=require(_0x07a4('0x1'));var logger=require(_0x07a4('0x2'))('api');var moment=require(_0x07a4('0x3'));var BPromise=require(_0x07a4('0x4'));var rp=require(_0x07a4('0x5'));var fs=require('fs');var path=require(_0x07a4('0x6'));var rimraf=require(_0x07a4('0x7'));var config=require('../../config/environment');var attributes=require(_0x07a4('0x8'));module[_0x07a4('0x9')]=function(_0x3a53fb,_0x399d0f){return _0x3a53fb[_0x07a4('0xa')]('MailApplication',attributes,{'tableName':_0x07a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x07a4('0xc'),'collate':_0x07a4('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index f7a3574..382458c 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 _0x9957=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','update','options','raw','attributes','limit','lodash','util','moment'];(function(_0x1e753b,_0x209149){var _0x13d34e=function(_0x338150){while(--_0x338150){_0x1e753b['push'](_0x1e753b['shift']());}};_0x13d34e(++_0x209149);}(_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 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']('MailApplication,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['MailApplication'][_0x7995('0x19')](_0x291317['body'],{'raw':_0x291317['options']?_0x291317[_0x7995('0x1a')][_0x7995('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x291317['options']?_0x291317[_0x7995('0x1a')]['where']||null:null,'attributes':_0x291317['options']?_0x291317[_0x7995('0x1a')][_0x7995('0x1c')]||null:null,'limit':_0x291317[_0x7995('0x1a')]?_0x291317[_0x7995('0x1a')][_0x7995('0x1d')]||null:null})[_0x7995('0xc')](function(_0x5d40ae){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x5d40ae));_0x37a7d4(_0x5d40ae);})[_0x7995('0x17')](function(_0x475351){logger[_0x7995('0x13')]('UpdateMailApplication',_0x475351[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x475351[_0x7995('0x15')]));});});}; \ 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(_0x5e8142,_0x22ff62){var _0x209fac=function(_0x51af2b){while(--_0x51af2b){_0x5e8142['push'](_0x5e8142['shift']());}};_0x209fac(++_0x22ff62);}(_0x7a54,0x106));var _0x47a5=function(_0x5944c9,_0x57bbaf){_0x5944c9=_0x5944c9-0x0;var _0x3d090c=_0x7a54[_0x5944c9];return _0x3d090c;};'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 eacdfab..9c9e619 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(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x54ef,0x112));var _0xf54e=function(_0x5a30f8,_0x40ea7c){_0x5a30f8=_0x5a30f8-0x0;var _0x4c0db0=_0x54ef[_0x5a30f8];return _0x4c0db0;};'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 _0x8ef6=['../../components/auth/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','mail','addTags','put','mailinteraction:update','update','mailinteraction:destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router'];(function(_0x17233d,_0x2dfb62){var _0x3ce099=function(_0x2169eb){while(--_0x2169eb){_0x17233d['push'](_0x17233d['shift']());}};_0x3ce099(++_0x2dfb62);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2dd0db,_0x19071a){_0x2dd0db=_0x2dd0db-0x0;var _0x542e64=_0x8ef6[_0x2dd0db];return _0x542e64;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var auth=require(_0x68ef('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x68ef('0x7'));var controller=require(_0x68ef('0x8'));router[_0x68ef('0x9')]('/',auth[_0x68ef('0xa')](),controller['index']);router['get'](_0x68ef('0xb'),auth[_0x68ef('0xa')](),controller[_0x68ef('0xc')]);router['get'](_0x68ef('0xd'),auth[_0x68ef('0xa')](),controller[_0x68ef('0xe')]);router[_0x68ef('0x9')](_0x68ef('0xf'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x10')]);router[_0x68ef('0x9')](_0x68ef('0x11'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x12')]);router[_0x68ef('0x13')]('/',auth['isAuthenticated'](),controller[_0x68ef('0x14')]);router[_0x68ef('0x13')](_0x68ef('0xf'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x15')]);router[_0x68ef('0x13')]('/:id/tags',auth[_0x68ef('0xa')](),interaction[_0x68ef('0x16')](_0x68ef('0x17'),'mailinteraction:addtags'),controller[_0x68ef('0x18')]);router[_0x68ef('0x19')](_0x68ef('0xd'),auth['isAuthenticated'](),interaction[_0x68ef('0x16')](_0x68ef('0x17'),_0x68ef('0x1a')),controller[_0x68ef('0x1b')]);router['delete'](_0x68ef('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0x68ef('0x17'),_0x68ef('0x1c')),controller['destroy']);router['delete'](_0x68ef('0x1d'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x1e')]);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 250ba88..f7ce3c6 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 _0xf5a7=['exports','DATE','STRING','TEXT','long','out','iconv'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xf5a7,0x195));var _0x7f5a=function(_0x313b32,_0x52754e){_0x313b32=_0x313b32-0x0;var _0x58c647=_0xf5a7[_0x313b32];return _0x58c647;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x7f5a('0x0'));module[_0x7f5a('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7f5a('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x7f5a('0x3')](0x1fe)},'to':{'type':Sequelize[_0x7f5a('0x3')]},'cc':{'type':Sequelize[_0x7f5a('0x4')](_0x7f5a('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x7f5a('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x7f5a('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x7f5a('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize['TEXT'](_0x7f5a('0x5'))},'lastMsgText':{'type':Sequelize[_0x7f5a('0x4')](_0x7f5a('0x5'))}}; \ No newline at end of file +var _0xa5c5=['BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','sequelize','iconv','exports'];(function(_0x244c22,_0x45aa82){var _0x1faf91=function(_0x446b17){while(--_0x446b17){_0x244c22['push'](_0x244c22['shift']());}};_0x1faf91(++_0x45aa82);}(_0xa5c5,0x1c9));var _0x5a5c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xa5c5[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x5a5c('0x0'));var iconv=require(_0x5a5c('0x1'));module[_0x5a5c('0x2')]={'closed':{'type':Sequelize[_0x5a5c('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5a5c('0x4')]},'disposition':{'type':Sequelize[_0x5a5c('0x5')]},'note':{'type':Sequelize[_0x5a5c('0x5')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x5a5c('0x5')]},'cc':{'type':Sequelize[_0x5a5c('0x6')](_0x5a5c('0x7'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x5a5c('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x5a5c('0x4')]},'substatus':{'type':Sequelize[_0x5a5c('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x5a5c('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x5a5c('0x8')]('in',_0x5a5c('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5a5c('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x5a5c('0x8')]('in',_0x5a5c('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize['TEXT'](_0x5a5c('0x7'))},'lastMsgText':{'type':Sequelize['TEXT'](_0x5a5c('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 6491c17..8b74ed0 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 _0xef40=['Tags','forEach','push','MailInteraction','findOne','lastMsgBody','lastMsgText','trimStart','catch','index','rawAttributes','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','select','field','color','from','tools_tags','COUNT(*)','mail_messages','me.MailInteractionId\x20=\x20i.id','where','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.MailAccountId','advancedFilter','parse','keys','createdAt','value','dateStart','startOf','utc','endOf','day','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','tableAlias','\x20=\x20?','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20<\x20?','unreadMessages','\x20IN\x20?','LIKE','\x20>\x20?','filter','isNil','i.MailAccountId\x20IN\x20?','concat','$gte','$lte','null','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','split','join','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','order','DESC','group','i.id','Sequelize','QueryTypes','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','sequelize','toString','keyBy','merge','Account.key','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','enableEmailPreview','all','rows','params','includeAll','include','create','body','find','describe','addMessage','MailMessage','ids','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','omit','Tag','emit','mailInteractionTags:save','removeTags','unix','server','files','tmp','interaction-%s.zip','subject','attachments','Attachment','Attachments','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','basename','existsSync','message%d.eml','download','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','html-to-text','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','json','count','offset','limit','set','Content-Range','apply','update','destroy','then','status','error','name','send','Users','map','TagIds'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xef40,0xb1));var _0x0ef4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xef40[_0x3bf83f];return _0x22c4a9;};'use strict';var pdf=require(_0x0ef4('0x0'));var emlformat=require(_0x0ef4('0x1'));var rimraf=require(_0x0ef4('0x2'));var zipdir=require(_0x0ef4('0x3'));var jsonpatch=require(_0x0ef4('0x4'));var rp=require('request-promise');var moment=require(_0x0ef4('0x5'));var BPromise=require(_0x0ef4('0x6'));var Mustache=require('mustache');var util=require(_0x0ef4('0x7'));var path=require(_0x0ef4('0x8'));var sox=require(_0x0ef4('0x9'));var csv=require(_0x0ef4('0xa'));var ejs=require(_0x0ef4('0xb'));var fs=require('fs');var _=require(_0x0ef4('0xc'));var squel=require(_0x0ef4('0xd'));var crypto=require('crypto');var jsforce=require(_0x0ef4('0xe'));var deskjs=require(_0x0ef4('0xf'));var toCsv=require(_0x0ef4('0xa'));var querystring=require(_0x0ef4('0x10'));var Papa=require('papaparse');var htmlToText=require(_0x0ef4('0x11'));var Redis=require('ioredis');var authService=require(_0x0ef4('0x12'));var qs=require(_0x0ef4('0x13'));var hardwareService=require(_0x0ef4('0x14'));var logger=require(_0x0ef4('0x15'))(_0x0ef4('0x16'));var utils=require(_0x0ef4('0x17'));var config=require(_0x0ef4('0x18'));var db=require('../../mysqldb')['db'];config[_0x0ef4('0x19')]=_[_0x0ef4('0x1a')](config[_0x0ef4('0x19')],{'host':_0x0ef4('0x1b'),'port':0x18eb});var socket=require(_0x0ef4('0x1c'))(new Redis(config[_0x0ef4('0x19')]));require(_0x0ef4('0x1d'))[_0x0ef4('0x1e')](socket);function respondWithStatusCode(_0x140407,_0x41674c){_0x41674c=_0x41674c||0xcc;return function(_0x108a6f){if(_0x108a6f){return _0x140407[_0x0ef4('0x1f')](_0x41674c);}return _0x140407['status'](_0x41674c)[_0x0ef4('0x20')]();};}function respondWithResult(_0x1ef073,_0xe5e5f3){_0xe5e5f3=_0xe5e5f3||0xc8;return function(_0x56c009){if(_0x56c009){return _0x1ef073['status'](_0xe5e5f3)[_0x0ef4('0x21')](_0x56c009);}};}function respondWithFilteredResult(_0xc7e1fe,_0x2c1974){return function(_0x214ff4){if(_0x214ff4){var _0x56e433=_0x214ff4[_0x0ef4('0x22')],_0x1ae6cc=_0x2c1974[_0x0ef4('0x23')],_0x509923=_0x2c1974[_0x0ef4('0x23')]+_0x2c1974[_0x0ef4('0x24')],_0x17b789;if(_0x509923>=_0x56e433){_0x509923=_0x56e433;_0x17b789=0xc8;}else{_0x17b789=0xce;}_0xc7e1fe['status'](_0x17b789);return _0xc7e1fe[_0x0ef4('0x25')](_0x0ef4('0x26'),_0x1ae6cc+'-'+_0x509923+'/'+_0x56e433)[_0x0ef4('0x21')](_0x214ff4);}return null;};}function patchUpdates(_0x362120){return function(_0x27f995){try{jsonpatch[_0x0ef4('0x27')](_0x27f995,_0x362120,!![]);}catch(_0x19a693){return BPromise['reject'](_0x19a693);}return _0x27f995['save']();};}function saveUpdates(_0x136a15,_0x244b01){return function(_0x398078){if(_0x398078){return _0x398078[_0x0ef4('0x28')](_0x136a15)['then'](function(_0x49eb18){return _0x49eb18;});}return null;};}function removeEntity(_0x399d65,_0x31f00b){return function(_0x2fa51e){if(_0x2fa51e){return _0x2fa51e[_0x0ef4('0x29')]()[_0x0ef4('0x2a')](function(){_0x399d65[_0x0ef4('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x507f06,_0x4c11b5){return function(_0xa7ee4b){if(!_0xa7ee4b){_0x507f06[_0x0ef4('0x1f')](0x194);}return _0xa7ee4b;};}function handleError(_0xc284e3,_0x1c8172){_0x1c8172=_0x1c8172||0x1f4;return function(_0x46a2b4){logger[_0x0ef4('0x2c')](_0x46a2b4['stack']);if(_0x46a2b4[_0x0ef4('0x2d')]){delete _0x46a2b4[_0x0ef4('0x2d')];}_0xc284e3['status'](_0x1c8172)[_0x0ef4('0x2e')](_0x46a2b4);};}function getInteractionUsers(_0x1c9c56,_0x361ffc){return new BPromise(function(_0x5aa0a4,_0x3c0a24){try{if(_0x361ffc[_0x1c9c56['id']]){_0x1c9c56[_0x0ef4('0x2f')]=_[_0x0ef4('0x30')](_0x361ffc[_0x1c9c56['id']],function(_0x50b7f6){return{'id':_0x50b7f6['id']};});}}catch(_0x1bb12c){_0x3c0a24(_0x1bb12c);}_0x5aa0a4(_0x1c9c56);});}function getInteractionTags(_0x515305,_0x2b2ec6){return new BPromise(function(_0x138bed,_0x22bdf2){try{if(_0x515305[_0x0ef4('0x31')]){_0x515305[_0x0ef4('0x32')]=[];_0x515305[_0x0ef4('0x31')]['split'](',')[_0x0ef4('0x33')](function(_0x4d1902){_0x515305[_0x0ef4('0x32')][_0x0ef4('0x34')](_0x2b2ec6[_0x4d1902]);});}delete _0x515305[_0x0ef4('0x31')];}catch(_0x26ac89){_0x22bdf2(_0x26ac89);}_0x138bed(_0x515305);});}function getLastMessageText(_0x4ed827){return new BPromise(function(_0x1b71dc,_0xe1d71a){return db[_0x0ef4('0x35')][_0x0ef4('0x36')]({'where':{'id':_0x4ed827['id']},'attributes':[_0x0ef4('0x37'),_0x0ef4('0x38')],'raw':!![]})[_0x0ef4('0x2a')](function(_0x21b155){if(!_0x21b155['lastMsgText']){_0x4ed827[_0x0ef4('0x38')]=_[_0x0ef4('0x39')](htmlToText['fromString'](_0x21b155['lastMsgBody'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x4ed827[_0x0ef4('0x38')]=_0x21b155[_0x0ef4('0x38')];}_0x1b71dc(_0x4ed827);})[_0x0ef4('0x3a')](function(_0x3f6e39){_0xe1d71a(_0x3f6e39);});});}function updateMailInteraction(_0x30d54c,_0x1320f8,_0xeafb99,_0x52ce27){return new BPromise(function(_0x147766,_0x2e3c7e){return getInteractionUsers(_0x30d54c,_0xeafb99)[_0x0ef4('0x2a')](function(_0x3bd28f){return getInteractionTags(_0x3bd28f,_0x1320f8);})['then'](function(_0x4b057b){if(_0x52ce27){_0x147766(getLastMessageText(_0x4b057b));}else{_0x147766(_0x4b057b);}})[_0x0ef4('0x3a')](function(_0x85e52e){_0x2e3c7e(_0x85e52e);});});}exports[_0x0ef4('0x3b')]=function(_0xd05154,_0x576b24){var _0x1e0aeb={},_0x20fc27={},_0x21143d={'count':0x0,'rows':[]};var _0xd0bd99=db[_0x0ef4('0x35')][_0x0ef4('0x3c')];_0x20fc27[_0x0ef4('0x3d')]=_['keys'](_0xd0bd99);_0x20fc27[_0x0ef4('0x3e')]=_['keys'](_0xd05154[_0x0ef4('0x3e')]);_0x20fc27['filters']=_[_0x0ef4('0x3f')](_0x20fc27[_0x0ef4('0x3d')],_0x20fc27[_0x0ef4('0x3e')]);_0x1e0aeb[_0x0ef4('0x40')]=_['intersection'](_0x20fc27[_0x0ef4('0x3d')],qs[_0x0ef4('0x41')](_0xd05154[_0x0ef4('0x3e')]['fields']));_0x1e0aeb['attributes']=_0x1e0aeb[_0x0ef4('0x40')][_0x0ef4('0x42')]?_0x1e0aeb[_0x0ef4('0x40')]:_0x20fc27[_0x0ef4('0x3d')];if(!_0xd05154[_0x0ef4('0x3e')][_0x0ef4('0x43')]('nolimit')){_0x1e0aeb[_0x0ef4('0x24')]=qs['limit'](_0xd05154[_0x0ef4('0x3e')][_0x0ef4('0x24')]);_0x1e0aeb[_0x0ef4('0x23')]=qs[_0x0ef4('0x23')](_0xd05154['query'][_0x0ef4('0x23')]);}_0x1e0aeb['order']=qs[_0x0ef4('0x44')](_0xd05154[_0x0ef4('0x3e')][_0x0ef4('0x44')]);_0x1e0aeb['where']=qs[_0x0ef4('0x45')](_[_0x0ef4('0x46')](_0xd05154['query'],_0x20fc27[_0x0ef4('0x45')]));var _0x2e493b=[];var _0x41755c=squel[_0x0ef4('0x47')]()[_0x0ef4('0x48')]('id')[_0x0ef4('0x48')](_0x0ef4('0x2d'))[_0x0ef4('0x48')](_0x0ef4('0x49'))[_0x0ef4('0x4a')](_0x0ef4('0x4b'));var _0x418981=squel[_0x0ef4('0x47')]()[_0x0ef4('0x48')](_0x0ef4('0x4c'))[_0x0ef4('0x4a')](_0x0ef4('0x4d'),'me')['where'](_0x0ef4('0x4e'))[_0x0ef4('0x4f')](_0x0ef4('0x50'))[_0x0ef4('0x4f')](_0x0ef4('0x51'));var _0x84ed12=squel['select']()['field'](_0x0ef4('0x52'))[_0x0ef4('0x48')]('ui.MailInteractionId')['from'](_0x0ef4('0x53'),'ui')[_0x0ef4('0x54')](_0x0ef4('0x55'),'u',_0x0ef4('0x56'));var _0x421897=squel[_0x0ef4('0x47')]()[_0x0ef4('0x4a')](_0x0ef4('0x57'),'i')[_0x0ef4('0x54')](_0x0ef4('0x58'),'c',_0x0ef4('0x59'))[_0x0ef4('0x54')](_0x0ef4('0x55'),'o','o.id\x20=\x20i.UserId')[_0x0ef4('0x54')]('mail_accounts','a',_0x0ef4('0x5a'))['left_join'](_0x0ef4('0x4d'),'me','me.MailInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false');var _0x570049=squel['expr']();if(_0xd05154[_0x0ef4('0x3e')][_0x0ef4('0x5b')]){var _0x486827=JSON[_0x0ef4('0x5c')](_0xd05154[_0x0ef4('0x3e')]['advancedFilter']);_[_0x0ef4('0x5d')](_0x486827)[_0x0ef4('0x33')](function(_0x523a5c){var _0x406fca=_0x486827[_0x523a5c];if(_0x523a5c===_0x0ef4('0x5e')){var _0x21d8ee=moment(_0x406fca[_0x0ef4('0x5f')][_0x0ef4('0x60')])[_0x0ef4('0x61')]('day')[_0x0ef4('0x62')]()['format']();var _0x42c6aa=moment(_0x42c6aa)['utc']()[_0x0ef4('0x63')](_0x0ef4('0x64'))[_0x0ef4('0x65')]();_0x570049[_0x0ef4('0x66')](_0x0ef4('0x67'),_0x21d8ee,_0x42c6aa);}else{if(_[_0x0ef4('0x68')](_0x406fca[_0x0ef4('0x69')])){_0x406fca[_0x0ef4('0x69')][_0x0ef4('0x33')](function(_0x430a53){switch(_0x406fca[_0x0ef4('0x69')][_0x0ef4('0x5f')]){case'IS':if(_0x523a5c!==_0x0ef4('0x6a')&&_0x523a5c!=='unreadMessages'){if(_[_0x0ef4('0x68')](_0x406fca['value'])&&_0x406fca[_0x0ef4('0x5f')][_0x0ef4('0x42')]>0x1){_0x570049['and'](_0x406fca[_0x0ef4('0x6b')]+'.'+_0x523a5c+'\x20IN\x20?',_0x406fca[_0x0ef4('0x5f')]);}else{_0x570049[_0x0ef4('0x66')](_0x406fca[_0x0ef4('0x6b')]+'.'+_0x523a5c+'\x20=\x20?',_0x406fca['value'][0x0]);}}break;case'=':_0x570049['and'](_0x406fca[_0x0ef4('0x6b')]+'.'+_0x523a5c+_0x0ef4('0x6c'),_0x406fca[_0x0ef4('0x5f')]);break;case'LIKE':if(_0x523a5c===_0x0ef4('0x6d')){_0x570049[_0x0ef4('0x66')](_0x0ef4('0x6e')+_0x0ef4('0x6f'),'%'+_0x406fca[_0x0ef4('0x5f')]+'%');_0x570049['or'](_0x0ef4('0x70')+_0x0ef4('0x6f'),'%'+_0x406fca[_0x0ef4('0x5f')]+'%');_0x570049['or'](_0x0ef4('0x71')+_0x0ef4('0x6f'),'%'+_0x406fca[_0x0ef4('0x5f')]+'%');}else{_0x570049['and'](_0x406fca[_0x0ef4('0x6b')]+'.'+_0x523a5c+'\x20LIKE\x20?','%'+_0x406fca['value']+'%');}break;case'>':_0x570049[_0x0ef4('0x66')](_0x406fca[_0x0ef4('0x6b')]+'.'+_0x523a5c+'\x20>\x20?',_0x406fca[_0x0ef4('0x5f')]);break;case'<':_0x570049[_0x0ef4('0x66')](_0x406fca[_0x0ef4('0x6b')]+'.'+_0x523a5c+_0x0ef4('0x72'),_0x406fca['value']);break;}});}else{switch(_0x406fca[_0x0ef4('0x69')][_0x0ef4('0x5f')]){case'IS':if(_0x523a5c!=='TagId'&&_0x523a5c!==_0x0ef4('0x73')){if(_['isArray'](_0x406fca[_0x0ef4('0x5f')])&&_0x406fca[_0x0ef4('0x5f')][_0x0ef4('0x42')]>0x1){_0x570049[_0x0ef4('0x66')](_0x406fca[_0x0ef4('0x6b')]+'.'+_0x523a5c+_0x0ef4('0x74'),_0x406fca[_0x0ef4('0x5f')]);}else{_0x570049[_0x0ef4('0x66')](_0x406fca[_0x0ef4('0x6b')]+'.'+_0x523a5c+_0x0ef4('0x6c'),_0x406fca[_0x0ef4('0x5f')][0x0]);}}break;case'=':_0x570049[_0x0ef4('0x66')](_0x406fca[_0x0ef4('0x6b')]+'.'+_0x523a5c+_0x0ef4('0x6c'),_0x406fca[_0x0ef4('0x5f')]);break;case _0x0ef4('0x75'):if(_0x523a5c===_0x0ef4('0x6d')){_0x570049[_0x0ef4('0x66')](_0x0ef4('0x6e')+'\x20LIKE\x20?','%'+_0x406fca['value']+'%');_0x570049['or'](_0x0ef4('0x70')+_0x0ef4('0x6f'),'%'+_0x406fca[_0x0ef4('0x5f')]+'%');_0x570049['or'](_0x0ef4('0x71')+_0x0ef4('0x6f'),'%'+_0x406fca[_0x0ef4('0x5f')]+'%');}else{_0x570049[_0x0ef4('0x66')](_0x406fca[_0x0ef4('0x6b')]+'.'+_0x523a5c+'\x20LIKE\x20?','%'+_0x406fca[_0x0ef4('0x5f')]+'%');}break;case'>':_0x570049[_0x0ef4('0x66')](_0x406fca[_0x0ef4('0x6b')]+'.'+_0x523a5c+_0x0ef4('0x76'),_0x406fca['value']);break;case'<':_0x570049[_0x0ef4('0x66')](_0x406fca[_0x0ef4('0x6b')]+'.'+_0x523a5c+_0x0ef4('0x72'),_0x406fca['value']);break;}}}});}else{var _0x4034dd=_(Object['keys'](_0xd05154[_0x0ef4('0x3e')]))[_0x0ef4('0x30')](function(_0x4ee7ca){return _0xd0bd99['hasOwnProperty'](_0x4ee7ca)?_0x4ee7ca:undefined;})[_0x0ef4('0x77')](function(_0x56d82b){return!_[_0x0ef4('0x78')](_0x56d82b);})['value']();if(!_['isEmpty'](_0x4034dd)){_0x4034dd[_0x0ef4('0x33')](function(_0x313131){if(_0x313131==='MailAccountId'){_0x421897[_0x0ef4('0x4f')](_0x0ef4('0x79'),[][_0x0ef4('0x7a')](_0xd05154[_0x0ef4('0x3e')][_0x313131]));}else if(_0x313131===_0x0ef4('0x5e')){var _0x27a98a=JSON[_0x0ef4('0x5c')](_0xd05154[_0x0ef4('0x3e')][_0x313131])[_0x0ef4('0x7b')];var _0x3294d5=JSON['parse'](_0xd05154[_0x0ef4('0x3e')][_0x313131])[_0x0ef4('0x7c')];_0x421897[_0x0ef4('0x4f')](_0x0ef4('0x67'),_0x27a98a,_0x3294d5);}else{if(_0xd05154['query'][_0x313131]===_0x0ef4('0x7d')){_0x421897[_0x0ef4('0x4f')]('i.'+_0x313131+'\x20IS\x20NULL');}else{_0x421897[_0x0ef4('0x4f')]('i.'+_0x313131+_0x0ef4('0x6c'),_0xd05154[_0x0ef4('0x3e')][_0x313131]);}}});}if(_0xd05154[_0x0ef4('0x3e')][_0x0ef4('0x77')]){var _0x52dfe4=_0xd05154[_0x0ef4('0x3e')]['filter']['replace']('\x5c','\x5c\x5c')[_0x0ef4('0x7e')]('\x27\x27',_0x0ef4('0x7f'));if(qs[_0x0ef4('0x80')](_0x52dfe4)){_0x570049['or'](_0x0ef4('0x81'),_0x52dfe4+'%');}else if(qs[_0x0ef4('0x82')](_0x52dfe4)){_0x570049['or'](_0x0ef4('0x83'),_0x52dfe4+'%');}else{var _0xdd0f2c=[];_0x52dfe4[_0x0ef4('0x84')]('\x20')[_0x0ef4('0x33')](function(_0x317f88){_0xdd0f2c[_0x0ef4('0x34')]('+'+_0x317f88['toString']());});var _0x49e364=_0xdd0f2c[_0x0ef4('0x85')]('\x20');_0x570049['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x49e364)['or'](_0x0ef4('0x86'),_0x49e364);}}}_0x421897[_0x0ef4('0x4f')](_0x570049);if(_0x1e0aeb['order']){_0x1e0aeb['order']['forEach'](function(_0x2c5283){_0x421897[_0x0ef4('0x87')]('i.'+_0x2c5283[0x0],_0x2c5283[0x1]===_0x0ef4('0x88')?![]:!![]);});}_0x421897[_0x0ef4('0x89')](_0x0ef4('0x8a'));var _0x4f54f4={'type':db[_0x0ef4('0x8b')][_0x0ef4('0x8c')]['SELECT'],'raw':!![]};var _0x7c1ce0=_0x421897['clone']()[_0x0ef4('0x48')](_0x0ef4('0x4c'))[_0x0ef4('0x48')](_0x0ef4('0x8d'),_0x0ef4('0x73'));if(!_0xd05154[_0x0ef4('0x3e')][_0x0ef4('0x5b')]){if(_0xd05154['query'][_0x0ef4('0x8e')]){if(_0xd05154['query']['read']==0x1){_0x7c1ce0[_0x0ef4('0x8f')](_0x0ef4('0x90'));_0x421897[_0x0ef4('0x8f')]('`unreadMessages`\x20=\x200');}else{_0x7c1ce0[_0x0ef4('0x8f')]('`unreadMessages`\x20>\x200');_0x421897['having'](_0x0ef4('0x91'));}}if(_0xd05154[_0x0ef4('0x3e')][_0x0ef4('0x92')]){var _0xdcd6ba=_[_0x0ef4('0x68')](_0xd05154[_0x0ef4('0x3e')][_0x0ef4('0x92')])?_0xd05154[_0x0ef4('0x3e')][_0x0ef4('0x92')]:new Array(_0xd05154[_0x0ef4('0x3e')][_0x0ef4('0x92')]);var _0x52ff16=squel[_0x0ef4('0x93')]();_0xdcd6ba['forEach'](function(_0x5302a7){_0x52ff16['or'](_0x0ef4('0x94'),'%,'+_0x5302a7+',%');});_0x421897[_0x0ef4('0x8f')](_0x52ff16);_0x7c1ce0[_0x0ef4('0x54')](_0x0ef4('0x95'),'it',_0x0ef4('0x96'));_0x7c1ce0[_0x0ef4('0x54')](_0x0ef4('0x4b'),'t',_0x0ef4('0x97'));_0x7c1ce0[_0x0ef4('0x4f')](_0x0ef4('0x98'),_0xdcd6ba);}}else{var _0x486827=JSON[_0x0ef4('0x5c')](_0xd05154[_0x0ef4('0x3e')]['advancedFilter']);_[_0x0ef4('0x5d')](_0x486827)[_0x0ef4('0x33')](function(_0x347e18){var _0x1eea24=_0x486827[_0x347e18];if(_0x347e18===_0x0ef4('0x6a')){var _0x5ece5a=_0x1eea24['value'];var _0x391d14=squel[_0x0ef4('0x93')]();_0x5ece5a[_0x0ef4('0x33')](function(_0x7a3b6){_0x391d14['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x7a3b6+',%');});_0x421897[_0x0ef4('0x8f')](_0x391d14);_0x7c1ce0[_0x0ef4('0x54')](_0x0ef4('0x95'),'it',_0x0ef4('0x96'));_0x7c1ce0['left_join'](_0x0ef4('0x4b'),'t',_0x0ef4('0x97'));_0x7c1ce0[_0x0ef4('0x4f')](_0x0ef4('0x98'),_0x5ece5a);}else if(_0x347e18==='unreadMessages'){if(_0x1eea24[_0x0ef4('0x5f')][_0x0ef4('0x42')]===0x1){if(_0x1eea24['value'][0x0]===0x1){_0x7c1ce0[_0x0ef4('0x8f')]('`unreadMessages`\x20=\x200');_0x421897[_0x0ef4('0x8f')]('`unreadMessages`\x20=\x200');}else{_0x7c1ce0[_0x0ef4('0x8f')]('`unreadMessages`\x20>\x200');_0x421897['having'](_0x0ef4('0x91'));}}}});}db[_0x0ef4('0x99')][_0x0ef4('0x3e')](_0x7c1ce0[_0x0ef4('0x9a')](),_0x4f54f4)['then'](function(_0x2f43a1){_0x21143d[_0x0ef4('0x22')]=_0x2f43a1['length'];if(_0x21143d[_0x0ef4('0x22')]===0x0)return[];return db[_0x0ef4('0x99')][_0x0ef4('0x3e')](_0x41755c[_0x0ef4('0x9a')](),_0x4f54f4)['then'](function(_0x15e920){_0x2e493b=_[_0x0ef4('0x9b')](_0x15e920,'id');_0x4f54f4=_[_0x0ef4('0x9c')](_0x4f54f4,{'model':db[_0x0ef4('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x421897['field'](_0x0ef4('0x8d'),'unreadMessages');_0x421897[_0x0ef4('0x48')]('a.key',_0x0ef4('0x9d'));_0x421897[_0x0ef4('0x48')](_0x0ef4('0x8a'));_0x421897[_0x0ef4('0x48')](_0x0ef4('0x9e'));_0x421897[_0x0ef4('0x48')](_0x0ef4('0x9f'));_0x421897['field'](_0x0ef4('0xa0'));_0x421897[_0x0ef4('0x48')](_0x0ef4('0xa1'));_0x421897['field'](_0x0ef4('0xa2'));_0x421897['field'](_0x0ef4('0xa3'));_0x421897[_0x0ef4('0x48')](_0x0ef4('0xa4'));_0x421897['field'](_0x0ef4('0xa5'));_0x421897[_0x0ef4('0x48')](_0x0ef4('0xa6'));_0x421897[_0x0ef4('0x48')](_0x0ef4('0xa7'));_0x421897[_0x0ef4('0x48')](_0x0ef4('0xa8'));_0x421897[_0x0ef4('0x48')](_0x0ef4('0xa9'));_0x421897[_0x0ef4('0x48')](_0x0ef4('0xaa'));_0x421897['field'](_0x0ef4('0xab'));_0x421897['field'](_0x0ef4('0x6e'),'Contact.firstName');_0x421897['field'](_0x0ef4('0x70'),_0x0ef4('0xac'));_0x421897[_0x0ef4('0x48')](_0x0ef4('0x71'),_0x0ef4('0xad'));_0x421897[_0x0ef4('0x48')](_0x0ef4('0xae'),_0x0ef4('0xaf'));_0x421897['field']('c.mobile',_0x0ef4('0xb0'));_0x421897[_0x0ef4('0x48')](_0x0ef4('0xb1'),_0x0ef4('0xb2'));_0x421897[_0x0ef4('0x48')](_0x0ef4('0xb3'),'TagIds');_0x421897[_0x0ef4('0x54')](_0x0ef4('0x95'),'it','it.MailInteractionId\x20=\x20i.id');_0x421897[_0x0ef4('0x54')]('tools_tags','t',_0x0ef4('0x97'));_0x421897[_0x0ef4('0x24')](_0x1e0aeb[_0x0ef4('0x24')]);_0x421897[_0x0ef4('0x23')](_0x1e0aeb[_0x0ef4('0x23')]);return db[_0x0ef4('0x99')]['query'](_0x421897[_0x0ef4('0x9a')](),_0x4f54f4);})[_0x0ef4('0x2a')](function(_0x30cfcf){_0x84ed12[_0x0ef4('0x4f')](_0x0ef4('0xb4'),_[_0x0ef4('0x30')](_0x30cfcf,'id'));return db[_0x0ef4('0x99')][_0x0ef4('0x3e')](_0x84ed12['toString'](),_0x4f54f4)['then'](function(_0x56207d){var _0x437ff3=_[_0x0ef4('0xb5')](_0x56207d,_0x0ef4('0xb6'));var _0x3ebc68=[];return db['Setting'][_0x0ef4('0x36')]({'attributes':[_0x0ef4('0xb7')],'raw':!![]})['then'](function(_0x26c021){var _0x15a2b7=_0x26c021[_0x0ef4('0xb7')];_0x30cfcf['forEach'](function(_0x439ed4){_0x3ebc68[_0x0ef4('0x34')](updateMailInteraction(_0x439ed4,_0x2e493b,_0x437ff3,_0x15a2b7));});return BPromise[_0x0ef4('0xb8')](_0x3ebc68);});});});})[_0x0ef4('0x2a')](function(_0x342016){_0x21143d[_0x0ef4('0xb9')]=_0x342016;return _0x21143d;})[_0x0ef4('0x2a')](respondWithFilteredResult(_0x576b24,_0x1e0aeb))[_0x0ef4('0x3a')](handleError(_0x576b24,null));};exports['show']=function(_0x5d2bfe,_0xf9757d){var _0x357e26={'raw':![],'where':{'id':_0x5d2bfe[_0x0ef4('0xba')]['id']}},_0x430cff={};_0x430cff['model']=_[_0x0ef4('0x5d')](db[_0x0ef4('0x35')]['rawAttributes']);_0x430cff[_0x0ef4('0x3e')]=_[_0x0ef4('0x5d')](_0x5d2bfe[_0x0ef4('0x3e')]);_0x430cff[_0x0ef4('0x45')]=_[_0x0ef4('0x3f')](_0x430cff[_0x0ef4('0x3d')],_0x430cff['query']);_0x357e26[_0x0ef4('0x40')]=_['intersection'](_0x430cff[_0x0ef4('0x3d')],qs[_0x0ef4('0x41')](_0x5d2bfe[_0x0ef4('0x3e')][_0x0ef4('0x41')]));_0x357e26[_0x0ef4('0x40')]=_0x357e26['attributes'][_0x0ef4('0x42')]?_0x357e26['attributes']:_0x430cff[_0x0ef4('0x3d')];if(_0x5d2bfe[_0x0ef4('0x3e')][_0x0ef4('0xbb')]){_0x357e26[_0x0ef4('0xbc')]=[{'all':!![]}];}_0x357e26=_[_0x0ef4('0x9c')]({},_0x357e26,_0x5d2bfe['options']);return db[_0x0ef4('0x35')]['find'](_0x357e26)[_0x0ef4('0x2a')](handleEntityNotFound(_0xf9757d,null))[_0x0ef4('0x2a')](respondWithResult(_0xf9757d,null))[_0x0ef4('0x3a')](handleError(_0xf9757d,null));};exports[_0x0ef4('0xbd')]=function(_0x479b5a,_0x5985c5){return db[_0x0ef4('0x35')][_0x0ef4('0xbd')](_0x479b5a[_0x0ef4('0xbe')],{})[_0x0ef4('0x2a')](respondWithResult(_0x5985c5,0xc9))[_0x0ef4('0x3a')](handleError(_0x5985c5,null));};exports[_0x0ef4('0x28')]=function(_0x3f1a1f,_0x3aaa4b){if(_0x3f1a1f[_0x0ef4('0xbe')]['id']){delete _0x3f1a1f[_0x0ef4('0xbe')]['id'];}return db[_0x0ef4('0x35')][_0x0ef4('0xbf')]({'where':{'id':_0x3f1a1f['params']['id']}})['then'](handleEntityNotFound(_0x3aaa4b,null))['then'](saveUpdates(_0x3f1a1f[_0x0ef4('0xbe')],null))[_0x0ef4('0x2a')](respondWithResult(_0x3aaa4b,null))[_0x0ef4('0x3a')](handleError(_0x3aaa4b,null));};exports[_0x0ef4('0x29')]=function(_0xa78174,_0x23d875){return db[_0x0ef4('0x35')][_0x0ef4('0xbf')]({'where':{'id':_0xa78174[_0x0ef4('0xba')]['id']}})['then'](handleEntityNotFound(_0x23d875,null))['then'](removeEntity(_0x23d875,null))[_0x0ef4('0x3a')](handleError(_0x23d875,null));};exports['describe']=function(_0x1ff628,_0x3ae0fa){return db[_0x0ef4('0x35')][_0x0ef4('0xc0')]()[_0x0ef4('0x2a')](respondWithResult(_0x3ae0fa,null))['catch'](handleError(_0x3ae0fa,null));};exports[_0x0ef4('0xc1')]=function(_0xd57895,_0x1dcd5c,_0x297a39){return db[_0x0ef4('0xc2')][_0x0ef4('0xbf')]({'where':{'id':_0xd57895[_0x0ef4('0xba')]['id']}})['then'](handleEntityNotFound(_0x1dcd5c,null))[_0x0ef4('0x2a')](function(_0x19c43c){if(_0x19c43c){return _0x19c43c[_0x0ef4('0xc1')](_0xd57895['body'][_0x0ef4('0xc3')],_['omit'](_0xd57895[_0x0ef4('0xbe')],['ids','id'])||{});}})[_0x0ef4('0x2a')](respondWithResult(_0x1dcd5c,null))[_0x0ef4('0x3a')](handleError(_0x1dcd5c,null));};exports[_0x0ef4('0xc4')]=function(_0x429183,_0x48501d,_0x193521){var _0x4bd60d={'raw':![],'where':{}};var _0x1abc3f={};var _0xe99ce4={'count':0x0,'rows':[]};return db['MailInteraction'][_0x0ef4('0x36')]({'where':{'id':_0x429183[_0x0ef4('0xba')]['id']}})[_0x0ef4('0x2a')](handleEntityNotFound(_0x48501d,null))[_0x0ef4('0x2a')](function(_0x5eaa8a){if(_0x5eaa8a){_0x1abc3f[_0x0ef4('0x3d')]=_[_0x0ef4('0x5d')](db['MailMessage']['rawAttributes']);_0x1abc3f[_0x0ef4('0x3e')]=_[_0x0ef4('0x5d')](_0x429183[_0x0ef4('0x3e')]);_0x1abc3f['filters']=_['intersection'](_0x1abc3f['model'],_0x1abc3f[_0x0ef4('0x3e')]);_0x4bd60d['attributes']=_[_0x0ef4('0x3f')](_0x1abc3f[_0x0ef4('0x3d')],qs[_0x0ef4('0x41')](_0x429183[_0x0ef4('0x3e')][_0x0ef4('0x41')]));_0x4bd60d[_0x0ef4('0x40')]=_0x4bd60d[_0x0ef4('0x40')][_0x0ef4('0x42')]?_0x4bd60d[_0x0ef4('0x40')]:_0x1abc3f[_0x0ef4('0x3d')];if(!_0x429183[_0x0ef4('0x3e')][_0x0ef4('0x43')](_0x0ef4('0xc5'))){_0x4bd60d[_0x0ef4('0x24')]=qs[_0x0ef4('0x24')](_0x429183[_0x0ef4('0x3e')][_0x0ef4('0x24')]);_0x4bd60d[_0x0ef4('0x23')]=qs[_0x0ef4('0x23')](_0x429183[_0x0ef4('0x3e')]['offset']);}_0x4bd60d[_0x0ef4('0x87')]=qs['sort'](_0x429183[_0x0ef4('0x3e')]['sort']);_0x4bd60d[_0x0ef4('0x4f')]=qs[_0x0ef4('0x45')](_['pick'](_0x429183['query'],_0x1abc3f[_0x0ef4('0x45')]));_0x4bd60d[_0x0ef4('0x4f')]['MailInteractionId']=_0x5eaa8a['id'];if(_0x429183[_0x0ef4('0x3e')][_0x0ef4('0x77')]){_0x4bd60d[_0x0ef4('0x4f')]=_[_0x0ef4('0x9c')](_0x4bd60d[_0x0ef4('0x4f')],{'$or':_['map'](_0x4bd60d['attributes'],function(_0x54a532){var _0x7566a2={};_0x7566a2[_0x54a532]={'$like':'%'+_0x429183[_0x0ef4('0x3e')][_0x0ef4('0x77')]+'%'};return _0x7566a2;})});}if(_0x429183[_0x0ef4('0x3e')]['$gte']){var _0x4fc2ca=_0x429183[_0x0ef4('0x3e')][_0x0ef4('0x7b')][_0x0ef4('0x84')](',');var _0x5da371={};_0x5da371[_0x4fc2ca[0x0]]={'$gte':moment(_0x4fc2ca[0x1])[_0x0ef4('0x65')](_0x0ef4('0xc6'))};_0x4bd60d[_0x0ef4('0x4f')]=_[_0x0ef4('0x9c')](_0x4bd60d[_0x0ef4('0x4f')],_0x5da371);}_0x4bd60d=_[_0x0ef4('0x9c')]({},_0x4bd60d,_0x429183[_0x0ef4('0xc7')]);return db['MailMessage'][_0x0ef4('0x22')]({'where':_0x4bd60d[_0x0ef4('0x4f')]})['then'](function(_0x4229b4){_0xe99ce4[_0x0ef4('0x22')]=_0x4229b4;if(_0x429183['query'][_0x0ef4('0xbb')]){_0x4bd60d[_0x0ef4('0xbc')]=[{'all':!![]}];}return db['MailMessage'][_0x0ef4('0xc8')](_0x4bd60d);})[_0x0ef4('0x2a')](function(_0x2f5d39){_0xe99ce4['rows']=_0x2f5d39;return _0xe99ce4;});}})[_0x0ef4('0x2a')](respondWithFilteredResult(_0x48501d,_0x4bd60d))[_0x0ef4('0x3a')](handleError(_0x48501d,null));};exports[_0x0ef4('0xc9')]=function(_0x1c7b3a,_0x2ea778,_0x15d118){return db[_0x0ef4('0x35')][_0x0ef4('0xbf')]({'where':{'id':_0x1c7b3a[_0x0ef4('0xba')]['id']}})[_0x0ef4('0x2a')](handleEntityNotFound(_0x2ea778,null))[_0x0ef4('0x2a')](function(_0x419fa1){if(_0x419fa1){return _0x419fa1['setTags'](_0x1c7b3a[_0x0ef4('0xbe')][_0x0ef4('0xc3')],_[_0x0ef4('0xca')](_0x1c7b3a[_0x0ef4('0xbe')],[_0x0ef4('0xc3'),'id'])||{})['spread'](function(){return db[_0x0ef4('0xcb')]['findAll']({'attributes':['id',_0x0ef4('0x2d'),_0x0ef4('0x49')],'where':{'id':_0x1c7b3a[_0x0ef4('0xbe')][_0x0ef4('0xc3')]}});})[_0x0ef4('0x2a')](function(_0x9d82cc){socket[_0x0ef4('0xcc')](_0x0ef4('0xcd'),{'id':Number(_0x1c7b3a[_0x0ef4('0xba')]['id']),'tags':_0x9d82cc||[]});return{'id':Number(_0x1c7b3a[_0x0ef4('0xba')]['id']),'tags':_0x9d82cc||[]};});}})['then'](respondWithResult(_0x2ea778,null))[_0x0ef4('0x3a')](handleError(_0x2ea778,null));};exports['removeTags']=function(_0x2b76fb,_0x3fac74,_0x5ba911){return db['MailInteraction'][_0x0ef4('0xbf')]({'where':{'id':_0x2b76fb['params']['id']}})[_0x0ef4('0x2a')](handleEntityNotFound(_0x3fac74,null))[_0x0ef4('0x2a')](function(_0x5778c7){if(_0x5778c7){return _0x5778c7[_0x0ef4('0xce')](_0x2b76fb[_0x0ef4('0x3e')][_0x0ef4('0xc3')]);}})[_0x0ef4('0x2a')](respondWithStatusCode(_0x3fac74,null))[_0x0ef4('0x3a')](handleError(_0x3fac74,null));};exports['download']=function(_0x357ae1,_0x1b55fe){var _0x1881de=moment()[_0x0ef4('0xcf')]()[_0x0ef4('0x9a')]();var _0x1ca188=path[_0x0ef4('0x85')](config['root'],_0x0ef4('0xd0'),_0x0ef4('0xd1'),'attachments');var _0x21323c=path[_0x0ef4('0x85')](config['root'],'server',_0x0ef4('0xd1'),_0x0ef4('0xd2'));var _0x46f7d6=path[_0x0ef4('0x85')](_0x21323c,_0x1881de);var _0x1f858a=util['format'](_0x0ef4('0xd3'),_0x1881de);var _0x6a141b=path[_0x0ef4('0x85')](_0x21323c,_0x1f858a);var _0x116d2f=![];return db[_0x0ef4('0x35')][_0x0ef4('0xbf')]({'where':{'id':_0x357ae1[_0x0ef4('0xba')]['id']}})[_0x0ef4('0x2a')](handleEntityNotFound(_0x1b55fe,null))['then'](function(_0x4fe7da){if(_0x4fe7da){return _0x4fe7da[_0x0ef4('0xc4')]({'attributes':['id',_0x0ef4('0xbe'),_0x0ef4('0x4a'),'to','cc','bcc',_0x0ef4('0xd4'),_0x0ef4('0x5e')],'where':{'secret':![]},'include':_0x357ae1[_0x0ef4('0x3e')][_0x0ef4('0xd5')]?[{'model':db[_0x0ef4('0xd6')],'as':_0x0ef4('0xd7')}]:undefined,'order':qs[_0x0ef4('0x44')]('id')});}return[];})['then'](function(_0x1f4953){_0x116d2f=_0x1f4953[_0x0ef4('0x42')];if(_0x1f4953[_0x0ef4('0x42')]){fs[_0x0ef4('0xd8')](_0x46f7d6);return BPromise[_0x0ef4('0xd9')](_0x1f4953,function(_0x2fcfcf,_0xbf61bc){var _0x52f7d3=_0x2fcfcf;var _0x21a9a7={'from':_0x52f7d3[_0x0ef4('0x4a')],'to':_0x52f7d3['to'],'subject':_0x52f7d3[_0x0ef4('0xd4')],'html':_0x52f7d3[_0x0ef4('0xbe')],'headers':{'Date':moment(_0x52f7d3['createdAt'])[_0x0ef4('0x65')](_0x0ef4('0xda'))},'attachments':[]};if(_0x2fcfcf['cc']){_0x21a9a7[_0x0ef4('0xdb')]['Cc']=_0x2fcfcf['cc'];}if(_0x2fcfcf[_0x0ef4('0xdc')]){_0x21a9a7[_0x0ef4('0xdb')]['Bcc']=_0x2fcfcf['bcc'];}return new BPromise(function(_0x5b0050,_0x3c3e1e){if(_0x2fcfcf[_0x0ef4('0xd7')]){for(var _0x3580f7=0x0;_0x3580f7<_0x2fcfcf[_0x0ef4('0xd7')][_0x0ef4('0x42')];_0x3580f7++){var _0x2069cd=_0x2fcfcf['Attachments'][_0x3580f7];var _0x3c5827=path[_0x0ef4('0x85')](_0x1ca188,_0x2069cd[_0x0ef4('0xdd')]);if(fs[_0x0ef4('0xde')](_0x3c5827)){_0x21a9a7['attachments']['push']({'name':_0x2069cd[_0x0ef4('0x2d')],'contentType':_0x2069cd['type'],'data':fs['readFileSync'](_0x3c5827)});}}}emlformat['build'](_0x21a9a7,function(_0x49fa9e,_0x3ca3d8){if(_0x49fa9e)return _0x3c3e1e(_0x49fa9e);fs['writeFileSync'](path['join'](_0x46f7d6,util[_0x0ef4('0x65')](_0x0ef4('0xdf'),_0xbf61bc)),_0x3ca3d8);return _0x5b0050(_0x3ca3d8);});});});}})[_0x0ef4('0x2a')](function(){if(_0x116d2f){return new BPromise(function(_0x1c5528,_0x3732ea){zipdir(_0x46f7d6,{'saveTo':_0x6a141b},function(_0x69c816,_0x3d54e6){if(_0x69c816)return _0x3732ea(_0x69c816);return _0x1c5528(_0x3d54e6);});});}})[_0x0ef4('0x2a')](function(){if(_0x116d2f){return new BPromise(function(_0x5ab94b,_0x34ebc4){rimraf(_0x46f7d6,function(_0x222c54){if(_0x222c54)_0x34ebc4(_0x222c54);return _0x5ab94b();});});}})['then'](function(){if(_0x116d2f){return _0x1b55fe[_0x0ef4('0xe0')](_0x6a141b,_0x1f858a,function(_0x36a52f){if(_0x36a52f){console['log'](_0x0ef4('0xe1'),_0x36a52f);}else{fs[_0x0ef4('0xe2')](_0x6a141b);}});}else{return _0x1b55fe[_0x0ef4('0x1f')](0xc8);}})['catch'](handleError(_0x1b55fe,null));}; \ No newline at end of file +var _0x3529=['c.email','\x20>\x20?','\x20<\x20?','\x20IN\x20?','LIKE','c.firstName','filter','isNil','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','$gte','$lte','null','\x20IS\x20NULL','replace','\x27\x27\x27\x27','isNumeric','isEmail','split','push','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','SELECT','clone','COUNT(me.id)','read','`unreadMessages`\x20=\x200','having','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','t.id\x20=\x20it.TagId','sequelize','keyBy','merge','a.key','Account.key','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.substatus','i.ContactId','i.MailAccountId','i.UserId','Contact.firstName','Contact.lastName','Contact.email','c.phone','c.mobile','c.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','Setting','enableEmailPreview','all','rows','rawAttributes','include','options','find','create','body','params','describe','addMessage','ids','omit','MailInteractionId','YYYY-MM-DD\x20HH:mm:ss','MailMessage','includeAll','findAll','setTags','spread','Tag','color','mailInteractionTags:save','removeTags','download','unix','root','server','files','tmp','interaction-%s.zip','getMessages','subject','attachments','Attachments','mkdirSync','each','headers','bcc','Bcc','basename','existsSync','type','readFileSync','build','message%d.eml','log','err','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','html-to-text','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./mailInteraction.socket','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','error','name','Users','map','TagIds','Tags','forEach','MailInteraction','findOne','lastMsgText','trimStart','fromString','lastMsgBody','catch','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','tools_tags','COUNT(*)','from','me.MailInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.MailInteractionId','user_has_mail_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.MailAccountId','mail_messages','me.MailInteractionId\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','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','unreadMessages','isArray','tableAlias','\x20=\x20?','ContactId','\x20LIKE\x20?','c.lastName'];(function(_0x38bc38,_0x374b3d){var _0x3109ca=function(_0x3b2e6f){while(--_0x3b2e6f){_0x38bc38['push'](_0x38bc38['shift']());}};_0x3109ca(++_0x374b3d);}(_0x3529,0x76));var _0x9352=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x3529[_0x2064e5];return _0x21a233;};'use strict';var pdf=require(_0x9352('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9352('0x1'));var jsonpatch=require(_0x9352('0x2'));var rp=require(_0x9352('0x3'));var moment=require(_0x9352('0x4'));var BPromise=require(_0x9352('0x5'));var Mustache=require('mustache');var util=require(_0x9352('0x6'));var path=require(_0x9352('0x7'));var sox=require(_0x9352('0x8'));var csv=require(_0x9352('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x9352('0xa'));var crypto=require(_0x9352('0xb'));var jsforce=require(_0x9352('0xc'));var deskjs=require(_0x9352('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9352('0xe'));var htmlToText=require(_0x9352('0xf'));var Redis=require(_0x9352('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9352('0x11'));var hardwareService=require(_0x9352('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x9352('0x13'));var config=require(_0x9352('0x14'));var db=require(_0x9352('0x15'))['db'];config['redis']=_[_0x9352('0x16')](config['redis'],{'host':_0x9352('0x17'),'port':0x18eb});var socket=require(_0x9352('0x18'))(new Redis(config[_0x9352('0x19')]));require(_0x9352('0x1a'))['register'](socket);function respondWithStatusCode(_0x226d3a,_0x890ada){_0x890ada=_0x890ada||0xcc;return function(_0x35c8e2){if(_0x35c8e2){return _0x226d3a[_0x9352('0x1b')](_0x890ada);}return _0x226d3a[_0x9352('0x1c')](_0x890ada)['end']();};}function respondWithResult(_0x192627,_0x23b4ce){_0x23b4ce=_0x23b4ce||0xc8;return function(_0x3170b3){if(_0x3170b3){return _0x192627['status'](_0x23b4ce)[_0x9352('0x1d')](_0x3170b3);}};}function respondWithFilteredResult(_0x35b6a3,_0x30a1c5){return function(_0x3e6017){if(_0x3e6017){var _0x3b495c=_0x3e6017[_0x9352('0x1e')],_0x2adb71=_0x30a1c5[_0x9352('0x1f')],_0x14f36a=_0x30a1c5['offset']+_0x30a1c5[_0x9352('0x20')],_0x40edf0;if(_0x14f36a>=_0x3b495c){_0x14f36a=_0x3b495c;_0x40edf0=0xc8;}else{_0x40edf0=0xce;}_0x35b6a3[_0x9352('0x1c')](_0x40edf0);return _0x35b6a3[_0x9352('0x21')](_0x9352('0x22'),_0x2adb71+'-'+_0x14f36a+'/'+_0x3b495c)[_0x9352('0x1d')](_0x3e6017);}return null;};}function patchUpdates(_0x59109a){return function(_0x5d66dc){try{jsonpatch[_0x9352('0x23')](_0x5d66dc,_0x59109a,!![]);}catch(_0x2a04e3){return BPromise['reject'](_0x2a04e3);}return _0x5d66dc[_0x9352('0x24')]();};}function saveUpdates(_0x5b5804,_0x4d9cf5){return function(_0x5cc416){if(_0x5cc416){return _0x5cc416[_0x9352('0x25')](_0x5b5804)[_0x9352('0x26')](function(_0x57dd54){return _0x57dd54;});}return null;};}function removeEntity(_0x32a1cc,_0x252a39){return function(_0x294a1b){if(_0x294a1b){return _0x294a1b[_0x9352('0x27')]()[_0x9352('0x26')](function(){_0x32a1cc[_0x9352('0x1c')](0xcc)[_0x9352('0x28')]();});}};}function handleEntityNotFound(_0x1c2474,_0x5105ea){return function(_0x35bf0f){if(!_0x35bf0f){_0x1c2474[_0x9352('0x1b')](0x194);}return _0x35bf0f;};}function handleError(_0x2f6b2a,_0x242e9a){_0x242e9a=_0x242e9a||0x1f4;return function(_0x896d05){logger[_0x9352('0x29')](_0x896d05['stack']);if(_0x896d05['name']){delete _0x896d05[_0x9352('0x2a')];}_0x2f6b2a[_0x9352('0x1c')](_0x242e9a)['send'](_0x896d05);};}function getInteractionUsers(_0x4eb83b,_0x56a60f){return new BPromise(function(_0x59fdfe,_0x55f178){try{if(_0x56a60f[_0x4eb83b['id']]){_0x4eb83b[_0x9352('0x2b')]=_[_0x9352('0x2c')](_0x56a60f[_0x4eb83b['id']],function(_0x4be87f){return{'id':_0x4be87f['id']};});}}catch(_0x42dbaa){_0x55f178(_0x42dbaa);}_0x59fdfe(_0x4eb83b);});}function getInteractionTags(_0xce0d0e,_0x3d2356){return new BPromise(function(_0x4a666a,_0x58250e){try{if(_0xce0d0e[_0x9352('0x2d')]){_0xce0d0e[_0x9352('0x2e')]=[];_0xce0d0e[_0x9352('0x2d')]['split'](',')[_0x9352('0x2f')](function(_0x462e86){_0xce0d0e[_0x9352('0x2e')]['push'](_0x3d2356[_0x462e86]);});}delete _0xce0d0e['TagIds'];}catch(_0x2df2a8){_0x58250e(_0x2df2a8);}_0x4a666a(_0xce0d0e);});}function getLastMessageText(_0x371ad2){return new BPromise(function(_0x3bb2b9,_0x4edaf1){return db[_0x9352('0x30')][_0x9352('0x31')]({'where':{'id':_0x371ad2['id']},'attributes':['lastMsgBody','lastMsgText'],'raw':!![]})[_0x9352('0x26')](function(_0x29ed41){if(!_0x29ed41[_0x9352('0x32')]){_0x371ad2['lastMsgText']=_[_0x9352('0x33')](htmlToText[_0x9352('0x34')](_0x29ed41[_0x9352('0x35')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x371ad2[_0x9352('0x32')]=_0x29ed41[_0x9352('0x32')];}_0x3bb2b9(_0x371ad2);})['catch'](function(_0x577738){_0x4edaf1(_0x577738);});});}function updateMailInteraction(_0x17e4db,_0x315c53,_0x545d31,_0x5a34f8){return new BPromise(function(_0xfe5b52,_0x5dc059){return getInteractionUsers(_0x17e4db,_0x545d31)['then'](function(_0x5e9a96){return getInteractionTags(_0x5e9a96,_0x315c53);})[_0x9352('0x26')](function(_0xd43b03){if(_0x5a34f8){_0xfe5b52(getLastMessageText(_0xd43b03));}else{_0xfe5b52(_0xd43b03);}})[_0x9352('0x36')](function(_0x2fff03){_0x5dc059(_0x2fff03);});});}exports['index']=function(_0x2c48d5,_0x15a65f){var _0x445134={},_0x4bbbe2={},_0x5c68f1={'count':0x0,'rows':[]};var _0x228b89=db[_0x9352('0x30')]['rawAttributes'];_0x4bbbe2[_0x9352('0x37')]=_['keys'](_0x228b89);_0x4bbbe2[_0x9352('0x38')]=_['keys'](_0x2c48d5[_0x9352('0x38')]);_0x4bbbe2['filters']=_['intersection'](_0x4bbbe2['model'],_0x4bbbe2[_0x9352('0x38')]);_0x445134[_0x9352('0x39')]=_[_0x9352('0x3a')](_0x4bbbe2[_0x9352('0x37')],qs[_0x9352('0x3b')](_0x2c48d5[_0x9352('0x38')]['fields']));_0x445134[_0x9352('0x39')]=_0x445134[_0x9352('0x39')][_0x9352('0x3c')]?_0x445134['attributes']:_0x4bbbe2[_0x9352('0x37')];if(!_0x2c48d5[_0x9352('0x38')][_0x9352('0x3d')](_0x9352('0x3e'))){_0x445134[_0x9352('0x20')]=qs[_0x9352('0x20')](_0x2c48d5['query'][_0x9352('0x20')]);_0x445134['offset']=qs[_0x9352('0x1f')](_0x2c48d5[_0x9352('0x38')][_0x9352('0x1f')]);}_0x445134[_0x9352('0x3f')]=qs[_0x9352('0x40')](_0x2c48d5['query'][_0x9352('0x40')]);_0x445134[_0x9352('0x41')]=qs[_0x9352('0x42')](_[_0x9352('0x43')](_0x2c48d5[_0x9352('0x38')],_0x4bbbe2[_0x9352('0x42')]));var _0x30deea=[];var _0x1dc721=squel[_0x9352('0x44')]()['field']('id')[_0x9352('0x45')](_0x9352('0x2a'))['field']('color')['from'](_0x9352('0x46'));var _0x37100d=squel['select']()[_0x9352('0x45')](_0x9352('0x47'))[_0x9352('0x48')]('mail_messages','me')[_0x9352('0x41')](_0x9352('0x49'))['where'](_0x9352('0x4a'))[_0x9352('0x41')](_0x9352('0x4b'));var _0x5188d3=squel[_0x9352('0x44')]()['field'](_0x9352('0x4c'))['field'](_0x9352('0x4d'))[_0x9352('0x48')](_0x9352('0x4e'),'ui')[_0x9352('0x4f')](_0x9352('0x50'),'u','u.id\x20=\x20ui.UserId');var _0x565fa=squel[_0x9352('0x44')]()[_0x9352('0x48')]('mail_interactions','i')[_0x9352('0x4f')](_0x9352('0x51'),'c',_0x9352('0x52'))[_0x9352('0x4f')]('users','o',_0x9352('0x53'))[_0x9352('0x4f')]('mail_accounts','a',_0x9352('0x54'))[_0x9352('0x4f')](_0x9352('0x55'),'me',_0x9352('0x56'));var _0x4c96de=squel[_0x9352('0x57')]();if(_0x2c48d5[_0x9352('0x38')][_0x9352('0x58')]){var _0xfe7af8=JSON[_0x9352('0x59')](_0x2c48d5['query'][_0x9352('0x58')]);_[_0x9352('0x5a')](_0xfe7af8)[_0x9352('0x2f')](function(_0x3a7959){var _0x25f4d0=_0xfe7af8[_0x3a7959];if(_0x3a7959===_0x9352('0x5b')){var _0x3c0370=moment(_0x25f4d0[_0x9352('0x5c')][_0x9352('0x5d')])[_0x9352('0x5e')](_0x9352('0x5f'))[_0x9352('0x60')]()[_0x9352('0x61')]();var _0x528deb=moment(_0x528deb)[_0x9352('0x60')]()[_0x9352('0x62')](_0x9352('0x5f'))[_0x9352('0x61')]();_0x4c96de[_0x9352('0x63')](_0x9352('0x64'),_0x3c0370,_0x528deb);}else{if(_['isArray'](_0x25f4d0[_0x9352('0x65')])){_0x25f4d0[_0x9352('0x65')]['forEach'](function(_0x50273f){switch(_0x25f4d0[_0x9352('0x65')][_0x9352('0x5c')]){case'IS':if(_0x3a7959!=='TagId'&&_0x3a7959!==_0x9352('0x66')){if(_[_0x9352('0x67')](_0x25f4d0[_0x9352('0x5c')])&&_0x25f4d0[_0x9352('0x5c')][_0x9352('0x3c')]>0x1){_0x4c96de[_0x9352('0x63')](_0x25f4d0[_0x9352('0x68')]+'.'+_0x3a7959+'\x20IN\x20?',_0x25f4d0['value']);}else{_0x4c96de['and'](_0x25f4d0[_0x9352('0x68')]+'.'+_0x3a7959+_0x9352('0x69'),_0x25f4d0[_0x9352('0x5c')][0x0]);}}break;case'=':_0x4c96de[_0x9352('0x63')](_0x25f4d0[_0x9352('0x68')]+'.'+_0x3a7959+_0x9352('0x69'),_0x25f4d0[_0x9352('0x5c')]);break;case'LIKE':if(_0x3a7959===_0x9352('0x6a')){_0x4c96de[_0x9352('0x63')]('c.firstName'+_0x9352('0x6b'),'%'+_0x25f4d0[_0x9352('0x5c')]+'%');_0x4c96de['or'](_0x9352('0x6c')+_0x9352('0x6b'),'%'+_0x25f4d0['value']+'%');_0x4c96de['or'](_0x9352('0x6d')+_0x9352('0x6b'),'%'+_0x25f4d0[_0x9352('0x5c')]+'%');}else{_0x4c96de[_0x9352('0x63')](_0x25f4d0[_0x9352('0x68')]+'.'+_0x3a7959+_0x9352('0x6b'),'%'+_0x25f4d0[_0x9352('0x5c')]+'%');}break;case'>':_0x4c96de[_0x9352('0x63')](_0x25f4d0['tableAlias']+'.'+_0x3a7959+_0x9352('0x6e'),_0x25f4d0[_0x9352('0x5c')]);break;case'<':_0x4c96de[_0x9352('0x63')](_0x25f4d0['tableAlias']+'.'+_0x3a7959+_0x9352('0x6f'),_0x25f4d0[_0x9352('0x5c')]);break;}});}else{switch(_0x25f4d0[_0x9352('0x65')][_0x9352('0x5c')]){case'IS':if(_0x3a7959!=='TagId'&&_0x3a7959!==_0x9352('0x66')){if(_['isArray'](_0x25f4d0[_0x9352('0x5c')])&&_0x25f4d0['value'][_0x9352('0x3c')]>0x1){_0x4c96de['and'](_0x25f4d0[_0x9352('0x68')]+'.'+_0x3a7959+_0x9352('0x70'),_0x25f4d0[_0x9352('0x5c')]);}else{_0x4c96de[_0x9352('0x63')](_0x25f4d0['tableAlias']+'.'+_0x3a7959+_0x9352('0x69'),_0x25f4d0[_0x9352('0x5c')][0x0]);}}break;case'=':_0x4c96de[_0x9352('0x63')](_0x25f4d0['tableAlias']+'.'+_0x3a7959+'\x20=\x20?',_0x25f4d0[_0x9352('0x5c')]);break;case _0x9352('0x71'):if(_0x3a7959===_0x9352('0x6a')){_0x4c96de[_0x9352('0x63')](_0x9352('0x72')+_0x9352('0x6b'),'%'+_0x25f4d0['value']+'%');_0x4c96de['or'](_0x9352('0x6c')+_0x9352('0x6b'),'%'+_0x25f4d0[_0x9352('0x5c')]+'%');_0x4c96de['or']('c.email'+_0x9352('0x6b'),'%'+_0x25f4d0[_0x9352('0x5c')]+'%');}else{_0x4c96de[_0x9352('0x63')](_0x25f4d0[_0x9352('0x68')]+'.'+_0x3a7959+'\x20LIKE\x20?','%'+_0x25f4d0[_0x9352('0x5c')]+'%');}break;case'>':_0x4c96de[_0x9352('0x63')](_0x25f4d0[_0x9352('0x68')]+'.'+_0x3a7959+_0x9352('0x6e'),_0x25f4d0[_0x9352('0x5c')]);break;case'<':_0x4c96de[_0x9352('0x63')](_0x25f4d0[_0x9352('0x68')]+'.'+_0x3a7959+'\x20<\x20?',_0x25f4d0[_0x9352('0x5c')]);break;}}}});}else{var _0x33debe=_(Object['keys'](_0x2c48d5[_0x9352('0x38')]))[_0x9352('0x2c')](function(_0x218035){return _0x228b89[_0x9352('0x3d')](_0x218035)?_0x218035:undefined;})[_0x9352('0x73')](function(_0x478f3d){return!_[_0x9352('0x74')](_0x478f3d);})['value']();if(!_[_0x9352('0x75')](_0x33debe)){_0x33debe[_0x9352('0x2f')](function(_0x41106a){if(_0x41106a===_0x9352('0x76')){_0x565fa[_0x9352('0x41')](_0x9352('0x77'),[][_0x9352('0x78')](_0x2c48d5[_0x9352('0x38')][_0x41106a]));}else if(_0x41106a===_0x9352('0x5b')){var _0x177384=JSON[_0x9352('0x59')](_0x2c48d5[_0x9352('0x38')][_0x41106a])[_0x9352('0x79')];var _0x3c5076=JSON['parse'](_0x2c48d5['query'][_0x41106a])[_0x9352('0x7a')];_0x565fa[_0x9352('0x41')](_0x9352('0x64'),_0x177384,_0x3c5076);}else{if(_0x2c48d5['query'][_0x41106a]===_0x9352('0x7b')){_0x565fa['where']('i.'+_0x41106a+_0x9352('0x7c'));}else{_0x565fa[_0x9352('0x41')]('i.'+_0x41106a+_0x9352('0x69'),_0x2c48d5[_0x9352('0x38')][_0x41106a]);}}});}if(_0x2c48d5[_0x9352('0x38')][_0x9352('0x73')]){var _0x14b86f=_0x2c48d5[_0x9352('0x38')][_0x9352('0x73')][_0x9352('0x7d')]('\x5c','\x5c\x5c')[_0x9352('0x7d')]('\x27\x27',_0x9352('0x7e'));if(qs[_0x9352('0x7f')](_0x14b86f)){_0x4c96de['or']('i.id\x20LIKE\x20?',_0x14b86f+'%');}else if(qs[_0x9352('0x80')](_0x14b86f)){_0x4c96de['or']('c.email\x20LIKE\x20?',_0x14b86f+'%');}else{var _0x3c95d9=[];_0x14b86f[_0x9352('0x81')]('\x20')['forEach'](function(_0xd740fa){_0x3c95d9[_0x9352('0x82')]('+'+_0xd740fa[_0x9352('0x83')]());});var _0x3c3b4c=_0x3c95d9[_0x9352('0x84')]('\x20');_0x4c96de['or'](_0x9352('0x85'),_0x3c3b4c)['or'](_0x9352('0x86'),_0x3c3b4c);}}}_0x565fa['where'](_0x4c96de);if(_0x445134[_0x9352('0x3f')]){_0x445134[_0x9352('0x3f')][_0x9352('0x2f')](function(_0x150e9a){_0x565fa[_0x9352('0x3f')]('i.'+_0x150e9a[0x0],_0x150e9a[0x1]===_0x9352('0x87')?![]:!![]);});}_0x565fa[_0x9352('0x88')](_0x9352('0x89'));var _0x3ae71c={'type':db[_0x9352('0x8a')]['QueryTypes'][_0x9352('0x8b')],'raw':!![]};var _0x56ab09=_0x565fa[_0x9352('0x8c')]()['field'](_0x9352('0x47'))[_0x9352('0x45')](_0x9352('0x8d'),_0x9352('0x66'));if(!_0x2c48d5[_0x9352('0x38')][_0x9352('0x58')]){if(_0x2c48d5[_0x9352('0x38')][_0x9352('0x8e')]){if(_0x2c48d5[_0x9352('0x38')][_0x9352('0x8e')]==0x1){_0x56ab09['having'](_0x9352('0x8f'));_0x565fa['having'](_0x9352('0x8f'));}else{_0x56ab09['having']('`unreadMessages`\x20>\x200');_0x565fa[_0x9352('0x90')](_0x9352('0x91'));}}if(_0x2c48d5[_0x9352('0x38')][_0x9352('0x92')]){var _0x56a70a=_[_0x9352('0x67')](_0x2c48d5['query']['tag'])?_0x2c48d5['query'][_0x9352('0x92')]:new Array(_0x2c48d5[_0x9352('0x38')][_0x9352('0x92')]);var _0x42c962=squel[_0x9352('0x57')]();_0x56a70a['forEach'](function(_0x142ffe){_0x42c962['or'](_0x9352('0x93'),'%,'+_0x142ffe+',%');});_0x565fa['having'](_0x42c962);_0x56ab09[_0x9352('0x4f')](_0x9352('0x94'),'it',_0x9352('0x95'));_0x56ab09[_0x9352('0x4f')](_0x9352('0x46'),'t','t.id\x20=\x20it.TagId');_0x56ab09['where'](_0x9352('0x96'),_0x56a70a);}}else{var _0xfe7af8=JSON[_0x9352('0x59')](_0x2c48d5['query'][_0x9352('0x58')]);_[_0x9352('0x5a')](_0xfe7af8)['forEach'](function(_0x429739){var _0x326bc5=_0xfe7af8[_0x429739];if(_0x429739==='TagId'){var _0x2b3eaf=_0x326bc5['value'];var _0x2d2b3a=squel[_0x9352('0x57')]();_0x2b3eaf[_0x9352('0x2f')](function(_0x57f06d){_0x2d2b3a['or'](_0x9352('0x93'),'%,'+_0x57f06d+',%');});_0x565fa[_0x9352('0x90')](_0x2d2b3a);_0x56ab09[_0x9352('0x4f')](_0x9352('0x94'),'it',_0x9352('0x95'));_0x56ab09['left_join'](_0x9352('0x46'),'t',_0x9352('0x97'));_0x56ab09['where'](_0x9352('0x96'),_0x2b3eaf);}else if(_0x429739===_0x9352('0x66')){if(_0x326bc5[_0x9352('0x5c')][_0x9352('0x3c')]===0x1){if(_0x326bc5['value'][0x0]===0x1){_0x56ab09['having'](_0x9352('0x8f'));_0x565fa['having'](_0x9352('0x8f'));}else{_0x56ab09[_0x9352('0x90')](_0x9352('0x91'));_0x565fa[_0x9352('0x90')](_0x9352('0x91'));}}}});}db[_0x9352('0x98')]['query'](_0x56ab09[_0x9352('0x83')](),_0x3ae71c)['then'](function(_0x49a076){_0x5c68f1[_0x9352('0x1e')]=_0x49a076[_0x9352('0x3c')];if(_0x5c68f1[_0x9352('0x1e')]===0x0)return[];return db[_0x9352('0x98')][_0x9352('0x38')](_0x1dc721[_0x9352('0x83')](),_0x3ae71c)[_0x9352('0x26')](function(_0x34d06e){_0x30deea=_[_0x9352('0x99')](_0x34d06e,'id');_0x3ae71c=_[_0x9352('0x9a')](_0x3ae71c,{'model':db[_0x9352('0x30')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x565fa[_0x9352('0x45')](_0x9352('0x8d'),_0x9352('0x66'));_0x565fa['field'](_0x9352('0x9b'),_0x9352('0x9c'));_0x565fa[_0x9352('0x45')](_0x9352('0x89'));_0x565fa[_0x9352('0x45')](_0x9352('0x9d'));_0x565fa[_0x9352('0x45')](_0x9352('0x9e'));_0x565fa[_0x9352('0x45')](_0x9352('0x9f'));_0x565fa[_0x9352('0x45')](_0x9352('0xa0'));_0x565fa['field'](_0x9352('0xa1'));_0x565fa[_0x9352('0x45')](_0x9352('0xa2'));_0x565fa[_0x9352('0x45')]('i.lastMsgDirection');_0x565fa[_0x9352('0x45')](_0x9352('0xa3'));_0x565fa[_0x9352('0x45')](_0x9352('0xa4'));_0x565fa['field'](_0x9352('0xa5'));_0x565fa['field']('i.to');_0x565fa['field'](_0x9352('0xa6'));_0x565fa[_0x9352('0x45')](_0x9352('0xa7'));_0x565fa[_0x9352('0x45')](_0x9352('0xa8'));_0x565fa[_0x9352('0x45')](_0x9352('0x72'),_0x9352('0xa9'));_0x565fa[_0x9352('0x45')](_0x9352('0x6c'),_0x9352('0xaa'));_0x565fa['field'](_0x9352('0x6d'),_0x9352('0xab'));_0x565fa[_0x9352('0x45')](_0x9352('0xac'),'Contact.phone');_0x565fa[_0x9352('0x45')](_0x9352('0xad'),'Contact.mobile');_0x565fa[_0x9352('0x45')](_0x9352('0xae'),'Contact.fax');_0x565fa['field'](_0x9352('0xaf'),'TagIds');_0x565fa['left_join'](_0x9352('0x94'),'it',_0x9352('0x95'));_0x565fa[_0x9352('0x4f')]('tools_tags','t',_0x9352('0x97'));_0x565fa[_0x9352('0x20')](_0x445134['limit']);_0x565fa[_0x9352('0x1f')](_0x445134[_0x9352('0x1f')]);return db[_0x9352('0x98')]['query'](_0x565fa[_0x9352('0x83')](),_0x3ae71c);})[_0x9352('0x26')](function(_0x1c61af){_0x5188d3['where'](_0x9352('0xb0'),_[_0x9352('0x2c')](_0x1c61af,'id'));return db[_0x9352('0x98')][_0x9352('0x38')](_0x5188d3[_0x9352('0x83')](),_0x3ae71c)['then'](function(_0x5e65e5){var _0x43cb5d=_['groupBy'](_0x5e65e5,'MailInteractionId');var _0x4a8145=[];return db[_0x9352('0xb1')][_0x9352('0x31')]({'attributes':[_0x9352('0xb2')],'raw':!![]})[_0x9352('0x26')](function(_0x3fc98d){var _0x86d3f3=_0x3fc98d[_0x9352('0xb2')];_0x1c61af['forEach'](function(_0x146edf){_0x4a8145[_0x9352('0x82')](updateMailInteraction(_0x146edf,_0x30deea,_0x43cb5d,_0x86d3f3));});return BPromise[_0x9352('0xb3')](_0x4a8145);});});});})[_0x9352('0x26')](function(_0x5818d8){_0x5c68f1[_0x9352('0xb4')]=_0x5818d8;return _0x5c68f1;})['then'](respondWithFilteredResult(_0x15a65f,_0x445134))[_0x9352('0x36')](handleError(_0x15a65f,null));};exports['show']=function(_0x38be23,_0xf0f8e6){var _0x5b2910={'raw':![],'where':{'id':_0x38be23['params']['id']}},_0x31e771={};_0x31e771['model']=_[_0x9352('0x5a')](db[_0x9352('0x30')][_0x9352('0xb5')]);_0x31e771[_0x9352('0x38')]=_[_0x9352('0x5a')](_0x38be23[_0x9352('0x38')]);_0x31e771[_0x9352('0x42')]=_['intersection'](_0x31e771[_0x9352('0x37')],_0x31e771['query']);_0x5b2910[_0x9352('0x39')]=_[_0x9352('0x3a')](_0x31e771[_0x9352('0x37')],qs[_0x9352('0x3b')](_0x38be23[_0x9352('0x38')][_0x9352('0x3b')]));_0x5b2910[_0x9352('0x39')]=_0x5b2910['attributes']['length']?_0x5b2910['attributes']:_0x31e771[_0x9352('0x37')];if(_0x38be23['query']['includeAll']){_0x5b2910[_0x9352('0xb6')]=[{'all':!![]}];}_0x5b2910=_[_0x9352('0x9a')]({},_0x5b2910,_0x38be23[_0x9352('0xb7')]);return db[_0x9352('0x30')][_0x9352('0xb8')](_0x5b2910)[_0x9352('0x26')](handleEntityNotFound(_0xf0f8e6,null))[_0x9352('0x26')](respondWithResult(_0xf0f8e6,null))['catch'](handleError(_0xf0f8e6,null));};exports[_0x9352('0xb9')]=function(_0x12b77a,_0xf3f849){return db['MailInteraction']['create'](_0x12b77a[_0x9352('0xba')],{})['then'](respondWithResult(_0xf3f849,0xc9))['catch'](handleError(_0xf3f849,null));};exports['update']=function(_0x27cf84,_0x27cd64){if(_0x27cf84[_0x9352('0xba')]['id']){delete _0x27cf84['body']['id'];}return db[_0x9352('0x30')]['find']({'where':{'id':_0x27cf84[_0x9352('0xbb')]['id']}})['then'](handleEntityNotFound(_0x27cd64,null))['then'](saveUpdates(_0x27cf84['body'],null))['then'](respondWithResult(_0x27cd64,null))[_0x9352('0x36')](handleError(_0x27cd64,null));};exports[_0x9352('0x27')]=function(_0x39bf3d,_0xc8bf93){return db['MailInteraction']['find']({'where':{'id':_0x39bf3d[_0x9352('0xbb')]['id']}})['then'](handleEntityNotFound(_0xc8bf93,null))[_0x9352('0x26')](removeEntity(_0xc8bf93,null))['catch'](handleError(_0xc8bf93,null));};exports[_0x9352('0xbc')]=function(_0x5696b1,_0x4bd923){return db[_0x9352('0x30')][_0x9352('0xbc')]()[_0x9352('0x26')](respondWithResult(_0x4bd923,null))[_0x9352('0x36')](handleError(_0x4bd923,null));};exports[_0x9352('0xbd')]=function(_0x1bf9eb,_0x41b349,_0x56b8ec){return db['MailMessage']['find']({'where':{'id':_0x1bf9eb[_0x9352('0xbb')]['id']}})[_0x9352('0x26')](handleEntityNotFound(_0x41b349,null))[_0x9352('0x26')](function(_0x546c7f){if(_0x546c7f){return _0x546c7f[_0x9352('0xbd')](_0x1bf9eb[_0x9352('0xba')][_0x9352('0xbe')],_[_0x9352('0xbf')](_0x1bf9eb[_0x9352('0xba')],['ids','id'])||{});}})[_0x9352('0x26')](respondWithResult(_0x41b349,null))[_0x9352('0x36')](handleError(_0x41b349,null));};exports['getMessages']=function(_0x50d31d,_0x55f15c,_0x2701fa){var _0x2db3a5={'raw':![],'where':{}};var _0x148885={};var _0x6e188a={'count':0x0,'rows':[]};return db[_0x9352('0x30')][_0x9352('0x31')]({'where':{'id':_0x50d31d['params']['id']}})['then'](handleEntityNotFound(_0x55f15c,null))['then'](function(_0x3526f1){if(_0x3526f1){_0x148885[_0x9352('0x37')]=_[_0x9352('0x5a')](db['MailMessage'][_0x9352('0xb5')]);_0x148885[_0x9352('0x38')]=_[_0x9352('0x5a')](_0x50d31d['query']);_0x148885[_0x9352('0x42')]=_['intersection'](_0x148885[_0x9352('0x37')],_0x148885['query']);_0x2db3a5['attributes']=_[_0x9352('0x3a')](_0x148885[_0x9352('0x37')],qs[_0x9352('0x3b')](_0x50d31d[_0x9352('0x38')][_0x9352('0x3b')]));_0x2db3a5[_0x9352('0x39')]=_0x2db3a5[_0x9352('0x39')][_0x9352('0x3c')]?_0x2db3a5[_0x9352('0x39')]:_0x148885[_0x9352('0x37')];if(!_0x50d31d[_0x9352('0x38')][_0x9352('0x3d')]('nolimit')){_0x2db3a5[_0x9352('0x20')]=qs[_0x9352('0x20')](_0x50d31d[_0x9352('0x38')][_0x9352('0x20')]);_0x2db3a5[_0x9352('0x1f')]=qs[_0x9352('0x1f')](_0x50d31d['query'][_0x9352('0x1f')]);}_0x2db3a5[_0x9352('0x3f')]=qs[_0x9352('0x40')](_0x50d31d['query'][_0x9352('0x40')]);_0x2db3a5[_0x9352('0x41')]=qs[_0x9352('0x42')](_[_0x9352('0x43')](_0x50d31d[_0x9352('0x38')],_0x148885['filters']));_0x2db3a5[_0x9352('0x41')][_0x9352('0xc0')]=_0x3526f1['id'];if(_0x50d31d[_0x9352('0x38')][_0x9352('0x73')]){_0x2db3a5[_0x9352('0x41')]=_[_0x9352('0x9a')](_0x2db3a5[_0x9352('0x41')],{'$or':_[_0x9352('0x2c')](_0x2db3a5[_0x9352('0x39')],function(_0x221224){var _0x3938ed={};_0x3938ed[_0x221224]={'$like':'%'+_0x50d31d[_0x9352('0x38')]['filter']+'%'};return _0x3938ed;})});}if(_0x50d31d[_0x9352('0x38')][_0x9352('0x79')]){var _0x2ea51c=_0x50d31d['query'][_0x9352('0x79')][_0x9352('0x81')](',');var _0x53d9d1={};_0x53d9d1[_0x2ea51c[0x0]]={'$gte':moment(_0x2ea51c[0x1])[_0x9352('0x61')](_0x9352('0xc1'))};_0x2db3a5[_0x9352('0x41')]=_[_0x9352('0x9a')](_0x2db3a5[_0x9352('0x41')],_0x53d9d1);}_0x2db3a5=_[_0x9352('0x9a')]({},_0x2db3a5,_0x50d31d[_0x9352('0xb7')]);return db[_0x9352('0xc2')][_0x9352('0x1e')]({'where':_0x2db3a5[_0x9352('0x41')]})[_0x9352('0x26')](function(_0x307914){_0x6e188a[_0x9352('0x1e')]=_0x307914;if(_0x50d31d[_0x9352('0x38')][_0x9352('0xc3')]){_0x2db3a5[_0x9352('0xb6')]=[{'all':!![]}];}return db[_0x9352('0xc2')][_0x9352('0xc4')](_0x2db3a5);})[_0x9352('0x26')](function(_0xce2d78){_0x6e188a[_0x9352('0xb4')]=_0xce2d78;return _0x6e188a;});}})['then'](respondWithFilteredResult(_0x55f15c,_0x2db3a5))['catch'](handleError(_0x55f15c,null));};exports['addTags']=function(_0x9bbf62,_0xddd2ee,_0x65437a){return db[_0x9352('0x30')]['find']({'where':{'id':_0x9bbf62[_0x9352('0xbb')]['id']}})[_0x9352('0x26')](handleEntityNotFound(_0xddd2ee,null))[_0x9352('0x26')](function(_0x2b156e){if(_0x2b156e){return _0x2b156e[_0x9352('0xc5')](_0x9bbf62['body'][_0x9352('0xbe')],_[_0x9352('0xbf')](_0x9bbf62[_0x9352('0xba')],[_0x9352('0xbe'),'id'])||{})[_0x9352('0xc6')](function(){return db[_0x9352('0xc7')][_0x9352('0xc4')]({'attributes':['id',_0x9352('0x2a'),_0x9352('0xc8')],'where':{'id':_0x9bbf62[_0x9352('0xba')][_0x9352('0xbe')]}});})[_0x9352('0x26')](function(_0x476d53){socket['emit'](_0x9352('0xc9'),{'id':Number(_0x9bbf62[_0x9352('0xbb')]['id']),'tags':_0x476d53||[]});return{'id':Number(_0x9bbf62[_0x9352('0xbb')]['id']),'tags':_0x476d53||[]};});}})[_0x9352('0x26')](respondWithResult(_0xddd2ee,null))['catch'](handleError(_0xddd2ee,null));};exports[_0x9352('0xca')]=function(_0x265c2a,_0x7a55a1,_0x58bf0f){return db['MailInteraction']['find']({'where':{'id':_0x265c2a[_0x9352('0xbb')]['id']}})['then'](handleEntityNotFound(_0x7a55a1,null))['then'](function(_0x2f85e2){if(_0x2f85e2){return _0x2f85e2['removeTags'](_0x265c2a['query'][_0x9352('0xbe')]);}})[_0x9352('0x26')](respondWithStatusCode(_0x7a55a1,null))[_0x9352('0x36')](handleError(_0x7a55a1,null));};exports[_0x9352('0xcb')]=function(_0x1349e4,_0x5b03fc){var _0x48e1f7=moment()[_0x9352('0xcc')]()['toString']();var _0x24a8c0=path['join'](config[_0x9352('0xcd')],_0x9352('0xce'),_0x9352('0xcf'),'attachments');var _0x1025c8=path['join'](config[_0x9352('0xcd')],_0x9352('0xce'),_0x9352('0xcf'),_0x9352('0xd0'));var _0x55ac6=path[_0x9352('0x84')](_0x1025c8,_0x48e1f7);var _0x2465b5=util[_0x9352('0x61')](_0x9352('0xd1'),_0x48e1f7);var _0x31403c=path[_0x9352('0x84')](_0x1025c8,_0x2465b5);var _0x58a540=![];return db[_0x9352('0x30')][_0x9352('0xb8')]({'where':{'id':_0x1349e4[_0x9352('0xbb')]['id']}})[_0x9352('0x26')](handleEntityNotFound(_0x5b03fc,null))['then'](function(_0x2aaf2c){if(_0x2aaf2c){return _0x2aaf2c[_0x9352('0xd2')]({'attributes':['id',_0x9352('0xba'),_0x9352('0x48'),'to','cc','bcc',_0x9352('0xd3'),_0x9352('0x5b')],'where':{'secret':![]},'include':_0x1349e4[_0x9352('0x38')][_0x9352('0xd4')]?[{'model':db['Attachment'],'as':_0x9352('0xd5')}]:undefined,'order':qs['sort']('id')});}return[];})['then'](function(_0x340ac4){_0x58a540=_0x340ac4[_0x9352('0x3c')];if(_0x340ac4[_0x9352('0x3c')]){fs[_0x9352('0xd6')](_0x55ac6);return BPromise[_0x9352('0xd7')](_0x340ac4,function(_0x16563a,_0x34b08b){var _0x3ed413=_0x16563a;var _0x298535={'from':_0x3ed413[_0x9352('0x48')],'to':_0x3ed413['to'],'subject':_0x3ed413['subject'],'html':_0x3ed413[_0x9352('0xba')],'headers':{'Date':moment(_0x3ed413[_0x9352('0x5b')])[_0x9352('0x61')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x16563a['cc']){_0x298535[_0x9352('0xd8')]['Cc']=_0x16563a['cc'];}if(_0x16563a[_0x9352('0xd9')]){_0x298535['headers'][_0x9352('0xda')]=_0x16563a[_0x9352('0xd9')];}return new BPromise(function(_0x1cd5f6,_0x540263){if(_0x16563a[_0x9352('0xd5')]){for(var _0x33da66=0x0;_0x33da66<_0x16563a[_0x9352('0xd5')][_0x9352('0x3c')];_0x33da66++){var _0x3d14d2=_0x16563a[_0x9352('0xd5')][_0x33da66];var _0x70b0ca=path[_0x9352('0x84')](_0x24a8c0,_0x3d14d2[_0x9352('0xdb')]);if(fs[_0x9352('0xdc')](_0x70b0ca)){_0x298535[_0x9352('0xd4')][_0x9352('0x82')]({'name':_0x3d14d2[_0x9352('0x2a')],'contentType':_0x3d14d2[_0x9352('0xdd')],'data':fs[_0x9352('0xde')](_0x70b0ca)});}}}emlformat[_0x9352('0xdf')](_0x298535,function(_0xa84a5e,_0x12045b){if(_0xa84a5e)return _0x540263(_0xa84a5e);fs['writeFileSync'](path['join'](_0x55ac6,util[_0x9352('0x61')](_0x9352('0xe0'),_0x34b08b)),_0x12045b);return _0x1cd5f6(_0x12045b);});});});}})['then'](function(){if(_0x58a540){return new BPromise(function(_0x389d89,_0x1784bb){zipdir(_0x55ac6,{'saveTo':_0x31403c},function(_0x209031,_0x24bb93){if(_0x209031)return _0x1784bb(_0x209031);return _0x389d89(_0x24bb93);});});}})[_0x9352('0x26')](function(){if(_0x58a540){return new BPromise(function(_0x2e07b9,_0x500a2c){rimraf(_0x55ac6,function(_0x3bb620){if(_0x3bb620)_0x500a2c(_0x3bb620);return _0x2e07b9();});});}})[_0x9352('0x26')](function(){if(_0x58a540){return _0x5b03fc[_0x9352('0xcb')](_0x31403c,_0x2465b5,function(_0xaedfa2){if(_0xaedfa2){console[_0x9352('0xe1')](_0x9352('0xe2'),_0xaedfa2);}else{fs['unlinkSync'](_0x31403c);}});}else{return _0x5b03fc[_0x9352('0x1b')](0xc8);}})['catch'](handleError(_0x5b03fc,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 4db9ccb..e9d807b 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 _0x150d=['findAll','unreadMessages','length','emit','catch','exports','events','../../mysqldb','MailInteraction','MailMessage','save','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x4ccf96,_0x34978e){var _0xd103b7=function(_0x55736b){while(--_0x55736b){_0x4ccf96['push'](_0x4ccf96['shift']());}};_0xd103b7(++_0x34978e);}(_0x150d,0x102));var _0xd150=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x150d[_0x4fbfd9];return _0x31dc94;};'use strict';var EventEmitter=require(_0xd150('0x0'));var MailInteraction=require(_0xd150('0x1'))['db'][_0xd150('0x2')];var MailMessage=require(_0xd150('0x1'))['db'][_0xd150('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd150('0x4'),'afterUpdate':_0xd150('0x5'),'afterDestroy':_0xd150('0x6')};function emitEvent(_0x51a47a){return function(_0x4b465f,_0x1890f7,_0x2cd38e){_0x4b465f[_0xd150('0x7')]({'attributes':['id'],'raw':!![]})[_0xd150('0x8')](function(_0x3600ba){_0x4b465f[_0xd150('0x9')](_0xd150('0xa'),_0x3600ba[_0xd150('0xb')](function(_0xc6feaa){return{'id':_0xc6feaa['id']};}));return MailMessage[_0xd150('0xc')]({'where':{'MailInteractionId':_0x4b465f['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd150('0x8')](function(_0x1e9d48){_0x4b465f[_0xd150('0x9')](_0xd150('0xd'),_0x1e9d48[_0xd150('0xe')]);MailInteractionEvents[_0xd150('0xf')](_0x51a47a+':'+_0x4b465f['id'],_0x4b465f);MailInteractionEvents[_0xd150('0xf')](_0x51a47a,_0x4b465f);_0x2cd38e(null);})[_0xd150('0x10')](_0x2cd38e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xd150('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0x889d=['setDataValue','Users','map','unreadMessages','length','emit','hasOwnProperty','hook','exports','../../mysqldb','MailInteraction','MailMessage','save','update','getUsers','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x889d,0x199));var _0xd889=function(_0x3b1b69,_0x447ec2){_0x3b1b69=_0x3b1b69-0x0;var _0x322bcf=_0x889d[_0x3b1b69];return _0x322bcf;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xd889('0x0'))['db'][_0xd889('0x1')];var MailMessage=require('../../mysqldb')['db'][_0xd889('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd889('0x3'),'afterUpdate':_0xd889('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3a25b3){return function(_0x11af6e,_0x48a5a2,_0x652c79){_0x11af6e[_0xd889('0x5')]({'attributes':['id'],'raw':!![]})[_0xd889('0x6')](function(_0x382174){_0x11af6e[_0xd889('0x7')](_0xd889('0x8'),_0x382174[_0xd889('0x9')](function(_0x242640){return{'id':_0x242640['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x11af6e['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x306a76){_0x11af6e[_0xd889('0x7')](_0xd889('0xa'),_0x306a76[_0xd889('0xb')]);MailInteractionEvents[_0xd889('0xc')](_0x3a25b3+':'+_0x11af6e['id'],_0x11af6e);MailInteractionEvents[_0xd889('0xc')](_0x3a25b3,_0x11af6e);_0x652c79(null);})['catch'](_0x652c79(null));};}for(var e in events){if(events[_0xd889('0xd')](e)){var event=events[e];MailInteraction[_0xd889('0xe')](e,emitEvent(event));}}module[_0xd889('0xf')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 1b0b6d8..9a3a621 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 _0xd860=['get','MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','substatus','closedAt','models'];(function(_0x4566eb,_0x47209f){var _0x383feb=function(_0x236e9a){while(--_0x236e9a){_0x4566eb['push'](_0x4566eb['shift']());}};_0x383feb(++_0x47209f);}(_0xd860,0xe6));var _0x0d86=function(_0x16131d,_0x5c0693){_0x16131d=_0x16131d-0x0;var _0x57e77a=_0xd860[_0x16131d];return _0x57e77a;};'use strict';var _=require(_0x0d86('0x0'));var util=require(_0x0d86('0x1'));var logger=require(_0x0d86('0x2'))(_0x0d86('0x3'));var moment=require(_0x0d86('0x4'));var BPromise=require(_0x0d86('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0d86('0x6'));var rimraf=require(_0x0d86('0x7'));var config=require(_0x0d86('0x8'));var attributes=require(_0x0d86('0x9'));module[_0x0d86('0xa')]=function(_0xb54b2d,_0x4711b9){return _0xb54b2d[_0x0d86('0xb')](_0x0d86('0xc'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x0d86('0xd'),'to'],'type':_0x0d86('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4517a7,_0x42e638,_0x4cff7e){if(_0x4517a7['substatus']){_0x4517a7[_0x0d86('0xf')]=moment()[_0x0d86('0x10')](_0x0d86('0x11'));}if(_0x4517a7[_0x0d86('0x12')]){_0x4517a7['closedAt']=moment()[_0x0d86('0x10')](_0x0d86('0x11'));}_0x4cff7e(null,_0x42e638);},'beforeUpdate':function(_0x122d40,_0x3ba0a2,_0x1dc3fa){if(_0x122d40['changed'](_0x0d86('0x13'))){_0x122d40['substatusAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x122d40['changed'](_0x0d86('0x12'))){_0x122d40[_0x0d86('0x14')]=moment()['format'](_0x0d86('0x11'));}_0x1dc3fa(null,_0x122d40);},'afterUpdate':function(_0x194799,_0x447ae5,_0x587a57){var _0x27af6c=_0xb54b2d[_0x0d86('0x15')];var _0x559ddd=_0x194799[_0x0d86('0x16')]({'plain':!![]});if(_0x559ddd['closed']){return _0x27af6c[_0x0d86('0x17')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x559ddd['id']}})[_0x0d86('0x18')](function(){_0x587a57();})[_0x0d86('0x19')](function(_0xc61afc){_0x587a57(_0xc61afc);});}else{_0x587a57();}}},'charset':_0x0d86('0x1a'),'collate':_0x0d86('0x1b')});}; \ No newline at end of file +var _0x7316=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','models','get','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x344c69,_0x2e5069){var _0x6aec64=function(_0x54ed51){while(--_0x54ed51){_0x344c69['push'](_0x344c69['shift']());}};_0x6aec64(++_0x2e5069);}(_0x7316,0x1a1));var _0x6731=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0x7316[_0x22b8a3];return _0x199a0c;};'use strict';var _=require(_0x6731('0x0'));var util=require(_0x6731('0x1'));var logger=require(_0x6731('0x2'))('api');var moment=require(_0x6731('0x3'));var BPromise=require(_0x6731('0x4'));var rp=require(_0x6731('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6731('0x6'));var config=require(_0x6731('0x7'));var attributes=require('./mailInteraction.attributes');module[_0x6731('0x8')]=function(_0x445408,_0x1e7db3){return _0x445408['define'](_0x6731('0x9'),attributes,{'tableName':_0x6731('0xa'),'paranoid':![],'indexes':[{'name':_0x6731('0xb'),'fields':[_0x6731('0xc'),'to'],'type':_0x6731('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x39db87,_0xf7d0cd,_0x41d0be){if(_0x39db87[_0x6731('0xe')]){_0x39db87[_0x6731('0xf')]=moment()[_0x6731('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x39db87[_0x6731('0x11')]){_0x39db87[_0x6731('0x12')]=moment()[_0x6731('0x10')](_0x6731('0x13'));}_0x41d0be(null,_0xf7d0cd);},'beforeUpdate':function(_0xb6bdd8,_0x4d9410,_0x48965c){if(_0xb6bdd8[_0x6731('0x14')](_0x6731('0xe'))){_0xb6bdd8[_0x6731('0xf')]=moment()[_0x6731('0x10')](_0x6731('0x13'));}if(_0xb6bdd8[_0x6731('0x14')](_0x6731('0x11'))){_0xb6bdd8['closedAt']=moment()[_0x6731('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x48965c(null,_0xb6bdd8);},'afterUpdate':function(_0x16735c,_0x333024,_0x276ea4){var _0x3212a6=_0x445408[_0x6731('0x15')];var _0xae36c3=_0x16735c[_0x6731('0x16')]({'plain':!![]});if(_0xae36c3[_0x6731('0x11')]){return _0x3212a6[_0x6731('0x17')][_0x6731('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0xae36c3['id']}})['then'](function(){_0x276ea4();})[_0x6731('0x19')](function(_0x5eb856){_0x276ea4(_0x5eb856);});}else{_0x276ea4();}}},'charset':_0x6731('0x1a'),'collate':_0x6731('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 297b73c..50dc3db 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 _0xed20=['./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','find','addTags','ids','spread','AddTags','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost'];(function(_0x320a2f,_0x3767d8){var _0x1d14ab=function(_0x1c0a9d){while(--_0x1c0a9d){_0x320a2f['push'](_0x320a2f['shift']());}};_0x1d14ab(++_0x3767d8);}(_0xed20,0xce));var _0x0ed2=function(_0xe2f67d,_0x3be422){_0xe2f67d=_0xe2f67d-0x0;var _0x5aa29d=_0xed20[_0xe2f67d];return _0x5aa29d;};'use strict';var _=require(_0x0ed2('0x0'));var util=require(_0x0ed2('0x1'));var moment=require(_0x0ed2('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ed2('0x3'));var fs=require('fs');var Redis=require(_0x0ed2('0x4'));var db=require(_0x0ed2('0x5'))['db'];var utils=require(_0x0ed2('0x6'));var logger=require(_0x0ed2('0x7'))(_0x0ed2('0x8'));var config=require('../../config/environment');var jayson=require(_0x0ed2('0x9'));var client=jayson[_0x0ed2('0xa')]['http']({'port':0x232a});config[_0x0ed2('0xb')]=_[_0x0ed2('0xc')](config[_0x0ed2('0xb')],{'host':_0x0ed2('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0ed2('0xb')]));require(_0x0ed2('0xe'))[_0x0ed2('0xf')](socket);function respondWithRpcPromise(_0x25a2d8,_0x48f0aa,_0x4d6fe2){return new BPromise(function(_0x36bd70,_0x1a3885){return client[_0x0ed2('0x10')](_0x25a2d8,_0x4d6fe2)[_0x0ed2('0x11')](function(_0x187709){logger[_0x0ed2('0x12')](_0x0ed2('0x13'),_0x48f0aa,_0x0ed2('0x14'));logger[_0x0ed2('0x15')](_0x0ed2('0x16'),_0x48f0aa,_0x0ed2('0x14'),JSON[_0x0ed2('0x17')](_0x187709));if(_0x187709['error']){if(_0x187709[_0x0ed2('0x18')][_0x0ed2('0x19')]===0x1f4){logger[_0x0ed2('0x18')](_0x0ed2('0x13'),_0x48f0aa,_0x187709[_0x0ed2('0x18')]['message']);return _0x1a3885(_0x187709[_0x0ed2('0x18')][_0x0ed2('0x1a')]);}logger[_0x0ed2('0x18')]('MailInteraction,\x20%s,\x20%s',_0x48f0aa,_0x187709[_0x0ed2('0x18')]['message']);return _0x36bd70(_0x187709[_0x0ed2('0x18')][_0x0ed2('0x1a')]);}else{logger[_0x0ed2('0x12')]('MailInteraction,\x20%s,\x20%s',_0x48f0aa,'request\x20sent');_0x36bd70(_0x187709[_0x0ed2('0x1b')][_0x0ed2('0x1a')]);}})['catch'](function(_0x322e35){logger['error'](_0x0ed2('0x13'),_0x48f0aa,_0x322e35);_0x1a3885(_0x322e35);});});}exports[_0x0ed2('0x1c')]=function(_0x4d5c76){var _0x5ac0aa=this;return new Promise(function(_0x585ac1,_0x13060b){return db[_0x0ed2('0x1d')][_0x0ed2('0x1e')](_0x4d5c76[_0x0ed2('0x1f')],{'raw':_0x4d5c76[_0x0ed2('0x20')]?_0x4d5c76[_0x0ed2('0x20')][_0x0ed2('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d5c76['options']?_0x4d5c76['options'][_0x0ed2('0x22')]||null:null,'attributes':_0x4d5c76[_0x0ed2('0x20')]?_0x4d5c76[_0x0ed2('0x20')][_0x0ed2('0x23')]||null:null,'limit':_0x4d5c76[_0x0ed2('0x20')]?_0x4d5c76[_0x0ed2('0x20')][_0x0ed2('0x24')]||null:null})[_0x0ed2('0x11')](function(_0x5f2660){logger[_0x0ed2('0x12')](_0x0ed2('0x1c'),_0x4d5c76);logger[_0x0ed2('0x15')](_0x0ed2('0x1c'),_0x4d5c76,JSON[_0x0ed2('0x17')](_0x5f2660));_0x585ac1(_0x5f2660);})['catch'](function(_0x14c0e6){logger[_0x0ed2('0x18')](_0x0ed2('0x1c'),_0x14c0e6[_0x0ed2('0x1a')],_0x4d5c76);_0x13060b(_0x5ac0aa[_0x0ed2('0x18')](0x1f4,_0x14c0e6[_0x0ed2('0x1a')]));});});};exports[_0x0ed2('0x25')]=function(_0x1d90ee){return new Promise(function(_0x1e62a8,_0x1e6efe){return db['MailInteraction'][_0x0ed2('0x26')]({'where':_0x1d90ee['options']?_0x1d90ee['options'][_0x0ed2('0x22')]||null:null})[_0x0ed2('0x11')](function(_0x11add7){if(_0x11add7){return _0x11add7[_0x0ed2('0x27')](_0x1d90ee[_0x0ed2('0x1f')][_0x0ed2('0x28')],_['omit'](_0x1d90ee['body'],['ids','id'])||{});}})[_0x0ed2('0x29')](function(_0x35eff4){logger[_0x0ed2('0x12')](_0x0ed2('0x2a'),_0x1d90ee);logger['debug'](_0x0ed2('0x2a'),_0x1d90ee,JSON['stringify'](_0x35eff4));_0x1e62a8(_0x35eff4);})[_0x0ed2('0x2b')](function(_0x793700){logger['error'](_0x0ed2('0x2a'),_0x793700['message'],_0x1d90ee);_0x1e6efe(_this[_0x0ed2('0x18')](0x1f4,_0x793700[_0x0ed2('0x1a')]));});});}; \ No newline at end of file +var _0x1a0b=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','socket.io-emitter','redis','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','MailInteraction','body','options','where','attributes','UpdateMailInteraction','debug','catch','find','addTags','ids','spread','AddTags','lodash'];(function(_0x448704,_0x326df6){var _0x5416e8=function(_0x10fe47){while(--_0x10fe47){_0x448704['push'](_0x448704['shift']());}};_0x5416e8(++_0x326df6);}(_0x1a0b,0x18f));var _0xb1a0=function(_0x104a6a,_0x3daf49){_0x104a6a=_0x104a6a-0x0;var _0x5bb201=_0x1a0b[_0x104a6a];return _0x5bb201;};'use strict';var _=require(_0xb1a0('0x0'));var util=require('util');var moment=require(_0xb1a0('0x1'));var BPromise=require(_0xb1a0('0x2'));var rs=require(_0xb1a0('0x3'));var fs=require('fs');var Redis=require(_0xb1a0('0x4'));var db=require(_0xb1a0('0x5'))['db'];var utils=require(_0xb1a0('0x6'));var logger=require(_0xb1a0('0x7'))(_0xb1a0('0x8'));var config=require(_0xb1a0('0x9'));var jayson=require(_0xb1a0('0xa'));var client=jayson[_0xb1a0('0xb')]['http']({'port':0x232a});config['redis']=_[_0xb1a0('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb1a0('0xd'))(new Redis(config[_0xb1a0('0xe')]));require(_0xb1a0('0xf'))['register'](socket);function respondWithRpcPromise(_0x517624,_0x3f5cad,_0xa672e8){return new BPromise(function(_0x16c4fb,_0x17bd0d){return client[_0xb1a0('0x10')](_0x517624,_0xa672e8)[_0xb1a0('0x11')](function(_0x5a2338){logger[_0xb1a0('0x12')](_0xb1a0('0x13'),_0x3f5cad,_0xb1a0('0x14'));logger['debug'](_0xb1a0('0x15'),_0x3f5cad,_0xb1a0('0x14'),JSON[_0xb1a0('0x16')](_0x5a2338));if(_0x5a2338[_0xb1a0('0x17')]){if(_0x5a2338['error'][_0xb1a0('0x18')]===0x1f4){logger[_0xb1a0('0x17')](_0xb1a0('0x13'),_0x3f5cad,_0x5a2338[_0xb1a0('0x17')][_0xb1a0('0x19')]);return _0x17bd0d(_0x5a2338[_0xb1a0('0x17')][_0xb1a0('0x19')]);}logger[_0xb1a0('0x17')](_0xb1a0('0x13'),_0x3f5cad,_0x5a2338[_0xb1a0('0x17')][_0xb1a0('0x19')]);return _0x16c4fb(_0x5a2338[_0xb1a0('0x17')][_0xb1a0('0x19')]);}else{logger[_0xb1a0('0x12')](_0xb1a0('0x13'),_0x3f5cad,_0xb1a0('0x14'));_0x16c4fb(_0x5a2338[_0xb1a0('0x1a')]['message']);}})['catch'](function(_0x5156d6){logger['error']('MailInteraction,\x20%s,\x20%s',_0x3f5cad,_0x5156d6);_0x17bd0d(_0x5156d6);});});}exports['UpdateMailInteraction']=function(_0x5e6930){var _0x490182=this;return new Promise(function(_0xefc9d3,_0xe0d8ce){return db[_0xb1a0('0x1b')]['update'](_0x5e6930[_0xb1a0('0x1c')],{'raw':_0x5e6930[_0xb1a0('0x1d')]?_0x5e6930[_0xb1a0('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e6930[_0xb1a0('0x1d')]?_0x5e6930['options'][_0xb1a0('0x1e')]||null:null,'attributes':_0x5e6930[_0xb1a0('0x1d')]?_0x5e6930[_0xb1a0('0x1d')][_0xb1a0('0x1f')]||null:null,'limit':_0x5e6930['options']?_0x5e6930[_0xb1a0('0x1d')]['limit']||null:null})[_0xb1a0('0x11')](function(_0x44941e){logger[_0xb1a0('0x12')](_0xb1a0('0x20'),_0x5e6930);logger[_0xb1a0('0x21')](_0xb1a0('0x20'),_0x5e6930,JSON[_0xb1a0('0x16')](_0x44941e));_0xefc9d3(_0x44941e);})[_0xb1a0('0x22')](function(_0x2e4630){logger['error']('UpdateMailInteraction',_0x2e4630[_0xb1a0('0x19')],_0x5e6930);_0xe0d8ce(_0x490182[_0xb1a0('0x17')](0x1f4,_0x2e4630[_0xb1a0('0x19')]));});});};exports['AddTagsToMailInteraction']=function(_0x1d5f19){return new Promise(function(_0x4b3fe8,_0x3fff58){return db['MailInteraction'][_0xb1a0('0x23')]({'where':_0x1d5f19[_0xb1a0('0x1d')]?_0x1d5f19[_0xb1a0('0x1d')][_0xb1a0('0x1e')]||null:null})[_0xb1a0('0x11')](function(_0x17e21d){if(_0x17e21d){return _0x17e21d[_0xb1a0('0x24')](_0x1d5f19[_0xb1a0('0x1c')][_0xb1a0('0x25')],_['omit'](_0x1d5f19[_0xb1a0('0x1c')],[_0xb1a0('0x25'),'id'])||{});}})[_0xb1a0('0x26')](function(_0x7c9a34){logger[_0xb1a0('0x12')](_0xb1a0('0x27'),_0x1d5f19);logger[_0xb1a0('0x21')]('AddTags',_0x1d5f19,JSON['stringify'](_0x7c9a34));_0x4b3fe8(_0x7c9a34);})[_0xb1a0('0x22')](function(_0x1826c3){logger['error'](_0xb1a0('0x27'),_0x1826c3[_0xb1a0('0x19')],_0x1d5f19);_0x3fff58(_this[_0xb1a0('0x17')](0x1f4,_0x1826c3[_0xb1a0('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index f369aa6..6fb4cda 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 _0x27da=['./mailInteraction.events','save','remove','update','removeListener','length'];(function(_0x41a2c9,_0x10c564){var _0x3af8f9=function(_0x34eeab){while(--_0x34eeab){_0x41a2c9['push'](_0x41a2c9['shift']());}};_0x3af8f9(++_0x10c564);}(_0x27da,0x14a));var _0xa27d=function(_0x242620,_0xf5efbf){_0x242620=_0x242620-0x0;var _0x21126e=_0x27da[_0x242620];return _0x21126e;};'use strict';var MailInteractionEvents=require(_0xa27d('0x0'));var events=[_0xa27d('0x1'),_0xa27d('0x2'),_0xa27d('0x3')];function createListener(_0x36feb7,_0x10ae0e){return function(_0x507cf0){_0x10ae0e['emit'](_0x36feb7,_0x507cf0);};}function removeListener(_0x20007f,_0x4c6fec){return function(){MailInteractionEvents[_0xa27d('0x4')](_0x20007f,_0x4c6fec);};}exports['register']=function(_0x12101b){for(var _0x2982bb=0x0,_0x1dfb73=events[_0xa27d('0x5')];_0x2982bb<_0x1dfb73;_0x2982bb++){var _0x1545d7=events[_0x2982bb];var _0x2e9d6f=createListener('mailInteraction:'+_0x1545d7,_0x12101b);MailInteractionEvents['on'](_0x1545d7,_0x2e9d6f);}}; \ No newline at end of file +var _0x673f=['mailInteraction:','./mailInteraction.events','save','remove','update','emit','register'];(function(_0x53a99a,_0x5d7ef0){var _0x7dcf97=function(_0x439ce6){while(--_0x439ce6){_0x53a99a['push'](_0x53a99a['shift']());}};_0x7dcf97(++_0x5d7ef0);}(_0x673f,0x1f2));var _0xf673=function(_0x5224b4,_0x355198){_0x5224b4=_0x5224b4-0x0;var _0x4cd0ae=_0x673f[_0x5224b4];return _0x4cd0ae;};'use strict';var MailInteractionEvents=require(_0xf673('0x0'));var events=[_0xf673('0x1'),_0xf673('0x2'),_0xf673('0x3')];function createListener(_0x1bbf4c,_0x3d7094){return function(_0x53e9ea){_0x3d7094[_0xf673('0x4')](_0x1bbf4c,_0x53e9ea);};}function removeListener(_0x26c20b,_0x14037){return function(){MailInteractionEvents['removeListener'](_0x26c20b,_0x14037);};}exports[_0xf673('0x5')]=function(_0xee00aa){for(var _0x3f2072=0x0,_0x257453=events['length'];_0x3f2072<_0x257453;_0x3f2072++){var _0x139ddd=events[_0x3f2072];var _0x2fc776=createListener(_0xf673('0x6')+_0x139ddd,_0xee00aa);MailInteractionEvents['on'](_0x139ddd,_0x2fc776);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index c7e053d..2656027 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 _0x687b=['/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','post','tracked','mail','create','put'];(function(_0x46569e,_0x29a653){var _0x2f57ce=function(_0x3f0cac){while(--_0x3f0cac){_0x46569e['push'](_0x46569e['shift']());}};_0x2f57ce(++_0x29a653);}(_0x687b,0x14a));var _0xb687=function(_0x386bf3,_0x39de2f){_0x386bf3=_0x386bf3-0x0;var _0x4e8eb5=_0x687b[_0x386bf3];return _0x4e8eb5;};'use strict';var multer=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var path=require(_0xb687('0x2'));var timeout=require(_0xb687('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xb687('0x4'));var interaction=require(_0xb687('0x5'));var config=require(_0xb687('0x6'));var controller=require(_0xb687('0x7'));router[_0xb687('0x8')]('/',auth[_0xb687('0x9')](),controller[_0xb687('0xa')]);router[_0xb687('0x8')](_0xb687('0xb'),auth[_0xb687('0x9')](),controller['describe']);router[_0xb687('0x8')](_0xb687('0xc'),auth['isAuthenticated'](),controller[_0xb687('0xd')]);router[_0xb687('0x8')](_0xb687('0xe'),auth[_0xb687('0x9')](),controller[_0xb687('0xf')]);router[_0xb687('0x10')]('/',auth[_0xb687('0x9')](),interaction[_0xb687('0x11')](_0xb687('0x12'),'mailmessage:create'),controller[_0xb687('0x13')]);router[_0xb687('0x14')](_0xb687('0xc'),auth[_0xb687('0x9')](),controller['update']);router['put'](_0xb687('0x15'),auth[_0xb687('0x9')](),controller['accept']);router[_0xb687('0x14')](_0xb687('0x16'),auth[_0xb687('0x9')](),controller[_0xb687('0x17')]);router[_0xb687('0x18')](_0xb687('0xc'),auth[_0xb687('0x9')](),controller[_0xb687('0x19')]);module[_0xb687('0x1a')]=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(_0x32ac67,_0x92510b){var _0x15dde2=function(_0x1ad315){while(--_0x1ad315){_0x32ac67['push'](_0x32ac67['shift']());}};_0x15dde2(++_0x92510b);}(_0xac9d,0x14d));var _0xdac9=function(_0xb4cc12,_0x41436e){_0xb4cc12=_0xb4cc12-0x0;var _0x8593b5=_0xac9d[_0xb4cc12];return _0x8593b5;};'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 7c9d820..5326669 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 _0xabbd=['BOOLEAN','ENUM','out','STRING','DATE','INTEGER','sequelize','lodash','exports','TEXT','long','medium'];(function(_0x4010cd,_0x196261){var _0x27d7d6=function(_0x547013){while(--_0x547013){_0x4010cd['push'](_0x4010cd['shift']());}};_0x27d7d6(++_0x196261);}(_0xabbd,0x1f2));var _0xdabb=function(_0x41a32a,_0xd888c6){_0x41a32a=_0x41a32a-0x0;var _0x56834d=_0xabbd[_0x41a32a];return _0x56834d;};'use strict';var Sequelize=require(_0xdabb('0x0'));var _=require(_0xdabb('0x1'));module[_0xdabb('0x2')]={'body':{'type':Sequelize[_0xdabb('0x3')](_0xdabb('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xdabb('0x3')](_0xdabb('0x5'))},'read':{'type':Sequelize[_0xdabb('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0xdabb('0x7')]('in',_0xdabb('0x8')),'defaultValue':_0xdabb('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0xdabb('0x9')](0x1fe)},'from':{'type':Sequelize[_0xdabb('0x9')]},'to':{'type':Sequelize[_0xdabb('0x3')](_0xdabb('0x4'))},'cc':{'type':Sequelize[_0xdabb('0x3')]('long')},'bcc':{'type':Sequelize[_0xdabb('0x3')](_0xdabb('0x4'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xdabb('0xa')]},'attach':{'type':Sequelize[_0xdabb('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xdabb('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xdabb('0xa')]},'originTo':{'type':Sequelize[_0xdabb('0x3')](_0xdabb('0x4'))},'originCc':{'type':Sequelize[_0xdabb('0x3')](_0xdabb('0x4'))}}; \ No newline at end of file +var _0xf925=['long','medium','ENUM','out','STRING','DATE','INTEGER','TEXT'];(function(_0x7fcda4,_0x58eaf9){var _0x2e96ee=function(_0x1a3e82){while(--_0x1a3e82){_0x7fcda4['push'](_0x7fcda4['shift']());}};_0x2e96ee(++_0x58eaf9);}(_0xf925,0xb7));var _0x5f92=function(_0x166e96,_0x55191d){_0x166e96=_0x166e96-0x0;var _0x553d73=_0xf925[_0x166e96];return _0x553d73;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module['exports']={'body':{'type':Sequelize[_0x5f92('0x0')](_0x5f92('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5f92('0x0')](_0x5f92('0x2'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x5f92('0x3')]('in',_0x5f92('0x4')),'defaultValue':_0x5f92('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5f92('0x5')](0x1fe)},'from':{'type':Sequelize[_0x5f92('0x5')]},'to':{'type':Sequelize[_0x5f92('0x0')](_0x5f92('0x1'))},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize['TEXT'](_0x5f92('0x1'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x5f92('0x6')]},'attach':{'type':Sequelize[_0x5f92('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x5f92('0x6')]},'originTo':{'type':Sequelize['TEXT'](_0x5f92('0x1'))},'originCc':{'type':Sequelize[_0x5f92('0x0')](_0x5f92('0x1'))}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 52a0d73..abdffd3 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 _0xf8fb=['Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','push','build','writeFileSync','download','log','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./mailMessage.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~!@#$%^&-_=+[{]}.','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','Content-Range','save','update','then','destroy','name','send','index','MailMessage','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','findAll','rows','include','find','body','params','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','SendMail','sendMail','messageId','mail','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','MailInteractionId','format','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','accept','EventManager','mail-interactions','reject','agent','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','rejectMessage','rejectmessage','unix','toString','server','tmp','files','message-%s.eml','from','bcc','subject','createdAt'];(function(_0x19e291,_0x5052bc){var _0x5c816f=function(_0x4a9cdf){while(--_0x4a9cdf){_0x19e291['push'](_0x19e291['shift']());}};_0x5c816f(++_0x5052bc);}(_0xf8fb,0xae));var _0xbf8f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xf8fb[_0xfae23b];return _0x200640;};'use strict';var pdf=require(_0xbf8f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbf8f('0x1'));var zipdir=require(_0xbf8f('0x2'));var jsonpatch=require(_0xbf8f('0x3'));var rp=require('request-promise');var moment=require(_0xbf8f('0x4'));var BPromise=require(_0xbf8f('0x5'));var Mustache=require(_0xbf8f('0x6'));var util=require(_0xbf8f('0x7'));var path=require('path');var sox=require(_0xbf8f('0x8'));var csv=require('to-csv');var ejs=require(_0xbf8f('0x9'));var fs=require('fs');var _=require(_0xbf8f('0xa'));var squel=require(_0xbf8f('0xb'));var crypto=require(_0xbf8f('0xc'));var jsforce=require(_0xbf8f('0xd'));var deskjs=require(_0xbf8f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbf8f('0xf'));var Papa=require('papaparse');var Redis=require(_0xbf8f('0x10'));var authService=require(_0xbf8f('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf8f('0x12'))(_0xbf8f('0x13'));var utils=require(_0xbf8f('0x14'));var config=require('../../config/environment');var db=require(_0xbf8f('0x15'))['db'];config['redis']=_['defaults'](config[_0xbf8f('0x16')],{'host':_0xbf8f('0x17'),'port':0x18eb});var socket=require(_0xbf8f('0x18'))(new Redis(config[_0xbf8f('0x16')]));require(_0xbf8f('0x19'))['register'](socket);var jayson=require(_0xbf8f('0x1a'));var client=jayson[_0xbf8f('0x1b')][_0xbf8f('0x1c')]({'port':0x232c});var client9003=jayson[_0xbf8f('0x1b')][_0xbf8f('0x1c')]({'port':0x232b});var client9002=jayson[_0xbf8f('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x1f2505,_0x5d04a2,_0x51dc1b){if(_0x51dc1b){var _0x5e3cb6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e3cb6[_0xbf8f('0x1d')](_0x5d04a2)){return _0x1f2505;}else{throw new Error(_0xbf8f('0x1e'));}}else{return _0x1f2505;}}function respondWithRpcPromise(_0x220d2d,_0xf7bbb5,_0xbef632,_0x2d52cd){return new BPromise(function(_0x3bfa0f,_0x5e023d){var _0x1a327a=_0x2d52cd||client;return _0x1a327a['request'](_0x220d2d,_0xbef632)['then'](function(_0x3e2e83){logger[_0xbf8f('0x1f')](_0xbf8f('0x20'),_0xf7bbb5,_0xbf8f('0x21'));logger[_0xbf8f('0x22')](_0xbf8f('0x23'),_0xf7bbb5,_0xbf8f('0x21'),JSON[_0xbf8f('0x24')](_0x3e2e83));if(_0x3e2e83[_0xbf8f('0x25')]){if(_0x3e2e83['error'][_0xbf8f('0x26')]===0x1f4){logger[_0xbf8f('0x25')](_0xbf8f('0x20'),_0xf7bbb5,_0x3e2e83[_0xbf8f('0x25')][_0xbf8f('0x27')]);return _0x5e023d(_0x3e2e83[_0xbf8f('0x25')]['message']);}logger[_0xbf8f('0x25')](_0xbf8f('0x20'),_0xf7bbb5,_0x3e2e83[_0xbf8f('0x25')][_0xbf8f('0x27')]);return _0x3bfa0f(_0x3e2e83[_0xbf8f('0x25')][_0xbf8f('0x27')]);}else{logger[_0xbf8f('0x1f')](_0xbf8f('0x20'),_0xf7bbb5,'request\x20sent');_0x3bfa0f(_0x3e2e83[_0xbf8f('0x28')][_0xbf8f('0x27')]);}})[_0xbf8f('0x29')](function(_0x153793){logger[_0xbf8f('0x25')](_0xbf8f('0x20'),_0xf7bbb5,_0x153793);_0x5e023d(_0x153793);});});}function respondWithStatusCode(_0x34f04e,_0x487197){_0x487197=_0x487197||0xcc;return function(_0x3919f3){if(_0x3919f3){return _0x34f04e[_0xbf8f('0x2a')](_0x487197);}return _0x34f04e[_0xbf8f('0x2b')](_0x487197)[_0xbf8f('0x2c')]();};}function respondWithResult(_0x43835a,_0x2f8af2){_0x2f8af2=_0x2f8af2||0xc8;return function(_0x47d95b){if(_0x47d95b){return _0x43835a[_0xbf8f('0x2b')](_0x2f8af2)[_0xbf8f('0x2d')](_0x47d95b);}};}function respondWithFilteredResult(_0x1f8e58,_0x49b229){return function(_0x1ee41c){if(_0x1ee41c){var _0x2dbdca=_0x1ee41c[_0xbf8f('0x2e')],_0x3bc819=_0x49b229[_0xbf8f('0x2f')],_0x50de5d=_0x49b229['offset']+_0x49b229['limit'],_0x59181e;if(_0x50de5d>=_0x2dbdca){_0x50de5d=_0x2dbdca;_0x59181e=0xc8;}else{_0x59181e=0xce;}_0x1f8e58[_0xbf8f('0x2b')](_0x59181e);return _0x1f8e58['set'](_0xbf8f('0x30'),_0x3bc819+'-'+_0x50de5d+'/'+_0x2dbdca)[_0xbf8f('0x2d')](_0x1ee41c);}return null;};}function patchUpdates(_0x1f3909){return function(_0xa53ce4){try{jsonpatch['apply'](_0xa53ce4,_0x1f3909,!![]);}catch(_0x4152d7){return BPromise['reject'](_0x4152d7);}return _0xa53ce4[_0xbf8f('0x31')]();};}function saveUpdates(_0x1bcb94,_0x5892a3){return function(_0x492351){if(_0x492351){return _0x492351[_0xbf8f('0x32')](_0x1bcb94)[_0xbf8f('0x33')](function(_0x3e76c3){return _0x3e76c3;});}return null;};}function removeEntity(_0x4ab251,_0x915071){return function(_0x123c29){if(_0x123c29){return _0x123c29[_0xbf8f('0x34')]()[_0xbf8f('0x33')](function(){_0x4ab251[_0xbf8f('0x2b')](0xcc)[_0xbf8f('0x2c')]();});}};}function handleEntityNotFound(_0x5e7e8e,_0x1e0f54){return function(_0x62fa22){if(!_0x62fa22){_0x5e7e8e[_0xbf8f('0x2a')](0x194);}return _0x62fa22;};}function handleError(_0x19e030,_0x2b2c2c){_0x2b2c2c=_0x2b2c2c||0x1f4;return function(_0x4609ca){logger[_0xbf8f('0x25')](_0x4609ca['stack']);if(_0x4609ca[_0xbf8f('0x35')]){delete _0x4609ca[_0xbf8f('0x35')];}_0x19e030[_0xbf8f('0x2b')](_0x2b2c2c)[_0xbf8f('0x36')](_0x4609ca);};}exports[_0xbf8f('0x37')]=function(_0x18fc7a,_0x2ecc86){var _0x3cb500={},_0x24d0a3={},_0x36acc2={'count':0x0,'rows':[]};var _0x5c5d52=db[_0xbf8f('0x38')]['rawAttributes'];_0x24d0a3[_0xbf8f('0x39')]=_[_0xbf8f('0x3a')](_0x5c5d52);_0x24d0a3[_0xbf8f('0x3b')]=_[_0xbf8f('0x3a')](_0x18fc7a[_0xbf8f('0x3b')]);_0x24d0a3[_0xbf8f('0x3c')]=_[_0xbf8f('0x3d')](_0x24d0a3['model'],_0x24d0a3[_0xbf8f('0x3b')]);_0x3cb500['attributes']=_[_0xbf8f('0x3d')](_0x24d0a3[_0xbf8f('0x39')],qs[_0xbf8f('0x3e')](_0x18fc7a[_0xbf8f('0x3b')]['fields']));_0x3cb500[_0xbf8f('0x3f')]=_0x3cb500[_0xbf8f('0x3f')][_0xbf8f('0x40')]?_0x3cb500[_0xbf8f('0x3f')]:_0x24d0a3['model'];if(!_0x18fc7a['query'][_0xbf8f('0x41')](_0xbf8f('0x42'))){_0x3cb500['limit']=qs[_0xbf8f('0x43')](_0x18fc7a[_0xbf8f('0x3b')]['limit']);_0x3cb500['offset']=qs[_0xbf8f('0x2f')](_0x18fc7a[_0xbf8f('0x3b')]['offset']);}_0x3cb500[_0xbf8f('0x44')]=qs['sort'](_0x18fc7a['query'][_0xbf8f('0x45')]);_0x3cb500[_0xbf8f('0x46')]=qs['filters'](_[_0xbf8f('0x47')](_0x18fc7a[_0xbf8f('0x3b')],_0x24d0a3[_0xbf8f('0x3c')]));if(_0x18fc7a[_0xbf8f('0x3b')][_0xbf8f('0x48')]){_0x3cb500[_0xbf8f('0x46')]=_[_0xbf8f('0x49')](_0x3cb500['where'],{'$or':_[_0xbf8f('0x4a')](_0x5c5d52,function(_0x462245){if(_0x462245['type'][_0xbf8f('0x4b')]!==_0xbf8f('0x4c')){var _0x4bd7f4={};_0x4bd7f4[_0x462245[_0xbf8f('0x4d')]]={'$like':'%'+_0x18fc7a[_0xbf8f('0x3b')][_0xbf8f('0x48')]+'%'};return _0x4bd7f4;}})});}_0x3cb500=_[_0xbf8f('0x49')]({},_0x3cb500,_0x18fc7a[_0xbf8f('0x4e')]);var _0x261834={'where':_0x3cb500[_0xbf8f('0x46')]};return db[_0xbf8f('0x38')]['count'](_0x261834)[_0xbf8f('0x33')](function(_0x45b78c){_0x36acc2[_0xbf8f('0x2e')]=_0x45b78c;if(_0x18fc7a['query'][_0xbf8f('0x4f')]){_0x3cb500['include']=[{'all':!![]}];}return db[_0xbf8f('0x38')][_0xbf8f('0x50')](_0x3cb500);})['then'](function(_0x4d66db){_0x36acc2[_0xbf8f('0x51')]=_0x4d66db;return _0x36acc2;})[_0xbf8f('0x33')](respondWithFilteredResult(_0x2ecc86,_0x3cb500))['catch'](handleError(_0x2ecc86,null));};exports['show']=function(_0x1819c3,_0x1f725f){var _0x23b848={'raw':!![],'where':{'id':_0x1819c3['params']['id']}},_0x4da350={};_0x4da350[_0xbf8f('0x39')]=_[_0xbf8f('0x3a')](db[_0xbf8f('0x38')]['rawAttributes']);_0x4da350[_0xbf8f('0x3b')]=_[_0xbf8f('0x3a')](_0x1819c3['query']);_0x4da350[_0xbf8f('0x3c')]=_['intersection'](_0x4da350[_0xbf8f('0x39')],_0x4da350[_0xbf8f('0x3b')]);_0x23b848[_0xbf8f('0x3f')]=_[_0xbf8f('0x3d')](_0x4da350[_0xbf8f('0x39')],qs['fields'](_0x1819c3[_0xbf8f('0x3b')]['fields']));_0x23b848[_0xbf8f('0x3f')]=_0x23b848['attributes'][_0xbf8f('0x40')]?_0x23b848[_0xbf8f('0x3f')]:_0x4da350['model'];if(_0x1819c3[_0xbf8f('0x3b')]['includeAll']){_0x23b848[_0xbf8f('0x52')]=[{'all':!![]}];}_0x23b848=_[_0xbf8f('0x49')]({},_0x23b848,_0x1819c3[_0xbf8f('0x4e')]);return db['MailMessage'][_0xbf8f('0x53')](_0x23b848)[_0xbf8f('0x33')](handleEntityNotFound(_0x1f725f,null))[_0xbf8f('0x33')](respondWithResult(_0x1f725f,null))[_0xbf8f('0x29')](handleError(_0x1f725f,null));};exports[_0xbf8f('0x32')]=function(_0x4f49ac,_0x52b022){if(_0x4f49ac[_0xbf8f('0x54')]['id']){delete _0x4f49ac[_0xbf8f('0x54')]['id'];}return db[_0xbf8f('0x38')][_0xbf8f('0x53')]({'where':{'id':_0x4f49ac['params']['id']}})[_0xbf8f('0x33')](handleEntityNotFound(_0x52b022,null))[_0xbf8f('0x33')](saveUpdates(_0x4f49ac['body'],null))[_0xbf8f('0x33')](respondWithResult(_0x52b022,null))[_0xbf8f('0x29')](handleError(_0x52b022,null));};exports[_0xbf8f('0x34')]=function(_0x128ac9,_0x293c7f){return db[_0xbf8f('0x38')][_0xbf8f('0x53')]({'where':{'id':_0x128ac9[_0xbf8f('0x55')]['id']}})[_0xbf8f('0x33')](handleEntityNotFound(_0x293c7f,null))[_0xbf8f('0x33')](removeEntity(_0x293c7f,null))['catch'](handleError(_0x293c7f,null));};exports['describe']=function(_0x123b40,_0x4c42b7){return db[_0xbf8f('0x38')][_0xbf8f('0x56')]()['then'](respondWithResult(_0x4c42b7,null))['catch'](handleError(_0x4c42b7,null));};exports[_0xbf8f('0x57')]=function(_0x45e7cd,_0x35083a){return db[_0xbf8f('0x38')][_0xbf8f('0x57')](_0x45e7cd[_0xbf8f('0x54')])[_0xbf8f('0x33')](function(_0x306fa2){if(_0x306fa2){if(_0x306fa2[_0xbf8f('0x58')]===_0xbf8f('0x59')&&!_0x306fa2[_0xbf8f('0x5a')]){return db[_0xbf8f('0x5b')][_0xbf8f('0x5c')]({'where':{'id':_0x306fa2[_0xbf8f('0x5d')]},'include':[{'model':db['MailServerOut'],'as':_0xbf8f('0x5e'),'raw':!![]}]})[_0xbf8f('0x33')](function(_0x4f8e78){if(_0x4f8e78&&_0x4f8e78['Smtp']){var _0x315217={'tls':{'rejectUnauthorized':![]}};if(_[_0xbf8f('0x5f')](_0x4f8e78[_0xbf8f('0x5e')][_0xbf8f('0x60')])){_0x315217[_0xbf8f('0x61')]=_0x4f8e78['Smtp'][_0xbf8f('0x61')];_0x315217[_0xbf8f('0x62')]=_0x4f8e78[_0xbf8f('0x5e')]['port'];_0x315217[_0xbf8f('0x63')]=_0x4f8e78[_0xbf8f('0x5e')][_0xbf8f('0x63')];if(_0x4f8e78[_0xbf8f('0x5e')][_0xbf8f('0x64')]){_0x315217[_0xbf8f('0x65')]={'user':_0x4f8e78[_0xbf8f('0x5e')][_0xbf8f('0x66')],'pass':_0x4f8e78['Smtp'][_0xbf8f('0x67')]};}}else{_0x315217[_0xbf8f('0x60')]=_0x4f8e78['Smtp']['service'];_0x315217['auth']={'user':_0x4f8e78[_0xbf8f('0x5e')][_0xbf8f('0x66')],'pass':_0x4f8e78['Smtp'][_0xbf8f('0x67')]};_0x315217[_0xbf8f('0x63')]=_0x4f8e78['Smtp'][_0xbf8f('0x63')];}if(_0x45e7cd['body']['attachments']&&_0x45e7cd[_0xbf8f('0x54')][_0xbf8f('0x68')]['length']){for(var _0x1b96ec=0x0;_0x1b96ec<_0x45e7cd[_0xbf8f('0x54')][_0xbf8f('0x68')][_0xbf8f('0x40')];_0x1b96ec+=0x1){_0x45e7cd['body'][_0xbf8f('0x68')][_0x1b96ec]={'filename':_0x45e7cd[_0xbf8f('0x54')][_0xbf8f('0x68')][_0x1b96ec][_0xbf8f('0x35')],'path':path[_0xbf8f('0x69')](config[_0xbf8f('0x6a')],_0xbf8f('0x6b'),_0x45e7cd[_0xbf8f('0x54')][_0xbf8f('0x68')][_0x1b96ec][_0xbf8f('0x6c')])};}}return{'account':_0x315217,'message':_0x45e7cd[_0xbf8f('0x54')]};}})[_0xbf8f('0x33')](function(_0x14055b){if(_0x14055b){return respondWithRpcPromise(_0xbf8f('0x6d'),_0xbf8f('0x6e'),_0x14055b,client9003)['then'](function(_0x15df2f){return _0x306fa2['update']({'read':!![],'messageId':_0x15df2f[_0xbf8f('0x6f')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0xbf8f('0x29')](function(_0x5b5733){logger['error']('%s',JSON[_0xbf8f('0x24')](_0x5b5733));return _0x306fa2;});}return _0x306fa2;});}return _0x306fa2;}})['then'](respondWithResult(_0x35083a,0xc9))[_0xbf8f('0x29')](handleError(_0x35083a,null));};var interaction_log=require(_0xbf8f('0x12'))('mail-interactions');exports['accept']=function(_0x46e6d8,_0x567f0f,_0x3712e8){var _0x5a954c={'channel':_0xbf8f('0x70')};if(_0x46e6d8[_0xbf8f('0x54')]['id']){delete _0x46e6d8['body']['id'];}_0x46e6d8[_0xbf8f('0x54')][_0xbf8f('0x71')]=!![];_0x46e6d8[_0xbf8f('0x54')][_0xbf8f('0x72')]=moment()['format'](_0xbf8f('0x73'));_0x46e6d8[_0xbf8f('0x54')][_0xbf8f('0x74')]=_0x46e6d8[_0xbf8f('0x54')][_0xbf8f('0x74')]||_0x46e6d8[_0xbf8f('0x66')]['id'];return db[_0xbf8f('0x38')]['find']({'where':{'id':_0x46e6d8[_0xbf8f('0x55')]['id'],'UserId':null},'include':[{'model':db[_0xbf8f('0x75')],'as':_0xbf8f('0x76')}]})[_0xbf8f('0x33')](handleEntityNotFound(_0x567f0f,null))['then'](saveUpdates(_0x46e6d8['body'],null))[_0xbf8f('0x33')](function(_0x37d799){if(_0x37d799){_0x5a954c[_0xbf8f('0x27')]=_0x37d799[_0xbf8f('0x77')]({'plain':!![]});return db['MailInteraction'][_0xbf8f('0x53')]({'where':{'id':_0x37d799[_0xbf8f('0x78')]}});}return null;})[_0xbf8f('0x33')](handleEntityNotFound(_0x567f0f,null))['then'](function(_0x5371e2){if(_0x5371e2){return _0x5371e2['update']({'UserId':_0x46e6d8[_0xbf8f('0x54')][_0xbf8f('0x74')],'read1stAt':_['isNil'](_0x5371e2['read1stAt'])?moment()[_0xbf8f('0x79')](_0xbf8f('0x73')):undefined});}return null;})[_0xbf8f('0x33')](function(_0x350cfb){if(_0x350cfb){_0x5a954c[_0xbf8f('0x7a')]=_0x350cfb[_0xbf8f('0x77')]({'plain':!![]});interaction_log[_0xbf8f('0x1f')](_0xbf8f('0x7b'),_0x46e6d8['user']['id'],_0x46e6d8['user']['name'],_0x46e6d8[_0xbf8f('0x66')]['role'],_0x5a954c[_0xbf8f('0x7a')]['id'],_0x46e6d8[_0xbf8f('0x54')]?JSON['stringify'](_0x46e6d8[_0xbf8f('0x54')]):'null');return respondWithRpcPromise(_0xbf8f('0x7c'),_0xbf8f('0x7d'),_0x5a954c);}return null;})['then'](function(_0x2558fc){if(_0x2558fc){if(_0x46e6d8[_0xbf8f('0x54')][_0xbf8f('0x7e')]){_0x5a954c[_0xbf8f('0x27')][_0xbf8f('0x7f')]=util[_0xbf8f('0x79')](_0xbf8f('0x80'),_0x46e6d8[_0xbf8f('0x66')]['name']);_0x5a954c[_0xbf8f('0x27')][_0xbf8f('0x81')]=_0x5a954c[_0xbf8f('0x81')];_0x5a954c[_0xbf8f('0x27')][_0xbf8f('0x82')]=_0xbf8f('0x83');return respondWithRpcPromise(_0xbf8f('0x84'),'EventManager',{'event':'acceptmessage','message':_0x5a954c[_0xbf8f('0x27')]},client9002)['then'](function(){return _0x5a954c;});}return _0x5a954c;}return null;})[_0xbf8f('0x33')](respondWithResult(_0x567f0f,null))[_0xbf8f('0x29')](handleError(_0x567f0f,null));};var interaction_log=require(_0xbf8f('0x12'))(_0xbf8f('0x85'));exports[_0xbf8f('0x86')]=function(_0x4aadae,_0xf57f77,_0xe04649){var _0x1281db={'agent':{},'channel':_0xbf8f('0x70')};if(_0x4aadae[_0xbf8f('0x54')]['id']){delete _0x4aadae[_0xbf8f('0x54')]['id'];}_0x4aadae['body']['UserId']=_0x4aadae[_0xbf8f('0x54')][_0xbf8f('0x74')]||_0x4aadae[_0xbf8f('0x66')]['id'];_0x1281db[_0xbf8f('0x87')]['id']=_0x4aadae[_0xbf8f('0x54')][_0xbf8f('0x74')];return db['MailMessage'][_0xbf8f('0x53')]({'where':{'id':_0x4aadae['params']['id'],'UserId':null}})[_0xbf8f('0x33')](handleEntityNotFound(_0xf57f77,null))[_0xbf8f('0x33')](function(_0x5c1843){if(_0x5c1843){_0x1281db['message']=_0x5c1843[_0xbf8f('0x77')]({'plain':!![]});return db[_0xbf8f('0x88')][_0xbf8f('0x53')]({'where':{'id':_0x5c1843[_0xbf8f('0x78')]}});}return null;})[_0xbf8f('0x33')](handleEntityNotFound(_0xf57f77,null))[_0xbf8f('0x33')](function(_0x309ace){if(_0x309ace){_0x1281db[_0xbf8f('0x7a')]=_0x309ace[_0xbf8f('0x77')]({'plain':!![]});interaction_log[_0xbf8f('0x1f')](_0xbf8f('0x89'),_0x4aadae['user']['id'],_0x4aadae[_0xbf8f('0x66')][_0xbf8f('0x35')],_0x4aadae[_0xbf8f('0x66')][_0xbf8f('0x8a')],_0x1281db['interaction']['id'],_0x4aadae[_0xbf8f('0x54')]?JSON[_0xbf8f('0x24')](_0x4aadae[_0xbf8f('0x54')]):_0xbf8f('0x8b'));return respondWithRpcPromise('RejectMessage',_0xbf8f('0x8c'),_0x1281db);}return null;})[_0xbf8f('0x33')](function(_0x441efc){if(_0x441efc){_0x441efc['message']['interface']=util[_0xbf8f('0x79')](_0xbf8f('0x80'),_0x4aadae['user'][_0xbf8f('0x35')]);_0x441efc[_0xbf8f('0x27')][_0xbf8f('0x81')]=_0x1281db['channel'];_0x441efc[_0xbf8f('0x27')][_0xbf8f('0x82')]=_0xbf8f('0x86');respondWithRpcPromise(_0xbf8f('0x84'),_0xbf8f('0x84'),{'event':_0xbf8f('0x8d'),'message':_0x441efc[_0xbf8f('0x27')]},client9002);return _0x1281db;}return null;})[_0xbf8f('0x33')](respondWithResult(_0xf57f77,null))[_0xbf8f('0x29')](handleError(_0xf57f77,null));};exports['download']=function(_0x4a442c,_0x378625){var _0x1c0cd8=moment()[_0xbf8f('0x8e')]()[_0xbf8f('0x8f')]();var _0x154692=path['join'](config['root'],_0xbf8f('0x90'),'files',_0xbf8f('0x91'));var _0x23597f=path[_0xbf8f('0x69')](config['root'],_0xbf8f('0x90'),_0xbf8f('0x92'),'attachments');var _0x3a81c5=util[_0xbf8f('0x79')](_0xbf8f('0x93'),_0x1c0cd8);return db[_0xbf8f('0x38')][_0xbf8f('0x53')]({'where':{'id':_0x4a442c[_0xbf8f('0x55')]['id']},'attributes':['id',_0xbf8f('0x54'),_0xbf8f('0x94'),'to','cc',_0xbf8f('0x95'),_0xbf8f('0x96'),_0xbf8f('0x97')],'include':_0x4a442c['query'][_0xbf8f('0x68')]?[{'model':db['Attachment'],'as':_0xbf8f('0x98')}]:undefined})[_0xbf8f('0x33')](handleEntityNotFound(_0x378625,null))[_0xbf8f('0x33')](function(_0x3c7c00){if(_0x3c7c00){var _0x42a784=_0x3c7c00;var _0x14942f={'from':_0x42a784[_0xbf8f('0x94')],'to':_0x42a784['to'],'subject':_0x42a784['subject'],'html':_0x42a784['body'],'headers':{'Date':moment(_0x42a784[_0xbf8f('0x97')])[_0xbf8f('0x79')](_0xbf8f('0x99'))},'attachments':[]};if(_0x3c7c00['cc']){_0x14942f[_0xbf8f('0x9a')]['Cc']=_0x3c7c00['cc'];}if(_0x3c7c00[_0xbf8f('0x95')]){_0x14942f['headers'][_0xbf8f('0x9b')]=_0x3c7c00[_0xbf8f('0x95')];}return new BPromise(function(_0x4de7b5,_0x4af312){if(_0x3c7c00[_0xbf8f('0x98')]){for(var _0x1ed1d5=0x0;_0x1ed1d5<_0x3c7c00['Attachments'][_0xbf8f('0x40')];_0x1ed1d5++){var _0x277132=_0x3c7c00[_0xbf8f('0x98')][_0x1ed1d5];var _0x392a4f=path[_0xbf8f('0x69')](_0x23597f,_0x277132[_0xbf8f('0x6c')]);if(fs['existsSync'](_0x392a4f)){_0x14942f['attachments'][_0xbf8f('0x9c')]({'name':_0x277132[_0xbf8f('0x35')],'contentType':_0x277132['type'],'data':fs['readFileSync'](_0x392a4f)});}}}emlformat[_0xbf8f('0x9d')](_0x14942f,function(_0x250bc2,_0x5b1f4d){if(_0x250bc2)return _0x4af312(_0x250bc2);fs[_0xbf8f('0x9e')](path[_0xbf8f('0x69')](_0x154692,_0x3a81c5),_0x5b1f4d);return _0x4de7b5(_0x5b1f4d);});});}})['then'](function(_0xaa67e){if(_0xaa67e){return _0x378625[_0xbf8f('0x9f')](path[_0xbf8f('0x69')](_0x154692,_0x3a81c5),_0x3a81c5,function(_0x3bd0a8){if(_0x3bd0a8){console[_0xbf8f('0xa0')](_0xbf8f('0xa1'),_0x3bd0a8);}else{fs[_0xbf8f('0xa2')](path['join'](_0x154692,_0x3a81c5));}});}})[_0xbf8f('0x29')](handleError(_0x378625,null));}; \ No newline at end of file +var _0x03d0=['reject','save','destroy','stack','name','send','index','MailMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','merge','update','body','find','params','describe','create','direction','secret','MailAccount','MailAccountId','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','mail','read','readAt','UserId','CmContact','get','MailInteraction','MailInteractionId','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','manual','SIP/%s','channel','EventManager','acceptmessage','null','RejectMessage','rejectMessage','event','download','unix','toString','server','files','tmp','from','bcc','subject','Attachment','Attachments','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','push','readFileSync','build','writeFileSync','log','err','html-pdf','eml-format','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','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','test','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply'];(function(_0x59ee41,_0xaf7db8){var _0x3ecd3e=function(_0x2f9291){while(--_0x2f9291){_0x59ee41['push'](_0x59ee41['shift']());}};_0x3ecd3e(++_0xaf7db8);}(_0x03d0,0x10e));var _0x003d=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x03d0[_0x432682];return _0x463d05;};'use strict';var pdf=require(_0x003d('0x0'));var emlformat=require(_0x003d('0x1'));var rimraf=require(_0x003d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x003d('0x3'));var rp=require(_0x003d('0x4'));var moment=require(_0x003d('0x5'));var BPromise=require(_0x003d('0x6'));var Mustache=require(_0x003d('0x7'));var util=require(_0x003d('0x8'));var path=require(_0x003d('0x9'));var sox=require(_0x003d('0xa'));var csv=require(_0x003d('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x003d('0xc'));var squel=require(_0x003d('0xd'));var crypto=require(_0x003d('0xe'));var jsforce=require(_0x003d('0xf'));var deskjs=require(_0x003d('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x003d('0x11'));var Redis=require(_0x003d('0x12'));var authService=require(_0x003d('0x13'));var qs=require(_0x003d('0x14'));var hardwareService=require(_0x003d('0x15'));var logger=require(_0x003d('0x16'))(_0x003d('0x17'));var utils=require('../../config/utils');var config=require(_0x003d('0x18'));var db=require(_0x003d('0x19'))['db'];config[_0x003d('0x1a')]=_[_0x003d('0x1b')](config[_0x003d('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x003d('0x1c'))(new Redis(config['redis']));require('./mailMessage.socket')[_0x003d('0x1d')](socket);var jayson=require(_0x003d('0x1e'));var client=jayson[_0x003d('0x1f')][_0x003d('0x20')]({'port':0x232c});var client9003=jayson['client']['http']({'port':0x232b});var client9002=jayson['client'][_0x003d('0x20')]({'port':0x232a});function checkPasswordPattern(_0x2ea3e4,_0x55c9fe,_0x26bdb8){if(_0x26bdb8){var _0x133162=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x133162[_0x003d('0x21')](_0x55c9fe)){return _0x2ea3e4;}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 _0x2ea3e4;}}function respondWithRpcPromise(_0x3c0c17,_0x141f6b,_0x44fda7,_0x14b879){return new BPromise(function(_0x33dfc0,_0x55f19d){var _0x253250=_0x14b879||client;return _0x253250[_0x003d('0x22')](_0x3c0c17,_0x44fda7)[_0x003d('0x23')](function(_0x44280a){logger[_0x003d('0x24')](_0x003d('0x25'),_0x141f6b,_0x003d('0x26'));logger[_0x003d('0x27')](_0x003d('0x28'),_0x141f6b,_0x003d('0x26'),JSON[_0x003d('0x29')](_0x44280a));if(_0x44280a[_0x003d('0x2a')]){if(_0x44280a[_0x003d('0x2a')][_0x003d('0x2b')]===0x1f4){logger[_0x003d('0x2a')](_0x003d('0x25'),_0x141f6b,_0x44280a[_0x003d('0x2a')][_0x003d('0x2c')]);return _0x55f19d(_0x44280a['error'][_0x003d('0x2c')]);}logger[_0x003d('0x2a')](_0x003d('0x25'),_0x141f6b,_0x44280a[_0x003d('0x2a')][_0x003d('0x2c')]);return _0x33dfc0(_0x44280a[_0x003d('0x2a')][_0x003d('0x2c')]);}else{logger[_0x003d('0x24')](_0x003d('0x25'),_0x141f6b,_0x003d('0x26'));_0x33dfc0(_0x44280a[_0x003d('0x2d')][_0x003d('0x2c')]);}})[_0x003d('0x2e')](function(_0x5a9e26){logger[_0x003d('0x2a')]('MailMessage,\x20%s,\x20%s',_0x141f6b,_0x5a9e26);_0x55f19d(_0x5a9e26);});});}function respondWithStatusCode(_0x29dfde,_0x3ab871){_0x3ab871=_0x3ab871||0xcc;return function(_0x12edba){if(_0x12edba){return _0x29dfde[_0x003d('0x2f')](_0x3ab871);}return _0x29dfde[_0x003d('0x30')](_0x3ab871)['end']();};}function respondWithResult(_0x29a909,_0x115fca){_0x115fca=_0x115fca||0xc8;return function(_0x3a6642){if(_0x3a6642){return _0x29a909[_0x003d('0x30')](_0x115fca)[_0x003d('0x31')](_0x3a6642);}};}function respondWithFilteredResult(_0x1824ed,_0x1ed006){return function(_0x2fd3f7){if(_0x2fd3f7){var _0x4d831c=_0x2fd3f7[_0x003d('0x32')],_0x1994cd=_0x1ed006[_0x003d('0x33')],_0x5ac63e=_0x1ed006[_0x003d('0x33')]+_0x1ed006[_0x003d('0x34')],_0x2b533c;if(_0x5ac63e>=_0x4d831c){_0x5ac63e=_0x4d831c;_0x2b533c=0xc8;}else{_0x2b533c=0xce;}_0x1824ed[_0x003d('0x30')](_0x2b533c);return _0x1824ed[_0x003d('0x35')](_0x003d('0x36'),_0x1994cd+'-'+_0x5ac63e+'/'+_0x4d831c)[_0x003d('0x31')](_0x2fd3f7);}return null;};}function patchUpdates(_0x31d3e0){return function(_0x1d638a){try{jsonpatch[_0x003d('0x37')](_0x1d638a,_0x31d3e0,!![]);}catch(_0x253f5c){return BPromise[_0x003d('0x38')](_0x253f5c);}return _0x1d638a[_0x003d('0x39')]();};}function saveUpdates(_0x42b600,_0x47eb1d){return function(_0x44ee96){if(_0x44ee96){return _0x44ee96['update'](_0x42b600)[_0x003d('0x23')](function(_0xba033){return _0xba033;});}return null;};}function removeEntity(_0x386277,_0x379e49){return function(_0xaac2a0){if(_0xaac2a0){return _0xaac2a0[_0x003d('0x3a')]()[_0x003d('0x23')](function(){_0x386277[_0x003d('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c95e8,_0x1279c0){return function(_0x2cb83d){if(!_0x2cb83d){_0x5c95e8['sendStatus'](0x194);}return _0x2cb83d;};}function handleError(_0x4ed210,_0x18f26d){_0x18f26d=_0x18f26d||0x1f4;return function(_0x46d3f2){logger[_0x003d('0x2a')](_0x46d3f2[_0x003d('0x3b')]);if(_0x46d3f2[_0x003d('0x3c')]){delete _0x46d3f2[_0x003d('0x3c')];}_0x4ed210['status'](_0x18f26d)[_0x003d('0x3d')](_0x46d3f2);};}exports[_0x003d('0x3e')]=function(_0x385213,_0x44812e){var _0x962945={},_0x54c9aa={},_0x6b4cfd={'count':0x0,'rows':[]};var _0x286b22=db[_0x003d('0x3f')][_0x003d('0x40')];_0x54c9aa[_0x003d('0x41')]=_[_0x003d('0x42')](_0x286b22);_0x54c9aa[_0x003d('0x43')]=_[_0x003d('0x42')](_0x385213[_0x003d('0x43')]);_0x54c9aa[_0x003d('0x44')]=_[_0x003d('0x45')](_0x54c9aa['model'],_0x54c9aa['query']);_0x962945[_0x003d('0x46')]=_[_0x003d('0x45')](_0x54c9aa['model'],qs[_0x003d('0x47')](_0x385213['query'][_0x003d('0x47')]));_0x962945[_0x003d('0x46')]=_0x962945[_0x003d('0x46')][_0x003d('0x48')]?_0x962945['attributes']:_0x54c9aa[_0x003d('0x41')];if(!_0x385213[_0x003d('0x43')][_0x003d('0x49')]('nolimit')){_0x962945[_0x003d('0x34')]=qs[_0x003d('0x34')](_0x385213[_0x003d('0x43')]['limit']);_0x962945[_0x003d('0x33')]=qs[_0x003d('0x33')](_0x385213[_0x003d('0x43')][_0x003d('0x33')]);}_0x962945[_0x003d('0x4a')]=qs[_0x003d('0x4b')](_0x385213[_0x003d('0x43')][_0x003d('0x4b')]);_0x962945[_0x003d('0x4c')]=qs[_0x003d('0x44')](_[_0x003d('0x4d')](_0x385213[_0x003d('0x43')],_0x54c9aa[_0x003d('0x44')]));if(_0x385213[_0x003d('0x43')]['filter']){_0x962945[_0x003d('0x4c')]=_['merge'](_0x962945[_0x003d('0x4c')],{'$or':_[_0x003d('0x4e')](_0x286b22,function(_0x5d2ec9){if(_0x5d2ec9[_0x003d('0x4f')][_0x003d('0x50')]!==_0x003d('0x51')){var _0x3296f5={};_0x3296f5[_0x5d2ec9[_0x003d('0x52')]]={'$like':'%'+_0x385213[_0x003d('0x43')][_0x003d('0x53')]+'%'};return _0x3296f5;}})});}_0x962945=_['merge']({},_0x962945,_0x385213[_0x003d('0x54')]);var _0x585cec={'where':_0x962945[_0x003d('0x4c')]};return db[_0x003d('0x3f')][_0x003d('0x32')](_0x585cec)[_0x003d('0x23')](function(_0x196d19){_0x6b4cfd[_0x003d('0x32')]=_0x196d19;if(_0x385213[_0x003d('0x43')][_0x003d('0x55')]){_0x962945[_0x003d('0x56')]=[{'all':!![]}];}return db['MailMessage'][_0x003d('0x57')](_0x962945);})[_0x003d('0x23')](function(_0x29d8ae){_0x6b4cfd[_0x003d('0x58')]=_0x29d8ae;return _0x6b4cfd;})[_0x003d('0x23')](respondWithFilteredResult(_0x44812e,_0x962945))[_0x003d('0x2e')](handleError(_0x44812e,null));};exports['show']=function(_0x4d19ec,_0x51929c){var _0x9c7912={'raw':!![],'where':{'id':_0x4d19ec['params']['id']}},_0x3b0a57={};_0x3b0a57['model']=_[_0x003d('0x42')](db[_0x003d('0x3f')]['rawAttributes']);_0x3b0a57[_0x003d('0x43')]=_[_0x003d('0x42')](_0x4d19ec[_0x003d('0x43')]);_0x3b0a57[_0x003d('0x44')]=_['intersection'](_0x3b0a57['model'],_0x3b0a57[_0x003d('0x43')]);_0x9c7912[_0x003d('0x46')]=_[_0x003d('0x45')](_0x3b0a57[_0x003d('0x41')],qs['fields'](_0x4d19ec[_0x003d('0x43')][_0x003d('0x47')]));_0x9c7912[_0x003d('0x46')]=_0x9c7912[_0x003d('0x46')]['length']?_0x9c7912[_0x003d('0x46')]:_0x3b0a57['model'];if(_0x4d19ec['query']['includeAll']){_0x9c7912[_0x003d('0x56')]=[{'all':!![]}];}_0x9c7912=_[_0x003d('0x59')]({},_0x9c7912,_0x4d19ec[_0x003d('0x54')]);return db['MailMessage']['find'](_0x9c7912)[_0x003d('0x23')](handleEntityNotFound(_0x51929c,null))[_0x003d('0x23')](respondWithResult(_0x51929c,null))[_0x003d('0x2e')](handleError(_0x51929c,null));};exports[_0x003d('0x5a')]=function(_0x423a2b,_0x126fa){if(_0x423a2b['body']['id']){delete _0x423a2b[_0x003d('0x5b')]['id'];}return db[_0x003d('0x3f')][_0x003d('0x5c')]({'where':{'id':_0x423a2b[_0x003d('0x5d')]['id']}})[_0x003d('0x23')](handleEntityNotFound(_0x126fa,null))[_0x003d('0x23')](saveUpdates(_0x423a2b[_0x003d('0x5b')],null))[_0x003d('0x23')](respondWithResult(_0x126fa,null))[_0x003d('0x2e')](handleError(_0x126fa,null));};exports['destroy']=function(_0x25b463,_0x47ec79){return db[_0x003d('0x3f')][_0x003d('0x5c')]({'where':{'id':_0x25b463[_0x003d('0x5d')]['id']}})[_0x003d('0x23')](handleEntityNotFound(_0x47ec79,null))['then'](removeEntity(_0x47ec79,null))[_0x003d('0x2e')](handleError(_0x47ec79,null));};exports[_0x003d('0x5e')]=function(_0x31d4fc,_0x257e9b){return db[_0x003d('0x3f')][_0x003d('0x5e')]()[_0x003d('0x23')](respondWithResult(_0x257e9b,null))[_0x003d('0x2e')](handleError(_0x257e9b,null));};exports[_0x003d('0x5f')]=function(_0x2bbdd6,_0x39005f){return db[_0x003d('0x3f')][_0x003d('0x5f')](_0x2bbdd6[_0x003d('0x5b')])[_0x003d('0x23')](function(_0x28a43a){if(_0x28a43a){if(_0x28a43a[_0x003d('0x60')]==='out'&&!_0x28a43a[_0x003d('0x61')]){return db[_0x003d('0x62')]['findOne']({'where':{'id':_0x28a43a[_0x003d('0x63')]},'include':[{'model':db['MailServerOut'],'as':_0x003d('0x64'),'raw':!![]}]})['then'](function(_0x13d973){if(_0x13d973&&_0x13d973[_0x003d('0x64')]){var _0x2c35a3={'tls':{'rejectUnauthorized':![]}};if(_[_0x003d('0x65')](_0x13d973[_0x003d('0x64')][_0x003d('0x66')])){_0x2c35a3[_0x003d('0x67')]=_0x13d973[_0x003d('0x64')][_0x003d('0x67')];_0x2c35a3['port']=_0x13d973[_0x003d('0x64')][_0x003d('0x68')];_0x2c35a3[_0x003d('0x69')]=_0x13d973[_0x003d('0x64')]['secure'];if(_0x13d973['Smtp'][_0x003d('0x6a')]){_0x2c35a3[_0x003d('0x6b')]={'user':_0x13d973['Smtp'][_0x003d('0x6c')],'pass':_0x13d973[_0x003d('0x64')][_0x003d('0x6d')]};}}else{_0x2c35a3['service']=_0x13d973[_0x003d('0x64')][_0x003d('0x66')];_0x2c35a3[_0x003d('0x6b')]={'user':_0x13d973[_0x003d('0x64')]['user'],'pass':_0x13d973[_0x003d('0x64')][_0x003d('0x6d')]};_0x2c35a3[_0x003d('0x69')]=_0x13d973[_0x003d('0x64')][_0x003d('0x69')];}if(_0x2bbdd6[_0x003d('0x5b')][_0x003d('0x6e')]&&_0x2bbdd6[_0x003d('0x5b')][_0x003d('0x6e')][_0x003d('0x48')]){for(var _0x11a91b=0x0;_0x11a91b<_0x2bbdd6['body']['attachments'][_0x003d('0x48')];_0x11a91b+=0x1){_0x2bbdd6[_0x003d('0x5b')]['attachments'][_0x11a91b]={'filename':_0x2bbdd6[_0x003d('0x5b')][_0x003d('0x6e')][_0x11a91b]['name'],'path':path[_0x003d('0x6f')](config[_0x003d('0x70')],_0x003d('0x71'),_0x2bbdd6['body'][_0x003d('0x6e')][_0x11a91b][_0x003d('0x72')])};}}return{'account':_0x2c35a3,'message':_0x2bbdd6[_0x003d('0x5b')]};}})[_0x003d('0x23')](function(_0x17d399){if(_0x17d399){return respondWithRpcPromise(_0x003d('0x73'),_0x003d('0x74'),_0x17d399,client9003)[_0x003d('0x23')](function(_0x254741){return _0x28a43a[_0x003d('0x5a')]({'read':!![],'messageId':_0x254741[_0x003d('0x75')],'sentAt':moment()[_0x003d('0x76')](_0x003d('0x77'))});})[_0x003d('0x2e')](function(_0x127aeb){logger['error']('%s',JSON[_0x003d('0x29')](_0x127aeb));return _0x28a43a;});}return _0x28a43a;});}return _0x28a43a;}})[_0x003d('0x23')](respondWithResult(_0x39005f,0xc9))[_0x003d('0x2e')](handleError(_0x39005f,null));};var interaction_log=require('../../config/logger')(_0x003d('0x78'));exports[_0x003d('0x79')]=function(_0x568587,_0xbb7aee,_0x251ce){var _0xfc97dd={'channel':_0x003d('0x7a')};if(_0x568587[_0x003d('0x5b')]['id']){delete _0x568587[_0x003d('0x5b')]['id'];}_0x568587[_0x003d('0x5b')][_0x003d('0x7b')]=!![];_0x568587[_0x003d('0x5b')][_0x003d('0x7c')]=moment()[_0x003d('0x76')](_0x003d('0x77'));_0x568587[_0x003d('0x5b')][_0x003d('0x7d')]=_0x568587[_0x003d('0x5b')][_0x003d('0x7d')]||_0x568587[_0x003d('0x6c')]['id'];return db[_0x003d('0x3f')][_0x003d('0x5c')]({'where':{'id':_0x568587[_0x003d('0x5d')]['id'],'UserId':null},'include':[{'model':db[_0x003d('0x7e')],'as':'Contact'}]})['then'](handleEntityNotFound(_0xbb7aee,null))[_0x003d('0x23')](saveUpdates(_0x568587[_0x003d('0x5b')],null))['then'](function(_0xe8676a){if(_0xe8676a){_0xfc97dd['message']=_0xe8676a[_0x003d('0x7f')]({'plain':!![]});return db[_0x003d('0x80')][_0x003d('0x5c')]({'where':{'id':_0xe8676a[_0x003d('0x81')]}});}return null;})[_0x003d('0x23')](handleEntityNotFound(_0xbb7aee,null))[_0x003d('0x23')](function(_0x47355e){if(_0x47355e){return _0x47355e[_0x003d('0x5a')]({'UserId':_0x568587['body'][_0x003d('0x7d')],'read1stAt':_['isNil'](_0x47355e['read1stAt'])?moment()['format'](_0x003d('0x77')):undefined});}return null;})['then'](function(_0x30d0a3){if(_0x30d0a3){_0xfc97dd[_0x003d('0x82')]=_0x30d0a3['get']({'plain':!![]});interaction_log[_0x003d('0x24')](_0x003d('0x83'),_0x568587[_0x003d('0x6c')]['id'],_0x568587[_0x003d('0x6c')][_0x003d('0x3c')],_0x568587[_0x003d('0x6c')][_0x003d('0x84')],_0xfc97dd['interaction']['id'],_0x568587['body']?JSON[_0x003d('0x29')](_0x568587[_0x003d('0x5b')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0xfc97dd);}return null;})[_0x003d('0x23')](function(_0x2f6634){if(_0x2f6634){if(_0x568587[_0x003d('0x5b')][_0x003d('0x85')]){_0xfc97dd[_0x003d('0x2c')]['interface']=util[_0x003d('0x76')](_0x003d('0x86'),_0x568587[_0x003d('0x6c')][_0x003d('0x3c')]);_0xfc97dd['message'][_0x003d('0x87')]=_0xfc97dd['channel'];_0xfc97dd[_0x003d('0x2c')]['event']=_0x003d('0x79');return respondWithRpcPromise('EventManager',_0x003d('0x88'),{'event':_0x003d('0x89'),'message':_0xfc97dd['message']},client9002)['then'](function(){return _0xfc97dd;});}return _0xfc97dd;}return null;})[_0x003d('0x23')](respondWithResult(_0xbb7aee,null))[_0x003d('0x2e')](handleError(_0xbb7aee,null));};var interaction_log=require(_0x003d('0x16'))(_0x003d('0x78'));exports[_0x003d('0x38')]=function(_0x31ac7e,_0x1fb358,_0x4a59da){var _0x945665={'agent':{},'channel':'mail'};if(_0x31ac7e['body']['id']){delete _0x31ac7e[_0x003d('0x5b')]['id'];}_0x31ac7e['body'][_0x003d('0x7d')]=_0x31ac7e['body']['UserId']||_0x31ac7e[_0x003d('0x6c')]['id'];_0x945665['agent']['id']=_0x31ac7e[_0x003d('0x5b')][_0x003d('0x7d')];return db[_0x003d('0x3f')][_0x003d('0x5c')]({'where':{'id':_0x31ac7e[_0x003d('0x5d')]['id'],'UserId':null}})[_0x003d('0x23')](handleEntityNotFound(_0x1fb358,null))[_0x003d('0x23')](function(_0x2b996e){if(_0x2b996e){_0x945665[_0x003d('0x2c')]=_0x2b996e[_0x003d('0x7f')]({'plain':!![]});return db[_0x003d('0x80')][_0x003d('0x5c')]({'where':{'id':_0x2b996e[_0x003d('0x81')]}});}return null;})[_0x003d('0x23')](handleEntityNotFound(_0x1fb358,null))['then'](function(_0x44315c){if(_0x44315c){_0x945665[_0x003d('0x82')]=_0x44315c[_0x003d('0x7f')]({'plain':!![]});interaction_log[_0x003d('0x24')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x31ac7e['user']['id'],_0x31ac7e[_0x003d('0x6c')][_0x003d('0x3c')],_0x31ac7e['user']['role'],_0x945665[_0x003d('0x82')]['id'],_0x31ac7e[_0x003d('0x5b')]?JSON[_0x003d('0x29')](_0x31ac7e[_0x003d('0x5b')]):_0x003d('0x8a'));return respondWithRpcPromise(_0x003d('0x8b'),_0x003d('0x8c'),_0x945665);}return null;})['then'](function(_0x5c62a8){if(_0x5c62a8){_0x5c62a8['message']['interface']=util['format'](_0x003d('0x86'),_0x31ac7e[_0x003d('0x6c')][_0x003d('0x3c')]);_0x5c62a8[_0x003d('0x2c')][_0x003d('0x87')]=_0x945665[_0x003d('0x87')];_0x5c62a8['message'][_0x003d('0x8d')]='reject';respondWithRpcPromise(_0x003d('0x88'),_0x003d('0x88'),{'event':'rejectmessage','message':_0x5c62a8[_0x003d('0x2c')]},client9002);return _0x945665;}return null;})[_0x003d('0x23')](respondWithResult(_0x1fb358,null))[_0x003d('0x2e')](handleError(_0x1fb358,null));};exports[_0x003d('0x8e')]=function(_0x3e5c96,_0x264264){var _0x377475=moment()[_0x003d('0x8f')]()[_0x003d('0x90')]();var _0x18fbc0=path[_0x003d('0x6f')](config[_0x003d('0x70')],_0x003d('0x91'),_0x003d('0x92'),_0x003d('0x93'));var _0x482d0e=path[_0x003d('0x6f')](config[_0x003d('0x70')],_0x003d('0x91'),_0x003d('0x92'),_0x003d('0x6e'));var _0x23f9da=util[_0x003d('0x76')]('message-%s.eml',_0x377475);return db[_0x003d('0x3f')][_0x003d('0x5c')]({'where':{'id':_0x3e5c96[_0x003d('0x5d')]['id']},'attributes':['id',_0x003d('0x5b'),_0x003d('0x94'),'to','cc',_0x003d('0x95'),_0x003d('0x96'),'createdAt'],'include':_0x3e5c96[_0x003d('0x43')][_0x003d('0x6e')]?[{'model':db[_0x003d('0x97')],'as':_0x003d('0x98')}]:undefined})['then'](handleEntityNotFound(_0x264264,null))[_0x003d('0x23')](function(_0x2e4697){if(_0x2e4697){var _0x176f22=_0x2e4697;var _0x11e842={'from':_0x176f22['from'],'to':_0x176f22['to'],'subject':_0x176f22[_0x003d('0x96')],'html':_0x176f22[_0x003d('0x5b')],'headers':{'Date':moment(_0x176f22[_0x003d('0x99')])[_0x003d('0x76')](_0x003d('0x9a'))},'attachments':[]};if(_0x2e4697['cc']){_0x11e842['headers']['Cc']=_0x2e4697['cc'];}if(_0x2e4697[_0x003d('0x95')]){_0x11e842[_0x003d('0x9b')][_0x003d('0x9c')]=_0x2e4697['bcc'];}return new BPromise(function(_0x56d216,_0x281911){if(_0x2e4697['Attachments']){for(var _0x519aa8=0x0;_0x519aa8<_0x2e4697[_0x003d('0x98')][_0x003d('0x48')];_0x519aa8++){var _0x3f04ec=_0x2e4697[_0x003d('0x98')][_0x519aa8];var _0x38ee96=path[_0x003d('0x6f')](_0x482d0e,_0x3f04ec['basename']);if(fs['existsSync'](_0x38ee96)){_0x11e842[_0x003d('0x6e')][_0x003d('0x9d')]({'name':_0x3f04ec[_0x003d('0x3c')],'contentType':_0x3f04ec[_0x003d('0x4f')],'data':fs[_0x003d('0x9e')](_0x38ee96)});}}}emlformat[_0x003d('0x9f')](_0x11e842,function(_0xbda224,_0xe9e88e){if(_0xbda224)return _0x281911(_0xbda224);fs[_0x003d('0xa0')](path[_0x003d('0x6f')](_0x18fbc0,_0x23f9da),_0xe9e88e);return _0x56d216(_0xe9e88e);});});}})[_0x003d('0x23')](function(_0x43865d){if(_0x43865d){return _0x264264[_0x003d('0x8e')](path[_0x003d('0x6f')](_0x18fbc0,_0x23f9da),_0x23f9da,function(_0x4d9617){if(_0x4d9617){console[_0x003d('0xa1')](_0x003d('0xa2'),_0x4d9617);}else{fs['unlinkSync'](path['join'](_0x18fbc0,_0x23f9da));}});}})[_0x003d('0x2e')](handleError(_0x264264,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 6bd89a9..f793e0f 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 _0x56ce=['../../mysqldb','MailMessage','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5066f2,_0x1c8314){var _0x3e98ca=function(_0x46a5d3){while(--_0x46a5d3){_0x5066f2['push'](_0x5066f2['shift']());}};_0x3e98ca(++_0x1c8314);}(_0x56ce,0xb0));var _0xe56c=function(_0x28f97a,_0x273459){_0x28f97a=_0x28f97a-0x0;var _0x599a15=_0x56ce[_0x28f97a];return _0x599a15;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xe56c('0x0'))['db'][_0xe56c('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xe56c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe56c('0x3')};function emitEvent(_0x5de20d){return function(_0x1c0b9c,_0x3a0d7e,_0x216732){MailMessageEvents[_0xe56c('0x4')](_0x5de20d+':'+_0x1c0b9c['id'],_0x1c0b9c);MailMessageEvents[_0xe56c('0x4')](_0x5de20d,_0x1c0b9c);_0x216732(null);};}for(var e in events){if(events[_0xe56c('0x5')](e)){var event=events[e];MailMessage[_0xe56c('0x6')](e,emitEvent(event));}}module[_0xe56c('0x7')]=MailMessageEvents; \ No newline at end of file +var _0xf69d=['hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','save','remove','emit'];(function(_0x5c2348,_0x35d86e){var _0x3410ba=function(_0x102f08){while(--_0x102f08){_0x5c2348['push'](_0x5c2348['shift']());}};_0x3410ba(++_0x35d86e);}(_0xf69d,0x162));var _0xdf69=function(_0x41ddfc,_0x32dc30){_0x41ddfc=_0x41ddfc-0x0;var _0xc78985=_0xf69d[_0x41ddfc];return _0xc78985;};'use strict';var EventEmitter=require(_0xdf69('0x0'));var MailMessage=require(_0xdf69('0x1'))['db'][_0xdf69('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdf69('0x3'),'afterUpdate':'update','afterDestroy':_0xdf69('0x4')};function emitEvent(_0x1e3010){return function(_0x2de21e,_0x193850,_0x55debe){MailMessageEvents[_0xdf69('0x5')](_0x1e3010+':'+_0x2de21e['id'],_0x2de21e);MailMessageEvents['emit'](_0x1e3010,_0x2de21e);_0x55debe(null);};}for(var e in events){if(events[_0xdf69('0x6')](e)){var event=events[e];MailMessage[_0xdf69('0x7')](e,emitEvent(event));}}module[_0xdf69('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 28dabaa..230e850 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 _0x55d6=['fti_mail_messages','plainBody','subject','body','fromString','models','get','direction','toLowerCase','secret','isNil','UserId','MailInteraction','MailInteractionId','update','catch','utf8mb4','utf8mb4_unicode_ci','util','api','bluebird','request-promise','html-to-text','path','rimraf','exports','define','mail_messages','messageId'];(function(_0x2a5630,_0x1e744d){var _0x549620=function(_0x31abbc){while(--_0x31abbc){_0x2a5630['push'](_0x2a5630['shift']());}};_0x549620(++_0x1e744d);}(_0x55d6,0x18b));var _0x655d=function(_0x829897,_0x118457){_0x829897=_0x829897-0x0;var _0x1c4047=_0x55d6[_0x829897];return _0x1c4047;};'use strict';var _=require('lodash');var util=require(_0x655d('0x0'));var logger=require('../../config/logger')(_0x655d('0x1'));var moment=require('moment');var BPromise=require(_0x655d('0x2'));var rp=require(_0x655d('0x3'));var htmlToText=require(_0x655d('0x4'));var fs=require('fs');var path=require(_0x655d('0x5'));var rimraf=require(_0x655d('0x6'));var config=require('../../config/environment');var attributes=require('./mailMessage.attributes');module[_0x655d('0x7')]=function(_0x36d939,_0x551264){return _0x36d939[_0x655d('0x8')]('MailMessage',attributes,{'tableName':_0x655d('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x655d('0xa')]},{'name':_0x655d('0xb'),'fields':[_0x655d('0xc'),_0x655d('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4b6484,_0x51cb40,_0x3ec120){if(_0x4b6484[_0x655d('0xe')]){_0x4b6484['plainBody']=htmlToText[_0x655d('0xf')](_0x4b6484[_0x655d('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3ec120(null,_0x51cb40);},'afterCreate':function(_0x5de927,_0x2aa9d4,_0x175a9e){var _0x342b80=_0x36d939[_0x655d('0x10')];var _0x4ec9f8=_0x5de927[_0x655d('0x11')]({'plain':!![]});if(_0x4ec9f8[_0x655d('0x12')][_0x655d('0x13')]()==='in'||_0x4ec9f8[_0x655d('0x12')][_0x655d('0x13')]()==='out'&&!_0x4ec9f8[_0x655d('0x14')]&&!_[_0x655d('0x15')](_0x4ec9f8[_0x655d('0x16')])){_0x342b80[_0x655d('0x17')]['findOne']({'where':{'id':_0x4ec9f8[_0x655d('0x18')]}})['then'](function(_0x158f98){if(_0x158f98){_0x158f98[_0x655d('0x19')]({'lastMsgAt':_0x4ec9f8['createdAt'],'lastMsgDirection':_0x4ec9f8['direction'][_0x655d('0x13')](),'lastMsgBody':_0x4ec9f8[_0x655d('0xe')]});}})[_0x655d('0x1a')](function(_0x59c244){console['error'](_0x59c244);});}_0x175a9e();}},'charset':_0x655d('0x1b'),'collate':_0x655d('0x1c')});}; \ No newline at end of file +var _0x9be7=['path','rimraf','../../config/environment','exports','define','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','body','models','get','direction','toLowerCase','secret','isNil','UserId','MailInteraction','MailInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','html-to-text'];(function(_0x319567,_0x23ea04){var _0xb49856=function(_0x437ff9){while(--_0x437ff9){_0x319567['push'](_0x319567['shift']());}};_0xb49856(++_0x23ea04);}(_0x9be7,0x7e));var _0x79be=function(_0x560448,_0x2c1082){_0x560448=_0x560448-0x0;var _0x550276=_0x9be7[_0x560448];return _0x550276;};'use strict';var _=require(_0x79be('0x0'));var util=require(_0x79be('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x79be('0x2'));var BPromise=require(_0x79be('0x3'));var rp=require(_0x79be('0x4'));var htmlToText=require(_0x79be('0x5'));var fs=require('fs');var path=require(_0x79be('0x6'));var rimraf=require(_0x79be('0x7'));var config=require(_0x79be('0x8'));var attributes=require('./mailMessage.attributes');module[_0x79be('0x9')]=function(_0x3b4c3e,_0x2493b7){return _0x3b4c3e[_0x79be('0xa')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x79be('0xb'),'fields':[_0x79be('0xb')]},{'name':_0x79be('0xc'),'fields':[_0x79be('0xd'),_0x79be('0xe')],'type':_0x79be('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4b266f,_0x365484,_0x4b7102){if(_0x4b266f['body']){_0x4b266f['plainBody']=htmlToText[_0x79be('0x10')](_0x4b266f[_0x79be('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4b7102(null,_0x365484);},'afterCreate':function(_0x45c604,_0x4dc753,_0x144962){var _0x1e8c00=_0x3b4c3e[_0x79be('0x12')];var _0x77c3b9=_0x45c604[_0x79be('0x13')]({'plain':!![]});if(_0x77c3b9[_0x79be('0x14')][_0x79be('0x15')]()==='in'||_0x77c3b9[_0x79be('0x14')][_0x79be('0x15')]()==='out'&&!_0x77c3b9[_0x79be('0x16')]&&!_[_0x79be('0x17')](_0x77c3b9[_0x79be('0x18')])){_0x1e8c00[_0x79be('0x19')]['findOne']({'where':{'id':_0x77c3b9[_0x79be('0x1a')]}})[_0x79be('0x1b')](function(_0x281dc5){if(_0x281dc5){_0x281dc5['update']({'lastMsgAt':_0x77c3b9[_0x79be('0x1c')],'lastMsgDirection':_0x77c3b9['direction'][_0x79be('0x15')](),'lastMsgBody':_0x77c3b9[_0x79be('0x11')]});}})[_0x79be('0x1d')](function(_0x4b8259){console[_0x79be('0x1e')](_0x4b8259);});}_0x144962();}},'charset':_0x79be('0x1f'),'collate':_0x79be('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 53f84dc..0d984db 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 _0x423b=['error','code','message','CreateMailMessage','create','body','options','raw','stringify','util','bluebird','ioredis','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x423b,0x12b));var _0xb423=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x423b[_0x5d2803];return _0xdcad2c;};'use strict';var _=require('lodash');var util=require(_0xb423('0x0'));var moment=require('moment');var BPromise=require(_0xb423('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb423('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb423('0x3'));var config=require(_0xb423('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xb423('0x5')][_0xb423('0x6')]({'port':0x232a});config[_0xb423('0x7')]=_[_0xb423('0x8')](config['redis'],{'host':_0xb423('0x9'),'port':0x18eb});var socket=require(_0xb423('0xa'))(new Redis(config[_0xb423('0x7')]));require(_0xb423('0xb'))[_0xb423('0xc')](socket);function respondWithRpcPromise(_0x50031c,_0x4c7c0b,_0x25926c){return new BPromise(function(_0x190099,_0x1060e6){return client[_0xb423('0xd')](_0x50031c,_0x25926c)[_0xb423('0xe')](function(_0x5b1010){logger[_0xb423('0xf')](_0xb423('0x10'),_0x4c7c0b,'request\x20sent');logger[_0xb423('0x11')](_0xb423('0x12'),_0x4c7c0b,_0xb423('0x13'),JSON['stringify'](_0x5b1010));if(_0x5b1010[_0xb423('0x14')]){if(_0x5b1010['error'][_0xb423('0x15')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x4c7c0b,_0x5b1010['error'][_0xb423('0x16')]);return _0x1060e6(_0x5b1010[_0xb423('0x14')][_0xb423('0x16')]);}logger['error'](_0xb423('0x10'),_0x4c7c0b,_0x5b1010[_0xb423('0x14')][_0xb423('0x16')]);return _0x190099(_0x5b1010[_0xb423('0x14')]['message']);}else{logger[_0xb423('0xf')](_0xb423('0x10'),_0x4c7c0b,'request\x20sent');_0x190099(_0x5b1010['result'][_0xb423('0x16')]);}})['catch'](function(_0xa924c6){logger[_0xb423('0x14')](_0xb423('0x10'),_0x4c7c0b,_0xa924c6);_0x1060e6(_0xa924c6);});});}exports[_0xb423('0x17')]=function(_0x2fb3cf){var _0x477fce=this;return new Promise(function(_0x190b1f,_0x41b213){return db['MailMessage'][_0xb423('0x18')](_0x2fb3cf[_0xb423('0x19')],{'raw':_0x2fb3cf[_0xb423('0x1a')]?_0x2fb3cf['options'][_0xb423('0x1b')]===undefined?!![]:![]:!![]})[_0xb423('0xe')](function(_0x5d4d21){logger[_0xb423('0xf')](_0xb423('0x17'),_0x2fb3cf);logger[_0xb423('0x11')]('CreateMailMessage',_0x2fb3cf,JSON[_0xb423('0x1c')](_0x5d4d21));_0x190b1f(_0x5d4d21);})['catch'](function(_0x21f531){logger['error'](_0xb423('0x17'),_0x21f531[_0xb423('0x16')],_0x2fb3cf);_0x41b213(_0x477fce['error'](0x1f4,_0x21f531[_0xb423('0x16')]));});});}; \ No newline at end of file +var _0xef8b=['info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','MailMessage,\x20%s,\x20%s','message','catch','create','body','options','CreateMailMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','then'];(function(_0x1f6efd,_0x1ff5f9){var _0x5a0ff5=function(_0x4f1f7b){while(--_0x4f1f7b){_0x1f6efd['push'](_0x1f6efd['shift']());}};_0x5a0ff5(++_0x1ff5f9);}(_0xef8b,0x192));var _0xbef8=function(_0xc315de,_0x5dc877){_0xc315de=_0xc315de-0x0;var _0x11a627=_0xef8b[_0xc315de];return _0x11a627;};'use strict';var _=require('lodash');var util=require(_0xbef8('0x0'));var moment=require(_0xbef8('0x1'));var BPromise=require(_0xbef8('0x2'));var rs=require(_0xbef8('0x3'));var fs=require('fs');var Redis=require(_0xbef8('0x4'));var db=require(_0xbef8('0x5'))['db'];var utils=require(_0xbef8('0x6'));var logger=require(_0xbef8('0x7'))(_0xbef8('0x8'));var config=require(_0xbef8('0x9'));var jayson=require(_0xbef8('0xa'));var client=jayson['client'][_0xbef8('0xb')]({'port':0x232a});config[_0xbef8('0xc')]=_[_0xbef8('0xd')](config['redis'],{'host':_0xbef8('0xe'),'port':0x18eb});var socket=require(_0xbef8('0xf'))(new Redis(config['redis']));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0xf58f5,_0x455b29,_0x3a73f1){return new BPromise(function(_0x1fe29a,_0x257a3c){return client[_0xbef8('0x10')](_0xf58f5,_0x3a73f1)[_0xbef8('0x11')](function(_0x3b778b){logger[_0xbef8('0x12')]('MailMessage,\x20%s,\x20%s',_0x455b29,_0xbef8('0x13'));logger[_0xbef8('0x14')](_0xbef8('0x15'),_0x455b29,'request\x20sent',JSON['stringify'](_0x3b778b));if(_0x3b778b['error']){if(_0x3b778b[_0xbef8('0x16')]['code']===0x1f4){logger[_0xbef8('0x16')](_0xbef8('0x17'),_0x455b29,_0x3b778b['error'][_0xbef8('0x18')]);return _0x257a3c(_0x3b778b['error']['message']);}logger[_0xbef8('0x16')]('MailMessage,\x20%s,\x20%s',_0x455b29,_0x3b778b['error'][_0xbef8('0x18')]);return _0x1fe29a(_0x3b778b[_0xbef8('0x16')][_0xbef8('0x18')]);}else{logger[_0xbef8('0x12')](_0xbef8('0x17'),_0x455b29,_0xbef8('0x13'));_0x1fe29a(_0x3b778b['result'][_0xbef8('0x18')]);}})[_0xbef8('0x19')](function(_0x55e47e){logger[_0xbef8('0x16')](_0xbef8('0x17'),_0x455b29,_0x55e47e);_0x257a3c(_0x55e47e);});});}exports['CreateMailMessage']=function(_0x8fb6af){var _0x145119=this;return new Promise(function(_0x420f8a,_0x4e763a){return db['MailMessage'][_0xbef8('0x1a')](_0x8fb6af[_0xbef8('0x1b')],{'raw':_0x8fb6af[_0xbef8('0x1c')]?_0x8fb6af[_0xbef8('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x34d494){logger[_0xbef8('0x12')](_0xbef8('0x1d'),_0x8fb6af);logger[_0xbef8('0x14')](_0xbef8('0x1d'),_0x8fb6af,JSON['stringify'](_0x34d494));_0x420f8a(_0x34d494);})[_0xbef8('0x19')](function(_0x44c4cf){logger[_0xbef8('0x16')]('CreateMailMessage',_0x44c4cf[_0xbef8('0x18')],_0x8fb6af);_0x4e763a(_0x145119['error'](0x1f4,_0x44c4cf[_0xbef8('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index b2812d1..b9284a6 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 _0x86ea=['emit','length','./mailMessage.events','update'];(function(_0x63c3c8,_0x53792d){var _0xd8bbe5=function(_0x5df3e1){while(--_0x5df3e1){_0x63c3c8['push'](_0x63c3c8['shift']());}};_0xd8bbe5(++_0x53792d);}(_0x86ea,0x86));var _0xa86e=function(_0x4411f7,_0x353c4e){_0x4411f7=_0x4411f7-0x0;var _0x8bc2f7=_0x86ea[_0x4411f7];return _0x8bc2f7;};'use strict';var MailMessageEvents=require(_0xa86e('0x0'));var events=['save','remove',_0xa86e('0x1')];function createListener(_0x4940d9,_0xe5a1ca){return function(_0x4c0ce5){_0xe5a1ca[_0xa86e('0x2')](_0x4940d9,_0x4c0ce5);};}function removeListener(_0x302e5b,_0x2f400c){return function(){MailMessageEvents['removeListener'](_0x302e5b,_0x2f400c);};}exports['register']=function(_0x37e466){for(var _0x582e92=0x0,_0x213b0f=events[_0xa86e('0x3')];_0x582e92<_0x213b0f;_0x582e92++){var _0x3b5dd2=events[_0x582e92];var _0x457c11=createListener('mailMessage:'+_0x3b5dd2,_0x37e466);MailMessageEvents['on'](_0x3b5dd2,_0x457c11);}}; \ No newline at end of file +var _0x44cd=['removeListener','length','mailMessage:','./mailMessage.events','save','remove','update','emit'];(function(_0x345dd9,_0x47ab37){var _0x2e7b67=function(_0x5b0d28){while(--_0x5b0d28){_0x345dd9['push'](_0x345dd9['shift']());}};_0x2e7b67(++_0x47ab37);}(_0x44cd,0xd3));var _0xd44c=function(_0x72895a,_0x433607){_0x72895a=_0x72895a-0x0;var _0x5226d5=_0x44cd[_0x72895a];return _0x5226d5;};'use strict';var MailMessageEvents=require(_0xd44c('0x0'));var events=[_0xd44c('0x1'),_0xd44c('0x2'),_0xd44c('0x3')];function createListener(_0x341d25,_0x281ffe){return function(_0x354f43){_0x281ffe[_0xd44c('0x4')](_0x341d25,_0x354f43);};}function removeListener(_0x3ee9bc,_0x49156d){return function(){MailMessageEvents[_0xd44c('0x5')](_0x3ee9bc,_0x49156d);};}exports['register']=function(_0x4bfbfa){for(var _0x2419b9=0x0,_0x24ca09=events[_0xd44c('0x6')];_0x2419b9<_0x24ca09;_0x2419b9++){var _0x53e571=events[_0x2419b9];var _0x4fa75a=createListener(_0xd44c('0x7')+_0x53e571,_0x4bfbfa);MailMessageEvents['on'](_0x53e571,_0x4fa75a);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 8ed03b4..a291904 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 _0x285b=['index','/describe','describe','/:id','isAuthenticated','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','put','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailQueue.controller','get'];(function(_0x4629e3,_0x4555f9){var _0x2e1e3c=function(_0x422dc6){while(--_0x422dc6){_0x4629e3['push'](_0x4629e3['shift']());}};_0x2e1e3c(++_0x4555f9);}(_0x285b,0x18c));var _0xb285=function(_0x524a05,_0x1abc7b){_0x524a05=_0x524a05-0x0;var _0x3a12e8=_0x285b[_0x524a05];return _0x3a12e8;};'use strict';var multer=require('multer');var util=require(_0xb285('0x0'));var path=require(_0xb285('0x1'));var timeout=require(_0xb285('0x2'));var express=require(_0xb285('0x3'));var router=express[_0xb285('0x4')]();var auth=require(_0xb285('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb285('0x6'));var controller=require(_0xb285('0x7'));router[_0xb285('0x8')]('/',auth['isAuthenticated'](),controller[_0xb285('0x9')]);router[_0xb285('0x8')](_0xb285('0xa'),auth['isAuthenticated'](),controller[_0xb285('0xb')]);router['get'](_0xb285('0xc'),auth[_0xb285('0xd')](),controller['show']);router['get']('/:id/members',auth[_0xb285('0xd')](),controller[_0xb285('0xe')]);router[_0xb285('0x8')](_0xb285('0xf'),auth['isAuthenticated'](),controller['getTeams']);router[_0xb285('0x8')](_0xb285('0x10'),auth['isAuthenticated'](),controller[_0xb285('0x11')]);router[_0xb285('0x12')]('/',auth[_0xb285('0xd')](),controller[_0xb285('0x13')]);router[_0xb285('0x12')](_0xb285('0xf'),auth[_0xb285('0xd')](),controller[_0xb285('0x14')]);router[_0xb285('0x12')]('/:id/users',auth[_0xb285('0xd')](),controller['addAgents']);router[_0xb285('0x15')](_0xb285('0xc'),auth[_0xb285('0xd')](),controller['update']);router[_0xb285('0x16')](_0xb285('0xc'),auth['isAuthenticated'](),controller[_0xb285('0x17')]);router[_0xb285('0x16')](_0xb285('0xf'),auth[_0xb285('0xd')](),controller[_0xb285('0x18')]);router['delete'](_0xb285('0x10'),auth[_0xb285('0xd')](),controller[_0xb285('0x19')]);module[_0xb285('0x1a')]=router; \ No newline at end of file +var _0xa9a0=['/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','update','delete','/:id','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','./mailQueue.controller','isAuthenticated','index','get','/describe','show','/:id/members','getMembers'];(function(_0x9b11c9,_0x20548a){var _0x272265=function(_0x30b837){while(--_0x30b837){_0x9b11c9['push'](_0x9b11c9['shift']());}};_0x272265(++_0x20548a);}(_0xa9a0,0x142));var _0x0a9a=function(_0x2e961f,_0x3471ae){_0x2e961f=_0x2e961f-0x0;var _0x3e4bdd=_0xa9a0[_0x2e961f];return _0x3e4bdd;};'use strict';var multer=require(_0x0a9a('0x0'));var util=require(_0x0a9a('0x1'));var path=require(_0x0a9a('0x2'));var timeout=require(_0x0a9a('0x3'));var express=require(_0x0a9a('0x4'));var router=express[_0x0a9a('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0a9a('0x6'));router['get']('/',auth[_0x0a9a('0x7')](),controller[_0x0a9a('0x8')]);router[_0x0a9a('0x9')](_0x0a9a('0xa'),auth[_0x0a9a('0x7')](),controller['describe']);router[_0x0a9a('0x9')]('/:id',auth[_0x0a9a('0x7')](),controller[_0x0a9a('0xb')]);router['get'](_0x0a9a('0xc'),auth['isAuthenticated'](),controller[_0x0a9a('0xd')]);router[_0x0a9a('0x9')](_0x0a9a('0xe'),auth[_0x0a9a('0x7')](),controller[_0x0a9a('0xf')]);router[_0x0a9a('0x9')](_0x0a9a('0x10'),auth[_0x0a9a('0x7')](),controller['getAgents']);router[_0x0a9a('0x11')]('/',auth[_0x0a9a('0x7')](),controller[_0x0a9a('0x12')]);router[_0x0a9a('0x11')](_0x0a9a('0xe'),auth[_0x0a9a('0x7')](),controller[_0x0a9a('0x13')]);router[_0x0a9a('0x11')](_0x0a9a('0x10'),auth[_0x0a9a('0x7')](),controller[_0x0a9a('0x14')]);router['put']('/:id',auth[_0x0a9a('0x7')](),controller[_0x0a9a('0x15')]);router[_0x0a9a('0x16')](_0x0a9a('0x17'),auth[_0x0a9a('0x7')](),controller[_0x0a9a('0x18')]);router['delete']('/:id/teams',auth[_0x0a9a('0x7')](),controller[_0x0a9a('0x19')]);router[_0x0a9a('0x16')](_0x0a9a('0x10'),auth[_0x0a9a('0x7')](),controller[_0x0a9a('0x1a')]);module[_0x0a9a('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index a8b4824..b0c9870 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 _0x8fe8=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x162cb1,_0x4e1df4){var _0xebc6a=function(_0x3c31c5){while(--_0x3c31c5){_0x162cb1['push'](_0x162cb1['shift']());}};_0xebc6a(++_0x4e1df4);}(_0x8fe8,0xfb));var _0x88fe=function(_0x2c35b3,_0x4c6e57){_0x2c35b3=_0x2c35b3-0x0;var _0x5aac29=_0x8fe8[_0x2c35b3];return _0x5aac29;};'use strict';var Sequelize=require(_0x88fe('0x0'));module[_0x88fe('0x1')]={'name':{'type':Sequelize[_0x88fe('0x2')],'unique':_0x88fe('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x88fe('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x88fe('0x5'),_0x88fe('0x6'),_0x88fe('0x7'))}}; \ No newline at end of file +var _0x910d=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','name'];(function(_0x564dbc,_0x37587b){var _0x5b7bbe=function(_0x1416ba){while(--_0x1416ba){_0x564dbc['push'](_0x564dbc['shift']());}};_0x5b7bbe(++_0x37587b);}(_0x910d,0x11e));var _0xd910=function(_0x238f29,_0x2e78a1){_0x238f29=_0x238f29-0x0;var _0x31503a=_0x910d[_0x238f29];return _0x31503a;};'use strict';var Sequelize=require(_0xd910('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xd910('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd910('0x2')]},'timeout':{'type':Sequelize[_0xd910('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd910('0x4')](_0xd910('0x5'),_0xd910('0x6'),_0xd910('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index a641d95..a0bec97 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 _0xc507=['html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','json','count','offset','limit','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','MailQueue','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','MailQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','order','map','UserMailQueue','User','findAndCountAll','UserId','agent','mailPause','format','%s/%s','SIP','createdAt','updatedAt','getTeams','addTeams','Team','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userMailQueue:remove','getAgents'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xc507,0x118));var _0x7c50=function(_0x164af1,_0x3cf772){_0x164af1=_0x164af1-0x0;var _0x5d81a2=_0xc507[_0x164af1];return _0x5d81a2;};'use strict';var pdf=require(_0x7c50('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7c50('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7c50('0x2'));var rp=require(_0x7c50('0x3'));var moment=require(_0x7c50('0x4'));var BPromise=require(_0x7c50('0x5'));var Mustache=require(_0x7c50('0x6'));var util=require(_0x7c50('0x7'));var path=require(_0x7c50('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7c50('0x9'));var fs=require('fs');var _=require(_0x7c50('0xa'));var squel=require(_0x7c50('0xb'));var crypto=require(_0x7c50('0xc'));var jsforce=require(_0x7c50('0xd'));var deskjs=require(_0x7c50('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7c50('0xf'));var Redis=require('ioredis');var authService=require(_0x7c50('0x10'));var qs=require(_0x7c50('0x11'));var hardwareService=require(_0x7c50('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x7c50('0x13'));var config=require(_0x7c50('0x14'));var db=require(_0x7c50('0x15'))['db'];config['redis']=_[_0x7c50('0x16')](config['redis'],{'host':_0x7c50('0x17'),'port':0x18eb});var socket=require(_0x7c50('0x18'))(new Redis(config[_0x7c50('0x19')]));require('./mailQueue.socket')[_0x7c50('0x1a')](socket);function respondWithStatusCode(_0x1f03cc,_0x3bd7de){_0x3bd7de=_0x3bd7de||0xcc;return function(_0x68b558){if(_0x68b558){return _0x1f03cc[_0x7c50('0x1b')](_0x3bd7de);}return _0x1f03cc[_0x7c50('0x1c')](_0x3bd7de)['end']();};}function respondWithResult(_0x1d5671,_0xcb8c73){_0xcb8c73=_0xcb8c73||0xc8;return function(_0x4e2172){if(_0x4e2172){return _0x1d5671[_0x7c50('0x1c')](_0xcb8c73)[_0x7c50('0x1d')](_0x4e2172);}};}function respondWithFilteredResult(_0x2c865f,_0x4ee2ef){return function(_0x1b9b43){if(_0x1b9b43){var _0x42c78f=_0x1b9b43[_0x7c50('0x1e')],_0x45d5af=_0x4ee2ef['offset'],_0x2326b2=_0x4ee2ef[_0x7c50('0x1f')]+_0x4ee2ef[_0x7c50('0x20')],_0x86b769;if(_0x2326b2>=_0x42c78f){_0x2326b2=_0x42c78f;_0x86b769=0xc8;}else{_0x86b769=0xce;}_0x2c865f[_0x7c50('0x1c')](_0x86b769);return _0x2c865f['set']('Content-Range',_0x45d5af+'-'+_0x2326b2+'/'+_0x42c78f)[_0x7c50('0x1d')](_0x1b9b43);}return null;};}function patchUpdates(_0x32e297){return function(_0x142087){try{jsonpatch[_0x7c50('0x21')](_0x142087,_0x32e297,!![]);}catch(_0x35fd06){return BPromise[_0x7c50('0x22')](_0x35fd06);}return _0x142087[_0x7c50('0x23')]();};}function saveUpdates(_0x527f9d,_0x4aafc7){return function(_0x2385bc){if(_0x2385bc){return _0x2385bc[_0x7c50('0x24')](_0x527f9d)[_0x7c50('0x25')](function(_0x20ce92){return _0x20ce92;});}return null;};}function removeEntity(_0x3bba5d,_0x134ca7){return function(_0x19b926){if(_0x19b926){return _0x19b926['destroy']()[_0x7c50('0x25')](function(){var _0x3dc7af=_0x19b926[_0x7c50('0x26')]({'plain':!![]});var _0x212b4b='MailQueues';return db[_0x7c50('0x27')][_0x7c50('0x28')]({'where':{'type':_0x212b4b,'resourceId':_0x3dc7af['id']}})[_0x7c50('0x25')](function(){return _0x19b926;});})[_0x7c50('0x25')](function(){_0x3bba5d[_0x7c50('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38c942,_0x3f3c40){return function(_0x2a1cff){if(!_0x2a1cff){_0x38c942[_0x7c50('0x1b')](0x194);}return _0x2a1cff;};}function handleError(_0x4e9ac8,_0x245f8f){_0x245f8f=_0x245f8f||0x1f4;return function(_0x4b6cc7){logger[_0x7c50('0x29')](_0x4b6cc7[_0x7c50('0x2a')]);if(_0x4b6cc7[_0x7c50('0x2b')]){delete _0x4b6cc7[_0x7c50('0x2b')];}_0x4e9ac8[_0x7c50('0x1c')](_0x245f8f)[_0x7c50('0x2c')](_0x4b6cc7);};}exports[_0x7c50('0x2d')]=function(_0x90b6e5,_0x17b214){var _0x1d6a3e={},_0x1e7863={},_0x276e8a={'count':0x0,'rows':[]};var _0x15b641=db[_0x7c50('0x2e')]['rawAttributes'];_0x1e7863['model']=_[_0x7c50('0x2f')](_0x15b641);_0x1e7863[_0x7c50('0x30')]=_[_0x7c50('0x2f')](_0x90b6e5[_0x7c50('0x30')]);_0x1e7863[_0x7c50('0x31')]=_[_0x7c50('0x32')](_0x1e7863['model'],_0x1e7863['query']);_0x1d6a3e['attributes']=_[_0x7c50('0x32')](_0x1e7863[_0x7c50('0x33')],qs[_0x7c50('0x34')](_0x90b6e5[_0x7c50('0x30')][_0x7c50('0x34')]));_0x1d6a3e['attributes']=_0x1d6a3e[_0x7c50('0x35')][_0x7c50('0x36')]?_0x1d6a3e['attributes']:_0x1e7863['model'];if(!_0x90b6e5[_0x7c50('0x30')][_0x7c50('0x37')](_0x7c50('0x38'))){_0x1d6a3e[_0x7c50('0x20')]=qs['limit'](_0x90b6e5[_0x7c50('0x30')][_0x7c50('0x20')]);_0x1d6a3e[_0x7c50('0x1f')]=qs[_0x7c50('0x1f')](_0x90b6e5['query'][_0x7c50('0x1f')]);}_0x1d6a3e['order']=qs[_0x7c50('0x39')](_0x90b6e5[_0x7c50('0x30')][_0x7c50('0x39')]);_0x1d6a3e[_0x7c50('0x3a')]=qs['filters'](_[_0x7c50('0x3b')](_0x90b6e5[_0x7c50('0x30')],_0x1e7863[_0x7c50('0x31')]));if(_0x90b6e5[_0x7c50('0x30')]['filter']){_0x1d6a3e[_0x7c50('0x3a')]=_[_0x7c50('0x3c')](_0x1d6a3e['where'],{'$or':_['map'](_0x15b641,function(_0x1fc527){if(_0x1fc527[_0x7c50('0x3d')][_0x7c50('0x3e')]!==_0x7c50('0x3f')){var _0x3f270c={};_0x3f270c[_0x1fc527['field']]={'$like':'%'+_0x90b6e5['query'][_0x7c50('0x40')]+'%'};return _0x3f270c;}})});}_0x1d6a3e=_['merge']({},_0x1d6a3e,_0x90b6e5[_0x7c50('0x41')]);var _0x3e7bda={'where':_0x1d6a3e[_0x7c50('0x3a')]};return db[_0x7c50('0x2e')][_0x7c50('0x1e')](_0x3e7bda)[_0x7c50('0x25')](function(_0x579268){_0x276e8a[_0x7c50('0x1e')]=_0x579268;if(_0x90b6e5[_0x7c50('0x30')][_0x7c50('0x42')]){_0x1d6a3e[_0x7c50('0x43')]=[{'all':!![]}];}return db[_0x7c50('0x2e')][_0x7c50('0x44')](_0x1d6a3e);})[_0x7c50('0x25')](function(_0x6946ea){_0x276e8a[_0x7c50('0x45')]=_0x6946ea;return _0x276e8a;})['then'](respondWithFilteredResult(_0x17b214,_0x1d6a3e))[_0x7c50('0x46')](handleError(_0x17b214,null));};exports['show']=function(_0x187116,_0x254a06){var _0x473b31={'raw':!![],'where':{'id':_0x187116[_0x7c50('0x47')]['id']}},_0x5acf2f={};_0x5acf2f[_0x7c50('0x33')]=_['keys'](db[_0x7c50('0x2e')][_0x7c50('0x48')]);_0x5acf2f[_0x7c50('0x30')]=_[_0x7c50('0x2f')](_0x187116[_0x7c50('0x30')]);_0x5acf2f[_0x7c50('0x31')]=_[_0x7c50('0x32')](_0x5acf2f[_0x7c50('0x33')],_0x5acf2f['query']);_0x473b31[_0x7c50('0x35')]=_['intersection'](_0x5acf2f['model'],qs[_0x7c50('0x34')](_0x187116[_0x7c50('0x30')][_0x7c50('0x34')]));_0x473b31['attributes']=_0x473b31['attributes']['length']?_0x473b31['attributes']:_0x5acf2f['model'];if(_0x187116['query'][_0x7c50('0x42')]){_0x473b31[_0x7c50('0x43')]=[{'all':!![]}];}_0x473b31=_[_0x7c50('0x3c')]({},_0x473b31,_0x187116[_0x7c50('0x41')]);return db[_0x7c50('0x2e')][_0x7c50('0x49')](_0x473b31)[_0x7c50('0x25')](handleEntityNotFound(_0x254a06,null))['then'](respondWithResult(_0x254a06,null))[_0x7c50('0x46')](handleError(_0x254a06,null));};exports[_0x7c50('0x4a')]=function(_0x4fb338,_0xf0c8c1){return db['MailQueue'][_0x7c50('0x4a')](_0x4fb338[_0x7c50('0x4b')],{})['then'](function(_0x570432){var _0x24d86a=_0x4fb338['user']['get']({'plain':!![]});if(!_0x24d86a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24d86a['role']==='user'){var _0x2a1718=_0x570432[_0x7c50('0x26')]({'plain':!![]});var _0x59f899=_0x7c50('0x4c');return db[_0x7c50('0x4d')][_0x7c50('0x49')]({'where':{'name':_0x59f899,'userProfileId':_0x24d86a[_0x7c50('0x4e')]},'raw':!![]})[_0x7c50('0x25')](function(_0xa2cd96){if(_0xa2cd96&&_0xa2cd96[_0x7c50('0x4f')]===0x0){return db[_0x7c50('0x27')]['create']({'name':_0x2a1718['name'],'resourceId':_0x2a1718['id'],'type':_0xa2cd96[_0x7c50('0x2b')],'sectionId':_0xa2cd96['id']},{})[_0x7c50('0x25')](function(){return _0x570432;});}else{return _0x570432;}})[_0x7c50('0x46')](function(_0x241415){logger[_0x7c50('0x29')](_0x7c50('0x50'),_0x241415);throw _0x241415;});}return _0x570432;})[_0x7c50('0x25')](respondWithResult(_0xf0c8c1,0xc9))[_0x7c50('0x46')](handleError(_0xf0c8c1,null));};exports[_0x7c50('0x24')]=function(_0x3f0b3b,_0x1f1628){if(_0x3f0b3b[_0x7c50('0x4b')]['id']){delete _0x3f0b3b[_0x7c50('0x4b')]['id'];}return db[_0x7c50('0x2e')][_0x7c50('0x49')]({'where':{'id':_0x3f0b3b['params']['id']}})[_0x7c50('0x25')](handleEntityNotFound(_0x1f1628,null))[_0x7c50('0x25')](saveUpdates(_0x3f0b3b[_0x7c50('0x4b')],null))[_0x7c50('0x25')](respondWithResult(_0x1f1628,null))[_0x7c50('0x46')](handleError(_0x1f1628,null));};exports[_0x7c50('0x28')]=function(_0x32cf8d,_0x112e31){return db[_0x7c50('0x2e')]['find']({'where':{'id':_0x32cf8d[_0x7c50('0x47')]['id']}})['then'](handleEntityNotFound(_0x112e31,null))[_0x7c50('0x25')](removeEntity(_0x112e31,null))['catch'](handleError(_0x112e31,null));};exports[_0x7c50('0x51')]=function(_0x38c475,_0x295407){return db[_0x7c50('0x2e')][_0x7c50('0x51')]()[_0x7c50('0x25')](respondWithResult(_0x295407,null))[_0x7c50('0x46')](handleError(_0x295407,null));};exports[_0x7c50('0x52')]=function(_0x9fc8c7,_0x29819c,_0x17e0fd){var _0x2689ae={'raw':!![],'where':{}},_0x85153a={},_0x4814cd;return db[_0x7c50('0x2e')][_0x7c50('0x53')]({'where':{'id':_0x9fc8c7['params']['id']}})[_0x7c50('0x25')](handleEntityNotFound(_0x29819c,null))[_0x7c50('0x25')](function(_0x203930){if(_0x203930){_0x4814cd=_0x203930[_0x7c50('0x26')]({'plain':!![]});_0x85153a[_0x7c50('0x33')]=_[_0x7c50('0x2f')](db['UserMailQueue']['rawAttributes']);_0x85153a[_0x7c50('0x30')]=_[_0x7c50('0x2f')](_0x9fc8c7[_0x7c50('0x30')]);_0x85153a[_0x7c50('0x31')]=_[_0x7c50('0x32')](_0x85153a[_0x7c50('0x33')],_0x85153a[_0x7c50('0x30')]);_0x2689ae[_0x7c50('0x35')]=_[_0x7c50('0x32')](_0x85153a[_0x7c50('0x33')],qs[_0x7c50('0x34')](_0x9fc8c7[_0x7c50('0x30')][_0x7c50('0x34')]));_0x2689ae[_0x7c50('0x35')]=_0x2689ae[_0x7c50('0x35')][_0x7c50('0x36')]?_0x2689ae['attributes']:_0x85153a[_0x7c50('0x33')];if(!_0x9fc8c7[_0x7c50('0x30')]['hasOwnProperty'](_0x7c50('0x38'))){_0x2689ae['limit']=qs['limit'](_0x9fc8c7['query'][_0x7c50('0x20')]);_0x2689ae[_0x7c50('0x1f')]=qs['offset'](_0x9fc8c7[_0x7c50('0x30')]['offset']);}_0x2689ae[_0x7c50('0x54')]=qs[_0x7c50('0x39')](_0x9fc8c7['query']['sort']);_0x2689ae[_0x7c50('0x3a')]=qs[_0x7c50('0x31')](_[_0x7c50('0x3b')](_0x9fc8c7[_0x7c50('0x30')],_0x85153a[_0x7c50('0x31')]));_0x2689ae[_0x7c50('0x3a')]['MailQueueId']=_0x203930['id'];if(_0x9fc8c7[_0x7c50('0x30')][_0x7c50('0x40')]){_0x2689ae[_0x7c50('0x3a')]=_['merge'](_0x2689ae[_0x7c50('0x3a')],{'$or':_[_0x7c50('0x55')](_0x2689ae[_0x7c50('0x35')],function(_0x4dea40){var _0x3e568a={};_0x3e568a[_0x4dea40]={'$like':'%'+_0x9fc8c7[_0x7c50('0x30')][_0x7c50('0x40')]+'%'};return _0x3e568a;})});}_0x2689ae=_[_0x7c50('0x3c')]({},_0x2689ae,_0x9fc8c7[_0x7c50('0x41')]);return db[_0x7c50('0x56')][_0x7c50('0x44')](_0x2689ae);}})[_0x7c50('0x25')](function(_0x5d5b5d){if(_0x5d5b5d){return db[_0x7c50('0x57')][_0x7c50('0x58')]({'where':{'id':_['map'](_0x5d5b5d,_0x7c50('0x59')),'role':_0x7c50('0x5a')},'attributes':['id',_0x7c50('0x2b'),_0x7c50('0x5b'),'updatedAt','createdAt']});}})[_0x7c50('0x25')](function(_0x33e32b){if(_0x33e32b){return{'count':_0x33e32b[_0x7c50('0x1e')],'rows':_['map'](_0x33e32b[_0x7c50('0x45')],function(_0x397b09){return{'membername':_0x397b09[_0x7c50('0x2b')],'UserId':_0x397b09['id'],'queue_name':_0x4814cd[_0x7c50('0x2b')],'MailQueueId':_0x4814cd['id'],'interface':util[_0x7c50('0x5c')](_0x7c50('0x5d'),_0x7c50('0x5e'),_0x397b09[_0x7c50('0x2b')]),'penalty':0x0,'paused':_0x397b09[_0x7c50('0x5b')],'createdAt':_0x397b09[_0x7c50('0x5f')],'updatedAt':_0x397b09[_0x7c50('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7c50('0x25')](respondWithFilteredResult(_0x29819c,_0x2689ae))['catch'](handleError(_0x29819c,null));};exports[_0x7c50('0x61')]=function(_0x3c6e53,_0x5b62be,_0x3eb82d){var _0x181360={};var _0x14f605={};var _0x191863;var _0x2a8c18;return db[_0x7c50('0x2e')][_0x7c50('0x53')]({'where':{'id':_0x3c6e53[_0x7c50('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b62be,null))[_0x7c50('0x25')](function(_0x43b39b){if(_0x43b39b){_0x191863=_0x43b39b;_0x14f605[_0x7c50('0x33')]=_[_0x7c50('0x2f')](db['Team'][_0x7c50('0x48')]);_0x14f605[_0x7c50('0x30')]=_[_0x7c50('0x2f')](_0x3c6e53[_0x7c50('0x30')]);_0x14f605['filters']=_[_0x7c50('0x32')](_0x14f605[_0x7c50('0x33')],_0x14f605[_0x7c50('0x30')]);_0x181360[_0x7c50('0x35')]=_[_0x7c50('0x32')](_0x14f605[_0x7c50('0x33')],qs[_0x7c50('0x34')](_0x3c6e53[_0x7c50('0x30')][_0x7c50('0x34')]));_0x181360['attributes']=_0x181360[_0x7c50('0x35')][_0x7c50('0x36')]?_0x181360['attributes']:_0x14f605[_0x7c50('0x33')];_0x181360['order']=qs[_0x7c50('0x39')](_0x3c6e53['query'][_0x7c50('0x39')]);_0x181360[_0x7c50('0x3a')]=qs[_0x7c50('0x31')](_[_0x7c50('0x3b')](_0x3c6e53[_0x7c50('0x30')],_0x14f605[_0x7c50('0x31')]));if(_0x3c6e53['query'][_0x7c50('0x40')]){_0x181360[_0x7c50('0x3a')]=_[_0x7c50('0x3c')](_0x181360[_0x7c50('0x3a')],{'$or':_[_0x7c50('0x55')](_0x181360['attributes'],function(_0x489861){var _0x2370a4={};_0x2370a4[_0x489861]={'$like':'%'+_0x3c6e53[_0x7c50('0x30')][_0x7c50('0x40')]+'%'};return _0x2370a4;})});}_0x181360=_['merge']({},_0x181360,_0x3c6e53[_0x7c50('0x41')]);return _0x191863[_0x7c50('0x61')](_0x181360);}})[_0x7c50('0x25')](function(_0x1a8f41){if(_0x1a8f41){_0x2a8c18=_0x1a8f41['length'];if(!_0x3c6e53[_0x7c50('0x30')][_0x7c50('0x37')]('nolimit')){_0x181360[_0x7c50('0x20')]=qs[_0x7c50('0x20')](_0x3c6e53['query']['limit']);_0x181360[_0x7c50('0x1f')]=qs[_0x7c50('0x1f')](_0x3c6e53['query'][_0x7c50('0x1f')]);}return _0x191863[_0x7c50('0x61')](_0x181360);}})[_0x7c50('0x25')](function(_0x1dffe3){if(_0x1dffe3){return _0x1dffe3?{'count':_0x2a8c18,'rows':_0x1dffe3}:null;}})[_0x7c50('0x25')](respondWithResult(_0x5b62be,null))[_0x7c50('0x46')](handleError(_0x5b62be,null));};exports[_0x7c50('0x62')]=function(_0x302270,_0x402aac,_0xaa445d){var _0x21a56e=_0x302270[_0x7c50('0x4b')]['teams'];return db[_0x7c50('0x63')][_0x7c50('0x44')]({'where':{'id':_[_0x7c50('0x55')](_0x21a56e,'id')},'attributes':['id'],'include':[{'model':db[_0x7c50('0x57')],'as':_0x7c50('0x64'),'attributes':['id','name',_0x7c50('0x65'),_0x7c50('0x66'),_0x7c50('0x67')],'raw':!![]}]})['then'](function(_0x5eca8f){if(_0x5eca8f){var _0x3788c0=_['flatMap'](_0x5eca8f,function(_0x3cf94d){var _0x13df66=_0x3cf94d[_0x7c50('0x26')]({'plain':!![]});return _0x13df66['Agents'];});return db[_0x7c50('0x2e')][_0x7c50('0x49')]({'where':{'id':_0x302270[_0x7c50('0x47')]['id']}})[_0x7c50('0x25')](function(_0x31351b){return db[_0x7c50('0x68')][_0x7c50('0x69')](function(_0xf219c4){return _0x31351b[_0x7c50('0x62')](_[_0x7c50('0x55')](_0x21a56e,'id'),{'transaction':_0xf219c4})[_0x7c50('0x25')](function(){return BPromise[_0x7c50('0x6a')](_0x3788c0,function(_0x70c22b){return db[_0x7c50('0x56')][_0x7c50('0x6b')]({'where':{'UserId':_0x70c22b['id'],'MailQueueId':_0x302270[_0x7c50('0x47')]['id']},'transaction':_0xf219c4});});})[_0x7c50('0x25')](function(){_0x3788c0[_0x7c50('0x6c')](function(_0x2487ff){socket[_0x7c50('0x6d')](_0x7c50('0x6e'),{'UserId':_0x2487ff['id'],'MailQueueId':_0x31351b['id']});});});});});}})[_0x7c50('0x25')](respondWithStatusCode(_0x402aac,null))['catch'](handleError(_0x402aac,null));};exports[_0x7c50('0x6f')]=function(_0x190ffb,_0x9e4857,_0x5b7d46){return db[_0x7c50('0x63')]['findAll']({'where':{'id':_0x190ffb['query'][_0x7c50('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7c50('0x64'),'attributes':['id'],'raw':!![]}]})[_0x7c50('0x25')](handleEntityNotFound(_0x9e4857,null))[_0x7c50('0x25')](function(_0x1fcc1b){var _0x51cba3=_[_0x7c50('0x55')](_0x1fcc1b,'id');var _0x434f9f=[];var _0x186deb=[];var _0x477469=squel[_0x7c50('0x71')]();_0x477469[_0x7c50('0x72')](_0x7c50('0x73'))[_0x7c50('0x74')](_0x7c50('0x75'),'tq')[_0x7c50('0x76')](_0x7c50('0x77'),'ut',_0x7c50('0x78'))['where']('MailQueueId\x20=\x20?',_0x190ffb[_0x7c50('0x47')]['id']);for(var _0x36b2b5=0x0;_0x36b2b5<_0x1fcc1b[_0x7c50('0x36')];_0x36b2b5+=0x1){let _0x3c0ddf=_0x1fcc1b[_0x36b2b5];for(var _0x3f9641=0x0;_0x3f9641<_0x3c0ddf['Agents'][_0x7c50('0x36')];_0x3f9641+=0x1){let _0x442aa8=_0x3c0ddf[_0x7c50('0x64')][_0x3f9641];var _0x1a2b99=_0x477469[_0x7c50('0x79')]();_0x1a2b99[_0x7c50('0x3a')](_0x7c50('0x7a'),_0x442aa8['id']);_0x186deb[_0x7c50('0x7b')](db[_0x7c50('0x68')][_0x7c50('0x30')](_0x1a2b99[_0x7c50('0x7c')](),{'type':db[_0x7c50('0x68')]['QueryTypes'][_0x7c50('0x7d')]})[_0x7c50('0x25')](function(_0x169167){if(_0x169167[_0x7c50('0x36')]===0x1){return _0x442aa8['id'];}else{var _0x270891=_[_0x7c50('0x7e')](_['map'](_0x169167,_0x7c50('0x7f')),function(_0x153aa5){return _[_0x7c50('0x80')](_0x51cba3,_0x153aa5);});if(_0x270891){return _0x442aa8['id'];}}}));}}return BPromise['all'](_0x186deb)[_0x7c50('0x25')](function(_0x22bc3b){_0x434f9f=_(_0x434f9f)[_0x7c50('0x81')](_0x22bc3b)[_0x7c50('0x82')]()[_0x7c50('0x83')]();return db['MailQueue'][_0x7c50('0x49')]({'where':{'id':_0x190ffb[_0x7c50('0x47')]['id']}})['then'](function(_0x23e096){return db[_0x7c50('0x68')][_0x7c50('0x69')](function(_0x4093d3){return _0x23e096[_0x7c50('0x6f')](_0x190ffb['query']['ids'],{'transaction':_0x4093d3})[_0x7c50('0x25')](function(){if(!_[_0x7c50('0x84')](_0x434f9f)){return _0x23e096[_0x7c50('0x85')](_0x434f9f,{'transaction':_0x4093d3});}})[_0x7c50('0x25')](function(){_0x434f9f[_0x7c50('0x6c')](function(_0x1b711a){socket['emit']('userMailQueue:remove',{'UserId':_0x1b711a,'MailQueueId':_0x23e096['id']});});});});});});})['then'](respondWithStatusCode(_0x9e4857,null))[_0x7c50('0x46')](handleError(_0x9e4857,null));};exports[_0x7c50('0x86')]=function(_0x2f21f3,_0x168872,_0x5c18b9){return db[_0x7c50('0x2e')][_0x7c50('0x49')]({'where':{'id':_0x2f21f3[_0x7c50('0x47')]['id']}})[_0x7c50('0x25')](handleEntityNotFound(_0x168872,null))[_0x7c50('0x25')](function(_0x1caa97){if(_0x1caa97){return _0x1caa97['addAgents'](_0x2f21f3[_0x7c50('0x4b')][_0x7c50('0x70')],_[_0x7c50('0x87')](_0x2f21f3[_0x7c50('0x4b')],[_0x7c50('0x70'),'id'])||{})[_0x7c50('0x88')](function(_0x3ca616){for(var _0x592b7d=0x0;_0x592b7d<_0x2f21f3[_0x7c50('0x4b')][_0x7c50('0x70')][_0x7c50('0x36')];_0x592b7d+=0x1){socket['emit'](_0x7c50('0x6e'),{'UserId':_0x2f21f3[_0x7c50('0x4b')][_0x7c50('0x70')][_0x592b7d],'MailQueueId':_0x2f21f3[_0x7c50('0x47')]['id']});}return _0x3ca616;});}})['then'](respondWithResult(_0x168872,null))[_0x7c50('0x46')](handleError(_0x168872,null));};exports[_0x7c50('0x85')]=function(_0x2033b8,_0x32639d,_0x33c52f){return db[_0x7c50('0x2e')][_0x7c50('0x49')]({'where':{'id':_0x2033b8['params']['id']}})[_0x7c50('0x25')](handleEntityNotFound(_0x32639d,null))['then'](function(_0x1e391d){if(_0x1e391d){return _0x1e391d[_0x7c50('0x85')](_0x2033b8[_0x7c50('0x30')][_0x7c50('0x70')])[_0x7c50('0x25')](function(){if(_[_0x7c50('0x89')](_0x2033b8[_0x7c50('0x30')][_0x7c50('0x70')])){for(var _0x4fe36d=0x0;_0x4fe36d<_0x2033b8[_0x7c50('0x30')][_0x7c50('0x70')][_0x7c50('0x36')];_0x4fe36d+=0x1){socket['emit'](_0x7c50('0x8a'),{'UserId':Number(_0x2033b8[_0x7c50('0x30')][_0x7c50('0x70')][_0x4fe36d]),'MailQueueId':Number(_0x2033b8[_0x7c50('0x47')]['id'])});}}else{socket[_0x7c50('0x6d')](_0x7c50('0x8a'),{'UserId':Number(_0x2033b8[_0x7c50('0x30')][_0x7c50('0x70')]),'MailQueueId':Number(_0x2033b8[_0x7c50('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x32639d,null))[_0x7c50('0x46')](handleError(_0x32639d,null));};exports['getAgents']=function(_0x19ac5a,_0x56074d,_0x19cd88){var _0x33b646={};var _0x1a5977={};var _0x9f86d;var _0x688ea4;return db[_0x7c50('0x2e')][_0x7c50('0x53')]({'where':{'id':_0x19ac5a['params']['id']}})[_0x7c50('0x25')](handleEntityNotFound(_0x56074d,null))['then'](function(_0x50b4df){if(_0x50b4df){_0x9f86d=_0x50b4df;_0x1a5977[_0x7c50('0x33')]=_[_0x7c50('0x2f')](db['User'][_0x7c50('0x48')]);_0x1a5977[_0x7c50('0x30')]=_['keys'](_0x19ac5a[_0x7c50('0x30')]);_0x1a5977[_0x7c50('0x31')]=_[_0x7c50('0x32')](_0x1a5977['model'],_0x1a5977[_0x7c50('0x30')]);_0x33b646[_0x7c50('0x35')]=_['intersection'](_0x1a5977[_0x7c50('0x33')],qs[_0x7c50('0x34')](_0x19ac5a[_0x7c50('0x30')][_0x7c50('0x34')]));_0x33b646[_0x7c50('0x35')]=_0x33b646['attributes'][_0x7c50('0x36')]?_0x33b646['attributes']:_0x1a5977[_0x7c50('0x33')];_0x33b646[_0x7c50('0x54')]=qs[_0x7c50('0x39')](_0x19ac5a[_0x7c50('0x30')][_0x7c50('0x39')]);_0x33b646[_0x7c50('0x3a')]=qs[_0x7c50('0x31')](_[_0x7c50('0x3b')](_0x19ac5a[_0x7c50('0x30')],_0x1a5977[_0x7c50('0x31')]));if(_0x19ac5a[_0x7c50('0x30')][_0x7c50('0x40')]){_0x33b646[_0x7c50('0x3a')]=_[_0x7c50('0x3c')](_0x33b646[_0x7c50('0x3a')],{'$or':_['map'](_0x33b646['attributes'],function(_0x3a3aaa){var _0x1f1538={};_0x1f1538[_0x3a3aaa]={'$like':'%'+_0x19ac5a['query']['filter']+'%'};return _0x1f1538;})});}_0x33b646=_[_0x7c50('0x3c')]({},_0x33b646,_0x19ac5a[_0x7c50('0x41')]);return _0x9f86d[_0x7c50('0x8b')](_0x33b646);}})[_0x7c50('0x25')](function(_0x1d4d40){if(_0x1d4d40){_0x688ea4=_0x1d4d40[_0x7c50('0x36')];if(!_0x19ac5a[_0x7c50('0x30')][_0x7c50('0x37')]('nolimit')){_0x33b646['limit']=qs[_0x7c50('0x20')](_0x19ac5a[_0x7c50('0x30')][_0x7c50('0x20')]);_0x33b646[_0x7c50('0x1f')]=qs[_0x7c50('0x1f')](_0x19ac5a[_0x7c50('0x30')]['offset']);}return _0x9f86d[_0x7c50('0x8b')](_0x33b646);}})[_0x7c50('0x25')](function(_0x1863ab){if(_0x1863ab){return _0x1863ab?{'count':_0x688ea4,'rows':_0x1863ab}:null;}})[_0x7c50('0x25')](respondWithResult(_0x56074d,null))['catch'](handleError(_0x56074d,null));}; \ No newline at end of file +var _0x7cc3=['mailPause','getTeams','Team','addTeams','teams','Agents','interface','transaction','each','forEach','emit','removeTeams','ids','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','SELECT','TeamId','all','union','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','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','jsforce','desk.js','papaparse','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','./mailQueue.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','send','MailQueue','rawAttributes','model','keys','filters','intersection','query','fields','attributes','length','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','getMembers','findOne','UserMailQueue','hasOwnProperty','nolimit','pick','User','findAndCountAll','updatedAt','createdAt','format','%s/%s','SIP'];(function(_0x91fd3a,_0x35ea08){var _0x2180e0=function(_0x5924fd){while(--_0x5924fd){_0x91fd3a['push'](_0x91fd3a['shift']());}};_0x2180e0(++_0x35ea08);}(_0x7cc3,0xa9));var _0x37cc=function(_0xa7026d,_0x1574f0){_0xa7026d=_0xa7026d-0x0;var _0x47e61e=_0x7cc3[_0xa7026d];return _0x47e61e;};'use strict';var pdf=require(_0x37cc('0x0'));var emlformat=require(_0x37cc('0x1'));var rimraf=require(_0x37cc('0x2'));var zipdir=require(_0x37cc('0x3'));var jsonpatch=require(_0x37cc('0x4'));var rp=require(_0x37cc('0x5'));var moment=require(_0x37cc('0x6'));var BPromise=require(_0x37cc('0x7'));var Mustache=require(_0x37cc('0x8'));var util=require(_0x37cc('0x9'));var path=require(_0x37cc('0xa'));var sox=require(_0x37cc('0xb'));var csv=require(_0x37cc('0xc'));var ejs=require(_0x37cc('0xd'));var fs=require('fs');var _=require(_0x37cc('0xe'));var squel=require(_0x37cc('0xf'));var crypto=require(_0x37cc('0x10'));var jsforce=require(_0x37cc('0x11'));var deskjs=require(_0x37cc('0x12'));var toCsv=require(_0x37cc('0xc'));var querystring=require('querystring');var Papa=require(_0x37cc('0x13'));var Redis=require('ioredis');var authService=require(_0x37cc('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x37cc('0x15'))(_0x37cc('0x16'));var utils=require('../../config/utils');var config=require(_0x37cc('0x17'));var db=require(_0x37cc('0x18'))['db'];config['redis']=_[_0x37cc('0x19')](config['redis'],{'host':_0x37cc('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x37cc('0x1b'))[_0x37cc('0x1c')](socket);function respondWithStatusCode(_0x3a7f8b,_0x5931ef){_0x5931ef=_0x5931ef||0xcc;return function(_0x86cd40){if(_0x86cd40){return _0x3a7f8b[_0x37cc('0x1d')](_0x5931ef);}return _0x3a7f8b[_0x37cc('0x1e')](_0x5931ef)[_0x37cc('0x1f')]();};}function respondWithResult(_0x574683,_0x1984c4){_0x1984c4=_0x1984c4||0xc8;return function(_0x3434d3){if(_0x3434d3){return _0x574683[_0x37cc('0x1e')](_0x1984c4)[_0x37cc('0x20')](_0x3434d3);}};}function respondWithFilteredResult(_0x37b930,_0x44e17c){return function(_0x1ed412){if(_0x1ed412){var _0x3832d5=_0x1ed412['count'],_0x5d43a2=_0x44e17c['offset'],_0x2aba81=_0x44e17c[_0x37cc('0x21')]+_0x44e17c[_0x37cc('0x22')],_0x16d388;if(_0x2aba81>=_0x3832d5){_0x2aba81=_0x3832d5;_0x16d388=0xc8;}else{_0x16d388=0xce;}_0x37b930[_0x37cc('0x1e')](_0x16d388);return _0x37b930[_0x37cc('0x23')](_0x37cc('0x24'),_0x5d43a2+'-'+_0x2aba81+'/'+_0x3832d5)[_0x37cc('0x20')](_0x1ed412);}return null;};}function patchUpdates(_0x408c5f){return function(_0x5b493a){try{jsonpatch[_0x37cc('0x25')](_0x5b493a,_0x408c5f,!![]);}catch(_0x58e836){return BPromise[_0x37cc('0x26')](_0x58e836);}return _0x5b493a[_0x37cc('0x27')]();};}function saveUpdates(_0x158b2f,_0x4c8224){return function(_0x4753c8){if(_0x4753c8){return _0x4753c8[_0x37cc('0x28')](_0x158b2f)[_0x37cc('0x29')](function(_0x1723d0){return _0x1723d0;});}return null;};}function removeEntity(_0x57dd46,_0x19fc70){return function(_0x4039d9){if(_0x4039d9){return _0x4039d9[_0x37cc('0x2a')]()[_0x37cc('0x29')](function(){var _0xb6887d=_0x4039d9[_0x37cc('0x2b')]({'plain':!![]});var _0xbb10a1='MailQueues';return db['UserProfileResource'][_0x37cc('0x2a')]({'where':{'type':_0xbb10a1,'resourceId':_0xb6887d['id']}})['then'](function(){return _0x4039d9;});})['then'](function(){_0x57dd46[_0x37cc('0x1e')](0xcc)[_0x37cc('0x1f')]();});}};}function handleEntityNotFound(_0x260a31,_0x3c3869){return function(_0x3b864a){if(!_0x3b864a){_0x260a31[_0x37cc('0x1d')](0x194);}return _0x3b864a;};}function handleError(_0x2b54ef,_0x281a67){_0x281a67=_0x281a67||0x1f4;return function(_0x53dc3a){logger[_0x37cc('0x2c')](_0x53dc3a[_0x37cc('0x2d')]);if(_0x53dc3a[_0x37cc('0x2e')]){delete _0x53dc3a['name'];}_0x2b54ef[_0x37cc('0x1e')](_0x281a67)[_0x37cc('0x2f')](_0x53dc3a);};}exports['index']=function(_0x5d550d,_0x5bbb90){var _0x54b39d={},_0x208548={},_0x4a51a2={'count':0x0,'rows':[]};var _0x48b9a9=db[_0x37cc('0x30')][_0x37cc('0x31')];_0x208548[_0x37cc('0x32')]=_[_0x37cc('0x33')](_0x48b9a9);_0x208548['query']=_['keys'](_0x5d550d['query']);_0x208548[_0x37cc('0x34')]=_[_0x37cc('0x35')](_0x208548['model'],_0x208548[_0x37cc('0x36')]);_0x54b39d['attributes']=_[_0x37cc('0x35')](_0x208548['model'],qs[_0x37cc('0x37')](_0x5d550d[_0x37cc('0x36')][_0x37cc('0x37')]));_0x54b39d[_0x37cc('0x38')]=_0x54b39d['attributes'][_0x37cc('0x39')]?_0x54b39d[_0x37cc('0x38')]:_0x208548[_0x37cc('0x32')];if(!_0x5d550d[_0x37cc('0x36')]['hasOwnProperty']('nolimit')){_0x54b39d[_0x37cc('0x22')]=qs[_0x37cc('0x22')](_0x5d550d['query'][_0x37cc('0x22')]);_0x54b39d['offset']=qs['offset'](_0x5d550d['query'][_0x37cc('0x21')]);}_0x54b39d[_0x37cc('0x3a')]=qs[_0x37cc('0x3b')](_0x5d550d[_0x37cc('0x36')]['sort']);_0x54b39d[_0x37cc('0x3c')]=qs[_0x37cc('0x34')](_['pick'](_0x5d550d['query'],_0x208548[_0x37cc('0x34')]));if(_0x5d550d['query'][_0x37cc('0x3d')]){_0x54b39d['where']=_[_0x37cc('0x3e')](_0x54b39d['where'],{'$or':_[_0x37cc('0x3f')](_0x48b9a9,function(_0xea40bc){if(_0xea40bc[_0x37cc('0x40')][_0x37cc('0x41')]!==_0x37cc('0x42')){var _0x392d8a={};_0x392d8a[_0xea40bc[_0x37cc('0x43')]]={'$like':'%'+_0x5d550d[_0x37cc('0x36')]['filter']+'%'};return _0x392d8a;}})});}_0x54b39d=_['merge']({},_0x54b39d,_0x5d550d[_0x37cc('0x44')]);var _0x555660={'where':_0x54b39d[_0x37cc('0x3c')]};return db['MailQueue'][_0x37cc('0x45')](_0x555660)[_0x37cc('0x29')](function(_0x186a44){_0x4a51a2[_0x37cc('0x45')]=_0x186a44;if(_0x5d550d['query'][_0x37cc('0x46')]){_0x54b39d[_0x37cc('0x47')]=[{'all':!![]}];}return db[_0x37cc('0x30')][_0x37cc('0x48')](_0x54b39d);})[_0x37cc('0x29')](function(_0x45fe9a){_0x4a51a2[_0x37cc('0x49')]=_0x45fe9a;return _0x4a51a2;})[_0x37cc('0x29')](respondWithFilteredResult(_0x5bbb90,_0x54b39d))[_0x37cc('0x4a')](handleError(_0x5bbb90,null));};exports[_0x37cc('0x4b')]=function(_0x191fe4,_0x4ddc08){var _0x12a2c8={'raw':!![],'where':{'id':_0x191fe4[_0x37cc('0x4c')]['id']}},_0x43103f={};_0x43103f[_0x37cc('0x32')]=_[_0x37cc('0x33')](db[_0x37cc('0x30')][_0x37cc('0x31')]);_0x43103f[_0x37cc('0x36')]=_[_0x37cc('0x33')](_0x191fe4[_0x37cc('0x36')]);_0x43103f['filters']=_[_0x37cc('0x35')](_0x43103f[_0x37cc('0x32')],_0x43103f[_0x37cc('0x36')]);_0x12a2c8['attributes']=_['intersection'](_0x43103f['model'],qs[_0x37cc('0x37')](_0x191fe4[_0x37cc('0x36')][_0x37cc('0x37')]));_0x12a2c8[_0x37cc('0x38')]=_0x12a2c8['attributes'][_0x37cc('0x39')]?_0x12a2c8[_0x37cc('0x38')]:_0x43103f[_0x37cc('0x32')];if(_0x191fe4[_0x37cc('0x36')]['includeAll']){_0x12a2c8['include']=[{'all':!![]}];}_0x12a2c8=_[_0x37cc('0x3e')]({},_0x12a2c8,_0x191fe4[_0x37cc('0x44')]);return db['MailQueue']['find'](_0x12a2c8)[_0x37cc('0x29')](handleEntityNotFound(_0x4ddc08,null))['then'](respondWithResult(_0x4ddc08,null))[_0x37cc('0x4a')](handleError(_0x4ddc08,null));};exports['create']=function(_0x375c50,_0x1414d9){return db[_0x37cc('0x30')][_0x37cc('0x4d')](_0x375c50[_0x37cc('0x4e')],{})[_0x37cc('0x29')](function(_0x3ef684){var _0x4f15a7=_0x375c50[_0x37cc('0x4f')][_0x37cc('0x2b')]({'plain':!![]});if(!_0x4f15a7)throw new Error(_0x37cc('0x50'));if(_0x4f15a7[_0x37cc('0x51')]===_0x37cc('0x4f')){var _0x1af0fa=_0x3ef684[_0x37cc('0x2b')]({'plain':!![]});var _0x47f973=_0x37cc('0x52');return db[_0x37cc('0x53')][_0x37cc('0x54')]({'where':{'name':_0x47f973,'userProfileId':_0x4f15a7[_0x37cc('0x55')]},'raw':!![]})[_0x37cc('0x29')](function(_0x38eea2){if(_0x38eea2&&_0x38eea2[_0x37cc('0x56')]===0x0){return db[_0x37cc('0x57')]['create']({'name':_0x1af0fa[_0x37cc('0x2e')],'resourceId':_0x1af0fa['id'],'type':_0x38eea2[_0x37cc('0x2e')],'sectionId':_0x38eea2['id']},{})['then'](function(){return _0x3ef684;});}else{return _0x3ef684;}})['catch'](function(_0x584abd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x584abd);throw _0x584abd;});}return _0x3ef684;})[_0x37cc('0x29')](respondWithResult(_0x1414d9,0xc9))[_0x37cc('0x4a')](handleError(_0x1414d9,null));};exports[_0x37cc('0x28')]=function(_0x33f77c,_0x3631d9){if(_0x33f77c[_0x37cc('0x4e')]['id']){delete _0x33f77c[_0x37cc('0x4e')]['id'];}return db[_0x37cc('0x30')][_0x37cc('0x54')]({'where':{'id':_0x33f77c[_0x37cc('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3631d9,null))[_0x37cc('0x29')](saveUpdates(_0x33f77c['body'],null))[_0x37cc('0x29')](respondWithResult(_0x3631d9,null))[_0x37cc('0x4a')](handleError(_0x3631d9,null));};exports[_0x37cc('0x2a')]=function(_0xfcc601,_0x86e7f4){return db[_0x37cc('0x30')][_0x37cc('0x54')]({'where':{'id':_0xfcc601[_0x37cc('0x4c')]['id']}})[_0x37cc('0x29')](handleEntityNotFound(_0x86e7f4,null))[_0x37cc('0x29')](removeEntity(_0x86e7f4,null))[_0x37cc('0x4a')](handleError(_0x86e7f4,null));};exports['describe']=function(_0x12b92c,_0x3d4599){return db[_0x37cc('0x30')]['describe']()[_0x37cc('0x29')](respondWithResult(_0x3d4599,null))['catch'](handleError(_0x3d4599,null));};exports[_0x37cc('0x58')]=function(_0x5becf5,_0x35d6c6,_0x43911a){var _0x1be23d={'raw':!![],'where':{}},_0x29ac7f={},_0x54ab3f;return db[_0x37cc('0x30')][_0x37cc('0x59')]({'where':{'id':_0x5becf5[_0x37cc('0x4c')]['id']}})[_0x37cc('0x29')](handleEntityNotFound(_0x35d6c6,null))[_0x37cc('0x29')](function(_0x21bba7){if(_0x21bba7){_0x54ab3f=_0x21bba7[_0x37cc('0x2b')]({'plain':!![]});_0x29ac7f['model']=_[_0x37cc('0x33')](db[_0x37cc('0x5a')][_0x37cc('0x31')]);_0x29ac7f['query']=_[_0x37cc('0x33')](_0x5becf5[_0x37cc('0x36')]);_0x29ac7f[_0x37cc('0x34')]=_[_0x37cc('0x35')](_0x29ac7f['model'],_0x29ac7f[_0x37cc('0x36')]);_0x1be23d[_0x37cc('0x38')]=_[_0x37cc('0x35')](_0x29ac7f[_0x37cc('0x32')],qs[_0x37cc('0x37')](_0x5becf5['query']['fields']));_0x1be23d[_0x37cc('0x38')]=_0x1be23d[_0x37cc('0x38')][_0x37cc('0x39')]?_0x1be23d[_0x37cc('0x38')]:_0x29ac7f[_0x37cc('0x32')];if(!_0x5becf5['query'][_0x37cc('0x5b')](_0x37cc('0x5c'))){_0x1be23d[_0x37cc('0x22')]=qs[_0x37cc('0x22')](_0x5becf5[_0x37cc('0x36')][_0x37cc('0x22')]);_0x1be23d[_0x37cc('0x21')]=qs[_0x37cc('0x21')](_0x5becf5[_0x37cc('0x36')]['offset']);}_0x1be23d[_0x37cc('0x3a')]=qs['sort'](_0x5becf5['query'][_0x37cc('0x3b')]);_0x1be23d[_0x37cc('0x3c')]=qs[_0x37cc('0x34')](_[_0x37cc('0x5d')](_0x5becf5[_0x37cc('0x36')],_0x29ac7f[_0x37cc('0x34')]));_0x1be23d[_0x37cc('0x3c')]['MailQueueId']=_0x21bba7['id'];if(_0x5becf5[_0x37cc('0x36')][_0x37cc('0x3d')]){_0x1be23d[_0x37cc('0x3c')]=_['merge'](_0x1be23d[_0x37cc('0x3c')],{'$or':_['map'](_0x1be23d[_0x37cc('0x38')],function(_0xde1938){var _0x3630bf={};_0x3630bf[_0xde1938]={'$like':'%'+_0x5becf5[_0x37cc('0x36')][_0x37cc('0x3d')]+'%'};return _0x3630bf;})});}_0x1be23d=_[_0x37cc('0x3e')]({},_0x1be23d,_0x5becf5[_0x37cc('0x44')]);return db[_0x37cc('0x5a')][_0x37cc('0x48')](_0x1be23d);}})[_0x37cc('0x29')](function(_0x3775bd){if(_0x3775bd){return db[_0x37cc('0x5e')][_0x37cc('0x5f')]({'where':{'id':_[_0x37cc('0x3f')](_0x3775bd,'UserId'),'role':'agent'},'attributes':['id','name','mailPause',_0x37cc('0x60'),_0x37cc('0x61')]});}})['then'](function(_0x350433){if(_0x350433){return{'count':_0x350433['count'],'rows':_[_0x37cc('0x3f')](_0x350433[_0x37cc('0x49')],function(_0xdc688d){return{'membername':_0xdc688d[_0x37cc('0x2e')],'UserId':_0xdc688d['id'],'queue_name':_0x54ab3f[_0x37cc('0x2e')],'MailQueueId':_0x54ab3f['id'],'interface':util[_0x37cc('0x62')](_0x37cc('0x63'),_0x37cc('0x64'),_0xdc688d['name']),'penalty':0x0,'paused':_0xdc688d[_0x37cc('0x65')],'createdAt':_0xdc688d[_0x37cc('0x61')],'updatedAt':_0xdc688d[_0x37cc('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x37cc('0x29')](respondWithFilteredResult(_0x35d6c6,_0x1be23d))[_0x37cc('0x4a')](handleError(_0x35d6c6,null));};exports[_0x37cc('0x66')]=function(_0x45b501,_0x4f8041,_0x4798d6){var _0x1bc584={};var _0x72248b={};var _0x37ebba;var _0x33d438;return db[_0x37cc('0x30')]['findOne']({'where':{'id':_0x45b501[_0x37cc('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4f8041,null))[_0x37cc('0x29')](function(_0x27f7fc){if(_0x27f7fc){_0x37ebba=_0x27f7fc;_0x72248b[_0x37cc('0x32')]=_[_0x37cc('0x33')](db[_0x37cc('0x67')][_0x37cc('0x31')]);_0x72248b[_0x37cc('0x36')]=_[_0x37cc('0x33')](_0x45b501['query']);_0x72248b[_0x37cc('0x34')]=_[_0x37cc('0x35')](_0x72248b['model'],_0x72248b[_0x37cc('0x36')]);_0x1bc584[_0x37cc('0x38')]=_[_0x37cc('0x35')](_0x72248b[_0x37cc('0x32')],qs['fields'](_0x45b501[_0x37cc('0x36')][_0x37cc('0x37')]));_0x1bc584[_0x37cc('0x38')]=_0x1bc584['attributes'][_0x37cc('0x39')]?_0x1bc584[_0x37cc('0x38')]:_0x72248b[_0x37cc('0x32')];_0x1bc584[_0x37cc('0x3a')]=qs['sort'](_0x45b501[_0x37cc('0x36')][_0x37cc('0x3b')]);_0x1bc584[_0x37cc('0x3c')]=qs['filters'](_['pick'](_0x45b501[_0x37cc('0x36')],_0x72248b[_0x37cc('0x34')]));if(_0x45b501[_0x37cc('0x36')][_0x37cc('0x3d')]){_0x1bc584['where']=_[_0x37cc('0x3e')](_0x1bc584[_0x37cc('0x3c')],{'$or':_['map'](_0x1bc584['attributes'],function(_0x10125d){var _0x365430={};_0x365430[_0x10125d]={'$like':'%'+_0x45b501[_0x37cc('0x36')][_0x37cc('0x3d')]+'%'};return _0x365430;})});}_0x1bc584=_[_0x37cc('0x3e')]({},_0x1bc584,_0x45b501[_0x37cc('0x44')]);return _0x37ebba['getTeams'](_0x1bc584);}})['then'](function(_0x5e5d1f){if(_0x5e5d1f){_0x33d438=_0x5e5d1f[_0x37cc('0x39')];if(!_0x45b501[_0x37cc('0x36')][_0x37cc('0x5b')](_0x37cc('0x5c'))){_0x1bc584[_0x37cc('0x22')]=qs[_0x37cc('0x22')](_0x45b501[_0x37cc('0x36')]['limit']);_0x1bc584['offset']=qs['offset'](_0x45b501[_0x37cc('0x36')][_0x37cc('0x21')]);}return _0x37ebba[_0x37cc('0x66')](_0x1bc584);}})[_0x37cc('0x29')](function(_0x5db1b2){if(_0x5db1b2){return _0x5db1b2?{'count':_0x33d438,'rows':_0x5db1b2}:null;}})['then'](respondWithResult(_0x4f8041,null))[_0x37cc('0x4a')](handleError(_0x4f8041,null));};exports[_0x37cc('0x68')]=function(_0x4abe09,_0x221ae7,_0x1a1d81){var _0xd8380c=_0x4abe09[_0x37cc('0x4e')][_0x37cc('0x69')];return db['Team']['findAll']({'where':{'id':_[_0x37cc('0x3f')](_0xd8380c,'id')},'attributes':['id'],'include':[{'model':db[_0x37cc('0x5e')],'as':_0x37cc('0x6a'),'attributes':['id',_0x37cc('0x2e'),'online','voicePause',_0x37cc('0x6b')],'raw':!![]}]})[_0x37cc('0x29')](function(_0x47a92a){if(_0x47a92a){var _0x34f49c=_['flatMap'](_0x47a92a,function(_0x4af452){var _0x508862=_0x4af452[_0x37cc('0x2b')]({'plain':!![]});return _0x508862['Agents'];});return db[_0x37cc('0x30')]['find']({'where':{'id':_0x4abe09['params']['id']}})[_0x37cc('0x29')](function(_0x483ef5){return db['sequelize'][_0x37cc('0x6c')](function(_0x4d9aef){return _0x483ef5['addTeams'](_[_0x37cc('0x3f')](_0xd8380c,'id'),{'transaction':_0x4d9aef})[_0x37cc('0x29')](function(){return BPromise[_0x37cc('0x6d')](_0x34f49c,function(_0x2e845c){return db[_0x37cc('0x5a')]['findOrCreate']({'where':{'UserId':_0x2e845c['id'],'MailQueueId':_0x4abe09[_0x37cc('0x4c')]['id']},'transaction':_0x4d9aef});});})[_0x37cc('0x29')](function(){_0x34f49c[_0x37cc('0x6e')](function(_0x17c40d){socket[_0x37cc('0x6f')]('userMailQueue:save',{'UserId':_0x17c40d['id'],'MailQueueId':_0x483ef5['id']});});});});});}})[_0x37cc('0x29')](respondWithStatusCode(_0x221ae7,null))[_0x37cc('0x4a')](handleError(_0x221ae7,null));};exports[_0x37cc('0x70')]=function(_0x19aea1,_0x5163d2,_0x58f17a){return db['Team'][_0x37cc('0x48')]({'where':{'id':_0x19aea1[_0x37cc('0x36')][_0x37cc('0x71')]},'attributes':['id'],'include':[{'model':db[_0x37cc('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x37cc('0x29')](handleEntityNotFound(_0x5163d2,null))['then'](function(_0x533443){var _0x51e903=_[_0x37cc('0x3f')](_0x533443,'id');var _0x4ae83f=[];var _0x247f72=[];var _0x3444a0=squel['select']();_0x3444a0['field'](_0x37cc('0x72'))[_0x37cc('0x73')]('team_has_mail_queues','tq')[_0x37cc('0x74')]('user_has_teams','ut',_0x37cc('0x75'))[_0x37cc('0x3c')]('MailQueueId\x20=\x20?',_0x19aea1[_0x37cc('0x4c')]['id']);for(var _0x4bb7ba=0x0;_0x4bb7ba<_0x533443[_0x37cc('0x39')];_0x4bb7ba+=0x1){let _0x407f51=_0x533443[_0x4bb7ba];for(var _0x56ddba=0x0;_0x56ddba<_0x407f51[_0x37cc('0x6a')]['length'];_0x56ddba+=0x1){let _0xb30bf5=_0x407f51[_0x37cc('0x6a')][_0x56ddba];var _0x1c3505=_0x3444a0[_0x37cc('0x76')]();_0x1c3505[_0x37cc('0x3c')](_0x37cc('0x77'),_0xb30bf5['id']);_0x247f72[_0x37cc('0x78')](db[_0x37cc('0x79')][_0x37cc('0x36')](_0x1c3505['toString'](),{'type':db[_0x37cc('0x79')]['QueryTypes'][_0x37cc('0x7a')]})[_0x37cc('0x29')](function(_0x480e8f){if(_0x480e8f[_0x37cc('0x39')]===0x1){return _0xb30bf5['id'];}else{var _0xff9862=_['every'](_['map'](_0x480e8f,_0x37cc('0x7b')),function(_0x5def51){return _['includes'](_0x51e903,_0x5def51);});if(_0xff9862){return _0xb30bf5['id'];}}}));}}return BPromise[_0x37cc('0x7c')](_0x247f72)[_0x37cc('0x29')](function(_0x4bc91e){_0x4ae83f=_(_0x4ae83f)[_0x37cc('0x7d')](_0x4bc91e)[_0x37cc('0x7e')]()[_0x37cc('0x7f')]();return db[_0x37cc('0x30')][_0x37cc('0x54')]({'where':{'id':_0x19aea1['params']['id']}})[_0x37cc('0x29')](function(_0x23a1d4){return db[_0x37cc('0x79')][_0x37cc('0x6c')](function(_0x19d87d){return _0x23a1d4[_0x37cc('0x70')](_0x19aea1['query']['ids'],{'transaction':_0x19d87d})[_0x37cc('0x29')](function(){if(!_[_0x37cc('0x80')](_0x4ae83f)){return _0x23a1d4[_0x37cc('0x81')](_0x4ae83f,{'transaction':_0x19d87d});}})[_0x37cc('0x29')](function(){_0x4ae83f[_0x37cc('0x6e')](function(_0x26161e){socket['emit'](_0x37cc('0x82'),{'UserId':_0x26161e,'MailQueueId':_0x23a1d4['id']});});});});});});})[_0x37cc('0x29')](respondWithStatusCode(_0x5163d2,null))[_0x37cc('0x4a')](handleError(_0x5163d2,null));};exports[_0x37cc('0x83')]=function(_0x13338a,_0x43d005,_0x36a07d){return db[_0x37cc('0x30')]['find']({'where':{'id':_0x13338a[_0x37cc('0x4c')]['id']}})['then'](handleEntityNotFound(_0x43d005,null))[_0x37cc('0x29')](function(_0x3a5534){if(_0x3a5534){return _0x3a5534[_0x37cc('0x83')](_0x13338a[_0x37cc('0x4e')][_0x37cc('0x71')],_[_0x37cc('0x84')](_0x13338a[_0x37cc('0x4e')],[_0x37cc('0x71'),'id'])||{})[_0x37cc('0x85')](function(_0x3fd7fe){for(var _0x33f142=0x0;_0x33f142<_0x13338a[_0x37cc('0x4e')][_0x37cc('0x71')][_0x37cc('0x39')];_0x33f142+=0x1){socket[_0x37cc('0x6f')]('userMailQueue:save',{'UserId':_0x13338a[_0x37cc('0x4e')][_0x37cc('0x71')][_0x33f142],'MailQueueId':_0x13338a[_0x37cc('0x4c')]['id']});}return _0x3fd7fe;});}})[_0x37cc('0x29')](respondWithResult(_0x43d005,null))[_0x37cc('0x4a')](handleError(_0x43d005,null));};exports[_0x37cc('0x81')]=function(_0x153222,_0x465ca8,_0x1afd85){return db[_0x37cc('0x30')][_0x37cc('0x54')]({'where':{'id':_0x153222[_0x37cc('0x4c')]['id']}})[_0x37cc('0x29')](handleEntityNotFound(_0x465ca8,null))['then'](function(_0x4d7001){if(_0x4d7001){return _0x4d7001[_0x37cc('0x81')](_0x153222['query'][_0x37cc('0x71')])['then'](function(){if(_['isArray'](_0x153222[_0x37cc('0x36')][_0x37cc('0x71')])){for(var _0x359d52=0x0;_0x359d52<_0x153222[_0x37cc('0x36')][_0x37cc('0x71')][_0x37cc('0x39')];_0x359d52+=0x1){socket['emit'](_0x37cc('0x82'),{'UserId':Number(_0x153222[_0x37cc('0x36')][_0x37cc('0x71')][_0x359d52]),'MailQueueId':Number(_0x153222[_0x37cc('0x4c')]['id'])});}}else{socket['emit'](_0x37cc('0x82'),{'UserId':Number(_0x153222[_0x37cc('0x36')][_0x37cc('0x71')]),'MailQueueId':Number(_0x153222[_0x37cc('0x4c')]['id'])});}});}})[_0x37cc('0x29')](respondWithStatusCode(_0x465ca8,null))[_0x37cc('0x4a')](handleError(_0x465ca8,null));};exports[_0x37cc('0x86')]=function(_0x45a348,_0x19f652,_0x3c5e1a){var _0x41184a={};var _0x3b8d39={};var _0x19c669;var _0x4ab48b;return db[_0x37cc('0x30')][_0x37cc('0x59')]({'where':{'id':_0x45a348['params']['id']}})[_0x37cc('0x29')](handleEntityNotFound(_0x19f652,null))[_0x37cc('0x29')](function(_0x4f6c9d){if(_0x4f6c9d){_0x19c669=_0x4f6c9d;_0x3b8d39[_0x37cc('0x32')]=_[_0x37cc('0x33')](db[_0x37cc('0x5e')][_0x37cc('0x31')]);_0x3b8d39['query']=_['keys'](_0x45a348[_0x37cc('0x36')]);_0x3b8d39[_0x37cc('0x34')]=_[_0x37cc('0x35')](_0x3b8d39[_0x37cc('0x32')],_0x3b8d39[_0x37cc('0x36')]);_0x41184a[_0x37cc('0x38')]=_['intersection'](_0x3b8d39['model'],qs['fields'](_0x45a348[_0x37cc('0x36')][_0x37cc('0x37')]));_0x41184a[_0x37cc('0x38')]=_0x41184a[_0x37cc('0x38')][_0x37cc('0x39')]?_0x41184a[_0x37cc('0x38')]:_0x3b8d39[_0x37cc('0x32')];_0x41184a['order']=qs[_0x37cc('0x3b')](_0x45a348['query'][_0x37cc('0x3b')]);_0x41184a['where']=qs[_0x37cc('0x34')](_[_0x37cc('0x5d')](_0x45a348['query'],_0x3b8d39[_0x37cc('0x34')]));if(_0x45a348['query'][_0x37cc('0x3d')]){_0x41184a[_0x37cc('0x3c')]=_[_0x37cc('0x3e')](_0x41184a[_0x37cc('0x3c')],{'$or':_[_0x37cc('0x3f')](_0x41184a[_0x37cc('0x38')],function(_0x166eba){var _0x194cbe={};_0x194cbe[_0x166eba]={'$like':'%'+_0x45a348[_0x37cc('0x36')]['filter']+'%'};return _0x194cbe;})});}_0x41184a=_[_0x37cc('0x3e')]({},_0x41184a,_0x45a348[_0x37cc('0x44')]);return _0x19c669['getAgents'](_0x41184a);}})['then'](function(_0x12d2a3){if(_0x12d2a3){_0x4ab48b=_0x12d2a3[_0x37cc('0x39')];if(!_0x45a348['query'][_0x37cc('0x5b')](_0x37cc('0x5c'))){_0x41184a[_0x37cc('0x22')]=qs[_0x37cc('0x22')](_0x45a348[_0x37cc('0x36')][_0x37cc('0x22')]);_0x41184a[_0x37cc('0x21')]=qs[_0x37cc('0x21')](_0x45a348[_0x37cc('0x36')]['offset']);}return _0x19c669[_0x37cc('0x86')](_0x41184a);}})[_0x37cc('0x29')](function(_0x3b07c9){if(_0x3b07c9){return _0x3b07c9?{'count':_0x4ab48b,'rows':_0x3b07c9}:null;}})['then'](respondWithResult(_0x19f652,null))[_0x37cc('0x4a')](handleError(_0x19f652,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index bf0d2e3..3358267 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 _0xf217=['save','update','hasOwnProperty','hook','MailQueue','setMaxListeners'];(function(_0x24cc5e,_0x511ddf){var _0x36502e=function(_0xdb4918){while(--_0xdb4918){_0x24cc5e['push'](_0x24cc5e['shift']());}};_0x36502e(++_0x511ddf);}(_0xf217,0x13c));var _0x7f21=function(_0x8ba19a,_0x1d2b2b){_0x8ba19a=_0x8ba19a-0x0;var _0x2bd8b4=_0xf217[_0x8ba19a];return _0x2bd8b4;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db'][_0x7f21('0x0')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x7f21('0x1')](0x0);var events={'afterCreate':_0x7f21('0x2'),'afterUpdate':_0x7f21('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4156e0){return function(_0x5ca666,_0xb55f7,_0x138921){MailQueueEvents['emit'](_0x4156e0+':'+_0x5ca666['id'],_0x5ca666);MailQueueEvents['emit'](_0x4156e0,_0x5ca666);_0x138921(null);};}for(var e in events){if(events[_0x7f21('0x4')](e)){var event=events[e];MailQueue[_0x7f21('0x5')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0xeb26=['setMaxListeners','remove','emit','hook','exports','events','../../mysqldb','MailQueue'];(function(_0x555493,_0x22046c){var _0x36de6e=function(_0x1df08a){while(--_0x1df08a){_0x555493['push'](_0x555493['shift']());}};_0x36de6e(++_0x22046c);}(_0xeb26,0xad));var _0x6eb2=function(_0x25cc27,_0x19909e){_0x25cc27=_0x25cc27-0x0;var _0x1351fe=_0xeb26[_0x25cc27];return _0x1351fe;};'use strict';var EventEmitter=require(_0x6eb2('0x0'));var MailQueue=require(_0x6eb2('0x1'))['db'][_0x6eb2('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x6eb2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6eb2('0x4')};function emitEvent(_0x4c98d0){return function(_0x217067,_0x3e4de7,_0x413fd9){MailQueueEvents[_0x6eb2('0x5')](_0x4c98d0+':'+_0x217067['id'],_0x217067);MailQueueEvents['emit'](_0x4c98d0,_0x217067);_0x413fd9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x6eb2('0x6')](e,emitEvent(event));}}module[_0x6eb2('0x7')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 9739221..89a2ffc 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 _0x70e0=['mail_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./mailQueue.attributes'];(function(_0x3e6a35,_0x6e5fb){var _0x134bcf=function(_0x68a0cd){while(--_0x68a0cd){_0x3e6a35['push'](_0x3e6a35['shift']());}};_0x134bcf(++_0x6e5fb);}(_0x70e0,0x17b));var _0x070e=function(_0x52d8d0,_0x47da28){_0x52d8d0=_0x52d8d0-0x0;var _0x193526=_0x70e0[_0x52d8d0];return _0x193526;};'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 +var _0xe706=['request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','moment','bluebird'];(function(_0x112a55,_0x55c199){var _0xc22d1=function(_0x3c3967){while(--_0x3c3967){_0x112a55['push'](_0x112a55['shift']());}};_0xc22d1(++_0x55c199);}(_0xe706,0xa3));var _0x6e70=function(_0x479a35,_0x2526b2){_0x479a35=_0x479a35-0x0;var _0x24fea9=_0xe706[_0x479a35];return _0x24fea9;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 7d821c7..e54cb08 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 _0x8f29=['message','result','catch','GetMailQueue','MailQueue','raw','options','where','attributes','limit','include','map','debug','stringify','ShowMailQueue','model','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x3e9f8e,_0x383e0d){var _0x52615c=function(_0x36497e){while(--_0x36497e){_0x3e9f8e['push'](_0x3e9f8e['shift']());}};_0x52615c(++_0x383e0d);}(_0x8f29,0x1f1));var _0x98f2=function(_0x576196,_0x98c588){_0x576196=_0x576196-0x0;var _0x1905ee=_0x8f29[_0x576196];return _0x1905ee;};'use strict';var _=require('lodash');var util=require(_0x98f2('0x0'));var moment=require(_0x98f2('0x1'));var BPromise=require('bluebird');var rs=require(_0x98f2('0x2'));var fs=require('fs');var Redis=require(_0x98f2('0x3'));var db=require(_0x98f2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x98f2('0x5'));var config=require(_0x98f2('0x6'));var jayson=require(_0x98f2('0x7'));var client=jayson[_0x98f2('0x8')][_0x98f2('0x9')]({'port':0x232a});config[_0x98f2('0xa')]=_[_0x98f2('0xb')](config[_0x98f2('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x98f2('0xc'))(new Redis(config[_0x98f2('0xa')]));require('./mailQueue.socket')[_0x98f2('0xd')](socket);function respondWithRpcPromise(_0x26085b,_0x4d2f0d,_0x28d8fb){return new BPromise(function(_0x2d62db,_0x5e1d38){return client[_0x98f2('0xe')](_0x26085b,_0x28d8fb)[_0x98f2('0xf')](function(_0x1a8092){logger[_0x98f2('0x10')](_0x98f2('0x11'),_0x4d2f0d,_0x98f2('0x12'));logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x4d2f0d,_0x98f2('0x12'),JSON['stringify'](_0x1a8092));if(_0x1a8092[_0x98f2('0x13')]){if(_0x1a8092['error'][_0x98f2('0x14')]===0x1f4){logger['error'](_0x98f2('0x11'),_0x4d2f0d,_0x1a8092[_0x98f2('0x13')][_0x98f2('0x15')]);return _0x5e1d38(_0x1a8092['error'][_0x98f2('0x15')]);}logger[_0x98f2('0x13')]('MailQueue,\x20%s,\x20%s',_0x4d2f0d,_0x1a8092[_0x98f2('0x13')]['message']);return _0x2d62db(_0x1a8092[_0x98f2('0x13')]['message']);}else{logger[_0x98f2('0x10')](_0x98f2('0x11'),_0x4d2f0d,_0x98f2('0x12'));_0x2d62db(_0x1a8092[_0x98f2('0x16')][_0x98f2('0x15')]);}})[_0x98f2('0x17')](function(_0x449405){logger[_0x98f2('0x13')](_0x98f2('0x11'),_0x4d2f0d,_0x449405);_0x5e1d38(_0x449405);});});}exports[_0x98f2('0x18')]=function(_0x50f00d){var _0x2febfc=this;return new Promise(function(_0x34dd47,_0x569ed4){return db[_0x98f2('0x19')]['findAll']({'raw':_0x50f00d['options']?_0x50f00d['options'][_0x98f2('0x1a')]===undefined?!![]:![]:!![],'where':_0x50f00d['options']?_0x50f00d[_0x98f2('0x1b')][_0x98f2('0x1c')]||null:null,'attributes':_0x50f00d[_0x98f2('0x1b')]?_0x50f00d[_0x98f2('0x1b')][_0x98f2('0x1d')]||null:null,'limit':_0x50f00d[_0x98f2('0x1b')]?_0x50f00d[_0x98f2('0x1b')][_0x98f2('0x1e')]||null:null,'include':_0x50f00d[_0x98f2('0x1b')]?_0x50f00d['options'][_0x98f2('0x1f')]?_[_0x98f2('0x20')](_0x50f00d[_0x98f2('0x1b')][_0x98f2('0x1f')],function(_0x64915b){return{'model':db[_0x64915b['model']],'as':_0x64915b['as'],'attributes':_0x64915b['attributes'],'include':_0x64915b[_0x98f2('0x1f')]?_[_0x98f2('0x20')](_0x64915b[_0x98f2('0x1f')],function(_0x32da82){return{'model':db[_0x32da82['model']],'as':_0x32da82['as'],'attributes':_0x32da82['attributes'],'include':_0x32da82[_0x98f2('0x1f')]?_[_0x98f2('0x20')](_0x32da82[_0x98f2('0x1f')],function(_0x50a2b5){return{'model':db[_0x50a2b5['model']],'as':_0x50a2b5['as'],'attributes':_0x50a2b5[_0x98f2('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x558ce8){logger[_0x98f2('0x10')](_0x98f2('0x18'),_0x50f00d);logger[_0x98f2('0x21')]('GetMailQueue',_0x50f00d,JSON[_0x98f2('0x22')](_0x558ce8));_0x34dd47(_0x558ce8);})[_0x98f2('0x17')](function(_0x2f8552){logger[_0x98f2('0x13')]('GetMailQueue',_0x2f8552[_0x98f2('0x15')],_0x50f00d);_0x569ed4(_0x2febfc[_0x98f2('0x13')](0x1f4,_0x2f8552[_0x98f2('0x15')]));});});};exports[_0x98f2('0x23')]=function(_0x788001){var _0x799821=this;return new Promise(function(_0x2a452f,_0x29958c){return db[_0x98f2('0x19')]['find']({'raw':_0x788001[_0x98f2('0x1b')]?_0x788001['options']['raw']===undefined?!![]:![]:!![],'where':_0x788001['options']?_0x788001[_0x98f2('0x1b')][_0x98f2('0x1c')]||null:null,'attributes':_0x788001['options']?_0x788001['options'][_0x98f2('0x1d')]||null:null,'include':_0x788001[_0x98f2('0x1b')]?_0x788001[_0x98f2('0x1b')][_0x98f2('0x1f')]?_[_0x98f2('0x20')](_0x788001[_0x98f2('0x1b')]['include'],function(_0x2c3467){return{'model':db[_0x2c3467[_0x98f2('0x24')]],'as':_0x2c3467['as'],'attributes':_0x2c3467[_0x98f2('0x1d')],'include':_0x2c3467[_0x98f2('0x1f')]?_[_0x98f2('0x20')](_0x2c3467[_0x98f2('0x1f')],function(_0x5e211f){return{'model':db[_0x5e211f['model']],'as':_0x5e211f['as'],'attributes':_0x5e211f[_0x98f2('0x1d')],'include':_0x5e211f['include']?_[_0x98f2('0x20')](_0x5e211f[_0x98f2('0x1f')],function(_0x40bbde){return{'model':db[_0x40bbde['model']],'as':_0x40bbde['as'],'attributes':_0x40bbde[_0x98f2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x98f2('0xf')](function(_0x3e8d2a){logger[_0x98f2('0x10')](_0x98f2('0x23'),_0x788001);logger['debug']('ShowMailQueue',_0x788001,JSON['stringify'](_0x3e8d2a));_0x2a452f(_0x3e8d2a);})[_0x98f2('0x17')](function(_0x606a22){logger[_0x98f2('0x13')](_0x98f2('0x23'),_0x606a22[_0x98f2('0x15')],_0x788001);_0x29958c(_0x799821[_0x98f2('0x13')](0x1f4,_0x606a22[_0x98f2('0x15')]));});});}; \ No newline at end of file +var _0x425d=['MailQueue','options','where','attributes','limit','include','map','model','then','raw','ShowMailQueue','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','./mailQueue.socket','register','request','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMailQueue'];(function(_0xe089c0,_0x432e0b){var _0x4cd904=function(_0x20bd44){while(--_0x20bd44){_0xe089c0['push'](_0xe089c0['shift']());}};_0x4cd904(++_0x432e0b);}(_0x425d,0x143));var _0xd425=function(_0x504c05,_0x2fe006){_0x504c05=_0x504c05-0x0;var _0x31c04a=_0x425d[_0x504c05];return _0x31c04a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd425('0x0'));var BPromise=require(_0xd425('0x1'));var rs=require(_0xd425('0x2'));var fs=require('fs');var Redis=require(_0xd425('0x3'));var db=require(_0xd425('0x4'))['db'];var utils=require(_0xd425('0x5'));var logger=require(_0xd425('0x6'))(_0xd425('0x7'));var config=require(_0xd425('0x8'));var jayson=require(_0xd425('0x9'));var client=jayson[_0xd425('0xa')]['http']({'port':0x232a});config[_0xd425('0xb')]=_['defaults'](config['redis'],{'host':_0xd425('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd425('0xb')]));require(_0xd425('0xd'))[_0xd425('0xe')](socket);function respondWithRpcPromise(_0x581a66,_0x34e77c,_0x33792a){return new BPromise(function(_0x4522f4,_0x2c7b89){return client[_0xd425('0xf')](_0x581a66,_0x33792a)['then'](function(_0x7951a5){logger['info'](_0xd425('0x10'),_0x34e77c,_0xd425('0x11'));logger[_0xd425('0x12')](_0xd425('0x13'),_0x34e77c,_0xd425('0x11'),JSON[_0xd425('0x14')](_0x7951a5));if(_0x7951a5['error']){if(_0x7951a5[_0xd425('0x15')][_0xd425('0x16')]===0x1f4){logger[_0xd425('0x15')](_0xd425('0x10'),_0x34e77c,_0x7951a5['error']['message']);return _0x2c7b89(_0x7951a5[_0xd425('0x15')][_0xd425('0x17')]);}logger['error'](_0xd425('0x10'),_0x34e77c,_0x7951a5[_0xd425('0x15')][_0xd425('0x17')]);return _0x4522f4(_0x7951a5['error'][_0xd425('0x17')]);}else{logger[_0xd425('0x18')](_0xd425('0x10'),_0x34e77c,_0xd425('0x11'));_0x4522f4(_0x7951a5[_0xd425('0x19')][_0xd425('0x17')]);}})[_0xd425('0x1a')](function(_0x301025){logger[_0xd425('0x15')](_0xd425('0x10'),_0x34e77c,_0x301025);_0x2c7b89(_0x301025);});});}exports[_0xd425('0x1b')]=function(_0x20a537){var _0x11958f=this;return new Promise(function(_0x1a2ace,_0x30ba02){return db[_0xd425('0x1c')]['findAll']({'raw':_0x20a537['options']?_0x20a537[_0xd425('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x20a537[_0xd425('0x1d')]?_0x20a537['options'][_0xd425('0x1e')]||null:null,'attributes':_0x20a537[_0xd425('0x1d')]?_0x20a537[_0xd425('0x1d')][_0xd425('0x1f')]||null:null,'limit':_0x20a537['options']?_0x20a537[_0xd425('0x1d')][_0xd425('0x20')]||null:null,'include':_0x20a537['options']?_0x20a537[_0xd425('0x1d')][_0xd425('0x21')]?_[_0xd425('0x22')](_0x20a537[_0xd425('0x1d')][_0xd425('0x21')],function(_0x5df3c3){return{'model':db[_0x5df3c3[_0xd425('0x23')]],'as':_0x5df3c3['as'],'attributes':_0x5df3c3[_0xd425('0x1f')],'include':_0x5df3c3['include']?_[_0xd425('0x22')](_0x5df3c3[_0xd425('0x21')],function(_0x2de3bd){return{'model':db[_0x2de3bd['model']],'as':_0x2de3bd['as'],'attributes':_0x2de3bd[_0xd425('0x1f')],'include':_0x2de3bd[_0xd425('0x21')]?_[_0xd425('0x22')](_0x2de3bd[_0xd425('0x21')],function(_0x54eda7){return{'model':db[_0x54eda7[_0xd425('0x23')]],'as':_0x54eda7['as'],'attributes':_0x54eda7[_0xd425('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd425('0x24')](function(_0x27b69a){logger[_0xd425('0x18')](_0xd425('0x1b'),_0x20a537);logger[_0xd425('0x12')](_0xd425('0x1b'),_0x20a537,JSON[_0xd425('0x14')](_0x27b69a));_0x1a2ace(_0x27b69a);})[_0xd425('0x1a')](function(_0x390f3b){logger[_0xd425('0x15')](_0xd425('0x1b'),_0x390f3b[_0xd425('0x17')],_0x20a537);_0x30ba02(_0x11958f[_0xd425('0x15')](0x1f4,_0x390f3b[_0xd425('0x17')]));});});};exports['ShowMailQueue']=function(_0x129e6b){var _0x4b5e25=this;return new Promise(function(_0x1a5bf8,_0x43c3c7){return db[_0xd425('0x1c')]['find']({'raw':_0x129e6b[_0xd425('0x1d')]?_0x129e6b[_0xd425('0x1d')][_0xd425('0x25')]===undefined?!![]:![]:!![],'where':_0x129e6b[_0xd425('0x1d')]?_0x129e6b['options'][_0xd425('0x1e')]||null:null,'attributes':_0x129e6b[_0xd425('0x1d')]?_0x129e6b[_0xd425('0x1d')]['attributes']||null:null,'include':_0x129e6b[_0xd425('0x1d')]?_0x129e6b[_0xd425('0x1d')]['include']?_['map'](_0x129e6b['options'][_0xd425('0x21')],function(_0x449565){return{'model':db[_0x449565[_0xd425('0x23')]],'as':_0x449565['as'],'attributes':_0x449565[_0xd425('0x1f')],'include':_0x449565['include']?_['map'](_0x449565[_0xd425('0x21')],function(_0x58e299){return{'model':db[_0x58e299[_0xd425('0x23')]],'as':_0x58e299['as'],'attributes':_0x58e299[_0xd425('0x1f')],'include':_0x58e299[_0xd425('0x21')]?_[_0xd425('0x22')](_0x58e299['include'],function(_0x5bfe0b){return{'model':db[_0x5bfe0b['model']],'as':_0x5bfe0b['as'],'attributes':_0x5bfe0b[_0xd425('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd425('0x24')](function(_0x1b2c27){logger[_0xd425('0x18')](_0xd425('0x26'),_0x129e6b);logger[_0xd425('0x12')](_0xd425('0x26'),_0x129e6b,JSON[_0xd425('0x14')](_0x1b2c27));_0x1a5bf8(_0x1b2c27);})['catch'](function(_0x527d9d){logger['error'](_0xd425('0x26'),_0x527d9d[_0xd425('0x17')],_0x129e6b);_0x43c3c7(_0x4b5e25[_0xd425('0x15')](0x1f4,_0x527d9d[_0xd425('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 406dc9c..41512ac 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 _0x6522=['register','mailQueue:','./mailQueue.events','save','remove','update','emit'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6522,0xb1));var _0x2652=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x6522[_0x2c91e9];return _0x13f0ff;};'use strict';var MailQueueEvents=require(_0x2652('0x0'));var events=[_0x2652('0x1'),_0x2652('0x2'),_0x2652('0x3')];function createListener(_0x2ca853,_0x30e2bb){return function(_0x577817){_0x30e2bb[_0x2652('0x4')](_0x2ca853,_0x577817);};}function removeListener(_0x95c4fb,_0xd49911){return function(){MailQueueEvents['removeListener'](_0x95c4fb,_0xd49911);};}exports[_0x2652('0x5')]=function(_0x3fc721){for(var _0x337540=0x0,_0x4d57e5=events['length'];_0x337540<_0x4d57e5;_0x337540++){var _0x170f68=events[_0x337540];var _0x36afbf=createListener(_0x2652('0x6')+_0x170f68,_0x3fc721);MailQueueEvents['on'](_0x170f68,_0x36afbf);}}; \ No newline at end of file +var _0x3fbe=['register','length','remove','update','emit'];(function(_0x454ea9,_0x4f9868){var _0x5dbe48=function(_0x37ea31){while(--_0x37ea31){_0x454ea9['push'](_0x454ea9['shift']());}};_0x5dbe48(++_0x4f9868);}(_0x3fbe,0x115));var _0xe3fb=function(_0x4ca3f2,_0x1f1a8b){_0x4ca3f2=_0x4ca3f2-0x0;var _0x15580d=_0x3fbe[_0x4ca3f2];return _0x15580d;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save',_0xe3fb('0x0'),_0xe3fb('0x1')];function createListener(_0x2f9625,_0x323a04){return function(_0x1b28d7){_0x323a04[_0xe3fb('0x2')](_0x2f9625,_0x1b28d7);};}function removeListener(_0x32a0d6,_0x176abe){return function(){MailQueueEvents['removeListener'](_0x32a0d6,_0x176abe);};}exports[_0xe3fb('0x3')]=function(_0xb7fe76){for(var _0x31f8ee=0x0,_0x5c5b33=events[_0xe3fb('0x4')];_0x31f8ee<_0x5c5b33;_0x31f8ee++){var _0x946815=events[_0x31f8ee];var _0x308acd=createListener('mailQueue:'+_0x946815,_0xb7fe76);MailQueueEvents['on'](_0x946815,_0x308acd);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 5394f6c..f721785 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 _0xee5c=['post','create','put','/:id','update','destroy','exports','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x46bbbe,_0x144bc5){var _0xa459eb=function(_0x1b776e){while(--_0x1b776e){_0x46bbbe['push'](_0x46bbbe['shift']());}};_0xa459eb(++_0x144bc5);}(_0xee5c,0xc5));var _0xcee5=function(_0x2e4cbf,_0x8763d3){_0x2e4cbf=_0x2e4cbf-0x0;var _0x52840f=_0xee5c[_0x2e4cbf];return _0x52840f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xcee5('0x0'));var express=require(_0xcee5('0x1'));var router=express[_0xcee5('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xcee5('0x3'));var config=require(_0xcee5('0x4'));var controller=require(_0xcee5('0x5'));router[_0xcee5('0x6')]('/',auth[_0xcee5('0x7')](),controller[_0xcee5('0x8')]);router[_0xcee5('0x6')](_0xcee5('0x9'),auth[_0xcee5('0x7')](),controller[_0xcee5('0xa')]);router[_0xcee5('0x6')]('/:id',auth[_0xcee5('0x7')](),controller[_0xcee5('0xb')]);router[_0xcee5('0xc')]('/',auth[_0xcee5('0x7')](),controller[_0xcee5('0xd')]);router[_0xcee5('0xe')](_0xcee5('0xf'),auth[_0xcee5('0x7')](),controller[_0xcee5('0x10')]);router['delete'](_0xcee5('0xf'),auth[_0xcee5('0x7')](),controller[_0xcee5('0x11')]);module[_0xcee5('0x12')]=router; \ No newline at end of file +var _0xfc17=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','describe','/:id','post','create','update','delete','destroy'];(function(_0x452985,_0x1ca4af){var _0x115294=function(_0x38a74d){while(--_0x38a74d){_0x452985['push'](_0x452985['shift']());}};_0x115294(++_0x1ca4af);}(_0xfc17,0xbf));var _0x7fc1=function(_0x56bb19,_0x3edf34){_0x56bb19=_0x56bb19-0x0;var _0x2b0451=_0xfc17[_0x56bb19];return _0x2b0451;};'use strict';var multer=require(_0x7fc1('0x0'));var util=require(_0x7fc1('0x1'));var path=require(_0x7fc1('0x2'));var timeout=require(_0x7fc1('0x3'));var express=require(_0x7fc1('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7fc1('0x5'));var config=require(_0x7fc1('0x6'));var controller=require(_0x7fc1('0x7'));router[_0x7fc1('0x8')]('/',auth[_0x7fc1('0x9')](),controller[_0x7fc1('0xa')]);router[_0x7fc1('0x8')]('/describe',auth[_0x7fc1('0x9')](),controller[_0x7fc1('0xb')]);router[_0x7fc1('0x8')](_0x7fc1('0xc'),auth[_0x7fc1('0x9')](),controller['show']);router[_0x7fc1('0xd')]('/',auth['isAuthenticated'](),controller[_0x7fc1('0xe')]);router['put'](_0x7fc1('0xc'),auth[_0x7fc1('0x9')](),controller[_0x7fc1('0xf')]);router[_0x7fc1('0x10')](_0x7fc1('0xc'),auth[_0x7fc1('0x9')](),controller[_0x7fc1('0x11')]);module[_0x7fc1('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index ef7062f..ccccf6b 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 _0x8693=['sequelize','exports','STRING','DATE'];(function(_0x59d4f3,_0x3db273){var _0x227b8d=function(_0x22cf61){while(--_0x22cf61){_0x59d4f3['push'](_0x59d4f3['shift']());}};_0x227b8d(++_0x3db273);}(_0x8693,0x1b0));var _0x3869=function(_0x485af0,_0x23da55){_0x485af0=_0x485af0-0x0;var _0x49380d=_0x8693[_0x485af0];return _0x49380d;};'use strict';var moment=require('moment');var Sequelize=require(_0x3869('0x0'));module[_0x3869('0x1')]={'uniqueid':{'type':Sequelize[_0x3869('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x3869('0x2')]},'joinAt':{'type':Sequelize[_0x3869('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3869('0x3')]},'exitAt':{'type':Sequelize[_0x3869('0x3')]},'reason':{'type':Sequelize[_0x3869('0x2')]}}; \ No newline at end of file +var _0x5d72=['DATE','moment','STRING'];(function(_0x349538,_0x173e1c){var _0x4e5a7f=function(_0x1976b3){while(--_0x1976b3){_0x349538['push'](_0x349538['shift']());}};_0x4e5a7f(++_0x173e1c);}(_0x5d72,0xb8));var _0x25d7=function(_0x5a4b16,_0x294bb1){_0x5a4b16=_0x5a4b16-0x0;var _0x5236dc=_0x5d72[_0x5a4b16];return _0x5236dc;};'use strict';var moment=require(_0x25d7('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x25d7('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x25d7('0x1')]},'joinAt':{'type':Sequelize[_0x25d7('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x25d7('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x25d7('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 9f3fda8..41586e4 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 _0xb396=['pick','filter','map','type','field','merge','options','MailQueueReport','includeAll','include','findAll','catch','params','intersection','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','index','rawAttributes','model','keys','query','filters','attributes','fields','length','nolimit','order','sort','where'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xb396,0x1e8));var _0x6b39=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb396[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0x6b39('0x0'));var emlformat=require(_0x6b39('0x1'));var rimraf=require(_0x6b39('0x2'));var zipdir=require(_0x6b39('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6b39('0x4'));var moment=require(_0x6b39('0x5'));var BPromise=require(_0x6b39('0x6'));var Mustache=require(_0x6b39('0x7'));var util=require(_0x6b39('0x8'));var path=require(_0x6b39('0x9'));var sox=require('sox');var csv=require(_0x6b39('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6b39('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6b39('0xc'));var deskjs=require(_0x6b39('0xd'));var toCsv=require(_0x6b39('0xa'));var querystring=require(_0x6b39('0xe'));var Papa=require(_0x6b39('0xf'));var Redis=require(_0x6b39('0x10'));var authService=require(_0x6b39('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6b39('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x121f8a,_0x366232){_0x366232=_0x366232||0xcc;return function(_0x513855){if(_0x513855){return _0x121f8a['sendStatus'](_0x366232);}return _0x121f8a[_0x6b39('0x13')](_0x366232)[_0x6b39('0x14')]();};}function respondWithResult(_0x21f78a,_0x20c41d){_0x20c41d=_0x20c41d||0xc8;return function(_0x104167){if(_0x104167){return _0x21f78a['status'](_0x20c41d)[_0x6b39('0x15')](_0x104167);}};}function respondWithFilteredResult(_0x47f61f,_0x26c704){return function(_0x18c3c7){if(_0x18c3c7){var _0x2b190b=_0x18c3c7[_0x6b39('0x16')],_0x49277f=_0x26c704[_0x6b39('0x17')],_0x84b853=_0x26c704[_0x6b39('0x17')]+_0x26c704[_0x6b39('0x18')],_0x5426f5;if(_0x84b853>=_0x2b190b){_0x84b853=_0x2b190b;_0x5426f5=0xc8;}else{_0x5426f5=0xce;}_0x47f61f[_0x6b39('0x13')](_0x5426f5);return _0x47f61f[_0x6b39('0x19')](_0x6b39('0x1a'),_0x49277f+'-'+_0x84b853+'/'+_0x2b190b)[_0x6b39('0x15')](_0x18c3c7);}return null;};}function patchUpdates(_0x524dbf){return function(_0x51a7dc){try{jsonpatch[_0x6b39('0x1b')](_0x51a7dc,_0x524dbf,!![]);}catch(_0x217527){return BPromise[_0x6b39('0x1c')](_0x217527);}return _0x51a7dc[_0x6b39('0x1d')]();};}function saveUpdates(_0x1893ad,_0x299538){return function(_0x458e7d){if(_0x458e7d){return _0x458e7d['update'](_0x1893ad)[_0x6b39('0x1e')](function(_0x23aab1){return _0x23aab1;});}return null;};}function removeEntity(_0x4a631b,_0x187ab1){return function(_0x39502d){if(_0x39502d){return _0x39502d[_0x6b39('0x1f')]()[_0x6b39('0x1e')](function(){_0x4a631b['status'](0xcc)[_0x6b39('0x14')]();});}};}function handleEntityNotFound(_0x4a4bc4,_0x5c2be5){return function(_0x6fd12){if(!_0x6fd12){_0x4a4bc4[_0x6b39('0x20')](0x194);}return _0x6fd12;};}function handleError(_0x1f70bd,_0x5183cc){_0x5183cc=_0x5183cc||0x1f4;return function(_0x4ebc33){logger[_0x6b39('0x21')](_0x4ebc33['stack']);if(_0x4ebc33[_0x6b39('0x22')]){delete _0x4ebc33[_0x6b39('0x22')];}_0x1f70bd[_0x6b39('0x13')](_0x5183cc)['send'](_0x4ebc33);};}exports[_0x6b39('0x23')]=function(_0x517d16,_0x2e1ea1){var _0x4f0c90={},_0x2e4527={},_0x2dfdd4={'count':0x0,'rows':[]};var _0x19f53b=db['MailQueueReport'][_0x6b39('0x24')];_0x2e4527[_0x6b39('0x25')]=_[_0x6b39('0x26')](_0x19f53b);_0x2e4527['query']=_[_0x6b39('0x26')](_0x517d16[_0x6b39('0x27')]);_0x2e4527[_0x6b39('0x28')]=_['intersection'](_0x2e4527[_0x6b39('0x25')],_0x2e4527[_0x6b39('0x27')]);_0x4f0c90[_0x6b39('0x29')]=_['intersection'](_0x2e4527[_0x6b39('0x25')],qs[_0x6b39('0x2a')](_0x517d16[_0x6b39('0x27')][_0x6b39('0x2a')]));_0x4f0c90[_0x6b39('0x29')]=_0x4f0c90[_0x6b39('0x29')][_0x6b39('0x2b')]?_0x4f0c90['attributes']:_0x2e4527[_0x6b39('0x25')];if(!_0x517d16[_0x6b39('0x27')]['hasOwnProperty'](_0x6b39('0x2c'))){_0x4f0c90[_0x6b39('0x18')]=qs[_0x6b39('0x18')](_0x517d16[_0x6b39('0x27')][_0x6b39('0x18')]);_0x4f0c90[_0x6b39('0x17')]=qs['offset'](_0x517d16[_0x6b39('0x27')][_0x6b39('0x17')]);}_0x4f0c90[_0x6b39('0x2d')]=qs[_0x6b39('0x2e')](_0x517d16['query'][_0x6b39('0x2e')]);_0x4f0c90[_0x6b39('0x2f')]=qs[_0x6b39('0x28')](_[_0x6b39('0x30')](_0x517d16[_0x6b39('0x27')],_0x2e4527[_0x6b39('0x28')]));if(_0x517d16[_0x6b39('0x27')][_0x6b39('0x31')]){_0x4f0c90[_0x6b39('0x2f')]=_['merge'](_0x4f0c90['where'],{'$or':_[_0x6b39('0x32')](_0x19f53b,function(_0x1cfd64){if(_0x1cfd64[_0x6b39('0x33')]['key']!=='VIRTUAL'){var _0x54a362={};_0x54a362[_0x1cfd64[_0x6b39('0x34')]]={'$like':'%'+_0x517d16[_0x6b39('0x27')][_0x6b39('0x31')]+'%'};return _0x54a362;}})});}_0x4f0c90=_[_0x6b39('0x35')]({},_0x4f0c90,_0x517d16[_0x6b39('0x36')]);var _0x541dce={'where':_0x4f0c90[_0x6b39('0x2f')]};return db[_0x6b39('0x37')][_0x6b39('0x16')](_0x541dce)[_0x6b39('0x1e')](function(_0x54953f){_0x2dfdd4[_0x6b39('0x16')]=_0x54953f;if(_0x517d16[_0x6b39('0x27')][_0x6b39('0x38')]){_0x4f0c90[_0x6b39('0x39')]=[{'all':!![]}];}return db[_0x6b39('0x37')][_0x6b39('0x3a')](_0x4f0c90);})[_0x6b39('0x1e')](function(_0x3a182a){_0x2dfdd4['rows']=_0x3a182a;return _0x2dfdd4;})['then'](respondWithFilteredResult(_0x2e1ea1,_0x4f0c90))[_0x6b39('0x3b')](handleError(_0x2e1ea1,null));};exports['show']=function(_0x1507af,_0x3bea34){var _0x86456f={'raw':!![],'where':{'id':_0x1507af[_0x6b39('0x3c')]['id']}},_0xe3c406={};_0xe3c406[_0x6b39('0x25')]=_[_0x6b39('0x26')](db['MailQueueReport'][_0x6b39('0x24')]);_0xe3c406[_0x6b39('0x27')]=_[_0x6b39('0x26')](_0x1507af[_0x6b39('0x27')]);_0xe3c406[_0x6b39('0x28')]=_[_0x6b39('0x3d')](_0xe3c406[_0x6b39('0x25')],_0xe3c406['query']);_0x86456f[_0x6b39('0x29')]=_[_0x6b39('0x3d')](_0xe3c406[_0x6b39('0x25')],qs['fields'](_0x1507af[_0x6b39('0x27')][_0x6b39('0x2a')]));_0x86456f[_0x6b39('0x29')]=_0x86456f[_0x6b39('0x29')][_0x6b39('0x2b')]?_0x86456f[_0x6b39('0x29')]:_0xe3c406[_0x6b39('0x25')];if(_0x1507af[_0x6b39('0x27')]['includeAll']){_0x86456f[_0x6b39('0x39')]=[{'all':!![]}];}_0x86456f=_[_0x6b39('0x35')]({},_0x86456f,_0x1507af[_0x6b39('0x36')]);return db[_0x6b39('0x37')][_0x6b39('0x3e')](_0x86456f)[_0x6b39('0x1e')](handleEntityNotFound(_0x3bea34,null))['then'](respondWithResult(_0x3bea34,null))[_0x6b39('0x3b')](handleError(_0x3bea34,null));};exports[_0x6b39('0x3f')]=function(_0x4ded23,_0x5cb7c9){return db[_0x6b39('0x37')][_0x6b39('0x3f')](_0x4ded23[_0x6b39('0x40')],{})[_0x6b39('0x1e')](respondWithResult(_0x5cb7c9,0xc9))[_0x6b39('0x3b')](handleError(_0x5cb7c9,null));};exports[_0x6b39('0x41')]=function(_0x4f97be,_0x3c5c66){if(_0x4f97be['body']['id']){delete _0x4f97be[_0x6b39('0x40')]['id'];}return db['MailQueueReport'][_0x6b39('0x3e')]({'where':{'id':_0x4f97be[_0x6b39('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3c5c66,null))['then'](saveUpdates(_0x4f97be['body'],null))['then'](respondWithResult(_0x3c5c66,null))[_0x6b39('0x3b')](handleError(_0x3c5c66,null));};exports['destroy']=function(_0x983474,_0x1d4d29){return db[_0x6b39('0x37')][_0x6b39('0x3e')]({'where':{'id':_0x983474[_0x6b39('0x3c')]['id']}})[_0x6b39('0x1e')](handleEntityNotFound(_0x1d4d29,null))['then'](removeEntity(_0x1d4d29,null))[_0x6b39('0x3b')](handleError(_0x1d4d29,null));};exports[_0x6b39('0x42')]=function(_0x95ff6d,_0x516c3c){return db[_0x6b39('0x37')]['describe']()['then'](respondWithResult(_0x516c3c,null))[_0x6b39('0x3b')](handleError(_0x516c3c,null));}; \ No newline at end of file +var _0xebae=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','destroy','then','end','error','name','send','index','MailQueueReport','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','include','rows','catch','intersection','find','create','body','update','params','describe','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xebae,0x83));var _0xeeba=function(_0x1c0fc3,_0x3537bb){_0x1c0fc3=_0x1c0fc3-0x0;var _0x338237=_0xebae[_0x1c0fc3];return _0x338237;};'use strict';var pdf=require(_0xeeba('0x0'));var emlformat=require(_0xeeba('0x1'));var rimraf=require(_0xeeba('0x2'));var zipdir=require(_0xeeba('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xeeba('0x4'));var BPromise=require(_0xeeba('0x5'));var Mustache=require(_0xeeba('0x6'));var util=require(_0xeeba('0x7'));var path=require(_0xeeba('0x8'));var sox=require(_0xeeba('0x9'));var csv=require(_0xeeba('0xa'));var ejs=require(_0xeeba('0xb'));var fs=require('fs');var _=require(_0xeeba('0xc'));var squel=require(_0xeeba('0xd'));var crypto=require(_0xeeba('0xe'));var jsforce=require(_0xeeba('0xf'));var deskjs=require(_0xeeba('0x10'));var toCsv=require('to-csv');var querystring=require(_0xeeba('0x11'));var Papa=require(_0xeeba('0x12'));var Redis=require(_0xeeba('0x13'));var authService=require(_0xeeba('0x14'));var qs=require(_0xeeba('0x15'));var hardwareService=require(_0xeeba('0x16'));var logger=require(_0xeeba('0x17'))(_0xeeba('0x18'));var utils=require(_0xeeba('0x19'));var config=require(_0xeeba('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17f3b0,_0x4971a8){_0x4971a8=_0x4971a8||0xcc;return function(_0xf1cb74){if(_0xf1cb74){return _0x17f3b0[_0xeeba('0x1b')](_0x4971a8);}return _0x17f3b0[_0xeeba('0x1c')](_0x4971a8)['end']();};}function respondWithResult(_0x1c34ce,_0x3b3ec4){_0x3b3ec4=_0x3b3ec4||0xc8;return function(_0x5f0d5e){if(_0x5f0d5e){return _0x1c34ce[_0xeeba('0x1c')](_0x3b3ec4)[_0xeeba('0x1d')](_0x5f0d5e);}};}function respondWithFilteredResult(_0x472ffe,_0x4167ec){return function(_0x50b7b7){if(_0x50b7b7){var _0x1421e0=_0x50b7b7[_0xeeba('0x1e')],_0x49e12c=_0x4167ec['offset'],_0x217b37=_0x4167ec[_0xeeba('0x1f')]+_0x4167ec['limit'],_0x194602;if(_0x217b37>=_0x1421e0){_0x217b37=_0x1421e0;_0x194602=0xc8;}else{_0x194602=0xce;}_0x472ffe[_0xeeba('0x1c')](_0x194602);return _0x472ffe[_0xeeba('0x20')](_0xeeba('0x21'),_0x49e12c+'-'+_0x217b37+'/'+_0x1421e0)['json'](_0x50b7b7);}return null;};}function patchUpdates(_0x2648cc){return function(_0x1a3569){try{jsonpatch[_0xeeba('0x22')](_0x1a3569,_0x2648cc,!![]);}catch(_0x2d90c0){return BPromise[_0xeeba('0x23')](_0x2d90c0);}return _0x1a3569[_0xeeba('0x24')]();};}function saveUpdates(_0x3816b8,_0x3f9bca){return function(_0x4b409d){if(_0x4b409d){return _0x4b409d['update'](_0x3816b8)['then'](function(_0x3d4a9b){return _0x3d4a9b;});}return null;};}function removeEntity(_0x59d489,_0x136ee1){return function(_0x46c49d){if(_0x46c49d){return _0x46c49d[_0xeeba('0x25')]()[_0xeeba('0x26')](function(){_0x59d489[_0xeeba('0x1c')](0xcc)[_0xeeba('0x27')]();});}};}function handleEntityNotFound(_0x4dda88,_0x2465b2){return function(_0x25343c){if(!_0x25343c){_0x4dda88[_0xeeba('0x1b')](0x194);}return _0x25343c;};}function handleError(_0x2ddcb8,_0x43b9e0){_0x43b9e0=_0x43b9e0||0x1f4;return function(_0x469f52){logger[_0xeeba('0x28')](_0x469f52['stack']);if(_0x469f52['name']){delete _0x469f52[_0xeeba('0x29')];}_0x2ddcb8[_0xeeba('0x1c')](_0x43b9e0)[_0xeeba('0x2a')](_0x469f52);};}exports[_0xeeba('0x2b')]=function(_0x2e3bf2,_0x5771bc){var _0x1e2d9d={},_0x43ca35={},_0x5d1380={'count':0x0,'rows':[]};var _0x4fefb4=db[_0xeeba('0x2c')][_0xeeba('0x2d')];_0x43ca35[_0xeeba('0x2e')]=_[_0xeeba('0x2f')](_0x4fefb4);_0x43ca35[_0xeeba('0x30')]=_[_0xeeba('0x2f')](_0x2e3bf2['query']);_0x43ca35[_0xeeba('0x31')]=_['intersection'](_0x43ca35[_0xeeba('0x2e')],_0x43ca35['query']);_0x1e2d9d[_0xeeba('0x32')]=_['intersection'](_0x43ca35['model'],qs[_0xeeba('0x33')](_0x2e3bf2[_0xeeba('0x30')][_0xeeba('0x33')]));_0x1e2d9d[_0xeeba('0x32')]=_0x1e2d9d['attributes'][_0xeeba('0x34')]?_0x1e2d9d[_0xeeba('0x32')]:_0x43ca35[_0xeeba('0x2e')];if(!_0x2e3bf2[_0xeeba('0x30')][_0xeeba('0x35')](_0xeeba('0x36'))){_0x1e2d9d[_0xeeba('0x37')]=qs[_0xeeba('0x37')](_0x2e3bf2[_0xeeba('0x30')][_0xeeba('0x37')]);_0x1e2d9d[_0xeeba('0x1f')]=qs[_0xeeba('0x1f')](_0x2e3bf2[_0xeeba('0x30')][_0xeeba('0x1f')]);}_0x1e2d9d['order']=qs[_0xeeba('0x38')](_0x2e3bf2[_0xeeba('0x30')]['sort']);_0x1e2d9d[_0xeeba('0x39')]=qs[_0xeeba('0x31')](_[_0xeeba('0x3a')](_0x2e3bf2['query'],_0x43ca35[_0xeeba('0x31')]));if(_0x2e3bf2['query'][_0xeeba('0x3b')]){_0x1e2d9d[_0xeeba('0x39')]=_[_0xeeba('0x3c')](_0x1e2d9d['where'],{'$or':_[_0xeeba('0x3d')](_0x4fefb4,function(_0x57eda3){if(_0x57eda3[_0xeeba('0x3e')]['key']!==_0xeeba('0x3f')){var _0x2d8bfd={};_0x2d8bfd[_0x57eda3[_0xeeba('0x40')]]={'$like':'%'+_0x2e3bf2[_0xeeba('0x30')]['filter']+'%'};return _0x2d8bfd;}})});}_0x1e2d9d=_['merge']({},_0x1e2d9d,_0x2e3bf2[_0xeeba('0x41')]);var _0x6e2a66={'where':_0x1e2d9d[_0xeeba('0x39')]};return db[_0xeeba('0x2c')][_0xeeba('0x1e')](_0x6e2a66)[_0xeeba('0x26')](function(_0x5d80ae){_0x5d1380[_0xeeba('0x1e')]=_0x5d80ae;if(_0x2e3bf2[_0xeeba('0x30')]['includeAll']){_0x1e2d9d[_0xeeba('0x42')]=[{'all':!![]}];}return db[_0xeeba('0x2c')]['findAll'](_0x1e2d9d);})[_0xeeba('0x26')](function(_0x4f239b){_0x5d1380[_0xeeba('0x43')]=_0x4f239b;return _0x5d1380;})[_0xeeba('0x26')](respondWithFilteredResult(_0x5771bc,_0x1e2d9d))[_0xeeba('0x44')](handleError(_0x5771bc,null));};exports['show']=function(_0x504f93,_0x3f781a){var _0x1f1b39={'raw':!![],'where':{'id':_0x504f93['params']['id']}},_0x28a82f={};_0x28a82f['model']=_[_0xeeba('0x2f')](db[_0xeeba('0x2c')][_0xeeba('0x2d')]);_0x28a82f[_0xeeba('0x30')]=_[_0xeeba('0x2f')](_0x504f93[_0xeeba('0x30')]);_0x28a82f['filters']=_[_0xeeba('0x45')](_0x28a82f[_0xeeba('0x2e')],_0x28a82f[_0xeeba('0x30')]);_0x1f1b39['attributes']=_[_0xeeba('0x45')](_0x28a82f[_0xeeba('0x2e')],qs[_0xeeba('0x33')](_0x504f93['query'][_0xeeba('0x33')]));_0x1f1b39['attributes']=_0x1f1b39[_0xeeba('0x32')]['length']?_0x1f1b39[_0xeeba('0x32')]:_0x28a82f[_0xeeba('0x2e')];if(_0x504f93[_0xeeba('0x30')]['includeAll']){_0x1f1b39[_0xeeba('0x42')]=[{'all':!![]}];}_0x1f1b39=_[_0xeeba('0x3c')]({},_0x1f1b39,_0x504f93[_0xeeba('0x41')]);return db['MailQueueReport'][_0xeeba('0x46')](_0x1f1b39)[_0xeeba('0x26')](handleEntityNotFound(_0x3f781a,null))['then'](respondWithResult(_0x3f781a,null))[_0xeeba('0x44')](handleError(_0x3f781a,null));};exports[_0xeeba('0x47')]=function(_0x11081a,_0x3b79b4){return db['MailQueueReport'][_0xeeba('0x47')](_0x11081a[_0xeeba('0x48')],{})['then'](respondWithResult(_0x3b79b4,0xc9))[_0xeeba('0x44')](handleError(_0x3b79b4,null));};exports[_0xeeba('0x49')]=function(_0x3c2f00,_0x412752){if(_0x3c2f00['body']['id']){delete _0x3c2f00[_0xeeba('0x48')]['id'];}return db[_0xeeba('0x2c')][_0xeeba('0x46')]({'where':{'id':_0x3c2f00['params']['id']}})[_0xeeba('0x26')](handleEntityNotFound(_0x412752,null))[_0xeeba('0x26')](saveUpdates(_0x3c2f00[_0xeeba('0x48')],null))[_0xeeba('0x26')](respondWithResult(_0x412752,null))[_0xeeba('0x44')](handleError(_0x412752,null));};exports[_0xeeba('0x25')]=function(_0x3b10c3,_0x17910c){return db[_0xeeba('0x2c')]['find']({'where':{'id':_0x3b10c3[_0xeeba('0x4a')]['id']}})[_0xeeba('0x26')](handleEntityNotFound(_0x17910c,null))[_0xeeba('0x26')](removeEntity(_0x17910c,null))[_0xeeba('0x44')](handleError(_0x17910c,null));};exports[_0xeeba('0x4b')]=function(_0x571605,_0x1a9d09){return db[_0xeeba('0x2c')][_0xeeba('0x4b')]()['then'](respondWithResult(_0x1a9d09,null))[_0xeeba('0x44')](handleError(_0x1a9d09,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 0771570..dbc2ce6 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 _0xa902=['../../config/logger','api','moment','request-promise','../../config/environment','./mailQueueReport.attributes','exports','define','report_mail_queue','lodash','util'];(function(_0x1825bc,_0x1abed5){var _0x4f5510=function(_0xe07b93){while(--_0xe07b93){_0x1825bc['push'](_0x1825bc['shift']());}};_0x4f5510(++_0x1abed5);}(_0xa902,0x8d));var _0x2a90=function(_0x32fb4a,_0x14adac){_0x32fb4a=_0x32fb4a-0x0;var _0x225e5f=_0xa902[_0x32fb4a];return _0x225e5f;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var logger=require(_0x2a90('0x2'))(_0x2a90('0x3'));var moment=require(_0x2a90('0x4'));var BPromise=require('bluebird');var rp=require(_0x2a90('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2a90('0x6'));var attributes=require(_0x2a90('0x7'));module[_0x2a90('0x8')]=function(_0x21e1d2,_0x4a32c7){return _0x21e1d2[_0x2a90('0x9')]('MailQueueReport',attributes,{'tableName':_0x2a90('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5eb1=['rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','report_mail_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x174e6b,_0x124a26){var _0x10ab0e=function(_0x704225){while(--_0x704225){_0x174e6b['push'](_0x174e6b['shift']());}};_0x10ab0e(++_0x124a26);}(_0x5eb1,0x7c));var _0x15eb=function(_0x5b5947,_0x11623c){_0x5b5947=_0x5b5947-0x0;var _0x7623e0=_0x5eb1[_0x5b5947];return _0x7623e0;};'use strict';var _=require('lodash');var util=require(_0x15eb('0x0'));var logger=require(_0x15eb('0x1'))(_0x15eb('0x2'));var moment=require(_0x15eb('0x3'));var BPromise=require(_0x15eb('0x4'));var rp=require(_0x15eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x15eb('0x6'));var config=require(_0x15eb('0x7'));var attributes=require(_0x15eb('0x8'));module[_0x15eb('0x9')]=function(_0x47e341,_0x1be042){return _0x47e341[_0x15eb('0xa')]('MailQueueReport',attributes,{'tableName':_0x15eb('0xb'),'paranoid':![],'indexes':[{'name':_0x15eb('0xc'),'fields':[_0x15eb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index f0da58c..7172ffa 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 _0x1d45=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','MailQueueReport,\x20%s,\x20%s','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','stringify','lodash','util'];(function(_0x18039a,_0x40215a){var _0x360971=function(_0x28620d){while(--_0x28620d){_0x18039a['push'](_0x18039a['shift']());}};_0x360971(++_0x40215a);}(_0x1d45,0xc4));var _0x51d4=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x1d45[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require(_0x51d4('0x0'));var util=require(_0x51d4('0x1'));var moment=require('moment');var BPromise=require(_0x51d4('0x2'));var rs=require(_0x51d4('0x3'));var fs=require('fs');var Redis=require(_0x51d4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x51d4('0x5'));var logger=require(_0x51d4('0x6'))(_0x51d4('0x7'));var config=require(_0x51d4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x51d4('0x9')][_0x51d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e3b3d,_0x4b7056,_0x518b57){return new BPromise(function(_0x22ab3a,_0x1faa05){return client[_0x51d4('0xb')](_0x2e3b3d,_0x518b57)[_0x51d4('0xc')](function(_0x1b714d){logger['info'](_0x51d4('0xd'),_0x4b7056,'request\x20sent');logger[_0x51d4('0xe')](_0x51d4('0xf'),_0x4b7056,_0x51d4('0x10'),JSON['stringify'](_0x1b714d));if(_0x1b714d[_0x51d4('0x11')]){if(_0x1b714d['error']['code']===0x1f4){logger['error'](_0x51d4('0xd'),_0x4b7056,_0x1b714d[_0x51d4('0x11')][_0x51d4('0x12')]);return _0x1faa05(_0x1b714d['error'][_0x51d4('0x12')]);}logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4b7056,_0x1b714d[_0x51d4('0x11')][_0x51d4('0x12')]);return _0x22ab3a(_0x1b714d['error']['message']);}else{logger[_0x51d4('0x13')](_0x51d4('0xd'),_0x4b7056,'request\x20sent');_0x22ab3a(_0x1b714d[_0x51d4('0x14')][_0x51d4('0x12')]);}})[_0x51d4('0x15')](function(_0x4ab376){logger[_0x51d4('0x11')](_0x51d4('0xd'),_0x4b7056,_0x4ab376);_0x1faa05(_0x4ab376);});});}exports['CreateMailQueueReport']=function(_0x20bde6){var _0x177ea8=this;return new Promise(function(_0x25cb39,_0x3c5cff){return db['MailQueueReport'][_0x51d4('0x16')](_0x20bde6[_0x51d4('0x17')],{'raw':_0x20bde6[_0x51d4('0x18')]?_0x20bde6['options'][_0x51d4('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1183cd){logger[_0x51d4('0x13')](_0x51d4('0x1a'),_0x20bde6);logger[_0x51d4('0xe')](_0x51d4('0x1a'),_0x20bde6,JSON['stringify'](_0x1183cd));_0x25cb39(_0x1183cd);})[_0x51d4('0x15')](function(_0x5c6310){logger['error'](_0x51d4('0x1a'),_0x5c6310['message'],_0x20bde6);_0x3c5cff(_0x177ea8[_0x51d4('0x11')](0x1f4,_0x5c6310[_0x51d4('0x12')]));});});};exports[_0x51d4('0x1b')]=function(_0x3efa2c){var _0x5456be=this;return new Promise(function(_0x46e0b2,_0x4b3ac2){return db['MailQueueReport'][_0x51d4('0x1c')](_0x3efa2c[_0x51d4('0x17')],{'raw':_0x3efa2c[_0x51d4('0x18')]?_0x3efa2c[_0x51d4('0x18')][_0x51d4('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3efa2c[_0x51d4('0x18')]?_0x3efa2c[_0x51d4('0x18')][_0x51d4('0x1d')]||null:null,'attributes':_0x3efa2c[_0x51d4('0x18')]?_0x3efa2c['options'][_0x51d4('0x1e')]||null:null,'limit':_0x3efa2c[_0x51d4('0x18')]?_0x3efa2c[_0x51d4('0x18')][_0x51d4('0x1f')]||null:null})[_0x51d4('0xc')](function(_0x440ae4){logger[_0x51d4('0x13')](_0x51d4('0x1b'),_0x3efa2c);logger[_0x51d4('0xe')](_0x51d4('0x1b'),_0x3efa2c,JSON[_0x51d4('0x20')](_0x440ae4));_0x46e0b2(_0x440ae4);})[_0x51d4('0x15')](function(_0x16ece2){logger[_0x51d4('0x11')]('UpdateMailQueueReport',_0x16ece2[_0x51d4('0x12')],_0x3efa2c);_0x4b3ac2(_0x5456be[_0x51d4('0x11')](0x1f4,_0x16ece2[_0x51d4('0x12')]));});});}; \ No newline at end of file +var _0x0725=['options','attributes','limit','UpdateMailQueueReport','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','create','body','raw','then','CreateMailQueueReport','debug','update'];(function(_0x73c6fc,_0x30d6b5){var _0x5eff99=function(_0x3411de){while(--_0x3411de){_0x73c6fc['push'](_0x73c6fc['shift']());}};_0x5eff99(++_0x30d6b5);}(_0x0725,0x11b));var _0x5072=function(_0x3ceefe,_0x3bbc42){_0x3ceefe=_0x3ceefe-0x0;var _0x1997cd=_0x0725[_0x3ceefe];return _0x1997cd;};'use strict';var _=require('lodash');var util=require(_0x5072('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5072('0x1'));var db=require(_0x5072('0x2'))['db'];var utils=require(_0x5072('0x3'));var logger=require(_0x5072('0x4'))(_0x5072('0x5'));var config=require(_0x5072('0x6'));var jayson=require(_0x5072('0x7'));var client=jayson[_0x5072('0x8')][_0x5072('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d3b08,_0x3376cc,_0x2551e2){return new BPromise(function(_0x8f7cb0,_0x3c4541){return client[_0x5072('0xa')](_0x5d3b08,_0x2551e2)['then'](function(_0x38a0a1){logger[_0x5072('0xb')](_0x5072('0xc'),_0x3376cc,_0x5072('0xd'));logger['debug'](_0x5072('0xe'),_0x3376cc,_0x5072('0xd'),JSON[_0x5072('0xf')](_0x38a0a1));if(_0x38a0a1[_0x5072('0x10')]){if(_0x38a0a1['error'][_0x5072('0x11')]===0x1f4){logger[_0x5072('0x10')]('MailQueueReport,\x20%s,\x20%s',_0x3376cc,_0x38a0a1[_0x5072('0x10')][_0x5072('0x12')]);return _0x3c4541(_0x38a0a1[_0x5072('0x10')][_0x5072('0x12')]);}logger[_0x5072('0x10')]('MailQueueReport,\x20%s,\x20%s',_0x3376cc,_0x38a0a1['error'][_0x5072('0x12')]);return _0x8f7cb0(_0x38a0a1[_0x5072('0x10')][_0x5072('0x12')]);}else{logger[_0x5072('0xb')](_0x5072('0xc'),_0x3376cc,_0x5072('0xd'));_0x8f7cb0(_0x38a0a1['result']['message']);}})[_0x5072('0x13')](function(_0x3f9ce2){logger['error'](_0x5072('0xc'),_0x3376cc,_0x3f9ce2);_0x3c4541(_0x3f9ce2);});});}exports['CreateMailQueueReport']=function(_0x47211c){var _0xdfe979=this;return new Promise(function(_0x40be4c,_0x191924){return db['MailQueueReport'][_0x5072('0x14')](_0x47211c[_0x5072('0x15')],{'raw':_0x47211c['options']?_0x47211c['options'][_0x5072('0x16')]===undefined?!![]:![]:!![]})[_0x5072('0x17')](function(_0x2d81cb){logger[_0x5072('0xb')](_0x5072('0x18'),_0x47211c);logger[_0x5072('0x19')](_0x5072('0x18'),_0x47211c,JSON[_0x5072('0xf')](_0x2d81cb));_0x40be4c(_0x2d81cb);})[_0x5072('0x13')](function(_0x41100c){logger[_0x5072('0x10')](_0x5072('0x18'),_0x41100c[_0x5072('0x12')],_0x47211c);_0x191924(_0xdfe979['error'](0x1f4,_0x41100c['message']));});});};exports['UpdateMailQueueReport']=function(_0x262eca){var _0x3222b1=this;return new Promise(function(_0x5a15c9,_0x1408ce){return db['MailQueueReport'][_0x5072('0x1a')](_0x262eca[_0x5072('0x15')],{'raw':_0x262eca[_0x5072('0x1b')]?_0x262eca[_0x5072('0x1b')][_0x5072('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x262eca['options']?_0x262eca['options']['where']||null:null,'attributes':_0x262eca[_0x5072('0x1b')]?_0x262eca[_0x5072('0x1b')][_0x5072('0x1c')]||null:null,'limit':_0x262eca[_0x5072('0x1b')]?_0x262eca[_0x5072('0x1b')][_0x5072('0x1d')]||null:null})['then'](function(_0x536d89){logger[_0x5072('0xb')](_0x5072('0x1e'),_0x262eca);logger[_0x5072('0x19')]('UpdateMailQueueReport',_0x262eca,JSON[_0x5072('0xf')](_0x536d89));_0x5a15c9(_0x536d89);})[_0x5072('0x13')](function(_0x24558){logger['error'](_0x5072('0x1e'),_0x24558[_0x5072('0x12')],_0x262eca);_0x1408ce(_0x3222b1[_0x5072('0x10')](0x1f4,_0x24558[_0x5072('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 68007ba..994209f 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 _0x4c60=['path','connect-timeout','Router','multer','util'];(function(_0x26fc81,_0x57fc19){var _0x9feece=function(_0x4344c3){while(--_0x4344c3){_0x26fc81['push'](_0x26fc81['shift']());}};_0x9feece(++_0x57fc19);}(_0x4c60,0xc1));var _0x04c6=function(_0x18046c,_0x514136){_0x18046c=_0x18046c-0x0;var _0x4b890a=_0x4c60[_0x18046c];return _0x4b890a;};'use strict';var multer=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var path=require(_0x04c6('0x2'));var timeout=require(_0x04c6('0x3'));var express=require('express');var router=express[_0x04c6('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module['exports']=router; \ No newline at end of file +var _0x0f80=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','exports'];(function(_0x4cdcdc,_0x34eac7){var _0x4704ce=function(_0x1de4ed){while(--_0x1de4ed){_0x4cdcdc['push'](_0x4cdcdc['shift']());}};_0x4704ce(++_0x34eac7);}(_0x0f80,0x108));var _0x00f8=function(_0x33c187,_0x1ca6c4){_0x33c187=_0x33c187-0x0;var _0x579b6e=_0x0f80[_0x33c187];return _0x579b6e;};'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 diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index b0de9e7..cb45061 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 _0x9861=['INTEGER','INBOX','sequelize','STRING','BOOLEAN','username'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9861,0x176));var _0x1986=function(_0x3cfc5c,_0x26aa62){_0x3cfc5c=_0x3cfc5c-0x0;var _0x6108ce=_0x9861[_0x3cfc5c];return _0x6108ce;};'use strict';var Sequelize=require(_0x1986('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x1986('0x1')]},'authentication':{'type':Sequelize[_0x1986('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x1986('0x1')],'unique':_0x1986('0x3')},'password':{'type':Sequelize[_0x1986('0x1')]},'port':{'type':Sequelize[_0x1986('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x1986('0x1')],'defaultValue':_0x1986('0x5')},'connTimeout':{'type':Sequelize[_0x1986('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x1986('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x1986('0x1')]}}; \ No newline at end of file +var _0xe130=['INTEGER','sequelize','exports','STRING','BOOLEAN','username','INBOX'];(function(_0x280d75,_0xb2569c){var _0x17dd1a=function(_0x257dfe){while(--_0x257dfe){_0x280d75['push'](_0x280d75['shift']());}};_0x17dd1a(++_0xb2569c);}(_0xe130,0x127));var _0x0e13=function(_0x285c0c,_0x91049){_0x285c0c=_0x285c0c-0x0;var _0x49cfc2=_0xe130[_0x285c0c];return _0x49cfc2;};'use strict';var Sequelize=require(_0x0e13('0x0'));module[_0x0e13('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x0e13('0x2')]},'authentication':{'type':Sequelize[_0x0e13('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x0e13('0x2')],'unique':_0x0e13('0x4')},'password':{'type':Sequelize[_0x0e13('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x0e13('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x0e13('0x2')],'defaultValue':_0x0e13('0x5')},'connTimeout':{'type':Sequelize[_0x0e13('0x6')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x0e13('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 639f3de..62e7612 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 _0x1335=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','mail_servers_in','lodash'];(function(_0x1c0bbb,_0xcfc371){var _0x23d01e=function(_0x4b0ff){while(--_0x4b0ff){_0x1c0bbb['push'](_0x1c0bbb['shift']());}};_0x23d01e(++_0xcfc371);}(_0x1335,0xe6));var _0x5133=function(_0x3adc36,_0x10d713){_0x3adc36=_0x3adc36-0x0;var _0x210c10=_0x1335[_0x3adc36];return _0x210c10;};'use strict';var _=require(_0x5133('0x0'));var util=require(_0x5133('0x1'));var logger=require(_0x5133('0x2'))(_0x5133('0x3'));var moment=require('moment');var BPromise=require(_0x5133('0x4'));var rp=require(_0x5133('0x5'));var fs=require('fs');var path=require(_0x5133('0x6'));var rimraf=require(_0x5133('0x7'));var config=require(_0x5133('0x8'));var attributes=require(_0x5133('0x9'));module['exports']=function(_0xfca030,_0x2e0635){return _0xfca030['define']('MailServerIn',attributes,{'tableName':_0x5133('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeae7=['bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','util','../../config/logger','api'];(function(_0x24f76a,_0x56246e){var _0x10c3ff=function(_0x249a98){while(--_0x249a98){_0x24f76a['push'](_0x24f76a['shift']());}};_0x10c3ff(++_0x56246e);}(_0xeae7,0x1a1));var _0x7eae=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0xeae7[_0x26b8b5];return _0x2150a9;};'use strict';var _=require('lodash');var util=require(_0x7eae('0x0'));var logger=require(_0x7eae('0x1'))(_0x7eae('0x2'));var moment=require('moment');var BPromise=require(_0x7eae('0x3'));var rp=require(_0x7eae('0x4'));var fs=require('fs');var path=require(_0x7eae('0x5'));var rimraf=require(_0x7eae('0x6'));var config=require(_0x7eae('0x7'));var attributes=require(_0x7eae('0x8'));module[_0x7eae('0x9')]=function(_0x4d8a11,_0x5b33bd){return _0x4d8a11[_0x7eae('0xa')](_0x7eae('0xb'),attributes,{'tableName':'mail_servers_in','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 958935e..af23d20 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 _0x3ea9=['MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','MailServerIn,\x20%s,\x20%s','message','info','result','catch','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','GetMailServerIn','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','request\x20sent','debug'];(function(_0x114d91,_0x1a2bc1){var _0x5d0ae7=function(_0x5e812f){while(--_0x5e812f){_0x114d91['push'](_0x114d91['shift']());}};_0x5d0ae7(++_0x1a2bc1);}(_0x3ea9,0x1c0));var _0x93ea=function(_0x4045cc,_0x6cafef){_0x4045cc=_0x4045cc-0x0;var _0x18e6c4=_0x3ea9[_0x4045cc];return _0x18e6c4;};'use strict';var _=require(_0x93ea('0x0'));var util=require(_0x93ea('0x1'));var moment=require('moment');var BPromise=require(_0x93ea('0x2'));var rs=require(_0x93ea('0x3'));var fs=require('fs');var Redis=require(_0x93ea('0x4'));var db=require(_0x93ea('0x5'))['db'];var utils=require(_0x93ea('0x6'));var logger=require(_0x93ea('0x7'))(_0x93ea('0x8'));var config=require(_0x93ea('0x9'));var jayson=require(_0x93ea('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x27c288,_0x407528,_0x4e1aeb){return new BPromise(function(_0x12f710,_0x43e81b){return client['request'](_0x27c288,_0x4e1aeb)[_0x93ea('0xb')](function(_0x5d1d03){logger['info']('MailServerIn,\x20%s,\x20%s',_0x407528,_0x93ea('0xc'));logger[_0x93ea('0xd')](_0x93ea('0xe'),_0x407528,'request\x20sent',JSON[_0x93ea('0xf')](_0x5d1d03));if(_0x5d1d03['error']){if(_0x5d1d03[_0x93ea('0x10')]['code']===0x1f4){logger['error'](_0x93ea('0x11'),_0x407528,_0x5d1d03['error'][_0x93ea('0x12')]);return _0x43e81b(_0x5d1d03[_0x93ea('0x10')][_0x93ea('0x12')]);}logger['error'](_0x93ea('0x11'),_0x407528,_0x5d1d03[_0x93ea('0x10')][_0x93ea('0x12')]);return _0x12f710(_0x5d1d03[_0x93ea('0x10')][_0x93ea('0x12')]);}else{logger[_0x93ea('0x13')](_0x93ea('0x11'),_0x407528,_0x93ea('0xc'));_0x12f710(_0x5d1d03[_0x93ea('0x14')][_0x93ea('0x12')]);}})[_0x93ea('0x15')](function(_0x469b19){logger[_0x93ea('0x10')]('MailServerIn,\x20%s,\x20%s',_0x407528,_0x469b19);_0x43e81b(_0x469b19);});});}exports['GetMailServerIn']=function(_0x1cd676){var _0x12e35f=this;return new Promise(function(_0xf7b389,_0x3b336f){return db[_0x93ea('0x16')][_0x93ea('0x17')]({'raw':_0x1cd676[_0x93ea('0x18')]?_0x1cd676[_0x93ea('0x18')][_0x93ea('0x19')]===undefined?!![]:![]:!![],'where':_0x1cd676[_0x93ea('0x18')]?_0x1cd676[_0x93ea('0x18')][_0x93ea('0x1a')]||null:null,'attributes':_0x1cd676[_0x93ea('0x18')]?_0x1cd676[_0x93ea('0x18')][_0x93ea('0x1b')]||null:null,'limit':_0x1cd676['options']?_0x1cd676[_0x93ea('0x18')][_0x93ea('0x1c')]||null:null,'include':_0x1cd676[_0x93ea('0x18')]?_0x1cd676[_0x93ea('0x18')][_0x93ea('0x1d')]?_[_0x93ea('0x1e')](_0x1cd676[_0x93ea('0x18')][_0x93ea('0x1d')],function(_0x27c1f0){return{'model':db[_0x27c1f0[_0x93ea('0x1f')]],'as':_0x27c1f0['as'],'attributes':_0x27c1f0[_0x93ea('0x1b')],'include':_0x27c1f0[_0x93ea('0x1d')]?_[_0x93ea('0x1e')](_0x27c1f0[_0x93ea('0x1d')],function(_0xde9ea3){return{'model':db[_0xde9ea3[_0x93ea('0x1f')]],'as':_0xde9ea3['as'],'attributes':_0xde9ea3[_0x93ea('0x1b')],'include':_0xde9ea3[_0x93ea('0x1d')]?_[_0x93ea('0x1e')](_0xde9ea3[_0x93ea('0x1d')],function(_0x1ac17e){return{'model':db[_0x1ac17e[_0x93ea('0x1f')]],'as':_0x1ac17e['as'],'attributes':_0x1ac17e[_0x93ea('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x93ea('0xb')](function(_0xb5712c){logger[_0x93ea('0x13')](_0x93ea('0x20'),_0x1cd676);logger[_0x93ea('0xd')](_0x93ea('0x20'),_0x1cd676,JSON[_0x93ea('0xf')](_0xb5712c));_0xf7b389(_0xb5712c);})[_0x93ea('0x15')](function(_0x2a54f0){logger[_0x93ea('0x10')]('GetMailServerIn',_0x2a54f0[_0x93ea('0x12')],_0x1cd676);_0x3b336f(_0x12e35f[_0x93ea('0x10')](0x1f4,_0x2a54f0[_0x93ea('0x12')]));});});}; \ No newline at end of file +var _0xb6b8=['error','code','MailServerIn,\x20%s,\x20%s','message','request\x20sent','result','GetMailServerIn','findAll','options','raw','where','limit','include','map','model','attributes','stringify','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','debug'];(function(_0x82140,_0x3a9d87){var _0x2b15a6=function(_0x2b565e){while(--_0x2b565e){_0x82140['push'](_0x82140['shift']());}};_0x2b15a6(++_0x3a9d87);}(_0xb6b8,0xb2));var _0x8b6b=function(_0x3e279c,_0x31b5b5){_0x3e279c=_0x3e279c-0x0;var _0x483616=_0xb6b8[_0x3e279c];return _0x483616;};'use strict';var _=require(_0x8b6b('0x0'));var util=require(_0x8b6b('0x1'));var moment=require('moment');var BPromise=require(_0x8b6b('0x2'));var rs=require(_0x8b6b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8b6b('0x4'))['db'];var utils=require(_0x8b6b('0x5'));var logger=require(_0x8b6b('0x6'))('rpc');var config=require(_0x8b6b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8b6b('0x8')][_0x8b6b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x120212,_0x3ce44a,_0x36b630){return new BPromise(function(_0x466484,_0x481c3b){return client[_0x8b6b('0xa')](_0x120212,_0x36b630)[_0x8b6b('0xb')](function(_0x51ab97){logger[_0x8b6b('0xc')]('MailServerIn,\x20%s,\x20%s',_0x3ce44a,'request\x20sent');logger[_0x8b6b('0xd')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x3ce44a,'request\x20sent',JSON['stringify'](_0x51ab97));if(_0x51ab97['error']){if(_0x51ab97[_0x8b6b('0xe')][_0x8b6b('0xf')]===0x1f4){logger['error'](_0x8b6b('0x10'),_0x3ce44a,_0x51ab97['error'][_0x8b6b('0x11')]);return _0x481c3b(_0x51ab97[_0x8b6b('0xe')][_0x8b6b('0x11')]);}logger[_0x8b6b('0xe')](_0x8b6b('0x10'),_0x3ce44a,_0x51ab97[_0x8b6b('0xe')][_0x8b6b('0x11')]);return _0x466484(_0x51ab97[_0x8b6b('0xe')][_0x8b6b('0x11')]);}else{logger['info'](_0x8b6b('0x10'),_0x3ce44a,_0x8b6b('0x12'));_0x466484(_0x51ab97[_0x8b6b('0x13')][_0x8b6b('0x11')]);}})['catch'](function(_0x4e7a0e){logger[_0x8b6b('0xe')](_0x8b6b('0x10'),_0x3ce44a,_0x4e7a0e);_0x481c3b(_0x4e7a0e);});});}exports[_0x8b6b('0x14')]=function(_0x1a6757){var _0x4904a3=this;return new Promise(function(_0x247f23,_0x391a37){return db['MailServerIn'][_0x8b6b('0x15')]({'raw':_0x1a6757['options']?_0x1a6757[_0x8b6b('0x16')][_0x8b6b('0x17')]===undefined?!![]:![]:!![],'where':_0x1a6757[_0x8b6b('0x16')]?_0x1a6757[_0x8b6b('0x16')][_0x8b6b('0x18')]||null:null,'attributes':_0x1a6757[_0x8b6b('0x16')]?_0x1a6757[_0x8b6b('0x16')]['attributes']||null:null,'limit':_0x1a6757[_0x8b6b('0x16')]?_0x1a6757[_0x8b6b('0x16')][_0x8b6b('0x19')]||null:null,'include':_0x1a6757[_0x8b6b('0x16')]?_0x1a6757[_0x8b6b('0x16')][_0x8b6b('0x1a')]?_[_0x8b6b('0x1b')](_0x1a6757[_0x8b6b('0x16')]['include'],function(_0x1d0084){return{'model':db[_0x1d0084[_0x8b6b('0x1c')]],'as':_0x1d0084['as'],'attributes':_0x1d0084[_0x8b6b('0x1d')],'include':_0x1d0084[_0x8b6b('0x1a')]?_['map'](_0x1d0084['include'],function(_0x5b9b6a){return{'model':db[_0x5b9b6a[_0x8b6b('0x1c')]],'as':_0x5b9b6a['as'],'attributes':_0x5b9b6a[_0x8b6b('0x1d')],'include':_0x5b9b6a[_0x8b6b('0x1a')]?_[_0x8b6b('0x1b')](_0x5b9b6a[_0x8b6b('0x1a')],function(_0x596cce){return{'model':db[_0x596cce[_0x8b6b('0x1c')]],'as':_0x596cce['as'],'attributes':_0x596cce['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x187544){logger[_0x8b6b('0xc')]('GetMailServerIn',_0x1a6757);logger[_0x8b6b('0xd')]('GetMailServerIn',_0x1a6757,JSON[_0x8b6b('0x1e')](_0x187544));_0x247f23(_0x187544);})[_0x8b6b('0x1f')](function(_0x4430b3){logger[_0x8b6b('0xe')](_0x8b6b('0x14'),_0x4430b3['message'],_0x1a6757);_0x391a37(_0x4904a3['error'](0x1f4,_0x4430b3['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index b655439..13b17bf 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 _0x8807=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','/:id','put','update','delete','destroy','exports','multer','util'];(function(_0x578b3b,_0x40fe5b){var _0x3a1b18=function(_0x40103e){while(--_0x40103e){_0x578b3b['push'](_0x578b3b['shift']());}};_0x3a1b18(++_0x40fe5b);}(_0x8807,0x148));var _0x7880=function(_0x1b7ad0,_0x25c5c3){_0x1b7ad0=_0x1b7ad0-0x0;var _0x424a5a=_0x8807[_0x1b7ad0];return _0x424a5a;};'use strict';var multer=require(_0x7880('0x0'));var util=require(_0x7880('0x1'));var path=require('path');var timeout=require(_0x7880('0x2'));var express=require(_0x7880('0x3'));var router=express['Router']();var auth=require(_0x7880('0x4'));var interaction=require(_0x7880('0x5'));var config=require('../../config/environment');var controller=require(_0x7880('0x6'));router[_0x7880('0x7')]('/',auth[_0x7880('0x8')](),controller['index']);router[_0x7880('0x7')](_0x7880('0x9'),auth[_0x7880('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x7880('0xa')](_0x7880('0x9'),auth[_0x7880('0x8')](),controller[_0x7880('0xb')]);router[_0x7880('0xc')](_0x7880('0x9'),auth[_0x7880('0x8')](),controller[_0x7880('0xd')]);module[_0x7880('0xe')]=router; \ No newline at end of file +var _0x6074=['put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','isAuthenticated','get','/:id','show','post','create'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6074,0x64));var _0x4607=function(_0x45806b,_0x53eeae){_0x45806b=_0x45806b-0x0;var _0x3e228e=_0x6074[_0x45806b];return _0x3e228e;};'use strict';var multer=require('multer');var util=require(_0x4607('0x0'));var path=require('path');var timeout=require(_0x4607('0x1'));var express=require(_0x4607('0x2'));var router=express[_0x4607('0x3')]();var auth=require(_0x4607('0x4'));var interaction=require(_0x4607('0x5'));var config=require(_0x4607('0x6'));var controller=require(_0x4607('0x7'));router['get']('/',auth[_0x4607('0x8')](),controller['index']);router[_0x4607('0x9')](_0x4607('0xa'),auth[_0x4607('0x8')](),controller[_0x4607('0xb')]);router[_0x4607('0xc')]('/',auth[_0x4607('0x8')](),controller[_0x4607('0xd')]);router[_0x4607('0xe')]('/:id',auth[_0x4607('0x8')](),controller[_0x4607('0xf')]);router[_0x4607('0x10')](_0x4607('0xa'),auth[_0x4607('0x8')](),controller[_0x4607('0x11')]);module[_0x4607('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 2252b05..a0c8d5e 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 _0x48c4=['STRING','BOOLEAN'];(function(_0x47c2f9,_0x4d8900){var _0x35096f=function(_0x3e51a8){while(--_0x3e51a8){_0x47c2f9['push'](_0x47c2f9['shift']());}};_0x35096f(++_0x4d8900);}(_0x48c4,0x10a));var _0x448c=function(_0x110b1a,_0x1ed6f6){_0x110b1a=_0x110b1a-0x0;var _0x5b5add=_0x48c4[_0x110b1a];return _0x5b5add;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x448c('0x0')]},'user':{'type':Sequelize[_0x448c('0x0')]},'pass':{'type':Sequelize[_0x448c('0x0')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x448c('0x1')],'defaultValue':![]},'service':{'type':Sequelize[_0x448c('0x0')]},'authentication':{'type':Sequelize[_0x448c('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0x798a=['STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0x798a,0xd3));var _0xa798=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x798a[_0x2070da];return _0x4f9fe1;};'use strict';var Sequelize=require(_0xa798('0x0'));module['exports']={'description':{'type':Sequelize[_0xa798('0x1')]},'host':{'type':Sequelize[_0xa798('0x1')]},'user':{'type':Sequelize[_0xa798('0x1')]},'pass':{'type':Sequelize[_0xa798('0x1')]},'port':{'type':Sequelize[_0xa798('0x2')]},'secure':{'type':Sequelize[_0xa798('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xa798('0x1')]},'authentication':{'type':Sequelize[_0xa798('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 3c43b3b..38a8fe0 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 _0x8d62=['filters','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','rows','show','params','fields','catch','create','body','destroy','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','end','error','stack','name','send','index','MailServerOut','rawAttributes','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where'];(function(_0x414f37,_0x1d6e30){var _0x361e8a=function(_0x5683de){while(--_0x5683de){_0x414f37['push'](_0x414f37['shift']());}};_0x361e8a(++_0x1d6e30);}(_0x8d62,0xf8));var _0x28d6=function(_0x23b96d,_0x5d90a6){_0x23b96d=_0x23b96d-0x0;var _0x386b80=_0x8d62[_0x23b96d];return _0x386b80;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x28d6('0x0'));var rimraf=require(_0x28d6('0x1'));var zipdir=require(_0x28d6('0x2'));var jsonpatch=require(_0x28d6('0x3'));var rp=require(_0x28d6('0x4'));var moment=require(_0x28d6('0x5'));var BPromise=require(_0x28d6('0x6'));var Mustache=require(_0x28d6('0x7'));var util=require(_0x28d6('0x8'));var path=require(_0x28d6('0x9'));var sox=require(_0x28d6('0xa'));var csv=require(_0x28d6('0xb'));var ejs=require(_0x28d6('0xc'));var fs=require('fs');var _=require(_0x28d6('0xd'));var squel=require('squel');var crypto=require(_0x28d6('0xe'));var jsforce=require(_0x28d6('0xf'));var deskjs=require(_0x28d6('0x10'));var toCsv=require('to-csv');var querystring=require(_0x28d6('0x11'));var Papa=require('papaparse');var Redis=require(_0x28d6('0x12'));var authService=require(_0x28d6('0x13'));var qs=require(_0x28d6('0x14'));var hardwareService=require(_0x28d6('0x15'));var logger=require(_0x28d6('0x16'))('api');var utils=require(_0x28d6('0x17'));var config=require(_0x28d6('0x18'));var db=require(_0x28d6('0x19'))['db'];function respondWithStatusCode(_0x4c9840,_0x291518){_0x291518=_0x291518||0xcc;return function(_0x240839){if(_0x240839){return _0x4c9840[_0x28d6('0x1a')](_0x291518);}return _0x4c9840[_0x28d6('0x1b')](_0x291518)['end']();};}function respondWithResult(_0x2ec139,_0x2e2ca8){_0x2e2ca8=_0x2e2ca8||0xc8;return function(_0x33ba38){if(_0x33ba38){return _0x2ec139['status'](_0x2e2ca8)[_0x28d6('0x1c')](_0x33ba38);}};}function respondWithFilteredResult(_0x53f101,_0x19c21d){return function(_0x425ffb){if(_0x425ffb){var _0x4b82e2=_0x425ffb[_0x28d6('0x1d')],_0x1881a8=_0x19c21d[_0x28d6('0x1e')],_0x159d2a=_0x19c21d['offset']+_0x19c21d[_0x28d6('0x1f')],_0x2d5eee;if(_0x159d2a>=_0x4b82e2){_0x159d2a=_0x4b82e2;_0x2d5eee=0xc8;}else{_0x2d5eee=0xce;}_0x53f101['status'](_0x2d5eee);return _0x53f101[_0x28d6('0x20')](_0x28d6('0x21'),_0x1881a8+'-'+_0x159d2a+'/'+_0x4b82e2)[_0x28d6('0x1c')](_0x425ffb);}return null;};}function patchUpdates(_0x2f28b1){return function(_0x50100c){try{jsonpatch[_0x28d6('0x22')](_0x50100c,_0x2f28b1,!![]);}catch(_0x2d521d){return BPromise['reject'](_0x2d521d);}return _0x50100c[_0x28d6('0x23')]();};}function saveUpdates(_0x20f2fd,_0x53d629){return function(_0x26362e){if(_0x26362e){return _0x26362e[_0x28d6('0x24')](_0x20f2fd)[_0x28d6('0x25')](function(_0x252c1d){return _0x252c1d;});}return null;};}function removeEntity(_0x250f6e,_0x3b121a){return function(_0x376a64){if(_0x376a64){return _0x376a64['destroy']()[_0x28d6('0x25')](function(){_0x250f6e['status'](0xcc)[_0x28d6('0x26')]();});}};}function handleEntityNotFound(_0x2288eb,_0x455dd6){return function(_0x3d128b){if(!_0x3d128b){_0x2288eb[_0x28d6('0x1a')](0x194);}return _0x3d128b;};}function handleError(_0x3f7eb9,_0x5ce953){_0x5ce953=_0x5ce953||0x1f4;return function(_0x5c4909){logger[_0x28d6('0x27')](_0x5c4909[_0x28d6('0x28')]);if(_0x5c4909[_0x28d6('0x29')]){delete _0x5c4909[_0x28d6('0x29')];}_0x3f7eb9['status'](_0x5ce953)[_0x28d6('0x2a')](_0x5c4909);};}exports[_0x28d6('0x2b')]=function(_0x2b9862,_0x1a2ba4){var _0x4757b1={},_0x6a76a={},_0x60ded0={'count':0x0,'rows':[]};var _0x20b220=db[_0x28d6('0x2c')][_0x28d6('0x2d')];_0x6a76a[_0x28d6('0x2e')]=_[_0x28d6('0x2f')](_0x20b220);_0x6a76a[_0x28d6('0x30')]=_[_0x28d6('0x2f')](_0x2b9862['query']);_0x6a76a['filters']=_[_0x28d6('0x31')](_0x6a76a[_0x28d6('0x2e')],_0x6a76a[_0x28d6('0x30')]);_0x4757b1[_0x28d6('0x32')]=_[_0x28d6('0x31')](_0x6a76a[_0x28d6('0x2e')],qs['fields'](_0x2b9862[_0x28d6('0x30')]['fields']));_0x4757b1[_0x28d6('0x32')]=_0x4757b1['attributes'][_0x28d6('0x33')]?_0x4757b1[_0x28d6('0x32')]:_0x6a76a[_0x28d6('0x2e')];if(!_0x2b9862[_0x28d6('0x30')][_0x28d6('0x34')]('nolimit')){_0x4757b1['limit']=qs[_0x28d6('0x1f')](_0x2b9862[_0x28d6('0x30')]['limit']);_0x4757b1[_0x28d6('0x1e')]=qs['offset'](_0x2b9862[_0x28d6('0x30')]['offset']);}_0x4757b1[_0x28d6('0x35')]=qs['sort'](_0x2b9862[_0x28d6('0x30')][_0x28d6('0x36')]);_0x4757b1[_0x28d6('0x37')]=qs[_0x28d6('0x38')](_[_0x28d6('0x39')](_0x2b9862[_0x28d6('0x30')],_0x6a76a[_0x28d6('0x38')]));if(_0x2b9862['query'][_0x28d6('0x3a')]){_0x4757b1[_0x28d6('0x37')]=_[_0x28d6('0x3b')](_0x4757b1[_0x28d6('0x37')],{'$or':_['map'](_0x20b220,function(_0x959853){if(_0x959853[_0x28d6('0x3c')][_0x28d6('0x3d')]!==_0x28d6('0x3e')){var _0x4bf8ca={};_0x4bf8ca[_0x959853[_0x28d6('0x3f')]]={'$like':'%'+_0x2b9862[_0x28d6('0x30')][_0x28d6('0x3a')]+'%'};return _0x4bf8ca;}})});}_0x4757b1=_[_0x28d6('0x3b')]({},_0x4757b1,_0x2b9862[_0x28d6('0x40')]);var _0x26f7a8={'where':_0x4757b1[_0x28d6('0x37')]};return db[_0x28d6('0x2c')][_0x28d6('0x1d')](_0x26f7a8)[_0x28d6('0x25')](function(_0x27eb6b){_0x60ded0[_0x28d6('0x1d')]=_0x27eb6b;if(_0x2b9862[_0x28d6('0x30')][_0x28d6('0x41')]){_0x4757b1[_0x28d6('0x42')]=[{'all':!![]}];}return db[_0x28d6('0x2c')]['findAll'](_0x4757b1);})['then'](function(_0x4ea872){_0x60ded0[_0x28d6('0x43')]=_0x4ea872;return _0x60ded0;})['then'](respondWithFilteredResult(_0x1a2ba4,_0x4757b1))['catch'](handleError(_0x1a2ba4,null));};exports[_0x28d6('0x44')]=function(_0x4ea383,_0x213bf9){var _0x3f551a={'raw':!![],'where':{'id':_0x4ea383[_0x28d6('0x45')]['id']}},_0x53362d={};_0x53362d[_0x28d6('0x2e')]=_[_0x28d6('0x2f')](db[_0x28d6('0x2c')][_0x28d6('0x2d')]);_0x53362d[_0x28d6('0x30')]=_[_0x28d6('0x2f')](_0x4ea383[_0x28d6('0x30')]);_0x53362d['filters']=_[_0x28d6('0x31')](_0x53362d[_0x28d6('0x2e')],_0x53362d['query']);_0x3f551a[_0x28d6('0x32')]=_[_0x28d6('0x31')](_0x53362d[_0x28d6('0x2e')],qs['fields'](_0x4ea383[_0x28d6('0x30')][_0x28d6('0x46')]));_0x3f551a[_0x28d6('0x32')]=_0x3f551a[_0x28d6('0x32')]['length']?_0x3f551a[_0x28d6('0x32')]:_0x53362d[_0x28d6('0x2e')];if(_0x4ea383[_0x28d6('0x30')]['includeAll']){_0x3f551a[_0x28d6('0x42')]=[{'all':!![]}];}_0x3f551a=_[_0x28d6('0x3b')]({},_0x3f551a,_0x4ea383[_0x28d6('0x40')]);return db[_0x28d6('0x2c')]['find'](_0x3f551a)[_0x28d6('0x25')](handleEntityNotFound(_0x213bf9,null))[_0x28d6('0x25')](respondWithResult(_0x213bf9,null))[_0x28d6('0x47')](handleError(_0x213bf9,null));};exports[_0x28d6('0x48')]=function(_0x3ec100,_0x594637){return db[_0x28d6('0x2c')][_0x28d6('0x48')](_0x3ec100[_0x28d6('0x49')],{})[_0x28d6('0x25')](respondWithResult(_0x594637,0xc9))[_0x28d6('0x47')](handleError(_0x594637,null));};exports[_0x28d6('0x24')]=function(_0x10a52,_0x6876a5){if(_0x10a52[_0x28d6('0x49')]['id']){delete _0x10a52[_0x28d6('0x49')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x10a52[_0x28d6('0x45')]['id']}})['then'](handleEntityNotFound(_0x6876a5,null))['then'](saveUpdates(_0x10a52['body'],null))[_0x28d6('0x25')](respondWithResult(_0x6876a5,null))['catch'](handleError(_0x6876a5,null));};exports[_0x28d6('0x4a')]=function(_0x543f58,_0x1cfe1f){return db[_0x28d6('0x2c')][_0x28d6('0x4b')]({'where':{'id':_0x543f58['params']['id']}})['then'](handleEntityNotFound(_0x1cfe1f,null))['then'](removeEntity(_0x1cfe1f,null))[_0x28d6('0x47')](handleError(_0x1cfe1f,null));}; \ No newline at end of file +var _0xac41=['bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','MailServerOut','rawAttributes','model','keys','query','attributes','fields','nolimit','order','sort','filters','pick','where','merge','map','type','key','field','filter','options','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x1090f8,_0x44f72a){var _0x33ee04=function(_0x58c416){while(--_0x58c416){_0x1090f8['push'](_0x1090f8['shift']());}};_0x33ee04(++_0x44f72a);}(_0xac41,0xdd));var _0x1ac4=function(_0x3842de,_0x52ee06){_0x3842de=_0x3842de-0x0;var _0x5d9538=_0xac41[_0x3842de];return _0x5d9538;};'use strict';var pdf=require(_0x1ac4('0x0'));var emlformat=require(_0x1ac4('0x1'));var rimraf=require(_0x1ac4('0x2'));var zipdir=require(_0x1ac4('0x3'));var jsonpatch=require(_0x1ac4('0x4'));var rp=require(_0x1ac4('0x5'));var moment=require(_0x1ac4('0x6'));var BPromise=require(_0x1ac4('0x7'));var Mustache=require('mustache');var util=require(_0x1ac4('0x8'));var path=require(_0x1ac4('0x9'));var sox=require(_0x1ac4('0xa'));var csv=require(_0x1ac4('0xb'));var ejs=require(_0x1ac4('0xc'));var fs=require('fs');var _=require(_0x1ac4('0xd'));var squel=require(_0x1ac4('0xe'));var crypto=require(_0x1ac4('0xf'));var jsforce=require(_0x1ac4('0x10'));var deskjs=require(_0x1ac4('0x11'));var toCsv=require(_0x1ac4('0xb'));var querystring=require(_0x1ac4('0x12'));var Papa=require(_0x1ac4('0x13'));var Redis=require(_0x1ac4('0x14'));var authService=require(_0x1ac4('0x15'));var qs=require(_0x1ac4('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ac4('0x17'))('api');var utils=require(_0x1ac4('0x18'));var config=require(_0x1ac4('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x395f61,_0x21b357){_0x21b357=_0x21b357||0xcc;return function(_0x4bc8d8){if(_0x4bc8d8){return _0x395f61[_0x1ac4('0x1a')](_0x21b357);}return _0x395f61['status'](_0x21b357)['end']();};}function respondWithResult(_0x527a60,_0x2b4a2e){_0x2b4a2e=_0x2b4a2e||0xc8;return function(_0x288b4e){if(_0x288b4e){return _0x527a60[_0x1ac4('0x1b')](_0x2b4a2e)[_0x1ac4('0x1c')](_0x288b4e);}};}function respondWithFilteredResult(_0x38f49e,_0x1f1dd4){return function(_0x5038e3){if(_0x5038e3){var _0x531769=_0x5038e3['count'],_0x160b86=_0x1f1dd4[_0x1ac4('0x1d')],_0x427684=_0x1f1dd4[_0x1ac4('0x1d')]+_0x1f1dd4[_0x1ac4('0x1e')],_0x387cbb;if(_0x427684>=_0x531769){_0x427684=_0x531769;_0x387cbb=0xc8;}else{_0x387cbb=0xce;}_0x38f49e[_0x1ac4('0x1b')](_0x387cbb);return _0x38f49e[_0x1ac4('0x1f')](_0x1ac4('0x20'),_0x160b86+'-'+_0x427684+'/'+_0x531769)[_0x1ac4('0x1c')](_0x5038e3);}return null;};}function patchUpdates(_0x5930ea){return function(_0x535891){try{jsonpatch[_0x1ac4('0x21')](_0x535891,_0x5930ea,!![]);}catch(_0x1dc9b3){return BPromise[_0x1ac4('0x22')](_0x1dc9b3);}return _0x535891[_0x1ac4('0x23')]();};}function saveUpdates(_0x3bd3f7,_0x5c7c4a){return function(_0x4b31c8){if(_0x4b31c8){return _0x4b31c8[_0x1ac4('0x24')](_0x3bd3f7)[_0x1ac4('0x25')](function(_0x479110){return _0x479110;});}return null;};}function removeEntity(_0x7113bf,_0x18d2b9){return function(_0x28a2d7){if(_0x28a2d7){return _0x28a2d7[_0x1ac4('0x26')]()['then'](function(){_0x7113bf[_0x1ac4('0x1b')](0xcc)[_0x1ac4('0x27')]();});}};}function handleEntityNotFound(_0x51901a,_0x1b5490){return function(_0x5e58b4){if(!_0x5e58b4){_0x51901a[_0x1ac4('0x1a')](0x194);}return _0x5e58b4;};}function handleError(_0x3026a8,_0x2d4c51){_0x2d4c51=_0x2d4c51||0x1f4;return function(_0x302b20){logger['error'](_0x302b20[_0x1ac4('0x28')]);if(_0x302b20['name']){delete _0x302b20[_0x1ac4('0x29')];}_0x3026a8[_0x1ac4('0x1b')](_0x2d4c51)[_0x1ac4('0x2a')](_0x302b20);};}exports[_0x1ac4('0x2b')]=function(_0x385885,_0x13a85d){var _0x1fc03a={},_0x2ef654={},_0x21a10e={'count':0x0,'rows':[]};var _0x291a00=db[_0x1ac4('0x2c')][_0x1ac4('0x2d')];_0x2ef654[_0x1ac4('0x2e')]=_[_0x1ac4('0x2f')](_0x291a00);_0x2ef654[_0x1ac4('0x30')]=_[_0x1ac4('0x2f')](_0x385885[_0x1ac4('0x30')]);_0x2ef654['filters']=_['intersection'](_0x2ef654['model'],_0x2ef654[_0x1ac4('0x30')]);_0x1fc03a[_0x1ac4('0x31')]=_['intersection'](_0x2ef654[_0x1ac4('0x2e')],qs[_0x1ac4('0x32')](_0x385885[_0x1ac4('0x30')]['fields']));_0x1fc03a[_0x1ac4('0x31')]=_0x1fc03a['attributes']['length']?_0x1fc03a[_0x1ac4('0x31')]:_0x2ef654[_0x1ac4('0x2e')];if(!_0x385885[_0x1ac4('0x30')]['hasOwnProperty'](_0x1ac4('0x33'))){_0x1fc03a[_0x1ac4('0x1e')]=qs[_0x1ac4('0x1e')](_0x385885[_0x1ac4('0x30')][_0x1ac4('0x1e')]);_0x1fc03a['offset']=qs[_0x1ac4('0x1d')](_0x385885[_0x1ac4('0x30')][_0x1ac4('0x1d')]);}_0x1fc03a[_0x1ac4('0x34')]=qs[_0x1ac4('0x35')](_0x385885[_0x1ac4('0x30')][_0x1ac4('0x35')]);_0x1fc03a['where']=qs[_0x1ac4('0x36')](_[_0x1ac4('0x37')](_0x385885['query'],_0x2ef654[_0x1ac4('0x36')]));if(_0x385885[_0x1ac4('0x30')]['filter']){_0x1fc03a[_0x1ac4('0x38')]=_[_0x1ac4('0x39')](_0x1fc03a[_0x1ac4('0x38')],{'$or':_[_0x1ac4('0x3a')](_0x291a00,function(_0x1625f5){if(_0x1625f5[_0x1ac4('0x3b')][_0x1ac4('0x3c')]!=='VIRTUAL'){var _0x2ff7fc={};_0x2ff7fc[_0x1625f5[_0x1ac4('0x3d')]]={'$like':'%'+_0x385885[_0x1ac4('0x30')][_0x1ac4('0x3e')]+'%'};return _0x2ff7fc;}})});}_0x1fc03a=_[_0x1ac4('0x39')]({},_0x1fc03a,_0x385885[_0x1ac4('0x3f')]);var _0x41a9c3={'where':_0x1fc03a['where']};return db['MailServerOut'][_0x1ac4('0x40')](_0x41a9c3)[_0x1ac4('0x25')](function(_0x4cf328){_0x21a10e['count']=_0x4cf328;if(_0x385885['query'][_0x1ac4('0x41')]){_0x1fc03a[_0x1ac4('0x42')]=[{'all':!![]}];}return db[_0x1ac4('0x2c')][_0x1ac4('0x43')](_0x1fc03a);})[_0x1ac4('0x25')](function(_0x41af65){_0x21a10e[_0x1ac4('0x44')]=_0x41af65;return _0x21a10e;})[_0x1ac4('0x25')](respondWithFilteredResult(_0x13a85d,_0x1fc03a))[_0x1ac4('0x45')](handleError(_0x13a85d,null));};exports[_0x1ac4('0x46')]=function(_0x21ccb9,_0x16058f){var _0x65460d={'raw':!![],'where':{'id':_0x21ccb9[_0x1ac4('0x47')]['id']}},_0x4ba469={};_0x4ba469[_0x1ac4('0x2e')]=_[_0x1ac4('0x2f')](db[_0x1ac4('0x2c')][_0x1ac4('0x2d')]);_0x4ba469['query']=_['keys'](_0x21ccb9[_0x1ac4('0x30')]);_0x4ba469[_0x1ac4('0x36')]=_['intersection'](_0x4ba469[_0x1ac4('0x2e')],_0x4ba469['query']);_0x65460d[_0x1ac4('0x31')]=_['intersection'](_0x4ba469[_0x1ac4('0x2e')],qs[_0x1ac4('0x32')](_0x21ccb9[_0x1ac4('0x30')][_0x1ac4('0x32')]));_0x65460d[_0x1ac4('0x31')]=_0x65460d[_0x1ac4('0x31')][_0x1ac4('0x48')]?_0x65460d[_0x1ac4('0x31')]:_0x4ba469[_0x1ac4('0x2e')];if(_0x21ccb9['query'][_0x1ac4('0x41')]){_0x65460d['include']=[{'all':!![]}];}_0x65460d=_[_0x1ac4('0x39')]({},_0x65460d,_0x21ccb9['options']);return db[_0x1ac4('0x2c')][_0x1ac4('0x49')](_0x65460d)[_0x1ac4('0x25')](handleEntityNotFound(_0x16058f,null))[_0x1ac4('0x25')](respondWithResult(_0x16058f,null))[_0x1ac4('0x45')](handleError(_0x16058f,null));};exports['create']=function(_0x483447,_0x45b7d3){return db['MailServerOut'][_0x1ac4('0x4a')](_0x483447[_0x1ac4('0x4b')],{})[_0x1ac4('0x25')](respondWithResult(_0x45b7d3,0xc9))['catch'](handleError(_0x45b7d3,null));};exports[_0x1ac4('0x24')]=function(_0x20d324,_0x1cb8ec){if(_0x20d324[_0x1ac4('0x4b')]['id']){delete _0x20d324[_0x1ac4('0x4b')]['id'];}return db[_0x1ac4('0x2c')][_0x1ac4('0x49')]({'where':{'id':_0x20d324['params']['id']}})[_0x1ac4('0x25')](handleEntityNotFound(_0x1cb8ec,null))['then'](saveUpdates(_0x20d324[_0x1ac4('0x4b')],null))[_0x1ac4('0x25')](respondWithResult(_0x1cb8ec,null))[_0x1ac4('0x45')](handleError(_0x1cb8ec,null));};exports[_0x1ac4('0x26')]=function(_0x2de44a,_0x4e132f){return db[_0x1ac4('0x2c')][_0x1ac4('0x49')]({'where':{'id':_0x2de44a[_0x1ac4('0x47')]['id']}})[_0x1ac4('0x25')](handleEntityNotFound(_0x4e132f,null))['then'](removeEntity(_0x4e132f,null))['catch'](handleError(_0x4e132f,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 567129d..256b8e4 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 _0x0abf=['define','mail_servers_out','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./mailServerOut.attributes','exports'];(function(_0x107bcc,_0x240740){var _0x574d0b=function(_0xf0f3d0){while(--_0xf0f3d0){_0x107bcc['push'](_0x107bcc['shift']());}};_0x574d0b(++_0x240740);}(_0x0abf,0xe8));var _0xf0ab=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x0abf[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var logger=require(_0xf0ab('0x1'))(_0xf0ab('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf0ab('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var attributes=require(_0xf0ab('0x6'));module[_0xf0ab('0x7')]=function(_0x2ab7d6,_0x4d2ea8){return _0x2ab7d6[_0xf0ab('0x8')]('MailServerOut',attributes,{'tableName':_0xf0ab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0972=['util','api','bluebird','request-promise','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','mail_servers_out'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x0972,0x64));var _0x2097=function(_0x2ab754,_0x112af5){_0x2ab754=_0x2ab754-0x0;var _0x160f0f=_0x0972[_0x2ab754];return _0x160f0f;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var logger=require('../../config/logger')(_0x2097('0x1'));var moment=require('moment');var BPromise=require(_0x2097('0x2'));var rp=require(_0x2097('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var attributes=require(_0x2097('0x6'));module[_0x2097('0x7')]=function(_0x2f84d8,_0x11ed13){return _0x2f84d8[_0x2097('0x8')]('MailServerOut',attributes,{'tableName':_0x2097('0x9'),'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 4681e5b..e5f6b8b 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 _0x1917=['catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result'];(function(_0x427690,_0x24cc9e){var _0x3aef71=function(_0x2bfdd0){while(--_0x2bfdd0){_0x427690['push'](_0x427690['shift']());}};_0x3aef71(++_0x24cc9e);}(_0x1917,0xb9));var _0x7191=function(_0x33038e,_0x4cfbfa){_0x33038e=_0x33038e-0x0;var _0x28e6b0=_0x1917[_0x33038e];return _0x28e6b0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7191('0x0'));var BPromise=require(_0x7191('0x1'));var rs=require(_0x7191('0x2'));var fs=require('fs');var Redis=require(_0x7191('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7191('0x4'));var logger=require(_0x7191('0x5'))(_0x7191('0x6'));var config=require(_0x7191('0x7'));var jayson=require(_0x7191('0x8'));var client=jayson[_0x7191('0x9')][_0x7191('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cf1f8,_0xb3a00f,_0x3b5588){return new BPromise(function(_0x56439d,_0x48dfae){return client[_0x7191('0xb')](_0x3cf1f8,_0x3b5588)[_0x7191('0xc')](function(_0x4a4412){logger['info'](_0x7191('0xd'),_0xb3a00f,_0x7191('0xe'));logger[_0x7191('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0xb3a00f,'request\x20sent',JSON[_0x7191('0x10')](_0x4a4412));if(_0x4a4412[_0x7191('0x11')]){if(_0x4a4412[_0x7191('0x11')][_0x7191('0x12')]===0x1f4){logger[_0x7191('0x11')](_0x7191('0xd'),_0xb3a00f,_0x4a4412[_0x7191('0x11')][_0x7191('0x13')]);return _0x48dfae(_0x4a4412[_0x7191('0x11')][_0x7191('0x13')]);}logger[_0x7191('0x11')](_0x7191('0xd'),_0xb3a00f,_0x4a4412[_0x7191('0x11')]['message']);return _0x56439d(_0x4a4412[_0x7191('0x11')]['message']);}else{logger[_0x7191('0x14')](_0x7191('0xd'),_0xb3a00f,'request\x20sent');_0x56439d(_0x4a4412[_0x7191('0x15')]['message']);}})[_0x7191('0x16')](function(_0xe5c663){logger[_0x7191('0x11')](_0x7191('0xd'),_0xb3a00f,_0xe5c663);_0x48dfae(_0xe5c663);});});} \ No newline at end of file +var _0xba6e=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x540e73,_0x2ea1c5){var _0x1dc49c=function(_0x317855){while(--_0x317855){_0x540e73['push'](_0x540e73['shift']());}};_0x1dc49c(++_0x2ea1c5);}(_0xba6e,0xe6));var _0xeba6=function(_0x4163a0,_0x7d7281){_0x4163a0=_0x4163a0-0x0;var _0x5c300d=_0xba6e[_0x4163a0];return _0x5c300d;};'use strict';var _=require(_0xeba6('0x0'));var util=require(_0xeba6('0x1'));var moment=require(_0xeba6('0x2'));var BPromise=require(_0xeba6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeba6('0x4'))['db'];var utils=require(_0xeba6('0x5'));var logger=require(_0xeba6('0x6'))('rpc');var config=require(_0xeba6('0x7'));var jayson=require(_0xeba6('0x8'));var client=jayson[_0xeba6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33d08e,_0x57908f,_0x472e05){return new BPromise(function(_0x59043f,_0x3c3823){return client[_0xeba6('0xa')](_0x33d08e,_0x472e05)['then'](function(_0x1a137e){logger[_0xeba6('0xb')](_0xeba6('0xc'),_0x57908f,_0xeba6('0xd'));logger[_0xeba6('0xe')](_0xeba6('0xf'),_0x57908f,_0xeba6('0xd'),JSON[_0xeba6('0x10')](_0x1a137e));if(_0x1a137e[_0xeba6('0x11')]){if(_0x1a137e[_0xeba6('0x11')]['code']===0x1f4){logger[_0xeba6('0x11')](_0xeba6('0xc'),_0x57908f,_0x1a137e[_0xeba6('0x11')][_0xeba6('0x12')]);return _0x3c3823(_0x1a137e[_0xeba6('0x11')][_0xeba6('0x12')]);}logger[_0xeba6('0x11')](_0xeba6('0xc'),_0x57908f,_0x1a137e['error'][_0xeba6('0x12')]);return _0x59043f(_0x1a137e['error'][_0xeba6('0x12')]);}else{logger[_0xeba6('0xb')](_0xeba6('0xc'),_0x57908f,_0xeba6('0xd'));_0x59043f(_0x1a137e[_0xeba6('0x13')]['message']);}})[_0xeba6('0x14')](function(_0x727179){logger['error'](_0xeba6('0xc'),_0x57908f,_0x727179);_0x3c3823(_0x727179);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index b010de8..8a977fe 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 _0x688a=['describe','show','create','put','/:id','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','./mailSubstatus.controller','get','isAuthenticated','index'];(function(_0x30c712,_0x2f5e94){var _0x2c6e97=function(_0xfcb3ed){while(--_0xfcb3ed){_0x30c712['push'](_0x30c712['shift']());}};_0x2c6e97(++_0x2f5e94);}(_0x688a,0x1e4));var _0xa688=function(_0x34b5d7,_0x208d36){_0x34b5d7=_0x34b5d7-0x0;var _0x19414a=_0x688a[_0x34b5d7];return _0x19414a;};'use strict';var multer=require(_0xa688('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa688('0x1'));var express=require(_0xa688('0x2'));var router=express[_0xa688('0x3')]();var auth=require(_0xa688('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa688('0x5'));router[_0xa688('0x6')]('/',auth[_0xa688('0x7')](),controller[_0xa688('0x8')]);router[_0xa688('0x6')]('/describe',auth[_0xa688('0x7')](),controller[_0xa688('0x9')]);router[_0xa688('0x6')]('/:id',auth[_0xa688('0x7')](),controller[_0xa688('0xa')]);router['post']('/',auth[_0xa688('0x7')](),controller[_0xa688('0xb')]);router[_0xa688('0xc')](_0xa688('0xd'),auth[_0xa688('0x7')](),controller['update']);router[_0xa688('0xe')](_0xa688('0xd'),auth[_0xa688('0x7')](),controller[_0xa688('0xf')]);module[_0xa688('0x10')]=router; \ No newline at end of file +var _0x36fc=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x36fc,0x102));var _0xc36f=function(_0x3b1f49,_0x241d12){_0x3b1f49=_0x3b1f49-0x0;var _0x3ccf6c=_0x36fc[_0x3b1f49];return _0x3ccf6c;};'use strict';var multer=require(_0xc36f('0x0'));var util=require(_0xc36f('0x1'));var path=require(_0xc36f('0x2'));var timeout=require(_0xc36f('0x3'));var express=require(_0xc36f('0x4'));var router=express[_0xc36f('0x5')]();var auth=require(_0xc36f('0x6'));var interaction=require(_0xc36f('0x7'));var config=require(_0xc36f('0x8'));var controller=require(_0xc36f('0x9'));router[_0xc36f('0xa')]('/',auth[_0xc36f('0xb')](),controller[_0xc36f('0xc')]);router['get'](_0xc36f('0xd'),auth[_0xc36f('0xb')](),controller['describe']);router[_0xc36f('0xa')]('/:id',auth[_0xc36f('0xb')](),controller[_0xc36f('0xe')]);router[_0xc36f('0xf')]('/',auth[_0xc36f('0xb')](),controller[_0xc36f('0x10')]);router[_0xc36f('0x11')](_0xc36f('0x12'),auth[_0xc36f('0xb')](),controller[_0xc36f('0x13')]);router[_0xc36f('0x14')](_0xc36f('0x12'),auth[_0xc36f('0xb')](),controller[_0xc36f('0x15')]);module[_0xc36f('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index a76b3dc..f7f5bef 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 _0x4c4d=['sequelize'];(function(_0x2ba434,_0x18488c){var _0x5c88f9=function(_0xaa8657){while(--_0xaa8657){_0x2ba434['push'](_0x2ba434['shift']());}};_0x5c88f9(++_0x18488c);}(_0x4c4d,0x1a2));var _0xd4c4=function(_0x2e9678,_0x384835){_0x2e9678=_0x2e9678-0x0;var _0x52ab61=_0x4c4d[_0x2e9678];return _0x52ab61;};'use strict';var Sequelize=require(_0xd4c4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4af8=['STRING'];(function(_0x3cd6c2,_0x10b5de){var _0x53f6e1=function(_0x358026){while(--_0x358026){_0x3cd6c2['push'](_0x3cd6c2['shift']());}};_0x53f6e1(++_0x10b5de);}(_0x4af8,0x1ad));var _0x84af=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x4af8[_0x334841];return _0x5beb4b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x84af('0x0')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 1f02736..d16f614 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 _0xe105=['../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','save','update','then','stack','name','send','index','MailSubstatus','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','params','find','body','describe','html-pdf','request-promise','moment','bluebird','mustache','path','sox','ejs','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x3c1e3a,_0x11ba7a){var _0x19acb8=function(_0x1a1a4a){while(--_0x1a1a4a){_0x3c1e3a['push'](_0x3c1e3a['shift']());}};_0x19acb8(++_0x11ba7a);}(_0xe105,0xef));var _0x5e10=function(_0x169680,_0x31c525){_0x169680=_0x169680-0x0;var _0x506473=_0xe105[_0x169680];return _0x506473;};'use strict';var pdf=require(_0x5e10('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5e10('0x1'));var moment=require(_0x5e10('0x2'));var BPromise=require(_0x5e10('0x3'));var Mustache=require(_0x5e10('0x4'));var util=require('util');var path=require(_0x5e10('0x5'));var sox=require(_0x5e10('0x6'));var csv=require('to-csv');var ejs=require(_0x5e10('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5e10('0x8'));var jsforce=require(_0x5e10('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5e10('0xa'));var Papa=require(_0x5e10('0xb'));var Redis=require(_0x5e10('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x5e10('0xd'));var hardwareService=require(_0x5e10('0xe'));var logger=require('../../config/logger')(_0x5e10('0xf'));var utils=require(_0x5e10('0x10'));var config=require(_0x5e10('0x11'));var db=require(_0x5e10('0x12'))['db'];function respondWithStatusCode(_0x5c7cdb,_0x15f186){_0x15f186=_0x15f186||0xcc;return function(_0x51dd6c){if(_0x51dd6c){return _0x5c7cdb[_0x5e10('0x13')](_0x15f186);}return _0x5c7cdb[_0x5e10('0x14')](_0x15f186)[_0x5e10('0x15')]();};}function respondWithResult(_0xff9745,_0x34729d){_0x34729d=_0x34729d||0xc8;return function(_0x29cef8){if(_0x29cef8){return _0xff9745[_0x5e10('0x14')](_0x34729d)['json'](_0x29cef8);}};}function respondWithFilteredResult(_0x12bd7f,_0xdcd3c){return function(_0x2e6b9e){if(_0x2e6b9e){var _0x2f13e8=_0x2e6b9e[_0x5e10('0x16')],_0x2861db=_0xdcd3c[_0x5e10('0x17')],_0x5679eb=_0xdcd3c[_0x5e10('0x17')]+_0xdcd3c[_0x5e10('0x18')],_0x20ccd5;if(_0x5679eb>=_0x2f13e8){_0x5679eb=_0x2f13e8;_0x20ccd5=0xc8;}else{_0x20ccd5=0xce;}_0x12bd7f[_0x5e10('0x14')](_0x20ccd5);return _0x12bd7f[_0x5e10('0x19')]('Content-Range',_0x2861db+'-'+_0x5679eb+'/'+_0x2f13e8)[_0x5e10('0x1a')](_0x2e6b9e);}return null;};}function patchUpdates(_0x47dfc5){return function(_0x1c77a1){try{jsonpatch[_0x5e10('0x1b')](_0x1c77a1,_0x47dfc5,!![]);}catch(_0x1acad9){return BPromise['reject'](_0x1acad9);}return _0x1c77a1[_0x5e10('0x1c')]();};}function saveUpdates(_0x257137,_0x1f5b02){return function(_0x113a8e){if(_0x113a8e){return _0x113a8e[_0x5e10('0x1d')](_0x257137)[_0x5e10('0x1e')](function(_0x333bdf){return _0x333bdf;});}return null;};}function removeEntity(_0x11b125,_0x138172){return function(_0x8b955){if(_0x8b955){return _0x8b955['destroy']()['then'](function(){_0x11b125[_0x5e10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44c69d,_0x37e351){return function(_0xbe0a8d){if(!_0xbe0a8d){_0x44c69d[_0x5e10('0x13')](0x194);}return _0xbe0a8d;};}function handleError(_0x2f4bc5,_0x8f0fee){_0x8f0fee=_0x8f0fee||0x1f4;return function(_0x4fe280){logger['error'](_0x4fe280[_0x5e10('0x1f')]);if(_0x4fe280['name']){delete _0x4fe280[_0x5e10('0x20')];}_0x2f4bc5[_0x5e10('0x14')](_0x8f0fee)[_0x5e10('0x21')](_0x4fe280);};}exports[_0x5e10('0x22')]=function(_0x22764f,_0x5c5b07){var _0x581494={},_0x3f7f85={},_0xb14be0={'count':0x0,'rows':[]};var _0x4f0b2=db[_0x5e10('0x23')][_0x5e10('0x24')];_0x3f7f85[_0x5e10('0x25')]=_[_0x5e10('0x26')](_0x4f0b2);_0x3f7f85[_0x5e10('0x27')]=_[_0x5e10('0x26')](_0x22764f[_0x5e10('0x27')]);_0x3f7f85[_0x5e10('0x28')]=_[_0x5e10('0x29')](_0x3f7f85[_0x5e10('0x25')],_0x3f7f85[_0x5e10('0x27')]);_0x581494[_0x5e10('0x2a')]=_[_0x5e10('0x29')](_0x3f7f85['model'],qs[_0x5e10('0x2b')](_0x22764f[_0x5e10('0x27')][_0x5e10('0x2b')]));_0x581494[_0x5e10('0x2a')]=_0x581494['attributes'][_0x5e10('0x2c')]?_0x581494[_0x5e10('0x2a')]:_0x3f7f85['model'];if(!_0x22764f[_0x5e10('0x27')]['hasOwnProperty']('nolimit')){_0x581494['limit']=qs[_0x5e10('0x18')](_0x22764f[_0x5e10('0x27')][_0x5e10('0x18')]);_0x581494[_0x5e10('0x17')]=qs[_0x5e10('0x17')](_0x22764f[_0x5e10('0x27')][_0x5e10('0x17')]);}_0x581494['order']=qs[_0x5e10('0x2d')](_0x22764f[_0x5e10('0x27')]['sort']);_0x581494[_0x5e10('0x2e')]=qs['filters'](_[_0x5e10('0x2f')](_0x22764f[_0x5e10('0x27')],_0x3f7f85[_0x5e10('0x28')]));if(_0x22764f[_0x5e10('0x27')][_0x5e10('0x30')]){_0x581494[_0x5e10('0x2e')]=_['merge'](_0x581494['where'],{'$or':_['map'](_0x4f0b2,function(_0x151ecc){if(_0x151ecc['type'][_0x5e10('0x31')]!==_0x5e10('0x32')){var _0x5c16d9={};_0x5c16d9[_0x151ecc[_0x5e10('0x33')]]={'$like':'%'+_0x22764f[_0x5e10('0x27')]['filter']+'%'};return _0x5c16d9;}})});}_0x581494=_[_0x5e10('0x34')]({},_0x581494,_0x22764f[_0x5e10('0x35')]);var _0x4ae5b1={'where':_0x581494[_0x5e10('0x2e')]};return db['MailSubstatus'][_0x5e10('0x16')](_0x4ae5b1)[_0x5e10('0x1e')](function(_0x9ce7bb){_0xb14be0[_0x5e10('0x16')]=_0x9ce7bb;if(_0x22764f[_0x5e10('0x27')][_0x5e10('0x36')]){_0x581494[_0x5e10('0x37')]=[{'all':!![]}];}return db['MailSubstatus'][_0x5e10('0x38')](_0x581494);})[_0x5e10('0x1e')](function(_0x3eb446){_0xb14be0[_0x5e10('0x39')]=_0x3eb446;return _0xb14be0;})[_0x5e10('0x1e')](respondWithFilteredResult(_0x5c5b07,_0x581494))[_0x5e10('0x3a')](handleError(_0x5c5b07,null));};exports['show']=function(_0xd2de70,_0xc23197){var _0x5b3bb1={'raw':!![],'where':{'id':_0xd2de70[_0x5e10('0x3b')]['id']}},_0x305464={};_0x305464[_0x5e10('0x25')]=_[_0x5e10('0x26')](db[_0x5e10('0x23')]['rawAttributes']);_0x305464[_0x5e10('0x27')]=_[_0x5e10('0x26')](_0xd2de70[_0x5e10('0x27')]);_0x305464['filters']=_[_0x5e10('0x29')](_0x305464[_0x5e10('0x25')],_0x305464[_0x5e10('0x27')]);_0x5b3bb1[_0x5e10('0x2a')]=_[_0x5e10('0x29')](_0x305464[_0x5e10('0x25')],qs[_0x5e10('0x2b')](_0xd2de70['query'][_0x5e10('0x2b')]));_0x5b3bb1['attributes']=_0x5b3bb1['attributes']['length']?_0x5b3bb1[_0x5e10('0x2a')]:_0x305464[_0x5e10('0x25')];if(_0xd2de70['query'][_0x5e10('0x36')]){_0x5b3bb1[_0x5e10('0x37')]=[{'all':!![]}];}_0x5b3bb1=_[_0x5e10('0x34')]({},_0x5b3bb1,_0xd2de70[_0x5e10('0x35')]);return db[_0x5e10('0x23')][_0x5e10('0x3c')](_0x5b3bb1)[_0x5e10('0x1e')](handleEntityNotFound(_0xc23197,null))[_0x5e10('0x1e')](respondWithResult(_0xc23197,null))['catch'](handleError(_0xc23197,null));};exports['create']=function(_0xe7608e,_0x1f1b05){return db[_0x5e10('0x23')]['create'](_0xe7608e[_0x5e10('0x3d')],{})[_0x5e10('0x1e')](respondWithResult(_0x1f1b05,0xc9))[_0x5e10('0x3a')](handleError(_0x1f1b05,null));};exports[_0x5e10('0x1d')]=function(_0x2040e4,_0x59c8b4){if(_0x2040e4[_0x5e10('0x3d')]['id']){delete _0x2040e4[_0x5e10('0x3d')]['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x2040e4[_0x5e10('0x3b')]['id']}})[_0x5e10('0x1e')](handleEntityNotFound(_0x59c8b4,null))[_0x5e10('0x1e')](saveUpdates(_0x2040e4[_0x5e10('0x3d')],null))[_0x5e10('0x1e')](respondWithResult(_0x59c8b4,null))[_0x5e10('0x3a')](handleError(_0x59c8b4,null));};exports['destroy']=function(_0x547435,_0x4ebdfb){return db[_0x5e10('0x23')]['find']({'where':{'id':_0x547435[_0x5e10('0x3b')]['id']}})[_0x5e10('0x1e')](handleEntityNotFound(_0x4ebdfb,null))[_0x5e10('0x1e')](removeEntity(_0x4ebdfb,null))[_0x5e10('0x3a')](handleError(_0x4ebdfb,null));};exports['describe']=function(_0x3dcc24,_0x1af964){return db[_0x5e10('0x23')][_0x5e10('0x3e')]()[_0x5e10('0x1e')](respondWithResult(_0x1af964,null))[_0x5e10('0x3a')](handleError(_0x1af964,null));}; \ No newline at end of file +var _0x43b1=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','where','pick','filter','merge','map','type','key','options','MailSubstatus','includeAll','findAll','rows','show','find','catch','create','body','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring'];(function(_0x2d126e,_0x1e8257){var _0xcb04d3=function(_0x19a2d9){while(--_0x19a2d9){_0x2d126e['push'](_0x2d126e['shift']());}};_0xcb04d3(++_0x1e8257);}(_0x43b1,0x7d));var _0x143b=function(_0x5efd94,_0x4cd999){_0x5efd94=_0x5efd94-0x0;var _0x2326b2=_0x43b1[_0x5efd94];return _0x2326b2;};'use strict';var pdf=require(_0x143b('0x0'));var emlformat=require(_0x143b('0x1'));var rimraf=require(_0x143b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x143b('0x3'));var rp=require('request-promise');var moment=require(_0x143b('0x4'));var BPromise=require(_0x143b('0x5'));var Mustache=require(_0x143b('0x6'));var util=require(_0x143b('0x7'));var path=require(_0x143b('0x8'));var sox=require(_0x143b('0x9'));var csv=require('to-csv');var ejs=require(_0x143b('0xa'));var fs=require('fs');var _=require(_0x143b('0xb'));var squel=require(_0x143b('0xc'));var crypto=require('crypto');var jsforce=require(_0x143b('0xd'));var deskjs=require(_0x143b('0xe'));var toCsv=require(_0x143b('0xf'));var querystring=require(_0x143b('0x10'));var Papa=require(_0x143b('0x11'));var Redis=require(_0x143b('0x12'));var authService=require(_0x143b('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x143b('0x14'));var logger=require(_0x143b('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x143b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cd6c7,_0x2c6712){_0x2c6712=_0x2c6712||0xcc;return function(_0x52429f){if(_0x52429f){return _0x2cd6c7[_0x143b('0x17')](_0x2c6712);}return _0x2cd6c7[_0x143b('0x18')](_0x2c6712)[_0x143b('0x19')]();};}function respondWithResult(_0x2e3053,_0x270dc9){_0x270dc9=_0x270dc9||0xc8;return function(_0x34cd9b){if(_0x34cd9b){return _0x2e3053[_0x143b('0x18')](_0x270dc9)[_0x143b('0x1a')](_0x34cd9b);}};}function respondWithFilteredResult(_0x2acea8,_0x548ffa){return function(_0x2bca2c){if(_0x2bca2c){var _0x3cc649=_0x2bca2c[_0x143b('0x1b')],_0x2d746a=_0x548ffa[_0x143b('0x1c')],_0x133603=_0x548ffa['offset']+_0x548ffa['limit'],_0x11d3a9;if(_0x133603>=_0x3cc649){_0x133603=_0x3cc649;_0x11d3a9=0xc8;}else{_0x11d3a9=0xce;}_0x2acea8[_0x143b('0x18')](_0x11d3a9);return _0x2acea8[_0x143b('0x1d')](_0x143b('0x1e'),_0x2d746a+'-'+_0x133603+'/'+_0x3cc649)[_0x143b('0x1a')](_0x2bca2c);}return null;};}function patchUpdates(_0x2201bc){return function(_0x19e3e1){try{jsonpatch[_0x143b('0x1f')](_0x19e3e1,_0x2201bc,!![]);}catch(_0x1ca6d2){return BPromise[_0x143b('0x20')](_0x1ca6d2);}return _0x19e3e1[_0x143b('0x21')]();};}function saveUpdates(_0x2a8b22,_0x59c3d9){return function(_0x1dd05b){if(_0x1dd05b){return _0x1dd05b[_0x143b('0x22')](_0x2a8b22)[_0x143b('0x23')](function(_0xfd9194){return _0xfd9194;});}return null;};}function removeEntity(_0x1f9126,_0x1bed9b){return function(_0x159ef6){if(_0x159ef6){return _0x159ef6[_0x143b('0x24')]()['then'](function(){_0x1f9126[_0x143b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a55fe,_0x5bdebc){return function(_0x549638){if(!_0x549638){_0x2a55fe[_0x143b('0x17')](0x194);}return _0x549638;};}function handleError(_0x100021,_0x4aaa24){_0x4aaa24=_0x4aaa24||0x1f4;return function(_0x4a9c97){logger[_0x143b('0x25')](_0x4a9c97['stack']);if(_0x4a9c97[_0x143b('0x26')]){delete _0x4a9c97['name'];}_0x100021[_0x143b('0x18')](_0x4aaa24)[_0x143b('0x27')](_0x4a9c97);};}exports[_0x143b('0x28')]=function(_0x4f5a17,_0x47997b){var _0x485336={},_0x5aab5b={},_0x3e96ff={'count':0x0,'rows':[]};var _0x4a4090=db['MailSubstatus'][_0x143b('0x29')];_0x5aab5b[_0x143b('0x2a')]=_[_0x143b('0x2b')](_0x4a4090);_0x5aab5b['query']=_[_0x143b('0x2b')](_0x4f5a17[_0x143b('0x2c')]);_0x5aab5b[_0x143b('0x2d')]=_[_0x143b('0x2e')](_0x5aab5b[_0x143b('0x2a')],_0x5aab5b['query']);_0x485336['attributes']=_['intersection'](_0x5aab5b['model'],qs[_0x143b('0x2f')](_0x4f5a17[_0x143b('0x2c')][_0x143b('0x2f')]));_0x485336[_0x143b('0x30')]=_0x485336[_0x143b('0x30')][_0x143b('0x31')]?_0x485336[_0x143b('0x30')]:_0x5aab5b[_0x143b('0x2a')];if(!_0x4f5a17[_0x143b('0x2c')][_0x143b('0x32')]('nolimit')){_0x485336[_0x143b('0x33')]=qs[_0x143b('0x33')](_0x4f5a17['query']['limit']);_0x485336[_0x143b('0x1c')]=qs[_0x143b('0x1c')](_0x4f5a17[_0x143b('0x2c')][_0x143b('0x1c')]);}_0x485336['order']=qs['sort'](_0x4f5a17['query']['sort']);_0x485336[_0x143b('0x34')]=qs[_0x143b('0x2d')](_[_0x143b('0x35')](_0x4f5a17['query'],_0x5aab5b[_0x143b('0x2d')]));if(_0x4f5a17[_0x143b('0x2c')][_0x143b('0x36')]){_0x485336['where']=_[_0x143b('0x37')](_0x485336[_0x143b('0x34')],{'$or':_[_0x143b('0x38')](_0x4a4090,function(_0x4c16f2){if(_0x4c16f2[_0x143b('0x39')][_0x143b('0x3a')]!=='VIRTUAL'){var _0x573d2c={};_0x573d2c[_0x4c16f2['field']]={'$like':'%'+_0x4f5a17[_0x143b('0x2c')][_0x143b('0x36')]+'%'};return _0x573d2c;}})});}_0x485336=_['merge']({},_0x485336,_0x4f5a17[_0x143b('0x3b')]);var _0xf3be22={'where':_0x485336[_0x143b('0x34')]};return db[_0x143b('0x3c')]['count'](_0xf3be22)[_0x143b('0x23')](function(_0x3cdc85){_0x3e96ff[_0x143b('0x1b')]=_0x3cdc85;if(_0x4f5a17[_0x143b('0x2c')][_0x143b('0x3d')]){_0x485336['include']=[{'all':!![]}];}return db[_0x143b('0x3c')][_0x143b('0x3e')](_0x485336);})[_0x143b('0x23')](function(_0x5cd618){_0x3e96ff[_0x143b('0x3f')]=_0x5cd618;return _0x3e96ff;})[_0x143b('0x23')](respondWithFilteredResult(_0x47997b,_0x485336))['catch'](handleError(_0x47997b,null));};exports[_0x143b('0x40')]=function(_0x374eaf,_0x395f59){var _0x109632={'raw':!![],'where':{'id':_0x374eaf['params']['id']}},_0x442a1d={};_0x442a1d[_0x143b('0x2a')]=_[_0x143b('0x2b')](db[_0x143b('0x3c')][_0x143b('0x29')]);_0x442a1d[_0x143b('0x2c')]=_[_0x143b('0x2b')](_0x374eaf[_0x143b('0x2c')]);_0x442a1d['filters']=_[_0x143b('0x2e')](_0x442a1d[_0x143b('0x2a')],_0x442a1d['query']);_0x109632[_0x143b('0x30')]=_[_0x143b('0x2e')](_0x442a1d['model'],qs[_0x143b('0x2f')](_0x374eaf[_0x143b('0x2c')][_0x143b('0x2f')]));_0x109632['attributes']=_0x109632[_0x143b('0x30')][_0x143b('0x31')]?_0x109632[_0x143b('0x30')]:_0x442a1d[_0x143b('0x2a')];if(_0x374eaf[_0x143b('0x2c')][_0x143b('0x3d')]){_0x109632['include']=[{'all':!![]}];}_0x109632=_[_0x143b('0x37')]({},_0x109632,_0x374eaf[_0x143b('0x3b')]);return db[_0x143b('0x3c')][_0x143b('0x41')](_0x109632)['then'](handleEntityNotFound(_0x395f59,null))[_0x143b('0x23')](respondWithResult(_0x395f59,null))[_0x143b('0x42')](handleError(_0x395f59,null));};exports[_0x143b('0x43')]=function(_0x3fabe4,_0x303171){return db[_0x143b('0x3c')][_0x143b('0x43')](_0x3fabe4['body'],{})['then'](respondWithResult(_0x303171,0xc9))['catch'](handleError(_0x303171,null));};exports[_0x143b('0x22')]=function(_0x10ca16,_0x332cfd){if(_0x10ca16[_0x143b('0x44')]['id']){delete _0x10ca16[_0x143b('0x44')]['id'];}return db[_0x143b('0x3c')][_0x143b('0x41')]({'where':{'id':_0x10ca16[_0x143b('0x45')]['id']}})[_0x143b('0x23')](handleEntityNotFound(_0x332cfd,null))[_0x143b('0x23')](saveUpdates(_0x10ca16['body'],null))[_0x143b('0x23')](respondWithResult(_0x332cfd,null))[_0x143b('0x42')](handleError(_0x332cfd,null));};exports[_0x143b('0x24')]=function(_0x42a5d9,_0x48e3e5){return db[_0x143b('0x3c')]['find']({'where':{'id':_0x42a5d9[_0x143b('0x45')]['id']}})[_0x143b('0x23')](handleEntityNotFound(_0x48e3e5,null))['then'](removeEntity(_0x48e3e5,null))['catch'](handleError(_0x48e3e5,null));};exports[_0x143b('0x46')]=function(_0x268ce7,_0x3c0f81){return db['MailSubstatus'][_0x143b('0x46')]()['then'](respondWithResult(_0x3c0f81,null))[_0x143b('0x42')](handleError(_0x3c0f81,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 2e31abb..6c168b7 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 _0xa32c=['bluebird','request-promise','path','rimraf','exports','define','MailSubstatus','lodash','../../config/logger','moment'];(function(_0x555323,_0x540d94){var _0x38efaf=function(_0x2afed4){while(--_0x2afed4){_0x555323['push'](_0x555323['shift']());}};_0x38efaf(++_0x540d94);}(_0xa32c,0x1d3));var _0xca32=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa32c[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xca32('0x0'));var util=require('util');var logger=require(_0xca32('0x1'))('api');var moment=require(_0xca32('0x2'));var BPromise=require(_0xca32('0x3'));var rp=require(_0xca32('0x4'));var fs=require('fs');var path=require(_0xca32('0x5'));var rimraf=require(_0xca32('0x6'));var config=require('../../config/environment');var attributes=require('./mailSubstatus.attributes');module[_0xca32('0x7')]=function(_0x547df5,_0x2e18b4){return _0x547df5[_0xca32('0x8')](_0xca32('0x9'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a36=['rimraf','../../config/environment','exports','MailSubstatus','mail_substatuses','lodash','util','api','request-promise'];(function(_0xa6032d,_0x17b71e){var _0x199bff=function(_0x4eaa2c){while(--_0x4eaa2c){_0xa6032d['push'](_0xa6032d['shift']());}};_0x199bff(++_0x17b71e);}(_0x4a36,0x95));var _0x64a3=function(_0x436838,_0xbe13a8){_0x436838=_0x436838-0x0;var _0x18bca5=_0x4a36[_0x436838];return _0x18bca5;};'use strict';var _=require(_0x64a3('0x0'));var util=require(_0x64a3('0x1'));var logger=require('../../config/logger')(_0x64a3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x64a3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x64a3('0x4'));var config=require(_0x64a3('0x5'));var attributes=require('./mailSubstatus.attributes');module[_0x64a3('0x6')]=function(_0x5efb64,_0x138079){return _0x5efb64['define'](_0x64a3('0x7'),attributes,{'tableName':_0x64a3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 5a7d11e..54dc83b 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 _0xc806=['then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x327615,_0x128547){var _0xd86a49=function(_0x1bba0d){while(--_0x1bba0d){_0x327615['push'](_0x327615['shift']());}};_0xd86a49(++_0x128547);}(_0xc806,0x170));var _0x6c80=function(_0x5cfed5,_0x5f14d7){_0x5cfed5=_0x5cfed5-0x0;var _0x4035e4=_0xc806[_0x5cfed5];return _0x4035e4;};'use strict';var _=require(_0x6c80('0x0'));var util=require(_0x6c80('0x1'));var moment=require(_0x6c80('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c80('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c80('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6c80('0x5'));var config=require(_0x6c80('0x6'));var jayson=require(_0x6c80('0x7'));var client=jayson[_0x6c80('0x8')][_0x6c80('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1de80d,_0x7f3ad9,_0x44aa1e){return new BPromise(function(_0x3521e2,_0x1459b4){return client['request'](_0x1de80d,_0x44aa1e)[_0x6c80('0xa')](function(_0x31aaab){logger[_0x6c80('0xb')](_0x6c80('0xc'),_0x7f3ad9,_0x6c80('0xd'));logger[_0x6c80('0xe')](_0x6c80('0xf'),_0x7f3ad9,_0x6c80('0xd'),JSON[_0x6c80('0x10')](_0x31aaab));if(_0x31aaab[_0x6c80('0x11')]){if(_0x31aaab[_0x6c80('0x11')][_0x6c80('0x12')]===0x1f4){logger[_0x6c80('0x11')](_0x6c80('0xc'),_0x7f3ad9,_0x31aaab[_0x6c80('0x11')]['message']);return _0x1459b4(_0x31aaab[_0x6c80('0x11')][_0x6c80('0x13')]);}logger[_0x6c80('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x7f3ad9,_0x31aaab[_0x6c80('0x11')]['message']);return _0x3521e2(_0x31aaab[_0x6c80('0x11')][_0x6c80('0x13')]);}else{logger[_0x6c80('0xb')](_0x6c80('0xc'),_0x7f3ad9,'request\x20sent');_0x3521e2(_0x31aaab[_0x6c80('0x14')]['message']);}})['catch'](function(_0x35dae5){logger[_0x6c80('0x11')](_0x6c80('0xc'),_0x7f3ad9,_0x35dae5);_0x1459b4(_0x35dae5);});});} \ No newline at end of file +var _0x9cc2=['randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','then','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','bluebird'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x9cc2,0x1c9));var _0x29cc=function(_0x37b7b6,_0x165a5c){_0x37b7b6=_0x37b7b6-0x0;var _0x10c4c3=_0x9cc2[_0x37b7b6];return _0x10c4c3;};'use strict';var _=require(_0x29cc('0x0'));var util=require(_0x29cc('0x1'));var moment=require('moment');var BPromise=require(_0x29cc('0x2'));var rs=require(_0x29cc('0x3'));var fs=require('fs');var Redis=require(_0x29cc('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29cc('0x5'))(_0x29cc('0x6'));var config=require('../../config/environment');var jayson=require(_0x29cc('0x7'));var client=jayson[_0x29cc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e4cb3,_0x5d6933,_0x162e08){return new BPromise(function(_0x2aab70,_0x2d30c4){return client[_0x29cc('0x9')](_0x3e4cb3,_0x162e08)[_0x29cc('0xa')](function(_0x29110c){logger[_0x29cc('0xb')](_0x29cc('0xc'),_0x5d6933,'request\x20sent');logger[_0x29cc('0xd')](_0x29cc('0xe'),_0x5d6933,_0x29cc('0xf'),JSON[_0x29cc('0x10')](_0x29110c));if(_0x29110c[_0x29cc('0x11')]){if(_0x29110c[_0x29cc('0x11')]['code']===0x1f4){logger[_0x29cc('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x5d6933,_0x29110c[_0x29cc('0x11')][_0x29cc('0x12')]);return _0x2d30c4(_0x29110c[_0x29cc('0x11')][_0x29cc('0x12')]);}logger[_0x29cc('0x11')](_0x29cc('0xc'),_0x5d6933,_0x29110c[_0x29cc('0x11')][_0x29cc('0x12')]);return _0x2aab70(_0x29110c['error']['message']);}else{logger[_0x29cc('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x5d6933,_0x29cc('0xf'));_0x2aab70(_0x29110c['result'][_0x29cc('0x12')]);}})[_0x29cc('0x13')](function(_0x2c769a){logger[_0x29cc('0x11')](_0x29cc('0xc'),_0x5d6933,_0x2c769a);_0x2d30c4(_0x2c769a);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 88e2bbd..42aecbd 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 _0x0adf=['update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','put'];(function(_0x5d9b7e,_0x1ac7b2){var _0x3cceb4=function(_0xc0cd0b){while(--_0xc0cd0b){_0x5d9b7e['push'](_0x5d9b7e['shift']());}};_0x3cceb4(++_0x1ac7b2);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x3c771d,_0x593fba){_0x3c771d=_0x3c771d-0x0;var _0x1bcaae=_0x0adf[_0x3c771d];return _0x1bcaae;};'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['post']('/',auth[_0xf0ad('0xc')](),controller['create']);router[_0xf0ad('0x10')](_0xf0ad('0xe'),auth[_0xf0ad('0xc')](),controller[_0xf0ad('0x11')]);router[_0xf0ad('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xf0ad('0x13')]);module[_0xf0ad('0x14')]=router; \ No newline at end of file +var _0xc21e=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy','exports','util','path'];(function(_0x3662b4,_0x503b4d){var _0x50928c=function(_0x15db69){while(--_0x15db69){_0x3662b4['push'](_0x3662b4['shift']());}};_0x50928c(++_0x503b4d);}(_0xc21e,0x1ca));var _0xec21=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xc21e[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0xec21('0x0'));var path=require(_0xec21('0x1'));var timeout=require(_0xec21('0x2'));var express=require(_0xec21('0x3'));var router=express[_0xec21('0x4')]();var auth=require(_0xec21('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xec21('0x6'));var controller=require(_0xec21('0x7'));router[_0xec21('0x8')]('/',auth[_0xec21('0x9')](),controller[_0xec21('0xa')]);router[_0xec21('0x8')](_0xec21('0xb'),auth[_0xec21('0x9')](),controller['describe']);router[_0xec21('0x8')](_0xec21('0xc'),auth[_0xec21('0x9')](),controller[_0xec21('0xd')]);router[_0xec21('0xe')]('/',auth['isAuthenticated'](),controller[_0xec21('0xf')]);router[_0xec21('0x10')](_0xec21('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xec21('0x11')](_0xec21('0xc'),auth['isAuthenticated'](),controller[_0xec21('0x12')]);module[_0xec21('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 bc6158c..c02313e 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 _0x7c7c=['queue','DATE','NOW','moment','sequelize','exports','STRING','ENUM','account','agent'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7c7c,0xdf));var _0xc7c7=function(_0x316ea9,_0x241fb4){_0x316ea9=_0x316ea9-0x0;var _0x3e1424=_0x7c7c[_0x316ea9];return _0x3e1424;};'use strict';var moment=require(_0xc7c7('0x0'));var Sequelize=require(_0xc7c7('0x1'));module[_0xc7c7('0x2')]={'uniqueid':{'type':Sequelize[_0xc7c7('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc7c7('0x4')](_0xc7c7('0x5'),_0xc7c7('0x6'),_0xc7c7('0x7')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xc7c7('0x8')],'allowNull':![],'defaultValue':Sequelize[_0xc7c7('0x9')]}}; \ No newline at end of file +var _0x8a53=['exports','STRING','account','queue','DATE','NOW','moment','sequelize'];(function(_0x26fe84,_0x429de2){var _0x45c767=function(_0x170f6c){while(--_0x170f6c){_0x26fe84['push'](_0x26fe84['shift']());}};_0x45c767(++_0x429de2);}(_0x8a53,0x1be));var _0x38a5=function(_0x2b56f9,_0x4798f0){_0x2b56f9=_0x2b56f9-0x0;var _0x17597b=_0x8a53[_0x2b56f9];return _0x17597b;};'use strict';var moment=require(_0x38a5('0x0'));var Sequelize=require(_0x38a5('0x1'));module[_0x38a5('0x2')]={'uniqueid':{'type':Sequelize[_0x38a5('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x38a5('0x4'),'agent',_0x38a5('0x5')),'allowNull':![],'defaultValue':_0x38a5('0x5')},'transferredAt':{'type':Sequelize[_0x38a5('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x38a5('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 94e2748..776bb02 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 _0x84c9=['limit','set','Content-Range','apply','update','then','destroy','error','stack','name','index','MailTransferReport','rawAttributes','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','where','filter','map','key','VIRTUAL','field','merge','options','includeAll','include','findAll','show','length','find','catch','create','body','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x84c9,0x72));var _0x984c=function(_0x5f15a1,_0x65274e){_0x5f15a1=_0x5f15a1-0x0;var _0xe59d9=_0x84c9[_0x5f15a1];return _0xe59d9;};'use strict';var pdf=require(_0x984c('0x0'));var emlformat=require(_0x984c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x984c('0x2'));var jsonpatch=require(_0x984c('0x3'));var rp=require(_0x984c('0x4'));var moment=require(_0x984c('0x5'));var BPromise=require(_0x984c('0x6'));var Mustache=require(_0x984c('0x7'));var util=require('util');var path=require(_0x984c('0x8'));var sox=require(_0x984c('0x9'));var csv=require(_0x984c('0xa'));var ejs=require(_0x984c('0xb'));var fs=require('fs');var _=require(_0x984c('0xc'));var squel=require(_0x984c('0xd'));var crypto=require(_0x984c('0xe'));var jsforce=require(_0x984c('0xf'));var deskjs=require(_0x984c('0x10'));var toCsv=require(_0x984c('0xa'));var querystring=require(_0x984c('0x11'));var Papa=require('papaparse');var Redis=require(_0x984c('0x12'));var authService=require(_0x984c('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x984c('0x14'));var logger=require(_0x984c('0x15'))(_0x984c('0x16'));var utils=require(_0x984c('0x17'));var config=require(_0x984c('0x18'));var db=require(_0x984c('0x19'))['db'];function respondWithStatusCode(_0x302184,_0x3e62f5){_0x3e62f5=_0x3e62f5||0xcc;return function(_0x3b22b6){if(_0x3b22b6){return _0x302184[_0x984c('0x1a')](_0x3e62f5);}return _0x302184[_0x984c('0x1b')](_0x3e62f5)[_0x984c('0x1c')]();};}function respondWithResult(_0x4b0001,_0x318036){_0x318036=_0x318036||0xc8;return function(_0x338f99){if(_0x338f99){return _0x4b0001['status'](_0x318036)[_0x984c('0x1d')](_0x338f99);}};}function respondWithFilteredResult(_0x8b2726,_0x31af96){return function(_0x1b13d4){if(_0x1b13d4){var _0x5b4505=_0x1b13d4[_0x984c('0x1e')],_0x49c199=_0x31af96['offset'],_0x1bf842=_0x31af96[_0x984c('0x1f')]+_0x31af96[_0x984c('0x20')],_0x36b4c8;if(_0x1bf842>=_0x5b4505){_0x1bf842=_0x5b4505;_0x36b4c8=0xc8;}else{_0x36b4c8=0xce;}_0x8b2726[_0x984c('0x1b')](_0x36b4c8);return _0x8b2726[_0x984c('0x21')](_0x984c('0x22'),_0x49c199+'-'+_0x1bf842+'/'+_0x5b4505)[_0x984c('0x1d')](_0x1b13d4);}return null;};}function patchUpdates(_0x1dbf5b){return function(_0x2c3d93){try{jsonpatch[_0x984c('0x23')](_0x2c3d93,_0x1dbf5b,!![]);}catch(_0x25abed){return BPromise['reject'](_0x25abed);}return _0x2c3d93['save']();};}function saveUpdates(_0x18d4f7,_0x5cc181){return function(_0x2556a3){if(_0x2556a3){return _0x2556a3[_0x984c('0x24')](_0x18d4f7)[_0x984c('0x25')](function(_0x4c57fd){return _0x4c57fd;});}return null;};}function removeEntity(_0xc8372c,_0x36fb5c){return function(_0x52ec33){if(_0x52ec33){return _0x52ec33[_0x984c('0x26')]()[_0x984c('0x25')](function(){_0xc8372c[_0x984c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b3f59,_0x4362b8){return function(_0x128546){if(!_0x128546){_0x5b3f59[_0x984c('0x1a')](0x194);}return _0x128546;};}function handleError(_0x4af3b9,_0x2e6925){_0x2e6925=_0x2e6925||0x1f4;return function(_0x3f852d){logger[_0x984c('0x27')](_0x3f852d[_0x984c('0x28')]);if(_0x3f852d['name']){delete _0x3f852d[_0x984c('0x29')];}_0x4af3b9[_0x984c('0x1b')](_0x2e6925)['send'](_0x3f852d);};}exports[_0x984c('0x2a')]=function(_0x522898,_0x9e50bc){var _0x1817a0={},_0x2fa8d5={},_0x17e60c={'count':0x0,'rows':[]};var _0x381e55=db[_0x984c('0x2b')][_0x984c('0x2c')];_0x2fa8d5['model']=_[_0x984c('0x2d')](_0x381e55);_0x2fa8d5[_0x984c('0x2e')]=_['keys'](_0x522898['query']);_0x2fa8d5[_0x984c('0x2f')]=_[_0x984c('0x30')](_0x2fa8d5[_0x984c('0x31')],_0x2fa8d5['query']);_0x1817a0[_0x984c('0x32')]=_[_0x984c('0x30')](_0x2fa8d5[_0x984c('0x31')],qs['fields'](_0x522898['query'][_0x984c('0x33')]));_0x1817a0[_0x984c('0x32')]=_0x1817a0[_0x984c('0x32')]['length']?_0x1817a0[_0x984c('0x32')]:_0x2fa8d5[_0x984c('0x31')];if(!_0x522898[_0x984c('0x2e')][_0x984c('0x34')]('nolimit')){_0x1817a0[_0x984c('0x20')]=qs[_0x984c('0x20')](_0x522898[_0x984c('0x2e')][_0x984c('0x20')]);_0x1817a0[_0x984c('0x1f')]=qs[_0x984c('0x1f')](_0x522898['query'][_0x984c('0x1f')]);}_0x1817a0[_0x984c('0x35')]=qs['sort'](_0x522898[_0x984c('0x2e')]['sort']);_0x1817a0[_0x984c('0x36')]=qs[_0x984c('0x2f')](_['pick'](_0x522898[_0x984c('0x2e')],_0x2fa8d5[_0x984c('0x2f')]));if(_0x522898['query'][_0x984c('0x37')]){_0x1817a0[_0x984c('0x36')]=_['merge'](_0x1817a0['where'],{'$or':_[_0x984c('0x38')](_0x381e55,function(_0x577f4b){if(_0x577f4b['type'][_0x984c('0x39')]!==_0x984c('0x3a')){var _0x118591={};_0x118591[_0x577f4b[_0x984c('0x3b')]]={'$like':'%'+_0x522898[_0x984c('0x2e')]['filter']+'%'};return _0x118591;}})});}_0x1817a0=_[_0x984c('0x3c')]({},_0x1817a0,_0x522898[_0x984c('0x3d')]);var _0x32fc65={'where':_0x1817a0[_0x984c('0x36')]};return db['MailTransferReport'][_0x984c('0x1e')](_0x32fc65)[_0x984c('0x25')](function(_0x47c3f1){_0x17e60c[_0x984c('0x1e')]=_0x47c3f1;if(_0x522898[_0x984c('0x2e')][_0x984c('0x3e')]){_0x1817a0[_0x984c('0x3f')]=[{'all':!![]}];}return db[_0x984c('0x2b')][_0x984c('0x40')](_0x1817a0);})[_0x984c('0x25')](function(_0x5353cf){_0x17e60c['rows']=_0x5353cf;return _0x17e60c;})[_0x984c('0x25')](respondWithFilteredResult(_0x9e50bc,_0x1817a0))['catch'](handleError(_0x9e50bc,null));};exports[_0x984c('0x41')]=function(_0x4139cd,_0x217cee){var _0x52ff22={'raw':!![],'where':{'id':_0x4139cd['params']['id']}},_0x3c2527={};_0x3c2527[_0x984c('0x31')]=_['keys'](db[_0x984c('0x2b')][_0x984c('0x2c')]);_0x3c2527[_0x984c('0x2e')]=_[_0x984c('0x2d')](_0x4139cd[_0x984c('0x2e')]);_0x3c2527[_0x984c('0x2f')]=_[_0x984c('0x30')](_0x3c2527[_0x984c('0x31')],_0x3c2527[_0x984c('0x2e')]);_0x52ff22[_0x984c('0x32')]=_[_0x984c('0x30')](_0x3c2527[_0x984c('0x31')],qs['fields'](_0x4139cd[_0x984c('0x2e')][_0x984c('0x33')]));_0x52ff22[_0x984c('0x32')]=_0x52ff22[_0x984c('0x32')][_0x984c('0x42')]?_0x52ff22['attributes']:_0x3c2527['model'];if(_0x4139cd['query'][_0x984c('0x3e')]){_0x52ff22[_0x984c('0x3f')]=[{'all':!![]}];}_0x52ff22=_[_0x984c('0x3c')]({},_0x52ff22,_0x4139cd[_0x984c('0x3d')]);return db[_0x984c('0x2b')][_0x984c('0x43')](_0x52ff22)[_0x984c('0x25')](handleEntityNotFound(_0x217cee,null))[_0x984c('0x25')](respondWithResult(_0x217cee,null))[_0x984c('0x44')](handleError(_0x217cee,null));};exports[_0x984c('0x45')]=function(_0x3df8f2,_0x554f24){return db[_0x984c('0x2b')][_0x984c('0x45')](_0x3df8f2['body'],{})[_0x984c('0x25')](respondWithResult(_0x554f24,0xc9))[_0x984c('0x44')](handleError(_0x554f24,null));};exports[_0x984c('0x24')]=function(_0x3203d8,_0x38d7ca){if(_0x3203d8[_0x984c('0x46')]['id']){delete _0x3203d8[_0x984c('0x46')]['id'];}return db['MailTransferReport'][_0x984c('0x43')]({'where':{'id':_0x3203d8[_0x984c('0x47')]['id']}})[_0x984c('0x25')](handleEntityNotFound(_0x38d7ca,null))[_0x984c('0x25')](saveUpdates(_0x3203d8[_0x984c('0x46')],null))[_0x984c('0x25')](respondWithResult(_0x38d7ca,null))[_0x984c('0x44')](handleError(_0x38d7ca,null));};exports[_0x984c('0x26')]=function(_0x21de34,_0x4277fc){return db[_0x984c('0x2b')][_0x984c('0x43')]({'where':{'id':_0x21de34[_0x984c('0x47')]['id']}})[_0x984c('0x25')](handleEntityNotFound(_0x4277fc,null))[_0x984c('0x25')](removeEntity(_0x4277fc,null))['catch'](handleError(_0x4277fc,null));};exports[_0x984c('0x48')]=function(_0x4e4c00,_0x5788f1){return db[_0x984c('0x2b')][_0x984c('0x48')]()[_0x984c('0x25')](respondWithResult(_0x5788f1,null))[_0x984c('0x44')](handleError(_0x5788f1,null));}; \ No newline at end of file +var _0xe766=['map','type','key','VIRTUAL','field','options','MailTransferReport','includeAll','include','catch','show','length','find','create','body','update','params','describe','html-pdf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','then','destroy','error','name','send','index','rawAttributes','keys','query','filters','model','intersection','fields','attributes','nolimit','order','sort','pick','where','merge'];(function(_0x468657,_0x59e3e6){var _0x26533d=function(_0x4a57be){while(--_0x4a57be){_0x468657['push'](_0x468657['shift']());}};_0x26533d(++_0x59e3e6);}(_0xe766,0xea));var _0x6e76=function(_0x65e216,_0x568bd5){_0x65e216=_0x65e216-0x0;var _0x4e3e06=_0xe766[_0x65e216];return _0x4e3e06;};'use strict';var pdf=require(_0x6e76('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6e76('0x1'));var rp=require(_0x6e76('0x2'));var moment=require(_0x6e76('0x3'));var BPromise=require(_0x6e76('0x4'));var Mustache=require(_0x6e76('0x5'));var util=require(_0x6e76('0x6'));var path=require(_0x6e76('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6e76('0x8'));var fs=require('fs');var _=require(_0x6e76('0x9'));var squel=require(_0x6e76('0xa'));var crypto=require(_0x6e76('0xb'));var jsforce=require(_0x6e76('0xc'));var deskjs=require(_0x6e76('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6e76('0xe'));var Papa=require(_0x6e76('0xf'));var Redis=require(_0x6e76('0x10'));var authService=require(_0x6e76('0x11'));var qs=require(_0x6e76('0x12'));var hardwareService=require(_0x6e76('0x13'));var logger=require(_0x6e76('0x14'))(_0x6e76('0x15'));var utils=require('../../config/utils');var config=require(_0x6e76('0x16'));var db=require(_0x6e76('0x17'))['db'];function respondWithStatusCode(_0x21631b,_0x49d34a){_0x49d34a=_0x49d34a||0xcc;return function(_0x5063b0){if(_0x5063b0){return _0x21631b[_0x6e76('0x18')](_0x49d34a);}return _0x21631b[_0x6e76('0x19')](_0x49d34a)['end']();};}function respondWithResult(_0x1fc1aa,_0xf0e3ff){_0xf0e3ff=_0xf0e3ff||0xc8;return function(_0x172d1c){if(_0x172d1c){return _0x1fc1aa[_0x6e76('0x19')](_0xf0e3ff)[_0x6e76('0x1a')](_0x172d1c);}};}function respondWithFilteredResult(_0x50c8f3,_0x439fb6){return function(_0x46e14d){if(_0x46e14d){var _0x77655=_0x46e14d[_0x6e76('0x1b')],_0xab70e0=_0x439fb6[_0x6e76('0x1c')],_0x356583=_0x439fb6[_0x6e76('0x1c')]+_0x439fb6[_0x6e76('0x1d')],_0x43a2e0;if(_0x356583>=_0x77655){_0x356583=_0x77655;_0x43a2e0=0xc8;}else{_0x43a2e0=0xce;}_0x50c8f3[_0x6e76('0x19')](_0x43a2e0);return _0x50c8f3[_0x6e76('0x1e')]('Content-Range',_0xab70e0+'-'+_0x356583+'/'+_0x77655)[_0x6e76('0x1a')](_0x46e14d);}return null;};}function patchUpdates(_0x30e09c){return function(_0x3766a5){try{jsonpatch[_0x6e76('0x1f')](_0x3766a5,_0x30e09c,!![]);}catch(_0x37d560){return BPromise[_0x6e76('0x20')](_0x37d560);}return _0x3766a5[_0x6e76('0x21')]();};}function saveUpdates(_0x216462,_0x455a44){return function(_0x571fe0){if(_0x571fe0){return _0x571fe0['update'](_0x216462)[_0x6e76('0x22')](function(_0x482684){return _0x482684;});}return null;};}function removeEntity(_0x2b0bb2,_0x2c32e2){return function(_0x350a22){if(_0x350a22){return _0x350a22[_0x6e76('0x23')]()[_0x6e76('0x22')](function(){_0x2b0bb2[_0x6e76('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x368f24,_0xacc97c){return function(_0x16aca9){if(!_0x16aca9){_0x368f24[_0x6e76('0x18')](0x194);}return _0x16aca9;};}function handleError(_0x33e259,_0xdd00e4){_0xdd00e4=_0xdd00e4||0x1f4;return function(_0x4f0e69){logger[_0x6e76('0x24')](_0x4f0e69['stack']);if(_0x4f0e69[_0x6e76('0x25')]){delete _0x4f0e69['name'];}_0x33e259[_0x6e76('0x19')](_0xdd00e4)[_0x6e76('0x26')](_0x4f0e69);};}exports[_0x6e76('0x27')]=function(_0x491fc7,_0x1cce70){var _0x409760={},_0x517313={},_0x418d99={'count':0x0,'rows':[]};var _0xa98b63=db['MailTransferReport'][_0x6e76('0x28')];_0x517313['model']=_[_0x6e76('0x29')](_0xa98b63);_0x517313[_0x6e76('0x2a')]=_[_0x6e76('0x29')](_0x491fc7[_0x6e76('0x2a')]);_0x517313[_0x6e76('0x2b')]=_['intersection'](_0x517313[_0x6e76('0x2c')],_0x517313['query']);_0x409760['attributes']=_[_0x6e76('0x2d')](_0x517313['model'],qs[_0x6e76('0x2e')](_0x491fc7['query'][_0x6e76('0x2e')]));_0x409760[_0x6e76('0x2f')]=_0x409760[_0x6e76('0x2f')]['length']?_0x409760[_0x6e76('0x2f')]:_0x517313[_0x6e76('0x2c')];if(!_0x491fc7[_0x6e76('0x2a')]['hasOwnProperty'](_0x6e76('0x30'))){_0x409760[_0x6e76('0x1d')]=qs[_0x6e76('0x1d')](_0x491fc7[_0x6e76('0x2a')][_0x6e76('0x1d')]);_0x409760[_0x6e76('0x1c')]=qs[_0x6e76('0x1c')](_0x491fc7['query'][_0x6e76('0x1c')]);}_0x409760[_0x6e76('0x31')]=qs['sort'](_0x491fc7[_0x6e76('0x2a')][_0x6e76('0x32')]);_0x409760['where']=qs[_0x6e76('0x2b')](_[_0x6e76('0x33')](_0x491fc7[_0x6e76('0x2a')],_0x517313[_0x6e76('0x2b')]));if(_0x491fc7[_0x6e76('0x2a')]['filter']){_0x409760[_0x6e76('0x34')]=_[_0x6e76('0x35')](_0x409760[_0x6e76('0x34')],{'$or':_[_0x6e76('0x36')](_0xa98b63,function(_0x13e3a5){if(_0x13e3a5[_0x6e76('0x37')][_0x6e76('0x38')]!==_0x6e76('0x39')){var _0x12faca={};_0x12faca[_0x13e3a5[_0x6e76('0x3a')]]={'$like':'%'+_0x491fc7[_0x6e76('0x2a')]['filter']+'%'};return _0x12faca;}})});}_0x409760=_[_0x6e76('0x35')]({},_0x409760,_0x491fc7[_0x6e76('0x3b')]);var _0x2b049a={'where':_0x409760[_0x6e76('0x34')]};return db[_0x6e76('0x3c')][_0x6e76('0x1b')](_0x2b049a)['then'](function(_0x36f3ec){_0x418d99[_0x6e76('0x1b')]=_0x36f3ec;if(_0x491fc7['query'][_0x6e76('0x3d')]){_0x409760[_0x6e76('0x3e')]=[{'all':!![]}];}return db[_0x6e76('0x3c')]['findAll'](_0x409760);})[_0x6e76('0x22')](function(_0x186b85){_0x418d99['rows']=_0x186b85;return _0x418d99;})[_0x6e76('0x22')](respondWithFilteredResult(_0x1cce70,_0x409760))[_0x6e76('0x3f')](handleError(_0x1cce70,null));};exports[_0x6e76('0x40')]=function(_0x5368f0,_0x285800){var _0x5d039b={'raw':!![],'where':{'id':_0x5368f0['params']['id']}},_0x24a51d={};_0x24a51d['model']=_[_0x6e76('0x29')](db[_0x6e76('0x3c')][_0x6e76('0x28')]);_0x24a51d['query']=_['keys'](_0x5368f0[_0x6e76('0x2a')]);_0x24a51d[_0x6e76('0x2b')]=_['intersection'](_0x24a51d['model'],_0x24a51d[_0x6e76('0x2a')]);_0x5d039b['attributes']=_[_0x6e76('0x2d')](_0x24a51d[_0x6e76('0x2c')],qs[_0x6e76('0x2e')](_0x5368f0[_0x6e76('0x2a')][_0x6e76('0x2e')]));_0x5d039b['attributes']=_0x5d039b['attributes'][_0x6e76('0x41')]?_0x5d039b[_0x6e76('0x2f')]:_0x24a51d['model'];if(_0x5368f0[_0x6e76('0x2a')][_0x6e76('0x3d')]){_0x5d039b[_0x6e76('0x3e')]=[{'all':!![]}];}_0x5d039b=_[_0x6e76('0x35')]({},_0x5d039b,_0x5368f0['options']);return db['MailTransferReport'][_0x6e76('0x42')](_0x5d039b)[_0x6e76('0x22')](handleEntityNotFound(_0x285800,null))['then'](respondWithResult(_0x285800,null))[_0x6e76('0x3f')](handleError(_0x285800,null));};exports[_0x6e76('0x43')]=function(_0x471b61,_0x537832){return db[_0x6e76('0x3c')][_0x6e76('0x43')](_0x471b61[_0x6e76('0x44')],{})[_0x6e76('0x22')](respondWithResult(_0x537832,0xc9))['catch'](handleError(_0x537832,null));};exports[_0x6e76('0x45')]=function(_0x801ed4,_0x453f12){if(_0x801ed4[_0x6e76('0x44')]['id']){delete _0x801ed4['body']['id'];}return db[_0x6e76('0x3c')]['find']({'where':{'id':_0x801ed4['params']['id']}})[_0x6e76('0x22')](handleEntityNotFound(_0x453f12,null))[_0x6e76('0x22')](saveUpdates(_0x801ed4[_0x6e76('0x44')],null))[_0x6e76('0x22')](respondWithResult(_0x453f12,null))[_0x6e76('0x3f')](handleError(_0x453f12,null));};exports[_0x6e76('0x23')]=function(_0x519326,_0x14f059){return db[_0x6e76('0x3c')][_0x6e76('0x42')]({'where':{'id':_0x519326[_0x6e76('0x46')]['id']}})[_0x6e76('0x22')](handleEntityNotFound(_0x14f059,null))['then'](removeEntity(_0x14f059,null))['catch'](handleError(_0x14f059,null));};exports[_0x6e76('0x47')]=function(_0x40904c,_0x593d9a){return db[_0x6e76('0x3c')][_0x6e76('0x47')]()[_0x6e76('0x22')](respondWithResult(_0x593d9a,null))[_0x6e76('0x3f')](handleError(_0x593d9a,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index d927583..c4e3f26 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 _0xeda8=['path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','report_mail_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise'];(function(_0x329905,_0x13c144){var _0x3aa42=function(_0x2fac43){while(--_0x2fac43){_0x329905['push'](_0x329905['shift']());}};_0x3aa42(++_0x13c144);}(_0xeda8,0x104));var _0x8eda=function(_0x22d4fa,_0x15daf7){_0x22d4fa=_0x22d4fa-0x0;var _0x560a4a=_0xeda8[_0x22d4fa];return _0x560a4a;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));module[_0x8eda('0xa')]=function(_0x1f3556,_0x349361){return _0x1f3556[_0x8eda('0xb')]('MailTransferReport',attributes,{'tableName':_0x8eda('0xc'),'paranoid':![],'indexes':[{'name':_0x8eda('0xd'),'fields':[_0x8eda('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x46ed=['bluebird','path','rimraf','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','api','moment'];(function(_0x2c3c4a,_0x5652ed){var _0x573f2b=function(_0x2fff99){while(--_0x2fff99){_0x2c3c4a['push'](_0x2c3c4a['shift']());}};_0x573f2b(++_0x5652ed);}(_0x46ed,0x168));var _0xd46e=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x46ed[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var logger=require('../../config/logger')(_0xd46e('0x2'));var moment=require(_0xd46e('0x3'));var BPromise=require(_0xd46e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd46e('0x5'));var rimraf=require(_0xd46e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd46e('0x7'));module[_0xd46e('0x8')]=function(_0x160bcf,_0x25cf78){return _0x160bcf[_0xd46e('0x9')](_0xd46e('0xa'),attributes,{'tableName':_0xd46e('0xb'),'paranoid':![],'indexes':[{'name':_0xd46e('0xc'),'fields':[_0xd46e('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 fbcdba5..e5015fc 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 _0xf010=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x402ec6,_0x212f99){var _0x3cfce1=function(_0x373125){while(--_0x373125){_0x402ec6['push'](_0x402ec6['shift']());}};_0x3cfce1(++_0x212f99);}(_0xf010,0x160));var _0x0f01=function(_0x410c30,_0x3ad860){_0x410c30=_0x410c30-0x0;var _0x58ec00=_0xf010[_0x410c30];return _0x58ec00;};'use strict';var _=require(_0x0f01('0x0'));var util=require(_0x0f01('0x1'));var moment=require(_0x0f01('0x2'));var BPromise=require(_0x0f01('0x3'));var rs=require(_0x0f01('0x4'));var fs=require('fs');var Redis=require(_0x0f01('0x5'));var db=require(_0x0f01('0x6'))['db'];var utils=require(_0x0f01('0x7'));var logger=require(_0x0f01('0x8'))(_0x0f01('0x9'));var config=require(_0x0f01('0xa'));var jayson=require(_0x0f01('0xb'));var client=jayson[_0x0f01('0xc')][_0x0f01('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1a481c,_0x3b92e0,_0x2fcef3){return new BPromise(function(_0x568b21,_0x382b62){return client[_0x0f01('0xe')](_0x1a481c,_0x2fcef3)[_0x0f01('0xf')](function(_0xc81533){logger[_0x0f01('0x10')](_0x0f01('0x11'),_0x3b92e0,_0x0f01('0x12'));logger[_0x0f01('0x13')](_0x0f01('0x14'),_0x3b92e0,_0x0f01('0x12'),JSON[_0x0f01('0x15')](_0xc81533));if(_0xc81533[_0x0f01('0x16')]){if(_0xc81533[_0x0f01('0x16')][_0x0f01('0x17')]===0x1f4){logger[_0x0f01('0x16')](_0x0f01('0x11'),_0x3b92e0,_0xc81533[_0x0f01('0x16')]['message']);return _0x382b62(_0xc81533[_0x0f01('0x16')][_0x0f01('0x18')]);}logger[_0x0f01('0x16')]('MailTransferReport,\x20%s,\x20%s',_0x3b92e0,_0xc81533['error']['message']);return _0x568b21(_0xc81533['error'][_0x0f01('0x18')]);}else{logger['info'](_0x0f01('0x11'),_0x3b92e0,_0x0f01('0x12'));_0x568b21(_0xc81533[_0x0f01('0x19')]['message']);}})[_0x0f01('0x1a')](function(_0x5d0730){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x3b92e0,_0x5d0730);_0x382b62(_0x5d0730);});});} \ No newline at end of file +var _0xd63c=['ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','then','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','MailTransferReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring'];(function(_0x55b30f,_0x12acbc){var _0x12b7b0=function(_0x5d4a1d){while(--_0x5d4a1d){_0x55b30f['push'](_0x55b30f['shift']());}};_0x12b7b0(++_0x12acbc);}(_0xd63c,0xce));var _0xcd63=function(_0x5acaea,_0x442cb0){_0x5acaea=_0x5acaea-0x0;var _0x509dfa=_0xd63c[_0x5acaea];return _0x509dfa;};'use strict';var _=require(_0xcd63('0x0'));var util=require(_0xcd63('0x1'));var moment=require('moment');var BPromise=require(_0xcd63('0x2'));var rs=require(_0xcd63('0x3'));var fs=require('fs');var Redis=require(_0xcd63('0x4'));var db=require(_0xcd63('0x5'))['db'];var utils=require(_0xcd63('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xcd63('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcd63('0x8')][_0xcd63('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d04f9,_0x219b9b,_0x16858a){return new BPromise(function(_0x3d1980,_0x11aa03){return client['request'](_0x3d04f9,_0x16858a)[_0xcd63('0xa')](function(_0xd91b18){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x219b9b,'request\x20sent');logger[_0xcd63('0xb')](_0xcd63('0xc'),_0x219b9b,_0xcd63('0xd'),JSON[_0xcd63('0xe')](_0xd91b18));if(_0xd91b18[_0xcd63('0xf')]){if(_0xd91b18[_0xcd63('0xf')][_0xcd63('0x10')]===0x1f4){logger[_0xcd63('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x219b9b,_0xd91b18[_0xcd63('0xf')][_0xcd63('0x11')]);return _0x11aa03(_0xd91b18[_0xcd63('0xf')][_0xcd63('0x11')]);}logger[_0xcd63('0xf')](_0xcd63('0x12'),_0x219b9b,_0xd91b18[_0xcd63('0xf')][_0xcd63('0x11')]);return _0x3d1980(_0xd91b18[_0xcd63('0xf')][_0xcd63('0x11')]);}else{logger['info'](_0xcd63('0x12'),_0x219b9b,'request\x20sent');_0x3d1980(_0xd91b18[_0xcd63('0x13')][_0xcd63('0x11')]);}})[_0xcd63('0x14')](function(_0x5d1bde){logger['error'](_0xcd63('0x12'),_0x219b9b,_0x5d1bde);_0x11aa03(_0x5d1bde);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 0cf7cdc..99695b9 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 _0xbcf4=['destroy','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','describe','show','create','put','/:id','delete'];(function(_0xbede54,_0x2b0c78){var _0x4a5dea=function(_0x3c7612){while(--_0x3c7612){_0xbede54['push'](_0xbede54['shift']());}};_0x4a5dea(++_0x2b0c78);}(_0xbcf4,0x133));var _0x4bcf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcf4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x4bcf('0x0'));var path=require(_0x4bcf('0x1'));var timeout=require(_0x4bcf('0x2'));var express=require('express');var router=express[_0x4bcf('0x3')]();var auth=require(_0x4bcf('0x4'));var interaction=require(_0x4bcf('0x5'));var config=require(_0x4bcf('0x6'));var controller=require('./memberReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4bcf('0x7')]);router[_0x4bcf('0x8')]('/describe',auth[_0x4bcf('0x9')](),controller[_0x4bcf('0xa')]);router[_0x4bcf('0x8')]('/:id',auth[_0x4bcf('0x9')](),controller[_0x4bcf('0xb')]);router['post']('/',auth[_0x4bcf('0x9')](),controller[_0x4bcf('0xc')]);router[_0x4bcf('0xd')](_0x4bcf('0xe'),auth[_0x4bcf('0x9')](),controller['update']);router[_0x4bcf('0xf')](_0x4bcf('0xe'),auth['isAuthenticated'](),controller[_0x4bcf('0x10')]);module['exports']=router; \ No newline at end of file +var _0x1b4f=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x53cbfb,_0x169728){var _0x3f8e88=function(_0x353879){while(--_0x353879){_0x53cbfb['push'](_0x53cbfb['shift']());}};_0x3f8e88(++_0x169728);}(_0x1b4f,0x1c8));var _0xf1b4=function(_0xcb4620,_0x5d1a3c){_0xcb4620=_0xcb4620-0x0;var _0x19ae97=_0x1b4f[_0xcb4620];return _0x19ae97;};'use strict';var multer=require(_0xf1b4('0x0'));var util=require(_0xf1b4('0x1'));var path=require(_0xf1b4('0x2'));var timeout=require(_0xf1b4('0x3'));var express=require(_0xf1b4('0x4'));var router=express['Router']();var auth=require(_0xf1b4('0x5'));var interaction=require(_0xf1b4('0x6'));var config=require(_0xf1b4('0x7'));var controller=require(_0xf1b4('0x8'));router[_0xf1b4('0x9')]('/',auth[_0xf1b4('0xa')](),controller[_0xf1b4('0xb')]);router[_0xf1b4('0x9')](_0xf1b4('0xc'),auth[_0xf1b4('0xa')](),controller['describe']);router[_0xf1b4('0x9')](_0xf1b4('0xd'),auth[_0xf1b4('0xa')](),controller[_0xf1b4('0xe')]);router['post']('/',auth[_0xf1b4('0xa')](),controller[_0xf1b4('0xf')]);router['put'](_0xf1b4('0xd'),auth[_0xf1b4('0xa')](),controller[_0xf1b4('0x10')]);router[_0xf1b4('0x11')](_0xf1b4('0xd'),auth[_0xf1b4('0xa')](),controller[_0xf1b4('0x12')]);module[_0xf1b4('0x13')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 36442f9..47ada06 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 _0xde32=['DATE','getDataValue','seconds','setDataValue','exitAt','duration','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER'];(function(_0x2cb4b0,_0x2c27a3){var _0x49ee31=function(_0x52c482){while(--_0x52c482){_0x2cb4b0['push'](_0x2cb4b0['shift']());}};_0x49ee31(++_0x2c27a3);}(_0xde32,0x189));var _0x2de3=function(_0x21068f,_0x3a9b2f){_0x21068f=_0x21068f-0x0;var _0x265f2e=_0xde32[_0x21068f];return _0x265f2e;};'use strict';var Sequelize=require(_0x2de3('0x0'));var moment=require(_0x2de3('0x1'));module[_0x2de3('0x2')]={'channel':{'type':Sequelize[_0x2de3('0x3')]},'membername':{'type':Sequelize[_0x2de3('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2de3('0x3')],'defaultValue':_0x2de3('0x4'),'comment':_0x2de3('0x5')},'duration':{'type':Sequelize[_0x2de3('0x6')]},'enterAt':{'type':Sequelize[_0x2de3('0x7')]},'exitAt':{'type':Sequelize[_0x2de3('0x7')],'set':function(_0x3116c6){var _0x53927a=moment(_0x3116c6);var _0x9d86c=moment(this[_0x2de3('0x8')]('enterAt'));var _0x406f5a=_0x53927a['diff'](_0x9d86c,_0x2de3('0x9'));this[_0x2de3('0xa')](_0x2de3('0xb'),_0x3116c6);this[_0x2de3('0xa')](_0x2de3('0xc'),_0x406f5a||null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x2de3('0x3')],'comment':_0x2de3('0xd')},'data3':{'type':Sequelize[_0x2de3('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':_0x2de3('0xe')},'data5':{'type':Sequelize[_0x2de3('0x3')],'comment':_0x2de3('0xf')},'role':{'type':Sequelize[_0x2de3('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x2de3('0x3')]}}; \ No newline at end of file +var _0x9853=['talk:[start]','sequelize','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]'];(function(_0x4ec8fd,_0x209c48){var _0x3fc425=function(_0x249e4d){while(--_0x249e4d){_0x4ec8fd['push'](_0x4ec8fd['shift']());}};_0x3fc425(++_0x209c48);}(_0x9853,0x71));var _0x3985=function(_0x3ee55a,_0x19aeea){_0x3ee55a=_0x3ee55a-0x0;var _0x581800=_0x9853[_0x3ee55a];return _0x581800;};'use strict';var Sequelize=require(_0x3985('0x0'));var moment=require('moment');module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x3985('0x1')]},'type':{'type':Sequelize[_0x3985('0x1')],'defaultValue':_0x3985('0x2'),'comment':_0x3985('0x3')},'duration':{'type':Sequelize[_0x3985('0x4')]},'enterAt':{'type':Sequelize[_0x3985('0x5')]},'exitAt':{'type':Sequelize[_0x3985('0x5')],'set':function(_0x200ad7){var _0x5b07a7=moment(_0x200ad7);var _0x3225ef=moment(this[_0x3985('0x6')](_0x3985('0x7')));var _0x4432a0=_0x5b07a7['diff'](_0x3225ef,_0x3985('0x8'));this[_0x3985('0x9')](_0x3985('0xa'),_0x200ad7);this['setDataValue'](_0x3985('0xb'),_0x4432a0||null);}},'data1':{'type':Sequelize[_0x3985('0x1')],'comment':_0x3985('0xc')},'data2':{'type':Sequelize[_0x3985('0x1')],'comment':_0x3985('0xd')},'data3':{'type':Sequelize[_0x3985('0x1')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x3985('0x1')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x3985('0x1')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x3985('0x4')]},'uniqueid':{'type':Sequelize[_0x3985('0x1')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index ef8e54d..81d9314 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 _0x5fc3=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','create','body','find','describe','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','sendStatus','end','status','count','offset','limit','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','index','MemberReport','model','keys','query','filters','intersection','attributes','fields'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1064bc,_0x206f12){_0x1064bc=_0x1064bc-0x0;var _0x5edc45=_0x5fc3[_0x1064bc];return _0x5edc45;};'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'];function respondWithStatusCode(_0x1a9f2b,_0x5469f5){_0x5469f5=_0x5469f5||0xcc;return function(_0x4cbe74){if(_0x4cbe74){return _0x1a9f2b[_0x35fc('0x17')](_0x5469f5);}return _0x1a9f2b['status'](_0x5469f5)[_0x35fc('0x18')]();};}function respondWithResult(_0x22055e,_0x2a6ad2){_0x2a6ad2=_0x2a6ad2||0xc8;return function(_0x29730f){if(_0x29730f){return _0x22055e[_0x35fc('0x19')](_0x2a6ad2)['json'](_0x29730f);}};}function respondWithFilteredResult(_0x59507a,_0x5eac0f){return function(_0x558364){if(_0x558364){var _0x398b67=_0x558364[_0x35fc('0x1a')],_0x229d56=_0x5eac0f[_0x35fc('0x1b')],_0x53b898=_0x5eac0f['offset']+_0x5eac0f[_0x35fc('0x1c')],_0x154958;if(_0x53b898>=_0x398b67){_0x53b898=_0x398b67;_0x154958=0xc8;}else{_0x154958=0xce;}_0x59507a[_0x35fc('0x19')](_0x154958);return _0x59507a['set'](_0x35fc('0x1d'),_0x229d56+'-'+_0x53b898+'/'+_0x398b67)[_0x35fc('0x1e')](_0x558364);}return null;};}function patchUpdates(_0x2e513b){return function(_0x5f56c6){try{jsonpatch[_0x35fc('0x1f')](_0x5f56c6,_0x2e513b,!![]);}catch(_0x3c58ea){return BPromise[_0x35fc('0x20')](_0x3c58ea);}return _0x5f56c6['save']();};}function saveUpdates(_0x402cff,_0x350a27){return function(_0x3229d1){if(_0x3229d1){return _0x3229d1[_0x35fc('0x21')](_0x402cff)[_0x35fc('0x22')](function(_0x21f1a9){return _0x21f1a9;});}return null;};}function removeEntity(_0x155016,_0x3b05b0){return function(_0x2405e8){if(_0x2405e8){return _0x2405e8[_0x35fc('0x23')]()['then'](function(){_0x155016[_0x35fc('0x19')](0xcc)[_0x35fc('0x18')]();});}};}function handleEntityNotFound(_0x257719,_0x2d8183){return function(_0x3b4743){if(!_0x3b4743){_0x257719['sendStatus'](0x194);}return _0x3b4743;};}function handleError(_0x33f5e8,_0x4c587a){_0x4c587a=_0x4c587a||0x1f4;return function(_0x561bf8){logger[_0x35fc('0x24')](_0x561bf8[_0x35fc('0x25')]);if(_0x561bf8[_0x35fc('0x26')]){delete _0x561bf8['name'];}_0x33f5e8[_0x35fc('0x19')](_0x4c587a)['send'](_0x561bf8);};}exports[_0x35fc('0x27')]=function(_0xdfab9f,_0x5cb986){var _0x519264={},_0x47774c={},_0x58edb6={'count':0x0,'rows':[]};var _0x274208=db[_0x35fc('0x28')]['rawAttributes'];_0x47774c[_0x35fc('0x29')]=_[_0x35fc('0x2a')](_0x274208);_0x47774c[_0x35fc('0x2b')]=_[_0x35fc('0x2a')](_0xdfab9f[_0x35fc('0x2b')]);_0x47774c[_0x35fc('0x2c')]=_[_0x35fc('0x2d')](_0x47774c[_0x35fc('0x29')],_0x47774c['query']);_0x519264[_0x35fc('0x2e')]=_[_0x35fc('0x2d')](_0x47774c[_0x35fc('0x29')],qs['fields'](_0xdfab9f[_0x35fc('0x2b')][_0x35fc('0x2f')]));_0x519264[_0x35fc('0x2e')]=_0x519264[_0x35fc('0x2e')][_0x35fc('0x30')]?_0x519264[_0x35fc('0x2e')]:_0x47774c[_0x35fc('0x29')];if(!_0xdfab9f[_0x35fc('0x2b')][_0x35fc('0x31')](_0x35fc('0x32'))){_0x519264['limit']=qs['limit'](_0xdfab9f[_0x35fc('0x2b')]['limit']);_0x519264[_0x35fc('0x1b')]=qs[_0x35fc('0x1b')](_0xdfab9f[_0x35fc('0x2b')][_0x35fc('0x1b')]);}_0x519264[_0x35fc('0x33')]=qs[_0x35fc('0x34')](_0xdfab9f['query'][_0x35fc('0x34')]);_0x519264[_0x35fc('0x35')]=qs[_0x35fc('0x2c')](_[_0x35fc('0x36')](_0xdfab9f[_0x35fc('0x2b')],_0x47774c[_0x35fc('0x2c')]));if(_0xdfab9f['query'][_0x35fc('0x37')]){_0x519264[_0x35fc('0x35')]=_[_0x35fc('0x38')](_0x519264['where'],{'$or':_[_0x35fc('0x39')](_0x274208,function(_0x48d223){if(_0x48d223[_0x35fc('0x3a')][_0x35fc('0x3b')]!==_0x35fc('0x3c')){var _0x2e00e3={};_0x2e00e3[_0x48d223['field']]={'$like':'%'+_0xdfab9f['query']['filter']+'%'};return _0x2e00e3;}})});}_0x519264=_[_0x35fc('0x38')]({},_0x519264,_0xdfab9f['options']);var _0x20f8bb={'where':_0x519264['where']};return db[_0x35fc('0x28')][_0x35fc('0x1a')](_0x20f8bb)[_0x35fc('0x22')](function(_0x22b724){_0x58edb6[_0x35fc('0x1a')]=_0x22b724;if(_0xdfab9f[_0x35fc('0x2b')][_0x35fc('0x3d')]){_0x519264['include']=[{'all':!![]}];}return db[_0x35fc('0x28')][_0x35fc('0x3e')](_0x519264);})['then'](function(_0x1feda5){_0x58edb6[_0x35fc('0x3f')]=_0x1feda5;return _0x58edb6;})[_0x35fc('0x22')](respondWithFilteredResult(_0x5cb986,_0x519264))[_0x35fc('0x40')](handleError(_0x5cb986,null));};exports[_0x35fc('0x41')]=function(_0x31d926,_0x58f25c){var _0x3f6480={'raw':!![],'where':{'id':_0x31d926[_0x35fc('0x42')]['id']}},_0x267858={};_0x267858['model']=_[_0x35fc('0x2a')](db[_0x35fc('0x28')]['rawAttributes']);_0x267858[_0x35fc('0x2b')]=_[_0x35fc('0x2a')](_0x31d926[_0x35fc('0x2b')]);_0x267858[_0x35fc('0x2c')]=_[_0x35fc('0x2d')](_0x267858[_0x35fc('0x29')],_0x267858[_0x35fc('0x2b')]);_0x3f6480[_0x35fc('0x2e')]=_['intersection'](_0x267858['model'],qs[_0x35fc('0x2f')](_0x31d926[_0x35fc('0x2b')]['fields']));_0x3f6480['attributes']=_0x3f6480['attributes'][_0x35fc('0x30')]?_0x3f6480[_0x35fc('0x2e')]:_0x267858['model'];if(_0x31d926[_0x35fc('0x2b')][_0x35fc('0x3d')]){_0x3f6480[_0x35fc('0x43')]=[{'all':!![]}];}_0x3f6480=_[_0x35fc('0x38')]({},_0x3f6480,_0x31d926['options']);return db['MemberReport']['find'](_0x3f6480)['then'](handleEntityNotFound(_0x58f25c,null))['then'](respondWithResult(_0x58f25c,null))[_0x35fc('0x40')](handleError(_0x58f25c,null));};exports[_0x35fc('0x44')]=function(_0x4fc5bc,_0x119925){return db['MemberReport'][_0x35fc('0x44')](_0x4fc5bc[_0x35fc('0x45')],{})[_0x35fc('0x22')](respondWithResult(_0x119925,0xc9))[_0x35fc('0x40')](handleError(_0x119925,null));};exports[_0x35fc('0x21')]=function(_0x5d3d0f,_0x64d381){if(_0x5d3d0f[_0x35fc('0x45')]['id']){delete _0x5d3d0f['body']['id'];}return db[_0x35fc('0x28')][_0x35fc('0x46')]({'where':{'id':_0x5d3d0f[_0x35fc('0x42')]['id']}})[_0x35fc('0x22')](handleEntityNotFound(_0x64d381,null))['then'](saveUpdates(_0x5d3d0f[_0x35fc('0x45')],null))['then'](respondWithResult(_0x64d381,null))['catch'](handleError(_0x64d381,null));};exports[_0x35fc('0x23')]=function(_0x9db7e8,_0x18dc78){return db[_0x35fc('0x28')][_0x35fc('0x46')]({'where':{'id':_0x9db7e8[_0x35fc('0x42')]['id']}})[_0x35fc('0x22')](handleEntityNotFound(_0x18dc78,null))[_0x35fc('0x22')](removeEntity(_0x18dc78,null))['catch'](handleError(_0x18dc78,null));};exports[_0x35fc('0x47')]=function(_0x91d7c0,_0xeca02e){return db[_0x35fc('0x28')][_0x35fc('0x47')]()[_0x35fc('0x22')](respondWithResult(_0xeca02e,null))[_0x35fc('0x40')](handleError(_0xeca02e,null));}; \ No newline at end of file +var _0x9a3d=['length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','map','type','key','VIRTUAL','field','merge','options','findAll','catch','show','params','includeAll','include','create','body','find','describe','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','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','apply','reject','save','update','then','destroy','error','stack','name','send','index','MemberReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields'];(function(_0x5c4efc,_0xf7baa4){var _0x3e003c=function(_0x162adb){while(--_0x162adb){_0x5c4efc['push'](_0x5c4efc['shift']());}};_0x3e003c(++_0xf7baa4);}(_0x9a3d,0x14e));var _0xd9a3=function(_0x4dcd93,_0x4112ae){_0x4dcd93=_0x4dcd93-0x0;var _0x2a6ecd=_0x9a3d[_0x4dcd93];return _0x2a6ecd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd9a3('0x0'));var rimraf=require(_0xd9a3('0x1'));var zipdir=require(_0xd9a3('0x2'));var jsonpatch=require(_0xd9a3('0x3'));var rp=require(_0xd9a3('0x4'));var moment=require(_0xd9a3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd9a3('0x6'));var util=require(_0xd9a3('0x7'));var path=require(_0xd9a3('0x8'));var sox=require(_0xd9a3('0x9'));var csv=require('to-csv');var ejs=require(_0xd9a3('0xa'));var fs=require('fs');var _=require(_0xd9a3('0xb'));var squel=require(_0xd9a3('0xc'));var crypto=require(_0xd9a3('0xd'));var jsforce=require(_0xd9a3('0xe'));var deskjs=require(_0xd9a3('0xf'));var toCsv=require(_0xd9a3('0x10'));var querystring=require(_0xd9a3('0x11'));var Papa=require('papaparse');var Redis=require(_0xd9a3('0x12'));var authService=require(_0xd9a3('0x13'));var qs=require(_0xd9a3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd9a3('0x15'))(_0xd9a3('0x16'));var utils=require('../../config/utils');var config=require(_0xd9a3('0x17'));var db=require(_0xd9a3('0x18'))['db'];function respondWithStatusCode(_0x250e84,_0x2c85f9){_0x2c85f9=_0x2c85f9||0xcc;return function(_0x3af3d2){if(_0x3af3d2){return _0x250e84[_0xd9a3('0x19')](_0x2c85f9);}return _0x250e84[_0xd9a3('0x1a')](_0x2c85f9)[_0xd9a3('0x1b')]();};}function respondWithResult(_0x508a93,_0x139e66){_0x139e66=_0x139e66||0xc8;return function(_0x26605e){if(_0x26605e){return _0x508a93[_0xd9a3('0x1a')](_0x139e66)[_0xd9a3('0x1c')](_0x26605e);}};}function respondWithFilteredResult(_0x34908b,_0x320522){return function(_0x246aaf){if(_0x246aaf){var _0x521ebe=_0x246aaf[_0xd9a3('0x1d')],_0x2f497a=_0x320522['offset'],_0x5107ee=_0x320522['offset']+_0x320522[_0xd9a3('0x1e')],_0x5ab52d;if(_0x5107ee>=_0x521ebe){_0x5107ee=_0x521ebe;_0x5ab52d=0xc8;}else{_0x5ab52d=0xce;}_0x34908b[_0xd9a3('0x1a')](_0x5ab52d);return _0x34908b['set']('Content-Range',_0x2f497a+'-'+_0x5107ee+'/'+_0x521ebe)['json'](_0x246aaf);}return null;};}function patchUpdates(_0x4a6901){return function(_0x54c7f9){try{jsonpatch[_0xd9a3('0x1f')](_0x54c7f9,_0x4a6901,!![]);}catch(_0x5bee91){return BPromise[_0xd9a3('0x20')](_0x5bee91);}return _0x54c7f9[_0xd9a3('0x21')]();};}function saveUpdates(_0x4eca09,_0x136610){return function(_0x12674f){if(_0x12674f){return _0x12674f[_0xd9a3('0x22')](_0x4eca09)[_0xd9a3('0x23')](function(_0x2c2611){return _0x2c2611;});}return null;};}function removeEntity(_0xdbe06f,_0x14bafc){return function(_0x59fee8){if(_0x59fee8){return _0x59fee8[_0xd9a3('0x24')]()[_0xd9a3('0x23')](function(){_0xdbe06f[_0xd9a3('0x1a')](0xcc)[_0xd9a3('0x1b')]();});}};}function handleEntityNotFound(_0x60818e,_0x3d562a){return function(_0x51c6d8){if(!_0x51c6d8){_0x60818e[_0xd9a3('0x19')](0x194);}return _0x51c6d8;};}function handleError(_0x138aaa,_0x23d1fc){_0x23d1fc=_0x23d1fc||0x1f4;return function(_0x20022e){logger[_0xd9a3('0x25')](_0x20022e[_0xd9a3('0x26')]);if(_0x20022e[_0xd9a3('0x27')]){delete _0x20022e[_0xd9a3('0x27')];}_0x138aaa['status'](_0x23d1fc)[_0xd9a3('0x28')](_0x20022e);};}exports[_0xd9a3('0x29')]=function(_0x1eb769,_0x58ea92){var _0x2e0c3e={},_0x4c57fa={},_0x41369e={'count':0x0,'rows':[]};var _0x3c7673=db[_0xd9a3('0x2a')][_0xd9a3('0x2b')];_0x4c57fa[_0xd9a3('0x2c')]=_[_0xd9a3('0x2d')](_0x3c7673);_0x4c57fa[_0xd9a3('0x2e')]=_[_0xd9a3('0x2d')](_0x1eb769['query']);_0x4c57fa[_0xd9a3('0x2f')]=_[_0xd9a3('0x30')](_0x4c57fa[_0xd9a3('0x2c')],_0x4c57fa['query']);_0x2e0c3e[_0xd9a3('0x31')]=_[_0xd9a3('0x30')](_0x4c57fa['model'],qs['fields'](_0x1eb769[_0xd9a3('0x2e')][_0xd9a3('0x32')]));_0x2e0c3e[_0xd9a3('0x31')]=_0x2e0c3e['attributes'][_0xd9a3('0x33')]?_0x2e0c3e[_0xd9a3('0x31')]:_0x4c57fa[_0xd9a3('0x2c')];if(!_0x1eb769[_0xd9a3('0x2e')][_0xd9a3('0x34')](_0xd9a3('0x35'))){_0x2e0c3e['limit']=qs[_0xd9a3('0x1e')](_0x1eb769[_0xd9a3('0x2e')][_0xd9a3('0x1e')]);_0x2e0c3e[_0xd9a3('0x36')]=qs[_0xd9a3('0x36')](_0x1eb769[_0xd9a3('0x2e')]['offset']);}_0x2e0c3e[_0xd9a3('0x37')]=qs[_0xd9a3('0x38')](_0x1eb769['query']['sort']);_0x2e0c3e['where']=qs[_0xd9a3('0x2f')](_[_0xd9a3('0x39')](_0x1eb769['query'],_0x4c57fa['filters']));if(_0x1eb769['query'][_0xd9a3('0x3a')]){_0x2e0c3e[_0xd9a3('0x3b')]=_['merge'](_0x2e0c3e[_0xd9a3('0x3b')],{'$or':_[_0xd9a3('0x3c')](_0x3c7673,function(_0x19d3a4){if(_0x19d3a4[_0xd9a3('0x3d')][_0xd9a3('0x3e')]!==_0xd9a3('0x3f')){var _0x383c72={};_0x383c72[_0x19d3a4[_0xd9a3('0x40')]]={'$like':'%'+_0x1eb769[_0xd9a3('0x2e')]['filter']+'%'};return _0x383c72;}})});}_0x2e0c3e=_[_0xd9a3('0x41')]({},_0x2e0c3e,_0x1eb769[_0xd9a3('0x42')]);var _0x7c4ba0={'where':_0x2e0c3e[_0xd9a3('0x3b')]};return db[_0xd9a3('0x2a')][_0xd9a3('0x1d')](_0x7c4ba0)[_0xd9a3('0x23')](function(_0x3140b3){_0x41369e[_0xd9a3('0x1d')]=_0x3140b3;if(_0x1eb769[_0xd9a3('0x2e')]['includeAll']){_0x2e0c3e['include']=[{'all':!![]}];}return db[_0xd9a3('0x2a')][_0xd9a3('0x43')](_0x2e0c3e);})[_0xd9a3('0x23')](function(_0x4cab7f){_0x41369e['rows']=_0x4cab7f;return _0x41369e;})[_0xd9a3('0x23')](respondWithFilteredResult(_0x58ea92,_0x2e0c3e))[_0xd9a3('0x44')](handleError(_0x58ea92,null));};exports[_0xd9a3('0x45')]=function(_0x9e14ad,_0x542030){var _0x53caf5={'raw':!![],'where':{'id':_0x9e14ad[_0xd9a3('0x46')]['id']}},_0x449391={};_0x449391[_0xd9a3('0x2c')]=_[_0xd9a3('0x2d')](db[_0xd9a3('0x2a')][_0xd9a3('0x2b')]);_0x449391[_0xd9a3('0x2e')]=_[_0xd9a3('0x2d')](_0x9e14ad['query']);_0x449391[_0xd9a3('0x2f')]=_[_0xd9a3('0x30')](_0x449391[_0xd9a3('0x2c')],_0x449391[_0xd9a3('0x2e')]);_0x53caf5['attributes']=_[_0xd9a3('0x30')](_0x449391[_0xd9a3('0x2c')],qs[_0xd9a3('0x32')](_0x9e14ad[_0xd9a3('0x2e')][_0xd9a3('0x32')]));_0x53caf5[_0xd9a3('0x31')]=_0x53caf5[_0xd9a3('0x31')][_0xd9a3('0x33')]?_0x53caf5[_0xd9a3('0x31')]:_0x449391[_0xd9a3('0x2c')];if(_0x9e14ad[_0xd9a3('0x2e')][_0xd9a3('0x47')]){_0x53caf5[_0xd9a3('0x48')]=[{'all':!![]}];}_0x53caf5=_[_0xd9a3('0x41')]({},_0x53caf5,_0x9e14ad[_0xd9a3('0x42')]);return db[_0xd9a3('0x2a')]['find'](_0x53caf5)[_0xd9a3('0x23')](handleEntityNotFound(_0x542030,null))[_0xd9a3('0x23')](respondWithResult(_0x542030,null))[_0xd9a3('0x44')](handleError(_0x542030,null));};exports['create']=function(_0x32781f,_0x35a7b4){return db[_0xd9a3('0x2a')][_0xd9a3('0x49')](_0x32781f[_0xd9a3('0x4a')],{})[_0xd9a3('0x23')](respondWithResult(_0x35a7b4,0xc9))[_0xd9a3('0x44')](handleError(_0x35a7b4,null));};exports['update']=function(_0x5ba625,_0x430e7d){if(_0x5ba625[_0xd9a3('0x4a')]['id']){delete _0x5ba625[_0xd9a3('0x4a')]['id'];}return db[_0xd9a3('0x2a')][_0xd9a3('0x4b')]({'where':{'id':_0x5ba625[_0xd9a3('0x46')]['id']}})[_0xd9a3('0x23')](handleEntityNotFound(_0x430e7d,null))[_0xd9a3('0x23')](saveUpdates(_0x5ba625[_0xd9a3('0x4a')],null))[_0xd9a3('0x23')](respondWithResult(_0x430e7d,null))['catch'](handleError(_0x430e7d,null));};exports['destroy']=function(_0x250e34,_0x9d069c){return db[_0xd9a3('0x2a')][_0xd9a3('0x4b')]({'where':{'id':_0x250e34[_0xd9a3('0x46')]['id']}})[_0xd9a3('0x23')](handleEntityNotFound(_0x9d069c,null))['then'](removeEntity(_0x9d069c,null))[_0xd9a3('0x44')](handleError(_0x9d069c,null));};exports[_0xd9a3('0x4c')]=function(_0x15e2ce,_0x556a59){return db['MemberReport'][_0xd9a3('0x4c')]()[_0xd9a3('0x23')](respondWithResult(_0x556a59,null))['catch'](handleError(_0x556a59,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 40d397c..06097ba 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 _0x78ea=['MemberReport','report_member','interface','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','define'];(function(_0x5c30ee,_0xa51f79){var _0x52e1f5=function(_0x5b1a4a){while(--_0x5b1a4a){_0x5c30ee['push'](_0x5c30ee['shift']());}};_0x52e1f5(++_0xa51f79);}(_0x78ea,0x6b));var _0xa78e=function(_0x2b212f,_0x54f3a0){_0x2b212f=_0x2b212f-0x0;var _0x196828=_0x78ea[_0x2b212f];return _0x196828;};'use strict';var _=require(_0xa78e('0x0'));var util=require(_0xa78e('0x1'));var logger=require(_0xa78e('0x2'))(_0xa78e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa78e('0x4'));var fs=require('fs');var path=require(_0xa78e('0x5'));var rimraf=require(_0xa78e('0x6'));var config=require(_0xa78e('0x7'));var attributes=require(_0xa78e('0x8'));module['exports']=function(_0x26b566,_0x30d139){return _0x26b566[_0xa78e('0x9')](_0xa78e('0xa'),attributes,{'tableName':_0xa78e('0xb'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0xa78e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2715=['path','./memberReport.attributes','exports','define','MemberReport','report_member','membername','interface','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1c2f21,_0x2d0eb2){var _0x3c6704=function(_0x434d21){while(--_0x434d21){_0x1c2f21['push'](_0x1c2f21['shift']());}};_0x3c6704(++_0x2d0eb2);}(_0x2715,0x1ac));var _0x5271=function(_0x8760b4,_0x4a1b0a){_0x8760b4=_0x8760b4-0x0;var _0xfd4277=_0x2715[_0x8760b4];return _0xfd4277;};'use strict';var _=require(_0x5271('0x0'));var util=require(_0x5271('0x1'));var logger=require(_0x5271('0x2'))(_0x5271('0x3'));var moment=require(_0x5271('0x4'));var BPromise=require(_0x5271('0x5'));var rp=require(_0x5271('0x6'));var fs=require('fs');var path=require(_0x5271('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5271('0x8'));module[_0x5271('0x9')]=function(_0x5c7e29,_0x2836ef){return _0x5c7e29[_0x5271('0xa')](_0x5271('0xb'),attributes,{'tableName':_0x5271('0xc'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x5271('0xd'),_0x5271('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 3f40236..1763b88 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 _0xbdf2=['catch','GetMemberReport','MemberReport','findAll','raw','options','attributes','limit','include','map','model','CreateMemberReport','create','body','UpdateMemberReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MemberReport,\x20%s,\x20%s','result'];(function(_0x358806,_0x322b66){var _0x19fdcb=function(_0xe01b8d){while(--_0xe01b8d){_0x358806['push'](_0x358806['shift']());}};_0x19fdcb(++_0x322b66);}(_0xbdf2,0x119));var _0x2bdf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbdf2[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2bdf('0x0'));var util=require(_0x2bdf('0x1'));var moment=require('moment');var BPromise=require(_0x2bdf('0x2'));var rs=require(_0x2bdf('0x3'));var fs=require('fs');var Redis=require(_0x2bdf('0x4'));var db=require(_0x2bdf('0x5'))['db'];var utils=require(_0x2bdf('0x6'));var logger=require(_0x2bdf('0x7'))('rpc');var config=require(_0x2bdf('0x8'));var jayson=require(_0x2bdf('0x9'));var client=jayson[_0x2bdf('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35702f,_0x191173,_0x205634){return new BPromise(function(_0xf1d7ed,_0x5060f9){return client[_0x2bdf('0xb')](_0x35702f,_0x205634)[_0x2bdf('0xc')](function(_0x1d7842){logger[_0x2bdf('0xd')]('MemberReport,\x20%s,\x20%s',_0x191173,_0x2bdf('0xe'));logger[_0x2bdf('0xf')](_0x2bdf('0x10'),_0x191173,_0x2bdf('0xe'),JSON[_0x2bdf('0x11')](_0x1d7842));if(_0x1d7842[_0x2bdf('0x12')]){if(_0x1d7842[_0x2bdf('0x12')][_0x2bdf('0x13')]===0x1f4){logger['error']('MemberReport,\x20%s,\x20%s',_0x191173,_0x1d7842[_0x2bdf('0x12')][_0x2bdf('0x14')]);return _0x5060f9(_0x1d7842[_0x2bdf('0x12')][_0x2bdf('0x14')]);}logger[_0x2bdf('0x12')](_0x2bdf('0x15'),_0x191173,_0x1d7842[_0x2bdf('0x12')][_0x2bdf('0x14')]);return _0xf1d7ed(_0x1d7842[_0x2bdf('0x12')][_0x2bdf('0x14')]);}else{logger[_0x2bdf('0xd')](_0x2bdf('0x15'),_0x191173,_0x2bdf('0xe'));_0xf1d7ed(_0x1d7842[_0x2bdf('0x16')][_0x2bdf('0x14')]);}})[_0x2bdf('0x17')](function(_0x2be004){logger[_0x2bdf('0x12')]('MemberReport,\x20%s,\x20%s',_0x191173,_0x2be004);_0x5060f9(_0x2be004);});});}exports[_0x2bdf('0x18')]=function(_0x2b9a8a){var _0x158b4e=this;return new Promise(function(_0x60221a,_0x34fd03){return db[_0x2bdf('0x19')][_0x2bdf('0x1a')]({'raw':_0x2b9a8a['options']?_0x2b9a8a['options'][_0x2bdf('0x1b')]===undefined?!![]:![]:!![],'where':_0x2b9a8a[_0x2bdf('0x1c')]?_0x2b9a8a['options']['where']||null:null,'attributes':_0x2b9a8a[_0x2bdf('0x1c')]?_0x2b9a8a[_0x2bdf('0x1c')][_0x2bdf('0x1d')]||null:null,'limit':_0x2b9a8a[_0x2bdf('0x1c')]?_0x2b9a8a[_0x2bdf('0x1c')][_0x2bdf('0x1e')]||null:null,'include':_0x2b9a8a['options']?_0x2b9a8a['options'][_0x2bdf('0x1f')]?_[_0x2bdf('0x20')](_0x2b9a8a[_0x2bdf('0x1c')][_0x2bdf('0x1f')],function(_0x122e69){return{'model':db[_0x122e69[_0x2bdf('0x21')]],'as':_0x122e69['as'],'attributes':_0x122e69['attributes'],'include':_0x122e69[_0x2bdf('0x1f')]?_[_0x2bdf('0x20')](_0x122e69[_0x2bdf('0x1f')],function(_0x4c10e8){return{'model':db[_0x4c10e8[_0x2bdf('0x21')]],'as':_0x4c10e8['as'],'attributes':_0x4c10e8['attributes'],'include':_0x4c10e8[_0x2bdf('0x1f')]?_[_0x2bdf('0x20')](_0x4c10e8['include'],function(_0x4907a1){return{'model':db[_0x4907a1['model']],'as':_0x4907a1['as'],'attributes':_0x4907a1[_0x2bdf('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2bdf('0xc')](function(_0xfd7469){logger[_0x2bdf('0xd')]('GetMemberReport',_0x2b9a8a);logger[_0x2bdf('0xf')](_0x2bdf('0x18'),_0x2b9a8a,JSON[_0x2bdf('0x11')](_0xfd7469));_0x60221a(_0xfd7469);})[_0x2bdf('0x17')](function(_0x2cea71){logger[_0x2bdf('0x12')](_0x2bdf('0x18'),_0x2cea71[_0x2bdf('0x14')],_0x2b9a8a);_0x34fd03(_0x158b4e[_0x2bdf('0x12')](0x1f4,_0x2cea71[_0x2bdf('0x14')]));});});};exports[_0x2bdf('0x22')]=function(_0x3478ed){var _0xf85875=this;return new Promise(function(_0xaf1a1f,_0x1a1a0d){return db[_0x2bdf('0x19')][_0x2bdf('0x23')](_0x3478ed[_0x2bdf('0x24')],{'raw':_0x3478ed[_0x2bdf('0x1c')]?_0x3478ed['options']['raw']===undefined?!![]:![]:!![]})[_0x2bdf('0xc')](function(_0x551f0d){logger[_0x2bdf('0xd')](_0x2bdf('0x22'),_0x3478ed);logger[_0x2bdf('0xf')](_0x2bdf('0x22'),_0x3478ed,JSON[_0x2bdf('0x11')](_0x551f0d));_0xaf1a1f(_0x551f0d);})[_0x2bdf('0x17')](function(_0x4571b5){logger[_0x2bdf('0x12')](_0x2bdf('0x22'),_0x4571b5[_0x2bdf('0x14')],_0x3478ed);_0x1a1a0d(_0xf85875[_0x2bdf('0x12')](0x1f4,_0x4571b5[_0x2bdf('0x14')]));});});};exports['UpdateMemberReport']=function(_0x123682){var _0x13baaf=this;return new Promise(function(_0x36b2a6,_0x509d81){return db[_0x2bdf('0x19')]['update'](_0x123682['body'],{'raw':_0x123682['options']?_0x123682[_0x2bdf('0x1c')][_0x2bdf('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x123682['options']?_0x123682[_0x2bdf('0x1c')]['where']||null:null,'attributes':_0x123682['options']?_0x123682[_0x2bdf('0x1c')]['attributes']||null:null,'limit':_0x123682['options']?_0x123682['options']['limit']||null:null})[_0x2bdf('0xc')](function(_0x1833ce){logger[_0x2bdf('0xd')](_0x2bdf('0x25'),_0x123682);logger['debug'](_0x2bdf('0x25'),_0x123682,JSON[_0x2bdf('0x11')](_0x1833ce));_0x36b2a6(_0x1833ce);})[_0x2bdf('0x17')](function(_0x123af7){logger[_0x2bdf('0x12')](_0x2bdf('0x25'),_0x123af7['message'],_0x123682);_0x509d81(_0x13baaf[_0x2bdf('0x12')](0x1f4,_0x123af7['message']));});});}; \ No newline at end of file +var _0xdae9=['request','then','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetMemberReport','findAll','options','raw','where','attributes','limit','include','map','model','debug','MemberReport','create','CreateMemberReport','update','UpdateMemberReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x592e04,_0x253712){var _0x1de137=function(_0x1aee0c){while(--_0x1aee0c){_0x592e04['push'](_0x592e04['shift']());}};_0x1de137(++_0x253712);}(_0xdae9,0x69));var _0x9dae=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xdae9[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x9dae('0x0'));var util=require('util');var moment=require(_0x9dae('0x1'));var BPromise=require(_0x9dae('0x2'));var rs=require(_0x9dae('0x3'));var fs=require('fs');var Redis=require(_0x9dae('0x4'));var db=require(_0x9dae('0x5'))['db'];var utils=require(_0x9dae('0x6'));var logger=require(_0x9dae('0x7'))(_0x9dae('0x8'));var config=require(_0x9dae('0x9'));var jayson=require(_0x9dae('0xa'));var client=jayson['client'][_0x9dae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e2897,_0x3d6b14,_0x22f8f6){return new BPromise(function(_0x5218c9,_0x636fdc){return client[_0x9dae('0xc')](_0x3e2897,_0x22f8f6)[_0x9dae('0xd')](function(_0x4465dd){logger['info'](_0x9dae('0xe'),_0x3d6b14,_0x9dae('0xf'));logger['debug'](_0x9dae('0x10'),_0x3d6b14,_0x9dae('0xf'),JSON[_0x9dae('0x11')](_0x4465dd));if(_0x4465dd[_0x9dae('0x12')]){if(_0x4465dd[_0x9dae('0x12')]['code']===0x1f4){logger[_0x9dae('0x12')]('MemberReport,\x20%s,\x20%s',_0x3d6b14,_0x4465dd['error'][_0x9dae('0x13')]);return _0x636fdc(_0x4465dd[_0x9dae('0x12')][_0x9dae('0x13')]);}logger[_0x9dae('0x12')](_0x9dae('0xe'),_0x3d6b14,_0x4465dd[_0x9dae('0x12')][_0x9dae('0x13')]);return _0x5218c9(_0x4465dd['error']['message']);}else{logger[_0x9dae('0x14')](_0x9dae('0xe'),_0x3d6b14,_0x9dae('0xf'));_0x5218c9(_0x4465dd[_0x9dae('0x15')][_0x9dae('0x13')]);}})[_0x9dae('0x16')](function(_0x2f4f71){logger[_0x9dae('0x12')](_0x9dae('0xe'),_0x3d6b14,_0x2f4f71);_0x636fdc(_0x2f4f71);});});}exports[_0x9dae('0x17')]=function(_0x46cc6b){var _0x2bace4=this;return new Promise(function(_0x4aee61,_0x6eede1){return db['MemberReport'][_0x9dae('0x18')]({'raw':_0x46cc6b[_0x9dae('0x19')]?_0x46cc6b[_0x9dae('0x19')][_0x9dae('0x1a')]===undefined?!![]:![]:!![],'where':_0x46cc6b['options']?_0x46cc6b['options'][_0x9dae('0x1b')]||null:null,'attributes':_0x46cc6b[_0x9dae('0x19')]?_0x46cc6b[_0x9dae('0x19')][_0x9dae('0x1c')]||null:null,'limit':_0x46cc6b[_0x9dae('0x19')]?_0x46cc6b['options'][_0x9dae('0x1d')]||null:null,'include':_0x46cc6b['options']?_0x46cc6b[_0x9dae('0x19')][_0x9dae('0x1e')]?_[_0x9dae('0x1f')](_0x46cc6b[_0x9dae('0x19')][_0x9dae('0x1e')],function(_0x1a58ac){return{'model':db[_0x1a58ac[_0x9dae('0x20')]],'as':_0x1a58ac['as'],'attributes':_0x1a58ac[_0x9dae('0x1c')],'include':_0x1a58ac[_0x9dae('0x1e')]?_[_0x9dae('0x1f')](_0x1a58ac[_0x9dae('0x1e')],function(_0x71aa38){return{'model':db[_0x71aa38[_0x9dae('0x20')]],'as':_0x71aa38['as'],'attributes':_0x71aa38['attributes'],'include':_0x71aa38[_0x9dae('0x1e')]?_['map'](_0x71aa38[_0x9dae('0x1e')],function(_0x42e757){return{'model':db[_0x42e757[_0x9dae('0x20')]],'as':_0x42e757['as'],'attributes':_0x42e757[_0x9dae('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9dae('0xd')](function(_0x409a8c){logger[_0x9dae('0x14')](_0x9dae('0x17'),_0x46cc6b);logger[_0x9dae('0x21')](_0x9dae('0x17'),_0x46cc6b,JSON['stringify'](_0x409a8c));_0x4aee61(_0x409a8c);})['catch'](function(_0xceabb7){logger[_0x9dae('0x12')](_0x9dae('0x17'),_0xceabb7['message'],_0x46cc6b);_0x6eede1(_0x2bace4[_0x9dae('0x12')](0x1f4,_0xceabb7[_0x9dae('0x13')]));});});};exports['CreateMemberReport']=function(_0x55617a){var _0x10cad9=this;return new Promise(function(_0x10f4b1,_0x36a40e){return db[_0x9dae('0x22')][_0x9dae('0x23')](_0x55617a['body'],{'raw':_0x55617a[_0x9dae('0x19')]?_0x55617a[_0x9dae('0x19')][_0x9dae('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x513d6e){logger[_0x9dae('0x14')](_0x9dae('0x24'),_0x55617a);logger[_0x9dae('0x21')]('CreateMemberReport',_0x55617a,JSON[_0x9dae('0x11')](_0x513d6e));_0x10f4b1(_0x513d6e);})['catch'](function(_0x33cca4){logger[_0x9dae('0x12')](_0x9dae('0x24'),_0x33cca4[_0x9dae('0x13')],_0x55617a);_0x36a40e(_0x10cad9[_0x9dae('0x12')](0x1f4,_0x33cca4[_0x9dae('0x13')]));});});};exports['UpdateMemberReport']=function(_0x1e6ee0){var _0x59fe70=this;return new Promise(function(_0x17c3a3,_0x2d2479){return db[_0x9dae('0x22')][_0x9dae('0x25')](_0x1e6ee0['body'],{'raw':_0x1e6ee0[_0x9dae('0x19')]?_0x1e6ee0[_0x9dae('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e6ee0[_0x9dae('0x19')]?_0x1e6ee0['options'][_0x9dae('0x1b')]||null:null,'attributes':_0x1e6ee0[_0x9dae('0x19')]?_0x1e6ee0[_0x9dae('0x19')][_0x9dae('0x1c')]||null:null,'limit':_0x1e6ee0[_0x9dae('0x19')]?_0x1e6ee0['options'][_0x9dae('0x1d')]||null:null})['then'](function(_0x4e4244){logger[_0x9dae('0x14')](_0x9dae('0x26'),_0x1e6ee0);logger['debug'](_0x9dae('0x26'),_0x1e6ee0,JSON[_0x9dae('0x11')](_0x4e4244));_0x17c3a3(_0x4e4244);})[_0x9dae('0x16')](function(_0x9f1687){logger[_0x9dae('0x12')](_0x9dae('0x26'),_0x9f1687['message'],_0x1e6ee0);_0x2d2479(_0x59fe70[_0x9dae('0x12')](0x1f4,_0x9f1687[_0x9dae('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index e041c3e..336845f 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 _0xbb1b=['index','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get'];(function(_0x2f1722,_0x3a53bc){var _0x350306=function(_0x9f1f15){while(--_0x9f1f15){_0x2f1722['push'](_0x2f1722['shift']());}};_0x350306(++_0x3a53bc);}(_0xbb1b,0x86));var _0xbbb1=function(_0x1feebc,_0x3aa6f1){_0x1feebc=_0x1feebc-0x0;var _0x32b854=_0xbb1b[_0x1feebc];return _0x32b854;};'use strict';var multer=require(_0xbbb1('0x0'));var util=require(_0xbbb1('0x1'));var path=require(_0xbbb1('0x2'));var timeout=require(_0xbbb1('0x3'));var express=require('express');var router=express[_0xbbb1('0x4')]();var auth=require(_0xbbb1('0x5'));var interaction=require(_0xbbb1('0x6'));var config=require(_0xbbb1('0x7'));var controller=require(_0xbbb1('0x8'));router[_0xbbb1('0x9')]('/',controller[_0xbbb1('0xa')]);module[_0xbbb1('0xb')]=router; \ No newline at end of file +var _0xa4f5=['path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','index','exports','multer','util'];(function(_0xecc316,_0x4c71f1){var _0x369fbe=function(_0x135076){while(--_0x135076){_0xecc316['push'](_0xecc316['shift']());}};_0x369fbe(++_0x4c71f1);}(_0xa4f5,0x94));var _0x5a4f=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xa4f5[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x5a4f('0x0'));var util=require(_0x5a4f('0x1'));var path=require(_0x5a4f('0x2'));var timeout=require(_0x5a4f('0x3'));var express=require(_0x5a4f('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x5a4f('0x5'));var config=require(_0x5a4f('0x6'));var controller=require('./migration.controller');router[_0x5a4f('0x7')]('/',controller[_0x5a4f('0x8')]);module[_0x5a4f('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 074bb0f..2dd0cf5 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 _0x0270=['STRING','version','sequelize','exports'];(function(_0x54ff06,_0x237fbd){var _0x4ac908=function(_0x52c84a){while(--_0x52c84a){_0x54ff06['push'](_0x54ff06['shift']());}};_0x4ac908(++_0x237fbd);}(_0x0270,0x1a6));var _0x0027=function(_0x1ed3b1,_0x6ac439){_0x1ed3b1=_0x1ed3b1-0x0;var _0x5df90d=_0x0270[_0x1ed3b1];return _0x5df90d;};'use strict';var Sequelize=require(_0x0027('0x0'));module[_0x0027('0x1')]={'version':{'type':Sequelize[_0x0027('0x2')],'unique':_0x0027('0x3')}}; \ No newline at end of file +var _0xf5dc=['sequelize','exports'];(function(_0x8c0bf5,_0x2456ab){var _0x447387=function(_0x4c2469){while(--_0x4c2469){_0x8c0bf5['push'](_0x8c0bf5['shift']());}};_0x447387(++_0x2456ab);}(_0xf5dc,0x136));var _0xcf5d=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf5dc[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xcf5d('0x0'));module[_0xcf5d('0x1')]={'version':{'type':Sequelize['STRING'],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 53f4f4f..c70f2d8 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 _0x4cfd=['key','field','options','includeAll','include','findAll','rows','catch','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','Migration','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type'];(function(_0x405fcb,_0x261ef6){var _0x1a0676=function(_0x46887b){while(--_0x46887b){_0x405fcb['push'](_0x405fcb['shift']());}};_0x1a0676(++_0x261ef6);}(_0x4cfd,0x152));var _0xd4cf=function(_0x31b9cf,_0x1a809b){_0x31b9cf=_0x31b9cf-0x0;var _0x357b8a=_0x4cfd[_0x31b9cf];return _0x357b8a;};'use strict';var pdf=require(_0xd4cf('0x0'));var emlformat=require(_0xd4cf('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd4cf('0x2'));var rp=require('request-promise');var moment=require(_0xd4cf('0x3'));var BPromise=require(_0xd4cf('0x4'));var Mustache=require(_0xd4cf('0x5'));var util=require(_0xd4cf('0x6'));var path=require(_0xd4cf('0x7'));var sox=require(_0xd4cf('0x8'));var csv=require(_0xd4cf('0x9'));var ejs=require(_0xd4cf('0xa'));var fs=require('fs');var _=require(_0xd4cf('0xb'));var squel=require(_0xd4cf('0xc'));var crypto=require(_0xd4cf('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd4cf('0x9'));var querystring=require('querystring');var Papa=require(_0xd4cf('0xe'));var Redis=require('ioredis');var authService=require(_0xd4cf('0xf'));var qs=require(_0xd4cf('0x10'));var hardwareService=require(_0xd4cf('0x11'));var logger=require('../../config/logger')(_0xd4cf('0x12'));var utils=require(_0xd4cf('0x13'));var config=require(_0xd4cf('0x14'));var db=require(_0xd4cf('0x15'))['db'];function respondWithStatusCode(_0x409677,_0x2d42e9){_0x2d42e9=_0x2d42e9||0xcc;return function(_0x25df50){if(_0x25df50){return _0x409677[_0xd4cf('0x16')](_0x2d42e9);}return _0x409677['status'](_0x2d42e9)['end']();};}function respondWithResult(_0x43e3a1,_0x529012){_0x529012=_0x529012||0xc8;return function(_0x3a4f96){if(_0x3a4f96){return _0x43e3a1[_0xd4cf('0x17')](_0x529012)[_0xd4cf('0x18')](_0x3a4f96);}};}function respondWithFilteredResult(_0x141af0,_0x423f64){return function(_0x3734ad){if(_0x3734ad){var _0x232783=_0x3734ad[_0xd4cf('0x19')],_0x3a669f=_0x423f64[_0xd4cf('0x1a')],_0x19c068=_0x423f64['offset']+_0x423f64[_0xd4cf('0x1b')],_0x4d4ca3;if(_0x19c068>=_0x232783){_0x19c068=_0x232783;_0x4d4ca3=0xc8;}else{_0x4d4ca3=0xce;}_0x141af0[_0xd4cf('0x17')](_0x4d4ca3);return _0x141af0['set'](_0xd4cf('0x1c'),_0x3a669f+'-'+_0x19c068+'/'+_0x232783)['json'](_0x3734ad);}return null;};}function patchUpdates(_0xad2c0){return function(_0x91c342){try{jsonpatch[_0xd4cf('0x1d')](_0x91c342,_0xad2c0,!![]);}catch(_0x38e1b2){return BPromise[_0xd4cf('0x1e')](_0x38e1b2);}return _0x91c342[_0xd4cf('0x1f')]();};}function saveUpdates(_0x21a788,_0x58215a){return function(_0x107684){if(_0x107684){return _0x107684['update'](_0x21a788)[_0xd4cf('0x20')](function(_0x4d7d72){return _0x4d7d72;});}return null;};}function removeEntity(_0x185ffd,_0x127385){return function(_0x5d72d8){if(_0x5d72d8){return _0x5d72d8['destroy']()['then'](function(){_0x185ffd[_0xd4cf('0x17')](0xcc)[_0xd4cf('0x21')]();});}};}function handleEntityNotFound(_0x5d55ba,_0x20e51c){return function(_0x402fc3){if(!_0x402fc3){_0x5d55ba[_0xd4cf('0x16')](0x194);}return _0x402fc3;};}function handleError(_0x21b6e1,_0x60bd0c){_0x60bd0c=_0x60bd0c||0x1f4;return function(_0x49962b){logger[_0xd4cf('0x22')](_0x49962b[_0xd4cf('0x23')]);if(_0x49962b[_0xd4cf('0x24')]){delete _0x49962b[_0xd4cf('0x24')];}_0x21b6e1['status'](_0x60bd0c)[_0xd4cf('0x25')](_0x49962b);};}exports[_0xd4cf('0x26')]=function(_0x6bb74c,_0x59aa14){var _0x410ad4={},_0x5b18d3={},_0x5f34ad={'count':0x0,'rows':[]};var _0x393b29=db[_0xd4cf('0x27')][_0xd4cf('0x28')];_0x5b18d3[_0xd4cf('0x29')]=_['keys'](_0x393b29);_0x5b18d3[_0xd4cf('0x2a')]=_[_0xd4cf('0x2b')](_0x6bb74c['query']);_0x5b18d3[_0xd4cf('0x2c')]=_[_0xd4cf('0x2d')](_0x5b18d3[_0xd4cf('0x29')],_0x5b18d3[_0xd4cf('0x2a')]);_0x410ad4[_0xd4cf('0x2e')]=_[_0xd4cf('0x2d')](_0x5b18d3[_0xd4cf('0x29')],qs['fields'](_0x6bb74c[_0xd4cf('0x2a')][_0xd4cf('0x2f')]));_0x410ad4[_0xd4cf('0x2e')]=_0x410ad4[_0xd4cf('0x2e')][_0xd4cf('0x30')]?_0x410ad4['attributes']:_0x5b18d3[_0xd4cf('0x29')];if(!_0x6bb74c[_0xd4cf('0x2a')]['hasOwnProperty'](_0xd4cf('0x31'))){_0x410ad4[_0xd4cf('0x1b')]=qs[_0xd4cf('0x1b')](_0x6bb74c['query'][_0xd4cf('0x1b')]);_0x410ad4[_0xd4cf('0x1a')]=qs[_0xd4cf('0x1a')](_0x6bb74c[_0xd4cf('0x2a')][_0xd4cf('0x1a')]);}_0x410ad4[_0xd4cf('0x32')]=qs[_0xd4cf('0x33')](_0x6bb74c[_0xd4cf('0x2a')][_0xd4cf('0x33')]);_0x410ad4[_0xd4cf('0x34')]=qs['filters'](_[_0xd4cf('0x35')](_0x6bb74c[_0xd4cf('0x2a')],_0x5b18d3['filters']));if(_0x6bb74c[_0xd4cf('0x2a')][_0xd4cf('0x36')]){_0x410ad4['where']=_[_0xd4cf('0x37')](_0x410ad4[_0xd4cf('0x34')],{'$or':_[_0xd4cf('0x38')](_0x393b29,function(_0x23caae){if(_0x23caae[_0xd4cf('0x39')][_0xd4cf('0x3a')]!=='VIRTUAL'){var _0x3614ab={};_0x3614ab[_0x23caae[_0xd4cf('0x3b')]]={'$like':'%'+_0x6bb74c[_0xd4cf('0x2a')]['filter']+'%'};return _0x3614ab;}})});}_0x410ad4=_[_0xd4cf('0x37')]({},_0x410ad4,_0x6bb74c[_0xd4cf('0x3c')]);var _0x1f0e63={'where':_0x410ad4['where']};return db['Migration'][_0xd4cf('0x19')](_0x1f0e63)[_0xd4cf('0x20')](function(_0x294132){_0x5f34ad[_0xd4cf('0x19')]=_0x294132;if(_0x6bb74c['query'][_0xd4cf('0x3d')]){_0x410ad4[_0xd4cf('0x3e')]=[{'all':!![]}];}return db[_0xd4cf('0x27')][_0xd4cf('0x3f')](_0x410ad4);})[_0xd4cf('0x20')](function(_0x212310){_0x5f34ad[_0xd4cf('0x40')]=_0x212310;return _0x5f34ad;})[_0xd4cf('0x20')](respondWithFilteredResult(_0x59aa14,_0x410ad4))[_0xd4cf('0x41')](handleError(_0x59aa14,null));}; \ No newline at end of file +var _0x13aa=['VIRTUAL','field','filter','merge','options','Migration','includeAll','include','findAll','rows','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','save','update','then','stack','name','send','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','map','type'];(function(_0x40c920,_0x15bd9e){var _0x4be411=function(_0x51a12f){while(--_0x51a12f){_0x40c920['push'](_0x40c920['shift']());}};_0x4be411(++_0x15bd9e);}(_0x13aa,0x117));var _0xa13a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x13aa[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xa13a('0x0'));var emlformat=require(_0xa13a('0x1'));var rimraf=require(_0xa13a('0x2'));var zipdir=require(_0xa13a('0x3'));var jsonpatch=require(_0xa13a('0x4'));var rp=require(_0xa13a('0x5'));var moment=require(_0xa13a('0x6'));var BPromise=require(_0xa13a('0x7'));var Mustache=require(_0xa13a('0x8'));var util=require(_0xa13a('0x9'));var path=require(_0xa13a('0xa'));var sox=require(_0xa13a('0xb'));var csv=require('to-csv');var ejs=require(_0xa13a('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa13a('0xd'));var crypto=require(_0xa13a('0xe'));var jsforce=require(_0xa13a('0xf'));var deskjs=require(_0xa13a('0x10'));var toCsv=require(_0xa13a('0x11'));var querystring=require(_0xa13a('0x12'));var Papa=require(_0xa13a('0x13'));var Redis=require(_0xa13a('0x14'));var authService=require(_0xa13a('0x15'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa13a('0x16'))('api');var utils=require(_0xa13a('0x17'));var config=require(_0xa13a('0x18'));var db=require(_0xa13a('0x19'))['db'];function respondWithStatusCode(_0x502743,_0x566936){_0x566936=_0x566936||0xcc;return function(_0x2ab009){if(_0x2ab009){return _0x502743[_0xa13a('0x1a')](_0x566936);}return _0x502743[_0xa13a('0x1b')](_0x566936)[_0xa13a('0x1c')]();};}function respondWithResult(_0x353ccc,_0x230309){_0x230309=_0x230309||0xc8;return function(_0x2fa3a8){if(_0x2fa3a8){return _0x353ccc[_0xa13a('0x1b')](_0x230309)[_0xa13a('0x1d')](_0x2fa3a8);}};}function respondWithFilteredResult(_0x3fae79,_0x272c11){return function(_0x258d27){if(_0x258d27){var _0xf0d294=_0x258d27[_0xa13a('0x1e')],_0x4680eb=_0x272c11[_0xa13a('0x1f')],_0x537aa0=_0x272c11['offset']+_0x272c11[_0xa13a('0x20')],_0x54dad3;if(_0x537aa0>=_0xf0d294){_0x537aa0=_0xf0d294;_0x54dad3=0xc8;}else{_0x54dad3=0xce;}_0x3fae79['status'](_0x54dad3);return _0x3fae79['set']('Content-Range',_0x4680eb+'-'+_0x537aa0+'/'+_0xf0d294)[_0xa13a('0x1d')](_0x258d27);}return null;};}function patchUpdates(_0x5f3e23){return function(_0xaa4ae7){try{jsonpatch[_0xa13a('0x21')](_0xaa4ae7,_0x5f3e23,!![]);}catch(_0x5e47a1){return BPromise['reject'](_0x5e47a1);}return _0xaa4ae7[_0xa13a('0x22')]();};}function saveUpdates(_0x5cea39,_0x4853c0){return function(_0x234df2){if(_0x234df2){return _0x234df2[_0xa13a('0x23')](_0x5cea39)['then'](function(_0x261623){return _0x261623;});}return null;};}function removeEntity(_0x5a1952,_0x4452eb){return function(_0x314701){if(_0x314701){return _0x314701['destroy']()[_0xa13a('0x24')](function(){_0x5a1952[_0xa13a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e74ef,_0x3afac2){return function(_0x4588e9){if(!_0x4588e9){_0x2e74ef[_0xa13a('0x1a')](0x194);}return _0x4588e9;};}function handleError(_0x47449f,_0xa486d4){_0xa486d4=_0xa486d4||0x1f4;return function(_0x3f8b4c){logger['error'](_0x3f8b4c[_0xa13a('0x25')]);if(_0x3f8b4c[_0xa13a('0x26')]){delete _0x3f8b4c[_0xa13a('0x26')];}_0x47449f['status'](_0xa486d4)[_0xa13a('0x27')](_0x3f8b4c);};}exports['index']=function(_0x56b080,_0x3ae002){var _0x56b1c0={},_0x59569d={},_0x381714={'count':0x0,'rows':[]};var _0x360287=db['Migration'][_0xa13a('0x28')];_0x59569d['model']=_['keys'](_0x360287);_0x59569d[_0xa13a('0x29')]=_[_0xa13a('0x2a')](_0x56b080[_0xa13a('0x29')]);_0x59569d[_0xa13a('0x2b')]=_[_0xa13a('0x2c')](_0x59569d['model'],_0x59569d[_0xa13a('0x29')]);_0x56b1c0['attributes']=_[_0xa13a('0x2c')](_0x59569d[_0xa13a('0x2d')],qs[_0xa13a('0x2e')](_0x56b080[_0xa13a('0x29')][_0xa13a('0x2e')]));_0x56b1c0[_0xa13a('0x2f')]=_0x56b1c0[_0xa13a('0x2f')][_0xa13a('0x30')]?_0x56b1c0[_0xa13a('0x2f')]:_0x59569d['model'];if(!_0x56b080[_0xa13a('0x29')][_0xa13a('0x31')](_0xa13a('0x32'))){_0x56b1c0[_0xa13a('0x20')]=qs['limit'](_0x56b080[_0xa13a('0x29')][_0xa13a('0x20')]);_0x56b1c0[_0xa13a('0x1f')]=qs[_0xa13a('0x1f')](_0x56b080[_0xa13a('0x29')][_0xa13a('0x1f')]);}_0x56b1c0['order']=qs[_0xa13a('0x33')](_0x56b080[_0xa13a('0x29')]['sort']);_0x56b1c0[_0xa13a('0x34')]=qs[_0xa13a('0x2b')](_[_0xa13a('0x35')](_0x56b080[_0xa13a('0x29')],_0x59569d[_0xa13a('0x2b')]));if(_0x56b080[_0xa13a('0x29')]['filter']){_0x56b1c0[_0xa13a('0x34')]=_['merge'](_0x56b1c0[_0xa13a('0x34')],{'$or':_[_0xa13a('0x36')](_0x360287,function(_0x30bfae){if(_0x30bfae[_0xa13a('0x37')]['key']!==_0xa13a('0x38')){var _0x3cba8b={};_0x3cba8b[_0x30bfae[_0xa13a('0x39')]]={'$like':'%'+_0x56b080['query'][_0xa13a('0x3a')]+'%'};return _0x3cba8b;}})});}_0x56b1c0=_[_0xa13a('0x3b')]({},_0x56b1c0,_0x56b080[_0xa13a('0x3c')]);var _0x5346a7={'where':_0x56b1c0[_0xa13a('0x34')]};return db[_0xa13a('0x3d')][_0xa13a('0x1e')](_0x5346a7)[_0xa13a('0x24')](function(_0xa5f6ae){_0x381714['count']=_0xa5f6ae;if(_0x56b080[_0xa13a('0x29')][_0xa13a('0x3e')]){_0x56b1c0[_0xa13a('0x3f')]=[{'all':!![]}];}return db[_0xa13a('0x3d')][_0xa13a('0x40')](_0x56b1c0);})[_0xa13a('0x24')](function(_0x26236a){_0x381714[_0xa13a('0x41')]=_0x26236a;return _0x381714;})[_0xa13a('0x24')](respondWithFilteredResult(_0x3ae002,_0x56b1c0))[_0xa13a('0x42')](handleError(_0x3ae002,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 5a6cb57..be749d5 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 _0xc41a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','Migration','migrations','util','../../config/logger'];(function(_0x472696,_0x352c0e){var _0x541921=function(_0x247401){while(--_0x247401){_0x472696['push'](_0x472696['shift']());}};_0x541921(++_0x352c0e);}(_0xc41a,0xe2));var _0xac41=function(_0xa68bc8,_0x76aa5){_0xa68bc8=_0xa68bc8-0x0;var _0x572ecb=_0xc41a[_0xa68bc8];return _0x572ecb;};'use strict';var _=require('lodash');var util=require(_0xac41('0x0'));var logger=require(_0xac41('0x1'))('api');var moment=require(_0xac41('0x2'));var BPromise=require(_0xac41('0x3'));var rp=require(_0xac41('0x4'));var fs=require('fs');var path=require(_0xac41('0x5'));var rimraf=require(_0xac41('0x6'));var config=require(_0xac41('0x7'));var attributes=require(_0xac41('0x8'));module[_0xac41('0x9')]=function(_0x512db7,_0x236696){return _0x512db7['define'](_0xac41('0xa'),attributes,{'tableName':_0xac41('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe19b=['bluebird','request-promise','path','./migration.attributes','exports','define','Migration','migrations','lodash','util','api','moment'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0xe19b,0x1e8));var _0xbe19=function(_0xd305e1,_0x164f9a){_0xd305e1=_0xd305e1-0x0;var _0x4fbfc4=_0xe19b[_0xd305e1];return _0x4fbfc4;};'use strict';var _=require(_0xbe19('0x0'));var util=require(_0xbe19('0x1'));var logger=require('../../config/logger')(_0xbe19('0x2'));var moment=require(_0xbe19('0x3'));var BPromise=require(_0xbe19('0x4'));var rp=require(_0xbe19('0x5'));var fs=require('fs');var path=require(_0xbe19('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe19('0x7'));module[_0xbe19('0x8')]=function(_0x84ac94,_0x2d4287){return _0x84ac94[_0xbe19('0x9')](_0xbe19('0xa'),attributes,{'tableName':_0xbe19('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index b892668..e2dae38 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 _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s'];(function(_0xf67a65,_0x4f9b5f){var _0x160786=function(_0x297812){while(--_0x297812){_0xf67a65['push'](_0xf67a65['shift']());}};_0x160786(++_0x4f9b5f);}(_0x00bb,0x1d8));var _0xb00b=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x00bb[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('Migration,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file +var _0x0faf=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4537dd,_0x334b79){var _0xf1d4f8=function(_0x49b212){while(--_0x49b212){_0x4537dd['push'](_0x4537dd['shift']());}};_0xf1d4f8(++_0x334b79);}(_0x0faf,0x132));var _0xf0fa=function(_0xabbd2f,_0x44d05a){_0xabbd2f=_0xabbd2f-0x0;var _0x34a040=_0x0faf[_0xabbd2f];return _0x34a040;};'use strict';var _=require(_0xf0fa('0x0'));var util=require('util');var moment=require(_0xf0fa('0x1'));var BPromise=require(_0xf0fa('0x2'));var rs=require(_0xf0fa('0x3'));var fs=require('fs');var Redis=require(_0xf0fa('0x4'));var db=require(_0xf0fa('0x5'))['db'];var utils=require(_0xf0fa('0x6'));var logger=require(_0xf0fa('0x7'))(_0xf0fa('0x8'));var config=require(_0xf0fa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf0fa('0xa')][_0xf0fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25b5c4,_0x3a703b,_0x2db1d9){return new BPromise(function(_0x587865,_0x42f7fd){return client[_0xf0fa('0xc')](_0x25b5c4,_0x2db1d9)['then'](function(_0x4df4d1){logger[_0xf0fa('0xd')](_0xf0fa('0xe'),_0x3a703b,_0xf0fa('0xf'));logger[_0xf0fa('0x10')](_0xf0fa('0x11'),_0x3a703b,_0xf0fa('0xf'),JSON[_0xf0fa('0x12')](_0x4df4d1));if(_0x4df4d1[_0xf0fa('0x13')]){if(_0x4df4d1['error'][_0xf0fa('0x14')]===0x1f4){logger['error'](_0xf0fa('0xe'),_0x3a703b,_0x4df4d1['error'][_0xf0fa('0x15')]);return _0x42f7fd(_0x4df4d1[_0xf0fa('0x13')][_0xf0fa('0x15')]);}logger['error']('Migration,\x20%s,\x20%s',_0x3a703b,_0x4df4d1[_0xf0fa('0x13')]['message']);return _0x587865(_0x4df4d1[_0xf0fa('0x13')][_0xf0fa('0x15')]);}else{logger[_0xf0fa('0xd')](_0xf0fa('0xe'),_0x3a703b,_0xf0fa('0xf'));_0x587865(_0x4df4d1[_0xf0fa('0x16')][_0xf0fa('0x15')]);}})[_0xf0fa('0x17')](function(_0x497542){logger[_0xf0fa('0x13')](_0xf0fa('0xe'),_0x3a703b,_0x497542);_0x42f7fd(_0x497542);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index f9b10ba..61e980d 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 _0x54c4=['isAuthenticated','post','/:id','update','exports','multer','path','connect-timeout','../../components/interaction/service','../../config/environment','./network.controller','get'];(function(_0x581cad,_0x355b2e){var _0x1a9f4b=function(_0x5c8461){while(--_0x5c8461){_0x581cad['push'](_0x581cad['shift']());}};_0x1a9f4b(++_0x355b2e);}(_0x54c4,0xdd));var _0x454c=function(_0x3d8d60,_0x12ded8){_0x3d8d60=_0x3d8d60-0x0;var _0xfd6778=_0x54c4[_0x3d8d60];return _0xfd6778;};'use strict';var multer=require(_0x454c('0x0'));var util=require('util');var path=require(_0x454c('0x1'));var timeout=require(_0x454c('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x454c('0x3'));var config=require(_0x454c('0x4'));var controller=require(_0x454c('0x5'));router[_0x454c('0x6')]('/',auth[_0x454c('0x7')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x454c('0x8')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x454c('0x9'),auth['isAuthenticated'](),controller[_0x454c('0xa')]);router['delete']('/:id',auth[_0x454c('0x7')](),controller['destroy']);module[_0x454c('0xb')]=router; \ No newline at end of file +var _0x2e3d=['post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x2e3d,0x8c));var _0xd2e3=function(_0x32526f,_0x7731ec){_0x32526f=_0x32526f-0x0;var _0x1e0d77=_0x2e3d[_0x32526f];return _0x1e0d77;};'use strict';var multer=require(_0xd2e3('0x0'));var util=require(_0xd2e3('0x1'));var path=require(_0xd2e3('0x2'));var timeout=require(_0xd2e3('0x3'));var express=require(_0xd2e3('0x4'));var router=express[_0xd2e3('0x5')]();var auth=require(_0xd2e3('0x6'));var interaction=require(_0xd2e3('0x7'));var config=require(_0xd2e3('0x8'));var controller=require('./network.controller');router[_0xd2e3('0x9')]('/',auth[_0xd2e3('0xa')](),controller[_0xd2e3('0xb')]);router[_0xd2e3('0x9')]('/:id',auth[_0xd2e3('0xa')](),controller['show']);router[_0xd2e3('0xc')]('/',auth['isAuthenticated'](),controller[_0xd2e3('0xd')]);router[_0xd2e3('0xe')](_0xd2e3('0xf'),auth[_0xd2e3('0xa')](),controller['update']);router[_0xd2e3('0x10')](_0xd2e3('0xf'),auth['isAuthenticated'](),controller[_0xd2e3('0x11')]);module[_0xd2e3('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 596c447..2c469ed 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 _0xf6b4=['localnet','externip','STRING','sequelize','exports'];(function(_0x529982,_0x243cd1){var _0x2af8a3=function(_0xe6e5c1){while(--_0xe6e5c1){_0x529982['push'](_0x529982['shift']());}};_0x2af8a3(++_0x243cd1);}(_0xf6b4,0xd0));var _0x4f6b=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0xf6b4[_0x374ccf];return _0x443cde;};'use strict';var Sequelize=require(_0x4f6b('0x0'));module[_0x4f6b('0x1')]={'type':{'type':Sequelize['ENUM'](_0x4f6b('0x2'),_0x4f6b('0x3'))},'value':{'type':Sequelize[_0x4f6b('0x4')]}}; \ No newline at end of file +var _0xd210=['ENUM','externip','STRING','sequelize'];(function(_0x57feb6,_0x21b4f0){var _0x27a6c5=function(_0x170426){while(--_0x170426){_0x57feb6['push'](_0x57feb6['shift']());}};_0x27a6c5(++_0x21b4f0);}(_0xd210,0x15b));var _0x0d21=function(_0x81e39d,_0x4c3934){_0x81e39d=_0x81e39d-0x0;var _0x548fbb=_0xd210[_0x81e39d];return _0x548fbb;};'use strict';var Sequelize=require(_0x0d21('0x0'));module['exports']={'type':{'type':Sequelize[_0x0d21('0x1')]('localnet',_0x0d21('0x2'))},'value':{'type':Sequelize[_0x0d21('0x3')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 05ff097..7ab8785 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 _0x9913=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','jayson/promise','http','test','request','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','Network,\x20%s,\x20%s','message','result','catch','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','Network','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','type','field','options','includeAll','include','findAll','rows','params','length','find','sequelize','create','body','readFileSync','join','root','server/files/templates/network.ejs','utf8','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','render','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','crypto','desk.js','querystring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9913,0x1af));var _0x3991=function(_0x539533,_0x59b89b){_0x539533=_0x539533-0x0;var _0x3942f3=_0x9913[_0x539533];return _0x3942f3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3991('0x0'));var rimraf=require(_0x3991('0x1'));var zipdir=require(_0x3991('0x2'));var jsonpatch=require(_0x3991('0x3'));var rp=require(_0x3991('0x4'));var moment=require('moment');var BPromise=require(_0x3991('0x5'));var Mustache=require(_0x3991('0x6'));var util=require(_0x3991('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x3991('0x8'));var ejs=require(_0x3991('0x9'));var fs=require('fs');var _=require(_0x3991('0xa'));var squel=require('squel');var crypto=require(_0x3991('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3991('0xc'));var toCsv=require(_0x3991('0x8'));var querystring=require(_0x3991('0xd'));var Papa=require(_0x3991('0xe'));var Redis=require('ioredis');var authService=require(_0x3991('0xf'));var qs=require(_0x3991('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3991('0x11'))(_0x3991('0x12'));var utils=require(_0x3991('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x3991('0x14'));var client=jayson['client'][_0x3991('0x15')]({'port':0x232a});function checkPasswordPattern(_0xfb4c17,_0x5ecf5b,_0x35a6b9){if(_0x35a6b9){var _0x27d019=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x27d019[_0x3991('0x16')](_0x5ecf5b)){return _0xfb4c17;}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 _0xfb4c17;}}function respondWithRpcPromise(_0x33a7bc,_0x289f19,_0xfd9a83,_0x4ed9d5){return new BPromise(function(_0x499c78,_0x366270){var _0xfc2586=_0x4ed9d5||client;return _0xfc2586[_0x3991('0x17')](_0x33a7bc,_0xfd9a83)[_0x3991('0x18')](function(_0x3127b7){logger[_0x3991('0x19')]('Network,\x20%s,\x20%s',_0x289f19,_0x3991('0x1a'));logger[_0x3991('0x1b')](_0x3991('0x1c'),_0x289f19,_0x3991('0x1a'),JSON[_0x3991('0x1d')](_0x3127b7));if(_0x3127b7[_0x3991('0x1e')]){if(_0x3127b7[_0x3991('0x1e')]['code']===0x1f4){logger[_0x3991('0x1e')](_0x3991('0x1f'),_0x289f19,_0x3127b7[_0x3991('0x1e')][_0x3991('0x20')]);return _0x366270(_0x3127b7[_0x3991('0x1e')]['message']);}logger[_0x3991('0x1e')](_0x3991('0x1f'),_0x289f19,_0x3127b7[_0x3991('0x1e')][_0x3991('0x20')]);return _0x499c78(_0x3127b7[_0x3991('0x1e')][_0x3991('0x20')]);}else{logger[_0x3991('0x19')]('Network,\x20%s,\x20%s',_0x289f19,_0x3991('0x1a'));_0x499c78(_0x3127b7[_0x3991('0x21')][_0x3991('0x20')]);}})[_0x3991('0x22')](function(_0xa98de6){logger[_0x3991('0x1e')](_0x3991('0x1f'),_0x289f19,_0xa98de6);_0x366270(_0xa98de6);});});}function respondWithStatusCode(_0x4835ce,_0x4771d3){_0x4771d3=_0x4771d3||0xcc;return function(_0x5107c6){if(_0x5107c6){return _0x4835ce['sendStatus'](_0x4771d3);}return _0x4835ce['status'](_0x4771d3)['end']();};}function respondWithResult(_0x3d453d,_0x2c8440){_0x2c8440=_0x2c8440||0xc8;return function(_0x4bed4e){if(_0x4bed4e){return _0x3d453d[_0x3991('0x23')](_0x2c8440)[_0x3991('0x24')](_0x4bed4e);}};}function respondWithFilteredResult(_0xff1ed6,_0x4b94c1){return function(_0x154655){if(_0x154655){var _0x20895a=_0x154655[_0x3991('0x25')],_0x509614=_0x4b94c1[_0x3991('0x26')],_0x39078b=_0x4b94c1[_0x3991('0x26')]+_0x4b94c1[_0x3991('0x27')],_0x4c66c1;if(_0x39078b>=_0x20895a){_0x39078b=_0x20895a;_0x4c66c1=0xc8;}else{_0x4c66c1=0xce;}_0xff1ed6['status'](_0x4c66c1);return _0xff1ed6['set'](_0x3991('0x28'),_0x509614+'-'+_0x39078b+'/'+_0x20895a)['json'](_0x154655);}return null;};}function patchUpdates(_0xe6caa5){return function(_0x273384){try{jsonpatch[_0x3991('0x29')](_0x273384,_0xe6caa5,!![]);}catch(_0x52818c){return BPromise[_0x3991('0x2a')](_0x52818c);}return _0x273384[_0x3991('0x2b')]();};}function saveUpdates(_0x5c7f8d,_0x3880d3){return function(_0xc3963a){if(_0xc3963a){return _0xc3963a[_0x3991('0x2c')](_0x5c7f8d)[_0x3991('0x18')](function(_0x97829b){return _0x97829b;});}return null;};}function removeEntity(_0x207f89,_0x48ee3c){return function(_0xdc4d36){if(_0xdc4d36){return _0xdc4d36[_0x3991('0x2d')]()[_0x3991('0x18')](function(){_0x207f89[_0x3991('0x23')](0xcc)[_0x3991('0x2e')]();});}};}function handleEntityNotFound(_0x5c967d,_0x3ac0e7){return function(_0x5784e3){if(!_0x5784e3){_0x5c967d[_0x3991('0x2f')](0x194);}return _0x5784e3;};}function handleError(_0x1eac70,_0x158391){_0x158391=_0x158391||0x1f4;return function(_0x148060){logger[_0x3991('0x1e')](_0x148060['stack']);if(_0x148060[_0x3991('0x30')]){delete _0x148060['name'];}_0x1eac70[_0x3991('0x23')](_0x158391)['send'](_0x148060);};}exports['index']=function(_0x19681b,_0x2bec69){var _0x55657f={},_0x54bebd={},_0x307827={'count':0x0,'rows':[]};var _0xea1d6c=db[_0x3991('0x31')][_0x3991('0x32')];_0x54bebd[_0x3991('0x33')]=_[_0x3991('0x34')](_0xea1d6c);_0x54bebd[_0x3991('0x35')]=_[_0x3991('0x34')](_0x19681b[_0x3991('0x35')]);_0x54bebd['filters']=_[_0x3991('0x36')](_0x54bebd[_0x3991('0x33')],_0x54bebd[_0x3991('0x35')]);_0x55657f[_0x3991('0x37')]=_[_0x3991('0x36')](_0x54bebd[_0x3991('0x33')],qs[_0x3991('0x38')](_0x19681b[_0x3991('0x35')][_0x3991('0x38')]));_0x55657f['attributes']=_0x55657f[_0x3991('0x37')]['length']?_0x55657f[_0x3991('0x37')]:_0x54bebd[_0x3991('0x33')];if(!_0x19681b[_0x3991('0x35')][_0x3991('0x39')]('nolimit')){_0x55657f[_0x3991('0x27')]=qs[_0x3991('0x27')](_0x19681b[_0x3991('0x35')][_0x3991('0x27')]);_0x55657f['offset']=qs['offset'](_0x19681b[_0x3991('0x35')][_0x3991('0x26')]);}_0x55657f[_0x3991('0x3a')]=qs[_0x3991('0x3b')](_0x19681b['query'][_0x3991('0x3b')]);_0x55657f[_0x3991('0x3c')]=qs[_0x3991('0x3d')](_['pick'](_0x19681b[_0x3991('0x35')],_0x54bebd[_0x3991('0x3d')]));if(_0x19681b[_0x3991('0x35')][_0x3991('0x3e')]){_0x55657f[_0x3991('0x3c')]=_[_0x3991('0x3f')](_0x55657f[_0x3991('0x3c')],{'$or':_['map'](_0xea1d6c,function(_0x308440){if(_0x308440[_0x3991('0x40')]['key']!=='VIRTUAL'){var _0x52c1c6={};_0x52c1c6[_0x308440[_0x3991('0x41')]]={'$like':'%'+_0x19681b[_0x3991('0x35')][_0x3991('0x3e')]+'%'};return _0x52c1c6;}})});}_0x55657f=_['merge']({},_0x55657f,_0x19681b[_0x3991('0x42')]);var _0x5e58a5={'where':_0x55657f['where']};return db[_0x3991('0x31')][_0x3991('0x25')](_0x5e58a5)[_0x3991('0x18')](function(_0x1eff25){_0x307827[_0x3991('0x25')]=_0x1eff25;if(_0x19681b['query'][_0x3991('0x43')]){_0x55657f[_0x3991('0x44')]=[{'all':!![]}];}return db['Network'][_0x3991('0x45')](_0x55657f);})[_0x3991('0x18')](function(_0x478630){_0x307827[_0x3991('0x46')]=_0x478630;return _0x307827;})[_0x3991('0x18')](respondWithFilteredResult(_0x2bec69,_0x55657f))['catch'](handleError(_0x2bec69,null));};exports['show']=function(_0x2ef236,_0x5c981a){var _0x31b025={'raw':!![],'where':{'id':_0x2ef236[_0x3991('0x47')]['id']}},_0x52edb4={};_0x52edb4[_0x3991('0x33')]=_[_0x3991('0x34')](db['Network'][_0x3991('0x32')]);_0x52edb4['query']=_[_0x3991('0x34')](_0x2ef236[_0x3991('0x35')]);_0x52edb4['filters']=_[_0x3991('0x36')](_0x52edb4[_0x3991('0x33')],_0x52edb4[_0x3991('0x35')]);_0x31b025[_0x3991('0x37')]=_['intersection'](_0x52edb4[_0x3991('0x33')],qs[_0x3991('0x38')](_0x2ef236[_0x3991('0x35')][_0x3991('0x38')]));_0x31b025[_0x3991('0x37')]=_0x31b025[_0x3991('0x37')][_0x3991('0x48')]?_0x31b025[_0x3991('0x37')]:_0x52edb4[_0x3991('0x33')];if(_0x2ef236[_0x3991('0x35')][_0x3991('0x43')]){_0x31b025[_0x3991('0x44')]=[{'all':!![]}];}_0x31b025=_[_0x3991('0x3f')]({},_0x31b025,_0x2ef236[_0x3991('0x42')]);return db['Network'][_0x3991('0x49')](_0x31b025)[_0x3991('0x18')](handleEntityNotFound(_0x5c981a,null))[_0x3991('0x18')](respondWithResult(_0x5c981a,null))[_0x3991('0x22')](handleError(_0x5c981a,null));};exports['create']=function(_0xe82ef9,_0x4951ad,_0x44618d){var _0x19b86b;return db[_0x3991('0x4a')]['transaction'](function(_0x34c85a){return db['Network'][_0x3991('0x4b')](_0xe82ef9['body'],{'raw':!![]})[_0x3991('0x18')](function(_0x5114b9){_0x19b86b=_0x5114b9;return db[_0x3991('0x31')][_0x3991('0x45')]({'where':{'type':_0xe82ef9[_0x3991('0x4c')][_0x3991('0x40')]},'raw':!![]});})[_0x3991('0x18')](function(_0x202554){var _0x5a5c95=fs[_0x3991('0x4d')](path[_0x3991('0x4e')](config[_0x3991('0x4f')],_0x3991('0x50')),_0x3991('0x51'));var _0x2d3e0b=ejs['render'](_0x5a5c95,{'networks':_0x202554||[]});fs[_0x3991('0x52')](util[_0x3991('0x53')](_0x3991('0x54'),_0xe82ef9[_0x3991('0x4c')][_0x3991('0x40')][_0x3991('0x55')]()),_0x2d3e0b);})[_0x3991('0x18')](function(){return respondWithRpcPromise(_0x3991('0x56'),_0x3991('0x4b'),{'module':_0x3991('0x57')});})[_0x3991('0x18')](function(){return _0x19b86b;});})[_0x3991('0x18')](respondWithResult(_0x4951ad,0xc9))[_0x3991('0x22')](handleError(_0x4951ad,null));};exports['update']=function(_0x2ff3d7,_0x3c8ab3,_0x5abd45){var _0x5e07e8;return db[_0x3991('0x4a')]['transaction'](function(_0x1abc8b){return db['Network'][_0x3991('0x49')]({'where':{'id':_0x2ff3d7[_0x3991('0x47')]['id']}})[_0x3991('0x18')](handleEntityNotFound(_0x3c8ab3,null))[_0x3991('0x18')](saveUpdates(_0x2ff3d7[_0x3991('0x4c')],null))[_0x3991('0x18')](function(_0xa774c6){if(_0xa774c6){_0x5e07e8=_0xa774c6;return db[_0x3991('0x31')][_0x3991('0x45')]({'where':{'type':_0x5e07e8[_0x3991('0x40')]},'raw':!![]});}return null;})['then'](function(_0x56b342){if(_0x56b342){var _0x4c9458=fs['readFileSync'](path[_0x3991('0x4e')](config['root'],_0x3991('0x50')),'utf8');var _0x57f55b=ejs[_0x3991('0x58')](_0x4c9458,{'networks':_0x56b342||[]});fs[_0x3991('0x52')](util[_0x3991('0x53')]('/etc/asterisk/sip_xcally_%s.conf',_0x5e07e8['type'][_0x3991('0x55')]()),_0x57f55b);return respondWithRpcPromise(_0x3991('0x56'),_0x3991('0x2c'),{'module':_0x3991('0x57')});}return null;})[_0x3991('0x18')](function(_0x455245){if(_0x455245){return _0x5e07e8;}return null;});})[_0x3991('0x18')](respondWithResult(_0x3c8ab3,null))[_0x3991('0x22')](handleError(_0x3c8ab3,null));};exports[_0x3991('0x2d')]=function(_0x53b5a5,_0x186bf4,_0x5e5d7e){var _0x1339d2;return db['Network'][_0x3991('0x49')]({'where':{'id':_0x53b5a5[_0x3991('0x47')]['id']}})['then'](function(_0x277d58){_0x1339d2=_0x277d58;return _0x277d58;})[_0x3991('0x18')](handleEntityNotFound(_0x186bf4,null))[_0x3991('0x18')](removeEntity(_0x186bf4,null))['then'](function(){if(_0x1339d2){return db[_0x3991('0x31')][_0x3991('0x45')]({'where':{'type':_0x1339d2['type']},'raw':!![]});}})[_0x3991('0x18')](function(_0x2dda4f){if(_0x2dda4f){var _0x591add=fs[_0x3991('0x4d')](path['join'](config[_0x3991('0x4f')],_0x3991('0x50')),_0x3991('0x51'));var _0xa584e2=ejs[_0x3991('0x58')](_0x591add,{'networks':_0x2dda4f||[]});fs[_0x3991('0x52')](util[_0x3991('0x53')](_0x3991('0x54'),_0x1339d2[_0x3991('0x40')][_0x3991('0x55')]()),_0xa584e2);return respondWithRpcPromise(_0x3991('0x56'),'destroy',{'module':_0x3991('0x57')});}})['catch'](handleError(_0x186bf4,null));}; \ No newline at end of file +var _0x3f8c=['params','rawAttributes','fields','includeAll','find','create','sequelize','transaction','body','findAll','join','root','server/files/templates/network.ejs','utf8','render','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','readFileSync','Reload','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','debug','request\x20sent','error','code','message','catch','Network,\x20%s,\x20%s','sendStatus','end','status','json','offset','set','apply','reject','update','destroy','stack','name','index','Network','keys','query','filters','attributes','intersection','model','length','limit','sort','where','pick','merge','map','type','key','VIRTUAL','filter','options','count','include','show'];(function(_0x730372,_0x2ee703){var _0x523984=function(_0x5d8983){while(--_0x5d8983){_0x730372['push'](_0x730372['shift']());}};_0x523984(++_0x2ee703);}(_0x3f8c,0x196));var _0xc3f8=function(_0x347aa2,_0xd60571){_0x347aa2=_0x347aa2-0x0;var _0x49b6d3=_0x3f8c[_0x347aa2];return _0x49b6d3;};'use strict';var pdf=require(_0xc3f8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc3f8('0x1'));var zipdir=require(_0xc3f8('0x2'));var jsonpatch=require(_0xc3f8('0x3'));var rp=require('request-promise');var moment=require(_0xc3f8('0x4'));var BPromise=require(_0xc3f8('0x5'));var Mustache=require(_0xc3f8('0x6'));var util=require(_0xc3f8('0x7'));var path=require(_0xc3f8('0x8'));var sox=require(_0xc3f8('0x9'));var csv=require(_0xc3f8('0xa'));var ejs=require(_0xc3f8('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc3f8('0xc'));var crypto=require('crypto');var jsforce=require(_0xc3f8('0xd'));var deskjs=require(_0xc3f8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc3f8('0xf'));var Papa=require(_0xc3f8('0x10'));var Redis=require(_0xc3f8('0x11'));var authService=require(_0xc3f8('0x12'));var qs=require(_0xc3f8('0x13'));var hardwareService=require(_0xc3f8('0x14'));var logger=require(_0xc3f8('0x15'))(_0xc3f8('0x16'));var utils=require(_0xc3f8('0x17'));var config=require(_0xc3f8('0x18'));var db=require(_0xc3f8('0x19'))['db'];var jayson=require(_0xc3f8('0x1a'));var client=jayson[_0xc3f8('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x1b9390,_0x5540c6,_0x5c86db){if(_0x5c86db){var _0x4e47ae=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4e47ae[_0xc3f8('0x1c')](_0x5540c6)){return _0x1b9390;}else{throw new Error(_0xc3f8('0x1d'));}}else{return _0x1b9390;}}function respondWithRpcPromise(_0x5ddef9,_0xc96ba6,_0x2c1512,_0x16765c){return new BPromise(function(_0x36d964,_0x2f3e1c){var _0x2ab159=_0x16765c||client;return _0x2ab159[_0xc3f8('0x1e')](_0x5ddef9,_0x2c1512)[_0xc3f8('0x1f')](function(_0x295730){logger['info']('Network,\x20%s,\x20%s',_0xc96ba6,'request\x20sent');logger[_0xc3f8('0x20')]('Network,\x20%s,\x20%s,\x20%s',_0xc96ba6,_0xc3f8('0x21'),JSON['stringify'](_0x295730));if(_0x295730[_0xc3f8('0x22')]){if(_0x295730[_0xc3f8('0x22')][_0xc3f8('0x23')]===0x1f4){logger[_0xc3f8('0x22')]('Network,\x20%s,\x20%s',_0xc96ba6,_0x295730[_0xc3f8('0x22')]['message']);return _0x2f3e1c(_0x295730[_0xc3f8('0x22')][_0xc3f8('0x24')]);}logger['error']('Network,\x20%s,\x20%s',_0xc96ba6,_0x295730['error'][_0xc3f8('0x24')]);return _0x36d964(_0x295730['error']['message']);}else{logger['info']('Network,\x20%s,\x20%s',_0xc96ba6,'request\x20sent');_0x36d964(_0x295730['result'][_0xc3f8('0x24')]);}})[_0xc3f8('0x25')](function(_0x1b72ab){logger[_0xc3f8('0x22')](_0xc3f8('0x26'),_0xc96ba6,_0x1b72ab);_0x2f3e1c(_0x1b72ab);});});}function respondWithStatusCode(_0x407741,_0x452f5c){_0x452f5c=_0x452f5c||0xcc;return function(_0x39a568){if(_0x39a568){return _0x407741[_0xc3f8('0x27')](_0x452f5c);}return _0x407741['status'](_0x452f5c)[_0xc3f8('0x28')]();};}function respondWithResult(_0x452730,_0x347fd8){_0x347fd8=_0x347fd8||0xc8;return function(_0x1a36b8){if(_0x1a36b8){return _0x452730[_0xc3f8('0x29')](_0x347fd8)[_0xc3f8('0x2a')](_0x1a36b8);}};}function respondWithFilteredResult(_0x69d59,_0x295b9b){return function(_0x3050b1){if(_0x3050b1){var _0x494bcd=_0x3050b1['count'],_0x4c9a2c=_0x295b9b['offset'],_0x2626a8=_0x295b9b[_0xc3f8('0x2b')]+_0x295b9b['limit'],_0xb31ade;if(_0x2626a8>=_0x494bcd){_0x2626a8=_0x494bcd;_0xb31ade=0xc8;}else{_0xb31ade=0xce;}_0x69d59[_0xc3f8('0x29')](_0xb31ade);return _0x69d59[_0xc3f8('0x2c')]('Content-Range',_0x4c9a2c+'-'+_0x2626a8+'/'+_0x494bcd)[_0xc3f8('0x2a')](_0x3050b1);}return null;};}function patchUpdates(_0x33deca){return function(_0x2b8ccd){try{jsonpatch[_0xc3f8('0x2d')](_0x2b8ccd,_0x33deca,!![]);}catch(_0x36e3c4){return BPromise[_0xc3f8('0x2e')](_0x36e3c4);}return _0x2b8ccd['save']();};}function saveUpdates(_0x232142,_0x306dec){return function(_0x1e24c0){if(_0x1e24c0){return _0x1e24c0[_0xc3f8('0x2f')](_0x232142)[_0xc3f8('0x1f')](function(_0x5d158f){return _0x5d158f;});}return null;};}function removeEntity(_0xcbc470,_0x3409aa){return function(_0xc2cfc9){if(_0xc2cfc9){return _0xc2cfc9[_0xc3f8('0x30')]()[_0xc3f8('0x1f')](function(){_0xcbc470[_0xc3f8('0x29')](0xcc)[_0xc3f8('0x28')]();});}};}function handleEntityNotFound(_0xa8bd67,_0x5dcac1){return function(_0x4c42b4){if(!_0x4c42b4){_0xa8bd67[_0xc3f8('0x27')](0x194);}return _0x4c42b4;};}function handleError(_0x18c697,_0x2ca58d){_0x2ca58d=_0x2ca58d||0x1f4;return function(_0x244558){logger['error'](_0x244558[_0xc3f8('0x31')]);if(_0x244558[_0xc3f8('0x32')]){delete _0x244558[_0xc3f8('0x32')];}_0x18c697['status'](_0x2ca58d)['send'](_0x244558);};}exports[_0xc3f8('0x33')]=function(_0x155764,_0x58f2a2){var _0x3baf68={},_0x3bfd52={},_0x399c4c={'count':0x0,'rows':[]};var _0x14e2e8=db[_0xc3f8('0x34')]['rawAttributes'];_0x3bfd52['model']=_[_0xc3f8('0x35')](_0x14e2e8);_0x3bfd52[_0xc3f8('0x36')]=_[_0xc3f8('0x35')](_0x155764[_0xc3f8('0x36')]);_0x3bfd52[_0xc3f8('0x37')]=_['intersection'](_0x3bfd52['model'],_0x3bfd52[_0xc3f8('0x36')]);_0x3baf68[_0xc3f8('0x38')]=_[_0xc3f8('0x39')](_0x3bfd52[_0xc3f8('0x3a')],qs['fields'](_0x155764[_0xc3f8('0x36')]['fields']));_0x3baf68['attributes']=_0x3baf68[_0xc3f8('0x38')][_0xc3f8('0x3b')]?_0x3baf68['attributes']:_0x3bfd52[_0xc3f8('0x3a')];if(!_0x155764[_0xc3f8('0x36')]['hasOwnProperty']('nolimit')){_0x3baf68[_0xc3f8('0x3c')]=qs['limit'](_0x155764['query'][_0xc3f8('0x3c')]);_0x3baf68['offset']=qs['offset'](_0x155764[_0xc3f8('0x36')][_0xc3f8('0x2b')]);}_0x3baf68['order']=qs[_0xc3f8('0x3d')](_0x155764[_0xc3f8('0x36')][_0xc3f8('0x3d')]);_0x3baf68[_0xc3f8('0x3e')]=qs['filters'](_[_0xc3f8('0x3f')](_0x155764[_0xc3f8('0x36')],_0x3bfd52[_0xc3f8('0x37')]));if(_0x155764['query']['filter']){_0x3baf68['where']=_[_0xc3f8('0x40')](_0x3baf68[_0xc3f8('0x3e')],{'$or':_[_0xc3f8('0x41')](_0x14e2e8,function(_0x2ef49f){if(_0x2ef49f[_0xc3f8('0x42')][_0xc3f8('0x43')]!==_0xc3f8('0x44')){var _0x5a0e3c={};_0x5a0e3c[_0x2ef49f['field']]={'$like':'%'+_0x155764['query'][_0xc3f8('0x45')]+'%'};return _0x5a0e3c;}})});}_0x3baf68=_[_0xc3f8('0x40')]({},_0x3baf68,_0x155764[_0xc3f8('0x46')]);var _0x203275={'where':_0x3baf68[_0xc3f8('0x3e')]};return db[_0xc3f8('0x34')][_0xc3f8('0x47')](_0x203275)[_0xc3f8('0x1f')](function(_0x4cac9a){_0x399c4c[_0xc3f8('0x47')]=_0x4cac9a;if(_0x155764[_0xc3f8('0x36')]['includeAll']){_0x3baf68[_0xc3f8('0x48')]=[{'all':!![]}];}return db['Network']['findAll'](_0x3baf68);})[_0xc3f8('0x1f')](function(_0x114e38){_0x399c4c['rows']=_0x114e38;return _0x399c4c;})[_0xc3f8('0x1f')](respondWithFilteredResult(_0x58f2a2,_0x3baf68))[_0xc3f8('0x25')](handleError(_0x58f2a2,null));};exports[_0xc3f8('0x49')]=function(_0x2813b4,_0x4ed198){var _0x2a69db={'raw':!![],'where':{'id':_0x2813b4[_0xc3f8('0x4a')]['id']}},_0x3f5699={};_0x3f5699['model']=_[_0xc3f8('0x35')](db[_0xc3f8('0x34')][_0xc3f8('0x4b')]);_0x3f5699[_0xc3f8('0x36')]=_[_0xc3f8('0x35')](_0x2813b4[_0xc3f8('0x36')]);_0x3f5699['filters']=_[_0xc3f8('0x39')](_0x3f5699['model'],_0x3f5699[_0xc3f8('0x36')]);_0x2a69db[_0xc3f8('0x38')]=_[_0xc3f8('0x39')](_0x3f5699['model'],qs[_0xc3f8('0x4c')](_0x2813b4[_0xc3f8('0x36')][_0xc3f8('0x4c')]));_0x2a69db['attributes']=_0x2a69db[_0xc3f8('0x38')][_0xc3f8('0x3b')]?_0x2a69db[_0xc3f8('0x38')]:_0x3f5699[_0xc3f8('0x3a')];if(_0x2813b4['query'][_0xc3f8('0x4d')]){_0x2a69db[_0xc3f8('0x48')]=[{'all':!![]}];}_0x2a69db=_[_0xc3f8('0x40')]({},_0x2a69db,_0x2813b4['options']);return db[_0xc3f8('0x34')][_0xc3f8('0x4e')](_0x2a69db)[_0xc3f8('0x1f')](handleEntityNotFound(_0x4ed198,null))[_0xc3f8('0x1f')](respondWithResult(_0x4ed198,null))[_0xc3f8('0x25')](handleError(_0x4ed198,null));};exports[_0xc3f8('0x4f')]=function(_0x248eba,_0x20d2a4,_0x18d66b){var _0x1ea102;return db[_0xc3f8('0x50')][_0xc3f8('0x51')](function(_0x410d27){return db[_0xc3f8('0x34')]['create'](_0x248eba[_0xc3f8('0x52')],{'raw':!![]})[_0xc3f8('0x1f')](function(_0x458353){_0x1ea102=_0x458353;return db['Network'][_0xc3f8('0x53')]({'where':{'type':_0x248eba['body']['type']},'raw':!![]});})['then'](function(_0x242fd2){var _0x1e8797=fs['readFileSync'](path[_0xc3f8('0x54')](config[_0xc3f8('0x55')],_0xc3f8('0x56')),_0xc3f8('0x57'));var _0xf4e9f3=ejs[_0xc3f8('0x58')](_0x1e8797,{'networks':_0x242fd2||[]});fs[_0xc3f8('0x59')](util[_0xc3f8('0x5a')](_0xc3f8('0x5b'),_0x248eba[_0xc3f8('0x52')]['type'][_0xc3f8('0x5c')]()),_0xf4e9f3);})[_0xc3f8('0x1f')](function(){return respondWithRpcPromise('Reload',_0xc3f8('0x4f'),{'module':_0xc3f8('0x5d')});})[_0xc3f8('0x1f')](function(){return _0x1ea102;});})[_0xc3f8('0x1f')](respondWithResult(_0x20d2a4,0xc9))[_0xc3f8('0x25')](handleError(_0x20d2a4,null));};exports[_0xc3f8('0x2f')]=function(_0x13235e,_0x3e872b,_0x395507){var _0x246ef1;return db[_0xc3f8('0x50')][_0xc3f8('0x51')](function(_0x45fe54){return db[_0xc3f8('0x34')]['find']({'where':{'id':_0x13235e[_0xc3f8('0x4a')]['id']}})[_0xc3f8('0x1f')](handleEntityNotFound(_0x3e872b,null))[_0xc3f8('0x1f')](saveUpdates(_0x13235e[_0xc3f8('0x52')],null))[_0xc3f8('0x1f')](function(_0x1053f2){if(_0x1053f2){_0x246ef1=_0x1053f2;return db[_0xc3f8('0x34')]['findAll']({'where':{'type':_0x246ef1[_0xc3f8('0x42')]},'raw':!![]});}return null;})['then'](function(_0x3ea781){if(_0x3ea781){var _0x5b22b3=fs[_0xc3f8('0x5e')](path['join'](config[_0xc3f8('0x55')],_0xc3f8('0x56')),_0xc3f8('0x57'));var _0x32bb87=ejs['render'](_0x5b22b3,{'networks':_0x3ea781||[]});fs[_0xc3f8('0x59')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x246ef1['type'][_0xc3f8('0x5c')]()),_0x32bb87);return respondWithRpcPromise('Reload',_0xc3f8('0x2f'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x190633){if(_0x190633){return _0x246ef1;}return null;});})[_0xc3f8('0x1f')](respondWithResult(_0x3e872b,null))[_0xc3f8('0x25')](handleError(_0x3e872b,null));};exports[_0xc3f8('0x30')]=function(_0x520eed,_0x488bbf,_0x414296){var _0x5d0ea3;return db[_0xc3f8('0x34')]['find']({'where':{'id':_0x520eed[_0xc3f8('0x4a')]['id']}})[_0xc3f8('0x1f')](function(_0x218ded){_0x5d0ea3=_0x218ded;return _0x218ded;})['then'](handleEntityNotFound(_0x488bbf,null))[_0xc3f8('0x1f')](removeEntity(_0x488bbf,null))[_0xc3f8('0x1f')](function(){if(_0x5d0ea3){return db[_0xc3f8('0x34')][_0xc3f8('0x53')]({'where':{'type':_0x5d0ea3[_0xc3f8('0x42')]},'raw':!![]});}})[_0xc3f8('0x1f')](function(_0x5a4365){if(_0x5a4365){var _0x5aa7d3=fs['readFileSync'](path['join'](config[_0xc3f8('0x55')],_0xc3f8('0x56')),_0xc3f8('0x57'));var _0x1a898c=ejs[_0xc3f8('0x58')](_0x5aa7d3,{'networks':_0x5a4365||[]});fs[_0xc3f8('0x59')](util[_0xc3f8('0x5a')](_0xc3f8('0x5b'),_0x5d0ea3[_0xc3f8('0x42')]['toLowerCase']()),_0x1a898c);return respondWithRpcPromise(_0xc3f8('0x5f'),'destroy',{'module':_0xc3f8('0x5d')});}})['catch'](handleError(_0x488bbf,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index c0a55d7..f359be8 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 _0x99ea=['rimraf','../../config/environment','./network.attributes','define','Network','network','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0xf35c95,_0x59b595){var _0x2199bf=function(_0x2e9f54){while(--_0x2e9f54){_0xf35c95['push'](_0xf35c95['shift']());}};_0x2199bf(++_0x59b595);}(_0x99ea,0x8a));var _0xa99e=function(_0xa79977,_0x4f7f12){_0xa79977=_0xa79977-0x0;var _0x109f10=_0x99ea[_0xa79977];return _0x109f10;};'use strict';var _=require(_0xa99e('0x0'));var util=require(_0xa99e('0x1'));var logger=require(_0xa99e('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa99e('0x3'));var rp=require(_0xa99e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa99e('0x5'));var config=require(_0xa99e('0x6'));var attributes=require(_0xa99e('0x7'));module['exports']=function(_0x34fa69,_0x2e9c44){return _0x34fa69[_0xa99e('0x8')](_0xa99e('0x9'),attributes,{'tableName':_0xa99e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x69b2=['lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./network.attributes','exports','define','Network','network'];(function(_0x1af658,_0x399caf){var _0x493cf7=function(_0x562646){while(--_0x562646){_0x1af658['push'](_0x1af658['shift']());}};_0x493cf7(++_0x399caf);}(_0x69b2,0x174));var _0x269b=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x69b2[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0x269b('0x0'));var util=require('util');var logger=require(_0x269b('0x1'))(_0x269b('0x2'));var moment=require(_0x269b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x269b('0x4'));var rimraf=require(_0x269b('0x5'));var config=require(_0x269b('0x6'));var attributes=require(_0x269b('0x7'));module[_0x269b('0x8')]=function(_0x40cbd1,_0x1f619b){return _0x40cbd1[_0x269b('0x9')](_0x269b('0xa'),attributes,{'tableName':_0x269b('0xb'),'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 cb33273..85baf24 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 _0xd67b=['Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s'];(function(_0x94d88a,_0x26c254){var _0x1ea07e=function(_0x451ee8){while(--_0x451ee8){_0x94d88a['push'](_0x94d88a['shift']());}};_0x1ea07e(++_0x26c254);}(_0xd67b,0x133));var _0xbd67=function(_0xe92cf4,_0x4c8f98){_0xe92cf4=_0xe92cf4-0x0;var _0x53bfe0=_0xd67b[_0xe92cf4];return _0x53bfe0;};'use strict';var _=require('lodash');var util=require(_0xbd67('0x0'));var moment=require('moment');var BPromise=require(_0xbd67('0x1'));var rs=require(_0xbd67('0x2'));var fs=require('fs');var Redis=require(_0xbd67('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbd67('0x4'));var logger=require('../../config/logger')(_0xbd67('0x5'));var config=require('../../config/environment');var jayson=require(_0xbd67('0x6'));var client=jayson[_0xbd67('0x7')][_0xbd67('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27b016,_0x1860c9,_0x72f9ac){return new BPromise(function(_0x2d4af6,_0xfad775){return client[_0xbd67('0x9')](_0x27b016,_0x72f9ac)[_0xbd67('0xa')](function(_0x177f41){logger[_0xbd67('0xb')](_0xbd67('0xc'),_0x1860c9,'request\x20sent');logger['debug'](_0xbd67('0xd'),_0x1860c9,'request\x20sent',JSON[_0xbd67('0xe')](_0x177f41));if(_0x177f41[_0xbd67('0xf')]){if(_0x177f41[_0xbd67('0xf')][_0xbd67('0x10')]===0x1f4){logger[_0xbd67('0xf')](_0xbd67('0xc'),_0x1860c9,_0x177f41[_0xbd67('0xf')][_0xbd67('0x11')]);return _0xfad775(_0x177f41[_0xbd67('0xf')][_0xbd67('0x11')]);}logger['error'](_0xbd67('0xc'),_0x1860c9,_0x177f41[_0xbd67('0xf')][_0xbd67('0x11')]);return _0x2d4af6(_0x177f41[_0xbd67('0xf')][_0xbd67('0x11')]);}else{logger[_0xbd67('0xb')](_0xbd67('0xc'),_0x1860c9,_0xbd67('0x12'));_0x2d4af6(_0x177f41[_0xbd67('0x13')][_0xbd67('0x11')]);}})['catch'](function(_0x4ab3a6){logger[_0xbd67('0xf')](_0xbd67('0xc'),_0x1860c9,_0x4ab3a6);_0xfad775(_0x4ab3a6);});});} \ No newline at end of file +var _0x0f4d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x620425,_0x280675){var _0x43497b=function(_0x483829){while(--_0x483829){_0x620425['push'](_0x620425['shift']());}};_0x43497b(++_0x280675);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x1e44a0,_0x199bd2){_0x1e44a0=_0x1e44a0-0x0;var _0x5b2d0b=_0x0f4d[_0x1e44a0];return _0x5b2d0b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd0f4('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd0f4('0x1'));var db=require(_0xd0f4('0x2'))['db'];var utils=require(_0xd0f4('0x3'));var logger=require(_0xd0f4('0x4'))(_0xd0f4('0x5'));var config=require(_0xd0f4('0x6'));var jayson=require(_0xd0f4('0x7'));var client=jayson[_0xd0f4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1164da,_0x27acb8,_0x4d0ab0){return new BPromise(function(_0x3992be,_0x2a0057){return client['request'](_0x1164da,_0x4d0ab0)[_0xd0f4('0x9')](function(_0x2570f0){logger['info'](_0xd0f4('0xa'),_0x27acb8,_0xd0f4('0xb'));logger[_0xd0f4('0xc')]('Network,\x20%s,\x20%s,\x20%s',_0x27acb8,'request\x20sent',JSON[_0xd0f4('0xd')](_0x2570f0));if(_0x2570f0[_0xd0f4('0xe')]){if(_0x2570f0[_0xd0f4('0xe')][_0xd0f4('0xf')]===0x1f4){logger[_0xd0f4('0xe')](_0xd0f4('0xa'),_0x27acb8,_0x2570f0[_0xd0f4('0xe')]['message']);return _0x2a0057(_0x2570f0[_0xd0f4('0xe')][_0xd0f4('0x10')]);}logger['error'](_0xd0f4('0xa'),_0x27acb8,_0x2570f0['error'][_0xd0f4('0x10')]);return _0x3992be(_0x2570f0['error'][_0xd0f4('0x10')]);}else{logger['info']('Network,\x20%s,\x20%s',_0x27acb8,'request\x20sent');_0x3992be(_0x2570f0[_0xd0f4('0x11')][_0xd0f4('0x10')]);}})[_0xd0f4('0x12')](function(_0x46c005){logger[_0xd0f4('0xe')](_0xd0f4('0xa'),_0x27acb8,_0x46c005);_0x2a0057(_0x46c005);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 1f37a81..826139c 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 _0x745d=['show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','create','post','addAnswer','/:id/notify','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x5ad67c,_0x144860){var _0xccce2e=function(_0x2dd95c){while(--_0x2dd95c){_0x5ad67c['push'](_0x5ad67c['shift']());}};_0xccce2e(++_0x144860);}(_0x745d,0x194));var _0xd745=function(_0x4fb3ab,_0x7d47df){_0x4fb3ab=_0x4fb3ab-0x0;var _0x428152=_0x745d[_0x4fb3ab];return _0x428152;};'use strict';var multer=require(_0xd745('0x0'));var util=require('util');var path=require(_0xd745('0x1'));var timeout=require(_0xd745('0x2'));var express=require(_0xd745('0x3'));var router=express['Router']();var auth=require(_0xd745('0x4'));var interaction=require(_0xd745('0x5'));var config=require(_0xd745('0x6'));var controller=require(_0xd745('0x7'));router[_0xd745('0x8')]('/',auth[_0xd745('0x9')](),controller[_0xd745('0xa')]);router[_0xd745('0x8')](_0xd745('0xb'),auth[_0xd745('0x9')](),controller[_0xd745('0xc')]);router[_0xd745('0x8')](_0xd745('0xd'),auth[_0xd745('0x9')](),controller[_0xd745('0xe')]);router[_0xd745('0x8')](_0xd745('0xf'),auth['isAuthenticated'](),controller[_0xd745('0x10')]);router['get'](_0xd745('0x11'),auth['isAuthenticated'](),controller[_0xd745('0x12')]);router[_0xd745('0x8')](_0xd745('0x13'),auth[_0xd745('0x9')](),controller[_0xd745('0x14')]);router[_0xd745('0x8')](_0xd745('0x15'),auth[_0xd745('0x9')](),controller[_0xd745('0x16')]);router[_0xd745('0x8')](_0xd745('0x17'),auth[_0xd745('0x9')](),controller[_0xd745('0x18')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd745('0x19')]);router['post'](_0xd745('0xf'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xd745('0x1a')]('/:id/canned_answers',auth[_0xd745('0x9')](),controller[_0xd745('0x1b')]);router['post'](_0xd745('0x1c'),controller['notify']);router[_0xd745('0x1a')](_0xd745('0x13'),auth[_0xd745('0x9')](),controller['addApplications']);router[_0xd745('0x1a')](_0xd745('0x17'),auth[_0xd745('0x9')](),controller[_0xd745('0x1d')]);router[_0xd745('0x1a')](_0xd745('0x1e'),auth[_0xd745('0x9')](),controller[_0xd745('0x1f')]);router[_0xd745('0x20')]('/:id',auth['isAuthenticated'](),controller[_0xd745('0x21')]);router[_0xd745('0x22')](_0xd745('0xd'),auth[_0xd745('0x9')](),controller[_0xd745('0x23')]);router[_0xd745('0x22')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xd745('0x24')]);router[_0xd745('0x22')](_0xd745('0x11'),auth[_0xd745('0x9')](),controller['removeAnswers']);router[_0xd745('0x22')](_0xd745('0x17'),auth[_0xd745('0x9')](),controller[_0xd745('0x25')]);module['exports']=router; \ No newline at end of file +var _0xf51f=['multer','util','path','express','Router','../../components/interaction/service','./openchannelAccount.controller','isAuthenticated','get','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/applications','getApplications','/:id/interactions','getInteractions','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','update','delete','removeDispositions','removeAnswers','/:id/users','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf51f,0x144));var _0xff51=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0xf51f[_0xca1f0e];return _0x35e4ef;};'use strict';var multer=require(_0xff51('0x0'));var util=require(_0xff51('0x1'));var path=require(_0xff51('0x2'));var timeout=require('connect-timeout');var express=require(_0xff51('0x3'));var router=express[_0xff51('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xff51('0x5'));var config=require('../../config/environment');var controller=require(_0xff51('0x6'));router['get']('/',auth[_0xff51('0x7')](),controller['index']);router[_0xff51('0x8')](_0xff51('0x9'),auth[_0xff51('0x7')](),controller['describe']);router[_0xff51('0x8')](_0xff51('0xa'),auth[_0xff51('0x7')](),controller[_0xff51('0xb')]);router['get'](_0xff51('0xc'),auth['isAuthenticated'](),controller[_0xff51('0xd')]);router['get']('/:id/canned_answers',auth[_0xff51('0x7')](),controller['getAnswers']);router[_0xff51('0x8')](_0xff51('0xe'),auth[_0xff51('0x7')](),controller[_0xff51('0xf')]);router[_0xff51('0x8')](_0xff51('0x10'),auth[_0xff51('0x7')](),controller[_0xff51('0x11')]);router[_0xff51('0x8')]('/:id/users',auth[_0xff51('0x7')](),controller[_0xff51('0x12')]);router[_0xff51('0x13')]('/',auth[_0xff51('0x7')](),controller[_0xff51('0x14')]);router['post'](_0xff51('0xc'),auth['isAuthenticated'](),controller[_0xff51('0x15')]);router[_0xff51('0x13')](_0xff51('0x16'),auth[_0xff51('0x7')](),controller[_0xff51('0x17')]);router[_0xff51('0x13')](_0xff51('0x18'),controller[_0xff51('0x19')]);router[_0xff51('0x13')](_0xff51('0xe'),auth[_0xff51('0x7')](),controller[_0xff51('0x1a')]);router[_0xff51('0x13')]('/:id/users',auth[_0xff51('0x7')](),controller[_0xff51('0x1b')]);router[_0xff51('0x13')](_0xff51('0x1c'),auth[_0xff51('0x7')](),controller[_0xff51('0x1d')]);router['put']('/:id',auth[_0xff51('0x7')](),controller[_0xff51('0x1e')]);router[_0xff51('0x1f')](_0xff51('0xa'),auth[_0xff51('0x7')](),controller['destroy']);router['delete'](_0xff51('0xc'),auth[_0xff51('0x7')](),controller[_0xff51('0x20')]);router[_0xff51('0x1f')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xff51('0x21')]);router[_0xff51('0x1f')](_0xff51('0x22'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xff51('0x23')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 356a716..17c82a1 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 _0x9839=['generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name'];(function(_0xfdb2df,_0x5517ff){var _0x42dc28=function(_0x3b547e){while(--_0x3b547e){_0xfdb2df['push'](_0xfdb2df['shift']());}};_0x42dc28(++_0x5517ff);}(_0x9839,0x183));var _0x9983=function(_0x138464,_0x20d160){_0x138464=_0x138464-0x0;var _0x2cf34b=_0x9839[_0x138464];return _0x2cf34b;};'use strict';var Sequelize=require(_0x9983('0x0'));var rs=require(_0x9983('0x1'));module[_0x9983('0x2')]={'name':{'type':Sequelize[_0x9983('0x3')],'unique':_0x9983('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x9983('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x9983('0x5')]();}},'replyUri':{'type':Sequelize[_0x9983('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x9983('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9983('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x9983('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9983('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9983('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x9983('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9983('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9983('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9983('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x9983('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x9983('0x7')],'defaultValue':![],'comment':_0x9983('0xa'),'set':function(_0xf71186){if(!_0xf71186)this[_0x9983('0xb')](_0x9983('0xc'),null);this['setDataValue'](_0x9983('0xd'),_0xf71186);}}}; \ No newline at end of file +var _0x06a1=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','randomstring','exports','name','STRING','TEXT','BOOLEAN','INTEGER'];(function(_0x1c7586,_0x1d46bd){var _0x3bd9a1=function(_0x2f2d4d){while(--_0x2f2d4d){_0x1c7586['push'](_0x1c7586['shift']());}};_0x3bd9a1(++_0x1d46bd);}(_0x06a1,0xa8));var _0x106a=function(_0x141929,_0x5a30c2){_0x141929=_0x141929-0x0;var _0x19637d=_0x06a1[_0x141929];return _0x19637d;};'use strict';var Sequelize=require(_0x106a('0x0'));var rs=require(_0x106a('0x1'));module[_0x106a('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x106a('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x106a('0x4')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x106a('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x106a('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x106a('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x106a('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x106a('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x106a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x106a('0x4')]},'queueTransfer':{'type':Sequelize[_0x106a('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x106a('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x106a('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x106a('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x106a('0x6')],'defaultValue':![],'comment':_0x106a('0x9'),'set':function(_0x34331f){if(!_0x34331f)this[_0x106a('0xa')]('mandatoryDispositionPauseId',null);this[_0x106a('0xa')]('mandatoryDisposition',_0x34331f);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 787c4a6..9e26d5f 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 _0xa3a5=['startRouting','EventManager','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','User','Owner','Tag','Tags','color','tag','omit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','emit','getAgents','ListId','dataValues','Messages','push','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelAccount.socket','register','jayson/promise','client','http','test','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','map','key','VIRTUAL','field','filter','options','count','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpnechannelAccountId','Disposition','findOne','OpenchannelAccountId','includeAll','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','CmContact','DESC','OpenchannelApplication','account','Applications','applications','orderBy','priority','asc','Contacts','firstName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','contact','lastName','messageId','interaction','created','autoclose','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','forcedOwnership','Start'];(function(_0x74c367,_0x169b3e){var _0x4c680a=function(_0x4cd7cd){while(--_0x4cd7cd){_0x74c367['push'](_0x74c367['shift']());}};_0x4c680a(++_0x169b3e);}(_0xa3a5,0xdd));var _0x5a3a=function(_0x2864ff,_0x4bc528){_0x2864ff=_0x2864ff-0x0;var _0x42c207=_0xa3a5[_0x2864ff];return _0x42c207;};'use strict';var pdf=require(_0x5a3a('0x0'));var emlformat=require(_0x5a3a('0x1'));var rimraf=require(_0x5a3a('0x2'));var zipdir=require(_0x5a3a('0x3'));var jsonpatch=require(_0x5a3a('0x4'));var rp=require(_0x5a3a('0x5'));var moment=require(_0x5a3a('0x6'));var BPromise=require(_0x5a3a('0x7'));var Mustache=require(_0x5a3a('0x8'));var util=require(_0x5a3a('0x9'));var path=require(_0x5a3a('0xa'));var sox=require(_0x5a3a('0xb'));var csv=require(_0x5a3a('0xc'));var ejs=require(_0x5a3a('0xd'));var fs=require('fs');var _=require(_0x5a3a('0xe'));var squel=require(_0x5a3a('0xf'));var crypto=require(_0x5a3a('0x10'));var jsforce=require(_0x5a3a('0x11'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5a3a('0x12'));var Redis=require(_0x5a3a('0x13'));var authService=require(_0x5a3a('0x14'));var qs=require(_0x5a3a('0x15'));var hardwareService=require(_0x5a3a('0x16'));var logger=require(_0x5a3a('0x17'))(_0x5a3a('0x18'));var utils=require(_0x5a3a('0x19'));var config=require(_0x5a3a('0x1a'));var db=require(_0x5a3a('0x1b'))['db'];config[_0x5a3a('0x1c')]=_[_0x5a3a('0x1d')](config['redis'],{'host':_0x5a3a('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5a3a('0x1c')]));require(_0x5a3a('0x1f'))[_0x5a3a('0x20')](socket);var jayson=require(_0x5a3a('0x21'));var client=jayson[_0x5a3a('0x22')][_0x5a3a('0x23')]({'port':0x232c});var client9002=jayson[_0x5a3a('0x22')][_0x5a3a('0x23')]({'port':0x232a});function checkPasswordPattern(_0xd868cb,_0xe49683,_0x349dc9){if(_0x349dc9){var _0x112cd8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x112cd8[_0x5a3a('0x24')](_0xe49683)){return _0xd868cb;}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 _0xd868cb;}}function respondWithRpcPromise(_0x4a8d5d,_0x123b68,_0x440a0c,_0x4da10e){return new BPromise(function(_0x138a9c,_0x127447){var _0x146344=_0x4da10e||client;return _0x146344[_0x5a3a('0x25')](_0x4a8d5d,_0x440a0c)[_0x5a3a('0x26')](function(_0x438192){logger[_0x5a3a('0x27')](_0x5a3a('0x28'),_0x123b68,_0x5a3a('0x29'));logger[_0x5a3a('0x2a')](_0x5a3a('0x2b'),_0x123b68,_0x5a3a('0x29'),JSON[_0x5a3a('0x2c')](_0x438192));if(_0x438192['error']){if(_0x438192[_0x5a3a('0x2d')][_0x5a3a('0x2e')]===0x1f4){logger[_0x5a3a('0x2d')](_0x5a3a('0x28'),_0x123b68,_0x438192[_0x5a3a('0x2d')][_0x5a3a('0x2f')]);return _0x127447(_0x438192[_0x5a3a('0x2d')]['message']);}logger[_0x5a3a('0x2d')](_0x5a3a('0x28'),_0x123b68,_0x438192[_0x5a3a('0x2d')]['message']);return _0x138a9c(_0x438192[_0x5a3a('0x2d')][_0x5a3a('0x2f')]);}else{logger[_0x5a3a('0x27')](_0x5a3a('0x28'),_0x123b68,'request\x20sent');_0x138a9c(_0x438192['result'][_0x5a3a('0x2f')]);}})[_0x5a3a('0x30')](function(_0x868c97){logger['error'](_0x5a3a('0x28'),_0x123b68,_0x868c97);_0x127447(_0x868c97);});});}function respondWithStatusCode(_0x3d0134,_0x4b19fb){_0x4b19fb=_0x4b19fb||0xcc;return function(_0x220481){if(_0x220481){return _0x3d0134[_0x5a3a('0x31')](_0x4b19fb);}return _0x3d0134[_0x5a3a('0x32')](_0x4b19fb)[_0x5a3a('0x33')]();};}function respondWithResult(_0xd65963,_0x54e83b){_0x54e83b=_0x54e83b||0xc8;return function(_0x5a5acc){if(_0x5a5acc){return _0xd65963[_0x5a3a('0x32')](_0x54e83b)[_0x5a3a('0x34')](_0x5a5acc);}};}function respondWithFilteredResult(_0x387777,_0x46e1e9){return function(_0x4e22e5){if(_0x4e22e5){var _0x540204=_0x4e22e5['count'],_0x2b79ff=_0x46e1e9[_0x5a3a('0x35')],_0x24720f=_0x46e1e9[_0x5a3a('0x35')]+_0x46e1e9['limit'],_0xa0b004;if(_0x24720f>=_0x540204){_0x24720f=_0x540204;_0xa0b004=0xc8;}else{_0xa0b004=0xce;}_0x387777['status'](_0xa0b004);return _0x387777[_0x5a3a('0x36')](_0x5a3a('0x37'),_0x2b79ff+'-'+_0x24720f+'/'+_0x540204)[_0x5a3a('0x34')](_0x4e22e5);}return null;};}function patchUpdates(_0xcdfea7){return function(_0x6116d){try{jsonpatch[_0x5a3a('0x38')](_0x6116d,_0xcdfea7,!![]);}catch(_0x579779){return BPromise[_0x5a3a('0x39')](_0x579779);}return _0x6116d[_0x5a3a('0x3a')]();};}function saveUpdates(_0x31f6de,_0x280c3d){return function(_0x4855b6){if(_0x4855b6){return _0x4855b6[_0x5a3a('0x3b')](_0x31f6de)[_0x5a3a('0x26')](function(_0x1c746d){return _0x1c746d;});}return null;};}function removeEntity(_0x3b9094,_0x5bd11c){return function(_0x32d302){if(_0x32d302){return _0x32d302[_0x5a3a('0x3c')]()[_0x5a3a('0x26')](function(){var _0x481e4c=_0x32d302[_0x5a3a('0x3d')]({'plain':!![]});var _0x1d35e2=_0x5a3a('0x3e');return db[_0x5a3a('0x3f')][_0x5a3a('0x3c')]({'where':{'type':_0x1d35e2,'resourceId':_0x481e4c['id']}})[_0x5a3a('0x26')](function(){return _0x32d302;});})[_0x5a3a('0x26')](function(){_0x3b9094['status'](0xcc)[_0x5a3a('0x33')]();});}};}function handleEntityNotFound(_0x3aa0fc,_0x2ec9c1){return function(_0x5055e5){if(!_0x5055e5){_0x3aa0fc[_0x5a3a('0x31')](0x194);}return _0x5055e5;};}function handleError(_0x4e0b47,_0x2ad216){_0x2ad216=_0x2ad216||0x1f4;return function(_0x3308d2){logger[_0x5a3a('0x2d')](_0x3308d2[_0x5a3a('0x40')]);if(_0x3308d2['name']){delete _0x3308d2[_0x5a3a('0x41')];}_0x4e0b47[_0x5a3a('0x32')](_0x2ad216)[_0x5a3a('0x42')](_0x3308d2);};}exports[_0x5a3a('0x43')]=function(_0x29db11,_0x38a97b){var _0x1e93af={'include':[{'model':db[_0x5a3a('0x44')],'as':_0x5a3a('0x45')}]},_0x249120={},_0x6d6254={'count':0x0,'rows':[]};var _0x2100fd=db[_0x5a3a('0x46')][_0x5a3a('0x47')];_0x249120[_0x5a3a('0x48')]=_[_0x5a3a('0x49')](_0x2100fd);_0x249120['query']=_['keys'](_0x29db11[_0x5a3a('0x4a')]);_0x249120[_0x5a3a('0x4b')]=_[_0x5a3a('0x4c')](_0x249120['model'],_0x249120[_0x5a3a('0x4a')]);_0x1e93af[_0x5a3a('0x4d')]=_[_0x5a3a('0x4c')](_0x249120['model'],qs[_0x5a3a('0x4e')](_0x29db11['query'][_0x5a3a('0x4e')]));_0x1e93af[_0x5a3a('0x4d')]=_0x1e93af[_0x5a3a('0x4d')][_0x5a3a('0x4f')]?_0x1e93af[_0x5a3a('0x4d')]:_0x249120[_0x5a3a('0x48')];if(!_0x29db11[_0x5a3a('0x4a')][_0x5a3a('0x50')](_0x5a3a('0x51'))){_0x1e93af[_0x5a3a('0x52')]=qs[_0x5a3a('0x52')](_0x29db11[_0x5a3a('0x4a')][_0x5a3a('0x52')]);_0x1e93af[_0x5a3a('0x35')]=qs[_0x5a3a('0x35')](_0x29db11[_0x5a3a('0x4a')][_0x5a3a('0x35')]);}_0x1e93af[_0x5a3a('0x53')]=qs[_0x5a3a('0x54')](_0x29db11['query'][_0x5a3a('0x54')]);_0x1e93af['where']=qs[_0x5a3a('0x4b')](_[_0x5a3a('0x55')](_0x29db11['query'],_0x249120[_0x5a3a('0x4b')]));if(_0x29db11[_0x5a3a('0x4a')]['filter']){_0x1e93af[_0x5a3a('0x56')]=_[_0x5a3a('0x57')](_0x1e93af[_0x5a3a('0x56')],{'$or':_[_0x5a3a('0x58')](_0x2100fd,function(_0x122e2e){if(_0x122e2e['type'][_0x5a3a('0x59')]!==_0x5a3a('0x5a')){var _0x3c7a4={};_0x3c7a4[_0x122e2e[_0x5a3a('0x5b')]]={'$like':'%'+_0x29db11[_0x5a3a('0x4a')][_0x5a3a('0x5c')]+'%'};return _0x3c7a4;}})});}_0x1e93af=_['merge']({},_0x1e93af,_0x29db11[_0x5a3a('0x5d')]);var _0x21bc98={'where':_0x1e93af[_0x5a3a('0x56')]};return db[_0x5a3a('0x46')][_0x5a3a('0x5e')](_0x21bc98)[_0x5a3a('0x26')](function(_0x4cd83e){_0x6d6254[_0x5a3a('0x5e')]=_0x4cd83e;if(_0x29db11['query']['includeAll']){_0x1e93af[_0x5a3a('0x5f')]=[{'all':!![]}];}return db[_0x5a3a('0x46')][_0x5a3a('0x60')](_0x1e93af);})[_0x5a3a('0x26')](function(_0x4a10a6){_0x6d6254[_0x5a3a('0x61')]=_0x4a10a6;return _0x6d6254;})[_0x5a3a('0x26')](respondWithFilteredResult(_0x38a97b,_0x1e93af))['catch'](handleError(_0x38a97b,null));};exports[_0x5a3a('0x62')]=function(_0x11e8d4,_0x30f67d){var _0x302de7={'raw':![],'where':{'id':_0x11e8d4[_0x5a3a('0x63')]['id']},'include':[{'model':db[_0x5a3a('0x44')],'as':_0x5a3a('0x45')}]},_0x7448de={};_0x7448de[_0x5a3a('0x48')]=_['keys'](db[_0x5a3a('0x46')]['rawAttributes']);_0x7448de['query']=_[_0x5a3a('0x49')](_0x11e8d4[_0x5a3a('0x4a')]);_0x7448de[_0x5a3a('0x4b')]=_[_0x5a3a('0x4c')](_0x7448de[_0x5a3a('0x48')],_0x7448de[_0x5a3a('0x4a')]);_0x302de7[_0x5a3a('0x4d')]=_[_0x5a3a('0x4c')](_0x7448de[_0x5a3a('0x48')],qs[_0x5a3a('0x4e')](_0x11e8d4['query'][_0x5a3a('0x4e')]));_0x302de7[_0x5a3a('0x4d')]=_0x302de7[_0x5a3a('0x4d')]['length']?_0x302de7[_0x5a3a('0x4d')]:_0x7448de[_0x5a3a('0x48')];if(_0x11e8d4[_0x5a3a('0x4a')]['includeAll']){_0x302de7[_0x5a3a('0x5f')]=[{'all':!![]}];}_0x302de7=_[_0x5a3a('0x57')]({},_0x302de7,_0x11e8d4[_0x5a3a('0x5d')]);return db[_0x5a3a('0x46')][_0x5a3a('0x64')](_0x302de7)[_0x5a3a('0x26')](handleEntityNotFound(_0x30f67d,null))[_0x5a3a('0x26')](respondWithResult(_0x30f67d,null))['catch'](handleError(_0x30f67d,null));};exports[_0x5a3a('0x65')]=function(_0x33bab9,_0x394d6d){return db[_0x5a3a('0x46')][_0x5a3a('0x65')](_0x33bab9[_0x5a3a('0x66')],{})[_0x5a3a('0x26')](function(_0x5b7126){var _0x3adc50=_0x33bab9[_0x5a3a('0x67')]['get']({'plain':!![]});if(!_0x3adc50)throw new Error(_0x5a3a('0x68'));if(_0x3adc50[_0x5a3a('0x69')]==='user'){var _0x567f34=_0x5b7126[_0x5a3a('0x3d')]({'plain':!![]});var _0x4ff3ae=_0x5a3a('0x3e');return db[_0x5a3a('0x6a')][_0x5a3a('0x64')]({'where':{'name':_0x4ff3ae,'userProfileId':_0x3adc50[_0x5a3a('0x6b')]},'raw':!![]})[_0x5a3a('0x26')](function(_0x2b61b2){if(_0x2b61b2&&_0x2b61b2['autoAssociation']===0x0){return db[_0x5a3a('0x3f')][_0x5a3a('0x65')]({'name':_0x567f34[_0x5a3a('0x41')],'resourceId':_0x567f34['id'],'type':_0x2b61b2[_0x5a3a('0x41')],'sectionId':_0x2b61b2['id']},{})[_0x5a3a('0x26')](function(){return _0x5b7126;});}else{return _0x5b7126;}})[_0x5a3a('0x30')](function(_0x5d4d78){logger['error'](_0x5a3a('0x6c'),_0x5d4d78);throw _0x5d4d78;});}return _0x5b7126;})[_0x5a3a('0x26')](respondWithResult(_0x394d6d,0xc9))[_0x5a3a('0x30')](handleError(_0x394d6d,null));};exports['update']=function(_0x82f7d1,_0xb2bb3f){if(_0x82f7d1[_0x5a3a('0x66')]['id']){delete _0x82f7d1[_0x5a3a('0x66')]['id'];}return db[_0x5a3a('0x46')][_0x5a3a('0x64')]({'where':{'id':_0x82f7d1[_0x5a3a('0x63')]['id']},'include':[{'model':db[_0x5a3a('0x44')],'as':_0x5a3a('0x45')}]})[_0x5a3a('0x26')](handleEntityNotFound(_0xb2bb3f,null))[_0x5a3a('0x26')](saveUpdates(_0x82f7d1[_0x5a3a('0x66')],null))['then'](respondWithResult(_0xb2bb3f,null))[_0x5a3a('0x30')](handleError(_0xb2bb3f,null));};exports[_0x5a3a('0x3c')]=function(_0x5b9dce,_0x4c3bba){return db[_0x5a3a('0x46')][_0x5a3a('0x64')]({'where':{'id':_0x5b9dce[_0x5a3a('0x63')]['id']}})[_0x5a3a('0x26')](handleEntityNotFound(_0x4c3bba,null))['then'](removeEntity(_0x4c3bba,null))[_0x5a3a('0x30')](handleError(_0x4c3bba,null));};exports[_0x5a3a('0x6d')]=function(_0x42a74b,_0x55e15c){return db[_0x5a3a('0x46')]['describe']()[_0x5a3a('0x26')](respondWithResult(_0x55e15c,null))[_0x5a3a('0x30')](handleError(_0x55e15c,null));};exports[_0x5a3a('0x6e')]=function(_0x4b5c44,_0xd5fd7c,_0x49a0d6){if(_0x4b5c44[_0x5a3a('0x66')]['id']){delete _0x4b5c44[_0x5a3a('0x66')]['id'];}return db[_0x5a3a('0x46')][_0x5a3a('0x64')]({'where':{'id':_0x4b5c44['params']['id']}})['then'](handleEntityNotFound(_0xd5fd7c,null))[_0x5a3a('0x26')](function(_0x50d238){if(_0x50d238){_0x4b5c44['body'][_0x5a3a('0x6f')]=_0x50d238['id'];return db[_0x5a3a('0x70')][_0x5a3a('0x65')](_0x4b5c44[_0x5a3a('0x66')]);}})[_0x5a3a('0x26')](respondWithResult(_0xd5fd7c,null))[_0x5a3a('0x30')](handleError(_0xd5fd7c,null));};exports['getDispositions']=function(_0x2164dc,_0x4f4334,_0x250d38){var _0x8f05a7={'raw':![],'where':{}};var _0x3aeecc={};var _0xc4c3e5={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x5a3a('0x71')]({'where':{'id':_0x2164dc[_0x5a3a('0x63')]['id']}})['then'](handleEntityNotFound(_0x4f4334,null))['then'](function(_0x1d6e4e){if(_0x1d6e4e){_0x3aeecc[_0x5a3a('0x48')]=_['keys'](db['Disposition'][_0x5a3a('0x47')]);_0x3aeecc['query']=_[_0x5a3a('0x49')](_0x2164dc['query']);_0x3aeecc[_0x5a3a('0x4b')]=_[_0x5a3a('0x4c')](_0x3aeecc[_0x5a3a('0x48')],_0x3aeecc[_0x5a3a('0x4a')]);_0x8f05a7[_0x5a3a('0x4d')]=_[_0x5a3a('0x4c')](_0x3aeecc['model'],qs['fields'](_0x2164dc[_0x5a3a('0x4a')][_0x5a3a('0x4e')]));_0x8f05a7['attributes']=_0x8f05a7[_0x5a3a('0x4d')][_0x5a3a('0x4f')]?_0x8f05a7['attributes']:_0x3aeecc['model'];if(!_0x2164dc['query'][_0x5a3a('0x50')](_0x5a3a('0x51'))){_0x8f05a7[_0x5a3a('0x52')]=qs[_0x5a3a('0x52')](_0x2164dc[_0x5a3a('0x4a')][_0x5a3a('0x52')]);_0x8f05a7[_0x5a3a('0x35')]=qs[_0x5a3a('0x35')](_0x2164dc['query']['offset']);}_0x8f05a7[_0x5a3a('0x53')]=qs[_0x5a3a('0x54')](_0x2164dc['query'][_0x5a3a('0x54')]);_0x8f05a7[_0x5a3a('0x56')]=qs[_0x5a3a('0x4b')](_['pick'](_0x2164dc['query'],_0x3aeecc[_0x5a3a('0x4b')]));_0x8f05a7[_0x5a3a('0x56')][_0x5a3a('0x72')]=_0x1d6e4e['id'];if(_0x2164dc[_0x5a3a('0x4a')][_0x5a3a('0x5c')]){_0x8f05a7[_0x5a3a('0x56')]=_[_0x5a3a('0x57')](_0x8f05a7[_0x5a3a('0x56')],{'$or':_[_0x5a3a('0x58')](_0x8f05a7[_0x5a3a('0x4d')],function(_0x199809){var _0x293656={};_0x293656[_0x199809]={'$like':'%'+_0x2164dc[_0x5a3a('0x4a')][_0x5a3a('0x5c')]+'%'};return _0x293656;})});}_0x8f05a7=_['merge']({},_0x8f05a7,_0x2164dc[_0x5a3a('0x5d')]);return db[_0x5a3a('0x70')]['count']({'where':_0x8f05a7[_0x5a3a('0x56')]})['then'](function(_0x4eee1f){_0xc4c3e5[_0x5a3a('0x5e')]=_0x4eee1f;if(_0x2164dc[_0x5a3a('0x4a')][_0x5a3a('0x73')]){_0x8f05a7['include']=[{'all':!![]}];}return db[_0x5a3a('0x70')][_0x5a3a('0x60')](_0x8f05a7);})[_0x5a3a('0x26')](function(_0x25a09d){_0xc4c3e5[_0x5a3a('0x61')]=_0x25a09d;return _0xc4c3e5;});}})['then'](respondWithFilteredResult(_0x4f4334,_0x8f05a7))[_0x5a3a('0x30')](handleError(_0x4f4334,null));};exports[_0x5a3a('0x74')]=function(_0x469235,_0x18d754,_0x5765e0){return db[_0x5a3a('0x46')][_0x5a3a('0x64')]({'where':{'id':_0x469235[_0x5a3a('0x63')]['id']}})[_0x5a3a('0x26')](handleEntityNotFound(_0x18d754,null))[_0x5a3a('0x26')](function(_0x17776a){if(_0x17776a){return _0x17776a['removeDispositions'](_0x469235[_0x5a3a('0x4a')][_0x5a3a('0x75')]);}})[_0x5a3a('0x26')](respondWithStatusCode(_0x18d754,null))['catch'](handleError(_0x18d754,null));};exports['addAnswer']=function(_0x4ed0a3,_0x165291,_0x4e67f7){if(_0x4ed0a3['body']['id']){delete _0x4ed0a3[_0x5a3a('0x66')]['id'];}return db[_0x5a3a('0x46')][_0x5a3a('0x64')]({'where':{'id':_0x4ed0a3['params']['id']}})[_0x5a3a('0x26')](handleEntityNotFound(_0x165291,null))[_0x5a3a('0x26')](function(_0x5c6225){if(_0x5c6225){_0x4ed0a3[_0x5a3a('0x66')][_0x5a3a('0x72')]=_0x5c6225['id'];return db[_0x5a3a('0x76')][_0x5a3a('0x65')](_0x4ed0a3[_0x5a3a('0x66')]);}})[_0x5a3a('0x26')](respondWithResult(_0x165291,null))['catch'](handleError(_0x165291,null));};exports[_0x5a3a('0x77')]=function(_0x329dad,_0x259397,_0x1517d5){var _0x1958ec={'raw':![],'where':{}};var _0x413eed={};var _0x5d4b91={'count':0x0,'rows':[]};return db[_0x5a3a('0x46')]['findOne']({'where':{'id':_0x329dad[_0x5a3a('0x63')]['id']}})[_0x5a3a('0x26')](handleEntityNotFound(_0x259397,null))[_0x5a3a('0x26')](function(_0x4774ed){if(_0x4774ed){_0x413eed[_0x5a3a('0x48')]=_[_0x5a3a('0x49')](db['CannedAnswer'][_0x5a3a('0x47')]);_0x413eed[_0x5a3a('0x4a')]=_['keys'](_0x329dad[_0x5a3a('0x4a')]);_0x413eed[_0x5a3a('0x4b')]=_['intersection'](_0x413eed[_0x5a3a('0x48')],_0x413eed[_0x5a3a('0x4a')]);_0x1958ec['attributes']=_[_0x5a3a('0x4c')](_0x413eed[_0x5a3a('0x48')],qs[_0x5a3a('0x4e')](_0x329dad[_0x5a3a('0x4a')][_0x5a3a('0x4e')]));_0x1958ec[_0x5a3a('0x4d')]=_0x1958ec[_0x5a3a('0x4d')][_0x5a3a('0x4f')]?_0x1958ec[_0x5a3a('0x4d')]:_0x413eed['model'];if(!_0x329dad[_0x5a3a('0x4a')][_0x5a3a('0x50')](_0x5a3a('0x51'))){_0x1958ec[_0x5a3a('0x52')]=qs['limit'](_0x329dad[_0x5a3a('0x4a')][_0x5a3a('0x52')]);_0x1958ec[_0x5a3a('0x35')]=qs[_0x5a3a('0x35')](_0x329dad[_0x5a3a('0x4a')][_0x5a3a('0x35')]);}_0x1958ec[_0x5a3a('0x53')]=qs['sort'](_0x329dad[_0x5a3a('0x4a')]['sort']);_0x1958ec['where']=qs[_0x5a3a('0x4b')](_[_0x5a3a('0x55')](_0x329dad[_0x5a3a('0x4a')],_0x413eed[_0x5a3a('0x4b')]));_0x1958ec[_0x5a3a('0x56')]['OpenchannelAccountId']=_0x4774ed['id'];if(_0x329dad[_0x5a3a('0x4a')][_0x5a3a('0x5c')]){_0x1958ec[_0x5a3a('0x56')]=_['merge'](_0x1958ec['where'],{'$or':_['map'](_0x1958ec['attributes'],function(_0x2b6215){var _0x5d9077={};_0x5d9077[_0x2b6215]={'$like':'%'+_0x329dad[_0x5a3a('0x4a')][_0x5a3a('0x5c')]+'%'};return _0x5d9077;})});}_0x1958ec=_['merge']({},_0x1958ec,_0x329dad[_0x5a3a('0x5d')]);return db[_0x5a3a('0x76')][_0x5a3a('0x5e')]({'where':_0x1958ec[_0x5a3a('0x56')]})[_0x5a3a('0x26')](function(_0x630b98){_0x5d4b91[_0x5a3a('0x5e')]=_0x630b98;if(_0x329dad[_0x5a3a('0x4a')][_0x5a3a('0x73')]){_0x1958ec[_0x5a3a('0x5f')]=[{'all':!![]}];}return db[_0x5a3a('0x76')]['findAll'](_0x1958ec);})[_0x5a3a('0x26')](function(_0x318cba){_0x5d4b91[_0x5a3a('0x61')]=_0x318cba;return _0x5d4b91;});}})[_0x5a3a('0x26')](respondWithFilteredResult(_0x259397,_0x1958ec))[_0x5a3a('0x30')](handleError(_0x259397,null));};exports['removeAnswers']=function(_0x1d941b,_0x4b7f20,_0x340162){return db[_0x5a3a('0x46')][_0x5a3a('0x64')]({'where':{'id':_0x1d941b[_0x5a3a('0x63')]['id']}})[_0x5a3a('0x26')](handleEntityNotFound(_0x4b7f20,null))['then'](function(_0x3e929e){if(_0x3e929e){return _0x3e929e[_0x5a3a('0x78')](_0x1d941b[_0x5a3a('0x4a')][_0x5a3a('0x75')]);}})['then'](respondWithStatusCode(_0x4b7f20,null))[_0x5a3a('0x30')](handleError(_0x4b7f20,null));};exports[_0x5a3a('0x79')]=function(_0x47107b,_0x333395,_0x6b45df){var _0x5642fd={'body':_0x47107b[_0x5a3a('0x66')],'channel':_0x5a3a('0x7a')};var _0x317370=[];var _0x477f7f=[];var _0x370eb9={};var _0x51d2c1=![];return db['CmContact'][_0x5a3a('0x6d')]()[_0x5a3a('0x26')](function(_0x11bf43){if(!_0x11bf43){throw new db['Sequelize'][(_0x5a3a('0x7b'))](_0x5a3a('0x7c'));}_0x317370=_[_0x5a3a('0x7d')](_[_0x5a3a('0x49')](_0x11bf43),[_0x5a3a('0x7e'),_0x5a3a('0x7f')]);_0x477f7f=_['difference'](_[_0x5a3a('0x49')](_0x11bf43),[_0x5a3a('0x7e'),_0x5a3a('0x7f'),_0x5a3a('0x80'),'ListId']);if(_0x47107b[_0x5a3a('0x66')]['id']){delete _0x47107b[_0x5a3a('0x66')]['id'];}if(_[_0x5a3a('0x81')](_0x47107b[_0x5a3a('0x66')]['from'])){throw new db[(_0x5a3a('0x82'))][(_0x5a3a('0x7b'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x47107b['body'][_0x5a3a('0x66')])||_0x47107b[_0x5a3a('0x66')]['body']===''){throw new db['Sequelize']['ValidationError'](_0x5a3a('0x83'));}if(_[_0x5a3a('0x81')](_0x47107b[_0x5a3a('0x66')][_0x5a3a('0x84')])){throw new db[(_0x5a3a('0x82'))]['ValidationError'](_0x5a3a('0x85')+_0x477f7f);}if(!_['includes'](_0x477f7f,_0x47107b[_0x5a3a('0x66')][_0x5a3a('0x84')])){throw new db[(_0x5a3a('0x82'))][(_0x5a3a('0x7b'))](_0x5a3a('0x86')+_0x477f7f);}_0x370eb9[_0x47107b['body'][_0x5a3a('0x84')]]=_0x47107b[_0x5a3a('0x66')][_0x5a3a('0x87')];})[_0x5a3a('0x26')](function(){return db['OpenchannelAccount']['find']({'where':{'id':_0x47107b[_0x5a3a('0x63')]['id']},'include':[{'model':db[_0x5a3a('0x88')],'as':_0x5a3a('0x89'),'include':[{'model':db[_0x5a3a('0x8a')],'as':'Contacts','where':_0x370eb9,'limit':0x1,'order':[['updatedAt',_0x5a3a('0x8b')]]}]},{'model':db[_0x5a3a('0x8c')],'as':'Applications'}]});})[_0x5a3a('0x26')](handleEntityNotFound(_0x333395,null))[_0x5a3a('0x26')](function(_0x596897){if(_0x596897&&_0x596897['List']){_0x5642fd[_0x5a3a('0x8d')]=_0x596897;_0x5642fd['applications']=_0x596897[_0x5a3a('0x8e')];_0x5642fd['list']=_0x596897[_0x5a3a('0x89')];_0x5642fd[_0x5a3a('0x8f')]=_[_0x5a3a('0x90')](_0x5642fd[_0x5a3a('0x8f')],[_0x5a3a('0x91')],[_0x5a3a('0x92')]);if(_0x5642fd[_0x5a3a('0x8d')][_0x5a3a('0x8e')]){delete _0x5642fd[_0x5a3a('0x8d')]['Applications'];}if(_0x5642fd['account']['List']&&_0x5642fd[_0x5a3a('0x8d')][_0x5a3a('0x89')][_0x5a3a('0x93')]['length']){return _0x5642fd['account'][_0x5a3a('0x89')][_0x5a3a('0x93')][0x0];}var _0x4c8297=_[_0x5a3a('0x1d')](_0x47107b[_0x5a3a('0x66')],{'firstName':_0x47107b[_0x5a3a('0x66')][_0x5a3a('0x87')],'ListId':_0x596897['ListId']});_0x4c8297[_0x47107b['body'][_0x5a3a('0x84')]]=_0x47107b['body']['from'];return db[_0x5a3a('0x8a')]['create'](_0x4c8297,{'fields':_0x317370,'raw':!![]});}})[_0x5a3a('0x26')](handleEntityNotFound(_0x333395,null))[_0x5a3a('0x26')](function(_0x3ea85c){_0x5642fd['contact']=_0x3ea85c;if(_0x3ea85c){var _0x2a7056={'ContactId':_0x3ea85c['id'],'OpenchannelAccountId':_0x47107b[_0x5a3a('0x63')]['id'],'from':(_0x3ea85c[_0x5a3a('0x94')]||'')+'\x20'+(_0x3ea85c['lastName']||'')};var _0x5d6bf9={'OpenchannelAccountId':_0x47107b[_0x5a3a('0x63')]['id'],'closed':![]};if(_0x47107b['body'][_0x5a3a('0x95')]){_0x5d6bf9[_0x5a3a('0x95')]=_0x47107b[_0x5a3a('0x66')]['threadId'];return db['OpenchannelInteraction']['find']({'where':_0x5d6bf9})[_0x5a3a('0x26')](function(_0x10bd20){if(_0x10bd20){return[_0x10bd20,![]];}_0x2a7056[_0x5a3a('0x95')]=_0x47107b['body'][_0x5a3a('0x95')];_0x2a7056[_0x5a3a('0x96')]=_0x47107b[_0x5a3a('0x66')][_0x5a3a('0x96')];return db[_0x5a3a('0x97')][_0x5a3a('0x65')](_0x2a7056)['then'](function(_0x6a924b){return[_0x6a924b,!![]];});});}else{_0x5d6bf9['threadId']=null;}_0x5d6bf9[_0x5a3a('0x98')]=_0x3ea85c['id'];return db[_0x5a3a('0x97')][_0x5a3a('0x64')]({'where':_0x5d6bf9})['then'](function(_0x336382){if(_0x336382){return[_0x336382,![]];}return db['OpenchannelInteraction'][_0x5a3a('0x65')](_0x2a7056)[_0x5a3a('0x26')](function(_0x5b4fc7){return[_0x5b4fc7,!![]];});});}})[_0x5a3a('0x99')](function(_0x4e0e9e,_0x1d9d3e){if(_0x4e0e9e){_0x51d2c1=_0x1d9d3e;if(!_0x1d9d3e){var _0x1162f5={'from':(_0x5642fd[_0x5a3a('0x9a')]['firstName']||'')+'\x20'+(_0x5642fd[_0x5a3a('0x9a')][_0x5a3a('0x9b')]||'')};if(_0x47107b['body'][_0x5a3a('0x95')]&&_0x47107b['body'][_0x5a3a('0x9c')]&&_0x47107b['body'][_0x5a3a('0x95')]!=_0x47107b[_0x5a3a('0x66')][_0x5a3a('0x9c')]){_0x1162f5['threadId']=_0x47107b['body'][_0x5a3a('0x9c')];}return _0x4e0e9e[_0x5a3a('0x3b')](_0x1162f5);}else{return _0x4e0e9e;}}})[_0x5a3a('0x26')](function(_0x2e048e){_0x5642fd[_0x5a3a('0x9d')]=_0x2e048e[_0x5a3a('0x3d')]({'plain':!![]});_0x5642fd[_0x5a3a('0x9d')][_0x5a3a('0x9e')]=_0x51d2c1;if(_0x5642fd[_0x5a3a('0x9d')][_0x5a3a('0x9e')]){if(_0x5642fd[_0x5a3a('0x8d')][_0x5a3a('0x9f')]){_0x5642fd['applications']['push']({'id':0x0,'priority':_0x5642fd[_0x5a3a('0x8f')][_0x5a3a('0x4f')]+0x1,'app':_0x5a3a('0xa0'),'appdata':'unmanaged','interval':_0x5a3a('0xa1')});}}return db[_0x5a3a('0xa2')]['create']({'body':_0x47107b[_0x5a3a('0x66')][_0x5a3a('0x66')],'OpenchannelAccountId':_0x47107b[_0x5a3a('0x63')]['id'],'OpenchannelInteractionId':_0x2e048e['id'],'direction':'in','ContactId':_0x5642fd[_0x5a3a('0x9a')]['id'],'AttachmentId':_0x47107b[_0x5a3a('0x66')][_0x5a3a('0xa3')]});})['then'](function(_0x2ff726){_0x5642fd[_0x5a3a('0x2f')]=_0x2ff726;if(_0x5642fd[_0x5a3a('0x9d')][_0x5a3a('0xa4')]){return db['User']['find']({'attributes':['id',_0x5a3a('0x41')],'where':{'id':_0x5642fd[_0x5a3a('0x9d')][_0x5a3a('0xa4')]}})['then'](function(_0x15aebc){if(_0x15aebc){_0x5642fd[_0x5a3a('0x8f')][_0x5a3a('0xa5')]({'id':0x0,'priority':0x0,'app':_0x5a3a('0xa6'),'appdata':_0x15aebc['name']+','+(_0x5642fd[_0x5a3a('0x8d')]['waitForTheAssignedAgent']||0xa),'interval':_0x5a3a('0xa1')});_0x5642fd[_0x5a3a('0xa7')]=![];}return respondWithRpcPromise(_0x5a3a('0xa8'),_0x5a3a('0xa9'),_0x5642fd);});}return respondWithRpcPromise(_0x5a3a('0xa8'),_0x5a3a('0xa9'),_0x5642fd);})[_0x5a3a('0x26')](function(_0x28265e){respondWithRpcPromise('EventManager',_0x5a3a('0xaa'),{'event':'notify','message':_0x28265e},client9002);return _0x28265e;})[_0x5a3a('0x26')](respondWithResult(_0x333395,null))[_0x5a3a('0x30')](handleError(_0x333395,null));};exports[_0x5a3a('0xab')]=function(_0x5cf6bf,_0x11c366,_0x3202a1){return db[_0x5a3a('0x46')][_0x5a3a('0x71')]({'where':{'id':_0x5cf6bf['params']['id']}})[_0x5a3a('0x26')](handleEntityNotFound(_0x11c366,null))[_0x5a3a('0x26')](function(_0x14bf43){if(_0x14bf43){return db['sequelize'][_0x5a3a('0xac')](function(_0x3c2bd0){return db[_0x5a3a('0x8c')][_0x5a3a('0x3c')]({'where':{'OpenchannelAccountId':_0x5cf6bf[_0x5a3a('0x63')]['id']},'transaction':_0x3c2bd0})[_0x5a3a('0x26')](function(_0x30c519){var _0x389c6e=_[_0x5a3a('0x58')](_0x5cf6bf['body'],function(_0x208438){_0x208438[_0x5a3a('0x72')]=_0x5cf6bf['params']['id'];return _0x208438;});return db[_0x5a3a('0x8c')][_0x5a3a('0xad')](_0x389c6e,{'transaction':_0x3c2bd0});});})[_0x5a3a('0x26')](function(){return db[_0x5a3a('0x8c')][_0x5a3a('0xae')]({'where':{'OpenchannelAccountId':_0x5cf6bf[_0x5a3a('0x63')]['id']},'order':_0x5a3a('0x91')});});}})[_0x5a3a('0x26')](respondWithResult(_0x11c366,null))[_0x5a3a('0x30')](handleError(_0x11c366,null));};exports[_0x5a3a('0xaf')]=function(_0x548d07,_0x398f4a,_0x5dd04b){var _0x4793dd={};var _0x494416={};var _0x33aab6;var _0xe7fd52;return db['OpenchannelAccount'][_0x5a3a('0x71')]({'where':{'id':_0x548d07[_0x5a3a('0x63')]['id']}})[_0x5a3a('0x26')](handleEntityNotFound(_0x398f4a,null))['then'](function(_0x10c29d){if(_0x10c29d){_0x33aab6=_0x10c29d;_0x494416[_0x5a3a('0x48')]=_[_0x5a3a('0x49')](db[_0x5a3a('0x8c')][_0x5a3a('0x47')]);_0x494416[_0x5a3a('0x4a')]=_[_0x5a3a('0x49')](_0x548d07[_0x5a3a('0x4a')]);_0x494416[_0x5a3a('0x4b')]=_[_0x5a3a('0x4c')](_0x494416[_0x5a3a('0x48')],_0x494416[_0x5a3a('0x4a')]);_0x4793dd[_0x5a3a('0x4d')]=_[_0x5a3a('0x4c')](_0x494416[_0x5a3a('0x48')],qs[_0x5a3a('0x4e')](_0x548d07[_0x5a3a('0x4a')][_0x5a3a('0x4e')]));_0x4793dd['attributes']=_0x4793dd[_0x5a3a('0x4d')][_0x5a3a('0x4f')]?_0x4793dd['attributes']:_0x494416['model'];_0x4793dd[_0x5a3a('0x53')]=qs[_0x5a3a('0x54')](_0x548d07[_0x5a3a('0x4a')]['sort']);_0x4793dd['where']=qs[_0x5a3a('0x4b')](_[_0x5a3a('0x55')](_0x548d07[_0x5a3a('0x4a')],_0x494416[_0x5a3a('0x4b')]));if(_0x548d07[_0x5a3a('0x4a')]['filter']){_0x4793dd[_0x5a3a('0x56')]=_[_0x5a3a('0x57')](_0x4793dd[_0x5a3a('0x56')],{'$or':_[_0x5a3a('0x58')](_0x4793dd[_0x5a3a('0x4d')],function(_0x2d1ec0){var _0x64ce78={};_0x64ce78[_0x2d1ec0]={'$like':'%'+_0x548d07[_0x5a3a('0x4a')][_0x5a3a('0x5c')]+'%'};return _0x64ce78;})});}_0x4793dd=_[_0x5a3a('0x57')]({},_0x4793dd,_0x548d07[_0x5a3a('0x5d')]);return _0x33aab6['getApplications'](_0x4793dd);}})[_0x5a3a('0x26')](function(_0x3de3ba){if(_0x3de3ba){_0xe7fd52=_0x3de3ba[_0x5a3a('0x4f')];if(!_0x548d07[_0x5a3a('0x4a')][_0x5a3a('0x50')](_0x5a3a('0x51'))){_0x4793dd[_0x5a3a('0x52')]=qs[_0x5a3a('0x52')](_0x548d07['query'][_0x5a3a('0x52')]);_0x4793dd['offset']=qs[_0x5a3a('0x35')](_0x548d07[_0x5a3a('0x4a')][_0x5a3a('0x35')]);}return _0x33aab6['getApplications'](_0x4793dd);}})[_0x5a3a('0x26')](function(_0x48e151){if(_0x48e151){return _0x48e151?{'count':_0xe7fd52,'rows':_0x48e151}:null;}})['then'](respondWithResult(_0x398f4a,null))[_0x5a3a('0x30')](handleError(_0x398f4a,null));};exports[_0x5a3a('0xb0')]=function(_0x30feba,_0x29d5fa,_0x30eb4b){var _0x541370={'raw':![],'where':{}};var _0x236719={};var _0x231f7e={'count':0x0,'rows':[]};return db[_0x5a3a('0x46')][_0x5a3a('0x71')]({'where':{'id':_0x30feba[_0x5a3a('0x63')]['id']}})[_0x5a3a('0x26')](handleEntityNotFound(_0x29d5fa,null))[_0x5a3a('0x26')](function(_0x178c2b){if(_0x178c2b){_0x236719[_0x5a3a('0x48')]=_[_0x5a3a('0x49')](db[_0x5a3a('0x97')][_0x5a3a('0x47')]);_0x236719[_0x5a3a('0x4a')]=_[_0x5a3a('0x49')](_0x30feba[_0x5a3a('0x4a')]);_0x236719[_0x5a3a('0x4b')]=_[_0x5a3a('0x4c')](_0x236719[_0x5a3a('0x48')],_0x236719[_0x5a3a('0x4a')]);_0x541370[_0x5a3a('0x4d')]=_[_0x5a3a('0x4c')](_0x236719['model'],qs[_0x5a3a('0x4e')](_0x30feba[_0x5a3a('0x4a')][_0x5a3a('0x4e')]));_0x541370['attributes']=_0x541370[_0x5a3a('0x4d')]['length']?_0x541370[_0x5a3a('0x4d')]:_0x236719['model'];if(!_0x30feba['query'][_0x5a3a('0x50')]('nolimit')){_0x541370['limit']=qs[_0x5a3a('0x52')](_0x30feba[_0x5a3a('0x4a')]['limit']);_0x541370['offset']=qs[_0x5a3a('0x35')](_0x30feba['query']['offset']);}_0x541370['order']=qs[_0x5a3a('0x54')](_0x30feba[_0x5a3a('0x4a')][_0x5a3a('0x54')]);_0x541370[_0x5a3a('0x56')]=qs[_0x5a3a('0x4b')](_[_0x5a3a('0x55')](_0x30feba[_0x5a3a('0x4a')],_0x236719[_0x5a3a('0x4b')]));_0x541370['where'][_0x5a3a('0x72')]=_0x178c2b['id'];if(_0x30feba[_0x5a3a('0x4a')][_0x5a3a('0x5c')]){_0x541370[_0x5a3a('0x56')]=_['merge'](_0x541370[_0x5a3a('0x56')],{'$or':_[_0x5a3a('0x58')](_0x541370[_0x5a3a('0x4d')],function(_0x20c019){var _0x5e31cb={};_0x5e31cb[_0x20c019]={'$like':'%'+_0x30feba['query'][_0x5a3a('0x5c')]+'%'};return _0x5e31cb;})});}_0x541370=_[_0x5a3a('0x57')]({},_0x541370,_0x30feba[_0x5a3a('0x5d')]);return db[_0x5a3a('0x97')][_0x5a3a('0x5e')]({'where':_0x541370[_0x5a3a('0x56')]})[_0x5a3a('0x26')](function(_0x4932af){_0x231f7e[_0x5a3a('0x5e')]=_0x4932af;if(_0x30feba[_0x5a3a('0x4a')]['includeAll']){_0x541370[_0x5a3a('0x5f')]=[{'model':db[_0x5a3a('0x8a')],'as':_0x5a3a('0xb1'),'required':![]},{'model':db[_0x5a3a('0xb2')],'as':_0x5a3a('0xb3'),'attributes':[_0x5a3a('0x41'),'fullname','internal'],'required':![]},{'model':db[_0x5a3a('0xb4')],'as':_0x5a3a('0xb5'),'attributes':['id',_0x5a3a('0x41'),_0x5a3a('0xb6')],'where':_0x30feba[_0x5a3a('0x4a')][_0x5a3a('0xb7')]?{'id':_0x30feba[_0x5a3a('0x4a')]['tag']}:undefined,'required':_0x30feba[_0x5a3a('0x4a')]['tag']?!![]:![]}];}return db[_0x5a3a('0x97')][_0x5a3a('0x60')](_0x541370);})[_0x5a3a('0x26')](function(_0x792880){_0x231f7e[_0x5a3a('0x61')]=_0x792880;return _0x231f7e;});}})['then'](respondWithFilteredResult(_0x29d5fa,_0x541370))[_0x5a3a('0x30')](handleError(_0x29d5fa,null));};exports['addAgents']=function(_0x5a3312,_0x598b68,_0x1938ff){return db[_0x5a3a('0x46')]['find']({'where':{'id':_0x5a3312[_0x5a3a('0x63')]['id']}})[_0x5a3a('0x26')](handleEntityNotFound(_0x598b68,null))[_0x5a3a('0x26')](function(_0x793400){if(_0x793400){return _0x793400['addAgents'](_0x5a3312[_0x5a3a('0x66')][_0x5a3a('0x75')],_[_0x5a3a('0xb8')](_0x5a3312[_0x5a3a('0x66')],[_0x5a3a('0x75'),'id'])||{})['spread'](function(_0x3093d8){for(var _0x4997bc=0x0;_0x4997bc<_0x5a3312[_0x5a3a('0x66')][_0x5a3a('0x75')]['length'];_0x4997bc+=0x1){socket['emit'](_0x5a3a('0xb9'),{'UserId':_0x5a3312[_0x5a3a('0x66')][_0x5a3a('0x75')][_0x4997bc],'OpenchannelAccountId':_0x5a3312[_0x5a3a('0x63')]['id']});}return _0x3093d8;});}})['then'](respondWithResult(_0x598b68,null))[_0x5a3a('0x30')](handleError(_0x598b68,null));};exports[_0x5a3a('0xba')]=function(_0x3c9560,_0x51ede1,_0x3b0a99){return db[_0x5a3a('0x46')][_0x5a3a('0x64')]({'where':{'id':_0x3c9560[_0x5a3a('0x63')]['id']}})[_0x5a3a('0x26')](handleEntityNotFound(_0x51ede1,null))['then'](function(_0x32c0a1){if(_0x32c0a1){return _0x32c0a1[_0x5a3a('0xba')](_0x3c9560[_0x5a3a('0x4a')][_0x5a3a('0x75')])[_0x5a3a('0x26')](function(){if(_[_0x5a3a('0xbb')](_0x3c9560[_0x5a3a('0x4a')][_0x5a3a('0x75')])){for(var _0x1a3d50=0x0;_0x1a3d50<_0x3c9560[_0x5a3a('0x4a')][_0x5a3a('0x75')][_0x5a3a('0x4f')];_0x1a3d50+=0x1){socket['emit'](_0x5a3a('0xbc'),{'UserId':Number(_0x3c9560[_0x5a3a('0x4a')][_0x5a3a('0x75')][_0x1a3d50]),'OpenchannelAccountId':Number(_0x3c9560[_0x5a3a('0x63')]['id'])});}}else{socket[_0x5a3a('0xbd')]('userOpenchannelAccount:remove',{'UserId':Number(_0x3c9560[_0x5a3a('0x4a')][_0x5a3a('0x75')]),'OpenchannelAccountId':Number(_0x3c9560[_0x5a3a('0x63')]['id'])});}});}})[_0x5a3a('0x26')](respondWithStatusCode(_0x51ede1,null))[_0x5a3a('0x30')](handleError(_0x51ede1,null));};exports[_0x5a3a('0xbe')]=function(_0x10393d,_0x1d4bf1,_0x5764f7){var _0x4adafd={};var _0x17a3d5={};var _0x1511ef;var _0x2a41bd;return db[_0x5a3a('0x46')]['findOne']({'where':{'id':_0x10393d[_0x5a3a('0x63')]['id']}})['then'](handleEntityNotFound(_0x1d4bf1,null))[_0x5a3a('0x26')](function(_0x43b5d4){if(_0x43b5d4){_0x1511ef=_0x43b5d4;_0x17a3d5[_0x5a3a('0x48')]=_[_0x5a3a('0x49')](db['User']['rawAttributes']);_0x17a3d5[_0x5a3a('0x4a')]=_[_0x5a3a('0x49')](_0x10393d[_0x5a3a('0x4a')]);_0x17a3d5[_0x5a3a('0x4b')]=_[_0x5a3a('0x4c')](_0x17a3d5[_0x5a3a('0x48')],_0x17a3d5['query']);_0x4adafd[_0x5a3a('0x4d')]=_[_0x5a3a('0x4c')](_0x17a3d5[_0x5a3a('0x48')],qs[_0x5a3a('0x4e')](_0x10393d['query'][_0x5a3a('0x4e')]));_0x4adafd['attributes']=_0x4adafd[_0x5a3a('0x4d')]['length']?_0x4adafd[_0x5a3a('0x4d')]:_0x17a3d5[_0x5a3a('0x48')];_0x4adafd['order']=qs[_0x5a3a('0x54')](_0x10393d[_0x5a3a('0x4a')]['sort']);_0x4adafd[_0x5a3a('0x56')]=qs[_0x5a3a('0x4b')](_[_0x5a3a('0x55')](_0x10393d[_0x5a3a('0x4a')],_0x17a3d5['filters']));if(_0x10393d[_0x5a3a('0x4a')][_0x5a3a('0x5c')]){_0x4adafd[_0x5a3a('0x56')]=_['merge'](_0x4adafd[_0x5a3a('0x56')],{'$or':_[_0x5a3a('0x58')](_0x4adafd[_0x5a3a('0x4d')],function(_0x5ecf60){var _0x88bac9={};_0x88bac9[_0x5ecf60]={'$like':'%'+_0x10393d[_0x5a3a('0x4a')][_0x5a3a('0x5c')]+'%'};return _0x88bac9;})});}_0x4adafd=_[_0x5a3a('0x57')]({},_0x4adafd,_0x10393d[_0x5a3a('0x5d')]);return _0x1511ef[_0x5a3a('0xbe')](_0x4adafd);}})['then'](function(_0x502b22){if(_0x502b22){_0x2a41bd=_0x502b22['length'];if(!_0x10393d[_0x5a3a('0x4a')][_0x5a3a('0x50')]('nolimit')){_0x4adafd[_0x5a3a('0x52')]=qs[_0x5a3a('0x52')](_0x10393d[_0x5a3a('0x4a')][_0x5a3a('0x52')]);_0x4adafd[_0x5a3a('0x35')]=qs[_0x5a3a('0x35')](_0x10393d[_0x5a3a('0x4a')]['offset']);}return _0x1511ef['getAgents'](_0x4adafd);}})['then'](function(_0x248217){if(_0x248217){return _0x248217?{'count':_0x2a41bd,'rows':_0x248217}:null;}})[_0x5a3a('0x26')](respondWithResult(_0x1d4bf1,null))[_0x5a3a('0x30')](handleError(_0x1d4bf1,null));};exports[_0x5a3a('0x42')]=function(_0x291265,_0x2fd101,_0x2b80e0){var _0x155b6c,_0xa6e56c,_0x2424b7;if(_[_0x5a3a('0x81')](_0x291265['body'][_0x5a3a('0x66')])||_0x291265[_0x5a3a('0x66')]['body']===''){throw new db['Sequelize'][(_0x5a3a('0x7b'))](_0x5a3a('0x83'));}if(_[_0x5a3a('0x81')](_0x291265[_0x5a3a('0x66')]['to'])){}_0x155b6c=_0x291265[_0x5a3a('0x66')]['to'];return db[_0x5a3a('0x46')][_0x5a3a('0x71')]({'where':{'id':_0x291265[_0x5a3a('0x63')]['id']}})[_0x5a3a('0x26')](handleEntityNotFound(_0x2fd101,null))[_0x5a3a('0x26')](function(_0x513138){if(_0x513138){return db['OpenchannelAccount']['find']({'where':{'id':_0x513138['id']},'include':[{'model':db['CmList'],'as':_0x5a3a('0x89'),'include':[{'model':db[_0x5a3a('0x8a')],'as':_0x5a3a('0x93'),'where':{[_0x513138[_0x5a3a('0x84')]]:_0x155b6c},'limit':0x1,'order':[[_0x5a3a('0x7f'),_0x5a3a('0x8b')]]}]}]})[_0x5a3a('0x26')](handleEntityNotFound(_0x2fd101,null))[_0x5a3a('0x26')](function(_0x22e4b8){if(_0x22e4b8&&_0x22e4b8[_0x5a3a('0x89')]){_0xa6e56c=_0x22e4b8['get']({'plain':!![]});if(_0xa6e56c['List']&&_0xa6e56c[_0x5a3a('0x89')][_0x5a3a('0x93')]['length']){return _0xa6e56c[_0x5a3a('0x89')][_0x5a3a('0x93')][0x0];}return db[_0x5a3a('0x8a')][_0x5a3a('0x65')](_['defaults'](_0x291265[_0x5a3a('0x66')],{'firstName':_0x155b6c,[_0x22e4b8[_0x5a3a('0x84')]]:_0x155b6c,'phone':_0x155b6c,'ListId':_0xa6e56c[_0x5a3a('0xbf')]}));}})[_0x5a3a('0x26')](handleEntityNotFound(_0x2fd101,null))[_0x5a3a('0x26')](function(_0x20bf14){if(_0x20bf14){_0x2424b7=_0x20bf14;return db['OpenchannelInteraction'][_0x5a3a('0x64')]({'where':{'ContactId':_0x2424b7['id'],'closed':![],'OpenchannelAccountId':_0xa6e56c['id']}})[_0x5a3a('0x26')](function(_0x41e250){if(_0x41e250){return[_0x41e250,![]];}return db[_0x5a3a('0x97')][_0x5a3a('0x65')]({'UserId':_0x291265[_0x5a3a('0x67')]['id'],'ContactId':_0x2424b7['id'],'OpenchannelAccountId':_0xa6e56c['id'],'lastMsgDirection':'out','Messages':[_['merge'](_0x291265[_0x5a3a('0x66')],{'read':![],'body':_0x291265[_0x5a3a('0x66')][_0x5a3a('0x66')],'OpenchannelAccountId':_0xa6e56c['id'],'UserId':_0x291265[_0x5a3a('0x67')]['id'],'ContactId':_0x2424b7['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})[_0x5a3a('0x26')](function(_0x3ed416){return[_0x3ed416,!![]];});});}})[_0x5a3a('0x99')](function(_0x5c4a6c,_0x567c7e){if(_0x567c7e){return _0x5c4a6c;}return db[_0x5a3a('0xa2')][_0x5a3a('0x65')](_[_0x5a3a('0x57')](_0x291265['body'],{'read':![],'body':_0x291265[_0x5a3a('0x66')][_0x5a3a('0x66')],'OpenchannelAccountId':_0xa6e56c['id'],'OpenchannelInteractionId':_0x5c4a6c['id'],'UserId':_0x291265[_0x5a3a('0x67')]['id'],'ContactId':_0x2424b7['id']}))[_0x5a3a('0x26')](function(_0x50eb4b){_0x5c4a6c[_0x5a3a('0xc0')]['Messages']=[];_0x5c4a6c[_0x5a3a('0xc0')][_0x5a3a('0xc1')][_0x5a3a('0xc2')](_0x50eb4b[_0x5a3a('0xc0')]);return _0x5c4a6c;});});}})[_0x5a3a('0x26')](respondWithResult(_0x2fd101,null))['catch'](handleError(_0x2fd101,null));}; \ No newline at end of file +var _0x3425=['intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','findAll','rows','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','findOne','rawAttributes','OpenchannelAccountId','removeDispositions','addAnswer','CannedAnswer','getAnswers','length','include','removeAnswers','ids','notify','CmContact','Sequelize','ValidationError','updatedAt','createdAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','OpenchannelApplication','account','applications','Applications','orderBy','priority','defaults','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','created','interaction','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','Messages','dataValues','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./openchannelAccount.socket','register','client','http','test','request','then','debug','stringify','error','message','OpenchannelAccount,\x20%s,\x20%s','info','request\x20sent','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','keys','query','filters'];(function(_0x319e62,_0x108604){var _0x58c7e5=function(_0x58a483){while(--_0x58a483){_0x319e62['push'](_0x319e62['shift']());}};_0x58c7e5(++_0x108604);}(_0x3425,0x1dd));var _0x5342=function(_0x34770d,_0x99ecbe){_0x34770d=_0x34770d-0x0;var _0x2deec8=_0x3425[_0x34770d];return _0x2deec8;};'use strict';var pdf=require(_0x5342('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5342('0x1'));var jsonpatch=require(_0x5342('0x2'));var rp=require(_0x5342('0x3'));var moment=require('moment');var BPromise=require(_0x5342('0x4'));var Mustache=require(_0x5342('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5342('0x6'));var csv=require(_0x5342('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5342('0x8'));var squel=require(_0x5342('0x9'));var crypto=require(_0x5342('0xa'));var jsforce=require(_0x5342('0xb'));var deskjs=require(_0x5342('0xc'));var toCsv=require(_0x5342('0x7'));var querystring=require('querystring');var Papa=require(_0x5342('0xd'));var Redis=require(_0x5342('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5342('0xf'));var hardwareService=require(_0x5342('0x10'));var logger=require(_0x5342('0x11'))(_0x5342('0x12'));var utils=require(_0x5342('0x13'));var config=require(_0x5342('0x14'));var db=require(_0x5342('0x15'))['db'];config[_0x5342('0x16')]=_['defaults'](config[_0x5342('0x16')],{'host':_0x5342('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5342('0x16')]));require(_0x5342('0x18'))[_0x5342('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5342('0x1a')][_0x5342('0x1b')]({'port':0x232c});var client9002=jayson[_0x5342('0x1a')][_0x5342('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x19bdb5,_0x326e79,_0x57c5e2){if(_0x57c5e2){var _0x38c58a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x38c58a[_0x5342('0x1c')](_0x326e79)){return _0x19bdb5;}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 _0x19bdb5;}}function respondWithRpcPromise(_0x3fc058,_0x24bddf,_0x370210,_0x3b48fb){return new BPromise(function(_0x4f9a50,_0x5baadc){var _0x595b71=_0x3b48fb||client;return _0x595b71[_0x5342('0x1d')](_0x3fc058,_0x370210)[_0x5342('0x1e')](function(_0xe349ff){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x24bddf,'request\x20sent');logger[_0x5342('0x1f')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x24bddf,'request\x20sent',JSON[_0x5342('0x20')](_0xe349ff));if(_0xe349ff[_0x5342('0x21')]){if(_0xe349ff[_0x5342('0x21')]['code']===0x1f4){logger[_0x5342('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x24bddf,_0xe349ff[_0x5342('0x21')][_0x5342('0x22')]);return _0x5baadc(_0xe349ff[_0x5342('0x21')][_0x5342('0x22')]);}logger[_0x5342('0x21')](_0x5342('0x23'),_0x24bddf,_0xe349ff[_0x5342('0x21')][_0x5342('0x22')]);return _0x4f9a50(_0xe349ff[_0x5342('0x21')]['message']);}else{logger[_0x5342('0x24')](_0x5342('0x23'),_0x24bddf,_0x5342('0x25'));_0x4f9a50(_0xe349ff[_0x5342('0x26')][_0x5342('0x22')]);}})[_0x5342('0x27')](function(_0x190e74){logger[_0x5342('0x21')](_0x5342('0x23'),_0x24bddf,_0x190e74);_0x5baadc(_0x190e74);});});}function respondWithStatusCode(_0x4b4686,_0x2fb969){_0x2fb969=_0x2fb969||0xcc;return function(_0x1b72d6){if(_0x1b72d6){return _0x4b4686[_0x5342('0x28')](_0x2fb969);}return _0x4b4686[_0x5342('0x29')](_0x2fb969)[_0x5342('0x2a')]();};}function respondWithResult(_0x2e1f10,_0x3f57b4){_0x3f57b4=_0x3f57b4||0xc8;return function(_0x5d8259){if(_0x5d8259){return _0x2e1f10[_0x5342('0x29')](_0x3f57b4)[_0x5342('0x2b')](_0x5d8259);}};}function respondWithFilteredResult(_0x104d24,_0x1587a1){return function(_0x46d5f0){if(_0x46d5f0){var _0x52104c=_0x46d5f0[_0x5342('0x2c')],_0x40fa57=_0x1587a1[_0x5342('0x2d')],_0x551b5a=_0x1587a1[_0x5342('0x2d')]+_0x1587a1[_0x5342('0x2e')],_0x382321;if(_0x551b5a>=_0x52104c){_0x551b5a=_0x52104c;_0x382321=0xc8;}else{_0x382321=0xce;}_0x104d24[_0x5342('0x29')](_0x382321);return _0x104d24[_0x5342('0x2f')](_0x5342('0x30'),_0x40fa57+'-'+_0x551b5a+'/'+_0x52104c)[_0x5342('0x2b')](_0x46d5f0);}return null;};}function patchUpdates(_0x586b94){return function(_0x5cdc0){try{jsonpatch[_0x5342('0x31')](_0x5cdc0,_0x586b94,!![]);}catch(_0x403818){return BPromise[_0x5342('0x32')](_0x403818);}return _0x5cdc0['save']();};}function saveUpdates(_0x228b03,_0x4c4f7d){return function(_0x171f3a){if(_0x171f3a){return _0x171f3a[_0x5342('0x33')](_0x228b03)['then'](function(_0x5a9951){return _0x5a9951;});}return null;};}function removeEntity(_0x5c0939,_0x9d3c89){return function(_0x24301e){if(_0x24301e){return _0x24301e[_0x5342('0x34')]()[_0x5342('0x1e')](function(){var _0x5126ab=_0x24301e[_0x5342('0x35')]({'plain':!![]});var _0x4ca62d=_0x5342('0x36');return db[_0x5342('0x37')][_0x5342('0x34')]({'where':{'type':_0x4ca62d,'resourceId':_0x5126ab['id']}})[_0x5342('0x1e')](function(){return _0x24301e;});})[_0x5342('0x1e')](function(){_0x5c0939[_0x5342('0x29')](0xcc)[_0x5342('0x2a')]();});}};}function handleEntityNotFound(_0x3a2047,_0x25c49b){return function(_0x24a9ff){if(!_0x24a9ff){_0x3a2047[_0x5342('0x28')](0x194);}return _0x24a9ff;};}function handleError(_0x4db81f,_0x5bc568){_0x5bc568=_0x5bc568||0x1f4;return function(_0x33b655){logger[_0x5342('0x21')](_0x33b655[_0x5342('0x38')]);if(_0x33b655[_0x5342('0x39')]){delete _0x33b655[_0x5342('0x39')];}_0x4db81f[_0x5342('0x29')](_0x5bc568)[_0x5342('0x3a')](_0x33b655);};}exports[_0x5342('0x3b')]=function(_0x10b160,_0x4c1c3f){var _0x45dcf8={'include':[{'model':db[_0x5342('0x3c')],'as':_0x5342('0x3d')}]},_0x2ab398={},_0x1f9fc2={'count':0x0,'rows':[]};var _0x384c6b=db[_0x5342('0x3e')]['rawAttributes'];_0x2ab398['model']=_[_0x5342('0x3f')](_0x384c6b);_0x2ab398['query']=_['keys'](_0x10b160[_0x5342('0x40')]);_0x2ab398[_0x5342('0x41')]=_[_0x5342('0x42')](_0x2ab398[_0x5342('0x43')],_0x2ab398['query']);_0x45dcf8[_0x5342('0x44')]=_[_0x5342('0x42')](_0x2ab398[_0x5342('0x43')],qs['fields'](_0x10b160[_0x5342('0x40')][_0x5342('0x45')]));_0x45dcf8[_0x5342('0x44')]=_0x45dcf8[_0x5342('0x44')]['length']?_0x45dcf8[_0x5342('0x44')]:_0x2ab398[_0x5342('0x43')];if(!_0x10b160['query'][_0x5342('0x46')](_0x5342('0x47'))){_0x45dcf8[_0x5342('0x2e')]=qs['limit'](_0x10b160[_0x5342('0x40')][_0x5342('0x2e')]);_0x45dcf8[_0x5342('0x2d')]=qs[_0x5342('0x2d')](_0x10b160['query'][_0x5342('0x2d')]);}_0x45dcf8[_0x5342('0x48')]=qs[_0x5342('0x49')](_0x10b160[_0x5342('0x40')]['sort']);_0x45dcf8[_0x5342('0x4a')]=qs[_0x5342('0x41')](_[_0x5342('0x4b')](_0x10b160[_0x5342('0x40')],_0x2ab398[_0x5342('0x41')]));if(_0x10b160[_0x5342('0x40')][_0x5342('0x4c')]){_0x45dcf8[_0x5342('0x4a')]=_[_0x5342('0x4d')](_0x45dcf8[_0x5342('0x4a')],{'$or':_[_0x5342('0x4e')](_0x384c6b,function(_0x523546){if(_0x523546[_0x5342('0x4f')]['key']!==_0x5342('0x50')){var _0x1bc3b7={};_0x1bc3b7[_0x523546[_0x5342('0x51')]]={'$like':'%'+_0x10b160[_0x5342('0x40')][_0x5342('0x4c')]+'%'};return _0x1bc3b7;}})});}_0x45dcf8=_['merge']({},_0x45dcf8,_0x10b160[_0x5342('0x52')]);var _0x1382a0={'where':_0x45dcf8[_0x5342('0x4a')]};return db[_0x5342('0x3e')][_0x5342('0x2c')](_0x1382a0)['then'](function(_0x4c2e4e){_0x1f9fc2[_0x5342('0x2c')]=_0x4c2e4e;if(_0x10b160['query']['includeAll']){_0x45dcf8['include']=[{'all':!![]}];}return db[_0x5342('0x3e')][_0x5342('0x53')](_0x45dcf8);})[_0x5342('0x1e')](function(_0x5a4c0f){_0x1f9fc2[_0x5342('0x54')]=_0x5a4c0f;return _0x1f9fc2;})['then'](respondWithFilteredResult(_0x4c1c3f,_0x45dcf8))['catch'](handleError(_0x4c1c3f,null));};exports[_0x5342('0x55')]=function(_0x2a0480,_0x5b756e){var _0x5a15ad={'raw':![],'where':{'id':_0x2a0480[_0x5342('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0x5342('0x3d')}]},_0x59b35f={};_0x59b35f[_0x5342('0x43')]=_[_0x5342('0x3f')](db[_0x5342('0x3e')]['rawAttributes']);_0x59b35f['query']=_[_0x5342('0x3f')](_0x2a0480['query']);_0x59b35f[_0x5342('0x41')]=_[_0x5342('0x42')](_0x59b35f[_0x5342('0x43')],_0x59b35f[_0x5342('0x40')]);_0x5a15ad['attributes']=_[_0x5342('0x42')](_0x59b35f['model'],qs['fields'](_0x2a0480[_0x5342('0x40')][_0x5342('0x45')]));_0x5a15ad[_0x5342('0x44')]=_0x5a15ad[_0x5342('0x44')]['length']?_0x5a15ad[_0x5342('0x44')]:_0x59b35f[_0x5342('0x43')];if(_0x2a0480[_0x5342('0x40')][_0x5342('0x57')]){_0x5a15ad['include']=[{'all':!![]}];}_0x5a15ad=_['merge']({},_0x5a15ad,_0x2a0480['options']);return db[_0x5342('0x3e')][_0x5342('0x58')](_0x5a15ad)['then'](handleEntityNotFound(_0x5b756e,null))[_0x5342('0x1e')](respondWithResult(_0x5b756e,null))[_0x5342('0x27')](handleError(_0x5b756e,null));};exports[_0x5342('0x59')]=function(_0x358f77,_0x2cd709){return db[_0x5342('0x3e')]['create'](_0x358f77[_0x5342('0x5a')],{})['then'](function(_0x2a4ec7){var _0x8841e3=_0x358f77[_0x5342('0x5b')][_0x5342('0x35')]({'plain':!![]});if(!_0x8841e3)throw new Error(_0x5342('0x5c'));if(_0x8841e3[_0x5342('0x5d')]===_0x5342('0x5b')){var _0x44ed40=_0x2a4ec7[_0x5342('0x35')]({'plain':!![]});var _0x302846='OpenchannelAccounts';return db[_0x5342('0x5e')][_0x5342('0x58')]({'where':{'name':_0x302846,'userProfileId':_0x8841e3[_0x5342('0x5f')]},'raw':!![]})['then'](function(_0x44f21f){if(_0x44f21f&&_0x44f21f['autoAssociation']===0x0){return db['UserProfileResource'][_0x5342('0x59')]({'name':_0x44ed40[_0x5342('0x39')],'resourceId':_0x44ed40['id'],'type':_0x44f21f['name'],'sectionId':_0x44f21f['id']},{})[_0x5342('0x1e')](function(){return _0x2a4ec7;});}else{return _0x2a4ec7;}})[_0x5342('0x27')](function(_0xd856d){logger['error'](_0x5342('0x60'),_0xd856d);throw _0xd856d;});}return _0x2a4ec7;})[_0x5342('0x1e')](respondWithResult(_0x2cd709,0xc9))[_0x5342('0x27')](handleError(_0x2cd709,null));};exports[_0x5342('0x33')]=function(_0x493866,_0x15aa52){if(_0x493866[_0x5342('0x5a')]['id']){delete _0x493866['body']['id'];}return db[_0x5342('0x3e')][_0x5342('0x58')]({'where':{'id':_0x493866[_0x5342('0x56')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x5342('0x1e')](handleEntityNotFound(_0x15aa52,null))[_0x5342('0x1e')](saveUpdates(_0x493866[_0x5342('0x5a')],null))['then'](respondWithResult(_0x15aa52,null))[_0x5342('0x27')](handleError(_0x15aa52,null));};exports[_0x5342('0x34')]=function(_0x12f50d,_0x2ba043){return db[_0x5342('0x3e')][_0x5342('0x58')]({'where':{'id':_0x12f50d['params']['id']}})[_0x5342('0x1e')](handleEntityNotFound(_0x2ba043,null))['then'](removeEntity(_0x2ba043,null))[_0x5342('0x27')](handleError(_0x2ba043,null));};exports[_0x5342('0x61')]=function(_0x21a85e,_0x5f0021){return db[_0x5342('0x3e')][_0x5342('0x61')]()['then'](respondWithResult(_0x5f0021,null))['catch'](handleError(_0x5f0021,null));};exports[_0x5342('0x62')]=function(_0x38cefd,_0x2018c4,_0x51d5e5){if(_0x38cefd['body']['id']){delete _0x38cefd[_0x5342('0x5a')]['id'];}return db[_0x5342('0x3e')][_0x5342('0x58')]({'where':{'id':_0x38cefd[_0x5342('0x56')]['id']}})[_0x5342('0x1e')](handleEntityNotFound(_0x2018c4,null))[_0x5342('0x1e')](function(_0x3da91e){if(_0x3da91e){_0x38cefd[_0x5342('0x5a')][_0x5342('0x63')]=_0x3da91e['id'];return db[_0x5342('0x64')][_0x5342('0x59')](_0x38cefd[_0x5342('0x5a')]);}})[_0x5342('0x1e')](respondWithResult(_0x2018c4,null))['catch'](handleError(_0x2018c4,null));};exports[_0x5342('0x65')]=function(_0x2637e8,_0x5e2df1,_0x98fde8){var _0x13391b={'raw':![],'where':{}};var _0x359ea2={};var _0x4fdf19={'count':0x0,'rows':[]};return db[_0x5342('0x3e')][_0x5342('0x66')]({'where':{'id':_0x2637e8['params']['id']}})[_0x5342('0x1e')](handleEntityNotFound(_0x5e2df1,null))['then'](function(_0x1ec1b1){if(_0x1ec1b1){_0x359ea2[_0x5342('0x43')]=_[_0x5342('0x3f')](db[_0x5342('0x64')][_0x5342('0x67')]);_0x359ea2['query']=_[_0x5342('0x3f')](_0x2637e8[_0x5342('0x40')]);_0x359ea2[_0x5342('0x41')]=_[_0x5342('0x42')](_0x359ea2[_0x5342('0x43')],_0x359ea2[_0x5342('0x40')]);_0x13391b[_0x5342('0x44')]=_[_0x5342('0x42')](_0x359ea2[_0x5342('0x43')],qs[_0x5342('0x45')](_0x2637e8[_0x5342('0x40')]['fields']));_0x13391b['attributes']=_0x13391b[_0x5342('0x44')]['length']?_0x13391b[_0x5342('0x44')]:_0x359ea2[_0x5342('0x43')];if(!_0x2637e8[_0x5342('0x40')][_0x5342('0x46')](_0x5342('0x47'))){_0x13391b[_0x5342('0x2e')]=qs[_0x5342('0x2e')](_0x2637e8[_0x5342('0x40')][_0x5342('0x2e')]);_0x13391b[_0x5342('0x2d')]=qs[_0x5342('0x2d')](_0x2637e8['query']['offset']);}_0x13391b[_0x5342('0x48')]=qs[_0x5342('0x49')](_0x2637e8[_0x5342('0x40')][_0x5342('0x49')]);_0x13391b['where']=qs['filters'](_[_0x5342('0x4b')](_0x2637e8['query'],_0x359ea2['filters']));_0x13391b['where'][_0x5342('0x68')]=_0x1ec1b1['id'];if(_0x2637e8['query'][_0x5342('0x4c')]){_0x13391b['where']=_['merge'](_0x13391b['where'],{'$or':_[_0x5342('0x4e')](_0x13391b[_0x5342('0x44')],function(_0x537a60){var _0x35f8c0={};_0x35f8c0[_0x537a60]={'$like':'%'+_0x2637e8['query'][_0x5342('0x4c')]+'%'};return _0x35f8c0;})});}_0x13391b=_[_0x5342('0x4d')]({},_0x13391b,_0x2637e8[_0x5342('0x52')]);return db[_0x5342('0x64')][_0x5342('0x2c')]({'where':_0x13391b[_0x5342('0x4a')]})[_0x5342('0x1e')](function(_0x5f5aa2){_0x4fdf19[_0x5342('0x2c')]=_0x5f5aa2;if(_0x2637e8[_0x5342('0x40')][_0x5342('0x57')]){_0x13391b['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x13391b);})[_0x5342('0x1e')](function(_0x2fe32a){_0x4fdf19['rows']=_0x2fe32a;return _0x4fdf19;});}})[_0x5342('0x1e')](respondWithFilteredResult(_0x5e2df1,_0x13391b))[_0x5342('0x27')](handleError(_0x5e2df1,null));};exports['removeDispositions']=function(_0x2ac0e8,_0x5284d9,_0x48f8d2){return db['OpenchannelAccount'][_0x5342('0x58')]({'where':{'id':_0x2ac0e8[_0x5342('0x56')]['id']}})[_0x5342('0x1e')](handleEntityNotFound(_0x5284d9,null))[_0x5342('0x1e')](function(_0x47d02e){if(_0x47d02e){return _0x47d02e[_0x5342('0x69')](_0x2ac0e8[_0x5342('0x40')]['ids']);}})[_0x5342('0x1e')](respondWithStatusCode(_0x5284d9,null))[_0x5342('0x27')](handleError(_0x5284d9,null));};exports[_0x5342('0x6a')]=function(_0x3a423b,_0x27f785,_0x53b053){if(_0x3a423b[_0x5342('0x5a')]['id']){delete _0x3a423b[_0x5342('0x5a')]['id'];}return db[_0x5342('0x3e')][_0x5342('0x58')]({'where':{'id':_0x3a423b[_0x5342('0x56')]['id']}})['then'](handleEntityNotFound(_0x27f785,null))[_0x5342('0x1e')](function(_0x15bd09){if(_0x15bd09){_0x3a423b[_0x5342('0x5a')][_0x5342('0x68')]=_0x15bd09['id'];return db[_0x5342('0x6b')]['create'](_0x3a423b[_0x5342('0x5a')]);}})[_0x5342('0x1e')](respondWithResult(_0x27f785,null))[_0x5342('0x27')](handleError(_0x27f785,null));};exports[_0x5342('0x6c')]=function(_0x39db5e,_0x209a03,_0x245a07){var _0x5c53f4={'raw':![],'where':{}};var _0x53d63b={};var _0xc9d3e={'count':0x0,'rows':[]};return db[_0x5342('0x3e')][_0x5342('0x66')]({'where':{'id':_0x39db5e[_0x5342('0x56')]['id']}})[_0x5342('0x1e')](handleEntityNotFound(_0x209a03,null))[_0x5342('0x1e')](function(_0x21cc6d){if(_0x21cc6d){_0x53d63b[_0x5342('0x43')]=_[_0x5342('0x3f')](db[_0x5342('0x6b')]['rawAttributes']);_0x53d63b[_0x5342('0x40')]=_[_0x5342('0x3f')](_0x39db5e[_0x5342('0x40')]);_0x53d63b[_0x5342('0x41')]=_[_0x5342('0x42')](_0x53d63b[_0x5342('0x43')],_0x53d63b['query']);_0x5c53f4[_0x5342('0x44')]=_[_0x5342('0x42')](_0x53d63b[_0x5342('0x43')],qs[_0x5342('0x45')](_0x39db5e[_0x5342('0x40')][_0x5342('0x45')]));_0x5c53f4[_0x5342('0x44')]=_0x5c53f4[_0x5342('0x44')][_0x5342('0x6d')]?_0x5c53f4[_0x5342('0x44')]:_0x53d63b[_0x5342('0x43')];if(!_0x39db5e[_0x5342('0x40')][_0x5342('0x46')](_0x5342('0x47'))){_0x5c53f4['limit']=qs[_0x5342('0x2e')](_0x39db5e[_0x5342('0x40')][_0x5342('0x2e')]);_0x5c53f4[_0x5342('0x2d')]=qs[_0x5342('0x2d')](_0x39db5e[_0x5342('0x40')][_0x5342('0x2d')]);}_0x5c53f4[_0x5342('0x48')]=qs[_0x5342('0x49')](_0x39db5e[_0x5342('0x40')][_0x5342('0x49')]);_0x5c53f4[_0x5342('0x4a')]=qs[_0x5342('0x41')](_[_0x5342('0x4b')](_0x39db5e[_0x5342('0x40')],_0x53d63b['filters']));_0x5c53f4[_0x5342('0x4a')][_0x5342('0x68')]=_0x21cc6d['id'];if(_0x39db5e[_0x5342('0x40')][_0x5342('0x4c')]){_0x5c53f4[_0x5342('0x4a')]=_[_0x5342('0x4d')](_0x5c53f4['where'],{'$or':_[_0x5342('0x4e')](_0x5c53f4[_0x5342('0x44')],function(_0x5473e8){var _0x2094fb={};_0x2094fb[_0x5473e8]={'$like':'%'+_0x39db5e[_0x5342('0x40')]['filter']+'%'};return _0x2094fb;})});}_0x5c53f4=_[_0x5342('0x4d')]({},_0x5c53f4,_0x39db5e['options']);return db['CannedAnswer'][_0x5342('0x2c')]({'where':_0x5c53f4[_0x5342('0x4a')]})['then'](function(_0x122b59){_0xc9d3e[_0x5342('0x2c')]=_0x122b59;if(_0x39db5e[_0x5342('0x40')]['includeAll']){_0x5c53f4[_0x5342('0x6e')]=[{'all':!![]}];}return db[_0x5342('0x6b')][_0x5342('0x53')](_0x5c53f4);})[_0x5342('0x1e')](function(_0x5e11cc){_0xc9d3e[_0x5342('0x54')]=_0x5e11cc;return _0xc9d3e;});}})[_0x5342('0x1e')](respondWithFilteredResult(_0x209a03,_0x5c53f4))[_0x5342('0x27')](handleError(_0x209a03,null));};exports['removeAnswers']=function(_0x565c2f,_0x4d9bf1,_0x2078ee){return db['OpenchannelAccount']['find']({'where':{'id':_0x565c2f[_0x5342('0x56')]['id']}})['then'](handleEntityNotFound(_0x4d9bf1,null))[_0x5342('0x1e')](function(_0x519181){if(_0x519181){return _0x519181[_0x5342('0x6f')](_0x565c2f['query'][_0x5342('0x70')]);}})[_0x5342('0x1e')](respondWithStatusCode(_0x4d9bf1,null))[_0x5342('0x27')](handleError(_0x4d9bf1,null));};exports[_0x5342('0x71')]=function(_0x170115,_0x41664c,_0xde0bba){var _0x3fd794={'body':_0x170115['body'],'channel':'openchannel'};var _0x1da254=[];var _0x119694=[];var _0x39c4f1={};var _0x7b5420=![];return db[_0x5342('0x72')]['describe']()[_0x5342('0x1e')](function(_0x26c77f){if(!_0x26c77f){throw new db[(_0x5342('0x73'))][(_0x5342('0x74'))]('no\x20available\x20attributes');}_0x1da254=_['difference'](_[_0x5342('0x3f')](_0x26c77f),['createdAt',_0x5342('0x75')]);_0x119694=_['difference'](_['keys'](_0x26c77f),[_0x5342('0x76'),_0x5342('0x75'),_0x5342('0x77'),_0x5342('0x78')]);if(_0x170115[_0x5342('0x5a')]['id']){delete _0x170115[_0x5342('0x5a')]['id'];}if(_[_0x5342('0x79')](_0x170115[_0x5342('0x5a')]['from'])){throw new db[(_0x5342('0x73'))][(_0x5342('0x74'))](_0x5342('0x7a'));}if(_[_0x5342('0x79')](_0x170115['body'][_0x5342('0x5a')])||_0x170115[_0x5342('0x5a')]['body']===''){throw new db[(_0x5342('0x73'))][(_0x5342('0x74'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x170115[_0x5342('0x5a')]['mapKey'])){throw new db[(_0x5342('0x73'))][(_0x5342('0x74'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x119694);}if(!_['includes'](_0x119694,_0x170115['body'][_0x5342('0x7b')])){throw new db[(_0x5342('0x73'))]['ValidationError'](_0x5342('0x7c')+_0x119694);}_0x39c4f1[_0x170115[_0x5342('0x5a')]['mapKey']]=_0x170115[_0x5342('0x5a')][_0x5342('0x7d')];})[_0x5342('0x1e')](function(){return db[_0x5342('0x3e')][_0x5342('0x58')]({'where':{'id':_0x170115['params']['id']},'include':[{'model':db[_0x5342('0x7e')],'as':_0x5342('0x7f'),'include':[{'model':db[_0x5342('0x72')],'as':_0x5342('0x80'),'where':_0x39c4f1,'limit':0x1,'order':[[_0x5342('0x75'),_0x5342('0x81')]]}]},{'model':db[_0x5342('0x82')],'as':'Applications'}]});})[_0x5342('0x1e')](handleEntityNotFound(_0x41664c,null))[_0x5342('0x1e')](function(_0x56a1e6){if(_0x56a1e6&&_0x56a1e6[_0x5342('0x7f')]){_0x3fd794[_0x5342('0x83')]=_0x56a1e6;_0x3fd794[_0x5342('0x84')]=_0x56a1e6[_0x5342('0x85')];_0x3fd794['list']=_0x56a1e6['List'];_0x3fd794['applications']=_[_0x5342('0x86')](_0x3fd794[_0x5342('0x84')],[_0x5342('0x87')],['asc']);if(_0x3fd794[_0x5342('0x83')][_0x5342('0x85')]){delete _0x3fd794[_0x5342('0x83')][_0x5342('0x85')];}if(_0x3fd794[_0x5342('0x83')][_0x5342('0x7f')]&&_0x3fd794[_0x5342('0x83')][_0x5342('0x7f')][_0x5342('0x80')][_0x5342('0x6d')]){return _0x3fd794['account'][_0x5342('0x7f')][_0x5342('0x80')][0x0];}var _0x1a1463=_[_0x5342('0x88')](_0x170115[_0x5342('0x5a')],{'firstName':_0x170115[_0x5342('0x5a')][_0x5342('0x7d')],'ListId':_0x56a1e6[_0x5342('0x78')]});_0x1a1463[_0x170115[_0x5342('0x5a')]['mapKey']]=_0x170115[_0x5342('0x5a')][_0x5342('0x7d')];return db[_0x5342('0x72')][_0x5342('0x59')](_0x1a1463,{'fields':_0x1da254,'raw':!![]});}})[_0x5342('0x1e')](handleEntityNotFound(_0x41664c,null))[_0x5342('0x1e')](function(_0x1de3e7){_0x3fd794[_0x5342('0x89')]=_0x1de3e7;if(_0x1de3e7){var _0x18a1f7={'ContactId':_0x1de3e7['id'],'OpenchannelAccountId':_0x170115[_0x5342('0x56')]['id'],'from':(_0x1de3e7[_0x5342('0x8a')]||'')+'\x20'+(_0x1de3e7[_0x5342('0x8b')]||'')};var _0x51bf6a={'OpenchannelAccountId':_0x170115[_0x5342('0x56')]['id'],'closed':![]};if(_0x170115[_0x5342('0x5a')][_0x5342('0x8c')]){_0x51bf6a[_0x5342('0x8c')]=_0x170115['body'][_0x5342('0x8c')];return db[_0x5342('0x8d')]['find']({'where':_0x51bf6a})['then'](function(_0x7fa04b){if(_0x7fa04b){return[_0x7fa04b,![]];}_0x18a1f7[_0x5342('0x8c')]=_0x170115[_0x5342('0x5a')]['threadId'];_0x18a1f7[_0x5342('0x8e')]=_0x170115[_0x5342('0x5a')][_0x5342('0x8e')];return db[_0x5342('0x8d')]['create'](_0x18a1f7)[_0x5342('0x1e')](function(_0x3e2d2b){return[_0x3e2d2b,!![]];});});}else{_0x51bf6a[_0x5342('0x8c')]=null;}_0x51bf6a[_0x5342('0x8f')]=_0x1de3e7['id'];return db['OpenchannelInteraction'][_0x5342('0x58')]({'where':_0x51bf6a})[_0x5342('0x1e')](function(_0x48a53a){if(_0x48a53a){return[_0x48a53a,![]];}return db[_0x5342('0x8d')][_0x5342('0x59')](_0x18a1f7)[_0x5342('0x1e')](function(_0x586c9e){return[_0x586c9e,!![]];});});}})['spread'](function(_0x174a4b,_0x2fe47e){if(_0x174a4b){_0x7b5420=_0x2fe47e;if(!_0x2fe47e){var _0x5028a6={'from':(_0x3fd794[_0x5342('0x89')]['firstName']||'')+'\x20'+(_0x3fd794[_0x5342('0x89')]['lastName']||'')};if(_0x170115[_0x5342('0x5a')]['threadId']&&_0x170115['body']['messageId']&&_0x170115['body'][_0x5342('0x8c')]!=_0x170115[_0x5342('0x5a')][_0x5342('0x90')]){_0x5028a6[_0x5342('0x8c')]=_0x170115[_0x5342('0x5a')]['messageId'];}return _0x174a4b[_0x5342('0x33')](_0x5028a6);}else{return _0x174a4b;}}})['then'](function(_0x316eb8){_0x3fd794['interaction']=_0x316eb8['get']({'plain':!![]});_0x3fd794['interaction'][_0x5342('0x91')]=_0x7b5420;if(_0x3fd794[_0x5342('0x92')][_0x5342('0x91')]){if(_0x3fd794[_0x5342('0x83')]['autoclose']){_0x3fd794['applications'][_0x5342('0x93')]({'id':0x0,'priority':_0x3fd794['applications'][_0x5342('0x6d')]+0x1,'app':_0x5342('0x94'),'appdata':'unmanaged','interval':_0x5342('0x95')});}}return db[_0x5342('0x96')][_0x5342('0x59')]({'body':_0x170115[_0x5342('0x5a')][_0x5342('0x5a')],'OpenchannelAccountId':_0x170115[_0x5342('0x56')]['id'],'OpenchannelInteractionId':_0x316eb8['id'],'direction':'in','ContactId':_0x3fd794['contact']['id'],'AttachmentId':_0x170115[_0x5342('0x5a')][_0x5342('0x97')]});})[_0x5342('0x1e')](function(_0x3a7900){_0x3fd794[_0x5342('0x22')]=_0x3a7900;if(_0x3fd794[_0x5342('0x92')][_0x5342('0x98')]){return db[_0x5342('0x99')][_0x5342('0x58')]({'attributes':['id',_0x5342('0x39')],'where':{'id':_0x3fd794[_0x5342('0x92')][_0x5342('0x98')]}})[_0x5342('0x1e')](function(_0x1aa8f7){if(_0x1aa8f7){_0x3fd794[_0x5342('0x84')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5342('0x9a'),'appdata':_0x1aa8f7[_0x5342('0x39')]+','+(_0x3fd794['account'][_0x5342('0x9b')]||0xa),'interval':_0x5342('0x95')});_0x3fd794[_0x5342('0x9c')]=![];}return respondWithRpcPromise('Start',_0x5342('0x9d'),_0x3fd794);});}return respondWithRpcPromise('Start',_0x5342('0x9d'),_0x3fd794);})[_0x5342('0x1e')](function(_0x6deab2){respondWithRpcPromise('EventManager','EventManager',{'event':_0x5342('0x71'),'message':_0x6deab2},client9002);return _0x6deab2;})[_0x5342('0x1e')](respondWithResult(_0x41664c,null))[_0x5342('0x27')](handleError(_0x41664c,null));};exports['addApplications']=function(_0x1f0ece,_0x220562,_0x3a0962){return db[_0x5342('0x3e')][_0x5342('0x66')]({'where':{'id':_0x1f0ece[_0x5342('0x56')]['id']}})[_0x5342('0x1e')](handleEntityNotFound(_0x220562,null))[_0x5342('0x1e')](function(_0x4f6925){if(_0x4f6925){return db['sequelize'][_0x5342('0x9e')](function(_0x3de596){return db[_0x5342('0x82')]['destroy']({'where':{'OpenchannelAccountId':_0x1f0ece[_0x5342('0x56')]['id']},'transaction':_0x3de596})[_0x5342('0x1e')](function(_0x2bc631){var _0x3e0e7e=_['map'](_0x1f0ece[_0x5342('0x5a')],function(_0x43704b){_0x43704b['OpenchannelAccountId']=_0x1f0ece['params']['id'];return _0x43704b;});return db[_0x5342('0x82')][_0x5342('0x9f')](_0x3e0e7e,{'transaction':_0x3de596});});})[_0x5342('0x1e')](function(){return db[_0x5342('0x82')][_0x5342('0xa0')]({'where':{'OpenchannelAccountId':_0x1f0ece['params']['id']},'order':_0x5342('0x87')});});}})[_0x5342('0x1e')](respondWithResult(_0x220562,null))['catch'](handleError(_0x220562,null));};exports[_0x5342('0xa1')]=function(_0x29adf2,_0x1e33b3,_0x18dcf2){var _0x24a9b4={};var _0x56b08e={};var _0x337fb2;var _0x1d14bb;return db[_0x5342('0x3e')]['findOne']({'where':{'id':_0x29adf2[_0x5342('0x56')]['id']}})[_0x5342('0x1e')](handleEntityNotFound(_0x1e33b3,null))[_0x5342('0x1e')](function(_0x3cbb32){if(_0x3cbb32){_0x337fb2=_0x3cbb32;_0x56b08e[_0x5342('0x43')]=_[_0x5342('0x3f')](db[_0x5342('0x82')]['rawAttributes']);_0x56b08e['query']=_[_0x5342('0x3f')](_0x29adf2[_0x5342('0x40')]);_0x56b08e[_0x5342('0x41')]=_[_0x5342('0x42')](_0x56b08e[_0x5342('0x43')],_0x56b08e['query']);_0x24a9b4['attributes']=_[_0x5342('0x42')](_0x56b08e['model'],qs['fields'](_0x29adf2['query']['fields']));_0x24a9b4['attributes']=_0x24a9b4[_0x5342('0x44')][_0x5342('0x6d')]?_0x24a9b4[_0x5342('0x44')]:_0x56b08e[_0x5342('0x43')];_0x24a9b4['order']=qs[_0x5342('0x49')](_0x29adf2[_0x5342('0x40')][_0x5342('0x49')]);_0x24a9b4[_0x5342('0x4a')]=qs[_0x5342('0x41')](_[_0x5342('0x4b')](_0x29adf2['query'],_0x56b08e[_0x5342('0x41')]));if(_0x29adf2[_0x5342('0x40')]['filter']){_0x24a9b4[_0x5342('0x4a')]=_['merge'](_0x24a9b4[_0x5342('0x4a')],{'$or':_['map'](_0x24a9b4[_0x5342('0x44')],function(_0x3d8b24){var _0x544fd3={};_0x544fd3[_0x3d8b24]={'$like':'%'+_0x29adf2[_0x5342('0x40')][_0x5342('0x4c')]+'%'};return _0x544fd3;})});}_0x24a9b4=_[_0x5342('0x4d')]({},_0x24a9b4,_0x29adf2[_0x5342('0x52')]);return _0x337fb2[_0x5342('0xa1')](_0x24a9b4);}})[_0x5342('0x1e')](function(_0x1b9c90){if(_0x1b9c90){_0x1d14bb=_0x1b9c90[_0x5342('0x6d')];if(!_0x29adf2[_0x5342('0x40')]['hasOwnProperty'](_0x5342('0x47'))){_0x24a9b4[_0x5342('0x2e')]=qs['limit'](_0x29adf2[_0x5342('0x40')][_0x5342('0x2e')]);_0x24a9b4[_0x5342('0x2d')]=qs[_0x5342('0x2d')](_0x29adf2[_0x5342('0x40')][_0x5342('0x2d')]);}return _0x337fb2[_0x5342('0xa1')](_0x24a9b4);}})[_0x5342('0x1e')](function(_0x31de26){if(_0x31de26){return _0x31de26?{'count':_0x1d14bb,'rows':_0x31de26}:null;}})[_0x5342('0x1e')](respondWithResult(_0x1e33b3,null))[_0x5342('0x27')](handleError(_0x1e33b3,null));};exports[_0x5342('0xa2')]=function(_0x36d77c,_0x2fbc75,_0x64003d){var _0x495ddb={'raw':![],'where':{}};var _0x2d4677={};var _0x2dbc0e={'count':0x0,'rows':[]};return db[_0x5342('0x3e')][_0x5342('0x66')]({'where':{'id':_0x36d77c[_0x5342('0x56')]['id']}})['then'](handleEntityNotFound(_0x2fbc75,null))[_0x5342('0x1e')](function(_0x4f1fe3){if(_0x4f1fe3){_0x2d4677[_0x5342('0x43')]=_[_0x5342('0x3f')](db['OpenchannelInteraction']['rawAttributes']);_0x2d4677[_0x5342('0x40')]=_[_0x5342('0x3f')](_0x36d77c['query']);_0x2d4677[_0x5342('0x41')]=_[_0x5342('0x42')](_0x2d4677[_0x5342('0x43')],_0x2d4677[_0x5342('0x40')]);_0x495ddb[_0x5342('0x44')]=_['intersection'](_0x2d4677[_0x5342('0x43')],qs[_0x5342('0x45')](_0x36d77c[_0x5342('0x40')][_0x5342('0x45')]));_0x495ddb['attributes']=_0x495ddb['attributes']['length']?_0x495ddb[_0x5342('0x44')]:_0x2d4677['model'];if(!_0x36d77c[_0x5342('0x40')][_0x5342('0x46')](_0x5342('0x47'))){_0x495ddb[_0x5342('0x2e')]=qs[_0x5342('0x2e')](_0x36d77c['query'][_0x5342('0x2e')]);_0x495ddb[_0x5342('0x2d')]=qs[_0x5342('0x2d')](_0x36d77c[_0x5342('0x40')][_0x5342('0x2d')]);}_0x495ddb[_0x5342('0x48')]=qs[_0x5342('0x49')](_0x36d77c[_0x5342('0x40')]['sort']);_0x495ddb[_0x5342('0x4a')]=qs['filters'](_['pick'](_0x36d77c[_0x5342('0x40')],_0x2d4677[_0x5342('0x41')]));_0x495ddb[_0x5342('0x4a')]['OpenchannelAccountId']=_0x4f1fe3['id'];if(_0x36d77c['query'][_0x5342('0x4c')]){_0x495ddb[_0x5342('0x4a')]=_[_0x5342('0x4d')](_0x495ddb['where'],{'$or':_['map'](_0x495ddb[_0x5342('0x44')],function(_0x3b2d53){var _0x336060={};_0x336060[_0x3b2d53]={'$like':'%'+_0x36d77c[_0x5342('0x40')]['filter']+'%'};return _0x336060;})});}_0x495ddb=_['merge']({},_0x495ddb,_0x36d77c['options']);return db[_0x5342('0x8d')][_0x5342('0x2c')]({'where':_0x495ddb[_0x5342('0x4a')]})[_0x5342('0x1e')](function(_0x5478a7){_0x2dbc0e[_0x5342('0x2c')]=_0x5478a7;if(_0x36d77c[_0x5342('0x40')][_0x5342('0x57')]){_0x495ddb[_0x5342('0x6e')]=[{'model':db[_0x5342('0x72')],'as':_0x5342('0xa3'),'required':![]},{'model':db[_0x5342('0x99')],'as':_0x5342('0xa4'),'attributes':[_0x5342('0x39'),_0x5342('0xa5'),_0x5342('0xa6')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x5342('0x39'),'color'],'where':_0x36d77c[_0x5342('0x40')][_0x5342('0xa7')]?{'id':_0x36d77c[_0x5342('0x40')]['tag']}:undefined,'required':_0x36d77c[_0x5342('0x40')][_0x5342('0xa7')]?!![]:![]}];}return db[_0x5342('0x8d')][_0x5342('0x53')](_0x495ddb);})[_0x5342('0x1e')](function(_0x3347b0){_0x2dbc0e[_0x5342('0x54')]=_0x3347b0;return _0x2dbc0e;});}})[_0x5342('0x1e')](respondWithFilteredResult(_0x2fbc75,_0x495ddb))[_0x5342('0x27')](handleError(_0x2fbc75,null));};exports[_0x5342('0xa8')]=function(_0xf1bff7,_0x700f66,_0x37a473){return db[_0x5342('0x3e')][_0x5342('0x58')]({'where':{'id':_0xf1bff7[_0x5342('0x56')]['id']}})['then'](handleEntityNotFound(_0x700f66,null))['then'](function(_0x2cdec5){if(_0x2cdec5){return _0x2cdec5[_0x5342('0xa8')](_0xf1bff7[_0x5342('0x5a')][_0x5342('0x70')],_[_0x5342('0xa9')](_0xf1bff7[_0x5342('0x5a')],['ids','id'])||{})[_0x5342('0xaa')](function(_0x23c4f6){for(var _0x3102ba=0x0;_0x3102ba<_0xf1bff7[_0x5342('0x5a')][_0x5342('0x70')][_0x5342('0x6d')];_0x3102ba+=0x1){socket[_0x5342('0xab')](_0x5342('0xac'),{'UserId':_0xf1bff7['body']['ids'][_0x3102ba],'OpenchannelAccountId':_0xf1bff7[_0x5342('0x56')]['id']});}return _0x23c4f6;});}})[_0x5342('0x1e')](respondWithResult(_0x700f66,null))[_0x5342('0x27')](handleError(_0x700f66,null));};exports['removeAgents']=function(_0x4adbd5,_0x39efc2,_0x4624d1){return db['OpenchannelAccount'][_0x5342('0x58')]({'where':{'id':_0x4adbd5[_0x5342('0x56')]['id']}})['then'](handleEntityNotFound(_0x39efc2,null))['then'](function(_0x40a689){if(_0x40a689){return _0x40a689[_0x5342('0xad')](_0x4adbd5['query']['ids'])['then'](function(){if(_[_0x5342('0xae')](_0x4adbd5[_0x5342('0x40')]['ids'])){for(var _0x280ea6=0x0;_0x280ea6<_0x4adbd5[_0x5342('0x40')][_0x5342('0x70')][_0x5342('0x6d')];_0x280ea6+=0x1){socket['emit'](_0x5342('0xaf'),{'UserId':Number(_0x4adbd5[_0x5342('0x40')][_0x5342('0x70')][_0x280ea6]),'OpenchannelAccountId':Number(_0x4adbd5[_0x5342('0x56')]['id'])});}}else{socket[_0x5342('0xab')]('userOpenchannelAccount:remove',{'UserId':Number(_0x4adbd5[_0x5342('0x40')][_0x5342('0x70')]),'OpenchannelAccountId':Number(_0x4adbd5['params']['id'])});}});}})['then'](respondWithStatusCode(_0x39efc2,null))[_0x5342('0x27')](handleError(_0x39efc2,null));};exports[_0x5342('0xb0')]=function(_0x3b15a7,_0x204dba,_0x17fcad){var _0x16a04c={};var _0x52cfac={};var _0x3e9136;var _0x562920;return db['OpenchannelAccount'][_0x5342('0x66')]({'where':{'id':_0x3b15a7[_0x5342('0x56')]['id']}})[_0x5342('0x1e')](handleEntityNotFound(_0x204dba,null))['then'](function(_0x23a88e){if(_0x23a88e){_0x3e9136=_0x23a88e;_0x52cfac['model']=_['keys'](db[_0x5342('0x99')][_0x5342('0x67')]);_0x52cfac[_0x5342('0x40')]=_['keys'](_0x3b15a7[_0x5342('0x40')]);_0x52cfac['filters']=_['intersection'](_0x52cfac[_0x5342('0x43')],_0x52cfac['query']);_0x16a04c[_0x5342('0x44')]=_[_0x5342('0x42')](_0x52cfac[_0x5342('0x43')],qs[_0x5342('0x45')](_0x3b15a7[_0x5342('0x40')][_0x5342('0x45')]));_0x16a04c[_0x5342('0x44')]=_0x16a04c[_0x5342('0x44')][_0x5342('0x6d')]?_0x16a04c[_0x5342('0x44')]:_0x52cfac['model'];_0x16a04c[_0x5342('0x48')]=qs[_0x5342('0x49')](_0x3b15a7[_0x5342('0x40')][_0x5342('0x49')]);_0x16a04c[_0x5342('0x4a')]=qs[_0x5342('0x41')](_['pick'](_0x3b15a7[_0x5342('0x40')],_0x52cfac[_0x5342('0x41')]));if(_0x3b15a7[_0x5342('0x40')][_0x5342('0x4c')]){_0x16a04c[_0x5342('0x4a')]=_[_0x5342('0x4d')](_0x16a04c['where'],{'$or':_['map'](_0x16a04c['attributes'],function(_0x513dd6){var _0x4f99f3={};_0x4f99f3[_0x513dd6]={'$like':'%'+_0x3b15a7[_0x5342('0x40')][_0x5342('0x4c')]+'%'};return _0x4f99f3;})});}_0x16a04c=_[_0x5342('0x4d')]({},_0x16a04c,_0x3b15a7[_0x5342('0x52')]);return _0x3e9136[_0x5342('0xb0')](_0x16a04c);}})[_0x5342('0x1e')](function(_0x3e98ec){if(_0x3e98ec){_0x562920=_0x3e98ec[_0x5342('0x6d')];if(!_0x3b15a7[_0x5342('0x40')][_0x5342('0x46')](_0x5342('0x47'))){_0x16a04c[_0x5342('0x2e')]=qs[_0x5342('0x2e')](_0x3b15a7[_0x5342('0x40')][_0x5342('0x2e')]);_0x16a04c['offset']=qs['offset'](_0x3b15a7['query']['offset']);}return _0x3e9136['getAgents'](_0x16a04c);}})['then'](function(_0x132636){if(_0x132636){return _0x132636?{'count':_0x562920,'rows':_0x132636}:null;}})[_0x5342('0x1e')](respondWithResult(_0x204dba,null))[_0x5342('0x27')](handleError(_0x204dba,null));};exports[_0x5342('0x3a')]=function(_0x49a3fb,_0x13dd55,_0x547566){var _0x130393,_0x4b8a77,_0x2b73b2;if(_[_0x5342('0x79')](_0x49a3fb[_0x5342('0x5a')][_0x5342('0x5a')])||_0x49a3fb[_0x5342('0x5a')]['body']===''){throw new db[(_0x5342('0x73'))][(_0x5342('0x74'))](_0x5342('0xb1'));}if(_['isNil'](_0x49a3fb[_0x5342('0x5a')]['to'])){}_0x130393=_0x49a3fb[_0x5342('0x5a')]['to'];return db[_0x5342('0x3e')][_0x5342('0x66')]({'where':{'id':_0x49a3fb[_0x5342('0x56')]['id']}})['then'](handleEntityNotFound(_0x13dd55,null))[_0x5342('0x1e')](function(_0x27fe55){if(_0x27fe55){return db[_0x5342('0x3e')][_0x5342('0x58')]({'where':{'id':_0x27fe55['id']},'include':[{'model':db[_0x5342('0x7e')],'as':_0x5342('0x7f'),'include':[{'model':db[_0x5342('0x72')],'as':_0x5342('0x80'),'where':{[_0x27fe55[_0x5342('0x7b')]]:_0x130393},'limit':0x1,'order':[[_0x5342('0x75'),_0x5342('0x81')]]}]}]})['then'](handleEntityNotFound(_0x13dd55,null))['then'](function(_0x52354d){if(_0x52354d&&_0x52354d['List']){_0x4b8a77=_0x52354d[_0x5342('0x35')]({'plain':!![]});if(_0x4b8a77['List']&&_0x4b8a77[_0x5342('0x7f')][_0x5342('0x80')]['length']){return _0x4b8a77[_0x5342('0x7f')]['Contacts'][0x0];}return db['CmContact']['create'](_[_0x5342('0x88')](_0x49a3fb[_0x5342('0x5a')],{'firstName':_0x130393,[_0x52354d[_0x5342('0x7b')]]:_0x130393,'phone':_0x130393,'ListId':_0x4b8a77['ListId']}));}})['then'](handleEntityNotFound(_0x13dd55,null))[_0x5342('0x1e')](function(_0x1ebcef){if(_0x1ebcef){_0x2b73b2=_0x1ebcef;return db[_0x5342('0x8d')]['find']({'where':{'ContactId':_0x2b73b2['id'],'closed':![],'OpenchannelAccountId':_0x4b8a77['id']}})[_0x5342('0x1e')](function(_0x1db8b4){if(_0x1db8b4){return[_0x1db8b4,![]];}return db[_0x5342('0x8d')][_0x5342('0x59')]({'UserId':_0x49a3fb['user']['id'],'ContactId':_0x2b73b2['id'],'OpenchannelAccountId':_0x4b8a77['id'],'lastMsgDirection':_0x5342('0xb2'),'Messages':[_[_0x5342('0x4d')](_0x49a3fb[_0x5342('0x5a')],{'read':![],'body':_0x49a3fb[_0x5342('0x5a')][_0x5342('0x5a')],'OpenchannelAccountId':_0x4b8a77['id'],'UserId':_0x49a3fb['user']['id'],'ContactId':_0x2b73b2['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x5342('0xb3')}]})[_0x5342('0x1e')](function(_0x20a2d4){return[_0x20a2d4,!![]];});});}})[_0x5342('0xaa')](function(_0x5595d4,_0x14c746){if(_0x14c746){return _0x5595d4;}return db['OpenchannelMessage'][_0x5342('0x59')](_[_0x5342('0x4d')](_0x49a3fb['body'],{'read':![],'body':_0x49a3fb['body'][_0x5342('0x5a')],'OpenchannelAccountId':_0x4b8a77['id'],'OpenchannelInteractionId':_0x5595d4['id'],'UserId':_0x49a3fb[_0x5342('0x5b')]['id'],'ContactId':_0x2b73b2['id']}))['then'](function(_0x4328e1){_0x5595d4[_0x5342('0xb4')][_0x5342('0xb3')]=[];_0x5595d4[_0x5342('0xb4')][_0x5342('0xb3')][_0x5342('0x93')](_0x4328e1['dataValues']);return _0x5595d4;});});}})[_0x5342('0x1e')](respondWithResult(_0x13dd55,null))[_0x5342('0x27')](handleError(_0x13dd55,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 7436a6a..f65f362 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 _0xa5bf=['setMaxListeners','save','update','emit','hasOwnProperty','events','OpenchannelAccount'];(function(_0x3f3f06,_0x581e5b){var _0x140feb=function(_0x4cc383){while(--_0x4cc383){_0x3f3f06['push'](_0x3f3f06['shift']());}};_0x140feb(++_0x581e5b);}(_0xa5bf,0x101));var _0xfa5b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa5bf[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0xfa5b('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xfa5b('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xfa5b('0x2')](0x0);var events={'afterCreate':_0xfa5b('0x3'),'afterUpdate':_0xfa5b('0x4'),'afterDestroy':'remove'};function emitEvent(_0xe688c8){return function(_0x565457,_0x43f97b,_0x38e3b3){OpenchannelAccountEvents[_0xfa5b('0x5')](_0xe688c8+':'+_0x565457['id'],_0x565457);OpenchannelAccountEvents[_0xfa5b('0x5')](_0xe688c8,_0x565457);_0x38e3b3(null);};}for(var e in events){if(events[_0xfa5b('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0xe5a2=['OpenchannelAccount','setMaxListeners','emit','hook','exports','events','../../mysqldb'];(function(_0x467686,_0x5e5772){var _0x280761=function(_0x342ba7){while(--_0x342ba7){_0x467686['push'](_0x467686['shift']());}};_0x280761(++_0x5e5772);}(_0xe5a2,0x98));var _0x2e5a=function(_0x4e0465,_0x10e136){_0x4e0465=_0x4e0465-0x0;var _0x287047=_0xe5a2[_0x4e0465];return _0x287047;};'use strict';var EventEmitter=require(_0x2e5a('0x0'));var OpenchannelAccount=require(_0x2e5a('0x1'))['db'][_0x2e5a('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x2e5a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x9ef750){return function(_0x2967da,_0xcae79c,_0x57a723){OpenchannelAccountEvents['emit'](_0x9ef750+':'+_0x2967da['id'],_0x2967da);OpenchannelAccountEvents[_0x2e5a('0x4')](_0x9ef750,_0x2967da);_0x57a723(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x2e5a('0x5')](e,emitEvent(event));}}module[_0x2e5a('0x6')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index c83a234..b514fb7 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 _0x7a7c=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./openchannelAccount.attributes','define','OpenchannelAccount','openchannel_accounts','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a7c,0x1c6));var _0xc7a7=function(_0x5a2175,_0x414170){_0x5a2175=_0x5a2175-0x0;var _0x4a4dfd=_0x7a7c[_0x5a2175];return _0x4a4dfd;};'use strict';var _=require(_0xc7a7('0x0'));var util=require(_0xc7a7('0x1'));var logger=require(_0xc7a7('0x2'))(_0xc7a7('0x3'));var moment=require('moment');var BPromise=require(_0xc7a7('0x4'));var rp=require(_0xc7a7('0x5'));var fs=require('fs');var path=require(_0xc7a7('0x6'));var rimraf=require('rimraf');var config=require(_0xc7a7('0x7'));var attributes=require(_0xc7a7('0x8'));module['exports']=function(_0x1ccf86,_0x3078ea){return _0x1ccf86[_0xc7a7('0x9')](_0xc7a7('0xa'),attributes,{'tableName':_0xc7a7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xadc2=['openchannel_accounts','lodash','../../config/logger','api','bluebird','request-promise','path','./openchannelAccount.attributes','define','OpenchannelAccount'];(function(_0x43819f,_0x1ab95b){var _0x8d9f39=function(_0x14b115){while(--_0x14b115){_0x43819f['push'](_0x43819f['shift']());}};_0x8d9f39(++_0x1ab95b);}(_0xadc2,0x187));var _0x2adc=function(_0x5abdb1,_0x53a9d8){_0x5abdb1=_0x5abdb1-0x0;var _0x353b1b=_0xadc2[_0x5abdb1];return _0x353b1b;};'use strict';var _=require(_0x2adc('0x0'));var util=require('util');var logger=require(_0x2adc('0x1'))(_0x2adc('0x2'));var moment=require('moment');var BPromise=require(_0x2adc('0x3'));var rp=require(_0x2adc('0x4'));var fs=require('fs');var path=require(_0x2adc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2adc('0x6'));module['exports']=function(_0x38b07c,_0x4ca949){return _0x38b07c[_0x2adc('0x7')](_0x2adc('0x8'),attributes,{'tableName':_0x2adc('0x9'),'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 f3c1c02..49c6c6e 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(_0x2cbb74,_0x241c10){var _0xa6d18=function(_0x5a2940){while(--_0x5a2940){_0x2cbb74['push'](_0x2cbb74['shift']());}};_0xa6d18(++_0x241c10);}(_0xe14b,0x93));var _0xbe14=function(_0x11ba0f,_0x33fe33){_0x11ba0f=_0x11ba0f-0x0;var _0x357d1c=_0xe14b[_0x11ba0f];return _0x357d1c;};'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 _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(_0x57b8f,_0x46bd03){var _0x500dc9=function(_0x48e451){while(--_0x48e451){_0x57b8f['push'](_0x57b8f['shift']());}};_0x500dc9(++_0x46bd03);}(_0xe14b,0x93));var _0xbe14=function(_0x593a94,_0xe49b46){_0x593a94=_0x593a94-0x0;var _0x4fc97f=_0xe14b[_0x593a94];return _0x4fc97f;};'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 diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 0f29b55..015d11c 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 _0x3abc=['openchannelAccount:','save','removeListener','register'];(function(_0x3a0428,_0xa7557e){var _0x265965=function(_0x42bff5){while(--_0x42bff5){_0x3a0428['push'](_0x3a0428['shift']());}};_0x265965(++_0xa7557e);}(_0x3abc,0x155));var _0xc3ab=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x3abc[_0x220dbb];return _0x2b77de;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xc3ab('0x0'),'remove','update'];function createListener(_0x540258,_0x11720b){return function(_0x151d53){_0x11720b['emit'](_0x540258,_0x151d53);};}function removeListener(_0x4418ea,_0x4e6d1b){return function(){OpenchannelAccountEvents[_0xc3ab('0x1')](_0x4418ea,_0x4e6d1b);};}exports[_0xc3ab('0x2')]=function(_0x25ea28){for(var _0x99fef3=0x0,_0xd28da7=events['length'];_0x99fef3<_0xd28da7;_0x99fef3++){var _0x5b89ea=events[_0x99fef3];var _0x33595e=createListener(_0xc3ab('0x3')+_0x5b89ea,_0x25ea28);OpenchannelAccountEvents['on'](_0x5b89ea,_0x33595e);}}; \ No newline at end of file +var _0x95d7=['removeListener','register','length','openchannelAccount:','save','remove','update','emit'];(function(_0x574617,_0x42eccc){var _0x29de90=function(_0x367aff){while(--_0x367aff){_0x574617['push'](_0x574617['shift']());}};_0x29de90(++_0x42eccc);}(_0x95d7,0x114));var _0x795d=function(_0x179303,_0x523829){_0x179303=_0x179303-0x0;var _0xbac768=_0x95d7[_0x179303];return _0xbac768;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x795d('0x0'),_0x795d('0x1'),_0x795d('0x2')];function createListener(_0x359083,_0x45417f){return function(_0x2a86d9){_0x45417f[_0x795d('0x3')](_0x359083,_0x2a86d9);};}function removeListener(_0x13c155,_0x5a21fb){return function(){OpenchannelAccountEvents[_0x795d('0x4')](_0x13c155,_0x5a21fb);};}exports[_0x795d('0x5')]=function(_0x3df758){for(var _0x312edc=0x0,_0x3f8710=events[_0x795d('0x6')];_0x312edc<_0x3f8710;_0x312edc++){var _0x54ebfc=events[_0x312edc];var _0x3b8172=createListener(_0x795d('0x7')+_0x54ebfc,_0x3df758);OpenchannelAccountEvents['on'](_0x54ebfc,_0x3b8172);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 1ccd250..b448062 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 _0xcc1c=['create','update','delete','destroy','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x25df80,_0xa2aec5){var _0x17b6d0=function(_0x446155){while(--_0x446155){_0x25df80['push'](_0x25df80['shift']());}};_0x17b6d0(++_0xa2aec5);}(_0xcc1c,0x1c6));var _0xccc1=function(_0x602ca8,_0x568e82){_0x602ca8=_0x602ca8-0x0;var _0x26e8ab=_0xcc1c[_0x602ca8];return _0x26e8ab;};'use strict';var multer=require('multer');var util=require(_0xccc1('0x0'));var path=require(_0xccc1('0x1'));var timeout=require(_0xccc1('0x2'));var express=require(_0xccc1('0x3'));var router=express['Router']();var auth=require(_0xccc1('0x4'));var interaction=require(_0xccc1('0x5'));var config=require(_0xccc1('0x6'));var controller=require(_0xccc1('0x7'));router[_0xccc1('0x8')]('/',auth[_0xccc1('0x9')](),controller[_0xccc1('0xa')]);router['get'](_0xccc1('0xb'),auth[_0xccc1('0x9')](),controller[_0xccc1('0xc')]);router[_0xccc1('0xd')]('/',auth['isAuthenticated'](),controller[_0xccc1('0xe')]);router['put'](_0xccc1('0xb'),auth[_0xccc1('0x9')](),controller[_0xccc1('0xf')]);router[_0xccc1('0x10')](_0xccc1('0xb'),auth[_0xccc1('0x9')](),controller[_0xccc1('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf0fe=['../../components/interaction/service','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','update','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x49c151,_0x4b2435){var _0x1a9163=function(_0x5ce7fa){while(--_0x5ce7fa){_0x49c151['push'](_0x49c151['shift']());}};_0x1a9163(++_0x4b2435);}(_0xf0fe,0x15a));var _0xef0f=function(_0x2db006,_0x5f412f){_0x2db006=_0x2db006-0x0;var _0x28d268=_0xf0fe[_0x2db006];return _0x28d268;};'use strict';var multer=require(_0xef0f('0x0'));var util=require('util');var path=require(_0xef0f('0x1'));var timeout=require(_0xef0f('0x2'));var express=require(_0xef0f('0x3'));var router=express[_0xef0f('0x4')]();var auth=require(_0xef0f('0x5'));var interaction=require(_0xef0f('0x6'));var config=require('../../config/environment');var controller=require(_0xef0f('0x7'));router[_0xef0f('0x8')]('/',auth[_0xef0f('0x9')](),controller[_0xef0f('0xa')]);router['get'](_0xef0f('0xb'),auth[_0xef0f('0x9')](),controller[_0xef0f('0xc')]);router[_0xef0f('0xd')]('/',auth[_0xef0f('0x9')](),controller[_0xef0f('0xe')]);router['put'](_0xef0f('0xb'),auth['isAuthenticated'](),controller[_0xef0f('0xf')]);router['delete'](_0xef0f('0xb'),auth[_0xef0f('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 6c63aa4..46154b5 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 _0x1d91=['sequelize','exports','INTEGER','noop','TEXT','STRING'];(function(_0x4db46b,_0xadcb1a){var _0x565be8=function(_0x5d2e50){while(--_0x5d2e50){_0x4db46b['push'](_0x4db46b['shift']());}};_0x565be8(++_0xadcb1a);}(_0x1d91,0x150));var _0x11d9=function(_0x645c29,_0x2d14f8){_0x645c29=_0x645c29-0x0;var _0x302294=_0x1d91[_0x645c29];return _0x302294;};'use strict';var Sequelize=require(_0x11d9('0x0'));module[_0x11d9('0x1')]={'priority':{'type':Sequelize[_0x11d9('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x11d9('0x3')},'appdata':{'type':Sequelize[_0x11d9('0x4')]()},'description':{'type':Sequelize[_0x11d9('0x5')]},'interval':{'type':Sequelize[_0x11d9('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x1cbc=['STRING','noop','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x1a12e1,_0x52acab){var _0x22768a=function(_0x250f5f){while(--_0x250f5f){_0x1a12e1['push'](_0x1a12e1['shift']());}};_0x22768a(++_0x52acab);}(_0x1cbc,0xf4));var _0xc1cb=function(_0x41d552,_0x1e59db){_0x41d552=_0x41d552-0x0;var _0x45d056=_0x1cbc[_0x41d552];return _0x45d056;};'use strict';var Sequelize=require(_0xc1cb('0x0'));module['exports']={'priority':{'type':Sequelize[_0xc1cb('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc1cb('0x2')],'allowNull':![],'defaultValue':_0xc1cb('0x3')},'appdata':{'type':Sequelize[_0xc1cb('0x4')]()},'description':{'type':Sequelize[_0xc1cb('0x2')]},'interval':{'type':Sequelize[_0xc1cb('0x2')],'defaultValue':_0xc1cb('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index eb246f9..4b7817d 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 _0x54af=['Content-Range','apply','save','then','destroy','end','error','name','send','index','OpenchannelApplication','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','count','includeAll','include','findAll','rows','show','merge','catch','create','body','find','params','html-pdf','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','set'];(function(_0x1219ba,_0x195743){var _0x582035=function(_0x374e34){while(--_0x374e34){_0x1219ba['push'](_0x1219ba['shift']());}};_0x582035(++_0x195743);}(_0x54af,0xaf));var _0xf54a=function(_0x3a56b5,_0x26663e){_0x3a56b5=_0x3a56b5-0x0;var _0x272f0b=_0x54af[_0x3a56b5];return _0x272f0b;};'use strict';var pdf=require(_0xf54a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf54a('0x1'));var zipdir=require(_0xf54a('0x2'));var jsonpatch=require(_0xf54a('0x3'));var rp=require('request-promise');var moment=require(_0xf54a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf54a('0x5'));var path=require(_0xf54a('0x6'));var sox=require(_0xf54a('0x7'));var csv=require(_0xf54a('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xf54a('0x9'));var crypto=require(_0xf54a('0xa'));var jsforce=require(_0xf54a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf54a('0x8'));var querystring=require(_0xf54a('0xc'));var Papa=require(_0xf54a('0xd'));var Redis=require(_0xf54a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf54a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54a('0x10'))(_0xf54a('0x11'));var utils=require(_0xf54a('0x12'));var config=require(_0xf54a('0x13'));var db=require(_0xf54a('0x14'))['db'];function respondWithStatusCode(_0x58b6c7,_0x5cd55d){_0x5cd55d=_0x5cd55d||0xcc;return function(_0x3727e5){if(_0x3727e5){return _0x58b6c7[_0xf54a('0x15')](_0x5cd55d);}return _0x58b6c7[_0xf54a('0x16')](_0x5cd55d)['end']();};}function respondWithResult(_0x187742,_0x5dd5ab){_0x5dd5ab=_0x5dd5ab||0xc8;return function(_0xef8faf){if(_0xef8faf){return _0x187742['status'](_0x5dd5ab)[_0xf54a('0x17')](_0xef8faf);}};}function respondWithFilteredResult(_0x5b1fff,_0x216ad1){return function(_0x5247bc){if(_0x5247bc){var _0x2b1cf9=_0x5247bc['count'],_0x4bee0a=_0x216ad1['offset'],_0x202b97=_0x216ad1[_0xf54a('0x18')]+_0x216ad1['limit'],_0x59526f;if(_0x202b97>=_0x2b1cf9){_0x202b97=_0x2b1cf9;_0x59526f=0xc8;}else{_0x59526f=0xce;}_0x5b1fff[_0xf54a('0x16')](_0x59526f);return _0x5b1fff[_0xf54a('0x19')](_0xf54a('0x1a'),_0x4bee0a+'-'+_0x202b97+'/'+_0x2b1cf9)[_0xf54a('0x17')](_0x5247bc);}return null;};}function patchUpdates(_0x5034b6){return function(_0x4b502d){try{jsonpatch[_0xf54a('0x1b')](_0x4b502d,_0x5034b6,!![]);}catch(_0x1db322){return BPromise['reject'](_0x1db322);}return _0x4b502d[_0xf54a('0x1c')]();};}function saveUpdates(_0x58a4b6,_0x3d7d32){return function(_0x28d246){if(_0x28d246){return _0x28d246['update'](_0x58a4b6)[_0xf54a('0x1d')](function(_0x3033bc){return _0x3033bc;});}return null;};}function removeEntity(_0x22db5c,_0x592f19){return function(_0x3f2e7b){if(_0x3f2e7b){return _0x3f2e7b[_0xf54a('0x1e')]()[_0xf54a('0x1d')](function(){_0x22db5c[_0xf54a('0x16')](0xcc)[_0xf54a('0x1f')]();});}};}function handleEntityNotFound(_0x4c8813,_0x38663f){return function(_0x1c996b){if(!_0x1c996b){_0x4c8813[_0xf54a('0x15')](0x194);}return _0x1c996b;};}function handleError(_0x44973b,_0x4e7233){_0x4e7233=_0x4e7233||0x1f4;return function(_0x39afe0){logger[_0xf54a('0x20')](_0x39afe0['stack']);if(_0x39afe0[_0xf54a('0x21')]){delete _0x39afe0[_0xf54a('0x21')];}_0x44973b[_0xf54a('0x16')](_0x4e7233)[_0xf54a('0x22')](_0x39afe0);};}exports[_0xf54a('0x23')]=function(_0x326a20,_0x2ed4e4){var _0x545d5b={},_0x51a8e3={},_0x5d26d5={'count':0x0,'rows':[]};var _0x390e6b=db[_0xf54a('0x24')][_0xf54a('0x25')];_0x51a8e3['model']=_[_0xf54a('0x26')](_0x390e6b);_0x51a8e3[_0xf54a('0x27')]=_[_0xf54a('0x26')](_0x326a20[_0xf54a('0x27')]);_0x51a8e3[_0xf54a('0x28')]=_[_0xf54a('0x29')](_0x51a8e3[_0xf54a('0x2a')],_0x51a8e3[_0xf54a('0x27')]);_0x545d5b[_0xf54a('0x2b')]=_['intersection'](_0x51a8e3['model'],qs[_0xf54a('0x2c')](_0x326a20['query'][_0xf54a('0x2c')]));_0x545d5b[_0xf54a('0x2b')]=_0x545d5b[_0xf54a('0x2b')][_0xf54a('0x2d')]?_0x545d5b[_0xf54a('0x2b')]:_0x51a8e3['model'];if(!_0x326a20[_0xf54a('0x27')][_0xf54a('0x2e')](_0xf54a('0x2f'))){_0x545d5b[_0xf54a('0x30')]=qs[_0xf54a('0x30')](_0x326a20['query']['limit']);_0x545d5b[_0xf54a('0x18')]=qs[_0xf54a('0x18')](_0x326a20[_0xf54a('0x27')][_0xf54a('0x18')]);}_0x545d5b[_0xf54a('0x31')]=qs[_0xf54a('0x32')](_0x326a20[_0xf54a('0x27')][_0xf54a('0x32')]);_0x545d5b[_0xf54a('0x33')]=qs[_0xf54a('0x28')](_[_0xf54a('0x34')](_0x326a20[_0xf54a('0x27')],_0x51a8e3[_0xf54a('0x28')]));if(_0x326a20[_0xf54a('0x27')][_0xf54a('0x35')]){_0x545d5b['where']=_['merge'](_0x545d5b['where'],{'$or':_['map'](_0x390e6b,function(_0x252d2b){if(_0x252d2b[_0xf54a('0x36')]['key']!=='VIRTUAL'){var _0x421865={};_0x421865[_0x252d2b['field']]={'$like':'%'+_0x326a20[_0xf54a('0x27')][_0xf54a('0x35')]+'%'};return _0x421865;}})});}_0x545d5b=_['merge']({},_0x545d5b,_0x326a20['options']);var _0xf4e2a7={'where':_0x545d5b[_0xf54a('0x33')]};return db['OpenchannelApplication'][_0xf54a('0x37')](_0xf4e2a7)[_0xf54a('0x1d')](function(_0x2beb52){_0x5d26d5[_0xf54a('0x37')]=_0x2beb52;if(_0x326a20[_0xf54a('0x27')][_0xf54a('0x38')]){_0x545d5b[_0xf54a('0x39')]=[{'all':!![]}];}return db[_0xf54a('0x24')][_0xf54a('0x3a')](_0x545d5b);})[_0xf54a('0x1d')](function(_0xa6ad07){_0x5d26d5[_0xf54a('0x3b')]=_0xa6ad07;return _0x5d26d5;})[_0xf54a('0x1d')](respondWithFilteredResult(_0x2ed4e4,_0x545d5b))['catch'](handleError(_0x2ed4e4,null));};exports[_0xf54a('0x3c')]=function(_0xd199ec,_0x4e4215){var _0xdeb111={'raw':!![],'where':{'id':_0xd199ec['params']['id']}},_0xcd25c3={};_0xcd25c3['model']=_[_0xf54a('0x26')](db[_0xf54a('0x24')][_0xf54a('0x25')]);_0xcd25c3[_0xf54a('0x27')]=_[_0xf54a('0x26')](_0xd199ec[_0xf54a('0x27')]);_0xcd25c3[_0xf54a('0x28')]=_[_0xf54a('0x29')](_0xcd25c3[_0xf54a('0x2a')],_0xcd25c3[_0xf54a('0x27')]);_0xdeb111['attributes']=_[_0xf54a('0x29')](_0xcd25c3['model'],qs[_0xf54a('0x2c')](_0xd199ec['query'][_0xf54a('0x2c')]));_0xdeb111[_0xf54a('0x2b')]=_0xdeb111[_0xf54a('0x2b')][_0xf54a('0x2d')]?_0xdeb111[_0xf54a('0x2b')]:_0xcd25c3['model'];if(_0xd199ec[_0xf54a('0x27')][_0xf54a('0x38')]){_0xdeb111[_0xf54a('0x39')]=[{'all':!![]}];}_0xdeb111=_[_0xf54a('0x3d')]({},_0xdeb111,_0xd199ec['options']);return db[_0xf54a('0x24')]['find'](_0xdeb111)[_0xf54a('0x1d')](handleEntityNotFound(_0x4e4215,null))[_0xf54a('0x1d')](respondWithResult(_0x4e4215,null))[_0xf54a('0x3e')](handleError(_0x4e4215,null));};exports[_0xf54a('0x3f')]=function(_0x41a163,_0x412b25){return db[_0xf54a('0x24')][_0xf54a('0x3f')](_0x41a163[_0xf54a('0x40')],{})[_0xf54a('0x1d')](respondWithResult(_0x412b25,0xc9))['catch'](handleError(_0x412b25,null));};exports['update']=function(_0x433c36,_0xd987d5){if(_0x433c36[_0xf54a('0x40')]['id']){delete _0x433c36[_0xf54a('0x40')]['id'];}return db[_0xf54a('0x24')][_0xf54a('0x41')]({'where':{'id':_0x433c36['params']['id']}})[_0xf54a('0x1d')](handleEntityNotFound(_0xd987d5,null))[_0xf54a('0x1d')](saveUpdates(_0x433c36[_0xf54a('0x40')],null))[_0xf54a('0x1d')](respondWithResult(_0xd987d5,null))[_0xf54a('0x3e')](handleError(_0xd987d5,null));};exports['destroy']=function(_0x528d73,_0x339922){return db['OpenchannelApplication'][_0xf54a('0x41')]({'where':{'id':_0x528d73[_0xf54a('0x42')]['id']}})['then'](handleEntityNotFound(_0x339922,null))[_0xf54a('0x1d')](removeEntity(_0x339922,null))[_0xf54a('0x3e')](handleError(_0x339922,null));}; \ No newline at end of file +var _0xceb9=['../../mysqldb','sendStatus','status','end','json','offset','limit','set','reject','update','then','destroy','error','stack','name','send','index','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','keys','OpenchannelApplication','create','body','find','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment'];(function(_0x2a9bdd,_0x8fd0c6){var _0x59788e=function(_0x13b968){while(--_0x13b968){_0x2a9bdd['push'](_0x2a9bdd['shift']());}};_0x59788e(++_0x8fd0c6);}(_0xceb9,0x1dd));var _0x9ceb=function(_0x53db70,_0x3f4a13){_0x53db70=_0x53db70-0x0;var _0x21b316=_0xceb9[_0x53db70];return _0x21b316;};'use strict';var pdf=require(_0x9ceb('0x0'));var emlformat=require(_0x9ceb('0x1'));var rimraf=require(_0x9ceb('0x2'));var zipdir=require(_0x9ceb('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ceb('0x4'));var moment=require(_0x9ceb('0x5'));var BPromise=require(_0x9ceb('0x6'));var Mustache=require('mustache');var util=require(_0x9ceb('0x7'));var path=require(_0x9ceb('0x8'));var sox=require('sox');var csv=require(_0x9ceb('0x9'));var ejs=require(_0x9ceb('0xa'));var fs=require('fs');var _=require(_0x9ceb('0xb'));var squel=require(_0x9ceb('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9ceb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9ceb('0xe'));var Redis=require(_0x9ceb('0xf'));var authService=require(_0x9ceb('0x10'));var qs=require(_0x9ceb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9ceb('0x12'));var utils=require('../../config/utils');var config=require(_0x9ceb('0x13'));var db=require(_0x9ceb('0x14'))['db'];function respondWithStatusCode(_0x1e3d1a,_0x373c97){_0x373c97=_0x373c97||0xcc;return function(_0x492614){if(_0x492614){return _0x1e3d1a[_0x9ceb('0x15')](_0x373c97);}return _0x1e3d1a[_0x9ceb('0x16')](_0x373c97)[_0x9ceb('0x17')]();};}function respondWithResult(_0x4b21bd,_0xf4dde8){_0xf4dde8=_0xf4dde8||0xc8;return function(_0x1f3a6b){if(_0x1f3a6b){return _0x4b21bd[_0x9ceb('0x16')](_0xf4dde8)[_0x9ceb('0x18')](_0x1f3a6b);}};}function respondWithFilteredResult(_0x1e4491,_0x35a3d8){return function(_0x258439){if(_0x258439){var _0xbfedb9=_0x258439['count'],_0x113ed7=_0x35a3d8[_0x9ceb('0x19')],_0x13e102=_0x35a3d8[_0x9ceb('0x19')]+_0x35a3d8[_0x9ceb('0x1a')],_0x9aa7d6;if(_0x13e102>=_0xbfedb9){_0x13e102=_0xbfedb9;_0x9aa7d6=0xc8;}else{_0x9aa7d6=0xce;}_0x1e4491[_0x9ceb('0x16')](_0x9aa7d6);return _0x1e4491[_0x9ceb('0x1b')]('Content-Range',_0x113ed7+'-'+_0x13e102+'/'+_0xbfedb9)[_0x9ceb('0x18')](_0x258439);}return null;};}function patchUpdates(_0x4ae0d9){return function(_0x31a4c1){try{jsonpatch['apply'](_0x31a4c1,_0x4ae0d9,!![]);}catch(_0x18cc9c){return BPromise[_0x9ceb('0x1c')](_0x18cc9c);}return _0x31a4c1['save']();};}function saveUpdates(_0x2d43a4,_0x1c8b51){return function(_0x4617dc){if(_0x4617dc){return _0x4617dc[_0x9ceb('0x1d')](_0x2d43a4)[_0x9ceb('0x1e')](function(_0xf966aa){return _0xf966aa;});}return null;};}function removeEntity(_0x58b4ef,_0xcfbe88){return function(_0x22930d){if(_0x22930d){return _0x22930d[_0x9ceb('0x1f')]()[_0x9ceb('0x1e')](function(){_0x58b4ef['status'](0xcc)[_0x9ceb('0x17')]();});}};}function handleEntityNotFound(_0xfae02f,_0x591d06){return function(_0x213fca){if(!_0x213fca){_0xfae02f[_0x9ceb('0x15')](0x194);}return _0x213fca;};}function handleError(_0x154234,_0x49c262){_0x49c262=_0x49c262||0x1f4;return function(_0xb7a953){logger[_0x9ceb('0x20')](_0xb7a953[_0x9ceb('0x21')]);if(_0xb7a953[_0x9ceb('0x22')]){delete _0xb7a953['name'];}_0x154234[_0x9ceb('0x16')](_0x49c262)[_0x9ceb('0x23')](_0xb7a953);};}exports[_0x9ceb('0x24')]=function(_0x2cb737,_0x5e6008){var _0x2f6d10={},_0x4d5c09={},_0x306629={'count':0x0,'rows':[]};var _0x4715f4=db['OpenchannelApplication']['rawAttributes'];_0x4d5c09['model']=_['keys'](_0x4715f4);_0x4d5c09[_0x9ceb('0x25')]=_['keys'](_0x2cb737[_0x9ceb('0x25')]);_0x4d5c09[_0x9ceb('0x26')]=_[_0x9ceb('0x27')](_0x4d5c09[_0x9ceb('0x28')],_0x4d5c09['query']);_0x2f6d10[_0x9ceb('0x29')]=_[_0x9ceb('0x27')](_0x4d5c09[_0x9ceb('0x28')],qs[_0x9ceb('0x2a')](_0x2cb737[_0x9ceb('0x25')][_0x9ceb('0x2a')]));_0x2f6d10[_0x9ceb('0x29')]=_0x2f6d10['attributes'][_0x9ceb('0x2b')]?_0x2f6d10[_0x9ceb('0x29')]:_0x4d5c09['model'];if(!_0x2cb737[_0x9ceb('0x25')][_0x9ceb('0x2c')](_0x9ceb('0x2d'))){_0x2f6d10['limit']=qs[_0x9ceb('0x1a')](_0x2cb737['query']['limit']);_0x2f6d10[_0x9ceb('0x19')]=qs[_0x9ceb('0x19')](_0x2cb737['query']['offset']);}_0x2f6d10[_0x9ceb('0x2e')]=qs[_0x9ceb('0x2f')](_0x2cb737[_0x9ceb('0x25')][_0x9ceb('0x2f')]);_0x2f6d10[_0x9ceb('0x30')]=qs[_0x9ceb('0x26')](_[_0x9ceb('0x31')](_0x2cb737[_0x9ceb('0x25')],_0x4d5c09[_0x9ceb('0x26')]));if(_0x2cb737['query'][_0x9ceb('0x32')]){_0x2f6d10[_0x9ceb('0x30')]=_[_0x9ceb('0x33')](_0x2f6d10['where'],{'$or':_[_0x9ceb('0x34')](_0x4715f4,function(_0x20fe54){if(_0x20fe54[_0x9ceb('0x35')][_0x9ceb('0x36')]!==_0x9ceb('0x37')){var _0x5138d9={};_0x5138d9[_0x20fe54[_0x9ceb('0x38')]]={'$like':'%'+_0x2cb737[_0x9ceb('0x25')][_0x9ceb('0x32')]+'%'};return _0x5138d9;}})});}_0x2f6d10=_['merge']({},_0x2f6d10,_0x2cb737[_0x9ceb('0x39')]);var _0x58527f={'where':_0x2f6d10[_0x9ceb('0x30')]};return db['OpenchannelApplication'][_0x9ceb('0x3a')](_0x58527f)['then'](function(_0x54e22c){_0x306629[_0x9ceb('0x3a')]=_0x54e22c;if(_0x2cb737[_0x9ceb('0x25')][_0x9ceb('0x3b')]){_0x2f6d10[_0x9ceb('0x3c')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x9ceb('0x3d')](_0x2f6d10);})[_0x9ceb('0x1e')](function(_0x4be0bc){_0x306629[_0x9ceb('0x3e')]=_0x4be0bc;return _0x306629;})['then'](respondWithFilteredResult(_0x5e6008,_0x2f6d10))[_0x9ceb('0x3f')](handleError(_0x5e6008,null));};exports[_0x9ceb('0x40')]=function(_0x95e449,_0x21690c){var _0x282cbb={'raw':!![],'where':{'id':_0x95e449[_0x9ceb('0x41')]['id']}},_0x393051={};_0x393051[_0x9ceb('0x28')]=_[_0x9ceb('0x42')](db[_0x9ceb('0x43')]['rawAttributes']);_0x393051[_0x9ceb('0x25')]=_[_0x9ceb('0x42')](_0x95e449[_0x9ceb('0x25')]);_0x393051[_0x9ceb('0x26')]=_[_0x9ceb('0x27')](_0x393051[_0x9ceb('0x28')],_0x393051['query']);_0x282cbb[_0x9ceb('0x29')]=_[_0x9ceb('0x27')](_0x393051[_0x9ceb('0x28')],qs['fields'](_0x95e449[_0x9ceb('0x25')]['fields']));_0x282cbb[_0x9ceb('0x29')]=_0x282cbb[_0x9ceb('0x29')]['length']?_0x282cbb[_0x9ceb('0x29')]:_0x393051[_0x9ceb('0x28')];if(_0x95e449[_0x9ceb('0x25')]['includeAll']){_0x282cbb[_0x9ceb('0x3c')]=[{'all':!![]}];}_0x282cbb=_[_0x9ceb('0x33')]({},_0x282cbb,_0x95e449['options']);return db[_0x9ceb('0x43')]['find'](_0x282cbb)[_0x9ceb('0x1e')](handleEntityNotFound(_0x21690c,null))[_0x9ceb('0x1e')](respondWithResult(_0x21690c,null))[_0x9ceb('0x3f')](handleError(_0x21690c,null));};exports[_0x9ceb('0x44')]=function(_0x1cda02,_0x4ca49f){return db['OpenchannelApplication']['create'](_0x1cda02[_0x9ceb('0x45')],{})['then'](respondWithResult(_0x4ca49f,0xc9))['catch'](handleError(_0x4ca49f,null));};exports[_0x9ceb('0x1d')]=function(_0x4dee48,_0x4cab49){if(_0x4dee48['body']['id']){delete _0x4dee48[_0x9ceb('0x45')]['id'];}return db[_0x9ceb('0x43')][_0x9ceb('0x46')]({'where':{'id':_0x4dee48[_0x9ceb('0x41')]['id']}})['then'](handleEntityNotFound(_0x4cab49,null))[_0x9ceb('0x1e')](saveUpdates(_0x4dee48[_0x9ceb('0x45')],null))['then'](respondWithResult(_0x4cab49,null))[_0x9ceb('0x3f')](handleError(_0x4cab49,null));};exports['destroy']=function(_0x92b253,_0x30aa1e){return db['OpenchannelApplication'][_0x9ceb('0x46')]({'where':{'id':_0x92b253[_0x9ceb('0x41')]['id']}})[_0x9ceb('0x1e')](handleEntityNotFound(_0x30aa1e,null))[_0x9ceb('0x1e')](removeEntity(_0x30aa1e,null))[_0x9ceb('0x3f')](handleError(_0x30aa1e,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index dc5d580..0dc8405 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 _0xc3fe=['define','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelApplication.attributes'];(function(_0x564587,_0x433d6d){var _0x20fd68=function(_0x243456){while(--_0x243456){_0x564587['push'](_0x564587['shift']());}};_0x20fd68(++_0x433d6d);}(_0xc3fe,0xff));var _0xec3f=function(_0x19879a,_0x212eea){_0x19879a=_0x19879a-0x0;var _0x13aa47=_0xc3fe[_0x19879a];return _0x13aa47;};'use strict';var _=require(_0xec3f('0x0'));var util=require(_0xec3f('0x1'));var logger=require(_0xec3f('0x2'))('api');var moment=require(_0xec3f('0x3'));var BPromise=require(_0xec3f('0x4'));var rp=require(_0xec3f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xec3f('0x6'));var config=require(_0xec3f('0x7'));var attributes=require(_0xec3f('0x8'));module['exports']=function(_0x4fb9aa,_0x2d5b29){return _0x4fb9aa[_0xec3f('0x9')]('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xec3f('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xbfcc=['util','../../config/logger','api','moment','rimraf','../../config/environment','exports','define','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x27aa57,_0x2fa496){var _0x2adf9d=function(_0x319225){while(--_0x319225){_0x27aa57['push'](_0x27aa57['shift']());}};_0x2adf9d(++_0x2fa496);}(_0xbfcc,0x9b));var _0xcbfc=function(_0x29d6e6,_0x264220){_0x29d6e6=_0x29d6e6-0x0;var _0xc75ff0=_0xbfcc[_0x29d6e6];return _0xc75ff0;};'use strict';var _=require(_0xcbfc('0x0'));var util=require(_0xcbfc('0x1'));var logger=require(_0xcbfc('0x2'))(_0xcbfc('0x3'));var moment=require(_0xcbfc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcbfc('0x5'));var config=require(_0xcbfc('0x6'));var attributes=require('./openchannelApplication.attributes');module[_0xcbfc('0x7')]=function(_0x13e7b8,_0x3fbe23){return _0x13e7b8[_0xcbfc('0x8')](_0xcbfc('0x9'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcbfc('0xa'),'collate':_0xcbfc('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 9471658..4b1819a 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 _0xdb79=['OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','OpenchannelApplication','update','options','raw','where','attributes','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','request','then','info'];(function(_0x2b27a0,_0x2ee33){var _0x44ec6b=function(_0x10351f){while(--_0x10351f){_0x2b27a0['push'](_0x2b27a0['shift']());}};_0x44ec6b(++_0x2ee33);}(_0xdb79,0x1e4));var _0x9db7=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xdb79[_0xaa0309];return _0x5de7ce;};'use strict';var _=require(_0x9db7('0x0'));var util=require(_0x9db7('0x1'));var moment=require(_0x9db7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9db7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9db7('0x4'));var logger=require('../../config/logger')(_0x9db7('0x5'));var config=require(_0x9db7('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43912d,_0x11987f,_0x330ad5){return new BPromise(function(_0x596e0a,_0x2f180c){return client[_0x9db7('0x7')](_0x43912d,_0x330ad5)[_0x9db7('0x8')](function(_0x31d8ab){logger[_0x9db7('0x9')](_0x9db7('0xa'),_0x11987f,'request\x20sent');logger[_0x9db7('0xb')](_0x9db7('0xc'),_0x11987f,_0x9db7('0xd'),JSON[_0x9db7('0xe')](_0x31d8ab));if(_0x31d8ab[_0x9db7('0xf')]){if(_0x31d8ab[_0x9db7('0xf')][_0x9db7('0x10')]===0x1f4){logger['error'](_0x9db7('0xa'),_0x11987f,_0x31d8ab[_0x9db7('0xf')]['message']);return _0x2f180c(_0x31d8ab[_0x9db7('0xf')][_0x9db7('0x11')]);}logger[_0x9db7('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x11987f,_0x31d8ab[_0x9db7('0xf')][_0x9db7('0x11')]);return _0x596e0a(_0x31d8ab[_0x9db7('0xf')][_0x9db7('0x11')]);}else{logger[_0x9db7('0x9')]('OpenchannelApplication,\x20%s,\x20%s',_0x11987f,_0x9db7('0xd'));_0x596e0a(_0x31d8ab[_0x9db7('0x12')]['message']);}})[_0x9db7('0x13')](function(_0x5b6433){logger[_0x9db7('0xf')](_0x9db7('0xa'),_0x11987f,_0x5b6433);_0x2f180c(_0x5b6433);});});}exports['UpdateOpenchannelApplication']=function(_0x244929){var _0x2ebcf7=this;return new Promise(function(_0x5b8b0d,_0x3c52f8){return db[_0x9db7('0x14')][_0x9db7('0x15')](_0x244929['body'],{'raw':_0x244929[_0x9db7('0x16')]?_0x244929[_0x9db7('0x16')][_0x9db7('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x244929[_0x9db7('0x16')]?_0x244929['options'][_0x9db7('0x18')]||null:null,'attributes':_0x244929[_0x9db7('0x16')]?_0x244929['options'][_0x9db7('0x19')]||null:null,'limit':_0x244929[_0x9db7('0x16')]?_0x244929['options']['limit']||null:null})[_0x9db7('0x8')](function(_0x43b066){logger[_0x9db7('0x9')]('UpdateOpenchannelApplication',_0x244929);logger['debug']('UpdateOpenchannelApplication',_0x244929,JSON[_0x9db7('0xe')](_0x43b066));_0x5b8b0d(_0x43b066);})[_0x9db7('0x13')](function(_0x4dd1e3){logger[_0x9db7('0xf')]('UpdateOpenchannelApplication',_0x4dd1e3[_0x9db7('0x11')],_0x244929);_0x3c52f8(_0x2ebcf7['error'](0x1f4,_0x4dd1e3[_0x9db7('0x11')]));});});}; \ No newline at end of file +var _0x3595=['ioredis','rpc','jayson/promise','http','request','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','update','body','options','where','attributes','limit','then','UpdateOpenchannelApplication','debug','catch','lodash','moment','bluebird','randomstring'];(function(_0x2e8a7a,_0xd07e9){var _0x1c4b71=function(_0x28762e){while(--_0x28762e){_0x2e8a7a['push'](_0x2e8a7a['shift']());}};_0x1c4b71(++_0xd07e9);}(_0x3595,0x168));var _0x5359=function(_0x2e8b9a,_0x2829cb){_0x2e8b9a=_0x2e8b9a-0x0;var _0x3d008a=_0x3595[_0x2e8b9a];return _0x3d008a;};'use strict';var _=require(_0x5359('0x0'));var util=require('util');var moment=require(_0x5359('0x1'));var BPromise=require(_0x5359('0x2'));var rs=require(_0x5359('0x3'));var fs=require('fs');var Redis=require(_0x5359('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5359('0x5'));var config=require('../../config/environment');var jayson=require(_0x5359('0x6'));var client=jayson['client'][_0x5359('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x370edd,_0x2ed6dd,_0x39be09){return new BPromise(function(_0x93ded6,_0x494b88){return client[_0x5359('0x8')](_0x370edd,_0x39be09)['then'](function(_0x477b6e){logger['info'](_0x5359('0x9'),_0x2ed6dd,'request\x20sent');logger['debug'](_0x5359('0xa'),_0x2ed6dd,'request\x20sent',JSON[_0x5359('0xb')](_0x477b6e));if(_0x477b6e[_0x5359('0xc')]){if(_0x477b6e[_0x5359('0xc')][_0x5359('0xd')]===0x1f4){logger[_0x5359('0xc')](_0x5359('0x9'),_0x2ed6dd,_0x477b6e[_0x5359('0xc')]['message']);return _0x494b88(_0x477b6e['error'][_0x5359('0xe')]);}logger['error'](_0x5359('0x9'),_0x2ed6dd,_0x477b6e[_0x5359('0xc')][_0x5359('0xe')]);return _0x93ded6(_0x477b6e[_0x5359('0xc')]['message']);}else{logger[_0x5359('0xf')](_0x5359('0x9'),_0x2ed6dd,_0x5359('0x10'));_0x93ded6(_0x477b6e[_0x5359('0x11')]['message']);}})['catch'](function(_0xe89c){logger[_0x5359('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x2ed6dd,_0xe89c);_0x494b88(_0xe89c);});});}exports['UpdateOpenchannelApplication']=function(_0x3ad1cc){var _0x90d19f=this;return new Promise(function(_0x43ea53,_0x3c83e5){return db['OpenchannelApplication'][_0x5359('0x12')](_0x3ad1cc[_0x5359('0x13')],{'raw':_0x3ad1cc['options']?_0x3ad1cc[_0x5359('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ad1cc[_0x5359('0x14')]?_0x3ad1cc['options'][_0x5359('0x15')]||null:null,'attributes':_0x3ad1cc[_0x5359('0x14')]?_0x3ad1cc['options'][_0x5359('0x16')]||null:null,'limit':_0x3ad1cc[_0x5359('0x14')]?_0x3ad1cc[_0x5359('0x14')][_0x5359('0x17')]||null:null})[_0x5359('0x18')](function(_0x1748fc){logger['info'](_0x5359('0x19'),_0x3ad1cc);logger[_0x5359('0x1a')]('UpdateOpenchannelApplication',_0x3ad1cc,JSON['stringify'](_0x1748fc));_0x43ea53(_0x1748fc);})[_0x5359('0x1b')](function(_0x479dc6){logger[_0x5359('0xc')](_0x5359('0x19'),_0x479dc6[_0x5359('0xe')],_0x3ad1cc);_0x3c83e5(_0x90d19f[_0x5359('0xc')](0x1f4,_0x479dc6[_0x5359('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 6132c91..28b429e 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 _0xb2aa=['getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','openchannel','put','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','Router','../../components/auth/service','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages'];(function(_0x3acca5,_0x5ad60b){var _0x203cd3=function(_0x1f945d){while(--_0x1f945d){_0x3acca5['push'](_0x3acca5['shift']());}};_0x203cd3(++_0x5ad60b);}(_0xb2aa,0x1c2));var _0xab2a=function(_0x123f48,_0x5dc777){_0x123f48=_0x123f48-0x0;var _0x325599=_0xb2aa[_0x123f48];return _0x325599;};'use strict';var multer=require(_0xab2a('0x0'));var util=require(_0xab2a('0x1'));var path=require('path');var timeout=require(_0xab2a('0x2'));var express=require('express');var router=express[_0xab2a('0x3')]();var auth=require(_0xab2a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xab2a('0x5'));router[_0xab2a('0x6')]('/',auth[_0xab2a('0x7')](),controller[_0xab2a('0x8')]);router[_0xab2a('0x6')](_0xab2a('0x9'),auth[_0xab2a('0x7')](),controller[_0xab2a('0xa')]);router['get'](_0xab2a('0xb'),auth[_0xab2a('0x7')](),controller[_0xab2a('0xc')]);router['get'](_0xab2a('0xd'),auth[_0xab2a('0x7')](),controller[_0xab2a('0xe')]);router[_0xab2a('0x6')](_0xab2a('0xf'),auth[_0xab2a('0x7')](),controller['download']);router[_0xab2a('0x10')]('/',auth[_0xab2a('0x7')](),controller[_0xab2a('0x11')]);router['post'](_0xab2a('0xd'),auth[_0xab2a('0x7')](),controller[_0xab2a('0x12')]);router['post'](_0xab2a('0x13'),auth['isAuthenticated'](),interaction[_0xab2a('0x14')](_0xab2a('0x15'),'openchannelinteraction:addtags'),controller['addTags']);router[_0xab2a('0x16')]('/:id',auth[_0xab2a('0x7')](),interaction[_0xab2a('0x14')](_0xab2a('0x15'),_0xab2a('0x17')),controller['update']);router[_0xab2a('0x18')](_0xab2a('0xb'),auth[_0xab2a('0x7')](),interaction[_0xab2a('0x14')](_0xab2a('0x15'),_0xab2a('0x19')),controller[_0xab2a('0x1a')]);router[_0xab2a('0x18')](_0xab2a('0x13'),auth['isAuthenticated'](),controller[_0xab2a('0x1b')]);module[_0xab2a('0x1c')]=router; \ No newline at end of file +var _0x1159=['/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x28fbe3,_0x4ac6f8){var _0x45db6a=function(_0x296ecb){while(--_0x296ecb){_0x28fbe3['push'](_0x28fbe3['shift']());}};_0x45db6a(++_0x4ac6f8);}(_0x1159,0x9a));var _0x9115=function(_0x1b6804,_0x5a9222){_0x1b6804=_0x1b6804-0x0;var _0x2bca06=_0x1159[_0x1b6804];return _0x2bca06;};'use strict';var multer=require(_0x9115('0x0'));var util=require(_0x9115('0x1'));var path=require('path');var timeout=require(_0x9115('0x2'));var express=require(_0x9115('0x3'));var router=express[_0x9115('0x4')]();var auth=require(_0x9115('0x5'));var interaction=require(_0x9115('0x6'));var config=require(_0x9115('0x7'));var controller=require('./openchannelInteraction.controller');router[_0x9115('0x8')]('/',auth[_0x9115('0x9')](),controller[_0x9115('0xa')]);router[_0x9115('0x8')](_0x9115('0xb'),auth[_0x9115('0x9')](),controller[_0x9115('0xc')]);router[_0x9115('0x8')](_0x9115('0xd'),auth[_0x9115('0x9')](),controller[_0x9115('0xe')]);router[_0x9115('0x8')](_0x9115('0xf'),auth[_0x9115('0x9')](),controller[_0x9115('0x10')]);router['get'](_0x9115('0x11'),auth[_0x9115('0x9')](),controller[_0x9115('0x12')]);router[_0x9115('0x13')]('/',auth['isAuthenticated'](),controller[_0x9115('0x14')]);router['post']('/:id/messages',auth[_0x9115('0x9')](),controller['addMessage']);router[_0x9115('0x13')](_0x9115('0x15'),auth['isAuthenticated'](),interaction[_0x9115('0x16')](_0x9115('0x17'),_0x9115('0x18')),controller[_0x9115('0x19')]);router[_0x9115('0x1a')]('/:id',auth['isAuthenticated'](),interaction[_0x9115('0x16')](_0x9115('0x17'),_0x9115('0x1b')),controller[_0x9115('0x1c')]);router[_0x9115('0x1d')]('/:id',auth[_0x9115('0x9')](),interaction[_0x9115('0x16')](_0x9115('0x17'),_0x9115('0x1e')),controller[_0x9115('0x1f')]);router['delete'](_0x9115('0x15'),auth['isAuthenticated'](),controller['removeTags']);module[_0x9115('0x20')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 8359497..827d606 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 _0x5a2a=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x3124e9,_0x49d9e8){var _0x2ecc0e=function(_0x17e9ac){while(--_0x17e9ac){_0x3124e9['push'](_0x3124e9['shift']());}};_0x2ecc0e(++_0x49d9e8);}(_0x5a2a,0x1c3));var _0xa5a2=function(_0x335112,_0x586929){_0x335112=_0x335112-0x0;var _0x428f8b=_0x5a2a[_0x335112];return _0x428f8b;};'use strict';var Sequelize=require(_0xa5a2('0x0'));module[_0xa5a2('0x1')]={'closed':{'type':Sequelize[_0xa5a2('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa5a2('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xa5a2('0x4')]},'externalUrl':{'type':Sequelize[_0xa5a2('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xa5a2('0x5')]('in',_0xa5a2('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xa5a2('0x4')]}}; \ No newline at end of file +var _0xb19f=['sequelize','exports','STRING','DATE','ENUM'];(function(_0x54e631,_0x3b8396){var _0x3c6b6a=function(_0x48cea6){while(--_0x48cea6){_0x54e631['push'](_0x54e631['shift']());}};_0x3c6b6a(++_0x3b8396);}(_0xb19f,0x7d));var _0xfb19=function(_0x229f58,_0x2fc35a){_0x229f58=_0x229f58-0x0;var _0xb7e54a=_0xb19f[_0x229f58];return _0xb7e54a;};'use strict';var Sequelize=require(_0xfb19('0x0'));module[_0xfb19('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xfb19('0x2')]},'note':{'type':Sequelize[_0xfb19('0x2')]},'read1stAt':{'type':Sequelize[_0xfb19('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xfb19('0x2')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xfb19('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xfb19('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 271e417..9384fea 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 _0x4a67=['a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','createdAt','value','dateStart','startOf','day','utc','format','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','unreadMessages','length','tableAlias','\x20=\x20?','and','ContactId','c.firstName','\x20LIKE\x20?','c.email','\x20>\x20?','\x20<\x20?','\x20IN\x20?','c.lastName','isNil','isEmpty','i.OpenchannelAccountId\x20IN\x20?','concat','$gte','parse','$lte','\x20IS\x20NULL','replace','isNumeric','i.id\x20LIKE\x20?','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','COUNT(me.id)','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','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','sequelize','keyBy','merge','a.key','Account.key','Contact.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','include','catch','create','update','body','find','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','nolimit','filter','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','setTags','spread','Tag','openchannelInteractionTags:save','removeTags','server','root','attachments','transcript-%d-%s.zip','Messages','direction','User','CmContact','firstName','lastName','Attachment','OpenchannelAccount','Account','Owner','fullname','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','Openchannel','YYYY-MM-DD','mkdirSync','N.A.','closed','closedAt','Public','Private','basename','pipe','createWriteStream','out','System','Contact','secret','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','download','log','unlinkSync','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','error','stack','name','map','Tags','TagIds','split','forEach','push','index','OpenchannelInteraction','rawAttributes','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','field','color','from','tools_tags','select','COUNT(*)','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','u.id','ui.OpenchannelInteractionId','openchannel_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4a67,0x172));var _0x74a6=function(_0x23b318,_0x4bf826){_0x23b318=_0x23b318-0x0;var _0x1abe07=_0x4a67[_0x23b318];return _0x1abe07;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x74a6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x74a6('0x1'));var rp=require(_0x74a6('0x2'));var moment=require(_0x74a6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x74a6('0x4'));var util=require(_0x74a6('0x5'));var path=require(_0x74a6('0x6'));var sox=require(_0x74a6('0x7'));var csv=require('to-csv');var ejs=require(_0x74a6('0x8'));var fs=require('fs');var _=require(_0x74a6('0x9'));var squel=require('squel');var crypto=require(_0x74a6('0xa'));var jsforce=require(_0x74a6('0xb'));var deskjs=require(_0x74a6('0xc'));var toCsv=require(_0x74a6('0xd'));var querystring=require(_0x74a6('0xe'));var Papa=require(_0x74a6('0xf'));var Redis=require(_0x74a6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x74a6('0x11'));var hardwareService=require(_0x74a6('0x12'));var logger=require(_0x74a6('0x13'))('api');var utils=require(_0x74a6('0x14'));var config=require('../../config/environment');var db=require(_0x74a6('0x15'))['db'];config[_0x74a6('0x16')]=_[_0x74a6('0x17')](config[_0x74a6('0x16')],{'host':_0x74a6('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x74a6('0x16')]));require(_0x74a6('0x19'))[_0x74a6('0x1a')](socket);function respondWithStatusCode(_0x26d8a7,_0x49b410){_0x49b410=_0x49b410||0xcc;return function(_0x129215){if(_0x129215){return _0x26d8a7[_0x74a6('0x1b')](_0x49b410);}return _0x26d8a7[_0x74a6('0x1c')](_0x49b410)[_0x74a6('0x1d')]();};}function respondWithResult(_0x7c77b9,_0x45407c){_0x45407c=_0x45407c||0xc8;return function(_0x36eece){if(_0x36eece){return _0x7c77b9['status'](_0x45407c)[_0x74a6('0x1e')](_0x36eece);}};}function respondWithFilteredResult(_0x1bfd59,_0x4f8d77){return function(_0x5c6f1c){if(_0x5c6f1c){var _0x55f568=_0x5c6f1c[_0x74a6('0x1f')],_0x2ee2f3=_0x4f8d77[_0x74a6('0x20')],_0x211886=_0x4f8d77['offset']+_0x4f8d77[_0x74a6('0x21')],_0x25e5ad;if(_0x211886>=_0x55f568){_0x211886=_0x55f568;_0x25e5ad=0xc8;}else{_0x25e5ad=0xce;}_0x1bfd59[_0x74a6('0x1c')](_0x25e5ad);return _0x1bfd59['set'](_0x74a6('0x22'),_0x2ee2f3+'-'+_0x211886+'/'+_0x55f568)[_0x74a6('0x1e')](_0x5c6f1c);}return null;};}function patchUpdates(_0x2f540d){return function(_0x375a7b){try{jsonpatch[_0x74a6('0x23')](_0x375a7b,_0x2f540d,!![]);}catch(_0xf4c590){return BPromise[_0x74a6('0x24')](_0xf4c590);}return _0x375a7b[_0x74a6('0x25')]();};}function saveUpdates(_0x5de6fc,_0x52a38b){return function(_0x216b79){if(_0x216b79){return _0x216b79['update'](_0x5de6fc)[_0x74a6('0x26')](function(_0x43c515){return _0x43c515;});}return null;};}function removeEntity(_0x4a10b6,_0x5c8634){return function(_0x3ac762){if(_0x3ac762){return _0x3ac762[_0x74a6('0x27')]()[_0x74a6('0x26')](function(){_0x4a10b6['status'](0xcc)[_0x74a6('0x1d')]();});}};}function handleEntityNotFound(_0x51fbb7,_0x4e35d4){return function(_0x21513f){if(!_0x21513f){_0x51fbb7[_0x74a6('0x1b')](0x194);}return _0x21513f;};}function handleError(_0x1b59ab,_0x181817){_0x181817=_0x181817||0x1f4;return function(_0x2169d8){logger[_0x74a6('0x28')](_0x2169d8[_0x74a6('0x29')]);if(_0x2169d8['name']){delete _0x2169d8[_0x74a6('0x2a')];}_0x1b59ab['status'](_0x181817)['send'](_0x2169d8);};}function getInteractionUsers(_0x5e446d,_0x542aba){return new BPromise(function(_0x20ca1a,_0x178a2d){try{if(_0x542aba[_0x5e446d['id']]){_0x5e446d['Users']=_[_0x74a6('0x2b')](_0x542aba[_0x5e446d['id']],function(_0x175662){return{'id':_0x175662['id']};});}}catch(_0xd533f0){_0x178a2d(_0xd533f0);}_0x20ca1a(_0x5e446d);});}function getInteractionTags(_0x5d8e60,_0x50079a){return new BPromise(function(_0x3bcbdc,_0x5c46fb){try{if(_0x5d8e60['TagIds']){_0x5d8e60[_0x74a6('0x2c')]=[];_0x5d8e60[_0x74a6('0x2d')][_0x74a6('0x2e')](',')[_0x74a6('0x2f')](function(_0x2e7b6e){_0x5d8e60['Tags'][_0x74a6('0x30')](_0x50079a[_0x2e7b6e]);});}delete _0x5d8e60['TagIds'];}catch(_0xcb7f9d){_0x5c46fb(_0xcb7f9d);}_0x3bcbdc(_0x5d8e60);});}function updateOpenchannelInteraction(_0x38c61e,_0x76c2ea,_0xdf11b9){return new BPromise(function(_0x17ea78,_0x1294af){return getInteractionUsers(_0x38c61e,_0xdf11b9)['then'](function(_0x12baa2){return getInteractionTags(_0x12baa2,_0x76c2ea);})[_0x74a6('0x26')](function(_0x3718e3){_0x17ea78(_0x3718e3);})['catch'](function(_0x1f6075){_0x1294af(_0x1f6075);});});}exports[_0x74a6('0x31')]=function(_0x30a9eb,_0x224e34){var _0x20966={},_0x692b8d={},_0x2058f3={'count':0x0,'rows':[]};var _0x1b061a=db[_0x74a6('0x32')][_0x74a6('0x33')];_0x692b8d['model']=_[_0x74a6('0x34')](_0x1b061a);_0x692b8d[_0x74a6('0x35')]=_[_0x74a6('0x34')](_0x30a9eb[_0x74a6('0x35')]);_0x692b8d[_0x74a6('0x36')]=_[_0x74a6('0x37')](_0x692b8d[_0x74a6('0x38')],_0x692b8d['query']);_0x20966[_0x74a6('0x39')]=_[_0x74a6('0x37')](_0x692b8d[_0x74a6('0x38')],qs['fields'](_0x30a9eb[_0x74a6('0x35')][_0x74a6('0x3a')]));_0x20966[_0x74a6('0x39')]=_0x20966['attributes']['length']?_0x20966['attributes']:_0x692b8d[_0x74a6('0x38')];if(!_0x30a9eb[_0x74a6('0x35')][_0x74a6('0x3b')]('nolimit')){_0x20966[_0x74a6('0x21')]=qs[_0x74a6('0x21')](_0x30a9eb['query'][_0x74a6('0x21')]);_0x20966[_0x74a6('0x20')]=qs[_0x74a6('0x20')](_0x30a9eb['query']['offset']);}_0x20966[_0x74a6('0x3c')]=qs['sort'](_0x30a9eb[_0x74a6('0x35')][_0x74a6('0x3d')]);_0x20966[_0x74a6('0x3e')]=qs[_0x74a6('0x36')](_[_0x74a6('0x3f')](_0x30a9eb[_0x74a6('0x35')],_0x692b8d[_0x74a6('0x36')]));var _0x92ba21=[];var _0x2e64d4=squel['select']()[_0x74a6('0x40')]('id')[_0x74a6('0x40')](_0x74a6('0x2a'))[_0x74a6('0x40')](_0x74a6('0x41'))[_0x74a6('0x42')](_0x74a6('0x43'));var _0x1f0f48=squel[_0x74a6('0x44')]()[_0x74a6('0x40')](_0x74a6('0x45'))[_0x74a6('0x42')](_0x74a6('0x46'),'me')[_0x74a6('0x3e')](_0x74a6('0x47'))[_0x74a6('0x3e')](_0x74a6('0x48'))['where']('me.read\x20=\x20false');var _0x1006e4=squel[_0x74a6('0x44')]()[_0x74a6('0x40')](_0x74a6('0x49'))[_0x74a6('0x40')](_0x74a6('0x4a'))[_0x74a6('0x42')]('user_has_openchannel_interactions','ui')['left_join']('users','u','u.id\x20=\x20ui.UserId');var _0x58e1dd=squel[_0x74a6('0x44')]()[_0x74a6('0x42')](_0x74a6('0x4b'),'i')[_0x74a6('0x4c')](_0x74a6('0x4d'),'c',_0x74a6('0x4e'))['left_join']('users','o',_0x74a6('0x4f'))[_0x74a6('0x4c')]('openchannel_accounts','a',_0x74a6('0x50'))[_0x74a6('0x4c')](_0x74a6('0x46'),'me',_0x74a6('0x51'));var _0x333ca0=squel[_0x74a6('0x52')]();if(_0x30a9eb[_0x74a6('0x35')][_0x74a6('0x53')]){var _0x42c46f=JSON['parse'](_0x30a9eb[_0x74a6('0x35')][_0x74a6('0x53')]);_[_0x74a6('0x34')](_0x42c46f)[_0x74a6('0x2f')](function(_0x453f18){var _0x2ae681=_0x42c46f[_0x453f18];if(_0x453f18===_0x74a6('0x54')){var _0x24e7b0=moment(_0x2ae681[_0x74a6('0x55')][_0x74a6('0x56')])[_0x74a6('0x57')](_0x74a6('0x58'))[_0x74a6('0x59')]()[_0x74a6('0x5a')]();var _0x56163f=moment(_0x56163f)[_0x74a6('0x59')]()['endOf'](_0x74a6('0x58'))[_0x74a6('0x5a')]();_0x333ca0['and'](_0x74a6('0x5b'),_0x24e7b0,_0x56163f);}else{if(_[_0x74a6('0x5c')](_0x2ae681[_0x74a6('0x5d')])){_0x2ae681['condition']['forEach'](function(_0x1f889a){switch(_0x2ae681[_0x74a6('0x5d')][_0x74a6('0x55')]){case'IS':if(_0x453f18!==_0x74a6('0x5e')&&_0x453f18!==_0x74a6('0x5f')){if(_[_0x74a6('0x5c')](_0x2ae681[_0x74a6('0x55')])&&_0x2ae681[_0x74a6('0x55')][_0x74a6('0x60')]>0x1){_0x333ca0['and'](_0x2ae681['tableAlias']+'.'+_0x453f18+'\x20IN\x20?',_0x2ae681['value']);}else{_0x333ca0['and'](_0x2ae681[_0x74a6('0x61')]+'.'+_0x453f18+_0x74a6('0x62'),_0x2ae681[_0x74a6('0x55')][0x0]);}}break;case'=':_0x333ca0[_0x74a6('0x63')](_0x2ae681['tableAlias']+'.'+_0x453f18+_0x74a6('0x62'),_0x2ae681[_0x74a6('0x55')]);break;case'LIKE':if(_0x453f18===_0x74a6('0x64')){_0x333ca0[_0x74a6('0x63')](_0x74a6('0x65')+_0x74a6('0x66'),'%'+_0x2ae681[_0x74a6('0x55')]+'%');_0x333ca0['or']('c.lastName'+_0x74a6('0x66'),'%'+_0x2ae681['value']+'%');_0x333ca0['or'](_0x74a6('0x67')+_0x74a6('0x66'),'%'+_0x2ae681[_0x74a6('0x55')]+'%');}else{_0x333ca0[_0x74a6('0x63')](_0x2ae681[_0x74a6('0x61')]+'.'+_0x453f18+'\x20LIKE\x20?','%'+_0x2ae681[_0x74a6('0x55')]+'%');}break;case'>':_0x333ca0[_0x74a6('0x63')](_0x2ae681[_0x74a6('0x61')]+'.'+_0x453f18+_0x74a6('0x68'),_0x2ae681['value']);break;case'<':_0x333ca0[_0x74a6('0x63')](_0x2ae681['tableAlias']+'.'+_0x453f18+_0x74a6('0x69'),_0x2ae681[_0x74a6('0x55')]);break;}});}else{switch(_0x2ae681['condition'][_0x74a6('0x55')]){case'IS':if(_0x453f18!==_0x74a6('0x5e')&&_0x453f18!==_0x74a6('0x5f')){if(_[_0x74a6('0x5c')](_0x2ae681[_0x74a6('0x55')])&&_0x2ae681['value']['length']>0x1){_0x333ca0[_0x74a6('0x63')](_0x2ae681[_0x74a6('0x61')]+'.'+_0x453f18+_0x74a6('0x6a'),_0x2ae681[_0x74a6('0x55')]);}else{_0x333ca0['and'](_0x2ae681[_0x74a6('0x61')]+'.'+_0x453f18+_0x74a6('0x62'),_0x2ae681[_0x74a6('0x55')][0x0]);}}break;case'=':_0x333ca0['and'](_0x2ae681[_0x74a6('0x61')]+'.'+_0x453f18+_0x74a6('0x62'),_0x2ae681[_0x74a6('0x55')]);break;case'LIKE':if(_0x453f18===_0x74a6('0x64')){_0x333ca0['and']('c.firstName'+_0x74a6('0x66'),'%'+_0x2ae681[_0x74a6('0x55')]+'%');_0x333ca0['or'](_0x74a6('0x6b')+_0x74a6('0x66'),'%'+_0x2ae681[_0x74a6('0x55')]+'%');_0x333ca0['or'](_0x74a6('0x67')+_0x74a6('0x66'),'%'+_0x2ae681[_0x74a6('0x55')]+'%');}else{_0x333ca0[_0x74a6('0x63')](_0x2ae681[_0x74a6('0x61')]+'.'+_0x453f18+_0x74a6('0x66'),'%'+_0x2ae681[_0x74a6('0x55')]+'%');}break;case'>':_0x333ca0['and'](_0x2ae681[_0x74a6('0x61')]+'.'+_0x453f18+_0x74a6('0x68'),_0x2ae681['value']);break;case'<':_0x333ca0[_0x74a6('0x63')](_0x2ae681[_0x74a6('0x61')]+'.'+_0x453f18+'\x20<\x20?',_0x2ae681[_0x74a6('0x55')]);break;}}}});}else{var _0x3f32ed=_(Object[_0x74a6('0x34')](_0x30a9eb[_0x74a6('0x35')]))[_0x74a6('0x2b')](function(_0xd37857){return _0x1b061a[_0x74a6('0x3b')](_0xd37857)?_0xd37857:undefined;})['filter'](function(_0x33eb72){return!_[_0x74a6('0x6c')](_0x33eb72);})[_0x74a6('0x55')]();if(!_[_0x74a6('0x6d')](_0x3f32ed)){_0x3f32ed['forEach'](function(_0x292431){if(_0x292431==='OpenchannelAccountId'){_0x58e1dd[_0x74a6('0x3e')](_0x74a6('0x6e'),[][_0x74a6('0x6f')](_0x30a9eb[_0x74a6('0x35')][_0x292431]));}else if(_0x292431===_0x74a6('0x54')){var _0x1fb991=JSON['parse'](_0x30a9eb[_0x74a6('0x35')][_0x292431])[_0x74a6('0x70')];var _0xf9a988=JSON[_0x74a6('0x71')](_0x30a9eb[_0x74a6('0x35')][_0x292431])[_0x74a6('0x72')];_0x58e1dd[_0x74a6('0x3e')](_0x74a6('0x5b'),_0x1fb991,_0xf9a988);}else{if(_0x30a9eb[_0x74a6('0x35')][_0x292431]==='null'){_0x58e1dd[_0x74a6('0x3e')]('i.'+_0x292431+_0x74a6('0x73'));}else{_0x58e1dd['where']('i.'+_0x292431+_0x74a6('0x62'),_0x30a9eb[_0x74a6('0x35')][_0x292431]);}}});}if(_0x30a9eb['query']['filter']){var _0x2f89fe=_0x30a9eb[_0x74a6('0x35')]['filter'][_0x74a6('0x74')]('\x5c','\x5c\x5c')[_0x74a6('0x74')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x74a6('0x75')](_0x2f89fe)){_0x333ca0['or'](_0x74a6('0x76'),_0x2f89fe+'%');}else{var _0x306d6c=[];_0x2f89fe[_0x74a6('0x2e')]('\x20')[_0x74a6('0x2f')](function(_0xeeab64){_0x306d6c[_0x74a6('0x30')]('+'+_0xeeab64[_0x74a6('0x77')]());});var _0x2c5ce8=_0x306d6c[_0x74a6('0x78')]('\x20');_0x333ca0['or'](_0x74a6('0x79'),_0x2c5ce8)['or'](_0x74a6('0x7a'),_0x2f89fe+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2f89fe+'%');}}}_0x58e1dd[_0x74a6('0x3e')](_0x333ca0);if(_0x20966['order']){_0x20966[_0x74a6('0x3c')][_0x74a6('0x2f')](function(_0x3411ce){_0x58e1dd[_0x74a6('0x3c')]('i.'+_0x3411ce[0x0],_0x3411ce[0x1]==='DESC'?![]:!![]);});}_0x58e1dd['group'](_0x74a6('0x7b'));var _0x1aba94={'type':db[_0x74a6('0x7c')][_0x74a6('0x7d')][_0x74a6('0x7e')],'raw':!![]};var _0x1bf36d=_0x58e1dd[_0x74a6('0x7f')]()[_0x74a6('0x40')](_0x74a6('0x45'))['field'](_0x74a6('0x80'),_0x74a6('0x5f'));if(!_0x30a9eb[_0x74a6('0x35')][_0x74a6('0x53')]){if(_0x30a9eb[_0x74a6('0x35')]['read']){if(_0x30a9eb[_0x74a6('0x35')]['read']==0x1){_0x1bf36d[_0x74a6('0x81')](_0x74a6('0x82'));_0x58e1dd[_0x74a6('0x81')](_0x74a6('0x82'));}else{_0x1bf36d['having'](_0x74a6('0x83'));_0x58e1dd[_0x74a6('0x81')]('`unreadMessages`\x20>\x200');}}if(_0x30a9eb[_0x74a6('0x35')][_0x74a6('0x84')]){var _0x5cedf7=_[_0x74a6('0x5c')](_0x30a9eb[_0x74a6('0x35')][_0x74a6('0x84')])?_0x30a9eb[_0x74a6('0x35')][_0x74a6('0x84')]:new Array(_0x30a9eb['query'][_0x74a6('0x84')]);var _0xd5fff6=squel[_0x74a6('0x52')]();_0x5cedf7[_0x74a6('0x2f')](function(_0x360b77){_0xd5fff6['or'](_0x74a6('0x85'),'%,'+_0x360b77+',%');});_0x58e1dd['having'](_0xd5fff6);_0x1bf36d[_0x74a6('0x4c')](_0x74a6('0x86'),'it',_0x74a6('0x87'));_0x1bf36d['left_join'](_0x74a6('0x43'),'t',_0x74a6('0x88'));_0x1bf36d[_0x74a6('0x3e')](_0x74a6('0x89'),_0x5cedf7);}}else{var _0x42c46f=JSON[_0x74a6('0x71')](_0x30a9eb['query'][_0x74a6('0x53')]);_[_0x74a6('0x34')](_0x42c46f)[_0x74a6('0x2f')](function(_0x3fe226){var _0x27a821=_0x42c46f[_0x3fe226];if(_0x3fe226===_0x74a6('0x5e')){var _0x36c231=_0x27a821['value'];var _0x14bf53=squel[_0x74a6('0x52')]();_0x36c231[_0x74a6('0x2f')](function(_0x495a06){_0x14bf53['or'](_0x74a6('0x85'),'%,'+_0x495a06+',%');});_0x58e1dd['having'](_0x14bf53);_0x1bf36d['left_join'](_0x74a6('0x8a'),'it','it.MailInteractionId\x20=\x20i.id');_0x1bf36d[_0x74a6('0x4c')]('tools_tags','t',_0x74a6('0x88'));_0x1bf36d[_0x74a6('0x3e')]('t.id\x20IN\x20?',_0x36c231);}else if(_0x3fe226===_0x74a6('0x5f')){if(_0x27a821[_0x74a6('0x55')]['length']===0x1){if(_0x27a821[_0x74a6('0x55')][0x0]===0x1){_0x1bf36d[_0x74a6('0x81')](_0x74a6('0x82'));_0x58e1dd[_0x74a6('0x81')](_0x74a6('0x82'));}else{_0x1bf36d[_0x74a6('0x81')](_0x74a6('0x83'));_0x58e1dd[_0x74a6('0x81')](_0x74a6('0x83'));}}}});}db[_0x74a6('0x8b')][_0x74a6('0x35')](_0x1bf36d[_0x74a6('0x77')](),_0x1aba94)[_0x74a6('0x26')](function(_0xb7525){_0x2058f3[_0x74a6('0x1f')]=_0xb7525['length'];if(_0x2058f3[_0x74a6('0x1f')]===0x0)return[];return db[_0x74a6('0x8b')]['query'](_0x2e64d4[_0x74a6('0x77')](),_0x1aba94)[_0x74a6('0x26')](function(_0x5e3414){_0x92ba21=_[_0x74a6('0x8c')](_0x5e3414,'id');_0x1aba94=_[_0x74a6('0x8d')](_0x1aba94,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x58e1dd[_0x74a6('0x40')](_0x74a6('0x80'),'unreadMessages');_0x58e1dd[_0x74a6('0x40')](_0x74a6('0x8e'),_0x74a6('0x8f'));_0x58e1dd['field']('i.*');_0x58e1dd[_0x74a6('0x40')](_0x74a6('0x65'),'Contact.firstName');_0x58e1dd[_0x74a6('0x40')]('c.lastName',_0x74a6('0x90'));_0x58e1dd[_0x74a6('0x40')](_0x74a6('0x67'),_0x74a6('0x91'));_0x58e1dd[_0x74a6('0x40')](_0x74a6('0x92'),_0x74a6('0x93'));_0x58e1dd[_0x74a6('0x40')]('c.mobile',_0x74a6('0x94'));_0x58e1dd['field'](_0x74a6('0x95'),_0x74a6('0x96'));_0x58e1dd[_0x74a6('0x40')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x74a6('0x2d'));_0x58e1dd[_0x74a6('0x4c')](_0x74a6('0x86'),'it',_0x74a6('0x87'));_0x58e1dd[_0x74a6('0x4c')](_0x74a6('0x43'),'t',_0x74a6('0x88'));_0x58e1dd['limit'](_0x20966[_0x74a6('0x21')]);_0x58e1dd['offset'](_0x20966['offset']);return db[_0x74a6('0x8b')][_0x74a6('0x35')](_0x58e1dd[_0x74a6('0x77')](),_0x1aba94);})[_0x74a6('0x26')](function(_0x4e2a6c){_0x1006e4[_0x74a6('0x3e')](_0x74a6('0x97'),_[_0x74a6('0x2b')](_0x4e2a6c,'id'));return db[_0x74a6('0x8b')][_0x74a6('0x35')](_0x1006e4[_0x74a6('0x77')](),_0x1aba94)[_0x74a6('0x26')](function(_0x5f3b2b){var _0x61e298=_[_0x74a6('0x98')](_0x5f3b2b,_0x74a6('0x99'));var _0x45d13f=[];_0x4e2a6c[_0x74a6('0x2f')](function(_0x52c745){_0x45d13f['push'](updateOpenchannelInteraction(_0x52c745,_0x92ba21,_0x61e298));});return BPromise[_0x74a6('0x9a')](_0x45d13f);});});})[_0x74a6('0x26')](function(_0x23a125){_0x2058f3[_0x74a6('0x9b')]=_0x23a125;return _0x2058f3;})[_0x74a6('0x26')](respondWithFilteredResult(_0x224e34,_0x20966))['catch'](handleError(_0x224e34,null));};exports[_0x74a6('0x9c')]=function(_0xcabee5,_0x70f394){var _0xb0e61={'raw':![],'where':{'id':_0xcabee5[_0x74a6('0x9d')]['id']}},_0x120a37={};_0x120a37['model']=_[_0x74a6('0x34')](db['OpenchannelInteraction'][_0x74a6('0x33')]);_0x120a37[_0x74a6('0x35')]=_[_0x74a6('0x34')](_0xcabee5[_0x74a6('0x35')]);_0x120a37[_0x74a6('0x36')]=_[_0x74a6('0x37')](_0x120a37[_0x74a6('0x38')],_0x120a37[_0x74a6('0x35')]);_0xb0e61[_0x74a6('0x39')]=_['intersection'](_0x120a37['model'],qs[_0x74a6('0x3a')](_0xcabee5[_0x74a6('0x35')][_0x74a6('0x3a')]));_0xb0e61[_0x74a6('0x39')]=_0xb0e61[_0x74a6('0x39')]['length']?_0xb0e61[_0x74a6('0x39')]:_0x120a37[_0x74a6('0x38')];if(_0xcabee5[_0x74a6('0x35')]['includeAll']){_0xb0e61[_0x74a6('0x9e')]=[{'all':!![]}];}_0xb0e61=_[_0x74a6('0x8d')]({},_0xb0e61,_0xcabee5['options']);return db[_0x74a6('0x32')]['find'](_0xb0e61)['then'](handleEntityNotFound(_0x70f394,null))[_0x74a6('0x26')](respondWithResult(_0x70f394,null))[_0x74a6('0x9f')](handleError(_0x70f394,null));};exports[_0x74a6('0xa0')]=function(_0x5b46dd,_0x335f15){return db['OpenchannelInteraction'][_0x74a6('0xa0')](_0x5b46dd['body'],{})[_0x74a6('0x26')](respondWithResult(_0x335f15,0xc9))['catch'](handleError(_0x335f15,null));};exports[_0x74a6('0xa1')]=function(_0x3f2fce,_0xf26cc9){if(_0x3f2fce[_0x74a6('0xa2')]['id']){delete _0x3f2fce['body']['id'];}return db[_0x74a6('0x32')][_0x74a6('0xa3')]({'where':{'id':_0x3f2fce[_0x74a6('0x9d')]['id']}})[_0x74a6('0x26')](handleEntityNotFound(_0xf26cc9,null))[_0x74a6('0x26')](saveUpdates(_0x3f2fce['body'],null))[_0x74a6('0x26')](respondWithResult(_0xf26cc9,null))[_0x74a6('0x9f')](handleError(_0xf26cc9,null));};exports[_0x74a6('0x27')]=function(_0x364524,_0x24ad6c){return db['OpenchannelInteraction'][_0x74a6('0xa3')]({'where':{'id':_0x364524[_0x74a6('0x9d')]['id']}})['then'](handleEntityNotFound(_0x24ad6c,null))[_0x74a6('0x26')](removeEntity(_0x24ad6c,null))[_0x74a6('0x9f')](handleError(_0x24ad6c,null));};exports[_0x74a6('0xa4')]=function(_0x51e8ef,_0x233ddd){return db[_0x74a6('0x32')][_0x74a6('0xa4')]()[_0x74a6('0x26')](respondWithResult(_0x233ddd,null))[_0x74a6('0x9f')](handleError(_0x233ddd,null));};exports[_0x74a6('0xa5')]=function(_0x53a6b5,_0xbb3f0f,_0x428ee6){return db[_0x74a6('0xa6')][_0x74a6('0xa3')]({'where':{'id':_0x53a6b5[_0x74a6('0x9d')]['id']}})['then'](handleEntityNotFound(_0xbb3f0f,null))['then'](function(_0x3f79a6){if(_0x3f79a6){return _0x3f79a6[_0x74a6('0xa5')](_0x53a6b5[_0x74a6('0xa2')][_0x74a6('0xa7')],_[_0x74a6('0xa8')](_0x53a6b5[_0x74a6('0xa2')],[_0x74a6('0xa7'),'id'])||{});}})[_0x74a6('0x26')](respondWithResult(_0xbb3f0f,null))['catch'](handleError(_0xbb3f0f,null));};exports[_0x74a6('0xa9')]=function(_0x216ec1,_0x3a10a3,_0x49a461){var _0x48966c={'raw':![],'where':{}};var _0x26a6e6={};var _0x3ab8ab={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x216ec1[_0x74a6('0x9d')]['id']}})[_0x74a6('0x26')](handleEntityNotFound(_0x3a10a3,null))[_0x74a6('0x26')](function(_0x48f380){if(_0x48f380){_0x26a6e6[_0x74a6('0x38')]=_['keys'](db[_0x74a6('0xa6')]['rawAttributes']);_0x26a6e6[_0x74a6('0x35')]=_[_0x74a6('0x34')](_0x216ec1[_0x74a6('0x35')]);_0x26a6e6['filters']=_['intersection'](_0x26a6e6[_0x74a6('0x38')],_0x26a6e6['query']);_0x48966c['attributes']=_[_0x74a6('0x37')](_0x26a6e6['model'],qs[_0x74a6('0x3a')](_0x216ec1[_0x74a6('0x35')][_0x74a6('0x3a')]));_0x48966c[_0x74a6('0x39')]=_0x48966c[_0x74a6('0x39')][_0x74a6('0x60')]?_0x48966c[_0x74a6('0x39')]:_0x26a6e6['model'];if(!_0x216ec1[_0x74a6('0x35')][_0x74a6('0x3b')](_0x74a6('0xaa'))){_0x48966c[_0x74a6('0x21')]=qs['limit'](_0x216ec1[_0x74a6('0x35')][_0x74a6('0x21')]);_0x48966c[_0x74a6('0x20')]=qs[_0x74a6('0x20')](_0x216ec1[_0x74a6('0x35')][_0x74a6('0x20')]);}_0x48966c[_0x74a6('0x3c')]=qs[_0x74a6('0x3d')](_0x216ec1[_0x74a6('0x35')][_0x74a6('0x3d')]);_0x48966c[_0x74a6('0x3e')]=qs[_0x74a6('0x36')](_[_0x74a6('0x3f')](_0x216ec1[_0x74a6('0x35')],_0x26a6e6[_0x74a6('0x36')]));_0x48966c[_0x74a6('0x3e')][_0x74a6('0x99')]=_0x48f380['id'];if(_0x216ec1[_0x74a6('0x35')][_0x74a6('0xab')]){_0x48966c[_0x74a6('0x3e')]=_['merge'](_0x48966c[_0x74a6('0x3e')],{'$or':_[_0x74a6('0x2b')](_0x48966c[_0x74a6('0x39')],function(_0x36a536){var _0x4bf76e={};_0x4bf76e[_0x36a536]={'$like':'%'+_0x216ec1['query'][_0x74a6('0xab')]+'%'};return _0x4bf76e;})});}if(_0x216ec1[_0x74a6('0x35')][_0x74a6('0x70')]){var _0x156296=_0x216ec1['query'][_0x74a6('0x70')]['split'](',');var _0x34a94d={};_0x34a94d[_0x156296[0x0]]={'$gte':moment(_0x156296[0x1])[_0x74a6('0x5a')](_0x74a6('0xac'))};_0x48966c[_0x74a6('0x3e')]=_[_0x74a6('0x8d')](_0x48966c['where'],_0x34a94d);}_0x48966c=_['merge']({},_0x48966c,_0x216ec1[_0x74a6('0xad')]);return db[_0x74a6('0xa6')][_0x74a6('0x1f')]({'where':_0x48966c[_0x74a6('0x3e')]})[_0x74a6('0x26')](function(_0x5e853b){_0x3ab8ab['count']=_0x5e853b;if(_0x216ec1['query'][_0x74a6('0xae')]){_0x48966c[_0x74a6('0x9e')]=[{'all':!![]}];}return db[_0x74a6('0xa6')][_0x74a6('0xaf')](_0x48966c);})[_0x74a6('0x26')](function(_0x3c751c){_0x3ab8ab[_0x74a6('0x9b')]=_0x3c751c;return _0x3ab8ab;});}})['then'](respondWithFilteredResult(_0x3a10a3,_0x48966c))[_0x74a6('0x9f')](handleError(_0x3a10a3,null));};exports['addTags']=function(_0x5436e7,_0x18f7f7,_0x4a33fb){return db['OpenchannelInteraction'][_0x74a6('0xa3')]({'where':{'id':_0x5436e7['params']['id']}})['then'](handleEntityNotFound(_0x18f7f7,null))['then'](function(_0x150055){if(_0x150055){return _0x150055[_0x74a6('0xb0')](_0x5436e7[_0x74a6('0xa2')]['ids'],_[_0x74a6('0xa8')](_0x5436e7[_0x74a6('0xa2')],[_0x74a6('0xa7'),'id'])||{})[_0x74a6('0xb1')](function(){return db[_0x74a6('0xb2')][_0x74a6('0xaf')]({'attributes':['id',_0x74a6('0x2a'),_0x74a6('0x41')],'where':{'id':_0x5436e7[_0x74a6('0xa2')]['ids']}});})[_0x74a6('0x26')](function(_0x2bff68){socket['emit'](_0x74a6('0xb3'),{'id':Number(_0x5436e7[_0x74a6('0x9d')]['id']),'tags':_0x2bff68||[]});return{'id':Number(_0x5436e7[_0x74a6('0x9d')]['id']),'tags':_0x2bff68||[]};});}})[_0x74a6('0x26')](respondWithResult(_0x18f7f7,null))[_0x74a6('0x9f')](handleError(_0x18f7f7,null));};exports[_0x74a6('0xb4')]=function(_0x50174e,_0x6db4ae,_0x4cb9ce){return db['OpenchannelInteraction']['find']({'where':{'id':_0x50174e[_0x74a6('0x9d')]['id']}})[_0x74a6('0x26')](handleEntityNotFound(_0x6db4ae,null))[_0x74a6('0x26')](function(_0xf37f3f){if(_0xf37f3f){return _0xf37f3f[_0x74a6('0xb4')](_0x50174e[_0x74a6('0x35')][_0x74a6('0xa7')]);}})[_0x74a6('0x26')](respondWithStatusCode(_0x6db4ae,null))['catch'](handleError(_0x6db4ae,null));};exports['download']=function(_0x13c51f,_0x227583){var _0x3bca8a=moment()['unix']()['toString']();var _0x4132da=path[_0x74a6('0x78')](config['root'],_0x74a6('0xb5'),'files','tmp');var _0x5d4cee=path[_0x74a6('0x78')](config[_0x74a6('0xb6')],_0x74a6('0xb5'),'files',_0x74a6('0xb7'));var _0x1d8f9d=path[_0x74a6('0x78')](_0x4132da,_0x3bca8a);var _0x340535=util[_0x74a6('0x5a')](_0x74a6('0xb8'),_0x13c51f[_0x74a6('0x9d')]['id'],_0x3bca8a);var _0x4d87b0=path['join'](_0x4132da,_0x340535);var _0x539355=![];return db[_0x74a6('0x32')]['find']({'where':{'id':_0x13c51f[_0x74a6('0x9d')]['id']},'include':[{'model':db[_0x74a6('0xa6')],'as':_0x74a6('0xb9'),'attributes':['id','body',_0x74a6('0x54'),_0x74a6('0xba'),'secret'],'include':[{'model':db['User'],'as':_0x74a6('0xbb'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0x74a6('0xbc')],'as':'Contact','attributes':['id',_0x74a6('0xbd'),_0x74a6('0xbe')],'raw':!![]},{'model':db['Attachment'],'as':_0x74a6('0xbf'),'raw':!![]}]},{'model':db[_0x74a6('0xc0')],'as':_0x74a6('0xc1'),'attributes':['id',_0x74a6('0x2a')]},{'model':db['User'],'as':_0x74a6('0xc2'),'attributes':['id',_0x74a6('0xc3')]}]})[_0x74a6('0x26')](handleEntityNotFound(_0x227583,null))['then'](function(_0x2d44c6){if(_0x2d44c6){var _0xf54fe6=_0x2d44c6['get']({'plain':!![]});_0x539355=!![];var _0x47cf19={'format':'A4','border':_0x74a6('0xc4'),'header':{'height':_0x74a6('0xc5'),'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':_0x74a6('0xc6'),'contents':{'default':util['format'](_0x74a6('0xc7'),util[_0x74a6('0x5a')](_0x74a6('0xc8'),_0x74a6('0xc9'),_0xf54fe6['id']),moment()[_0x74a6('0x5a')](_0x74a6('0xca'))['toString']())}}};fs[_0x74a6('0xcb')](_0x1d8f9d);var _0x47e1cb={'channel':_0x74a6('0xc9'),'account':_0xf54fe6[_0x74a6('0xc1')][_0x74a6('0x2a')],'agent':_0xf54fe6[_0x74a6('0xc2')]?_0xf54fe6[_0x74a6('0xc2')][_0x74a6('0xc3')]:_0x74a6('0xcc'),'createdAt':moment(_0xf54fe6[_0x74a6('0x54')])[_0x74a6('0x5a')](_0x74a6('0xac'))[_0x74a6('0x77')](),'closedAt':_0xf54fe6[_0x74a6('0xcd')]?moment(_0xf54fe6[_0x74a6('0xce')])[_0x74a6('0x5a')](_0x74a6('0xac'))[_0x74a6('0x77')]():'','disposition':_0xf54fe6['disposition'],'visibility':_0xf54fe6['threadId']?_0x74a6('0xcf'):_0x74a6('0xd0'),'messages':_(_0xf54fe6[_0x74a6('0xb9')])[_0x74a6('0xab')]({'secret':![]})[_0x74a6('0x2b')](function(_0x5f59d2){if(_0x5f59d2[_0x74a6('0xbf')]){var _0x55f988=path[_0x74a6('0x78')](_0x5d4cee,_0x5f59d2['Attachment'][_0x74a6('0xd1')]);if(fs['existsSync'](_0x55f988)){fs['createReadStream'](_0x55f988)[_0x74a6('0xd2')](fs[_0x74a6('0xd3')](path[_0x74a6('0x78')](_0x1d8f9d,_0x5f59d2['Attachment'][_0x74a6('0xd1')])));}}return{'date':moment(_0x5f59d2[_0x74a6('0x54')])['format'](_0x74a6('0xac'))[_0x74a6('0x77')](),'sender':_0x5f59d2['direction']===_0x74a6('0xd4')?_0x5f59d2['User']?_0x5f59d2[_0x74a6('0xbb')][_0x74a6('0xc3')]:_0x74a6('0xd5'):_0x5f59d2[_0x74a6('0xd6')][_0x74a6('0xbd')]+(_0x5f59d2[_0x74a6('0xd6')][_0x74a6('0xbe')]?'\x20'+_0x5f59d2[_0x74a6('0xd6')][_0x74a6('0xbe')]:''),'body':_0x5f59d2[_0x74a6('0xbf')]?_0x5f59d2[_0x74a6('0xbf')][_0x74a6('0xd1')]:_0x5f59d2[_0x74a6('0xa2')],'direction':_0x5f59d2['direction']===_0x74a6('0xd4')?'A':'C','secret':_0x5f59d2[_0x74a6('0xd7')],'attachment':_0x5f59d2[_0x74a6('0xbf')]};})[_0x74a6('0x55')]()};return ejs[_0x74a6('0xd8')](path[_0x74a6('0x78')](config['root'],'server',_0x74a6('0xd9'),_0x74a6('0xda')),{'interaction':_0x47e1cb})['then'](function(_0x1fa14d){return new BPromise(function(_0x1f0a35,_0x3f60d8){pdf['create'](_0x1fa14d,_0x47cf19)[_0x74a6('0xdb')](path[_0x74a6('0x78')](_0x1d8f9d,_0x74a6('0xdc')+_0xf54fe6['id']+'-'+_0x3bca8a+_0x74a6('0xdd')),function(_0x24fb22,_0x35a345){if(_0x24fb22)return _0x3f60d8(_0x24fb22);_0x1f0a35(_0x35a345);});});});}})[_0x74a6('0x26')](function(){if(_0x539355){return new BPromise(function(_0x3360ca,_0x52d462){zipdir(_0x1d8f9d,{'saveTo':_0x4d87b0},function(_0x3133dd,_0x8d98aa){if(_0x3133dd)return _0x52d462(_0x3133dd);return _0x3360ca(_0x8d98aa);});})['then'](function(){return new BPromise(function(_0x18e51b,_0x16024e){rimraf(_0x1d8f9d,function(_0x57906c){if(_0x57906c)_0x16024e(_0x57906c);return _0x18e51b();});});})[_0x74a6('0x26')](function(){return _0x227583[_0x74a6('0xde')](_0x4d87b0,_0x340535,function(_0x4d33e4){if(_0x4d33e4){console[_0x74a6('0xdf')]('err',_0x4d33e4);}else{fs[_0x74a6('0xe0')](_0x4d87b0);}});});}else{return _0x227583[_0x74a6('0x1b')](0xc8);}})[_0x74a6('0x9f')](handleError(_0x227583,null));}; \ No newline at end of file +var _0xdae4=['Contact','firstName','Attachment','OpenchannelAccount','Account','Owner','fullname','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','\x0a\x20\x20\x20\x20\x20\x20\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','YYYY-MM-DD','mkdirSync','N.A.','closed','closedAt','threadId','Private','join','existsSync','pipe','createWriteStream','basename','out','lastName','secret','renderFile','views','transcript-','.pdf','download','log','err','unlinkSync','sendStatus','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','status','end','offset','Content-Range','json','apply','reject','save','update','then','error','stack','name','Users','map','TagIds','split','Tags','push','index','OpenchannelInteraction','rawAttributes','model','keys','query','filters','intersection','attributes','limit','sort','pick','select','field','color','from','tools_tags','COUNT(*)','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','where','me.direction\x20=\x20\x27in\x27','left_join','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','advancedFilter','parse','forEach','createdAt','dateStart','utc','format','endOf','day','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','value','TagId','unreadMessages','length','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','c.email','\x20<\x20?','\x20LIKE\x20?','hasOwnProperty','filter','isNil','isEmpty','OpenchannelAccountId','$gte','$lte','\x20IS\x20NULL','replace','\x27\x27\x27\x27','isNumeric','toString','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','i.id','Sequelize','QueryTypes','SELECT','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','sequelize','count','keyBy','merge','a.key','Account.key','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','all','rows','catch','params','fields','includeAll','options','find','create','body','destroy','describe','addMessage','OpenchannelMessage','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','omit','spread','Tag','emit','openchannelInteractionTags:save','removeTags','unix','root','server','files','tmp','attachments','transcript-%d-%s.zip','direction','User','CmContact'];(function(_0x42161d,_0xd933){var _0x5889c2=function(_0x46af75){while(--_0x46af75){_0x42161d['push'](_0x42161d['shift']());}};_0x5889c2(++_0xd933);}(_0xdae4,0x107));var _0x4dae=function(_0x5ee749,_0x4270b9){_0x5ee749=_0x5ee749-0x0;var _0x4077ee=_0xdae4[_0x5ee749];return _0x4077ee;};'use strict';var pdf=require(_0x4dae('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4dae('0x1'));var jsonpatch=require(_0x4dae('0x2'));var rp=require(_0x4dae('0x3'));var moment=require(_0x4dae('0x4'));var BPromise=require(_0x4dae('0x5'));var Mustache=require(_0x4dae('0x6'));var util=require('util');var path=require(_0x4dae('0x7'));var sox=require('sox');var csv=require(_0x4dae('0x8'));var ejs=require(_0x4dae('0x9'));var fs=require('fs');var _=require(_0x4dae('0xa'));var squel=require(_0x4dae('0xb'));var crypto=require(_0x4dae('0xc'));var jsforce=require(_0x4dae('0xd'));var deskjs=require(_0x4dae('0xe'));var toCsv=require(_0x4dae('0x8'));var querystring=require(_0x4dae('0xf'));var Papa=require(_0x4dae('0x10'));var Redis=require(_0x4dae('0x11'));var authService=require(_0x4dae('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4dae('0x13'));var utils=require(_0x4dae('0x14'));var config=require(_0x4dae('0x15'));var db=require(_0x4dae('0x16'))['db'];config[_0x4dae('0x17')]=_[_0x4dae('0x18')](config[_0x4dae('0x17')],{'host':_0x4dae('0x19'),'port':0x18eb});var socket=require(_0x4dae('0x1a'))(new Redis(config[_0x4dae('0x17')]));require(_0x4dae('0x1b'))['register'](socket);function respondWithStatusCode(_0xf88642,_0xb66e06){_0xb66e06=_0xb66e06||0xcc;return function(_0x7ab3a6){if(_0x7ab3a6){return _0xf88642['sendStatus'](_0xb66e06);}return _0xf88642[_0x4dae('0x1c')](_0xb66e06)[_0x4dae('0x1d')]();};}function respondWithResult(_0x5c1904,_0xc90a58){_0xc90a58=_0xc90a58||0xc8;return function(_0x1be285){if(_0x1be285){return _0x5c1904['status'](_0xc90a58)['json'](_0x1be285);}};}function respondWithFilteredResult(_0x18b89d,_0x230d6a){return function(_0x4997f2){if(_0x4997f2){var _0x3ec1b7=_0x4997f2['count'],_0x422163=_0x230d6a[_0x4dae('0x1e')],_0x3d4278=_0x230d6a[_0x4dae('0x1e')]+_0x230d6a['limit'],_0x33b938;if(_0x3d4278>=_0x3ec1b7){_0x3d4278=_0x3ec1b7;_0x33b938=0xc8;}else{_0x33b938=0xce;}_0x18b89d[_0x4dae('0x1c')](_0x33b938);return _0x18b89d['set'](_0x4dae('0x1f'),_0x422163+'-'+_0x3d4278+'/'+_0x3ec1b7)[_0x4dae('0x20')](_0x4997f2);}return null;};}function patchUpdates(_0x59f248){return function(_0x11c8b6){try{jsonpatch[_0x4dae('0x21')](_0x11c8b6,_0x59f248,!![]);}catch(_0x454290){return BPromise[_0x4dae('0x22')](_0x454290);}return _0x11c8b6[_0x4dae('0x23')]();};}function saveUpdates(_0x2d3c2e,_0x108a21){return function(_0x10ce49){if(_0x10ce49){return _0x10ce49[_0x4dae('0x24')](_0x2d3c2e)[_0x4dae('0x25')](function(_0xedc120){return _0xedc120;});}return null;};}function removeEntity(_0x31fa93,_0x307bc1){return function(_0x10c5a4){if(_0x10c5a4){return _0x10c5a4['destroy']()[_0x4dae('0x25')](function(){_0x31fa93[_0x4dae('0x1c')](0xcc)[_0x4dae('0x1d')]();});}};}function handleEntityNotFound(_0x33df0b,_0x3db5c6){return function(_0x18d9d7){if(!_0x18d9d7){_0x33df0b['sendStatus'](0x194);}return _0x18d9d7;};}function handleError(_0x8b3240,_0x4fd9c0){_0x4fd9c0=_0x4fd9c0||0x1f4;return function(_0x4e7cc2){logger[_0x4dae('0x26')](_0x4e7cc2[_0x4dae('0x27')]);if(_0x4e7cc2['name']){delete _0x4e7cc2[_0x4dae('0x28')];}_0x8b3240[_0x4dae('0x1c')](_0x4fd9c0)['send'](_0x4e7cc2);};}function getInteractionUsers(_0x169882,_0xe5a958){return new BPromise(function(_0x3df184,_0x2cffae){try{if(_0xe5a958[_0x169882['id']]){_0x169882[_0x4dae('0x29')]=_[_0x4dae('0x2a')](_0xe5a958[_0x169882['id']],function(_0x20562e){return{'id':_0x20562e['id']};});}}catch(_0x412840){_0x2cffae(_0x412840);}_0x3df184(_0x169882);});}function getInteractionTags(_0x586ed8,_0x370ec9){return new BPromise(function(_0x417f3b,_0x42e263){try{if(_0x586ed8[_0x4dae('0x2b')]){_0x586ed8['Tags']=[];_0x586ed8['TagIds'][_0x4dae('0x2c')](',')['forEach'](function(_0xc9c591){_0x586ed8[_0x4dae('0x2d')][_0x4dae('0x2e')](_0x370ec9[_0xc9c591]);});}delete _0x586ed8[_0x4dae('0x2b')];}catch(_0x162542){_0x42e263(_0x162542);}_0x417f3b(_0x586ed8);});}function updateOpenchannelInteraction(_0x2424d3,_0x4c7f0f,_0x685504){return new BPromise(function(_0x46384a,_0x53f57a){return getInteractionUsers(_0x2424d3,_0x685504)[_0x4dae('0x25')](function(_0x2a64d2){return getInteractionTags(_0x2a64d2,_0x4c7f0f);})[_0x4dae('0x25')](function(_0x554949){_0x46384a(_0x554949);})['catch'](function(_0x562434){_0x53f57a(_0x562434);});});}exports[_0x4dae('0x2f')]=function(_0x54847c,_0x4717d6){var _0x2e8c9d={},_0x1e8047={},_0x50f238={'count':0x0,'rows':[]};var _0x37da4b=db[_0x4dae('0x30')][_0x4dae('0x31')];_0x1e8047[_0x4dae('0x32')]=_[_0x4dae('0x33')](_0x37da4b);_0x1e8047[_0x4dae('0x34')]=_[_0x4dae('0x33')](_0x54847c[_0x4dae('0x34')]);_0x1e8047[_0x4dae('0x35')]=_['intersection'](_0x1e8047['model'],_0x1e8047[_0x4dae('0x34')]);_0x2e8c9d['attributes']=_[_0x4dae('0x36')](_0x1e8047[_0x4dae('0x32')],qs['fields'](_0x54847c[_0x4dae('0x34')]['fields']));_0x2e8c9d[_0x4dae('0x37')]=_0x2e8c9d[_0x4dae('0x37')]['length']?_0x2e8c9d[_0x4dae('0x37')]:_0x1e8047['model'];if(!_0x54847c[_0x4dae('0x34')]['hasOwnProperty']('nolimit')){_0x2e8c9d[_0x4dae('0x38')]=qs[_0x4dae('0x38')](_0x54847c['query']['limit']);_0x2e8c9d['offset']=qs[_0x4dae('0x1e')](_0x54847c[_0x4dae('0x34')]['offset']);}_0x2e8c9d['order']=qs['sort'](_0x54847c[_0x4dae('0x34')][_0x4dae('0x39')]);_0x2e8c9d['where']=qs['filters'](_[_0x4dae('0x3a')](_0x54847c['query'],_0x1e8047[_0x4dae('0x35')]));var _0x461fe5=[];var _0x1da442=squel[_0x4dae('0x3b')]()[_0x4dae('0x3c')]('id')[_0x4dae('0x3c')]('name')[_0x4dae('0x3c')](_0x4dae('0x3d'))[_0x4dae('0x3e')](_0x4dae('0x3f'));var _0x5024af=squel[_0x4dae('0x3b')]()[_0x4dae('0x3c')](_0x4dae('0x40'))[_0x4dae('0x3e')](_0x4dae('0x41'),'me')['where'](_0x4dae('0x42'))[_0x4dae('0x43')](_0x4dae('0x44'))[_0x4dae('0x43')]('me.read\x20=\x20false');var _0x512bba=squel[_0x4dae('0x3b')]()[_0x4dae('0x3c')]('u.id')[_0x4dae('0x3c')]('ui.OpenchannelInteractionId')[_0x4dae('0x3e')]('user_has_openchannel_interactions','ui')[_0x4dae('0x45')]('users','u',_0x4dae('0x46'));var _0x16b91d=squel[_0x4dae('0x3b')]()[_0x4dae('0x3e')]('openchannel_interactions','i')[_0x4dae('0x45')]('cm_contacts','c',_0x4dae('0x47'))[_0x4dae('0x45')](_0x4dae('0x48'),'o','o.id\x20=\x20i.UserId')[_0x4dae('0x45')](_0x4dae('0x49'),'a',_0x4dae('0x4a'))['left_join']('openchannel_messages','me','me.OpenchannelInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false');var _0xf6d085=squel['expr']();if(_0x54847c[_0x4dae('0x34')][_0x4dae('0x4b')]){var _0x2e9ecf=JSON[_0x4dae('0x4c')](_0x54847c['query']['advancedFilter']);_[_0x4dae('0x33')](_0x2e9ecf)[_0x4dae('0x4d')](function(_0x6377e){var _0x4a2212=_0x2e9ecf[_0x6377e];if(_0x6377e===_0x4dae('0x4e')){var _0x4e66a2=moment(_0x4a2212['value'][_0x4dae('0x4f')])['startOf']('day')[_0x4dae('0x50')]()[_0x4dae('0x51')]();var _0x26246e=moment(_0x26246e)[_0x4dae('0x50')]()[_0x4dae('0x52')](_0x4dae('0x53'))['format']();_0xf6d085[_0x4dae('0x54')](_0x4dae('0x55'),_0x4e66a2,_0x26246e);}else{if(_[_0x4dae('0x56')](_0x4a2212[_0x4dae('0x57')])){_0x4a2212[_0x4dae('0x57')][_0x4dae('0x4d')](function(_0xc840b1){switch(_0x4a2212[_0x4dae('0x57')][_0x4dae('0x58')]){case'IS':if(_0x6377e!==_0x4dae('0x59')&&_0x6377e!==_0x4dae('0x5a')){if(_[_0x4dae('0x56')](_0x4a2212['value'])&&_0x4a2212['value'][_0x4dae('0x5b')]>0x1){_0xf6d085[_0x4dae('0x54')](_0x4a2212[_0x4dae('0x5c')]+'.'+_0x6377e+_0x4dae('0x5d'),_0x4a2212['value']);}else{_0xf6d085[_0x4dae('0x54')](_0x4a2212[_0x4dae('0x5c')]+'.'+_0x6377e+_0x4dae('0x5e'),_0x4a2212[_0x4dae('0x58')][0x0]);}}break;case'=':_0xf6d085[_0x4dae('0x54')](_0x4a2212[_0x4dae('0x5c')]+'.'+_0x6377e+_0x4dae('0x5e'),_0x4a2212['value']);break;case _0x4dae('0x5f'):if(_0x6377e===_0x4dae('0x60')){_0xf6d085[_0x4dae('0x54')](_0x4dae('0x61')+'\x20LIKE\x20?','%'+_0x4a2212['value']+'%');_0xf6d085['or']('c.lastName'+'\x20LIKE\x20?','%'+_0x4a2212[_0x4dae('0x58')]+'%');_0xf6d085['or'](_0x4dae('0x62')+'\x20LIKE\x20?','%'+_0x4a2212[_0x4dae('0x58')]+'%');}else{_0xf6d085['and'](_0x4a2212['tableAlias']+'.'+_0x6377e+'\x20LIKE\x20?','%'+_0x4a2212[_0x4dae('0x58')]+'%');}break;case'>':_0xf6d085[_0x4dae('0x54')](_0x4a2212[_0x4dae('0x5c')]+'.'+_0x6377e+'\x20>\x20?',_0x4a2212[_0x4dae('0x58')]);break;case'<':_0xf6d085['and'](_0x4a2212[_0x4dae('0x5c')]+'.'+_0x6377e+_0x4dae('0x63'),_0x4a2212[_0x4dae('0x58')]);break;}});}else{switch(_0x4a2212[_0x4dae('0x57')][_0x4dae('0x58')]){case'IS':if(_0x6377e!==_0x4dae('0x59')&&_0x6377e!==_0x4dae('0x5a')){if(_['isArray'](_0x4a2212['value'])&&_0x4a2212[_0x4dae('0x58')][_0x4dae('0x5b')]>0x1){_0xf6d085[_0x4dae('0x54')](_0x4a2212[_0x4dae('0x5c')]+'.'+_0x6377e+'\x20IN\x20?',_0x4a2212[_0x4dae('0x58')]);}else{_0xf6d085['and'](_0x4a2212[_0x4dae('0x5c')]+'.'+_0x6377e+_0x4dae('0x5e'),_0x4a2212[_0x4dae('0x58')][0x0]);}}break;case'=':_0xf6d085[_0x4dae('0x54')](_0x4a2212['tableAlias']+'.'+_0x6377e+_0x4dae('0x5e'),_0x4a2212['value']);break;case _0x4dae('0x5f'):if(_0x6377e==='ContactId'){_0xf6d085['and'](_0x4dae('0x61')+'\x20LIKE\x20?','%'+_0x4a2212[_0x4dae('0x58')]+'%');_0xf6d085['or']('c.lastName'+_0x4dae('0x64'),'%'+_0x4a2212['value']+'%');_0xf6d085['or'](_0x4dae('0x62')+'\x20LIKE\x20?','%'+_0x4a2212[_0x4dae('0x58')]+'%');}else{_0xf6d085[_0x4dae('0x54')](_0x4a2212['tableAlias']+'.'+_0x6377e+'\x20LIKE\x20?','%'+_0x4a2212[_0x4dae('0x58')]+'%');}break;case'>':_0xf6d085[_0x4dae('0x54')](_0x4a2212[_0x4dae('0x5c')]+'.'+_0x6377e+'\x20>\x20?',_0x4a2212[_0x4dae('0x58')]);break;case'<':_0xf6d085[_0x4dae('0x54')](_0x4a2212[_0x4dae('0x5c')]+'.'+_0x6377e+_0x4dae('0x63'),_0x4a2212['value']);break;}}}});}else{var _0x20de3b=_(Object[_0x4dae('0x33')](_0x54847c['query']))[_0x4dae('0x2a')](function(_0x5d48d0){return _0x37da4b[_0x4dae('0x65')](_0x5d48d0)?_0x5d48d0:undefined;})[_0x4dae('0x66')](function(_0xb1a93e){return!_[_0x4dae('0x67')](_0xb1a93e);})[_0x4dae('0x58')]();if(!_[_0x4dae('0x68')](_0x20de3b)){_0x20de3b[_0x4dae('0x4d')](function(_0x5c25e9){if(_0x5c25e9===_0x4dae('0x69')){_0x16b91d['where']('i.OpenchannelAccountId\x20IN\x20?',[]['concat'](_0x54847c[_0x4dae('0x34')][_0x5c25e9]));}else if(_0x5c25e9===_0x4dae('0x4e')){var _0x142756=JSON['parse'](_0x54847c[_0x4dae('0x34')][_0x5c25e9])[_0x4dae('0x6a')];var _0x47c344=JSON['parse'](_0x54847c['query'][_0x5c25e9])[_0x4dae('0x6b')];_0x16b91d[_0x4dae('0x43')](_0x4dae('0x55'),_0x142756,_0x47c344);}else{if(_0x54847c[_0x4dae('0x34')][_0x5c25e9]==='null'){_0x16b91d[_0x4dae('0x43')]('i.'+_0x5c25e9+_0x4dae('0x6c'));}else{_0x16b91d['where']('i.'+_0x5c25e9+_0x4dae('0x5e'),_0x54847c[_0x4dae('0x34')][_0x5c25e9]);}}});}if(_0x54847c[_0x4dae('0x34')][_0x4dae('0x66')]){var _0x30a796=_0x54847c[_0x4dae('0x34')]['filter'][_0x4dae('0x6d')]('\x5c','\x5c\x5c')[_0x4dae('0x6d')]('\x27\x27',_0x4dae('0x6e'));if(qs[_0x4dae('0x6f')](_0x30a796)){_0xf6d085['or']('i.id\x20LIKE\x20?',_0x30a796+'%');}else{var _0x56a18e=[];_0x30a796[_0x4dae('0x2c')]('\x20')['forEach'](function(_0x534f27){_0x56a18e[_0x4dae('0x2e')]('+'+_0x534f27[_0x4dae('0x70')]());});var _0x3fb0eb=_0x56a18e['join']('\x20');_0xf6d085['or'](_0x4dae('0x71'),_0x3fb0eb)['or']('i.from\x20LIKE\x20?',_0x30a796+'%')['or'](_0x4dae('0x72'),_0x30a796+'%');}}}_0x16b91d[_0x4dae('0x43')](_0xf6d085);if(_0x2e8c9d[_0x4dae('0x73')]){_0x2e8c9d['order'][_0x4dae('0x4d')](function(_0x4e330a){_0x16b91d[_0x4dae('0x73')]('i.'+_0x4e330a[0x0],_0x4e330a[0x1]===_0x4dae('0x74')?![]:!![]);});}_0x16b91d['group'](_0x4dae('0x75'));var _0x459628={'type':db[_0x4dae('0x76')][_0x4dae('0x77')][_0x4dae('0x78')],'raw':!![]};var _0x47c126=_0x16b91d['clone']()[_0x4dae('0x3c')]('COUNT(*)')[_0x4dae('0x3c')](_0x4dae('0x79'),_0x4dae('0x5a'));if(!_0x54847c[_0x4dae('0x34')][_0x4dae('0x4b')]){if(_0x54847c[_0x4dae('0x34')][_0x4dae('0x7a')]){if(_0x54847c[_0x4dae('0x34')][_0x4dae('0x7a')]==0x1){_0x47c126[_0x4dae('0x7b')](_0x4dae('0x7c'));_0x16b91d[_0x4dae('0x7b')](_0x4dae('0x7c'));}else{_0x47c126['having'](_0x4dae('0x7d'));_0x16b91d['having'](_0x4dae('0x7d'));}}if(_0x54847c[_0x4dae('0x34')][_0x4dae('0x7e')]){var _0x118ea8=_[_0x4dae('0x56')](_0x54847c[_0x4dae('0x34')][_0x4dae('0x7e')])?_0x54847c[_0x4dae('0x34')]['tag']:new Array(_0x54847c[_0x4dae('0x34')][_0x4dae('0x7e')]);var _0x50563a=squel['expr']();_0x118ea8['forEach'](function(_0x5c4496){_0x50563a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5c4496+',%');});_0x16b91d[_0x4dae('0x7b')](_0x50563a);_0x47c126[_0x4dae('0x45')](_0x4dae('0x7f'),'it',_0x4dae('0x80'));_0x47c126['left_join'](_0x4dae('0x3f'),'t',_0x4dae('0x81'));_0x47c126[_0x4dae('0x43')](_0x4dae('0x82'),_0x118ea8);}}else{var _0x2e9ecf=JSON[_0x4dae('0x4c')](_0x54847c[_0x4dae('0x34')]['advancedFilter']);_['keys'](_0x2e9ecf)[_0x4dae('0x4d')](function(_0x589587){var _0x21888b=_0x2e9ecf[_0x589587];if(_0x589587==='TagId'){var _0x32a5d6=_0x21888b[_0x4dae('0x58')];var _0x4f3a28=squel[_0x4dae('0x83')]();_0x32a5d6[_0x4dae('0x4d')](function(_0x5edb22){_0x4f3a28['or'](_0x4dae('0x84'),'%,'+_0x5edb22+',%');});_0x16b91d[_0x4dae('0x7b')](_0x4f3a28);_0x47c126[_0x4dae('0x45')](_0x4dae('0x85'),'it',_0x4dae('0x86'));_0x47c126[_0x4dae('0x45')](_0x4dae('0x3f'),'t','t.id\x20=\x20it.TagId');_0x47c126[_0x4dae('0x43')](_0x4dae('0x82'),_0x32a5d6);}else if(_0x589587===_0x4dae('0x5a')){if(_0x21888b['value'][_0x4dae('0x5b')]===0x1){if(_0x21888b[_0x4dae('0x58')][0x0]===0x1){_0x47c126[_0x4dae('0x7b')](_0x4dae('0x7c'));_0x16b91d['having'](_0x4dae('0x7c'));}else{_0x47c126[_0x4dae('0x7b')]('`unreadMessages`\x20>\x200');_0x16b91d['having'](_0x4dae('0x7d'));}}}});}db[_0x4dae('0x87')][_0x4dae('0x34')](_0x47c126[_0x4dae('0x70')](),_0x459628)[_0x4dae('0x25')](function(_0x486cb6){_0x50f238['count']=_0x486cb6[_0x4dae('0x5b')];if(_0x50f238[_0x4dae('0x88')]===0x0)return[];return db[_0x4dae('0x87')]['query'](_0x1da442[_0x4dae('0x70')](),_0x459628)[_0x4dae('0x25')](function(_0x1d1c54){_0x461fe5=_[_0x4dae('0x89')](_0x1d1c54,'id');_0x459628=_[_0x4dae('0x8a')](_0x459628,{'model':db[_0x4dae('0x30')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x16b91d[_0x4dae('0x3c')](_0x4dae('0x79'),_0x4dae('0x5a'));_0x16b91d[_0x4dae('0x3c')](_0x4dae('0x8b'),_0x4dae('0x8c'));_0x16b91d[_0x4dae('0x3c')](_0x4dae('0x8d'));_0x16b91d[_0x4dae('0x3c')](_0x4dae('0x61'),_0x4dae('0x8e'));_0x16b91d['field'](_0x4dae('0x8f'),_0x4dae('0x90'));_0x16b91d[_0x4dae('0x3c')](_0x4dae('0x62'),_0x4dae('0x91'));_0x16b91d[_0x4dae('0x3c')](_0x4dae('0x92'),_0x4dae('0x93'));_0x16b91d['field'](_0x4dae('0x94'),_0x4dae('0x95'));_0x16b91d[_0x4dae('0x3c')](_0x4dae('0x96'),_0x4dae('0x97'));_0x16b91d[_0x4dae('0x3c')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x4dae('0x2b'));_0x16b91d[_0x4dae('0x45')](_0x4dae('0x7f'),'it',_0x4dae('0x80'));_0x16b91d[_0x4dae('0x45')](_0x4dae('0x3f'),'t',_0x4dae('0x81'));_0x16b91d[_0x4dae('0x38')](_0x2e8c9d[_0x4dae('0x38')]);_0x16b91d[_0x4dae('0x1e')](_0x2e8c9d[_0x4dae('0x1e')]);return db['sequelize']['query'](_0x16b91d[_0x4dae('0x70')](),_0x459628);})[_0x4dae('0x25')](function(_0x1f204e){_0x512bba[_0x4dae('0x43')](_0x4dae('0x98'),_[_0x4dae('0x2a')](_0x1f204e,'id'));return db['sequelize'][_0x4dae('0x34')](_0x512bba[_0x4dae('0x70')](),_0x459628)['then'](function(_0xa96f3b){var _0xa59f2b=_[_0x4dae('0x99')](_0xa96f3b,'OpenchannelInteractionId');var _0x11a73d=[];_0x1f204e[_0x4dae('0x4d')](function(_0x213a04){_0x11a73d[_0x4dae('0x2e')](updateOpenchannelInteraction(_0x213a04,_0x461fe5,_0xa59f2b));});return BPromise[_0x4dae('0x9a')](_0x11a73d);});});})[_0x4dae('0x25')](function(_0x212864){_0x50f238[_0x4dae('0x9b')]=_0x212864;return _0x50f238;})['then'](respondWithFilteredResult(_0x4717d6,_0x2e8c9d))[_0x4dae('0x9c')](handleError(_0x4717d6,null));};exports['show']=function(_0x59ce67,_0x310afb){var _0x964b72={'raw':![],'where':{'id':_0x59ce67[_0x4dae('0x9d')]['id']}},_0x33951a={};_0x33951a[_0x4dae('0x32')]=_[_0x4dae('0x33')](db[_0x4dae('0x30')]['rawAttributes']);_0x33951a[_0x4dae('0x34')]=_['keys'](_0x59ce67[_0x4dae('0x34')]);_0x33951a['filters']=_[_0x4dae('0x36')](_0x33951a[_0x4dae('0x32')],_0x33951a[_0x4dae('0x34')]);_0x964b72[_0x4dae('0x37')]=_[_0x4dae('0x36')](_0x33951a[_0x4dae('0x32')],qs[_0x4dae('0x9e')](_0x59ce67['query'][_0x4dae('0x9e')]));_0x964b72[_0x4dae('0x37')]=_0x964b72[_0x4dae('0x37')][_0x4dae('0x5b')]?_0x964b72[_0x4dae('0x37')]:_0x33951a[_0x4dae('0x32')];if(_0x59ce67['query'][_0x4dae('0x9f')]){_0x964b72['include']=[{'all':!![]}];}_0x964b72=_['merge']({},_0x964b72,_0x59ce67[_0x4dae('0xa0')]);return db[_0x4dae('0x30')][_0x4dae('0xa1')](_0x964b72)['then'](handleEntityNotFound(_0x310afb,null))[_0x4dae('0x25')](respondWithResult(_0x310afb,null))[_0x4dae('0x9c')](handleError(_0x310afb,null));};exports[_0x4dae('0xa2')]=function(_0x4c2049,_0xe6114){return db[_0x4dae('0x30')][_0x4dae('0xa2')](_0x4c2049[_0x4dae('0xa3')],{})[_0x4dae('0x25')](respondWithResult(_0xe6114,0xc9))[_0x4dae('0x9c')](handleError(_0xe6114,null));};exports[_0x4dae('0x24')]=function(_0x256b3b,_0x485de9){if(_0x256b3b['body']['id']){delete _0x256b3b[_0x4dae('0xa3')]['id'];}return db['OpenchannelInteraction'][_0x4dae('0xa1')]({'where':{'id':_0x256b3b[_0x4dae('0x9d')]['id']}})[_0x4dae('0x25')](handleEntityNotFound(_0x485de9,null))[_0x4dae('0x25')](saveUpdates(_0x256b3b[_0x4dae('0xa3')],null))[_0x4dae('0x25')](respondWithResult(_0x485de9,null))[_0x4dae('0x9c')](handleError(_0x485de9,null));};exports[_0x4dae('0xa4')]=function(_0x168208,_0x3e9524){return db[_0x4dae('0x30')]['find']({'where':{'id':_0x168208['params']['id']}})[_0x4dae('0x25')](handleEntityNotFound(_0x3e9524,null))[_0x4dae('0x25')](removeEntity(_0x3e9524,null))['catch'](handleError(_0x3e9524,null));};exports[_0x4dae('0xa5')]=function(_0x4491e6,_0x195de0){return db['OpenchannelInteraction'][_0x4dae('0xa5')]()['then'](respondWithResult(_0x195de0,null))[_0x4dae('0x9c')](handleError(_0x195de0,null));};exports[_0x4dae('0xa6')]=function(_0xc6ec5,_0x302229,_0x2e45bd){return db[_0x4dae('0xa7')][_0x4dae('0xa1')]({'where':{'id':_0xc6ec5[_0x4dae('0x9d')]['id']}})[_0x4dae('0x25')](handleEntityNotFound(_0x302229,null))[_0x4dae('0x25')](function(_0xf3d519){if(_0xf3d519){return _0xf3d519[_0x4dae('0xa6')](_0xc6ec5[_0x4dae('0xa3')][_0x4dae('0xa8')],_['omit'](_0xc6ec5[_0x4dae('0xa3')],[_0x4dae('0xa8'),'id'])||{});}})[_0x4dae('0x25')](respondWithResult(_0x302229,null))[_0x4dae('0x9c')](handleError(_0x302229,null));};exports[_0x4dae('0xa9')]=function(_0x3840e4,_0x1262b0,_0x4a00f5){var _0xa5d054={'raw':![],'where':{}};var _0x4ce5b4={};var _0x505e7e={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x3840e4['params']['id']}})[_0x4dae('0x25')](handleEntityNotFound(_0x1262b0,null))[_0x4dae('0x25')](function(_0x314f11){if(_0x314f11){_0x4ce5b4[_0x4dae('0x32')]=_[_0x4dae('0x33')](db[_0x4dae('0xa7')]['rawAttributes']);_0x4ce5b4[_0x4dae('0x34')]=_[_0x4dae('0x33')](_0x3840e4['query']);_0x4ce5b4[_0x4dae('0x35')]=_[_0x4dae('0x36')](_0x4ce5b4[_0x4dae('0x32')],_0x4ce5b4[_0x4dae('0x34')]);_0xa5d054[_0x4dae('0x37')]=_[_0x4dae('0x36')](_0x4ce5b4[_0x4dae('0x32')],qs[_0x4dae('0x9e')](_0x3840e4[_0x4dae('0x34')][_0x4dae('0x9e')]));_0xa5d054[_0x4dae('0x37')]=_0xa5d054['attributes'][_0x4dae('0x5b')]?_0xa5d054[_0x4dae('0x37')]:_0x4ce5b4['model'];if(!_0x3840e4['query'][_0x4dae('0x65')]('nolimit')){_0xa5d054[_0x4dae('0x38')]=qs[_0x4dae('0x38')](_0x3840e4[_0x4dae('0x34')][_0x4dae('0x38')]);_0xa5d054[_0x4dae('0x1e')]=qs[_0x4dae('0x1e')](_0x3840e4['query'][_0x4dae('0x1e')]);}_0xa5d054[_0x4dae('0x73')]=qs[_0x4dae('0x39')](_0x3840e4[_0x4dae('0x34')]['sort']);_0xa5d054[_0x4dae('0x43')]=qs[_0x4dae('0x35')](_[_0x4dae('0x3a')](_0x3840e4['query'],_0x4ce5b4['filters']));_0xa5d054[_0x4dae('0x43')]['OpenchannelInteractionId']=_0x314f11['id'];if(_0x3840e4['query'][_0x4dae('0x66')]){_0xa5d054['where']=_[_0x4dae('0x8a')](_0xa5d054[_0x4dae('0x43')],{'$or':_['map'](_0xa5d054[_0x4dae('0x37')],function(_0x3e4710){var _0x2cd4f0={};_0x2cd4f0[_0x3e4710]={'$like':'%'+_0x3840e4['query'][_0x4dae('0x66')]+'%'};return _0x2cd4f0;})});}if(_0x3840e4[_0x4dae('0x34')][_0x4dae('0x6a')]){var _0x446d44=_0x3840e4[_0x4dae('0x34')][_0x4dae('0x6a')]['split'](',');var _0x4937b3={};_0x4937b3[_0x446d44[0x0]]={'$gte':moment(_0x446d44[0x1])['format'](_0x4dae('0xaa'))};_0xa5d054[_0x4dae('0x43')]=_[_0x4dae('0x8a')](_0xa5d054[_0x4dae('0x43')],_0x4937b3);}_0xa5d054=_[_0x4dae('0x8a')]({},_0xa5d054,_0x3840e4[_0x4dae('0xa0')]);return db[_0x4dae('0xa7')][_0x4dae('0x88')]({'where':_0xa5d054[_0x4dae('0x43')]})['then'](function(_0x49fa9e){_0x505e7e[_0x4dae('0x88')]=_0x49fa9e;if(_0x3840e4['query'][_0x4dae('0x9f')]){_0xa5d054[_0x4dae('0xab')]=[{'all':!![]}];}return db[_0x4dae('0xa7')][_0x4dae('0xac')](_0xa5d054);})['then'](function(_0x56c0d7){_0x505e7e[_0x4dae('0x9b')]=_0x56c0d7;return _0x505e7e;});}})[_0x4dae('0x25')](respondWithFilteredResult(_0x1262b0,_0xa5d054))[_0x4dae('0x9c')](handleError(_0x1262b0,null));};exports[_0x4dae('0xad')]=function(_0x2818fc,_0x1e7ee9,_0xed46f7){return db['OpenchannelInteraction'][_0x4dae('0xa1')]({'where':{'id':_0x2818fc[_0x4dae('0x9d')]['id']}})[_0x4dae('0x25')](handleEntityNotFound(_0x1e7ee9,null))[_0x4dae('0x25')](function(_0x37dea7){if(_0x37dea7){return _0x37dea7[_0x4dae('0xae')](_0x2818fc['body'][_0x4dae('0xa8')],_[_0x4dae('0xaf')](_0x2818fc['body'],[_0x4dae('0xa8'),'id'])||{})[_0x4dae('0xb0')](function(){return db[_0x4dae('0xb1')][_0x4dae('0xac')]({'attributes':['id',_0x4dae('0x28'),_0x4dae('0x3d')],'where':{'id':_0x2818fc['body'][_0x4dae('0xa8')]}});})['then'](function(_0x56d234){socket[_0x4dae('0xb2')](_0x4dae('0xb3'),{'id':Number(_0x2818fc['params']['id']),'tags':_0x56d234||[]});return{'id':Number(_0x2818fc[_0x4dae('0x9d')]['id']),'tags':_0x56d234||[]};});}})['then'](respondWithResult(_0x1e7ee9,null))[_0x4dae('0x9c')](handleError(_0x1e7ee9,null));};exports[_0x4dae('0xb4')]=function(_0x4a3314,_0x101900,_0x3327ab){return db[_0x4dae('0x30')]['find']({'where':{'id':_0x4a3314[_0x4dae('0x9d')]['id']}})[_0x4dae('0x25')](handleEntityNotFound(_0x101900,null))[_0x4dae('0x25')](function(_0x3b3c33){if(_0x3b3c33){return _0x3b3c33[_0x4dae('0xb4')](_0x4a3314[_0x4dae('0x34')]['ids']);}})[_0x4dae('0x25')](respondWithStatusCode(_0x101900,null))[_0x4dae('0x9c')](handleError(_0x101900,null));};exports['download']=function(_0x4ba58f,_0x5d07b6){var _0x430399=moment()[_0x4dae('0xb5')]()[_0x4dae('0x70')]();var _0x358434=path['join'](config[_0x4dae('0xb6')],_0x4dae('0xb7'),_0x4dae('0xb8'),_0x4dae('0xb9'));var _0x3b5ce2=path['join'](config['root'],'server','files',_0x4dae('0xba'));var _0x5764b8=path['join'](_0x358434,_0x430399);var _0x48183c=util[_0x4dae('0x51')](_0x4dae('0xbb'),_0x4ba58f[_0x4dae('0x9d')]['id'],_0x430399);var _0xb3a8aa=path['join'](_0x358434,_0x48183c);var _0x561086=![];return db[_0x4dae('0x30')][_0x4dae('0xa1')]({'where':{'id':_0x4ba58f['params']['id']},'include':[{'model':db[_0x4dae('0xa7')],'as':'Messages','attributes':['id',_0x4dae('0xa3'),'createdAt',_0x4dae('0xbc'),'secret'],'include':[{'model':db['User'],'as':_0x4dae('0xbd'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0x4dae('0xbe')],'as':_0x4dae('0xbf'),'attributes':['id',_0x4dae('0xc0'),'lastName'],'raw':!![]},{'model':db[_0x4dae('0xc1')],'as':_0x4dae('0xc1'),'raw':!![]}]},{'model':db[_0x4dae('0xc2')],'as':_0x4dae('0xc3'),'attributes':['id',_0x4dae('0x28')]},{'model':db[_0x4dae('0xbd')],'as':_0x4dae('0xc4'),'attributes':['id',_0x4dae('0xc5')]}]})['then'](handleEntityNotFound(_0x5d07b6,null))[_0x4dae('0x25')](function(_0xed5922){if(_0xed5922){var _0xc6ef7c=_0xed5922[_0x4dae('0xc6')]({'plain':!![]});_0x561086=!![];var _0x3a6c5f={'format':'A4','border':_0x4dae('0xc7'),'header':{'height':'40px','contents':{'first':_0x4dae('0xc8')}},'footer':{'height':'30px','contents':{'default':util['format'](_0x4dae('0xc9'),util['format'](_0x4dae('0xca'),'Openchannel',_0xc6ef7c['id']),moment()[_0x4dae('0x51')](_0x4dae('0xcb'))[_0x4dae('0x70')]())}}};fs[_0x4dae('0xcc')](_0x5764b8);var _0x197f04={'channel':'Openchannel','account':_0xc6ef7c[_0x4dae('0xc3')][_0x4dae('0x28')],'agent':_0xc6ef7c['Owner']?_0xc6ef7c['Owner'][_0x4dae('0xc5')]:_0x4dae('0xcd'),'createdAt':moment(_0xc6ef7c[_0x4dae('0x4e')])[_0x4dae('0x51')](_0x4dae('0xaa'))[_0x4dae('0x70')](),'closedAt':_0xc6ef7c[_0x4dae('0xce')]?moment(_0xc6ef7c[_0x4dae('0xcf')])[_0x4dae('0x51')](_0x4dae('0xaa'))['toString']():'','disposition':_0xc6ef7c['disposition'],'visibility':_0xc6ef7c[_0x4dae('0xd0')]?'Public':_0x4dae('0xd1'),'messages':_(_0xc6ef7c['Messages'])[_0x4dae('0x66')]({'secret':![]})[_0x4dae('0x2a')](function(_0x5a3b0d){if(_0x5a3b0d[_0x4dae('0xc1')]){var _0x307454=path[_0x4dae('0xd2')](_0x3b5ce2,_0x5a3b0d[_0x4dae('0xc1')]['basename']);if(fs[_0x4dae('0xd3')](_0x307454)){fs['createReadStream'](_0x307454)[_0x4dae('0xd4')](fs[_0x4dae('0xd5')](path[_0x4dae('0xd2')](_0x5764b8,_0x5a3b0d[_0x4dae('0xc1')][_0x4dae('0xd6')])));}}return{'date':moment(_0x5a3b0d['createdAt'])[_0x4dae('0x51')](_0x4dae('0xaa'))[_0x4dae('0x70')](),'sender':_0x5a3b0d[_0x4dae('0xbc')]===_0x4dae('0xd7')?_0x5a3b0d[_0x4dae('0xbd')]?_0x5a3b0d[_0x4dae('0xbd')][_0x4dae('0xc5')]:'System':_0x5a3b0d['Contact'][_0x4dae('0xc0')]+(_0x5a3b0d['Contact'][_0x4dae('0xd8')]?'\x20'+_0x5a3b0d[_0x4dae('0xbf')][_0x4dae('0xd8')]:''),'body':_0x5a3b0d[_0x4dae('0xc1')]?_0x5a3b0d[_0x4dae('0xc1')][_0x4dae('0xd6')]:_0x5a3b0d[_0x4dae('0xa3')],'direction':_0x5a3b0d[_0x4dae('0xbc')]==='out'?'A':'C','secret':_0x5a3b0d[_0x4dae('0xd9')],'attachment':_0x5a3b0d['Attachment']};})[_0x4dae('0x58')]()};return ejs[_0x4dae('0xda')](path[_0x4dae('0xd2')](config[_0x4dae('0xb6')],_0x4dae('0xb7'),_0x4dae('0xdb'),'downloadInteraction.html'),{'interaction':_0x197f04})[_0x4dae('0x25')](function(_0x5c387d){return new BPromise(function(_0x4aee46,_0x4301ed){pdf[_0x4dae('0xa2')](_0x5c387d,_0x3a6c5f)['toFile'](path[_0x4dae('0xd2')](_0x5764b8,_0x4dae('0xdc')+_0xc6ef7c['id']+'-'+_0x430399+_0x4dae('0xdd')),function(_0x523c84,_0x561f70){if(_0x523c84)return _0x4301ed(_0x523c84);_0x4aee46(_0x561f70);});});});}})['then'](function(){if(_0x561086){return new BPromise(function(_0x190d5a,_0x5e4b68){zipdir(_0x5764b8,{'saveTo':_0xb3a8aa},function(_0x89a268,_0x32f470){if(_0x89a268)return _0x5e4b68(_0x89a268);return _0x190d5a(_0x32f470);});})[_0x4dae('0x25')](function(){return new BPromise(function(_0x391f74,_0x15ec01){rimraf(_0x5764b8,function(_0xd8fb6){if(_0xd8fb6)_0x15ec01(_0xd8fb6);return _0x391f74();});});})[_0x4dae('0x25')](function(){return _0x5d07b6[_0x4dae('0xde')](_0xb3a8aa,_0x48183c,function(_0x21213c){if(_0x21213c){console[_0x4dae('0xdf')](_0x4dae('0xe0'),_0x21213c);}else{fs[_0x4dae('0xe1')](_0xb3a8aa);}});});}else{return _0x5d07b6[_0x4dae('0xe2')](0xc8);}})['catch'](handleError(_0x5d07b6,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 9ee5f84..5a194a5 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 _0x6aac=['hasOwnProperty','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0xec778e,_0x354656){var _0x1b1e1d=function(_0x274f22){while(--_0x274f22){_0xec778e['push'](_0xec778e['shift']());}};_0x1b1e1d(++_0x354656);}(_0x6aac,0x145));var _0xc6aa=function(_0x1e32cf,_0x2a6f3c){_0x1e32cf=_0x1e32cf-0x0;var _0x4689d4=_0x6aac[_0x1e32cf];return _0x4689d4;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xc6aa('0x0'))['db'][_0xc6aa('0x1')];var OpenchannelMessage=require('../../mysqldb')['db'][_0xc6aa('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc6aa('0x3'),'afterUpdate':_0xc6aa('0x4'),'afterDestroy':_0xc6aa('0x5')};function emitEvent(_0x4a1953){return function(_0x3614c1,_0x11f8f2,_0x16b492){_0x3614c1[_0xc6aa('0x6')]({'attributes':['id'],'raw':!![]})[_0xc6aa('0x7')](function(_0x362ee6){_0x3614c1[_0xc6aa('0x8')](_0xc6aa('0x9'),_0x362ee6[_0xc6aa('0xa')](function(_0x4a94bf){return{'id':_0x4a94bf['id']};}));return OpenchannelMessage[_0xc6aa('0xb')]({'where':{'OpenchannelInteractionId':_0x3614c1['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc6aa('0x7')](function(_0x1e6d28){_0x3614c1['setDataValue'](_0xc6aa('0xc'),_0x1e6d28[_0xc6aa('0xd')]);OpenchannelInteractionEvents[_0xc6aa('0xe')](_0x4a1953+':'+_0x3614c1['id'],_0x3614c1);OpenchannelInteractionEvents['emit'](_0x4a1953,_0x3614c1);_0x16b492(null);})['catch'](_0x16b492(null));};}for(var e in events){if(events[_0xc6aa('0xf')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xc6aa('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xc80d=['hasOwnProperty','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch'];(function(_0x223bc8,_0x171ddd){var _0x100d76=function(_0xf2a51d){while(--_0xf2a51d){_0x223bc8['push'](_0x223bc8['shift']());}};_0x100d76(++_0x171ddd);}(_0xc80d,0x121));var _0xdc80=function(_0x58142c,_0x39935a){_0x58142c=_0x58142c-0x0;var _0x4c69aa=_0xc80d[_0x58142c];return _0x4c69aa;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xdc80('0x0'))['db'][_0xdc80('0x1')];var OpenchannelMessage=require(_0xdc80('0x0'))['db'][_0xdc80('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xdc80('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdc80('0x4'),'afterDestroy':_0xdc80('0x5')};function emitEvent(_0x4a76a6){return function(_0x13d06a,_0x3e6db0,_0x2178e8){_0x13d06a[_0xdc80('0x6')]({'attributes':['id'],'raw':!![]})[_0xdc80('0x7')](function(_0x5c2c83){_0x13d06a[_0xdc80('0x8')](_0xdc80('0x9'),_0x5c2c83[_0xdc80('0xa')](function(_0x4e9030){return{'id':_0x4e9030['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x13d06a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdc80('0x7')](function(_0x4523a5){_0x13d06a[_0xdc80('0x8')](_0xdc80('0xb'),_0x4523a5[_0xdc80('0xc')]);OpenchannelInteractionEvents[_0xdc80('0xd')](_0x4a76a6+':'+_0x13d06a['id'],_0x13d06a);OpenchannelInteractionEvents[_0xdc80('0xd')](_0x4a76a6,_0x13d06a);_0x2178e8(null);})[_0xdc80('0xe')](_0x2178e8(null));};}for(var e in events){if(events[_0xdc80('0xf')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index b9fddc9..997a459 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 _0x6fad=['api','bluebird','path','rimraf','../../config/environment','./openchannelInteraction.attributes','define','OpenchannelInteraction','changed','closed','closedAt','format','lodash','util','../../config/logger'];(function(_0x9c8058,_0x4f2895){var _0x54190d=function(_0x2404cf){while(--_0x2404cf){_0x9c8058['push'](_0x9c8058['shift']());}};_0x54190d(++_0x4f2895);}(_0x6fad,0x174));var _0xd6fa=function(_0x5648ca,_0x4728bf){_0x5648ca=_0x5648ca-0x0;var _0x4e06f9=_0x6fad[_0x5648ca];return _0x4e06f9;};'use strict';var _=require(_0xd6fa('0x0'));var util=require(_0xd6fa('0x1'));var logger=require(_0xd6fa('0x2'))(_0xd6fa('0x3'));var moment=require('moment');var BPromise=require(_0xd6fa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6fa('0x5'));var rimraf=require(_0xd6fa('0x6'));var config=require(_0xd6fa('0x7'));var attributes=require(_0xd6fa('0x8'));module['exports']=function(_0x45dad4,_0x329390){return _0x45dad4[_0xd6fa('0x9')](_0xd6fa('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1d2aaa,_0x566a11,_0x92911b){if(_0x1d2aaa[_0xd6fa('0xb')](_0xd6fa('0xc'))){_0x1d2aaa[_0xd6fa('0xd')]=moment()[_0xd6fa('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x92911b(null,_0x1d2aaa);}}});}; \ No newline at end of file +var _0x9de3=['../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x33849b,_0x5c8cfc){var _0x10bced=function(_0x1f605){while(--_0x1f605){_0x33849b['push'](_0x33849b['shift']());}};_0x10bced(++_0x5c8cfc);}(_0x9de3,0xea));var _0x39de=function(_0x8013ba,_0x5a7989){_0x8013ba=_0x8013ba-0x0;var _0xc9b8b7=_0x9de3[_0x8013ba];return _0xc9b8b7;};'use strict';var _=require(_0x39de('0x0'));var util=require('util');var logger=require(_0x39de('0x1'))(_0x39de('0x2'));var moment=require(_0x39de('0x3'));var BPromise=require('bluebird');var rp=require(_0x39de('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x39de('0x5'));var config=require(_0x39de('0x6'));var attributes=require(_0x39de('0x7'));module[_0x39de('0x8')]=function(_0x529524,_0x2e8f82){return _0x529524[_0x39de('0x9')](_0x39de('0xa'),attributes,{'tableName':_0x39de('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2604fa,_0x59ce28,_0x4e7204){if(_0x2604fa['changed'](_0x39de('0xc'))){_0x2604fa[_0x39de('0xd')]=moment()[_0x39de('0xe')](_0x39de('0xf'));}_0x4e7204(null,_0x2604fa);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index e2acdfa..5a187e7 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 _0x71ab=['message','OpenchannelInteraction,\x20%s,\x20%s','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','options','raw','where','attributes','limit','debug','AddTagsToOpenchannelInteraction','find','body','omit','spread','AddTags','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','request\x20sent','stringify','error'];(function(_0x2b77d0,_0x11f932){var _0x3b1d83=function(_0x27b661){while(--_0x27b661){_0x2b77d0['push'](_0x2b77d0['shift']());}};_0x3b1d83(++_0x11f932);}(_0x71ab,0x64));var _0xb71a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x71ab[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var moment=require('moment');var BPromise=require(_0xb71a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb71a('0x2'));var db=require(_0xb71a('0x3'))['db'];var utils=require(_0xb71a('0x4'));var logger=require(_0xb71a('0x5'))(_0xb71a('0x6'));var config=require(_0xb71a('0x7'));var jayson=require(_0xb71a('0x8'));var client=jayson[_0xb71a('0x9')][_0xb71a('0xa')]({'port':0x232a});config[_0xb71a('0xb')]=_[_0xb71a('0xc')](config[_0xb71a('0xb')],{'host':_0xb71a('0xd'),'port':0x18eb});var socket=require(_0xb71a('0xe'))(new Redis(config[_0xb71a('0xb')]));require(_0xb71a('0xf'))[_0xb71a('0x10')](socket);function respondWithRpcPromise(_0x2e8883,_0x517eed,_0xfec897){return new BPromise(function(_0x58956d,_0x3d7bd7){return client[_0xb71a('0x11')](_0x2e8883,_0xfec897)[_0xb71a('0x12')](function(_0x591311){logger[_0xb71a('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x517eed,_0xb71a('0x14'));logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x517eed,_0xb71a('0x14'),JSON[_0xb71a('0x15')](_0x591311));if(_0x591311[_0xb71a('0x16')]){if(_0x591311[_0xb71a('0x16')]['code']===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x517eed,_0x591311[_0xb71a('0x16')][_0xb71a('0x17')]);return _0x3d7bd7(_0x591311[_0xb71a('0x16')][_0xb71a('0x17')]);}logger[_0xb71a('0x16')](_0xb71a('0x18'),_0x517eed,_0x591311[_0xb71a('0x16')][_0xb71a('0x17')]);return _0x58956d(_0x591311[_0xb71a('0x16')]['message']);}else{logger[_0xb71a('0x13')](_0xb71a('0x18'),_0x517eed,_0xb71a('0x14'));_0x58956d(_0x591311[_0xb71a('0x19')][_0xb71a('0x17')]);}})[_0xb71a('0x1a')](function(_0x349de1){logger[_0xb71a('0x16')](_0xb71a('0x18'),_0x517eed,_0x349de1);_0x3d7bd7(_0x349de1);});});}exports[_0xb71a('0x1b')]=function(_0x16394a){var _0x494899=this;return new Promise(function(_0x5bb77a,_0x1358f2){return db[_0xb71a('0x1c')]['update'](_0x16394a['body'],{'raw':_0x16394a[_0xb71a('0x1d')]?_0x16394a['options'][_0xb71a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16394a[_0xb71a('0x1d')]?_0x16394a[_0xb71a('0x1d')][_0xb71a('0x1f')]||null:null,'attributes':_0x16394a[_0xb71a('0x1d')]?_0x16394a[_0xb71a('0x1d')][_0xb71a('0x20')]||null:null,'limit':_0x16394a[_0xb71a('0x1d')]?_0x16394a['options'][_0xb71a('0x21')]||null:null})[_0xb71a('0x12')](function(_0x353930){logger[_0xb71a('0x13')](_0xb71a('0x1b'),_0x16394a);logger[_0xb71a('0x22')](_0xb71a('0x1b'),_0x16394a,JSON[_0xb71a('0x15')](_0x353930));_0x5bb77a(_0x353930);})[_0xb71a('0x1a')](function(_0x2a847a){logger[_0xb71a('0x16')](_0xb71a('0x1b'),_0x2a847a[_0xb71a('0x17')],_0x16394a);_0x1358f2(_0x494899['error'](0x1f4,_0x2a847a[_0xb71a('0x17')]));});});};exports[_0xb71a('0x23')]=function(_0x1689ce){return new Promise(function(_0x358954,_0x2fbd73){return db[_0xb71a('0x1c')][_0xb71a('0x24')]({'where':_0x1689ce[_0xb71a('0x1d')]?_0x1689ce[_0xb71a('0x1d')][_0xb71a('0x1f')]||null:null})[_0xb71a('0x12')](function(_0x542ffd){if(_0x542ffd){return _0x542ffd['addTags'](_0x1689ce[_0xb71a('0x25')]['ids'],_[_0xb71a('0x26')](_0x1689ce[_0xb71a('0x25')],['ids','id'])||{});}})[_0xb71a('0x27')](function(_0xa42f25){logger[_0xb71a('0x13')](_0xb71a('0x28'),_0x1689ce);logger[_0xb71a('0x22')](_0xb71a('0x28'),_0x1689ce,JSON['stringify'](_0xa42f25));_0x358954(_0xa42f25);})[_0xb71a('0x1a')](function(_0x3f137a){logger[_0xb71a('0x16')](_0xb71a('0x28'),_0x3f137a['message'],_0x1689ce);_0x2fbd73(_this[_0xb71a('0x16')](0x1f4,_0x3f137a[_0xb71a('0x17')]));});});}; \ No newline at end of file +var _0x1261=['../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelInteraction','options','raw','where','attributes','then','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','body','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x1261,0x144));var _0x1126=function(_0x34bbd5,_0x3c810a){_0x34bbd5=_0x34bbd5-0x0;var _0x46244f=_0x1261[_0x34bbd5];return _0x46244f;};'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});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['UpdateOpenchannelInteraction']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['update'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22ed37[_0x1126('0x1a')]?_0x22ed37['options'][_0x1126('0x1c')]||null:null,'attributes':_0x22ed37[_0x1126('0x1a')]?_0x22ed37['options'][_0x1126('0x1d')]||null:null,'limit':_0x22ed37['options']?_0x22ed37['options']['limit']||null:null})[_0x1126('0x1e')](function(_0x15bcc3){logger[_0x1126('0x17')](_0x1126('0x1f'),_0x22ed37);logger[_0x1126('0x11')](_0x1126('0x1f'),_0x22ed37,JSON[_0x1126('0x13')](_0x15bcc3));_0x2f70ac(_0x15bcc3);})[_0x1126('0x18')](function(_0x589725){logger[_0x1126('0x14')](_0x1126('0x1f'),_0x589725[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19['error'](0x1f4,_0x589725['message']));});});};exports[_0x1126('0x20')]=function(_0x39bf0e){return new Promise(function(_0x55e195,_0x2fb797){return db[_0x1126('0x19')]['find']({'where':_0x39bf0e[_0x1126('0x1a')]?_0x39bf0e['options'][_0x1126('0x1c')]||null:null})['then'](function(_0x771bb8){if(_0x771bb8){return _0x771bb8['addTags'](_0x39bf0e[_0x1126('0x21')]['ids'],_['omit'](_0x39bf0e['body'],[_0x1126('0x22'),'id'])||{});}})[_0x1126('0x23')](function(_0x1cef48){logger['info'](_0x1126('0x24'),_0x39bf0e);logger[_0x1126('0x11')]('AddTags',_0x39bf0e,JSON[_0x1126('0x13')](_0x1cef48));_0x55e195(_0x1cef48);})[_0x1126('0x18')](function(_0x2d8127){logger[_0x1126('0x14')]('AddTags',_0x2d8127['message'],_0x39bf0e);_0x2fb797(_this[_0x1126('0x14')](0x1f4,_0x2d8127[_0x1126('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 4599550..7e81abd 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 _0x12cb=['openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit','removeListener','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x12cb,0x88));var _0xb12c=function(_0x557d2e,_0x3b609e){_0x557d2e=_0x557d2e-0x0;var _0x1e52c6=_0x12cb[_0x557d2e];return _0x1e52c6;};'use strict';var OpenchannelInteractionEvents=require(_0xb12c('0x0'));var events=[_0xb12c('0x1'),_0xb12c('0x2'),_0xb12c('0x3')];function createListener(_0x1afca8,_0x4b0fd8){return function(_0x2332b6){_0x4b0fd8[_0xb12c('0x4')](_0x1afca8,_0x2332b6);};}function removeListener(_0x1ea435,_0x271546){return function(){OpenchannelInteractionEvents[_0xb12c('0x5')](_0x1ea435,_0x271546);};}exports[_0xb12c('0x6')]=function(_0x39e5f0){for(var _0x2bd739=0x0,_0x1d6501=events[_0xb12c('0x7')];_0x2bd739<_0x1d6501;_0x2bd739++){var _0x150513=events[_0x2bd739];var _0x51342a=createListener(_0xb12c('0x8')+_0x150513,_0x39e5f0);OpenchannelInteractionEvents['on'](_0x150513,_0x51342a);}}; \ No newline at end of file +var _0x608e=['openchannelInteraction:','./openchannelInteraction.events','remove','update','removeListener','length'];(function(_0x2997ea,_0x1e25e0){var _0x4a6c39=function(_0x12d7c7){while(--_0x12d7c7){_0x2997ea['push'](_0x2997ea['shift']());}};_0x4a6c39(++_0x1e25e0);}(_0x608e,0x16f));var _0xe608=function(_0x12cf5d,_0x140a8a){_0x12cf5d=_0x12cf5d-0x0;var _0x23091d=_0x608e[_0x12cf5d];return _0x23091d;};'use strict';var OpenchannelInteractionEvents=require(_0xe608('0x0'));var events=['save',_0xe608('0x1'),_0xe608('0x2')];function createListener(_0x1df8c4,_0x15c7b1){return function(_0x4cb0db){_0x15c7b1['emit'](_0x1df8c4,_0x4cb0db);};}function removeListener(_0x4a0078,_0x9e02b2){return function(){OpenchannelInteractionEvents[_0xe608('0x3')](_0x4a0078,_0x9e02b2);};}exports['register']=function(_0x4580a7){for(var _0x2fb455=0x0,_0x7f9fcf=events[_0xe608('0x4')];_0x2fb455<_0x7f9fcf;_0x2fb455++){var _0x13e14c=events[_0x2fb455];var _0x326fd7=createListener(_0xe608('0x5')+_0x13e14c,_0x4580a7);OpenchannelInteractionEvents['on'](_0x13e14c,_0x326fd7);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index b1c2e3a..50c7b2f 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 _0xc212=['/:id','show','post','openchannel','openchannelmessage:create','create','put','update','accept','/:id/reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','/describe'];(function(_0x13b1ee,_0x17dc6c){var _0x3b76e6=function(_0x2120b9){while(--_0x2120b9){_0x13b1ee['push'](_0x13b1ee['shift']());}};_0x3b76e6(++_0x17dc6c);}(_0xc212,0x175));var _0x2c21=function(_0x4b8d1d,_0x137725){_0x4b8d1d=_0x4b8d1d-0x0;var _0x198292=_0xc212[_0x4b8d1d];return _0x198292;};'use strict';var multer=require(_0x2c21('0x0'));var util=require('util');var path=require(_0x2c21('0x1'));var timeout=require(_0x2c21('0x2'));var express=require(_0x2c21('0x3'));var router=express[_0x2c21('0x4')]();var auth=require(_0x2c21('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2c21('0x6'));var controller=require(_0x2c21('0x7'));router[_0x2c21('0x8')]('/',auth[_0x2c21('0x9')](),controller['index']);router[_0x2c21('0x8')](_0x2c21('0xa'),auth[_0x2c21('0x9')](),controller['describe']);router['get'](_0x2c21('0xb'),auth[_0x2c21('0x9')](),controller[_0x2c21('0xc')]);router[_0x2c21('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x2c21('0xe'),_0x2c21('0xf')),controller[_0x2c21('0x10')]);router[_0x2c21('0x11')](_0x2c21('0xb'),auth[_0x2c21('0x9')](),controller[_0x2c21('0x12')]);router[_0x2c21('0x11')]('/:id/accept',auth[_0x2c21('0x9')](),controller[_0x2c21('0x13')]);router[_0x2c21('0x11')](_0x2c21('0x14'),auth[_0x2c21('0x9')](),controller['reject']);router[_0x2c21('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x2c21('0x16')]);module[_0x2c21('0x17')]=router; \ No newline at end of file +var _0x0298=['isAuthenticated','index','/describe','describe','/:id','show','tracked','openchannel','openchannelmessage:create','create','put','/:id/accept','accept','/:id/reject','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x4243a5,_0x463882){var _0x6bea5b=function(_0x473b3f){while(--_0x473b3f){_0x4243a5['push'](_0x4243a5['shift']());}};_0x6bea5b(++_0x463882);}(_0x0298,0x74));var _0x8029=function(_0xc9275e,_0x4cc1ba){_0xc9275e=_0xc9275e-0x0;var _0x5162d4=_0x0298[_0xc9275e];return _0x5162d4;};'use strict';var multer=require(_0x8029('0x0'));var util=require(_0x8029('0x1'));var path=require('path');var timeout=require(_0x8029('0x2'));var express=require('express');var router=express[_0x8029('0x3')]();var auth=require(_0x8029('0x4'));var interaction=require(_0x8029('0x5'));var config=require(_0x8029('0x6'));var controller=require(_0x8029('0x7'));router[_0x8029('0x8')]('/',auth[_0x8029('0x9')](),controller[_0x8029('0xa')]);router['get'](_0x8029('0xb'),auth[_0x8029('0x9')](),controller[_0x8029('0xc')]);router[_0x8029('0x8')](_0x8029('0xd'),auth[_0x8029('0x9')](),controller[_0x8029('0xe')]);router['post']('/',auth[_0x8029('0x9')](),interaction[_0x8029('0xf')](_0x8029('0x10'),_0x8029('0x11')),controller[_0x8029('0x12')]);router[_0x8029('0x13')](_0x8029('0xd'),auth[_0x8029('0x9')](),controller['update']);router[_0x8029('0x13')](_0x8029('0x14'),auth[_0x8029('0x9')](),controller[_0x8029('0x15')]);router[_0x8029('0x13')](_0x8029('0x16'),auth[_0x8029('0x9')](),controller['reject']);router['delete'](_0x8029('0xd'),auth[_0x8029('0x9')](),controller[_0x8029('0x17')]);module[_0x8029('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 2a2702a..64dee00 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 _0xa31a=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xa31a,0x11f));var _0xaa31=function(_0x154efd,_0x27c90d){_0x154efd=_0x154efd-0x0;var _0x331e99=_0xa31a[_0x154efd];return _0x331e99;};'use strict';var Sequelize=require('sequelize');module[_0xaa31('0x0')]={'body':{'type':Sequelize[_0xaa31('0x1')](_0xaa31('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xaa31('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xaa31('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xaa31('0x4')]('in',_0xaa31('0x5')),'defaultValue':_0xaa31('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xaa31('0x6')]}}; \ No newline at end of file +var _0x9b78=['medium','BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9b78,0x14d));var _0x89b7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9b78[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x89b7('0x0'));module[_0x89b7('0x1')]={'body':{'type':Sequelize[_0x89b7('0x2')](_0x89b7('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x89b7('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x89b7('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x89b7('0x5')]('in','out'),'defaultValue':_0x89b7('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x89b7('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 0775099..14830ed 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 _0x524e=['ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','test','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','Content-Range','apply','reject','destroy','stack','name','index','OpenchannelMessage','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','merge','map','key','VIRTUAL','field','filter','options','count','includeAll','include','findAll','find','create','update','body','params','describe','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','acceptMessage','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x2029e8,_0x228f42){var _0x1ef458=function(_0x4fee8b){while(--_0x4fee8b){_0x2029e8['push'](_0x2029e8['shift']());}};_0x1ef458(++_0x228f42);}(_0x524e,0x15e));var _0xe524=function(_0x3590e2,_0x17aa97){_0x3590e2=_0x3590e2-0x0;var _0x508c51=_0x524e[_0x3590e2];return _0x508c51;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe524('0x0'));var zipdir=require(_0xe524('0x1'));var jsonpatch=require(_0xe524('0x2'));var rp=require(_0xe524('0x3'));var moment=require(_0xe524('0x4'));var BPromise=require(_0xe524('0x5'));var Mustache=require(_0xe524('0x6'));var util=require(_0xe524('0x7'));var path=require(_0xe524('0x8'));var sox=require(_0xe524('0x9'));var csv=require('to-csv');var ejs=require(_0xe524('0xa'));var fs=require('fs');var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0xf'));var querystring=require(_0xe524('0x10'));var Papa=require(_0xe524('0x11'));var Redis=require(_0xe524('0x12'));var authService=require(_0xe524('0x13'));var qs=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var db=require(_0xe524('0x1a'))['db'];config[_0xe524('0x1b')]=_[_0xe524('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe524('0x1d'))(new Redis(config[_0xe524('0x1b')]));require(_0xe524('0x1e'))[_0xe524('0x1f')](socket);var jayson=require(_0xe524('0x20'));var client=jayson['client'][_0xe524('0x21')]({'port':0x232c});var client9002=jayson['client'][_0xe524('0x21')]({'port':0x232a});function checkPasswordPattern(_0x1b0af6,_0x48165e,_0x569660){if(_0x569660){var _0x488fce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x488fce[_0xe524('0x22')](_0x48165e)){return _0x1b0af6;}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 _0x1b0af6;}}function respondWithRpcPromise(_0x29a031,_0x5f17fe,_0x5c8736,_0x5a5c0d){return new BPromise(function(_0x3a4027,_0x4f1dfb){var _0x11b2a1=_0x5a5c0d||client;return _0x11b2a1[_0xe524('0x23')](_0x29a031,_0x5c8736)[_0xe524('0x24')](function(_0x209d0b){logger['info'](_0xe524('0x25'),_0x5f17fe,_0xe524('0x26'));logger['debug'](_0xe524('0x27'),_0x5f17fe,_0xe524('0x26'),JSON[_0xe524('0x28')](_0x209d0b));if(_0x209d0b[_0xe524('0x29')]){if(_0x209d0b[_0xe524('0x29')][_0xe524('0x2a')]===0x1f4){logger[_0xe524('0x29')](_0xe524('0x25'),_0x5f17fe,_0x209d0b[_0xe524('0x29')]['message']);return _0x4f1dfb(_0x209d0b[_0xe524('0x29')]['message']);}logger['error'](_0xe524('0x25'),_0x5f17fe,_0x209d0b[_0xe524('0x29')][_0xe524('0x2b')]);return _0x3a4027(_0x209d0b[_0xe524('0x29')]['message']);}else{logger[_0xe524('0x2c')]('OpenchannelMessage,\x20%s,\x20%s',_0x5f17fe,_0xe524('0x26'));_0x3a4027(_0x209d0b[_0xe524('0x2d')][_0xe524('0x2b')]);}})[_0xe524('0x2e')](function(_0x4102d9){logger[_0xe524('0x29')](_0xe524('0x25'),_0x5f17fe,_0x4102d9);_0x4f1dfb(_0x4102d9);});});}function respondWithStatusCode(_0x583cc3,_0x58a896){_0x58a896=_0x58a896||0xcc;return function(_0x283f18){if(_0x283f18){return _0x583cc3[_0xe524('0x2f')](_0x58a896);}return _0x583cc3[_0xe524('0x30')](_0x58a896)[_0xe524('0x31')]();};}function respondWithResult(_0x359c8b,_0x5405e4){_0x5405e4=_0x5405e4||0xc8;return function(_0x52f140){if(_0x52f140){return _0x359c8b[_0xe524('0x30')](_0x5405e4)[_0xe524('0x32')](_0x52f140);}};}function respondWithFilteredResult(_0x3aedd9,_0x8070e4){return function(_0x25c0a1){if(_0x25c0a1){var _0x517fa0=_0x25c0a1['count'],_0x365a1f=_0x8070e4[_0xe524('0x33')],_0x9a7e98=_0x8070e4[_0xe524('0x33')]+_0x8070e4['limit'],_0x4a4e15;if(_0x9a7e98>=_0x517fa0){_0x9a7e98=_0x517fa0;_0x4a4e15=0xc8;}else{_0x4a4e15=0xce;}_0x3aedd9[_0xe524('0x30')](_0x4a4e15);return _0x3aedd9['set'](_0xe524('0x34'),_0x365a1f+'-'+_0x9a7e98+'/'+_0x517fa0)['json'](_0x25c0a1);}return null;};}function patchUpdates(_0x315e56){return function(_0x330162){try{jsonpatch[_0xe524('0x35')](_0x330162,_0x315e56,!![]);}catch(_0x5600d2){return BPromise[_0xe524('0x36')](_0x5600d2);}return _0x330162['save']();};}function saveUpdates(_0xdbdf53,_0x16eff9){return function(_0x276343){if(_0x276343){return _0x276343['update'](_0xdbdf53)[_0xe524('0x24')](function(_0x119cc3){return _0x119cc3;});}return null;};}function removeEntity(_0x49c43e,_0x27817e){return function(_0x2852b9){if(_0x2852b9){return _0x2852b9[_0xe524('0x37')]()[_0xe524('0x24')](function(){_0x49c43e['status'](0xcc)[_0xe524('0x31')]();});}};}function handleEntityNotFound(_0xcf8060,_0x615b5e){return function(_0x13cda8){if(!_0x13cda8){_0xcf8060[_0xe524('0x2f')](0x194);}return _0x13cda8;};}function handleError(_0x369073,_0x2741e8){_0x2741e8=_0x2741e8||0x1f4;return function(_0x2bc477){logger['error'](_0x2bc477[_0xe524('0x38')]);if(_0x2bc477['name']){delete _0x2bc477[_0xe524('0x39')];}_0x369073[_0xe524('0x30')](_0x2741e8)['send'](_0x2bc477);};}exports[_0xe524('0x3a')]=function(_0x5b47ce,_0x1c3aae){var _0x41af26={},_0x38758e={},_0x3103e9={'count':0x0,'rows':[]};var _0x82a87b=db[_0xe524('0x3b')][_0xe524('0x3c')];_0x38758e[_0xe524('0x3d')]=_['keys'](_0x82a87b);_0x38758e[_0xe524('0x3e')]=_[_0xe524('0x3f')](_0x5b47ce[_0xe524('0x3e')]);_0x38758e[_0xe524('0x40')]=_[_0xe524('0x41')](_0x38758e[_0xe524('0x3d')],_0x38758e[_0xe524('0x3e')]);_0x41af26[_0xe524('0x42')]=_['intersection'](_0x38758e[_0xe524('0x3d')],qs[_0xe524('0x43')](_0x5b47ce[_0xe524('0x3e')]['fields']));_0x41af26[_0xe524('0x42')]=_0x41af26['attributes'][_0xe524('0x44')]?_0x41af26[_0xe524('0x42')]:_0x38758e[_0xe524('0x3d')];if(!_0x5b47ce[_0xe524('0x3e')][_0xe524('0x45')](_0xe524('0x46'))){_0x41af26[_0xe524('0x47')]=qs['limit'](_0x5b47ce[_0xe524('0x3e')][_0xe524('0x47')]);_0x41af26[_0xe524('0x33')]=qs[_0xe524('0x33')](_0x5b47ce[_0xe524('0x3e')][_0xe524('0x33')]);}_0x41af26['order']=qs[_0xe524('0x48')](_0x5b47ce[_0xe524('0x3e')][_0xe524('0x48')]);_0x41af26['where']=qs[_0xe524('0x40')](_['pick'](_0x5b47ce['query'],_0x38758e[_0xe524('0x40')]));if(_0x5b47ce[_0xe524('0x3e')]['filter']){_0x41af26[_0xe524('0x49')]=_[_0xe524('0x4a')](_0x41af26[_0xe524('0x49')],{'$or':_[_0xe524('0x4b')](_0x82a87b,function(_0x53d94b){if(_0x53d94b['type'][_0xe524('0x4c')]!==_0xe524('0x4d')){var _0x53c204={};_0x53c204[_0x53d94b[_0xe524('0x4e')]]={'$like':'%'+_0x5b47ce['query'][_0xe524('0x4f')]+'%'};return _0x53c204;}})});}_0x41af26=_[_0xe524('0x4a')]({},_0x41af26,_0x5b47ce[_0xe524('0x50')]);var _0x312c47={'where':_0x41af26[_0xe524('0x49')]};return db[_0xe524('0x3b')][_0xe524('0x51')](_0x312c47)[_0xe524('0x24')](function(_0x1642a7){_0x3103e9[_0xe524('0x51')]=_0x1642a7;if(_0x5b47ce[_0xe524('0x3e')][_0xe524('0x52')]){_0x41af26[_0xe524('0x53')]=[{'all':!![]}];}return db[_0xe524('0x3b')][_0xe524('0x54')](_0x41af26);})['then'](function(_0x53be1f){_0x3103e9['rows']=_0x53be1f;return _0x3103e9;})['then'](respondWithFilteredResult(_0x1c3aae,_0x41af26))[_0xe524('0x2e')](handleError(_0x1c3aae,null));};exports['show']=function(_0x232cf0,_0x15d7ee){var _0x561107={'raw':!![],'where':{'id':_0x232cf0['params']['id']}},_0x20753e={};_0x20753e['model']=_[_0xe524('0x3f')](db[_0xe524('0x3b')][_0xe524('0x3c')]);_0x20753e['query']=_['keys'](_0x232cf0['query']);_0x20753e['filters']=_['intersection'](_0x20753e['model'],_0x20753e[_0xe524('0x3e')]);_0x561107[_0xe524('0x42')]=_['intersection'](_0x20753e[_0xe524('0x3d')],qs[_0xe524('0x43')](_0x232cf0[_0xe524('0x3e')][_0xe524('0x43')]));_0x561107[_0xe524('0x42')]=_0x561107['attributes'][_0xe524('0x44')]?_0x561107[_0xe524('0x42')]:_0x20753e[_0xe524('0x3d')];if(_0x232cf0['query'][_0xe524('0x52')]){_0x561107['include']=[{'all':!![]}];}_0x561107=_[_0xe524('0x4a')]({},_0x561107,_0x232cf0[_0xe524('0x50')]);return db[_0xe524('0x3b')][_0xe524('0x55')](_0x561107)[_0xe524('0x24')](handleEntityNotFound(_0x15d7ee,null))[_0xe524('0x24')](respondWithResult(_0x15d7ee,null))[_0xe524('0x2e')](handleError(_0x15d7ee,null));};exports[_0xe524('0x56')]=function(_0x20bff3,_0x110f2c){return db[_0xe524('0x3b')][_0xe524('0x56')](_0x20bff3['body'],{})['then'](respondWithResult(_0x110f2c,0xc9))['catch'](handleError(_0x110f2c,null));};exports[_0xe524('0x57')]=function(_0x469f67,_0xe7de83){if(_0x469f67[_0xe524('0x58')]['id']){delete _0x469f67[_0xe524('0x58')]['id'];}return db[_0xe524('0x3b')][_0xe524('0x55')]({'where':{'id':_0x469f67[_0xe524('0x59')]['id']}})[_0xe524('0x24')](handleEntityNotFound(_0xe7de83,null))[_0xe524('0x24')](saveUpdates(_0x469f67[_0xe524('0x58')],null))['then'](respondWithResult(_0xe7de83,null))[_0xe524('0x2e')](handleError(_0xe7de83,null));};exports[_0xe524('0x37')]=function(_0x4a5f4a,_0x53da86){return db['OpenchannelMessage']['find']({'where':{'id':_0x4a5f4a[_0xe524('0x59')]['id']}})[_0xe524('0x24')](handleEntityNotFound(_0x53da86,null))[_0xe524('0x24')](removeEntity(_0x53da86,null))[_0xe524('0x2e')](handleError(_0x53da86,null));};exports['describe']=function(_0x4773b4,_0x244f08){return db[_0xe524('0x3b')][_0xe524('0x5a')]()['then'](respondWithResult(_0x244f08,null))['catch'](handleError(_0x244f08,null));};var interaction_log=require('../../config/logger')(_0xe524('0x5b'));exports['accept']=function(_0x357418,_0x1ebb35,_0x3f4201){var _0x287ab8={'channel':_0xe524('0x5c')};if(_0x357418['body']['id']){delete _0x357418['body']['id'];}_0x357418[_0xe524('0x58')][_0xe524('0x5d')]=!![];_0x357418[_0xe524('0x58')][_0xe524('0x5e')]=moment()[_0xe524('0x5f')](_0xe524('0x60'));_0x357418['body'][_0xe524('0x61')]=_0x357418[_0xe524('0x58')][_0xe524('0x61')]||_0x357418['user']['id'];return db[_0xe524('0x3b')][_0xe524('0x55')]({'where':{'id':_0x357418[_0xe524('0x59')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xe524('0x24')](handleEntityNotFound(_0x1ebb35,null))[_0xe524('0x24')](saveUpdates(_0x357418[_0xe524('0x58')],null))[_0xe524('0x24')](function(_0x139a0a){if(_0x139a0a){_0x287ab8['message']=_0x139a0a[_0xe524('0x62')]({'plain':!![]});return db[_0xe524('0x63')][_0xe524('0x55')]({'where':{'id':_0x139a0a[_0xe524('0x64')]}});}return null;})[_0xe524('0x24')](handleEntityNotFound(_0x1ebb35,null))[_0xe524('0x24')](function(_0x35e6b2){if(_0x35e6b2){return _0x35e6b2[_0xe524('0x57')]({'UserId':_0x357418[_0xe524('0x58')][_0xe524('0x61')],'read1stAt':_[_0xe524('0x65')](_0x35e6b2['read1stAt'])?moment()[_0xe524('0x5f')](_0xe524('0x60')):undefined});}return null;})[_0xe524('0x24')](function(_0xfed246){if(_0xfed246){_0x287ab8[_0xe524('0x66')]=_0xfed246['get']({'plain':!![]});interaction_log[_0xe524('0x2c')](_0xe524('0x67'),_0x357418[_0xe524('0x68')]['id'],_0x357418[_0xe524('0x68')][_0xe524('0x39')],_0x357418[_0xe524('0x68')][_0xe524('0x69')],_0x287ab8['interaction']['id'],_0x357418[_0xe524('0x58')]?JSON[_0xe524('0x28')](_0x357418[_0xe524('0x58')]):_0xe524('0x6a'));return respondWithRpcPromise('AcceptMessage',_0xe524('0x6b'),_0x287ab8);}return null;})['then'](function(_0x27b0cb){if(_0x27b0cb){if(_0x357418[_0xe524('0x58')][_0xe524('0x6c')]){_0x287ab8['message'][_0xe524('0x6d')]=util[_0xe524('0x5f')](_0xe524('0x6e'),_0x357418[_0xe524('0x68')][_0xe524('0x39')]);_0x287ab8['message'][_0xe524('0x6f')]=_0x287ab8[_0xe524('0x6f')];_0x287ab8[_0xe524('0x2b')][_0xe524('0x70')]=_0xe524('0x71');return respondWithRpcPromise('EventManager',_0xe524('0x72'),{'event':_0xe524('0x73'),'message':_0x287ab8[_0xe524('0x2b')]},client9002)[_0xe524('0x24')](function(){return _0x287ab8;});}return _0x287ab8;}return null;})[_0xe524('0x24')](respondWithResult(_0x1ebb35,null))[_0xe524('0x2e')](handleError(_0x1ebb35,null));};var interaction_log=require('../../config/logger')(_0xe524('0x5b'));exports[_0xe524('0x36')]=function(_0x1beaa2,_0x492fd3,_0x2a0513){var _0x884a8f={'agent':{},'channel':'openchannel'};if(_0x1beaa2[_0xe524('0x58')]['id']){delete _0x1beaa2[_0xe524('0x58')]['id'];}_0x1beaa2[_0xe524('0x58')][_0xe524('0x61')]=_0x1beaa2[_0xe524('0x58')][_0xe524('0x61')]||_0x1beaa2['user']['id'];_0x884a8f[_0xe524('0x74')]['id']=_0x1beaa2[_0xe524('0x58')][_0xe524('0x61')];return db[_0xe524('0x3b')][_0xe524('0x55')]({'where':{'id':_0x1beaa2[_0xe524('0x59')]['id'],'UserId':null}})[_0xe524('0x24')](handleEntityNotFound(_0x492fd3,null))[_0xe524('0x24')](function(_0x465c3d){if(_0x465c3d){_0x884a8f[_0xe524('0x2b')]=_0x465c3d[_0xe524('0x62')]({'plain':!![]});return db[_0xe524('0x63')][_0xe524('0x55')]({'where':{'id':_0x465c3d[_0xe524('0x64')]}});}return null;})[_0xe524('0x24')](handleEntityNotFound(_0x492fd3,null))['then'](function(_0x933c2a){if(_0x933c2a){_0x884a8f[_0xe524('0x66')]=_0x933c2a[_0xe524('0x62')]({'plain':!![]});interaction_log['info'](_0xe524('0x75'),_0x1beaa2[_0xe524('0x68')]['id'],_0x1beaa2['user']['name'],_0x1beaa2[_0xe524('0x68')]['role'],_0x884a8f[_0xe524('0x66')]['id'],_0x1beaa2['body']?JSON[_0xe524('0x28')](_0x1beaa2[_0xe524('0x58')]):_0xe524('0x6a'));return respondWithRpcPromise(_0xe524('0x76'),'rejectMessage',_0x884a8f);}return null;})['then'](function(_0x2ad24d){if(_0x2ad24d){_0x2ad24d[_0xe524('0x2b')]['interface']=util[_0xe524('0x5f')](_0xe524('0x6e'),_0x1beaa2[_0xe524('0x68')]['name']);_0x2ad24d[_0xe524('0x2b')][_0xe524('0x6f')]=_0x884a8f[_0xe524('0x6f')];_0x2ad24d[_0xe524('0x2b')][_0xe524('0x70')]=_0xe524('0x36');respondWithRpcPromise('EventManager','EventManager',{'event':_0xe524('0x77'),'message':_0x2ad24d['message']},client9002);return _0x884a8f;}return null;})[_0xe524('0x24')](respondWithResult(_0x492fd3,null))[_0xe524('0x2e')](handleError(_0x492fd3,null));}; \ No newline at end of file +var _0x524e=['ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','test','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','Content-Range','apply','reject','destroy','stack','name','index','OpenchannelMessage','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','merge','map','key','VIRTUAL','field','filter','options','count','includeAll','include','findAll','find','create','update','body','params','describe','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','acceptMessage','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x4979e3,_0x290af2){var _0x4e51cc=function(_0x2e2e07){while(--_0x2e2e07){_0x4979e3['push'](_0x4979e3['shift']());}};_0x4e51cc(++_0x290af2);}(_0x524e,0x15e));var _0xe524=function(_0x243e30,_0x37e079){_0x243e30=_0x243e30-0x0;var _0x238a8d=_0x524e[_0x243e30];return _0x238a8d;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe524('0x0'));var zipdir=require(_0xe524('0x1'));var jsonpatch=require(_0xe524('0x2'));var rp=require(_0xe524('0x3'));var moment=require(_0xe524('0x4'));var BPromise=require(_0xe524('0x5'));var Mustache=require(_0xe524('0x6'));var util=require(_0xe524('0x7'));var path=require(_0xe524('0x8'));var sox=require(_0xe524('0x9'));var csv=require('to-csv');var ejs=require(_0xe524('0xa'));var fs=require('fs');var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0xf'));var querystring=require(_0xe524('0x10'));var Papa=require(_0xe524('0x11'));var Redis=require(_0xe524('0x12'));var authService=require(_0xe524('0x13'));var qs=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var db=require(_0xe524('0x1a'))['db'];config[_0xe524('0x1b')]=_[_0xe524('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe524('0x1d'))(new Redis(config[_0xe524('0x1b')]));require(_0xe524('0x1e'))[_0xe524('0x1f')](socket);var jayson=require(_0xe524('0x20'));var client=jayson['client'][_0xe524('0x21')]({'port':0x232c});var client9002=jayson['client'][_0xe524('0x21')]({'port':0x232a});function checkPasswordPattern(_0x1b0af6,_0x48165e,_0x569660){if(_0x569660){var _0x488fce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x488fce[_0xe524('0x22')](_0x48165e)){return _0x1b0af6;}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 _0x1b0af6;}}function respondWithRpcPromise(_0x29a031,_0x5f17fe,_0x5c8736,_0x5a5c0d){return new BPromise(function(_0x3a4027,_0x4f1dfb){var _0x11b2a1=_0x5a5c0d||client;return _0x11b2a1[_0xe524('0x23')](_0x29a031,_0x5c8736)[_0xe524('0x24')](function(_0x209d0b){logger['info'](_0xe524('0x25'),_0x5f17fe,_0xe524('0x26'));logger['debug'](_0xe524('0x27'),_0x5f17fe,_0xe524('0x26'),JSON[_0xe524('0x28')](_0x209d0b));if(_0x209d0b[_0xe524('0x29')]){if(_0x209d0b[_0xe524('0x29')][_0xe524('0x2a')]===0x1f4){logger[_0xe524('0x29')](_0xe524('0x25'),_0x5f17fe,_0x209d0b[_0xe524('0x29')]['message']);return _0x4f1dfb(_0x209d0b[_0xe524('0x29')]['message']);}logger['error'](_0xe524('0x25'),_0x5f17fe,_0x209d0b[_0xe524('0x29')][_0xe524('0x2b')]);return _0x3a4027(_0x209d0b[_0xe524('0x29')]['message']);}else{logger[_0xe524('0x2c')]('OpenchannelMessage,\x20%s,\x20%s',_0x5f17fe,_0xe524('0x26'));_0x3a4027(_0x209d0b[_0xe524('0x2d')][_0xe524('0x2b')]);}})[_0xe524('0x2e')](function(_0x4102d9){logger[_0xe524('0x29')](_0xe524('0x25'),_0x5f17fe,_0x4102d9);_0x4f1dfb(_0x4102d9);});});}function respondWithStatusCode(_0x583cc3,_0x58a896){_0x58a896=_0x58a896||0xcc;return function(_0x283f18){if(_0x283f18){return _0x583cc3[_0xe524('0x2f')](_0x58a896);}return _0x583cc3[_0xe524('0x30')](_0x58a896)[_0xe524('0x31')]();};}function respondWithResult(_0x359c8b,_0x5405e4){_0x5405e4=_0x5405e4||0xc8;return function(_0x52f140){if(_0x52f140){return _0x359c8b[_0xe524('0x30')](_0x5405e4)[_0xe524('0x32')](_0x52f140);}};}function respondWithFilteredResult(_0x3aedd9,_0x8070e4){return function(_0x25c0a1){if(_0x25c0a1){var _0x517fa0=_0x25c0a1['count'],_0x365a1f=_0x8070e4[_0xe524('0x33')],_0x9a7e98=_0x8070e4[_0xe524('0x33')]+_0x8070e4['limit'],_0x4a4e15;if(_0x9a7e98>=_0x517fa0){_0x9a7e98=_0x517fa0;_0x4a4e15=0xc8;}else{_0x4a4e15=0xce;}_0x3aedd9[_0xe524('0x30')](_0x4a4e15);return _0x3aedd9['set'](_0xe524('0x34'),_0x365a1f+'-'+_0x9a7e98+'/'+_0x517fa0)['json'](_0x25c0a1);}return null;};}function patchUpdates(_0x315e56){return function(_0x330162){try{jsonpatch[_0xe524('0x35')](_0x330162,_0x315e56,!![]);}catch(_0x5600d2){return BPromise[_0xe524('0x36')](_0x5600d2);}return _0x330162['save']();};}function saveUpdates(_0xdbdf53,_0x16eff9){return function(_0x276343){if(_0x276343){return _0x276343['update'](_0xdbdf53)[_0xe524('0x24')](function(_0x119cc3){return _0x119cc3;});}return null;};}function removeEntity(_0x49c43e,_0x27817e){return function(_0x2852b9){if(_0x2852b9){return _0x2852b9[_0xe524('0x37')]()[_0xe524('0x24')](function(){_0x49c43e['status'](0xcc)[_0xe524('0x31')]();});}};}function handleEntityNotFound(_0xcf8060,_0x615b5e){return function(_0x13cda8){if(!_0x13cda8){_0xcf8060[_0xe524('0x2f')](0x194);}return _0x13cda8;};}function handleError(_0x369073,_0x2741e8){_0x2741e8=_0x2741e8||0x1f4;return function(_0x2bc477){logger['error'](_0x2bc477[_0xe524('0x38')]);if(_0x2bc477['name']){delete _0x2bc477[_0xe524('0x39')];}_0x369073[_0xe524('0x30')](_0x2741e8)['send'](_0x2bc477);};}exports[_0xe524('0x3a')]=function(_0x5b47ce,_0x1c3aae){var _0x41af26={},_0x38758e={},_0x3103e9={'count':0x0,'rows':[]};var _0x82a87b=db[_0xe524('0x3b')][_0xe524('0x3c')];_0x38758e[_0xe524('0x3d')]=_['keys'](_0x82a87b);_0x38758e[_0xe524('0x3e')]=_[_0xe524('0x3f')](_0x5b47ce[_0xe524('0x3e')]);_0x38758e[_0xe524('0x40')]=_[_0xe524('0x41')](_0x38758e[_0xe524('0x3d')],_0x38758e[_0xe524('0x3e')]);_0x41af26[_0xe524('0x42')]=_['intersection'](_0x38758e[_0xe524('0x3d')],qs[_0xe524('0x43')](_0x5b47ce[_0xe524('0x3e')]['fields']));_0x41af26[_0xe524('0x42')]=_0x41af26['attributes'][_0xe524('0x44')]?_0x41af26[_0xe524('0x42')]:_0x38758e[_0xe524('0x3d')];if(!_0x5b47ce[_0xe524('0x3e')][_0xe524('0x45')](_0xe524('0x46'))){_0x41af26[_0xe524('0x47')]=qs['limit'](_0x5b47ce[_0xe524('0x3e')][_0xe524('0x47')]);_0x41af26[_0xe524('0x33')]=qs[_0xe524('0x33')](_0x5b47ce[_0xe524('0x3e')][_0xe524('0x33')]);}_0x41af26['order']=qs[_0xe524('0x48')](_0x5b47ce[_0xe524('0x3e')][_0xe524('0x48')]);_0x41af26['where']=qs[_0xe524('0x40')](_['pick'](_0x5b47ce['query'],_0x38758e[_0xe524('0x40')]));if(_0x5b47ce[_0xe524('0x3e')]['filter']){_0x41af26[_0xe524('0x49')]=_[_0xe524('0x4a')](_0x41af26[_0xe524('0x49')],{'$or':_[_0xe524('0x4b')](_0x82a87b,function(_0x53d94b){if(_0x53d94b['type'][_0xe524('0x4c')]!==_0xe524('0x4d')){var _0x53c204={};_0x53c204[_0x53d94b[_0xe524('0x4e')]]={'$like':'%'+_0x5b47ce['query'][_0xe524('0x4f')]+'%'};return _0x53c204;}})});}_0x41af26=_[_0xe524('0x4a')]({},_0x41af26,_0x5b47ce[_0xe524('0x50')]);var _0x312c47={'where':_0x41af26[_0xe524('0x49')]};return db[_0xe524('0x3b')][_0xe524('0x51')](_0x312c47)[_0xe524('0x24')](function(_0x1642a7){_0x3103e9[_0xe524('0x51')]=_0x1642a7;if(_0x5b47ce[_0xe524('0x3e')][_0xe524('0x52')]){_0x41af26[_0xe524('0x53')]=[{'all':!![]}];}return db[_0xe524('0x3b')][_0xe524('0x54')](_0x41af26);})['then'](function(_0x53be1f){_0x3103e9['rows']=_0x53be1f;return _0x3103e9;})['then'](respondWithFilteredResult(_0x1c3aae,_0x41af26))[_0xe524('0x2e')](handleError(_0x1c3aae,null));};exports['show']=function(_0x232cf0,_0x15d7ee){var _0x561107={'raw':!![],'where':{'id':_0x232cf0['params']['id']}},_0x20753e={};_0x20753e['model']=_[_0xe524('0x3f')](db[_0xe524('0x3b')][_0xe524('0x3c')]);_0x20753e['query']=_['keys'](_0x232cf0['query']);_0x20753e['filters']=_['intersection'](_0x20753e['model'],_0x20753e[_0xe524('0x3e')]);_0x561107[_0xe524('0x42')]=_['intersection'](_0x20753e[_0xe524('0x3d')],qs[_0xe524('0x43')](_0x232cf0[_0xe524('0x3e')][_0xe524('0x43')]));_0x561107[_0xe524('0x42')]=_0x561107['attributes'][_0xe524('0x44')]?_0x561107[_0xe524('0x42')]:_0x20753e[_0xe524('0x3d')];if(_0x232cf0['query'][_0xe524('0x52')]){_0x561107['include']=[{'all':!![]}];}_0x561107=_[_0xe524('0x4a')]({},_0x561107,_0x232cf0[_0xe524('0x50')]);return db[_0xe524('0x3b')][_0xe524('0x55')](_0x561107)[_0xe524('0x24')](handleEntityNotFound(_0x15d7ee,null))[_0xe524('0x24')](respondWithResult(_0x15d7ee,null))[_0xe524('0x2e')](handleError(_0x15d7ee,null));};exports[_0xe524('0x56')]=function(_0x20bff3,_0x110f2c){return db[_0xe524('0x3b')][_0xe524('0x56')](_0x20bff3['body'],{})['then'](respondWithResult(_0x110f2c,0xc9))['catch'](handleError(_0x110f2c,null));};exports[_0xe524('0x57')]=function(_0x469f67,_0xe7de83){if(_0x469f67[_0xe524('0x58')]['id']){delete _0x469f67[_0xe524('0x58')]['id'];}return db[_0xe524('0x3b')][_0xe524('0x55')]({'where':{'id':_0x469f67[_0xe524('0x59')]['id']}})[_0xe524('0x24')](handleEntityNotFound(_0xe7de83,null))[_0xe524('0x24')](saveUpdates(_0x469f67[_0xe524('0x58')],null))['then'](respondWithResult(_0xe7de83,null))[_0xe524('0x2e')](handleError(_0xe7de83,null));};exports[_0xe524('0x37')]=function(_0x4a5f4a,_0x53da86){return db['OpenchannelMessage']['find']({'where':{'id':_0x4a5f4a[_0xe524('0x59')]['id']}})[_0xe524('0x24')](handleEntityNotFound(_0x53da86,null))[_0xe524('0x24')](removeEntity(_0x53da86,null))[_0xe524('0x2e')](handleError(_0x53da86,null));};exports['describe']=function(_0x4773b4,_0x244f08){return db[_0xe524('0x3b')][_0xe524('0x5a')]()['then'](respondWithResult(_0x244f08,null))['catch'](handleError(_0x244f08,null));};var interaction_log=require('../../config/logger')(_0xe524('0x5b'));exports['accept']=function(_0x357418,_0x1ebb35,_0x3f4201){var _0x287ab8={'channel':_0xe524('0x5c')};if(_0x357418['body']['id']){delete _0x357418['body']['id'];}_0x357418[_0xe524('0x58')][_0xe524('0x5d')]=!![];_0x357418[_0xe524('0x58')][_0xe524('0x5e')]=moment()[_0xe524('0x5f')](_0xe524('0x60'));_0x357418['body'][_0xe524('0x61')]=_0x357418[_0xe524('0x58')][_0xe524('0x61')]||_0x357418['user']['id'];return db[_0xe524('0x3b')][_0xe524('0x55')]({'where':{'id':_0x357418[_0xe524('0x59')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xe524('0x24')](handleEntityNotFound(_0x1ebb35,null))[_0xe524('0x24')](saveUpdates(_0x357418[_0xe524('0x58')],null))[_0xe524('0x24')](function(_0x139a0a){if(_0x139a0a){_0x287ab8['message']=_0x139a0a[_0xe524('0x62')]({'plain':!![]});return db[_0xe524('0x63')][_0xe524('0x55')]({'where':{'id':_0x139a0a[_0xe524('0x64')]}});}return null;})[_0xe524('0x24')](handleEntityNotFound(_0x1ebb35,null))[_0xe524('0x24')](function(_0x35e6b2){if(_0x35e6b2){return _0x35e6b2[_0xe524('0x57')]({'UserId':_0x357418[_0xe524('0x58')][_0xe524('0x61')],'read1stAt':_[_0xe524('0x65')](_0x35e6b2['read1stAt'])?moment()[_0xe524('0x5f')](_0xe524('0x60')):undefined});}return null;})[_0xe524('0x24')](function(_0xfed246){if(_0xfed246){_0x287ab8[_0xe524('0x66')]=_0xfed246['get']({'plain':!![]});interaction_log[_0xe524('0x2c')](_0xe524('0x67'),_0x357418[_0xe524('0x68')]['id'],_0x357418[_0xe524('0x68')][_0xe524('0x39')],_0x357418[_0xe524('0x68')][_0xe524('0x69')],_0x287ab8['interaction']['id'],_0x357418[_0xe524('0x58')]?JSON[_0xe524('0x28')](_0x357418[_0xe524('0x58')]):_0xe524('0x6a'));return respondWithRpcPromise('AcceptMessage',_0xe524('0x6b'),_0x287ab8);}return null;})['then'](function(_0x27b0cb){if(_0x27b0cb){if(_0x357418[_0xe524('0x58')][_0xe524('0x6c')]){_0x287ab8['message'][_0xe524('0x6d')]=util[_0xe524('0x5f')](_0xe524('0x6e'),_0x357418[_0xe524('0x68')][_0xe524('0x39')]);_0x287ab8['message'][_0xe524('0x6f')]=_0x287ab8[_0xe524('0x6f')];_0x287ab8[_0xe524('0x2b')][_0xe524('0x70')]=_0xe524('0x71');return respondWithRpcPromise('EventManager',_0xe524('0x72'),{'event':_0xe524('0x73'),'message':_0x287ab8[_0xe524('0x2b')]},client9002)[_0xe524('0x24')](function(){return _0x287ab8;});}return _0x287ab8;}return null;})[_0xe524('0x24')](respondWithResult(_0x1ebb35,null))[_0xe524('0x2e')](handleError(_0x1ebb35,null));};var interaction_log=require('../../config/logger')(_0xe524('0x5b'));exports[_0xe524('0x36')]=function(_0x1beaa2,_0x492fd3,_0x2a0513){var _0x884a8f={'agent':{},'channel':'openchannel'};if(_0x1beaa2[_0xe524('0x58')]['id']){delete _0x1beaa2[_0xe524('0x58')]['id'];}_0x1beaa2[_0xe524('0x58')][_0xe524('0x61')]=_0x1beaa2[_0xe524('0x58')][_0xe524('0x61')]||_0x1beaa2['user']['id'];_0x884a8f[_0xe524('0x74')]['id']=_0x1beaa2[_0xe524('0x58')][_0xe524('0x61')];return db[_0xe524('0x3b')][_0xe524('0x55')]({'where':{'id':_0x1beaa2[_0xe524('0x59')]['id'],'UserId':null}})[_0xe524('0x24')](handleEntityNotFound(_0x492fd3,null))[_0xe524('0x24')](function(_0x465c3d){if(_0x465c3d){_0x884a8f[_0xe524('0x2b')]=_0x465c3d[_0xe524('0x62')]({'plain':!![]});return db[_0xe524('0x63')][_0xe524('0x55')]({'where':{'id':_0x465c3d[_0xe524('0x64')]}});}return null;})[_0xe524('0x24')](handleEntityNotFound(_0x492fd3,null))['then'](function(_0x933c2a){if(_0x933c2a){_0x884a8f[_0xe524('0x66')]=_0x933c2a[_0xe524('0x62')]({'plain':!![]});interaction_log['info'](_0xe524('0x75'),_0x1beaa2[_0xe524('0x68')]['id'],_0x1beaa2['user']['name'],_0x1beaa2[_0xe524('0x68')]['role'],_0x884a8f[_0xe524('0x66')]['id'],_0x1beaa2['body']?JSON[_0xe524('0x28')](_0x1beaa2[_0xe524('0x58')]):_0xe524('0x6a'));return respondWithRpcPromise(_0xe524('0x76'),'rejectMessage',_0x884a8f);}return null;})['then'](function(_0x2ad24d){if(_0x2ad24d){_0x2ad24d[_0xe524('0x2b')]['interface']=util[_0xe524('0x5f')](_0xe524('0x6e'),_0x1beaa2[_0xe524('0x68')]['name']);_0x2ad24d[_0xe524('0x2b')][_0xe524('0x6f')]=_0x884a8f[_0xe524('0x6f')];_0x2ad24d[_0xe524('0x2b')][_0xe524('0x70')]=_0xe524('0x36');respondWithRpcPromise('EventManager','EventManager',{'event':_0xe524('0x77'),'message':_0x2ad24d['message']},client9002);return _0x884a8f;}return null;})[_0xe524('0x24')](respondWithResult(_0x492fd3,null))[_0xe524('0x2e')](handleError(_0x492fd3,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 2515dda..cfa530f 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 _0x2508=['save','update','remove','emit','exports','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x1e5508,_0x5d1f88){var _0x32948f=function(_0x4e71bb){while(--_0x4e71bb){_0x1e5508['push'](_0x1e5508['shift']());}};_0x32948f(++_0x5d1f88);}(_0x2508,0xcd));var _0x8250=function(_0x4c28f8,_0x45ca13){_0x4c28f8=_0x4c28f8-0x0;var _0x4cab40=_0x2508[_0x4c28f8];return _0x4cab40;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x8250('0x0'))['db'][_0x8250('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x8250('0x2')](0x0);var events={'afterCreate':_0x8250('0x3'),'afterUpdate':_0x8250('0x4'),'afterDestroy':_0x8250('0x5')};function emitEvent(_0x3ea00f){return function(_0x156232,_0x520759,_0x257d94){OpenchannelMessageEvents[_0x8250('0x6')](_0x3ea00f+':'+_0x156232['id'],_0x156232);OpenchannelMessageEvents[_0x8250('0x6')](_0x3ea00f,_0x156232);_0x257d94(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x8250('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x9c87=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x9c87,0x181));var _0x79c8=function(_0x3238ea,_0x91809d){_0x3238ea=_0x3238ea-0x0;var _0x4aaac2=_0x9c87[_0x3238ea];return _0x4aaac2;};'use strict';var EventEmitter=require(_0x79c8('0x0'));var OpenchannelMessage=require(_0x79c8('0x1'))['db'][_0x79c8('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x79c8('0x3')](0x0);var events={'afterCreate':_0x79c8('0x4'),'afterUpdate':_0x79c8('0x5'),'afterDestroy':'remove'};function emitEvent(_0xc6f590){return function(_0x482b53,_0x29521b,_0x42acaf){OpenchannelMessageEvents[_0x79c8('0x6')](_0xc6f590+':'+_0x482b53['id'],_0x482b53);OpenchannelMessageEvents[_0x79c8('0x6')](_0xc6f590,_0x482b53);_0x42acaf(null);};}for(var e in events){if(events[_0x79c8('0x7')](e)){var event=events[e];OpenchannelMessage[_0x79c8('0x8')](e,emitEvent(event));}}module[_0x79c8('0x9')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index c74bdbb..4015715 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 _0x6d8f=['openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','findOne','then','update','error','out','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','OpenchannelInteractionId','keys','get','replyUri','info','afterCreate','length','omit','Contact','POST','method','format','threadId','Interaction','inspect','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage'];(function(_0x147e62,_0x563ecb){var _0x2b8972=function(_0x4c7301){while(--_0x4c7301){_0x147e62['push'](_0x147e62['shift']());}};_0x2b8972(++_0x563ecb);}(_0x6d8f,0xbd));var _0xf6d8=function(_0x1773c5,_0x52f01b){_0x1773c5=_0x1773c5-0x0;var _0x5d72ed=_0x6d8f[_0x1773c5];return _0x5d72ed;};'use strict';var _=require('lodash');var util=require(_0xf6d8('0x0'));var logger=require(_0xf6d8('0x1'))('api');var moment=require(_0xf6d8('0x2'));var BPromise=require('bluebird');var rp=require(_0xf6d8('0x3'));var fs=require('fs');var path=require(_0xf6d8('0x4'));var rimraf=require(_0xf6d8('0x5'));var config=require(_0xf6d8('0x6'));var attributes=require(_0xf6d8('0x7'));module[_0xf6d8('0x8')]=function(_0x296d19,_0x38ca99){return _0x296d19[_0xf6d8('0x9')](_0xf6d8('0xa'),attributes,{'tableName':_0xf6d8('0xb'),'paranoid':![],'indexes':[{'name':_0xf6d8('0xc'),'fields':[_0xf6d8('0xd')],'type':_0xf6d8('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b4bb2,_0x21b185,_0x12ccde){var _0x43492e=_0x296d19[_0xf6d8('0xf')];var _0x1f99f9=_0x4b4bb2['get']({'plain':!![]});if(_0x1f99f9[_0xf6d8('0x10')][_0xf6d8('0x11')]()==='in'||_0x1f99f9[_0xf6d8('0x10')][_0xf6d8('0x11')]()==='out'&&!_0x1f99f9[_0xf6d8('0x12')]&&!_[_0xf6d8('0x13')](_0x1f99f9['UserId'])){_0x43492e['OpenchannelInteraction'][_0xf6d8('0x14')]({'where':{'id':_0x1f99f9['OpenchannelInteractionId']}})[_0xf6d8('0x15')](function(_0x3572cb){if(_0x3572cb){_0x3572cb[_0xf6d8('0x16')]({'lastMsgAt':_0x1f99f9['createdAt'],'lastMsgDirection':_0x1f99f9[_0xf6d8('0x10')]['toLowerCase']()});}})['catch'](function(_0x331116){console[_0xf6d8('0x17')](_0x331116);});}if(_0x1f99f9['direction']===_0xf6d8('0x18')&&!_0x1f99f9['secret']){var _0x276548;_0x43492e[_0xf6d8('0x19')][_0xf6d8('0x1a')]()[_0xf6d8('0x15')](function(_0x459743){return _0x43492e[_0xf6d8('0x1b')][_0xf6d8('0x1c')]({'where':{'id':_0x1f99f9[_0xf6d8('0x1d')]},'include':[{'model':_0x43492e[_0xf6d8('0x1e')],'as':_0xf6d8('0x1f'),'where':{'id':_0x1f99f9[_0xf6d8('0x20')]},'limit':0x1,'include':[{'model':_0x43492e[_0xf6d8('0x19')],'as':'Contact','attributes':_[_0xf6d8('0x21')](_0x459743)}]}]});})[_0xf6d8('0x15')](function(_0x4b38f1){_0x276548=_0x4b38f1[_0xf6d8('0x22')]({'plain':!![]});if(_0x276548&&_0x276548[_0xf6d8('0x23')]){logger[_0xf6d8('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0xf6d8('0x25'),util['format']('Forwarding\x20message\x20%d\x20to\x20%s',_0x1f99f9['id'],_0x276548['replyUri']));if(_0x276548[_0xf6d8('0x1f')]&&_0x276548['Interactions'][_0xf6d8('0x26')]){_0x1f99f9['Interaction']=_[_0xf6d8('0x27')](_0x276548[_0xf6d8('0x1f')][0x0],'Contact');_0x1f99f9[_0xf6d8('0x28')]=_0x276548['Interactions'][0x0][_0xf6d8('0x28')];}var _0x21b185={'method':_0xf6d8('0x29'),'uri':encodeURI(_0x276548[_0xf6d8('0x23')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x21b185[_0xf6d8('0x2a')]){case'GET':_0x21b185['qs']=_0x1f99f9;break;case _0xf6d8('0x29'):_0x21b185[_0xf6d8('0xd')]=_0x1f99f9;break;}return rp(_0x21b185)['then'](function(_0x5d7286){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0xf6d8('0x25'),util[_0xf6d8('0x2b')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x1f99f9['id'],_0x276548['replyUri']));if(_0x5d7286[_0xf6d8('0xd')][_0xf6d8('0x2c')]&&_0x5d7286[_0xf6d8('0xd')][_0xf6d8('0x2c')]!=_0x1f99f9[_0xf6d8('0x2d')][_0xf6d8('0x2c')]){return _0x43492e['OpenchannelInteraction'][_0xf6d8('0x16')]({'threadId':_0x5d7286[_0xf6d8('0xd')][_0xf6d8('0x2c')]},{'logging':!![],'where':{'id':_0x1f99f9[_0xf6d8('0x2d')]['id']}});}else{return;}})[_0xf6d8('0x15')](function(){return _0x4b4bb2[_0xf6d8('0x16')]({'read':!![]});})['catch'](function(_0x5727d8){logger[_0xf6d8('0x17')]('OpenchannelMessage,\x20%s,\x20%s',_0xf6d8('0x25'),util[_0xf6d8('0x2e')](_0x5727d8,{'showHidden':![],'depth':null}));_0x12ccde();});}else{_0x12ccde();}})[_0xf6d8('0x2f')](function(){_0x12ccde();});}else{_0x12ccde();}}},'charset':_0xf6d8('0x30'),'collate':_0xf6d8('0x31')});}; \ No newline at end of file +var _0xe82b=['define','openchannel_messages','fti_openchannel_messages','body','models','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','catch','CmContact','describe','then','OpenchannelAccount','Interactions','Contact','get','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','error','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes','exports'];(function(_0x2c34c5,_0x5572ff){var _0x466d58=function(_0x5999a5){while(--_0x5999a5){_0x2c34c5['push'](_0x2c34c5['shift']());}};_0x466d58(++_0x5572ff);}(_0xe82b,0xc6));var _0xbe82=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xe82b[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xbe82('0x0'));var util=require(_0xbe82('0x1'));var logger=require(_0xbe82('0x2'))(_0xbe82('0x3'));var moment=require('moment');var BPromise=require(_0xbe82('0x4'));var rp=require(_0xbe82('0x5'));var fs=require('fs');var path=require(_0xbe82('0x6'));var rimraf=require(_0xbe82('0x7'));var config=require('../../config/environment');var attributes=require(_0xbe82('0x8'));module[_0xbe82('0x9')]=function(_0x354228,_0x5bb5a0){return _0x354228[_0xbe82('0xa')]('OpenchannelMessage',attributes,{'tableName':_0xbe82('0xb'),'paranoid':![],'indexes':[{'name':_0xbe82('0xc'),'fields':[_0xbe82('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1fa5e9,_0x1fd59e,_0x264913){var _0x51146b=_0x354228[_0xbe82('0xe')];var _0x9f0f61=_0x1fa5e9['get']({'plain':!![]});if(_0x9f0f61['direction']['toLowerCase']()==='in'||_0x9f0f61[_0xbe82('0xf')][_0xbe82('0x10')]()===_0xbe82('0x11')&&!_0x9f0f61[_0xbe82('0x12')]&&!_[_0xbe82('0x13')](_0x9f0f61[_0xbe82('0x14')])){_0x51146b[_0xbe82('0x15')][_0xbe82('0x16')]({'where':{'id':_0x9f0f61[_0xbe82('0x17')]}})['then'](function(_0x3e6b15){if(_0x3e6b15){_0x3e6b15[_0xbe82('0x18')]({'lastMsgAt':_0x9f0f61['createdAt'],'lastMsgDirection':_0x9f0f61[_0xbe82('0xf')]['toLowerCase']()});}})[_0xbe82('0x19')](function(_0x1cfc24){console['error'](_0x1cfc24);});}if(_0x9f0f61[_0xbe82('0xf')]===_0xbe82('0x11')&&!_0x9f0f61[_0xbe82('0x12')]){var _0x136f2f;_0x51146b[_0xbe82('0x1a')][_0xbe82('0x1b')]()[_0xbe82('0x1c')](function(_0x3e2fd5){return _0x51146b[_0xbe82('0x1d')]['find']({'where':{'id':_0x9f0f61['OpenchannelAccountId']},'include':[{'model':_0x51146b[_0xbe82('0x15')],'as':_0xbe82('0x1e'),'where':{'id':_0x9f0f61['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x51146b[_0xbe82('0x1a')],'as':_0xbe82('0x1f'),'attributes':_['keys'](_0x3e2fd5)}]}]});})[_0xbe82('0x1c')](function(_0x3aaa5c){_0x136f2f=_0x3aaa5c[_0xbe82('0x20')]({'plain':!![]});if(_0x136f2f&&_0x136f2f[_0xbe82('0x21')]){logger[_0xbe82('0x22')](_0xbe82('0x23'),_0xbe82('0x24'),util[_0xbe82('0x25')](_0xbe82('0x26'),_0x9f0f61['id'],_0x136f2f['replyUri']));if(_0x136f2f['Interactions']&&_0x136f2f['Interactions'][_0xbe82('0x27')]){_0x9f0f61[_0xbe82('0x28')]=_[_0xbe82('0x29')](_0x136f2f[_0xbe82('0x1e')][0x0],_0xbe82('0x1f'));_0x9f0f61[_0xbe82('0x1f')]=_0x136f2f[_0xbe82('0x1e')][0x0][_0xbe82('0x1f')];}var _0x1fd59e={'method':_0xbe82('0x2a'),'uri':encodeURI(_0x136f2f[_0xbe82('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1fd59e[_0xbe82('0x2b')]){case _0xbe82('0x2c'):_0x1fd59e['qs']=_0x9f0f61;break;case'POST':_0x1fd59e['body']=_0x9f0f61;break;}return rp(_0x1fd59e)['then'](function(_0x485830){logger['info'](_0xbe82('0x23'),'afterCreate',util['format'](_0xbe82('0x2d'),_0x9f0f61['id'],_0x136f2f[_0xbe82('0x21')]));if(_0x485830[_0xbe82('0xd')][_0xbe82('0x2e')]&&_0x485830[_0xbe82('0xd')]['threadId']!=_0x9f0f61[_0xbe82('0x28')][_0xbe82('0x2e')]){return _0x51146b['OpenchannelInteraction']['update']({'threadId':_0x485830[_0xbe82('0xd')][_0xbe82('0x2e')]},{'logging':!![],'where':{'id':_0x9f0f61[_0xbe82('0x28')]['id']}});}else{return;}})[_0xbe82('0x1c')](function(){return _0x1fa5e9[_0xbe82('0x18')]({'read':!![]});})[_0xbe82('0x19')](function(_0x146b9c){logger[_0xbe82('0x2f')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xbe82('0x30')](_0x146b9c,{'showHidden':![],'depth':null}));_0x264913();});}else{_0x264913();}})[_0xbe82('0x31')](function(){_0x264913();});}else{_0x264913();}}},'charset':_0xbe82('0x32'),'collate':_0xbe82('0x33')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 9eeaa0d..aee6077 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 _0x8d5d=['request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','./openchannelMessage.socket','register','then','info','OpenchannelMessage,\x20%s,\x20%s'];(function(_0xb47dc0,_0x407032){var _0x57f0b0=function(_0x11c030){while(--_0x11c030){_0xb47dc0['push'](_0xb47dc0['shift']());}};_0x57f0b0(++_0x407032);}(_0x8d5d,0x10e));var _0xd8d5=function(_0x4620b1,_0x2ebcf5){_0x4620b1=_0x4620b1-0x0;var _0x3be345=_0x8d5d[_0x4620b1];return _0x3be345;};'use strict';var _=require(_0xd8d5('0x0'));var util=require(_0xd8d5('0x1'));var moment=require(_0xd8d5('0x2'));var BPromise=require(_0xd8d5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8d5('0x4'));var db=require(_0xd8d5('0x5'))['db'];var utils=require(_0xd8d5('0x6'));var logger=require('../../config/logger')(_0xd8d5('0x7'));var config=require(_0xd8d5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd8d5('0x9')][_0xd8d5('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xd8d5('0xb')],{'host':_0xd8d5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd8d5('0xb')]));require(_0xd8d5('0xd'))[_0xd8d5('0xe')](socket);function respondWithRpcPromise(_0x55de66,_0x3aab7f,_0x4f6f51){return new BPromise(function(_0x7e3601,_0x3423ba){return client['request'](_0x55de66,_0x4f6f51)[_0xd8d5('0xf')](function(_0x3f8753){logger[_0xd8d5('0x10')](_0xd8d5('0x11'),_0x3aab7f,_0xd8d5('0x12'));logger[_0xd8d5('0x13')](_0xd8d5('0x14'),_0x3aab7f,_0xd8d5('0x12'),JSON[_0xd8d5('0x15')](_0x3f8753));if(_0x3f8753[_0xd8d5('0x16')]){if(_0x3f8753[_0xd8d5('0x16')]['code']===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x3aab7f,_0x3f8753[_0xd8d5('0x16')][_0xd8d5('0x17')]);return _0x3423ba(_0x3f8753[_0xd8d5('0x16')][_0xd8d5('0x17')]);}logger['error'](_0xd8d5('0x11'),_0x3aab7f,_0x3f8753[_0xd8d5('0x16')][_0xd8d5('0x17')]);return _0x7e3601(_0x3f8753[_0xd8d5('0x16')]['message']);}else{logger[_0xd8d5('0x10')](_0xd8d5('0x11'),_0x3aab7f,'request\x20sent');_0x7e3601(_0x3f8753[_0xd8d5('0x18')][_0xd8d5('0x17')]);}})[_0xd8d5('0x19')](function(_0x1e6661){logger[_0xd8d5('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x3aab7f,_0x1e6661);_0x3423ba(_0x1e6661);});});}exports[_0xd8d5('0x1a')]=function(_0x52e30c){var _0x151f50=this;return new Promise(function(_0x173075,_0x4cb38a){return db[_0xd8d5('0x1b')][_0xd8d5('0x1c')](_0x52e30c[_0xd8d5('0x1d')],{'raw':_0x52e30c[_0xd8d5('0x1e')]?_0x52e30c[_0xd8d5('0x1e')][_0xd8d5('0x1f')]===undefined?!![]:![]:!![]})[_0xd8d5('0xf')](function(_0x497203){logger['info']('CreateOpenchannelMessage',_0x52e30c);logger['debug']('CreateOpenchannelMessage',_0x52e30c,JSON['stringify'](_0x497203));_0x173075(_0x497203);})[_0xd8d5('0x19')](function(_0x150cc5){logger[_0xd8d5('0x16')]('CreateOpenchannelMessage',_0x150cc5['message'],_0x52e30c);_0x4cb38a(_0x151f50[_0xd8d5('0x16')](0x1f4,_0x150cc5[_0xd8d5('0x17')]));});});}; \ No newline at end of file +var _0x5914=['stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s'];(function(_0x5f6cd,_0x24a9b7){var _0x57dc4d=function(_0x209d2a){while(--_0x209d2a){_0x5f6cd['push'](_0x5f6cd['shift']());}};_0x57dc4d(++_0x24a9b7);}(_0x5914,0x198));var _0x4591=function(_0x32db7e,_0x234948){_0x32db7e=_0x32db7e-0x0;var _0x5d08e2=_0x5914[_0x32db7e];return _0x5d08e2;};'use strict';var _=require(_0x4591('0x0'));var util=require('util');var moment=require(_0x4591('0x1'));var BPromise=require(_0x4591('0x2'));var rs=require(_0x4591('0x3'));var fs=require('fs');var Redis=require(_0x4591('0x4'));var db=require(_0x4591('0x5'))['db'];var utils=require(_0x4591('0x6'));var logger=require(_0x4591('0x7'))('rpc');var config=require(_0x4591('0x8'));var jayson=require(_0x4591('0x9'));var client=jayson['client'][_0x4591('0xa')]({'port':0x232a});config[_0x4591('0xb')]=_[_0x4591('0xc')](config[_0x4591('0xb')],{'host':_0x4591('0xd'),'port':0x18eb});var socket=require(_0x4591('0xe'))(new Redis(config[_0x4591('0xb')]));require(_0x4591('0xf'))[_0x4591('0x10')](socket);function respondWithRpcPromise(_0x4e486e,_0x334cab,_0xdb7c5b){return new BPromise(function(_0x287546,_0x2feae8){return client[_0x4591('0x11')](_0x4e486e,_0xdb7c5b)[_0x4591('0x12')](function(_0x4779c3){logger[_0x4591('0x13')](_0x4591('0x14'),_0x334cab,_0x4591('0x15'));logger[_0x4591('0x16')](_0x4591('0x17'),_0x334cab,_0x4591('0x15'),JSON[_0x4591('0x18')](_0x4779c3));if(_0x4779c3['error']){if(_0x4779c3[_0x4591('0x19')][_0x4591('0x1a')]===0x1f4){logger[_0x4591('0x19')]('OpenchannelMessage,\x20%s,\x20%s',_0x334cab,_0x4779c3[_0x4591('0x19')]['message']);return _0x2feae8(_0x4779c3['error'][_0x4591('0x1b')]);}logger[_0x4591('0x19')](_0x4591('0x14'),_0x334cab,_0x4779c3[_0x4591('0x19')][_0x4591('0x1b')]);return _0x287546(_0x4779c3[_0x4591('0x19')][_0x4591('0x1b')]);}else{logger['info'](_0x4591('0x14'),_0x334cab,_0x4591('0x15'));_0x287546(_0x4779c3[_0x4591('0x1c')][_0x4591('0x1b')]);}})[_0x4591('0x1d')](function(_0x5ea028){logger[_0x4591('0x19')]('OpenchannelMessage,\x20%s,\x20%s',_0x334cab,_0x5ea028);_0x2feae8(_0x5ea028);});});}exports[_0x4591('0x1e')]=function(_0x2a1b19){var _0x67691a=this;return new Promise(function(_0x2142d8,_0x89f137){return db[_0x4591('0x1f')][_0x4591('0x20')](_0x2a1b19[_0x4591('0x21')],{'raw':_0x2a1b19[_0x4591('0x22')]?_0x2a1b19[_0x4591('0x22')][_0x4591('0x23')]===undefined?!![]:![]:!![]})[_0x4591('0x12')](function(_0x44cfce){logger[_0x4591('0x13')](_0x4591('0x1e'),_0x2a1b19);logger['debug']('CreateOpenchannelMessage',_0x2a1b19,JSON['stringify'](_0x44cfce));_0x2142d8(_0x44cfce);})[_0x4591('0x1d')](function(_0x19eaa0){logger[_0x4591('0x19')](_0x4591('0x1e'),_0x19eaa0[_0x4591('0x1b')],_0x2a1b19);_0x89f137(_0x67691a[_0x4591('0x19')](0x1f4,_0x19eaa0[_0x4591('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 27fe103..5707da7 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 _0x303a=['removeListener','register','length','./openchannelMessage.events','remove','update','emit'];(function(_0x41a100,_0x16a3d2){var _0xa6b33e=function(_0x56cf93){while(--_0x56cf93){_0x41a100['push'](_0x41a100['shift']());}};_0xa6b33e(++_0x16a3d2);}(_0x303a,0x1a0));var _0xa303=function(_0x429948,_0x1a6851){_0x429948=_0x429948-0x0;var _0x35d5d1=_0x303a[_0x429948];return _0x35d5d1;};'use strict';var OpenchannelMessageEvents=require(_0xa303('0x0'));var events=['save',_0xa303('0x1'),_0xa303('0x2')];function createListener(_0x36e548,_0x19d27a){return function(_0x594b49){_0x19d27a[_0xa303('0x3')](_0x36e548,_0x594b49);};}function removeListener(_0x26b47c,_0x38a354){return function(){OpenchannelMessageEvents[_0xa303('0x4')](_0x26b47c,_0x38a354);};}exports[_0xa303('0x5')]=function(_0x1c7ee9){for(var _0x2bc3d7=0x0,_0x3f61f1=events[_0xa303('0x6')];_0x2bc3d7<_0x3f61f1;_0x2bc3d7++){var _0x5d95fd=events[_0x2bc3d7];var _0x51e1ee=createListener('openchannelMessage:'+_0x5d95fd,_0x1c7ee9);OpenchannelMessageEvents['on'](_0x5d95fd,_0x51e1ee);}}; \ No newline at end of file +var _0xb66c=['openchannelMessage:','./openchannelMessage.events','remove','removeListener','register','length'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xb66c,0x175));var _0xcb66=function(_0x449f9b,_0x5db701){_0x449f9b=_0x449f9b-0x0;var _0x369249=_0xb66c[_0x449f9b];return _0x369249;};'use strict';var OpenchannelMessageEvents=require(_0xcb66('0x0'));var events=['save',_0xcb66('0x1'),'update'];function createListener(_0x2afcb8,_0x24ea13){return function(_0xf7ccc5){_0x24ea13['emit'](_0x2afcb8,_0xf7ccc5);};}function removeListener(_0x35d439,_0x386241){return function(){OpenchannelMessageEvents[_0xcb66('0x2')](_0x35d439,_0x386241);};}exports[_0xcb66('0x3')]=function(_0x5d766d){for(var _0x518163=0x0,_0x19adf5=events[_0xcb66('0x4')];_0x518163<_0x19adf5;_0x518163++){var _0xa3993=events[_0x518163];var _0x439f3d=createListener(_0xcb66('0x5')+_0xa3993,_0x5d766d);OpenchannelMessageEvents['on'](_0xa3993,_0x439f3d);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index c5b9376..b810318 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 _0xb7df=['express','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','put','update','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout'];(function(_0x333cd4,_0x5bee82){var _0x1924c7=function(_0x132e43){while(--_0x132e43){_0x333cd4['push'](_0x333cd4['shift']());}};_0x1924c7(++_0x5bee82);}(_0xb7df,0xcf));var _0xfb7d=function(_0xc50932,_0x20ff16){_0xc50932=_0xc50932-0x0;var _0x3edb30=_0xb7df[_0xc50932];return _0x3edb30;};'use strict';var multer=require('multer');var util=require(_0xfb7d('0x0'));var path=require(_0xfb7d('0x1'));var timeout=require(_0xfb7d('0x2'));var express=require(_0xfb7d('0x3'));var router=express[_0xfb7d('0x4')]();var auth=require(_0xfb7d('0x5'));var interaction=require(_0xfb7d('0x6'));var config=require('../../config/environment');var controller=require(_0xfb7d('0x7'));router[_0xfb7d('0x8')]('/',auth['isAuthenticated'](),controller[_0xfb7d('0x9')]);router[_0xfb7d('0x8')](_0xfb7d('0xa'),auth[_0xfb7d('0xb')](),controller[_0xfb7d('0xc')]);router[_0xfb7d('0x8')](_0xfb7d('0xd'),auth[_0xfb7d('0xb')](),controller[_0xfb7d('0xe')]);router[_0xfb7d('0x8')](_0xfb7d('0xf'),auth[_0xfb7d('0xb')](),controller[_0xfb7d('0x10')]);router[_0xfb7d('0x8')](_0xfb7d('0x11'),auth['isAuthenticated'](),controller['getTeams']);router['get'](_0xfb7d('0x12'),auth['isAuthenticated'](),controller[_0xfb7d('0x13')]);router[_0xfb7d('0x14')]('/',auth[_0xfb7d('0xb')](),controller[_0xfb7d('0x15')]);router[_0xfb7d('0x14')](_0xfb7d('0x11'),auth[_0xfb7d('0xb')](),controller[_0xfb7d('0x16')]);router[_0xfb7d('0x14')](_0xfb7d('0x12'),auth[_0xfb7d('0xb')](),controller['addAgents']);router[_0xfb7d('0x17')](_0xfb7d('0xd'),auth[_0xfb7d('0xb')](),controller[_0xfb7d('0x18')]);router[_0xfb7d('0x19')]('/:id',auth[_0xfb7d('0xb')](),controller[_0xfb7d('0x1a')]);router['delete']('/:id/teams',auth[_0xfb7d('0xb')](),controller[_0xfb7d('0x1b')]);router[_0xfb7d('0x19')](_0xfb7d('0x12'),auth['isAuthenticated'](),controller[_0xfb7d('0x1c')]);module[_0xfb7d('0x1d')]=router; \ No newline at end of file +var _0x63b6=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','show','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','put','/:id','update','delete','removeTeams','multer','util','connect-timeout','express','Router'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x63b6,0xb1));var _0x663b=function(_0x186604,_0x9d48e3){_0x186604=_0x186604-0x0;var _0x4f472b=_0x63b6[_0x186604];return _0x4f472b;};'use strict';var multer=require(_0x663b('0x0'));var util=require(_0x663b('0x1'));var path=require('path');var timeout=require(_0x663b('0x2'));var express=require(_0x663b('0x3'));var router=express[_0x663b('0x4')]();var auth=require(_0x663b('0x5'));var interaction=require(_0x663b('0x6'));var config=require(_0x663b('0x7'));var controller=require(_0x663b('0x8'));router[_0x663b('0x9')]('/',auth[_0x663b('0xa')](),controller[_0x663b('0xb')]);router['get'](_0x663b('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x663b('0x9')]('/:id',auth[_0x663b('0xa')](),controller[_0x663b('0xd')]);router[_0x663b('0x9')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0x663b('0x9')]('/:id/teams',auth[_0x663b('0xa')](),controller['getTeams']);router['get'](_0x663b('0xe'),auth[_0x663b('0xa')](),controller[_0x663b('0xf')]);router[_0x663b('0x10')]('/',auth[_0x663b('0xa')](),controller[_0x663b('0x11')]);router[_0x663b('0x10')](_0x663b('0x12'),auth['isAuthenticated'](),controller[_0x663b('0x13')]);router[_0x663b('0x10')](_0x663b('0xe'),auth['isAuthenticated'](),controller[_0x663b('0x14')]);router[_0x663b('0x15')](_0x663b('0x16'),auth[_0x663b('0xa')](),controller[_0x663b('0x17')]);router[_0x663b('0x18')](_0x663b('0x16'),auth[_0x663b('0xa')](),controller['destroy']);router[_0x663b('0x18')](_0x663b('0x12'),auth[_0x663b('0xa')](),controller[_0x663b('0x19')]);router[_0x663b('0x18')](_0x663b('0xe'),auth[_0x663b('0xa')](),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 a7336f2..caff1b6 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 _0x7b4a=['rrmemory','beepall','STRING','INTEGER'];(function(_0x3a58d2,_0x142995){var _0x150b67=function(_0x3209eb){while(--_0x3209eb){_0x3a58d2['push'](_0x3a58d2['shift']());}};_0x150b67(++_0x142995);}(_0x7b4a,0xca));var _0xa7b4=function(_0x85c547,_0x3f565b){_0x85c547=_0x85c547-0x0;var _0x3a5b1f=_0x7b4a[_0x85c547];return _0x3a5b1f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa7b4('0x0')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa7b4('0x0')]},'timeout':{'type':Sequelize[_0xa7b4('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa7b4('0x2'),_0xa7b4('0x3'),'roundrobin')}}; \ No newline at end of file +var _0xf114=['rrmemory','beepall','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xf114,0x132));var _0x4f11=function(_0x22d7b8,_0x28f3ac){_0x22d7b8=_0x22d7b8-0x0;var _0xb61e6f=_0xf114[_0x22d7b8];return _0xb61e6f;};'use strict';var Sequelize=require(_0x4f11('0x0'));module[_0x4f11('0x1')]={'name':{'type':Sequelize[_0x4f11('0x2')],'unique':_0x4f11('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4f11('0x2')]},'timeout':{'type':Sequelize[_0x4f11('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4f11('0x5')](_0x4f11('0x6'),_0x4f11('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index f6786c6..a9e19a6 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 _0xffff=['includes','all','union','compact','value','transaction','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','offset','limit','set','Content-Range','apply','save','update','then','get','UserProfileResource','end','error','stack','send','index','OpenchannelQueue','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','field','options','count','includeAll','rows','catch','show','filters','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','find','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','findAll','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','teams','User','online','interface','flatMap','Agents','sequelize','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','select','from','team_has_openchannel_queues','join','user_has_teams','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId'];(function(_0x2824b2,_0xacbff5){var _0x23e612=function(_0x4c9d47){while(--_0x4c9d47){_0x2824b2['push'](_0x2824b2['shift']());}};_0x23e612(++_0xacbff5);}(_0xffff,0x1bb));var _0xffff=function(_0x4c1965,_0x2eb238){_0x4c1965=_0x4c1965-0x0;var _0x8b2a1a=_0xffff[_0x4c1965];return _0x8b2a1a;};'use strict';var pdf=require(_0xffff('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xffff('0x1'));var zipdir=require(_0xffff('0x2'));var jsonpatch=require(_0xffff('0x3'));var rp=require(_0xffff('0x4'));var moment=require(_0xffff('0x5'));var BPromise=require(_0xffff('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xffff('0x7'));var sox=require(_0xffff('0x8'));var csv=require('to-csv');var ejs=require(_0xffff('0x9'));var fs=require('fs');var _=require(_0xffff('0xa'));var squel=require(_0xffff('0xb'));var crypto=require(_0xffff('0xc'));var jsforce=require(_0xffff('0xd'));var deskjs=require(_0xffff('0xe'));var toCsv=require('to-csv');var querystring=require(_0xffff('0xf'));var Papa=require(_0xffff('0x10'));var Redis=require(_0xffff('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xffff('0x12'));var hardwareService=require(_0xffff('0x13'));var logger=require('../../config/logger')(_0xffff('0x14'));var utils=require(_0xffff('0x15'));var config=require(_0xffff('0x16'));var db=require(_0xffff('0x17'))['db'];config[_0xffff('0x18')]=_[_0xffff('0x19')](config[_0xffff('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xffff('0x1a'))(new Redis(config['redis']));require(_0xffff('0x1b'))[_0xffff('0x1c')](socket);function respondWithStatusCode(_0xdcf722,_0x25fa5a){_0x25fa5a=_0x25fa5a||0xcc;return function(_0x56784c){if(_0x56784c){return _0xdcf722[_0xffff('0x1d')](_0x25fa5a);}return _0xdcf722[_0xffff('0x1e')](_0x25fa5a)['end']();};}function respondWithResult(_0x32a1c7,_0x161c45){_0x161c45=_0x161c45||0xc8;return function(_0x43ccaf){if(_0x43ccaf){return _0x32a1c7['status'](_0x161c45)[_0xffff('0x1f')](_0x43ccaf);}};}function respondWithFilteredResult(_0x419f78,_0x466812){return function(_0x10ca53){if(_0x10ca53){var _0x59e54e=_0x10ca53['count'],_0xf9a361=_0x466812[_0xffff('0x20')],_0xb5d3f5=_0x466812[_0xffff('0x20')]+_0x466812[_0xffff('0x21')],_0x2aaab9;if(_0xb5d3f5>=_0x59e54e){_0xb5d3f5=_0x59e54e;_0x2aaab9=0xc8;}else{_0x2aaab9=0xce;}_0x419f78[_0xffff('0x1e')](_0x2aaab9);return _0x419f78[_0xffff('0x22')](_0xffff('0x23'),_0xf9a361+'-'+_0xb5d3f5+'/'+_0x59e54e)['json'](_0x10ca53);}return null;};}function patchUpdates(_0xef8f9b){return function(_0xc4f7d6){try{jsonpatch[_0xffff('0x24')](_0xc4f7d6,_0xef8f9b,!![]);}catch(_0x419228){return BPromise['reject'](_0x419228);}return _0xc4f7d6[_0xffff('0x25')]();};}function saveUpdates(_0x3134c8,_0x6bca7f){return function(_0x2fae19){if(_0x2fae19){return _0x2fae19[_0xffff('0x26')](_0x3134c8)['then'](function(_0x43e01a){return _0x43e01a;});}return null;};}function removeEntity(_0x5998e8,_0x1ed03e){return function(_0x13b01d){if(_0x13b01d){return _0x13b01d['destroy']()[_0xffff('0x27')](function(){var _0x5d2e42=_0x13b01d[_0xffff('0x28')]({'plain':!![]});var _0xad384c='OpenchannelQueues';return db[_0xffff('0x29')]['destroy']({'where':{'type':_0xad384c,'resourceId':_0x5d2e42['id']}})[_0xffff('0x27')](function(){return _0x13b01d;});})[_0xffff('0x27')](function(){_0x5998e8['status'](0xcc)[_0xffff('0x2a')]();});}};}function handleEntityNotFound(_0x40b665,_0x26f3e5){return function(_0x3b1f90){if(!_0x3b1f90){_0x40b665[_0xffff('0x1d')](0x194);}return _0x3b1f90;};}function handleError(_0x38b8ce,_0x1a3fe7){_0x1a3fe7=_0x1a3fe7||0x1f4;return function(_0x2923e7){logger[_0xffff('0x2b')](_0x2923e7[_0xffff('0x2c')]);if(_0x2923e7['name']){delete _0x2923e7['name'];}_0x38b8ce[_0xffff('0x1e')](_0x1a3fe7)[_0xffff('0x2d')](_0x2923e7);};}exports[_0xffff('0x2e')]=function(_0x509dd5,_0x195f90){var _0x5d40eb={},_0x4565bf={},_0x2db10c={'count':0x0,'rows':[]};var _0x23df4f=db[_0xffff('0x2f')][_0xffff('0x30')];_0x4565bf[_0xffff('0x31')]=_[_0xffff('0x32')](_0x23df4f);_0x4565bf[_0xffff('0x33')]=_[_0xffff('0x32')](_0x509dd5[_0xffff('0x33')]);_0x4565bf['filters']=_['intersection'](_0x4565bf[_0xffff('0x31')],_0x4565bf[_0xffff('0x33')]);_0x5d40eb[_0xffff('0x34')]=_[_0xffff('0x35')](_0x4565bf['model'],qs['fields'](_0x509dd5[_0xffff('0x33')][_0xffff('0x36')]));_0x5d40eb[_0xffff('0x34')]=_0x5d40eb[_0xffff('0x34')][_0xffff('0x37')]?_0x5d40eb[_0xffff('0x34')]:_0x4565bf[_0xffff('0x31')];if(!_0x509dd5[_0xffff('0x33')][_0xffff('0x38')](_0xffff('0x39'))){_0x5d40eb[_0xffff('0x21')]=qs['limit'](_0x509dd5[_0xffff('0x33')][_0xffff('0x21')]);_0x5d40eb[_0xffff('0x20')]=qs[_0xffff('0x20')](_0x509dd5['query'][_0xffff('0x20')]);}_0x5d40eb[_0xffff('0x3a')]=qs[_0xffff('0x3b')](_0x509dd5[_0xffff('0x33')][_0xffff('0x3b')]);_0x5d40eb[_0xffff('0x3c')]=qs['filters'](_['pick'](_0x509dd5['query'],_0x4565bf['filters']));if(_0x509dd5[_0xffff('0x33')][_0xffff('0x3d')]){_0x5d40eb[_0xffff('0x3c')]=_[_0xffff('0x3e')](_0x5d40eb[_0xffff('0x3c')],{'$or':_[_0xffff('0x3f')](_0x23df4f,function(_0xb2ca76){if(_0xb2ca76[_0xffff('0x40')]['key']!=='VIRTUAL'){var _0x22ab9c={};_0x22ab9c[_0xb2ca76[_0xffff('0x41')]]={'$like':'%'+_0x509dd5[_0xffff('0x33')]['filter']+'%'};return _0x22ab9c;}})});}_0x5d40eb=_[_0xffff('0x3e')]({},_0x5d40eb,_0x509dd5[_0xffff('0x42')]);var _0x33e732={'where':_0x5d40eb['where']};return db[_0xffff('0x2f')][_0xffff('0x43')](_0x33e732)[_0xffff('0x27')](function(_0x1d84ab){_0x2db10c[_0xffff('0x43')]=_0x1d84ab;if(_0x509dd5[_0xffff('0x33')][_0xffff('0x44')]){_0x5d40eb['include']=[{'all':!![]}];}return db[_0xffff('0x2f')]['findAll'](_0x5d40eb);})[_0xffff('0x27')](function(_0x4e049d){_0x2db10c[_0xffff('0x45')]=_0x4e049d;return _0x2db10c;})[_0xffff('0x27')](respondWithFilteredResult(_0x195f90,_0x5d40eb))[_0xffff('0x46')](handleError(_0x195f90,null));};exports[_0xffff('0x47')]=function(_0x4d6a77,_0x289676){var _0x2b2511={'raw':!![],'where':{'id':_0x4d6a77['params']['id']}},_0x25c13c={};_0x25c13c[_0xffff('0x31')]=_['keys'](db[_0xffff('0x2f')]['rawAttributes']);_0x25c13c[_0xffff('0x33')]=_['keys'](_0x4d6a77[_0xffff('0x33')]);_0x25c13c[_0xffff('0x48')]=_[_0xffff('0x35')](_0x25c13c[_0xffff('0x31')],_0x25c13c[_0xffff('0x33')]);_0x2b2511['attributes']=_['intersection'](_0x25c13c['model'],qs[_0xffff('0x36')](_0x4d6a77[_0xffff('0x33')][_0xffff('0x36')]));_0x2b2511['attributes']=_0x2b2511[_0xffff('0x34')]['length']?_0x2b2511[_0xffff('0x34')]:_0x25c13c[_0xffff('0x31')];if(_0x4d6a77[_0xffff('0x33')][_0xffff('0x44')]){_0x2b2511['include']=[{'all':!![]}];}_0x2b2511=_[_0xffff('0x3e')]({},_0x2b2511,_0x4d6a77[_0xffff('0x42')]);return db[_0xffff('0x2f')]['find'](_0x2b2511)[_0xffff('0x27')](handleEntityNotFound(_0x289676,null))[_0xffff('0x27')](respondWithResult(_0x289676,null))[_0xffff('0x46')](handleError(_0x289676,null));};exports[_0xffff('0x49')]=function(_0x635b27,_0x493bee){return db['OpenchannelQueue'][_0xffff('0x49')](_0x635b27[_0xffff('0x4a')],{})[_0xffff('0x27')](function(_0x2de989){var _0xac73a6=_0x635b27[_0xffff('0x4b')]['get']({'plain':!![]});if(!_0xac73a6)throw new Error(_0xffff('0x4c'));if(_0xac73a6[_0xffff('0x4d')]==='user'){var _0x28dc63=_0x2de989[_0xffff('0x28')]({'plain':!![]});var _0x4df614=_0xffff('0x4e');return db['UserProfileSection'][_0xffff('0x4f')]({'where':{'name':_0x4df614,'userProfileId':_0xac73a6[_0xffff('0x50')]},'raw':!![]})[_0xffff('0x27')](function(_0x15b902){if(_0x15b902&&_0x15b902[_0xffff('0x51')]===0x0){return db['UserProfileResource'][_0xffff('0x49')]({'name':_0x28dc63[_0xffff('0x52')],'resourceId':_0x28dc63['id'],'type':_0x15b902[_0xffff('0x52')],'sectionId':_0x15b902['id']},{})[_0xffff('0x27')](function(){return _0x2de989;});}else{return _0x2de989;}})[_0xffff('0x46')](function(_0x268e13){logger['error'](_0xffff('0x53'),_0x268e13);throw _0x268e13;});}return _0x2de989;})[_0xffff('0x27')](respondWithResult(_0x493bee,0xc9))[_0xffff('0x46')](handleError(_0x493bee,null));};exports[_0xffff('0x26')]=function(_0x4188b7,_0x4542f5){if(_0x4188b7[_0xffff('0x4a')]['id']){delete _0x4188b7[_0xffff('0x4a')]['id'];}return db[_0xffff('0x2f')]['find']({'where':{'id':_0x4188b7[_0xffff('0x54')]['id']}})[_0xffff('0x27')](handleEntityNotFound(_0x4542f5,null))[_0xffff('0x27')](saveUpdates(_0x4188b7['body'],null))['then'](respondWithResult(_0x4542f5,null))[_0xffff('0x46')](handleError(_0x4542f5,null));};exports[_0xffff('0x55')]=function(_0x487601,_0x4b9378){return db[_0xffff('0x2f')][_0xffff('0x4f')]({'where':{'id':_0x487601[_0xffff('0x54')]['id']}})[_0xffff('0x27')](handleEntityNotFound(_0x4b9378,null))[_0xffff('0x27')](removeEntity(_0x4b9378,null))[_0xffff('0x46')](handleError(_0x4b9378,null));};exports[_0xffff('0x56')]=function(_0x236388,_0x24d029){return db[_0xffff('0x2f')]['describe']()[_0xffff('0x27')](respondWithResult(_0x24d029,null))[_0xffff('0x46')](handleError(_0x24d029,null));};exports[_0xffff('0x57')]=function(_0x4bc935,_0x29ac21,_0x377ad1){var _0x2ce63e={'raw':!![],'where':{}},_0x552bf8={},_0x10761c;return db[_0xffff('0x2f')][_0xffff('0x58')]({'where':{'id':_0x4bc935[_0xffff('0x54')]['id']}})[_0xffff('0x27')](handleEntityNotFound(_0x29ac21,null))[_0xffff('0x27')](function(_0x1a25d2){if(_0x1a25d2){_0x10761c=_0x1a25d2[_0xffff('0x28')]({'plain':!![]});_0x552bf8[_0xffff('0x31')]=_[_0xffff('0x32')](db[_0xffff('0x59')][_0xffff('0x30')]);_0x552bf8[_0xffff('0x33')]=_[_0xffff('0x32')](_0x4bc935['query']);_0x552bf8['filters']=_[_0xffff('0x35')](_0x552bf8[_0xffff('0x31')],_0x552bf8['query']);_0x2ce63e[_0xffff('0x34')]=_[_0xffff('0x35')](_0x552bf8['model'],qs[_0xffff('0x36')](_0x4bc935[_0xffff('0x33')][_0xffff('0x36')]));_0x2ce63e[_0xffff('0x34')]=_0x2ce63e[_0xffff('0x34')][_0xffff('0x37')]?_0x2ce63e['attributes']:_0x552bf8[_0xffff('0x31')];if(!_0x4bc935['query'][_0xffff('0x38')](_0xffff('0x39'))){_0x2ce63e['limit']=qs[_0xffff('0x21')](_0x4bc935[_0xffff('0x33')][_0xffff('0x21')]);_0x2ce63e[_0xffff('0x20')]=qs['offset'](_0x4bc935[_0xffff('0x33')][_0xffff('0x20')]);}_0x2ce63e[_0xffff('0x3a')]=qs['sort'](_0x4bc935[_0xffff('0x33')][_0xffff('0x3b')]);_0x2ce63e['where']=qs[_0xffff('0x48')](_['pick'](_0x4bc935[_0xffff('0x33')],_0x552bf8['filters']));_0x2ce63e[_0xffff('0x3c')][_0xffff('0x5a')]=_0x1a25d2['id'];if(_0x4bc935[_0xffff('0x33')][_0xffff('0x3d')]){_0x2ce63e[_0xffff('0x3c')]=_[_0xffff('0x3e')](_0x2ce63e[_0xffff('0x3c')],{'$or':_[_0xffff('0x3f')](_0x2ce63e['attributes'],function(_0xaac578){var _0x1e531c={};_0x1e531c[_0xaac578]={'$like':'%'+_0x4bc935['query'][_0xffff('0x3d')]+'%'};return _0x1e531c;})});}_0x2ce63e=_[_0xffff('0x3e')]({},_0x2ce63e,_0x4bc935['options']);return db['UserOpenchannelQueue'][_0xffff('0x5b')](_0x2ce63e);}})[_0xffff('0x27')](function(_0x471bdc){if(_0x471bdc){return db['User'][_0xffff('0x5c')]({'where':{'id':_[_0xffff('0x3f')](_0x471bdc,_0xffff('0x5d')),'role':_0xffff('0x5e')},'attributes':['id',_0xffff('0x52'),_0xffff('0x5f'),_0xffff('0x60'),_0xffff('0x61')]});}})[_0xffff('0x27')](function(_0x1ae281){if(_0x1ae281){return{'count':_0x1ae281[_0xffff('0x43')],'rows':_[_0xffff('0x3f')](_0x1ae281[_0xffff('0x45')],function(_0x1926c6){return{'membername':_0x1926c6[_0xffff('0x52')],'UserId':_0x1926c6['id'],'queue_name':_0x10761c[_0xffff('0x52')],'OpenchannelQueueId':_0x10761c['id'],'interface':util[_0xffff('0x62')]('%s/%s',_0xffff('0x63'),_0x1926c6[_0xffff('0x52')]),'penalty':0x0,'paused':_0x1926c6[_0xffff('0x5f')],'createdAt':_0x1926c6[_0xffff('0x61')],'updatedAt':_0x1926c6['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xffff('0x27')](respondWithFilteredResult(_0x29ac21,_0x2ce63e))['catch'](handleError(_0x29ac21,null));};exports[_0xffff('0x64')]=function(_0x2960d5,_0x4deab1,_0x25b235){var _0x299e4e={};var _0x433b51={};var _0x12b1e6;var _0x5024de;return db[_0xffff('0x2f')][_0xffff('0x58')]({'where':{'id':_0x2960d5['params']['id']}})[_0xffff('0x27')](handleEntityNotFound(_0x4deab1,null))['then'](function(_0x304443){if(_0x304443){_0x12b1e6=_0x304443;_0x433b51[_0xffff('0x31')]=_['keys'](db[_0xffff('0x65')]['rawAttributes']);_0x433b51[_0xffff('0x33')]=_[_0xffff('0x32')](_0x2960d5[_0xffff('0x33')]);_0x433b51['filters']=_[_0xffff('0x35')](_0x433b51[_0xffff('0x31')],_0x433b51['query']);_0x299e4e[_0xffff('0x34')]=_[_0xffff('0x35')](_0x433b51[_0xffff('0x31')],qs['fields'](_0x2960d5[_0xffff('0x33')]['fields']));_0x299e4e[_0xffff('0x34')]=_0x299e4e[_0xffff('0x34')][_0xffff('0x37')]?_0x299e4e['attributes']:_0x433b51[_0xffff('0x31')];_0x299e4e[_0xffff('0x3a')]=qs[_0xffff('0x3b')](_0x2960d5[_0xffff('0x33')][_0xffff('0x3b')]);_0x299e4e['where']=qs[_0xffff('0x48')](_['pick'](_0x2960d5['query'],_0x433b51[_0xffff('0x48')]));if(_0x2960d5['query']['filter']){_0x299e4e[_0xffff('0x3c')]=_[_0xffff('0x3e')](_0x299e4e['where'],{'$or':_[_0xffff('0x3f')](_0x299e4e[_0xffff('0x34')],function(_0x594e85){var _0x1d27d8={};_0x1d27d8[_0x594e85]={'$like':'%'+_0x2960d5[_0xffff('0x33')][_0xffff('0x3d')]+'%'};return _0x1d27d8;})});}_0x299e4e=_['merge']({},_0x299e4e,_0x2960d5[_0xffff('0x42')]);return _0x12b1e6[_0xffff('0x64')](_0x299e4e);}})['then'](function(_0x1312e3){if(_0x1312e3){_0x5024de=_0x1312e3[_0xffff('0x37')];if(!_0x2960d5[_0xffff('0x33')][_0xffff('0x38')](_0xffff('0x39'))){_0x299e4e[_0xffff('0x21')]=qs[_0xffff('0x21')](_0x2960d5[_0xffff('0x33')][_0xffff('0x21')]);_0x299e4e[_0xffff('0x20')]=qs[_0xffff('0x20')](_0x2960d5[_0xffff('0x33')]['offset']);}return _0x12b1e6[_0xffff('0x64')](_0x299e4e);}})[_0xffff('0x27')](function(_0xe6c300){if(_0xe6c300){return _0xe6c300?{'count':_0x5024de,'rows':_0xe6c300}:null;}})['then'](respondWithResult(_0x4deab1,null))['catch'](handleError(_0x4deab1,null));};exports[_0xffff('0x66')]=function(_0xaf0338,_0x3cb472,_0x26d686){var _0x4529cb=_0xaf0338[_0xffff('0x4a')][_0xffff('0x67')];return db[_0xffff('0x65')][_0xffff('0x5b')]({'where':{'id':_[_0xffff('0x3f')](_0x4529cb,'id')},'attributes':['id'],'include':[{'model':db[_0xffff('0x68')],'as':'Agents','attributes':['id',_0xffff('0x52'),_0xffff('0x69'),'voicePause',_0xffff('0x6a')],'raw':!![]}]})[_0xffff('0x27')](function(_0x3323df){if(_0x3323df){var _0x1ad83b=_[_0xffff('0x6b')](_0x3323df,function(_0x44214c){var _0x2c0745=_0x44214c['get']({'plain':!![]});return _0x2c0745[_0xffff('0x6c')];});return db[_0xffff('0x2f')][_0xffff('0x4f')]({'where':{'id':_0xaf0338['params']['id']}})[_0xffff('0x27')](function(_0x29950f){return db[_0xffff('0x6d')]['transaction'](function(_0x21cfe7){return _0x29950f[_0xffff('0x66')](_[_0xffff('0x3f')](_0x4529cb,'id'),{'transaction':_0x21cfe7})['then'](function(){return BPromise[_0xffff('0x6e')](_0x1ad83b,function(_0x284434){return db[_0xffff('0x59')][_0xffff('0x6f')]({'where':{'UserId':_0x284434['id'],'OpenchannelQueueId':_0xaf0338[_0xffff('0x54')]['id']},'transaction':_0x21cfe7});});})['then'](function(){_0x1ad83b[_0xffff('0x70')](function(_0x13cabd){socket[_0xffff('0x71')](_0xffff('0x72'),{'UserId':_0x13cabd['id'],'OpenchannelQueueId':_0x29950f['id']});});});});});}})['then'](respondWithStatusCode(_0x3cb472,null))[_0xffff('0x46')](handleError(_0x3cb472,null));};exports[_0xffff('0x73')]=function(_0x32a268,_0x4b8555,_0x41feda){return db[_0xffff('0x65')]['findAll']({'where':{'id':_0x32a268[_0xffff('0x33')][_0xffff('0x74')]},'attributes':['id'],'include':[{'model':db[_0xffff('0x68')],'as':_0xffff('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xffff('0x27')](handleEntityNotFound(_0x4b8555,null))[_0xffff('0x27')](function(_0x58c725){var _0x2303c7=_[_0xffff('0x3f')](_0x58c725,'id');var _0x2ec2f8=[];var _0x5a3298=[];var _0x1839f8=squel[_0xffff('0x75')]();_0x1839f8[_0xffff('0x41')]('tq.TeamId')[_0xffff('0x76')](_0xffff('0x77'),'tq')[_0xffff('0x78')](_0xffff('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('OpenchannelQueueId\x20=\x20?',_0x32a268[_0xffff('0x54')]['id']);for(var _0x1f8a11=0x0;_0x1f8a11<_0x58c725['length'];_0x1f8a11+=0x1){let _0x2b41ee=_0x58c725[_0x1f8a11];for(var _0x48861d=0x0;_0x48861d<_0x2b41ee[_0xffff('0x6c')][_0xffff('0x37')];_0x48861d+=0x1){let _0x5dfdaf=_0x2b41ee[_0xffff('0x6c')][_0x48861d];var _0x467b95=_0x1839f8['clone']();_0x467b95[_0xffff('0x3c')](_0xffff('0x7a'),_0x5dfdaf['id']);_0x5a3298[_0xffff('0x7b')](db[_0xffff('0x6d')][_0xffff('0x33')](_0x467b95[_0xffff('0x7c')](),{'type':db['sequelize'][_0xffff('0x7d')][_0xffff('0x7e')]})[_0xffff('0x27')](function(_0x5bc618){if(_0x5bc618[_0xffff('0x37')]===0x1){return _0x5dfdaf['id'];}else{var _0x1cb498=_[_0xffff('0x7f')](_[_0xffff('0x3f')](_0x5bc618,_0xffff('0x80')),function(_0x1a0243){return _[_0xffff('0x81')](_0x2303c7,_0x1a0243);});if(_0x1cb498){return _0x5dfdaf['id'];}}}));}}return BPromise[_0xffff('0x82')](_0x5a3298)['then'](function(_0x2097da){_0x2ec2f8=_(_0x2ec2f8)[_0xffff('0x83')](_0x2097da)[_0xffff('0x84')]()[_0xffff('0x85')]();return db[_0xffff('0x2f')]['find']({'where':{'id':_0x32a268['params']['id']}})[_0xffff('0x27')](function(_0x58f641){return db[_0xffff('0x6d')][_0xffff('0x86')](function(_0x1f7685){return _0x58f641[_0xffff('0x73')](_0x32a268[_0xffff('0x33')][_0xffff('0x74')],{'transaction':_0x1f7685})[_0xffff('0x27')](function(){if(!_[_0xffff('0x87')](_0x2ec2f8)){return _0x58f641[_0xffff('0x88')](_0x2ec2f8,{'transaction':_0x1f7685});}})[_0xffff('0x27')](function(){_0x2ec2f8['forEach'](function(_0x318da6){socket[_0xffff('0x71')](_0xffff('0x89'),{'UserId':_0x318da6,'OpenchannelQueueId':_0x58f641['id']});});});});});});})[_0xffff('0x27')](respondWithStatusCode(_0x4b8555,null))['catch'](handleError(_0x4b8555,null));};exports[_0xffff('0x8a')]=function(_0x2b28ea,_0x18b146,_0x269777){return db['OpenchannelQueue'][_0xffff('0x4f')]({'where':{'id':_0x2b28ea[_0xffff('0x54')]['id']}})[_0xffff('0x27')](handleEntityNotFound(_0x18b146,null))[_0xffff('0x27')](function(_0x2fe419){if(_0x2fe419){return _0x2fe419[_0xffff('0x8a')](_0x2b28ea['body'][_0xffff('0x74')],_[_0xffff('0x8b')](_0x2b28ea['body'],[_0xffff('0x74'),'id'])||{})[_0xffff('0x8c')](function(_0x230e23){for(var _0x1d331e=0x0;_0x1d331e<_0x2b28ea['body'][_0xffff('0x74')][_0xffff('0x37')];_0x1d331e+=0x1){socket[_0xffff('0x71')]('userOpenchannelQueue:save',{'UserId':_0x2b28ea[_0xffff('0x4a')][_0xffff('0x74')][_0x1d331e],'OpenchannelQueueId':_0x2b28ea[_0xffff('0x54')]['id']});}return _0x230e23;});}})[_0xffff('0x27')](respondWithResult(_0x18b146,null))[_0xffff('0x46')](handleError(_0x18b146,null));};exports[_0xffff('0x88')]=function(_0x766250,_0x17f185,_0x9de4){return db['OpenchannelQueue'][_0xffff('0x4f')]({'where':{'id':_0x766250[_0xffff('0x54')]['id']}})[_0xffff('0x27')](handleEntityNotFound(_0x17f185,null))[_0xffff('0x27')](function(_0x1fca31){if(_0x1fca31){return _0x1fca31['removeAgents'](_0x766250['query']['ids'])[_0xffff('0x27')](function(){if(_[_0xffff('0x8d')](_0x766250[_0xffff('0x33')][_0xffff('0x74')])){for(var _0x53b3f5=0x0;_0x53b3f5<_0x766250[_0xffff('0x33')][_0xffff('0x74')][_0xffff('0x37')];_0x53b3f5+=0x1){socket['emit'](_0xffff('0x89'),{'UserId':Number(_0x766250[_0xffff('0x33')][_0xffff('0x74')][_0x53b3f5]),'OpenchannelQueueId':Number(_0x766250[_0xffff('0x54')]['id'])});}}else{socket[_0xffff('0x71')]('userOpenchannelQueue:remove',{'UserId':Number(_0x766250[_0xffff('0x33')]['ids']),'OpenchannelQueueId':Number(_0x766250['params']['id'])});}});}})[_0xffff('0x27')](respondWithStatusCode(_0x17f185,null))[_0xffff('0x46')](handleError(_0x17f185,null));};exports[_0xffff('0x8e')]=function(_0x1321b4,_0x45ea5e,_0x41e992){var _0x5bd2bc={};var _0x4efa95={};var _0x1f9bf7;var _0x310d20;return db[_0xffff('0x2f')][_0xffff('0x58')]({'where':{'id':_0x1321b4['params']['id']}})[_0xffff('0x27')](handleEntityNotFound(_0x45ea5e,null))[_0xffff('0x27')](function(_0x9e921){if(_0x9e921){_0x1f9bf7=_0x9e921;_0x4efa95['model']=_[_0xffff('0x32')](db[_0xffff('0x68')][_0xffff('0x30')]);_0x4efa95['query']=_[_0xffff('0x32')](_0x1321b4[_0xffff('0x33')]);_0x4efa95['filters']=_[_0xffff('0x35')](_0x4efa95['model'],_0x4efa95[_0xffff('0x33')]);_0x5bd2bc[_0xffff('0x34')]=_[_0xffff('0x35')](_0x4efa95[_0xffff('0x31')],qs[_0xffff('0x36')](_0x1321b4['query'][_0xffff('0x36')]));_0x5bd2bc['attributes']=_0x5bd2bc[_0xffff('0x34')][_0xffff('0x37')]?_0x5bd2bc['attributes']:_0x4efa95[_0xffff('0x31')];_0x5bd2bc[_0xffff('0x3a')]=qs[_0xffff('0x3b')](_0x1321b4['query'][_0xffff('0x3b')]);_0x5bd2bc[_0xffff('0x3c')]=qs['filters'](_['pick'](_0x1321b4[_0xffff('0x33')],_0x4efa95[_0xffff('0x48')]));if(_0x1321b4[_0xffff('0x33')][_0xffff('0x3d')]){_0x5bd2bc[_0xffff('0x3c')]=_[_0xffff('0x3e')](_0x5bd2bc[_0xffff('0x3c')],{'$or':_[_0xffff('0x3f')](_0x5bd2bc['attributes'],function(_0x5e4c49){var _0x426137={};_0x426137[_0x5e4c49]={'$like':'%'+_0x1321b4[_0xffff('0x33')][_0xffff('0x3d')]+'%'};return _0x426137;})});}_0x5bd2bc=_[_0xffff('0x3e')]({},_0x5bd2bc,_0x1321b4[_0xffff('0x42')]);return _0x1f9bf7[_0xffff('0x8e')](_0x5bd2bc);}})[_0xffff('0x27')](function(_0x40465d){if(_0x40465d){_0x310d20=_0x40465d[_0xffff('0x37')];if(!_0x1321b4[_0xffff('0x33')][_0xffff('0x38')](_0xffff('0x39'))){_0x5bd2bc[_0xffff('0x21')]=qs[_0xffff('0x21')](_0x1321b4[_0xffff('0x33')][_0xffff('0x21')]);_0x5bd2bc[_0xffff('0x20')]=qs[_0xffff('0x20')](_0x1321b4[_0xffff('0x33')][_0xffff('0x20')]);}return _0x1f9bf7[_0xffff('0x8e')](_0x5bd2bc);}})[_0xffff('0x27')](function(_0x5a64f0){if(_0x5a64f0){return _0x5a64f0?{'count':_0x310d20,'rows':_0x5a64f0}:null;}})[_0xffff('0x27')](respondWithResult(_0x45ea5e,null))[_0xffff('0x46')](handleError(_0x45ea5e,null));}; \ No newline at end of file +var _0xe14f=['role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserOpenchannelQueue','nolimit','OpenchannelQueueId','findAll','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','hasOwnProperty','addTeams','User','online','voicePause','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','from','team_has_openchannel_queues','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','ids','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','findOne','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','index','OpenchannelQueue','rawAttributes','model','keys','query','intersection','fields','attributes','order','sort','where','pick','filters','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x24386b,_0x3465ed){var _0x2bc907=function(_0x56da0a){while(--_0x56da0a){_0x24386b['push'](_0x24386b['shift']());}};_0x2bc907(++_0x3465ed);}(_0xe14f,0xc8));var _0xfe14=function(_0x29cd50,_0x2055f7){_0x29cd50=_0x29cd50-0x0;var _0x111d80=_0xe14f[_0x29cd50];return _0x111d80;};'use strict';var pdf=require(_0xfe14('0x0'));var emlformat=require(_0xfe14('0x1'));var rimraf=require(_0xfe14('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe14('0x3'));var rp=require('request-promise');var moment=require(_0xfe14('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfe14('0x5'));var util=require(_0xfe14('0x6'));var path=require(_0xfe14('0x7'));var sox=require(_0xfe14('0x8'));var csv=require(_0xfe14('0x9'));var ejs=require(_0xfe14('0xa'));var fs=require('fs');var _=require(_0xfe14('0xb'));var squel=require(_0xfe14('0xc'));var crypto=require(_0xfe14('0xd'));var jsforce=require(_0xfe14('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfe14('0xf'));var Papa=require(_0xfe14('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xfe14('0x11'));var logger=require(_0xfe14('0x12'))(_0xfe14('0x13'));var utils=require(_0xfe14('0x14'));var config=require(_0xfe14('0x15'));var db=require(_0xfe14('0x16'))['db'];config[_0xfe14('0x17')]=_['defaults'](config[_0xfe14('0x17')],{'host':_0xfe14('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfe14('0x17')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x22d0b5,_0x1ab3ef){_0x1ab3ef=_0x1ab3ef||0xcc;return function(_0x36a257){if(_0x36a257){return _0x22d0b5[_0xfe14('0x19')](_0x1ab3ef);}return _0x22d0b5[_0xfe14('0x1a')](_0x1ab3ef)[_0xfe14('0x1b')]();};}function respondWithResult(_0x1f8710,_0x40fec1){_0x40fec1=_0x40fec1||0xc8;return function(_0x6ae711){if(_0x6ae711){return _0x1f8710[_0xfe14('0x1a')](_0x40fec1)[_0xfe14('0x1c')](_0x6ae711);}};}function respondWithFilteredResult(_0x45aab4,_0x2424ff){return function(_0x134811){if(_0x134811){var _0x74dc8a=_0x134811[_0xfe14('0x1d')],_0x3174c4=_0x2424ff[_0xfe14('0x1e')],_0x832d33=_0x2424ff[_0xfe14('0x1e')]+_0x2424ff[_0xfe14('0x1f')],_0x2ff8aa;if(_0x832d33>=_0x74dc8a){_0x832d33=_0x74dc8a;_0x2ff8aa=0xc8;}else{_0x2ff8aa=0xce;}_0x45aab4[_0xfe14('0x1a')](_0x2ff8aa);return _0x45aab4[_0xfe14('0x20')](_0xfe14('0x21'),_0x3174c4+'-'+_0x832d33+'/'+_0x74dc8a)[_0xfe14('0x1c')](_0x134811);}return null;};}function patchUpdates(_0x5216c2){return function(_0x588075){try{jsonpatch[_0xfe14('0x22')](_0x588075,_0x5216c2,!![]);}catch(_0x588d34){return BPromise['reject'](_0x588d34);}return _0x588075[_0xfe14('0x23')]();};}function saveUpdates(_0x4fb36c,_0x38edba){return function(_0x29866b){if(_0x29866b){return _0x29866b[_0xfe14('0x24')](_0x4fb36c)[_0xfe14('0x25')](function(_0x2e9f43){return _0x2e9f43;});}return null;};}function removeEntity(_0x250c99,_0x298178){return function(_0x4b5ac7){if(_0x4b5ac7){return _0x4b5ac7[_0xfe14('0x26')]()[_0xfe14('0x25')](function(){var _0x59d3ac=_0x4b5ac7[_0xfe14('0x27')]({'plain':!![]});var _0x3762ad=_0xfe14('0x28');return db[_0xfe14('0x29')][_0xfe14('0x26')]({'where':{'type':_0x3762ad,'resourceId':_0x59d3ac['id']}})[_0xfe14('0x25')](function(){return _0x4b5ac7;});})['then'](function(){_0x250c99[_0xfe14('0x1a')](0xcc)[_0xfe14('0x1b')]();});}};}function handleEntityNotFound(_0x107b18,_0x366aec){return function(_0x10b26f){if(!_0x10b26f){_0x107b18[_0xfe14('0x19')](0x194);}return _0x10b26f;};}function handleError(_0x40f454,_0x5071d3){_0x5071d3=_0x5071d3||0x1f4;return function(_0x398dfb){logger[_0xfe14('0x2a')](_0x398dfb[_0xfe14('0x2b')]);if(_0x398dfb[_0xfe14('0x2c')]){delete _0x398dfb['name'];}_0x40f454[_0xfe14('0x1a')](_0x5071d3)['send'](_0x398dfb);};}exports[_0xfe14('0x2d')]=function(_0x3e8e0d,_0x301641){var _0x5a6e58={},_0x51ac49={},_0x15fe37={'count':0x0,'rows':[]};var _0x1aa10d=db[_0xfe14('0x2e')][_0xfe14('0x2f')];_0x51ac49[_0xfe14('0x30')]=_[_0xfe14('0x31')](_0x1aa10d);_0x51ac49[_0xfe14('0x32')]=_['keys'](_0x3e8e0d['query']);_0x51ac49['filters']=_[_0xfe14('0x33')](_0x51ac49[_0xfe14('0x30')],_0x51ac49[_0xfe14('0x32')]);_0x5a6e58['attributes']=_[_0xfe14('0x33')](_0x51ac49[_0xfe14('0x30')],qs[_0xfe14('0x34')](_0x3e8e0d[_0xfe14('0x32')]['fields']));_0x5a6e58[_0xfe14('0x35')]=_0x5a6e58[_0xfe14('0x35')]['length']?_0x5a6e58[_0xfe14('0x35')]:_0x51ac49['model'];if(!_0x3e8e0d[_0xfe14('0x32')]['hasOwnProperty']('nolimit')){_0x5a6e58['limit']=qs['limit'](_0x3e8e0d['query'][_0xfe14('0x1f')]);_0x5a6e58[_0xfe14('0x1e')]=qs[_0xfe14('0x1e')](_0x3e8e0d['query'][_0xfe14('0x1e')]);}_0x5a6e58[_0xfe14('0x36')]=qs[_0xfe14('0x37')](_0x3e8e0d[_0xfe14('0x32')]['sort']);_0x5a6e58[_0xfe14('0x38')]=qs['filters'](_[_0xfe14('0x39')](_0x3e8e0d[_0xfe14('0x32')],_0x51ac49[_0xfe14('0x3a')]));if(_0x3e8e0d[_0xfe14('0x32')][_0xfe14('0x3b')]){_0x5a6e58[_0xfe14('0x38')]=_[_0xfe14('0x3c')](_0x5a6e58['where'],{'$or':_[_0xfe14('0x3d')](_0x1aa10d,function(_0x2f949b){if(_0x2f949b[_0xfe14('0x3e')][_0xfe14('0x3f')]!==_0xfe14('0x40')){var _0x8964f6={};_0x8964f6[_0x2f949b[_0xfe14('0x41')]]={'$like':'%'+_0x3e8e0d['query']['filter']+'%'};return _0x8964f6;}})});}_0x5a6e58=_[_0xfe14('0x3c')]({},_0x5a6e58,_0x3e8e0d[_0xfe14('0x42')]);var _0x231c76={'where':_0x5a6e58['where']};return db['OpenchannelQueue'][_0xfe14('0x1d')](_0x231c76)[_0xfe14('0x25')](function(_0x41d09a){_0x15fe37[_0xfe14('0x1d')]=_0x41d09a;if(_0x3e8e0d['query'][_0xfe14('0x43')]){_0x5a6e58[_0xfe14('0x44')]=[{'all':!![]}];}return db[_0xfe14('0x2e')]['findAll'](_0x5a6e58);})[_0xfe14('0x25')](function(_0x3e544e){_0x15fe37[_0xfe14('0x45')]=_0x3e544e;return _0x15fe37;})[_0xfe14('0x25')](respondWithFilteredResult(_0x301641,_0x5a6e58))[_0xfe14('0x46')](handleError(_0x301641,null));};exports['show']=function(_0x49ff3a,_0x3d25cb){var _0x50c650={'raw':!![],'where':{'id':_0x49ff3a[_0xfe14('0x47')]['id']}},_0x37dc9f={};_0x37dc9f[_0xfe14('0x30')]=_[_0xfe14('0x31')](db['OpenchannelQueue']['rawAttributes']);_0x37dc9f['query']=_[_0xfe14('0x31')](_0x49ff3a[_0xfe14('0x32')]);_0x37dc9f[_0xfe14('0x3a')]=_['intersection'](_0x37dc9f[_0xfe14('0x30')],_0x37dc9f['query']);_0x50c650[_0xfe14('0x35')]=_[_0xfe14('0x33')](_0x37dc9f['model'],qs['fields'](_0x49ff3a[_0xfe14('0x32')][_0xfe14('0x34')]));_0x50c650[_0xfe14('0x35')]=_0x50c650[_0xfe14('0x35')][_0xfe14('0x48')]?_0x50c650[_0xfe14('0x35')]:_0x37dc9f[_0xfe14('0x30')];if(_0x49ff3a[_0xfe14('0x32')][_0xfe14('0x43')]){_0x50c650[_0xfe14('0x44')]=[{'all':!![]}];}_0x50c650=_[_0xfe14('0x3c')]({},_0x50c650,_0x49ff3a[_0xfe14('0x42')]);return db[_0xfe14('0x2e')][_0xfe14('0x49')](_0x50c650)[_0xfe14('0x25')](handleEntityNotFound(_0x3d25cb,null))['then'](respondWithResult(_0x3d25cb,null))[_0xfe14('0x46')](handleError(_0x3d25cb,null));};exports[_0xfe14('0x4a')]=function(_0x4dadf1,_0x2f4788){return db[_0xfe14('0x2e')][_0xfe14('0x4a')](_0x4dadf1[_0xfe14('0x4b')],{})[_0xfe14('0x25')](function(_0x39882b){var _0x41b9de=_0x4dadf1[_0xfe14('0x4c')]['get']({'plain':!![]});if(!_0x41b9de)throw new Error(_0xfe14('0x4d'));if(_0x41b9de[_0xfe14('0x4e')]===_0xfe14('0x4c')){var _0x10cd73=_0x39882b['get']({'plain':!![]});var _0x49966f=_0xfe14('0x28');return db[_0xfe14('0x4f')][_0xfe14('0x49')]({'where':{'name':_0x49966f,'userProfileId':_0x41b9de[_0xfe14('0x50')]},'raw':!![]})[_0xfe14('0x25')](function(_0x362354){if(_0x362354&&_0x362354[_0xfe14('0x51')]===0x0){return db[_0xfe14('0x29')]['create']({'name':_0x10cd73['name'],'resourceId':_0x10cd73['id'],'type':_0x362354['name'],'sectionId':_0x362354['id']},{})['then'](function(){return _0x39882b;});}else{return _0x39882b;}})[_0xfe14('0x46')](function(_0x1f0686){logger['error'](_0xfe14('0x52'),_0x1f0686);throw _0x1f0686;});}return _0x39882b;})['then'](respondWithResult(_0x2f4788,0xc9))[_0xfe14('0x46')](handleError(_0x2f4788,null));};exports['update']=function(_0x3427db,_0x40eb05){if(_0x3427db['body']['id']){delete _0x3427db['body']['id'];}return db[_0xfe14('0x2e')][_0xfe14('0x49')]({'where':{'id':_0x3427db[_0xfe14('0x47')]['id']}})[_0xfe14('0x25')](handleEntityNotFound(_0x40eb05,null))[_0xfe14('0x25')](saveUpdates(_0x3427db[_0xfe14('0x4b')],null))[_0xfe14('0x25')](respondWithResult(_0x40eb05,null))['catch'](handleError(_0x40eb05,null));};exports[_0xfe14('0x26')]=function(_0x4e3818,_0x46f074){return db[_0xfe14('0x2e')]['find']({'where':{'id':_0x4e3818[_0xfe14('0x47')]['id']}})[_0xfe14('0x25')](handleEntityNotFound(_0x46f074,null))[_0xfe14('0x25')](removeEntity(_0x46f074,null))['catch'](handleError(_0x46f074,null));};exports[_0xfe14('0x53')]=function(_0x448d9f,_0x32f155){return db[_0xfe14('0x2e')]['describe']()['then'](respondWithResult(_0x32f155,null))[_0xfe14('0x46')](handleError(_0x32f155,null));};exports[_0xfe14('0x54')]=function(_0x554324,_0x2b7704,_0x2fadc6){var _0xc10384={'raw':!![],'where':{}},_0xe60e5a={},_0x594fc8;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x554324['params']['id']}})[_0xfe14('0x25')](handleEntityNotFound(_0x2b7704,null))[_0xfe14('0x25')](function(_0x507f76){if(_0x507f76){_0x594fc8=_0x507f76[_0xfe14('0x27')]({'plain':!![]});_0xe60e5a[_0xfe14('0x30')]=_[_0xfe14('0x31')](db[_0xfe14('0x55')][_0xfe14('0x2f')]);_0xe60e5a[_0xfe14('0x32')]=_['keys'](_0x554324[_0xfe14('0x32')]);_0xe60e5a['filters']=_['intersection'](_0xe60e5a[_0xfe14('0x30')],_0xe60e5a['query']);_0xc10384[_0xfe14('0x35')]=_[_0xfe14('0x33')](_0xe60e5a[_0xfe14('0x30')],qs[_0xfe14('0x34')](_0x554324[_0xfe14('0x32')]['fields']));_0xc10384[_0xfe14('0x35')]=_0xc10384['attributes'][_0xfe14('0x48')]?_0xc10384[_0xfe14('0x35')]:_0xe60e5a[_0xfe14('0x30')];if(!_0x554324['query']['hasOwnProperty'](_0xfe14('0x56'))){_0xc10384['limit']=qs[_0xfe14('0x1f')](_0x554324[_0xfe14('0x32')][_0xfe14('0x1f')]);_0xc10384[_0xfe14('0x1e')]=qs['offset'](_0x554324[_0xfe14('0x32')]['offset']);}_0xc10384[_0xfe14('0x36')]=qs['sort'](_0x554324[_0xfe14('0x32')][_0xfe14('0x37')]);_0xc10384[_0xfe14('0x38')]=qs[_0xfe14('0x3a')](_[_0xfe14('0x39')](_0x554324[_0xfe14('0x32')],_0xe60e5a['filters']));_0xc10384['where'][_0xfe14('0x57')]=_0x507f76['id'];if(_0x554324[_0xfe14('0x32')][_0xfe14('0x3b')]){_0xc10384[_0xfe14('0x38')]=_[_0xfe14('0x3c')](_0xc10384[_0xfe14('0x38')],{'$or':_[_0xfe14('0x3d')](_0xc10384[_0xfe14('0x35')],function(_0x5f0b8e){var _0x3a7d15={};_0x3a7d15[_0x5f0b8e]={'$like':'%'+_0x554324[_0xfe14('0x32')][_0xfe14('0x3b')]+'%'};return _0x3a7d15;})});}_0xc10384=_[_0xfe14('0x3c')]({},_0xc10384,_0x554324[_0xfe14('0x42')]);return db[_0xfe14('0x55')][_0xfe14('0x58')](_0xc10384);}})[_0xfe14('0x25')](function(_0x49cd1f){if(_0x49cd1f){return db['User'][_0xfe14('0x59')]({'where':{'id':_['map'](_0x49cd1f,_0xfe14('0x5a')),'role':_0xfe14('0x5b')},'attributes':['id',_0xfe14('0x2c'),_0xfe14('0x5c'),_0xfe14('0x5d'),_0xfe14('0x5e')]});}})[_0xfe14('0x25')](function(_0x19a7ea){if(_0x19a7ea){return{'count':_0x19a7ea[_0xfe14('0x1d')],'rows':_['map'](_0x19a7ea[_0xfe14('0x45')],function(_0x5d07f5){return{'membername':_0x5d07f5[_0xfe14('0x2c')],'UserId':_0x5d07f5['id'],'queue_name':_0x594fc8[_0xfe14('0x2c')],'OpenchannelQueueId':_0x594fc8['id'],'interface':util['format'](_0xfe14('0x5f'),_0xfe14('0x60'),_0x5d07f5['name']),'penalty':0x0,'paused':_0x5d07f5[_0xfe14('0x5c')],'createdAt':_0x5d07f5[_0xfe14('0x5e')],'updatedAt':_0x5d07f5['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2b7704,_0xc10384))[_0xfe14('0x46')](handleError(_0x2b7704,null));};exports[_0xfe14('0x61')]=function(_0x34870a,_0x7a63af,_0x236bdb){var _0x245d56={};var _0x2b5f59={};var _0x3d305a;var _0x1ed409;return db[_0xfe14('0x2e')]['findOne']({'where':{'id':_0x34870a['params']['id']}})[_0xfe14('0x25')](handleEntityNotFound(_0x7a63af,null))[_0xfe14('0x25')](function(_0x5c38b6){if(_0x5c38b6){_0x3d305a=_0x5c38b6;_0x2b5f59['model']=_['keys'](db[_0xfe14('0x62')]['rawAttributes']);_0x2b5f59[_0xfe14('0x32')]=_[_0xfe14('0x31')](_0x34870a['query']);_0x2b5f59['filters']=_['intersection'](_0x2b5f59['model'],_0x2b5f59[_0xfe14('0x32')]);_0x245d56['attributes']=_['intersection'](_0x2b5f59[_0xfe14('0x30')],qs['fields'](_0x34870a['query']['fields']));_0x245d56[_0xfe14('0x35')]=_0x245d56['attributes'][_0xfe14('0x48')]?_0x245d56[_0xfe14('0x35')]:_0x2b5f59[_0xfe14('0x30')];_0x245d56[_0xfe14('0x36')]=qs[_0xfe14('0x37')](_0x34870a['query'][_0xfe14('0x37')]);_0x245d56[_0xfe14('0x38')]=qs[_0xfe14('0x3a')](_[_0xfe14('0x39')](_0x34870a[_0xfe14('0x32')],_0x2b5f59[_0xfe14('0x3a')]));if(_0x34870a[_0xfe14('0x32')][_0xfe14('0x3b')]){_0x245d56['where']=_['merge'](_0x245d56['where'],{'$or':_['map'](_0x245d56[_0xfe14('0x35')],function(_0x527510){var _0x36d9e2={};_0x36d9e2[_0x527510]={'$like':'%'+_0x34870a[_0xfe14('0x32')][_0xfe14('0x3b')]+'%'};return _0x36d9e2;})});}_0x245d56=_['merge']({},_0x245d56,_0x34870a[_0xfe14('0x42')]);return _0x3d305a[_0xfe14('0x61')](_0x245d56);}})['then'](function(_0x57cbe2){if(_0x57cbe2){_0x1ed409=_0x57cbe2['length'];if(!_0x34870a['query'][_0xfe14('0x63')]('nolimit')){_0x245d56[_0xfe14('0x1f')]=qs[_0xfe14('0x1f')](_0x34870a[_0xfe14('0x32')]['limit']);_0x245d56[_0xfe14('0x1e')]=qs[_0xfe14('0x1e')](_0x34870a[_0xfe14('0x32')][_0xfe14('0x1e')]);}return _0x3d305a[_0xfe14('0x61')](_0x245d56);}})[_0xfe14('0x25')](function(_0x4f1280){if(_0x4f1280){return _0x4f1280?{'count':_0x1ed409,'rows':_0x4f1280}:null;}})[_0xfe14('0x25')](respondWithResult(_0x7a63af,null))['catch'](handleError(_0x7a63af,null));};exports[_0xfe14('0x64')]=function(_0x3b8306,_0x12c7d3,_0x3c2fd9){var _0x1ae7da=_0x3b8306[_0xfe14('0x4b')]['teams'];return db[_0xfe14('0x62')][_0xfe14('0x58')]({'where':{'id':_[_0xfe14('0x3d')](_0x1ae7da,'id')},'attributes':['id'],'include':[{'model':db[_0xfe14('0x65')],'as':'Agents','attributes':['id',_0xfe14('0x2c'),_0xfe14('0x66'),_0xfe14('0x67'),'interface'],'raw':!![]}]})[_0xfe14('0x25')](function(_0x183f1e){if(_0x183f1e){var _0x3ae49a=_[_0xfe14('0x68')](_0x183f1e,function(_0x464e5f){var _0x505634=_0x464e5f[_0xfe14('0x27')]({'plain':!![]});return _0x505634[_0xfe14('0x69')];});return db['OpenchannelQueue'][_0xfe14('0x49')]({'where':{'id':_0x3b8306[_0xfe14('0x47')]['id']}})[_0xfe14('0x25')](function(_0x5a1576){return db[_0xfe14('0x6a')][_0xfe14('0x6b')](function(_0x4d7d05){return _0x5a1576['addTeams'](_[_0xfe14('0x3d')](_0x1ae7da,'id'),{'transaction':_0x4d7d05})[_0xfe14('0x25')](function(){return BPromise[_0xfe14('0x6c')](_0x3ae49a,function(_0x46f855){return db[_0xfe14('0x55')][_0xfe14('0x6d')]({'where':{'UserId':_0x46f855['id'],'OpenchannelQueueId':_0x3b8306[_0xfe14('0x47')]['id']},'transaction':_0x4d7d05});});})[_0xfe14('0x25')](function(){_0x3ae49a[_0xfe14('0x6e')](function(_0x2a0571){socket[_0xfe14('0x6f')](_0xfe14('0x70'),{'UserId':_0x2a0571['id'],'OpenchannelQueueId':_0x5a1576['id']});});});});});}})['then'](respondWithStatusCode(_0x12c7d3,null))[_0xfe14('0x46')](handleError(_0x12c7d3,null));};exports[_0xfe14('0x71')]=function(_0xc85e82,_0x1b07ed,_0x13bae0){return db['Team'][_0xfe14('0x58')]({'where':{'id':_0xc85e82['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xfe14('0x65')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1b07ed,null))['then'](function(_0x1f232c){var _0xf5479=_[_0xfe14('0x3d')](_0x1f232c,'id');var _0x744655=[];var _0x242e91=[];var _0x1aed9f=squel[_0xfe14('0x72')]();_0x1aed9f[_0xfe14('0x41')]('tq.TeamId')[_0xfe14('0x73')](_0xfe14('0x74'),'tq')['join']('user_has_teams','ut',_0xfe14('0x75'))[_0xfe14('0x38')](_0xfe14('0x76'),_0xc85e82['params']['id']);for(var _0x46d6ac=0x0;_0x46d6ac<_0x1f232c[_0xfe14('0x48')];_0x46d6ac+=0x1){let _0x271a1e=_0x1f232c[_0x46d6ac];for(var _0x5ed8da=0x0;_0x5ed8da<_0x271a1e[_0xfe14('0x69')][_0xfe14('0x48')];_0x5ed8da+=0x1){let _0x4257c7=_0x271a1e[_0xfe14('0x69')][_0x5ed8da];var _0x1f1e76=_0x1aed9f[_0xfe14('0x77')]();_0x1f1e76[_0xfe14('0x38')](_0xfe14('0x78'),_0x4257c7['id']);_0x242e91['push'](db[_0xfe14('0x6a')][_0xfe14('0x32')](_0x1f1e76[_0xfe14('0x79')](),{'type':db[_0xfe14('0x6a')][_0xfe14('0x7a')][_0xfe14('0x7b')]})[_0xfe14('0x25')](function(_0xa7e01c){if(_0xa7e01c['length']===0x1){return _0x4257c7['id'];}else{var _0x12bfb6=_[_0xfe14('0x7c')](_['map'](_0xa7e01c,'TeamId'),function(_0x2bfac7){return _[_0xfe14('0x7d')](_0xf5479,_0x2bfac7);});if(_0x12bfb6){return _0x4257c7['id'];}}}));}}return BPromise[_0xfe14('0x7e')](_0x242e91)[_0xfe14('0x25')](function(_0x57ecc0){_0x744655=_(_0x744655)[_0xfe14('0x7f')](_0x57ecc0)[_0xfe14('0x80')]()[_0xfe14('0x81')]();return db[_0xfe14('0x2e')][_0xfe14('0x49')]({'where':{'id':_0xc85e82[_0xfe14('0x47')]['id']}})[_0xfe14('0x25')](function(_0x18b1a0){return db[_0xfe14('0x6a')][_0xfe14('0x6b')](function(_0x5b30f0){return _0x18b1a0[_0xfe14('0x71')](_0xc85e82[_0xfe14('0x32')][_0xfe14('0x82')],{'transaction':_0x5b30f0})[_0xfe14('0x25')](function(){if(!_['isEmpty'](_0x744655)){return _0x18b1a0[_0xfe14('0x83')](_0x744655,{'transaction':_0x5b30f0});}})['then'](function(){_0x744655[_0xfe14('0x6e')](function(_0x47c3d0){socket[_0xfe14('0x6f')](_0xfe14('0x84'),{'UserId':_0x47c3d0,'OpenchannelQueueId':_0x18b1a0['id']});});});});});});})[_0xfe14('0x25')](respondWithStatusCode(_0x1b07ed,null))[_0xfe14('0x46')](handleError(_0x1b07ed,null));};exports['addAgents']=function(_0x148f0a,_0x324f32,_0x5f2f99){return db['OpenchannelQueue'][_0xfe14('0x49')]({'where':{'id':_0x148f0a[_0xfe14('0x47')]['id']}})[_0xfe14('0x25')](handleEntityNotFound(_0x324f32,null))['then'](function(_0x3becc9){if(_0x3becc9){return _0x3becc9[_0xfe14('0x85')](_0x148f0a[_0xfe14('0x4b')][_0xfe14('0x82')],_[_0xfe14('0x86')](_0x148f0a[_0xfe14('0x4b')],[_0xfe14('0x82'),'id'])||{})[_0xfe14('0x87')](function(_0x3bcf4a){for(var _0x388ab9=0x0;_0x388ab9<_0x148f0a[_0xfe14('0x4b')][_0xfe14('0x82')]['length'];_0x388ab9+=0x1){socket[_0xfe14('0x6f')](_0xfe14('0x70'),{'UserId':_0x148f0a[_0xfe14('0x4b')][_0xfe14('0x82')][_0x388ab9],'OpenchannelQueueId':_0x148f0a[_0xfe14('0x47')]['id']});}return _0x3bcf4a;});}})[_0xfe14('0x25')](respondWithResult(_0x324f32,null))[_0xfe14('0x46')](handleError(_0x324f32,null));};exports[_0xfe14('0x83')]=function(_0x4da55e,_0x3cf711,_0x479995){return db['OpenchannelQueue']['find']({'where':{'id':_0x4da55e[_0xfe14('0x47')]['id']}})[_0xfe14('0x25')](handleEntityNotFound(_0x3cf711,null))[_0xfe14('0x25')](function(_0x33bafd){if(_0x33bafd){return _0x33bafd[_0xfe14('0x83')](_0x4da55e['query'][_0xfe14('0x82')])['then'](function(){if(_[_0xfe14('0x88')](_0x4da55e['query']['ids'])){for(var _0x567ba1=0x0;_0x567ba1<_0x4da55e[_0xfe14('0x32')][_0xfe14('0x82')][_0xfe14('0x48')];_0x567ba1+=0x1){socket[_0xfe14('0x6f')](_0xfe14('0x84'),{'UserId':Number(_0x4da55e['query'][_0xfe14('0x82')][_0x567ba1]),'OpenchannelQueueId':Number(_0x4da55e[_0xfe14('0x47')]['id'])});}}else{socket['emit'](_0xfe14('0x84'),{'UserId':Number(_0x4da55e[_0xfe14('0x32')][_0xfe14('0x82')]),'OpenchannelQueueId':Number(_0x4da55e[_0xfe14('0x47')]['id'])});}});}})[_0xfe14('0x25')](respondWithStatusCode(_0x3cf711,null))['catch'](handleError(_0x3cf711,null));};exports[_0xfe14('0x89')]=function(_0x12c678,_0xf443d4,_0x45835c){var _0x17577c={};var _0x254ac4={};var _0x50ab87;var _0x3bd221;return db[_0xfe14('0x2e')][_0xfe14('0x8a')]({'where':{'id':_0x12c678[_0xfe14('0x47')]['id']}})['then'](handleEntityNotFound(_0xf443d4,null))[_0xfe14('0x25')](function(_0x4b71c7){if(_0x4b71c7){_0x50ab87=_0x4b71c7;_0x254ac4[_0xfe14('0x30')]=_['keys'](db[_0xfe14('0x65')]['rawAttributes']);_0x254ac4['query']=_[_0xfe14('0x31')](_0x12c678[_0xfe14('0x32')]);_0x254ac4[_0xfe14('0x3a')]=_[_0xfe14('0x33')](_0x254ac4[_0xfe14('0x30')],_0x254ac4[_0xfe14('0x32')]);_0x17577c[_0xfe14('0x35')]=_[_0xfe14('0x33')](_0x254ac4[_0xfe14('0x30')],qs[_0xfe14('0x34')](_0x12c678[_0xfe14('0x32')]['fields']));_0x17577c['attributes']=_0x17577c[_0xfe14('0x35')]['length']?_0x17577c[_0xfe14('0x35')]:_0x254ac4[_0xfe14('0x30')];_0x17577c[_0xfe14('0x36')]=qs[_0xfe14('0x37')](_0x12c678[_0xfe14('0x32')][_0xfe14('0x37')]);_0x17577c[_0xfe14('0x38')]=qs[_0xfe14('0x3a')](_[_0xfe14('0x39')](_0x12c678[_0xfe14('0x32')],_0x254ac4[_0xfe14('0x3a')]));if(_0x12c678[_0xfe14('0x32')]['filter']){_0x17577c['where']=_[_0xfe14('0x3c')](_0x17577c[_0xfe14('0x38')],{'$or':_[_0xfe14('0x3d')](_0x17577c[_0xfe14('0x35')],function(_0x4e0b39){var _0x4c4afa={};_0x4c4afa[_0x4e0b39]={'$like':'%'+_0x12c678['query'][_0xfe14('0x3b')]+'%'};return _0x4c4afa;})});}_0x17577c=_['merge']({},_0x17577c,_0x12c678[_0xfe14('0x42')]);return _0x50ab87[_0xfe14('0x89')](_0x17577c);}})['then'](function(_0x3ead87){if(_0x3ead87){_0x3bd221=_0x3ead87['length'];if(!_0x12c678[_0xfe14('0x32')][_0xfe14('0x63')]('nolimit')){_0x17577c[_0xfe14('0x1f')]=qs['limit'](_0x12c678[_0xfe14('0x32')][_0xfe14('0x1f')]);_0x17577c[_0xfe14('0x1e')]=qs[_0xfe14('0x1e')](_0x12c678[_0xfe14('0x32')][_0xfe14('0x1e')]);}return _0x50ab87[_0xfe14('0x89')](_0x17577c);}})[_0xfe14('0x25')](function(_0x24f190){if(_0x24f190){return _0x24f190?{'count':_0x3bd221,'rows':_0x24f190}:null;}})[_0xfe14('0x25')](respondWithResult(_0xf443d4,null))['catch'](handleError(_0xf443d4,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index d37b358..1599a5f 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 _0x5fa2=['exports','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x5fa2,0x143));var _0x25fa=function(_0x1e8a4c,_0x23e540){_0x1e8a4c=_0x1e8a4c-0x0;var _0x368ab6=_0x5fa2[_0x1e8a4c];return _0x368ab6;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x25fa('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x25fa('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x25fa('0x2'),'afterDestroy':_0x25fa('0x3')};function emitEvent(_0x3da29f){return function(_0x21558e,_0x407701,_0x58dc13){OpenchannelQueueEvents[_0x25fa('0x4')](_0x3da29f+':'+_0x21558e['id'],_0x21558e);OpenchannelQueueEvents[_0x25fa('0x4')](_0x3da29f,_0x21558e);_0x58dc13(null);};}for(var e in events){if(events[_0x25fa('0x5')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x25fa('0x6')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x5eec=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','emit'];(function(_0x470680,_0x18246e){var _0x2b08a8=function(_0x22dc2c){while(--_0x22dc2c){_0x470680['push'](_0x470680['shift']());}};_0x2b08a8(++_0x18246e);}(_0x5eec,0x71));var _0xc5ee=function(_0x26a484,_0x190db3){_0x26a484=_0x26a484-0x0;var _0x372785=_0x5eec[_0x26a484];return _0x372785;};'use strict';var EventEmitter=require(_0xc5ee('0x0'));var OpenchannelQueue=require(_0xc5ee('0x1'))['db'][_0xc5ee('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xc5ee('0x3')](0x0);var events={'afterCreate':_0xc5ee('0x4'),'afterUpdate':_0xc5ee('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4c1851){return function(_0x2cdc27,_0x2f0cb3,_0x2df5d0){OpenchannelQueueEvents[_0xc5ee('0x6')](_0x4c1851+':'+_0x2cdc27['id'],_0x2cdc27);OpenchannelQueueEvents[_0xc5ee('0x6')](_0x4c1851,_0x2cdc27);_0x2df5d0(null);};}for(var e in events){if(events[_0xc5ee('0x7')](e)){var event=events[e];OpenchannelQueue[_0xc5ee('0x8')](e,emitEvent(event));}}module[_0xc5ee('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index bae7be3..fd7bab7 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 _0x1b75=['request-promise','path','rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4e5b79,_0x37979b){var _0x28e555=function(_0xa9b6c8){while(--_0xa9b6c8){_0x4e5b79['push'](_0x4e5b79['shift']());}};_0x28e555(++_0x37979b);}(_0x1b75,0xa4));var _0x51b7=function(_0x44fef1,_0x132cf4){_0x44fef1=_0x44fef1-0x0;var _0x3c3a04=_0x1b75[_0x44fef1];return _0x3c3a04;};'use strict';var _=require(_0x51b7('0x0'));var util=require('util');var logger=require(_0x51b7('0x1'))(_0x51b7('0x2'));var moment=require(_0x51b7('0x3'));var BPromise=require(_0x51b7('0x4'));var rp=require(_0x51b7('0x5'));var fs=require('fs');var path=require(_0x51b7('0x6'));var rimraf=require(_0x51b7('0x7'));var config=require('../../config/environment');var attributes=require(_0x51b7('0x8'));module[_0x51b7('0x9')]=function(_0x27d2f5,_0x5936e0){return _0x27d2f5[_0x51b7('0xa')](_0x51b7('0xb'),attributes,{'tableName':_0x51b7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb47e=['rimraf','../../config/environment','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xb47e,0x145));var _0xeb47=function(_0x25d9a9,_0x1c71b7){_0x25d9a9=_0x25d9a9-0x0;var _0x4158b4=_0xb47e[_0x25d9a9];return _0x4158b4;};'use strict';var _=require(_0xeb47('0x0'));var util=require(_0xeb47('0x1'));var logger=require(_0xeb47('0x2'))('api');var moment=require('moment');var BPromise=require(_0xeb47('0x3'));var rp=require(_0xeb47('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb47('0x5'));var config=require(_0xeb47('0x6'));var attributes=require('./openchannelQueue.attributes');module['exports']=function(_0x49b44b,_0x6178ba){return _0x49b44b[_0xeb47('0x7')](_0xeb47('0x8'),attributes,{'tableName':_0xeb47('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 6bdb2d6..5604754 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 _0xa37e=['map','include','model','ShowOpenchannelQueue','find','where','catch','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','attributes','limit'];(function(_0x5137dd,_0x55c6cb){var _0x11dea6=function(_0x290bce){while(--_0x290bce){_0x5137dd['push'](_0x5137dd['shift']());}};_0x11dea6(++_0x55c6cb);}(_0xa37e,0x97));var _0xea37=function(_0x152691,_0x521046){_0x152691=_0x152691-0x0;var _0x339603=_0xa37e[_0x152691];return _0x339603;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xea37('0x0'));var BPromise=require(_0xea37('0x1'));var rs=require(_0xea37('0x2'));var fs=require('fs');var Redis=require(_0xea37('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xea37('0x4'));var logger=require('../../config/logger')(_0xea37('0x5'));var config=require(_0xea37('0x6'));var jayson=require(_0xea37('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xea37('0x8')]=_['defaults'](config['redis'],{'host':_0xea37('0x9'),'port':0x18eb});var socket=require(_0xea37('0xa'))(new Redis(config[_0xea37('0x8')]));require(_0xea37('0xb'))['register'](socket);function respondWithRpcPromise(_0x315e5f,_0x37ca45,_0x8371a){return new BPromise(function(_0x55d4de,_0x5060cd){return client[_0xea37('0xc')](_0x315e5f,_0x8371a)[_0xea37('0xd')](function(_0x3cd18b){logger['info'](_0xea37('0xe'),_0x37ca45,_0xea37('0xf'));logger[_0xea37('0x10')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x37ca45,_0xea37('0xf'),JSON[_0xea37('0x11')](_0x3cd18b));if(_0x3cd18b['error']){if(_0x3cd18b[_0xea37('0x12')]['code']===0x1f4){logger[_0xea37('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x37ca45,_0x3cd18b[_0xea37('0x12')][_0xea37('0x13')]);return _0x5060cd(_0x3cd18b[_0xea37('0x12')][_0xea37('0x13')]);}logger['error'](_0xea37('0xe'),_0x37ca45,_0x3cd18b['error']['message']);return _0x55d4de(_0x3cd18b[_0xea37('0x12')]['message']);}else{logger[_0xea37('0x14')](_0xea37('0xe'),_0x37ca45,'request\x20sent');_0x55d4de(_0x3cd18b[_0xea37('0x15')][_0xea37('0x13')]);}})['catch'](function(_0x786ee5){logger[_0xea37('0x12')](_0xea37('0xe'),_0x37ca45,_0x786ee5);_0x5060cd(_0x786ee5);});});}exports[_0xea37('0x16')]=function(_0xac3650){var _0x447fcb=this;return new Promise(function(_0x121812,_0x238567){return db[_0xea37('0x17')][_0xea37('0x18')]({'raw':_0xac3650['options']?_0xac3650[_0xea37('0x19')][_0xea37('0x1a')]===undefined?!![]:![]:!![],'where':_0xac3650[_0xea37('0x19')]?_0xac3650['options']['where']||null:null,'attributes':_0xac3650[_0xea37('0x19')]?_0xac3650[_0xea37('0x19')][_0xea37('0x1b')]||null:null,'limit':_0xac3650[_0xea37('0x19')]?_0xac3650['options'][_0xea37('0x1c')]||null:null,'include':_0xac3650['options']?_0xac3650['options']['include']?_[_0xea37('0x1d')](_0xac3650['options'][_0xea37('0x1e')],function(_0x11dfbb){return{'model':db[_0x11dfbb[_0xea37('0x1f')]],'as':_0x11dfbb['as'],'attributes':_0x11dfbb[_0xea37('0x1b')],'include':_0x11dfbb[_0xea37('0x1e')]?_[_0xea37('0x1d')](_0x11dfbb['include'],function(_0x57a7cc){return{'model':db[_0x57a7cc['model']],'as':_0x57a7cc['as'],'attributes':_0x57a7cc[_0xea37('0x1b')],'include':_0x57a7cc[_0xea37('0x1e')]?_['map'](_0x57a7cc[_0xea37('0x1e')],function(_0x10d556){return{'model':db[_0x10d556[_0xea37('0x1f')]],'as':_0x10d556['as'],'attributes':_0x10d556['attributes']};}):[]};}):[]};}):[]:[]})[_0xea37('0xd')](function(_0x366acb){logger[_0xea37('0x14')](_0xea37('0x16'),_0xac3650);logger['debug'](_0xea37('0x16'),_0xac3650,JSON['stringify'](_0x366acb));_0x121812(_0x366acb);})['catch'](function(_0x1faf31){logger['error']('GetOpenchannelQueue',_0x1faf31['message'],_0xac3650);_0x238567(_0x447fcb[_0xea37('0x12')](0x1f4,_0x1faf31[_0xea37('0x13')]));});});};exports[_0xea37('0x20')]=function(_0x75e1f1){var _0x3e585e=this;return new Promise(function(_0x15b2b3,_0x5e2526){return db[_0xea37('0x17')][_0xea37('0x21')]({'raw':_0x75e1f1[_0xea37('0x19')]?_0x75e1f1[_0xea37('0x19')][_0xea37('0x1a')]===undefined?!![]:![]:!![],'where':_0x75e1f1[_0xea37('0x19')]?_0x75e1f1['options'][_0xea37('0x22')]||null:null,'attributes':_0x75e1f1['options']?_0x75e1f1[_0xea37('0x19')][_0xea37('0x1b')]||null:null,'include':_0x75e1f1[_0xea37('0x19')]?_0x75e1f1[_0xea37('0x19')][_0xea37('0x1e')]?_[_0xea37('0x1d')](_0x75e1f1[_0xea37('0x19')][_0xea37('0x1e')],function(_0x4d396a){return{'model':db[_0x4d396a[_0xea37('0x1f')]],'as':_0x4d396a['as'],'attributes':_0x4d396a[_0xea37('0x1b')],'include':_0x4d396a[_0xea37('0x1e')]?_[_0xea37('0x1d')](_0x4d396a[_0xea37('0x1e')],function(_0x393550){return{'model':db[_0x393550['model']],'as':_0x393550['as'],'attributes':_0x393550['attributes'],'include':_0x393550['include']?_[_0xea37('0x1d')](_0x393550['include'],function(_0x331778){return{'model':db[_0x331778['model']],'as':_0x331778['as'],'attributes':_0x331778['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x52905b){logger[_0xea37('0x14')](_0xea37('0x20'),_0x75e1f1);logger[_0xea37('0x10')](_0xea37('0x20'),_0x75e1f1,JSON[_0xea37('0x11')](_0x52905b));_0x15b2b3(_0x52905b);})[_0xea37('0x23')](function(_0x18da6e){logger[_0xea37('0x12')](_0xea37('0x20'),_0x18da6e['message'],_0x75e1f1);_0x5e2526(_0x3e585e[_0xea37('0x12')](0x1f4,_0x18da6e['message']));});});}; \ No newline at end of file +var _0xeedf=['map','model','find','ShowOpenchannelQueue','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','socket.io-emitter','request','then','info','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include'];(function(_0x50245d,_0x520a37){var _0x9db1ea=function(_0x32b280){while(--_0x32b280){_0x50245d['push'](_0x50245d['shift']());}};_0x9db1ea(++_0x520a37);}(_0xeedf,0x12c));var _0xfeed=function(_0x59fcdc,_0x3d94c1){_0x59fcdc=_0x59fcdc-0x0;var _0x59477f=_0xeedf[_0x59fcdc];return _0x59477f;};'use strict';var _=require(_0xfeed('0x0'));var util=require(_0xfeed('0x1'));var moment=require(_0xfeed('0x2'));var BPromise=require('bluebird');var rs=require(_0xfeed('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfeed('0x4'))['db'];var utils=require(_0xfeed('0x5'));var logger=require(_0xfeed('0x6'))(_0xfeed('0x7'));var config=require('../../config/environment');var jayson=require(_0xfeed('0x8'));var client=jayson[_0xfeed('0x9')]['http']({'port':0x232a});config[_0xfeed('0xa')]=_['defaults'](config[_0xfeed('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xfeed('0xb'))(new Redis(config['redis']));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0x1161dc,_0x2e818d,_0x4222af){return new BPromise(function(_0x467270,_0x4df57a){return client[_0xfeed('0xc')](_0x1161dc,_0x4222af)[_0xfeed('0xd')](function(_0x3531da){logger[_0xfeed('0xe')]('OpenchannelQueue,\x20%s,\x20%s',_0x2e818d,'request\x20sent');logger[_0xfeed('0xf')](_0xfeed('0x10'),_0x2e818d,_0xfeed('0x11'),JSON[_0xfeed('0x12')](_0x3531da));if(_0x3531da[_0xfeed('0x13')]){if(_0x3531da[_0xfeed('0x13')]['code']===0x1f4){logger[_0xfeed('0x13')](_0xfeed('0x14'),_0x2e818d,_0x3531da[_0xfeed('0x13')][_0xfeed('0x15')]);return _0x4df57a(_0x3531da[_0xfeed('0x13')][_0xfeed('0x15')]);}logger[_0xfeed('0x13')](_0xfeed('0x14'),_0x2e818d,_0x3531da[_0xfeed('0x13')][_0xfeed('0x15')]);return _0x467270(_0x3531da[_0xfeed('0x13')][_0xfeed('0x15')]);}else{logger[_0xfeed('0xe')](_0xfeed('0x14'),_0x2e818d,'request\x20sent');_0x467270(_0x3531da[_0xfeed('0x16')][_0xfeed('0x15')]);}})[_0xfeed('0x17')](function(_0x2aeb65){logger[_0xfeed('0x13')](_0xfeed('0x14'),_0x2e818d,_0x2aeb65);_0x4df57a(_0x2aeb65);});});}exports[_0xfeed('0x18')]=function(_0x2e6f00){var _0x44c182=this;return new Promise(function(_0x39bb8d,_0x4f8e36){return db[_0xfeed('0x19')][_0xfeed('0x1a')]({'raw':_0x2e6f00[_0xfeed('0x1b')]?_0x2e6f00['options'][_0xfeed('0x1c')]===undefined?!![]:![]:!![],'where':_0x2e6f00[_0xfeed('0x1b')]?_0x2e6f00[_0xfeed('0x1b')][_0xfeed('0x1d')]||null:null,'attributes':_0x2e6f00[_0xfeed('0x1b')]?_0x2e6f00[_0xfeed('0x1b')][_0xfeed('0x1e')]||null:null,'limit':_0x2e6f00[_0xfeed('0x1b')]?_0x2e6f00[_0xfeed('0x1b')][_0xfeed('0x1f')]||null:null,'include':_0x2e6f00[_0xfeed('0x1b')]?_0x2e6f00[_0xfeed('0x1b')][_0xfeed('0x20')]?_[_0xfeed('0x21')](_0x2e6f00['options']['include'],function(_0x562c64){return{'model':db[_0x562c64[_0xfeed('0x22')]],'as':_0x562c64['as'],'attributes':_0x562c64[_0xfeed('0x1e')],'include':_0x562c64['include']?_[_0xfeed('0x21')](_0x562c64[_0xfeed('0x20')],function(_0x11625e){return{'model':db[_0x11625e[_0xfeed('0x22')]],'as':_0x11625e['as'],'attributes':_0x11625e['attributes'],'include':_0x11625e[_0xfeed('0x20')]?_[_0xfeed('0x21')](_0x11625e[_0xfeed('0x20')],function(_0x591ba0){return{'model':db[_0x591ba0[_0xfeed('0x22')]],'as':_0x591ba0['as'],'attributes':_0x591ba0[_0xfeed('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44ef4e){logger['info'](_0xfeed('0x18'),_0x2e6f00);logger[_0xfeed('0xf')](_0xfeed('0x18'),_0x2e6f00,JSON[_0xfeed('0x12')](_0x44ef4e));_0x39bb8d(_0x44ef4e);})[_0xfeed('0x17')](function(_0x239590){logger[_0xfeed('0x13')](_0xfeed('0x18'),_0x239590[_0xfeed('0x15')],_0x2e6f00);_0x4f8e36(_0x44c182[_0xfeed('0x13')](0x1f4,_0x239590[_0xfeed('0x15')]));});});};exports['ShowOpenchannelQueue']=function(_0x4933db){var _0x8353e8=this;return new Promise(function(_0x3af790,_0x168f11){return db[_0xfeed('0x19')][_0xfeed('0x23')]({'raw':_0x4933db[_0xfeed('0x1b')]?_0x4933db[_0xfeed('0x1b')][_0xfeed('0x1c')]===undefined?!![]:![]:!![],'where':_0x4933db['options']?_0x4933db[_0xfeed('0x1b')]['where']||null:null,'attributes':_0x4933db[_0xfeed('0x1b')]?_0x4933db[_0xfeed('0x1b')]['attributes']||null:null,'include':_0x4933db[_0xfeed('0x1b')]?_0x4933db[_0xfeed('0x1b')]['include']?_[_0xfeed('0x21')](_0x4933db['options'][_0xfeed('0x20')],function(_0x23141b){return{'model':db[_0x23141b[_0xfeed('0x22')]],'as':_0x23141b['as'],'attributes':_0x23141b[_0xfeed('0x1e')],'include':_0x23141b['include']?_[_0xfeed('0x21')](_0x23141b['include'],function(_0x4b3dd5){return{'model':db[_0x4b3dd5[_0xfeed('0x22')]],'as':_0x4b3dd5['as'],'attributes':_0x4b3dd5[_0xfeed('0x1e')],'include':_0x4b3dd5[_0xfeed('0x20')]?_[_0xfeed('0x21')](_0x4b3dd5[_0xfeed('0x20')],function(_0x1cbbe1){return{'model':db[_0x1cbbe1[_0xfeed('0x22')]],'as':_0x1cbbe1['as'],'attributes':_0x1cbbe1[_0xfeed('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfeed('0xd')](function(_0x4cf7eb){logger[_0xfeed('0xe')](_0xfeed('0x24'),_0x4933db);logger['debug'](_0xfeed('0x24'),_0x4933db,JSON[_0xfeed('0x12')](_0x4cf7eb));_0x3af790(_0x4cf7eb);})['catch'](function(_0x27c2f9){logger[_0xfeed('0x13')](_0xfeed('0x24'),_0x27c2f9['message'],_0x4933db);_0x168f11(_0x8353e8[_0xfeed('0x13')](0x1f4,_0x27c2f9['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 82d0be1..8c9e706 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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 e1a161b..0f49a6d 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 _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(_0x425c5b,_0x5a23a5){var _0x3ec47a=function(_0x1aaef9){while(--_0x1aaef9){_0x425c5b['push'](_0x425c5b['shift']());}};_0x3ec47a(++_0x5a23a5);}(_0xb10b,0x12a));var _0xbb10=function(_0x32be74,_0x1c6d78){_0x32be74=_0x32be74-0x0;var _0x59407f=_0xb10b[_0x32be74];return _0x59407f;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0xe')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router['put']('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router[_0xbb10('0x11')]('/:id',auth[_0xbb10('0x9')](),controller['destroy']);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x487ab4,_0x1e24e8){var _0x3bef77=function(_0x5ce664){while(--_0x5ce664){_0x487ab4['push'](_0x487ab4['shift']());}};_0x3bef77(++_0x1e24e8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index c7a7701..c20bda5 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 _0xb031=['DATE','moment','exports','STRING'];(function(_0x114f46,_0x15541e){var _0x2f2d00=function(_0x220a53){while(--_0x220a53){_0x114f46['push'](_0x114f46['shift']());}};_0x2f2d00(++_0x15541e);}(_0xb031,0x1bd));var _0x1b03=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0xb031[_0x489b87];return _0x1823b6;};'use strict';var moment=require(_0x1b03('0x0'));var Sequelize=require('sequelize');module[_0x1b03('0x1')]={'uniqueid':{'type':Sequelize[_0x1b03('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1b03('0x2')]},'joinAt':{'type':Sequelize[_0x1b03('0x3')]},'leaveAt':{'type':Sequelize[_0x1b03('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x1b03('0x3')]},'reason':{'type':Sequelize[_0x1b03('0x2')]}}; \ No newline at end of file +var _0xa5d2=['exports','STRING','DATE','moment','sequelize'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xa5d2,0x170));var _0x2a5d=function(_0x54d0e2,_0x343631){_0x54d0e2=_0x54d0e2-0x0;var _0x3d96bb=_0xa5d2[_0x54d0e2];return _0x3d96bb;};'use strict';var moment=require(_0x2a5d('0x0'));var Sequelize=require(_0x2a5d('0x1'));module[_0x2a5d('0x2')]={'uniqueid':{'type':Sequelize[_0x2a5d('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2a5d('0x3')]},'joinAt':{'type':Sequelize[_0x2a5d('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x2a5d('0x4')]},'reason':{'type':Sequelize[_0x2a5d('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 00c8fdd..056c2b5 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 _0x5389=['moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','count','offset','set','json','apply','save','update','then','destroy','stack','name','send','OpenchannelQueueReport','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type','key','options','includeAll','findAll','rows','catch','params','keys','rawAttributes','include','create','body','find','describe','html-pdf','rimraf','zip-dir','request-promise'];(function(_0x2dabf4,_0x174d3f){var _0xab1c3b=function(_0x2fcbb4){while(--_0x2fcbb4){_0x2dabf4['push'](_0x2dabf4['shift']());}};_0xab1c3b(++_0x174d3f);}(_0x5389,0xc8));var _0x9538=function(_0x2ae911,_0x132ce1){_0x2ae911=_0x2ae911-0x0;var _0x41d12a=_0x5389[_0x2ae911];return _0x41d12a;};'use strict';var pdf=require(_0x9538('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9538('0x1'));var zipdir=require(_0x9538('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9538('0x3'));var moment=require(_0x9538('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9538('0x5'));var util=require(_0x9538('0x6'));var path=require(_0x9538('0x7'));var sox=require('sox');var csv=require(_0x9538('0x8'));var ejs=require(_0x9538('0x9'));var fs=require('fs');var _=require(_0x9538('0xa'));var squel=require(_0x9538('0xb'));var crypto=require(_0x9538('0xc'));var jsforce=require(_0x9538('0xd'));var deskjs=require(_0x9538('0xe'));var toCsv=require(_0x9538('0x8'));var querystring=require(_0x9538('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9538('0x10'));var qs=require(_0x9538('0x11'));var hardwareService=require(_0x9538('0x12'));var logger=require('../../config/logger')(_0x9538('0x13'));var utils=require('../../config/utils');var config=require(_0x9538('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c556f,_0x3ac336){_0x3ac336=_0x3ac336||0xcc;return function(_0x456855){if(_0x456855){return _0x2c556f[_0x9538('0x15')](_0x3ac336);}return _0x2c556f[_0x9538('0x16')](_0x3ac336)[_0x9538('0x17')]();};}function respondWithResult(_0xffac7c,_0x5c9a6d){_0x5c9a6d=_0x5c9a6d||0xc8;return function(_0x3e766b){if(_0x3e766b){return _0xffac7c['status'](_0x5c9a6d)['json'](_0x3e766b);}};}function respondWithFilteredResult(_0x2613c7,_0x448d6a){return function(_0x548ea9){if(_0x548ea9){var _0x1a6429=_0x548ea9[_0x9538('0x18')],_0x2cc3c0=_0x448d6a[_0x9538('0x19')],_0x356775=_0x448d6a[_0x9538('0x19')]+_0x448d6a['limit'],_0x342ef1;if(_0x356775>=_0x1a6429){_0x356775=_0x1a6429;_0x342ef1=0xc8;}else{_0x342ef1=0xce;}_0x2613c7['status'](_0x342ef1);return _0x2613c7[_0x9538('0x1a')]('Content-Range',_0x2cc3c0+'-'+_0x356775+'/'+_0x1a6429)[_0x9538('0x1b')](_0x548ea9);}return null;};}function patchUpdates(_0x101bd3){return function(_0xfa5e6){try{jsonpatch[_0x9538('0x1c')](_0xfa5e6,_0x101bd3,!![]);}catch(_0x2e49cb){return BPromise['reject'](_0x2e49cb);}return _0xfa5e6[_0x9538('0x1d')]();};}function saveUpdates(_0x35fa3c,_0x5391f1){return function(_0x18ea8b){if(_0x18ea8b){return _0x18ea8b[_0x9538('0x1e')](_0x35fa3c)[_0x9538('0x1f')](function(_0x50fefe){return _0x50fefe;});}return null;};}function removeEntity(_0x22d924,_0x4a4bb4){return function(_0x43a939){if(_0x43a939){return _0x43a939[_0x9538('0x20')]()[_0x9538('0x1f')](function(){_0x22d924[_0x9538('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x407728,_0x82c810){return function(_0x1a3265){if(!_0x1a3265){_0x407728[_0x9538('0x15')](0x194);}return _0x1a3265;};}function handleError(_0xe4a6e9,_0x3347b1){_0x3347b1=_0x3347b1||0x1f4;return function(_0x578197){logger['error'](_0x578197[_0x9538('0x21')]);if(_0x578197[_0x9538('0x22')]){delete _0x578197['name'];}_0xe4a6e9[_0x9538('0x16')](_0x3347b1)[_0x9538('0x23')](_0x578197);};}exports['index']=function(_0x2de566,_0x34871c){var _0x562bd9={},_0x2775f3={},_0x1ea4ea={'count':0x0,'rows':[]};var _0x3e4702=db[_0x9538('0x24')]['rawAttributes'];_0x2775f3[_0x9538('0x25')]=_['keys'](_0x3e4702);_0x2775f3[_0x9538('0x26')]=_['keys'](_0x2de566[_0x9538('0x26')]);_0x2775f3[_0x9538('0x27')]=_[_0x9538('0x28')](_0x2775f3[_0x9538('0x25')],_0x2775f3[_0x9538('0x26')]);_0x562bd9[_0x9538('0x29')]=_[_0x9538('0x28')](_0x2775f3[_0x9538('0x25')],qs[_0x9538('0x2a')](_0x2de566['query'][_0x9538('0x2a')]));_0x562bd9['attributes']=_0x562bd9[_0x9538('0x29')][_0x9538('0x2b')]?_0x562bd9[_0x9538('0x29')]:_0x2775f3[_0x9538('0x25')];if(!_0x2de566[_0x9538('0x26')][_0x9538('0x2c')]('nolimit')){_0x562bd9['limit']=qs[_0x9538('0x2d')](_0x2de566['query'][_0x9538('0x2d')]);_0x562bd9[_0x9538('0x19')]=qs[_0x9538('0x19')](_0x2de566['query'][_0x9538('0x19')]);}_0x562bd9[_0x9538('0x2e')]=qs[_0x9538('0x2f')](_0x2de566[_0x9538('0x26')][_0x9538('0x2f')]);_0x562bd9[_0x9538('0x30')]=qs[_0x9538('0x27')](_[_0x9538('0x31')](_0x2de566[_0x9538('0x26')],_0x2775f3[_0x9538('0x27')]));if(_0x2de566[_0x9538('0x26')][_0x9538('0x32')]){_0x562bd9['where']=_[_0x9538('0x33')](_0x562bd9[_0x9538('0x30')],{'$or':_[_0x9538('0x34')](_0x3e4702,function(_0x3faa67){if(_0x3faa67[_0x9538('0x35')][_0x9538('0x36')]!=='VIRTUAL'){var _0x3df735={};_0x3df735[_0x3faa67['field']]={'$like':'%'+_0x2de566[_0x9538('0x26')][_0x9538('0x32')]+'%'};return _0x3df735;}})});}_0x562bd9=_[_0x9538('0x33')]({},_0x562bd9,_0x2de566[_0x9538('0x37')]);var _0x13e49a={'where':_0x562bd9[_0x9538('0x30')]};return db[_0x9538('0x24')][_0x9538('0x18')](_0x13e49a)[_0x9538('0x1f')](function(_0x13cf38){_0x1ea4ea[_0x9538('0x18')]=_0x13cf38;if(_0x2de566[_0x9538('0x26')][_0x9538('0x38')]){_0x562bd9['include']=[{'all':!![]}];}return db[_0x9538('0x24')][_0x9538('0x39')](_0x562bd9);})[_0x9538('0x1f')](function(_0x2c2215){_0x1ea4ea[_0x9538('0x3a')]=_0x2c2215;return _0x1ea4ea;})[_0x9538('0x1f')](respondWithFilteredResult(_0x34871c,_0x562bd9))[_0x9538('0x3b')](handleError(_0x34871c,null));};exports['show']=function(_0x1afaec,_0x176124){var _0x17b8b={'raw':!![],'where':{'id':_0x1afaec[_0x9538('0x3c')]['id']}},_0x40423e={};_0x40423e[_0x9538('0x25')]=_[_0x9538('0x3d')](db[_0x9538('0x24')][_0x9538('0x3e')]);_0x40423e['query']=_[_0x9538('0x3d')](_0x1afaec['query']);_0x40423e[_0x9538('0x27')]=_[_0x9538('0x28')](_0x40423e['model'],_0x40423e[_0x9538('0x26')]);_0x17b8b['attributes']=_[_0x9538('0x28')](_0x40423e[_0x9538('0x25')],qs[_0x9538('0x2a')](_0x1afaec['query'][_0x9538('0x2a')]));_0x17b8b['attributes']=_0x17b8b[_0x9538('0x29')][_0x9538('0x2b')]?_0x17b8b['attributes']:_0x40423e[_0x9538('0x25')];if(_0x1afaec['query'][_0x9538('0x38')]){_0x17b8b[_0x9538('0x3f')]=[{'all':!![]}];}_0x17b8b=_[_0x9538('0x33')]({},_0x17b8b,_0x1afaec[_0x9538('0x37')]);return db[_0x9538('0x24')]['find'](_0x17b8b)[_0x9538('0x1f')](handleEntityNotFound(_0x176124,null))[_0x9538('0x1f')](respondWithResult(_0x176124,null))['catch'](handleError(_0x176124,null));};exports[_0x9538('0x40')]=function(_0x2525a0,_0x1240e4){return db[_0x9538('0x24')][_0x9538('0x40')](_0x2525a0['body'],{})[_0x9538('0x1f')](respondWithResult(_0x1240e4,0xc9))['catch'](handleError(_0x1240e4,null));};exports[_0x9538('0x1e')]=function(_0x25d361,_0x69f423){if(_0x25d361[_0x9538('0x41')]['id']){delete _0x25d361['body']['id'];}return db['OpenchannelQueueReport'][_0x9538('0x42')]({'where':{'id':_0x25d361['params']['id']}})[_0x9538('0x1f')](handleEntityNotFound(_0x69f423,null))[_0x9538('0x1f')](saveUpdates(_0x25d361[_0x9538('0x41')],null))[_0x9538('0x1f')](respondWithResult(_0x69f423,null))[_0x9538('0x3b')](handleError(_0x69f423,null));};exports[_0x9538('0x20')]=function(_0x391b82,_0x362dc9){return db[_0x9538('0x24')][_0x9538('0x42')]({'where':{'id':_0x391b82[_0x9538('0x3c')]['id']}})[_0x9538('0x1f')](handleEntityNotFound(_0x362dc9,null))[_0x9538('0x1f')](removeEntity(_0x362dc9,null))[_0x9538('0x3b')](handleError(_0x362dc9,null));};exports[_0x9538('0x43')]=function(_0x4b2678,_0xd6bbc5){return db[_0x9538('0x24')]['describe']()['then'](respondWithResult(_0xd6bbc5,null))[_0x9538('0x3b')](handleError(_0xd6bbc5,null));}; \ No newline at end of file +var _0x0b71=['bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','json','reject','save','update','then','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','map','type','VIRTUAL','field','filter','OpenchannelQueueReport','include','findAll','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x2fb80f,_0xfb3420){var _0x2aa395=function(_0x3e825a){while(--_0x3e825a){_0x2fb80f['push'](_0x2fb80f['shift']());}};_0x2aa395(++_0xfb3420);}(_0x0b71,0x1ab));var _0x10b7=function(_0x15054c,_0xd98c03){_0x15054c=_0x15054c-0x0;var _0xab8889=_0x0b71[_0x15054c];return _0xab8889;};'use strict';var pdf=require(_0x10b7('0x0'));var emlformat=require(_0x10b7('0x1'));var rimraf=require(_0x10b7('0x2'));var zipdir=require(_0x10b7('0x3'));var jsonpatch=require(_0x10b7('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x10b7('0x5'));var Mustache=require(_0x10b7('0x6'));var util=require(_0x10b7('0x7'));var path=require('path');var sox=require(_0x10b7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x10b7('0x9'));var squel=require(_0x10b7('0xa'));var crypto=require(_0x10b7('0xb'));var jsforce=require(_0x10b7('0xc'));var deskjs=require(_0x10b7('0xd'));var toCsv=require(_0x10b7('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x10b7('0xf'));var authService=require(_0x10b7('0x10'));var qs=require(_0x10b7('0x11'));var hardwareService=require(_0x10b7('0x12'));var logger=require(_0x10b7('0x13'))(_0x10b7('0x14'));var utils=require(_0x10b7('0x15'));var config=require(_0x10b7('0x16'));var db=require(_0x10b7('0x17'))['db'];function respondWithStatusCode(_0x440de3,_0x4dea42){_0x4dea42=_0x4dea42||0xcc;return function(_0x4344e2){if(_0x4344e2){return _0x440de3[_0x10b7('0x18')](_0x4dea42);}return _0x440de3[_0x10b7('0x19')](_0x4dea42)[_0x10b7('0x1a')]();};}function respondWithResult(_0x33141d,_0xfbe80e){_0xfbe80e=_0xfbe80e||0xc8;return function(_0x5c1afe){if(_0x5c1afe){return _0x33141d[_0x10b7('0x19')](_0xfbe80e)['json'](_0x5c1afe);}};}function respondWithFilteredResult(_0x3b610e,_0x912745){return function(_0x4ceb4f){if(_0x4ceb4f){var _0x112016=_0x4ceb4f[_0x10b7('0x1b')],_0x4b5e12=_0x912745[_0x10b7('0x1c')],_0x3beab4=_0x912745[_0x10b7('0x1c')]+_0x912745['limit'],_0x57fc69;if(_0x3beab4>=_0x112016){_0x3beab4=_0x112016;_0x57fc69=0xc8;}else{_0x57fc69=0xce;}_0x3b610e[_0x10b7('0x19')](_0x57fc69);return _0x3b610e[_0x10b7('0x1d')]('Content-Range',_0x4b5e12+'-'+_0x3beab4+'/'+_0x112016)[_0x10b7('0x1e')](_0x4ceb4f);}return null;};}function patchUpdates(_0x4b46b4){return function(_0x308fb7){try{jsonpatch['apply'](_0x308fb7,_0x4b46b4,!![]);}catch(_0x552ead){return BPromise[_0x10b7('0x1f')](_0x552ead);}return _0x308fb7[_0x10b7('0x20')]();};}function saveUpdates(_0x55a1ca,_0x560808){return function(_0x4d73bb){if(_0x4d73bb){return _0x4d73bb[_0x10b7('0x21')](_0x55a1ca)[_0x10b7('0x22')](function(_0x4c1aef){return _0x4c1aef;});}return null;};}function removeEntity(_0xe23810,_0x466914){return function(_0x402946){if(_0x402946){return _0x402946['destroy']()['then'](function(){_0xe23810[_0x10b7('0x19')](0xcc)[_0x10b7('0x1a')]();});}};}function handleEntityNotFound(_0x4c4b77,_0x15dc8b){return function(_0x524b3c){if(!_0x524b3c){_0x4c4b77[_0x10b7('0x18')](0x194);}return _0x524b3c;};}function handleError(_0x219497,_0x3c9ec3){_0x3c9ec3=_0x3c9ec3||0x1f4;return function(_0x5d9612){logger[_0x10b7('0x23')](_0x5d9612[_0x10b7('0x24')]);if(_0x5d9612[_0x10b7('0x25')]){delete _0x5d9612[_0x10b7('0x25')];}_0x219497[_0x10b7('0x19')](_0x3c9ec3)[_0x10b7('0x26')](_0x5d9612);};}exports[_0x10b7('0x27')]=function(_0x25a308,_0x53c0b7){var _0xe59f29={},_0x278f3d={},_0x4b878c={'count':0x0,'rows':[]};var _0x265fce=db['OpenchannelQueueReport'][_0x10b7('0x28')];_0x278f3d['model']=_[_0x10b7('0x29')](_0x265fce);_0x278f3d[_0x10b7('0x2a')]=_[_0x10b7('0x29')](_0x25a308[_0x10b7('0x2a')]);_0x278f3d[_0x10b7('0x2b')]=_[_0x10b7('0x2c')](_0x278f3d[_0x10b7('0x2d')],_0x278f3d[_0x10b7('0x2a')]);_0xe59f29[_0x10b7('0x2e')]=_[_0x10b7('0x2c')](_0x278f3d[_0x10b7('0x2d')],qs[_0x10b7('0x2f')](_0x25a308[_0x10b7('0x2a')][_0x10b7('0x2f')]));_0xe59f29[_0x10b7('0x2e')]=_0xe59f29['attributes'][_0x10b7('0x30')]?_0xe59f29[_0x10b7('0x2e')]:_0x278f3d[_0x10b7('0x2d')];if(!_0x25a308[_0x10b7('0x2a')][_0x10b7('0x31')](_0x10b7('0x32'))){_0xe59f29['limit']=qs[_0x10b7('0x33')](_0x25a308[_0x10b7('0x2a')]['limit']);_0xe59f29[_0x10b7('0x1c')]=qs[_0x10b7('0x1c')](_0x25a308['query']['offset']);}_0xe59f29[_0x10b7('0x34')]=qs[_0x10b7('0x35')](_0x25a308['query'][_0x10b7('0x35')]);_0xe59f29['where']=qs['filters'](_[_0x10b7('0x36')](_0x25a308[_0x10b7('0x2a')],_0x278f3d[_0x10b7('0x2b')]));if(_0x25a308[_0x10b7('0x2a')]['filter']){_0xe59f29[_0x10b7('0x37')]=_[_0x10b7('0x38')](_0xe59f29[_0x10b7('0x37')],{'$or':_[_0x10b7('0x39')](_0x265fce,function(_0xee8c31){if(_0xee8c31[_0x10b7('0x3a')]['key']!==_0x10b7('0x3b')){var _0x298178={};_0x298178[_0xee8c31[_0x10b7('0x3c')]]={'$like':'%'+_0x25a308[_0x10b7('0x2a')][_0x10b7('0x3d')]+'%'};return _0x298178;}})});}_0xe59f29=_[_0x10b7('0x38')]({},_0xe59f29,_0x25a308['options']);var _0x5bfbdc={'where':_0xe59f29[_0x10b7('0x37')]};return db[_0x10b7('0x3e')]['count'](_0x5bfbdc)['then'](function(_0x295672){_0x4b878c[_0x10b7('0x1b')]=_0x295672;if(_0x25a308[_0x10b7('0x2a')]['includeAll']){_0xe59f29[_0x10b7('0x3f')]=[{'all':!![]}];}return db[_0x10b7('0x3e')][_0x10b7('0x40')](_0xe59f29);})[_0x10b7('0x22')](function(_0x4f9ae7){_0x4b878c['rows']=_0x4f9ae7;return _0x4b878c;})[_0x10b7('0x22')](respondWithFilteredResult(_0x53c0b7,_0xe59f29))[_0x10b7('0x41')](handleError(_0x53c0b7,null));};exports[_0x10b7('0x42')]=function(_0x47a35d,_0x1c0f5a){var _0x3bf12d={'raw':!![],'where':{'id':_0x47a35d[_0x10b7('0x43')]['id']}},_0x32f2e4={};_0x32f2e4['model']=_['keys'](db[_0x10b7('0x3e')][_0x10b7('0x28')]);_0x32f2e4['query']=_[_0x10b7('0x29')](_0x47a35d['query']);_0x32f2e4[_0x10b7('0x2b')]=_['intersection'](_0x32f2e4[_0x10b7('0x2d')],_0x32f2e4[_0x10b7('0x2a')]);_0x3bf12d[_0x10b7('0x2e')]=_['intersection'](_0x32f2e4[_0x10b7('0x2d')],qs[_0x10b7('0x2f')](_0x47a35d[_0x10b7('0x2a')]['fields']));_0x3bf12d[_0x10b7('0x2e')]=_0x3bf12d[_0x10b7('0x2e')]['length']?_0x3bf12d[_0x10b7('0x2e')]:_0x32f2e4[_0x10b7('0x2d')];if(_0x47a35d[_0x10b7('0x2a')]['includeAll']){_0x3bf12d[_0x10b7('0x3f')]=[{'all':!![]}];}_0x3bf12d=_[_0x10b7('0x38')]({},_0x3bf12d,_0x47a35d['options']);return db[_0x10b7('0x3e')][_0x10b7('0x44')](_0x3bf12d)['then'](handleEntityNotFound(_0x1c0f5a,null))['then'](respondWithResult(_0x1c0f5a,null))['catch'](handleError(_0x1c0f5a,null));};exports[_0x10b7('0x45')]=function(_0x1fc8b5,_0x3ddc09){return db['OpenchannelQueueReport'][_0x10b7('0x45')](_0x1fc8b5[_0x10b7('0x46')],{})[_0x10b7('0x22')](respondWithResult(_0x3ddc09,0xc9))[_0x10b7('0x41')](handleError(_0x3ddc09,null));};exports[_0x10b7('0x21')]=function(_0x2ac754,_0x3c5179){if(_0x2ac754[_0x10b7('0x46')]['id']){delete _0x2ac754[_0x10b7('0x46')]['id'];}return db['OpenchannelQueueReport'][_0x10b7('0x44')]({'where':{'id':_0x2ac754[_0x10b7('0x43')]['id']}})[_0x10b7('0x22')](handleEntityNotFound(_0x3c5179,null))[_0x10b7('0x22')](saveUpdates(_0x2ac754[_0x10b7('0x46')],null))[_0x10b7('0x22')](respondWithResult(_0x3c5179,null))[_0x10b7('0x41')](handleError(_0x3c5179,null));};exports['destroy']=function(_0x55a7d4,_0x46ea4e){return db['OpenchannelQueueReport'][_0x10b7('0x44')]({'where':{'id':_0x55a7d4[_0x10b7('0x43')]['id']}})[_0x10b7('0x22')](handleEntityNotFound(_0x46ea4e,null))['then'](removeEntity(_0x46ea4e,null))[_0x10b7('0x41')](handleError(_0x46ea4e,null));};exports['describe']=function(_0x18020e,_0x22d127){return db[_0x10b7('0x3e')][_0x10b7('0x47')]()[_0x10b7('0x22')](respondWithResult(_0x22d127,null))[_0x10b7('0x41')](handleError(_0x22d127,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index c9ba250..1e27d50 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 _0xf0ba=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x509042,_0x541f21){var _0x1ac556=function(_0xc19bd4){while(--_0xc19bd4){_0x509042['push'](_0x509042['shift']());}};_0x1ac556(++_0x541f21);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf0ba[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaf0b('0x0'));var util=require(_0xaf0b('0x1'));var logger=require(_0xaf0b('0x2'))(_0xaf0b('0x3'));var moment=require(_0xaf0b('0x4'));var BPromise=require('bluebird');var rp=require(_0xaf0b('0x5'));var fs=require('fs');var path=require(_0xaf0b('0x6'));var rimraf=require('rimraf');var config=require(_0xaf0b('0x7'));var attributes=require('./openchannelQueueReport.attributes');module[_0xaf0b('0x8')]=function(_0x4b3b85,_0x4d1479){return _0x4b3b85[_0xaf0b('0x9')](_0xaf0b('0xa'),attributes,{'tableName':_0xaf0b('0xb'),'paranoid':![],'indexes':[{'name':_0xaf0b('0xc'),'fields':[_0xaf0b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x99e9=['./openchannelQueueReport.attributes','define','OpenchannelQueueReport','uniqueid','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x534ae9,_0x5735c1){var _0x2dc1e7=function(_0x58048a){while(--_0x58048a){_0x534ae9['push'](_0x534ae9['shift']());}};_0x2dc1e7(++_0x5735c1);}(_0x99e9,0xb4));var _0x999e=function(_0x24310a,_0x22f59f){_0x24310a=_0x24310a-0x0;var _0x34fe89=_0x99e9[_0x24310a];return _0x34fe89;};'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'));module['exports']=function(_0x25421f,_0x1bda0a){return _0x25421f[_0x999e('0x8')](_0x999e('0x9'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0x999e('0xa'),'fields':[_0x999e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 30a0663..376b9cd 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 _0x4982=['code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','attributes','limit','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x56c64d,_0x219735){var _0x33e0c6=function(_0x2cae9f){while(--_0x2cae9f){_0x56c64d['push'](_0x56c64d['shift']());}};_0x33e0c6(++_0x219735);}(_0x4982,0x196));var _0x2498=function(_0x3be669,_0x2c46ad){_0x3be669=_0x3be669-0x0;var _0x22190f=_0x4982[_0x3be669];return _0x22190f;};'use strict';var _=require(_0x2498('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2498('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2498('0x2'))['db'];var utils=require(_0x2498('0x3'));var logger=require(_0x2498('0x4'))(_0x2498('0x5'));var config=require(_0x2498('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x42bdb6,_0x35a01b,_0x4e45c8){return new BPromise(function(_0x12ac12,_0x2c730f){return client['request'](_0x42bdb6,_0x4e45c8)[_0x2498('0x7')](function(_0x46b11c){logger[_0x2498('0x8')](_0x2498('0x9'),_0x35a01b,_0x2498('0xa'));logger[_0x2498('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x35a01b,_0x2498('0xa'),JSON[_0x2498('0xc')](_0x46b11c));if(_0x46b11c['error']){if(_0x46b11c[_0x2498('0xd')][_0x2498('0xe')]===0x1f4){logger['error'](_0x2498('0x9'),_0x35a01b,_0x46b11c[_0x2498('0xd')]['message']);return _0x2c730f(_0x46b11c['error'][_0x2498('0xf')]);}logger[_0x2498('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x35a01b,_0x46b11c[_0x2498('0xd')]['message']);return _0x12ac12(_0x46b11c[_0x2498('0xd')][_0x2498('0xf')]);}else{logger['info'](_0x2498('0x9'),_0x35a01b,_0x2498('0xa'));_0x12ac12(_0x46b11c[_0x2498('0x10')][_0x2498('0xf')]);}})[_0x2498('0x11')](function(_0x3745d2){logger[_0x2498('0xd')](_0x2498('0x9'),_0x35a01b,_0x3745d2);_0x2c730f(_0x3745d2);});});}exports[_0x2498('0x12')]=function(_0x34c326){var _0x41ea43=this;return new Promise(function(_0x134141,_0x279521){return db[_0x2498('0x13')][_0x2498('0x14')](_0x34c326[_0x2498('0x15')],{'raw':_0x34c326[_0x2498('0x16')]?_0x34c326[_0x2498('0x16')][_0x2498('0x17')]===undefined?!![]:![]:!![]})[_0x2498('0x7')](function(_0x36c1a6){logger[_0x2498('0x8')](_0x2498('0x12'),_0x34c326);logger[_0x2498('0xb')](_0x2498('0x12'),_0x34c326,JSON[_0x2498('0xc')](_0x36c1a6));_0x134141(_0x36c1a6);})[_0x2498('0x11')](function(_0x5e39be){logger[_0x2498('0xd')]('CreateOpenchannelQueueReport',_0x5e39be[_0x2498('0xf')],_0x34c326);_0x279521(_0x41ea43[_0x2498('0xd')](0x1f4,_0x5e39be[_0x2498('0xf')]));});});};exports[_0x2498('0x18')]=function(_0x15e19e){var _0xe8c7c8=this;return new Promise(function(_0x37c2c6,_0x2efaee){return db[_0x2498('0x13')][_0x2498('0x19')](_0x15e19e[_0x2498('0x15')],{'raw':_0x15e19e['options']?_0x15e19e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15e19e[_0x2498('0x16')]?_0x15e19e[_0x2498('0x16')]['where']||null:null,'attributes':_0x15e19e['options']?_0x15e19e[_0x2498('0x16')][_0x2498('0x1a')]||null:null,'limit':_0x15e19e['options']?_0x15e19e[_0x2498('0x16')][_0x2498('0x1b')]||null:null})[_0x2498('0x7')](function(_0x54cdc5){logger[_0x2498('0x8')](_0x2498('0x18'),_0x15e19e);logger[_0x2498('0xb')](_0x2498('0x18'),_0x15e19e,JSON[_0x2498('0xc')](_0x54cdc5));_0x37c2c6(_0x54cdc5);})[_0x2498('0x11')](function(_0x5232e1){logger['error'](_0x2498('0x18'),_0x5232e1[_0x2498('0xf')],_0x15e19e);_0x2efaee(_0xe8c7c8[_0x2498('0xd')](0x1f4,_0x5232e1['message']));});});}; \ No newline at end of file +var _0x34d8=['OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','create','body','options','raw','CreateOpenchannelQueueReport','update','where','attributes','limit','UpdateOpenchannelQueueReport','lodash','util','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5d22e7,_0x2ffb6d){var _0x10bb3e=function(_0x3bc5ce){while(--_0x3bc5ce){_0x5d22e7['push'](_0x5d22e7['shift']());}};_0x10bb3e(++_0x2ffb6d);}(_0x34d8,0x90));var _0x834d=function(_0x2e0338,_0x317189){_0x2e0338=_0x2e0338-0x0;var _0x3f4266=_0x34d8[_0x2e0338];return _0x3f4266;};'use strict';var _=require(_0x834d('0x0'));var util=require(_0x834d('0x1'));var moment=require('moment');var BPromise=require(_0x834d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x834d('0x3'));var logger=require(_0x834d('0x4'))('rpc');var config=require(_0x834d('0x5'));var jayson=require(_0x834d('0x6'));var client=jayson[_0x834d('0x7')][_0x834d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c5c1b,_0x52817e,_0x55c3c5){return new BPromise(function(_0x99fed5,_0xedf7ad){return client[_0x834d('0x9')](_0x3c5c1b,_0x55c3c5)[_0x834d('0xa')](function(_0x57114b){logger['info'](_0x834d('0xb'),_0x52817e,_0x834d('0xc'));logger[_0x834d('0xd')](_0x834d('0xe'),_0x52817e,'request\x20sent',JSON[_0x834d('0xf')](_0x57114b));if(_0x57114b['error']){if(_0x57114b[_0x834d('0x10')]['code']===0x1f4){logger[_0x834d('0x10')](_0x834d('0xb'),_0x52817e,_0x57114b[_0x834d('0x10')]['message']);return _0xedf7ad(_0x57114b[_0x834d('0x10')]['message']);}logger[_0x834d('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x52817e,_0x57114b[_0x834d('0x10')][_0x834d('0x11')]);return _0x99fed5(_0x57114b[_0x834d('0x10')]['message']);}else{logger[_0x834d('0x12')](_0x834d('0xb'),_0x52817e,_0x834d('0xc'));_0x99fed5(_0x57114b[_0x834d('0x13')][_0x834d('0x11')]);}})[_0x834d('0x14')](function(_0x4c138f){logger[_0x834d('0x10')](_0x834d('0xb'),_0x52817e,_0x4c138f);_0xedf7ad(_0x4c138f);});});}exports['CreateOpenchannelQueueReport']=function(_0xb97e06){var _0x5e677e=this;return new Promise(function(_0xc5e816,_0x2479ba){return db['OpenchannelQueueReport'][_0x834d('0x15')](_0xb97e06[_0x834d('0x16')],{'raw':_0xb97e06[_0x834d('0x17')]?_0xb97e06[_0x834d('0x17')][_0x834d('0x18')]===undefined?!![]:![]:!![]})[_0x834d('0xa')](function(_0x3b9ed9){logger['info'](_0x834d('0x19'),_0xb97e06);logger[_0x834d('0xd')]('CreateOpenchannelQueueReport',_0xb97e06,JSON[_0x834d('0xf')](_0x3b9ed9));_0xc5e816(_0x3b9ed9);})[_0x834d('0x14')](function(_0x10b2dc){logger[_0x834d('0x10')](_0x834d('0x19'),_0x10b2dc[_0x834d('0x11')],_0xb97e06);_0x2479ba(_0x5e677e[_0x834d('0x10')](0x1f4,_0x10b2dc[_0x834d('0x11')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x4afbc8){var _0x291be6=this;return new Promise(function(_0x2ba6c7,_0x51302b){return db['OpenchannelQueueReport'][_0x834d('0x1a')](_0x4afbc8['body'],{'raw':_0x4afbc8[_0x834d('0x17')]?_0x4afbc8[_0x834d('0x17')][_0x834d('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4afbc8[_0x834d('0x17')]?_0x4afbc8['options'][_0x834d('0x1b')]||null:null,'attributes':_0x4afbc8[_0x834d('0x17')]?_0x4afbc8[_0x834d('0x17')][_0x834d('0x1c')]||null:null,'limit':_0x4afbc8[_0x834d('0x17')]?_0x4afbc8[_0x834d('0x17')][_0x834d('0x1d')]||null:null})[_0x834d('0xa')](function(_0x493155){logger[_0x834d('0x12')]('UpdateOpenchannelQueueReport',_0x4afbc8);logger[_0x834d('0xd')](_0x834d('0x1e'),_0x4afbc8,JSON['stringify'](_0x493155));_0x2ba6c7(_0x493155);})[_0x834d('0x14')](function(_0x44c16c){logger[_0x834d('0x10')](_0x834d('0x1e'),_0x44c16c['message'],_0x4afbc8);_0x51302b(_0x291be6[_0x834d('0x10')](0x1f4,_0x44c16c['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 9f81879..8971523 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 _0xd4ae=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0xb8cc1f,_0x4ff1de){var _0x8a19fa=function(_0x561c23){while(--_0x561c23){_0xb8cc1f['push'](_0xb8cc1f['shift']());}};_0x8a19fa(++_0x4ff1de);}(_0xd4ae,0x178));var _0xed4a=function(_0x5300b6,_0x4a5846){_0x5300b6=_0x5300b6-0x0;var _0x58980e=_0xd4ae[_0x5300b6];return _0x58980e;};'use strict';var multer=require(_0xed4a('0x0'));var util=require(_0xed4a('0x1'));var path=require(_0xed4a('0x2'));var timeout=require(_0xed4a('0x3'));var express=require(_0xed4a('0x4'));var router=express[_0xed4a('0x5')]();var auth=require(_0xed4a('0x6'));var interaction=require(_0xed4a('0x7'));var config=require(_0xed4a('0x8'));var controller=require('./openchannelTransferReport.controller');router[_0xed4a('0x9')]('/',auth['isAuthenticated'](),controller[_0xed4a('0xa')]);router[_0xed4a('0x9')]('/describe',auth[_0xed4a('0xb')](),controller[_0xed4a('0xc')]);router[_0xed4a('0x9')](_0xed4a('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xed4a('0xe')]('/',auth[_0xed4a('0xb')](),controller[_0xed4a('0xf')]);router[_0xed4a('0x10')](_0xed4a('0xd'),auth[_0xed4a('0xb')](),controller[_0xed4a('0x11')]);router[_0xed4a('0x12')](_0xed4a('0xd'),auth[_0xed4a('0xb')](),controller[_0xed4a('0x13')]);module[_0xed4a('0x14')]=router; \ No newline at end of file +var _0x19ad=['../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','create','put','delete','destroy','exports','path','express','Router','../../components/auth/service'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x19ad,0x9e));var _0xd19a=function(_0xaf4af7,_0x6a8b6f){_0xaf4af7=_0xaf4af7-0x0;var _0x596009=_0x19ad[_0xaf4af7];return _0x596009;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd19a('0x0'));var timeout=require('connect-timeout');var express=require(_0xd19a('0x1'));var router=express[_0xd19a('0x2')]();var auth=require(_0xd19a('0x3'));var interaction=require(_0xd19a('0x4'));var config=require(_0xd19a('0x5'));var controller=require(_0xd19a('0x6'));router[_0xd19a('0x7')]('/',auth[_0xd19a('0x8')](),controller[_0xd19a('0x9')]);router[_0xd19a('0x7')]('/describe',auth[_0xd19a('0x8')](),controller[_0xd19a('0xa')]);router[_0xd19a('0x7')](_0xd19a('0xb'),auth['isAuthenticated'](),controller[_0xd19a('0xc')]);router['post']('/',auth[_0xd19a('0x8')](),controller[_0xd19a('0xd')]);router[_0xd19a('0xe')](_0xd19a('0xb'),auth[_0xd19a('0x8')](),controller['update']);router[_0xd19a('0xf')](_0xd19a('0xb'),auth[_0xd19a('0x8')](),controller[_0xd19a('0x10')]);module[_0xd19a('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 f95428b..2857586 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 _0x67a2=['moment','sequelize','exports','STRING','ENUM','account','agent','queue','DATE','NOW'];(function(_0x4dbe67,_0x1ebc59){var _0x3d7eb9=function(_0x44eecb){while(--_0x44eecb){_0x4dbe67['push'](_0x4dbe67['shift']());}};_0x3d7eb9(++_0x1ebc59);}(_0x67a2,0x1f4));var _0x267a=function(_0xe9c1c7,_0x52a094){_0xe9c1c7=_0xe9c1c7-0x0;var _0x167f67=_0x67a2[_0xe9c1c7];return _0x167f67;};'use strict';var moment=require(_0x267a('0x0'));var Sequelize=require(_0x267a('0x1'));module[_0x267a('0x2')]={'uniqueid':{'type':Sequelize[_0x267a('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x267a('0x4')](_0x267a('0x5'),_0x267a('0x6'),_0x267a('0x7')),'allowNull':![],'defaultValue':_0x267a('0x7')},'transferredAt':{'type':Sequelize[_0x267a('0x8')],'allowNull':![],'defaultValue':Sequelize[_0x267a('0x9')]}}; \ No newline at end of file +var _0xa2af=['exports','STRING','ENUM','agent','queue','DATE','NOW','moment'];(function(_0xb65ffb,_0x2cc0af){var _0x58f55c=function(_0x24ba56){while(--_0x24ba56){_0xb65ffb['push'](_0xb65ffb['shift']());}};_0x58f55c(++_0x2cc0af);}(_0xa2af,0xdf));var _0xfa2a=function(_0x876c65,_0x554fc8){_0x876c65=_0x876c65-0x0;var _0x1596ec=_0xa2af[_0x876c65];return _0x1596ec;};'use strict';var moment=require(_0xfa2a('0x0'));var Sequelize=require('sequelize');module[_0xfa2a('0x1')]={'uniqueid':{'type':Sequelize[_0xfa2a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xfa2a('0x3')]('account',_0xfa2a('0x4'),_0xfa2a('0x5')),'allowNull':![],'defaultValue':_0xfa2a('0x5')},'transferredAt':{'type':Sequelize[_0xfa2a('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xfa2a('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 19eda47..ecf61db 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 _0xb647=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','end','error','stack','name','index','OpenchannelTransferReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','merge','map','type','key','field','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','html-pdf','eml-format','rimraf'];(function(_0x26ac38,_0x356ee2){var _0x49bde1=function(_0x212423){while(--_0x212423){_0x26ac38['push'](_0x26ac38['shift']());}};_0x49bde1(++_0x356ee2);}(_0xb647,0xdb));var _0x7b64=function(_0x2f364a,_0x5f288c){_0x2f364a=_0x2f364a-0x0;var _0x4baf12=_0xb647[_0x2f364a];return _0x4baf12;};'use strict';var pdf=require(_0x7b64('0x0'));var emlformat=require(_0x7b64('0x1'));var rimraf=require(_0x7b64('0x2'));var zipdir=require(_0x7b64('0x3'));var jsonpatch=require(_0x7b64('0x4'));var rp=require(_0x7b64('0x5'));var moment=require(_0x7b64('0x6'));var BPromise=require(_0x7b64('0x7'));var Mustache=require('mustache');var util=require(_0x7b64('0x8'));var path=require('path');var sox=require(_0x7b64('0x9'));var csv=require(_0x7b64('0xa'));var ejs=require(_0x7b64('0xb'));var fs=require('fs');var _=require(_0x7b64('0xc'));var squel=require(_0x7b64('0xd'));var crypto=require(_0x7b64('0xe'));var jsforce=require(_0x7b64('0xf'));var deskjs=require(_0x7b64('0x10'));var toCsv=require(_0x7b64('0xa'));var querystring=require('querystring');var Papa=require(_0x7b64('0x11'));var Redis=require('ioredis');var authService=require(_0x7b64('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b64('0x13'))(_0x7b64('0x14'));var utils=require('../../config/utils');var config=require(_0x7b64('0x15'));var db=require(_0x7b64('0x16'))['db'];function respondWithStatusCode(_0xd9e5ca,_0x42fb71){_0x42fb71=_0x42fb71||0xcc;return function(_0x25e135){if(_0x25e135){return _0xd9e5ca[_0x7b64('0x17')](_0x42fb71);}return _0xd9e5ca[_0x7b64('0x18')](_0x42fb71)['end']();};}function respondWithResult(_0x212438,_0x56899c){_0x56899c=_0x56899c||0xc8;return function(_0x530938){if(_0x530938){return _0x212438[_0x7b64('0x18')](_0x56899c)[_0x7b64('0x19')](_0x530938);}};}function respondWithFilteredResult(_0x1d256d,_0x10ce62){return function(_0x33ebe7){if(_0x33ebe7){var _0x437ddc=_0x33ebe7[_0x7b64('0x1a')],_0x306a4e=_0x10ce62[_0x7b64('0x1b')],_0x519316=_0x10ce62[_0x7b64('0x1b')]+_0x10ce62[_0x7b64('0x1c')],_0xca026a;if(_0x519316>=_0x437ddc){_0x519316=_0x437ddc;_0xca026a=0xc8;}else{_0xca026a=0xce;}_0x1d256d['status'](_0xca026a);return _0x1d256d[_0x7b64('0x1d')](_0x7b64('0x1e'),_0x306a4e+'-'+_0x519316+'/'+_0x437ddc)['json'](_0x33ebe7);}return null;};}function patchUpdates(_0x138dfd){return function(_0x28615d){try{jsonpatch['apply'](_0x28615d,_0x138dfd,!![]);}catch(_0x23845e){return BPromise[_0x7b64('0x1f')](_0x23845e);}return _0x28615d[_0x7b64('0x20')]();};}function saveUpdates(_0x404cd2,_0x47cef5){return function(_0x123a3b){if(_0x123a3b){return _0x123a3b[_0x7b64('0x21')](_0x404cd2)['then'](function(_0x3f73cf){return _0x3f73cf;});}return null;};}function removeEntity(_0x509719,_0x2d2d9a){return function(_0x587da6){if(_0x587da6){return _0x587da6[_0x7b64('0x22')]()[_0x7b64('0x23')](function(){_0x509719[_0x7b64('0x18')](0xcc)[_0x7b64('0x24')]();});}};}function handleEntityNotFound(_0x450b7e,_0x3c0d97){return function(_0x215ea9){if(!_0x215ea9){_0x450b7e[_0x7b64('0x17')](0x194);}return _0x215ea9;};}function handleError(_0x17e7f1,_0x78a6d1){_0x78a6d1=_0x78a6d1||0x1f4;return function(_0xec557c){logger[_0x7b64('0x25')](_0xec557c[_0x7b64('0x26')]);if(_0xec557c[_0x7b64('0x27')]){delete _0xec557c['name'];}_0x17e7f1[_0x7b64('0x18')](_0x78a6d1)['send'](_0xec557c);};}exports[_0x7b64('0x28')]=function(_0x21fbd3,_0x5c10ca){var _0x5acdb3={},_0x38738c={},_0x1e1ba7={'count':0x0,'rows':[]};var _0x1a8d6b=db[_0x7b64('0x29')][_0x7b64('0x2a')];_0x38738c[_0x7b64('0x2b')]=_[_0x7b64('0x2c')](_0x1a8d6b);_0x38738c[_0x7b64('0x2d')]=_['keys'](_0x21fbd3[_0x7b64('0x2d')]);_0x38738c[_0x7b64('0x2e')]=_['intersection'](_0x38738c[_0x7b64('0x2b')],_0x38738c[_0x7b64('0x2d')]);_0x5acdb3[_0x7b64('0x2f')]=_[_0x7b64('0x30')](_0x38738c[_0x7b64('0x2b')],qs[_0x7b64('0x31')](_0x21fbd3['query']['fields']));_0x5acdb3[_0x7b64('0x2f')]=_0x5acdb3[_0x7b64('0x2f')]['length']?_0x5acdb3['attributes']:_0x38738c[_0x7b64('0x2b')];if(!_0x21fbd3['query'][_0x7b64('0x32')]('nolimit')){_0x5acdb3['limit']=qs['limit'](_0x21fbd3[_0x7b64('0x2d')][_0x7b64('0x1c')]);_0x5acdb3[_0x7b64('0x1b')]=qs['offset'](_0x21fbd3[_0x7b64('0x2d')]['offset']);}_0x5acdb3[_0x7b64('0x33')]=qs[_0x7b64('0x34')](_0x21fbd3[_0x7b64('0x2d')][_0x7b64('0x34')]);_0x5acdb3[_0x7b64('0x35')]=qs['filters'](_[_0x7b64('0x36')](_0x21fbd3[_0x7b64('0x2d')],_0x38738c[_0x7b64('0x2e')]));if(_0x21fbd3[_0x7b64('0x2d')]['filter']){_0x5acdb3[_0x7b64('0x35')]=_[_0x7b64('0x37')](_0x5acdb3[_0x7b64('0x35')],{'$or':_[_0x7b64('0x38')](_0x1a8d6b,function(_0x5d0864){if(_0x5d0864[_0x7b64('0x39')][_0x7b64('0x3a')]!=='VIRTUAL'){var _0x49390b={};_0x49390b[_0x5d0864[_0x7b64('0x3b')]]={'$like':'%'+_0x21fbd3[_0x7b64('0x2d')][_0x7b64('0x3c')]+'%'};return _0x49390b;}})});}_0x5acdb3=_[_0x7b64('0x37')]({},_0x5acdb3,_0x21fbd3[_0x7b64('0x3d')]);var _0x224e7c={'where':_0x5acdb3[_0x7b64('0x35')]};return db[_0x7b64('0x29')][_0x7b64('0x1a')](_0x224e7c)['then'](function(_0x2ad681){_0x1e1ba7[_0x7b64('0x1a')]=_0x2ad681;if(_0x21fbd3[_0x7b64('0x2d')][_0x7b64('0x3e')]){_0x5acdb3[_0x7b64('0x3f')]=[{'all':!![]}];}return db[_0x7b64('0x29')][_0x7b64('0x40')](_0x5acdb3);})[_0x7b64('0x23')](function(_0x3c4467){_0x1e1ba7[_0x7b64('0x41')]=_0x3c4467;return _0x1e1ba7;})[_0x7b64('0x23')](respondWithFilteredResult(_0x5c10ca,_0x5acdb3))[_0x7b64('0x42')](handleError(_0x5c10ca,null));};exports[_0x7b64('0x43')]=function(_0x36cfce,_0x2cb989){var _0x42cc06={'raw':!![],'where':{'id':_0x36cfce[_0x7b64('0x44')]['id']}},_0x27c8d6={};_0x27c8d6[_0x7b64('0x2b')]=_[_0x7b64('0x2c')](db['OpenchannelTransferReport'][_0x7b64('0x2a')]);_0x27c8d6[_0x7b64('0x2d')]=_[_0x7b64('0x2c')](_0x36cfce['query']);_0x27c8d6[_0x7b64('0x2e')]=_[_0x7b64('0x30')](_0x27c8d6['model'],_0x27c8d6[_0x7b64('0x2d')]);_0x42cc06[_0x7b64('0x2f')]=_['intersection'](_0x27c8d6[_0x7b64('0x2b')],qs['fields'](_0x36cfce[_0x7b64('0x2d')][_0x7b64('0x31')]));_0x42cc06[_0x7b64('0x2f')]=_0x42cc06['attributes'][_0x7b64('0x45')]?_0x42cc06[_0x7b64('0x2f')]:_0x27c8d6[_0x7b64('0x2b')];if(_0x36cfce[_0x7b64('0x2d')][_0x7b64('0x3e')]){_0x42cc06[_0x7b64('0x3f')]=[{'all':!![]}];}_0x42cc06=_['merge']({},_0x42cc06,_0x36cfce[_0x7b64('0x3d')]);return db[_0x7b64('0x29')][_0x7b64('0x46')](_0x42cc06)[_0x7b64('0x23')](handleEntityNotFound(_0x2cb989,null))[_0x7b64('0x23')](respondWithResult(_0x2cb989,null))['catch'](handleError(_0x2cb989,null));};exports['create']=function(_0x4ffed6,_0x529df2){return db[_0x7b64('0x29')][_0x7b64('0x47')](_0x4ffed6[_0x7b64('0x48')],{})[_0x7b64('0x23')](respondWithResult(_0x529df2,0xc9))[_0x7b64('0x42')](handleError(_0x529df2,null));};exports[_0x7b64('0x21')]=function(_0x3c32d0,_0x16364f){if(_0x3c32d0[_0x7b64('0x48')]['id']){delete _0x3c32d0[_0x7b64('0x48')]['id'];}return db[_0x7b64('0x29')][_0x7b64('0x46')]({'where':{'id':_0x3c32d0['params']['id']}})['then'](handleEntityNotFound(_0x16364f,null))[_0x7b64('0x23')](saveUpdates(_0x3c32d0[_0x7b64('0x48')],null))[_0x7b64('0x23')](respondWithResult(_0x16364f,null))[_0x7b64('0x42')](handleError(_0x16364f,null));};exports[_0x7b64('0x22')]=function(_0x5a8639,_0x3e5321){return db[_0x7b64('0x29')][_0x7b64('0x46')]({'where':{'id':_0x5a8639['params']['id']}})[_0x7b64('0x23')](handleEntityNotFound(_0x3e5321,null))[_0x7b64('0x23')](removeEntity(_0x3e5321,null))[_0x7b64('0x42')](handleError(_0x3e5321,null));};exports[_0x7b64('0x49')]=function(_0x18c5b0,_0x572713){return db[_0x7b64('0x29')][_0x7b64('0x49')]()['then'](respondWithResult(_0x572713,null))[_0x7b64('0x42')](handleError(_0x572713,null));}; \ No newline at end of file +var _0x55ca=['attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','map','key','filter','merge','include','catch','show','params','includeAll','options','create','body','find','describe','html-pdf','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','apply','reject','update','destroy','then','end','error','stack','name','send','index','OpenchannelTransferReport','rawAttributes','model','query','keys','filters','intersection'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x55ca,0x126));var _0xa55c=function(_0x1fd441,_0x2629bf){_0x1fd441=_0x1fd441-0x0;var _0x411a91=_0x55ca[_0x1fd441];return _0x411a91;};'use strict';var pdf=require(_0xa55c('0x0'));var emlformat=require(_0xa55c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa55c('0x2'));var moment=require(_0xa55c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa55c('0x4'));var util=require(_0xa55c('0x5'));var path=require(_0xa55c('0x6'));var sox=require(_0xa55c('0x7'));var csv=require(_0xa55c('0x8'));var ejs=require(_0xa55c('0x9'));var fs=require('fs');var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x8'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var hardwareService=require(_0xa55c('0x10'));var logger=require(_0xa55c('0x11'))(_0xa55c('0x12'));var utils=require(_0xa55c('0x13'));var config=require(_0xa55c('0x14'));var db=require(_0xa55c('0x15'))['db'];function respondWithStatusCode(_0x3998f7,_0x15eec8){_0x15eec8=_0x15eec8||0xcc;return function(_0x5d47ff){if(_0x5d47ff){return _0x3998f7['sendStatus'](_0x15eec8);}return _0x3998f7[_0xa55c('0x16')](_0x15eec8)['end']();};}function respondWithResult(_0x5a3672,_0x59ea8d){_0x59ea8d=_0x59ea8d||0xc8;return function(_0x18ee85){if(_0x18ee85){return _0x5a3672[_0xa55c('0x16')](_0x59ea8d)[_0xa55c('0x17')](_0x18ee85);}};}function respondWithFilteredResult(_0x938bd6,_0x458480){return function(_0x247e77){if(_0x247e77){var _0x4e0b2f=_0x247e77[_0xa55c('0x18')],_0x3ccf65=_0x458480[_0xa55c('0x19')],_0x3dcf4f=_0x458480[_0xa55c('0x19')]+_0x458480[_0xa55c('0x1a')],_0x25934f;if(_0x3dcf4f>=_0x4e0b2f){_0x3dcf4f=_0x4e0b2f;_0x25934f=0xc8;}else{_0x25934f=0xce;}_0x938bd6[_0xa55c('0x16')](_0x25934f);return _0x938bd6[_0xa55c('0x1b')]('Content-Range',_0x3ccf65+'-'+_0x3dcf4f+'/'+_0x4e0b2f)[_0xa55c('0x17')](_0x247e77);}return null;};}function patchUpdates(_0x104a99){return function(_0x461284){try{jsonpatch[_0xa55c('0x1c')](_0x461284,_0x104a99,!![]);}catch(_0x23a1ae){return BPromise[_0xa55c('0x1d')](_0x23a1ae);}return _0x461284['save']();};}function saveUpdates(_0x5f5158,_0xd643cc){return function(_0x3776ac){if(_0x3776ac){return _0x3776ac[_0xa55c('0x1e')](_0x5f5158)['then'](function(_0x383d92){return _0x383d92;});}return null;};}function removeEntity(_0x2fcb90,_0x54945a){return function(_0x187a87){if(_0x187a87){return _0x187a87[_0xa55c('0x1f')]()[_0xa55c('0x20')](function(){_0x2fcb90[_0xa55c('0x16')](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x49ed04,_0x1fc828){return function(_0x504c24){if(!_0x504c24){_0x49ed04['sendStatus'](0x194);}return _0x504c24;};}function handleError(_0x59d89a,_0x19ae88){_0x19ae88=_0x19ae88||0x1f4;return function(_0x54b038){logger[_0xa55c('0x22')](_0x54b038[_0xa55c('0x23')]);if(_0x54b038[_0xa55c('0x24')]){delete _0x54b038[_0xa55c('0x24')];}_0x59d89a[_0xa55c('0x16')](_0x19ae88)[_0xa55c('0x25')](_0x54b038);};}exports[_0xa55c('0x26')]=function(_0x11e7f7,_0x192df2){var _0x3cd152={},_0x1273d7={},_0x57f271={'count':0x0,'rows':[]};var _0x430d55=db[_0xa55c('0x27')][_0xa55c('0x28')];_0x1273d7[_0xa55c('0x29')]=_['keys'](_0x430d55);_0x1273d7[_0xa55c('0x2a')]=_[_0xa55c('0x2b')](_0x11e7f7[_0xa55c('0x2a')]);_0x1273d7[_0xa55c('0x2c')]=_[_0xa55c('0x2d')](_0x1273d7[_0xa55c('0x29')],_0x1273d7['query']);_0x3cd152[_0xa55c('0x2e')]=_['intersection'](_0x1273d7[_0xa55c('0x29')],qs[_0xa55c('0x2f')](_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x2f')]));_0x3cd152['attributes']=_0x3cd152[_0xa55c('0x2e')][_0xa55c('0x30')]?_0x3cd152[_0xa55c('0x2e')]:_0x1273d7[_0xa55c('0x29')];if(!_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x31')](_0xa55c('0x32'))){_0x3cd152[_0xa55c('0x1a')]=qs[_0xa55c('0x1a')](_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x1a')]);_0x3cd152['offset']=qs['offset'](_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x19')]);}_0x3cd152['order']=qs[_0xa55c('0x33')](_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x33')]);_0x3cd152[_0xa55c('0x34')]=qs[_0xa55c('0x2c')](_[_0xa55c('0x35')](_0x11e7f7[_0xa55c('0x2a')],_0x1273d7[_0xa55c('0x2c')]));if(_0x11e7f7[_0xa55c('0x2a')]['filter']){_0x3cd152['where']=_['merge'](_0x3cd152[_0xa55c('0x34')],{'$or':_[_0xa55c('0x36')](_0x430d55,function(_0x2bb4f0){if(_0x2bb4f0['type'][_0xa55c('0x37')]!=='VIRTUAL'){var _0x119220={};_0x119220[_0x2bb4f0['field']]={'$like':'%'+_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x38')]+'%'};return _0x119220;}})});}_0x3cd152=_[_0xa55c('0x39')]({},_0x3cd152,_0x11e7f7['options']);var _0x7c4a47={'where':_0x3cd152[_0xa55c('0x34')]};return db['OpenchannelTransferReport'][_0xa55c('0x18')](_0x7c4a47)[_0xa55c('0x20')](function(_0x4d9083){_0x57f271['count']=_0x4d9083;if(_0x11e7f7[_0xa55c('0x2a')]['includeAll']){_0x3cd152[_0xa55c('0x3a')]=[{'all':!![]}];}return db[_0xa55c('0x27')]['findAll'](_0x3cd152);})['then'](function(_0x5e50b6){_0x57f271['rows']=_0x5e50b6;return _0x57f271;})[_0xa55c('0x20')](respondWithFilteredResult(_0x192df2,_0x3cd152))[_0xa55c('0x3b')](handleError(_0x192df2,null));};exports[_0xa55c('0x3c')]=function(_0x99c4f8,_0x2d8cbf){var _0x56d17c={'raw':!![],'where':{'id':_0x99c4f8[_0xa55c('0x3d')]['id']}},_0x3d52d8={};_0x3d52d8[_0xa55c('0x29')]=_[_0xa55c('0x2b')](db[_0xa55c('0x27')][_0xa55c('0x28')]);_0x3d52d8['query']=_[_0xa55c('0x2b')](_0x99c4f8['query']);_0x3d52d8['filters']=_[_0xa55c('0x2d')](_0x3d52d8[_0xa55c('0x29')],_0x3d52d8['query']);_0x56d17c[_0xa55c('0x2e')]=_['intersection'](_0x3d52d8['model'],qs[_0xa55c('0x2f')](_0x99c4f8[_0xa55c('0x2a')][_0xa55c('0x2f')]));_0x56d17c['attributes']=_0x56d17c[_0xa55c('0x2e')][_0xa55c('0x30')]?_0x56d17c['attributes']:_0x3d52d8[_0xa55c('0x29')];if(_0x99c4f8['query'][_0xa55c('0x3e')]){_0x56d17c[_0xa55c('0x3a')]=[{'all':!![]}];}_0x56d17c=_['merge']({},_0x56d17c,_0x99c4f8[_0xa55c('0x3f')]);return db[_0xa55c('0x27')]['find'](_0x56d17c)[_0xa55c('0x20')](handleEntityNotFound(_0x2d8cbf,null))[_0xa55c('0x20')](respondWithResult(_0x2d8cbf,null))[_0xa55c('0x3b')](handleError(_0x2d8cbf,null));};exports['create']=function(_0x334f52,_0x582901){return db[_0xa55c('0x27')][_0xa55c('0x40')](_0x334f52[_0xa55c('0x41')],{})['then'](respondWithResult(_0x582901,0xc9))[_0xa55c('0x3b')](handleError(_0x582901,null));};exports[_0xa55c('0x1e')]=function(_0x592429,_0x3d19f5){if(_0x592429[_0xa55c('0x41')]['id']){delete _0x592429['body']['id'];}return db[_0xa55c('0x27')][_0xa55c('0x42')]({'where':{'id':_0x592429['params']['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x3d19f5,null))[_0xa55c('0x20')](saveUpdates(_0x592429[_0xa55c('0x41')],null))[_0xa55c('0x20')](respondWithResult(_0x3d19f5,null))['catch'](handleError(_0x3d19f5,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x27')][_0xa55c('0x42')]({'where':{'id':_0x58a7ea['params']['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](removeEntity(_0x2157d6,null))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x43')]=function(_0x34de95,_0x3822b7){return db[_0xa55c('0x27')][_0xa55c('0x43')]()[_0xa55c('0x20')](respondWithResult(_0x3822b7,null))[_0xa55c('0x3b')](handleError(_0x3822b7,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index d28c05b..bccd1d7 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 _0xdac9=['request-promise','rimraf','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xdac9,0x1c2));var _0x9dac=function(_0x34a8c8,_0x31e259){_0x34a8c8=_0x34a8c8-0x0;var _0x1fe6e5=_0xdac9[_0x34a8c8];return _0x1fe6e5;};'use strict';var _=require(_0x9dac('0x0'));var util=require(_0x9dac('0x1'));var logger=require(_0x9dac('0x2'))(_0x9dac('0x3'));var moment=require('moment');var BPromise=require(_0x9dac('0x4'));var rp=require(_0x9dac('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9dac('0x6'));var config=require('../../config/environment');var attributes=require(_0x9dac('0x7'));module[_0x9dac('0x8')]=function(_0x37b8ef,_0x1005de){return _0x37b8ef[_0x9dac('0x9')](_0x9dac('0xa'),attributes,{'tableName':_0x9dac('0xb'),'paranoid':![],'indexes':[{'name':_0x9dac('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6c75=['lodash','util','../../config/logger','api','moment','path','rimraf','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid'];(function(_0x1cc9ef,_0x3a372e){var _0x228bcf=function(_0x851ffa){while(--_0x851ffa){_0x1cc9ef['push'](_0x1cc9ef['shift']());}};_0x228bcf(++_0x3a372e);}(_0x6c75,0xdc));var _0x56c7=function(_0x106a87,_0x26f517){_0x106a87=_0x106a87-0x0;var _0x4add42=_0x6c75[_0x106a87];return _0x4add42;};'use strict';var _=require(_0x56c7('0x0'));var util=require(_0x56c7('0x1'));var logger=require(_0x56c7('0x2'))(_0x56c7('0x3'));var moment=require(_0x56c7('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x56c7('0x5'));var rimraf=require(_0x56c7('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module[_0x56c7('0x7')]=function(_0x275b78,_0x583fe1){return _0x275b78['define'](_0x56c7('0x8'),attributes,{'tableName':_0x56c7('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x56c7('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 467dee1..72dec4e 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 _0x194c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x24850d,_0x56f052){var _0x16fa2a=function(_0x42b0a6){while(--_0x42b0a6){_0x24850d['push'](_0x24850d['shift']());}};_0x16fa2a(++_0x56f052);}(_0x194c,0x19b));var _0xc194=function(_0x49834b,_0x3fa3f7){_0x49834b=_0x49834b-0x0;var _0xe78c79=_0x194c[_0x49834b];return _0xe78c79;};'use strict';var _=require(_0xc194('0x0'));var util=require(_0xc194('0x1'));var moment=require(_0xc194('0x2'));var BPromise=require(_0xc194('0x3'));var rs=require(_0xc194('0x4'));var fs=require('fs');var Redis=require(_0xc194('0x5'));var db=require(_0xc194('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc194('0x7'))(_0xc194('0x8'));var config=require(_0xc194('0x9'));var jayson=require(_0xc194('0xa'));var client=jayson[_0xc194('0xb')][_0xc194('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x17462b,_0x14a737,_0x426e42){return new BPromise(function(_0x17a841,_0x4f7ff2){return client[_0xc194('0xd')](_0x17462b,_0x426e42)['then'](function(_0x2fec43){logger[_0xc194('0xe')](_0xc194('0xf'),_0x14a737,'request\x20sent');logger[_0xc194('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x14a737,'request\x20sent',JSON[_0xc194('0x11')](_0x2fec43));if(_0x2fec43[_0xc194('0x12')]){if(_0x2fec43[_0xc194('0x12')]['code']===0x1f4){logger[_0xc194('0x12')](_0xc194('0xf'),_0x14a737,_0x2fec43[_0xc194('0x12')][_0xc194('0x13')]);return _0x4f7ff2(_0x2fec43['error'][_0xc194('0x13')]);}logger['error'](_0xc194('0xf'),_0x14a737,_0x2fec43[_0xc194('0x12')][_0xc194('0x13')]);return _0x17a841(_0x2fec43['error'][_0xc194('0x13')]);}else{logger[_0xc194('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x14a737,_0xc194('0x14'));_0x17a841(_0x2fec43[_0xc194('0x15')][_0xc194('0x13')]);}})['catch'](function(_0x5594d){logger[_0xc194('0x12')](_0xc194('0xf'),_0x14a737,_0x5594d);_0x4f7ff2(_0x5594d);});});} \ No newline at end of file +var _0x98ac=['error','message','info','result','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x98ac,0x16d));var _0xc98a=function(_0x208157,_0x5823ae){_0x208157=_0x208157-0x0;var _0x47d478=_0x98ac[_0x208157];return _0x47d478;};'use strict';var _=require(_0xc98a('0x0'));var util=require(_0xc98a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc98a('0x2'))['db'];var utils=require(_0xc98a('0x3'));var logger=require(_0xc98a('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc98a('0x5'));var client=jayson[_0xc98a('0x6')][_0xc98a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xb00b21,_0x59533b,_0x233c6d){return new BPromise(function(_0x4b0c88,_0x1aaf3f){return client['request'](_0xb00b21,_0x233c6d)[_0xc98a('0x8')](function(_0x6c4946){logger['info'](_0xc98a('0x9'),_0x59533b,'request\x20sent');logger[_0xc98a('0xa')](_0xc98a('0xb'),_0x59533b,_0xc98a('0xc'),JSON[_0xc98a('0xd')](_0x6c4946));if(_0x6c4946['error']){if(_0x6c4946['error'][_0xc98a('0xe')]===0x1f4){logger[_0xc98a('0xf')](_0xc98a('0x9'),_0x59533b,_0x6c4946[_0xc98a('0xf')]['message']);return _0x1aaf3f(_0x6c4946['error']['message']);}logger['error'](_0xc98a('0x9'),_0x59533b,_0x6c4946[_0xc98a('0xf')]['message']);return _0x4b0c88(_0x6c4946[_0xc98a('0xf')][_0xc98a('0x10')]);}else{logger[_0xc98a('0x11')](_0xc98a('0x9'),_0x59533b,_0xc98a('0xc'));_0x4b0c88(_0x6c4946[_0xc98a('0x12')][_0xc98a('0x10')]);}})[_0xc98a('0x13')](function(_0x4d69c4){logger[_0xc98a('0xf')](_0xc98a('0x9'),_0x59533b,_0x4d69c4);_0x1aaf3f(_0x4d69c4);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index e426339..aa8c327 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 _0xcea2=['update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','./pause.controller','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x424057,_0x579c26){var _0x5eaad8=function(_0x3913a8){while(--_0x3913a8){_0x424057['push'](_0x424057['shift']());}};_0x5eaad8(++_0x579c26);}(_0xcea2,0x15a));var _0x2cea=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xcea2[_0x2ec461];return _0x28603d;};'use strict';var multer=require(_0x2cea('0x0'));var util=require('util');var path=require(_0x2cea('0x1'));var timeout=require('connect-timeout');var express=require(_0x2cea('0x2'));var router=express[_0x2cea('0x3')]();var auth=require(_0x2cea('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2cea('0x5'));var controller=require(_0x2cea('0x6'));router[_0x2cea('0x7')]('/',auth['isAuthenticated'](),controller[_0x2cea('0x8')]);router['get'](_0x2cea('0x9'),auth[_0x2cea('0xa')](),controller[_0x2cea('0xb')]);router[_0x2cea('0xc')]('/',auth[_0x2cea('0xa')](),controller[_0x2cea('0xd')]);router['put'](_0x2cea('0x9'),auth[_0x2cea('0xa')](),controller[_0x2cea('0xe')]);router[_0x2cea('0xf')](_0x2cea('0x9'),auth[_0x2cea('0xa')](),controller[_0x2cea('0x10')]);module[_0x2cea('0x11')]=router; \ No newline at end of file +var _0x60e1=['./pause.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x784604,_0x504fa9){var _0xc85f1a=function(_0x40dea9){while(--_0x40dea9){_0x784604['push'](_0x784604['shift']());}};_0xc85f1a(++_0x504fa9);}(_0x60e1,0x14c));var _0x160e=function(_0x230dc5,_0x44c18f){_0x230dc5=_0x230dc5-0x0;var _0x2b637d=_0x60e1[_0x230dc5];return _0x2b637d;};'use strict';var multer=require(_0x160e('0x0'));var util=require('util');var path=require(_0x160e('0x1'));var timeout=require(_0x160e('0x2'));var express=require(_0x160e('0x3'));var router=express[_0x160e('0x4')]();var auth=require(_0x160e('0x5'));var interaction=require(_0x160e('0x6'));var config=require(_0x160e('0x7'));var controller=require(_0x160e('0x8'));router[_0x160e('0x9')]('/',auth[_0x160e('0xa')](),controller['index']);router[_0x160e('0x9')]('/:id',auth[_0x160e('0xa')](),controller[_0x160e('0xb')]);router[_0x160e('0xc')]('/',auth['isAuthenticated'](),controller[_0x160e('0xd')]);router[_0x160e('0xe')](_0x160e('0xf'),auth[_0x160e('0xa')](),controller[_0x160e('0x10')]);router[_0x160e('0x11')]('/:id',auth[_0x160e('0xa')](),controller[_0x160e('0x12')]);module[_0x160e('0x13')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 1435c63..a1d04a4 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 _0x81d9=['STRING','name','sequelize','exports'];(function(_0x3017e8,_0x5ec37b){var _0xbeb6f7=function(_0x1ca187){while(--_0x1ca187){_0x3017e8['push'](_0x3017e8['shift']());}};_0xbeb6f7(++_0x5ec37b);}(_0x81d9,0x146));var _0x981d=function(_0x18d2b5,_0x367ced){_0x18d2b5=_0x18d2b5-0x0;var _0xa76b94=_0x81d9[_0x18d2b5];return _0xa76b94;};'use strict';var Sequelize=require(_0x981d('0x0'));module[_0x981d('0x1')]={'name':{'type':Sequelize[_0x981d('0x2')],'unique':_0x981d('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8385=['STRING','name','sequelize'];(function(_0x38941a,_0x589c16){var _0x49bb30=function(_0x1a039a){while(--_0x1a039a){_0x38941a['push'](_0x38941a['shift']());}};_0x49bb30(++_0x589c16);}(_0x8385,0x161));var _0x5838=function(_0x24a571,_0x5b3383){_0x24a571=_0x24a571-0x0;var _0x593a38=_0x8385[_0x24a571];return _0x593a38;};'use strict';var Sequelize=require(_0x5838('0x0'));module['exports']={'name':{'type':Sequelize[_0x5838('0x1')],'unique':_0x5838('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x5838('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 586a0ae..f1325f7 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 _0xe1d0=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','end','error','stack','name','send','index','rawAttributes','model','keys','query','attributes','fields','nolimit','limit','sort','filters','pick','filter','where','merge','map','type','key','field','options','include','Pause','findAll','rows','catch','params','intersection','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0xe1d0,0xd8));var _0x0e1d=function(_0x28777e,_0x185650){_0x28777e=_0x28777e-0x0;var _0x21ed33=_0xe1d0[_0x28777e];return _0x21ed33;};'use strict';var pdf=require(_0x0e1d('0x0'));var emlformat=require(_0x0e1d('0x1'));var rimraf=require(_0x0e1d('0x2'));var zipdir=require(_0x0e1d('0x3'));var jsonpatch=require(_0x0e1d('0x4'));var rp=require('request-promise');var moment=require(_0x0e1d('0x5'));var BPromise=require(_0x0e1d('0x6'));var Mustache=require(_0x0e1d('0x7'));var util=require(_0x0e1d('0x8'));var path=require('path');var sox=require(_0x0e1d('0x9'));var csv=require(_0x0e1d('0xa'));var ejs=require(_0x0e1d('0xb'));var fs=require('fs');var _=require(_0x0e1d('0xc'));var squel=require(_0x0e1d('0xd'));var crypto=require(_0x0e1d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0e1d('0xf'));var toCsv=require(_0x0e1d('0xa'));var querystring=require('querystring');var Papa=require(_0x0e1d('0x10'));var Redis=require(_0x0e1d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0e1d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e1d('0x13'))(_0x0e1d('0x14'));var utils=require(_0x0e1d('0x15'));var config=require(_0x0e1d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18c088,_0xbb4de4){_0xbb4de4=_0xbb4de4||0xcc;return function(_0x50b208){if(_0x50b208){return _0x18c088[_0x0e1d('0x17')](_0xbb4de4);}return _0x18c088['status'](_0xbb4de4)['end']();};}function respondWithResult(_0x40327d,_0x420a40){_0x420a40=_0x420a40||0xc8;return function(_0x9610e4){if(_0x9610e4){return _0x40327d[_0x0e1d('0x18')](_0x420a40)['json'](_0x9610e4);}};}function respondWithFilteredResult(_0x1b4c1a,_0x1d5c0a){return function(_0x28a4cd){if(_0x28a4cd){var _0x39ba4a=_0x28a4cd[_0x0e1d('0x19')],_0x1437df=_0x1d5c0a[_0x0e1d('0x1a')],_0x26656d=_0x1d5c0a['offset']+_0x1d5c0a['limit'],_0x76fbba;if(_0x26656d>=_0x39ba4a){_0x26656d=_0x39ba4a;_0x76fbba=0xc8;}else{_0x76fbba=0xce;}_0x1b4c1a[_0x0e1d('0x18')](_0x76fbba);return _0x1b4c1a[_0x0e1d('0x1b')](_0x0e1d('0x1c'),_0x1437df+'-'+_0x26656d+'/'+_0x39ba4a)['json'](_0x28a4cd);}return null;};}function patchUpdates(_0x27a0b4){return function(_0x654cd2){try{jsonpatch[_0x0e1d('0x1d')](_0x654cd2,_0x27a0b4,!![]);}catch(_0x399ab5){return BPromise[_0x0e1d('0x1e')](_0x399ab5);}return _0x654cd2[_0x0e1d('0x1f')]();};}function saveUpdates(_0x16cc40,_0xedffef){return function(_0x4b5d6c){if(_0x4b5d6c){return _0x4b5d6c[_0x0e1d('0x20')](_0x16cc40)[_0x0e1d('0x21')](function(_0x4f9ae5){return _0x4f9ae5;});}return null;};}function removeEntity(_0x31c75c,_0x496a30){return function(_0x19eff3){if(_0x19eff3){return _0x19eff3[_0x0e1d('0x22')]()['then'](function(){var _0x5a5cfe=_0x19eff3[_0x0e1d('0x23')]({'plain':!![]});var _0x13e1ca=_0x0e1d('0x24');return db[_0x0e1d('0x25')]['destroy']({'where':{'type':_0x13e1ca,'resourceId':_0x5a5cfe['id']}})[_0x0e1d('0x21')](function(){return _0x19eff3;});})[_0x0e1d('0x21')](function(){_0x31c75c['status'](0xcc)[_0x0e1d('0x26')]();});}};}function handleEntityNotFound(_0x210533,_0x3c7762){return function(_0x447968){if(!_0x447968){_0x210533[_0x0e1d('0x17')](0x194);}return _0x447968;};}function handleError(_0x4c5975,_0x1ea022){_0x1ea022=_0x1ea022||0x1f4;return function(_0x1d5e2e){logger[_0x0e1d('0x27')](_0x1d5e2e[_0x0e1d('0x28')]);if(_0x1d5e2e[_0x0e1d('0x29')]){delete _0x1d5e2e[_0x0e1d('0x29')];}_0x4c5975[_0x0e1d('0x18')](_0x1ea022)[_0x0e1d('0x2a')](_0x1d5e2e);};}exports[_0x0e1d('0x2b')]=function(_0x84b739,_0x2f1160){var _0x394233={},_0x435346={},_0x1a8131={'count':0x0,'rows':[]};var _0x5eb543=db['Pause'][_0x0e1d('0x2c')];_0x435346[_0x0e1d('0x2d')]=_[_0x0e1d('0x2e')](_0x5eb543);_0x435346[_0x0e1d('0x2f')]=_[_0x0e1d('0x2e')](_0x84b739[_0x0e1d('0x2f')]);_0x435346['filters']=_['intersection'](_0x435346[_0x0e1d('0x2d')],_0x435346[_0x0e1d('0x2f')]);_0x394233[_0x0e1d('0x30')]=_['intersection'](_0x435346[_0x0e1d('0x2d')],qs[_0x0e1d('0x31')](_0x84b739[_0x0e1d('0x2f')]['fields']));_0x394233[_0x0e1d('0x30')]=_0x394233['attributes']['length']?_0x394233[_0x0e1d('0x30')]:_0x435346[_0x0e1d('0x2d')];if(!_0x84b739[_0x0e1d('0x2f')]['hasOwnProperty'](_0x0e1d('0x32'))){_0x394233[_0x0e1d('0x33')]=qs[_0x0e1d('0x33')](_0x84b739['query'][_0x0e1d('0x33')]);_0x394233[_0x0e1d('0x1a')]=qs[_0x0e1d('0x1a')](_0x84b739['query'][_0x0e1d('0x1a')]);}_0x394233['order']=qs[_0x0e1d('0x34')](_0x84b739['query'][_0x0e1d('0x34')]);_0x394233['where']=qs[_0x0e1d('0x35')](_[_0x0e1d('0x36')](_0x84b739[_0x0e1d('0x2f')],_0x435346[_0x0e1d('0x35')]));if(_0x84b739[_0x0e1d('0x2f')][_0x0e1d('0x37')]){_0x394233[_0x0e1d('0x38')]=_[_0x0e1d('0x39')](_0x394233[_0x0e1d('0x38')],{'$or':_[_0x0e1d('0x3a')](_0x5eb543,function(_0x15de9d){if(_0x15de9d[_0x0e1d('0x3b')][_0x0e1d('0x3c')]!=='VIRTUAL'){var _0x1e88bf={};_0x1e88bf[_0x15de9d[_0x0e1d('0x3d')]]={'$like':'%'+_0x84b739[_0x0e1d('0x2f')]['filter']+'%'};return _0x1e88bf;}})});}_0x394233=_['merge']({},_0x394233,_0x84b739[_0x0e1d('0x3e')]);var _0x4726ab={'where':_0x394233[_0x0e1d('0x38')]};return db['Pause'][_0x0e1d('0x19')](_0x4726ab)[_0x0e1d('0x21')](function(_0x57e880){_0x1a8131[_0x0e1d('0x19')]=_0x57e880;if(_0x84b739[_0x0e1d('0x2f')]['includeAll']){_0x394233[_0x0e1d('0x3f')]=[{'all':!![]}];}return db[_0x0e1d('0x40')][_0x0e1d('0x41')](_0x394233);})[_0x0e1d('0x21')](function(_0x4cdcc6){_0x1a8131[_0x0e1d('0x42')]=_0x4cdcc6;return _0x1a8131;})['then'](respondWithFilteredResult(_0x2f1160,_0x394233))[_0x0e1d('0x43')](handleError(_0x2f1160,null));};exports['show']=function(_0x1c6f8b,_0x3c37dd){var _0x58c4bf={'raw':!![],'where':{'id':_0x1c6f8b[_0x0e1d('0x44')]['id']}},_0x33fa21={};_0x33fa21[_0x0e1d('0x2d')]=_[_0x0e1d('0x2e')](db['Pause'][_0x0e1d('0x2c')]);_0x33fa21[_0x0e1d('0x2f')]=_['keys'](_0x1c6f8b['query']);_0x33fa21['filters']=_[_0x0e1d('0x45')](_0x33fa21['model'],_0x33fa21['query']);_0x58c4bf[_0x0e1d('0x30')]=_[_0x0e1d('0x45')](_0x33fa21[_0x0e1d('0x2d')],qs[_0x0e1d('0x31')](_0x1c6f8b[_0x0e1d('0x2f')][_0x0e1d('0x31')]));_0x58c4bf[_0x0e1d('0x30')]=_0x58c4bf['attributes']['length']?_0x58c4bf[_0x0e1d('0x30')]:_0x33fa21[_0x0e1d('0x2d')];if(_0x1c6f8b['query'][_0x0e1d('0x46')]){_0x58c4bf[_0x0e1d('0x3f')]=[{'all':!![]}];}_0x58c4bf=_['merge']({},_0x58c4bf,_0x1c6f8b[_0x0e1d('0x3e')]);return db['Pause']['find'](_0x58c4bf)[_0x0e1d('0x21')](handleEntityNotFound(_0x3c37dd,null))['then'](respondWithResult(_0x3c37dd,null))[_0x0e1d('0x43')](handleError(_0x3c37dd,null));};exports[_0x0e1d('0x47')]=function(_0x16cfdd,_0x4bba56){return db[_0x0e1d('0x40')][_0x0e1d('0x47')](_0x16cfdd['body'],{})[_0x0e1d('0x21')](function(_0x4faf06){var _0x304e91=_0x16cfdd[_0x0e1d('0x48')]['get']({'plain':!![]});if(!_0x304e91)throw new Error(_0x0e1d('0x49'));if(_0x304e91['role']===_0x0e1d('0x48')){var _0x3f9fd3=_0x4faf06[_0x0e1d('0x23')]({'plain':!![]});var _0x158abb=_0x0e1d('0x24');return db[_0x0e1d('0x4a')][_0x0e1d('0x4b')]({'where':{'name':_0x158abb,'userProfileId':_0x304e91[_0x0e1d('0x4c')]},'raw':!![]})[_0x0e1d('0x21')](function(_0x43230d){if(_0x43230d&&_0x43230d['autoAssociation']===0x0){return db[_0x0e1d('0x25')][_0x0e1d('0x47')]({'name':_0x3f9fd3['name'],'resourceId':_0x3f9fd3['id'],'type':_0x43230d[_0x0e1d('0x29')],'sectionId':_0x43230d['id']},{})[_0x0e1d('0x21')](function(){return _0x4faf06;});}else{return _0x4faf06;}})[_0x0e1d('0x43')](function(_0x2c609e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c609e);throw _0x2c609e;});}return _0x4faf06;})['then'](respondWithResult(_0x4bba56,0xc9))['catch'](handleError(_0x4bba56,null));};exports[_0x0e1d('0x20')]=function(_0x451337,_0x1982b8){if(_0x451337[_0x0e1d('0x4d')]['id']){delete _0x451337[_0x0e1d('0x4d')]['id'];}return db[_0x0e1d('0x40')][_0x0e1d('0x4b')]({'where':{'id':_0x451337['params']['id']}})[_0x0e1d('0x21')](handleEntityNotFound(_0x1982b8,null))[_0x0e1d('0x21')](saveUpdates(_0x451337['body'],null))[_0x0e1d('0x21')](respondWithResult(_0x1982b8,null))[_0x0e1d('0x43')](handleError(_0x1982b8,null));};exports['destroy']=function(_0x32429c,_0x333476){return db['Pause']['find']({'where':{'id':_0x32429c[_0x0e1d('0x44')]['id']}})['then'](handleEntityNotFound(_0x333476,null))[_0x0e1d('0x21')](removeEntity(_0x333476,null))['catch'](handleError(_0x333476,null));}; \ No newline at end of file +var _0x7ce5=['sort','pick','filter','where','map','type','key','VIRTUAL','field','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','to-csv','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','offset','limit','set','reject','save','then','destroy','get','Pauses','stack','name','send','Pause','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x13aeca,_0x778aac){var _0x404453=function(_0x5d6f6f){while(--_0x5d6f6f){_0x13aeca['push'](_0x13aeca['shift']());}};_0x404453(++_0x778aac);}(_0x7ce5,0x1a0));var _0x57ce=function(_0x545fda,_0x8535c1){_0x545fda=_0x545fda-0x0;var _0xb987d8=_0x7ce5[_0x545fda];return _0xb987d8;};'use strict';var pdf=require(_0x57ce('0x0'));var emlformat=require(_0x57ce('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x57ce('0x2'));var jsonpatch=require(_0x57ce('0x3'));var rp=require(_0x57ce('0x4'));var moment=require(_0x57ce('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x57ce('0x6'));var sox=require('sox');var csv=require(_0x57ce('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x57ce('0x8'));var squel=require('squel');var crypto=require(_0x57ce('0x9'));var jsforce=require(_0x57ce('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x57ce('0x7'));var querystring=require('querystring');var Papa=require(_0x57ce('0xb'));var Redis=require(_0x57ce('0xc'));var authService=require(_0x57ce('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x57ce('0xe'));var logger=require('../../config/logger')(_0x57ce('0xf'));var utils=require(_0x57ce('0x10'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x566613,_0x26a91f){_0x26a91f=_0x26a91f||0xcc;return function(_0x402780){if(_0x402780){return _0x566613[_0x57ce('0x11')](_0x26a91f);}return _0x566613[_0x57ce('0x12')](_0x26a91f)[_0x57ce('0x13')]();};}function respondWithResult(_0x25de8b,_0x2780eb){_0x2780eb=_0x2780eb||0xc8;return function(_0x5ca145){if(_0x5ca145){return _0x25de8b[_0x57ce('0x12')](_0x2780eb)[_0x57ce('0x14')](_0x5ca145);}};}function respondWithFilteredResult(_0x7a7de7,_0x552288){return function(_0x15803a){if(_0x15803a){var _0x46548d=_0x15803a['count'],_0x49fe92=_0x552288['offset'],_0x2e215e=_0x552288[_0x57ce('0x15')]+_0x552288[_0x57ce('0x16')],_0x520025;if(_0x2e215e>=_0x46548d){_0x2e215e=_0x46548d;_0x520025=0xc8;}else{_0x520025=0xce;}_0x7a7de7[_0x57ce('0x12')](_0x520025);return _0x7a7de7[_0x57ce('0x17')]('Content-Range',_0x49fe92+'-'+_0x2e215e+'/'+_0x46548d)['json'](_0x15803a);}return null;};}function patchUpdates(_0x3df38c){return function(_0x2e323e){try{jsonpatch['apply'](_0x2e323e,_0x3df38c,!![]);}catch(_0x1e5b06){return BPromise[_0x57ce('0x18')](_0x1e5b06);}return _0x2e323e[_0x57ce('0x19')]();};}function saveUpdates(_0x43dddd,_0x20c5b6){return function(_0xc1493a){if(_0xc1493a){return _0xc1493a['update'](_0x43dddd)[_0x57ce('0x1a')](function(_0x114a59){return _0x114a59;});}return null;};}function removeEntity(_0x16d0ef,_0x3af7d6){return function(_0x5ed7f1){if(_0x5ed7f1){return _0x5ed7f1[_0x57ce('0x1b')]()['then'](function(){var _0x33ba21=_0x5ed7f1[_0x57ce('0x1c')]({'plain':!![]});var _0x43da60=_0x57ce('0x1d');return db['UserProfileResource'][_0x57ce('0x1b')]({'where':{'type':_0x43da60,'resourceId':_0x33ba21['id']}})[_0x57ce('0x1a')](function(){return _0x5ed7f1;});})[_0x57ce('0x1a')](function(){_0x16d0ef[_0x57ce('0x12')](0xcc)[_0x57ce('0x13')]();});}};}function handleEntityNotFound(_0x44ac71,_0x37ceb8){return function(_0x130d1a){if(!_0x130d1a){_0x44ac71[_0x57ce('0x11')](0x194);}return _0x130d1a;};}function handleError(_0x2ac5c1,_0xf70e29){_0xf70e29=_0xf70e29||0x1f4;return function(_0x27f2a4){logger['error'](_0x27f2a4[_0x57ce('0x1e')]);if(_0x27f2a4[_0x57ce('0x1f')]){delete _0x27f2a4['name'];}_0x2ac5c1[_0x57ce('0x12')](_0xf70e29)[_0x57ce('0x20')](_0x27f2a4);};}exports['index']=function(_0x68ea1e,_0x53521e){var _0x231d2b={},_0x1b01d9={},_0x620a1f={'count':0x0,'rows':[]};var _0x297f54=db[_0x57ce('0x21')][_0x57ce('0x22')];_0x1b01d9[_0x57ce('0x23')]=_[_0x57ce('0x24')](_0x297f54);_0x1b01d9[_0x57ce('0x25')]=_[_0x57ce('0x24')](_0x68ea1e['query']);_0x1b01d9[_0x57ce('0x26')]=_[_0x57ce('0x27')](_0x1b01d9[_0x57ce('0x23')],_0x1b01d9[_0x57ce('0x25')]);_0x231d2b['attributes']=_['intersection'](_0x1b01d9[_0x57ce('0x23')],qs[_0x57ce('0x28')](_0x68ea1e[_0x57ce('0x25')][_0x57ce('0x28')]));_0x231d2b[_0x57ce('0x29')]=_0x231d2b['attributes'][_0x57ce('0x2a')]?_0x231d2b[_0x57ce('0x29')]:_0x1b01d9['model'];if(!_0x68ea1e[_0x57ce('0x25')][_0x57ce('0x2b')](_0x57ce('0x2c'))){_0x231d2b['limit']=qs[_0x57ce('0x16')](_0x68ea1e[_0x57ce('0x25')][_0x57ce('0x16')]);_0x231d2b[_0x57ce('0x15')]=qs[_0x57ce('0x15')](_0x68ea1e[_0x57ce('0x25')][_0x57ce('0x15')]);}_0x231d2b[_0x57ce('0x2d')]=qs['sort'](_0x68ea1e[_0x57ce('0x25')][_0x57ce('0x2e')]);_0x231d2b['where']=qs[_0x57ce('0x26')](_[_0x57ce('0x2f')](_0x68ea1e[_0x57ce('0x25')],_0x1b01d9[_0x57ce('0x26')]));if(_0x68ea1e[_0x57ce('0x25')][_0x57ce('0x30')]){_0x231d2b[_0x57ce('0x31')]=_['merge'](_0x231d2b[_0x57ce('0x31')],{'$or':_[_0x57ce('0x32')](_0x297f54,function(_0x4e1a66){if(_0x4e1a66[_0x57ce('0x33')][_0x57ce('0x34')]!==_0x57ce('0x35')){var _0x2ccdb2={};_0x2ccdb2[_0x4e1a66[_0x57ce('0x36')]]={'$like':'%'+_0x68ea1e[_0x57ce('0x25')][_0x57ce('0x30')]+'%'};return _0x2ccdb2;}})});}_0x231d2b=_[_0x57ce('0x37')]({},_0x231d2b,_0x68ea1e[_0x57ce('0x38')]);var _0x5853ce={'where':_0x231d2b[_0x57ce('0x31')]};return db[_0x57ce('0x21')][_0x57ce('0x39')](_0x5853ce)['then'](function(_0x3c6dc2){_0x620a1f[_0x57ce('0x39')]=_0x3c6dc2;if(_0x68ea1e[_0x57ce('0x25')][_0x57ce('0x3a')]){_0x231d2b[_0x57ce('0x3b')]=[{'all':!![]}];}return db['Pause'][_0x57ce('0x3c')](_0x231d2b);})['then'](function(_0x1b460b){_0x620a1f[_0x57ce('0x3d')]=_0x1b460b;return _0x620a1f;})[_0x57ce('0x1a')](respondWithFilteredResult(_0x53521e,_0x231d2b))[_0x57ce('0x3e')](handleError(_0x53521e,null));};exports[_0x57ce('0x3f')]=function(_0x203b9f,_0x1ec93e){var _0x13b5e9={'raw':!![],'where':{'id':_0x203b9f[_0x57ce('0x40')]['id']}},_0x21ab15={};_0x21ab15[_0x57ce('0x23')]=_['keys'](db[_0x57ce('0x21')]['rawAttributes']);_0x21ab15[_0x57ce('0x25')]=_['keys'](_0x203b9f[_0x57ce('0x25')]);_0x21ab15[_0x57ce('0x26')]=_[_0x57ce('0x27')](_0x21ab15[_0x57ce('0x23')],_0x21ab15[_0x57ce('0x25')]);_0x13b5e9[_0x57ce('0x29')]=_[_0x57ce('0x27')](_0x21ab15[_0x57ce('0x23')],qs['fields'](_0x203b9f['query'][_0x57ce('0x28')]));_0x13b5e9['attributes']=_0x13b5e9[_0x57ce('0x29')][_0x57ce('0x2a')]?_0x13b5e9[_0x57ce('0x29')]:_0x21ab15[_0x57ce('0x23')];if(_0x203b9f['query'][_0x57ce('0x3a')]){_0x13b5e9[_0x57ce('0x3b')]=[{'all':!![]}];}_0x13b5e9=_[_0x57ce('0x37')]({},_0x13b5e9,_0x203b9f[_0x57ce('0x38')]);return db[_0x57ce('0x21')][_0x57ce('0x41')](_0x13b5e9)[_0x57ce('0x1a')](handleEntityNotFound(_0x1ec93e,null))[_0x57ce('0x1a')](respondWithResult(_0x1ec93e,null))[_0x57ce('0x3e')](handleError(_0x1ec93e,null));};exports[_0x57ce('0x42')]=function(_0x13558c,_0x16aacd){return db[_0x57ce('0x21')][_0x57ce('0x42')](_0x13558c[_0x57ce('0x43')],{})[_0x57ce('0x1a')](function(_0x25fc52){var _0x18b4c1=_0x13558c['user']['get']({'plain':!![]});if(!_0x18b4c1)throw new Error(_0x57ce('0x44'));if(_0x18b4c1['role']===_0x57ce('0x45')){var _0x20ca66=_0x25fc52['get']({'plain':!![]});var _0x3f939b=_0x57ce('0x1d');return db[_0x57ce('0x46')][_0x57ce('0x41')]({'where':{'name':_0x3f939b,'userProfileId':_0x18b4c1[_0x57ce('0x47')]},'raw':!![]})[_0x57ce('0x1a')](function(_0x152945){if(_0x152945&&_0x152945[_0x57ce('0x48')]===0x0){return db[_0x57ce('0x49')][_0x57ce('0x42')]({'name':_0x20ca66[_0x57ce('0x1f')],'resourceId':_0x20ca66['id'],'type':_0x152945['name'],'sectionId':_0x152945['id']},{})[_0x57ce('0x1a')](function(){return _0x25fc52;});}else{return _0x25fc52;}})['catch'](function(_0x55539a){logger[_0x57ce('0x4a')](_0x57ce('0x4b'),_0x55539a);throw _0x55539a;});}return _0x25fc52;})['then'](respondWithResult(_0x16aacd,0xc9))[_0x57ce('0x3e')](handleError(_0x16aacd,null));};exports[_0x57ce('0x4c')]=function(_0x3774f4,_0x21ba54){if(_0x3774f4[_0x57ce('0x43')]['id']){delete _0x3774f4[_0x57ce('0x43')]['id'];}return db[_0x57ce('0x21')][_0x57ce('0x41')]({'where':{'id':_0x3774f4[_0x57ce('0x40')]['id']}})[_0x57ce('0x1a')](handleEntityNotFound(_0x21ba54,null))[_0x57ce('0x1a')](saveUpdates(_0x3774f4[_0x57ce('0x43')],null))[_0x57ce('0x1a')](respondWithResult(_0x21ba54,null))[_0x57ce('0x3e')](handleError(_0x21ba54,null));};exports[_0x57ce('0x1b')]=function(_0x127c7c,_0x16937d){return db[_0x57ce('0x21')][_0x57ce('0x41')]({'where':{'id':_0x127c7c[_0x57ce('0x40')]['id']}})['then'](handleEntityNotFound(_0x16937d,null))[_0x57ce('0x1a')](removeEntity(_0x16937d,null))[_0x57ce('0x3e')](handleError(_0x16937d,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 22ee21d..e5a2d17 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 _0x79a8=['exports','define','Pause','tools_pauses','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x313b7b,_0x4592cc){var _0x466bed=function(_0x12ce4b){while(--_0x12ce4b){_0x313b7b['push'](_0x313b7b['shift']());}};_0x466bed(++_0x4592cc);}(_0x79a8,0x1a6));var _0x879a=function(_0x378b4,_0x5ca7fa){_0x378b4=_0x378b4-0x0;var _0x11d07b=_0x79a8[_0x378b4];return _0x11d07b;};'use strict';var _=require('lodash');var util=require(_0x879a('0x0'));var logger=require(_0x879a('0x1'))(_0x879a('0x2'));var moment=require(_0x879a('0x3'));var BPromise=require('bluebird');var rp=require(_0x879a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x879a('0x5'));var config=require(_0x879a('0x6'));var attributes=require('./pause.attributes');module[_0x879a('0x7')]=function(_0x804f40,_0x28f382){return _0x804f40[_0x879a('0x8')](_0x879a('0x9'),attributes,{'tableName':_0x879a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4aa1=['Pause','util','bluebird','request-promise','path','../../config/environment','./pause.attributes','exports','define'];(function(_0x2d088c,_0x539a1b){var _0x4b9713=function(_0x32b1f6){while(--_0x32b1f6){_0x2d088c['push'](_0x2d088c['shift']());}};_0x4b9713(++_0x539a1b);}(_0x4aa1,0xbe));var _0x14aa=function(_0x7f71b5,_0x3be7fe){_0x7f71b5=_0x7f71b5-0x0;var _0x4de68a=_0x4aa1[_0x7f71b5];return _0x4de68a;};'use strict';var _=require('lodash');var util=require(_0x14aa('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x14aa('0x1'));var rp=require(_0x14aa('0x2'));var fs=require('fs');var path=require(_0x14aa('0x3'));var rimraf=require('rimraf');var config=require(_0x14aa('0x4'));var attributes=require(_0x14aa('0x5'));module[_0x14aa('0x6')]=function(_0x413bae,_0xa2e4b2){return _0x413bae[_0x14aa('0x7')](_0x14aa('0x8'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 3b1cdeb..a05b06a 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 _0x5356=['attributes','include','map','model','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','info','Pause,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','ShowPause','Pause','find','options','raw'];(function(_0x30bca4,_0x591083){var _0x1c8c47=function(_0x578333){while(--_0x578333){_0x30bca4['push'](_0x30bca4['shift']());}};_0x1c8c47(++_0x591083);}(_0x5356,0x17e));var _0x6535=function(_0x34a63b,_0x3c8734){_0x34a63b=_0x34a63b-0x0;var _0x58f5dc=_0x5356[_0x34a63b];return _0x58f5dc;};'use strict';var _=require(_0x6535('0x0'));var util=require(_0x6535('0x1'));var moment=require(_0x6535('0x2'));var BPromise=require(_0x6535('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6535('0x4'))['db'];var utils=require(_0x6535('0x5'));var logger=require(_0x6535('0x6'))(_0x6535('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6535('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c2701,_0x17f36e,_0x175e4a){return new BPromise(function(_0x32a826,_0x58b510){return client['request'](_0x1c2701,_0x175e4a)[_0x6535('0x9')](function(_0x5d7423){logger[_0x6535('0xa')](_0x6535('0xb'),_0x17f36e,'request\x20sent');logger[_0x6535('0xc')]('Pause,\x20%s,\x20%s,\x20%s',_0x17f36e,_0x6535('0xd'),JSON[_0x6535('0xe')](_0x5d7423));if(_0x5d7423[_0x6535('0xf')]){if(_0x5d7423[_0x6535('0xf')]['code']===0x1f4){logger['error']('Pause,\x20%s,\x20%s',_0x17f36e,_0x5d7423[_0x6535('0xf')][_0x6535('0x10')]);return _0x58b510(_0x5d7423[_0x6535('0xf')][_0x6535('0x10')]);}logger[_0x6535('0xf')](_0x6535('0xb'),_0x17f36e,_0x5d7423[_0x6535('0xf')]['message']);return _0x32a826(_0x5d7423['error'][_0x6535('0x10')]);}else{logger['info'](_0x6535('0xb'),_0x17f36e,_0x6535('0xd'));_0x32a826(_0x5d7423['result'][_0x6535('0x10')]);}})[_0x6535('0x11')](function(_0x89dad7){logger[_0x6535('0xf')](_0x6535('0xb'),_0x17f36e,_0x89dad7);_0x58b510(_0x89dad7);});});}exports[_0x6535('0x12')]=function(_0x39457c){var _0x23a01f=this;return new Promise(function(_0x526133,_0x5a5a83){return db[_0x6535('0x13')][_0x6535('0x14')]({'raw':_0x39457c[_0x6535('0x15')]?_0x39457c['options'][_0x6535('0x16')]===undefined?!![]:![]:!![],'where':_0x39457c[_0x6535('0x15')]?_0x39457c['options']['where']||null:null,'attributes':_0x39457c[_0x6535('0x15')]?_0x39457c[_0x6535('0x15')][_0x6535('0x17')]||null:null,'include':_0x39457c[_0x6535('0x15')]?_0x39457c[_0x6535('0x15')][_0x6535('0x18')]?_[_0x6535('0x19')](_0x39457c[_0x6535('0x15')][_0x6535('0x18')],function(_0x18f1cf){return{'model':db[_0x18f1cf[_0x6535('0x1a')]],'as':_0x18f1cf['as'],'attributes':_0x18f1cf[_0x6535('0x17')],'include':_0x18f1cf[_0x6535('0x18')]?_[_0x6535('0x19')](_0x18f1cf[_0x6535('0x18')],function(_0x55fac8){return{'model':db[_0x55fac8[_0x6535('0x1a')]],'as':_0x55fac8['as'],'attributes':_0x55fac8['attributes'],'include':_0x55fac8[_0x6535('0x18')]?_[_0x6535('0x19')](_0x55fac8[_0x6535('0x18')],function(_0xc5d099){return{'model':db[_0xc5d099[_0x6535('0x1a')]],'as':_0xc5d099['as'],'attributes':_0xc5d099[_0x6535('0x17')]};}):[]};}):[]};}):[]:[]})[_0x6535('0x9')](function(_0x455e91){logger[_0x6535('0xa')](_0x6535('0x12'),_0x39457c);logger[_0x6535('0xc')]('ShowPause',_0x39457c,JSON['stringify'](_0x455e91));_0x526133(_0x455e91);})[_0x6535('0x11')](function(_0x1f1d4e){logger[_0x6535('0xf')](_0x6535('0x12'),_0x1f1d4e[_0x6535('0x10')],_0x39457c);_0x5a5a83(_0x23a01f[_0x6535('0xf')](0x1f4,_0x1f1d4e[_0x6535('0x10')]));});});}; \ No newline at end of file +var _0x5f30=['client','http','request','then','info','Pause,\x20%s,\x20%s','request\x20sent','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Pause','options','raw','where','include','map','model','attributes','ShowPause','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x401c19,_0x57df31){var _0x531bae=function(_0x54ffa1){while(--_0x54ffa1){_0x401c19['push'](_0x401c19['shift']());}};_0x531bae(++_0x57df31);}(_0x5f30,0xe9));var _0x05f3=function(_0x2d9b69,_0x139175){_0x2d9b69=_0x2d9b69-0x0;var _0x185624=_0x5f30[_0x2d9b69];return _0x185624;};'use strict';var _=require(_0x05f3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x05f3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05f3('0x2'))['db'];var utils=require(_0x05f3('0x3'));var logger=require(_0x05f3('0x4'))('rpc');var config=require(_0x05f3('0x5'));var jayson=require(_0x05f3('0x6'));var client=jayson[_0x05f3('0x7')][_0x05f3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b008a,_0x543731,_0x3b1f2c){return new BPromise(function(_0x262f53,_0x225efb){return client[_0x05f3('0x9')](_0x2b008a,_0x3b1f2c)[_0x05f3('0xa')](function(_0x1852df){logger[_0x05f3('0xb')](_0x05f3('0xc'),_0x543731,_0x05f3('0xd'));logger['debug'](_0x05f3('0xe'),_0x543731,'request\x20sent',JSON[_0x05f3('0xf')](_0x1852df));if(_0x1852df['error']){if(_0x1852df[_0x05f3('0x10')][_0x05f3('0x11')]===0x1f4){logger[_0x05f3('0x10')](_0x05f3('0xc'),_0x543731,_0x1852df[_0x05f3('0x10')][_0x05f3('0x12')]);return _0x225efb(_0x1852df[_0x05f3('0x10')][_0x05f3('0x12')]);}logger[_0x05f3('0x10')](_0x05f3('0xc'),_0x543731,_0x1852df[_0x05f3('0x10')][_0x05f3('0x12')]);return _0x262f53(_0x1852df[_0x05f3('0x10')][_0x05f3('0x12')]);}else{logger[_0x05f3('0xb')](_0x05f3('0xc'),_0x543731,_0x05f3('0xd'));_0x262f53(_0x1852df[_0x05f3('0x13')]['message']);}})[_0x05f3('0x14')](function(_0x34d39b){logger[_0x05f3('0x10')]('Pause,\x20%s,\x20%s',_0x543731,_0x34d39b);_0x225efb(_0x34d39b);});});}exports['ShowPause']=function(_0x158ac1){var _0x764406=this;return new Promise(function(_0x42410a,_0xc8cd7){return db[_0x05f3('0x15')]['find']({'raw':_0x158ac1[_0x05f3('0x16')]?_0x158ac1[_0x05f3('0x16')][_0x05f3('0x17')]===undefined?!![]:![]:!![],'where':_0x158ac1[_0x05f3('0x16')]?_0x158ac1[_0x05f3('0x16')][_0x05f3('0x18')]||null:null,'attributes':_0x158ac1[_0x05f3('0x16')]?_0x158ac1[_0x05f3('0x16')]['attributes']||null:null,'include':_0x158ac1[_0x05f3('0x16')]?_0x158ac1[_0x05f3('0x16')][_0x05f3('0x19')]?_[_0x05f3('0x1a')](_0x158ac1[_0x05f3('0x16')][_0x05f3('0x19')],function(_0x364a60){return{'model':db[_0x364a60[_0x05f3('0x1b')]],'as':_0x364a60['as'],'attributes':_0x364a60['attributes'],'include':_0x364a60[_0x05f3('0x19')]?_[_0x05f3('0x1a')](_0x364a60[_0x05f3('0x19')],function(_0x4cf582){return{'model':db[_0x4cf582['model']],'as':_0x4cf582['as'],'attributes':_0x4cf582[_0x05f3('0x1c')],'include':_0x4cf582[_0x05f3('0x19')]?_[_0x05f3('0x1a')](_0x4cf582[_0x05f3('0x19')],function(_0x2841c9){return{'model':db[_0x2841c9[_0x05f3('0x1b')]],'as':_0x2841c9['as'],'attributes':_0x2841c9[_0x05f3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x05f3('0xa')](function(_0x59d22d){logger[_0x05f3('0xb')](_0x05f3('0x1d'),_0x158ac1);logger['debug'](_0x05f3('0x1d'),_0x158ac1,JSON[_0x05f3('0xf')](_0x59d22d));_0x42410a(_0x59d22d);})[_0x05f3('0x14')](function(_0x499abe){logger['error'](_0x05f3('0x1d'),_0x499abe['message'],_0x158ac1);_0xc8cd7(_0x764406['error'](0x1f4,_0x499abe[_0x05f3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 60ec640..d8c791f 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 _0x34ba=['single','file','upload','webhookPost','put','delete','/:id','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','diskStorage','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','post'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x34ba,0xa2));var _0xa34b=function(_0x28863a,_0x2d34c2){_0x28863a=_0x28863a-0x0;var _0x3d020f=_0x34ba[_0x28863a];return _0x3d020f;};'use strict';var multer=require('multer');var util=require(_0xa34b('0x0'));var path=require(_0xa34b('0x1'));var timeout=require(_0xa34b('0x2'));var express=require(_0xa34b('0x3'));var router=express[_0xa34b('0x4')]();var auth=require(_0xa34b('0x5'));var interaction=require(_0xa34b('0x6'));var config=require(_0xa34b('0x7'));var controller=require(_0xa34b('0x8'));router[_0xa34b('0x9')]('/',auth[_0xa34b('0xa')](),controller[_0xa34b('0xb')]);router[_0xa34b('0x9')](_0xa34b('0xc'),controller[_0xa34b('0xd')]);router[_0xa34b('0x9')]('/:id',auth[_0xa34b('0xa')](),controller['show']);router[_0xa34b('0x9')]('/:id/download',auth[_0xa34b('0xa')](),controller['download']);var upload=multer({'storage':multer[_0xa34b('0xe')]({'destination':function(_0x2c3dee,_0x4c21c9,_0x1d4f44){_0x1d4f44(null,path['join'](config[_0xa34b('0xf')],_0xa34b('0x10')));},'filename':function(_0x940f6a,_0x3237b2,_0x232cb7){_0x3237b2['originalname']=_0x3237b2[_0xa34b('0x11')][_0xa34b('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x232cb7(null,util[_0xa34b('0x13')](_0xa34b('0x14'),path[_0xa34b('0x15')](_0x3237b2[_0xa34b('0x11')],path['extname'](_0x3237b2['originalname'])),Date['now'](),path[_0xa34b('0x16')](_0x3237b2[_0xa34b('0x11')])));}})});router[_0xa34b('0x17')]('/',upload[_0xa34b('0x18')](_0xa34b('0x19')),controller[_0xa34b('0x1a')]);router['post'](_0xa34b('0xc'),controller[_0xa34b('0x1b')]);router[_0xa34b('0x1c')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa34b('0x1d')](_0xa34b('0x1e'),auth[_0xa34b('0xa')](),controller['delete']);module['exports']=router; \ No newline at end of file +var _0x6b3e=['/webhook','webhookGet','isAuthenticated','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','single','file','upload','/:id','update','delete','exports','path','connect-timeout','express','Router','../../config/environment','./plugin.controller','get','index'];(function(_0xa9054d,_0x3cc1bf){var _0x3aae53=function(_0x54254b){while(--_0x54254b){_0xa9054d['push'](_0xa9054d['shift']());}};_0x3aae53(++_0x3cc1bf);}(_0x6b3e,0x1c9));var _0xe6b3=function(_0x55491f,_0x3aea90){_0x55491f=_0x55491f-0x0;var _0x4bc1fb=_0x6b3e[_0x55491f];return _0x4bc1fb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe6b3('0x0'));var timeout=require(_0xe6b3('0x1'));var express=require(_0xe6b3('0x2'));var router=express[_0xe6b3('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe6b3('0x4'));var controller=require(_0xe6b3('0x5'));router[_0xe6b3('0x6')]('/',auth['isAuthenticated'](),controller[_0xe6b3('0x7')]);router['get'](_0xe6b3('0x8'),controller[_0xe6b3('0x9')]);router[_0xe6b3('0x6')]('/:id',auth[_0xe6b3('0xa')](),controller[_0xe6b3('0xb')]);router[_0xe6b3('0x6')](_0xe6b3('0xc'),auth[_0xe6b3('0xa')](),controller[_0xe6b3('0xd')]);var upload=multer({'storage':multer[_0xe6b3('0xe')]({'destination':function(_0x2a571c,_0x352dc3,_0x3c93bf){_0x3c93bf(null,path[_0xe6b3('0xf')](config[_0xe6b3('0x10')],_0xe6b3('0x11')));},'filename':function(_0x4be828,_0x5bd84c,_0x2008e3){_0x5bd84c[_0xe6b3('0x12')]=_0x5bd84c[_0xe6b3('0x12')][_0xe6b3('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2008e3(null,util[_0xe6b3('0x14')](_0xe6b3('0x15'),path[_0xe6b3('0x16')](_0x5bd84c[_0xe6b3('0x12')],path['extname'](_0x5bd84c[_0xe6b3('0x12')])),Date['now'](),path[_0xe6b3('0x17')](_0x5bd84c[_0xe6b3('0x12')])));}})});router['post']('/',upload[_0xe6b3('0x18')](_0xe6b3('0x19')),controller[_0xe6b3('0x1a')]);router['post'](_0xe6b3('0x8'),controller['webhookPost']);router['put'](_0xe6b3('0x1b'),auth[_0xe6b3('0xa')](),controller[_0xe6b3('0x1c')]);router[_0xe6b3('0x1d')]('/:id',auth[_0xe6b3('0xa')](),controller[_0xe6b3('0x1d')]);module[_0xe6b3('0x1e')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 4d56e03..add19fe 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 _0xa4f9=['TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','never','sequelize','exports','ENUM','html','script'];(function(_0x43e2a0,_0x1dbb81){var _0x301655=function(_0x2aec98){while(--_0x2aec98){_0x43e2a0['push'](_0x43e2a0['shift']());}};_0x301655(++_0x1dbb81);}(_0xa4f9,0x1cf));var _0x9a4f=function(_0x164ccf,_0xe01cc6){_0x164ccf=_0x164ccf-0x0;var _0x14e90b=_0xa4f9[_0x164ccf];return _0x14e90b;};'use strict';var Sequelize=require(_0x9a4f('0x0'));module[_0x9a4f('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9a4f('0x2')](_0x9a4f('0x3'),_0x9a4f('0x4'))},'description':{'type':Sequelize[_0x9a4f('0x5')]},'version':{'type':Sequelize[_0x9a4f('0x5')]},'path':{'type':Sequelize[_0x9a4f('0x6')],'comment':_0x9a4f('0x7')},'active':{'type':Sequelize[_0x9a4f('0x8')],'defaultValue':0x0,'comment':_0x9a4f('0x9')},'sidebar':{'type':Sequelize[_0x9a4f('0x2')]('adminOnly',_0x9a4f('0xa'),_0x9a4f('0xb'),_0x9a4f('0xc')),'defaultValue':_0x9a4f('0xb'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x9a4f('0x6')]},'adminUrl':{'type':Sequelize[_0x9a4f('0x6')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x9a4f('0x6')]},'scriptPath':{'type':Sequelize[_0x9a4f('0x6')]}}; \ No newline at end of file +var _0x4d52=['STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports'];(function(_0x1c461e,_0x1b98ff){var _0x1dce4f=function(_0x5cbdf0){while(--_0x5cbdf0){_0x1c461e['push'](_0x1c461e['shift']());}};_0x1dce4f(++_0x1b98ff);}(_0x4d52,0x137));var _0x24d5=function(_0x3fa26c,_0x2d7eab){_0x3fa26c=_0x3fa26c-0x0;var _0x5e33df=_0x4d52[_0x3fa26c];return _0x5e33df;};'use strict';var Sequelize=require('sequelize');module[_0x24d5('0x0')]={'name':{'type':Sequelize[_0x24d5('0x1')]},'type':{'type':Sequelize[_0x24d5('0x2')](_0x24d5('0x3'),_0x24d5('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x24d5('0x5')]},'path':{'type':Sequelize[_0x24d5('0x1')],'comment':_0x24d5('0x6')},'active':{'type':Sequelize[_0x24d5('0x7')],'defaultValue':0x0,'comment':_0x24d5('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0x24d5('0x9'),_0x24d5('0xa'),_0x24d5('0xb'),'never'),'defaultValue':_0x24d5('0xb'),'comment':_0x24d5('0xc')},'icon':{'type':Sequelize[_0x24d5('0x1')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x24d5('0x1')]},'scriptName':{'type':Sequelize[_0x24d5('0x1')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 61b598c..6a30e39 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 _0x3e3e=['some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','undefined','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','port','encoding','method','%s%s','headers','content-length','content-type','statusCode','webhookPost','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','redis','localhost','socket.io-emitter','./plugin.socket','sendStatus','end','json','count','offset','limit','status','set','apply','reject','save','update','then','destroy','Plugins','UserProfileResource','error','stack','name','send','index','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','filters','filter','where','type','merge','options','Plugin','includeAll','include','rows','catch','show','length','find','download','join','server/files/plugins','format','%s.zip','basename','createWriteStream','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','root','dirname','path','attachments/**/*','finalize','close','existsSync','unlinkSync','info','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory'];(function(_0xf62f27,_0x249f1d){var _0x4f7985=function(_0x54875b){while(--_0x54875b){_0xf62f27['push'](_0xf62f27['shift']());}};_0x4f7985(++_0x249f1d);}(_0x3e3e,0x173));var _0xe3e3=function(_0x1012bd,_0x321da6){_0x1012bd=_0x1012bd-0x0;var _0x287d4e=_0x3e3e[_0x1012bd];return _0x287d4e;};'use strict';var pdf=require(_0xe3e3('0x0'));var emlformat=require(_0xe3e3('0x1'));var rimraf=require(_0xe3e3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe3e3('0x3'));var rp=require(_0xe3e3('0x4'));var moment=require(_0xe3e3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe3e3('0x6'));var util=require(_0xe3e3('0x7'));var path=require('path');var sox=require(_0xe3e3('0x8'));var csv=require('to-csv');var ejs=require(_0xe3e3('0x9'));var fs=require('fs');var _=require(_0xe3e3('0xa'));var squel=require(_0xe3e3('0xb'));var crypto=require(_0xe3e3('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe3e3('0xd'));var querystring=require(_0xe3e3('0xe'));var Papa=require(_0xe3e3('0xf'));var extract=require('extract-zip');var rimraf=require(_0xe3e3('0x2'));var archiver=require('archiver');var Redis=require(_0xe3e3('0x10'));var authService=require(_0xe3e3('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe3e3('0x12'));var logger=require(_0xe3e3('0x13'))(_0xe3e3('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xe3e3('0x15')]=_['defaults'](config[_0xe3e3('0x15')],{'host':_0xe3e3('0x16'),'port':0x18eb});var socket=require(_0xe3e3('0x17'))(new Redis(config[_0xe3e3('0x15')]));require(_0xe3e3('0x18'))['register'](socket);function respondWithStatusCode(_0x10136b,_0x24b476){_0x24b476=_0x24b476||0xcc;return function(_0x8423ea){if(_0x8423ea){return _0x10136b[_0xe3e3('0x19')](_0x24b476);}return _0x10136b['status'](_0x24b476)[_0xe3e3('0x1a')]();};}function respondWithResult(_0x2337b0,_0x499725){_0x499725=_0x499725||0xc8;return function(_0x141569){if(_0x141569){return _0x2337b0['status'](_0x499725)[_0xe3e3('0x1b')](_0x141569);}};}function respondWithFilteredResult(_0x4afed6,_0x2c64da){return function(_0x2e2e5c){if(_0x2e2e5c){var _0x4a42dc=_0x2e2e5c[_0xe3e3('0x1c')],_0x2c9b7f=_0x2c64da[_0xe3e3('0x1d')],_0x2d6fd1=_0x2c64da[_0xe3e3('0x1d')]+_0x2c64da[_0xe3e3('0x1e')],_0x1d9eb1;if(_0x2d6fd1>=_0x4a42dc){_0x2d6fd1=_0x4a42dc;_0x1d9eb1=0xc8;}else{_0x1d9eb1=0xce;}_0x4afed6[_0xe3e3('0x1f')](_0x1d9eb1);return _0x4afed6[_0xe3e3('0x20')]('Content-Range',_0x2c9b7f+'-'+_0x2d6fd1+'/'+_0x4a42dc)[_0xe3e3('0x1b')](_0x2e2e5c);}return null;};}function patchUpdates(_0x34a4d8){return function(_0x4c8d9e){try{jsonpatch[_0xe3e3('0x21')](_0x4c8d9e,_0x34a4d8,!![]);}catch(_0x54b09a){return BPromise[_0xe3e3('0x22')](_0x54b09a);}return _0x4c8d9e[_0xe3e3('0x23')]();};}function saveUpdates(_0x1e69e4,_0xf75509){return function(_0xaad006){if(_0xaad006){return _0xaad006[_0xe3e3('0x24')](_0x1e69e4)[_0xe3e3('0x25')](function(_0x297a62){return _0x297a62;});}return null;};}function removeEntity(_0x261947,_0x178a84){return function(_0x2bca29){if(_0x2bca29){return _0x2bca29[_0xe3e3('0x26')]()[_0xe3e3('0x25')](function(){var _0x59d7b8=_0x2bca29['get']({'plain':!![]});var _0x554e85=_0xe3e3('0x27');return db[_0xe3e3('0x28')][_0xe3e3('0x26')]({'where':{'type':_0x554e85,'resourceId':_0x59d7b8['id']}})[_0xe3e3('0x25')](function(){return _0x2bca29;});})[_0xe3e3('0x25')](function(){_0x261947[_0xe3e3('0x1f')](0xcc)[_0xe3e3('0x1a')]();});}};}function handleEntityNotFound(_0x1a0b4f,_0x3dcdc9){return function(_0x184787){if(!_0x184787){_0x1a0b4f[_0xe3e3('0x19')](0x194);}return _0x184787;};}function handleError(_0x44d0d1,_0x4a95f5){_0x4a95f5=_0x4a95f5||0x1f4;return function(_0x53b48b){logger[_0xe3e3('0x29')](_0x53b48b[_0xe3e3('0x2a')]);if(_0x53b48b[_0xe3e3('0x2b')]){delete _0x53b48b['name'];}_0x44d0d1[_0xe3e3('0x1f')](_0x4a95f5)[_0xe3e3('0x2c')](_0x53b48b);};}exports[_0xe3e3('0x2d')]=function(_0x2962a8,_0x4c0c5b){var _0x3d72e3={},_0x5d64c5={},_0x361121={'count':0x0,'rows':[]};var _0x129766=db['Plugin'][_0xe3e3('0x2e')];_0x5d64c5[_0xe3e3('0x2f')]=_[_0xe3e3('0x30')](_0x129766);_0x5d64c5[_0xe3e3('0x31')]=_[_0xe3e3('0x30')](_0x2962a8['query']);_0x5d64c5['filters']=_[_0xe3e3('0x32')](_0x5d64c5['model'],_0x5d64c5[_0xe3e3('0x31')]);_0x3d72e3[_0xe3e3('0x33')]=_[_0xe3e3('0x32')](_0x5d64c5['model'],qs[_0xe3e3('0x34')](_0x2962a8[_0xe3e3('0x31')][_0xe3e3('0x34')]));_0x3d72e3[_0xe3e3('0x33')]=_0x3d72e3[_0xe3e3('0x33')]['length']?_0x3d72e3['attributes']:_0x5d64c5[_0xe3e3('0x2f')];if(!_0x2962a8[_0xe3e3('0x31')][_0xe3e3('0x35')]('nolimit')){_0x3d72e3[_0xe3e3('0x1e')]=qs[_0xe3e3('0x1e')](_0x2962a8['query']['limit']);_0x3d72e3[_0xe3e3('0x1d')]=qs[_0xe3e3('0x1d')](_0x2962a8[_0xe3e3('0x31')][_0xe3e3('0x1d')]);}_0x3d72e3[_0xe3e3('0x36')]=qs[_0xe3e3('0x37')](_0x2962a8['query'][_0xe3e3('0x37')]);_0x3d72e3['where']=qs['filters'](_['pick'](_0x2962a8[_0xe3e3('0x31')],_0x5d64c5[_0xe3e3('0x38')]));if(_0x2962a8[_0xe3e3('0x31')][_0xe3e3('0x39')]){_0x3d72e3['where']=_['merge'](_0x3d72e3[_0xe3e3('0x3a')],{'$or':_['map'](_0x129766,function(_0x74fa62){if(_0x74fa62[_0xe3e3('0x3b')]['key']!=='VIRTUAL'){var _0x58dd5a={};_0x58dd5a[_0x74fa62['field']]={'$like':'%'+_0x2962a8[_0xe3e3('0x31')][_0xe3e3('0x39')]+'%'};return _0x58dd5a;}})});}_0x3d72e3=_[_0xe3e3('0x3c')]({},_0x3d72e3,_0x2962a8[_0xe3e3('0x3d')]);var _0x25f656={'where':_0x3d72e3[_0xe3e3('0x3a')]};return db[_0xe3e3('0x3e')][_0xe3e3('0x1c')](_0x25f656)['then'](function(_0x233cc0){_0x361121[_0xe3e3('0x1c')]=_0x233cc0;if(_0x2962a8['query'][_0xe3e3('0x3f')]){_0x3d72e3[_0xe3e3('0x40')]=[{'all':!![]}];}return db[_0xe3e3('0x3e')]['findAll'](_0x3d72e3);})[_0xe3e3('0x25')](function(_0x15b226){_0x361121[_0xe3e3('0x41')]=_0x15b226;return _0x361121;})[_0xe3e3('0x25')](respondWithFilteredResult(_0x4c0c5b,_0x3d72e3))[_0xe3e3('0x42')](handleError(_0x4c0c5b,null));};exports[_0xe3e3('0x43')]=function(_0x2e917c,_0x40c531){var _0x36cc0d={'raw':!![],'where':{'id':_0x2e917c['params']['id']}},_0x5c5535={};_0x5c5535[_0xe3e3('0x2f')]=_[_0xe3e3('0x30')](db[_0xe3e3('0x3e')][_0xe3e3('0x2e')]);_0x5c5535[_0xe3e3('0x31')]=_[_0xe3e3('0x30')](_0x2e917c['query']);_0x5c5535[_0xe3e3('0x38')]=_['intersection'](_0x5c5535[_0xe3e3('0x2f')],_0x5c5535[_0xe3e3('0x31')]);_0x36cc0d[_0xe3e3('0x33')]=_[_0xe3e3('0x32')](_0x5c5535[_0xe3e3('0x2f')],qs['fields'](_0x2e917c[_0xe3e3('0x31')][_0xe3e3('0x34')]));_0x36cc0d['attributes']=_0x36cc0d['attributes'][_0xe3e3('0x44')]?_0x36cc0d[_0xe3e3('0x33')]:_0x5c5535[_0xe3e3('0x2f')];if(_0x2e917c[_0xe3e3('0x31')]['includeAll']){_0x36cc0d[_0xe3e3('0x40')]=[{'all':!![]}];}_0x36cc0d=_[_0xe3e3('0x3c')]({},_0x36cc0d,_0x2e917c[_0xe3e3('0x3d')]);return db[_0xe3e3('0x3e')][_0xe3e3('0x45')](_0x36cc0d)[_0xe3e3('0x25')](handleEntityNotFound(_0x40c531,null))[_0xe3e3('0x25')](respondWithResult(_0x40c531,null))[_0xe3e3('0x42')](handleError(_0x40c531,null));};exports[_0xe3e3('0x46')]=function(_0x15c0fc,_0x29b9c2,_0x55c4f9){return db[_0xe3e3('0x3e')][_0xe3e3('0x45')]({'where':{'id':_0x15c0fc['params']['id']},'attributes':[_0xe3e3('0x2b'),'path'],'raw':!![]})[_0xe3e3('0x25')](handleEntityNotFound(_0x29b9c2,null))['then'](function(_0x398596){if(_0x398596){var _0x4a26c4=path[_0xe3e3('0x47')](config['root'],_0xe3e3('0x48'),util[_0xe3e3('0x49')](_0xe3e3('0x4a'),path[_0xe3e3('0x4b')](_0x398596['path'])));var _0x409e08=fs[_0xe3e3('0x4c')](_0x4a26c4);var _0x3f0d4e=archiver('zip',{'zlib':{'level':0x9}});_0x3f0d4e['on']('warning',function(_0x463c1a){if(_0x463c1a[_0xe3e3('0x4d')]===_0xe3e3('0x4e')){logger[_0xe3e3('0x29')](_0x463c1a);}else{throw new db[(_0xe3e3('0x4f'))][(_0xe3e3('0x50'))](_0xe3e3('0x51'));}});_0x3f0d4e['on'](_0xe3e3('0x29'),function(_0xd48bb3){throw new db[(_0xe3e3('0x4f'))][(_0xe3e3('0x50'))](_0xe3e3('0x51'));});_0x3f0d4e[_0xe3e3('0x52')](_0x409e08);_0x3f0d4e['glob'](_0xe3e3('0x53'),{'cwd':path[_0xe3e3('0x47')](config[_0xe3e3('0x54')],_0xe3e3('0x48'),path[_0xe3e3('0x55')](_0x398596[_0xe3e3('0x56')])),'ignore':[path[_0xe3e3('0x47')](path['basename'](_0x398596[_0xe3e3('0x56')]),'node_modules/**/*'),path[_0xe3e3('0x47')](path[_0xe3e3('0x4b')](_0x398596[_0xe3e3('0x56')]),_0xe3e3('0x57'))],'nodir':!![]})[_0xe3e3('0x58')]();_0x409e08['on'](_0xe3e3('0x59'),function(){if(!fs[_0xe3e3('0x5a')](_0x4a26c4)){throw new db[(_0xe3e3('0x4f'))][(_0xe3e3('0x50'))]('Plugin\x20not\x20found');}return _0x29b9c2[_0xe3e3('0x46')](_0x4a26c4,util['format']('%s.zip',path[_0xe3e3('0x4b')](_0x398596[_0xe3e3('0x56')])),function(_0xae8bd9){if(_0xae8bd9){throw new db['Sequelize'][(_0xe3e3('0x50'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xe3e3('0x5b')](_0x4a26c4);logger[_0xe3e3('0x5c')]('Download\x20completed');logger[_0xe3e3('0x5c')]('Temporary\x20file\x20removed');});});}return null;})[_0xe3e3('0x42')](handleError(_0x29b9c2,null));};exports[_0xe3e3('0x5d')]=function(_0x21fdd7,_0x74d503,_0x3ebb7f){var _0x30ddad=path[_0xe3e3('0x4b')](_0x21fdd7[_0xe3e3('0x5e')]['filename'],path['extname'](_0x21fdd7[_0xe3e3('0x5e')][_0xe3e3('0x5f')]));var _0x296fc7=path[_0xe3e3('0x47')](config['root'],_0xe3e3('0x48'),_0x21fdd7['file'][_0xe3e3('0x5f')]);var _0x48da14=path[_0xe3e3('0x47')](config[_0xe3e3('0x54')],_0xe3e3('0x48'),_0x30ddad);logger[_0xe3e3('0x5c')](_0xe3e3('0x60'),_0x296fc7);logger['info'](_0xe3e3('0x61'),_0x48da14);try{fs['chmodSync'](_0x296fc7,parseInt(_0xe3e3('0x62'),0x8));extract(_0x296fc7,{'dir':_0x48da14},function(_0x450398){if(_0x450398){logger[_0xe3e3('0x29')](_0x450398);handleError(_0x450398,!![]);};var _0x3de3ea=fs[_0xe3e3('0x63')](_0x48da14);if(_0x3de3ea['length']>0x1){removeReferences(_0x296fc7,_0x48da14);logger[_0xe3e3('0x29')](_0xe3e3('0x64'));return _0x3ebb7f(new Error(_0xe3e3('0x64')));}var _0xf1489c=fs[_0xe3e3('0x65')](path[_0xe3e3('0x47')](_0x48da14,_0x3de3ea[0x0]));if(_0xf1489c['isFile']()){removeReferences(_0x296fc7,_0x48da14);logger[_0xe3e3('0x29')](_0xe3e3('0x64'));return _0x3ebb7f(new Error(_0xe3e3('0x64')));}if(_0xf1489c[_0xe3e3('0x66')]()){var _0x11794f=fs[_0xe3e3('0x63')](path[_0xe3e3('0x47')](_0x48da14,_0x3de3ea[0x0]));if(_0x11794f[_0xe3e3('0x44')]===0x0){removeReferences(_0x296fc7,_0x48da14);logger[_0xe3e3('0x29')]('Invalid\x20plugin\x20structure');return _0x3ebb7f(new Error(_0xe3e3('0x64')));}var _0x44a556=_0x11794f[_0xe3e3('0x67')](function(_0x11ba11){return _0x11ba11===_0xe3e3('0x68');});if(!_0x44a556){return _0x3ebb7f(new Error(_0xe3e3('0x69')));}var _0xbe2458=fs[_0xe3e3('0x6a')](path[_0xe3e3('0x47')](_0x48da14,_0x3de3ea[0x0],_0xe3e3('0x68')));var _0x35de93=JSON[_0xe3e3('0x6b')](_0xbe2458);if('undefined'==typeof _0x35de93[_0xe3e3('0x2b')]){return _0x3ebb7f(new Error(_0xe3e3('0x6c')));}if(_0xe3e3('0x6d')==typeof _0x35de93[_0xe3e3('0x3b')]){return _0x3ebb7f(new Error(_0xe3e3('0x6e')));}if('undefined'==typeof _0x35de93[_0xe3e3('0x6f')]){return _0x3ebb7f(new Error(_0xe3e3('0x70')));}if(_0xe3e3('0x6d')==typeof _0x35de93[_0xe3e3('0x71')]){return _0x3ebb7f(new Error(_0xe3e3('0x72')));}if(_0x35de93[_0xe3e3('0x3b')]===_0xe3e3('0x73')){if(_0xe3e3('0x6d')==typeof _0x35de93['parameters']['views']){return _0x3ebb7f(new Error(_0xe3e3('0x74')));}if('undefined'==typeof _0x35de93[_0xe3e3('0x71')][_0xe3e3('0x75')][_0xe3e3('0x76')]&&_0xe3e3('0x6d')==typeof _0x35de93['parameters']['views'][_0xe3e3('0x77')]){return _0x3ebb7f(new Error(_0xe3e3('0x78')));}}else if(_0x35de93['type']===_0xe3e3('0x79')){if(_0xe3e3('0x6d')==typeof _0x35de93[_0xe3e3('0x71')][_0xe3e3('0x7a')]){return _0x3ebb7f(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x35de93['parameters'][_0xe3e3('0x7b')]){return _0x3ebb7f(new Error(_0xe3e3('0x7c')));}}else{return _0x3ebb7f(new Error(_0xe3e3('0x7d')));}var _0x1544b3=_0x35de93[_0xe3e3('0x2b')];var _0x295181=_0x35de93[_0xe3e3('0x7e')];var _0x476e48=_0x35de93[_0xe3e3('0x3b')];var _0x543b93=_0x35de93[_0xe3e3('0x7f')]?_0x35de93[_0xe3e3('0x7f')]:_0xe3e3('0x80');var _0x2c61fc=_0x35de93['icon']?_0x35de93[_0xe3e3('0x81')]:_0xe3e3('0x82');var _0x4ff8f8='';var _0xfbd24f='';var _0x52cd02='';var _0x4e6f4d='';var _0x5b2a38=_0x35de93[_0xe3e3('0x6f')];if(_0x476e48==='html'){if(_0xe3e3('0x6d')!=typeof _0x35de93[_0xe3e3('0x71')][_0xe3e3('0x75')][_0xe3e3('0x76')]){var _0x5dec8b=_0x35de93[_0xe3e3('0x71')][_0xe3e3('0x75')][_0xe3e3('0x76')];if(!/^(f|ht)tps?:\/\//i[_0xe3e3('0x83')](_0x5dec8b)){_0x4ff8f8=path['join'](_0xe3e3('0x84'),_0x30ddad,_0x3de3ea[0x0],_0x5dec8b);}else{_0x4ff8f8=_0x5dec8b;}}else{logger[_0xe3e3('0x5c')](_0xe3e3('0x85'));}if(_0xe3e3('0x6d')!=typeof _0x35de93[_0xe3e3('0x71')]['views']['agent']){var _0x490477=_0x35de93[_0xe3e3('0x71')][_0xe3e3('0x75')][_0xe3e3('0x77')];if(!/^(f|ht)tps?:\/\//i[_0xe3e3('0x83')](_0x490477)){_0xfbd24f=path[_0xe3e3('0x47')](_0xe3e3('0x84'),_0x30ddad,_0x3de3ea[0x0],_0x490477);}else{_0xfbd24f=_0x490477;}}else{logger[_0xe3e3('0x5c')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x476e48==='script'){_0x52cd02=_0x35de93['parameters'][_0xe3e3('0x7a')];_0x4e6f4d=_0x35de93[_0xe3e3('0x71')]['scriptPath'];if(_0xe3e3('0x6d')!=typeof _0x35de93[_0xe3e3('0x71')][_0xe3e3('0x75')]){if(_0xe3e3('0x6d')!=typeof _0x35de93[_0xe3e3('0x71')][_0xe3e3('0x75')][_0xe3e3('0x76')]){var _0x5dec8b=_0x35de93['parameters'][_0xe3e3('0x75')][_0xe3e3('0x76')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5dec8b)){_0x4ff8f8=path['join'](_0xe3e3('0x84'),_0x30ddad,_0x3de3ea[0x0],_0x5dec8b);}else{_0x4ff8f8=_0x5dec8b;}}if(_0xe3e3('0x6d')!=typeof _0x35de93[_0xe3e3('0x71')][_0xe3e3('0x75')][_0xe3e3('0x77')]){var _0x490477=_0x35de93[_0xe3e3('0x71')][_0xe3e3('0x75')][_0xe3e3('0x77')];if(!/^(f|ht)tps?:\/\//i['test'](_0x490477)){_0xfbd24f=path['join'](_0xe3e3('0x84'),_0x30ddad,_0x3de3ea[0x0],_0x490477);}else{_0xfbd24f=_0x490477;}}}}var _0x18b13d={'name':_0x1544b3,'description':_0x295181,'path':path[_0xe3e3('0x47')](_0x30ddad,_0x3de3ea[0x0]),'type':_0x476e48,'sidebar':_0x543b93,'icon':_0x2c61fc,'adminUrl':_0x4ff8f8,'agentUrl':_0xfbd24f,'scriptName':_0x52cd02,'scriptPath':_0x4e6f4d,'version':_0x5b2a38};removeReferences(_0x296fc7,null);return db[_0xe3e3('0x3e')]['create'](_0x18b13d)[_0xe3e3('0x25')](function(_0x421e75){var _0x3fb8fa={'role':_0x21fdd7[_0xe3e3('0x86')][_0xe3e3('0x87')],'userProfileId':_0x21fdd7[_0xe3e3('0x86')][_0xe3e3('0x88')]};if(!_0x3fb8fa)throw new Error(_0xe3e3('0x89'));if(_0x3fb8fa[_0xe3e3('0x87')]==='user'){var _0x4bef26=_0x421e75['get']({'plain':!![]});return db['UserProfileSection'][_0xe3e3('0x45')]({'where':{'name':'Plugins','userProfileId':_0x3fb8fa['userProfileId']},'raw':!![]})['then'](function(_0x140477){if(_0x140477&&_0x140477[_0xe3e3('0x8a')]===0x0){return db[_0xe3e3('0x28')][_0xe3e3('0x8b')]({'name':_0x4bef26[_0xe3e3('0x2b')],'resourceId':_0x4bef26['id'],'type':_0x140477[_0xe3e3('0x2b')],'sectionId':_0x140477['id']},{})[_0xe3e3('0x25')](function(){return _0x421e75;});}else{return _0x421e75;}})[_0xe3e3('0x42')](function(_0x2709ac){logger['error'](_0xe3e3('0x8c'),_0x2709ac);throw _0x2709ac;});}return _0x421e75;})[_0xe3e3('0x25')](respondWithResult(_0x74d503,null))[_0xe3e3('0x42')](handleError(_0x74d503,null));}});}catch(_0x5d67dd){_0x74d503[_0xe3e3('0x1f')](0x1f4)[_0xe3e3('0x2c')](_0x5d67dd);}};function removeReferences(_0x339c55,_0x54fe37){try{if(_0x339c55){fs[_0xe3e3('0x5b')](_0x339c55);logger[_0xe3e3('0x5c')]('Zip\x20archive\x20removed');}if(_0x54fe37){rimraf(_0x54fe37,function(){});logger[_0xe3e3('0x5c')](_0xe3e3('0x8d'));}}catch(_0x265777){logger['error'](_0x265777);}}exports['update']=function(_0x30a21c,_0x229c45,_0xa5104a){return db[_0xe3e3('0x3e')][_0xe3e3('0x45')]({'where':{'id':_0x30a21c['params']['id']}})[_0xe3e3('0x25')](handleEntityNotFound(_0x229c45,null))[_0xe3e3('0x25')](saveUpdates(_0x30a21c[_0xe3e3('0x86')],null))[_0xe3e3('0x25')](respondWithResult(_0x229c45,null))[_0xe3e3('0x42')](handleError(_0x229c45,null));};exports[_0xe3e3('0x8e')]=function(_0xee8392,_0x30e710,_0x3e5c2c){return db[_0xe3e3('0x3e')][_0xe3e3('0x45')]({'where':{'id':_0xee8392['params']['id']}})['then'](function(_0x4aa87d){if(_0x4aa87d){return _0x4aa87d[_0xe3e3('0x26')]();}})[_0xe3e3('0x25')](function(_0x15a470){rimraf(path[_0xe3e3('0x47')](config[_0xe3e3('0x54')],_0xe3e3('0x48'),path[_0xe3e3('0x55')](_0x15a470[_0xe3e3('0x56')])),function(){});return _0x15a470;})[_0xe3e3('0x25')](handleEntityNotFound(_0x30e710,null))[_0xe3e3('0x25')](respondWithStatusCode(_0x30e710,null))[_0xe3e3('0x42')](handleError(_0x30e710,null));};exports[_0xe3e3('0x8f')]=function(_0x2a942a,_0x17d456,_0x385163){return BPromise[_0xe3e3('0x90')]()[_0xe3e3('0x25')](function(){if(!_0x2a942a[_0xe3e3('0x31')][_0xe3e3('0x56')]){throw new Error(_0xe3e3('0x91'));}if(!_0x2a942a[_0xe3e3('0x31')]['port']){throw new Error(_0xe3e3('0x92'));}var _0x597fe0=_0x2a942a[_0xe3e3('0x31')][_0xe3e3('0x93')]?_0x2a942a['query'][_0xe3e3('0x93')]+':'+_0x2a942a[_0xe3e3('0x31')]['port']:_0xe3e3('0x94')+_0x2a942a['query'][_0xe3e3('0x95')];var _0x5b6868=_0x2a942a[_0xe3e3('0x31')]['json']?_0x2a942a['query'][_0xe3e3('0x1b')]:!![];var _0xfee33c=_0x2a942a['query']['encoding']?_0x2a942a['query'][_0xe3e3('0x96')]:null;var _0x5444f6={'method':_0x2a942a[_0xe3e3('0x97')],'uri':util[_0xe3e3('0x49')](_0xe3e3('0x98'),_0x597fe0,_0x2a942a[_0xe3e3('0x31')][_0xe3e3('0x56')]),'json':_0x5b6868,'resolveWithFullResponse':!![],'encoding':_0xfee33c,'qs':_0x2a942a[_0xe3e3('0x31')]};if(_0x2a942a[_0xe3e3('0x99')]){_0x5444f6['headers']=_0x2a942a['headers'];if(_0x5444f6[_0xe3e3('0x99')][_0xe3e3('0x9a')]){delete _0x5444f6[_0xe3e3('0x99')]['content-length'];}}if(_0x5444f6[_0xe3e3('0x99')][_0xe3e3('0x9b')]){delete _0x5444f6[_0xe3e3('0x99')]['content-type'];}return rp(_0x5444f6);})[_0xe3e3('0x25')](function(_0x45ff9a){if(_0x45ff9a){_0x17d456[_0xe3e3('0x20')](_0x45ff9a[_0xe3e3('0x99')]);logger[_0xe3e3('0x5c')](_0x45ff9a['body']);if(_['endsWith'](_0x2a942a['query']['path'],_0xe3e3('0x46'))&&_0x45ff9a[_0xe3e3('0x9c')]==0x1f4){return _0x17d456[_0xe3e3('0x19')](_0x45ff9a[_0xe3e3('0x9c')]);}else{return _0x17d456['status'](_0x45ff9a['statusCode'])['send'](_0x45ff9a[_0xe3e3('0x86')]);}}else{return _0x17d456[_0xe3e3('0x19')](0xc8);}})[_0xe3e3('0x42')](handleError(_0x17d456,null));};exports[_0xe3e3('0x9d')]=function(_0x25b5f2,_0x5a55c0,_0x36bed9){return BPromise['resolve']()[_0xe3e3('0x25')](function(){if(!_0x25b5f2[_0xe3e3('0x31')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x25b5f2[_0xe3e3('0x31')]['port']){throw new Error(_0xe3e3('0x92'));}var _0x17fc7a=_0x25b5f2['query'][_0xe3e3('0x93')]?_0x25b5f2[_0xe3e3('0x31')]['hostname']+':'+_0x25b5f2[_0xe3e3('0x31')]['port']:_0xe3e3('0x94')+_0x25b5f2[_0xe3e3('0x31')]['port'];var _0x3a89b0=_0x25b5f2[_0xe3e3('0x31')][_0xe3e3('0x1b')]?_0x25b5f2[_0xe3e3('0x31')][_0xe3e3('0x1b')]:!![];var _0x29f30f=_0x25b5f2[_0xe3e3('0x31')][_0xe3e3('0x96')]?_0x25b5f2[_0xe3e3('0x31')][_0xe3e3('0x96')]:null;var _0x1c4e8a={'method':_0x25b5f2['method'],'uri':util[_0xe3e3('0x49')](_0xe3e3('0x98'),_0x17fc7a,_0x25b5f2[_0xe3e3('0x31')][_0xe3e3('0x56')]),'json':_0x3a89b0,'resolveWithFullResponse':!![],'encoding':_0x29f30f,'body':_0x25b5f2[_0xe3e3('0x86')]};if(_0x25b5f2[_0xe3e3('0x99')]){_0x1c4e8a[_0xe3e3('0x99')]=_0x25b5f2[_0xe3e3('0x99')];if(_0x1c4e8a[_0xe3e3('0x99')][_0xe3e3('0x9a')]){delete _0x1c4e8a[_0xe3e3('0x99')][_0xe3e3('0x9a')];}}if(_0x1c4e8a[_0xe3e3('0x99')][_0xe3e3('0x9b')]){delete _0x1c4e8a[_0xe3e3('0x99')][_0xe3e3('0x9b')];}return rp(_0x1c4e8a);})[_0xe3e3('0x25')](function(_0x505338){if(_0x505338){_0x5a55c0[_0xe3e3('0x20')](_0x505338[_0xe3e3('0x99')]);logger[_0xe3e3('0x5c')](_0x505338[_0xe3e3('0x86')]);return _0x5a55c0[_0xe3e3('0x1f')](_0x505338[_0xe3e3('0x9c')])[_0xe3e3('0x2c')](_0x505338[_0xe3e3('0x86')]);}else{return _0x5a55c0['sendStatus'](0xc8);}})[_0xe3e3('0x42')](handleError(_0x5a55c0,null));}; \ No newline at end of file +var _0x0ffd=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','dirname','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','method','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','then','destroy','get','UserProfileResource','end','stack','name','index','Plugin','rawAttributes','model','keys','intersection','fields','attributes','length','query','hasOwnProperty','sort','where','filters','pick','filter','merge','map','type','key','field','options','findAll','rows','catch','params','includeAll','find','download','join','root','server/files/plugins','format','%s.zip','basename','zip','warning','code','ENOENT','error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','glob','node_modules/**/*','finalize','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','lstatSync','isFile','Invalid\x20plugin\x20structure','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','Invalid\x20manifest:\x20views\x20missing','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','icon','icon-apps','admin','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Plugins','autoAssociation'];(function(_0x12a122,_0x25ef64){var _0x50860b=function(_0x3f04c1){while(--_0x3f04c1){_0x12a122['push'](_0x12a122['shift']());}};_0x50860b(++_0x25ef64);}(_0x0ffd,0x167));var _0xd0ff=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x0ffd[_0x13ea00];return _0x1f7347;};'use strict';var pdf=require(_0xd0ff('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd0ff('0x1'));var zipdir=require(_0xd0ff('0x2'));var jsonpatch=require(_0xd0ff('0x3'));var rp=require(_0xd0ff('0x4'));var moment=require(_0xd0ff('0x5'));var BPromise=require(_0xd0ff('0x6'));var Mustache=require('mustache');var util=require(_0xd0ff('0x7'));var path=require(_0xd0ff('0x8'));var sox=require(_0xd0ff('0x9'));var csv=require(_0xd0ff('0xa'));var ejs=require(_0xd0ff('0xb'));var fs=require('fs');var _=require(_0xd0ff('0xc'));var squel=require(_0xd0ff('0xd'));var crypto=require(_0xd0ff('0xe'));var jsforce=require(_0xd0ff('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd0ff('0xa'));var querystring=require(_0xd0ff('0x10'));var Papa=require(_0xd0ff('0x11'));var extract=require('extract-zip');var rimraf=require(_0xd0ff('0x1'));var archiver=require(_0xd0ff('0x12'));var Redis=require(_0xd0ff('0x13'));var authService=require(_0xd0ff('0x14'));var qs=require(_0xd0ff('0x15'));var hardwareService=require(_0xd0ff('0x16'));var logger=require(_0xd0ff('0x17'))(_0xd0ff('0x18'));var utils=require('../../config/utils');var config=require(_0xd0ff('0x19'));var db=require(_0xd0ff('0x1a'))['db'];config[_0xd0ff('0x1b')]=_['defaults'](config['redis'],{'host':_0xd0ff('0x1c'),'port':0x18eb});var socket=require(_0xd0ff('0x1d'))(new Redis(config[_0xd0ff('0x1b')]));require('./plugin.socket')[_0xd0ff('0x1e')](socket);function respondWithStatusCode(_0x495bf0,_0x3a4478){_0x3a4478=_0x3a4478||0xcc;return function(_0xa3e80a){if(_0xa3e80a){return _0x495bf0[_0xd0ff('0x1f')](_0x3a4478);}return _0x495bf0[_0xd0ff('0x20')](_0x3a4478)['end']();};}function respondWithResult(_0x4b4c4c,_0xc71e87){_0xc71e87=_0xc71e87||0xc8;return function(_0x5efcdf){if(_0x5efcdf){return _0x4b4c4c[_0xd0ff('0x20')](_0xc71e87)['json'](_0x5efcdf);}};}function respondWithFilteredResult(_0x332af6,_0x1f90a1){return function(_0x274f5f){if(_0x274f5f){var _0x12eb26=_0x274f5f[_0xd0ff('0x21')],_0x58d275=_0x1f90a1[_0xd0ff('0x22')],_0x567f40=_0x1f90a1[_0xd0ff('0x22')]+_0x1f90a1[_0xd0ff('0x23')],_0x2df346;if(_0x567f40>=_0x12eb26){_0x567f40=_0x12eb26;_0x2df346=0xc8;}else{_0x2df346=0xce;}_0x332af6[_0xd0ff('0x20')](_0x2df346);return _0x332af6[_0xd0ff('0x24')](_0xd0ff('0x25'),_0x58d275+'-'+_0x567f40+'/'+_0x12eb26)[_0xd0ff('0x26')](_0x274f5f);}return null;};}function patchUpdates(_0x5eb32b){return function(_0x556473){try{jsonpatch['apply'](_0x556473,_0x5eb32b,!![]);}catch(_0x2ee50b){return BPromise[_0xd0ff('0x27')](_0x2ee50b);}return _0x556473[_0xd0ff('0x28')]();};}function saveUpdates(_0xdf430c,_0x432c30){return function(_0x164d47){if(_0x164d47){return _0x164d47['update'](_0xdf430c)[_0xd0ff('0x29')](function(_0x155ea8){return _0x155ea8;});}return null;};}function removeEntity(_0x31558a,_0x274cd1){return function(_0x211457){if(_0x211457){return _0x211457[_0xd0ff('0x2a')]()['then'](function(){var _0x135cea=_0x211457[_0xd0ff('0x2b')]({'plain':!![]});var _0x5b1b6c='Plugins';return db[_0xd0ff('0x2c')][_0xd0ff('0x2a')]({'where':{'type':_0x5b1b6c,'resourceId':_0x135cea['id']}})[_0xd0ff('0x29')](function(){return _0x211457;});})[_0xd0ff('0x29')](function(){_0x31558a['status'](0xcc)[_0xd0ff('0x2d')]();});}};}function handleEntityNotFound(_0x54c661,_0x216a4d){return function(_0x4507df){if(!_0x4507df){_0x54c661[_0xd0ff('0x1f')](0x194);}return _0x4507df;};}function handleError(_0x570c08,_0x11a6c1){_0x11a6c1=_0x11a6c1||0x1f4;return function(_0x58a1e5){logger['error'](_0x58a1e5[_0xd0ff('0x2e')]);if(_0x58a1e5[_0xd0ff('0x2f')]){delete _0x58a1e5[_0xd0ff('0x2f')];}_0x570c08['status'](_0x11a6c1)['send'](_0x58a1e5);};}exports[_0xd0ff('0x30')]=function(_0x2a5160,_0x36847c){var _0x176e59={},_0x22200a={},_0x1e251d={'count':0x0,'rows':[]};var _0x5d989f=db[_0xd0ff('0x31')][_0xd0ff('0x32')];_0x22200a[_0xd0ff('0x33')]=_[_0xd0ff('0x34')](_0x5d989f);_0x22200a['query']=_[_0xd0ff('0x34')](_0x2a5160['query']);_0x22200a['filters']=_[_0xd0ff('0x35')](_0x22200a['model'],_0x22200a['query']);_0x176e59['attributes']=_[_0xd0ff('0x35')](_0x22200a[_0xd0ff('0x33')],qs[_0xd0ff('0x36')](_0x2a5160['query'][_0xd0ff('0x36')]));_0x176e59['attributes']=_0x176e59[_0xd0ff('0x37')][_0xd0ff('0x38')]?_0x176e59[_0xd0ff('0x37')]:_0x22200a['model'];if(!_0x2a5160[_0xd0ff('0x39')][_0xd0ff('0x3a')]('nolimit')){_0x176e59[_0xd0ff('0x23')]=qs[_0xd0ff('0x23')](_0x2a5160[_0xd0ff('0x39')][_0xd0ff('0x23')]);_0x176e59[_0xd0ff('0x22')]=qs[_0xd0ff('0x22')](_0x2a5160[_0xd0ff('0x39')]['offset']);}_0x176e59['order']=qs[_0xd0ff('0x3b')](_0x2a5160[_0xd0ff('0x39')][_0xd0ff('0x3b')]);_0x176e59[_0xd0ff('0x3c')]=qs[_0xd0ff('0x3d')](_[_0xd0ff('0x3e')](_0x2a5160[_0xd0ff('0x39')],_0x22200a['filters']));if(_0x2a5160[_0xd0ff('0x39')][_0xd0ff('0x3f')]){_0x176e59[_0xd0ff('0x3c')]=_[_0xd0ff('0x40')](_0x176e59[_0xd0ff('0x3c')],{'$or':_[_0xd0ff('0x41')](_0x5d989f,function(_0x5ec9af){if(_0x5ec9af[_0xd0ff('0x42')][_0xd0ff('0x43')]!=='VIRTUAL'){var _0x29d72e={};_0x29d72e[_0x5ec9af[_0xd0ff('0x44')]]={'$like':'%'+_0x2a5160['query'][_0xd0ff('0x3f')]+'%'};return _0x29d72e;}})});}_0x176e59=_[_0xd0ff('0x40')]({},_0x176e59,_0x2a5160[_0xd0ff('0x45')]);var _0x3b4070={'where':_0x176e59[_0xd0ff('0x3c')]};return db[_0xd0ff('0x31')][_0xd0ff('0x21')](_0x3b4070)['then'](function(_0x321380){_0x1e251d[_0xd0ff('0x21')]=_0x321380;if(_0x2a5160[_0xd0ff('0x39')]['includeAll']){_0x176e59['include']=[{'all':!![]}];}return db[_0xd0ff('0x31')][_0xd0ff('0x46')](_0x176e59);})[_0xd0ff('0x29')](function(_0x32604f){_0x1e251d[_0xd0ff('0x47')]=_0x32604f;return _0x1e251d;})[_0xd0ff('0x29')](respondWithFilteredResult(_0x36847c,_0x176e59))[_0xd0ff('0x48')](handleError(_0x36847c,null));};exports['show']=function(_0x83ee6e,_0x2637f9){var _0x5410bd={'raw':!![],'where':{'id':_0x83ee6e[_0xd0ff('0x49')]['id']}},_0x407eef={};_0x407eef[_0xd0ff('0x33')]=_['keys'](db['Plugin'][_0xd0ff('0x32')]);_0x407eef[_0xd0ff('0x39')]=_[_0xd0ff('0x34')](_0x83ee6e[_0xd0ff('0x39')]);_0x407eef[_0xd0ff('0x3d')]=_[_0xd0ff('0x35')](_0x407eef[_0xd0ff('0x33')],_0x407eef[_0xd0ff('0x39')]);_0x5410bd[_0xd0ff('0x37')]=_[_0xd0ff('0x35')](_0x407eef['model'],qs[_0xd0ff('0x36')](_0x83ee6e[_0xd0ff('0x39')][_0xd0ff('0x36')]));_0x5410bd['attributes']=_0x5410bd[_0xd0ff('0x37')][_0xd0ff('0x38')]?_0x5410bd[_0xd0ff('0x37')]:_0x407eef[_0xd0ff('0x33')];if(_0x83ee6e['query'][_0xd0ff('0x4a')]){_0x5410bd['include']=[{'all':!![]}];}_0x5410bd=_[_0xd0ff('0x40')]({},_0x5410bd,_0x83ee6e['options']);return db[_0xd0ff('0x31')][_0xd0ff('0x4b')](_0x5410bd)[_0xd0ff('0x29')](handleEntityNotFound(_0x2637f9,null))[_0xd0ff('0x29')](respondWithResult(_0x2637f9,null))[_0xd0ff('0x48')](handleError(_0x2637f9,null));};exports[_0xd0ff('0x4c')]=function(_0x1e9a0b,_0x12c71c,_0x2a3879){return db[_0xd0ff('0x31')]['find']({'where':{'id':_0x1e9a0b[_0xd0ff('0x49')]['id']},'attributes':[_0xd0ff('0x2f'),_0xd0ff('0x8')],'raw':!![]})[_0xd0ff('0x29')](handleEntityNotFound(_0x12c71c,null))[_0xd0ff('0x29')](function(_0x217cd2){if(_0x217cd2){var _0xa7d863=path[_0xd0ff('0x4d')](config[_0xd0ff('0x4e')],_0xd0ff('0x4f'),util[_0xd0ff('0x50')](_0xd0ff('0x51'),path[_0xd0ff('0x52')](_0x217cd2['path'])));var _0x26a3a0=fs['createWriteStream'](_0xa7d863);var _0x349cdc=archiver(_0xd0ff('0x53'),{'zlib':{'level':0x9}});_0x349cdc['on'](_0xd0ff('0x54'),function(_0x13fc8f){if(_0x13fc8f[_0xd0ff('0x55')]===_0xd0ff('0x56')){logger[_0xd0ff('0x57')](_0x13fc8f);}else{throw new db[(_0xd0ff('0x58'))]['Error'](_0xd0ff('0x59'));}});_0x349cdc['on']('error',function(_0x530aad){throw new db['Sequelize'][(_0xd0ff('0x5a'))](_0xd0ff('0x59'));});_0x349cdc['pipe'](_0x26a3a0);_0x349cdc[_0xd0ff('0x5b')]('**/*',{'cwd':path['join'](config[_0xd0ff('0x4e')],_0xd0ff('0x4f'),path['dirname'](_0x217cd2['path'])),'ignore':[path[_0xd0ff('0x4d')](path['basename'](_0x217cd2[_0xd0ff('0x8')]),_0xd0ff('0x5c')),path['join'](path[_0xd0ff('0x52')](_0x217cd2[_0xd0ff('0x8')]),'attachments/**/*')],'nodir':!![]})[_0xd0ff('0x5d')]();_0x26a3a0['on']('close',function(){if(!fs['existsSync'](_0xa7d863)){throw new db[(_0xd0ff('0x58'))]['Error'](_0xd0ff('0x5e'));}return _0x12c71c[_0xd0ff('0x4c')](_0xa7d863,util[_0xd0ff('0x50')](_0xd0ff('0x51'),path[_0xd0ff('0x52')](_0x217cd2[_0xd0ff('0x8')])),function(_0x5e90fb){if(_0x5e90fb){throw new db['Sequelize'][(_0xd0ff('0x5a'))](_0xd0ff('0x5f'));}fs[_0xd0ff('0x60')](_0xa7d863);logger[_0xd0ff('0x61')](_0xd0ff('0x62'));logger[_0xd0ff('0x61')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x12c71c,null));};exports[_0xd0ff('0x63')]=function(_0x4e3d4a,_0x4ba773,_0x26270a){var _0x25741f=path['basename'](_0x4e3d4a[_0xd0ff('0x64')]['filename'],path['extname'](_0x4e3d4a[_0xd0ff('0x64')]['filename']));var _0x44bbeb=path[_0xd0ff('0x4d')](config[_0xd0ff('0x4e')],_0xd0ff('0x4f'),_0x4e3d4a[_0xd0ff('0x64')][_0xd0ff('0x65')]);var _0x1916eb=path['join'](config[_0xd0ff('0x4e')],_0xd0ff('0x4f'),_0x25741f);logger['info'](_0xd0ff('0x66'),_0x44bbeb);logger[_0xd0ff('0x61')](_0xd0ff('0x67'),_0x1916eb);try{fs[_0xd0ff('0x68')](_0x44bbeb,parseInt(_0xd0ff('0x69'),0x8));extract(_0x44bbeb,{'dir':_0x1916eb},function(_0x4987f9){if(_0x4987f9){logger[_0xd0ff('0x57')](_0x4987f9);handleError(_0x4987f9,!![]);};var _0x582b40=fs['readdirSync'](_0x1916eb);if(_0x582b40[_0xd0ff('0x38')]>0x1){removeReferences(_0x44bbeb,_0x1916eb);logger[_0xd0ff('0x57')]('Invalid\x20plugin\x20structure');return _0x26270a(new Error('Invalid\x20plugin\x20structure'));}var _0x3f0104=fs[_0xd0ff('0x6a')](path[_0xd0ff('0x4d')](_0x1916eb,_0x582b40[0x0]));if(_0x3f0104[_0xd0ff('0x6b')]()){removeReferences(_0x44bbeb,_0x1916eb);logger[_0xd0ff('0x57')]('Invalid\x20plugin\x20structure');return _0x26270a(new Error(_0xd0ff('0x6c')));}if(_0x3f0104[_0xd0ff('0x6d')]()){var _0x55ead1=fs[_0xd0ff('0x6e')](path[_0xd0ff('0x4d')](_0x1916eb,_0x582b40[0x0]));if(_0x55ead1[_0xd0ff('0x38')]===0x0){removeReferences(_0x44bbeb,_0x1916eb);logger[_0xd0ff('0x57')]('Invalid\x20plugin\x20structure');return _0x26270a(new Error('Invalid\x20plugin\x20structure'));}var _0x498c54=_0x55ead1[_0xd0ff('0x6f')](function(_0x5a4575){return _0x5a4575===_0xd0ff('0x70');});if(!_0x498c54){return _0x26270a(new Error(_0xd0ff('0x71')));}var _0x5c282d=fs['readFileSync'](path[_0xd0ff('0x4d')](_0x1916eb,_0x582b40[0x0],_0xd0ff('0x70')));var _0x38b98a=JSON[_0xd0ff('0x72')](_0x5c282d);if(_0xd0ff('0x73')==typeof _0x38b98a['name']){return _0x26270a(new Error(_0xd0ff('0x74')));}if(_0xd0ff('0x73')==typeof _0x38b98a[_0xd0ff('0x42')]){return _0x26270a(new Error(_0xd0ff('0x75')));}if(_0xd0ff('0x73')==typeof _0x38b98a[_0xd0ff('0x76')]){return _0x26270a(new Error(_0xd0ff('0x77')));}if(_0xd0ff('0x73')==typeof _0x38b98a[_0xd0ff('0x78')]){return _0x26270a(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x38b98a[_0xd0ff('0x42')]===_0xd0ff('0x79')){if('undefined'==typeof _0x38b98a['parameters']['views']){return _0x26270a(new Error(_0xd0ff('0x7a')));}if(_0xd0ff('0x73')==typeof _0x38b98a[_0xd0ff('0x78')]['views']['admin']&&'undefined'==typeof _0x38b98a[_0xd0ff('0x78')][_0xd0ff('0x7b')][_0xd0ff('0x7c')]){return _0x26270a(new Error(_0xd0ff('0x7d')));}}else if(_0x38b98a['type']===_0xd0ff('0x7e')){if(_0xd0ff('0x73')==typeof _0x38b98a[_0xd0ff('0x78')][_0xd0ff('0x7f')]){return _0x26270a(new Error(_0xd0ff('0x80')));}if(_0xd0ff('0x73')==typeof _0x38b98a[_0xd0ff('0x78')][_0xd0ff('0x81')]){return _0x26270a(new Error(_0xd0ff('0x82')));}}else{return _0x26270a(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x12ef43=_0x38b98a[_0xd0ff('0x2f')];var _0x317d8b=_0x38b98a[_0xd0ff('0x83')];var _0x22bf0a=_0x38b98a[_0xd0ff('0x42')];var _0x210688=_0x38b98a[_0xd0ff('0x84')]?_0x38b98a[_0xd0ff('0x84')]:'always';var _0x114835=_0x38b98a[_0xd0ff('0x85')]?_0x38b98a['icon']:_0xd0ff('0x86');var _0x12a2e6='';var _0xfb2e22='';var _0x2d399a='';var _0x10c7d8='';var _0x57197b=_0x38b98a['version'];if(_0x22bf0a==='html'){if(_0xd0ff('0x73')!=typeof _0x38b98a[_0xd0ff('0x78')][_0xd0ff('0x7b')][_0xd0ff('0x87')]){var _0x4515d3=_0x38b98a[_0xd0ff('0x78')][_0xd0ff('0x7b')][_0xd0ff('0x87')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4515d3)){_0x12a2e6=path['join'](_0xd0ff('0x88'),_0x25741f,_0x582b40[0x0],_0x4515d3);}else{_0x12a2e6=_0x4515d3;}}else{logger[_0xd0ff('0x61')](_0xd0ff('0x89'));}if('undefined'!=typeof _0x38b98a[_0xd0ff('0x78')][_0xd0ff('0x7b')][_0xd0ff('0x7c')]){var _0x2ea681=_0x38b98a[_0xd0ff('0x78')][_0xd0ff('0x7b')][_0xd0ff('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0xd0ff('0x8a')](_0x2ea681)){_0xfb2e22=path['join']('plugins',_0x25741f,_0x582b40[0x0],_0x2ea681);}else{_0xfb2e22=_0x2ea681;}}else{logger[_0xd0ff('0x61')](_0xd0ff('0x8b'));}}else if(_0x22bf0a==='script'){_0x2d399a=_0x38b98a[_0xd0ff('0x78')]['scriptName'];_0x10c7d8=_0x38b98a['parameters'][_0xd0ff('0x81')];if(_0xd0ff('0x73')!=typeof _0x38b98a['parameters'][_0xd0ff('0x7b')]){if(_0xd0ff('0x73')!=typeof _0x38b98a['parameters'][_0xd0ff('0x7b')][_0xd0ff('0x87')]){var _0x4515d3=_0x38b98a[_0xd0ff('0x78')][_0xd0ff('0x7b')][_0xd0ff('0x87')];if(!/^(f|ht)tps?:\/\//i[_0xd0ff('0x8a')](_0x4515d3)){_0x12a2e6=path[_0xd0ff('0x4d')](_0xd0ff('0x88'),_0x25741f,_0x582b40[0x0],_0x4515d3);}else{_0x12a2e6=_0x4515d3;}}if(_0xd0ff('0x73')!=typeof _0x38b98a[_0xd0ff('0x78')][_0xd0ff('0x7b')][_0xd0ff('0x7c')]){var _0x2ea681=_0x38b98a['parameters'][_0xd0ff('0x7b')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x2ea681)){_0xfb2e22=path[_0xd0ff('0x4d')](_0xd0ff('0x88'),_0x25741f,_0x582b40[0x0],_0x2ea681);}else{_0xfb2e22=_0x2ea681;}}}}var _0x1c330e={'name':_0x12ef43,'description':_0x317d8b,'path':path[_0xd0ff('0x4d')](_0x25741f,_0x582b40[0x0]),'type':_0x22bf0a,'sidebar':_0x210688,'icon':_0x114835,'adminUrl':_0x12a2e6,'agentUrl':_0xfb2e22,'scriptName':_0x2d399a,'scriptPath':_0x10c7d8,'version':_0x57197b};removeReferences(_0x44bbeb,null);return db[_0xd0ff('0x31')][_0xd0ff('0x8c')](_0x1c330e)[_0xd0ff('0x29')](function(_0x4279aa){var _0x4a72={'role':_0x4e3d4a[_0xd0ff('0x8d')][_0xd0ff('0x8e')],'userProfileId':_0x4e3d4a[_0xd0ff('0x8d')][_0xd0ff('0x8f')]};if(!_0x4a72)throw new Error(_0xd0ff('0x90'));if(_0x4a72[_0xd0ff('0x8e')]===_0xd0ff('0x91')){var _0x1437f3=_0x4279aa[_0xd0ff('0x2b')]({'plain':!![]});return db['UserProfileSection'][_0xd0ff('0x4b')]({'where':{'name':_0xd0ff('0x92'),'userProfileId':_0x4a72[_0xd0ff('0x8f')]},'raw':!![]})[_0xd0ff('0x29')](function(_0x4a16bd){if(_0x4a16bd&&_0x4a16bd[_0xd0ff('0x93')]===0x0){return db[_0xd0ff('0x2c')]['create']({'name':_0x1437f3['name'],'resourceId':_0x1437f3['id'],'type':_0x4a16bd[_0xd0ff('0x2f')],'sectionId':_0x4a16bd['id']},{})[_0xd0ff('0x29')](function(){return _0x4279aa;});}else{return _0x4279aa;}})[_0xd0ff('0x48')](function(_0x59e06f){logger[_0xd0ff('0x57')](_0xd0ff('0x94'),_0x59e06f);throw _0x59e06f;});}return _0x4279aa;})[_0xd0ff('0x29')](respondWithResult(_0x4ba773,null))['catch'](handleError(_0x4ba773,null));}});}catch(_0x13099a){_0x4ba773[_0xd0ff('0x20')](0x1f4)[_0xd0ff('0x95')](_0x13099a);}};function removeReferences(_0x1cf059,_0x582fb2){try{if(_0x1cf059){fs[_0xd0ff('0x60')](_0x1cf059);logger['info'](_0xd0ff('0x96'));}if(_0x582fb2){rimraf(_0x582fb2,function(){});logger[_0xd0ff('0x61')](_0xd0ff('0x97'));}}catch(_0x3a2082){logger[_0xd0ff('0x57')](_0x3a2082);}}exports[_0xd0ff('0x98')]=function(_0x536436,_0x1dea99,_0x164823){return db[_0xd0ff('0x31')][_0xd0ff('0x4b')]({'where':{'id':_0x536436[_0xd0ff('0x49')]['id']}})['then'](handleEntityNotFound(_0x1dea99,null))[_0xd0ff('0x29')](saveUpdates(_0x536436[_0xd0ff('0x8d')],null))[_0xd0ff('0x29')](respondWithResult(_0x1dea99,null))[_0xd0ff('0x48')](handleError(_0x1dea99,null));};exports['delete']=function(_0x273f4c,_0x36f48a,_0x31913e){return db[_0xd0ff('0x31')]['find']({'where':{'id':_0x273f4c[_0xd0ff('0x49')]['id']}})[_0xd0ff('0x29')](function(_0x20431d){if(_0x20431d){return _0x20431d[_0xd0ff('0x2a')]();}})['then'](function(_0x4d9d76){rimraf(path[_0xd0ff('0x4d')](config[_0xd0ff('0x4e')],'server/files/plugins',path[_0xd0ff('0x99')](_0x4d9d76[_0xd0ff('0x8')])),function(){});return _0x4d9d76;})[_0xd0ff('0x29')](handleEntityNotFound(_0x36f48a,null))['then'](respondWithStatusCode(_0x36f48a,null))[_0xd0ff('0x48')](handleError(_0x36f48a,null));};exports['webhookGet']=function(_0x4b45e7,_0x57b5a1,_0x2a6ced){return BPromise[_0xd0ff('0x9a')]()[_0xd0ff('0x29')](function(){if(!_0x4b45e7[_0xd0ff('0x39')][_0xd0ff('0x8')]){throw new Error(_0xd0ff('0x9b'));}if(!_0x4b45e7[_0xd0ff('0x39')]['port']){throw new Error(_0xd0ff('0x9c'));}var _0x5377e4=_0x4b45e7[_0xd0ff('0x39')][_0xd0ff('0x9d')]?_0x4b45e7[_0xd0ff('0x39')][_0xd0ff('0x9d')]+':'+_0x4b45e7[_0xd0ff('0x39')][_0xd0ff('0x9e')]:_0xd0ff('0x9f')+_0x4b45e7['query'][_0xd0ff('0x9e')];var _0x2eb564=_0x4b45e7[_0xd0ff('0x39')][_0xd0ff('0x26')]?_0x4b45e7[_0xd0ff('0x39')][_0xd0ff('0x26')]:!![];var _0x3abe51=_0x4b45e7[_0xd0ff('0x39')]['encoding']?_0x4b45e7['query'][_0xd0ff('0xa0')]:null;var _0x41a460={'method':_0x4b45e7['method'],'uri':util[_0xd0ff('0x50')](_0xd0ff('0xa1'),_0x5377e4,_0x4b45e7['query'][_0xd0ff('0x8')]),'json':_0x2eb564,'resolveWithFullResponse':!![],'encoding':_0x3abe51,'qs':_0x4b45e7['query']};if(_0x4b45e7[_0xd0ff('0xa2')]){_0x41a460[_0xd0ff('0xa2')]=_0x4b45e7[_0xd0ff('0xa2')];if(_0x41a460[_0xd0ff('0xa2')][_0xd0ff('0xa3')]){delete _0x41a460['headers']['content-length'];}}if(_0x41a460['headers'][_0xd0ff('0xa4')]){delete _0x41a460[_0xd0ff('0xa2')][_0xd0ff('0xa4')];}return rp(_0x41a460);})['then'](function(_0x4518de){if(_0x4518de){_0x57b5a1[_0xd0ff('0x24')](_0x4518de['headers']);logger[_0xd0ff('0x61')](_0x4518de[_0xd0ff('0x8d')]);if(_[_0xd0ff('0xa5')](_0x4b45e7[_0xd0ff('0x39')][_0xd0ff('0x8')],'download')&&_0x4518de[_0xd0ff('0xa6')]==0x1f4){return _0x57b5a1[_0xd0ff('0x1f')](_0x4518de[_0xd0ff('0xa6')]);}else{return _0x57b5a1[_0xd0ff('0x20')](_0x4518de[_0xd0ff('0xa6')])[_0xd0ff('0x95')](_0x4518de['body']);}}else{return _0x57b5a1[_0xd0ff('0x1f')](0xc8);}})[_0xd0ff('0x48')](handleError(_0x57b5a1,null));};exports[_0xd0ff('0xa7')]=function(_0x424ad5,_0x39ae5c,_0x2f06ec){return BPromise[_0xd0ff('0x9a')]()[_0xd0ff('0x29')](function(){if(!_0x424ad5[_0xd0ff('0x39')][_0xd0ff('0x8')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x424ad5[_0xd0ff('0x39')][_0xd0ff('0x9e')]){throw new Error(_0xd0ff('0x9c'));}var _0x5cc528=_0x424ad5[_0xd0ff('0x39')]['hostname']?_0x424ad5[_0xd0ff('0x39')][_0xd0ff('0x9d')]+':'+_0x424ad5[_0xd0ff('0x39')][_0xd0ff('0x9e')]:_0xd0ff('0x9f')+_0x424ad5[_0xd0ff('0x39')][_0xd0ff('0x9e')];var _0x518a91=_0x424ad5['query'][_0xd0ff('0x26')]?_0x424ad5['query'][_0xd0ff('0x26')]:!![];var _0x4c67e9=_0x424ad5[_0xd0ff('0x39')][_0xd0ff('0xa0')]?_0x424ad5[_0xd0ff('0x39')][_0xd0ff('0xa0')]:null;var _0x2ef03a={'method':_0x424ad5[_0xd0ff('0xa8')],'uri':util[_0xd0ff('0x50')]('%s%s',_0x5cc528,_0x424ad5[_0xd0ff('0x39')]['path']),'json':_0x518a91,'resolveWithFullResponse':!![],'encoding':_0x4c67e9,'body':_0x424ad5['body']};if(_0x424ad5[_0xd0ff('0xa2')]){_0x2ef03a[_0xd0ff('0xa2')]=_0x424ad5[_0xd0ff('0xa2')];if(_0x2ef03a['headers']['content-length']){delete _0x2ef03a[_0xd0ff('0xa2')][_0xd0ff('0xa3')];}}if(_0x2ef03a[_0xd0ff('0xa2')]['content-type']){delete _0x2ef03a[_0xd0ff('0xa2')]['content-type'];}return rp(_0x2ef03a);})[_0xd0ff('0x29')](function(_0x3bf5b1){if(_0x3bf5b1){_0x39ae5c[_0xd0ff('0x24')](_0x3bf5b1['headers']);logger[_0xd0ff('0x61')](_0x3bf5b1[_0xd0ff('0x8d')]);return _0x39ae5c['status'](_0x3bf5b1[_0xd0ff('0xa6')])[_0xd0ff('0x95')](_0x3bf5b1[_0xd0ff('0x8d')]);}else{return _0x39ae5c[_0xd0ff('0x1f')](0xc8);}})[_0xd0ff('0x48')](handleError(_0x39ae5c,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 3cc517b..79d8b67 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 _0x22c5=['emit','hasOwnProperty','hook','exports','../../mysqldb','Plugin','setMaxListeners','save','update','remove'];(function(_0x10ea23,_0x87f70c){var _0x32faae=function(_0x13c4fc){while(--_0x13c4fc){_0x10ea23['push'](_0x10ea23['shift']());}};_0x32faae(++_0x87f70c);}(_0x22c5,0x18a));var _0x522c=function(_0x254684,_0x5d37ca){_0x254684=_0x254684-0x0;var _0x1664ff=_0x22c5[_0x254684];return _0x1664ff;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x522c('0x0'))['db'][_0x522c('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x522c('0x2')](0x0);var events={'afterCreate':_0x522c('0x3'),'afterUpdate':_0x522c('0x4'),'afterDestroy':_0x522c('0x5')};function emitEvent(_0x23e14e){return function(_0x2997d1,_0x182dfe,_0x1420b1){PluginEvents[_0x522c('0x6')](_0x23e14e+':'+_0x2997d1['id'],_0x2997d1);PluginEvents['emit'](_0x23e14e,_0x2997d1);_0x1420b1(null);};}for(var e in events){if(events[_0x522c('0x7')](e)){var event=events[e];Plugin[_0x522c('0x8')](e,emitEvent(event));}}module[_0x522c('0x9')]=PluginEvents; \ No newline at end of file +var _0x8cec=['events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x98dd9d,_0x536d3e){var _0x56dd36=function(_0x52c876){while(--_0x52c876){_0x98dd9d['push'](_0x98dd9d['shift']());}};_0x56dd36(++_0x536d3e);}(_0x8cec,0x16b));var _0xc8ce=function(_0x35b023,_0x2df3b6){_0x35b023=_0x35b023-0x0;var _0x3f2197=_0x8cec[_0x35b023];return _0x3f2197;};'use strict';var EventEmitter=require(_0xc8ce('0x0'));var Plugin=require(_0xc8ce('0x1'))['db'][_0xc8ce('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xc8ce('0x3')](0x0);var events={'afterCreate':_0xc8ce('0x4'),'afterUpdate':_0xc8ce('0x5'),'afterDestroy':_0xc8ce('0x6')};function emitEvent(_0x5044d0){return function(_0x3699b5,_0x15709f,_0x56c941){PluginEvents[_0xc8ce('0x7')](_0x5044d0+':'+_0x3699b5['id'],_0x3699b5);PluginEvents['emit'](_0x5044d0,_0x3699b5);_0x56c941(null);};}for(var e in events){if(events[_0xc8ce('0x8')](e)){var event=events[e];Plugin[_0xc8ce('0x9')](e,emitEvent(event));}}module[_0xc8ce('0xa')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 4bf07f4..8c6f63b 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 _0x4e68=['request-promise','path','./plugin.attributes','exports','Plugin','util','../../config/logger','moment','bluebird'];(function(_0xd9259f,_0x224752){var _0x2c449c=function(_0x230b51){while(--_0x230b51){_0xd9259f['push'](_0xd9259f['shift']());}};_0x2c449c(++_0x224752);}(_0x4e68,0x191));var _0x84e6=function(_0x1e2ef0,_0x1cd292){_0x1e2ef0=_0x1e2ef0-0x0;var _0x25a444=_0x4e68[_0x1e2ef0];return _0x25a444;};'use strict';var _=require('lodash');var util=require(_0x84e6('0x0'));var logger=require(_0x84e6('0x1'))('api');var moment=require(_0x84e6('0x2'));var BPromise=require(_0x84e6('0x3'));var rp=require(_0x84e6('0x4'));var fs=require('fs');var path=require(_0x84e6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x84e6('0x6'));module[_0x84e6('0x7')]=function(_0x442f57,_0x2bfbb2){return _0x442f57['define'](_0x84e6('0x8'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbdc1=['define','Plugin','plugins','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./plugin.attributes','exports'];(function(_0x35bca2,_0x4ce50d){var _0x295d7a=function(_0x226e4d){while(--_0x226e4d){_0x35bca2['push'](_0x35bca2['shift']());}};_0x295d7a(++_0x4ce50d);}(_0xbdc1,0x147));var _0x1bdc=function(_0x5b67c5,_0x19a93f){_0x5b67c5=_0x5b67c5-0x0;var _0x26b5b7=_0xbdc1[_0x5b67c5];return _0x26b5b7;};'use strict';var _=require(_0x1bdc('0x0'));var util=require('util');var logger=require(_0x1bdc('0x1'))(_0x1bdc('0x2'));var moment=require(_0x1bdc('0x3'));var BPromise=require(_0x1bdc('0x4'));var rp=require(_0x1bdc('0x5'));var fs=require('fs');var path=require(_0x1bdc('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1bdc('0x7'));module[_0x1bdc('0x8')]=function(_0x5f03bf,_0x180e0b){return _0x5f03bf[_0x1bdc('0x9')](_0x1bdc('0xa'),attributes,{'tableName':_0x1bdc('0xb'),'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 0f2e9e8..10635c3 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 _0x546c=['CreatePlugin','create','options','info','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x9bb5cb,_0x1f8301){var _0x3d611c=function(_0x497e6c){while(--_0x497e6c){_0x9bb5cb['push'](_0x9bb5cb['shift']());}};_0x3d611c(++_0x1f8301);}(_0x546c,0x1c7));var _0xc546=function(_0x47047f,_0x5f57a3){_0x47047f=_0x47047f-0x0;var _0x16298b=_0x546c[_0x47047f];return _0x16298b;};'use strict';var _=require(_0xc546('0x0'));var util=require(_0xc546('0x1'));var moment=require(_0xc546('0x2'));var BPromise=require(_0xc546('0x3'));var rs=require(_0xc546('0x4'));var fs=require('fs');var Redis=require(_0xc546('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc546('0x6'));var logger=require(_0xc546('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc546('0x8'));var client=jayson[_0xc546('0x9')][_0xc546('0xa')]({'port':0x232a});config[_0xc546('0xb')]=_['defaults'](config[_0xc546('0xb')],{'host':_0xc546('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc546('0xb')]));require(_0xc546('0xd'))[_0xc546('0xe')](socket);function respondWithRpcPromise(_0x3d7bf5,_0x5b1119,_0x3fae80){return new BPromise(function(_0x55f327,_0x58e36c){return client[_0xc546('0xf')](_0x3d7bf5,_0x3fae80)[_0xc546('0x10')](function(_0x498977){logger['info'](_0xc546('0x11'),_0x5b1119,_0xc546('0x12'));logger['debug'](_0xc546('0x13'),_0x5b1119,'request\x20sent',JSON[_0xc546('0x14')](_0x498977));if(_0x498977[_0xc546('0x15')]){if(_0x498977[_0xc546('0x15')][_0xc546('0x16')]===0x1f4){logger[_0xc546('0x15')](_0xc546('0x11'),_0x5b1119,_0x498977['error'][_0xc546('0x17')]);return _0x58e36c(_0x498977[_0xc546('0x15')]['message']);}logger[_0xc546('0x15')](_0xc546('0x11'),_0x5b1119,_0x498977[_0xc546('0x15')][_0xc546('0x17')]);return _0x55f327(_0x498977[_0xc546('0x15')][_0xc546('0x17')]);}else{logger['info'](_0xc546('0x11'),_0x5b1119,_0xc546('0x12'));_0x55f327(_0x498977['result']['message']);}})[_0xc546('0x18')](function(_0x3818f4){logger['error'](_0xc546('0x11'),_0x5b1119,_0x3818f4);_0x58e36c(_0x3818f4);});});}exports[_0xc546('0x19')]=function(_0x44760b){var _0x2b4153=this;return new Promise(function(_0x39ca08,_0xe464b1){return db['Plugin'][_0xc546('0x1a')](_0x44760b['body'],{'raw':_0x44760b[_0xc546('0x1b')]?_0x44760b[_0xc546('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xc546('0x10')](function(_0x1820a3){logger[_0xc546('0x1c')](_0xc546('0x19'),_0x44760b);logger[_0xc546('0x1d')]('CreatePlugin',_0x44760b,JSON['stringify'](_0x1820a3));_0x39ca08(_0x1820a3);})[_0xc546('0x18')](function(_0x1ae0e9){logger[_0xc546('0x15')](_0xc546('0x19'),_0x1ae0e9[_0xc546('0x17')],_0x44760b);_0xe464b1(_0x2b4153[_0xc546('0x15')](0x1f4,_0x1ae0e9['message']));});});}; \ No newline at end of file +var _0xdbf3=['../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','CreatePlugin','Plugin','create','options','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xf902df,_0x3c6256){var _0x345a52=function(_0x1b271b){while(--_0x1b271b){_0xf902df['push'](_0xf902df['shift']());}};_0x345a52(++_0x3c6256);}(_0xdbf3,0x162));var _0x3dbf=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xdbf3[_0x45783c];return _0x1161da;};'use strict';var _=require('lodash');var util=require(_0x3dbf('0x0'));var moment=require(_0x3dbf('0x1'));var BPromise=require(_0x3dbf('0x2'));var rs=require(_0x3dbf('0x3'));var fs=require('fs');var Redis=require(_0x3dbf('0x4'));var db=require(_0x3dbf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3dbf('0x6'))(_0x3dbf('0x7'));var config=require('../../config/environment');var jayson=require(_0x3dbf('0x8'));var client=jayson['client'][_0x3dbf('0x9')]({'port':0x232a});config[_0x3dbf('0xa')]=_[_0x3dbf('0xb')](config[_0x3dbf('0xa')],{'host':_0x3dbf('0xc'),'port':0x18eb});var socket=require(_0x3dbf('0xd'))(new Redis(config['redis']));require('./plugin.socket')[_0x3dbf('0xe')](socket);function respondWithRpcPromise(_0x55941d,_0x3d410f,_0x5d33b9){return new BPromise(function(_0x57f8fb,_0x219e28){return client['request'](_0x55941d,_0x5d33b9)[_0x3dbf('0xf')](function(_0x107d1a){logger[_0x3dbf('0x10')](_0x3dbf('0x11'),_0x3d410f,_0x3dbf('0x12'));logger['debug'](_0x3dbf('0x13'),_0x3d410f,_0x3dbf('0x12'),JSON[_0x3dbf('0x14')](_0x107d1a));if(_0x107d1a['error']){if(_0x107d1a['error'][_0x3dbf('0x15')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x3d410f,_0x107d1a[_0x3dbf('0x16')]['message']);return _0x219e28(_0x107d1a['error'][_0x3dbf('0x17')]);}logger['error'](_0x3dbf('0x11'),_0x3d410f,_0x107d1a[_0x3dbf('0x16')][_0x3dbf('0x17')]);return _0x57f8fb(_0x107d1a[_0x3dbf('0x16')][_0x3dbf('0x17')]);}else{logger[_0x3dbf('0x10')](_0x3dbf('0x11'),_0x3d410f,'request\x20sent');_0x57f8fb(_0x107d1a[_0x3dbf('0x18')][_0x3dbf('0x17')]);}})[_0x3dbf('0x19')](function(_0x45a173){logger[_0x3dbf('0x16')](_0x3dbf('0x11'),_0x3d410f,_0x45a173);_0x219e28(_0x45a173);});});}exports[_0x3dbf('0x1a')]=function(_0x6304a4){var _0xbcd481=this;return new Promise(function(_0x2057da,_0x458098){return db[_0x3dbf('0x1b')][_0x3dbf('0x1c')](_0x6304a4['body'],{'raw':_0x6304a4[_0x3dbf('0x1d')]?_0x6304a4[_0x3dbf('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x3dbf('0xf')](function(_0x1de464){logger[_0x3dbf('0x10')](_0x3dbf('0x1a'),_0x6304a4);logger['debug'](_0x3dbf('0x1a'),_0x6304a4,JSON[_0x3dbf('0x14')](_0x1de464));_0x2057da(_0x1de464);})[_0x3dbf('0x19')](function(_0x3dc722){logger[_0x3dbf('0x16')]('CreatePlugin',_0x3dc722[_0x3dbf('0x17')],_0x6304a4);_0x458098(_0xbcd481[_0x3dbf('0x16')](0x1f4,_0x3dc722[_0x3dbf('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index b1ca80a..ecebd26 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 _0x3b38=['./plugin.events','save','remove','emit','removeListener','register','length','plugin:'];(function(_0x198e31,_0x18c560){var _0x52c12b=function(_0x4ceeb1){while(--_0x4ceeb1){_0x198e31['push'](_0x198e31['shift']());}};_0x52c12b(++_0x18c560);}(_0x3b38,0xa8));var _0x83b3=function(_0x58f3ff,_0x37113f){_0x58f3ff=_0x58f3ff-0x0;var _0x5ebc29=_0x3b38[_0x58f3ff];return _0x5ebc29;};'use strict';var PluginEvents=require(_0x83b3('0x0'));var events=[_0x83b3('0x1'),_0x83b3('0x2'),'update'];function createListener(_0x879618,_0x431f74){return function(_0x28bed4){_0x431f74[_0x83b3('0x3')](_0x879618,_0x28bed4);};}function removeListener(_0x8b048a,_0x123e1c){return function(){PluginEvents[_0x83b3('0x4')](_0x8b048a,_0x123e1c);};}exports[_0x83b3('0x5')]=function(_0x5b90db){for(var _0x4cbbec=0x0,_0x4b0c00=events[_0x83b3('0x6')];_0x4cbbec<_0x4b0c00;_0x4cbbec++){var _0x5ac5ee=events[_0x4cbbec];var _0x290b46=createListener(_0x83b3('0x7')+_0x5ac5ee,_0x5b90db);PluginEvents['on'](_0x5ac5ee,_0x290b46);}}; \ No newline at end of file +var _0x5855=['removeListener','register','plugin:','./plugin.events','save','remove','update'];(function(_0x5652e3,_0x5d1a11){var _0x1b31c0=function(_0x55800a){while(--_0x55800a){_0x5652e3['push'](_0x5652e3['shift']());}};_0x1b31c0(++_0x5d1a11);}(_0x5855,0x1ed));var _0x5585=function(_0x5ae350,_0x24edc7){_0x5ae350=_0x5ae350-0x0;var _0x4e3073=_0x5855[_0x5ae350];return _0x4e3073;};'use strict';var PluginEvents=require(_0x5585('0x0'));var events=[_0x5585('0x1'),_0x5585('0x2'),_0x5585('0x3')];function createListener(_0x2c5fbf,_0x1e2fcd){return function(_0x93b019){_0x1e2fcd['emit'](_0x2c5fbf,_0x93b019);};}function removeListener(_0x476d29,_0x312b7e){return function(){PluginEvents[_0x5585('0x4')](_0x476d29,_0x312b7e);};}exports[_0x5585('0x5')]=function(_0x41712c){for(var _0xe41abd=0x0,_0x5ac64d=events['length'];_0xe41abd<_0x5ac64d;_0xe41abd++){var _0x1d8ef2=events[_0xe41abd];var _0x2f624e=createListener(_0x5585('0x6')+_0x1d8ef2,_0x41712c);PluginEvents['on'](_0x1d8ef2,_0x2f624e);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 0d80a5f..54d50fa 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(_0x2cbc93,_0x728161){var _0x303598=function(_0x4903d9){while(--_0x4903d9){_0x2cbc93['push'](_0x2cbc93['shift']());}};_0x303598(++_0x728161);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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(_0x199466,_0x5bed57){var _0xc5752=function(_0x4ffc14){while(--_0x4ffc14){_0x199466['push'](_0x199466['shift']());}};_0xc5752(++_0x5bed57);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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 0ed1cbc..f07a8f7 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 _0x1335=['create','body','script','cwd','dirname','start','dump','status','Missing\x20name\x20and/or\x20path','update','restart','Unknown\x20status','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','child_process','exec','bluebird','json','error','stack','name','send','npm\x20install','index','list','then','express','motion2','catch','show','describe','params'];(function(_0x33cd3d,_0xf089a){var _0x4107a9=function(_0x3db544){while(--_0x3db544){_0x33cd3d['push'](_0x33cd3d['shift']());}};_0x4107a9(++_0xf089a);}(_0x1335,0xe6));var _0x5133=function(_0x5efa1b,_0x53c765){_0x5efa1b=_0x5efa1b-0x0;var _0x155946=_0x1335[_0x5efa1b];return _0x155946;};'use strict';var _=require(_0x5133('0x0'));var pm2=require(_0x5133('0x1'));var logger=require(_0x5133('0x2'))(_0x5133('0x3'));var path=require('path');var exec=require(_0x5133('0x4'))[_0x5133('0x5')];var BPromise=require(_0x5133('0x6'));function handleEntityNotFound(_0x357091,_0x33f5db){return function(_0x9f5c53){if(!_0x9f5c53){_0x357091['sendStatus'](0x194);;}return _0x9f5c53;};}function respondWithResult(_0xfca030,_0x2e0635){_0x2e0635=_0x2e0635||0xc8;return function(_0x56ba90){if(_0x56ba90){return _0xfca030['status'](_0x2e0635)[_0x5133('0x7')](_0x56ba90);}return null;};}function handleError(_0x4ae6ec,_0x106dbf){_0x106dbf=_0x106dbf||0x1f4;return function(_0x58eb7a){logger[_0x5133('0x8')](_0x58eb7a[_0x5133('0x9')]);if(_0x58eb7a['name']){delete _0x58eb7a[_0x5133('0xa')];}_0x4ae6ec['status'](_0x106dbf)[_0x5133('0xb')](_0x58eb7a);};}function execChildProcess(){return new BPromise(function(_0x17ba90,_0xe377e6){exec(_0x5133('0xc'),function(_0x503e0d,_0x537393,_0x23bcc0){logger['info'](_0x537393);logger['info'](_0x23bcc0);if(_0x503e0d){logger['error'](_0x503e0d);return _0xe377e6(_0x503e0d);}return _0x17ba90(_0x537393);});});}exports[_0x5133('0xd')]=function(_0x2f86ea,_0x19d0ed){return pm2[_0x5133('0xe')]()[_0x5133('0xf')](function(_0x627ac9){if(_0x627ac9){var _0x374a67=_['reject'](_0x627ac9,function(_0x253219){return _0x253219[_0x5133('0xa')]===_0x5133('0x10')||_0x253219[_0x5133('0xa')]===_0x5133('0x11');});return{'rows':_0x374a67,'count':_0x374a67['length']};}return null;})[_0x5133('0xf')](respondWithResult(_0x19d0ed,null))[_0x5133('0x12')](handleError(_0x19d0ed,null));};exports[_0x5133('0x13')]=function(_0x3b8e7a,_0x390f9c){return pm2[_0x5133('0x14')](_0x3b8e7a[_0x5133('0x15')]['id'])['then'](respondWithResult(_0x390f9c,null))[_0x5133('0xf')](handleEntityNotFound(_0x390f9c,null))[_0x5133('0x12')](handleError(_0x390f9c,null));};exports[_0x5133('0x16')]=function(_0xa6ca5a,_0x2c8e3a){if(_0xa6ca5a['body'][_0x5133('0xa')]&&_0xa6ca5a[_0x5133('0x17')][_0x5133('0x18')]){var _0x5d3440=path['join'](__dirname,'../../files/plugins',_0xa6ca5a[_0x5133('0x17')]['script']);var _0x474733=process[_0x5133('0x19')]();process['chdir'](path[_0x5133('0x1a')](_0x5d3440));return execChildProcess()[_0x5133('0xf')](function(_0x3eb78f){process['chdir'](_0x474733);return pm2[_0x5133('0x1b')]({'name':_0xa6ca5a[_0x5133('0x17')]['name'],'script':_0x5d3440});})[_0x5133('0xf')](function(_0x3503d8){pm2[_0x5133('0x1c')]();return _0x3503d8[0x0];})['then'](respondWithResult(_0x2c8e3a,0xc9))['catch'](handleError(_0x2c8e3a,null));}else{return _0x2c8e3a[_0x5133('0x1d')](0x1f4)[_0x5133('0xb')]({'message':_0x5133('0x1e')});}};exports[_0x5133('0x1f')]=function(_0x4ca935,_0x447428){if(_0x4ca935['body']['id']){delete _0x4ca935['body']['id'];}var _0x3328a6={'online':_0x5133('0x20'),'stopped':'stop'};if(_0x3328a6['hasOwnProperty'](_0x4ca935['body'][_0x5133('0x1d')])){return pm2[_0x3328a6[_0x4ca935[_0x5133('0x17')][_0x5133('0x1d')]]](_0x4ca935[_0x5133('0x15')]['id'])[_0x5133('0xf')](respondWithResult(_0x447428,0xc8))[_0x5133('0x12')](handleError(_0x447428,null));}else{return _0x447428[_0x5133('0x1d')](0x1f4)[_0x5133('0xb')]({'message':_0x5133('0x21')});}};exports['destroy']=function(_0x57a9de,_0x9437c7){if(_0x57a9de[_0x5133('0x17')]['id']){delete _0x57a9de['body']['id'];}if(_0x57a9de['params']['id']){return pm2[_0x5133('0x22')](_0x57a9de[_0x5133('0x15')]['id'])[_0x5133('0xf')](function(_0x2b9497){pm2[_0x5133('0x1c')]();return _0x2b9497[0x0];})[_0x5133('0xf')](respondWithResult(_0x9437c7,null))[_0x5133('0x12')](handleError(_0x9437c7,null));}else{return _0x9437c7['status'](0x1f4)[_0x5133('0xb')]({'message':_0x5133('0x23')});}}; \ No newline at end of file +var _0xcc20=['info','index','reject','express','motion2','then','show','catch','create','body','script','join','../../files/plugins','cwd','chdir','dump','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','params','send','Unknown\x20status','Unknown\x20id','lodash','../../config/pm2','api','path','exec','sendStatus','json','error','stack','name','status','npm\x20install'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xcc20,0x114));var _0x0cc2=function(_0x1672eb,_0x175755){_0x1672eb=_0x1672eb-0x0;var _0x924d7=_0xcc20[_0x1672eb];return _0x924d7;};'use strict';var _=require(_0x0cc2('0x0'));var pm2=require(_0x0cc2('0x1'));var logger=require('../../config/logger')(_0x0cc2('0x2'));var path=require(_0x0cc2('0x3'));var exec=require('child_process')[_0x0cc2('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x55869e,_0x3fdf66){return function(_0x36c566){if(!_0x36c566){_0x55869e[_0x0cc2('0x5')](0x194);;}return _0x36c566;};}function respondWithResult(_0x5a11ef,_0x390b91){_0x390b91=_0x390b91||0xc8;return function(_0x169d72){if(_0x169d72){return _0x5a11ef['status'](_0x390b91)[_0x0cc2('0x6')](_0x169d72);}return null;};}function handleError(_0x223b86,_0x1e5b4d){_0x1e5b4d=_0x1e5b4d||0x1f4;return function(_0x141d6e){logger[_0x0cc2('0x7')](_0x141d6e[_0x0cc2('0x8')]);if(_0x141d6e['name']){delete _0x141d6e[_0x0cc2('0x9')];}_0x223b86[_0x0cc2('0xa')](_0x1e5b4d)['send'](_0x141d6e);};}function execChildProcess(){return new BPromise(function(_0x3d705c,_0x52fcf2){exec(_0x0cc2('0xb'),function(_0x3b9801,_0x1ba5a8,_0x16575d){logger[_0x0cc2('0xc')](_0x1ba5a8);logger[_0x0cc2('0xc')](_0x16575d);if(_0x3b9801){logger[_0x0cc2('0x7')](_0x3b9801);return _0x52fcf2(_0x3b9801);}return _0x3d705c(_0x1ba5a8);});});}exports[_0x0cc2('0xd')]=function(_0x205cea,_0x47c94c){return pm2['list']()['then'](function(_0x26a506){if(_0x26a506){var _0x39fb38=_[_0x0cc2('0xe')](_0x26a506,function(_0x5b0869){return _0x5b0869[_0x0cc2('0x9')]===_0x0cc2('0xf')||_0x5b0869[_0x0cc2('0x9')]===_0x0cc2('0x10');});return{'rows':_0x39fb38,'count':_0x39fb38['length']};}return null;})[_0x0cc2('0x11')](respondWithResult(_0x47c94c,null))['catch'](handleError(_0x47c94c,null));};exports[_0x0cc2('0x12')]=function(_0x215c0e,_0x3a3646){return pm2['describe'](_0x215c0e['params']['id'])[_0x0cc2('0x11')](respondWithResult(_0x3a3646,null))[_0x0cc2('0x11')](handleEntityNotFound(_0x3a3646,null))[_0x0cc2('0x13')](handleError(_0x3a3646,null));};exports[_0x0cc2('0x14')]=function(_0x1b1b0d,_0x15a43c){if(_0x1b1b0d[_0x0cc2('0x15')][_0x0cc2('0x9')]&&_0x1b1b0d[_0x0cc2('0x15')][_0x0cc2('0x16')]){var _0x2f7a42=path[_0x0cc2('0x17')](__dirname,_0x0cc2('0x18'),_0x1b1b0d[_0x0cc2('0x15')][_0x0cc2('0x16')]);var _0x533bc5=process[_0x0cc2('0x19')]();process[_0x0cc2('0x1a')](path['dirname'](_0x2f7a42));return execChildProcess()[_0x0cc2('0x11')](function(_0x35793c){process[_0x0cc2('0x1a')](_0x533bc5);return pm2['start']({'name':_0x1b1b0d['body'][_0x0cc2('0x9')],'script':_0x2f7a42});})['then'](function(_0x2f55c4){pm2[_0x0cc2('0x1b')]();return _0x2f55c4[0x0];})['then'](respondWithResult(_0x15a43c,0xc9))[_0x0cc2('0x13')](handleError(_0x15a43c,null));}else{return _0x15a43c['status'](0x1f4)['send']({'message':_0x0cc2('0x1c')});}};exports[_0x0cc2('0x1d')]=function(_0x31bd1a,_0x4653ab){if(_0x31bd1a[_0x0cc2('0x15')]['id']){delete _0x31bd1a[_0x0cc2('0x15')]['id'];}var _0x1996da={'online':'restart','stopped':_0x0cc2('0x1e')};if(_0x1996da[_0x0cc2('0x1f')](_0x31bd1a['body'][_0x0cc2('0xa')])){return pm2[_0x1996da[_0x31bd1a['body'][_0x0cc2('0xa')]]](_0x31bd1a[_0x0cc2('0x20')]['id'])[_0x0cc2('0x11')](respondWithResult(_0x4653ab,0xc8))[_0x0cc2('0x13')](handleError(_0x4653ab,null));}else{return _0x4653ab['status'](0x1f4)[_0x0cc2('0x21')]({'message':_0x0cc2('0x22')});}};exports['destroy']=function(_0x57de66,_0x52dfbf){if(_0x57de66[_0x0cc2('0x15')]['id']){delete _0x57de66[_0x0cc2('0x15')]['id'];}if(_0x57de66[_0x0cc2('0x20')]['id']){return pm2['delete'](_0x57de66[_0x0cc2('0x20')]['id'])['then'](function(_0x57a25d){pm2[_0x0cc2('0x1b')]();return _0x57a25d[0x0];})[_0x0cc2('0x11')](respondWithResult(_0x52dfbf,null))['catch'](handleError(_0x52dfbf,null));}else{return _0x52dfbf['status'](0x1f4)[_0x0cc2('0x21')]({'message':_0x0cc2('0x23')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index dfe4523..c3d4db8 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 _0xb4b6=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x1ae2b1,_0x389154){var _0x4c97b8=function(_0x372181){while(--_0x372181){_0x1ae2b1['push'](_0x1ae2b1['shift']());}};_0x4c97b8(++_0x389154);}(_0xb4b6,0x7e));var _0x6b4b=function(_0x49c2c9,_0x79307a){_0x49c2c9=_0x49c2c9-0x0;var _0x2cd5dc=_0xb4b6[_0x49c2c9];return _0x2cd5dc;};'use strict';var multer=require('multer');var util=require(_0x6b4b('0x0'));var path=require(_0x6b4b('0x1'));var timeout=require(_0x6b4b('0x2'));var express=require(_0x6b4b('0x3'));var router=express[_0x6b4b('0x4')]();var auth=require(_0x6b4b('0x5'));var interaction=require(_0x6b4b('0x6'));var config=require(_0x6b4b('0x7'));module[_0x6b4b('0x8')]=router; \ No newline at end of file +var _0xbbbd=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x42f718,_0x35df28){var _0x257671=function(_0x29c333){while(--_0x29c333){_0x42f718['push'](_0x42f718['shift']());}};_0x257671(++_0x35df28);}(_0xbbbd,0x86));var _0xdbbb=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xbbbd[_0x474bc0];return _0x4b24cf;};'use strict';var multer=require(_0xdbbb('0x0'));var util=require(_0xdbbb('0x1'));var path=require(_0xdbbb('0x2'));var timeout=require(_0xdbbb('0x3'));var express=require(_0xdbbb('0x4'));var router=express[_0xdbbb('0x5')]();var auth=require(_0xdbbb('0x6'));var interaction=require(_0xdbbb('0x7'));var config=require(_0xdbbb('0x8'));module[_0xdbbb('0x9')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 4991f5f..1ccf072 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 _0x52a3=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x52a3,0x1d8));var _0x352a=function(_0x12dca4,_0x38e541){_0x12dca4=_0x12dca4-0x0;var _0x5db702=_0x52a3[_0x12dca4];return _0x5db702;};'use strict';var Sequelize=require(_0x352a('0x0'));module[_0x352a('0x1')]={'state':{'type':Sequelize[_0x352a('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x352a('0x3')]},'scheduledat':{'type':Sequelize[_0x352a('0x4')]},'uniqueid':{'type':Sequelize[_0x352a('0x3')]},'starttime':{'type':Sequelize[_0x352a('0x4')]},'responsetime':{'type':Sequelize[_0x352a('0x4')]},'ringtime':{'type':Sequelize[_0x352a('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x352a('0x3')]},'membername':{'type':Sequelize[_0x352a('0x3')]}}; \ No newline at end of file +var _0x0500=['DATE','INTEGER','STRING'];(function(_0x4c0622,_0x5dacaf){var _0x1799d8=function(_0x2ba801){while(--_0x2ba801){_0x4c0622['push'](_0x4c0622['shift']());}};_0x1799d8(++_0x5dacaf);}(_0x0500,0xcb));var _0x0050=function(_0x4201b9,_0x112d90){_0x4201b9=_0x4201b9-0x0;var _0x4fc0a2=_0x0500[_0x4201b9];return _0x4fc0a2;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x0050('0x0')]},'scheduledat':{'type':Sequelize[_0x0050('0x1')]},'uniqueid':{'type':Sequelize[_0x0050('0x0')]},'starttime':{'type':Sequelize[_0x0050('0x1')]},'responsetime':{'type':Sequelize[_0x0050('0x1')]},'ringtime':{'type':Sequelize[_0x0050('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x0050('0x0')]},'campaigntype':{'type':Sequelize[_0x0050('0x0')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index e2dbede..71429de 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 _0x0642=['ReportAgentPreview','api','moment','bluebird','path','rimraf','exports','define'];(function(_0x3bbadd,_0x27d709){var _0x136d6c=function(_0x5cfedb){while(--_0x5cfedb){_0x3bbadd['push'](_0x3bbadd['shift']());}};_0x136d6c(++_0x27d709);}(_0x0642,0x1d9));var _0x2064=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x0642[_0x24237f];return _0x48298e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2064('0x0'));var moment=require(_0x2064('0x1'));var BPromise=require(_0x2064('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2064('0x3'));var rimraf=require(_0x2064('0x4'));var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module[_0x2064('0x5')]=function(_0x28bf2b,_0x50bae8){return _0x28bf2b[_0x2064('0x6')](_0x2064('0x7'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4819=['ReportAgentPreview','report_agent_preview','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define'];(function(_0x4d969e,_0x378aef){var _0xb81762=function(_0x30866c){while(--_0x30866c){_0x4d969e['push'](_0x4d969e['shift']());}};_0xb81762(++_0x378aef);}(_0x4819,0x1c2));var _0x9481=function(_0x33a89d,_0xed52ed){_0x33a89d=_0x33a89d-0x0;var _0x175025=_0x4819[_0x33a89d];return _0x175025;};'use strict';var _=require(_0x9481('0x0'));var util=require(_0x9481('0x1'));var logger=require('../../config/logger')(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module[_0x9481('0xa')]=function(_0x2ad42d,_0x2ef0f9){return _0x2ad42d[_0x9481('0xb')](_0x9481('0xc'),attributes,{'tableName':_0x9481('0xd'),'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 17d8735..7ad62ad 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 _0x16ab=['request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','then','debug','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x16ab,0x1d1));var _0xb16a=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x16ab[_0x556927];return _0x5f1235;};'use strict';var _=require(_0xb16a('0x0'));var util=require('util');var moment=require(_0xb16a('0x1'));var BPromise=require(_0xb16a('0x2'));var rs=require(_0xb16a('0x3'));var fs=require('fs');var Redis=require(_0xb16a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb16a('0x5'));var logger=require(_0xb16a('0x6'))(_0xb16a('0x7'));var config=require(_0xb16a('0x8'));var jayson=require(_0xb16a('0x9'));var client=jayson[_0xb16a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b6882,_0x136417,_0x21866e){return new BPromise(function(_0xa2ce15,_0x56df69){return client[_0xb16a('0xb')](_0x1b6882,_0x21866e)['then'](function(_0x55908e){logger[_0xb16a('0xc')](_0xb16a('0xd'),_0x136417,_0xb16a('0xe'));logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x136417,_0xb16a('0xe'),JSON[_0xb16a('0xf')](_0x55908e));if(_0x55908e[_0xb16a('0x10')]){if(_0x55908e['error'][_0xb16a('0x11')]===0x1f4){logger[_0xb16a('0x10')](_0xb16a('0xd'),_0x136417,_0x55908e[_0xb16a('0x10')][_0xb16a('0x12')]);return _0x56df69(_0x55908e[_0xb16a('0x10')][_0xb16a('0x12')]);}logger['error'](_0xb16a('0xd'),_0x136417,_0x55908e[_0xb16a('0x10')]['message']);return _0xa2ce15(_0x55908e[_0xb16a('0x10')][_0xb16a('0x12')]);}else{logger[_0xb16a('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x136417,_0xb16a('0xe'));_0xa2ce15(_0x55908e[_0xb16a('0x13')][_0xb16a('0x12')]);}})[_0xb16a('0x14')](function(_0xd292ef){logger[_0xb16a('0x10')](_0xb16a('0xd'),_0x136417,_0xd292ef);_0x56df69(_0xd292ef);});});}exports[_0xb16a('0x15')]=function(_0x4e27b1){var _0x5977a2=this;return new Promise(function(_0xcc98e5,_0x5d06d3){return db[_0xb16a('0x16')][_0xb16a('0x17')](_0x4e27b1['body'],{'raw':_0x4e27b1[_0xb16a('0x18')]?_0x4e27b1['options'][_0xb16a('0x19')]===undefined?!![]:![]:!![]})[_0xb16a('0x1a')](function(_0x1b668e){logger[_0xb16a('0xc')]('CreateReportAgentPreview',_0x4e27b1);logger[_0xb16a('0x1b')]('CreateReportAgentPreview',_0x4e27b1,JSON['stringify'](_0x1b668e));_0xcc98e5(_0x1b668e);})['catch'](function(_0x2e96c1){logger['error']('CreateReportAgentPreview',_0x2e96c1[_0xb16a('0x12')],_0x4e27b1);_0x5d06d3(_0x5977a2[_0xb16a('0x10')](0x1f4,_0x2e96c1['message']));});});}; \ No newline at end of file +var _0x7a83=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','body','options','raw','lodash','util','bluebird'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7a83,0xab));var _0x37a8=function(_0x4687df,_0x12099c){_0x4687df=_0x4687df-0x0;var _0x32eaef=_0x7a83[_0x4687df];return _0x32eaef;};'use strict';var _=require(_0x37a8('0x0'));var util=require(_0x37a8('0x1'));var moment=require('moment');var BPromise=require(_0x37a8('0x2'));var rs=require(_0x37a8('0x3'));var fs=require('fs');var Redis=require(_0x37a8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x37a8('0x5'));var logger=require(_0x37a8('0x6'))('rpc');var config=require(_0x37a8('0x7'));var jayson=require(_0x37a8('0x8'));var client=jayson[_0x37a8('0x9')][_0x37a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c56bb,_0x5ca0ff,_0x3d79ce){return new BPromise(function(_0x56dc71,_0x251962){return client[_0x37a8('0xb')](_0x1c56bb,_0x3d79ce)[_0x37a8('0xc')](function(_0x4f3679){logger[_0x37a8('0xd')](_0x37a8('0xe'),_0x5ca0ff,_0x37a8('0xf'));logger[_0x37a8('0x10')](_0x37a8('0x11'),_0x5ca0ff,'request\x20sent',JSON[_0x37a8('0x12')](_0x4f3679));if(_0x4f3679[_0x37a8('0x13')]){if(_0x4f3679[_0x37a8('0x13')][_0x37a8('0x14')]===0x1f4){logger[_0x37a8('0x13')](_0x37a8('0xe'),_0x5ca0ff,_0x4f3679[_0x37a8('0x13')][_0x37a8('0x15')]);return _0x251962(_0x4f3679['error']['message']);}logger['error'](_0x37a8('0xe'),_0x5ca0ff,_0x4f3679[_0x37a8('0x13')][_0x37a8('0x15')]);return _0x56dc71(_0x4f3679[_0x37a8('0x13')][_0x37a8('0x15')]);}else{logger[_0x37a8('0xd')](_0x37a8('0xe'),_0x5ca0ff,_0x37a8('0xf'));_0x56dc71(_0x4f3679[_0x37a8('0x16')][_0x37a8('0x15')]);}})[_0x37a8('0x17')](function(_0x2c163){logger[_0x37a8('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x5ca0ff,_0x2c163);_0x251962(_0x2c163);});});}exports[_0x37a8('0x18')]=function(_0x3b9f29){var _0x186486=this;return new Promise(function(_0x3ab746,_0x4b7b21){return db[_0x37a8('0x19')]['create'](_0x3b9f29[_0x37a8('0x1a')],{'raw':_0x3b9f29['options']?_0x3b9f29[_0x37a8('0x1b')][_0x37a8('0x1c')]===undefined?!![]:![]:!![]})[_0x37a8('0xc')](function(_0x15a55e){logger[_0x37a8('0xd')](_0x37a8('0x18'),_0x3b9f29);logger[_0x37a8('0x10')]('CreateReportAgentPreview',_0x3b9f29,JSON[_0x37a8('0x12')](_0x15a55e));_0x3ab746(_0x15a55e);})['catch'](function(_0x5a601a){logger[_0x37a8('0x13')](_0x37a8('0x18'),_0x5a601a['message'],_0x3b9f29);_0x4b7b21(_0x186486[_0x37a8('0x13')](0x1f4,_0x5a601a[_0x37a8('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index de17ef4..7fa2bdc 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 _0x5607=['/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/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/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id','showSmsQueues','/agents/:id/notify','agentNotify','multer','util','path','Router','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','/outbound','outbound'];(function(_0x2eb3db,_0x4a32c0){var _0x358f33=function(_0x1d0588){while(--_0x1d0588){_0x2eb3db['push'](_0x2eb3db['shift']());}};_0x358f33(++_0x4a32c0);}(_0x5607,0xc3));var _0x7560=function(_0x5711dc,_0x2743ee){_0x5711dc=_0x5711dc-0x0;var _0x41d709=_0x5607[_0x5711dc];return _0x41d709;};'use strict';var multer=require(_0x7560('0x0'));var util=require(_0x7560('0x1'));var path=require(_0x7560('0x2'));var express=require('express');var router=express[_0x7560('0x3')]();var auth=require('../../components/auth/service');var controller=require(_0x7560('0x4'));router[_0x7560('0x5')](_0x7560('0x6'),auth['isAuthenticated'](),controller[_0x7560('0x7')]);router['get'](_0x7560('0x8'),auth[_0x7560('0x9')](),controller[_0x7560('0xa')]);router[_0x7560('0x5')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x7560('0x9')](),controller[_0x7560('0xb')]);router[_0x7560('0x5')]('/voice/queues',auth[_0x7560('0x9')](),controller[_0x7560('0xc')]);router[_0x7560('0x5')](_0x7560('0xd'),auth[_0x7560('0x9')](),controller['chatQueues']);router[_0x7560('0x5')](_0x7560('0xe'),auth[_0x7560('0x9')](),controller[_0x7560('0xf')]);router['get'](_0x7560('0x10'),auth[_0x7560('0x9')](),controller[_0x7560('0x11')]);router['get'](_0x7560('0x12'),auth[_0x7560('0x9')](),controller['openchannelQueues']);router[_0x7560('0x5')](_0x7560('0x13'),auth[_0x7560('0x9')](),controller[_0x7560('0x14')]);router[_0x7560('0x5')]('/fax/queues',auth[_0x7560('0x9')](),controller[_0x7560('0x15')]);router[_0x7560('0x5')](_0x7560('0x16'),auth[_0x7560('0x9')](),controller['voiceQueuesPreview']);router[_0x7560('0x5')]('/voice/queues/channels',auth['isAuthenticated'](),controller[_0x7560('0x17')]);router[_0x7560('0x5')](_0x7560('0x18'),auth[_0x7560('0x9')](),controller[_0x7560('0x19')]);router[_0x7560('0x5')](_0x7560('0x1a'),auth[_0x7560('0x9')](),controller[_0x7560('0x1b')]);router[_0x7560('0x5')](_0x7560('0x1c'),auth[_0x7560('0x9')](),controller['voiceQueuesChannelRedirect']);router['get'](_0x7560('0x1d'),auth['isAuthenticated'](),controller[_0x7560('0x1e')]);router['get'](_0x7560('0x1f'),auth[_0x7560('0x9')](),controller[_0x7560('0x20')]);router[_0x7560('0x5')](_0x7560('0x21'),auth[_0x7560('0x9')](),controller[_0x7560('0x22')]);router[_0x7560('0x5')](_0x7560('0x23'),auth[_0x7560('0x9')](),controller[_0x7560('0x24')]);router[_0x7560('0x25')](_0x7560('0x26'),auth[_0x7560('0x9')](),controller[_0x7560('0x27')]);router[_0x7560('0x5')](_0x7560('0x28'),auth['isAuthenticated'](),controller[_0x7560('0x29')]);router[_0x7560('0x5')](_0x7560('0x2a'),auth[_0x7560('0x9')](),controller[_0x7560('0x2b')]);router[_0x7560('0x5')](_0x7560('0x2c'),auth[_0x7560('0x9')](),controller['campaigns']);router[_0x7560('0x5')](_0x7560('0x2d'),auth[_0x7560('0x9')](),controller[_0x7560('0x2e')]);router['get'](_0x7560('0x2f'),auth['isAuthenticated'](),controller[_0x7560('0x30')]);router[_0x7560('0x5')]('/mail/queues/waitinginteractions',auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router[_0x7560('0x5')](_0x7560('0x31'),auth['isAuthenticated'](),controller[_0x7560('0x32')]);router['get'](_0x7560('0x33'),auth[_0x7560('0x9')](),controller[_0x7560('0x34')]);router[_0x7560('0x5')](_0x7560('0x35'),auth[_0x7560('0x9')](),controller[_0x7560('0x36')]);router[_0x7560('0x37')](_0x7560('0x38'),auth[_0x7560('0x9')](),controller[_0x7560('0x39')](_0x7560('0x3a')));router['get'](_0x7560('0x3b'),auth[_0x7560('0x9')](),controller[_0x7560('0x3c')]);router[_0x7560('0x37')](_0x7560('0x3d'),auth[_0x7560('0x9')](),controller[_0x7560('0x39')](_0x7560('0x3e')));router['get'](_0x7560('0x3f'),auth[_0x7560('0x9')](),controller[_0x7560('0x40')]);router['post'](_0x7560('0x41'),auth['isAuthenticated'](),controller[_0x7560('0x39')](_0x7560('0x42')));router[_0x7560('0x5')](_0x7560('0x43'),auth[_0x7560('0x9')](),controller[_0x7560('0x44')]);router[_0x7560('0x37')](_0x7560('0x45'),auth[_0x7560('0x9')](),controller[_0x7560('0x39')](_0x7560('0x46')));router[_0x7560('0x5')]('/openchannel/queues/:id',auth[_0x7560('0x9')](),controller[_0x7560('0x47')]);router['post']('/sms/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify']('sms'));router[_0x7560('0x5')](_0x7560('0x48'),auth['isAuthenticated'](),controller[_0x7560('0x49')]);router[_0x7560('0x37')](_0x7560('0x4a'),auth[_0x7560('0x9')](),controller[_0x7560('0x4b')]);module['exports']=router; \ No newline at end of file +var _0xfcb2=['/agents/:id/notify','exports','multer','util','path','express','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','/outbound/channels','agents','put','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/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','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','showSmsQueues'];(function(_0x5e73a8,_0x55f095){var _0x4012bc=function(_0x448060){while(--_0x448060){_0x5e73a8['push'](_0x5e73a8['shift']());}};_0x4012bc(++_0x55f095);}(_0xfcb2,0x1be));var _0x2fcb=function(_0x1ab020,_0x1b9656){_0x1ab020=_0x1ab020-0x0;var _0x57d2e8=_0xfcb2[_0x1ab020];return _0x57d2e8;};'use strict';var multer=require(_0x2fcb('0x0'));var util=require(_0x2fcb('0x1'));var path=require(_0x2fcb('0x2'));var express=require(_0x2fcb('0x3'));var router=express['Router']();var auth=require(_0x2fcb('0x4'));var controller=require(_0x2fcb('0x5'));router[_0x2fcb('0x6')](_0x2fcb('0x7'),auth[_0x2fcb('0x8')](),controller[_0x2fcb('0x9')]);router[_0x2fcb('0x6')](_0x2fcb('0xa'),auth[_0x2fcb('0x8')](),controller['voiceChannelMixMonitor']);router['get']('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x2fcb('0x8')](),controller[_0x2fcb('0xb')]);router[_0x2fcb('0x6')](_0x2fcb('0xc'),auth['isAuthenticated'](),controller[_0x2fcb('0xd')]);router[_0x2fcb('0x6')](_0x2fcb('0xe'),auth[_0x2fcb('0x8')](),controller[_0x2fcb('0xf')]);router[_0x2fcb('0x6')](_0x2fcb('0x10'),auth[_0x2fcb('0x8')](),controller[_0x2fcb('0x11')]);router[_0x2fcb('0x6')](_0x2fcb('0x12'),auth[_0x2fcb('0x8')](),controller[_0x2fcb('0x13')]);router['get']('/openchannel/queues',auth['isAuthenticated'](),controller[_0x2fcb('0x14')]);router[_0x2fcb('0x6')]('/sms/queues',auth['isAuthenticated'](),controller['smsQueues']);router[_0x2fcb('0x6')]('/fax/queues',auth['isAuthenticated'](),controller[_0x2fcb('0x15')]);router[_0x2fcb('0x6')](_0x2fcb('0x16'),auth[_0x2fcb('0x8')](),controller['voiceQueuesPreview']);router[_0x2fcb('0x6')](_0x2fcb('0x17'),auth['isAuthenticated'](),controller[_0x2fcb('0x18')]);router[_0x2fcb('0x6')](_0x2fcb('0x19'),auth[_0x2fcb('0x8')](),controller['voiceQueuesChannel']);router['get'](_0x2fcb('0x1a'),auth['isAuthenticated'](),controller[_0x2fcb('0x1b')]);router[_0x2fcb('0x6')](_0x2fcb('0x1c'),auth[_0x2fcb('0x8')](),controller[_0x2fcb('0x1d')]);router[_0x2fcb('0x6')](_0x2fcb('0x1e'),auth['isAuthenticated'](),controller[_0x2fcb('0x1f')]);router['get'](_0x2fcb('0x20'),auth[_0x2fcb('0x8')](),controller[_0x2fcb('0x21')]);router[_0x2fcb('0x6')](_0x2fcb('0x22'),auth[_0x2fcb('0x8')](),controller['outboundChannels']);router[_0x2fcb('0x6')]('/agents',auth[_0x2fcb('0x8')](),controller[_0x2fcb('0x23')]);router[_0x2fcb('0x24')]('/agents/:id/capacity',auth['isAuthenticated'](),controller[_0x2fcb('0x25')]);router['get'](_0x2fcb('0x26'),auth['isAuthenticated'](),controller[_0x2fcb('0x27')]);router[_0x2fcb('0x6')](_0x2fcb('0x28'),auth[_0x2fcb('0x8')](),controller[_0x2fcb('0x29')]);router['get'](_0x2fcb('0x2a'),auth[_0x2fcb('0x8')](),controller[_0x2fcb('0x2b')]);router['get']('/fax/accounts',auth[_0x2fcb('0x8')](),controller[_0x2fcb('0x2c')]);router[_0x2fcb('0x6')](_0x2fcb('0x2d'),auth[_0x2fcb('0x8')](),controller[_0x2fcb('0x2e')]);router[_0x2fcb('0x6')](_0x2fcb('0x2f'),auth['isAuthenticated'](),controller[_0x2fcb('0x30')]);router[_0x2fcb('0x6')](_0x2fcb('0x31'),auth[_0x2fcb('0x8')](),controller[_0x2fcb('0x32')]);router[_0x2fcb('0x6')](_0x2fcb('0x33'),auth[_0x2fcb('0x8')](),controller[_0x2fcb('0x34')]);router[_0x2fcb('0x6')](_0x2fcb('0x35'),auth[_0x2fcb('0x8')](),controller[_0x2fcb('0x36')]);router[_0x2fcb('0x37')](_0x2fcb('0x38'),auth['isAuthenticated'](),controller[_0x2fcb('0x39')](_0x2fcb('0x3a')));router[_0x2fcb('0x6')](_0x2fcb('0x3b'),auth['isAuthenticated'](),controller[_0x2fcb('0x3c')]);router['post'](_0x2fcb('0x3d'),auth[_0x2fcb('0x8')](),controller['queueNotify'](_0x2fcb('0x3e')));router[_0x2fcb('0x6')](_0x2fcb('0x3f'),auth[_0x2fcb('0x8')](),controller[_0x2fcb('0x40')]);router['post']('/fax/queues/:id/notify',auth[_0x2fcb('0x8')](),controller[_0x2fcb('0x39')](_0x2fcb('0x41')));router[_0x2fcb('0x6')](_0x2fcb('0x42'),auth['isAuthenticated'](),controller['showFaxQueues']);router['post']('/openchannel/queues/:id/notify',auth[_0x2fcb('0x8')](),controller[_0x2fcb('0x39')](_0x2fcb('0x43')));router[_0x2fcb('0x6')](_0x2fcb('0x44'),auth['isAuthenticated'](),controller[_0x2fcb('0x45')]);router[_0x2fcb('0x37')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0x2fcb('0x46')));router[_0x2fcb('0x6')]('/sms/queues/:id',auth['isAuthenticated'](),controller[_0x2fcb('0x47')]);router['post'](_0x2fcb('0x48'),auth['isAuthenticated'](),controller['agentNotify']);module[_0x2fcb('0x49')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index f21f2bf..2f885ca 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 _0x2bad=['hasOwnProperty','MemberReport','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','findOrCreate','isNil','interface','SIP/%s','agent','AgentCapacity','telephones','Telephones','campaigns','Campaigns','chatQueues','ChatQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','InteractionId','From','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Message','agentTransferTimeout','bluebird','lodash','../../mysqldb','../../config/logger','jayson/promise','client','http','request','error','message','result','catch','stack','name','status','find','rows','voiceChannels','query','then','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','body','user','interaction'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x2bad,0x11e));var _0xd2ba=function(_0x290181,_0x46db3e){_0x290181=_0x290181-0x0;var _0x2dc9dc=_0x2bad[_0x290181];return _0x2dc9dc;};'use strict';var BPromise=require(_0xd2ba('0x0'));var moment=require('moment');var _=require(_0xd2ba('0x1'));var util=require('util');var db=require(_0xd2ba('0x2'))['db'];var logger=require(_0xd2ba('0x3'))('api');var jayson=require(_0xd2ba('0x4'));var amiClient=jayson[_0xd2ba('0x5')][_0xd2ba('0x6')]({'port':0x232a});var mailClient=jayson[_0xd2ba('0x5')][_0xd2ba('0x6')]({'port':0x232b});var routingClient=jayson[_0xd2ba('0x5')][_0xd2ba('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x296b70,_0x506157,_0x15fb7b){return new BPromise(function(_0x553ecc,_0x4cb891){var _0x1da9fd=_0x15fb7b?_0x15fb7b:amiClient;return _0x1da9fd[_0xd2ba('0x7')](_0x296b70,_0x506157)['then'](function(_0x58d6d0){if(_0x58d6d0[_0xd2ba('0x8')]){if(_0x58d6d0['error']['code']===0x1f4){return _0x4cb891(_0x58d6d0['error'][_0xd2ba('0x9')]);}return _0x553ecc(_0x58d6d0[_0xd2ba('0x8')]['message']);}else{_0x553ecc(_0x58d6d0[_0xd2ba('0xa')]);}})[_0xd2ba('0xb')](function(_0x543e3f){_0x4cb891(_0x543e3f);});});}function respondWithResult(_0x5871a0,_0x4ba2cc){_0x4ba2cc=_0x4ba2cc||0xc8;return function(_0x58477c){if(_0x58477c){return _0x5871a0['status'](_0x4ba2cc)['json'](_0x58477c);}return _0x5871a0['sendStatus'](0x194);};}function handleError(_0x321f4d,_0x440b92){_0x440b92=_0x440b92||0x1f4;return function(_0x578cb){logger['error'](_0x578cb[_0xd2ba('0xc')]);if(_0x578cb[_0xd2ba('0xd')]){delete _0x578cb[_0xd2ba('0xd')];}_0x321f4d[_0xd2ba('0xe')](_0x440b92)['send'](_0x578cb);};}function findById(_0x51d639){return function(_0x74b1eb){if(!_['isNil'](_0x51d639)&&!_['isNil'](_0x74b1eb)&&!_['isNil'](_0x74b1eb['rows'])){return _[_0xd2ba('0xf')](_0x74b1eb[_0xd2ba('0x10')],function(_0x3aaded){return _0x3aaded['id']==_0x51d639;});}return null;};}exports[_0xd2ba('0x11')]=function(_0x1fe5cc,_0x12db17){return respondWithRpcPromise('VoiceChannels',_0x1fe5cc[_0xd2ba('0x12')])[_0xd2ba('0x13')](respondWithResult(_0x12db17,null))[_0xd2ba('0xb')](handleError(_0x12db17,null));};exports['voiceChannelMixMonitor']=function(_0x3336f6,_0x171313){return respondWithRpcPromise(_0xd2ba('0x14'),_[_0xd2ba('0x15')](_0x3336f6[_0xd2ba('0x12')],_0x3336f6[_0xd2ba('0x16')]))[_0xd2ba('0x13')](respondWithResult(_0x171313,null))[_0xd2ba('0xb')](handleError(_0x171313,null));};exports[_0xd2ba('0x17')]=function(_0x478377,_0xb3a608){return respondWithRpcPromise(_0xd2ba('0x18'),_[_0xd2ba('0x15')](_0x478377[_0xd2ba('0x12')],_0x478377[_0xd2ba('0x16')]))[_0xd2ba('0x13')](respondWithResult(_0xb3a608,null))['catch'](handleError(_0xb3a608,null));};exports[_0xd2ba('0x19')]=function(_0x5ec9c1,_0xa4c762){return respondWithRpcPromise('VoiceQueues',_0x5ec9c1[_0xd2ba('0x12')])['then'](respondWithResult(_0xa4c762,null))[_0xd2ba('0xb')](handleError(_0xa4c762,null));};exports[_0xd2ba('0x1a')]=function(_0x2b8725,_0x18e6d8){return respondWithRpcPromise('VoiceQueues',_0x2b8725['query'])[_0xd2ba('0x13')](findById(_0x2b8725[_0xd2ba('0x16')]['id']))[_0xd2ba('0x13')](respondWithResult(_0x18e6d8,null))[_0xd2ba('0xb')](handleError(_0x18e6d8,null));};exports['voiceQueuesPreview']=function(_0x2353f4,_0x3ebaad){return respondWithRpcPromise(_0xd2ba('0x1b'),_[_0xd2ba('0x15')](_0x2353f4[_0xd2ba('0x12')],_0x2353f4['params']))['then'](respondWithResult(_0x3ebaad,null))[_0xd2ba('0xb')](handleError(_0x3ebaad,null));};exports['voiceQueuesChannels']=function(_0x47e32a,_0x208670){return respondWithRpcPromise(_0xd2ba('0x1c'),_0x47e32a[_0xd2ba('0x12')])[_0xd2ba('0x13')](respondWithResult(_0x208670,null))[_0xd2ba('0xb')](handleError(_0x208670,null));};exports[_0xd2ba('0x1d')]=function(_0x230502,_0x2fda36){return respondWithRpcPromise(_0xd2ba('0x1e'),_['merge'](_0x230502[_0xd2ba('0x12')],_0x230502[_0xd2ba('0x16')]))[_0xd2ba('0x13')](respondWithResult(_0x2fda36,null))[_0xd2ba('0xb')](handleError(_0x2fda36,null));};exports['voiceQueuesChannelHangup']=function(_0x1611b2,_0x9433e8){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0xd2ba('0x15')](_0x1611b2['query'],_0x1611b2['params']))[_0xd2ba('0x13')](respondWithResult(_0x9433e8,null))[_0xd2ba('0xb')](handleError(_0x9433e8,null));};exports[_0xd2ba('0x1f')]=function(_0x3e957c,_0x1b8414){return respondWithRpcPromise(_0xd2ba('0x20'),_['merge'](_0x3e957c[_0xd2ba('0x12')],_0x3e957c[_0xd2ba('0x16')]))[_0xd2ba('0x13')](respondWithResult(_0x1b8414,null))[_0xd2ba('0xb')](handleError(_0x1b8414,null));};exports[_0xd2ba('0x21')]=function(_0x2ddb7f,_0x53b807){return respondWithRpcPromise('Outbound',_0x2ddb7f['query'])['then'](respondWithResult(_0x53b807,null))['catch'](handleError(_0x53b807,null));};exports[_0xd2ba('0x22')]=function(_0x52ce2e,_0x15a421){return respondWithRpcPromise(_0xd2ba('0x23'),_0x52ce2e[_0xd2ba('0x12')])['then'](respondWithResult(_0x15a421,null))[_0xd2ba('0xb')](handleError(_0x15a421,null));};exports['agents']=function(_0x1745c2,_0x219de9){var _0x411b10;return respondWithRpcPromise(_0xd2ba('0x24'),_0x1745c2['query'])[_0xd2ba('0x13')](function(_0x5efb8f){_0x411b10=_0x5efb8f;return respondWithRpcPromise('Agents',_0x1745c2[_0xd2ba('0x12')],routingClient);})[_0xd2ba('0x13')](function(_0x25e031){return _[_0xd2ba('0x15')]({},_0x25e031,_0x411b10);})[_0xd2ba('0x13')](respondWithResult(_0x219de9,null))[_0xd2ba('0xb')](handleError(_0x219de9,null));};exports[_0xd2ba('0x25')]=function(_0x1ed6f8,_0x198e48){if(_0x1ed6f8[_0xd2ba('0x26')]&&_0x1ed6f8[_0xd2ba('0x26')]['interaction']&&_0x1ed6f8['user']&&_0x1ed6f8[_0xd2ba('0x27')][_0xd2ba('0xd')]){for(var _0x298125 in _0x1ed6f8[_0xd2ba('0x26')][_0xd2ba('0x28')]){if(_0x1ed6f8[_0xd2ba('0x26')][_0xd2ba('0x28')][_0xd2ba('0x29')](_0x298125)){db[_0xd2ba('0x2a')][_0xd2ba('0x2b')]({'where':{'channel':_0x298125,'membername':_0x1ed6f8['user'][_0xd2ba('0xd')],'type':_0xd2ba('0x2c'),'exitAt':null,'uniqueid':_0x1ed6f8[_0xd2ba('0x26')][_0xd2ba('0x28')][_0x298125]&&_0x1ed6f8[_0xd2ba('0x26')][_0xd2ba('0x28')][_0x298125]['length']?{'$notIn':_0x1ed6f8[_0xd2ba('0x26')][_0xd2ba('0x28')][_0x298125]}:{'$ne':null}}})[_0xd2ba('0x13')](function(_0x33cc42){var _0x1b11a4=moment()[_0xd2ba('0x2d')](_0xd2ba('0x2e'));for(var _0x16bb43=0x0,_0x21ca57=_0x33cc42[_0xd2ba('0x2f')];_0x16bb43<_0x21ca57;_0x16bb43+=0x1){_0x33cc42[_0x16bb43]['updateAttributes']({'exitAt':_0x1b11a4});}});for(var _0x82a335=0x0;_0x82a335<_0x1ed6f8[_0xd2ba('0x26')][_0xd2ba('0x28')][_0x298125]['length'];_0x82a335+=0x1){db[_0xd2ba('0x2a')][_0xd2ba('0x30')]({'where':{'channel':_0x298125,'membername':_0x1ed6f8['user'][_0xd2ba('0xd')],'type':_0xd2ba('0x2c'),'uniqueid':_0x1ed6f8['body'][_0xd2ba('0x28')][_0x298125][_0x82a335],'exitAt':null},'defaults':{'channel':_0x298125,'membername':_0x1ed6f8['user']['name'],'interface':_[_0xd2ba('0x31')](_0x1ed6f8[_0xd2ba('0x27')][_0xd2ba('0x32')])?util[_0xd2ba('0x2d')](_0xd2ba('0x33'),_0x1ed6f8[_0xd2ba('0x27')][_0xd2ba('0xd')]):_0x1ed6f8[_0xd2ba('0x27')]['interface'],'type':_0xd2ba('0x2c'),'enterAt':moment()[_0xd2ba('0x2d')](_0xd2ba('0x2e')),'role':_0xd2ba('0x34'),'internal':_0x1ed6f8[_0xd2ba('0x27')]['internal'],'uniqueid':_0x1ed6f8['body'][_0xd2ba('0x28')][_0x298125][_0x82a335]}});}}}}return respondWithRpcPromise(_0xd2ba('0x35'),{'id':_0x1ed6f8[_0xd2ba('0x16')]['id'],'capacity':_0x1ed6f8[_0xd2ba('0x26')]['capacity']},routingClient)['then'](respondWithResult(_0x198e48,null))[_0xd2ba('0xb')](handleError(_0x198e48,null));};exports[_0xd2ba('0x36')]=function(_0x3ff53c,_0x2a831b){return respondWithRpcPromise(_0xd2ba('0x37'),_0x3ff53c[_0xd2ba('0x12')])[_0xd2ba('0x13')](respondWithResult(_0x2a831b,null))['catch'](handleError(_0x2a831b,null));};exports['trunks']=function(_0x2a8812,_0x87b80d){return respondWithRpcPromise('Trunks',_0x2a8812[_0xd2ba('0x12')])[_0xd2ba('0x13')](respondWithResult(_0x87b80d,null))['catch'](handleError(_0x87b80d,null));};exports[_0xd2ba('0x38')]=function(_0x25e343,_0x382303){return respondWithRpcPromise(_0xd2ba('0x39'),_0x25e343[_0xd2ba('0x12')])['then'](respondWithResult(_0x382303,null))[_0xd2ba('0xb')](handleError(_0x382303,null));};exports[_0xd2ba('0x3a')]=function(_0x1b7af1,_0x4e6446){return respondWithRpcPromise(_0xd2ba('0x3b'),_0x1b7af1[_0xd2ba('0x12')],routingClient)['then'](respondWithResult(_0x4e6446,null))['catch'](handleError(_0x4e6446,null));};exports['showChatQueues']=function(_0x5b1e16,_0x5a646c){return respondWithRpcPromise(_0xd2ba('0x3b'),_0x5b1e16[_0xd2ba('0x12')],routingClient)[_0xd2ba('0x13')](findById(_0x5b1e16[_0xd2ba('0x16')]['id']))[_0xd2ba('0x13')](respondWithResult(_0x5a646c,null))['catch'](handleError(_0x5a646c,null));};exports['mailQueues']=function(_0x4ae02f,_0x27dcfa){return respondWithRpcPromise('MailQueues',_0x4ae02f['query'],routingClient)[_0xd2ba('0x13')](respondWithResult(_0x27dcfa,null))['catch'](handleError(_0x27dcfa,null));};exports[_0xd2ba('0x3c')]=function(_0x200a0e,_0x2d93d9){return respondWithRpcPromise(_0xd2ba('0x3d'),_0x200a0e['query'],routingClient)[_0xd2ba('0x13')](findById(_0x200a0e[_0xd2ba('0x16')]['id']))[_0xd2ba('0x13')](respondWithResult(_0x2d93d9,null))[_0xd2ba('0xb')](handleError(_0x2d93d9,null));};exports[_0xd2ba('0x3e')]=function(_0x812143,_0x55c69c){return respondWithRpcPromise(_0xd2ba('0x3f'),_0x812143[_0xd2ba('0x12')],mailClient)[_0xd2ba('0x13')](respondWithResult(_0x55c69c,null))[_0xd2ba('0xb')](handleError(_0x55c69c,null));};exports[_0xd2ba('0x40')]=function(_0x362f55,_0x3256af){return respondWithRpcPromise(_0xd2ba('0x41'),_0x362f55[_0xd2ba('0x12')],routingClient)['then'](respondWithResult(_0x3256af,null))[_0xd2ba('0xb')](handleError(_0x3256af,null));};exports[_0xd2ba('0x42')]=function(_0x57c231,_0xa9830d){return respondWithRpcPromise('OpenchannelQueues',_0x57c231['query'],routingClient)[_0xd2ba('0x13')](findById(_0x57c231[_0xd2ba('0x16')]['id']))[_0xd2ba('0x13')](respondWithResult(_0xa9830d,null))[_0xd2ba('0xb')](handleError(_0xa9830d,null));};exports[_0xd2ba('0x43')]=function(_0x26c958,_0x33e323){return respondWithRpcPromise(_0xd2ba('0x44'),_0x26c958[_0xd2ba('0x12')],routingClient)[_0xd2ba('0x13')](respondWithResult(_0x33e323,null))[_0xd2ba('0xb')](handleError(_0x33e323,null));};exports[_0xd2ba('0x45')]=function(_0x67ab52,_0x373564){return respondWithRpcPromise(_0xd2ba('0x44'),_0x67ab52[_0xd2ba('0x12')],routingClient)[_0xd2ba('0x13')](findById(_0x67ab52['params']['id']))[_0xd2ba('0x13')](respondWithResult(_0x373564,null))[_0xd2ba('0xb')](handleError(_0x373564,null));};exports['faxQueues']=function(_0x15ff8b,_0x54a56b){return respondWithRpcPromise(_0xd2ba('0x46'),_0x15ff8b[_0xd2ba('0x12')],routingClient)[_0xd2ba('0x13')](respondWithResult(_0x54a56b,null))[_0xd2ba('0xb')](handleError(_0x54a56b,null));};exports[_0xd2ba('0x47')]=function(_0x165ed1,_0x560808){return respondWithRpcPromise(_0xd2ba('0x46'),_0x165ed1[_0xd2ba('0x12')],routingClient)[_0xd2ba('0x13')](findById(_0x165ed1[_0xd2ba('0x16')]['id']))[_0xd2ba('0x13')](respondWithResult(_0x560808,null))[_0xd2ba('0xb')](handleError(_0x560808,null));};exports[_0xd2ba('0x48')]=function(_0x3818ca,_0x1be22b){return respondWithRpcPromise(_0xd2ba('0x49'),_0x3818ca[_0xd2ba('0x12')])[_0xd2ba('0x13')](respondWithResult(_0x1be22b,null))['catch'](handleError(_0x1be22b,null));};exports[_0xd2ba('0x4a')]=function(_0x4cdded,_0x3a9753){return respondWithRpcPromise(_0xd2ba('0x4b'),_0x4cdded[_0xd2ba('0x12')],routingClient)[_0xd2ba('0x13')](respondWithResult(_0x3a9753,null))[_0xd2ba('0xb')](handleError(_0x3a9753,null));};exports[_0xd2ba('0x4c')]=function(_0x2d2544,_0x1aee36){return respondWithRpcPromise(_0xd2ba('0x4d'),_0x2d2544[_0xd2ba('0x12')],routingClient)[_0xd2ba('0x13')](respondWithResult(_0x1aee36,null))[_0xd2ba('0xb')](handleError(_0x1aee36,null));};exports[_0xd2ba('0x4e')]=function(_0x186e8c,_0x51d689){return respondWithRpcPromise(_0xd2ba('0x4f'),_0x186e8c['query'],routingClient)[_0xd2ba('0x13')](respondWithResult(_0x51d689,null))[_0xd2ba('0xb')](handleError(_0x51d689,null));};exports[_0xd2ba('0x50')]=function(_0x42a1ab,_0x3c7a7c){return respondWithRpcPromise(_0xd2ba('0x51'),_0x42a1ab[_0xd2ba('0x12')],routingClient)[_0xd2ba('0x13')](respondWithResult(_0x3c7a7c,null))[_0xd2ba('0xb')](handleError(_0x3c7a7c,null));};exports['faxQueuesWaitingInteractions']=function(_0x26b14f,_0x406004){return respondWithRpcPromise(_0xd2ba('0x52'),_0x26b14f['query'],routingClient)['then'](respondWithResult(_0x406004,null))['catch'](handleError(_0x406004,null));};exports[_0xd2ba('0x53')]=function(_0x1b3795){return function(_0x4bf666,_0x4cf14c){var _0x33520e,_0xf61652;var _0x1fcd88=_[_0xd2ba('0x54')](_0x1b3795);var _0x222e75=_0x1b3795===_0xd2ba('0x55')?_0xd2ba('0x56'):_0xd2ba('0x57');return db[_0x1fcd88+_0xd2ba('0x58')]['findOne']({'raw':!![],'where':{'id':_0x4bf666[_0xd2ba('0x16')]['id']}})[_0xd2ba('0x13')](function(_0x5f2c82){if(_[_0xd2ba('0x31')](_0x5f2c82)){throw new Error(_0x1fcd88+'\x20Queue\x20not\x20found');}_0x33520e=_0x5f2c82;return db[_0x1fcd88+'Message'][_0xd2ba('0x59')]({'where':{'id':_0x4bf666[_0xd2ba('0x26')][_0xd2ba('0x5a')]},'include':[{'model':db[_0x1fcd88+_0xd2ba('0x5b')],'as':_0xd2ba('0x5b')},{'model':db[_0x1fcd88+_0x222e75],'as':_0xd2ba('0x57')}]});})['then'](function(_0x163a1f){if(_[_0xd2ba('0x31')](_0x163a1f)){throw new Error(_0x1fcd88+_0xd2ba('0x5c'));}_0xf61652=_0x163a1f;return _0x163a1f[_0xd2ba('0x5d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd2ba('0x13')](function(){var _0x370b98={'uniqueid':_0x1b3795+'.'+_0xf61652['id']+'.'+_0xf61652[_0xd2ba('0x5b')]['id'],'FromUserId':_0x4bf666['user']['id'],'type':'queue'};_0x370b98[_0x1fcd88+'MessageId']=_0xf61652['id'];_0x370b98[_0x1fcd88+_0xd2ba('0x5e')]=_0xf61652[_0xd2ba('0x5b')]['id'];_0x370b98[_0xd2ba('0x5f')+_0x1fcd88+_0x222e75+'Id']=_0xf61652[_0xd2ba('0x57')]['id'];_0x370b98['To'+_0x1fcd88+_0xd2ba('0x60')]=_0x33520e['id'];return db[_0x1fcd88+_0xd2ba('0x61')][_0xd2ba('0x62')](_0x370b98);})[_0xd2ba('0x13')](function(){return respondWithRpcPromise(_0xd2ba('0x63'),{'channel':_0x1b3795,'interaction':_0xf61652[_0xd2ba('0x5b')],'message':_0xf61652,'account':_0xf61652[_0xd2ba('0x57')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd2ba('0x64'),'appdata':_0x33520e[_0xd2ba('0xd')]+','+(_0xf61652[_0xd2ba('0x57')][_0xd2ba('0x65')]||0x12c),'interval':_0xd2ba('0x66')}]},routingClient);})[_0xd2ba('0x13')](respondWithResult(_0x4cf14c,null))[_0xd2ba('0xb')](handleError(_0x4cf14c,null));};};exports[_0xd2ba('0x67')]=function(_0x33ddc3,_0x1b122c){var _0xdfc8f0,_0x49d5da;if(_[_0xd2ba('0x31')](_0x33ddc3['body'][_0xd2ba('0x68')])){throw new Error(_0xd2ba('0x69'));}var _0x28177a=_0x33ddc3[_0xd2ba('0x26')][_0xd2ba('0x68')];var _0x22ff40=_['capitalize'](_0x28177a);var _0x52c49c=_0x28177a===_0xd2ba('0x55')?_0xd2ba('0x56'):_0xd2ba('0x57');return db[_0xd2ba('0x6a')][_0xd2ba('0x59')]({'raw':!![],'where':{'id':_0x33ddc3['params']['id'],'role':_0xd2ba('0x34')}})[_0xd2ba('0x13')](function(_0x3da566){if(_[_0xd2ba('0x31')](_0x3da566)){throw new Error('Agent\x20not\x20found');}_0xdfc8f0=_0x3da566;return db[_0x22ff40+_0xd2ba('0x6b')][_0xd2ba('0x59')]({'where':{'id':_0x33ddc3[_0xd2ba('0x26')][_0xd2ba('0x5a')]},'include':[{'model':db[_0x22ff40+'Interaction'],'as':_0xd2ba('0x5b')},{'model':db[_0x22ff40+_0x52c49c],'as':_0xd2ba('0x57')}]});})['then'](function(_0x539478){if(_[_0xd2ba('0x31')](_0x539478)){throw new Error(_0x22ff40+_0xd2ba('0x5c'));}_0x49d5da=_0x539478;return _0x539478['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xd2ba('0x13')](function(){var _0x12ff8={'uniqueid':_0x28177a+'.'+_0x49d5da['id']+'.'+_0x49d5da[_0xd2ba('0x5b')]['id'],'FromUserId':_0x33ddc3[_0xd2ba('0x27')]['id'],'type':_0xd2ba('0x64'),'ToUserId':_0xdfc8f0['id']};_0x12ff8[_0x22ff40+'MessageId']=_0x49d5da['id'];_0x12ff8[_0x22ff40+_0xd2ba('0x5e')]=_0x49d5da[_0xd2ba('0x5b')]['id'];_0x12ff8[_0xd2ba('0x5f')+_0x22ff40+_0x52c49c+'Id']=_0x49d5da[_0xd2ba('0x57')]['id'];return db[_0x22ff40+_0xd2ba('0x61')][_0xd2ba('0x62')](_0x12ff8);})[_0xd2ba('0x13')](function(){return respondWithRpcPromise(_0xd2ba('0x63'),{'channel':_0x28177a,'interaction':_0x49d5da[_0xd2ba('0x5b')],'message':_0x49d5da,'account':_0x49d5da[_0xd2ba('0x57')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd2ba('0x34'),'appdata':_0xdfc8f0['name']+','+(_0x49d5da[_0xd2ba('0x57')][_0xd2ba('0x6c')]||0x12c),'interval':_0xd2ba('0x66')}]},routingClient);})[_0xd2ba('0x13')](respondWithResult(_0x1b122c,null))['catch'](handleError(_0x1b122c,null));}; \ No newline at end of file +var _0xac72=['Website','Account','Queue','\x20Queue\x20not\x20found','findOne','messageId','Interaction','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','Agent\x20not\x20found','Message','\x20Message\x20not\x20found','create','agentTransferTimeout','bluebird','moment','lodash','util','../../config/logger','api','client','http','request','then','error','code','message','result','catch','status','json','name','send','isNil','rows','find','VoiceChannels','query','VoiceChannelMixMonitor','merge','VoiceChannelStopMixMonitor','params','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','OutboundChannels','agents','Agents','agentCapacity','body','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','updateAttributes','findOrCreate','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','showMailQueues','MailQueues','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','faxQueues','FaxQueues','showFaxQueues','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize'];(function(_0x50ae92,_0x11e899){var _0x375128=function(_0xbdc369){while(--_0xbdc369){_0x50ae92['push'](_0x50ae92['shift']());}};_0x375128(++_0x11e899);}(_0xac72,0xfb));var _0x2ac7=function(_0xd0e8e3,_0x225e3a){_0xd0e8e3=_0xd0e8e3-0x0;var _0x331828=_0xac72[_0xd0e8e3];return _0x331828;};'use strict';var BPromise=require(_0x2ac7('0x0'));var moment=require(_0x2ac7('0x1'));var _=require(_0x2ac7('0x2'));var util=require(_0x2ac7('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x2ac7('0x4'))(_0x2ac7('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x2ac7('0x6')][_0x2ac7('0x7')]({'port':0x232a});var mailClient=jayson[_0x2ac7('0x6')][_0x2ac7('0x7')]({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x357a95,_0x310c03,_0x2c1ace){return new BPromise(function(_0x232bff,_0x190c4d){var _0x3a3e9d=_0x2c1ace?_0x2c1ace:amiClient;return _0x3a3e9d[_0x2ac7('0x8')](_0x357a95,_0x310c03)[_0x2ac7('0x9')](function(_0x25294f){if(_0x25294f[_0x2ac7('0xa')]){if(_0x25294f['error'][_0x2ac7('0xb')]===0x1f4){return _0x190c4d(_0x25294f[_0x2ac7('0xa')][_0x2ac7('0xc')]);}return _0x232bff(_0x25294f[_0x2ac7('0xa')][_0x2ac7('0xc')]);}else{_0x232bff(_0x25294f[_0x2ac7('0xd')]);}})[_0x2ac7('0xe')](function(_0x5b44d1){_0x190c4d(_0x5b44d1);});});}function respondWithResult(_0x24d533,_0x3fd61e){_0x3fd61e=_0x3fd61e||0xc8;return function(_0xa12b90){if(_0xa12b90){return _0x24d533[_0x2ac7('0xf')](_0x3fd61e)[_0x2ac7('0x10')](_0xa12b90);}return _0x24d533['sendStatus'](0x194);};}function handleError(_0x75f793,_0x291a1b){_0x291a1b=_0x291a1b||0x1f4;return function(_0x5938f5){logger[_0x2ac7('0xa')](_0x5938f5['stack']);if(_0x5938f5[_0x2ac7('0x11')]){delete _0x5938f5['name'];}_0x75f793[_0x2ac7('0xf')](_0x291a1b)[_0x2ac7('0x12')](_0x5938f5);};}function findById(_0x1a8484){return function(_0x3b2625){if(!_[_0x2ac7('0x13')](_0x1a8484)&&!_[_0x2ac7('0x13')](_0x3b2625)&&!_['isNil'](_0x3b2625[_0x2ac7('0x14')])){return _[_0x2ac7('0x15')](_0x3b2625[_0x2ac7('0x14')],function(_0x513131){return _0x513131['id']==_0x1a8484;});}return null;};}exports['voiceChannels']=function(_0x256409,_0x41dedd){return respondWithRpcPromise(_0x2ac7('0x16'),_0x256409[_0x2ac7('0x17')])[_0x2ac7('0x9')](respondWithResult(_0x41dedd,null))[_0x2ac7('0xe')](handleError(_0x41dedd,null));};exports['voiceChannelMixMonitor']=function(_0xd14f5d,_0x2d4e20){return respondWithRpcPromise(_0x2ac7('0x18'),_[_0x2ac7('0x19')](_0xd14f5d[_0x2ac7('0x17')],_0xd14f5d['params']))['then'](respondWithResult(_0x2d4e20,null))[_0x2ac7('0xe')](handleError(_0x2d4e20,null));};exports['voiceChannelStopMixMonitor']=function(_0x5acfaf,_0x706db1){return respondWithRpcPromise(_0x2ac7('0x1a'),_['merge'](_0x5acfaf[_0x2ac7('0x17')],_0x5acfaf[_0x2ac7('0x1b')]))[_0x2ac7('0x9')](respondWithResult(_0x706db1,null))[_0x2ac7('0xe')](handleError(_0x706db1,null));};exports['voiceQueues']=function(_0x21d8ec,_0x1f94d2){return respondWithRpcPromise(_0x2ac7('0x1c'),_0x21d8ec['query'])[_0x2ac7('0x9')](respondWithResult(_0x1f94d2,null))[_0x2ac7('0xe')](handleError(_0x1f94d2,null));};exports[_0x2ac7('0x1d')]=function(_0x26f8c0,_0x5d162c){return respondWithRpcPromise(_0x2ac7('0x1c'),_0x26f8c0[_0x2ac7('0x17')])[_0x2ac7('0x9')](findById(_0x26f8c0['params']['id']))['then'](respondWithResult(_0x5d162c,null))[_0x2ac7('0xe')](handleError(_0x5d162c,null));};exports[_0x2ac7('0x1e')]=function(_0x5c9741,_0x1e6a3b){return respondWithRpcPromise(_0x2ac7('0x1f'),_[_0x2ac7('0x19')](_0x5c9741[_0x2ac7('0x17')],_0x5c9741['params']))[_0x2ac7('0x9')](respondWithResult(_0x1e6a3b,null))[_0x2ac7('0xe')](handleError(_0x1e6a3b,null));};exports[_0x2ac7('0x20')]=function(_0x1a1765,_0x5151e6){return respondWithRpcPromise(_0x2ac7('0x21'),_0x1a1765[_0x2ac7('0x17')])[_0x2ac7('0x9')](respondWithResult(_0x5151e6,null))[_0x2ac7('0xe')](handleError(_0x5151e6,null));};exports[_0x2ac7('0x22')]=function(_0x2fc600,_0x19a43a){return respondWithRpcPromise(_0x2ac7('0x23'),_[_0x2ac7('0x19')](_0x2fc600[_0x2ac7('0x17')],_0x2fc600['params']))[_0x2ac7('0x9')](respondWithResult(_0x19a43a,null))[_0x2ac7('0xe')](handleError(_0x19a43a,null));};exports[_0x2ac7('0x24')]=function(_0x1730ab,_0x4b3f46){return respondWithRpcPromise(_0x2ac7('0x25'),_[_0x2ac7('0x19')](_0x1730ab[_0x2ac7('0x17')],_0x1730ab[_0x2ac7('0x1b')]))[_0x2ac7('0x9')](respondWithResult(_0x4b3f46,null))['catch'](handleError(_0x4b3f46,null));};exports[_0x2ac7('0x26')]=function(_0x59779a,_0x1d01c7){return respondWithRpcPromise(_0x2ac7('0x27'),_['merge'](_0x59779a[_0x2ac7('0x17')],_0x59779a[_0x2ac7('0x1b')]))['then'](respondWithResult(_0x1d01c7,null))[_0x2ac7('0xe')](handleError(_0x1d01c7,null));};exports['outbound']=function(_0x59a11c,_0x5ce257){return respondWithRpcPromise(_0x2ac7('0x28'),_0x59a11c[_0x2ac7('0x17')])[_0x2ac7('0x9')](respondWithResult(_0x5ce257,null))[_0x2ac7('0xe')](handleError(_0x5ce257,null));};exports['outboundChannels']=function(_0x1d9bc9,_0x1b0131){return respondWithRpcPromise(_0x2ac7('0x29'),_0x1d9bc9[_0x2ac7('0x17')])['then'](respondWithResult(_0x1b0131,null))['catch'](handleError(_0x1b0131,null));};exports[_0x2ac7('0x2a')]=function(_0x1a360f,_0x2b6ab0){var _0x3c752c;return respondWithRpcPromise(_0x2ac7('0x2b'),_0x1a360f[_0x2ac7('0x17')])[_0x2ac7('0x9')](function(_0x5a6d06){_0x3c752c=_0x5a6d06;return respondWithRpcPromise(_0x2ac7('0x2b'),_0x1a360f['query'],routingClient);})[_0x2ac7('0x9')](function(_0x4f39bb){return _[_0x2ac7('0x19')]({},_0x4f39bb,_0x3c752c);})[_0x2ac7('0x9')](respondWithResult(_0x2b6ab0,null))['catch'](handleError(_0x2b6ab0,null));};exports[_0x2ac7('0x2c')]=function(_0x2a9315,_0x4142ae){if(_0x2a9315[_0x2ac7('0x2d')]&&_0x2a9315[_0x2ac7('0x2d')]['interaction']&&_0x2a9315['user']&&_0x2a9315[_0x2ac7('0x2e')][_0x2ac7('0x11')]){for(var _0x4a4758 in _0x2a9315['body'][_0x2ac7('0x2f')]){if(_0x2a9315['body'][_0x2ac7('0x2f')][_0x2ac7('0x30')](_0x4a4758)){db[_0x2ac7('0x31')][_0x2ac7('0x32')]({'where':{'channel':_0x4a4758,'membername':_0x2a9315[_0x2ac7('0x2e')][_0x2ac7('0x11')],'type':_0x2ac7('0x33'),'exitAt':null,'uniqueid':_0x2a9315[_0x2ac7('0x2d')]['interaction'][_0x4a4758]&&_0x2a9315[_0x2ac7('0x2d')]['interaction'][_0x4a4758][_0x2ac7('0x34')]?{'$notIn':_0x2a9315[_0x2ac7('0x2d')][_0x2ac7('0x2f')][_0x4a4758]}:{'$ne':null}}})[_0x2ac7('0x9')](function(_0x1d1633){var _0x523fb2=moment()[_0x2ac7('0x35')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x429352=0x0,_0x111043=_0x1d1633['length'];_0x429352<_0x111043;_0x429352+=0x1){_0x1d1633[_0x429352][_0x2ac7('0x36')]({'exitAt':_0x523fb2});}});for(var _0x51949b=0x0;_0x51949b<_0x2a9315['body']['interaction'][_0x4a4758]['length'];_0x51949b+=0x1){db[_0x2ac7('0x31')][_0x2ac7('0x37')]({'where':{'channel':_0x4a4758,'membername':_0x2a9315[_0x2ac7('0x2e')][_0x2ac7('0x11')],'type':_0x2ac7('0x33'),'uniqueid':_0x2a9315[_0x2ac7('0x2d')][_0x2ac7('0x2f')][_0x4a4758][_0x51949b],'exitAt':null},'defaults':{'channel':_0x4a4758,'membername':_0x2a9315['user'][_0x2ac7('0x11')],'interface':_[_0x2ac7('0x13')](_0x2a9315[_0x2ac7('0x2e')][_0x2ac7('0x38')])?util[_0x2ac7('0x35')](_0x2ac7('0x39'),_0x2a9315[_0x2ac7('0x2e')][_0x2ac7('0x11')]):_0x2a9315[_0x2ac7('0x2e')]['interface'],'type':_0x2ac7('0x33'),'enterAt':moment()['format'](_0x2ac7('0x3a')),'role':_0x2ac7('0x3b'),'internal':_0x2a9315['user'][_0x2ac7('0x3c')],'uniqueid':_0x2a9315['body'][_0x2ac7('0x2f')][_0x4a4758][_0x51949b]}});}}}}return respondWithRpcPromise(_0x2ac7('0x3d'),{'id':_0x2a9315[_0x2ac7('0x1b')]['id'],'capacity':_0x2a9315[_0x2ac7('0x2d')][_0x2ac7('0x3e')]},routingClient)['then'](respondWithResult(_0x4142ae,null))[_0x2ac7('0xe')](handleError(_0x4142ae,null));};exports[_0x2ac7('0x3f')]=function(_0x484be6,_0x4f866c){return respondWithRpcPromise(_0x2ac7('0x40'),_0x484be6['query'])[_0x2ac7('0x9')](respondWithResult(_0x4f866c,null))[_0x2ac7('0xe')](handleError(_0x4f866c,null));};exports[_0x2ac7('0x41')]=function(_0xed8823,_0x242d0d){return respondWithRpcPromise('Trunks',_0xed8823[_0x2ac7('0x17')])['then'](respondWithResult(_0x242d0d,null))['catch'](handleError(_0x242d0d,null));};exports[_0x2ac7('0x42')]=function(_0x45fef4,_0x428163){return respondWithRpcPromise(_0x2ac7('0x43'),_0x45fef4[_0x2ac7('0x17')])['then'](respondWithResult(_0x428163,null))[_0x2ac7('0xe')](handleError(_0x428163,null));};exports[_0x2ac7('0x44')]=function(_0x21ce3a,_0x1f478e){return respondWithRpcPromise('ChatQueues',_0x21ce3a[_0x2ac7('0x17')],routingClient)[_0x2ac7('0x9')](respondWithResult(_0x1f478e,null))[_0x2ac7('0xe')](handleError(_0x1f478e,null));};exports[_0x2ac7('0x45')]=function(_0x2a44fa,_0x5a338){return respondWithRpcPromise(_0x2ac7('0x46'),_0x2a44fa[_0x2ac7('0x17')],routingClient)[_0x2ac7('0x9')](findById(_0x2a44fa[_0x2ac7('0x1b')]['id']))[_0x2ac7('0x9')](respondWithResult(_0x5a338,null))[_0x2ac7('0xe')](handleError(_0x5a338,null));};exports[_0x2ac7('0x47')]=function(_0x13e0fb,_0x37f57d){return respondWithRpcPromise('MailQueues',_0x13e0fb[_0x2ac7('0x17')],routingClient)[_0x2ac7('0x9')](respondWithResult(_0x37f57d,null))[_0x2ac7('0xe')](handleError(_0x37f57d,null));};exports[_0x2ac7('0x48')]=function(_0x3675ba,_0x3e0004){return respondWithRpcPromise(_0x2ac7('0x49'),_0x3675ba[_0x2ac7('0x17')],routingClient)['then'](findById(_0x3675ba['params']['id']))[_0x2ac7('0x9')](respondWithResult(_0x3e0004,null))[_0x2ac7('0xe')](handleError(_0x3e0004,null));};exports['mailAccounts']=function(_0x13dbe6,_0x155b68){return respondWithRpcPromise('MailAccounts',_0x13dbe6[_0x2ac7('0x17')],mailClient)[_0x2ac7('0x9')](respondWithResult(_0x155b68,null))[_0x2ac7('0xe')](handleError(_0x155b68,null));};exports[_0x2ac7('0x4a')]=function(_0x3b90c6,_0x45a83c){return respondWithRpcPromise(_0x2ac7('0x4b'),_0x3b90c6[_0x2ac7('0x17')],routingClient)[_0x2ac7('0x9')](respondWithResult(_0x45a83c,null))[_0x2ac7('0xe')](handleError(_0x45a83c,null));};exports[_0x2ac7('0x4c')]=function(_0x579da9,_0xda6813){return respondWithRpcPromise('OpenchannelQueues',_0x579da9[_0x2ac7('0x17')],routingClient)[_0x2ac7('0x9')](findById(_0x579da9[_0x2ac7('0x1b')]['id']))[_0x2ac7('0x9')](respondWithResult(_0xda6813,null))[_0x2ac7('0xe')](handleError(_0xda6813,null));};exports[_0x2ac7('0x4d')]=function(_0x78f118,_0x5541fd){return respondWithRpcPromise('SmsQueues',_0x78f118[_0x2ac7('0x17')],routingClient)[_0x2ac7('0x9')](respondWithResult(_0x5541fd,null))[_0x2ac7('0xe')](handleError(_0x5541fd,null));};exports[_0x2ac7('0x4e')]=function(_0x7ab662,_0x370a40){return respondWithRpcPromise(_0x2ac7('0x4f'),_0x7ab662['query'],routingClient)['then'](findById(_0x7ab662[_0x2ac7('0x1b')]['id']))[_0x2ac7('0x9')](respondWithResult(_0x370a40,null))[_0x2ac7('0xe')](handleError(_0x370a40,null));};exports[_0x2ac7('0x50')]=function(_0x4a7569,_0x4fa2b9){return respondWithRpcPromise(_0x2ac7('0x51'),_0x4a7569[_0x2ac7('0x17')],routingClient)[_0x2ac7('0x9')](respondWithResult(_0x4fa2b9,null))[_0x2ac7('0xe')](handleError(_0x4fa2b9,null));};exports[_0x2ac7('0x52')]=function(_0x579530,_0x57f7d5){return respondWithRpcPromise(_0x2ac7('0x51'),_0x579530[_0x2ac7('0x17')],routingClient)[_0x2ac7('0x9')](findById(_0x579530[_0x2ac7('0x1b')]['id']))[_0x2ac7('0x9')](respondWithResult(_0x57f7d5,null))[_0x2ac7('0xe')](handleError(_0x57f7d5,null));};exports['faxAccounts']=function(_0x3667e2,_0x1e1d56){return respondWithRpcPromise('FaxAccounts',_0x3667e2['query'])[_0x2ac7('0x9')](respondWithResult(_0x1e1d56,null))[_0x2ac7('0xe')](handleError(_0x1e1d56,null));};exports[_0x2ac7('0x53')]=function(_0x2318b2,_0x29155f){return respondWithRpcPromise(_0x2ac7('0x54'),_0x2318b2[_0x2ac7('0x17')],routingClient)[_0x2ac7('0x9')](respondWithResult(_0x29155f,null))[_0x2ac7('0xe')](handleError(_0x29155f,null));};exports['mailQueuesWaitingInteractions']=function(_0x3b99a0,_0x6462f2){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x3b99a0[_0x2ac7('0x17')],routingClient)['then'](respondWithResult(_0x6462f2,null))['catch'](handleError(_0x6462f2,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x341a7a,_0x10f70c){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x341a7a[_0x2ac7('0x17')],routingClient)['then'](respondWithResult(_0x10f70c,null))['catch'](handleError(_0x10f70c,null));};exports[_0x2ac7('0x55')]=function(_0x40be47,_0x137051){return respondWithRpcPromise(_0x2ac7('0x56'),_0x40be47[_0x2ac7('0x17')],routingClient)[_0x2ac7('0x9')](respondWithResult(_0x137051,null))[_0x2ac7('0xe')](handleError(_0x137051,null));};exports[_0x2ac7('0x57')]=function(_0x3eaa33,_0x31b4db){return respondWithRpcPromise(_0x2ac7('0x58'),_0x3eaa33[_0x2ac7('0x17')],routingClient)[_0x2ac7('0x9')](respondWithResult(_0x31b4db,null))[_0x2ac7('0xe')](handleError(_0x31b4db,null));};exports[_0x2ac7('0x59')]=function(_0x233ce2){return function(_0x4d1965,_0x16e675){var _0x10af9f,_0x29810c;var _0x4d5cae=_[_0x2ac7('0x5a')](_0x233ce2);var _0x253e40=_0x233ce2==='chat'?_0x2ac7('0x5b'):_0x2ac7('0x5c');return db[_0x4d5cae+_0x2ac7('0x5d')]['findOne']({'raw':!![],'where':{'id':_0x4d1965['params']['id']}})[_0x2ac7('0x9')](function(_0x54136b){if(_[_0x2ac7('0x13')](_0x54136b)){throw new Error(_0x4d5cae+_0x2ac7('0x5e'));}_0x10af9f=_0x54136b;return db[_0x4d5cae+'Message'][_0x2ac7('0x5f')]({'where':{'id':_0x4d1965[_0x2ac7('0x2d')][_0x2ac7('0x60')]},'include':[{'model':db[_0x4d5cae+_0x2ac7('0x61')],'as':'Interaction'},{'model':db[_0x4d5cae+_0x253e40],'as':_0x2ac7('0x5c')}]});})[_0x2ac7('0x9')](function(_0x5d6ec0){if(_[_0x2ac7('0x13')](_0x5d6ec0)){throw new Error(_0x4d5cae+'\x20Message\x20not\x20found');}_0x29810c=_0x5d6ec0;return _0x5d6ec0[_0x2ac7('0x62')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x10fb6e={'uniqueid':_0x233ce2+'.'+_0x29810c['id']+'.'+_0x29810c[_0x2ac7('0x61')]['id'],'FromUserId':_0x4d1965[_0x2ac7('0x2e')]['id'],'type':_0x2ac7('0x63')};_0x10fb6e[_0x4d5cae+_0x2ac7('0x64')]=_0x29810c['id'];_0x10fb6e[_0x4d5cae+_0x2ac7('0x65')]=_0x29810c['Interaction']['id'];_0x10fb6e[_0x2ac7('0x66')+_0x4d5cae+_0x253e40+'Id']=_0x29810c[_0x2ac7('0x5c')]['id'];_0x10fb6e['To'+_0x4d5cae+_0x2ac7('0x67')]=_0x10af9f['id'];return db[_0x4d5cae+_0x2ac7('0x68')]['create'](_0x10fb6e);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x233ce2,'interaction':_0x29810c[_0x2ac7('0x61')],'message':_0x29810c,'account':_0x29810c[_0x2ac7('0x5c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x2ac7('0x63'),'appdata':_0x10af9f[_0x2ac7('0x11')]+','+(_0x29810c[_0x2ac7('0x5c')][_0x2ac7('0x69')]||0x12c),'interval':_0x2ac7('0x6a')}]},routingClient);})['then'](respondWithResult(_0x16e675,null))[_0x2ac7('0xe')](handleError(_0x16e675,null));};};exports[_0x2ac7('0x6b')]=function(_0x1e0b45,_0x276fbf){var _0x3e5ad7,_0x2bbbd1;if(_['isNil'](_0x1e0b45[_0x2ac7('0x2d')]['channel'])){throw new Error(_0x2ac7('0x6c'));}var _0x27814f=_0x1e0b45['body']['channel'];var _0x208409=_['capitalize'](_0x27814f);var _0x17ea62=_0x27814f==='chat'?_0x2ac7('0x5b'):_0x2ac7('0x5c');return db['User']['findOne']({'raw':!![],'where':{'id':_0x1e0b45[_0x2ac7('0x1b')]['id'],'role':_0x2ac7('0x3b')}})[_0x2ac7('0x9')](function(_0x10c0a9){if(_[_0x2ac7('0x13')](_0x10c0a9)){throw new Error(_0x2ac7('0x6d'));}_0x3e5ad7=_0x10c0a9;return db[_0x208409+_0x2ac7('0x6e')][_0x2ac7('0x5f')]({'where':{'id':_0x1e0b45[_0x2ac7('0x2d')]['messageId']},'include':[{'model':db[_0x208409+'Interaction'],'as':_0x2ac7('0x61')},{'model':db[_0x208409+_0x17ea62],'as':_0x2ac7('0x5c')}]});})[_0x2ac7('0x9')](function(_0x3cf331){if(_[_0x2ac7('0x13')](_0x3cf331)){throw new Error(_0x208409+_0x2ac7('0x6f'));}_0x2bbbd1=_0x3cf331;return _0x3cf331['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x2ac7('0x9')](function(){var _0x5c8600={'uniqueid':_0x27814f+'.'+_0x2bbbd1['id']+'.'+_0x2bbbd1[_0x2ac7('0x61')]['id'],'FromUserId':_0x1e0b45[_0x2ac7('0x2e')]['id'],'type':_0x2ac7('0x63'),'ToUserId':_0x3e5ad7['id']};_0x5c8600[_0x208409+'MessageId']=_0x2bbbd1['id'];_0x5c8600[_0x208409+_0x2ac7('0x65')]=_0x2bbbd1[_0x2ac7('0x61')]['id'];_0x5c8600[_0x2ac7('0x66')+_0x208409+_0x17ea62+'Id']=_0x2bbbd1[_0x2ac7('0x5c')]['id'];return db[_0x208409+_0x2ac7('0x68')][_0x2ac7('0x70')](_0x5c8600);})[_0x2ac7('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0x27814f,'interaction':_0x2bbbd1[_0x2ac7('0x61')],'message':_0x2bbbd1,'account':_0x2bbbd1[_0x2ac7('0x5c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x2ac7('0x3b'),'appdata':_0x3e5ad7[_0x2ac7('0x11')]+','+(_0x2bbbd1[_0x2ac7('0x5c')][_0x2ac7('0x71')]||0x12c),'interval':_0x2ac7('0x6a')}]},routingClient);})[_0x2ac7('0x9')](respondWithResult(_0x276fbf,null))[_0x2ac7('0xe')](handleError(_0x276fbf,null));}; \ No newline at end of file diff --git a/server/api/saAsset/index.js b/server/api/saAsset/index.js index 2392d95..1981172 100644 --- a/server/api/saAsset/index.js +++ b/server/api/saAsset/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32ef=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','getSubscriptions','/:id','post','create','/:id/automaticSubscriptionInvoiceAlignment','automaticSubscriptionInvoiceAlignment','/:id/automaticSubscriptionInvoice','automaticSubscriptionInvoice','update','delete','exports','multer','util','path','connect-timeout'];(function(_0xb6da2d,_0x9dbbba){var _0x155572=function(_0x2ebdd3){while(--_0x2ebdd3){_0xb6da2d['push'](_0xb6da2d['shift']());}};_0x155572(++_0x9dbbba);}(_0x32ef,0xf9));var _0xf32e=function(_0x28892f,_0x52ece8){_0x28892f=_0x28892f-0x0;var _0x31bc71=_0x32ef[_0x28892f];return _0x31bc71;};'use strict';var multer=require(_0xf32e('0x0'));var util=require(_0xf32e('0x1'));var path=require(_0xf32e('0x2'));var timeout=require(_0xf32e('0x3'));var express=require(_0xf32e('0x4'));var router=express[_0xf32e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xf32e('0x6'));var config=require(_0xf32e('0x7'));var controller=require('./saAsset.controller');router[_0xf32e('0x8')]('/',auth[_0xf32e('0x9')](),controller[_0xf32e('0xa')]);router[_0xf32e('0x8')](_0xf32e('0xb'),auth[_0xf32e('0x9')](),controller['describe']);router[_0xf32e('0x8')]('/getSubscriptions',auth[_0xf32e('0x9')](),controller[_0xf32e('0xc')]);router[_0xf32e('0x8')](_0xf32e('0xd'),auth[_0xf32e('0x9')](),controller['show']);router[_0xf32e('0xe')]('/',auth[_0xf32e('0x9')](),controller[_0xf32e('0xf')]);router[_0xf32e('0xe')](_0xf32e('0x10'),auth[_0xf32e('0x9')](),controller[_0xf32e('0x11')]);router[_0xf32e('0xe')](_0xf32e('0x12'),auth[_0xf32e('0x9')](),controller[_0xf32e('0x13')]);router['put'](_0xf32e('0xd'),auth[_0xf32e('0x9')](),controller[_0xf32e('0x14')]);router[_0xf32e('0x15')](_0xf32e('0xd'),auth[_0xf32e('0x9')](),controller['destroy']);module[_0xf32e('0x16')]=router; \ No newline at end of file +var _0xaa48=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saAsset.controller','get','isAuthenticated','index','/describe','describe','/getSubscriptions','getSubscriptions','show','create','post','/:id/automaticSubscriptionInvoiceAlignment','automaticSubscriptionInvoiceAlignment','/:id/automaticSubscriptionInvoice','automaticSubscriptionInvoice','update','delete','/:id','destroy','exports','multer','util'];(function(_0x26cf77,_0x183d5c){var _0x58b93f=function(_0x2161bf){while(--_0x2161bf){_0x26cf77['push'](_0x26cf77['shift']());}};_0x58b93f(++_0x183d5c);}(_0xaa48,0x15a));var _0x8aa4=function(_0x2a60c0,_0x26cbeb){_0x2a60c0=_0x2a60c0-0x0;var _0x4a8424=_0xaa48[_0x2a60c0];return _0x4a8424;};'use strict';var multer=require(_0x8aa4('0x0'));var util=require(_0x8aa4('0x1'));var path=require(_0x8aa4('0x2'));var timeout=require(_0x8aa4('0x3'));var express=require(_0x8aa4('0x4'));var router=express[_0x8aa4('0x5')]();var auth=require(_0x8aa4('0x6'));var interaction=require(_0x8aa4('0x7'));var config=require(_0x8aa4('0x8'));var controller=require(_0x8aa4('0x9'));router[_0x8aa4('0xa')]('/',auth[_0x8aa4('0xb')](),controller[_0x8aa4('0xc')]);router[_0x8aa4('0xa')](_0x8aa4('0xd'),auth[_0x8aa4('0xb')](),controller[_0x8aa4('0xe')]);router[_0x8aa4('0xa')](_0x8aa4('0xf'),auth['isAuthenticated'](),controller[_0x8aa4('0x10')]);router[_0x8aa4('0xa')]('/:id',auth[_0x8aa4('0xb')](),controller[_0x8aa4('0x11')]);router['post']('/',auth[_0x8aa4('0xb')](),controller[_0x8aa4('0x12')]);router[_0x8aa4('0x13')](_0x8aa4('0x14'),auth[_0x8aa4('0xb')](),controller[_0x8aa4('0x15')]);router[_0x8aa4('0x13')](_0x8aa4('0x16'),auth[_0x8aa4('0xb')](),controller[_0x8aa4('0x17')]);router['put']('/:id',auth[_0x8aa4('0xb')](),controller[_0x8aa4('0x18')]);router[_0x8aa4('0x19')](_0x8aa4('0x1a'),auth[_0x8aa4('0xb')](),controller[_0x8aa4('0x1b')]);module[_0x8aa4('0x1c')]=router; \ No newline at end of file diff --git a/server/api/saAsset/saAsset.attributes.js b/server/api/saAsset/saAsset.attributes.js index 845036b..6b57c4b 100644 --- a/server/api/saAsset/saAsset.attributes.js +++ b/server/api/saAsset/saAsset.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe493=['STRING','INTEGER','TEXT','long','DECIMAL','BOOLEAN','sequelize','exports'];(function(_0x1151c7,_0x8bce58){var _0x460427=function(_0x45456d){while(--_0x45456d){_0x1151c7['push'](_0x1151c7['shift']());}};_0x460427(++_0x8bce58);}(_0xe493,0x7e));var _0x3e49=function(_0x5962a5,_0x474081){_0x5962a5=_0x5962a5-0x0;var _0x3a489a=_0xe493[_0x5962a5];return _0x3a489a;};'use strict';var Sequelize=require(_0x3e49('0x0'));module[_0x3e49('0x1')]={'companyName':{'type':Sequelize[_0x3e49('0x2')]},'companyId':{'type':Sequelize[_0x3e49('0x3')]},'productName':{'type':Sequelize[_0x3e49('0x4')],'allowNull':![]},'productCode':{'type':Sequelize['STRING'],'allowNull':![]},'productDescription':{'type':Sequelize[_0x3e49('0x4')](_0x3e49('0x5'))+'\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci'},'typeName':{'type':Sequelize[_0x3e49('0x2')]},'pricelistName':{'type':Sequelize['TEXT']},'pricelistId':{'type':Sequelize[_0x3e49('0x4')]},'netPrice':{'type':Sequelize[_0x3e49('0x6')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize[_0x3e49('0x6')](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize[_0x3e49('0x6')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x3e49('0x2')]},'note':{'type':Sequelize[_0x3e49('0x4')]},'dateLastInvoice':{'type':Sequelize['DATE']},'dateNextInvoice':{'type':Sequelize['DATE']},'subscriptionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'subscriptionName':{'type':Sequelize[_0x3e49('0x2')],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0x3e49('0x3')],'allowNull':![]},'deleted':{'type':Sequelize[_0x3e49('0x7')]},'status':{'type':Sequelize[_0x3e49('0x2')]}}; \ No newline at end of file +var _0x0439=['INTEGER','TEXT','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','DECIMAL','DATE','sequelize','exports','STRING'];(function(_0x2fabb1,_0x43be31){var _0xe63267=function(_0x3d477f){while(--_0x3d477f){_0x2fabb1['push'](_0x2fabb1['shift']());}};_0xe63267(++_0x43be31);}(_0x0439,0xdd));var _0x9043=function(_0x4dc00b,_0x229642){_0x4dc00b=_0x4dc00b-0x0;var _0x38a107=_0x0439[_0x4dc00b];return _0x38a107;};'use strict';var Sequelize=require(_0x9043('0x0'));module[_0x9043('0x1')]={'companyName':{'type':Sequelize[_0x9043('0x2')]},'companyId':{'type':Sequelize[_0x9043('0x3')]},'productName':{'type':Sequelize[_0x9043('0x4')],'allowNull':![]},'productCode':{'type':Sequelize[_0x9043('0x2')],'allowNull':![]},'productDescription':{'type':Sequelize[_0x9043('0x4')]('long')+_0x9043('0x5')},'typeName':{'type':Sequelize[_0x9043('0x2')]},'pricelistName':{'type':Sequelize[_0x9043('0x4')]},'pricelistId':{'type':Sequelize['TEXT']},'netPrice':{'type':Sequelize[_0x9043('0x6')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize['DECIMAL'](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x9043('0x2')]},'note':{'type':Sequelize[_0x9043('0x4')]},'dateLastInvoice':{'type':Sequelize['DATE']},'dateNextInvoice':{'type':Sequelize[_0x9043('0x7')]},'subscriptionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'subscriptionName':{'type':Sequelize[_0x9043('0x2')],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0x9043('0x3')],'allowNull':![]},'deleted':{'type':Sequelize['BOOLEAN']},'status':{'type':Sequelize[_0x9043('0x2')]}}; \ No newline at end of file diff --git a/server/api/saAsset/saAsset.controller.js b/server/api/saAsset/saAsset.controller.js index 179047f..36c0978 100644 --- a/server/api/saAsset/saAsset.controller.js +++ b/server/api/saAsset/saAsset.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['error','stack','name','send','index','SAAsset','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','options','create','body','find','params','describe','getSubscriptions','nolimit','findAll','CONCAT\x20(`companyName`,\x22\x20\x22,`pricelistName`,\x22\x20\x22,`subscriptionName`)\x20as\x20SubscriptionName,DATEDIFF\x20(`dateNextInvoice`,NOW())\x20as\x20Expired,`subscriptionId`,`companyName`,`companyId`,`pricelistName`,`pricelistId`,`subscriptionName`,`dateNextInvoice`,SUM(`netPrice`\x20-\x20(`netPrice`\x20/\x20100\x20*\x20`discount`))\x20as\x20TotalNetPrice,SUM((`netPrice`\x20-\x20(`netPrice`\x20/\x20100\x20*\x20`discount`))\x20/\x20100\x20*\x20`tax`)\x20as\x20TotalTax','companyName','companyId','pricelistId','subscriptionName','automaticSubscriptionInvoiceAlignment','sequelize','transaction','CmCompany','findOne','DESC','subscriptionId','groupBy','log','automaticSubscriptionInvoice\x20productForCompany->','push','Partial','all','SequelizeUniqueConstraintError','Duplicate\x20entry.','??????\x20invoiceType','??????\x20updSubscriptionDetail\x20product.id->','dateNextInvoice','subscriptionMonthly','months','System','productDescription','typeName','pricelistName','netPrice','discount','quantity','SAInvoiceDetail','SAPaymentMethod','saPaymentMethod','Invoice\x20','Automatic\x20Job','close','saStreet','saCountry','saISOCode','saPIVA','saFiscalMessage','saExpiryDay','saEurope','saSocCap','saPostalCode','saCity','saFiscalCode','saSDICode','bankAccount','bankName','bankpostalCode','bankcity','bankBICSWIFT','bankIBAN','phone','fax','email','website','bankABI','paypalEmail','productCode','negate','isNull','mapValues','createdAt','value','abs','diff','diffDay','total','££££££££\x20products','forEach','Total','WARNING','No\x20product\x20to\x20assign\x20invoice.\x20Invoice\x20not\x20created!!\x20','sendStatus','TCL:\x20exports.automaticProformaInvoice\x20->\x20err','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'];(function(_0x78929c,_0x529d2f){var _0x1c1c5c=function(_0x5c097b){while(--_0x5c097b){_0x78929c['push'](_0x78929c['shift']());}};_0x1c1c5c(++_0x529d2f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1597e2,_0x388d3e){_0x1597e2=_0x1597e2-0x0;var _0x4c8c0a=_0xcb91[_0x1597e2];return _0x4c8c0a;};'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['SAAsset']['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['SAAsset'][_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));};exports[_0x1cb9('0x46')]=function(_0x1b750d,_0x3561a5){return db[_0x1cb9('0x27')][_0x1cb9('0x46')]()[_0x1cb9('0x21')](respondWithResult(_0x3561a5,null))[_0x1cb9('0x3e')](handleError(_0x3561a5,null));};exports[_0x1cb9('0x47')]=function(_0x17f10e,_0x48dd4a){var _0x5092a6=qs[_0x1cb9('0x31')](_0x17f10e[_0x1cb9('0x2b')][_0x1cb9('0x31')]);if(!_0x17f10e[_0x1cb9('0x2b')][_0x1cb9('0x2f')](_0x1cb9('0x48'))){var _0x367dd7=qs[_0x1cb9('0x19')](_0x17f10e[_0x1cb9('0x2b')][_0x1cb9('0x19')]);var _0x4a4b87=qs[_0x1cb9('0x18')](_0x17f10e['query'][_0x1cb9('0x18')]);}return db['SAAsset'][_0x1cb9('0x49')]({'attributes':[db['sequelize']['literal'](_0x1cb9('0x4a'))],'group':[_0x1cb9('0x4b'),_0x1cb9('0x4c'),'pricelistName',_0x1cb9('0x4d'),_0x1cb9('0x4e'),'subscriptionId','dateNextInvoice'],'order':_0x5092a6,'limit':_0x367dd7,'offset':_0x4a4b87,'raw':!![]})[_0x1cb9('0x21')](function(_0x1a0314){return{'count':_0x1a0314[_0x1cb9('0x2e')],'rows':_0x1a0314};})[_0x1cb9('0x21')](handleEntityNotFound(_0x48dd4a,null))[_0x1cb9('0x21')](respondWithResult(_0x48dd4a,null))[_0x1cb9('0x3e')](handleError(_0x48dd4a,null));};exports[_0x1cb9('0x4f')]=function(_0x5912f9,_0x345ddd,_0x2607c7){var _0x108551;if(_0x5912f9['body']['id']){delete _0x5912f9[_0x1cb9('0x43')]['id'];}return db[_0x1cb9('0x50')][_0x1cb9('0x51')](function(_0xf6eb2d){return db[_0x1cb9('0x52')][_0x1cb9('0x53')]({'where':{'defaultEntry':0x1},'raw':!![]})['then'](function(_0x37ceb5){_0x108551=_0x37ceb5;return db[_0x1cb9('0x27')][_0x1cb9('0x49')]({'where':{'dateLastInvoice':null,'deleted':null},'order':[[_0x1cb9('0x4c'),_0x1cb9('0x54')],[_0x1cb9('0x4d'),_0x1cb9('0x54')],[_0x1cb9('0x55'),_0x1cb9('0x54')]],'raw':!![]});})[_0x1cb9('0x21')](function(_0x370c97){if(_0x370c97['length']>0x0){var _0xfc39e1=[];var _0xb4c211=_[_0x1cb9('0x56')](_0x370c97,_0x1cb9('0x4c'));Object['keys'](_0xb4c211)['forEach'](function(_0x319358){var _0x2f8f27=_0xb4c211[_0x319358];console[_0x1cb9('0x57')](_0x1cb9('0x58'),_0x2f8f27);_0xfc39e1[_0x1cb9('0x59')](addSubscriptionInvoice(_0x2f8f27,_0x108551,_0x319358,_0x1cb9('0x5a'),_0xf6eb2d));});return BPromise[_0x1cb9('0x5b')](_0xfc39e1);}else{var _0xd010a9={'errors':[{'type':'INFO','message':'No\x20invoice.\x20Invoice\x20expired!!\x20'}]};throw _0xd010a9;}});})[_0x1cb9('0x21')](function(){return _0x345ddd['sendStatus'](0xc8);})['catch'](function(_0x4ca5bc){console['log']('TCL:\x20exports.automaticProformaInvoice\x20->\x20err',_0x4ca5bc);if(_0x4ca5bc[_0x1cb9('0x24')]===_0x1cb9('0x5c')){var _0x4ca5bc={'errors':[{'message':_0x1cb9('0x5d')}]};}_0x345ddd[_0x1cb9('0x1a')](0x1f4)[_0x1cb9('0x25')](_0x4ca5bc);});};function updSubscriptionDetail(_0x54f008,_0x27d7ef,_0x3e1207){console['log']('??????\x20updSubscriptionDetail\x20product->',_0x54f008);console[_0x1cb9('0x57')](_0x1cb9('0x5e'),_0x27d7ef);console[_0x1cb9('0x57')](_0x1cb9('0x5f'),_0x54f008['id']);console[_0x1cb9('0x57')]('??????\x20updSubscriptionDetail\x20product.dateNextInvoice->',_0x54f008['dateNextInvoice']);var _0x5eb0ad;var _0x270282;if(_0x27d7ef===_0x1cb9('0x5a')){_0x5eb0ad=moment();_0x270282=_0x54f008[_0x1cb9('0x60')];}else{_0x5eb0ad=_0x54f008[_0x1cb9('0x60')];_0x270282=moment(_0x54f008[_0x1cb9('0x60')])['add'](_0x54f008[_0x1cb9('0x61')],_0x1cb9('0x62'));}console['log']('lastInvoice',_0x5eb0ad);console[_0x1cb9('0x57')]('nextInvoice',_0x270282);return db[_0x1cb9('0x27')][_0x1cb9('0x1f')]({'dateLastInvoice':_0x5eb0ad,'dateNextInvoice':_0x270282,'agentFullname':_0x1cb9('0x63')},{'where':{'id':_0x54f008['id']},'raw':!![],'transaction':_0x3e1207})[_0x1cb9('0x3e')](function(_0x3619a2){throw _0x3619a2;});}function addSubscriptionInvoiceDetail(_0x398779,_0x4aeeff,_0xde0d93){var _0x15fc04={'companyName':_0x398779[_0x1cb9('0x4b')],'companyId':_0x398779[_0x1cb9('0x4c')],'productName':_0x398779['productName'],'productCode':_0x398779['productCode'],'productDescription':_0x398779[_0x1cb9('0x64')],'typeName':_0x398779[_0x1cb9('0x65')],'pricelistName':_0x398779[_0x1cb9('0x66')],'priceListId':_0x398779[_0x1cb9('0x4d')],'netPrice':_0x398779[_0x1cb9('0x67')],'discount':_0x398779[_0x1cb9('0x68')],'tax':_0x398779['tax'],'agentFullname':_0x1cb9('0x63'),'note':_0x398779['note'],'subscriptionId':_0x398779[_0x1cb9('0x55')],'subscriptionName':_0x398779[_0x1cb9('0x4e')],'subscriptionMonthly':_0x398779['subscriptionMonthly'],'quantity':_0x398779[_0x1cb9('0x69')],'InvoiceId':_0x4aeeff['id']};return db[_0x1cb9('0x6a')][_0x1cb9('0x42')](_0x15fc04,{'raw':!![],'transaction':_0xde0d93})['catch'](function(_0x1b4878){throw _0x1b4878;});}function addSubscriptionInvoice(_0x95be29,_0x306abf,_0x16c6cb,_0x43665c,_0x25c5bc){return db['CmCompany'][_0x1cb9('0x53')]({'where':{'id':_0x16c6cb},'raw':!![]})[_0x1cb9('0x21')](function(_0x38d6a7){return db[_0x1cb9('0x6b')][_0x1cb9('0x53')]({'where':{'id':_0x38d6a7[_0x1cb9('0x6c')]},'raw':!![]})[_0x1cb9('0x21')](function(_0x37bcd9){var _0x4cd544={'name':_0x1cb9('0x6d')+moment()+'_'+_0x43665c,'note':_0x1cb9('0x6e'),'agentFullname':'System','status':_0x1cb9('0x6f'),'companyName':_0x38d6a7['name'],'companyId':_0x38d6a7['id'],'paid':0x0,'discount':0x0,'receivingStreet':_0x38d6a7[_0x1cb9('0x70')],'receivingPostalCode':_0x38d6a7['saPostalCode'],'receivingCity':_0x38d6a7['saCity'],'receivingCountry':_0x38d6a7[_0x1cb9('0x71')],'receivingISOCode':_0x38d6a7[_0x1cb9('0x72')],'receivingFiscalCode':_0x38d6a7['saFiscalCode'],'receivingPIVA':_0x38d6a7[_0x1cb9('0x73')],'receivingSDICode':_0x38d6a7['saSDICode'],'receivingFiscalMessage':_0x38d6a7[_0x1cb9('0x74')],'receivingExpiryDay':_0x38d6a7[_0x1cb9('0x75')],'receivingEurope':_0x38d6a7[_0x1cb9('0x76')],'receivingSocCap':_0x38d6a7[_0x1cb9('0x77')],'issuerName':_0x306abf['name'],'issuerStreet':_0x306abf[_0x1cb9('0x70')],'issuerPostalCode':_0x306abf[_0x1cb9('0x78')],'issuerCity':_0x306abf[_0x1cb9('0x79')],'issuerCountry':_0x306abf[_0x1cb9('0x71')],'issuerISOCode':_0x306abf[_0x1cb9('0x72')],'issuerFiscalCode':_0x306abf[_0x1cb9('0x7a')],'issuerPIVA':_0x306abf['saPIVA'],'issuerSDICode':_0x306abf[_0x1cb9('0x7b')],'issuerFiscalMessage':_0x306abf[_0x1cb9('0x74')],'issuerExpiryDay':_0x306abf[_0x1cb9('0x75')],'issuerSocCap':_0x306abf[_0x1cb9('0x77')],'issuerBankAccount':_0x37bcd9[_0x1cb9('0x7c')],'issuerBankName':_0x37bcd9[_0x1cb9('0x7d')],'issuerBankStreet':_0x37bcd9['bankstreet'],'issuerBankPostalCode':_0x37bcd9[_0x1cb9('0x7e')],'issuerBankCity':_0x37bcd9[_0x1cb9('0x7f')],'issuerBankCountry':_0x37bcd9['bankcountry'],'issuerBankBICSWIFT':_0x37bcd9[_0x1cb9('0x80')],'issuerBankIBAN':_0x37bcd9[_0x1cb9('0x81')],'issuerPhone':_0x306abf[_0x1cb9('0x82')],'issuerFax':_0x306abf[_0x1cb9('0x83')],'issuerEmail':_0x306abf[_0x1cb9('0x84')],'issuerWeb':_0x306abf[_0x1cb9('0x85')],'issuerABI':_0x37bcd9[_0x1cb9('0x86')],'issuerCAB':_0x37bcd9['banckCAB'],'issuerPayPal':_0x37bcd9[_0x1cb9('0x87')]};return db['SAInvoice'][_0x1cb9('0x42')](_0x4cd544,{'transaction':_0x25c5bc})[_0x1cb9('0x21')](function(_0x50dd60){var _0x37ba21=[];for(var _0x114255=0x0;_0x114255<_0x95be29[_0x1cb9('0x2e')];_0x114255++){_0x37ba21[_0x1cb9('0x59')](updSubscriptionDetail(_0x95be29[_0x114255],_0x43665c,_0x25c5bc));}var _0x56f23d=[_0x1cb9('0x88'),_0x1cb9('0x4d'),_0x1cb9('0x55'),'netPrice'];_(_0x95be29)[_0x1cb9('0x56')](function(_0xe3ee8e){return _[_0x1cb9('0x44')](_[_0x1cb9('0x34')](_0xe3ee8e,_0x56f23d),_[_0x1cb9('0x89')](_[_0x1cb9('0x8a')]));})[_0x1cb9('0x8b')](function(_0x4884cf){var _0xebae61=_0x4884cf[0x0];_0xebae61['quantity']=_0x4884cf[_0x1cb9('0x2e')];if(_0x43665c===_0x1cb9('0x5a')){_0xebae61[_0x1cb9('0x67')]=computePrice(_0xebae61[_0x1cb9('0x8c')],_0xebae61['dateNextInvoice'],_0xebae61[_0x1cb9('0x67')],_0xebae61[_0x1cb9('0x61')]);}_0x37ba21['push'](addSubscriptionInvoiceDetail(_0xebae61,_0x50dd60,_0x25c5bc));})[_0x1cb9('0x8d')]();return BPromise[_0x1cb9('0x5b')](_0x37ba21);});});})[_0x1cb9('0x3e')](function(_0x27532a){console[_0x1cb9('0x57')]('TCL:\x20exports.automaticProformaInvoice\x20->\x20err',_0x27532a);throw _0x27532a;});}function computePrice(_0x5e0e56,_0x544d2d,_0x5ad853,_0x19daa1){var _0x175e87=_0x5ad853;console[_0x1cb9('0x57')](_0x1cb9('0x8c'),_0x5e0e56);console[_0x1cb9('0x57')](_0x1cb9('0x60'),_0x544d2d);console[_0x1cb9('0x57')](_0x1cb9('0x61'),_0x19daa1);console['log'](_0x1cb9('0x67'),_0x5ad853);if(_0x19daa1!=0x0){var _0x18f51e=moment(_0x5e0e56);var _0x3f5b31=moment(_0x544d2d);var _0x5eff1e=Math[_0x1cb9('0x8e')](_0x18f51e[_0x1cb9('0x8f')](_0x3f5b31,'days'));console[_0x1cb9('0x57')](_0x1cb9('0x90'),_0x5eff1e);var _0x887adc=_0x5ad853/(0x1e*_0x19daa1);console[_0x1cb9('0x57')]('dayPrice',_0x887adc);_0x175e87=_0x887adc*_0x5eff1e;}console[_0x1cb9('0x57')](_0x1cb9('0x91'),_0x175e87);return _0x175e87;}exports['automaticSubscriptionInvoice']=function(_0x5bd78d,_0x1f2d69,_0x3ba0a5){var _0x4deff1;if(_0x5bd78d['body']['id']){delete _0x5bd78d[_0x1cb9('0x43')]['id'];}return db[_0x1cb9('0x50')]['transaction'](function(_0x4d6021){return db[_0x1cb9('0x52')]['findOne']({'where':{'defaultEntry':0x1},'raw':!![]})['then'](function(_0x548fc3){_0x4deff1=_0x548fc3;return db[_0x1cb9('0x27')]['findAll']({'where':{'dateNextInvoice':{'$lt':moment()},'subscriptionMonthly':{'$ne':0x0},'deleted':null},'order':[[_0x1cb9('0x4c'),_0x1cb9('0x54')],[_0x1cb9('0x4d'),'DESC'],[_0x1cb9('0x55'),_0x1cb9('0x54')]],'raw':!![]});})[_0x1cb9('0x21')](function(_0x4c54b5){console[_0x1cb9('0x57')](_0x1cb9('0x92'),_0x4c54b5);if(_0x4c54b5[_0x1cb9('0x2e')]>0x0){var _0x3439a4=[];var _0xd71b7c=_['groupBy'](_0x4c54b5,_0x1cb9('0x4c'));Object[_0x1cb9('0x2a')](_0xd71b7c)[_0x1cb9('0x93')](function(_0x58e97a){var _0x340842=_0xd71b7c[_0x58e97a];console[_0x1cb9('0x57')](_0x1cb9('0x58'),_0x340842);_0x3439a4[_0x1cb9('0x59')](addSubscriptionInvoice(_0x340842,_0x4deff1,_0x58e97a,_0x1cb9('0x94'),_0x4d6021));});return BPromise['all'](_0x3439a4);}else{var _0xf98d41={'errors':[{'type':_0x1cb9('0x95'),'message':_0x1cb9('0x96')}]};throw _0xf98d41;}});})[_0x1cb9('0x21')](function(){return _0x1f2d69[_0x1cb9('0x97')](0xc8);})[_0x1cb9('0x3e')](function(_0x37affa){console[_0x1cb9('0x57')](_0x1cb9('0x98'),_0x37affa);if(_0x37affa[_0x1cb9('0x24')]===_0x1cb9('0x5c')){var _0x37affa={'errors':[{'message':_0x1cb9('0x5d')}]};}_0x1f2d69[_0x1cb9('0x1a')](0x1f4)[_0x1cb9('0x25')](_0x37affa);});}; \ No newline at end of file +var _0xd64b=['lastInvoice','nextInvoice','System','productName','productCode','productDescription','netPrice','discount','subscriptionName','subscriptionMonthly','quantity','SAPaymentMethod','saPaymentMethod','Invoice\x20','Automatic\x20Job','saCity','saCountry','saISOCode','saFiscalCode','saPIVA','saFiscalMessage','saExpiryDay','saEurope','saSocCap','saPostalCode','saSDICode','bankAccount','bankName','bankstreet','bankpostalCode','bankcountry','bankIBAN','phone','fax','website','paypalEmail','SAInvoice','negate','isNull','mapValues','createdAt','value','diff','days','dayPrice','total','££££££££\x20products','automaticSubscriptionInvoice\x20productForCompany->','Total','SequelizeUniqueConstraintError','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','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','update','then','destroy','error','stack','name','send','index','SAAsset','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','map','type','field','options','include','findAll','catch','keys','length','find','create','body','describe','getSubscriptions','sequelize','literal','CONCAT\x20(`companyName`,\x22\x20\x22,`pricelistName`,\x22\x20\x22,`subscriptionName`)\x20as\x20SubscriptionName,DATEDIFF\x20(`dateNextInvoice`,NOW())\x20as\x20Expired,`subscriptionId`,`companyName`,`companyId`,`pricelistName`,`pricelistId`,`subscriptionName`,`dateNextInvoice`,SUM(`netPrice`\x20-\x20(`netPrice`\x20/\x20100\x20*\x20`discount`))\x20as\x20TotalNetPrice,SUM((`netPrice`\x20-\x20(`netPrice`\x20/\x20100\x20*\x20`discount`))\x20/\x20100\x20*\x20`tax`)\x20as\x20TotalTax','companyName','companyId','subscriptionId','dateNextInvoice','automaticSubscriptionInvoiceAlignment','transaction','CmCompany','findOne','pricelistId','DESC','groupBy','forEach','log','push','Partial','all','INFO','No\x20invoice.\x20Invoice\x20expired!!\x20','TCL:\x20exports.automaticProformaInvoice\x20->\x20err','Duplicate\x20entry.','??????\x20updSubscriptionDetail\x20product->','??????\x20invoiceType','??????\x20updSubscriptionDetail\x20product.id->','months'];(function(_0x3212cc,_0x3bfe46){var _0x3ecd2c=function(_0x594465){while(--_0x594465){_0x3212cc['push'](_0x3212cc['shift']());}};_0x3ecd2c(++_0x3bfe46);}(_0xd64b,0xc1));var _0xbd64=function(_0x58fad2,_0xb39887){_0x58fad2=_0x58fad2-0x0;var _0x49f947=_0xd64b[_0x58fad2];return _0x49f947;};'use strict';var pdf=require(_0xbd64('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbd64('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd64('0x2'));var rp=require(_0xbd64('0x3'));var moment=require(_0xbd64('0x4'));var BPromise=require(_0xbd64('0x5'));var Mustache=require(_0xbd64('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbd64('0x7'));var fs=require('fs');var _=require(_0xbd64('0x8'));var squel=require(_0xbd64('0x9'));var crypto=require(_0xbd64('0xa'));var jsforce=require(_0xbd64('0xb'));var deskjs=require(_0xbd64('0xc'));var toCsv=require(_0xbd64('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbd64('0xe'));var authService=require(_0xbd64('0xf'));var qs=require(_0xbd64('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd64('0x11'))(_0xbd64('0x12'));var utils=require(_0xbd64('0x13'));var config=require(_0xbd64('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x431b29,_0x5f2adf){_0x5f2adf=_0x5f2adf||0xcc;return function(_0x136f60){if(_0x136f60){return _0x431b29[_0xbd64('0x15')](_0x5f2adf);}return _0x431b29[_0xbd64('0x16')](_0x5f2adf)[_0xbd64('0x17')]();};}function respondWithResult(_0x367824,_0x27438c){_0x27438c=_0x27438c||0xc8;return function(_0x2e23f2){if(_0x2e23f2){return _0x367824[_0xbd64('0x16')](_0x27438c)[_0xbd64('0x18')](_0x2e23f2);}};}function respondWithFilteredResult(_0x4ae471,_0x2d1159){return function(_0x13e7a4){if(_0x13e7a4){var _0x3ff550=_0x13e7a4[_0xbd64('0x19')],_0x32fd34=_0x2d1159['offset'],_0x29fc16=_0x2d1159[_0xbd64('0x1a')]+_0x2d1159[_0xbd64('0x1b')],_0x49a914;if(_0x29fc16>=_0x3ff550){_0x29fc16=_0x3ff550;_0x49a914=0xc8;}else{_0x49a914=0xce;}_0x4ae471[_0xbd64('0x16')](_0x49a914);return _0x4ae471[_0xbd64('0x1c')](_0xbd64('0x1d'),_0x32fd34+'-'+_0x29fc16+'/'+_0x3ff550)[_0xbd64('0x18')](_0x13e7a4);}return null;};}function patchUpdates(_0xa5491d){return function(_0x32c4c7){try{jsonpatch['apply'](_0x32c4c7,_0xa5491d,!![]);}catch(_0x305545){return BPromise[_0xbd64('0x1e')](_0x305545);}return _0x32c4c7['save']();};}function saveUpdates(_0x516158,_0xa4647f){return function(_0x42b328){if(_0x42b328){return _0x42b328[_0xbd64('0x1f')](_0x516158)[_0xbd64('0x20')](function(_0x2c5551){return _0x2c5551;});}return null;};}function removeEntity(_0x816e00,_0x5dc2bd){return function(_0x4d4a16){if(_0x4d4a16){return _0x4d4a16[_0xbd64('0x21')]()[_0xbd64('0x20')](function(){_0x816e00[_0xbd64('0x16')](0xcc)[_0xbd64('0x17')]();});}};}function handleEntityNotFound(_0x55e74c,_0x51d118){return function(_0x28497c){if(!_0x28497c){_0x55e74c['sendStatus'](0x194);}return _0x28497c;};}function handleError(_0x46ab38,_0x5b356b){_0x5b356b=_0x5b356b||0x1f4;return function(_0x33452d){logger[_0xbd64('0x22')](_0x33452d[_0xbd64('0x23')]);if(_0x33452d[_0xbd64('0x24')]){delete _0x33452d['name'];}_0x46ab38[_0xbd64('0x16')](_0x5b356b)[_0xbd64('0x25')](_0x33452d);};}exports[_0xbd64('0x26')]=function(_0x2a44d0,_0x4d1563){var _0x4e8719={},_0x29c9c8={},_0x49eac5={'count':0x0,'rows':[]};var _0x53fe58=db[_0xbd64('0x27')]['rawAttributes'];_0x29c9c8[_0xbd64('0x28')]=_['keys'](_0x53fe58);_0x29c9c8[_0xbd64('0x29')]=_['keys'](_0x2a44d0[_0xbd64('0x29')]);_0x29c9c8[_0xbd64('0x2a')]=_[_0xbd64('0x2b')](_0x29c9c8[_0xbd64('0x28')],_0x29c9c8[_0xbd64('0x29')]);_0x4e8719[_0xbd64('0x2c')]=_['intersection'](_0x29c9c8[_0xbd64('0x28')],qs[_0xbd64('0x2d')](_0x2a44d0[_0xbd64('0x29')][_0xbd64('0x2d')]));_0x4e8719[_0xbd64('0x2c')]=_0x4e8719[_0xbd64('0x2c')]['length']?_0x4e8719['attributes']:_0x29c9c8[_0xbd64('0x28')];if(!_0x2a44d0['query'][_0xbd64('0x2e')](_0xbd64('0x2f'))){_0x4e8719['limit']=qs['limit'](_0x2a44d0[_0xbd64('0x29')]['limit']);_0x4e8719['offset']=qs[_0xbd64('0x1a')](_0x2a44d0[_0xbd64('0x29')][_0xbd64('0x1a')]);}_0x4e8719['order']=qs[_0xbd64('0x30')](_0x2a44d0['query'][_0xbd64('0x30')]);_0x4e8719[_0xbd64('0x31')]=qs[_0xbd64('0x2a')](_[_0xbd64('0x32')](_0x2a44d0[_0xbd64('0x29')],_0x29c9c8[_0xbd64('0x2a')]));if(_0x2a44d0['query']['filter']){_0x4e8719[_0xbd64('0x31')]=_[_0xbd64('0x33')](_0x4e8719[_0xbd64('0x31')],{'$or':_[_0xbd64('0x34')](_0x53fe58,function(_0x5cf522){if(_0x5cf522[_0xbd64('0x35')]['key']!=='VIRTUAL'){var _0x1db1fa={};_0x1db1fa[_0x5cf522[_0xbd64('0x36')]]={'$like':'%'+_0x2a44d0[_0xbd64('0x29')]['filter']+'%'};return _0x1db1fa;}})});}_0x4e8719=_['merge']({},_0x4e8719,_0x2a44d0[_0xbd64('0x37')]);var _0x51d056={'where':_0x4e8719[_0xbd64('0x31')]};return db['SAAsset'][_0xbd64('0x19')](_0x51d056)[_0xbd64('0x20')](function(_0x550221){_0x49eac5[_0xbd64('0x19')]=_0x550221;if(_0x2a44d0['query']['includeAll']){_0x4e8719[_0xbd64('0x38')]=[{'all':!![]}];}return db[_0xbd64('0x27')][_0xbd64('0x39')](_0x4e8719);})['then'](function(_0x540e2a){_0x49eac5['rows']=_0x540e2a;return _0x49eac5;})[_0xbd64('0x20')](respondWithFilteredResult(_0x4d1563,_0x4e8719))[_0xbd64('0x3a')](handleError(_0x4d1563,null));};exports['show']=function(_0x393f57,_0x34b19a){var _0x19832c={'raw':![],'where':{'id':_0x393f57['params']['id']}},_0x27fd12={};_0x27fd12['model']=_[_0xbd64('0x3b')](db['SAAsset']['rawAttributes']);_0x27fd12[_0xbd64('0x29')]=_[_0xbd64('0x3b')](_0x393f57[_0xbd64('0x29')]);_0x27fd12[_0xbd64('0x2a')]=_[_0xbd64('0x2b')](_0x27fd12[_0xbd64('0x28')],_0x27fd12[_0xbd64('0x29')]);_0x19832c[_0xbd64('0x2c')]=_['intersection'](_0x27fd12[_0xbd64('0x28')],qs[_0xbd64('0x2d')](_0x393f57['query'][_0xbd64('0x2d')]));_0x19832c[_0xbd64('0x2c')]=_0x19832c[_0xbd64('0x2c')][_0xbd64('0x3c')]?_0x19832c[_0xbd64('0x2c')]:_0x27fd12[_0xbd64('0x28')];if(_0x393f57[_0xbd64('0x29')]['includeAll']){_0x19832c[_0xbd64('0x38')]=[{'all':!![]}];}_0x19832c=_['merge']({},_0x19832c,_0x393f57[_0xbd64('0x37')]);return db['SAAsset'][_0xbd64('0x3d')](_0x19832c)[_0xbd64('0x20')](handleEntityNotFound(_0x34b19a,null))[_0xbd64('0x20')](respondWithResult(_0x34b19a,null))['catch'](handleError(_0x34b19a,null));};exports[_0xbd64('0x3e')]=function(_0x495522,_0x526705){return db['SAAsset'][_0xbd64('0x3e')](_0x495522[_0xbd64('0x3f')],{})[_0xbd64('0x20')](respondWithResult(_0x526705,0xc9))[_0xbd64('0x3a')](handleError(_0x526705,null));};exports[_0xbd64('0x1f')]=function(_0x3079b6,_0x3a5806){if(_0x3079b6['body']['id']){delete _0x3079b6[_0xbd64('0x3f')]['id'];}return db[_0xbd64('0x27')][_0xbd64('0x3d')]({'where':{'id':_0x3079b6['params']['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x3a5806,null))[_0xbd64('0x20')](saveUpdates(_0x3079b6[_0xbd64('0x3f')],null))[_0xbd64('0x20')](respondWithResult(_0x3a5806,null))[_0xbd64('0x3a')](handleError(_0x3a5806,null));};exports['destroy']=function(_0x283699,_0x1a9ec8){return db[_0xbd64('0x27')][_0xbd64('0x3d')]({'where':{'id':_0x283699['params']['id']}})['then'](handleEntityNotFound(_0x1a9ec8,null))[_0xbd64('0x20')](removeEntity(_0x1a9ec8,null))[_0xbd64('0x3a')](handleError(_0x1a9ec8,null));};exports[_0xbd64('0x40')]=function(_0x4700a7,_0x389336){return db[_0xbd64('0x27')][_0xbd64('0x40')]()[_0xbd64('0x20')](respondWithResult(_0x389336,null))[_0xbd64('0x3a')](handleError(_0x389336,null));};exports[_0xbd64('0x41')]=function(_0x419c39,_0x3027bb){var _0x3f81d8=qs[_0xbd64('0x30')](_0x419c39[_0xbd64('0x29')]['sort']);if(!_0x419c39[_0xbd64('0x29')]['hasOwnProperty']('nolimit')){var _0x552c95=qs['limit'](_0x419c39[_0xbd64('0x29')][_0xbd64('0x1b')]);var _0x5480f5=qs[_0xbd64('0x1a')](_0x419c39[_0xbd64('0x29')][_0xbd64('0x1a')]);}return db['SAAsset'][_0xbd64('0x39')]({'attributes':[db[_0xbd64('0x42')][_0xbd64('0x43')](_0xbd64('0x44'))],'group':[_0xbd64('0x45'),_0xbd64('0x46'),'pricelistName','pricelistId','subscriptionName',_0xbd64('0x47'),_0xbd64('0x48')],'order':_0x3f81d8,'limit':_0x552c95,'offset':_0x5480f5,'raw':!![]})[_0xbd64('0x20')](function(_0x958272){return{'count':_0x958272['length'],'rows':_0x958272};})[_0xbd64('0x20')](handleEntityNotFound(_0x3027bb,null))[_0xbd64('0x20')](respondWithResult(_0x3027bb,null))[_0xbd64('0x3a')](handleError(_0x3027bb,null));};exports[_0xbd64('0x49')]=function(_0x3a0e5c,_0xe24e44,_0x546790){var _0x270910;if(_0x3a0e5c[_0xbd64('0x3f')]['id']){delete _0x3a0e5c[_0xbd64('0x3f')]['id'];}return db[_0xbd64('0x42')][_0xbd64('0x4a')](function(_0x41fa48){return db[_0xbd64('0x4b')][_0xbd64('0x4c')]({'where':{'defaultEntry':0x1},'raw':!![]})[_0xbd64('0x20')](function(_0x1e8e1c){_0x270910=_0x1e8e1c;return db[_0xbd64('0x27')][_0xbd64('0x39')]({'where':{'dateLastInvoice':null,'deleted':null},'order':[['companyId','DESC'],[_0xbd64('0x4d'),_0xbd64('0x4e')],['subscriptionId','DESC']],'raw':!![]});})[_0xbd64('0x20')](function(_0x12bc56){if(_0x12bc56['length']>0x0){var _0x6facf3=[];var _0x13f083=_[_0xbd64('0x4f')](_0x12bc56,_0xbd64('0x46'));Object[_0xbd64('0x3b')](_0x13f083)[_0xbd64('0x50')](function(_0x2d788){var _0x23e602=_0x13f083[_0x2d788];console[_0xbd64('0x51')]('automaticSubscriptionInvoice\x20productForCompany->',_0x23e602);_0x6facf3[_0xbd64('0x52')](addSubscriptionInvoice(_0x23e602,_0x270910,_0x2d788,_0xbd64('0x53'),_0x41fa48));});return BPromise[_0xbd64('0x54')](_0x6facf3);}else{var _0x5054a6={'errors':[{'type':_0xbd64('0x55'),'message':_0xbd64('0x56')}]};throw _0x5054a6;}});})['then'](function(){return _0xe24e44[_0xbd64('0x15')](0xc8);})[_0xbd64('0x3a')](function(_0x16634d){console[_0xbd64('0x51')](_0xbd64('0x57'),_0x16634d);if(_0x16634d[_0xbd64('0x24')]==='SequelizeUniqueConstraintError'){var _0x16634d={'errors':[{'message':_0xbd64('0x58')}]};}_0xe24e44[_0xbd64('0x16')](0x1f4)[_0xbd64('0x25')](_0x16634d);});};function updSubscriptionDetail(_0x4c8882,_0xff862e,_0x1c8b40){console['log'](_0xbd64('0x59'),_0x4c8882);console['log'](_0xbd64('0x5a'),_0xff862e);console[_0xbd64('0x51')](_0xbd64('0x5b'),_0x4c8882['id']);console[_0xbd64('0x51')]('??????\x20updSubscriptionDetail\x20product.dateNextInvoice->',_0x4c8882[_0xbd64('0x48')]);var _0x54a3b1;var _0x30bdef;if(_0xff862e===_0xbd64('0x53')){_0x54a3b1=moment();_0x30bdef=_0x4c8882[_0xbd64('0x48')];}else{_0x54a3b1=_0x4c8882[_0xbd64('0x48')];_0x30bdef=moment(_0x4c8882['dateNextInvoice'])['add'](_0x4c8882['subscriptionMonthly'],_0xbd64('0x5c'));}console[_0xbd64('0x51')](_0xbd64('0x5d'),_0x54a3b1);console[_0xbd64('0x51')](_0xbd64('0x5e'),_0x30bdef);return db[_0xbd64('0x27')]['update']({'dateLastInvoice':_0x54a3b1,'dateNextInvoice':_0x30bdef,'agentFullname':_0xbd64('0x5f')},{'where':{'id':_0x4c8882['id']},'raw':!![],'transaction':_0x1c8b40})[_0xbd64('0x3a')](function(_0x305ffc){throw _0x305ffc;});}function addSubscriptionInvoiceDetail(_0x333720,_0x12f171,_0x463105){var _0x2f3516={'companyName':_0x333720[_0xbd64('0x45')],'companyId':_0x333720[_0xbd64('0x46')],'productName':_0x333720[_0xbd64('0x60')],'productCode':_0x333720[_0xbd64('0x61')],'productDescription':_0x333720[_0xbd64('0x62')],'typeName':_0x333720['typeName'],'pricelistName':_0x333720['pricelistName'],'priceListId':_0x333720[_0xbd64('0x4d')],'netPrice':_0x333720[_0xbd64('0x63')],'discount':_0x333720[_0xbd64('0x64')],'tax':_0x333720['tax'],'agentFullname':_0xbd64('0x5f'),'note':_0x333720['note'],'subscriptionId':_0x333720[_0xbd64('0x47')],'subscriptionName':_0x333720[_0xbd64('0x65')],'subscriptionMonthly':_0x333720[_0xbd64('0x66')],'quantity':_0x333720[_0xbd64('0x67')],'InvoiceId':_0x12f171['id']};return db['SAInvoiceDetail'][_0xbd64('0x3e')](_0x2f3516,{'raw':!![],'transaction':_0x463105})['catch'](function(_0x14f79e){throw _0x14f79e;});}function addSubscriptionInvoice(_0x3929d9,_0x310f64,_0x2ba285,_0x120b11,_0x49f7fd){return db[_0xbd64('0x4b')][_0xbd64('0x4c')]({'where':{'id':_0x2ba285},'raw':!![]})['then'](function(_0x2b95a0){return db[_0xbd64('0x68')][_0xbd64('0x4c')]({'where':{'id':_0x2b95a0[_0xbd64('0x69')]},'raw':!![]})['then'](function(_0x4159a7){var _0x4b0bd9={'name':_0xbd64('0x6a')+moment()+'_'+_0x120b11,'note':_0xbd64('0x6b'),'agentFullname':_0xbd64('0x5f'),'status':'close','companyName':_0x2b95a0['name'],'companyId':_0x2b95a0['id'],'paid':0x0,'discount':0x0,'receivingStreet':_0x2b95a0['saStreet'],'receivingPostalCode':_0x2b95a0['saPostalCode'],'receivingCity':_0x2b95a0[_0xbd64('0x6c')],'receivingCountry':_0x2b95a0[_0xbd64('0x6d')],'receivingISOCode':_0x2b95a0[_0xbd64('0x6e')],'receivingFiscalCode':_0x2b95a0[_0xbd64('0x6f')],'receivingPIVA':_0x2b95a0[_0xbd64('0x70')],'receivingSDICode':_0x2b95a0['saSDICode'],'receivingFiscalMessage':_0x2b95a0[_0xbd64('0x71')],'receivingExpiryDay':_0x2b95a0[_0xbd64('0x72')],'receivingEurope':_0x2b95a0[_0xbd64('0x73')],'receivingSocCap':_0x2b95a0[_0xbd64('0x74')],'issuerName':_0x310f64[_0xbd64('0x24')],'issuerStreet':_0x310f64['saStreet'],'issuerPostalCode':_0x310f64[_0xbd64('0x75')],'issuerCity':_0x310f64[_0xbd64('0x6c')],'issuerCountry':_0x310f64[_0xbd64('0x6d')],'issuerISOCode':_0x310f64[_0xbd64('0x6e')],'issuerFiscalCode':_0x310f64['saFiscalCode'],'issuerPIVA':_0x310f64['saPIVA'],'issuerSDICode':_0x310f64[_0xbd64('0x76')],'issuerFiscalMessage':_0x310f64[_0xbd64('0x71')],'issuerExpiryDay':_0x310f64[_0xbd64('0x72')],'issuerSocCap':_0x310f64[_0xbd64('0x74')],'issuerBankAccount':_0x4159a7[_0xbd64('0x77')],'issuerBankName':_0x4159a7[_0xbd64('0x78')],'issuerBankStreet':_0x4159a7[_0xbd64('0x79')],'issuerBankPostalCode':_0x4159a7[_0xbd64('0x7a')],'issuerBankCity':_0x4159a7['bankcity'],'issuerBankCountry':_0x4159a7[_0xbd64('0x7b')],'issuerBankBICSWIFT':_0x4159a7['bankBICSWIFT'],'issuerBankIBAN':_0x4159a7[_0xbd64('0x7c')],'issuerPhone':_0x310f64[_0xbd64('0x7d')],'issuerFax':_0x310f64[_0xbd64('0x7e')],'issuerEmail':_0x310f64['email'],'issuerWeb':_0x310f64[_0xbd64('0x7f')],'issuerABI':_0x4159a7['bankABI'],'issuerCAB':_0x4159a7['banckCAB'],'issuerPayPal':_0x4159a7[_0xbd64('0x80')]};return db[_0xbd64('0x81')][_0xbd64('0x3e')](_0x4b0bd9,{'transaction':_0x49f7fd})['then'](function(_0x364af8){var _0x3a34b7=[];for(var _0x8150bb=0x0;_0x8150bb<_0x3929d9[_0xbd64('0x3c')];_0x8150bb++){_0x3a34b7['push'](updSubscriptionDetail(_0x3929d9[_0x8150bb],_0x120b11,_0x49f7fd));}var _0x17a4c4=[_0xbd64('0x61'),_0xbd64('0x4d'),_0xbd64('0x47'),_0xbd64('0x63')];_(_0x3929d9)[_0xbd64('0x4f')](function(_0x3bc2e8){return _[_0xbd64('0x3d')](_[_0xbd64('0x32')](_0x3bc2e8,_0x17a4c4),_[_0xbd64('0x82')](_[_0xbd64('0x83')]));})[_0xbd64('0x84')](function(_0x2196b8){var _0x37f388=_0x2196b8[0x0];_0x37f388['quantity']=_0x2196b8['length'];if(_0x120b11===_0xbd64('0x53')){_0x37f388[_0xbd64('0x63')]=computePrice(_0x37f388[_0xbd64('0x85')],_0x37f388['dateNextInvoice'],_0x37f388[_0xbd64('0x63')],_0x37f388['subscriptionMonthly']);}_0x3a34b7[_0xbd64('0x52')](addSubscriptionInvoiceDetail(_0x37f388,_0x364af8,_0x49f7fd));})[_0xbd64('0x86')]();return BPromise[_0xbd64('0x54')](_0x3a34b7);});});})[_0xbd64('0x3a')](function(_0x562932){console[_0xbd64('0x51')](_0xbd64('0x57'),_0x562932);throw _0x562932;});}function computePrice(_0x550f18,_0x283704,_0x58284d,_0x3ca036){var _0x2415a8=_0x58284d;console[_0xbd64('0x51')](_0xbd64('0x85'),_0x550f18);console[_0xbd64('0x51')](_0xbd64('0x48'),_0x283704);console['log'](_0xbd64('0x66'),_0x3ca036);console['log'](_0xbd64('0x63'),_0x58284d);if(_0x3ca036!=0x0){var _0x1fa7ad=moment(_0x550f18);var _0x4df56f=moment(_0x283704);var _0x43d734=Math['abs'](_0x1fa7ad[_0xbd64('0x87')](_0x4df56f,_0xbd64('0x88')));console[_0xbd64('0x51')]('diffDay',_0x43d734);var _0x219f6a=_0x58284d/(0x1e*_0x3ca036);console[_0xbd64('0x51')](_0xbd64('0x89'),_0x219f6a);_0x2415a8=_0x219f6a*_0x43d734;}console[_0xbd64('0x51')](_0xbd64('0x8a'),_0x2415a8);return _0x2415a8;}exports['automaticSubscriptionInvoice']=function(_0x58efa2,_0x42feee,_0x3d8de3){var _0xeb9c51;if(_0x58efa2[_0xbd64('0x3f')]['id']){delete _0x58efa2[_0xbd64('0x3f')]['id'];}return db[_0xbd64('0x42')][_0xbd64('0x4a')](function(_0xd8f344){return db[_0xbd64('0x4b')][_0xbd64('0x4c')]({'where':{'defaultEntry':0x1},'raw':!![]})[_0xbd64('0x20')](function(_0x3cd6d6){_0xeb9c51=_0x3cd6d6;return db[_0xbd64('0x27')]['findAll']({'where':{'dateNextInvoice':{'$lt':moment()},'subscriptionMonthly':{'$ne':0x0},'deleted':null},'order':[[_0xbd64('0x46'),_0xbd64('0x4e')],['pricelistId',_0xbd64('0x4e')],[_0xbd64('0x47'),_0xbd64('0x4e')]],'raw':!![]});})[_0xbd64('0x20')](function(_0x4e948c){console['log'](_0xbd64('0x8b'),_0x4e948c);if(_0x4e948c[_0xbd64('0x3c')]>0x0){var _0x7f4e70=[];var _0x2af19c=_[_0xbd64('0x4f')](_0x4e948c,_0xbd64('0x46'));Object[_0xbd64('0x3b')](_0x2af19c)[_0xbd64('0x50')](function(_0x1cb98a){var _0x4781d8=_0x2af19c[_0x1cb98a];console[_0xbd64('0x51')](_0xbd64('0x8c'),_0x4781d8);_0x7f4e70['push'](addSubscriptionInvoice(_0x4781d8,_0xeb9c51,_0x1cb98a,_0xbd64('0x8d'),_0xd8f344));});return BPromise[_0xbd64('0x54')](_0x7f4e70);}else{var _0x124c0e={'errors':[{'type':'WARNING','message':'No\x20product\x20to\x20assign\x20invoice.\x20Invoice\x20not\x20created!!\x20'}]};throw _0x124c0e;}});})[_0xbd64('0x20')](function(){return _0x42feee[_0xbd64('0x15')](0xc8);})['catch'](function(_0x18364c){console[_0xbd64('0x51')](_0xbd64('0x57'),_0x18364c);if(_0x18364c[_0xbd64('0x24')]===_0xbd64('0x8e')){var _0x18364c={'errors':[{'message':_0xbd64('0x58')}]};}_0x42feee[_0xbd64('0x16')](0x1f4)[_0xbd64('0x25')](_0x18364c);});}; \ No newline at end of file diff --git a/server/api/saAsset/saAsset.model.js b/server/api/saAsset/saAsset.model.js index 8588156..ab84bb2 100644 --- a/server/api/saAsset/saAsset.model.js +++ b/server/api/saAsset/saAsset.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x725a=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','lodash'];(function(_0x21b359,_0x4dc80e){var _0x57b8e7=function(_0x135adb){while(--_0x135adb){_0x21b359['push'](_0x21b359['shift']());}};_0x57b8e7(++_0x4dc80e);}(_0x725a,0x12b));var _0xa725=function(_0x37496d,_0xf738a6){_0x37496d=_0x37496d-0x0;var _0x3fc0e9=_0x725a[_0x37496d];return _0x3fc0e9;};'use strict';var _=require(_0xa725('0x0'));var util=require(_0xa725('0x1'));var logger=require(_0xa725('0x2'))(_0xa725('0x3'));var moment=require(_0xa725('0x4'));var BPromise=require(_0xa725('0x5'));var rp=require(_0xa725('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa725('0x7'));var config=require(_0xa725('0x8'));var attributes=require('./saAsset.attributes');module[_0xa725('0x9')]=function(_0x209b10,_0x35fab6){return _0x209b10['define']('SAAsset',attributes,{'tableName':'sa_assets','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2ec=['request-promise','path','rimraf','exports','SAAsset','sa_assets','lodash','util','../../config/logger','api','moment'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0xc2ec,0xf8));var _0xcc2e=function(_0x42b40b,_0x6a6048){_0x42b40b=_0x42b40b-0x0;var _0x765872=_0xc2ec[_0x42b40b];return _0x765872;};'use strict';var _=require(_0xcc2e('0x0'));var util=require(_0xcc2e('0x1'));var logger=require(_0xcc2e('0x2'))(_0xcc2e('0x3'));var moment=require(_0xcc2e('0x4'));var BPromise=require('bluebird');var rp=require(_0xcc2e('0x5'));var fs=require('fs');var path=require(_0xcc2e('0x6'));var rimraf=require(_0xcc2e('0x7'));var config=require('../../config/environment');var attributes=require('./saAsset.attributes');module[_0xcc2e('0x8')]=function(_0x5bddbe,_0x216ec2){return _0x5bddbe['define'](_0xcc2e('0x9'),attributes,{'tableName':_0xcc2e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saAsset/saAsset.rpc.js b/server/api/saAsset/saAsset.rpc.js index 50a51e5..066e114 100644 --- a/server/api/saAsset/saAsset.rpc.js +++ b/server/api/saAsset/saAsset.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2eb9=['SAAsset,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SAAsset,\x20%s,\x20%s','debug'];(function(_0x34cbfd,_0x4499b7){var _0x2eb449=function(_0x6f9bc0){while(--_0x6f9bc0){_0x34cbfd['push'](_0x34cbfd['shift']());}};_0x2eb449(++_0x4499b7);}(_0x2eb9,0x97));var _0x92eb=function(_0x2dc91e,_0x3cfb86){_0x2dc91e=_0x2dc91e-0x0;var _0x169de8=_0x2eb9[_0x2dc91e];return _0x169de8;};'use strict';var _=require(_0x92eb('0x0'));var util=require(_0x92eb('0x1'));var moment=require(_0x92eb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x92eb('0x3'));var db=require(_0x92eb('0x4'))['db'];var utils=require(_0x92eb('0x5'));var logger=require(_0x92eb('0x6'))(_0x92eb('0x7'));var config=require(_0x92eb('0x8'));var jayson=require(_0x92eb('0x9'));var client=jayson[_0x92eb('0xa')][_0x92eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a8500,_0x4b5350,_0x4d58ad){return new BPromise(function(_0x537d61,_0xa21794){return client[_0x92eb('0xc')](_0x1a8500,_0x4d58ad)[_0x92eb('0xd')](function(_0x3077cd){logger[_0x92eb('0xe')](_0x92eb('0xf'),_0x4b5350,'request\x20sent');logger[_0x92eb('0x10')](_0x92eb('0x11'),_0x4b5350,_0x92eb('0x12'),JSON[_0x92eb('0x13')](_0x3077cd));if(_0x3077cd[_0x92eb('0x14')]){if(_0x3077cd[_0x92eb('0x14')][_0x92eb('0x15')]===0x1f4){logger[_0x92eb('0x14')](_0x92eb('0xf'),_0x4b5350,_0x3077cd[_0x92eb('0x14')]['message']);return _0xa21794(_0x3077cd[_0x92eb('0x14')][_0x92eb('0x16')]);}logger['error'](_0x92eb('0xf'),_0x4b5350,_0x3077cd[_0x92eb('0x14')][_0x92eb('0x16')]);return _0x537d61(_0x3077cd['error'][_0x92eb('0x16')]);}else{logger[_0x92eb('0xe')]('SAAsset,\x20%s,\x20%s',_0x4b5350,_0x92eb('0x12'));_0x537d61(_0x3077cd['result']['message']);}})[_0x92eb('0x17')](function(_0x4d9fb5){logger[_0x92eb('0x14')](_0x92eb('0xf'),_0x4b5350,_0x4d9fb5);_0xa21794(_0x4d9fb5);});});} \ No newline at end of file +var _0x7940=['error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','SAAsset,\x20%s,\x20%s','request\x20sent','debug','SAAsset,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x8e1922,_0x38349d){var _0x3e4e55=function(_0x511ec6){while(--_0x511ec6){_0x8e1922['push'](_0x8e1922['shift']());}};_0x3e4e55(++_0x38349d);}(_0x7940,0x139));var _0x0794=function(_0x2dedbc,_0x46f199){_0x2dedbc=_0x2dedbc-0x0;var _0x3cc4f9=_0x7940[_0x2dedbc];return _0x3cc4f9;};'use strict';var _=require('lodash');var util=require(_0x0794('0x0'));var moment=require(_0x0794('0x1'));var BPromise=require(_0x0794('0x2'));var rs=require(_0x0794('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0794('0x4'))['db'];var utils=require(_0x0794('0x5'));var logger=require(_0x0794('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0794('0x7'));var client=jayson['client'][_0x0794('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x278f9a,_0x37eb9c,_0x467abe){return new BPromise(function(_0x3ef624,_0x3ef71f){return client[_0x0794('0x9')](_0x278f9a,_0x467abe)[_0x0794('0xa')](function(_0x1f4a1f){logger[_0x0794('0xb')](_0x0794('0xc'),_0x37eb9c,_0x0794('0xd'));logger[_0x0794('0xe')](_0x0794('0xf'),_0x37eb9c,_0x0794('0xd'),JSON[_0x0794('0x10')](_0x1f4a1f));if(_0x1f4a1f[_0x0794('0x11')]){if(_0x1f4a1f[_0x0794('0x11')][_0x0794('0x12')]===0x1f4){logger['error']('SAAsset,\x20%s,\x20%s',_0x37eb9c,_0x1f4a1f[_0x0794('0x11')]['message']);return _0x3ef71f(_0x1f4a1f['error'][_0x0794('0x13')]);}logger[_0x0794('0x11')](_0x0794('0xc'),_0x37eb9c,_0x1f4a1f[_0x0794('0x11')][_0x0794('0x13')]);return _0x3ef624(_0x1f4a1f[_0x0794('0x11')][_0x0794('0x13')]);}else{logger['info']('SAAsset,\x20%s,\x20%s',_0x37eb9c,_0x0794('0xd'));_0x3ef624(_0x1f4a1f[_0x0794('0x14')][_0x0794('0x13')]);}})[_0x0794('0x15')](function(_0x17635a){logger[_0x0794('0x11')](_0x0794('0xc'),_0x37eb9c,_0x17635a);_0x3ef71f(_0x17635a);});});} \ No newline at end of file diff --git a/server/api/saCompanyRelationship/index.js b/server/api/saCompanyRelationship/index.js index ed04976..a84e0d2 100644 --- a/server/api/saCompanyRelationship/index.js +++ b/server/api/saCompanyRelationship/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb1dc=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update','delete'];(function(_0x4b281a,_0x1733de){var _0x3149a7=function(_0x3a6b40){while(--_0x3a6b40){_0x4b281a['push'](_0x4b281a['shift']());}};_0x3149a7(++_0x1733de);}(_0xb1dc,0x1bb));var _0xcb1d=function(_0x38c632,_0x14e8e6){_0x38c632=_0x38c632-0x0;var _0x12737e=_0xb1dc[_0x38c632];return _0x12737e;};'use strict';var multer=require(_0xcb1d('0x0'));var util=require(_0xcb1d('0x1'));var path=require(_0xcb1d('0x2'));var timeout=require(_0xcb1d('0x3'));var express=require(_0xcb1d('0x4'));var router=express[_0xcb1d('0x5')]();var auth=require(_0xcb1d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcb1d('0x7'));var controller=require('./saCompanyRelationship.controller');router['get']('/',auth[_0xcb1d('0x8')](),controller[_0xcb1d('0x9')]);router[_0xcb1d('0xa')](_0xcb1d('0xb'),auth[_0xcb1d('0x8')](),controller[_0xcb1d('0xc')]);router[_0xcb1d('0xa')](_0xcb1d('0xd'),auth[_0xcb1d('0x8')](),controller[_0xcb1d('0xe')]);router['post']('/',auth[_0xcb1d('0x8')](),controller[_0xcb1d('0xf')]);router[_0xcb1d('0x10')](_0xcb1d('0xd'),auth[_0xcb1d('0x8')](),controller[_0xcb1d('0x11')]);router[_0xcb1d('0x12')](_0xcb1d('0xd'),auth[_0xcb1d('0x8')](),controller[_0xcb1d('0x13')]);module[_0xcb1d('0x14')]=router; \ No newline at end of file +var _0x52ce=['/describe','describe','/:id','post','create','delete','destroy','util','express','../../components/auth/service','../../config/environment','./saCompanyRelationship.controller','get','isAuthenticated','index'];(function(_0xa1f972,_0x3f89c6){var _0x2ab4ef=function(_0x216bee){while(--_0x216bee){_0xa1f972['push'](_0xa1f972['shift']());}};_0x2ab4ef(++_0x3f89c6);}(_0x52ce,0x17e));var _0xe52c=function(_0x3358ba,_0x24c5fc){_0x3358ba=_0x3358ba-0x0;var _0x296e73=_0x52ce[_0x3358ba];return _0x296e73;};'use strict';var multer=require('multer');var util=require(_0xe52c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe52c('0x1'));var router=express['Router']();var auth=require(_0xe52c('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xe52c('0x3'));var controller=require(_0xe52c('0x4'));router[_0xe52c('0x5')]('/',auth[_0xe52c('0x6')](),controller[_0xe52c('0x7')]);router[_0xe52c('0x5')](_0xe52c('0x8'),auth[_0xe52c('0x6')](),controller[_0xe52c('0x9')]);router[_0xe52c('0x5')](_0xe52c('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xe52c('0xb')]('/',auth[_0xe52c('0x6')](),controller[_0xe52c('0xc')]);router['put']('/:id',auth[_0xe52c('0x6')](),controller['update']);router[_0xe52c('0xd')](_0xe52c('0xa'),auth['isAuthenticated'](),controller[_0xe52c('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/saCompanyRelationship/saCompanyRelationship.attributes.js b/server/api/saCompanyRelationship/saCompanyRelationship.attributes.js index ac461c3..8e97768 100644 --- a/server/api/saCompanyRelationship/saCompanyRelationship.attributes.js +++ b/server/api/saCompanyRelationship/saCompanyRelationship.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x815d=['sequelize','name'];(function(_0x371fc1,_0x5e1f18){var _0x5e6914=function(_0x3bc745){while(--_0x3bc745){_0x371fc1['push'](_0x371fc1['shift']());}};_0x5e6914(++_0x5e1f18);}(_0x815d,0x8a));var _0xd815=function(_0x15cd94,_0xd4426b){_0x15cd94=_0x15cd94-0x0;var _0x29c7da=_0x815d[_0x15cd94];return _0x29c7da;};'use strict';var Sequelize=require(_0xd815('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd815('0x1')}}; \ No newline at end of file +var _0xe497=['exports','STRING','name','sequelize'];(function(_0x2a238a,_0x1d5054){var _0xeef802=function(_0x583637){while(--_0x583637){_0x2a238a['push'](_0x2a238a['shift']());}};_0xeef802(++_0x1d5054);}(_0xe497,0x153));var _0x7e49=function(_0x28569d,_0x38e789){_0x28569d=_0x28569d-0x0;var _0x273805=_0xe497[_0x28569d];return _0x273805;};'use strict';var Sequelize=require(_0x7e49('0x0'));module[_0x7e49('0x1')]={'name':{'type':Sequelize[_0x7e49('0x2')],'allowNull':![],'unique':_0x7e49('0x3')}}; \ No newline at end of file diff --git a/server/api/saCompanyRelationship/saCompanyRelationship.controller.js b/server/api/saCompanyRelationship/saCompanyRelationship.controller.js index f4b5a5a..768a6a1 100644 --- a/server/api/saCompanyRelationship/saCompanyRelationship.controller.js +++ b/server/api/saCompanyRelationship/saCompanyRelationship.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d8c=['SACompanyRelationship','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','count','include','findAll','rows','catch','show','params','includeAll','find','create','body','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','json','offset','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index'];(function(_0x12772f,_0x2dc816){var _0x750a31=function(_0x40b120){while(--_0x40b120){_0x12772f['push'](_0x12772f['shift']());}};_0x750a31(++_0x2dc816);}(_0x6d8c,0x146));var _0xc6d8=function(_0x4fad53,_0x2fa371){_0x4fad53=_0x4fad53-0x0;var _0xfb1a60=_0x6d8c[_0x4fad53];return _0xfb1a60;};'use strict';var pdf=require(_0xc6d8('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc6d8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc6d8('0x2'));var moment=require(_0xc6d8('0x3'));var BPromise=require(_0xc6d8('0x4'));var Mustache=require(_0xc6d8('0x5'));var util=require(_0xc6d8('0x6'));var path=require(_0xc6d8('0x7'));var sox=require(_0xc6d8('0x8'));var csv=require(_0xc6d8('0x9'));var ejs=require(_0xc6d8('0xa'));var fs=require('fs');var _=require(_0xc6d8('0xb'));var squel=require(_0xc6d8('0xc'));var crypto=require(_0xc6d8('0xd'));var jsforce=require(_0xc6d8('0xe'));var deskjs=require(_0xc6d8('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc6d8('0x10'));var Papa=require(_0xc6d8('0x11'));var Redis=require(_0xc6d8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc6d8('0x13'));var hardwareService=require(_0xc6d8('0x14'));var logger=require('../../config/logger')(_0xc6d8('0x15'));var utils=require('../../config/utils');var config=require(_0xc6d8('0x16'));var db=require(_0xc6d8('0x17'))['db'];function respondWithStatusCode(_0x72a65f,_0x11c80a){_0x11c80a=_0x11c80a||0xcc;return function(_0x14b3b3){if(_0x14b3b3){return _0x72a65f['sendStatus'](_0x11c80a);}return _0x72a65f[_0xc6d8('0x18')](_0x11c80a)['end']();};}function respondWithResult(_0x322bb9,_0x499dc5){_0x499dc5=_0x499dc5||0xc8;return function(_0x2c9673){if(_0x2c9673){return _0x322bb9[_0xc6d8('0x18')](_0x499dc5)[_0xc6d8('0x19')](_0x2c9673);}};}function respondWithFilteredResult(_0x307521,_0x261190){return function(_0x3961a3){if(_0x3961a3){var _0x727efc=_0x3961a3['count'],_0x46611c=_0x261190['offset'],_0x4bd2c2=_0x261190[_0xc6d8('0x1a')]+_0x261190['limit'],_0x26e24e;if(_0x4bd2c2>=_0x727efc){_0x4bd2c2=_0x727efc;_0x26e24e=0xc8;}else{_0x26e24e=0xce;}_0x307521[_0xc6d8('0x18')](_0x26e24e);return _0x307521['set'](_0xc6d8('0x1b'),_0x46611c+'-'+_0x4bd2c2+'/'+_0x727efc)[_0xc6d8('0x19')](_0x3961a3);}return null;};}function patchUpdates(_0x29e531){return function(_0x13917c){try{jsonpatch['apply'](_0x13917c,_0x29e531,!![]);}catch(_0x477a12){return BPromise[_0xc6d8('0x1c')](_0x477a12);}return _0x13917c[_0xc6d8('0x1d')]();};}function saveUpdates(_0x2e1faa,_0x1680b7){return function(_0x57f34a){if(_0x57f34a){return _0x57f34a[_0xc6d8('0x1e')](_0x2e1faa)[_0xc6d8('0x1f')](function(_0x205eb9){return _0x205eb9;});}return null;};}function removeEntity(_0x5da03e,_0x1fe2e0){return function(_0x730eb1){if(_0x730eb1){return _0x730eb1[_0xc6d8('0x20')]()[_0xc6d8('0x1f')](function(){_0x5da03e['status'](0xcc)[_0xc6d8('0x21')]();});}};}function handleEntityNotFound(_0x305a8e,_0xe4c7f8){return function(_0x334d3d){if(!_0x334d3d){_0x305a8e['sendStatus'](0x194);}return _0x334d3d;};}function handleError(_0x20d38f,_0x2e77c6){_0x2e77c6=_0x2e77c6||0x1f4;return function(_0x1fd29c){logger[_0xc6d8('0x22')](_0x1fd29c[_0xc6d8('0x23')]);if(_0x1fd29c[_0xc6d8('0x24')]){delete _0x1fd29c['name'];}_0x20d38f[_0xc6d8('0x18')](_0x2e77c6)[_0xc6d8('0x25')](_0x1fd29c);};}exports[_0xc6d8('0x26')]=function(_0x4040d3,_0x1af22a){var _0x51616e={},_0xd03fb5={},_0x9a30c8={'count':0x0,'rows':[]};var _0x2f8b18=db[_0xc6d8('0x27')][_0xc6d8('0x28')];_0xd03fb5[_0xc6d8('0x29')]=_['keys'](_0x2f8b18);_0xd03fb5[_0xc6d8('0x2a')]=_[_0xc6d8('0x2b')](_0x4040d3['query']);_0xd03fb5[_0xc6d8('0x2c')]=_[_0xc6d8('0x2d')](_0xd03fb5['model'],_0xd03fb5['query']);_0x51616e[_0xc6d8('0x2e')]=_['intersection'](_0xd03fb5[_0xc6d8('0x29')],qs[_0xc6d8('0x2f')](_0x4040d3['query'][_0xc6d8('0x2f')]));_0x51616e['attributes']=_0x51616e[_0xc6d8('0x2e')][_0xc6d8('0x30')]?_0x51616e[_0xc6d8('0x2e')]:_0xd03fb5[_0xc6d8('0x29')];if(!_0x4040d3[_0xc6d8('0x2a')][_0xc6d8('0x31')](_0xc6d8('0x32'))){_0x51616e[_0xc6d8('0x33')]=qs[_0xc6d8('0x33')](_0x4040d3['query'][_0xc6d8('0x33')]);_0x51616e[_0xc6d8('0x1a')]=qs[_0xc6d8('0x1a')](_0x4040d3['query'][_0xc6d8('0x1a')]);}_0x51616e[_0xc6d8('0x34')]=qs[_0xc6d8('0x35')](_0x4040d3[_0xc6d8('0x2a')]['sort']);_0x51616e[_0xc6d8('0x36')]=qs[_0xc6d8('0x2c')](_[_0xc6d8('0x37')](_0x4040d3[_0xc6d8('0x2a')],_0xd03fb5[_0xc6d8('0x2c')]));if(_0x4040d3['query'][_0xc6d8('0x38')]){_0x51616e[_0xc6d8('0x36')]=_[_0xc6d8('0x39')](_0x51616e[_0xc6d8('0x36')],{'$or':_[_0xc6d8('0x3a')](_0x2f8b18,function(_0x33c320){if(_0x33c320['type'][_0xc6d8('0x3b')]!==_0xc6d8('0x3c')){var _0x390de9={};_0x390de9[_0x33c320[_0xc6d8('0x3d')]]={'$like':'%'+_0x4040d3[_0xc6d8('0x2a')]['filter']+'%'};return _0x390de9;}})});}_0x51616e=_[_0xc6d8('0x39')]({},_0x51616e,_0x4040d3['options']);var _0xb6e01e={'where':_0x51616e[_0xc6d8('0x36')]};return db[_0xc6d8('0x27')][_0xc6d8('0x3e')](_0xb6e01e)[_0xc6d8('0x1f')](function(_0x2dc0dc){_0x9a30c8[_0xc6d8('0x3e')]=_0x2dc0dc;if(_0x4040d3[_0xc6d8('0x2a')]['includeAll']){_0x51616e[_0xc6d8('0x3f')]=[{'all':!![]}];}return db['SACompanyRelationship'][_0xc6d8('0x40')](_0x51616e);})[_0xc6d8('0x1f')](function(_0x4197c6){_0x9a30c8[_0xc6d8('0x41')]=_0x4197c6;return _0x9a30c8;})['then'](respondWithFilteredResult(_0x1af22a,_0x51616e))[_0xc6d8('0x42')](handleError(_0x1af22a,null));};exports[_0xc6d8('0x43')]=function(_0x4dad2e,_0x8a9dc5){var _0x36d4d5={'raw':![],'where':{'id':_0x4dad2e[_0xc6d8('0x44')]['id']}},_0x45c9d1={};_0x45c9d1[_0xc6d8('0x29')]=_['keys'](db['SACompanyRelationship'][_0xc6d8('0x28')]);_0x45c9d1['query']=_['keys'](_0x4dad2e[_0xc6d8('0x2a')]);_0x45c9d1[_0xc6d8('0x2c')]=_['intersection'](_0x45c9d1[_0xc6d8('0x29')],_0x45c9d1['query']);_0x36d4d5[_0xc6d8('0x2e')]=_[_0xc6d8('0x2d')](_0x45c9d1[_0xc6d8('0x29')],qs[_0xc6d8('0x2f')](_0x4dad2e['query'][_0xc6d8('0x2f')]));_0x36d4d5[_0xc6d8('0x2e')]=_0x36d4d5[_0xc6d8('0x2e')][_0xc6d8('0x30')]?_0x36d4d5[_0xc6d8('0x2e')]:_0x45c9d1[_0xc6d8('0x29')];if(_0x4dad2e['query'][_0xc6d8('0x45')]){_0x36d4d5[_0xc6d8('0x3f')]=[{'all':!![]}];}_0x36d4d5=_['merge']({},_0x36d4d5,_0x4dad2e['options']);return db[_0xc6d8('0x27')][_0xc6d8('0x46')](_0x36d4d5)['then'](handleEntityNotFound(_0x8a9dc5,null))[_0xc6d8('0x1f')](respondWithResult(_0x8a9dc5,null))['catch'](handleError(_0x8a9dc5,null));};exports[_0xc6d8('0x47')]=function(_0x1af6bd,_0x44c4bb){return db[_0xc6d8('0x27')][_0xc6d8('0x47')](_0x1af6bd['body'],{})['then'](respondWithResult(_0x44c4bb,0xc9))[_0xc6d8('0x42')](handleError(_0x44c4bb,null));};exports[_0xc6d8('0x1e')]=function(_0x275fe7,_0x1037bb){if(_0x275fe7['body']['id']){delete _0x275fe7['body']['id'];}return db['SACompanyRelationship'][_0xc6d8('0x46')]({'where':{'id':_0x275fe7[_0xc6d8('0x44')]['id']}})[_0xc6d8('0x1f')](handleEntityNotFound(_0x1037bb,null))[_0xc6d8('0x1f')](saveUpdates(_0x275fe7[_0xc6d8('0x48')],null))[_0xc6d8('0x1f')](respondWithResult(_0x1037bb,null))[_0xc6d8('0x42')](handleError(_0x1037bb,null));};exports[_0xc6d8('0x20')]=function(_0x4b8675,_0x27d5eb){return db[_0xc6d8('0x27')][_0xc6d8('0x46')]({'where':{'id':_0x4b8675[_0xc6d8('0x44')]['id']}})[_0xc6d8('0x1f')](handleEntityNotFound(_0x27d5eb,null))[_0xc6d8('0x1f')](removeEntity(_0x27d5eb,null))[_0xc6d8('0x42')](handleError(_0x27d5eb,null));};exports['describe']=function(_0x3dcf8a,_0x33b332){return db[_0xc6d8('0x27')]['describe']()['then'](respondWithResult(_0x33b332,null))['catch'](handleError(_0x33b332,null));}; \ No newline at end of file +var _0xee39=['rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','key','VIRTUAL','options','SACompanyRelationship','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xee39,0x144));var _0x9ee3=function(_0x4ba7ff,_0x5ae44c){_0x4ba7ff=_0x4ba7ff-0x0;var _0x2a6704=_0xee39[_0x4ba7ff];return _0x2a6704;};'use strict';var pdf=require(_0x9ee3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9ee3('0x1'));var zipdir=require(_0x9ee3('0x2'));var jsonpatch=require(_0x9ee3('0x3'));var rp=require('request-promise');var moment=require(_0x9ee3('0x4'));var BPromise=require(_0x9ee3('0x5'));var Mustache=require('mustache');var util=require(_0x9ee3('0x6'));var path=require(_0x9ee3('0x7'));var sox=require(_0x9ee3('0x8'));var csv=require(_0x9ee3('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9ee3('0xa'));var squel=require('squel');var crypto=require(_0x9ee3('0xb'));var jsforce=require(_0x9ee3('0xc'));var deskjs=require(_0x9ee3('0xd'));var toCsv=require(_0x9ee3('0x9'));var querystring=require(_0x9ee3('0xe'));var Papa=require(_0x9ee3('0xf'));var Redis=require('ioredis');var authService=require(_0x9ee3('0x10'));var qs=require(_0x9ee3('0x11'));var hardwareService=require(_0x9ee3('0x12'));var logger=require('../../config/logger')(_0x9ee3('0x13'));var utils=require(_0x9ee3('0x14'));var config=require('../../config/environment');var db=require(_0x9ee3('0x15'))['db'];function respondWithStatusCode(_0xb9c5cb,_0x42d9f7){_0x42d9f7=_0x42d9f7||0xcc;return function(_0x4efcb7){if(_0x4efcb7){return _0xb9c5cb[_0x9ee3('0x16')](_0x42d9f7);}return _0xb9c5cb[_0x9ee3('0x17')](_0x42d9f7)[_0x9ee3('0x18')]();};}function respondWithResult(_0x48d57f,_0x3250a5){_0x3250a5=_0x3250a5||0xc8;return function(_0x4e282b){if(_0x4e282b){return _0x48d57f[_0x9ee3('0x17')](_0x3250a5)[_0x9ee3('0x19')](_0x4e282b);}};}function respondWithFilteredResult(_0x287fee,_0x5fb610){return function(_0x1cda1c){if(_0x1cda1c){var _0x3068f4=_0x1cda1c[_0x9ee3('0x1a')],_0x20875e=_0x5fb610[_0x9ee3('0x1b')],_0x299205=_0x5fb610[_0x9ee3('0x1b')]+_0x5fb610[_0x9ee3('0x1c')],_0x116c0e;if(_0x299205>=_0x3068f4){_0x299205=_0x3068f4;_0x116c0e=0xc8;}else{_0x116c0e=0xce;}_0x287fee[_0x9ee3('0x17')](_0x116c0e);return _0x287fee[_0x9ee3('0x1d')](_0x9ee3('0x1e'),_0x20875e+'-'+_0x299205+'/'+_0x3068f4)['json'](_0x1cda1c);}return null;};}function patchUpdates(_0x43fc92){return function(_0xa20217){try{jsonpatch[_0x9ee3('0x1f')](_0xa20217,_0x43fc92,!![]);}catch(_0x4b40b6){return BPromise[_0x9ee3('0x20')](_0x4b40b6);}return _0xa20217[_0x9ee3('0x21')]();};}function saveUpdates(_0x7ebcf1,_0x50d876){return function(_0x2bfb25){if(_0x2bfb25){return _0x2bfb25[_0x9ee3('0x22')](_0x7ebcf1)[_0x9ee3('0x23')](function(_0x4c9a0c){return _0x4c9a0c;});}return null;};}function removeEntity(_0x2295aa,_0x230cf8){return function(_0x1a6704){if(_0x1a6704){return _0x1a6704[_0x9ee3('0x24')]()[_0x9ee3('0x23')](function(){_0x2295aa[_0x9ee3('0x17')](0xcc)[_0x9ee3('0x18')]();});}};}function handleEntityNotFound(_0x5a29e1,_0x3735f1){return function(_0x30ec15){if(!_0x30ec15){_0x5a29e1[_0x9ee3('0x16')](0x194);}return _0x30ec15;};}function handleError(_0x5e96ed,_0x49272c){_0x49272c=_0x49272c||0x1f4;return function(_0x1cec33){logger['error'](_0x1cec33[_0x9ee3('0x25')]);if(_0x1cec33[_0x9ee3('0x26')]){delete _0x1cec33[_0x9ee3('0x26')];}_0x5e96ed['status'](_0x49272c)[_0x9ee3('0x27')](_0x1cec33);};}exports[_0x9ee3('0x28')]=function(_0x32a4bc,_0x148d2f){var _0x26e744={},_0x9cfad0={},_0x2e13eb={'count':0x0,'rows':[]};var _0xbae720=db['SACompanyRelationship'][_0x9ee3('0x29')];_0x9cfad0[_0x9ee3('0x2a')]=_[_0x9ee3('0x2b')](_0xbae720);_0x9cfad0['query']=_[_0x9ee3('0x2b')](_0x32a4bc[_0x9ee3('0x2c')]);_0x9cfad0[_0x9ee3('0x2d')]=_[_0x9ee3('0x2e')](_0x9cfad0[_0x9ee3('0x2a')],_0x9cfad0[_0x9ee3('0x2c')]);_0x26e744[_0x9ee3('0x2f')]=_[_0x9ee3('0x2e')](_0x9cfad0[_0x9ee3('0x2a')],qs['fields'](_0x32a4bc['query']['fields']));_0x26e744[_0x9ee3('0x2f')]=_0x26e744[_0x9ee3('0x2f')][_0x9ee3('0x30')]?_0x26e744['attributes']:_0x9cfad0[_0x9ee3('0x2a')];if(!_0x32a4bc['query'][_0x9ee3('0x31')](_0x9ee3('0x32'))){_0x26e744[_0x9ee3('0x1c')]=qs[_0x9ee3('0x1c')](_0x32a4bc[_0x9ee3('0x2c')]['limit']);_0x26e744['offset']=qs[_0x9ee3('0x1b')](_0x32a4bc[_0x9ee3('0x2c')][_0x9ee3('0x1b')]);}_0x26e744['order']=qs[_0x9ee3('0x33')](_0x32a4bc[_0x9ee3('0x2c')][_0x9ee3('0x33')]);_0x26e744[_0x9ee3('0x34')]=qs['filters'](_[_0x9ee3('0x35')](_0x32a4bc[_0x9ee3('0x2c')],_0x9cfad0['filters']));if(_0x32a4bc[_0x9ee3('0x2c')][_0x9ee3('0x36')]){_0x26e744[_0x9ee3('0x34')]=_[_0x9ee3('0x37')](_0x26e744[_0x9ee3('0x34')],{'$or':_[_0x9ee3('0x38')](_0xbae720,function(_0x437812){if(_0x437812['type'][_0x9ee3('0x39')]!==_0x9ee3('0x3a')){var _0xe4e4d9={};_0xe4e4d9[_0x437812['field']]={'$like':'%'+_0x32a4bc['query'][_0x9ee3('0x36')]+'%'};return _0xe4e4d9;}})});}_0x26e744=_[_0x9ee3('0x37')]({},_0x26e744,_0x32a4bc[_0x9ee3('0x3b')]);var _0x31b9ce={'where':_0x26e744['where']};return db[_0x9ee3('0x3c')][_0x9ee3('0x1a')](_0x31b9ce)['then'](function(_0x29af75){_0x2e13eb['count']=_0x29af75;if(_0x32a4bc['query'][_0x9ee3('0x3d')]){_0x26e744[_0x9ee3('0x3e')]=[{'all':!![]}];}return db[_0x9ee3('0x3c')][_0x9ee3('0x3f')](_0x26e744);})['then'](function(_0x794097){_0x2e13eb[_0x9ee3('0x40')]=_0x794097;return _0x2e13eb;})['then'](respondWithFilteredResult(_0x148d2f,_0x26e744))[_0x9ee3('0x41')](handleError(_0x148d2f,null));};exports[_0x9ee3('0x42')]=function(_0x2f5f18,_0x4f2306){var _0x384fa={'raw':![],'where':{'id':_0x2f5f18[_0x9ee3('0x43')]['id']}},_0x45c45b={};_0x45c45b[_0x9ee3('0x2a')]=_[_0x9ee3('0x2b')](db[_0x9ee3('0x3c')][_0x9ee3('0x29')]);_0x45c45b['query']=_['keys'](_0x2f5f18[_0x9ee3('0x2c')]);_0x45c45b[_0x9ee3('0x2d')]=_[_0x9ee3('0x2e')](_0x45c45b[_0x9ee3('0x2a')],_0x45c45b[_0x9ee3('0x2c')]);_0x384fa[_0x9ee3('0x2f')]=_[_0x9ee3('0x2e')](_0x45c45b['model'],qs[_0x9ee3('0x44')](_0x2f5f18[_0x9ee3('0x2c')][_0x9ee3('0x44')]));_0x384fa['attributes']=_0x384fa[_0x9ee3('0x2f')][_0x9ee3('0x30')]?_0x384fa[_0x9ee3('0x2f')]:_0x45c45b[_0x9ee3('0x2a')];if(_0x2f5f18['query'][_0x9ee3('0x3d')]){_0x384fa['include']=[{'all':!![]}];}_0x384fa=_[_0x9ee3('0x37')]({},_0x384fa,_0x2f5f18[_0x9ee3('0x3b')]);return db[_0x9ee3('0x3c')][_0x9ee3('0x45')](_0x384fa)['then'](handleEntityNotFound(_0x4f2306,null))[_0x9ee3('0x23')](respondWithResult(_0x4f2306,null))[_0x9ee3('0x41')](handleError(_0x4f2306,null));};exports[_0x9ee3('0x46')]=function(_0x4dadc9,_0x53f16e){return db[_0x9ee3('0x3c')][_0x9ee3('0x46')](_0x4dadc9[_0x9ee3('0x47')],{})['then'](respondWithResult(_0x53f16e,0xc9))[_0x9ee3('0x41')](handleError(_0x53f16e,null));};exports['update']=function(_0x30c587,_0x2b586f){if(_0x30c587[_0x9ee3('0x47')]['id']){delete _0x30c587[_0x9ee3('0x47')]['id'];}return db[_0x9ee3('0x3c')][_0x9ee3('0x45')]({'where':{'id':_0x30c587[_0x9ee3('0x43')]['id']}})[_0x9ee3('0x23')](handleEntityNotFound(_0x2b586f,null))[_0x9ee3('0x23')](saveUpdates(_0x30c587[_0x9ee3('0x47')],null))['then'](respondWithResult(_0x2b586f,null))[_0x9ee3('0x41')](handleError(_0x2b586f,null));};exports[_0x9ee3('0x24')]=function(_0x2837cf,_0x37e326){return db[_0x9ee3('0x3c')][_0x9ee3('0x45')]({'where':{'id':_0x2837cf[_0x9ee3('0x43')]['id']}})[_0x9ee3('0x23')](handleEntityNotFound(_0x37e326,null))[_0x9ee3('0x23')](removeEntity(_0x37e326,null))[_0x9ee3('0x41')](handleError(_0x37e326,null));};exports[_0x9ee3('0x48')]=function(_0x423270,_0x3e25f2){return db[_0x9ee3('0x3c')][_0x9ee3('0x48')]()[_0x9ee3('0x23')](respondWithResult(_0x3e25f2,null))[_0x9ee3('0x41')](handleError(_0x3e25f2,null));}; \ No newline at end of file diff --git a/server/api/saCompanyRelationship/saCompanyRelationship.model.js b/server/api/saCompanyRelationship/saCompanyRelationship.model.js index 255d9ec..dacf909 100644 --- a/server/api/saCompanyRelationship/saCompanyRelationship.model.js +++ b/server/api/saCompanyRelationship/saCompanyRelationship.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4490=['define','SACompanyRelationship','sa_company_relationships','lodash','util','../../config/logger','api','moment','request-promise','./saCompanyRelationship.attributes','exports'];(function(_0x52f6a5,_0x4f7470){var _0x5db07d=function(_0x219f00){while(--_0x219f00){_0x52f6a5['push'](_0x52f6a5['shift']());}};_0x5db07d(++_0x4f7470);}(_0x4490,0x1a5));var _0x0449=function(_0x35921e,_0x2213e1){_0x35921e=_0x35921e-0x0;var _0x1c1039=_0x4490[_0x35921e];return _0x1c1039;};'use strict';var _=require(_0x0449('0x0'));var util=require(_0x0449('0x1'));var logger=require(_0x0449('0x2'))(_0x0449('0x3'));var moment=require(_0x0449('0x4'));var BPromise=require('bluebird');var rp=require(_0x0449('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0449('0x6'));module[_0x0449('0x7')]=function(_0x3f7326,_0x5d39c6){return _0x3f7326[_0x0449('0x8')](_0x0449('0x9'),attributes,{'tableName':_0x0449('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf928=['moment','bluebird','request-promise','./saCompanyRelationship.attributes','exports','SACompanyRelationship','sa_company_relationships','lodash','../../config/logger','api'];(function(_0x5d43a4,_0x4917c4){var _0xa11051=function(_0x32e341){while(--_0x32e341){_0x5d43a4['push'](_0x5d43a4['shift']());}};_0xa11051(++_0x4917c4);}(_0xf928,0x18d));var _0x8f92=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf928[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8f92('0x0'));var util=require('util');var logger=require(_0x8f92('0x1'))(_0x8f92('0x2'));var moment=require(_0x8f92('0x3'));var BPromise=require(_0x8f92('0x4'));var rp=require(_0x8f92('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8f92('0x6'));module[_0x8f92('0x7')]=function(_0x5003db,_0x3ff42c){return _0x5003db['define'](_0x8f92('0x8'),attributes,{'tableName':_0x8f92('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saCompanyRelationship/saCompanyRelationship.rpc.js b/server/api/saCompanyRelationship/saCompanyRelationship.rpc.js index 2357331..31aba4b 100644 --- a/server/api/saCompanyRelationship/saCompanyRelationship.rpc.js +++ b/server/api/saCompanyRelationship/saCompanyRelationship.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2aed=['http','request','then','SACompanyRelationship,\x20%s,\x20%s','request\x20sent','debug','SACompanyRelationship,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x919445,_0x5467dc){var _0x511b3e=function(_0xde10f3){while(--_0xde10f3){_0x919445['push'](_0x919445['shift']());}};_0x511b3e(++_0x5467dc);}(_0x2aed,0x107));var _0xd2ae=function(_0xd4ba9e,_0x17b7ff){_0xd4ba9e=_0xd4ba9e-0x0;var _0x54f365=_0x2aed[_0xd4ba9e];return _0x54f365;};'use strict';var _=require(_0xd2ae('0x0'));var util=require(_0xd2ae('0x1'));var moment=require(_0xd2ae('0x2'));var BPromise=require(_0xd2ae('0x3'));var rs=require(_0xd2ae('0x4'));var fs=require('fs');var Redis=require(_0xd2ae('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd2ae('0x6'));var logger=require(_0xd2ae('0x7'))(_0xd2ae('0x8'));var config=require(_0xd2ae('0x9'));var jayson=require(_0xd2ae('0xa'));var client=jayson[_0xd2ae('0xb')][_0xd2ae('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9a026b,_0x50207f,_0xaeaf07){return new BPromise(function(_0x432853,_0x14232a){return client[_0xd2ae('0xd')](_0x9a026b,_0xaeaf07)[_0xd2ae('0xe')](function(_0xe986b0){logger['info'](_0xd2ae('0xf'),_0x50207f,_0xd2ae('0x10'));logger[_0xd2ae('0x11')](_0xd2ae('0x12'),_0x50207f,_0xd2ae('0x10'),JSON[_0xd2ae('0x13')](_0xe986b0));if(_0xe986b0[_0xd2ae('0x14')]){if(_0xe986b0['error'][_0xd2ae('0x15')]===0x1f4){logger['error'](_0xd2ae('0xf'),_0x50207f,_0xe986b0[_0xd2ae('0x14')][_0xd2ae('0x16')]);return _0x14232a(_0xe986b0['error'][_0xd2ae('0x16')]);}logger['error']('SACompanyRelationship,\x20%s,\x20%s',_0x50207f,_0xe986b0[_0xd2ae('0x14')][_0xd2ae('0x16')]);return _0x432853(_0xe986b0[_0xd2ae('0x14')][_0xd2ae('0x16')]);}else{logger[_0xd2ae('0x17')](_0xd2ae('0xf'),_0x50207f,'request\x20sent');_0x432853(_0xe986b0[_0xd2ae('0x18')][_0xd2ae('0x16')]);}})['catch'](function(_0x6c28b8){logger[_0xd2ae('0x14')]('SACompanyRelationship,\x20%s,\x20%s',_0x50207f,_0x6c28b8);_0x14232a(_0x6c28b8);});});} \ No newline at end of file +var _0x09d3=['SACompanyRelationship,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','info','SACompanyRelationship,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x33d9b6,_0x4754e5){var _0x381370=function(_0x11293c){while(--_0x11293c){_0x33d9b6['push'](_0x33d9b6['shift']());}};_0x381370(++_0x4754e5);}(_0x09d3,0x6a));var _0x309d=function(_0x443cd8,_0x26d5a7){_0x443cd8=_0x443cd8-0x0;var _0x1fd66f=_0x09d3[_0x443cd8];return _0x1fd66f;};'use strict';var _=require('lodash');var util=require(_0x309d('0x0'));var moment=require(_0x309d('0x1'));var BPromise=require('bluebird');var rs=require(_0x309d('0x2'));var fs=require('fs');var Redis=require(_0x309d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x309d('0x4'));var logger=require(_0x309d('0x5'))(_0x309d('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x309d('0x7')][_0x309d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27cdff,_0x274236,_0xf9c6e0){return new BPromise(function(_0x6cdd57,_0x57849f){return client['request'](_0x27cdff,_0xf9c6e0)['then'](function(_0x48630d){logger[_0x309d('0x9')]('SACompanyRelationship,\x20%s,\x20%s',_0x274236,'request\x20sent');logger['debug'](_0x309d('0xa'),_0x274236,_0x309d('0xb'),JSON['stringify'](_0x48630d));if(_0x48630d[_0x309d('0xc')]){if(_0x48630d[_0x309d('0xc')]['code']===0x1f4){logger[_0x309d('0xc')](_0x309d('0xd'),_0x274236,_0x48630d[_0x309d('0xc')][_0x309d('0xe')]);return _0x57849f(_0x48630d[_0x309d('0xc')][_0x309d('0xe')]);}logger[_0x309d('0xc')]('SACompanyRelationship,\x20%s,\x20%s',_0x274236,_0x48630d[_0x309d('0xc')][_0x309d('0xe')]);return _0x6cdd57(_0x48630d[_0x309d('0xc')][_0x309d('0xe')]);}else{logger[_0x309d('0x9')]('SACompanyRelationship,\x20%s,\x20%s',_0x274236,_0x309d('0xb'));_0x6cdd57(_0x48630d[_0x309d('0xf')]['message']);}})[_0x309d('0x10')](function(_0x2ddf18){logger[_0x309d('0xc')]('SACompanyRelationship,\x20%s,\x20%s',_0x274236,_0x2ddf18);_0x57849f(_0x2ddf18);});});} \ No newline at end of file diff --git a/server/api/saCompanyType/index.js b/server/api/saCompanyType/index.js index 0f19d29..0f9cb0e 100644 --- a/server/api/saCompanyType/index.js +++ b/server/api/saCompanyType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac9d=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./saCompanyType.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xac9d,0x14d));var _0xdac9=function(_0x14f5c3,_0x1e3047){_0x14f5c3=_0x14f5c3-0x0;var _0x2ea070=_0xac9d[_0x14f5c3];return _0x2ea070;};'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('0x10')]('/',auth[_0xdac9('0x9')](),controller[_0xdac9('0x11')]);router[_0xdac9('0x12')](_0xdac9('0xe'),auth[_0xdac9('0x9')](),controller[_0xdac9('0x13')]);router[_0xdac9('0x14')]('/:id',auth[_0xdac9('0x9')](),controller[_0xdac9('0x15')]);module['exports']=router; \ No newline at end of file +var _0x24ca=['put','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./saCompanyType.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x24ca,0x1bc));var _0xa24c=function(_0x47e93d,_0x26bbdd){_0x47e93d=_0x47e93d-0x0;var _0xe86c46=_0x24ca[_0x47e93d];return _0xe86c46;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require(_0xa24c('0x1'));var timeout=require(_0xa24c('0x2'));var express=require(_0xa24c('0x3'));var router=express['Router']();var auth=require(_0xa24c('0x4'));var interaction=require(_0xa24c('0x5'));var config=require(_0xa24c('0x6'));var controller=require(_0xa24c('0x7'));router[_0xa24c('0x8')]('/',auth[_0xa24c('0x9')](),controller[_0xa24c('0xa')]);router[_0xa24c('0x8')](_0xa24c('0xb'),auth[_0xa24c('0x9')](),controller[_0xa24c('0xc')]);router['get'](_0xa24c('0xd'),auth[_0xa24c('0x9')](),controller[_0xa24c('0xe')]);router['post']('/',auth[_0xa24c('0x9')](),controller[_0xa24c('0xf')]);router[_0xa24c('0x10')](_0xa24c('0xd'),auth[_0xa24c('0x9')](),controller[_0xa24c('0x11')]);router[_0xa24c('0x12')](_0xa24c('0xd'),auth[_0xa24c('0x9')](),controller['destroy']);module[_0xa24c('0x13')]=router; \ No newline at end of file diff --git a/server/api/saCompanyType/saCompanyType.attributes.js b/server/api/saCompanyType/saCompanyType.attributes.js index 6ea2cbe..067816f 100644 --- a/server/api/saCompanyType/saCompanyType.attributes.js +++ b/server/api/saCompanyType/saCompanyType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00bb=['STRING','sequelize','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x00bb,0x1d8));var _0xb00b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x00bb[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0xb00b('0x0'));module[_0xb00b('0x1')]={'name':{'type':Sequelize[_0xb00b('0x2')],'allowNull':![],'unique':'name'},'fieldsToCheck':{'type':Sequelize[_0xb00b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xe644=['name','sequelize','exports','STRING'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4e64('0x0'));module[_0x4e64('0x1')]={'name':{'type':Sequelize[_0x4e64('0x2')],'allowNull':![],'unique':_0x4e64('0x3')},'fieldsToCheck':{'type':Sequelize[_0x4e64('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/saCompanyType/saCompanyType.controller.js b/server/api/saCompanyType/saCompanyType.controller.js index daa724b..53ac9b4 100644 --- a/server/api/saCompanyType/saCompanyType.controller.js +++ b/server/api/saCompanyType/saCompanyType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x506c=['where','pick','filter','merge','type','key','field','includeAll','include','findAll','rows','catch','show','params','intersection','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','SACompanyType','rawAttributes','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort'];(function(_0x541060,_0x336a59){var _0x1fdc4e=function(_0x198e5d){while(--_0x198e5d){_0x541060['push'](_0x541060['shift']());}};_0x1fdc4e(++_0x336a59);}(_0x506c,0xf5));var _0xc506=function(_0x4028c4,_0x37903a){_0x4028c4=_0x4028c4-0x0;var _0x3c556c=_0x506c[_0x4028c4];return _0x3c556c;};'use strict';var pdf=require(_0xc506('0x0'));var emlformat=require(_0xc506('0x1'));var rimraf=require(_0xc506('0x2'));var zipdir=require(_0xc506('0x3'));var jsonpatch=require(_0xc506('0x4'));var rp=require('request-promise');var moment=require(_0xc506('0x5'));var BPromise=require(_0xc506('0x6'));var Mustache=require(_0xc506('0x7'));var util=require('util');var path=require('path');var sox=require(_0xc506('0x8'));var csv=require(_0xc506('0x9'));var ejs=require(_0xc506('0xa'));var fs=require('fs');var _=require(_0xc506('0xb'));var squel=require('squel');var crypto=require(_0xc506('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc506('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc506('0xe'));var Papa=require(_0xc506('0xf'));var Redis=require('ioredis');var authService=require(_0xc506('0x10'));var qs=require(_0xc506('0x11'));var hardwareService=require(_0xc506('0x12'));var logger=require(_0xc506('0x13'))(_0xc506('0x14'));var utils=require('../../config/utils');var config=require(_0xc506('0x15'));var db=require(_0xc506('0x16'))['db'];function respondWithStatusCode(_0x53eba8,_0x13bfbd){_0x13bfbd=_0x13bfbd||0xcc;return function(_0xafdca9){if(_0xafdca9){return _0x53eba8[_0xc506('0x17')](_0x13bfbd);}return _0x53eba8[_0xc506('0x18')](_0x13bfbd)[_0xc506('0x19')]();};}function respondWithResult(_0x5112e9,_0x25cf38){_0x25cf38=_0x25cf38||0xc8;return function(_0x3c7348){if(_0x3c7348){return _0x5112e9[_0xc506('0x18')](_0x25cf38)[_0xc506('0x1a')](_0x3c7348);}};}function respondWithFilteredResult(_0x55a309,_0xf3d470){return function(_0x1ab65f){if(_0x1ab65f){var _0x378725=_0x1ab65f[_0xc506('0x1b')],_0x8c27f6=_0xf3d470[_0xc506('0x1c')],_0x33c896=_0xf3d470[_0xc506('0x1c')]+_0xf3d470['limit'],_0x28cf40;if(_0x33c896>=_0x378725){_0x33c896=_0x378725;_0x28cf40=0xc8;}else{_0x28cf40=0xce;}_0x55a309[_0xc506('0x18')](_0x28cf40);return _0x55a309[_0xc506('0x1d')](_0xc506('0x1e'),_0x8c27f6+'-'+_0x33c896+'/'+_0x378725)['json'](_0x1ab65f);}return null;};}function patchUpdates(_0x330823){return function(_0x4e587d){try{jsonpatch[_0xc506('0x1f')](_0x4e587d,_0x330823,!![]);}catch(_0x128114){return BPromise[_0xc506('0x20')](_0x128114);}return _0x4e587d[_0xc506('0x21')]();};}function saveUpdates(_0x4a2115,_0x3532b8){return function(_0x35f3f8){if(_0x35f3f8){return _0x35f3f8[_0xc506('0x22')](_0x4a2115)[_0xc506('0x23')](function(_0x1f64a1){return _0x1f64a1;});}return null;};}function removeEntity(_0x4a5d9f,_0x2809b9){return function(_0x561c76){if(_0x561c76){return _0x561c76[_0xc506('0x24')]()[_0xc506('0x23')](function(){_0x4a5d9f[_0xc506('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a1043,_0x5aef10){return function(_0x5355ef){if(!_0x5355ef){_0x4a1043[_0xc506('0x17')](0x194);}return _0x5355ef;};}function handleError(_0x424d36,_0x17781f){_0x17781f=_0x17781f||0x1f4;return function(_0x194265){logger[_0xc506('0x25')](_0x194265[_0xc506('0x26')]);if(_0x194265[_0xc506('0x27')]){delete _0x194265[_0xc506('0x27')];}_0x424d36[_0xc506('0x18')](_0x17781f)['send'](_0x194265);};}exports[_0xc506('0x28')]=function(_0x45984b,_0x151dfd){var _0xe49ced={},_0x1efdc9={},_0x16047a={'count':0x0,'rows':[]};var _0x5107c7=db[_0xc506('0x29')][_0xc506('0x2a')];_0x1efdc9[_0xc506('0x2b')]=_[_0xc506('0x2c')](_0x5107c7);_0x1efdc9[_0xc506('0x2d')]=_[_0xc506('0x2c')](_0x45984b['query']);_0x1efdc9[_0xc506('0x2e')]=_['intersection'](_0x1efdc9[_0xc506('0x2b')],_0x1efdc9[_0xc506('0x2d')]);_0xe49ced['attributes']=_['intersection'](_0x1efdc9['model'],qs[_0xc506('0x2f')](_0x45984b[_0xc506('0x2d')]['fields']));_0xe49ced[_0xc506('0x30')]=_0xe49ced[_0xc506('0x30')][_0xc506('0x31')]?_0xe49ced[_0xc506('0x30')]:_0x1efdc9['model'];if(!_0x45984b[_0xc506('0x2d')][_0xc506('0x32')](_0xc506('0x33'))){_0xe49ced[_0xc506('0x34')]=qs[_0xc506('0x34')](_0x45984b[_0xc506('0x2d')][_0xc506('0x34')]);_0xe49ced[_0xc506('0x1c')]=qs['offset'](_0x45984b[_0xc506('0x2d')][_0xc506('0x1c')]);}_0xe49ced[_0xc506('0x35')]=qs[_0xc506('0x36')](_0x45984b[_0xc506('0x2d')][_0xc506('0x36')]);_0xe49ced[_0xc506('0x37')]=qs['filters'](_[_0xc506('0x38')](_0x45984b[_0xc506('0x2d')],_0x1efdc9['filters']));if(_0x45984b[_0xc506('0x2d')][_0xc506('0x39')]){_0xe49ced[_0xc506('0x37')]=_[_0xc506('0x3a')](_0xe49ced['where'],{'$or':_['map'](_0x5107c7,function(_0x1fb1bc){if(_0x1fb1bc[_0xc506('0x3b')][_0xc506('0x3c')]!=='VIRTUAL'){var _0x50bbd9={};_0x50bbd9[_0x1fb1bc[_0xc506('0x3d')]]={'$like':'%'+_0x45984b['query'][_0xc506('0x39')]+'%'};return _0x50bbd9;}})});}_0xe49ced=_['merge']({},_0xe49ced,_0x45984b['options']);var _0x2f98e1={'where':_0xe49ced[_0xc506('0x37')]};return db[_0xc506('0x29')]['count'](_0x2f98e1)[_0xc506('0x23')](function(_0x2a6723){_0x16047a[_0xc506('0x1b')]=_0x2a6723;if(_0x45984b[_0xc506('0x2d')][_0xc506('0x3e')]){_0xe49ced[_0xc506('0x3f')]=[{'all':!![]}];}return db['SACompanyType'][_0xc506('0x40')](_0xe49ced);})['then'](function(_0xe7ea25){_0x16047a[_0xc506('0x41')]=_0xe7ea25;return _0x16047a;})[_0xc506('0x23')](respondWithFilteredResult(_0x151dfd,_0xe49ced))[_0xc506('0x42')](handleError(_0x151dfd,null));};exports[_0xc506('0x43')]=function(_0x1905fd,_0x39de82){var _0x27150f={'raw':![],'where':{'id':_0x1905fd[_0xc506('0x44')]['id']}},_0x159ed8={};_0x159ed8[_0xc506('0x2b')]=_['keys'](db[_0xc506('0x29')][_0xc506('0x2a')]);_0x159ed8[_0xc506('0x2d')]=_['keys'](_0x1905fd['query']);_0x159ed8[_0xc506('0x2e')]=_[_0xc506('0x45')](_0x159ed8[_0xc506('0x2b')],_0x159ed8['query']);_0x27150f[_0xc506('0x30')]=_[_0xc506('0x45')](_0x159ed8[_0xc506('0x2b')],qs[_0xc506('0x2f')](_0x1905fd[_0xc506('0x2d')][_0xc506('0x2f')]));_0x27150f[_0xc506('0x30')]=_0x27150f[_0xc506('0x30')][_0xc506('0x31')]?_0x27150f[_0xc506('0x30')]:_0x159ed8['model'];if(_0x1905fd[_0xc506('0x2d')]['includeAll']){_0x27150f[_0xc506('0x3f')]=[{'all':!![]}];}_0x27150f=_['merge']({},_0x27150f,_0x1905fd[_0xc506('0x46')]);return db[_0xc506('0x29')][_0xc506('0x47')](_0x27150f)['then'](handleEntityNotFound(_0x39de82,null))[_0xc506('0x23')](respondWithResult(_0x39de82,null))['catch'](handleError(_0x39de82,null));};exports[_0xc506('0x48')]=function(_0x1b6db1,_0x3d20f2){return db[_0xc506('0x29')][_0xc506('0x48')](_0x1b6db1[_0xc506('0x49')],{})[_0xc506('0x23')](respondWithResult(_0x3d20f2,0xc9))[_0xc506('0x42')](handleError(_0x3d20f2,null));};exports['update']=function(_0x5d0ca8,_0x3e0b9b){if(_0x5d0ca8[_0xc506('0x49')]['id']){delete _0x5d0ca8[_0xc506('0x49')]['id'];}return db[_0xc506('0x29')][_0xc506('0x47')]({'where':{'id':_0x5d0ca8['params']['id']}})[_0xc506('0x23')](handleEntityNotFound(_0x3e0b9b,null))[_0xc506('0x23')](saveUpdates(_0x5d0ca8[_0xc506('0x49')],null))['then'](respondWithResult(_0x3e0b9b,null))['catch'](handleError(_0x3e0b9b,null));};exports[_0xc506('0x24')]=function(_0x48c74d,_0x572750){return db[_0xc506('0x29')][_0xc506('0x47')]({'where':{'id':_0x48c74d[_0xc506('0x44')]['id']}})[_0xc506('0x23')](handleEntityNotFound(_0x572750,null))['then'](removeEntity(_0x572750,null))[_0xc506('0x42')](handleError(_0x572750,null));};exports[_0xc506('0x4a')]=function(_0x17a3b7,_0x281a88){return db[_0xc506('0x29')][_0xc506('0x4a')]()[_0xc506('0x23')](respondWithResult(_0x281a88,null))[_0xc506('0x42')](handleError(_0x281a88,null));}; \ No newline at end of file +var _0x8742=['json','count','offset','limit','Content-Range','apply','then','destroy','sendStatus','error','name','index','rawAttributes','keys','query','intersection','model','attributes','fields','length','order','sort','where','pick','filters','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','SACompanyType','findAll','rows','show','params','find','catch','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end'];(function(_0x26045d,_0x3e437a){var _0x5b6567=function(_0x2dc57b){while(--_0x2dc57b){_0x26045d['push'](_0x26045d['shift']());}};_0x5b6567(++_0x3e437a);}(_0x8742,0x1ef));var _0x2874=function(_0x3452c1,_0x4a0ea1){_0x3452c1=_0x3452c1-0x0;var _0x2a1e8a=_0x8742[_0x3452c1];return _0x2a1e8a;};'use strict';var pdf=require(_0x2874('0x0'));var emlformat=require(_0x2874('0x1'));var rimraf=require(_0x2874('0x2'));var zipdir=require(_0x2874('0x3'));var jsonpatch=require(_0x2874('0x4'));var rp=require(_0x2874('0x5'));var moment=require(_0x2874('0x6'));var BPromise=require(_0x2874('0x7'));var Mustache=require('mustache');var util=require(_0x2874('0x8'));var path=require(_0x2874('0x9'));var sox=require(_0x2874('0xa'));var csv=require(_0x2874('0xb'));var ejs=require(_0x2874('0xc'));var fs=require('fs');var _=require(_0x2874('0xd'));var squel=require(_0x2874('0xe'));var crypto=require('crypto');var jsforce=require(_0x2874('0xf'));var deskjs=require(_0x2874('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2874('0x11'));var Papa=require(_0x2874('0x12'));var Redis=require(_0x2874('0x13'));var authService=require(_0x2874('0x14'));var qs=require(_0x2874('0x15'));var hardwareService=require(_0x2874('0x16'));var logger=require(_0x2874('0x17'))(_0x2874('0x18'));var utils=require(_0x2874('0x19'));var config=require(_0x2874('0x1a'));var db=require(_0x2874('0x1b'))['db'];function respondWithStatusCode(_0x58bac2,_0x3155eb){_0x3155eb=_0x3155eb||0xcc;return function(_0x4dfac6){if(_0x4dfac6){return _0x58bac2['sendStatus'](_0x3155eb);}return _0x58bac2[_0x2874('0x1c')](_0x3155eb)[_0x2874('0x1d')]();};}function respondWithResult(_0x2c1631,_0x17ea9d){_0x17ea9d=_0x17ea9d||0xc8;return function(_0x8f3fb7){if(_0x8f3fb7){return _0x2c1631[_0x2874('0x1c')](_0x17ea9d)[_0x2874('0x1e')](_0x8f3fb7);}};}function respondWithFilteredResult(_0x1c4bf8,_0x3b74d1){return function(_0x76ca3){if(_0x76ca3){var _0x49fbcc=_0x76ca3[_0x2874('0x1f')],_0x120ab9=_0x3b74d1[_0x2874('0x20')],_0x593a65=_0x3b74d1[_0x2874('0x20')]+_0x3b74d1[_0x2874('0x21')],_0x49c883;if(_0x593a65>=_0x49fbcc){_0x593a65=_0x49fbcc;_0x49c883=0xc8;}else{_0x49c883=0xce;}_0x1c4bf8[_0x2874('0x1c')](_0x49c883);return _0x1c4bf8['set'](_0x2874('0x22'),_0x120ab9+'-'+_0x593a65+'/'+_0x49fbcc)[_0x2874('0x1e')](_0x76ca3);}return null;};}function patchUpdates(_0x40eb6c){return function(_0x6c3fea){try{jsonpatch[_0x2874('0x23')](_0x6c3fea,_0x40eb6c,!![]);}catch(_0x1859c1){return BPromise['reject'](_0x1859c1);}return _0x6c3fea['save']();};}function saveUpdates(_0x57acfa,_0x36347b){return function(_0x371397){if(_0x371397){return _0x371397['update'](_0x57acfa)[_0x2874('0x24')](function(_0x298682){return _0x298682;});}return null;};}function removeEntity(_0x570364,_0x3acfce){return function(_0x571dab){if(_0x571dab){return _0x571dab[_0x2874('0x25')]()[_0x2874('0x24')](function(){_0x570364[_0x2874('0x1c')](0xcc)[_0x2874('0x1d')]();});}};}function handleEntityNotFound(_0x365a94,_0x50dd78){return function(_0x6ba212){if(!_0x6ba212){_0x365a94[_0x2874('0x26')](0x194);}return _0x6ba212;};}function handleError(_0x1a6417,_0x12367a){_0x12367a=_0x12367a||0x1f4;return function(_0x469004){logger[_0x2874('0x27')](_0x469004['stack']);if(_0x469004[_0x2874('0x28')]){delete _0x469004['name'];}_0x1a6417['status'](_0x12367a)['send'](_0x469004);};}exports[_0x2874('0x29')]=function(_0x29ef88,_0x45bcec){var _0x5545d6={},_0x21bdc7={},_0x27da90={'count':0x0,'rows':[]};var _0x1e4423=db['SACompanyType'][_0x2874('0x2a')];_0x21bdc7['model']=_[_0x2874('0x2b')](_0x1e4423);_0x21bdc7['query']=_['keys'](_0x29ef88[_0x2874('0x2c')]);_0x21bdc7['filters']=_[_0x2874('0x2d')](_0x21bdc7[_0x2874('0x2e')],_0x21bdc7[_0x2874('0x2c')]);_0x5545d6[_0x2874('0x2f')]=_[_0x2874('0x2d')](_0x21bdc7[_0x2874('0x2e')],qs['fields'](_0x29ef88['query'][_0x2874('0x30')]));_0x5545d6[_0x2874('0x2f')]=_0x5545d6['attributes'][_0x2874('0x31')]?_0x5545d6[_0x2874('0x2f')]:_0x21bdc7[_0x2874('0x2e')];if(!_0x29ef88[_0x2874('0x2c')]['hasOwnProperty']('nolimit')){_0x5545d6[_0x2874('0x21')]=qs[_0x2874('0x21')](_0x29ef88[_0x2874('0x2c')][_0x2874('0x21')]);_0x5545d6[_0x2874('0x20')]=qs[_0x2874('0x20')](_0x29ef88['query']['offset']);}_0x5545d6[_0x2874('0x32')]=qs[_0x2874('0x33')](_0x29ef88[_0x2874('0x2c')][_0x2874('0x33')]);_0x5545d6[_0x2874('0x34')]=qs['filters'](_[_0x2874('0x35')](_0x29ef88[_0x2874('0x2c')],_0x21bdc7[_0x2874('0x36')]));if(_0x29ef88[_0x2874('0x2c')][_0x2874('0x37')]){_0x5545d6[_0x2874('0x34')]=_[_0x2874('0x38')](_0x5545d6[_0x2874('0x34')],{'$or':_[_0x2874('0x39')](_0x1e4423,function(_0x6746e6){if(_0x6746e6['type'][_0x2874('0x3a')]!==_0x2874('0x3b')){var _0x494b44={};_0x494b44[_0x6746e6[_0x2874('0x3c')]]={'$like':'%'+_0x29ef88[_0x2874('0x2c')][_0x2874('0x37')]+'%'};return _0x494b44;}})});}_0x5545d6=_[_0x2874('0x38')]({},_0x5545d6,_0x29ef88[_0x2874('0x3d')]);var _0x5cd3d4={'where':_0x5545d6[_0x2874('0x34')]};return db['SACompanyType'][_0x2874('0x1f')](_0x5cd3d4)['then'](function(_0x49aac4){_0x27da90[_0x2874('0x1f')]=_0x49aac4;if(_0x29ef88[_0x2874('0x2c')][_0x2874('0x3e')]){_0x5545d6[_0x2874('0x3f')]=[{'all':!![]}];}return db[_0x2874('0x40')][_0x2874('0x41')](_0x5545d6);})[_0x2874('0x24')](function(_0x19878f){_0x27da90[_0x2874('0x42')]=_0x19878f;return _0x27da90;})[_0x2874('0x24')](respondWithFilteredResult(_0x45bcec,_0x5545d6))['catch'](handleError(_0x45bcec,null));};exports[_0x2874('0x43')]=function(_0x37fa59,_0x230083){var _0x4bb113={'raw':![],'where':{'id':_0x37fa59[_0x2874('0x44')]['id']}},_0x2c54ea={};_0x2c54ea[_0x2874('0x2e')]=_[_0x2874('0x2b')](db['SACompanyType'][_0x2874('0x2a')]);_0x2c54ea[_0x2874('0x2c')]=_[_0x2874('0x2b')](_0x37fa59['query']);_0x2c54ea[_0x2874('0x36')]=_[_0x2874('0x2d')](_0x2c54ea[_0x2874('0x2e')],_0x2c54ea[_0x2874('0x2c')]);_0x4bb113[_0x2874('0x2f')]=_[_0x2874('0x2d')](_0x2c54ea[_0x2874('0x2e')],qs[_0x2874('0x30')](_0x37fa59[_0x2874('0x2c')][_0x2874('0x30')]));_0x4bb113['attributes']=_0x4bb113[_0x2874('0x2f')][_0x2874('0x31')]?_0x4bb113['attributes']:_0x2c54ea[_0x2874('0x2e')];if(_0x37fa59[_0x2874('0x2c')][_0x2874('0x3e')]){_0x4bb113[_0x2874('0x3f')]=[{'all':!![]}];}_0x4bb113=_[_0x2874('0x38')]({},_0x4bb113,_0x37fa59[_0x2874('0x3d')]);return db[_0x2874('0x40')][_0x2874('0x45')](_0x4bb113)['then'](handleEntityNotFound(_0x230083,null))[_0x2874('0x24')](respondWithResult(_0x230083,null))[_0x2874('0x46')](handleError(_0x230083,null));};exports[_0x2874('0x47')]=function(_0x57ab31,_0x51cff4){return db[_0x2874('0x40')]['create'](_0x57ab31[_0x2874('0x48')],{})[_0x2874('0x24')](respondWithResult(_0x51cff4,0xc9))[_0x2874('0x46')](handleError(_0x51cff4,null));};exports[_0x2874('0x49')]=function(_0x59fe74,_0x22fed5){if(_0x59fe74[_0x2874('0x48')]['id']){delete _0x59fe74[_0x2874('0x48')]['id'];}return db[_0x2874('0x40')][_0x2874('0x45')]({'where':{'id':_0x59fe74['params']['id']}})[_0x2874('0x24')](handleEntityNotFound(_0x22fed5,null))['then'](saveUpdates(_0x59fe74[_0x2874('0x48')],null))['then'](respondWithResult(_0x22fed5,null))['catch'](handleError(_0x22fed5,null));};exports[_0x2874('0x25')]=function(_0x16a76d,_0x12352f){return db[_0x2874('0x40')]['find']({'where':{'id':_0x16a76d[_0x2874('0x44')]['id']}})['then'](handleEntityNotFound(_0x12352f,null))[_0x2874('0x24')](removeEntity(_0x12352f,null))[_0x2874('0x46')](handleError(_0x12352f,null));};exports[_0x2874('0x4a')]=function(_0x398928,_0xfee0d0){return db['SACompanyType'][_0x2874('0x4a')]()[_0x2874('0x24')](respondWithResult(_0xfee0d0,null))[_0x2874('0x46')](handleError(_0xfee0d0,null));}; \ No newline at end of file diff --git a/server/api/saCompanyType/saCompanyType.model.js b/server/api/saCompanyType/saCompanyType.model.js index 1f284a4..d39d9ae 100644 --- a/server/api/saCompanyType/saCompanyType.model.js +++ b/server/api/saCompanyType/saCompanyType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd09=['sa_company_types','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./saCompanyType.attributes','exports','define','SACompanyType'];(function(_0x1b6a85,_0x24aaf2){var _0x4abd90=function(_0x38787f){while(--_0x38787f){_0x1b6a85['push'](_0x1b6a85['shift']());}};_0x4abd90(++_0x24aaf2);}(_0xfd09,0x109));var _0x9fd0=function(_0x324f55,_0x2e6ca4){_0x324f55=_0x324f55-0x0;var _0x284952=_0xfd09[_0x324f55];return _0x284952;};'use strict';var _=require('lodash');var util=require(_0x9fd0('0x0'));var logger=require(_0x9fd0('0x1'))('api');var moment=require(_0x9fd0('0x2'));var BPromise=require('bluebird');var rp=require(_0x9fd0('0x3'));var fs=require('fs');var path=require(_0x9fd0('0x4'));var rimraf=require(_0x9fd0('0x5'));var config=require(_0x9fd0('0x6'));var attributes=require(_0x9fd0('0x7'));module[_0x9fd0('0x8')]=function(_0x3508fd,_0x4bd375){return _0x3508fd[_0x9fd0('0x9')](_0x9fd0('0xa'),attributes,{'tableName':_0x9fd0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4eb8=['define','SACompanyType','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3a21c0,_0x348451){var _0x411e84=function(_0xdd7b02){while(--_0xdd7b02){_0x3a21c0['push'](_0x3a21c0['shift']());}};_0x411e84(++_0x348451);}(_0x4eb8,0xca));var _0x84eb=function(_0x18894b,_0xb20093){_0x18894b=_0x18894b-0x0;var _0x4b3230=_0x4eb8[_0x18894b];return _0x4b3230;};'use strict';var _=require(_0x84eb('0x0'));var util=require('util');var logger=require(_0x84eb('0x1'))(_0x84eb('0x2'));var moment=require(_0x84eb('0x3'));var BPromise=require('bluebird');var rp=require(_0x84eb('0x4'));var fs=require('fs');var path=require(_0x84eb('0x5'));var rimraf=require(_0x84eb('0x6'));var config=require(_0x84eb('0x7'));var attributes=require('./saCompanyType.attributes');module['exports']=function(_0xa417ca,_0x114056){return _0xa417ca[_0x84eb('0x8')](_0x84eb('0x9'),attributes,{'tableName':'sa_company_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saCompanyType/saCompanyType.rpc.js b/server/api/saCompanyType/saCompanyType.rpc.js index 7cae33f..6d292d3 100644 --- a/server/api/saCompanyType/saCompanyType.rpc.js +++ b/server/api/saCompanyType/saCompanyType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5713=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','debug','SACompanyType,\x20%s,\x20%s,\x20%s','request\x20sent','error','SACompanyType,\x20%s,\x20%s','message','result','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x121d04,_0x1bf26b){var _0xa39e0=function(_0x2fd971){while(--_0x2fd971){_0x121d04['push'](_0x121d04['shift']());}};_0xa39e0(++_0x1bf26b);}(_0x5713,0x1c7));var _0x3571=function(_0x4b7fc8,_0x4f8a7d){_0x4b7fc8=_0x4b7fc8-0x0;var _0x3458a1=_0x5713[_0x4b7fc8];return _0x3458a1;};'use strict';var _=require(_0x3571('0x0'));var util=require(_0x3571('0x1'));var moment=require('moment');var BPromise=require(_0x3571('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3571('0x3'));var db=require(_0x3571('0x4'))['db'];var utils=require(_0x3571('0x5'));var logger=require(_0x3571('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3571('0x7'));var client=jayson[_0x3571('0x8')][_0x3571('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x432a48,_0x3a6f29,_0x1f8f0f){return new BPromise(function(_0x48b06d,_0x358ba1){return client[_0x3571('0xa')](_0x432a48,_0x1f8f0f)[_0x3571('0xb')](function(_0x288fc8){logger[_0x3571('0xc')]('SACompanyType,\x20%s,\x20%s',_0x3a6f29,'request\x20sent');logger[_0x3571('0xd')](_0x3571('0xe'),_0x3a6f29,_0x3571('0xf'),JSON['stringify'](_0x288fc8));if(_0x288fc8['error']){if(_0x288fc8['error']['code']===0x1f4){logger[_0x3571('0x10')](_0x3571('0x11'),_0x3a6f29,_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);return _0x358ba1(_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);}logger[_0x3571('0x10')](_0x3571('0x11'),_0x3a6f29,_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);return _0x48b06d(_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);}else{logger[_0x3571('0xc')](_0x3571('0x11'),_0x3a6f29,_0x3571('0xf'));_0x48b06d(_0x288fc8[_0x3571('0x13')]['message']);}})['catch'](function(_0x48c77e){logger[_0x3571('0x10')]('SACompanyType,\x20%s,\x20%s',_0x3a6f29,_0x48c77e);_0x358ba1(_0x48c77e);});});} \ No newline at end of file +var _0x42f4=['jayson/promise','http','then','request\x20sent','debug','SACompanyType,\x20%s,\x20%s,\x20%s','stringify','error','code','SACompanyType,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment'];(function(_0x3bd945,_0x4375a0){var _0x2a1a18=function(_0x3c929a){while(--_0x3c929a){_0x3bd945['push'](_0x3bd945['shift']());}};_0x2a1a18(++_0x4375a0);}(_0x42f4,0x19d));var _0x442f=function(_0x53f964,_0x3b52b8){_0x53f964=_0x53f964-0x0;var _0x17be6c=_0x42f4[_0x53f964];return _0x17be6c;};'use strict';var _=require(_0x442f('0x0'));var util=require('util');var moment=require(_0x442f('0x1'));var BPromise=require(_0x442f('0x2'));var rs=require(_0x442f('0x3'));var fs=require('fs');var Redis=require(_0x442f('0x4'));var db=require(_0x442f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x442f('0x6'));var jayson=require(_0x442f('0x7'));var client=jayson['client'][_0x442f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11b450,_0x23c5ba,_0x37dfe7){return new BPromise(function(_0x6c0b4b,_0x476480){return client['request'](_0x11b450,_0x37dfe7)[_0x442f('0x9')](function(_0x4e32af){logger['info']('SACompanyType,\x20%s,\x20%s',_0x23c5ba,_0x442f('0xa'));logger[_0x442f('0xb')](_0x442f('0xc'),_0x23c5ba,_0x442f('0xa'),JSON[_0x442f('0xd')](_0x4e32af));if(_0x4e32af[_0x442f('0xe')]){if(_0x4e32af[_0x442f('0xe')][_0x442f('0xf')]===0x1f4){logger[_0x442f('0xe')](_0x442f('0x10'),_0x23c5ba,_0x4e32af['error'][_0x442f('0x11')]);return _0x476480(_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);}logger[_0x442f('0xe')](_0x442f('0x10'),_0x23c5ba,_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);return _0x6c0b4b(_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);}else{logger[_0x442f('0x12')](_0x442f('0x10'),_0x23c5ba,_0x442f('0xa'));_0x6c0b4b(_0x4e32af[_0x442f('0x13')][_0x442f('0x11')]);}})[_0x442f('0x14')](function(_0x3ff2b1){logger['error'](_0x442f('0x10'),_0x23c5ba,_0x3ff2b1);_0x476480(_0x3ff2b1);});});} \ No newline at end of file diff --git a/server/api/saCreditNote/index.js b/server/api/saCreditNote/index.js index 058000b..910c1d5 100644 --- a/server/api/saCreditNote/index.js +++ b/server/api/saCreditNote/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./saCreditNote.controller','get','isAuthenticated','/describe','/:id','/:id/download','getCreditnotePDF','post','update'];(function(_0x27deda,_0x300d08){var _0x29c0eb=function(_0x2d9a77){while(--_0x2d9a77){_0x27deda['push'](_0x27deda['shift']());}};_0x29c0eb(++_0x300d08);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')]('/',auth[_0x0a9e('0x8')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);module[_0x0a9e('0x11')]=router; \ No newline at end of file +var _0xb10b=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./saCreditNote.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','create','put','delete','destroy','exports','multer','path'];(function(_0x6e75cf,_0x490044){var _0x3c2e9d=function(_0x2f0714){while(--_0x2f0714){_0x6e75cf['push'](_0x6e75cf['shift']());}};_0x3c2e9d(++_0x490044);}(_0xb10b,0x12a));var _0xbb10=function(_0x5e9665,_0x439465){_0x5e9665=_0x5e9665-0x0;var _0x5bf400=_0xb10b[_0x5e9665];return _0x5bf400;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getCreditnotePDF']);router['post']('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router[_0xbb10('0x10')]('/:id',auth[_0xbb10('0x9')](),controller['update']);router[_0xbb10('0x11')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);module[_0xbb10('0x13')]=router; \ No newline at end of file diff --git a/server/api/saCreditNote/saCreditNote.attributes.js b/server/api/saCreditNote/saCreditNote.attributes.js index 59051eb..979c2e1 100644 --- a/server/api/saCreditNote/saCreditNote.attributes.js +++ b/server/api/saCreditNote/saCreditNote.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1605=['INTEGER','TEXT','BOOLEAN','DATE','exports','STRING'];(function(_0x3d1934,_0x1e5f29){var _0x2562fd=function(_0x3fd24c){while(--_0x3fd24c){_0x3d1934['push'](_0x3d1934['shift']());}};_0x2562fd(++_0x1e5f29);}(_0x1605,0xe2));var _0x5160=function(_0x1c1fd1,_0x215dd7){_0x1c1fd1=_0x1c1fd1-0x0;var _0x3dddc0=_0x1605[_0x1c1fd1];return _0x3dddc0;};'use strict';var Sequelize=require('sequelize');module[_0x5160('0x0')]={'name':{'type':Sequelize[_0x5160('0x1')],'allowNull':![]},'InvoiceId':{'type':Sequelize[_0x5160('0x2')]},'note':{'type':Sequelize[_0x5160('0x3')]},'agentFullname':{'type':Sequelize[_0x5160('0x1')]},'status':{'type':Sequelize[_0x5160('0x3')]},'companyName':{'type':Sequelize[_0x5160('0x1')],'allowNull':![]},'companyId':{'type':Sequelize[_0x5160('0x2')],'allowNull':![]},'paid':{'type':Sequelize[_0x5160('0x2')],'defaultValue':0x0},'discount':{'type':Sequelize['DECIMAL'](0xd,0x4)},'receivingStreet':{'type':Sequelize['STRING']},'receivingPostalCode':{'type':Sequelize[_0x5160('0x1')]},'receivingCity':{'type':Sequelize['STRING']},'receivingCountry':{'type':Sequelize[_0x5160('0x1')]},'receivingISOCode':{'type':Sequelize[_0x5160('0x1')](0x3)},'receivingFiscalCode':{'type':Sequelize[_0x5160('0x1')](0x32)},'receivingPIVA':{'type':Sequelize[_0x5160('0x1')](0x32)},'receivingSDICode':{'type':Sequelize[_0x5160('0x1')](0x15)},'receivingFiscalMessage':{'type':Sequelize[_0x5160('0x1')](0x3e8)},'receivingExpiryDay':{'type':Sequelize[_0x5160('0x2')]},'receivingEurope':{'type':Sequelize[_0x5160('0x4')]},'receivingSocCap':{'type':Sequelize[_0x5160('0x1')](0xff)},'issuerName':{'type':Sequelize[_0x5160('0x1')]},'issuerStreet':{'type':Sequelize[_0x5160('0x1')]},'issuerPostalCode':{'type':Sequelize[_0x5160('0x1')]},'issuerCity':{'type':Sequelize[_0x5160('0x1')]},'issuerCountry':{'type':Sequelize[_0x5160('0x1')]},'issuerISOCode':{'type':Sequelize[_0x5160('0x1')](0x3)},'issuerFiscalCode':{'type':Sequelize[_0x5160('0x1')](0x32)},'issuerPIVA':{'type':Sequelize[_0x5160('0x1')](0x32)},'issuerSDICode':{'type':Sequelize[_0x5160('0x1')](0x15)},'issuerFiscalMessage':{'type':Sequelize['STRING']},'issuerExpiryDay':{'type':Sequelize[_0x5160('0x2')]},'issuerEurope':{'type':Sequelize['BOOLEAN']},'issuerSocCap':{'type':Sequelize[_0x5160('0x1')](0xff)},'issuerBankAccount':{'type':Sequelize[_0x5160('0x1')](0xff)},'issuerBankName':{'type':Sequelize[_0x5160('0x1')](0xff)},'issuerBankStreet':{'type':Sequelize[_0x5160('0x1')]},'issuerBankPostalCode':{'type':Sequelize[_0x5160('0x1')]},'issuerBankCity':{'type':Sequelize[_0x5160('0x1')]},'issuerBankCountry':{'type':Sequelize[_0x5160('0x1')]},'issuerBankBICSWIFT':{'type':Sequelize[_0x5160('0x1')]},'issuerBankIBAN':{'type':Sequelize[_0x5160('0x1')]},'issuerPhone':{'type':Sequelize[_0x5160('0x1')]},'issuerFax':{'type':Sequelize[_0x5160('0x1')]},'issuerEmail':{'type':Sequelize[_0x5160('0x1')]},'issuerWeb':{'type':Sequelize[_0x5160('0x1')]},'issuerABI':{'type':Sequelize[_0x5160('0x1')]},'issuerCAB':{'type':Sequelize[_0x5160('0x1')]},'issuerPayPal':{'type':Sequelize['STRING']},'startDate':{'type':Sequelize[_0x5160('0x5')]},'endDate':{'type':Sequelize[_0x5160('0x5')]},'beginningCompetence':{'type':Sequelize[_0x5160('0x5')]},'endCompetence':{'type':Sequelize[_0x5160('0x5')]},'clientCode':{'type':Sequelize[_0x5160('0x1')]},'number':{'type':Sequelize[_0x5160('0x2')]}}; \ No newline at end of file +var _0xb03c=['DATE','sequelize','exports','INTEGER','TEXT','DECIMAL','STRING'];(function(_0x8d0461,_0x34e7e9){var _0x483ad7=function(_0x4a0b0f){while(--_0x4a0b0f){_0x8d0461['push'](_0x8d0461['shift']());}};_0x483ad7(++_0x34e7e9);}(_0xb03c,0xc5));var _0xcb03=function(_0x1f83a5,_0x59843f){_0x1f83a5=_0x1f83a5-0x0;var _0x45edf0=_0xb03c[_0x1f83a5];return _0x45edf0;};'use strict';var Sequelize=require(_0xcb03('0x0'));module[_0xcb03('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'InvoiceId':{'type':Sequelize[_0xcb03('0x2')]},'note':{'type':Sequelize[_0xcb03('0x3')]},'agentFullname':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xcb03('0x3')]},'companyName':{'type':Sequelize['STRING'],'allowNull':![]},'companyId':{'type':Sequelize[_0xcb03('0x2')],'allowNull':![]},'paid':{'type':Sequelize[_0xcb03('0x2')],'defaultValue':0x0},'discount':{'type':Sequelize[_0xcb03('0x4')](0xd,0x4)},'receivingStreet':{'type':Sequelize['STRING']},'receivingPostalCode':{'type':Sequelize[_0xcb03('0x5')]},'receivingCity':{'type':Sequelize[_0xcb03('0x5')]},'receivingCountry':{'type':Sequelize[_0xcb03('0x5')]},'receivingISOCode':{'type':Sequelize[_0xcb03('0x5')](0x3)},'receivingFiscalCode':{'type':Sequelize[_0xcb03('0x5')](0x32)},'receivingPIVA':{'type':Sequelize[_0xcb03('0x5')](0x32)},'receivingSDICode':{'type':Sequelize['STRING'](0x15)},'receivingFiscalMessage':{'type':Sequelize[_0xcb03('0x5')](0x3e8)},'receivingExpiryDay':{'type':Sequelize[_0xcb03('0x2')]},'receivingEurope':{'type':Sequelize['BOOLEAN']},'receivingSocCap':{'type':Sequelize[_0xcb03('0x5')](0xff)},'issuerName':{'type':Sequelize[_0xcb03('0x5')]},'issuerStreet':{'type':Sequelize[_0xcb03('0x5')]},'issuerPostalCode':{'type':Sequelize[_0xcb03('0x5')]},'issuerCity':{'type':Sequelize['STRING']},'issuerCountry':{'type':Sequelize[_0xcb03('0x5')]},'issuerISOCode':{'type':Sequelize[_0xcb03('0x5')](0x3)},'issuerFiscalCode':{'type':Sequelize[_0xcb03('0x5')](0x32)},'issuerPIVA':{'type':Sequelize[_0xcb03('0x5')](0x32)},'issuerSDICode':{'type':Sequelize[_0xcb03('0x5')](0x15)},'issuerFiscalMessage':{'type':Sequelize[_0xcb03('0x5')]},'issuerExpiryDay':{'type':Sequelize[_0xcb03('0x2')]},'issuerEurope':{'type':Sequelize['BOOLEAN']},'issuerSocCap':{'type':Sequelize['STRING'](0xff)},'issuerBankAccount':{'type':Sequelize[_0xcb03('0x5')](0xff)},'issuerBankName':{'type':Sequelize[_0xcb03('0x5')](0xff)},'issuerBankStreet':{'type':Sequelize['STRING']},'issuerBankPostalCode':{'type':Sequelize[_0xcb03('0x5')]},'issuerBankCity':{'type':Sequelize[_0xcb03('0x5')]},'issuerBankCountry':{'type':Sequelize[_0xcb03('0x5')]},'issuerBankBICSWIFT':{'type':Sequelize['STRING']},'issuerBankIBAN':{'type':Sequelize[_0xcb03('0x5')]},'issuerPhone':{'type':Sequelize[_0xcb03('0x5')]},'issuerFax':{'type':Sequelize['STRING']},'issuerEmail':{'type':Sequelize[_0xcb03('0x5')]},'issuerWeb':{'type':Sequelize[_0xcb03('0x5')]},'issuerABI':{'type':Sequelize[_0xcb03('0x5')]},'issuerCAB':{'type':Sequelize['STRING']},'issuerPayPal':{'type':Sequelize[_0xcb03('0x5')]},'startDate':{'type':Sequelize[_0xcb03('0x6')]},'endDate':{'type':Sequelize[_0xcb03('0x6')]},'beginningCompetence':{'type':Sequelize[_0xcb03('0x6')]},'endCompetence':{'type':Sequelize['DATE']},'clientCode':{'type':Sequelize[_0xcb03('0x5')]},'number':{'type':Sequelize[_0xcb03('0x2')]}}; \ No newline at end of file diff --git a/server/api/saCreditNote/saCreditNote.controller.js b/server/api/saCreditNote/saCreditNote.controller.js index 7ee2d2d..cf57c9d 100644 --- a/server/api/saCreditNote/saCreditNote.controller.js +++ b/server/api/saCreditNote/saCreditNote.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7602=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','then','error','stack','name','send','index','SACreditNote','model','keys','query','filters','intersection','attributes','fields','length','nolimit','pick','filter','merge','where','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','update','describe','getCreditnotePDF','join','root','files','tmp','images','logos','logo-invoice.png','server','format','Credinote_%s-%s.pdf','creditnote','SACreditNoteDetail','findAll','log','{{page}}/{{pages}}','footer','contents','default','','issuerWeb','','mkdirSync','','\x20\x20body{font-family:\x20Verdana,\x20Geneva,\x20Tahoma,\x20sans-serif;}.itemTabTitle{background-color:\x20lightgray;\x20height:\x2040px;}.issuerInfo{color:\x20lightgray;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;\x20font-size:\x2012px;}.issuerData{font-weight:\x20normal}.issuerFiled{font-weight:\x20bold;\x20font-size:\x2010px;\x20padding-left:\x2010px;}.issuerFiledWeb{font-weight:\x20bold;\x20text-align:\x20center;}.receiperInfo{text-align:\x20right;\x20font-size:\x2012px}.receiperCompanyName{font-weight:\x20bold;\x20padding-top:\x2010px;\x20padding-bottom:\x2015px;\x20font-size:\x2016px}.reciperFiscalInfo{padding-top:\x205px;\x20padding-bottom:\x205px;}table.center{margin-left:\x20auto;\x20margin-right:\x20auto;\x20width:\x2090%;}.total{background-color:\x20lightgray;\x20font-size:\x2018px;\x20font-weight:\x20bold;}.totalText{background-color:\x20lightgray;\x20text-align:\x20right;\x20font-size:\x2016px;\x20padding-right:\x2010px;}.totalEmpty{background-color:\x20#ffffff;}.invoiceNumber{font-weight:\x20bolder;\x20font-size:\x2024px;\x20padding-bottom:\x2020px;}.invoiceNumber{font-weight:\x20bold;\x20font-size:\x2018px;}.createdDate{font-size:\x2014px;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;}.duedDate{font-size:\x2014px;\x20padding-bottom:\x2010px;}.TFtable{width:\x20100%;\x20font-size:\x2010px;\x20border-collapse:\x20collapse;}.TFtable\x20td{padding:\x207px;}.TFtable\x20tr:nth-child(even){background:\x20#ffffff;}.TFtable\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.numberRight{text-align:\x20right;}.numberCenter{text-align:\x20center}.currency{text-align:\x20left;}table.roundedCorners{border:\x202px\x20solid\x20lightgray;\x20border-radius:\x205px;\x20border-spacing:\x200;\x20width:\x20100%;\x20font-size:\x2010px;}table.roundedCorners\x20td,\x20table.roundedCorners\x20th{border-bottom:\x201px\x20solid\x20lightgray;\x20padding:\x2010px;}table.roundedCorners\x20tr:last-child\x20>\x20td{border-bottom:\x20none;}table.roundedCorners\x20tr:nth-child(even){background:\x20#ffffff;}table.roundedCorners\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.lex{padding-left:\x2010px;font-size:\x2010px;padding-bottom:\x2020px;}.divTotal{float:\x20right;\x20border-radius:\x205px;\x20border:\x202px\x20solid\x20lightgray;\x20padding:\x2010px;\x20margin-top:30px;}.itemTotal{width:\x20200px;\x20line-height:\x2030px;}.tabTotal{border-collapse:\x20collapse;}','Telefono','Fax','Email','VAT\x20number','Tax\x20code','C.F.','I.S.\x20code','Codice\x20S.D.I.','Soc.Cap.\x20fp','Cap.Soc.\x20iv','Invoice','Fattura','Proforma','Credit\x20note','Nota\x20di\x20credito','Due\x20date','Scadenza','Item','Articolo','Description','Descrizione','Ore/Qta','Prezzo\x20Unitario','Sconto','Subtotal','Imponibile','Tasse','Total','Totale','Please\x20send\x20PAYMENT\x20to','Account\x20Holder','Bank\x20name','Nome\x20banca','Bank\x20Address','Indirizzo\x20banca','CAB','BIC','SWIF','IBAN','Pay\x20via\x20Paypal','Paga\x20con\x20Paypal','Thank\x20you\x20for\x20your\x20business.\x20We\x20do\x20expect\x20payment\x20by\x20',',\x20so\x20please\x20do\x20so\x20within\x20this\x20time.','\x20quindi\x20vi\x20preghiamo\x20di\x20provvedere\x20entro\x20tale\x20termine.','Italy','','\x20','','\x20%s
','issuerName','%s
','issuerStreet','issuerPostalCode','\x20%s','issuerCity','issuerCountry','-\x20%s\x20
','phone',':\x20%s
','issuerPhone','fax','issuerFax','email','issuerEmail','piva','sdi','issuerSocCap','','','','%s','receivingStreet','%s\x20-\x20','receivingPostalCode','receivingCity','receivingCountry','','receivingFiscalCode','receivingSDICode','','','','\x20N.%d','number','%s,\x20','%s\x20','updatedAt','add','saExpiryDay','DD/MM/YYYY','','duedate',':\x20%s','','','','description','','hrsqty','unitprice','details','netPrice','quantity','%s','productName','productDescription','%d','','toFixed','€','isNil','discount','tax','receivingFiscalMessage','indexOf','','\x20','','total','','nettopay',' ','','\x20%s\x20','fromCharCode','','','sendpayment',':','issuerBankAccount',':\x20','','issuerBankName','bankaddress','issuerBankStreet','issuerBankPostalCode','\x20-\x20','issuerBankCity','issuerBankCountry','abi','cab','issuerABI','bic','issuerBankBICSWIFT','issuerBankIBAN','issuerPayPal','thank1','','
','','toFile','download','err','foldername','sendStatus','rimraf','zip-dir','bluebird','path','sox','to-csv','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware'];(function(_0x1dac7a,_0x1828ce){var _0x4cb363=function(_0x80f6de){while(--_0x80f6de){_0x1dac7a['push'](_0x1dac7a['shift']());}};_0x4cb363(++_0x1828ce);}(_0x7602,0xe6));var _0x2760=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x7602[_0x525c7b];return _0x27b33e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2760('0x0'));var zipdir=require(_0x2760('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2760('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2760('0x3'));var sox=require(_0x2760('0x4'));var csv=require(_0x2760('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2760('0x6'));var crypto=require(_0x2760('0x7'));var jsforce=require(_0x2760('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x2760('0x5'));var querystring=require(_0x2760('0x9'));var Papa=require('papaparse');var Redis=require(_0x2760('0xa'));var authService=require('../../components/auth/service');var qs=require(_0x2760('0xb'));var hardwareService=require(_0x2760('0xc'));var logger=require(_0x2760('0xd'))(_0x2760('0xe'));var utils=require(_0x2760('0xf'));var config=require(_0x2760('0x10'));var db=require(_0x2760('0x11'))['db'];function respondWithStatusCode(_0x3a9e28,_0x1cd92b){_0x1cd92b=_0x1cd92b||0xcc;return function(_0x36c5a8){if(_0x36c5a8){return _0x3a9e28['sendStatus'](_0x1cd92b);}return _0x3a9e28[_0x2760('0x12')](_0x1cd92b)[_0x2760('0x13')]();};}function respondWithResult(_0xacb283,_0x496049){_0x496049=_0x496049||0xc8;return function(_0xf9f1b2){if(_0xf9f1b2){return _0xacb283['status'](_0x496049)[_0x2760('0x14')](_0xf9f1b2);}};}function respondWithFilteredResult(_0x3dd23a,_0x38ac6f){return function(_0x620c1c){if(_0x620c1c){var _0x5b5340=_0x620c1c[_0x2760('0x15')],_0x42f80a=_0x38ac6f[_0x2760('0x16')],_0x489a2e=_0x38ac6f[_0x2760('0x16')]+_0x38ac6f[_0x2760('0x17')],_0x343061;if(_0x489a2e>=_0x5b5340){_0x489a2e=_0x5b5340;_0x343061=0xc8;}else{_0x343061=0xce;}_0x3dd23a['status'](_0x343061);return _0x3dd23a[_0x2760('0x18')](_0x2760('0x19'),_0x42f80a+'-'+_0x489a2e+'/'+_0x5b5340)[_0x2760('0x14')](_0x620c1c);}return null;};}function patchUpdates(_0x59506d){return function(_0x2c8b5a){try{jsonpatch[_0x2760('0x1a')](_0x2c8b5a,_0x59506d,!![]);}catch(_0x254346){return BPromise['reject'](_0x254346);}return _0x2c8b5a['save']();};}function saveUpdates(_0x185ccc,_0x35dbb7){return function(_0x546215){if(_0x546215){return _0x546215['update'](_0x185ccc)[_0x2760('0x1b')](function(_0x432c1b){return _0x432c1b;});}return null;};}function removeEntity(_0x54f65c,_0x2d23ad){return function(_0xcaef4c){if(_0xcaef4c){return _0xcaef4c['destroy']()[_0x2760('0x1b')](function(){_0x54f65c[_0x2760('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f811d,_0xf6e89e){return function(_0x388be5){if(!_0x388be5){_0x1f811d['sendStatus'](0x194);}return _0x388be5;};}function handleError(_0x5ba663,_0x2de6ef){_0x2de6ef=_0x2de6ef||0x1f4;return function(_0x1cebc3){logger[_0x2760('0x1c')](_0x1cebc3[_0x2760('0x1d')]);if(_0x1cebc3[_0x2760('0x1e')]){delete _0x1cebc3[_0x2760('0x1e')];}_0x5ba663[_0x2760('0x12')](_0x2de6ef)[_0x2760('0x1f')](_0x1cebc3);};}exports[_0x2760('0x20')]=function(_0x11cfda,_0x2f3684){var _0x16353f={},_0x56c320={},_0x4ca429={'count':0x0,'rows':[]};var _0x4aaae7=db[_0x2760('0x21')]['rawAttributes'];_0x56c320[_0x2760('0x22')]=_[_0x2760('0x23')](_0x4aaae7);_0x56c320[_0x2760('0x24')]=_[_0x2760('0x23')](_0x11cfda[_0x2760('0x24')]);_0x56c320[_0x2760('0x25')]=_[_0x2760('0x26')](_0x56c320[_0x2760('0x22')],_0x56c320[_0x2760('0x24')]);_0x16353f[_0x2760('0x27')]=_[_0x2760('0x26')](_0x56c320[_0x2760('0x22')],qs[_0x2760('0x28')](_0x11cfda[_0x2760('0x24')][_0x2760('0x28')]));_0x16353f['attributes']=_0x16353f[_0x2760('0x27')][_0x2760('0x29')]?_0x16353f[_0x2760('0x27')]:_0x56c320[_0x2760('0x22')];if(!_0x11cfda[_0x2760('0x24')]['hasOwnProperty'](_0x2760('0x2a'))){_0x16353f[_0x2760('0x17')]=qs[_0x2760('0x17')](_0x11cfda[_0x2760('0x24')][_0x2760('0x17')]);_0x16353f['offset']=qs['offset'](_0x11cfda[_0x2760('0x24')][_0x2760('0x16')]);}_0x16353f['order']=qs['sort'](_0x11cfda['query']['sort']);_0x16353f['where']=qs[_0x2760('0x25')](_[_0x2760('0x2b')](_0x11cfda['query'],_0x56c320[_0x2760('0x25')]));if(_0x11cfda[_0x2760('0x24')][_0x2760('0x2c')]){_0x16353f['where']=_[_0x2760('0x2d')](_0x16353f[_0x2760('0x2e')],{'$or':_['map'](_0x4aaae7,function(_0x13fe62){if(_0x13fe62['type']['key']!==_0x2760('0x2f')){var _0x5d460e={};_0x5d460e[_0x13fe62[_0x2760('0x30')]]={'$like':'%'+_0x11cfda[_0x2760('0x24')]['filter']+'%'};return _0x5d460e;}})});}_0x16353f=_[_0x2760('0x2d')]({},_0x16353f,_0x11cfda[_0x2760('0x31')]);var _0x5519b3={'where':_0x16353f[_0x2760('0x2e')]};return db[_0x2760('0x21')][_0x2760('0x15')](_0x5519b3)[_0x2760('0x1b')](function(_0x65acd2){_0x4ca429[_0x2760('0x15')]=_0x65acd2;if(_0x11cfda['query'][_0x2760('0x32')]){_0x16353f[_0x2760('0x33')]=[{'all':!![]}];}return db['SACreditNote']['findAll'](_0x16353f);})['then'](function(_0x5aa33a){_0x4ca429[_0x2760('0x34')]=_0x5aa33a;return _0x4ca429;})[_0x2760('0x1b')](respondWithFilteredResult(_0x2f3684,_0x16353f))[_0x2760('0x35')](handleError(_0x2f3684,null));};exports[_0x2760('0x36')]=function(_0x107120,_0x2ea1b4){var _0x10a48d={'raw':![],'where':{'id':_0x107120[_0x2760('0x37')]['id']}},_0x4b75a4={};_0x4b75a4['model']=_[_0x2760('0x23')](db['SACreditNote'][_0x2760('0x38')]);_0x4b75a4[_0x2760('0x24')]=_['keys'](_0x107120[_0x2760('0x24')]);_0x4b75a4['filters']=_[_0x2760('0x26')](_0x4b75a4['model'],_0x4b75a4['query']);_0x10a48d[_0x2760('0x27')]=_[_0x2760('0x26')](_0x4b75a4[_0x2760('0x22')],qs[_0x2760('0x28')](_0x107120['query'][_0x2760('0x28')]));_0x10a48d[_0x2760('0x27')]=_0x10a48d[_0x2760('0x27')][_0x2760('0x29')]?_0x10a48d['attributes']:_0x4b75a4[_0x2760('0x22')];if(_0x107120[_0x2760('0x24')]['includeAll']){_0x10a48d[_0x2760('0x33')]=[{'all':!![]}];}_0x10a48d=_[_0x2760('0x2d')]({},_0x10a48d,_0x107120['options']);return db[_0x2760('0x21')][_0x2760('0x39')](_0x10a48d)['then'](handleEntityNotFound(_0x2ea1b4,null))[_0x2760('0x1b')](respondWithResult(_0x2ea1b4,null))['catch'](handleError(_0x2ea1b4,null));};exports[_0x2760('0x3a')]=function(_0x51c756,_0x3a1a13){return db[_0x2760('0x21')][_0x2760('0x3a')](_0x51c756[_0x2760('0x3b')],{})[_0x2760('0x1b')](respondWithResult(_0x3a1a13,0xc9))[_0x2760('0x35')](handleError(_0x3a1a13,null));};exports[_0x2760('0x3c')]=function(_0x4cca98,_0x110800){if(_0x4cca98[_0x2760('0x3b')]['id']){delete _0x4cca98[_0x2760('0x3b')]['id'];}return db['SACreditNote'][_0x2760('0x39')]({'where':{'id':_0x4cca98[_0x2760('0x37')]['id']}})[_0x2760('0x1b')](handleEntityNotFound(_0x110800,null))[_0x2760('0x1b')](saveUpdates(_0x4cca98[_0x2760('0x3b')],null))[_0x2760('0x1b')](respondWithResult(_0x110800,null))['catch'](handleError(_0x110800,null));};exports['destroy']=function(_0x5d95b1,_0x5347d8){return db['SACreditNote']['find']({'where':{'id':_0x5d95b1[_0x2760('0x37')]['id']}})['then'](handleEntityNotFound(_0x5347d8,null))[_0x2760('0x1b')](removeEntity(_0x5347d8,null))[_0x2760('0x35')](handleError(_0x5347d8,null));};exports[_0x2760('0x3d')]=function(_0x476dd5,_0x296588){return db[_0x2760('0x21')][_0x2760('0x3d')]()[_0x2760('0x1b')](respondWithResult(_0x296588,null))[_0x2760('0x35')](handleError(_0x296588,null));};exports[_0x2760('0x3e')]=function(_0x564b08,_0x198c64){var _0x3ea3f5=moment()['unix']()['toString']();var _0x49fddb=path[_0x2760('0x3f')](config[_0x2760('0x40')],'server',_0x2760('0x41'),_0x2760('0x42'));var _0x1094f5=path[_0x2760('0x3f')](config['root'],'server',_0x2760('0x41'),_0x2760('0x43'),_0x2760('0x44'),_0x2760('0x45'));var _0x2d2ed8=path[_0x2760('0x3f')](config[_0x2760('0x40')],_0x2760('0x46'),_0x2760('0x41'),_0x2760('0x43'),_0x2760('0x44'),'paid-invoice.png');var _0x2206a6=path['join'](_0x49fddb,_0x3ea3f5);var _0x29cfdd=util[_0x2760('0x47')](_0x2760('0x48'),_0x564b08['params']['id'],_0x3ea3f5);var _0x4f5786=path[_0x2760('0x3f')](_0x2206a6,_0x29cfdd);var _0x18bc58=![];var _0x366aac={};return db[_0x2760('0x21')]['find']({'where':{'id':_0x564b08[_0x2760('0x37')]['id']},'raw':!![]})[_0x2760('0x1b')](handleEntityNotFound(_0x198c64,null))[_0x2760('0x1b')](function(_0x37b93e){if(_0x37b93e){_0x366aac[_0x2760('0x49')]=_0x37b93e;return db[_0x2760('0x4a')][_0x2760('0x4b')]({'where':{'CreditNoteId':_0x37b93e['id']},'raw':!![],'logging':console[_0x2760('0x4c')]})['then'](function(_0x1470bc){_0x366aac['details']=_0x1470bc;_0x18bc58=!![];var _0x3b027e='';var _0x486d02={'format':'A4','orientation':'portrait','border':'1cm','footer':{'height':'10mm','contents':{'default':_0x2760('0x4d')}}};_0x486d02[_0x2760('0x4e')][_0x2760('0x4f')][_0x2760('0x50')]=_0x486d02['footer'][_0x2760('0x4f')][_0x2760('0x50')]+_0x2760('0x51')+_0x366aac[_0x2760('0x49')][_0x2760('0x52')]+_0x2760('0x53');fs[_0x2760('0x54')](_0x2206a6);_0x3b027e=_0x2760('0x55');_0x3b027e+=_0x2760('0x56');_0x3b027e+='';var _0x203bf9={'phone':{'en':'Phone','it':_0x2760('0x57')},'fax':{'en':_0x2760('0x58'),'it':_0x2760('0x58')},'email':{'en':'Email','it':_0x2760('0x59')},'piva':{'en':_0x2760('0x5a'),'it':'P.IVA'},'cf':{'en':_0x2760('0x5b'),'it':_0x2760('0x5c')},'sdi':{'en':_0x2760('0x5d'),'it':_0x2760('0x5e')},'cs':{'en':_0x2760('0x5f'),'it':_0x2760('0x60')},'invoice':{'en':_0x2760('0x61'),'it':_0x2760('0x62')},'proforma':{'en':_0x2760('0x63'),'it':_0x2760('0x63')},'creditnote':{'en':_0x2760('0x64'),'it':_0x2760('0x65')},'duedate':{'en':_0x2760('0x66'),'it':_0x2760('0x67')},'item':{'en':_0x2760('0x68'),'it':_0x2760('0x69')},'description':{'en':_0x2760('0x6a'),'it':_0x2760('0x6b')},'hrsqty':{'en':'Hrs/Qty','it':_0x2760('0x6c')},'unitprice':{'en':'Unit\x20Price','it':_0x2760('0x6d')},'subtotal':{'en':'Sub\x20Total','it':'Sub\x20Totale'},'discount':{'en':'Discount','it':_0x2760('0x6e')},'total':{'en':_0x2760('0x6f'),'it':_0x2760('0x70')},'tax':{'en':'Tax','it':_0x2760('0x71')},'nettopay':{'en':_0x2760('0x72'),'it':_0x2760('0x73')},'sendpayment':{'en':_0x2760('0x74'),'it':'Si\x20prega\x20di\x20inviare\x20il\x20pagamento\x20a'},'accountholder':{'en':_0x2760('0x75'),'it':'Conto\x20intestato\x20a'},'bankname':{'en':_0x2760('0x76'),'it':_0x2760('0x77')},'bankaddress':{'en':_0x2760('0x78'),'it':_0x2760('0x79')},'abi':{'en':'ABI','it':'ABI'},'cab':{'en':_0x2760('0x7a'),'it':_0x2760('0x7a')},'bic':{'en':_0x2760('0x7b'),'it':_0x2760('0x7b')},'swif':{'en':_0x2760('0x7c'),'it':_0x2760('0x7c')},'iban':{'en':_0x2760('0x7d'),'it':_0x2760('0x7d')},'paypal':{'en':_0x2760('0x7e'),'it':_0x2760('0x7f')},'thank1':{'en':_0x2760('0x80'),'it':'Grazie.\x20Prevediamo\x20il\x20pagamento\x20entro\x20'},'thank2':{'en':_0x2760('0x81'),'it':_0x2760('0x82')}};var _0x361020='it';if(_0x366aac[_0x2760('0x49')]['receivingCountry']!==_0x2760('0x83')){_0x361020='en';}_0x3b027e+=_0x2760('0x84');_0x3b027e+=_0x2760('0x85')+_0x1094f5+_0x2760('0x86');_0x3b027e+=_0x2760('0x87');_0x3b027e+=util[_0x2760('0x47')](_0x2760('0x88'),_0x366aac[_0x2760('0x49')][_0x2760('0x89')]);_0x3b027e+=util[_0x2760('0x47')](_0x2760('0x8a'),_0x366aac[_0x2760('0x49')][_0x2760('0x8b')]);_0x3b027e+=util[_0x2760('0x47')]('%s',_0x366aac[_0x2760('0x49')][_0x2760('0x8c')]);_0x3b027e+=util[_0x2760('0x47')](_0x2760('0x8d'),_0x366aac['creditnote'][_0x2760('0x8e')]);_0x3b027e+=util['format']('-\x20%s\x20
',_0x366aac[_0x2760('0x49')][_0x2760('0x8f')]);_0x3b027e+=util[_0x2760('0x47')](_0x2760('0x90'),_0x366aac[_0x2760('0x49')][_0x2760('0x8f')]);_0x3b027e+=util[_0x2760('0x47')](_0x203bf9[_0x2760('0x91')][_0x361020]+_0x2760('0x92'),_0x366aac[_0x2760('0x49')][_0x2760('0x93')]);_0x3b027e+=util[_0x2760('0x47')](_0x203bf9[_0x2760('0x94')][_0x361020]+_0x2760('0x92'),_0x366aac[_0x2760('0x49')][_0x2760('0x95')]);_0x3b027e+=util[_0x2760('0x47')](_0x203bf9[_0x2760('0x96')][_0x361020]+_0x2760('0x8a'),_0x366aac[_0x2760('0x49')][_0x2760('0x97')]);_0x3b027e+=util[_0x2760('0x47')](_0x203bf9[_0x2760('0x98')][_0x361020]+_0x2760('0x92'),_0x366aac[_0x2760('0x49')]['issuerPIVA']);_0x3b027e+=util[_0x2760('0x47')](_0x203bf9['cf'][_0x361020]+_0x2760('0x92'),_0x366aac['creditnote']['issuerFiscalCode']);_0x3b027e+=util[_0x2760('0x47')](_0x203bf9[_0x2760('0x99')][_0x361020]+'%s
',_0x366aac[_0x2760('0x49')]['issuerSDICode']);_0x3b027e+=util[_0x2760('0x47')](_0x203bf9['cs'][_0x361020]+_0x2760('0x92'),_0x366aac[_0x2760('0x49')][_0x2760('0x9a')]);_0x3b027e+=_0x2760('0x9b');_0x3b027e+=_0x2760('0x9c');_0x3b027e+=_0x2760('0x9d');_0x3b027e+=util[_0x2760('0x47')](_0x2760('0x9e'),_0x366aac[_0x2760('0x49')]['companyName']);_0x3b027e+=util['format'](_0x2760('0x8a'),_0x366aac[_0x2760('0x49')][_0x2760('0x9f')]);_0x3b027e+=util[_0x2760('0x47')](_0x2760('0xa0'),_0x366aac['creditnote'][_0x2760('0xa1')]);_0x3b027e+=util['format']('%s
',_0x366aac['creditnote'][_0x2760('0xa2')]);_0x3b027e+=util[_0x2760('0x47')](_0x2760('0x8a'),_0x366aac[_0x2760('0x49')][_0x2760('0xa3')]);_0x3b027e+=util[_0x2760('0x47')](_0x2760('0xa4')+_0x203bf9['cf'][_0x361020]+_0x2760('0x92'),_0x366aac[_0x2760('0x49')][_0x2760('0xa5')]);_0x3b027e+=util[_0x2760('0x47')](_0x203bf9[_0x2760('0x98')][_0x361020]+':\x20%s
',_0x366aac[_0x2760('0x49')]['receivingPIVA']);_0x3b027e+=util[_0x2760('0x47')](_0x203bf9[_0x2760('0x99')][_0x361020]+_0x2760('0x92'),_0x366aac[_0x2760('0x49')][_0x2760('0xa6')]);_0x3b027e+=_0x2760('0xa7');_0x3b027e+=_0x2760('0xa8');_0x3b027e+='';_0x3b027e+='';_0x3b027e+=util[_0x2760('0x47')](_0x2760('0xa9')+_0x203bf9[_0x2760('0x49')][_0x361020]+_0x2760('0xaa'),_0x37b93e[_0x2760('0xab')]);_0x3b027e+=util[_0x2760('0x47')](_0x2760('0xac'),_0x366aac[_0x2760('0x49')][_0x2760('0x8e')]);var _0x86ddd7=moment(_0x366aac[_0x2760('0x49')]['startDate'])[_0x2760('0x47')]('DD/MM/YYYY');_0x3b027e+=util['format'](_0x2760('0xad'),_0x86ddd7);var _0x174e4e=moment(_0x366aac[_0x2760('0x49')][_0x2760('0xae')])[_0x2760('0xaf')](_0x366aac[_0x2760('0x49')][_0x2760('0xb0')],'days')[_0x2760('0x47')](_0x2760('0xb1'));_0x3b027e+=util['format'](_0x2760('0xb2')+_0x203bf9[_0x2760('0xb3')][_0x361020]+_0x2760('0xb4'),_0x174e4e);_0x3b027e+=_0x2760('0xa8');_0x3b027e+=_0x2760('0x87');_0x3b027e+=_0x2760('0xb5');_0x3b027e+=_0x2760('0xb6');_0x3b027e+=_0x2760('0x87');_0x3b027e+=''+_0x203bf9['item'][_0x361020]+_0x2760('0xb7');_0x3b027e+=''+_0x203bf9[_0x2760('0xb8')][_0x361020]+'';_0x3b027e+=_0x2760('0xb9')+_0x203bf9[_0x2760('0xba')][_0x361020]+_0x2760('0xb7');_0x3b027e+=_0x2760('0xb9')+_0x203bf9[_0x2760('0xbb')][_0x361020]+'';_0x3b027e+=''+_0x203bf9['subtotal'][_0x361020]+_0x2760('0xb7');_0x3b027e+=_0x2760('0xa8');var _0x1d3b1e=0x0;var _0x7c177=0x0;for(var _0x3efbe1=0x0;_0x3efbe1<_0x366aac[_0x2760('0xbc')]['length'];_0x3efbe1++){var _0xb00891=0x0;var _0x4c3011=0x0;var _0x59f709=0x0;var _0x469622=0x0;_0xb00891=_0x366aac[_0x2760('0xbc')][_0x3efbe1][_0x2760('0xbd')]-_0x366aac[_0x2760('0xbc')][_0x3efbe1]['netPrice']/0x64*_0x366aac[_0x2760('0xbc')][_0x3efbe1]['discount'];_0x4c3011=_0xb00891/0x64*_0x366aac[_0x2760('0xbc')][_0x3efbe1]['tax'];_0x59f709=_0xb00891*_0x366aac['details'][_0x3efbe1][_0x2760('0xbe')];_0x469622=_0x4c3011*_0x366aac['details'][_0x3efbe1][_0x2760('0xbe')];_0x3b027e+=_0x2760('0x87');_0x3b027e+=util[_0x2760('0x47')](_0x2760('0xbf'),_0x366aac[_0x2760('0xbc')][_0x3efbe1][_0x2760('0xc0')]);_0x3b027e+=util[_0x2760('0x47')](_0x2760('0xbf'),_0x366aac[_0x2760('0xbc')][_0x3efbe1][_0x2760('0xc1')]);_0x3b027e+=util['format'](_0x2760('0xc2'),_0x366aac[_0x2760('0xbc')][_0x3efbe1]['quantity']);_0x3b027e+=_0x2760('0xc3')+_0xb00891[_0x2760('0xc4')](0x2)+_0x2760('0xc5');_0x3b027e+=_0x2760('0xc3')+_0x59f709[_0x2760('0xc4')](0x2)+'€';_0x3b027e+=_0x2760('0xa8');_0x1d3b1e+=_0x59f709;_0x7c177+=_0x469622;}_0x3b027e+='';if(!_[_0x2760('0xc6')](_0x366aac[_0x2760('0x49')][_0x2760('0xc7')])){var _0x626ba8=0x0;var _0x51e76e=0x0;var _0x55d2ec=_0x366aac['creditnote'][_0x2760('0xc7')]*0x64/_0x1d3b1e;for(var _0x3efbe1=0x0;_0x3efbe1<_0x366aac[_0x2760('0xbc')][_0x2760('0x29')];_0x3efbe1++){var _0x1f599f=0x0;var _0x487f8c=0x0;var _0x39b30d=0x0;_0xb00891=_0x366aac[_0x2760('0xbc')][_0x3efbe1][_0x2760('0xbd')]-_0x366aac[_0x2760('0xbc')][_0x3efbe1][_0x2760('0xbd')]/0x64*_0x366aac['details'][_0x3efbe1][_0x2760('0xc7')];_0x1f599f=_0xb00891/0x64*_0x55d2ec;_0x487f8c=_0xb00891-_0x1f599f;_0x39b30d=_0x487f8c*_0x366aac[_0x2760('0xbc')][_0x3efbe1][_0x2760('0xbe')];_0x626ba8+=_0x39b30d;_0x51e76e+=_0x39b30d/0x64*_0x366aac[_0x2760('0xbc')][_0x3efbe1][_0x2760('0xc8')];}}var _0xd7cafd=0x0;var _0x193e99=0x0;var _0x24eead=![];var _0x464894=_0x366aac['creditnote'][_0x2760('0xc9')];if(_0x464894[_0x2760('0xca')]('split\x20payment')!=-0x1){_0x24eead=!![];}if(!_['isNil'](_0x366aac[_0x2760('0x49')]['discount'])){_0x3b027e+=_0x2760('0x87');if(_0x366aac[_0x2760('0x49')][_0x2760('0xc7')]>0x0){_0x3b027e+=_0x2760('0xcb')+_0x203bf9[_0x2760('0xc7')][_0x361020]+'';_0x3b027e+=_0x2760('0xcc')+_0x366aac[_0x2760('0x49')][_0x2760('0xc7')][_0x2760('0xc4')](0x2)+_0x2760('0xc5');}_0x3b027e+=_0x2760('0xa8');_0xd7cafd=_0x51e76e;_0x193e99=_0x626ba8;}else{_0xd7cafd=_0x7c177;_0x193e99=_0x1d3b1e;}if(_0xd7cafd>0x0||_0x366aac[_0x2760('0x49')][_0x2760('0xc7')]>0x0){_0x3b027e+=_0x2760('0x87');_0x3b027e+=_0x2760('0xcd')+_0x203bf9[_0x2760('0xce')][_0x361020]+'';_0x3b027e+=_0x2760('0xc3')+_0x193e99['toFixed'](0x2)+_0x2760('0xc5');_0x3b027e+=_0x2760('0xa8');}if(_0xd7cafd>0x0){_0x3b027e+=_0x2760('0x87');_0x3b027e+=_0x2760('0xcd')+_0x203bf9[_0x2760('0xc8')][_0x361020]+_0x2760('0x9b');_0x3b027e+=_0x2760('0xc3')+_0xd7cafd['toFixed'](0x2)+_0x2760('0xc5');_0x3b027e+=_0x2760('0xa8');}_0x3b027e+=_0x2760('0x87');var _0x566ed4;if(_0x24eead){_0x566ed4=_0x193e99;}else{_0x566ed4=_0x193e99+_0xd7cafd;}_0x3b027e+=_0x2760('0xcf')+_0x203bf9[_0x2760('0xd0')][_0x361020]+''+_0x566ed4[_0x2760('0xc4')](0x2)+_0x2760('0xc5');_0x3b027e+='\x20';_0x3b027e+=_0x2760('0xd1');_0x3b027e+=_0x2760('0xd2');_0x3b027e+=_0x2760('0x87');_0x3b027e+=util[_0x2760('0x47')](_0x2760('0xd3'),_0x366aac[_0x2760('0x49')][_0x2760('0xc9')]['replace'](new RegExp(String[_0x2760('0xd4')](0xd),'g'),_0x2760('0xd5')));_0x3b027e+='';_0x3b027e+='';_0x3b027e+=_0x2760('0xb5');_0x3b027e+=_0x2760('0xd6')+_0x203bf9[_0x2760('0xd7')][_0x361020]+_0x2760('0xd8');if(!_[_0x2760('0xc6')](_0x366aac[_0x2760('0x49')][_0x2760('0xd9')])){_0x3b027e+=_0x2760('0xd6')+_0x203bf9['accountholder'][_0x361020]+_0x2760('0xda')+_0x366aac[_0x2760('0x49')][_0x2760('0xd9')]+_0x2760('0xdb');_0x3b027e+=''+_0x203bf9['bankname'][_0x361020]+_0x2760('0xda')+_0x366aac['creditnote'][_0x2760('0xdc')]+'\x20';_0x3b027e+=_0x2760('0xd6')+_0x203bf9[_0x2760('0xdd')][_0x361020]+_0x2760('0xda')+_0x366aac[_0x2760('0x49')][_0x2760('0xde')]+',\x20'+_0x366aac['creditnote'][_0x2760('0xdf')]+_0x2760('0xe0')+_0x366aac[_0x2760('0x49')][_0x2760('0xe1')]+'\x20('+_0x366aac['creditnote'][_0x2760('0xe2')]+')'+_0x2760('0xdb');_0x3b027e+=_0x2760('0xd6')+_0x203bf9[_0x2760('0xe3')][_0x361020]+'/'+_0x203bf9[_0x2760('0xe4')][_0x361020]+_0x2760('0xda')+_0x366aac[_0x2760('0x49')][_0x2760('0xe5')]+'/'+_0x366aac[_0x2760('0x49')]['issuerCAB']+_0x2760('0xdb');_0x3b027e+=_0x2760('0xd6')+_0x203bf9[_0x2760('0xe6')][_0x361020]+'/'+_0x203bf9['swif'][_0x361020]+_0x2760('0xda')+_0x366aac[_0x2760('0x49')][_0x2760('0xe7')]+'';_0x3b027e+=''+_0x203bf9['iban'][_0x361020]+_0x2760('0xda')+_0x366aac[_0x2760('0x49')][_0x2760('0xe8')]+'';}if(!_[_0x2760('0xc6')](_0x366aac['creditnote'][_0x2760('0xe9')])){_0x3b027e+=_0x2760('0xd6')+_0x203bf9['paypal'][_0x361020]+_0x2760('0xda')+_0x366aac[_0x2760('0x49')]['issuerPayPal']+_0x2760('0xdb');}_0x3b027e+=''+_0x203bf9[_0x2760('0xea')][_0x361020]+_0x2760('0xeb')+_0x174e4e+''+_0x203bf9['thank2'][_0x361020]+_0x2760('0x53');_0x3b027e+=_0x2760('0x9b');_0x3b027e+=_0x2760('0xa8');_0x3b027e+=_0x2760('0xec');_0x3b027e+=_0x2760('0xed');_0x3b027e+='';return new BPromise(function(_0x189c59,_0x6820c){pdf['create'](_0x3b027e,_0x486d02)[_0x2760('0xee')](path['join'](_0x2206a6,_0x29cfdd),function(_0x370ce6,_0x3c145d){if(_0x370ce6)return _0x6820c(_0x370ce6);_0x189c59(_0x3c145d);});});});}})['then'](function(){if(_0x18bc58){console[_0x2760('0x4c')]('TCL:\x20exports.getCreditnotePDF\x20->\x20saveTo,\x20fileName',_0x4f5786,_0x29cfdd);return _0x198c64[_0x2760('0xef')](_0x4f5786,_0x29cfdd,function(_0x164659){if(_0x164659){console[_0x2760('0x4c')](_0x2760('0xf0'),_0x164659);}else{console[_0x2760('0x4c')](_0x2760('0xf1'),_0x2206a6);rimraf(_0x2206a6,function(){});}});}else{return _0x198c64[_0x2760('0xf2')](0xc8);}})['catch'](handleError(_0x198c64,null));}; \ No newline at end of file +var _0xd2b9=['','','sendpayment',':','issuerBankAccount','accountholder',':\x20','','bankname','issuerBankName','bankaddress','issuerBankStreet','issuerBankPostalCode','\x20-\x20','issuerBankCity','issuerBankCountry','abi','cab','issuerABI','issuerCAB','bic','swif','issuerBankBICSWIFT','iban','issuerPayPal','thank1','','thank2','','','toFile','TCL:\x20exports.getCreditnotePDF\x20->\x20saveTo,\x20fileName','download','err','foldername','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','reject','save','then','destroy','end','stack','name','SACreditNote','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','params','describe','getCreditnotePDF','toString','join','root','files','tmp','images','logo-invoice.png','server','logos','paid-invoice.png','format','Credinote_%s-%s.pdf','creditnote','SACreditNoteDetail','log','details','portrait','1cm','10mm','{{page}}/{{pages}}','footer','contents','default','','mkdirSync','','','Phone','Telefono','Fax','Email','VAT\x20number','P.IVA','Tax\x20code','C.F.','Codice\x20S.D.I.','Soc.Cap.\x20fp','Cap.Soc.\x20iv','Invoice','Fattura','Proforma','Nota\x20di\x20credito','Due\x20date','Scadenza','Item','Articolo','Description','Hrs/Qty','Ore/Qta','Unit\x20Price','Prezzo\x20Unitario','Sub\x20Total','Sub\x20Totale','Discount','Sconto','Subtotal','Tax','Tasse','Please\x20send\x20PAYMENT\x20to','Si\x20prega\x20di\x20inviare\x20il\x20pagamento\x20a','Bank\x20name','Nome\x20banca','Indirizzo\x20banca','ABI','CAB','BIC','SWIF','IBAN','Pay\x20via\x20Paypal','Paga\x20con\x20Paypal','Thank\x20you\x20for\x20your\x20business.\x20We\x20do\x20expect\x20payment\x20by\x20','Grazie.\x20Prevediamo\x20il\x20pagamento\x20entro\x20',',\x20so\x20please\x20do\x20so\x20within\x20this\x20time.','\x20quindi\x20vi\x20preghiamo\x20di\x20provvedere\x20entro\x20tale\x20termine.','receivingCountry','Italy','','\x22\x20width=\x22180\x22>','','\x20%s
','issuerName','%s
','issuerPostalCode','\x20%s','issuerCity','issuerCountry','-\x20%s\x20
','phone',':\x20%s
','issuerPhone','fax','issuerFax','issuerEmail','piva','issuerPIVA','issuerFiscalCode','sdi','issuerSDICode','','','','%s','companyName','receivingStreet','%s\x20-\x20','receivingPostalCode','receivingCity','','receivingPIVA','','','','\x20N.%d','number','%s,\x20','startDate','DD/MM/YYYY','%s\x20','updatedAt','days','duedate','','','item','hrsqty','','unitprice','subtotal','netPrice','discount','tax','quantity','productName','productDescription','%d','','toFixed','€','isNil','','','total','','nettopay','','\x20',' ','','\x20%s\x20','receivingFiscalMessage','replace','fromCharCode'];(function(_0x45f417,_0x10f305){var _0x4821a6=function(_0x93d730){while(--_0x93d730){_0x45f417['push'](_0x45f417['shift']());}};_0x4821a6(++_0x10f305);}(_0xd2b9,0x128));var _0x9d2b=function(_0x4282aa,_0xe66504){_0x4282aa=_0x4282aa-0x0;var _0x5085f0=_0xd2b9[_0x4282aa];return _0x5085f0;};'use strict';var pdf=require(_0x9d2b('0x0'));var emlformat=require(_0x9d2b('0x1'));var rimraf=require(_0x9d2b('0x2'));var zipdir=require(_0x9d2b('0x3'));var jsonpatch=require(_0x9d2b('0x4'));var rp=require(_0x9d2b('0x5'));var moment=require('moment');var BPromise=require(_0x9d2b('0x6'));var Mustache=require(_0x9d2b('0x7'));var util=require('util');var path=require(_0x9d2b('0x8'));var sox=require(_0x9d2b('0x9'));var csv=require('to-csv');var ejs=require(_0x9d2b('0xa'));var fs=require('fs');var _=require(_0x9d2b('0xb'));var squel=require(_0x9d2b('0xc'));var crypto=require(_0x9d2b('0xd'));var jsforce=require(_0x9d2b('0xe'));var deskjs=require(_0x9d2b('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9d2b('0x10'));var Redis=require(_0x9d2b('0x11'));var authService=require(_0x9d2b('0x12'));var qs=require(_0x9d2b('0x13'));var hardwareService=require(_0x9d2b('0x14'));var logger=require(_0x9d2b('0x15'))(_0x9d2b('0x16'));var utils=require(_0x9d2b('0x17'));var config=require(_0x9d2b('0x18'));var db=require(_0x9d2b('0x19'))['db'];function respondWithStatusCode(_0x18f09c,_0x24e224){_0x24e224=_0x24e224||0xcc;return function(_0x3e4188){if(_0x3e4188){return _0x18f09c[_0x9d2b('0x1a')](_0x24e224);}return _0x18f09c[_0x9d2b('0x1b')](_0x24e224)['end']();};}function respondWithResult(_0x5215ab,_0x557e8b){_0x557e8b=_0x557e8b||0xc8;return function(_0x1f4ae0){if(_0x1f4ae0){return _0x5215ab[_0x9d2b('0x1b')](_0x557e8b)[_0x9d2b('0x1c')](_0x1f4ae0);}};}function respondWithFilteredResult(_0x11e80b,_0x3af1e2){return function(_0x558bb8){if(_0x558bb8){var _0x503381=_0x558bb8[_0x9d2b('0x1d')],_0x108e13=_0x3af1e2[_0x9d2b('0x1e')],_0x34dd6e=_0x3af1e2[_0x9d2b('0x1e')]+_0x3af1e2['limit'],_0x2a808b;if(_0x34dd6e>=_0x503381){_0x34dd6e=_0x503381;_0x2a808b=0xc8;}else{_0x2a808b=0xce;}_0x11e80b[_0x9d2b('0x1b')](_0x2a808b);return _0x11e80b[_0x9d2b('0x1f')](_0x9d2b('0x20'),_0x108e13+'-'+_0x34dd6e+'/'+_0x503381)[_0x9d2b('0x1c')](_0x558bb8);}return null;};}function patchUpdates(_0x1934b1){return function(_0x5b22b8){try{jsonpatch['apply'](_0x5b22b8,_0x1934b1,!![]);}catch(_0x25a513){return BPromise[_0x9d2b('0x21')](_0x25a513);}return _0x5b22b8[_0x9d2b('0x22')]();};}function saveUpdates(_0x1d4e69,_0xf420a1){return function(_0x40e377){if(_0x40e377){return _0x40e377['update'](_0x1d4e69)[_0x9d2b('0x23')](function(_0x338ac1){return _0x338ac1;});}return null;};}function removeEntity(_0x3b7bba,_0xe5733d){return function(_0x23cf6c){if(_0x23cf6c){return _0x23cf6c[_0x9d2b('0x24')]()[_0x9d2b('0x23')](function(){_0x3b7bba[_0x9d2b('0x1b')](0xcc)[_0x9d2b('0x25')]();});}};}function handleEntityNotFound(_0x58a6da,_0x381e67){return function(_0x1b2648){if(!_0x1b2648){_0x58a6da[_0x9d2b('0x1a')](0x194);}return _0x1b2648;};}function handleError(_0x44ad61,_0x42fc31){_0x42fc31=_0x42fc31||0x1f4;return function(_0xd00b26){logger['error'](_0xd00b26[_0x9d2b('0x26')]);if(_0xd00b26[_0x9d2b('0x27')]){delete _0xd00b26[_0x9d2b('0x27')];}_0x44ad61[_0x9d2b('0x1b')](_0x42fc31)['send'](_0xd00b26);};}exports['index']=function(_0x316d55,_0x4ded9a){var _0x4381e9={},_0xca3ece={},_0x12979c={'count':0x0,'rows':[]};var _0x5851af=db[_0x9d2b('0x28')]['rawAttributes'];_0xca3ece[_0x9d2b('0x29')]=_[_0x9d2b('0x2a')](_0x5851af);_0xca3ece[_0x9d2b('0x2b')]=_[_0x9d2b('0x2a')](_0x316d55[_0x9d2b('0x2b')]);_0xca3ece[_0x9d2b('0x2c')]=_['intersection'](_0xca3ece[_0x9d2b('0x29')],_0xca3ece[_0x9d2b('0x2b')]);_0x4381e9['attributes']=_[_0x9d2b('0x2d')](_0xca3ece['model'],qs['fields'](_0x316d55[_0x9d2b('0x2b')][_0x9d2b('0x2e')]));_0x4381e9[_0x9d2b('0x2f')]=_0x4381e9[_0x9d2b('0x2f')][_0x9d2b('0x30')]?_0x4381e9['attributes']:_0xca3ece[_0x9d2b('0x29')];if(!_0x316d55['query'][_0x9d2b('0x31')]('nolimit')){_0x4381e9[_0x9d2b('0x32')]=qs[_0x9d2b('0x32')](_0x316d55[_0x9d2b('0x2b')][_0x9d2b('0x32')]);_0x4381e9['offset']=qs[_0x9d2b('0x1e')](_0x316d55[_0x9d2b('0x2b')][_0x9d2b('0x1e')]);}_0x4381e9[_0x9d2b('0x33')]=qs[_0x9d2b('0x34')](_0x316d55[_0x9d2b('0x2b')][_0x9d2b('0x34')]);_0x4381e9[_0x9d2b('0x35')]=qs[_0x9d2b('0x2c')](_[_0x9d2b('0x36')](_0x316d55['query'],_0xca3ece[_0x9d2b('0x2c')]));if(_0x316d55[_0x9d2b('0x2b')][_0x9d2b('0x37')]){_0x4381e9[_0x9d2b('0x35')]=_[_0x9d2b('0x38')](_0x4381e9['where'],{'$or':_[_0x9d2b('0x39')](_0x5851af,function(_0x5ac8bc){if(_0x5ac8bc[_0x9d2b('0x3a')][_0x9d2b('0x3b')]!=='VIRTUAL'){var _0x2e048c={};_0x2e048c[_0x5ac8bc[_0x9d2b('0x3c')]]={'$like':'%'+_0x316d55[_0x9d2b('0x2b')][_0x9d2b('0x37')]+'%'};return _0x2e048c;}})});}_0x4381e9=_[_0x9d2b('0x38')]({},_0x4381e9,_0x316d55[_0x9d2b('0x3d')]);var _0x1a28ff={'where':_0x4381e9[_0x9d2b('0x35')]};return db[_0x9d2b('0x28')][_0x9d2b('0x1d')](_0x1a28ff)[_0x9d2b('0x23')](function(_0x1c4ab4){_0x12979c['count']=_0x1c4ab4;if(_0x316d55['query'][_0x9d2b('0x3e')]){_0x4381e9[_0x9d2b('0x3f')]=[{'all':!![]}];}return db[_0x9d2b('0x28')][_0x9d2b('0x40')](_0x4381e9);})['then'](function(_0x1ca2b6){_0x12979c[_0x9d2b('0x41')]=_0x1ca2b6;return _0x12979c;})[_0x9d2b('0x23')](respondWithFilteredResult(_0x4ded9a,_0x4381e9))[_0x9d2b('0x42')](handleError(_0x4ded9a,null));};exports['show']=function(_0x18e3ff,_0x5640c8){var _0x4e2e1b={'raw':![],'where':{'id':_0x18e3ff['params']['id']}},_0x12fcf9={};_0x12fcf9[_0x9d2b('0x29')]=_['keys'](db[_0x9d2b('0x28')][_0x9d2b('0x43')]);_0x12fcf9[_0x9d2b('0x2b')]=_['keys'](_0x18e3ff['query']);_0x12fcf9[_0x9d2b('0x2c')]=_[_0x9d2b('0x2d')](_0x12fcf9[_0x9d2b('0x29')],_0x12fcf9['query']);_0x4e2e1b[_0x9d2b('0x2f')]=_[_0x9d2b('0x2d')](_0x12fcf9[_0x9d2b('0x29')],qs[_0x9d2b('0x2e')](_0x18e3ff['query'][_0x9d2b('0x2e')]));_0x4e2e1b[_0x9d2b('0x2f')]=_0x4e2e1b[_0x9d2b('0x2f')][_0x9d2b('0x30')]?_0x4e2e1b[_0x9d2b('0x2f')]:_0x12fcf9[_0x9d2b('0x29')];if(_0x18e3ff[_0x9d2b('0x2b')][_0x9d2b('0x3e')]){_0x4e2e1b[_0x9d2b('0x3f')]=[{'all':!![]}];}_0x4e2e1b=_[_0x9d2b('0x38')]({},_0x4e2e1b,_0x18e3ff[_0x9d2b('0x3d')]);return db[_0x9d2b('0x28')][_0x9d2b('0x44')](_0x4e2e1b)[_0x9d2b('0x23')](handleEntityNotFound(_0x5640c8,null))[_0x9d2b('0x23')](respondWithResult(_0x5640c8,null))[_0x9d2b('0x42')](handleError(_0x5640c8,null));};exports[_0x9d2b('0x45')]=function(_0x797ffb,_0x118659){return db[_0x9d2b('0x28')]['create'](_0x797ffb[_0x9d2b('0x46')],{})[_0x9d2b('0x23')](respondWithResult(_0x118659,0xc9))[_0x9d2b('0x42')](handleError(_0x118659,null));};exports['update']=function(_0x32eb73,_0x54da33){if(_0x32eb73['body']['id']){delete _0x32eb73[_0x9d2b('0x46')]['id'];}return db[_0x9d2b('0x28')][_0x9d2b('0x44')]({'where':{'id':_0x32eb73[_0x9d2b('0x47')]['id']}})[_0x9d2b('0x23')](handleEntityNotFound(_0x54da33,null))[_0x9d2b('0x23')](saveUpdates(_0x32eb73['body'],null))[_0x9d2b('0x23')](respondWithResult(_0x54da33,null))['catch'](handleError(_0x54da33,null));};exports[_0x9d2b('0x24')]=function(_0x29f438,_0x33bdc0){return db['SACreditNote'][_0x9d2b('0x44')]({'where':{'id':_0x29f438['params']['id']}})['then'](handleEntityNotFound(_0x33bdc0,null))[_0x9d2b('0x23')](removeEntity(_0x33bdc0,null))['catch'](handleError(_0x33bdc0,null));};exports[_0x9d2b('0x48')]=function(_0x10b285,_0x4830b6){return db['SACreditNote'][_0x9d2b('0x48')]()[_0x9d2b('0x23')](respondWithResult(_0x4830b6,null))[_0x9d2b('0x42')](handleError(_0x4830b6,null));};exports[_0x9d2b('0x49')]=function(_0x5f3894,_0x2e50c9){var _0xf1c7cf=moment()['unix']()[_0x9d2b('0x4a')]();var _0x17c9d1=path[_0x9d2b('0x4b')](config[_0x9d2b('0x4c')],'server',_0x9d2b('0x4d'),_0x9d2b('0x4e'));var _0x4354d2=path[_0x9d2b('0x4b')](config['root'],'server',_0x9d2b('0x4d'),_0x9d2b('0x4f'),'logos',_0x9d2b('0x50'));var _0x482f24=path[_0x9d2b('0x4b')](config[_0x9d2b('0x4c')],_0x9d2b('0x51'),'files','images',_0x9d2b('0x52'),_0x9d2b('0x53'));var _0x1dd940=path[_0x9d2b('0x4b')](_0x17c9d1,_0xf1c7cf);var _0x4bb2c9=util[_0x9d2b('0x54')](_0x9d2b('0x55'),_0x5f3894['params']['id'],_0xf1c7cf);var _0xb9b272=path['join'](_0x1dd940,_0x4bb2c9);var _0x3998b0=![];var _0x21c440={};return db[_0x9d2b('0x28')][_0x9d2b('0x44')]({'where':{'id':_0x5f3894['params']['id']},'raw':!![]})[_0x9d2b('0x23')](handleEntityNotFound(_0x2e50c9,null))[_0x9d2b('0x23')](function(_0x5d97cf){if(_0x5d97cf){_0x21c440[_0x9d2b('0x56')]=_0x5d97cf;return db[_0x9d2b('0x57')]['findAll']({'where':{'CreditNoteId':_0x5d97cf['id']},'raw':!![],'logging':console[_0x9d2b('0x58')]})[_0x9d2b('0x23')](function(_0x3f2331){_0x21c440[_0x9d2b('0x59')]=_0x3f2331;_0x3998b0=!![];var _0x48ca9c='';var _0x5ce81a={'format':'A4','orientation':_0x9d2b('0x5a'),'border':_0x9d2b('0x5b'),'footer':{'height':_0x9d2b('0x5c'),'contents':{'default':_0x9d2b('0x5d')}}};_0x5ce81a[_0x9d2b('0x5e')][_0x9d2b('0x5f')][_0x9d2b('0x60')]=_0x5ce81a[_0x9d2b('0x5e')][_0x9d2b('0x5f')][_0x9d2b('0x60')]+_0x9d2b('0x61')+_0x21c440[_0x9d2b('0x56')]['issuerWeb']+'';fs[_0x9d2b('0x62')](_0x1dd940);_0x48ca9c=_0x9d2b('0x63');_0x48ca9c+='\x20\x20body{font-family:\x20Verdana,\x20Geneva,\x20Tahoma,\x20sans-serif;}.itemTabTitle{background-color:\x20lightgray;\x20height:\x2040px;}.issuerInfo{color:\x20lightgray;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;\x20font-size:\x2012px;}.issuerData{font-weight:\x20normal}.issuerFiled{font-weight:\x20bold;\x20font-size:\x2010px;\x20padding-left:\x2010px;}.issuerFiledWeb{font-weight:\x20bold;\x20text-align:\x20center;}.receiperInfo{text-align:\x20right;\x20font-size:\x2012px}.receiperCompanyName{font-weight:\x20bold;\x20padding-top:\x2010px;\x20padding-bottom:\x2015px;\x20font-size:\x2016px}.reciperFiscalInfo{padding-top:\x205px;\x20padding-bottom:\x205px;}table.center{margin-left:\x20auto;\x20margin-right:\x20auto;\x20width:\x2090%;}.total{background-color:\x20lightgray;\x20font-size:\x2018px;\x20font-weight:\x20bold;}.totalText{background-color:\x20lightgray;\x20text-align:\x20right;\x20font-size:\x2016px;\x20padding-right:\x2010px;}.totalEmpty{background-color:\x20#ffffff;}.invoiceNumber{font-weight:\x20bolder;\x20font-size:\x2024px;\x20padding-bottom:\x2020px;}.invoiceNumber{font-weight:\x20bold;\x20font-size:\x2018px;}.createdDate{font-size:\x2014px;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;}.duedDate{font-size:\x2014px;\x20padding-bottom:\x2010px;}.TFtable{width:\x20100%;\x20font-size:\x2010px;\x20border-collapse:\x20collapse;}.TFtable\x20td{padding:\x207px;}.TFtable\x20tr:nth-child(even){background:\x20#ffffff;}.TFtable\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.numberRight{text-align:\x20right;}.numberCenter{text-align:\x20center}.currency{text-align:\x20left;}table.roundedCorners{border:\x202px\x20solid\x20lightgray;\x20border-radius:\x205px;\x20border-spacing:\x200;\x20width:\x20100%;\x20font-size:\x2010px;}table.roundedCorners\x20td,\x20table.roundedCorners\x20th{border-bottom:\x201px\x20solid\x20lightgray;\x20padding:\x2010px;}table.roundedCorners\x20tr:last-child\x20>\x20td{border-bottom:\x20none;}table.roundedCorners\x20tr:nth-child(even){background:\x20#ffffff;}table.roundedCorners\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.lex{padding-left:\x2010px;font-size:\x2010px;padding-bottom:\x2020px;}.divTotal{float:\x20right;\x20border-radius:\x205px;\x20border:\x202px\x20solid\x20lightgray;\x20padding:\x2010px;\x20margin-top:30px;}.itemTotal{width:\x20200px;\x20line-height:\x2030px;}.tabTotal{border-collapse:\x20collapse;}';_0x48ca9c+=_0x9d2b('0x64');var _0x27e5e4={'phone':{'en':_0x9d2b('0x65'),'it':_0x9d2b('0x66')},'fax':{'en':_0x9d2b('0x67'),'it':_0x9d2b('0x67')},'email':{'en':_0x9d2b('0x68'),'it':'Email'},'piva':{'en':_0x9d2b('0x69'),'it':_0x9d2b('0x6a')},'cf':{'en':_0x9d2b('0x6b'),'it':_0x9d2b('0x6c')},'sdi':{'en':'I.S.\x20code','it':_0x9d2b('0x6d')},'cs':{'en':_0x9d2b('0x6e'),'it':_0x9d2b('0x6f')},'invoice':{'en':_0x9d2b('0x70'),'it':_0x9d2b('0x71')},'proforma':{'en':'Proforma','it':_0x9d2b('0x72')},'creditnote':{'en':'Credit\x20note','it':_0x9d2b('0x73')},'duedate':{'en':_0x9d2b('0x74'),'it':_0x9d2b('0x75')},'item':{'en':_0x9d2b('0x76'),'it':_0x9d2b('0x77')},'description':{'en':_0x9d2b('0x78'),'it':'Descrizione'},'hrsqty':{'en':_0x9d2b('0x79'),'it':_0x9d2b('0x7a')},'unitprice':{'en':_0x9d2b('0x7b'),'it':_0x9d2b('0x7c')},'subtotal':{'en':_0x9d2b('0x7d'),'it':_0x9d2b('0x7e')},'discount':{'en':_0x9d2b('0x7f'),'it':_0x9d2b('0x80')},'total':{'en':_0x9d2b('0x81'),'it':'Imponibile'},'tax':{'en':_0x9d2b('0x82'),'it':_0x9d2b('0x83')},'nettopay':{'en':'Total','it':'Totale'},'sendpayment':{'en':_0x9d2b('0x84'),'it':_0x9d2b('0x85')},'accountholder':{'en':'Account\x20Holder','it':'Conto\x20intestato\x20a'},'bankname':{'en':_0x9d2b('0x86'),'it':_0x9d2b('0x87')},'bankaddress':{'en':'Bank\x20Address','it':_0x9d2b('0x88')},'abi':{'en':_0x9d2b('0x89'),'it':_0x9d2b('0x89')},'cab':{'en':_0x9d2b('0x8a'),'it':_0x9d2b('0x8a')},'bic':{'en':_0x9d2b('0x8b'),'it':_0x9d2b('0x8b')},'swif':{'en':_0x9d2b('0x8c'),'it':_0x9d2b('0x8c')},'iban':{'en':_0x9d2b('0x8d'),'it':_0x9d2b('0x8d')},'paypal':{'en':_0x9d2b('0x8e'),'it':_0x9d2b('0x8f')},'thank1':{'en':_0x9d2b('0x90'),'it':_0x9d2b('0x91')},'thank2':{'en':_0x9d2b('0x92'),'it':_0x9d2b('0x93')}};var _0x3828e5='it';if(_0x21c440[_0x9d2b('0x56')][_0x9d2b('0x94')]!==_0x9d2b('0x95')){_0x3828e5='en';}_0x48ca9c+=_0x9d2b('0x96');_0x48ca9c+='\x20',_0x21c440[_0x9d2b('0x56')][_0x9d2b('0x9f')]);_0x48ca9c+=util['format'](_0x9d2b('0xa0'),_0x21c440[_0x9d2b('0x56')][_0x9d2b('0x9f')]);_0x48ca9c+=util[_0x9d2b('0x54')](_0x27e5e4[_0x9d2b('0xa1')][_0x3828e5]+_0x9d2b('0xa2'),_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xa3')]);_0x48ca9c+=util[_0x9d2b('0x54')](_0x27e5e4[_0x9d2b('0xa4')][_0x3828e5]+_0x9d2b('0xa2'),_0x21c440['creditnote'][_0x9d2b('0xa5')]);_0x48ca9c+=util[_0x9d2b('0x54')](_0x27e5e4['email'][_0x3828e5]+'%s
',_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xa6')]);_0x48ca9c+=util[_0x9d2b('0x54')](_0x27e5e4[_0x9d2b('0xa7')][_0x3828e5]+_0x9d2b('0xa2'),_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xa8')]);_0x48ca9c+=util[_0x9d2b('0x54')](_0x27e5e4['cf'][_0x3828e5]+_0x9d2b('0xa2'),_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xa9')]);_0x48ca9c+=util[_0x9d2b('0x54')](_0x27e5e4[_0x9d2b('0xaa')][_0x3828e5]+'%s
',_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xab')]);_0x48ca9c+=util[_0x9d2b('0x54')](_0x27e5e4['cs'][_0x3828e5]+':\x20%s
',_0x21c440[_0x9d2b('0x56')]['issuerSocCap']);_0x48ca9c+=_0x9d2b('0xac');_0x48ca9c+=_0x9d2b('0xad');_0x48ca9c+=_0x9d2b('0xae');_0x48ca9c+=util['format'](_0x9d2b('0xaf'),_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xb0')]);_0x48ca9c+=util[_0x9d2b('0x54')](_0x9d2b('0x9b'),_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xb1')]);_0x48ca9c+=util['format'](_0x9d2b('0xb2'),_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xb3')]);_0x48ca9c+=util[_0x9d2b('0x54')](_0x9d2b('0x9b'),_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xb4')]);_0x48ca9c+=util[_0x9d2b('0x54')](_0x9d2b('0x9b'),_0x21c440[_0x9d2b('0x56')][_0x9d2b('0x94')]);_0x48ca9c+=util[_0x9d2b('0x54')](_0x9d2b('0xb5')+_0x27e5e4['cf'][_0x3828e5]+_0x9d2b('0xa2'),_0x21c440[_0x9d2b('0x56')]['receivingFiscalCode']);_0x48ca9c+=util[_0x9d2b('0x54')](_0x27e5e4[_0x9d2b('0xa7')][_0x3828e5]+_0x9d2b('0xa2'),_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xb6')]);_0x48ca9c+=util['format'](_0x27e5e4[_0x9d2b('0xaa')][_0x3828e5]+_0x9d2b('0xa2'),_0x21c440[_0x9d2b('0x56')]['receivingSDICode']);_0x48ca9c+=_0x9d2b('0xb7');_0x48ca9c+=_0x9d2b('0xb8');_0x48ca9c+=_0x9d2b('0x98');_0x48ca9c+=_0x9d2b('0xb9');_0x48ca9c+=util[_0x9d2b('0x54')](''+_0x27e5e4[_0x9d2b('0x56')][_0x3828e5]+_0x9d2b('0xba'),_0x5d97cf[_0x9d2b('0xbb')]);_0x48ca9c+=util['format'](_0x9d2b('0xbc'),_0x21c440[_0x9d2b('0x56')][_0x9d2b('0x9e')]);var _0x45f01a=moment(_0x21c440['creditnote'][_0x9d2b('0xbd')])[_0x9d2b('0x54')](_0x9d2b('0xbe'));_0x48ca9c+=util[_0x9d2b('0x54')](_0x9d2b('0xbf'),_0x45f01a);var _0x2854f0=moment(_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xc0')])['add'](_0x21c440[_0x9d2b('0x56')]['saExpiryDay'],_0x9d2b('0xc1'))[_0x9d2b('0x54')](_0x9d2b('0xbe'));_0x48ca9c+=util[_0x9d2b('0x54')](''+_0x27e5e4[_0x9d2b('0xc2')][_0x3828e5]+':\x20%s',_0x2854f0);_0x48ca9c+='
';_0x48ca9c+='';_0x48ca9c+='';_0x48ca9c+=_0x9d2b('0xc3');_0x48ca9c+=_0x9d2b('0x98');_0x48ca9c+=_0x9d2b('0xc4')+_0x27e5e4[_0x9d2b('0xc5')][_0x3828e5]+'';_0x48ca9c+=_0x9d2b('0xc4')+_0x27e5e4['description'][_0x3828e5]+'';_0x48ca9c+=''+_0x27e5e4[_0x9d2b('0xc6')][_0x3828e5]+_0x9d2b('0xc7');_0x48ca9c+=_0x9d2b('0xc4')+_0x27e5e4[_0x9d2b('0xc8')][_0x3828e5]+_0x9d2b('0xc7');_0x48ca9c+=_0x9d2b('0xc4')+_0x27e5e4[_0x9d2b('0xc9')][_0x3828e5]+'';_0x48ca9c+=_0x9d2b('0xb8');var _0x2e7a63=0x0;var _0x2f94ce=0x0;for(var _0x9a6504=0x0;_0x9a6504<_0x21c440[_0x9d2b('0x59')][_0x9d2b('0x30')];_0x9a6504++){var _0x2cf451=0x0;var _0x1cd40f=0x0;var _0x47657d=0x0;var _0x247868=0x0;_0x2cf451=_0x21c440['details'][_0x9a6504]['netPrice']-_0x21c440[_0x9d2b('0x59')][_0x9a6504][_0x9d2b('0xca')]/0x64*_0x21c440[_0x9d2b('0x59')][_0x9a6504][_0x9d2b('0xcb')];_0x1cd40f=_0x2cf451/0x64*_0x21c440[_0x9d2b('0x59')][_0x9a6504][_0x9d2b('0xcc')];_0x47657d=_0x2cf451*_0x21c440[_0x9d2b('0x59')][_0x9a6504]['quantity'];_0x247868=_0x1cd40f*_0x21c440['details'][_0x9a6504][_0x9d2b('0xcd')];_0x48ca9c+='';_0x48ca9c+=util[_0x9d2b('0x54')]('',_0x21c440[_0x9d2b('0x59')][_0x9a6504][_0x9d2b('0xce')]);_0x48ca9c+=util['format']('',_0x21c440['details'][_0x9a6504][_0x9d2b('0xcf')]);_0x48ca9c+=util[_0x9d2b('0x54')](_0x9d2b('0xd0'),_0x21c440[_0x9d2b('0x59')][_0x9a6504][_0x9d2b('0xcd')]);_0x48ca9c+=_0x9d2b('0xd1')+_0x2cf451[_0x9d2b('0xd2')](0x2)+_0x9d2b('0xd3');_0x48ca9c+=_0x9d2b('0xd1')+_0x47657d[_0x9d2b('0xd2')](0x2)+_0x9d2b('0xd3');_0x48ca9c+='';_0x2e7a63+=_0x47657d;_0x2f94ce+=_0x247868;}_0x48ca9c+='
%s%s
';if(!_[_0x9d2b('0xd4')](_0x21c440['creditnote']['discount'])){var _0x583dc4=0x0;var _0x563eac=0x0;var _0x580c15=_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xcb')]*0x64/_0x2e7a63;for(var _0x9a6504=0x0;_0x9a6504<_0x21c440['details']['length'];_0x9a6504++){var _0x963c7=0x0;var _0x23b497=0x0;var _0x4f3dbf=0x0;_0x2cf451=_0x21c440[_0x9d2b('0x59')][_0x9a6504][_0x9d2b('0xca')]-_0x21c440[_0x9d2b('0x59')][_0x9a6504][_0x9d2b('0xca')]/0x64*_0x21c440['details'][_0x9a6504]['discount'];_0x963c7=_0x2cf451/0x64*_0x580c15;_0x23b497=_0x2cf451-_0x963c7;_0x4f3dbf=_0x23b497*_0x21c440[_0x9d2b('0x59')][_0x9a6504][_0x9d2b('0xcd')];_0x583dc4+=_0x4f3dbf;_0x563eac+=_0x4f3dbf/0x64*_0x21c440[_0x9d2b('0x59')][_0x9a6504]['tax'];}}var _0x52b6a1=0x0;var _0x1c9ae6=0x0;var _0x7aea00=![];var _0x11b2cf=_0x21c440[_0x9d2b('0x56')]['receivingFiscalMessage'];if(_0x11b2cf['indexOf']('split\x20payment')!=-0x1){_0x7aea00=!![];}if(!_[_0x9d2b('0xd4')](_0x21c440['creditnote']['discount'])){_0x48ca9c+=_0x9d2b('0x98');if(_0x21c440[_0x9d2b('0x56')]['discount']>0x0){_0x48ca9c+=_0x9d2b('0xd5')+_0x27e5e4['discount'][_0x3828e5]+_0x9d2b('0xac');_0x48ca9c+='\x20'+_0x21c440['creditnote'][_0x9d2b('0xcb')][_0x9d2b('0xd2')](0x2)+_0x9d2b('0xd3');}_0x48ca9c+=_0x9d2b('0xb8');_0x52b6a1=_0x563eac;_0x1c9ae6=_0x583dc4;}else{_0x52b6a1=_0x2f94ce;_0x1c9ae6=_0x2e7a63;}if(_0x52b6a1>0x0||_0x21c440[_0x9d2b('0x56')]['discount']>0x0){_0x48ca9c+='';_0x48ca9c+=_0x9d2b('0xd6')+_0x27e5e4[_0x9d2b('0xd7')][_0x3828e5]+'';_0x48ca9c+=_0x9d2b('0xd1')+_0x1c9ae6['toFixed'](0x2)+_0x9d2b('0xd3');_0x48ca9c+=_0x9d2b('0xb8');}if(_0x52b6a1>0x0){_0x48ca9c+='';_0x48ca9c+=_0x9d2b('0xd6')+_0x27e5e4['tax'][_0x3828e5]+'';_0x48ca9c+=_0x9d2b('0xd1')+_0x52b6a1[_0x9d2b('0xd2')](0x2)+'€';_0x48ca9c+='';}_0x48ca9c+=_0x9d2b('0x98');var _0x4bcf35;if(_0x7aea00){_0x4bcf35=_0x1c9ae6;}else{_0x4bcf35=_0x1c9ae6+_0x52b6a1;}_0x48ca9c+=_0x9d2b('0xd8')+_0x27e5e4[_0x9d2b('0xd9')][_0x3828e5]+_0x9d2b('0xda')+_0x4bcf35[_0x9d2b('0xd2')](0x2)+_0x9d2b('0xd3');_0x48ca9c+=_0x9d2b('0xdb');_0x48ca9c+=_0x9d2b('0xdc');_0x48ca9c+=_0x9d2b('0xdd');_0x48ca9c+=_0x9d2b('0x98');_0x48ca9c+=util[_0x9d2b('0x54')](_0x9d2b('0xde'),_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xdf')][_0x9d2b('0xe0')](new RegExp(String[_0x9d2b('0xe1')](0xd),'g'),_0x9d2b('0xe2')));_0x48ca9c+=_0x9d2b('0xb8');_0x48ca9c+=_0x9d2b('0x98');_0x48ca9c+=_0x9d2b('0xb9');_0x48ca9c+=_0x9d2b('0xe3')+_0x27e5e4[_0x9d2b('0xe4')][_0x3828e5]+_0x9d2b('0xe5');if(!_[_0x9d2b('0xd4')](_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xe6')])){_0x48ca9c+=_0x9d2b('0xe3')+_0x27e5e4[_0x9d2b('0xe7')][_0x3828e5]+_0x9d2b('0xe8')+_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xe6')]+_0x9d2b('0xe9');_0x48ca9c+=_0x9d2b('0xe3')+_0x27e5e4[_0x9d2b('0xea')][_0x3828e5]+_0x9d2b('0xe8')+_0x21c440['creditnote'][_0x9d2b('0xeb')]+'\x20';_0x48ca9c+=_0x9d2b('0xe3')+_0x27e5e4[_0x9d2b('0xec')][_0x3828e5]+_0x9d2b('0xe8')+_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xed')]+',\x20'+_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xee')]+_0x9d2b('0xef')+_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xf0')]+'\x20('+_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xf1')]+')'+'';_0x48ca9c+=_0x9d2b('0xe3')+_0x27e5e4[_0x9d2b('0xf2')][_0x3828e5]+'/'+_0x27e5e4[_0x9d2b('0xf3')][_0x3828e5]+_0x9d2b('0xe8')+_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xf4')]+'/'+_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xf5')]+_0x9d2b('0xe9');_0x48ca9c+=_0x9d2b('0xe3')+_0x27e5e4[_0x9d2b('0xf6')][_0x3828e5]+'/'+_0x27e5e4[_0x9d2b('0xf7')][_0x3828e5]+_0x9d2b('0xe8')+_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xf8')]+_0x9d2b('0xe9');_0x48ca9c+=_0x9d2b('0xe3')+_0x27e5e4[_0x9d2b('0xf9')][_0x3828e5]+_0x9d2b('0xe8')+_0x21c440['creditnote']['issuerBankIBAN']+_0x9d2b('0xe9');}if(!_[_0x9d2b('0xd4')](_0x21c440['creditnote'][_0x9d2b('0xfa')])){_0x48ca9c+=_0x9d2b('0xe3')+_0x27e5e4['paypal'][_0x3828e5]+_0x9d2b('0xe8')+_0x21c440[_0x9d2b('0x56')][_0x9d2b('0xfa')]+_0x9d2b('0xe9');}_0x48ca9c+=_0x9d2b('0xe3')+_0x27e5e4[_0x9d2b('0xfb')][_0x3828e5]+''+_0x2854f0+_0x9d2b('0xfc')+_0x27e5e4[_0x9d2b('0xfd')][_0x3828e5]+'';_0x48ca9c+='';_0x48ca9c+=_0x9d2b('0xb8');_0x48ca9c+=_0x9d2b('0xfe');_0x48ca9c+='';_0x48ca9c+=_0x9d2b('0xff');return new BPromise(function(_0x20b393,_0x3a2600){pdf[_0x9d2b('0x45')](_0x48ca9c,_0x5ce81a)[_0x9d2b('0x100')](path[_0x9d2b('0x4b')](_0x1dd940,_0x4bb2c9),function(_0x335e0b,_0x3cca02){if(_0x335e0b)return _0x3a2600(_0x335e0b);_0x20b393(_0x3cca02);});});});}})[_0x9d2b('0x23')](function(){if(_0x3998b0){console['log'](_0x9d2b('0x101'),_0xb9b272,_0x4bb2c9);return _0x2e50c9[_0x9d2b('0x102')](_0xb9b272,_0x4bb2c9,function(_0x3dcfd3){if(_0x3dcfd3){console[_0x9d2b('0x58')](_0x9d2b('0x103'),_0x3dcfd3);}else{console[_0x9d2b('0x58')](_0x9d2b('0x104'),_0x1dd940);rimraf(_0x1dd940,function(){});}});}else{return _0x2e50c9[_0x9d2b('0x1a')](0xc8);}})[_0x9d2b('0x42')](handleError(_0x2e50c9,null));}; \ No newline at end of file diff --git a/server/api/saCreditNote/saCreditNote.model.js b/server/api/saCreditNote/saCreditNote.model.js index b2c9b2a..f198497 100644 --- a/server/api/saCreditNote/saCreditNote.model.js +++ b/server/api/saCreditNote/saCreditNote.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec56=['path','rimraf','../../config/environment','./saCreditNote.attributes','exports','define','SACreditNote','sa_creditNotes','models','get','format','YYYY','has','SACreditNoteNumber','transaction','then','number','update','log','TCL:\x20error','lodash','api','moment','bluebird','request-promise'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xec56,0x1bd));var _0x6ec5=function(_0x227890,_0x2c064e){_0x227890=_0x227890-0x0;var _0x14e0ba=_0xec56[_0x227890];return _0x14e0ba;};'use strict';var _=require(_0x6ec5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6ec5('0x1'));var moment=require(_0x6ec5('0x2'));var BPromise=require(_0x6ec5('0x3'));var rp=require(_0x6ec5('0x4'));var fs=require('fs');var path=require(_0x6ec5('0x5'));var rimraf=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var attributes=require(_0x6ec5('0x8'));module[_0x6ec5('0x9')]=function(_0x28b12b,_0x2d0a93){return _0x28b12b[_0x6ec5('0xa')](_0x6ec5('0xb'),attributes,{'tableName':_0x6ec5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3dd891,_0x225d2f,_0x17bcf0){var _0x1a5538=_0x28b12b[_0x6ec5('0xd')];var _0x4a23b6=_0x3dd891[_0x6ec5('0xe')]({'plain':!![]});var _0x3ef4f6=0x1;var _0x444093=parseInt(moment()[_0x6ec5('0xf')](_0x6ec5('0x10')));try{if(_[_0x6ec5('0x11')](_0x4a23b6,'id')){return _0x1a5538[_0x6ec5('0x12')]['findOne']({'where':{'year':_0x444093},'raw':!![],'logging':!![],'transaction':_0x225d2f[_0x6ec5('0x13')]})[_0x6ec5('0x14')](function(_0x2b1f61){if(_0x2b1f61){_0x3ef4f6=_0x2b1f61[_0x6ec5('0x15')]+0x1;return _0x1a5538[_0x6ec5('0x12')][_0x6ec5('0x16')]({'number':_0x3ef4f6},{'where':{'id':_0x2b1f61['id']},'transaction':_0x225d2f[_0x6ec5('0x13')],'logging':!![]});}return _0x1a5538[_0x6ec5('0x12')]['create']({'year':_0x444093,'number':_0x3ef4f6},{'logging':!![],'transaction':_0x225d2f[_0x6ec5('0x13')]});})['then'](function(){_0x4a23b6[_0x6ec5('0x15')]=_0x3ef4f6;})[_0x6ec5('0x14')](function(){_0x17bcf0();});}}catch(_0x4a4e3c){console[_0x6ec5('0x17')](_0x6ec5('0x18'),_0x4a4e3c);_0x17bcf0();}}}});}; \ No newline at end of file +var _0x99e9=['SACreditNote','models','get','format','YYYY','has','SACreditNoteNumber','findOne','transaction','then','create','TCL:\x20error','util','../../config/logger','api','moment','request-promise','path','rimraf','./saCreditNote.attributes','define'];(function(_0x2ebbff,_0x541581){var _0x1ed41d=function(_0xa231e0){while(--_0xa231e0){_0x2ebbff['push'](_0x2ebbff['shift']());}};_0x1ed41d(++_0x541581);}(_0x99e9,0xb4));var _0x999e=function(_0x39c12e,_0x585534){_0x39c12e=_0x39c12e-0x0;var _0x58dbf4=_0x99e9[_0x39c12e];return _0x58dbf4;};'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'));module['exports']=function(_0x25421f,_0x1bda0a){return _0x25421f[_0x999e('0x8')](_0x999e('0x9'),attributes,{'tableName':'sa_creditNotes','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x46aeae,_0x38a692,_0x343a12){var _0x46f780=_0x25421f[_0x999e('0xa')];var _0x175042=_0x46aeae[_0x999e('0xb')]({'plain':!![]});var _0x180846=0x1;var _0x3cb1c2=parseInt(moment()[_0x999e('0xc')](_0x999e('0xd')));try{if(_[_0x999e('0xe')](_0x175042,'id')){return _0x46f780[_0x999e('0xf')][_0x999e('0x10')]({'where':{'year':_0x3cb1c2},'raw':!![],'logging':!![],'transaction':_0x38a692[_0x999e('0x11')]})[_0x999e('0x12')](function(_0x26b55a){if(_0x26b55a){_0x180846=_0x26b55a['number']+0x1;return _0x46f780[_0x999e('0xf')]['update']({'number':_0x180846},{'where':{'id':_0x26b55a['id']},'transaction':_0x38a692[_0x999e('0x11')],'logging':!![]});}return _0x46f780[_0x999e('0xf')][_0x999e('0x13')]({'year':_0x3cb1c2,'number':_0x180846},{'logging':!![],'transaction':_0x38a692['transaction']});})[_0x999e('0x12')](function(){_0x175042['number']=_0x180846;})[_0x999e('0x12')](function(){_0x343a12();});}}catch(_0x539598){console['log'](_0x999e('0x14'),_0x539598);_0x343a12();}}}});}; \ No newline at end of file diff --git a/server/api/saCreditNote/saCreditNote.rpc.js b/server/api/saCreditNote/saCreditNote.rpc.js index c608dac..791adc5 100644 --- a/server/api/saCreditNote/saCreditNote.rpc.js +++ b/server/api/saCreditNote/saCreditNote.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc1dc=['then','SACreditNote,\x20%s,\x20%s','request\x20sent','debug','SACreditNote,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2c23cc,_0x4b543c){var _0x449a33=function(_0x2f80fd){while(--_0x2f80fd){_0x2c23cc['push'](_0x2c23cc['shift']());}};_0x449a33(++_0x4b543c);}(_0xc1dc,0x84));var _0xcc1d=function(_0x5a3bb5,_0x1e3d5b){_0x5a3bb5=_0x5a3bb5-0x0;var _0x4bf5e9=_0xc1dc[_0x5a3bb5];return _0x4bf5e9;};'use strict';var _=require(_0xcc1d('0x0'));var util=require(_0xcc1d('0x1'));var moment=require(_0xcc1d('0x2'));var BPromise=require('bluebird');var rs=require(_0xcc1d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc1d('0x4'))['db'];var utils=require(_0xcc1d('0x5'));var logger=require('../../config/logger')(_0xcc1d('0x6'));var config=require(_0xcc1d('0x7'));var jayson=require(_0xcc1d('0x8'));var client=jayson[_0xcc1d('0x9')][_0xcc1d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x597eb8,_0x4dc8ee,_0x23e085){return new BPromise(function(_0x24d561,_0x6e9800){return client[_0xcc1d('0xb')](_0x597eb8,_0x23e085)[_0xcc1d('0xc')](function(_0x171592){logger['info'](_0xcc1d('0xd'),_0x4dc8ee,_0xcc1d('0xe'));logger[_0xcc1d('0xf')](_0xcc1d('0x10'),_0x4dc8ee,_0xcc1d('0xe'),JSON[_0xcc1d('0x11')](_0x171592));if(_0x171592['error']){if(_0x171592[_0xcc1d('0x12')][_0xcc1d('0x13')]===0x1f4){logger['error'](_0xcc1d('0xd'),_0x4dc8ee,_0x171592[_0xcc1d('0x12')][_0xcc1d('0x14')]);return _0x6e9800(_0x171592[_0xcc1d('0x12')][_0xcc1d('0x14')]);}logger[_0xcc1d('0x12')](_0xcc1d('0xd'),_0x4dc8ee,_0x171592['error']['message']);return _0x24d561(_0x171592[_0xcc1d('0x12')]['message']);}else{logger[_0xcc1d('0x15')](_0xcc1d('0xd'),_0x4dc8ee,_0xcc1d('0xe'));_0x24d561(_0x171592[_0xcc1d('0x16')][_0xcc1d('0x14')]);}})[_0xcc1d('0x17')](function(_0x1f9737){logger[_0xcc1d('0x12')](_0xcc1d('0xd'),_0x4dc8ee,_0x1f9737);_0x6e9800(_0x1f9737);});});} \ No newline at end of file +var _0x0eeb=['client','http','request','then','info','SACreditNote,\x20%s,\x20%s','SACreditNote,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xdfb7e4,_0x38cb7c){var _0x31efe5=function(_0x7c0f58){while(--_0x7c0f58){_0xdfb7e4['push'](_0xdfb7e4['shift']());}};_0x31efe5(++_0x38cb7c);}(_0x0eeb,0xc5));var _0xb0ee=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0eeb[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xb0ee('0x0'));var util=require(_0xb0ee('0x1'));var moment=require(_0xb0ee('0x2'));var BPromise=require(_0xb0ee('0x3'));var rs=require(_0xb0ee('0x4'));var fs=require('fs');var Redis=require(_0xb0ee('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb0ee('0x6'))(_0xb0ee('0x7'));var config=require(_0xb0ee('0x8'));var jayson=require(_0xb0ee('0x9'));var client=jayson[_0xb0ee('0xa')][_0xb0ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17f445,_0x5377b4,_0x207a85){return new BPromise(function(_0x586bc9,_0x13c198){return client[_0xb0ee('0xc')](_0x17f445,_0x207a85)[_0xb0ee('0xd')](function(_0x308603){logger[_0xb0ee('0xe')](_0xb0ee('0xf'),_0x5377b4,'request\x20sent');logger['debug'](_0xb0ee('0x10'),_0x5377b4,_0xb0ee('0x11'),JSON['stringify'](_0x308603));if(_0x308603['error']){if(_0x308603[_0xb0ee('0x12')][_0xb0ee('0x13')]===0x1f4){logger[_0xb0ee('0x12')](_0xb0ee('0xf'),_0x5377b4,_0x308603['error'][_0xb0ee('0x14')]);return _0x13c198(_0x308603['error']['message']);}logger['error'](_0xb0ee('0xf'),_0x5377b4,_0x308603[_0xb0ee('0x12')]['message']);return _0x586bc9(_0x308603[_0xb0ee('0x12')][_0xb0ee('0x14')]);}else{logger[_0xb0ee('0xe')](_0xb0ee('0xf'),_0x5377b4,_0xb0ee('0x11'));_0x586bc9(_0x308603[_0xb0ee('0x15')][_0xb0ee('0x14')]);}})[_0xb0ee('0x16')](function(_0x549e64){logger['error'](_0xb0ee('0xf'),_0x5377b4,_0x549e64);_0x13c198(_0x549e64);});});} \ No newline at end of file diff --git a/server/api/saCreditNoteDetail/index.js b/server/api/saCreditNoteDetail/index.js index 6790cf4..9c99d2c 100644 --- a/server/api/saCreditNoteDetail/index.js +++ b/server/api/saCreditNoteDetail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3a2=['describe','show','post','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x3c0dcc,_0x18c419){var _0x1a224c=function(_0x238ae7){while(--_0x238ae7){_0x3c0dcc['push'](_0x3c0dcc['shift']());}};_0x1a224c(++_0x18c419);}(_0xc3a2,0x86));var _0x2c3a=function(_0x5c1b6b,_0x406c18){_0x5c1b6b=_0x5c1b6b-0x0;var _0x4c0009=_0xc3a2[_0x5c1b6b];return _0x4c0009;};'use strict';var multer=require(_0x2c3a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2c3a('0x1'));var express=require(_0x2c3a('0x2'));var router=express[_0x2c3a('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x2c3a('0x4'));var config=require(_0x2c3a('0x5'));var controller=require('./saCreditNoteDetail.controller');router[_0x2c3a('0x6')]('/',auth[_0x2c3a('0x7')](),controller[_0x2c3a('0x8')]);router[_0x2c3a('0x6')](_0x2c3a('0x9'),auth[_0x2c3a('0x7')](),controller[_0x2c3a('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2c3a('0xb')]);router[_0x2c3a('0xc')]('/',auth[_0x2c3a('0x7')](),controller['create']);router['put'](_0x2c3a('0xd'),auth[_0x2c3a('0x7')](),controller[_0x2c3a('0xe')]);router[_0x2c3a('0xf')](_0x2c3a('0xd'),auth['isAuthenticated'](),controller[_0x2c3a('0x10')]);module[_0x2c3a('0x11')]=router; \ No newline at end of file +var _0x8970=['../../components/interaction/service','../../config/environment','./saCreditNoteDetail.controller','get','index','/describe','describe','isAuthenticated','create','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x420b72,_0x57755){var _0x170cdd=function(_0x5f4370){while(--_0x5f4370){_0x420b72['push'](_0x420b72['shift']());}};_0x170cdd(++_0x57755);}(_0x8970,0x11b));var _0x0897=function(_0x34ef5c,_0xc66298){_0x34ef5c=_0x34ef5c-0x0;var _0x36734c=_0x8970[_0x34ef5c];return _0x36734c;};'use strict';var multer=require(_0x0897('0x0'));var util=require(_0x0897('0x1'));var path=require('path');var timeout=require(_0x0897('0x2'));var express=require(_0x0897('0x3'));var router=express[_0x0897('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0897('0x5'));var config=require(_0x0897('0x6'));var controller=require(_0x0897('0x7'));router[_0x0897('0x8')]('/',auth['isAuthenticated'](),controller[_0x0897('0x9')]);router[_0x0897('0x8')](_0x0897('0xa'),auth['isAuthenticated'](),controller[_0x0897('0xb')]);router[_0x0897('0x8')]('/:id',auth[_0x0897('0xc')](),controller['show']);router['post']('/',auth[_0x0897('0xc')](),controller[_0x0897('0xd')]);router['put'](_0x0897('0xe'),auth[_0x0897('0xc')](),controller['update']);router[_0x0897('0xf')]('/:id',auth[_0x0897('0xc')](),controller[_0x0897('0x10')]);module[_0x0897('0x11')]=router; \ No newline at end of file diff --git a/server/api/saCreditNoteDetail/saCreditNoteDetail.attributes.js b/server/api/saCreditNoteDetail/saCreditNoteDetail.attributes.js index cf6d0ba..df0c4d8 100644 --- a/server/api/saCreditNoteDetail/saCreditNoteDetail.attributes.js +++ b/server/api/saCreditNoteDetail/saCreditNoteDetail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf021=['sequelize','exports','STRING','INTEGER','TEXT','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','DECIMAL'];(function(_0x452af7,_0x993b24){var _0x16a885=function(_0x4539bf){while(--_0x4539bf){_0x452af7['push'](_0x452af7['shift']());}};_0x16a885(++_0x993b24);}(_0xf021,0x18f));var _0x1f02=function(_0x5e9876,_0x16052d){_0x5e9876=_0x5e9876-0x0;var _0x576c48=_0xf021[_0x5e9876];return _0x576c48;};'use strict';var Sequelize=require(_0x1f02('0x0'));module[_0x1f02('0x1')]={'companyName':{'type':Sequelize[_0x1f02('0x2')],'allowNull':![]},'companyId':{'type':Sequelize[_0x1f02('0x3')],'allowNull':![]},'productName':{'type':Sequelize[_0x1f02('0x4')],'allowNull':![]},'productCode':{'type':Sequelize['STRING'],'allowNull':![]},'productDescription':{'type':Sequelize[_0x1f02('0x4')]('long')+_0x1f02('0x5')},'typeName':{'type':Sequelize[_0x1f02('0x2')],'allowNull':![]},'unitName':{'type':Sequelize['STRING']},'pricelistName':{'type':Sequelize['TEXT'],'allowNull':![]},'priceListId':{'type':Sequelize[_0x1f02('0x3')],'allowNull':![]},'netPrice':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize[_0x1f02('0x6')](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize[_0x1f02('0x6')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x1f02('0x2')],'allowNull':![]},'note':{'type':Sequelize[_0x1f02('0x4')]},'subscriptionId':{'type':Sequelize[_0x1f02('0x3')],'allowNull':![]},'subscriptionName':{'type':Sequelize['STRING'],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0x1f02('0x3')],'allowNull':![]},'quantity':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]}}; \ No newline at end of file +var _0x153f=['INTEGER','TEXT','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','DECIMAL','sequelize','exports','STRING'];(function(_0x4040b1,_0x1d76a5){var _0x4bcf2e=function(_0x55d0bc){while(--_0x55d0bc){_0x4040b1['push'](_0x4040b1['shift']());}};_0x4bcf2e(++_0x1d76a5);}(_0x153f,0x15b));var _0xf153=function(_0x2aad55,_0x4b13d2){_0x2aad55=_0x2aad55-0x0;var _0x5e30ae=_0x153f[_0x2aad55];return _0x5e30ae;};'use strict';var Sequelize=require(_0xf153('0x0'));module[_0xf153('0x1')]={'companyName':{'type':Sequelize[_0xf153('0x2')],'allowNull':![]},'companyId':{'type':Sequelize[_0xf153('0x3')],'allowNull':![]},'productName':{'type':Sequelize[_0xf153('0x4')],'allowNull':![]},'productCode':{'type':Sequelize[_0xf153('0x2')],'allowNull':![]},'productDescription':{'type':Sequelize[_0xf153('0x4')]('long')+_0xf153('0x5')},'typeName':{'type':Sequelize['STRING'],'allowNull':![]},'unitName':{'type':Sequelize[_0xf153('0x2')]},'pricelistName':{'type':Sequelize[_0xf153('0x4')],'allowNull':![]},'priceListId':{'type':Sequelize[_0xf153('0x3')],'allowNull':![]},'netPrice':{'type':Sequelize[_0xf153('0x6')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize[_0xf153('0x6')](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0xf153('0x2')],'allowNull':![]},'note':{'type':Sequelize[_0xf153('0x4')]},'subscriptionId':{'type':Sequelize[_0xf153('0x3')],'allowNull':![]},'subscriptionName':{'type':Sequelize[_0xf153('0x2')],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0xf153('0x3')],'allowNull':![]},'quantity':{'type':Sequelize[_0xf153('0x6')](0xd,0x4),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/saCreditNoteDetail/saCreditNoteDetail.controller.js b/server/api/saCreditNoteDetail/saCreditNoteDetail.controller.js index cdff447..5f06be2 100644 --- a/server/api/saCreditNoteDetail/saCreditNoteDetail.controller.js +++ b/server/api/saCreditNoteDetail/saCreditNoteDetail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7d0=['type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','update','params','destroy','describe','rimraf','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','SACreditNoteDetail','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map'];(function(_0x6b8377,_0x48fb12){var _0x55c210=function(_0x3dd6e2){while(--_0x3dd6e2){_0x6b8377['push'](_0x6b8377['shift']());}};_0x55c210(++_0x48fb12);}(_0xb7d0,0xf1));var _0x0b7d=function(_0x2f2a0d,_0x5d1976){_0x2f2a0d=_0x2f2a0d-0x0;var _0x823f5e=_0xb7d0[_0x2f2a0d];return _0x823f5e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x0b7d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0b7d('0x1'));var Mustache=require(_0x0b7d('0x2'));var util=require(_0x0b7d('0x3'));var path=require('path');var sox=require(_0x0b7d('0x4'));var csv=require(_0x0b7d('0x5'));var ejs=require(_0x0b7d('0x6'));var fs=require('fs');var _=require(_0x0b7d('0x7'));var squel=require(_0x0b7d('0x8'));var crypto=require(_0x0b7d('0x9'));var jsforce=require(_0x0b7d('0xa'));var deskjs=require(_0x0b7d('0xb'));var toCsv=require(_0x0b7d('0x5'));var querystring=require(_0x0b7d('0xc'));var Papa=require(_0x0b7d('0xd'));var Redis=require('ioredis');var authService=require(_0x0b7d('0xe'));var qs=require(_0x0b7d('0xf'));var hardwareService=require(_0x0b7d('0x10'));var logger=require(_0x0b7d('0x11'))(_0x0b7d('0x12'));var utils=require(_0x0b7d('0x13'));var config=require(_0x0b7d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40d444,_0xdecbf7){_0xdecbf7=_0xdecbf7||0xcc;return function(_0x392de8){if(_0x392de8){return _0x40d444[_0x0b7d('0x15')](_0xdecbf7);}return _0x40d444['status'](_0xdecbf7)[_0x0b7d('0x16')]();};}function respondWithResult(_0x3e946c,_0x4b7be1){_0x4b7be1=_0x4b7be1||0xc8;return function(_0x11caa7){if(_0x11caa7){return _0x3e946c[_0x0b7d('0x17')](_0x4b7be1)['json'](_0x11caa7);}};}function respondWithFilteredResult(_0x31c7fb,_0x5b4247){return function(_0x3b6a94){if(_0x3b6a94){var _0x1e8903=_0x3b6a94[_0x0b7d('0x18')],_0x438ca1=_0x5b4247[_0x0b7d('0x19')],_0x1f0d31=_0x5b4247[_0x0b7d('0x19')]+_0x5b4247[_0x0b7d('0x1a')],_0x2588a5;if(_0x1f0d31>=_0x1e8903){_0x1f0d31=_0x1e8903;_0x2588a5=0xc8;}else{_0x2588a5=0xce;}_0x31c7fb[_0x0b7d('0x17')](_0x2588a5);return _0x31c7fb[_0x0b7d('0x1b')](_0x0b7d('0x1c'),_0x438ca1+'-'+_0x1f0d31+'/'+_0x1e8903)[_0x0b7d('0x1d')](_0x3b6a94);}return null;};}function patchUpdates(_0x2d341e){return function(_0xea837d){try{jsonpatch[_0x0b7d('0x1e')](_0xea837d,_0x2d341e,!![]);}catch(_0xe14803){return BPromise[_0x0b7d('0x1f')](_0xe14803);}return _0xea837d[_0x0b7d('0x20')]();};}function saveUpdates(_0x2a6a45,_0x58be44){return function(_0x3a91a9){if(_0x3a91a9){return _0x3a91a9['update'](_0x2a6a45)['then'](function(_0x5d82be){return _0x5d82be;});}return null;};}function removeEntity(_0x551e70,_0x4bf692){return function(_0x4e2c96){if(_0x4e2c96){return _0x4e2c96['destroy']()[_0x0b7d('0x21')](function(){_0x551e70[_0x0b7d('0x17')](0xcc)[_0x0b7d('0x16')]();});}};}function handleEntityNotFound(_0x299886,_0x4cb49a){return function(_0x588604){if(!_0x588604){_0x299886[_0x0b7d('0x15')](0x194);}return _0x588604;};}function handleError(_0x2e6db4,_0x6439ae){_0x6439ae=_0x6439ae||0x1f4;return function(_0x499148){logger[_0x0b7d('0x22')](_0x499148[_0x0b7d('0x23')]);if(_0x499148['name']){delete _0x499148[_0x0b7d('0x24')];}_0x2e6db4[_0x0b7d('0x17')](_0x6439ae)[_0x0b7d('0x25')](_0x499148);};}exports['index']=function(_0x14cffd,_0x5699e8){var _0x97eba5={},_0x42284d={},_0x282cab={'count':0x0,'rows':[]};var _0x2a8fba=db[_0x0b7d('0x26')]['rawAttributes'];_0x42284d[_0x0b7d('0x27')]=_['keys'](_0x2a8fba);_0x42284d[_0x0b7d('0x28')]=_[_0x0b7d('0x29')](_0x14cffd['query']);_0x42284d['filters']=_[_0x0b7d('0x2a')](_0x42284d['model'],_0x42284d[_0x0b7d('0x28')]);_0x97eba5[_0x0b7d('0x2b')]=_[_0x0b7d('0x2a')](_0x42284d[_0x0b7d('0x27')],qs[_0x0b7d('0x2c')](_0x14cffd[_0x0b7d('0x28')][_0x0b7d('0x2c')]));_0x97eba5[_0x0b7d('0x2b')]=_0x97eba5[_0x0b7d('0x2b')][_0x0b7d('0x2d')]?_0x97eba5[_0x0b7d('0x2b')]:_0x42284d['model'];if(!_0x14cffd['query'][_0x0b7d('0x2e')](_0x0b7d('0x2f'))){_0x97eba5[_0x0b7d('0x1a')]=qs[_0x0b7d('0x1a')](_0x14cffd[_0x0b7d('0x28')][_0x0b7d('0x1a')]);_0x97eba5[_0x0b7d('0x19')]=qs['offset'](_0x14cffd[_0x0b7d('0x28')]['offset']);}_0x97eba5['order']=qs['sort'](_0x14cffd[_0x0b7d('0x28')][_0x0b7d('0x30')]);_0x97eba5[_0x0b7d('0x31')]=qs[_0x0b7d('0x32')](_[_0x0b7d('0x33')](_0x14cffd[_0x0b7d('0x28')],_0x42284d[_0x0b7d('0x32')]));if(_0x14cffd[_0x0b7d('0x28')][_0x0b7d('0x34')]){_0x97eba5[_0x0b7d('0x31')]=_[_0x0b7d('0x35')](_0x97eba5['where'],{'$or':_[_0x0b7d('0x36')](_0x2a8fba,function(_0x19658c){if(_0x19658c[_0x0b7d('0x37')][_0x0b7d('0x38')]!==_0x0b7d('0x39')){var _0x3a3c76={};_0x3a3c76[_0x19658c[_0x0b7d('0x3a')]]={'$like':'%'+_0x14cffd[_0x0b7d('0x28')][_0x0b7d('0x34')]+'%'};return _0x3a3c76;}})});}_0x97eba5=_[_0x0b7d('0x35')]({},_0x97eba5,_0x14cffd[_0x0b7d('0x3b')]);var _0x389d4e={'where':_0x97eba5[_0x0b7d('0x31')]};return db[_0x0b7d('0x26')][_0x0b7d('0x18')](_0x389d4e)[_0x0b7d('0x21')](function(_0xe031e9){_0x282cab[_0x0b7d('0x18')]=_0xe031e9;if(_0x14cffd['query'][_0x0b7d('0x3c')]){_0x97eba5[_0x0b7d('0x3d')]=[{'all':!![]}];}return db['SACreditNoteDetail'][_0x0b7d('0x3e')](_0x97eba5);})[_0x0b7d('0x21')](function(_0x542663){_0x282cab[_0x0b7d('0x3f')]=_0x542663;return _0x282cab;})['then'](respondWithFilteredResult(_0x5699e8,_0x97eba5))[_0x0b7d('0x40')](handleError(_0x5699e8,null));};exports[_0x0b7d('0x41')]=function(_0x4fb7b4,_0x2f5918){var _0x24d625={'raw':![],'where':{'id':_0x4fb7b4['params']['id']}},_0x58e953={};_0x58e953[_0x0b7d('0x27')]=_[_0x0b7d('0x29')](db[_0x0b7d('0x26')][_0x0b7d('0x42')]);_0x58e953[_0x0b7d('0x28')]=_[_0x0b7d('0x29')](_0x4fb7b4[_0x0b7d('0x28')]);_0x58e953[_0x0b7d('0x32')]=_[_0x0b7d('0x2a')](_0x58e953['model'],_0x58e953['query']);_0x24d625['attributes']=_[_0x0b7d('0x2a')](_0x58e953[_0x0b7d('0x27')],qs[_0x0b7d('0x2c')](_0x4fb7b4[_0x0b7d('0x28')]['fields']));_0x24d625[_0x0b7d('0x2b')]=_0x24d625[_0x0b7d('0x2b')][_0x0b7d('0x2d')]?_0x24d625[_0x0b7d('0x2b')]:_0x58e953[_0x0b7d('0x27')];if(_0x4fb7b4[_0x0b7d('0x28')][_0x0b7d('0x3c')]){_0x24d625['include']=[{'all':!![]}];}_0x24d625=_[_0x0b7d('0x35')]({},_0x24d625,_0x4fb7b4['options']);return db[_0x0b7d('0x26')][_0x0b7d('0x43')](_0x24d625)[_0x0b7d('0x21')](handleEntityNotFound(_0x2f5918,null))[_0x0b7d('0x21')](respondWithResult(_0x2f5918,null))[_0x0b7d('0x40')](handleError(_0x2f5918,null));};exports[_0x0b7d('0x44')]=function(_0x2a7567,_0x15e8ef){return db[_0x0b7d('0x26')][_0x0b7d('0x44')](_0x2a7567[_0x0b7d('0x45')],{})[_0x0b7d('0x21')](respondWithResult(_0x15e8ef,0xc9))['catch'](handleError(_0x15e8ef,null));};exports[_0x0b7d('0x46')]=function(_0x512dad,_0x28fb96){if(_0x512dad[_0x0b7d('0x45')]['id']){delete _0x512dad[_0x0b7d('0x45')]['id'];}return db['SACreditNoteDetail']['find']({'where':{'id':_0x512dad[_0x0b7d('0x47')]['id']}})[_0x0b7d('0x21')](handleEntityNotFound(_0x28fb96,null))[_0x0b7d('0x21')](saveUpdates(_0x512dad['body'],null))[_0x0b7d('0x21')](respondWithResult(_0x28fb96,null))[_0x0b7d('0x40')](handleError(_0x28fb96,null));};exports[_0x0b7d('0x48')]=function(_0x117d0b,_0x13fe0f){return db[_0x0b7d('0x26')][_0x0b7d('0x43')]({'where':{'id':_0x117d0b[_0x0b7d('0x47')]['id']}})[_0x0b7d('0x21')](handleEntityNotFound(_0x13fe0f,null))['then'](removeEntity(_0x13fe0f,null))[_0x0b7d('0x40')](handleError(_0x13fe0f,null));};exports[_0x0b7d('0x49')]=function(_0x35ecc3,_0x1fd03e){return db[_0x0b7d('0x26')][_0x0b7d('0x49')]()[_0x0b7d('0x21')](respondWithResult(_0x1fd03e,null))[_0x0b7d('0x40')](handleError(_0x1fd03e,null));}; \ No newline at end of file +var _0x3c62=['squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','SACreditNoteDetail','rawAttributes','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','describe','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x187d44,_0x4b9400){var _0x523bf2=function(_0x2d772c){while(--_0x2d772c){_0x187d44['push'](_0x187d44['shift']());}};_0x523bf2(++_0x4b9400);}(_0x3c62,0x119));var _0x23c6=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x3c62[_0x311c35];return _0x5cc50c;};'use strict';var pdf=require(_0x23c6('0x0'));var emlformat=require(_0x23c6('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x23c6('0x2'));var moment=require(_0x23c6('0x3'));var BPromise=require(_0x23c6('0x4'));var Mustache=require(_0x23c6('0x5'));var util=require(_0x23c6('0x6'));var path=require(_0x23c6('0x7'));var sox=require(_0x23c6('0x8'));var csv=require(_0x23c6('0x9'));var ejs=require(_0x23c6('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x23c6('0xb'));var crypto=require(_0x23c6('0xc'));var jsforce=require(_0x23c6('0xd'));var deskjs=require(_0x23c6('0xe'));var toCsv=require(_0x23c6('0x9'));var querystring=require(_0x23c6('0xf'));var Papa=require(_0x23c6('0x10'));var Redis=require('ioredis');var authService=require(_0x23c6('0x11'));var qs=require(_0x23c6('0x12'));var hardwareService=require(_0x23c6('0x13'));var logger=require(_0x23c6('0x14'))(_0x23c6('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x23c6('0x16'))['db'];function respondWithStatusCode(_0x15dc47,_0x393175){_0x393175=_0x393175||0xcc;return function(_0x4baa9c){if(_0x4baa9c){return _0x15dc47[_0x23c6('0x17')](_0x393175);}return _0x15dc47['status'](_0x393175)['end']();};}function respondWithResult(_0x24e701,_0x4ba1ac){_0x4ba1ac=_0x4ba1ac||0xc8;return function(_0x10d0af){if(_0x10d0af){return _0x24e701[_0x23c6('0x18')](_0x4ba1ac)[_0x23c6('0x19')](_0x10d0af);}};}function respondWithFilteredResult(_0x3d0856,_0x1a95a8){return function(_0x49cfdf){if(_0x49cfdf){var _0x3a67f4=_0x49cfdf[_0x23c6('0x1a')],_0x206aa9=_0x1a95a8[_0x23c6('0x1b')],_0x3fc642=_0x1a95a8[_0x23c6('0x1b')]+_0x1a95a8[_0x23c6('0x1c')],_0x559314;if(_0x3fc642>=_0x3a67f4){_0x3fc642=_0x3a67f4;_0x559314=0xc8;}else{_0x559314=0xce;}_0x3d0856[_0x23c6('0x18')](_0x559314);return _0x3d0856[_0x23c6('0x1d')](_0x23c6('0x1e'),_0x206aa9+'-'+_0x3fc642+'/'+_0x3a67f4)[_0x23c6('0x19')](_0x49cfdf);}return null;};}function patchUpdates(_0x5191ad){return function(_0x62fa9d){try{jsonpatch[_0x23c6('0x1f')](_0x62fa9d,_0x5191ad,!![]);}catch(_0x32289f){return BPromise['reject'](_0x32289f);}return _0x62fa9d[_0x23c6('0x20')]();};}function saveUpdates(_0x1cecbc,_0x66579a){return function(_0x2547dc){if(_0x2547dc){return _0x2547dc[_0x23c6('0x21')](_0x1cecbc)[_0x23c6('0x22')](function(_0x4eec3d){return _0x4eec3d;});}return null;};}function removeEntity(_0x4a117a,_0x47ba8a){return function(_0x109b0b){if(_0x109b0b){return _0x109b0b[_0x23c6('0x23')]()['then'](function(){_0x4a117a[_0x23c6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56cff5,_0x7e2a96){return function(_0x4058ef){if(!_0x4058ef){_0x56cff5['sendStatus'](0x194);}return _0x4058ef;};}function handleError(_0x509a21,_0x25cefd){_0x25cefd=_0x25cefd||0x1f4;return function(_0x13c37c){logger[_0x23c6('0x24')](_0x13c37c[_0x23c6('0x25')]);if(_0x13c37c[_0x23c6('0x26')]){delete _0x13c37c[_0x23c6('0x26')];}_0x509a21[_0x23c6('0x18')](_0x25cefd)[_0x23c6('0x27')](_0x13c37c);};}exports['index']=function(_0x4b0f67,_0x104f76){var _0x378c87={},_0x5a17e7={},_0x442df1={'count':0x0,'rows':[]};var _0x124e5d=db[_0x23c6('0x28')][_0x23c6('0x29')];_0x5a17e7[_0x23c6('0x2a')]=_['keys'](_0x124e5d);_0x5a17e7[_0x23c6('0x2b')]=_['keys'](_0x4b0f67[_0x23c6('0x2b')]);_0x5a17e7[_0x23c6('0x2c')]=_['intersection'](_0x5a17e7[_0x23c6('0x2a')],_0x5a17e7['query']);_0x378c87['attributes']=_[_0x23c6('0x2d')](_0x5a17e7[_0x23c6('0x2a')],qs[_0x23c6('0x2e')](_0x4b0f67[_0x23c6('0x2b')][_0x23c6('0x2e')]));_0x378c87[_0x23c6('0x2f')]=_0x378c87[_0x23c6('0x2f')][_0x23c6('0x30')]?_0x378c87[_0x23c6('0x2f')]:_0x5a17e7[_0x23c6('0x2a')];if(!_0x4b0f67[_0x23c6('0x2b')]['hasOwnProperty'](_0x23c6('0x31'))){_0x378c87['limit']=qs['limit'](_0x4b0f67[_0x23c6('0x2b')][_0x23c6('0x1c')]);_0x378c87[_0x23c6('0x1b')]=qs[_0x23c6('0x1b')](_0x4b0f67[_0x23c6('0x2b')][_0x23c6('0x1b')]);}_0x378c87[_0x23c6('0x32')]=qs[_0x23c6('0x33')](_0x4b0f67[_0x23c6('0x2b')]['sort']);_0x378c87[_0x23c6('0x34')]=qs['filters'](_[_0x23c6('0x35')](_0x4b0f67[_0x23c6('0x2b')],_0x5a17e7[_0x23c6('0x2c')]));if(_0x4b0f67[_0x23c6('0x2b')][_0x23c6('0x36')]){_0x378c87[_0x23c6('0x34')]=_[_0x23c6('0x37')](_0x378c87[_0x23c6('0x34')],{'$or':_[_0x23c6('0x38')](_0x124e5d,function(_0x3c5e9f){if(_0x3c5e9f[_0x23c6('0x39')][_0x23c6('0x3a')]!==_0x23c6('0x3b')){var _0x6b12cd={};_0x6b12cd[_0x3c5e9f['field']]={'$like':'%'+_0x4b0f67[_0x23c6('0x2b')]['filter']+'%'};return _0x6b12cd;}})});}_0x378c87=_['merge']({},_0x378c87,_0x4b0f67[_0x23c6('0x3c')]);var _0x4f4b4c={'where':_0x378c87[_0x23c6('0x34')]};return db[_0x23c6('0x28')]['count'](_0x4f4b4c)[_0x23c6('0x22')](function(_0x2fb32a){_0x442df1['count']=_0x2fb32a;if(_0x4b0f67[_0x23c6('0x2b')]['includeAll']){_0x378c87[_0x23c6('0x3d')]=[{'all':!![]}];}return db[_0x23c6('0x28')][_0x23c6('0x3e')](_0x378c87);})[_0x23c6('0x22')](function(_0x23d4d2){_0x442df1[_0x23c6('0x3f')]=_0x23d4d2;return _0x442df1;})[_0x23c6('0x22')](respondWithFilteredResult(_0x104f76,_0x378c87))[_0x23c6('0x40')](handleError(_0x104f76,null));};exports[_0x23c6('0x41')]=function(_0x530893,_0x3810c1){var _0x5ae022={'raw':![],'where':{'id':_0x530893[_0x23c6('0x42')]['id']}},_0x27c494={};_0x27c494[_0x23c6('0x2a')]=_[_0x23c6('0x43')](db[_0x23c6('0x28')][_0x23c6('0x29')]);_0x27c494['query']=_[_0x23c6('0x43')](_0x530893[_0x23c6('0x2b')]);_0x27c494[_0x23c6('0x2c')]=_['intersection'](_0x27c494[_0x23c6('0x2a')],_0x27c494[_0x23c6('0x2b')]);_0x5ae022[_0x23c6('0x2f')]=_[_0x23c6('0x2d')](_0x27c494[_0x23c6('0x2a')],qs[_0x23c6('0x2e')](_0x530893[_0x23c6('0x2b')]['fields']));_0x5ae022[_0x23c6('0x2f')]=_0x5ae022['attributes'][_0x23c6('0x30')]?_0x5ae022['attributes']:_0x27c494['model'];if(_0x530893[_0x23c6('0x2b')][_0x23c6('0x44')]){_0x5ae022[_0x23c6('0x3d')]=[{'all':!![]}];}_0x5ae022=_[_0x23c6('0x37')]({},_0x5ae022,_0x530893['options']);return db['SACreditNoteDetail'][_0x23c6('0x45')](_0x5ae022)[_0x23c6('0x22')](handleEntityNotFound(_0x3810c1,null))[_0x23c6('0x22')](respondWithResult(_0x3810c1,null))[_0x23c6('0x40')](handleError(_0x3810c1,null));};exports[_0x23c6('0x46')]=function(_0x5e875e,_0x556874){return db[_0x23c6('0x28')][_0x23c6('0x46')](_0x5e875e[_0x23c6('0x47')],{})[_0x23c6('0x22')](respondWithResult(_0x556874,0xc9))[_0x23c6('0x40')](handleError(_0x556874,null));};exports[_0x23c6('0x21')]=function(_0x1fd1ce,_0x59d9de){if(_0x1fd1ce[_0x23c6('0x47')]['id']){delete _0x1fd1ce['body']['id'];}return db[_0x23c6('0x28')][_0x23c6('0x45')]({'where':{'id':_0x1fd1ce[_0x23c6('0x42')]['id']}})[_0x23c6('0x22')](handleEntityNotFound(_0x59d9de,null))[_0x23c6('0x22')](saveUpdates(_0x1fd1ce[_0x23c6('0x47')],null))[_0x23c6('0x22')](respondWithResult(_0x59d9de,null))[_0x23c6('0x40')](handleError(_0x59d9de,null));};exports[_0x23c6('0x23')]=function(_0x1c631f,_0x25801b){return db[_0x23c6('0x28')][_0x23c6('0x45')]({'where':{'id':_0x1c631f[_0x23c6('0x42')]['id']}})[_0x23c6('0x22')](handleEntityNotFound(_0x25801b,null))[_0x23c6('0x22')](removeEntity(_0x25801b,null))[_0x23c6('0x40')](handleError(_0x25801b,null));};exports[_0x23c6('0x48')]=function(_0x9189fc,_0x19645e){return db[_0x23c6('0x28')]['describe']()['then'](respondWithResult(_0x19645e,null))[_0x23c6('0x40')](handleError(_0x19645e,null));}; \ No newline at end of file diff --git a/server/api/saCreditNoteDetail/saCreditNoteDetail.model.js b/server/api/saCreditNoteDetail/saCreditNoteDetail.model.js index 78612aa..87d85c7 100644 --- a/server/api/saCreditNoteDetail/saCreditNoteDetail.model.js +++ b/server/api/saCreditNoteDetail/saCreditNoteDetail.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf395=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./saCreditNoteDetail.attributes','exports','sa_creditNote_details','lodash'];(function(_0xe84861,_0x587e1b){var _0x4d00e1=function(_0x3f5283){while(--_0x3f5283){_0xe84861['push'](_0xe84861['shift']());}};_0x4d00e1(++_0x587e1b);}(_0xf395,0x1b7));var _0x5f39=function(_0x4f6d30,_0x325bb8){_0x4f6d30=_0x4f6d30-0x0;var _0x34d7b3=_0xf395[_0x4f6d30];return _0x34d7b3;};'use strict';var _=require(_0x5f39('0x0'));var util=require(_0x5f39('0x1'));var logger=require('../../config/logger')(_0x5f39('0x2'));var moment=require(_0x5f39('0x3'));var BPromise=require(_0x5f39('0x4'));var rp=require(_0x5f39('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f39('0x6'));var config=require(_0x5f39('0x7'));var attributes=require(_0x5f39('0x8'));module[_0x5f39('0x9')]=function(_0x31054b,_0x10ba98){return _0x31054b['define']('SACreditNoteDetail',attributes,{'tableName':_0x5f39('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec26=['define','SACreditNoteDetail','sa_creditNote_details','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./saCreditNoteDetail.attributes','exports'];(function(_0x39d6f5,_0x18283b){var _0x18d6b7=function(_0x544b48){while(--_0x544b48){_0x39d6f5['push'](_0x39d6f5['shift']());}};_0x18d6b7(++_0x18283b);}(_0xec26,0x1df));var _0x6ec2=function(_0x3055ad,_0x5ea054){_0x3055ad=_0x3055ad-0x0;var _0x543083=_0xec26[_0x3055ad];return _0x543083;};'use strict';var _=require(_0x6ec2('0x0'));var util=require(_0x6ec2('0x1'));var logger=require(_0x6ec2('0x2'))(_0x6ec2('0x3'));var moment=require('moment');var BPromise=require(_0x6ec2('0x4'));var rp=require(_0x6ec2('0x5'));var fs=require('fs');var path=require(_0x6ec2('0x6'));var rimraf=require(_0x6ec2('0x7'));var config=require(_0x6ec2('0x8'));var attributes=require(_0x6ec2('0x9'));module[_0x6ec2('0xa')]=function(_0x23423a,_0x4e08e7){return _0x23423a[_0x6ec2('0xb')](_0x6ec2('0xc'),attributes,{'tableName':_0x6ec2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saCreditNoteDetail/saCreditNoteDetail.rpc.js b/server/api/saCreditNoteDetail/saCreditNoteDetail.rpc.js index 1155dfb..7855061 100644 --- a/server/api/saCreditNoteDetail/saCreditNoteDetail.rpc.js +++ b/server/api/saCreditNoteDetail/saCreditNoteDetail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x11ff=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SACreditNoteDetail,\x20%s,\x20%s','request\x20sent','debug','SACreditNoteDetail,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x3ef155,_0x1e36dc){var _0x931490=function(_0x5e8302){while(--_0x5e8302){_0x3ef155['push'](_0x3ef155['shift']());}};_0x931490(++_0x1e36dc);}(_0x11ff,0xb2));var _0xf11f=function(_0x17ba75,_0x156046){_0x17ba75=_0x17ba75-0x0;var _0x223975=_0x11ff[_0x17ba75];return _0x223975;};'use strict';var _=require(_0xf11f('0x0'));var util=require(_0xf11f('0x1'));var moment=require(_0xf11f('0x2'));var BPromise=require('bluebird');var rs=require(_0xf11f('0x3'));var fs=require('fs');var Redis=require(_0xf11f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf11f('0x5'));var logger=require(_0xf11f('0x6'))(_0xf11f('0x7'));var config=require(_0xf11f('0x8'));var jayson=require(_0xf11f('0x9'));var client=jayson[_0xf11f('0xa')][_0xf11f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1019a6,_0x361305,_0xf6bcc2){return new BPromise(function(_0x5aa271,_0x2c4be4){return client[_0xf11f('0xc')](_0x1019a6,_0xf6bcc2)[_0xf11f('0xd')](function(_0x261f74){logger[_0xf11f('0xe')](_0xf11f('0xf'),_0x361305,_0xf11f('0x10'));logger[_0xf11f('0x11')](_0xf11f('0x12'),_0x361305,'request\x20sent',JSON[_0xf11f('0x13')](_0x261f74));if(_0x261f74['error']){if(_0x261f74[_0xf11f('0x14')]['code']===0x1f4){logger[_0xf11f('0x14')](_0xf11f('0xf'),_0x361305,_0x261f74['error'][_0xf11f('0x15')]);return _0x2c4be4(_0x261f74['error'][_0xf11f('0x15')]);}logger[_0xf11f('0x14')](_0xf11f('0xf'),_0x361305,_0x261f74[_0xf11f('0x14')][_0xf11f('0x15')]);return _0x5aa271(_0x261f74[_0xf11f('0x14')][_0xf11f('0x15')]);}else{logger[_0xf11f('0xe')](_0xf11f('0xf'),_0x361305,'request\x20sent');_0x5aa271(_0x261f74['result'][_0xf11f('0x15')]);}})[_0xf11f('0x16')](function(_0xfc8a90){logger[_0xf11f('0x14')](_0xf11f('0xf'),_0x361305,_0xfc8a90);_0x2c4be4(_0xfc8a90);});});} \ No newline at end of file +var _0xa659=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','SACreditNoteDetail,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x464075,_0x216f2b){var _0x1d3788=function(_0x576c8f){while(--_0x576c8f){_0x464075['push'](_0x464075['shift']());}};_0x1d3788(++_0x216f2b);}(_0xa659,0x1c1));var _0x9a65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa659[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9a65('0x0'));var util=require(_0x9a65('0x1'));var moment=require(_0x9a65('0x2'));var BPromise=require('bluebird');var rs=require(_0x9a65('0x3'));var fs=require('fs');var Redis=require(_0x9a65('0x4'));var db=require(_0x9a65('0x5'))['db'];var utils=require(_0x9a65('0x6'));var logger=require('../../config/logger')(_0x9a65('0x7'));var config=require(_0x9a65('0x8'));var jayson=require(_0x9a65('0x9'));var client=jayson[_0x9a65('0xa')][_0x9a65('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x186983,_0x3b92f9,_0x5f0c8a){return new BPromise(function(_0x19d2d5,_0x267aa0){return client[_0x9a65('0xc')](_0x186983,_0x5f0c8a)[_0x9a65('0xd')](function(_0x44cad6){logger[_0x9a65('0xe')](_0x9a65('0xf'),_0x3b92f9,'request\x20sent');logger[_0x9a65('0x10')]('SACreditNoteDetail,\x20%s,\x20%s,\x20%s',_0x3b92f9,_0x9a65('0x11'),JSON[_0x9a65('0x12')](_0x44cad6));if(_0x44cad6[_0x9a65('0x13')]){if(_0x44cad6[_0x9a65('0x13')][_0x9a65('0x14')]===0x1f4){logger[_0x9a65('0x13')]('SACreditNoteDetail,\x20%s,\x20%s',_0x3b92f9,_0x44cad6['error'][_0x9a65('0x15')]);return _0x267aa0(_0x44cad6['error']['message']);}logger[_0x9a65('0x13')](_0x9a65('0xf'),_0x3b92f9,_0x44cad6[_0x9a65('0x13')][_0x9a65('0x15')]);return _0x19d2d5(_0x44cad6['error'][_0x9a65('0x15')]);}else{logger[_0x9a65('0xe')](_0x9a65('0xf'),_0x3b92f9,_0x9a65('0x11'));_0x19d2d5(_0x44cad6[_0x9a65('0x16')][_0x9a65('0x15')]);}})[_0x9a65('0x17')](function(_0x100df0){logger[_0x9a65('0x13')](_0x9a65('0xf'),_0x3b92f9,_0x100df0);_0x267aa0(_0x100df0);});});} \ No newline at end of file diff --git a/server/api/saCreditNoteNumber/index.js b/server/api/saCreditNoteNumber/index.js index 28d640b..3133bb0 100644 --- a/server/api/saCreditNoteNumber/index.js +++ b/server/api/saCreditNoteNumber/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x26a6=['/:id','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./saCreditNoteNumber.controller','get','isAuthenticated','/describe','describe'];(function(_0x1810e3,_0x540f69){var _0x5a54c2=function(_0x392332){while(--_0x392332){_0x1810e3['push'](_0x1810e3['shift']());}};_0x5a54c2(++_0x540f69);}(_0x26a6,0xe4));var _0x626a=function(_0x256752,_0xee0dcf){_0x256752=_0x256752-0x0;var _0x566fac=_0x26a6[_0x256752];return _0x566fac;};'use strict';var multer=require('multer');var util=require(_0x626a('0x0'));var path=require(_0x626a('0x1'));var timeout=require(_0x626a('0x2'));var express=require(_0x626a('0x3'));var router=express[_0x626a('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x626a('0x5'));var config=require(_0x626a('0x6'));var controller=require(_0x626a('0x7'));router[_0x626a('0x8')]('/',auth[_0x626a('0x9')](),controller['index']);router['get'](_0x626a('0xa'),auth[_0x626a('0x9')](),controller[_0x626a('0xb')]);router[_0x626a('0x8')](_0x626a('0xc'),auth[_0x626a('0x9')](),controller[_0x626a('0xd')]);router[_0x626a('0xe')]('/',auth[_0x626a('0x9')](),controller[_0x626a('0xf')]);router['put'](_0x626a('0xc'),auth[_0x626a('0x9')](),controller[_0x626a('0x10')]);router[_0x626a('0x11')](_0x626a('0xc'),auth['isAuthenticated'](),controller[_0x626a('0x12')]);module[_0x626a('0x13')]=router; \ No newline at end of file +var _0xee57=['post','create','put','delete','util','Router','./saCreditNoteNumber.controller','isAuthenticated','index','/describe','describe','get','/:id','show'];(function(_0x28f20d,_0x58d381){var _0x19696b=function(_0x31c4f1){while(--_0x31c4f1){_0x28f20d['push'](_0x28f20d['shift']());}};_0x19696b(++_0x58d381);}(_0xee57,0x170));var _0x7ee5=function(_0x3352c1,_0x10d9c4){_0x3352c1=_0x3352c1-0x0;var _0x234f31=_0xee57[_0x3352c1];return _0x234f31;};'use strict';var multer=require('multer');var util=require(_0x7ee5('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7ee5('0x1')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7ee5('0x2'));router['get']('/',auth[_0x7ee5('0x3')](),controller[_0x7ee5('0x4')]);router['get'](_0x7ee5('0x5'),auth[_0x7ee5('0x3')](),controller[_0x7ee5('0x6')]);router[_0x7ee5('0x7')](_0x7ee5('0x8'),auth[_0x7ee5('0x3')](),controller[_0x7ee5('0x9')]);router[_0x7ee5('0xa')]('/',auth[_0x7ee5('0x3')](),controller[_0x7ee5('0xb')]);router[_0x7ee5('0xc')](_0x7ee5('0x8'),auth[_0x7ee5('0x3')](),controller['update']);router[_0x7ee5('0xd')](_0x7ee5('0x8'),auth[_0x7ee5('0x3')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/saCreditNoteNumber/saCreditNoteNumber.attributes.js b/server/api/saCreditNoteNumber/saCreditNoteNumber.attributes.js index ff385ac..e60ded8 100644 --- a/server/api/saCreditNoteNumber/saCreditNoteNumber.attributes.js +++ b/server/api/saCreditNoteNumber/saCreditNoteNumber.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x99f4=['exports','INTEGER','sequelize'];(function(_0x4239bd,_0x1f310b){var _0x21f061=function(_0xbe0bca){while(--_0xbe0bca){_0x4239bd['push'](_0x4239bd['shift']());}};_0x21f061(++_0x1f310b);}(_0x99f4,0x167));var _0x499f=function(_0x48d446,_0x58dbc4){_0x48d446=_0x48d446-0x0;var _0x28353c=_0x99f4[_0x48d446];return _0x28353c;};'use strict';var Sequelize=require(_0x499f('0x0'));module[_0x499f('0x1')]={'year':{'type':Sequelize[_0x499f('0x2')]},'number':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x808b=['exports','INTEGER','sequelize'];(function(_0x2fff83,_0x29d5fe){var _0xa2a722=function(_0x18b6b0){while(--_0x18b6b0){_0x2fff83['push'](_0x2fff83['shift']());}};_0xa2a722(++_0x29d5fe);}(_0x808b,0x122));var _0xb808=function(_0x23fdd3,_0x667ee6){_0x23fdd3=_0x23fdd3-0x0;var _0x552eee=_0x808b[_0x23fdd3];return _0x552eee;};'use strict';var Sequelize=require(_0xb808('0x0'));module[_0xb808('0x1')]={'year':{'type':Sequelize[_0xb808('0x2')]},'number':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/saCreditNoteNumber/saCreditNoteNumber.controller.js b/server/api/saCreditNoteNumber/saCreditNoteNumber.controller.js index 642b8c3..f86fda1 100644 --- a/server/api/saCreditNoteNumber/saCreditNoteNumber.controller.js +++ b/server/api/saCreditNoteNumber/saCreditNoteNumber.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2efa=['limit','order','sort','where','filters','pick','filter','map','type','key','field','options','count','includeAll','include','findAll','rows','catch','merge','find','create','update','body','params','describe','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','Content-Range','save','then','destroy','error','stack','name','send','index','SACreditNoteNumber','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x5421c4,_0x1e9ff1){var _0x4dee02=function(_0x5552e3){while(--_0x5552e3){_0x5421c4['push'](_0x5421c4['shift']());}};_0x4dee02(++_0x1e9ff1);}(_0x2efa,0x141));var _0xa2ef=function(_0x25ac0d,_0x5e7312){_0x25ac0d=_0x25ac0d-0x0;var _0x1e9f18=_0x2efa[_0x25ac0d];return _0x1e9f18;};'use strict';var pdf=require(_0xa2ef('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa2ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa2ef('0x2'));var rp=require(_0xa2ef('0x3'));var moment=require('moment');var BPromise=require(_0xa2ef('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa2ef('0x5'));var sox=require(_0xa2ef('0x6'));var csv=require(_0xa2ef('0x7'));var ejs=require(_0xa2ef('0x8'));var fs=require('fs');var _=require(_0xa2ef('0x9'));var squel=require(_0xa2ef('0xa'));var crypto=require(_0xa2ef('0xb'));var jsforce=require(_0xa2ef('0xc'));var deskjs=require(_0xa2ef('0xd'));var toCsv=require(_0xa2ef('0x7'));var querystring=require(_0xa2ef('0xe'));var Papa=require(_0xa2ef('0xf'));var Redis=require(_0xa2ef('0x10'));var authService=require(_0xa2ef('0x11'));var qs=require(_0xa2ef('0x12'));var hardwareService=require(_0xa2ef('0x13'));var logger=require(_0xa2ef('0x14'))('api');var utils=require(_0xa2ef('0x15'));var config=require(_0xa2ef('0x16'));var db=require(_0xa2ef('0x17'))['db'];function respondWithStatusCode(_0x604a3e,_0x2abe8f){_0x2abe8f=_0x2abe8f||0xcc;return function(_0x3d3568){if(_0x3d3568){return _0x604a3e[_0xa2ef('0x18')](_0x2abe8f);}return _0x604a3e[_0xa2ef('0x19')](_0x2abe8f)[_0xa2ef('0x1a')]();};}function respondWithResult(_0x57b999,_0x4ebc6b){_0x4ebc6b=_0x4ebc6b||0xc8;return function(_0x34b1fe){if(_0x34b1fe){return _0x57b999[_0xa2ef('0x19')](_0x4ebc6b)[_0xa2ef('0x1b')](_0x34b1fe);}};}function respondWithFilteredResult(_0x131f5f,_0x494a98){return function(_0x5884be){if(_0x5884be){var _0x3b2569=_0x5884be['count'],_0x59e914=_0x494a98[_0xa2ef('0x1c')],_0x1e4aa3=_0x494a98[_0xa2ef('0x1c')]+_0x494a98['limit'],_0x43d283;if(_0x1e4aa3>=_0x3b2569){_0x1e4aa3=_0x3b2569;_0x43d283=0xc8;}else{_0x43d283=0xce;}_0x131f5f[_0xa2ef('0x19')](_0x43d283);return _0x131f5f['set'](_0xa2ef('0x1d'),_0x59e914+'-'+_0x1e4aa3+'/'+_0x3b2569)[_0xa2ef('0x1b')](_0x5884be);}return null;};}function patchUpdates(_0x57035e){return function(_0xe886f6){try{jsonpatch['apply'](_0xe886f6,_0x57035e,!![]);}catch(_0xf85c59){return BPromise['reject'](_0xf85c59);}return _0xe886f6[_0xa2ef('0x1e')]();};}function saveUpdates(_0x37377c,_0x3e72db){return function(_0x2d8f9f){if(_0x2d8f9f){return _0x2d8f9f['update'](_0x37377c)[_0xa2ef('0x1f')](function(_0x343da0){return _0x343da0;});}return null;};}function removeEntity(_0x475df0,_0x30c153){return function(_0x4db7fa){if(_0x4db7fa){return _0x4db7fa[_0xa2ef('0x20')]()[_0xa2ef('0x1f')](function(){_0x475df0[_0xa2ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b59f2,_0x16d0c0){return function(_0x9c21d0){if(!_0x9c21d0){_0x5b59f2[_0xa2ef('0x18')](0x194);}return _0x9c21d0;};}function handleError(_0x11f555,_0x2f5997){_0x2f5997=_0x2f5997||0x1f4;return function(_0xcbe8c3){logger[_0xa2ef('0x21')](_0xcbe8c3[_0xa2ef('0x22')]);if(_0xcbe8c3[_0xa2ef('0x23')]){delete _0xcbe8c3['name'];}_0x11f555['status'](_0x2f5997)[_0xa2ef('0x24')](_0xcbe8c3);};}exports[_0xa2ef('0x25')]=function(_0x8c1b0,_0x242a08){var _0x31847c={},_0x4ddf40={},_0x470391={'count':0x0,'rows':[]};var _0x1ae952=db[_0xa2ef('0x26')][_0xa2ef('0x27')];_0x4ddf40[_0xa2ef('0x28')]=_[_0xa2ef('0x29')](_0x1ae952);_0x4ddf40['query']=_[_0xa2ef('0x29')](_0x8c1b0[_0xa2ef('0x2a')]);_0x4ddf40['filters']=_[_0xa2ef('0x2b')](_0x4ddf40[_0xa2ef('0x28')],_0x4ddf40[_0xa2ef('0x2a')]);_0x31847c[_0xa2ef('0x2c')]=_['intersection'](_0x4ddf40[_0xa2ef('0x28')],qs[_0xa2ef('0x2d')](_0x8c1b0['query']['fields']));_0x31847c[_0xa2ef('0x2c')]=_0x31847c['attributes'][_0xa2ef('0x2e')]?_0x31847c[_0xa2ef('0x2c')]:_0x4ddf40[_0xa2ef('0x28')];if(!_0x8c1b0[_0xa2ef('0x2a')][_0xa2ef('0x2f')](_0xa2ef('0x30'))){_0x31847c['limit']=qs[_0xa2ef('0x31')](_0x8c1b0[_0xa2ef('0x2a')][_0xa2ef('0x31')]);_0x31847c[_0xa2ef('0x1c')]=qs[_0xa2ef('0x1c')](_0x8c1b0[_0xa2ef('0x2a')][_0xa2ef('0x1c')]);}_0x31847c[_0xa2ef('0x32')]=qs[_0xa2ef('0x33')](_0x8c1b0[_0xa2ef('0x2a')]['sort']);_0x31847c[_0xa2ef('0x34')]=qs[_0xa2ef('0x35')](_[_0xa2ef('0x36')](_0x8c1b0[_0xa2ef('0x2a')],_0x4ddf40['filters']));if(_0x8c1b0[_0xa2ef('0x2a')][_0xa2ef('0x37')]){_0x31847c[_0xa2ef('0x34')]=_['merge'](_0x31847c[_0xa2ef('0x34')],{'$or':_[_0xa2ef('0x38')](_0x1ae952,function(_0x2ac62c){if(_0x2ac62c[_0xa2ef('0x39')][_0xa2ef('0x3a')]!=='VIRTUAL'){var _0x5dbfd2={};_0x5dbfd2[_0x2ac62c[_0xa2ef('0x3b')]]={'$like':'%'+_0x8c1b0[_0xa2ef('0x2a')]['filter']+'%'};return _0x5dbfd2;}})});}_0x31847c=_['merge']({},_0x31847c,_0x8c1b0[_0xa2ef('0x3c')]);var _0x55fa01={'where':_0x31847c[_0xa2ef('0x34')]};return db[_0xa2ef('0x26')][_0xa2ef('0x3d')](_0x55fa01)[_0xa2ef('0x1f')](function(_0x16c4c1){_0x470391[_0xa2ef('0x3d')]=_0x16c4c1;if(_0x8c1b0[_0xa2ef('0x2a')][_0xa2ef('0x3e')]){_0x31847c[_0xa2ef('0x3f')]=[{'all':!![]}];}return db[_0xa2ef('0x26')][_0xa2ef('0x40')](_0x31847c);})[_0xa2ef('0x1f')](function(_0x2155f6){_0x470391[_0xa2ef('0x41')]=_0x2155f6;return _0x470391;})[_0xa2ef('0x1f')](respondWithFilteredResult(_0x242a08,_0x31847c))[_0xa2ef('0x42')](handleError(_0x242a08,null));};exports['show']=function(_0x569865,_0x3814dd){var _0x6b7bf5={'raw':![],'where':{'id':_0x569865['params']['id']}},_0x3be393={};_0x3be393[_0xa2ef('0x28')]=_[_0xa2ef('0x29')](db[_0xa2ef('0x26')][_0xa2ef('0x27')]);_0x3be393[_0xa2ef('0x2a')]=_[_0xa2ef('0x29')](_0x569865[_0xa2ef('0x2a')]);_0x3be393['filters']=_[_0xa2ef('0x2b')](_0x3be393[_0xa2ef('0x28')],_0x3be393[_0xa2ef('0x2a')]);_0x6b7bf5[_0xa2ef('0x2c')]=_['intersection'](_0x3be393[_0xa2ef('0x28')],qs[_0xa2ef('0x2d')](_0x569865[_0xa2ef('0x2a')][_0xa2ef('0x2d')]));_0x6b7bf5[_0xa2ef('0x2c')]=_0x6b7bf5['attributes'][_0xa2ef('0x2e')]?_0x6b7bf5[_0xa2ef('0x2c')]:_0x3be393['model'];if(_0x569865[_0xa2ef('0x2a')][_0xa2ef('0x3e')]){_0x6b7bf5[_0xa2ef('0x3f')]=[{'all':!![]}];}_0x6b7bf5=_[_0xa2ef('0x43')]({},_0x6b7bf5,_0x569865[_0xa2ef('0x3c')]);return db[_0xa2ef('0x26')][_0xa2ef('0x44')](_0x6b7bf5)['then'](handleEntityNotFound(_0x3814dd,null))[_0xa2ef('0x1f')](respondWithResult(_0x3814dd,null))[_0xa2ef('0x42')](handleError(_0x3814dd,null));};exports[_0xa2ef('0x45')]=function(_0x252148,_0x8f4101){return db[_0xa2ef('0x26')][_0xa2ef('0x45')](_0x252148['body'],{})[_0xa2ef('0x1f')](respondWithResult(_0x8f4101,0xc9))['catch'](handleError(_0x8f4101,null));};exports[_0xa2ef('0x46')]=function(_0xe08f13,_0x5eb17b){if(_0xe08f13['body']['id']){delete _0xe08f13[_0xa2ef('0x47')]['id'];}return db[_0xa2ef('0x26')][_0xa2ef('0x44')]({'where':{'id':_0xe08f13[_0xa2ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x5eb17b,null))[_0xa2ef('0x1f')](saveUpdates(_0xe08f13[_0xa2ef('0x47')],null))[_0xa2ef('0x1f')](respondWithResult(_0x5eb17b,null))['catch'](handleError(_0x5eb17b,null));};exports['destroy']=function(_0x1053a3,_0x397ef9){return db[_0xa2ef('0x26')][_0xa2ef('0x44')]({'where':{'id':_0x1053a3[_0xa2ef('0x48')]['id']}})[_0xa2ef('0x1f')](handleEntityNotFound(_0x397ef9,null))[_0xa2ef('0x1f')](removeEntity(_0x397ef9,null))[_0xa2ef('0x42')](handleError(_0x397ef9,null));};exports['describe']=function(_0x15f816,_0x13bf8a){return db[_0xa2ef('0x26')][_0xa2ef('0x49')]()[_0xa2ef('0x1f')](respondWithResult(_0x13bf8a,null))[_0xa2ef('0x42')](handleError(_0x13bf8a,null));}; \ No newline at end of file +var _0x97e7=['end','json','count','offset','status','set','Content-Range','reject','save','update','destroy','then','stack','name','send','index','SACreditNoteNumber','rawAttributes','keys','query','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','map','type','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus'];(function(_0x54d9c0,_0x130836){var _0x1fcb4b=function(_0x37928c){while(--_0x37928c){_0x54d9c0['push'](_0x54d9c0['shift']());}};_0x1fcb4b(++_0x130836);}(_0x97e7,0x1a1));var _0x797e=function(_0x406b13,_0x2f193c){_0x406b13=_0x406b13-0x0;var _0xc3cc04=_0x97e7[_0x406b13];return _0xc3cc04;};'use strict';var pdf=require(_0x797e('0x0'));var emlformat=require(_0x797e('0x1'));var rimraf=require(_0x797e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x797e('0x3'));var rp=require(_0x797e('0x4'));var moment=require(_0x797e('0x5'));var BPromise=require(_0x797e('0x6'));var Mustache=require(_0x797e('0x7'));var util=require(_0x797e('0x8'));var path=require(_0x797e('0x9'));var sox=require(_0x797e('0xa'));var csv=require(_0x797e('0xb'));var ejs=require(_0x797e('0xc'));var fs=require('fs');var _=require(_0x797e('0xd'));var squel=require(_0x797e('0xe'));var crypto=require('crypto');var jsforce=require(_0x797e('0xf'));var deskjs=require(_0x797e('0x10'));var toCsv=require(_0x797e('0xb'));var querystring=require(_0x797e('0x11'));var Papa=require('papaparse');var Redis=require(_0x797e('0x12'));var authService=require(_0x797e('0x13'));var qs=require(_0x797e('0x14'));var hardwareService=require(_0x797e('0x15'));var logger=require(_0x797e('0x16'))(_0x797e('0x17'));var utils=require(_0x797e('0x18'));var config=require('../../config/environment');var db=require(_0x797e('0x19'))['db'];function respondWithStatusCode(_0x22be4d,_0x1da7a4){_0x1da7a4=_0x1da7a4||0xcc;return function(_0x5e924f){if(_0x5e924f){return _0x22be4d[_0x797e('0x1a')](_0x1da7a4);}return _0x22be4d['status'](_0x1da7a4)[_0x797e('0x1b')]();};}function respondWithResult(_0x4ae89e,_0x285968){_0x285968=_0x285968||0xc8;return function(_0x437b80){if(_0x437b80){return _0x4ae89e['status'](_0x285968)[_0x797e('0x1c')](_0x437b80);}};}function respondWithFilteredResult(_0x48ea8c,_0x37d007){return function(_0xfbd7a2){if(_0xfbd7a2){var _0x27e5b6=_0xfbd7a2[_0x797e('0x1d')],_0x1ccfaa=_0x37d007[_0x797e('0x1e')],_0x442ba0=_0x37d007[_0x797e('0x1e')]+_0x37d007['limit'],_0x3f6e25;if(_0x442ba0>=_0x27e5b6){_0x442ba0=_0x27e5b6;_0x3f6e25=0xc8;}else{_0x3f6e25=0xce;}_0x48ea8c[_0x797e('0x1f')](_0x3f6e25);return _0x48ea8c[_0x797e('0x20')](_0x797e('0x21'),_0x1ccfaa+'-'+_0x442ba0+'/'+_0x27e5b6)['json'](_0xfbd7a2);}return null;};}function patchUpdates(_0x112eb3){return function(_0x3643b7){try{jsonpatch['apply'](_0x3643b7,_0x112eb3,!![]);}catch(_0x2c1657){return BPromise[_0x797e('0x22')](_0x2c1657);}return _0x3643b7[_0x797e('0x23')]();};}function saveUpdates(_0x3535fb,_0x248e89){return function(_0x57ddae){if(_0x57ddae){return _0x57ddae[_0x797e('0x24')](_0x3535fb)['then'](function(_0x544225){return _0x544225;});}return null;};}function removeEntity(_0x4ebb8f,_0x4edfd9){return function(_0x47bde9){if(_0x47bde9){return _0x47bde9[_0x797e('0x25')]()[_0x797e('0x26')](function(){_0x4ebb8f[_0x797e('0x1f')](0xcc)[_0x797e('0x1b')]();});}};}function handleEntityNotFound(_0x1b03d0,_0x137aea){return function(_0x41d4df){if(!_0x41d4df){_0x1b03d0[_0x797e('0x1a')](0x194);}return _0x41d4df;};}function handleError(_0x20b32f,_0x4215dd){_0x4215dd=_0x4215dd||0x1f4;return function(_0x1713a0){logger['error'](_0x1713a0[_0x797e('0x27')]);if(_0x1713a0[_0x797e('0x28')]){delete _0x1713a0['name'];}_0x20b32f[_0x797e('0x1f')](_0x4215dd)[_0x797e('0x29')](_0x1713a0);};}exports[_0x797e('0x2a')]=function(_0x28189c,_0x2eb629){var _0x11eb11={},_0xa156f0={},_0x13f7e7={'count':0x0,'rows':[]};var _0x3a9310=db[_0x797e('0x2b')][_0x797e('0x2c')];_0xa156f0['model']=_[_0x797e('0x2d')](_0x3a9310);_0xa156f0[_0x797e('0x2e')]=_[_0x797e('0x2d')](_0x28189c[_0x797e('0x2e')]);_0xa156f0['filters']=_[_0x797e('0x2f')](_0xa156f0[_0x797e('0x30')],_0xa156f0[_0x797e('0x2e')]);_0x11eb11['attributes']=_[_0x797e('0x2f')](_0xa156f0[_0x797e('0x30')],qs['fields'](_0x28189c['query'][_0x797e('0x31')]));_0x11eb11['attributes']=_0x11eb11['attributes'][_0x797e('0x32')]?_0x11eb11[_0x797e('0x33')]:_0xa156f0['model'];if(!_0x28189c['query'][_0x797e('0x34')](_0x797e('0x35'))){_0x11eb11[_0x797e('0x36')]=qs['limit'](_0x28189c['query']['limit']);_0x11eb11[_0x797e('0x1e')]=qs[_0x797e('0x1e')](_0x28189c[_0x797e('0x2e')]['offset']);}_0x11eb11[_0x797e('0x37')]=qs['sort'](_0x28189c[_0x797e('0x2e')][_0x797e('0x38')]);_0x11eb11[_0x797e('0x39')]=qs[_0x797e('0x3a')](_['pick'](_0x28189c['query'],_0xa156f0['filters']));if(_0x28189c[_0x797e('0x2e')]['filter']){_0x11eb11[_0x797e('0x39')]=_['merge'](_0x11eb11[_0x797e('0x39')],{'$or':_[_0x797e('0x3b')](_0x3a9310,function(_0x58433e){if(_0x58433e[_0x797e('0x3c')]['key']!=='VIRTUAL'){var _0x56f263={};_0x56f263[_0x58433e['field']]={'$like':'%'+_0x28189c[_0x797e('0x2e')][_0x797e('0x3d')]+'%'};return _0x56f263;}})});}_0x11eb11=_[_0x797e('0x3e')]({},_0x11eb11,_0x28189c[_0x797e('0x3f')]);var _0x5ca9f4={'where':_0x11eb11['where']};return db['SACreditNoteNumber'][_0x797e('0x1d')](_0x5ca9f4)[_0x797e('0x26')](function(_0x5b8370){_0x13f7e7[_0x797e('0x1d')]=_0x5b8370;if(_0x28189c['query'][_0x797e('0x40')]){_0x11eb11[_0x797e('0x41')]=[{'all':!![]}];}return db['SACreditNoteNumber'][_0x797e('0x42')](_0x11eb11);})[_0x797e('0x26')](function(_0x2630f6){_0x13f7e7[_0x797e('0x43')]=_0x2630f6;return _0x13f7e7;})[_0x797e('0x26')](respondWithFilteredResult(_0x2eb629,_0x11eb11))[_0x797e('0x44')](handleError(_0x2eb629,null));};exports[_0x797e('0x45')]=function(_0x3eb6f5,_0x38778b){var _0x9a4390={'raw':![],'where':{'id':_0x3eb6f5[_0x797e('0x46')]['id']}},_0x5a5336={};_0x5a5336[_0x797e('0x30')]=_['keys'](db[_0x797e('0x2b')][_0x797e('0x2c')]);_0x5a5336[_0x797e('0x2e')]=_['keys'](_0x3eb6f5[_0x797e('0x2e')]);_0x5a5336['filters']=_[_0x797e('0x2f')](_0x5a5336[_0x797e('0x30')],_0x5a5336[_0x797e('0x2e')]);_0x9a4390[_0x797e('0x33')]=_['intersection'](_0x5a5336[_0x797e('0x30')],qs[_0x797e('0x31')](_0x3eb6f5[_0x797e('0x2e')][_0x797e('0x31')]));_0x9a4390[_0x797e('0x33')]=_0x9a4390[_0x797e('0x33')]['length']?_0x9a4390['attributes']:_0x5a5336[_0x797e('0x30')];if(_0x3eb6f5['query']['includeAll']){_0x9a4390[_0x797e('0x41')]=[{'all':!![]}];}_0x9a4390=_[_0x797e('0x3e')]({},_0x9a4390,_0x3eb6f5[_0x797e('0x3f')]);return db[_0x797e('0x2b')]['find'](_0x9a4390)[_0x797e('0x26')](handleEntityNotFound(_0x38778b,null))[_0x797e('0x26')](respondWithResult(_0x38778b,null))[_0x797e('0x44')](handleError(_0x38778b,null));};exports[_0x797e('0x47')]=function(_0x5eb031,_0x1b50b2){return db[_0x797e('0x2b')][_0x797e('0x47')](_0x5eb031[_0x797e('0x48')],{})[_0x797e('0x26')](respondWithResult(_0x1b50b2,0xc9))[_0x797e('0x44')](handleError(_0x1b50b2,null));};exports[_0x797e('0x24')]=function(_0x581ded,_0x503556){if(_0x581ded['body']['id']){delete _0x581ded[_0x797e('0x48')]['id'];}return db[_0x797e('0x2b')]['find']({'where':{'id':_0x581ded[_0x797e('0x46')]['id']}})[_0x797e('0x26')](handleEntityNotFound(_0x503556,null))['then'](saveUpdates(_0x581ded['body'],null))[_0x797e('0x26')](respondWithResult(_0x503556,null))['catch'](handleError(_0x503556,null));};exports[_0x797e('0x25')]=function(_0x36af89,_0x247c43){return db['SACreditNoteNumber']['find']({'where':{'id':_0x36af89[_0x797e('0x46')]['id']}})[_0x797e('0x26')](handleEntityNotFound(_0x247c43,null))[_0x797e('0x26')](removeEntity(_0x247c43,null))['catch'](handleError(_0x247c43,null));};exports[_0x797e('0x49')]=function(_0x561198,_0x5b13b6){return db[_0x797e('0x2b')][_0x797e('0x49')]()[_0x797e('0x26')](respondWithResult(_0x5b13b6,null))[_0x797e('0x44')](handleError(_0x5b13b6,null));}; \ No newline at end of file diff --git a/server/api/saCreditNoteNumber/saCreditNoteNumber.model.js b/server/api/saCreditNoteNumber/saCreditNoteNumber.model.js index 86fc94d..b169b83 100644 --- a/server/api/saCreditNoteNumber/saCreditNoteNumber.model.js +++ b/server/api/saCreditNoteNumber/saCreditNoteNumber.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14f4=['../../config/environment','./saCreditNoteNumber.attributes','exports','define','SACreditNoteNumber','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x45fa67,_0x54f9c8){var _0x2eddaf=function(_0x3a9aec){while(--_0x3a9aec){_0x45fa67['push'](_0x45fa67['shift']());}};_0x2eddaf(++_0x54f9c8);}(_0x14f4,0x1d9));var _0x414f=function(_0x4dfd44,_0x1c4205){_0x4dfd44=_0x4dfd44-0x0;var _0x407755=_0x14f4[_0x4dfd44];return _0x407755;};'use strict';var _=require('lodash');var util=require(_0x414f('0x0'));var logger=require(_0x414f('0x1'))(_0x414f('0x2'));var moment=require(_0x414f('0x3'));var BPromise=require(_0x414f('0x4'));var rp=require(_0x414f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x414f('0x6'));var config=require(_0x414f('0x7'));var attributes=require(_0x414f('0x8'));module[_0x414f('0x9')]=function(_0x49b714,_0x273f8b){return _0x49b714[_0x414f('0xa')](_0x414f('0xb'),attributes,{'tableName':'sa_creditNote_numbers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcbb1=['bluebird','request-promise','path','../../config/environment','./saCreditNoteNumber.attributes','define','SACreditNoteNumber','util','moment'];(function(_0x567709,_0x24d144){var _0xfc920a=function(_0x271058){while(--_0x271058){_0x567709['push'](_0x567709['shift']());}};_0xfc920a(++_0x24d144);}(_0xcbb1,0x1d2));var _0x1cbb=function(_0x2d4b80,_0x5c929d){_0x2d4b80=_0x2d4b80-0x0;var _0x10c8d0=_0xcbb1[_0x2d4b80];return _0x10c8d0;};'use strict';var _=require('lodash');var util=require(_0x1cbb('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x1cbb('0x1'));var BPromise=require(_0x1cbb('0x2'));var rp=require(_0x1cbb('0x3'));var fs=require('fs');var path=require(_0x1cbb('0x4'));var rimraf=require('rimraf');var config=require(_0x1cbb('0x5'));var attributes=require(_0x1cbb('0x6'));module['exports']=function(_0x4b37c2,_0x3c3241){return _0x4b37c2[_0x1cbb('0x7')](_0x1cbb('0x8'),attributes,{'tableName':'sa_creditNote_numbers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saCreditNoteNumber/saCreditNoteNumber.rpc.js b/server/api/saCreditNoteNumber/saCreditNoteNumber.rpc.js index ac442eb..5cbdba6 100644 --- a/server/api/saCreditNoteNumber/saCreditNoteNumber.rpc.js +++ b/server/api/saCreditNoteNumber/saCreditNoteNumber.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc7d4=['result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SACreditNoteNumber,\x20%s,\x20%s','request\x20sent','debug','SACreditNoteNumber,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x493313,_0x2bba21){var _0x192bf4=function(_0x1c6a40){while(--_0x1c6a40){_0x493313['push'](_0x493313['shift']());}};_0x192bf4(++_0x2bba21);}(_0xc7d4,0x172));var _0x4c7d=function(_0x3e28b4,_0x1d3bd9){_0x3e28b4=_0x3e28b4-0x0;var _0x2a4a5c=_0xc7d4[_0x3e28b4];return _0x2a4a5c;};'use strict';var _=require(_0x4c7d('0x0'));var util=require(_0x4c7d('0x1'));var moment=require(_0x4c7d('0x2'));var BPromise=require(_0x4c7d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4c7d('0x4'));var logger=require(_0x4c7d('0x5'))(_0x4c7d('0x6'));var config=require('../../config/environment');var jayson=require(_0x4c7d('0x7'));var client=jayson[_0x4c7d('0x8')][_0x4c7d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4eb996,_0x48275e,_0x312e11){return new BPromise(function(_0x4e49fa,_0x5230fd){return client[_0x4c7d('0xa')](_0x4eb996,_0x312e11)[_0x4c7d('0xb')](function(_0x476684){logger[_0x4c7d('0xc')](_0x4c7d('0xd'),_0x48275e,_0x4c7d('0xe'));logger[_0x4c7d('0xf')](_0x4c7d('0x10'),_0x48275e,_0x4c7d('0xe'),JSON[_0x4c7d('0x11')](_0x476684));if(_0x476684[_0x4c7d('0x12')]){if(_0x476684[_0x4c7d('0x12')][_0x4c7d('0x13')]===0x1f4){logger['error'](_0x4c7d('0xd'),_0x48275e,_0x476684[_0x4c7d('0x12')][_0x4c7d('0x14')]);return _0x5230fd(_0x476684[_0x4c7d('0x12')][_0x4c7d('0x14')]);}logger[_0x4c7d('0x12')]('SACreditNoteNumber,\x20%s,\x20%s',_0x48275e,_0x476684[_0x4c7d('0x12')]['message']);return _0x4e49fa(_0x476684['error']['message']);}else{logger[_0x4c7d('0xc')](_0x4c7d('0xd'),_0x48275e,_0x4c7d('0xe'));_0x4e49fa(_0x476684[_0x4c7d('0x15')][_0x4c7d('0x14')]);}})[_0x4c7d('0x16')](function(_0x216e4b){logger[_0x4c7d('0x12')](_0x4c7d('0xd'),_0x48275e,_0x216e4b);_0x5230fd(_0x216e4b);});});} \ No newline at end of file +var _0x2c64=['info','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SACreditNoteNumber,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0xecfe68,_0x3bf3d2){var _0x51ac8f=function(_0x4afc44){while(--_0x4afc44){_0xecfe68['push'](_0xecfe68['shift']());}};_0x51ac8f(++_0x3bf3d2);}(_0x2c64,0x1bb));var _0x42c6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x2c64[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x42c6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x42c6('0x1'));var rs=require(_0x42c6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x42c6('0x3'))['db'];var utils=require(_0x42c6('0x4'));var logger=require(_0x42c6('0x5'))(_0x42c6('0x6'));var config=require(_0x42c6('0x7'));var jayson=require(_0x42c6('0x8'));var client=jayson[_0x42c6('0x9')][_0x42c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe287d0,_0x476917,_0x1c77bd){return new BPromise(function(_0x2e8276,_0x2e5030){return client['request'](_0xe287d0,_0x1c77bd)[_0x42c6('0xb')](function(_0x4fb0f7){logger['info'](_0x42c6('0xc'),_0x476917,_0x42c6('0xd'));logger[_0x42c6('0xe')]('SACreditNoteNumber,\x20%s,\x20%s,\x20%s',_0x476917,_0x42c6('0xd'),JSON[_0x42c6('0xf')](_0x4fb0f7));if(_0x4fb0f7[_0x42c6('0x10')]){if(_0x4fb0f7[_0x42c6('0x10')][_0x42c6('0x11')]===0x1f4){logger[_0x42c6('0x10')](_0x42c6('0xc'),_0x476917,_0x4fb0f7[_0x42c6('0x10')][_0x42c6('0x12')]);return _0x2e5030(_0x4fb0f7[_0x42c6('0x10')][_0x42c6('0x12')]);}logger[_0x42c6('0x10')](_0x42c6('0xc'),_0x476917,_0x4fb0f7[_0x42c6('0x10')][_0x42c6('0x12')]);return _0x2e8276(_0x4fb0f7[_0x42c6('0x10')][_0x42c6('0x12')]);}else{logger[_0x42c6('0x13')](_0x42c6('0xc'),_0x476917,_0x42c6('0xd'));_0x2e8276(_0x4fb0f7['result'][_0x42c6('0x12')]);}})[_0x42c6('0x14')](function(_0x57e139){logger[_0x42c6('0x10')](_0x42c6('0xc'),_0x476917,_0x57e139);_0x2e5030(_0x57e139);});});} \ No newline at end of file diff --git a/server/api/saDossier/index.js b/server/api/saDossier/index.js index 1914d98..832f490 100644 --- a/server/api/saDossier/index.js +++ b/server/api/saDossier/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x033d=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','describe','/:id','show','put','update','destroy','util'];(function(_0x17bd5c,_0x5a3bc4){var _0x2b8d53=function(_0x53ecc7){while(--_0x53ecc7){_0x17bd5c['push'](_0x17bd5c['shift']());}};_0x2b8d53(++_0x5a3bc4);}(_0x033d,0x1cf));var _0xd033=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x033d[_0x397e5f];return _0x5302b8;};'use strict';var multer=require('multer');var util=require(_0xd033('0x0'));var path=require(_0xd033('0x1'));var timeout=require(_0xd033('0x2'));var express=require(_0xd033('0x3'));var router=express[_0xd033('0x4')]();var auth=require(_0xd033('0x5'));var interaction=require(_0xd033('0x6'));var config=require(_0xd033('0x7'));var controller=require('./saDossier.controller');router['get']('/',auth[_0xd033('0x8')](),controller[_0xd033('0x9')]);router['get']('/describe',auth[_0xd033('0x8')](),controller[_0xd033('0xa')]);router['get'](_0xd033('0xb'),auth['isAuthenticated'](),controller[_0xd033('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd033('0xd')](_0xd033('0xb'),auth[_0xd033('0x8')](),controller[_0xd033('0xe')]);router['delete'](_0xd033('0xb'),auth['isAuthenticated'](),controller[_0xd033('0xf')]);module['exports']=router; \ No newline at end of file +var _0x1b3a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./saDossier.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','destroy','multer','util','express','Router'];(function(_0x302d0b,_0x2c7dbb){var _0x3b9e1d=function(_0x598beb){while(--_0x598beb){_0x302d0b['push'](_0x302d0b['shift']());}};_0x3b9e1d(++_0x2c7dbb);}(_0x1b3a,0xe0));var _0xa1b3=function(_0x3f51f3,_0x53f1a2){_0x3f51f3=_0x3f51f3-0x0;var _0x11015e=_0x1b3a[_0x3f51f3];return _0x11015e;};'use strict';var multer=require(_0xa1b3('0x0'));var util=require(_0xa1b3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa1b3('0x2'));var router=express[_0xa1b3('0x3')]();var auth=require(_0xa1b3('0x4'));var interaction=require(_0xa1b3('0x5'));var config=require(_0xa1b3('0x6'));var controller=require(_0xa1b3('0x7'));router[_0xa1b3('0x8')]('/',auth[_0xa1b3('0x9')](),controller['index']);router['get'](_0xa1b3('0xa'),auth[_0xa1b3('0x9')](),controller[_0xa1b3('0xb')]);router[_0xa1b3('0x8')](_0xa1b3('0xc'),auth[_0xa1b3('0x9')](),controller[_0xa1b3('0xd')]);router[_0xa1b3('0xe')]('/',auth[_0xa1b3('0x9')](),controller[_0xa1b3('0xf')]);router[_0xa1b3('0x10')](_0xa1b3('0xc'),auth[_0xa1b3('0x9')](),controller['update']);router[_0xa1b3('0x11')]('/:id',auth[_0xa1b3('0x9')](),controller[_0xa1b3('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/saDossier/saDossier.attributes.js b/server/api/saDossier/saDossier.attributes.js index ac71e34..b5e6c2e 100644 --- a/server/api/saDossier/saDossier.attributes.js +++ b/server/api/saDossier/saDossier.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x76f2=['TEXT','sequelize','exports','STRING'];(function(_0x52157f,_0x31f543){var _0x9a0f46=function(_0x257c23){while(--_0x257c23){_0x52157f['push'](_0x52157f['shift']());}};_0x9a0f46(++_0x31f543);}(_0x76f2,0x125));var _0x276f=function(_0x4c30c8,_0x2f06f3){_0x4c30c8=_0x4c30c8-0x0;var _0x505bb9=_0x76f2[_0x4c30c8];return _0x505bb9;};'use strict';var Sequelize=require(_0x276f('0x0'));module[_0x276f('0x1')]={'name':{'type':Sequelize[_0x276f('0x2')],'allowNull':![]},'agentFullname':{'type':Sequelize[_0x276f('0x2')]},'note':{'type':Sequelize[_0x276f('0x3')]}}; \ No newline at end of file +var _0xe172=['exports','STRING','TEXT','sequelize'];(function(_0x29da09,_0x342172){var _0x522a7e=function(_0x5bae06){while(--_0x5bae06){_0x29da09['push'](_0x29da09['shift']());}};_0x522a7e(++_0x342172);}(_0xe172,0x1bb));var _0x2e17=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xe172[_0x474bc0];return _0x4b24cf;};'use strict';var Sequelize=require(_0x2e17('0x0'));module[_0x2e17('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'agentFullname':{'type':Sequelize[_0x2e17('0x2')]},'note':{'type':Sequelize[_0x2e17('0x3')]}}; \ No newline at end of file diff --git a/server/api/saDossier/saDossier.controller.js b/server/api/saDossier/saDossier.controller.js index 89d6041..cf47c03 100644 --- a/server/api/saDossier/saDossier.controller.js +++ b/server/api/saDossier/saDossier.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e81=['html-pdf','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','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','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','SADossier','rawAttributes','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','map','type','VIRTUAL','field','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','body','update','describe'];(function(_0x27f9d0,_0x16f496){var _0x33f787=function(_0x3e41e0){while(--_0x3e41e0){_0x27f9d0['push'](_0x27f9d0['shift']());}};_0x33f787(++_0x16f496);}(_0x4e81,0x1bc));var _0x14e8=function(_0x1d04b5,_0x30792c){_0x1d04b5=_0x1d04b5-0x0;var _0x161342=_0x4e81[_0x1d04b5];return _0x161342;};'use strict';var pdf=require(_0x14e8('0x0'));var emlformat=require(_0x14e8('0x1'));var rimraf=require(_0x14e8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x14e8('0x3'));var BPromise=require(_0x14e8('0x4'));var Mustache=require(_0x14e8('0x5'));var util=require(_0x14e8('0x6'));var path=require(_0x14e8('0x7'));var sox=require(_0x14e8('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x14e8('0x9'));var squel=require(_0x14e8('0xa'));var crypto=require(_0x14e8('0xb'));var jsforce=require(_0x14e8('0xc'));var deskjs=require(_0x14e8('0xd'));var toCsv=require(_0x14e8('0xe'));var querystring=require(_0x14e8('0xf'));var Papa=require(_0x14e8('0x10'));var Redis=require(_0x14e8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x14e8('0x12'));var hardwareService=require(_0x14e8('0x13'));var logger=require(_0x14e8('0x14'))(_0x14e8('0x15'));var utils=require(_0x14e8('0x16'));var config=require(_0x14e8('0x17'));var db=require(_0x14e8('0x18'))['db'];function respondWithStatusCode(_0x30df66,_0x52d13c){_0x52d13c=_0x52d13c||0xcc;return function(_0x37eccb){if(_0x37eccb){return _0x30df66['sendStatus'](_0x52d13c);}return _0x30df66[_0x14e8('0x19')](_0x52d13c)[_0x14e8('0x1a')]();};}function respondWithResult(_0x32a01d,_0x5a95b7){_0x5a95b7=_0x5a95b7||0xc8;return function(_0x22fa86){if(_0x22fa86){return _0x32a01d['status'](_0x5a95b7)[_0x14e8('0x1b')](_0x22fa86);}};}function respondWithFilteredResult(_0x58d26e,_0x347216){return function(_0x3761a1){if(_0x3761a1){var _0xc6101f=_0x3761a1[_0x14e8('0x1c')],_0x135996=_0x347216[_0x14e8('0x1d')],_0x52e64f=_0x347216[_0x14e8('0x1d')]+_0x347216[_0x14e8('0x1e')],_0x10c4a9;if(_0x52e64f>=_0xc6101f){_0x52e64f=_0xc6101f;_0x10c4a9=0xc8;}else{_0x10c4a9=0xce;}_0x58d26e[_0x14e8('0x19')](_0x10c4a9);return _0x58d26e[_0x14e8('0x1f')](_0x14e8('0x20'),_0x135996+'-'+_0x52e64f+'/'+_0xc6101f)['json'](_0x3761a1);}return null;};}function patchUpdates(_0x328c5a){return function(_0x233cd8){try{jsonpatch[_0x14e8('0x21')](_0x233cd8,_0x328c5a,!![]);}catch(_0x7b10f2){return BPromise[_0x14e8('0x22')](_0x7b10f2);}return _0x233cd8['save']();};}function saveUpdates(_0xc967c9,_0x1cefdc){return function(_0x2abfec){if(_0x2abfec){return _0x2abfec['update'](_0xc967c9)[_0x14e8('0x23')](function(_0x47f060){return _0x47f060;});}return null;};}function removeEntity(_0x4cca43,_0xb33beb){return function(_0x3e8d5c){if(_0x3e8d5c){return _0x3e8d5c[_0x14e8('0x24')]()[_0x14e8('0x23')](function(){_0x4cca43['status'](0xcc)[_0x14e8('0x1a')]();});}};}function handleEntityNotFound(_0x5b11f9,_0x31bdd3){return function(_0x185a0e){if(!_0x185a0e){_0x5b11f9['sendStatus'](0x194);}return _0x185a0e;};}function handleError(_0x58a3a1,_0x4e7ec5){_0x4e7ec5=_0x4e7ec5||0x1f4;return function(_0x4a758c){logger[_0x14e8('0x25')](_0x4a758c[_0x14e8('0x26')]);if(_0x4a758c[_0x14e8('0x27')]){delete _0x4a758c[_0x14e8('0x27')];}_0x58a3a1['status'](_0x4e7ec5)[_0x14e8('0x28')](_0x4a758c);};}exports[_0x14e8('0x29')]=function(_0x3c09cb,_0x2f5818){var _0x28035a={},_0xfc0545={},_0x2813ae={'count':0x0,'rows':[]};var _0x4abc29=db[_0x14e8('0x2a')][_0x14e8('0x2b')];_0xfc0545[_0x14e8('0x2c')]=_['keys'](_0x4abc29);_0xfc0545['query']=_['keys'](_0x3c09cb[_0x14e8('0x2d')]);_0xfc0545[_0x14e8('0x2e')]=_['intersection'](_0xfc0545[_0x14e8('0x2c')],_0xfc0545[_0x14e8('0x2d')]);_0x28035a[_0x14e8('0x2f')]=_[_0x14e8('0x30')](_0xfc0545['model'],qs[_0x14e8('0x31')](_0x3c09cb[_0x14e8('0x2d')][_0x14e8('0x31')]));_0x28035a[_0x14e8('0x2f')]=_0x28035a[_0x14e8('0x2f')]['length']?_0x28035a[_0x14e8('0x2f')]:_0xfc0545[_0x14e8('0x2c')];if(!_0x3c09cb[_0x14e8('0x2d')][_0x14e8('0x32')]('nolimit')){_0x28035a[_0x14e8('0x1e')]=qs['limit'](_0x3c09cb[_0x14e8('0x2d')][_0x14e8('0x1e')]);_0x28035a[_0x14e8('0x1d')]=qs[_0x14e8('0x1d')](_0x3c09cb[_0x14e8('0x2d')][_0x14e8('0x1d')]);}_0x28035a[_0x14e8('0x33')]=qs[_0x14e8('0x34')](_0x3c09cb[_0x14e8('0x2d')][_0x14e8('0x34')]);_0x28035a[_0x14e8('0x35')]=qs[_0x14e8('0x2e')](_['pick'](_0x3c09cb['query'],_0xfc0545['filters']));if(_0x3c09cb[_0x14e8('0x2d')]['filter']){_0x28035a[_0x14e8('0x35')]=_['merge'](_0x28035a[_0x14e8('0x35')],{'$or':_[_0x14e8('0x36')](_0x4abc29,function(_0x41fe2a){if(_0x41fe2a[_0x14e8('0x37')]['key']!==_0x14e8('0x38')){var _0x514415={};_0x514415[_0x41fe2a[_0x14e8('0x39')]]={'$like':'%'+_0x3c09cb[_0x14e8('0x2d')][_0x14e8('0x3a')]+'%'};return _0x514415;}})});}_0x28035a=_[_0x14e8('0x3b')]({},_0x28035a,_0x3c09cb[_0x14e8('0x3c')]);var _0x4ede06={'where':_0x28035a['where']};return db[_0x14e8('0x2a')]['count'](_0x4ede06)[_0x14e8('0x23')](function(_0x20f69d){_0x2813ae[_0x14e8('0x1c')]=_0x20f69d;if(_0x3c09cb['query'][_0x14e8('0x3d')]){_0x28035a[_0x14e8('0x3e')]=[{'all':!![]}];}return db['SADossier'][_0x14e8('0x3f')](_0x28035a);})[_0x14e8('0x23')](function(_0x1f429a){_0x2813ae[_0x14e8('0x40')]=_0x1f429a;return _0x2813ae;})[_0x14e8('0x23')](respondWithFilteredResult(_0x2f5818,_0x28035a))[_0x14e8('0x41')](handleError(_0x2f5818,null));};exports[_0x14e8('0x42')]=function(_0x38ec58,_0x33743a){var _0x18faf5={'raw':![],'where':{'id':_0x38ec58[_0x14e8('0x43')]['id']}},_0x11f0ee={};_0x11f0ee[_0x14e8('0x2c')]=_[_0x14e8('0x44')](db[_0x14e8('0x2a')]['rawAttributes']);_0x11f0ee[_0x14e8('0x2d')]=_['keys'](_0x38ec58['query']);_0x11f0ee['filters']=_[_0x14e8('0x30')](_0x11f0ee['model'],_0x11f0ee[_0x14e8('0x2d')]);_0x18faf5[_0x14e8('0x2f')]=_[_0x14e8('0x30')](_0x11f0ee[_0x14e8('0x2c')],qs[_0x14e8('0x31')](_0x38ec58[_0x14e8('0x2d')][_0x14e8('0x31')]));_0x18faf5[_0x14e8('0x2f')]=_0x18faf5[_0x14e8('0x2f')][_0x14e8('0x45')]?_0x18faf5[_0x14e8('0x2f')]:_0x11f0ee['model'];if(_0x38ec58[_0x14e8('0x2d')][_0x14e8('0x3d')]){_0x18faf5[_0x14e8('0x3e')]=[{'all':!![]}];}_0x18faf5=_[_0x14e8('0x3b')]({},_0x18faf5,_0x38ec58['options']);return db[_0x14e8('0x2a')][_0x14e8('0x46')](_0x18faf5)['then'](handleEntityNotFound(_0x33743a,null))['then'](respondWithResult(_0x33743a,null))[_0x14e8('0x41')](handleError(_0x33743a,null));};exports['create']=function(_0x58b609,_0x257cc1){return db[_0x14e8('0x2a')]['create'](_0x58b609[_0x14e8('0x47')],{})[_0x14e8('0x23')](respondWithResult(_0x257cc1,0xc9))['catch'](handleError(_0x257cc1,null));};exports[_0x14e8('0x48')]=function(_0x1994fb,_0x1dee01){if(_0x1994fb[_0x14e8('0x47')]['id']){delete _0x1994fb[_0x14e8('0x47')]['id'];}return db[_0x14e8('0x2a')][_0x14e8('0x46')]({'where':{'id':_0x1994fb[_0x14e8('0x43')]['id']}})[_0x14e8('0x23')](handleEntityNotFound(_0x1dee01,null))[_0x14e8('0x23')](saveUpdates(_0x1994fb[_0x14e8('0x47')],null))[_0x14e8('0x23')](respondWithResult(_0x1dee01,null))[_0x14e8('0x41')](handleError(_0x1dee01,null));};exports[_0x14e8('0x24')]=function(_0x1bf742,_0x1f50bc){return db['SADossier'][_0x14e8('0x46')]({'where':{'id':_0x1bf742['params']['id']}})[_0x14e8('0x23')](handleEntityNotFound(_0x1f50bc,null))[_0x14e8('0x23')](removeEntity(_0x1f50bc,null))[_0x14e8('0x41')](handleError(_0x1f50bc,null));};exports[_0x14e8('0x49')]=function(_0x5dcb68,_0x4d91df){return db['SADossier'][_0x14e8('0x49')]()['then'](respondWithResult(_0x4d91df,null))['catch'](handleError(_0x4d91df,null));}; \ No newline at end of file +var _0x8603=['find','catch','create','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','SADossier','keys','query','filters','intersection','model','fields','attributes','nolimit','order','sort','where','merge','map','VIRTUAL','field','filter','options','include','findAll','rows','show','params','rawAttributes','length','includeAll'];(function(_0x403859,_0x316892){var _0x55a319=function(_0x5dc96b){while(--_0x5dc96b){_0x403859['push'](_0x403859['shift']());}};_0x55a319(++_0x316892);}(_0x8603,0x190));var _0x3860=function(_0x24166f,_0x33e4b8){_0x24166f=_0x24166f-0x0;var _0x280943=_0x8603[_0x24166f];return _0x280943;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3860('0x0'));var rimraf=require(_0x3860('0x1'));var zipdir=require(_0x3860('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3860('0x3'));var BPromise=require(_0x3860('0x4'));var Mustache=require(_0x3860('0x5'));var util=require('util');var path=require(_0x3860('0x6'));var sox=require('sox');var csv=require(_0x3860('0x7'));var ejs=require(_0x3860('0x8'));var fs=require('fs');var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var Redis=require('ioredis');var authService=require(_0x3860('0xe'));var qs=require(_0x3860('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3860('0x10'))(_0x3860('0x11'));var utils=require('../../config/utils');var config=require(_0x3860('0x12'));var db=require(_0x3860('0x13'))['db'];function respondWithStatusCode(_0x4c6a45,_0x405510){_0x405510=_0x405510||0xcc;return function(_0x8ad61d){if(_0x8ad61d){return _0x4c6a45[_0x3860('0x14')](_0x405510);}return _0x4c6a45[_0x3860('0x15')](_0x405510)[_0x3860('0x16')]();};}function respondWithResult(_0x21ae4e,_0x3d4ae1){_0x3d4ae1=_0x3d4ae1||0xc8;return function(_0x12b23b){if(_0x12b23b){return _0x21ae4e[_0x3860('0x15')](_0x3d4ae1)[_0x3860('0x17')](_0x12b23b);}};}function respondWithFilteredResult(_0x54dbc3,_0x3d861d){return function(_0x21eaf1){if(_0x21eaf1){var _0x122e40=_0x21eaf1[_0x3860('0x18')],_0x37d9ab=_0x3d861d[_0x3860('0x19')],_0x1055b3=_0x3d861d[_0x3860('0x19')]+_0x3d861d[_0x3860('0x1a')],_0xfa0c9a;if(_0x1055b3>=_0x122e40){_0x1055b3=_0x122e40;_0xfa0c9a=0xc8;}else{_0xfa0c9a=0xce;}_0x54dbc3[_0x3860('0x15')](_0xfa0c9a);return _0x54dbc3[_0x3860('0x1b')]('Content-Range',_0x37d9ab+'-'+_0x1055b3+'/'+_0x122e40)['json'](_0x21eaf1);}return null;};}function patchUpdates(_0x373b06){return function(_0x41ce59){try{jsonpatch[_0x3860('0x1c')](_0x41ce59,_0x373b06,!![]);}catch(_0x53fc63){return BPromise[_0x3860('0x1d')](_0x53fc63);}return _0x41ce59[_0x3860('0x1e')]();};}function saveUpdates(_0x22e873,_0x3af33a){return function(_0x20a5b0){if(_0x20a5b0){return _0x20a5b0[_0x3860('0x1f')](_0x22e873)[_0x3860('0x20')](function(_0x1f8891){return _0x1f8891;});}return null;};}function removeEntity(_0x21d179,_0x3f6b04){return function(_0xacd57f){if(_0xacd57f){return _0xacd57f[_0x3860('0x21')]()[_0x3860('0x20')](function(){_0x21d179[_0x3860('0x15')](0xcc)[_0x3860('0x16')]();});}};}function handleEntityNotFound(_0x564efd,_0xfc10a5){return function(_0x133093){if(!_0x133093){_0x564efd[_0x3860('0x14')](0x194);}return _0x133093;};}function handleError(_0x301e03,_0x20bb1e){_0x20bb1e=_0x20bb1e||0x1f4;return function(_0x56a6d1){logger[_0x3860('0x22')](_0x56a6d1['stack']);if(_0x56a6d1['name']){delete _0x56a6d1[_0x3860('0x23')];}_0x301e03[_0x3860('0x15')](_0x20bb1e)['send'](_0x56a6d1);};}exports['index']=function(_0x5f42d5,_0x1b2e4d){var _0x3ebc5b={},_0xb25cc2={},_0x371f3a={'count':0x0,'rows':[]};var _0x9332a5=db[_0x3860('0x24')]['rawAttributes'];_0xb25cc2['model']=_[_0x3860('0x25')](_0x9332a5);_0xb25cc2[_0x3860('0x26')]=_['keys'](_0x5f42d5[_0x3860('0x26')]);_0xb25cc2[_0x3860('0x27')]=_[_0x3860('0x28')](_0xb25cc2[_0x3860('0x29')],_0xb25cc2[_0x3860('0x26')]);_0x3ebc5b['attributes']=_[_0x3860('0x28')](_0xb25cc2[_0x3860('0x29')],qs[_0x3860('0x2a')](_0x5f42d5['query'][_0x3860('0x2a')]));_0x3ebc5b['attributes']=_0x3ebc5b[_0x3860('0x2b')]['length']?_0x3ebc5b[_0x3860('0x2b')]:_0xb25cc2[_0x3860('0x29')];if(!_0x5f42d5[_0x3860('0x26')]['hasOwnProperty'](_0x3860('0x2c'))){_0x3ebc5b[_0x3860('0x1a')]=qs['limit'](_0x5f42d5[_0x3860('0x26')]['limit']);_0x3ebc5b[_0x3860('0x19')]=qs[_0x3860('0x19')](_0x5f42d5[_0x3860('0x26')][_0x3860('0x19')]);}_0x3ebc5b[_0x3860('0x2d')]=qs[_0x3860('0x2e')](_0x5f42d5[_0x3860('0x26')]['sort']);_0x3ebc5b[_0x3860('0x2f')]=qs[_0x3860('0x27')](_['pick'](_0x5f42d5[_0x3860('0x26')],_0xb25cc2[_0x3860('0x27')]));if(_0x5f42d5[_0x3860('0x26')]['filter']){_0x3ebc5b['where']=_[_0x3860('0x30')](_0x3ebc5b[_0x3860('0x2f')],{'$or':_[_0x3860('0x31')](_0x9332a5,function(_0xa921ed){if(_0xa921ed['type']['key']!==_0x3860('0x32')){var _0x40dae8={};_0x40dae8[_0xa921ed[_0x3860('0x33')]]={'$like':'%'+_0x5f42d5[_0x3860('0x26')][_0x3860('0x34')]+'%'};return _0x40dae8;}})});}_0x3ebc5b=_['merge']({},_0x3ebc5b,_0x5f42d5[_0x3860('0x35')]);var _0xbfa744={'where':_0x3ebc5b['where']};return db['SADossier'][_0x3860('0x18')](_0xbfa744)[_0x3860('0x20')](function(_0x295752){_0x371f3a[_0x3860('0x18')]=_0x295752;if(_0x5f42d5[_0x3860('0x26')]['includeAll']){_0x3ebc5b[_0x3860('0x36')]=[{'all':!![]}];}return db['SADossier'][_0x3860('0x37')](_0x3ebc5b);})[_0x3860('0x20')](function(_0x53d443){_0x371f3a[_0x3860('0x38')]=_0x53d443;return _0x371f3a;})[_0x3860('0x20')](respondWithFilteredResult(_0x1b2e4d,_0x3ebc5b))['catch'](handleError(_0x1b2e4d,null));};exports[_0x3860('0x39')]=function(_0xc7d34d,_0x15bd2c){var _0xf346e={'raw':![],'where':{'id':_0xc7d34d[_0x3860('0x3a')]['id']}},_0x4f486e={};_0x4f486e[_0x3860('0x29')]=_[_0x3860('0x25')](db['SADossier'][_0x3860('0x3b')]);_0x4f486e['query']=_[_0x3860('0x25')](_0xc7d34d[_0x3860('0x26')]);_0x4f486e[_0x3860('0x27')]=_[_0x3860('0x28')](_0x4f486e[_0x3860('0x29')],_0x4f486e[_0x3860('0x26')]);_0xf346e['attributes']=_[_0x3860('0x28')](_0x4f486e[_0x3860('0x29')],qs['fields'](_0xc7d34d['query'][_0x3860('0x2a')]));_0xf346e[_0x3860('0x2b')]=_0xf346e['attributes'][_0x3860('0x3c')]?_0xf346e[_0x3860('0x2b')]:_0x4f486e['model'];if(_0xc7d34d[_0x3860('0x26')][_0x3860('0x3d')]){_0xf346e[_0x3860('0x36')]=[{'all':!![]}];}_0xf346e=_[_0x3860('0x30')]({},_0xf346e,_0xc7d34d[_0x3860('0x35')]);return db[_0x3860('0x24')][_0x3860('0x3e')](_0xf346e)[_0x3860('0x20')](handleEntityNotFound(_0x15bd2c,null))[_0x3860('0x20')](respondWithResult(_0x15bd2c,null))[_0x3860('0x3f')](handleError(_0x15bd2c,null));};exports[_0x3860('0x40')]=function(_0x3d20af,_0x270532){return db['SADossier'][_0x3860('0x40')](_0x3d20af['body'],{})[_0x3860('0x20')](respondWithResult(_0x270532,0xc9))[_0x3860('0x3f')](handleError(_0x270532,null));};exports[_0x3860('0x1f')]=function(_0xbad34b,_0x39e2cb){if(_0xbad34b[_0x3860('0x41')]['id']){delete _0xbad34b[_0x3860('0x41')]['id'];}return db[_0x3860('0x24')]['find']({'where':{'id':_0xbad34b[_0x3860('0x3a')]['id']}})[_0x3860('0x20')](handleEntityNotFound(_0x39e2cb,null))[_0x3860('0x20')](saveUpdates(_0xbad34b['body'],null))[_0x3860('0x20')](respondWithResult(_0x39e2cb,null))[_0x3860('0x3f')](handleError(_0x39e2cb,null));};exports[_0x3860('0x21')]=function(_0x3dc957,_0x5ed2db){return db['SADossier'][_0x3860('0x3e')]({'where':{'id':_0x3dc957['params']['id']}})[_0x3860('0x20')](handleEntityNotFound(_0x5ed2db,null))[_0x3860('0x20')](removeEntity(_0x5ed2db,null))[_0x3860('0x3f')](handleError(_0x5ed2db,null));};exports['describe']=function(_0x29c52d,_0x5a019a){return db[_0x3860('0x24')]['describe']()[_0x3860('0x20')](respondWithResult(_0x5a019a,null))[_0x3860('0x3f')](handleError(_0x5a019a,null));}; \ No newline at end of file diff --git a/server/api/saDossier/saDossier.model.js b/server/api/saDossier/saDossier.model.js index a3abba8..1125b03 100644 --- a/server/api/saDossier/saDossier.model.js +++ b/server/api/saDossier/saDossier.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['sa_dossiers','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./saDossier.attributes','exports','SADossier'];(function(_0x59a611,_0x20ab19){var _0xb614ec=function(_0x353b11){while(--_0x353b11){_0x59a611['push'](_0x59a611['shift']());}};_0xb614ec(++_0x20ab19);}(_0x34e8,0x12c));var _0x834e=function(_0x3a0ab8,_0x250283){_0x3a0ab8=_0x3a0ab8-0x0;var _0x247036=_0x34e8[_0x3a0ab8];return _0x247036;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['sa_dossiers','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./saDossier.attributes','exports','SADossier'];(function(_0x2dd093,_0x386beb){var _0x46fee5=function(_0x4c7050){while(--_0x4c7050){_0x2dd093['push'](_0x2dd093['shift']());}};_0x46fee5(++_0x386beb);}(_0x34e8,0x12c));var _0x834e=function(_0x55d81d,_0x3f6922){_0x55d81d=_0x55d81d-0x0;var _0x4f2562=_0x34e8[_0x55d81d];return _0x4f2562;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saDossier/saDossier.rpc.js b/server/api/saDossier/saDossier.rpc.js index e838b18..5acd750 100644 --- a/server/api/saDossier/saDossier.rpc.js +++ b/server/api/saDossier/saDossier.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9c9=['info','SADossier,\x20%s,\x20%s','request\x20sent','debug','SADossier,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then'];(function(_0x27dc5e,_0x114644){var _0x2dfee3=function(_0x1d0e8f){while(--_0x1d0e8f){_0x27dc5e['push'](_0x27dc5e['shift']());}};_0x2dfee3(++_0x114644);}(_0xa9c9,0x81));var _0x9a9c=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xa9c9[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0x9a9c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9a9c('0x1'));var rs=require(_0x9a9c('0x2'));var fs=require('fs');var Redis=require(_0x9a9c('0x3'));var db=require(_0x9a9c('0x4'))['db'];var utils=require(_0x9a9c('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9a9c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9a9c('0x7')][_0x9a9c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf0aa83,_0x3fed9f,_0x1d3cd6){return new BPromise(function(_0x309b3a,_0x6547e8){return client[_0x9a9c('0x9')](_0xf0aa83,_0x1d3cd6)[_0x9a9c('0xa')](function(_0x185feb){logger[_0x9a9c('0xb')](_0x9a9c('0xc'),_0x3fed9f,_0x9a9c('0xd'));logger[_0x9a9c('0xe')](_0x9a9c('0xf'),_0x3fed9f,_0x9a9c('0xd'),JSON[_0x9a9c('0x10')](_0x185feb));if(_0x185feb[_0x9a9c('0x11')]){if(_0x185feb[_0x9a9c('0x11')][_0x9a9c('0x12')]===0x1f4){logger[_0x9a9c('0x11')](_0x9a9c('0xc'),_0x3fed9f,_0x185feb['error'][_0x9a9c('0x13')]);return _0x6547e8(_0x185feb[_0x9a9c('0x11')][_0x9a9c('0x13')]);}logger['error']('SADossier,\x20%s,\x20%s',_0x3fed9f,_0x185feb['error']['message']);return _0x309b3a(_0x185feb[_0x9a9c('0x11')][_0x9a9c('0x13')]);}else{logger[_0x9a9c('0xb')](_0x9a9c('0xc'),_0x3fed9f,'request\x20sent');_0x309b3a(_0x185feb['result']['message']);}})['catch'](function(_0x12a153){logger[_0x9a9c('0x11')](_0x9a9c('0xc'),_0x3fed9f,_0x12a153);_0x6547e8(_0x12a153);});});} \ No newline at end of file +var _0xbcbd=['../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SADossier,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5ed051,_0x4f1144){var _0x17b687=function(_0x525cf4){while(--_0x525cf4){_0x5ed051['push'](_0x5ed051['shift']());}};_0x17b687(++_0x4f1144);}(_0xbcbd,0xd7));var _0xdbcb=function(_0x102caf,_0x363913){_0x102caf=_0x102caf-0x0;var _0x35a33f=_0xbcbd[_0x102caf];return _0x35a33f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdbcb('0x0'));var BPromise=require(_0xdbcb('0x1'));var rs=require(_0xdbcb('0x2'));var fs=require('fs');var Redis=require(_0xdbcb('0x3'));var db=require(_0xdbcb('0x4'))['db'];var utils=require(_0xdbcb('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xdbcb('0x6'));var jayson=require(_0xdbcb('0x7'));var client=jayson[_0xdbcb('0x8')][_0xdbcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x84d84d,_0x94b57a,_0xa98154){return new BPromise(function(_0x20eae8,_0xae48a0){return client[_0xdbcb('0xa')](_0x84d84d,_0xa98154)[_0xdbcb('0xb')](function(_0x18af71){logger[_0xdbcb('0xc')](_0xdbcb('0xd'),_0x94b57a,_0xdbcb('0xe'));logger[_0xdbcb('0xf')]('SADossier,\x20%s,\x20%s,\x20%s',_0x94b57a,_0xdbcb('0xe'),JSON[_0xdbcb('0x10')](_0x18af71));if(_0x18af71[_0xdbcb('0x11')]){if(_0x18af71[_0xdbcb('0x11')][_0xdbcb('0x12')]===0x1f4){logger[_0xdbcb('0x11')](_0xdbcb('0xd'),_0x94b57a,_0x18af71[_0xdbcb('0x11')][_0xdbcb('0x13')]);return _0xae48a0(_0x18af71[_0xdbcb('0x11')][_0xdbcb('0x13')]);}logger['error'](_0xdbcb('0xd'),_0x94b57a,_0x18af71[_0xdbcb('0x11')][_0xdbcb('0x13')]);return _0x20eae8(_0x18af71['error'][_0xdbcb('0x13')]);}else{logger[_0xdbcb('0xc')](_0xdbcb('0xd'),_0x94b57a,_0xdbcb('0xe'));_0x20eae8(_0x18af71[_0xdbcb('0x14')][_0xdbcb('0x13')]);}})[_0xdbcb('0x15')](function(_0x3f4cda){logger['error'](_0xdbcb('0xd'),_0x94b57a,_0x3f4cda);_0xae48a0(_0x3f4cda);});});} \ No newline at end of file diff --git a/server/api/saInvoice/index.js b/server/api/saInvoice/index.js index 9fd3b31..9b7a441 100644 --- a/server/api/saInvoice/index.js +++ b/server/api/saInvoice/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa97b=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saInvoice.controller','isAuthenticated','get','/describe','describe','/getInvoicesNumberByYear','getInvoicesNumberByYear','getInvoicesRevenueByQuarter','/:id','show','/:id/download','post','create','/:id/automaticInvoiceCreditnote','put','update','delete','destroy','exports','multer'];(function(_0x35dfe6,_0x4244fa){var _0x59651c=function(_0x3ff137){while(--_0x3ff137){_0x35dfe6['push'](_0x35dfe6['shift']());}};_0x59651c(++_0x4244fa);}(_0xa97b,0x179));var _0xba97=function(_0x13c4ed,_0x3d1b61){_0x13c4ed=_0x13c4ed-0x0;var _0x7713ac=_0xa97b[_0x13c4ed];return _0x7713ac;};'use strict';var multer=require(_0xba97('0x0'));var util=require(_0xba97('0x1'));var path=require(_0xba97('0x2'));var timeout=require('connect-timeout');var express=require(_0xba97('0x3'));var router=express[_0xba97('0x4')]();var auth=require(_0xba97('0x5'));var interaction=require(_0xba97('0x6'));var config=require(_0xba97('0x7'));var controller=require(_0xba97('0x8'));router['get']('/',auth[_0xba97('0x9')](),controller['index']);router[_0xba97('0xa')](_0xba97('0xb'),auth['isAuthenticated'](),controller[_0xba97('0xc')]);router['get'](_0xba97('0xd'),auth['isAuthenticated'](),controller[_0xba97('0xe')]);router['get']('/getInvoicesRevenueByQuarter',auth[_0xba97('0x9')](),controller[_0xba97('0xf')]);router[_0xba97('0xa')](_0xba97('0x10'),auth[_0xba97('0x9')](),controller[_0xba97('0x11')]);router[_0xba97('0xa')](_0xba97('0x12'),auth[_0xba97('0x9')](),controller['getInvoicePDF']);router[_0xba97('0x13')]('/',auth['isAuthenticated'](),controller[_0xba97('0x14')]);router['post'](_0xba97('0x15'),auth[_0xba97('0x9')](),controller['automaticInvoiceCreditnote']);router[_0xba97('0x16')]('/:id',auth[_0xba97('0x9')](),controller[_0xba97('0x17')]);router[_0xba97('0x18')](_0xba97('0x10'),auth[_0xba97('0x9')](),controller[_0xba97('0x19')]);module[_0xba97('0x1a')]=router; \ No newline at end of file +var _0x867f=['/:id','show','/:id/download','getInvoicePDF','post','create','automaticInvoiceCreditnote','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./saInvoice.controller','get','index','/describe','isAuthenticated','describe','/getInvoicesNumberByYear','getInvoicesNumberByYear','/getInvoicesRevenueByQuarter','getInvoicesRevenueByQuarter'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x867f,0x1f1));var _0xf867=function(_0x59eacf,_0x56ec4a){_0x59eacf=_0x59eacf-0x0;var _0x5d74f2=_0x867f[_0x59eacf];return _0x5d74f2;};'use strict';var multer=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var path=require('path');var timeout=require(_0xf867('0x2'));var express=require('express');var router=express[_0xf867('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf867('0x4'));var config=require(_0xf867('0x5'));var controller=require(_0xf867('0x6'));router[_0xf867('0x7')]('/',auth['isAuthenticated'](),controller[_0xf867('0x8')]);router[_0xf867('0x7')](_0xf867('0x9'),auth[_0xf867('0xa')](),controller[_0xf867('0xb')]);router[_0xf867('0x7')](_0xf867('0xc'),auth[_0xf867('0xa')](),controller[_0xf867('0xd')]);router['get'](_0xf867('0xe'),auth['isAuthenticated'](),controller[_0xf867('0xf')]);router[_0xf867('0x7')](_0xf867('0x10'),auth['isAuthenticated'](),controller[_0xf867('0x11')]);router[_0xf867('0x7')](_0xf867('0x12'),auth[_0xf867('0xa')](),controller[_0xf867('0x13')]);router[_0xf867('0x14')]('/',auth[_0xf867('0xa')](),controller[_0xf867('0x15')]);router[_0xf867('0x14')]('/:id/automaticInvoiceCreditnote',auth[_0xf867('0xa')](),controller[_0xf867('0x16')]);router['put'](_0xf867('0x10'),auth[_0xf867('0xa')](),controller[_0xf867('0x17')]);router[_0xf867('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xf867('0x19')]);module[_0xf867('0x1a')]=router; \ No newline at end of file diff --git a/server/api/saInvoice/saInvoice.attributes.js b/server/api/saInvoice/saInvoice.attributes.js index dc78797..b0640ae 100644 --- a/server/api/saInvoice/saInvoice.attributes.js +++ b/server/api/saInvoice/saInvoice.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x89c2=['INTEGER','DECIMAL','BOOLEAN','DATE','sequelize','STRING'];(function(_0x845b9c,_0x112dd8){var _0x2a7aa6=function(_0x28d943){while(--_0x28d943){_0x845b9c['push'](_0x845b9c['shift']());}};_0x2a7aa6(++_0x112dd8);}(_0x89c2,0x184));var _0x289c=function(_0x44a9fb,_0x5231f3){_0x44a9fb=_0x44a9fb-0x0;var _0x3b296e=_0x89c2[_0x44a9fb];return _0x3b296e;};'use strict';var Sequelize=require(_0x289c('0x0'));module['exports']={'name':{'type':Sequelize[_0x289c('0x1')]},'note':{'type':Sequelize['TEXT']},'agentFullname':{'type':Sequelize[_0x289c('0x1')]},'status':{'type':Sequelize['TEXT']},'companyName':{'type':Sequelize[_0x289c('0x1')],'allowNull':![]},'companyId':{'type':Sequelize[_0x289c('0x2')],'allowNull':![]},'paid':{'type':Sequelize[_0x289c('0x2')],'defaultValue':0x0},'discount':{'type':Sequelize[_0x289c('0x3')](0xd,0x4)},'receivingStreet':{'type':Sequelize[_0x289c('0x1')]},'receivingPostalCode':{'type':Sequelize['STRING']},'receivingCity':{'type':Sequelize[_0x289c('0x1')]},'receivingCountry':{'type':Sequelize['STRING']},'receivingISOCode':{'type':Sequelize[_0x289c('0x1')](0x3)},'receivingFiscalCode':{'type':Sequelize[_0x289c('0x1')](0x32)},'receivingPIVA':{'type':Sequelize[_0x289c('0x1')](0x32)},'receivingSDICode':{'type':Sequelize[_0x289c('0x1')](0x15)},'receivingFiscalMessage':{'type':Sequelize[_0x289c('0x1')](0x3e8)},'receivingExpiryDay':{'type':Sequelize['INTEGER']},'receivingEurope':{'type':Sequelize[_0x289c('0x4')]},'receivingSocCap':{'type':Sequelize[_0x289c('0x1')](0xff)},'issuerName':{'type':Sequelize['STRING']},'issuerStreet':{'type':Sequelize[_0x289c('0x1')]},'issuerPostalCode':{'type':Sequelize['STRING']},'issuerCity':{'type':Sequelize[_0x289c('0x1')]},'issuerCountry':{'type':Sequelize[_0x289c('0x1')]},'issuerISOCode':{'type':Sequelize[_0x289c('0x1')](0x3)},'issuerFiscalCode':{'type':Sequelize['STRING'](0x32)},'issuerPIVA':{'type':Sequelize[_0x289c('0x1')](0x32)},'issuerSDICode':{'type':Sequelize[_0x289c('0x1')](0x15)},'issuerFiscalMessage':{'type':Sequelize[_0x289c('0x1')](0x3e8)},'issuerExpiryDay':{'type':Sequelize[_0x289c('0x2')]},'issuerEurope':{'type':Sequelize['BOOLEAN']},'issuerSocCap':{'type':Sequelize[_0x289c('0x1')](0xff)},'issuerBankAccount':{'type':Sequelize[_0x289c('0x1')](0xff)},'issuerBankName':{'type':Sequelize[_0x289c('0x1')](0xff)},'issuerBankStreet':{'type':Sequelize[_0x289c('0x1')]},'issuerBankPostalCode':{'type':Sequelize[_0x289c('0x1')]},'issuerBankCity':{'type':Sequelize[_0x289c('0x1')]},'issuerBankCountry':{'type':Sequelize[_0x289c('0x1')]},'issuerBankBICSWIFT':{'type':Sequelize[_0x289c('0x1')]},'issuerBankIBAN':{'type':Sequelize[_0x289c('0x1')]},'issuerPhone':{'type':Sequelize[_0x289c('0x1')]},'issuerFax':{'type':Sequelize[_0x289c('0x1')]},'issuerEmail':{'type':Sequelize['STRING']},'issuerWeb':{'type':Sequelize[_0x289c('0x1')]},'issuerABI':{'type':Sequelize[_0x289c('0x1')]},'issuerCAB':{'type':Sequelize['STRING']},'issuerPayPal':{'type':Sequelize[_0x289c('0x1')]},'startDate':{'type':Sequelize[_0x289c('0x5')]},'endDate':{'type':Sequelize[_0x289c('0x5')]},'number':{'type':Sequelize[_0x289c('0x2')]},'beginningCompetence':{'type':Sequelize[_0x289c('0x5')]},'endCompetence':{'type':Sequelize['DATE']},'clientCode':{'type':Sequelize[_0x289c('0x1')]}}; \ No newline at end of file +var _0x00cd=['STRING','TEXT','INTEGER','BOOLEAN','DATE','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x00cd,0x1cd));var _0xd00c=function(_0x5ebc04,_0x14a363){_0x5ebc04=_0x5ebc04-0x0;var _0x17845c=_0x00cd[_0x5ebc04];return _0x17845c;};'use strict';var Sequelize=require(_0xd00c('0x0'));module['exports']={'name':{'type':Sequelize[_0xd00c('0x1')]},'note':{'type':Sequelize[_0xd00c('0x2')]},'agentFullname':{'type':Sequelize[_0xd00c('0x1')]},'status':{'type':Sequelize['TEXT']},'companyName':{'type':Sequelize[_0xd00c('0x1')],'allowNull':![]},'companyId':{'type':Sequelize[_0xd00c('0x3')],'allowNull':![]},'paid':{'type':Sequelize[_0xd00c('0x3')],'defaultValue':0x0},'discount':{'type':Sequelize['DECIMAL'](0xd,0x4)},'receivingStreet':{'type':Sequelize[_0xd00c('0x1')]},'receivingPostalCode':{'type':Sequelize[_0xd00c('0x1')]},'receivingCity':{'type':Sequelize[_0xd00c('0x1')]},'receivingCountry':{'type':Sequelize[_0xd00c('0x1')]},'receivingISOCode':{'type':Sequelize['STRING'](0x3)},'receivingFiscalCode':{'type':Sequelize[_0xd00c('0x1')](0x32)},'receivingPIVA':{'type':Sequelize['STRING'](0x32)},'receivingSDICode':{'type':Sequelize[_0xd00c('0x1')](0x15)},'receivingFiscalMessage':{'type':Sequelize[_0xd00c('0x1')](0x3e8)},'receivingExpiryDay':{'type':Sequelize[_0xd00c('0x3')]},'receivingEurope':{'type':Sequelize[_0xd00c('0x4')]},'receivingSocCap':{'type':Sequelize[_0xd00c('0x1')](0xff)},'issuerName':{'type':Sequelize[_0xd00c('0x1')]},'issuerStreet':{'type':Sequelize[_0xd00c('0x1')]},'issuerPostalCode':{'type':Sequelize['STRING']},'issuerCity':{'type':Sequelize[_0xd00c('0x1')]},'issuerCountry':{'type':Sequelize[_0xd00c('0x1')]},'issuerISOCode':{'type':Sequelize[_0xd00c('0x1')](0x3)},'issuerFiscalCode':{'type':Sequelize['STRING'](0x32)},'issuerPIVA':{'type':Sequelize[_0xd00c('0x1')](0x32)},'issuerSDICode':{'type':Sequelize[_0xd00c('0x1')](0x15)},'issuerFiscalMessage':{'type':Sequelize[_0xd00c('0x1')](0x3e8)},'issuerExpiryDay':{'type':Sequelize[_0xd00c('0x3')]},'issuerEurope':{'type':Sequelize[_0xd00c('0x4')]},'issuerSocCap':{'type':Sequelize['STRING'](0xff)},'issuerBankAccount':{'type':Sequelize[_0xd00c('0x1')](0xff)},'issuerBankName':{'type':Sequelize['STRING'](0xff)},'issuerBankStreet':{'type':Sequelize[_0xd00c('0x1')]},'issuerBankPostalCode':{'type':Sequelize['STRING']},'issuerBankCity':{'type':Sequelize[_0xd00c('0x1')]},'issuerBankCountry':{'type':Sequelize[_0xd00c('0x1')]},'issuerBankBICSWIFT':{'type':Sequelize[_0xd00c('0x1')]},'issuerBankIBAN':{'type':Sequelize[_0xd00c('0x1')]},'issuerPhone':{'type':Sequelize['STRING']},'issuerFax':{'type':Sequelize[_0xd00c('0x1')]},'issuerEmail':{'type':Sequelize[_0xd00c('0x1')]},'issuerWeb':{'type':Sequelize[_0xd00c('0x1')]},'issuerABI':{'type':Sequelize[_0xd00c('0x1')]},'issuerCAB':{'type':Sequelize['STRING']},'issuerPayPal':{'type':Sequelize[_0xd00c('0x1')]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'number':{'type':Sequelize[_0xd00c('0x3')]},'beginningCompetence':{'type':Sequelize['DATE']},'endCompetence':{'type':Sequelize[_0xd00c('0x5')]},'clientCode':{'type':Sequelize[_0xd00c('0x1')]}}; \ No newline at end of file diff --git a/server/api/saInvoice/saInvoice.controller.js b/server/api/saInvoice/saInvoice.controller.js index 2f0da6f..b1b9225 100644 --- a/server/api/saInvoice/saInvoice.controller.js +++ b/server/api/saInvoice/saInvoice.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf1f4=['Articolo','Description','Descrizione','Hrs/Qty','Ore/Qta','Unit\x20Price','Prezzo\x20Unitario','Sub\x20Total','Sub\x20Totale','Discount','Sconto','Imponibile','Tasse','Total','Totale','Please\x20send\x20PAYMENT\x20to','Conto\x20intestato\x20a','Nome\x20banca','Bank\x20Address','Indirizzo\x20banca','ABI','CAB','SWIF','IBAN','Pay\x20via\x20Paypal','Paga\x20con\x20Paypal','Thank\x20you\x20for\x20your\x20business.\x20We\x20do\x20expect\x20payment\x20by\x20',',\x20so\x20please\x20do\x20so\x20within\x20this\x20time.','\x20quindi\x20vi\x20preghiamo\x20di\x20provvedere\x20entro\x20tale\x20termine.','receivingCountry','','\x22\x20width=\x22180\x22>','','\x20%s
','issuerName','issuerStreet','issuerPostalCode','\x20%s','-\x20%s\x20
','issuerCountry','phone',':\x20%s
','issuerPhone','fax','email','issuerFiscalCode','sdi','issuerSocCap','%s','companyName','receivingStreet','%s\x20-\x20','receivingPostalCode','receivingCity','','receivingFiscalCode','','','number','%s,\x20','issuerCity','startDate','DD/MM/YYYY','%s\x20','add','duedate',':\x20%s','','','','item','description','','hrsqty','subtotal','netPrice','discount','tax','quantity','%s','productName','productDescription','%d','','toFixed','€','isNil','indexOf','split\x20payment','','','\x20','','total','nettopay','','\x20',' ','','\x20%s\x20','receivingFiscalMessage','replace','fromCharCode','','','sendpayment',':','issuerBankAccount',':\x20','','bankname','issuerBankName','bankaddress','issuerBankStreet','issuerBankPostalCode','\x20-\x20','issuerABI','issuerCAB','bic','swif','issuerBankBICSWIFT','iban','issuerBankIBAN','issuerPayPal','','thank1','','paid','\x20','','log','toFile','TCL:\x20exports.getInvoicePDF\x20->\x20saveTo,\x20fileName','err','foldername','getInvoicesNumberByYear','years','select','from','sa_invoices','YEAR(startDate)','invoiceYear','MONTH(startDate)','invoiceMonth','YEAR(startDate)\x20IN\x20(','group','QueryTypes','getInvoicesRevenueByQuarter','sa_invoice_details','said','month','year','sum(said.netPrice\x20*\x20said.quantity)','monthTotal','sai','sai.id\x20=\x20said.InvoiceId','addInvoiceCreditnoteDetail->>','companyId','productCode','typeName','pricelistName','priceListId','note','subscriptionId','subscriptionName','subscriptionMonthly','SACreditNoteDetail','automaticInvoiceCreditnote','transaction','SACreditNote','all','WARNING','No\x20product\x20to\x20assign\x20credit\x20note.\x20Credit\x20note\x20not\x20created!!\x20','TCL:\x20exports.automaticInvoiceCreditnote\x20->\x20err','SequelizeUniqueConstraintError','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','SAInvoice','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','map','type','VIRTUAL','field','filter','merge','include','catch','model','rawAttributes','length','includeAll','options','create','sequelize','Sequelize','Transaction','ISOLATION_LEVELS','SERIALIZABLE','body','find','params','describe','getInvoicePDF','unix','toString','join','server','tmp','logos','root','images','paid-invoice.png','format','Invoice_%s-%s.pdf','invoice','SAInvoiceDetail','findAll','details','portrait','1cm','{{page}}/{{pages}}','footer','contents','','issuerWeb','','mkdirSync','\x20\x20body{font-family:\x20Verdana,\x20Geneva,\x20Tahoma,\x20sans-serif;}.itemTabTitle{background-color:\x20lightgray;\x20height:\x2040px;}.issuerInfo{color:\x20lightgray;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;\x20font-size:\x2012px;}.issuerData{font-weight:\x20normal}.issuerFiled{font-weight:\x20bold;\x20font-size:\x2010px;\x20padding-left:\x2010px;}.issuerFiledWeb{font-weight:\x20bold;\x20text-align:\x20center;}.receiperInfo{text-align:\x20right;\x20font-size:\x2012px}.receiperCompanyName{font-weight:\x20bold;\x20padding-top:\x2010px;\x20padding-bottom:\x2015px;\x20font-size:\x2016px}.reciperFiscalInfo{padding-top:\x205px;\x20padding-bottom:\x205px;}table.center{margin-left:\x20auto;\x20margin-right:\x20auto;\x20width:\x2090%;}.total{background-color:\x20lightgray;\x20font-size:\x2018px;\x20font-weight:\x20bold;}.totalText{background-color:\x20lightgray;\x20text-align:\x20right;\x20font-size:\x2016px;\x20padding-right:\x2010px;}.totalEmpty{background-color:\x20#ffffff;}.invoiceNumber{font-weight:\x20bolder;\x20font-size:\x2024px;\x20padding-bottom:\x2020px;}.invoiceNumber{font-weight:\x20bold;\x20font-size:\x2018px;}.createdDate{font-size:\x2014px;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;}.duedDate{font-size:\x2014px;\x20padding-bottom:\x2010px;}.TFtable{width:\x20100%;\x20font-size:\x2010px;\x20border-collapse:\x20collapse;}.TFtable\x20td{padding:\x207px;}.TFtable\x20tr:nth-child(even){background:\x20#ffffff;}.TFtable\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.numberRight{text-align:\x20right;}.numberCenter{text-align:\x20center}.currency{text-align:\x20left;}table.roundedCorners{border:\x202px\x20solid\x20lightgray;\x20border-radius:\x205px;\x20border-spacing:\x200;\x20width:\x20100%;\x20font-size:\x2010px;}table.roundedCorners\x20td,\x20table.roundedCorners\x20th{border-bottom:\x201px\x20solid\x20lightgray;\x20padding:\x2010px;}table.roundedCorners\x20tr:last-child\x20>\x20td{border-bottom:\x20none;}table.roundedCorners\x20tr:nth-child(even){background:\x20#ffffff;}table.roundedCorners\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.lex{padding-left:\x2010px;font-size:\x2010px;padding-bottom:\x2020px;}.divTotal{float:\x20right;\x20border-radius:\x205px;\x20border:\x202px\x20solid\x20lightgray;\x20padding:\x2010px;\x20margin-top:30px;}.itemTotal{width:\x20200px;\x20line-height:\x2030px;}.tabTotal{border-collapse:\x20collapse;}','','Email','VAT\x20number','P.IVA','Tax\x20code','I.S.\x20code','Codice\x20S.D.I.','Soc.Cap.\x20fp','Cap.Soc.\x20iv','Invoice','Fattura','Proforma','Credit\x20note','Nota\x20di\x20credito','Due\x20date','Scadenza'];(function(_0x2dc81b,_0x2063ae){var _0x3a2946=function(_0x398317){while(--_0x398317){_0x2dc81b['push'](_0x2dc81b['shift']());}};_0x3a2946(++_0x2063ae);}(_0xf1f4,0xb0));var _0x4f1f=function(_0x39198e,_0x1e28d4){_0x39198e=_0x39198e-0x0;var _0x469240=_0xf1f4[_0x39198e];return _0x469240;};'use strict';var pdf=require(_0x4f1f('0x0'));var emlformat=require(_0x4f1f('0x1'));var rimraf=require(_0x4f1f('0x2'));var zipdir=require(_0x4f1f('0x3'));var jsonpatch=require(_0x4f1f('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4f1f('0x5'));var Mustache=require(_0x4f1f('0x6'));var util=require('util');var path=require(_0x4f1f('0x7'));var sox=require(_0x4f1f('0x8'));var csv=require(_0x4f1f('0x9'));var ejs=require(_0x4f1f('0xa'));var fs=require('fs');var _=require(_0x4f1f('0xb'));var squel=require(_0x4f1f('0xc'));var crypto=require(_0x4f1f('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4f1f('0xe'));var authService=require(_0x4f1f('0xf'));var qs=require(_0x4f1f('0x10'));var hardwareService=require(_0x4f1f('0x11'));var logger=require(_0x4f1f('0x12'))(_0x4f1f('0x13'));var utils=require(_0x4f1f('0x14'));var config=require(_0x4f1f('0x15'));var db=require(_0x4f1f('0x16'))['db'];function respondWithStatusCode(_0x24f21a,_0x3732e1){_0x3732e1=_0x3732e1||0xcc;return function(_0x2ac6e3){if(_0x2ac6e3){return _0x24f21a[_0x4f1f('0x17')](_0x3732e1);}return _0x24f21a[_0x4f1f('0x18')](_0x3732e1)['end']();};}function respondWithResult(_0x2920fd,_0x2a17f7){_0x2a17f7=_0x2a17f7||0xc8;return function(_0x35e838){if(_0x35e838){return _0x2920fd[_0x4f1f('0x18')](_0x2a17f7)[_0x4f1f('0x19')](_0x35e838);}};}function respondWithFilteredResult(_0x9d1c19,_0x1189cc){return function(_0x770c11){if(_0x770c11){var _0x950622=_0x770c11[_0x4f1f('0x1a')],_0x930f9=_0x1189cc[_0x4f1f('0x1b')],_0x349eac=_0x1189cc[_0x4f1f('0x1b')]+_0x1189cc[_0x4f1f('0x1c')],_0x36f6e9;if(_0x349eac>=_0x950622){_0x349eac=_0x950622;_0x36f6e9=0xc8;}else{_0x36f6e9=0xce;}_0x9d1c19['status'](_0x36f6e9);return _0x9d1c19['set'](_0x4f1f('0x1d'),_0x930f9+'-'+_0x349eac+'/'+_0x950622)[_0x4f1f('0x19')](_0x770c11);}return null;};}function patchUpdates(_0x3c9b3d){return function(_0x2e6871){try{jsonpatch[_0x4f1f('0x1e')](_0x2e6871,_0x3c9b3d,!![]);}catch(_0x2d0bd5){return BPromise[_0x4f1f('0x1f')](_0x2d0bd5);}return _0x2e6871['save']();};}function saveUpdates(_0x53c57f,_0x865f81){return function(_0x3f5351){if(_0x3f5351){return _0x3f5351[_0x4f1f('0x20')](_0x53c57f)[_0x4f1f('0x21')](function(_0x9ab2ed){return _0x9ab2ed;});}return null;};}function removeEntity(_0x3fab3,_0x175bf0){return function(_0x16da0e){if(_0x16da0e){return _0x16da0e[_0x4f1f('0x22')]()[_0x4f1f('0x21')](function(){_0x3fab3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x537f20,_0x33cd67){return function(_0x3084dd){if(!_0x3084dd){_0x537f20[_0x4f1f('0x17')](0x194);}return _0x3084dd;};}function handleError(_0x141581,_0xe409fd){_0xe409fd=_0xe409fd||0x1f4;return function(_0x501d11){logger[_0x4f1f('0x23')](_0x501d11[_0x4f1f('0x24')]);if(_0x501d11['name']){delete _0x501d11[_0x4f1f('0x25')];}_0x141581[_0x4f1f('0x18')](_0xe409fd)[_0x4f1f('0x26')](_0x501d11);};}exports['index']=function(_0x9485ec,_0x268e1a){var _0x1c8e2c={},_0x46b5c9={},_0x21696b={'count':0x0,'rows':[]};var _0x3acc23=db[_0x4f1f('0x27')]['rawAttributes'];_0x46b5c9['model']=_[_0x4f1f('0x28')](_0x3acc23);_0x46b5c9[_0x4f1f('0x29')]=_['keys'](_0x9485ec[_0x4f1f('0x29')]);_0x46b5c9[_0x4f1f('0x2a')]=_[_0x4f1f('0x2b')](_0x46b5c9['model'],_0x46b5c9[_0x4f1f('0x29')]);_0x1c8e2c[_0x4f1f('0x2c')]=_[_0x4f1f('0x2b')](_0x46b5c9['model'],qs[_0x4f1f('0x2d')](_0x9485ec[_0x4f1f('0x29')]['fields']));_0x1c8e2c['attributes']=_0x1c8e2c[_0x4f1f('0x2c')]['length']?_0x1c8e2c[_0x4f1f('0x2c')]:_0x46b5c9['model'];if(!_0x9485ec['query'][_0x4f1f('0x2e')](_0x4f1f('0x2f'))){_0x1c8e2c['limit']=qs[_0x4f1f('0x1c')](_0x9485ec[_0x4f1f('0x29')]['limit']);_0x1c8e2c[_0x4f1f('0x1b')]=qs[_0x4f1f('0x1b')](_0x9485ec[_0x4f1f('0x29')][_0x4f1f('0x1b')]);}_0x1c8e2c[_0x4f1f('0x30')]=qs[_0x4f1f('0x31')](_0x9485ec['query'][_0x4f1f('0x31')]);_0x1c8e2c[_0x4f1f('0x32')]=qs[_0x4f1f('0x2a')](_['pick'](_0x9485ec[_0x4f1f('0x29')],_0x46b5c9[_0x4f1f('0x2a')]));if(_0x9485ec[_0x4f1f('0x29')]['filter']){_0x1c8e2c['where']=_['merge'](_0x1c8e2c[_0x4f1f('0x32')],{'$or':_[_0x4f1f('0x33')](_0x3acc23,function(_0x1110f2){if(_0x1110f2[_0x4f1f('0x34')]['key']!==_0x4f1f('0x35')){var _0x299b5d={};_0x299b5d[_0x1110f2[_0x4f1f('0x36')]]={'$like':'%'+_0x9485ec['query'][_0x4f1f('0x37')]+'%'};return _0x299b5d;}})});}_0x1c8e2c=_[_0x4f1f('0x38')]({},_0x1c8e2c,_0x9485ec['options']);var _0x4f7fec={'where':_0x1c8e2c['where']};return db[_0x4f1f('0x27')][_0x4f1f('0x1a')](_0x4f7fec)[_0x4f1f('0x21')](function(_0x1c4e9d){_0x21696b[_0x4f1f('0x1a')]=_0x1c4e9d;if(_0x9485ec[_0x4f1f('0x29')]['includeAll']){_0x1c8e2c[_0x4f1f('0x39')]=[{'all':!![]}];}return db[_0x4f1f('0x27')]['findAll'](_0x1c8e2c);})[_0x4f1f('0x21')](function(_0x4a6b51){_0x21696b['rows']=_0x4a6b51;return _0x21696b;})[_0x4f1f('0x21')](respondWithFilteredResult(_0x268e1a,_0x1c8e2c))[_0x4f1f('0x3a')](handleError(_0x268e1a,null));};exports['show']=function(_0x4b8875,_0x404147){var _0x403dd3={'raw':![],'where':{'id':_0x4b8875['params']['id']}},_0x836ed4={};_0x836ed4[_0x4f1f('0x3b')]=_[_0x4f1f('0x28')](db[_0x4f1f('0x27')][_0x4f1f('0x3c')]);_0x836ed4[_0x4f1f('0x29')]=_[_0x4f1f('0x28')](_0x4b8875[_0x4f1f('0x29')]);_0x836ed4['filters']=_['intersection'](_0x836ed4[_0x4f1f('0x3b')],_0x836ed4['query']);_0x403dd3['attributes']=_[_0x4f1f('0x2b')](_0x836ed4[_0x4f1f('0x3b')],qs['fields'](_0x4b8875[_0x4f1f('0x29')]['fields']));_0x403dd3['attributes']=_0x403dd3[_0x4f1f('0x2c')][_0x4f1f('0x3d')]?_0x403dd3[_0x4f1f('0x2c')]:_0x836ed4[_0x4f1f('0x3b')];if(_0x4b8875['query'][_0x4f1f('0x3e')]){_0x403dd3[_0x4f1f('0x39')]=[{'all':!![]}];}_0x403dd3=_['merge']({},_0x403dd3,_0x4b8875[_0x4f1f('0x3f')]);return db[_0x4f1f('0x27')]['find'](_0x403dd3)['then'](handleEntityNotFound(_0x404147,null))[_0x4f1f('0x21')](respondWithResult(_0x404147,null))[_0x4f1f('0x3a')](handleError(_0x404147,null));};exports[_0x4f1f('0x40')]=function(_0x2dcbad,_0x4d5590){return db[_0x4f1f('0x41')]['transaction']({'isolationLevel':db[_0x4f1f('0x42')][_0x4f1f('0x43')][_0x4f1f('0x44')][_0x4f1f('0x45')]},function(_0x5ebc77){return db[_0x4f1f('0x27')]['create'](_0x2dcbad[_0x4f1f('0x46')],{'transaction':_0x5ebc77});})[_0x4f1f('0x21')](respondWithResult(_0x4d5590,0xc9))[_0x4f1f('0x3a')](handleError(_0x4d5590,null));};exports['update']=function(_0x2823f4,_0xf6b9e3){if(_0x2823f4[_0x4f1f('0x46')]['id']){delete _0x2823f4['body']['id'];}return db[_0x4f1f('0x27')][_0x4f1f('0x47')]({'where':{'id':_0x2823f4['params']['id']}})['then'](handleEntityNotFound(_0xf6b9e3,null))[_0x4f1f('0x21')](saveUpdates(_0x2823f4['body'],null))[_0x4f1f('0x21')](respondWithResult(_0xf6b9e3,null))[_0x4f1f('0x3a')](handleError(_0xf6b9e3,null));};exports['destroy']=function(_0x4544ed,_0x4e01b3){return db['SAInvoice'][_0x4f1f('0x47')]({'where':{'id':_0x4544ed[_0x4f1f('0x48')]['id']}})[_0x4f1f('0x21')](handleEntityNotFound(_0x4e01b3,null))[_0x4f1f('0x21')](removeEntity(_0x4e01b3,null))[_0x4f1f('0x3a')](handleError(_0x4e01b3,null));};exports['describe']=function(_0x29f793,_0x4bad90){return db[_0x4f1f('0x27')][_0x4f1f('0x49')]()[_0x4f1f('0x21')](respondWithResult(_0x4bad90,null))[_0x4f1f('0x3a')](handleError(_0x4bad90,null));};exports[_0x4f1f('0x4a')]=function(_0x43a4d2,_0x2f202f){var _0x4a16f1=moment()[_0x4f1f('0x4b')]()[_0x4f1f('0x4c')]();var _0x4207c1=path[_0x4f1f('0x4d')](config['root'],_0x4f1f('0x4e'),'files',_0x4f1f('0x4f'));var _0x260eba=path['join'](config['root'],_0x4f1f('0x4e'),'files','images',_0x4f1f('0x50'),'logo-invoice.png');var _0x457f78=path[_0x4f1f('0x4d')](config[_0x4f1f('0x51')],'server','files',_0x4f1f('0x52'),_0x4f1f('0x50'),_0x4f1f('0x53'));var _0x3c85f7=path[_0x4f1f('0x4d')](_0x4207c1,_0x4a16f1);var _0x179252=util[_0x4f1f('0x54')](_0x4f1f('0x55'),_0x43a4d2['params']['id'],_0x4a16f1);var _0x45102a=path[_0x4f1f('0x4d')](_0x3c85f7,_0x179252);var _0x476aa1=![];var _0x1893e9={};return db[_0x4f1f('0x27')][_0x4f1f('0x47')]({'where':{'id':_0x43a4d2[_0x4f1f('0x48')]['id']},'raw':!![]})[_0x4f1f('0x21')](handleEntityNotFound(_0x2f202f,null))['then'](function(_0x155e85){if(_0x155e85){_0x1893e9[_0x4f1f('0x56')]=_0x155e85;return db[_0x4f1f('0x57')][_0x4f1f('0x58')]({'where':{'InvoiceId':_0x155e85['id']},'raw':!![]})[_0x4f1f('0x21')](function(_0x3ff4be){_0x1893e9[_0x4f1f('0x59')]=_0x3ff4be;_0x476aa1=!![];var _0x362c5d='';var _0x5b5d71={'format':'A4','orientation':_0x4f1f('0x5a'),'border':_0x4f1f('0x5b'),'footer':{'height':'10mm','contents':{'default':_0x4f1f('0x5c')}}};_0x5b5d71[_0x4f1f('0x5d')][_0x4f1f('0x5e')]['default']=_0x5b5d71[_0x4f1f('0x5d')][_0x4f1f('0x5e')]['default']+_0x4f1f('0x5f')+_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0x60')]+_0x4f1f('0x61');fs[_0x4f1f('0x62')](_0x3c85f7);_0x362c5d='';_0x362c5d+=_0x4f1f('0x63');_0x362c5d+=_0x4f1f('0x64');var _0x2f14d4={'phone':{'en':'Phone','it':'Telefono'},'fax':{'en':'Fax','it':'Fax'},'email':{'en':_0x4f1f('0x65'),'it':_0x4f1f('0x65')},'piva':{'en':_0x4f1f('0x66'),'it':_0x4f1f('0x67')},'cf':{'en':_0x4f1f('0x68'),'it':'C.F.'},'sdi':{'en':_0x4f1f('0x69'),'it':_0x4f1f('0x6a')},'cs':{'en':_0x4f1f('0x6b'),'it':_0x4f1f('0x6c')},'invoice':{'en':_0x4f1f('0x6d'),'it':_0x4f1f('0x6e')},'proforma':{'en':_0x4f1f('0x6f'),'it':'Proforma'},'creditnote':{'en':_0x4f1f('0x70'),'it':_0x4f1f('0x71')},'duedate':{'en':_0x4f1f('0x72'),'it':_0x4f1f('0x73')},'item':{'en':'Item','it':_0x4f1f('0x74')},'description':{'en':_0x4f1f('0x75'),'it':_0x4f1f('0x76')},'hrsqty':{'en':_0x4f1f('0x77'),'it':_0x4f1f('0x78')},'unitprice':{'en':_0x4f1f('0x79'),'it':_0x4f1f('0x7a')},'subtotal':{'en':_0x4f1f('0x7b'),'it':_0x4f1f('0x7c')},'discount':{'en':_0x4f1f('0x7d'),'it':_0x4f1f('0x7e')},'total':{'en':'Subtotal','it':_0x4f1f('0x7f')},'tax':{'en':'Tax','it':_0x4f1f('0x80')},'nettopay':{'en':_0x4f1f('0x81'),'it':_0x4f1f('0x82')},'sendpayment':{'en':_0x4f1f('0x83'),'it':'Si\x20prega\x20di\x20inviare\x20il\x20pagamento\x20a'},'accountholder':{'en':'Account\x20Holder','it':_0x4f1f('0x84')},'bankname':{'en':'Bank\x20name','it':_0x4f1f('0x85')},'bankaddress':{'en':_0x4f1f('0x86'),'it':_0x4f1f('0x87')},'abi':{'en':_0x4f1f('0x88'),'it':'ABI'},'cab':{'en':_0x4f1f('0x89'),'it':_0x4f1f('0x89')},'bic':{'en':'BIC','it':'BIC'},'swif':{'en':_0x4f1f('0x8a'),'it':_0x4f1f('0x8a')},'iban':{'en':'IBAN','it':_0x4f1f('0x8b')},'paypal':{'en':_0x4f1f('0x8c'),'it':_0x4f1f('0x8d')},'thank1':{'en':_0x4f1f('0x8e'),'it':'Grazie.\x20Prevediamo\x20il\x20pagamento\x20entro\x20'},'thank2':{'en':_0x4f1f('0x8f'),'it':_0x4f1f('0x90')}};var _0x4f1626='it';if(_0x1893e9['invoice'][_0x4f1f('0x91')]!=='Italy'){_0x4f1626='en';}_0x362c5d+=_0x4f1f('0x92');_0x362c5d+='\x20',_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0x97')]);_0x362c5d+=util[_0x4f1f('0x54')]('%s',_0x1893e9['invoice'][_0x4f1f('0x98')]);_0x362c5d+=util[_0x4f1f('0x54')](_0x4f1f('0x99'),_0x1893e9[_0x4f1f('0x56')]['issuerCity']);_0x362c5d+=util[_0x4f1f('0x54')](_0x4f1f('0x9a'),_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0x9b')]);_0x362c5d+=util[_0x4f1f('0x54')](_0x2f14d4[_0x4f1f('0x9c')][_0x4f1626]+_0x4f1f('0x9d'),_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0x9e')]);_0x362c5d+=util['format'](_0x2f14d4[_0x4f1f('0x9f')][_0x4f1626]+_0x4f1f('0x9d'),_0x1893e9[_0x4f1f('0x56')]['issuerFax']);_0x362c5d+=util[_0x4f1f('0x54')](_0x2f14d4[_0x4f1f('0xa0')][_0x4f1626]+':\x20%s
',_0x1893e9[_0x4f1f('0x56')]['issuerEmail']);_0x362c5d+=util[_0x4f1f('0x54')](_0x2f14d4['piva'][_0x4f1626]+_0x4f1f('0x9d'),_0x1893e9[_0x4f1f('0x56')]['issuerPIVA']);_0x362c5d+=util[_0x4f1f('0x54')](_0x2f14d4['cf'][_0x4f1626]+_0x4f1f('0x9d'),_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0xa1')]);_0x362c5d+=util[_0x4f1f('0x54')](_0x2f14d4[_0x4f1f('0xa2')][_0x4f1626]+_0x4f1f('0x9d'),_0x1893e9[_0x4f1f('0x56')]['issuerSDICode']);_0x362c5d+=util[_0x4f1f('0x54')](_0x2f14d4['cs'][_0x4f1626]+_0x4f1f('0x9d'),_0x1893e9['invoice'][_0x4f1f('0xa3')]);_0x362c5d+='';_0x362c5d+='
';_0x362c5d+='';_0x362c5d+=util['format'](_0x4f1f('0xa4'),_0x1893e9['invoice'][_0x4f1f('0xa5')]);_0x362c5d+=util[_0x4f1f('0x54')]('%s
',_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0xa6')]);_0x362c5d+=util[_0x4f1f('0x54')](_0x4f1f('0xa7'),_0x1893e9['invoice'][_0x4f1f('0xa8')]);_0x362c5d+=util['format']('%s
',_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0xa9')]);_0x362c5d+=util[_0x4f1f('0x54')]('%s
',_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0x91')]);_0x362c5d+=_0x4f1f('0xaa');if(_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0xab')]){_0x362c5d+=util[_0x4f1f('0x54')](_0x2f14d4['cf'][_0x4f1626]+_0x4f1f('0x9d'),_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0xab')]);}_0x362c5d+=util[_0x4f1f('0x54')](_0x2f14d4['piva'][_0x4f1626]+_0x4f1f('0x9d'),_0x1893e9[_0x4f1f('0x56')]['receivingPIVA']);if(_0x1893e9[_0x4f1f('0x56')]['receivingSDICode']){_0x362c5d+=util[_0x4f1f('0x54')](_0x2f14d4['sdi'][_0x4f1626]+':\x20%s
',_0x1893e9[_0x4f1f('0x56')]['receivingSDICode']);}_0x362c5d+=_0x4f1f('0xac');_0x362c5d+='
';_0x362c5d+=_0x4f1f('0x94');_0x362c5d+='';_0x362c5d+=util['format'](_0x4f1f('0xad')+_0x2f14d4['invoice'][_0x4f1626]+'\x20N.%d',_0x155e85[_0x4f1f('0xae')]);_0x362c5d+=util[_0x4f1f('0x54')](_0x4f1f('0xaf'),_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0xb0')]);var _0x1f99e6=moment(_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0xb1')])[_0x4f1f('0x54')](_0x4f1f('0xb2'));_0x362c5d+=util[_0x4f1f('0x54')](_0x4f1f('0xb3'),_0x1f99e6);var _0x8fb07e=moment(_0x1893e9['invoice'][_0x4f1f('0xb1')])[_0x4f1f('0xb4')](_0x1893e9['invoice']['saExpiryDay'],'days')['format'](_0x4f1f('0xb2'));if(_0x1893e9[_0x4f1f('0x56')]['endDate']){_0x8fb07e=moment(_0x1893e9['invoice']['endDate'])['format']('DD/MM/YYYY');}_0x362c5d+=util[_0x4f1f('0x54')](''+_0x2f14d4[_0x4f1f('0xb5')][_0x4f1626]+_0x4f1f('0xb6'),_0x8fb07e);_0x362c5d+=_0x4f1f('0xb7');_0x362c5d+='';_0x362c5d+=_0x4f1f('0xb8');_0x362c5d+='';_0x362c5d+='';_0x362c5d+=_0x4f1f('0xb9')+_0x2f14d4[_0x4f1f('0xba')][_0x4f1626]+'';_0x362c5d+=_0x4f1f('0xb9')+_0x2f14d4[_0x4f1f('0xbb')][_0x4f1626]+_0x4f1f('0xbc');_0x362c5d+=_0x4f1f('0xb9')+_0x2f14d4[_0x4f1f('0xbd')][_0x4f1626]+_0x4f1f('0xbc');_0x362c5d+=_0x4f1f('0xb9')+_0x2f14d4['unitprice'][_0x4f1626]+_0x4f1f('0xbc');_0x362c5d+=''+_0x2f14d4[_0x4f1f('0xbe')][_0x4f1626]+_0x4f1f('0xbc');_0x362c5d+=_0x4f1f('0xb7');var _0x1d39ff=0x0;var _0x53a826=0x0;for(var _0x5430ca=0x0;_0x5430ca<_0x1893e9['details'][_0x4f1f('0x3d')];_0x5430ca++){var _0x279440=0x0;var _0x587cc2=0x0;var _0x370955=0x0;var _0x1b4e6e=0x0;_0x279440=_0x1893e9[_0x4f1f('0x59')][_0x5430ca][_0x4f1f('0xbf')]-_0x1893e9[_0x4f1f('0x59')][_0x5430ca][_0x4f1f('0xbf')]/0x64*_0x1893e9['details'][_0x5430ca][_0x4f1f('0xc0')];_0x587cc2=_0x279440/0x64*_0x1893e9[_0x4f1f('0x59')][_0x5430ca][_0x4f1f('0xc1')];_0x370955=_0x279440*_0x1893e9[_0x4f1f('0x59')][_0x5430ca][_0x4f1f('0xc2')];_0x1b4e6e=_0x587cc2*_0x1893e9[_0x4f1f('0x59')][_0x5430ca]['quantity'];_0x362c5d+=_0x4f1f('0x94');_0x362c5d+=util['format'](_0x4f1f('0xc3'),_0x1893e9['details'][_0x5430ca][_0x4f1f('0xc4')]);_0x362c5d+=util[_0x4f1f('0x54')](_0x4f1f('0xc3'),_0x1893e9[_0x4f1f('0x59')][_0x5430ca][_0x4f1f('0xc5')]);_0x362c5d+=util[_0x4f1f('0x54')](_0x4f1f('0xc6'),_0x1893e9[_0x4f1f('0x59')][_0x5430ca][_0x4f1f('0xc2')]);_0x362c5d+=_0x4f1f('0xc7')+_0x279440[_0x4f1f('0xc8')](0x2)+_0x4f1f('0xc9');_0x362c5d+=''+_0x370955[_0x4f1f('0xc8')](0x2)+_0x4f1f('0xc9');_0x362c5d+=_0x4f1f('0xb7');_0x1d39ff+=_0x370955;_0x53a826+=_0x1b4e6e;}_0x362c5d+='
';if(!_[_0x4f1f('0xca')](_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0xc0')])){var _0xfd7c69=0x0;var _0x32c361=0x0;var _0x1241c7=_0x1893e9[_0x4f1f('0x56')]['discount']*0x64/_0x1d39ff;for(var _0x5430ca=0x0;_0x5430ca<_0x1893e9[_0x4f1f('0x59')][_0x4f1f('0x3d')];_0x5430ca++){var _0x3a7e0b=0x0;var _0x430311=0x0;var _0x5699a2=0x0;_0x279440=_0x1893e9['details'][_0x5430ca][_0x4f1f('0xbf')]-_0x1893e9['details'][_0x5430ca][_0x4f1f('0xbf')]/0x64*_0x1893e9[_0x4f1f('0x59')][_0x5430ca][_0x4f1f('0xc0')];_0x3a7e0b=_0x279440/0x64*_0x1241c7;_0x430311=_0x279440-_0x3a7e0b;_0x5699a2=_0x430311*_0x1893e9[_0x4f1f('0x59')][_0x5430ca][_0x4f1f('0xc2')];_0xfd7c69+=_0x5699a2;_0x32c361+=_0x5699a2/0x64*_0x1893e9[_0x4f1f('0x59')][_0x5430ca]['tax'];}}var _0x4c2095=0x0;var _0x30c80c=0x0;var _0x286b78=![];var _0x4486ae=_0x1893e9[_0x4f1f('0x56')]['receivingFiscalMessage'];if(_0x4486ae[_0x4f1f('0xcb')](_0x4f1f('0xcc'))!=-0x1){_0x286b78=!![];}if(!_[_0x4f1f('0xca')](_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0xc0')])){_0x362c5d+=_0x4f1f('0x94');if(_0x1893e9[_0x4f1f('0x56')]['discount']>0x0){_0x362c5d+=_0x4f1f('0xcd')+_0x2f14d4[_0x4f1f('0xc0')][_0x4f1626]+_0x4f1f('0xce');_0x362c5d+=_0x4f1f('0xcf')+_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0xc0')]['toFixed'](0x2)+_0x4f1f('0xc9');}_0x362c5d+=_0x4f1f('0xb7');_0x4c2095=_0x32c361;_0x30c80c=_0xfd7c69;}else{_0x4c2095=_0x53a826;_0x30c80c=_0x1d39ff;}if(_0x4c2095>0x0||_0x1893e9[_0x4f1f('0x56')]['discount']>0x0){_0x362c5d+=_0x4f1f('0x94');_0x362c5d+=_0x4f1f('0xd0')+_0x2f14d4[_0x4f1f('0xd1')][_0x4f1626]+_0x4f1f('0xce');_0x362c5d+=_0x4f1f('0xc7')+_0x30c80c[_0x4f1f('0xc8')](0x2)+_0x4f1f('0xc9');_0x362c5d+=_0x4f1f('0xb7');}if(_0x4c2095>0x0){_0x362c5d+='';_0x362c5d+=_0x4f1f('0xd0')+_0x2f14d4['tax'][_0x4f1626]+_0x4f1f('0xce');_0x362c5d+=_0x4f1f('0xc7')+_0x4c2095[_0x4f1f('0xc8')](0x2)+_0x4f1f('0xc9');_0x362c5d+=_0x4f1f('0xb7');}_0x362c5d+=_0x4f1f('0x94');var _0x5032bf;if(_0x286b78){_0x5032bf=_0x30c80c;}else{_0x5032bf=_0x30c80c+_0x4c2095;}_0x362c5d+=''+_0x2f14d4[_0x4f1f('0xd2')][_0x4f1626]+_0x4f1f('0xd3')+_0x5032bf[_0x4f1f('0xc8')](0x2)+_0x4f1f('0xc9');_0x362c5d+=_0x4f1f('0xd4');_0x362c5d+=_0x4f1f('0xb7');_0x362c5d+=_0x4f1f('0xd5');_0x362c5d+=_0x4f1f('0xd6');_0x362c5d+=_0x4f1f('0x94');_0x362c5d+=util[_0x4f1f('0x54')](_0x4f1f('0xd7'),_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0xd8')][_0x4f1f('0xd9')](new RegExp(String[_0x4f1f('0xda')](0xd),'g'),_0x4f1f('0xdb')));_0x362c5d+=_0x4f1f('0xb7');_0x362c5d+=_0x4f1f('0x94');_0x362c5d+=_0x4f1f('0xb8');_0x362c5d+=_0x4f1f('0xdc')+_0x2f14d4[_0x4f1f('0xdd')][_0x4f1626]+_0x4f1f('0xde');if(!_[_0x4f1f('0xca')](_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0xdf')])){_0x362c5d+=''+_0x2f14d4['accountholder'][_0x4f1626]+_0x4f1f('0xe0')+_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0xdf')]+_0x4f1f('0xe1');_0x362c5d+=''+_0x2f14d4[_0x4f1f('0xe2')][_0x4f1626]+':\x20'+_0x1893e9['invoice'][_0x4f1f('0xe3')]+'
\x20';_0x362c5d+=_0x4f1f('0xdc')+_0x2f14d4[_0x4f1f('0xe4')][_0x4f1626]+':\x20'+_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0xe5')]+',\x20'+_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0xe6')]+_0x4f1f('0xe7')+_0x1893e9['invoice']['issuerBankCity']+'\x20('+_0x1893e9[_0x4f1f('0x56')]['issuerBankCountry']+')'+'';_0x362c5d+=_0x4f1f('0xdc')+_0x2f14d4['abi'][_0x4f1626]+'/'+_0x2f14d4['cab'][_0x4f1626]+':\x20'+_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0xe8')]+'/'+_0x1893e9['invoice'][_0x4f1f('0xe9')]+_0x4f1f('0xe1');_0x362c5d+=''+_0x2f14d4[_0x4f1f('0xea')][_0x4f1626]+'/'+_0x2f14d4[_0x4f1f('0xeb')][_0x4f1626]+_0x4f1f('0xe0')+_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0xec')]+_0x4f1f('0xe1');_0x362c5d+=_0x4f1f('0xdc')+_0x2f14d4[_0x4f1f('0xed')][_0x4f1626]+_0x4f1f('0xe0')+_0x1893e9['invoice'][_0x4f1f('0xee')]+_0x4f1f('0xe1');}if(!_[_0x4f1f('0xca')](_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0xef')])){_0x362c5d+=_0x4f1f('0xdc')+_0x2f14d4['paypal'][_0x4f1626]+_0x4f1f('0xe0')+_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0xef')]+_0x4f1f('0xf0');}_0x362c5d+=''+_0x2f14d4[_0x4f1f('0xf1')][_0x4f1626]+''+_0x8fb07e+_0x4f1f('0xf2')+_0x2f14d4['thank2'][_0x4f1626]+'';_0x362c5d+='';_0x362c5d+=_0x4f1f('0xb7');if(_0x1893e9[_0x4f1f('0x56')][_0x4f1f('0xf3')]===0x1){_0x362c5d+=_0x4f1f('0xf4')+_0x457f78+'\x22\x20width=\x22180\x22>';}_0x362c5d+='';_0x362c5d+=_0x4f1f('0xf5');_0x362c5d+=_0x4f1f('0xf6');console[_0x4f1f('0xf7')](_0x4f1f('0x46'),_0x362c5d);return new BPromise(function(_0x37fe66,_0x551832){pdf[_0x4f1f('0x40')](_0x362c5d,_0x5b5d71)[_0x4f1f('0xf8')](path[_0x4f1f('0x4d')](_0x3c85f7,_0x179252),function(_0x49f51b,_0x37cdb3){if(_0x49f51b)return _0x551832(_0x49f51b);_0x37fe66(_0x37cdb3);});});});}})[_0x4f1f('0x21')](function(){if(_0x476aa1){console[_0x4f1f('0xf7')](_0x4f1f('0xf9'),_0x45102a,_0x179252);return _0x2f202f['download'](_0x45102a,_0x179252,function(_0x23a19b){if(_0x23a19b){console[_0x4f1f('0xf7')](_0x4f1f('0xfa'),_0x23a19b);}else{console[_0x4f1f('0xf7')](_0x4f1f('0xfb'),_0x3c85f7);rimraf(_0x3c85f7,function(){});}});}else{return _0x2f202f['sendStatus'](0xc8);}})[_0x4f1f('0x3a')](handleError(_0x2f202f,null));};exports[_0x4f1f('0xfc')]=function(_0x5f340f,_0x2ffcd6){var _0x124514=_0x5f340f[_0x4f1f('0x29')][_0x4f1f('0xfd')];var _0x4080c9=squel[_0x4f1f('0xfe')]()[_0x4f1f('0xff')](_0x4f1f('0x100'))[_0x4f1f('0x36')]('count(id)','invoiceNumber')['field'](_0x4f1f('0x101'),_0x4f1f('0x102'))[_0x4f1f('0x36')](_0x4f1f('0x103'),_0x4f1f('0x104'))['where'](_0x4f1f('0x105')+_0x124514+')')[_0x4f1f('0x30')](_0x4f1f('0x103'))[_0x4f1f('0x30')](_0x4f1f('0x101'),![])[_0x4f1f('0x106')](_0x4f1f('0x101'))[_0x4f1f('0x106')]('MONTH(startDate)');return db[_0x4f1f('0x41')][_0x4f1f('0x29')](_0x4080c9[_0x4f1f('0x4c')](),{'type':db[_0x4f1f('0x41')][_0x4f1f('0x107')]['SELECT']})[_0x4f1f('0x21')](function(_0x515a71){return{'count':_0x515a71['length'],'rows':_0x515a71};})['then'](handleEntityNotFound(_0x2ffcd6,null))[_0x4f1f('0x21')](respondWithResult(_0x2ffcd6,null))[_0x4f1f('0x3a')](handleError(_0x2ffcd6,null));};exports[_0x4f1f('0x108')]=function(_0x53b179,_0x2202a4){var _0x17004e=_0x53b179[_0x4f1f('0x29')][_0x4f1f('0xfd')];var _0x619b8f=squel[_0x4f1f('0xfe')]()[_0x4f1f('0xff')](_0x4f1f('0x109'),_0x4f1f('0x10a'))['field']('MONTH(startDate)',_0x4f1f('0x10b'))[_0x4f1f('0x36')](_0x4f1f('0x101'),_0x4f1f('0x10c'))['field'](_0x4f1f('0x10d'),_0x4f1f('0x10e'))[_0x4f1f('0x4d')](_0x4f1f('0x100'),_0x4f1f('0x10f'),_0x4f1f('0x110'))[_0x4f1f('0x32')]('YEAR(startDate)\x20IN\x20('+_0x17004e+')')['order']('MONTH(startDate)')[_0x4f1f('0x30')](_0x4f1f('0x101'),![])['group'](_0x4f1f('0x101'))[_0x4f1f('0x106')](_0x4f1f('0x103'));return db[_0x4f1f('0x41')][_0x4f1f('0x29')](_0x619b8f[_0x4f1f('0x4c')](),{'type':db[_0x4f1f('0x41')][_0x4f1f('0x107')]['SELECT']})[_0x4f1f('0x21')](function(_0x13bf16){return{'count':_0x13bf16[_0x4f1f('0x3d')],'rows':_0x13bf16};})[_0x4f1f('0x21')](handleEntityNotFound(_0x2202a4,null))[_0x4f1f('0x21')](respondWithResult(_0x2202a4,null))[_0x4f1f('0x3a')](handleError(_0x2202a4,null));};function addInvoiceCreditnoteDetail(_0x3c5e80,_0x4c5a99,_0x15c120){console[_0x4f1f('0xf7')](_0x4f1f('0x111'),_0x3c5e80);var _0x4c3055={'companyName':_0x3c5e80[_0x4f1f('0xa5')],'companyId':_0x3c5e80[_0x4f1f('0x112')],'productName':_0x3c5e80['productName'],'productCode':_0x3c5e80[_0x4f1f('0x113')],'productDescription':_0x3c5e80[_0x4f1f('0xc5')],'typeName':_0x3c5e80[_0x4f1f('0x114')],'pricelistName':_0x3c5e80[_0x4f1f('0x115')],'priceListId':_0x3c5e80[_0x4f1f('0x116')],'netPrice':_0x3c5e80['netPrice'],'discount':_0x3c5e80['discount'],'tax':_0x3c5e80[_0x4f1f('0xc1')],'agentFullname':_0x3c5e80['agentFullname'],'note':_0x3c5e80[_0x4f1f('0x117')],'subscriptionId':_0x3c5e80[_0x4f1f('0x118')],'subscriptionName':_0x3c5e80[_0x4f1f('0x119')],'subscriptionMonthly':_0x3c5e80[_0x4f1f('0x11a')],'quantity':_0x3c5e80[_0x4f1f('0xc2')],'CreditNoteId':_0x4c5a99,'unitName':_0x3c5e80['unitName']};return db[_0x4f1f('0x11b')][_0x4f1f('0x40')](_0x4c3055,{'transaction':_0x15c120});}exports[_0x4f1f('0x11c')]=function(_0x274e1e,_0x401936,_0x18ea31){var _0x1d70e6;if(_0x274e1e[_0x4f1f('0x46')]['id']){delete _0x274e1e['body']['id'];}console['log'](_0x274e1e);return db[_0x4f1f('0x41')][_0x4f1f('0x11d')](function(_0x58691e){return db[_0x4f1f('0x11e')][_0x4f1f('0x40')](_0x274e1e[_0x4f1f('0x46')],{'transaction':_0x58691e})[_0x4f1f('0x21')](function(_0x3e495b){_0x1d70e6=_0x3e495b;var _0x226a27=_0x274e1e['params']['id'];return db[_0x4f1f('0x57')][_0x4f1f('0x58')]({'where':{'InvoiceId':_0x226a27},'raw':!![],'logging':console[_0x4f1f('0xf7')]});})[_0x4f1f('0x21')](function(_0x5ee26e){if(_0x5ee26e[_0x4f1f('0x3d')]>0x0){var _0x44e20c=[];for(var _0x35dd67=0x0;_0x35dd67<_0x5ee26e[_0x4f1f('0x3d')];_0x35dd67++){_0x44e20c['push'](addInvoiceCreditnoteDetail(_0x5ee26e[_0x35dd67],_0x1d70e6['id'],_0x58691e));}return BPromise[_0x4f1f('0x11f')](_0x44e20c);}else{var _0x43e993={'errors':[{'type':_0x4f1f('0x120'),'message':_0x4f1f('0x121')}]};throw _0x43e993;}});})[_0x4f1f('0x21')](function(){return _0x401936[_0x4f1f('0x17')](0xc8);})['catch'](function(_0x299493){console['log'](_0x4f1f('0x122'),_0x299493);if(_0x299493[_0x4f1f('0x25')]===_0x4f1f('0x123')){var _0x299493={'errors':[{'message':'Duplicate\x20entry.'}]};}_0x401936[_0x4f1f('0x18')](0x1f4)[_0x4f1f('0x26')](_0x299493);});}; \ No newline at end of file +var _0x9beb=['%s\x20-\x20','receivingPostalCode','receivingCity','receivingFiscalCode','','','\x20N.%d','number','%s,\x20','startDate','DD/MM/YYYY','%s\x20','add','saExpiryDay','endDate','duedate','','item','','','description','hrsqty','unitprice','subtotal','netPrice','discount','tax','quantity','%s','productDescription','%d','','toFixed','','receivingFiscalMessage','split\x20payment','isNil','','total','€','','','nettopay','','\x20',' ','','\x20%s\x20','replace','fromCharCode','','','','sendpayment',':','accountholder',':\x20','issuerBankAccount','','bankname','issuerBankName','\x20','bankaddress','issuerBankStreet','\x20-\x20','issuerBankCountry','issuerCAB','bic','swif','issuerBankBICSWIFT','iban','issuerBankIBAN','issuerPayPal','','','thank2','paid','\x22\x20width=\x22180\x22>','
','','log','toFile','TCL:\x20exports.getInvoicePDF\x20->\x20saveTo,\x20fileName','download','err','foldername','years','select','from','sa_invoices','MONTH(startDate)','YEAR(startDate)','group','QueryTypes','SELECT','getInvoicesRevenueByQuarter','sa_invoice_details','month','year','sum(said.netPrice\x20*\x20said.quantity)','monthTotal','sai','sai.id\x20=\x20said.InvoiceId','addInvoiceCreditnoteDetail->>','companyName','companyId','productCode','typeName','pricelistName','agentFullname','note','subscriptionMonthly','unitName','SACreditNoteDetail','automaticInvoiceCreditnote','SACreditNote','push','WARNING','TCL:\x20exports.automaticInvoiceCreditnote\x20->\x20err','SequelizeUniqueConstraintError','Duplicate\x20entry.','send','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','error','SAInvoice','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','VIRTUAL','field','includeAll','include','findAll','then','rows','catch','show','options','find','create','sequelize','transaction','Sequelize','Transaction','ISOLATION_LEVELS','body','params','describe','getInvoicePDF','toString','join','root','server','images','logos','logo-invoice.png','files','format','Invoice_%s-%s.pdf','invoice','SAInvoiceDetail','details','portrait','1cm','10mm','{{page}}
/{{pages}}','footer','default','','mkdirSync','','\x20\x20body{font-family:\x20Verdana,\x20Geneva,\x20Tahoma,\x20sans-serif;}.itemTabTitle{background-color:\x20lightgray;\x20height:\x2040px;}.issuerInfo{color:\x20lightgray;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;\x20font-size:\x2012px;}.issuerData{font-weight:\x20normal}.issuerFiled{font-weight:\x20bold;\x20font-size:\x2010px;\x20padding-left:\x2010px;}.issuerFiledWeb{font-weight:\x20bold;\x20text-align:\x20center;}.receiperInfo{text-align:\x20right;\x20font-size:\x2012px}.receiperCompanyName{font-weight:\x20bold;\x20padding-top:\x2010px;\x20padding-bottom:\x2015px;\x20font-size:\x2016px}.reciperFiscalInfo{padding-top:\x205px;\x20padding-bottom:\x205px;}table.center{margin-left:\x20auto;\x20margin-right:\x20auto;\x20width:\x2090%;}.total{background-color:\x20lightgray;\x20font-size:\x2018px;\x20font-weight:\x20bold;}.totalText{background-color:\x20lightgray;\x20text-align:\x20right;\x20font-size:\x2016px;\x20padding-right:\x2010px;}.totalEmpty{background-color:\x20#ffffff;}.invoiceNumber{font-weight:\x20bolder;\x20font-size:\x2024px;\x20padding-bottom:\x2020px;}.invoiceNumber{font-weight:\x20bold;\x20font-size:\x2018px;}.createdDate{font-size:\x2014px;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;}.duedDate{font-size:\x2014px;\x20padding-bottom:\x2010px;}.TFtable{width:\x20100%;\x20font-size:\x2010px;\x20border-collapse:\x20collapse;}.TFtable\x20td{padding:\x207px;}.TFtable\x20tr:nth-child(even){background:\x20#ffffff;}.TFtable\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.numberRight{text-align:\x20right;}.numberCenter{text-align:\x20center}.currency{text-align:\x20left;}table.roundedCorners{border:\x202px\x20solid\x20lightgray;\x20border-radius:\x205px;\x20border-spacing:\x200;\x20width:\x20100%;\x20font-size:\x2010px;}table.roundedCorners\x20td,\x20table.roundedCorners\x20th{border-bottom:\x201px\x20solid\x20lightgray;\x20padding:\x2010px;}table.roundedCorners\x20tr:last-child\x20>\x20td{border-bottom:\x20none;}table.roundedCorners\x20tr:nth-child(even){background:\x20#ffffff;}table.roundedCorners\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.lex{padding-left:\x2010px;font-size:\x2010px;padding-bottom:\x2020px;}.divTotal{float:\x20right;\x20border-radius:\x205px;\x20border:\x202px\x20solid\x20lightgray;\x20padding:\x2010px;\x20margin-top:30px;}.itemTotal{width:\x20200px;\x20line-height:\x2030px;}.tabTotal{border-collapse:\x20collapse;}','','Phone','Fax','Email','VAT\x20number','Tax\x20code','C.F.','Codice\x20S.D.I.','Soc.Cap.\x20fp','Cap.Soc.\x20iv','Fattura','Proforma','Credit\x20note','Nota\x20di\x20credito','Scadenza','Item','Articolo','Description','Descrizione','Ore/Qta','Unit\x20Price','Prezzo\x20Unitario','Sub\x20Total','Sub\x20Totale','Discount','Sconto','Subtotal','Imponibile','Tax','Tasse','Total','Totale','Please\x20send\x20PAYMENT\x20to','Si\x20prega\x20di\x20inviare\x20il\x20pagamento\x20a','Account\x20Holder','Conto\x20intestato\x20a','Bank\x20name','Nome\x20banca','Bank\x20Address','Indirizzo\x20banca','ABI','CAB','BIC','SWIF','IBAN','Pay\x20via\x20Paypal','Paga\x20con\x20Paypal','Grazie.\x20Prevediamo\x20il\x20pagamento\x20entro\x20',',\x20so\x20please\x20do\x20so\x20within\x20this\x20time.','\x20quindi\x20vi\x20preghiamo\x20di\x20provvedere\x20entro\x20tale\x20termine.','\x20','\x20%s
','issuerName','%s
','issuerStreet','issuerPostalCode','\x20%s','issuerCity','-\x20%s\x20
','issuerCountry','phone',':\x20%s
','issuerPhone','fax','issuerFax','email','issuerEmail','piva','issuerPIVA','issuerFiscalCode','sdi','issuerSDICode','issuerSocCap','','','','%s','receivingStreet'];(function(_0x100682,_0x11afec){var _0xcb6e87=function(_0x3ef421){while(--_0x3ef421){_0x100682['push'](_0x100682['shift']());}};_0xcb6e87(++_0x11afec);}(_0x9beb,0x1a6));var _0xb9be=function(_0x4f76c4,_0x38ff43){_0x4f76c4=_0x4f76c4-0x0;var _0x322765=_0x9beb[_0x4f76c4];return _0x322765;};'use strict';var pdf=require(_0xb9be('0x0'));var emlformat=require(_0xb9be('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb9be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb9be('0x3'));var BPromise=require(_0xb9be('0x4'));var Mustache=require(_0xb9be('0x5'));var util=require(_0xb9be('0x6'));var path=require(_0xb9be('0x7'));var sox=require(_0xb9be('0x8'));var csv=require(_0xb9be('0x9'));var ejs=require(_0xb9be('0xa'));var fs=require('fs');var _=require(_0xb9be('0xb'));var squel=require('squel');var crypto=require(_0xb9be('0xc'));var jsforce=require(_0xb9be('0xd'));var deskjs=require(_0xb9be('0xe'));var toCsv=require(_0xb9be('0x9'));var querystring=require(_0xb9be('0xf'));var Papa=require(_0xb9be('0x10'));var Redis=require('ioredis');var authService=require(_0xb9be('0x11'));var qs=require(_0xb9be('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb9be('0x13'));var utils=require('../../config/utils');var config=require(_0xb9be('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48611a,_0x568a4e){_0x568a4e=_0x568a4e||0xcc;return function(_0x3bf339){if(_0x3bf339){return _0x48611a['sendStatus'](_0x568a4e);}return _0x48611a['status'](_0x568a4e)[_0xb9be('0x15')]();};}function respondWithResult(_0x28f6a1,_0x20dee4){_0x20dee4=_0x20dee4||0xc8;return function(_0x365dd4){if(_0x365dd4){return _0x28f6a1[_0xb9be('0x16')](_0x20dee4)[_0xb9be('0x17')](_0x365dd4);}};}function respondWithFilteredResult(_0x32a106,_0x2ef03b){return function(_0x25c947){if(_0x25c947){var _0x14c8cb=_0x25c947[_0xb9be('0x18')],_0x5dd6ad=_0x2ef03b[_0xb9be('0x19')],_0x5172db=_0x2ef03b['offset']+_0x2ef03b[_0xb9be('0x1a')],_0xb6d9ce;if(_0x5172db>=_0x14c8cb){_0x5172db=_0x14c8cb;_0xb6d9ce=0xc8;}else{_0xb6d9ce=0xce;}_0x32a106['status'](_0xb6d9ce);return _0x32a106[_0xb9be('0x1b')](_0xb9be('0x1c'),_0x5dd6ad+'-'+_0x5172db+'/'+_0x14c8cb)[_0xb9be('0x17')](_0x25c947);}return null;};}function patchUpdates(_0x253540){return function(_0xabe939){try{jsonpatch[_0xb9be('0x1d')](_0xabe939,_0x253540,!![]);}catch(_0x23b231){return BPromise[_0xb9be('0x1e')](_0x23b231);}return _0xabe939[_0xb9be('0x1f')]();};}function saveUpdates(_0x16b503,_0x2cc97d){return function(_0x52c0c2){if(_0x52c0c2){return _0x52c0c2[_0xb9be('0x20')](_0x16b503)['then'](function(_0x5e0ccc){return _0x5e0ccc;});}return null;};}function removeEntity(_0x39ee85,_0x46a026){return function(_0xe9f979){if(_0xe9f979){return _0xe9f979[_0xb9be('0x21')]()['then'](function(){_0x39ee85[_0xb9be('0x16')](0xcc)[_0xb9be('0x15')]();});}};}function handleEntityNotFound(_0x17565d,_0x1e283a){return function(_0x5d277d){if(!_0x5d277d){_0x17565d[_0xb9be('0x22')](0x194);}return _0x5d277d;};}function handleError(_0x4fd135,_0x1ab367){_0x1ab367=_0x1ab367||0x1f4;return function(_0x486ec2){logger[_0xb9be('0x23')](_0x486ec2['stack']);if(_0x486ec2['name']){delete _0x486ec2['name'];}_0x4fd135[_0xb9be('0x16')](_0x1ab367)['send'](_0x486ec2);};}exports['index']=function(_0x23c55f,_0x560055){var _0x2c418b={},_0x9a88cf={},_0x4dde38={'count':0x0,'rows':[]};var _0x12e872=db[_0xb9be('0x24')][_0xb9be('0x25')];_0x9a88cf['model']=_[_0xb9be('0x26')](_0x12e872);_0x9a88cf[_0xb9be('0x27')]=_[_0xb9be('0x26')](_0x23c55f[_0xb9be('0x27')]);_0x9a88cf[_0xb9be('0x28')]=_[_0xb9be('0x29')](_0x9a88cf[_0xb9be('0x2a')],_0x9a88cf[_0xb9be('0x27')]);_0x2c418b['attributes']=_[_0xb9be('0x29')](_0x9a88cf[_0xb9be('0x2a')],qs[_0xb9be('0x2b')](_0x23c55f[_0xb9be('0x27')]['fields']));_0x2c418b['attributes']=_0x2c418b[_0xb9be('0x2c')][_0xb9be('0x2d')]?_0x2c418b[_0xb9be('0x2c')]:_0x9a88cf['model'];if(!_0x23c55f[_0xb9be('0x27')][_0xb9be('0x2e')](_0xb9be('0x2f'))){_0x2c418b['limit']=qs[_0xb9be('0x1a')](_0x23c55f[_0xb9be('0x27')][_0xb9be('0x1a')]);_0x2c418b[_0xb9be('0x19')]=qs[_0xb9be('0x19')](_0x23c55f['query']['offset']);}_0x2c418b[_0xb9be('0x30')]=qs[_0xb9be('0x31')](_0x23c55f[_0xb9be('0x27')][_0xb9be('0x31')]);_0x2c418b[_0xb9be('0x32')]=qs[_0xb9be('0x28')](_['pick'](_0x23c55f[_0xb9be('0x27')],_0x9a88cf[_0xb9be('0x28')]));if(_0x23c55f[_0xb9be('0x27')][_0xb9be('0x33')]){_0x2c418b[_0xb9be('0x32')]=_[_0xb9be('0x34')](_0x2c418b[_0xb9be('0x32')],{'$or':_[_0xb9be('0x35')](_0x12e872,function(_0x428b74){if(_0x428b74[_0xb9be('0x36')]['key']!==_0xb9be('0x37')){var _0x2796a5={};_0x2796a5[_0x428b74[_0xb9be('0x38')]]={'$like':'%'+_0x23c55f[_0xb9be('0x27')]['filter']+'%'};return _0x2796a5;}})});}_0x2c418b=_[_0xb9be('0x34')]({},_0x2c418b,_0x23c55f['options']);var _0x1d2d2e={'where':_0x2c418b[_0xb9be('0x32')]};return db[_0xb9be('0x24')][_0xb9be('0x18')](_0x1d2d2e)['then'](function(_0x23acaa){_0x4dde38[_0xb9be('0x18')]=_0x23acaa;if(_0x23c55f['query'][_0xb9be('0x39')]){_0x2c418b[_0xb9be('0x3a')]=[{'all':!![]}];}return db[_0xb9be('0x24')][_0xb9be('0x3b')](_0x2c418b);})[_0xb9be('0x3c')](function(_0x1c217f){_0x4dde38[_0xb9be('0x3d')]=_0x1c217f;return _0x4dde38;})['then'](respondWithFilteredResult(_0x560055,_0x2c418b))[_0xb9be('0x3e')](handleError(_0x560055,null));};exports[_0xb9be('0x3f')]=function(_0x31135b,_0x2a84ea){var _0x5d4841={'raw':![],'where':{'id':_0x31135b['params']['id']}},_0x5ef901={};_0x5ef901[_0xb9be('0x2a')]=_[_0xb9be('0x26')](db['SAInvoice'][_0xb9be('0x25')]);_0x5ef901[_0xb9be('0x27')]=_['keys'](_0x31135b[_0xb9be('0x27')]);_0x5ef901[_0xb9be('0x28')]=_['intersection'](_0x5ef901[_0xb9be('0x2a')],_0x5ef901[_0xb9be('0x27')]);_0x5d4841[_0xb9be('0x2c')]=_[_0xb9be('0x29')](_0x5ef901['model'],qs[_0xb9be('0x2b')](_0x31135b[_0xb9be('0x27')][_0xb9be('0x2b')]));_0x5d4841[_0xb9be('0x2c')]=_0x5d4841[_0xb9be('0x2c')]['length']?_0x5d4841['attributes']:_0x5ef901[_0xb9be('0x2a')];if(_0x31135b[_0xb9be('0x27')][_0xb9be('0x39')]){_0x5d4841[_0xb9be('0x3a')]=[{'all':!![]}];}_0x5d4841=_[_0xb9be('0x34')]({},_0x5d4841,_0x31135b[_0xb9be('0x40')]);return db['SAInvoice'][_0xb9be('0x41')](_0x5d4841)['then'](handleEntityNotFound(_0x2a84ea,null))[_0xb9be('0x3c')](respondWithResult(_0x2a84ea,null))[_0xb9be('0x3e')](handleError(_0x2a84ea,null));};exports[_0xb9be('0x42')]=function(_0x24aff5,_0x426667){return db[_0xb9be('0x43')][_0xb9be('0x44')]({'isolationLevel':db[_0xb9be('0x45')][_0xb9be('0x46')][_0xb9be('0x47')]['SERIALIZABLE']},function(_0x2302b7){return db[_0xb9be('0x24')][_0xb9be('0x42')](_0x24aff5[_0xb9be('0x48')],{'transaction':_0x2302b7});})['then'](respondWithResult(_0x426667,0xc9))[_0xb9be('0x3e')](handleError(_0x426667,null));};exports[_0xb9be('0x20')]=function(_0x33a956,_0x5af265){if(_0x33a956[_0xb9be('0x48')]['id']){delete _0x33a956[_0xb9be('0x48')]['id'];}return db[_0xb9be('0x24')][_0xb9be('0x41')]({'where':{'id':_0x33a956['params']['id']}})[_0xb9be('0x3c')](handleEntityNotFound(_0x5af265,null))[_0xb9be('0x3c')](saveUpdates(_0x33a956[_0xb9be('0x48')],null))[_0xb9be('0x3c')](respondWithResult(_0x5af265,null))['catch'](handleError(_0x5af265,null));};exports[_0xb9be('0x21')]=function(_0x342e57,_0x4cb93a){return db[_0xb9be('0x24')][_0xb9be('0x41')]({'where':{'id':_0x342e57[_0xb9be('0x49')]['id']}})[_0xb9be('0x3c')](handleEntityNotFound(_0x4cb93a,null))[_0xb9be('0x3c')](removeEntity(_0x4cb93a,null))[_0xb9be('0x3e')](handleError(_0x4cb93a,null));};exports['describe']=function(_0x23c7a0,_0x1e161a){return db[_0xb9be('0x24')][_0xb9be('0x4a')]()['then'](respondWithResult(_0x1e161a,null))[_0xb9be('0x3e')](handleError(_0x1e161a,null));};exports[_0xb9be('0x4b')]=function(_0x18798e,_0x1723cf){var _0x30371a=moment()['unix']()[_0xb9be('0x4c')]();var _0x4741f5=path[_0xb9be('0x4d')](config[_0xb9be('0x4e')],_0xb9be('0x4f'),'files','tmp');var _0xbc8012=path[_0xb9be('0x4d')](config['root'],_0xb9be('0x4f'),'files',_0xb9be('0x50'),_0xb9be('0x51'),_0xb9be('0x52'));var _0x452e3f=path[_0xb9be('0x4d')](config['root'],_0xb9be('0x4f'),_0xb9be('0x53'),'images','logos','paid-invoice.png');var _0x3d6696=path[_0xb9be('0x4d')](_0x4741f5,_0x30371a);var _0x3d0761=util[_0xb9be('0x54')](_0xb9be('0x55'),_0x18798e['params']['id'],_0x30371a);var _0x5a6452=path[_0xb9be('0x4d')](_0x3d6696,_0x3d0761);var _0x3f2981=![];var _0x95812={};return db[_0xb9be('0x24')][_0xb9be('0x41')]({'where':{'id':_0x18798e[_0xb9be('0x49')]['id']},'raw':!![]})[_0xb9be('0x3c')](handleEntityNotFound(_0x1723cf,null))['then'](function(_0x810593){if(_0x810593){_0x95812[_0xb9be('0x56')]=_0x810593;return db[_0xb9be('0x57')]['findAll']({'where':{'InvoiceId':_0x810593['id']},'raw':!![]})[_0xb9be('0x3c')](function(_0x582fcb){_0x95812[_0xb9be('0x58')]=_0x582fcb;_0x3f2981=!![];var _0x540ad4='';var _0xc589e6={'format':'A4','orientation':_0xb9be('0x59'),'border':_0xb9be('0x5a'),'footer':{'height':_0xb9be('0x5b'),'contents':{'default':_0xb9be('0x5c')}}};_0xc589e6[_0xb9be('0x5d')]['contents'][_0xb9be('0x5e')]=_0xc589e6[_0xb9be('0x5d')]['contents']['default']+''+_0x95812[_0xb9be('0x56')]['issuerWeb']+_0xb9be('0x5f');fs[_0xb9be('0x60')](_0x3d6696);_0x540ad4=_0xb9be('0x61');_0x540ad4+=_0xb9be('0x62');_0x540ad4+=_0xb9be('0x63');var _0x293994={'phone':{'en':_0xb9be('0x64'),'it':'Telefono'},'fax':{'en':_0xb9be('0x65'),'it':'Fax'},'email':{'en':_0xb9be('0x66'),'it':_0xb9be('0x66')},'piva':{'en':_0xb9be('0x67'),'it':'P.IVA'},'cf':{'en':_0xb9be('0x68'),'it':_0xb9be('0x69')},'sdi':{'en':'I.S.\x20code','it':_0xb9be('0x6a')},'cs':{'en':_0xb9be('0x6b'),'it':_0xb9be('0x6c')},'invoice':{'en':'Invoice','it':_0xb9be('0x6d')},'proforma':{'en':_0xb9be('0x6e'),'it':_0xb9be('0x6e')},'creditnote':{'en':_0xb9be('0x6f'),'it':_0xb9be('0x70')},'duedate':{'en':'Due\x20date','it':_0xb9be('0x71')},'item':{'en':_0xb9be('0x72'),'it':_0xb9be('0x73')},'description':{'en':_0xb9be('0x74'),'it':_0xb9be('0x75')},'hrsqty':{'en':'Hrs/Qty','it':_0xb9be('0x76')},'unitprice':{'en':_0xb9be('0x77'),'it':_0xb9be('0x78')},'subtotal':{'en':_0xb9be('0x79'),'it':_0xb9be('0x7a')},'discount':{'en':_0xb9be('0x7b'),'it':_0xb9be('0x7c')},'total':{'en':_0xb9be('0x7d'),'it':_0xb9be('0x7e')},'tax':{'en':_0xb9be('0x7f'),'it':_0xb9be('0x80')},'nettopay':{'en':_0xb9be('0x81'),'it':_0xb9be('0x82')},'sendpayment':{'en':_0xb9be('0x83'),'it':_0xb9be('0x84')},'accountholder':{'en':_0xb9be('0x85'),'it':_0xb9be('0x86')},'bankname':{'en':_0xb9be('0x87'),'it':_0xb9be('0x88')},'bankaddress':{'en':_0xb9be('0x89'),'it':_0xb9be('0x8a')},'abi':{'en':_0xb9be('0x8b'),'it':'ABI'},'cab':{'en':_0xb9be('0x8c'),'it':_0xb9be('0x8c')},'bic':{'en':'BIC','it':_0xb9be('0x8d')},'swif':{'en':'SWIF','it':_0xb9be('0x8e')},'iban':{'en':'IBAN','it':_0xb9be('0x8f')},'paypal':{'en':_0xb9be('0x90'),'it':_0xb9be('0x91')},'thank1':{'en':'Thank\x20you\x20for\x20your\x20business.\x20We\x20do\x20expect\x20payment\x20by\x20','it':_0xb9be('0x92')},'thank2':{'en':_0xb9be('0x93'),'it':_0xb9be('0x94')}};var _0x51a05b='it';if(_0x95812[_0xb9be('0x56')]['receivingCountry']!=='Italy'){_0x51a05b='en';}_0x540ad4+='';_0x540ad4+=_0xb9be('0x95')+_0xbc8012+'\x22\x20width=\x22180\x22>';_0x540ad4+=_0xb9be('0x96');_0x540ad4+=util[_0xb9be('0x54')](_0xb9be('0x97'),_0x95812[_0xb9be('0x56')][_0xb9be('0x98')]);_0x540ad4+=util[_0xb9be('0x54')](_0xb9be('0x99'),_0x95812['invoice'][_0xb9be('0x9a')]);_0x540ad4+=util[_0xb9be('0x54')]('%s',_0x95812[_0xb9be('0x56')][_0xb9be('0x9b')]);_0x540ad4+=util[_0xb9be('0x54')](_0xb9be('0x9c'),_0x95812[_0xb9be('0x56')][_0xb9be('0x9d')]);_0x540ad4+=util[_0xb9be('0x54')](_0xb9be('0x9e'),_0x95812[_0xb9be('0x56')][_0xb9be('0x9f')]);_0x540ad4+=util[_0xb9be('0x54')](_0x293994[_0xb9be('0xa0')][_0x51a05b]+_0xb9be('0xa1'),_0x95812[_0xb9be('0x56')][_0xb9be('0xa2')]);_0x540ad4+=util[_0xb9be('0x54')](_0x293994[_0xb9be('0xa3')][_0x51a05b]+_0xb9be('0xa1'),_0x95812[_0xb9be('0x56')][_0xb9be('0xa4')]);_0x540ad4+=util[_0xb9be('0x54')](_0x293994[_0xb9be('0xa5')][_0x51a05b]+_0xb9be('0xa1'),_0x95812[_0xb9be('0x56')][_0xb9be('0xa6')]);_0x540ad4+=util['format'](_0x293994[_0xb9be('0xa7')][_0x51a05b]+_0xb9be('0xa1'),_0x95812[_0xb9be('0x56')][_0xb9be('0xa8')]);_0x540ad4+=util[_0xb9be('0x54')](_0x293994['cf'][_0x51a05b]+_0xb9be('0xa1'),_0x95812[_0xb9be('0x56')][_0xb9be('0xa9')]);_0x540ad4+=util[_0xb9be('0x54')](_0x293994[_0xb9be('0xaa')][_0x51a05b]+_0xb9be('0xa1'),_0x95812['invoice'][_0xb9be('0xab')]);_0x540ad4+=util[_0xb9be('0x54')](_0x293994['cs'][_0x51a05b]+_0xb9be('0xa1'),_0x95812['invoice'][_0xb9be('0xac')]);_0x540ad4+=_0xb9be('0xad');_0x540ad4+=_0xb9be('0xae');_0x540ad4+=_0xb9be('0xaf');_0x540ad4+=util[_0xb9be('0x54')](_0xb9be('0xb0'),_0x95812[_0xb9be('0x56')]['companyName']);_0x540ad4+=util[_0xb9be('0x54')](_0xb9be('0x99'),_0x95812[_0xb9be('0x56')][_0xb9be('0xb1')]);_0x540ad4+=util[_0xb9be('0x54')](_0xb9be('0xb2'),_0x95812[_0xb9be('0x56')][_0xb9be('0xb3')]);_0x540ad4+=util[_0xb9be('0x54')]('%s
',_0x95812[_0xb9be('0x56')][_0xb9be('0xb4')]);_0x540ad4+=util[_0xb9be('0x54')](_0xb9be('0x99'),_0x95812[_0xb9be('0x56')]['receivingCountry']);_0x540ad4+='';if(_0x95812[_0xb9be('0x56')][_0xb9be('0xb5')]){_0x540ad4+=util[_0xb9be('0x54')](_0x293994['cf'][_0x51a05b]+':\x20%s
',_0x95812[_0xb9be('0x56')][_0xb9be('0xb5')]);}_0x540ad4+=util[_0xb9be('0x54')](_0x293994[_0xb9be('0xa7')][_0x51a05b]+_0xb9be('0xa1'),_0x95812['invoice']['receivingPIVA']);if(_0x95812[_0xb9be('0x56')]['receivingSDICode']){_0x540ad4+=util[_0xb9be('0x54')](_0x293994[_0xb9be('0xaa')][_0x51a05b]+_0xb9be('0xa1'),_0x95812[_0xb9be('0x56')]['receivingSDICode']);}_0x540ad4+=_0xb9be('0xb6');_0x540ad4+=_0xb9be('0xb7');_0x540ad4+=_0xb9be('0x96');_0x540ad4+='';_0x540ad4+=util['format'](''+_0x293994[_0xb9be('0x56')][_0x51a05b]+_0xb9be('0xb8'),_0x810593[_0xb9be('0xb9')]);_0x540ad4+=util[_0xb9be('0x54')](_0xb9be('0xba'),_0x95812[_0xb9be('0x56')][_0xb9be('0x9d')]);var _0x310aad=moment(_0x95812[_0xb9be('0x56')][_0xb9be('0xbb')])['format'](_0xb9be('0xbc'));_0x540ad4+=util['format'](_0xb9be('0xbd'),_0x310aad);var _0x426e04=moment(_0x95812[_0xb9be('0x56')][_0xb9be('0xbb')])[_0xb9be('0xbe')](_0x95812[_0xb9be('0x56')][_0xb9be('0xbf')],'days')['format'](_0xb9be('0xbc'));if(_0x95812[_0xb9be('0x56')]['endDate']){_0x426e04=moment(_0x95812['invoice'][_0xb9be('0xc0')])[_0xb9be('0x54')](_0xb9be('0xbc'));}_0x540ad4+=util[_0xb9be('0x54')](''+_0x293994[_0xb9be('0xc1')][_0x51a05b]+':\x20%s',_0x426e04);_0x540ad4+=_0xb9be('0xb7');_0x540ad4+=_0xb9be('0x96');_0x540ad4+='';_0x540ad4+=_0xb9be('0xc2');_0x540ad4+=_0xb9be('0x96');_0x540ad4+=''+_0x293994[_0xb9be('0xc3')][_0x51a05b]+_0xb9be('0xc4');_0x540ad4+=_0xb9be('0xc5')+_0x293994[_0xb9be('0xc6')][_0x51a05b]+'';_0x540ad4+=_0xb9be('0xc5')+_0x293994[_0xb9be('0xc7')][_0x51a05b]+_0xb9be('0xc4');_0x540ad4+=_0xb9be('0xc5')+_0x293994[_0xb9be('0xc8')][_0x51a05b]+_0xb9be('0xc4');_0x540ad4+=_0xb9be('0xc5')+_0x293994[_0xb9be('0xc9')][_0x51a05b]+_0xb9be('0xc4');_0x540ad4+=_0xb9be('0xb7');var _0x214f28=0x0;var _0x29f812=0x0;for(var _0x39a6cb=0x0;_0x39a6cb<_0x95812['details'][_0xb9be('0x2d')];_0x39a6cb++){var _0x552ed0=0x0;var _0x48652d=0x0;var _0x41b163=0x0;var _0x3aa02a=0x0;_0x552ed0=_0x95812['details'][_0x39a6cb]['netPrice']-_0x95812[_0xb9be('0x58')][_0x39a6cb][_0xb9be('0xca')]/0x64*_0x95812[_0xb9be('0x58')][_0x39a6cb][_0xb9be('0xcb')];_0x48652d=_0x552ed0/0x64*_0x95812[_0xb9be('0x58')][_0x39a6cb][_0xb9be('0xcc')];_0x41b163=_0x552ed0*_0x95812[_0xb9be('0x58')][_0x39a6cb]['quantity'];_0x3aa02a=_0x48652d*_0x95812[_0xb9be('0x58')][_0x39a6cb][_0xb9be('0xcd')];_0x540ad4+=_0xb9be('0x96');_0x540ad4+=util[_0xb9be('0x54')](_0xb9be('0xce'),_0x95812[_0xb9be('0x58')][_0x39a6cb]['productName']);_0x540ad4+=util['format'](_0xb9be('0xce'),_0x95812[_0xb9be('0x58')][_0x39a6cb][_0xb9be('0xcf')]);_0x540ad4+=util[_0xb9be('0x54')](_0xb9be('0xd0'),_0x95812[_0xb9be('0x58')][_0x39a6cb][_0xb9be('0xcd')]);_0x540ad4+=_0xb9be('0xd1')+_0x552ed0[_0xb9be('0xd2')](0x2)+'€';_0x540ad4+=''+_0x41b163[_0xb9be('0xd2')](0x2)+'€';_0x540ad4+=_0xb9be('0xb7');_0x214f28+=_0x41b163;_0x29f812+=_0x3aa02a;}_0x540ad4+=_0xb9be('0xd3');if(!_['isNil'](_0x95812[_0xb9be('0x56')][_0xb9be('0xcb')])){var _0x3d58a7=0x0;var _0x5363cf=0x0;var _0x169d71=_0x95812[_0xb9be('0x56')][_0xb9be('0xcb')]*0x64/_0x214f28;for(var _0x39a6cb=0x0;_0x39a6cb<_0x95812[_0xb9be('0x58')][_0xb9be('0x2d')];_0x39a6cb++){var _0x131875=0x0;var _0x11f299=0x0;var _0x5def47=0x0;_0x552ed0=_0x95812[_0xb9be('0x58')][_0x39a6cb]['netPrice']-_0x95812['details'][_0x39a6cb][_0xb9be('0xca')]/0x64*_0x95812[_0xb9be('0x58')][_0x39a6cb][_0xb9be('0xcb')];_0x131875=_0x552ed0/0x64*_0x169d71;_0x11f299=_0x552ed0-_0x131875;_0x5def47=_0x11f299*_0x95812[_0xb9be('0x58')][_0x39a6cb][_0xb9be('0xcd')];_0x3d58a7+=_0x5def47;_0x5363cf+=_0x5def47/0x64*_0x95812[_0xb9be('0x58')][_0x39a6cb][_0xb9be('0xcc')];}}var _0x28448e=0x0;var _0x101bf2=0x0;var _0x45b73b=![];var _0x5391c5=_0x95812[_0xb9be('0x56')][_0xb9be('0xd4')];if(_0x5391c5['indexOf'](_0xb9be('0xd5'))!=-0x1){_0x45b73b=!![];}if(!_[_0xb9be('0xd6')](_0x95812[_0xb9be('0x56')][_0xb9be('0xcb')])){_0x540ad4+=_0xb9be('0x96');if(_0x95812[_0xb9be('0x56')][_0xb9be('0xcb')]>0x0){_0x540ad4+=_0xb9be('0xd7')+_0x293994[_0xb9be('0xcb')][_0x51a05b]+_0xb9be('0xad');_0x540ad4+='\x20'+_0x95812[_0xb9be('0x56')][_0xb9be('0xcb')][_0xb9be('0xd2')](0x2)+'€';}_0x540ad4+='';_0x28448e=_0x5363cf;_0x101bf2=_0x3d58a7;}else{_0x28448e=_0x29f812;_0x101bf2=_0x214f28;}if(_0x28448e>0x0||_0x95812[_0xb9be('0x56')][_0xb9be('0xcb')]>0x0){_0x540ad4+=_0xb9be('0x96');_0x540ad4+=''+_0x293994[_0xb9be('0xd8')][_0x51a05b]+_0xb9be('0xad');_0x540ad4+=_0xb9be('0xd1')+_0x101bf2[_0xb9be('0xd2')](0x2)+_0xb9be('0xd9');_0x540ad4+='';}if(_0x28448e>0x0){_0x540ad4+=_0xb9be('0x96');_0x540ad4+=_0xb9be('0xda')+_0x293994[_0xb9be('0xcc')][_0x51a05b]+_0xb9be('0xad');_0x540ad4+=''+_0x28448e['toFixed'](0x2)+_0xb9be('0xd9');_0x540ad4+=_0xb9be('0xb7');}_0x540ad4+=_0xb9be('0x96');var _0x5745f5;if(_0x45b73b){_0x5745f5=_0x101bf2;}else{_0x5745f5=_0x101bf2+_0x28448e;}_0x540ad4+=_0xb9be('0xdb')+_0x293994[_0xb9be('0xdc')][_0x51a05b]+_0xb9be('0xdd')+_0x5745f5['toFixed'](0x2)+_0xb9be('0xd9');_0x540ad4+=_0xb9be('0xde');_0x540ad4+=_0xb9be('0xb7');_0x540ad4+=_0xb9be('0xdf');_0x540ad4+=_0xb9be('0xe0');_0x540ad4+=_0xb9be('0x96');_0x540ad4+=util[_0xb9be('0x54')](_0xb9be('0xe1'),_0x95812[_0xb9be('0x56')][_0xb9be('0xd4')][_0xb9be('0xe2')](new RegExp(String[_0xb9be('0xe3')](0xd),'g'),_0xb9be('0xe4')));_0x540ad4+=_0xb9be('0xb7');_0x540ad4+=_0xb9be('0x96');_0x540ad4+=_0xb9be('0xe5');_0x540ad4+=_0xb9be('0xe6')+_0x293994[_0xb9be('0xe7')][_0x51a05b]+_0xb9be('0xe8');if(!_[_0xb9be('0xd6')](_0x95812[_0xb9be('0x56')]['issuerBankAccount'])){_0x540ad4+=_0xb9be('0xe6')+_0x293994[_0xb9be('0xe9')][_0x51a05b]+_0xb9be('0xea')+_0x95812['invoice'][_0xb9be('0xeb')]+_0xb9be('0xec');_0x540ad4+=_0xb9be('0xe6')+_0x293994[_0xb9be('0xed')][_0x51a05b]+_0xb9be('0xea')+_0x95812['invoice'][_0xb9be('0xee')]+_0xb9be('0xef');_0x540ad4+=_0xb9be('0xe6')+_0x293994[_0xb9be('0xf0')][_0x51a05b]+_0xb9be('0xea')+_0x95812[_0xb9be('0x56')][_0xb9be('0xf1')]+',\x20'+_0x95812[_0xb9be('0x56')]['issuerBankPostalCode']+_0xb9be('0xf2')+_0x95812[_0xb9be('0x56')]['issuerBankCity']+'\x20('+_0x95812[_0xb9be('0x56')][_0xb9be('0xf3')]+')'+_0xb9be('0xec');_0x540ad4+=''+_0x293994['abi'][_0x51a05b]+'/'+_0x293994['cab'][_0x51a05b]+':\x20'+_0x95812[_0xb9be('0x56')]['issuerABI']+'/'+_0x95812['invoice'][_0xb9be('0xf4')]+_0xb9be('0xec');_0x540ad4+=_0xb9be('0xe6')+_0x293994[_0xb9be('0xf5')][_0x51a05b]+'/'+_0x293994[_0xb9be('0xf6')][_0x51a05b]+_0xb9be('0xea')+_0x95812[_0xb9be('0x56')][_0xb9be('0xf7')]+_0xb9be('0xec');_0x540ad4+=''+_0x293994[_0xb9be('0xf8')][_0x51a05b]+':\x20'+_0x95812[_0xb9be('0x56')][_0xb9be('0xf9')]+_0xb9be('0xec');}if(!_[_0xb9be('0xd6')](_0x95812[_0xb9be('0x56')][_0xb9be('0xfa')])){_0x540ad4+=_0xb9be('0xe6')+_0x293994['paypal'][_0x51a05b]+':\x20'+_0x95812[_0xb9be('0x56')][_0xb9be('0xfa')]+'';}_0x540ad4+=_0xb9be('0xe6')+_0x293994['thank1'][_0x51a05b]+_0xb9be('0xfb')+_0x426e04+_0xb9be('0xfc')+_0x293994[_0xb9be('0xfd')][_0x51a05b]+_0xb9be('0x5f');_0x540ad4+='';_0x540ad4+=_0xb9be('0xb7');if(_0x95812[_0xb9be('0x56')][_0xb9be('0xfe')]===0x1){_0x540ad4+=_0xb9be('0x95')+_0x452e3f+_0xb9be('0xff');}_0x540ad4+=_0xb9be('0x100');_0x540ad4+='';_0x540ad4+=_0xb9be('0x101');console[_0xb9be('0x102')](_0xb9be('0x48'),_0x540ad4);return new BPromise(function(_0x1b6fb9,_0x3b17a1){pdf[_0xb9be('0x42')](_0x540ad4,_0xc589e6)[_0xb9be('0x103')](path[_0xb9be('0x4d')](_0x3d6696,_0x3d0761),function(_0x172810,_0x4d2a71){if(_0x172810)return _0x3b17a1(_0x172810);_0x1b6fb9(_0x4d2a71);});});});}})[_0xb9be('0x3c')](function(){if(_0x3f2981){console[_0xb9be('0x102')](_0xb9be('0x104'),_0x5a6452,_0x3d0761);return _0x1723cf[_0xb9be('0x105')](_0x5a6452,_0x3d0761,function(_0x39df10){if(_0x39df10){console['log'](_0xb9be('0x106'),_0x39df10);}else{console[_0xb9be('0x102')](_0xb9be('0x107'),_0x3d6696);rimraf(_0x3d6696,function(){});}});}else{return _0x1723cf['sendStatus'](0xc8);}})[_0xb9be('0x3e')](handleError(_0x1723cf,null));};exports['getInvoicesNumberByYear']=function(_0x23e83b,_0x1420e8){var _0xd16d1b=_0x23e83b[_0xb9be('0x27')][_0xb9be('0x108')];var _0x19d425=squel[_0xb9be('0x109')]()[_0xb9be('0x10a')](_0xb9be('0x10b'))['field']('count(id)','invoiceNumber')[_0xb9be('0x38')]('YEAR(startDate)','invoiceYear')[_0xb9be('0x38')]('MONTH(startDate)','invoiceMonth')[_0xb9be('0x32')]('YEAR(startDate)\x20IN\x20('+_0xd16d1b+')')['order'](_0xb9be('0x10c'))['order'](_0xb9be('0x10d'),![])[_0xb9be('0x10e')](_0xb9be('0x10d'))[_0xb9be('0x10e')](_0xb9be('0x10c'));return db[_0xb9be('0x43')][_0xb9be('0x27')](_0x19d425[_0xb9be('0x4c')](),{'type':db[_0xb9be('0x43')][_0xb9be('0x10f')][_0xb9be('0x110')]})[_0xb9be('0x3c')](function(_0x442ecf){return{'count':_0x442ecf['length'],'rows':_0x442ecf};})[_0xb9be('0x3c')](handleEntityNotFound(_0x1420e8,null))[_0xb9be('0x3c')](respondWithResult(_0x1420e8,null))[_0xb9be('0x3e')](handleError(_0x1420e8,null));};exports[_0xb9be('0x111')]=function(_0x1438f6,_0x24a03e){var _0x5e7516=_0x1438f6[_0xb9be('0x27')][_0xb9be('0x108')];var _0xc3d5d9=squel[_0xb9be('0x109')]()[_0xb9be('0x10a')](_0xb9be('0x112'),'said')['field'](_0xb9be('0x10c'),_0xb9be('0x113'))[_0xb9be('0x38')](_0xb9be('0x10d'),_0xb9be('0x114'))['field'](_0xb9be('0x115'),_0xb9be('0x116'))[_0xb9be('0x4d')](_0xb9be('0x10b'),_0xb9be('0x117'),_0xb9be('0x118'))['where']('YEAR(startDate)\x20IN\x20('+_0x5e7516+')')[_0xb9be('0x30')]('MONTH(startDate)')[_0xb9be('0x30')](_0xb9be('0x10d'),![])[_0xb9be('0x10e')](_0xb9be('0x10d'))[_0xb9be('0x10e')](_0xb9be('0x10c'));return db[_0xb9be('0x43')][_0xb9be('0x27')](_0xc3d5d9[_0xb9be('0x4c')](),{'type':db['sequelize'][_0xb9be('0x10f')][_0xb9be('0x110')]})[_0xb9be('0x3c')](function(_0x36b564){return{'count':_0x36b564[_0xb9be('0x2d')],'rows':_0x36b564};})[_0xb9be('0x3c')](handleEntityNotFound(_0x24a03e,null))[_0xb9be('0x3c')](respondWithResult(_0x24a03e,null))[_0xb9be('0x3e')](handleError(_0x24a03e,null));};function addInvoiceCreditnoteDetail(_0x3c2832,_0x331f6a,_0x4762d8){console[_0xb9be('0x102')](_0xb9be('0x119'),_0x3c2832);var _0x2cb30f={'companyName':_0x3c2832[_0xb9be('0x11a')],'companyId':_0x3c2832[_0xb9be('0x11b')],'productName':_0x3c2832['productName'],'productCode':_0x3c2832[_0xb9be('0x11c')],'productDescription':_0x3c2832['productDescription'],'typeName':_0x3c2832[_0xb9be('0x11d')],'pricelistName':_0x3c2832[_0xb9be('0x11e')],'priceListId':_0x3c2832['priceListId'],'netPrice':_0x3c2832[_0xb9be('0xca')],'discount':_0x3c2832['discount'],'tax':_0x3c2832['tax'],'agentFullname':_0x3c2832[_0xb9be('0x11f')],'note':_0x3c2832[_0xb9be('0x120')],'subscriptionId':_0x3c2832['subscriptionId'],'subscriptionName':_0x3c2832['subscriptionName'],'subscriptionMonthly':_0x3c2832[_0xb9be('0x121')],'quantity':_0x3c2832['quantity'],'CreditNoteId':_0x331f6a,'unitName':_0x3c2832[_0xb9be('0x122')]};return db[_0xb9be('0x123')]['create'](_0x2cb30f,{'transaction':_0x4762d8});}exports[_0xb9be('0x124')]=function(_0x93e5f0,_0x4346f5,_0x5c1b1d){var _0x1fcd2d;if(_0x93e5f0[_0xb9be('0x48')]['id']){delete _0x93e5f0[_0xb9be('0x48')]['id'];}console[_0xb9be('0x102')](_0x93e5f0);return db[_0xb9be('0x43')]['transaction'](function(_0x955e45){return db[_0xb9be('0x125')][_0xb9be('0x42')](_0x93e5f0['body'],{'transaction':_0x955e45})['then'](function(_0x168d7d){_0x1fcd2d=_0x168d7d;var _0xec2faf=_0x93e5f0[_0xb9be('0x49')]['id'];return db[_0xb9be('0x57')][_0xb9be('0x3b')]({'where':{'InvoiceId':_0xec2faf},'raw':!![],'logging':console[_0xb9be('0x102')]});})[_0xb9be('0x3c')](function(_0x350b1e){if(_0x350b1e[_0xb9be('0x2d')]>0x0){var _0xd51f31=[];for(var _0x5ea68f=0x0;_0x5ea68f<_0x350b1e[_0xb9be('0x2d')];_0x5ea68f++){_0xd51f31[_0xb9be('0x126')](addInvoiceCreditnoteDetail(_0x350b1e[_0x5ea68f],_0x1fcd2d['id'],_0x955e45));}return BPromise['all'](_0xd51f31);}else{var _0xd3a78b={'errors':[{'type':_0xb9be('0x127'),'message':'No\x20product\x20to\x20assign\x20credit\x20note.\x20Credit\x20note\x20not\x20created!!\x20'}]};throw _0xd3a78b;}});})[_0xb9be('0x3c')](function(){return _0x4346f5[_0xb9be('0x22')](0xc8);})['catch'](function(_0x35f720){console[_0xb9be('0x102')](_0xb9be('0x128'),_0x35f720);if(_0x35f720['name']===_0xb9be('0x129')){var _0x35f720={'errors':[{'message':_0xb9be('0x12a')}]};}_0x4346f5[_0xb9be('0x16')](0x1f4)[_0xb9be('0x12b')](_0x35f720);});}; \ No newline at end of file diff --git a/server/api/saInvoice/saInvoice.model.js b/server/api/saInvoice/saInvoice.model.js index 42b821d..85a76ed 100644 --- a/server/api/saInvoice/saInvoice.model.js +++ b/server/api/saInvoice/saInvoice.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcca7=['findOne','transaction','number','create','then','TCL:\x20error','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./saInvoice.attributes','exports','sa_invoices','models','get','YYYY','has','SAInvoiceNumber'];(function(_0x882a20,_0x137b5f){var _0x5eee06=function(_0x1e20f8){while(--_0x1e20f8){_0x882a20['push'](_0x882a20['shift']());}};_0x5eee06(++_0x137b5f);}(_0xcca7,0x1aa));var _0x7cca=function(_0x12bfaf,_0x262b75){_0x12bfaf=_0x12bfaf-0x0;var _0x41c075=_0xcca7[_0x12bfaf];return _0x41c075;};'use strict';var _=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var logger=require(_0x7cca('0x2'))(_0x7cca('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7cca('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7cca('0x5'));var config=require(_0x7cca('0x6'));var attributes=require(_0x7cca('0x7'));module[_0x7cca('0x8')]=function(_0x1c6c95,_0xe70805){return _0x1c6c95['define']('SAInvoice',attributes,{'tableName':_0x7cca('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xd7a28d,_0x1aed1b,_0x1e8cb9){var _0x18bac4=_0x1c6c95[_0x7cca('0xa')];var _0x20ffa9=_0xd7a28d[_0x7cca('0xb')]({'plain':!![]});var _0x27323a=0x1;var _0x1a773e=parseInt(moment()['format'](_0x7cca('0xc')));try{if(_[_0x7cca('0xd')](_0x20ffa9,'id')){return _0x18bac4[_0x7cca('0xe')][_0x7cca('0xf')]({'where':{'year':_0x1a773e},'raw':!![],'logging':!![],'transaction':_0x1aed1b[_0x7cca('0x10')]})['then'](function(_0x2a14cc){if(_0x2a14cc){_0x27323a=_0x2a14cc[_0x7cca('0x11')]+0x1;return _0x18bac4[_0x7cca('0xe')]['update']({'number':_0x27323a},{'where':{'id':_0x2a14cc['id']},'transaction':_0x1aed1b['transaction'],'logging':!![]});}return _0x18bac4[_0x7cca('0xe')][_0x7cca('0x12')]({'year':_0x1a773e,'number':_0x27323a},{'logging':!![],'transaction':_0x1aed1b[_0x7cca('0x10')]});})[_0x7cca('0x13')](function(){_0x20ffa9[_0x7cca('0x11')]=_0x27323a;})[_0x7cca('0x13')](function(){_0x1e8cb9();});}}catch(_0x45143d){console['log'](_0x7cca('0x14'),_0x45143d);_0x1e8cb9();}}}});}; \ No newline at end of file +var _0x3c6c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','get','YYYY','has','SAInvoiceNumber','then','number','update','transaction','create','log','TCL:\x20error','lodash','../../config/logger','api'];(function(_0x2eb988,_0x5abc48){var _0x4e98c0=function(_0x2b1b82){while(--_0x2b1b82){_0x2eb988['push'](_0x2eb988['shift']());}};_0x4e98c0(++_0x5abc48);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x255cf6,_0x28f0a3){_0x255cf6=_0x255cf6-0x0;var _0x3e38ff=_0x3c6c[_0x255cf6];return _0x3e38ff;};'use strict';var _=require(_0xc3c6('0x0'));var util=require('util');var logger=require(_0xc3c6('0x1'))(_0xc3c6('0x2'));var moment=require(_0xc3c6('0x3'));var BPromise=require(_0xc3c6('0x4'));var rp=require(_0xc3c6('0x5'));var fs=require('fs');var path=require(_0xc3c6('0x6'));var rimraf=require(_0xc3c6('0x7'));var config=require(_0xc3c6('0x8'));var attributes=require('./saInvoice.attributes');module[_0xc3c6('0x9')]=function(_0x4a2ca1,_0xe7731e){return _0x4a2ca1['define']('SAInvoice',attributes,{'tableName':'sa_invoices','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5185c3,_0x4f39dd,_0x12fabf){var _0x1c04d4=_0x4a2ca1['models'];var _0x168fdc=_0x5185c3[_0xc3c6('0xa')]({'plain':!![]});var _0x44b9c9=0x1;var _0x377311=parseInt(moment()['format'](_0xc3c6('0xb')));try{if(_[_0xc3c6('0xc')](_0x168fdc,'id')){return _0x1c04d4[_0xc3c6('0xd')]['findOne']({'where':{'year':_0x377311},'raw':!![],'logging':!![],'transaction':_0x4f39dd['transaction']})[_0xc3c6('0xe')](function(_0x407147){if(_0x407147){_0x44b9c9=_0x407147[_0xc3c6('0xf')]+0x1;return _0x1c04d4[_0xc3c6('0xd')][_0xc3c6('0x10')]({'number':_0x44b9c9},{'where':{'id':_0x407147['id']},'transaction':_0x4f39dd[_0xc3c6('0x11')],'logging':!![]});}return _0x1c04d4[_0xc3c6('0xd')][_0xc3c6('0x12')]({'year':_0x377311,'number':_0x44b9c9},{'logging':!![],'transaction':_0x4f39dd[_0xc3c6('0x11')]});})[_0xc3c6('0xe')](function(){_0x168fdc[_0xc3c6('0xf')]=_0x44b9c9;})[_0xc3c6('0xe')](function(){_0x12fabf();});}}catch(_0x37a6a8){console[_0xc3c6('0x13')](_0xc3c6('0x14'),_0x37a6a8);_0x12fabf();}}}});}; \ No newline at end of file diff --git a/server/api/saInvoice/saInvoice.rpc.js b/server/api/saInvoice/saInvoice.rpc.js index cfe8d3b..ed90c07 100644 --- a/server/api/saInvoice/saInvoice.rpc.js +++ b/server/api/saInvoice/saInvoice.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc7b0=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SAInvoice,\x20%s,\x20%s','request\x20sent','SAInvoice,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x288cef,_0x18898a){var _0x575a93=function(_0x552e7a){while(--_0x552e7a){_0x288cef['push'](_0x288cef['shift']());}};_0x575a93(++_0x18898a);}(_0xc7b0,0x159));var _0x0c7b=function(_0x337f30,_0x288614){_0x337f30=_0x337f30-0x0;var _0x1ab893=_0xc7b0[_0x337f30];return _0x1ab893;};'use strict';var _=require(_0x0c7b('0x0'));var util=require(_0x0c7b('0x1'));var moment=require('moment');var BPromise=require(_0x0c7b('0x2'));var rs=require(_0x0c7b('0x3'));var fs=require('fs');var Redis=require(_0x0c7b('0x4'));var db=require(_0x0c7b('0x5'))['db'];var utils=require(_0x0c7b('0x6'));var logger=require(_0x0c7b('0x7'))(_0x0c7b('0x8'));var config=require(_0x0c7b('0x9'));var jayson=require(_0x0c7b('0xa'));var client=jayson['client'][_0x0c7b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b1180,_0x5c14ce,_0x4de3c3){return new BPromise(function(_0x380aa6,_0x137952){return client[_0x0c7b('0xc')](_0x2b1180,_0x4de3c3)[_0x0c7b('0xd')](function(_0x319762){logger[_0x0c7b('0xe')](_0x0c7b('0xf'),_0x5c14ce,_0x0c7b('0x10'));logger['debug'](_0x0c7b('0x11'),_0x5c14ce,_0x0c7b('0x10'),JSON['stringify'](_0x319762));if(_0x319762[_0x0c7b('0x12')]){if(_0x319762[_0x0c7b('0x12')]['code']===0x1f4){logger['error']('SAInvoice,\x20%s,\x20%s',_0x5c14ce,_0x319762['error'][_0x0c7b('0x13')]);return _0x137952(_0x319762[_0x0c7b('0x12')][_0x0c7b('0x13')]);}logger['error'](_0x0c7b('0xf'),_0x5c14ce,_0x319762[_0x0c7b('0x12')][_0x0c7b('0x13')]);return _0x380aa6(_0x319762[_0x0c7b('0x12')][_0x0c7b('0x13')]);}else{logger['info'](_0x0c7b('0xf'),_0x5c14ce,'request\x20sent');_0x380aa6(_0x319762[_0x0c7b('0x14')]['message']);}})[_0x0c7b('0x15')](function(_0x47d3ec){logger[_0x0c7b('0x12')](_0x0c7b('0xf'),_0x5c14ce,_0x47d3ec);_0x137952(_0x47d3ec);});});} \ No newline at end of file +var _0xc626=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','info','request\x20sent','debug','SAInvoice,\x20%s,\x20%s,\x20%s','stringify','error','code','SAInvoice,\x20%s,\x20%s','message'];(function(_0x4a3f10,_0x3373f1){var _0x1bcf08=function(_0x2e1bdd){while(--_0x2e1bdd){_0x4a3f10['push'](_0x4a3f10['shift']());}};_0x1bcf08(++_0x3373f1);}(_0xc626,0x178));var _0x6c62=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc626[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6c62('0x0'));var util=require(_0x6c62('0x1'));var moment=require(_0x6c62('0x2'));var BPromise=require(_0x6c62('0x3'));var rs=require(_0x6c62('0x4'));var fs=require('fs');var Redis=require(_0x6c62('0x5'));var db=require(_0x6c62('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6c62('0x7'))(_0x6c62('0x8'));var config=require('../../config/environment');var jayson=require(_0x6c62('0x9'));var client=jayson[_0x6c62('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39de1f,_0x4a772f,_0x361a9e){return new BPromise(function(_0x1e8492,_0x46e464){return client['request'](_0x39de1f,_0x361a9e)['then'](function(_0x838240){logger[_0x6c62('0xb')]('SAInvoice,\x20%s,\x20%s',_0x4a772f,_0x6c62('0xc'));logger[_0x6c62('0xd')](_0x6c62('0xe'),_0x4a772f,_0x6c62('0xc'),JSON[_0x6c62('0xf')](_0x838240));if(_0x838240[_0x6c62('0x10')]){if(_0x838240[_0x6c62('0x10')][_0x6c62('0x11')]===0x1f4){logger[_0x6c62('0x10')](_0x6c62('0x12'),_0x4a772f,_0x838240[_0x6c62('0x10')][_0x6c62('0x13')]);return _0x46e464(_0x838240[_0x6c62('0x10')][_0x6c62('0x13')]);}logger['error'](_0x6c62('0x12'),_0x4a772f,_0x838240['error'][_0x6c62('0x13')]);return _0x1e8492(_0x838240[_0x6c62('0x10')][_0x6c62('0x13')]);}else{logger[_0x6c62('0xb')](_0x6c62('0x12'),_0x4a772f,'request\x20sent');_0x1e8492(_0x838240[_0x6c62('0x14')][_0x6c62('0x13')]);}})[_0x6c62('0x15')](function(_0x5428bc){logger['error'](_0x6c62('0x12'),_0x4a772f,_0x5428bc);_0x46e464(_0x5428bc);});});} \ No newline at end of file diff --git a/server/api/saInvoiceDetail/index.js b/server/api/saInvoiceDetail/index.js index 3e55eef..47f44e6 100644 --- a/server/api/saInvoiceDetail/index.js +++ b/server/api/saInvoiceDetail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ea6=['/describe','describe','/:id','show','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saInvoiceDetail.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ea6,0x144));var _0x63ea=function(_0x443261,_0x5c8e46){_0x443261=_0x443261-0x0;var _0x2bab38=_0x3ea6[_0x443261];return _0x2bab38;};'use strict';var multer=require(_0x63ea('0x0'));var util=require('util');var path=require(_0x63ea('0x1'));var timeout=require(_0x63ea('0x2'));var express=require(_0x63ea('0x3'));var router=express[_0x63ea('0x4')]();var auth=require(_0x63ea('0x5'));var interaction=require(_0x63ea('0x6'));var config=require(_0x63ea('0x7'));var controller=require(_0x63ea('0x8'));router[_0x63ea('0x9')]('/',auth[_0x63ea('0xa')](),controller[_0x63ea('0xb')]);router['get'](_0x63ea('0xc'),auth[_0x63ea('0xa')](),controller[_0x63ea('0xd')]);router[_0x63ea('0x9')](_0x63ea('0xe'),auth[_0x63ea('0xa')](),controller[_0x63ea('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x63ea('0x10')](_0x63ea('0xe'),auth[_0x63ea('0xa')](),controller[_0x63ea('0x11')]);router[_0x63ea('0x12')]('/:id',auth[_0x63ea('0xa')](),controller[_0x63ea('0x13')]);module[_0x63ea('0x14')]=router; \ No newline at end of file +var _0xcfb9=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./saInvoiceDetail.controller','get','index','/describe','describe','/:id','isAuthenticated','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x9c3c56,_0x169b56){var _0x2dd782=function(_0x386962){while(--_0x386962){_0x9c3c56['push'](_0x9c3c56['shift']());}};_0x2dd782(++_0x169b56);}(_0xcfb9,0x7b));var _0x9cfb=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0xcfb9[_0x8dc04d];return _0x2f5f28;};'use strict';var multer=require(_0x9cfb('0x0'));var util=require(_0x9cfb('0x1'));var path=require(_0x9cfb('0x2'));var timeout=require(_0x9cfb('0x3'));var express=require(_0x9cfb('0x4'));var router=express[_0x9cfb('0x5')]();var auth=require(_0x9cfb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9cfb('0x7'));var controller=require(_0x9cfb('0x8'));router[_0x9cfb('0x9')]('/',auth['isAuthenticated'](),controller[_0x9cfb('0xa')]);router[_0x9cfb('0x9')](_0x9cfb('0xb'),auth['isAuthenticated'](),controller[_0x9cfb('0xc')]);router[_0x9cfb('0x9')](_0x9cfb('0xd'),auth[_0x9cfb('0xe')](),controller['show']);router[_0x9cfb('0xf')]('/',auth[_0x9cfb('0xe')](),controller[_0x9cfb('0x10')]);router['put'](_0x9cfb('0xd'),auth[_0x9cfb('0xe')](),controller[_0x9cfb('0x11')]);router[_0x9cfb('0x12')](_0x9cfb('0xd'),auth[_0x9cfb('0xe')](),controller[_0x9cfb('0x13')]);module[_0x9cfb('0x14')]=router; \ No newline at end of file diff --git a/server/api/saInvoiceDetail/saInvoiceDetail.attributes.js b/server/api/saInvoiceDetail/saInvoiceDetail.attributes.js index eec54e5..06cb363 100644 --- a/server/api/saInvoiceDetail/saInvoiceDetail.attributes.js +++ b/server/api/saInvoiceDetail/saInvoiceDetail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e63=['DECIMAL','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x5e63,0xa9));var _0x35e6=function(_0x569e8d,_0x51f3ee){_0x569e8d=_0x569e8d-0x0;var _0x2c7097=_0x5e63[_0x569e8d];return _0x2c7097;};'use strict';var Sequelize=require(_0x35e6('0x0'));module[_0x35e6('0x1')]={'companyName':{'type':Sequelize[_0x35e6('0x2')],'allowNull':![]},'companyId':{'type':Sequelize['INTEGER'],'allowNull':![]},'productName':{'type':Sequelize['TEXT'],'allowNull':![]},'productCode':{'type':Sequelize[_0x35e6('0x2')],'allowNull':![]},'productDescription':{'type':Sequelize['TEXT']('long')+'\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci'},'typeName':{'type':Sequelize[_0x35e6('0x2')],'allowNull':![]},'unitName':{'type':Sequelize[_0x35e6('0x2')]},'pricelistName':{'type':Sequelize[_0x35e6('0x3')],'allowNull':![]},'priceListId':{'type':Sequelize[_0x35e6('0x4')],'allowNull':![]},'netPrice':{'type':Sequelize[_0x35e6('0x5')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize[_0x35e6('0x5')](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize[_0x35e6('0x5')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x35e6('0x2')],'allowNull':![]},'note':{'type':Sequelize[_0x35e6('0x3')]},'subscriptionId':{'type':Sequelize[_0x35e6('0x4')],'allowNull':![]},'subscriptionName':{'type':Sequelize[_0x35e6('0x2')],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0x35e6('0x4')],'allowNull':![]},'quantity':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'ProductQuotationId':{'type':Sequelize[_0x35e6('0x4')]}}; \ No newline at end of file +var _0x13dd=['sequelize','STRING','INTEGER','TEXT','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','DECIMAL'];(function(_0x4dde21,_0x3d8960){var _0x541a4d=function(_0x44bd00){while(--_0x44bd00){_0x4dde21['push'](_0x4dde21['shift']());}};_0x541a4d(++_0x3d8960);}(_0x13dd,0x17a));var _0xd13d=function(_0x330a70,_0x3a18ae){_0x330a70=_0x330a70-0x0;var _0x4d1267=_0x13dd[_0x330a70];return _0x4d1267;};'use strict';var Sequelize=require(_0xd13d('0x0'));module['exports']={'companyName':{'type':Sequelize[_0xd13d('0x1')],'allowNull':![]},'companyId':{'type':Sequelize[_0xd13d('0x2')],'allowNull':![]},'productName':{'type':Sequelize['TEXT'],'allowNull':![]},'productCode':{'type':Sequelize[_0xd13d('0x1')],'allowNull':![]},'productDescription':{'type':Sequelize[_0xd13d('0x3')](_0xd13d('0x4'))+_0xd13d('0x5')},'typeName':{'type':Sequelize[_0xd13d('0x1')],'allowNull':![]},'unitName':{'type':Sequelize['STRING']},'pricelistName':{'type':Sequelize[_0xd13d('0x3')],'allowNull':![]},'priceListId':{'type':Sequelize[_0xd13d('0x2')],'allowNull':![]},'netPrice':{'type':Sequelize[_0xd13d('0x6')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize[_0xd13d('0x6')](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize[_0xd13d('0x6')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize['STRING'],'allowNull':![]},'note':{'type':Sequelize['TEXT']},'subscriptionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'subscriptionName':{'type':Sequelize[_0xd13d('0x1')],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0xd13d('0x2')],'allowNull':![]},'quantity':{'type':Sequelize[_0xd13d('0x6')](0xd,0x4),'allowNull':![]},'ProductQuotationId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/saInvoiceDetail/saInvoiceDetail.controller.js b/server/api/saInvoiceDetail/saInvoiceDetail.controller.js index c73fa61..700197b 100644 --- a/server/api/saInvoiceDetail/saInvoiceDetail.controller.js +++ b/server/api/saInvoiceDetail/saInvoiceDetail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc629=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','SAInvoiceDetail','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','where','merge','key','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','create','body','find','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','squel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc629,0x140));var _0x9c62=function(_0x18ebf5,_0x2cd5c6){_0x18ebf5=_0x18ebf5-0x0;var _0x27471a=_0xc629[_0x18ebf5];return _0x27471a;};'use strict';var pdf=require(_0x9c62('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9c62('0x1'));var zipdir=require(_0x9c62('0x2'));var jsonpatch=require(_0x9c62('0x3'));var rp=require(_0x9c62('0x4'));var moment=require(_0x9c62('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9c62('0x6'));var util=require(_0x9c62('0x7'));var path=require(_0x9c62('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x9c62('0x9'));var crypto=require(_0x9c62('0xa'));var jsforce=require(_0x9c62('0xb'));var deskjs=require(_0x9c62('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9c62('0xd'));var Papa=require('papaparse');var Redis=require(_0x9c62('0xe'));var authService=require(_0x9c62('0xf'));var qs=require(_0x9c62('0x10'));var hardwareService=require(_0x9c62('0x11'));var logger=require(_0x9c62('0x12'))(_0x9c62('0x13'));var utils=require(_0x9c62('0x14'));var config=require(_0x9c62('0x15'));var db=require(_0x9c62('0x16'))['db'];function respondWithStatusCode(_0x52b730,_0xd9659a){_0xd9659a=_0xd9659a||0xcc;return function(_0xbd72ab){if(_0xbd72ab){return _0x52b730['sendStatus'](_0xd9659a);}return _0x52b730[_0x9c62('0x17')](_0xd9659a)[_0x9c62('0x18')]();};}function respondWithResult(_0x283005,_0x327e89){_0x327e89=_0x327e89||0xc8;return function(_0x399e33){if(_0x399e33){return _0x283005[_0x9c62('0x17')](_0x327e89)[_0x9c62('0x19')](_0x399e33);}};}function respondWithFilteredResult(_0x91e822,_0x123bde){return function(_0x58ee0e){if(_0x58ee0e){var _0x2f9106=_0x58ee0e[_0x9c62('0x1a')],_0x4c7e51=_0x123bde['offset'],_0x13ca71=_0x123bde[_0x9c62('0x1b')]+_0x123bde[_0x9c62('0x1c')],_0x6dadbe;if(_0x13ca71>=_0x2f9106){_0x13ca71=_0x2f9106;_0x6dadbe=0xc8;}else{_0x6dadbe=0xce;}_0x91e822[_0x9c62('0x17')](_0x6dadbe);return _0x91e822['set']('Content-Range',_0x4c7e51+'-'+_0x13ca71+'/'+_0x2f9106)['json'](_0x58ee0e);}return null;};}function patchUpdates(_0x192b54){return function(_0x13b2dc){try{jsonpatch[_0x9c62('0x1d')](_0x13b2dc,_0x192b54,!![]);}catch(_0x4873c0){return BPromise[_0x9c62('0x1e')](_0x4873c0);}return _0x13b2dc['save']();};}function saveUpdates(_0x5c8b73,_0x3fb255){return function(_0x442f79){if(_0x442f79){return _0x442f79[_0x9c62('0x1f')](_0x5c8b73)[_0x9c62('0x20')](function(_0x4a78df){return _0x4a78df;});}return null;};}function removeEntity(_0x351b05,_0x4cf9bc){return function(_0x3b563b){if(_0x3b563b){return _0x3b563b[_0x9c62('0x21')]()[_0x9c62('0x20')](function(){_0x351b05[_0x9c62('0x17')](0xcc)[_0x9c62('0x18')]();});}};}function handleEntityNotFound(_0x16f37f,_0x4451e0){return function(_0xe05cc7){if(!_0xe05cc7){_0x16f37f[_0x9c62('0x22')](0x194);}return _0xe05cc7;};}function handleError(_0x5c8a4e,_0x13dae3){_0x13dae3=_0x13dae3||0x1f4;return function(_0x472541){logger[_0x9c62('0x23')](_0x472541[_0x9c62('0x24')]);if(_0x472541[_0x9c62('0x25')]){delete _0x472541[_0x9c62('0x25')];}_0x5c8a4e['status'](_0x13dae3)[_0x9c62('0x26')](_0x472541);};}exports[_0x9c62('0x27')]=function(_0x47db1f,_0x4e4e72){var _0x391568={},_0x46a467={},_0x59a7e9={'count':0x0,'rows':[]};var _0xe3ac7=db[_0x9c62('0x28')][_0x9c62('0x29')];_0x46a467['model']=_['keys'](_0xe3ac7);_0x46a467[_0x9c62('0x2a')]=_[_0x9c62('0x2b')](_0x47db1f[_0x9c62('0x2a')]);_0x46a467[_0x9c62('0x2c')]=_[_0x9c62('0x2d')](_0x46a467[_0x9c62('0x2e')],_0x46a467[_0x9c62('0x2a')]);_0x391568[_0x9c62('0x2f')]=_[_0x9c62('0x2d')](_0x46a467[_0x9c62('0x2e')],qs['fields'](_0x47db1f['query'][_0x9c62('0x30')]));_0x391568[_0x9c62('0x2f')]=_0x391568['attributes'][_0x9c62('0x31')]?_0x391568[_0x9c62('0x2f')]:_0x46a467[_0x9c62('0x2e')];if(!_0x47db1f[_0x9c62('0x2a')]['hasOwnProperty']('nolimit')){_0x391568[_0x9c62('0x1c')]=qs[_0x9c62('0x1c')](_0x47db1f[_0x9c62('0x2a')][_0x9c62('0x1c')]);_0x391568[_0x9c62('0x1b')]=qs[_0x9c62('0x1b')](_0x47db1f[_0x9c62('0x2a')][_0x9c62('0x1b')]);}_0x391568['order']=qs['sort'](_0x47db1f[_0x9c62('0x2a')]['sort']);_0x391568['where']=qs['filters'](_['pick'](_0x47db1f[_0x9c62('0x2a')],_0x46a467['filters']));if(_0x47db1f[_0x9c62('0x2a')]['filter']){_0x391568[_0x9c62('0x32')]=_[_0x9c62('0x33')](_0x391568['where'],{'$or':_['map'](_0xe3ac7,function(_0x298c93){if(_0x298c93['type'][_0x9c62('0x34')]!==_0x9c62('0x35')){var _0xd3a10b={};_0xd3a10b[_0x298c93['field']]={'$like':'%'+_0x47db1f[_0x9c62('0x2a')]['filter']+'%'};return _0xd3a10b;}})});}_0x391568=_[_0x9c62('0x33')]({},_0x391568,_0x47db1f['options']);var _0xa4c986={'where':_0x391568[_0x9c62('0x32')]};return db[_0x9c62('0x28')][_0x9c62('0x1a')](_0xa4c986)[_0x9c62('0x20')](function(_0x332067){_0x59a7e9['count']=_0x332067;if(_0x47db1f[_0x9c62('0x2a')][_0x9c62('0x36')]){_0x391568[_0x9c62('0x37')]=[{'all':!![]}];}return db[_0x9c62('0x28')][_0x9c62('0x38')](_0x391568);})[_0x9c62('0x20')](function(_0x416255){_0x59a7e9[_0x9c62('0x39')]=_0x416255;return _0x59a7e9;})['then'](respondWithFilteredResult(_0x4e4e72,_0x391568))[_0x9c62('0x3a')](handleError(_0x4e4e72,null));};exports[_0x9c62('0x3b')]=function(_0x12fd69,_0x4f6aa3){var _0x57f463={'raw':![],'where':{'id':_0x12fd69['params']['id']}},_0xb682cb={};_0xb682cb[_0x9c62('0x2e')]=_[_0x9c62('0x2b')](db[_0x9c62('0x28')][_0x9c62('0x29')]);_0xb682cb[_0x9c62('0x2a')]=_['keys'](_0x12fd69[_0x9c62('0x2a')]);_0xb682cb[_0x9c62('0x2c')]=_['intersection'](_0xb682cb[_0x9c62('0x2e')],_0xb682cb[_0x9c62('0x2a')]);_0x57f463['attributes']=_['intersection'](_0xb682cb[_0x9c62('0x2e')],qs[_0x9c62('0x30')](_0x12fd69[_0x9c62('0x2a')]['fields']));_0x57f463['attributes']=_0x57f463['attributes'][_0x9c62('0x31')]?_0x57f463[_0x9c62('0x2f')]:_0xb682cb[_0x9c62('0x2e')];if(_0x12fd69[_0x9c62('0x2a')][_0x9c62('0x36')]){_0x57f463['include']=[{'all':!![]}];}_0x57f463=_[_0x9c62('0x33')]({},_0x57f463,_0x12fd69[_0x9c62('0x3c')]);return db[_0x9c62('0x28')]['find'](_0x57f463)['then'](handleEntityNotFound(_0x4f6aa3,null))[_0x9c62('0x20')](respondWithResult(_0x4f6aa3,null))['catch'](handleError(_0x4f6aa3,null));};exports[_0x9c62('0x3d')]=function(_0x156a78,_0x4bf4a7){return db[_0x9c62('0x28')][_0x9c62('0x3d')](_0x156a78['body'],{})[_0x9c62('0x20')](respondWithResult(_0x4bf4a7,0xc9))[_0x9c62('0x3a')](handleError(_0x4bf4a7,null));};exports[_0x9c62('0x1f')]=function(_0x38c95b,_0xb8a952){if(_0x38c95b[_0x9c62('0x3e')]['id']){delete _0x38c95b['body']['id'];}return db['SAInvoiceDetail'][_0x9c62('0x3f')]({'where':{'id':_0x38c95b[_0x9c62('0x40')]['id']}})[_0x9c62('0x20')](handleEntityNotFound(_0xb8a952,null))[_0x9c62('0x20')](saveUpdates(_0x38c95b[_0x9c62('0x3e')],null))[_0x9c62('0x20')](respondWithResult(_0xb8a952,null))['catch'](handleError(_0xb8a952,null));};exports['destroy']=function(_0x1ebb37,_0x18b449){return db[_0x9c62('0x28')][_0x9c62('0x3f')]({'where':{'id':_0x1ebb37['params']['id']}})[_0x9c62('0x20')](handleEntityNotFound(_0x18b449,null))[_0x9c62('0x20')](removeEntity(_0x18b449,null))[_0x9c62('0x3a')](handleError(_0x18b449,null));};exports['describe']=function(_0x3dedcd,_0x43937a){return db[_0x9c62('0x28')][_0x9c62('0x41')]()[_0x9c62('0x20')](respondWithResult(_0x43937a,null))[_0x9c62('0x3a')](handleError(_0x43937a,null));}; \ No newline at end of file +var _0x5994=['crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','SAInvoiceDetail','model','keys','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','catch','show','rawAttributes','find','create','body','params','describe','html-pdf','fast-json-patch','moment','util','path','sox','to-csv','lodash'];(function(_0x1eb10e,_0xad4ba9){var _0x26a0f6=function(_0x449e63){while(--_0x449e63){_0x1eb10e['push'](_0x1eb10e['shift']());}};_0x26a0f6(++_0xad4ba9);}(_0x5994,0x7c));var _0x4599=function(_0x24c362,_0x180084){_0x24c362=_0x24c362-0x0;var _0x5867e7=_0x5994[_0x24c362];return _0x5867e7;};'use strict';var pdf=require(_0x4599('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4599('0x1'));var rp=require('request-promise');var moment=require(_0x4599('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4599('0x3'));var path=require(_0x4599('0x4'));var sox=require(_0x4599('0x5'));var csv=require(_0x4599('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4599('0x7'));var squel=require('squel');var crypto=require(_0x4599('0x8'));var jsforce=require(_0x4599('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4599('0xa'));var Papa=require(_0x4599('0xb'));var Redis=require('ioredis');var authService=require(_0x4599('0xc'));var qs=require(_0x4599('0xd'));var hardwareService=require(_0x4599('0xe'));var logger=require('../../config/logger')('api');var utils=require(_0x4599('0xf'));var config=require(_0x4599('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x322080,_0xb89caf){_0xb89caf=_0xb89caf||0xcc;return function(_0x2097c6){if(_0x2097c6){return _0x322080[_0x4599('0x11')](_0xb89caf);}return _0x322080[_0x4599('0x12')](_0xb89caf)['end']();};}function respondWithResult(_0x32c3e2,_0x12171c){_0x12171c=_0x12171c||0xc8;return function(_0x1a7343){if(_0x1a7343){return _0x32c3e2[_0x4599('0x12')](_0x12171c)[_0x4599('0x13')](_0x1a7343);}};}function respondWithFilteredResult(_0x1098ce,_0x35a473){return function(_0x436856){if(_0x436856){var _0xd63bcc=_0x436856[_0x4599('0x14')],_0x4a3b71=_0x35a473['offset'],_0x2dfb3c=_0x35a473[_0x4599('0x15')]+_0x35a473[_0x4599('0x16')],_0x2653a2;if(_0x2dfb3c>=_0xd63bcc){_0x2dfb3c=_0xd63bcc;_0x2653a2=0xc8;}else{_0x2653a2=0xce;}_0x1098ce[_0x4599('0x12')](_0x2653a2);return _0x1098ce['set']('Content-Range',_0x4a3b71+'-'+_0x2dfb3c+'/'+_0xd63bcc)['json'](_0x436856);}return null;};}function patchUpdates(_0x8afe44){return function(_0x43831c){try{jsonpatch[_0x4599('0x17')](_0x43831c,_0x8afe44,!![]);}catch(_0x10b1cb){return BPromise[_0x4599('0x18')](_0x10b1cb);}return _0x43831c[_0x4599('0x19')]();};}function saveUpdates(_0x2c5731,_0x4141ac){return function(_0x11300f){if(_0x11300f){return _0x11300f[_0x4599('0x1a')](_0x2c5731)[_0x4599('0x1b')](function(_0x2b7ed9){return _0x2b7ed9;});}return null;};}function removeEntity(_0x5d251d,_0x577020){return function(_0x1fa9da){if(_0x1fa9da){return _0x1fa9da[_0x4599('0x1c')]()['then'](function(){_0x5d251d[_0x4599('0x12')](0xcc)[_0x4599('0x1d')]();});}};}function handleEntityNotFound(_0x26e677,_0x237388){return function(_0x54d5ba){if(!_0x54d5ba){_0x26e677[_0x4599('0x11')](0x194);}return _0x54d5ba;};}function handleError(_0xd42117,_0x120819){_0x120819=_0x120819||0x1f4;return function(_0x14bf18){logger[_0x4599('0x1e')](_0x14bf18[_0x4599('0x1f')]);if(_0x14bf18['name']){delete _0x14bf18[_0x4599('0x20')];}_0xd42117[_0x4599('0x12')](_0x120819)[_0x4599('0x21')](_0x14bf18);};}exports[_0x4599('0x22')]=function(_0x3aa277,_0x3d7dbb){var _0x183e8d={},_0x3caa16={},_0x160d2b={'count':0x0,'rows':[]};var _0x3cc870=db[_0x4599('0x23')]['rawAttributes'];_0x3caa16[_0x4599('0x24')]=_[_0x4599('0x25')](_0x3cc870);_0x3caa16[_0x4599('0x26')]=_['keys'](_0x3aa277[_0x4599('0x26')]);_0x3caa16['filters']=_['intersection'](_0x3caa16[_0x4599('0x24')],_0x3caa16[_0x4599('0x26')]);_0x183e8d[_0x4599('0x27')]=_[_0x4599('0x28')](_0x3caa16['model'],qs[_0x4599('0x29')](_0x3aa277[_0x4599('0x26')][_0x4599('0x29')]));_0x183e8d[_0x4599('0x27')]=_0x183e8d[_0x4599('0x27')][_0x4599('0x2a')]?_0x183e8d['attributes']:_0x3caa16[_0x4599('0x24')];if(!_0x3aa277[_0x4599('0x26')]['hasOwnProperty'](_0x4599('0x2b'))){_0x183e8d[_0x4599('0x16')]=qs[_0x4599('0x16')](_0x3aa277[_0x4599('0x26')][_0x4599('0x16')]);_0x183e8d[_0x4599('0x15')]=qs[_0x4599('0x15')](_0x3aa277['query'][_0x4599('0x15')]);}_0x183e8d[_0x4599('0x2c')]=qs[_0x4599('0x2d')](_0x3aa277[_0x4599('0x26')][_0x4599('0x2d')]);_0x183e8d[_0x4599('0x2e')]=qs[_0x4599('0x2f')](_['pick'](_0x3aa277[_0x4599('0x26')],_0x3caa16[_0x4599('0x2f')]));if(_0x3aa277[_0x4599('0x26')][_0x4599('0x30')]){_0x183e8d[_0x4599('0x2e')]=_[_0x4599('0x31')](_0x183e8d[_0x4599('0x2e')],{'$or':_[_0x4599('0x32')](_0x3cc870,function(_0x6406a8){if(_0x6406a8[_0x4599('0x33')]['key']!==_0x4599('0x34')){var _0x1784a1={};_0x1784a1[_0x6406a8[_0x4599('0x35')]]={'$like':'%'+_0x3aa277[_0x4599('0x26')][_0x4599('0x30')]+'%'};return _0x1784a1;}})});}_0x183e8d=_['merge']({},_0x183e8d,_0x3aa277[_0x4599('0x36')]);var _0x140715={'where':_0x183e8d[_0x4599('0x2e')]};return db['SAInvoiceDetail'][_0x4599('0x14')](_0x140715)[_0x4599('0x1b')](function(_0x407a07){_0x160d2b[_0x4599('0x14')]=_0x407a07;if(_0x3aa277[_0x4599('0x26')][_0x4599('0x37')]){_0x183e8d[_0x4599('0x38')]=[{'all':!![]}];}return db['SAInvoiceDetail']['findAll'](_0x183e8d);})[_0x4599('0x1b')](function(_0x5e2de3){_0x160d2b[_0x4599('0x39')]=_0x5e2de3;return _0x160d2b;})['then'](respondWithFilteredResult(_0x3d7dbb,_0x183e8d))[_0x4599('0x3a')](handleError(_0x3d7dbb,null));};exports[_0x4599('0x3b')]=function(_0x4486ab,_0x2c1217){var _0x58d11a={'raw':![],'where':{'id':_0x4486ab['params']['id']}},_0x4dceaa={};_0x4dceaa['model']=_['keys'](db[_0x4599('0x23')][_0x4599('0x3c')]);_0x4dceaa[_0x4599('0x26')]=_[_0x4599('0x25')](_0x4486ab[_0x4599('0x26')]);_0x4dceaa['filters']=_[_0x4599('0x28')](_0x4dceaa[_0x4599('0x24')],_0x4dceaa[_0x4599('0x26')]);_0x58d11a[_0x4599('0x27')]=_[_0x4599('0x28')](_0x4dceaa[_0x4599('0x24')],qs[_0x4599('0x29')](_0x4486ab[_0x4599('0x26')][_0x4599('0x29')]));_0x58d11a[_0x4599('0x27')]=_0x58d11a[_0x4599('0x27')][_0x4599('0x2a')]?_0x58d11a[_0x4599('0x27')]:_0x4dceaa[_0x4599('0x24')];if(_0x4486ab['query'][_0x4599('0x37')]){_0x58d11a[_0x4599('0x38')]=[{'all':!![]}];}_0x58d11a=_['merge']({},_0x58d11a,_0x4486ab['options']);return db['SAInvoiceDetail'][_0x4599('0x3d')](_0x58d11a)[_0x4599('0x1b')](handleEntityNotFound(_0x2c1217,null))[_0x4599('0x1b')](respondWithResult(_0x2c1217,null))[_0x4599('0x3a')](handleError(_0x2c1217,null));};exports[_0x4599('0x3e')]=function(_0x4472fe,_0x57c0cd){return db[_0x4599('0x23')]['create'](_0x4472fe[_0x4599('0x3f')],{})[_0x4599('0x1b')](respondWithResult(_0x57c0cd,0xc9))[_0x4599('0x3a')](handleError(_0x57c0cd,null));};exports['update']=function(_0x5345a2,_0x4b5be9){if(_0x5345a2[_0x4599('0x3f')]['id']){delete _0x5345a2[_0x4599('0x3f')]['id'];}return db[_0x4599('0x23')][_0x4599('0x3d')]({'where':{'id':_0x5345a2[_0x4599('0x40')]['id']}})[_0x4599('0x1b')](handleEntityNotFound(_0x4b5be9,null))[_0x4599('0x1b')](saveUpdates(_0x5345a2[_0x4599('0x3f')],null))[_0x4599('0x1b')](respondWithResult(_0x4b5be9,null))[_0x4599('0x3a')](handleError(_0x4b5be9,null));};exports[_0x4599('0x1c')]=function(_0x1acdab,_0xd274a9){return db[_0x4599('0x23')][_0x4599('0x3d')]({'where':{'id':_0x1acdab['params']['id']}})['then'](handleEntityNotFound(_0xd274a9,null))['then'](removeEntity(_0xd274a9,null))['catch'](handleError(_0xd274a9,null));};exports['describe']=function(_0x38266e,_0x5aa5cc){return db[_0x4599('0x23')][_0x4599('0x41')]()['then'](respondWithResult(_0x5aa5cc,null))[_0x4599('0x3a')](handleError(_0x5aa5cc,null));}; \ No newline at end of file diff --git a/server/api/saInvoiceDetail/saInvoiceDetail.model.js b/server/api/saInvoiceDetail/saInvoiceDetail.model.js index 0a67ca5..79a9c05 100644 --- a/server/api/saInvoiceDetail/saInvoiceDetail.model.js +++ b/server/api/saInvoiceDetail/saInvoiceDetail.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba26=['bluebird','path','rimraf','./saInvoiceDetail.attributes','exports','define','sa_invoice_details','../../config/logger','api'];(function(_0x2d2b4f,_0x409c9c){var _0x211cd0=function(_0x5a02f7){while(--_0x5a02f7){_0x2d2b4f['push'](_0x2d2b4f['shift']());}};_0x211cd0(++_0x409c9c);}(_0xba26,0x1c9));var _0x6ba2=function(_0x33da36,_0x52e086){_0x33da36=_0x33da36-0x0;var _0x46820d=_0xba26[_0x33da36];return _0x46820d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6ba2('0x0'))(_0x6ba2('0x1'));var moment=require('moment');var BPromise=require(_0x6ba2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ba2('0x3'));var rimraf=require(_0x6ba2('0x4'));var config=require('../../config/environment');var attributes=require(_0x6ba2('0x5'));module[_0x6ba2('0x6')]=function(_0x24124a,_0x125002){return _0x24124a[_0x6ba2('0x7')]('SAInvoiceDetail',attributes,{'tableName':_0x6ba2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x190b=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./saInvoiceDetail.attributes','exports','define','lodash','util'];(function(_0x8dd4f0,_0x3354b5){var _0x3580fa=function(_0x5ee75a){while(--_0x5ee75a){_0x8dd4f0['push'](_0x8dd4f0['shift']());}};_0x3580fa(++_0x3354b5);}(_0x190b,0x1ab));var _0xb190=function(_0x538431,_0x2707fa){_0x538431=_0x538431-0x0;var _0x35ec91=_0x190b[_0x538431];return _0x35ec91;};'use strict';var _=require(_0xb190('0x0'));var util=require(_0xb190('0x1'));var logger=require(_0xb190('0x2'))('api');var moment=require(_0xb190('0x3'));var BPromise=require(_0xb190('0x4'));var rp=require(_0xb190('0x5'));var fs=require('fs');var path=require(_0xb190('0x6'));var rimraf=require('rimraf');var config=require(_0xb190('0x7'));var attributes=require(_0xb190('0x8'));module[_0xb190('0x9')]=function(_0x2afdbb,_0x17fffa){return _0x2afdbb[_0xb190('0xa')]('SAInvoiceDetail',attributes,{'tableName':'sa_invoice_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saInvoiceDetail/saInvoiceDetail.rpc.js b/server/api/saInvoiceDetail/saInvoiceDetail.rpc.js index cd84e2a..62f5366 100644 --- a/server/api/saInvoiceDetail/saInvoiceDetail.rpc.js +++ b/server/api/saInvoiceDetail/saInvoiceDetail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd3f=['stringify','error','message','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','SAInvoiceDetail,\x20%s,\x20%s','request\x20sent','debug','SAInvoiceDetail,\x20%s,\x20%s,\x20%s'];(function(_0x2db24f,_0x340858){var _0x2c571c=function(_0xbc709){while(--_0xbc709){_0x2db24f['push'](_0x2db24f['shift']());}};_0x2c571c(++_0x340858);}(_0xbd3f,0x1d0));var _0xfbd3=function(_0x21fc68,_0x459828){_0x21fc68=_0x21fc68-0x0;var _0x3561e1=_0xbd3f[_0x21fc68];return _0x3561e1;};'use strict';var _=require(_0xfbd3('0x0'));var util=require(_0xfbd3('0x1'));var moment=require('moment');var BPromise=require(_0xfbd3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfbd3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfbd3('0x4'));var logger=require(_0xfbd3('0x5'))(_0xfbd3('0x6'));var config=require(_0xfbd3('0x7'));var jayson=require(_0xfbd3('0x8'));var client=jayson['client'][_0xfbd3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a7510,_0x51b205,_0x251c31){return new BPromise(function(_0xf7d212,_0x5997c1){return client['request'](_0x1a7510,_0x251c31)[_0xfbd3('0xa')](function(_0x5f3d70){logger[_0xfbd3('0xb')](_0xfbd3('0xc'),_0x51b205,_0xfbd3('0xd'));logger[_0xfbd3('0xe')](_0xfbd3('0xf'),_0x51b205,_0xfbd3('0xd'),JSON[_0xfbd3('0x10')](_0x5f3d70));if(_0x5f3d70[_0xfbd3('0x11')]){if(_0x5f3d70[_0xfbd3('0x11')]['code']===0x1f4){logger[_0xfbd3('0x11')](_0xfbd3('0xc'),_0x51b205,_0x5f3d70[_0xfbd3('0x11')][_0xfbd3('0x12')]);return _0x5997c1(_0x5f3d70[_0xfbd3('0x11')][_0xfbd3('0x12')]);}logger[_0xfbd3('0x11')](_0xfbd3('0xc'),_0x51b205,_0x5f3d70[_0xfbd3('0x11')]['message']);return _0xf7d212(_0x5f3d70['error'][_0xfbd3('0x12')]);}else{logger['info'](_0xfbd3('0xc'),_0x51b205,_0xfbd3('0xd'));_0xf7d212(_0x5f3d70['result'][_0xfbd3('0x12')]);}})[_0xfbd3('0x13')](function(_0x1ed4f6){logger[_0xfbd3('0x11')]('SAInvoiceDetail,\x20%s,\x20%s',_0x51b205,_0x1ed4f6);_0x5997c1(_0x1ed4f6);});});} \ No newline at end of file +var _0xe119=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','SAInvoiceDetail,\x20%s,\x20%s','request\x20sent','debug','SAInvoiceDetail,\x20%s,\x20%s,\x20%s'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xe119,0x1b6));var _0x9e11=function(_0x501b7a,_0x31f666){_0x501b7a=_0x501b7a-0x0;var _0x1045d8=_0xe119[_0x501b7a];return _0x1045d8;};'use strict';var _=require(_0x9e11('0x0'));var util=require(_0x9e11('0x1'));var moment=require(_0x9e11('0x2'));var BPromise=require(_0x9e11('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e11('0x4'));var db=require(_0x9e11('0x5'))['db'];var utils=require(_0x9e11('0x6'));var logger=require(_0x9e11('0x7'))(_0x9e11('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9e11('0x9')][_0x9e11('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ae56,_0x23c21a,_0x2a28ed){return new BPromise(function(_0x3f5164,_0x50f947){return client[_0x9e11('0xb')](_0x57ae56,_0x2a28ed)[_0x9e11('0xc')](function(_0x201c9b){logger[_0x9e11('0xd')](_0x9e11('0xe'),_0x23c21a,_0x9e11('0xf'));logger[_0x9e11('0x10')](_0x9e11('0x11'),_0x23c21a,_0x9e11('0xf'),JSON[_0x9e11('0x12')](_0x201c9b));if(_0x201c9b[_0x9e11('0x13')]){if(_0x201c9b['error'][_0x9e11('0x14')]===0x1f4){logger[_0x9e11('0x13')](_0x9e11('0xe'),_0x23c21a,_0x201c9b[_0x9e11('0x13')][_0x9e11('0x15')]);return _0x50f947(_0x201c9b[_0x9e11('0x13')][_0x9e11('0x15')]);}logger[_0x9e11('0x13')](_0x9e11('0xe'),_0x23c21a,_0x201c9b[_0x9e11('0x13')]['message']);return _0x3f5164(_0x201c9b[_0x9e11('0x13')][_0x9e11('0x15')]);}else{logger[_0x9e11('0xd')](_0x9e11('0xe'),_0x23c21a,_0x9e11('0xf'));_0x3f5164(_0x201c9b[_0x9e11('0x16')][_0x9e11('0x15')]);}})[_0x9e11('0x17')](function(_0x476e7f){logger[_0x9e11('0x13')](_0x9e11('0xe'),_0x23c21a,_0x476e7f);_0x50f947(_0x476e7f);});});} \ No newline at end of file diff --git a/server/api/saInvoiceLaw/index.js b/server/api/saInvoiceLaw/index.js index b7340b8..45ac1fa 100644 --- a/server/api/saInvoiceLaw/index.js +++ b/server/api/saInvoiceLaw/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xacba=['/describe','describe','put','update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0xacba,0x167));var _0xaacb=function(_0xa5b46d,_0x14c5e5){_0xa5b46d=_0xa5b46d-0x0;var _0x383725=_0xacba[_0xa5b46d];return _0x383725;};'use strict';var multer=require(_0xaacb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaacb('0x1'));var express=require(_0xaacb('0x2'));var router=express['Router']();var auth=require(_0xaacb('0x3'));var interaction=require(_0xaacb('0x4'));var config=require(_0xaacb('0x5'));var controller=require('./saInvoiceLaw.controller');router[_0xaacb('0x6')]('/',auth[_0xaacb('0x7')](),controller[_0xaacb('0x8')]);router[_0xaacb('0x6')](_0xaacb('0x9'),auth[_0xaacb('0x7')](),controller[_0xaacb('0xa')]);router[_0xaacb('0x6')]('/:id',auth[_0xaacb('0x7')](),controller['show']);router['post']('/',auth[_0xaacb('0x7')](),controller['create']);router[_0xaacb('0xb')]('/:id',auth[_0xaacb('0x7')](),controller[_0xaacb('0xc')]);router[_0xaacb('0xd')]('/:id',auth[_0xaacb('0x7')](),controller[_0xaacb('0xe')]);module[_0xaacb('0xf')]=router; \ No newline at end of file +var _0x83ef=['put','/:id','update','destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./saInvoiceLaw.controller','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x9d49bd,_0x209e02){var _0x2c4a89=function(_0x286426){while(--_0x286426){_0x9d49bd['push'](_0x9d49bd['shift']());}};_0x2c4a89(++_0x209e02);}(_0x83ef,0x1d1));var _0xf83e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x83ef[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xf83e('0x0'));var util=require(_0xf83e('0x1'));var path=require('path');var timeout=require(_0xf83e('0x2'));var express=require('express');var router=express[_0xf83e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf83e('0x4'));var config=require(_0xf83e('0x5'));var controller=require(_0xf83e('0x6'));router[_0xf83e('0x7')]('/',auth[_0xf83e('0x8')](),controller[_0xf83e('0x9')]);router[_0xf83e('0x7')](_0xf83e('0xa'),auth[_0xf83e('0x8')](),controller[_0xf83e('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf83e('0xc')]);router[_0xf83e('0xd')]('/',auth[_0xf83e('0x8')](),controller[_0xf83e('0xe')]);router[_0xf83e('0xf')](_0xf83e('0x10'),auth['isAuthenticated'](),controller[_0xf83e('0x11')]);router['delete'](_0xf83e('0x10'),auth['isAuthenticated'](),controller[_0xf83e('0x12')]);module[_0xf83e('0x13')]=router; \ No newline at end of file diff --git a/server/api/saInvoiceLaw/saInvoiceLaw.attributes.js b/server/api/saInvoiceLaw/saInvoiceLaw.attributes.js index 494d4a1..7c0620c 100644 --- a/server/api/saInvoiceLaw/saInvoiceLaw.attributes.js +++ b/server/api/saInvoiceLaw/saInvoiceLaw.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x866a=['sequelize','STRING','name'];(function(_0x536f8b,_0x2d80e3){var _0x4a0c90=function(_0x4d79cc){while(--_0x4d79cc){_0x536f8b['push'](_0x536f8b['shift']());}};_0x4a0c90(++_0x2d80e3);}(_0x866a,0xab));var _0xa866=function(_0x330e77,_0x2dd3c0){_0x330e77=_0x330e77-0x0;var _0xdbadea=_0x866a[_0x330e77];return _0xdbadea;};'use strict';var Sequelize=require(_0xa866('0x0'));module['exports']={'name':{'type':Sequelize[_0xa866('0x1')],'allowNull':![],'unique':_0xa866('0x2')}}; \ No newline at end of file +var _0x7ab4=['exports','STRING','name','sequelize'];(function(_0x1488cd,_0x25a893){var _0x63fa13=function(_0x57dd1c){while(--_0x57dd1c){_0x1488cd['push'](_0x1488cd['shift']());}};_0x63fa13(++_0x25a893);}(_0x7ab4,0x1cb));var _0x47ab=function(_0x216f7d,_0x496249){_0x216f7d=_0x216f7d-0x0;var _0xc49d7f=_0x7ab4[_0x216f7d];return _0xc49d7f;};'use strict';var Sequelize=require(_0x47ab('0x0'));module[_0x47ab('0x1')]={'name':{'type':Sequelize[_0x47ab('0x2')],'allowNull':![],'unique':_0x47ab('0x3')}}; \ No newline at end of file diff --git a/server/api/saInvoiceLaw/saInvoiceLaw.controller.js b/server/api/saInvoiceLaw/saInvoiceLaw.controller.js index a49a22b..d6255bc 100644 --- a/server/api/saInvoiceLaw/saInvoiceLaw.controller.js +++ b/server/api/saInvoiceLaw/saInvoiceLaw.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3974=['reject','save','update','then','destroy','stack','name','send','index','SAInvoiceLaw','rawAttributes','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','options','rows','catch','show','params','keys','intersection','includeAll','include','find','create','body','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json'];(function(_0x5a2285,_0x3212d1){var _0x48f6ed=function(_0x322127){while(--_0x322127){_0x5a2285['push'](_0x5a2285['shift']());}};_0x48f6ed(++_0x3212d1);}(_0x3974,0xbc));var _0x4397=function(_0x34342c,_0x5e532c){_0x34342c=_0x34342c-0x0;var _0x610325=_0x3974[_0x34342c];return _0x610325;};'use strict';var pdf=require(_0x4397('0x0'));var emlformat=require(_0x4397('0x1'));var rimraf=require(_0x4397('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4397('0x3'));var moment=require(_0x4397('0x4'));var BPromise=require(_0x4397('0x5'));var Mustache=require(_0x4397('0x6'));var util=require(_0x4397('0x7'));var path=require('path');var sox=require(_0x4397('0x8'));var csv=require(_0x4397('0x9'));var ejs=require(_0x4397('0xa'));var fs=require('fs');var _=require(_0x4397('0xb'));var squel=require('squel');var crypto=require(_0x4397('0xc'));var jsforce=require(_0x4397('0xd'));var deskjs=require(_0x4397('0xe'));var toCsv=require(_0x4397('0x9'));var querystring=require('querystring');var Papa=require(_0x4397('0xf'));var Redis=require(_0x4397('0x10'));var authService=require(_0x4397('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4397('0x12'))(_0x4397('0x13'));var utils=require(_0x4397('0x14'));var config=require('../../config/environment');var db=require(_0x4397('0x15'))['db'];function respondWithStatusCode(_0x19a812,_0x3aa181){_0x3aa181=_0x3aa181||0xcc;return function(_0x50b80d){if(_0x50b80d){return _0x19a812[_0x4397('0x16')](_0x3aa181);}return _0x19a812[_0x4397('0x17')](_0x3aa181)[_0x4397('0x18')]();};}function respondWithResult(_0x5432a7,_0x1968e9){_0x1968e9=_0x1968e9||0xc8;return function(_0x541bf0){if(_0x541bf0){return _0x5432a7[_0x4397('0x17')](_0x1968e9)['json'](_0x541bf0);}};}function respondWithFilteredResult(_0x17c9a9,_0x30ac21){return function(_0x3b6dfa){if(_0x3b6dfa){var _0x1aa61f=_0x3b6dfa[_0x4397('0x19')],_0x172ce2=_0x30ac21[_0x4397('0x1a')],_0x423224=_0x30ac21[_0x4397('0x1a')]+_0x30ac21[_0x4397('0x1b')],_0x4fa1fa;if(_0x423224>=_0x1aa61f){_0x423224=_0x1aa61f;_0x4fa1fa=0xc8;}else{_0x4fa1fa=0xce;}_0x17c9a9[_0x4397('0x17')](_0x4fa1fa);return _0x17c9a9[_0x4397('0x1c')](_0x4397('0x1d'),_0x172ce2+'-'+_0x423224+'/'+_0x1aa61f)[_0x4397('0x1e')](_0x3b6dfa);}return null;};}function patchUpdates(_0x30a37a){return function(_0x5270d7){try{jsonpatch['apply'](_0x5270d7,_0x30a37a,!![]);}catch(_0xff27cd){return BPromise[_0x4397('0x1f')](_0xff27cd);}return _0x5270d7[_0x4397('0x20')]();};}function saveUpdates(_0xaf9b09,_0x5619bb){return function(_0x523002){if(_0x523002){return _0x523002[_0x4397('0x21')](_0xaf9b09)[_0x4397('0x22')](function(_0x52bf64){return _0x52bf64;});}return null;};}function removeEntity(_0x5a583b,_0x499ebd){return function(_0x2cc426){if(_0x2cc426){return _0x2cc426[_0x4397('0x23')]()['then'](function(){_0x5a583b[_0x4397('0x17')](0xcc)[_0x4397('0x18')]();});}};}function handleEntityNotFound(_0x53d6d3,_0x2797d2){return function(_0x4d6de6){if(!_0x4d6de6){_0x53d6d3[_0x4397('0x16')](0x194);}return _0x4d6de6;};}function handleError(_0x2d3b13,_0x58ef09){_0x58ef09=_0x58ef09||0x1f4;return function(_0x514472){logger['error'](_0x514472[_0x4397('0x24')]);if(_0x514472[_0x4397('0x25')]){delete _0x514472[_0x4397('0x25')];}_0x2d3b13[_0x4397('0x17')](_0x58ef09)[_0x4397('0x26')](_0x514472);};}exports[_0x4397('0x27')]=function(_0x224662,_0xe78a54){var _0x47161d={},_0x1c224b={},_0x411522={'count':0x0,'rows':[]};var _0xa59687=db[_0x4397('0x28')][_0x4397('0x29')];_0x1c224b['model']=_['keys'](_0xa59687);_0x1c224b[_0x4397('0x2a')]=_['keys'](_0x224662[_0x4397('0x2a')]);_0x1c224b[_0x4397('0x2b')]=_['intersection'](_0x1c224b[_0x4397('0x2c')],_0x1c224b[_0x4397('0x2a')]);_0x47161d[_0x4397('0x2d')]=_['intersection'](_0x1c224b[_0x4397('0x2c')],qs[_0x4397('0x2e')](_0x224662[_0x4397('0x2a')]['fields']));_0x47161d[_0x4397('0x2d')]=_0x47161d['attributes'][_0x4397('0x2f')]?_0x47161d['attributes']:_0x1c224b[_0x4397('0x2c')];if(!_0x224662[_0x4397('0x2a')][_0x4397('0x30')](_0x4397('0x31'))){_0x47161d[_0x4397('0x1b')]=qs[_0x4397('0x1b')](_0x224662['query'][_0x4397('0x1b')]);_0x47161d[_0x4397('0x1a')]=qs['offset'](_0x224662['query']['offset']);}_0x47161d[_0x4397('0x32')]=qs[_0x4397('0x33')](_0x224662[_0x4397('0x2a')][_0x4397('0x33')]);_0x47161d[_0x4397('0x34')]=qs[_0x4397('0x2b')](_[_0x4397('0x35')](_0x224662['query'],_0x1c224b['filters']));if(_0x224662[_0x4397('0x2a')][_0x4397('0x36')]){_0x47161d[_0x4397('0x34')]=_[_0x4397('0x37')](_0x47161d['where'],{'$or':_[_0x4397('0x38')](_0xa59687,function(_0x26ed15){if(_0x26ed15[_0x4397('0x39')][_0x4397('0x3a')]!=='VIRTUAL'){var _0x5589c2={};_0x5589c2[_0x26ed15[_0x4397('0x3b')]]={'$like':'%'+_0x224662['query'][_0x4397('0x36')]+'%'};return _0x5589c2;}})});}_0x47161d=_[_0x4397('0x37')]({},_0x47161d,_0x224662[_0x4397('0x3c')]);var _0x4ee1e5={'where':_0x47161d['where']};return db[_0x4397('0x28')][_0x4397('0x19')](_0x4ee1e5)[_0x4397('0x22')](function(_0xb21c53){_0x411522[_0x4397('0x19')]=_0xb21c53;if(_0x224662[_0x4397('0x2a')]['includeAll']){_0x47161d['include']=[{'all':!![]}];}return db[_0x4397('0x28')]['findAll'](_0x47161d);})[_0x4397('0x22')](function(_0x9d5070){_0x411522[_0x4397('0x3d')]=_0x9d5070;return _0x411522;})[_0x4397('0x22')](respondWithFilteredResult(_0xe78a54,_0x47161d))[_0x4397('0x3e')](handleError(_0xe78a54,null));};exports[_0x4397('0x3f')]=function(_0x56eeda,_0x286d87){var _0x278fc8={'raw':![],'where':{'id':_0x56eeda[_0x4397('0x40')]['id']}},_0x52cc0a={};_0x52cc0a[_0x4397('0x2c')]=_[_0x4397('0x41')](db['SAInvoiceLaw']['rawAttributes']);_0x52cc0a[_0x4397('0x2a')]=_['keys'](_0x56eeda[_0x4397('0x2a')]);_0x52cc0a[_0x4397('0x2b')]=_[_0x4397('0x42')](_0x52cc0a[_0x4397('0x2c')],_0x52cc0a['query']);_0x278fc8[_0x4397('0x2d')]=_[_0x4397('0x42')](_0x52cc0a[_0x4397('0x2c')],qs[_0x4397('0x2e')](_0x56eeda[_0x4397('0x2a')][_0x4397('0x2e')]));_0x278fc8['attributes']=_0x278fc8[_0x4397('0x2d')][_0x4397('0x2f')]?_0x278fc8[_0x4397('0x2d')]:_0x52cc0a['model'];if(_0x56eeda[_0x4397('0x2a')][_0x4397('0x43')]){_0x278fc8[_0x4397('0x44')]=[{'all':!![]}];}_0x278fc8=_[_0x4397('0x37')]({},_0x278fc8,_0x56eeda[_0x4397('0x3c')]);return db[_0x4397('0x28')][_0x4397('0x45')](_0x278fc8)['then'](handleEntityNotFound(_0x286d87,null))[_0x4397('0x22')](respondWithResult(_0x286d87,null))[_0x4397('0x3e')](handleError(_0x286d87,null));};exports[_0x4397('0x46')]=function(_0x55201a,_0xd79743){return db[_0x4397('0x28')][_0x4397('0x46')](_0x55201a[_0x4397('0x47')],{})[_0x4397('0x22')](respondWithResult(_0xd79743,0xc9))[_0x4397('0x3e')](handleError(_0xd79743,null));};exports[_0x4397('0x21')]=function(_0x60bc33,_0xb4c25a){if(_0x60bc33[_0x4397('0x47')]['id']){delete _0x60bc33['body']['id'];}return db['SAInvoiceLaw'][_0x4397('0x45')]({'where':{'id':_0x60bc33[_0x4397('0x40')]['id']}})[_0x4397('0x22')](handleEntityNotFound(_0xb4c25a,null))[_0x4397('0x22')](saveUpdates(_0x60bc33[_0x4397('0x47')],null))[_0x4397('0x22')](respondWithResult(_0xb4c25a,null))['catch'](handleError(_0xb4c25a,null));};exports[_0x4397('0x23')]=function(_0x2dc479,_0x5d095a){return db['SAInvoiceLaw'][_0x4397('0x45')]({'where':{'id':_0x2dc479[_0x4397('0x40')]['id']}})[_0x4397('0x22')](handleEntityNotFound(_0x5d095a,null))['then'](removeEntity(_0x5d095a,null))[_0x4397('0x3e')](handleError(_0x5d095a,null));};exports[_0x4397('0x48')]=function(_0x47eaeb,_0x7ca663){return db['SAInvoiceLaw'][_0x4397('0x48')]()['then'](respondWithResult(_0x7ca663,null))[_0x4397('0x3e')](handleError(_0x7ca663,null));}; \ No newline at end of file +var _0xf603=['util','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','SAInvoiceLaw','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','field','options','count','includeAll','include','catch','show','params','find','create','update','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x2978e1,_0x26b3f5){var _0xca0ea8=function(_0x289c2e){while(--_0x289c2e){_0x2978e1['push'](_0x2978e1['shift']());}};_0xca0ea8(++_0x26b3f5);}(_0xf603,0x124));var _0x3f60=function(_0x32ddfd,_0x5e512f){_0x32ddfd=_0x32ddfd-0x0;var _0x4deb0e=_0xf603[_0x32ddfd];return _0x4deb0e;};'use strict';var pdf=require(_0x3f60('0x0'));var emlformat=require(_0x3f60('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3f60('0x2'));var jsonpatch=require(_0x3f60('0x3'));var rp=require(_0x3f60('0x4'));var moment=require(_0x3f60('0x5'));var BPromise=require(_0x3f60('0x6'));var Mustache=require(_0x3f60('0x7'));var util=require(_0x3f60('0x8'));var path=require(_0x3f60('0x9'));var sox=require(_0x3f60('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x3f60('0xb'));var crypto=require(_0x3f60('0xc'));var jsforce=require(_0x3f60('0xd'));var deskjs=require(_0x3f60('0xe'));var toCsv=require(_0x3f60('0xf'));var querystring=require(_0x3f60('0x10'));var Papa=require(_0x3f60('0x11'));var Redis=require(_0x3f60('0x12'));var authService=require(_0x3f60('0x13'));var qs=require(_0x3f60('0x14'));var hardwareService=require(_0x3f60('0x15'));var logger=require(_0x3f60('0x16'))(_0x3f60('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1dc0f6,_0x449d7b){_0x449d7b=_0x449d7b||0xcc;return function(_0x2e79e8){if(_0x2e79e8){return _0x1dc0f6['sendStatus'](_0x449d7b);}return _0x1dc0f6[_0x3f60('0x18')](_0x449d7b)[_0x3f60('0x19')]();};}function respondWithResult(_0x51775b,_0x240995){_0x240995=_0x240995||0xc8;return function(_0x1b3e74){if(_0x1b3e74){return _0x51775b['status'](_0x240995)[_0x3f60('0x1a')](_0x1b3e74);}};}function respondWithFilteredResult(_0x5a047a,_0x39ce92){return function(_0x2cd28f){if(_0x2cd28f){var _0x5e7718=_0x2cd28f['count'],_0x3c0e9d=_0x39ce92[_0x3f60('0x1b')],_0x4e84b5=_0x39ce92[_0x3f60('0x1b')]+_0x39ce92[_0x3f60('0x1c')],_0x2fe94a;if(_0x4e84b5>=_0x5e7718){_0x4e84b5=_0x5e7718;_0x2fe94a=0xc8;}else{_0x2fe94a=0xce;}_0x5a047a[_0x3f60('0x18')](_0x2fe94a);return _0x5a047a[_0x3f60('0x1d')](_0x3f60('0x1e'),_0x3c0e9d+'-'+_0x4e84b5+'/'+_0x5e7718)['json'](_0x2cd28f);}return null;};}function patchUpdates(_0xb803f5){return function(_0xda621b){try{jsonpatch[_0x3f60('0x1f')](_0xda621b,_0xb803f5,!![]);}catch(_0x9c845f){return BPromise[_0x3f60('0x20')](_0x9c845f);}return _0xda621b[_0x3f60('0x21')]();};}function saveUpdates(_0x4f7621,_0x35dcd8){return function(_0x2f1735){if(_0x2f1735){return _0x2f1735['update'](_0x4f7621)[_0x3f60('0x22')](function(_0x2dba08){return _0x2dba08;});}return null;};}function removeEntity(_0x407d50,_0x135b14){return function(_0x1d23bb){if(_0x1d23bb){return _0x1d23bb[_0x3f60('0x23')]()[_0x3f60('0x22')](function(){_0x407d50[_0x3f60('0x18')](0xcc)[_0x3f60('0x19')]();});}};}function handleEntityNotFound(_0x31847d,_0x3f6fa7){return function(_0x35b8f6){if(!_0x35b8f6){_0x31847d[_0x3f60('0x24')](0x194);}return _0x35b8f6;};}function handleError(_0x39ba85,_0x2e3918){_0x2e3918=_0x2e3918||0x1f4;return function(_0x4d2c95){logger[_0x3f60('0x25')](_0x4d2c95[_0x3f60('0x26')]);if(_0x4d2c95[_0x3f60('0x27')]){delete _0x4d2c95[_0x3f60('0x27')];}_0x39ba85[_0x3f60('0x18')](_0x2e3918)[_0x3f60('0x28')](_0x4d2c95);};}exports[_0x3f60('0x29')]=function(_0x23e265,_0x5942f6){var _0x473bd7={},_0x1829f2={},_0x20ef1c={'count':0x0,'rows':[]};var _0x3a29b2=db[_0x3f60('0x2a')][_0x3f60('0x2b')];_0x1829f2[_0x3f60('0x2c')]=_[_0x3f60('0x2d')](_0x3a29b2);_0x1829f2[_0x3f60('0x2e')]=_[_0x3f60('0x2d')](_0x23e265[_0x3f60('0x2e')]);_0x1829f2[_0x3f60('0x2f')]=_[_0x3f60('0x30')](_0x1829f2[_0x3f60('0x2c')],_0x1829f2[_0x3f60('0x2e')]);_0x473bd7[_0x3f60('0x31')]=_[_0x3f60('0x30')](_0x1829f2[_0x3f60('0x2c')],qs[_0x3f60('0x32')](_0x23e265[_0x3f60('0x2e')][_0x3f60('0x32')]));_0x473bd7[_0x3f60('0x31')]=_0x473bd7[_0x3f60('0x31')][_0x3f60('0x33')]?_0x473bd7[_0x3f60('0x31')]:_0x1829f2[_0x3f60('0x2c')];if(!_0x23e265[_0x3f60('0x2e')][_0x3f60('0x34')](_0x3f60('0x35'))){_0x473bd7[_0x3f60('0x1c')]=qs[_0x3f60('0x1c')](_0x23e265['query'][_0x3f60('0x1c')]);_0x473bd7[_0x3f60('0x1b')]=qs['offset'](_0x23e265[_0x3f60('0x2e')][_0x3f60('0x1b')]);}_0x473bd7[_0x3f60('0x36')]=qs[_0x3f60('0x37')](_0x23e265['query'][_0x3f60('0x37')]);_0x473bd7[_0x3f60('0x38')]=qs['filters'](_['pick'](_0x23e265[_0x3f60('0x2e')],_0x1829f2['filters']));if(_0x23e265[_0x3f60('0x2e')][_0x3f60('0x39')]){_0x473bd7[_0x3f60('0x38')]=_[_0x3f60('0x3a')](_0x473bd7['where'],{'$or':_['map'](_0x3a29b2,function(_0x353969){if(_0x353969[_0x3f60('0x3b')][_0x3f60('0x3c')]!==_0x3f60('0x3d')){var _0x1d7fba={};_0x1d7fba[_0x353969[_0x3f60('0x3e')]]={'$like':'%'+_0x23e265['query'][_0x3f60('0x39')]+'%'};return _0x1d7fba;}})});}_0x473bd7=_['merge']({},_0x473bd7,_0x23e265[_0x3f60('0x3f')]);var _0x56b7be={'where':_0x473bd7[_0x3f60('0x38')]};return db[_0x3f60('0x2a')][_0x3f60('0x40')](_0x56b7be)[_0x3f60('0x22')](function(_0x2a9f5f){_0x20ef1c['count']=_0x2a9f5f;if(_0x23e265['query'][_0x3f60('0x41')]){_0x473bd7[_0x3f60('0x42')]=[{'all':!![]}];}return db[_0x3f60('0x2a')]['findAll'](_0x473bd7);})[_0x3f60('0x22')](function(_0x42f82d){_0x20ef1c['rows']=_0x42f82d;return _0x20ef1c;})['then'](respondWithFilteredResult(_0x5942f6,_0x473bd7))[_0x3f60('0x43')](handleError(_0x5942f6,null));};exports[_0x3f60('0x44')]=function(_0x3f2129,_0xfffae3){var _0x2f4c18={'raw':![],'where':{'id':_0x3f2129[_0x3f60('0x45')]['id']}},_0x570b28={};_0x570b28[_0x3f60('0x2c')]=_[_0x3f60('0x2d')](db[_0x3f60('0x2a')][_0x3f60('0x2b')]);_0x570b28[_0x3f60('0x2e')]=_['keys'](_0x3f2129['query']);_0x570b28[_0x3f60('0x2f')]=_[_0x3f60('0x30')](_0x570b28['model'],_0x570b28['query']);_0x2f4c18['attributes']=_[_0x3f60('0x30')](_0x570b28[_0x3f60('0x2c')],qs['fields'](_0x3f2129['query']['fields']));_0x2f4c18[_0x3f60('0x31')]=_0x2f4c18['attributes']['length']?_0x2f4c18[_0x3f60('0x31')]:_0x570b28[_0x3f60('0x2c')];if(_0x3f2129['query']['includeAll']){_0x2f4c18[_0x3f60('0x42')]=[{'all':!![]}];}_0x2f4c18=_['merge']({},_0x2f4c18,_0x3f2129[_0x3f60('0x3f')]);return db['SAInvoiceLaw'][_0x3f60('0x46')](_0x2f4c18)[_0x3f60('0x22')](handleEntityNotFound(_0xfffae3,null))[_0x3f60('0x22')](respondWithResult(_0xfffae3,null))[_0x3f60('0x43')](handleError(_0xfffae3,null));};exports[_0x3f60('0x47')]=function(_0x539826,_0xba2b0a){return db[_0x3f60('0x2a')]['create'](_0x539826['body'],{})[_0x3f60('0x22')](respondWithResult(_0xba2b0a,0xc9))[_0x3f60('0x43')](handleError(_0xba2b0a,null));};exports[_0x3f60('0x48')]=function(_0xe70ab0,_0x44444d){if(_0xe70ab0['body']['id']){delete _0xe70ab0[_0x3f60('0x49')]['id'];}return db['SAInvoiceLaw'][_0x3f60('0x46')]({'where':{'id':_0xe70ab0[_0x3f60('0x45')]['id']}})[_0x3f60('0x22')](handleEntityNotFound(_0x44444d,null))['then'](saveUpdates(_0xe70ab0[_0x3f60('0x49')],null))[_0x3f60('0x22')](respondWithResult(_0x44444d,null))[_0x3f60('0x43')](handleError(_0x44444d,null));};exports['destroy']=function(_0x217348,_0x55f75f){return db[_0x3f60('0x2a')][_0x3f60('0x46')]({'where':{'id':_0x217348[_0x3f60('0x45')]['id']}})[_0x3f60('0x22')](handleEntityNotFound(_0x55f75f,null))['then'](removeEntity(_0x55f75f,null))[_0x3f60('0x43')](handleError(_0x55f75f,null));};exports[_0x3f60('0x4a')]=function(_0x4c87b1,_0x2ac6db){return db['SAInvoiceLaw']['describe']()['then'](respondWithResult(_0x2ac6db,null))['catch'](handleError(_0x2ac6db,null));}; \ No newline at end of file diff --git a/server/api/saInvoiceLaw/saInvoiceLaw.model.js b/server/api/saInvoiceLaw/saInvoiceLaw.model.js index 9e746ab..65bceb4 100644 --- a/server/api/saInvoiceLaw/saInvoiceLaw.model.js +++ b/server/api/saInvoiceLaw/saInvoiceLaw.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['path','rimraf','../../config/environment','./saInvoiceLaw.attributes','exports','define','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x3e13cf,_0xdab4e8){var _0x431369=function(_0xa166a4){while(--_0xa166a4){_0x3e13cf['push'](_0x3e13cf['shift']());}};_0x431369(++_0xdab4e8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x318840,_0x561b1e){_0x318840=_0x318840-0x0;var _0x223da4=_0x0b0e[_0x318840];return _0x223da4;};'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')]('SAInvoiceLaw',attributes,{'tableName':'sa_invoice_laws','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9354=['../../config/environment','./saInvoiceLaw.attributes','exports','define','SAInvoiceLaw','sa_invoice_laws','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x220afa,_0xf5f6cc){var _0x1b79d1=function(_0x178a39){while(--_0x178a39){_0x220afa['push'](_0x220afa['shift']());}};_0x1b79d1(++_0xf5f6cc);}(_0x9354,0x96));var _0x4935=function(_0x4ca288,_0x254dd8){_0x4ca288=_0x4ca288-0x0;var _0x2362c1=_0x9354[_0x4ca288];return _0x2362c1;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var logger=require(_0x4935('0x1'))('api');var moment=require(_0x4935('0x2'));var BPromise=require(_0x4935('0x3'));var rp=require(_0x4935('0x4'));var fs=require('fs');var path=require(_0x4935('0x5'));var rimraf=require('rimraf');var config=require(_0x4935('0x6'));var attributes=require(_0x4935('0x7'));module[_0x4935('0x8')]=function(_0x2d518a,_0x263864){return _0x2d518a[_0x4935('0x9')](_0x4935('0xa'),attributes,{'tableName':_0x4935('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saInvoiceLaw/saInvoiceLaw.rpc.js b/server/api/saInvoiceLaw/saInvoiceLaw.rpc.js index c98cda2..76d2293 100644 --- a/server/api/saInvoiceLaw/saInvoiceLaw.rpc.js +++ b/server/api/saInvoiceLaw/saInvoiceLaw.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64d6=['SAInvoiceLaw,\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','jayson/promise','client','http','then','info'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x64d6,0x11c));var _0x664d=function(_0x583f00,_0x10e901){_0x583f00=_0x583f00-0x0;var _0x2d4771=_0x64d6[_0x583f00];return _0x2d4771;};'use strict';var _=require('lodash');var util=require(_0x664d('0x0'));var moment=require(_0x664d('0x1'));var BPromise=require(_0x664d('0x2'));var rs=require(_0x664d('0x3'));var fs=require('fs');var Redis=require(_0x664d('0x4'));var db=require(_0x664d('0x5'))['db'];var utils=require(_0x664d('0x6'));var logger=require(_0x664d('0x7'))(_0x664d('0x8'));var config=require(_0x664d('0x9'));var jayson=require(_0x664d('0xa'));var client=jayson[_0x664d('0xb')][_0x664d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x58639c,_0x1acfb7,_0x3ccaa8){return new BPromise(function(_0x4b3343,_0x10afb3){return client['request'](_0x58639c,_0x3ccaa8)[_0x664d('0xd')](function(_0x5a0535){logger[_0x664d('0xe')](_0x664d('0xf'),_0x1acfb7,_0x664d('0x10'));logger['debug']('SAInvoiceLaw,\x20%s,\x20%s,\x20%s',_0x1acfb7,_0x664d('0x10'),JSON[_0x664d('0x11')](_0x5a0535));if(_0x5a0535[_0x664d('0x12')]){if(_0x5a0535[_0x664d('0x12')][_0x664d('0x13')]===0x1f4){logger[_0x664d('0x12')](_0x664d('0xf'),_0x1acfb7,_0x5a0535[_0x664d('0x12')][_0x664d('0x14')]);return _0x10afb3(_0x5a0535[_0x664d('0x12')][_0x664d('0x14')]);}logger['error'](_0x664d('0xf'),_0x1acfb7,_0x5a0535[_0x664d('0x12')][_0x664d('0x14')]);return _0x4b3343(_0x5a0535['error'][_0x664d('0x14')]);}else{logger['info'](_0x664d('0xf'),_0x1acfb7,'request\x20sent');_0x4b3343(_0x5a0535[_0x664d('0x15')][_0x664d('0x14')]);}})[_0x664d('0x16')](function(_0x1bee49){logger[_0x664d('0x12')](_0x664d('0xf'),_0x1acfb7,_0x1bee49);_0x10afb3(_0x1bee49);});});} \ No newline at end of file +var _0x4bc6=['../../config/utils','../../config/logger','jayson/promise','client','then','SAInvoiceLaw,\x20%s,\x20%s','request\x20sent','debug','SAInvoiceLaw,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1c8fa5,_0x1e40b6){var _0x556021=function(_0x53e58c){while(--_0x53e58c){_0x1c8fa5['push'](_0x1c8fa5['shift']());}};_0x556021(++_0x1e40b6);}(_0x4bc6,0x67));var _0x64bc=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x4bc6[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x64bc('0x0'));var util=require(_0x64bc('0x1'));var moment=require(_0x64bc('0x2'));var BPromise=require(_0x64bc('0x3'));var rs=require(_0x64bc('0x4'));var fs=require('fs');var Redis=require(_0x64bc('0x5'));var db=require(_0x64bc('0x6'))['db'];var utils=require(_0x64bc('0x7'));var logger=require(_0x64bc('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x64bc('0x9'));var client=jayson[_0x64bc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc50b50,_0xaa25fb,_0x4a614c){return new BPromise(function(_0xbcc3c1,_0x2891c7){return client['request'](_0xc50b50,_0x4a614c)[_0x64bc('0xb')](function(_0x4dd8e3){logger['info'](_0x64bc('0xc'),_0xaa25fb,_0x64bc('0xd'));logger[_0x64bc('0xe')](_0x64bc('0xf'),_0xaa25fb,_0x64bc('0xd'),JSON[_0x64bc('0x10')](_0x4dd8e3));if(_0x4dd8e3['error']){if(_0x4dd8e3['error'][_0x64bc('0x11')]===0x1f4){logger[_0x64bc('0x12')]('SAInvoiceLaw,\x20%s,\x20%s',_0xaa25fb,_0x4dd8e3[_0x64bc('0x12')][_0x64bc('0x13')]);return _0x2891c7(_0x4dd8e3[_0x64bc('0x12')][_0x64bc('0x13')]);}logger[_0x64bc('0x12')](_0x64bc('0xc'),_0xaa25fb,_0x4dd8e3[_0x64bc('0x12')][_0x64bc('0x13')]);return _0xbcc3c1(_0x4dd8e3['error'][_0x64bc('0x13')]);}else{logger[_0x64bc('0x14')](_0x64bc('0xc'),_0xaa25fb,_0x64bc('0xd'));_0xbcc3c1(_0x4dd8e3['result'][_0x64bc('0x13')]);}})[_0x64bc('0x15')](function(_0x10a73f){logger[_0x64bc('0x12')](_0x64bc('0xc'),_0xaa25fb,_0x10a73f);_0x2891c7(_0x10a73f);});});} \ No newline at end of file diff --git a/server/api/saInvoiceNumber/index.js b/server/api/saInvoiceNumber/index.js index a225721..cba8410 100644 --- a/server/api/saInvoiceNumber/index.js +++ b/server/api/saInvoiceNumber/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9af8=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./saInvoiceNumber.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','update','/:id','destroy','multer'];(function(_0x46428c,_0x20ab75){var _0x16a677=function(_0x2b0817){while(--_0x2b0817){_0x46428c['push'](_0x46428c['shift']());}};_0x16a677(++_0x20ab75);}(_0x9af8,0x1a3));var _0x89af=function(_0xba3307,_0x39ef8b){_0xba3307=_0xba3307-0x0;var _0x70d2b9=_0x9af8[_0xba3307];return _0x70d2b9;};'use strict';var multer=require(_0x89af('0x0'));var util=require('util');var path=require(_0x89af('0x1'));var timeout=require(_0x89af('0x2'));var express=require(_0x89af('0x3'));var router=express[_0x89af('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x89af('0x5'));var config=require(_0x89af('0x6'));var controller=require(_0x89af('0x7'));router[_0x89af('0x8')]('/',auth[_0x89af('0x9')](),controller[_0x89af('0xa')]);router['get'](_0x89af('0xb'),auth[_0x89af('0x9')](),controller[_0x89af('0xc')]);router[_0x89af('0x8')]('/:id',auth[_0x89af('0x9')](),controller[_0x89af('0xd')]);router[_0x89af('0xe')]('/',auth['isAuthenticated'](),controller[_0x89af('0xf')]);router[_0x89af('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x89af('0x11')]);router['delete'](_0x89af('0x12'),auth['isAuthenticated'](),controller[_0x89af('0x13')]);module['exports']=router; \ No newline at end of file +var _0xfe5f=['/:id','show','create','put','update','delete','destroy','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','index','isAuthenticated'];(function(_0x3b2481,_0x52d9d0){var _0x29962f=function(_0x3f2c90){while(--_0x3f2c90){_0x3b2481['push'](_0x3b2481['shift']());}};_0x29962f(++_0x52d9d0);}(_0xfe5f,0x137));var _0xffe5=function(_0x301773,_0x15e562){_0x301773=_0x301773-0x0;var _0x5c6383=_0xfe5f[_0x301773];return _0x5c6383;};'use strict';var multer=require('multer');var util=require(_0xffe5('0x0'));var path=require(_0xffe5('0x1'));var timeout=require(_0xffe5('0x2'));var express=require(_0xffe5('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xffe5('0x4'));var config=require(_0xffe5('0x5'));var controller=require('./saInvoiceNumber.controller');router[_0xffe5('0x6')]('/',auth['isAuthenticated'](),controller[_0xffe5('0x7')]);router[_0xffe5('0x6')]('/describe',auth[_0xffe5('0x8')](),controller['describe']);router[_0xffe5('0x6')](_0xffe5('0x9'),auth[_0xffe5('0x8')](),controller[_0xffe5('0xa')]);router['post']('/',auth[_0xffe5('0x8')](),controller[_0xffe5('0xb')]);router[_0xffe5('0xc')](_0xffe5('0x9'),auth[_0xffe5('0x8')](),controller[_0xffe5('0xd')]);router[_0xffe5('0xe')](_0xffe5('0x9'),auth[_0xffe5('0x8')](),controller[_0xffe5('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/saInvoiceNumber/saInvoiceNumber.attributes.js b/server/api/saInvoiceNumber/saInvoiceNumber.attributes.js index 24c19ad..405bf37 100644 --- a/server/api/saInvoiceNumber/saInvoiceNumber.attributes.js +++ b/server/api/saInvoiceNumber/saInvoiceNumber.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc78=['exports','INTEGER','sequelize'];(function(_0x5e6a25,_0x458d9a){var _0xd327cc=function(_0x2d93dc){while(--_0x2d93dc){_0x5e6a25['push'](_0x5e6a25['shift']());}};_0xd327cc(++_0x458d9a);}(_0xdc78,0x1ca));var _0x8dc7=function(_0x28eedc,_0x176917){_0x28eedc=_0x28eedc-0x0;var _0x575e59=_0xdc78[_0x28eedc];return _0x575e59;};'use strict';var Sequelize=require(_0x8dc7('0x0'));module[_0x8dc7('0x1')]={'year':{'type':Sequelize[_0x8dc7('0x2')]},'number':{'type':Sequelize[_0x8dc7('0x2')]}}; \ No newline at end of file +var _0x1d5c=['INTEGER','sequelize','exports'];(function(_0x169585,_0x476cc6){var _0x5cf666=function(_0x4f7106){while(--_0x4f7106){_0x169585['push'](_0x169585['shift']());}};_0x5cf666(++_0x476cc6);}(_0x1d5c,0xeb));var _0xc1d5=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0x1d5c[_0x65c50e];return _0x4573e7;};'use strict';var Sequelize=require(_0xc1d5('0x0'));module[_0xc1d5('0x1')]={'year':{'type':Sequelize[_0xc1d5('0x2')]},'number':{'type':Sequelize[_0xc1d5('0x2')]}}; \ No newline at end of file diff --git a/server/api/saInvoiceNumber/saInvoiceNumber.controller.js b/server/api/saInvoiceNumber/saInvoiceNumber.controller.js index fce7418..92cadba 100644 --- a/server/api/saInvoiceNumber/saInvoiceNumber.controller.js +++ b/server/api/saInvoiceNumber/saInvoiceNumber.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e92=['filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','catch','show','params','merge','find','update','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','squel','crypto','querystring','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','save','then','destroy','error','stack','name','send','index','SAInvoiceNumber','rawAttributes','model','keys','query'];(function(_0x259288,_0x53bd64){var _0x1475f9=function(_0x125a25){while(--_0x125a25){_0x259288['push'](_0x259288['shift']());}};_0x1475f9(++_0x53bd64);}(_0x4e92,0x1ea));var _0x24e9=function(_0x117f4c,_0x36a9b1){_0x117f4c=_0x117f4c-0x0;var _0x2b24e9=_0x4e92[_0x117f4c];return _0x2b24e9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x24e9('0x0'));var jsonpatch=require(_0x24e9('0x1'));var rp=require(_0x24e9('0x2'));var moment=require(_0x24e9('0x3'));var BPromise=require(_0x24e9('0x4'));var Mustache=require(_0x24e9('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x24e9('0x6'));var ejs=require(_0x24e9('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x24e9('0x8'));var crypto=require(_0x24e9('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x24e9('0x6'));var querystring=require(_0x24e9('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x24e9('0xb'));var hardwareService=require(_0x24e9('0xc'));var logger=require('../../config/logger')(_0x24e9('0xd'));var utils=require(_0x24e9('0xe'));var config=require(_0x24e9('0xf'));var db=require(_0x24e9('0x10'))['db'];function respondWithStatusCode(_0x53c2fe,_0x1ee414){_0x1ee414=_0x1ee414||0xcc;return function(_0x2889bd){if(_0x2889bd){return _0x53c2fe[_0x24e9('0x11')](_0x1ee414);}return _0x53c2fe[_0x24e9('0x12')](_0x1ee414)[_0x24e9('0x13')]();};}function respondWithResult(_0x794d61,_0x8cbe85){_0x8cbe85=_0x8cbe85||0xc8;return function(_0x5cc866){if(_0x5cc866){return _0x794d61[_0x24e9('0x12')](_0x8cbe85)[_0x24e9('0x14')](_0x5cc866);}};}function respondWithFilteredResult(_0x497def,_0x57dcf1){return function(_0x1a7cf6){if(_0x1a7cf6){var _0xdd3482=_0x1a7cf6[_0x24e9('0x15')],_0x3f8d36=_0x57dcf1[_0x24e9('0x16')],_0x37cb74=_0x57dcf1[_0x24e9('0x16')]+_0x57dcf1['limit'],_0x316efd;if(_0x37cb74>=_0xdd3482){_0x37cb74=_0xdd3482;_0x316efd=0xc8;}else{_0x316efd=0xce;}_0x497def[_0x24e9('0x12')](_0x316efd);return _0x497def[_0x24e9('0x17')]('Content-Range',_0x3f8d36+'-'+_0x37cb74+'/'+_0xdd3482)['json'](_0x1a7cf6);}return null;};}function patchUpdates(_0x12ebaf){return function(_0x299041){try{jsonpatch[_0x24e9('0x18')](_0x299041,_0x12ebaf,!![]);}catch(_0x1184c2){return BPromise['reject'](_0x1184c2);}return _0x299041[_0x24e9('0x19')]();};}function saveUpdates(_0x12c293,_0xcfc31c){return function(_0x15e769){if(_0x15e769){return _0x15e769['update'](_0x12c293)[_0x24e9('0x1a')](function(_0xfca87c){return _0xfca87c;});}return null;};}function removeEntity(_0x24ae12,_0x50ec0e){return function(_0x3d497d){if(_0x3d497d){return _0x3d497d[_0x24e9('0x1b')]()[_0x24e9('0x1a')](function(){_0x24ae12[_0x24e9('0x12')](0xcc)[_0x24e9('0x13')]();});}};}function handleEntityNotFound(_0x49a4a2,_0x1d0d8f){return function(_0xe058ed){if(!_0xe058ed){_0x49a4a2[_0x24e9('0x11')](0x194);}return _0xe058ed;};}function handleError(_0x678b3e,_0x4651fa){_0x4651fa=_0x4651fa||0x1f4;return function(_0x3f2b69){logger[_0x24e9('0x1c')](_0x3f2b69[_0x24e9('0x1d')]);if(_0x3f2b69[_0x24e9('0x1e')]){delete _0x3f2b69[_0x24e9('0x1e')];}_0x678b3e[_0x24e9('0x12')](_0x4651fa)[_0x24e9('0x1f')](_0x3f2b69);};}exports[_0x24e9('0x20')]=function(_0x2edd29,_0x20b803){var _0x39ba1b={},_0x327676={},_0x5edc61={'count':0x0,'rows':[]};var _0xf67f84=db[_0x24e9('0x21')][_0x24e9('0x22')];_0x327676[_0x24e9('0x23')]=_[_0x24e9('0x24')](_0xf67f84);_0x327676['query']=_['keys'](_0x2edd29[_0x24e9('0x25')]);_0x327676[_0x24e9('0x26')]=_[_0x24e9('0x27')](_0x327676['model'],_0x327676[_0x24e9('0x25')]);_0x39ba1b[_0x24e9('0x28')]=_['intersection'](_0x327676['model'],qs[_0x24e9('0x29')](_0x2edd29['query'][_0x24e9('0x29')]));_0x39ba1b['attributes']=_0x39ba1b[_0x24e9('0x28')][_0x24e9('0x2a')]?_0x39ba1b['attributes']:_0x327676[_0x24e9('0x23')];if(!_0x2edd29['query']['hasOwnProperty'](_0x24e9('0x2b'))){_0x39ba1b[_0x24e9('0x2c')]=qs[_0x24e9('0x2c')](_0x2edd29['query'][_0x24e9('0x2c')]);_0x39ba1b[_0x24e9('0x16')]=qs['offset'](_0x2edd29[_0x24e9('0x25')][_0x24e9('0x16')]);}_0x39ba1b[_0x24e9('0x2d')]=qs['sort'](_0x2edd29[_0x24e9('0x25')][_0x24e9('0x2e')]);_0x39ba1b[_0x24e9('0x2f')]=qs[_0x24e9('0x26')](_[_0x24e9('0x30')](_0x2edd29['query'],_0x327676[_0x24e9('0x26')]));if(_0x2edd29[_0x24e9('0x25')]['filter']){_0x39ba1b[_0x24e9('0x2f')]=_['merge'](_0x39ba1b[_0x24e9('0x2f')],{'$or':_['map'](_0xf67f84,function(_0x1aab63){if(_0x1aab63[_0x24e9('0x31')][_0x24e9('0x32')]!==_0x24e9('0x33')){var _0x2323e8={};_0x2323e8[_0x1aab63[_0x24e9('0x34')]]={'$like':'%'+_0x2edd29['query'][_0x24e9('0x35')]+'%'};return _0x2323e8;}})});}_0x39ba1b=_['merge']({},_0x39ba1b,_0x2edd29[_0x24e9('0x36')]);var _0x3c1249={'where':_0x39ba1b['where']};return db[_0x24e9('0x21')][_0x24e9('0x15')](_0x3c1249)[_0x24e9('0x1a')](function(_0x2cb614){_0x5edc61[_0x24e9('0x15')]=_0x2cb614;if(_0x2edd29[_0x24e9('0x25')][_0x24e9('0x37')]){_0x39ba1b[_0x24e9('0x38')]=[{'all':!![]}];}return db[_0x24e9('0x21')][_0x24e9('0x39')](_0x39ba1b);})[_0x24e9('0x1a')](function(_0x4c28e8){_0x5edc61['rows']=_0x4c28e8;return _0x5edc61;})[_0x24e9('0x1a')](respondWithFilteredResult(_0x20b803,_0x39ba1b))[_0x24e9('0x3a')](handleError(_0x20b803,null));};exports[_0x24e9('0x3b')]=function(_0x2a40ce,_0x246560){var _0x577c52={'raw':![],'where':{'id':_0x2a40ce[_0x24e9('0x3c')]['id']}},_0x4d3041={};_0x4d3041[_0x24e9('0x23')]=_[_0x24e9('0x24')](db['SAInvoiceNumber'][_0x24e9('0x22')]);_0x4d3041['query']=_[_0x24e9('0x24')](_0x2a40ce[_0x24e9('0x25')]);_0x4d3041[_0x24e9('0x26')]=_[_0x24e9('0x27')](_0x4d3041[_0x24e9('0x23')],_0x4d3041[_0x24e9('0x25')]);_0x577c52[_0x24e9('0x28')]=_[_0x24e9('0x27')](_0x4d3041[_0x24e9('0x23')],qs[_0x24e9('0x29')](_0x2a40ce['query'][_0x24e9('0x29')]));_0x577c52['attributes']=_0x577c52[_0x24e9('0x28')]['length']?_0x577c52[_0x24e9('0x28')]:_0x4d3041['model'];if(_0x2a40ce['query'][_0x24e9('0x37')]){_0x577c52[_0x24e9('0x38')]=[{'all':!![]}];}_0x577c52=_[_0x24e9('0x3d')]({},_0x577c52,_0x2a40ce[_0x24e9('0x36')]);return db[_0x24e9('0x21')][_0x24e9('0x3e')](_0x577c52)[_0x24e9('0x1a')](handleEntityNotFound(_0x246560,null))[_0x24e9('0x1a')](respondWithResult(_0x246560,null))['catch'](handleError(_0x246560,null));};exports['create']=function(_0x3e2523,_0xc7d84b){return db[_0x24e9('0x21')]['create'](_0x3e2523['body'],{})[_0x24e9('0x1a')](respondWithResult(_0xc7d84b,0xc9))[_0x24e9('0x3a')](handleError(_0xc7d84b,null));};exports[_0x24e9('0x3f')]=function(_0x5dbe45,_0x3863e8){if(_0x5dbe45[_0x24e9('0x40')]['id']){delete _0x5dbe45[_0x24e9('0x40')]['id'];}return db[_0x24e9('0x21')][_0x24e9('0x3e')]({'where':{'id':_0x5dbe45[_0x24e9('0x3c')]['id']}})[_0x24e9('0x1a')](handleEntityNotFound(_0x3863e8,null))[_0x24e9('0x1a')](saveUpdates(_0x5dbe45[_0x24e9('0x40')],null))['then'](respondWithResult(_0x3863e8,null))[_0x24e9('0x3a')](handleError(_0x3863e8,null));};exports[_0x24e9('0x1b')]=function(_0x1b50e4,_0x1a2845){return db[_0x24e9('0x21')][_0x24e9('0x3e')]({'where':{'id':_0x1b50e4['params']['id']}})[_0x24e9('0x1a')](handleEntityNotFound(_0x1a2845,null))['then'](removeEntity(_0x1a2845,null))[_0x24e9('0x3a')](handleError(_0x1a2845,null));};exports[_0x24e9('0x41')]=function(_0x18d7b7,_0xf58208){return db[_0x24e9('0x21')]['describe']()[_0x24e9('0x1a')](respondWithResult(_0xf58208,null))[_0x24e9('0x3a')](handleError(_0xf58208,null));}; \ No newline at end of file +var _0x1ef5=['to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','sendStatus','end','count','offset','limit','status','set','Content-Range','json','save','update','then','destroy','error','stack','send','index','rawAttributes','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','map','key','VIRTUAL','merge','SAInvoiceNumber','includeAll','include','findAll','rows','find','catch','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x1ef5,0x146));var _0x51ef=function(_0x57dd17,_0x1ad289){_0x57dd17=_0x57dd17-0x0;var _0x4f27cc=_0x1ef5[_0x57dd17];return _0x4f27cc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x51ef('0x0'));var rimraf=require(_0x51ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x51ef('0x2'));var rp=require(_0x51ef('0x3'));var moment=require(_0x51ef('0x4'));var BPromise=require(_0x51ef('0x5'));var Mustache=require(_0x51ef('0x6'));var util=require(_0x51ef('0x7'));var path=require(_0x51ef('0x8'));var sox=require('sox');var csv=require(_0x51ef('0x9'));var ejs=require(_0x51ef('0xa'));var fs=require('fs');var _=require(_0x51ef('0xb'));var squel=require('squel');var crypto=require(_0x51ef('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x51ef('0xd'));var toCsv=require(_0x51ef('0x9'));var querystring=require('querystring');var Papa=require(_0x51ef('0xe'));var Redis=require(_0x51ef('0xf'));var authService=require(_0x51ef('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x51ef('0x11'));var utils=require(_0x51ef('0x12'));var config=require(_0x51ef('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x194094,_0x535c8f){_0x535c8f=_0x535c8f||0xcc;return function(_0x2a2222){if(_0x2a2222){return _0x194094[_0x51ef('0x14')](_0x535c8f);}return _0x194094['status'](_0x535c8f)[_0x51ef('0x15')]();};}function respondWithResult(_0x4b0e07,_0x2d1808){_0x2d1808=_0x2d1808||0xc8;return function(_0x39c81b){if(_0x39c81b){return _0x4b0e07['status'](_0x2d1808)['json'](_0x39c81b);}};}function respondWithFilteredResult(_0x8165d8,_0xefb9eb){return function(_0x36f849){if(_0x36f849){var _0xe1bcb6=_0x36f849[_0x51ef('0x16')],_0x405f0c=_0xefb9eb[_0x51ef('0x17')],_0x4934fb=_0xefb9eb['offset']+_0xefb9eb[_0x51ef('0x18')],_0x552e25;if(_0x4934fb>=_0xe1bcb6){_0x4934fb=_0xe1bcb6;_0x552e25=0xc8;}else{_0x552e25=0xce;}_0x8165d8[_0x51ef('0x19')](_0x552e25);return _0x8165d8[_0x51ef('0x1a')](_0x51ef('0x1b'),_0x405f0c+'-'+_0x4934fb+'/'+_0xe1bcb6)[_0x51ef('0x1c')](_0x36f849);}return null;};}function patchUpdates(_0x5d2e80){return function(_0x35449b){try{jsonpatch['apply'](_0x35449b,_0x5d2e80,!![]);}catch(_0x272b26){return BPromise['reject'](_0x272b26);}return _0x35449b[_0x51ef('0x1d')]();};}function saveUpdates(_0x5241b4,_0xff5f1d){return function(_0x32e5fc){if(_0x32e5fc){return _0x32e5fc[_0x51ef('0x1e')](_0x5241b4)[_0x51ef('0x1f')](function(_0x52f1d2){return _0x52f1d2;});}return null;};}function removeEntity(_0x4e1726,_0x200dd2){return function(_0x8589ab){if(_0x8589ab){return _0x8589ab[_0x51ef('0x20')]()[_0x51ef('0x1f')](function(){_0x4e1726[_0x51ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b8141,_0x1e256e){return function(_0x2d2607){if(!_0x2d2607){_0x3b8141['sendStatus'](0x194);}return _0x2d2607;};}function handleError(_0x4f9514,_0x2f36e6){_0x2f36e6=_0x2f36e6||0x1f4;return function(_0x1d3c82){logger[_0x51ef('0x21')](_0x1d3c82[_0x51ef('0x22')]);if(_0x1d3c82['name']){delete _0x1d3c82['name'];}_0x4f9514[_0x51ef('0x19')](_0x2f36e6)[_0x51ef('0x23')](_0x1d3c82);};}exports[_0x51ef('0x24')]=function(_0x4a3a8d,_0x2b5fbf){var _0x3f1dcc={},_0x5c451d={},_0x23d981={'count':0x0,'rows':[]};var _0x29ccb5=db['SAInvoiceNumber'][_0x51ef('0x25')];_0x5c451d[_0x51ef('0x26')]=_[_0x51ef('0x27')](_0x29ccb5);_0x5c451d['query']=_[_0x51ef('0x27')](_0x4a3a8d[_0x51ef('0x28')]);_0x5c451d['filters']=_[_0x51ef('0x29')](_0x5c451d[_0x51ef('0x26')],_0x5c451d['query']);_0x3f1dcc[_0x51ef('0x2a')]=_['intersection'](_0x5c451d[_0x51ef('0x26')],qs[_0x51ef('0x2b')](_0x4a3a8d[_0x51ef('0x28')][_0x51ef('0x2b')]));_0x3f1dcc[_0x51ef('0x2a')]=_0x3f1dcc[_0x51ef('0x2a')][_0x51ef('0x2c')]?_0x3f1dcc[_0x51ef('0x2a')]:_0x5c451d[_0x51ef('0x26')];if(!_0x4a3a8d[_0x51ef('0x28')]['hasOwnProperty'](_0x51ef('0x2d'))){_0x3f1dcc['limit']=qs[_0x51ef('0x18')](_0x4a3a8d[_0x51ef('0x28')][_0x51ef('0x18')]);_0x3f1dcc[_0x51ef('0x17')]=qs[_0x51ef('0x17')](_0x4a3a8d[_0x51ef('0x28')][_0x51ef('0x17')]);}_0x3f1dcc[_0x51ef('0x2e')]=qs['sort'](_0x4a3a8d[_0x51ef('0x28')][_0x51ef('0x2f')]);_0x3f1dcc[_0x51ef('0x30')]=qs[_0x51ef('0x31')](_[_0x51ef('0x32')](_0x4a3a8d[_0x51ef('0x28')],_0x5c451d[_0x51ef('0x31')]));if(_0x4a3a8d[_0x51ef('0x28')][_0x51ef('0x33')]){_0x3f1dcc[_0x51ef('0x30')]=_['merge'](_0x3f1dcc[_0x51ef('0x30')],{'$or':_[_0x51ef('0x34')](_0x29ccb5,function(_0x42b22c){if(_0x42b22c['type'][_0x51ef('0x35')]!==_0x51ef('0x36')){var _0x2bf31a={};_0x2bf31a[_0x42b22c['field']]={'$like':'%'+_0x4a3a8d[_0x51ef('0x28')][_0x51ef('0x33')]+'%'};return _0x2bf31a;}})});}_0x3f1dcc=_[_0x51ef('0x37')]({},_0x3f1dcc,_0x4a3a8d['options']);var _0x146415={'where':_0x3f1dcc['where']};return db[_0x51ef('0x38')]['count'](_0x146415)[_0x51ef('0x1f')](function(_0x5f51cb){_0x23d981[_0x51ef('0x16')]=_0x5f51cb;if(_0x4a3a8d[_0x51ef('0x28')][_0x51ef('0x39')]){_0x3f1dcc[_0x51ef('0x3a')]=[{'all':!![]}];}return db[_0x51ef('0x38')][_0x51ef('0x3b')](_0x3f1dcc);})[_0x51ef('0x1f')](function(_0x59f260){_0x23d981[_0x51ef('0x3c')]=_0x59f260;return _0x23d981;})[_0x51ef('0x1f')](respondWithFilteredResult(_0x2b5fbf,_0x3f1dcc))['catch'](handleError(_0x2b5fbf,null));};exports['show']=function(_0x5e6ebb,_0x40cc47){var _0x46e409={'raw':![],'where':{'id':_0x5e6ebb['params']['id']}},_0x580f80={};_0x580f80['model']=_[_0x51ef('0x27')](db[_0x51ef('0x38')][_0x51ef('0x25')]);_0x580f80[_0x51ef('0x28')]=_['keys'](_0x5e6ebb[_0x51ef('0x28')]);_0x580f80[_0x51ef('0x31')]=_[_0x51ef('0x29')](_0x580f80[_0x51ef('0x26')],_0x580f80[_0x51ef('0x28')]);_0x46e409['attributes']=_[_0x51ef('0x29')](_0x580f80[_0x51ef('0x26')],qs[_0x51ef('0x2b')](_0x5e6ebb['query'][_0x51ef('0x2b')]));_0x46e409[_0x51ef('0x2a')]=_0x46e409[_0x51ef('0x2a')][_0x51ef('0x2c')]?_0x46e409[_0x51ef('0x2a')]:_0x580f80[_0x51ef('0x26')];if(_0x5e6ebb[_0x51ef('0x28')][_0x51ef('0x39')]){_0x46e409[_0x51ef('0x3a')]=[{'all':!![]}];}_0x46e409=_[_0x51ef('0x37')]({},_0x46e409,_0x5e6ebb['options']);return db[_0x51ef('0x38')][_0x51ef('0x3d')](_0x46e409)[_0x51ef('0x1f')](handleEntityNotFound(_0x40cc47,null))[_0x51ef('0x1f')](respondWithResult(_0x40cc47,null))[_0x51ef('0x3e')](handleError(_0x40cc47,null));};exports[_0x51ef('0x3f')]=function(_0x21f0ea,_0x4e51f8){return db[_0x51ef('0x38')][_0x51ef('0x3f')](_0x21f0ea[_0x51ef('0x40')],{})[_0x51ef('0x1f')](respondWithResult(_0x4e51f8,0xc9))[_0x51ef('0x3e')](handleError(_0x4e51f8,null));};exports[_0x51ef('0x1e')]=function(_0x248df8,_0x84af21){if(_0x248df8[_0x51ef('0x40')]['id']){delete _0x248df8['body']['id'];}return db['SAInvoiceNumber']['find']({'where':{'id':_0x248df8[_0x51ef('0x41')]['id']}})[_0x51ef('0x1f')](handleEntityNotFound(_0x84af21,null))[_0x51ef('0x1f')](saveUpdates(_0x248df8[_0x51ef('0x40')],null))[_0x51ef('0x1f')](respondWithResult(_0x84af21,null))[_0x51ef('0x3e')](handleError(_0x84af21,null));};exports[_0x51ef('0x20')]=function(_0x15f8a1,_0x31031c){return db[_0x51ef('0x38')][_0x51ef('0x3d')]({'where':{'id':_0x15f8a1[_0x51ef('0x41')]['id']}})[_0x51ef('0x1f')](handleEntityNotFound(_0x31031c,null))[_0x51ef('0x1f')](removeEntity(_0x31031c,null))['catch'](handleError(_0x31031c,null));};exports['describe']=function(_0xb41cfd,_0x518daf){return db[_0x51ef('0x38')][_0x51ef('0x42')]()[_0x51ef('0x1f')](respondWithResult(_0x518daf,null))[_0x51ef('0x3e')](handleError(_0x518daf,null));}; \ No newline at end of file diff --git a/server/api/saInvoiceNumber/saInvoiceNumber.model.js b/server/api/saInvoiceNumber/saInvoiceNumber.model.js index 82f55db..cb7fe02 100644 --- a/server/api/saInvoiceNumber/saInvoiceNumber.model.js +++ b/server/api/saInvoiceNumber/saInvoiceNumber.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b61=['path','rimraf','../../config/environment','./saInvoiceNumber.attributes','define','SAInvoiceNumber','sa_invoice_numbers','lodash','util','api','moment','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5b61,0x14c));var _0x15b6=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0x5b61[_0x4eafed];return _0x159c85;};'use strict';var _=require(_0x15b6('0x0'));var util=require(_0x15b6('0x1'));var logger=require('../../config/logger')(_0x15b6('0x2'));var moment=require(_0x15b6('0x3'));var BPromise=require(_0x15b6('0x4'));var rp=require(_0x15b6('0x5'));var fs=require('fs');var path=require(_0x15b6('0x6'));var rimraf=require(_0x15b6('0x7'));var config=require(_0x15b6('0x8'));var attributes=require(_0x15b6('0x9'));module['exports']=function(_0x2c09fa,_0xde1dfb){return _0x2c09fa[_0x15b6('0xa')](_0x15b6('0xb'),attributes,{'tableName':_0x15b6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f40=['SAInvoiceNumber','util','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x21cc45,_0x22eff2){var _0x169c76=function(_0x540230){while(--_0x540230){_0x21cc45['push'](_0x21cc45['shift']());}};_0x169c76(++_0x22eff2);}(_0x0f40,0x119));var _0x00f4=function(_0x53e9b3,_0x10ebad){_0x53e9b3=_0x53e9b3-0x0;var _0x1c394e=_0x0f40[_0x53e9b3];return _0x1c394e;};'use strict';var _=require('lodash');var util=require(_0x00f4('0x0'));var logger=require('../../config/logger')(_0x00f4('0x1'));var moment=require(_0x00f4('0x2'));var BPromise=require(_0x00f4('0x3'));var rp=require(_0x00f4('0x4'));var fs=require('fs');var path=require(_0x00f4('0x5'));var rimraf=require(_0x00f4('0x6'));var config=require('../../config/environment');var attributes=require('./saInvoiceNumber.attributes');module[_0x00f4('0x7')]=function(_0x34b3f7,_0x15ae33){return _0x34b3f7[_0x00f4('0x8')](_0x00f4('0x9'),attributes,{'tableName':'sa_invoice_numbers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saInvoiceNumber/saInvoiceNumber.rpc.js b/server/api/saInvoiceNumber/saInvoiceNumber.rpc.js index b5b257b..ae9ebf0 100644 --- a/server/api/saInvoiceNumber/saInvoiceNumber.rpc.js +++ b/server/api/saInvoiceNumber/saInvoiceNumber.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf743=['http','request','then','info','SAInvoiceNumber,\x20%s,\x20%s','request\x20sent','debug','SAInvoiceNumber,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x57abe9,_0x35d265){var _0x13a02d=function(_0x3080fa){while(--_0x3080fa){_0x57abe9['push'](_0x57abe9['shift']());}};_0x13a02d(++_0x35d265);}(_0xf743,0x188));var _0x3f74=function(_0x4cccb7,_0x528880){_0x4cccb7=_0x4cccb7-0x0;var _0x8fa7f6=_0xf743[_0x4cccb7];return _0x8fa7f6;};'use strict';var _=require(_0x3f74('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3f74('0x1'));var logger=require(_0x3f74('0x2'))(_0x3f74('0x3'));var config=require(_0x3f74('0x4'));var jayson=require(_0x3f74('0x5'));var client=jayson[_0x3f74('0x6')][_0x3f74('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x43dc85,_0x2ffcda,_0x1f4b65){return new BPromise(function(_0x40b598,_0x13a291){return client[_0x3f74('0x8')](_0x43dc85,_0x1f4b65)[_0x3f74('0x9')](function(_0x668849){logger[_0x3f74('0xa')](_0x3f74('0xb'),_0x2ffcda,_0x3f74('0xc'));logger[_0x3f74('0xd')](_0x3f74('0xe'),_0x2ffcda,_0x3f74('0xc'),JSON[_0x3f74('0xf')](_0x668849));if(_0x668849[_0x3f74('0x10')]){if(_0x668849['error'][_0x3f74('0x11')]===0x1f4){logger[_0x3f74('0x10')]('SAInvoiceNumber,\x20%s,\x20%s',_0x2ffcda,_0x668849[_0x3f74('0x10')][_0x3f74('0x12')]);return _0x13a291(_0x668849['error'][_0x3f74('0x12')]);}logger[_0x3f74('0x10')](_0x3f74('0xb'),_0x2ffcda,_0x668849['error'][_0x3f74('0x12')]);return _0x40b598(_0x668849['error'][_0x3f74('0x12')]);}else{logger[_0x3f74('0xa')](_0x3f74('0xb'),_0x2ffcda,'request\x20sent');_0x40b598(_0x668849[_0x3f74('0x13')][_0x3f74('0x12')]);}})[_0x3f74('0x14')](function(_0x3a25ac){logger[_0x3f74('0x10')]('SAInvoiceNumber,\x20%s,\x20%s',_0x2ffcda,_0x3a25ac);_0x13a291(_0x3a25ac);});});} \ No newline at end of file +var _0x79a1=['../../config/environment','jayson/promise','client','http','request','info','SAInvoiceNumber,\x20%s,\x20%s','request\x20sent','debug','SAInvoiceNumber,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x79a1,0x159));var _0x179a=function(_0x1d89d8,_0x202310){_0x1d89d8=_0x1d89d8-0x0;var _0x74f3b0=_0x79a1[_0x1d89d8];return _0x74f3b0;};'use strict';var _=require('lodash');var util=require(_0x179a('0x0'));var moment=require(_0x179a('0x1'));var BPromise=require('bluebird');var rs=require(_0x179a('0x2'));var fs=require('fs');var Redis=require(_0x179a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x179a('0x4'));var logger=require(_0x179a('0x5'))(_0x179a('0x6'));var config=require(_0x179a('0x7'));var jayson=require(_0x179a('0x8'));var client=jayson[_0x179a('0x9')][_0x179a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5530bf,_0x1440ef,_0x5176f8){return new BPromise(function(_0x2a2483,_0x41fef8){return client[_0x179a('0xb')](_0x5530bf,_0x5176f8)['then'](function(_0xb7c86a){logger[_0x179a('0xc')](_0x179a('0xd'),_0x1440ef,_0x179a('0xe'));logger[_0x179a('0xf')](_0x179a('0x10'),_0x1440ef,_0x179a('0xe'),JSON[_0x179a('0x11')](_0xb7c86a));if(_0xb7c86a[_0x179a('0x12')]){if(_0xb7c86a[_0x179a('0x12')][_0x179a('0x13')]===0x1f4){logger[_0x179a('0x12')]('SAInvoiceNumber,\x20%s,\x20%s',_0x1440ef,_0xb7c86a['error'][_0x179a('0x14')]);return _0x41fef8(_0xb7c86a[_0x179a('0x12')]['message']);}logger[_0x179a('0x12')](_0x179a('0xd'),_0x1440ef,_0xb7c86a[_0x179a('0x12')][_0x179a('0x14')]);return _0x2a2483(_0xb7c86a[_0x179a('0x12')]['message']);}else{logger['info'](_0x179a('0xd'),_0x1440ef,'request\x20sent');_0x2a2483(_0xb7c86a[_0x179a('0x15')][_0x179a('0x14')]);}})['catch'](function(_0x2ae50c){logger[_0x179a('0x12')]('SAInvoiceNumber,\x20%s,\x20%s',_0x1440ef,_0x2ae50c);_0x41fef8(_0x2ae50c);});});} \ No newline at end of file diff --git a/server/api/saOrder/index.js b/server/api/saOrder/index.js index 6ac6cfa..a91b402 100644 --- a/server/api/saOrder/index.js +++ b/server/api/saOrder/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c3c=['post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saOrder.controller','get','isAuthenticated','index','/:id','show'];(function(_0x42af53,_0x50af6b){var _0x1cfc79=function(_0x352688){while(--_0x352688){_0x42af53['push'](_0x42af53['shift']());}};_0x1cfc79(++_0x50af6b);}(_0x5c3c,0x132));var _0xc5c3=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5c3c[_0x31e29a];return _0x32d892;};'use strict';var multer=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var path=require(_0xc5c3('0x2'));var timeout=require(_0xc5c3('0x3'));var express=require('express');var router=express[_0xc5c3('0x4')]();var auth=require(_0xc5c3('0x5'));var interaction=require(_0xc5c3('0x6'));var config=require(_0xc5c3('0x7'));var controller=require(_0xc5c3('0x8'));router[_0xc5c3('0x9')]('/',auth[_0xc5c3('0xa')](),controller[_0xc5c3('0xb')]);router[_0xc5c3('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xc5c3('0x9')](_0xc5c3('0xc'),auth['isAuthenticated'](),controller[_0xc5c3('0xd')]);router[_0xc5c3('0xe')]('/',auth['isAuthenticated'](),controller[_0xc5c3('0xf')]);router[_0xc5c3('0x10')]('/:id',auth[_0xc5c3('0xa')](),controller[_0xc5c3('0x11')]);router[_0xc5c3('0x12')]('/:id',auth[_0xc5c3('0xa')](),controller[_0xc5c3('0x13')]);module['exports']=router; \ No newline at end of file +var _0xf7b4=['update','delete','multer','connect-timeout','express','../../components/interaction/service','../../config/environment','./saOrder.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xf7b4,0x152));var _0x4f7b=function(_0x2c0399,_0x15c979){_0x2c0399=_0x2c0399-0x0;var _0x8af475=_0xf7b4[_0x2c0399];return _0x8af475;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f7b('0x1'));var express=require(_0x4f7b('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4f7b('0x3'));var config=require(_0x4f7b('0x4'));var controller=require(_0x4f7b('0x5'));router[_0x4f7b('0x6')]('/',auth[_0x4f7b('0x7')](),controller[_0x4f7b('0x8')]);router[_0x4f7b('0x6')](_0x4f7b('0x9'),auth[_0x4f7b('0x7')](),controller[_0x4f7b('0xa')]);router[_0x4f7b('0x6')](_0x4f7b('0xb'),auth[_0x4f7b('0x7')](),controller['show']);router[_0x4f7b('0xc')]('/',auth[_0x4f7b('0x7')](),controller['create']);router[_0x4f7b('0xd')](_0x4f7b('0xb'),auth[_0x4f7b('0x7')](),controller[_0x4f7b('0xe')]);router[_0x4f7b('0xf')]('/:id',auth[_0x4f7b('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/saOrder/saOrder.attributes.js b/server/api/saOrder/saOrder.attributes.js index eb817e4..d319a06 100644 --- a/server/api/saOrder/saOrder.attributes.js +++ b/server/api/saOrder/saOrder.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['sequelize','exports','STRING'];(function(_0x304a6e,_0x2a93ad){var _0x5e3751=function(_0x55df79){while(--_0x55df79){_0x304a6e['push'](_0x304a6e['shift']());}};_0x5e3751(++_0x2a93ad);}(_0xe14b,0x93));var _0xbe14=function(_0x1379c4,_0x47f981){_0x1379c4=_0x1379c4-0x0;var _0x87b96=_0xe14b[_0x1379c4];return _0x87b96;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'clientCode':{'type':Sequelize['STRING']},'note':{'type':Sequelize['TEXT']},'agentFullname':{'type':Sequelize[_0xbe14('0x2')]},'status':{'type':Sequelize[_0xbe14('0x2')]}}; \ No newline at end of file +var _0x814b=['STRING','TEXT','sequelize','exports'];(function(_0x301f54,_0x568155){var _0x116558=function(_0x3980aa){while(--_0x3980aa){_0x301f54['push'](_0x301f54['shift']());}};_0x116558(++_0x568155);}(_0x814b,0x1a2));var _0xb814=function(_0x53a7a8,_0xed2bff){_0x53a7a8=_0x53a7a8-0x0;var _0x555f71=_0x814b[_0x53a7a8];return _0x555f71;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'clientCode':{'type':Sequelize[_0xb814('0x2')]},'note':{'type':Sequelize[_0xb814('0x3')]},'agentFullname':{'type':Sequelize[_0xb814('0x2')]},'status':{'type':Sequelize[_0xb814('0x2')]}}; \ No newline at end of file diff --git a/server/api/saOrder/saOrder.controller.js b/server/api/saOrder/saOrder.controller.js index fc2d5e0..1a4ea2d 100644 --- a/server/api/saOrder/saOrder.controller.js +++ b/server/api/saOrder/saOrder.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d2e=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','offset','limit','set','apply','then','destroy','end','stack','name','send','index','SAOrder','rawAttributes','keys','query','filters','model','fields','attributes','hasOwnProperty','order','sort','where','filter','map','type','key','field','merge','count','includeAll','findAll','catch','show','intersection','include','options','find','create','body','update','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x3da8eb,_0xf6cec2){var _0x26d6ef=function(_0x3f18ae){while(--_0x3f18ae){_0x3da8eb['push'](_0x3da8eb['shift']());}};_0x26d6ef(++_0xf6cec2);}(_0x7d2e,0x150));var _0xe7d2=function(_0x245c79,_0x50406b){_0x245c79=_0x245c79-0x0;var _0x3aab1d=_0x7d2e[_0x245c79];return _0x3aab1d;};'use strict';var pdf=require(_0xe7d2('0x0'));var emlformat=require(_0xe7d2('0x1'));var rimraf=require(_0xe7d2('0x2'));var zipdir=require(_0xe7d2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7d2('0x4'));var moment=require('moment');var BPromise=require(_0xe7d2('0x5'));var Mustache=require(_0xe7d2('0x6'));var util=require(_0xe7d2('0x7'));var path=require(_0xe7d2('0x8'));var sox=require(_0xe7d2('0x9'));var csv=require(_0xe7d2('0xa'));var ejs=require(_0xe7d2('0xb'));var fs=require('fs');var _=require(_0xe7d2('0xc'));var squel=require(_0xe7d2('0xd'));var crypto=require(_0xe7d2('0xe'));var jsforce=require(_0xe7d2('0xf'));var deskjs=require(_0xe7d2('0x10'));var toCsv=require(_0xe7d2('0xa'));var querystring=require(_0xe7d2('0x11'));var Papa=require('papaparse');var Redis=require(_0xe7d2('0x12'));var authService=require(_0xe7d2('0x13'));var qs=require(_0xe7d2('0x14'));var hardwareService=require(_0xe7d2('0x15'));var logger=require(_0xe7d2('0x16'))(_0xe7d2('0x17'));var utils=require('../../config/utils');var config=require(_0xe7d2('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a8ca4,_0x2abfd1){_0x2abfd1=_0x2abfd1||0xcc;return function(_0x5222c9){if(_0x5222c9){return _0x4a8ca4[_0xe7d2('0x19')](_0x2abfd1);}return _0x4a8ca4[_0xe7d2('0x1a')](_0x2abfd1)['end']();};}function respondWithResult(_0x8773c1,_0x12f827){_0x12f827=_0x12f827||0xc8;return function(_0x31060b){if(_0x31060b){return _0x8773c1[_0xe7d2('0x1a')](_0x12f827)[_0xe7d2('0x1b')](_0x31060b);}};}function respondWithFilteredResult(_0x5a6da3,_0x1a6490){return function(_0x6e0015){if(_0x6e0015){var _0x3940d7=_0x6e0015['count'],_0x112518=_0x1a6490[_0xe7d2('0x1c')],_0x491f62=_0x1a6490[_0xe7d2('0x1c')]+_0x1a6490[_0xe7d2('0x1d')],_0x511216;if(_0x491f62>=_0x3940d7){_0x491f62=_0x3940d7;_0x511216=0xc8;}else{_0x511216=0xce;}_0x5a6da3[_0xe7d2('0x1a')](_0x511216);return _0x5a6da3[_0xe7d2('0x1e')]('Content-Range',_0x112518+'-'+_0x491f62+'/'+_0x3940d7)[_0xe7d2('0x1b')](_0x6e0015);}return null;};}function patchUpdates(_0x4648e4){return function(_0x51dac5){try{jsonpatch[_0xe7d2('0x1f')](_0x51dac5,_0x4648e4,!![]);}catch(_0x15d700){return BPromise['reject'](_0x15d700);}return _0x51dac5['save']();};}function saveUpdates(_0x3f5db1,_0x572cb4){return function(_0x1b1b82){if(_0x1b1b82){return _0x1b1b82['update'](_0x3f5db1)[_0xe7d2('0x20')](function(_0x34317e){return _0x34317e;});}return null;};}function removeEntity(_0x4e9b1b,_0x246483){return function(_0x38b2da){if(_0x38b2da){return _0x38b2da[_0xe7d2('0x21')]()[_0xe7d2('0x20')](function(){_0x4e9b1b['status'](0xcc)[_0xe7d2('0x22')]();});}};}function handleEntityNotFound(_0x5aa21b,_0x5c09bd){return function(_0x2e48a6){if(!_0x2e48a6){_0x5aa21b[_0xe7d2('0x19')](0x194);}return _0x2e48a6;};}function handleError(_0x18fb72,_0x27e0bb){_0x27e0bb=_0x27e0bb||0x1f4;return function(_0x3d4c59){logger['error'](_0x3d4c59[_0xe7d2('0x23')]);if(_0x3d4c59[_0xe7d2('0x24')]){delete _0x3d4c59[_0xe7d2('0x24')];}_0x18fb72[_0xe7d2('0x1a')](_0x27e0bb)[_0xe7d2('0x25')](_0x3d4c59);};}exports[_0xe7d2('0x26')]=function(_0x5305f3,_0x37b647){var _0x1837c9={},_0x30eea9={},_0x29b28b={'count':0x0,'rows':[]};var _0x5aca76=db[_0xe7d2('0x27')][_0xe7d2('0x28')];_0x30eea9['model']=_[_0xe7d2('0x29')](_0x5aca76);_0x30eea9[_0xe7d2('0x2a')]=_[_0xe7d2('0x29')](_0x5305f3[_0xe7d2('0x2a')]);_0x30eea9[_0xe7d2('0x2b')]=_['intersection'](_0x30eea9[_0xe7d2('0x2c')],_0x30eea9[_0xe7d2('0x2a')]);_0x1837c9['attributes']=_['intersection'](_0x30eea9[_0xe7d2('0x2c')],qs[_0xe7d2('0x2d')](_0x5305f3['query'][_0xe7d2('0x2d')]));_0x1837c9[_0xe7d2('0x2e')]=_0x1837c9[_0xe7d2('0x2e')]['length']?_0x1837c9['attributes']:_0x30eea9[_0xe7d2('0x2c')];if(!_0x5305f3[_0xe7d2('0x2a')][_0xe7d2('0x2f')]('nolimit')){_0x1837c9['limit']=qs[_0xe7d2('0x1d')](_0x5305f3['query']['limit']);_0x1837c9['offset']=qs[_0xe7d2('0x1c')](_0x5305f3['query'][_0xe7d2('0x1c')]);}_0x1837c9[_0xe7d2('0x30')]=qs[_0xe7d2('0x31')](_0x5305f3[_0xe7d2('0x2a')][_0xe7d2('0x31')]);_0x1837c9[_0xe7d2('0x32')]=qs[_0xe7d2('0x2b')](_['pick'](_0x5305f3[_0xe7d2('0x2a')],_0x30eea9[_0xe7d2('0x2b')]));if(_0x5305f3[_0xe7d2('0x2a')][_0xe7d2('0x33')]){_0x1837c9['where']=_['merge'](_0x1837c9[_0xe7d2('0x32')],{'$or':_[_0xe7d2('0x34')](_0x5aca76,function(_0x3bc581){if(_0x3bc581[_0xe7d2('0x35')][_0xe7d2('0x36')]!=='VIRTUAL'){var _0x5d822b={};_0x5d822b[_0x3bc581[_0xe7d2('0x37')]]={'$like':'%'+_0x5305f3[_0xe7d2('0x2a')][_0xe7d2('0x33')]+'%'};return _0x5d822b;}})});}_0x1837c9=_[_0xe7d2('0x38')]({},_0x1837c9,_0x5305f3['options']);var _0x42782f={'where':_0x1837c9[_0xe7d2('0x32')]};return db[_0xe7d2('0x27')]['count'](_0x42782f)[_0xe7d2('0x20')](function(_0x79f81e){_0x29b28b[_0xe7d2('0x39')]=_0x79f81e;if(_0x5305f3['query'][_0xe7d2('0x3a')]){_0x1837c9['include']=[{'all':!![]}];}return db[_0xe7d2('0x27')][_0xe7d2('0x3b')](_0x1837c9);})[_0xe7d2('0x20')](function(_0x32d042){_0x29b28b['rows']=_0x32d042;return _0x29b28b;})[_0xe7d2('0x20')](respondWithFilteredResult(_0x37b647,_0x1837c9))[_0xe7d2('0x3c')](handleError(_0x37b647,null));};exports[_0xe7d2('0x3d')]=function(_0x4e3866,_0x5e798d){var _0x3209b0={'raw':![],'where':{'id':_0x4e3866['params']['id']}},_0x8f31bc={};_0x8f31bc[_0xe7d2('0x2c')]=_[_0xe7d2('0x29')](db['SAOrder'][_0xe7d2('0x28')]);_0x8f31bc[_0xe7d2('0x2a')]=_[_0xe7d2('0x29')](_0x4e3866[_0xe7d2('0x2a')]);_0x8f31bc['filters']=_[_0xe7d2('0x3e')](_0x8f31bc[_0xe7d2('0x2c')],_0x8f31bc[_0xe7d2('0x2a')]);_0x3209b0[_0xe7d2('0x2e')]=_[_0xe7d2('0x3e')](_0x8f31bc['model'],qs[_0xe7d2('0x2d')](_0x4e3866['query'][_0xe7d2('0x2d')]));_0x3209b0[_0xe7d2('0x2e')]=_0x3209b0['attributes']['length']?_0x3209b0[_0xe7d2('0x2e')]:_0x8f31bc[_0xe7d2('0x2c')];if(_0x4e3866['query'][_0xe7d2('0x3a')]){_0x3209b0[_0xe7d2('0x3f')]=[{'all':!![]}];}_0x3209b0=_[_0xe7d2('0x38')]({},_0x3209b0,_0x4e3866[_0xe7d2('0x40')]);return db[_0xe7d2('0x27')][_0xe7d2('0x41')](_0x3209b0)['then'](handleEntityNotFound(_0x5e798d,null))[_0xe7d2('0x20')](respondWithResult(_0x5e798d,null))[_0xe7d2('0x3c')](handleError(_0x5e798d,null));};exports['create']=function(_0x55b085,_0x4850a3){return db[_0xe7d2('0x27')][_0xe7d2('0x42')](_0x55b085[_0xe7d2('0x43')],{})[_0xe7d2('0x20')](respondWithResult(_0x4850a3,0xc9))['catch'](handleError(_0x4850a3,null));};exports[_0xe7d2('0x44')]=function(_0x42e8ff,_0x5dfd07){if(_0x42e8ff[_0xe7d2('0x43')]['id']){delete _0x42e8ff['body']['id'];}return db[_0xe7d2('0x27')][_0xe7d2('0x41')]({'where':{'id':_0x42e8ff[_0xe7d2('0x45')]['id']}})[_0xe7d2('0x20')](handleEntityNotFound(_0x5dfd07,null))[_0xe7d2('0x20')](saveUpdates(_0x42e8ff[_0xe7d2('0x43')],null))[_0xe7d2('0x20')](respondWithResult(_0x5dfd07,null))[_0xe7d2('0x3c')](handleError(_0x5dfd07,null));};exports['destroy']=function(_0x3959c3,_0x53bee0){return db['SAOrder'][_0xe7d2('0x41')]({'where':{'id':_0x3959c3[_0xe7d2('0x45')]['id']}})[_0xe7d2('0x20')](handleEntityNotFound(_0x53bee0,null))[_0xe7d2('0x20')](removeEntity(_0x53bee0,null))['catch'](handleError(_0x53bee0,null));};exports[_0xe7d2('0x46')]=function(_0x5e6912,_0xe34dcd){return db['SAOrder']['describe']()[_0xe7d2('0x20')](respondWithResult(_0xe34dcd,null))[_0xe7d2('0x3c')](handleError(_0xe34dcd,null));}; \ No newline at end of file +var _0xdf79=['count','then','include','findAll','catch','show','includeAll','create','update','body','find','params','html-pdf','rimraf','zip-dir','request-promise','mustache','util','path','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','destroy','error','stack','name','send','rawAttributes','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','type','key','VIRTUAL','filter','SAOrder'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xdf79,0x19e));var _0x9df7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdf79[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x9df7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9df7('0x1'));var zipdir=require(_0x9df7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9df7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9df7('0x4'));var util=require(_0x9df7('0x5'));var path=require(_0x9df7('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9df7('0x7'));var fs=require('fs');var _=require(_0x9df7('0x8'));var squel=require('squel');var crypto=require(_0x9df7('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x9df7('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9df7('0xb'));var Redis=require(_0x9df7('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x9df7('0xd'));var hardwareService=require(_0x9df7('0xe'));var logger=require('../../config/logger')(_0x9df7('0xf'));var utils=require(_0x9df7('0x10'));var config=require(_0x9df7('0x11'));var db=require(_0x9df7('0x12'))['db'];function respondWithStatusCode(_0x20340d,_0x5a4892){_0x5a4892=_0x5a4892||0xcc;return function(_0x5d25df){if(_0x5d25df){return _0x20340d[_0x9df7('0x13')](_0x5a4892);}return _0x20340d[_0x9df7('0x14')](_0x5a4892)[_0x9df7('0x15')]();};}function respondWithResult(_0x2b546c,_0x5cb032){_0x5cb032=_0x5cb032||0xc8;return function(_0x591c61){if(_0x591c61){return _0x2b546c[_0x9df7('0x14')](_0x5cb032)[_0x9df7('0x16')](_0x591c61);}};}function respondWithFilteredResult(_0x4bc65c,_0x582482){return function(_0x557c60){if(_0x557c60){var _0x104b42=_0x557c60['count'],_0x2a4541=_0x582482[_0x9df7('0x17')],_0x55baab=_0x582482['offset']+_0x582482[_0x9df7('0x18')],_0x4a947c;if(_0x55baab>=_0x104b42){_0x55baab=_0x104b42;_0x4a947c=0xc8;}else{_0x4a947c=0xce;}_0x4bc65c[_0x9df7('0x14')](_0x4a947c);return _0x4bc65c[_0x9df7('0x19')](_0x9df7('0x1a'),_0x2a4541+'-'+_0x55baab+'/'+_0x104b42)[_0x9df7('0x16')](_0x557c60);}return null;};}function patchUpdates(_0x59697b){return function(_0x1cc684){try{jsonpatch[_0x9df7('0x1b')](_0x1cc684,_0x59697b,!![]);}catch(_0x6ad8ea){return BPromise[_0x9df7('0x1c')](_0x6ad8ea);}return _0x1cc684[_0x9df7('0x1d')]();};}function saveUpdates(_0x548bed,_0x59325a){return function(_0x43b055){if(_0x43b055){return _0x43b055['update'](_0x548bed)['then'](function(_0x1c7be2){return _0x1c7be2;});}return null;};}function removeEntity(_0x75e4df,_0xb1e425){return function(_0x96fbb2){if(_0x96fbb2){return _0x96fbb2[_0x9df7('0x1e')]()['then'](function(){_0x75e4df[_0x9df7('0x14')](0xcc)[_0x9df7('0x15')]();});}};}function handleEntityNotFound(_0x2affbc,_0x3e85da){return function(_0x3038dd){if(!_0x3038dd){_0x2affbc[_0x9df7('0x13')](0x194);}return _0x3038dd;};}function handleError(_0x204160,_0x4673fa){_0x4673fa=_0x4673fa||0x1f4;return function(_0x3b7052){logger[_0x9df7('0x1f')](_0x3b7052[_0x9df7('0x20')]);if(_0x3b7052['name']){delete _0x3b7052[_0x9df7('0x21')];}_0x204160[_0x9df7('0x14')](_0x4673fa)[_0x9df7('0x22')](_0x3b7052);};}exports['index']=function(_0x229d55,_0x4215bc){var _0x109085={},_0x522d02={},_0xb0ac10={'count':0x0,'rows':[]};var _0x2f790b=db['SAOrder'][_0x9df7('0x23')];_0x522d02[_0x9df7('0x24')]=_[_0x9df7('0x25')](_0x2f790b);_0x522d02[_0x9df7('0x26')]=_[_0x9df7('0x25')](_0x229d55[_0x9df7('0x26')]);_0x522d02['filters']=_['intersection'](_0x522d02[_0x9df7('0x24')],_0x522d02[_0x9df7('0x26')]);_0x109085['attributes']=_[_0x9df7('0x27')](_0x522d02[_0x9df7('0x24')],qs[_0x9df7('0x28')](_0x229d55[_0x9df7('0x26')][_0x9df7('0x28')]));_0x109085[_0x9df7('0x29')]=_0x109085['attributes'][_0x9df7('0x2a')]?_0x109085[_0x9df7('0x29')]:_0x522d02[_0x9df7('0x24')];if(!_0x229d55[_0x9df7('0x26')]['hasOwnProperty'](_0x9df7('0x2b'))){_0x109085[_0x9df7('0x18')]=qs[_0x9df7('0x18')](_0x229d55[_0x9df7('0x26')]['limit']);_0x109085[_0x9df7('0x17')]=qs[_0x9df7('0x17')](_0x229d55['query'][_0x9df7('0x17')]);}_0x109085[_0x9df7('0x2c')]=qs[_0x9df7('0x2d')](_0x229d55[_0x9df7('0x26')][_0x9df7('0x2d')]);_0x109085[_0x9df7('0x2e')]=qs[_0x9df7('0x2f')](_[_0x9df7('0x30')](_0x229d55[_0x9df7('0x26')],_0x522d02[_0x9df7('0x2f')]));if(_0x229d55['query']['filter']){_0x109085[_0x9df7('0x2e')]=_[_0x9df7('0x31')](_0x109085[_0x9df7('0x2e')],{'$or':_['map'](_0x2f790b,function(_0x5e4dd9){if(_0x5e4dd9[_0x9df7('0x32')][_0x9df7('0x33')]!==_0x9df7('0x34')){var _0x3421e6={};_0x3421e6[_0x5e4dd9['field']]={'$like':'%'+_0x229d55[_0x9df7('0x26')][_0x9df7('0x35')]+'%'};return _0x3421e6;}})});}_0x109085=_['merge']({},_0x109085,_0x229d55['options']);var _0x1dfc28={'where':_0x109085['where']};return db[_0x9df7('0x36')][_0x9df7('0x37')](_0x1dfc28)[_0x9df7('0x38')](function(_0x5e351e){_0xb0ac10[_0x9df7('0x37')]=_0x5e351e;if(_0x229d55['query']['includeAll']){_0x109085[_0x9df7('0x39')]=[{'all':!![]}];}return db[_0x9df7('0x36')][_0x9df7('0x3a')](_0x109085);})['then'](function(_0x3daa7f){_0xb0ac10['rows']=_0x3daa7f;return _0xb0ac10;})[_0x9df7('0x38')](respondWithFilteredResult(_0x4215bc,_0x109085))[_0x9df7('0x3b')](handleError(_0x4215bc,null));};exports[_0x9df7('0x3c')]=function(_0x52fd3,_0x2355a6){var _0x1ca815={'raw':![],'where':{'id':_0x52fd3['params']['id']}},_0x29ee11={};_0x29ee11['model']=_[_0x9df7('0x25')](db['SAOrder'][_0x9df7('0x23')]);_0x29ee11[_0x9df7('0x26')]=_[_0x9df7('0x25')](_0x52fd3['query']);_0x29ee11[_0x9df7('0x2f')]=_['intersection'](_0x29ee11[_0x9df7('0x24')],_0x29ee11[_0x9df7('0x26')]);_0x1ca815['attributes']=_['intersection'](_0x29ee11[_0x9df7('0x24')],qs[_0x9df7('0x28')](_0x52fd3[_0x9df7('0x26')][_0x9df7('0x28')]));_0x1ca815['attributes']=_0x1ca815[_0x9df7('0x29')][_0x9df7('0x2a')]?_0x1ca815['attributes']:_0x29ee11[_0x9df7('0x24')];if(_0x52fd3['query'][_0x9df7('0x3d')]){_0x1ca815[_0x9df7('0x39')]=[{'all':!![]}];}_0x1ca815=_[_0x9df7('0x31')]({},_0x1ca815,_0x52fd3['options']);return db[_0x9df7('0x36')]['find'](_0x1ca815)[_0x9df7('0x38')](handleEntityNotFound(_0x2355a6,null))['then'](respondWithResult(_0x2355a6,null))[_0x9df7('0x3b')](handleError(_0x2355a6,null));};exports[_0x9df7('0x3e')]=function(_0x506f20,_0x3f2bbe){return db['SAOrder']['create'](_0x506f20['body'],{})[_0x9df7('0x38')](respondWithResult(_0x3f2bbe,0xc9))['catch'](handleError(_0x3f2bbe,null));};exports[_0x9df7('0x3f')]=function(_0x20151d,_0x295505){if(_0x20151d[_0x9df7('0x40')]['id']){delete _0x20151d[_0x9df7('0x40')]['id'];}return db[_0x9df7('0x36')][_0x9df7('0x41')]({'where':{'id':_0x20151d['params']['id']}})[_0x9df7('0x38')](handleEntityNotFound(_0x295505,null))[_0x9df7('0x38')](saveUpdates(_0x20151d[_0x9df7('0x40')],null))['then'](respondWithResult(_0x295505,null))[_0x9df7('0x3b')](handleError(_0x295505,null));};exports[_0x9df7('0x1e')]=function(_0x566477,_0x40fd1b){return db[_0x9df7('0x36')][_0x9df7('0x41')]({'where':{'id':_0x566477[_0x9df7('0x42')]['id']}})['then'](handleEntityNotFound(_0x40fd1b,null))[_0x9df7('0x38')](removeEntity(_0x40fd1b,null))[_0x9df7('0x3b')](handleError(_0x40fd1b,null));};exports['describe']=function(_0x36402e,_0x2b372b){return db[_0x9df7('0x36')]['describe']()[_0x9df7('0x38')](respondWithResult(_0x2b372b,null))[_0x9df7('0x3b')](handleError(_0x2b372b,null));}; \ No newline at end of file diff --git a/server/api/saOrder/saOrder.model.js b/server/api/saOrder/saOrder.model.js index e03193d..1dcf990 100644 --- a/server/api/saOrder/saOrder.model.js +++ b/server/api/saOrder/saOrder.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8685=['bluebird','request-promise','path','../../config/environment','./saOrder.attributes','SAOrder','lodash','util','../../config/logger'];(function(_0x156af1,_0xc47f08){var _0x5961a5=function(_0x896800){while(--_0x896800){_0x156af1['push'](_0x156af1['shift']());}};_0x5961a5(++_0xc47f08);}(_0x8685,0x114));var _0x5868=function(_0x4b2f9c,_0x22b452){_0x4b2f9c=_0x4b2f9c-0x0;var _0x9f29aa=_0x8685[_0x4b2f9c];return _0x9f29aa;};'use strict';var _=require(_0x5868('0x0'));var util=require(_0x5868('0x1'));var logger=require(_0x5868('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5868('0x3'));var rp=require(_0x5868('0x4'));var fs=require('fs');var path=require(_0x5868('0x5'));var rimraf=require('rimraf');var config=require(_0x5868('0x6'));var attributes=require(_0x5868('0x7'));module['exports']=function(_0x22c9e6,_0x2995f1){return _0x22c9e6['define'](_0x5868('0x8'),attributes,{'tableName':'sa_orders','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa28d=['sa_orders','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./saOrder.attributes','exports','SAOrder'];(function(_0x5756c6,_0x58290a){var _0x4b5806=function(_0x193246){while(--_0x193246){_0x5756c6['push'](_0x5756c6['shift']());}};_0x4b5806(++_0x58290a);}(_0xa28d,0xf1));var _0xda28=function(_0x4ee90f,_0x2e689c){_0x4ee90f=_0x4ee90f-0x0;var _0x55a845=_0xa28d[_0x4ee90f];return _0x55a845;};'use strict';var _=require('lodash');var util=require(_0xda28('0x0'));var logger=require(_0xda28('0x1'))(_0xda28('0x2'));var moment=require('moment');var BPromise=require(_0xda28('0x3'));var rp=require(_0xda28('0x4'));var fs=require('fs');var path=require(_0xda28('0x5'));var rimraf=require(_0xda28('0x6'));var config=require(_0xda28('0x7'));var attributes=require(_0xda28('0x8'));module[_0xda28('0x9')]=function(_0x15fa19,_0x2fcbb0){return _0x15fa19['define'](_0xda28('0xa'),attributes,{'tableName':_0xda28('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saOrder/saOrder.rpc.js b/server/api/saOrder/saOrder.rpc.js index 14e71a8..a0d2d3e 100644 --- a/server/api/saOrder/saOrder.rpc.js +++ b/server/api/saOrder/saOrder.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x60c5=['../../config/environment','jayson/promise','client','then','info','request\x20sent','SAOrder,\x20%s,\x20%s,\x20%s','error','code','message','SAOrder,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x37ee81,_0x1d9d27){var _0x5bf04f=function(_0x3f9767){while(--_0x3f9767){_0x37ee81['push'](_0x37ee81['shift']());}};_0x5bf04f(++_0x1d9d27);}(_0x60c5,0x91));var _0x560c=function(_0x1b1d86,_0x31caaa){_0x1b1d86=_0x1b1d86-0x0;var _0x1d1b39=_0x60c5[_0x1b1d86];return _0x1d1b39;};'use strict';var _=require(_0x560c('0x0'));var util=require(_0x560c('0x1'));var moment=require(_0x560c('0x2'));var BPromise=require(_0x560c('0x3'));var rs=require(_0x560c('0x4'));var fs=require('fs');var Redis=require(_0x560c('0x5'));var db=require(_0x560c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x560c('0x7'))(_0x560c('0x8'));var config=require(_0x560c('0x9'));var jayson=require(_0x560c('0xa'));var client=jayson[_0x560c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30bfaa,_0x18fc61,_0x29c1f5){return new BPromise(function(_0x5ee8e5,_0x4872b6){return client['request'](_0x30bfaa,_0x29c1f5)[_0x560c('0xc')](function(_0x108775){logger[_0x560c('0xd')]('SAOrder,\x20%s,\x20%s',_0x18fc61,_0x560c('0xe'));logger['debug'](_0x560c('0xf'),_0x18fc61,'request\x20sent',JSON['stringify'](_0x108775));if(_0x108775[_0x560c('0x10')]){if(_0x108775[_0x560c('0x10')][_0x560c('0x11')]===0x1f4){logger[_0x560c('0x10')]('SAOrder,\x20%s,\x20%s',_0x18fc61,_0x108775[_0x560c('0x10')][_0x560c('0x12')]);return _0x4872b6(_0x108775[_0x560c('0x10')][_0x560c('0x12')]);}logger[_0x560c('0x10')](_0x560c('0x13'),_0x18fc61,_0x108775[_0x560c('0x10')]['message']);return _0x5ee8e5(_0x108775[_0x560c('0x10')][_0x560c('0x12')]);}else{logger['info']('SAOrder,\x20%s,\x20%s',_0x18fc61,_0x560c('0xe'));_0x5ee8e5(_0x108775[_0x560c('0x14')][_0x560c('0x12')]);}})[_0x560c('0x15')](function(_0x4e8bf1){logger[_0x560c('0x10')]('SAOrder,\x20%s,\x20%s',_0x18fc61,_0x4e8bf1);_0x4872b6(_0x4e8bf1);});});} \ No newline at end of file +var _0xe2e9=['SAOrder,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','info','SAOrder,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4c53ed,_0x398530){var _0x4a4606=function(_0xeec283){while(--_0xeec283){_0x4c53ed['push'](_0x4c53ed['shift']());}};_0x4a4606(++_0x398530);}(_0xe2e9,0x1d9));var _0x9e2e=function(_0x27403a,_0x3cfa40){_0x27403a=_0x27403a-0x0;var _0x1de9eb=_0xe2e9[_0x27403a];return _0x1de9eb;};'use strict';var _=require('lodash');var util=require(_0x9e2e('0x0'));var moment=require(_0x9e2e('0x1'));var BPromise=require(_0x9e2e('0x2'));var rs=require(_0x9e2e('0x3'));var fs=require('fs');var Redis=require(_0x9e2e('0x4'));var db=require(_0x9e2e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9e2e('0x6'));var config=require('../../config/environment');var jayson=require(_0x9e2e('0x7'));var client=jayson['client'][_0x9e2e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x402968,_0x4c14a1,_0x5adfd4){return new BPromise(function(_0x27e7f6,_0x57ebef){return client['request'](_0x402968,_0x5adfd4)['then'](function(_0x166ed5){logger[_0x9e2e('0x9')](_0x9e2e('0xa'),_0x4c14a1,_0x9e2e('0xb'));logger[_0x9e2e('0xc')](_0x9e2e('0xd'),_0x4c14a1,_0x9e2e('0xb'),JSON[_0x9e2e('0xe')](_0x166ed5));if(_0x166ed5['error']){if(_0x166ed5[_0x9e2e('0xf')]['code']===0x1f4){logger[_0x9e2e('0xf')]('SAOrder,\x20%s,\x20%s',_0x4c14a1,_0x166ed5['error'][_0x9e2e('0x10')]);return _0x57ebef(_0x166ed5[_0x9e2e('0xf')][_0x9e2e('0x10')]);}logger[_0x9e2e('0xf')](_0x9e2e('0xa'),_0x4c14a1,_0x166ed5['error'][_0x9e2e('0x10')]);return _0x27e7f6(_0x166ed5[_0x9e2e('0xf')][_0x9e2e('0x10')]);}else{logger[_0x9e2e('0x9')]('SAOrder,\x20%s,\x20%s',_0x4c14a1,_0x9e2e('0xb'));_0x27e7f6(_0x166ed5[_0x9e2e('0x11')][_0x9e2e('0x10')]);}})['catch'](function(_0x37db13){logger[_0x9e2e('0xf')](_0x9e2e('0xa'),_0x4c14a1,_0x37db13);_0x57ebef(_0x37db13);});});} \ No newline at end of file diff --git a/server/api/saPayment/index.js b/server/api/saPayment/index.js index a9ac1e0..a34b5d4 100644 --- a/server/api/saPayment/index.js +++ b/server/api/saPayment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x032e=['exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./saPayment.controller','get','isAuthenticated','index','describe','/:id','show','create','put'];(function(_0x23634b,_0x29caca){var _0x46d99d=function(_0x36f470){while(--_0x36f470){_0x23634b['push'](_0x23634b['shift']());}};_0x46d99d(++_0x29caca);}(_0x032e,0x1cc));var _0xe032=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x032e[_0x5bd426];return _0x23a7eb;};'use strict';var multer=require('multer');var util=require(_0xe032('0x0'));var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require(_0xe032('0x3'));var router=express[_0xe032('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')]('/',auth[_0xe032('0x9')](),controller[_0xe032('0xa')]);router[_0xe032('0x8')]('/describe',auth[_0xe032('0x9')](),controller[_0xe032('0xb')]);router[_0xe032('0x8')](_0xe032('0xc'),auth[_0xe032('0x9')](),controller[_0xe032('0xd')]);router['post']('/',auth[_0xe032('0x9')](),controller[_0xe032('0xe')]);router[_0xe032('0xf')]('/:id',auth[_0xe032('0x9')](),controller['update']);router['delete']('/:id',auth[_0xe032('0x9')](),controller['destroy']);module[_0xe032('0x10')]=router; \ No newline at end of file +var _0x1173=['post','create','/:id','update','delete','destroy','util','path','Router','../../components/auth/service','../../components/interaction/service','./saPayment.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x1173,0x138));var _0x3117=function(_0x1d4297,_0x3cf1f9){_0x1d4297=_0x1d4297-0x0;var _0x3ba0c9=_0x1173[_0x1d4297];return _0x3ba0c9;};'use strict';var multer=require('multer');var util=require(_0x3117('0x0'));var path=require(_0x3117('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3117('0x2')]();var auth=require(_0x3117('0x3'));var interaction=require(_0x3117('0x4'));var config=require('../../config/environment');var controller=require(_0x3117('0x5'));router[_0x3117('0x6')]('/',auth[_0x3117('0x7')](),controller[_0x3117('0x8')]);router[_0x3117('0x6')](_0x3117('0x9'),auth[_0x3117('0x7')](),controller[_0x3117('0xa')]);router[_0x3117('0x6')]('/:id',auth[_0x3117('0x7')](),controller[_0x3117('0xb')]);router[_0x3117('0xc')]('/',auth[_0x3117('0x7')](),controller[_0x3117('0xd')]);router['put'](_0x3117('0xe'),auth[_0x3117('0x7')](),controller[_0x3117('0xf')]);router[_0x3117('0x10')](_0x3117('0xe'),auth[_0x3117('0x7')](),controller[_0x3117('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/saPayment/saPayment.attributes.js b/server/api/saPayment/saPayment.attributes.js index f4fec86..9e470a7 100644 --- a/server/api/saPayment/saPayment.attributes.js +++ b/server/api/saPayment/saPayment.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ed9=['INTEGER','STRING','DATE','sequelize','exports','DECIMAL','TEXT'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1ed9,0xe3));var _0x91ed=function(_0x423e56,_0x58fdd3){_0x423e56=_0x423e56-0x0;var _0x54154a=_0x1ed9[_0x423e56];return _0x54154a;};'use strict';var Sequelize=require(_0x91ed('0x0'));module[_0x91ed('0x1')]={'payment':{'type':Sequelize[_0x91ed('0x2')](0xd,0x4),'allowNull':![]},'note':{'type':Sequelize[_0x91ed('0x3')]},'companyId':{'type':Sequelize[_0x91ed('0x4')]},'companyName':{'type':Sequelize['TEXT']},'paymentMethod':{'type':Sequelize[_0x91ed('0x3')]},'agentFullname':{'type':Sequelize[_0x91ed('0x5')]},'paymentDate':{'type':Sequelize[_0x91ed('0x6')]}}; \ No newline at end of file +var _0x91b6=['sequelize','exports','TEXT','DATE'];(function(_0xe23db4,_0x125dd5){var _0x3906c2=function(_0x52dea2){while(--_0x52dea2){_0xe23db4['push'](_0xe23db4['shift']());}};_0x3906c2(++_0x125dd5);}(_0x91b6,0x1d4));var _0x691b=function(_0x51156d,_0xe9e50){_0x51156d=_0x51156d-0x0;var _0x598764=_0x91b6[_0x51156d];return _0x598764;};'use strict';var Sequelize=require(_0x691b('0x0'));module[_0x691b('0x1')]={'payment':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'note':{'type':Sequelize[_0x691b('0x2')]},'companyId':{'type':Sequelize['INTEGER']},'companyName':{'type':Sequelize['TEXT']},'paymentMethod':{'type':Sequelize[_0x691b('0x2')]},'agentFullname':{'type':Sequelize['STRING']},'paymentDate':{'type':Sequelize[_0x691b('0x3')]}}; \ No newline at end of file diff --git a/server/api/saPayment/saPayment.controller.js b/server/api/saPayment/saPayment.controller.js index 9b3a069..4d7ebc6 100644 --- a/server/api/saPayment/saPayment.controller.js +++ b/server/api/saPayment/saPayment.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd2c=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','sort','pick','filter','where','merge','type','key','VIRTUAL','field','include','findAll','rows','includeAll','options','find','create','body','catch','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','limit','status','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','SAPayment','rawAttributes','model','keys'];(function(_0x177e5f,_0x37e620){var _0x37c389=function(_0x5215fb){while(--_0x5215fb){_0x177e5f['push'](_0x177e5f['shift']());}};_0x37c389(++_0x37e620);}(_0xbd2c,0x18f));var _0xcbd2=function(_0x3a2e8c,_0x149a71){_0x3a2e8c=_0x3a2e8c-0x0;var _0x4e199d=_0xbd2c[_0x3a2e8c];return _0x4e199d;};'use strict';var pdf=require(_0xcbd2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcbd2('0x1'));var zipdir=require(_0xcbd2('0x2'));var jsonpatch=require(_0xcbd2('0x3'));var rp=require(_0xcbd2('0x4'));var moment=require('moment');var BPromise=require(_0xcbd2('0x5'));var Mustache=require(_0xcbd2('0x6'));var util=require(_0xcbd2('0x7'));var path=require(_0xcbd2('0x8'));var sox=require(_0xcbd2('0x9'));var csv=require(_0xcbd2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xcbd2('0xb'));var crypto=require(_0xcbd2('0xc'));var jsforce=require(_0xcbd2('0xd'));var deskjs=require(_0xcbd2('0xe'));var toCsv=require(_0xcbd2('0xa'));var querystring=require(_0xcbd2('0xf'));var Papa=require('papaparse');var Redis=require(_0xcbd2('0x10'));var authService=require(_0xcbd2('0x11'));var qs=require(_0xcbd2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbd2('0x13'))(_0xcbd2('0x14'));var utils=require(_0xcbd2('0x15'));var config=require(_0xcbd2('0x16'));var db=require(_0xcbd2('0x17'))['db'];function respondWithStatusCode(_0x5f4e8c,_0x4f74db){_0x4f74db=_0x4f74db||0xcc;return function(_0x18e6dd){if(_0x18e6dd){return _0x5f4e8c[_0xcbd2('0x18')](_0x4f74db);}return _0x5f4e8c['status'](_0x4f74db)[_0xcbd2('0x19')]();};}function respondWithResult(_0x5baff7,_0x25e8f9){_0x25e8f9=_0x25e8f9||0xc8;return function(_0x1bfe03){if(_0x1bfe03){return _0x5baff7['status'](_0x25e8f9)[_0xcbd2('0x1a')](_0x1bfe03);}};}function respondWithFilteredResult(_0x3c11f9,_0x27ac16){return function(_0x3502d0){if(_0x3502d0){var _0xbbea77=_0x3502d0[_0xcbd2('0x1b')],_0x92e2a2=_0x27ac16['offset'],_0x2fd3dc=_0x27ac16['offset']+_0x27ac16[_0xcbd2('0x1c')],_0x59f78d;if(_0x2fd3dc>=_0xbbea77){_0x2fd3dc=_0xbbea77;_0x59f78d=0xc8;}else{_0x59f78d=0xce;}_0x3c11f9[_0xcbd2('0x1d')](_0x59f78d);return _0x3c11f9[_0xcbd2('0x1e')](_0xcbd2('0x1f'),_0x92e2a2+'-'+_0x2fd3dc+'/'+_0xbbea77)[_0xcbd2('0x1a')](_0x3502d0);}return null;};}function patchUpdates(_0x57b619){return function(_0x468ed4){try{jsonpatch['apply'](_0x468ed4,_0x57b619,!![]);}catch(_0x275337){return BPromise[_0xcbd2('0x20')](_0x275337);}return _0x468ed4['save']();};}function saveUpdates(_0x1c1be9,_0x921afd){return function(_0x2aa76a){if(_0x2aa76a){return _0x2aa76a[_0xcbd2('0x21')](_0x1c1be9)[_0xcbd2('0x22')](function(_0x1b286a){return _0x1b286a;});}return null;};}function removeEntity(_0x3fdbcb,_0x48f1e0){return function(_0x25dece){if(_0x25dece){return _0x25dece[_0xcbd2('0x23')]()[_0xcbd2('0x22')](function(){_0x3fdbcb[_0xcbd2('0x1d')](0xcc)[_0xcbd2('0x19')]();});}};}function handleEntityNotFound(_0x1d4380,_0x4c5b56){return function(_0x12cbc6){if(!_0x12cbc6){_0x1d4380['sendStatus'](0x194);}return _0x12cbc6;};}function handleError(_0x4bd150,_0x8e6c4a){_0x8e6c4a=_0x8e6c4a||0x1f4;return function(_0x239bc3){logger[_0xcbd2('0x24')](_0x239bc3[_0xcbd2('0x25')]);if(_0x239bc3[_0xcbd2('0x26')]){delete _0x239bc3[_0xcbd2('0x26')];}_0x4bd150['status'](_0x8e6c4a)[_0xcbd2('0x27')](_0x239bc3);};}exports[_0xcbd2('0x28')]=function(_0x26ad3c,_0x194122){var _0x12ce90={},_0x2bf51c={},_0x3b9c3d={'count':0x0,'rows':[]};var _0xb296c6=db[_0xcbd2('0x29')][_0xcbd2('0x2a')];_0x2bf51c[_0xcbd2('0x2b')]=_[_0xcbd2('0x2c')](_0xb296c6);_0x2bf51c[_0xcbd2('0x2d')]=_[_0xcbd2('0x2c')](_0x26ad3c[_0xcbd2('0x2d')]);_0x2bf51c[_0xcbd2('0x2e')]=_[_0xcbd2('0x2f')](_0x2bf51c['model'],_0x2bf51c[_0xcbd2('0x2d')]);_0x12ce90['attributes']=_[_0xcbd2('0x2f')](_0x2bf51c[_0xcbd2('0x2b')],qs[_0xcbd2('0x30')](_0x26ad3c[_0xcbd2('0x2d')][_0xcbd2('0x30')]));_0x12ce90['attributes']=_0x12ce90[_0xcbd2('0x31')][_0xcbd2('0x32')]?_0x12ce90[_0xcbd2('0x31')]:_0x2bf51c[_0xcbd2('0x2b')];if(!_0x26ad3c['query'][_0xcbd2('0x33')](_0xcbd2('0x34'))){_0x12ce90[_0xcbd2('0x1c')]=qs[_0xcbd2('0x1c')](_0x26ad3c['query'][_0xcbd2('0x1c')]);_0x12ce90[_0xcbd2('0x35')]=qs[_0xcbd2('0x35')](_0x26ad3c[_0xcbd2('0x2d')]['offset']);}_0x12ce90['order']=qs[_0xcbd2('0x36')](_0x26ad3c[_0xcbd2('0x2d')][_0xcbd2('0x36')]);_0x12ce90['where']=qs[_0xcbd2('0x2e')](_[_0xcbd2('0x37')](_0x26ad3c['query'],_0x2bf51c[_0xcbd2('0x2e')]));if(_0x26ad3c[_0xcbd2('0x2d')][_0xcbd2('0x38')]){_0x12ce90[_0xcbd2('0x39')]=_[_0xcbd2('0x3a')](_0x12ce90['where'],{'$or':_['map'](_0xb296c6,function(_0x3de9af){if(_0x3de9af[_0xcbd2('0x3b')][_0xcbd2('0x3c')]!==_0xcbd2('0x3d')){var _0x5b970d={};_0x5b970d[_0x3de9af[_0xcbd2('0x3e')]]={'$like':'%'+_0x26ad3c[_0xcbd2('0x2d')][_0xcbd2('0x38')]+'%'};return _0x5b970d;}})});}_0x12ce90=_['merge']({},_0x12ce90,_0x26ad3c['options']);var _0x406434={'where':_0x12ce90[_0xcbd2('0x39')]};return db['SAPayment']['count'](_0x406434)['then'](function(_0x50e34b){_0x3b9c3d[_0xcbd2('0x1b')]=_0x50e34b;if(_0x26ad3c[_0xcbd2('0x2d')]['includeAll']){_0x12ce90[_0xcbd2('0x3f')]=[{'all':!![]}];}return db['SAPayment'][_0xcbd2('0x40')](_0x12ce90);})[_0xcbd2('0x22')](function(_0x14267f){_0x3b9c3d[_0xcbd2('0x41')]=_0x14267f;return _0x3b9c3d;})['then'](respondWithFilteredResult(_0x194122,_0x12ce90))['catch'](handleError(_0x194122,null));};exports['show']=function(_0x4f2140,_0x186529){var _0x733e21={'raw':![],'where':{'id':_0x4f2140['params']['id']}},_0x520a9c={};_0x520a9c[_0xcbd2('0x2b')]=_['keys'](db['SAPayment']['rawAttributes']);_0x520a9c['query']=_[_0xcbd2('0x2c')](_0x4f2140[_0xcbd2('0x2d')]);_0x520a9c[_0xcbd2('0x2e')]=_[_0xcbd2('0x2f')](_0x520a9c[_0xcbd2('0x2b')],_0x520a9c[_0xcbd2('0x2d')]);_0x733e21[_0xcbd2('0x31')]=_['intersection'](_0x520a9c[_0xcbd2('0x2b')],qs[_0xcbd2('0x30')](_0x4f2140[_0xcbd2('0x2d')][_0xcbd2('0x30')]));_0x733e21[_0xcbd2('0x31')]=_0x733e21[_0xcbd2('0x31')][_0xcbd2('0x32')]?_0x733e21[_0xcbd2('0x31')]:_0x520a9c['model'];if(_0x4f2140['query'][_0xcbd2('0x42')]){_0x733e21['include']=[{'all':!![]}];}_0x733e21=_['merge']({},_0x733e21,_0x4f2140[_0xcbd2('0x43')]);return db['SAPayment'][_0xcbd2('0x44')](_0x733e21)[_0xcbd2('0x22')](handleEntityNotFound(_0x186529,null))[_0xcbd2('0x22')](respondWithResult(_0x186529,null))['catch'](handleError(_0x186529,null));};exports[_0xcbd2('0x45')]=function(_0x10018d,_0x185307){return db['SAPayment']['create'](_0x10018d[_0xcbd2('0x46')],{})['then'](respondWithResult(_0x185307,0xc9))[_0xcbd2('0x47')](handleError(_0x185307,null));};exports['update']=function(_0x2f024e,_0x2e780c){if(_0x2f024e['body']['id']){delete _0x2f024e[_0xcbd2('0x46')]['id'];}return db[_0xcbd2('0x29')][_0xcbd2('0x44')]({'where':{'id':_0x2f024e[_0xcbd2('0x48')]['id']}})['then'](handleEntityNotFound(_0x2e780c,null))[_0xcbd2('0x22')](saveUpdates(_0x2f024e[_0xcbd2('0x46')],null))[_0xcbd2('0x22')](respondWithResult(_0x2e780c,null))[_0xcbd2('0x47')](handleError(_0x2e780c,null));};exports['destroy']=function(_0x41e8c6,_0x3e3d2c){return db[_0xcbd2('0x29')][_0xcbd2('0x44')]({'where':{'id':_0x41e8c6[_0xcbd2('0x48')]['id']}})[_0xcbd2('0x22')](handleEntityNotFound(_0x3e3d2c,null))['then'](removeEntity(_0x3e3d2c,null))['catch'](handleError(_0x3e3d2c,null));};exports[_0xcbd2('0x49')]=function(_0x34e98a,_0x4d7289){return db['SAPayment'][_0xcbd2('0x49')]()['then'](respondWithResult(_0x4d7289,null))[_0xcbd2('0x47')](handleError(_0x4d7289,null));}; \ No newline at end of file +var _0x93ae=['merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','show','catch','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','SAPayment','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter'];(function(_0x18e014,_0x593ba7){var _0x858ce3=function(_0x4eebc0){while(--_0x4eebc0){_0x18e014['push'](_0x18e014['shift']());}};_0x858ce3(++_0x593ba7);}(_0x93ae,0xf3));var _0xe93a=function(_0x3be487,_0x2e0af1){_0x3be487=_0x3be487-0x0;var _0x4717f2=_0x93ae[_0x3be487];return _0x4717f2;};'use strict';var pdf=require(_0xe93a('0x0'));var emlformat=require(_0xe93a('0x1'));var rimraf=require(_0xe93a('0x2'));var zipdir=require(_0xe93a('0x3'));var jsonpatch=require(_0xe93a('0x4'));var rp=require(_0xe93a('0x5'));var moment=require(_0xe93a('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xe93a('0x7'));var util=require(_0xe93a('0x8'));var path=require(_0xe93a('0x9'));var sox=require(_0xe93a('0xa'));var csv=require('to-csv');var ejs=require(_0xe93a('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe93a('0xc'));var crypto=require('crypto');var jsforce=require(_0xe93a('0xd'));var deskjs=require(_0xe93a('0xe'));var toCsv=require(_0xe93a('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe93a('0x10'));var authService=require(_0xe93a('0x11'));var qs=require(_0xe93a('0x12'));var hardwareService=require(_0xe93a('0x13'));var logger=require(_0xe93a('0x14'))(_0xe93a('0x15'));var utils=require(_0xe93a('0x16'));var config=require(_0xe93a('0x17'));var db=require(_0xe93a('0x18'))['db'];function respondWithStatusCode(_0x7cd790,_0x5ba5fa){_0x5ba5fa=_0x5ba5fa||0xcc;return function(_0x26768c){if(_0x26768c){return _0x7cd790['sendStatus'](_0x5ba5fa);}return _0x7cd790[_0xe93a('0x19')](_0x5ba5fa)[_0xe93a('0x1a')]();};}function respondWithResult(_0x10c439,_0x195644){_0x195644=_0x195644||0xc8;return function(_0x3f5093){if(_0x3f5093){return _0x10c439['status'](_0x195644)[_0xe93a('0x1b')](_0x3f5093);}};}function respondWithFilteredResult(_0x19bf6b,_0x2b577b){return function(_0x178c1d){if(_0x178c1d){var _0x323edf=_0x178c1d['count'],_0x13a1e5=_0x2b577b['offset'],_0x1a5f08=_0x2b577b[_0xe93a('0x1c')]+_0x2b577b[_0xe93a('0x1d')],_0x21916a;if(_0x1a5f08>=_0x323edf){_0x1a5f08=_0x323edf;_0x21916a=0xc8;}else{_0x21916a=0xce;}_0x19bf6b[_0xe93a('0x19')](_0x21916a);return _0x19bf6b[_0xe93a('0x1e')](_0xe93a('0x1f'),_0x13a1e5+'-'+_0x1a5f08+'/'+_0x323edf)[_0xe93a('0x1b')](_0x178c1d);}return null;};}function patchUpdates(_0x4bba17){return function(_0x416e5e){try{jsonpatch[_0xe93a('0x20')](_0x416e5e,_0x4bba17,!![]);}catch(_0x29ec31){return BPromise[_0xe93a('0x21')](_0x29ec31);}return _0x416e5e[_0xe93a('0x22')]();};}function saveUpdates(_0xfabfd7,_0x879211){return function(_0x4c4810){if(_0x4c4810){return _0x4c4810['update'](_0xfabfd7)[_0xe93a('0x23')](function(_0x30a898){return _0x30a898;});}return null;};}function removeEntity(_0xe9045b,_0x5b5194){return function(_0x4e8fdf){if(_0x4e8fdf){return _0x4e8fdf[_0xe93a('0x24')]()[_0xe93a('0x23')](function(){_0xe9045b[_0xe93a('0x19')](0xcc)[_0xe93a('0x1a')]();});}};}function handleEntityNotFound(_0x496cf9,_0x3eb03c){return function(_0x4152dc){if(!_0x4152dc){_0x496cf9[_0xe93a('0x25')](0x194);}return _0x4152dc;};}function handleError(_0x190973,_0x353605){_0x353605=_0x353605||0x1f4;return function(_0x1a2f05){logger[_0xe93a('0x26')](_0x1a2f05[_0xe93a('0x27')]);if(_0x1a2f05['name']){delete _0x1a2f05[_0xe93a('0x28')];}_0x190973[_0xe93a('0x19')](_0x353605)[_0xe93a('0x29')](_0x1a2f05);};}exports[_0xe93a('0x2a')]=function(_0x17f799,_0x411977){var _0x31cc62={},_0x39e3bb={},_0x540a8f={'count':0x0,'rows':[]};var _0x26d80e=db[_0xe93a('0x2b')]['rawAttributes'];_0x39e3bb[_0xe93a('0x2c')]=_[_0xe93a('0x2d')](_0x26d80e);_0x39e3bb[_0xe93a('0x2e')]=_[_0xe93a('0x2d')](_0x17f799[_0xe93a('0x2e')]);_0x39e3bb[_0xe93a('0x2f')]=_[_0xe93a('0x30')](_0x39e3bb['model'],_0x39e3bb['query']);_0x31cc62['attributes']=_[_0xe93a('0x30')](_0x39e3bb[_0xe93a('0x2c')],qs['fields'](_0x17f799['query'][_0xe93a('0x31')]));_0x31cc62[_0xe93a('0x32')]=_0x31cc62[_0xe93a('0x32')][_0xe93a('0x33')]?_0x31cc62['attributes']:_0x39e3bb[_0xe93a('0x2c')];if(!_0x17f799['query'][_0xe93a('0x34')](_0xe93a('0x35'))){_0x31cc62['limit']=qs['limit'](_0x17f799['query'][_0xe93a('0x1d')]);_0x31cc62[_0xe93a('0x1c')]=qs[_0xe93a('0x1c')](_0x17f799[_0xe93a('0x2e')][_0xe93a('0x1c')]);}_0x31cc62['order']=qs[_0xe93a('0x36')](_0x17f799['query'][_0xe93a('0x36')]);_0x31cc62[_0xe93a('0x37')]=qs['filters'](_['pick'](_0x17f799[_0xe93a('0x2e')],_0x39e3bb[_0xe93a('0x2f')]));if(_0x17f799[_0xe93a('0x2e')][_0xe93a('0x38')]){_0x31cc62[_0xe93a('0x37')]=_[_0xe93a('0x39')](_0x31cc62[_0xe93a('0x37')],{'$or':_[_0xe93a('0x3a')](_0x26d80e,function(_0x3e2b6b){if(_0x3e2b6b[_0xe93a('0x3b')][_0xe93a('0x3c')]!==_0xe93a('0x3d')){var _0x2de9fb={};_0x2de9fb[_0x3e2b6b[_0xe93a('0x3e')]]={'$like':'%'+_0x17f799[_0xe93a('0x2e')]['filter']+'%'};return _0x2de9fb;}})});}_0x31cc62=_[_0xe93a('0x39')]({},_0x31cc62,_0x17f799[_0xe93a('0x3f')]);var _0x195dbc={'where':_0x31cc62[_0xe93a('0x37')]};return db[_0xe93a('0x2b')][_0xe93a('0x40')](_0x195dbc)['then'](function(_0x17535c){_0x540a8f[_0xe93a('0x40')]=_0x17535c;if(_0x17f799['query'][_0xe93a('0x41')]){_0x31cc62[_0xe93a('0x42')]=[{'all':!![]}];}return db[_0xe93a('0x2b')][_0xe93a('0x43')](_0x31cc62);})[_0xe93a('0x23')](function(_0x36c9e5){_0x540a8f[_0xe93a('0x44')]=_0x36c9e5;return _0x540a8f;})[_0xe93a('0x23')](respondWithFilteredResult(_0x411977,_0x31cc62))['catch'](handleError(_0x411977,null));};exports[_0xe93a('0x45')]=function(_0x5080fc,_0x21da0d){var _0x1b3dab={'raw':![],'where':{'id':_0x5080fc['params']['id']}},_0x555010={};_0x555010[_0xe93a('0x2c')]=_['keys'](db['SAPayment']['rawAttributes']);_0x555010[_0xe93a('0x2e')]=_[_0xe93a('0x2d')](_0x5080fc[_0xe93a('0x2e')]);_0x555010[_0xe93a('0x2f')]=_[_0xe93a('0x30')](_0x555010[_0xe93a('0x2c')],_0x555010['query']);_0x1b3dab[_0xe93a('0x32')]=_[_0xe93a('0x30')](_0x555010[_0xe93a('0x2c')],qs[_0xe93a('0x31')](_0x5080fc['query'][_0xe93a('0x31')]));_0x1b3dab[_0xe93a('0x32')]=_0x1b3dab['attributes'][_0xe93a('0x33')]?_0x1b3dab[_0xe93a('0x32')]:_0x555010[_0xe93a('0x2c')];if(_0x5080fc['query']['includeAll']){_0x1b3dab[_0xe93a('0x42')]=[{'all':!![]}];}_0x1b3dab=_[_0xe93a('0x39')]({},_0x1b3dab,_0x5080fc[_0xe93a('0x3f')]);return db[_0xe93a('0x2b')]['find'](_0x1b3dab)[_0xe93a('0x23')](handleEntityNotFound(_0x21da0d,null))[_0xe93a('0x23')](respondWithResult(_0x21da0d,null))[_0xe93a('0x46')](handleError(_0x21da0d,null));};exports['create']=function(_0x233073,_0x328386){return db[_0xe93a('0x2b')][_0xe93a('0x47')](_0x233073[_0xe93a('0x48')],{})[_0xe93a('0x23')](respondWithResult(_0x328386,0xc9))[_0xe93a('0x46')](handleError(_0x328386,null));};exports['update']=function(_0x5ce174,_0x48db54){if(_0x5ce174[_0xe93a('0x48')]['id']){delete _0x5ce174[_0xe93a('0x48')]['id'];}return db[_0xe93a('0x2b')]['find']({'where':{'id':_0x5ce174[_0xe93a('0x49')]['id']}})['then'](handleEntityNotFound(_0x48db54,null))[_0xe93a('0x23')](saveUpdates(_0x5ce174[_0xe93a('0x48')],null))[_0xe93a('0x23')](respondWithResult(_0x48db54,null))['catch'](handleError(_0x48db54,null));};exports[_0xe93a('0x24')]=function(_0x40a327,_0x45618e){return db['SAPayment']['find']({'where':{'id':_0x40a327[_0xe93a('0x49')]['id']}})[_0xe93a('0x23')](handleEntityNotFound(_0x45618e,null))['then'](removeEntity(_0x45618e,null))[_0xe93a('0x46')](handleError(_0x45618e,null));};exports[_0xe93a('0x4a')]=function(_0xe90b03,_0x10175a){return db[_0xe93a('0x2b')]['describe']()[_0xe93a('0x23')](respondWithResult(_0x10175a,null))[_0xe93a('0x46')](handleError(_0x10175a,null));}; \ No newline at end of file diff --git a/server/api/saPayment/saPayment.model.js b/server/api/saPayment/saPayment.model.js index 9bd06b2..3e75326 100644 --- a/server/api/saPayment/saPayment.model.js +++ b/server/api/saPayment/saPayment.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9aa=['define','sa_payments','models','get','InvoiceId','invoice','receivingFiscalMessage','indexOf','SAInvoiceDetail','findAll','details','then','payments','length','payment','netPrice','discount','tax','isNil','quantity','paid','log','invoice-->','catch','TCL:\x20err','find','ProformaId','proforma','split\x20payment','SAProformaDetail','SAProforma','update','has','SAInvoice','SAPayment','Hook\x20afterCreate:\x20err','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x1db565,_0x2cbe46){var _0xeb0a7c=function(_0x5eca67){while(--_0x5eca67){_0x1db565['push'](_0x1db565['shift']());}};_0xeb0a7c(++_0x2cbe46);}(_0xb9aa,0xa8));var _0xab9a=function(_0x3d4fef,_0x220a84){_0x3d4fef=_0x3d4fef-0x0;var _0x5944e8=_0xb9aa[_0x3d4fef];return _0x5944e8;};'use strict';var _=require(_0xab9a('0x0'));var util=require(_0xab9a('0x1'));var logger=require(_0xab9a('0x2'))('api');var moment=require('moment');var BPromise=require(_0xab9a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xab9a('0x4'));var rimraf=require(_0xab9a('0x5'));var config=require(_0xab9a('0x6'));var attributes=require('./saPayment.attributes');module[_0xab9a('0x7')]=function(_0x34c549,_0x5bbd1b){return _0x34c549[_0xab9a('0x8')]('SAPayment',attributes,{'tableName':_0xab9a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1e8c5c,_0x32d887,_0x3d6739){var _0x3c4a66=_0x34c549[_0xab9a('0xa')];var _0x10dbeb={};var _0x1a4cc0={};var _0x169892=_0x1e8c5c[_0xab9a('0xb')]({'plain':!![]});if(_['has'](_0x169892,_0xab9a('0xc'))){_0x3c4a66['SAInvoice']['find']({'where':{'id':_0x169892[_0xab9a('0xc')]},'raw':!![]})['then'](function(_0x176878){if(_0x176878){_0x10dbeb[_0xab9a('0xd')]=_0x176878;var _0x467ea3=![];if(_0x10dbeb[_0xab9a('0xd')][_0xab9a('0xe')][_0xab9a('0xf')]('split\x20payment')!=-0x1){_0x467ea3=!![];}return _0x3c4a66[_0xab9a('0x10')][_0xab9a('0x11')]({'where':{'InvoiceId':_0x169892[_0xab9a('0xc')]},'raw':!![]})['then'](function(_0x477140){_0x10dbeb[_0xab9a('0x12')]=_0x477140;return _0x3c4a66['SAPayment']['findAll']({'where':{'InvoiceId':_0x169892['InvoiceId']},'raw':!![]});})[_0xab9a('0x13')](function(_0x4265fa){_0x10dbeb[_0xab9a('0x14')]=_0x4265fa;var _0x539891=0x0;var _0x3ad096=0x0;var _0x546339=0x0;var _0x376251=0x0;var _0x5bd7b7=0x0;for(var _0x171494=0x0;_0x171494<_0x10dbeb[_0xab9a('0x14')][_0xab9a('0x15')];_0x171494++){_0x539891+=_0x10dbeb[_0xab9a('0x14')][_0x171494][_0xab9a('0x16')];}for(var _0x171494=0x0;_0x171494<_0x10dbeb[_0xab9a('0x12')][_0xab9a('0x15')];_0x171494++){var _0x386f2a=0x0;var _0x8ba1b2=0x0;var _0x52d7a2=0x0;var _0x2c0abe=0x0;_0x386f2a=_0x10dbeb[_0xab9a('0x12')][_0x171494][_0xab9a('0x17')]-_0x10dbeb[_0xab9a('0x12')][_0x171494]['netPrice']/0x64*_0x10dbeb['details'][_0x171494][_0xab9a('0x18')];_0x8ba1b2=_0x386f2a/0x64*_0x10dbeb[_0xab9a('0x12')][_0x171494][_0xab9a('0x19')];_0x52d7a2=_0x386f2a*_0x10dbeb[_0xab9a('0x12')][_0x171494]['quantity'];_0x2c0abe=_0x8ba1b2*_0x10dbeb[_0xab9a('0x12')][_0x171494]['quantity'];_0x376251+=_0x52d7a2;_0x5bd7b7+=_0x2c0abe;}if(!_[_0xab9a('0x1a')](_0x10dbeb[_0xab9a('0xd')]['discount'])){var _0x44a127=0x0;var _0x507122=0x0;var _0x3b21cc=_0x10dbeb['invoice'][_0xab9a('0x18')]*0x64/_0x376251;for(var _0x1a453=0x0;_0x1a453<_0x10dbeb[_0xab9a('0x12')][_0xab9a('0x15')];_0x1a453++){var _0x26c67f=0x0;var _0x100ed6=0x0;var _0x2e63b6=0x0;_0x386f2a=_0x10dbeb[_0xab9a('0x12')][_0x1a453][_0xab9a('0x17')]-_0x10dbeb['details'][_0x1a453][_0xab9a('0x17')]/0x64*_0x10dbeb[_0xab9a('0x12')][_0x1a453][_0xab9a('0x18')];_0x26c67f=_0x386f2a/0x64*_0x3b21cc;_0x100ed6=_0x386f2a-_0x26c67f;_0x2e63b6=_0x100ed6*_0x10dbeb[_0xab9a('0x12')][_0x1a453][_0xab9a('0x1b')];_0x44a127+=_0x2e63b6;_0x507122+=_0x2e63b6/0x64*_0x10dbeb[_0xab9a('0x12')][_0x1a453][_0xab9a('0x19')];}}if(!_[_0xab9a('0x1a')](_0x10dbeb[_0xab9a('0xd')][_0xab9a('0x18')])){if(_0x467ea3){_0x3ad096=_0x44a127;}else{_0x3ad096=_0x507122+_0x44a127;}}else{if(_0x467ea3){_0x3ad096=_0x376251;}else{_0x3ad096=_0x5bd7b7+_0x376251;}}if(_0x539891==_0x3ad096){_0x10dbeb['invoice'][_0xab9a('0x1c')]=0x1;}if(_0x539891<_0x3ad096){_0x10dbeb['invoice'][_0xab9a('0x1c')]=0x2;}if(_0x539891>_0x3ad096){_0x10dbeb[_0xab9a('0xd')][_0xab9a('0x1c')]=0x3;}_0x3c4a66['SAInvoice']['update'](_0x10dbeb[_0xab9a('0xd')],{'where':{'id':_0x169892[_0xab9a('0xc')]}})[_0xab9a('0x13')](function(_0x5aa03e){console[_0xab9a('0x1d')](_0xab9a('0x1e'),_0x5aa03e);})[_0xab9a('0x1f')](function(_0x5014b8){console[_0xab9a('0x1d')](_0xab9a('0x20'),_0x5014b8);});});}});}else{_0x3c4a66['SAProforma'][_0xab9a('0x21')]({'where':{'id':_0x169892[_0xab9a('0x22')]},'raw':!![]})['then'](function(_0x535ea2){if(_0x535ea2){_0x1a4cc0[_0xab9a('0x23')]=_0x535ea2;var _0x115f26=![];if(_0x1a4cc0['proforma'][_0xab9a('0xe')]['indexOf'](_0xab9a('0x24'))!=-0x1){_0x115f26=!![];}return _0x3c4a66[_0xab9a('0x25')][_0xab9a('0x11')]({'where':{'ProformaId':_0x169892[_0xab9a('0x22')]},'raw':!![]})[_0xab9a('0x13')](function(_0x30caa2){_0x1a4cc0[_0xab9a('0x12')]=_0x30caa2;return _0x3c4a66['SAPayment']['findAll']({'where':{'ProformaId':_0x169892[_0xab9a('0x22')]},'raw':!![]});})[_0xab9a('0x13')](function(_0x3c52d4){_0x1a4cc0[_0xab9a('0x14')]=_0x3c52d4;var _0x3c165c=0x0;var _0x14d44d=0x0;var _0xd0a40=0x0;var _0x189948=0x0;var _0x2e2847=0x0;for(var _0xfbfec4=0x0;_0xfbfec4<_0x1a4cc0[_0xab9a('0x14')]['length'];_0xfbfec4++){_0x3c165c+=_0x1a4cc0['payments'][_0xfbfec4][_0xab9a('0x16')];}for(var _0xfbfec4=0x0;_0xfbfec4<_0x1a4cc0[_0xab9a('0x12')][_0xab9a('0x15')];_0xfbfec4++){var _0x5e5ab5=0x0;var _0x2a2bee=0x0;var _0x760003=0x0;var _0x2c2da0=0x0;_0x5e5ab5=_0x1a4cc0[_0xab9a('0x12')][_0xfbfec4][_0xab9a('0x17')]-_0x1a4cc0['details'][_0xfbfec4][_0xab9a('0x17')]/0x64*_0x1a4cc0[_0xab9a('0x12')][_0xfbfec4][_0xab9a('0x18')];_0x2a2bee=_0x5e5ab5/0x64*_0x1a4cc0['details'][_0xfbfec4][_0xab9a('0x19')];_0x760003=_0x5e5ab5*_0x1a4cc0['details'][_0xfbfec4]['quantity'];_0x2c2da0=_0x2a2bee*_0x1a4cc0[_0xab9a('0x12')][_0xfbfec4][_0xab9a('0x1b')];_0x189948+=_0x760003;_0x2e2847+=_0x2c2da0;}if(!_[_0xab9a('0x1a')](_0x1a4cc0['proforma'][_0xab9a('0x18')])){var _0x45b4e8=0x0;var _0x46ae15=0x0;var _0x3c7b7a=_0x1a4cc0['proforma']['discount']*0x64/_0x189948;for(var _0x1fe5d8=0x0;_0x1fe5d8<_0x1a4cc0[_0xab9a('0x12')][_0xab9a('0x15')];_0x1fe5d8++){var _0x7fb748=0x0;var _0x56ad2f=0x0;var _0xcb417d=0x0;_0x5e5ab5=_0x1a4cc0['details'][_0x1fe5d8][_0xab9a('0x17')]-_0x1a4cc0[_0xab9a('0x12')][_0x1fe5d8][_0xab9a('0x17')]/0x64*_0x1a4cc0[_0xab9a('0x12')][_0x1fe5d8]['discount'];_0x7fb748=_0x5e5ab5/0x64*_0x3c7b7a;_0x56ad2f=_0x5e5ab5-_0x7fb748;_0xcb417d=_0x56ad2f*_0x1a4cc0['details'][_0x1fe5d8][_0xab9a('0x1b')];_0x45b4e8+=_0xcb417d;_0x46ae15+=_0xcb417d/0x64*_0x1a4cc0[_0xab9a('0x12')][_0x1fe5d8][_0xab9a('0x19')];}}if(!_[_0xab9a('0x1a')](_0x1a4cc0['proforma'][_0xab9a('0x18')])){if(_0x115f26){_0x14d44d=_0x45b4e8;}else{_0x14d44d=_0x46ae15+_0x45b4e8;}}else{if(_0x115f26){_0x14d44d=_0x189948;}else{_0x14d44d=_0x2e2847+_0x189948;}}if(_0x3c165c==_0x14d44d){_0x1a4cc0[_0xab9a('0x23')][_0xab9a('0x1c')]=0x1;}if(_0x3c165c<_0x14d44d){_0x1a4cc0[_0xab9a('0x23')][_0xab9a('0x1c')]=0x2;}if(_0x3c165c>_0x14d44d){_0x1a4cc0[_0xab9a('0x23')]['paid']=0x3;}_0x3c4a66[_0xab9a('0x26')][_0xab9a('0x27')](_0x1a4cc0[_0xab9a('0x23')],{'where':{'id':_0x169892[_0xab9a('0x22')]}})[_0xab9a('0x13')](function(_0x13da5a){})[_0xab9a('0x1f')](function(_0x29b59e){console[_0xab9a('0x1d')]('Hook\x20afterCreate:\x20err',_0x29b59e);});});}});}_0x3d6739();},'afterUpdate':function(_0x530c65,_0x3f548b,_0x4a21d9){var _0xe4d32e=_0x34c549[_0xab9a('0xa')];var _0x4b975b={};var _0x2d3489={};var _0x1880bf=_0x530c65[_0xab9a('0xb')]({'plain':!![]});if(_[_0xab9a('0x28')](_0x1880bf,_0xab9a('0xc'))){_0xe4d32e[_0xab9a('0x29')][_0xab9a('0x21')]({'where':{'id':_0x1880bf[_0xab9a('0xc')]},'raw':!![]})[_0xab9a('0x13')](function(_0x516fb2){if(_0x516fb2){_0x4b975b[_0xab9a('0xd')]=_0x516fb2;var _0x43504c=![];if(_0x4b975b['invoice'][_0xab9a('0xe')][_0xab9a('0xf')](_0xab9a('0x24'))!=-0x1){_0x43504c=!![];}return _0xe4d32e[_0xab9a('0x10')][_0xab9a('0x11')]({'where':{'InvoiceId':_0x1880bf[_0xab9a('0xc')]},'raw':!![]})[_0xab9a('0x13')](function(_0x38ebf0){_0x4b975b[_0xab9a('0x12')]=_0x38ebf0;return _0xe4d32e[_0xab9a('0x2a')][_0xab9a('0x11')]({'where':{'InvoiceId':_0x1880bf['InvoiceId']},'raw':!![]});})[_0xab9a('0x13')](function(_0x1c6d9d){_0x4b975b['payments']=_0x1c6d9d;var _0x5b6d43=0x0;var _0x21c690=0x0;var _0x1ecb49=0x0;var _0x344983=0x0;var _0x352931=0x0;for(var _0x16da9c=0x0;_0x16da9c<_0x4b975b[_0xab9a('0x14')]['length'];_0x16da9c++){_0x5b6d43+=_0x4b975b[_0xab9a('0x14')][_0x16da9c]['payment'];}for(var _0x16da9c=0x0;_0x16da9c<_0x4b975b['details'][_0xab9a('0x15')];_0x16da9c++){var _0x1f4cdb=0x0;var _0x38f7ec=0x0;var _0x2e3fd0=0x0;var _0x450332=0x0;_0x1f4cdb=_0x4b975b[_0xab9a('0x12')][_0x16da9c][_0xab9a('0x17')]-_0x4b975b[_0xab9a('0x12')][_0x16da9c][_0xab9a('0x17')]/0x64*_0x4b975b['details'][_0x16da9c][_0xab9a('0x18')];_0x38f7ec=_0x1f4cdb/0x64*_0x4b975b[_0xab9a('0x12')][_0x16da9c][_0xab9a('0x19')];_0x2e3fd0=_0x1f4cdb*_0x4b975b[_0xab9a('0x12')][_0x16da9c][_0xab9a('0x1b')];_0x450332=_0x38f7ec*_0x4b975b[_0xab9a('0x12')][_0x16da9c][_0xab9a('0x1b')];_0x344983+=_0x2e3fd0;_0x352931+=_0x450332;}if(!_[_0xab9a('0x1a')](_0x4b975b[_0xab9a('0xd')][_0xab9a('0x18')])){var _0x299c2d=0x0;var _0x6f0789=0x0;var _0x3031dd=_0x4b975b[_0xab9a('0xd')][_0xab9a('0x18')]*0x64/_0x344983;for(var _0x5d8cb1=0x0;_0x5d8cb1<_0x4b975b[_0xab9a('0x12')]['length'];_0x5d8cb1++){var _0x1c3801=0x0;var _0x51c344=0x0;var _0x2d4f64=0x0;_0x1f4cdb=_0x4b975b['details'][_0x5d8cb1][_0xab9a('0x17')]-_0x4b975b[_0xab9a('0x12')][_0x5d8cb1][_0xab9a('0x17')]/0x64*_0x4b975b[_0xab9a('0x12')][_0x5d8cb1][_0xab9a('0x18')];_0x1c3801=_0x1f4cdb/0x64*_0x3031dd;_0x51c344=_0x1f4cdb-_0x1c3801;_0x2d4f64=_0x51c344*_0x4b975b['details'][_0x5d8cb1][_0xab9a('0x1b')];_0x299c2d+=_0x2d4f64;_0x6f0789+=_0x2d4f64/0x64*_0x4b975b[_0xab9a('0x12')][_0x5d8cb1]['tax'];}}if(!_['isNil'](_0x4b975b[_0xab9a('0xd')][_0xab9a('0x18')])){if(_0x43504c){_0x21c690=_0x299c2d;}else{_0x21c690=_0x6f0789+_0x299c2d;}}else{if(_0x43504c){_0x21c690=_0x344983;}else{_0x21c690=_0x352931+_0x344983;}}if(_0x5b6d43==_0x21c690){_0x4b975b[_0xab9a('0xd')][_0xab9a('0x1c')]=0x1;}if(_0x5b6d43<_0x21c690){_0x4b975b[_0xab9a('0xd')]['paid']=0x2;}if(_0x5b6d43>_0x21c690){_0x4b975b[_0xab9a('0xd')][_0xab9a('0x1c')]=0x3;}_0xe4d32e[_0xab9a('0x29')]['update'](_0x4b975b[_0xab9a('0xd')],{'where':{'id':_0x1880bf['InvoiceId']}})['then'](function(_0x2ffbb4){console[_0xab9a('0x1d')]('invoice-->',_0x2ffbb4);})['catch'](function(_0x11e70c){console['log'](_0xab9a('0x20'),_0x11e70c);});});}});}else{_0xe4d32e[_0xab9a('0x26')][_0xab9a('0x21')]({'where':{'id':_0x1880bf['ProformaId']},'raw':!![]})[_0xab9a('0x13')](function(_0x24f80c){if(_0x24f80c){_0x2d3489[_0xab9a('0x23')]=_0x24f80c;var _0x58a490=![];if(_0x4b975b[_0xab9a('0xd')][_0xab9a('0xe')][_0xab9a('0xf')](_0xab9a('0x24'))!=-0x1){_0x58a490=!![];}return _0xe4d32e['SAProformaDetail'][_0xab9a('0x11')]({'where':{'ProformaId':_0x1880bf[_0xab9a('0x22')]},'raw':!![]})[_0xab9a('0x13')](function(_0x17d4a1){_0x2d3489[_0xab9a('0x12')]=_0x17d4a1;return _0xe4d32e[_0xab9a('0x2a')][_0xab9a('0x11')]({'where':{'ProformaId':_0x1880bf[_0xab9a('0x22')]},'raw':!![]});})[_0xab9a('0x13')](function(_0x400e40){_0x2d3489[_0xab9a('0x14')]=_0x400e40;var _0x3123ee=0x0;var _0x2f49d2=0x0;var _0x3a12cb=0x0;var _0x125efa=0x0;var _0x271658=0x0;for(var _0x3de684=0x0;_0x3de684<_0x2d3489[_0xab9a('0x14')][_0xab9a('0x15')];_0x3de684++){_0x3123ee+=_0x2d3489[_0xab9a('0x14')][_0x3de684][_0xab9a('0x16')];}for(var _0x3de684=0x0;_0x3de684<_0x2d3489['details'][_0xab9a('0x15')];_0x3de684++){var _0x76dd83=0x0;var _0x32ee01=0x0;var _0x4ce987=0x0;var _0x37315e=0x0;_0x76dd83=_0x2d3489[_0xab9a('0x12')][_0x3de684][_0xab9a('0x17')]-_0x2d3489[_0xab9a('0x12')][_0x3de684][_0xab9a('0x17')]/0x64*_0x2d3489[_0xab9a('0x12')][_0x3de684][_0xab9a('0x18')];_0x32ee01=_0x76dd83/0x64*_0x2d3489[_0xab9a('0x12')][_0x3de684][_0xab9a('0x19')];_0x4ce987=_0x76dd83*_0x2d3489['details'][_0x3de684]['quantity'];_0x37315e=_0x32ee01*_0x2d3489[_0xab9a('0x12')][_0x3de684]['quantity'];_0x125efa+=_0x4ce987;_0x271658+=_0x37315e;}if(!_[_0xab9a('0x1a')](_0x2d3489[_0xab9a('0x23')][_0xab9a('0x18')])){var _0x3a51f2=0x0;var _0x401866=0x0;var _0x20cfa8=_0x2d3489[_0xab9a('0x23')]['discount']*0x64/_0x125efa;for(var _0x208c8a=0x0;_0x208c8a<_0x2d3489[_0xab9a('0x12')][_0xab9a('0x15')];_0x208c8a++){var _0xcba03d=0x0;var _0x1295bf=0x0;var _0x34ea5c=0x0;_0x76dd83=_0x2d3489[_0xab9a('0x12')][_0x208c8a][_0xab9a('0x17')]-_0x2d3489[_0xab9a('0x12')][_0x208c8a][_0xab9a('0x17')]/0x64*_0x2d3489[_0xab9a('0x12')][_0x208c8a]['discount'];_0xcba03d=_0x76dd83/0x64*_0x20cfa8;_0x1295bf=_0x76dd83-_0xcba03d;_0x34ea5c=_0x1295bf*_0x2d3489[_0xab9a('0x12')][_0x208c8a][_0xab9a('0x1b')];_0x3a51f2+=_0x34ea5c;_0x401866+=_0x34ea5c/0x64*_0x2d3489['details'][_0x208c8a][_0xab9a('0x19')];}}if(!_['isNil'](_0x2d3489['proforma'][_0xab9a('0x18')])){if(_0x58a490){_0x2f49d2=_0x3a51f2;}else{_0x2f49d2=_0x401866+_0x3a51f2;}}else{if(_0x58a490){_0x2f49d2=_0x125efa;}else{_0x2f49d2=_0x271658+_0x125efa;}}if(_0x3123ee==_0x2f49d2){_0x2d3489[_0xab9a('0x23')][_0xab9a('0x1c')]=0x1;}if(_0x3123ee<_0x2f49d2){_0x2d3489[_0xab9a('0x23')][_0xab9a('0x1c')]=0x2;}if(_0x3123ee>_0x2f49d2){_0x2d3489['proforma'][_0xab9a('0x1c')]=0x3;}_0xe4d32e[_0xab9a('0x26')][_0xab9a('0x27')](_0x2d3489[_0xab9a('0x23')],{'where':{'id':_0x1880bf[_0xab9a('0x22')]}})[_0xab9a('0x13')](function(_0x44fe2b){})[_0xab9a('0x1f')](function(_0x2fb78a){console['log'](_0xab9a('0x2b'),_0x2fb78a);});});}});}_0x4a21d9();}}});}; \ No newline at end of file +var _0x5989=['payment','netPrice','quantity','isNil','discount','tax','paid','update','log','invoice-->','catch','SAProforma','ProformaId','proforma','SAProformaDetail','Hook\x20afterCreate:\x20err','TCL:\x20err','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./saPayment.attributes','exports','define','SAPayment','sa_payments','models','get','has','InvoiceId','SAInvoice','find','then','invoice','indexOf','split\x20payment','SAInvoiceDetail','details','findAll','payments','length'];(function(_0x8016dd,_0x323024){var _0x18393d=function(_0x3b95d9){while(--_0x3b95d9){_0x8016dd['push'](_0x8016dd['shift']());}};_0x18393d(++_0x323024);}(_0x5989,0x119));var _0x9598=function(_0x417955,_0x4ed8c8){_0x417955=_0x417955-0x0;var _0x3a94ef=_0x5989[_0x417955];return _0x3a94ef;};'use strict';var _=require(_0x9598('0x0'));var util=require(_0x9598('0x1'));var logger=require(_0x9598('0x2'))(_0x9598('0x3'));var moment=require(_0x9598('0x4'));var BPromise=require('bluebird');var rp=require(_0x9598('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9598('0x6'));var attributes=require(_0x9598('0x7'));module[_0x9598('0x8')]=function(_0x4ac5b2,_0x1c0b94){return _0x4ac5b2[_0x9598('0x9')](_0x9598('0xa'),attributes,{'tableName':_0x9598('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2415d4,_0x3f6ac7,_0x5e1312){var _0x46e15=_0x4ac5b2[_0x9598('0xc')];var _0x5b0c06={};var _0x4b9ba4={};var _0x424f24=_0x2415d4[_0x9598('0xd')]({'plain':!![]});if(_[_0x9598('0xe')](_0x424f24,_0x9598('0xf'))){_0x46e15[_0x9598('0x10')][_0x9598('0x11')]({'where':{'id':_0x424f24[_0x9598('0xf')]},'raw':!![]})[_0x9598('0x12')](function(_0x2d2774){if(_0x2d2774){_0x5b0c06[_0x9598('0x13')]=_0x2d2774;var _0x585a4d=![];if(_0x5b0c06[_0x9598('0x13')]['receivingFiscalMessage'][_0x9598('0x14')](_0x9598('0x15'))!=-0x1){_0x585a4d=!![];}return _0x46e15[_0x9598('0x16')]['findAll']({'where':{'InvoiceId':_0x424f24[_0x9598('0xf')]},'raw':!![]})[_0x9598('0x12')](function(_0x350dd0){_0x5b0c06[_0x9598('0x17')]=_0x350dd0;return _0x46e15['SAPayment'][_0x9598('0x18')]({'where':{'InvoiceId':_0x424f24[_0x9598('0xf')]},'raw':!![]});})['then'](function(_0x35d4c6){_0x5b0c06[_0x9598('0x19')]=_0x35d4c6;var _0x11bc1a=0x0;var _0x591fb0=0x0;var _0x132e28=0x0;var _0x358f38=0x0;var _0x47bb7c=0x0;for(var _0x56038c=0x0;_0x56038c<_0x5b0c06[_0x9598('0x19')][_0x9598('0x1a')];_0x56038c++){_0x11bc1a+=_0x5b0c06[_0x9598('0x19')][_0x56038c][_0x9598('0x1b')];}for(var _0x56038c=0x0;_0x56038c<_0x5b0c06[_0x9598('0x17')][_0x9598('0x1a')];_0x56038c++){var _0x1ad1c8=0x0;var _0x29f780=0x0;var _0x1b0f98=0x0;var _0xdecdc1=0x0;_0x1ad1c8=_0x5b0c06[_0x9598('0x17')][_0x56038c][_0x9598('0x1c')]-_0x5b0c06[_0x9598('0x17')][_0x56038c][_0x9598('0x1c')]/0x64*_0x5b0c06[_0x9598('0x17')][_0x56038c]['discount'];_0x29f780=_0x1ad1c8/0x64*_0x5b0c06[_0x9598('0x17')][_0x56038c]['tax'];_0x1b0f98=_0x1ad1c8*_0x5b0c06['details'][_0x56038c][_0x9598('0x1d')];_0xdecdc1=_0x29f780*_0x5b0c06[_0x9598('0x17')][_0x56038c][_0x9598('0x1d')];_0x358f38+=_0x1b0f98;_0x47bb7c+=_0xdecdc1;}if(!_[_0x9598('0x1e')](_0x5b0c06[_0x9598('0x13')][_0x9598('0x1f')])){var _0x225162=0x0;var _0x514b07=0x0;var _0x194c88=_0x5b0c06['invoice'][_0x9598('0x1f')]*0x64/_0x358f38;for(var _0x291925=0x0;_0x291925<_0x5b0c06[_0x9598('0x17')][_0x9598('0x1a')];_0x291925++){var _0x22cab1=0x0;var _0x3d4674=0x0;var _0x52db5f=0x0;_0x1ad1c8=_0x5b0c06[_0x9598('0x17')][_0x291925][_0x9598('0x1c')]-_0x5b0c06[_0x9598('0x17')][_0x291925][_0x9598('0x1c')]/0x64*_0x5b0c06[_0x9598('0x17')][_0x291925]['discount'];_0x22cab1=_0x1ad1c8/0x64*_0x194c88;_0x3d4674=_0x1ad1c8-_0x22cab1;_0x52db5f=_0x3d4674*_0x5b0c06['details'][_0x291925][_0x9598('0x1d')];_0x225162+=_0x52db5f;_0x514b07+=_0x52db5f/0x64*_0x5b0c06[_0x9598('0x17')][_0x291925][_0x9598('0x20')];}}if(!_['isNil'](_0x5b0c06['invoice'][_0x9598('0x1f')])){if(_0x585a4d){_0x591fb0=_0x225162;}else{_0x591fb0=_0x514b07+_0x225162;}}else{if(_0x585a4d){_0x591fb0=_0x358f38;}else{_0x591fb0=_0x47bb7c+_0x358f38;}}if(_0x11bc1a==_0x591fb0){_0x5b0c06[_0x9598('0x13')][_0x9598('0x21')]=0x1;}if(_0x11bc1a<_0x591fb0){_0x5b0c06[_0x9598('0x13')][_0x9598('0x21')]=0x2;}if(_0x11bc1a>_0x591fb0){_0x5b0c06[_0x9598('0x13')][_0x9598('0x21')]=0x3;}_0x46e15[_0x9598('0x10')][_0x9598('0x22')](_0x5b0c06[_0x9598('0x13')],{'where':{'id':_0x424f24[_0x9598('0xf')]}})[_0x9598('0x12')](function(_0x16b5ca){console[_0x9598('0x23')](_0x9598('0x24'),_0x16b5ca);})[_0x9598('0x25')](function(_0x5133c5){console[_0x9598('0x23')]('TCL:\x20err',_0x5133c5);});});}});}else{_0x46e15[_0x9598('0x26')][_0x9598('0x11')]({'where':{'id':_0x424f24[_0x9598('0x27')]},'raw':!![]})[_0x9598('0x12')](function(_0x3cf7bb){if(_0x3cf7bb){_0x4b9ba4['proforma']=_0x3cf7bb;var _0x4ac430=![];if(_0x4b9ba4[_0x9598('0x28')]['receivingFiscalMessage'][_0x9598('0x14')]('split\x20payment')!=-0x1){_0x4ac430=!![];}return _0x46e15[_0x9598('0x29')][_0x9598('0x18')]({'where':{'ProformaId':_0x424f24[_0x9598('0x27')]},'raw':!![]})['then'](function(_0x27c1e5){_0x4b9ba4[_0x9598('0x17')]=_0x27c1e5;return _0x46e15[_0x9598('0xa')]['findAll']({'where':{'ProformaId':_0x424f24[_0x9598('0x27')]},'raw':!![]});})['then'](function(_0xee3478){_0x4b9ba4[_0x9598('0x19')]=_0xee3478;var _0x593478=0x0;var _0x539d56=0x0;var _0x54c47b=0x0;var _0x431996=0x0;var _0x47102f=0x0;for(var _0x5884e4=0x0;_0x5884e4<_0x4b9ba4[_0x9598('0x19')]['length'];_0x5884e4++){_0x593478+=_0x4b9ba4['payments'][_0x5884e4][_0x9598('0x1b')];}for(var _0x5884e4=0x0;_0x5884e4<_0x4b9ba4[_0x9598('0x17')]['length'];_0x5884e4++){var _0xe4cd7=0x0;var _0xa78a20=0x0;var _0x103b1d=0x0;var _0x57de81=0x0;_0xe4cd7=_0x4b9ba4[_0x9598('0x17')][_0x5884e4][_0x9598('0x1c')]-_0x4b9ba4[_0x9598('0x17')][_0x5884e4]['netPrice']/0x64*_0x4b9ba4['details'][_0x5884e4][_0x9598('0x1f')];_0xa78a20=_0xe4cd7/0x64*_0x4b9ba4[_0x9598('0x17')][_0x5884e4][_0x9598('0x20')];_0x103b1d=_0xe4cd7*_0x4b9ba4[_0x9598('0x17')][_0x5884e4]['quantity'];_0x57de81=_0xa78a20*_0x4b9ba4[_0x9598('0x17')][_0x5884e4]['quantity'];_0x431996+=_0x103b1d;_0x47102f+=_0x57de81;}if(!_[_0x9598('0x1e')](_0x4b9ba4[_0x9598('0x28')][_0x9598('0x1f')])){var _0x8b5c13=0x0;var _0x15ec11=0x0;var _0x45942a=_0x4b9ba4['proforma']['discount']*0x64/_0x431996;for(var _0x4db968=0x0;_0x4db968<_0x4b9ba4[_0x9598('0x17')][_0x9598('0x1a')];_0x4db968++){var _0x89448c=0x0;var _0x21fd9f=0x0;var _0x59bade=0x0;_0xe4cd7=_0x4b9ba4['details'][_0x4db968][_0x9598('0x1c')]-_0x4b9ba4[_0x9598('0x17')][_0x4db968][_0x9598('0x1c')]/0x64*_0x4b9ba4[_0x9598('0x17')][_0x4db968]['discount'];_0x89448c=_0xe4cd7/0x64*_0x45942a;_0x21fd9f=_0xe4cd7-_0x89448c;_0x59bade=_0x21fd9f*_0x4b9ba4[_0x9598('0x17')][_0x4db968][_0x9598('0x1d')];_0x8b5c13+=_0x59bade;_0x15ec11+=_0x59bade/0x64*_0x4b9ba4[_0x9598('0x17')][_0x4db968]['tax'];}}if(!_[_0x9598('0x1e')](_0x4b9ba4[_0x9598('0x28')][_0x9598('0x1f')])){if(_0x4ac430){_0x539d56=_0x8b5c13;}else{_0x539d56=_0x15ec11+_0x8b5c13;}}else{if(_0x4ac430){_0x539d56=_0x431996;}else{_0x539d56=_0x47102f+_0x431996;}}if(_0x593478==_0x539d56){_0x4b9ba4[_0x9598('0x28')][_0x9598('0x21')]=0x1;}if(_0x593478<_0x539d56){_0x4b9ba4[_0x9598('0x28')]['paid']=0x2;}if(_0x593478>_0x539d56){_0x4b9ba4['proforma'][_0x9598('0x21')]=0x3;}_0x46e15[_0x9598('0x26')][_0x9598('0x22')](_0x4b9ba4[_0x9598('0x28')],{'where':{'id':_0x424f24[_0x9598('0x27')]}})[_0x9598('0x12')](function(_0x4e30db){})[_0x9598('0x25')](function(_0x4219d6){console['log'](_0x9598('0x2a'),_0x4219d6);});});}});}_0x5e1312();},'afterUpdate':function(_0x47c44f,_0x330256,_0x31b952){var _0x7c2711=_0x4ac5b2[_0x9598('0xc')];var _0x4624b9={};var _0x213c19={};var _0x5e0ac4=_0x47c44f[_0x9598('0xd')]({'plain':!![]});if(_['has'](_0x5e0ac4,_0x9598('0xf'))){_0x7c2711['SAInvoice']['find']({'where':{'id':_0x5e0ac4['InvoiceId']},'raw':!![]})[_0x9598('0x12')](function(_0x2c4994){if(_0x2c4994){_0x4624b9['invoice']=_0x2c4994;var _0x282558=![];if(_0x4624b9['invoice']['receivingFiscalMessage'][_0x9598('0x14')](_0x9598('0x15'))!=-0x1){_0x282558=!![];}return _0x7c2711[_0x9598('0x16')][_0x9598('0x18')]({'where':{'InvoiceId':_0x5e0ac4[_0x9598('0xf')]},'raw':!![]})[_0x9598('0x12')](function(_0x28add6){_0x4624b9['details']=_0x28add6;return _0x7c2711[_0x9598('0xa')]['findAll']({'where':{'InvoiceId':_0x5e0ac4['InvoiceId']},'raw':!![]});})[_0x9598('0x12')](function(_0x14d8f5){_0x4624b9[_0x9598('0x19')]=_0x14d8f5;var _0x2e0852=0x0;var _0x245bce=0x0;var _0x5585ec=0x0;var _0x2e985a=0x0;var _0x318893=0x0;for(var _0xb8ee2d=0x0;_0xb8ee2d<_0x4624b9['payments'][_0x9598('0x1a')];_0xb8ee2d++){_0x2e0852+=_0x4624b9['payments'][_0xb8ee2d][_0x9598('0x1b')];}for(var _0xb8ee2d=0x0;_0xb8ee2d<_0x4624b9[_0x9598('0x17')]['length'];_0xb8ee2d++){var _0x4a916d=0x0;var _0x2d6661=0x0;var _0x3cf6e5=0x0;var _0x30de8c=0x0;_0x4a916d=_0x4624b9['details'][_0xb8ee2d][_0x9598('0x1c')]-_0x4624b9[_0x9598('0x17')][_0xb8ee2d][_0x9598('0x1c')]/0x64*_0x4624b9[_0x9598('0x17')][_0xb8ee2d]['discount'];_0x2d6661=_0x4a916d/0x64*_0x4624b9[_0x9598('0x17')][_0xb8ee2d]['tax'];_0x3cf6e5=_0x4a916d*_0x4624b9['details'][_0xb8ee2d][_0x9598('0x1d')];_0x30de8c=_0x2d6661*_0x4624b9['details'][_0xb8ee2d][_0x9598('0x1d')];_0x2e985a+=_0x3cf6e5;_0x318893+=_0x30de8c;}if(!_[_0x9598('0x1e')](_0x4624b9[_0x9598('0x13')][_0x9598('0x1f')])){var _0x30ff67=0x0;var _0x47b57b=0x0;var _0x4e6c4f=_0x4624b9[_0x9598('0x13')][_0x9598('0x1f')]*0x64/_0x2e985a;for(var _0x41272d=0x0;_0x41272d<_0x4624b9['details'][_0x9598('0x1a')];_0x41272d++){var _0x4d680c=0x0;var _0x310a23=0x0;var _0x47e161=0x0;_0x4a916d=_0x4624b9['details'][_0x41272d]['netPrice']-_0x4624b9['details'][_0x41272d][_0x9598('0x1c')]/0x64*_0x4624b9[_0x9598('0x17')][_0x41272d]['discount'];_0x4d680c=_0x4a916d/0x64*_0x4e6c4f;_0x310a23=_0x4a916d-_0x4d680c;_0x47e161=_0x310a23*_0x4624b9[_0x9598('0x17')][_0x41272d]['quantity'];_0x30ff67+=_0x47e161;_0x47b57b+=_0x47e161/0x64*_0x4624b9[_0x9598('0x17')][_0x41272d][_0x9598('0x20')];}}if(!_[_0x9598('0x1e')](_0x4624b9[_0x9598('0x13')][_0x9598('0x1f')])){if(_0x282558){_0x245bce=_0x30ff67;}else{_0x245bce=_0x47b57b+_0x30ff67;}}else{if(_0x282558){_0x245bce=_0x2e985a;}else{_0x245bce=_0x318893+_0x2e985a;}}if(_0x2e0852==_0x245bce){_0x4624b9[_0x9598('0x13')]['paid']=0x1;}if(_0x2e0852<_0x245bce){_0x4624b9[_0x9598('0x13')][_0x9598('0x21')]=0x2;}if(_0x2e0852>_0x245bce){_0x4624b9[_0x9598('0x13')][_0x9598('0x21')]=0x3;}_0x7c2711[_0x9598('0x10')][_0x9598('0x22')](_0x4624b9[_0x9598('0x13')],{'where':{'id':_0x5e0ac4[_0x9598('0xf')]}})[_0x9598('0x12')](function(_0x306f3e){console[_0x9598('0x23')](_0x9598('0x24'),_0x306f3e);})[_0x9598('0x25')](function(_0x595986){console[_0x9598('0x23')](_0x9598('0x2b'),_0x595986);});});}});}else{_0x7c2711[_0x9598('0x26')][_0x9598('0x11')]({'where':{'id':_0x5e0ac4['ProformaId']},'raw':!![]})[_0x9598('0x12')](function(_0x4053e7){if(_0x4053e7){_0x213c19[_0x9598('0x28')]=_0x4053e7;var _0x34c609=![];if(_0x4624b9[_0x9598('0x13')]['receivingFiscalMessage'][_0x9598('0x14')](_0x9598('0x15'))!=-0x1){_0x34c609=!![];}return _0x7c2711[_0x9598('0x29')][_0x9598('0x18')]({'where':{'ProformaId':_0x5e0ac4['ProformaId']},'raw':!![]})['then'](function(_0x28c4fb){_0x213c19[_0x9598('0x17')]=_0x28c4fb;return _0x7c2711[_0x9598('0xa')][_0x9598('0x18')]({'where':{'ProformaId':_0x5e0ac4[_0x9598('0x27')]},'raw':!![]});})[_0x9598('0x12')](function(_0x29e5f0){_0x213c19['payments']=_0x29e5f0;var _0x4ad3a1=0x0;var _0xc5c8c1=0x0;var _0x5cebed=0x0;var _0x15547d=0x0;var _0x1d2fe1=0x0;for(var _0xcbea45=0x0;_0xcbea45<_0x213c19[_0x9598('0x19')][_0x9598('0x1a')];_0xcbea45++){_0x4ad3a1+=_0x213c19[_0x9598('0x19')][_0xcbea45]['payment'];}for(var _0xcbea45=0x0;_0xcbea45<_0x213c19[_0x9598('0x17')]['length'];_0xcbea45++){var _0x4e6d90=0x0;var _0x146da9=0x0;var _0x361382=0x0;var _0x384b82=0x0;_0x4e6d90=_0x213c19[_0x9598('0x17')][_0xcbea45][_0x9598('0x1c')]-_0x213c19[_0x9598('0x17')][_0xcbea45][_0x9598('0x1c')]/0x64*_0x213c19[_0x9598('0x17')][_0xcbea45][_0x9598('0x1f')];_0x146da9=_0x4e6d90/0x64*_0x213c19[_0x9598('0x17')][_0xcbea45]['tax'];_0x361382=_0x4e6d90*_0x213c19['details'][_0xcbea45]['quantity'];_0x384b82=_0x146da9*_0x213c19[_0x9598('0x17')][_0xcbea45]['quantity'];_0x15547d+=_0x361382;_0x1d2fe1+=_0x384b82;}if(!_[_0x9598('0x1e')](_0x213c19[_0x9598('0x28')]['discount'])){var _0x3dbd84=0x0;var _0x4a3899=0x0;var _0x2abb44=_0x213c19[_0x9598('0x28')]['discount']*0x64/_0x15547d;for(var _0x348324=0x0;_0x348324<_0x213c19[_0x9598('0x17')]['length'];_0x348324++){var _0x3e6187=0x0;var _0x204b42=0x0;var _0x15dd4e=0x0;_0x4e6d90=_0x213c19[_0x9598('0x17')][_0x348324][_0x9598('0x1c')]-_0x213c19[_0x9598('0x17')][_0x348324]['netPrice']/0x64*_0x213c19['details'][_0x348324][_0x9598('0x1f')];_0x3e6187=_0x4e6d90/0x64*_0x2abb44;_0x204b42=_0x4e6d90-_0x3e6187;_0x15dd4e=_0x204b42*_0x213c19[_0x9598('0x17')][_0x348324][_0x9598('0x1d')];_0x3dbd84+=_0x15dd4e;_0x4a3899+=_0x15dd4e/0x64*_0x213c19[_0x9598('0x17')][_0x348324][_0x9598('0x20')];}}if(!_[_0x9598('0x1e')](_0x213c19[_0x9598('0x28')]['discount'])){if(_0x34c609){_0xc5c8c1=_0x3dbd84;}else{_0xc5c8c1=_0x4a3899+_0x3dbd84;}}else{if(_0x34c609){_0xc5c8c1=_0x15547d;}else{_0xc5c8c1=_0x1d2fe1+_0x15547d;}}if(_0x4ad3a1==_0xc5c8c1){_0x213c19[_0x9598('0x28')]['paid']=0x1;}if(_0x4ad3a1<_0xc5c8c1){_0x213c19['proforma'][_0x9598('0x21')]=0x2;}if(_0x4ad3a1>_0xc5c8c1){_0x213c19[_0x9598('0x28')][_0x9598('0x21')]=0x3;}_0x7c2711['SAProforma'][_0x9598('0x22')](_0x213c19['proforma'],{'where':{'id':_0x5e0ac4['ProformaId']}})['then'](function(_0x4045c8){})[_0x9598('0x25')](function(_0x5d31bc){console[_0x9598('0x23')](_0x9598('0x2a'),_0x5d31bc);});});}});}_0x31b952();}}});}; \ No newline at end of file diff --git a/server/api/saPayment/saPayment.rpc.js b/server/api/saPayment/saPayment.rpc.js index 6f71479..95bf209 100644 --- a/server/api/saPayment/saPayment.rpc.js +++ b/server/api/saPayment/saPayment.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8cda=['request\x20sent','debug','SAPayment,\x20%s,\x20%s,\x20%s','error','message','info','catch','lodash','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','SAPayment,\x20%s,\x20%s'];(function(_0x4a898f,_0x1e4850){var _0x219067=function(_0x1517b5){while(--_0x1517b5){_0x4a898f['push'](_0x4a898f['shift']());}};_0x219067(++_0x1e4850);}(_0x8cda,0x6d));var _0xa8cd=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8cda[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa8cd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa8cd('0x1'))['db'];var utils=require(_0xa8cd('0x2'));var logger=require(_0xa8cd('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa8cd('0x4'));var client=jayson[_0xa8cd('0x5')][_0xa8cd('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x127669,_0x3e7063,_0x3a2944){return new BPromise(function(_0x10e05b,_0x5b9c06){return client[_0xa8cd('0x7')](_0x127669,_0x3a2944)[_0xa8cd('0x8')](function(_0x3dec41){logger['info'](_0xa8cd('0x9'),_0x3e7063,_0xa8cd('0xa'));logger[_0xa8cd('0xb')](_0xa8cd('0xc'),_0x3e7063,_0xa8cd('0xa'),JSON['stringify'](_0x3dec41));if(_0x3dec41[_0xa8cd('0xd')]){if(_0x3dec41[_0xa8cd('0xd')]['code']===0x1f4){logger[_0xa8cd('0xd')](_0xa8cd('0x9'),_0x3e7063,_0x3dec41[_0xa8cd('0xd')][_0xa8cd('0xe')]);return _0x5b9c06(_0x3dec41[_0xa8cd('0xd')][_0xa8cd('0xe')]);}logger[_0xa8cd('0xd')](_0xa8cd('0x9'),_0x3e7063,_0x3dec41[_0xa8cd('0xd')]['message']);return _0x10e05b(_0x3dec41[_0xa8cd('0xd')][_0xa8cd('0xe')]);}else{logger[_0xa8cd('0xf')](_0xa8cd('0x9'),_0x3e7063,_0xa8cd('0xa'));_0x10e05b(_0x3dec41['result'][_0xa8cd('0xe')]);}})[_0xa8cd('0x10')](function(_0x465a86){logger[_0xa8cd('0xd')]('SAPayment,\x20%s,\x20%s',_0x3e7063,_0x465a86);_0x5b9c06(_0x465a86);});});} \ No newline at end of file +var _0x9e30=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','SAPayment,\x20%s,\x20%s,\x20%s','error','message','SAPayment,\x20%s,\x20%s','result','catch','lodash','util'];(function(_0x420339,_0x44e6d1){var _0x182774=function(_0x12752e){while(--_0x12752e){_0x420339['push'](_0x420339['shift']());}};_0x182774(++_0x44e6d1);}(_0x9e30,0xcd));var _0x09e3=function(_0x90f34f,_0x404021){_0x90f34f=_0x90f34f-0x0;var _0x4b18cf=_0x9e30[_0x90f34f];return _0x4b18cf;};'use strict';var _=require(_0x09e3('0x0'));var util=require(_0x09e3('0x1'));var moment=require('moment');var BPromise=require(_0x09e3('0x2'));var rs=require(_0x09e3('0x3'));var fs=require('fs');var Redis=require(_0x09e3('0x4'));var db=require(_0x09e3('0x5'))['db'];var utils=require(_0x09e3('0x6'));var logger=require(_0x09e3('0x7'))(_0x09e3('0x8'));var config=require(_0x09e3('0x9'));var jayson=require(_0x09e3('0xa'));var client=jayson[_0x09e3('0xb')][_0x09e3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a4442,_0x545127,_0x17dcd4){return new BPromise(function(_0x3feb1b,_0x5952f5){return client[_0x09e3('0xd')](_0x1a4442,_0x17dcd4)[_0x09e3('0xe')](function(_0x159163){logger[_0x09e3('0xf')]('SAPayment,\x20%s,\x20%s',_0x545127,_0x09e3('0x10'));logger['debug'](_0x09e3('0x11'),_0x545127,_0x09e3('0x10'),JSON['stringify'](_0x159163));if(_0x159163['error']){if(_0x159163[_0x09e3('0x12')]['code']===0x1f4){logger[_0x09e3('0x12')]('SAPayment,\x20%s,\x20%s',_0x545127,_0x159163[_0x09e3('0x12')][_0x09e3('0x13')]);return _0x5952f5(_0x159163[_0x09e3('0x12')][_0x09e3('0x13')]);}logger['error']('SAPayment,\x20%s,\x20%s',_0x545127,_0x159163['error'][_0x09e3('0x13')]);return _0x3feb1b(_0x159163[_0x09e3('0x12')][_0x09e3('0x13')]);}else{logger[_0x09e3('0xf')](_0x09e3('0x14'),_0x545127,'request\x20sent');_0x3feb1b(_0x159163[_0x09e3('0x15')][_0x09e3('0x13')]);}})[_0x09e3('0x16')](function(_0x33c264){logger[_0x09e3('0x12')](_0x09e3('0x14'),_0x545127,_0x33c264);_0x5952f5(_0x33c264);});});} \ No newline at end of file diff --git a/server/api/saPaymentMethod/index.js b/server/api/saPaymentMethod/index.js index 7e07833..60399a4 100644 --- a/server/api/saPaymentMethod/index.js +++ b/server/api/saPaymentMethod/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9320=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saPaymentMethod.controller','isAuthenticated','get','/describe','describe','show','post','create'];(function(_0x17a07e,_0x55f77a){var _0x118926=function(_0x2ed1ad){while(--_0x2ed1ad){_0x17a07e['push'](_0x17a07e['shift']());}};_0x118926(++_0x55f77a);}(_0x9320,0xbe));var _0x0932=function(_0x144c3a,_0x25771a){_0x144c3a=_0x144c3a-0x0;var _0x31aa7b=_0x9320[_0x144c3a];return _0x31aa7b;};'use strict';var multer=require(_0x0932('0x0'));var util=require(_0x0932('0x1'));var path=require(_0x0932('0x2'));var timeout=require(_0x0932('0x3'));var express=require(_0x0932('0x4'));var router=express[_0x0932('0x5')]();var auth=require(_0x0932('0x6'));var interaction=require(_0x0932('0x7'));var config=require(_0x0932('0x8'));var controller=require(_0x0932('0x9'));router['get']('/',auth[_0x0932('0xa')](),controller['index']);router[_0x0932('0xb')](_0x0932('0xc'),auth['isAuthenticated'](),controller[_0x0932('0xd')]);router[_0x0932('0xb')]('/:id',auth[_0x0932('0xa')](),controller[_0x0932('0xe')]);router[_0x0932('0xf')]('/',auth[_0x0932('0xa')](),controller[_0x0932('0x10')]);router[_0x0932('0x11')](_0x0932('0x12'),auth['isAuthenticated'](),controller[_0x0932('0x13')]);router[_0x0932('0x14')](_0x0932('0x12'),auth[_0x0932('0xa')](),controller[_0x0932('0x15')]);module[_0x0932('0x16')]=router; \ No newline at end of file +var _0x2dc3=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./saPaymentMethod.controller','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','destroy','multer','path','connect-timeout'];(function(_0x3c8ca1,_0x7cc09a){var _0x1eb209=function(_0x30180c){while(--_0x30180c){_0x3c8ca1['push'](_0x3c8ca1['shift']());}};_0x1eb209(++_0x7cc09a);}(_0x2dc3,0x9f));var _0x32dc=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2dc3[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x32dc('0x0'));var util=require('util');var path=require(_0x32dc('0x1'));var timeout=require(_0x32dc('0x2'));var express=require(_0x32dc('0x3'));var router=express['Router']();var auth=require(_0x32dc('0x4'));var interaction=require(_0x32dc('0x5'));var config=require(_0x32dc('0x6'));var controller=require(_0x32dc('0x7'));router['get']('/',auth[_0x32dc('0x8')](),controller['index']);router['get'](_0x32dc('0x9'),auth['isAuthenticated'](),controller[_0x32dc('0xa')]);router['get'](_0x32dc('0xb'),auth[_0x32dc('0x8')](),controller[_0x32dc('0xc')]);router[_0x32dc('0xd')]('/',auth['isAuthenticated'](),controller[_0x32dc('0xe')]);router[_0x32dc('0xf')](_0x32dc('0xb'),auth[_0x32dc('0x8')](),controller[_0x32dc('0x10')]);router['delete'](_0x32dc('0xb'),auth[_0x32dc('0x8')](),controller[_0x32dc('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/saPaymentMethod/saPaymentMethod.attributes.js b/server/api/saPaymentMethod/saPaymentMethod.attributes.js index eefcea7..0e20606 100644 --- a/server/api/saPaymentMethod/saPaymentMethod.attributes.js +++ b/server/api/saPaymentMethod/saPaymentMethod.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe2f=['STRING','sequelize','exports'];(function(_0x4c7853,_0x210d47){var _0x210deb=function(_0x20facd){while(--_0x20facd){_0x4c7853['push'](_0x4c7853['shift']());}};_0x210deb(++_0x210d47);}(_0xfe2f,0xfd));var _0xffe2=function(_0x287813,_0x314990){_0x287813=_0x287813-0x0;var _0x4a5f0f=_0xfe2f[_0x287813];return _0x4a5f0f;};'use strict';var Sequelize=require(_0xffe2('0x0'));module[_0xffe2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'bankAccount':{'type':Sequelize['STRING']},'paymentType':{'type':Sequelize[_0xffe2('0x2')]},'bankName':{'type':Sequelize['STRING']},'bankstreet':{'type':Sequelize[_0xffe2('0x2')]},'bankpostalCode':{'type':Sequelize['STRING']},'bankcity':{'type':Sequelize['STRING']},'bankcountry':{'type':Sequelize['STRING']},'bankBICSWIFT':{'type':Sequelize[_0xffe2('0x2')]},'bankIBAN':{'type':Sequelize[_0xffe2('0x2')]},'bankABI':{'type':Sequelize['STRING']},'banckCAB':{'type':Sequelize[_0xffe2('0x2')]},'paypalEmail':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}}}; \ No newline at end of file +var _0x1f5a=['exports','name','STRING','sequelize'];(function(_0x64ba1b,_0x30f58d){var _0x18b6d7=function(_0x88fcc3){while(--_0x88fcc3){_0x64ba1b['push'](_0x64ba1b['shift']());}};_0x18b6d7(++_0x30f58d);}(_0x1f5a,0xff));var _0xa1f5=function(_0x380509,_0x5ae6bc){_0x380509=_0x380509-0x0;var _0x18090f=_0x1f5a[_0x380509];return _0x18090f;};'use strict';var Sequelize=require(_0xa1f5('0x0'));module[_0xa1f5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa1f5('0x2')},'bankAccount':{'type':Sequelize[_0xa1f5('0x3')]},'paymentType':{'type':Sequelize[_0xa1f5('0x3')]},'bankName':{'type':Sequelize['STRING']},'bankstreet':{'type':Sequelize['STRING']},'bankpostalCode':{'type':Sequelize['STRING']},'bankcity':{'type':Sequelize['STRING']},'bankcountry':{'type':Sequelize[_0xa1f5('0x3')]},'bankBICSWIFT':{'type':Sequelize['STRING']},'bankIBAN':{'type':Sequelize['STRING']},'bankABI':{'type':Sequelize[_0xa1f5('0x3')]},'banckCAB':{'type':Sequelize['STRING']},'paypalEmail':{'type':Sequelize[_0xa1f5('0x3')],'validate':{'isEmail':!![]}}}; \ No newline at end of file diff --git a/server/api/saPaymentMethod/saPaymentMethod.controller.js b/server/api/saPaymentMethod/saPaymentMethod.controller.js index 9079093..8833f02 100644 --- a/server/api/saPaymentMethod/saPaymentMethod.controller.js +++ b/server/api/saPaymentMethod/saPaymentMethod.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','update','destroy','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','SAPaymentMethod','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x11e17e,_0x1d06a6){var _0xaa46af=function(_0xb9a45d){while(--_0xb9a45d){_0x11e17e['push'](_0x11e17e['shift']());}};_0xaa46af(++_0x1d06a6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var 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['SAPaymentMethod'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['SAPaymentMethod']['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){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['SAPaymentMethod'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));};exports[_0x0a9e('0x43')]=function(_0x992c77,_0x6054ee){return db[_0x0a9e('0x24')][_0x0a9e('0x43')]()['then'](respondWithResult(_0x6054ee,null))[_0x0a9e('0x3b')](handleError(_0x6054ee,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','update','destroy','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','SAPaymentMethod','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x4e0d4e,_0x185c29){var _0x4fb047=function(_0x7904d7){while(--_0x7904d7){_0x4e0d4e['push'](_0x4e0d4e['shift']());}};_0x4fb047(++_0x185c29);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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['SAPaymentMethod'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['SAPaymentMethod']['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){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['SAPaymentMethod'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));};exports[_0x0a9e('0x43')]=function(_0x992c77,_0x6054ee){return db[_0x0a9e('0x24')][_0x0a9e('0x43')]()['then'](respondWithResult(_0x6054ee,null))[_0x0a9e('0x3b')](handleError(_0x6054ee,null));}; \ No newline at end of file diff --git a/server/api/saPaymentMethod/saPaymentMethod.model.js b/server/api/saPaymentMethod/saPaymentMethod.model.js index 420dbd3..ba5bc20 100644 --- a/server/api/saPaymentMethod/saPaymentMethod.model.js +++ b/server/api/saPaymentMethod/saPaymentMethod.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac12=['moment','bluebird','path','rimraf','../../config/environment','./saPaymentMethod.attributes','exports','define','SAPaymentMethod','sa_paymentMethods','lodash','util','../../config/logger'];(function(_0x255c0f,_0x506772){var _0x4cfc7e=function(_0x21a8ef){while(--_0x21a8ef){_0x255c0f['push'](_0x255c0f['shift']());}};_0x4cfc7e(++_0x506772);}(_0xac12,0x7f));var _0x2ac1=function(_0x2f9717,_0x1e8d5f){_0x2f9717=_0x2f9717-0x0;var _0x7f1276=_0xac12[_0x2f9717];return _0x7f1276;};'use strict';var _=require(_0x2ac1('0x0'));var util=require(_0x2ac1('0x1'));var logger=require(_0x2ac1('0x2'))('api');var moment=require(_0x2ac1('0x3'));var BPromise=require(_0x2ac1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2ac1('0x5'));var rimraf=require(_0x2ac1('0x6'));var config=require(_0x2ac1('0x7'));var attributes=require(_0x2ac1('0x8'));module[_0x2ac1('0x9')]=function(_0x5ae92b,_0x41df42){return _0x5ae92b[_0x2ac1('0xa')](_0x2ac1('0xb'),attributes,{'tableName':_0x2ac1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x544f=['define','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports'];(function(_0x5e9d73,_0x2f1600){var _0x13e1fc=function(_0x84d551){while(--_0x84d551){_0x5e9d73['push'](_0x5e9d73['shift']());}};_0x13e1fc(++_0x2f1600);}(_0x544f,0x97));var _0xf544=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x544f[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xf544('0x0'));var util=require(_0xf544('0x1'));var logger=require(_0xf544('0x2'))(_0xf544('0x3'));var moment=require(_0xf544('0x4'));var BPromise=require(_0xf544('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf544('0x6'));var rimraf=require(_0xf544('0x7'));var config=require('../../config/environment');var attributes=require('./saPaymentMethod.attributes');module[_0xf544('0x8')]=function(_0x47a9f6,_0x468f8d){return _0x47a9f6[_0xf544('0x9')]('SAPaymentMethod',attributes,{'tableName':'sa_paymentMethods','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saPaymentMethod/saPaymentMethod.rpc.js b/server/api/saPaymentMethod/saPaymentMethod.rpc.js index 77547cc..bea7a8e 100644 --- a/server/api/saPaymentMethod/saPaymentMethod.rpc.js +++ b/server/api/saPaymentMethod/saPaymentMethod.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff61=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','SAPaymentMethod,\x20%s,\x20%s,\x20%s','stringify','error','code','SAPaymentMethod,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x1e56d2,_0x1e85b6){var _0x335915=function(_0x4271e1){while(--_0x4271e1){_0x1e56d2['push'](_0x1e56d2['shift']());}};_0x335915(++_0x1e85b6);}(_0xff61,0x76));var _0x1ff6=function(_0x492fc6,_0xefec2){_0x492fc6=_0x492fc6-0x0;var _0x5041d3=_0xff61[_0x492fc6];return _0x5041d3;};'use strict';var _=require(_0x1ff6('0x0'));var util=require(_0x1ff6('0x1'));var moment=require(_0x1ff6('0x2'));var BPromise=require(_0x1ff6('0x3'));var rs=require(_0x1ff6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ff6('0x5'))['db'];var utils=require(_0x1ff6('0x6'));var logger=require('../../config/logger')(_0x1ff6('0x7'));var config=require(_0x1ff6('0x8'));var jayson=require(_0x1ff6('0x9'));var client=jayson[_0x1ff6('0xa')][_0x1ff6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1648c1,_0x3e1bb6,_0x37c629){return new BPromise(function(_0x23cdb0,_0x2416a5){return client[_0x1ff6('0xc')](_0x1648c1,_0x37c629)[_0x1ff6('0xd')](function(_0x212576){logger['info']('SAPaymentMethod,\x20%s,\x20%s',_0x3e1bb6,_0x1ff6('0xe'));logger[_0x1ff6('0xf')](_0x1ff6('0x10'),_0x3e1bb6,'request\x20sent',JSON[_0x1ff6('0x11')](_0x212576));if(_0x212576[_0x1ff6('0x12')]){if(_0x212576[_0x1ff6('0x12')][_0x1ff6('0x13')]===0x1f4){logger[_0x1ff6('0x12')](_0x1ff6('0x14'),_0x3e1bb6,_0x212576['error'][_0x1ff6('0x15')]);return _0x2416a5(_0x212576[_0x1ff6('0x12')][_0x1ff6('0x15')]);}logger[_0x1ff6('0x12')](_0x1ff6('0x14'),_0x3e1bb6,_0x212576[_0x1ff6('0x12')][_0x1ff6('0x15')]);return _0x23cdb0(_0x212576['error'][_0x1ff6('0x15')]);}else{logger['info'](_0x1ff6('0x14'),_0x3e1bb6,'request\x20sent');_0x23cdb0(_0x212576[_0x1ff6('0x16')][_0x1ff6('0x15')]);}})[_0x1ff6('0x17')](function(_0x15df99){logger[_0x1ff6('0x12')](_0x1ff6('0x14'),_0x3e1bb6,_0x15df99);_0x2416a5(_0x15df99);});});} \ No newline at end of file +var _0x8b56=['info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','SAPaymentMethod,\x20%s,\x20%s','request\x20sent','debug','SAPaymentMethod,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4b91c4,_0x23f35f){var _0x25cb80=function(_0x48e283){while(--_0x48e283){_0x4b91c4['push'](_0x4b91c4['shift']());}};_0x25cb80(++_0x23f35f);}(_0x8b56,0x173));var _0x68b5=function(_0x1247b0,_0x1290c4){_0x1247b0=_0x1247b0-0x0;var _0x389ebc=_0x8b56[_0x1247b0];return _0x389ebc;};'use strict';var _=require(_0x68b5('0x0'));var util=require(_0x68b5('0x1'));var moment=require(_0x68b5('0x2'));var BPromise=require(_0x68b5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x68b5('0x4'));var db=require(_0x68b5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x68b5('0x6'));var config=require('../../config/environment');var jayson=require(_0x68b5('0x7'));var client=jayson[_0x68b5('0x8')][_0x68b5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a26ec,_0x162a9d,_0x561255){return new BPromise(function(_0x290db9,_0x9b5c53){return client[_0x68b5('0xa')](_0x3a26ec,_0x561255)[_0x68b5('0xb')](function(_0x214e27){logger['info'](_0x68b5('0xc'),_0x162a9d,_0x68b5('0xd'));logger[_0x68b5('0xe')](_0x68b5('0xf'),_0x162a9d,_0x68b5('0xd'),JSON[_0x68b5('0x10')](_0x214e27));if(_0x214e27[_0x68b5('0x11')]){if(_0x214e27[_0x68b5('0x11')][_0x68b5('0x12')]===0x1f4){logger[_0x68b5('0x11')](_0x68b5('0xc'),_0x162a9d,_0x214e27[_0x68b5('0x11')]['message']);return _0x9b5c53(_0x214e27[_0x68b5('0x11')][_0x68b5('0x13')]);}logger[_0x68b5('0x11')](_0x68b5('0xc'),_0x162a9d,_0x214e27[_0x68b5('0x11')]['message']);return _0x290db9(_0x214e27['error'][_0x68b5('0x13')]);}else{logger[_0x68b5('0x14')]('SAPaymentMethod,\x20%s,\x20%s',_0x162a9d,_0x68b5('0xd'));_0x290db9(_0x214e27[_0x68b5('0x15')][_0x68b5('0x13')]);}})[_0x68b5('0x16')](function(_0x376ac2){logger[_0x68b5('0x11')](_0x68b5('0xc'),_0x162a9d,_0x376ac2);_0x9b5c53(_0x376ac2);});});} \ No newline at end of file diff --git a/server/api/saPriceList/index.js b/server/api/saPriceList/index.js index 23b5692..2ef291e 100644 --- a/server/api/saPriceList/index.js +++ b/server/api/saPriceList/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x895e=['index','/describe','/:id','show','getProducts','post','/:id/products','update','delete','destroy','removeProducts','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x4f234d,_0xf12cac){var _0x1c6688=function(_0x2bf983){while(--_0x2bf983){_0x4f234d['push'](_0x4f234d['shift']());}};_0x1c6688(++_0xf12cac);}(_0x895e,0xab));var _0xe895=function(_0x2062df,_0xb7252f){_0x2062df=_0x2062df-0x0;var _0x49ccbf=_0x895e[_0x2062df];return _0x49ccbf;};'use strict';var multer=require('multer');var util=require(_0xe895('0x0'));var path=require(_0xe895('0x1'));var timeout=require(_0xe895('0x2'));var express=require(_0xe895('0x3'));var router=express[_0xe895('0x4')]();var auth=require(_0xe895('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe895('0x6'));var controller=require('./saPriceList.controller');router[_0xe895('0x7')]('/',auth[_0xe895('0x8')](),controller[_0xe895('0x9')]);router['get'](_0xe895('0xa'),auth[_0xe895('0x8')](),controller['describe']);router[_0xe895('0x7')](_0xe895('0xb'),auth[_0xe895('0x8')](),controller[_0xe895('0xc')]);router[_0xe895('0x7')]('/:id/products',auth[_0xe895('0x8')](),controller[_0xe895('0xd')]);router[_0xe895('0xe')]('/',auth[_0xe895('0x8')](),controller['create']);router[_0xe895('0xe')]('/:id/clone',auth[_0xe895('0x8')](),controller['clone']);router[_0xe895('0xe')](_0xe895('0xf'),auth[_0xe895('0x8')](),controller['addProduct']);router['put'](_0xe895('0xb'),auth['isAuthenticated'](),controller[_0xe895('0x10')]);router[_0xe895('0x11')]('/:id',auth[_0xe895('0x8')](),controller[_0xe895('0x12')]);router[_0xe895('0x11')](_0xe895('0xf'),auth['isAuthenticated'](),controller[_0xe895('0x13')]);module['exports']=router; \ No newline at end of file +var _0x17eb=['/:id/products','getProducts','post','create','clone','addProduct','put','delete','destroy','removeProducts','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show'];(function(_0x5df492,_0x294297){var _0x5b5d78=function(_0x22ce8b){while(--_0x22ce8b){_0x5df492['push'](_0x5df492['shift']());}};_0x5b5d78(++_0x294297);}(_0x17eb,0x145));var _0xb17e=function(_0x369f77,_0x1ed585){_0x369f77=_0x369f77-0x0;var _0x2b0a62=_0x17eb[_0x369f77];return _0x2b0a62;};'use strict';var multer=require(_0xb17e('0x0'));var util=require('util');var path=require(_0xb17e('0x1'));var timeout=require(_0xb17e('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xb17e('0x3'));var interaction=require(_0xb17e('0x4'));var config=require(_0xb17e('0x5'));var controller=require('./saPriceList.controller');router[_0xb17e('0x6')]('/',auth[_0xb17e('0x7')](),controller['index']);router[_0xb17e('0x6')](_0xb17e('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0xb17e('0x6')](_0xb17e('0x9'),auth[_0xb17e('0x7')](),controller[_0xb17e('0xa')]);router['get'](_0xb17e('0xb'),auth[_0xb17e('0x7')](),controller[_0xb17e('0xc')]);router[_0xb17e('0xd')]('/',auth[_0xb17e('0x7')](),controller[_0xb17e('0xe')]);router[_0xb17e('0xd')]('/:id/clone',auth[_0xb17e('0x7')](),controller[_0xb17e('0xf')]);router[_0xb17e('0xd')](_0xb17e('0xb'),auth['isAuthenticated'](),controller[_0xb17e('0x10')]);router[_0xb17e('0x11')](_0xb17e('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xb17e('0x12')](_0xb17e('0x9'),auth[_0xb17e('0x7')](),controller[_0xb17e('0x13')]);router[_0xb17e('0x12')](_0xb17e('0xb'),auth[_0xb17e('0x7')](),controller[_0xb17e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/saPriceList/saPriceList.attributes.js b/server/api/saPriceList/saPriceList.attributes.js index ccfdb22..ca32f6c 100644 --- a/server/api/saPriceList/saPriceList.attributes.js +++ b/server/api/saPriceList/saPriceList.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3363=['DECIMAL','DATE','sequelize','exports','STRING','name'];(function(_0x152c92,_0x4b3c59){var _0x561041=function(_0x4a34e6){while(--_0x4a34e6){_0x152c92['push'](_0x152c92['shift']());}};_0x561041(++_0x4b3c59);}(_0x3363,0xe0));var _0x3336=function(_0x2c797c,_0x507e04){_0x2c797c=_0x2c797c-0x0;var _0x41bd8b=_0x3363[_0x2c797c];return _0x41bd8b;};'use strict';var Sequelize=require(_0x3336('0x0'));module[_0x3336('0x1')]={'name':{'type':Sequelize[_0x3336('0x2')],'allowNull':![],'unique':_0x3336('0x3')},'description':{'type':Sequelize['TEXT'],'allowNull':!![]},'discount':{'type':Sequelize[_0x3336('0x4')](0x6,0x3),'allowNull':![]},'startAt':{'type':Sequelize[_0x3336('0x5')],'allowNull':!![]},'endAt':{'type':Sequelize[_0x3336('0x5')],'allowNull':!![]}}; \ No newline at end of file +var _0xa22b=['DATE'];(function(_0x2609a7,_0x204b89){var _0x3eef9c=function(_0x5b2ee6){while(--_0x5b2ee6){_0x2609a7['push'](_0x2609a7['shift']());}};_0x3eef9c(++_0x204b89);}(_0xa22b,0x123));var _0xba22=function(_0xfe0c25,_0x4c73e4){_0xfe0c25=_0xfe0c25-0x0;var _0xf95682=_0xa22b[_0xfe0c25];return _0xf95682;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['TEXT'],'allowNull':!![]},'discount':{'type':Sequelize['DECIMAL'](0x6,0x3),'allowNull':![]},'startAt':{'type':Sequelize[_0xba22('0x0')],'allowNull':!![]},'endAt':{'type':Sequelize['DATE'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/saPriceList/saPriceList.controller.js b/server/api/saPriceList/saPriceList.controller.js index 0dc24b3..1fca6c3 100644 --- a/server/api/saPriceList/saPriceList.controller.js +++ b/server/api/saPriceList/saPriceList.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4d0=['describe','findOne','pick','PriceListId','map','SAProductPricesList','Product','Pricelist','addProduct','removeProducts','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','SAPriceList','rawAttributes','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','field','options','includeAll','include','CmCompany','company','findAll','rows','show','params','keys','find','catch','create','body','get','omit','updatedAt','createdAt'];(function(_0x1248ac,_0x5ed008){var _0x4b21db=function(_0x1caa51){while(--_0x1caa51){_0x1248ac['push'](_0x1248ac['shift']());}};_0x4b21db(++_0x5ed008);}(_0xb4d0,0x1bd));var _0x0b4d=function(_0x5b682f,_0x3befac){_0x5b682f=_0x5b682f-0x0;var _0x47f01b=_0xb4d0[_0x5b682f];return _0x47f01b;};'use strict';var pdf=require(_0x0b4d('0x0'));var emlformat=require(_0x0b4d('0x1'));var rimraf=require(_0x0b4d('0x2'));var zipdir=require(_0x0b4d('0x3'));var jsonpatch=require(_0x0b4d('0x4'));var rp=require('request-promise');var moment=require(_0x0b4d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0b4d('0x6'));var util=require(_0x0b4d('0x7'));var path=require(_0x0b4d('0x8'));var sox=require('sox');var csv=require(_0x0b4d('0x9'));var ejs=require(_0x0b4d('0xa'));var fs=require('fs');var _=require(_0x0b4d('0xb'));var squel=require('squel');var crypto=require(_0x0b4d('0xc'));var jsforce=require(_0x0b4d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0b4d('0xe'));var Papa=require(_0x0b4d('0xf'));var Redis=require(_0x0b4d('0x10'));var authService=require(_0x0b4d('0x11'));var qs=require(_0x0b4d('0x12'));var hardwareService=require(_0x0b4d('0x13'));var logger=require('../../config/logger')(_0x0b4d('0x14'));var utils=require(_0x0b4d('0x15'));var config=require(_0x0b4d('0x16'));var db=require(_0x0b4d('0x17'))['db'];function respondWithStatusCode(_0x46de67,_0x4d1cea){_0x4d1cea=_0x4d1cea||0xcc;return function(_0x4145fa){if(_0x4145fa){return _0x46de67['sendStatus'](_0x4d1cea);}return _0x46de67['status'](_0x4d1cea)[_0x0b4d('0x18')]();};}function respondWithResult(_0x5f4e21,_0x9ca73){_0x9ca73=_0x9ca73||0xc8;return function(_0x4b76d9){if(_0x4b76d9){return _0x5f4e21[_0x0b4d('0x19')](_0x9ca73)[_0x0b4d('0x1a')](_0x4b76d9);}};}function respondWithFilteredResult(_0x2737a9,_0x107ee4){return function(_0x10e6ca){if(_0x10e6ca){var _0x38275b=_0x10e6ca[_0x0b4d('0x1b')],_0x2fc6b1=_0x107ee4[_0x0b4d('0x1c')],_0x4be7e8=_0x107ee4['offset']+_0x107ee4['limit'],_0x2dbbd9;if(_0x4be7e8>=_0x38275b){_0x4be7e8=_0x38275b;_0x2dbbd9=0xc8;}else{_0x2dbbd9=0xce;}_0x2737a9[_0x0b4d('0x19')](_0x2dbbd9);return _0x2737a9[_0x0b4d('0x1d')](_0x0b4d('0x1e'),_0x2fc6b1+'-'+_0x4be7e8+'/'+_0x38275b)[_0x0b4d('0x1a')](_0x10e6ca);}return null;};}function patchUpdates(_0x49fc85){return function(_0x169202){try{jsonpatch[_0x0b4d('0x1f')](_0x169202,_0x49fc85,!![]);}catch(_0x500085){return BPromise[_0x0b4d('0x20')](_0x500085);}return _0x169202[_0x0b4d('0x21')]();};}function saveUpdates(_0x4f1225,_0x369bb6){return function(_0x48d5da){if(_0x48d5da){return _0x48d5da[_0x0b4d('0x22')](_0x4f1225)[_0x0b4d('0x23')](function(_0x409417){return _0x409417;});}return null;};}function removeEntity(_0x757d5f,_0x15f672){return function(_0x5614a0){if(_0x5614a0){return _0x5614a0[_0x0b4d('0x24')]()['then'](function(){_0x757d5f[_0x0b4d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a90e8,_0x1b8abd){return function(_0x563330){if(!_0x563330){_0x5a90e8[_0x0b4d('0x25')](0x194);}return _0x563330;};}function handleError(_0x2165ff,_0x3b9c29){_0x3b9c29=_0x3b9c29||0x1f4;return function(_0x11e9ba){logger[_0x0b4d('0x26')](_0x11e9ba['stack']);if(_0x11e9ba[_0x0b4d('0x27')]){delete _0x11e9ba[_0x0b4d('0x27')];}_0x2165ff[_0x0b4d('0x19')](_0x3b9c29)[_0x0b4d('0x28')](_0x11e9ba);};}exports['index']=function(_0x3c1f51,_0x577c76){var _0x13bc46={},_0x246457={},_0x2b8b92={'count':0x0,'rows':[]};var _0x4a5910=db[_0x0b4d('0x29')][_0x0b4d('0x2a')];_0x246457[_0x0b4d('0x2b')]=_['keys'](_0x4a5910);_0x246457[_0x0b4d('0x2c')]=_['keys'](_0x3c1f51[_0x0b4d('0x2c')]);_0x246457[_0x0b4d('0x2d')]=_['intersection'](_0x246457[_0x0b4d('0x2b')],_0x246457[_0x0b4d('0x2c')]);_0x13bc46[_0x0b4d('0x2e')]=_[_0x0b4d('0x2f')](_0x246457[_0x0b4d('0x2b')],qs[_0x0b4d('0x30')](_0x3c1f51['query'][_0x0b4d('0x30')]));_0x13bc46[_0x0b4d('0x2e')]=_0x13bc46[_0x0b4d('0x2e')][_0x0b4d('0x31')]?_0x13bc46[_0x0b4d('0x2e')]:_0x246457[_0x0b4d('0x2b')];if(!_0x3c1f51[_0x0b4d('0x2c')][_0x0b4d('0x32')](_0x0b4d('0x33'))){_0x13bc46[_0x0b4d('0x34')]=qs['limit'](_0x3c1f51['query']['limit']);_0x13bc46[_0x0b4d('0x1c')]=qs[_0x0b4d('0x1c')](_0x3c1f51[_0x0b4d('0x2c')][_0x0b4d('0x1c')]);}_0x13bc46[_0x0b4d('0x35')]=qs[_0x0b4d('0x36')](_0x3c1f51[_0x0b4d('0x2c')][_0x0b4d('0x36')]);_0x13bc46[_0x0b4d('0x37')]=qs['filters'](_['pick'](_0x3c1f51[_0x0b4d('0x2c')],_0x246457[_0x0b4d('0x2d')]));if(_0x3c1f51[_0x0b4d('0x2c')][_0x0b4d('0x38')]){_0x13bc46[_0x0b4d('0x37')]=_[_0x0b4d('0x39')](_0x13bc46[_0x0b4d('0x37')],{'$or':_['map'](_0x4a5910,function(_0x44c7cf){if(_0x44c7cf['type']['key']!=='VIRTUAL'){var _0x92ae7a={};_0x92ae7a[_0x44c7cf[_0x0b4d('0x3a')]]={'$like':'%'+_0x3c1f51[_0x0b4d('0x2c')][_0x0b4d('0x38')]+'%'};return _0x92ae7a;}})});}_0x13bc46=_[_0x0b4d('0x39')]({},_0x13bc46,_0x3c1f51[_0x0b4d('0x3b')]);var _0x56604e={'where':_0x13bc46['where']};return db[_0x0b4d('0x29')][_0x0b4d('0x1b')](_0x56604e)[_0x0b4d('0x23')](function(_0xfbc9aa){_0x2b8b92['count']=_0xfbc9aa;if(_0x3c1f51[_0x0b4d('0x2c')][_0x0b4d('0x3c')]){_0x13bc46[_0x0b4d('0x3d')]=[{'model':db[_0x0b4d('0x3e')],'as':_0x0b4d('0x3f')}];}return db[_0x0b4d('0x29')][_0x0b4d('0x40')](_0x13bc46);})[_0x0b4d('0x23')](function(_0x3e1bf5){_0x2b8b92[_0x0b4d('0x41')]=_0x3e1bf5;return _0x2b8b92;})[_0x0b4d('0x23')](respondWithFilteredResult(_0x577c76,_0x13bc46))['catch'](handleError(_0x577c76,null));};exports[_0x0b4d('0x42')]=function(_0x26c1ca,_0x499684){var _0x53aa09={'raw':![],'where':{'id':_0x26c1ca[_0x0b4d('0x43')]['id']}},_0x1fc18f={};_0x1fc18f[_0x0b4d('0x2b')]=_[_0x0b4d('0x44')](db[_0x0b4d('0x29')][_0x0b4d('0x2a')]);_0x1fc18f[_0x0b4d('0x2c')]=_[_0x0b4d('0x44')](_0x26c1ca[_0x0b4d('0x2c')]);_0x1fc18f[_0x0b4d('0x2d')]=_[_0x0b4d('0x2f')](_0x1fc18f[_0x0b4d('0x2b')],_0x1fc18f[_0x0b4d('0x2c')]);_0x53aa09[_0x0b4d('0x2e')]=_[_0x0b4d('0x2f')](_0x1fc18f[_0x0b4d('0x2b')],qs[_0x0b4d('0x30')](_0x26c1ca['query'][_0x0b4d('0x30')]));_0x53aa09[_0x0b4d('0x2e')]=_0x53aa09[_0x0b4d('0x2e')]['length']?_0x53aa09[_0x0b4d('0x2e')]:_0x1fc18f['model'];if(_0x26c1ca[_0x0b4d('0x2c')][_0x0b4d('0x3c')]){_0x53aa09[_0x0b4d('0x3d')]=[{'all':!![]}];}_0x53aa09=_[_0x0b4d('0x39')]({},_0x53aa09,_0x26c1ca[_0x0b4d('0x3b')]);return db[_0x0b4d('0x29')][_0x0b4d('0x45')](_0x53aa09)['then'](handleEntityNotFound(_0x499684,null))[_0x0b4d('0x23')](respondWithResult(_0x499684,null))[_0x0b4d('0x46')](handleError(_0x499684,null));};exports[_0x0b4d('0x47')]=function(_0x15a085,_0xb531d8){return db[_0x0b4d('0x29')][_0x0b4d('0x47')](_0x15a085[_0x0b4d('0x48')],{})[_0x0b4d('0x23')](respondWithResult(_0xb531d8,0xc9))[_0x0b4d('0x46')](handleError(_0xb531d8,null));};exports['clone']=function(_0x433e24,_0x46b90f){var _0x45df48={'raw':![],'where':{'id':_0x433e24[_0x0b4d('0x43')]['id']}},_0x1485a5={};_0x1485a5['model']=_['keys'](db[_0x0b4d('0x29')][_0x0b4d('0x2a')]);_0x45df48[_0x0b4d('0x2e')]=_[_0x0b4d('0x2f')](_0x1485a5[_0x0b4d('0x2b')],qs[_0x0b4d('0x30')](_0x433e24[_0x0b4d('0x2c')][_0x0b4d('0x30')]));_0x45df48[_0x0b4d('0x2e')]=_0x45df48[_0x0b4d('0x2e')][_0x0b4d('0x31')]?_0x45df48[_0x0b4d('0x2e')]:_0x1485a5[_0x0b4d('0x2b')];if(_0x433e24[_0x0b4d('0x2c')][_0x0b4d('0x3c')]){_0x45df48['include']=[{'all':!![]}];}_0x45df48=_[_0x0b4d('0x39')]({},_0x45df48,_0x433e24['options']);return db[_0x0b4d('0x29')][_0x0b4d('0x45')](_0x45df48)[_0x0b4d('0x23')](handleEntityNotFound(_0x46b90f,null))[_0x0b4d('0x23')](function(_0x58eb5c){if(_0x58eb5c){var _0x1ef825=_0x58eb5c[_0x0b4d('0x49')]({'plain':!![]});_0x1ef825=qs[_0x0b4d('0x4a')](_0x1ef825,['id','createdAt',_0x0b4d('0x4b')]);_0x433e24[_0x0b4d('0x48')]=_[_0x0b4d('0x4a')](_0x433e24[_0x0b4d('0x48')],['id',_0x0b4d('0x4c'),'updatedAt']);return db[_0x0b4d('0x29')][_0x0b4d('0x47')](_[_0x0b4d('0x39')](_0x1ef825,_0x433e24[_0x0b4d('0x48')]),{'include':_0x433e24[_0x0b4d('0x2c')][_0x0b4d('0x3c')]?[{'all':!![]}]:undefined});}})[_0x0b4d('0x23')](respondWithResult(_0x46b90f,0xc9))['catch'](handleError(_0x46b90f,null));};exports[_0x0b4d('0x22')]=function(_0x36e20d,_0x527e64){if(_0x36e20d[_0x0b4d('0x48')]['id']){delete _0x36e20d[_0x0b4d('0x48')]['id'];}return db[_0x0b4d('0x29')][_0x0b4d('0x45')]({'where':{'id':_0x36e20d['params']['id']}})[_0x0b4d('0x23')](handleEntityNotFound(_0x527e64,null))['then'](saveUpdates(_0x36e20d[_0x0b4d('0x48')],null))[_0x0b4d('0x23')](respondWithResult(_0x527e64,null))[_0x0b4d('0x46')](handleError(_0x527e64,null));};exports[_0x0b4d('0x24')]=function(_0x415816,_0x5f2eb3){return db[_0x0b4d('0x29')][_0x0b4d('0x45')]({'where':{'id':_0x415816[_0x0b4d('0x43')]['id']}})[_0x0b4d('0x23')](handleEntityNotFound(_0x5f2eb3,null))[_0x0b4d('0x23')](removeEntity(_0x5f2eb3,null))['catch'](handleError(_0x5f2eb3,null));};exports[_0x0b4d('0x4d')]=function(_0x121695,_0x3fbd8e){return db[_0x0b4d('0x29')][_0x0b4d('0x4d')]()[_0x0b4d('0x23')](respondWithResult(_0x3fbd8e,null))[_0x0b4d('0x46')](handleError(_0x3fbd8e,null));};exports['getProducts']=function(_0x410a04,_0x463357,_0x5caad6){var _0x2621a1={'raw':![],'where':{}};var _0x5a015c={};var _0x3db5fa={'count':0x0,'rows':[]};return db[_0x0b4d('0x29')][_0x0b4d('0x4e')]({'where':{'id':_0x410a04[_0x0b4d('0x43')]['id']}})['then'](handleEntityNotFound(_0x463357,null))[_0x0b4d('0x23')](function(_0xc94d61){if(_0xc94d61){_0x5a015c[_0x0b4d('0x2b')]=_[_0x0b4d('0x44')](db['SAProductPricesList'][_0x0b4d('0x2a')]);_0x5a015c['query']=_[_0x0b4d('0x44')](_0x410a04[_0x0b4d('0x2c')]);_0x5a015c[_0x0b4d('0x2d')]=_[_0x0b4d('0x2f')](_0x5a015c['model'],_0x5a015c[_0x0b4d('0x2c')]);_0x2621a1[_0x0b4d('0x2e')]=_[_0x0b4d('0x2f')](_0x5a015c[_0x0b4d('0x2b')],qs[_0x0b4d('0x30')](_0x410a04[_0x0b4d('0x2c')][_0x0b4d('0x30')]));_0x2621a1[_0x0b4d('0x2e')]=_0x2621a1[_0x0b4d('0x2e')][_0x0b4d('0x31')]?_0x2621a1[_0x0b4d('0x2e')]:_0x5a015c['model'];if(!_0x410a04['query'][_0x0b4d('0x32')](_0x0b4d('0x33'))){_0x2621a1[_0x0b4d('0x34')]=qs[_0x0b4d('0x34')](_0x410a04[_0x0b4d('0x2c')][_0x0b4d('0x34')]);_0x2621a1[_0x0b4d('0x1c')]=qs[_0x0b4d('0x1c')](_0x410a04[_0x0b4d('0x2c')][_0x0b4d('0x1c')]);}_0x2621a1[_0x0b4d('0x35')]=qs[_0x0b4d('0x36')](_0x410a04[_0x0b4d('0x2c')]['sort']);_0x2621a1['where']=qs[_0x0b4d('0x2d')](_[_0x0b4d('0x4f')](_0x410a04['query'],_0x5a015c['filters']));_0x2621a1['where'][_0x0b4d('0x50')]=_0xc94d61['id'];if(_0x410a04['query']['filter']){_0x2621a1[_0x0b4d('0x37')]=_[_0x0b4d('0x39')](_0x2621a1[_0x0b4d('0x37')],{'$or':_[_0x0b4d('0x51')](_0x2621a1[_0x0b4d('0x2e')],function(_0x934c3d){var _0x39c123={};_0x39c123[_0x934c3d]={'$like':'%'+_0x410a04[_0x0b4d('0x2c')][_0x0b4d('0x38')]+'%'};return _0x39c123;})});}_0x2621a1=_['merge']({},_0x2621a1,_0x410a04['options']);return db[_0x0b4d('0x52')]['count']({'where':_0x2621a1['where']})[_0x0b4d('0x23')](function(_0x1015f8){_0x3db5fa['count']=_0x1015f8;if(_0x410a04[_0x0b4d('0x2c')]['includeAll']){_0x2621a1['include']=[{'model':db['SAProduct'],'as':_0x0b4d('0x53'),'include':[{'all':!![]}]},{'model':db[_0x0b4d('0x29')],'as':_0x0b4d('0x54')}];}return db[_0x0b4d('0x52')][_0x0b4d('0x40')](_0x2621a1);})[_0x0b4d('0x23')](function(_0x3f1b9f){_0x3db5fa[_0x0b4d('0x41')]=_0x3f1b9f;return _0x3db5fa;});}})[_0x0b4d('0x23')](respondWithFilteredResult(_0x463357,_0x2621a1))[_0x0b4d('0x46')](handleError(_0x463357,null));};exports[_0x0b4d('0x55')]=function(_0x473465,_0x492ef8,_0x117208){if(_0x473465[_0x0b4d('0x48')]['id']){delete _0x473465['body']['id'];}return db['SAPriceList'][_0x0b4d('0x45')]({'where':{'id':_0x473465['params']['id']}})[_0x0b4d('0x23')](handleEntityNotFound(_0x492ef8,null))[_0x0b4d('0x23')](function(_0x51a2de){if(_0x51a2de){_0x473465[_0x0b4d('0x48')][_0x0b4d('0x50')]=_0x51a2de['id'];return db[_0x0b4d('0x52')][_0x0b4d('0x47')](_0x473465[_0x0b4d('0x48')]);}})[_0x0b4d('0x23')](respondWithResult(_0x492ef8,null))['catch'](handleError(_0x492ef8,null));};exports['removeProducts']=function(_0x133993,_0x2d6f0c,_0x30c2e3){return db[_0x0b4d('0x52')][_0x0b4d('0x45')]({'where':{'id':_0x133993[_0x0b4d('0x43')]['id']}})[_0x0b4d('0x23')](handleEntityNotFound(_0x2d6f0c,null))[_0x0b4d('0x23')](function(_0x3a5090){if(_0x3a5090){return _0x3a5090[_0x0b4d('0x56')](_0x133993[_0x0b4d('0x2c')]['ids']);}})['then'](respondWithStatusCode(_0x2d6f0c,null))[_0x0b4d('0x46')](handleError(_0x2d6f0c,null));}; \ No newline at end of file +var _0x6176=['includeAll','include','company','findAll','rows','catch','params','create','body','clone','rawAttributes','find','get','omit','createdAt','updatedAt','describe','findOne','PriceListId','Product','Pricelist','addProduct','SAProductPricesList','removeProducts','html-pdf','eml-format','rimraf','moment','util','sox','to-csv','ejs','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','name','send','index','SAPriceList','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','count'];(function(_0x5dd789,_0x2913ff){var _0x25db71=function(_0x54fba2){while(--_0x54fba2){_0x5dd789['push'](_0x5dd789['shift']());}};_0x25db71(++_0x2913ff);}(_0x6176,0x69));var _0x6617=function(_0x3af760,_0x3784ba){_0x3af760=_0x3af760-0x0;var _0x337df6=_0x6176[_0x3af760];return _0x337df6;};'use strict';var pdf=require(_0x6617('0x0'));var emlformat=require(_0x6617('0x1'));var rimraf=require(_0x6617('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6617('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6617('0x4'));var path=require('path');var sox=require(_0x6617('0x5'));var csv=require(_0x6617('0x6'));var ejs=require(_0x6617('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6617('0x8'));var jsforce=require(_0x6617('0x9'));var deskjs=require(_0x6617('0xa'));var toCsv=require(_0x6617('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6617('0xb'));var authService=require(_0x6617('0xc'));var qs=require(_0x6617('0xd'));var hardwareService=require(_0x6617('0xe'));var logger=require(_0x6617('0xf'))(_0x6617('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6617('0x11'))['db'];function respondWithStatusCode(_0x5407ff,_0x23e679){_0x23e679=_0x23e679||0xcc;return function(_0x2a404d){if(_0x2a404d){return _0x5407ff[_0x6617('0x12')](_0x23e679);}return _0x5407ff[_0x6617('0x13')](_0x23e679)['end']();};}function respondWithResult(_0x2854da,_0x5e62dd){_0x5e62dd=_0x5e62dd||0xc8;return function(_0x3da0d3){if(_0x3da0d3){return _0x2854da[_0x6617('0x13')](_0x5e62dd)[_0x6617('0x14')](_0x3da0d3);}};}function respondWithFilteredResult(_0x1e62a7,_0x5d35fc){return function(_0x58478e){if(_0x58478e){var _0x27cc7b=_0x58478e['count'],_0x543e0a=_0x5d35fc[_0x6617('0x15')],_0x28199c=_0x5d35fc[_0x6617('0x15')]+_0x5d35fc[_0x6617('0x16')],_0x405a18;if(_0x28199c>=_0x27cc7b){_0x28199c=_0x27cc7b;_0x405a18=0xc8;}else{_0x405a18=0xce;}_0x1e62a7[_0x6617('0x13')](_0x405a18);return _0x1e62a7[_0x6617('0x17')](_0x6617('0x18'),_0x543e0a+'-'+_0x28199c+'/'+_0x27cc7b)[_0x6617('0x14')](_0x58478e);}return null;};}function patchUpdates(_0x3a74c9){return function(_0x3191a9){try{jsonpatch[_0x6617('0x19')](_0x3191a9,_0x3a74c9,!![]);}catch(_0x245090){return BPromise['reject'](_0x245090);}return _0x3191a9[_0x6617('0x1a')]();};}function saveUpdates(_0x47989a,_0x53989d){return function(_0x3d310d){if(_0x3d310d){return _0x3d310d[_0x6617('0x1b')](_0x47989a)[_0x6617('0x1c')](function(_0x33bd21){return _0x33bd21;});}return null;};}function removeEntity(_0x14536a,_0x1b8d00){return function(_0x5be05d){if(_0x5be05d){return _0x5be05d[_0x6617('0x1d')]()[_0x6617('0x1c')](function(){_0x14536a[_0x6617('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c4aad,_0x15bc8b){return function(_0x573f45){if(!_0x573f45){_0x3c4aad[_0x6617('0x12')](0x194);}return _0x573f45;};}function handleError(_0x54620e,_0x227749){_0x227749=_0x227749||0x1f4;return function(_0x3c54c7){logger['error'](_0x3c54c7['stack']);if(_0x3c54c7[_0x6617('0x1e')]){delete _0x3c54c7[_0x6617('0x1e')];}_0x54620e['status'](_0x227749)[_0x6617('0x1f')](_0x3c54c7);};}exports[_0x6617('0x20')]=function(_0x515939,_0x44423f){var _0x13dc1a={},_0x3b65a1={},_0x3e6b69={'count':0x0,'rows':[]};var _0x34ffec=db[_0x6617('0x21')]['rawAttributes'];_0x3b65a1['model']=_[_0x6617('0x22')](_0x34ffec);_0x3b65a1[_0x6617('0x23')]=_[_0x6617('0x22')](_0x515939[_0x6617('0x23')]);_0x3b65a1[_0x6617('0x24')]=_[_0x6617('0x25')](_0x3b65a1[_0x6617('0x26')],_0x3b65a1[_0x6617('0x23')]);_0x13dc1a[_0x6617('0x27')]=_[_0x6617('0x25')](_0x3b65a1[_0x6617('0x26')],qs[_0x6617('0x28')](_0x515939[_0x6617('0x23')][_0x6617('0x28')]));_0x13dc1a[_0x6617('0x27')]=_0x13dc1a['attributes'][_0x6617('0x29')]?_0x13dc1a[_0x6617('0x27')]:_0x3b65a1[_0x6617('0x26')];if(!_0x515939['query'][_0x6617('0x2a')](_0x6617('0x2b'))){_0x13dc1a[_0x6617('0x16')]=qs[_0x6617('0x16')](_0x515939['query'][_0x6617('0x16')]);_0x13dc1a[_0x6617('0x15')]=qs[_0x6617('0x15')](_0x515939[_0x6617('0x23')]['offset']);}_0x13dc1a[_0x6617('0x2c')]=qs['sort'](_0x515939[_0x6617('0x23')][_0x6617('0x2d')]);_0x13dc1a[_0x6617('0x2e')]=qs[_0x6617('0x24')](_[_0x6617('0x2f')](_0x515939['query'],_0x3b65a1[_0x6617('0x24')]));if(_0x515939[_0x6617('0x23')][_0x6617('0x30')]){_0x13dc1a['where']=_['merge'](_0x13dc1a[_0x6617('0x2e')],{'$or':_[_0x6617('0x31')](_0x34ffec,function(_0x5dcc66){if(_0x5dcc66[_0x6617('0x32')][_0x6617('0x33')]!==_0x6617('0x34')){var _0x49355f={};_0x49355f[_0x5dcc66[_0x6617('0x35')]]={'$like':'%'+_0x515939['query'][_0x6617('0x30')]+'%'};return _0x49355f;}})});}_0x13dc1a=_[_0x6617('0x36')]({},_0x13dc1a,_0x515939[_0x6617('0x37')]);var _0x2b51c4={'where':_0x13dc1a['where']};return db[_0x6617('0x21')][_0x6617('0x38')](_0x2b51c4)[_0x6617('0x1c')](function(_0x48c42a){_0x3e6b69[_0x6617('0x38')]=_0x48c42a;if(_0x515939[_0x6617('0x23')][_0x6617('0x39')]){_0x13dc1a[_0x6617('0x3a')]=[{'model':db['CmCompany'],'as':_0x6617('0x3b')}];}return db[_0x6617('0x21')][_0x6617('0x3c')](_0x13dc1a);})['then'](function(_0x29062d){_0x3e6b69[_0x6617('0x3d')]=_0x29062d;return _0x3e6b69;})['then'](respondWithFilteredResult(_0x44423f,_0x13dc1a))[_0x6617('0x3e')](handleError(_0x44423f,null));};exports['show']=function(_0x25c1da,_0x255a31){var _0x2391a9={'raw':![],'where':{'id':_0x25c1da[_0x6617('0x3f')]['id']}},_0x43452f={};_0x43452f[_0x6617('0x26')]=_[_0x6617('0x22')](db[_0x6617('0x21')]['rawAttributes']);_0x43452f['query']=_['keys'](_0x25c1da['query']);_0x43452f[_0x6617('0x24')]=_[_0x6617('0x25')](_0x43452f['model'],_0x43452f[_0x6617('0x23')]);_0x2391a9['attributes']=_[_0x6617('0x25')](_0x43452f[_0x6617('0x26')],qs[_0x6617('0x28')](_0x25c1da[_0x6617('0x23')][_0x6617('0x28')]));_0x2391a9[_0x6617('0x27')]=_0x2391a9['attributes'][_0x6617('0x29')]?_0x2391a9[_0x6617('0x27')]:_0x43452f[_0x6617('0x26')];if(_0x25c1da[_0x6617('0x23')][_0x6617('0x39')]){_0x2391a9[_0x6617('0x3a')]=[{'all':!![]}];}_0x2391a9=_[_0x6617('0x36')]({},_0x2391a9,_0x25c1da[_0x6617('0x37')]);return db[_0x6617('0x21')]['find'](_0x2391a9)[_0x6617('0x1c')](handleEntityNotFound(_0x255a31,null))['then'](respondWithResult(_0x255a31,null))[_0x6617('0x3e')](handleError(_0x255a31,null));};exports[_0x6617('0x40')]=function(_0x3b9167,_0x3543b1){return db[_0x6617('0x21')][_0x6617('0x40')](_0x3b9167[_0x6617('0x41')],{})[_0x6617('0x1c')](respondWithResult(_0x3543b1,0xc9))['catch'](handleError(_0x3543b1,null));};exports[_0x6617('0x42')]=function(_0x32df1c,_0xc9f23a){var _0x292b40={'raw':![],'where':{'id':_0x32df1c[_0x6617('0x3f')]['id']}},_0x575195={};_0x575195[_0x6617('0x26')]=_[_0x6617('0x22')](db['SAPriceList'][_0x6617('0x43')]);_0x292b40[_0x6617('0x27')]=_[_0x6617('0x25')](_0x575195[_0x6617('0x26')],qs[_0x6617('0x28')](_0x32df1c[_0x6617('0x23')][_0x6617('0x28')]));_0x292b40['attributes']=_0x292b40['attributes'][_0x6617('0x29')]?_0x292b40['attributes']:_0x575195[_0x6617('0x26')];if(_0x32df1c[_0x6617('0x23')][_0x6617('0x39')]){_0x292b40[_0x6617('0x3a')]=[{'all':!![]}];}_0x292b40=_[_0x6617('0x36')]({},_0x292b40,_0x32df1c['options']);return db[_0x6617('0x21')][_0x6617('0x44')](_0x292b40)['then'](handleEntityNotFound(_0xc9f23a,null))[_0x6617('0x1c')](function(_0x1db51b){if(_0x1db51b){var _0x4c6e86=_0x1db51b[_0x6617('0x45')]({'plain':!![]});_0x4c6e86=qs[_0x6617('0x46')](_0x4c6e86,['id',_0x6617('0x47'),_0x6617('0x48')]);_0x32df1c[_0x6617('0x41')]=_['omit'](_0x32df1c[_0x6617('0x41')],['id',_0x6617('0x47'),'updatedAt']);return db[_0x6617('0x21')][_0x6617('0x40')](_['merge'](_0x4c6e86,_0x32df1c[_0x6617('0x41')]),{'include':_0x32df1c['query'][_0x6617('0x39')]?[{'all':!![]}]:undefined});}})[_0x6617('0x1c')](respondWithResult(_0xc9f23a,0xc9))[_0x6617('0x3e')](handleError(_0xc9f23a,null));};exports[_0x6617('0x1b')]=function(_0x3c69e7,_0x1f3e17){if(_0x3c69e7[_0x6617('0x41')]['id']){delete _0x3c69e7[_0x6617('0x41')]['id'];}return db[_0x6617('0x21')][_0x6617('0x44')]({'where':{'id':_0x3c69e7[_0x6617('0x3f')]['id']}})[_0x6617('0x1c')](handleEntityNotFound(_0x1f3e17,null))['then'](saveUpdates(_0x3c69e7['body'],null))[_0x6617('0x1c')](respondWithResult(_0x1f3e17,null))[_0x6617('0x3e')](handleError(_0x1f3e17,null));};exports['destroy']=function(_0x50fa14,_0x30ac46){return db[_0x6617('0x21')]['find']({'where':{'id':_0x50fa14['params']['id']}})[_0x6617('0x1c')](handleEntityNotFound(_0x30ac46,null))[_0x6617('0x1c')](removeEntity(_0x30ac46,null))[_0x6617('0x3e')](handleError(_0x30ac46,null));};exports[_0x6617('0x49')]=function(_0x27b6e2,_0x227edb){return db[_0x6617('0x21')][_0x6617('0x49')]()['then'](respondWithResult(_0x227edb,null))['catch'](handleError(_0x227edb,null));};exports['getProducts']=function(_0x398c1f,_0xceb91b,_0x4292a4){var _0x520653={'raw':![],'where':{}};var _0x2c153f={};var _0x2eea36={'count':0x0,'rows':[]};return db[_0x6617('0x21')][_0x6617('0x4a')]({'where':{'id':_0x398c1f[_0x6617('0x3f')]['id']}})['then'](handleEntityNotFound(_0xceb91b,null))[_0x6617('0x1c')](function(_0xe3d4e4){if(_0xe3d4e4){_0x2c153f[_0x6617('0x26')]=_['keys'](db['SAProductPricesList'][_0x6617('0x43')]);_0x2c153f[_0x6617('0x23')]=_[_0x6617('0x22')](_0x398c1f[_0x6617('0x23')]);_0x2c153f[_0x6617('0x24')]=_[_0x6617('0x25')](_0x2c153f[_0x6617('0x26')],_0x2c153f[_0x6617('0x23')]);_0x520653[_0x6617('0x27')]=_[_0x6617('0x25')](_0x2c153f[_0x6617('0x26')],qs[_0x6617('0x28')](_0x398c1f[_0x6617('0x23')][_0x6617('0x28')]));_0x520653['attributes']=_0x520653[_0x6617('0x27')][_0x6617('0x29')]?_0x520653[_0x6617('0x27')]:_0x2c153f[_0x6617('0x26')];if(!_0x398c1f[_0x6617('0x23')][_0x6617('0x2a')](_0x6617('0x2b'))){_0x520653[_0x6617('0x16')]=qs['limit'](_0x398c1f[_0x6617('0x23')][_0x6617('0x16')]);_0x520653[_0x6617('0x15')]=qs[_0x6617('0x15')](_0x398c1f[_0x6617('0x23')][_0x6617('0x15')]);}_0x520653[_0x6617('0x2c')]=qs['sort'](_0x398c1f['query'][_0x6617('0x2d')]);_0x520653[_0x6617('0x2e')]=qs[_0x6617('0x24')](_[_0x6617('0x2f')](_0x398c1f[_0x6617('0x23')],_0x2c153f[_0x6617('0x24')]));_0x520653[_0x6617('0x2e')][_0x6617('0x4b')]=_0xe3d4e4['id'];if(_0x398c1f[_0x6617('0x23')][_0x6617('0x30')]){_0x520653['where']=_[_0x6617('0x36')](_0x520653[_0x6617('0x2e')],{'$or':_[_0x6617('0x31')](_0x520653['attributes'],function(_0x265d98){var _0x458f0d={};_0x458f0d[_0x265d98]={'$like':'%'+_0x398c1f['query'][_0x6617('0x30')]+'%'};return _0x458f0d;})});}_0x520653=_[_0x6617('0x36')]({},_0x520653,_0x398c1f[_0x6617('0x37')]);return db['SAProductPricesList'][_0x6617('0x38')]({'where':_0x520653['where']})[_0x6617('0x1c')](function(_0x115342){_0x2eea36[_0x6617('0x38')]=_0x115342;if(_0x398c1f[_0x6617('0x23')][_0x6617('0x39')]){_0x520653[_0x6617('0x3a')]=[{'model':db['SAProduct'],'as':_0x6617('0x4c'),'include':[{'all':!![]}]},{'model':db[_0x6617('0x21')],'as':_0x6617('0x4d')}];}return db['SAProductPricesList'][_0x6617('0x3c')](_0x520653);})[_0x6617('0x1c')](function(_0x5bef72){_0x2eea36[_0x6617('0x3d')]=_0x5bef72;return _0x2eea36;});}})[_0x6617('0x1c')](respondWithFilteredResult(_0xceb91b,_0x520653))['catch'](handleError(_0xceb91b,null));};exports[_0x6617('0x4e')]=function(_0x9ce966,_0x5d66a8,_0x3e1982){if(_0x9ce966[_0x6617('0x41')]['id']){delete _0x9ce966['body']['id'];}return db[_0x6617('0x21')][_0x6617('0x44')]({'where':{'id':_0x9ce966['params']['id']}})[_0x6617('0x1c')](handleEntityNotFound(_0x5d66a8,null))[_0x6617('0x1c')](function(_0x1263cb){if(_0x1263cb){_0x9ce966[_0x6617('0x41')][_0x6617('0x4b')]=_0x1263cb['id'];return db[_0x6617('0x4f')]['create'](_0x9ce966[_0x6617('0x41')]);}})[_0x6617('0x1c')](respondWithResult(_0x5d66a8,null))[_0x6617('0x3e')](handleError(_0x5d66a8,null));};exports[_0x6617('0x50')]=function(_0x2b2b81,_0xf0bc04,_0x38d9a5){return db[_0x6617('0x4f')]['find']({'where':{'id':_0x2b2b81[_0x6617('0x3f')]['id']}})[_0x6617('0x1c')](handleEntityNotFound(_0xf0bc04,null))[_0x6617('0x1c')](function(_0x55b999){if(_0x55b999){return _0x55b999[_0x6617('0x50')](_0x2b2b81['query']['ids']);}})[_0x6617('0x1c')](respondWithStatusCode(_0xf0bc04,null))[_0x6617('0x3e')](handleError(_0xf0bc04,null));}; \ No newline at end of file diff --git a/server/api/saPriceList/saPriceList.model.js b/server/api/saPriceList/saPriceList.model.js index af2a713..7c0e656 100644 --- a/server/api/saPriceList/saPriceList.model.js +++ b/server/api/saPriceList/saPriceList.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./saPriceList.attributes','exports','define','sa_price_list','lodash','../../config/logger'];(function(_0x24f870,_0x2c8a88){var _0x5d065b=function(_0x168247){while(--_0x168247){_0x24f870['push'](_0x24f870['shift']());}};_0x5d065b(++_0x2c8a88);}(_0xb10b,0x12a));var _0xbb10=function(_0x2ca0cf,_0x2f56c3){_0x2ca0cf=_0x2ca0cf-0x0;var _0x12e852=_0xb10b[_0x2ca0cf];return _0x12e852;};'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')]('SAPriceList',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./saPriceList.attributes','exports','define','sa_price_list','lodash','../../config/logger'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0xb10b,0x12a));var _0xbb10=function(_0x36bbbb,_0x3f6709){_0x36bbbb=_0x36bbbb-0x0;var _0x3ca0eb=_0xb10b[_0x36bbbb];return _0x3ca0eb;};'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')]('SAPriceList',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saPriceList/saPriceList.rpc.js b/server/api/saPriceList/saPriceList.rpc.js index f18908d..0bd5687 100644 --- a/server/api/saPriceList/saPriceList.rpc.js +++ b/server/api/saPriceList/saPriceList.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdccf=['stringify','error','code','SAPriceList,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','SAPriceList,\x20%s,\x20%s,\x20%s'];(function(_0x3a9f07,_0x402524){var _0x58350e=function(_0x3fbd0f){while(--_0x3fbd0f){_0x3a9f07['push'](_0x3a9f07['shift']());}};_0x58350e(++_0x402524);}(_0xdccf,0x1d3));var _0xfdcc=function(_0x5bacac,_0x2dbcd8){_0x5bacac=_0x5bacac-0x0;var _0x4e4be0=_0xdccf[_0x5bacac];return _0x4e4be0;};'use strict';var _=require(_0xfdcc('0x0'));var util=require(_0xfdcc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfdcc('0x2'));var fs=require('fs');var Redis=require(_0xfdcc('0x3'));var db=require(_0xfdcc('0x4'))['db'];var utils=require(_0xfdcc('0x5'));var logger=require('../../config/logger')(_0xfdcc('0x6'));var config=require(_0xfdcc('0x7'));var jayson=require(_0xfdcc('0x8'));var client=jayson[_0xfdcc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23347f,_0x4bfb20,_0x341d7e){return new BPromise(function(_0x297447,_0x173ffb){return client[_0xfdcc('0xa')](_0x23347f,_0x341d7e)[_0xfdcc('0xb')](function(_0x112a22){logger[_0xfdcc('0xc')]('SAPriceList,\x20%s,\x20%s',_0x4bfb20,_0xfdcc('0xd'));logger[_0xfdcc('0xe')](_0xfdcc('0xf'),_0x4bfb20,_0xfdcc('0xd'),JSON[_0xfdcc('0x10')](_0x112a22));if(_0x112a22[_0xfdcc('0x11')]){if(_0x112a22[_0xfdcc('0x11')][_0xfdcc('0x12')]===0x1f4){logger['error'](_0xfdcc('0x13'),_0x4bfb20,_0x112a22[_0xfdcc('0x11')][_0xfdcc('0x14')]);return _0x173ffb(_0x112a22['error']['message']);}logger[_0xfdcc('0x11')](_0xfdcc('0x13'),_0x4bfb20,_0x112a22[_0xfdcc('0x11')][_0xfdcc('0x14')]);return _0x297447(_0x112a22[_0xfdcc('0x11')][_0xfdcc('0x14')]);}else{logger[_0xfdcc('0xc')](_0xfdcc('0x13'),_0x4bfb20,_0xfdcc('0xd'));_0x297447(_0x112a22[_0xfdcc('0x15')][_0xfdcc('0x14')]);}})[_0xfdcc('0x16')](function(_0x2026db){logger[_0xfdcc('0x11')](_0xfdcc('0x13'),_0x4bfb20,_0x2026db);_0x173ffb(_0x2026db);});});} \ No newline at end of file +var _0xe874=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SAPriceList,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','moment'];(function(_0x25b6be,_0x1af155){var _0x26c1d8=function(_0x24f570){while(--_0x24f570){_0x25b6be['push'](_0x25b6be['shift']());}};_0x26c1d8(++_0x1af155);}(_0xe874,0x105));var _0x4e87=function(_0x10e2c9,_0x489aab){_0x10e2c9=_0x10e2c9-0x0;var _0x426947=_0xe874[_0x10e2c9];return _0x426947;};'use strict';var _=require(_0x4e87('0x0'));var util=require(_0x4e87('0x1'));var moment=require(_0x4e87('0x2'));var BPromise=require(_0x4e87('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4e87('0x4'));var db=require(_0x4e87('0x5'))['db'];var utils=require(_0x4e87('0x6'));var logger=require(_0x4e87('0x7'))(_0x4e87('0x8'));var config=require(_0x4e87('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4e87('0xa')][_0x4e87('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d67e7,_0x408997,_0x4d0544){return new BPromise(function(_0x3122ce,_0x5e8a04){return client[_0x4e87('0xc')](_0x4d67e7,_0x4d0544)[_0x4e87('0xd')](function(_0x1c657c){logger[_0x4e87('0xe')](_0x4e87('0xf'),_0x408997,_0x4e87('0x10'));logger[_0x4e87('0x11')]('SAPriceList,\x20%s,\x20%s,\x20%s',_0x408997,_0x4e87('0x10'),JSON['stringify'](_0x1c657c));if(_0x1c657c[_0x4e87('0x12')]){if(_0x1c657c[_0x4e87('0x12')][_0x4e87('0x13')]===0x1f4){logger[_0x4e87('0x12')]('SAPriceList,\x20%s,\x20%s',_0x408997,_0x1c657c[_0x4e87('0x12')]['message']);return _0x5e8a04(_0x1c657c[_0x4e87('0x12')][_0x4e87('0x14')]);}logger[_0x4e87('0x12')]('SAPriceList,\x20%s,\x20%s',_0x408997,_0x1c657c['error'][_0x4e87('0x14')]);return _0x3122ce(_0x1c657c['error'][_0x4e87('0x14')]);}else{logger[_0x4e87('0xe')](_0x4e87('0xf'),_0x408997,_0x4e87('0x10'));_0x3122ce(_0x1c657c['result'][_0x4e87('0x14')]);}})[_0x4e87('0x15')](function(_0x330e35){logger[_0x4e87('0x12')](_0x4e87('0xf'),_0x408997,_0x330e35);_0x5e8a04(_0x330e35);});});} \ No newline at end of file diff --git a/server/api/saProduct/index.js b/server/api/saProduct/index.js index 748db05..4e17988 100644 --- a/server/api/saProduct/index.js +++ b/server/api/saProduct/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x75e0=['/:id','show','post','/:id/clone','clone','update','multer','util','path','express','Router','../../components/interaction/service','./saProduct.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x27432f,_0x24582e){var _0x282119=function(_0x47b535){while(--_0x47b535){_0x27432f['push'](_0x27432f['shift']());}};_0x282119(++_0x24582e);}(_0x75e0,0x1c8));var _0x075e=function(_0x3b4ffe,_0xdefc09){_0x3b4ffe=_0x3b4ffe-0x0;var _0x1b67f7=_0x75e0[_0x3b4ffe];return _0x1b67f7;};'use strict';var multer=require(_0x075e('0x0'));var util=require(_0x075e('0x1'));var path=require(_0x075e('0x2'));var timeout=require('connect-timeout');var express=require(_0x075e('0x3'));var router=express[_0x075e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x075e('0x5'));var config=require('../../config/environment');var controller=require(_0x075e('0x6'));router[_0x075e('0x7')]('/',auth[_0x075e('0x8')](),controller[_0x075e('0x9')]);router[_0x075e('0x7')](_0x075e('0xa'),auth[_0x075e('0x8')](),controller[_0x075e('0xb')]);router[_0x075e('0x7')](_0x075e('0xc'),auth[_0x075e('0x8')](),controller[_0x075e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x075e('0xe')](_0x075e('0xf'),auth[_0x075e('0x8')](),controller[_0x075e('0x10')]);router['put'](_0x075e('0xc'),auth[_0x075e('0x8')](),controller[_0x075e('0x11')]);module['exports']=router; \ No newline at end of file +var _0x03f8=['describe','show','create','/:id/clone','put','/:id','update','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saProduct.controller','get','isAuthenticated','index'];(function(_0x29285f,_0x304093){var _0xed5aa2=function(_0x1d5328){while(--_0x1d5328){_0x29285f['push'](_0x29285f['shift']());}};_0xed5aa2(++_0x304093);}(_0x03f8,0x1d0));var _0x803f=function(_0x1d5d4a,_0x44102d){_0x1d5d4a=_0x1d5d4a-0x0;var _0x348926=_0x03f8[_0x1d5d4a];return _0x348926;};'use strict';var multer=require(_0x803f('0x0'));var util=require(_0x803f('0x1'));var path=require('path');var timeout=require(_0x803f('0x2'));var express=require('express');var router=express[_0x803f('0x3')]();var auth=require(_0x803f('0x4'));var interaction=require(_0x803f('0x5'));var config=require(_0x803f('0x6'));var controller=require(_0x803f('0x7'));router[_0x803f('0x8')]('/',auth[_0x803f('0x9')](),controller[_0x803f('0xa')]);router[_0x803f('0x8')]('/describe',auth[_0x803f('0x9')](),controller[_0x803f('0xb')]);router[_0x803f('0x8')]('/:id',auth[_0x803f('0x9')](),controller[_0x803f('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x803f('0xd')]);router['post'](_0x803f('0xe'),auth[_0x803f('0x9')](),controller['clone']);router[_0x803f('0xf')](_0x803f('0x10'),auth[_0x803f('0x9')](),controller[_0x803f('0x11')]);module[_0x803f('0x12')]=router; \ No newline at end of file diff --git a/server/api/saProduct/saProduct.attributes.js b/server/api/saProduct/saProduct.attributes.js index 0075984..8510716 100644 --- a/server/api/saProduct/saProduct.attributes.js +++ b/server/api/saProduct/saProduct.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ea1=['DECIMAL','INTEGER','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','sequelize','exports','STRING','name','productcode'];(function(_0x303cbd,_0x2cc128){var _0x5297c5=function(_0x1d6cd4){while(--_0x1d6cd4){_0x303cbd['push'](_0x303cbd['shift']());}};_0x5297c5(++_0x2cc128);}(_0x2ea1,0xca));var _0x12ea=function(_0x34629f,_0x5d105d){_0x34629f=_0x34629f-0x0;var _0x5d6106=_0x2ea1[_0x34629f];return _0x5d6106;};'use strict';var Sequelize=require(_0x12ea('0x0'));module[_0x12ea('0x1')]={'name':{'type':Sequelize[_0x12ea('0x2')],'allowNull':![],'unique':_0x12ea('0x3')},'productcode':{'type':Sequelize[_0x12ea('0x2')],'allowNull':![],'unique':_0x12ea('0x4')},'netprice':{'type':Sequelize[_0x12ea('0x5')](0xd,0x4),'allowNull':![]},'tax':{'type':Sequelize[_0x12ea('0x6')],'allowNull':![]},'description':{'type':Sequelize['TEXT'](_0x12ea('0x7'))+_0x12ea('0x8')},'qtymin':{'type':Sequelize[_0x12ea('0x5')](0xd,0x4),'allowNull':!![]},'phaseout':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'allowNull':![]}}; \ No newline at end of file +var _0x37e9=['name','productcode','DECIMAL','TEXT','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','BOOLEAN','sequelize','exports','STRING'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x37e9,0x1e7));var _0x937e=function(_0x3ea27d,_0x1bffef){_0x3ea27d=_0x3ea27d-0x0;var _0x193cab=_0x37e9[_0x3ea27d];return _0x193cab;};'use strict';var Sequelize=require(_0x937e('0x0'));module[_0x937e('0x1')]={'name':{'type':Sequelize[_0x937e('0x2')],'allowNull':![],'unique':_0x937e('0x3')},'productcode':{'type':Sequelize[_0x937e('0x2')],'allowNull':![],'unique':_0x937e('0x4')},'netprice':{'type':Sequelize[_0x937e('0x5')](0xd,0x4),'allowNull':![]},'tax':{'type':Sequelize['INTEGER'],'allowNull':![]},'description':{'type':Sequelize[_0x937e('0x6')](_0x937e('0x7'))+_0x937e('0x8')},'qtymin':{'type':Sequelize[_0x937e('0x5')](0xd,0x4),'allowNull':!![]},'phaseout':{'type':Sequelize[_0x937e('0x9')],'defaultValue':0x0,'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/saProduct/saProduct.controller.js b/server/api/saProduct/saProduct.controller.js index 98a4125..c4d95f1 100644 --- a/server/api/saProduct/saProduct.controller.js +++ b/server/api/saProduct/saProduct.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4395=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','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','stack','name','index','SAProduct','rawAttributes','keys','query','filters','intersection','model','attributes','fields','order','sort','where','pick','filter','merge','map','type','key','field','options','findAll','rows','catch','show','params','length','include','create','body','clone','includeAll','find','get','omit','updatedAt','createdAt','describe','html-pdf','eml-format','rimraf'];(function(_0x10e653,_0x59f1cc){var _0x328dfd=function(_0x2bc428){while(--_0x2bc428){_0x10e653['push'](_0x10e653['shift']());}};_0x328dfd(++_0x59f1cc);}(_0x4395,0x183));var _0x5439=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4395[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x5439('0x0'));var emlformat=require(_0x5439('0x1'));var rimraf=require(_0x5439('0x2'));var zipdir=require(_0x5439('0x3'));var jsonpatch=require(_0x5439('0x4'));var rp=require(_0x5439('0x5'));var moment=require(_0x5439('0x6'));var BPromise=require(_0x5439('0x7'));var Mustache=require(_0x5439('0x8'));var util=require(_0x5439('0x9'));var path=require('path');var sox=require(_0x5439('0xa'));var csv=require(_0x5439('0xb'));var ejs=require(_0x5439('0xc'));var fs=require('fs');var _=require(_0x5439('0xd'));var squel=require('squel');var crypto=require(_0x5439('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5439('0xf'));var toCsv=require(_0x5439('0xb'));var querystring=require('querystring');var Papa=require(_0x5439('0x10'));var Redis=require(_0x5439('0x11'));var authService=require(_0x5439('0x12'));var qs=require(_0x5439('0x13'));var hardwareService=require(_0x5439('0x14'));var logger=require(_0x5439('0x15'))('api');var utils=require(_0x5439('0x16'));var config=require(_0x5439('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x562101,_0x36a388){_0x36a388=_0x36a388||0xcc;return function(_0x12368b){if(_0x12368b){return _0x562101[_0x5439('0x18')](_0x36a388);}return _0x562101[_0x5439('0x19')](_0x36a388)[_0x5439('0x1a')]();};}function respondWithResult(_0xb08a4e,_0x285e11){_0x285e11=_0x285e11||0xc8;return function(_0x52b674){if(_0x52b674){return _0xb08a4e[_0x5439('0x19')](_0x285e11)[_0x5439('0x1b')](_0x52b674);}};}function respondWithFilteredResult(_0x261199,_0x119bd3){return function(_0x33f28a){if(_0x33f28a){var _0x588282=_0x33f28a[_0x5439('0x1c')],_0x225fd2=_0x119bd3[_0x5439('0x1d')],_0x261b3f=_0x119bd3[_0x5439('0x1d')]+_0x119bd3[_0x5439('0x1e')],_0x31d19a;if(_0x261b3f>=_0x588282){_0x261b3f=_0x588282;_0x31d19a=0xc8;}else{_0x31d19a=0xce;}_0x261199[_0x5439('0x19')](_0x31d19a);return _0x261199[_0x5439('0x1f')](_0x5439('0x20'),_0x225fd2+'-'+_0x261b3f+'/'+_0x588282)[_0x5439('0x1b')](_0x33f28a);}return null;};}function patchUpdates(_0x2b20e6){return function(_0xef34bb){try{jsonpatch[_0x5439('0x21')](_0xef34bb,_0x2b20e6,!![]);}catch(_0xb37856){return BPromise[_0x5439('0x22')](_0xb37856);}return _0xef34bb[_0x5439('0x23')]();};}function saveUpdates(_0x321bd6,_0x19371b){return function(_0xe51efc){if(_0xe51efc){return _0xe51efc[_0x5439('0x24')](_0x321bd6)[_0x5439('0x25')](function(_0x312ebf){return _0x312ebf;});}return null;};}function removeEntity(_0x1f9f9f,_0x284d21){return function(_0x2026ef){if(_0x2026ef){return _0x2026ef['destroy']()[_0x5439('0x25')](function(){_0x1f9f9f[_0x5439('0x19')](0xcc)[_0x5439('0x1a')]();});}};}function handleEntityNotFound(_0x34352f,_0x421fb6){return function(_0xc4369c){if(!_0xc4369c){_0x34352f[_0x5439('0x18')](0x194);}return _0xc4369c;};}function handleError(_0xb7bbc,_0x17e7b3){_0x17e7b3=_0x17e7b3||0x1f4;return function(_0x378eca){logger['error'](_0x378eca[_0x5439('0x26')]);if(_0x378eca[_0x5439('0x27')]){delete _0x378eca[_0x5439('0x27')];}_0xb7bbc[_0x5439('0x19')](_0x17e7b3)['send'](_0x378eca);};}exports[_0x5439('0x28')]=function(_0x4b74cb,_0x386821){var _0x40a8ab={},_0x1ee73d={},_0x2abddb={'count':0x0,'rows':[]};var _0x5a215b=db[_0x5439('0x29')][_0x5439('0x2a')];_0x1ee73d['model']=_[_0x5439('0x2b')](_0x5a215b);_0x1ee73d[_0x5439('0x2c')]=_['keys'](_0x4b74cb[_0x5439('0x2c')]);_0x1ee73d[_0x5439('0x2d')]=_[_0x5439('0x2e')](_0x1ee73d[_0x5439('0x2f')],_0x1ee73d[_0x5439('0x2c')]);_0x40a8ab[_0x5439('0x30')]=_[_0x5439('0x2e')](_0x1ee73d['model'],qs['fields'](_0x4b74cb[_0x5439('0x2c')][_0x5439('0x31')]));_0x40a8ab[_0x5439('0x30')]=_0x40a8ab['attributes']['length']?_0x40a8ab['attributes']:_0x1ee73d[_0x5439('0x2f')];if(!_0x4b74cb[_0x5439('0x2c')]['hasOwnProperty']('nolimit')){_0x40a8ab[_0x5439('0x1e')]=qs[_0x5439('0x1e')](_0x4b74cb[_0x5439('0x2c')][_0x5439('0x1e')]);_0x40a8ab[_0x5439('0x1d')]=qs[_0x5439('0x1d')](_0x4b74cb[_0x5439('0x2c')][_0x5439('0x1d')]);}_0x40a8ab[_0x5439('0x32')]=qs[_0x5439('0x33')](_0x4b74cb['query'][_0x5439('0x33')]);_0x40a8ab[_0x5439('0x34')]=qs[_0x5439('0x2d')](_[_0x5439('0x35')](_0x4b74cb[_0x5439('0x2c')],_0x1ee73d['filters']));if(_0x4b74cb[_0x5439('0x2c')][_0x5439('0x36')]){_0x40a8ab[_0x5439('0x34')]=_[_0x5439('0x37')](_0x40a8ab[_0x5439('0x34')],{'$or':_[_0x5439('0x38')](_0x5a215b,function(_0x523e62){if(_0x523e62[_0x5439('0x39')][_0x5439('0x3a')]!=='VIRTUAL'){var _0x5dd1fe={};_0x5dd1fe[_0x523e62[_0x5439('0x3b')]]={'$like':'%'+_0x4b74cb[_0x5439('0x2c')][_0x5439('0x36')]+'%'};return _0x5dd1fe;}})});}_0x40a8ab=_[_0x5439('0x37')]({},_0x40a8ab,_0x4b74cb[_0x5439('0x3c')]);var _0x86d714={'where':_0x40a8ab[_0x5439('0x34')]};return db[_0x5439('0x29')]['count'](_0x86d714)[_0x5439('0x25')](function(_0x11a2ad){_0x2abddb[_0x5439('0x1c')]=_0x11a2ad;if(_0x4b74cb[_0x5439('0x2c')]['includeAll']){_0x40a8ab['include']=[{'all':!![]}];}return db[_0x5439('0x29')][_0x5439('0x3d')](_0x40a8ab);})['then'](function(_0x38b27e){_0x2abddb[_0x5439('0x3e')]=_0x38b27e;return _0x2abddb;})[_0x5439('0x25')](respondWithFilteredResult(_0x386821,_0x40a8ab))[_0x5439('0x3f')](handleError(_0x386821,null));};exports[_0x5439('0x40')]=function(_0x9f2fe8,_0x48d0ce){var _0x493e09={'raw':![],'where':{'id':_0x9f2fe8[_0x5439('0x41')]['id']}},_0x2d209d={};_0x2d209d['model']=_['keys'](db['SAProduct'][_0x5439('0x2a')]);_0x2d209d[_0x5439('0x2c')]=_[_0x5439('0x2b')](_0x9f2fe8['query']);_0x2d209d[_0x5439('0x2d')]=_[_0x5439('0x2e')](_0x2d209d[_0x5439('0x2f')],_0x2d209d['query']);_0x493e09['attributes']=_['intersection'](_0x2d209d['model'],qs[_0x5439('0x31')](_0x9f2fe8['query'][_0x5439('0x31')]));_0x493e09[_0x5439('0x30')]=_0x493e09[_0x5439('0x30')][_0x5439('0x42')]?_0x493e09[_0x5439('0x30')]:_0x2d209d['model'];if(_0x9f2fe8[_0x5439('0x2c')]['includeAll']){_0x493e09[_0x5439('0x43')]=[{'all':!![]}];}_0x493e09=_['merge']({},_0x493e09,_0x9f2fe8[_0x5439('0x3c')]);return db[_0x5439('0x29')]['find'](_0x493e09)[_0x5439('0x25')](handleEntityNotFound(_0x48d0ce,null))[_0x5439('0x25')](respondWithResult(_0x48d0ce,null))[_0x5439('0x3f')](handleError(_0x48d0ce,null));};exports[_0x5439('0x44')]=function(_0x43ea1f,_0x4618b7){return db[_0x5439('0x29')]['create'](_0x43ea1f[_0x5439('0x45')],{})[_0x5439('0x25')](respondWithResult(_0x4618b7,0xc9))['catch'](handleError(_0x4618b7,null));};exports[_0x5439('0x46')]=function(_0x12cc33,_0x31d543){var _0x2a83ed={'raw':![],'where':{'id':_0x12cc33[_0x5439('0x41')]['id']}},_0x3d528a={};_0x3d528a[_0x5439('0x2f')]=_[_0x5439('0x2b')](db['SAProduct'][_0x5439('0x2a')]);_0x2a83ed['attributes']=_[_0x5439('0x2e')](_0x3d528a[_0x5439('0x2f')],qs[_0x5439('0x31')](_0x12cc33[_0x5439('0x2c')][_0x5439('0x31')]));_0x2a83ed['attributes']=_0x2a83ed[_0x5439('0x30')][_0x5439('0x42')]?_0x2a83ed['attributes']:_0x3d528a[_0x5439('0x2f')];if(_0x12cc33[_0x5439('0x2c')][_0x5439('0x47')]){_0x2a83ed[_0x5439('0x43')]=[{'all':!![]}];}_0x2a83ed=_['merge']({},_0x2a83ed,_0x12cc33['options']);return db[_0x5439('0x29')][_0x5439('0x48')](_0x2a83ed)[_0x5439('0x25')](handleEntityNotFound(_0x31d543,null))['then'](function(_0x5aef48){if(_0x5aef48){var _0x21b85a=_0x5aef48[_0x5439('0x49')]({'plain':!![]});_0x21b85a=qs[_0x5439('0x4a')](_0x21b85a,['id','createdAt',_0x5439('0x4b')]);_0x12cc33[_0x5439('0x45')]=_[_0x5439('0x4a')](_0x12cc33[_0x5439('0x45')],['id',_0x5439('0x4c'),_0x5439('0x4b')]);return db[_0x5439('0x29')][_0x5439('0x44')](_[_0x5439('0x37')](_0x21b85a,_0x12cc33['body']),{'include':_0x12cc33[_0x5439('0x2c')][_0x5439('0x47')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x31d543,0xc9))[_0x5439('0x3f')](handleError(_0x31d543,null));};exports[_0x5439('0x24')]=function(_0x14fb6c,_0x4377b2){if(_0x14fb6c[_0x5439('0x45')]['id']){delete _0x14fb6c['body']['id'];}return db['SAProduct'][_0x5439('0x48')]({'where':{'id':_0x14fb6c[_0x5439('0x41')]['id']}})[_0x5439('0x25')](handleEntityNotFound(_0x4377b2,null))[_0x5439('0x25')](saveUpdates(_0x14fb6c['body'],null))[_0x5439('0x25')](respondWithResult(_0x4377b2,null))[_0x5439('0x3f')](handleError(_0x4377b2,null));};exports[_0x5439('0x4d')]=function(_0x255a11,_0xea77d5){return db['SAProduct'][_0x5439('0x4d')]()[_0x5439('0x25')](respondWithResult(_0xea77d5,null))[_0x5439('0x3f')](handleError(_0xea77d5,null));}; \ No newline at end of file +var _0x4709=['html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','keys','query','intersection','model','attributes','fields','length','nolimit','offset','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','field','SAProduct','count','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','get','omit','createdAt','updatedAt','describe'];(function(_0xf67d14,_0x1e9e01){var _0x4ac2b5=function(_0x22a02a){while(--_0x22a02a){_0xf67d14['push'](_0xf67d14['shift']());}};_0x4ac2b5(++_0x1e9e01);}(_0x4709,0x98));var _0x9470=function(_0x260900,_0x366912){_0x260900=_0x260900-0x0;var _0x4eb376=_0x4709[_0x260900];return _0x4eb376;};'use strict';var pdf=require(_0x9470('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9470('0x1'));var jsonpatch=require(_0x9470('0x2'));var rp=require(_0x9470('0x3'));var moment=require(_0x9470('0x4'));var BPromise=require(_0x9470('0x5'));var Mustache=require(_0x9470('0x6'));var util=require(_0x9470('0x7'));var path=require(_0x9470('0x8'));var sox=require(_0x9470('0x9'));var csv=require(_0x9470('0xa'));var ejs=require(_0x9470('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9470('0xc'));var deskjs=require(_0x9470('0xd'));var toCsv=require(_0x9470('0xa'));var querystring=require(_0x9470('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9470('0xf'));var qs=require(_0x9470('0x10'));var hardwareService=require(_0x9470('0x11'));var logger=require(_0x9470('0x12'))(_0x9470('0x13'));var utils=require('../../config/utils');var config=require(_0x9470('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51deb8,_0x5b34ae){_0x5b34ae=_0x5b34ae||0xcc;return function(_0x113f84){if(_0x113f84){return _0x51deb8['sendStatus'](_0x5b34ae);}return _0x51deb8[_0x9470('0x15')](_0x5b34ae)[_0x9470('0x16')]();};}function respondWithResult(_0x2152ff,_0x52e3ac){_0x52e3ac=_0x52e3ac||0xc8;return function(_0x2e4f30){if(_0x2e4f30){return _0x2152ff[_0x9470('0x15')](_0x52e3ac)[_0x9470('0x17')](_0x2e4f30);}};}function respondWithFilteredResult(_0x20bb66,_0x35210f){return function(_0x5bfa2e){if(_0x5bfa2e){var _0x2acbd3=_0x5bfa2e['count'],_0x375159=_0x35210f['offset'],_0x579a2f=_0x35210f['offset']+_0x35210f[_0x9470('0x18')],_0x592a87;if(_0x579a2f>=_0x2acbd3){_0x579a2f=_0x2acbd3;_0x592a87=0xc8;}else{_0x592a87=0xce;}_0x20bb66[_0x9470('0x15')](_0x592a87);return _0x20bb66['set'](_0x9470('0x19'),_0x375159+'-'+_0x579a2f+'/'+_0x2acbd3)[_0x9470('0x17')](_0x5bfa2e);}return null;};}function patchUpdates(_0x35c774){return function(_0x51b01b){try{jsonpatch[_0x9470('0x1a')](_0x51b01b,_0x35c774,!![]);}catch(_0x6dab59){return BPromise[_0x9470('0x1b')](_0x6dab59);}return _0x51b01b[_0x9470('0x1c')]();};}function saveUpdates(_0x1a905d,_0x133ef2){return function(_0x26a145){if(_0x26a145){return _0x26a145[_0x9470('0x1d')](_0x1a905d)[_0x9470('0x1e')](function(_0x2a05ff){return _0x2a05ff;});}return null;};}function removeEntity(_0x79aa56,_0xacbd19){return function(_0x191e51){if(_0x191e51){return _0x191e51[_0x9470('0x1f')]()['then'](function(){_0x79aa56['status'](0xcc)[_0x9470('0x16')]();});}};}function handleEntityNotFound(_0x135aa2,_0x4c3ce3){return function(_0x4d036b){if(!_0x4d036b){_0x135aa2[_0x9470('0x20')](0x194);}return _0x4d036b;};}function handleError(_0x52d160,_0x3afeca){_0x3afeca=_0x3afeca||0x1f4;return function(_0x36a1e1){logger[_0x9470('0x21')](_0x36a1e1[_0x9470('0x22')]);if(_0x36a1e1[_0x9470('0x23')]){delete _0x36a1e1[_0x9470('0x23')];}_0x52d160[_0x9470('0x15')](_0x3afeca)[_0x9470('0x24')](_0x36a1e1);};}exports[_0x9470('0x25')]=function(_0x414b1f,_0x2a6004){var _0x48402e={},_0x59b7f6={},_0x10c115={'count':0x0,'rows':[]};var _0x133db3=db['SAProduct'][_0x9470('0x26')];_0x59b7f6['model']=_[_0x9470('0x27')](_0x133db3);_0x59b7f6[_0x9470('0x28')]=_['keys'](_0x414b1f[_0x9470('0x28')]);_0x59b7f6['filters']=_[_0x9470('0x29')](_0x59b7f6[_0x9470('0x2a')],_0x59b7f6[_0x9470('0x28')]);_0x48402e[_0x9470('0x2b')]=_[_0x9470('0x29')](_0x59b7f6[_0x9470('0x2a')],qs[_0x9470('0x2c')](_0x414b1f[_0x9470('0x28')][_0x9470('0x2c')]));_0x48402e[_0x9470('0x2b')]=_0x48402e[_0x9470('0x2b')][_0x9470('0x2d')]?_0x48402e[_0x9470('0x2b')]:_0x59b7f6[_0x9470('0x2a')];if(!_0x414b1f[_0x9470('0x28')]['hasOwnProperty'](_0x9470('0x2e'))){_0x48402e['limit']=qs[_0x9470('0x18')](_0x414b1f['query'][_0x9470('0x18')]);_0x48402e[_0x9470('0x2f')]=qs['offset'](_0x414b1f['query'][_0x9470('0x2f')]);}_0x48402e[_0x9470('0x30')]=qs['sort'](_0x414b1f['query'][_0x9470('0x31')]);_0x48402e[_0x9470('0x32')]=qs[_0x9470('0x33')](_[_0x9470('0x34')](_0x414b1f[_0x9470('0x28')],_0x59b7f6['filters']));if(_0x414b1f[_0x9470('0x28')][_0x9470('0x35')]){_0x48402e[_0x9470('0x32')]=_[_0x9470('0x36')](_0x48402e['where'],{'$or':_['map'](_0x133db3,function(_0x3bdd8d){if(_0x3bdd8d[_0x9470('0x37')]['key']!==_0x9470('0x38')){var _0x3293a5={};_0x3293a5[_0x3bdd8d[_0x9470('0x39')]]={'$like':'%'+_0x414b1f[_0x9470('0x28')][_0x9470('0x35')]+'%'};return _0x3293a5;}})});}_0x48402e=_[_0x9470('0x36')]({},_0x48402e,_0x414b1f['options']);var _0x53dc04={'where':_0x48402e[_0x9470('0x32')]};return db[_0x9470('0x3a')][_0x9470('0x3b')](_0x53dc04)[_0x9470('0x1e')](function(_0x15fd8a){_0x10c115[_0x9470('0x3b')]=_0x15fd8a;if(_0x414b1f['query'][_0x9470('0x3c')]){_0x48402e[_0x9470('0x3d')]=[{'all':!![]}];}return db[_0x9470('0x3a')][_0x9470('0x3e')](_0x48402e);})[_0x9470('0x1e')](function(_0x264f4a){_0x10c115[_0x9470('0x3f')]=_0x264f4a;return _0x10c115;})[_0x9470('0x1e')](respondWithFilteredResult(_0x2a6004,_0x48402e))[_0x9470('0x40')](handleError(_0x2a6004,null));};exports[_0x9470('0x41')]=function(_0x3181ac,_0x3953d3){var _0x3c8e24={'raw':![],'where':{'id':_0x3181ac[_0x9470('0x42')]['id']}},_0x103a1b={};_0x103a1b[_0x9470('0x2a')]=_['keys'](db[_0x9470('0x3a')]['rawAttributes']);_0x103a1b[_0x9470('0x28')]=_[_0x9470('0x27')](_0x3181ac['query']);_0x103a1b[_0x9470('0x33')]=_[_0x9470('0x29')](_0x103a1b[_0x9470('0x2a')],_0x103a1b[_0x9470('0x28')]);_0x3c8e24[_0x9470('0x2b')]=_[_0x9470('0x29')](_0x103a1b[_0x9470('0x2a')],qs[_0x9470('0x2c')](_0x3181ac[_0x9470('0x28')][_0x9470('0x2c')]));_0x3c8e24['attributes']=_0x3c8e24[_0x9470('0x2b')]['length']?_0x3c8e24['attributes']:_0x103a1b['model'];if(_0x3181ac[_0x9470('0x28')][_0x9470('0x3c')]){_0x3c8e24[_0x9470('0x3d')]=[{'all':!![]}];}_0x3c8e24=_[_0x9470('0x36')]({},_0x3c8e24,_0x3181ac[_0x9470('0x43')]);return db[_0x9470('0x3a')][_0x9470('0x44')](_0x3c8e24)['then'](handleEntityNotFound(_0x3953d3,null))[_0x9470('0x1e')](respondWithResult(_0x3953d3,null))[_0x9470('0x40')](handleError(_0x3953d3,null));};exports[_0x9470('0x45')]=function(_0x5c1b4d,_0x247b77){return db[_0x9470('0x3a')]['create'](_0x5c1b4d[_0x9470('0x46')],{})['then'](respondWithResult(_0x247b77,0xc9))['catch'](handleError(_0x247b77,null));};exports['clone']=function(_0x1b3fcd,_0x5411e2){var _0x55ebb3={'raw':![],'where':{'id':_0x1b3fcd[_0x9470('0x42')]['id']}},_0xdfd5f5={};_0xdfd5f5[_0x9470('0x2a')]=_['keys'](db['SAProduct']['rawAttributes']);_0x55ebb3['attributes']=_[_0x9470('0x29')](_0xdfd5f5['model'],qs[_0x9470('0x2c')](_0x1b3fcd[_0x9470('0x28')][_0x9470('0x2c')]));_0x55ebb3[_0x9470('0x2b')]=_0x55ebb3['attributes']['length']?_0x55ebb3[_0x9470('0x2b')]:_0xdfd5f5[_0x9470('0x2a')];if(_0x1b3fcd[_0x9470('0x28')][_0x9470('0x3c')]){_0x55ebb3[_0x9470('0x3d')]=[{'all':!![]}];}_0x55ebb3=_[_0x9470('0x36')]({},_0x55ebb3,_0x1b3fcd[_0x9470('0x43')]);return db[_0x9470('0x3a')]['find'](_0x55ebb3)[_0x9470('0x1e')](handleEntityNotFound(_0x5411e2,null))[_0x9470('0x1e')](function(_0x28e270){if(_0x28e270){var _0x524f37=_0x28e270[_0x9470('0x47')]({'plain':!![]});_0x524f37=qs[_0x9470('0x48')](_0x524f37,['id',_0x9470('0x49'),_0x9470('0x4a')]);_0x1b3fcd[_0x9470('0x46')]=_[_0x9470('0x48')](_0x1b3fcd[_0x9470('0x46')],['id','createdAt',_0x9470('0x4a')]);return db['SAProduct'][_0x9470('0x45')](_[_0x9470('0x36')](_0x524f37,_0x1b3fcd[_0x9470('0x46')]),{'include':_0x1b3fcd[_0x9470('0x28')][_0x9470('0x3c')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x5411e2,0xc9))[_0x9470('0x40')](handleError(_0x5411e2,null));};exports[_0x9470('0x1d')]=function(_0xfa4774,_0x36ecd8){if(_0xfa4774['body']['id']){delete _0xfa4774[_0x9470('0x46')]['id'];}return db['SAProduct'][_0x9470('0x44')]({'where':{'id':_0xfa4774[_0x9470('0x42')]['id']}})[_0x9470('0x1e')](handleEntityNotFound(_0x36ecd8,null))[_0x9470('0x1e')](saveUpdates(_0xfa4774[_0x9470('0x46')],null))[_0x9470('0x1e')](respondWithResult(_0x36ecd8,null))[_0x9470('0x40')](handleError(_0x36ecd8,null));};exports['describe']=function(_0x344217,_0x4e993e){return db[_0x9470('0x3a')][_0x9470('0x4b')]()['then'](respondWithResult(_0x4e993e,null))[_0x9470('0x40')](handleError(_0x4e993e,null));}; \ No newline at end of file diff --git a/server/api/saProduct/saProduct.model.js b/server/api/saProduct/saProduct.model.js index 600ce15..f2b5282 100644 --- a/server/api/saProduct/saProduct.model.js +++ b/server/api/saProduct/saProduct.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2c31=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./saProduct.attributes','define','sa_products','lodash','util'];(function(_0x21a387,_0x2cda9e){var _0x19806a=function(_0x44bf7f){while(--_0x44bf7f){_0x21a387['push'](_0x21a387['shift']());}};_0x19806a(++_0x2cda9e);}(_0x2c31,0xee));var _0x12c3=function(_0x42ad29,_0x21e0cf){_0x42ad29=_0x42ad29-0x0;var _0x15493b=_0x2c31[_0x42ad29];return _0x15493b;};'use strict';var _=require(_0x12c3('0x0'));var util=require(_0x12c3('0x1'));var logger=require(_0x12c3('0x2'))(_0x12c3('0x3'));var moment=require(_0x12c3('0x4'));var BPromise=require(_0x12c3('0x5'));var rp=require(_0x12c3('0x6'));var fs=require('fs');var path=require(_0x12c3('0x7'));var rimraf=require('rimraf');var config=require(_0x12c3('0x8'));var attributes=require(_0x12c3('0x9'));module['exports']=function(_0x25585c,_0x173947){return _0x25585c[_0x12c3('0xa')]('SAProduct',attributes,{'tableName':_0x12c3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e01=['SAProduct','sa_products','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./saProduct.attributes','exports','define'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x3e01,0x92));var _0x13e0=function(_0xcd629d,_0x2b6d91){_0xcd629d=_0xcd629d-0x0;var _0x7035d8=_0x3e01[_0xcd629d];return _0x7035d8;};'use strict';var _=require(_0x13e0('0x0'));var util=require(_0x13e0('0x1'));var logger=require(_0x13e0('0x2'))('api');var moment=require(_0x13e0('0x3'));var BPromise=require('bluebird');var rp=require(_0x13e0('0x4'));var fs=require('fs');var path=require(_0x13e0('0x5'));var rimraf=require(_0x13e0('0x6'));var config=require('../../config/environment');var attributes=require(_0x13e0('0x7'));module[_0x13e0('0x8')]=function(_0x542aaa,_0x1e982d){return _0x542aaa[_0x13e0('0x9')](_0x13e0('0xa'),attributes,{'tableName':_0x13e0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saProduct/saProduct.rpc.js b/server/api/saProduct/saProduct.rpc.js index 9206c79..233cf93 100644 --- a/server/api/saProduct/saProduct.rpc.js +++ b/server/api/saProduct/saProduct.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac9d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','SAProduct,\x20%s,\x20%s','request\x20sent','debug','SAProduct,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x1e092a,_0x5706e7){var _0x140082=function(_0x137447){while(--_0x137447){_0x1e092a['push'](_0x1e092a['shift']());}};_0x140082(++_0x5706e7);}(_0xac9d,0x14d));var _0xdac9=function(_0x12a201,_0x30aaba){_0x12a201=_0x12a201-0x0;var _0x52a4d2=_0xac9d[_0x12a201];return _0x52a4d2;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){return client['request'](_0x776b6c,_0x39f560)[_0xdac9('0xc')](function(_0x3a013b){logger[_0xdac9('0xd')](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));logger[_0xdac9('0x10')](_0xdac9('0x11'),_0x1c78c5,_0xdac9('0xf'),JSON[_0xdac9('0x12')](_0x3a013b));if(_0x3a013b['error']){if(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x14')]===0x1f4){logger['error'](_0xdac9('0xe'),_0x1c78c5,_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);return _0x2b1d6f(_0x3a013b['error'][_0xdac9('0x15')]);}logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x3a013b['error']['message']);return _0x5531af(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);}else{logger['info'](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));_0x5531af(_0x3a013b[_0xdac9('0x16')][_0xdac9('0x15')]);}})[_0xdac9('0x17')](function(_0x393acc){logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x393acc);_0x2b1d6f(_0x393acc);});});} \ No newline at end of file +var _0x2d17=['SAProduct,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','request\x20sent','debug','SAProduct,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x50856f,_0x262f2c){var _0x505ca2=function(_0x4df2f2){while(--_0x4df2f2){_0x50856f['push'](_0x50856f['shift']());}};_0x505ca2(++_0x262f2c);}(_0x2d17,0x17e));var _0x72d1=function(_0x4073aa,_0x3d3e19){_0x4073aa=_0x4073aa-0x0;var _0x5dc043=_0x2d17[_0x4073aa];return _0x5dc043;};'use strict';var _=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var moment=require('moment');var BPromise=require(_0x72d1('0x2'));var rs=require(_0x72d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d1('0x4'))['db'];var utils=require(_0x72d1('0x5'));var logger=require('../../config/logger')(_0x72d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x72d1('0x7'));var client=jayson['client'][_0x72d1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x239d1f,_0x5b40a9,_0x477264){return new BPromise(function(_0x422f5a,_0x19e248){return client['request'](_0x239d1f,_0x477264)[_0x72d1('0x9')](function(_0x288362){logger[_0x72d1('0xa')]('SAProduct,\x20%s,\x20%s',_0x5b40a9,_0x72d1('0xb'));logger[_0x72d1('0xc')](_0x72d1('0xd'),_0x5b40a9,_0x72d1('0xb'),JSON[_0x72d1('0xe')](_0x288362));if(_0x288362[_0x72d1('0xf')]){if(_0x288362[_0x72d1('0xf')][_0x72d1('0x10')]===0x1f4){logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x288362['error'][_0x72d1('0x12')]);return _0x19e248(_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);}logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);return _0x422f5a(_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);}else{logger[_0x72d1('0xa')](_0x72d1('0x11'),_0x5b40a9,_0x72d1('0xb'));_0x422f5a(_0x288362[_0x72d1('0x13')]['message']);}})[_0x72d1('0x14')](function(_0x5262b0){logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x5262b0);_0x19e248(_0x5262b0);});});} \ No newline at end of file diff --git a/server/api/saProductOrder/index.js b/server/api/saProductOrder/index.js index 0cf0834..fec6f96 100644 --- a/server/api/saProductOrder/index.js +++ b/server/api/saProductOrder/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5be1=['../../config/environment','./saProductOrder.controller','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','delete','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x2d7283,_0x339809){var _0x855165=function(_0x44e36b){while(--_0x44e36b){_0x2d7283['push'](_0x2d7283['shift']());}};_0x855165(++_0x339809);}(_0x5be1,0x13f));var _0x15be=function(_0x38fea3,_0x4601cf){_0x38fea3=_0x38fea3-0x0;var _0x5de2d5=_0x5be1[_0x38fea3];return _0x5de2d5;};'use strict';var multer=require('multer');var util=require(_0x15be('0x0'));var path=require('path');var timeout=require(_0x15be('0x1'));var express=require(_0x15be('0x2'));var router=express['Router']();var auth=require(_0x15be('0x3'));var interaction=require(_0x15be('0x4'));var config=require(_0x15be('0x5'));var controller=require(_0x15be('0x6'));router[_0x15be('0x7')]('/',auth[_0x15be('0x8')](),controller[_0x15be('0x9')]);router[_0x15be('0x7')](_0x15be('0xa'),auth[_0x15be('0x8')](),controller[_0x15be('0xb')]);router[_0x15be('0x7')]('/:id',auth[_0x15be('0x8')](),controller[_0x15be('0xc')]);router[_0x15be('0xd')]('/',auth['isAuthenticated'](),controller[_0x15be('0xe')]);router['put'](_0x15be('0xf'),auth[_0x15be('0x8')](),controller[_0x15be('0x10')]);router[_0x15be('0x11')](_0x15be('0xf'),auth[_0x15be('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1212=['isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./saProductOrder.controller','get','index','/describe'];(function(_0x297acf,_0x530d6c){var _0x2dd757=function(_0x1b7aa9){while(--_0x1b7aa9){_0x297acf['push'](_0x297acf['shift']());}};_0x2dd757(++_0x530d6c);}(_0x1212,0x13f));var _0x2121=function(_0x1f5067,_0x2e995a){_0x1f5067=_0x1f5067-0x0;var _0x4c21d4=_0x1212[_0x1f5067];return _0x4c21d4;};'use strict';var multer=require(_0x2121('0x0'));var util=require(_0x2121('0x1'));var path=require('path');var timeout=require(_0x2121('0x2'));var express=require(_0x2121('0x3'));var router=express[_0x2121('0x4')]();var auth=require(_0x2121('0x5'));var interaction=require(_0x2121('0x6'));var config=require('../../config/environment');var controller=require(_0x2121('0x7'));router[_0x2121('0x8')]('/',auth['isAuthenticated'](),controller[_0x2121('0x9')]);router[_0x2121('0x8')](_0x2121('0xa'),auth[_0x2121('0xb')](),controller[_0x2121('0xc')]);router[_0x2121('0x8')](_0x2121('0xd'),auth[_0x2121('0xb')](),controller[_0x2121('0xe')]);router[_0x2121('0xf')]('/',auth['isAuthenticated'](),controller[_0x2121('0x10')]);router[_0x2121('0x11')](_0x2121('0xd'),auth['isAuthenticated'](),controller[_0x2121('0x12')]);router[_0x2121('0x13')](_0x2121('0xd'),auth[_0x2121('0xb')](),controller[_0x2121('0x14')]);module[_0x2121('0x15')]=router; \ No newline at end of file diff --git a/server/api/saProductOrder/saProductOrder.attributes.js b/server/api/saProductOrder/saProductOrder.attributes.js index b37908a..0da4d5e 100644 --- a/server/api/saProductOrder/saProductOrder.attributes.js +++ b/server/api/saProductOrder/saProductOrder.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ca8=['BOOLEAN','sequelize','exports','TEXT','DECIMAL','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ca8,0x7f));var _0x87ca=function(_0x3c6df4,_0x58dd6e){_0x3c6df4=_0x3c6df4-0x0;var _0xfc1f96=_0x7ca8[_0x3c6df4];return _0xfc1f96;};'use strict';var Sequelize=require(_0x87ca('0x0'));module[_0x87ca('0x1')]={'productName':{'type':Sequelize[_0x87ca('0x2')],'allowNull':![]},'productCode':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex_prodCode_OrderID'},'productNetPrice':{'type':Sequelize[_0x87ca('0x3')](0xd,0x4)},'productTax':{'type':Sequelize['INTEGER']},'productDescription':{'type':Sequelize[_0x87ca('0x2')](_0x87ca('0x4'))+_0x87ca('0x5')},'productQtyMin':{'type':Sequelize[_0x87ca('0x6')],'allowNull':!![]},'pricelistName':{'type':Sequelize['TEXT']},'pricelistDiscount':{'type':Sequelize[_0x87ca('0x3')](0x6,0x3),'allowNull':![]},'productPricelistDiscount':{'type':Sequelize[_0x87ca('0x3')](0xd,0x4),'allowNull':![]},'productPricelistNetPrice':{'type':Sequelize[_0x87ca('0x3')](0xd,0x4)},'netPrice':{'type':Sequelize[_0x87ca('0x3')](0xd,0x4),'allowNull':![]},'quantity':{'type':Sequelize['INTEGER'],'allowNull':![]},'discount':{'type':Sequelize[_0x87ca('0x3')](0x6,0x3),'allowNull':![]},'totalPrice':{'type':Sequelize[_0x87ca('0x3')](0xd,0x4),'allowNull':![]},'tax':{'type':Sequelize[_0x87ca('0x3')](0xd,0x4),'allowNull':![]},'totalDiscount':{'type':Sequelize[_0x87ca('0x3')](0xd,0x4),'allowNull':![]},'totalTax':{'type':Sequelize[_0x87ca('0x3')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x87ca('0x7')]},'note':{'type':Sequelize['TEXT']},'QuotationId':{'type':Sequelize['INTEGER']},'OrderId':{'type':Sequelize['INTEGER'],'unique':'compositeIndex_prodCode_OrderID'},'totalPrice':{'type':Sequelize[_0x87ca('0x3')](0xd,0x4)},'totalTax':{'type':Sequelize[_0x87ca('0x3')](0xd,0x4)},'typeName':{'type':Sequelize['STRING']},'TypeId':{'type':Sequelize[_0x87ca('0x6')]},'unitName':{'type':Sequelize[_0x87ca('0x7')]},'UnitId':{'type':Sequelize['INTEGER']},'attendanceName':{'type':Sequelize[_0x87ca('0x7')]},'attendanceId':{'type':Sequelize[_0x87ca('0x6')]},'attendanceMonthly':{'type':Sequelize[_0x87ca('0x6')]},'companyName':{'type':Sequelize[_0x87ca('0x7')]},'companyId':{'type':Sequelize[_0x87ca('0x6')]},'productAsset':{'type':Sequelize[_0x87ca('0x8')]}}; \ No newline at end of file +var _0x7b40=['DECIMAL','INTEGER','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','TEXT','BOOLEAN','exports','STRING','compositeIndex_prodCode_OrderID'];(function(_0x265003,_0xf0f023){var _0x33c743=function(_0x326a5d){while(--_0x326a5d){_0x265003['push'](_0x265003['shift']());}};_0x33c743(++_0xf0f023);}(_0x7b40,0x1c8));var _0x07b4=function(_0x4a7a3c,_0x15604e){_0x4a7a3c=_0x4a7a3c-0x0;var _0x94e7de=_0x7b40[_0x4a7a3c];return _0x94e7de;};'use strict';var Sequelize=require('sequelize');module[_0x07b4('0x0')]={'productName':{'type':Sequelize['TEXT'],'allowNull':![]},'productCode':{'type':Sequelize[_0x07b4('0x1')],'allowNull':![],'unique':_0x07b4('0x2')},'productNetPrice':{'type':Sequelize[_0x07b4('0x3')](0xd,0x4)},'productTax':{'type':Sequelize[_0x07b4('0x4')]},'productDescription':{'type':Sequelize['TEXT'](_0x07b4('0x5'))+_0x07b4('0x6')},'productQtyMin':{'type':Sequelize['INTEGER'],'allowNull':!![]},'pricelistName':{'type':Sequelize[_0x07b4('0x7')]},'pricelistDiscount':{'type':Sequelize[_0x07b4('0x3')](0x6,0x3),'allowNull':![]},'productPricelistDiscount':{'type':Sequelize[_0x07b4('0x3')](0xd,0x4),'allowNull':![]},'productPricelistNetPrice':{'type':Sequelize[_0x07b4('0x3')](0xd,0x4)},'netPrice':{'type':Sequelize[_0x07b4('0x3')](0xd,0x4),'allowNull':![]},'quantity':{'type':Sequelize['INTEGER'],'allowNull':![]},'discount':{'type':Sequelize[_0x07b4('0x3')](0x6,0x3),'allowNull':![]},'totalPrice':{'type':Sequelize[_0x07b4('0x3')](0xd,0x4),'allowNull':![]},'tax':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'totalDiscount':{'type':Sequelize[_0x07b4('0x3')](0xd,0x4),'allowNull':![]},'totalTax':{'type':Sequelize[_0x07b4('0x3')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x07b4('0x1')]},'note':{'type':Sequelize['TEXT']},'QuotationId':{'type':Sequelize[_0x07b4('0x4')]},'OrderId':{'type':Sequelize[_0x07b4('0x4')],'unique':_0x07b4('0x2')},'totalPrice':{'type':Sequelize[_0x07b4('0x3')](0xd,0x4)},'totalTax':{'type':Sequelize['DECIMAL'](0xd,0x4)},'typeName':{'type':Sequelize[_0x07b4('0x1')]},'TypeId':{'type':Sequelize[_0x07b4('0x4')]},'unitName':{'type':Sequelize['STRING']},'UnitId':{'type':Sequelize['INTEGER']},'attendanceName':{'type':Sequelize[_0x07b4('0x1')]},'attendanceId':{'type':Sequelize[_0x07b4('0x4')]},'attendanceMonthly':{'type':Sequelize['INTEGER']},'companyName':{'type':Sequelize[_0x07b4('0x1')]},'companyId':{'type':Sequelize[_0x07b4('0x4')]},'productAsset':{'type':Sequelize[_0x07b4('0x8')]}}; \ No newline at end of file diff --git a/server/api/saProductOrder/saProductOrder.controller.js b/server/api/saProductOrder/saProductOrder.controller.js index 9a472a4..e6c9349 100644 --- a/server/api/saProductOrder/saProductOrder.controller.js +++ b/server/api/saProductOrder/saProductOrder.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b27=['update','then','destroy','error','stack','send','index','rawAttributes','model','keys','query','dateStart','dateEnd','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','add','day','merge','map','key','VIRTUAL','field','options','include','SAProductOrder','catch','includeAll','find','create','body','params','describe','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save'];(function(_0x9e689c,_0x2600d8){var _0x13ee00=function(_0x60e5e2){while(--_0x60e5e2){_0x9e689c['push'](_0x9e689c['shift']());}};_0x13ee00(++_0x2600d8);}(_0x0b27,0x148));var _0x70b2=function(_0x4d751d,_0x205f5a){_0x4d751d=_0x4d751d-0x0;var _0x440b06=_0x0b27[_0x4d751d];return _0x440b06;};'use strict';var pdf=require(_0x70b2('0x0'));var emlformat=require(_0x70b2('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x70b2('0x2'));var rp=require(_0x70b2('0x3'));var moment=require(_0x70b2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x70b2('0x5'));var util=require(_0x70b2('0x6'));var path=require(_0x70b2('0x7'));var sox=require(_0x70b2('0x8'));var csv=require(_0x70b2('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x70b2('0xa'));var squel=require(_0x70b2('0xb'));var crypto=require(_0x70b2('0xc'));var jsforce=require(_0x70b2('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x70b2('0xe'));var Papa=require(_0x70b2('0xf'));var Redis=require(_0x70b2('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0x70b2('0x11'))('api');var utils=require(_0x70b2('0x12'));var config=require(_0x70b2('0x13'));var db=require(_0x70b2('0x14'))['db'];function respondWithStatusCode(_0x2fdcc6,_0x5c7962){_0x5c7962=_0x5c7962||0xcc;return function(_0x31a1ba){if(_0x31a1ba){return _0x2fdcc6[_0x70b2('0x15')](_0x5c7962);}return _0x2fdcc6[_0x70b2('0x16')](_0x5c7962)[_0x70b2('0x17')]();};}function respondWithResult(_0x3e24d2,_0x8d962b){_0x8d962b=_0x8d962b||0xc8;return function(_0x10a3df){if(_0x10a3df){return _0x3e24d2[_0x70b2('0x16')](_0x8d962b)[_0x70b2('0x18')](_0x10a3df);}};}function respondWithFilteredResult(_0x259a1c,_0x456a30){return function(_0x5d2d3d){if(_0x5d2d3d){var _0x1a0b7c=_0x5d2d3d[_0x70b2('0x19')],_0x985089=_0x456a30[_0x70b2('0x1a')],_0x5e232f=_0x456a30[_0x70b2('0x1a')]+_0x456a30[_0x70b2('0x1b')],_0x2deb02;if(_0x5e232f>=_0x1a0b7c){_0x5e232f=_0x1a0b7c;_0x2deb02=0xc8;}else{_0x2deb02=0xce;}_0x259a1c['status'](_0x2deb02);return _0x259a1c['set'](_0x70b2('0x1c'),_0x985089+'-'+_0x5e232f+'/'+_0x1a0b7c)[_0x70b2('0x18')](_0x5d2d3d);}return null;};}function patchUpdates(_0x52e452){return function(_0x55f343){try{jsonpatch[_0x70b2('0x1d')](_0x55f343,_0x52e452,!![]);}catch(_0x262de6){return BPromise[_0x70b2('0x1e')](_0x262de6);}return _0x55f343[_0x70b2('0x1f')]();};}function saveUpdates(_0x120f01,_0x335e0a){return function(_0x347466){if(_0x347466){return _0x347466[_0x70b2('0x20')](_0x120f01)[_0x70b2('0x21')](function(_0x23b9f6){return _0x23b9f6;});}return null;};}function removeEntity(_0x2cc79f,_0x11b075){return function(_0x3c81de){if(_0x3c81de){return _0x3c81de[_0x70b2('0x22')]()[_0x70b2('0x21')](function(){_0x2cc79f[_0x70b2('0x16')](0xcc)[_0x70b2('0x17')]();});}};}function handleEntityNotFound(_0x5ab790,_0x143a75){return function(_0x1067d3){if(!_0x1067d3){_0x5ab790[_0x70b2('0x15')](0x194);}return _0x1067d3;};}function handleError(_0x56cf98,_0x1d3882){_0x1d3882=_0x1d3882||0x1f4;return function(_0x1e43db){logger[_0x70b2('0x23')](_0x1e43db[_0x70b2('0x24')]);if(_0x1e43db['name']){delete _0x1e43db['name'];}_0x56cf98[_0x70b2('0x16')](_0x1d3882)[_0x70b2('0x25')](_0x1e43db);};}exports[_0x70b2('0x26')]=function(_0x1b973d,_0x53662b){var _0x693189={'raw':!![]},_0x4031a8={},_0x4c9ba9={'count':0x0,'rows':[]};var _0x2d37b4=db['SAProductOrder'][_0x70b2('0x27')];_0x4031a8[_0x70b2('0x28')]=_[_0x70b2('0x29')](_0x2d37b4);var _0x86dda1={'dateStart':_0x1b973d[_0x70b2('0x2a')][_0x70b2('0x2b')],'dateEnd':_0x1b973d[_0x70b2('0x2a')][_0x70b2('0x2c')]};delete _0x1b973d[_0x70b2('0x2a')]['dateStart'];delete _0x1b973d[_0x70b2('0x2a')][_0x70b2('0x2c')];_0x4031a8[_0x70b2('0x2a')]=_[_0x70b2('0x29')](_0x1b973d['query']);_0x4031a8['filters']=_[_0x70b2('0x2d')](_0x4031a8['model'],_0x4031a8[_0x70b2('0x2a')]);_0x693189['attributes']=_[_0x70b2('0x2d')](_0x4031a8[_0x70b2('0x28')],qs[_0x70b2('0x2e')](_0x1b973d['query'][_0x70b2('0x2e')]));_0x693189[_0x70b2('0x2f')]=_0x693189[_0x70b2('0x2f')][_0x70b2('0x30')]?_0x693189['attributes']:_0x4031a8['model'];if(!_0x1b973d[_0x70b2('0x2a')][_0x70b2('0x31')](_0x70b2('0x32'))){_0x693189[_0x70b2('0x1b')]=qs[_0x70b2('0x1b')](_0x1b973d[_0x70b2('0x2a')][_0x70b2('0x1b')]);_0x693189[_0x70b2('0x1a')]=qs[_0x70b2('0x1a')](_0x1b973d[_0x70b2('0x2a')][_0x70b2('0x1a')]);}_0x693189[_0x70b2('0x33')]=qs[_0x70b2('0x34')](_0x1b973d[_0x70b2('0x2a')][_0x70b2('0x34')]);_0x693189[_0x70b2('0x35')]=qs[_0x70b2('0x36')](_['pick'](_0x1b973d[_0x70b2('0x2a')],_0x4031a8[_0x70b2('0x36')]));if(_0x86dda1[_0x70b2('0x2b')]){if(_0x86dda1[_0x70b2('0x2c')]){_0x86dda1[_0x70b2('0x2c')]=moment(_0x86dda1['dateEnd'])[_0x70b2('0x37')](0x1,'day');}else{_0x86dda1[_0x70b2('0x2c')]=moment(_0x86dda1[_0x70b2('0x2b')])[_0x70b2('0x37')](0x1,_0x70b2('0x38'));}_[_0x70b2('0x39')](_0x693189[_0x70b2('0x35')],{'createdAt':{'$gte':_0x86dda1[_0x70b2('0x2b')],'$lte':_0x86dda1[_0x70b2('0x2c')]}});}if(_0x1b973d[_0x70b2('0x2a')]['filter']){_0x693189[_0x70b2('0x35')]=_[_0x70b2('0x39')](_0x693189[_0x70b2('0x35')],{'$or':_[_0x70b2('0x3a')](_0x2d37b4,function(_0xa3a894){if(_0xa3a894['type'][_0x70b2('0x3b')]!==_0x70b2('0x3c')){var _0x5e3869={};_0x5e3869[_0xa3a894[_0x70b2('0x3d')]]={'$like':'%'+_0x1b973d[_0x70b2('0x2a')]['filter']+'%'};return _0x5e3869;}})});}_0x693189=_[_0x70b2('0x39')]({},_0x693189,_0x1b973d[_0x70b2('0x3e')]);var _0x1b4193={'where':_0x693189[_0x70b2('0x35')]};return db['SAProductOrder'][_0x70b2('0x19')](_0x1b4193)[_0x70b2('0x21')](function(_0x1c5998){_0x4c9ba9['count']=_0x1c5998;if(_0x1b973d[_0x70b2('0x2a')]['includeAll']){_0x693189[_0x70b2('0x3f')]=[{'all':!![]}];}return db[_0x70b2('0x40')]['findAll'](_0x693189);})[_0x70b2('0x21')](function(_0x85be7e){_0x4c9ba9['rows']=_0x85be7e;return _0x4c9ba9;})['then'](respondWithFilteredResult(_0x53662b,_0x693189))[_0x70b2('0x41')](handleError(_0x53662b,null));};exports['show']=function(_0x559ad6,_0x19342a){var _0x20be92={'raw':!![],'where':{'id':_0x559ad6['params']['id']}},_0x12a08a={};_0x12a08a[_0x70b2('0x28')]=_['keys'](db[_0x70b2('0x40')][_0x70b2('0x27')]);_0x12a08a[_0x70b2('0x2a')]=_[_0x70b2('0x29')](_0x559ad6[_0x70b2('0x2a')]);_0x12a08a[_0x70b2('0x36')]=_['intersection'](_0x12a08a[_0x70b2('0x28')],_0x12a08a[_0x70b2('0x2a')]);_0x20be92[_0x70b2('0x2f')]=_[_0x70b2('0x2d')](_0x12a08a['model'],qs['fields'](_0x559ad6[_0x70b2('0x2a')][_0x70b2('0x2e')]));_0x20be92[_0x70b2('0x2f')]=_0x20be92[_0x70b2('0x2f')][_0x70b2('0x30')]?_0x20be92[_0x70b2('0x2f')]:_0x12a08a[_0x70b2('0x28')];if(_0x559ad6[_0x70b2('0x2a')][_0x70b2('0x42')]){_0x20be92['include']=[{'all':!![]}];}_0x20be92=_[_0x70b2('0x39')]({},_0x20be92,_0x559ad6[_0x70b2('0x3e')]);return db[_0x70b2('0x40')][_0x70b2('0x43')](_0x20be92)[_0x70b2('0x21')](handleEntityNotFound(_0x19342a,null))['then'](respondWithResult(_0x19342a,null))['catch'](handleError(_0x19342a,null));};exports[_0x70b2('0x44')]=function(_0x172d13,_0x666814){return db[_0x70b2('0x40')]['create'](_0x172d13[_0x70b2('0x45')],{})[_0x70b2('0x21')](respondWithResult(_0x666814,0xc9))[_0x70b2('0x41')](handleError(_0x666814,null));};exports[_0x70b2('0x20')]=function(_0x1e3fd7,_0x5e18dc){if(_0x1e3fd7[_0x70b2('0x45')]['id']){delete _0x1e3fd7[_0x70b2('0x45')]['id'];}return db[_0x70b2('0x40')][_0x70b2('0x43')]({'where':{'id':_0x1e3fd7[_0x70b2('0x46')]['id']}})[_0x70b2('0x21')](handleEntityNotFound(_0x5e18dc,null))['then'](saveUpdates(_0x1e3fd7[_0x70b2('0x45')],null))['then'](respondWithResult(_0x5e18dc,null))[_0x70b2('0x41')](handleError(_0x5e18dc,null));};exports[_0x70b2('0x22')]=function(_0x2ed00e,_0xc0ec16){return db[_0x70b2('0x40')][_0x70b2('0x43')]({'where':{'id':_0x2ed00e[_0x70b2('0x46')]['id']}})[_0x70b2('0x21')](handleEntityNotFound(_0xc0ec16,null))[_0x70b2('0x21')](removeEntity(_0xc0ec16,null))['catch'](handleError(_0xc0ec16,null));};exports['describe']=function(_0x385fe6,_0x2cfefd){return db[_0x70b2('0x40')][_0x70b2('0x47')]()[_0x70b2('0x21')](respondWithResult(_0x2cfefd,null))[_0x70b2('0x41')](handleError(_0x2cfefd,null));}; \ No newline at end of file +var _0xbc6b=['count','then','includeAll','include','findAll','catch','show','params','fields','find','create','body','describe','eml-format','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','api','../../config/utils','status','end','json','offset','limit','set','Content-Range','apply','save','update','destroy','sendStatus','error','stack','name','send','SAProductOrder','rawAttributes','keys','query','dateStart','dateEnd','filters','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','day','add','merge','filter','map','type','key','VIRTUAL','field','options'];(function(_0x294683,_0x46fb29){var _0x22196e=function(_0xe72522){while(--_0xe72522){_0x294683['push'](_0x294683['shift']());}};_0x22196e(++_0x46fb29);}(_0xbc6b,0x19f));var _0xbbc6=function(_0x41d432,_0x20e878){_0x41d432=_0x41d432-0x0;var _0x1650f9=_0xbc6b[_0x41d432];return _0x1650f9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbbc6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xbbc6('0x1'));var sox=require('sox');var csv=require(_0xbbc6('0x2'));var ejs=require(_0xbbc6('0x3'));var fs=require('fs');var _=require(_0xbbc6('0x4'));var squel=require(_0xbbc6('0x5'));var crypto=require('crypto');var jsforce=require(_0xbbc6('0x6'));var deskjs=require(_0xbbc6('0x7'));var toCsv=require(_0xbbc6('0x2'));var querystring=require(_0xbbc6('0x8'));var Papa=require('papaparse');var Redis=require(_0xbbc6('0x9'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xbbc6('0xa'));var utils=require(_0xbbc6('0xb'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55914c,_0x365e4e){_0x365e4e=_0x365e4e||0xcc;return function(_0x46a794){if(_0x46a794){return _0x55914c['sendStatus'](_0x365e4e);}return _0x55914c[_0xbbc6('0xc')](_0x365e4e)[_0xbbc6('0xd')]();};}function respondWithResult(_0x553155,_0x415768){_0x415768=_0x415768||0xc8;return function(_0x5b20ef){if(_0x5b20ef){return _0x553155[_0xbbc6('0xc')](_0x415768)[_0xbbc6('0xe')](_0x5b20ef);}};}function respondWithFilteredResult(_0x19dd6c,_0xf0de7b){return function(_0x1b4713){if(_0x1b4713){var _0x2b10d6=_0x1b4713['count'],_0x580ce5=_0xf0de7b[_0xbbc6('0xf')],_0x103506=_0xf0de7b[_0xbbc6('0xf')]+_0xf0de7b[_0xbbc6('0x10')],_0x306fde;if(_0x103506>=_0x2b10d6){_0x103506=_0x2b10d6;_0x306fde=0xc8;}else{_0x306fde=0xce;}_0x19dd6c[_0xbbc6('0xc')](_0x306fde);return _0x19dd6c[_0xbbc6('0x11')](_0xbbc6('0x12'),_0x580ce5+'-'+_0x103506+'/'+_0x2b10d6)[_0xbbc6('0xe')](_0x1b4713);}return null;};}function patchUpdates(_0x2998c8){return function(_0x9fb738){try{jsonpatch[_0xbbc6('0x13')](_0x9fb738,_0x2998c8,!![]);}catch(_0x182757){return BPromise['reject'](_0x182757);}return _0x9fb738[_0xbbc6('0x14')]();};}function saveUpdates(_0x58cc9b,_0x4da9c0){return function(_0x3fb336){if(_0x3fb336){return _0x3fb336[_0xbbc6('0x15')](_0x58cc9b)['then'](function(_0x459c11){return _0x459c11;});}return null;};}function removeEntity(_0x33b6c8,_0x1631dd){return function(_0x55239e){if(_0x55239e){return _0x55239e[_0xbbc6('0x16')]()['then'](function(){_0x33b6c8[_0xbbc6('0xc')](0xcc)[_0xbbc6('0xd')]();});}};}function handleEntityNotFound(_0x41ce91,_0x1cac35){return function(_0x2c799e){if(!_0x2c799e){_0x41ce91[_0xbbc6('0x17')](0x194);}return _0x2c799e;};}function handleError(_0x37ea4c,_0x2963c5){_0x2963c5=_0x2963c5||0x1f4;return function(_0xb8dc03){logger[_0xbbc6('0x18')](_0xb8dc03[_0xbbc6('0x19')]);if(_0xb8dc03[_0xbbc6('0x1a')]){delete _0xb8dc03['name'];}_0x37ea4c['status'](_0x2963c5)[_0xbbc6('0x1b')](_0xb8dc03);};}exports['index']=function(_0x1daa61,_0x40c950){var _0x449670={'raw':!![]},_0x11327c={},_0x82bc03={'count':0x0,'rows':[]};var _0x372f2c=db[_0xbbc6('0x1c')][_0xbbc6('0x1d')];_0x11327c['model']=_[_0xbbc6('0x1e')](_0x372f2c);var _0x35327e={'dateStart':_0x1daa61[_0xbbc6('0x1f')][_0xbbc6('0x20')],'dateEnd':_0x1daa61[_0xbbc6('0x1f')]['dateEnd']};delete _0x1daa61[_0xbbc6('0x1f')][_0xbbc6('0x20')];delete _0x1daa61[_0xbbc6('0x1f')][_0xbbc6('0x21')];_0x11327c[_0xbbc6('0x1f')]=_[_0xbbc6('0x1e')](_0x1daa61['query']);_0x11327c[_0xbbc6('0x22')]=_['intersection'](_0x11327c[_0xbbc6('0x23')],_0x11327c[_0xbbc6('0x1f')]);_0x449670[_0xbbc6('0x24')]=_['intersection'](_0x11327c[_0xbbc6('0x23')],qs['fields'](_0x1daa61[_0xbbc6('0x1f')]['fields']));_0x449670[_0xbbc6('0x24')]=_0x449670[_0xbbc6('0x24')][_0xbbc6('0x25')]?_0x449670[_0xbbc6('0x24')]:_0x11327c[_0xbbc6('0x23')];if(!_0x1daa61[_0xbbc6('0x1f')][_0xbbc6('0x26')](_0xbbc6('0x27'))){_0x449670[_0xbbc6('0x10')]=qs[_0xbbc6('0x10')](_0x1daa61[_0xbbc6('0x1f')][_0xbbc6('0x10')]);_0x449670['offset']=qs['offset'](_0x1daa61[_0xbbc6('0x1f')]['offset']);}_0x449670[_0xbbc6('0x28')]=qs['sort'](_0x1daa61[_0xbbc6('0x1f')][_0xbbc6('0x29')]);_0x449670[_0xbbc6('0x2a')]=qs['filters'](_[_0xbbc6('0x2b')](_0x1daa61[_0xbbc6('0x1f')],_0x11327c[_0xbbc6('0x22')]));if(_0x35327e[_0xbbc6('0x20')]){if(_0x35327e[_0xbbc6('0x21')]){_0x35327e[_0xbbc6('0x21')]=moment(_0x35327e[_0xbbc6('0x21')])['add'](0x1,_0xbbc6('0x2c'));}else{_0x35327e['dateEnd']=moment(_0x35327e['dateStart'])[_0xbbc6('0x2d')](0x1,_0xbbc6('0x2c'));}_[_0xbbc6('0x2e')](_0x449670['where'],{'createdAt':{'$gte':_0x35327e[_0xbbc6('0x20')],'$lte':_0x35327e['dateEnd']}});}if(_0x1daa61[_0xbbc6('0x1f')][_0xbbc6('0x2f')]){_0x449670[_0xbbc6('0x2a')]=_[_0xbbc6('0x2e')](_0x449670['where'],{'$or':_[_0xbbc6('0x30')](_0x372f2c,function(_0x5026e3){if(_0x5026e3[_0xbbc6('0x31')][_0xbbc6('0x32')]!==_0xbbc6('0x33')){var _0x5dc6e3={};_0x5dc6e3[_0x5026e3[_0xbbc6('0x34')]]={'$like':'%'+_0x1daa61[_0xbbc6('0x1f')]['filter']+'%'};return _0x5dc6e3;}})});}_0x449670=_[_0xbbc6('0x2e')]({},_0x449670,_0x1daa61[_0xbbc6('0x35')]);var _0x4e820b={'where':_0x449670[_0xbbc6('0x2a')]};return db['SAProductOrder'][_0xbbc6('0x36')](_0x4e820b)[_0xbbc6('0x37')](function(_0x51985c){_0x82bc03[_0xbbc6('0x36')]=_0x51985c;if(_0x1daa61[_0xbbc6('0x1f')][_0xbbc6('0x38')]){_0x449670[_0xbbc6('0x39')]=[{'all':!![]}];}return db['SAProductOrder'][_0xbbc6('0x3a')](_0x449670);})['then'](function(_0x3c01ee){_0x82bc03['rows']=_0x3c01ee;return _0x82bc03;})['then'](respondWithFilteredResult(_0x40c950,_0x449670))[_0xbbc6('0x3b')](handleError(_0x40c950,null));};exports[_0xbbc6('0x3c')]=function(_0x2f2a2a,_0x25427){var _0x171883={'raw':!![],'where':{'id':_0x2f2a2a[_0xbbc6('0x3d')]['id']}},_0x39c91e={};_0x39c91e[_0xbbc6('0x23')]=_[_0xbbc6('0x1e')](db[_0xbbc6('0x1c')][_0xbbc6('0x1d')]);_0x39c91e[_0xbbc6('0x1f')]=_[_0xbbc6('0x1e')](_0x2f2a2a['query']);_0x39c91e[_0xbbc6('0x22')]=_['intersection'](_0x39c91e[_0xbbc6('0x23')],_0x39c91e[_0xbbc6('0x1f')]);_0x171883['attributes']=_['intersection'](_0x39c91e[_0xbbc6('0x23')],qs['fields'](_0x2f2a2a[_0xbbc6('0x1f')][_0xbbc6('0x3e')]));_0x171883['attributes']=_0x171883[_0xbbc6('0x24')][_0xbbc6('0x25')]?_0x171883[_0xbbc6('0x24')]:_0x39c91e[_0xbbc6('0x23')];if(_0x2f2a2a[_0xbbc6('0x1f')][_0xbbc6('0x38')]){_0x171883['include']=[{'all':!![]}];}_0x171883=_[_0xbbc6('0x2e')]({},_0x171883,_0x2f2a2a[_0xbbc6('0x35')]);return db['SAProductOrder'][_0xbbc6('0x3f')](_0x171883)[_0xbbc6('0x37')](handleEntityNotFound(_0x25427,null))[_0xbbc6('0x37')](respondWithResult(_0x25427,null))[_0xbbc6('0x3b')](handleError(_0x25427,null));};exports['create']=function(_0x4bd549,_0x280095){return db[_0xbbc6('0x1c')][_0xbbc6('0x40')](_0x4bd549['body'],{})[_0xbbc6('0x37')](respondWithResult(_0x280095,0xc9))[_0xbbc6('0x3b')](handleError(_0x280095,null));};exports[_0xbbc6('0x15')]=function(_0x405d90,_0x4806d3){if(_0x405d90['body']['id']){delete _0x405d90['body']['id'];}return db[_0xbbc6('0x1c')][_0xbbc6('0x3f')]({'where':{'id':_0x405d90[_0xbbc6('0x3d')]['id']}})[_0xbbc6('0x37')](handleEntityNotFound(_0x4806d3,null))['then'](saveUpdates(_0x405d90[_0xbbc6('0x41')],null))[_0xbbc6('0x37')](respondWithResult(_0x4806d3,null))[_0xbbc6('0x3b')](handleError(_0x4806d3,null));};exports[_0xbbc6('0x16')]=function(_0x44f775,_0x3d8170){return db[_0xbbc6('0x1c')]['find']({'where':{'id':_0x44f775['params']['id']}})[_0xbbc6('0x37')](handleEntityNotFound(_0x3d8170,null))[_0xbbc6('0x37')](removeEntity(_0x3d8170,null))[_0xbbc6('0x3b')](handleError(_0x3d8170,null));};exports['describe']=function(_0x1ba213,_0x1be34f){return db[_0xbbc6('0x1c')][_0xbbc6('0x42')]()['then'](respondWithResult(_0x1be34f,null))[_0xbbc6('0x3b')](handleError(_0x1be34f,null));}; \ No newline at end of file diff --git a/server/api/saProductOrder/saProductOrder.model.js b/server/api/saProductOrder/saProductOrder.model.js index be70a22..690df57 100644 --- a/server/api/saProductOrder/saProductOrder.model.js +++ b/server/api/saProductOrder/saProductOrder.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49ed=['util','../../config/logger','moment','bluebird','request-promise','./saProductOrder.attributes','exports','define','SAProductOrder','sa_product_has_order','lodash'];(function(_0x836342,_0x8287ed){var _0xc82e8d=function(_0x243ba4){while(--_0x243ba4){_0x836342['push'](_0x836342['shift']());}};_0xc82e8d(++_0x8287ed);}(_0x49ed,0xc5));var _0xd49e=function(_0x3e4f99,_0x286b42){_0x3e4f99=_0x3e4f99-0x0;var _0x22ca09=_0x49ed[_0x3e4f99];return _0x22ca09;};'use strict';var _=require(_0xd49e('0x0'));var util=require(_0xd49e('0x1'));var logger=require(_0xd49e('0x2'))('api');var moment=require(_0xd49e('0x3'));var BPromise=require(_0xd49e('0x4'));var rp=require(_0xd49e('0x5'));var attributes=require(_0xd49e('0x6'));module[_0xd49e('0x7')]=function(_0x451731,_0x4c1cdb){return _0x451731[_0xd49e('0x8')](_0xd49e('0x9'),attributes,{'tableName':_0xd49e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3413=['util','../../config/logger','bluebird','request-promise','exports','define','SAProductOrder','sa_product_has_order','lodash'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x3413,0x86));var _0x3341=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3413[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3341('0x0'));var util=require(_0x3341('0x1'));var logger=require(_0x3341('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3341('0x3'));var rp=require(_0x3341('0x4'));var attributes=require('./saProductOrder.attributes');module[_0x3341('0x5')]=function(_0x50307d,_0x200c39){return _0x50307d[_0x3341('0x6')](_0x3341('0x7'),attributes,{'tableName':_0x3341('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saProductOrder/saProductOrder.rpc.js b/server/api/saProductOrder/saProductOrder.rpc.js index 78900f4..ca3442e 100644 --- a/server/api/saProductOrder/saProductOrder.rpc.js +++ b/server/api/saProductOrder/saProductOrder.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3487=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','SAProductOrder,\x20%s,\x20%s,\x20%s','error','code','SAProductOrder,\x20%s,\x20%s','message','result','lodash','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3487,0x162));var _0x7348=function(_0x15a8fa,_0x4652b2){_0x15a8fa=_0x15a8fa-0x0;var _0x1355c2=_0x3487[_0x15a8fa];return _0x1355c2;};'use strict';var _=require(_0x7348('0x0'));var util=require('util');var moment=require(_0x7348('0x1'));var BPromise=require(_0x7348('0x2'));var rs=require(_0x7348('0x3'));var fs=require('fs');var Redis=require(_0x7348('0x4'));var db=require(_0x7348('0x5'))['db'];var utils=require(_0x7348('0x6'));var logger=require(_0x7348('0x7'))('rpc');var config=require(_0x7348('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7348('0x9')][_0x7348('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ab8e0,_0x470b9b,_0x11762d){return new BPromise(function(_0x4a97a9,_0x411edb){return client[_0x7348('0xb')](_0x3ab8e0,_0x11762d)[_0x7348('0xc')](function(_0x2c5f6b){logger[_0x7348('0xd')]('SAProductOrder,\x20%s,\x20%s',_0x470b9b,_0x7348('0xe'));logger['debug'](_0x7348('0xf'),_0x470b9b,_0x7348('0xe'),JSON['stringify'](_0x2c5f6b));if(_0x2c5f6b[_0x7348('0x10')]){if(_0x2c5f6b['error'][_0x7348('0x11')]===0x1f4){logger[_0x7348('0x10')](_0x7348('0x12'),_0x470b9b,_0x2c5f6b[_0x7348('0x10')]['message']);return _0x411edb(_0x2c5f6b[_0x7348('0x10')][_0x7348('0x13')]);}logger['error'](_0x7348('0x12'),_0x470b9b,_0x2c5f6b['error'][_0x7348('0x13')]);return _0x4a97a9(_0x2c5f6b[_0x7348('0x10')][_0x7348('0x13')]);}else{logger['info'](_0x7348('0x12'),_0x470b9b,_0x7348('0xe'));_0x4a97a9(_0x2c5f6b[_0x7348('0x14')][_0x7348('0x13')]);}})['catch'](function(_0x5bdcbd){logger['error']('SAProductOrder,\x20%s,\x20%s',_0x470b9b,_0x5bdcbd);_0x411edb(_0x5bdcbd);});});} \ No newline at end of file +var _0xb36c=['jayson/promise','client','request','then','info','SAProductOrder,\x20%s,\x20%s','request\x20sent','debug','SAProductOrder,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x29b2d0,_0x73bf4b){var _0x4af937=function(_0x1b19c9){while(--_0x1b19c9){_0x29b2d0['push'](_0x29b2d0['shift']());}};_0x4af937(++_0x73bf4b);}(_0xb36c,0x122));var _0xcb36=function(_0x2f5da3,_0x43e7d1){_0x2f5da3=_0x2f5da3-0x0;var _0x85b801=_0xb36c[_0x2f5da3];return _0x85b801;};'use strict';var _=require(_0xcb36('0x0'));var util=require(_0xcb36('0x1'));var moment=require('moment');var BPromise=require(_0xcb36('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb36('0x3'));var db=require(_0xcb36('0x4'))['db'];var utils=require(_0xcb36('0x5'));var logger=require(_0xcb36('0x6'))(_0xcb36('0x7'));var config=require(_0xcb36('0x8'));var jayson=require(_0xcb36('0x9'));var client=jayson[_0xcb36('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34bac9,_0x581096,_0x437e6d){return new BPromise(function(_0x4f8503,_0x1c75c6){return client[_0xcb36('0xb')](_0x34bac9,_0x437e6d)[_0xcb36('0xc')](function(_0x21eab0){logger[_0xcb36('0xd')](_0xcb36('0xe'),_0x581096,_0xcb36('0xf'));logger[_0xcb36('0x10')](_0xcb36('0x11'),_0x581096,_0xcb36('0xf'),JSON[_0xcb36('0x12')](_0x21eab0));if(_0x21eab0['error']){if(_0x21eab0[_0xcb36('0x13')]['code']===0x1f4){logger['error'](_0xcb36('0xe'),_0x581096,_0x21eab0['error'][_0xcb36('0x14')]);return _0x1c75c6(_0x21eab0['error'][_0xcb36('0x14')]);}logger[_0xcb36('0x13')](_0xcb36('0xe'),_0x581096,_0x21eab0[_0xcb36('0x13')][_0xcb36('0x14')]);return _0x4f8503(_0x21eab0[_0xcb36('0x13')][_0xcb36('0x14')]);}else{logger[_0xcb36('0xd')](_0xcb36('0xe'),_0x581096,'request\x20sent');_0x4f8503(_0x21eab0[_0xcb36('0x15')][_0xcb36('0x14')]);}})[_0xcb36('0x16')](function(_0x1af8fb){logger['error']('SAProductOrder,\x20%s,\x20%s',_0x581096,_0x1af8fb);_0x1c75c6(_0x1af8fb);});});} \ No newline at end of file diff --git a/server/api/saProductPricesList/index.js b/server/api/saProductPricesList/index.js index 4bfa974..bc973ee 100644 --- a/server/api/saProductPricesList/index.js +++ b/server/api/saProductPricesList/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','./saProductPricesList.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x39cf70,_0x3ec55b){var _0x580424=function(_0x580a4e){while(--_0x580a4e){_0x39cf70['push'](_0x39cf70['shift']());}};_0x580424(++_0x3ec55b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 _0xd8b0=['index','get','/describe','describe','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saProductPricesList.controller'];(function(_0x4b53f7,_0x4c368b){var _0x591cd6=function(_0x563d45){while(--_0x563d45){_0x4b53f7['push'](_0x4b53f7['shift']());}};_0x591cd6(++_0x4c368b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0x10'),auth[_0x0d8b('0xb')](),controller['update']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x12')]);module[_0x0d8b('0x13')]=router; \ No newline at end of file diff --git a/server/api/saProductPricesList/saProductPricesList.attributes.js b/server/api/saProductPricesList/saProductPricesList.attributes.js index d180528..fe94630 100644 --- a/server/api/saProductPricesList/saProductPricesList.attributes.js +++ b/server/api/saProductPricesList/saProductPricesList.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed36=['INTEGER','compositeIndex_prodID_priceID','sequelize','exports'];(function(_0x3092c4,_0x73f18f){var _0x4729b4=function(_0x1d9c7a){while(--_0x1d9c7a){_0x3092c4['push'](_0x3092c4['shift']());}};_0x4729b4(++_0x73f18f);}(_0xed36,0x182));var _0x6ed3=function(_0x2b9fa7,_0x10f043){_0x2b9fa7=_0x2b9fa7-0x0;var _0x4d0e14=_0xed36[_0x2b9fa7];return _0x4d0e14;};'use strict';var Sequelize=require(_0x6ed3('0x0'));module[_0x6ed3('0x1')]={'discount':{'type':Sequelize['DECIMAL'](0x6,0x3),'allowNull':![]},'netpricesalelist':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'ProductId':{'type':Sequelize[_0x6ed3('0x2')],'unique':'compositeIndex_prodID_priceID'},'PriceListId':{'type':Sequelize[_0x6ed3('0x2')],'unique':_0x6ed3('0x3')}}; \ No newline at end of file +var _0x5e3c=['DECIMAL','INTEGER','compositeIndex_prodID_priceID','sequelize','exports'];(function(_0x5873d8,_0x4cb64e){var _0x4c68e4=function(_0x362cfe){while(--_0x362cfe){_0x5873d8['push'](_0x5873d8['shift']());}};_0x4c68e4(++_0x4cb64e);}(_0x5e3c,0x19d));var _0xc5e3=function(_0x3e123c,_0x16e529){_0x3e123c=_0x3e123c-0x0;var _0x3e834a=_0x5e3c[_0x3e123c];return _0x3e834a;};'use strict';var Sequelize=require(_0xc5e3('0x0'));module[_0xc5e3('0x1')]={'discount':{'type':Sequelize[_0xc5e3('0x2')](0x6,0x3),'allowNull':![]},'netpricesalelist':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'ProductId':{'type':Sequelize[_0xc5e3('0x3')],'unique':_0xc5e3('0x4')},'PriceListId':{'type':Sequelize[_0xc5e3('0x3')],'unique':_0xc5e3('0x4')}}; \ No newline at end of file diff --git a/server/api/saProductPricesList/saProductPricesList.controller.js b/server/api/saProductPricesList/saProductPricesList.controller.js index e628974..7c1599d 100644 --- a/server/api/saProductPricesList/saProductPricesList.controller.js +++ b/server/api/saProductPricesList/saProductPricesList.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf6c9=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','destroy','then','end','error','stack','name','index','SAProductPricesList','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','type','key','VIRTUAL','field','merge','options','include','findAll','rows','catch','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','ejs','lodash','squel'];(function(_0x532e57,_0x284124){var _0x515149=function(_0x1d9b1e){while(--_0x1d9b1e){_0x532e57['push'](_0x532e57['shift']());}};_0x515149(++_0x284124);}(_0xf6c9,0x153));var _0x9f6c=function(_0x3a9ad0,_0x6da77a){_0x3a9ad0=_0x3a9ad0-0x0;var _0x236e94=_0xf6c9[_0x3a9ad0];return _0x236e94;};'use strict';var pdf=require(_0x9f6c('0x0'));var emlformat=require(_0x9f6c('0x1'));var rimraf=require(_0x9f6c('0x2'));var zipdir=require(_0x9f6c('0x3'));var jsonpatch=require(_0x9f6c('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9f6c('0x5'));var util=require('util');var path=require(_0x9f6c('0x6'));var sox=require(_0x9f6c('0x7'));var csv=require('to-csv');var ejs=require(_0x9f6c('0x8'));var fs=require('fs');var _=require(_0x9f6c('0x9'));var squel=require(_0x9f6c('0xa'));var crypto=require(_0x9f6c('0xb'));var jsforce=require(_0x9f6c('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9f6c('0xd'));var Papa=require(_0x9f6c('0xe'));var Redis=require(_0x9f6c('0xf'));var authService=require(_0x9f6c('0x10'));var qs=require(_0x9f6c('0x11'));var hardwareService=require(_0x9f6c('0x12'));var logger=require(_0x9f6c('0x13'))(_0x9f6c('0x14'));var utils=require(_0x9f6c('0x15'));var config=require('../../config/environment');var db=require(_0x9f6c('0x16'))['db'];function respondWithStatusCode(_0x22fb03,_0x5d33ce){_0x5d33ce=_0x5d33ce||0xcc;return function(_0x5cabdb){if(_0x5cabdb){return _0x22fb03[_0x9f6c('0x17')](_0x5d33ce);}return _0x22fb03[_0x9f6c('0x18')](_0x5d33ce)['end']();};}function respondWithResult(_0x1c0cb3,_0xe596e1){_0xe596e1=_0xe596e1||0xc8;return function(_0x5003ba){if(_0x5003ba){return _0x1c0cb3['status'](_0xe596e1)[_0x9f6c('0x19')](_0x5003ba);}};}function respondWithFilteredResult(_0xefb3bc,_0xd0afad){return function(_0x156cce){if(_0x156cce){var _0x281a82=_0x156cce[_0x9f6c('0x1a')],_0x26994f=_0xd0afad[_0x9f6c('0x1b')],_0x38bd98=_0xd0afad[_0x9f6c('0x1b')]+_0xd0afad[_0x9f6c('0x1c')],_0x5b6b;if(_0x38bd98>=_0x281a82){_0x38bd98=_0x281a82;_0x5b6b=0xc8;}else{_0x5b6b=0xce;}_0xefb3bc[_0x9f6c('0x18')](_0x5b6b);return _0xefb3bc[_0x9f6c('0x1d')]('Content-Range',_0x26994f+'-'+_0x38bd98+'/'+_0x281a82)[_0x9f6c('0x19')](_0x156cce);}return null;};}function patchUpdates(_0xb31333){return function(_0x3d7b8b){try{jsonpatch[_0x9f6c('0x1e')](_0x3d7b8b,_0xb31333,!![]);}catch(_0x230b62){return BPromise[_0x9f6c('0x1f')](_0x230b62);}return _0x3d7b8b[_0x9f6c('0x20')]();};}function saveUpdates(_0x5ea5f9,_0x4b8b3a){return function(_0x2f26ec){if(_0x2f26ec){return _0x2f26ec[_0x9f6c('0x21')](_0x5ea5f9)['then'](function(_0x250dda){return _0x250dda;});}return null;};}function removeEntity(_0x272b92,_0x5116ef){return function(_0x393084){if(_0x393084){return _0x393084[_0x9f6c('0x22')]()[_0x9f6c('0x23')](function(){_0x272b92[_0x9f6c('0x18')](0xcc)[_0x9f6c('0x24')]();});}};}function handleEntityNotFound(_0x123082,_0x3d07b7){return function(_0x2f4428){if(!_0x2f4428){_0x123082[_0x9f6c('0x17')](0x194);}return _0x2f4428;};}function handleError(_0x59c754,_0x23fb8d){_0x23fb8d=_0x23fb8d||0x1f4;return function(_0x2c366b){logger[_0x9f6c('0x25')](_0x2c366b[_0x9f6c('0x26')]);if(_0x2c366b[_0x9f6c('0x27')]){delete _0x2c366b[_0x9f6c('0x27')];}_0x59c754['status'](_0x23fb8d)['send'](_0x2c366b);};}exports[_0x9f6c('0x28')]=function(_0xcd7e9f,_0x25dd84){var _0x545bc0={},_0x500fb3={},_0x20ddd9={'count':0x0,'rows':[]};var _0x1f04bb=db[_0x9f6c('0x29')]['rawAttributes'];_0x500fb3[_0x9f6c('0x2a')]=_[_0x9f6c('0x2b')](_0x1f04bb);_0x500fb3['query']=_[_0x9f6c('0x2b')](_0xcd7e9f[_0x9f6c('0x2c')]);_0x500fb3['filters']=_[_0x9f6c('0x2d')](_0x500fb3[_0x9f6c('0x2a')],_0x500fb3[_0x9f6c('0x2c')]);_0x545bc0[_0x9f6c('0x2e')]=_[_0x9f6c('0x2d')](_0x500fb3[_0x9f6c('0x2a')],qs[_0x9f6c('0x2f')](_0xcd7e9f[_0x9f6c('0x2c')][_0x9f6c('0x2f')]));_0x545bc0['attributes']=_0x545bc0[_0x9f6c('0x2e')][_0x9f6c('0x30')]?_0x545bc0[_0x9f6c('0x2e')]:_0x500fb3['model'];if(!_0xcd7e9f[_0x9f6c('0x2c')][_0x9f6c('0x31')]('nolimit')){_0x545bc0[_0x9f6c('0x1c')]=qs['limit'](_0xcd7e9f[_0x9f6c('0x2c')][_0x9f6c('0x1c')]);_0x545bc0[_0x9f6c('0x1b')]=qs['offset'](_0xcd7e9f[_0x9f6c('0x2c')][_0x9f6c('0x1b')]);}_0x545bc0[_0x9f6c('0x32')]=qs[_0x9f6c('0x33')](_0xcd7e9f[_0x9f6c('0x2c')][_0x9f6c('0x33')]);_0x545bc0[_0x9f6c('0x34')]=qs[_0x9f6c('0x35')](_[_0x9f6c('0x36')](_0xcd7e9f[_0x9f6c('0x2c')],_0x500fb3['filters']));if(_0xcd7e9f[_0x9f6c('0x2c')]['filter']){_0x545bc0[_0x9f6c('0x34')]=_['merge'](_0x545bc0[_0x9f6c('0x34')],{'$or':_['map'](_0x1f04bb,function(_0x2d951c){if(_0x2d951c[_0x9f6c('0x37')][_0x9f6c('0x38')]!==_0x9f6c('0x39')){var _0x2d65e6={};_0x2d65e6[_0x2d951c[_0x9f6c('0x3a')]]={'$like':'%'+_0xcd7e9f[_0x9f6c('0x2c')]['filter']+'%'};return _0x2d65e6;}})});}_0x545bc0=_[_0x9f6c('0x3b')]({},_0x545bc0,_0xcd7e9f[_0x9f6c('0x3c')]);var _0x164157={'where':_0x545bc0[_0x9f6c('0x34')]};return db[_0x9f6c('0x29')][_0x9f6c('0x1a')](_0x164157)[_0x9f6c('0x23')](function(_0x30b4f3){_0x20ddd9[_0x9f6c('0x1a')]=_0x30b4f3;if(_0xcd7e9f['query']['includeAll']){_0x545bc0[_0x9f6c('0x3d')]=[{'all':!![]}];}return db[_0x9f6c('0x29')][_0x9f6c('0x3e')](_0x545bc0);})[_0x9f6c('0x23')](function(_0x5cf6a3){_0x20ddd9[_0x9f6c('0x3f')]=_0x5cf6a3;return _0x20ddd9;})[_0x9f6c('0x23')](respondWithFilteredResult(_0x25dd84,_0x545bc0))[_0x9f6c('0x40')](handleError(_0x25dd84,null));};exports['show']=function(_0x64325b,_0x63f2ee){var _0x8f94d={'raw':![],'where':{'id':_0x64325b['params']['id']}},_0x4339aa={};_0x4339aa[_0x9f6c('0x2a')]=_[_0x9f6c('0x2b')](db[_0x9f6c('0x29')]['rawAttributes']);_0x4339aa['query']=_[_0x9f6c('0x2b')](_0x64325b[_0x9f6c('0x2c')]);_0x4339aa['filters']=_['intersection'](_0x4339aa[_0x9f6c('0x2a')],_0x4339aa[_0x9f6c('0x2c')]);_0x8f94d[_0x9f6c('0x2e')]=_['intersection'](_0x4339aa[_0x9f6c('0x2a')],qs[_0x9f6c('0x2f')](_0x64325b['query'][_0x9f6c('0x2f')]));_0x8f94d[_0x9f6c('0x2e')]=_0x8f94d[_0x9f6c('0x2e')]['length']?_0x8f94d['attributes']:_0x4339aa['model'];if(_0x64325b[_0x9f6c('0x2c')]['includeAll']){_0x8f94d[_0x9f6c('0x3d')]=[{'all':!![]}];}_0x8f94d=_[_0x9f6c('0x3b')]({},_0x8f94d,_0x64325b[_0x9f6c('0x3c')]);return db[_0x9f6c('0x29')][_0x9f6c('0x41')](_0x8f94d)[_0x9f6c('0x23')](handleEntityNotFound(_0x63f2ee,null))['then'](respondWithResult(_0x63f2ee,null))[_0x9f6c('0x40')](handleError(_0x63f2ee,null));};exports['create']=function(_0x214afa,_0x500541){return db[_0x9f6c('0x29')][_0x9f6c('0x42')](_0x214afa[_0x9f6c('0x43')],{})[_0x9f6c('0x23')](respondWithResult(_0x500541,0xc9))[_0x9f6c('0x40')](handleError(_0x500541,null));};exports['update']=function(_0x28f7e0,_0x3dad26){if(_0x28f7e0['body']['id']){delete _0x28f7e0[_0x9f6c('0x43')]['id'];}return db['SAProductPricesList'][_0x9f6c('0x41')]({'where':{'id':_0x28f7e0[_0x9f6c('0x44')]['id']}})[_0x9f6c('0x23')](handleEntityNotFound(_0x3dad26,null))['then'](saveUpdates(_0x28f7e0[_0x9f6c('0x43')],null))[_0x9f6c('0x23')](respondWithResult(_0x3dad26,null))[_0x9f6c('0x40')](handleError(_0x3dad26,null));};exports[_0x9f6c('0x22')]=function(_0x2cf223,_0x1ef32e){return db[_0x9f6c('0x29')][_0x9f6c('0x41')]({'where':{'id':_0x2cf223['params']['id']}})[_0x9f6c('0x23')](handleEntityNotFound(_0x1ef32e,null))[_0x9f6c('0x23')](removeEntity(_0x1ef32e,null))[_0x9f6c('0x40')](handleError(_0x1ef32e,null));};exports[_0x9f6c('0x45')]=function(_0x2db023,_0x23f32c){return db[_0x9f6c('0x29')][_0x9f6c('0x45')]()[_0x9f6c('0x23')](respondWithResult(_0x23f32c,null))['catch'](handleError(_0x23f32c,null));}; \ No newline at end of file +var _0xa46d=['includeAll','include','findAll','rows','show','params','intersection','create','catch','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','SAProductPricesList','model','keys','query','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','type','key','field','options'];(function(_0x39cd6e,_0x1d67c){var _0x404c90=function(_0x433f7d){while(--_0x433f7d){_0x39cd6e['push'](_0x39cd6e['shift']());}};_0x404c90(++_0x1d67c);}(_0xa46d,0xe1));var _0xda46=function(_0x316858,_0x519700){_0x316858=_0x316858-0x0;var _0x50a70b=_0xa46d[_0x316858];return _0x50a70b;};'use strict';var pdf=require(_0xda46('0x0'));var emlformat=require(_0xda46('0x1'));var rimraf=require(_0xda46('0x2'));var zipdir=require(_0xda46('0x3'));var jsonpatch=require(_0xda46('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xda46('0x5'));var util=require(_0xda46('0x6'));var path=require(_0xda46('0x7'));var sox=require(_0xda46('0x8'));var csv=require(_0xda46('0x9'));var ejs=require(_0xda46('0xa'));var fs=require('fs');var _=require(_0xda46('0xb'));var squel=require('squel');var crypto=require(_0xda46('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xda46('0x9'));var querystring=require(_0xda46('0xd'));var Papa=require(_0xda46('0xe'));var Redis=require(_0xda46('0xf'));var authService=require(_0xda46('0x10'));var qs=require(_0xda46('0x11'));var hardwareService=require(_0xda46('0x12'));var logger=require('../../config/logger')(_0xda46('0x13'));var utils=require(_0xda46('0x14'));var config=require(_0xda46('0x15'));var db=require(_0xda46('0x16'))['db'];function respondWithStatusCode(_0x4192f4,_0x491d49){_0x491d49=_0x491d49||0xcc;return function(_0x9205b4){if(_0x9205b4){return _0x4192f4[_0xda46('0x17')](_0x491d49);}return _0x4192f4['status'](_0x491d49)[_0xda46('0x18')]();};}function respondWithResult(_0x4b125c,_0x315f56){_0x315f56=_0x315f56||0xc8;return function(_0x42f4eb){if(_0x42f4eb){return _0x4b125c[_0xda46('0x19')](_0x315f56)[_0xda46('0x1a')](_0x42f4eb);}};}function respondWithFilteredResult(_0x50db1e,_0x3ecfef){return function(_0x3156ee){if(_0x3156ee){var _0x19d1b6=_0x3156ee[_0xda46('0x1b')],_0x26d8e1=_0x3ecfef[_0xda46('0x1c')],_0x5e2897=_0x3ecfef[_0xda46('0x1c')]+_0x3ecfef[_0xda46('0x1d')],_0x4fab8c;if(_0x5e2897>=_0x19d1b6){_0x5e2897=_0x19d1b6;_0x4fab8c=0xc8;}else{_0x4fab8c=0xce;}_0x50db1e[_0xda46('0x19')](_0x4fab8c);return _0x50db1e[_0xda46('0x1e')](_0xda46('0x1f'),_0x26d8e1+'-'+_0x5e2897+'/'+_0x19d1b6)[_0xda46('0x1a')](_0x3156ee);}return null;};}function patchUpdates(_0x3df291){return function(_0x2631bb){try{jsonpatch[_0xda46('0x20')](_0x2631bb,_0x3df291,!![]);}catch(_0x7b751d){return BPromise['reject'](_0x7b751d);}return _0x2631bb[_0xda46('0x21')]();};}function saveUpdates(_0x33793d,_0x3d590d){return function(_0x5e3d83){if(_0x5e3d83){return _0x5e3d83[_0xda46('0x22')](_0x33793d)[_0xda46('0x23')](function(_0x4270b4){return _0x4270b4;});}return null;};}function removeEntity(_0x480e9c,_0x47f15d){return function(_0x5c9c7f){if(_0x5c9c7f){return _0x5c9c7f[_0xda46('0x24')]()[_0xda46('0x23')](function(){_0x480e9c[_0xda46('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10bde9,_0x80c71d){return function(_0x29fe21){if(!_0x29fe21){_0x10bde9[_0xda46('0x17')](0x194);}return _0x29fe21;};}function handleError(_0x21c87f,_0x936e78){_0x936e78=_0x936e78||0x1f4;return function(_0x4e578f){logger['error'](_0x4e578f[_0xda46('0x25')]);if(_0x4e578f[_0xda46('0x26')]){delete _0x4e578f[_0xda46('0x26')];}_0x21c87f['status'](_0x936e78)[_0xda46('0x27')](_0x4e578f);};}exports[_0xda46('0x28')]=function(_0x57881f,_0x19ee21){var _0x2b001a={},_0x2b7b96={},_0x224bcf={'count':0x0,'rows':[]};var _0xd58ddd=db[_0xda46('0x29')]['rawAttributes'];_0x2b7b96[_0xda46('0x2a')]=_[_0xda46('0x2b')](_0xd58ddd);_0x2b7b96[_0xda46('0x2c')]=_[_0xda46('0x2b')](_0x57881f[_0xda46('0x2c')]);_0x2b7b96['filters']=_['intersection'](_0x2b7b96[_0xda46('0x2a')],_0x2b7b96[_0xda46('0x2c')]);_0x2b001a[_0xda46('0x2d')]=_['intersection'](_0x2b7b96['model'],qs[_0xda46('0x2e')](_0x57881f[_0xda46('0x2c')][_0xda46('0x2e')]));_0x2b001a[_0xda46('0x2d')]=_0x2b001a[_0xda46('0x2d')][_0xda46('0x2f')]?_0x2b001a[_0xda46('0x2d')]:_0x2b7b96[_0xda46('0x2a')];if(!_0x57881f['query']['hasOwnProperty'](_0xda46('0x30'))){_0x2b001a[_0xda46('0x1d')]=qs[_0xda46('0x1d')](_0x57881f[_0xda46('0x2c')][_0xda46('0x1d')]);_0x2b001a['offset']=qs[_0xda46('0x1c')](_0x57881f[_0xda46('0x2c')][_0xda46('0x1c')]);}_0x2b001a[_0xda46('0x31')]=qs['sort'](_0x57881f[_0xda46('0x2c')][_0xda46('0x32')]);_0x2b001a[_0xda46('0x33')]=qs[_0xda46('0x34')](_[_0xda46('0x35')](_0x57881f[_0xda46('0x2c')],_0x2b7b96[_0xda46('0x34')]));if(_0x57881f[_0xda46('0x2c')]['filter']){_0x2b001a['where']=_[_0xda46('0x36')](_0x2b001a[_0xda46('0x33')],{'$or':_['map'](_0xd58ddd,function(_0x271692){if(_0x271692[_0xda46('0x37')][_0xda46('0x38')]!=='VIRTUAL'){var _0x51d953={};_0x51d953[_0x271692[_0xda46('0x39')]]={'$like':'%'+_0x57881f[_0xda46('0x2c')]['filter']+'%'};return _0x51d953;}})});}_0x2b001a=_['merge']({},_0x2b001a,_0x57881f[_0xda46('0x3a')]);var _0x1f8193={'where':_0x2b001a[_0xda46('0x33')]};return db[_0xda46('0x29')]['count'](_0x1f8193)[_0xda46('0x23')](function(_0x8af5da){_0x224bcf[_0xda46('0x1b')]=_0x8af5da;if(_0x57881f[_0xda46('0x2c')][_0xda46('0x3b')]){_0x2b001a[_0xda46('0x3c')]=[{'all':!![]}];}return db['SAProductPricesList'][_0xda46('0x3d')](_0x2b001a);})[_0xda46('0x23')](function(_0x70d311){_0x224bcf[_0xda46('0x3e')]=_0x70d311;return _0x224bcf;})['then'](respondWithFilteredResult(_0x19ee21,_0x2b001a))['catch'](handleError(_0x19ee21,null));};exports[_0xda46('0x3f')]=function(_0x594fbb,_0xd2e3ee){var _0x188199={'raw':![],'where':{'id':_0x594fbb[_0xda46('0x40')]['id']}},_0x1c7663={};_0x1c7663[_0xda46('0x2a')]=_[_0xda46('0x2b')](db[_0xda46('0x29')]['rawAttributes']);_0x1c7663[_0xda46('0x2c')]=_[_0xda46('0x2b')](_0x594fbb[_0xda46('0x2c')]);_0x1c7663['filters']=_['intersection'](_0x1c7663['model'],_0x1c7663[_0xda46('0x2c')]);_0x188199[_0xda46('0x2d')]=_[_0xda46('0x41')](_0x1c7663[_0xda46('0x2a')],qs[_0xda46('0x2e')](_0x594fbb['query'][_0xda46('0x2e')]));_0x188199['attributes']=_0x188199['attributes'][_0xda46('0x2f')]?_0x188199['attributes']:_0x1c7663['model'];if(_0x594fbb[_0xda46('0x2c')][_0xda46('0x3b')]){_0x188199[_0xda46('0x3c')]=[{'all':!![]}];}_0x188199=_['merge']({},_0x188199,_0x594fbb[_0xda46('0x3a')]);return db[_0xda46('0x29')]['find'](_0x188199)['then'](handleEntityNotFound(_0xd2e3ee,null))[_0xda46('0x23')](respondWithResult(_0xd2e3ee,null))['catch'](handleError(_0xd2e3ee,null));};exports[_0xda46('0x42')]=function(_0x3327cc,_0x38433f){return db[_0xda46('0x29')]['create'](_0x3327cc['body'],{})[_0xda46('0x23')](respondWithResult(_0x38433f,0xc9))[_0xda46('0x43')](handleError(_0x38433f,null));};exports['update']=function(_0xbf9fed,_0x35fb78){if(_0xbf9fed['body']['id']){delete _0xbf9fed[_0xda46('0x44')]['id'];}return db[_0xda46('0x29')][_0xda46('0x45')]({'where':{'id':_0xbf9fed[_0xda46('0x40')]['id']}})[_0xda46('0x23')](handleEntityNotFound(_0x35fb78,null))[_0xda46('0x23')](saveUpdates(_0xbf9fed['body'],null))[_0xda46('0x23')](respondWithResult(_0x35fb78,null))['catch'](handleError(_0x35fb78,null));};exports[_0xda46('0x24')]=function(_0x5a5819,_0x533f5b){return db[_0xda46('0x29')][_0xda46('0x45')]({'where':{'id':_0x5a5819[_0xda46('0x40')]['id']}})[_0xda46('0x23')](handleEntityNotFound(_0x533f5b,null))[_0xda46('0x23')](removeEntity(_0x533f5b,null))[_0xda46('0x43')](handleError(_0x533f5b,null));};exports['describe']=function(_0xe0f6f4,_0x3cdde7){return db['SAProductPricesList'][_0xda46('0x46')]()[_0xda46('0x23')](respondWithResult(_0x3cdde7,null))[_0xda46('0x43')](handleError(_0x3cdde7,null));}; \ No newline at end of file diff --git a/server/api/saProductPricesList/saProductPricesList.model.js b/server/api/saProductPricesList/saProductPricesList.model.js index 534335f..c6876a1 100644 --- a/server/api/saProductPricesList/saProductPricesList.model.js +++ b/server/api/saProductPricesList/saProductPricesList.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3fec=['sa_product_has_price_lists','lodash','api','moment','request-promise','../../config/environment','exports','define','SAProductPricesList'];(function(_0x356e23,_0x204e36){var _0x268fc6=function(_0x1e2a54){while(--_0x1e2a54){_0x356e23['push'](_0x356e23['shift']());}};_0x268fc6(++_0x204e36);}(_0x3fec,0x1ba));var _0xc3fe=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3fec[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc3fe('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc3fe('0x1'));var moment=require(_0xc3fe('0x2'));var BPromise=require('bluebird');var rp=require(_0xc3fe('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc3fe('0x4'));var attributes=require('./saProductPricesList.attributes');module[_0xc3fe('0x5')]=function(_0x327d2f,_0x22dd19){return _0x327d2f[_0xc3fe('0x6')](_0xc3fe('0x7'),attributes,{'tableName':_0xc3fe('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x31c2=['exports','SAProductPricesList','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./saProductPricesList.attributes'];(function(_0x8ae98b,_0x155f88){var _0xc30bd4=function(_0x5ca462){while(--_0x5ca462){_0x8ae98b['push'](_0x8ae98b['shift']());}};_0xc30bd4(++_0x155f88);}(_0x31c2,0x98));var _0x231c=function(_0x100823,_0x5b3395){_0x100823=_0x100823-0x0;var _0x164629=_0x31c2[_0x100823];return _0x164629;};'use strict';var _=require(_0x231c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x231c('0x1'));var moment=require(_0x231c('0x2'));var BPromise=require('bluebird');var rp=require(_0x231c('0x3'));var fs=require('fs');var path=require(_0x231c('0x4'));var rimraf=require(_0x231c('0x5'));var config=require(_0x231c('0x6'));var attributes=require(_0x231c('0x7'));module[_0x231c('0x8')]=function(_0x21b4df,_0x4442b9){return _0x21b4df['define'](_0x231c('0x9'),attributes,{'tableName':'sa_product_has_price_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saProductPricesList/saProductPricesList.rpc.js b/server/api/saProductPricesList/saProductPricesList.rpc.js index 852c2a2..1946364 100644 --- a/server/api/saProductPricesList/saProductPricesList.rpc.js +++ b/server/api/saProductPricesList/saProductPricesList.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf780=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','SAProductPricesList,\x20%s,\x20%s','debug','SAProductPricesList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0xf780,0x1a3));var _0x0f78=function(_0x45e7d8,_0x4cf431){_0x45e7d8=_0x45e7d8-0x0;var _0x34ec9f=_0xf780[_0x45e7d8];return _0x34ec9f;};'use strict';var _=require(_0x0f78('0x0'));var util=require('util');var moment=require(_0x0f78('0x1'));var BPromise=require(_0x0f78('0x2'));var rs=require(_0x0f78('0x3'));var fs=require('fs');var Redis=require(_0x0f78('0x4'));var db=require(_0x0f78('0x5'))['db'];var utils=require(_0x0f78('0x6'));var logger=require(_0x0f78('0x7'))(_0x0f78('0x8'));var config=require(_0x0f78('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2ab634,_0x39cfd7,_0x46290d){return new BPromise(function(_0x508834,_0x4c0755){return client['request'](_0x2ab634,_0x46290d)[_0x0f78('0xa')](function(_0x2a0942){logger[_0x0f78('0xb')](_0x0f78('0xc'),_0x39cfd7,'request\x20sent');logger[_0x0f78('0xd')](_0x0f78('0xe'),_0x39cfd7,'request\x20sent',JSON[_0x0f78('0xf')](_0x2a0942));if(_0x2a0942[_0x0f78('0x10')]){if(_0x2a0942[_0x0f78('0x10')][_0x0f78('0x11')]===0x1f4){logger['error'](_0x0f78('0xc'),_0x39cfd7,_0x2a0942[_0x0f78('0x10')][_0x0f78('0x12')]);return _0x4c0755(_0x2a0942[_0x0f78('0x10')]['message']);}logger[_0x0f78('0x10')](_0x0f78('0xc'),_0x39cfd7,_0x2a0942[_0x0f78('0x10')][_0x0f78('0x12')]);return _0x508834(_0x2a0942[_0x0f78('0x10')]['message']);}else{logger[_0x0f78('0xb')](_0x0f78('0xc'),_0x39cfd7,_0x0f78('0x13'));_0x508834(_0x2a0942[_0x0f78('0x14')][_0x0f78('0x12')]);}})[_0x0f78('0x15')](function(_0x42d211){logger[_0x0f78('0x10')](_0x0f78('0xc'),_0x39cfd7,_0x42d211);_0x4c0755(_0x42d211);});});} \ No newline at end of file +var _0xf165=['stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','info','SAProductPricesList,\x20%s,\x20%s','request\x20sent','SAProductPricesList,\x20%s,\x20%s,\x20%s'];(function(_0x417b21,_0x30f6fb){var _0x383e4e=function(_0x2f0baf){while(--_0x2f0baf){_0x417b21['push'](_0x417b21['shift']());}};_0x383e4e(++_0x30f6fb);}(_0xf165,0x11e));var _0x5f16=function(_0x59328f,_0x2ee4d5){_0x59328f=_0x59328f-0x0;var _0x14c992=_0xf165[_0x59328f];return _0x14c992;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5f16('0x0'));var BPromise=require(_0x5f16('0x1'));var rs=require(_0x5f16('0x2'));var fs=require('fs');var Redis=require(_0x5f16('0x3'));var db=require(_0x5f16('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f16('0x5'))('rpc');var config=require(_0x5f16('0x6'));var jayson=require(_0x5f16('0x7'));var client=jayson[_0x5f16('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24aa34,_0x10d9af,_0xbbd409){return new BPromise(function(_0x5341eb,_0x42f33d){return client['request'](_0x24aa34,_0xbbd409)[_0x5f16('0x9')](function(_0x1d4f4c){logger[_0x5f16('0xa')](_0x5f16('0xb'),_0x10d9af,_0x5f16('0xc'));logger['debug'](_0x5f16('0xd'),_0x10d9af,_0x5f16('0xc'),JSON[_0x5f16('0xe')](_0x1d4f4c));if(_0x1d4f4c[_0x5f16('0xf')]){if(_0x1d4f4c[_0x5f16('0xf')][_0x5f16('0x10')]===0x1f4){logger[_0x5f16('0xf')](_0x5f16('0xb'),_0x10d9af,_0x1d4f4c[_0x5f16('0xf')]['message']);return _0x42f33d(_0x1d4f4c['error'][_0x5f16('0x11')]);}logger[_0x5f16('0xf')](_0x5f16('0xb'),_0x10d9af,_0x1d4f4c['error'][_0x5f16('0x11')]);return _0x5341eb(_0x1d4f4c['error'][_0x5f16('0x11')]);}else{logger[_0x5f16('0xa')](_0x5f16('0xb'),_0x10d9af,_0x5f16('0xc'));_0x5341eb(_0x1d4f4c[_0x5f16('0x12')][_0x5f16('0x11')]);}})[_0x5f16('0x13')](function(_0x324610){logger['error'](_0x5f16('0xb'),_0x10d9af,_0x324610);_0x42f33d(_0x324610);});});} \ No newline at end of file diff --git a/server/api/saProductQuotation/index.js b/server/api/saProductQuotation/index.js index ca78c99..e0e33b3 100644 --- a/server/api/saProductQuotation/index.js +++ b/server/api/saProductQuotation/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa631=['automaticProforma','put','/:id','update','/:id/updateBulk','updateBulk','destroy','exports','util','path','connect-timeout','Router','../../config/environment','./saProductQuotation.controller','get','isAuthenticated','describe','show','post','create','automaticInvoice','/:id/automaticProforma'];(function(_0x512526,_0x29a7d2){var _0x3ee2c7=function(_0x84127a){while(--_0x84127a){_0x512526['push'](_0x512526['shift']());}};_0x3ee2c7(++_0x29a7d2);}(_0xa631,0xe4));var _0x1a63=function(_0x448d7c,_0x28911c){_0x448d7c=_0x448d7c-0x0;var _0x2629e1=_0xa631[_0x448d7c];return _0x2629e1;};'use strict';var multer=require('multer');var util=require(_0x1a63('0x0'));var path=require(_0x1a63('0x1'));var timeout=require(_0x1a63('0x2'));var express=require('express');var router=express[_0x1a63('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a63('0x4'));var controller=require(_0x1a63('0x5'));router[_0x1a63('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x1a63('0x7')](),controller[_0x1a63('0x8')]);router[_0x1a63('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x1a63('0x9')]);router[_0x1a63('0xa')]('/',auth[_0x1a63('0x7')](),controller[_0x1a63('0xb')]);router[_0x1a63('0xa')]('/:id/automaticInvoice',auth[_0x1a63('0x7')](),controller[_0x1a63('0xc')]);router[_0x1a63('0xa')](_0x1a63('0xd'),auth['isAuthenticated'](),controller[_0x1a63('0xe')]);router[_0x1a63('0xf')](_0x1a63('0x10'),auth['isAuthenticated'](),controller[_0x1a63('0x11')]);router['put'](_0x1a63('0x12'),auth[_0x1a63('0x7')](),controller[_0x1a63('0x13')]);router['delete']('/:id',auth[_0x1a63('0x7')](),controller[_0x1a63('0x14')]);module[_0x1a63('0x15')]=router; \ No newline at end of file +var _0x8585=['automaticProforma','put','update','/:id/updateBulk','updateBulk','delete','destroy','exports','multer','util','path','express','Router','./saProductQuotation.controller','get','/describe','isAuthenticated','/:id','create','/:id/automaticInvoice','automaticInvoice','post','/:id/automaticProforma'];(function(_0x437ff6,_0x514be8){var _0x2edcc2=function(_0x4fde92){while(--_0x4fde92){_0x437ff6['push'](_0x437ff6['shift']());}};_0x2edcc2(++_0x514be8);}(_0x8585,0x64));var _0x5858=function(_0xe9b460,_0x904443){_0xe9b460=_0xe9b460-0x0;var _0xc0fead=_0x8585[_0xe9b460];return _0xc0fead;};'use strict';var multer=require(_0x5858('0x0'));var util=require(_0x5858('0x1'));var path=require(_0x5858('0x2'));var timeout=require('connect-timeout');var express=require(_0x5858('0x3'));var router=express[_0x5858('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5858('0x5'));router[_0x5858('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5858('0x6')](_0x5858('0x7'),auth[_0x5858('0x8')](),controller['describe']);router['get'](_0x5858('0x9'),auth[_0x5858('0x8')](),controller['show']);router['post']('/',auth[_0x5858('0x8')](),controller[_0x5858('0xa')]);router['post'](_0x5858('0xb'),auth[_0x5858('0x8')](),controller[_0x5858('0xc')]);router[_0x5858('0xd')](_0x5858('0xe'),auth[_0x5858('0x8')](),controller[_0x5858('0xf')]);router[_0x5858('0x10')](_0x5858('0x9'),auth['isAuthenticated'](),controller[_0x5858('0x11')]);router[_0x5858('0x10')](_0x5858('0x12'),auth['isAuthenticated'](),controller[_0x5858('0x13')]);router[_0x5858('0x14')](_0x5858('0x9'),auth[_0x5858('0x8')](),controller[_0x5858('0x15')]);module[_0x5858('0x16')]=router; \ No newline at end of file diff --git a/server/api/saProductQuotation/saProductQuotation.attributes.js b/server/api/saProductQuotation/saProductQuotation.attributes.js index 0e4462a..a8d1a19 100644 --- a/server/api/saProductQuotation/saProductQuotation.attributes.js +++ b/server/api/saProductQuotation/saProductQuotation.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4eba=['STRING','compositeIndex_prodCode_QuotationID','INTEGER','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','DECIMAL','BOOLEAN','DATE','sequelize','TEXT'];(function(_0xbff27e,_0x5b58f4){var _0x595d4c=function(_0x73564b){while(--_0x73564b){_0xbff27e['push'](_0xbff27e['shift']());}};_0x595d4c(++_0x5b58f4);}(_0x4eba,0x17a));var _0xa4eb=function(_0x1a3f55,_0x49554c){_0x1a3f55=_0x1a3f55-0x0;var _0x162e2d=_0x4eba[_0x1a3f55];return _0x162e2d;};'use strict';var Sequelize=require(_0xa4eb('0x0'));module['exports']={'productName':{'type':Sequelize[_0xa4eb('0x1')],'allowNull':![]},'productCode':{'type':Sequelize[_0xa4eb('0x2')],'allowNull':![],'unique':_0xa4eb('0x3')},'productNetPrice':{'type':Sequelize['DECIMAL'](0xd,0x4)},'productTax':{'type':Sequelize[_0xa4eb('0x4')]},'productDescription':{'type':Sequelize['TEXT'](_0xa4eb('0x5'))+_0xa4eb('0x6')},'productQtyMin':{'type':Sequelize['INTEGER'],'allowNull':!![]},'pricelistName':{'type':Sequelize[_0xa4eb('0x1')]},'pricelistDiscount':{'type':Sequelize[_0xa4eb('0x7')](0x6,0x3),'allowNull':![]},'productPricelistDiscount':{'type':Sequelize[_0xa4eb('0x7')](0xd,0x4),'allowNull':![]},'productPricelistNetPrice':{'type':Sequelize[_0xa4eb('0x7')](0xd,0x4)},'netPrice':{'type':Sequelize[_0xa4eb('0x7')](0xd,0x4),'allowNull':![]},'quantity':{'type':Sequelize[_0xa4eb('0x7')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize[_0xa4eb('0x7')](0x6,0x3),'allowNull':![]},'totalPrice':{'type':Sequelize[_0xa4eb('0x7')](0xd,0x4),'allowNull':![]},'tax':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'totalDiscount':{'type':Sequelize[_0xa4eb('0x7')](0xd,0x4),'allowNull':![]},'totalTax':{'type':Sequelize[_0xa4eb('0x7')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0xa4eb('0x2')]},'note':{'type':Sequelize[_0xa4eb('0x1')]},'QuotationId':{'type':Sequelize[_0xa4eb('0x4')],'unique':'compositeIndex_prodCode_QuotationID'},'totalPrice':{'type':Sequelize[_0xa4eb('0x7')](0xd,0x4)},'totalTax':{'type':Sequelize[_0xa4eb('0x7')](0xd,0x4)},'typeName':{'type':Sequelize[_0xa4eb('0x2')]},'TypeId':{'type':Sequelize[_0xa4eb('0x4')]},'unitName':{'type':Sequelize[_0xa4eb('0x2')]},'UnitId':{'type':Sequelize[_0xa4eb('0x4')]},'subscriptionName':{'type':Sequelize[_0xa4eb('0x2')]},'subscriptionId':{'type':Sequelize[_0xa4eb('0x4')]},'subscriptionMonthly':{'type':Sequelize[_0xa4eb('0x4')]},'companyName':{'type':Sequelize[_0xa4eb('0x2')]},'companyId':{'type':Sequelize[_0xa4eb('0x4')]},'productAsset':{'type':Sequelize[_0xa4eb('0x8')]},'deletedAt':{'type':Sequelize[_0xa4eb('0x9')],'unique':_0xa4eb('0x3')}}; \ No newline at end of file +var _0x1ebe=['TEXT','STRING','compositeIndex_prodCode_QuotationID','DECIMAL','INTEGER','long','BOOLEAN','DATE','sequelize'];(function(_0x1b51b1,_0x79976c){var _0xf0765b=function(_0x324307){while(--_0x324307){_0x1b51b1['push'](_0x1b51b1['shift']());}};_0xf0765b(++_0x79976c);}(_0x1ebe,0x143));var _0xe1eb=function(_0x1fe185,_0xa257a9){_0x1fe185=_0x1fe185-0x0;var _0xe3064e=_0x1ebe[_0x1fe185];return _0xe3064e;};'use strict';var Sequelize=require(_0xe1eb('0x0'));module['exports']={'productName':{'type':Sequelize[_0xe1eb('0x1')],'allowNull':![]},'productCode':{'type':Sequelize[_0xe1eb('0x2')],'allowNull':![],'unique':_0xe1eb('0x3')},'productNetPrice':{'type':Sequelize[_0xe1eb('0x4')](0xd,0x4)},'productTax':{'type':Sequelize[_0xe1eb('0x5')]},'productDescription':{'type':Sequelize[_0xe1eb('0x1')](_0xe1eb('0x6'))+'\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci'},'productQtyMin':{'type':Sequelize[_0xe1eb('0x5')],'allowNull':!![]},'pricelistName':{'type':Sequelize[_0xe1eb('0x1')]},'pricelistDiscount':{'type':Sequelize[_0xe1eb('0x4')](0x6,0x3),'allowNull':![]},'productPricelistDiscount':{'type':Sequelize[_0xe1eb('0x4')](0xd,0x4),'allowNull':![]},'productPricelistNetPrice':{'type':Sequelize['DECIMAL'](0xd,0x4)},'netPrice':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'quantity':{'type':Sequelize[_0xe1eb('0x4')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize[_0xe1eb('0x4')](0x6,0x3),'allowNull':![]},'totalPrice':{'type':Sequelize[_0xe1eb('0x4')](0xd,0x4),'allowNull':![]},'tax':{'type':Sequelize[_0xe1eb('0x4')](0xd,0x4),'allowNull':![]},'totalDiscount':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'totalTax':{'type':Sequelize[_0xe1eb('0x4')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xe1eb('0x1')]},'QuotationId':{'type':Sequelize[_0xe1eb('0x5')],'unique':_0xe1eb('0x3')},'totalPrice':{'type':Sequelize[_0xe1eb('0x4')](0xd,0x4)},'totalTax':{'type':Sequelize[_0xe1eb('0x4')](0xd,0x4)},'typeName':{'type':Sequelize[_0xe1eb('0x2')]},'TypeId':{'type':Sequelize['INTEGER']},'unitName':{'type':Sequelize[_0xe1eb('0x2')]},'UnitId':{'type':Sequelize['INTEGER']},'subscriptionName':{'type':Sequelize[_0xe1eb('0x2')]},'subscriptionId':{'type':Sequelize[_0xe1eb('0x5')]},'subscriptionMonthly':{'type':Sequelize[_0xe1eb('0x5')]},'companyName':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xe1eb('0x5')]},'productAsset':{'type':Sequelize[_0xe1eb('0x7')]},'deletedAt':{'type':Sequelize[_0xe1eb('0x8')],'unique':'compositeIndex_prodCode_QuotationID'}}; \ No newline at end of file diff --git a/server/api/saProductQuotation/saProductQuotation.controller.js b/server/api/saProductQuotation/saProductQuotation.controller.js index 89bbc16..0ed2122 100644 --- a/server/api/saProductQuotation/saProductQuotation.controller.js +++ b/server/api/saProductQuotation/saProductQuotation.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['length','query','hasOwnProperty','nolimit','sort','pick','where','merge','map','type','key','VIRTUAL','options','SAProductQuotation','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','destroy','describe','InvoiceId','sequelize','transaction','companyId','productName','productCode','productDescription','pricelistName','discount','tax','subscriptionId','subscriptionName','subscriptionMonthly','quantity','unitName','SAInvoiceDetail','automaticInvoice','SAInvoice','result','push','all','No\x20product\x20to\x20assign\x20invoice.\x20Invoice\x20not\x20created!!','log','TCL:\x20exports.automaticInvoice\x20->\x20err','send','companyName','typeName','ProductPriceListId','netPrice','agentFullname','note','SAProformaDetail','automaticProforma','SAProforma','WARNING','TCL:\x20exports.automaticProforma\x20->\x20err','SequelizeUniqueConstraintError','Duplicate\x20entry.','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','rawAttributes','keys','filters','model','attributes','intersection'];(function(_0x487cb0,_0x339d3e){var _0x5a8047=function(_0x2804a3){while(--_0x2804a3){_0x487cb0['push'](_0x487cb0['shift']());}};_0x5a8047(++_0x339d3e);}(_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={'raw':!![]},_0x59a905={},_0x28f639={'count':0x0,'rows':[]};var _0x3ef745=db['SAProductQuotation'][_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['SAProductQuotation'][_0x0d8b('0x41')](_0x4b4bde)['then'](handleEntityNotFound(_0xe0bf42,null))['then'](respondWithResult(_0xe0bf42,null))[_0x0d8b('0x3d')](handleError(_0xe0bf42,null));};exports[_0x0d8b('0x42')]=function(_0x5a75c7,_0x5ebe8a){return db['SAProductQuotation']['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));};function assignProductQuotationToProformaInvoice(_0x131579,_0x1106d6){if(_0x131579[_0x0d8b('0x43')]['id']){delete _0x131579[_0x0d8b('0x43')]['id'];}return db[_0x0d8b('0x38')]['update']({'ProformaId':_0x131579['body']['ProformaId'],'InvoiceId':_0x131579['body'][_0x0d8b('0x46')]},{'where':{'QuotationId':_0x131579[_0x0d8b('0x3f')]['id'],'ProformaId':_0x131579['query']['ProformaId']||{'$eq':null},'InvoiceId':_0x131579[_0x0d8b('0x2c')][_0x0d8b('0x46')]||{'$eq':null}},'transaction':_0x1106d6});}exports['updateBulk']=function(_0x5ef6c3,_0x900906,_0xeeefd4){return db[_0x0d8b('0x47')][_0x0d8b('0x48')](function(_0x2d5519){return assignProductQuotationToProformaInvoice(_0x5ef6c3,_0x2d5519)['then'](function(_0x2de903){return _0x900906[_0x0d8b('0x15')](0xc8);})['catch'](handleError(_0x900906,null));});};function addInvoiceDetail(_0x580580,_0xf6a773,_0x3f2d95){var _0x546fef={'companyName':_0x580580['companyName'],'companyId':_0x580580[_0x0d8b('0x49')],'productName':_0x580580[_0x0d8b('0x4a')],'productCode':_0x580580[_0x0d8b('0x4b')],'productDescription':_0x580580[_0x0d8b('0x4c')],'typeName':_0x580580['typeName'],'pricelistName':_0x580580[_0x0d8b('0x4d')],'priceListId':_0x580580['ProductPriceListId'],'netPrice':_0x580580['netPrice'],'discount':_0x580580[_0x0d8b('0x4e')],'tax':_0x580580[_0x0d8b('0x4f')],'agentFullname':_0x580580['agentFullname'],'note':_0x580580['note'],'subscriptionId':_0x580580[_0x0d8b('0x50')],'subscriptionName':_0x580580[_0x0d8b('0x51')],'subscriptionMonthly':_0x580580[_0x0d8b('0x52')],'quantity':_0x580580[_0x0d8b('0x53')],'InvoiceId':_0xf6a773,'unitName':_0x580580[_0x0d8b('0x54')]};return db[_0x0d8b('0x55')][_0x0d8b('0x42')](_0x546fef,{'transaction':_0x3f2d95})[_0x0d8b('0x21')](function(){return db['SAProductQuotation'][_0x0d8b('0x20')]({'InvoiceId':_0xf6a773},{'where':{'id':_0x580580['id']},'transaction':_0x3f2d95});});}exports[_0x0d8b('0x56')]=function(_0x3a3d33,_0x3c7efb,_0x3fb9ea){if(_0x3a3d33[_0x0d8b('0x43')]['id']){delete _0x3a3d33[_0x0d8b('0x43')]['id'];}return db[_0x0d8b('0x47')][_0x0d8b('0x48')](function(_0x4bfdf1){return db[_0x0d8b('0x57')][_0x0d8b('0x42')](_0x3a3d33[_0x0d8b('0x43')],{'transaction':_0x4bfdf1})[_0x0d8b('0x21')](function(_0x43ad22){console['log'](_0x0d8b('0x58'),_0x43ad22);var _0x2d6284=_0x3a3d33[_0x0d8b('0x3f')]['id'];return db[_0x0d8b('0x38')][_0x0d8b('0x3b')]({'where':{'QuotationId':_0x2d6284,'productAsset':{'$ne':0x1},'ProformaId':{'$eq':null},'InvoiceId':{'$eq':null}},'raw':!![],'logging':console['log']})['then'](function(_0x3b1166){if(_0x3b1166[_0x0d8b('0x2b')]>0x0){var _0x3e4a41=[];for(var _0xbbb520=0x0;_0xbbb520<_0x3b1166['length'];_0xbbb520++){_0x3e4a41[_0x0d8b('0x59')](addInvoiceDetail(_0x3b1166[_0xbbb520],_0x43ad22['id'],_0x4bfdf1));}return BPromise[_0x0d8b('0x5a')](_0x3e4a41);}else{var _0x8c0bbe={'errors':[{'type':'WARNING','message':_0x0d8b('0x5b')}]};throw _0x8c0bbe;}});});})['then'](function(){return _0x3c7efb[_0x0d8b('0x15')](0xc8);})[_0x0d8b('0x3d')](function(_0x1efce6){console[_0x0d8b('0x5c')](_0x0d8b('0x5d'),_0x1efce6);if(_0x1efce6[_0x0d8b('0x23')]==='SequelizeUniqueConstraintError'){var _0x1efce6={'errors':[{'message':'Duplicate\x20entry.'}]};}_0x3c7efb[_0x0d8b('0x16')](0x1f4)[_0x0d8b('0x5e')](_0x1efce6);});};function addProformaDetail(_0xafeeb0,_0x33a614,_0x48025e){var _0x19e097={'companyName':_0xafeeb0[_0x0d8b('0x5f')],'companyId':_0xafeeb0[_0x0d8b('0x49')],'productName':_0xafeeb0[_0x0d8b('0x4a')],'productCode':_0xafeeb0[_0x0d8b('0x4b')],'productDescription':_0xafeeb0[_0x0d8b('0x4c')],'typeName':_0xafeeb0[_0x0d8b('0x60')],'pricelistName':_0xafeeb0[_0x0d8b('0x4d')],'priceListId':_0xafeeb0[_0x0d8b('0x61')],'netPrice':_0xafeeb0[_0x0d8b('0x62')],'discount':_0xafeeb0['discount'],'tax':_0xafeeb0['tax'],'agentFullname':_0xafeeb0[_0x0d8b('0x63')],'note':_0xafeeb0[_0x0d8b('0x64')],'subscriptionId':_0xafeeb0['subscriptionId'],'subscriptionName':_0xafeeb0[_0x0d8b('0x51')],'subscriptionMonthly':_0xafeeb0['subscriptionMonthly'],'quantity':_0xafeeb0['quantity'],'ProformaId':_0x33a614};return db[_0x0d8b('0x65')][_0x0d8b('0x42')](_0x19e097,{'transaction':_0x48025e})['then'](function(){return db['SAProductQuotation'][_0x0d8b('0x20')]({'ProformaId':_0x33a614},{'where':{'id':_0xafeeb0['id']},'transaction':_0x48025e});});}exports[_0x0d8b('0x66')]=function(_0x70e4b2,_0x435090,_0x2ab72b){if(_0x70e4b2[_0x0d8b('0x43')]['id']){delete _0x70e4b2[_0x0d8b('0x43')]['id'];}return db['sequelize'][_0x0d8b('0x48')](function(_0x5878c2){return db[_0x0d8b('0x67')][_0x0d8b('0x42')](_0x70e4b2[_0x0d8b('0x43')],{'transaction':_0x5878c2})[_0x0d8b('0x21')](function(_0x49f610){console[_0x0d8b('0x5c')]('result',_0x49f610);var _0x3a356b=_0x70e4b2[_0x0d8b('0x3f')]['id'];return db[_0x0d8b('0x38')][_0x0d8b('0x3b')]({'where':{'QuotationId':_0x3a356b,'productAsset':{'$ne':0x1},'ProformaId':{'$eq':null},'InvoiceId':{'$eq':null}},'raw':!![],'logging':console[_0x0d8b('0x5c')]})[_0x0d8b('0x21')](function(_0x3e927c){if(_0x3e927c[_0x0d8b('0x2b')]>0x0){var _0x266a69=[];for(var _0x44aa74=0x0;_0x44aa74<_0x3e927c['length'];_0x44aa74++){_0x266a69[_0x0d8b('0x59')](addProformaDetail(_0x3e927c[_0x44aa74],_0x49f610['id'],_0x5878c2));}return BPromise['all'](_0x266a69);}else{var _0x3e4121={'errors':[{'type':_0x0d8b('0x68'),'message':'No\x20product\x20to\x20assign\x20proforma.\x20Proforma\x20not\x20created!!'}]};throw _0x3e4121;}});});})[_0x0d8b('0x21')](function(){return _0x435090['sendStatus'](0xc8);})[_0x0d8b('0x3d')](function(_0x445a00){console[_0x0d8b('0x5c')](_0x0d8b('0x69'),_0x445a00);if(_0x445a00[_0x0d8b('0x23')]===_0x0d8b('0x6a')){var _0x445a00={'errors':[{'message':_0x0d8b('0x6b')}]};}_0x435090['status'](0x1f4)[_0x0d8b('0x5e')](_0x445a00);});}; \ No newline at end of file +var _0xd8b0=['length','query','hasOwnProperty','nolimit','sort','pick','where','merge','map','type','key','VIRTUAL','options','SAProductQuotation','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','destroy','describe','InvoiceId','sequelize','transaction','companyId','productName','productCode','productDescription','pricelistName','discount','tax','subscriptionId','subscriptionName','subscriptionMonthly','quantity','unitName','SAInvoiceDetail','automaticInvoice','SAInvoice','result','push','all','No\x20product\x20to\x20assign\x20invoice.\x20Invoice\x20not\x20created!!','log','TCL:\x20exports.automaticInvoice\x20->\x20err','send','companyName','typeName','ProductPriceListId','netPrice','agentFullname','note','SAProformaDetail','automaticProforma','SAProforma','WARNING','TCL:\x20exports.automaticProforma\x20->\x20err','SequelizeUniqueConstraintError','Duplicate\x20entry.','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','rawAttributes','keys','filters','model','attributes','intersection'];(function(_0x1d13c8,_0x1554e6){var _0x3a3b03=function(_0x3d488d){while(--_0x3d488d){_0x1d13c8['push'](_0x1d13c8['shift']());}};_0x3a3b03(++_0x1554e6);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var 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={'raw':!![]},_0x59a905={},_0x28f639={'count':0x0,'rows':[]};var _0x3ef745=db['SAProductQuotation'][_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['SAProductQuotation'][_0x0d8b('0x41')](_0x4b4bde)['then'](handleEntityNotFound(_0xe0bf42,null))['then'](respondWithResult(_0xe0bf42,null))[_0x0d8b('0x3d')](handleError(_0xe0bf42,null));};exports[_0x0d8b('0x42')]=function(_0x5a75c7,_0x5ebe8a){return db['SAProductQuotation']['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));};function assignProductQuotationToProformaInvoice(_0x131579,_0x1106d6){if(_0x131579[_0x0d8b('0x43')]['id']){delete _0x131579[_0x0d8b('0x43')]['id'];}return db[_0x0d8b('0x38')]['update']({'ProformaId':_0x131579['body']['ProformaId'],'InvoiceId':_0x131579['body'][_0x0d8b('0x46')]},{'where':{'QuotationId':_0x131579[_0x0d8b('0x3f')]['id'],'ProformaId':_0x131579['query']['ProformaId']||{'$eq':null},'InvoiceId':_0x131579[_0x0d8b('0x2c')][_0x0d8b('0x46')]||{'$eq':null}},'transaction':_0x1106d6});}exports['updateBulk']=function(_0x5ef6c3,_0x900906,_0xeeefd4){return db[_0x0d8b('0x47')][_0x0d8b('0x48')](function(_0x2d5519){return assignProductQuotationToProformaInvoice(_0x5ef6c3,_0x2d5519)['then'](function(_0x2de903){return _0x900906[_0x0d8b('0x15')](0xc8);})['catch'](handleError(_0x900906,null));});};function addInvoiceDetail(_0x580580,_0xf6a773,_0x3f2d95){var _0x546fef={'companyName':_0x580580['companyName'],'companyId':_0x580580[_0x0d8b('0x49')],'productName':_0x580580[_0x0d8b('0x4a')],'productCode':_0x580580[_0x0d8b('0x4b')],'productDescription':_0x580580[_0x0d8b('0x4c')],'typeName':_0x580580['typeName'],'pricelistName':_0x580580[_0x0d8b('0x4d')],'priceListId':_0x580580['ProductPriceListId'],'netPrice':_0x580580['netPrice'],'discount':_0x580580[_0x0d8b('0x4e')],'tax':_0x580580[_0x0d8b('0x4f')],'agentFullname':_0x580580['agentFullname'],'note':_0x580580['note'],'subscriptionId':_0x580580[_0x0d8b('0x50')],'subscriptionName':_0x580580[_0x0d8b('0x51')],'subscriptionMonthly':_0x580580[_0x0d8b('0x52')],'quantity':_0x580580[_0x0d8b('0x53')],'InvoiceId':_0xf6a773,'unitName':_0x580580[_0x0d8b('0x54')]};return db[_0x0d8b('0x55')][_0x0d8b('0x42')](_0x546fef,{'transaction':_0x3f2d95})[_0x0d8b('0x21')](function(){return db['SAProductQuotation'][_0x0d8b('0x20')]({'InvoiceId':_0xf6a773},{'where':{'id':_0x580580['id']},'transaction':_0x3f2d95});});}exports[_0x0d8b('0x56')]=function(_0x3a3d33,_0x3c7efb,_0x3fb9ea){if(_0x3a3d33[_0x0d8b('0x43')]['id']){delete _0x3a3d33[_0x0d8b('0x43')]['id'];}return db[_0x0d8b('0x47')][_0x0d8b('0x48')](function(_0x4bfdf1){return db[_0x0d8b('0x57')][_0x0d8b('0x42')](_0x3a3d33[_0x0d8b('0x43')],{'transaction':_0x4bfdf1})[_0x0d8b('0x21')](function(_0x43ad22){console['log'](_0x0d8b('0x58'),_0x43ad22);var _0x2d6284=_0x3a3d33[_0x0d8b('0x3f')]['id'];return db[_0x0d8b('0x38')][_0x0d8b('0x3b')]({'where':{'QuotationId':_0x2d6284,'productAsset':{'$ne':0x1},'ProformaId':{'$eq':null},'InvoiceId':{'$eq':null}},'raw':!![],'logging':console['log']})['then'](function(_0x3b1166){if(_0x3b1166[_0x0d8b('0x2b')]>0x0){var _0x3e4a41=[];for(var _0xbbb520=0x0;_0xbbb520<_0x3b1166['length'];_0xbbb520++){_0x3e4a41[_0x0d8b('0x59')](addInvoiceDetail(_0x3b1166[_0xbbb520],_0x43ad22['id'],_0x4bfdf1));}return BPromise[_0x0d8b('0x5a')](_0x3e4a41);}else{var _0x8c0bbe={'errors':[{'type':'WARNING','message':_0x0d8b('0x5b')}]};throw _0x8c0bbe;}});});})['then'](function(){return _0x3c7efb[_0x0d8b('0x15')](0xc8);})[_0x0d8b('0x3d')](function(_0x1efce6){console[_0x0d8b('0x5c')](_0x0d8b('0x5d'),_0x1efce6);if(_0x1efce6[_0x0d8b('0x23')]==='SequelizeUniqueConstraintError'){var _0x1efce6={'errors':[{'message':'Duplicate\x20entry.'}]};}_0x3c7efb[_0x0d8b('0x16')](0x1f4)[_0x0d8b('0x5e')](_0x1efce6);});};function addProformaDetail(_0xafeeb0,_0x33a614,_0x48025e){var _0x19e097={'companyName':_0xafeeb0[_0x0d8b('0x5f')],'companyId':_0xafeeb0[_0x0d8b('0x49')],'productName':_0xafeeb0[_0x0d8b('0x4a')],'productCode':_0xafeeb0[_0x0d8b('0x4b')],'productDescription':_0xafeeb0[_0x0d8b('0x4c')],'typeName':_0xafeeb0[_0x0d8b('0x60')],'pricelistName':_0xafeeb0[_0x0d8b('0x4d')],'priceListId':_0xafeeb0[_0x0d8b('0x61')],'netPrice':_0xafeeb0[_0x0d8b('0x62')],'discount':_0xafeeb0['discount'],'tax':_0xafeeb0['tax'],'agentFullname':_0xafeeb0[_0x0d8b('0x63')],'note':_0xafeeb0[_0x0d8b('0x64')],'subscriptionId':_0xafeeb0['subscriptionId'],'subscriptionName':_0xafeeb0[_0x0d8b('0x51')],'subscriptionMonthly':_0xafeeb0['subscriptionMonthly'],'quantity':_0xafeeb0['quantity'],'ProformaId':_0x33a614};return db[_0x0d8b('0x65')][_0x0d8b('0x42')](_0x19e097,{'transaction':_0x48025e})['then'](function(){return db['SAProductQuotation'][_0x0d8b('0x20')]({'ProformaId':_0x33a614},{'where':{'id':_0xafeeb0['id']},'transaction':_0x48025e});});}exports[_0x0d8b('0x66')]=function(_0x70e4b2,_0x435090,_0x2ab72b){if(_0x70e4b2[_0x0d8b('0x43')]['id']){delete _0x70e4b2[_0x0d8b('0x43')]['id'];}return db['sequelize'][_0x0d8b('0x48')](function(_0x5878c2){return db[_0x0d8b('0x67')][_0x0d8b('0x42')](_0x70e4b2[_0x0d8b('0x43')],{'transaction':_0x5878c2})[_0x0d8b('0x21')](function(_0x49f610){console[_0x0d8b('0x5c')]('result',_0x49f610);var _0x3a356b=_0x70e4b2[_0x0d8b('0x3f')]['id'];return db[_0x0d8b('0x38')][_0x0d8b('0x3b')]({'where':{'QuotationId':_0x3a356b,'productAsset':{'$ne':0x1},'ProformaId':{'$eq':null},'InvoiceId':{'$eq':null}},'raw':!![],'logging':console[_0x0d8b('0x5c')]})[_0x0d8b('0x21')](function(_0x3e927c){if(_0x3e927c[_0x0d8b('0x2b')]>0x0){var _0x266a69=[];for(var _0x44aa74=0x0;_0x44aa74<_0x3e927c['length'];_0x44aa74++){_0x266a69[_0x0d8b('0x59')](addProformaDetail(_0x3e927c[_0x44aa74],_0x49f610['id'],_0x5878c2));}return BPromise['all'](_0x266a69);}else{var _0x3e4121={'errors':[{'type':_0x0d8b('0x68'),'message':'No\x20product\x20to\x20assign\x20proforma.\x20Proforma\x20not\x20created!!'}]};throw _0x3e4121;}});});})[_0x0d8b('0x21')](function(){return _0x435090['sendStatus'](0xc8);})[_0x0d8b('0x3d')](function(_0x445a00){console[_0x0d8b('0x5c')](_0x0d8b('0x69'),_0x445a00);if(_0x445a00[_0x0d8b('0x23')]===_0x0d8b('0x6a')){var _0x445a00={'errors':[{'message':_0x0d8b('0x6b')}]};}_0x435090['status'](0x1f4)[_0x0d8b('0x5e')](_0x445a00);});}; \ No newline at end of file diff --git a/server/api/saProductQuotation/saProductQuotation.model.js b/server/api/saProductQuotation/saProductQuotation.model.js index f9ea24f..9f9107e 100644 --- a/server/api/saProductQuotation/saProductQuotation.model.js +++ b/server/api/saProductQuotation/saProductQuotation.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9cec=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','SAProductQuotation','lodash','util','../../config/logger'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x9cec,0x81));var _0xc9ce=function(_0x1269dc,_0x5cc0bc){_0x1269dc=_0x1269dc-0x0;var _0x2a93fb=_0x9cec[_0x1269dc];return _0x2a93fb;};'use strict';var _=require(_0xc9ce('0x0'));var util=require(_0xc9ce('0x1'));var logger=require(_0xc9ce('0x2'))(_0xc9ce('0x3'));var moment=require(_0xc9ce('0x4'));var BPromise=require(_0xc9ce('0x5'));var rp=require(_0xc9ce('0x6'));var fs=require('fs');var path=require(_0xc9ce('0x7'));var rimraf=require('rimraf');var config=require(_0xc9ce('0x8'));var attributes=require('./saProductQuotation.attributes');module[_0xc9ce('0x9')]=function(_0x4a5bfd,_0x2af760){return _0x4a5bfd[_0xc9ce('0xa')](_0xc9ce('0xb'),attributes,{'tableName':'sa_product_has_quotation','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8243=['define','SAProductQuotation','sa_product_has_quotation','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./saProductQuotation.attributes','exports'];(function(_0xcf95b4,_0x24baf1){var _0x20d28b=function(_0x3814e7){while(--_0x3814e7){_0xcf95b4['push'](_0xcf95b4['shift']());}};_0x20d28b(++_0x24baf1);}(_0x8243,0xab));var _0x3824=function(_0x5248ec,_0x2ebb12){_0x5248ec=_0x5248ec-0x0;var _0xd13a0e=_0x8243[_0x5248ec];return _0xd13a0e;};'use strict';var _=require(_0x3824('0x0'));var util=require(_0x3824('0x1'));var logger=require(_0x3824('0x2'))(_0x3824('0x3'));var moment=require(_0x3824('0x4'));var BPromise=require('bluebird');var rp=require(_0x3824('0x5'));var fs=require('fs');var path=require(_0x3824('0x6'));var rimraf=require(_0x3824('0x7'));var config=require(_0x3824('0x8'));var attributes=require(_0x3824('0x9'));module[_0x3824('0xa')]=function(_0x5b1d23,_0x152c7d){return _0x5b1d23[_0x3824('0xb')](_0x3824('0xc'),attributes,{'tableName':_0x3824('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saProductQuotation/saProductQuotation.rpc.js b/server/api/saProductQuotation/saProductQuotation.rpc.js index 85191fc..c50a7a9 100644 --- a/server/api/saProductQuotation/saProductQuotation.rpc.js +++ b/server/api/saProductQuotation/saProductQuotation.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c49=['../../config/environment','jayson/promise','client','http','request','request\x20sent','SAProductQuotation,\x20%s,\x20%s,\x20%s','stringify','error','code','SAProductQuotation,\x20%s,\x20%s','message','info','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x25fa5c,_0x421141){var _0x1bade2=function(_0x3faf20){while(--_0x3faf20){_0x25fa5c['push'](_0x25fa5c['shift']());}};_0x1bade2(++_0x421141);}(_0x9c49,0x189));var _0x99c4=function(_0x539531,_0x45390f){_0x539531=_0x539531-0x0;var _0x394b0c=_0x9c49[_0x539531];return _0x394b0c;};'use strict';var _=require(_0x99c4('0x0'));var util=require(_0x99c4('0x1'));var moment=require('moment');var BPromise=require(_0x99c4('0x2'));var rs=require(_0x99c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x99c4('0x4'));var logger=require(_0x99c4('0x5'))(_0x99c4('0x6'));var config=require(_0x99c4('0x7'));var jayson=require(_0x99c4('0x8'));var client=jayson[_0x99c4('0x9')][_0x99c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e97af,_0x3304e0,_0x43818d){return new BPromise(function(_0x4040fb,_0x152989){return client[_0x99c4('0xb')](_0x2e97af,_0x43818d)['then'](function(_0x388eaf){logger['info']('SAProductQuotation,\x20%s,\x20%s',_0x3304e0,_0x99c4('0xc'));logger['debug'](_0x99c4('0xd'),_0x3304e0,_0x99c4('0xc'),JSON[_0x99c4('0xe')](_0x388eaf));if(_0x388eaf[_0x99c4('0xf')]){if(_0x388eaf[_0x99c4('0xf')][_0x99c4('0x10')]===0x1f4){logger['error'](_0x99c4('0x11'),_0x3304e0,_0x388eaf['error']['message']);return _0x152989(_0x388eaf['error'][_0x99c4('0x12')]);}logger[_0x99c4('0xf')](_0x99c4('0x11'),_0x3304e0,_0x388eaf[_0x99c4('0xf')][_0x99c4('0x12')]);return _0x4040fb(_0x388eaf[_0x99c4('0xf')][_0x99c4('0x12')]);}else{logger[_0x99c4('0x13')](_0x99c4('0x11'),_0x3304e0,_0x99c4('0xc'));_0x4040fb(_0x388eaf['result'][_0x99c4('0x12')]);}})['catch'](function(_0x6f87c8){logger[_0x99c4('0xf')](_0x99c4('0x11'),_0x3304e0,_0x6f87c8);_0x152989(_0x6f87c8);});});} \ No newline at end of file +var _0xbbe8=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SAProductQuotation,\x20%s,\x20%s','debug','SAProductQuotation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x2c0a6a,_0x1abf96){var _0x2a1269=function(_0x3dc9de){while(--_0x3dc9de){_0x2c0a6a['push'](_0x2c0a6a['shift']());}};_0x2a1269(++_0x1abf96);}(_0xbbe8,0x84));var _0x8bbe=function(_0x5cf5fd,_0x4bca34){_0x5cf5fd=_0x5cf5fd-0x0;var _0x4a53ec=_0xbbe8[_0x5cf5fd];return _0x4a53ec;};'use strict';var _=require(_0x8bbe('0x0'));var util=require('util');var moment=require(_0x8bbe('0x1'));var BPromise=require(_0x8bbe('0x2'));var rs=require(_0x8bbe('0x3'));var fs=require('fs');var Redis=require(_0x8bbe('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8bbe('0x5'));var logger=require(_0x8bbe('0x6'))('rpc');var config=require(_0x8bbe('0x7'));var jayson=require(_0x8bbe('0x8'));var client=jayson[_0x8bbe('0x9')][_0x8bbe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f890,_0xd99369,_0x22a1bd){return new BPromise(function(_0x18ade6,_0x348589){return client[_0x8bbe('0xb')](_0xe5f890,_0x22a1bd)[_0x8bbe('0xc')](function(_0x2c7d79){logger[_0x8bbe('0xd')](_0x8bbe('0xe'),_0xd99369,'request\x20sent');logger[_0x8bbe('0xf')](_0x8bbe('0x10'),_0xd99369,_0x8bbe('0x11'),JSON[_0x8bbe('0x12')](_0x2c7d79));if(_0x2c7d79[_0x8bbe('0x13')]){if(_0x2c7d79[_0x8bbe('0x13')][_0x8bbe('0x14')]===0x1f4){logger[_0x8bbe('0x13')]('SAProductQuotation,\x20%s,\x20%s',_0xd99369,_0x2c7d79[_0x8bbe('0x13')][_0x8bbe('0x15')]);return _0x348589(_0x2c7d79['error'][_0x8bbe('0x15')]);}logger['error'](_0x8bbe('0xe'),_0xd99369,_0x2c7d79[_0x8bbe('0x13')][_0x8bbe('0x15')]);return _0x18ade6(_0x2c7d79['error'][_0x8bbe('0x15')]);}else{logger[_0x8bbe('0xd')]('SAProductQuotation,\x20%s,\x20%s',_0xd99369,_0x8bbe('0x11'));_0x18ade6(_0x2c7d79['result'][_0x8bbe('0x15')]);}})[_0x8bbe('0x16')](function(_0x200f3a){logger[_0x8bbe('0x13')]('SAProductQuotation,\x20%s,\x20%s',_0xd99369,_0x200f3a);_0x348589(_0x200f3a);});});} \ No newline at end of file diff --git a/server/api/saProforma/index.js b/server/api/saProforma/index.js index be7d41c..028b422 100644 --- a/server/api/saProforma/index.js +++ b/server/api/saProforma/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dab=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','post','cloneProforma','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../config/environment','./saProforma.controller'];(function(_0x5eb26d,_0x1f3383){var _0x2a5303=function(_0x3febff){while(--_0x3febff){_0x5eb26d['push'](_0x5eb26d['shift']());}};_0x2a5303(++_0x1f3383);}(_0x7dab,0x10a));var _0xb7da=function(_0x5e34fe,_0x480b18){_0x5e34fe=_0x5e34fe-0x0;var _0x1a23e7=_0x7dab[_0x5e34fe];return _0x1a23e7;};'use strict';var multer=require(_0xb7da('0x0'));var util=require(_0xb7da('0x1'));var path=require('path');var timeout=require(_0xb7da('0x2'));var express=require(_0xb7da('0x3'));var router=express[_0xb7da('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb7da('0x5'));var controller=require(_0xb7da('0x6'));router[_0xb7da('0x7')]('/',auth[_0xb7da('0x8')](),controller[_0xb7da('0x9')]);router['get'](_0xb7da('0xa'),auth[_0xb7da('0x8')](),controller[_0xb7da('0xb')]);router[_0xb7da('0x7')](_0xb7da('0xc'),auth[_0xb7da('0x8')](),controller[_0xb7da('0xd')]);router[_0xb7da('0x7')](_0xb7da('0xe'),auth[_0xb7da('0x8')](),controller['getProformaPDF']);router[_0xb7da('0xf')]('/',auth[_0xb7da('0x8')](),controller['create']);router[_0xb7da('0xf')]('/:id/cloneProforma',auth[_0xb7da('0x8')](),controller[_0xb7da('0x10')]);router['put']('/:id',auth[_0xb7da('0x8')](),controller[_0xb7da('0x11')]);router[_0xb7da('0x12')](_0xb7da('0xc'),auth[_0xb7da('0x8')](),controller[_0xb7da('0x13')]);module[_0xb7da('0x14')]=router; \ No newline at end of file +var _0x29a6=['../../components/auth/service','get','isAuthenticated','index','/describe','describe','show','/:id/download','getProformaPDF','post','create','cloneProforma','put','/:id','delete','destroy','exports','multer','path','Router'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x29a6,0xd9));var _0x629a=function(_0x935cd3,_0x1f0a42){_0x935cd3=_0x935cd3-0x0;var _0x7f28fe=_0x29a6[_0x935cd3];return _0x7f28fe;};'use strict';var multer=require(_0x629a('0x0'));var util=require('util');var path=require(_0x629a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x629a('0x2')]();var auth=require(_0x629a('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./saProforma.controller');router[_0x629a('0x4')]('/',auth[_0x629a('0x5')](),controller[_0x629a('0x6')]);router[_0x629a('0x4')](_0x629a('0x7'),auth['isAuthenticated'](),controller[_0x629a('0x8')]);router[_0x629a('0x4')]('/:id',auth[_0x629a('0x5')](),controller[_0x629a('0x9')]);router[_0x629a('0x4')](_0x629a('0xa'),auth[_0x629a('0x5')](),controller[_0x629a('0xb')]);router[_0x629a('0xc')]('/',auth[_0x629a('0x5')](),controller[_0x629a('0xd')]);router[_0x629a('0xc')]('/:id/cloneProforma',auth['isAuthenticated'](),controller[_0x629a('0xe')]);router[_0x629a('0xf')](_0x629a('0x10'),auth[_0x629a('0x5')](),controller['update']);router[_0x629a('0x11')](_0x629a('0x10'),auth[_0x629a('0x5')](),controller[_0x629a('0x12')]);module[_0x629a('0x13')]=router; \ No newline at end of file diff --git a/server/api/saProforma/saProforma.attributes.js b/server/api/saProforma/saProforma.attributes.js index ec32257..4c15c7a 100644 --- a/server/api/saProforma/saProforma.attributes.js +++ b/server/api/saProforma/saProforma.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa48=['exports','STRING','TEXT','INTEGER','BOOLEAN','DATE','sequelize'];(function(_0x5257bf,_0xf39844){var _0x30f32b=function(_0x252bff){while(--_0x252bff){_0x5257bf['push'](_0x5257bf['shift']());}};_0x30f32b(++_0xf39844);}(_0xaa48,0x195));var _0x8aa4=function(_0x17d4e8,_0x9eb635){_0x17d4e8=_0x17d4e8-0x0;var _0x5585d9=_0xaa48[_0x17d4e8];return _0x5585d9;};'use strict';var Sequelize=require(_0x8aa4('0x0'));module[_0x8aa4('0x1')]={'name':{'type':Sequelize[_0x8aa4('0x2')]},'note':{'type':Sequelize['TEXT']},'agentFullname':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x8aa4('0x3')]},'companyName':{'type':Sequelize['STRING'],'allowNull':![]},'companyId':{'type':Sequelize[_0x8aa4('0x4')],'allowNull':![]},'authorized':{'type':Sequelize[_0x8aa4('0x5')]},'clientCode':{'type':Sequelize[_0x8aa4('0x2')]},'discount':{'type':Sequelize['DECIMAL'](0xd,0x4)},'paid':{'type':Sequelize[_0x8aa4('0x4')],'defaultValue':0x0},'receivingStreet':{'type':Sequelize[_0x8aa4('0x2')]},'receivingPostalCode':{'type':Sequelize[_0x8aa4('0x2')]},'receivingCity':{'type':Sequelize['STRING']},'receivingCountry':{'type':Sequelize[_0x8aa4('0x2')]},'receivingISOCode':{'type':Sequelize[_0x8aa4('0x2')](0x3)},'receivingFiscalCode':{'type':Sequelize[_0x8aa4('0x2')](0x32)},'receivingPIVA':{'type':Sequelize[_0x8aa4('0x2')](0x32)},'receivingSDICode':{'type':Sequelize['STRING'](0x15)},'receivingFiscalMessage':{'type':Sequelize['STRING']},'receivingExpiryDay':{'type':Sequelize[_0x8aa4('0x4')]},'receivingEurope':{'type':Sequelize[_0x8aa4('0x5')]},'receivingSocCap':{'type':Sequelize[_0x8aa4('0x2')](0xff)},'issuerName':{'type':Sequelize[_0x8aa4('0x2')]},'issuerStreet':{'type':Sequelize['STRING']},'issuerPostalCode':{'type':Sequelize['STRING']},'issuerCity':{'type':Sequelize[_0x8aa4('0x2')]},'issuerCountry':{'type':Sequelize[_0x8aa4('0x2')]},'issuerISOCode':{'type':Sequelize[_0x8aa4('0x2')](0x3)},'issuerFiscalCode':{'type':Sequelize[_0x8aa4('0x2')](0x32)},'issuerPIVA':{'type':Sequelize[_0x8aa4('0x2')](0x32)},'issuerSDICode':{'type':Sequelize[_0x8aa4('0x2')](0x15)},'issuerFiscalMessage':{'type':Sequelize[_0x8aa4('0x2')](0x3e8)},'issuerExpiryDay':{'type':Sequelize['INTEGER']},'issuerEurope':{'type':Sequelize['BOOLEAN']},'issuerSocCap':{'type':Sequelize[_0x8aa4('0x2')](0xff)},'issuerBankAccount':{'type':Sequelize[_0x8aa4('0x2')](0xff)},'issuerBankName':{'type':Sequelize[_0x8aa4('0x2')](0xff)},'issuerBankStreet':{'type':Sequelize[_0x8aa4('0x2')]},'issuerBankPostalCode':{'type':Sequelize['STRING']},'issuerBankCity':{'type':Sequelize[_0x8aa4('0x2')]},'issuerBankCountry':{'type':Sequelize[_0x8aa4('0x2')]},'issuerBankBICSWIFT':{'type':Sequelize[_0x8aa4('0x2')]},'issuerBankIBAN':{'type':Sequelize[_0x8aa4('0x2')]},'issuerPhone':{'type':Sequelize[_0x8aa4('0x2')]},'issuerFax':{'type':Sequelize['STRING']},'issuerEmail':{'type':Sequelize[_0x8aa4('0x2')]},'issuerWeb':{'type':Sequelize['STRING']},'issuerABI':{'type':Sequelize[_0x8aa4('0x2')]},'issuerCAB':{'type':Sequelize['STRING']},'issuerPayPal':{'type':Sequelize[_0x8aa4('0x2')]},'clientCode':{'type':Sequelize[_0x8aa4('0x2')]},'startDate':{'type':Sequelize[_0x8aa4('0x6')]},'endDate':{'type':Sequelize['DATE']},'number':{'type':Sequelize[_0x8aa4('0x4')]},'beginningCompetence':{'type':Sequelize[_0x8aa4('0x6')]},'endCompetence':{'type':Sequelize[_0x8aa4('0x6')]}}; \ No newline at end of file +var _0x2910=['DECIMAL','DATE','sequelize','STRING','TEXT','INTEGER','BOOLEAN'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2910,0x113));var _0x0291=function(_0x99e075,_0x211213){_0x99e075=_0x99e075-0x0;var _0x1a81ba=_0x2910[_0x99e075];return _0x1a81ba;};'use strict';var Sequelize=require(_0x0291('0x0'));module['exports']={'name':{'type':Sequelize[_0x0291('0x1')]},'note':{'type':Sequelize['TEXT']},'agentFullname':{'type':Sequelize[_0x0291('0x1')]},'status':{'type':Sequelize[_0x0291('0x2')]},'companyName':{'type':Sequelize[_0x0291('0x1')],'allowNull':![]},'companyId':{'type':Sequelize[_0x0291('0x3')],'allowNull':![]},'authorized':{'type':Sequelize[_0x0291('0x4')]},'clientCode':{'type':Sequelize['STRING']},'discount':{'type':Sequelize[_0x0291('0x5')](0xd,0x4)},'paid':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'receivingStreet':{'type':Sequelize[_0x0291('0x1')]},'receivingPostalCode':{'type':Sequelize[_0x0291('0x1')]},'receivingCity':{'type':Sequelize['STRING']},'receivingCountry':{'type':Sequelize[_0x0291('0x1')]},'receivingISOCode':{'type':Sequelize[_0x0291('0x1')](0x3)},'receivingFiscalCode':{'type':Sequelize[_0x0291('0x1')](0x32)},'receivingPIVA':{'type':Sequelize['STRING'](0x32)},'receivingSDICode':{'type':Sequelize[_0x0291('0x1')](0x15)},'receivingFiscalMessage':{'type':Sequelize['STRING']},'receivingExpiryDay':{'type':Sequelize['INTEGER']},'receivingEurope':{'type':Sequelize[_0x0291('0x4')]},'receivingSocCap':{'type':Sequelize['STRING'](0xff)},'issuerName':{'type':Sequelize[_0x0291('0x1')]},'issuerStreet':{'type':Sequelize['STRING']},'issuerPostalCode':{'type':Sequelize[_0x0291('0x1')]},'issuerCity':{'type':Sequelize['STRING']},'issuerCountry':{'type':Sequelize[_0x0291('0x1')]},'issuerISOCode':{'type':Sequelize[_0x0291('0x1')](0x3)},'issuerFiscalCode':{'type':Sequelize[_0x0291('0x1')](0x32)},'issuerPIVA':{'type':Sequelize[_0x0291('0x1')](0x32)},'issuerSDICode':{'type':Sequelize[_0x0291('0x1')](0x15)},'issuerFiscalMessage':{'type':Sequelize[_0x0291('0x1')](0x3e8)},'issuerExpiryDay':{'type':Sequelize[_0x0291('0x3')]},'issuerEurope':{'type':Sequelize['BOOLEAN']},'issuerSocCap':{'type':Sequelize[_0x0291('0x1')](0xff)},'issuerBankAccount':{'type':Sequelize[_0x0291('0x1')](0xff)},'issuerBankName':{'type':Sequelize[_0x0291('0x1')](0xff)},'issuerBankStreet':{'type':Sequelize['STRING']},'issuerBankPostalCode':{'type':Sequelize[_0x0291('0x1')]},'issuerBankCity':{'type':Sequelize[_0x0291('0x1')]},'issuerBankCountry':{'type':Sequelize[_0x0291('0x1')]},'issuerBankBICSWIFT':{'type':Sequelize['STRING']},'issuerBankIBAN':{'type':Sequelize[_0x0291('0x1')]},'issuerPhone':{'type':Sequelize[_0x0291('0x1')]},'issuerFax':{'type':Sequelize[_0x0291('0x1')]},'issuerEmail':{'type':Sequelize[_0x0291('0x1')]},'issuerWeb':{'type':Sequelize[_0x0291('0x1')]},'issuerABI':{'type':Sequelize['STRING']},'issuerCAB':{'type':Sequelize[_0x0291('0x1')]},'issuerPayPal':{'type':Sequelize[_0x0291('0x1')]},'clientCode':{'type':Sequelize[_0x0291('0x1')]},'startDate':{'type':Sequelize[_0x0291('0x6')]},'endDate':{'type':Sequelize[_0x0291('0x6')]},'number':{'type':Sequelize[_0x0291('0x3')]},'beginningCompetence':{'type':Sequelize[_0x0291('0x6')]},'endCompetence':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/saProforma/saProforma.controller.js b/server/api/saProforma/saProforma.controller.js index 23add37..24a6a48 100644 --- a/server/api/saProforma/saProforma.controller.js +++ b/server/api/saProforma/saProforma.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4cb2=['where','filter','merge','map','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','fields','find','create','update','body','describe','unix','toString','join','root','server','files','tmp','images','logos','logo-invoice.png','paid-invoice.png','Proforma_%s-%s.pdf','SAProformaDetail','details','portrait','1cm','10mm','{{page}}/{{pages}}','footer','contents','default','','issuerWeb','','mkdirSync','','Phone','Telefono','Fax','Email','VAT\x20number','P.IVA','I.S.\x20code','Codice\x20S.D.I.','Cap.Soc.\x20iv','Invoice','Proforma','Nota\x20di\x20credito','Scadenza','Articolo','Description','Descrizione','Ore/Qta','Unit\x20Price','Sub\x20Total','Sub\x20Totale','Discount','Sconto','Tax','Tasse','Total','Totale','Please\x20send\x20PAYMENT\x20to','Si\x20prega\x20di\x20inviare\x20il\x20pagamento\x20a','Account\x20Holder','Conto\x20intestato\x20a','Bank\x20name','Bank\x20Address','Indirizzo\x20banca','ABI','CAB','BIC','SWIF','IBAN','Thank\x20you\x20for\x20your\x20business.\x20We\x20do\x20expect\x20payment\x20by\x20','Grazie.\x20Prevediamo\x20il\x20pagamento\x20entro\x20',',\x20so\x20please\x20do\x20so\x20within\x20this\x20time.','\x20quindi\x20vi\x20preghiamo\x20di\x20provvedere\x20entro\x20tale\x20termine.','proforma','receivingCountry','Italy','\x20','','format','\x20%s
','issuerName','%s
','issuerCity','-\x20%s\x20
','issuerCountry','phone',':\x20%s
','issuerPhone','fax','issuerFax','email','issuerEmail','piva','issuerPIVA','issuerFiscalCode','sdi','','','','receivingStreet','receivingCity','','receivingFiscalCode','receivingSDICode','','','\x20N.%d','%s,\x20','updatedAt','DD/MM/YYYY','%s\x20','add','saExpiryDay','days','',':\x20%s','','','','','hrsqty','subtotal','quantity','%s','productDescription','%d','','toFixed','\x20€','','discount','netPrice','receivingFiscalMessage','indexOf','','total','','tax','','','\x20',' ','fromCharCode','','','issuerBankAccount',':\x20','bankname','issuerBankName','bankaddress','issuerBankStreet','\x20-\x20','issuerBankCity','abi','cab','issuerABI','','bic','iban','issuerBankIBAN','isNil','issuerPayPal','thank1','','thank2','','','','toFile','log','TCL:\x20exports.getProformaPDF\x20->\x20saveTo,\x20fileName','err','foldername','ProformaId','cloneProforma','transaction','result','cloneProforma\x20productsProforma:','push','all','WARNING','No\x20product\x20to\x20assign\x20new\x20proforma.\x20Proforma\x20not\x20created!!\x20','TCL:\x20exports.cloneProforma\x20->\x20err','send','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','set','Content-Range','apply','save','then','destroy','end','name','index','SAProforma','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','limit','offset','order','sort'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4cb2,0xc9));var _0x24cb=function(_0x5a027d,_0x79ee66){_0x5a027d=_0x5a027d-0x0;var _0x4b2b77=_0x4cb2[_0x5a027d];return _0x4b2b77;};'use strict';var pdf=require(_0x24cb('0x0'));var emlformat=require(_0x24cb('0x1'));var rimraf=require(_0x24cb('0x2'));var zipdir=require(_0x24cb('0x3'));var jsonpatch=require(_0x24cb('0x4'));var rp=require(_0x24cb('0x5'));var moment=require(_0x24cb('0x6'));var BPromise=require(_0x24cb('0x7'));var Mustache=require(_0x24cb('0x8'));var util=require(_0x24cb('0x9'));var path=require('path');var sox=require(_0x24cb('0xa'));var csv=require('to-csv');var ejs=require(_0x24cb('0xb'));var fs=require('fs');var _=require(_0x24cb('0xc'));var squel=require(_0x24cb('0xd'));var crypto=require(_0x24cb('0xe'));var jsforce=require(_0x24cb('0xf'));var deskjs=require(_0x24cb('0x10'));var toCsv=require(_0x24cb('0x11'));var querystring=require(_0x24cb('0x12'));var Papa=require(_0x24cb('0x13'));var Redis=require(_0x24cb('0x14'));var authService=require(_0x24cb('0x15'));var qs=require(_0x24cb('0x16'));var hardwareService=require(_0x24cb('0x17'));var logger=require(_0x24cb('0x18'))('api');var utils=require(_0x24cb('0x19'));var config=require('../../config/environment');var db=require(_0x24cb('0x1a'))['db'];function respondWithStatusCode(_0x44b357,_0x575a65){_0x575a65=_0x575a65||0xcc;return function(_0x15e9d1){if(_0x15e9d1){return _0x44b357[_0x24cb('0x1b')](_0x575a65);}return _0x44b357['status'](_0x575a65)['end']();};}function respondWithResult(_0x551d9a,_0x3d862d){_0x3d862d=_0x3d862d||0xc8;return function(_0x4c80c9){if(_0x4c80c9){return _0x551d9a[_0x24cb('0x1c')](_0x3d862d)[_0x24cb('0x1d')](_0x4c80c9);}};}function respondWithFilteredResult(_0xed65d4,_0x3d9aae){return function(_0x1ffaa8){if(_0x1ffaa8){var _0x3fbc11=_0x1ffaa8['count'],_0x4f130f=_0x3d9aae['offset'],_0x159a59=_0x3d9aae['offset']+_0x3d9aae['limit'],_0x27a495;if(_0x159a59>=_0x3fbc11){_0x159a59=_0x3fbc11;_0x27a495=0xc8;}else{_0x27a495=0xce;}_0xed65d4[_0x24cb('0x1c')](_0x27a495);return _0xed65d4[_0x24cb('0x1e')](_0x24cb('0x1f'),_0x4f130f+'-'+_0x159a59+'/'+_0x3fbc11)[_0x24cb('0x1d')](_0x1ffaa8);}return null;};}function patchUpdates(_0x26fd04){return function(_0x23bafd){try{jsonpatch[_0x24cb('0x20')](_0x23bafd,_0x26fd04,!![]);}catch(_0x5dbcda){return BPromise['reject'](_0x5dbcda);}return _0x23bafd[_0x24cb('0x21')]();};}function saveUpdates(_0x56da9d,_0x37af81){return function(_0x2bf258){if(_0x2bf258){return _0x2bf258['update'](_0x56da9d)[_0x24cb('0x22')](function(_0x58a65e){return _0x58a65e;});}return null;};}function removeEntity(_0x397fc9,_0x3dc797){return function(_0x4a1a3f){if(_0x4a1a3f){return _0x4a1a3f[_0x24cb('0x23')]()[_0x24cb('0x22')](function(){_0x397fc9[_0x24cb('0x1c')](0xcc)[_0x24cb('0x24')]();});}};}function handleEntityNotFound(_0x4bf221,_0x37a119){return function(_0x37643a){if(!_0x37643a){_0x4bf221[_0x24cb('0x1b')](0x194);}return _0x37643a;};}function handleError(_0x507b7f,_0x384986){_0x384986=_0x384986||0x1f4;return function(_0x1f14c5){logger['error'](_0x1f14c5['stack']);if(_0x1f14c5[_0x24cb('0x25')]){delete _0x1f14c5['name'];}_0x507b7f[_0x24cb('0x1c')](_0x384986)['send'](_0x1f14c5);};}exports[_0x24cb('0x26')]=function(_0x119db9,_0xee1c35){var _0x1dd36a={},_0x220e9f={},_0x4f5cc1={'count':0x0,'rows':[]};var _0x53bcc9=db[_0x24cb('0x27')][_0x24cb('0x28')];_0x220e9f[_0x24cb('0x29')]=_[_0x24cb('0x2a')](_0x53bcc9);_0x220e9f[_0x24cb('0x2b')]=_[_0x24cb('0x2a')](_0x119db9[_0x24cb('0x2b')]);_0x220e9f[_0x24cb('0x2c')]=_[_0x24cb('0x2d')](_0x220e9f[_0x24cb('0x29')],_0x220e9f[_0x24cb('0x2b')]);_0x1dd36a[_0x24cb('0x2e')]=_[_0x24cb('0x2d')](_0x220e9f[_0x24cb('0x29')],qs['fields'](_0x119db9['query']['fields']));_0x1dd36a['attributes']=_0x1dd36a[_0x24cb('0x2e')][_0x24cb('0x2f')]?_0x1dd36a[_0x24cb('0x2e')]:_0x220e9f['model'];if(!_0x119db9[_0x24cb('0x2b')][_0x24cb('0x30')]('nolimit')){_0x1dd36a[_0x24cb('0x31')]=qs[_0x24cb('0x31')](_0x119db9['query'][_0x24cb('0x31')]);_0x1dd36a['offset']=qs['offset'](_0x119db9[_0x24cb('0x2b')][_0x24cb('0x32')]);}_0x1dd36a[_0x24cb('0x33')]=qs[_0x24cb('0x34')](_0x119db9[_0x24cb('0x2b')][_0x24cb('0x34')]);_0x1dd36a[_0x24cb('0x35')]=qs[_0x24cb('0x2c')](_['pick'](_0x119db9[_0x24cb('0x2b')],_0x220e9f['filters']));if(_0x119db9[_0x24cb('0x2b')][_0x24cb('0x36')]){_0x1dd36a['where']=_[_0x24cb('0x37')](_0x1dd36a[_0x24cb('0x35')],{'$or':_[_0x24cb('0x38')](_0x53bcc9,function(_0x2ab493){if(_0x2ab493[_0x24cb('0x39')]['key']!==_0x24cb('0x3a')){var _0x26894b={};_0x26894b[_0x2ab493['field']]={'$like':'%'+_0x119db9[_0x24cb('0x2b')]['filter']+'%'};return _0x26894b;}})});}_0x1dd36a=_['merge']({},_0x1dd36a,_0x119db9[_0x24cb('0x3b')]);var _0x2dbd7a={'where':_0x1dd36a[_0x24cb('0x35')]};return db['SAProforma'][_0x24cb('0x3c')](_0x2dbd7a)[_0x24cb('0x22')](function(_0x410395){_0x4f5cc1[_0x24cb('0x3c')]=_0x410395;if(_0x119db9['query'][_0x24cb('0x3d')]){_0x1dd36a[_0x24cb('0x3e')]=[{'all':!![]}];}return db[_0x24cb('0x27')][_0x24cb('0x3f')](_0x1dd36a);})[_0x24cb('0x22')](function(_0x4beb06){_0x4f5cc1[_0x24cb('0x40')]=_0x4beb06;return _0x4f5cc1;})[_0x24cb('0x22')](respondWithFilteredResult(_0xee1c35,_0x1dd36a))[_0x24cb('0x41')](handleError(_0xee1c35,null));};exports[_0x24cb('0x42')]=function(_0x5ae0c1,_0x135e87){var _0x5c9015={'raw':![],'where':{'id':_0x5ae0c1[_0x24cb('0x43')]['id']}},_0x5b929d={};_0x5b929d[_0x24cb('0x29')]=_[_0x24cb('0x2a')](db[_0x24cb('0x27')][_0x24cb('0x28')]);_0x5b929d[_0x24cb('0x2b')]=_['keys'](_0x5ae0c1[_0x24cb('0x2b')]);_0x5b929d[_0x24cb('0x2c')]=_[_0x24cb('0x2d')](_0x5b929d[_0x24cb('0x29')],_0x5b929d['query']);_0x5c9015['attributes']=_[_0x24cb('0x2d')](_0x5b929d[_0x24cb('0x29')],qs[_0x24cb('0x44')](_0x5ae0c1[_0x24cb('0x2b')][_0x24cb('0x44')]));_0x5c9015[_0x24cb('0x2e')]=_0x5c9015['attributes'][_0x24cb('0x2f')]?_0x5c9015[_0x24cb('0x2e')]:_0x5b929d['model'];if(_0x5ae0c1[_0x24cb('0x2b')]['includeAll']){_0x5c9015[_0x24cb('0x3e')]=[{'all':!![]}];}_0x5c9015=_[_0x24cb('0x37')]({},_0x5c9015,_0x5ae0c1['options']);return db[_0x24cb('0x27')][_0x24cb('0x45')](_0x5c9015)[_0x24cb('0x22')](handleEntityNotFound(_0x135e87,null))['then'](respondWithResult(_0x135e87,null))['catch'](handleError(_0x135e87,null));};exports[_0x24cb('0x46')]=function(_0x236711,_0x142e75){return db['SAProforma'][_0x24cb('0x46')](_0x236711['body'],{})[_0x24cb('0x22')](respondWithResult(_0x142e75,0xc9))[_0x24cb('0x41')](handleError(_0x142e75,null));};exports[_0x24cb('0x47')]=function(_0x12b60d,_0x484c3a){if(_0x12b60d[_0x24cb('0x48')]['id']){delete _0x12b60d[_0x24cb('0x48')]['id'];}return db[_0x24cb('0x27')][_0x24cb('0x45')]({'where':{'id':_0x12b60d[_0x24cb('0x43')]['id']}})[_0x24cb('0x22')](handleEntityNotFound(_0x484c3a,null))[_0x24cb('0x22')](saveUpdates(_0x12b60d[_0x24cb('0x48')],null))[_0x24cb('0x22')](respondWithResult(_0x484c3a,null))[_0x24cb('0x41')](handleError(_0x484c3a,null));};exports[_0x24cb('0x23')]=function(_0xc7e776,_0x221020){return db[_0x24cb('0x27')][_0x24cb('0x45')]({'where':{'id':_0xc7e776[_0x24cb('0x43')]['id']}})[_0x24cb('0x22')](handleEntityNotFound(_0x221020,null))[_0x24cb('0x22')](removeEntity(_0x221020,null))['catch'](handleError(_0x221020,null));};exports[_0x24cb('0x49')]=function(_0x44dd7b,_0x1e9d46){return db['SAProforma']['describe']()['then'](respondWithResult(_0x1e9d46,null))[_0x24cb('0x41')](handleError(_0x1e9d46,null));};exports['getProformaPDF']=function(_0x5eb375,_0xd0eaa8){var _0x39007c=moment()[_0x24cb('0x4a')]()[_0x24cb('0x4b')]();var _0x3a9abd=path[_0x24cb('0x4c')](config[_0x24cb('0x4d')],_0x24cb('0x4e'),_0x24cb('0x4f'),_0x24cb('0x50'));var _0x3d42f0=path['join'](config[_0x24cb('0x4d')],_0x24cb('0x4e'),_0x24cb('0x4f'),_0x24cb('0x51'),_0x24cb('0x52'),_0x24cb('0x53'));var _0x23baf2=path[_0x24cb('0x4c')](config[_0x24cb('0x4d')],_0x24cb('0x4e'),'files',_0x24cb('0x51'),_0x24cb('0x52'),_0x24cb('0x54'));var _0x1bf1e2=path[_0x24cb('0x4c')](_0x3a9abd,_0x39007c);var _0x35d343=util['format'](_0x24cb('0x55'),_0x5eb375['params']['id'],_0x39007c);var _0x26ffd9=path[_0x24cb('0x4c')](_0x1bf1e2,_0x35d343);var _0x324c18=![];var _0x3613d3={};return db[_0x24cb('0x27')][_0x24cb('0x45')]({'where':{'id':_0x5eb375[_0x24cb('0x43')]['id']},'raw':!![]})[_0x24cb('0x22')](handleEntityNotFound(_0xd0eaa8,null))[_0x24cb('0x22')](function(_0x3630f8){if(_0x3630f8){_0x3613d3['proforma']=_0x3630f8;return db[_0x24cb('0x56')][_0x24cb('0x3f')]({'where':{'ProformaId':_0x3630f8['id']},'raw':!![]})[_0x24cb('0x22')](function(_0x174873){_0x3613d3[_0x24cb('0x57')]=_0x174873;_0x324c18=!![];var _0x48b350='';var _0x270169={'format':'A4','orientation':_0x24cb('0x58'),'border':_0x24cb('0x59'),'footer':{'height':_0x24cb('0x5a'),'contents':{'default':_0x24cb('0x5b')}}};_0x270169[_0x24cb('0x5c')][_0x24cb('0x5d')][_0x24cb('0x5e')]=_0x270169['footer'][_0x24cb('0x5d')][_0x24cb('0x5e')]+_0x24cb('0x5f')+_0x3613d3['proforma'][_0x24cb('0x60')]+_0x24cb('0x61');fs[_0x24cb('0x62')](_0x1bf1e2);_0x48b350='';_0x48b350+='\x20\x20body{font-family:\x20Verdana,\x20Geneva,\x20Tahoma,\x20sans-serif;}.itemTabTitle{background-color:\x20lightgray;\x20height:\x2040px;}.issuerInfo{color:\x20lightgray;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;\x20font-size:\x2012px;}.issuerData{font-weight:\x20normal}.issuerFiled{font-weight:\x20bold;\x20font-size:\x2010px;\x20padding-left:\x2010px;}.issuerFiledWeb{font-weight:\x20bold;\x20text-align:\x20center;}.receiperInfo{text-align:\x20right;\x20font-size:\x2012px}.receiperCompanyName{font-weight:\x20bold;\x20padding-top:\x2010px;\x20padding-bottom:\x2015px;\x20font-size:\x2016px}.reciperFiscalInfo{padding-top:\x205px;\x20padding-bottom:\x205px;}table.center{margin-left:\x20auto;\x20margin-right:\x20auto;\x20width:\x2090%;}.total{background-color:\x20lightgray;\x20font-size:\x2018px;\x20font-weight:\x20bold;}.totalText{background-color:\x20lightgray;\x20text-align:\x20right;\x20font-size:\x2016px;\x20padding-right:\x2010px;}.totalEmpty{background-color:\x20#ffffff;}.invoiceNumber{font-weight:\x20bolder;\x20font-size:\x2024px;\x20padding-bottom:\x2020px;}.invoiceNumber{font-weight:\x20bold;\x20font-size:\x2018px;}.createdDate{font-size:\x2014px;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;}.duedDate{font-size:\x2014px;\x20padding-bottom:\x2010px;}.TFtable{width:\x20100%;\x20font-size:\x2010px;\x20border-collapse:\x20collapse;}.TFtable\x20td{padding:\x207px;}.TFtable\x20tr:nth-child(even){background:\x20#ffffff;}.TFtable\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.numberRight{text-align:\x20right;}.numberCenter{text-align:\x20center}.currency{text-align:\x20left;}table.roundedCorners{border:\x202px\x20solid\x20lightgray;\x20border-radius:\x205px;\x20border-spacing:\x200;\x20width:\x20100%;\x20font-size:\x2010px;}table.roundedCorners\x20td,\x20table.roundedCorners\x20th{border-bottom:\x201px\x20solid\x20lightgray;\x20padding:\x2010px;}table.roundedCorners\x20tr:last-child\x20>\x20td{border-bottom:\x20none;}table.roundedCorners\x20tr:nth-child(even){background:\x20#ffffff;}table.roundedCorners\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.lex{padding-left:\x2010px;font-size:\x2010px;padding-bottom:\x2020px;}.divTotal{float:\x20right;\x20border-radius:\x205px;\x20border:\x202px\x20solid\x20lightgray;\x20padding:\x2010px;\x20margin-top:30px;}.itemTotal{width:\x20200px;\x20line-height:\x2030px;}.tabTotal{border-collapse:\x20collapse;}';_0x48b350+=_0x24cb('0x63');var _0x4f2af2={'phone':{'en':_0x24cb('0x64'),'it':_0x24cb('0x65')},'fax':{'en':_0x24cb('0x66'),'it':_0x24cb('0x66')},'email':{'en':_0x24cb('0x67'),'it':'Email'},'piva':{'en':_0x24cb('0x68'),'it':_0x24cb('0x69')},'cf':{'en':'Tax\x20code','it':'C.F.'},'sdi':{'en':_0x24cb('0x6a'),'it':_0x24cb('0x6b')},'cs':{'en':'Soc.Cap.\x20fp','it':_0x24cb('0x6c')},'invoice':{'en':_0x24cb('0x6d'),'it':'Fattura'},'proforma':{'en':_0x24cb('0x6e'),'it':'Proforma'},'creditnote':{'en':'Credit\x20note','it':_0x24cb('0x6f')},'duedate':{'en':'Due\x20date','it':_0x24cb('0x70')},'item':{'en':'Item','it':_0x24cb('0x71')},'description':{'en':_0x24cb('0x72'),'it':_0x24cb('0x73')},'hrsqty':{'en':'Hrs/Qty','it':_0x24cb('0x74')},'unitprice':{'en':_0x24cb('0x75'),'it':'Prezzo\x20Unitario'},'subtotal':{'en':_0x24cb('0x76'),'it':_0x24cb('0x77')},'discount':{'en':_0x24cb('0x78'),'it':_0x24cb('0x79')},'total':{'en':'Subtotal','it':'Imponibile'},'tax':{'en':_0x24cb('0x7a'),'it':_0x24cb('0x7b')},'nettopay':{'en':_0x24cb('0x7c'),'it':_0x24cb('0x7d')},'sendpayment':{'en':_0x24cb('0x7e'),'it':_0x24cb('0x7f')},'accountholder':{'en':_0x24cb('0x80'),'it':_0x24cb('0x81')},'bankname':{'en':_0x24cb('0x82'),'it':'Nome\x20banca'},'bankaddress':{'en':_0x24cb('0x83'),'it':_0x24cb('0x84')},'abi':{'en':_0x24cb('0x85'),'it':_0x24cb('0x85')},'cab':{'en':_0x24cb('0x86'),'it':_0x24cb('0x86')},'bic':{'en':'BIC','it':_0x24cb('0x87')},'swif':{'en':'SWIF','it':_0x24cb('0x88')},'iban':{'en':_0x24cb('0x89'),'it':_0x24cb('0x89')},'paypal':{'en':'Pay\x20via\x20Paypal','it':'Paga\x20con\x20Paypal'},'thank1':{'en':_0x24cb('0x8a'),'it':_0x24cb('0x8b')},'thank2':{'en':_0x24cb('0x8c'),'it':_0x24cb('0x8d')}};var _0xb724fc='it';if(_0x3613d3[_0x24cb('0x8e')][_0x24cb('0x8f')]!==_0x24cb('0x90')){_0xb724fc='en';}_0x48b350+='';_0x48b350+=_0x24cb('0x91')+_0x3d42f0+_0x24cb('0x92');_0x48b350+=_0x24cb('0x93');_0x48b350+=util[_0x24cb('0x94')](_0x24cb('0x95'),_0x3613d3['proforma'][_0x24cb('0x96')]);_0x48b350+=util['format'](_0x24cb('0x97'),_0x3613d3[_0x24cb('0x8e')]['issuerStreet']);_0x48b350+=util['format']('%s',_0x3613d3[_0x24cb('0x8e')]['issuerPostalCode']);_0x48b350+=util[_0x24cb('0x94')]('\x20%s',_0x3613d3[_0x24cb('0x8e')][_0x24cb('0x98')]);_0x48b350+=util[_0x24cb('0x94')](_0x24cb('0x99'),_0x3613d3[_0x24cb('0x8e')][_0x24cb('0x9a')]);_0x48b350+=util[_0x24cb('0x94')](_0x4f2af2[_0x24cb('0x9b')][_0xb724fc]+_0x24cb('0x9c'),_0x3613d3['proforma'][_0x24cb('0x9d')]);_0x48b350+=util[_0x24cb('0x94')](_0x4f2af2[_0x24cb('0x9e')][_0xb724fc]+':\x20%s
',_0x3613d3[_0x24cb('0x8e')][_0x24cb('0x9f')]);_0x48b350+=util[_0x24cb('0x94')](_0x4f2af2[_0x24cb('0xa0')][_0xb724fc]+_0x24cb('0x9c'),_0x3613d3['proforma'][_0x24cb('0xa1')]);_0x48b350+=util[_0x24cb('0x94')](_0x4f2af2[_0x24cb('0xa2')][_0xb724fc]+_0x24cb('0x9c'),_0x3613d3[_0x24cb('0x8e')][_0x24cb('0xa3')]);_0x48b350+=util[_0x24cb('0x94')](_0x4f2af2['cf'][_0xb724fc]+':\x20%s
',_0x3613d3[_0x24cb('0x8e')][_0x24cb('0xa4')]);_0x48b350+=util[_0x24cb('0x94')](_0x4f2af2[_0x24cb('0xa5')][_0xb724fc]+_0x24cb('0x9c'),_0x3613d3[_0x24cb('0x8e')]['issuerSDICode']);_0x48b350+=util[_0x24cb('0x94')](_0x4f2af2['cs'][_0xb724fc]+_0x24cb('0x9c'),_0x3613d3[_0x24cb('0x8e')]['issuerSocCap']);_0x48b350+=_0x24cb('0xa6');_0x48b350+=_0x24cb('0xa7');_0x48b350+=_0x24cb('0xa8');_0x48b350+=util[_0x24cb('0x94')]('%s',_0x3613d3[_0x24cb('0x8e')]['companyName']);_0x48b350+=util[_0x24cb('0x94')](_0x24cb('0x97'),_0x3613d3['proforma'][_0x24cb('0xa9')]);_0x48b350+=util[_0x24cb('0x94')]('%s\x20-\x20',_0x3613d3[_0x24cb('0x8e')]['receivingPostalCode']);_0x48b350+=util[_0x24cb('0x94')](_0x24cb('0x97'),_0x3613d3[_0x24cb('0x8e')][_0x24cb('0xaa')]);_0x48b350+=util[_0x24cb('0x94')](_0x24cb('0x97'),_0x3613d3[_0x24cb('0x8e')][_0x24cb('0x8f')]);_0x48b350+=util[_0x24cb('0x94')](_0x24cb('0xab')+_0x4f2af2['cf'][_0xb724fc]+_0x24cb('0x9c'),_0x3613d3[_0x24cb('0x8e')][_0x24cb('0xac')]);_0x48b350+=util['format'](_0x4f2af2['piva'][_0xb724fc]+_0x24cb('0x9c'),_0x3613d3['proforma']['receivingPIVA']);_0x48b350+=util['format'](_0x4f2af2[_0x24cb('0xa5')][_0xb724fc]+':\x20%s
',_0x3613d3[_0x24cb('0x8e')][_0x24cb('0xad')]);_0x48b350+=_0x24cb('0xae');_0x48b350+=_0x24cb('0xaf');_0x48b350+=_0x24cb('0x93');_0x48b350+='';_0x48b350+=util[_0x24cb('0x94')](''+_0x4f2af2[_0x24cb('0x8e')][_0xb724fc]+_0x24cb('0xb0'),_0x3630f8['id']);_0x48b350+=util[_0x24cb('0x94')](_0x24cb('0xb1'),_0x3613d3[_0x24cb('0x8e')][_0x24cb('0x98')]);var _0x2674f9=moment(_0x3613d3[_0x24cb('0x8e')][_0x24cb('0xb2')])[_0x24cb('0x94')](_0x24cb('0xb3'));_0x48b350+=util[_0x24cb('0x94')](_0x24cb('0xb4'),_0x2674f9);var _0x17da77=moment(_0x3613d3[_0x24cb('0x8e')][_0x24cb('0xb2')])[_0x24cb('0xb5')](_0x3613d3[_0x24cb('0x8e')][_0x24cb('0xb6')],_0x24cb('0xb7'))['format']('DD/MM/YYYY');_0x48b350+=util[_0x24cb('0x94')](_0x24cb('0xb8')+_0x4f2af2['duedate'][_0xb724fc]+_0x24cb('0xb9'),_0x17da77);_0x48b350+=_0x24cb('0xaf');_0x48b350+=_0x24cb('0x93');_0x48b350+=_0x24cb('0xba');_0x48b350+=_0x24cb('0xbb');_0x48b350+=_0x24cb('0x93');_0x48b350+=_0x24cb('0xbc')+_0x4f2af2['item'][_0xb724fc]+_0x24cb('0xbd');_0x48b350+=''+_0x4f2af2['description'][_0xb724fc]+_0x24cb('0xbd');_0x48b350+=''+_0x4f2af2[_0x24cb('0xbe')][_0xb724fc]+_0x24cb('0xbd');_0x48b350+=_0x24cb('0xbc')+_0x4f2af2['unitprice'][_0xb724fc]+_0x24cb('0xbd');_0x48b350+=_0x24cb('0xbc')+_0x4f2af2[_0x24cb('0xbf')][_0xb724fc]+_0x24cb('0xbd');_0x48b350+=_0x24cb('0xaf');var _0x2a2629=0x0;var _0x19a392=0x0;for(var _0x2f4006=0x0;_0x2f4006<_0x3613d3[_0x24cb('0x57')][_0x24cb('0x2f')];_0x2f4006++){var _0x23705f=0x0;var _0x380cf5=0x0;var _0x44613d=0x0;var _0x7fcebc=0x0;_0x23705f=_0x3613d3[_0x24cb('0x57')][_0x2f4006]['netPrice']-_0x3613d3[_0x24cb('0x57')][_0x2f4006]['netPrice']/0x64*_0x3613d3[_0x24cb('0x57')][_0x2f4006]['discount'];_0x380cf5=_0x23705f/0x64*_0x3613d3[_0x24cb('0x57')][_0x2f4006]['tax'];_0x44613d=_0x23705f*_0x3613d3[_0x24cb('0x57')][_0x2f4006][_0x24cb('0xc0')];_0x7fcebc=_0x380cf5*_0x3613d3[_0x24cb('0x57')][_0x2f4006][_0x24cb('0xc0')];_0x48b350+=_0x24cb('0x93');_0x48b350+=util[_0x24cb('0x94')](_0x24cb('0xc1'),_0x3613d3[_0x24cb('0x57')][_0x2f4006]['productName']);_0x48b350+=util[_0x24cb('0x94')]('%s',_0x3613d3[_0x24cb('0x57')][_0x2f4006][_0x24cb('0xc2')]);_0x48b350+=util[_0x24cb('0x94')](_0x24cb('0xc3'),_0x3613d3[_0x24cb('0x57')][_0x2f4006][_0x24cb('0xc0')]);_0x48b350+=_0x24cb('0xc4')+_0x23705f[_0x24cb('0xc5')](0x2)+_0x24cb('0xc6');_0x48b350+=''+_0x44613d['toFixed'](0x2)+_0x24cb('0xc6');_0x48b350+=_0x24cb('0xaf');_0x2a2629+=_0x44613d;_0x19a392+=_0x7fcebc;}_0x48b350+=_0x24cb('0xc7');if(!_['isNil'](_0x3613d3[_0x24cb('0x8e')][_0x24cb('0xc8')])){var _0x13b8e5=0x0;var _0x470b21=0x0;var _0x7337de=_0x3613d3[_0x24cb('0x8e')]['discount']*0x64/_0x2a2629;for(var _0x2f4006=0x0;_0x2f4006<_0x3613d3[_0x24cb('0x57')][_0x24cb('0x2f')];_0x2f4006++){var _0x2c45a6=0x0;var _0x3f71d2=0x0;var _0x284934=0x0;_0x23705f=_0x3613d3[_0x24cb('0x57')][_0x2f4006][_0x24cb('0xc9')]-_0x3613d3['details'][_0x2f4006][_0x24cb('0xc9')]/0x64*_0x3613d3[_0x24cb('0x57')][_0x2f4006]['discount'];_0x2c45a6=_0x23705f/0x64*_0x7337de;_0x3f71d2=_0x23705f-_0x2c45a6;_0x284934=_0x3f71d2*_0x3613d3[_0x24cb('0x57')][_0x2f4006][_0x24cb('0xc0')];_0x13b8e5+=_0x284934;_0x470b21+=_0x284934/0x64*_0x3613d3['details'][_0x2f4006]['tax'];}}var _0x36fe82=0x0;var _0x4bca90=0x0;var _0x1e3696=![];var _0x2293b8=_0x3613d3[_0x24cb('0x8e')][_0x24cb('0xca')];if(_0x2293b8[_0x24cb('0xcb')]('split\x20payment')!=-0x1){_0x1e3696=!![];}if(!_['isNil'](_0x3613d3[_0x24cb('0x8e')][_0x24cb('0xc8')])){_0x48b350+=_0x24cb('0x93');if(_0x3613d3[_0x24cb('0x8e')]['discount']>0x0){_0x48b350+=_0x24cb('0xcc')+_0x4f2af2[_0x24cb('0xc8')][_0xb724fc]+_0x24cb('0xa6');_0x48b350+=''+_0x3613d3['proforma']['discount']['toFixed'](0x2)+_0x24cb('0xc6');}_0x48b350+=_0x24cb('0xaf');_0x36fe82=_0x470b21;_0x4bca90=_0x13b8e5;}else{_0x36fe82=_0x19a392;_0x4bca90=_0x2a2629;}if(_0x36fe82>0x0||_0x3613d3[_0x24cb('0x8e')][_0x24cb('0xc8')]>0x0){_0x48b350+=_0x24cb('0x93');_0x48b350+=''+_0x4f2af2[_0x24cb('0xcd')][_0xb724fc]+_0x24cb('0xa6');_0x48b350+=_0x24cb('0xc4')+_0x4bca90[_0x24cb('0xc5')](0x2)+_0x24cb('0xc6');_0x48b350+=_0x24cb('0xaf');}if(_0x36fe82>0x0){_0x48b350+=_0x24cb('0x93');_0x48b350+=_0x24cb('0xce')+_0x4f2af2[_0x24cb('0xcf')][_0xb724fc]+_0x24cb('0xa6');_0x48b350+=_0x24cb('0xc4')+_0x36fe82[_0x24cb('0xc5')](0x2)+_0x24cb('0xc6');_0x48b350+=_0x24cb('0xaf');}_0x48b350+=_0x24cb('0x93');var _0x49359b;if(_0x1e3696){_0x49359b=_0x4bca90;}else{_0x49359b=_0x4bca90+_0x36fe82;}_0x48b350+=_0x24cb('0xd0')+_0x4f2af2['nettopay'][_0xb724fc]+_0x24cb('0xd1')+_0x49359b[_0x24cb('0xc5')](0x2)+_0x24cb('0xc6');_0x48b350+=_0x24cb('0xd2');_0x48b350+=_0x24cb('0xaf');_0x48b350+=_0x24cb('0xd3');_0x48b350+='';_0x48b350+=_0x24cb('0x93');_0x48b350+=util[_0x24cb('0x94')]('\x20%s\x20',_0x3613d3[_0x24cb('0x8e')][_0x24cb('0xca')]['replace'](new RegExp(String[_0x24cb('0xd4')](0xd),'g'),_0x24cb('0xd5')));_0x48b350+=_0x24cb('0xaf');_0x48b350+='';_0x48b350+=_0x24cb('0xba');_0x48b350+=_0x24cb('0xd6')+_0x4f2af2['sendpayment'][_0xb724fc]+_0x24cb('0x61');if(!_['isNil'](_0x3613d3[_0x24cb('0x8e')][_0x24cb('0xd7')])){_0x48b350+=''+_0x4f2af2['accountholder'][_0xb724fc]+_0x24cb('0xd8')+_0x3613d3[_0x24cb('0x8e')][_0x24cb('0xd7')]+'';_0x48b350+=''+_0x4f2af2[_0x24cb('0xd9')][_0xb724fc]+':\x20'+_0x3613d3[_0x24cb('0x8e')][_0x24cb('0xda')]+'\x20';_0x48b350+=_0x24cb('0xd6')+_0x4f2af2[_0x24cb('0xdb')][_0xb724fc]+_0x24cb('0xd8')+_0x3613d3[_0x24cb('0x8e')][_0x24cb('0xdc')]+',\x20'+_0x3613d3[_0x24cb('0x8e')]['issuerBankPostalCode']+_0x24cb('0xdd')+_0x3613d3['proforma'][_0x24cb('0xde')]+'\x20('+_0x3613d3[_0x24cb('0x8e')]['issuerBankCountry']+')'+'';_0x48b350+=''+_0x4f2af2[_0x24cb('0xdf')][_0xb724fc]+'/'+_0x4f2af2[_0x24cb('0xe0')][_0xb724fc]+_0x24cb('0xd8')+_0x3613d3[_0x24cb('0x8e')][_0x24cb('0xe1')]+'/'+_0x3613d3[_0x24cb('0x8e')]['issuerCAB']+_0x24cb('0xe2');_0x48b350+=''+_0x4f2af2[_0x24cb('0xe3')][_0xb724fc]+'/'+_0x4f2af2['swif'][_0xb724fc]+_0x24cb('0xd8')+_0x3613d3[_0x24cb('0x8e')]['issuerBankBICSWIFT']+_0x24cb('0xe2');_0x48b350+=_0x24cb('0xd6')+_0x4f2af2[_0x24cb('0xe4')][_0xb724fc]+_0x24cb('0xd8')+_0x3613d3[_0x24cb('0x8e')][_0x24cb('0xe5')]+'';}if(!_[_0x24cb('0xe6')](_0x3613d3[_0x24cb('0x8e')][_0x24cb('0xe7')])){_0x48b350+=_0x24cb('0xd6')+_0x4f2af2['paypal'][_0xb724fc]+':\x20'+_0x3613d3[_0x24cb('0x8e')][_0x24cb('0xe7')]+'';}_0x48b350+=_0x24cb('0xd6')+_0x4f2af2[_0x24cb('0xe8')][_0xb724fc]+''+_0x17da77+_0x24cb('0xe9')+_0x4f2af2[_0x24cb('0xea')][_0xb724fc]+_0x24cb('0x61');_0x48b350+='';_0x48b350+=_0x24cb('0xaf');if(_0x3613d3['proforma']['paid']===0x1){_0x48b350+=_0x24cb('0x91')+_0x23baf2+_0x24cb('0x92');}_0x48b350+=_0x24cb('0xeb');_0x48b350+=_0x24cb('0xec');_0x48b350+=_0x24cb('0xed');return new BPromise(function(_0x549fbc,_0xb5f5be){pdf[_0x24cb('0x46')](_0x48b350,_0x270169)[_0x24cb('0xee')](path[_0x24cb('0x4c')](_0x1bf1e2,_0x35d343),function(_0x16712c,_0x18a0a6){if(_0x16712c)return _0xb5f5be(_0x16712c);_0x549fbc(_0x18a0a6);});});});}})[_0x24cb('0x22')](function(){if(_0x324c18){console[_0x24cb('0xef')](_0x24cb('0xf0'),_0x26ffd9,_0x35d343);return _0xd0eaa8['download'](_0x26ffd9,_0x35d343,function(_0x204d3b){if(_0x204d3b){console['log'](_0x24cb('0xf1'),_0x204d3b);}else{console[_0x24cb('0xef')](_0x24cb('0xf2'),_0x1bf1e2);rimraf(_0x1bf1e2,function(){});}});}else{return _0xd0eaa8[_0x24cb('0x1b')](0xc8);}})['catch'](handleError(_0xd0eaa8,null));};function addCloneDetail(_0x62a295,_0xb9f737,_0x20b5fa){console['log']('addCloneDetail->>',_0x62a295);_0x62a295[_0x24cb('0xf3')]=_0xb9f737;delete _0x62a295['id'];return db[_0x24cb('0x56')]['create'](_0x62a295,{'transaction':_0x20b5fa});}exports[_0x24cb('0xf4')]=function(_0x59c91f,_0x13c173,_0x25d102){var _0x9443e6;if(_0x59c91f[_0x24cb('0x48')]['id']){delete _0x59c91f[_0x24cb('0x48')]['id'];}console[_0x24cb('0xef')]('cloneProforma\x20req.params.id:',_0x59c91f[_0x24cb('0x43')]['id']);return db['sequelize'][_0x24cb('0xf5')](function(_0x49a6e0){return db[_0x24cb('0x27')][_0x24cb('0x46')](_0x59c91f[_0x24cb('0x48')],{'transaction':_0x49a6e0,'logging':console['log']})[_0x24cb('0x22')](function(_0x3d03f9){console['log'](_0x24cb('0xf6'),_0x3d03f9);_0x9443e6=_0x3d03f9;var _0x542870=_0x59c91f[_0x24cb('0x43')]['id'];return db['SAProformaDetail'][_0x24cb('0x3f')]({'where':{'ProformaId':_0x542870},'raw':!![]});})['then'](function(_0x455e8c){console[_0x24cb('0xef')](_0x24cb('0xf7'),_0x455e8c);if(_0x455e8c[_0x24cb('0x2f')]>0x0){var _0x5c240a=[];for(var _0x4e1f8a=0x0;_0x4e1f8a<_0x455e8c[_0x24cb('0x2f')];_0x4e1f8a++){_0x5c240a[_0x24cb('0xf8')](addCloneDetail(_0x455e8c[_0x4e1f8a],_0x9443e6['id'],_0x49a6e0));}return BPromise[_0x24cb('0xf9')](_0x5c240a);}else{var _0x210f5e={'errors':[{'type':_0x24cb('0xfa'),'message':_0x24cb('0xfb')}]};throw _0x210f5e;}});})['then'](function(){return _0x13c173[_0x24cb('0x1b')](0xc8);})[_0x24cb('0x41')](function(_0x3076e5){console[_0x24cb('0xef')](_0x24cb('0xfc'),_0x3076e5);if(_0x3076e5['name']==='SequelizeUniqueConstraintError'){var _0x3076e5={'errors':[{'message':'Duplicate\x20entry.'}]};}_0x13c173[_0x24cb('0x1c')](0x1f4)[_0x24cb('0xfd')](_0x3076e5);});}; \ No newline at end of file +var _0x0a52=['catch','create','body','describe','toString','join','root','server','files','tmp','images','logos','paid-invoice.png','SAProformaDetail','details','portrait','1cm','10mm','footer','contents','default','','proforma','','mkdirSync','','\x20\x20body{font-family:\x20Verdana,\x20Geneva,\x20Tahoma,\x20sans-serif;}.itemTabTitle{background-color:\x20lightgray;\x20height:\x2040px;}.issuerInfo{color:\x20lightgray;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;\x20font-size:\x2012px;}.issuerData{font-weight:\x20normal}.issuerFiled{font-weight:\x20bold;\x20font-size:\x2010px;\x20padding-left:\x2010px;}.issuerFiledWeb{font-weight:\x20bold;\x20text-align:\x20center;}.receiperInfo{text-align:\x20right;\x20font-size:\x2012px}.receiperCompanyName{font-weight:\x20bold;\x20padding-top:\x2010px;\x20padding-bottom:\x2015px;\x20font-size:\x2016px}.reciperFiscalInfo{padding-top:\x205px;\x20padding-bottom:\x205px;}table.center{margin-left:\x20auto;\x20margin-right:\x20auto;\x20width:\x2090%;}.total{background-color:\x20lightgray;\x20font-size:\x2018px;\x20font-weight:\x20bold;}.totalText{background-color:\x20lightgray;\x20text-align:\x20right;\x20font-size:\x2016px;\x20padding-right:\x2010px;}.totalEmpty{background-color:\x20#ffffff;}.invoiceNumber{font-weight:\x20bolder;\x20font-size:\x2024px;\x20padding-bottom:\x2020px;}.invoiceNumber{font-weight:\x20bold;\x20font-size:\x2018px;}.createdDate{font-size:\x2014px;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;}.duedDate{font-size:\x2014px;\x20padding-bottom:\x2010px;}.TFtable{width:\x20100%;\x20font-size:\x2010px;\x20border-collapse:\x20collapse;}.TFtable\x20td{padding:\x207px;}.TFtable\x20tr:nth-child(even){background:\x20#ffffff;}.TFtable\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.numberRight{text-align:\x20right;}.numberCenter{text-align:\x20center}.currency{text-align:\x20left;}table.roundedCorners{border:\x202px\x20solid\x20lightgray;\x20border-radius:\x205px;\x20border-spacing:\x200;\x20width:\x20100%;\x20font-size:\x2010px;}table.roundedCorners\x20td,\x20table.roundedCorners\x20th{border-bottom:\x201px\x20solid\x20lightgray;\x20padding:\x2010px;}table.roundedCorners\x20tr:last-child\x20>\x20td{border-bottom:\x20none;}table.roundedCorners\x20tr:nth-child(even){background:\x20#ffffff;}table.roundedCorners\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.lex{padding-left:\x2010px;font-size:\x2010px;padding-bottom:\x2020px;}.divTotal{float:\x20right;\x20border-radius:\x205px;\x20border:\x202px\x20solid\x20lightgray;\x20padding:\x2010px;\x20margin-top:30px;}.itemTotal{width:\x20200px;\x20line-height:\x2030px;}.tabTotal{border-collapse:\x20collapse;}','','Telefono','Fax','Email','VAT\x20number','Tax\x20code','C.F.','I.S.\x20code','Codice\x20S.D.I.','Soc.Cap.\x20fp','Cap.Soc.\x20iv','Invoice','Fattura','Proforma','Credit\x20note','Nota\x20di\x20credito','Due\x20date','Item','Hrs/Qty','Ore/Qta','Unit\x20Price','Prezzo\x20Unitario','Sub\x20Total','Sub\x20Totale','Sconto','Imponibile','Tasse','Total','Totale','Si\x20prega\x20di\x20inviare\x20il\x20pagamento\x20a','Conto\x20intestato\x20a','Nome\x20banca','Bank\x20Address','Indirizzo\x20banca','ABI','BIC','SWIF','IBAN','Pay\x20via\x20Paypal','Paga\x20con\x20Paypal','Thank\x20you\x20for\x20your\x20business.\x20We\x20do\x20expect\x20payment\x20by\x20','Grazie.\x20Prevediamo\x20il\x20pagamento\x20entro\x20',',\x20so\x20please\x20do\x20so\x20within\x20this\x20time.','\x20quindi\x20vi\x20preghiamo\x20di\x20provvedere\x20entro\x20tale\x20termine.','receivingCountry','Italy','','\x20\x20%s
','issuerName','%s
','issuerStreet','issuerPostalCode','\x20%s','issuerCity','-\x20%s\x20
','issuerCountry','phone',':\x20%s
','issuerPhone','fax','issuerFax','email','issuerEmail','piva','issuerPIVA','sdi','issuerSocCap','','','%s','companyName','receivingStreet','%s\x20-\x20','receivingPostalCode','receivingFiscalCode','receivingPIVA','receivingSDICode','
','','','%s,\x20','DD/MM/YYYY','%s\x20','add','saExpiryDay','days','','duedate',':\x20%s','','','','','description','hrsqty','unitprice','netPrice','discount','tax','quantity','','productName','productDescription','','toFixed','\x20€','
%s
','isNil','receivingFiscalMessage','indexOf','total','','nettopay','\x20',' ','','replace','','','sendpayment','issuerBankAccount','accountholder','','bankname',':\x20','issuerBankName','\x20','bankaddress','issuerBankStreet','issuerBankPostalCode','\x20-\x20','abi','cab','issuerABI','issuerCAB','swif','issuerBankBICSWIFT','issuerPayPal','paypal','','thank2','paid','\x22\x20width=\x22180\x22>','','toFile','log','download','err','foldername','ProformaId','cloneProforma','cloneProforma\x20req.params.id:','sequelize','transaction','findAll','cloneProforma\x20productsProforma:','push','all','No\x20product\x20to\x20assign\x20new\x20proforma.\x20Proforma\x20not\x20created!!\x20','SequelizeUniqueConstraintError','Duplicate\x20entry.','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','SAProforma','count','includeAll','include','rows','show','params','options','find'];(function(_0x2ccdac,_0x17e581){var _0x1a68af=function(_0x52cd8c){while(--_0x52cd8c){_0x2ccdac['push'](_0x2ccdac['shift']());}};_0x1a68af(++_0x17e581);}(_0x0a52,0x1c2));var _0x20a5=function(_0x5e8295,_0x4fcee0){_0x5e8295=_0x5e8295-0x0;var _0x2b08aa=_0x0a52[_0x5e8295];return _0x2b08aa;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x20a5('0x0'));var rimraf=require(_0x20a5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x20a5('0x2'));var rp=require(_0x20a5('0x3'));var moment=require(_0x20a5('0x4'));var BPromise=require(_0x20a5('0x5'));var Mustache=require('mustache');var util=require(_0x20a5('0x6'));var path=require(_0x20a5('0x7'));var sox=require(_0x20a5('0x8'));var csv=require('to-csv');var ejs=require(_0x20a5('0x9'));var fs=require('fs');var _=require(_0x20a5('0xa'));var squel=require(_0x20a5('0xb'));var crypto=require(_0x20a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x20a5('0xd'));var toCsv=require(_0x20a5('0xe'));var querystring=require(_0x20a5('0xf'));var Papa=require(_0x20a5('0x10'));var Redis=require(_0x20a5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x20a5('0x12'));var hardwareService=require(_0x20a5('0x13'));var logger=require(_0x20a5('0x14'))('api');var utils=require(_0x20a5('0x15'));var config=require(_0x20a5('0x16'));var db=require(_0x20a5('0x17'))['db'];function respondWithStatusCode(_0x1bfbda,_0x122611){_0x122611=_0x122611||0xcc;return function(_0x3c2d4f){if(_0x3c2d4f){return _0x1bfbda[_0x20a5('0x18')](_0x122611);}return _0x1bfbda[_0x20a5('0x19')](_0x122611)['end']();};}function respondWithResult(_0x214dfb,_0x3a0fe0){_0x3a0fe0=_0x3a0fe0||0xc8;return function(_0x840924){if(_0x840924){return _0x214dfb['status'](_0x3a0fe0)[_0x20a5('0x1a')](_0x840924);}};}function respondWithFilteredResult(_0x4d7aed,_0x44afd5){return function(_0x4459d4){if(_0x4459d4){var _0x2d38e0=_0x4459d4['count'],_0x496558=_0x44afd5[_0x20a5('0x1b')],_0x3610ca=_0x44afd5[_0x20a5('0x1b')]+_0x44afd5[_0x20a5('0x1c')],_0x1c5ace;if(_0x3610ca>=_0x2d38e0){_0x3610ca=_0x2d38e0;_0x1c5ace=0xc8;}else{_0x1c5ace=0xce;}_0x4d7aed[_0x20a5('0x19')](_0x1c5ace);return _0x4d7aed['set'](_0x20a5('0x1d'),_0x496558+'-'+_0x3610ca+'/'+_0x2d38e0)[_0x20a5('0x1a')](_0x4459d4);}return null;};}function patchUpdates(_0x307a80){return function(_0x33efbe){try{jsonpatch[_0x20a5('0x1e')](_0x33efbe,_0x307a80,!![]);}catch(_0x43b53c){return BPromise[_0x20a5('0x1f')](_0x43b53c);}return _0x33efbe[_0x20a5('0x20')]();};}function saveUpdates(_0x27b958,_0x500c3b){return function(_0xf3256c){if(_0xf3256c){return _0xf3256c[_0x20a5('0x21')](_0x27b958)['then'](function(_0x111139){return _0x111139;});}return null;};}function removeEntity(_0xdebeeb,_0x5bff34){return function(_0x3ac688){if(_0x3ac688){return _0x3ac688[_0x20a5('0x22')]()[_0x20a5('0x23')](function(){_0xdebeeb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b7d8b,_0x5a9daa){return function(_0x5b3bff){if(!_0x5b3bff){_0x5b7d8b[_0x20a5('0x18')](0x194);}return _0x5b3bff;};}function handleError(_0x16fe3c,_0x403933){_0x403933=_0x403933||0x1f4;return function(_0x256ef4){logger[_0x20a5('0x24')](_0x256ef4[_0x20a5('0x25')]);if(_0x256ef4[_0x20a5('0x26')]){delete _0x256ef4[_0x20a5('0x26')];}_0x16fe3c[_0x20a5('0x19')](_0x403933)[_0x20a5('0x27')](_0x256ef4);};}exports[_0x20a5('0x28')]=function(_0x24034b,_0x39e173){var _0x369002={},_0x4a05f8={},_0x49fde6={'count':0x0,'rows':[]};var _0x2bacb6=db['SAProforma'][_0x20a5('0x29')];_0x4a05f8[_0x20a5('0x2a')]=_[_0x20a5('0x2b')](_0x2bacb6);_0x4a05f8[_0x20a5('0x2c')]=_['keys'](_0x24034b[_0x20a5('0x2c')]);_0x4a05f8[_0x20a5('0x2d')]=_[_0x20a5('0x2e')](_0x4a05f8['model'],_0x4a05f8[_0x20a5('0x2c')]);_0x369002[_0x20a5('0x2f')]=_[_0x20a5('0x2e')](_0x4a05f8[_0x20a5('0x2a')],qs[_0x20a5('0x30')](_0x24034b[_0x20a5('0x2c')]['fields']));_0x369002[_0x20a5('0x2f')]=_0x369002[_0x20a5('0x2f')][_0x20a5('0x31')]?_0x369002[_0x20a5('0x2f')]:_0x4a05f8[_0x20a5('0x2a')];if(!_0x24034b[_0x20a5('0x2c')][_0x20a5('0x32')]('nolimit')){_0x369002['limit']=qs[_0x20a5('0x1c')](_0x24034b[_0x20a5('0x2c')][_0x20a5('0x1c')]);_0x369002[_0x20a5('0x1b')]=qs[_0x20a5('0x1b')](_0x24034b[_0x20a5('0x2c')][_0x20a5('0x1b')]);}_0x369002[_0x20a5('0x33')]=qs[_0x20a5('0x34')](_0x24034b[_0x20a5('0x2c')][_0x20a5('0x34')]);_0x369002[_0x20a5('0x35')]=qs[_0x20a5('0x2d')](_[_0x20a5('0x36')](_0x24034b[_0x20a5('0x2c')],_0x4a05f8['filters']));if(_0x24034b[_0x20a5('0x2c')][_0x20a5('0x37')]){_0x369002[_0x20a5('0x35')]=_[_0x20a5('0x38')](_0x369002[_0x20a5('0x35')],{'$or':_[_0x20a5('0x39')](_0x2bacb6,function(_0x11f5a6){if(_0x11f5a6[_0x20a5('0x3a')]['key']!==_0x20a5('0x3b')){var _0x34d5cf={};_0x34d5cf[_0x11f5a6[_0x20a5('0x3c')]]={'$like':'%'+_0x24034b[_0x20a5('0x2c')][_0x20a5('0x37')]+'%'};return _0x34d5cf;}})});}_0x369002=_[_0x20a5('0x38')]({},_0x369002,_0x24034b['options']);var _0x36456c={'where':_0x369002['where']};return db[_0x20a5('0x3d')][_0x20a5('0x3e')](_0x36456c)[_0x20a5('0x23')](function(_0x225e17){_0x49fde6[_0x20a5('0x3e')]=_0x225e17;if(_0x24034b[_0x20a5('0x2c')][_0x20a5('0x3f')]){_0x369002[_0x20a5('0x40')]=[{'all':!![]}];}return db['SAProforma']['findAll'](_0x369002);})['then'](function(_0x2c9083){_0x49fde6[_0x20a5('0x41')]=_0x2c9083;return _0x49fde6;})[_0x20a5('0x23')](respondWithFilteredResult(_0x39e173,_0x369002))['catch'](handleError(_0x39e173,null));};exports[_0x20a5('0x42')]=function(_0x3f5f34,_0x458a6c){var _0x370618={'raw':![],'where':{'id':_0x3f5f34[_0x20a5('0x43')]['id']}},_0x3543f2={};_0x3543f2[_0x20a5('0x2a')]=_[_0x20a5('0x2b')](db[_0x20a5('0x3d')][_0x20a5('0x29')]);_0x3543f2['query']=_[_0x20a5('0x2b')](_0x3f5f34['query']);_0x3543f2[_0x20a5('0x2d')]=_[_0x20a5('0x2e')](_0x3543f2[_0x20a5('0x2a')],_0x3543f2[_0x20a5('0x2c')]);_0x370618[_0x20a5('0x2f')]=_[_0x20a5('0x2e')](_0x3543f2['model'],qs['fields'](_0x3f5f34['query'][_0x20a5('0x30')]));_0x370618[_0x20a5('0x2f')]=_0x370618['attributes']['length']?_0x370618[_0x20a5('0x2f')]:_0x3543f2['model'];if(_0x3f5f34['query'][_0x20a5('0x3f')]){_0x370618[_0x20a5('0x40')]=[{'all':!![]}];}_0x370618=_[_0x20a5('0x38')]({},_0x370618,_0x3f5f34[_0x20a5('0x44')]);return db[_0x20a5('0x3d')][_0x20a5('0x45')](_0x370618)[_0x20a5('0x23')](handleEntityNotFound(_0x458a6c,null))[_0x20a5('0x23')](respondWithResult(_0x458a6c,null))[_0x20a5('0x46')](handleError(_0x458a6c,null));};exports[_0x20a5('0x47')]=function(_0x2eb8fa,_0x558d07){return db[_0x20a5('0x3d')][_0x20a5('0x47')](_0x2eb8fa['body'],{})[_0x20a5('0x23')](respondWithResult(_0x558d07,0xc9))['catch'](handleError(_0x558d07,null));};exports['update']=function(_0x3553bb,_0x32073c){if(_0x3553bb[_0x20a5('0x48')]['id']){delete _0x3553bb[_0x20a5('0x48')]['id'];}return db[_0x20a5('0x3d')]['find']({'where':{'id':_0x3553bb[_0x20a5('0x43')]['id']}})[_0x20a5('0x23')](handleEntityNotFound(_0x32073c,null))[_0x20a5('0x23')](saveUpdates(_0x3553bb['body'],null))[_0x20a5('0x23')](respondWithResult(_0x32073c,null))['catch'](handleError(_0x32073c,null));};exports['destroy']=function(_0x10e2d3,_0x304627){return db[_0x20a5('0x3d')][_0x20a5('0x45')]({'where':{'id':_0x10e2d3['params']['id']}})[_0x20a5('0x23')](handleEntityNotFound(_0x304627,null))['then'](removeEntity(_0x304627,null))[_0x20a5('0x46')](handleError(_0x304627,null));};exports['describe']=function(_0x26d459,_0x5587a5){return db[_0x20a5('0x3d')][_0x20a5('0x49')]()[_0x20a5('0x23')](respondWithResult(_0x5587a5,null))['catch'](handleError(_0x5587a5,null));};exports['getProformaPDF']=function(_0x124a05,_0x44a52e){var _0x231703=moment()['unix']()[_0x20a5('0x4a')]();var _0x228a92=path[_0x20a5('0x4b')](config[_0x20a5('0x4c')],_0x20a5('0x4d'),_0x20a5('0x4e'),_0x20a5('0x4f'));var _0x167871=path[_0x20a5('0x4b')](config[_0x20a5('0x4c')],_0x20a5('0x4d'),_0x20a5('0x4e'),_0x20a5('0x50'),'logos','logo-invoice.png');var _0xdf2157=path[_0x20a5('0x4b')](config['root'],_0x20a5('0x4d'),_0x20a5('0x4e'),_0x20a5('0x50'),_0x20a5('0x51'),_0x20a5('0x52'));var _0x20c436=path[_0x20a5('0x4b')](_0x228a92,_0x231703);var _0x1b0450=util['format']('Proforma_%s-%s.pdf',_0x124a05[_0x20a5('0x43')]['id'],_0x231703);var _0x1c3c1e=path[_0x20a5('0x4b')](_0x20c436,_0x1b0450);var _0x215f4c=![];var _0x12cbfa={};return db[_0x20a5('0x3d')][_0x20a5('0x45')]({'where':{'id':_0x124a05[_0x20a5('0x43')]['id']},'raw':!![]})[_0x20a5('0x23')](handleEntityNotFound(_0x44a52e,null))[_0x20a5('0x23')](function(_0x10f222){if(_0x10f222){_0x12cbfa['proforma']=_0x10f222;return db[_0x20a5('0x53')]['findAll']({'where':{'ProformaId':_0x10f222['id']},'raw':!![]})[_0x20a5('0x23')](function(_0x5c9e2a){_0x12cbfa[_0x20a5('0x54')]=_0x5c9e2a;_0x215f4c=!![];var _0x1936ef='';var _0x3639c6={'format':'A4','orientation':_0x20a5('0x55'),'border':_0x20a5('0x56'),'footer':{'height':_0x20a5('0x57'),'contents':{'default':'{{page}}/{{pages}}'}}};_0x3639c6[_0x20a5('0x58')][_0x20a5('0x59')][_0x20a5('0x5a')]=_0x3639c6[_0x20a5('0x58')][_0x20a5('0x59')]['default']+_0x20a5('0x5b')+_0x12cbfa[_0x20a5('0x5c')]['issuerWeb']+_0x20a5('0x5d');fs[_0x20a5('0x5e')](_0x20c436);_0x1936ef=_0x20a5('0x5f');_0x1936ef+=_0x20a5('0x60');_0x1936ef+=_0x20a5('0x61');var _0x357a34={'phone':{'en':'Phone','it':_0x20a5('0x62')},'fax':{'en':_0x20a5('0x63'),'it':_0x20a5('0x63')},'email':{'en':_0x20a5('0x64'),'it':_0x20a5('0x64')},'piva':{'en':_0x20a5('0x65'),'it':'P.IVA'},'cf':{'en':_0x20a5('0x66'),'it':_0x20a5('0x67')},'sdi':{'en':_0x20a5('0x68'),'it':_0x20a5('0x69')},'cs':{'en':_0x20a5('0x6a'),'it':_0x20a5('0x6b')},'invoice':{'en':_0x20a5('0x6c'),'it':_0x20a5('0x6d')},'proforma':{'en':_0x20a5('0x6e'),'it':_0x20a5('0x6e')},'creditnote':{'en':_0x20a5('0x6f'),'it':_0x20a5('0x70')},'duedate':{'en':_0x20a5('0x71'),'it':'Scadenza'},'item':{'en':_0x20a5('0x72'),'it':'Articolo'},'description':{'en':'Description','it':'Descrizione'},'hrsqty':{'en':_0x20a5('0x73'),'it':_0x20a5('0x74')},'unitprice':{'en':_0x20a5('0x75'),'it':_0x20a5('0x76')},'subtotal':{'en':_0x20a5('0x77'),'it':_0x20a5('0x78')},'discount':{'en':'Discount','it':_0x20a5('0x79')},'total':{'en':'Subtotal','it':_0x20a5('0x7a')},'tax':{'en':'Tax','it':_0x20a5('0x7b')},'nettopay':{'en':_0x20a5('0x7c'),'it':_0x20a5('0x7d')},'sendpayment':{'en':'Please\x20send\x20PAYMENT\x20to','it':_0x20a5('0x7e')},'accountholder':{'en':'Account\x20Holder','it':_0x20a5('0x7f')},'bankname':{'en':'Bank\x20name','it':_0x20a5('0x80')},'bankaddress':{'en':_0x20a5('0x81'),'it':_0x20a5('0x82')},'abi':{'en':_0x20a5('0x83'),'it':_0x20a5('0x83')},'cab':{'en':'CAB','it':'CAB'},'bic':{'en':_0x20a5('0x84'),'it':_0x20a5('0x84')},'swif':{'en':'SWIF','it':_0x20a5('0x85')},'iban':{'en':_0x20a5('0x86'),'it':_0x20a5('0x86')},'paypal':{'en':_0x20a5('0x87'),'it':_0x20a5('0x88')},'thank1':{'en':_0x20a5('0x89'),'it':_0x20a5('0x8a')},'thank2':{'en':_0x20a5('0x8b'),'it':_0x20a5('0x8c')}};var _0x4c517a='it';if(_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0x8d')]!==_0x20a5('0x8e')){_0x4c517a='en';}_0x1936ef+=_0x20a5('0x8f');_0x1936ef+=_0x20a5('0x90')+_0x167871+'\x22\x20width=\x22180\x22>';_0x1936ef+='';_0x1936ef+=util[_0x20a5('0x91')](_0x20a5('0x92'),_0x12cbfa['proforma'][_0x20a5('0x93')]);_0x1936ef+=util['format'](_0x20a5('0x94'),_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0x95')]);_0x1936ef+=util[_0x20a5('0x91')]('%s',_0x12cbfa['proforma'][_0x20a5('0x96')]);_0x1936ef+=util[_0x20a5('0x91')](_0x20a5('0x97'),_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0x98')]);_0x1936ef+=util[_0x20a5('0x91')](_0x20a5('0x99'),_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0x9a')]);_0x1936ef+=util[_0x20a5('0x91')](_0x357a34[_0x20a5('0x9b')][_0x4c517a]+_0x20a5('0x9c'),_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0x9d')]);_0x1936ef+=util[_0x20a5('0x91')](_0x357a34[_0x20a5('0x9e')][_0x4c517a]+_0x20a5('0x9c'),_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0x9f')]);_0x1936ef+=util['format'](_0x357a34[_0x20a5('0xa0')][_0x4c517a]+_0x20a5('0x9c'),_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0xa1')]);_0x1936ef+=util['format'](_0x357a34[_0x20a5('0xa2')][_0x4c517a]+_0x20a5('0x9c'),_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0xa3')]);_0x1936ef+=util[_0x20a5('0x91')](_0x357a34['cf'][_0x4c517a]+_0x20a5('0x9c'),_0x12cbfa[_0x20a5('0x5c')]['issuerFiscalCode']);_0x1936ef+=util[_0x20a5('0x91')](_0x357a34[_0x20a5('0xa4')][_0x4c517a]+_0x20a5('0x9c'),_0x12cbfa[_0x20a5('0x5c')]['issuerSDICode']);_0x1936ef+=util['format'](_0x357a34['cs'][_0x4c517a]+_0x20a5('0x9c'),_0x12cbfa['proforma'][_0x20a5('0xa5')]);_0x1936ef+=_0x20a5('0xa6');_0x1936ef+='';_0x1936ef+=_0x20a5('0xa7');_0x1936ef+=util[_0x20a5('0x91')](_0x20a5('0xa8'),_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0xa9')]);_0x1936ef+=util[_0x20a5('0x91')](_0x20a5('0x94'),_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0xaa')]);_0x1936ef+=util['format'](_0x20a5('0xab'),_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0xac')]);_0x1936ef+=util[_0x20a5('0x91')](_0x20a5('0x94'),_0x12cbfa[_0x20a5('0x5c')]['receivingCity']);_0x1936ef+=util[_0x20a5('0x91')](_0x20a5('0x94'),_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0x8d')]);_0x1936ef+=util[_0x20a5('0x91')](''+_0x357a34['cf'][_0x4c517a]+_0x20a5('0x9c'),_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0xad')]);_0x1936ef+=util[_0x20a5('0x91')](_0x357a34[_0x20a5('0xa2')][_0x4c517a]+_0x20a5('0x9c'),_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0xae')]);_0x1936ef+=util['format'](_0x357a34[_0x20a5('0xa4')][_0x4c517a]+':\x20%s
',_0x12cbfa['proforma'][_0x20a5('0xaf')]);_0x1936ef+='';_0x1936ef+='
';_0x1936ef+=_0x20a5('0xb0');_0x1936ef+=_0x20a5('0xb1');_0x1936ef+=util[_0x20a5('0x91')](_0x20a5('0xb2')+_0x357a34[_0x20a5('0x5c')][_0x4c517a]+'\x20N.%d',_0x10f222['id']);_0x1936ef+=util[_0x20a5('0x91')](_0x20a5('0xb3'),_0x12cbfa[_0x20a5('0x5c')]['issuerCity']);var _0x3dfccf=moment(_0x12cbfa['proforma']['updatedAt'])[_0x20a5('0x91')](_0x20a5('0xb4'));_0x1936ef+=util[_0x20a5('0x91')](_0x20a5('0xb5'),_0x3dfccf);var _0x4e2c54=moment(_0x12cbfa['proforma']['updatedAt'])[_0x20a5('0xb6')](_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0xb7')],_0x20a5('0xb8'))[_0x20a5('0x91')](_0x20a5('0xb4'));_0x1936ef+=util[_0x20a5('0x91')](_0x20a5('0xb9')+_0x357a34[_0x20a5('0xba')][_0x4c517a]+_0x20a5('0xbb'),_0x4e2c54);_0x1936ef+=_0x20a5('0xbc');_0x1936ef+=_0x20a5('0xb0');_0x1936ef+=_0x20a5('0xb1');_0x1936ef+=_0x20a5('0xbd');_0x1936ef+=_0x20a5('0xb0');_0x1936ef+=_0x20a5('0xbe')+_0x357a34['item'][_0x4c517a]+_0x20a5('0xbf');_0x1936ef+=_0x20a5('0xbe')+_0x357a34[_0x20a5('0xc0')][_0x4c517a]+_0x20a5('0xbf');_0x1936ef+=''+_0x357a34[_0x20a5('0xc1')][_0x4c517a]+'';_0x1936ef+=_0x20a5('0xbe')+_0x357a34[_0x20a5('0xc2')][_0x4c517a]+_0x20a5('0xbf');_0x1936ef+=_0x20a5('0xbe')+_0x357a34['subtotal'][_0x4c517a]+_0x20a5('0xbf');_0x1936ef+='';var _0x476a5f=0x0;var _0x5839c4=0x0;for(var _0x45624f=0x0;_0x45624f<_0x12cbfa['details'][_0x20a5('0x31')];_0x45624f++){var _0xb8802b=0x0;var _0x96e9c=0x0;var _0x48ec47=0x0;var _0x4e5bfc=0x0;_0xb8802b=_0x12cbfa[_0x20a5('0x54')][_0x45624f]['netPrice']-_0x12cbfa['details'][_0x45624f][_0x20a5('0xc3')]/0x64*_0x12cbfa['details'][_0x45624f][_0x20a5('0xc4')];_0x96e9c=_0xb8802b/0x64*_0x12cbfa[_0x20a5('0x54')][_0x45624f][_0x20a5('0xc5')];_0x48ec47=_0xb8802b*_0x12cbfa[_0x20a5('0x54')][_0x45624f][_0x20a5('0xc6')];_0x4e5bfc=_0x96e9c*_0x12cbfa[_0x20a5('0x54')][_0x45624f][_0x20a5('0xc6')];_0x1936ef+=_0x20a5('0xb0');_0x1936ef+=util[_0x20a5('0x91')](_0x20a5('0xc7'),_0x12cbfa[_0x20a5('0x54')][_0x45624f][_0x20a5('0xc8')]);_0x1936ef+=util[_0x20a5('0x91')]('',_0x12cbfa[_0x20a5('0x54')][_0x45624f][_0x20a5('0xc9')]);_0x1936ef+=util[_0x20a5('0x91')]('%d',_0x12cbfa['details'][_0x45624f][_0x20a5('0xc6')]);_0x1936ef+=_0x20a5('0xca')+_0xb8802b['toFixed'](0x2)+'\x20€';_0x1936ef+=''+_0x48ec47[_0x20a5('0xcb')](0x2)+_0x20a5('0xcc');_0x1936ef+='';_0x476a5f+=_0x48ec47;_0x5839c4+=_0x4e5bfc;}_0x1936ef+=_0x20a5('0xcd');if(!_[_0x20a5('0xce')](_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0xc4')])){var _0x176f01=0x0;var _0x42e837=0x0;var _0x574ad5=_0x12cbfa['proforma'][_0x20a5('0xc4')]*0x64/_0x476a5f;for(var _0x45624f=0x0;_0x45624f<_0x12cbfa[_0x20a5('0x54')][_0x20a5('0x31')];_0x45624f++){var _0x39e869=0x0;var _0x2faff9=0x0;var _0x7791c=0x0;_0xb8802b=_0x12cbfa[_0x20a5('0x54')][_0x45624f][_0x20a5('0xc3')]-_0x12cbfa['details'][_0x45624f]['netPrice']/0x64*_0x12cbfa[_0x20a5('0x54')][_0x45624f][_0x20a5('0xc4')];_0x39e869=_0xb8802b/0x64*_0x574ad5;_0x2faff9=_0xb8802b-_0x39e869;_0x7791c=_0x2faff9*_0x12cbfa[_0x20a5('0x54')][_0x45624f][_0x20a5('0xc6')];_0x176f01+=_0x7791c;_0x42e837+=_0x7791c/0x64*_0x12cbfa[_0x20a5('0x54')][_0x45624f][_0x20a5('0xc5')];}}var _0x1c50fe=0x0;var _0x28d843=0x0;var _0xba075d=![];var _0x101189=_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0xcf')];if(_0x101189[_0x20a5('0xd0')]('split\x20payment')!=-0x1){_0xba075d=!![];}if(!_['isNil'](_0x12cbfa[_0x20a5('0x5c')]['discount'])){_0x1936ef+='';if(_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0xc4')]>0x0){_0x1936ef+=''+_0x357a34[_0x20a5('0xc4')][_0x4c517a]+'';_0x1936ef+=_0x20a5('0xca')+_0x12cbfa['proforma'][_0x20a5('0xc4')]['toFixed'](0x2)+_0x20a5('0xcc');}_0x1936ef+=_0x20a5('0xbc');_0x1c50fe=_0x42e837;_0x28d843=_0x176f01;}else{_0x1c50fe=_0x5839c4;_0x28d843=_0x476a5f;}if(_0x1c50fe>0x0||_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0xc4')]>0x0){_0x1936ef+=_0x20a5('0xb0');_0x1936ef+=''+_0x357a34[_0x20a5('0xd1')][_0x4c517a]+_0x20a5('0xa6');_0x1936ef+=_0x20a5('0xca')+_0x28d843['toFixed'](0x2)+_0x20a5('0xcc');_0x1936ef+=_0x20a5('0xbc');}if(_0x1c50fe>0x0){_0x1936ef+=_0x20a5('0xb0');_0x1936ef+=''+_0x357a34[_0x20a5('0xc5')][_0x4c517a]+_0x20a5('0xa6');_0x1936ef+=''+_0x1c50fe['toFixed'](0x2)+'\x20€';_0x1936ef+=_0x20a5('0xbc');}_0x1936ef+=_0x20a5('0xb0');var _0x1be2c2;if(_0xba075d){_0x1be2c2=_0x28d843;}else{_0x1be2c2=_0x28d843+_0x1c50fe;}_0x1936ef+=_0x20a5('0xd2')+_0x357a34[_0x20a5('0xd3')][_0x4c517a]+''+_0x1be2c2[_0x20a5('0xcb')](0x2)+_0x20a5('0xcc');_0x1936ef+=_0x20a5('0xd4');_0x1936ef+=_0x20a5('0xbc');_0x1936ef+=_0x20a5('0xd5');_0x1936ef+=_0x20a5('0xd6');_0x1936ef+=_0x20a5('0xb0');_0x1936ef+=util[_0x20a5('0x91')]('\x20%s\x20',_0x12cbfa['proforma']['receivingFiscalMessage'][_0x20a5('0xd7')](new RegExp(String['fromCharCode'](0xd),'g'),_0x20a5('0xd8')));_0x1936ef+='';_0x1936ef+=_0x20a5('0xb0');_0x1936ef+=_0x20a5('0xb1');_0x1936ef+=_0x20a5('0xd9')+_0x357a34[_0x20a5('0xda')][_0x4c517a]+_0x20a5('0x5d');if(!_[_0x20a5('0xce')](_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0xdb')])){_0x1936ef+=_0x20a5('0xd9')+_0x357a34[_0x20a5('0xdc')][_0x4c517a]+':\x20'+_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0xdb')]+_0x20a5('0xdd');_0x1936ef+=_0x20a5('0xd9')+_0x357a34[_0x20a5('0xde')][_0x4c517a]+_0x20a5('0xdf')+_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0xe0')]+_0x20a5('0xe1');_0x1936ef+=_0x20a5('0xd9')+_0x357a34[_0x20a5('0xe2')][_0x4c517a]+_0x20a5('0xdf')+_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0xe3')]+',\x20'+_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0xe4')]+_0x20a5('0xe5')+_0x12cbfa[_0x20a5('0x5c')]['issuerBankCity']+'\x20('+_0x12cbfa['proforma']['issuerBankCountry']+')'+_0x20a5('0xdd');_0x1936ef+=_0x20a5('0xd9')+_0x357a34[_0x20a5('0xe6')][_0x4c517a]+'/'+_0x357a34[_0x20a5('0xe7')][_0x4c517a]+_0x20a5('0xdf')+_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0xe8')]+'/'+_0x12cbfa['proforma'][_0x20a5('0xe9')]+_0x20a5('0xdd');_0x1936ef+=_0x20a5('0xd9')+_0x357a34['bic'][_0x4c517a]+'/'+_0x357a34[_0x20a5('0xea')][_0x4c517a]+':\x20'+_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0xeb')]+_0x20a5('0xdd');_0x1936ef+=''+_0x357a34['iban'][_0x4c517a]+_0x20a5('0xdf')+_0x12cbfa['proforma']['issuerBankIBAN']+'';}if(!_[_0x20a5('0xce')](_0x12cbfa['proforma'][_0x20a5('0xec')])){_0x1936ef+=_0x20a5('0xd9')+_0x357a34[_0x20a5('0xed')][_0x4c517a]+':\x20'+_0x12cbfa[_0x20a5('0x5c')]['issuerPayPal']+'';}_0x1936ef+=''+_0x357a34['thank1'][_0x4c517a]+''+_0x4e2c54+_0x20a5('0xee')+_0x357a34[_0x20a5('0xef')][_0x4c517a]+'';_0x1936ef+='';_0x1936ef+=_0x20a5('0xbc');if(_0x12cbfa[_0x20a5('0x5c')][_0x20a5('0xf0')]===0x1){_0x1936ef+=_0x20a5('0x90')+_0xdf2157+_0x20a5('0xf1');}_0x1936ef+='
%s
';_0x1936ef+=_0x20a5('0xf2');_0x1936ef+='';return new BPromise(function(_0x3a7388,_0x3b193b){pdf[_0x20a5('0x47')](_0x1936ef,_0x3639c6)[_0x20a5('0xf3')](path[_0x20a5('0x4b')](_0x20c436,_0x1b0450),function(_0x1ab007,_0x107c97){if(_0x1ab007)return _0x3b193b(_0x1ab007);_0x3a7388(_0x107c97);});});});}})[_0x20a5('0x23')](function(){if(_0x215f4c){console[_0x20a5('0xf4')]('TCL:\x20exports.getProformaPDF\x20->\x20saveTo,\x20fileName',_0x1c3c1e,_0x1b0450);return _0x44a52e[_0x20a5('0xf5')](_0x1c3c1e,_0x1b0450,function(_0xac7d75){if(_0xac7d75){console[_0x20a5('0xf4')](_0x20a5('0xf6'),_0xac7d75);}else{console[_0x20a5('0xf4')](_0x20a5('0xf7'),_0x20c436);rimraf(_0x20c436,function(){});}});}else{return _0x44a52e[_0x20a5('0x18')](0xc8);}})[_0x20a5('0x46')](handleError(_0x44a52e,null));};function addCloneDetail(_0x1f3772,_0x3e29be,_0x5a99a9){console[_0x20a5('0xf4')]('addCloneDetail->>',_0x1f3772);_0x1f3772[_0x20a5('0xf8')]=_0x3e29be;delete _0x1f3772['id'];return db['SAProformaDetail'][_0x20a5('0x47')](_0x1f3772,{'transaction':_0x5a99a9});}exports[_0x20a5('0xf9')]=function(_0xfcf218,_0x348b92,_0x43c271){var _0x46c5c1;if(_0xfcf218['body']['id']){delete _0xfcf218[_0x20a5('0x48')]['id'];}console[_0x20a5('0xf4')](_0x20a5('0xfa'),_0xfcf218[_0x20a5('0x43')]['id']);return db[_0x20a5('0xfb')][_0x20a5('0xfc')](function(_0x56fd9a){return db['SAProforma'][_0x20a5('0x47')](_0xfcf218[_0x20a5('0x48')],{'transaction':_0x56fd9a,'logging':console[_0x20a5('0xf4')]})[_0x20a5('0x23')](function(_0x5c2c7e){console[_0x20a5('0xf4')]('result',_0x5c2c7e);_0x46c5c1=_0x5c2c7e;var _0x56f93c=_0xfcf218[_0x20a5('0x43')]['id'];return db[_0x20a5('0x53')][_0x20a5('0xfd')]({'where':{'ProformaId':_0x56f93c},'raw':!![]});})[_0x20a5('0x23')](function(_0x269ec8){console[_0x20a5('0xf4')](_0x20a5('0xfe'),_0x269ec8);if(_0x269ec8[_0x20a5('0x31')]>0x0){var _0x15aaf0=[];for(var _0x3a1ee7=0x0;_0x3a1ee7<_0x269ec8[_0x20a5('0x31')];_0x3a1ee7++){_0x15aaf0[_0x20a5('0xff')](addCloneDetail(_0x269ec8[_0x3a1ee7],_0x46c5c1['id'],_0x56fd9a));}return BPromise[_0x20a5('0x100')](_0x15aaf0);}else{var _0x1becfc={'errors':[{'type':'WARNING','message':_0x20a5('0x101')}]};throw _0x1becfc;}});})[_0x20a5('0x23')](function(){return _0x348b92['sendStatus'](0xc8);})[_0x20a5('0x46')](function(_0xbe0f7a){console[_0x20a5('0xf4')]('TCL:\x20exports.cloneProforma\x20->\x20err',_0xbe0f7a);if(_0xbe0f7a[_0x20a5('0x26')]===_0x20a5('0x102')){var _0xbe0f7a={'errors':[{'message':_0x20a5('0x103')}]};}_0x348b92[_0x20a5('0x19')](0x1f4)[_0x20a5('0x27')](_0xbe0f7a);});}; \ No newline at end of file diff --git a/server/api/saProforma/saProforma.model.js b/server/api/saProforma/saProforma.model.js index 56f013f..0a6d727 100644 --- a/server/api/saProforma/saProforma.model.js +++ b/server/api/saProforma/saProforma.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35ab=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./saProforma.attributes','SAProforma','sa_proformas','lodash'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x35ab,0x17f));var _0xb35a=function(_0x261560,_0x197a94){_0x261560=_0x261560-0x0;var _0x5b3747=_0x35ab[_0x261560];return _0x5b3747;};'use strict';var _=require(_0xb35a('0x0'));var util=require(_0xb35a('0x1'));var logger=require(_0xb35a('0x2'))(_0xb35a('0x3'));var moment=require(_0xb35a('0x4'));var BPromise=require(_0xb35a('0x5'));var rp=require(_0xb35a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb35a('0x7'));var config=require(_0xb35a('0x8'));var attributes=require(_0xb35a('0x9'));module['exports']=function(_0x431296,_0x3951c2){return _0x431296['define'](_0xb35a('0xa'),attributes,{'tableName':_0xb35a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0356=['SAProforma','sa_proformas','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./saProforma.attributes','exports'];(function(_0x321f48,_0x407eed){var _0x400e26=function(_0x13c76c){while(--_0x13c76c){_0x321f48['push'](_0x321f48['shift']());}};_0x400e26(++_0x407eed);}(_0x0356,0x1d6));var _0x6035=function(_0x2585f5,_0x58fdaa){_0x2585f5=_0x2585f5-0x0;var _0x4ec462=_0x0356[_0x2585f5];return _0x4ec462;};'use strict';var _=require(_0x6035('0x0'));var util=require(_0x6035('0x1'));var logger=require(_0x6035('0x2'))(_0x6035('0x3'));var moment=require(_0x6035('0x4'));var BPromise=require(_0x6035('0x5'));var rp=require(_0x6035('0x6'));var fs=require('fs');var path=require(_0x6035('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6035('0x8'));module[_0x6035('0x9')]=function(_0x1603a5,_0x4c8d81){return _0x1603a5['define'](_0x6035('0xa'),attributes,{'tableName':_0x6035('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saProforma/saProforma.rpc.js b/server/api/saProforma/saProforma.rpc.js index b11e109..5f471fc 100644 --- a/server/api/saProforma/saProforma.rpc.js +++ b/server/api/saProforma/saProforma.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97ed=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SAProforma,\x20%s,\x20%s','request\x20sent','debug','SAProforma,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','ioredis'];(function(_0x175433,_0x36487a){var _0x1d3c30=function(_0x578e98){while(--_0x578e98){_0x175433['push'](_0x175433['shift']());}};_0x1d3c30(++_0x36487a);}(_0x97ed,0x1e1));var _0xd97e=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x97ed[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0xd97e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd97e('0x1'));var db=require(_0xd97e('0x2'))['db'];var utils=require(_0xd97e('0x3'));var logger=require(_0xd97e('0x4'))(_0xd97e('0x5'));var config=require(_0xd97e('0x6'));var jayson=require(_0xd97e('0x7'));var client=jayson[_0xd97e('0x8')][_0xd97e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b2f16,_0x468015,_0x280167){return new BPromise(function(_0x2e56e7,_0x3c5b4e){return client[_0xd97e('0xa')](_0x1b2f16,_0x280167)[_0xd97e('0xb')](function(_0x289ce2){logger['info'](_0xd97e('0xc'),_0x468015,_0xd97e('0xd'));logger[_0xd97e('0xe')](_0xd97e('0xf'),_0x468015,_0xd97e('0xd'),JSON[_0xd97e('0x10')](_0x289ce2));if(_0x289ce2[_0xd97e('0x11')]){if(_0x289ce2[_0xd97e('0x11')][_0xd97e('0x12')]===0x1f4){logger['error'](_0xd97e('0xc'),_0x468015,_0x289ce2[_0xd97e('0x11')][_0xd97e('0x13')]);return _0x3c5b4e(_0x289ce2[_0xd97e('0x11')]['message']);}logger[_0xd97e('0x11')](_0xd97e('0xc'),_0x468015,_0x289ce2[_0xd97e('0x11')][_0xd97e('0x13')]);return _0x2e56e7(_0x289ce2['error'][_0xd97e('0x13')]);}else{logger[_0xd97e('0x14')]('SAProforma,\x20%s,\x20%s',_0x468015,_0xd97e('0xd'));_0x2e56e7(_0x289ce2[_0xd97e('0x15')][_0xd97e('0x13')]);}})[_0xd97e('0x16')](function(_0x10f75c){logger[_0xd97e('0x11')](_0xd97e('0xc'),_0x468015,_0x10f75c);_0x3c5b4e(_0x10f75c);});});} \ No newline at end of file +var _0x708a=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','SAProforma,\x20%s,\x20%s','request\x20sent','SAProforma,\x20%s,\x20%s,\x20%s','error','message','info','result','util'];(function(_0xed13de,_0x2ce066){var _0x364f1b=function(_0x1f6011){while(--_0x1f6011){_0xed13de['push'](_0xed13de['shift']());}};_0x364f1b(++_0x2ce066);}(_0x708a,0x18e));var _0xa708=function(_0x19d626,_0xfdda71){_0x19d626=_0x19d626-0x0;var _0x25de7e=_0x708a[_0x19d626];return _0x25de7e;};'use strict';var _=require('lodash');var util=require(_0xa708('0x0'));var moment=require(_0xa708('0x1'));var BPromise=require('bluebird');var rs=require(_0xa708('0x2'));var fs=require('fs');var Redis=require(_0xa708('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa708('0x4'));var logger=require(_0xa708('0x5'))(_0xa708('0x6'));var config=require(_0xa708('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa708('0x8')][_0xa708('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e6d7c,_0x17ea09,_0x2a5af1){return new BPromise(function(_0x267d41,_0x5f1c95){return client[_0xa708('0xa')](_0x5e6d7c,_0x2a5af1)[_0xa708('0xb')](function(_0x2c372e){logger['info'](_0xa708('0xc'),_0x17ea09,_0xa708('0xd'));logger['debug'](_0xa708('0xe'),_0x17ea09,_0xa708('0xd'),JSON['stringify'](_0x2c372e));if(_0x2c372e[_0xa708('0xf')]){if(_0x2c372e[_0xa708('0xf')]['code']===0x1f4){logger['error'](_0xa708('0xc'),_0x17ea09,_0x2c372e['error']['message']);return _0x5f1c95(_0x2c372e[_0xa708('0xf')]['message']);}logger[_0xa708('0xf')]('SAProforma,\x20%s,\x20%s',_0x17ea09,_0x2c372e[_0xa708('0xf')][_0xa708('0x10')]);return _0x267d41(_0x2c372e['error']['message']);}else{logger[_0xa708('0x11')]('SAProforma,\x20%s,\x20%s',_0x17ea09,'request\x20sent');_0x267d41(_0x2c372e[_0xa708('0x12')]['message']);}})['catch'](function(_0x1e0490){logger[_0xa708('0xf')](_0xa708('0xc'),_0x17ea09,_0x1e0490);_0x5f1c95(_0x1e0490);});});} \ No newline at end of file diff --git a/server/api/saProformaDetail/index.js b/server/api/saProformaDetail/index.js index b8e78dc..01fa851 100644 --- a/server/api/saProformaDetail/index.js +++ b/server/api/saProformaDetail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd64b=['update','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','create','post','automaticProformaInvoice','put'];(function(_0x12e295,_0x1ef56c){var _0x1267e2=function(_0x1907f4){while(--_0x1907f4){_0x12e295['push'](_0x12e295['shift']());}};_0x1267e2(++_0x1ef56c);}(_0xd64b,0xc1));var _0xbd64=function(_0x5aadc1,_0x13af65){_0x5aadc1=_0x5aadc1-0x0;var _0x36eb9b=_0xd64b[_0x5aadc1];return _0x36eb9b;};'use strict';var multer=require(_0xbd64('0x0'));var util=require('util');var path=require(_0xbd64('0x1'));var timeout=require('connect-timeout');var express=require(_0xbd64('0x2'));var router=express[_0xbd64('0x3')]();var auth=require(_0xbd64('0x4'));var interaction=require(_0xbd64('0x5'));var config=require(_0xbd64('0x6'));var controller=require('./saProformaDetail.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xbd64('0x7')](_0xbd64('0x8'),auth[_0xbd64('0x9')](),controller[_0xbd64('0xa')]);router[_0xbd64('0x7')](_0xbd64('0xb'),auth[_0xbd64('0x9')](),controller['show']);router['post']('/',auth[_0xbd64('0x9')](),controller[_0xbd64('0xc')]);router[_0xbd64('0xd')]('/:id/automaticProformaInvoice',auth[_0xbd64('0x9')](),controller[_0xbd64('0xe')]);router[_0xbd64('0xf')](_0xbd64('0xb'),auth['isAuthenticated'](),controller[_0xbd64('0x10')]);router['delete'](_0xbd64('0xb'),auth[_0xbd64('0x9')](),controller[_0xbd64('0x11')]);module[_0xbd64('0x12')]=router; \ No newline at end of file +var _0x0713=['destroy','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./saProformaDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','post','/:id/automaticProformaInvoice','put','update','delete'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var auth=require(_0x3071('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3071('0x5'));var controller=require(_0x3071('0x6'));router[_0x3071('0x7')]('/',auth[_0x3071('0x8')](),controller[_0x3071('0x9')]);router[_0x3071('0x7')](_0x3071('0xa'),auth[_0x3071('0x8')](),controller[_0x3071('0xb')]);router[_0x3071('0x7')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0xd')]);router['post']('/',auth[_0x3071('0x8')](),controller[_0x3071('0xe')]);router[_0x3071('0xf')](_0x3071('0x10'),auth[_0x3071('0x8')](),controller['automaticProformaInvoice']);router[_0x3071('0x11')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0x12')]);router[_0x3071('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x3071('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/saProformaDetail/saProformaDetail.attributes.js b/server/api/saProformaDetail/saProformaDetail.attributes.js index 9e09e99..7d95e8b 100644 --- a/server/api/saProformaDetail/saProformaDetail.attributes.js +++ b/server/api/saProformaDetail/saProformaDetail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7384=['DECIMAL','sequelize','STRING','INTEGER','TEXT','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci'];(function(_0x141e03,_0x18340e){var _0x2074e3=function(_0x2b7ece){while(--_0x2b7ece){_0x141e03['push'](_0x141e03['shift']());}};_0x2074e3(++_0x18340e);}(_0x7384,0x158));var _0x4738=function(_0x2443b4,_0x44f51d){_0x2443b4=_0x2443b4-0x0;var _0x3e3a87=_0x7384[_0x2443b4];return _0x3e3a87;};'use strict';var Sequelize=require(_0x4738('0x0'));module['exports']={'companyName':{'type':Sequelize[_0x4738('0x1')],'allowNull':![]},'companyId':{'type':Sequelize[_0x4738('0x2')],'allowNull':![]},'productName':{'type':Sequelize[_0x4738('0x3')],'allowNull':![]},'productCode':{'type':Sequelize[_0x4738('0x1')],'allowNull':![]},'productDescription':{'type':Sequelize['TEXT'](_0x4738('0x4'))+_0x4738('0x5')},'typeName':{'type':Sequelize[_0x4738('0x1')],'allowNull':![]},'unitName':{'type':Sequelize[_0x4738('0x1')]},'pricelistName':{'type':Sequelize['TEXT'],'allowNull':![]},'priceListId':{'type':Sequelize[_0x4738('0x2')],'allowNull':![]},'netPrice':{'type':Sequelize[_0x4738('0x6')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize['DECIMAL'](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize[_0x4738('0x6')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x4738('0x1')],'allowNull':![]},'note':{'type':Sequelize[_0x4738('0x3')]},'subscriptionId':{'type':Sequelize[_0x4738('0x2')],'allowNull':![]},'subscriptionName':{'type':Sequelize[_0x4738('0x1')],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize['INTEGER'],'allowNull':![]},'quantity':{'type':Sequelize[_0x4738('0x6')](0xd,0x4),'allowNull':![]},'ProductQuotationId':{'type':Sequelize[_0x4738('0x2')]}}; \ No newline at end of file +var _0xe8b3=['DECIMAL','sequelize','STRING','INTEGER','TEXT','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci'];(function(_0x51e0e2,_0x306e4b){var _0x2fe124=function(_0x1ddd9e){while(--_0x1ddd9e){_0x51e0e2['push'](_0x51e0e2['shift']());}};_0x2fe124(++_0x306e4b);}(_0xe8b3,0xb0));var _0x3e8b=function(_0x137ad6,_0x48589b){_0x137ad6=_0x137ad6-0x0;var _0x52f0d4=_0xe8b3[_0x137ad6];return _0x52f0d4;};'use strict';var Sequelize=require(_0x3e8b('0x0'));module['exports']={'companyName':{'type':Sequelize[_0x3e8b('0x1')],'allowNull':![]},'companyId':{'type':Sequelize[_0x3e8b('0x2')],'allowNull':![]},'productName':{'type':Sequelize['TEXT'],'allowNull':![]},'productCode':{'type':Sequelize[_0x3e8b('0x1')],'allowNull':![]},'productDescription':{'type':Sequelize[_0x3e8b('0x3')](_0x3e8b('0x4'))+_0x3e8b('0x5')},'typeName':{'type':Sequelize[_0x3e8b('0x1')],'allowNull':![]},'unitName':{'type':Sequelize[_0x3e8b('0x1')]},'pricelistName':{'type':Sequelize[_0x3e8b('0x3')],'allowNull':![]},'priceListId':{'type':Sequelize['INTEGER'],'allowNull':![]},'netPrice':{'type':Sequelize[_0x3e8b('0x6')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize['DECIMAL'](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize[_0x3e8b('0x6')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x3e8b('0x1')],'allowNull':![]},'note':{'type':Sequelize[_0x3e8b('0x3')]},'subscriptionId':{'type':Sequelize[_0x3e8b('0x2')],'allowNull':![]},'subscriptionName':{'type':Sequelize[_0x3e8b('0x1')],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0x3e8b('0x2')],'allowNull':![]},'quantity':{'type':Sequelize[_0x3e8b('0x6')](0xd,0x4),'allowNull':![]},'ProductQuotationId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/saProformaDetail/saProformaDetail.controller.js b/server/api/saProformaDetail/saProformaDetail.controller.js index d9f624f..ae2ddc8 100644 --- a/server/api/saProformaDetail/saProformaDetail.controller.js +++ b/server/api/saProformaDetail/saProformaDetail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09a5=['jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','limit','set','Content-Range','apply','reject','then','destroy','name','SAProformaDetail','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','type','key','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','update','body','describe','log','addProformaInvoiceDetail->>','companyName','companyId','productCode','productDescription','typeName','pricelistName','priceListId','netPrice','tax','agentFullname','note','subscriptionId','subscriptionName','subscriptionMonthly','quantity','SAProductQuotation','ProformaId','sequelize','SAInvoice','push','WARNING','No\x20product\x20to\x20assign\x20invoice.\x20Invoice\x20not\x20created!!\x20','Duplicate\x20entry.','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x5b3374,_0x161dc0){var _0x1b9f6d=function(_0xc417f7){while(--_0xc417f7){_0x5b3374['push'](_0x5b3374['shift']());}};_0x1b9f6d(++_0x161dc0);}(_0x09a5,0x1c7));var _0x509a=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x09a5[_0x37c22c];return _0x119d79;};'use strict';var pdf=require(_0x509a('0x0'));var emlformat=require(_0x509a('0x1'));var rimraf=require(_0x509a('0x2'));var zipdir=require(_0x509a('0x3'));var jsonpatch=require(_0x509a('0x4'));var rp=require(_0x509a('0x5'));var moment=require(_0x509a('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x509a('0x7'));var path=require(_0x509a('0x8'));var sox=require(_0x509a('0x9'));var csv=require(_0x509a('0xa'));var ejs=require(_0x509a('0xb'));var fs=require('fs');var _=require(_0x509a('0xc'));var squel=require(_0x509a('0xd'));var crypto=require(_0x509a('0xe'));var jsforce=require(_0x509a('0xf'));var deskjs=require(_0x509a('0x10'));var toCsv=require(_0x509a('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x509a('0x11'));var authService=require(_0x509a('0x12'));var qs=require(_0x509a('0x13'));var hardwareService=require(_0x509a('0x14'));var logger=require(_0x509a('0x15'))(_0x509a('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d2b78,_0x187b27){_0x187b27=_0x187b27||0xcc;return function(_0x461a50){if(_0x461a50){return _0x5d2b78[_0x509a('0x17')](_0x187b27);}return _0x5d2b78[_0x509a('0x18')](_0x187b27)[_0x509a('0x19')]();};}function respondWithResult(_0x5b4aa1,_0x5dd990){_0x5dd990=_0x5dd990||0xc8;return function(_0x135857){if(_0x135857){return _0x5b4aa1[_0x509a('0x18')](_0x5dd990)[_0x509a('0x1a')](_0x135857);}};}function respondWithFilteredResult(_0x4c3a8f,_0x4daf23){return function(_0x4efd40){if(_0x4efd40){var _0x4949d8=_0x4efd40['count'],_0x39d362=_0x4daf23['offset'],_0x1d47b6=_0x4daf23['offset']+_0x4daf23[_0x509a('0x1b')],_0x10c050;if(_0x1d47b6>=_0x4949d8){_0x1d47b6=_0x4949d8;_0x10c050=0xc8;}else{_0x10c050=0xce;}_0x4c3a8f['status'](_0x10c050);return _0x4c3a8f[_0x509a('0x1c')](_0x509a('0x1d'),_0x39d362+'-'+_0x1d47b6+'/'+_0x4949d8)[_0x509a('0x1a')](_0x4efd40);}return null;};}function patchUpdates(_0x25263f){return function(_0x100f9b){try{jsonpatch[_0x509a('0x1e')](_0x100f9b,_0x25263f,!![]);}catch(_0x20883f){return BPromise[_0x509a('0x1f')](_0x20883f);}return _0x100f9b['save']();};}function saveUpdates(_0xf8c870,_0x2b32a3){return function(_0x219977){if(_0x219977){return _0x219977['update'](_0xf8c870)[_0x509a('0x20')](function(_0x343e27){return _0x343e27;});}return null;};}function removeEntity(_0x446c28,_0x461ec5){return function(_0x5d9bd3){if(_0x5d9bd3){return _0x5d9bd3[_0x509a('0x21')]()[_0x509a('0x20')](function(){_0x446c28[_0x509a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ffba7,_0x5a6ac3){return function(_0x3f63ee){if(!_0x3f63ee){_0x4ffba7[_0x509a('0x17')](0x194);}return _0x3f63ee;};}function handleError(_0x5baee5,_0x432094){_0x432094=_0x432094||0x1f4;return function(_0x2e2819){logger['error'](_0x2e2819['stack']);if(_0x2e2819[_0x509a('0x22')]){delete _0x2e2819[_0x509a('0x22')];}_0x5baee5['status'](_0x432094)['send'](_0x2e2819);};}exports['index']=function(_0x2306ba,_0x3bcd8e){var _0x71e742={},_0x4c5733={},_0x4fefca={'count':0x0,'rows':[]};var _0x363098=db[_0x509a('0x23')]['rawAttributes'];_0x4c5733['model']=_[_0x509a('0x24')](_0x363098);_0x4c5733[_0x509a('0x25')]=_['keys'](_0x2306ba[_0x509a('0x25')]);_0x4c5733[_0x509a('0x26')]=_[_0x509a('0x27')](_0x4c5733[_0x509a('0x28')],_0x4c5733['query']);_0x71e742[_0x509a('0x29')]=_['intersection'](_0x4c5733[_0x509a('0x28')],qs[_0x509a('0x2a')](_0x2306ba[_0x509a('0x25')][_0x509a('0x2a')]));_0x71e742[_0x509a('0x29')]=_0x71e742[_0x509a('0x29')][_0x509a('0x2b')]?_0x71e742[_0x509a('0x29')]:_0x4c5733[_0x509a('0x28')];if(!_0x2306ba['query'][_0x509a('0x2c')](_0x509a('0x2d'))){_0x71e742[_0x509a('0x1b')]=qs[_0x509a('0x1b')](_0x2306ba[_0x509a('0x25')][_0x509a('0x1b')]);_0x71e742['offset']=qs[_0x509a('0x2e')](_0x2306ba[_0x509a('0x25')]['offset']);}_0x71e742[_0x509a('0x2f')]=qs['sort'](_0x2306ba[_0x509a('0x25')][_0x509a('0x30')]);_0x71e742[_0x509a('0x31')]=qs[_0x509a('0x26')](_[_0x509a('0x32')](_0x2306ba[_0x509a('0x25')],_0x4c5733[_0x509a('0x26')]));if(_0x2306ba[_0x509a('0x25')]['filter']){_0x71e742[_0x509a('0x31')]=_[_0x509a('0x33')](_0x71e742[_0x509a('0x31')],{'$or':_['map'](_0x363098,function(_0x10c067){if(_0x10c067[_0x509a('0x34')][_0x509a('0x35')]!==_0x509a('0x36')){var _0x337be3={};_0x337be3[_0x10c067['field']]={'$like':'%'+_0x2306ba[_0x509a('0x25')]['filter']+'%'};return _0x337be3;}})});}_0x71e742=_['merge']({},_0x71e742,_0x2306ba[_0x509a('0x37')]);var _0x195656={'where':_0x71e742[_0x509a('0x31')]};return db['SAProformaDetail'][_0x509a('0x38')](_0x195656)[_0x509a('0x20')](function(_0x109ae2){_0x4fefca[_0x509a('0x38')]=_0x109ae2;if(_0x2306ba[_0x509a('0x25')][_0x509a('0x39')]){_0x71e742[_0x509a('0x3a')]=[{'all':!![]}];}return db[_0x509a('0x23')][_0x509a('0x3b')](_0x71e742);})['then'](function(_0x4fea03){_0x4fefca[_0x509a('0x3c')]=_0x4fea03;return _0x4fefca;})[_0x509a('0x20')](respondWithFilteredResult(_0x3bcd8e,_0x71e742))[_0x509a('0x3d')](handleError(_0x3bcd8e,null));};exports['show']=function(_0x338d24,_0xfbf8df){var _0x2bc353={'raw':![],'where':{'id':_0x338d24[_0x509a('0x3e')]['id']}},_0xad3ab4={};_0xad3ab4['model']=_['keys'](db[_0x509a('0x23')][_0x509a('0x3f')]);_0xad3ab4[_0x509a('0x25')]=_[_0x509a('0x24')](_0x338d24[_0x509a('0x25')]);_0xad3ab4[_0x509a('0x26')]=_['intersection'](_0xad3ab4[_0x509a('0x28')],_0xad3ab4[_0x509a('0x25')]);_0x2bc353['attributes']=_[_0x509a('0x27')](_0xad3ab4['model'],qs[_0x509a('0x2a')](_0x338d24['query'][_0x509a('0x2a')]));_0x2bc353[_0x509a('0x29')]=_0x2bc353['attributes'][_0x509a('0x2b')]?_0x2bc353[_0x509a('0x29')]:_0xad3ab4[_0x509a('0x28')];if(_0x338d24[_0x509a('0x25')][_0x509a('0x39')]){_0x2bc353[_0x509a('0x3a')]=[{'all':!![]}];}_0x2bc353=_[_0x509a('0x33')]({},_0x2bc353,_0x338d24['options']);return db['SAProformaDetail'][_0x509a('0x40')](_0x2bc353)[_0x509a('0x20')](handleEntityNotFound(_0xfbf8df,null))[_0x509a('0x20')](respondWithResult(_0xfbf8df,null))[_0x509a('0x3d')](handleError(_0xfbf8df,null));};exports['create']=function(_0x89ff29,_0x35d6b6){return db['SAProformaDetail'][_0x509a('0x41')](_0x89ff29['body'],{})[_0x509a('0x20')](respondWithResult(_0x35d6b6,0xc9))[_0x509a('0x3d')](handleError(_0x35d6b6,null));};exports[_0x509a('0x42')]=function(_0x1e846c,_0xc61e00){if(_0x1e846c[_0x509a('0x43')]['id']){delete _0x1e846c[_0x509a('0x43')]['id'];}return db[_0x509a('0x23')]['find']({'where':{'id':_0x1e846c[_0x509a('0x3e')]['id']}})[_0x509a('0x20')](handleEntityNotFound(_0xc61e00,null))[_0x509a('0x20')](saveUpdates(_0x1e846c['body'],null))[_0x509a('0x20')](respondWithResult(_0xc61e00,null))['catch'](handleError(_0xc61e00,null));};exports['destroy']=function(_0x5215d2,_0x430495){return db[_0x509a('0x23')][_0x509a('0x40')]({'where':{'id':_0x5215d2[_0x509a('0x3e')]['id']}})[_0x509a('0x20')](handleEntityNotFound(_0x430495,null))[_0x509a('0x20')](removeEntity(_0x430495,null))['catch'](handleError(_0x430495,null));};exports[_0x509a('0x44')]=function(_0xcac914,_0x1cf07a){return db['SAProformaDetail'][_0x509a('0x44')]()[_0x509a('0x20')](respondWithResult(_0x1cf07a,null))[_0x509a('0x3d')](handleError(_0x1cf07a,null));};function addProformaInvoiceDetail(_0x2d48e5,_0x213c37,_0x1413cf){console[_0x509a('0x45')](_0x509a('0x46'),_0x2d48e5);var _0x3abd82={'companyName':_0x2d48e5[_0x509a('0x47')],'companyId':_0x2d48e5[_0x509a('0x48')],'productName':_0x2d48e5['productName'],'productCode':_0x2d48e5[_0x509a('0x49')],'productDescription':_0x2d48e5[_0x509a('0x4a')],'typeName':_0x2d48e5[_0x509a('0x4b')],'pricelistName':_0x2d48e5[_0x509a('0x4c')],'priceListId':_0x2d48e5[_0x509a('0x4d')],'netPrice':_0x2d48e5[_0x509a('0x4e')],'discount':_0x2d48e5['discount'],'tax':_0x2d48e5[_0x509a('0x4f')],'agentFullname':_0x2d48e5[_0x509a('0x50')],'note':_0x2d48e5[_0x509a('0x51')],'subscriptionId':_0x2d48e5[_0x509a('0x52')],'subscriptionName':_0x2d48e5[_0x509a('0x53')],'subscriptionMonthly':_0x2d48e5[_0x509a('0x54')],'quantity':_0x2d48e5[_0x509a('0x55')],'InvoiceId':_0x213c37};return db['SAInvoiceDetail'][_0x509a('0x41')](_0x3abd82,{'transaction':_0x1413cf})[_0x509a('0x20')](function(){return db[_0x509a('0x56')][_0x509a('0x42')]({'InvoiceId':_0x213c37},{'where':{'ProductPriceListId':_0x2d48e5[_0x509a('0x4d')],'productCode':_0x2d48e5[_0x509a('0x49')],'ProformaId':_0x2d48e5[_0x509a('0x57')]},'transaction':_0x1413cf});});}exports['automaticProformaInvoice']=function(_0x2dc0b2,_0x23e08b,_0xd9fff8){var _0x4170df;if(_0x2dc0b2['body']['id']){delete _0x2dc0b2['body']['id'];}console[_0x509a('0x45')](_0x2dc0b2);return db[_0x509a('0x58')]['transaction'](function(_0x421ca8){return db[_0x509a('0x59')][_0x509a('0x41')](_0x2dc0b2['body'],{'transaction':_0x421ca8,'logging':console[_0x509a('0x45')]})[_0x509a('0x20')](function(_0x3789e5){_0x4170df=_0x3789e5;var _0x476ef1=_0x2dc0b2[_0x509a('0x3e')]['id'];return db['SAProformaDetail'][_0x509a('0x3b')]({'where':{'ProformaId':_0x476ef1},'raw':!![],'logging':console['log']});})[_0x509a('0x20')](function(_0x3362d9){if(_0x3362d9[_0x509a('0x2b')]>0x0){var _0x47b7bd=[];for(var _0x142b49=0x0;_0x142b49<_0x3362d9[_0x509a('0x2b')];_0x142b49++){_0x47b7bd[_0x509a('0x5a')](addProformaInvoiceDetail(_0x3362d9[_0x142b49],_0x4170df['id'],_0x421ca8));}return BPromise['all'](_0x47b7bd);}else{var _0x3fa86c={'errors':[{'type':_0x509a('0x5b'),'message':_0x509a('0x5c')}]};throw _0x3fa86c;}});})[_0x509a('0x20')](function(){return _0x23e08b[_0x509a('0x17')](0xc8);})[_0x509a('0x3d')](function(_0x40b9e8){console[_0x509a('0x45')]('TCL:\x20exports.automaticProformaInvoice\x20->\x20err',_0x40b9e8);if(_0x40b9e8[_0x509a('0x22')]==='SequelizeUniqueConstraintError'){var _0x40b9e8={'errors':[{'message':_0x509a('0x5d')}]};}_0x23e08b['status'](0x1f4)['send'](_0x40b9e8);});}; \ No newline at end of file +var _0xd9bf=['findAll','rows','catch','show','find','create','body','describe','addProformaInvoiceDetail->>','companyName','companyId','productName','productCode','typeName','pricelistName','priceListId','netPrice','discount','tax','agentFullname','note','subscriptionId','subscriptionMonthly','quantity','SAProductQuotation','ProformaId','log','sequelize','SAInvoice','params','length','push','all','WARNING','No\x20product\x20to\x20assign\x20invoice.\x20Invoice\x20not\x20created!!\x20','TCL:\x20exports.automaticProformaInvoice\x20->\x20err','SequelizeUniqueConstraintError','Duplicate\x20entry.','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','set','apply','reject','save','update','then','destroy','error','stack','send','SAProformaDetail','rawAttributes','model','keys','query','filters','intersection','attributes','fields','limit','offset','order','sort','where','pick','merge','map','type','key','field','filter','options','includeAll','include'];(function(_0x25f206,_0x1121bb){var _0xf96267=function(_0x2de085){while(--_0x2de085){_0x25f206['push'](_0x25f206['shift']());}};_0xf96267(++_0x1121bb);}(_0xd9bf,0x1be));var _0xfd9b=function(_0x2bab35,_0x4bdd97){_0x2bab35=_0x2bab35-0x0;var _0xbc231a=_0xd9bf[_0x2bab35];return _0xbc231a;};'use strict';var pdf=require(_0xfd9b('0x0'));var emlformat=require(_0xfd9b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xfd9b('0x2'));var jsonpatch=require(_0xfd9b('0x3'));var rp=require(_0xfd9b('0x4'));var moment=require(_0xfd9b('0x5'));var BPromise=require(_0xfd9b('0x6'));var Mustache=require(_0xfd9b('0x7'));var util=require(_0xfd9b('0x8'));var path=require('path');var sox=require(_0xfd9b('0x9'));var csv=require(_0xfd9b('0xa'));var ejs=require(_0xfd9b('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xfd9b('0xc'));var crypto=require(_0xfd9b('0xd'));var jsforce=require(_0xfd9b('0xe'));var deskjs=require(_0xfd9b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xfd9b('0x10'));var Papa=require(_0xfd9b('0x11'));var Redis=require('ioredis');var authService=require(_0xfd9b('0x12'));var qs=require(_0xfd9b('0x13'));var hardwareService=require(_0xfd9b('0x14'));var logger=require(_0xfd9b('0x15'))('api');var utils=require(_0xfd9b('0x16'));var config=require(_0xfd9b('0x17'));var db=require(_0xfd9b('0x18'))['db'];function respondWithStatusCode(_0x4a7410,_0x37820f){_0x37820f=_0x37820f||0xcc;return function(_0x48c75b){if(_0x48c75b){return _0x4a7410[_0xfd9b('0x19')](_0x37820f);}return _0x4a7410[_0xfd9b('0x1a')](_0x37820f)[_0xfd9b('0x1b')]();};}function respondWithResult(_0x45bfc4,_0x4a6b8b){_0x4a6b8b=_0x4a6b8b||0xc8;return function(_0x41c02b){if(_0x41c02b){return _0x45bfc4['status'](_0x4a6b8b)[_0xfd9b('0x1c')](_0x41c02b);}};}function respondWithFilteredResult(_0x564ed4,_0x51d076){return function(_0xd35dad){if(_0xd35dad){var _0x2875d6=_0xd35dad[_0xfd9b('0x1d')],_0x23ee40=_0x51d076['offset'],_0x1ed871=_0x51d076['offset']+_0x51d076['limit'],_0x41c7fa;if(_0x1ed871>=_0x2875d6){_0x1ed871=_0x2875d6;_0x41c7fa=0xc8;}else{_0x41c7fa=0xce;}_0x564ed4[_0xfd9b('0x1a')](_0x41c7fa);return _0x564ed4[_0xfd9b('0x1e')]('Content-Range',_0x23ee40+'-'+_0x1ed871+'/'+_0x2875d6)[_0xfd9b('0x1c')](_0xd35dad);}return null;};}function patchUpdates(_0x51d948){return function(_0x2dd68f){try{jsonpatch[_0xfd9b('0x1f')](_0x2dd68f,_0x51d948,!![]);}catch(_0x327997){return BPromise[_0xfd9b('0x20')](_0x327997);}return _0x2dd68f[_0xfd9b('0x21')]();};}function saveUpdates(_0x256bbb,_0x29400b){return function(_0x203198){if(_0x203198){return _0x203198[_0xfd9b('0x22')](_0x256bbb)[_0xfd9b('0x23')](function(_0x225cb3){return _0x225cb3;});}return null;};}function removeEntity(_0x3652c3,_0x383128){return function(_0x43f494){if(_0x43f494){return _0x43f494[_0xfd9b('0x24')]()[_0xfd9b('0x23')](function(){_0x3652c3['status'](0xcc)[_0xfd9b('0x1b')]();});}};}function handleEntityNotFound(_0x1c6ed4,_0x438b6a){return function(_0x48c90e){if(!_0x48c90e){_0x1c6ed4['sendStatus'](0x194);}return _0x48c90e;};}function handleError(_0x152d05,_0x476cda){_0x476cda=_0x476cda||0x1f4;return function(_0x3b15af){logger[_0xfd9b('0x25')](_0x3b15af[_0xfd9b('0x26')]);if(_0x3b15af['name']){delete _0x3b15af['name'];}_0x152d05[_0xfd9b('0x1a')](_0x476cda)[_0xfd9b('0x27')](_0x3b15af);};}exports['index']=function(_0x593f24,_0x5b48b2){var _0x1290ec={},_0x25b06a={},_0x10fbf9={'count':0x0,'rows':[]};var _0x3ed433=db[_0xfd9b('0x28')][_0xfd9b('0x29')];_0x25b06a[_0xfd9b('0x2a')]=_[_0xfd9b('0x2b')](_0x3ed433);_0x25b06a[_0xfd9b('0x2c')]=_[_0xfd9b('0x2b')](_0x593f24['query']);_0x25b06a[_0xfd9b('0x2d')]=_[_0xfd9b('0x2e')](_0x25b06a[_0xfd9b('0x2a')],_0x25b06a[_0xfd9b('0x2c')]);_0x1290ec[_0xfd9b('0x2f')]=_['intersection'](_0x25b06a[_0xfd9b('0x2a')],qs[_0xfd9b('0x30')](_0x593f24['query'][_0xfd9b('0x30')]));_0x1290ec[_0xfd9b('0x2f')]=_0x1290ec[_0xfd9b('0x2f')]['length']?_0x1290ec[_0xfd9b('0x2f')]:_0x25b06a[_0xfd9b('0x2a')];if(!_0x593f24[_0xfd9b('0x2c')]['hasOwnProperty']('nolimit')){_0x1290ec[_0xfd9b('0x31')]=qs[_0xfd9b('0x31')](_0x593f24[_0xfd9b('0x2c')][_0xfd9b('0x31')]);_0x1290ec[_0xfd9b('0x32')]=qs['offset'](_0x593f24[_0xfd9b('0x2c')]['offset']);}_0x1290ec[_0xfd9b('0x33')]=qs[_0xfd9b('0x34')](_0x593f24[_0xfd9b('0x2c')][_0xfd9b('0x34')]);_0x1290ec[_0xfd9b('0x35')]=qs[_0xfd9b('0x2d')](_[_0xfd9b('0x36')](_0x593f24['query'],_0x25b06a['filters']));if(_0x593f24[_0xfd9b('0x2c')]['filter']){_0x1290ec[_0xfd9b('0x35')]=_[_0xfd9b('0x37')](_0x1290ec['where'],{'$or':_[_0xfd9b('0x38')](_0x3ed433,function(_0x329ed0){if(_0x329ed0[_0xfd9b('0x39')][_0xfd9b('0x3a')]!=='VIRTUAL'){var _0x5188a3={};_0x5188a3[_0x329ed0[_0xfd9b('0x3b')]]={'$like':'%'+_0x593f24[_0xfd9b('0x2c')][_0xfd9b('0x3c')]+'%'};return _0x5188a3;}})});}_0x1290ec=_[_0xfd9b('0x37')]({},_0x1290ec,_0x593f24[_0xfd9b('0x3d')]);var _0x57b204={'where':_0x1290ec[_0xfd9b('0x35')]};return db['SAProformaDetail'][_0xfd9b('0x1d')](_0x57b204)[_0xfd9b('0x23')](function(_0x5c2c28){_0x10fbf9[_0xfd9b('0x1d')]=_0x5c2c28;if(_0x593f24[_0xfd9b('0x2c')][_0xfd9b('0x3e')]){_0x1290ec[_0xfd9b('0x3f')]=[{'all':!![]}];}return db[_0xfd9b('0x28')][_0xfd9b('0x40')](_0x1290ec);})[_0xfd9b('0x23')](function(_0x134e89){_0x10fbf9[_0xfd9b('0x41')]=_0x134e89;return _0x10fbf9;})[_0xfd9b('0x23')](respondWithFilteredResult(_0x5b48b2,_0x1290ec))[_0xfd9b('0x42')](handleError(_0x5b48b2,null));};exports[_0xfd9b('0x43')]=function(_0x4f3f62,_0x531026){var _0x35b822={'raw':![],'where':{'id':_0x4f3f62['params']['id']}},_0x35c04e={};_0x35c04e['model']=_[_0xfd9b('0x2b')](db['SAProformaDetail'][_0xfd9b('0x29')]);_0x35c04e[_0xfd9b('0x2c')]=_[_0xfd9b('0x2b')](_0x4f3f62['query']);_0x35c04e[_0xfd9b('0x2d')]=_[_0xfd9b('0x2e')](_0x35c04e['model'],_0x35c04e[_0xfd9b('0x2c')]);_0x35b822['attributes']=_[_0xfd9b('0x2e')](_0x35c04e['model'],qs[_0xfd9b('0x30')](_0x4f3f62[_0xfd9b('0x2c')][_0xfd9b('0x30')]));_0x35b822[_0xfd9b('0x2f')]=_0x35b822[_0xfd9b('0x2f')]['length']?_0x35b822[_0xfd9b('0x2f')]:_0x35c04e[_0xfd9b('0x2a')];if(_0x4f3f62[_0xfd9b('0x2c')][_0xfd9b('0x3e')]){_0x35b822[_0xfd9b('0x3f')]=[{'all':!![]}];}_0x35b822=_[_0xfd9b('0x37')]({},_0x35b822,_0x4f3f62[_0xfd9b('0x3d')]);return db[_0xfd9b('0x28')][_0xfd9b('0x44')](_0x35b822)['then'](handleEntityNotFound(_0x531026,null))[_0xfd9b('0x23')](respondWithResult(_0x531026,null))['catch'](handleError(_0x531026,null));};exports[_0xfd9b('0x45')]=function(_0x70fdcd,_0x1fe851){return db[_0xfd9b('0x28')][_0xfd9b('0x45')](_0x70fdcd[_0xfd9b('0x46')],{})[_0xfd9b('0x23')](respondWithResult(_0x1fe851,0xc9))[_0xfd9b('0x42')](handleError(_0x1fe851,null));};exports[_0xfd9b('0x22')]=function(_0x544917,_0x3b0e3d){if(_0x544917[_0xfd9b('0x46')]['id']){delete _0x544917['body']['id'];}return db[_0xfd9b('0x28')][_0xfd9b('0x44')]({'where':{'id':_0x544917['params']['id']}})[_0xfd9b('0x23')](handleEntityNotFound(_0x3b0e3d,null))[_0xfd9b('0x23')](saveUpdates(_0x544917[_0xfd9b('0x46')],null))[_0xfd9b('0x23')](respondWithResult(_0x3b0e3d,null))['catch'](handleError(_0x3b0e3d,null));};exports[_0xfd9b('0x24')]=function(_0x5f1390,_0x4fdf09){return db[_0xfd9b('0x28')][_0xfd9b('0x44')]({'where':{'id':_0x5f1390['params']['id']}})['then'](handleEntityNotFound(_0x4fdf09,null))[_0xfd9b('0x23')](removeEntity(_0x4fdf09,null))[_0xfd9b('0x42')](handleError(_0x4fdf09,null));};exports[_0xfd9b('0x47')]=function(_0x2574e1,_0x24587d){return db['SAProformaDetail'][_0xfd9b('0x47')]()[_0xfd9b('0x23')](respondWithResult(_0x24587d,null))['catch'](handleError(_0x24587d,null));};function addProformaInvoiceDetail(_0x4143bf,_0xf5892f,_0x2374cc){console['log'](_0xfd9b('0x48'),_0x4143bf);var _0x5cde7d={'companyName':_0x4143bf[_0xfd9b('0x49')],'companyId':_0x4143bf[_0xfd9b('0x4a')],'productName':_0x4143bf[_0xfd9b('0x4b')],'productCode':_0x4143bf[_0xfd9b('0x4c')],'productDescription':_0x4143bf['productDescription'],'typeName':_0x4143bf[_0xfd9b('0x4d')],'pricelistName':_0x4143bf[_0xfd9b('0x4e')],'priceListId':_0x4143bf[_0xfd9b('0x4f')],'netPrice':_0x4143bf[_0xfd9b('0x50')],'discount':_0x4143bf[_0xfd9b('0x51')],'tax':_0x4143bf[_0xfd9b('0x52')],'agentFullname':_0x4143bf[_0xfd9b('0x53')],'note':_0x4143bf[_0xfd9b('0x54')],'subscriptionId':_0x4143bf[_0xfd9b('0x55')],'subscriptionName':_0x4143bf['subscriptionName'],'subscriptionMonthly':_0x4143bf[_0xfd9b('0x56')],'quantity':_0x4143bf[_0xfd9b('0x57')],'InvoiceId':_0xf5892f};return db['SAInvoiceDetail'][_0xfd9b('0x45')](_0x5cde7d,{'transaction':_0x2374cc})['then'](function(){return db[_0xfd9b('0x58')][_0xfd9b('0x22')]({'InvoiceId':_0xf5892f},{'where':{'ProductPriceListId':_0x4143bf[_0xfd9b('0x4f')],'productCode':_0x4143bf[_0xfd9b('0x4c')],'ProformaId':_0x4143bf[_0xfd9b('0x59')]},'transaction':_0x2374cc});});}exports['automaticProformaInvoice']=function(_0x3d0016,_0x49afd6,_0x5df999){var _0x42303f;if(_0x3d0016[_0xfd9b('0x46')]['id']){delete _0x3d0016[_0xfd9b('0x46')]['id'];}console[_0xfd9b('0x5a')](_0x3d0016);return db[_0xfd9b('0x5b')]['transaction'](function(_0x59c19e){return db[_0xfd9b('0x5c')]['create'](_0x3d0016['body'],{'transaction':_0x59c19e,'logging':console[_0xfd9b('0x5a')]})[_0xfd9b('0x23')](function(_0x33f1e7){_0x42303f=_0x33f1e7;var _0x270d67=_0x3d0016[_0xfd9b('0x5d')]['id'];return db[_0xfd9b('0x28')][_0xfd9b('0x40')]({'where':{'ProformaId':_0x270d67},'raw':!![],'logging':console[_0xfd9b('0x5a')]});})[_0xfd9b('0x23')](function(_0x4a0f1c){if(_0x4a0f1c[_0xfd9b('0x5e')]>0x0){var _0x38a93c=[];for(var _0x31bde4=0x0;_0x31bde4<_0x4a0f1c[_0xfd9b('0x5e')];_0x31bde4++){_0x38a93c[_0xfd9b('0x5f')](addProformaInvoiceDetail(_0x4a0f1c[_0x31bde4],_0x42303f['id'],_0x59c19e));}return BPromise[_0xfd9b('0x60')](_0x38a93c);}else{var _0x130ece={'errors':[{'type':_0xfd9b('0x61'),'message':_0xfd9b('0x62')}]};throw _0x130ece;}});})['then'](function(){return _0x49afd6[_0xfd9b('0x19')](0xc8);})[_0xfd9b('0x42')](function(_0x59bdad){console[_0xfd9b('0x5a')](_0xfd9b('0x63'),_0x59bdad);if(_0x59bdad['name']===_0xfd9b('0x64')){var _0x59bdad={'errors':[{'message':_0xfd9b('0x65')}]};}_0x49afd6['status'](0x1f4)[_0xfd9b('0x27')](_0x59bdad);});}; \ No newline at end of file diff --git a/server/api/saProformaDetail/saProformaDetail.model.js b/server/api/saProformaDetail/saProformaDetail.model.js index e2d94e7..513d2aa 100644 --- a/server/api/saProformaDetail/saProformaDetail.model.js +++ b/server/api/saProformaDetail/saProformaDetail.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe7fe=['request-promise','path','rimraf','define','SAProformaDetail','lodash','util','../../config/logger','api','bluebird'];(function(_0xf0628a,_0x26e87e){var _0x4ff0e7=function(_0x3a6fb6){while(--_0x3a6fb6){_0xf0628a['push'](_0xf0628a['shift']());}};_0x4ff0e7(++_0x26e87e);}(_0xe7fe,0x19f));var _0xee7f=function(_0x243a2a,_0x35a7a6){_0x243a2a=_0x243a2a-0x0;var _0x38cdec=_0xe7fe[_0x243a2a];return _0x38cdec;};'use strict';var _=require(_0xee7f('0x0'));var util=require(_0xee7f('0x1'));var logger=require(_0xee7f('0x2'))(_0xee7f('0x3'));var moment=require('moment');var BPromise=require(_0xee7f('0x4'));var rp=require(_0xee7f('0x5'));var fs=require('fs');var path=require(_0xee7f('0x6'));var rimraf=require(_0xee7f('0x7'));var config=require('../../config/environment');var attributes=require('./saProformaDetail.attributes');module['exports']=function(_0x4a5186,_0x9a481d){return _0x4a5186[_0xee7f('0x8')](_0xee7f('0x9'),attributes,{'tableName':'sa_proforma_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaca1=['path','../../config/environment','exports','define','SAProformaDetail','util','api','bluebird'];(function(_0x308da3,_0x4e4225){var _0x85100e=function(_0x72e7e8){while(--_0x72e7e8){_0x308da3['push'](_0x308da3['shift']());}};_0x85100e(++_0x4e4225);}(_0xaca1,0x16d));var _0x1aca=function(_0x2bb25a,_0x5a0632){_0x2bb25a=_0x2bb25a-0x0;var _0x41b8c4=_0xaca1[_0x2bb25a];return _0x41b8c4;};'use strict';var _=require('lodash');var util=require(_0x1aca('0x0'));var logger=require('../../config/logger')(_0x1aca('0x1'));var moment=require('moment');var BPromise=require(_0x1aca('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1aca('0x3'));var rimraf=require('rimraf');var config=require(_0x1aca('0x4'));var attributes=require('./saProformaDetail.attributes');module[_0x1aca('0x5')]=function(_0x2fe4c0,_0x30355e){return _0x2fe4c0[_0x1aca('0x6')](_0x1aca('0x7'),attributes,{'tableName':'sa_proforma_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saProformaDetail/saProformaDetail.rpc.js b/server/api/saProformaDetail/saProformaDetail.rpc.js index e4ab73c..2d4f88c 100644 --- a/server/api/saProformaDetail/saProformaDetail.rpc.js +++ b/server/api/saProformaDetail/saProformaDetail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SAProformaDetail,\x20%s,\x20%s','request\x20sent','debug','SAProformaDetail,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5c1230,_0x514881){var _0x487042=function(_0xb6f5f8){while(--_0xb6f5f8){_0x5c1230['push'](_0x5c1230['shift']());}};_0x487042(++_0x514881);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('SAProformaDetail,\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 +var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SAProformaDetail,\x20%s,\x20%s','request\x20sent','debug','SAProformaDetail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x31aa3d,_0x1a38c5){var _0x6583d4=function(_0x5417d1){while(--_0x5417d1){_0x31aa3d['push'](_0x31aa3d['shift']());}};_0x6583d4(++_0x1a38c5);}(_0x34e8,0x12c));var _0x834e=function(_0x2df507,_0x1ec7ec){_0x2df507=_0x2df507-0x0;var _0x5dbe35=_0x34e8[_0x2df507];return _0x5dbe35;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('SAProformaDetail,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('SAProformaDetail,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/saQuotation/index.js b/server/api/saQuotation/index.js index c386678..501a07d 100644 --- a/server/api/saQuotation/index.js +++ b/server/api/saQuotation/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x92f6=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./saQuotation.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','destroy','multer','util','path'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x92f6,0x101));var _0x692f=function(_0x2e9782,_0x93d50e){_0x2e9782=_0x2e9782-0x0;var _0x2615c7=_0x92f6[_0x2e9782];return _0x2615c7;};'use strict';var multer=require(_0x692f('0x0'));var util=require(_0x692f('0x1'));var path=require(_0x692f('0x2'));var timeout=require(_0x692f('0x3'));var express=require(_0x692f('0x4'));var router=express['Router']();var auth=require(_0x692f('0x5'));var interaction=require(_0x692f('0x6'));var config=require(_0x692f('0x7'));var controller=require(_0x692f('0x8'));router[_0x692f('0x9')]('/',auth[_0x692f('0xa')](),controller[_0x692f('0xb')]);router[_0x692f('0x9')](_0x692f('0xc'),auth['isAuthenticated'](),controller[_0x692f('0xd')]);router[_0x692f('0x9')](_0x692f('0xe'),auth[_0x692f('0xa')](),controller[_0x692f('0xf')]);router[_0x692f('0x10')]('/',auth[_0x692f('0xa')](),controller[_0x692f('0x11')]);router[_0x692f('0x10')]('/:id/movequotationassets',auth[_0x692f('0xa')](),controller['moveQuotationAsset']);router['put'](_0x692f('0xe'),auth[_0x692f('0xa')](),controller[_0x692f('0x12')]);router['delete'](_0x692f('0xe'),auth['isAuthenticated'](),controller[_0x692f('0x13')]);module['exports']=router; \ No newline at end of file +var _0x49b7=['show','post','create','moveQuotationAsset','update','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./saQuotation.controller','isAuthenticated','/describe','describe','/:id'];(function(_0x14c8ee,_0x34d4fb){var _0x51acc2=function(_0x4c1277){while(--_0x4c1277){_0x14c8ee['push'](_0x14c8ee['shift']());}};_0x51acc2(++_0x34d4fb);}(_0x49b7,0x137));var _0x749b=function(_0x41c381,_0x1176bd){_0x41c381=_0x41c381-0x0;var _0x427981=_0x49b7[_0x41c381];return _0x427981;};'use strict';var multer=require(_0x749b('0x0'));var util=require(_0x749b('0x1'));var path=require(_0x749b('0x2'));var timeout=require(_0x749b('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x749b('0x4'));var interaction=require(_0x749b('0x5'));var config=require(_0x749b('0x6'));var controller=require(_0x749b('0x7'));router['get']('/',auth[_0x749b('0x8')](),controller['index']);router['get'](_0x749b('0x9'),auth[_0x749b('0x8')](),controller[_0x749b('0xa')]);router['get'](_0x749b('0xb'),auth['isAuthenticated'](),controller[_0x749b('0xc')]);router[_0x749b('0xd')]('/',auth[_0x749b('0x8')](),controller[_0x749b('0xe')]);router[_0x749b('0xd')]('/:id/movequotationassets',auth['isAuthenticated'](),controller[_0x749b('0xf')]);router['put']('/:id',auth[_0x749b('0x8')](),controller[_0x749b('0x10')]);router[_0x749b('0x11')](_0x749b('0xb'),auth['isAuthenticated'](),controller[_0x749b('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/saQuotation/saQuotation.attributes.js b/server/api/saQuotation/saQuotation.attributes.js index de0d103..71df3e0 100644 --- a/server/api/saQuotation/saQuotation.attributes.js +++ b/server/api/saQuotation/saQuotation.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x41c9=['name','TEXT','sequelize','STRING'];(function(_0x3a067a,_0x2947be){var _0x1cafd8=function(_0x153acb){while(--_0x153acb){_0x3a067a['push'](_0x3a067a['shift']());}};_0x1cafd8(++_0x2947be);}(_0x41c9,0x7e));var _0x941c=function(_0x4b21a5,_0x169722){_0x4b21a5=_0x4b21a5-0x0;var _0x24aa82=_0x41c9[_0x4b21a5];return _0x24aa82;};'use strict';var Sequelize=require(_0x941c('0x0'));module['exports']={'name':{'type':Sequelize[_0x941c('0x1')],'unique':_0x941c('0x2')},'note':{'type':Sequelize[_0x941c('0x3')]},'agentFullname':{'type':Sequelize['STRING']},'status':{'type':Sequelize['TEXT']},'companyName':{'type':Sequelize[_0x941c('0x1')]},'companyId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xd0bb=['INTEGER','sequelize','exports','STRING','name','TEXT'];(function(_0x3c80c3,_0x40e427){var _0x5ce977=function(_0x3c355b){while(--_0x3c355b){_0x3c80c3['push'](_0x3c80c3['shift']());}};_0x5ce977(++_0x40e427);}(_0xd0bb,0x1cf));var _0xbd0b=function(_0x20c72d,_0x52fe1c){_0x20c72d=_0x20c72d-0x0;var _0xec7469=_0xd0bb[_0x20c72d];return _0xec7469;};'use strict';var Sequelize=require(_0xbd0b('0x0'));module[_0xbd0b('0x1')]={'name':{'type':Sequelize[_0xbd0b('0x2')],'unique':_0xbd0b('0x3')},'note':{'type':Sequelize[_0xbd0b('0x4')]},'agentFullname':{'type':Sequelize[_0xbd0b('0x2')]},'status':{'type':Sequelize['TEXT']},'companyName':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xbd0b('0x5')]}}; \ No newline at end of file diff --git a/server/api/saQuotation/saQuotation.controller.js b/server/api/saQuotation/saQuotation.controller.js index 92c8ff1..5b70e1f 100644 --- a/server/api/saQuotation/saQuotation.controller.js +++ b/server/api/saQuotation/saQuotation.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9676=['subscriptionName','subscriptionMonthly','companyId','push','bulkCreate','SAProductQuotation','moveQuotationAsset','clone','all','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','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','map','type','key','field','options','includeAll','include','SAQuotation','findAll','rows','catch','show','find','create','body','params','describe','TCL:\x20manageProductQuotationIntoAsset\x20->\x20productQuotation','subscriptionId','ProductPriceListId','productCode','log','TCL:\x20manageProductQuotationIntoAsset\x20->\x20productsAsset','TCL:\x20manageProductQuotationIntoAsset\x20->\x20listproduct','dateNextInvoice','SAAsset','abs','quantity','value','WARNING','There\x20are\x20not\x20enough\x20products\x20to\x20cancel.','companyName','productName','productTax','productDescription','typeName','pricelistName','netPrice','agentFullname','tax'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x9676,0xe3));var _0x6967=function(_0x397f34,_0x3ac328){_0x397f34=_0x397f34-0x0;var _0x272cda=_0x9676[_0x397f34];return _0x272cda;};'use strict';var pdf=require(_0x6967('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6967('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6967('0x2'));var rp=require(_0x6967('0x3'));var moment=require(_0x6967('0x4'));var BPromise=require(_0x6967('0x5'));var Mustache=require(_0x6967('0x6'));var util=require(_0x6967('0x7'));var path=require(_0x6967('0x8'));var sox=require(_0x6967('0x9'));var csv=require(_0x6967('0xa'));var ejs=require(_0x6967('0xb'));var fs=require('fs');var _=require(_0x6967('0xc'));var squel=require(_0x6967('0xd'));var crypto=require(_0x6967('0xe'));var jsforce=require(_0x6967('0xf'));var deskjs=require(_0x6967('0x10'));var toCsv=require(_0x6967('0xa'));var querystring=require(_0x6967('0x11'));var Papa=require(_0x6967('0x12'));var Redis=require(_0x6967('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x6967('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6967('0x15'))(_0x6967('0x16'));var utils=require(_0x6967('0x17'));var config=require(_0x6967('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35a750,_0x3ba36c){_0x3ba36c=_0x3ba36c||0xcc;return function(_0x4cdfbe){if(_0x4cdfbe){return _0x35a750['sendStatus'](_0x3ba36c);}return _0x35a750[_0x6967('0x19')](_0x3ba36c)[_0x6967('0x1a')]();};}function respondWithResult(_0x2657cb,_0x2e5ed1){_0x2e5ed1=_0x2e5ed1||0xc8;return function(_0x4ae0f1){if(_0x4ae0f1){return _0x2657cb[_0x6967('0x19')](_0x2e5ed1)['json'](_0x4ae0f1);}};}function respondWithFilteredResult(_0x516dff,_0x54035b){return function(_0x5b335b){if(_0x5b335b){var _0x5eecc1=_0x5b335b[_0x6967('0x1b')],_0x273a20=_0x54035b[_0x6967('0x1c')],_0x40adad=_0x54035b[_0x6967('0x1c')]+_0x54035b[_0x6967('0x1d')],_0x46063c;if(_0x40adad>=_0x5eecc1){_0x40adad=_0x5eecc1;_0x46063c=0xc8;}else{_0x46063c=0xce;}_0x516dff['status'](_0x46063c);return _0x516dff[_0x6967('0x1e')](_0x6967('0x1f'),_0x273a20+'-'+_0x40adad+'/'+_0x5eecc1)[_0x6967('0x20')](_0x5b335b);}return null;};}function patchUpdates(_0x79c959){return function(_0x26d26a){try{jsonpatch['apply'](_0x26d26a,_0x79c959,!![]);}catch(_0x280cfc){return BPromise[_0x6967('0x21')](_0x280cfc);}return _0x26d26a[_0x6967('0x22')]();};}function saveUpdates(_0x5a4b96,_0x594a28){return function(_0x41fa47){if(_0x41fa47){return _0x41fa47[_0x6967('0x23')](_0x5a4b96)[_0x6967('0x24')](function(_0x724bc2){return _0x724bc2;});}return null;};}function removeEntity(_0x137e58,_0xd852bc){return function(_0x2a98d5){if(_0x2a98d5){return _0x2a98d5[_0x6967('0x25')]()[_0x6967('0x24')](function(){_0x137e58[_0x6967('0x19')](0xcc)[_0x6967('0x1a')]();});}};}function handleEntityNotFound(_0x2fa922,_0x79298f){return function(_0x5ce41f){if(!_0x5ce41f){_0x2fa922[_0x6967('0x26')](0x194);}return _0x5ce41f;};}function handleError(_0xec765b,_0x40b901){_0x40b901=_0x40b901||0x1f4;return function(_0x368e9b){logger[_0x6967('0x27')](_0x368e9b[_0x6967('0x28')]);if(_0x368e9b[_0x6967('0x29')]){delete _0x368e9b['name'];}_0xec765b[_0x6967('0x19')](_0x40b901)[_0x6967('0x2a')](_0x368e9b);};}exports[_0x6967('0x2b')]=function(_0x5e6683,_0x2e3a28){var _0x6a951b={},_0x47b4d3={},_0x595eba={'count':0x0,'rows':[]};var _0x2f3bbb=db['SAQuotation'][_0x6967('0x2c')];_0x47b4d3[_0x6967('0x2d')]=_['keys'](_0x2f3bbb);_0x47b4d3[_0x6967('0x2e')]=_[_0x6967('0x2f')](_0x5e6683[_0x6967('0x2e')]);_0x47b4d3[_0x6967('0x30')]=_[_0x6967('0x31')](_0x47b4d3[_0x6967('0x2d')],_0x47b4d3[_0x6967('0x2e')]);_0x6a951b[_0x6967('0x32')]=_[_0x6967('0x31')](_0x47b4d3[_0x6967('0x2d')],qs[_0x6967('0x33')](_0x5e6683[_0x6967('0x2e')][_0x6967('0x33')]));_0x6a951b[_0x6967('0x32')]=_0x6a951b['attributes'][_0x6967('0x34')]?_0x6a951b['attributes']:_0x47b4d3[_0x6967('0x2d')];if(!_0x5e6683[_0x6967('0x2e')][_0x6967('0x35')](_0x6967('0x36'))){_0x6a951b[_0x6967('0x1d')]=qs[_0x6967('0x1d')](_0x5e6683[_0x6967('0x2e')][_0x6967('0x1d')]);_0x6a951b[_0x6967('0x1c')]=qs['offset'](_0x5e6683[_0x6967('0x2e')][_0x6967('0x1c')]);}_0x6a951b[_0x6967('0x37')]=qs[_0x6967('0x38')](_0x5e6683[_0x6967('0x2e')]['sort']);_0x6a951b['where']=qs['filters'](_[_0x6967('0x39')](_0x5e6683['query'],_0x47b4d3[_0x6967('0x30')]));if(_0x5e6683['query']['filter']){_0x6a951b[_0x6967('0x3a')]=_[_0x6967('0x3b')](_0x6a951b[_0x6967('0x3a')],{'$or':_[_0x6967('0x3c')](_0x2f3bbb,function(_0x433ba4){if(_0x433ba4[_0x6967('0x3d')][_0x6967('0x3e')]!=='VIRTUAL'){var _0x481fd3={};_0x481fd3[_0x433ba4[_0x6967('0x3f')]]={'$like':'%'+_0x5e6683[_0x6967('0x2e')]['filter']+'%'};return _0x481fd3;}})});}_0x6a951b=_[_0x6967('0x3b')]({},_0x6a951b,_0x5e6683[_0x6967('0x40')]);var _0x3fab68={'where':_0x6a951b[_0x6967('0x3a')]};return db['SAQuotation'][_0x6967('0x1b')](_0x3fab68)['then'](function(_0x48d512){_0x595eba['count']=_0x48d512;if(_0x5e6683[_0x6967('0x2e')][_0x6967('0x41')]){_0x6a951b[_0x6967('0x42')]=[{'all':!![]}];}return db[_0x6967('0x43')][_0x6967('0x44')](_0x6a951b);})[_0x6967('0x24')](function(_0x240567){_0x595eba[_0x6967('0x45')]=_0x240567;return _0x595eba;})[_0x6967('0x24')](respondWithFilteredResult(_0x2e3a28,_0x6a951b))[_0x6967('0x46')](handleError(_0x2e3a28,null));};exports[_0x6967('0x47')]=function(_0x5eb5a7,_0x156507){var _0x539eed={'raw':![],'where':{'id':_0x5eb5a7['params']['id']}},_0x17150a={};_0x17150a[_0x6967('0x2d')]=_[_0x6967('0x2f')](db[_0x6967('0x43')][_0x6967('0x2c')]);_0x17150a[_0x6967('0x2e')]=_[_0x6967('0x2f')](_0x5eb5a7[_0x6967('0x2e')]);_0x17150a[_0x6967('0x30')]=_[_0x6967('0x31')](_0x17150a[_0x6967('0x2d')],_0x17150a[_0x6967('0x2e')]);_0x539eed['attributes']=_[_0x6967('0x31')](_0x17150a[_0x6967('0x2d')],qs['fields'](_0x5eb5a7[_0x6967('0x2e')]['fields']));_0x539eed['attributes']=_0x539eed[_0x6967('0x32')][_0x6967('0x34')]?_0x539eed[_0x6967('0x32')]:_0x17150a['model'];if(_0x5eb5a7[_0x6967('0x2e')][_0x6967('0x41')]){_0x539eed['include']=[{'all':!![]}];}_0x539eed=_[_0x6967('0x3b')]({},_0x539eed,_0x5eb5a7[_0x6967('0x40')]);return db[_0x6967('0x43')][_0x6967('0x48')](_0x539eed)[_0x6967('0x24')](handleEntityNotFound(_0x156507,null))[_0x6967('0x24')](respondWithResult(_0x156507,null))[_0x6967('0x46')](handleError(_0x156507,null));};exports[_0x6967('0x49')]=function(_0x38a801,_0x2d1672){return db[_0x6967('0x43')]['create'](_0x38a801[_0x6967('0x4a')],{})[_0x6967('0x24')](respondWithResult(_0x2d1672,0xc9))[_0x6967('0x46')](handleError(_0x2d1672,null));};exports[_0x6967('0x23')]=function(_0x2112a1,_0x5ea75d){if(_0x2112a1[_0x6967('0x4a')]['id']){delete _0x2112a1['body']['id'];}return db[_0x6967('0x43')][_0x6967('0x48')]({'where':{'id':_0x2112a1['params']['id']}})[_0x6967('0x24')](handleEntityNotFound(_0x5ea75d,null))[_0x6967('0x24')](saveUpdates(_0x2112a1['body'],null))['then'](respondWithResult(_0x5ea75d,null))['catch'](handleError(_0x5ea75d,null));};exports[_0x6967('0x25')]=function(_0x30e947,_0xc10ce9){return db[_0x6967('0x43')][_0x6967('0x48')]({'where':{'id':_0x30e947[_0x6967('0x4b')]['id']}})[_0x6967('0x24')](handleEntityNotFound(_0xc10ce9,null))[_0x6967('0x24')](removeEntity(_0xc10ce9,null))['catch'](handleError(_0xc10ce9,null));};exports[_0x6967('0x4c')]=function(_0x593950,_0x482ef8){return db[_0x6967('0x43')][_0x6967('0x4c')]()[_0x6967('0x24')](respondWithResult(_0x482ef8,null))[_0x6967('0x46')](handleError(_0x482ef8,null));};function manageProductQuotationIntoAsset(_0x2ac671,_0x4f6f58){console['log'](_0x6967('0x4d'),_0x2ac671);var _0x5a71f6=_0x2ac671['companyId'];var _0x52c815=[];return db['SAAsset'][_0x6967('0x44')]({'where':{'companyId':_0x5a71f6,'SubscriptionId':_0x2ac671[_0x6967('0x4e')],'pricelistId':_0x2ac671[_0x6967('0x4f')],'productCode':_0x2ac671[_0x6967('0x50')],'deleted':{'$or':[0x0,null]}},'raw':!![]})['then'](function(_0x4b5ec2){console[_0x6967('0x51')](_0x6967('0x52'),_0x4b5ec2);_0x52c815=_0x4b5ec2;console[_0x6967('0x51')](_0x6967('0x53'),_0x52c815);if(_0x52c815&&_0x52c815[_0x6967('0x34')]>0x0){var _0x21b957=_0x52c815[0x0][_0x6967('0x54')];var _0x1a3d85=_0x52c815['length'];return[_0x21b957,_0x1a3d85];}else{return db[_0x6967('0x55')]['findOne']({'where':{'companyId':_0x5a71f6,'SubscriptionId':_0x2ac671['subscriptionId'],'pricelistId':_0x2ac671[_0x6967('0x4f')]},'raw':!![]})[_0x6967('0x24')](function(_0x374195){var _0x23b189=new Date();if(_0x374195){_0x23b189=_0x374195[_0x6967('0x54')];}return[_0x23b189,0x0];});}})['spread'](function(_0x518264,_0x2453eb){var _0x1a7834=Math[_0x6967('0x56')](_0x2ac671[_0x6967('0x57')]);if(_0x2ac671[_0x6967('0x57')]<0x0&&_0x1a7834<=_0x2453eb){var _0x2c1398=_(_0x52c815)['slice'](0x0,_0x1a7834)[_0x6967('0x3c')]('id')[_0x6967('0x58')]();return db['SAAsset'][_0x6967('0x23')]({'deleted':0x1},{'where':{'id':_0x2c1398}});}if(_0x2ac671['quantity']<0x0&&Math[_0x6967('0x56')](_0x2ac671[_0x6967('0x57')])>_0x2453eb){var _0x12df34={'errors':[{'type':_0x6967('0x59'),'message':_0x6967('0x5a')}]};throw _0x12df34;}if(_0x2ac671['quantity']>0x0){var _0x41236f=new Array();for(var _0x197924=0x0;_0x197924<_0x2ac671[_0x6967('0x57')];_0x197924++){var _0x1a543f={'companyName':_0x2ac671[_0x6967('0x5b')],'companyId':_0x2ac671['companyId'],'productName':_0x2ac671[_0x6967('0x5c')],'productCode':_0x2ac671['productCode'],'productTax':_0x2ac671[_0x6967('0x5d')],'productDescription':_0x2ac671[_0x6967('0x5e')],'typeName':_0x2ac671[_0x6967('0x5f')],'pricelistName':_0x2ac671[_0x6967('0x60')],'pricelistId':_0x2ac671[_0x6967('0x4f')],'netPrice':_0x2ac671[_0x6967('0x61')],'discount':_0x2ac671['discount'],'agentFullname':_0x2ac671[_0x6967('0x62')],'note':_0x2ac671['note'],'tax':_0x2ac671[_0x6967('0x63')],'subscriptionId':_0x2ac671[_0x6967('0x4e')],'subscriptionName':_0x2ac671[_0x6967('0x64')],'subscriptionMonthly':_0x2ac671[_0x6967('0x65')]};_0x1a543f[_0x6967('0x54')]=_0x518264;_0x1a543f[_0x6967('0x66')]=_0x5a71f6;_0x41236f[_0x6967('0x67')](_0x1a543f);}return db['SAAsset'][_0x6967('0x68')](_0x41236f,{'transaction':_0x4f6f58})[_0x6967('0x24')](function(){return db[_0x6967('0x69')]['update']({'productAsset':0x1},{'where':{'id':_0x2ac671['id']},'transaction':_0x4f6f58});});}});}exports[_0x6967('0x6a')]=function(_0x30b4a1,_0x306162,_0x17d98f){var _0x477150=_0x30b4a1['params']['id'];return db[_0x6967('0x69')][_0x6967('0x44')]({'where':{'QuotationId':_0x477150,'productAsset':null},'raw':!![],'logging':console[_0x6967('0x51')]})[_0x6967('0x24')](function(_0x35cb53){if(_0x35cb53[_0x6967('0x34')]>0x0){return db['sequelize']['transaction'](function(_0x4cb709){var _0x2c040c=new Array();for(var _0x89ab41=0x0;_0x89ab41<_0x35cb53[_0x6967('0x34')];_0x89ab41++){var _0x46de50=_[_0x6967('0x6b')](_0x35cb53[_0x89ab41]);_0x2c040c[_0x6967('0x67')](manageProductQuotationIntoAsset(_0x46de50,_0x4cb709));}return BPromise[_0x6967('0x6c')](_0x2c040c);});}else{var _0x5a0c6a={'errors':[{'type':'WARNING','message':'No\x20product\x20to\x20move.'}]};throw _0x5a0c6a;}})['then'](handleEntityNotFound(_0x306162,null))[_0x6967('0x24')](respondWithStatusCode(_0x306162,0xc8))[_0x6967('0x46')](handleError(_0x306162,null));}; \ No newline at end of file +var _0x2f27=['SAAsset','findOne','ProductPriceListId','spread','abs','quantity','value','WARNING','companyName','productName','productTax','productDescription','typeName','pricelistName','netPrice','discount','note','tax','subscriptionName','push','bulkCreate','SAProductQuotation','moveQuotationAsset','sequelize','transaction','clone','No\x20product\x20to\x20move.','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','SAQuotation','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','sort','where','pick','filter','map','key','field','merge','includeAll','include','rows','catch','params','options','find','create','body','describe','log','TCL:\x20manageProductQuotationIntoAsset\x20->\x20productQuotation','companyId','findAll','subscriptionId','productCode','TCL:\x20manageProductQuotationIntoAsset\x20->\x20productsAsset','TCL:\x20manageProductQuotationIntoAsset\x20->\x20listproduct','dateNextInvoice'];(function(_0x3299d1,_0x545733){var _0x44356e=function(_0x52fd77){while(--_0x52fd77){_0x3299d1['push'](_0x3299d1['shift']());}};_0x44356e(++_0x545733);}(_0x2f27,0x1ab));var _0x72f2=function(_0x4f9bf7,_0x5b0078){_0x4f9bf7=_0x4f9bf7-0x0;var _0x5e664a=_0x2f27[_0x4f9bf7];return _0x5e664a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x72f2('0x0'));var rimraf=require(_0x72f2('0x1'));var zipdir=require(_0x72f2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x72f2('0x3'));var moment=require(_0x72f2('0x4'));var BPromise=require(_0x72f2('0x5'));var Mustache=require('mustache');var util=require(_0x72f2('0x6'));var path=require('path');var sox=require(_0x72f2('0x7'));var csv=require(_0x72f2('0x8'));var ejs=require(_0x72f2('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x72f2('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x72f2('0x8'));var querystring=require('querystring');var Papa=require(_0x72f2('0xb'));var Redis=require(_0x72f2('0xc'));var authService=require(_0x72f2('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x72f2('0xe'));var logger=require(_0x72f2('0xf'))(_0x72f2('0x10'));var utils=require(_0x72f2('0x11'));var config=require('../../config/environment');var db=require(_0x72f2('0x12'))['db'];function respondWithStatusCode(_0x2f093e,_0x5093ee){_0x5093ee=_0x5093ee||0xcc;return function(_0x3ef4b4){if(_0x3ef4b4){return _0x2f093e[_0x72f2('0x13')](_0x5093ee);}return _0x2f093e[_0x72f2('0x14')](_0x5093ee)[_0x72f2('0x15')]();};}function respondWithResult(_0x493cee,_0x441070){_0x441070=_0x441070||0xc8;return function(_0x433a9a){if(_0x433a9a){return _0x493cee[_0x72f2('0x14')](_0x441070)[_0x72f2('0x16')](_0x433a9a);}};}function respondWithFilteredResult(_0xf7632a,_0x3d11ba){return function(_0xc576b1){if(_0xc576b1){var _0x49c137=_0xc576b1[_0x72f2('0x17')],_0x2ab88c=_0x3d11ba[_0x72f2('0x18')],_0x2be9c5=_0x3d11ba[_0x72f2('0x18')]+_0x3d11ba[_0x72f2('0x19')],_0x14ff06;if(_0x2be9c5>=_0x49c137){_0x2be9c5=_0x49c137;_0x14ff06=0xc8;}else{_0x14ff06=0xce;}_0xf7632a['status'](_0x14ff06);return _0xf7632a[_0x72f2('0x1a')](_0x72f2('0x1b'),_0x2ab88c+'-'+_0x2be9c5+'/'+_0x49c137)['json'](_0xc576b1);}return null;};}function patchUpdates(_0x4fd054){return function(_0x124bc8){try{jsonpatch['apply'](_0x124bc8,_0x4fd054,!![]);}catch(_0x38c56b){return BPromise[_0x72f2('0x1c')](_0x38c56b);}return _0x124bc8[_0x72f2('0x1d')]();};}function saveUpdates(_0x1ede85,_0x43ccc7){return function(_0x14fb4b){if(_0x14fb4b){return _0x14fb4b[_0x72f2('0x1e')](_0x1ede85)[_0x72f2('0x1f')](function(_0xb63491){return _0xb63491;});}return null;};}function removeEntity(_0x20c7d1,_0x1a6e29){return function(_0x16e021){if(_0x16e021){return _0x16e021[_0x72f2('0x20')]()[_0x72f2('0x1f')](function(){_0x20c7d1[_0x72f2('0x14')](0xcc)[_0x72f2('0x15')]();});}};}function handleEntityNotFound(_0x379725,_0xa88ad5){return function(_0x4f55cc){if(!_0x4f55cc){_0x379725[_0x72f2('0x13')](0x194);}return _0x4f55cc;};}function handleError(_0x359c3c,_0x294abb){_0x294abb=_0x294abb||0x1f4;return function(_0x33dd94){logger['error'](_0x33dd94[_0x72f2('0x21')]);if(_0x33dd94[_0x72f2('0x22')]){delete _0x33dd94[_0x72f2('0x22')];}_0x359c3c['status'](_0x294abb)[_0x72f2('0x23')](_0x33dd94);};}exports['index']=function(_0x1080ff,_0x13289a){var _0x56179f={},_0xd35463={},_0x3a3186={'count':0x0,'rows':[]};var _0x4bfae4=db[_0x72f2('0x24')][_0x72f2('0x25')];_0xd35463[_0x72f2('0x26')]=_['keys'](_0x4bfae4);_0xd35463['query']=_[_0x72f2('0x27')](_0x1080ff['query']);_0xd35463[_0x72f2('0x28')]=_[_0x72f2('0x29')](_0xd35463[_0x72f2('0x26')],_0xd35463[_0x72f2('0x2a')]);_0x56179f[_0x72f2('0x2b')]=_[_0x72f2('0x29')](_0xd35463[_0x72f2('0x26')],qs[_0x72f2('0x2c')](_0x1080ff['query'][_0x72f2('0x2c')]));_0x56179f[_0x72f2('0x2b')]=_0x56179f[_0x72f2('0x2b')][_0x72f2('0x2d')]?_0x56179f[_0x72f2('0x2b')]:_0xd35463[_0x72f2('0x26')];if(!_0x1080ff[_0x72f2('0x2a')]['hasOwnProperty']('nolimit')){_0x56179f[_0x72f2('0x19')]=qs[_0x72f2('0x19')](_0x1080ff['query'][_0x72f2('0x19')]);_0x56179f[_0x72f2('0x18')]=qs[_0x72f2('0x18')](_0x1080ff[_0x72f2('0x2a')][_0x72f2('0x18')]);}_0x56179f['order']=qs[_0x72f2('0x2e')](_0x1080ff[_0x72f2('0x2a')][_0x72f2('0x2e')]);_0x56179f[_0x72f2('0x2f')]=qs[_0x72f2('0x28')](_[_0x72f2('0x30')](_0x1080ff[_0x72f2('0x2a')],_0xd35463[_0x72f2('0x28')]));if(_0x1080ff['query'][_0x72f2('0x31')]){_0x56179f['where']=_['merge'](_0x56179f[_0x72f2('0x2f')],{'$or':_[_0x72f2('0x32')](_0x4bfae4,function(_0x2341c0){if(_0x2341c0['type'][_0x72f2('0x33')]!=='VIRTUAL'){var _0x4c23d3={};_0x4c23d3[_0x2341c0[_0x72f2('0x34')]]={'$like':'%'+_0x1080ff['query'][_0x72f2('0x31')]+'%'};return _0x4c23d3;}})});}_0x56179f=_[_0x72f2('0x35')]({},_0x56179f,_0x1080ff['options']);var _0x403fee={'where':_0x56179f[_0x72f2('0x2f')]};return db[_0x72f2('0x24')][_0x72f2('0x17')](_0x403fee)[_0x72f2('0x1f')](function(_0x1c08c1){_0x3a3186[_0x72f2('0x17')]=_0x1c08c1;if(_0x1080ff[_0x72f2('0x2a')][_0x72f2('0x36')]){_0x56179f[_0x72f2('0x37')]=[{'all':!![]}];}return db[_0x72f2('0x24')]['findAll'](_0x56179f);})[_0x72f2('0x1f')](function(_0x44d858){_0x3a3186[_0x72f2('0x38')]=_0x44d858;return _0x3a3186;})['then'](respondWithFilteredResult(_0x13289a,_0x56179f))[_0x72f2('0x39')](handleError(_0x13289a,null));};exports['show']=function(_0x30baed,_0x1c5b40){var _0x4c197c={'raw':![],'where':{'id':_0x30baed[_0x72f2('0x3a')]['id']}},_0x92ca08={};_0x92ca08[_0x72f2('0x26')]=_[_0x72f2('0x27')](db[_0x72f2('0x24')][_0x72f2('0x25')]);_0x92ca08[_0x72f2('0x2a')]=_[_0x72f2('0x27')](_0x30baed[_0x72f2('0x2a')]);_0x92ca08[_0x72f2('0x28')]=_[_0x72f2('0x29')](_0x92ca08[_0x72f2('0x26')],_0x92ca08[_0x72f2('0x2a')]);_0x4c197c['attributes']=_[_0x72f2('0x29')](_0x92ca08[_0x72f2('0x26')],qs[_0x72f2('0x2c')](_0x30baed['query']['fields']));_0x4c197c[_0x72f2('0x2b')]=_0x4c197c[_0x72f2('0x2b')]['length']?_0x4c197c['attributes']:_0x92ca08['model'];if(_0x30baed[_0x72f2('0x2a')][_0x72f2('0x36')]){_0x4c197c[_0x72f2('0x37')]=[{'all':!![]}];}_0x4c197c=_[_0x72f2('0x35')]({},_0x4c197c,_0x30baed[_0x72f2('0x3b')]);return db[_0x72f2('0x24')][_0x72f2('0x3c')](_0x4c197c)[_0x72f2('0x1f')](handleEntityNotFound(_0x1c5b40,null))[_0x72f2('0x1f')](respondWithResult(_0x1c5b40,null))[_0x72f2('0x39')](handleError(_0x1c5b40,null));};exports[_0x72f2('0x3d')]=function(_0x3bc054,_0x4a1f97){return db[_0x72f2('0x24')][_0x72f2('0x3d')](_0x3bc054[_0x72f2('0x3e')],{})[_0x72f2('0x1f')](respondWithResult(_0x4a1f97,0xc9))['catch'](handleError(_0x4a1f97,null));};exports[_0x72f2('0x1e')]=function(_0x48cc76,_0x103caf){if(_0x48cc76['body']['id']){delete _0x48cc76[_0x72f2('0x3e')]['id'];}return db[_0x72f2('0x24')][_0x72f2('0x3c')]({'where':{'id':_0x48cc76[_0x72f2('0x3a')]['id']}})[_0x72f2('0x1f')](handleEntityNotFound(_0x103caf,null))[_0x72f2('0x1f')](saveUpdates(_0x48cc76[_0x72f2('0x3e')],null))[_0x72f2('0x1f')](respondWithResult(_0x103caf,null))[_0x72f2('0x39')](handleError(_0x103caf,null));};exports[_0x72f2('0x20')]=function(_0x65939,_0x1c72d1){return db[_0x72f2('0x24')]['find']({'where':{'id':_0x65939[_0x72f2('0x3a')]['id']}})[_0x72f2('0x1f')](handleEntityNotFound(_0x1c72d1,null))['then'](removeEntity(_0x1c72d1,null))[_0x72f2('0x39')](handleError(_0x1c72d1,null));};exports[_0x72f2('0x3f')]=function(_0x23fed6,_0x37f120){return db[_0x72f2('0x24')]['describe']()[_0x72f2('0x1f')](respondWithResult(_0x37f120,null))[_0x72f2('0x39')](handleError(_0x37f120,null));};function manageProductQuotationIntoAsset(_0xf5d32a,_0x297f65){console[_0x72f2('0x40')](_0x72f2('0x41'),_0xf5d32a);var _0x264d06=_0xf5d32a[_0x72f2('0x42')];var _0x184383=[];return db['SAAsset'][_0x72f2('0x43')]({'where':{'companyId':_0x264d06,'SubscriptionId':_0xf5d32a[_0x72f2('0x44')],'pricelistId':_0xf5d32a['ProductPriceListId'],'productCode':_0xf5d32a[_0x72f2('0x45')],'deleted':{'$or':[0x0,null]}},'raw':!![]})[_0x72f2('0x1f')](function(_0x108312){console['log'](_0x72f2('0x46'),_0x108312);_0x184383=_0x108312;console[_0x72f2('0x40')](_0x72f2('0x47'),_0x184383);if(_0x184383&&_0x184383[_0x72f2('0x2d')]>0x0){var _0x439418=_0x184383[0x0][_0x72f2('0x48')];var _0x42cce9=_0x184383[_0x72f2('0x2d')];return[_0x439418,_0x42cce9];}else{return db[_0x72f2('0x49')][_0x72f2('0x4a')]({'where':{'companyId':_0x264d06,'SubscriptionId':_0xf5d32a['subscriptionId'],'pricelistId':_0xf5d32a[_0x72f2('0x4b')]},'raw':!![]})[_0x72f2('0x1f')](function(_0x476729){var _0x5154eb=new Date();if(_0x476729){_0x5154eb=_0x476729[_0x72f2('0x48')];}return[_0x5154eb,0x0];});}})[_0x72f2('0x4c')](function(_0xfa61fc,_0x20c65d){var _0x50318b=Math[_0x72f2('0x4d')](_0xf5d32a['quantity']);if(_0xf5d32a[_0x72f2('0x4e')]<0x0&&_0x50318b<=_0x20c65d){var _0x206e3d=_(_0x184383)['slice'](0x0,_0x50318b)[_0x72f2('0x32')]('id')[_0x72f2('0x4f')]();return db[_0x72f2('0x49')][_0x72f2('0x1e')]({'deleted':0x1},{'where':{'id':_0x206e3d}});}if(_0xf5d32a[_0x72f2('0x4e')]<0x0&&Math[_0x72f2('0x4d')](_0xf5d32a[_0x72f2('0x4e')])>_0x20c65d){var _0x57f527={'errors':[{'type':_0x72f2('0x50'),'message':'There\x20are\x20not\x20enough\x20products\x20to\x20cancel.'}]};throw _0x57f527;}if(_0xf5d32a['quantity']>0x0){var _0xd81b2e=new Array();for(var _0x290fa4=0x0;_0x290fa4<_0xf5d32a['quantity'];_0x290fa4++){var _0x178472={'companyName':_0xf5d32a[_0x72f2('0x51')],'companyId':_0xf5d32a['companyId'],'productName':_0xf5d32a[_0x72f2('0x52')],'productCode':_0xf5d32a[_0x72f2('0x45')],'productTax':_0xf5d32a[_0x72f2('0x53')],'productDescription':_0xf5d32a[_0x72f2('0x54')],'typeName':_0xf5d32a[_0x72f2('0x55')],'pricelistName':_0xf5d32a[_0x72f2('0x56')],'pricelistId':_0xf5d32a[_0x72f2('0x4b')],'netPrice':_0xf5d32a[_0x72f2('0x57')],'discount':_0xf5d32a[_0x72f2('0x58')],'agentFullname':_0xf5d32a['agentFullname'],'note':_0xf5d32a[_0x72f2('0x59')],'tax':_0xf5d32a[_0x72f2('0x5a')],'subscriptionId':_0xf5d32a[_0x72f2('0x44')],'subscriptionName':_0xf5d32a[_0x72f2('0x5b')],'subscriptionMonthly':_0xf5d32a['subscriptionMonthly']};_0x178472[_0x72f2('0x48')]=_0xfa61fc;_0x178472['companyId']=_0x264d06;_0xd81b2e[_0x72f2('0x5c')](_0x178472);}return db['SAAsset'][_0x72f2('0x5d')](_0xd81b2e,{'transaction':_0x297f65})['then'](function(){return db[_0x72f2('0x5e')][_0x72f2('0x1e')]({'productAsset':0x1},{'where':{'id':_0xf5d32a['id']},'transaction':_0x297f65});});}});}exports[_0x72f2('0x5f')]=function(_0x5458b3,_0x14b34f,_0x10cf2f){var _0x3f076e=_0x5458b3['params']['id'];return db[_0x72f2('0x5e')]['findAll']({'where':{'QuotationId':_0x3f076e,'productAsset':null},'raw':!![],'logging':console[_0x72f2('0x40')]})[_0x72f2('0x1f')](function(_0x12da77){if(_0x12da77[_0x72f2('0x2d')]>0x0){return db[_0x72f2('0x60')][_0x72f2('0x61')](function(_0x43c7fe){var _0x502014=new Array();for(var _0x2ac267=0x0;_0x2ac267<_0x12da77[_0x72f2('0x2d')];_0x2ac267++){var _0x19f38f=_[_0x72f2('0x62')](_0x12da77[_0x2ac267]);_0x502014['push'](manageProductQuotationIntoAsset(_0x19f38f,_0x43c7fe));}return BPromise['all'](_0x502014);});}else{var _0x38b8e6={'errors':[{'type':_0x72f2('0x50'),'message':_0x72f2('0x63')}]};throw _0x38b8e6;}})['then'](handleEntityNotFound(_0x14b34f,null))[_0x72f2('0x1f')](respondWithStatusCode(_0x14b34f,0xc8))[_0x72f2('0x39')](handleError(_0x14b34f,null));}; \ No newline at end of file diff --git a/server/api/saQuotation/saQuotation.model.js b/server/api/saQuotation/saQuotation.model.js index 0488dab..aee5a0a 100644 --- a/server/api/saQuotation/saQuotation.model.js +++ b/server/api/saQuotation/saQuotation.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4522=['path','rimraf','../../config/environment','./saQuotation.attributes','exports','define','SAQuotation','sa_quotations','../../config/logger','api','moment','request-promise'];(function(_0xb6aa53,_0x4bf9c9){var _0x240e29=function(_0x570fee){while(--_0x570fee){_0xb6aa53['push'](_0xb6aa53['shift']());}};_0x240e29(++_0x4bf9c9);}(_0x4522,0x1a0));var _0x2452=function(_0x2896f6,_0x180922){_0x2896f6=_0x2896f6-0x0;var _0x42d237=_0x4522[_0x2896f6];return _0x42d237;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2452('0x0'))(_0x2452('0x1'));var moment=require(_0x2452('0x2'));var BPromise=require('bluebird');var rp=require(_0x2452('0x3'));var fs=require('fs');var path=require(_0x2452('0x4'));var rimraf=require(_0x2452('0x5'));var config=require(_0x2452('0x6'));var attributes=require(_0x2452('0x7'));module[_0x2452('0x8')]=function(_0x15fc69,_0x226578){return _0x15fc69[_0x2452('0x9')](_0x2452('0xa'),attributes,{'tableName':_0x2452('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf45e=['exports','define','SAQuotation','sa_quotations','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./saQuotation.attributes'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0xf45e,0x115));var _0xef45=function(_0xb5e11c,_0x4477e2){_0xb5e11c=_0xb5e11c-0x0;var _0x9de970=_0xf45e[_0xb5e11c];return _0x9de970;};'use strict';var _=require(_0xef45('0x0'));var util=require('util');var logger=require(_0xef45('0x1'))('api');var moment=require(_0xef45('0x2'));var BPromise=require(_0xef45('0x3'));var rp=require(_0xef45('0x4'));var fs=require('fs');var path=require(_0xef45('0x5'));var rimraf=require(_0xef45('0x6'));var config=require(_0xef45('0x7'));var attributes=require(_0xef45('0x8'));module[_0xef45('0x9')]=function(_0x338960,_0x315b84){return _0x338960[_0xef45('0xa')](_0xef45('0xb'),attributes,{'tableName':_0xef45('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saQuotation/saQuotation.rpc.js b/server/api/saQuotation/saQuotation.rpc.js index 3e7c777..d7b4176 100644 --- a/server/api/saQuotation/saQuotation.rpc.js +++ b/server/api/saQuotation/saQuotation.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d5f=['info','SAQuotation,\x20%s,\x20%s','request\x20sent','message','error','result','catch','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x7d5f,0x1e2));var _0xf7d5=function(_0x319b6f,_0x2d73b5){_0x319b6f=_0x319b6f-0x0;var _0x4f52ae=_0x7d5f[_0x319b6f];return _0x4f52ae;};'use strict';var _=require(_0xf7d5('0x0'));var util=require(_0xf7d5('0x1'));var moment=require('moment');var BPromise=require(_0xf7d5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf7d5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf7d5('0x4'))(_0xf7d5('0x5'));var config=require(_0xf7d5('0x6'));var jayson=require(_0xf7d5('0x7'));var client=jayson[_0xf7d5('0x8')][_0xf7d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xea4eea,_0x43a576,_0x57e8a8){return new BPromise(function(_0x482766,_0x434dc9){return client[_0xf7d5('0xa')](_0xea4eea,_0x57e8a8)[_0xf7d5('0xb')](function(_0x40e4f1){logger[_0xf7d5('0xc')](_0xf7d5('0xd'),_0x43a576,_0xf7d5('0xe'));logger['debug']('SAQuotation,\x20%s,\x20%s,\x20%s',_0x43a576,_0xf7d5('0xe'),JSON['stringify'](_0x40e4f1));if(_0x40e4f1['error']){if(_0x40e4f1['error']['code']===0x1f4){logger['error']('SAQuotation,\x20%s,\x20%s',_0x43a576,_0x40e4f1['error'][_0xf7d5('0xf')]);return _0x434dc9(_0x40e4f1[_0xf7d5('0x10')][_0xf7d5('0xf')]);}logger[_0xf7d5('0x10')](_0xf7d5('0xd'),_0x43a576,_0x40e4f1[_0xf7d5('0x10')][_0xf7d5('0xf')]);return _0x482766(_0x40e4f1['error'][_0xf7d5('0xf')]);}else{logger['info']('SAQuotation,\x20%s,\x20%s',_0x43a576,_0xf7d5('0xe'));_0x482766(_0x40e4f1[_0xf7d5('0x11')][_0xf7d5('0xf')]);}})[_0xf7d5('0x12')](function(_0x1c9c0b){logger[_0xf7d5('0x10')](_0xf7d5('0xd'),_0x43a576,_0x1c9c0b);_0x434dc9(_0x1c9c0b);});});} \ No newline at end of file +var _0x2ec9=['jayson/promise','client','http','request','then','info','SAQuotation,\x20%s,\x20%s','request\x20sent','SAQuotation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x291982,_0x23a8e6){var _0x5cf632=function(_0x505809){while(--_0x505809){_0x291982['push'](_0x291982['shift']());}};_0x5cf632(++_0x23a8e6);}(_0x2ec9,0xf4));var _0x92ec=function(_0x326a44,_0x41c393){_0x326a44=_0x326a44-0x0;var _0x218e10=_0x2ec9[_0x326a44];return _0x218e10;};'use strict';var _=require(_0x92ec('0x0'));var util=require(_0x92ec('0x1'));var moment=require(_0x92ec('0x2'));var BPromise=require(_0x92ec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x92ec('0x4'));var db=require(_0x92ec('0x5'))['db'];var utils=require(_0x92ec('0x6'));var logger=require(_0x92ec('0x7'))('rpc');var config=require(_0x92ec('0x8'));var jayson=require(_0x92ec('0x9'));var client=jayson[_0x92ec('0xa')][_0x92ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x81b1ef,_0x3a49a0,_0x350988){return new BPromise(function(_0x3285f7,_0x25bd51){return client[_0x92ec('0xc')](_0x81b1ef,_0x350988)[_0x92ec('0xd')](function(_0x1e3347){logger[_0x92ec('0xe')](_0x92ec('0xf'),_0x3a49a0,_0x92ec('0x10'));logger['debug'](_0x92ec('0x11'),_0x3a49a0,_0x92ec('0x10'),JSON[_0x92ec('0x12')](_0x1e3347));if(_0x1e3347[_0x92ec('0x13')]){if(_0x1e3347[_0x92ec('0x13')]['code']===0x1f4){logger[_0x92ec('0x13')](_0x92ec('0xf'),_0x3a49a0,_0x1e3347[_0x92ec('0x13')][_0x92ec('0x14')]);return _0x25bd51(_0x1e3347[_0x92ec('0x13')][_0x92ec('0x14')]);}logger[_0x92ec('0x13')](_0x92ec('0xf'),_0x3a49a0,_0x1e3347[_0x92ec('0x13')][_0x92ec('0x14')]);return _0x3285f7(_0x1e3347[_0x92ec('0x13')][_0x92ec('0x14')]);}else{logger[_0x92ec('0xe')](_0x92ec('0xf'),_0x3a49a0,_0x92ec('0x10'));_0x3285f7(_0x1e3347[_0x92ec('0x15')][_0x92ec('0x14')]);}})[_0x92ec('0x16')](function(_0x4fcf4e){logger[_0x92ec('0x13')](_0x92ec('0xf'),_0x3a49a0,_0x4fcf4e);_0x25bd51(_0x4fcf4e);});});} \ No newline at end of file diff --git a/server/api/saRequest/index.js b/server/api/saRequest/index.js index a1c848d..831cbd7 100644 --- a/server/api/saRequest/index.js +++ b/server/api/saRequest/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47f8=['/describe','isAuthenticated','describe','get','show','post','create','/:id','update','delete','multer','path','express','../../components/auth/service','../../components/interaction/service','./saRequest.controller','index'];(function(_0x54fa4d,_0x13b308){var _0x4c7d65=function(_0x598398){while(--_0x598398){_0x54fa4d['push'](_0x54fa4d['shift']());}};_0x4c7d65(++_0x13b308);}(_0x47f8,0x1d5));var _0x847f=function(_0x4a7c31,_0x30fc89){_0x4a7c31=_0x4a7c31-0x0;var _0x3ee630=_0x47f8[_0x4a7c31];return _0x3ee630;};'use strict';var multer=require(_0x847f('0x0'));var util=require('util');var path=require(_0x847f('0x1'));var timeout=require('connect-timeout');var express=require(_0x847f('0x2'));var router=express['Router']();var auth=require(_0x847f('0x3'));var interaction=require(_0x847f('0x4'));var config=require('../../config/environment');var controller=require(_0x847f('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x847f('0x6')]);router['get'](_0x847f('0x7'),auth[_0x847f('0x8')](),controller[_0x847f('0x9')]);router[_0x847f('0xa')]('/:id',auth[_0x847f('0x8')](),controller[_0x847f('0xb')]);router[_0x847f('0xc')]('/',auth[_0x847f('0x8')](),controller[_0x847f('0xd')]);router['put'](_0x847f('0xe'),auth[_0x847f('0x8')](),controller[_0x847f('0xf')]);router[_0x847f('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5c34=['delete','destroy','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./saRequest.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update'];(function(_0x356d07,_0x415b54){var _0x5511a8=function(_0x4188f1){while(--_0x4188f1){_0x356d07['push'](_0x356d07['shift']());}};_0x5511a8(++_0x415b54);}(_0x5c34,0xfe));var _0x45c3=function(_0x2e41fe,_0x3218b8){_0x2e41fe=_0x2e41fe-0x0;var _0x361ebe=_0x5c34[_0x2e41fe];return _0x361ebe;};'use strict';var multer=require(_0x45c3('0x0'));var util=require(_0x45c3('0x1'));var path=require('path');var timeout=require(_0x45c3('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x45c3('0x3'));var interaction=require(_0x45c3('0x4'));var config=require(_0x45c3('0x5'));var controller=require(_0x45c3('0x6'));router[_0x45c3('0x7')]('/',auth[_0x45c3('0x8')](),controller['index']);router[_0x45c3('0x7')](_0x45c3('0x9'),auth[_0x45c3('0x8')](),controller[_0x45c3('0xa')]);router[_0x45c3('0x7')](_0x45c3('0xb'),auth['isAuthenticated'](),controller[_0x45c3('0xc')]);router[_0x45c3('0xd')]('/',auth[_0x45c3('0x8')](),controller[_0x45c3('0xe')]);router['put'](_0x45c3('0xb'),auth[_0x45c3('0x8')](),controller[_0x45c3('0xf')]);router[_0x45c3('0x10')](_0x45c3('0xb'),auth[_0x45c3('0x8')](),controller[_0x45c3('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/saRequest/saRequest.attributes.js b/server/api/saRequest/saRequest.attributes.js index 408e962..0f8b9b6 100644 --- a/server/api/saRequest/saRequest.attributes.js +++ b/server/api/saRequest/saRequest.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5aec=['DATE','STRING','name','TEXT','sequelize','exports'];(function(_0x45bcb1,_0x46cad0){var _0x4bd6a3=function(_0x1f197f){while(--_0x1f197f){_0x45bcb1['push'](_0x45bcb1['shift']());}};_0x4bd6a3(++_0x46cad0);}(_0x5aec,0xbe));var _0xc5ae=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x5aec[_0x556bb1];return _0x45455f;};'use strict';var Sequelize=require(_0xc5ae('0x0'));module[_0xc5ae('0x1')]={'endAt':{'type':Sequelize[_0xc5ae('0x2')]},'name':{'type':Sequelize[_0xc5ae('0x3')],'unique':_0xc5ae('0x4')},'agentFullname':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc5ae('0x5')]}}; \ No newline at end of file +var _0x0082=['TEXT','sequelize','exports','DATE','STRING'];(function(_0x1e081a,_0x482d6b){var _0x428209=function(_0x524b53){while(--_0x524b53){_0x1e081a['push'](_0x1e081a['shift']());}};_0x428209(++_0x482d6b);}(_0x0082,0x79));var _0x2008=function(_0xb499da,_0x2e8849){_0xb499da=_0xb499da-0x0;var _0x482dd6=_0x0082[_0xb499da];return _0x482dd6;};'use strict';var Sequelize=require(_0x2008('0x0'));module[_0x2008('0x1')]={'endAt':{'type':Sequelize[_0x2008('0x2')]},'name':{'type':Sequelize[_0x2008('0x3')],'unique':'name'},'agentFullname':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x2008('0x4')]}}; \ No newline at end of file diff --git a/server/api/saRequest/saRequest.controller.js b/server/api/saRequest/saRequest.controller.js index 9aa704f..3cb7f53 100644 --- a/server/api/saRequest/saRequest.controller.js +++ b/server/api/saRequest/saRequest.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['includeAll','findAll','catch','params','model','options','find','create','body','describe','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','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','send','index','SARequest','rawAttributes','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','field','count'];(function(_0x1f1511,_0x4ea911){var _0x1d9ab8=function(_0x53276a){while(--_0x53276a){_0x1f1511['push'](_0x1f1511['shift']());}};_0x1d9ab8(++_0x4ea911);}(_0xb10b,0x12a));var _0xbb10=function(_0x5dc2fa,_0x56279d){_0x5dc2fa=_0x5dc2fa-0x0;var _0x16eaf9=_0xb10b[_0x5dc2fa];return _0x16eaf9;};'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'];function respondWithStatusCode(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xcc;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x18')](_0x44fb19);}return _0x5be7e0[_0xbb10('0x19')](_0x44fb19)[_0xbb10('0x1a')]();};}function respondWithResult(_0x147230,_0x58a612){_0x58a612=_0x58a612||0xc8;return function(_0x26e021){if(_0x26e021){return _0x147230[_0xbb10('0x19')](_0x58a612)[_0xbb10('0x1b')](_0x26e021);}};}function respondWithFilteredResult(_0x17fd46,_0x3df17b){return function(_0x2f2ebf){if(_0x2f2ebf){var _0x24a57b=_0x2f2ebf['count'],_0x36b5e8=_0x3df17b[_0xbb10('0x1c')],_0x3e26f4=_0x3df17b[_0xbb10('0x1c')]+_0x3df17b[_0xbb10('0x1d')],_0x2b184e;if(_0x3e26f4>=_0x24a57b){_0x3e26f4=_0x24a57b;_0x2b184e=0xc8;}else{_0x2b184e=0xce;}_0x17fd46[_0xbb10('0x19')](_0x2b184e);return _0x17fd46[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x36b5e8+'-'+_0x3e26f4+'/'+_0x24a57b)[_0xbb10('0x1b')](_0x2f2ebf);}return null;};}function patchUpdates(_0x30efc6){return function(_0xbf2906){try{jsonpatch[_0xbb10('0x20')](_0xbf2906,_0x30efc6,!![]);}catch(_0x48b6e9){return BPromise[_0xbb10('0x21')](_0x48b6e9);}return _0xbf2906[_0xbb10('0x22')]();};}function saveUpdates(_0x388fab,_0x109908){return function(_0xdf237d){if(_0xdf237d){return _0xdf237d[_0xbb10('0x23')](_0x388fab)['then'](function(_0x12f888){return _0x12f888;});}return null;};}function removeEntity(_0x12ef77,_0x50aea1){return function(_0x4c4b0d){if(_0x4c4b0d){return _0x4c4b0d[_0xbb10('0x24')]()[_0xbb10('0x25')](function(){_0x12ef77[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x445761,_0x1824b7){return function(_0x407cb4){if(!_0x407cb4){_0x445761[_0xbb10('0x18')](0x194);}return _0x407cb4;};}function handleError(_0x7f2377,_0x395404){_0x395404=_0x395404||0x1f4;return function(_0x3ba6cd){logger[_0xbb10('0x26')](_0x3ba6cd['stack']);if(_0x3ba6cd['name']){delete _0x3ba6cd['name'];}_0x7f2377[_0xbb10('0x19')](_0x395404)[_0xbb10('0x27')](_0x3ba6cd);};}exports[_0xbb10('0x28')]=function(_0x4e25ff,_0x2fdde9){var _0x24d586={},_0x6ed43b={},_0x1d5e95={'count':0x0,'rows':[]};var _0x1acce9=db[_0xbb10('0x29')][_0xbb10('0x2a')];_0x6ed43b['model']=_[_0xbb10('0x2b')](_0x1acce9);_0x6ed43b[_0xbb10('0x2c')]=_[_0xbb10('0x2b')](_0x4e25ff[_0xbb10('0x2c')]);_0x6ed43b[_0xbb10('0x2d')]=_[_0xbb10('0x2e')](_0x6ed43b['model'],_0x6ed43b[_0xbb10('0x2c')]);_0x24d586['attributes']=_[_0xbb10('0x2e')](_0x6ed43b['model'],qs[_0xbb10('0x2f')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x2f')]));_0x24d586['attributes']=_0x24d586['attributes'][_0xbb10('0x30')]?_0x24d586[_0xbb10('0x31')]:_0x6ed43b['model'];if(!_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x32')](_0xbb10('0x33'))){_0x24d586[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x1d')]);_0x24d586['offset']=qs[_0xbb10('0x1c')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x1c')]);}_0x24d586[_0xbb10('0x34')]=qs[_0xbb10('0x35')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x35')]);_0x24d586[_0xbb10('0x36')]=qs[_0xbb10('0x2d')](_['pick'](_0x4e25ff[_0xbb10('0x2c')],_0x6ed43b[_0xbb10('0x2d')]));if(_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x37')]){_0x24d586['where']=_[_0xbb10('0x38')](_0x24d586['where'],{'$or':_['map'](_0x1acce9,function(_0x3eb3cc){if(_0x3eb3cc[_0xbb10('0x39')][_0xbb10('0x3a')]!==_0xbb10('0x3b')){var _0x15d895={};_0x15d895[_0x3eb3cc[_0xbb10('0x3c')]]={'$like':'%'+_0x4e25ff['query'][_0xbb10('0x37')]+'%'};return _0x15d895;}})});}_0x24d586=_[_0xbb10('0x38')]({},_0x24d586,_0x4e25ff['options']);var _0x5e3fbd={'where':_0x24d586['where']};return db[_0xbb10('0x29')][_0xbb10('0x3d')](_0x5e3fbd)[_0xbb10('0x25')](function(_0x4d5a9b){_0x1d5e95[_0xbb10('0x3d')]=_0x4d5a9b;if(_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x3e')]){_0x24d586['include']=[{'all':!![]}];}return db[_0xbb10('0x29')][_0xbb10('0x3f')](_0x24d586);})[_0xbb10('0x25')](function(_0x446f49){_0x1d5e95['rows']=_0x446f49;return _0x1d5e95;})[_0xbb10('0x25')](respondWithFilteredResult(_0x2fdde9,_0x24d586))[_0xbb10('0x40')](handleError(_0x2fdde9,null));};exports['show']=function(_0xe2040f,_0x2e3214){var _0x44d6ae={'raw':![],'where':{'id':_0xe2040f[_0xbb10('0x41')]['id']}},_0x3a9934={};_0x3a9934[_0xbb10('0x42')]=_['keys'](db[_0xbb10('0x29')][_0xbb10('0x2a')]);_0x3a9934[_0xbb10('0x2c')]=_[_0xbb10('0x2b')](_0xe2040f['query']);_0x3a9934[_0xbb10('0x2d')]=_[_0xbb10('0x2e')](_0x3a9934[_0xbb10('0x42')],_0x3a9934[_0xbb10('0x2c')]);_0x44d6ae['attributes']=_[_0xbb10('0x2e')](_0x3a9934[_0xbb10('0x42')],qs['fields'](_0xe2040f['query'][_0xbb10('0x2f')]));_0x44d6ae['attributes']=_0x44d6ae[_0xbb10('0x31')][_0xbb10('0x30')]?_0x44d6ae['attributes']:_0x3a9934[_0xbb10('0x42')];if(_0xe2040f[_0xbb10('0x2c')][_0xbb10('0x3e')]){_0x44d6ae['include']=[{'all':!![]}];}_0x44d6ae=_[_0xbb10('0x38')]({},_0x44d6ae,_0xe2040f[_0xbb10('0x43')]);return db[_0xbb10('0x29')][_0xbb10('0x44')](_0x44d6ae)[_0xbb10('0x25')](handleEntityNotFound(_0x2e3214,null))[_0xbb10('0x25')](respondWithResult(_0x2e3214,null))[_0xbb10('0x40')](handleError(_0x2e3214,null));};exports[_0xbb10('0x45')]=function(_0x205bb4,_0x43b948){return db[_0xbb10('0x29')][_0xbb10('0x45')](_0x205bb4['body'],{})[_0xbb10('0x25')](respondWithResult(_0x43b948,0xc9))[_0xbb10('0x40')](handleError(_0x43b948,null));};exports['update']=function(_0x14e1cb,_0x2f5027){if(_0x14e1cb[_0xbb10('0x46')]['id']){delete _0x14e1cb[_0xbb10('0x46')]['id'];}return db[_0xbb10('0x29')][_0xbb10('0x44')]({'where':{'id':_0x14e1cb[_0xbb10('0x41')]['id']}})['then'](handleEntityNotFound(_0x2f5027,null))['then'](saveUpdates(_0x14e1cb[_0xbb10('0x46')],null))[_0xbb10('0x25')](respondWithResult(_0x2f5027,null))[_0xbb10('0x40')](handleError(_0x2f5027,null));};exports['destroy']=function(_0x5f0c12,_0x3cd6f3){return db[_0xbb10('0x29')][_0xbb10('0x44')]({'where':{'id':_0x5f0c12[_0xbb10('0x41')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x3cd6f3,null))[_0xbb10('0x25')](removeEntity(_0x3cd6f3,null))[_0xbb10('0x40')](handleError(_0x3cd6f3,null));};exports[_0xbb10('0x47')]=function(_0x2626d8,_0x3d7e7e){return db['SARequest']['describe']()[_0xbb10('0x25')](respondWithResult(_0x3d7e7e,null))[_0xbb10('0x40')](handleError(_0x3d7e7e,null));}; \ No newline at end of file +var _0xb10b=['includeAll','findAll','catch','params','model','options','find','create','body','describe','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','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','send','index','SARequest','rawAttributes','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','field','count'];(function(_0x529e36,_0x235e90){var _0x1626da=function(_0x3e112a){while(--_0x3e112a){_0x529e36['push'](_0x529e36['shift']());}};_0x1626da(++_0x235e90);}(_0xb10b,0x12a));var _0xbb10=function(_0x2fea0b,_0x1427b2){_0x2fea0b=_0x2fea0b-0x0;var _0x80f5ec=_0xb10b[_0x2fea0b];return _0x80f5ec;};'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'];function respondWithStatusCode(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xcc;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x18')](_0x44fb19);}return _0x5be7e0[_0xbb10('0x19')](_0x44fb19)[_0xbb10('0x1a')]();};}function respondWithResult(_0x147230,_0x58a612){_0x58a612=_0x58a612||0xc8;return function(_0x26e021){if(_0x26e021){return _0x147230[_0xbb10('0x19')](_0x58a612)[_0xbb10('0x1b')](_0x26e021);}};}function respondWithFilteredResult(_0x17fd46,_0x3df17b){return function(_0x2f2ebf){if(_0x2f2ebf){var _0x24a57b=_0x2f2ebf['count'],_0x36b5e8=_0x3df17b[_0xbb10('0x1c')],_0x3e26f4=_0x3df17b[_0xbb10('0x1c')]+_0x3df17b[_0xbb10('0x1d')],_0x2b184e;if(_0x3e26f4>=_0x24a57b){_0x3e26f4=_0x24a57b;_0x2b184e=0xc8;}else{_0x2b184e=0xce;}_0x17fd46[_0xbb10('0x19')](_0x2b184e);return _0x17fd46[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x36b5e8+'-'+_0x3e26f4+'/'+_0x24a57b)[_0xbb10('0x1b')](_0x2f2ebf);}return null;};}function patchUpdates(_0x30efc6){return function(_0xbf2906){try{jsonpatch[_0xbb10('0x20')](_0xbf2906,_0x30efc6,!![]);}catch(_0x48b6e9){return BPromise[_0xbb10('0x21')](_0x48b6e9);}return _0xbf2906[_0xbb10('0x22')]();};}function saveUpdates(_0x388fab,_0x109908){return function(_0xdf237d){if(_0xdf237d){return _0xdf237d[_0xbb10('0x23')](_0x388fab)['then'](function(_0x12f888){return _0x12f888;});}return null;};}function removeEntity(_0x12ef77,_0x50aea1){return function(_0x4c4b0d){if(_0x4c4b0d){return _0x4c4b0d[_0xbb10('0x24')]()[_0xbb10('0x25')](function(){_0x12ef77[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x445761,_0x1824b7){return function(_0x407cb4){if(!_0x407cb4){_0x445761[_0xbb10('0x18')](0x194);}return _0x407cb4;};}function handleError(_0x7f2377,_0x395404){_0x395404=_0x395404||0x1f4;return function(_0x3ba6cd){logger[_0xbb10('0x26')](_0x3ba6cd['stack']);if(_0x3ba6cd['name']){delete _0x3ba6cd['name'];}_0x7f2377[_0xbb10('0x19')](_0x395404)[_0xbb10('0x27')](_0x3ba6cd);};}exports[_0xbb10('0x28')]=function(_0x4e25ff,_0x2fdde9){var _0x24d586={},_0x6ed43b={},_0x1d5e95={'count':0x0,'rows':[]};var _0x1acce9=db[_0xbb10('0x29')][_0xbb10('0x2a')];_0x6ed43b['model']=_[_0xbb10('0x2b')](_0x1acce9);_0x6ed43b[_0xbb10('0x2c')]=_[_0xbb10('0x2b')](_0x4e25ff[_0xbb10('0x2c')]);_0x6ed43b[_0xbb10('0x2d')]=_[_0xbb10('0x2e')](_0x6ed43b['model'],_0x6ed43b[_0xbb10('0x2c')]);_0x24d586['attributes']=_[_0xbb10('0x2e')](_0x6ed43b['model'],qs[_0xbb10('0x2f')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x2f')]));_0x24d586['attributes']=_0x24d586['attributes'][_0xbb10('0x30')]?_0x24d586[_0xbb10('0x31')]:_0x6ed43b['model'];if(!_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x32')](_0xbb10('0x33'))){_0x24d586[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x1d')]);_0x24d586['offset']=qs[_0xbb10('0x1c')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x1c')]);}_0x24d586[_0xbb10('0x34')]=qs[_0xbb10('0x35')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x35')]);_0x24d586[_0xbb10('0x36')]=qs[_0xbb10('0x2d')](_['pick'](_0x4e25ff[_0xbb10('0x2c')],_0x6ed43b[_0xbb10('0x2d')]));if(_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x37')]){_0x24d586['where']=_[_0xbb10('0x38')](_0x24d586['where'],{'$or':_['map'](_0x1acce9,function(_0x3eb3cc){if(_0x3eb3cc[_0xbb10('0x39')][_0xbb10('0x3a')]!==_0xbb10('0x3b')){var _0x15d895={};_0x15d895[_0x3eb3cc[_0xbb10('0x3c')]]={'$like':'%'+_0x4e25ff['query'][_0xbb10('0x37')]+'%'};return _0x15d895;}})});}_0x24d586=_[_0xbb10('0x38')]({},_0x24d586,_0x4e25ff['options']);var _0x5e3fbd={'where':_0x24d586['where']};return db[_0xbb10('0x29')][_0xbb10('0x3d')](_0x5e3fbd)[_0xbb10('0x25')](function(_0x4d5a9b){_0x1d5e95[_0xbb10('0x3d')]=_0x4d5a9b;if(_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x3e')]){_0x24d586['include']=[{'all':!![]}];}return db[_0xbb10('0x29')][_0xbb10('0x3f')](_0x24d586);})[_0xbb10('0x25')](function(_0x446f49){_0x1d5e95['rows']=_0x446f49;return _0x1d5e95;})[_0xbb10('0x25')](respondWithFilteredResult(_0x2fdde9,_0x24d586))[_0xbb10('0x40')](handleError(_0x2fdde9,null));};exports['show']=function(_0xe2040f,_0x2e3214){var _0x44d6ae={'raw':![],'where':{'id':_0xe2040f[_0xbb10('0x41')]['id']}},_0x3a9934={};_0x3a9934[_0xbb10('0x42')]=_['keys'](db[_0xbb10('0x29')][_0xbb10('0x2a')]);_0x3a9934[_0xbb10('0x2c')]=_[_0xbb10('0x2b')](_0xe2040f['query']);_0x3a9934[_0xbb10('0x2d')]=_[_0xbb10('0x2e')](_0x3a9934[_0xbb10('0x42')],_0x3a9934[_0xbb10('0x2c')]);_0x44d6ae['attributes']=_[_0xbb10('0x2e')](_0x3a9934[_0xbb10('0x42')],qs['fields'](_0xe2040f['query'][_0xbb10('0x2f')]));_0x44d6ae['attributes']=_0x44d6ae[_0xbb10('0x31')][_0xbb10('0x30')]?_0x44d6ae['attributes']:_0x3a9934[_0xbb10('0x42')];if(_0xe2040f[_0xbb10('0x2c')][_0xbb10('0x3e')]){_0x44d6ae['include']=[{'all':!![]}];}_0x44d6ae=_[_0xbb10('0x38')]({},_0x44d6ae,_0xe2040f[_0xbb10('0x43')]);return db[_0xbb10('0x29')][_0xbb10('0x44')](_0x44d6ae)[_0xbb10('0x25')](handleEntityNotFound(_0x2e3214,null))[_0xbb10('0x25')](respondWithResult(_0x2e3214,null))[_0xbb10('0x40')](handleError(_0x2e3214,null));};exports[_0xbb10('0x45')]=function(_0x205bb4,_0x43b948){return db[_0xbb10('0x29')][_0xbb10('0x45')](_0x205bb4['body'],{})[_0xbb10('0x25')](respondWithResult(_0x43b948,0xc9))[_0xbb10('0x40')](handleError(_0x43b948,null));};exports['update']=function(_0x14e1cb,_0x2f5027){if(_0x14e1cb[_0xbb10('0x46')]['id']){delete _0x14e1cb[_0xbb10('0x46')]['id'];}return db[_0xbb10('0x29')][_0xbb10('0x44')]({'where':{'id':_0x14e1cb[_0xbb10('0x41')]['id']}})['then'](handleEntityNotFound(_0x2f5027,null))['then'](saveUpdates(_0x14e1cb[_0xbb10('0x46')],null))[_0xbb10('0x25')](respondWithResult(_0x2f5027,null))[_0xbb10('0x40')](handleError(_0x2f5027,null));};exports['destroy']=function(_0x5f0c12,_0x3cd6f3){return db[_0xbb10('0x29')][_0xbb10('0x44')]({'where':{'id':_0x5f0c12[_0xbb10('0x41')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x3cd6f3,null))[_0xbb10('0x25')](removeEntity(_0x3cd6f3,null))[_0xbb10('0x40')](handleError(_0x3cd6f3,null));};exports[_0xbb10('0x47')]=function(_0x2626d8,_0x3d7e7e){return db['SARequest']['describe']()[_0xbb10('0x25')](respondWithResult(_0x3d7e7e,null))[_0xbb10('0x40')](handleError(_0x3d7e7e,null));}; \ No newline at end of file diff --git a/server/api/saRequest/saRequest.model.js b/server/api/saRequest/saRequest.model.js index f7b5c00..3c37c55 100644 --- a/server/api/saRequest/saRequest.model.js +++ b/server/api/saRequest/saRequest.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./saRequest.attributes','exports','define','SARequest','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x82b1b,_0x5dfc7d){var _0x25c15c=function(_0x595b9f){while(--_0x595b9f){_0x82b1b['push'](_0x82b1b['shift']());}};_0x25c15c(++_0x5dfc7d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'sa_requests','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./saRequest.attributes','exports','define','SARequest','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x4dd383,_0x38dbd6){var _0x5dc5f5=function(_0x3cdf4e){while(--_0x3cdf4e){_0x4dd383['push'](_0x4dd383['shift']());}};_0x5dc5f5(++_0x38dbd6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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':'sa_requests','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saRequest/saRequest.rpc.js b/server/api/saRequest/saRequest.rpc.js index f9300f8..cae83cc 100644 --- a/server/api/saRequest/saRequest.rpc.js +++ b/server/api/saRequest/saRequest.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8262=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SARequest,\x20%s,\x20%s,\x20%s','stringify','error','SARequest,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x10cbda,_0x331fd9){var _0x10e5d8=function(_0x468805){while(--_0x468805){_0x10cbda['push'](_0x10cbda['shift']());}};_0x10e5d8(++_0x331fd9);}(_0x8262,0x125));var _0x2826=function(_0x43f8ff,_0x262fd2){_0x43f8ff=_0x43f8ff-0x0;var _0x230fb6=_0x8262[_0x43f8ff];return _0x230fb6;};'use strict';var _=require(_0x2826('0x0'));var util=require('util');var moment=require(_0x2826('0x1'));var BPromise=require('bluebird');var rs=require(_0x2826('0x2'));var fs=require('fs');var Redis=require(_0x2826('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2826('0x4'));var logger=require(_0x2826('0x5'))(_0x2826('0x6'));var config=require(_0x2826('0x7'));var jayson=require(_0x2826('0x8'));var client=jayson[_0x2826('0x9')][_0x2826('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf33a9a,_0x5810c0,_0x2c01e1){return new BPromise(function(_0x2dbf21,_0x270e95){return client[_0x2826('0xb')](_0xf33a9a,_0x2c01e1)[_0x2826('0xc')](function(_0x38e2d9){logger[_0x2826('0xd')]('SARequest,\x20%s,\x20%s',_0x5810c0,_0x2826('0xe'));logger[_0x2826('0xf')](_0x2826('0x10'),_0x5810c0,_0x2826('0xe'),JSON[_0x2826('0x11')](_0x38e2d9));if(_0x38e2d9['error']){if(_0x38e2d9['error']['code']===0x1f4){logger[_0x2826('0x12')](_0x2826('0x13'),_0x5810c0,_0x38e2d9[_0x2826('0x12')]['message']);return _0x270e95(_0x38e2d9['error'][_0x2826('0x14')]);}logger['error'](_0x2826('0x13'),_0x5810c0,_0x38e2d9[_0x2826('0x12')][_0x2826('0x14')]);return _0x2dbf21(_0x38e2d9[_0x2826('0x12')][_0x2826('0x14')]);}else{logger[_0x2826('0xd')]('SARequest,\x20%s,\x20%s',_0x5810c0,_0x2826('0xe'));_0x2dbf21(_0x38e2d9[_0x2826('0x15')][_0x2826('0x14')]);}})[_0x2826('0x16')](function(_0x5ea81d){logger[_0x2826('0x12')]('SARequest,\x20%s,\x20%s',_0x5810c0,_0x5ea81d);_0x270e95(_0x5ea81d);});});} \ No newline at end of file +var _0x476a=['util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','request','info','SARequest,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x44c840,_0x165e07){var _0x7e316c=function(_0x27129d){while(--_0x27129d){_0x44c840['push'](_0x44c840['shift']());}};_0x7e316c(++_0x165e07);}(_0x476a,0xc5));var _0xa476=function(_0x558099,_0x4be744){_0x558099=_0x558099-0x0;var _0x18ac2e=_0x476a[_0x558099];return _0x18ac2e;};'use strict';var _=require(_0xa476('0x0'));var util=require(_0xa476('0x1'));var moment=require(_0xa476('0x2'));var BPromise=require(_0xa476('0x3'));var rs=require(_0xa476('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa476('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa476('0x6'));var jayson=require(_0xa476('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x311554,_0xfdc8d7,_0x4d0319){return new BPromise(function(_0x31d03c,_0x52cbc5){return client[_0xa476('0x8')](_0x311554,_0x4d0319)['then'](function(_0x57fca1){logger[_0xa476('0x9')](_0xa476('0xa'),_0xfdc8d7,'request\x20sent');logger[_0xa476('0xb')]('SARequest,\x20%s,\x20%s,\x20%s',_0xfdc8d7,_0xa476('0xc'),JSON[_0xa476('0xd')](_0x57fca1));if(_0x57fca1[_0xa476('0xe')]){if(_0x57fca1[_0xa476('0xe')][_0xa476('0xf')]===0x1f4){logger[_0xa476('0xe')](_0xa476('0xa'),_0xfdc8d7,_0x57fca1[_0xa476('0xe')]['message']);return _0x52cbc5(_0x57fca1[_0xa476('0xe')][_0xa476('0x10')]);}logger['error'](_0xa476('0xa'),_0xfdc8d7,_0x57fca1['error']['message']);return _0x31d03c(_0x57fca1['error'][_0xa476('0x10')]);}else{logger['info'](_0xa476('0xa'),_0xfdc8d7,'request\x20sent');_0x31d03c(_0x57fca1['result'][_0xa476('0x10')]);}})[_0xa476('0x11')](function(_0x4966c8){logger[_0xa476('0xe')](_0xa476('0xa'),_0xfdc8d7,_0x4966c8);_0x52cbc5(_0x4966c8);});});} \ No newline at end of file diff --git a/server/api/saSalesCondition/index.js b/server/api/saSalesCondition/index.js index a2a5e4d..5fc2d5b 100644 --- a/server/api/saSalesCondition/index.js +++ b/server/api/saSalesCondition/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa4fb=['isAuthenticated','index','/:id','show','create','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','./saSalesCondition.controller','get'];(function(_0x3b87f4,_0x112243){var _0x63d16e=function(_0x3e7323){while(--_0x3e7323){_0x3b87f4['push'](_0x3b87f4['shift']());}};_0x63d16e(++_0x112243);}(_0xa4fb,0xd8));var _0xba4f=function(_0x3f6e26,_0x811a34){_0x3f6e26=_0x3f6e26-0x0;var _0x474345=_0xa4fb[_0x3f6e26];return _0x474345;};'use strict';var multer=require(_0xba4f('0x0'));var util=require('util');var path=require(_0xba4f('0x1'));var timeout=require('connect-timeout');var express=require(_0xba4f('0x2'));var router=express[_0xba4f('0x3')]();var auth=require(_0xba4f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xba4f('0x5'));var controller=require(_0xba4f('0x6'));router[_0xba4f('0x7')]('/',auth[_0xba4f('0x8')](),controller[_0xba4f('0x9')]);router[_0xba4f('0x7')](_0xba4f('0xa'),auth[_0xba4f('0x8')](),controller[_0xba4f('0xb')]);router['post']('/',auth[_0xba4f('0x8')](),controller[_0xba4f('0xc')]);module[_0xba4f('0xd')]=router; \ No newline at end of file +var _0x1d17=['exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','/:id','show','create'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x1d17,0x139));var _0x71d1=function(_0x4fcd54,_0x38ce24){_0x4fcd54=_0x4fcd54-0x0;var _0xf8983=_0x1d17[_0x4fcd54];return _0xf8983;};'use strict';var multer=require(_0x71d1('0x0'));var util=require(_0x71d1('0x1'));var path=require(_0x71d1('0x2'));var timeout=require('connect-timeout');var express=require(_0x71d1('0x3'));var router=express[_0x71d1('0x4')]();var auth=require(_0x71d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x71d1('0x6'));var controller=require('./saSalesCondition.controller');router['get']('/',auth[_0x71d1('0x7')](),controller[_0x71d1('0x8')]);router['get'](_0x71d1('0x9'),auth[_0x71d1('0x7')](),controller[_0x71d1('0xa')]);router['post']('/',auth[_0x71d1('0x7')](),controller[_0x71d1('0xb')]);module[_0x71d1('0xc')]=router; \ No newline at end of file diff --git a/server/api/saSalesCondition/saSalesCondition.attributes.js b/server/api/saSalesCondition/saSalesCondition.attributes.js index e01f347..25dc0e1 100644 --- a/server/api/saSalesCondition/saSalesCondition.attributes.js +++ b/server/api/saSalesCondition/saSalesCondition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5636=['sequelize','exports'];(function(_0x59b7fc,_0x2cb4f7){var _0x5345f1=function(_0x2c9a82){while(--_0x2c9a82){_0x59b7fc['push'](_0x59b7fc['shift']());}};_0x5345f1(++_0x2cb4f7);}(_0x5636,0x102));var _0x6563=function(_0x1bd0af,_0x1a0e89){_0x1bd0af=_0x1bd0af-0x0;var _0x37a04f=_0x5636[_0x1bd0af];return _0x37a04f;};'use strict';var Sequelize=require(_0x6563('0x0'));module[_0x6563('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'momthlysubscription':{'type':Sequelize['INTEGER'],'allowNull':![]}}; \ No newline at end of file +var _0x22fb=['STRING','INTEGER'];(function(_0xb9bfa3,_0x173f5f){var _0x5c0556=function(_0x269e61){while(--_0x269e61){_0xb9bfa3['push'](_0xb9bfa3['shift']());}};_0x5c0556(++_0x173f5f);}(_0x22fb,0x192));var _0xb22f=function(_0x11266b,_0x32094b){_0x11266b=_0x11266b-0x0;var _0x409cf9=_0x22fb[_0x11266b];return _0x409cf9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb22f('0x0')],'allowNull':![],'unique':'name'},'momthlysubscription':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/saSalesCondition/saSalesCondition.controller.js b/server/api/saSalesCondition/saSalesCondition.controller.js index 5777ff6..b428d44 100644 --- a/server/api/saSalesCondition/saSalesCondition.controller.js +++ b/server/api/saSalesCondition/saSalesCondition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a03=['attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','SASalesCondition','count','include','findAll','catch','show','rawAttributes','length','includeAll','find','create','body','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','model','keys','query','filters','intersection'];(function(_0x3886bb,_0x281b96){var _0x39ca0e=function(_0xe7c627){while(--_0xe7c627){_0x3886bb['push'](_0x3886bb['shift']());}};_0x39ca0e(++_0x281b96);}(_0x8a03,0xf0));var _0x38a0=function(_0x488aa2,_0x370003){_0x488aa2=_0x488aa2-0x0;var _0x1d0a00=_0x8a03[_0x488aa2];return _0x1d0a00;};'use strict';var pdf=require(_0x38a0('0x0'));var emlformat=require(_0x38a0('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x38a0('0x2'));var rp=require(_0x38a0('0x3'));var moment=require('moment');var BPromise=require(_0x38a0('0x4'));var Mustache=require(_0x38a0('0x5'));var util=require(_0x38a0('0x6'));var path=require('path');var sox=require(_0x38a0('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x38a0('0x8'));var squel=require(_0x38a0('0x9'));var crypto=require(_0x38a0('0xa'));var jsforce=require(_0x38a0('0xb'));var deskjs=require(_0x38a0('0xc'));var toCsv=require(_0x38a0('0xd'));var querystring=require('querystring');var Papa=require(_0x38a0('0xe'));var Redis=require(_0x38a0('0xf'));var authService=require(_0x38a0('0x10'));var qs=require(_0x38a0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x38a0('0x12'))(_0x38a0('0x13'));var utils=require(_0x38a0('0x14'));var config=require('../../config/environment');var db=require(_0x38a0('0x15'))['db'];function respondWithStatusCode(_0x1726d4,_0xf0260e){_0xf0260e=_0xf0260e||0xcc;return function(_0x815e22){if(_0x815e22){return _0x1726d4[_0x38a0('0x16')](_0xf0260e);}return _0x1726d4['status'](_0xf0260e)[_0x38a0('0x17')]();};}function respondWithResult(_0xd9656,_0x12702f){_0x12702f=_0x12702f||0xc8;return function(_0x25ac1d){if(_0x25ac1d){return _0xd9656[_0x38a0('0x18')](_0x12702f)[_0x38a0('0x19')](_0x25ac1d);}};}function respondWithFilteredResult(_0x4162e2,_0x28962d){return function(_0xb7cf4f){if(_0xb7cf4f){var _0x278a53=_0xb7cf4f['count'],_0x495016=_0x28962d['offset'],_0x57d0cb=_0x28962d[_0x38a0('0x1a')]+_0x28962d[_0x38a0('0x1b')],_0x58df5d;if(_0x57d0cb>=_0x278a53){_0x57d0cb=_0x278a53;_0x58df5d=0xc8;}else{_0x58df5d=0xce;}_0x4162e2['status'](_0x58df5d);return _0x4162e2['set'](_0x38a0('0x1c'),_0x495016+'-'+_0x57d0cb+'/'+_0x278a53)[_0x38a0('0x19')](_0xb7cf4f);}return null;};}function patchUpdates(_0x234964){return function(_0x308d85){try{jsonpatch[_0x38a0('0x1d')](_0x308d85,_0x234964,!![]);}catch(_0x4ebc62){return BPromise[_0x38a0('0x1e')](_0x4ebc62);}return _0x308d85[_0x38a0('0x1f')]();};}function saveUpdates(_0x22dfbe,_0x4eafa0){return function(_0xaf3122){if(_0xaf3122){return _0xaf3122[_0x38a0('0x20')](_0x22dfbe)[_0x38a0('0x21')](function(_0x30c24f){return _0x30c24f;});}return null;};}function removeEntity(_0x197054,_0x442279){return function(_0x153da8){if(_0x153da8){return _0x153da8[_0x38a0('0x22')]()[_0x38a0('0x21')](function(){_0x197054[_0x38a0('0x18')](0xcc)[_0x38a0('0x17')]();});}};}function handleEntityNotFound(_0x133758,_0x1f4800){return function(_0x5141e3){if(!_0x5141e3){_0x133758[_0x38a0('0x16')](0x194);}return _0x5141e3;};}function handleError(_0x382ab3,_0x491c04){_0x491c04=_0x491c04||0x1f4;return function(_0x4e6262){logger['error'](_0x4e6262[_0x38a0('0x23')]);if(_0x4e6262[_0x38a0('0x24')]){delete _0x4e6262[_0x38a0('0x24')];}_0x382ab3['status'](_0x491c04)[_0x38a0('0x25')](_0x4e6262);};}exports[_0x38a0('0x26')]=function(_0x368a99,_0xed2421){var _0x3dcdeb={'raw':!![]},_0x21b95e={},_0x3b1068={'count':0x0,'rows':[]};var _0x1fea51=db['SASalesCondition']['rawAttributes'];_0x21b95e[_0x38a0('0x27')]=_[_0x38a0('0x28')](_0x1fea51);_0x21b95e[_0x38a0('0x29')]=_[_0x38a0('0x28')](_0x368a99['query']);_0x21b95e[_0x38a0('0x2a')]=_[_0x38a0('0x2b')](_0x21b95e[_0x38a0('0x27')],_0x21b95e['query']);_0x3dcdeb[_0x38a0('0x2c')]=_[_0x38a0('0x2b')](_0x21b95e[_0x38a0('0x27')],qs[_0x38a0('0x2d')](_0x368a99[_0x38a0('0x29')][_0x38a0('0x2d')]));_0x3dcdeb['attributes']=_0x3dcdeb[_0x38a0('0x2c')]['length']?_0x3dcdeb['attributes']:_0x21b95e[_0x38a0('0x27')];if(!_0x368a99[_0x38a0('0x29')][_0x38a0('0x2e')](_0x38a0('0x2f'))){_0x3dcdeb[_0x38a0('0x1b')]=qs[_0x38a0('0x1b')](_0x368a99['query'][_0x38a0('0x1b')]);_0x3dcdeb[_0x38a0('0x1a')]=qs['offset'](_0x368a99['query']['offset']);}_0x3dcdeb['order']=qs[_0x38a0('0x30')](_0x368a99[_0x38a0('0x29')][_0x38a0('0x30')]);_0x3dcdeb[_0x38a0('0x31')]=qs[_0x38a0('0x2a')](_[_0x38a0('0x32')](_0x368a99[_0x38a0('0x29')],_0x21b95e[_0x38a0('0x2a')]));if(_0x368a99[_0x38a0('0x29')]['filter']){_0x3dcdeb[_0x38a0('0x31')]=_[_0x38a0('0x33')](_0x3dcdeb[_0x38a0('0x31')],{'$or':_[_0x38a0('0x34')](_0x1fea51,function(_0x14df89){if(_0x14df89[_0x38a0('0x35')][_0x38a0('0x36')]!==_0x38a0('0x37')){var _0x57085c={};_0x57085c[_0x14df89[_0x38a0('0x38')]]={'$like':'%'+_0x368a99[_0x38a0('0x29')][_0x38a0('0x39')]+'%'};return _0x57085c;}})});}_0x3dcdeb=_['merge']({},_0x3dcdeb,_0x368a99[_0x38a0('0x3a')]);var _0x1e5749={'where':_0x3dcdeb[_0x38a0('0x31')]};return db[_0x38a0('0x3b')][_0x38a0('0x3c')](_0x1e5749)['then'](function(_0x2618dc){_0x3b1068[_0x38a0('0x3c')]=_0x2618dc;if(_0x368a99[_0x38a0('0x29')]['includeAll']){_0x3dcdeb[_0x38a0('0x3d')]=[{'all':!![]}];}return db[_0x38a0('0x3b')][_0x38a0('0x3e')](_0x3dcdeb);})[_0x38a0('0x21')](function(_0x433cac){_0x3b1068['rows']=_0x433cac;return _0x3b1068;})[_0x38a0('0x21')](respondWithFilteredResult(_0xed2421,_0x3dcdeb))[_0x38a0('0x3f')](handleError(_0xed2421,null));};exports[_0x38a0('0x40')]=function(_0x4ea56f,_0x50298f){var _0x1ecd4f={'raw':!![],'where':{'id':_0x4ea56f['params']['id']}},_0x5e4099={};_0x5e4099[_0x38a0('0x27')]=_[_0x38a0('0x28')](db['SASalesCondition'][_0x38a0('0x41')]);_0x5e4099['query']=_[_0x38a0('0x28')](_0x4ea56f[_0x38a0('0x29')]);_0x5e4099[_0x38a0('0x2a')]=_[_0x38a0('0x2b')](_0x5e4099['model'],_0x5e4099[_0x38a0('0x29')]);_0x1ecd4f['attributes']=_[_0x38a0('0x2b')](_0x5e4099[_0x38a0('0x27')],qs[_0x38a0('0x2d')](_0x4ea56f['query']['fields']));_0x1ecd4f[_0x38a0('0x2c')]=_0x1ecd4f[_0x38a0('0x2c')][_0x38a0('0x42')]?_0x1ecd4f[_0x38a0('0x2c')]:_0x5e4099[_0x38a0('0x27')];if(_0x4ea56f[_0x38a0('0x29')][_0x38a0('0x43')]){_0x1ecd4f[_0x38a0('0x3d')]=[{'all':!![]}];}_0x1ecd4f=_[_0x38a0('0x33')]({},_0x1ecd4f,_0x4ea56f[_0x38a0('0x3a')]);return db[_0x38a0('0x3b')][_0x38a0('0x44')](_0x1ecd4f)[_0x38a0('0x21')](handleEntityNotFound(_0x50298f,null))[_0x38a0('0x21')](respondWithResult(_0x50298f,null))[_0x38a0('0x3f')](handleError(_0x50298f,null));};exports[_0x38a0('0x45')]=function(_0x4381f1,_0x31346b){return db[_0x38a0('0x3b')]['create'](_0x4381f1[_0x38a0('0x46')],{})[_0x38a0('0x21')](respondWithResult(_0x31346b,0xc9))['catch'](handleError(_0x31346b,null));}; \ No newline at end of file +var _0x5b43=['request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','SASalesCondition','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','count','includeAll','include','findAll','rows','catch','show','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x3700bc,_0x5d40a5){var _0x10bbed=function(_0xad56d7){while(--_0xad56d7){_0x3700bc['push'](_0x3700bc['shift']());}};_0x10bbed(++_0x5d40a5);}(_0x5b43,0x123));var _0x35b4=function(_0x138524,_0x560360){_0x138524=_0x138524-0x0;var _0x550d82=_0x5b43[_0x138524];return _0x550d82;};'use strict';var pdf=require(_0x35b4('0x0'));var emlformat=require(_0x35b4('0x1'));var rimraf=require(_0x35b4('0x2'));var zipdir=require(_0x35b4('0x3'));var jsonpatch=require(_0x35b4('0x4'));var rp=require(_0x35b4('0x5'));var moment=require('moment');var BPromise=require(_0x35b4('0x6'));var Mustache=require('mustache');var util=require(_0x35b4('0x7'));var path=require(_0x35b4('0x8'));var sox=require(_0x35b4('0x9'));var csv=require(_0x35b4('0xa'));var ejs=require(_0x35b4('0xb'));var fs=require('fs');var _=require(_0x35b4('0xc'));var squel=require(_0x35b4('0xd'));var crypto=require(_0x35b4('0xe'));var jsforce=require(_0x35b4('0xf'));var deskjs=require(_0x35b4('0x10'));var toCsv=require('to-csv');var querystring=require(_0x35b4('0x11'));var Papa=require('papaparse');var Redis=require(_0x35b4('0x12'));var authService=require(_0x35b4('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x35b4('0x14'))(_0x35b4('0x15'));var utils=require(_0x35b4('0x16'));var config=require(_0x35b4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x438133,_0x8fd8d9){_0x8fd8d9=_0x8fd8d9||0xcc;return function(_0x4ebbb4){if(_0x4ebbb4){return _0x438133[_0x35b4('0x18')](_0x8fd8d9);}return _0x438133[_0x35b4('0x19')](_0x8fd8d9)[_0x35b4('0x1a')]();};}function respondWithResult(_0x317312,_0x488531){_0x488531=_0x488531||0xc8;return function(_0x15a816){if(_0x15a816){return _0x317312['status'](_0x488531)[_0x35b4('0x1b')](_0x15a816);}};}function respondWithFilteredResult(_0x963489,_0x41a9a0){return function(_0x332dfd){if(_0x332dfd){var _0x4ee47a=_0x332dfd['count'],_0xc83826=_0x41a9a0[_0x35b4('0x1c')],_0x22ea6c=_0x41a9a0[_0x35b4('0x1c')]+_0x41a9a0[_0x35b4('0x1d')],_0x5b1235;if(_0x22ea6c>=_0x4ee47a){_0x22ea6c=_0x4ee47a;_0x5b1235=0xc8;}else{_0x5b1235=0xce;}_0x963489[_0x35b4('0x19')](_0x5b1235);return _0x963489[_0x35b4('0x1e')](_0x35b4('0x1f'),_0xc83826+'-'+_0x22ea6c+'/'+_0x4ee47a)[_0x35b4('0x1b')](_0x332dfd);}return null;};}function patchUpdates(_0x1f7739){return function(_0x39fd22){try{jsonpatch[_0x35b4('0x20')](_0x39fd22,_0x1f7739,!![]);}catch(_0x3927c9){return BPromise[_0x35b4('0x21')](_0x3927c9);}return _0x39fd22[_0x35b4('0x22')]();};}function saveUpdates(_0x48a5da,_0x268994){return function(_0x3ce6da){if(_0x3ce6da){return _0x3ce6da[_0x35b4('0x23')](_0x48a5da)[_0x35b4('0x24')](function(_0x2432b6){return _0x2432b6;});}return null;};}function removeEntity(_0x3cc513,_0x3a5afa){return function(_0xfb3e0c){if(_0xfb3e0c){return _0xfb3e0c[_0x35b4('0x25')]()[_0x35b4('0x24')](function(){_0x3cc513[_0x35b4('0x19')](0xcc)[_0x35b4('0x1a')]();});}};}function handleEntityNotFound(_0x13802d,_0x49932f){return function(_0xb8bb7a){if(!_0xb8bb7a){_0x13802d[_0x35b4('0x18')](0x194);}return _0xb8bb7a;};}function handleError(_0x41aacc,_0x1d360f){_0x1d360f=_0x1d360f||0x1f4;return function(_0x3ade53){logger[_0x35b4('0x26')](_0x3ade53[_0x35b4('0x27')]);if(_0x3ade53['name']){delete _0x3ade53[_0x35b4('0x28')];}_0x41aacc[_0x35b4('0x19')](_0x1d360f)[_0x35b4('0x29')](_0x3ade53);};}exports[_0x35b4('0x2a')]=function(_0xaecb39,_0x3c416a){var _0xc604f={'raw':!![]},_0xb52610={},_0x4edd85={'count':0x0,'rows':[]};var _0x4c6e62=db[_0x35b4('0x2b')][_0x35b4('0x2c')];_0xb52610[_0x35b4('0x2d')]=_[_0x35b4('0x2e')](_0x4c6e62);_0xb52610[_0x35b4('0x2f')]=_['keys'](_0xaecb39['query']);_0xb52610[_0x35b4('0x30')]=_['intersection'](_0xb52610['model'],_0xb52610[_0x35b4('0x2f')]);_0xc604f[_0x35b4('0x31')]=_[_0x35b4('0x32')](_0xb52610[_0x35b4('0x2d')],qs['fields'](_0xaecb39[_0x35b4('0x2f')][_0x35b4('0x33')]));_0xc604f[_0x35b4('0x31')]=_0xc604f[_0x35b4('0x31')][_0x35b4('0x34')]?_0xc604f[_0x35b4('0x31')]:_0xb52610[_0x35b4('0x2d')];if(!_0xaecb39[_0x35b4('0x2f')]['hasOwnProperty'](_0x35b4('0x35'))){_0xc604f[_0x35b4('0x1d')]=qs[_0x35b4('0x1d')](_0xaecb39[_0x35b4('0x2f')][_0x35b4('0x1d')]);_0xc604f['offset']=qs['offset'](_0xaecb39[_0x35b4('0x2f')][_0x35b4('0x1c')]);}_0xc604f[_0x35b4('0x36')]=qs[_0x35b4('0x37')](_0xaecb39[_0x35b4('0x2f')][_0x35b4('0x37')]);_0xc604f[_0x35b4('0x38')]=qs[_0x35b4('0x30')](_[_0x35b4('0x39')](_0xaecb39['query'],_0xb52610['filters']));if(_0xaecb39['query']['filter']){_0xc604f[_0x35b4('0x38')]=_[_0x35b4('0x3a')](_0xc604f[_0x35b4('0x38')],{'$or':_[_0x35b4('0x3b')](_0x4c6e62,function(_0xa6a2fe){if(_0xa6a2fe[_0x35b4('0x3c')][_0x35b4('0x3d')]!==_0x35b4('0x3e')){var _0x46a46b={};_0x46a46b[_0xa6a2fe[_0x35b4('0x3f')]]={'$like':'%'+_0xaecb39['query'][_0x35b4('0x40')]+'%'};return _0x46a46b;}})});}_0xc604f=_[_0x35b4('0x3a')]({},_0xc604f,_0xaecb39['options']);var _0x161182={'where':_0xc604f[_0x35b4('0x38')]};return db[_0x35b4('0x2b')][_0x35b4('0x41')](_0x161182)[_0x35b4('0x24')](function(_0x63d247){_0x4edd85[_0x35b4('0x41')]=_0x63d247;if(_0xaecb39[_0x35b4('0x2f')][_0x35b4('0x42')]){_0xc604f[_0x35b4('0x43')]=[{'all':!![]}];}return db[_0x35b4('0x2b')][_0x35b4('0x44')](_0xc604f);})[_0x35b4('0x24')](function(_0x149438){_0x4edd85[_0x35b4('0x45')]=_0x149438;return _0x4edd85;})['then'](respondWithFilteredResult(_0x3c416a,_0xc604f))[_0x35b4('0x46')](handleError(_0x3c416a,null));};exports[_0x35b4('0x47')]=function(_0x2eb2be,_0x1a416a){var _0x45dc80={'raw':!![],'where':{'id':_0x2eb2be['params']['id']}},_0x4ebaf8={};_0x4ebaf8['model']=_[_0x35b4('0x2e')](db[_0x35b4('0x2b')][_0x35b4('0x2c')]);_0x4ebaf8[_0x35b4('0x2f')]=_['keys'](_0x2eb2be[_0x35b4('0x2f')]);_0x4ebaf8[_0x35b4('0x30')]=_[_0x35b4('0x32')](_0x4ebaf8[_0x35b4('0x2d')],_0x4ebaf8[_0x35b4('0x2f')]);_0x45dc80[_0x35b4('0x31')]=_[_0x35b4('0x32')](_0x4ebaf8[_0x35b4('0x2d')],qs['fields'](_0x2eb2be[_0x35b4('0x2f')]['fields']));_0x45dc80[_0x35b4('0x31')]=_0x45dc80['attributes'][_0x35b4('0x34')]?_0x45dc80[_0x35b4('0x31')]:_0x4ebaf8[_0x35b4('0x2d')];if(_0x2eb2be[_0x35b4('0x2f')][_0x35b4('0x42')]){_0x45dc80[_0x35b4('0x43')]=[{'all':!![]}];}_0x45dc80=_['merge']({},_0x45dc80,_0x2eb2be['options']);return db[_0x35b4('0x2b')]['find'](_0x45dc80)[_0x35b4('0x24')](handleEntityNotFound(_0x1a416a,null))[_0x35b4('0x24')](respondWithResult(_0x1a416a,null))[_0x35b4('0x46')](handleError(_0x1a416a,null));};exports[_0x35b4('0x48')]=function(_0x3ab46e,_0x599bf0){return db[_0x35b4('0x2b')]['create'](_0x3ab46e[_0x35b4('0x49')],{})[_0x35b4('0x24')](respondWithResult(_0x599bf0,0xc9))[_0x35b4('0x46')](handleError(_0x599bf0,null));}; \ No newline at end of file diff --git a/server/api/saSalesCondition/saSalesCondition.model.js b/server/api/saSalesCondition/saSalesCondition.model.js index a3092a6..b4bec5b 100644 --- a/server/api/saSalesCondition/saSalesCondition.model.js +++ b/server/api/saSalesCondition/saSalesCondition.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4e3=['./saSalesCondition.attributes','exports','SASalesCondition','sa_sales_conditions','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x46f3f8,_0x12c74b){var _0xbc57cd=function(_0x34df37){while(--_0x34df37){_0x46f3f8['push'](_0x46f3f8['shift']());}};_0xbc57cd(++_0x12c74b);}(_0xd4e3,0x178));var _0x3d4e=function(_0x5c9274,_0x4e849b){_0x5c9274=_0x5c9274-0x0;var _0x1ef7d3=_0xd4e3[_0x5c9274];return _0x1ef7d3;};'use strict';var _=require('lodash');var util=require(_0x3d4e('0x0'));var logger=require(_0x3d4e('0x1'))('api');var moment=require(_0x3d4e('0x2'));var BPromise=require(_0x3d4e('0x3'));var rp=require(_0x3d4e('0x4'));var fs=require('fs');var path=require(_0x3d4e('0x5'));var rimraf=require(_0x3d4e('0x6'));var config=require(_0x3d4e('0x7'));var attributes=require(_0x3d4e('0x8'));module[_0x3d4e('0x9')]=function(_0x6baa87,_0x29e7a1){return _0x6baa87['define'](_0x3d4e('0xa'),attributes,{'tableName':_0x3d4e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92bc=['path','rimraf','../../config/environment','./saSalesCondition.attributes','exports','define','SASalesCondition','sa_sales_conditions','util','../../config/logger','api','moment','request-promise'];(function(_0x291166,_0x229134){var _0x49692b=function(_0x2bad23){while(--_0x2bad23){_0x291166['push'](_0x291166['shift']());}};_0x49692b(++_0x229134);}(_0x92bc,0x19b));var _0xc92b=function(_0x58873c,_0x2482c5){_0x58873c=_0x58873c-0x0;var _0x1f3711=_0x92bc[_0x58873c];return _0x1f3711;};'use strict';var _=require('lodash');var util=require(_0xc92b('0x0'));var logger=require(_0xc92b('0x1'))(_0xc92b('0x2'));var moment=require(_0xc92b('0x3'));var BPromise=require('bluebird');var rp=require(_0xc92b('0x4'));var fs=require('fs');var path=require(_0xc92b('0x5'));var rimraf=require(_0xc92b('0x6'));var config=require(_0xc92b('0x7'));var attributes=require(_0xc92b('0x8'));module[_0xc92b('0x9')]=function(_0x5bb080,_0x1bbb89){return _0x5bb080[_0xc92b('0xa')](_0xc92b('0xb'),attributes,{'tableName':_0xc92b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saSalesCondition/saSalesCondition.rpc.js b/server/api/saSalesCondition/saSalesCondition.rpc.js index da9255e..f361c13 100644 --- a/server/api/saSalesCondition/saSalesCondition.rpc.js +++ b/server/api/saSalesCondition/saSalesCondition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5cd9=['../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','info','request\x20sent','stringify','error','code','SASalesCondition,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xeaba4b,_0x1eab4b){var _0x32f4fd=function(_0x43ec5b){while(--_0x43ec5b){_0xeaba4b['push'](_0xeaba4b['shift']());}};_0x32f4fd(++_0x1eab4b);}(_0x5cd9,0xb7));var _0x95cd=function(_0x45ff1e,_0xdd16){_0x45ff1e=_0x45ff1e-0x0;var _0x16089a=_0x5cd9[_0x45ff1e];return _0x16089a;};'use strict';var _=require(_0x95cd('0x0'));var util=require(_0x95cd('0x1'));var moment=require(_0x95cd('0x2'));var BPromise=require(_0x95cd('0x3'));var rs=require(_0x95cd('0x4'));var fs=require('fs');var Redis=require(_0x95cd('0x5'));var db=require(_0x95cd('0x6'))['db'];var utils=require(_0x95cd('0x7'));var logger=require('../../config/logger')(_0x95cd('0x8'));var config=require(_0x95cd('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x95cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f115d,_0x489b6b,_0x1558a0){return new BPromise(function(_0x16045f,_0x21c0b8){return client['request'](_0x4f115d,_0x1558a0)[_0x95cd('0xb')](function(_0x2f499e){logger[_0x95cd('0xc')]('SASalesCondition,\x20%s,\x20%s',_0x489b6b,'request\x20sent');logger['debug']('SASalesCondition,\x20%s,\x20%s,\x20%s',_0x489b6b,_0x95cd('0xd'),JSON[_0x95cd('0xe')](_0x2f499e));if(_0x2f499e[_0x95cd('0xf')]){if(_0x2f499e['error'][_0x95cd('0x10')]===0x1f4){logger[_0x95cd('0xf')](_0x95cd('0x11'),_0x489b6b,_0x2f499e[_0x95cd('0xf')][_0x95cd('0x12')]);return _0x21c0b8(_0x2f499e[_0x95cd('0xf')][_0x95cd('0x12')]);}logger[_0x95cd('0xf')](_0x95cd('0x11'),_0x489b6b,_0x2f499e[_0x95cd('0xf')]['message']);return _0x16045f(_0x2f499e[_0x95cd('0xf')][_0x95cd('0x12')]);}else{logger[_0x95cd('0xc')](_0x95cd('0x11'),_0x489b6b,'request\x20sent');_0x16045f(_0x2f499e[_0x95cd('0x13')][_0x95cd('0x12')]);}})[_0x95cd('0x14')](function(_0x19a728){logger[_0x95cd('0xf')]('SASalesCondition,\x20%s,\x20%s',_0x489b6b,_0x19a728);_0x21c0b8(_0x19a728);});});} \ No newline at end of file +var _0x599e=['error','code','message','SASalesCondition,\x20%s,\x20%s','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request\x20sent','SASalesCondition,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x53142f,_0x1aebd4){var _0x4c232d=function(_0x29ff14){while(--_0x29ff14){_0x53142f['push'](_0x53142f['shift']());}};_0x4c232d(++_0x1aebd4);}(_0x599e,0x70));var _0xe599=function(_0x182891,_0x32eb2c){_0x182891=_0x182891-0x0;var _0x126505=_0x599e[_0x182891];return _0x126505;};'use strict';var _=require(_0xe599('0x0'));var util=require(_0xe599('0x1'));var moment=require(_0xe599('0x2'));var BPromise=require('bluebird');var rs=require(_0xe599('0x3'));var fs=require('fs');var Redis=require(_0xe599('0x4'));var db=require(_0xe599('0x5'))['db'];var utils=require(_0xe599('0x6'));var logger=require(_0xe599('0x7'))(_0xe599('0x8'));var config=require(_0xe599('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe599('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x183861,_0x2f3258,_0x13a909){return new BPromise(function(_0x10805c,_0xd312c3){return client['request'](_0x183861,_0x13a909)['then'](function(_0x5a20c0){logger['info']('SASalesCondition,\x20%s,\x20%s',_0x2f3258,_0xe599('0xb'));logger['debug'](_0xe599('0xc'),_0x2f3258,'request\x20sent',JSON[_0xe599('0xd')](_0x5a20c0));if(_0x5a20c0[_0xe599('0xe')]){if(_0x5a20c0[_0xe599('0xe')][_0xe599('0xf')]===0x1f4){logger['error']('SASalesCondition,\x20%s,\x20%s',_0x2f3258,_0x5a20c0[_0xe599('0xe')][_0xe599('0x10')]);return _0xd312c3(_0x5a20c0['error'][_0xe599('0x10')]);}logger['error'](_0xe599('0x11'),_0x2f3258,_0x5a20c0[_0xe599('0xe')][_0xe599('0x10')]);return _0x10805c(_0x5a20c0['error']['message']);}else{logger[_0xe599('0x12')](_0xe599('0x11'),_0x2f3258,_0xe599('0xb'));_0x10805c(_0x5a20c0[_0xe599('0x13')][_0xe599('0x10')]);}})[_0xe599('0x14')](function(_0x5ded3f){logger['error']('SASalesCondition,\x20%s,\x20%s',_0x2f3258,_0x5ded3f);_0xd312c3(_0x5ded3f);});});} \ No newline at end of file diff --git a/server/api/saTypeProduct/index.js b/server/api/saTypeProduct/index.js index 4b489cc..8980fcf 100644 --- a/server/api/saTypeProduct/index.js +++ b/server/api/saTypeProduct/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f96=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./saTypeProduct.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','update','delete','destroy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9f96,0x109));var _0x69f9=function(_0x13ffdb,_0x435287){_0x13ffdb=_0x13ffdb-0x0;var _0x33af1b=_0x9f96[_0x13ffdb];return _0x33af1b;};'use strict';var multer=require(_0x69f9('0x0'));var util=require(_0x69f9('0x1'));var path=require(_0x69f9('0x2'));var timeout=require(_0x69f9('0x3'));var express=require(_0x69f9('0x4'));var router=express[_0x69f9('0x5')]();var auth=require(_0x69f9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x69f9('0x7'));var controller=require(_0x69f9('0x8'));router['get']('/',auth[_0x69f9('0x9')](),controller[_0x69f9('0xa')]);router[_0x69f9('0xb')](_0x69f9('0xc'),auth[_0x69f9('0x9')](),controller[_0x69f9('0xd')]);router['get'](_0x69f9('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x69f9('0xf')]('/',auth[_0x69f9('0x9')](),controller[_0x69f9('0x10')]);router[_0x69f9('0x11')](_0x69f9('0xe'),auth['isAuthenticated'](),controller[_0x69f9('0x12')]);router[_0x69f9('0x13')](_0x69f9('0xe'),auth[_0x69f9('0x9')](),controller[_0x69f9('0x14')]);module[_0x69f9('0x15')]=router; \ No newline at end of file +var _0x0cf1=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./saTypeProduct.controller','get','isAuthenticated','/describe'];(function(_0x3c7d3f,_0x472d06){var _0x4d5ac0=function(_0x143202){while(--_0x143202){_0x3c7d3f['push'](_0x3c7d3f['shift']());}};_0x4d5ac0(++_0x472d06);}(_0x0cf1,0xe5));var _0x10cf=function(_0x299f13,_0x5e968a){_0x299f13=_0x299f13-0x0;var _0x1b2cf2=_0x0cf1[_0x299f13];return _0x1b2cf2;};'use strict';var multer=require(_0x10cf('0x0'));var util=require(_0x10cf('0x1'));var path=require(_0x10cf('0x2'));var timeout=require(_0x10cf('0x3'));var express=require('express');var router=express[_0x10cf('0x4')]();var auth=require(_0x10cf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x10cf('0x6'));var controller=require(_0x10cf('0x7'));router[_0x10cf('0x8')]('/',auth[_0x10cf('0x9')](),controller['index']);router['get'](_0x10cf('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x10cf('0xb'),auth[_0x10cf('0x9')](),controller[_0x10cf('0xc')]);router[_0x10cf('0xd')]('/',auth[_0x10cf('0x9')](),controller[_0x10cf('0xe')]);router[_0x10cf('0xf')](_0x10cf('0xb'),auth[_0x10cf('0x9')](),controller[_0x10cf('0x10')]);router[_0x10cf('0x11')](_0x10cf('0xb'),auth[_0x10cf('0x9')](),controller[_0x10cf('0x12')]);module[_0x10cf('0x13')]=router; \ No newline at end of file diff --git a/server/api/saTypeProduct/saTypeProduct.attributes.js b/server/api/saTypeProduct/saTypeProduct.attributes.js index a0ad860..d718341 100644 --- a/server/api/saTypeProduct/saTypeProduct.attributes.js +++ b/server/api/saTypeProduct/saTypeProduct.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8594=['exports','sequelize'];(function(_0x416cdc,_0x213b87){var _0x1931ce=function(_0x1dc762){while(--_0x1dc762){_0x416cdc['push'](_0x416cdc['shift']());}};_0x1931ce(++_0x213b87);}(_0x8594,0x141));var _0x4859=function(_0x76f957,_0xb4fd15){_0x76f957=_0x76f957-0x0;var _0x109ee=_0x8594[_0x76f957];return _0x109ee;};'use strict';var Sequelize=require(_0x4859('0x0'));module[_0x4859('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'}}; \ No newline at end of file +var _0x31c3=['name','sequelize','exports','STRING'];(function(_0x11d736,_0x3b4cd4){var _0x3888e2=function(_0x3bdb5a){while(--_0x3bdb5a){_0x11d736['push'](_0x11d736['shift']());}};_0x3888e2(++_0x3b4cd4);}(_0x31c3,0x79));var _0x331c=function(_0x317af6,_0x3b3535){_0x317af6=_0x317af6-0x0;var _0x5439f9=_0x31c3[_0x317af6];return _0x5439f9;};'use strict';var Sequelize=require(_0x331c('0x0'));module[_0x331c('0x1')]={'name':{'type':Sequelize[_0x331c('0x2')],'allowNull':![],'unique':_0x331c('0x3')}}; \ No newline at end of file diff --git a/server/api/saTypeProduct/saTypeProduct.controller.js b/server/api/saTypeProduct/saTypeProduct.controller.js index 9ddf563..762475b 100644 --- a/server/api/saTypeProduct/saTypeProduct.controller.js +++ b/server/api/saTypeProduct/saTypeProduct.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2903=['api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','SATypeProduct','rawAttributes','model','keys','query','filters','intersection','attributes','nolimit','order','sort','where','filter','merge','map','key','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2903,0x14a));var _0x3290=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x2903[_0x25e7cb];return _0x375d92;};'use strict';var pdf=require(_0x3290('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3290('0x1'));var zipdir=require(_0x3290('0x2'));var jsonpatch=require(_0x3290('0x3'));var rp=require(_0x3290('0x4'));var moment=require(_0x3290('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3290('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3290('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3290('0x8'));var crypto=require(_0x3290('0x9'));var jsforce=require(_0x3290('0xa'));var deskjs=require(_0x3290('0xb'));var toCsv=require(_0x3290('0xc'));var querystring=require(_0x3290('0xd'));var Papa=require(_0x3290('0xe'));var Redis=require(_0x3290('0xf'));var authService=require(_0x3290('0x10'));var qs=require(_0x3290('0x11'));var hardwareService=require(_0x3290('0x12'));var logger=require(_0x3290('0x13'))(_0x3290('0x14'));var utils=require('../../config/utils');var config=require(_0x3290('0x15'));var db=require(_0x3290('0x16'))['db'];function respondWithStatusCode(_0x2162fb,_0x330025){_0x330025=_0x330025||0xcc;return function(_0x15bc23){if(_0x15bc23){return _0x2162fb[_0x3290('0x17')](_0x330025);}return _0x2162fb[_0x3290('0x18')](_0x330025)[_0x3290('0x19')]();};}function respondWithResult(_0x243723,_0x2cca80){_0x2cca80=_0x2cca80||0xc8;return function(_0x849fea){if(_0x849fea){return _0x243723[_0x3290('0x18')](_0x2cca80)['json'](_0x849fea);}};}function respondWithFilteredResult(_0x38d8f8,_0x41a59b){return function(_0x24f6b2){if(_0x24f6b2){var _0x3a084c=_0x24f6b2[_0x3290('0x1a')],_0xd49fec=_0x41a59b[_0x3290('0x1b')],_0x472c79=_0x41a59b[_0x3290('0x1b')]+_0x41a59b[_0x3290('0x1c')],_0x92c270;if(_0x472c79>=_0x3a084c){_0x472c79=_0x3a084c;_0x92c270=0xc8;}else{_0x92c270=0xce;}_0x38d8f8[_0x3290('0x18')](_0x92c270);return _0x38d8f8['set'](_0x3290('0x1d'),_0xd49fec+'-'+_0x472c79+'/'+_0x3a084c)['json'](_0x24f6b2);}return null;};}function patchUpdates(_0x29a249){return function(_0x28d60c){try{jsonpatch[_0x3290('0x1e')](_0x28d60c,_0x29a249,!![]);}catch(_0x3c7384){return BPromise[_0x3290('0x1f')](_0x3c7384);}return _0x28d60c[_0x3290('0x20')]();};}function saveUpdates(_0x442607,_0x2d04e7){return function(_0x43e53f){if(_0x43e53f){return _0x43e53f[_0x3290('0x21')](_0x442607)[_0x3290('0x22')](function(_0xc7b306){return _0xc7b306;});}return null;};}function removeEntity(_0x5bbaad,_0xb37087){return function(_0x5da256){if(_0x5da256){return _0x5da256[_0x3290('0x23')]()[_0x3290('0x22')](function(){_0x5bbaad[_0x3290('0x18')](0xcc)[_0x3290('0x19')]();});}};}function handleEntityNotFound(_0x319e80,_0x1aa548){return function(_0x2aca72){if(!_0x2aca72){_0x319e80[_0x3290('0x17')](0x194);}return _0x2aca72;};}function handleError(_0x29b8d0,_0x32eb2c){_0x32eb2c=_0x32eb2c||0x1f4;return function(_0x470955){logger[_0x3290('0x24')](_0x470955[_0x3290('0x25')]);if(_0x470955[_0x3290('0x26')]){delete _0x470955[_0x3290('0x26')];}_0x29b8d0[_0x3290('0x18')](_0x32eb2c)[_0x3290('0x27')](_0x470955);};}exports['index']=function(_0x436e3e,_0x1c6521){var _0x3a4c6f={},_0x52a506={},_0x393e01={'count':0x0,'rows':[]};var _0x5b0351=db[_0x3290('0x28')][_0x3290('0x29')];_0x52a506[_0x3290('0x2a')]=_[_0x3290('0x2b')](_0x5b0351);_0x52a506[_0x3290('0x2c')]=_[_0x3290('0x2b')](_0x436e3e[_0x3290('0x2c')]);_0x52a506[_0x3290('0x2d')]=_[_0x3290('0x2e')](_0x52a506[_0x3290('0x2a')],_0x52a506['query']);_0x3a4c6f['attributes']=_[_0x3290('0x2e')](_0x52a506[_0x3290('0x2a')],qs['fields'](_0x436e3e[_0x3290('0x2c')]['fields']));_0x3a4c6f[_0x3290('0x2f')]=_0x3a4c6f[_0x3290('0x2f')]['length']?_0x3a4c6f[_0x3290('0x2f')]:_0x52a506['model'];if(!_0x436e3e[_0x3290('0x2c')]['hasOwnProperty'](_0x3290('0x30'))){_0x3a4c6f['limit']=qs[_0x3290('0x1c')](_0x436e3e[_0x3290('0x2c')][_0x3290('0x1c')]);_0x3a4c6f[_0x3290('0x1b')]=qs[_0x3290('0x1b')](_0x436e3e[_0x3290('0x2c')][_0x3290('0x1b')]);}_0x3a4c6f[_0x3290('0x31')]=qs['sort'](_0x436e3e['query'][_0x3290('0x32')]);_0x3a4c6f[_0x3290('0x33')]=qs['filters'](_['pick'](_0x436e3e[_0x3290('0x2c')],_0x52a506[_0x3290('0x2d')]));if(_0x436e3e[_0x3290('0x2c')][_0x3290('0x34')]){_0x3a4c6f[_0x3290('0x33')]=_[_0x3290('0x35')](_0x3a4c6f['where'],{'$or':_[_0x3290('0x36')](_0x5b0351,function(_0x1f38aa){if(_0x1f38aa['type'][_0x3290('0x37')]!==_0x3290('0x38')){var _0x533421={};_0x533421[_0x1f38aa['field']]={'$like':'%'+_0x436e3e[_0x3290('0x2c')][_0x3290('0x34')]+'%'};return _0x533421;}})});}_0x3a4c6f=_[_0x3290('0x35')]({},_0x3a4c6f,_0x436e3e[_0x3290('0x39')]);var _0x51fed1={'where':_0x3a4c6f['where']};return db['SATypeProduct'][_0x3290('0x1a')](_0x51fed1)[_0x3290('0x22')](function(_0x3ba1c3){_0x393e01[_0x3290('0x1a')]=_0x3ba1c3;if(_0x436e3e[_0x3290('0x2c')][_0x3290('0x3a')]){_0x3a4c6f['include']=[{'all':!![]}];}return db[_0x3290('0x28')][_0x3290('0x3b')](_0x3a4c6f);})[_0x3290('0x22')](function(_0x5cca29){_0x393e01[_0x3290('0x3c')]=_0x5cca29;return _0x393e01;})[_0x3290('0x22')](respondWithFilteredResult(_0x1c6521,_0x3a4c6f))[_0x3290('0x3d')](handleError(_0x1c6521,null));};exports[_0x3290('0x3e')]=function(_0x5be6f4,_0x449ad5){var _0x56b60d={'raw':![],'where':{'id':_0x5be6f4[_0x3290('0x3f')]['id']}},_0xef224={};_0xef224[_0x3290('0x2a')]=_[_0x3290('0x2b')](db[_0x3290('0x28')][_0x3290('0x29')]);_0xef224[_0x3290('0x2c')]=_[_0x3290('0x2b')](_0x5be6f4['query']);_0xef224['filters']=_[_0x3290('0x2e')](_0xef224[_0x3290('0x2a')],_0xef224['query']);_0x56b60d[_0x3290('0x2f')]=_[_0x3290('0x2e')](_0xef224[_0x3290('0x2a')],qs['fields'](_0x5be6f4[_0x3290('0x2c')]['fields']));_0x56b60d[_0x3290('0x2f')]=_0x56b60d[_0x3290('0x2f')][_0x3290('0x40')]?_0x56b60d[_0x3290('0x2f')]:_0xef224[_0x3290('0x2a')];if(_0x5be6f4[_0x3290('0x2c')][_0x3290('0x3a')]){_0x56b60d[_0x3290('0x41')]=[{'all':!![]}];}_0x56b60d=_['merge']({},_0x56b60d,_0x5be6f4[_0x3290('0x39')]);return db[_0x3290('0x28')][_0x3290('0x42')](_0x56b60d)[_0x3290('0x22')](handleEntityNotFound(_0x449ad5,null))['then'](respondWithResult(_0x449ad5,null))[_0x3290('0x3d')](handleError(_0x449ad5,null));};exports[_0x3290('0x43')]=function(_0x20598a,_0x51cd58){return db['SATypeProduct'][_0x3290('0x43')](_0x20598a['body'],{})[_0x3290('0x22')](respondWithResult(_0x51cd58,0xc9))[_0x3290('0x3d')](handleError(_0x51cd58,null));};exports[_0x3290('0x21')]=function(_0x43e48e,_0x5a87a4){if(_0x43e48e[_0x3290('0x44')]['id']){delete _0x43e48e['body']['id'];}return db[_0x3290('0x28')]['find']({'where':{'id':_0x43e48e[_0x3290('0x3f')]['id']}})[_0x3290('0x22')](handleEntityNotFound(_0x5a87a4,null))['then'](saveUpdates(_0x43e48e[_0x3290('0x44')],null))[_0x3290('0x22')](respondWithResult(_0x5a87a4,null))[_0x3290('0x3d')](handleError(_0x5a87a4,null));};exports[_0x3290('0x23')]=function(_0x4e6345,_0xa1aaf3){return db[_0x3290('0x28')][_0x3290('0x42')]({'where':{'id':_0x4e6345['params']['id']}})[_0x3290('0x22')](handleEntityNotFound(_0xa1aaf3,null))[_0x3290('0x22')](removeEntity(_0xa1aaf3,null))[_0x3290('0x3d')](handleError(_0xa1aaf3,null));};exports['describe']=function(_0x3bdb91,_0x580f09){return db[_0x3290('0x28')][_0x3290('0x45')]()['then'](respondWithResult(_0x580f09,null))[_0x3290('0x3d')](handleError(_0x580f09,null));}; \ No newline at end of file +var _0x463e=['mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','end','status','count','offset','limit','set','json','reject','save','update','then','destroy','sendStatus','error','send','index','SATypeProduct','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','map','type','key','includeAll','findAll','rows','catch','show','include','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x479691,_0x1002be){var _0x32a5c1=function(_0x2753f4){while(--_0x2753f4){_0x479691['push'](_0x479691['shift']());}};_0x32a5c1(++_0x1002be);}(_0x463e,0x110));var _0xe463=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x463e[_0x433a86];return _0x23000c;};'use strict';var pdf=require(_0xe463('0x0'));var emlformat=require(_0xe463('0x1'));var rimraf=require(_0xe463('0x2'));var zipdir=require(_0xe463('0x3'));var jsonpatch=require(_0xe463('0x4'));var rp=require(_0xe463('0x5'));var moment=require(_0xe463('0x6'));var BPromise=require(_0xe463('0x7'));var Mustache=require(_0xe463('0x8'));var util=require(_0xe463('0x9'));var path=require(_0xe463('0xa'));var sox=require('sox');var csv=require(_0xe463('0xb'));var ejs=require(_0xe463('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe463('0xd'));var crypto=require('crypto');var jsforce=require(_0xe463('0xe'));var deskjs=require(_0xe463('0xf'));var toCsv=require(_0xe463('0xb'));var querystring=require(_0xe463('0x10'));var Papa=require(_0xe463('0x11'));var Redis=require(_0xe463('0x12'));var authService=require(_0xe463('0x13'));var qs=require(_0xe463('0x14'));var hardwareService=require(_0xe463('0x15'));var logger=require(_0xe463('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xe463('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x231021,_0x5b319d){_0x5b319d=_0x5b319d||0xcc;return function(_0xe83304){if(_0xe83304){return _0x231021['sendStatus'](_0x5b319d);}return _0x231021['status'](_0x5b319d)[_0xe463('0x18')]();};}function respondWithResult(_0x385751,_0x33f16b){_0x33f16b=_0x33f16b||0xc8;return function(_0x3eb4d2){if(_0x3eb4d2){return _0x385751[_0xe463('0x19')](_0x33f16b)['json'](_0x3eb4d2);}};}function respondWithFilteredResult(_0x167ed0,_0x3b2532){return function(_0x50a4ee){if(_0x50a4ee){var _0x27c735=_0x50a4ee[_0xe463('0x1a')],_0x513e0f=_0x3b2532['offset'],_0x5cd86b=_0x3b2532[_0xe463('0x1b')]+_0x3b2532[_0xe463('0x1c')],_0x2ee37f;if(_0x5cd86b>=_0x27c735){_0x5cd86b=_0x27c735;_0x2ee37f=0xc8;}else{_0x2ee37f=0xce;}_0x167ed0[_0xe463('0x19')](_0x2ee37f);return _0x167ed0[_0xe463('0x1d')]('Content-Range',_0x513e0f+'-'+_0x5cd86b+'/'+_0x27c735)[_0xe463('0x1e')](_0x50a4ee);}return null;};}function patchUpdates(_0x519f16){return function(_0xef8e60){try{jsonpatch['apply'](_0xef8e60,_0x519f16,!![]);}catch(_0x57ef9a){return BPromise[_0xe463('0x1f')](_0x57ef9a);}return _0xef8e60[_0xe463('0x20')]();};}function saveUpdates(_0x270683,_0x2361a7){return function(_0x4573f1){if(_0x4573f1){return _0x4573f1[_0xe463('0x21')](_0x270683)[_0xe463('0x22')](function(_0x4a1a19){return _0x4a1a19;});}return null;};}function removeEntity(_0x5455c7,_0x2a62fc){return function(_0x2d59ec){if(_0x2d59ec){return _0x2d59ec[_0xe463('0x23')]()['then'](function(){_0x5455c7[_0xe463('0x19')](0xcc)[_0xe463('0x18')]();});}};}function handleEntityNotFound(_0x2f725f,_0x271db5){return function(_0x5db4d5){if(!_0x5db4d5){_0x2f725f[_0xe463('0x24')](0x194);}return _0x5db4d5;};}function handleError(_0x1b01dd,_0x331623){_0x331623=_0x331623||0x1f4;return function(_0x5c03d1){logger[_0xe463('0x25')](_0x5c03d1['stack']);if(_0x5c03d1['name']){delete _0x5c03d1['name'];}_0x1b01dd['status'](_0x331623)[_0xe463('0x26')](_0x5c03d1);};}exports[_0xe463('0x27')]=function(_0x43ed20,_0x3fe9b4){var _0x15ac6c={},_0x421999={},_0x205c11={'count':0x0,'rows':[]};var _0x1d2c38=db[_0xe463('0x28')][_0xe463('0x29')];_0x421999[_0xe463('0x2a')]=_[_0xe463('0x2b')](_0x1d2c38);_0x421999[_0xe463('0x2c')]=_['keys'](_0x43ed20[_0xe463('0x2c')]);_0x421999[_0xe463('0x2d')]=_[_0xe463('0x2e')](_0x421999[_0xe463('0x2a')],_0x421999['query']);_0x15ac6c['attributes']=_[_0xe463('0x2e')](_0x421999[_0xe463('0x2a')],qs[_0xe463('0x2f')](_0x43ed20[_0xe463('0x2c')][_0xe463('0x2f')]));_0x15ac6c[_0xe463('0x30')]=_0x15ac6c[_0xe463('0x30')][_0xe463('0x31')]?_0x15ac6c[_0xe463('0x30')]:_0x421999[_0xe463('0x2a')];if(!_0x43ed20['query'][_0xe463('0x32')]('nolimit')){_0x15ac6c['limit']=qs['limit'](_0x43ed20[_0xe463('0x2c')][_0xe463('0x1c')]);_0x15ac6c[_0xe463('0x1b')]=qs[_0xe463('0x1b')](_0x43ed20['query']['offset']);}_0x15ac6c[_0xe463('0x33')]=qs[_0xe463('0x34')](_0x43ed20[_0xe463('0x2c')][_0xe463('0x34')]);_0x15ac6c[_0xe463('0x35')]=qs[_0xe463('0x2d')](_['pick'](_0x43ed20[_0xe463('0x2c')],_0x421999[_0xe463('0x2d')]));if(_0x43ed20[_0xe463('0x2c')][_0xe463('0x36')]){_0x15ac6c[_0xe463('0x35')]=_[_0xe463('0x37')](_0x15ac6c[_0xe463('0x35')],{'$or':_[_0xe463('0x38')](_0x1d2c38,function(_0x453b36){if(_0x453b36[_0xe463('0x39')][_0xe463('0x3a')]!=='VIRTUAL'){var _0x3676d3={};_0x3676d3[_0x453b36['field']]={'$like':'%'+_0x43ed20[_0xe463('0x2c')]['filter']+'%'};return _0x3676d3;}})});}_0x15ac6c=_[_0xe463('0x37')]({},_0x15ac6c,_0x43ed20['options']);var _0xb694={'where':_0x15ac6c[_0xe463('0x35')]};return db[_0xe463('0x28')]['count'](_0xb694)['then'](function(_0x253943){_0x205c11[_0xe463('0x1a')]=_0x253943;if(_0x43ed20[_0xe463('0x2c')][_0xe463('0x3b')]){_0x15ac6c['include']=[{'all':!![]}];}return db[_0xe463('0x28')][_0xe463('0x3c')](_0x15ac6c);})[_0xe463('0x22')](function(_0x2c377e){_0x205c11[_0xe463('0x3d')]=_0x2c377e;return _0x205c11;})['then'](respondWithFilteredResult(_0x3fe9b4,_0x15ac6c))[_0xe463('0x3e')](handleError(_0x3fe9b4,null));};exports[_0xe463('0x3f')]=function(_0x46937b,_0x28b92f){var _0x2a087b={'raw':![],'where':{'id':_0x46937b['params']['id']}},_0x279396={};_0x279396['model']=_[_0xe463('0x2b')](db['SATypeProduct'][_0xe463('0x29')]);_0x279396[_0xe463('0x2c')]=_['keys'](_0x46937b[_0xe463('0x2c')]);_0x279396['filters']=_[_0xe463('0x2e')](_0x279396['model'],_0x279396['query']);_0x2a087b[_0xe463('0x30')]=_[_0xe463('0x2e')](_0x279396[_0xe463('0x2a')],qs[_0xe463('0x2f')](_0x46937b[_0xe463('0x2c')][_0xe463('0x2f')]));_0x2a087b[_0xe463('0x30')]=_0x2a087b[_0xe463('0x30')]['length']?_0x2a087b[_0xe463('0x30')]:_0x279396['model'];if(_0x46937b[_0xe463('0x2c')][_0xe463('0x3b')]){_0x2a087b[_0xe463('0x40')]=[{'all':!![]}];}_0x2a087b=_[_0xe463('0x37')]({},_0x2a087b,_0x46937b['options']);return db[_0xe463('0x28')][_0xe463('0x41')](_0x2a087b)['then'](handleEntityNotFound(_0x28b92f,null))['then'](respondWithResult(_0x28b92f,null))[_0xe463('0x3e')](handleError(_0x28b92f,null));};exports['create']=function(_0x128ee4,_0x57e82b){return db[_0xe463('0x28')][_0xe463('0x42')](_0x128ee4[_0xe463('0x43')],{})['then'](respondWithResult(_0x57e82b,0xc9))['catch'](handleError(_0x57e82b,null));};exports['update']=function(_0x20aa9b,_0x347b6d){if(_0x20aa9b[_0xe463('0x43')]['id']){delete _0x20aa9b[_0xe463('0x43')]['id'];}return db['SATypeProduct'][_0xe463('0x41')]({'where':{'id':_0x20aa9b['params']['id']}})[_0xe463('0x22')](handleEntityNotFound(_0x347b6d,null))['then'](saveUpdates(_0x20aa9b[_0xe463('0x43')],null))[_0xe463('0x22')](respondWithResult(_0x347b6d,null))['catch'](handleError(_0x347b6d,null));};exports[_0xe463('0x23')]=function(_0x478156,_0x5c3805){return db[_0xe463('0x28')][_0xe463('0x41')]({'where':{'id':_0x478156[_0xe463('0x44')]['id']}})['then'](handleEntityNotFound(_0x5c3805,null))['then'](removeEntity(_0x5c3805,null))[_0xe463('0x3e')](handleError(_0x5c3805,null));};exports['describe']=function(_0x34ce2a,_0x3b6749){return db[_0xe463('0x28')][_0xe463('0x45')]()[_0xe463('0x22')](respondWithResult(_0x3b6749,null))[_0xe463('0x3e')](handleError(_0x3b6749,null));}; \ No newline at end of file diff --git a/server/api/saTypeProduct/saTypeProduct.model.js b/server/api/saTypeProduct/saTypeProduct.model.js index 17be54e..b6dcae2 100644 --- a/server/api/saTypeProduct/saTypeProduct.model.js +++ b/server/api/saTypeProduct/saTypeProduct.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d32=['path','../../config/environment','./saTypeProduct.attributes','exports','define','SATypeProduct','sa_type_products','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4d32,0xe7));var _0x24d3=function(_0x5bb2e9,_0x2d3666){_0x5bb2e9=_0x5bb2e9-0x0;var _0xd073e8=_0x4d32[_0x5bb2e9];return _0xd073e8;};'use strict';var _=require(_0x24d3('0x0'));var util=require(_0x24d3('0x1'));var logger=require(_0x24d3('0x2'))(_0x24d3('0x3'));var moment=require(_0x24d3('0x4'));var BPromise=require(_0x24d3('0x5'));var rp=require(_0x24d3('0x6'));var fs=require('fs');var path=require(_0x24d3('0x7'));var rimraf=require('rimraf');var config=require(_0x24d3('0x8'));var attributes=require(_0x24d3('0x9'));module[_0x24d3('0xa')]=function(_0x580f6b,_0x6a8030){return _0x580f6b[_0x24d3('0xb')](_0x24d3('0xc'),attributes,{'tableName':_0x24d3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c66=['path','rimraf','./saTypeProduct.attributes','exports','define','SATypeProduct','lodash','moment','bluebird','request-promise'];(function(_0x5c39ed,_0x342bcc){var _0x1865e5=function(_0x59f0e6){while(--_0x59f0e6){_0x5c39ed['push'](_0x5c39ed['shift']());}};_0x1865e5(++_0x342bcc);}(_0x3c66,0x1d2));var _0x63c6=function(_0xda3489,_0x13d28a){_0xda3489=_0xda3489-0x0;var _0x3af347=_0x3c66[_0xda3489];return _0x3af347;};'use strict';var _=require(_0x63c6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x63c6('0x1'));var BPromise=require(_0x63c6('0x2'));var rp=require(_0x63c6('0x3'));var fs=require('fs');var path=require(_0x63c6('0x4'));var rimraf=require(_0x63c6('0x5'));var config=require('../../config/environment');var attributes=require(_0x63c6('0x6'));module[_0x63c6('0x7')]=function(_0x44d3c1,_0x5487db){return _0x44d3c1[_0x63c6('0x8')](_0x63c6('0x9'),attributes,{'tableName':'sa_type_products','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saTypeProduct/saTypeProduct.rpc.js b/server/api/saTypeProduct/saTypeProduct.rpc.js index b16d164..2c32df7 100644 --- a/server/api/saTypeProduct/saTypeProduct.rpc.js +++ b/server/api/saTypeProduct/saTypeProduct.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafef=['code','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','info','SATypeProduct,\x20%s,\x20%s','debug','SATypeProduct,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1ba82d,_0x14b659){var _0x209faa=function(_0x167774){while(--_0x167774){_0x1ba82d['push'](_0x1ba82d['shift']());}};_0x209faa(++_0x14b659);}(_0xafef,0xa3));var _0xfafe=function(_0x52b5ba,_0x3e241c){_0x52b5ba=_0x52b5ba-0x0;var _0x55d015=_0xafef[_0x52b5ba];return _0x55d015;};'use strict';var _=require(_0xfafe('0x0'));var util=require(_0xfafe('0x1'));var moment=require('moment');var BPromise=require(_0xfafe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfafe('0x3'));var db=require(_0xfafe('0x4'))['db'];var utils=require(_0xfafe('0x5'));var logger=require(_0xfafe('0x6'))(_0xfafe('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x28c59a,_0x4e4c33,_0x34940c){return new BPromise(function(_0x267627,_0x4b97c5){return client[_0xfafe('0x8')](_0x28c59a,_0x34940c)[_0xfafe('0x9')](function(_0x1ce77d){logger[_0xfafe('0xa')](_0xfafe('0xb'),_0x4e4c33,'request\x20sent');logger[_0xfafe('0xc')](_0xfafe('0xd'),_0x4e4c33,_0xfafe('0xe'),JSON[_0xfafe('0xf')](_0x1ce77d));if(_0x1ce77d[_0xfafe('0x10')]){if(_0x1ce77d[_0xfafe('0x10')][_0xfafe('0x11')]===0x1f4){logger[_0xfafe('0x10')](_0xfafe('0xb'),_0x4e4c33,_0x1ce77d[_0xfafe('0x10')][_0xfafe('0x12')]);return _0x4b97c5(_0x1ce77d[_0xfafe('0x10')]['message']);}logger[_0xfafe('0x10')](_0xfafe('0xb'),_0x4e4c33,_0x1ce77d[_0xfafe('0x10')]['message']);return _0x267627(_0x1ce77d[_0xfafe('0x10')][_0xfafe('0x12')]);}else{logger[_0xfafe('0xa')](_0xfafe('0xb'),_0x4e4c33,'request\x20sent');_0x267627(_0x1ce77d['result'][_0xfafe('0x12')]);}})[_0xfafe('0x13')](function(_0x710916){logger[_0xfafe('0x10')](_0xfafe('0xb'),_0x4e4c33,_0x710916);_0x4b97c5(_0x710916);});});} \ No newline at end of file +var _0xfa60=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','SATypeProduct,\x20%s,\x20%s,\x20%s','stringify','error','code','SATypeProduct,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x4c6ac6,_0x53395e){var _0x5501b8=function(_0x170cc3){while(--_0x170cc3){_0x4c6ac6['push'](_0x4c6ac6['shift']());}};_0x5501b8(++_0x53395e);}(_0xfa60,0x9d));var _0x0fa6=function(_0x30f8d6,_0x4d4233){_0x30f8d6=_0x30f8d6-0x0;var _0x27b834=_0xfa60[_0x30f8d6];return _0x27b834;};'use strict';var _=require(_0x0fa6('0x0'));var util=require(_0x0fa6('0x1'));var moment=require(_0x0fa6('0x2'));var BPromise=require(_0x0fa6('0x3'));var rs=require(_0x0fa6('0x4'));var fs=require('fs');var Redis=require(_0x0fa6('0x5'));var db=require(_0x0fa6('0x6'))['db'];var utils=require(_0x0fa6('0x7'));var logger=require(_0x0fa6('0x8'))(_0x0fa6('0x9'));var config=require(_0x0fa6('0xa'));var jayson=require(_0x0fa6('0xb'));var client=jayson[_0x0fa6('0xc')][_0x0fa6('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2af993,_0x359ec0,_0x429c18){return new BPromise(function(_0x38c1c3,_0x44e06f){return client[_0x0fa6('0xe')](_0x2af993,_0x429c18)[_0x0fa6('0xf')](function(_0x1fc9ea){logger['info']('SATypeProduct,\x20%s,\x20%s',_0x359ec0,_0x0fa6('0x10'));logger[_0x0fa6('0x11')](_0x0fa6('0x12'),_0x359ec0,_0x0fa6('0x10'),JSON[_0x0fa6('0x13')](_0x1fc9ea));if(_0x1fc9ea[_0x0fa6('0x14')]){if(_0x1fc9ea[_0x0fa6('0x14')][_0x0fa6('0x15')]===0x1f4){logger[_0x0fa6('0x14')](_0x0fa6('0x16'),_0x359ec0,_0x1fc9ea['error']['message']);return _0x44e06f(_0x1fc9ea['error'][_0x0fa6('0x17')]);}logger[_0x0fa6('0x14')](_0x0fa6('0x16'),_0x359ec0,_0x1fc9ea[_0x0fa6('0x14')][_0x0fa6('0x17')]);return _0x38c1c3(_0x1fc9ea[_0x0fa6('0x14')][_0x0fa6('0x17')]);}else{logger[_0x0fa6('0x18')]('SATypeProduct,\x20%s,\x20%s',_0x359ec0,_0x0fa6('0x10'));_0x38c1c3(_0x1fc9ea[_0x0fa6('0x19')][_0x0fa6('0x17')]);}})[_0x0fa6('0x1a')](function(_0x1f032b){logger[_0x0fa6('0x14')]('SATypeProduct,\x20%s,\x20%s',_0x359ec0,_0x1f032b);_0x44e06f(_0x1f032b);});});} \ No newline at end of file diff --git a/server/api/saUnitMeasure/index.js b/server/api/saUnitMeasure/index.js index a48008a..19933f2 100644 --- a/server/api/saUnitMeasure/index.js +++ b/server/api/saUnitMeasure/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc902=['put','update','delete','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','post','create'];(function(_0x3558c0,_0x29d479){var _0x284615=function(_0x46797d){while(--_0x46797d){_0x3558c0['push'](_0x3558c0['shift']());}};_0x284615(++_0x29d479);}(_0xc902,0xca));var _0x2c90=function(_0x1b686d,_0x1041bc){_0x1b686d=_0x1b686d-0x0;var _0x53bc15=_0xc902[_0x1b686d];return _0x53bc15;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2c90('0x0'));var timeout=require(_0x2c90('0x1'));var express=require(_0x2c90('0x2'));var router=express[_0x2c90('0x3')]();var auth=require(_0x2c90('0x4'));var interaction=require(_0x2c90('0x5'));var config=require(_0x2c90('0x6'));var controller=require('./saUnitMeasure.controller');router[_0x2c90('0x7')]('/',auth[_0x2c90('0x8')](),controller['index']);router[_0x2c90('0x7')](_0x2c90('0x9'),auth[_0x2c90('0x8')](),controller[_0x2c90('0xa')]);router[_0x2c90('0x7')](_0x2c90('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x2c90('0xc')]('/',auth['isAuthenticated'](),controller[_0x2c90('0xd')]);router[_0x2c90('0xe')](_0x2c90('0xb'),auth[_0x2c90('0x8')](),controller[_0x2c90('0xf')]);router[_0x2c90('0x10')](_0x2c90('0xb'),auth[_0x2c90('0x8')](),controller['destroy']);module[_0x2c90('0x11')]=router; \ No newline at end of file +var _0x326a=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./saUnitMeasure.controller','get','isAuthenticated','index','/describe','describe','show','post','put','update','delete','/:id'];(function(_0x5ea42f,_0x4ce3aa){var _0x2bbe33=function(_0x60ee04){while(--_0x60ee04){_0x5ea42f['push'](_0x5ea42f['shift']());}};_0x2bbe33(++_0x4ce3aa);}(_0x326a,0xe9));var _0xa326=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x326a[_0x13b8f3];return _0x1a6d06;};'use strict';var multer=require(_0xa326('0x0'));var util=require(_0xa326('0x1'));var path=require('path');var timeout=require(_0xa326('0x2'));var express=require(_0xa326('0x3'));var router=express[_0xa326('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa326('0x5'));var config=require(_0xa326('0x6'));var controller=require(_0xa326('0x7'));router[_0xa326('0x8')]('/',auth[_0xa326('0x9')](),controller[_0xa326('0xa')]);router[_0xa326('0x8')](_0xa326('0xb'),auth['isAuthenticated'](),controller[_0xa326('0xc')]);router[_0xa326('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xa326('0xd')]);router[_0xa326('0xe')]('/',auth[_0xa326('0x9')](),controller['create']);router[_0xa326('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xa326('0x10')]);router[_0xa326('0x11')](_0xa326('0x12'),auth[_0xa326('0x9')](),controller[_0xa326('0x13')]);module[_0xa326('0x14')]=router; \ No newline at end of file diff --git a/server/api/saUnitMeasure/saUnitMeasure.attributes.js b/server/api/saUnitMeasure/saUnitMeasure.attributes.js index 7ba3a2f..4b9a0a5 100644 --- a/server/api/saUnitMeasure/saUnitMeasure.attributes.js +++ b/server/api/saUnitMeasure/saUnitMeasure.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcba9=['exports','STRING','CHAR','abbreviation','sequelize'];(function(_0x294288,_0x3005db){var _0x3b0156=function(_0x52b138){while(--_0x52b138){_0x294288['push'](_0x294288['shift']());}};_0x3b0156(++_0x3005db);}(_0xcba9,0xcc));var _0x9cba=function(_0x44c4a3,_0x5a38fa){_0x44c4a3=_0x44c4a3-0x0;var _0x11982d=_0xcba9[_0x44c4a3];return _0x11982d;};'use strict';var Sequelize=require(_0x9cba('0x0'));module[_0x9cba('0x1')]={'name':{'type':Sequelize[_0x9cba('0x2')],'allowNull':![],'unique':'name'},'abbreviation':{'type':Sequelize[_0x9cba('0x3')](0x3),'allowNull':![],'unique':_0x9cba('0x4')}}; \ No newline at end of file +var _0x4a1e=['sequelize','exports','name','CHAR','abbreviation'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x4a1e,0x131));var _0xe4a1=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x4a1e[_0x29b609];return _0x54c952;};'use strict';var Sequelize=require(_0xe4a1('0x0'));module[_0xe4a1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe4a1('0x2')},'abbreviation':{'type':Sequelize[_0xe4a1('0x3')](0x3),'allowNull':![],'unique':_0xe4a1('0x4')}}; \ No newline at end of file diff --git a/server/api/saUnitMeasure/saUnitMeasure.controller.js b/server/api/saUnitMeasure/saUnitMeasure.controller.js index ebea979..84fc6a8 100644 --- a/server/api/saUnitMeasure/saUnitMeasure.controller.js +++ b/server/api/saUnitMeasure/saUnitMeasure.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x22c9=['SAUnitMeasure','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','key','VIRTUAL','options','includeAll','rows','show','include','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','api','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index'];(function(_0x195176,_0x92239d){var _0x2c38dc=function(_0x3d294d){while(--_0x3d294d){_0x195176['push'](_0x195176['shift']());}};_0x2c38dc(++_0x92239d);}(_0x22c9,0x126));var _0x922c=function(_0x2e0d05,_0x268558){_0x2e0d05=_0x2e0d05-0x0;var _0x5480f8=_0x22c9[_0x2e0d05];return _0x5480f8;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x922c('0x0'));var zipdir=require(_0x922c('0x1'));var jsonpatch=require(_0x922c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x922c('0x3'));var Mustache=require(_0x922c('0x4'));var util=require(_0x922c('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x922c('0x6'));var ejs=require(_0x922c('0x7'));var fs=require('fs');var _=require(_0x922c('0x8'));var squel=require(_0x922c('0x9'));var crypto=require(_0x922c('0xa'));var jsforce=require(_0x922c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x922c('0x6'));var querystring=require(_0x922c('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x922c('0xd'));var qs=require(_0x922c('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x922c('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x922c('0x10'))['db'];function respondWithStatusCode(_0x23b610,_0x2872da){_0x2872da=_0x2872da||0xcc;return function(_0xcb8ffe){if(_0xcb8ffe){return _0x23b610[_0x922c('0x11')](_0x2872da);}return _0x23b610['status'](_0x2872da)[_0x922c('0x12')]();};}function respondWithResult(_0x243764,_0x3e802e){_0x3e802e=_0x3e802e||0xc8;return function(_0x1c8f5f){if(_0x1c8f5f){return _0x243764[_0x922c('0x13')](_0x3e802e)[_0x922c('0x14')](_0x1c8f5f);}};}function respondWithFilteredResult(_0x3b12c8,_0x7b6485){return function(_0x3fb068){if(_0x3fb068){var _0x1c5e33=_0x3fb068[_0x922c('0x15')],_0x3b7f2c=_0x7b6485[_0x922c('0x16')],_0x259216=_0x7b6485[_0x922c('0x16')]+_0x7b6485[_0x922c('0x17')],_0x400a84;if(_0x259216>=_0x1c5e33){_0x259216=_0x1c5e33;_0x400a84=0xc8;}else{_0x400a84=0xce;}_0x3b12c8[_0x922c('0x13')](_0x400a84);return _0x3b12c8[_0x922c('0x18')](_0x922c('0x19'),_0x3b7f2c+'-'+_0x259216+'/'+_0x1c5e33)[_0x922c('0x14')](_0x3fb068);}return null;};}function patchUpdates(_0x4582c7){return function(_0x22f7df){try{jsonpatch[_0x922c('0x1a')](_0x22f7df,_0x4582c7,!![]);}catch(_0x10cec3){return BPromise[_0x922c('0x1b')](_0x10cec3);}return _0x22f7df[_0x922c('0x1c')]();};}function saveUpdates(_0x5bde88,_0x3e795b){return function(_0x3a8b62){if(_0x3a8b62){return _0x3a8b62[_0x922c('0x1d')](_0x5bde88)[_0x922c('0x1e')](function(_0x5724b3){return _0x5724b3;});}return null;};}function removeEntity(_0x132f38,_0x506f39){return function(_0x5e0e1e){if(_0x5e0e1e){return _0x5e0e1e[_0x922c('0x1f')]()[_0x922c('0x1e')](function(){_0x132f38[_0x922c('0x13')](0xcc)[_0x922c('0x12')]();});}};}function handleEntityNotFound(_0x4a4d86,_0x405476){return function(_0xbc8b15){if(!_0xbc8b15){_0x4a4d86[_0x922c('0x11')](0x194);}return _0xbc8b15;};}function handleError(_0x27fb64,_0x563397){_0x563397=_0x563397||0x1f4;return function(_0x110d42){logger[_0x922c('0x20')](_0x110d42['stack']);if(_0x110d42[_0x922c('0x21')]){delete _0x110d42[_0x922c('0x21')];}_0x27fb64[_0x922c('0x13')](_0x563397)[_0x922c('0x22')](_0x110d42);};}exports[_0x922c('0x23')]=function(_0x1fa4d5,_0x517898){var _0x48e363={},_0x2c0cd2={},_0x1d2416={'count':0x0,'rows':[]};var _0x3223c7=db[_0x922c('0x24')][_0x922c('0x25')];_0x2c0cd2[_0x922c('0x26')]=_[_0x922c('0x27')](_0x3223c7);_0x2c0cd2[_0x922c('0x28')]=_[_0x922c('0x27')](_0x1fa4d5[_0x922c('0x28')]);_0x2c0cd2[_0x922c('0x29')]=_[_0x922c('0x2a')](_0x2c0cd2[_0x922c('0x26')],_0x2c0cd2[_0x922c('0x28')]);_0x48e363[_0x922c('0x2b')]=_[_0x922c('0x2a')](_0x2c0cd2[_0x922c('0x26')],qs[_0x922c('0x2c')](_0x1fa4d5[_0x922c('0x28')][_0x922c('0x2c')]));_0x48e363[_0x922c('0x2b')]=_0x48e363[_0x922c('0x2b')][_0x922c('0x2d')]?_0x48e363[_0x922c('0x2b')]:_0x2c0cd2['model'];if(!_0x1fa4d5[_0x922c('0x28')][_0x922c('0x2e')](_0x922c('0x2f'))){_0x48e363['limit']=qs[_0x922c('0x17')](_0x1fa4d5['query']['limit']);_0x48e363[_0x922c('0x16')]=qs[_0x922c('0x16')](_0x1fa4d5[_0x922c('0x28')]['offset']);}_0x48e363['order']=qs['sort'](_0x1fa4d5[_0x922c('0x28')][_0x922c('0x30')]);_0x48e363['where']=qs[_0x922c('0x29')](_[_0x922c('0x31')](_0x1fa4d5[_0x922c('0x28')],_0x2c0cd2[_0x922c('0x29')]));if(_0x1fa4d5[_0x922c('0x28')][_0x922c('0x32')]){_0x48e363[_0x922c('0x33')]=_[_0x922c('0x34')](_0x48e363[_0x922c('0x33')],{'$or':_['map'](_0x3223c7,function(_0x3b636b){if(_0x3b636b[_0x922c('0x35')][_0x922c('0x36')]!==_0x922c('0x37')){var _0x360a7e={};_0x360a7e[_0x3b636b['field']]={'$like':'%'+_0x1fa4d5[_0x922c('0x28')][_0x922c('0x32')]+'%'};return _0x360a7e;}})});}_0x48e363=_['merge']({},_0x48e363,_0x1fa4d5[_0x922c('0x38')]);var _0x3e02ee={'where':_0x48e363['where']};return db['SAUnitMeasure']['count'](_0x3e02ee)['then'](function(_0x412e1d){_0x1d2416[_0x922c('0x15')]=_0x412e1d;if(_0x1fa4d5[_0x922c('0x28')][_0x922c('0x39')]){_0x48e363['include']=[{'all':!![]}];}return db[_0x922c('0x24')]['findAll'](_0x48e363);})[_0x922c('0x1e')](function(_0x566828){_0x1d2416[_0x922c('0x3a')]=_0x566828;return _0x1d2416;})['then'](respondWithFilteredResult(_0x517898,_0x48e363))['catch'](handleError(_0x517898,null));};exports[_0x922c('0x3b')]=function(_0x38cf0f,_0x15426b){var _0x38b605={'raw':![],'where':{'id':_0x38cf0f['params']['id']}},_0x2c7f94={};_0x2c7f94[_0x922c('0x26')]=_['keys'](db[_0x922c('0x24')][_0x922c('0x25')]);_0x2c7f94[_0x922c('0x28')]=_['keys'](_0x38cf0f['query']);_0x2c7f94[_0x922c('0x29')]=_[_0x922c('0x2a')](_0x2c7f94[_0x922c('0x26')],_0x2c7f94[_0x922c('0x28')]);_0x38b605[_0x922c('0x2b')]=_[_0x922c('0x2a')](_0x2c7f94['model'],qs[_0x922c('0x2c')](_0x38cf0f[_0x922c('0x28')][_0x922c('0x2c')]));_0x38b605[_0x922c('0x2b')]=_0x38b605[_0x922c('0x2b')][_0x922c('0x2d')]?_0x38b605['attributes']:_0x2c7f94[_0x922c('0x26')];if(_0x38cf0f['query'][_0x922c('0x39')]){_0x38b605[_0x922c('0x3c')]=[{'all':!![]}];}_0x38b605=_[_0x922c('0x34')]({},_0x38b605,_0x38cf0f[_0x922c('0x38')]);return db['SAUnitMeasure'][_0x922c('0x3d')](_0x38b605)['then'](handleEntityNotFound(_0x15426b,null))['then'](respondWithResult(_0x15426b,null))[_0x922c('0x3e')](handleError(_0x15426b,null));};exports['create']=function(_0x20b57b,_0x200225){return db['SAUnitMeasure'][_0x922c('0x3f')](_0x20b57b[_0x922c('0x40')],{})[_0x922c('0x1e')](respondWithResult(_0x200225,0xc9))['catch'](handleError(_0x200225,null));};exports['update']=function(_0x5da266,_0x5e641a){if(_0x5da266[_0x922c('0x40')]['id']){delete _0x5da266[_0x922c('0x40')]['id'];}return db[_0x922c('0x24')][_0x922c('0x3d')]({'where':{'id':_0x5da266['params']['id']}})[_0x922c('0x1e')](handleEntityNotFound(_0x5e641a,null))[_0x922c('0x1e')](saveUpdates(_0x5da266[_0x922c('0x40')],null))['then'](respondWithResult(_0x5e641a,null))[_0x922c('0x3e')](handleError(_0x5e641a,null));};exports[_0x922c('0x1f')]=function(_0x39b399,_0x41bc72){return db[_0x922c('0x24')]['find']({'where':{'id':_0x39b399['params']['id']}})[_0x922c('0x1e')](handleEntityNotFound(_0x41bc72,null))[_0x922c('0x1e')](removeEntity(_0x41bc72,null))[_0x922c('0x3e')](handleError(_0x41bc72,null));};exports[_0x922c('0x41')]=function(_0x597cc7,_0x45236f){return db[_0x922c('0x24')][_0x922c('0x41')]()[_0x922c('0x1e')](respondWithResult(_0x45236f,null))[_0x922c('0x3e')](handleError(_0x45236f,null));}; \ No newline at end of file +var _0xe30f=['save','update','then','destroy','sendStatus','stack','name','send','index','SAUnitMeasure','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','field','includeAll','rows','catch','show','params','include','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','set','Content-Range','apply','reject'];(function(_0x50bd78,_0x18d349){var _0x170d7b=function(_0x38fa39){while(--_0x38fa39){_0x50bd78['push'](_0x50bd78['shift']());}};_0x170d7b(++_0x18d349);}(_0xe30f,0x1de));var _0xfe30=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xe30f[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfe30('0x0'));var rimraf=require(_0xfe30('0x1'));var zipdir=require(_0xfe30('0x2'));var jsonpatch=require(_0xfe30('0x3'));var rp=require('request-promise');var moment=require(_0xfe30('0x4'));var BPromise=require(_0xfe30('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfe30('0x6'));var sox=require(_0xfe30('0x7'));var csv=require(_0xfe30('0x8'));var ejs=require(_0xfe30('0x9'));var fs=require('fs');var _=require(_0xfe30('0xa'));var squel=require(_0xfe30('0xb'));var crypto=require(_0xfe30('0xc'));var jsforce=require(_0xfe30('0xd'));var deskjs=require(_0xfe30('0xe'));var toCsv=require(_0xfe30('0x8'));var querystring=require(_0xfe30('0xf'));var Papa=require(_0xfe30('0x10'));var Redis=require('ioredis');var authService=require(_0xfe30('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xfe30('0x12'));var logger=require(_0xfe30('0x13'))(_0xfe30('0x14'));var utils=require(_0xfe30('0x15'));var config=require(_0xfe30('0x16'));var db=require(_0xfe30('0x17'))['db'];function respondWithStatusCode(_0x26c174,_0x7ec162){_0x7ec162=_0x7ec162||0xcc;return function(_0x4c2e8d){if(_0x4c2e8d){return _0x26c174['sendStatus'](_0x7ec162);}return _0x26c174['status'](_0x7ec162)[_0xfe30('0x18')]();};}function respondWithResult(_0x4e6891,_0x3be9d){_0x3be9d=_0x3be9d||0xc8;return function(_0x2c4981){if(_0x2c4981){return _0x4e6891[_0xfe30('0x19')](_0x3be9d)[_0xfe30('0x1a')](_0x2c4981);}};}function respondWithFilteredResult(_0x2d6d23,_0x347b0c){return function(_0xd7bff7){if(_0xd7bff7){var _0x46cf80=_0xd7bff7[_0xfe30('0x1b')],_0x1b9691=_0x347b0c[_0xfe30('0x1c')],_0xdbe386=_0x347b0c[_0xfe30('0x1c')]+_0x347b0c['limit'],_0x17ba33;if(_0xdbe386>=_0x46cf80){_0xdbe386=_0x46cf80;_0x17ba33=0xc8;}else{_0x17ba33=0xce;}_0x2d6d23[_0xfe30('0x19')](_0x17ba33);return _0x2d6d23[_0xfe30('0x1d')](_0xfe30('0x1e'),_0x1b9691+'-'+_0xdbe386+'/'+_0x46cf80)[_0xfe30('0x1a')](_0xd7bff7);}return null;};}function patchUpdates(_0x47cbb){return function(_0x565422){try{jsonpatch[_0xfe30('0x1f')](_0x565422,_0x47cbb,!![]);}catch(_0x1f2223){return BPromise[_0xfe30('0x20')](_0x1f2223);}return _0x565422[_0xfe30('0x21')]();};}function saveUpdates(_0x2d5f96,_0x2a09cb){return function(_0x11e7e8){if(_0x11e7e8){return _0x11e7e8[_0xfe30('0x22')](_0x2d5f96)[_0xfe30('0x23')](function(_0x45f452){return _0x45f452;});}return null;};}function removeEntity(_0x46dec4,_0x26df6f){return function(_0x563be3){if(_0x563be3){return _0x563be3[_0xfe30('0x24')]()[_0xfe30('0x23')](function(){_0x46dec4[_0xfe30('0x19')](0xcc)[_0xfe30('0x18')]();});}};}function handleEntityNotFound(_0x1783ba,_0x2f5d0e){return function(_0x58a16b){if(!_0x58a16b){_0x1783ba[_0xfe30('0x25')](0x194);}return _0x58a16b;};}function handleError(_0x4371c1,_0x16e18c){_0x16e18c=_0x16e18c||0x1f4;return function(_0x24a7c8){logger['error'](_0x24a7c8[_0xfe30('0x26')]);if(_0x24a7c8[_0xfe30('0x27')]){delete _0x24a7c8['name'];}_0x4371c1[_0xfe30('0x19')](_0x16e18c)[_0xfe30('0x28')](_0x24a7c8);};}exports[_0xfe30('0x29')]=function(_0x5d62f7,_0x57f9a5){var _0x252f1a={},_0x32face={},_0x48dfe7={'count':0x0,'rows':[]};var _0x3a1ee7=db[_0xfe30('0x2a')][_0xfe30('0x2b')];_0x32face[_0xfe30('0x2c')]=_[_0xfe30('0x2d')](_0x3a1ee7);_0x32face['query']=_[_0xfe30('0x2d')](_0x5d62f7[_0xfe30('0x2e')]);_0x32face[_0xfe30('0x2f')]=_[_0xfe30('0x30')](_0x32face['model'],_0x32face[_0xfe30('0x2e')]);_0x252f1a[_0xfe30('0x31')]=_[_0xfe30('0x30')](_0x32face[_0xfe30('0x2c')],qs['fields'](_0x5d62f7[_0xfe30('0x2e')][_0xfe30('0x32')]));_0x252f1a['attributes']=_0x252f1a[_0xfe30('0x31')][_0xfe30('0x33')]?_0x252f1a['attributes']:_0x32face[_0xfe30('0x2c')];if(!_0x5d62f7['query']['hasOwnProperty'](_0xfe30('0x34'))){_0x252f1a[_0xfe30('0x35')]=qs[_0xfe30('0x35')](_0x5d62f7[_0xfe30('0x2e')][_0xfe30('0x35')]);_0x252f1a['offset']=qs[_0xfe30('0x1c')](_0x5d62f7['query'][_0xfe30('0x1c')]);}_0x252f1a[_0xfe30('0x36')]=qs[_0xfe30('0x37')](_0x5d62f7['query'][_0xfe30('0x37')]);_0x252f1a[_0xfe30('0x38')]=qs['filters'](_['pick'](_0x5d62f7[_0xfe30('0x2e')],_0x32face['filters']));if(_0x5d62f7[_0xfe30('0x2e')][_0xfe30('0x39')]){_0x252f1a[_0xfe30('0x38')]=_[_0xfe30('0x3a')](_0x252f1a['where'],{'$or':_['map'](_0x3a1ee7,function(_0x1f39e3){if(_0x1f39e3[_0xfe30('0x3b')]['key']!==_0xfe30('0x3c')){var _0x2e0170={};_0x2e0170[_0x1f39e3[_0xfe30('0x3d')]]={'$like':'%'+_0x5d62f7[_0xfe30('0x2e')][_0xfe30('0x39')]+'%'};return _0x2e0170;}})});}_0x252f1a=_[_0xfe30('0x3a')]({},_0x252f1a,_0x5d62f7['options']);var _0x22da9d={'where':_0x252f1a[_0xfe30('0x38')]};return db[_0xfe30('0x2a')][_0xfe30('0x1b')](_0x22da9d)[_0xfe30('0x23')](function(_0x3151e1){_0x48dfe7[_0xfe30('0x1b')]=_0x3151e1;if(_0x5d62f7[_0xfe30('0x2e')][_0xfe30('0x3e')]){_0x252f1a['include']=[{'all':!![]}];}return db[_0xfe30('0x2a')]['findAll'](_0x252f1a);})['then'](function(_0x14259f){_0x48dfe7[_0xfe30('0x3f')]=_0x14259f;return _0x48dfe7;})[_0xfe30('0x23')](respondWithFilteredResult(_0x57f9a5,_0x252f1a))[_0xfe30('0x40')](handleError(_0x57f9a5,null));};exports[_0xfe30('0x41')]=function(_0x364a95,_0x2fc119){var _0x29d663={'raw':![],'where':{'id':_0x364a95[_0xfe30('0x42')]['id']}},_0x2bbf1d={};_0x2bbf1d[_0xfe30('0x2c')]=_['keys'](db[_0xfe30('0x2a')][_0xfe30('0x2b')]);_0x2bbf1d[_0xfe30('0x2e')]=_[_0xfe30('0x2d')](_0x364a95[_0xfe30('0x2e')]);_0x2bbf1d[_0xfe30('0x2f')]=_[_0xfe30('0x30')](_0x2bbf1d[_0xfe30('0x2c')],_0x2bbf1d['query']);_0x29d663[_0xfe30('0x31')]=_[_0xfe30('0x30')](_0x2bbf1d['model'],qs[_0xfe30('0x32')](_0x364a95[_0xfe30('0x2e')][_0xfe30('0x32')]));_0x29d663[_0xfe30('0x31')]=_0x29d663[_0xfe30('0x31')]['length']?_0x29d663[_0xfe30('0x31')]:_0x2bbf1d[_0xfe30('0x2c')];if(_0x364a95[_0xfe30('0x2e')][_0xfe30('0x3e')]){_0x29d663[_0xfe30('0x43')]=[{'all':!![]}];}_0x29d663=_[_0xfe30('0x3a')]({},_0x29d663,_0x364a95[_0xfe30('0x44')]);return db[_0xfe30('0x2a')]['find'](_0x29d663)[_0xfe30('0x23')](handleEntityNotFound(_0x2fc119,null))[_0xfe30('0x23')](respondWithResult(_0x2fc119,null))[_0xfe30('0x40')](handleError(_0x2fc119,null));};exports[_0xfe30('0x45')]=function(_0x2af8ac,_0x161971){return db[_0xfe30('0x2a')][_0xfe30('0x45')](_0x2af8ac[_0xfe30('0x46')],{})[_0xfe30('0x23')](respondWithResult(_0x161971,0xc9))[_0xfe30('0x40')](handleError(_0x161971,null));};exports[_0xfe30('0x22')]=function(_0x352e39,_0x293336){if(_0x352e39['body']['id']){delete _0x352e39[_0xfe30('0x46')]['id'];}return db[_0xfe30('0x2a')][_0xfe30('0x47')]({'where':{'id':_0x352e39[_0xfe30('0x42')]['id']}})['then'](handleEntityNotFound(_0x293336,null))['then'](saveUpdates(_0x352e39['body'],null))[_0xfe30('0x23')](respondWithResult(_0x293336,null))[_0xfe30('0x40')](handleError(_0x293336,null));};exports[_0xfe30('0x24')]=function(_0x385791,_0x3a2587){return db['SAUnitMeasure'][_0xfe30('0x47')]({'where':{'id':_0x385791[_0xfe30('0x42')]['id']}})['then'](handleEntityNotFound(_0x3a2587,null))[_0xfe30('0x23')](removeEntity(_0x3a2587,null))[_0xfe30('0x40')](handleError(_0x3a2587,null));};exports[_0xfe30('0x48')]=function(_0x280adc,_0xe2742e){return db[_0xfe30('0x2a')][_0xfe30('0x48')]()[_0xfe30('0x23')](respondWithResult(_0xe2742e,null))['catch'](handleError(_0xe2742e,null));}; \ No newline at end of file diff --git a/server/api/saUnitMeasure/saUnitMeasure.model.js b/server/api/saUnitMeasure/saUnitMeasure.model.js index 331a278..5913ee2 100644 --- a/server/api/saUnitMeasure/saUnitMeasure.model.js +++ b/server/api/saUnitMeasure/saUnitMeasure.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4307=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','SAUnitMeasure','util'];(function(_0x65cd03,_0x2913ee){var _0x21c579=function(_0xee6ad4){while(--_0xee6ad4){_0x65cd03['push'](_0x65cd03['shift']());}};_0x21c579(++_0x2913ee);}(_0x4307,0xb3));var _0x7430=function(_0x49aeea,_0x2d316c){_0x49aeea=_0x49aeea-0x0;var _0xf26a17=_0x4307[_0x49aeea];return _0xf26a17;};'use strict';var _=require('lodash');var util=require(_0x7430('0x0'));var logger=require(_0x7430('0x1'))(_0x7430('0x2'));var moment=require(_0x7430('0x3'));var BPromise=require(_0x7430('0x4'));var rp=require(_0x7430('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7430('0x6'));var attributes=require('./saUnitMeasure.attributes');module[_0x7430('0x7')]=function(_0x4fc9ae,_0x1c2d9d){return _0x4fc9ae['define'](_0x7430('0x8'),attributes,{'tableName':'sa_unit_measures','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd80=['SAUnitMeasure','sa_unit_measures','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./saUnitMeasure.attributes','exports','define'];(function(_0x2d571e,_0xcc0df3){var _0x3a73b9=function(_0x567573){while(--_0x567573){_0x2d571e['push'](_0x2d571e['shift']());}};_0x3a73b9(++_0xcc0df3);}(_0xdd80,0x147));var _0x0dd8=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xdd80[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x0dd8('0x0'));var util=require(_0x0dd8('0x1'));var logger=require(_0x0dd8('0x2'))('api');var moment=require(_0x0dd8('0x3'));var BPromise=require(_0x0dd8('0x4'));var rp=require(_0x0dd8('0x5'));var fs=require('fs');var path=require(_0x0dd8('0x6'));var rimraf=require('rimraf');var config=require(_0x0dd8('0x7'));var attributes=require(_0x0dd8('0x8'));module[_0x0dd8('0x9')]=function(_0x26ead4,_0x59c568){return _0x26ead4[_0x0dd8('0xa')](_0x0dd8('0xb'),attributes,{'tableName':_0x0dd8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saUnitMeasure/saUnitMeasure.rpc.js b/server/api/saUnitMeasure/saUnitMeasure.rpc.js index 4b23fca..1adeb2f 100644 --- a/server/api/saUnitMeasure/saUnitMeasure.rpc.js +++ b/server/api/saUnitMeasure/saUnitMeasure.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe26c=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SAUnitMeasure,\x20%s,\x20%s','request\x20sent','SAUnitMeasure,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2416b2,_0x134439){var _0x159c30=function(_0x2e335c){while(--_0x2e335c){_0x2416b2['push'](_0x2416b2['shift']());}};_0x159c30(++_0x134439);}(_0xe26c,0x71));var _0xce26=function(_0x4d9911,_0x412b9c){_0x4d9911=_0x4d9911-0x0;var _0x5982fe=_0xe26c[_0x4d9911];return _0x5982fe;};'use strict';var _=require(_0xce26('0x0'));var util=require(_0xce26('0x1'));var moment=require(_0xce26('0x2'));var BPromise=require(_0xce26('0x3'));var rs=require(_0xce26('0x4'));var fs=require('fs');var Redis=require(_0xce26('0x5'));var db=require(_0xce26('0x6'))['db'];var utils=require(_0xce26('0x7'));var logger=require(_0xce26('0x8'))(_0xce26('0x9'));var config=require(_0xce26('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xce26('0xb')][_0xce26('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x13fd05,_0x3c9293,_0x427fee){return new BPromise(function(_0x26b094,_0x4a8d36){return client[_0xce26('0xd')](_0x13fd05,_0x427fee)[_0xce26('0xe')](function(_0x17a005){logger[_0xce26('0xf')](_0xce26('0x10'),_0x3c9293,_0xce26('0x11'));logger['debug'](_0xce26('0x12'),_0x3c9293,'request\x20sent',JSON[_0xce26('0x13')](_0x17a005));if(_0x17a005[_0xce26('0x14')]){if(_0x17a005['error'][_0xce26('0x15')]===0x1f4){logger['error'](_0xce26('0x10'),_0x3c9293,_0x17a005[_0xce26('0x14')]['message']);return _0x4a8d36(_0x17a005[_0xce26('0x14')][_0xce26('0x16')]);}logger['error'](_0xce26('0x10'),_0x3c9293,_0x17a005['error'][_0xce26('0x16')]);return _0x26b094(_0x17a005[_0xce26('0x14')][_0xce26('0x16')]);}else{logger[_0xce26('0xf')](_0xce26('0x10'),_0x3c9293,'request\x20sent');_0x26b094(_0x17a005[_0xce26('0x17')]['message']);}})['catch'](function(_0x18ab1e){logger[_0xce26('0x14')](_0xce26('0x10'),_0x3c9293,_0x18ab1e);_0x4a8d36(_0x18ab1e);});});} \ No newline at end of file +var _0x33a2=['request\x20sent','debug','SAUnitMeasure,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','then','info','SAUnitMeasure,\x20%s,\x20%s'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x33a2,0x138));var _0x233a=function(_0x40c508,_0x299c76){_0x40c508=_0x40c508-0x0;var _0x5a0767=_0x33a2[_0x40c508];return _0x5a0767;};'use strict';var _=require('lodash');var util=require(_0x233a('0x0'));var moment=require('moment');var BPromise=require(_0x233a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x233a('0x2'));var db=require(_0x233a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x233a('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x233a('0x5'));var client=jayson[_0x233a('0x6')][_0x233a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x410d37,_0x1d51fc,_0xf2d610){return new BPromise(function(_0x5eae44,_0x4088d9){return client['request'](_0x410d37,_0xf2d610)[_0x233a('0x8')](function(_0x3dbf62){logger[_0x233a('0x9')](_0x233a('0xa'),_0x1d51fc,_0x233a('0xb'));logger[_0x233a('0xc')](_0x233a('0xd'),_0x1d51fc,_0x233a('0xb'),JSON['stringify'](_0x3dbf62));if(_0x3dbf62[_0x233a('0xe')]){if(_0x3dbf62['error'][_0x233a('0xf')]===0x1f4){logger[_0x233a('0xe')]('SAUnitMeasure,\x20%s,\x20%s',_0x1d51fc,_0x3dbf62[_0x233a('0xe')][_0x233a('0x10')]);return _0x4088d9(_0x3dbf62[_0x233a('0xe')][_0x233a('0x10')]);}logger['error']('SAUnitMeasure,\x20%s,\x20%s',_0x1d51fc,_0x3dbf62[_0x233a('0xe')][_0x233a('0x10')]);return _0x5eae44(_0x3dbf62[_0x233a('0xe')][_0x233a('0x10')]);}else{logger[_0x233a('0x9')](_0x233a('0xa'),_0x1d51fc,'request\x20sent');_0x5eae44(_0x3dbf62[_0x233a('0x11')][_0x233a('0x10')]);}})[_0x233a('0x12')](function(_0x9f226d){logger[_0x233a('0xe')](_0x233a('0xa'),_0x1d51fc,_0x9f226d);_0x4088d9(_0x9f226d);});});} \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index cc48369..1ebc1a3 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 _0xac49=['index','/:id','/:id/run','run','create','put','update','delete','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated'];(function(_0x255f23,_0x13a6cf){var _0x196f92=function(_0x22158e){while(--_0x22158e){_0x255f23['push'](_0x255f23['shift']());}};_0x196f92(++_0x13a6cf);}(_0xac49,0xb4));var _0x9ac4=function(_0x4c9fa2,_0x2a1d04){_0x4c9fa2=_0x4c9fa2-0x0;var _0x1f72df=_0xac49[_0x4c9fa2];return _0x1f72df;};'use strict';var multer=require(_0x9ac4('0x0'));var util=require(_0x9ac4('0x1'));var path=require('path');var timeout=require(_0x9ac4('0x2'));var express=require(_0x9ac4('0x3'));var router=express['Router']();var auth=require(_0x9ac4('0x4'));var interaction=require(_0x9ac4('0x5'));var config=require(_0x9ac4('0x6'));var controller=require(_0x9ac4('0x7'));router[_0x9ac4('0x8')]('/',auth[_0x9ac4('0x9')](),controller[_0x9ac4('0xa')]);router[_0x9ac4('0x8')](_0x9ac4('0xb'),auth[_0x9ac4('0x9')](),controller['show']);router['get'](_0x9ac4('0xc'),auth[_0x9ac4('0x9')](),controller[_0x9ac4('0xd')]);router['post']('/',auth[_0x9ac4('0x9')](),controller[_0x9ac4('0xe')]);router[_0x9ac4('0xf')](_0x9ac4('0xb'),auth[_0x9ac4('0x9')](),controller[_0x9ac4('0x10')]);router[_0x9ac4('0x11')]('/:id',auth[_0x9ac4('0x9')](),controller[_0x9ac4('0x12')]);module['exports']=router; \ No newline at end of file +var _0xbb4c=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','express','Router','../../config/environment','get'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xbb4c,0x71));var _0xcbb4=function(_0x524792,_0x7af1ef){_0x524792=_0x524792-0x0;var _0x2c6aae=_0xbb4c[_0x524792];return _0x2c6aae;};'use strict';var multer=require(_0xcbb4('0x0'));var util=require(_0xcbb4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcbb4('0x2'));var router=express[_0xcbb4('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcbb4('0x4'));var controller=require('./schedule.controller');router[_0xcbb4('0x5')]('/',auth[_0xcbb4('0x6')](),controller[_0xcbb4('0x7')]);router[_0xcbb4('0x5')](_0xcbb4('0x8'),auth[_0xcbb4('0x6')](),controller[_0xcbb4('0x9')]);router[_0xcbb4('0x5')]('/:id/run',auth[_0xcbb4('0x6')](),controller['run']);router[_0xcbb4('0xa')]('/',auth[_0xcbb4('0x6')](),controller[_0xcbb4('0xb')]);router[_0xcbb4('0xc')](_0xcbb4('0x8'),auth[_0xcbb4('0x6')](),controller[_0xcbb4('0xd')]);router[_0xcbb4('0xe')](_0xcbb4('0x8'),auth[_0xcbb4('0x6')](),controller[_0xcbb4('0xf')]);module[_0xcbb4('0x10')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 2344039..1f10299 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 _0x3b40=['hours','minutes','csv','pdf','custom','default','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','quarters','months','weeks','days'];(function(_0x3fe633,_0x512d24){var _0x5665f0=function(_0x30807d){while(--_0x30807d){_0x3fe633['push'](_0x3fe633['shift']());}};_0x5665f0(++_0x512d24);}(_0x3b40,0x17d));var _0x03b4=function(_0x3d631a,_0x4d7d2d){_0x3d631a=_0x3d631a-0x0;var _0x5b8ee6=_0x3b40[_0x3d631a];return _0x5b8ee6;};'use strict';var Sequelize=require('sequelize');module[_0x03b4('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x03b4('0x1')]},'active':{'type':Sequelize[_0x03b4('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x03b4('0x1')],'allowNull':![],'defaultValue':_0x03b4('0x3')},'startAt':{'type':Sequelize[_0x03b4('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x03b4('0x5')]('years',_0x03b4('0x6'),_0x03b4('0x7'),_0x03b4('0x8'),_0x03b4('0x9'),_0x03b4('0xa'),_0x03b4('0xb')),'allowNull':![],'defaultValue':_0x03b4('0x9')},'output':{'type':Sequelize['ENUM'](_0x03b4('0xc'),_0x03b4('0xd'),'xlsx'),'allowNull':![],'defaultValue':_0x03b4('0xc')},'type':{'type':Sequelize[_0x03b4('0x5')](_0x03b4('0xe'),_0x03b4('0xf')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x03b4('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x03b4('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x03b4('0x10')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x7fc4=['csv','custom','default','TEXT','BOOLEAN','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','ENUM','years','days','hours','minutes'];(function(_0x1fd2b2,_0x477e34){var _0x3f111c=function(_0x1b1cf6){while(--_0x1b1cf6){_0x1fd2b2['push'](_0x1fd2b2['shift']());}};_0x3f111c(++_0x477e34);}(_0x7fc4,0x19a));var _0x47fc=function(_0x474644,_0xaf5ca5){_0x474644=_0x474644-0x0;var _0x17abcf=_0x7fc4[_0x474644];return _0x17abcf;};'use strict';var Sequelize=require(_0x47fc('0x0'));module[_0x47fc('0x1')]={'name':{'type':Sequelize[_0x47fc('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x47fc('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x47fc('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x47fc('0x5')](_0x47fc('0x6'),'quarters','months','weeks',_0x47fc('0x7'),_0x47fc('0x8'),_0x47fc('0x9')),'allowNull':![],'defaultValue':_0x47fc('0x7')},'output':{'type':Sequelize['ENUM'](_0x47fc('0xa'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0x47fc('0xa')},'type':{'type':Sequelize['ENUM'](_0x47fc('0xb'),_0x47fc('0xc')),'allowNull':![],'defaultValue':_0x47fc('0xb')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x47fc('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x47fc('0xd')]},'sendIfEmpty':{'type':Sequelize[_0x47fc('0xe')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 52fbfff..5c4aecb 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 _0xdd51=['options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','autoAssociation','run','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','save','update','destroy','then','get','UserProfileResource','error','name','send','index','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','count','includeAll','Schedule','findAll','rows','params','include'];(function(_0x23931f,_0x44a59c){var _0x2575ce=function(_0xea6dec){while(--_0xea6dec){_0x23931f['push'](_0x23931f['shift']());}};_0x2575ce(++_0x44a59c);}(_0xdd51,0x197));var _0x1dd5=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xdd51[_0x2d7f0e];return _0x110b07;};'use strict';var pdf=require(_0x1dd5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1dd5('0x1'));var zipdir=require(_0x1dd5('0x2'));var jsonpatch=require(_0x1dd5('0x3'));var rp=require(_0x1dd5('0x4'));var moment=require(_0x1dd5('0x5'));var BPromise=require(_0x1dd5('0x6'));var Mustache=require(_0x1dd5('0x7'));var util=require('util');var path=require('path');var sox=require(_0x1dd5('0x8'));var csv=require(_0x1dd5('0x9'));var ejs=require(_0x1dd5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1dd5('0xb'));var crypto=require('crypto');var jsforce=require(_0x1dd5('0xc'));var deskjs=require(_0x1dd5('0xd'));var toCsv=require(_0x1dd5('0x9'));var querystring=require(_0x1dd5('0xe'));var Papa=require(_0x1dd5('0xf'));var Redis=require(_0x1dd5('0x10'));var authService=require(_0x1dd5('0x11'));var qs=require(_0x1dd5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1dd5('0x13'));var config=require('../../config/environment');var db=require(_0x1dd5('0x14'))['db'];function respondWithStatusCode(_0x5ee262,_0x8a39e0){_0x8a39e0=_0x8a39e0||0xcc;return function(_0x3bada8){if(_0x3bada8){return _0x5ee262[_0x1dd5('0x15')](_0x8a39e0);}return _0x5ee262[_0x1dd5('0x16')](_0x8a39e0)[_0x1dd5('0x17')]();};}function respondWithResult(_0x4498a4,_0x4451b4){_0x4451b4=_0x4451b4||0xc8;return function(_0x14e97a){if(_0x14e97a){return _0x4498a4[_0x1dd5('0x16')](_0x4451b4)[_0x1dd5('0x18')](_0x14e97a);}};}function respondWithFilteredResult(_0x252204,_0x2d0b8e){return function(_0x4b8bcc){if(_0x4b8bcc){var _0x13c469=_0x4b8bcc['count'],_0x3b363b=_0x2d0b8e['offset'],_0x552c0f=_0x2d0b8e[_0x1dd5('0x19')]+_0x2d0b8e[_0x1dd5('0x1a')],_0xe7dcf6;if(_0x552c0f>=_0x13c469){_0x552c0f=_0x13c469;_0xe7dcf6=0xc8;}else{_0xe7dcf6=0xce;}_0x252204[_0x1dd5('0x16')](_0xe7dcf6);return _0x252204['set'](_0x1dd5('0x1b'),_0x3b363b+'-'+_0x552c0f+'/'+_0x13c469)[_0x1dd5('0x18')](_0x4b8bcc);}return null;};}function patchUpdates(_0x24df2c){return function(_0x2f833d){try{jsonpatch[_0x1dd5('0x1c')](_0x2f833d,_0x24df2c,!![]);}catch(_0x5d4f54){return BPromise['reject'](_0x5d4f54);}return _0x2f833d[_0x1dd5('0x1d')]();};}function saveUpdates(_0xc8945,_0x3c5fec){return function(_0x528577){if(_0x528577){return _0x528577[_0x1dd5('0x1e')](_0xc8945)['then'](function(_0x4d2a14){return _0x4d2a14;});}return null;};}function removeEntity(_0x209693,_0x3246d3){return function(_0x3e559a){if(_0x3e559a){return _0x3e559a[_0x1dd5('0x1f')]()[_0x1dd5('0x20')](function(){var _0x380d0c=_0x3e559a[_0x1dd5('0x21')]({'plain':!![]});var _0x7f8dda='Scheduler';return db[_0x1dd5('0x22')]['destroy']({'where':{'type':_0x7f8dda,'resourceId':_0x380d0c['id']}})[_0x1dd5('0x20')](function(){return _0x3e559a;});})['then'](function(){_0x209693['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x46de28,_0x455336){return function(_0x44b899){if(!_0x44b899){_0x46de28[_0x1dd5('0x15')](0x194);}return _0x44b899;};}function handleError(_0x1d0120,_0x4508bc){_0x4508bc=_0x4508bc||0x1f4;return function(_0x17f08e){logger[_0x1dd5('0x23')](_0x17f08e['stack']);if(_0x17f08e[_0x1dd5('0x24')]){delete _0x17f08e[_0x1dd5('0x24')];}_0x1d0120['status'](_0x4508bc)[_0x1dd5('0x25')](_0x17f08e);};}exports[_0x1dd5('0x26')]=function(_0x558d98,_0x229177){var _0x3f8dfc={},_0x4e0206={},_0x345b31={'count':0x0,'rows':[]};var _0x46bb6d=db['Schedule'][_0x1dd5('0x27')];_0x4e0206[_0x1dd5('0x28')]=_['keys'](_0x46bb6d);_0x4e0206[_0x1dd5('0x29')]=_[_0x1dd5('0x2a')](_0x558d98[_0x1dd5('0x29')]);_0x4e0206[_0x1dd5('0x2b')]=_[_0x1dd5('0x2c')](_0x4e0206[_0x1dd5('0x28')],_0x4e0206[_0x1dd5('0x29')]);_0x3f8dfc['attributes']=_[_0x1dd5('0x2c')](_0x4e0206[_0x1dd5('0x28')],qs[_0x1dd5('0x2d')](_0x558d98['query'][_0x1dd5('0x2d')]));_0x3f8dfc[_0x1dd5('0x2e')]=_0x3f8dfc[_0x1dd5('0x2e')][_0x1dd5('0x2f')]?_0x3f8dfc[_0x1dd5('0x2e')]:_0x4e0206[_0x1dd5('0x28')];if(!_0x558d98['query']['hasOwnProperty'](_0x1dd5('0x30'))){_0x3f8dfc[_0x1dd5('0x1a')]=qs[_0x1dd5('0x1a')](_0x558d98[_0x1dd5('0x29')][_0x1dd5('0x1a')]);_0x3f8dfc[_0x1dd5('0x19')]=qs[_0x1dd5('0x19')](_0x558d98['query'][_0x1dd5('0x19')]);}_0x3f8dfc[_0x1dd5('0x31')]=qs[_0x1dd5('0x32')](_0x558d98['query'][_0x1dd5('0x32')]);_0x3f8dfc[_0x1dd5('0x33')]=qs['filters'](_[_0x1dd5('0x34')](_0x558d98[_0x1dd5('0x29')],_0x4e0206['filters']));if(_0x558d98[_0x1dd5('0x29')][_0x1dd5('0x35')]){_0x3f8dfc['where']=_[_0x1dd5('0x36')](_0x3f8dfc[_0x1dd5('0x33')],{'$or':_[_0x1dd5('0x37')](_0x46bb6d,function(_0x38224d){if(_0x38224d[_0x1dd5('0x38')][_0x1dd5('0x39')]!==_0x1dd5('0x3a')){var _0x5e7670={};_0x5e7670[_0x38224d[_0x1dd5('0x3b')]]={'$like':'%'+_0x558d98[_0x1dd5('0x29')][_0x1dd5('0x35')]+'%'};return _0x5e7670;}})});}_0x3f8dfc=_[_0x1dd5('0x36')]({},_0x3f8dfc,_0x558d98['options']);var _0x5a1b36={'where':_0x3f8dfc[_0x1dd5('0x33')]};return db['Schedule']['count'](_0x5a1b36)['then'](function(_0x5eed90){_0x345b31[_0x1dd5('0x3c')]=_0x5eed90;if(_0x558d98['query'][_0x1dd5('0x3d')]){_0x3f8dfc['include']=[{'all':!![]}];}return db[_0x1dd5('0x3e')][_0x1dd5('0x3f')](_0x3f8dfc);})[_0x1dd5('0x20')](function(_0x23d222){_0x345b31[_0x1dd5('0x40')]=_0x23d222;return _0x345b31;})[_0x1dd5('0x20')](respondWithFilteredResult(_0x229177,_0x3f8dfc))['catch'](handleError(_0x229177,null));};exports['show']=function(_0x5b63d0,_0x1ebd8d){var _0x4139f4={'raw':![],'where':{'id':_0x5b63d0[_0x1dd5('0x41')]['id']}},_0xcaedd2={};_0xcaedd2['model']=_['keys'](db[_0x1dd5('0x3e')][_0x1dd5('0x27')]);_0xcaedd2[_0x1dd5('0x29')]=_[_0x1dd5('0x2a')](_0x5b63d0[_0x1dd5('0x29')]);_0xcaedd2[_0x1dd5('0x2b')]=_['intersection'](_0xcaedd2[_0x1dd5('0x28')],_0xcaedd2[_0x1dd5('0x29')]);_0x4139f4[_0x1dd5('0x2e')]=_['intersection'](_0xcaedd2[_0x1dd5('0x28')],qs['fields'](_0x5b63d0[_0x1dd5('0x29')][_0x1dd5('0x2d')]));_0x4139f4['attributes']=_0x4139f4[_0x1dd5('0x2e')][_0x1dd5('0x2f')]?_0x4139f4[_0x1dd5('0x2e')]:_0xcaedd2['model'];if(_0x5b63d0[_0x1dd5('0x29')]['includeAll']){_0x4139f4[_0x1dd5('0x42')]=[{'all':!![]}];}_0x4139f4=_['merge']({},_0x4139f4,_0x5b63d0[_0x1dd5('0x43')]);return db['Schedule'][_0x1dd5('0x44')](_0x4139f4)[_0x1dd5('0x20')](handleEntityNotFound(_0x1ebd8d,null))[_0x1dd5('0x20')](respondWithResult(_0x1ebd8d,null))[_0x1dd5('0x45')](handleError(_0x1ebd8d,null));};exports[_0x1dd5('0x46')]=function(_0xace5bb,_0x47d457){return db['Schedule']['create'](_0xace5bb[_0x1dd5('0x47')],{})[_0x1dd5('0x20')](function(_0x45b50d){var _0x455d20=_0xace5bb[_0x1dd5('0x48')][_0x1dd5('0x21')]({'plain':!![]});if(!_0x455d20)throw new Error(_0x1dd5('0x49'));if(_0x455d20[_0x1dd5('0x4a')]===_0x1dd5('0x48')){var _0x335994=_0x45b50d[_0x1dd5('0x21')]({'plain':!![]});var _0x5364af=_0x1dd5('0x4b');return db[_0x1dd5('0x4c')][_0x1dd5('0x44')]({'where':{'name':_0x5364af,'userProfileId':_0x455d20['userProfileId']},'raw':!![]})['then'](function(_0x3f1602){if(_0x3f1602&&_0x3f1602[_0x1dd5('0x4d')]===0x0){return db[_0x1dd5('0x22')]['create']({'name':_0x335994[_0x1dd5('0x24')],'resourceId':_0x335994['id'],'type':_0x3f1602[_0x1dd5('0x24')],'sectionId':_0x3f1602['id']},{})[_0x1dd5('0x20')](function(){return _0x45b50d;});}else{return _0x45b50d;}})[_0x1dd5('0x45')](function(_0x1853f2){logger[_0x1dd5('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1853f2);throw _0x1853f2;});}return _0x45b50d;})[_0x1dd5('0x20')](respondWithResult(_0x47d457,0xc9))['catch'](handleError(_0x47d457,null));};exports[_0x1dd5('0x1e')]=function(_0x46e8e9,_0x35982c){if(_0x46e8e9[_0x1dd5('0x47')]['id']){delete _0x46e8e9[_0x1dd5('0x47')]['id'];}return db[_0x1dd5('0x3e')][_0x1dd5('0x44')]({'where':{'id':_0x46e8e9[_0x1dd5('0x41')]['id']}})[_0x1dd5('0x20')](handleEntityNotFound(_0x35982c,null))['then'](saveUpdates(_0x46e8e9[_0x1dd5('0x47')],null))[_0x1dd5('0x20')](respondWithResult(_0x35982c,null))[_0x1dd5('0x45')](handleError(_0x35982c,null));};exports[_0x1dd5('0x1f')]=function(_0x2f9d29,_0x3df263){return db[_0x1dd5('0x3e')][_0x1dd5('0x44')]({'where':{'id':_0x2f9d29['params']['id']}})[_0x1dd5('0x20')](handleEntityNotFound(_0x3df263,null))['then'](removeEntity(_0x3df263,null))[_0x1dd5('0x45')](handleError(_0x3df263,null));};exports[_0x1dd5('0x4e')]=function(_0x2b9800,_0x22f6b6,_0x4f5f4b){var _0x5a6f8b=require('../../config/schedule');return db['Schedule'][_0x1dd5('0x44')]({'where':{'id':_0x2b9800[_0x1dd5('0x41')]['id']},'raw':!![]})[_0x1dd5('0x20')](handleEntityNotFound(_0x22f6b6,null))['then'](function(){_0x5a6f8b['run'](_0x2b9800['params']['id']);})[_0x1dd5('0x20')](respondWithStatusCode(_0x22f6b6,null))[_0x1dd5('0x45')](handleError(_0x22f6b6,null));}; \ No newline at end of file +var _0xda56=['../../config/license/hardware','api','../../config/environment','../../mysqldb','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','get','Scheduler','UserProfileResource','end','error','stack','name','index','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','merge','where','map','key','field','options','Schedule','includeAll','include','rows','show','params','rawAttributes','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','html-pdf','eml-format','moment','mustache','path','sox','ejs','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x293856,_0x493fd8){var _0x204d1f=function(_0x33fea2){while(--_0x33fea2){_0x293856['push'](_0x293856['shift']());}};_0x204d1f(++_0x493fd8);}(_0xda56,0x86));var _0x6da5=function(_0x4cbdb7,_0x1b82f6){_0x4cbdb7=_0x4cbdb7-0x0;var _0x4ecb18=_0xda56[_0x4cbdb7];return _0x4ecb18;};'use strict';var pdf=require(_0x6da5('0x0'));var emlformat=require(_0x6da5('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6da5('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6da5('0x3'));var util=require('util');var path=require(_0x6da5('0x4'));var sox=require(_0x6da5('0x5'));var csv=require('to-csv');var ejs=require(_0x6da5('0x6'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6da5('0x7'));var jsforce=require(_0x6da5('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x6da5('0x9'));var querystring=require(_0x6da5('0xa'));var Papa=require(_0x6da5('0xb'));var Redis=require(_0x6da5('0xc'));var authService=require(_0x6da5('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6da5('0xe'));var logger=require('../../config/logger')(_0x6da5('0xf'));var utils=require('../../config/utils');var config=require(_0x6da5('0x10'));var db=require(_0x6da5('0x11'))['db'];function respondWithStatusCode(_0xf6704f,_0x152009){_0x152009=_0x152009||0xcc;return function(_0x54fbaf){if(_0x54fbaf){return _0xf6704f['sendStatus'](_0x152009);}return _0xf6704f[_0x6da5('0x12')](_0x152009)['end']();};}function respondWithResult(_0x5af76e,_0x2b8662){_0x2b8662=_0x2b8662||0xc8;return function(_0x30cac8){if(_0x30cac8){return _0x5af76e['status'](_0x2b8662)[_0x6da5('0x13')](_0x30cac8);}};}function respondWithFilteredResult(_0x4020be,_0x2f3ec1){return function(_0x1f4706){if(_0x1f4706){var _0x51ef9b=_0x1f4706[_0x6da5('0x14')],_0x2456cb=_0x2f3ec1[_0x6da5('0x15')],_0x4c2a27=_0x2f3ec1[_0x6da5('0x15')]+_0x2f3ec1[_0x6da5('0x16')],_0x570c15;if(_0x4c2a27>=_0x51ef9b){_0x4c2a27=_0x51ef9b;_0x570c15=0xc8;}else{_0x570c15=0xce;}_0x4020be['status'](_0x570c15);return _0x4020be['set'](_0x6da5('0x17'),_0x2456cb+'-'+_0x4c2a27+'/'+_0x51ef9b)['json'](_0x1f4706);}return null;};}function patchUpdates(_0x4ab9f6){return function(_0x57b9cd){try{jsonpatch[_0x6da5('0x18')](_0x57b9cd,_0x4ab9f6,!![]);}catch(_0x444f99){return BPromise[_0x6da5('0x19')](_0x444f99);}return _0x57b9cd[_0x6da5('0x1a')]();};}function saveUpdates(_0x48f4e7,_0x276b3f){return function(_0x29c6c5){if(_0x29c6c5){return _0x29c6c5[_0x6da5('0x1b')](_0x48f4e7)['then'](function(_0x435f55){return _0x435f55;});}return null;};}function removeEntity(_0x1f3907,_0x12f576){return function(_0x57204e){if(_0x57204e){return _0x57204e[_0x6da5('0x1c')]()[_0x6da5('0x1d')](function(){var _0x1d41eb=_0x57204e[_0x6da5('0x1e')]({'plain':!![]});var _0x569a3c=_0x6da5('0x1f');return db[_0x6da5('0x20')]['destroy']({'where':{'type':_0x569a3c,'resourceId':_0x1d41eb['id']}})[_0x6da5('0x1d')](function(){return _0x57204e;});})[_0x6da5('0x1d')](function(){_0x1f3907['status'](0xcc)[_0x6da5('0x21')]();});}};}function handleEntityNotFound(_0x2b27a6,_0x2c1f70){return function(_0x3c23db){if(!_0x3c23db){_0x2b27a6['sendStatus'](0x194);}return _0x3c23db;};}function handleError(_0x605d0e,_0xd4fa1c){_0xd4fa1c=_0xd4fa1c||0x1f4;return function(_0x448336){logger[_0x6da5('0x22')](_0x448336[_0x6da5('0x23')]);if(_0x448336[_0x6da5('0x24')]){delete _0x448336['name'];}_0x605d0e[_0x6da5('0x12')](_0xd4fa1c)['send'](_0x448336);};}exports[_0x6da5('0x25')]=function(_0x8e3bac,_0x43e314){var _0xb68bf7={},_0x4220ef={},_0x459454={'count':0x0,'rows':[]};var _0x3e69d7=db['Schedule']['rawAttributes'];_0x4220ef[_0x6da5('0x26')]=_['keys'](_0x3e69d7);_0x4220ef['query']=_[_0x6da5('0x27')](_0x8e3bac['query']);_0x4220ef[_0x6da5('0x28')]=_['intersection'](_0x4220ef[_0x6da5('0x26')],_0x4220ef[_0x6da5('0x29')]);_0xb68bf7[_0x6da5('0x2a')]=_[_0x6da5('0x2b')](_0x4220ef[_0x6da5('0x26')],qs['fields'](_0x8e3bac['query'][_0x6da5('0x2c')]));_0xb68bf7['attributes']=_0xb68bf7['attributes'][_0x6da5('0x2d')]?_0xb68bf7['attributes']:_0x4220ef[_0x6da5('0x26')];if(!_0x8e3bac[_0x6da5('0x29')][_0x6da5('0x2e')](_0x6da5('0x2f'))){_0xb68bf7[_0x6da5('0x16')]=qs[_0x6da5('0x16')](_0x8e3bac[_0x6da5('0x29')][_0x6da5('0x16')]);_0xb68bf7[_0x6da5('0x15')]=qs[_0x6da5('0x15')](_0x8e3bac[_0x6da5('0x29')][_0x6da5('0x15')]);}_0xb68bf7[_0x6da5('0x30')]=qs[_0x6da5('0x31')](_0x8e3bac['query'][_0x6da5('0x31')]);_0xb68bf7['where']=qs[_0x6da5('0x28')](_['pick'](_0x8e3bac[_0x6da5('0x29')],_0x4220ef['filters']));if(_0x8e3bac['query']['filter']){_0xb68bf7['where']=_[_0x6da5('0x32')](_0xb68bf7[_0x6da5('0x33')],{'$or':_[_0x6da5('0x34')](_0x3e69d7,function(_0x4bac30){if(_0x4bac30['type'][_0x6da5('0x35')]!=='VIRTUAL'){var _0x117326={};_0x117326[_0x4bac30[_0x6da5('0x36')]]={'$like':'%'+_0x8e3bac[_0x6da5('0x29')]['filter']+'%'};return _0x117326;}})});}_0xb68bf7=_[_0x6da5('0x32')]({},_0xb68bf7,_0x8e3bac[_0x6da5('0x37')]);var _0x29019d={'where':_0xb68bf7['where']};return db[_0x6da5('0x38')]['count'](_0x29019d)[_0x6da5('0x1d')](function(_0xe7b9be){_0x459454[_0x6da5('0x14')]=_0xe7b9be;if(_0x8e3bac[_0x6da5('0x29')][_0x6da5('0x39')]){_0xb68bf7[_0x6da5('0x3a')]=[{'all':!![]}];}return db['Schedule']['findAll'](_0xb68bf7);})[_0x6da5('0x1d')](function(_0x3434ab){_0x459454[_0x6da5('0x3b')]=_0x3434ab;return _0x459454;})['then'](respondWithFilteredResult(_0x43e314,_0xb68bf7))['catch'](handleError(_0x43e314,null));};exports[_0x6da5('0x3c')]=function(_0xfa781b,_0x36231e){var _0x381ed4={'raw':![],'where':{'id':_0xfa781b[_0x6da5('0x3d')]['id']}},_0xfaa9be={};_0xfaa9be[_0x6da5('0x26')]=_[_0x6da5('0x27')](db[_0x6da5('0x38')][_0x6da5('0x3e')]);_0xfaa9be['query']=_[_0x6da5('0x27')](_0xfa781b[_0x6da5('0x29')]);_0xfaa9be[_0x6da5('0x28')]=_[_0x6da5('0x2b')](_0xfaa9be['model'],_0xfaa9be[_0x6da5('0x29')]);_0x381ed4[_0x6da5('0x2a')]=_[_0x6da5('0x2b')](_0xfaa9be['model'],qs[_0x6da5('0x2c')](_0xfa781b[_0x6da5('0x29')][_0x6da5('0x2c')]));_0x381ed4[_0x6da5('0x2a')]=_0x381ed4['attributes'][_0x6da5('0x2d')]?_0x381ed4[_0x6da5('0x2a')]:_0xfaa9be[_0x6da5('0x26')];if(_0xfa781b['query'][_0x6da5('0x39')]){_0x381ed4[_0x6da5('0x3a')]=[{'all':!![]}];}_0x381ed4=_['merge']({},_0x381ed4,_0xfa781b[_0x6da5('0x37')]);return db[_0x6da5('0x38')]['find'](_0x381ed4)[_0x6da5('0x1d')](handleEntityNotFound(_0x36231e,null))[_0x6da5('0x1d')](respondWithResult(_0x36231e,null))[_0x6da5('0x3f')](handleError(_0x36231e,null));};exports[_0x6da5('0x40')]=function(_0x2fb6fe,_0x250921){return db[_0x6da5('0x38')][_0x6da5('0x40')](_0x2fb6fe[_0x6da5('0x41')],{})[_0x6da5('0x1d')](function(_0x33ac06){var _0x2d2a4f=_0x2fb6fe[_0x6da5('0x42')][_0x6da5('0x1e')]({'plain':!![]});if(!_0x2d2a4f)throw new Error(_0x6da5('0x43'));if(_0x2d2a4f[_0x6da5('0x44')]===_0x6da5('0x42')){var _0x4f6139=_0x33ac06[_0x6da5('0x1e')]({'plain':!![]});var _0x4fe3ca='Scheduler';return db[_0x6da5('0x45')][_0x6da5('0x46')]({'where':{'name':_0x4fe3ca,'userProfileId':_0x2d2a4f['userProfileId']},'raw':!![]})[_0x6da5('0x1d')](function(_0x1a854d){if(_0x1a854d&&_0x1a854d[_0x6da5('0x47')]===0x0){return db[_0x6da5('0x20')][_0x6da5('0x40')]({'name':_0x4f6139[_0x6da5('0x24')],'resourceId':_0x4f6139['id'],'type':_0x1a854d[_0x6da5('0x24')],'sectionId':_0x1a854d['id']},{})[_0x6da5('0x1d')](function(){return _0x33ac06;});}else{return _0x33ac06;}})[_0x6da5('0x3f')](function(_0x5708a6){logger[_0x6da5('0x22')](_0x6da5('0x48'),_0x5708a6);throw _0x5708a6;});}return _0x33ac06;})[_0x6da5('0x1d')](respondWithResult(_0x250921,0xc9))[_0x6da5('0x3f')](handleError(_0x250921,null));};exports[_0x6da5('0x1b')]=function(_0x2551b8,_0x196250){if(_0x2551b8[_0x6da5('0x41')]['id']){delete _0x2551b8['body']['id'];}return db[_0x6da5('0x38')][_0x6da5('0x46')]({'where':{'id':_0x2551b8[_0x6da5('0x3d')]['id']}})[_0x6da5('0x1d')](handleEntityNotFound(_0x196250,null))[_0x6da5('0x1d')](saveUpdates(_0x2551b8[_0x6da5('0x41')],null))[_0x6da5('0x1d')](respondWithResult(_0x196250,null))[_0x6da5('0x3f')](handleError(_0x196250,null));};exports[_0x6da5('0x1c')]=function(_0x106b4b,_0x43b86f){return db['Schedule'][_0x6da5('0x46')]({'where':{'id':_0x106b4b[_0x6da5('0x3d')]['id']}})[_0x6da5('0x1d')](handleEntityNotFound(_0x43b86f,null))[_0x6da5('0x1d')](removeEntity(_0x43b86f,null))[_0x6da5('0x3f')](handleError(_0x43b86f,null));};exports[_0x6da5('0x49')]=function(_0x326ba7,_0x52e084,_0x3e0ab0){var _0x310adc=require('../../config/schedule');return db[_0x6da5('0x38')]['find']({'where':{'id':_0x326ba7[_0x6da5('0x3d')]['id']},'raw':!![]})[_0x6da5('0x1d')](handleEntityNotFound(_0x52e084,null))[_0x6da5('0x1d')](function(){_0x310adc[_0x6da5('0x49')](_0x326ba7[_0x6da5('0x3d')]['id']);})[_0x6da5('0x1d')](respondWithStatusCode(_0x52e084,null))[_0x6da5('0x3f')](handleError(_0x52e084,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 5dbf8bd..2659c2d 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 _0xb33b=['exports','Schedule','tools_schedules','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0xb33b,0x17f));var _0xbb33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb33b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xbb33('0x0'));var logger=require(_0xbb33('0x1'))(_0xbb33('0x2'));var moment=require(_0xbb33('0x3'));var BPromise=require(_0xbb33('0x4'));var rp=require(_0xbb33('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbb33('0x6'));var attributes=require('./schedule.attributes');module[_0xbb33('0x7')]=function(_0x122d84,_0x360059){return _0x122d84['define'](_0xbb33('0x8'),attributes,{'tableName':_0xbb33('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6531=['../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x344a45,_0x1666a4){var _0x4a6896=function(_0x1dc1fe){while(--_0x1dc1fe){_0x344a45['push'](_0x344a45['shift']());}};_0x4a6896(++_0x1666a4);}(_0x6531,0x1f4));var _0x1653=function(_0x252dbf,_0x30eb95){_0x252dbf=_0x252dbf-0x0;var _0xf6d27d=_0x6531[_0x252dbf];return _0xf6d27d;};'use strict';var _=require('lodash');var util=require(_0x1653('0x0'));var logger=require(_0x1653('0x1'))(_0x1653('0x2'));var moment=require(_0x1653('0x3'));var BPromise=require(_0x1653('0x4'));var rp=require(_0x1653('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1653('0x6'));var config=require(_0x1653('0x7'));var attributes=require(_0x1653('0x8'));module[_0x1653('0x9')]=function(_0x2b21d1,_0x5034a4){return _0x2b21d1[_0x1653('0xa')](_0x1653('0xb'),attributes,{'tableName':_0x1653('0xc'),'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 9f40aeb..35e07ec 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 _0x4f5c=['code','message','info','result','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','client','http','request','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error'];(function(_0x8aba1a,_0x106e8a){var _0x4dca9a=function(_0x3c57da){while(--_0x3c57da){_0x8aba1a['push'](_0x8aba1a['shift']());}};_0x4dca9a(++_0x106e8a);}(_0x4f5c,0x82));var _0xc4f5=function(_0x25875a,_0x54dd06){_0x25875a=_0x25875a-0x0;var _0x21daee=_0x4f5c[_0x25875a];return _0x21daee;};'use strict';var _=require(_0xc4f5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc4f5('0x1'));var rs=require(_0xc4f5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc4f5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc4f5('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc4f5('0x5')][_0xc4f5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x22b051,_0x3598c5,_0x21a468){return new BPromise(function(_0x5584de,_0x3a5dc0){return client[_0xc4f5('0x7')](_0x22b051,_0x21a468)[_0xc4f5('0x8')](function(_0x310acd){logger['info'](_0xc4f5('0x9'),_0x3598c5,_0xc4f5('0xa'));logger[_0xc4f5('0xb')](_0xc4f5('0xc'),_0x3598c5,_0xc4f5('0xa'),JSON['stringify'](_0x310acd));if(_0x310acd[_0xc4f5('0xd')]){if(_0x310acd[_0xc4f5('0xd')][_0xc4f5('0xe')]===0x1f4){logger[_0xc4f5('0xd')](_0xc4f5('0x9'),_0x3598c5,_0x310acd['error'][_0xc4f5('0xf')]);return _0x3a5dc0(_0x310acd[_0xc4f5('0xd')][_0xc4f5('0xf')]);}logger[_0xc4f5('0xd')]('Schedule,\x20%s,\x20%s',_0x3598c5,_0x310acd[_0xc4f5('0xd')][_0xc4f5('0xf')]);return _0x5584de(_0x310acd['error']['message']);}else{logger[_0xc4f5('0x10')](_0xc4f5('0x9'),_0x3598c5,_0xc4f5('0xa'));_0x5584de(_0x310acd[_0xc4f5('0x11')][_0xc4f5('0xf')]);}})['catch'](function(_0x306852){logger[_0xc4f5('0xd')](_0xc4f5('0x9'),_0x3598c5,_0x306852);_0x3a5dc0(_0x306852);});});} \ No newline at end of file +var _0x8e62=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x256684,_0x529c1e){var _0x37a0c9=function(_0x4b431b){while(--_0x4b431b){_0x256684['push'](_0x256684['shift']());}};_0x37a0c9(++_0x529c1e);}(_0x8e62,0xa6));var _0x28e6=function(_0x4573bd,_0x19b9b5){_0x4573bd=_0x4573bd-0x0;var _0xc07bb9=_0x8e62[_0x4573bd];return _0xc07bb9;};'use strict';var _=require(_0x28e6('0x0'));var util=require(_0x28e6('0x1'));var moment=require(_0x28e6('0x2'));var BPromise=require('bluebird');var rs=require(_0x28e6('0x3'));var fs=require('fs');var Redis=require(_0x28e6('0x4'));var db=require(_0x28e6('0x5'))['db'];var utils=require(_0x28e6('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x28e6('0x7'));var jayson=require(_0x28e6('0x8'));var client=jayson['client'][_0x28e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50a6ca,_0x124d26,_0x2946cc){return new BPromise(function(_0x2b4a91,_0x25f639){return client[_0x28e6('0xa')](_0x50a6ca,_0x2946cc)['then'](function(_0x400d7e){logger[_0x28e6('0xb')](_0x28e6('0xc'),_0x124d26,_0x28e6('0xd'));logger[_0x28e6('0xe')](_0x28e6('0xf'),_0x124d26,_0x28e6('0xd'),JSON['stringify'](_0x400d7e));if(_0x400d7e['error']){if(_0x400d7e[_0x28e6('0x10')][_0x28e6('0x11')]===0x1f4){logger['error'](_0x28e6('0xc'),_0x124d26,_0x400d7e['error'][_0x28e6('0x12')]);return _0x25f639(_0x400d7e['error'][_0x28e6('0x12')]);}logger[_0x28e6('0x10')](_0x28e6('0xc'),_0x124d26,_0x400d7e[_0x28e6('0x10')]['message']);return _0x2b4a91(_0x400d7e[_0x28e6('0x10')][_0x28e6('0x12')]);}else{logger[_0x28e6('0xb')](_0x28e6('0xc'),_0x124d26,_0x28e6('0xd'));_0x2b4a91(_0x400d7e[_0x28e6('0x13')][_0x28e6('0x12')]);}})[_0x28e6('0x14')](function(_0x3acec4){logger[_0x28e6('0x10')](_0x28e6('0xc'),_0x124d26,_0x3acec4);_0x25f639(_0x3acec4);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 4dd86c2..bccfe56 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 _0xa8be=['../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x33ffa1,_0x193a11){var _0x87c238=function(_0x4f1d33){while(--_0x4f1d33){_0x33ffa1['push'](_0x33ffa1['shift']());}};_0x87c238(++_0x193a11);}(_0xa8be,0x9b));var _0xea8b=function(_0xb8ac7,_0x32bfc8){_0xb8ac7=_0xb8ac7-0x0;var _0x51f055=_0xa8be[_0xb8ac7];return _0x51f055;};'use strict';var multer=require(_0xea8b('0x0'));var util=require(_0xea8b('0x1'));var path=require(_0xea8b('0x2'));var timeout=require(_0xea8b('0x3'));var express=require('express');var router=express[_0xea8b('0x4')]();var auth=require(_0xea8b('0x5'));var interaction=require(_0xea8b('0x6'));var config=require(_0xea8b('0x7'));var controller=require(_0xea8b('0x8'));router[_0xea8b('0x9')]('/',auth[_0xea8b('0xa')](),controller[_0xea8b('0xb')]);router['get']('/describe',auth[_0xea8b('0xa')](),controller[_0xea8b('0xc')]);router[_0xea8b('0x9')](_0xea8b('0xd'),auth[_0xea8b('0xa')](),controller[_0xea8b('0xe')]);router['get'](_0xea8b('0xf'),auth[_0xea8b('0xa')](),controller[_0xea8b('0x10')]);router[_0xea8b('0x11')]('/',auth[_0xea8b('0xa')](),controller[_0xea8b('0x12')]);router[_0xea8b('0x13')](_0xea8b('0xd'),auth[_0xea8b('0xa')](),controller['update']);router[_0xea8b('0x14')](_0xea8b('0xd'),auth[_0xea8b('0xa')](),controller[_0xea8b('0x15')]);module[_0xea8b('0x16')]=router; \ No newline at end of file +var _0x63a7=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','/:id','show','download','create','put','update','delete','destroy','exports'];(function(_0x4923ef,_0x235b5a){var _0x32e0f3=function(_0xe84859){while(--_0xe84859){_0x4923ef['push'](_0x4923ef['shift']());}};_0x32e0f3(++_0x235b5a);}(_0x63a7,0x1a2));var _0x763a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x63a7[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x763a('0x0'));var util=require(_0x763a('0x1'));var path=require(_0x763a('0x2'));var timeout=require(_0x763a('0x3'));var express=require(_0x763a('0x4'));var router=express['Router']();var auth=require(_0x763a('0x5'));var interaction=require(_0x763a('0x6'));var config=require(_0x763a('0x7'));var controller=require(_0x763a('0x8'));router[_0x763a('0x9')]('/',auth[_0x763a('0xa')](),controller[_0x763a('0xb')]);router[_0x763a('0x9')](_0x763a('0xc'),auth[_0x763a('0xa')](),controller['describe']);router[_0x763a('0x9')](_0x763a('0xd'),auth[_0x763a('0xa')](),controller[_0x763a('0xe')]);router[_0x763a('0x9')]('/:id/download',auth[_0x763a('0xa')](),controller[_0x763a('0xf')]);router['post']('/',auth[_0x763a('0xa')](),controller[_0x763a('0x10')]);router[_0x763a('0x11')](_0x763a('0xd'),auth[_0x763a('0xa')](),controller[_0x763a('0x12')]);router[_0x763a('0x13')](_0x763a('0xd'),auth['isAuthenticated'](),controller[_0x763a('0x14')]);module[_0x763a('0x15')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 8077dbf..e4fa359 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 _0xe2b4=['toString','format','DATE','createdAt','updatedAt','sequelize','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','startedAt','subtract','closedAt','duration','MM-DD-YYYY\x20HH:mm'];(function(_0x2c8692,_0x47871f){var _0x5702ea=function(_0x35e13d){while(--_0x35e13d){_0x2c8692['push'](_0x2c8692['shift']());}};_0x5702ea(++_0x47871f);}(_0xe2b4,0x1d3));var _0x4e2b=function(_0x18a64b,_0x275229){_0x18a64b=_0x18a64b-0x0;var _0x235131=_0xe2b4[_0x18a64b];return _0x235131;};'use strict';var Sequelize=require(_0x4e2b('0x0'));var moment=require('moment');var path=require(_0x4e2b('0x1'));var config=require(_0x4e2b('0x2'));module[_0x4e2b('0x3')]={'format':{'type':Sequelize[_0x4e2b('0x4')],'get':function(){return this[_0x4e2b('0x5')](_0x4e2b('0x6'))?path[_0x4e2b('0x7')](this[_0x4e2b('0x5')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x4e2b('0x8')]},'channel':{'type':Sequelize[_0x4e2b('0x8')]},'value':{'type':Sequelize[_0x4e2b('0x8')],'set':function(_0xf51885){var _0xc8590a=_0xf51885[_0x4e2b('0x9')](/\\/g,'/');this[_0x4e2b('0xa')]('value',_0xc8590a);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x2b2827){this[_0x4e2b('0xa')](_0x4e2b('0xb'),moment()[_0x4e2b('0xc')](_0x2b2827,'ms'));this[_0x4e2b('0xa')](_0x4e2b('0xd'),moment());this[_0x4e2b('0xa')](_0x4e2b('0xe'),_0x2b2827);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x4e2b('0x5')](_0x4e2b('0xb')))['format'](_0x4e2b('0xf'))[_0x4e2b('0x10')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x4e2b('0x5')]('closedAt'))[_0x4e2b('0x11')](_0x4e2b('0xf'))[_0x4e2b('0x10')]();}},'createdAt':{'type':Sequelize[_0x4e2b('0x12')],'get':function(){return moment(this[_0x4e2b('0x5')](_0x4e2b('0x13')))[_0x4e2b('0x11')](_0x4e2b('0xf'))[_0x4e2b('0x10')]();}},'updatedAt':{'type':Sequelize[_0x4e2b('0x12')],'get':function(){return moment(this['getDataValue'](_0x4e2b('0x14')))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file +var _0xe35f=['value','INTEGER','startedAt','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','updatedAt','moment','path','../../config/environment','exports','getDataValue','extname','STRING','replace','setDataValue'];(function(_0x176860,_0x2fbf0f){var _0x5f4a69=function(_0x54fc47){while(--_0x54fc47){_0x176860['push'](_0x176860['shift']());}};_0x5f4a69(++_0x2fbf0f);}(_0xe35f,0x8f));var _0xfe35=function(_0x4568a9,_0x3040d3){_0x4568a9=_0x4568a9-0x0;var _0xb26a5b=_0xe35f[_0x4568a9];return _0xb26a5b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfe35('0x0'));var path=require(_0xfe35('0x1'));var config=require(_0xfe35('0x2'));module[_0xfe35('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xfe35('0x4')]('value')?path[_0xfe35('0x5')](this['getDataValue']('value')):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xfe35('0x6')]},'value':{'type':Sequelize['STRING'],'set':function(_0xa01d1a){var _0x5c787a=_0xa01d1a[_0xfe35('0x7')](/\\/g,'/');this[_0xfe35('0x8')](_0xfe35('0x9'),_0x5c787a);}},'rating':{'type':Sequelize[_0xfe35('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x14dd78){this[_0xfe35('0x8')](_0xfe35('0xb'),moment()['subtract'](_0x14dd78,'ms'));this['setDataValue'](_0xfe35('0xc'),moment());this['setDataValue'](_0xfe35('0xd'),_0x14dd78);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xfe35('0x4')](_0xfe35('0xb')))[_0xfe35('0xe')](_0xfe35('0xf'))[_0xfe35('0x10')]();}},'closedAt':{'type':Sequelize[_0xfe35('0x11')],'get':function(){return moment(this[_0xfe35('0x4')]('closedAt'))[_0xfe35('0xe')](_0xfe35('0xf'))[_0xfe35('0x10')]();}},'createdAt':{'type':Sequelize[_0xfe35('0x11')],'get':function(){return moment(this[_0xfe35('0x4')]('createdAt'))[_0xfe35('0xe')](_0xfe35('0xf'))[_0xfe35('0x10')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xfe35('0x4')](_0xfe35('0x12')))['format'](_0xfe35('0xf'))[_0xfe35('0x10')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 7154819..28812c2 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 _0x6b27=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','then','destroy','error','stack','name','send','ScreenRecording','rawAttributes','model','format','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','download','filename','extname','unlink','message','Not\x20found','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x401937,_0x54e515){var _0x495c99=function(_0x286f7e){while(--_0x286f7e){_0x401937['push'](_0x401937['shift']());}};_0x495c99(++_0x54e515);}(_0x6b27,0x173));var _0x76b2=function(_0xdc0641,_0x1dc55c){_0xdc0641=_0xdc0641-0x0;var _0x3eb12a=_0x6b27[_0xdc0641];return _0x3eb12a;};'use strict';var pdf=require(_0x76b2('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x76b2('0x1'));var jsonpatch=require(_0x76b2('0x2'));var rp=require('request-promise');var moment=require(_0x76b2('0x3'));var BPromise=require(_0x76b2('0x4'));var Mustache=require(_0x76b2('0x5'));var util=require(_0x76b2('0x6'));var path=require(_0x76b2('0x7'));var sox=require(_0x76b2('0x8'));var csv=require(_0x76b2('0x9'));var ejs=require(_0x76b2('0xa'));var fs=require('fs');var _=require(_0x76b2('0xb'));var squel=require(_0x76b2('0xc'));var crypto=require('crypto');var jsforce=require(_0x76b2('0xd'));var deskjs=require(_0x76b2('0xe'));var toCsv=require(_0x76b2('0x9'));var querystring=require('querystring');var Papa=require(_0x76b2('0xf'));var Redis=require(_0x76b2('0x10'));var authService=require(_0x76b2('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x76b2('0x12'));var logger=require(_0x76b2('0x13'))(_0x76b2('0x14'));var utils=require(_0x76b2('0x15'));var config=require(_0x76b2('0x16'));var db=require(_0x76b2('0x17'))['db'];function respondWithStatusCode(_0xa738ef,_0x2e4da3){_0x2e4da3=_0x2e4da3||0xcc;return function(_0x130b1c){if(_0x130b1c){return _0xa738ef[_0x76b2('0x18')](_0x2e4da3);}return _0xa738ef[_0x76b2('0x19')](_0x2e4da3)[_0x76b2('0x1a')]();};}function respondWithResult(_0x48d5fd,_0x1a157e){_0x1a157e=_0x1a157e||0xc8;return function(_0x546f22){if(_0x546f22){return _0x48d5fd[_0x76b2('0x19')](_0x1a157e)[_0x76b2('0x1b')](_0x546f22);}};}function respondWithFilteredResult(_0x45b3d6,_0x465762){return function(_0x15d176){if(_0x15d176){var _0xd52ad0=_0x15d176[_0x76b2('0x1c')],_0x29825e=_0x465762[_0x76b2('0x1d')],_0x55d219=_0x465762[_0x76b2('0x1d')]+_0x465762[_0x76b2('0x1e')],_0x2b5727;if(_0x55d219>=_0xd52ad0){_0x55d219=_0xd52ad0;_0x2b5727=0xc8;}else{_0x2b5727=0xce;}_0x45b3d6[_0x76b2('0x19')](_0x2b5727);return _0x45b3d6[_0x76b2('0x1f')]('Content-Range',_0x29825e+'-'+_0x55d219+'/'+_0xd52ad0)[_0x76b2('0x1b')](_0x15d176);}return null;};}function patchUpdates(_0x42fa03){return function(_0xdd8c24){try{jsonpatch[_0x76b2('0x20')](_0xdd8c24,_0x42fa03,!![]);}catch(_0x59cd46){return BPromise[_0x76b2('0x21')](_0x59cd46);}return _0xdd8c24['save']();};}function saveUpdates(_0x57613b,_0x4cdab9){return function(_0x540f17){if(_0x540f17){return _0x540f17['update'](_0x57613b)[_0x76b2('0x22')](function(_0x2c8661){return _0x2c8661;});}return null;};}function removeEntity(_0x2345aa,_0x3d04c9){return function(_0x53858c){if(_0x53858c){return _0x53858c[_0x76b2('0x23')]()[_0x76b2('0x22')](function(){_0x2345aa[_0x76b2('0x19')](0xcc)[_0x76b2('0x1a')]();});}};}function handleEntityNotFound(_0x48cbe2,_0x355a9a){return function(_0x480c76){if(!_0x480c76){_0x48cbe2[_0x76b2('0x18')](0x194);}return _0x480c76;};}function handleError(_0x24262c,_0xd06b90){_0xd06b90=_0xd06b90||0x1f4;return function(_0x175b25){logger[_0x76b2('0x24')](_0x175b25[_0x76b2('0x25')]);if(_0x175b25['name']){delete _0x175b25[_0x76b2('0x26')];}_0x24262c[_0x76b2('0x19')](_0xd06b90)[_0x76b2('0x27')](_0x175b25);};}exports['index']=function(_0x19ff03,_0x1731ec){var _0x5a099a={},_0x175930={},_0x104be6={'count':0x0,'rows':[]};var _0x50489b=db[_0x76b2('0x28')][_0x76b2('0x29')];_0x175930[_0x76b2('0x2a')]=_['differenceBy'](_['keys'](_0x50489b),[_0x76b2('0x2b')]);_0x175930[_0x76b2('0x2c')]=_[_0x76b2('0x2d')](_0x19ff03[_0x76b2('0x2c')]);_0x175930[_0x76b2('0x2e')]=_[_0x76b2('0x2f')](_0x175930[_0x76b2('0x2a')],_0x175930['query']);_0x5a099a[_0x76b2('0x30')]=_[_0x76b2('0x2f')](_0x175930[_0x76b2('0x2a')],qs['fields'](_0x19ff03['query'][_0x76b2('0x31')]));_0x5a099a['attributes']=_0x5a099a['attributes'][_0x76b2('0x32')]?_0x5a099a['attributes']:_0x175930[_0x76b2('0x2a')];if(!_0x19ff03[_0x76b2('0x2c')]['hasOwnProperty'](_0x76b2('0x33'))){_0x5a099a['limit']=qs['limit'](_0x19ff03[_0x76b2('0x2c')][_0x76b2('0x1e')]);_0x5a099a['offset']=qs['offset'](_0x19ff03[_0x76b2('0x2c')][_0x76b2('0x1d')]);}_0x5a099a[_0x76b2('0x34')]=qs['sort'](_0x19ff03[_0x76b2('0x2c')][_0x76b2('0x35')]);_0x5a099a[_0x76b2('0x36')]=qs[_0x76b2('0x2e')](_[_0x76b2('0x37')](_0x19ff03['query'],_0x175930[_0x76b2('0x2e')]));if(_0x19ff03[_0x76b2('0x2c')][_0x76b2('0x38')]){_0x5a099a['where']=_[_0x76b2('0x39')](_0x5a099a[_0x76b2('0x36')],{'$or':_[_0x76b2('0x3a')](_0x50489b,function(_0x36cd9f){if(_0x36cd9f[_0x76b2('0x3b')]['key']!==_0x76b2('0x3c')){var _0x1ec949={};_0x1ec949[_0x36cd9f[_0x76b2('0x3d')]]={'$like':'%'+_0x19ff03[_0x76b2('0x2c')][_0x76b2('0x38')]+'%'};return _0x1ec949;}})});}_0x5a099a=_[_0x76b2('0x39')]({},_0x5a099a,_0x19ff03[_0x76b2('0x3e')]);var _0x25581f={'where':_0x5a099a[_0x76b2('0x36')]};return db[_0x76b2('0x28')][_0x76b2('0x1c')](_0x25581f)[_0x76b2('0x22')](function(_0x52ff9f){_0x104be6[_0x76b2('0x1c')]=_0x52ff9f;if(_0x19ff03[_0x76b2('0x2c')]['includeAll']){_0x5a099a[_0x76b2('0x3f')]=[{'all':!![]}];}return db[_0x76b2('0x28')][_0x76b2('0x40')](_0x5a099a);})['then'](function(_0x4cc54d){_0x104be6[_0x76b2('0x41')]=_0x4cc54d;return _0x104be6;})[_0x76b2('0x22')](respondWithFilteredResult(_0x1731ec,_0x5a099a))[_0x76b2('0x42')](handleError(_0x1731ec,null));};exports[_0x76b2('0x43')]=function(_0x357a03,_0x3fbd2b){var _0x12beb4={'raw':![],'where':{'id':_0x357a03[_0x76b2('0x44')]['id']}},_0x40a67f={};_0x40a67f[_0x76b2('0x2a')]=_['keys'](db[_0x76b2('0x28')][_0x76b2('0x29')]);_0x40a67f[_0x76b2('0x2c')]=_[_0x76b2('0x2d')](_0x357a03[_0x76b2('0x2c')]);_0x40a67f['filters']=_['intersection'](_0x40a67f['model'],_0x40a67f[_0x76b2('0x2c')]);_0x12beb4[_0x76b2('0x30')]=_[_0x76b2('0x2f')](_0x40a67f['model'],qs[_0x76b2('0x31')](_0x357a03['query']['fields']));_0x12beb4[_0x76b2('0x30')]=_0x12beb4['attributes'][_0x76b2('0x32')]?_0x12beb4[_0x76b2('0x30')]:_0x40a67f[_0x76b2('0x2a')];if(_0x357a03['query'][_0x76b2('0x45')]){_0x12beb4[_0x76b2('0x3f')]=[{'all':!![]}];}_0x12beb4=_[_0x76b2('0x39')]({},_0x12beb4,_0x357a03[_0x76b2('0x3e')]);return db[_0x76b2('0x28')][_0x76b2('0x46')](_0x12beb4)[_0x76b2('0x22')](handleEntityNotFound(_0x3fbd2b,null))[_0x76b2('0x22')](respondWithResult(_0x3fbd2b,null))['catch'](handleError(_0x3fbd2b,null));};exports['create']=function(_0x50d5ce,_0x47509e){return db['ScreenRecording'][_0x76b2('0x47')](_0x50d5ce[_0x76b2('0x48')],{})[_0x76b2('0x22')](respondWithResult(_0x47509e,0xc9))['catch'](handleError(_0x47509e,null));};exports['update']=function(_0x1bd0f8,_0x32c386){if(_0x1bd0f8['body']['id']){delete _0x1bd0f8[_0x76b2('0x48')]['id'];}delete _0x1bd0f8['body'][_0x76b2('0x49')];delete _0x1bd0f8[_0x76b2('0x48')][_0x76b2('0x4a')];delete _0x1bd0f8[_0x76b2('0x48')][_0x76b2('0x4b')];delete _0x1bd0f8['body'][_0x76b2('0x4c')];return db[_0x76b2('0x28')][_0x76b2('0x46')]({'where':{'id':_0x1bd0f8[_0x76b2('0x44')]['id']}})[_0x76b2('0x22')](handleEntityNotFound(_0x32c386,null))[_0x76b2('0x22')](saveUpdates(_0x1bd0f8[_0x76b2('0x48')],null))[_0x76b2('0x22')](respondWithResult(_0x32c386,null))[_0x76b2('0x42')](handleError(_0x32c386,null));};exports[_0x76b2('0x23')]=function(_0x14f0a1,_0x296bf5){return db['ScreenRecording'][_0x76b2('0x46')]({'where':{'id':_0x14f0a1[_0x76b2('0x44')]['id']}})[_0x76b2('0x22')](handleEntityNotFound(_0x296bf5,null))['then'](removeEntity(_0x296bf5,null))['catch'](handleError(_0x296bf5,null));};exports[_0x76b2('0x4d')]=function(_0x51d686,_0x317c26){return db[_0x76b2('0x28')]['describe']()[_0x76b2('0x22')](respondWithResult(_0x317c26,null))['catch'](handleError(_0x317c26,null));};exports['download']=function(_0xdadb04,_0x48ee1c,_0x45b2ce){var _0x56a91b=require(_0x76b2('0x4e'));var _0x555666=![];var _0x5c19fd={};if(_0xdadb04[_0x76b2('0x2c')][_0x76b2('0x3b')]&&_0xdadb04['query'][_0x76b2('0x3b')]===_0x76b2('0x4f')){_0x5c19fd[_0x76b2('0x4f')]=_0xdadb04[_0x76b2('0x44')]['id'];}else{_0x5c19fd['id']=_0xdadb04[_0x76b2('0x44')]['id'];}return db[_0x76b2('0x28')]['find']({'where':_0x5c19fd,'attributes':['id',_0x76b2('0x4c')],'raw':!![]})[_0x76b2('0x22')](handleEntityNotFound(_0x48ee1c,null))[_0x76b2('0x22')](function(_0x3b4d11){if(_0x3b4d11){var _0x4da1dc=path[_0x76b2('0x50')](config['root'],_0x76b2('0x51'),_0x3b4d11[_0x76b2('0x4c')]);var _0xf4b975=util['format'](_0x76b2('0x52'),_0x4da1dc);if(fs[_0x76b2('0x53')](_0xf4b975)){_0x555666=!![];return _0x56a91b[_0x76b2('0x54')](_0xf4b975,_0x4da1dc,config[_0x76b2('0x55')]['recording'])[_0x76b2('0x22')](function(){return _0x3b4d11;});}return _0x3b4d11;}})[_0x76b2('0x22')](function(_0x1eccb7){if(_0x1eccb7){var _0x21bf00=path[_0x76b2('0x50')](config[_0x76b2('0x56')],_0x76b2('0x51'),_0x1eccb7[_0x76b2('0x4c')]);if(!fs[_0x76b2('0x53')](_0x21bf00)){throw new db[(_0x76b2('0x57'))][(_0x76b2('0x58'))](_0x76b2('0x59'));}if(_0x1eccb7['filename']){return _0x48ee1c[_0x76b2('0x5a')](_0x21bf00,_0x1eccb7[_0x76b2('0x5b')]+path[_0x76b2('0x5c')](_0x21bf00),function(){if(_0x555666){fs['unlink'](_0x21bf00);}});}else{return _0x48ee1c[_0x76b2('0x5a')](_0x21bf00,function(_0x332c93){if(_0x555666){fs[_0x76b2('0x5d')](_0x21bf00);}});}}})[_0x76b2('0x42')](function(_0x34ecfd){if(_0x34ecfd[_0x76b2('0x5e')]==='ScreenRecording\x20not\x20found'){_0x48ee1c[_0x76b2('0x19')](0x194)['send'](_0x76b2('0x5f'));}else{return handleError(_0x48ee1c,null);}});}; \ No newline at end of file +var _0x48d5=['VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','find','create','body','createdAt','closedAt','value','params','describe','download','type','uniqueid','root','existsSync','server/files/screen_recordings','Sequelize','ScreenRecording\x20not\x20found','filename','extname','unlink','message','html-pdf','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','reject','save','update','then','destroy','error','stack','name','send','index','ScreenRecording','rawAttributes','model','differenceBy','keys','format','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','map'];(function(_0x54af2d,_0xe34009){var _0x18ada1=function(_0x193653){while(--_0x193653){_0x54af2d['push'](_0x54af2d['shift']());}};_0x18ada1(++_0xe34009);}(_0x48d5,0x1da));var _0x548d=function(_0x22754d,_0x3ffa6b){_0x22754d=_0x22754d-0x0;var _0x4e2724=_0x48d5[_0x22754d];return _0x4e2724;};'use strict';var pdf=require(_0x548d('0x0'));var emlformat=require(_0x548d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x548d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x548d('0x3'));var Mustache=require(_0x548d('0x4'));var util=require(_0x548d('0x5'));var path=require(_0x548d('0x6'));var sox=require(_0x548d('0x7'));var csv=require(_0x548d('0x8'));var ejs=require(_0x548d('0x9'));var fs=require('fs');var _=require(_0x548d('0xa'));var squel=require(_0x548d('0xb'));var crypto=require(_0x548d('0xc'));var jsforce=require(_0x548d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x548d('0xe'));var Redis=require(_0x548d('0xf'));var authService=require(_0x548d('0x10'));var qs=require(_0x548d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x548d('0x12'))(_0x548d('0x13'));var utils=require(_0x548d('0x14'));var config=require(_0x548d('0x15'));var db=require(_0x548d('0x16'))['db'];function respondWithStatusCode(_0xf95414,_0x478231){_0x478231=_0x478231||0xcc;return function(_0x5b4009){if(_0x5b4009){return _0xf95414[_0x548d('0x17')](_0x478231);}return _0xf95414[_0x548d('0x18')](_0x478231)[_0x548d('0x19')]();};}function respondWithResult(_0x1654b6,_0x4f455b){_0x4f455b=_0x4f455b||0xc8;return function(_0x1d97f9){if(_0x1d97f9){return _0x1654b6[_0x548d('0x18')](_0x4f455b)[_0x548d('0x1a')](_0x1d97f9);}};}function respondWithFilteredResult(_0xcd2d7d,_0x1855bc){return function(_0x289c1c){if(_0x289c1c){var _0x302aa2=_0x289c1c[_0x548d('0x1b')],_0x2a7219=_0x1855bc[_0x548d('0x1c')],_0x50ef52=_0x1855bc[_0x548d('0x1c')]+_0x1855bc['limit'],_0x5dd20d;if(_0x50ef52>=_0x302aa2){_0x50ef52=_0x302aa2;_0x5dd20d=0xc8;}else{_0x5dd20d=0xce;}_0xcd2d7d[_0x548d('0x18')](_0x5dd20d);return _0xcd2d7d['set']('Content-Range',_0x2a7219+'-'+_0x50ef52+'/'+_0x302aa2)[_0x548d('0x1a')](_0x289c1c);}return null;};}function patchUpdates(_0x5ebb22){return function(_0x22505f){try{jsonpatch['apply'](_0x22505f,_0x5ebb22,!![]);}catch(_0x3efa01){return BPromise[_0x548d('0x1d')](_0x3efa01);}return _0x22505f[_0x548d('0x1e')]();};}function saveUpdates(_0x4321d4,_0x594773){return function(_0x3d16b8){if(_0x3d16b8){return _0x3d16b8[_0x548d('0x1f')](_0x4321d4)[_0x548d('0x20')](function(_0x32bf1d){return _0x32bf1d;});}return null;};}function removeEntity(_0x519b4c,_0x146ecb){return function(_0x12c2ef){if(_0x12c2ef){return _0x12c2ef[_0x548d('0x21')]()[_0x548d('0x20')](function(){_0x519b4c['status'](0xcc)[_0x548d('0x19')]();});}};}function handleEntityNotFound(_0x23a481,_0x2ad9bc){return function(_0x5057b7){if(!_0x5057b7){_0x23a481[_0x548d('0x17')](0x194);}return _0x5057b7;};}function handleError(_0x152083,_0x7d5957){_0x7d5957=_0x7d5957||0x1f4;return function(_0x4adf99){logger[_0x548d('0x22')](_0x4adf99[_0x548d('0x23')]);if(_0x4adf99['name']){delete _0x4adf99[_0x548d('0x24')];}_0x152083[_0x548d('0x18')](_0x7d5957)[_0x548d('0x25')](_0x4adf99);};}exports[_0x548d('0x26')]=function(_0x50b4b8,_0x56a3b4){var _0x194fde={},_0x5113a9={},_0x108de8={'count':0x0,'rows':[]};var _0x4da67e=db[_0x548d('0x27')][_0x548d('0x28')];_0x5113a9[_0x548d('0x29')]=_[_0x548d('0x2a')](_[_0x548d('0x2b')](_0x4da67e),[_0x548d('0x2c')]);_0x5113a9['query']=_['keys'](_0x50b4b8['query']);_0x5113a9[_0x548d('0x2d')]=_[_0x548d('0x2e')](_0x5113a9[_0x548d('0x29')],_0x5113a9['query']);_0x194fde[_0x548d('0x2f')]=_[_0x548d('0x2e')](_0x5113a9[_0x548d('0x29')],qs[_0x548d('0x30')](_0x50b4b8[_0x548d('0x31')]['fields']));_0x194fde[_0x548d('0x2f')]=_0x194fde[_0x548d('0x2f')][_0x548d('0x32')]?_0x194fde['attributes']:_0x5113a9[_0x548d('0x29')];if(!_0x50b4b8[_0x548d('0x31')][_0x548d('0x33')](_0x548d('0x34'))){_0x194fde[_0x548d('0x35')]=qs[_0x548d('0x35')](_0x50b4b8[_0x548d('0x31')][_0x548d('0x35')]);_0x194fde[_0x548d('0x1c')]=qs[_0x548d('0x1c')](_0x50b4b8['query'][_0x548d('0x1c')]);}_0x194fde[_0x548d('0x36')]=qs[_0x548d('0x37')](_0x50b4b8[_0x548d('0x31')][_0x548d('0x37')]);_0x194fde['where']=qs['filters'](_['pick'](_0x50b4b8['query'],_0x5113a9[_0x548d('0x2d')]));if(_0x50b4b8['query'][_0x548d('0x38')]){_0x194fde[_0x548d('0x39')]=_[_0x548d('0x3a')](_0x194fde[_0x548d('0x39')],{'$or':_[_0x548d('0x3b')](_0x4da67e,function(_0x16a68c){if(_0x16a68c['type']['key']!==_0x548d('0x3c')){var _0x53a765={};_0x53a765[_0x16a68c[_0x548d('0x3d')]]={'$like':'%'+_0x50b4b8[_0x548d('0x31')][_0x548d('0x38')]+'%'};return _0x53a765;}})});}_0x194fde=_[_0x548d('0x3a')]({},_0x194fde,_0x50b4b8[_0x548d('0x3e')]);var _0x4de5c1={'where':_0x194fde[_0x548d('0x39')]};return db[_0x548d('0x27')][_0x548d('0x1b')](_0x4de5c1)[_0x548d('0x20')](function(_0x3ae1c3){_0x108de8[_0x548d('0x1b')]=_0x3ae1c3;if(_0x50b4b8['query'][_0x548d('0x3f')]){_0x194fde[_0x548d('0x40')]=[{'all':!![]}];}return db[_0x548d('0x27')][_0x548d('0x41')](_0x194fde);})['then'](function(_0x236e42){_0x108de8[_0x548d('0x42')]=_0x236e42;return _0x108de8;})[_0x548d('0x20')](respondWithFilteredResult(_0x56a3b4,_0x194fde))[_0x548d('0x43')](handleError(_0x56a3b4,null));};exports[_0x548d('0x44')]=function(_0x1ee074,_0x49d87e){var _0x4119c7={'raw':![],'where':{'id':_0x1ee074['params']['id']}},_0x43a210={};_0x43a210[_0x548d('0x29')]=_[_0x548d('0x2b')](db[_0x548d('0x27')]['rawAttributes']);_0x43a210[_0x548d('0x31')]=_[_0x548d('0x2b')](_0x1ee074[_0x548d('0x31')]);_0x43a210[_0x548d('0x2d')]=_[_0x548d('0x2e')](_0x43a210[_0x548d('0x29')],_0x43a210[_0x548d('0x31')]);_0x4119c7[_0x548d('0x2f')]=_['intersection'](_0x43a210[_0x548d('0x29')],qs['fields'](_0x1ee074['query'][_0x548d('0x30')]));_0x4119c7['attributes']=_0x4119c7[_0x548d('0x2f')][_0x548d('0x32')]?_0x4119c7[_0x548d('0x2f')]:_0x43a210[_0x548d('0x29')];if(_0x1ee074['query'][_0x548d('0x3f')]){_0x4119c7['include']=[{'all':!![]}];}_0x4119c7=_[_0x548d('0x3a')]({},_0x4119c7,_0x1ee074[_0x548d('0x3e')]);return db['ScreenRecording'][_0x548d('0x45')](_0x4119c7)[_0x548d('0x20')](handleEntityNotFound(_0x49d87e,null))[_0x548d('0x20')](respondWithResult(_0x49d87e,null))[_0x548d('0x43')](handleError(_0x49d87e,null));};exports[_0x548d('0x46')]=function(_0x2e2789,_0x1f043f){return db[_0x548d('0x27')][_0x548d('0x46')](_0x2e2789['body'],{})['then'](respondWithResult(_0x1f043f,0xc9))[_0x548d('0x43')](handleError(_0x1f043f,null));};exports['update']=function(_0x392cac,_0xdc4f66){if(_0x392cac['body']['id']){delete _0x392cac[_0x548d('0x47')]['id'];}delete _0x392cac[_0x548d('0x47')]['duration'];delete _0x392cac[_0x548d('0x47')][_0x548d('0x48')];delete _0x392cac['body'][_0x548d('0x49')];delete _0x392cac['body'][_0x548d('0x4a')];return db[_0x548d('0x27')][_0x548d('0x45')]({'where':{'id':_0x392cac[_0x548d('0x4b')]['id']}})[_0x548d('0x20')](handleEntityNotFound(_0xdc4f66,null))['then'](saveUpdates(_0x392cac[_0x548d('0x47')],null))[_0x548d('0x20')](respondWithResult(_0xdc4f66,null))[_0x548d('0x43')](handleError(_0xdc4f66,null));};exports[_0x548d('0x21')]=function(_0x467373,_0x457daa){return db[_0x548d('0x27')][_0x548d('0x45')]({'where':{'id':_0x467373[_0x548d('0x4b')]['id']}})[_0x548d('0x20')](handleEntityNotFound(_0x457daa,null))[_0x548d('0x20')](removeEntity(_0x457daa,null))[_0x548d('0x43')](handleError(_0x457daa,null));};exports[_0x548d('0x4c')]=function(_0x3b50db,_0x279e66){return db[_0x548d('0x27')][_0x548d('0x4c')]()[_0x548d('0x20')](respondWithResult(_0x279e66,null))[_0x548d('0x43')](handleError(_0x279e66,null));};exports[_0x548d('0x4d')]=function(_0x46e603,_0x58b271,_0x3734e3){var _0x13ad5c=require('../../components/encryptor');var _0x3ce59f=![];var _0x1452df={};if(_0x46e603['query'][_0x548d('0x4e')]&&_0x46e603[_0x548d('0x31')][_0x548d('0x4e')]==='uniqueid'){_0x1452df[_0x548d('0x4f')]=_0x46e603['params']['id'];}else{_0x1452df['id']=_0x46e603['params']['id'];}return db[_0x548d('0x27')][_0x548d('0x45')]({'where':_0x1452df,'attributes':['id',_0x548d('0x4a')],'raw':!![]})[_0x548d('0x20')](handleEntityNotFound(_0x58b271,null))['then'](function(_0x24bac9){if(_0x24bac9){var _0x240295=path['join'](config[_0x548d('0x50')],'server/files/screen_recordings',_0x24bac9[_0x548d('0x4a')]);var _0x10ad1b=util[_0x548d('0x2c')]('%s.cypher',_0x240295);if(fs[_0x548d('0x51')](_0x10ad1b)){_0x3ce59f=!![];return _0x13ad5c['decryptFile'](_0x10ad1b,_0x240295,config['secrets']['recording'])[_0x548d('0x20')](function(){return _0x24bac9;});}return _0x24bac9;}})[_0x548d('0x20')](function(_0x2fd6a5){if(_0x2fd6a5){var _0x565c3b=path['join'](config['root'],_0x548d('0x52'),_0x2fd6a5[_0x548d('0x4a')]);if(!fs[_0x548d('0x51')](_0x565c3b)){throw new db[(_0x548d('0x53'))]['ValidationError'](_0x548d('0x54'));}if(_0x2fd6a5[_0x548d('0x55')]){return _0x58b271['download'](_0x565c3b,_0x2fd6a5[_0x548d('0x55')]+path[_0x548d('0x56')](_0x565c3b),function(){if(_0x3ce59f){fs[_0x548d('0x57')](_0x565c3b);}});}else{return _0x58b271[_0x548d('0x4d')](_0x565c3b,function(_0x225c78){if(_0x3ce59f){fs[_0x548d('0x57')](_0x565c3b);}});}}})['catch'](function(_0x3f5725){if(_0x3f5725[_0x548d('0x58')]==='ScreenRecording\x20not\x20found'){_0x58b271[_0x548d('0x18')](0x194)['send']('Not\x20found');}else{return handleError(_0x58b271,null);}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 0eeafd3..88e94b6 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 _0xf5f1=['path','rimraf','../../config/environment','./screenRecording.attributes','exports','screen_recordings','interactionid','isNil','value','join','root','server','existsSync','log','catch','resolve','finally','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0xf5f1,0xe9));var _0x1f5f=function(_0x490f60,_0x14c1e2){_0x490f60=_0x490f60-0x0;var _0x1bba70=_0xf5f1[_0x490f60];return _0x1bba70;};'use strict';var _=require(_0x1f5f('0x0'));var util=require(_0x1f5f('0x1'));var logger=require(_0x1f5f('0x2'))(_0x1f5f('0x3'));var moment=require(_0x1f5f('0x4'));var BPromise=require(_0x1f5f('0x5'));var rp=require(_0x1f5f('0x6'));var fs=require('fs');var path=require(_0x1f5f('0x7'));var rimraf=require(_0x1f5f('0x8'));var config=require(_0x1f5f('0x9'));var attributes=require(_0x1f5f('0xa'));module[_0x1f5f('0xb')]=function(_0x4eaec6,_0x5c1d09){return _0x4eaec6['define']('ScreenRecording',attributes,{'tableName':_0x1f5f('0xc'),'paranoid':![],'indexes':[{'name':_0x1f5f('0xd'),'fields':[_0x1f5f('0xd')]}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x5a28e2,_0x5bcb9d,_0x448115){return new BPromise(function(_0x32bb7a,_0x575a05){if(!_[_0x1f5f('0xe')](_0x5a28e2[_0x1f5f('0xf')])){var _0x177a0f=path[_0x1f5f('0x10')](config[_0x1f5f('0x11')],_0x1f5f('0x12'),'files',_0x1f5f('0xc'),_0x5a28e2[_0x1f5f('0xf')]);if(fs[_0x1f5f('0x13')](_0x177a0f)){rimraf(_0x177a0f,function(_0xf431b5){if(_0xf431b5){console[_0x1f5f('0x14')](_0xf431b5);}});}}_0x32bb7a();})[_0x1f5f('0x15')](function(_0x34ba53){BPromise[_0x1f5f('0x16')]();})[_0x1f5f('0x17')](function(){_0x448115();});}}});}; \ No newline at end of file +var _0xf04e=['value','existsSync','log','resolve','finally','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./screenRecording.attributes','exports','screen_recordings','interactionid','isNil','join','server','files'];(function(_0x1f204c,_0x3edf0b){var _0x3b94e7=function(_0x1bdd0d){while(--_0x1bdd0d){_0x1f204c['push'](_0x1f204c['shift']());}};_0x3b94e7(++_0x3edf0b);}(_0xf04e,0xcd));var _0xef04=function(_0x3048d0,_0x566f44){_0x3048d0=_0x3048d0-0x0;var _0x3d3c0d=_0xf04e[_0x3048d0];return _0x3d3c0d;};'use strict';var _=require(_0xef04('0x0'));var util=require('util');var logger=require(_0xef04('0x1'))(_0xef04('0x2'));var moment=require(_0xef04('0x3'));var BPromise=require('bluebird');var rp=require(_0xef04('0x4'));var fs=require('fs');var path=require(_0xef04('0x5'));var rimraf=require(_0xef04('0x6'));var config=require('../../config/environment');var attributes=require(_0xef04('0x7'));module[_0xef04('0x8')]=function(_0x213ff0,_0x154c84){return _0x213ff0['define']('ScreenRecording',attributes,{'tableName':_0xef04('0x9'),'paranoid':![],'indexes':[{'name':_0xef04('0xa'),'fields':[_0xef04('0xa')]}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x43ec87,_0x59910e,_0x586906){return new BPromise(function(_0x517318,_0x16f1fa){if(!_[_0xef04('0xb')](_0x43ec87['value'])){var _0x5509e8=path[_0xef04('0xc')](config['root'],_0xef04('0xd'),_0xef04('0xe'),'screen_recordings',_0x43ec87[_0xef04('0xf')]);if(fs[_0xef04('0x10')](_0x5509e8)){rimraf(_0x5509e8,function(_0x13963e){if(_0x13963e){console[_0xef04('0x11')](_0x13963e);}});}}_0x517318();})['catch'](function(_0x1a8cb7){BPromise[_0xef04('0x12')]();})[_0xef04('0x13')](function(){_0x586906();});}}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index fa02c57..2f83d46 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 _0x8958=['client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x21b359,_0x4dc80e){var _0x57b8e7=function(_0x135adb){while(--_0x135adb){_0x21b359['push'](_0x21b359['shift']());}};_0x57b8e7(++_0x4dc80e);}(_0x8958,0x93));var _0x8895=function(_0x1d209c,_0x633e4a){_0x1d209c=_0x1d209c-0x0;var _0x33c332=_0x8958[_0x1d209c];return _0x33c332;};'use strict';var _=require('lodash');var util=require(_0x8895('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8895('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x8895('0x2'))(_0x8895('0x3'));var config=require(_0x8895('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x8895('0x5')][_0x8895('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x124e1e,_0x40cec6,_0x33013a){return new BPromise(function(_0x51376b,_0xe018b8){return client[_0x8895('0x7')](_0x124e1e,_0x33013a)[_0x8895('0x8')](function(_0x24fe49){logger[_0x8895('0x9')](_0x8895('0xa'),_0x40cec6,_0x8895('0xb'));logger[_0x8895('0xc')](_0x8895('0xd'),_0x40cec6,_0x8895('0xb'),JSON['stringify'](_0x24fe49));if(_0x24fe49[_0x8895('0xe')]){if(_0x24fe49[_0x8895('0xe')][_0x8895('0xf')]===0x1f4){logger[_0x8895('0xe')](_0x8895('0xa'),_0x40cec6,_0x24fe49[_0x8895('0xe')]['message']);return _0xe018b8(_0x24fe49[_0x8895('0xe')][_0x8895('0x10')]);}logger[_0x8895('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x40cec6,_0x24fe49['error'][_0x8895('0x10')]);return _0x51376b(_0x24fe49['error'][_0x8895('0x10')]);}else{logger[_0x8895('0x9')](_0x8895('0xa'),_0x40cec6,_0x8895('0xb'));_0x51376b(_0x24fe49[_0x8895('0x11')]['message']);}})[_0x8895('0x12')](function(_0x100fc8){logger[_0x8895('0xe')](_0x8895('0xa'),_0x40cec6,_0x100fc8);_0xe018b8(_0x100fc8);});});} \ No newline at end of file +var _0x33c5=['then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x33c5,0xe6));var _0x533c=function(_0x15e6fe,_0x1a5c39){_0x15e6fe=_0x15e6fe-0x0;var _0x34894d=_0x33c5[_0x15e6fe];return _0x34894d;};'use strict';var _=require('lodash');var util=require(_0x533c('0x0'));var moment=require(_0x533c('0x1'));var BPromise=require('bluebird');var rs=require(_0x533c('0x2'));var fs=require('fs');var Redis=require(_0x533c('0x3'));var db=require(_0x533c('0x4'))['db'];var utils=require(_0x533c('0x5'));var logger=require(_0x533c('0x6'))('rpc');var config=require(_0x533c('0x7'));var jayson=require(_0x533c('0x8'));var client=jayson[_0x533c('0x9')][_0x533c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34ca89,_0x1699d5,_0x3a009b){return new BPromise(function(_0x36d74e,_0x2c297c){return client[_0x533c('0xb')](_0x34ca89,_0x3a009b)[_0x533c('0xc')](function(_0x46536d){logger[_0x533c('0xd')](_0x533c('0xe'),_0x1699d5,_0x533c('0xf'));logger[_0x533c('0x10')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x1699d5,_0x533c('0xf'),JSON[_0x533c('0x11')](_0x46536d));if(_0x46536d[_0x533c('0x12')]){if(_0x46536d[_0x533c('0x12')][_0x533c('0x13')]===0x1f4){logger[_0x533c('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x1699d5,_0x46536d[_0x533c('0x12')][_0x533c('0x14')]);return _0x2c297c(_0x46536d[_0x533c('0x12')][_0x533c('0x14')]);}logger[_0x533c('0x12')](_0x533c('0xe'),_0x1699d5,_0x46536d[_0x533c('0x12')][_0x533c('0x14')]);return _0x36d74e(_0x46536d['error'][_0x533c('0x14')]);}else{logger[_0x533c('0xd')](_0x533c('0xe'),_0x1699d5,_0x533c('0xf'));_0x36d74e(_0x46536d['result'][_0x533c('0x14')]);}})[_0x533c('0x15')](function(_0x41e22c){logger[_0x533c('0x12')](_0x533c('0xe'),_0x1699d5,_0x41e22c);_0x2c297c(_0x41e22c);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 77e72eb..848acf6 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 _0x5eef=['addPreferred','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./setting.controller','get','isAuthenticated','/:id','show','/:id/logo','getLogoLogin','/:id/gdpr','gdpr','join','root','server/files/images/logos/','format','%s%s','logo','extname','post','single','diskStorage','logologin','originalname','file','addLogoLogin','preferred','/:id/preferred'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x5eef,0x161));var _0xf5ee=function(_0x530e73,_0x544b03){_0x530e73=_0x530e73-0x0;var _0x54c6d6=_0x5eef[_0x530e73];return _0x54c6d6;};'use strict';var multer=require(_0xf5ee('0x0'));var util=require(_0xf5ee('0x1'));var path=require(_0xf5ee('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf5ee('0x3')]();var auth=require(_0xf5ee('0x4'));var interaction=require(_0xf5ee('0x5'));var config=require('../../config/environment');var controller=require(_0xf5ee('0x6'));router[_0xf5ee('0x7')]('/',auth[_0xf5ee('0x8')](),controller['index']);router['get'](_0xf5ee('0x9'),controller[_0xf5ee('0xa')]);router[_0xf5ee('0x7')](_0xf5ee('0xb'),controller['getLogo']);router[_0xf5ee('0x7')]('/:id/logo_login',controller[_0xf5ee('0xc')]);router[_0xf5ee('0x7')](_0xf5ee('0xd'),controller[_0xf5ee('0xe')]);router[_0xf5ee('0x7')]('/:id/preferred',controller['getPreferred']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3fa91d,_0x3bff95,_0x21369c){_0x21369c(null,path[_0xf5ee('0xf')](config[_0xf5ee('0x10')],_0xf5ee('0x11')));},'filename':function(_0x524286,_0x5a84e2,_0xbfe535){_0xbfe535(null,util[_0xf5ee('0x12')](_0xf5ee('0x13'),_0xf5ee('0x14'),path[_0xf5ee('0x15')](_0x5a84e2['originalname'])));}})});router[_0xf5ee('0x16')]('/:id/logo',upload[_0xf5ee('0x17')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xf5ee('0x18')]({'destination':function(_0x19ef7b,_0x233fb6,_0x4b0601){_0x4b0601(null,path[_0xf5ee('0xf')](config[_0xf5ee('0x10')],_0xf5ee('0x11')));},'filename':function(_0x1f9dc0,_0x1900c6,_0x2291fa){_0x2291fa(null,util[_0xf5ee('0x12')]('%s%s',_0xf5ee('0x19'),path[_0xf5ee('0x15')](_0x1900c6[_0xf5ee('0x1a')])));}})});router[_0xf5ee('0x16')]('/:id/logo_login',upload[_0xf5ee('0x17')](_0xf5ee('0x1b')),controller[_0xf5ee('0x1c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1b978a,_0x56b9f2,_0x31c49c){_0x31c49c(null,path[_0xf5ee('0xf')](config[_0xf5ee('0x10')],_0xf5ee('0x11')));},'filename':function(_0x4ac394,_0xfa96a5,_0x4d2735){_0x4d2735(null,util[_0xf5ee('0x12')]('%s%s',_0xf5ee('0x1d'),path[_0xf5ee('0x15')](_0xfa96a5['originalname'])));}})});router[_0xf5ee('0x16')](_0xf5ee('0x1e'),upload[_0xf5ee('0x17')]('file'),controller[_0xf5ee('0x1f')]);router['put']('/:id',auth[_0xf5ee('0x8')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0xc126=['./setting.controller','isAuthenticated','index','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','get','gdpr','/:id/preferred','getPreferred','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single','file','addLogo','logologin','addLogoLogin','preferred','addPreferred','/:id','update','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x554e43,_0x3cec90){var _0xf2c423=function(_0x3dda6c){while(--_0x3dda6c){_0x554e43['push'](_0x554e43['shift']());}};_0xf2c423(++_0x3cec90);}(_0xc126,0x131));var _0x6c12=function(_0x445b1a,_0x18fdeb){_0x445b1a=_0x445b1a-0x0;var _0x3161e5=_0xc126[_0x445b1a];return _0x3161e5;};'use strict';var multer=require(_0x6c12('0x0'));var util=require(_0x6c12('0x1'));var path=require(_0x6c12('0x2'));var timeout=require(_0x6c12('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x6c12('0x4'));var interaction=require(_0x6c12('0x5'));var config=require(_0x6c12('0x6'));var controller=require(_0x6c12('0x7'));router['get']('/',auth[_0x6c12('0x8')](),controller[_0x6c12('0x9')]);router['get']('/:id',controller[_0x6c12('0xa')]);router['get'](_0x6c12('0xb'),controller[_0x6c12('0xc')]);router['get'](_0x6c12('0xd'),controller[_0x6c12('0xe')]);router[_0x6c12('0xf')]('/:id/gdpr',controller[_0x6c12('0x10')]);router['get'](_0x6c12('0x11'),controller[_0x6c12('0x12')]);var upload=multer({'storage':multer[_0x6c12('0x13')]({'destination':function(_0x6a8b79,_0x3268d8,_0x5c3686){_0x5c3686(null,path[_0x6c12('0x14')](config[_0x6c12('0x15')],_0x6c12('0x16')));},'filename':function(_0x2c81f2,_0x9aa5f3,_0x46c76f){_0x46c76f(null,util[_0x6c12('0x17')](_0x6c12('0x18'),_0x6c12('0x19'),path[_0x6c12('0x1a')](_0x9aa5f3[_0x6c12('0x1b')])));}})});router[_0x6c12('0x1c')](_0x6c12('0xb'),upload[_0x6c12('0x1d')](_0x6c12('0x1e')),controller[_0x6c12('0x1f')]);var upload=multer({'storage':multer[_0x6c12('0x13')]({'destination':function(_0x22aceb,_0xbb846f,_0x5653fe){_0x5653fe(null,path[_0x6c12('0x14')](config[_0x6c12('0x15')],'server/files/images/logos/'));},'filename':function(_0x55f22c,_0x32781d,_0x114839){_0x114839(null,util[_0x6c12('0x17')](_0x6c12('0x18'),_0x6c12('0x20'),path['extname'](_0x32781d[_0x6c12('0x1b')])));}})});router[_0x6c12('0x1c')](_0x6c12('0xd'),upload[_0x6c12('0x1d')]('file'),controller[_0x6c12('0x21')]);var upload=multer({'storage':multer[_0x6c12('0x13')]({'destination':function(_0x174009,_0x493b95,_0x4170b1){_0x4170b1(null,path[_0x6c12('0x14')](config[_0x6c12('0x15')],_0x6c12('0x16')));},'filename':function(_0x3f446f,_0x4949df,_0x4dfbdb){_0x4dfbdb(null,util[_0x6c12('0x17')](_0x6c12('0x18'),_0x6c12('0x22'),path[_0x6c12('0x1a')](_0x4949df[_0x6c12('0x1b')])));}})});router[_0x6c12('0x1c')](_0x6c12('0x11'),upload['single'](_0x6c12('0x1e')),controller[_0x6c12('0x23')]);router['put'](_0x6c12('0x24'),auth[_0x6c12('0x8')](),controller[_0x6c12('0x25')]);module[_0x6c12('0x26')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index fcf09df..ca0f471 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 _0x6ea9=['https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize','exports','INTEGER','min_internal','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x57928b,_0x29a111){var _0x49aad6=function(_0x34a268){while(--_0x34a268){_0x57928b['push'](_0x57928b['shift']());}};_0x49aad6(++_0x29a111);}(_0x6ea9,0x89));var _0x96ea=function(_0x2f4a4a,_0x58ac7b){_0x2f4a4a=_0x2f4a4a-0x0;var _0x5bf5ed=_0x6ea9[_0x2f4a4a];return _0x5bf5ed;};'use strict';var Sequelize=require(_0x96ea('0x0'));module[_0x96ea('0x1')]={'min_internal':{'type':Sequelize[_0x96ea('0x2')](0xb),'unique':_0x96ea('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x96ea('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x96ea('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x96ea('0x4')],'defaultValue':_0x96ea('0x5')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x96ea('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x96ea('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x96ea('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x96ea('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x96ea('0x4')]},'turnaddr':{'type':Sequelize[_0x96ea('0x4')]},'turnusername':{'type':Sequelize[_0x96ea('0x4')]},'turnpassword':{'type':Sequelize[_0x96ea('0x4')]},'pageTitle':{'type':Sequelize[_0x96ea('0x4')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x96ea('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x96ea('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x96ea('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x96ea('0x4')],'defaultValue':_0x96ea('0x7')},'enableEmailPreview':{'type':Sequelize[_0x96ea('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x96ea('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x96ea('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x96ea('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x96ea('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x96ea('0x8')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x96ea('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x96ea('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x96ea('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x96ea('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x96ea('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x96ea('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0x3f19=['sequelize','INTEGER','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml'];(function(_0x1494c7,_0x2d3601){var _0x3a1356=function(_0x1f880a){while(--_0x1f880a){_0x1494c7['push'](_0x1494c7['shift']());}};_0x3a1356(++_0x2d3601);}(_0x3f19,0xc0));var _0x93f1=function(_0x154a0a,_0x96977b){_0x154a0a=_0x154a0a-0x0;var _0x550392=_0x3f19[_0x154a0a];return _0x550392;};'use strict';var Sequelize=require(_0x93f1('0x0'));module['exports']={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x93f1('0x1')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x93f1('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x93f1('0x2')],'defaultValue':_0x93f1('0x3')},'logo':{'type':Sequelize[_0x93f1('0x2')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x93f1('0x2')]},'defaultLoginLogo':{'type':Sequelize[_0x93f1('0x4')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x93f1('0x2')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x93f1('0x4')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x93f1('0x4')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x93f1('0x4')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x93f1('0x2')]},'turnusername':{'type':Sequelize[_0x93f1('0x2')]},'turnpassword':{'type':Sequelize[_0x93f1('0x2')]},'pageTitle':{'type':Sequelize[_0x93f1('0x2')]},'defaultPageTitle':{'type':Sequelize[_0x93f1('0x4')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x93f1('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x93f1('0x4')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x93f1('0x2')],'defaultValue':_0x93f1('0x5')},'enableEmailPreview':{'type':Sequelize[_0x93f1('0x4')],'defaultValue':![]},'split':{'type':Sequelize[_0x93f1('0x4')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x93f1('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x93f1('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x93f1('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x93f1('0x2')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x93f1('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x93f1('0x4')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x93f1('0x2')]},'defaultPreferred':{'type':Sequelize[_0x93f1('0x4')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x93f1('0x2')]},'allowedLoginAttempts':{'type':Sequelize[_0x93f1('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x93f1('0x1')],'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 66102f7..f288244 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 _0xed68=['server/files/templates/turn.ejs','utf8','writeFileSync','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','Reload','res_rtp_asterisk.so','file','filename','body','logo','find','addLogoLogin','server/files/images/logos','loginLogo','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','toLower','default_logo.png','default','upperFirst','Sequelize','ValidationError','Logo\x20not\x20found','download','../../config/license/util','getLogoLogin','preferred','default_loginLogo.png','gdpr','securePassword','getPreferred','getLicense','custom','default_preferred.png','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','util','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','Setting,\x20%s,\x20%s','debug','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','Setting','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','show','params','rawAttributes','length','get','readFileSync','join','root','server/files/templates/stun.ejs','render'];(function(_0x3b3ecb,_0x17572f){var _0x130268=function(_0x325dba){while(--_0x325dba){_0x3b3ecb['push'](_0x3b3ecb['shift']());}};_0x130268(++_0x17572f);}(_0xed68,0x199));var _0x8ed6=function(_0x9729d7,_0x1b79a8){_0x9729d7=_0x9729d7-0x0;var _0x3c4ac6=_0xed68[_0x9729d7];return _0x3c4ac6;};'use strict';var pdf=require(_0x8ed6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8ed6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8ed6('0x2'));var rp=require(_0x8ed6('0x3'));var moment=require('moment');var BPromise=require(_0x8ed6('0x4'));var Mustache=require('mustache');var util=require(_0x8ed6('0x5'));var path=require('path');var sox=require(_0x8ed6('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x8ed6('0x7'));var squel=require('squel');var crypto=require(_0x8ed6('0x8'));var jsforce=require(_0x8ed6('0x9'));var deskjs=require(_0x8ed6('0xa'));var toCsv=require(_0x8ed6('0xb'));var querystring=require(_0x8ed6('0xc'));var Papa=require(_0x8ed6('0xd'));var Redis=require(_0x8ed6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8ed6('0xf'));var hardwareService=require(_0x8ed6('0x10'));var logger=require(_0x8ed6('0x11'))(_0x8ed6('0x12'));var utils=require(_0x8ed6('0x13'));var config=require(_0x8ed6('0x14'));var db=require(_0x8ed6('0x15'))['db'];var jayson=require(_0x8ed6('0x16'));var client=jayson[_0x8ed6('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x539e86,_0x480e79,_0x165147){if(_0x165147){var _0x3a71cc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3a71cc[_0x8ed6('0x18')](_0x480e79)){return _0x539e86;}else{throw new Error(_0x8ed6('0x19'));}}else{return _0x539e86;}}function respondWithRpcPromise(_0x48e1d1,_0x2bf46f,_0x24706a,_0x5673df){return new BPromise(function(_0x30eca6,_0x5aa7df){var _0x43e17f=_0x5673df||client;return _0x43e17f[_0x8ed6('0x1a')](_0x48e1d1,_0x24706a)['then'](function(_0x1a5858){logger[_0x8ed6('0x1b')](_0x8ed6('0x1c'),_0x2bf46f,'request\x20sent');logger[_0x8ed6('0x1d')]('Setting,\x20%s,\x20%s,\x20%s',_0x2bf46f,'request\x20sent',JSON[_0x8ed6('0x1e')](_0x1a5858));if(_0x1a5858[_0x8ed6('0x1f')]){if(_0x1a5858[_0x8ed6('0x1f')]['code']===0x1f4){logger[_0x8ed6('0x1f')](_0x8ed6('0x1c'),_0x2bf46f,_0x1a5858[_0x8ed6('0x1f')]['message']);return _0x5aa7df(_0x1a5858[_0x8ed6('0x1f')]['message']);}logger[_0x8ed6('0x1f')]('Setting,\x20%s,\x20%s',_0x2bf46f,_0x1a5858[_0x8ed6('0x1f')][_0x8ed6('0x20')]);return _0x30eca6(_0x1a5858[_0x8ed6('0x1f')][_0x8ed6('0x20')]);}else{logger[_0x8ed6('0x1b')](_0x8ed6('0x1c'),_0x2bf46f,'request\x20sent');_0x30eca6(_0x1a5858[_0x8ed6('0x21')][_0x8ed6('0x20')]);}})[_0x8ed6('0x22')](function(_0x25ba15){logger[_0x8ed6('0x1f')](_0x8ed6('0x1c'),_0x2bf46f,_0x25ba15);_0x5aa7df(_0x25ba15);});});}function respondWithStatusCode(_0x1bddd6,_0x5811d1){_0x5811d1=_0x5811d1||0xcc;return function(_0x9dd930){if(_0x9dd930){return _0x1bddd6[_0x8ed6('0x23')](_0x5811d1);}return _0x1bddd6[_0x8ed6('0x24')](_0x5811d1)[_0x8ed6('0x25')]();};}function respondWithResult(_0x3f52d3,_0x3aa3f3){_0x3aa3f3=_0x3aa3f3||0xc8;return function(_0x514676){if(_0x514676){return _0x3f52d3['status'](_0x3aa3f3)[_0x8ed6('0x26')](_0x514676);}};}function respondWithFilteredResult(_0x1bcd2e,_0x4701b3){return function(_0x7f1c3f){if(_0x7f1c3f){var _0xc1bb60=_0x7f1c3f[_0x8ed6('0x27')],_0x27cae7=_0x4701b3[_0x8ed6('0x28')],_0xd3391a=_0x4701b3[_0x8ed6('0x28')]+_0x4701b3[_0x8ed6('0x29')],_0xd86c20;if(_0xd3391a>=_0xc1bb60){_0xd3391a=_0xc1bb60;_0xd86c20=0xc8;}else{_0xd86c20=0xce;}_0x1bcd2e[_0x8ed6('0x24')](_0xd86c20);return _0x1bcd2e[_0x8ed6('0x2a')](_0x8ed6('0x2b'),_0x27cae7+'-'+_0xd3391a+'/'+_0xc1bb60)[_0x8ed6('0x26')](_0x7f1c3f);}return null;};}function patchUpdates(_0x29d8ec){return function(_0x2b1750){try{jsonpatch[_0x8ed6('0x2c')](_0x2b1750,_0x29d8ec,!![]);}catch(_0x576fc3){return BPromise[_0x8ed6('0x2d')](_0x576fc3);}return _0x2b1750[_0x8ed6('0x2e')]();};}function saveUpdates(_0xe6df5b,_0x6f0c5d){return function(_0x4a1613){if(_0x4a1613){return _0x4a1613[_0x8ed6('0x2f')](_0xe6df5b)['then'](function(_0x382560){return _0x382560;});}return null;};}function removeEntity(_0x8fbebf,_0xceb24b){return function(_0x18022b){if(_0x18022b){return _0x18022b[_0x8ed6('0x30')]()[_0x8ed6('0x31')](function(){_0x8fbebf['status'](0xcc)[_0x8ed6('0x25')]();});}};}function handleEntityNotFound(_0x5ac08a,_0x28cd39){return function(_0x45e1de){if(!_0x45e1de){_0x5ac08a['sendStatus'](0x194);}return _0x45e1de;};}function handleError(_0x2ea505,_0x5aaeba){_0x5aaeba=_0x5aaeba||0x1f4;return function(_0x4acbc9){logger[_0x8ed6('0x1f')](_0x4acbc9[_0x8ed6('0x32')]);if(_0x4acbc9['name']){delete _0x4acbc9[_0x8ed6('0x33')];}_0x2ea505[_0x8ed6('0x24')](_0x5aaeba)[_0x8ed6('0x34')](_0x4acbc9);};}exports[_0x8ed6('0x35')]=function(_0x299d2c,_0x224b47){var _0x46e9e2={},_0x2812ac={},_0x18df98={'count':0x0,'rows':[]};var _0x4e1c59=db[_0x8ed6('0x36')]['rawAttributes'];_0x2812ac[_0x8ed6('0x37')]=_[_0x8ed6('0x38')](_0x4e1c59);_0x2812ac[_0x8ed6('0x39')]=_[_0x8ed6('0x38')](_0x299d2c[_0x8ed6('0x39')]);_0x2812ac[_0x8ed6('0x3a')]=_[_0x8ed6('0x3b')](_0x2812ac[_0x8ed6('0x37')],_0x2812ac['query']);_0x46e9e2[_0x8ed6('0x3c')]=_[_0x8ed6('0x3b')](_0x2812ac[_0x8ed6('0x37')],qs['fields'](_0x299d2c['query'][_0x8ed6('0x3d')]));_0x46e9e2['attributes']=_0x46e9e2[_0x8ed6('0x3c')]['length']?_0x46e9e2[_0x8ed6('0x3c')]:_0x2812ac[_0x8ed6('0x37')];if(!_0x299d2c['query'][_0x8ed6('0x3e')]('nolimit')){_0x46e9e2[_0x8ed6('0x29')]=qs['limit'](_0x299d2c['query'][_0x8ed6('0x29')]);_0x46e9e2['offset']=qs['offset'](_0x299d2c['query'][_0x8ed6('0x28')]);}_0x46e9e2[_0x8ed6('0x3f')]=qs[_0x8ed6('0x40')](_0x299d2c[_0x8ed6('0x39')][_0x8ed6('0x40')]);_0x46e9e2[_0x8ed6('0x41')]=qs[_0x8ed6('0x3a')](_['pick'](_0x299d2c[_0x8ed6('0x39')],_0x2812ac[_0x8ed6('0x3a')]));if(_0x299d2c[_0x8ed6('0x39')][_0x8ed6('0x42')]){_0x46e9e2[_0x8ed6('0x41')]=_[_0x8ed6('0x43')](_0x46e9e2[_0x8ed6('0x41')],{'$or':_[_0x8ed6('0x44')](_0x4e1c59,function(_0x6017a1){if(_0x6017a1[_0x8ed6('0x45')][_0x8ed6('0x46')]!==_0x8ed6('0x47')){var _0x223529={};_0x223529[_0x6017a1[_0x8ed6('0x48')]]={'$like':'%'+_0x299d2c[_0x8ed6('0x39')][_0x8ed6('0x42')]+'%'};return _0x223529;}})});}_0x46e9e2=_[_0x8ed6('0x43')]({},_0x46e9e2,_0x299d2c['options']);var _0x55c4a0={'where':_0x46e9e2[_0x8ed6('0x41')]};return db['Setting']['count'](_0x55c4a0)[_0x8ed6('0x31')](function(_0x3fec88){_0x18df98[_0x8ed6('0x27')]=_0x3fec88;if(_0x299d2c[_0x8ed6('0x39')][_0x8ed6('0x49')]){_0x46e9e2[_0x8ed6('0x4a')]=[{'all':!![]}];}return db[_0x8ed6('0x36')][_0x8ed6('0x4b')](_0x46e9e2);})[_0x8ed6('0x31')](function(_0x43d71d){_0x18df98[_0x8ed6('0x4c')]=_0x43d71d;return _0x18df98;})[_0x8ed6('0x31')](respondWithFilteredResult(_0x224b47,_0x46e9e2))[_0x8ed6('0x22')](handleError(_0x224b47,null));};exports[_0x8ed6('0x4d')]=function(_0x2995f0,_0x4d9be4){var _0x4e0a22={'raw':![],'where':{'id':_0x2995f0[_0x8ed6('0x4e')]['id']}},_0x3f4e59={};_0x3f4e59[_0x8ed6('0x37')]=_[_0x8ed6('0x38')](db[_0x8ed6('0x36')][_0x8ed6('0x4f')]);_0x3f4e59['query']=_[_0x8ed6('0x38')](_0x2995f0['query']);_0x3f4e59[_0x8ed6('0x3a')]=_[_0x8ed6('0x3b')](_0x3f4e59[_0x8ed6('0x37')],_0x3f4e59[_0x8ed6('0x39')]);_0x4e0a22['attributes']=_[_0x8ed6('0x3b')](_0x3f4e59[_0x8ed6('0x37')],qs[_0x8ed6('0x3d')](_0x2995f0[_0x8ed6('0x39')][_0x8ed6('0x3d')]));_0x4e0a22[_0x8ed6('0x3c')]=_0x4e0a22['attributes'][_0x8ed6('0x50')]?_0x4e0a22[_0x8ed6('0x3c')]:_0x3f4e59[_0x8ed6('0x37')];if(_0x2995f0[_0x8ed6('0x39')]['includeAll']){_0x4e0a22[_0x8ed6('0x4a')]=[{'all':!![]}];}_0x4e0a22=_[_0x8ed6('0x43')]({},_0x4e0a22,_0x2995f0['options']);return db[_0x8ed6('0x36')]['find'](_0x4e0a22)[_0x8ed6('0x31')](handleEntityNotFound(_0x4d9be4,null))[_0x8ed6('0x31')](respondWithResult(_0x4d9be4,null))[_0x8ed6('0x22')](handleError(_0x4d9be4,null));};exports['update']=function(_0x15af49,_0x24efb9,_0x495c78){var _0x55dc7a;return db['Setting']['find']({'where':{'id':_0x15af49['params']['id']}})[_0x8ed6('0x31')](handleEntityNotFound(_0x24efb9,null))[_0x8ed6('0x31')](saveUpdates(_0x15af49['body'],null))[_0x8ed6('0x31')](function(_0xa91235){if(_0xa91235){_0x55dc7a=_0xa91235[_0x8ed6('0x51')]({'plain':!![]});var _0x53d88d=fs[_0x8ed6('0x52')](path[_0x8ed6('0x53')](config[_0x8ed6('0x54')],_0x8ed6('0x55')),'utf8');var _0x1cbcf4=ejs[_0x8ed6('0x56')](_0x53d88d,_0x55dc7a);var _0x431366=fs['readFileSync'](path[_0x8ed6('0x53')](config['root'],_0x8ed6('0x57')),_0x8ed6('0x58'));var _0xb16f59=ejs['render'](_0x431366,_0x55dc7a);fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x1cbcf4);fs[_0x8ed6('0x59')](_0x8ed6('0x5a'),_0xb16f59);return respondWithRpcPromise('Reload','update',{'module':_0x8ed6('0x5b')});}})[_0x8ed6('0x31')](function(){return respondWithRpcPromise(_0x8ed6('0x5c'),'update',{'module':_0x8ed6('0x5d')});})['then'](function(){return _0x55dc7a||null;})['then'](respondWithResult(_0x24efb9,null))[_0x8ed6('0x22')](handleError(_0x24efb9,null));};exports['addLogo']=function(_0x54dcf4,_0x33eb31,_0x151a3d){if(_0x54dcf4[_0x8ed6('0x5e')]&&_0x54dcf4[_0x8ed6('0x5e')][_0x8ed6('0x5f')]){_0x54dcf4[_0x8ed6('0x60')][_0x8ed6('0x61')]=_0x54dcf4[_0x8ed6('0x5e')]['filename'];}return db[_0x8ed6('0x36')][_0x8ed6('0x62')]({'where':{'id':_0x54dcf4['params']['id']}})['then'](handleEntityNotFound(_0x33eb31,null))['then'](saveUpdates(_0x54dcf4[_0x8ed6('0x60')],null))[_0x8ed6('0x31')](respondWithResult(_0x33eb31,null))[_0x8ed6('0x22')](handleError(_0x33eb31,null));};exports[_0x8ed6('0x63')]=function(_0x5506e5,_0x14a5c1,_0x4aa7ad){if(_0x5506e5[_0x8ed6('0x5e')]&&_0x5506e5[_0x8ed6('0x5e')][_0x8ed6('0x5f')]){_0x5506e5['body']['loginLogo']=_0x5506e5[_0x8ed6('0x5e')]['filename'];}return db[_0x8ed6('0x36')][_0x8ed6('0x62')]({'where':{'id':_0x5506e5[_0x8ed6('0x4e')]['id']}})[_0x8ed6('0x31')](handleEntityNotFound(_0x14a5c1,null))[_0x8ed6('0x31')](saveUpdates(_0x5506e5[_0x8ed6('0x60')],null))['then'](respondWithResult(_0x14a5c1,null))[_0x8ed6('0x22')](handleError(_0x14a5c1,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x3acb2e,_0x42a699,_0x5be0e6){var _0xce8eac=_0x8ed6('0x64');var _0x5778f1={'custom':![]};return utilLicense['getLicense']()[_0x8ed6('0x31')](function(_0x551ad8){if(_0x551ad8){_0x5778f1=_0x551ad8;}return db[_0x8ed6('0x36')][_0x8ed6('0x62')]({'where':{'id':_0x3acb2e[_0x8ed6('0x4e')]['id']},'attributes':[_0x8ed6('0x61'),_0x8ed6('0x65'),'preferred',_0x8ed6('0x66'),_0x8ed6('0x67'),_0x8ed6('0x68')],'raw':!![]});})[_0x8ed6('0x31')](handleEntityNotFound(_0x42a699,null))[_0x8ed6('0x31')](function(_0xacd772){if(_0xacd772){var _0x285321=_0xacd772[_0x8ed6('0x61')]&&fs[_0x8ed6('0x69')](path[_0x8ed6('0x53')](config[_0x8ed6('0x54')],_0xce8eac,_[_0x8ed6('0x6a')](_0xacd772[_0x8ed6('0x61')])))?path[_0x8ed6('0x53')](config['root'],_0xce8eac,_[_0x8ed6('0x6a')](_0xacd772[_0x8ed6('0x61')])):path[_0x8ed6('0x53')](config[_0x8ed6('0x54')],_0xce8eac,_['toLower'](_0x8ed6('0x6b')));var _0xc92c33=_0x8ed6('0x6c')+_[_0x8ed6('0x6d')](_0x8ed6('0x61'));if(_0xacd772[_0xc92c33]||!_0x5778f1['custom']){_0x285321=path[_0x8ed6('0x53')](config[_0x8ed6('0x54')],_0xce8eac,_[_0x8ed6('0x6a')](_0x8ed6('0x6b')));}if(!fs['existsSync'](_0x285321)){throw new db[(_0x8ed6('0x6e'))][(_0x8ed6('0x6f'))](_0x8ed6('0x70'));}return _0x42a699[_0x8ed6('0x71')](_0x285321);}})[_0x8ed6('0x22')](handleError(_0x42a699,null));};var utilLicense=require(_0x8ed6('0x72'));exports[_0x8ed6('0x73')]=function(_0x549d71,_0x44a1de,_0xdf6eef){var _0x264c06=_0x8ed6('0x64');var _0x314790={'custom':![]};return utilLicense['getLicense']()[_0x8ed6('0x31')](function(_0x2a8065){if(_0x2a8065){_0x314790=_0x2a8065;}return db[_0x8ed6('0x36')][_0x8ed6('0x62')]({'where':{'id':_0x549d71['params']['id']},'attributes':[_0x8ed6('0x61'),_0x8ed6('0x65'),_0x8ed6('0x74'),_0x8ed6('0x66'),_0x8ed6('0x67'),_0x8ed6('0x68')],'raw':!![]});})[_0x8ed6('0x31')](handleEntityNotFound(_0x44a1de,null))[_0x8ed6('0x31')](function(_0x37a9b9){if(_0x37a9b9){var _0x576470=_0x37a9b9[_0x8ed6('0x65')]&&fs[_0x8ed6('0x69')](path[_0x8ed6('0x53')](config[_0x8ed6('0x54')],_0x264c06,_['toLower'](_0x37a9b9['loginLogo'])))?path[_0x8ed6('0x53')](config[_0x8ed6('0x54')],_0x264c06,_[_0x8ed6('0x6a')](_0x37a9b9[_0x8ed6('0x65')])):path[_0x8ed6('0x53')](config['root'],_0x264c06,_[_0x8ed6('0x6a')](_0x8ed6('0x75')));var _0x580ec3='default'+_[_0x8ed6('0x6d')]('loginLogo');if(_0x37a9b9[_0x580ec3]||!_0x314790['custom']){_0x576470=path[_0x8ed6('0x53')](config[_0x8ed6('0x54')],_0x264c06,_[_0x8ed6('0x6a')](_0x8ed6('0x75')));}if(!fs[_0x8ed6('0x69')](_0x576470)){throw new db['Sequelize']['ValidationError'](_0x8ed6('0x70'));}return _0x44a1de[_0x8ed6('0x71')](_0x576470);}})[_0x8ed6('0x22')](handleError(_0x44a1de,null));};exports[_0x8ed6('0x76')]=function(_0x366c18,_0xd6ad6a){return db[_0x8ed6('0x36')][_0x8ed6('0x62')]({'where':{'id':_0x366c18[_0x8ed6('0x4e')]['id']},'attributes':[_0x8ed6('0x77')]})[_0x8ed6('0x31')](respondWithResult(_0xd6ad6a,null))['catch'](handleError(_0xd6ad6a,null));};exports['addPreferred']=function(_0x381d07,_0x1e3f10,_0x7b3119){if(_0x381d07[_0x8ed6('0x5e')]&&_0x381d07[_0x8ed6('0x5e')][_0x8ed6('0x5f')]){_0x381d07[_0x8ed6('0x60')][_0x8ed6('0x74')]=_0x381d07[_0x8ed6('0x5e')][_0x8ed6('0x5f')];}return db['Setting'][_0x8ed6('0x62')]({'where':{'id':_0x381d07[_0x8ed6('0x4e')]['id']}})[_0x8ed6('0x31')](handleEntityNotFound(_0x1e3f10,null))[_0x8ed6('0x31')](saveUpdates(_0x381d07[_0x8ed6('0x60')],null))[_0x8ed6('0x31')](respondWithResult(_0x1e3f10,null))['catch'](handleError(_0x1e3f10,null));};var utilLicense=require(_0x8ed6('0x72'));exports[_0x8ed6('0x78')]=function(_0x2cd08d,_0x38483f,_0x5e4e9b){var _0x1587ca=_0x8ed6('0x64');var _0x2b9fbb={'custom':![]};return utilLicense[_0x8ed6('0x79')]()[_0x8ed6('0x31')](function(_0x4d22ae){if(_0x4d22ae){_0x2b9fbb=_0x4d22ae;}return db[_0x8ed6('0x36')]['find']({'where':{'id':_0x2cd08d[_0x8ed6('0x4e')]['id']},'attributes':['logo','loginLogo',_0x8ed6('0x74'),_0x8ed6('0x66'),_0x8ed6('0x67'),_0x8ed6('0x68')],'raw':!![]});})[_0x8ed6('0x31')](handleEntityNotFound(_0x38483f,null))[_0x8ed6('0x31')](function(_0x337c73){if(_0x337c73){var _0x1bd5e8=_0x337c73['preferred']&&fs['existsSync'](path[_0x8ed6('0x53')](config[_0x8ed6('0x54')],_0x1587ca,_[_0x8ed6('0x6a')](_0x337c73[_0x8ed6('0x74')])))?path['join'](config[_0x8ed6('0x54')],_0x1587ca,_['toLower'](_0x337c73[_0x8ed6('0x74')])):path[_0x8ed6('0x53')](config['root'],_0x1587ca,_[_0x8ed6('0x6a')]('default_preferred.png'));var _0x21de36=_0x8ed6('0x6c')+_['upperFirst']('preferred');if(_0x337c73[_0x21de36]||!_0x2b9fbb[_0x8ed6('0x7a')]||!_0x2b9fbb[_0x8ed6('0x74')]){_0x1bd5e8=path['join'](config[_0x8ed6('0x54')],_0x1587ca,_[_0x8ed6('0x6a')](_0x8ed6('0x7b')));}if(!fs['existsSync'](_0x1bd5e8)){throw new db[(_0x8ed6('0x6e'))][(_0x8ed6('0x6f'))](_0x8ed6('0x70'));}return _0x38483f[_0x8ed6('0x71')](_0x1bd5e8);}})['catch'](handleError(_0x38483f,null));}; \ No newline at end of file +var _0x33d2=['getLogoLogin','defaultPreferred','default_loginLogo.png','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','download','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','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','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','limit','set','Content-Range','apply','reject','save','destroy','end','stack','name','Setting','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','where','filter','map','type','key','VIRTUAL','field','merge','options','count','include','findAll','rows','show','params','includeAll','update','find','body','get','readFileSync','join','server/files/templates/stun.ejs','root','server/files/templates/turn.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','file','filename','logo','addLogoLogin','loginLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultLoginLogo','toLower','default','upperFirst','custom','default_logo.png','existsSync','Sequelize','ValidationError','Logo\x20not\x20found','../../config/license/util'];(function(_0x2c150d,_0x345c1b){var _0x5a45f9=function(_0xf781ef){while(--_0xf781ef){_0x2c150d['push'](_0x2c150d['shift']());}};_0x5a45f9(++_0x345c1b);}(_0x33d2,0x1e9));var _0x233d=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x33d2[_0x39d544];return _0x5a5ff2;};'use strict';var pdf=require(_0x233d('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x233d('0x1'));var jsonpatch=require(_0x233d('0x2'));var rp=require(_0x233d('0x3'));var moment=require(_0x233d('0x4'));var BPromise=require(_0x233d('0x5'));var Mustache=require('mustache');var util=require(_0x233d('0x6'));var path=require('path');var sox=require(_0x233d('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x233d('0x8'));var jsforce=require(_0x233d('0x9'));var deskjs=require(_0x233d('0xa'));var toCsv=require('to-csv');var querystring=require(_0x233d('0xb'));var Papa=require('papaparse');var Redis=require(_0x233d('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x233d('0xd'));var hardwareService=require(_0x233d('0xe'));var logger=require(_0x233d('0xf'))(_0x233d('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x233d('0x11'));var client=jayson[_0x233d('0x12')][_0x233d('0x13')]({'port':0x232a});function checkPasswordPattern(_0x15ea46,_0x1491be,_0x5b9c94){if(_0x5b9c94){var _0x36c834=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x36c834[_0x233d('0x14')](_0x1491be)){return _0x15ea46;}else{throw new Error(_0x233d('0x15'));}}else{return _0x15ea46;}}function respondWithRpcPromise(_0x323728,_0x67c8b8,_0x546e81,_0x3c6cc3){return new BPromise(function(_0x4da36b,_0x29e6dc){var _0x4d74f1=_0x3c6cc3||client;return _0x4d74f1[_0x233d('0x16')](_0x323728,_0x546e81)[_0x233d('0x17')](function(_0x37f1c2){logger[_0x233d('0x18')](_0x233d('0x19'),_0x67c8b8,_0x233d('0x1a'));logger['debug'](_0x233d('0x1b'),_0x67c8b8,_0x233d('0x1a'),JSON[_0x233d('0x1c')](_0x37f1c2));if(_0x37f1c2['error']){if(_0x37f1c2[_0x233d('0x1d')]['code']===0x1f4){logger[_0x233d('0x1d')](_0x233d('0x19'),_0x67c8b8,_0x37f1c2['error'][_0x233d('0x1e')]);return _0x29e6dc(_0x37f1c2['error'][_0x233d('0x1e')]);}logger[_0x233d('0x1d')](_0x233d('0x19'),_0x67c8b8,_0x37f1c2[_0x233d('0x1d')][_0x233d('0x1e')]);return _0x4da36b(_0x37f1c2['error'][_0x233d('0x1e')]);}else{logger[_0x233d('0x18')](_0x233d('0x19'),_0x67c8b8,'request\x20sent');_0x4da36b(_0x37f1c2[_0x233d('0x1f')][_0x233d('0x1e')]);}})[_0x233d('0x20')](function(_0x58cac7){logger[_0x233d('0x1d')](_0x233d('0x19'),_0x67c8b8,_0x58cac7);_0x29e6dc(_0x58cac7);});});}function respondWithStatusCode(_0x16b1fe,_0x40aa1b){_0x40aa1b=_0x40aa1b||0xcc;return function(_0x3404c4){if(_0x3404c4){return _0x16b1fe[_0x233d('0x21')](_0x40aa1b);}return _0x16b1fe['status'](_0x40aa1b)['end']();};}function respondWithResult(_0xcbb014,_0x16486e){_0x16486e=_0x16486e||0xc8;return function(_0x12dba5){if(_0x12dba5){return _0xcbb014[_0x233d('0x22')](_0x16486e)[_0x233d('0x23')](_0x12dba5);}};}function respondWithFilteredResult(_0x2342f1,_0x508bf7){return function(_0x3f6bd9){if(_0x3f6bd9){var _0x441729=_0x3f6bd9['count'],_0x3561fc=_0x508bf7['offset'],_0xb98546=_0x508bf7['offset']+_0x508bf7[_0x233d('0x24')],_0x40d02a;if(_0xb98546>=_0x441729){_0xb98546=_0x441729;_0x40d02a=0xc8;}else{_0x40d02a=0xce;}_0x2342f1[_0x233d('0x22')](_0x40d02a);return _0x2342f1[_0x233d('0x25')](_0x233d('0x26'),_0x3561fc+'-'+_0xb98546+'/'+_0x441729)[_0x233d('0x23')](_0x3f6bd9);}return null;};}function patchUpdates(_0x4bdfcf){return function(_0x45dab0){try{jsonpatch[_0x233d('0x27')](_0x45dab0,_0x4bdfcf,!![]);}catch(_0x59e96d){return BPromise[_0x233d('0x28')](_0x59e96d);}return _0x45dab0[_0x233d('0x29')]();};}function saveUpdates(_0x5b121a,_0x416e6f){return function(_0x2cc5a2){if(_0x2cc5a2){return _0x2cc5a2['update'](_0x5b121a)[_0x233d('0x17')](function(_0x228428){return _0x228428;});}return null;};}function removeEntity(_0x5545fc,_0x5b1e2c){return function(_0x2ee6c8){if(_0x2ee6c8){return _0x2ee6c8[_0x233d('0x2a')]()['then'](function(){_0x5545fc[_0x233d('0x22')](0xcc)[_0x233d('0x2b')]();});}};}function handleEntityNotFound(_0x565fc1,_0x230d6f){return function(_0x46a04d){if(!_0x46a04d){_0x565fc1['sendStatus'](0x194);}return _0x46a04d;};}function handleError(_0xaf4401,_0x3056b9){_0x3056b9=_0x3056b9||0x1f4;return function(_0x579065){logger[_0x233d('0x1d')](_0x579065[_0x233d('0x2c')]);if(_0x579065['name']){delete _0x579065[_0x233d('0x2d')];}_0xaf4401[_0x233d('0x22')](_0x3056b9)['send'](_0x579065);};}exports['index']=function(_0x457641,_0x58b45a){var _0x14c892={},_0x316450={},_0x56344b={'count':0x0,'rows':[]};var _0x144cc9=db[_0x233d('0x2e')][_0x233d('0x2f')];_0x316450[_0x233d('0x30')]=_[_0x233d('0x31')](_0x144cc9);_0x316450[_0x233d('0x32')]=_['keys'](_0x457641[_0x233d('0x32')]);_0x316450[_0x233d('0x33')]=_[_0x233d('0x34')](_0x316450[_0x233d('0x30')],_0x316450[_0x233d('0x32')]);_0x14c892[_0x233d('0x35')]=_[_0x233d('0x34')](_0x316450[_0x233d('0x30')],qs[_0x233d('0x36')](_0x457641['query'][_0x233d('0x36')]));_0x14c892['attributes']=_0x14c892[_0x233d('0x35')][_0x233d('0x37')]?_0x14c892['attributes']:_0x316450[_0x233d('0x30')];if(!_0x457641[_0x233d('0x32')]['hasOwnProperty'](_0x233d('0x38'))){_0x14c892[_0x233d('0x24')]=qs[_0x233d('0x24')](_0x457641[_0x233d('0x32')][_0x233d('0x24')]);_0x14c892[_0x233d('0x39')]=qs[_0x233d('0x39')](_0x457641[_0x233d('0x32')][_0x233d('0x39')]);}_0x14c892[_0x233d('0x3a')]=qs[_0x233d('0x3b')](_0x457641['query']['sort']);_0x14c892[_0x233d('0x3c')]=qs[_0x233d('0x33')](_['pick'](_0x457641[_0x233d('0x32')],_0x316450['filters']));if(_0x457641[_0x233d('0x32')][_0x233d('0x3d')]){_0x14c892['where']=_['merge'](_0x14c892[_0x233d('0x3c')],{'$or':_[_0x233d('0x3e')](_0x144cc9,function(_0x479ca6){if(_0x479ca6[_0x233d('0x3f')][_0x233d('0x40')]!==_0x233d('0x41')){var _0x2d2107={};_0x2d2107[_0x479ca6[_0x233d('0x42')]]={'$like':'%'+_0x457641[_0x233d('0x32')]['filter']+'%'};return _0x2d2107;}})});}_0x14c892=_[_0x233d('0x43')]({},_0x14c892,_0x457641[_0x233d('0x44')]);var _0x49a582={'where':_0x14c892[_0x233d('0x3c')]};return db[_0x233d('0x2e')][_0x233d('0x45')](_0x49a582)[_0x233d('0x17')](function(_0xa1bd3b){_0x56344b[_0x233d('0x45')]=_0xa1bd3b;if(_0x457641[_0x233d('0x32')]['includeAll']){_0x14c892[_0x233d('0x46')]=[{'all':!![]}];}return db[_0x233d('0x2e')][_0x233d('0x47')](_0x14c892);})['then'](function(_0x1db9da){_0x56344b[_0x233d('0x48')]=_0x1db9da;return _0x56344b;})['then'](respondWithFilteredResult(_0x58b45a,_0x14c892))['catch'](handleError(_0x58b45a,null));};exports[_0x233d('0x49')]=function(_0x439527,_0x5555c8){var _0x5f2d8c={'raw':![],'where':{'id':_0x439527[_0x233d('0x4a')]['id']}},_0x54c8ad={};_0x54c8ad[_0x233d('0x30')]=_[_0x233d('0x31')](db[_0x233d('0x2e')]['rawAttributes']);_0x54c8ad[_0x233d('0x32')]=_['keys'](_0x439527[_0x233d('0x32')]);_0x54c8ad['filters']=_[_0x233d('0x34')](_0x54c8ad[_0x233d('0x30')],_0x54c8ad[_0x233d('0x32')]);_0x5f2d8c[_0x233d('0x35')]=_[_0x233d('0x34')](_0x54c8ad[_0x233d('0x30')],qs[_0x233d('0x36')](_0x439527[_0x233d('0x32')][_0x233d('0x36')]));_0x5f2d8c[_0x233d('0x35')]=_0x5f2d8c[_0x233d('0x35')]['length']?_0x5f2d8c[_0x233d('0x35')]:_0x54c8ad[_0x233d('0x30')];if(_0x439527[_0x233d('0x32')][_0x233d('0x4b')]){_0x5f2d8c[_0x233d('0x46')]=[{'all':!![]}];}_0x5f2d8c=_[_0x233d('0x43')]({},_0x5f2d8c,_0x439527[_0x233d('0x44')]);return db[_0x233d('0x2e')]['find'](_0x5f2d8c)[_0x233d('0x17')](handleEntityNotFound(_0x5555c8,null))[_0x233d('0x17')](respondWithResult(_0x5555c8,null))[_0x233d('0x20')](handleError(_0x5555c8,null));};exports[_0x233d('0x4c')]=function(_0x56646c,_0x44fd05,_0xb651f9){var _0x1fa978;return db['Setting'][_0x233d('0x4d')]({'where':{'id':_0x56646c[_0x233d('0x4a')]['id']}})[_0x233d('0x17')](handleEntityNotFound(_0x44fd05,null))['then'](saveUpdates(_0x56646c[_0x233d('0x4e')],null))[_0x233d('0x17')](function(_0x3454dd){if(_0x3454dd){_0x1fa978=_0x3454dd[_0x233d('0x4f')]({'plain':!![]});var _0x1f1849=fs[_0x233d('0x50')](path[_0x233d('0x51')](config['root'],_0x233d('0x52')),'utf8');var _0x4ba8e8=ejs['render'](_0x1f1849,_0x1fa978);var _0x4728f9=fs[_0x233d('0x50')](path[_0x233d('0x51')](config[_0x233d('0x53')],_0x233d('0x54')),_0x233d('0x55'));var _0x52f91b=ejs[_0x233d('0x56')](_0x4728f9,_0x1fa978);fs[_0x233d('0x57')](_0x233d('0x58'),_0x4ba8e8);fs[_0x233d('0x57')](_0x233d('0x59'),_0x52f91b);return respondWithRpcPromise('Reload','update',{'module':_0x233d('0x5a')});}})[_0x233d('0x17')](function(){return respondWithRpcPromise('Reload',_0x233d('0x4c'),{'module':'res_rtp_asterisk.so'});})['then'](function(){return _0x1fa978||null;})[_0x233d('0x17')](respondWithResult(_0x44fd05,null))[_0x233d('0x20')](handleError(_0x44fd05,null));};exports['addLogo']=function(_0x113156,_0x1e52bd,_0x540f8e){if(_0x113156['file']&&_0x113156[_0x233d('0x5b')][_0x233d('0x5c')]){_0x113156[_0x233d('0x4e')][_0x233d('0x5d')]=_0x113156['file'][_0x233d('0x5c')];}return db['Setting']['find']({'where':{'id':_0x113156['params']['id']}})['then'](handleEntityNotFound(_0x1e52bd,null))['then'](saveUpdates(_0x113156['body'],null))[_0x233d('0x17')](respondWithResult(_0x1e52bd,null))[_0x233d('0x20')](handleError(_0x1e52bd,null));};exports[_0x233d('0x5e')]=function(_0x2060ff,_0x45f539,_0x2a5ec0){if(_0x2060ff[_0x233d('0x5b')]&&_0x2060ff['file'][_0x233d('0x5c')]){_0x2060ff[_0x233d('0x4e')][_0x233d('0x5f')]=_0x2060ff[_0x233d('0x5b')][_0x233d('0x5c')];}return db[_0x233d('0x2e')][_0x233d('0x4d')]({'where':{'id':_0x2060ff['params']['id']}})[_0x233d('0x17')](handleEntityNotFound(_0x45f539,null))[_0x233d('0x17')](saveUpdates(_0x2060ff[_0x233d('0x4e')],null))[_0x233d('0x17')](respondWithResult(_0x45f539,null))[_0x233d('0x20')](handleError(_0x45f539,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x1ebdcf,_0x5d466b,_0x340dc0){var _0x3b051a=_0x233d('0x60');var _0x13a68a={'custom':![]};return utilLicense[_0x233d('0x61')]()[_0x233d('0x17')](function(_0x232628){if(_0x232628){_0x13a68a=_0x232628;}return db['Setting'][_0x233d('0x4d')]({'where':{'id':_0x1ebdcf[_0x233d('0x4a')]['id']},'attributes':[_0x233d('0x5d'),_0x233d('0x5f'),_0x233d('0x62'),_0x233d('0x63'),_0x233d('0x64'),'defaultPreferred'],'raw':!![]});})['then'](handleEntityNotFound(_0x5d466b,null))[_0x233d('0x17')](function(_0x434856){if(_0x434856){var _0x3a0785=_0x434856['logo']&&fs['existsSync'](path[_0x233d('0x51')](config[_0x233d('0x53')],_0x3b051a,_[_0x233d('0x65')](_0x434856[_0x233d('0x5d')])))?path[_0x233d('0x51')](config[_0x233d('0x53')],_0x3b051a,_[_0x233d('0x65')](_0x434856[_0x233d('0x5d')])):path['join'](config[_0x233d('0x53')],_0x3b051a,_[_0x233d('0x65')]('default_logo.png'));var _0x370e9b=_0x233d('0x66')+_[_0x233d('0x67')](_0x233d('0x5d'));if(_0x434856[_0x370e9b]||!_0x13a68a[_0x233d('0x68')]){_0x3a0785=path['join'](config[_0x233d('0x53')],_0x3b051a,_['toLower'](_0x233d('0x69')));}if(!fs[_0x233d('0x6a')](_0x3a0785)){throw new db[(_0x233d('0x6b'))][(_0x233d('0x6c'))](_0x233d('0x6d'));}return _0x5d466b['download'](_0x3a0785);}})[_0x233d('0x20')](handleError(_0x5d466b,null));};var utilLicense=require(_0x233d('0x6e'));exports[_0x233d('0x6f')]=function(_0x66acfe,_0x36d8d0,_0x23173b){var _0x5cf689=_0x233d('0x60');var _0x1e1283={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x9c74a1){if(_0x9c74a1){_0x1e1283=_0x9c74a1;}return db[_0x233d('0x2e')][_0x233d('0x4d')]({'where':{'id':_0x66acfe[_0x233d('0x4a')]['id']},'attributes':['logo',_0x233d('0x5f'),_0x233d('0x62'),_0x233d('0x63'),_0x233d('0x64'),_0x233d('0x70')],'raw':!![]});})['then'](handleEntityNotFound(_0x36d8d0,null))[_0x233d('0x17')](function(_0x13557e){if(_0x13557e){var _0x2506a2=_0x13557e[_0x233d('0x5f')]&&fs[_0x233d('0x6a')](path['join'](config[_0x233d('0x53')],_0x5cf689,_[_0x233d('0x65')](_0x13557e[_0x233d('0x5f')])))?path[_0x233d('0x51')](config['root'],_0x5cf689,_[_0x233d('0x65')](_0x13557e[_0x233d('0x5f')])):path[_0x233d('0x51')](config['root'],_0x5cf689,_[_0x233d('0x65')](_0x233d('0x71')));var _0x6ba3be=_0x233d('0x66')+_['upperFirst'](_0x233d('0x5f'));if(_0x13557e[_0x6ba3be]||!_0x1e1283['custom']){_0x2506a2=path['join'](config[_0x233d('0x53')],_0x5cf689,_[_0x233d('0x65')](_0x233d('0x71')));}if(!fs[_0x233d('0x6a')](_0x2506a2)){throw new db['Sequelize'][(_0x233d('0x6c'))]('Logo\x20not\x20found');}return _0x36d8d0['download'](_0x2506a2);}})[_0x233d('0x20')](handleError(_0x36d8d0,null));};exports[_0x233d('0x72')]=function(_0x47ae61,_0x4c3c28){return db['Setting'][_0x233d('0x4d')]({'where':{'id':_0x47ae61['params']['id']},'attributes':[_0x233d('0x73')]})['then'](respondWithResult(_0x4c3c28,null))[_0x233d('0x20')](handleError(_0x4c3c28,null));};exports[_0x233d('0x74')]=function(_0x90566,_0x2ca4a2,_0x4654dd){if(_0x90566['file']&&_0x90566['file'][_0x233d('0x5c')]){_0x90566[_0x233d('0x4e')][_0x233d('0x62')]=_0x90566['file'][_0x233d('0x5c')];}return db[_0x233d('0x2e')]['find']({'where':{'id':_0x90566['params']['id']}})[_0x233d('0x17')](handleEntityNotFound(_0x2ca4a2,null))[_0x233d('0x17')](saveUpdates(_0x90566[_0x233d('0x4e')],null))[_0x233d('0x17')](respondWithResult(_0x2ca4a2,null))[_0x233d('0x20')](handleError(_0x2ca4a2,null));};var utilLicense=require('../../config/license/util');exports[_0x233d('0x75')]=function(_0x2ca1da,_0x5b0cd7,_0x8b7ee9){var _0x2318ff=_0x233d('0x60');var _0x479487={'custom':![]};return utilLicense[_0x233d('0x61')]()['then'](function(_0x4a6b2c){if(_0x4a6b2c){_0x479487=_0x4a6b2c;}return db[_0x233d('0x2e')][_0x233d('0x4d')]({'where':{'id':_0x2ca1da['params']['id']},'attributes':[_0x233d('0x5d'),'loginLogo',_0x233d('0x62'),_0x233d('0x63'),'defaultLoginLogo','defaultPreferred'],'raw':!![]});})[_0x233d('0x17')](handleEntityNotFound(_0x5b0cd7,null))[_0x233d('0x17')](function(_0x2a63f0){if(_0x2a63f0){var _0x3c3e47=_0x2a63f0[_0x233d('0x62')]&&fs['existsSync'](path[_0x233d('0x51')](config[_0x233d('0x53')],_0x2318ff,_['toLower'](_0x2a63f0['preferred'])))?path[_0x233d('0x51')](config[_0x233d('0x53')],_0x2318ff,_['toLower'](_0x2a63f0['preferred'])):path['join'](config[_0x233d('0x53')],_0x2318ff,_[_0x233d('0x65')](_0x233d('0x76')));var _0x3dc508=_0x233d('0x66')+_[_0x233d('0x67')](_0x233d('0x62'));if(_0x2a63f0[_0x3dc508]||!_0x479487[_0x233d('0x68')]||!_0x479487[_0x233d('0x62')]){_0x3c3e47=path[_0x233d('0x51')](config[_0x233d('0x53')],_0x2318ff,_[_0x233d('0x65')](_0x233d('0x76')));}if(!fs['existsSync'](_0x3c3e47)){throw new db[(_0x233d('0x6b'))][(_0x233d('0x6c'))]('Logo\x20not\x20found');}return _0x5b0cd7[_0x233d('0x77')](_0x3c3e47);}})[_0x233d('0x20')](handleError(_0x5b0cd7,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 82a867f..7c291f6 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 _0x0fbd=['request-promise','path','rimraf','../../config/environment','./setting.attributes','define','Setting','settings','lodash','util','../../config/logger','api','moment'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x0fbd,0x8a));var _0xd0fb=function(_0x36d572,_0x1825b7){_0x36d572=_0x36d572-0x0;var _0x5dbfab=_0x0fbd[_0x36d572];return _0x5dbfab;};'use strict';var _=require(_0xd0fb('0x0'));var util=require(_0xd0fb('0x1'));var logger=require(_0xd0fb('0x2'))(_0xd0fb('0x3'));var moment=require(_0xd0fb('0x4'));var BPromise=require('bluebird');var rp=require(_0xd0fb('0x5'));var fs=require('fs');var path=require(_0xd0fb('0x6'));var rimraf=require(_0xd0fb('0x7'));var config=require(_0xd0fb('0x8'));var attributes=require(_0xd0fb('0x9'));module['exports']=function(_0x24af7e,_0xb234db){return _0x24af7e[_0xd0fb('0xa')](_0xd0fb('0xb'),attributes,{'tableName':_0xd0fb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97be=['rimraf','../../config/environment','./setting.attributes','define','Setting','settings','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x224dff,_0x5af22e){var _0x2cae16=function(_0x249522){while(--_0x249522){_0x224dff['push'](_0x224dff['shift']());}};_0x2cae16(++_0x5af22e);}(_0x97be,0xe6));var _0xe97b=function(_0x39b679,_0x4139fa){_0x39b679=_0x39b679-0x0;var _0x55279d=_0x97be[_0x39b679];return _0x55279d;};'use strict';var _=require(_0xe97b('0x0'));var util=require(_0xe97b('0x1'));var logger=require(_0xe97b('0x2'))(_0xe97b('0x3'));var moment=require(_0xe97b('0x4'));var BPromise=require(_0xe97b('0x5'));var rp=require(_0xe97b('0x6'));var fs=require('fs');var path=require(_0xe97b('0x7'));var rimraf=require(_0xe97b('0x8'));var config=require(_0xe97b('0x9'));var attributes=require(_0xe97b('0xa'));module['exports']=function(_0x30eba4,_0x5297e1){return _0x30eba4[_0xe97b('0xb')](_0xe97b('0xc'),attributes,{'tableName':_0xe97b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 6df172e..05e81c6 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 _0x8454=['error','message','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s'];(function(_0x206818,_0x2f32de){var _0x513842=function(_0x164e85){while(--_0x164e85){_0x206818['push'](_0x206818['shift']());}};_0x513842(++_0x2f32de);}(_0x8454,0x106));var _0x4845=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x8454[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x4845('0x0'));var moment=require(_0x4845('0x1'));var BPromise=require('bluebird');var rs=require(_0x4845('0x2'));var fs=require('fs');var Redis=require(_0x4845('0x3'));var db=require(_0x4845('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4845('0x5'))(_0x4845('0x6'));var config=require(_0x4845('0x7'));var jayson=require(_0x4845('0x8'));var client=jayson[_0x4845('0x9')][_0x4845('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x119684,_0xf606dd,_0x55f6dd){return new BPromise(function(_0x4ef948,_0x579af4){return client[_0x4845('0xb')](_0x119684,_0x55f6dd)[_0x4845('0xc')](function(_0x594acf){logger[_0x4845('0xd')](_0x4845('0xe'),_0xf606dd,_0x4845('0xf'));logger[_0x4845('0x10')](_0x4845('0x11'),_0xf606dd,_0x4845('0xf'),JSON['stringify'](_0x594acf));if(_0x594acf['error']){if(_0x594acf[_0x4845('0x12')]['code']===0x1f4){logger[_0x4845('0x12')](_0x4845('0xe'),_0xf606dd,_0x594acf['error'][_0x4845('0x13')]);return _0x579af4(_0x594acf[_0x4845('0x12')][_0x4845('0x13')]);}logger['error'](_0x4845('0xe'),_0xf606dd,_0x594acf[_0x4845('0x12')][_0x4845('0x13')]);return _0x4ef948(_0x594acf[_0x4845('0x12')][_0x4845('0x13')]);}else{logger[_0x4845('0xd')]('Setting,\x20%s,\x20%s',_0xf606dd,_0x4845('0xf'));_0x4ef948(_0x594acf['result'][_0x4845('0x13')]);}})['catch'](function(_0x37049d){logger[_0x4845('0x12')](_0x4845('0xe'),_0xf606dd,_0x37049d);_0x579af4(_0x37049d);});});} \ No newline at end of file +var _0xb3ff=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x35ff27,_0x375e7e){var _0x1e5954=function(_0x3766dd){while(--_0x3766dd){_0x35ff27['push'](_0x35ff27['shift']());}};_0x1e5954(++_0x375e7e);}(_0xb3ff,0x1bd));var _0xfb3f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb3ff[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfb3f('0x0'));var util=require(_0xfb3f('0x1'));var moment=require(_0xfb3f('0x2'));var BPromise=require('bluebird');var rs=require(_0xfb3f('0x3'));var fs=require('fs');var Redis=require(_0xfb3f('0x4'));var db=require(_0xfb3f('0x5'))['db'];var utils=require(_0xfb3f('0x6'));var logger=require('../../config/logger')(_0xfb3f('0x7'));var config=require('../../config/environment');var jayson=require(_0xfb3f('0x8'));var client=jayson[_0xfb3f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31557a,_0x1660b5,_0x58ced7){return new BPromise(function(_0x2e97ef,_0x28a75d){return client['request'](_0x31557a,_0x58ced7)[_0xfb3f('0xa')](function(_0x138c71){logger[_0xfb3f('0xb')](_0xfb3f('0xc'),_0x1660b5,_0xfb3f('0xd'));logger[_0xfb3f('0xe')](_0xfb3f('0xf'),_0x1660b5,_0xfb3f('0xd'),JSON[_0xfb3f('0x10')](_0x138c71));if(_0x138c71[_0xfb3f('0x11')]){if(_0x138c71[_0xfb3f('0x11')][_0xfb3f('0x12')]===0x1f4){logger[_0xfb3f('0x11')](_0xfb3f('0xc'),_0x1660b5,_0x138c71[_0xfb3f('0x11')][_0xfb3f('0x13')]);return _0x28a75d(_0x138c71[_0xfb3f('0x11')][_0xfb3f('0x13')]);}logger[_0xfb3f('0x11')]('Setting,\x20%s,\x20%s',_0x1660b5,_0x138c71[_0xfb3f('0x11')][_0xfb3f('0x13')]);return _0x2e97ef(_0x138c71[_0xfb3f('0x11')][_0xfb3f('0x13')]);}else{logger[_0xfb3f('0xb')]('Setting,\x20%s,\x20%s',_0x1660b5,_0xfb3f('0xd'));_0x2e97ef(_0x138c71[_0xfb3f('0x14')][_0xfb3f('0x13')]);}})[_0xfb3f('0x15')](function(_0x9b8903){logger[_0xfb3f('0x11')](_0xfb3f('0xc'),_0x1660b5,_0x9b8903);_0x28a75d(_0x9b8903);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 243fdda..7986acd 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 _0x8fcf=['statusGet','/:id/users','create','addDisposition','post','addAnswer','/:id/notify','notify','/:id/send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x3911e2,_0x4bfccf){var _0x5d55c6=function(_0x2d1334){while(--_0x2d1334){_0x3911e2['push'](_0x3911e2['shift']());}};_0x5d55c6(++_0x4bfccf);}(_0x8fcf,0x1c9));var _0xf8fc=function(_0x1cfac8,_0x39a4a9){_0x1cfac8=_0x1cfac8-0x0;var _0x395056=_0x8fcf[_0x1cfac8];return _0x395056;};'use strict';var multer=require('multer');var util=require(_0xf8fc('0x0'));var path=require(_0xf8fc('0x1'));var timeout=require(_0xf8fc('0x2'));var express=require(_0xf8fc('0x3'));var router=express[_0xf8fc('0x4')]();var auth=require(_0xf8fc('0x5'));var interaction=require(_0xf8fc('0x6'));var config=require(_0xf8fc('0x7'));var controller=require(_0xf8fc('0x8'));router[_0xf8fc('0x9')]('/',auth[_0xf8fc('0xa')](),controller[_0xf8fc('0xb')]);router[_0xf8fc('0x9')]('/describe',auth[_0xf8fc('0xa')](),controller[_0xf8fc('0xc')]);router[_0xf8fc('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xf8fc('0xd')]);router['get'](_0xf8fc('0xe'),auth['isAuthenticated'](),controller[_0xf8fc('0xf')]);router[_0xf8fc('0x9')](_0xf8fc('0x10'),auth[_0xf8fc('0xa')](),controller[_0xf8fc('0x11')]);router['get'](_0xf8fc('0x12'),auth[_0xf8fc('0xa')](),controller[_0xf8fc('0x13')]);router[_0xf8fc('0x9')](_0xf8fc('0x14'),auth[_0xf8fc('0xa')](),controller[_0xf8fc('0x15')]);router[_0xf8fc('0x9')](_0xf8fc('0x16'),controller[_0xf8fc('0x17')]);router[_0xf8fc('0x9')](_0xf8fc('0x18'),auth[_0xf8fc('0xa')](),controller['getAgents']);router['post']('/',auth[_0xf8fc('0xa')](),controller[_0xf8fc('0x19')]);router['post'](_0xf8fc('0xe'),auth[_0xf8fc('0xa')](),controller[_0xf8fc('0x1a')]);router[_0xf8fc('0x1b')]('/:id/canned_answers',auth[_0xf8fc('0xa')](),controller[_0xf8fc('0x1c')]);router['post'](_0xf8fc('0x1d'),controller[_0xf8fc('0x1e')]);router[_0xf8fc('0x1b')](_0xf8fc('0x12'),auth[_0xf8fc('0xa')](),controller['addApplications']);router[_0xf8fc('0x1b')](_0xf8fc('0x1f'),auth[_0xf8fc('0xa')](),controller['send']);router[_0xf8fc('0x1b')](_0xf8fc('0x16'),controller[_0xf8fc('0x20')]);router[_0xf8fc('0x1b')](_0xf8fc('0x18'),auth[_0xf8fc('0xa')](),controller[_0xf8fc('0x21')]);router[_0xf8fc('0x22')]('/:id',auth[_0xf8fc('0xa')](),controller[_0xf8fc('0x23')]);router[_0xf8fc('0x24')](_0xf8fc('0x25'),auth[_0xf8fc('0xa')](),controller[_0xf8fc('0x26')]);router[_0xf8fc('0x24')](_0xf8fc('0xe'),auth[_0xf8fc('0xa')](),controller[_0xf8fc('0x27')]);router[_0xf8fc('0x24')](_0xf8fc('0x10'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0xf8fc('0x24')](_0xf8fc('0x18'),auth[_0xf8fc('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xd5d6=['addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','/:id/dispositions','addDisposition'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0xd5d6,0xcb));var _0x6d5d=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xd5d6[_0x34021d];return _0x16597b;};'use strict';var multer=require(_0x6d5d('0x0'));var util=require('util');var path=require(_0x6d5d('0x1'));var timeout=require(_0x6d5d('0x2'));var express=require(_0x6d5d('0x3'));var router=express[_0x6d5d('0x4')]();var auth=require(_0x6d5d('0x5'));var interaction=require(_0x6d5d('0x6'));var config=require('../../config/environment');var controller=require('./smsAccount.controller');router[_0x6d5d('0x7')]('/',auth[_0x6d5d('0x8')](),controller[_0x6d5d('0x9')]);router[_0x6d5d('0x7')](_0x6d5d('0xa'),auth[_0x6d5d('0x8')](),controller[_0x6d5d('0xb')]);router[_0x6d5d('0x7')](_0x6d5d('0xc'),auth[_0x6d5d('0x8')](),controller[_0x6d5d('0xd')]);router[_0x6d5d('0x7')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0x6d5d('0x7')](_0x6d5d('0xe'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x6d5d('0x7')](_0x6d5d('0xf'),auth[_0x6d5d('0x8')](),controller[_0x6d5d('0x10')]);router[_0x6d5d('0x7')](_0x6d5d('0x11'),auth['isAuthenticated'](),controller[_0x6d5d('0x12')]);router['get'](_0x6d5d('0x13'),controller[_0x6d5d('0x14')]);router[_0x6d5d('0x7')]('/:id/users',auth[_0x6d5d('0x8')](),controller[_0x6d5d('0x15')]);router[_0x6d5d('0x16')]('/',auth[_0x6d5d('0x8')](),controller['create']);router[_0x6d5d('0x16')](_0x6d5d('0x17'),auth[_0x6d5d('0x8')](),controller[_0x6d5d('0x18')]);router[_0x6d5d('0x16')](_0x6d5d('0xe'),auth['isAuthenticated'](),controller[_0x6d5d('0x19')]);router[_0x6d5d('0x16')](_0x6d5d('0x1a'),controller[_0x6d5d('0x1b')]);router[_0x6d5d('0x16')](_0x6d5d('0xf'),auth[_0x6d5d('0x8')](),controller[_0x6d5d('0x1c')]);router[_0x6d5d('0x16')](_0x6d5d('0x1d'),auth[_0x6d5d('0x8')](),controller[_0x6d5d('0x1e')]);router[_0x6d5d('0x16')]('/:id/status',controller['status']);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x6d5d('0x1f')](_0x6d5d('0xc'),auth[_0x6d5d('0x8')](),controller[_0x6d5d('0x20')]);router[_0x6d5d('0x21')](_0x6d5d('0xc'),auth[_0x6d5d('0x8')](),controller[_0x6d5d('0x22')]);router[_0x6d5d('0x21')](_0x6d5d('0x17'),auth[_0x6d5d('0x8')](),controller[_0x6d5d('0x23')]);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router['delete']('/:id/users',auth[_0x6d5d('0x8')](),controller[_0x6d5d('0x24')]);module[_0x6d5d('0x25')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index c32223c..31e2743 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 _0x9904=['BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','sequelize','name','STRING','generate','ENUM','connectel','clicksend','plivo','clickatell','csc','infobip'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9904,0xf1));var _0x4990=function(_0x3d4347,_0x47f3d9){_0x3d4347=_0x3d4347-0x0;var _0x14e255=_0x9904[_0x3d4347];return _0x14e255;};'use strict';var Sequelize=require(_0x4990('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4990('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0x4990('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x4990('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x4990('0x2')],'defaultValue':function(){return rs[_0x4990('0x3')]();}},'phone':{'type':Sequelize[_0x4990('0x2')]},'type':{'type':Sequelize[_0x4990('0x4')]('twilio','skebby',_0x4990('0x5'),_0x4990('0x6'),_0x4990('0x7'),_0x4990('0x8'),_0x4990('0x9'),_0x4990('0xa'),'intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x4990('0x2')]},'smsMethod':{'type':Sequelize[_0x4990('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x4990('0x2')]},'password':{'type':Sequelize[_0x4990('0x2')]},'apiKey':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x4990('0x2')]},'deliveryReport':{'type':Sequelize[_0x4990('0xb')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x4990('0xc')],'defaultValue':function(){return _0x4990('0xd');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4990('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4990('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4990('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4990('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4990('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x4990('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4990('0xe')],'comment':_0x4990('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x4990('0xb')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x57a122){if(!_0x57a122)this[_0x4990('0x10')](_0x4990('0x11'),null);this['setDataValue']('mandatoryDisposition',_0x57a122);}}}; \ No newline at end of file +var _0xca70=['intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','randomstring','exports','STRING','name','generate','ENUM','skebby','connectel','clicksend','plivo','clickatell','csc'];(function(_0x175b2d,_0x5a426a){var _0x4488ed=function(_0xab3f02){while(--_0xab3f02){_0x175b2d['push'](_0x175b2d['shift']());}};_0x4488ed(++_0x5a426a);}(_0xca70,0x169));var _0x0ca7=function(_0x166ddd,_0x1345d1){_0x166ddd=_0x166ddd-0x0;var _0x3cff8e=_0xca70[_0x166ddd];return _0x3cff8e;};'use strict';var Sequelize=require(_0x0ca7('0x0'));var rs=require(_0x0ca7('0x1'));module[_0x0ca7('0x2')]={'name':{'type':Sequelize[_0x0ca7('0x3')],'unique':_0x0ca7('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x0ca7('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x0ca7('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x0ca7('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0ca7('0x6')]('twilio',_0x0ca7('0x7'),_0x0ca7('0x8'),_0x0ca7('0x9'),_0x0ca7('0xa'),_0x0ca7('0xb'),_0x0ca7('0xc'),'infobip',_0x0ca7('0xd'))},'accountSid':{'type':Sequelize[_0x0ca7('0x3')]},'authId':{'type':Sequelize[_0x0ca7('0x3')]},'authToken':{'type':Sequelize[_0x0ca7('0x3')]},'smsMethod':{'type':Sequelize[_0x0ca7('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x0ca7('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x0ca7('0x3')]},'senderString':{'type':Sequelize[_0x0ca7('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x0ca7('0x3')]},'notificationTemplate':{'type':Sequelize[_0x0ca7('0xe')],'defaultValue':function(){return _0x0ca7('0xf');}},'notificationSound':{'type':Sequelize[_0x0ca7('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0ca7('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0ca7('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0ca7('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0ca7('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0ca7('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0ca7('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x0ca7('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x0ca7('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x0ca7('0x10')],'defaultValue':![],'comment':_0x0ca7('0x13'),'set':function(_0x364659){if(!_0x364659)this['setDataValue'](_0x0ca7('0x14'),null);this[_0x0ca7('0x15')]('mandatoryDisposition',_0x364659);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index cf97564..31b4c03 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 _0x686c=['endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','status_code','DELIVERED','groupName','intelepeer','redif','inspect','error_code','RECEIVED_BY_RECIPIENT','statusGet','csc','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','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/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./smsAccount.socket','client','http','test','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','get','SmsAccounts','sendStatus','stack','name','send','index','SmsAccount','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','where','merge','map','type','key','VIRTUAL','filter','options','include','findAll','show','params','Pause','mandatoryDispositionPause','includeAll','find','create','body','role','user','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','SmsAccountId','findOne','Disposition','rows','removeDispositions','addAnswer','CannedAnswer','nolimit','removeAnswers','ids','sms','SmsApplication','account','applications','asc','Applications','Sequelize','ValidationError','difference','updatedAt','createdAt','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','refid','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','omit','mapKey','contact','SmsInteraction','spread','interaction','push','close','unmanaged','*,*,*,*','created','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','sequelize','bulkCreate','getApplications','CmContact','Owner','fullname','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','log'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x686c,0xf5));var _0xc686=function(_0x396d05,_0x5cbf27){_0x396d05=_0x396d05-0x0;var _0x3b206e=_0x686c[_0x396d05];return _0x3b206e;};'use strict';var pdf=require(_0xc686('0x0'));var emlformat=require(_0xc686('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc686('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc686('0x3'));var moment=require(_0xc686('0x4'));var BPromise=require(_0xc686('0x5'));var Mustache=require(_0xc686('0x6'));var util=require(_0xc686('0x7'));var path=require(_0xc686('0x8'));var sox=require(_0xc686('0x9'));var csv=require(_0xc686('0xa'));var ejs=require(_0xc686('0xb'));var fs=require('fs');var _=require(_0xc686('0xc'));var squel=require(_0xc686('0xd'));var crypto=require(_0xc686('0xe'));var jsforce=require(_0xc686('0xf'));var deskjs=require(_0xc686('0x10'));var toCsv=require(_0xc686('0xa'));var querystring=require(_0xc686('0x11'));var Papa=require(_0xc686('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc686('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc686('0x14'))(_0xc686('0x15'));var utils=require(_0xc686('0x16'));var config=require(_0xc686('0x17'));var db=require(_0xc686('0x18'))['db'];config['redis']=_[_0xc686('0x19')](config[_0xc686('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xc686('0x1b'))(new Redis(config[_0xc686('0x1a')]));require(_0xc686('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xc686('0x1d')][_0xc686('0x1e')]({'port':0x232c});function checkPasswordPattern(_0x2d234b,_0x3ce4d3,_0x3c1000){if(_0x3c1000){var _0x4a4771=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a4771[_0xc686('0x1f')](_0x3ce4d3)){return _0x2d234b;}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 _0x2d234b;}}function respondWithRpcPromise(_0x4708d3,_0xaa807d,_0x376943,_0x24e8ee){return new BPromise(function(_0x38a75d,_0x3a9878){var _0x2789a1=_0x24e8ee||client;return _0x2789a1[_0xc686('0x20')](_0x4708d3,_0x376943)[_0xc686('0x21')](function(_0x11033a){logger[_0xc686('0x22')](_0xc686('0x23'),_0xaa807d,_0xc686('0x24'));logger[_0xc686('0x25')](_0xc686('0x26'),_0xaa807d,'request\x20sent',JSON[_0xc686('0x27')](_0x11033a));if(_0x11033a[_0xc686('0x28')]){if(_0x11033a[_0xc686('0x28')][_0xc686('0x29')]===0x1f4){logger['error'](_0xc686('0x23'),_0xaa807d,_0x11033a[_0xc686('0x28')]['message']);return _0x3a9878(_0x11033a[_0xc686('0x28')]['message']);}logger['error'](_0xc686('0x23'),_0xaa807d,_0x11033a[_0xc686('0x28')]['message']);return _0x38a75d(_0x11033a[_0xc686('0x28')][_0xc686('0x2a')]);}else{logger[_0xc686('0x22')](_0xc686('0x23'),_0xaa807d,'request\x20sent');_0x38a75d(_0x11033a[_0xc686('0x2b')][_0xc686('0x2a')]);}})[_0xc686('0x2c')](function(_0x3493bf){logger[_0xc686('0x28')](_0xc686('0x23'),_0xaa807d,_0x3493bf);_0x3a9878(_0x3493bf);});});}function respondWithStatusCode(_0x446468,_0x36ca28){_0x36ca28=_0x36ca28||0xcc;return function(_0x45d5d2){if(_0x45d5d2){return _0x446468['sendStatus'](_0x36ca28);}return _0x446468[_0xc686('0x2d')](_0x36ca28)[_0xc686('0x2e')]();};}function respondWithResult(_0xa80696,_0x3f9914){_0x3f9914=_0x3f9914||0xc8;return function(_0x3312fb){if(_0x3312fb){return _0xa80696[_0xc686('0x2d')](_0x3f9914)[_0xc686('0x2f')](_0x3312fb);}};}function respondWithFilteredResult(_0x38b850,_0xad0c0d){return function(_0x1b83dc){if(_0x1b83dc){var _0x5acb5a=_0x1b83dc[_0xc686('0x30')],_0x24bd6e=_0xad0c0d[_0xc686('0x31')],_0x55bdf2=_0xad0c0d[_0xc686('0x31')]+_0xad0c0d[_0xc686('0x32')],_0x148229;if(_0x55bdf2>=_0x5acb5a){_0x55bdf2=_0x5acb5a;_0x148229=0xc8;}else{_0x148229=0xce;}_0x38b850[_0xc686('0x2d')](_0x148229);return _0x38b850[_0xc686('0x33')](_0xc686('0x34'),_0x24bd6e+'-'+_0x55bdf2+'/'+_0x5acb5a)[_0xc686('0x2f')](_0x1b83dc);}return null;};}function patchUpdates(_0x4ce587){return function(_0x1d697b){try{jsonpatch['apply'](_0x1d697b,_0x4ce587,!![]);}catch(_0x56d53d){return BPromise[_0xc686('0x35')](_0x56d53d);}return _0x1d697b[_0xc686('0x36')]();};}function saveUpdates(_0x44c334,_0x3e001e){return function(_0x187f1e){if(_0x187f1e){return _0x187f1e[_0xc686('0x37')](_0x44c334)[_0xc686('0x21')](function(_0x459ab9){return _0x459ab9;});}return null;};}function removeEntity(_0x56db31,_0x3b353e){return function(_0x4711a2){if(_0x4711a2){return _0x4711a2[_0xc686('0x38')]()[_0xc686('0x21')](function(){var _0x283306=_0x4711a2[_0xc686('0x39')]({'plain':!![]});var _0x34c493=_0xc686('0x3a');return db['UserProfileResource']['destroy']({'where':{'type':_0x34c493,'resourceId':_0x283306['id']}})[_0xc686('0x21')](function(){return _0x4711a2;});})[_0xc686('0x21')](function(){_0x56db31[_0xc686('0x2d')](0xcc)[_0xc686('0x2e')]();});}};}function handleEntityNotFound(_0xeaf951,_0x3dfdb9){return function(_0x5b4023){if(!_0x5b4023){_0xeaf951[_0xc686('0x3b')](0x194);}return _0x5b4023;};}function handleError(_0x39b9bd,_0x572c76){_0x572c76=_0x572c76||0x1f4;return function(_0x27913d){logger['error'](_0x27913d[_0xc686('0x3c')]);if(_0x27913d[_0xc686('0x3d')]){delete _0x27913d[_0xc686('0x3d')];}_0x39b9bd[_0xc686('0x2d')](_0x572c76)[_0xc686('0x3e')](_0x27913d);};}exports[_0xc686('0x3f')]=function(_0x217f1e,_0x260731){var _0x44bfd7={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x36636c={},_0x1fbf00={'count':0x0,'rows':[]};var _0x22ec5e=db[_0xc686('0x40')][_0xc686('0x41')];_0x36636c[_0xc686('0x42')]=_[_0xc686('0x43')](_0x22ec5e);_0x36636c[_0xc686('0x44')]=_[_0xc686('0x43')](_0x217f1e[_0xc686('0x44')]);_0x36636c['filters']=_[_0xc686('0x45')](_0x36636c[_0xc686('0x42')],_0x36636c[_0xc686('0x44')]);_0x44bfd7[_0xc686('0x46')]=_['intersection'](_0x36636c[_0xc686('0x42')],qs[_0xc686('0x47')](_0x217f1e['query'][_0xc686('0x47')]));_0x44bfd7[_0xc686('0x46')]=_0x44bfd7[_0xc686('0x46')][_0xc686('0x48')]?_0x44bfd7[_0xc686('0x46')]:_0x36636c['model'];if(!_0x217f1e[_0xc686('0x44')][_0xc686('0x49')]('nolimit')){_0x44bfd7[_0xc686('0x32')]=qs[_0xc686('0x32')](_0x217f1e[_0xc686('0x44')][_0xc686('0x32')]);_0x44bfd7['offset']=qs['offset'](_0x217f1e[_0xc686('0x44')]['offset']);}_0x44bfd7[_0xc686('0x4a')]=qs[_0xc686('0x4b')](_0x217f1e['query'][_0xc686('0x4b')]);_0x44bfd7['where']=qs[_0xc686('0x4c')](_[_0xc686('0x4d')](_0x217f1e['query'],_0x36636c[_0xc686('0x4c')]));if(_0x217f1e[_0xc686('0x44')]['filter']){_0x44bfd7[_0xc686('0x4e')]=_[_0xc686('0x4f')](_0x44bfd7[_0xc686('0x4e')],{'$or':_[_0xc686('0x50')](_0x22ec5e,function(_0x30d3f5){if(_0x30d3f5[_0xc686('0x51')][_0xc686('0x52')]!==_0xc686('0x53')){var _0xd66e49={};_0xd66e49[_0x30d3f5['field']]={'$like':'%'+_0x217f1e[_0xc686('0x44')][_0xc686('0x54')]+'%'};return _0xd66e49;}})});}_0x44bfd7=_[_0xc686('0x4f')]({},_0x44bfd7,_0x217f1e[_0xc686('0x55')]);var _0x29ebbc={'where':_0x44bfd7[_0xc686('0x4e')]};return db[_0xc686('0x40')][_0xc686('0x30')](_0x29ebbc)[_0xc686('0x21')](function(_0x36c150){_0x1fbf00[_0xc686('0x30')]=_0x36c150;if(_0x217f1e['query']['includeAll']){_0x44bfd7[_0xc686('0x56')]=[{'all':!![]}];}return db[_0xc686('0x40')][_0xc686('0x57')](_0x44bfd7);})[_0xc686('0x21')](function(_0x117272){_0x1fbf00['rows']=_0x117272;return _0x1fbf00;})[_0xc686('0x21')](respondWithFilteredResult(_0x260731,_0x44bfd7))[_0xc686('0x2c')](handleError(_0x260731,null));};exports[_0xc686('0x58')]=function(_0x349012,_0x5a37f0){var _0x72e049={'raw':![],'where':{'id':_0x349012[_0xc686('0x59')]['id']},'include':[{'model':db[_0xc686('0x5a')],'as':_0xc686('0x5b')}]},_0x4c7674={};_0x4c7674[_0xc686('0x42')]=_[_0xc686('0x43')](db[_0xc686('0x40')][_0xc686('0x41')]);_0x4c7674[_0xc686('0x44')]=_['keys'](_0x349012[_0xc686('0x44')]);_0x4c7674['filters']=_['intersection'](_0x4c7674[_0xc686('0x42')],_0x4c7674['query']);_0x72e049[_0xc686('0x46')]=_[_0xc686('0x45')](_0x4c7674[_0xc686('0x42')],qs[_0xc686('0x47')](_0x349012['query'][_0xc686('0x47')]));_0x72e049['attributes']=_0x72e049[_0xc686('0x46')][_0xc686('0x48')]?_0x72e049[_0xc686('0x46')]:_0x4c7674[_0xc686('0x42')];if(_0x349012[_0xc686('0x44')][_0xc686('0x5c')]){_0x72e049[_0xc686('0x56')]=[{'all':!![]}];}_0x72e049=_[_0xc686('0x4f')]({},_0x72e049,_0x349012['options']);return db['SmsAccount'][_0xc686('0x5d')](_0x72e049)[_0xc686('0x21')](handleEntityNotFound(_0x5a37f0,null))[_0xc686('0x21')](respondWithResult(_0x5a37f0,null))[_0xc686('0x2c')](handleError(_0x5a37f0,null));};exports[_0xc686('0x5e')]=function(_0x32b458,_0x24c8fd){return db[_0xc686('0x40')][_0xc686('0x5e')](_0x32b458[_0xc686('0x5f')],{})[_0xc686('0x21')](function(_0x148c48){var _0x42bb94=_0x32b458['user'][_0xc686('0x39')]({'plain':!![]});if(!_0x42bb94)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42bb94[_0xc686('0x60')]===_0xc686('0x61')){var _0x3c8b13=_0x148c48[_0xc686('0x39')]({'plain':!![]});var _0x2d966e=_0xc686('0x3a');return db['UserProfileSection'][_0xc686('0x5d')]({'where':{'name':_0x2d966e,'userProfileId':_0x42bb94[_0xc686('0x62')]},'raw':!![]})[_0xc686('0x21')](function(_0x59cf28){if(_0x59cf28&&_0x59cf28[_0xc686('0x63')]===0x0){return db[_0xc686('0x64')][_0xc686('0x5e')]({'name':_0x3c8b13['name'],'resourceId':_0x3c8b13['id'],'type':_0x59cf28[_0xc686('0x3d')],'sectionId':_0x59cf28['id']},{})[_0xc686('0x21')](function(){return _0x148c48;});}else{return _0x148c48;}})[_0xc686('0x2c')](function(_0xb3779b){logger[_0xc686('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb3779b);throw _0xb3779b;});}return _0x148c48;})['then'](respondWithResult(_0x24c8fd,0xc9))[_0xc686('0x2c')](handleError(_0x24c8fd,null));};exports[_0xc686('0x37')]=function(_0x215ff5,_0x128cf4){if(_0x215ff5['body']['id']){delete _0x215ff5[_0xc686('0x5f')]['id'];}return db[_0xc686('0x40')]['find']({'where':{'id':_0x215ff5['params']['id']},'include':[{'model':db[_0xc686('0x5a')],'as':_0xc686('0x5b')}]})[_0xc686('0x21')](handleEntityNotFound(_0x128cf4,null))['then'](saveUpdates(_0x215ff5[_0xc686('0x5f')],null))[_0xc686('0x21')](respondWithResult(_0x128cf4,null))['catch'](handleError(_0x128cf4,null));};exports[_0xc686('0x38')]=function(_0x4633c9,_0x43ad66){return db['SmsAccount'][_0xc686('0x5d')]({'where':{'id':_0x4633c9[_0xc686('0x59')]['id']}})[_0xc686('0x21')](handleEntityNotFound(_0x43ad66,null))[_0xc686('0x21')](removeEntity(_0x43ad66,null))[_0xc686('0x2c')](handleError(_0x43ad66,null));};exports['describe']=function(_0x2aadbc,_0x237ab0){return db[_0xc686('0x40')][_0xc686('0x65')]()['then'](respondWithResult(_0x237ab0,null))[_0xc686('0x2c')](handleError(_0x237ab0,null));};exports[_0xc686('0x66')]=function(_0x45e53d,_0x10cd80,_0x1a5cab){if(_0x45e53d[_0xc686('0x5f')]['id']){delete _0x45e53d[_0xc686('0x5f')]['id'];}return db[_0xc686('0x40')][_0xc686('0x5d')]({'where':{'id':_0x45e53d['params']['id']}})['then'](handleEntityNotFound(_0x10cd80,null))[_0xc686('0x21')](function(_0x153dd6){if(_0x153dd6){_0x45e53d[_0xc686('0x5f')][_0xc686('0x67')]=_0x153dd6['id'];return db['Disposition'][_0xc686('0x5e')](_0x45e53d[_0xc686('0x5f')]);}})[_0xc686('0x21')](respondWithResult(_0x10cd80,null))[_0xc686('0x2c')](handleError(_0x10cd80,null));};exports['getDispositions']=function(_0x4a02bc,_0x302be3,_0x230079){var _0x1ef5bf={'raw':![],'where':{}};var _0x3ea19b={};var _0x2f9597={'count':0x0,'rows':[]};return db[_0xc686('0x40')][_0xc686('0x68')]({'where':{'id':_0x4a02bc[_0xc686('0x59')]['id']}})[_0xc686('0x21')](handleEntityNotFound(_0x302be3,null))[_0xc686('0x21')](function(_0xa83d98){if(_0xa83d98){_0x3ea19b[_0xc686('0x42')]=_['keys'](db[_0xc686('0x69')][_0xc686('0x41')]);_0x3ea19b[_0xc686('0x44')]=_['keys'](_0x4a02bc[_0xc686('0x44')]);_0x3ea19b[_0xc686('0x4c')]=_[_0xc686('0x45')](_0x3ea19b[_0xc686('0x42')],_0x3ea19b[_0xc686('0x44')]);_0x1ef5bf[_0xc686('0x46')]=_['intersection'](_0x3ea19b[_0xc686('0x42')],qs[_0xc686('0x47')](_0x4a02bc[_0xc686('0x44')][_0xc686('0x47')]));_0x1ef5bf['attributes']=_0x1ef5bf[_0xc686('0x46')][_0xc686('0x48')]?_0x1ef5bf['attributes']:_0x3ea19b['model'];if(!_0x4a02bc[_0xc686('0x44')][_0xc686('0x49')]('nolimit')){_0x1ef5bf[_0xc686('0x32')]=qs[_0xc686('0x32')](_0x4a02bc['query'][_0xc686('0x32')]);_0x1ef5bf[_0xc686('0x31')]=qs['offset'](_0x4a02bc[_0xc686('0x44')][_0xc686('0x31')]);}_0x1ef5bf[_0xc686('0x4a')]=qs[_0xc686('0x4b')](_0x4a02bc[_0xc686('0x44')][_0xc686('0x4b')]);_0x1ef5bf[_0xc686('0x4e')]=qs[_0xc686('0x4c')](_[_0xc686('0x4d')](_0x4a02bc['query'],_0x3ea19b['filters']));_0x1ef5bf[_0xc686('0x4e')][_0xc686('0x67')]=_0xa83d98['id'];if(_0x4a02bc['query'][_0xc686('0x54')]){_0x1ef5bf[_0xc686('0x4e')]=_[_0xc686('0x4f')](_0x1ef5bf['where'],{'$or':_[_0xc686('0x50')](_0x1ef5bf[_0xc686('0x46')],function(_0x5e312b){var _0x5ae8e7={};_0x5ae8e7[_0x5e312b]={'$like':'%'+_0x4a02bc[_0xc686('0x44')][_0xc686('0x54')]+'%'};return _0x5ae8e7;})});}_0x1ef5bf=_[_0xc686('0x4f')]({},_0x1ef5bf,_0x4a02bc[_0xc686('0x55')]);return db[_0xc686('0x69')][_0xc686('0x30')]({'where':_0x1ef5bf[_0xc686('0x4e')]})['then'](function(_0xb3e06b){_0x2f9597['count']=_0xb3e06b;if(_0x4a02bc[_0xc686('0x44')][_0xc686('0x5c')]){_0x1ef5bf[_0xc686('0x56')]=[{'all':!![]}];}return db[_0xc686('0x69')][_0xc686('0x57')](_0x1ef5bf);})[_0xc686('0x21')](function(_0x500517){_0x2f9597[_0xc686('0x6a')]=_0x500517;return _0x2f9597;});}})[_0xc686('0x21')](respondWithFilteredResult(_0x302be3,_0x1ef5bf))[_0xc686('0x2c')](handleError(_0x302be3,null));};exports[_0xc686('0x6b')]=function(_0x120509,_0x4481a0,_0x3a41e0){return db[_0xc686('0x40')][_0xc686('0x5d')]({'where':{'id':_0x120509[_0xc686('0x59')]['id']}})[_0xc686('0x21')](handleEntityNotFound(_0x4481a0,null))[_0xc686('0x21')](function(_0x506139){if(_0x506139){return _0x506139['removeDispositions'](_0x120509[_0xc686('0x44')]['ids']);}})[_0xc686('0x21')](respondWithStatusCode(_0x4481a0,null))[_0xc686('0x2c')](handleError(_0x4481a0,null));};exports[_0xc686('0x6c')]=function(_0x4cdc97,_0x1c685f,_0x5dc16a){if(_0x4cdc97[_0xc686('0x5f')]['id']){delete _0x4cdc97[_0xc686('0x5f')]['id'];}return db[_0xc686('0x40')]['find']({'where':{'id':_0x4cdc97[_0xc686('0x59')]['id']}})['then'](handleEntityNotFound(_0x1c685f,null))[_0xc686('0x21')](function(_0xae3b0c){if(_0xae3b0c){_0x4cdc97[_0xc686('0x5f')][_0xc686('0x67')]=_0xae3b0c['id'];return db['CannedAnswer']['create'](_0x4cdc97[_0xc686('0x5f')]);}})['then'](respondWithResult(_0x1c685f,null))['catch'](handleError(_0x1c685f,null));};exports['getAnswers']=function(_0x2a3137,_0x23f126,_0x25a1d3){var _0x4720e4={'raw':![],'where':{}};var _0x47f493={};var _0xe2a63c={'count':0x0,'rows':[]};return db[_0xc686('0x40')]['findOne']({'where':{'id':_0x2a3137['params']['id']}})[_0xc686('0x21')](handleEntityNotFound(_0x23f126,null))[_0xc686('0x21')](function(_0xf1ce1d){if(_0xf1ce1d){_0x47f493['model']=_['keys'](db[_0xc686('0x6d')][_0xc686('0x41')]);_0x47f493[_0xc686('0x44')]=_['keys'](_0x2a3137['query']);_0x47f493[_0xc686('0x4c')]=_[_0xc686('0x45')](_0x47f493[_0xc686('0x42')],_0x47f493[_0xc686('0x44')]);_0x4720e4[_0xc686('0x46')]=_[_0xc686('0x45')](_0x47f493['model'],qs[_0xc686('0x47')](_0x2a3137['query'][_0xc686('0x47')]));_0x4720e4[_0xc686('0x46')]=_0x4720e4[_0xc686('0x46')][_0xc686('0x48')]?_0x4720e4[_0xc686('0x46')]:_0x47f493[_0xc686('0x42')];if(!_0x2a3137[_0xc686('0x44')][_0xc686('0x49')](_0xc686('0x6e'))){_0x4720e4['limit']=qs['limit'](_0x2a3137[_0xc686('0x44')][_0xc686('0x32')]);_0x4720e4[_0xc686('0x31')]=qs['offset'](_0x2a3137['query'][_0xc686('0x31')]);}_0x4720e4[_0xc686('0x4a')]=qs['sort'](_0x2a3137[_0xc686('0x44')][_0xc686('0x4b')]);_0x4720e4['where']=qs[_0xc686('0x4c')](_[_0xc686('0x4d')](_0x2a3137[_0xc686('0x44')],_0x47f493['filters']));_0x4720e4[_0xc686('0x4e')][_0xc686('0x67')]=_0xf1ce1d['id'];if(_0x2a3137['query'][_0xc686('0x54')]){_0x4720e4[_0xc686('0x4e')]=_[_0xc686('0x4f')](_0x4720e4[_0xc686('0x4e')],{'$or':_['map'](_0x4720e4[_0xc686('0x46')],function(_0x36a490){var _0x3c3db8={};_0x3c3db8[_0x36a490]={'$like':'%'+_0x2a3137[_0xc686('0x44')][_0xc686('0x54')]+'%'};return _0x3c3db8;})});}_0x4720e4=_[_0xc686('0x4f')]({},_0x4720e4,_0x2a3137[_0xc686('0x55')]);return db['CannedAnswer']['count']({'where':_0x4720e4[_0xc686('0x4e')]})['then'](function(_0x2eaae5){_0xe2a63c[_0xc686('0x30')]=_0x2eaae5;if(_0x2a3137['query'][_0xc686('0x5c')]){_0x4720e4[_0xc686('0x56')]=[{'all':!![]}];}return db['CannedAnswer'][_0xc686('0x57')](_0x4720e4);})['then'](function(_0x56f5e1){_0xe2a63c[_0xc686('0x6a')]=_0x56f5e1;return _0xe2a63c;});}})[_0xc686('0x21')](respondWithFilteredResult(_0x23f126,_0x4720e4))[_0xc686('0x2c')](handleError(_0x23f126,null));};exports[_0xc686('0x6f')]=function(_0x5b660d,_0x2cfbc6,_0x515d16){return db['SmsAccount']['find']({'where':{'id':_0x5b660d[_0xc686('0x59')]['id']}})[_0xc686('0x21')](handleEntityNotFound(_0x2cfbc6,null))[_0xc686('0x21')](function(_0x3b6a3b){if(_0x3b6a3b){return _0x3b6a3b['removeAnswers'](_0x5b660d[_0xc686('0x44')][_0xc686('0x70')]);}})['then'](respondWithStatusCode(_0x2cfbc6,null))[_0xc686('0x2c')](handleError(_0x2cfbc6,null));};exports['notify']=function(_0x5600ec,_0xed27aa,_0x541efb){var _0x492715={'channel':_0xc686('0x71')};var _0x31b38c=[];var _0x566804=[];var _0x5dcd4e={};return db['SmsAccount'][_0xc686('0x5d')]({'where':{'id':_0x5600ec[_0xc686('0x59')]['id']},'include':[{'model':db[_0xc686('0x72')],'as':'Applications'}]})[_0xc686('0x21')](handleEntityNotFound(_0xed27aa,null))[_0xc686('0x21')](function(_0x32b836){_0x492715[_0xc686('0x73')]=_0x32b836;_0x492715[_0xc686('0x74')]=_['orderBy'](_0x32b836['Applications'],['priority'],[_0xc686('0x75')]);if(_0x492715[_0xc686('0x73')][_0xc686('0x76')]){delete _0x492715[_0xc686('0x73')][_0xc686('0x76')];}return db['CmContact'][_0xc686('0x65')]();})[_0xc686('0x21')](function(_0x56efac){if(!_0x56efac){throw new db[(_0xc686('0x77'))][(_0xc686('0x78'))]('no\x20available\x20attributes');}_0x31b38c=_[_0xc686('0x79')](_[_0xc686('0x43')](_0x56efac),['createdAt',_0xc686('0x7a')]);_0x566804=_['difference'](_[_0xc686('0x43')](_0x56efac),[_0xc686('0x7b'),_0xc686('0x7a'),'CompanyId',_0xc686('0x7c')]);_0x492715['body']={'mapKey':_0xc686('0x7d')};if(_0x492715['account'][_0xc686('0x51')]){switch(_0x492715[_0xc686('0x73')][_0xc686('0x51')]){case _0xc686('0x7e'):_0x492715['body'][_0xc686('0x7f')]=_0x5600ec[_0xc686('0x5f')][_0xc686('0x80')];_0x492715['body'][_0xc686('0x5f')]=_0x5600ec[_0xc686('0x5f')][_0xc686('0x81')];_0x492715[_0xc686('0x5f')][_0xc686('0x82')]=_0x5600ec[_0xc686('0x5f')][_0xc686('0x83')];break;case _0xc686('0x84'):_0x492715[_0xc686('0x5f')][_0xc686('0x7f')]='+'+_0x5600ec['body']['sender'];_0x492715['body'][_0xc686('0x5f')]=_0x5600ec[_0xc686('0x5f')][_0xc686('0x85')];break;case _0xc686('0x86'):_0x492715[_0xc686('0x5f')][_0xc686('0x7f')]=_0x5600ec['body'][_0xc686('0x7f')];_0x492715[_0xc686('0x5f')]['body']=_0x5600ec[_0xc686('0x5f')][_0xc686('0x2a')];break;case _0xc686('0x87'):_0x492715[_0xc686('0x5f')]['from']=_0x5600ec['body'][_0xc686('0x7f')];_0x492715[_0xc686('0x5f')][_0xc686('0x5f')]=_0x5600ec[_0xc686('0x5f')][_0xc686('0x5f')];_0x492715['body']['messageId']=_0x5600ec[_0xc686('0x5f')][_0xc686('0x88')];break;case _0xc686('0x89'):_0x492715[_0xc686('0x5f')][_0xc686('0x7f')]=_0x5600ec[_0xc686('0x5f')][_0xc686('0x80')];_0x492715[_0xc686('0x5f')][_0xc686('0x5f')]=_0x5600ec[_0xc686('0x5f')][_0xc686('0x8a')];_0x492715[_0xc686('0x5f')]['messageId']=_0x5600ec[_0xc686('0x5f')][_0xc686('0x8b')];break;case _0xc686('0x8c'):_0x492715[_0xc686('0x5f')][_0xc686('0x7f')]='+'+_0x5600ec['body'][_0xc686('0x8d')][0x0][_0xc686('0x7f')];_0x492715[_0xc686('0x5f')][_0xc686('0x5f')]=_0x5600ec[_0xc686('0x5f')][_0xc686('0x8d')][0x0][_0xc686('0x85')];_0x492715[_0xc686('0x5f')][_0xc686('0x82')]=_0x5600ec[_0xc686('0x5f')][_0xc686('0x8d')][0x0]['messageId'];break;case'csc':_0x492715[_0xc686('0x5f')][_0xc686('0x7f')]=_0x5600ec[_0xc686('0x5f')][_0xc686('0x8e')];_0x492715[_0xc686('0x5f')]['body']=_0x5600ec['body'][_0xc686('0x8f')]['message'];break;case _0xc686('0x90'):_0x492715['body']['from']=_0x5600ec['body'][_0xc686('0x91')];_0x492715[_0xc686('0x5f')]['body']=_0x5600ec['body'][_0xc686('0x85')];_0x492715[_0xc686('0x5f')][_0xc686('0x82')]=_0x5600ec['body'][_0xc686('0x92')];break;case'intelepeer':_0x492715[_0xc686('0x5f')][_0xc686('0x7f')]=_0x5600ec[_0xc686('0x5f')][_0xc686('0x7f')];_0x492715[_0xc686('0x5f')][_0xc686('0x5f')]=_0x5600ec[_0xc686('0x5f')]['message'];_0x492715[_0xc686('0x5f')]['messageId']=_0x5600ec['body'][_0xc686('0x93')];break;}}if(_0x492715[_0xc686('0x5f')]['id']){delete _0x492715[_0xc686('0x5f')]['id'];}if(_[_0xc686('0x94')](_0x492715[_0xc686('0x5f')][_0xc686('0x7f')])){throw new db[(_0xc686('0x77'))][(_0xc686('0x78'))]('from\x20is\x20mandatory');}if(_[_0xc686('0x94')](_0x492715[_0xc686('0x5f')][_0xc686('0x5f')])||_0x492715[_0xc686('0x5f')][_0xc686('0x5f')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x492715[_0xc686('0x5f')]['mapKey'])){throw new db[(_0xc686('0x77'))][(_0xc686('0x78'))](_0xc686('0x95')+_0x566804);}if(!_[_0xc686('0x96')](_0x566804,_0x492715['body']['mapKey'])){throw new db['Sequelize'][(_0xc686('0x78'))](_0xc686('0x97')+_0x566804);}_0x5dcd4e[_0x492715['body']['mapKey']]=_0x492715[_0xc686('0x5f')][_0xc686('0x7f')];return db['CmList'][_0xc686('0x5d')]({'where':{'id':_0x492715['account'][_0xc686('0x7c')]},'include':[{'model':db['CmContact'],'as':_0xc686('0x98'),'where':_0x5dcd4e,'limit':0x1,'order':[[_0xc686('0x7a'),_0xc686('0x99')]]}]});})['then'](handleEntityNotFound(_0xed27aa,null))[_0xc686('0x21')](function(_0x44620a){if(_0x44620a){_0x492715[_0xc686('0x9a')]=_[_0xc686('0x9b')](_0x44620a,[_0xc686('0x98')]);if(_0x44620a[_0xc686('0x98')][_0xc686('0x48')]){return _0x44620a[_0xc686('0x98')][0x0];}var _0x2292b3=_[_0xc686('0x19')](_0x492715[_0xc686('0x5f')],{'firstName':_0x492715[_0xc686('0x5f')][_0xc686('0x7f')],'ListId':_0x44620a['id']});_0x2292b3[_0x492715[_0xc686('0x5f')][_0xc686('0x9c')]]=_0x492715[_0xc686('0x5f')][_0xc686('0x7f')];return db['CmContact'][_0xc686('0x5e')](_0x2292b3,{'fields':_0x31b38c,'raw':!![]});}})[_0xc686('0x21')](handleEntityNotFound(_0xed27aa,null))[_0xc686('0x21')](function(_0x41846f){if(_0x41846f){_0x492715[_0xc686('0x9d')]=_0x41846f;var _0x4624a8={'ContactId':_0x41846f['id'],'phone':_0x492715['body'][_0xc686('0x7f')],'SmsAccountId':_0x5600ec['params']['id']};var _0x46ef84={'ContactId':_0x41846f['id'],'SmsAccountId':_0x5600ec[_0xc686('0x59')]['id'],'closed':![]};return db['SmsInteraction'][_0xc686('0x5d')]({'where':_0x46ef84})[_0xc686('0x21')](function(_0x2efe64){if(_0x2efe64){return[_0x2efe64,![]];}return db[_0xc686('0x9e')][_0xc686('0x5e')](_0x4624a8)['then'](function(_0x4146fa){return[_0x4146fa,!![]];});});}})[_0xc686('0x9f')](function(_0x51a725,_0x534ebb){_0x492715[_0xc686('0xa0')]=_0x51a725[_0xc686('0x39')]({'plain':!![]});_0x492715[_0xc686('0xa0')]['created']=![];if(_0x534ebb){if(_0x492715[_0xc686('0x73')]['autoclose']){_0x492715[_0xc686('0x74')][_0xc686('0xa1')]({'id':0x0,'priority':_0x492715['applications'][_0xc686('0x48')]+0x1,'app':_0xc686('0xa2'),'appdata':_0xc686('0xa3'),'interval':_0xc686('0xa4')});}_0x492715[_0xc686('0xa0')][_0xc686('0xa5')]=!![];}return db[_0xc686('0xa6')][_0xc686('0x5e')]({'phone':_0x492715[_0xc686('0x5f')][_0xc686('0x7f')],'messageId':_0x492715[_0xc686('0x5f')][_0xc686('0x82')],'body':_0x492715[_0xc686('0x5f')]['body'],'SmsAccountId':_0x5600ec[_0xc686('0x59')]['id'],'SmsInteractionId':_0x51a725['id'],'direction':'in','ContactId':_0x51a725[_0xc686('0xa7')],'AttachmentId':_0x492715[_0xc686('0x5f')][_0xc686('0xa8')]});})['then'](function(_0x22ba97){_0x492715[_0xc686('0x2a')]=_0x22ba97;if(_0x492715[_0xc686('0xa0')][_0xc686('0xa9')]){return db[_0xc686('0xaa')][_0xc686('0x5d')]({'attributes':['id',_0xc686('0x3d')],'where':{'id':_0x492715[_0xc686('0xa0')]['UserId']}})['then'](function(_0xc262f3){if(_0xc262f3){_0x492715['applications'][_0xc686('0xab')]({'id':0x0,'priority':0x0,'app':_0xc686('0xac'),'appdata':_0xc262f3[_0xc686('0x3d')]+','+(_0x492715['account'][_0xc686('0xad')]||0xa),'interval':_0xc686('0xa4')});}return respondWithRpcPromise('Start','startRouting',_0x492715);});}return respondWithRpcPromise(_0xc686('0xae'),'startRouting',_0x492715);})[_0xc686('0x21')](function(_0x1efff7){if(_0x1efff7){var _0x5dc247=0xc8;var _0x378bba=_0xc686('0xaf');logger[_0xc686('0x22')](_0xc686('0x26'),_0x378bba,_0x5dc247,'entity\x20found');logger['debug'](_0xc686('0xb0'),_0x378bba,_0x5dc247,'entity\x20found',JSON[_0xc686('0x27')](_0x1efff7));if(_0x492715[_0xc686('0x73')][_0xc686('0x51')]===_0xc686('0x7e')){return _0xed27aa[_0xc686('0x2d')](_0x5dc247)[_0xc686('0x33')](_0xc686('0xb1'),_0xc686('0xb2'))[_0xc686('0x3e')]('\x0a');}else{return _0xed27aa[_0xc686('0x2d')](_0x5dc247)['json'](_0x1efff7);}}})[_0xc686('0x2c')](handleError(_0xed27aa,null));};exports['addApplications']=function(_0x22dca1,_0x18f17b,_0x49123c){return db['SmsAccount'][_0xc686('0x68')]({'where':{'id':_0x22dca1['params']['id']}})[_0xc686('0x21')](handleEntityNotFound(_0x18f17b,null))[_0xc686('0x21')](function(_0x3f479b){if(_0x3f479b){return db[_0xc686('0xb3')]['transaction'](function(_0x60c161){return db['SmsApplication'][_0xc686('0x38')]({'where':{'SmsAccountId':_0x22dca1[_0xc686('0x59')]['id']},'transaction':_0x60c161})[_0xc686('0x21')](function(_0x1decd2){var _0x8be1e2=_[_0xc686('0x50')](_0x22dca1[_0xc686('0x5f')],function(_0x3109d4){_0x3109d4[_0xc686('0x67')]=_0x22dca1[_0xc686('0x59')]['id'];return _0x3109d4;});return db[_0xc686('0x72')][_0xc686('0xb4')](_0x8be1e2,{'transaction':_0x60c161});});})[_0xc686('0x21')](function(){return db[_0xc686('0x72')]['findAndCountAll']({'where':{'SmsAccountId':_0x22dca1['params']['id']},'order':'priority'});});}})[_0xc686('0x21')](respondWithResult(_0x18f17b,null))['catch'](handleError(_0x18f17b,null));};exports['getApplications']=function(_0x3088a1,_0x31f910,_0x149188){var _0x359ac4={};var _0x34411b={};var _0x537655;var _0x4072d0;return db['SmsAccount'][_0xc686('0x68')]({'where':{'id':_0x3088a1[_0xc686('0x59')]['id']}})[_0xc686('0x21')](handleEntityNotFound(_0x31f910,null))[_0xc686('0x21')](function(_0x235946){if(_0x235946){_0x537655=_0x235946;_0x34411b['model']=_[_0xc686('0x43')](db[_0xc686('0x72')][_0xc686('0x41')]);_0x34411b[_0xc686('0x44')]=_[_0xc686('0x43')](_0x3088a1[_0xc686('0x44')]);_0x34411b[_0xc686('0x4c')]=_[_0xc686('0x45')](_0x34411b[_0xc686('0x42')],_0x34411b[_0xc686('0x44')]);_0x359ac4[_0xc686('0x46')]=_[_0xc686('0x45')](_0x34411b[_0xc686('0x42')],qs[_0xc686('0x47')](_0x3088a1[_0xc686('0x44')][_0xc686('0x47')]));_0x359ac4[_0xc686('0x46')]=_0x359ac4['attributes'][_0xc686('0x48')]?_0x359ac4[_0xc686('0x46')]:_0x34411b['model'];_0x359ac4['order']=qs[_0xc686('0x4b')](_0x3088a1[_0xc686('0x44')][_0xc686('0x4b')]);_0x359ac4['where']=qs['filters'](_[_0xc686('0x4d')](_0x3088a1[_0xc686('0x44')],_0x34411b[_0xc686('0x4c')]));if(_0x3088a1[_0xc686('0x44')][_0xc686('0x54')]){_0x359ac4['where']=_[_0xc686('0x4f')](_0x359ac4[_0xc686('0x4e')],{'$or':_['map'](_0x359ac4[_0xc686('0x46')],function(_0x6148d3){var _0x1229ed={};_0x1229ed[_0x6148d3]={'$like':'%'+_0x3088a1[_0xc686('0x44')][_0xc686('0x54')]+'%'};return _0x1229ed;})});}_0x359ac4=_[_0xc686('0x4f')]({},_0x359ac4,_0x3088a1['options']);return _0x537655[_0xc686('0xb5')](_0x359ac4);}})[_0xc686('0x21')](function(_0x3c40ef){if(_0x3c40ef){_0x4072d0=_0x3c40ef[_0xc686('0x48')];if(!_0x3088a1[_0xc686('0x44')][_0xc686('0x49')](_0xc686('0x6e'))){_0x359ac4[_0xc686('0x32')]=qs['limit'](_0x3088a1[_0xc686('0x44')][_0xc686('0x32')]);_0x359ac4[_0xc686('0x31')]=qs[_0xc686('0x31')](_0x3088a1[_0xc686('0x44')][_0xc686('0x31')]);}return _0x537655[_0xc686('0xb5')](_0x359ac4);}})[_0xc686('0x21')](function(_0x40f308){if(_0x40f308){return _0x40f308?{'count':_0x4072d0,'rows':_0x40f308}:null;}})[_0xc686('0x21')](respondWithResult(_0x31f910,null))[_0xc686('0x2c')](handleError(_0x31f910,null));};exports['getInteractions']=function(_0x119d29,_0x25bea8,_0x39ffbd){var _0x9be03b={'raw':![],'where':{}};var _0x31b32e={};var _0x56eca8={'count':0x0,'rows':[]};return db[_0xc686('0x40')][_0xc686('0x68')]({'where':{'id':_0x119d29[_0xc686('0x59')]['id']}})[_0xc686('0x21')](handleEntityNotFound(_0x25bea8,null))[_0xc686('0x21')](function(_0x463f4c){if(_0x463f4c){_0x31b32e[_0xc686('0x42')]=_[_0xc686('0x43')](db[_0xc686('0x9e')][_0xc686('0x41')]);_0x31b32e[_0xc686('0x44')]=_[_0xc686('0x43')](_0x119d29[_0xc686('0x44')]);_0x31b32e[_0xc686('0x4c')]=_[_0xc686('0x45')](_0x31b32e[_0xc686('0x42')],_0x31b32e[_0xc686('0x44')]);_0x9be03b[_0xc686('0x46')]=_[_0xc686('0x45')](_0x31b32e[_0xc686('0x42')],qs[_0xc686('0x47')](_0x119d29[_0xc686('0x44')][_0xc686('0x47')]));_0x9be03b[_0xc686('0x46')]=_0x9be03b['attributes'][_0xc686('0x48')]?_0x9be03b[_0xc686('0x46')]:_0x31b32e[_0xc686('0x42')];if(!_0x119d29[_0xc686('0x44')][_0xc686('0x49')](_0xc686('0x6e'))){_0x9be03b[_0xc686('0x32')]=qs[_0xc686('0x32')](_0x119d29['query']['limit']);_0x9be03b['offset']=qs[_0xc686('0x31')](_0x119d29[_0xc686('0x44')][_0xc686('0x31')]);}_0x9be03b[_0xc686('0x4a')]=qs[_0xc686('0x4b')](_0x119d29[_0xc686('0x44')][_0xc686('0x4b')]);_0x9be03b[_0xc686('0x4e')]=qs[_0xc686('0x4c')](_['pick'](_0x119d29[_0xc686('0x44')],_0x31b32e['filters']));_0x9be03b[_0xc686('0x4e')][_0xc686('0x67')]=_0x463f4c['id'];if(_0x119d29[_0xc686('0x44')][_0xc686('0x54')]){_0x9be03b[_0xc686('0x4e')]=_[_0xc686('0x4f')](_0x9be03b[_0xc686('0x4e')],{'$or':_[_0xc686('0x50')](_0x9be03b[_0xc686('0x46')],function(_0x328c02){var _0x188742={};_0x188742[_0x328c02]={'$like':'%'+_0x119d29[_0xc686('0x44')][_0xc686('0x54')]+'%'};return _0x188742;})});}_0x9be03b=_[_0xc686('0x4f')]({},_0x9be03b,_0x119d29['options']);return db['SmsInteraction'][_0xc686('0x30')]({'where':_0x9be03b[_0xc686('0x4e')]})['then'](function(_0x54aa11){_0x56eca8['count']=_0x54aa11;if(_0x119d29[_0xc686('0x44')][_0xc686('0x5c')]){_0x9be03b[_0xc686('0x56')]=[{'model':db[_0xc686('0xb6')],'as':'Contact','required':![]},{'model':db[_0xc686('0xaa')],'as':_0xc686('0xb7'),'attributes':['name',_0xc686('0xb8'),'internal'],'required':![]},{'model':db[_0xc686('0xb9')],'as':_0xc686('0xba'),'attributes':['id',_0xc686('0x3d'),_0xc686('0xbb')],'where':_0x119d29[_0xc686('0x44')][_0xc686('0xbc')]?{'id':_0x119d29[_0xc686('0x44')][_0xc686('0xbc')]}:undefined,'required':_0x119d29['query'][_0xc686('0xbc')]?!![]:![]}];}return db['SmsInteraction'][_0xc686('0x57')](_0x9be03b);})[_0xc686('0x21')](function(_0x1d90d8){_0x56eca8[_0xc686('0x6a')]=_0x1d90d8;return _0x56eca8;});}})['then'](respondWithFilteredResult(_0x25bea8,_0x9be03b))[_0xc686('0x2c')](handleError(_0x25bea8,null));};exports['send']=function(_0x3f5229,_0x4c8a4e,_0x141a85){var _0x5907f0,_0x7b4ce0,_0x49ab67;if(_[_0xc686('0x94')](_0x3f5229['body'][_0xc686('0x5f')])||_0x3f5229[_0xc686('0x5f')][_0xc686('0x5f')]===''){throw new db['Sequelize']['ValidationError'](_0xc686('0xbd'));}if(_[_0xc686('0x94')](_0x3f5229['body']['to'])){throw new db[(_0xc686('0x77'))][(_0xc686('0x78'))](_0xc686('0xbe'));}_0x5907f0=_0x3f5229[_0xc686('0x5f')]['to'];return db[_0xc686('0x40')]['find']({'where':{'id':_0x3f5229['params']['id']},'include':[{'model':db[_0xc686('0xbf')],'as':_0xc686('0xc0'),'include':[{'model':db[_0xc686('0xb6')],'as':'Contacts','where':{'mobile':_0x5907f0},'limit':0x1,'order':[['updatedAt',_0xc686('0x99')]]}]}]})[_0xc686('0x21')](handleEntityNotFound(_0x4c8a4e,null))[_0xc686('0x21')](function(_0x69461e){if(_0x69461e&&_0x69461e[_0xc686('0xc0')]){_0x7b4ce0=_0x69461e[_0xc686('0x39')]({'plain':!![]});if(_0x7b4ce0[_0xc686('0xc0')]&&_0x7b4ce0[_0xc686('0xc0')]['Contacts'][_0xc686('0x48')]){return _0x7b4ce0[_0xc686('0xc0')]['Contacts'][0x0];}return db[_0xc686('0xb6')][_0xc686('0x5e')](_[_0xc686('0x19')](_0x3f5229['body'],{'firstName':_0x5907f0,'mobile':_0x5907f0,'phone':_0x5907f0,'ListId':_0x7b4ce0[_0xc686('0x7c')]}));}})['then'](handleEntityNotFound(_0x4c8a4e,null))[_0xc686('0x21')](function(_0x148604){if(_0x148604){_0x49ab67=_0x148604;return db[_0xc686('0x9e')][_0xc686('0x5d')]({'where':{'ContactId':_0x49ab67['id'],'closed':![],'SmsAccountId':_0x7b4ce0['id']}})['then'](function(_0x49b0b0){if(_0x49b0b0){return[_0x49b0b0,![]];}return db[_0xc686('0x9e')][_0xc686('0x5e')]({'UserId':_0x3f5229[_0xc686('0x61')]['id'],'ContactId':_0x49ab67['id'],'SmsAccountId':_0x7b4ce0['id'],'phone':_0x5907f0,'firstMsgDirection':_0xc686('0xc1'),'Messages':[_[_0xc686('0x4f')](_0x3f5229['body'],{'read':![],'body':_0x3f5229['body'][_0xc686('0x5f')],'phone':_0x5907f0,'SmsAccountId':_0x7b4ce0['id'],'UserId':_0x3f5229['user']['id'],'ContactId':_0x49ab67['id']})]},{'include':[{'model':db[_0xc686('0xa6')],'as':_0xc686('0xc2')}]})[_0xc686('0x21')](function(_0x267aeb){return[_0x267aeb,!![]];});});}})['spread'](function(_0x1907f9,_0x48dab4){if(_0x48dab4){return _0x1907f9;}return db[_0xc686('0xa6')][_0xc686('0x5e')](_[_0xc686('0x4f')](_0x3f5229[_0xc686('0x5f')],{'read':![],'body':_0x3f5229[_0xc686('0x5f')][_0xc686('0x5f')],'phone':_0x5907f0,'SmsAccountId':_0x7b4ce0['id'],'SmsInteractionId':_0x1907f9['id'],'UserId':_0x3f5229[_0xc686('0x61')]['id'],'ContactId':_0x49ab67['id']}))[_0xc686('0x21')](function(_0x2f3658){_0x1907f9[_0xc686('0xc3')][_0xc686('0xc2')]=[];_0x1907f9[_0xc686('0xc3')][_0xc686('0xc2')][_0xc686('0xa1')](_0x2f3658[_0xc686('0xc3')]);return _0x1907f9;});})['then'](respondWithResult(_0x4c8a4e,null))[_0xc686('0x2c')](handleError(_0x4c8a4e,null));};exports[_0xc686('0x2d')]=function(_0x4116a8,_0x1b5d12,_0x50e757){if(_0x4116a8[_0xc686('0x5f')]['id']){delete _0x4116a8[_0xc686('0x5f')]['id'];}console[_0xc686('0xc4')](_0xc686('0xc5'),_0x4116a8['body']);var _0x5b8d97,_0x3d55bb,_0x9100b8;return db[_0xc686('0x40')][_0xc686('0x5d')]({'where':{'id':_0x4116a8['params']['id']}})['then'](handleEntityNotFound(_0x1b5d12,null))[_0xc686('0x21')](function(_0x2c9bb4){if(_0x2c9bb4){_0x9100b8=_0x2c9bb4;logger[_0xc686('0x25')](_0xc686('0x26'),_0xc686('0x2d'),_0xc686('0xc6'),_0x2c9bb4[_0xc686('0x51')],util['inspect'](_0x4116a8[_0xc686('0x5f')],{'showHidden':![],'depth':null}));switch(_0x2c9bb4[_0xc686('0x51')]){case _0xc686('0x84'):if(_0x4116a8[_0xc686('0x5f')]['skebby_dispatch_id']&&_0x4116a8[_0xc686('0x5f')][_0xc686('0x2d')]){_0x3d55bb=_0x4116a8['body']['status'];return db['SmsMessage'][_0xc686('0x5d')]({'where':{'messageId':_0x4116a8[_0xc686('0x5f')][_0xc686('0xc7')]}});}break;case _0xc686('0x86'):if(_0x4116a8[_0xc686('0x5f')][_0xc686('0xc8')]&&_0x4116a8['body']['statusInt']){_0x3d55bb=_0x4116a8['body'][_0xc686('0xc9')];return db['SmsMessage'][_0xc686('0x5d')]({'where':{'messageId':_0x4116a8[_0xc686('0x5f')][_0xc686('0xc8')]}});}break;case _0xc686('0x87'):if(_0x4116a8[_0xc686('0x5f')][_0xc686('0x88')]&&_0x4116a8['body'][_0xc686('0xca')]){_0x3d55bb=_0x4116a8[_0xc686('0x5f')][_0xc686('0xca')];return db[_0xc686('0xa6')]['find']({'where':{'messageId':_0x4116a8[_0xc686('0x5f')][_0xc686('0x88')]}});}break;case _0xc686('0x8c'):var _0x13896f=_0x4116a8[_0xc686('0x5f')][_0xc686('0x8d')][0x0];if(_0x13896f[_0xc686('0x82')]&&_0x13896f[_0xc686('0x2d')]['groupName']===_0xc686('0xcb')){_0x3d55bb=_0x13896f[_0xc686('0x2d')][_0xc686('0xcc')];return db[_0xc686('0xa6')][_0xc686('0x5d')]({'where':{'messageId':_0x13896f['messageId']}});}break;case _0xc686('0x90'):if(_0x4116a8[_0xc686('0x5f')]['messageId']&&_0x4116a8[_0xc686('0x5f')][_0xc686('0x2d')]){_0x3d55bb=_0x4116a8['body']['status'];return db[_0xc686('0xa6')]['find']({'where':{'messageId':_0x4116a8[_0xc686('0x5f')][_0xc686('0x82')]}});}break;case _0xc686('0xcd'):if(_0x4116a8[_0xc686('0x5f')][_0xc686('0xce')]&&_0x4116a8['body'][_0xc686('0x2d')]){_0x3d55bb=_0x4116a8[_0xc686('0x5f')][_0xc686('0x2d')];return db[_0xc686('0xa6')]['find']({'where':{'messageId':_0x4116a8[_0xc686('0x5f')][_0xc686('0xce')]}});}break;}}})[_0xc686('0x21')](handleEntityNotFound(_0x1b5d12,null))[_0xc686('0x21')](function(_0x36636f){if(_0x36636f){_0x5b8d97=_0x36636f;switch(_0x9100b8[_0xc686('0x51')]){case _0xc686('0x84'):if(_0x3d55bb===_0xc686('0xcb')){return _0x5b8d97[_0xc686('0x37')]({'read':!![]});}else{logger[_0xc686('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc686('0x2d'),_0xc686('0x84'),util[_0xc686('0xcf')](_0x4116a8['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x3d55bb==='1'){return _0x5b8d97['update']({'read':!![]});}else{logger[_0xc686('0x28')](_0xc686('0x26'),_0xc686('0x2d'),_0xc686('0x84'),util[_0xc686('0xcf')](_0x4116a8[_0xc686('0x5f')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x4116a8['body'][_0xc686('0xd0')]&&_0x3d55bb>=0xc8&&_0x3d55bb<=0xce){return _0x5b8d97[_0xc686('0x37')]({'read':!![]});}else{logger[_0xc686('0x28')](_0xc686('0x26'),_0xc686('0x2d'),_0xc686('0x87'),util[_0xc686('0xcf')](_0x4116a8[_0xc686('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xc686('0x8c'):var _0x17d3bb=_0x4116a8['body'][_0xc686('0x8d')][0x0];if(_0x17d3bb[_0xc686('0x2d')]['groupName']===_0xc686('0xcb')){return _0x5b8d97[_0xc686('0x37')]({'read':!![]});}else{logger[_0xc686('0x28')](_0xc686('0x26'),_0xc686('0x2d'),_0xc686('0x8c'),util['inspect'](_0x4116a8[_0xc686('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xc686('0x90'):if(_0x3d55bb=='DELIVERED_TO_GATEWAY'||_0x3d55bb==_0xc686('0xd1')){return _0x5b8d97[_0xc686('0x37')]({'read':!![]});}else{logger[_0xc686('0x28')](_0xc686('0x26'),_0xc686('0x2d'),_0xc686('0x90'),util[_0xc686('0xcf')](_0x4116a8[_0xc686('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xc686('0xcd'):if(_0x3d55bb==='DELIVRD'||_0x3d55bb==='ACCEPTD'){return _0x5b8d97['update']({'read':!![]});}else{logger[_0xc686('0x28')](_0xc686('0x26'),_0xc686('0x2d'),_0xc686('0xcd'),util['inspect'](_0x4116a8[_0xc686('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x5b8d97;}})['then'](respondWithResult(_0x1b5d12,null))['catch'](handleError(_0x1b5d12,null));};exports[_0xc686('0xd2')]=function(_0x136235,_0x4c2979,_0x426efa){var _0x2b904d,_0x329767,_0x3ec95b;return db[_0xc686('0x40')][_0xc686('0x5d')]({'where':{'id':_0x136235[_0xc686('0x59')]['id']}})[_0xc686('0x21')](handleEntityNotFound(_0x4c2979,null))[_0xc686('0x21')](function(_0x5dec87){if(_0x5dec87){_0x3ec95b=_0x5dec87;logger[_0xc686('0x25')](_0xc686('0x26'),_0xc686('0x2d'),'received\x20delivery\x20report\x20from',_0x5dec87[_0xc686('0x51')],util[_0xc686('0xcf')](_0x136235['query'],{'showHidden':![],'depth':null}));switch(_0x5dec87[_0xc686('0x51')]){case _0xc686('0xd3'):if(_0x136235[_0xc686('0x44')][_0xc686('0xd4')]&&_0x136235['query'][_0xc686('0xd5')]){_0x329767=_0x136235['query']['state'];return db['SmsMessage'][_0xc686('0x5d')]({'where':{'messageId':_0x136235[_0xc686('0x44')]['message-id']}});}break;}}})[_0xc686('0x21')](handleEntityNotFound(_0x4c2979,null))[_0xc686('0x21')](function(_0xca5d92){if(_0xca5d92){_0x2b904d=_0xca5d92;switch(_0x3ec95b['type']){case'csc':if(_0x329767==='2'||_0x329767==='6'){return _0x2b904d[_0xc686('0x37')]({'read':!![]});}else{logger[_0xc686('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','csc',util['inspect'](_0x136235[_0xc686('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x2b904d;}})['then'](respondWithResult(_0x4c2979,null))['catch'](handleError(_0x4c2979,null));};exports[_0xc686('0xd6')]=function(_0x5aa9b1,_0x1d8b1,_0x35f1f5){return db[_0xc686('0x40')][_0xc686('0x5d')]({'where':{'id':_0x5aa9b1[_0xc686('0x59')]['id']}})['then'](handleEntityNotFound(_0x1d8b1,null))[_0xc686('0x21')](function(_0x9508cb){if(_0x9508cb){return _0x9508cb[_0xc686('0xd6')](_0x5aa9b1[_0xc686('0x5f')]['ids'],_[_0xc686('0x9b')](_0x5aa9b1[_0xc686('0x5f')],[_0xc686('0x70'),'id'])||{})['spread'](function(_0x1b72be){for(var _0x44bbf9=0x0;_0x44bbf9<_0x5aa9b1[_0xc686('0x5f')]['ids'][_0xc686('0x48')];_0x44bbf9+=0x1){socket[_0xc686('0xd7')](_0xc686('0xd8'),{'UserId':_0x5aa9b1[_0xc686('0x5f')][_0xc686('0x70')][_0x44bbf9],'SmsAccountId':_0x5aa9b1[_0xc686('0x59')]['id']});}return _0x1b72be;});}})[_0xc686('0x21')](respondWithResult(_0x1d8b1,null))[_0xc686('0x2c')](handleError(_0x1d8b1,null));};exports['removeAgents']=function(_0x201995,_0x221668,_0x501861){return db[_0xc686('0x40')]['find']({'where':{'id':_0x201995[_0xc686('0x59')]['id']}})[_0xc686('0x21')](handleEntityNotFound(_0x221668,null))[_0xc686('0x21')](function(_0x8ff88f){if(_0x8ff88f){return _0x8ff88f[_0xc686('0xd9')](_0x201995[_0xc686('0x44')][_0xc686('0x70')])[_0xc686('0x21')](function(){if(_[_0xc686('0xda')](_0x201995[_0xc686('0x44')][_0xc686('0x70')])){for(var _0x4c478c=0x0;_0x4c478c<_0x201995['query']['ids']['length'];_0x4c478c+=0x1){socket[_0xc686('0xd7')](_0xc686('0xdb'),{'UserId':Number(_0x201995['query'][_0xc686('0x70')][_0x4c478c]),'SmsAccountId':Number(_0x201995['params']['id'])});}}else{socket['emit'](_0xc686('0xdb'),{'UserId':Number(_0x201995[_0xc686('0x44')][_0xc686('0x70')]),'SmsAccountId':Number(_0x201995['params']['id'])});}});}})['then'](respondWithStatusCode(_0x221668,null))['catch'](handleError(_0x221668,null));};exports[_0xc686('0xdc')]=function(_0x3ce6b2,_0x1e456d,_0x4a9274){var _0x48f512={};var _0x5b4f07={};var _0x6aabe1;var _0x2d4545;return db[_0xc686('0x40')][_0xc686('0x68')]({'where':{'id':_0x3ce6b2[_0xc686('0x59')]['id']}})['then'](handleEntityNotFound(_0x1e456d,null))[_0xc686('0x21')](function(_0xa74f51){if(_0xa74f51){_0x6aabe1=_0xa74f51;_0x5b4f07[_0xc686('0x42')]=_[_0xc686('0x43')](db[_0xc686('0xaa')][_0xc686('0x41')]);_0x5b4f07[_0xc686('0x44')]=_[_0xc686('0x43')](_0x3ce6b2['query']);_0x5b4f07['filters']=_[_0xc686('0x45')](_0x5b4f07['model'],_0x5b4f07[_0xc686('0x44')]);_0x48f512[_0xc686('0x46')]=_[_0xc686('0x45')](_0x5b4f07['model'],qs['fields'](_0x3ce6b2[_0xc686('0x44')][_0xc686('0x47')]));_0x48f512[_0xc686('0x46')]=_0x48f512[_0xc686('0x46')][_0xc686('0x48')]?_0x48f512['attributes']:_0x5b4f07['model'];_0x48f512[_0xc686('0x4a')]=qs['sort'](_0x3ce6b2[_0xc686('0x44')][_0xc686('0x4b')]);_0x48f512['where']=qs[_0xc686('0x4c')](_['pick'](_0x3ce6b2[_0xc686('0x44')],_0x5b4f07['filters']));if(_0x3ce6b2['query']['filter']){_0x48f512[_0xc686('0x4e')]=_[_0xc686('0x4f')](_0x48f512[_0xc686('0x4e')],{'$or':_[_0xc686('0x50')](_0x48f512[_0xc686('0x46')],function(_0x4579f9){var _0x5584bf={};_0x5584bf[_0x4579f9]={'$like':'%'+_0x3ce6b2[_0xc686('0x44')]['filter']+'%'};return _0x5584bf;})});}_0x48f512=_['merge']({},_0x48f512,_0x3ce6b2[_0xc686('0x55')]);return _0x6aabe1[_0xc686('0xdc')](_0x48f512);}})['then'](function(_0x2a7498){if(_0x2a7498){_0x2d4545=_0x2a7498[_0xc686('0x48')];if(!_0x3ce6b2['query']['hasOwnProperty'](_0xc686('0x6e'))){_0x48f512[_0xc686('0x32')]=qs[_0xc686('0x32')](_0x3ce6b2[_0xc686('0x44')][_0xc686('0x32')]);_0x48f512[_0xc686('0x31')]=qs[_0xc686('0x31')](_0x3ce6b2[_0xc686('0x44')][_0xc686('0x31')]);}return _0x6aabe1[_0xc686('0xdc')](_0x48f512);}})[_0xc686('0x21')](function(_0xcc7180){if(_0xcc7180){return _0xcc7180?{'count':_0x2d4545,'rows':_0xcc7180}:null;}})[_0xc686('0x21')](respondWithResult(_0x1e456d,null))[_0xc686('0x2c')](handleError(_0x1e456d,null));}; \ No newline at end of file +var _0x63ec=['getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','tag','CmList','DESC','List','Messages','dataValues','push','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','requestid','statusInt','status_code','DELIVERED','groupName','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','csc','state','message-id','addAgents','emit','removeAgents','userSmsAccount:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','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','defaults','redis','localhost','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','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','update','then','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','mandatoryDispositionPause','SmsAccount','rawAttributes','keys','query','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','rows','show','params','intersection','length','find','catch','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','SmsAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','findAll','removeAnswers','notify','sms','Applications','account','applications','orderBy','priority','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','twilio','from','From','Body','MessageSid','skebby','text','clicksend','messageId','message_id','plivo','MessageUUID','infobip','results','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','list','omit','contact','SmsInteraction','spread','interaction','autoclose','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications','transaction','SmsApplication','bulkCreate'];(function(_0x4c9fe2,_0x49e4ec){var _0x43e3c4=function(_0x34237e){while(--_0x34237e){_0x4c9fe2['push'](_0x4c9fe2['shift']());}};_0x43e3c4(++_0x49e4ec);}(_0x63ec,0x1e4));var _0xc63e=function(_0x48ce27,_0x3d57a6){_0x48ce27=_0x48ce27-0x0;var _0x4b0fc0=_0x63ec[_0x48ce27];return _0x4b0fc0;};'use strict';var pdf=require(_0xc63e('0x0'));var emlformat=require(_0xc63e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc63e('0x2'));var jsonpatch=require(_0xc63e('0x3'));var rp=require(_0xc63e('0x4'));var moment=require(_0xc63e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc63e('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc63e('0x7'));var ejs=require(_0xc63e('0x8'));var fs=require('fs');var _=require(_0xc63e('0x9'));var squel=require(_0xc63e('0xa'));var crypto=require(_0xc63e('0xb'));var jsforce=require(_0xc63e('0xc'));var deskjs=require(_0xc63e('0xd'));var toCsv=require(_0xc63e('0x7'));var querystring=require(_0xc63e('0xe'));var Papa=require('papaparse');var Redis=require(_0xc63e('0xf'));var authService=require(_0xc63e('0x10'));var qs=require(_0xc63e('0x11'));var hardwareService=require(_0xc63e('0x12'));var logger=require('../../config/logger')(_0xc63e('0x13'));var utils=require(_0xc63e('0x14'));var config=require(_0xc63e('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xc63e('0x16')](config[_0xc63e('0x17')],{'host':_0xc63e('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc63e('0x17')]));require('./smsAccount.socket')[_0xc63e('0x19')](socket);var jayson=require(_0xc63e('0x1a'));var client=jayson[_0xc63e('0x1b')][_0xc63e('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x34ab4d,_0x4ee69c,_0x3d08d1){if(_0x3d08d1){var _0x197550=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x197550[_0xc63e('0x1d')](_0x4ee69c)){return _0x34ab4d;}else{throw new Error(_0xc63e('0x1e'));}}else{return _0x34ab4d;}}function respondWithRpcPromise(_0x509de4,_0x538319,_0x1a0c96,_0x125030){return new BPromise(function(_0x54ef3f,_0x1fe926){var _0x570b12=_0x125030||client;return _0x570b12[_0xc63e('0x1f')](_0x509de4,_0x1a0c96)['then'](function(_0x3ba5d7){logger[_0xc63e('0x20')](_0xc63e('0x21'),_0x538319,_0xc63e('0x22'));logger[_0xc63e('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x538319,_0xc63e('0x22'),JSON[_0xc63e('0x24')](_0x3ba5d7));if(_0x3ba5d7[_0xc63e('0x25')]){if(_0x3ba5d7[_0xc63e('0x25')][_0xc63e('0x26')]===0x1f4){logger['error'](_0xc63e('0x21'),_0x538319,_0x3ba5d7['error'][_0xc63e('0x27')]);return _0x1fe926(_0x3ba5d7[_0xc63e('0x25')][_0xc63e('0x27')]);}logger['error'](_0xc63e('0x21'),_0x538319,_0x3ba5d7['error'][_0xc63e('0x27')]);return _0x54ef3f(_0x3ba5d7[_0xc63e('0x25')]['message']);}else{logger['info'](_0xc63e('0x21'),_0x538319,_0xc63e('0x22'));_0x54ef3f(_0x3ba5d7[_0xc63e('0x28')]['message']);}})['catch'](function(_0x4a3ae8){logger['error'](_0xc63e('0x21'),_0x538319,_0x4a3ae8);_0x1fe926(_0x4a3ae8);});});}function respondWithStatusCode(_0x5ae810,_0x1896c8){_0x1896c8=_0x1896c8||0xcc;return function(_0x215574){if(_0x215574){return _0x5ae810[_0xc63e('0x29')](_0x1896c8);}return _0x5ae810[_0xc63e('0x2a')](_0x1896c8)[_0xc63e('0x2b')]();};}function respondWithResult(_0x4df6f9,_0x558c72){_0x558c72=_0x558c72||0xc8;return function(_0x50023a){if(_0x50023a){return _0x4df6f9[_0xc63e('0x2a')](_0x558c72)['json'](_0x50023a);}};}function respondWithFilteredResult(_0x478e82,_0x3fb777){return function(_0x55c9e7){if(_0x55c9e7){var _0x107ec6=_0x55c9e7[_0xc63e('0x2c')],_0xaf547=_0x3fb777['offset'],_0xcedda6=_0x3fb777[_0xc63e('0x2d')]+_0x3fb777[_0xc63e('0x2e')],_0x28dcf6;if(_0xcedda6>=_0x107ec6){_0xcedda6=_0x107ec6;_0x28dcf6=0xc8;}else{_0x28dcf6=0xce;}_0x478e82[_0xc63e('0x2a')](_0x28dcf6);return _0x478e82[_0xc63e('0x2f')](_0xc63e('0x30'),_0xaf547+'-'+_0xcedda6+'/'+_0x107ec6)[_0xc63e('0x31')](_0x55c9e7);}return null;};}function patchUpdates(_0x286d2e){return function(_0x404c0c){try{jsonpatch['apply'](_0x404c0c,_0x286d2e,!![]);}catch(_0x664c4e){return BPromise[_0xc63e('0x32')](_0x664c4e);}return _0x404c0c['save']();};}function saveUpdates(_0x4f4569,_0x56d34c){return function(_0x1e5928){if(_0x1e5928){return _0x1e5928[_0xc63e('0x33')](_0x4f4569)[_0xc63e('0x34')](function(_0xafcb0b){return _0xafcb0b;});}return null;};}function removeEntity(_0x176940,_0x44f7b1){return function(_0x2eca52){if(_0x2eca52){return _0x2eca52[_0xc63e('0x35')]()[_0xc63e('0x34')](function(){var _0x10df19=_0x2eca52[_0xc63e('0x36')]({'plain':!![]});var _0x3800d2=_0xc63e('0x37');return db[_0xc63e('0x38')][_0xc63e('0x35')]({'where':{'type':_0x3800d2,'resourceId':_0x10df19['id']}})[_0xc63e('0x34')](function(){return _0x2eca52;});})[_0xc63e('0x34')](function(){_0x176940[_0xc63e('0x2a')](0xcc)[_0xc63e('0x2b')]();});}};}function handleEntityNotFound(_0x393489,_0x448858){return function(_0x499c51){if(!_0x499c51){_0x393489[_0xc63e('0x29')](0x194);}return _0x499c51;};}function handleError(_0x573f75,_0x242e0e){_0x242e0e=_0x242e0e||0x1f4;return function(_0x288e76){logger[_0xc63e('0x25')](_0x288e76[_0xc63e('0x39')]);if(_0x288e76[_0xc63e('0x3a')]){delete _0x288e76[_0xc63e('0x3a')];}_0x573f75[_0xc63e('0x2a')](_0x242e0e)[_0xc63e('0x3b')](_0x288e76);};}exports['index']=function(_0x458f49,_0x1a1c4d){var _0x171c09={'include':[{'model':db['Pause'],'as':_0xc63e('0x3c')}]},_0x2b1e2e={},_0x3c03a2={'count':0x0,'rows':[]};var _0x8b7633=db[_0xc63e('0x3d')][_0xc63e('0x3e')];_0x2b1e2e['model']=_[_0xc63e('0x3f')](_0x8b7633);_0x2b1e2e['query']=_[_0xc63e('0x3f')](_0x458f49[_0xc63e('0x40')]);_0x2b1e2e[_0xc63e('0x41')]=_['intersection'](_0x2b1e2e[_0xc63e('0x42')],_0x2b1e2e[_0xc63e('0x40')]);_0x171c09[_0xc63e('0x43')]=_['intersection'](_0x2b1e2e[_0xc63e('0x42')],qs[_0xc63e('0x44')](_0x458f49[_0xc63e('0x40')][_0xc63e('0x44')]));_0x171c09[_0xc63e('0x43')]=_0x171c09[_0xc63e('0x43')]['length']?_0x171c09[_0xc63e('0x43')]:_0x2b1e2e[_0xc63e('0x42')];if(!_0x458f49['query'][_0xc63e('0x45')](_0xc63e('0x46'))){_0x171c09[_0xc63e('0x2e')]=qs['limit'](_0x458f49[_0xc63e('0x40')][_0xc63e('0x2e')]);_0x171c09[_0xc63e('0x2d')]=qs['offset'](_0x458f49['query'][_0xc63e('0x2d')]);}_0x171c09[_0xc63e('0x47')]=qs[_0xc63e('0x48')](_0x458f49[_0xc63e('0x40')]['sort']);_0x171c09[_0xc63e('0x49')]=qs[_0xc63e('0x41')](_[_0xc63e('0x4a')](_0x458f49[_0xc63e('0x40')],_0x2b1e2e[_0xc63e('0x41')]));if(_0x458f49['query']['filter']){_0x171c09[_0xc63e('0x49')]=_[_0xc63e('0x4b')](_0x171c09['where'],{'$or':_[_0xc63e('0x4c')](_0x8b7633,function(_0xf4c5b){if(_0xf4c5b[_0xc63e('0x4d')][_0xc63e('0x4e')]!==_0xc63e('0x4f')){var _0x5aa55c={};_0x5aa55c[_0xf4c5b[_0xc63e('0x50')]]={'$like':'%'+_0x458f49[_0xc63e('0x40')][_0xc63e('0x51')]+'%'};return _0x5aa55c;}})});}_0x171c09=_['merge']({},_0x171c09,_0x458f49[_0xc63e('0x52')]);var _0x255b80={'where':_0x171c09[_0xc63e('0x49')]};return db[_0xc63e('0x3d')][_0xc63e('0x2c')](_0x255b80)['then'](function(_0x34cb88){_0x3c03a2[_0xc63e('0x2c')]=_0x34cb88;if(_0x458f49[_0xc63e('0x40')][_0xc63e('0x53')]){_0x171c09[_0xc63e('0x54')]=[{'all':!![]}];}return db[_0xc63e('0x3d')]['findAll'](_0x171c09);})[_0xc63e('0x34')](function(_0x2090ec){_0x3c03a2[_0xc63e('0x55')]=_0x2090ec;return _0x3c03a2;})[_0xc63e('0x34')](respondWithFilteredResult(_0x1a1c4d,_0x171c09))['catch'](handleError(_0x1a1c4d,null));};exports[_0xc63e('0x56')]=function(_0x2baf3f,_0x40f839){var _0x2e94ae={'raw':![],'where':{'id':_0x2baf3f[_0xc63e('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0xc63e('0x3c')}]},_0x16786a={};_0x16786a['model']=_['keys'](db[_0xc63e('0x3d')][_0xc63e('0x3e')]);_0x16786a[_0xc63e('0x40')]=_[_0xc63e('0x3f')](_0x2baf3f['query']);_0x16786a[_0xc63e('0x41')]=_[_0xc63e('0x58')](_0x16786a[_0xc63e('0x42')],_0x16786a[_0xc63e('0x40')]);_0x2e94ae[_0xc63e('0x43')]=_[_0xc63e('0x58')](_0x16786a[_0xc63e('0x42')],qs[_0xc63e('0x44')](_0x2baf3f[_0xc63e('0x40')][_0xc63e('0x44')]));_0x2e94ae[_0xc63e('0x43')]=_0x2e94ae[_0xc63e('0x43')][_0xc63e('0x59')]?_0x2e94ae[_0xc63e('0x43')]:_0x16786a['model'];if(_0x2baf3f[_0xc63e('0x40')][_0xc63e('0x53')]){_0x2e94ae[_0xc63e('0x54')]=[{'all':!![]}];}_0x2e94ae=_[_0xc63e('0x4b')]({},_0x2e94ae,_0x2baf3f['options']);return db[_0xc63e('0x3d')][_0xc63e('0x5a')](_0x2e94ae)[_0xc63e('0x34')](handleEntityNotFound(_0x40f839,null))[_0xc63e('0x34')](respondWithResult(_0x40f839,null))[_0xc63e('0x5b')](handleError(_0x40f839,null));};exports['create']=function(_0x3195ff,_0x226812){return db[_0xc63e('0x3d')][_0xc63e('0x5c')](_0x3195ff['body'],{})[_0xc63e('0x34')](function(_0x6f74a2){var _0xa280cf=_0x3195ff[_0xc63e('0x5d')]['get']({'plain':!![]});if(!_0xa280cf)throw new Error(_0xc63e('0x5e'));if(_0xa280cf['role']==='user'){var _0x5710a7=_0x6f74a2[_0xc63e('0x36')]({'plain':!![]});var _0x44e91c='SmsAccounts';return db[_0xc63e('0x5f')][_0xc63e('0x5a')]({'where':{'name':_0x44e91c,'userProfileId':_0xa280cf[_0xc63e('0x60')]},'raw':!![]})[_0xc63e('0x34')](function(_0x243762){if(_0x243762&&_0x243762[_0xc63e('0x61')]===0x0){return db[_0xc63e('0x38')][_0xc63e('0x5c')]({'name':_0x5710a7[_0xc63e('0x3a')],'resourceId':_0x5710a7['id'],'type':_0x243762[_0xc63e('0x3a')],'sectionId':_0x243762['id']},{})[_0xc63e('0x34')](function(){return _0x6f74a2;});}else{return _0x6f74a2;}})['catch'](function(_0x470fbe){logger[_0xc63e('0x25')](_0xc63e('0x62'),_0x470fbe);throw _0x470fbe;});}return _0x6f74a2;})[_0xc63e('0x34')](respondWithResult(_0x226812,0xc9))[_0xc63e('0x5b')](handleError(_0x226812,null));};exports[_0xc63e('0x33')]=function(_0x45858d,_0x22aa19){if(_0x45858d[_0xc63e('0x63')]['id']){delete _0x45858d['body']['id'];}return db[_0xc63e('0x3d')]['find']({'where':{'id':_0x45858d['params']['id']},'include':[{'model':db['Pause'],'as':_0xc63e('0x3c')}]})['then'](handleEntityNotFound(_0x22aa19,null))['then'](saveUpdates(_0x45858d[_0xc63e('0x63')],null))[_0xc63e('0x34')](respondWithResult(_0x22aa19,null))['catch'](handleError(_0x22aa19,null));};exports[_0xc63e('0x35')]=function(_0x2e47ac,_0x5e985c){return db[_0xc63e('0x3d')]['find']({'where':{'id':_0x2e47ac['params']['id']}})['then'](handleEntityNotFound(_0x5e985c,null))[_0xc63e('0x34')](removeEntity(_0x5e985c,null))[_0xc63e('0x5b')](handleError(_0x5e985c,null));};exports[_0xc63e('0x64')]=function(_0x13f527,_0x23b555){return db[_0xc63e('0x3d')][_0xc63e('0x64')]()[_0xc63e('0x34')](respondWithResult(_0x23b555,null))['catch'](handleError(_0x23b555,null));};exports[_0xc63e('0x65')]=function(_0x58111b,_0x4e63ec,_0x92d613){if(_0x58111b[_0xc63e('0x63')]['id']){delete _0x58111b[_0xc63e('0x63')]['id'];}return db[_0xc63e('0x3d')][_0xc63e('0x5a')]({'where':{'id':_0x58111b['params']['id']}})['then'](handleEntityNotFound(_0x4e63ec,null))[_0xc63e('0x34')](function(_0x260190){if(_0x260190){_0x58111b[_0xc63e('0x63')][_0xc63e('0x66')]=_0x260190['id'];return db[_0xc63e('0x67')][_0xc63e('0x5c')](_0x58111b[_0xc63e('0x63')]);}})[_0xc63e('0x34')](respondWithResult(_0x4e63ec,null))[_0xc63e('0x5b')](handleError(_0x4e63ec,null));};exports[_0xc63e('0x68')]=function(_0x435531,_0x15cb9e,_0x4b1668){var _0x5ceafd={'raw':![],'where':{}};var _0x433c9e={};var _0x33ae61={'count':0x0,'rows':[]};return db[_0xc63e('0x3d')][_0xc63e('0x69')]({'where':{'id':_0x435531[_0xc63e('0x57')]['id']}})[_0xc63e('0x34')](handleEntityNotFound(_0x15cb9e,null))[_0xc63e('0x34')](function(_0x3e44a1){if(_0x3e44a1){_0x433c9e[_0xc63e('0x42')]=_[_0xc63e('0x3f')](db[_0xc63e('0x67')][_0xc63e('0x3e')]);_0x433c9e['query']=_[_0xc63e('0x3f')](_0x435531[_0xc63e('0x40')]);_0x433c9e[_0xc63e('0x41')]=_[_0xc63e('0x58')](_0x433c9e['model'],_0x433c9e[_0xc63e('0x40')]);_0x5ceafd[_0xc63e('0x43')]=_[_0xc63e('0x58')](_0x433c9e[_0xc63e('0x42')],qs[_0xc63e('0x44')](_0x435531['query'][_0xc63e('0x44')]));_0x5ceafd['attributes']=_0x5ceafd['attributes'][_0xc63e('0x59')]?_0x5ceafd['attributes']:_0x433c9e[_0xc63e('0x42')];if(!_0x435531['query'][_0xc63e('0x45')]('nolimit')){_0x5ceafd[_0xc63e('0x2e')]=qs[_0xc63e('0x2e')](_0x435531['query'][_0xc63e('0x2e')]);_0x5ceafd[_0xc63e('0x2d')]=qs[_0xc63e('0x2d')](_0x435531[_0xc63e('0x40')][_0xc63e('0x2d')]);}_0x5ceafd[_0xc63e('0x47')]=qs[_0xc63e('0x48')](_0x435531['query'][_0xc63e('0x48')]);_0x5ceafd[_0xc63e('0x49')]=qs['filters'](_[_0xc63e('0x4a')](_0x435531[_0xc63e('0x40')],_0x433c9e[_0xc63e('0x41')]));_0x5ceafd[_0xc63e('0x49')]['SmsAccountId']=_0x3e44a1['id'];if(_0x435531[_0xc63e('0x40')]['filter']){_0x5ceafd[_0xc63e('0x49')]=_['merge'](_0x5ceafd['where'],{'$or':_[_0xc63e('0x4c')](_0x5ceafd['attributes'],function(_0x3e0093){var _0x35d398={};_0x35d398[_0x3e0093]={'$like':'%'+_0x435531['query'][_0xc63e('0x51')]+'%'};return _0x35d398;})});}_0x5ceafd=_[_0xc63e('0x4b')]({},_0x5ceafd,_0x435531['options']);return db[_0xc63e('0x67')][_0xc63e('0x2c')]({'where':_0x5ceafd[_0xc63e('0x49')]})[_0xc63e('0x34')](function(_0x4c0c87){_0x33ae61[_0xc63e('0x2c')]=_0x4c0c87;if(_0x435531[_0xc63e('0x40')][_0xc63e('0x53')]){_0x5ceafd['include']=[{'all':!![]}];}return db[_0xc63e('0x67')]['findAll'](_0x5ceafd);})[_0xc63e('0x34')](function(_0x19d32f){_0x33ae61['rows']=_0x19d32f;return _0x33ae61;});}})[_0xc63e('0x34')](respondWithFilteredResult(_0x15cb9e,_0x5ceafd))[_0xc63e('0x5b')](handleError(_0x15cb9e,null));};exports[_0xc63e('0x6a')]=function(_0x14ab5d,_0x54d475,_0x43f9aa){return db[_0xc63e('0x3d')][_0xc63e('0x5a')]({'where':{'id':_0x14ab5d['params']['id']}})[_0xc63e('0x34')](handleEntityNotFound(_0x54d475,null))[_0xc63e('0x34')](function(_0xdf9ca3){if(_0xdf9ca3){return _0xdf9ca3[_0xc63e('0x6a')](_0x14ab5d['query'][_0xc63e('0x6b')]);}})[_0xc63e('0x34')](respondWithStatusCode(_0x54d475,null))[_0xc63e('0x5b')](handleError(_0x54d475,null));};exports[_0xc63e('0x6c')]=function(_0x19855e,_0x1c308e,_0x3e5010){if(_0x19855e['body']['id']){delete _0x19855e['body']['id'];}return db[_0xc63e('0x3d')][_0xc63e('0x5a')]({'where':{'id':_0x19855e[_0xc63e('0x57')]['id']}})[_0xc63e('0x34')](handleEntityNotFound(_0x1c308e,null))[_0xc63e('0x34')](function(_0x1e5311){if(_0x1e5311){_0x19855e[_0xc63e('0x63')][_0xc63e('0x66')]=_0x1e5311['id'];return db[_0xc63e('0x6d')][_0xc63e('0x5c')](_0x19855e[_0xc63e('0x63')]);}})[_0xc63e('0x34')](respondWithResult(_0x1c308e,null))[_0xc63e('0x5b')](handleError(_0x1c308e,null));};exports['getAnswers']=function(_0x4b7ca1,_0x41a269,_0x11cda2){var _0x2c7da3={'raw':![],'where':{}};var _0x5d447b={};var _0x47fadf={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x4b7ca1[_0xc63e('0x57')]['id']}})['then'](handleEntityNotFound(_0x41a269,null))[_0xc63e('0x34')](function(_0x293519){if(_0x293519){_0x5d447b['model']=_[_0xc63e('0x3f')](db[_0xc63e('0x6d')][_0xc63e('0x3e')]);_0x5d447b[_0xc63e('0x40')]=_['keys'](_0x4b7ca1[_0xc63e('0x40')]);_0x5d447b[_0xc63e('0x41')]=_['intersection'](_0x5d447b[_0xc63e('0x42')],_0x5d447b['query']);_0x2c7da3[_0xc63e('0x43')]=_[_0xc63e('0x58')](_0x5d447b['model'],qs[_0xc63e('0x44')](_0x4b7ca1[_0xc63e('0x40')][_0xc63e('0x44')]));_0x2c7da3[_0xc63e('0x43')]=_0x2c7da3[_0xc63e('0x43')][_0xc63e('0x59')]?_0x2c7da3[_0xc63e('0x43')]:_0x5d447b[_0xc63e('0x42')];if(!_0x4b7ca1[_0xc63e('0x40')][_0xc63e('0x45')](_0xc63e('0x46'))){_0x2c7da3[_0xc63e('0x2e')]=qs[_0xc63e('0x2e')](_0x4b7ca1[_0xc63e('0x40')]['limit']);_0x2c7da3[_0xc63e('0x2d')]=qs[_0xc63e('0x2d')](_0x4b7ca1[_0xc63e('0x40')][_0xc63e('0x2d')]);}_0x2c7da3[_0xc63e('0x47')]=qs[_0xc63e('0x48')](_0x4b7ca1[_0xc63e('0x40')][_0xc63e('0x48')]);_0x2c7da3['where']=qs[_0xc63e('0x41')](_[_0xc63e('0x4a')](_0x4b7ca1['query'],_0x5d447b['filters']));_0x2c7da3[_0xc63e('0x49')][_0xc63e('0x66')]=_0x293519['id'];if(_0x4b7ca1[_0xc63e('0x40')][_0xc63e('0x51')]){_0x2c7da3[_0xc63e('0x49')]=_[_0xc63e('0x4b')](_0x2c7da3[_0xc63e('0x49')],{'$or':_[_0xc63e('0x4c')](_0x2c7da3[_0xc63e('0x43')],function(_0x4b0885){var _0x41fc67={};_0x41fc67[_0x4b0885]={'$like':'%'+_0x4b7ca1['query'][_0xc63e('0x51')]+'%'};return _0x41fc67;})});}_0x2c7da3=_[_0xc63e('0x4b')]({},_0x2c7da3,_0x4b7ca1[_0xc63e('0x52')]);return db['CannedAnswer'][_0xc63e('0x2c')]({'where':_0x2c7da3[_0xc63e('0x49')]})[_0xc63e('0x34')](function(_0x32567e){_0x47fadf[_0xc63e('0x2c')]=_0x32567e;if(_0x4b7ca1[_0xc63e('0x40')][_0xc63e('0x53')]){_0x2c7da3[_0xc63e('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0xc63e('0x6e')](_0x2c7da3);})[_0xc63e('0x34')](function(_0x17c82b){_0x47fadf[_0xc63e('0x55')]=_0x17c82b;return _0x47fadf;});}})[_0xc63e('0x34')](respondWithFilteredResult(_0x41a269,_0x2c7da3))[_0xc63e('0x5b')](handleError(_0x41a269,null));};exports['removeAnswers']=function(_0xe31df1,_0x2b4d45,_0x3b51ad){return db[_0xc63e('0x3d')][_0xc63e('0x5a')]({'where':{'id':_0xe31df1['params']['id']}})['then'](handleEntityNotFound(_0x2b4d45,null))['then'](function(_0x1d9fab){if(_0x1d9fab){return _0x1d9fab[_0xc63e('0x6f')](_0xe31df1[_0xc63e('0x40')][_0xc63e('0x6b')]);}})['then'](respondWithStatusCode(_0x2b4d45,null))['catch'](handleError(_0x2b4d45,null));};exports[_0xc63e('0x70')]=function(_0x1f12f2,_0x537ca8,_0x38e204){var _0x14438a={'channel':_0xc63e('0x71')};var _0x2eedf3=[];var _0x440649=[];var _0x274c09={};return db['SmsAccount'][_0xc63e('0x5a')]({'where':{'id':_0x1f12f2[_0xc63e('0x57')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xc63e('0x72')}]})[_0xc63e('0x34')](handleEntityNotFound(_0x537ca8,null))[_0xc63e('0x34')](function(_0x51a320){_0x14438a[_0xc63e('0x73')]=_0x51a320;_0x14438a[_0xc63e('0x74')]=_[_0xc63e('0x75')](_0x51a320[_0xc63e('0x72')],[_0xc63e('0x76')],[_0xc63e('0x77')]);if(_0x14438a[_0xc63e('0x73')][_0xc63e('0x72')]){delete _0x14438a[_0xc63e('0x73')][_0xc63e('0x72')];}return db[_0xc63e('0x78')][_0xc63e('0x64')]();})['then'](function(_0x6058be){if(!_0x6058be){throw new db['Sequelize'][(_0xc63e('0x79'))](_0xc63e('0x7a'));}_0x2eedf3=_[_0xc63e('0x7b')](_[_0xc63e('0x3f')](_0x6058be),[_0xc63e('0x7c'),_0xc63e('0x7d')]);_0x440649=_[_0xc63e('0x7b')](_[_0xc63e('0x3f')](_0x6058be),[_0xc63e('0x7c'),_0xc63e('0x7d'),'CompanyId',_0xc63e('0x7e')]);_0x14438a[_0xc63e('0x63')]={'mapKey':'mobile'};if(_0x14438a[_0xc63e('0x73')]['type']){switch(_0x14438a[_0xc63e('0x73')][_0xc63e('0x4d')]){case _0xc63e('0x7f'):_0x14438a[_0xc63e('0x63')][_0xc63e('0x80')]=_0x1f12f2[_0xc63e('0x63')][_0xc63e('0x81')];_0x14438a[_0xc63e('0x63')][_0xc63e('0x63')]=_0x1f12f2[_0xc63e('0x63')][_0xc63e('0x82')];_0x14438a[_0xc63e('0x63')]['messageId']=_0x1f12f2['body'][_0xc63e('0x83')];break;case _0xc63e('0x84'):_0x14438a['body'][_0xc63e('0x80')]='+'+_0x1f12f2[_0xc63e('0x63')]['sender'];_0x14438a[_0xc63e('0x63')][_0xc63e('0x63')]=_0x1f12f2[_0xc63e('0x63')][_0xc63e('0x85')];break;case'connectel':_0x14438a[_0xc63e('0x63')]['from']=_0x1f12f2[_0xc63e('0x63')][_0xc63e('0x80')];_0x14438a[_0xc63e('0x63')][_0xc63e('0x63')]=_0x1f12f2[_0xc63e('0x63')][_0xc63e('0x27')];break;case _0xc63e('0x86'):_0x14438a[_0xc63e('0x63')][_0xc63e('0x80')]=_0x1f12f2[_0xc63e('0x63')][_0xc63e('0x80')];_0x14438a[_0xc63e('0x63')][_0xc63e('0x63')]=_0x1f12f2[_0xc63e('0x63')]['body'];_0x14438a[_0xc63e('0x63')][_0xc63e('0x87')]=_0x1f12f2['body'][_0xc63e('0x88')];break;case _0xc63e('0x89'):_0x14438a[_0xc63e('0x63')]['from']=_0x1f12f2[_0xc63e('0x63')][_0xc63e('0x81')];_0x14438a[_0xc63e('0x63')]['body']=_0x1f12f2[_0xc63e('0x63')]['Text'];_0x14438a['body'][_0xc63e('0x87')]=_0x1f12f2[_0xc63e('0x63')][_0xc63e('0x8a')];break;case _0xc63e('0x8b'):_0x14438a[_0xc63e('0x63')][_0xc63e('0x80')]='+'+_0x1f12f2['body'][_0xc63e('0x8c')][0x0][_0xc63e('0x80')];_0x14438a['body'][_0xc63e('0x63')]=_0x1f12f2[_0xc63e('0x63')][_0xc63e('0x8c')][0x0][_0xc63e('0x85')];_0x14438a[_0xc63e('0x63')]['messageId']=_0x1f12f2[_0xc63e('0x63')][_0xc63e('0x8c')][0x0]['messageId'];break;case'csc':_0x14438a[_0xc63e('0x63')]['from']=_0x1f12f2['body']['originatingAddress'];_0x14438a['body']['body']=_0x1f12f2[_0xc63e('0x63')][_0xc63e('0x8d')][_0xc63e('0x27')];break;case _0xc63e('0x8e'):_0x14438a[_0xc63e('0x63')][_0xc63e('0x80')]=_0x1f12f2['body'][_0xc63e('0x8f')];_0x14438a[_0xc63e('0x63')][_0xc63e('0x63')]=_0x1f12f2[_0xc63e('0x63')][_0xc63e('0x85')];_0x14438a[_0xc63e('0x63')][_0xc63e('0x87')]=_0x1f12f2[_0xc63e('0x63')][_0xc63e('0x90')];break;case _0xc63e('0x91'):_0x14438a[_0xc63e('0x63')][_0xc63e('0x80')]=_0x1f12f2['body']['from'];_0x14438a['body'][_0xc63e('0x63')]=_0x1f12f2['body'][_0xc63e('0x27')];_0x14438a[_0xc63e('0x63')][_0xc63e('0x87')]=_0x1f12f2[_0xc63e('0x63')][_0xc63e('0x92')];break;}}if(_0x14438a[_0xc63e('0x63')]['id']){delete _0x14438a['body']['id'];}if(_[_0xc63e('0x93')](_0x14438a[_0xc63e('0x63')][_0xc63e('0x80')])){throw new db[(_0xc63e('0x94'))][(_0xc63e('0x79'))](_0xc63e('0x95'));}if(_[_0xc63e('0x93')](_0x14438a[_0xc63e('0x63')]['body'])||_0x14438a['body']['body']===''){throw new db[(_0xc63e('0x94'))][(_0xc63e('0x79'))](_0xc63e('0x96'));}if(_[_0xc63e('0x93')](_0x14438a[_0xc63e('0x63')][_0xc63e('0x97')])){throw new db['Sequelize'][(_0xc63e('0x79'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x440649);}if(!_[_0xc63e('0x98')](_0x440649,_0x14438a['body'][_0xc63e('0x97')])){throw new db[(_0xc63e('0x94'))][(_0xc63e('0x79'))](_0xc63e('0x99')+_0x440649);}_0x274c09[_0x14438a[_0xc63e('0x63')][_0xc63e('0x97')]]=_0x14438a['body'][_0xc63e('0x80')];return db['CmList'][_0xc63e('0x5a')]({'where':{'id':_0x14438a[_0xc63e('0x73')][_0xc63e('0x7e')]},'include':[{'model':db['CmContact'],'as':_0xc63e('0x9a'),'where':_0x274c09,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0xc63e('0x34')](handleEntityNotFound(_0x537ca8,null))['then'](function(_0x99a765){if(_0x99a765){_0x14438a[_0xc63e('0x9b')]=_[_0xc63e('0x9c')](_0x99a765,[_0xc63e('0x9a')]);if(_0x99a765[_0xc63e('0x9a')][_0xc63e('0x59')]){return _0x99a765[_0xc63e('0x9a')][0x0];}var _0x2ffe2f=_[_0xc63e('0x16')](_0x14438a[_0xc63e('0x63')],{'firstName':_0x14438a['body']['from'],'ListId':_0x99a765['id']});_0x2ffe2f[_0x14438a[_0xc63e('0x63')][_0xc63e('0x97')]]=_0x14438a[_0xc63e('0x63')][_0xc63e('0x80')];return db[_0xc63e('0x78')][_0xc63e('0x5c')](_0x2ffe2f,{'fields':_0x2eedf3,'raw':!![]});}})[_0xc63e('0x34')](handleEntityNotFound(_0x537ca8,null))[_0xc63e('0x34')](function(_0x2eee29){if(_0x2eee29){_0x14438a[_0xc63e('0x9d')]=_0x2eee29;var _0x5013e4={'ContactId':_0x2eee29['id'],'phone':_0x14438a[_0xc63e('0x63')][_0xc63e('0x80')],'SmsAccountId':_0x1f12f2['params']['id']};var _0x1f23df={'ContactId':_0x2eee29['id'],'SmsAccountId':_0x1f12f2[_0xc63e('0x57')]['id'],'closed':![]};return db[_0xc63e('0x9e')]['find']({'where':_0x1f23df})[_0xc63e('0x34')](function(_0x556c82){if(_0x556c82){return[_0x556c82,![]];}return db[_0xc63e('0x9e')]['create'](_0x5013e4)[_0xc63e('0x34')](function(_0x15709b){return[_0x15709b,!![]];});});}})[_0xc63e('0x9f')](function(_0x237c06,_0xebb477){_0x14438a[_0xc63e('0xa0')]=_0x237c06[_0xc63e('0x36')]({'plain':!![]});_0x14438a['interaction']['created']=![];if(_0xebb477){if(_0x14438a['account'][_0xc63e('0xa1')]){_0x14438a['applications']['push']({'id':0x0,'priority':_0x14438a['applications'][_0xc63e('0x59')]+0x1,'app':_0xc63e('0xa2'),'appdata':_0xc63e('0xa3'),'interval':_0xc63e('0xa4')});}_0x14438a[_0xc63e('0xa0')]['created']=!![];}return db[_0xc63e('0xa5')]['create']({'phone':_0x14438a[_0xc63e('0x63')][_0xc63e('0x80')],'messageId':_0x14438a[_0xc63e('0x63')]['messageId'],'body':_0x14438a['body'][_0xc63e('0x63')],'SmsAccountId':_0x1f12f2[_0xc63e('0x57')]['id'],'SmsInteractionId':_0x237c06['id'],'direction':'in','ContactId':_0x237c06[_0xc63e('0xa6')],'AttachmentId':_0x14438a[_0xc63e('0x63')][_0xc63e('0xa7')]});})['then'](function(_0x1abfa3){_0x14438a[_0xc63e('0x27')]=_0x1abfa3;if(_0x14438a[_0xc63e('0xa0')][_0xc63e('0xa8')]){return db[_0xc63e('0xa9')]['find']({'attributes':['id',_0xc63e('0x3a')],'where':{'id':_0x14438a[_0xc63e('0xa0')][_0xc63e('0xa8')]}})[_0xc63e('0x34')](function(_0x3177e7){if(_0x3177e7){_0x14438a[_0xc63e('0x74')][_0xc63e('0xaa')]({'id':0x0,'priority':0x0,'app':_0xc63e('0xab'),'appdata':_0x3177e7['name']+','+(_0x14438a['account'][_0xc63e('0xac')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xc63e('0xad'),'startRouting',_0x14438a);});}return respondWithRpcPromise(_0xc63e('0xad'),'startRouting',_0x14438a);})[_0xc63e('0x34')](function(_0x573402){if(_0x573402){var _0x3f699d=0xc8;var _0xb0e55b=_0xc63e('0xae');logger[_0xc63e('0x20')](_0xc63e('0xaf'),_0xb0e55b,_0x3f699d,_0xc63e('0xb0'));logger['debug'](_0xc63e('0xb1'),_0xb0e55b,_0x3f699d,_0xc63e('0xb0'),JSON[_0xc63e('0x24')](_0x573402));if(_0x14438a[_0xc63e('0x73')][_0xc63e('0x4d')]===_0xc63e('0x7f')){return _0x537ca8[_0xc63e('0x2a')](_0x3f699d)[_0xc63e('0x2f')](_0xc63e('0xb2'),_0xc63e('0xb3'))['send'](_0xc63e('0xb4'));}else{return _0x537ca8[_0xc63e('0x2a')](_0x3f699d)[_0xc63e('0x31')](_0x573402);}}})[_0xc63e('0x5b')](handleError(_0x537ca8,null));};exports[_0xc63e('0xb5')]=function(_0x4e32dc,_0x548373,_0x218281){return db[_0xc63e('0x3d')][_0xc63e('0x69')]({'where':{'id':_0x4e32dc[_0xc63e('0x57')]['id']}})['then'](handleEntityNotFound(_0x548373,null))[_0xc63e('0x34')](function(_0x4335ae){if(_0x4335ae){return db['sequelize'][_0xc63e('0xb6')](function(_0x2f61a6){return db[_0xc63e('0xb7')][_0xc63e('0x35')]({'where':{'SmsAccountId':_0x4e32dc[_0xc63e('0x57')]['id']},'transaction':_0x2f61a6})[_0xc63e('0x34')](function(_0x5641e5){var _0x1cdad3=_['map'](_0x4e32dc[_0xc63e('0x63')],function(_0x42676c){_0x42676c[_0xc63e('0x66')]=_0x4e32dc['params']['id'];return _0x42676c;});return db[_0xc63e('0xb7')][_0xc63e('0xb8')](_0x1cdad3,{'transaction':_0x2f61a6});});})[_0xc63e('0x34')](function(){return db[_0xc63e('0xb7')]['findAndCountAll']({'where':{'SmsAccountId':_0x4e32dc[_0xc63e('0x57')]['id']},'order':_0xc63e('0x76')});});}})[_0xc63e('0x34')](respondWithResult(_0x548373,null))[_0xc63e('0x5b')](handleError(_0x548373,null));};exports[_0xc63e('0xb9')]=function(_0x2d7b52,_0x35c916,_0x261d04){var _0x5a0e77={};var _0x39a53e={};var _0x24b649;var _0x2a84b0;return db['SmsAccount'][_0xc63e('0x69')]({'where':{'id':_0x2d7b52['params']['id']}})[_0xc63e('0x34')](handleEntityNotFound(_0x35c916,null))[_0xc63e('0x34')](function(_0x1c5f81){if(_0x1c5f81){_0x24b649=_0x1c5f81;_0x39a53e[_0xc63e('0x42')]=_[_0xc63e('0x3f')](db[_0xc63e('0xb7')][_0xc63e('0x3e')]);_0x39a53e[_0xc63e('0x40')]=_[_0xc63e('0x3f')](_0x2d7b52[_0xc63e('0x40')]);_0x39a53e[_0xc63e('0x41')]=_[_0xc63e('0x58')](_0x39a53e['model'],_0x39a53e['query']);_0x5a0e77[_0xc63e('0x43')]=_['intersection'](_0x39a53e[_0xc63e('0x42')],qs['fields'](_0x2d7b52[_0xc63e('0x40')][_0xc63e('0x44')]));_0x5a0e77[_0xc63e('0x43')]=_0x5a0e77[_0xc63e('0x43')]['length']?_0x5a0e77[_0xc63e('0x43')]:_0x39a53e['model'];_0x5a0e77[_0xc63e('0x47')]=qs[_0xc63e('0x48')](_0x2d7b52['query'][_0xc63e('0x48')]);_0x5a0e77[_0xc63e('0x49')]=qs[_0xc63e('0x41')](_[_0xc63e('0x4a')](_0x2d7b52['query'],_0x39a53e[_0xc63e('0x41')]));if(_0x2d7b52[_0xc63e('0x40')]['filter']){_0x5a0e77[_0xc63e('0x49')]=_['merge'](_0x5a0e77[_0xc63e('0x49')],{'$or':_[_0xc63e('0x4c')](_0x5a0e77['attributes'],function(_0xef76df){var _0x3ccda2={};_0x3ccda2[_0xef76df]={'$like':'%'+_0x2d7b52[_0xc63e('0x40')][_0xc63e('0x51')]+'%'};return _0x3ccda2;})});}_0x5a0e77=_[_0xc63e('0x4b')]({},_0x5a0e77,_0x2d7b52[_0xc63e('0x52')]);return _0x24b649[_0xc63e('0xb9')](_0x5a0e77);}})[_0xc63e('0x34')](function(_0x3e0144){if(_0x3e0144){_0x2a84b0=_0x3e0144[_0xc63e('0x59')];if(!_0x2d7b52[_0xc63e('0x40')][_0xc63e('0x45')](_0xc63e('0x46'))){_0x5a0e77[_0xc63e('0x2e')]=qs[_0xc63e('0x2e')](_0x2d7b52['query'][_0xc63e('0x2e')]);_0x5a0e77['offset']=qs[_0xc63e('0x2d')](_0x2d7b52['query'][_0xc63e('0x2d')]);}return _0x24b649[_0xc63e('0xb9')](_0x5a0e77);}})[_0xc63e('0x34')](function(_0x2c5ded){if(_0x2c5ded){return _0x2c5ded?{'count':_0x2a84b0,'rows':_0x2c5ded}:null;}})[_0xc63e('0x34')](respondWithResult(_0x35c916,null))[_0xc63e('0x5b')](handleError(_0x35c916,null));};exports[_0xc63e('0xba')]=function(_0x117677,_0x56ae40,_0x309189){var _0x5363cb={'raw':![],'where':{}};var _0x1b8b9c={};var _0x33e816={'count':0x0,'rows':[]};return db['SmsAccount'][_0xc63e('0x69')]({'where':{'id':_0x117677[_0xc63e('0x57')]['id']}})[_0xc63e('0x34')](handleEntityNotFound(_0x56ae40,null))[_0xc63e('0x34')](function(_0x341964){if(_0x341964){_0x1b8b9c[_0xc63e('0x42')]=_[_0xc63e('0x3f')](db[_0xc63e('0x9e')][_0xc63e('0x3e')]);_0x1b8b9c[_0xc63e('0x40')]=_[_0xc63e('0x3f')](_0x117677[_0xc63e('0x40')]);_0x1b8b9c[_0xc63e('0x41')]=_[_0xc63e('0x58')](_0x1b8b9c['model'],_0x1b8b9c[_0xc63e('0x40')]);_0x5363cb[_0xc63e('0x43')]=_[_0xc63e('0x58')](_0x1b8b9c[_0xc63e('0x42')],qs[_0xc63e('0x44')](_0x117677[_0xc63e('0x40')]['fields']));_0x5363cb[_0xc63e('0x43')]=_0x5363cb[_0xc63e('0x43')][_0xc63e('0x59')]?_0x5363cb['attributes']:_0x1b8b9c[_0xc63e('0x42')];if(!_0x117677[_0xc63e('0x40')][_0xc63e('0x45')](_0xc63e('0x46'))){_0x5363cb[_0xc63e('0x2e')]=qs[_0xc63e('0x2e')](_0x117677[_0xc63e('0x40')][_0xc63e('0x2e')]);_0x5363cb[_0xc63e('0x2d')]=qs[_0xc63e('0x2d')](_0x117677[_0xc63e('0x40')][_0xc63e('0x2d')]);}_0x5363cb[_0xc63e('0x47')]=qs['sort'](_0x117677['query']['sort']);_0x5363cb[_0xc63e('0x49')]=qs[_0xc63e('0x41')](_[_0xc63e('0x4a')](_0x117677[_0xc63e('0x40')],_0x1b8b9c[_0xc63e('0x41')]));_0x5363cb['where'][_0xc63e('0x66')]=_0x341964['id'];if(_0x117677[_0xc63e('0x40')][_0xc63e('0x51')]){_0x5363cb[_0xc63e('0x49')]=_[_0xc63e('0x4b')](_0x5363cb[_0xc63e('0x49')],{'$or':_[_0xc63e('0x4c')](_0x5363cb[_0xc63e('0x43')],function(_0x22eec3){var _0xa800b7={};_0xa800b7[_0x22eec3]={'$like':'%'+_0x117677[_0xc63e('0x40')][_0xc63e('0x51')]+'%'};return _0xa800b7;})});}_0x5363cb=_[_0xc63e('0x4b')]({},_0x5363cb,_0x117677[_0xc63e('0x52')]);return db['SmsInteraction']['count']({'where':_0x5363cb[_0xc63e('0x49')]})[_0xc63e('0x34')](function(_0x46dbbd){_0x33e816[_0xc63e('0x2c')]=_0x46dbbd;if(_0x117677['query'][_0xc63e('0x53')]){_0x5363cb[_0xc63e('0x54')]=[{'model':db[_0xc63e('0x78')],'as':_0xc63e('0xbb'),'required':![]},{'model':db[_0xc63e('0xa9')],'as':_0xc63e('0xbc'),'attributes':[_0xc63e('0x3a'),'fullname',_0xc63e('0xbd')],'required':![]},{'model':db[_0xc63e('0xbe')],'as':_0xc63e('0xbf'),'attributes':['id','name','color'],'where':_0x117677[_0xc63e('0x40')][_0xc63e('0xc0')]?{'id':_0x117677[_0xc63e('0x40')]['tag']}:undefined,'required':_0x117677[_0xc63e('0x40')][_0xc63e('0xc0')]?!![]:![]}];}return db[_0xc63e('0x9e')][_0xc63e('0x6e')](_0x5363cb);})[_0xc63e('0x34')](function(_0x5620c6){_0x33e816['rows']=_0x5620c6;return _0x33e816;});}})[_0xc63e('0x34')](respondWithFilteredResult(_0x56ae40,_0x5363cb))[_0xc63e('0x5b')](handleError(_0x56ae40,null));};exports[_0xc63e('0x3b')]=function(_0x545c56,_0x53e891,_0x39ce74){var _0x16ba9a,_0x21830b,_0x4a6b53;if(_[_0xc63e('0x93')](_0x545c56['body'][_0xc63e('0x63')])||_0x545c56[_0xc63e('0x63')][_0xc63e('0x63')]===''){throw new db['Sequelize'][(_0xc63e('0x79'))](_0xc63e('0x96'));}if(_[_0xc63e('0x93')](_0x545c56[_0xc63e('0x63')]['to'])){throw new db[(_0xc63e('0x94'))][(_0xc63e('0x79'))]('to\x20is\x20mandatory');}_0x16ba9a=_0x545c56[_0xc63e('0x63')]['to'];return db[_0xc63e('0x3d')][_0xc63e('0x5a')]({'where':{'id':_0x545c56[_0xc63e('0x57')]['id']},'include':[{'model':db[_0xc63e('0xc1')],'as':'List','include':[{'model':db[_0xc63e('0x78')],'as':_0xc63e('0x9a'),'where':{'mobile':_0x16ba9a},'limit':0x1,'order':[['updatedAt',_0xc63e('0xc2')]]}]}]})['then'](handleEntityNotFound(_0x53e891,null))['then'](function(_0x5cc943){if(_0x5cc943&&_0x5cc943['List']){_0x21830b=_0x5cc943['get']({'plain':!![]});if(_0x21830b['List']&&_0x21830b[_0xc63e('0xc3')][_0xc63e('0x9a')]['length']){return _0x21830b[_0xc63e('0xc3')][_0xc63e('0x9a')][0x0];}return db[_0xc63e('0x78')][_0xc63e('0x5c')](_[_0xc63e('0x16')](_0x545c56[_0xc63e('0x63')],{'firstName':_0x16ba9a,'mobile':_0x16ba9a,'phone':_0x16ba9a,'ListId':_0x21830b[_0xc63e('0x7e')]}));}})[_0xc63e('0x34')](handleEntityNotFound(_0x53e891,null))[_0xc63e('0x34')](function(_0x2169d5){if(_0x2169d5){_0x4a6b53=_0x2169d5;return db[_0xc63e('0x9e')][_0xc63e('0x5a')]({'where':{'ContactId':_0x4a6b53['id'],'closed':![],'SmsAccountId':_0x21830b['id']}})['then'](function(_0x29f18b){if(_0x29f18b){return[_0x29f18b,![]];}return db['SmsInteraction']['create']({'UserId':_0x545c56[_0xc63e('0x5d')]['id'],'ContactId':_0x4a6b53['id'],'SmsAccountId':_0x21830b['id'],'phone':_0x16ba9a,'firstMsgDirection':'out','Messages':[_[_0xc63e('0x4b')](_0x545c56['body'],{'read':![],'body':_0x545c56[_0xc63e('0x63')][_0xc63e('0x63')],'phone':_0x16ba9a,'SmsAccountId':_0x21830b['id'],'UserId':_0x545c56['user']['id'],'ContactId':_0x4a6b53['id']})]},{'include':[{'model':db[_0xc63e('0xa5')],'as':_0xc63e('0xc4')}]})[_0xc63e('0x34')](function(_0x3fca5c){return[_0x3fca5c,!![]];});});}})['spread'](function(_0x21bc0b,_0x3303b0){if(_0x3303b0){return _0x21bc0b;}return db[_0xc63e('0xa5')]['create'](_['merge'](_0x545c56[_0xc63e('0x63')],{'read':![],'body':_0x545c56[_0xc63e('0x63')][_0xc63e('0x63')],'phone':_0x16ba9a,'SmsAccountId':_0x21830b['id'],'SmsInteractionId':_0x21bc0b['id'],'UserId':_0x545c56[_0xc63e('0x5d')]['id'],'ContactId':_0x4a6b53['id']}))[_0xc63e('0x34')](function(_0x5313fc){_0x21bc0b[_0xc63e('0xc5')][_0xc63e('0xc4')]=[];_0x21bc0b[_0xc63e('0xc5')][_0xc63e('0xc4')][_0xc63e('0xc6')](_0x5313fc['dataValues']);return _0x21bc0b;});})[_0xc63e('0x34')](respondWithResult(_0x53e891,null))[_0xc63e('0x5b')](handleError(_0x53e891,null));};exports[_0xc63e('0x2a')]=function(_0x1c5e2e,_0x4fb450,_0x5960a5){if(_0x1c5e2e[_0xc63e('0x63')]['id']){delete _0x1c5e2e['body']['id'];}console[_0xc63e('0xc7')](_0xc63e('0xc8'),_0x1c5e2e['body']);var _0x53a335,_0x856e8d,_0x58cefe;return db[_0xc63e('0x3d')][_0xc63e('0x5a')]({'where':{'id':_0x1c5e2e[_0xc63e('0x57')]['id']}})[_0xc63e('0x34')](handleEntityNotFound(_0x4fb450,null))[_0xc63e('0x34')](function(_0x59a562){if(_0x59a562){_0x58cefe=_0x59a562;logger[_0xc63e('0x23')](_0xc63e('0xaf'),_0xc63e('0x2a'),_0xc63e('0xc9'),_0x59a562[_0xc63e('0x4d')],util[_0xc63e('0xca')](_0x1c5e2e[_0xc63e('0x63')],{'showHidden':![],'depth':null}));switch(_0x59a562['type']){case _0xc63e('0x84'):if(_0x1c5e2e[_0xc63e('0x63')][_0xc63e('0xcb')]&&_0x1c5e2e[_0xc63e('0x63')][_0xc63e('0x2a')]){_0x856e8d=_0x1c5e2e['body'][_0xc63e('0x2a')];return db[_0xc63e('0xa5')][_0xc63e('0x5a')]({'where':{'messageId':_0x1c5e2e[_0xc63e('0x63')][_0xc63e('0xcb')]}});}break;case _0xc63e('0xcc'):if(_0x1c5e2e[_0xc63e('0x63')][_0xc63e('0xcd')]&&_0x1c5e2e[_0xc63e('0x63')]['statusInt']){_0x856e8d=_0x1c5e2e['body'][_0xc63e('0xce')];return db[_0xc63e('0xa5')]['find']({'where':{'messageId':_0x1c5e2e[_0xc63e('0x63')][_0xc63e('0xcd')]}});}break;case _0xc63e('0x86'):if(_0x1c5e2e['body'][_0xc63e('0x88')]&&_0x1c5e2e[_0xc63e('0x63')][_0xc63e('0xcf')]){_0x856e8d=_0x1c5e2e['body'][_0xc63e('0xcf')];return db[_0xc63e('0xa5')]['find']({'where':{'messageId':_0x1c5e2e[_0xc63e('0x63')][_0xc63e('0x88')]}});}break;case'infobip':var _0x56e43c=_0x1c5e2e['body']['results'][0x0];if(_0x56e43c[_0xc63e('0x87')]&&_0x56e43c[_0xc63e('0x2a')]['groupName']===_0xc63e('0xd0')){_0x856e8d=_0x56e43c[_0xc63e('0x2a')][_0xc63e('0xd1')];return db['SmsMessage']['find']({'where':{'messageId':_0x56e43c[_0xc63e('0x87')]}});}break;case _0xc63e('0x8e'):if(_0x1c5e2e[_0xc63e('0x63')][_0xc63e('0x87')]&&_0x1c5e2e[_0xc63e('0x63')][_0xc63e('0x2a')]){_0x856e8d=_0x1c5e2e['body']['status'];return db[_0xc63e('0xa5')][_0xc63e('0x5a')]({'where':{'messageId':_0x1c5e2e[_0xc63e('0x63')][_0xc63e('0x87')]}});}break;case _0xc63e('0x91'):if(_0x1c5e2e['body']['redif']&&_0x1c5e2e[_0xc63e('0x63')][_0xc63e('0x2a')]){_0x856e8d=_0x1c5e2e[_0xc63e('0x63')][_0xc63e('0x2a')];return db[_0xc63e('0xa5')][_0xc63e('0x5a')]({'where':{'messageId':_0x1c5e2e['body']['redif']}});}break;}}})['then'](handleEntityNotFound(_0x4fb450,null))[_0xc63e('0x34')](function(_0x69cd0f){if(_0x69cd0f){_0x53a335=_0x69cd0f;switch(_0x58cefe['type']){case _0xc63e('0x84'):if(_0x856e8d===_0xc63e('0xd0')){return _0x53a335[_0xc63e('0x33')]({'read':!![]});}else{logger[_0xc63e('0x25')](_0xc63e('0xaf'),_0xc63e('0x2a'),'skebby',util[_0xc63e('0xca')](_0x1c5e2e[_0xc63e('0x63')],{'showHidden':![],'depth':null}));}break;case _0xc63e('0xcc'):if(_0x856e8d==='1'){return _0x53a335[_0xc63e('0x33')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc63e('0x2a'),_0xc63e('0x84'),util['inspect'](_0x1c5e2e['body'],{'showHidden':![],'depth':null}));}break;case _0xc63e('0x86'):if(!_0x1c5e2e[_0xc63e('0x63')]['error_code']&&_0x856e8d>=0xc8&&_0x856e8d<=0xce){return _0x53a335[_0xc63e('0x33')]({'read':!![]});}else{logger[_0xc63e('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xc63e('0x86'),util[_0xc63e('0xca')](_0x1c5e2e[_0xc63e('0x63')],{'showHidden':![],'depth':null}));}break;case _0xc63e('0x8b'):var _0x13ac75=_0x1c5e2e['body'][_0xc63e('0x8c')][0x0];if(_0x13ac75[_0xc63e('0x2a')][_0xc63e('0xd1')]==='DELIVERED'){return _0x53a335[_0xc63e('0x33')]({'read':!![]});}else{logger[_0xc63e('0x25')](_0xc63e('0xaf'),'status',_0xc63e('0x8b'),util[_0xc63e('0xca')](_0x1c5e2e['body'],{'showHidden':![],'depth':null}));}break;case _0xc63e('0x8e'):if(_0x856e8d==_0xc63e('0xd2')||_0x856e8d==_0xc63e('0xd3')){return _0x53a335[_0xc63e('0x33')]({'read':!![]});}else{logger[_0xc63e('0x25')](_0xc63e('0xaf'),'status',_0xc63e('0x8e'),util[_0xc63e('0xca')](_0x1c5e2e['body'],{'showHidden':![],'depth':null}));}break;case _0xc63e('0x91'):if(_0x856e8d===_0xc63e('0xd4')||_0x856e8d===_0xc63e('0xd5')){return _0x53a335[_0xc63e('0x33')]({'read':!![]});}else{logger[_0xc63e('0x25')](_0xc63e('0xaf'),_0xc63e('0x2a'),_0xc63e('0x91'),util[_0xc63e('0xca')](_0x1c5e2e['body'],{'showHidden':![],'depth':null}));}break;}return _0x53a335;}})[_0xc63e('0x34')](respondWithResult(_0x4fb450,null))[_0xc63e('0x5b')](handleError(_0x4fb450,null));};exports[_0xc63e('0xd6')]=function(_0x3a8e14,_0x24d431,_0x103dea){var _0x6af0de,_0x2aa09c,_0x206d39;return db[_0xc63e('0x3d')][_0xc63e('0x5a')]({'where':{'id':_0x3a8e14['params']['id']}})['then'](handleEntityNotFound(_0x24d431,null))[_0xc63e('0x34')](function(_0x17722e){if(_0x17722e){_0x206d39=_0x17722e;logger['debug'](_0xc63e('0xaf'),_0xc63e('0x2a'),_0xc63e('0xc9'),_0x17722e['type'],util[_0xc63e('0xca')](_0x3a8e14[_0xc63e('0x40')],{'showHidden':![],'depth':null}));switch(_0x17722e['type']){case _0xc63e('0xd7'):if(_0x3a8e14[_0xc63e('0x40')]['message-id']&&_0x3a8e14[_0xc63e('0x40')][_0xc63e('0xd8')]){_0x2aa09c=_0x3a8e14[_0xc63e('0x40')][_0xc63e('0xd8')];return db['SmsMessage'][_0xc63e('0x5a')]({'where':{'messageId':_0x3a8e14['query'][_0xc63e('0xd9')]}});}break;}}})[_0xc63e('0x34')](handleEntityNotFound(_0x24d431,null))[_0xc63e('0x34')](function(_0x1484a1){if(_0x1484a1){_0x6af0de=_0x1484a1;switch(_0x206d39['type']){case _0xc63e('0xd7'):if(_0x2aa09c==='2'||_0x2aa09c==='6'){return _0x6af0de[_0xc63e('0x33')]({'read':!![]});}else{logger[_0xc63e('0x25')](_0xc63e('0xaf'),_0xc63e('0x2a'),'csc',util['inspect'](_0x3a8e14[_0xc63e('0x40')],{'showHidden':![],'depth':null}));};break;}return _0x6af0de;}})['then'](respondWithResult(_0x24d431,null))['catch'](handleError(_0x24d431,null));};exports[_0xc63e('0xda')]=function(_0x1cd3a4,_0x51cec1,_0x475568){return db[_0xc63e('0x3d')][_0xc63e('0x5a')]({'where':{'id':_0x1cd3a4[_0xc63e('0x57')]['id']}})['then'](handleEntityNotFound(_0x51cec1,null))['then'](function(_0x27bb97){if(_0x27bb97){return _0x27bb97['addAgents'](_0x1cd3a4[_0xc63e('0x63')]['ids'],_[_0xc63e('0x9c')](_0x1cd3a4[_0xc63e('0x63')],[_0xc63e('0x6b'),'id'])||{})['spread'](function(_0x1f275d){for(var _0x2867b0=0x0;_0x2867b0<_0x1cd3a4['body'][_0xc63e('0x6b')][_0xc63e('0x59')];_0x2867b0+=0x1){socket[_0xc63e('0xdb')]('userSmsAccount:save',{'UserId':_0x1cd3a4[_0xc63e('0x63')]['ids'][_0x2867b0],'SmsAccountId':_0x1cd3a4[_0xc63e('0x57')]['id']});}return _0x1f275d;});}})[_0xc63e('0x34')](respondWithResult(_0x51cec1,null))[_0xc63e('0x5b')](handleError(_0x51cec1,null));};exports[_0xc63e('0xdc')]=function(_0x424aab,_0x27dc3b,_0x5cc1fd){return db['SmsAccount']['find']({'where':{'id':_0x424aab[_0xc63e('0x57')]['id']}})[_0xc63e('0x34')](handleEntityNotFound(_0x27dc3b,null))[_0xc63e('0x34')](function(_0x591812){if(_0x591812){return _0x591812['removeAgents'](_0x424aab['query'][_0xc63e('0x6b')])[_0xc63e('0x34')](function(){if(_['isArray'](_0x424aab[_0xc63e('0x40')][_0xc63e('0x6b')])){for(var _0x3c73cf=0x0;_0x3c73cf<_0x424aab[_0xc63e('0x40')][_0xc63e('0x6b')][_0xc63e('0x59')];_0x3c73cf+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x424aab[_0xc63e('0x40')]['ids'][_0x3c73cf]),'SmsAccountId':Number(_0x424aab['params']['id'])});}}else{socket[_0xc63e('0xdb')](_0xc63e('0xdd'),{'UserId':Number(_0x424aab[_0xc63e('0x40')][_0xc63e('0x6b')]),'SmsAccountId':Number(_0x424aab[_0xc63e('0x57')]['id'])});}});}})[_0xc63e('0x34')](respondWithStatusCode(_0x27dc3b,null))['catch'](handleError(_0x27dc3b,null));};exports['getAgents']=function(_0xc1dad0,_0x424d62,_0x2343e8){var _0xb3154e={};var _0x1a937e={};var _0x2d44a1;var _0x1bb083;return db[_0xc63e('0x3d')][_0xc63e('0x69')]({'where':{'id':_0xc1dad0[_0xc63e('0x57')]['id']}})[_0xc63e('0x34')](handleEntityNotFound(_0x424d62,null))['then'](function(_0x3c6bfb){if(_0x3c6bfb){_0x2d44a1=_0x3c6bfb;_0x1a937e['model']=_[_0xc63e('0x3f')](db[_0xc63e('0xa9')][_0xc63e('0x3e')]);_0x1a937e[_0xc63e('0x40')]=_[_0xc63e('0x3f')](_0xc1dad0['query']);_0x1a937e[_0xc63e('0x41')]=_[_0xc63e('0x58')](_0x1a937e['model'],_0x1a937e[_0xc63e('0x40')]);_0xb3154e[_0xc63e('0x43')]=_[_0xc63e('0x58')](_0x1a937e[_0xc63e('0x42')],qs[_0xc63e('0x44')](_0xc1dad0['query'][_0xc63e('0x44')]));_0xb3154e[_0xc63e('0x43')]=_0xb3154e[_0xc63e('0x43')]['length']?_0xb3154e[_0xc63e('0x43')]:_0x1a937e[_0xc63e('0x42')];_0xb3154e[_0xc63e('0x47')]=qs['sort'](_0xc1dad0[_0xc63e('0x40')]['sort']);_0xb3154e[_0xc63e('0x49')]=qs[_0xc63e('0x41')](_[_0xc63e('0x4a')](_0xc1dad0[_0xc63e('0x40')],_0x1a937e[_0xc63e('0x41')]));if(_0xc1dad0[_0xc63e('0x40')][_0xc63e('0x51')]){_0xb3154e[_0xc63e('0x49')]=_[_0xc63e('0x4b')](_0xb3154e['where'],{'$or':_[_0xc63e('0x4c')](_0xb3154e[_0xc63e('0x43')],function(_0x1c7c48){var _0x8457c3={};_0x8457c3[_0x1c7c48]={'$like':'%'+_0xc1dad0[_0xc63e('0x40')][_0xc63e('0x51')]+'%'};return _0x8457c3;})});}_0xb3154e=_[_0xc63e('0x4b')]({},_0xb3154e,_0xc1dad0[_0xc63e('0x52')]);return _0x2d44a1[_0xc63e('0xde')](_0xb3154e);}})[_0xc63e('0x34')](function(_0x2a559e){if(_0x2a559e){_0x1bb083=_0x2a559e[_0xc63e('0x59')];if(!_0xc1dad0[_0xc63e('0x40')][_0xc63e('0x45')](_0xc63e('0x46'))){_0xb3154e[_0xc63e('0x2e')]=qs['limit'](_0xc1dad0[_0xc63e('0x40')]['limit']);_0xb3154e[_0xc63e('0x2d')]=qs['offset'](_0xc1dad0['query']['offset']);}return _0x2d44a1['getAgents'](_0xb3154e);}})[_0xc63e('0x34')](function(_0x78388b){if(_0x78388b){return _0x78388b?{'count':_0x1bb083,'rows':_0x78388b}:null;}})[_0xc63e('0x34')](respondWithResult(_0x424d62,null))['catch'](handleError(_0x424d62,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index ad3a273..4a58a11 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 _0x44e8=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x22eca8,_0x38d0d4){var _0x4ad900=function(_0x23d86a){while(--_0x23d86a){_0x22eca8['push'](_0x22eca8['shift']());}};_0x4ad900(++_0x38d0d4);}(_0x44e8,0xd7));var _0x844e=function(_0x33b5c1,_0x531c33){_0x33b5c1=_0x33b5c1-0x0;var _0x12359d=_0x44e8[_0x33b5c1];return _0x12359d;};'use strict';var EventEmitter=require(_0x844e('0x0'));var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x844e('0x1')](0x0);var events={'afterCreate':_0x844e('0x2'),'afterUpdate':_0x844e('0x3'),'afterDestroy':_0x844e('0x4')};function emitEvent(_0x49ce1b){return function(_0x3a8b3c,_0x167368,_0x2c8b9e){SmsAccountEvents[_0x844e('0x5')](_0x49ce1b+':'+_0x3a8b3c['id'],_0x3a8b3c);SmsAccountEvents['emit'](_0x49ce1b,_0x3a8b3c);_0x2c8b9e(null);};}for(var e in events){if(events[_0x844e('0x6')](e)){var event=events[e];SmsAccount[_0x844e('0x7')](e,emitEvent(event));}}module[_0x844e('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x46fc=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save'];(function(_0x1064ff,_0x5d8e93){var _0x18957a=function(_0x1e812f){while(--_0x1e812f){_0x1064ff['push'](_0x1064ff['shift']());}};_0x18957a(++_0x5d8e93);}(_0x46fc,0x103));var _0xc46f=function(_0x1f79f8,_0x4b68e7){_0x1f79f8=_0x1f79f8-0x0;var _0x21baa6=_0x46fc[_0x1f79f8];return _0x21baa6;};'use strict';var EventEmitter=require(_0xc46f('0x0'));var SmsAccount=require(_0xc46f('0x1'))['db'][_0xc46f('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xc46f('0x3')](0x0);var events={'afterCreate':_0xc46f('0x4'),'afterUpdate':_0xc46f('0x5'),'afterDestroy':_0xc46f('0x6')};function emitEvent(_0x24058a){return function(_0x3a56db,_0x5b0483,_0x4a0677){SmsAccountEvents[_0xc46f('0x7')](_0x24058a+':'+_0x3a56db['id'],_0x3a56db);SmsAccountEvents[_0xc46f('0x7')](_0x24058a,_0x3a56db);_0x4a0677(null);};}for(var e in events){if(events[_0xc46f('0x8')](e)){var event=events[e];SmsAccount[_0xc46f('0x9')](e,emitEvent(event));}}module[_0xc46f('0xa')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 94daab7..01600d6 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 _0x0f58=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api'];(function(_0x53717f,_0x7fea5a){var _0x360d70=function(_0x255234){while(--_0x255234){_0x53717f['push'](_0x53717f['shift']());}};_0x360d70(++_0x7fea5a);}(_0x0f58,0x1e6));var _0x80f5=function(_0x73ba5,_0x2c2ae7){_0x73ba5=_0x73ba5-0x0;var _0x5ab252=_0x0f58[_0x73ba5];return _0x5ab252;};'use strict';var _=require(_0x80f5('0x0'));var util=require(_0x80f5('0x1'));var logger=require(_0x80f5('0x2'))(_0x80f5('0x3'));var moment=require(_0x80f5('0x4'));var BPromise=require(_0x80f5('0x5'));var rp=require(_0x80f5('0x6'));var fs=require('fs');var path=require(_0x80f5('0x7'));var rimraf=require(_0x80f5('0x8'));var config=require(_0x80f5('0x9'));var attributes=require('./smsAccount.attributes');module[_0x80f5('0xa')]=function(_0x3ef812,_0x36d31a){return _0x3ef812[_0x80f5('0xb')](_0x80f5('0xc'),attributes,{'tableName':_0x80f5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe364=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger'];(function(_0x37c276,_0x4f6ca9){var _0x40851c=function(_0x331651){while(--_0x331651){_0x37c276['push'](_0x37c276['shift']());}};_0x40851c(++_0x4f6ca9);}(_0xe364,0x1d1));var _0x4e36=function(_0x4191bc,_0x3096c5){_0x4191bc=_0x4191bc-0x0;var _0x1ffd4e=_0xe364[_0x4191bc];return _0x1ffd4e;};'use strict';var _=require(_0x4e36('0x0'));var util=require(_0x4e36('0x1'));var logger=require(_0x4e36('0x2'))(_0x4e36('0x3'));var moment=require('moment');var BPromise=require(_0x4e36('0x4'));var rp=require(_0x4e36('0x5'));var fs=require('fs');var path=require(_0x4e36('0x6'));var rimraf=require(_0x4e36('0x7'));var config=require(_0x4e36('0x8'));var attributes=require('./smsAccount.attributes');module[_0x4e36('0x9')]=function(_0x52587b,_0x339f91){return _0x52587b[_0x4e36('0xa')](_0x4e36('0xb'),attributes,{'tableName':_0x4e36('0xc'),'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 0f08370..d1cb6e0 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 _0xf825=['SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','ShowSmsAccount','find','options','where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xf825,0x11c));var _0x5f82=function(_0xe5c0ed,_0x296ecf){_0xe5c0ed=_0xe5c0ed-0x0;var _0x4674bd=_0xf825[_0xe5c0ed];return _0x4674bd;};'use strict';var _=require(_0x5f82('0x0'));var util=require(_0x5f82('0x1'));var moment=require(_0x5f82('0x2'));var BPromise=require(_0x5f82('0x3'));var rs=require(_0x5f82('0x4'));var fs=require('fs');var Redis=require(_0x5f82('0x5'));var db=require(_0x5f82('0x6'))['db'];var utils=require(_0x5f82('0x7'));var logger=require(_0x5f82('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5f82('0x9'));var client=jayson['client'][_0x5f82('0xa')]({'port':0x232a});config[_0x5f82('0xb')]=_[_0x5f82('0xc')](config[_0x5f82('0xb')],{'host':_0x5f82('0xd'),'port':0x18eb});var socket=require(_0x5f82('0xe'))(new Redis(config['redis']));require(_0x5f82('0xf'))['register'](socket);function respondWithRpcPromise(_0x5e8230,_0x42bc33,_0x62065f){return new BPromise(function(_0x551503,_0x541f8d){return client[_0x5f82('0x10')](_0x5e8230,_0x62065f)[_0x5f82('0x11')](function(_0x522a47){logger[_0x5f82('0x12')](_0x5f82('0x13'),_0x42bc33,_0x5f82('0x14'));logger[_0x5f82('0x15')](_0x5f82('0x16'),_0x42bc33,_0x5f82('0x14'),JSON['stringify'](_0x522a47));if(_0x522a47[_0x5f82('0x17')]){if(_0x522a47[_0x5f82('0x17')][_0x5f82('0x18')]===0x1f4){logger[_0x5f82('0x17')](_0x5f82('0x13'),_0x42bc33,_0x522a47[_0x5f82('0x17')][_0x5f82('0x19')]);return _0x541f8d(_0x522a47['error'][_0x5f82('0x19')]);}logger['error'](_0x5f82('0x13'),_0x42bc33,_0x522a47[_0x5f82('0x17')][_0x5f82('0x19')]);return _0x551503(_0x522a47[_0x5f82('0x17')]['message']);}else{logger[_0x5f82('0x12')]('SmsAccount,\x20%s,\x20%s',_0x42bc33,_0x5f82('0x14'));_0x551503(_0x522a47['result']['message']);}})['catch'](function(_0x133cf9){logger[_0x5f82('0x17')](_0x5f82('0x13'),_0x42bc33,_0x133cf9);_0x541f8d(_0x133cf9);});});}exports[_0x5f82('0x1a')]=function(_0x23f007){var _0x5431dc=this;return new Promise(function(_0x5755bd,_0x145d60){return db['SmsAccount'][_0x5f82('0x1b')]({'raw':_0x23f007[_0x5f82('0x1c')]?_0x23f007[_0x5f82('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x23f007[_0x5f82('0x1c')]?_0x23f007[_0x5f82('0x1c')][_0x5f82('0x1d')]||null:null,'attributes':_0x23f007[_0x5f82('0x1c')]?_0x23f007[_0x5f82('0x1c')]['attributes']||null:null,'include':_0x23f007[_0x5f82('0x1c')]?_0x23f007[_0x5f82('0x1c')][_0x5f82('0x1e')]?_[_0x5f82('0x1f')](_0x23f007[_0x5f82('0x1c')][_0x5f82('0x1e')],function(_0x4c1268){return{'model':db[_0x4c1268[_0x5f82('0x20')]],'as':_0x4c1268['as'],'attributes':_0x4c1268[_0x5f82('0x21')],'include':_0x4c1268[_0x5f82('0x1e')]?_[_0x5f82('0x1f')](_0x4c1268[_0x5f82('0x1e')],function(_0x4dae8d){return{'model':db[_0x4dae8d[_0x5f82('0x20')]],'as':_0x4dae8d['as'],'attributes':_0x4dae8d['attributes'],'include':_0x4dae8d[_0x5f82('0x1e')]?_[_0x5f82('0x1f')](_0x4dae8d[_0x5f82('0x1e')],function(_0x30b21d){return{'model':db[_0x30b21d[_0x5f82('0x20')]],'as':_0x30b21d['as'],'attributes':_0x30b21d['attributes']};}):[]};}):[]};}):[]:[]})[_0x5f82('0x11')](function(_0x7659b5){logger[_0x5f82('0x12')](_0x5f82('0x1a'),_0x23f007);logger[_0x5f82('0x15')]('ShowSmsAccount',_0x23f007,JSON['stringify'](_0x7659b5));_0x5755bd(_0x7659b5);})['catch'](function(_0x1b069d){logger[_0x5f82('0x17')](_0x5f82('0x1a'),_0x1b069d[_0x5f82('0x19')],_0x23f007);_0x145d60(_0x5431dc['error'](0x1f4,_0x1b069d[_0x5f82('0x19')]));});});}; \ No newline at end of file +var _0x3650=['./smsAccount.socket','register','request','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','map','include','model','then','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x5429c1,_0x4338a8){var _0x5417e5=function(_0x562335){while(--_0x562335){_0x5429c1['push'](_0x5429c1['shift']());}};_0x5417e5(++_0x4338a8);}(_0x3650,0x148));var _0x0365=function(_0x34ed77,_0x118c4f){_0x34ed77=_0x34ed77-0x0;var _0x251c75=_0x3650[_0x34ed77];return _0x251c75;};'use strict';var _=require(_0x0365('0x0'));var util=require(_0x0365('0x1'));var moment=require(_0x0365('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0365('0x3'));var db=require(_0x0365('0x4'))['db'];var utils=require(_0x0365('0x5'));var logger=require(_0x0365('0x6'))(_0x0365('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0365('0x8')][_0x0365('0x9')]({'port':0x232a});config[_0x0365('0xa')]=_[_0x0365('0xb')](config[_0x0365('0xa')],{'host':_0x0365('0xc'),'port':0x18eb});var socket=require(_0x0365('0xd'))(new Redis(config[_0x0365('0xa')]));require(_0x0365('0xe'))[_0x0365('0xf')](socket);function respondWithRpcPromise(_0x55ce34,_0x37740a,_0x1298da){return new BPromise(function(_0x14ca14,_0x54d11e){return client[_0x0365('0x10')](_0x55ce34,_0x1298da)['then'](function(_0x4a80b4){logger['info'](_0x0365('0x11'),_0x37740a,_0x0365('0x12'));logger[_0x0365('0x13')](_0x0365('0x14'),_0x37740a,_0x0365('0x12'),JSON['stringify'](_0x4a80b4));if(_0x4a80b4[_0x0365('0x15')]){if(_0x4a80b4[_0x0365('0x15')][_0x0365('0x16')]===0x1f4){logger[_0x0365('0x15')]('SmsAccount,\x20%s,\x20%s',_0x37740a,_0x4a80b4['error']['message']);return _0x54d11e(_0x4a80b4['error'][_0x0365('0x17')]);}logger[_0x0365('0x15')](_0x0365('0x11'),_0x37740a,_0x4a80b4[_0x0365('0x15')][_0x0365('0x17')]);return _0x14ca14(_0x4a80b4[_0x0365('0x15')][_0x0365('0x17')]);}else{logger[_0x0365('0x18')](_0x0365('0x11'),_0x37740a,_0x0365('0x12'));_0x14ca14(_0x4a80b4[_0x0365('0x19')][_0x0365('0x17')]);}})[_0x0365('0x1a')](function(_0x30dc4e){logger[_0x0365('0x15')](_0x0365('0x11'),_0x37740a,_0x30dc4e);_0x54d11e(_0x30dc4e);});});}exports[_0x0365('0x1b')]=function(_0xf34b78){var _0x2c272e=this;return new Promise(function(_0x2e799e,_0x524b09){return db[_0x0365('0x1c')][_0x0365('0x1d')]({'raw':_0xf34b78[_0x0365('0x1e')]?_0xf34b78[_0x0365('0x1e')][_0x0365('0x1f')]===undefined?!![]:![]:!![],'where':_0xf34b78[_0x0365('0x1e')]?_0xf34b78[_0x0365('0x1e')][_0x0365('0x20')]||null:null,'attributes':_0xf34b78[_0x0365('0x1e')]?_0xf34b78[_0x0365('0x1e')][_0x0365('0x21')]||null:null,'include':_0xf34b78['options']?_0xf34b78[_0x0365('0x1e')]['include']?_[_0x0365('0x22')](_0xf34b78[_0x0365('0x1e')][_0x0365('0x23')],function(_0x10c92a){return{'model':db[_0x10c92a[_0x0365('0x24')]],'as':_0x10c92a['as'],'attributes':_0x10c92a[_0x0365('0x21')],'include':_0x10c92a['include']?_['map'](_0x10c92a['include'],function(_0x21a5ce){return{'model':db[_0x21a5ce[_0x0365('0x24')]],'as':_0x21a5ce['as'],'attributes':_0x21a5ce[_0x0365('0x21')],'include':_0x21a5ce[_0x0365('0x23')]?_[_0x0365('0x22')](_0x21a5ce[_0x0365('0x23')],function(_0x3b639c){return{'model':db[_0x3b639c[_0x0365('0x24')]],'as':_0x3b639c['as'],'attributes':_0x3b639c[_0x0365('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0365('0x25')](function(_0x35ff1a){logger['info'](_0x0365('0x1b'),_0xf34b78);logger[_0x0365('0x13')](_0x0365('0x1b'),_0xf34b78,JSON['stringify'](_0x35ff1a));_0x2e799e(_0x35ff1a);})[_0x0365('0x1a')](function(_0x1515f3){logger[_0x0365('0x15')](_0x0365('0x1b'),_0x1515f3[_0x0365('0x17')],_0xf34b78);_0x524b09(_0x2c272e[_0x0365('0x15')](0x1f4,_0x1515f3['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index aa5f20a..8c93be6 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 _0xd464=['remove','update','emit','removeListener','smsAccount:','./smsAccount.events','save'];(function(_0x3151af,_0x373f86){var _0x48dfc7=function(_0x9ef9bf){while(--_0x9ef9bf){_0x3151af['push'](_0x3151af['shift']());}};_0x48dfc7(++_0x373f86);}(_0xd464,0x132));var _0x4d46=function(_0x263f44,_0x5a5b95){_0x263f44=_0x263f44-0x0;var _0x2ba85e=_0xd464[_0x263f44];return _0x2ba85e;};'use strict';var SmsAccountEvents=require(_0x4d46('0x0'));var events=[_0x4d46('0x1'),_0x4d46('0x2'),_0x4d46('0x3')];function createListener(_0x9e5937,_0xb3bd90){return function(_0x19f65b){_0xb3bd90[_0x4d46('0x4')](_0x9e5937,_0x19f65b);};}function removeListener(_0x31bbf4,_0x5936d3){return function(){SmsAccountEvents[_0x4d46('0x5')](_0x31bbf4,_0x5936d3);};}exports['register']=function(_0x49abdf){for(var _0x39275f=0x0,_0x2eaa91=events['length'];_0x39275f<_0x2eaa91;_0x39275f++){var _0x2a2216=events[_0x39275f];var _0x447dbb=createListener(_0x4d46('0x6')+_0x2a2216,_0x49abdf);SmsAccountEvents['on'](_0x2a2216,_0x447dbb);}}; \ No newline at end of file +var _0x00d2=['length','smsAccount:','./smsAccount.events','save','remove','update','emit','removeListener'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x00d2,0x12a));var _0x200d=function(_0x3a99f4,_0x2a81c1){_0x3a99f4=_0x3a99f4-0x0;var _0xea0b42=_0x00d2[_0x3a99f4];return _0xea0b42;};'use strict';var SmsAccountEvents=require(_0x200d('0x0'));var events=[_0x200d('0x1'),_0x200d('0x2'),_0x200d('0x3')];function createListener(_0x43d502,_0x12b2c9){return function(_0x28ed9e){_0x12b2c9[_0x200d('0x4')](_0x43d502,_0x28ed9e);};}function removeListener(_0x2dc911,_0x4587e5){return function(){SmsAccountEvents[_0x200d('0x5')](_0x2dc911,_0x4587e5);};}exports['register']=function(_0x5c6095){for(var _0x5b7dd9=0x0,_0x5df91e=events[_0x200d('0x6')];_0x5b7dd9<_0x5df91e;_0x5b7dd9++){var _0x21afbf=events[_0x5b7dd9];var _0x339aa6=createListener(_0x200d('0x7')+_0x21afbf,_0x5c6095);SmsAccountEvents['on'](_0x21afbf,_0x339aa6);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index c14620e..dc4c8f2 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 _0xff93=['destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','/:id','show','create','put','update','delete'];(function(_0x3afd18,_0x5b4029){var _0x2109fe=function(_0xbcafbf){while(--_0xbcafbf){_0x3afd18['push'](_0x3afd18['shift']());}};_0x2109fe(++_0x5b4029);}(_0xff93,0x162));var _0x3ff9=function(_0x98417d,_0x2d249c){_0x98417d=_0x98417d-0x0;var _0x51ee3c=_0xff93[_0x98417d];return _0x51ee3c;};'use strict';var multer=require(_0x3ff9('0x0'));var util=require(_0x3ff9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3ff9('0x2')]();var auth=require(_0x3ff9('0x3'));var interaction=require(_0x3ff9('0x4'));var config=require('../../config/environment');var controller=require(_0x3ff9('0x5'));router[_0x3ff9('0x6')]('/',auth[_0x3ff9('0x7')](),controller['index']);router[_0x3ff9('0x6')](_0x3ff9('0x8'),auth['isAuthenticated'](),controller[_0x3ff9('0x9')]);router['post']('/',auth[_0x3ff9('0x7')](),controller[_0x3ff9('0xa')]);router[_0x3ff9('0xb')](_0x3ff9('0x8'),auth['isAuthenticated'](),controller[_0x3ff9('0xc')]);router[_0x3ff9('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x3ff9('0xe')]);module[_0x3ff9('0xf')]=router; \ No newline at end of file +var _0xdf9b=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','update','delete','/:id','destroy','exports'];(function(_0xe22ceb,_0x27dc83){var _0x45bb58=function(_0x4e1177){while(--_0x4e1177){_0xe22ceb['push'](_0xe22ceb['shift']());}};_0x45bb58(++_0x27dc83);}(_0xdf9b,0x98));var _0xbdf9=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xdf9b[_0x2adbeb];return _0x5e18a6;};'use strict';var multer=require(_0xbdf9('0x0'));var util=require(_0xbdf9('0x1'));var path=require(_0xbdf9('0x2'));var timeout=require(_0xbdf9('0x3'));var express=require('express');var router=express[_0xbdf9('0x4')]();var auth=require(_0xbdf9('0x5'));var interaction=require(_0xbdf9('0x6'));var config=require(_0xbdf9('0x7'));var controller=require('./smsApplication.controller');router[_0xbdf9('0x8')]('/',auth[_0xbdf9('0x9')](),controller[_0xbdf9('0xa')]);router[_0xbdf9('0x8')]('/:id',auth[_0xbdf9('0x9')](),controller['show']);router[_0xbdf9('0xb')]('/',auth['isAuthenticated'](),controller[_0xbdf9('0xc')]);router[_0xbdf9('0xd')]('/:id',auth[_0xbdf9('0x9')](),controller[_0xbdf9('0xe')]);router[_0xbdf9('0xf')](_0xbdf9('0x10'),auth['isAuthenticated'](),controller[_0xbdf9('0x11')]);module[_0xbdf9('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index d68b88c..f766e8e 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 _0x5cc3=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x20006a,_0x15b257){var _0x9098f=function(_0x256887){while(--_0x256887){_0x20006a['push'](_0x20006a['shift']());}};_0x9098f(++_0x15b257);}(_0x5cc3,0x144));var _0x35cc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5cc3[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x35cc('0x0'));module[_0x35cc('0x1')]={'priority':{'type':Sequelize[_0x35cc('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x35cc('0x3')],'allowNull':![],'defaultValue':_0x35cc('0x4')},'appdata':{'type':Sequelize[_0x35cc('0x5')]()},'description':{'type':Sequelize[_0x35cc('0x3')]},'interval':{'type':Sequelize[_0x35cc('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xad1b=['sequelize','exports','INTEGER','STRING','TEXT'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0xad1b,0x131));var _0xbad1=function(_0x19014f,_0x3dec2d){_0x19014f=_0x19014f-0x0;var _0x50aa2e=_0xad1b[_0x19014f];return _0x50aa2e;};'use strict';var Sequelize=require(_0xbad1('0x0'));module[_0xbad1('0x1')]={'priority':{'type':Sequelize[_0xbad1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbad1('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xbad1('0x4')]()},'description':{'type':Sequelize[_0xbad1('0x3')]},'interval':{'type':Sequelize[_0xbad1('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 78cdc5a..72072e4 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 _0xd782=['count','offset','apply','reject','save','update','then','error','stack','name','send','index','SmsApplication','rawAttributes','model','keys','query','intersection','fields','attributes','length','nolimit','limit','order','sort','where','filters','merge','map','type','key','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','find','create','body','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json'];(function(_0x538a2c,_0x8af4f){var _0x1dd921=function(_0x1456f3){while(--_0x1456f3){_0x538a2c['push'](_0x538a2c['shift']());}};_0x1dd921(++_0x8af4f);}(_0xd782,0xb4));var _0x2d78=function(_0xc69fba,_0x1efb6d){_0xc69fba=_0xc69fba-0x0;var _0x2ce574=_0xd782[_0xc69fba];return _0x2ce574;};'use strict';var pdf=require(_0x2d78('0x0'));var emlformat=require(_0x2d78('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2d78('0x2'));var jsonpatch=require(_0x2d78('0x3'));var rp=require('request-promise');var moment=require(_0x2d78('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2d78('0x5'));var util=require(_0x2d78('0x6'));var path=require(_0x2d78('0x7'));var sox=require(_0x2d78('0x8'));var csv=require(_0x2d78('0x9'));var ejs=require(_0x2d78('0xa'));var fs=require('fs');var _=require(_0x2d78('0xb'));var squel=require('squel');var crypto=require(_0x2d78('0xc'));var jsforce=require(_0x2d78('0xd'));var deskjs=require(_0x2d78('0xe'));var toCsv=require(_0x2d78('0x9'));var querystring=require(_0x2d78('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x2d78('0x10'));var logger=require('../../config/logger')(_0x2d78('0x11'));var utils=require(_0x2d78('0x12'));var config=require(_0x2d78('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x93b091,_0x5eb273){_0x5eb273=_0x5eb273||0xcc;return function(_0x3ab4d2){if(_0x3ab4d2){return _0x93b091[_0x2d78('0x14')](_0x5eb273);}return _0x93b091[_0x2d78('0x15')](_0x5eb273)[_0x2d78('0x16')]();};}function respondWithResult(_0x578798,_0x14cae8){_0x14cae8=_0x14cae8||0xc8;return function(_0x3b7284){if(_0x3b7284){return _0x578798[_0x2d78('0x15')](_0x14cae8)[_0x2d78('0x17')](_0x3b7284);}};}function respondWithFilteredResult(_0x577896,_0x48575d){return function(_0x1f59e0){if(_0x1f59e0){var _0x470998=_0x1f59e0[_0x2d78('0x18')],_0x649ba5=_0x48575d[_0x2d78('0x19')],_0x415515=_0x48575d['offset']+_0x48575d['limit'],_0x105d86;if(_0x415515>=_0x470998){_0x415515=_0x470998;_0x105d86=0xc8;}else{_0x105d86=0xce;}_0x577896[_0x2d78('0x15')](_0x105d86);return _0x577896['set']('Content-Range',_0x649ba5+'-'+_0x415515+'/'+_0x470998)[_0x2d78('0x17')](_0x1f59e0);}return null;};}function patchUpdates(_0x37cca3){return function(_0x50abba){try{jsonpatch[_0x2d78('0x1a')](_0x50abba,_0x37cca3,!![]);}catch(_0x14cd81){return BPromise[_0x2d78('0x1b')](_0x14cd81);}return _0x50abba[_0x2d78('0x1c')]();};}function saveUpdates(_0x437758,_0x35b21c){return function(_0x4a1d04){if(_0x4a1d04){return _0x4a1d04[_0x2d78('0x1d')](_0x437758)['then'](function(_0x4b0470){return _0x4b0470;});}return null;};}function removeEntity(_0x2b922c,_0x12d219){return function(_0x264f39){if(_0x264f39){return _0x264f39['destroy']()[_0x2d78('0x1e')](function(){_0x2b922c['status'](0xcc)[_0x2d78('0x16')]();});}};}function handleEntityNotFound(_0x5d8272,_0x2d97c7){return function(_0x167fe4){if(!_0x167fe4){_0x5d8272[_0x2d78('0x14')](0x194);}return _0x167fe4;};}function handleError(_0x52e801,_0x3b7caa){_0x3b7caa=_0x3b7caa||0x1f4;return function(_0x271b7e){logger[_0x2d78('0x1f')](_0x271b7e[_0x2d78('0x20')]);if(_0x271b7e[_0x2d78('0x21')]){delete _0x271b7e[_0x2d78('0x21')];}_0x52e801[_0x2d78('0x15')](_0x3b7caa)[_0x2d78('0x22')](_0x271b7e);};}exports[_0x2d78('0x23')]=function(_0x512cb7,_0x67e578){var _0x4fba54={},_0x28d75e={},_0x1486f={'count':0x0,'rows':[]};var _0x5d5067=db[_0x2d78('0x24')][_0x2d78('0x25')];_0x28d75e[_0x2d78('0x26')]=_[_0x2d78('0x27')](_0x5d5067);_0x28d75e[_0x2d78('0x28')]=_[_0x2d78('0x27')](_0x512cb7[_0x2d78('0x28')]);_0x28d75e['filters']=_['intersection'](_0x28d75e[_0x2d78('0x26')],_0x28d75e[_0x2d78('0x28')]);_0x4fba54['attributes']=_[_0x2d78('0x29')](_0x28d75e[_0x2d78('0x26')],qs[_0x2d78('0x2a')](_0x512cb7['query']['fields']));_0x4fba54[_0x2d78('0x2b')]=_0x4fba54['attributes'][_0x2d78('0x2c')]?_0x4fba54[_0x2d78('0x2b')]:_0x28d75e[_0x2d78('0x26')];if(!_0x512cb7[_0x2d78('0x28')]['hasOwnProperty'](_0x2d78('0x2d'))){_0x4fba54['limit']=qs[_0x2d78('0x2e')](_0x512cb7[_0x2d78('0x28')][_0x2d78('0x2e')]);_0x4fba54[_0x2d78('0x19')]=qs[_0x2d78('0x19')](_0x512cb7[_0x2d78('0x28')][_0x2d78('0x19')]);}_0x4fba54[_0x2d78('0x2f')]=qs[_0x2d78('0x30')](_0x512cb7[_0x2d78('0x28')][_0x2d78('0x30')]);_0x4fba54[_0x2d78('0x31')]=qs[_0x2d78('0x32')](_['pick'](_0x512cb7[_0x2d78('0x28')],_0x28d75e[_0x2d78('0x32')]));if(_0x512cb7[_0x2d78('0x28')]['filter']){_0x4fba54['where']=_[_0x2d78('0x33')](_0x4fba54[_0x2d78('0x31')],{'$or':_[_0x2d78('0x34')](_0x5d5067,function(_0x3dbe93){if(_0x3dbe93[_0x2d78('0x35')][_0x2d78('0x36')]!==_0x2d78('0x37')){var _0x51a761={};_0x51a761[_0x3dbe93['field']]={'$like':'%'+_0x512cb7[_0x2d78('0x28')][_0x2d78('0x38')]+'%'};return _0x51a761;}})});}_0x4fba54=_['merge']({},_0x4fba54,_0x512cb7[_0x2d78('0x39')]);var _0x82d8e8={'where':_0x4fba54[_0x2d78('0x31')]};return db['SmsApplication']['count'](_0x82d8e8)['then'](function(_0x5040f0){_0x1486f['count']=_0x5040f0;if(_0x512cb7['query'][_0x2d78('0x3a')]){_0x4fba54['include']=[{'all':!![]}];}return db[_0x2d78('0x24')][_0x2d78('0x3b')](_0x4fba54);})[_0x2d78('0x1e')](function(_0x522c63){_0x1486f[_0x2d78('0x3c')]=_0x522c63;return _0x1486f;})[_0x2d78('0x1e')](respondWithFilteredResult(_0x67e578,_0x4fba54))[_0x2d78('0x3d')](handleError(_0x67e578,null));};exports[_0x2d78('0x3e')]=function(_0xb86af4,_0x3daf71){var _0x40146f={'raw':!![],'where':{'id':_0xb86af4[_0x2d78('0x3f')]['id']}},_0x27920b={};_0x27920b['model']=_[_0x2d78('0x27')](db['SmsApplication'][_0x2d78('0x25')]);_0x27920b[_0x2d78('0x28')]=_[_0x2d78('0x27')](_0xb86af4['query']);_0x27920b[_0x2d78('0x32')]=_[_0x2d78('0x29')](_0x27920b[_0x2d78('0x26')],_0x27920b[_0x2d78('0x28')]);_0x40146f[_0x2d78('0x2b')]=_[_0x2d78('0x29')](_0x27920b[_0x2d78('0x26')],qs['fields'](_0xb86af4[_0x2d78('0x28')][_0x2d78('0x2a')]));_0x40146f[_0x2d78('0x2b')]=_0x40146f['attributes'][_0x2d78('0x2c')]?_0x40146f[_0x2d78('0x2b')]:_0x27920b['model'];if(_0xb86af4[_0x2d78('0x28')]['includeAll']){_0x40146f['include']=[{'all':!![]}];}_0x40146f=_[_0x2d78('0x33')]({},_0x40146f,_0xb86af4[_0x2d78('0x39')]);return db['SmsApplication'][_0x2d78('0x40')](_0x40146f)['then'](handleEntityNotFound(_0x3daf71,null))['then'](respondWithResult(_0x3daf71,null))['catch'](handleError(_0x3daf71,null));};exports[_0x2d78('0x41')]=function(_0x277edf,_0x11841c){return db[_0x2d78('0x24')][_0x2d78('0x41')](_0x277edf[_0x2d78('0x42')],{})[_0x2d78('0x1e')](respondWithResult(_0x11841c,0xc9))[_0x2d78('0x3d')](handleError(_0x11841c,null));};exports[_0x2d78('0x1d')]=function(_0x2b83d0,_0x541f00){if(_0x2b83d0[_0x2d78('0x42')]['id']){delete _0x2b83d0[_0x2d78('0x42')]['id'];}return db[_0x2d78('0x24')][_0x2d78('0x40')]({'where':{'id':_0x2b83d0[_0x2d78('0x3f')]['id']}})[_0x2d78('0x1e')](handleEntityNotFound(_0x541f00,null))[_0x2d78('0x1e')](saveUpdates(_0x2b83d0[_0x2d78('0x42')],null))['then'](respondWithResult(_0x541f00,null))['catch'](handleError(_0x541f00,null));};exports[_0x2d78('0x43')]=function(_0x1aee04,_0x276184){return db[_0x2d78('0x24')]['find']({'where':{'id':_0x1aee04['params']['id']}})[_0x2d78('0x1e')](handleEntityNotFound(_0x276184,null))['then'](removeEntity(_0x276184,null))[_0x2d78('0x3d')](handleError(_0x276184,null));}; \ No newline at end of file +var _0xdf31=['create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','SmsApplication','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','map','type','key','VIRTUAL','field','merge','includeAll','rows','catch','show','params','rawAttributes','options','find'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0xdf31,0x160));var _0x1df3=function(_0x5ad7a8,_0x5a9e20){_0x5ad7a8=_0x5ad7a8-0x0;var _0x2bec3d=_0xdf31[_0x5ad7a8];return _0x2bec3d;};'use strict';var pdf=require(_0x1df3('0x0'));var emlformat=require(_0x1df3('0x1'));var rimraf=require(_0x1df3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1df3('0x3'));var rp=require(_0x1df3('0x4'));var moment=require(_0x1df3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1df3('0x6'));var util=require('util');var path=require('path');var sox=require(_0x1df3('0x7'));var csv=require(_0x1df3('0x8'));var ejs=require(_0x1df3('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1df3('0xa'));var jsforce=require(_0x1df3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1df3('0x8'));var querystring=require(_0x1df3('0xc'));var Papa=require(_0x1df3('0xd'));var Redis=require(_0x1df3('0xe'));var authService=require(_0x1df3('0xf'));var qs=require(_0x1df3('0x10'));var hardwareService=require(_0x1df3('0x11'));var logger=require(_0x1df3('0x12'))(_0x1df3('0x13'));var utils=require(_0x1df3('0x14'));var config=require('../../config/environment');var db=require(_0x1df3('0x15'))['db'];function respondWithStatusCode(_0x35dd89,_0xf6473b){_0xf6473b=_0xf6473b||0xcc;return function(_0x3563a3){if(_0x3563a3){return _0x35dd89[_0x1df3('0x16')](_0xf6473b);}return _0x35dd89[_0x1df3('0x17')](_0xf6473b)[_0x1df3('0x18')]();};}function respondWithResult(_0x2d9b8a,_0x52fd48){_0x52fd48=_0x52fd48||0xc8;return function(_0x2bd239){if(_0x2bd239){return _0x2d9b8a[_0x1df3('0x17')](_0x52fd48)['json'](_0x2bd239);}};}function respondWithFilteredResult(_0x537f11,_0x1b34c0){return function(_0x32f9c0){if(_0x32f9c0){var _0x36e369=_0x32f9c0[_0x1df3('0x19')],_0x995fd0=_0x1b34c0[_0x1df3('0x1a')],_0x58dc6f=_0x1b34c0[_0x1df3('0x1a')]+_0x1b34c0[_0x1df3('0x1b')],_0x40ea37;if(_0x58dc6f>=_0x36e369){_0x58dc6f=_0x36e369;_0x40ea37=0xc8;}else{_0x40ea37=0xce;}_0x537f11[_0x1df3('0x17')](_0x40ea37);return _0x537f11[_0x1df3('0x1c')](_0x1df3('0x1d'),_0x995fd0+'-'+_0x58dc6f+'/'+_0x36e369)['json'](_0x32f9c0);}return null;};}function patchUpdates(_0x27f83b){return function(_0x10540c){try{jsonpatch[_0x1df3('0x1e')](_0x10540c,_0x27f83b,!![]);}catch(_0x5eced2){return BPromise[_0x1df3('0x1f')](_0x5eced2);}return _0x10540c['save']();};}function saveUpdates(_0x2db215,_0x20858b){return function(_0x1f6aed){if(_0x1f6aed){return _0x1f6aed[_0x1df3('0x20')](_0x2db215)[_0x1df3('0x21')](function(_0x54306c){return _0x54306c;});}return null;};}function removeEntity(_0x3e6dc4,_0x44c818){return function(_0x1674b7){if(_0x1674b7){return _0x1674b7[_0x1df3('0x22')]()['then'](function(){_0x3e6dc4[_0x1df3('0x17')](0xcc)[_0x1df3('0x18')]();});}};}function handleEntityNotFound(_0x52d87e,_0x2b2825){return function(_0x306c4b){if(!_0x306c4b){_0x52d87e[_0x1df3('0x16')](0x194);}return _0x306c4b;};}function handleError(_0x49ac50,_0x4f6cce){_0x4f6cce=_0x4f6cce||0x1f4;return function(_0xca5914){logger[_0x1df3('0x23')](_0xca5914[_0x1df3('0x24')]);if(_0xca5914[_0x1df3('0x25')]){delete _0xca5914[_0x1df3('0x25')];}_0x49ac50[_0x1df3('0x17')](_0x4f6cce)[_0x1df3('0x26')](_0xca5914);};}exports['index']=function(_0x64de50,_0x235618){var _0xc39132={},_0x24d3d3={},_0x4aeb05={'count':0x0,'rows':[]};var _0x4cafc=db[_0x1df3('0x27')]['rawAttributes'];_0x24d3d3[_0x1df3('0x28')]=_['keys'](_0x4cafc);_0x24d3d3[_0x1df3('0x29')]=_[_0x1df3('0x2a')](_0x64de50[_0x1df3('0x29')]);_0x24d3d3['filters']=_[_0x1df3('0x2b')](_0x24d3d3[_0x1df3('0x28')],_0x24d3d3['query']);_0xc39132[_0x1df3('0x2c')]=_[_0x1df3('0x2b')](_0x24d3d3[_0x1df3('0x28')],qs['fields'](_0x64de50[_0x1df3('0x29')][_0x1df3('0x2d')]));_0xc39132[_0x1df3('0x2c')]=_0xc39132[_0x1df3('0x2c')][_0x1df3('0x2e')]?_0xc39132[_0x1df3('0x2c')]:_0x24d3d3[_0x1df3('0x28')];if(!_0x64de50['query'][_0x1df3('0x2f')](_0x1df3('0x30'))){_0xc39132['limit']=qs[_0x1df3('0x1b')](_0x64de50['query'][_0x1df3('0x1b')]);_0xc39132[_0x1df3('0x1a')]=qs[_0x1df3('0x1a')](_0x64de50[_0x1df3('0x29')][_0x1df3('0x1a')]);}_0xc39132[_0x1df3('0x31')]=qs['sort'](_0x64de50[_0x1df3('0x29')][_0x1df3('0x32')]);_0xc39132[_0x1df3('0x33')]=qs[_0x1df3('0x34')](_['pick'](_0x64de50[_0x1df3('0x29')],_0x24d3d3[_0x1df3('0x34')]));if(_0x64de50['query'][_0x1df3('0x35')]){_0xc39132[_0x1df3('0x33')]=_['merge'](_0xc39132[_0x1df3('0x33')],{'$or':_[_0x1df3('0x36')](_0x4cafc,function(_0x2f3474){if(_0x2f3474[_0x1df3('0x37')][_0x1df3('0x38')]!==_0x1df3('0x39')){var _0x4698a4={};_0x4698a4[_0x2f3474[_0x1df3('0x3a')]]={'$like':'%'+_0x64de50['query']['filter']+'%'};return _0x4698a4;}})});}_0xc39132=_[_0x1df3('0x3b')]({},_0xc39132,_0x64de50['options']);var _0x1e8dc6={'where':_0xc39132[_0x1df3('0x33')]};return db[_0x1df3('0x27')][_0x1df3('0x19')](_0x1e8dc6)[_0x1df3('0x21')](function(_0x2f1102){_0x4aeb05[_0x1df3('0x19')]=_0x2f1102;if(_0x64de50[_0x1df3('0x29')][_0x1df3('0x3c')]){_0xc39132['include']=[{'all':!![]}];}return db[_0x1df3('0x27')]['findAll'](_0xc39132);})[_0x1df3('0x21')](function(_0x4cef28){_0x4aeb05[_0x1df3('0x3d')]=_0x4cef28;return _0x4aeb05;})[_0x1df3('0x21')](respondWithFilteredResult(_0x235618,_0xc39132))[_0x1df3('0x3e')](handleError(_0x235618,null));};exports[_0x1df3('0x3f')]=function(_0x1745e6,_0x19ff51){var _0x46c352={'raw':!![],'where':{'id':_0x1745e6[_0x1df3('0x40')]['id']}},_0x5527a9={};_0x5527a9[_0x1df3('0x28')]=_[_0x1df3('0x2a')](db[_0x1df3('0x27')][_0x1df3('0x41')]);_0x5527a9[_0x1df3('0x29')]=_[_0x1df3('0x2a')](_0x1745e6[_0x1df3('0x29')]);_0x5527a9[_0x1df3('0x34')]=_['intersection'](_0x5527a9[_0x1df3('0x28')],_0x5527a9[_0x1df3('0x29')]);_0x46c352[_0x1df3('0x2c')]=_[_0x1df3('0x2b')](_0x5527a9[_0x1df3('0x28')],qs[_0x1df3('0x2d')](_0x1745e6[_0x1df3('0x29')][_0x1df3('0x2d')]));_0x46c352['attributes']=_0x46c352[_0x1df3('0x2c')][_0x1df3('0x2e')]?_0x46c352[_0x1df3('0x2c')]:_0x5527a9[_0x1df3('0x28')];if(_0x1745e6[_0x1df3('0x29')][_0x1df3('0x3c')]){_0x46c352['include']=[{'all':!![]}];}_0x46c352=_[_0x1df3('0x3b')]({},_0x46c352,_0x1745e6[_0x1df3('0x42')]);return db[_0x1df3('0x27')][_0x1df3('0x43')](_0x46c352)[_0x1df3('0x21')](handleEntityNotFound(_0x19ff51,null))[_0x1df3('0x21')](respondWithResult(_0x19ff51,null))[_0x1df3('0x3e')](handleError(_0x19ff51,null));};exports[_0x1df3('0x44')]=function(_0x3d9e6d,_0x1c038b){return db[_0x1df3('0x27')][_0x1df3('0x44')](_0x3d9e6d[_0x1df3('0x45')],{})['then'](respondWithResult(_0x1c038b,0xc9))[_0x1df3('0x3e')](handleError(_0x1c038b,null));};exports['update']=function(_0x4f8836,_0x5a7200){if(_0x4f8836[_0x1df3('0x45')]['id']){delete _0x4f8836[_0x1df3('0x45')]['id'];}return db['SmsApplication'][_0x1df3('0x43')]({'where':{'id':_0x4f8836[_0x1df3('0x40')]['id']}})[_0x1df3('0x21')](handleEntityNotFound(_0x5a7200,null))[_0x1df3('0x21')](saveUpdates(_0x4f8836[_0x1df3('0x45')],null))[_0x1df3('0x21')](respondWithResult(_0x5a7200,null))[_0x1df3('0x3e')](handleError(_0x5a7200,null));};exports[_0x1df3('0x22')]=function(_0x55a45f,_0x57c235){return db[_0x1df3('0x27')][_0x1df3('0x43')]({'where':{'id':_0x55a45f[_0x1df3('0x40')]['id']}})[_0x1df3('0x21')](handleEntityNotFound(_0x57c235,null))['then'](removeEntity(_0x57c235,null))[_0x1df3('0x3e')](handleError(_0x57c235,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 29ffa59..15d359d 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 _0xdb28=['bluebird','request-promise','path','rimraf','../../config/environment','exports','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x359bbe,_0x5b7fcc){var _0x1b3353=function(_0x34b41c){while(--_0x34b41c){_0x359bbe['push'](_0x359bbe['shift']());}};_0x1b3353(++_0x5b7fcc);}(_0xdb28,0x106));var _0x8db2=function(_0x31f82d,_0x23e446){_0x31f82d=_0x31f82d-0x0;var _0x120908=_0xdb28[_0x31f82d];return _0x120908;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var logger=require(_0x8db2('0x2'))(_0x8db2('0x3'));var moment=require('moment');var BPromise=require(_0x8db2('0x4'));var rp=require(_0x8db2('0x5'));var fs=require('fs');var path=require(_0x8db2('0x6'));var rimraf=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var attributes=require('./smsApplication.attributes');module[_0x8db2('0x9')]=function(_0x1d2dd3,_0x5f42ee){return _0x1d2dd3['define'](_0x8db2('0xa'),attributes,{'tableName':_0x8db2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8db2('0xc'),'collate':_0x8db2('0xd')});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','lodash'];(function(_0x5efaf7,_0x54cbb8){var _0x373808=function(_0x2d0294){while(--_0x2d0294){_0x5efaf7['push'](_0x5efaf7['shift']());}};_0x373808(++_0x54cbb8);}(_0x326f,0xd1));var _0xf326=function(_0x24cd92,_0x4803a4){_0x24cd92=_0x24cd92-0x0;var _0xd416e7=_0x326f[_0x24cd92];return _0xd416e7;};'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 diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 53d4161..c2db980 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 _0xd22c=['../../config/utils','../../config/environment','client','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x561281,_0x56ce98){var _0x5106e8=function(_0x3dcf31){while(--_0x3dcf31){_0x561281['push'](_0x561281['shift']());}};_0x5106e8(++_0x56ce98);}(_0xd22c,0x1e9));var _0xcd22=function(_0x321e72,_0x23dfcc){_0x321e72=_0x321e72-0x0;var _0xb956bd=_0xd22c[_0x321e72];return _0xb956bd;};'use strict';var _=require('lodash');var util=require(_0xcd22('0x0'));var moment=require(_0xcd22('0x1'));var BPromise=require('bluebird');var rs=require(_0xcd22('0x2'));var fs=require('fs');var Redis=require(_0xcd22('0x3'));var db=require(_0xcd22('0x4'))['db'];var utils=require(_0xcd22('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xcd22('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xcd22('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b49ce,_0x3ce078,_0x4eefb1){return new BPromise(function(_0x35b10e,_0x117a79){return client[_0xcd22('0x8')](_0x1b49ce,_0x4eefb1)['then'](function(_0x5026ff){logger[_0xcd22('0x9')](_0xcd22('0xa'),_0x3ce078,_0xcd22('0xb'));logger[_0xcd22('0xc')](_0xcd22('0xd'),_0x3ce078,_0xcd22('0xb'),JSON[_0xcd22('0xe')](_0x5026ff));if(_0x5026ff[_0xcd22('0xf')]){if(_0x5026ff[_0xcd22('0xf')]['code']===0x1f4){logger['error'](_0xcd22('0xa'),_0x3ce078,_0x5026ff[_0xcd22('0xf')]['message']);return _0x117a79(_0x5026ff[_0xcd22('0xf')][_0xcd22('0x10')]);}logger[_0xcd22('0xf')](_0xcd22('0xa'),_0x3ce078,_0x5026ff['error']['message']);return _0x35b10e(_0x5026ff[_0xcd22('0xf')]['message']);}else{logger[_0xcd22('0x9')](_0xcd22('0xa'),_0x3ce078,_0xcd22('0xb'));_0x35b10e(_0x5026ff[_0xcd22('0x11')][_0xcd22('0x10')]);}})[_0xcd22('0x12')](function(_0xb81e2e){logger[_0xcd22('0xf')](_0xcd22('0xa'),_0x3ce078,_0xb81e2e);_0x117a79(_0xb81e2e);});});} \ No newline at end of file +var _0xce68=['jayson/promise','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment'];(function(_0xd2a313,_0xd98999){var _0x245a66=function(_0x156683){while(--_0x156683){_0xd2a313['push'](_0xd2a313['shift']());}};_0x245a66(++_0xd98999);}(_0xce68,0xbf));var _0x8ce6=function(_0x18d957,_0x335640){_0x18d957=_0x18d957-0x0;var _0x246071=_0xce68[_0x18d957];return _0x246071;};'use strict';var _=require(_0x8ce6('0x0'));var util=require(_0x8ce6('0x1'));var moment=require('moment');var BPromise=require(_0x8ce6('0x2'));var rs=require(_0x8ce6('0x3'));var fs=require('fs');var Redis=require(_0x8ce6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8ce6('0x5'));var config=require(_0x8ce6('0x6'));var jayson=require(_0x8ce6('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x47ea64,_0x1d37b1,_0x1a8227){return new BPromise(function(_0xfae6bc,_0x3b8a72){return client[_0x8ce6('0x8')](_0x47ea64,_0x1a8227)[_0x8ce6('0x9')](function(_0x543df5){logger['info'](_0x8ce6('0xa'),_0x1d37b1,_0x8ce6('0xb'));logger[_0x8ce6('0xc')](_0x8ce6('0xd'),_0x1d37b1,'request\x20sent',JSON[_0x8ce6('0xe')](_0x543df5));if(_0x543df5['error']){if(_0x543df5[_0x8ce6('0xf')]['code']===0x1f4){logger[_0x8ce6('0xf')]('SmsApplication,\x20%s,\x20%s',_0x1d37b1,_0x543df5[_0x8ce6('0xf')][_0x8ce6('0x10')]);return _0x3b8a72(_0x543df5[_0x8ce6('0xf')]['message']);}logger[_0x8ce6('0xf')](_0x8ce6('0xa'),_0x1d37b1,_0x543df5[_0x8ce6('0xf')]['message']);return _0xfae6bc(_0x543df5['error'][_0x8ce6('0x10')]);}else{logger['info'](_0x8ce6('0xa'),_0x1d37b1,_0x8ce6('0xb'));_0xfae6bc(_0x543df5[_0x8ce6('0x11')][_0x8ce6('0x10')]);}})['catch'](function(_0x5a9957){logger['error'](_0x8ce6('0xa'),_0x1d37b1,_0x5a9957);_0x3b8a72(_0x5a9957);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 2af5f6b..3252fd7 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 _0x00b1=['isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','addTags','smsinteraction:update','update','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get','/describe'];(function(_0x396886,_0x28646f){var _0xb8d5d0=function(_0x1d9cb0){while(--_0x1d9cb0){_0x396886['push'](_0x396886['shift']());}};_0xb8d5d0(++_0x28646f);}(_0x00b1,0x171));var _0x100b=function(_0x2ea641,_0x4d1b8f){_0x2ea641=_0x2ea641-0x0;var _0x245fd9=_0x00b1[_0x2ea641];return _0x245fd9;};'use strict';var multer=require('multer');var util=require(_0x100b('0x0'));var path=require(_0x100b('0x1'));var timeout=require(_0x100b('0x2'));var express=require('express');var router=express[_0x100b('0x3')]();var auth=require(_0x100b('0x4'));var interaction=require(_0x100b('0x5'));var config=require('../../config/environment');var controller=require(_0x100b('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x100b('0x7')](_0x100b('0x8'),auth[_0x100b('0x9')](),controller[_0x100b('0xa')]);router[_0x100b('0x7')](_0x100b('0xb'),auth[_0x100b('0x9')](),controller[_0x100b('0xc')]);router[_0x100b('0x7')](_0x100b('0xd'),auth[_0x100b('0x9')](),controller[_0x100b('0xe')]);router[_0x100b('0x7')](_0x100b('0xf'),auth[_0x100b('0x9')](),controller['download']);router[_0x100b('0x10')]('/',auth[_0x100b('0x9')](),controller[_0x100b('0x11')]);router[_0x100b('0x10')]('/:id/messages',auth['isAuthenticated'](),controller[_0x100b('0x12')]);router[_0x100b('0x10')](_0x100b('0x13'),auth[_0x100b('0x9')](),interaction[_0x100b('0x14')](_0x100b('0x15'),'smsinteraction:addtags'),controller[_0x100b('0x16')]);router['put'](_0x100b('0xb'),auth['isAuthenticated'](),interaction[_0x100b('0x14')](_0x100b('0x15'),_0x100b('0x17')),controller[_0x100b('0x18')]);router[_0x100b('0x19')](_0x100b('0xb'),auth[_0x100b('0x9')](),interaction[_0x100b('0x14')](_0x100b('0x15'),'smsinteraction:destroy'),controller['destroy']);router['delete'](_0x100b('0x13'),auth[_0x100b('0x9')](),controller['removeTags']);module[_0x100b('0x1a')]=router; \ No newline at end of file +var _0xe968=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','getMessages','/:id/download','download','post','/:id/messages','addMessage','/:id/tags','tracked','sms','smsinteraction:update','delete','smsinteraction:destroy','destroy','removeTags','exports'];(function(_0x336ca2,_0x1a813a){var _0xda59a6=function(_0x47caa6){while(--_0x47caa6){_0x336ca2['push'](_0x336ca2['shift']());}};_0xda59a6(++_0x1a813a);}(_0xe968,0x188));var _0x8e96=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xe968[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0x8e96('0x0'));var path=require('path');var timeout=require(_0x8e96('0x1'));var express=require(_0x8e96('0x2'));var router=express[_0x8e96('0x3')]();var auth=require(_0x8e96('0x4'));var interaction=require(_0x8e96('0x5'));var config=require(_0x8e96('0x6'));var controller=require('./smsInteraction.controller');router[_0x8e96('0x7')]('/',auth['isAuthenticated'](),controller[_0x8e96('0x8')]);router[_0x8e96('0x7')](_0x8e96('0x9'),auth[_0x8e96('0xa')](),controller[_0x8e96('0xb')]);router[_0x8e96('0x7')](_0x8e96('0xc'),auth[_0x8e96('0xa')](),controller['show']);router[_0x8e96('0x7')]('/:id/messages',auth[_0x8e96('0xa')](),controller[_0x8e96('0xd')]);router[_0x8e96('0x7')](_0x8e96('0xe'),auth[_0x8e96('0xa')](),controller[_0x8e96('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8e96('0x10')](_0x8e96('0x11'),auth[_0x8e96('0xa')](),controller[_0x8e96('0x12')]);router[_0x8e96('0x10')](_0x8e96('0x13'),auth[_0x8e96('0xa')](),interaction[_0x8e96('0x14')](_0x8e96('0x15'),'smsinteraction:addtags'),controller['addTags']);router['put'](_0x8e96('0xc'),auth[_0x8e96('0xa')](),interaction[_0x8e96('0x14')](_0x8e96('0x15'),_0x8e96('0x16')),controller['update']);router[_0x8e96('0x17')](_0x8e96('0xc'),auth[_0x8e96('0xa')](),interaction[_0x8e96('0x14')](_0x8e96('0x15'),_0x8e96('0x18')),controller[_0x8e96('0x19')]);router[_0x8e96('0x17')]('/:id/tags',auth['isAuthenticated'](),controller[_0x8e96('0x1a')]);module[_0x8e96('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 9ed8ec3..bf55160 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 _0x8d28=['STRING','ENUM','out','sequelize','moment','exports','DATE'];(function(_0x529313,_0x28a8b3){var _0x3f7d31=function(_0x1ccb2a){while(--_0x1ccb2a){_0x529313['push'](_0x529313['shift']());}};_0x3f7d31(++_0x28a8b3);}(_0x8d28,0x145));var _0x88d2=function(_0x186492,_0x4c9547){_0x186492=_0x186492-0x0;var _0x326c9d=_0x8d28[_0x186492];return _0x326c9d;};'use strict';var Sequelize=require(_0x88d2('0x0'));var moment=require(_0x88d2('0x1'));module[_0x88d2('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x88d2('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x88d2('0x4')]},'phone':{'type':Sequelize[_0x88d2('0x4')]},'read1stAt':{'type':Sequelize[_0x88d2('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x88d2('0x5')]('in',_0x88d2('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x88d2('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x88d2('0x5')]('in',_0x88d2('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x90d3=['ENUM','out','moment','exports','DATE','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x90d3,0x16a));var _0x390d=function(_0x3e69ae,_0x366e8d){_0x3e69ae=_0x3e69ae-0x0;var _0x3d7f42=_0x90d3[_0x3e69ae];return _0x3d7f42;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x390d('0x0'));module[_0x390d('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x390d('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x390d('0x3')]},'phone':{'type':Sequelize[_0x390d('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x390d('0x4')]('in',_0x390d('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x390d('0x4')]('in',_0x390d('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index df9ba0f..9897d81 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 _0x8c58=['Content-Range','apply','reject','update','then','destroy','error','name','Users','map','forEach','Tags','TagIds','catch','index','SmsInteraction','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','select','field','color','from','tools_tags','sms_messages','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','a.id\x20=\x20i.SmsAccountId','expr','parse','keys','createdAt','value','startOf','utc','format','day','and','condition','unreadMessages','\x20IN\x20?','tableAlias','\x20=\x20?','LIKE','c.firstName','\x20LIKE\x20?','c.lastName','\x20>\x20?','\x20<\x20?','TagId','isArray','filter','isNil','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','push','toString','join','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','group','i.id','Sequelize','clone','COUNT(*)','COUNT(me.id)','advancedFilter','read','`unreadMessages`\x20=\x200','having','`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','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','sequelize','keyBy','merge','a.key','Account.key','i.*','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','all','rows','show','params','includeAll','include','options','find','body','describe','addMessage','SmsMessage','ids','getMessages','findOne','pick','split','YYYY-MM-DD\x20HH:mm:ss','setTags','omit','spread','Tag','emit','smsInteractionTags:save','removeTags','download','root','files','server','attachments','transcript-%d-%s.zip','Messages','direction','secret','User','fullname','CmContact','Contact','firstName','Account','Owner','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','\x0a\x20\x20\x20\x20\x20\x20\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','YYYY-MM-DD','Sms','N.A.','closed','disposition','out','lastName','renderFile','views','downloadInteraction.html','create','toFile','transcript-','.pdf','log','unlinkSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','count','offset','set'];(function(_0x2af603,_0x165822){var _0x441b0c=function(_0x166cb2){while(--_0x166cb2){_0x2af603['push'](_0x2af603['shift']());}};_0x441b0c(++_0x165822);}(_0x8c58,0xba));var _0x88c5=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0x8c58[_0x490be3];return _0x3f5140;};'use strict';var pdf=require(_0x88c5('0x0'));var emlformat=require(_0x88c5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x88c5('0x2'));var jsonpatch=require(_0x88c5('0x3'));var rp=require(_0x88c5('0x4'));var moment=require(_0x88c5('0x5'));var BPromise=require(_0x88c5('0x6'));var Mustache=require(_0x88c5('0x7'));var util=require(_0x88c5('0x8'));var path=require(_0x88c5('0x9'));var sox=require(_0x88c5('0xa'));var csv=require(_0x88c5('0xb'));var ejs=require(_0x88c5('0xc'));var fs=require('fs');var _=require(_0x88c5('0xd'));var squel=require(_0x88c5('0xe'));var crypto=require(_0x88c5('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x88c5('0xb'));var querystring=require(_0x88c5('0x10'));var Papa=require(_0x88c5('0x11'));var Redis=require('ioredis');var authService=require(_0x88c5('0x12'));var qs=require(_0x88c5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x88c5('0x14'))(_0x88c5('0x15'));var utils=require(_0x88c5('0x16'));var config=require(_0x88c5('0x17'));var db=require('../../mysqldb')['db'];config[_0x88c5('0x18')]=_[_0x88c5('0x19')](config['redis'],{'host':_0x88c5('0x1a'),'port':0x18eb});var socket=require(_0x88c5('0x1b'))(new Redis(config[_0x88c5('0x18')]));require(_0x88c5('0x1c'))[_0x88c5('0x1d')](socket);function respondWithStatusCode(_0x302893,_0x4883c0){_0x4883c0=_0x4883c0||0xcc;return function(_0x12bc9e){if(_0x12bc9e){return _0x302893[_0x88c5('0x1e')](_0x4883c0);}return _0x302893[_0x88c5('0x1f')](_0x4883c0)[_0x88c5('0x20')]();};}function respondWithResult(_0x59a569,_0x34a3c7){_0x34a3c7=_0x34a3c7||0xc8;return function(_0xbffaf6){if(_0xbffaf6){return _0x59a569[_0x88c5('0x1f')](_0x34a3c7)[_0x88c5('0x21')](_0xbffaf6);}};}function respondWithFilteredResult(_0xd014bb,_0x153bab){return function(_0x5be72a){if(_0x5be72a){var _0x29c0cc=_0x5be72a[_0x88c5('0x22')],_0x3675aa=_0x153bab[_0x88c5('0x23')],_0x2e6737=_0x153bab[_0x88c5('0x23')]+_0x153bab['limit'],_0x342371;if(_0x2e6737>=_0x29c0cc){_0x2e6737=_0x29c0cc;_0x342371=0xc8;}else{_0x342371=0xce;}_0xd014bb[_0x88c5('0x1f')](_0x342371);return _0xd014bb[_0x88c5('0x24')](_0x88c5('0x25'),_0x3675aa+'-'+_0x2e6737+'/'+_0x29c0cc)[_0x88c5('0x21')](_0x5be72a);}return null;};}function patchUpdates(_0x737835){return function(_0x1b207f){try{jsonpatch[_0x88c5('0x26')](_0x1b207f,_0x737835,!![]);}catch(_0x5aa511){return BPromise[_0x88c5('0x27')](_0x5aa511);}return _0x1b207f['save']();};}function saveUpdates(_0x35c10c,_0x1db033){return function(_0x18ba56){if(_0x18ba56){return _0x18ba56[_0x88c5('0x28')](_0x35c10c)[_0x88c5('0x29')](function(_0x1c6d25){return _0x1c6d25;});}return null;};}function removeEntity(_0x253d91,_0x16dc79){return function(_0x10aee4){if(_0x10aee4){return _0x10aee4[_0x88c5('0x2a')]()[_0x88c5('0x29')](function(){_0x253d91['status'](0xcc)[_0x88c5('0x20')]();});}};}function handleEntityNotFound(_0x285e6c,_0xa40954){return function(_0x4ade82){if(!_0x4ade82){_0x285e6c[_0x88c5('0x1e')](0x194);}return _0x4ade82;};}function handleError(_0xc489bc,_0x53a496){_0x53a496=_0x53a496||0x1f4;return function(_0x189a1d){logger[_0x88c5('0x2b')](_0x189a1d['stack']);if(_0x189a1d[_0x88c5('0x2c')]){delete _0x189a1d['name'];}_0xc489bc[_0x88c5('0x1f')](_0x53a496)['send'](_0x189a1d);};}function getInteractionUsers(_0x4a3f89,_0xbf87d5){return new BPromise(function(_0x635fc2,_0x99647a){try{if(_0xbf87d5[_0x4a3f89['id']]){_0x4a3f89[_0x88c5('0x2d')]=_[_0x88c5('0x2e')](_0xbf87d5[_0x4a3f89['id']],function(_0x55db3c){return{'id':_0x55db3c['id']};});}}catch(_0x37b342){_0x99647a(_0x37b342);}_0x635fc2(_0x4a3f89);});}function getInteractionTags(_0x11f9a0,_0x1dac7e){return new BPromise(function(_0x31624d,_0x9be210){try{if(_0x11f9a0['TagIds']){_0x11f9a0['Tags']=[];_0x11f9a0['TagIds']['split'](',')[_0x88c5('0x2f')](function(_0x210519){_0x11f9a0[_0x88c5('0x30')]['push'](_0x1dac7e[_0x210519]);});}delete _0x11f9a0[_0x88c5('0x31')];}catch(_0x3df596){_0x9be210(_0x3df596);}_0x31624d(_0x11f9a0);});}function updateSmsInteraction(_0x1ab16a,_0x49dfe4,_0x23166a){return new BPromise(function(_0x59b2f0,_0x31b14b){return getInteractionUsers(_0x1ab16a,_0x23166a)[_0x88c5('0x29')](function(_0xbb7ff7){return getInteractionTags(_0xbb7ff7,_0x49dfe4);})[_0x88c5('0x29')](function(_0x28c94f){_0x59b2f0(_0x28c94f);})[_0x88c5('0x32')](function(_0x14dca9){_0x31b14b(_0x14dca9);});});}exports[_0x88c5('0x33')]=function(_0x36b27d,_0xd5558d){var _0x2b2ead={},_0x44753a={},_0x4f8ea1={'count':0x0,'rows':[]};var _0x1218e4=db[_0x88c5('0x34')][_0x88c5('0x35')];_0x44753a[_0x88c5('0x36')]=_['keys'](_0x1218e4);_0x44753a[_0x88c5('0x37')]=_['keys'](_0x36b27d[_0x88c5('0x37')]);_0x44753a[_0x88c5('0x38')]=_[_0x88c5('0x39')](_0x44753a[_0x88c5('0x36')],_0x44753a[_0x88c5('0x37')]);_0x2b2ead[_0x88c5('0x3a')]=_[_0x88c5('0x39')](_0x44753a[_0x88c5('0x36')],qs[_0x88c5('0x3b')](_0x36b27d['query'][_0x88c5('0x3b')]));_0x2b2ead[_0x88c5('0x3a')]=_0x2b2ead[_0x88c5('0x3a')][_0x88c5('0x3c')]?_0x2b2ead[_0x88c5('0x3a')]:_0x44753a[_0x88c5('0x36')];if(!_0x36b27d[_0x88c5('0x37')][_0x88c5('0x3d')](_0x88c5('0x3e'))){_0x2b2ead[_0x88c5('0x3f')]=qs[_0x88c5('0x3f')](_0x36b27d[_0x88c5('0x37')][_0x88c5('0x3f')]);_0x2b2ead[_0x88c5('0x23')]=qs['offset'](_0x36b27d[_0x88c5('0x37')][_0x88c5('0x23')]);}_0x2b2ead[_0x88c5('0x40')]=qs['sort'](_0x36b27d[_0x88c5('0x37')][_0x88c5('0x41')]);_0x2b2ead[_0x88c5('0x42')]=qs[_0x88c5('0x38')](_['pick'](_0x36b27d[_0x88c5('0x37')],_0x44753a['filters']));var _0x9e8bb7=[];var _0x157520=squel[_0x88c5('0x43')]()[_0x88c5('0x44')]('id')[_0x88c5('0x44')](_0x88c5('0x2c'))[_0x88c5('0x44')](_0x88c5('0x45'))[_0x88c5('0x46')](_0x88c5('0x47'));var _0x38c1ac=squel[_0x88c5('0x43')]()[_0x88c5('0x44')]('COUNT(*)')[_0x88c5('0x46')](_0x88c5('0x48'),'me')[_0x88c5('0x42')]('me.SmsInteractionId\x20=\x20i.id')[_0x88c5('0x42')](_0x88c5('0x49'))['where'](_0x88c5('0x4a'));var _0x34ebfd=squel[_0x88c5('0x43')]()[_0x88c5('0x44')](_0x88c5('0x4b'))[_0x88c5('0x44')](_0x88c5('0x4c'))[_0x88c5('0x46')](_0x88c5('0x4d'),'ui')[_0x88c5('0x4e')](_0x88c5('0x4f'),'u',_0x88c5('0x50'));var _0x323c0c=squel[_0x88c5('0x43')]()[_0x88c5('0x46')](_0x88c5('0x51'),'i')[_0x88c5('0x4e')]('cm_contacts','c',_0x88c5('0x52'))[_0x88c5('0x4e')](_0x88c5('0x4f'),'o','o.id\x20=\x20i.UserId')[_0x88c5('0x4e')](_0x88c5('0x53'),'a',_0x88c5('0x54'))[_0x88c5('0x4e')]('sms_messages','me','me.SmsInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false');var _0x384c90=squel[_0x88c5('0x55')]();if(_0x36b27d['query']['advancedFilter']){var _0x22ce94=JSON[_0x88c5('0x56')](_0x36b27d['query']['advancedFilter']);_[_0x88c5('0x57')](_0x22ce94)[_0x88c5('0x2f')](function(_0x4822ef){var _0x2daf71=_0x22ce94[_0x4822ef];if(_0x4822ef===_0x88c5('0x58')){var _0x11ba15=moment(_0x2daf71[_0x88c5('0x59')]['dateStart'])[_0x88c5('0x5a')]('day')[_0x88c5('0x5b')]()[_0x88c5('0x5c')]();var _0x362394=moment(_0x362394)[_0x88c5('0x5b')]()['endOf'](_0x88c5('0x5d'))['format']();_0x384c90[_0x88c5('0x5e')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x11ba15,_0x362394);}else{if(_['isArray'](_0x2daf71[_0x88c5('0x5f')])){_0x2daf71['condition'][_0x88c5('0x2f')](function(_0x3f3ef4){switch(_0x2daf71[_0x88c5('0x5f')][_0x88c5('0x59')]){case'IS':if(_0x4822ef!=='TagId'&&_0x4822ef!==_0x88c5('0x60')){if(_['isArray'](_0x2daf71[_0x88c5('0x59')])&&_0x2daf71['value'][_0x88c5('0x3c')]>0x1){_0x384c90[_0x88c5('0x5e')](_0x2daf71['tableAlias']+'.'+_0x4822ef+_0x88c5('0x61'),_0x2daf71['value']);}else{_0x384c90[_0x88c5('0x5e')](_0x2daf71[_0x88c5('0x62')]+'.'+_0x4822ef+_0x88c5('0x63'),_0x2daf71[_0x88c5('0x59')][0x0]);}}break;case'=':_0x384c90['and'](_0x2daf71[_0x88c5('0x62')]+'.'+_0x4822ef+'\x20=\x20?',_0x2daf71[_0x88c5('0x59')]);break;case _0x88c5('0x64'):if(_0x4822ef==='ContactId'){_0x384c90['and'](_0x88c5('0x65')+_0x88c5('0x66'),'%'+_0x2daf71['value']+'%');_0x384c90['or'](_0x88c5('0x67')+_0x88c5('0x66'),'%'+_0x2daf71[_0x88c5('0x59')]+'%');_0x384c90['or']('c.email'+_0x88c5('0x66'),'%'+_0x2daf71[_0x88c5('0x59')]+'%');}else{_0x384c90[_0x88c5('0x5e')](_0x2daf71[_0x88c5('0x62')]+'.'+_0x4822ef+_0x88c5('0x66'),'%'+_0x2daf71['value']+'%');}break;case'>':_0x384c90['and'](_0x2daf71[_0x88c5('0x62')]+'.'+_0x4822ef+_0x88c5('0x68'),_0x2daf71['value']);break;case'<':_0x384c90[_0x88c5('0x5e')](_0x2daf71[_0x88c5('0x62')]+'.'+_0x4822ef+_0x88c5('0x69'),_0x2daf71['value']);break;}});}else{switch(_0x2daf71['condition'][_0x88c5('0x59')]){case'IS':if(_0x4822ef!==_0x88c5('0x6a')&&_0x4822ef!==_0x88c5('0x60')){if(_[_0x88c5('0x6b')](_0x2daf71[_0x88c5('0x59')])&&_0x2daf71[_0x88c5('0x59')][_0x88c5('0x3c')]>0x1){_0x384c90['and'](_0x2daf71[_0x88c5('0x62')]+'.'+_0x4822ef+_0x88c5('0x61'),_0x2daf71[_0x88c5('0x59')]);}else{_0x384c90[_0x88c5('0x5e')](_0x2daf71['tableAlias']+'.'+_0x4822ef+_0x88c5('0x63'),_0x2daf71['value'][0x0]);}}break;case'=':_0x384c90['and'](_0x2daf71[_0x88c5('0x62')]+'.'+_0x4822ef+'\x20=\x20?',_0x2daf71[_0x88c5('0x59')]);break;case'LIKE':if(_0x4822ef==='ContactId'){_0x384c90[_0x88c5('0x5e')]('c.firstName'+_0x88c5('0x66'),'%'+_0x2daf71['value']+'%');_0x384c90['or'](_0x88c5('0x67')+'\x20LIKE\x20?','%'+_0x2daf71[_0x88c5('0x59')]+'%');_0x384c90['or']('c.email'+'\x20LIKE\x20?','%'+_0x2daf71[_0x88c5('0x59')]+'%');}else{_0x384c90[_0x88c5('0x5e')](_0x2daf71[_0x88c5('0x62')]+'.'+_0x4822ef+_0x88c5('0x66'),'%'+_0x2daf71[_0x88c5('0x59')]+'%');}break;case'>':_0x384c90[_0x88c5('0x5e')](_0x2daf71[_0x88c5('0x62')]+'.'+_0x4822ef+_0x88c5('0x68'),_0x2daf71[_0x88c5('0x59')]);break;case'<':_0x384c90['and'](_0x2daf71[_0x88c5('0x62')]+'.'+_0x4822ef+'\x20<\x20?',_0x2daf71['value']);break;}}}});}else{var _0x17fff4=_(Object['keys'](_0x36b27d[_0x88c5('0x37')]))[_0x88c5('0x2e')](function(_0x1f4135){return _0x1218e4[_0x88c5('0x3d')](_0x1f4135)?_0x1f4135:undefined;})[_0x88c5('0x6c')](function(_0x94ceea){return!_[_0x88c5('0x6d')](_0x94ceea);})['value']();if(!_[_0x88c5('0x6e')](_0x17fff4)){_0x17fff4[_0x88c5('0x2f')](function(_0x304e96){if(_0x304e96===_0x88c5('0x6f')){_0x323c0c[_0x88c5('0x42')](_0x88c5('0x70'),[][_0x88c5('0x71')](_0x36b27d['query'][_0x304e96]));}else if(_0x304e96==='createdAt'){var _0x367ea8=JSON[_0x88c5('0x56')](_0x36b27d[_0x88c5('0x37')][_0x304e96])[_0x88c5('0x72')];var _0x2518fa=JSON[_0x88c5('0x56')](_0x36b27d['query'][_0x304e96])[_0x88c5('0x73')];_0x323c0c[_0x88c5('0x42')](_0x88c5('0x74'),_0x367ea8,_0x2518fa);}else{if(_0x36b27d[_0x88c5('0x37')][_0x304e96]===_0x88c5('0x75')){_0x323c0c['where']('i.'+_0x304e96+'\x20IS\x20NULL');}else{_0x323c0c['where']('i.'+_0x304e96+_0x88c5('0x63'),_0x36b27d[_0x88c5('0x37')][_0x304e96]);}}});}if(_0x36b27d[_0x88c5('0x37')]['filter']){var _0x21901f=_0x36b27d[_0x88c5('0x37')]['filter'][_0x88c5('0x76')]('\x5c','\x5c\x5c')[_0x88c5('0x76')]('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x21901f)){_0x384c90['or'](_0x88c5('0x77'),_0x21901f+'%')['or'](_0x88c5('0x78'),_0x21901f+'%');}else{var _0x43bfdc=[];_0x21901f['split']('\x20')[_0x88c5('0x2f')](function(_0x5bb8e7){_0x43bfdc[_0x88c5('0x79')]('+'+_0x5bb8e7[_0x88c5('0x7a')]());});var _0x5c725a=_0x43bfdc[_0x88c5('0x7b')]('\x20');_0x384c90['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x5c725a)['or'](_0x88c5('0x7c'),_0x21901f+'%');}}}_0x323c0c['where'](_0x384c90);if(_0x2b2ead[_0x88c5('0x40')]){_0x2b2ead[_0x88c5('0x40')][_0x88c5('0x2f')](function(_0x3f15d5){_0x323c0c[_0x88c5('0x40')]('i.'+_0x3f15d5[0x0],_0x3f15d5[0x1]===_0x88c5('0x7d')?![]:!![]);});}_0x323c0c[_0x88c5('0x7e')](_0x88c5('0x7f'));var _0x575069={'type':db[_0x88c5('0x80')]['QueryTypes']['SELECT'],'raw':!![]};var _0x14baca=_0x323c0c[_0x88c5('0x81')]()[_0x88c5('0x44')](_0x88c5('0x82'))[_0x88c5('0x44')](_0x88c5('0x83'),_0x88c5('0x60'));if(!_0x36b27d[_0x88c5('0x37')][_0x88c5('0x84')]){if(_0x36b27d[_0x88c5('0x37')][_0x88c5('0x85')]){if(_0x36b27d[_0x88c5('0x37')][_0x88c5('0x85')]==0x1){_0x14baca['having'](_0x88c5('0x86'));_0x323c0c['having']('`unreadMessages`\x20=\x200');}else{_0x14baca[_0x88c5('0x87')](_0x88c5('0x88'));_0x323c0c[_0x88c5('0x87')]('`unreadMessages`\x20>\x200');}}if(_0x36b27d[_0x88c5('0x37')][_0x88c5('0x89')]){var _0x5a9ba0=_['isArray'](_0x36b27d[_0x88c5('0x37')][_0x88c5('0x89')])?_0x36b27d[_0x88c5('0x37')][_0x88c5('0x89')]:new Array(_0x36b27d[_0x88c5('0x37')][_0x88c5('0x89')]);var _0x807a3f=squel[_0x88c5('0x55')]();_0x5a9ba0['forEach'](function(_0x16dab7){_0x807a3f['or'](_0x88c5('0x8a'),'%,'+_0x16dab7+',%');});_0x323c0c[_0x88c5('0x87')](_0x807a3f);_0x14baca[_0x88c5('0x4e')](_0x88c5('0x8b'),'it',_0x88c5('0x8c'));_0x14baca[_0x88c5('0x4e')](_0x88c5('0x47'),'t',_0x88c5('0x8d'));_0x14baca[_0x88c5('0x42')]('t.id\x20IN\x20?',_0x5a9ba0);}}else{var _0x22ce94=JSON[_0x88c5('0x56')](_0x36b27d['query'][_0x88c5('0x84')]);_['keys'](_0x22ce94)[_0x88c5('0x2f')](function(_0x2a8ab7){var _0x5e2e16=_0x22ce94[_0x2a8ab7];if(_0x2a8ab7===_0x88c5('0x6a')){var _0x334a35=_0x5e2e16[_0x88c5('0x59')];var _0x5f1557=squel[_0x88c5('0x55')]();_0x334a35['forEach'](function(_0xf7e192){_0x5f1557['or'](_0x88c5('0x8a'),'%,'+_0xf7e192+',%');});_0x323c0c['having'](_0x5f1557);_0x14baca[_0x88c5('0x4e')](_0x88c5('0x8e'),'it',_0x88c5('0x8f'));_0x14baca[_0x88c5('0x4e')](_0x88c5('0x47'),'t',_0x88c5('0x8d'));_0x14baca['where'](_0x88c5('0x90'),_0x334a35);}else if(_0x2a8ab7===_0x88c5('0x60')){if(_0x5e2e16['value'][_0x88c5('0x3c')]===0x1){if(_0x5e2e16[_0x88c5('0x59')][0x0]===0x1){_0x14baca[_0x88c5('0x87')](_0x88c5('0x86'));_0x323c0c[_0x88c5('0x87')](_0x88c5('0x86'));}else{_0x14baca['having']('`unreadMessages`\x20>\x200');_0x323c0c[_0x88c5('0x87')](_0x88c5('0x88'));}}}});}db[_0x88c5('0x91')][_0x88c5('0x37')](_0x14baca[_0x88c5('0x7a')](),_0x575069)[_0x88c5('0x29')](function(_0x1a6b73){_0x4f8ea1[_0x88c5('0x22')]=_0x1a6b73[_0x88c5('0x3c')];if(_0x4f8ea1[_0x88c5('0x22')]===0x0)return[];return db['sequelize']['query'](_0x157520['toString'](),_0x575069)[_0x88c5('0x29')](function(_0x2f67fe){_0x9e8bb7=_[_0x88c5('0x92')](_0x2f67fe,'id');_0x575069=_[_0x88c5('0x93')](_0x575069,{'model':db[_0x88c5('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x323c0c[_0x88c5('0x44')](_0x88c5('0x83'),_0x88c5('0x60'));_0x323c0c[_0x88c5('0x44')](_0x88c5('0x94'),_0x88c5('0x95'));_0x323c0c[_0x88c5('0x44')](_0x88c5('0x96'));_0x323c0c[_0x88c5('0x44')]('c.firstName',_0x88c5('0x97'));_0x323c0c[_0x88c5('0x44')](_0x88c5('0x67'),_0x88c5('0x98'));_0x323c0c['field'](_0x88c5('0x99'),_0x88c5('0x9a'));_0x323c0c['field'](_0x88c5('0x9b'),_0x88c5('0x9c'));_0x323c0c[_0x88c5('0x44')]('c.mobile',_0x88c5('0x9d'));_0x323c0c[_0x88c5('0x44')]('c.fax',_0x88c5('0x9e'));_0x323c0c['field'](_0x88c5('0x9f'),'TagIds');_0x323c0c[_0x88c5('0x4e')](_0x88c5('0x8b'),'it','it.SmsInteractionId\x20=\x20i.id');_0x323c0c[_0x88c5('0x4e')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x323c0c[_0x88c5('0x3f')](_0x2b2ead[_0x88c5('0x3f')]);_0x323c0c['offset'](_0x2b2ead[_0x88c5('0x23')]);return db[_0x88c5('0x91')][_0x88c5('0x37')](_0x323c0c[_0x88c5('0x7a')](),_0x575069);})[_0x88c5('0x29')](function(_0x3d2f95){_0x34ebfd[_0x88c5('0x42')](_0x88c5('0xa0'),_[_0x88c5('0x2e')](_0x3d2f95,'id'));return db[_0x88c5('0x91')]['query'](_0x34ebfd[_0x88c5('0x7a')](),_0x575069)[_0x88c5('0x29')](function(_0x36889a){var _0x5bec62=_['groupBy'](_0x36889a,_0x88c5('0xa1'));var _0xec24ba=[];_0x3d2f95['forEach'](function(_0x64a52e){_0xec24ba[_0x88c5('0x79')](updateSmsInteraction(_0x64a52e,_0x9e8bb7,_0x5bec62));});return BPromise[_0x88c5('0xa2')](_0xec24ba);});});})[_0x88c5('0x29')](function(_0x1195a8){_0x4f8ea1[_0x88c5('0xa3')]=_0x1195a8;return _0x4f8ea1;})[_0x88c5('0x29')](respondWithFilteredResult(_0xd5558d,_0x2b2ead))[_0x88c5('0x32')](handleError(_0xd5558d,null));};exports[_0x88c5('0xa4')]=function(_0x34ffb6,_0x4ea3e3){var _0x29b48c={'raw':![],'where':{'id':_0x34ffb6[_0x88c5('0xa5')]['id']}},_0x1dedb9={};_0x1dedb9['model']=_[_0x88c5('0x57')](db[_0x88c5('0x34')][_0x88c5('0x35')]);_0x1dedb9[_0x88c5('0x37')]=_[_0x88c5('0x57')](_0x34ffb6[_0x88c5('0x37')]);_0x1dedb9[_0x88c5('0x38')]=_['intersection'](_0x1dedb9[_0x88c5('0x36')],_0x1dedb9['query']);_0x29b48c[_0x88c5('0x3a')]=_['intersection'](_0x1dedb9[_0x88c5('0x36')],qs[_0x88c5('0x3b')](_0x34ffb6[_0x88c5('0x37')][_0x88c5('0x3b')]));_0x29b48c[_0x88c5('0x3a')]=_0x29b48c['attributes'][_0x88c5('0x3c')]?_0x29b48c['attributes']:_0x1dedb9[_0x88c5('0x36')];if(_0x34ffb6['query'][_0x88c5('0xa6')]){_0x29b48c[_0x88c5('0xa7')]=[{'all':!![]}];}_0x29b48c=_['merge']({},_0x29b48c,_0x34ffb6[_0x88c5('0xa8')]);return db[_0x88c5('0x34')][_0x88c5('0xa9')](_0x29b48c)[_0x88c5('0x29')](handleEntityNotFound(_0x4ea3e3,null))[_0x88c5('0x29')](respondWithResult(_0x4ea3e3,null))[_0x88c5('0x32')](handleError(_0x4ea3e3,null));};exports['create']=function(_0x448cd8,_0xe95c5){return db['SmsInteraction']['create'](_0x448cd8[_0x88c5('0xaa')],{})['then'](respondWithResult(_0xe95c5,0xc9))['catch'](handleError(_0xe95c5,null));};exports['update']=function(_0x4beb5c,_0x3c2f87){if(_0x4beb5c['body']['id']){delete _0x4beb5c['body']['id'];}return db[_0x88c5('0x34')][_0x88c5('0xa9')]({'where':{'id':_0x4beb5c[_0x88c5('0xa5')]['id']}})[_0x88c5('0x29')](handleEntityNotFound(_0x3c2f87,null))[_0x88c5('0x29')](saveUpdates(_0x4beb5c[_0x88c5('0xaa')],null))[_0x88c5('0x29')](respondWithResult(_0x3c2f87,null))[_0x88c5('0x32')](handleError(_0x3c2f87,null));};exports[_0x88c5('0x2a')]=function(_0x55d0d0,_0x511d00){return db[_0x88c5('0x34')][_0x88c5('0xa9')]({'where':{'id':_0x55d0d0[_0x88c5('0xa5')]['id']}})[_0x88c5('0x29')](handleEntityNotFound(_0x511d00,null))[_0x88c5('0x29')](removeEntity(_0x511d00,null))[_0x88c5('0x32')](handleError(_0x511d00,null));};exports['describe']=function(_0x2e5014,_0x5466ec){return db['SmsInteraction'][_0x88c5('0xab')]()[_0x88c5('0x29')](respondWithResult(_0x5466ec,null))[_0x88c5('0x32')](handleError(_0x5466ec,null));};exports[_0x88c5('0xac')]=function(_0x2a834b,_0x5749e1,_0x147393){return db[_0x88c5('0xad')][_0x88c5('0xa9')]({'where':{'id':_0x2a834b['params']['id']}})['then'](handleEntityNotFound(_0x5749e1,null))['then'](function(_0x4c33e7){if(_0x4c33e7){return _0x4c33e7[_0x88c5('0xac')](_0x2a834b[_0x88c5('0xaa')][_0x88c5('0xae')],_['omit'](_0x2a834b[_0x88c5('0xaa')],[_0x88c5('0xae'),'id'])||{});}})[_0x88c5('0x29')](respondWithResult(_0x5749e1,null))[_0x88c5('0x32')](handleError(_0x5749e1,null));};exports[_0x88c5('0xaf')]=function(_0x3221ed,_0xd19181,_0x5a2376){var _0x44f4e7={'raw':![],'where':{}};var _0x58a753={};var _0x185e7b={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x88c5('0xb0')]({'where':{'id':_0x3221ed[_0x88c5('0xa5')]['id']}})[_0x88c5('0x29')](handleEntityNotFound(_0xd19181,null))[_0x88c5('0x29')](function(_0x585d0a){if(_0x585d0a){_0x58a753[_0x88c5('0x36')]=_[_0x88c5('0x57')](db[_0x88c5('0xad')]['rawAttributes']);_0x58a753[_0x88c5('0x37')]=_[_0x88c5('0x57')](_0x3221ed[_0x88c5('0x37')]);_0x58a753[_0x88c5('0x38')]=_[_0x88c5('0x39')](_0x58a753[_0x88c5('0x36')],_0x58a753['query']);_0x44f4e7[_0x88c5('0x3a')]=_[_0x88c5('0x39')](_0x58a753['model'],qs[_0x88c5('0x3b')](_0x3221ed[_0x88c5('0x37')][_0x88c5('0x3b')]));_0x44f4e7['attributes']=_0x44f4e7[_0x88c5('0x3a')]['length']?_0x44f4e7[_0x88c5('0x3a')]:_0x58a753[_0x88c5('0x36')];if(!_0x3221ed[_0x88c5('0x37')][_0x88c5('0x3d')](_0x88c5('0x3e'))){_0x44f4e7[_0x88c5('0x3f')]=qs[_0x88c5('0x3f')](_0x3221ed[_0x88c5('0x37')]['limit']);_0x44f4e7[_0x88c5('0x23')]=qs[_0x88c5('0x23')](_0x3221ed[_0x88c5('0x37')][_0x88c5('0x23')]);}_0x44f4e7[_0x88c5('0x40')]=qs[_0x88c5('0x41')](_0x3221ed[_0x88c5('0x37')][_0x88c5('0x41')]);_0x44f4e7[_0x88c5('0x42')]=qs[_0x88c5('0x38')](_[_0x88c5('0xb1')](_0x3221ed[_0x88c5('0x37')],_0x58a753[_0x88c5('0x38')]));_0x44f4e7[_0x88c5('0x42')][_0x88c5('0xa1')]=_0x585d0a['id'];if(_0x3221ed[_0x88c5('0x37')][_0x88c5('0x6c')]){_0x44f4e7[_0x88c5('0x42')]=_[_0x88c5('0x93')](_0x44f4e7[_0x88c5('0x42')],{'$or':_[_0x88c5('0x2e')](_0x44f4e7[_0x88c5('0x3a')],function(_0x34af1c){var _0x333924={};_0x333924[_0x34af1c]={'$like':'%'+_0x3221ed['query']['filter']+'%'};return _0x333924;})});}if(_0x3221ed[_0x88c5('0x37')]['$gte']){var _0x1f64a2=_0x3221ed[_0x88c5('0x37')][_0x88c5('0x72')][_0x88c5('0xb2')](',');var _0x55f270={};_0x55f270[_0x1f64a2[0x0]]={'$gte':moment(_0x1f64a2[0x1])[_0x88c5('0x5c')](_0x88c5('0xb3'))};_0x44f4e7[_0x88c5('0x42')]=_[_0x88c5('0x93')](_0x44f4e7[_0x88c5('0x42')],_0x55f270);}_0x44f4e7=_[_0x88c5('0x93')]({},_0x44f4e7,_0x3221ed[_0x88c5('0xa8')]);return db[_0x88c5('0xad')][_0x88c5('0x22')]({'where':_0x44f4e7[_0x88c5('0x42')]})[_0x88c5('0x29')](function(_0x467a08){_0x185e7b[_0x88c5('0x22')]=_0x467a08;if(_0x3221ed[_0x88c5('0x37')]['includeAll']){_0x44f4e7[_0x88c5('0xa7')]=[{'all':!![]}];}return db[_0x88c5('0xad')]['findAll'](_0x44f4e7);})['then'](function(_0x5dc663){_0x185e7b['rows']=_0x5dc663;return _0x185e7b;});}})[_0x88c5('0x29')](respondWithFilteredResult(_0xd19181,_0x44f4e7))[_0x88c5('0x32')](handleError(_0xd19181,null));};exports['addTags']=function(_0x47e435,_0x5f37e0,_0x246b80){return db[_0x88c5('0x34')][_0x88c5('0xa9')]({'where':{'id':_0x47e435[_0x88c5('0xa5')]['id']}})[_0x88c5('0x29')](handleEntityNotFound(_0x5f37e0,null))['then'](function(_0x51a99b){if(_0x51a99b){return _0x51a99b[_0x88c5('0xb4')](_0x47e435[_0x88c5('0xaa')][_0x88c5('0xae')],_[_0x88c5('0xb5')](_0x47e435[_0x88c5('0xaa')],['ids','id'])||{})[_0x88c5('0xb6')](function(){return db[_0x88c5('0xb7')]['findAll']({'attributes':['id',_0x88c5('0x2c'),_0x88c5('0x45')],'where':{'id':_0x47e435[_0x88c5('0xaa')]['ids']}});})[_0x88c5('0x29')](function(_0x3b02d1){socket[_0x88c5('0xb8')](_0x88c5('0xb9'),{'id':Number(_0x47e435[_0x88c5('0xa5')]['id']),'tags':_0x3b02d1||[]});return{'id':Number(_0x47e435[_0x88c5('0xa5')]['id']),'tags':_0x3b02d1||[]};});}})['then'](respondWithResult(_0x5f37e0,null))[_0x88c5('0x32')](handleError(_0x5f37e0,null));};exports[_0x88c5('0xba')]=function(_0x3d945a,_0x2fc1e8,_0x1be851){return db[_0x88c5('0x34')][_0x88c5('0xa9')]({'where':{'id':_0x3d945a[_0x88c5('0xa5')]['id']}})['then'](handleEntityNotFound(_0x2fc1e8,null))[_0x88c5('0x29')](function(_0x5019a1){if(_0x5019a1){return _0x5019a1[_0x88c5('0xba')](_0x3d945a[_0x88c5('0x37')]['ids']);}})['then'](respondWithStatusCode(_0x2fc1e8,null))[_0x88c5('0x32')](handleError(_0x2fc1e8,null));};exports[_0x88c5('0xbb')]=function(_0x4d2227,_0x812830){var _0x449979=moment()['unix']()[_0x88c5('0x7a')]();var _0x125f4f=path['join'](config[_0x88c5('0xbc')],'server',_0x88c5('0xbd'),'tmp');var _0x13a67f=path[_0x88c5('0x7b')](config['root'],_0x88c5('0xbe'),_0x88c5('0xbd'),_0x88c5('0xbf'));var _0x215c42=path[_0x88c5('0x7b')](_0x125f4f,_0x449979);var _0x1bcf45=util[_0x88c5('0x5c')](_0x88c5('0xc0'),_0x4d2227[_0x88c5('0xa5')]['id'],_0x449979);var _0x459b4d=path[_0x88c5('0x7b')](_0x125f4f,_0x1bcf45);var _0x25fb17=![];return db[_0x88c5('0x34')]['find']({'where':{'id':_0x4d2227[_0x88c5('0xa5')]['id']},'include':[{'model':db['SmsMessage'],'as':_0x88c5('0xc1'),'attributes':['id','body','createdAt',_0x88c5('0xc2'),_0x88c5('0xc3')],'include':[{'model':db[_0x88c5('0xc4')],'as':'User','attributes':['id',_0x88c5('0xc5')],'raw':!![]},{'model':db[_0x88c5('0xc6')],'as':_0x88c5('0xc7'),'attributes':['id',_0x88c5('0xc8'),'lastName'],'raw':!![]}]},{'model':db['SmsAccount'],'as':_0x88c5('0xc9'),'attributes':['id',_0x88c5('0x2c')]},{'model':db[_0x88c5('0xc4')],'as':_0x88c5('0xca'),'attributes':['id',_0x88c5('0xc5')]}]})[_0x88c5('0x29')](handleEntityNotFound(_0x812830,null))[_0x88c5('0x29')](function(_0x16e7a2){if(_0x16e7a2){var _0x21cb24=_0x16e7a2['get']({'plain':!![]});_0x25fb17=!![];var _0x553250={'format':'A4','border':_0x88c5('0xcb'),'header':{'height':_0x88c5('0xcc'),'contents':{'first':_0x88c5('0xcd')}},'footer':{'height':'30px','contents':{'default':util['format'](_0x88c5('0xce'),util[_0x88c5('0x5c')]('%s\x20#%d','Sms',_0x21cb24['id']),moment()[_0x88c5('0x5c')](_0x88c5('0xcf'))[_0x88c5('0x7a')]())}}};fs['mkdirSync'](_0x215c42);var _0x369840={'channel':_0x88c5('0xd0'),'account':_0x21cb24['Account'][_0x88c5('0x2c')],'agent':_0x21cb24[_0x88c5('0xca')]?_0x21cb24[_0x88c5('0xca')][_0x88c5('0xc5')]:_0x88c5('0xd1'),'createdAt':moment(_0x21cb24[_0x88c5('0x58')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x88c5('0x7a')](),'closedAt':_0x21cb24[_0x88c5('0xd2')]?moment(_0x21cb24['closedAt'])[_0x88c5('0x5c')](_0x88c5('0xb3'))[_0x88c5('0x7a')]():'','disposition':_0x21cb24[_0x88c5('0xd3')],'messages':_(_0x21cb24[_0x88c5('0xc1')])[_0x88c5('0x6c')]({'secret':![]})[_0x88c5('0x2e')](function(_0x73e8a6){return{'date':moment(_0x73e8a6[_0x88c5('0x58')])[_0x88c5('0x5c')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x73e8a6['direction']===_0x88c5('0xd4')?_0x73e8a6['User']?_0x73e8a6[_0x88c5('0xc4')][_0x88c5('0xc5')]:'System':_0x73e8a6[_0x88c5('0xc7')]['firstName']+(_0x73e8a6[_0x88c5('0xc7')][_0x88c5('0xd5')]?'\x20'+_0x73e8a6[_0x88c5('0xc7')][_0x88c5('0xd5')]:''),'body':_0x73e8a6[_0x88c5('0xaa')],'direction':_0x73e8a6[_0x88c5('0xc2')]===_0x88c5('0xd4')?'A':'C','secret':_0x73e8a6[_0x88c5('0xc3')]};})[_0x88c5('0x59')]()};return ejs[_0x88c5('0xd6')](path[_0x88c5('0x7b')](config[_0x88c5('0xbc')],_0x88c5('0xbe'),_0x88c5('0xd7'),_0x88c5('0xd8')),{'interaction':_0x369840})[_0x88c5('0x29')](function(_0x31752d){return new BPromise(function(_0x2f58ac,_0x2ea466){pdf[_0x88c5('0xd9')](_0x31752d,_0x553250)[_0x88c5('0xda')](path[_0x88c5('0x7b')](_0x215c42,_0x88c5('0xdb')+_0x21cb24['id']+'-'+_0x449979+_0x88c5('0xdc')),function(_0x3e7298,_0x206c47){if(_0x3e7298)return _0x2ea466(_0x3e7298);_0x2f58ac(_0x206c47);});});});}})[_0x88c5('0x29')](function(){if(_0x25fb17){return new BPromise(function(_0x451271,_0xdb918){zipdir(_0x215c42,{'saveTo':_0x459b4d},function(_0x510dc5,_0x30265a){if(_0x510dc5)return _0xdb918(_0x510dc5);return _0x451271(_0x30265a);});})[_0x88c5('0x29')](function(){return new BPromise(function(_0x11d824,_0x2cd2d7){rimraf(_0x215c42,function(_0x4d80e6){if(_0x4d80e6)_0x2cd2d7(_0x4d80e6);return _0x11d824();});});})['then'](function(){return _0x812830[_0x88c5('0xbb')](_0x459b4d,_0x1bcf45,function(_0x96d835){if(_0x96d835){console[_0x88c5('0xdd')]('err',_0x96d835);}else{fs[_0x88c5('0xde')](_0x459b4d);}});});}else{return _0x812830[_0x88c5('0x1e')](0xc8);}})['catch'](handleError(_0x812830,null));}; \ No newline at end of file +var _0xcf3b=['System','Contact','lastName','views','toFile','transcript-','.pdf','log','err','html-pdf','eml-format','rimraf','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit','Content-Range','reject','save','then','destroy','stack','name','Users','map','TagIds','Tags','split','push','catch','SmsInteraction','rawAttributes','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','field','color','from','tools_tags','select','COUNT(*)','sms_messages','me.read\x20=\x20false','u.id','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','advancedFilter','forEach','createdAt','value','day','utc','format','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','TagId','isArray','length','\x20IN\x20?','and','tableAlias','\x20=\x20?','LIKE','ContactId','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','unreadMessages','c.firstName','isNil','isEmpty','i.SmsAccountId\x20IN\x20?','$gte','parse','null','\x20IS\x20NULL','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','DESC','group','i.id','Sequelize','QueryTypes','read','having','`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?','expr','mail_interaction_has_tags','`unreadMessages`\x20=\x200','sequelize','toString','count','merge','COUNT(me.id)','a.key','Account.key','i.*','Contact.firstName','Contact.lastName','c.phone','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','show','params','includeAll','include','find','create','body','update','describe','addMessage','SmsMessage','ids','findOne','YYYY-MM-DD\x20HH:mm:ss','options','addTags','setTags','spread','Tag','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Messages','direction','secret','User','fullname','CmContact','firstName','SmsAccount','Account','get','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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','YYYY-MM-DD','mkdirSync','Sms','Owner','N.A.','closed','out'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcf3b,0xe2));var _0xbcf3=function(_0x7380ea,_0x57a24d){_0x7380ea=_0x7380ea-0x0;var _0x2611dd=_0xcf3b[_0x7380ea];return _0x2611dd;};'use strict';var pdf=require(_0xbcf3('0x0'));var emlformat=require(_0xbcf3('0x1'));var rimraf=require(_0xbcf3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbcf3('0x3'));var BPromise=require(_0xbcf3('0x4'));var Mustache=require(_0xbcf3('0x5'));var util=require(_0xbcf3('0x6'));var path=require(_0xbcf3('0x7'));var sox=require('sox');var csv=require(_0xbcf3('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbcf3('0x9'));var squel=require(_0xbcf3('0xa'));var crypto=require(_0xbcf3('0xb'));var jsforce=require(_0xbcf3('0xc'));var deskjs=require(_0xbcf3('0xd'));var toCsv=require(_0xbcf3('0x8'));var querystring=require(_0xbcf3('0xe'));var Papa=require(_0xbcf3('0xf'));var Redis=require(_0xbcf3('0x10'));var authService=require(_0xbcf3('0x11'));var qs=require(_0xbcf3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbcf3('0x13'))(_0xbcf3('0x14'));var utils=require(_0xbcf3('0x15'));var config=require(_0xbcf3('0x16'));var db=require('../../mysqldb')['db'];config[_0xbcf3('0x17')]=_[_0xbcf3('0x18')](config[_0xbcf3('0x17')],{'host':_0xbcf3('0x19'),'port':0x18eb});var socket=require(_0xbcf3('0x1a'))(new Redis(config['redis']));require(_0xbcf3('0x1b'))[_0xbcf3('0x1c')](socket);function respondWithStatusCode(_0x3441d4,_0x1e6f65){_0x1e6f65=_0x1e6f65||0xcc;return function(_0x16e3eb){if(_0x16e3eb){return _0x3441d4[_0xbcf3('0x1d')](_0x1e6f65);}return _0x3441d4[_0xbcf3('0x1e')](_0x1e6f65)[_0xbcf3('0x1f')]();};}function respondWithResult(_0x1cb611,_0xc952da){_0xc952da=_0xc952da||0xc8;return function(_0x32c482){if(_0x32c482){return _0x1cb611[_0xbcf3('0x1e')](_0xc952da)[_0xbcf3('0x20')](_0x32c482);}};}function respondWithFilteredResult(_0x56a1ab,_0x771d9d){return function(_0x4ffcdc){if(_0x4ffcdc){var _0x35159a=_0x4ffcdc['count'],_0xbf7460=_0x771d9d[_0xbcf3('0x21')],_0x56b61e=_0x771d9d[_0xbcf3('0x21')]+_0x771d9d[_0xbcf3('0x22')],_0x5139c5;if(_0x56b61e>=_0x35159a){_0x56b61e=_0x35159a;_0x5139c5=0xc8;}else{_0x5139c5=0xce;}_0x56a1ab['status'](_0x5139c5);return _0x56a1ab['set'](_0xbcf3('0x23'),_0xbf7460+'-'+_0x56b61e+'/'+_0x35159a)[_0xbcf3('0x20')](_0x4ffcdc);}return null;};}function patchUpdates(_0x3f8cbe){return function(_0x269c3a){try{jsonpatch['apply'](_0x269c3a,_0x3f8cbe,!![]);}catch(_0xb3b456){return BPromise[_0xbcf3('0x24')](_0xb3b456);}return _0x269c3a[_0xbcf3('0x25')]();};}function saveUpdates(_0x376c70,_0x24c06c){return function(_0x58a56d){if(_0x58a56d){return _0x58a56d['update'](_0x376c70)[_0xbcf3('0x26')](function(_0x176d42){return _0x176d42;});}return null;};}function removeEntity(_0x5640bd,_0x43344b){return function(_0x322015){if(_0x322015){return _0x322015[_0xbcf3('0x27')]()['then'](function(){_0x5640bd['status'](0xcc)[_0xbcf3('0x1f')]();});}};}function handleEntityNotFound(_0x233aa7,_0x522f21){return function(_0x3d796b){if(!_0x3d796b){_0x233aa7['sendStatus'](0x194);}return _0x3d796b;};}function handleError(_0x2ce4b4,_0x332267){_0x332267=_0x332267||0x1f4;return function(_0x3d098c){logger['error'](_0x3d098c[_0xbcf3('0x28')]);if(_0x3d098c[_0xbcf3('0x29')]){delete _0x3d098c[_0xbcf3('0x29')];}_0x2ce4b4[_0xbcf3('0x1e')](_0x332267)['send'](_0x3d098c);};}function getInteractionUsers(_0x25eb4d,_0x17eb87){return new BPromise(function(_0x5f0c3d,_0x5d16c4){try{if(_0x17eb87[_0x25eb4d['id']]){_0x25eb4d[_0xbcf3('0x2a')]=_[_0xbcf3('0x2b')](_0x17eb87[_0x25eb4d['id']],function(_0x16b7da){return{'id':_0x16b7da['id']};});}}catch(_0x133a0a){_0x5d16c4(_0x133a0a);}_0x5f0c3d(_0x25eb4d);});}function getInteractionTags(_0x3322ce,_0x3c14bd){return new BPromise(function(_0x3799c4,_0x18d639){try{if(_0x3322ce[_0xbcf3('0x2c')]){_0x3322ce[_0xbcf3('0x2d')]=[];_0x3322ce[_0xbcf3('0x2c')][_0xbcf3('0x2e')](',')['forEach'](function(_0x4986fd){_0x3322ce[_0xbcf3('0x2d')][_0xbcf3('0x2f')](_0x3c14bd[_0x4986fd]);});}delete _0x3322ce[_0xbcf3('0x2c')];}catch(_0x1264a1){_0x18d639(_0x1264a1);}_0x3799c4(_0x3322ce);});}function updateSmsInteraction(_0x34003e,_0x5c2bd1,_0x5dda3f){return new BPromise(function(_0x1fb5e3,_0x5cfc97){return getInteractionUsers(_0x34003e,_0x5dda3f)['then'](function(_0x5149ec){return getInteractionTags(_0x5149ec,_0x5c2bd1);})[_0xbcf3('0x26')](function(_0x57895f){_0x1fb5e3(_0x57895f);})[_0xbcf3('0x30')](function(_0x56f3fe){_0x5cfc97(_0x56f3fe);});});}exports['index']=function(_0x2d0333,_0x14023c){var _0x12df92={},_0x45a1e7={},_0x46bb4b={'count':0x0,'rows':[]};var _0x3b49ec=db[_0xbcf3('0x31')][_0xbcf3('0x32')];_0x45a1e7['model']=_[_0xbcf3('0x33')](_0x3b49ec);_0x45a1e7[_0xbcf3('0x34')]=_[_0xbcf3('0x33')](_0x2d0333[_0xbcf3('0x34')]);_0x45a1e7['filters']=_[_0xbcf3('0x35')](_0x45a1e7[_0xbcf3('0x36')],_0x45a1e7[_0xbcf3('0x34')]);_0x12df92[_0xbcf3('0x37')]=_[_0xbcf3('0x35')](_0x45a1e7[_0xbcf3('0x36')],qs[_0xbcf3('0x38')](_0x2d0333[_0xbcf3('0x34')]['fields']));_0x12df92[_0xbcf3('0x37')]=_0x12df92[_0xbcf3('0x37')]['length']?_0x12df92[_0xbcf3('0x37')]:_0x45a1e7[_0xbcf3('0x36')];if(!_0x2d0333[_0xbcf3('0x34')][_0xbcf3('0x39')](_0xbcf3('0x3a'))){_0x12df92[_0xbcf3('0x22')]=qs[_0xbcf3('0x22')](_0x2d0333[_0xbcf3('0x34')]['limit']);_0x12df92[_0xbcf3('0x21')]=qs[_0xbcf3('0x21')](_0x2d0333[_0xbcf3('0x34')][_0xbcf3('0x21')]);}_0x12df92[_0xbcf3('0x3b')]=qs['sort'](_0x2d0333[_0xbcf3('0x34')][_0xbcf3('0x3c')]);_0x12df92[_0xbcf3('0x3d')]=qs[_0xbcf3('0x3e')](_[_0xbcf3('0x3f')](_0x2d0333[_0xbcf3('0x34')],_0x45a1e7[_0xbcf3('0x3e')]));var _0x381b9=[];var _0x4e8589=squel['select']()[_0xbcf3('0x40')]('id')[_0xbcf3('0x40')]('name')[_0xbcf3('0x40')](_0xbcf3('0x41'))[_0xbcf3('0x42')](_0xbcf3('0x43'));var _0x4197f=squel[_0xbcf3('0x44')]()[_0xbcf3('0x40')](_0xbcf3('0x45'))[_0xbcf3('0x42')](_0xbcf3('0x46'),'me')['where']('me.SmsInteractionId\x20=\x20i.id')[_0xbcf3('0x3d')]('me.direction\x20=\x20\x27in\x27')['where'](_0xbcf3('0x47'));var _0x54f632=squel['select']()[_0xbcf3('0x40')](_0xbcf3('0x48'))[_0xbcf3('0x40')](_0xbcf3('0x49'))[_0xbcf3('0x42')](_0xbcf3('0x4a'),'ui')[_0xbcf3('0x4b')](_0xbcf3('0x4c'),'u','u.id\x20=\x20ui.UserId');var _0x580537=squel[_0xbcf3('0x44')]()[_0xbcf3('0x42')](_0xbcf3('0x4d'),'i')[_0xbcf3('0x4b')]('cm_contacts','c',_0xbcf3('0x4e'))[_0xbcf3('0x4b')]('users','o','o.id\x20=\x20i.UserId')['left_join'](_0xbcf3('0x4f'),'a',_0xbcf3('0x50'))[_0xbcf3('0x4b')](_0xbcf3('0x46'),'me',_0xbcf3('0x51'));var _0x44769f=squel['expr']();if(_0x2d0333[_0xbcf3('0x34')][_0xbcf3('0x52')]){var _0x4217f5=JSON['parse'](_0x2d0333['query'][_0xbcf3('0x52')]);_[_0xbcf3('0x33')](_0x4217f5)[_0xbcf3('0x53')](function(_0x6e0063){var _0x10bd34=_0x4217f5[_0x6e0063];if(_0x6e0063===_0xbcf3('0x54')){var _0x1f443a=moment(_0x10bd34[_0xbcf3('0x55')]['dateStart'])['startOf'](_0xbcf3('0x56'))[_0xbcf3('0x57')]()[_0xbcf3('0x58')]();var _0x4fe6d1=moment(_0x4fe6d1)[_0xbcf3('0x57')]()['endOf'](_0xbcf3('0x56'))[_0xbcf3('0x58')]();_0x44769f['and'](_0xbcf3('0x59'),_0x1f443a,_0x4fe6d1);}else{if(_['isArray'](_0x10bd34[_0xbcf3('0x5a')])){_0x10bd34[_0xbcf3('0x5a')][_0xbcf3('0x53')](function(_0xb6d174){switch(_0x10bd34[_0xbcf3('0x5a')][_0xbcf3('0x55')]){case'IS':if(_0x6e0063!==_0xbcf3('0x5b')&&_0x6e0063!=='unreadMessages'){if(_[_0xbcf3('0x5c')](_0x10bd34['value'])&&_0x10bd34[_0xbcf3('0x55')][_0xbcf3('0x5d')]>0x1){_0x44769f['and'](_0x10bd34['tableAlias']+'.'+_0x6e0063+_0xbcf3('0x5e'),_0x10bd34[_0xbcf3('0x55')]);}else{_0x44769f[_0xbcf3('0x5f')](_0x10bd34[_0xbcf3('0x60')]+'.'+_0x6e0063+_0xbcf3('0x61'),_0x10bd34[_0xbcf3('0x55')][0x0]);}}break;case'=':_0x44769f[_0xbcf3('0x5f')](_0x10bd34[_0xbcf3('0x60')]+'.'+_0x6e0063+_0xbcf3('0x61'),_0x10bd34[_0xbcf3('0x55')]);break;case _0xbcf3('0x62'):if(_0x6e0063===_0xbcf3('0x63')){_0x44769f['and']('c.firstName'+_0xbcf3('0x64'),'%'+_0x10bd34[_0xbcf3('0x55')]+'%');_0x44769f['or'](_0xbcf3('0x65')+'\x20LIKE\x20?','%'+_0x10bd34[_0xbcf3('0x55')]+'%');_0x44769f['or'](_0xbcf3('0x66')+'\x20LIKE\x20?','%'+_0x10bd34[_0xbcf3('0x55')]+'%');}else{_0x44769f['and'](_0x10bd34[_0xbcf3('0x60')]+'.'+_0x6e0063+'\x20LIKE\x20?','%'+_0x10bd34[_0xbcf3('0x55')]+'%');}break;case'>':_0x44769f[_0xbcf3('0x5f')](_0x10bd34[_0xbcf3('0x60')]+'.'+_0x6e0063+_0xbcf3('0x67'),_0x10bd34[_0xbcf3('0x55')]);break;case'<':_0x44769f[_0xbcf3('0x5f')](_0x10bd34[_0xbcf3('0x60')]+'.'+_0x6e0063+_0xbcf3('0x68'),_0x10bd34[_0xbcf3('0x55')]);break;}});}else{switch(_0x10bd34[_0xbcf3('0x5a')][_0xbcf3('0x55')]){case'IS':if(_0x6e0063!==_0xbcf3('0x5b')&&_0x6e0063!==_0xbcf3('0x69')){if(_[_0xbcf3('0x5c')](_0x10bd34[_0xbcf3('0x55')])&&_0x10bd34[_0xbcf3('0x55')]['length']>0x1){_0x44769f[_0xbcf3('0x5f')](_0x10bd34[_0xbcf3('0x60')]+'.'+_0x6e0063+_0xbcf3('0x5e'),_0x10bd34[_0xbcf3('0x55')]);}else{_0x44769f[_0xbcf3('0x5f')](_0x10bd34[_0xbcf3('0x60')]+'.'+_0x6e0063+_0xbcf3('0x61'),_0x10bd34['value'][0x0]);}}break;case'=':_0x44769f['and'](_0x10bd34[_0xbcf3('0x60')]+'.'+_0x6e0063+_0xbcf3('0x61'),_0x10bd34[_0xbcf3('0x55')]);break;case'LIKE':if(_0x6e0063==='ContactId'){_0x44769f[_0xbcf3('0x5f')](_0xbcf3('0x6a')+'\x20LIKE\x20?','%'+_0x10bd34['value']+'%');_0x44769f['or'](_0xbcf3('0x65')+_0xbcf3('0x64'),'%'+_0x10bd34['value']+'%');_0x44769f['or'](_0xbcf3('0x66')+'\x20LIKE\x20?','%'+_0x10bd34[_0xbcf3('0x55')]+'%');}else{_0x44769f[_0xbcf3('0x5f')](_0x10bd34[_0xbcf3('0x60')]+'.'+_0x6e0063+_0xbcf3('0x64'),'%'+_0x10bd34[_0xbcf3('0x55')]+'%');}break;case'>':_0x44769f[_0xbcf3('0x5f')](_0x10bd34[_0xbcf3('0x60')]+'.'+_0x6e0063+'\x20>\x20?',_0x10bd34[_0xbcf3('0x55')]);break;case'<':_0x44769f[_0xbcf3('0x5f')](_0x10bd34[_0xbcf3('0x60')]+'.'+_0x6e0063+_0xbcf3('0x68'),_0x10bd34[_0xbcf3('0x55')]);break;}}}});}else{var _0x4d00fe=_(Object[_0xbcf3('0x33')](_0x2d0333['query']))[_0xbcf3('0x2b')](function(_0x5732b2){return _0x3b49ec[_0xbcf3('0x39')](_0x5732b2)?_0x5732b2:undefined;})['filter'](function(_0x407ae6){return!_[_0xbcf3('0x6b')](_0x407ae6);})[_0xbcf3('0x55')]();if(!_[_0xbcf3('0x6c')](_0x4d00fe)){_0x4d00fe[_0xbcf3('0x53')](function(_0x16858f){if(_0x16858f==='SmsAccountId'){_0x580537['where'](_0xbcf3('0x6d'),[]['concat'](_0x2d0333['query'][_0x16858f]));}else if(_0x16858f===_0xbcf3('0x54')){var _0x443454=JSON['parse'](_0x2d0333['query'][_0x16858f])[_0xbcf3('0x6e')];var _0x176b08=JSON[_0xbcf3('0x6f')](_0x2d0333[_0xbcf3('0x34')][_0x16858f])['$lte'];_0x580537[_0xbcf3('0x3d')](_0xbcf3('0x59'),_0x443454,_0x176b08);}else{if(_0x2d0333['query'][_0x16858f]===_0xbcf3('0x70')){_0x580537[_0xbcf3('0x3d')]('i.'+_0x16858f+_0xbcf3('0x71'));}else{_0x580537[_0xbcf3('0x3d')]('i.'+_0x16858f+_0xbcf3('0x61'),_0x2d0333[_0xbcf3('0x34')][_0x16858f]);}}});}if(_0x2d0333[_0xbcf3('0x34')][_0xbcf3('0x72')]){var _0x10a6be=_0x2d0333[_0xbcf3('0x34')][_0xbcf3('0x72')][_0xbcf3('0x73')]('\x5c','\x5c\x5c')[_0xbcf3('0x73')]('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x10a6be)){_0x44769f['or'](_0xbcf3('0x74'),_0x10a6be+'%')['or'](_0xbcf3('0x75'),_0x10a6be+'%');}else{var _0x33240e=[];_0x10a6be[_0xbcf3('0x2e')]('\x20')[_0xbcf3('0x53')](function(_0x5af493){_0x33240e[_0xbcf3('0x2f')]('+'+_0x5af493['toString']());});var _0x28eaeb=_0x33240e['join']('\x20');_0x44769f['or'](_0xbcf3('0x76'),_0x28eaeb)['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x10a6be+'%');}}}_0x580537['where'](_0x44769f);if(_0x12df92['order']){_0x12df92['order']['forEach'](function(_0xc91ec3){_0x580537[_0xbcf3('0x3b')]('i.'+_0xc91ec3[0x0],_0xc91ec3[0x1]===_0xbcf3('0x77')?![]:!![]);});}_0x580537[_0xbcf3('0x78')](_0xbcf3('0x79'));var _0x4b353c={'type':db[_0xbcf3('0x7a')][_0xbcf3('0x7b')]['SELECT'],'raw':!![]};var _0x54ddda=_0x580537['clone']()[_0xbcf3('0x40')](_0xbcf3('0x45'))['field']('COUNT(me.id)',_0xbcf3('0x69'));if(!_0x2d0333[_0xbcf3('0x34')]['advancedFilter']){if(_0x2d0333[_0xbcf3('0x34')][_0xbcf3('0x7c')]){if(_0x2d0333[_0xbcf3('0x34')][_0xbcf3('0x7c')]==0x1){_0x54ddda[_0xbcf3('0x7d')]('`unreadMessages`\x20=\x200');_0x580537['having']('`unreadMessages`\x20=\x200');}else{_0x54ddda[_0xbcf3('0x7d')](_0xbcf3('0x7e'));_0x580537[_0xbcf3('0x7d')](_0xbcf3('0x7e'));}}if(_0x2d0333[_0xbcf3('0x34')][_0xbcf3('0x7f')]){var _0x38cd0e=_[_0xbcf3('0x5c')](_0x2d0333[_0xbcf3('0x34')][_0xbcf3('0x7f')])?_0x2d0333[_0xbcf3('0x34')]['tag']:new Array(_0x2d0333['query'][_0xbcf3('0x7f')]);var _0x3f8c89=squel['expr']();_0x38cd0e[_0xbcf3('0x53')](function(_0x28bb20){_0x3f8c89['or'](_0xbcf3('0x80'),'%,'+_0x28bb20+',%');});_0x580537[_0xbcf3('0x7d')](_0x3f8c89);_0x54ddda['left_join'](_0xbcf3('0x81'),'it',_0xbcf3('0x82'));_0x54ddda['left_join'](_0xbcf3('0x43'),'t',_0xbcf3('0x83'));_0x54ddda['where'](_0xbcf3('0x84'),_0x38cd0e);}}else{var _0x4217f5=JSON[_0xbcf3('0x6f')](_0x2d0333['query'][_0xbcf3('0x52')]);_['keys'](_0x4217f5)[_0xbcf3('0x53')](function(_0x786312){var _0x265310=_0x4217f5[_0x786312];if(_0x786312==='TagId'){var _0xd0bfe7=_0x265310[_0xbcf3('0x55')];var _0x2c8adb=squel[_0xbcf3('0x85')]();_0xd0bfe7['forEach'](function(_0x214ee1){_0x2c8adb['or'](_0xbcf3('0x80'),'%,'+_0x214ee1+',%');});_0x580537[_0xbcf3('0x7d')](_0x2c8adb);_0x54ddda[_0xbcf3('0x4b')](_0xbcf3('0x86'),'it','it.MailInteractionId\x20=\x20i.id');_0x54ddda[_0xbcf3('0x4b')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x54ddda['where']('t.id\x20IN\x20?',_0xd0bfe7);}else if(_0x786312==='unreadMessages'){if(_0x265310['value']['length']===0x1){if(_0x265310[_0xbcf3('0x55')][0x0]===0x1){_0x54ddda[_0xbcf3('0x7d')](_0xbcf3('0x87'));_0x580537[_0xbcf3('0x7d')](_0xbcf3('0x87'));}else{_0x54ddda['having']('`unreadMessages`\x20>\x200');_0x580537[_0xbcf3('0x7d')](_0xbcf3('0x7e'));}}}});}db[_0xbcf3('0x88')][_0xbcf3('0x34')](_0x54ddda[_0xbcf3('0x89')](),_0x4b353c)[_0xbcf3('0x26')](function(_0x31eb5c){_0x46bb4b[_0xbcf3('0x8a')]=_0x31eb5c[_0xbcf3('0x5d')];if(_0x46bb4b['count']===0x0)return[];return db[_0xbcf3('0x88')][_0xbcf3('0x34')](_0x4e8589[_0xbcf3('0x89')](),_0x4b353c)[_0xbcf3('0x26')](function(_0xb855f3){_0x381b9=_['keyBy'](_0xb855f3,'id');_0x4b353c=_[_0xbcf3('0x8b')](_0x4b353c,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x580537[_0xbcf3('0x40')](_0xbcf3('0x8c'),_0xbcf3('0x69'));_0x580537[_0xbcf3('0x40')](_0xbcf3('0x8d'),_0xbcf3('0x8e'));_0x580537[_0xbcf3('0x40')](_0xbcf3('0x8f'));_0x580537[_0xbcf3('0x40')](_0xbcf3('0x6a'),_0xbcf3('0x90'));_0x580537[_0xbcf3('0x40')](_0xbcf3('0x65'),_0xbcf3('0x91'));_0x580537['field'](_0xbcf3('0x66'),'Contact.email');_0x580537[_0xbcf3('0x40')](_0xbcf3('0x92'),'Contact.phone');_0x580537['field']('c.mobile',_0xbcf3('0x93'));_0x580537[_0xbcf3('0x40')](_0xbcf3('0x94'),_0xbcf3('0x95'));_0x580537[_0xbcf3('0x40')](_0xbcf3('0x96'),'TagIds');_0x580537[_0xbcf3('0x4b')](_0xbcf3('0x81'),'it',_0xbcf3('0x82'));_0x580537[_0xbcf3('0x4b')](_0xbcf3('0x43'),'t',_0xbcf3('0x83'));_0x580537[_0xbcf3('0x22')](_0x12df92[_0xbcf3('0x22')]);_0x580537[_0xbcf3('0x21')](_0x12df92[_0xbcf3('0x21')]);return db['sequelize'][_0xbcf3('0x34')](_0x580537[_0xbcf3('0x89')](),_0x4b353c);})['then'](function(_0x6ffbf5){_0x54f632['where'](_0xbcf3('0x97'),_[_0xbcf3('0x2b')](_0x6ffbf5,'id'));return db[_0xbcf3('0x88')][_0xbcf3('0x34')](_0x54f632[_0xbcf3('0x89')](),_0x4b353c)[_0xbcf3('0x26')](function(_0x17ad5c){var _0x35d5f7=_[_0xbcf3('0x98')](_0x17ad5c,_0xbcf3('0x99'));var _0x29a241=[];_0x6ffbf5[_0xbcf3('0x53')](function(_0x13960d){_0x29a241[_0xbcf3('0x2f')](updateSmsInteraction(_0x13960d,_0x381b9,_0x35d5f7));});return BPromise[_0xbcf3('0x9a')](_0x29a241);});});})[_0xbcf3('0x26')](function(_0x53e122){_0x46bb4b['rows']=_0x53e122;return _0x46bb4b;})[_0xbcf3('0x26')](respondWithFilteredResult(_0x14023c,_0x12df92))[_0xbcf3('0x30')](handleError(_0x14023c,null));};exports[_0xbcf3('0x9b')]=function(_0x3e4126,_0x1b5cf9){var _0xa180d6={'raw':![],'where':{'id':_0x3e4126[_0xbcf3('0x9c')]['id']}},_0x1c8331={};_0x1c8331[_0xbcf3('0x36')]=_[_0xbcf3('0x33')](db[_0xbcf3('0x31')]['rawAttributes']);_0x1c8331[_0xbcf3('0x34')]=_[_0xbcf3('0x33')](_0x3e4126[_0xbcf3('0x34')]);_0x1c8331[_0xbcf3('0x3e')]=_[_0xbcf3('0x35')](_0x1c8331[_0xbcf3('0x36')],_0x1c8331[_0xbcf3('0x34')]);_0xa180d6['attributes']=_[_0xbcf3('0x35')](_0x1c8331['model'],qs['fields'](_0x3e4126[_0xbcf3('0x34')][_0xbcf3('0x38')]));_0xa180d6['attributes']=_0xa180d6[_0xbcf3('0x37')][_0xbcf3('0x5d')]?_0xa180d6[_0xbcf3('0x37')]:_0x1c8331[_0xbcf3('0x36')];if(_0x3e4126['query'][_0xbcf3('0x9d')]){_0xa180d6[_0xbcf3('0x9e')]=[{'all':!![]}];}_0xa180d6=_[_0xbcf3('0x8b')]({},_0xa180d6,_0x3e4126['options']);return db[_0xbcf3('0x31')][_0xbcf3('0x9f')](_0xa180d6)[_0xbcf3('0x26')](handleEntityNotFound(_0x1b5cf9,null))['then'](respondWithResult(_0x1b5cf9,null))['catch'](handleError(_0x1b5cf9,null));};exports['create']=function(_0x209d9d,_0x1fb867){return db[_0xbcf3('0x31')][_0xbcf3('0xa0')](_0x209d9d[_0xbcf3('0xa1')],{})[_0xbcf3('0x26')](respondWithResult(_0x1fb867,0xc9))[_0xbcf3('0x30')](handleError(_0x1fb867,null));};exports[_0xbcf3('0xa2')]=function(_0x405353,_0x14ee90){if(_0x405353[_0xbcf3('0xa1')]['id']){delete _0x405353['body']['id'];}return db[_0xbcf3('0x31')]['find']({'where':{'id':_0x405353['params']['id']}})['then'](handleEntityNotFound(_0x14ee90,null))[_0xbcf3('0x26')](saveUpdates(_0x405353['body'],null))[_0xbcf3('0x26')](respondWithResult(_0x14ee90,null))[_0xbcf3('0x30')](handleError(_0x14ee90,null));};exports[_0xbcf3('0x27')]=function(_0x387a47,_0x133c7a){return db['SmsInteraction']['find']({'where':{'id':_0x387a47[_0xbcf3('0x9c')]['id']}})[_0xbcf3('0x26')](handleEntityNotFound(_0x133c7a,null))[_0xbcf3('0x26')](removeEntity(_0x133c7a,null))['catch'](handleError(_0x133c7a,null));};exports[_0xbcf3('0xa3')]=function(_0x3a9127,_0xb6c6d0){return db[_0xbcf3('0x31')]['describe']()[_0xbcf3('0x26')](respondWithResult(_0xb6c6d0,null))['catch'](handleError(_0xb6c6d0,null));};exports[_0xbcf3('0xa4')]=function(_0x8c46de,_0x40e439,_0x479a24){return db[_0xbcf3('0xa5')][_0xbcf3('0x9f')]({'where':{'id':_0x8c46de[_0xbcf3('0x9c')]['id']}})[_0xbcf3('0x26')](handleEntityNotFound(_0x40e439,null))['then'](function(_0x258408){if(_0x258408){return _0x258408['addMessage'](_0x8c46de[_0xbcf3('0xa1')][_0xbcf3('0xa6')],_['omit'](_0x8c46de['body'],['ids','id'])||{});}})[_0xbcf3('0x26')](respondWithResult(_0x40e439,null))['catch'](handleError(_0x40e439,null));};exports['getMessages']=function(_0x2a30ca,_0x4867fe,_0x293655){var _0x4a73cb={'raw':![],'where':{}};var _0x3418e8={};var _0x2d4ac4={'count':0x0,'rows':[]};return db[_0xbcf3('0x31')][_0xbcf3('0xa7')]({'where':{'id':_0x2a30ca[_0xbcf3('0x9c')]['id']}})[_0xbcf3('0x26')](handleEntityNotFound(_0x4867fe,null))[_0xbcf3('0x26')](function(_0x2346e8){if(_0x2346e8){_0x3418e8[_0xbcf3('0x36')]=_['keys'](db[_0xbcf3('0xa5')][_0xbcf3('0x32')]);_0x3418e8[_0xbcf3('0x34')]=_[_0xbcf3('0x33')](_0x2a30ca['query']);_0x3418e8[_0xbcf3('0x3e')]=_[_0xbcf3('0x35')](_0x3418e8[_0xbcf3('0x36')],_0x3418e8[_0xbcf3('0x34')]);_0x4a73cb[_0xbcf3('0x37')]=_['intersection'](_0x3418e8[_0xbcf3('0x36')],qs[_0xbcf3('0x38')](_0x2a30ca[_0xbcf3('0x34')][_0xbcf3('0x38')]));_0x4a73cb[_0xbcf3('0x37')]=_0x4a73cb[_0xbcf3('0x37')][_0xbcf3('0x5d')]?_0x4a73cb[_0xbcf3('0x37')]:_0x3418e8['model'];if(!_0x2a30ca[_0xbcf3('0x34')]['hasOwnProperty'](_0xbcf3('0x3a'))){_0x4a73cb[_0xbcf3('0x22')]=qs[_0xbcf3('0x22')](_0x2a30ca['query'][_0xbcf3('0x22')]);_0x4a73cb[_0xbcf3('0x21')]=qs['offset'](_0x2a30ca[_0xbcf3('0x34')][_0xbcf3('0x21')]);}_0x4a73cb['order']=qs[_0xbcf3('0x3c')](_0x2a30ca[_0xbcf3('0x34')]['sort']);_0x4a73cb[_0xbcf3('0x3d')]=qs[_0xbcf3('0x3e')](_[_0xbcf3('0x3f')](_0x2a30ca[_0xbcf3('0x34')],_0x3418e8[_0xbcf3('0x3e')]));_0x4a73cb[_0xbcf3('0x3d')]['SmsInteractionId']=_0x2346e8['id'];if(_0x2a30ca[_0xbcf3('0x34')][_0xbcf3('0x72')]){_0x4a73cb[_0xbcf3('0x3d')]=_[_0xbcf3('0x8b')](_0x4a73cb[_0xbcf3('0x3d')],{'$or':_[_0xbcf3('0x2b')](_0x4a73cb['attributes'],function(_0x132cc8){var _0x2ae914={};_0x2ae914[_0x132cc8]={'$like':'%'+_0x2a30ca[_0xbcf3('0x34')][_0xbcf3('0x72')]+'%'};return _0x2ae914;})});}if(_0x2a30ca['query']['$gte']){var _0x43e2fc=_0x2a30ca['query'][_0xbcf3('0x6e')][_0xbcf3('0x2e')](',');var _0x331c8b={};_0x331c8b[_0x43e2fc[0x0]]={'$gte':moment(_0x43e2fc[0x1])['format'](_0xbcf3('0xa8'))};_0x4a73cb[_0xbcf3('0x3d')]=_[_0xbcf3('0x8b')](_0x4a73cb['where'],_0x331c8b);}_0x4a73cb=_[_0xbcf3('0x8b')]({},_0x4a73cb,_0x2a30ca[_0xbcf3('0xa9')]);return db['SmsMessage'][_0xbcf3('0x8a')]({'where':_0x4a73cb['where']})[_0xbcf3('0x26')](function(_0xc950f){_0x2d4ac4['count']=_0xc950f;if(_0x2a30ca[_0xbcf3('0x34')][_0xbcf3('0x9d')]){_0x4a73cb[_0xbcf3('0x9e')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x4a73cb);})[_0xbcf3('0x26')](function(_0x21e9d5){_0x2d4ac4['rows']=_0x21e9d5;return _0x2d4ac4;});}})[_0xbcf3('0x26')](respondWithFilteredResult(_0x4867fe,_0x4a73cb))['catch'](handleError(_0x4867fe,null));};exports[_0xbcf3('0xaa')]=function(_0x3b6a99,_0x19311c,_0x39d014){return db[_0xbcf3('0x31')][_0xbcf3('0x9f')]({'where':{'id':_0x3b6a99[_0xbcf3('0x9c')]['id']}})[_0xbcf3('0x26')](handleEntityNotFound(_0x19311c,null))[_0xbcf3('0x26')](function(_0x2bdb13){if(_0x2bdb13){return _0x2bdb13[_0xbcf3('0xab')](_0x3b6a99[_0xbcf3('0xa1')][_0xbcf3('0xa6')],_['omit'](_0x3b6a99[_0xbcf3('0xa1')],[_0xbcf3('0xa6'),'id'])||{})[_0xbcf3('0xac')](function(){return db[_0xbcf3('0xad')]['findAll']({'attributes':['id',_0xbcf3('0x29'),_0xbcf3('0x41')],'where':{'id':_0x3b6a99[_0xbcf3('0xa1')][_0xbcf3('0xa6')]}});})[_0xbcf3('0x26')](function(_0xe45a46){socket[_0xbcf3('0xae')](_0xbcf3('0xaf'),{'id':Number(_0x3b6a99[_0xbcf3('0x9c')]['id']),'tags':_0xe45a46||[]});return{'id':Number(_0x3b6a99[_0xbcf3('0x9c')]['id']),'tags':_0xe45a46||[]};});}})['then'](respondWithResult(_0x19311c,null))[_0xbcf3('0x30')](handleError(_0x19311c,null));};exports[_0xbcf3('0xb0')]=function(_0x48ca45,_0x957909,_0x10b555){return db[_0xbcf3('0x31')]['find']({'where':{'id':_0x48ca45[_0xbcf3('0x9c')]['id']}})['then'](handleEntityNotFound(_0x957909,null))[_0xbcf3('0x26')](function(_0x1beaca){if(_0x1beaca){return _0x1beaca[_0xbcf3('0xb0')](_0x48ca45[_0xbcf3('0x34')]['ids']);}})['then'](respondWithStatusCode(_0x957909,null))[_0xbcf3('0x30')](handleError(_0x957909,null));};exports[_0xbcf3('0xb1')]=function(_0x1645cf,_0x5d90d1){var _0xceed06=moment()[_0xbcf3('0xb2')]()[_0xbcf3('0x89')]();var _0x2b166c=path[_0xbcf3('0xb3')](config[_0xbcf3('0xb4')],_0xbcf3('0xb5'),_0xbcf3('0xb6'),_0xbcf3('0xb7'));var _0xc13ab2=path[_0xbcf3('0xb3')](config[_0xbcf3('0xb4')],'server',_0xbcf3('0xb6'),_0xbcf3('0xb8'));var _0x4215af=path[_0xbcf3('0xb3')](_0x2b166c,_0xceed06);var _0x3cfe7b=util['format'](_0xbcf3('0xb9'),_0x1645cf[_0xbcf3('0x9c')]['id'],_0xceed06);var _0x3555bb=path[_0xbcf3('0xb3')](_0x2b166c,_0x3cfe7b);var _0x502c52=![];return db[_0xbcf3('0x31')][_0xbcf3('0x9f')]({'where':{'id':_0x1645cf['params']['id']},'include':[{'model':db[_0xbcf3('0xa5')],'as':_0xbcf3('0xba'),'attributes':['id',_0xbcf3('0xa1'),_0xbcf3('0x54'),_0xbcf3('0xbb'),_0xbcf3('0xbc')],'include':[{'model':db[_0xbcf3('0xbd')],'as':'User','attributes':['id',_0xbcf3('0xbe')],'raw':!![]},{'model':db[_0xbcf3('0xbf')],'as':'Contact','attributes':['id',_0xbcf3('0xc0'),'lastName'],'raw':!![]}]},{'model':db[_0xbcf3('0xc1')],'as':_0xbcf3('0xc2'),'attributes':['id',_0xbcf3('0x29')]},{'model':db[_0xbcf3('0xbd')],'as':'Owner','attributes':['id','fullname']}]})[_0xbcf3('0x26')](handleEntityNotFound(_0x5d90d1,null))[_0xbcf3('0x26')](function(_0x390717){if(_0x390717){var _0x41af32=_0x390717[_0xbcf3('0xc3')]({'plain':!![]});_0x502c52=!![];var _0x13ae27={'format':'A4','border':'10px','header':{'height':_0xbcf3('0xc4'),'contents':{'first':_0xbcf3('0xc5')}},'footer':{'height':_0xbcf3('0xc6'),'contents':{'default':util[_0xbcf3('0x58')](_0xbcf3('0xc7'),util[_0xbcf3('0x58')](_0xbcf3('0xc8'),'Sms',_0x41af32['id']),moment()[_0xbcf3('0x58')](_0xbcf3('0xc9'))[_0xbcf3('0x89')]())}}};fs[_0xbcf3('0xca')](_0x4215af);var _0x4daa49={'channel':_0xbcf3('0xcb'),'account':_0x41af32[_0xbcf3('0xc2')]['name'],'agent':_0x41af32[_0xbcf3('0xcc')]?_0x41af32[_0xbcf3('0xcc')][_0xbcf3('0xbe')]:_0xbcf3('0xcd'),'createdAt':moment(_0x41af32['createdAt'])['format'](_0xbcf3('0xa8'))['toString'](),'closedAt':_0x41af32[_0xbcf3('0xce')]?moment(_0x41af32['closedAt'])['format'](_0xbcf3('0xa8'))[_0xbcf3('0x89')]():'','disposition':_0x41af32['disposition'],'messages':_(_0x41af32[_0xbcf3('0xba')])[_0xbcf3('0x72')]({'secret':![]})[_0xbcf3('0x2b')](function(_0xb6be01){return{'date':moment(_0xb6be01['createdAt'])[_0xbcf3('0x58')](_0xbcf3('0xa8'))[_0xbcf3('0x89')](),'sender':_0xb6be01['direction']===_0xbcf3('0xcf')?_0xb6be01[_0xbcf3('0xbd')]?_0xb6be01[_0xbcf3('0xbd')][_0xbcf3('0xbe')]:_0xbcf3('0xd0'):_0xb6be01['Contact'][_0xbcf3('0xc0')]+(_0xb6be01[_0xbcf3('0xd1')][_0xbcf3('0xd2')]?'\x20'+_0xb6be01[_0xbcf3('0xd1')]['lastName']:''),'body':_0xb6be01[_0xbcf3('0xa1')],'direction':_0xb6be01[_0xbcf3('0xbb')]===_0xbcf3('0xcf')?'A':'C','secret':_0xb6be01[_0xbcf3('0xbc')]};})[_0xbcf3('0x55')]()};return ejs['renderFile'](path[_0xbcf3('0xb3')](config[_0xbcf3('0xb4')],'server',_0xbcf3('0xd3'),'downloadInteraction.html'),{'interaction':_0x4daa49})['then'](function(_0x687490){return new BPromise(function(_0x32eb2d,_0x15c464){pdf['create'](_0x687490,_0x13ae27)[_0xbcf3('0xd4')](path[_0xbcf3('0xb3')](_0x4215af,_0xbcf3('0xd5')+_0x41af32['id']+'-'+_0xceed06+_0xbcf3('0xd6')),function(_0x1e49ed,_0x470fbb){if(_0x1e49ed)return _0x15c464(_0x1e49ed);_0x32eb2d(_0x470fbb);});});});}})['then'](function(){if(_0x502c52){return new BPromise(function(_0x4e4c3c,_0x3f7b10){zipdir(_0x4215af,{'saveTo':_0x3555bb},function(_0x82a428,_0x10d847){if(_0x82a428)return _0x3f7b10(_0x82a428);return _0x4e4c3c(_0x10d847);});})['then'](function(){return new BPromise(function(_0x2c146f,_0x437c12){rimraf(_0x4215af,function(_0x36fa30){if(_0x36fa30)_0x437c12(_0x36fa30);return _0x2c146f();});});})['then'](function(){return _0x5d90d1[_0xbcf3('0xb1')](_0x3555bb,_0x3cfe7b,function(_0x4580ed){if(_0x4580ed){console[_0xbcf3('0xd7')](_0xbcf3('0xd8'),_0x4580ed);}else{fs['unlinkSync'](_0x3555bb);}});});}else{return _0x5d90d1[_0xbcf3('0x1d')](0xc8);}})[_0xbcf3('0x30')](handleError(_0x5d90d1,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index bcb0e8f..10aa71a 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 _0x2f37=['exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','Users','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x2f37,0x76));var _0x72f3=function(_0x499580,_0x4c3425){_0x499580=_0x499580-0x0;var _0x55530f=_0x2f37[_0x499580];return _0x55530f;};'use strict';var EventEmitter=require(_0x72f3('0x0'));var SmsInteraction=require(_0x72f3('0x1'))['db']['SmsInteraction'];var SmsMessage=require('../../mysqldb')['db'][_0x72f3('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x72f3('0x3')](0x0);var events={'afterCreate':_0x72f3('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x272273){return function(_0x1e661d,_0x4e446f,_0x3ec3d4){_0x1e661d['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x169efb){_0x1e661d['setDataValue'](_0x72f3('0x5'),_0x169efb['map'](function(_0x1bf1ee){return{'id':_0x1bf1ee['id']};}));return SmsMessage[_0x72f3('0x6')]({'where':{'SmsInteractionId':_0x1e661d['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x59384b){_0x1e661d[_0x72f3('0x7')](_0x72f3('0x8'),_0x59384b['length']);SmsInteractionEvents[_0x72f3('0x9')](_0x272273+':'+_0x1e661d['id'],_0x1e661d);SmsInteractionEvents[_0x72f3('0x9')](_0x272273,_0x1e661d);_0x3ec3d4(null);})[_0x72f3('0xa')](_0x3ec3d4(null));};}for(var e in events){if(events[_0x72f3('0xb')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x72f3('0xc')]=SmsInteractionEvents; \ No newline at end of file +var _0x2ee0=['unreadMessages','emit','catch','hook','exports','../../mysqldb','SmsMessage','save','update','remove','then','setDataValue','map','findAll'];(function(_0xe25ee9,_0x1f6d98){var _0x56c669=function(_0x32e81a){while(--_0x32e81a){_0xe25ee9['push'](_0xe25ee9['shift']());}};_0x56c669(++_0x1f6d98);}(_0x2ee0,0x171));var _0x02ee=function(_0x559233,_0x4f4408){_0x559233=_0x559233-0x0;var _0x1a9acb=_0x2ee0[_0x559233];return _0x1a9acb;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x02ee('0x0'))['db']['SmsInteraction'];var SmsMessage=require(_0x02ee('0x0'))['db'][_0x02ee('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x02ee('0x2'),'afterUpdate':_0x02ee('0x3'),'afterDestroy':_0x02ee('0x4')};function emitEvent(_0x29fe25){return function(_0x2a73e1,_0x21afbd,_0x110ec1){_0x2a73e1['getUsers']({'attributes':['id'],'raw':!![]})[_0x02ee('0x5')](function(_0x3ab893){_0x2a73e1[_0x02ee('0x6')]('Users',_0x3ab893[_0x02ee('0x7')](function(_0x4109b4){return{'id':_0x4109b4['id']};}));return SmsMessage[_0x02ee('0x8')]({'where':{'SmsInteractionId':_0x2a73e1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x02ee('0x5')](function(_0x560da8){_0x2a73e1[_0x02ee('0x6')](_0x02ee('0x9'),_0x560da8['length']);SmsInteractionEvents['emit'](_0x29fe25+':'+_0x2a73e1['id'],_0x2a73e1);SmsInteractionEvents[_0x02ee('0xa')](_0x29fe25,_0x2a73e1);_0x110ec1(null);})[_0x02ee('0xb')](_0x110ec1(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x02ee('0xc')](e,emitEvent(event));}}module[_0x02ee('0xd')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 297abba..826868f 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 _0x042c=['YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','format'];(function(_0x2d2efe,_0x1ac81b){var _0x135b0a=function(_0x21f1b9){while(--_0x21f1b9){_0x2d2efe['push'](_0x2d2efe['shift']());}};_0x135b0a(++_0x1ac81b);}(_0x042c,0xb7));var _0xc042=function(_0x3c6d80,_0xc2ee3a){_0x3c6d80=_0x3c6d80-0x0;var _0x5245ba=_0x042c[_0x3c6d80];return _0x5245ba;};'use strict';var _=require('lodash');var util=require(_0xc042('0x0'));var logger=require(_0xc042('0x1'))('api');var moment=require(_0xc042('0x2'));var BPromise=require(_0xc042('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc042('0x4'));var config=require('../../config/environment');var attributes=require(_0xc042('0x5'));module[_0xc042('0x6')]=function(_0x304eaf,_0x116905){return _0x304eaf[_0xc042('0x7')](_0xc042('0x8'),attributes,{'tableName':_0xc042('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x28ad90,_0xc59e6b,_0x39099b){if(_0x28ad90[_0xc042('0xa')](_0xc042('0xb'))){_0x28ad90['closedAt']=moment()[_0xc042('0xc')](_0xc042('0xd'));}_0x39099b(null,_0x28ad90);}}});}; \ No newline at end of file +var _0xf229=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','exports','define','SmsInteraction','sms_interactions'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf229,0xff));var _0x9f22=function(_0x33ca77,_0x7a4aa4){_0x33ca77=_0x33ca77-0x0;var _0xa265bb=_0xf229[_0x33ca77];return _0xa265bb;};'use strict';var _=require(_0x9f22('0x0'));var util=require(_0x9f22('0x1'));var logger=require(_0x9f22('0x2'))(_0x9f22('0x3'));var moment=require(_0x9f22('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module[_0x9f22('0x5')]=function(_0x378172,_0x34c0c2){return _0x378172[_0x9f22('0x6')](_0x9f22('0x7'),attributes,{'tableName':_0x9f22('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x49268d,_0x5d9bf6,_0x3f5d7b){if(_0x49268d['changed']('closed')){_0x49268d[_0x9f22('0x9')]=moment()[_0x9f22('0xa')](_0x9f22('0xb'));}_0x3f5d7b(null,_0x49268d);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index a67ca16..beab44a 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 _0x137a=['raw','where','stringify','AddTagsToSmsInteraction','ids','omit','spread','AddTags','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./smsInteraction.socket','request','then','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','SmsInteraction,\x20%s,\x20%s','message','catch','UpdateSmsInteraction','SmsInteraction','update','body','options'];(function(_0x757255,_0x3e346d){var _0x142469=function(_0x23b507){while(--_0x23b507){_0x757255['push'](_0x757255['shift']());}};_0x142469(++_0x3e346d);}(_0x137a,0xec));var _0xa137=function(_0x1ddbe1,_0x31d3a9){_0x1ddbe1=_0x1ddbe1-0x0;var _0x596bf4=_0x137a[_0x1ddbe1];return _0x596bf4;};'use strict';var _=require('lodash');var util=require(_0xa137('0x0'));var moment=require('moment');var BPromise=require(_0xa137('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa137('0x2'));var db=require(_0xa137('0x3'))['db'];var utils=require(_0xa137('0x4'));var logger=require(_0xa137('0x5'))(_0xa137('0x6'));var config=require(_0xa137('0x7'));var jayson=require(_0xa137('0x8'));var client=jayson[_0xa137('0x9')]['http']({'port':0x232a});config[_0xa137('0xa')]=_[_0xa137('0xb')](config[_0xa137('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa137('0xc'))(new Redis(config[_0xa137('0xa')]));require(_0xa137('0xd'))['register'](socket);function respondWithRpcPromise(_0x5cbd09,_0x30221e,_0x1a954e){return new BPromise(function(_0x55c1d8,_0x1f62d6){return client[_0xa137('0xe')](_0x5cbd09,_0x1a954e)[_0xa137('0xf')](function(_0x1664a9){logger[_0xa137('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x30221e,_0xa137('0x11'));logger[_0xa137('0x12')](_0xa137('0x13'),_0x30221e,'request\x20sent',JSON['stringify'](_0x1664a9));if(_0x1664a9['error']){if(_0x1664a9[_0xa137('0x14')][_0xa137('0x15')]===0x1f4){logger[_0xa137('0x14')](_0xa137('0x16'),_0x30221e,_0x1664a9['error'][_0xa137('0x17')]);return _0x1f62d6(_0x1664a9[_0xa137('0x14')][_0xa137('0x17')]);}logger[_0xa137('0x14')](_0xa137('0x16'),_0x30221e,_0x1664a9[_0xa137('0x14')][_0xa137('0x17')]);return _0x55c1d8(_0x1664a9[_0xa137('0x14')][_0xa137('0x17')]);}else{logger[_0xa137('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x30221e,_0xa137('0x11'));_0x55c1d8(_0x1664a9['result'][_0xa137('0x17')]);}})[_0xa137('0x18')](function(_0x20ce9e){logger[_0xa137('0x14')](_0xa137('0x16'),_0x30221e,_0x20ce9e);_0x1f62d6(_0x20ce9e);});});}exports[_0xa137('0x19')]=function(_0x274bf7){var _0x544cae=this;return new Promise(function(_0x46cdc8,_0x473662){return db[_0xa137('0x1a')][_0xa137('0x1b')](_0x274bf7[_0xa137('0x1c')],{'raw':_0x274bf7[_0xa137('0x1d')]?_0x274bf7[_0xa137('0x1d')][_0xa137('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x274bf7['options']?_0x274bf7[_0xa137('0x1d')][_0xa137('0x1f')]||null:null,'attributes':_0x274bf7[_0xa137('0x1d')]?_0x274bf7['options']['attributes']||null:null,'limit':_0x274bf7[_0xa137('0x1d')]?_0x274bf7['options']['limit']||null:null})['then'](function(_0x282df6){logger[_0xa137('0x10')](_0xa137('0x19'),_0x274bf7);logger[_0xa137('0x12')](_0xa137('0x19'),_0x274bf7,JSON[_0xa137('0x20')](_0x282df6));_0x46cdc8(_0x282df6);})[_0xa137('0x18')](function(_0x1c659b){logger[_0xa137('0x14')](_0xa137('0x19'),_0x1c659b[_0xa137('0x17')],_0x274bf7);_0x473662(_0x544cae[_0xa137('0x14')](0x1f4,_0x1c659b['message']));});});};exports[_0xa137('0x21')]=function(_0x280f02){return new Promise(function(_0x289891,_0x3d5ca1){return db[_0xa137('0x1a')]['find']({'where':_0x280f02['options']?_0x280f02[_0xa137('0x1d')]['where']||null:null})[_0xa137('0xf')](function(_0x5c5c87){if(_0x5c5c87){return _0x5c5c87['addTags'](_0x280f02['body'][_0xa137('0x22')],_[_0xa137('0x23')](_0x280f02[_0xa137('0x1c')],['ids','id'])||{});}})[_0xa137('0x24')](function(_0x1b124b){logger[_0xa137('0x10')]('AddTags',_0x280f02);logger[_0xa137('0x12')](_0xa137('0x25'),_0x280f02,JSON[_0xa137('0x20')](_0x1b124b));_0x289891(_0x1b124b);})[_0xa137('0x18')](function(_0x3f956d){logger[_0xa137('0x14')](_0xa137('0x25'),_0x3f956d[_0xa137('0x17')],_0x280f02);_0x3d5ca1(_this[_0xa137('0x14')](0x1f4,_0x3f956d[_0xa137('0x17')]));});});}; \ No newline at end of file +var _0x9be4=['message','info','catch','UpdateSmsInteraction','update','body','options','attributes','limit','AddTagsToSmsInteraction','where','addTags','ids','omit','spread','AddTags','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','then','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsInteraction,\x20%s,\x20%s'];(function(_0x2fee96,_0x2f735d){var _0x2e6ad1=function(_0x2c55ad){while(--_0x2c55ad){_0x2fee96['push'](_0x2fee96['shift']());}};_0x2e6ad1(++_0x2f735d);}(_0x9be4,0x1aa));var _0x49be=function(_0x56bb91,_0x1f3921){_0x56bb91=_0x56bb91-0x0;var _0x51d4b9=_0x9be4[_0x56bb91];return _0x51d4b9;};'use strict';var _=require(_0x49be('0x0'));var util=require(_0x49be('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x49be('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x49be('0x3'))['db'];var utils=require(_0x49be('0x4'));var logger=require(_0x49be('0x5'))(_0x49be('0x6'));var config=require(_0x49be('0x7'));var jayson=require(_0x49be('0x8'));var client=jayson[_0x49be('0x9')][_0x49be('0xa')]({'port':0x232a});config[_0x49be('0xb')]=_[_0x49be('0xc')](config[_0x49be('0xb')],{'host':_0x49be('0xd'),'port':0x18eb});var socket=require(_0x49be('0xe'))(new Redis(config['redis']));require(_0x49be('0xf'))[_0x49be('0x10')](socket);function respondWithRpcPromise(_0x260549,_0x317625,_0x2ea5b2){return new BPromise(function(_0x54f9b0,_0x5ea507){return client['request'](_0x260549,_0x2ea5b2)[_0x49be('0x11')](function(_0x5944b8){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x317625,_0x49be('0x12'));logger[_0x49be('0x13')](_0x49be('0x14'),_0x317625,_0x49be('0x12'),JSON[_0x49be('0x15')](_0x5944b8));if(_0x5944b8[_0x49be('0x16')]){if(_0x5944b8['error'][_0x49be('0x17')]===0x1f4){logger['error'](_0x49be('0x18'),_0x317625,_0x5944b8[_0x49be('0x16')][_0x49be('0x19')]);return _0x5ea507(_0x5944b8[_0x49be('0x16')]['message']);}logger[_0x49be('0x16')](_0x49be('0x18'),_0x317625,_0x5944b8[_0x49be('0x16')][_0x49be('0x19')]);return _0x54f9b0(_0x5944b8[_0x49be('0x16')]['message']);}else{logger[_0x49be('0x1a')](_0x49be('0x18'),_0x317625,_0x49be('0x12'));_0x54f9b0(_0x5944b8['result'][_0x49be('0x19')]);}})[_0x49be('0x1b')](function(_0x9022b2){logger[_0x49be('0x16')](_0x49be('0x18'),_0x317625,_0x9022b2);_0x5ea507(_0x9022b2);});});}exports[_0x49be('0x1c')]=function(_0x43081a){var _0x3a3f44=this;return new Promise(function(_0x23bde4,_0x23f566){return db['SmsInteraction'][_0x49be('0x1d')](_0x43081a[_0x49be('0x1e')],{'raw':_0x43081a['options']?_0x43081a['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43081a[_0x49be('0x1f')]?_0x43081a[_0x49be('0x1f')]['where']||null:null,'attributes':_0x43081a[_0x49be('0x1f')]?_0x43081a[_0x49be('0x1f')][_0x49be('0x20')]||null:null,'limit':_0x43081a['options']?_0x43081a['options'][_0x49be('0x21')]||null:null})[_0x49be('0x11')](function(_0x1bd21d){logger[_0x49be('0x1a')]('UpdateSmsInteraction',_0x43081a);logger[_0x49be('0x13')](_0x49be('0x1c'),_0x43081a,JSON[_0x49be('0x15')](_0x1bd21d));_0x23bde4(_0x1bd21d);})[_0x49be('0x1b')](function(_0xb5cb4f){logger[_0x49be('0x16')](_0x49be('0x1c'),_0xb5cb4f[_0x49be('0x19')],_0x43081a);_0x23f566(_0x3a3f44[_0x49be('0x16')](0x1f4,_0xb5cb4f[_0x49be('0x19')]));});});};exports[_0x49be('0x22')]=function(_0x1ead51){return new Promise(function(_0x21be23,_0x3fb07a){return db['SmsInteraction']['find']({'where':_0x1ead51[_0x49be('0x1f')]?_0x1ead51[_0x49be('0x1f')][_0x49be('0x23')]||null:null})[_0x49be('0x11')](function(_0x30ef97){if(_0x30ef97){return _0x30ef97[_0x49be('0x24')](_0x1ead51[_0x49be('0x1e')][_0x49be('0x25')],_[_0x49be('0x26')](_0x1ead51['body'],[_0x49be('0x25'),'id'])||{});}})[_0x49be('0x27')](function(_0x2e4796){logger[_0x49be('0x1a')](_0x49be('0x28'),_0x1ead51);logger[_0x49be('0x13')](_0x49be('0x28'),_0x1ead51,JSON[_0x49be('0x15')](_0x2e4796));_0x21be23(_0x2e4796);})[_0x49be('0x1b')](function(_0x28d9a7){logger[_0x49be('0x16')]('AddTags',_0x28d9a7[_0x49be('0x19')],_0x1ead51);_0x3fb07a(_this['error'](0x1f4,_0x28d9a7[_0x49be('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index a657d61..10068f0 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 _0x4d31=['smsInteraction:','./smsInteraction.events','save','update','emit','removeListener','register','length'];(function(_0x1e0381,_0x2e11de){var _0x35df40=function(_0x596fcc){while(--_0x596fcc){_0x1e0381['push'](_0x1e0381['shift']());}};_0x35df40(++_0x2e11de);}(_0x4d31,0x1b1));var _0x14d3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4d31[_0x20a584];return _0x4b41a8;};'use strict';var SmsInteractionEvents=require(_0x14d3('0x0'));var events=[_0x14d3('0x1'),'remove',_0x14d3('0x2')];function createListener(_0x45909a,_0x283e96){return function(_0x3e2bff){_0x283e96[_0x14d3('0x3')](_0x45909a,_0x3e2bff);};}function removeListener(_0xd5d2ce,_0x28e319){return function(){SmsInteractionEvents[_0x14d3('0x4')](_0xd5d2ce,_0x28e319);};}exports[_0x14d3('0x5')]=function(_0x8f3c89){for(var _0x9c2675=0x0,_0x5962bf=events[_0x14d3('0x6')];_0x9c2675<_0x5962bf;_0x9c2675++){var _0x3a9039=events[_0x9c2675];var _0x45de24=createListener(_0x14d3('0x7')+_0x3a9039,_0x8f3c89);SmsInteractionEvents['on'](_0x3a9039,_0x45de24);}}; \ No newline at end of file +var _0x1d30=['update','emit','removeListener','register','length','smsInteraction:','./smsInteraction.events','remove'];(function(_0x4671e0,_0x16f9df){var _0x27de20=function(_0x25cbde){while(--_0x25cbde){_0x4671e0['push'](_0x4671e0['shift']());}};_0x27de20(++_0x16f9df);}(_0x1d30,0x15e));var _0x01d3=function(_0x2fe0e,_0xf41578){_0x2fe0e=_0x2fe0e-0x0;var _0x3b417d=_0x1d30[_0x2fe0e];return _0x3b417d;};'use strict';var SmsInteractionEvents=require(_0x01d3('0x0'));var events=['save',_0x01d3('0x1'),_0x01d3('0x2')];function createListener(_0x511b0e,_0x7894c7){return function(_0x5424ee){_0x7894c7[_0x01d3('0x3')](_0x511b0e,_0x5424ee);};}function removeListener(_0x330708,_0x4050eb){return function(){SmsInteractionEvents[_0x01d3('0x4')](_0x330708,_0x4050eb);};}exports[_0x01d3('0x5')]=function(_0x5a5a14){for(var _0x11d63d=0x0,_0x2cfe46=events[_0x01d3('0x6')];_0x11d63d<_0x2cfe46;_0x11d63d++){var _0x3dcbea=events[_0x11d63d];var _0xb539fb=createListener(_0x01d3('0x7')+_0x3dcbea,_0x5a5a14);SmsInteractionEvents['on'](_0x3dcbea,_0xb539fb);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 2e29974..18e8e3d 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 _0x15c9=['smsmessage:create','create','put','/:id','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','../../components/auth/service','../../config/environment','index','get','/describe','isAuthenticated','describe','show','post','tracked','sms'];(function(_0x5cd80d,_0x11242f){var _0xf08d62=function(_0x276a26){while(--_0x276a26){_0x5cd80d['push'](_0x5cd80d['shift']());}};_0xf08d62(++_0x11242f);}(_0x15c9,0x83));var _0x915c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x15c9[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x915c('0x0'));var util=require(_0x915c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x915c('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x915c('0x3'));var controller=require('./smsMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x915c('0x4')]);router[_0x915c('0x5')](_0x915c('0x6'),auth[_0x915c('0x7')](),controller[_0x915c('0x8')]);router[_0x915c('0x5')]('/:id',auth[_0x915c('0x7')](),controller[_0x915c('0x9')]);router[_0x915c('0xa')]('/',auth['isAuthenticated'](),interaction[_0x915c('0xb')](_0x915c('0xc'),_0x915c('0xd')),controller[_0x915c('0xe')]);router[_0x915c('0xa')]('/:id/status',controller['status']);router[_0x915c('0xf')](_0x915c('0x10'),auth[_0x915c('0x7')](),controller[_0x915c('0x11')]);router[_0x915c('0xf')](_0x915c('0x12'),auth[_0x915c('0x7')](),controller[_0x915c('0x13')]);router[_0x915c('0xf')](_0x915c('0x14'),auth[_0x915c('0x7')](),controller['reject']);router[_0x915c('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x915c('0x16')]);module[_0x915c('0x17')]=router; \ No newline at end of file +var _0x11ff=['describe','isAuthenticated','post','tracked','sms','smsmessage:create','create','put','update','/:id/accept','accept','reject','delete','/:id','exports','multer','util','path','express','Router','../../components/auth/service','./smsMessage.controller','get','index','/describe'];(function(_0x57e172,_0x3f7e02){var _0x33d96c=function(_0x5aaf19){while(--_0x5aaf19){_0x57e172['push'](_0x57e172['shift']());}};_0x33d96c(++_0x3f7e02);}(_0x11ff,0x1d1));var _0xf11f=function(_0x90a503,_0x665b24){_0x90a503=_0x90a503-0x0;var _0x16d3a8=_0x11ff[_0x90a503];return _0x16d3a8;};'use strict';var multer=require(_0xf11f('0x0'));var util=require(_0xf11f('0x1'));var path=require(_0xf11f('0x2'));var timeout=require('connect-timeout');var express=require(_0xf11f('0x3'));var router=express[_0xf11f('0x4')]();var auth=require(_0xf11f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf11f('0x6'));router[_0xf11f('0x7')]('/',auth['isAuthenticated'](),controller[_0xf11f('0x8')]);router['get'](_0xf11f('0x9'),auth['isAuthenticated'](),controller[_0xf11f('0xa')]);router[_0xf11f('0x7')]('/:id',auth[_0xf11f('0xb')](),controller['show']);router[_0xf11f('0xc')]('/',auth[_0xf11f('0xb')](),interaction[_0xf11f('0xd')](_0xf11f('0xe'),_0xf11f('0xf')),controller[_0xf11f('0x10')]);router[_0xf11f('0xc')]('/:id/status',controller['status']);router[_0xf11f('0x11')]('/:id',auth[_0xf11f('0xb')](),controller[_0xf11f('0x12')]);router[_0xf11f('0x11')](_0xf11f('0x13'),auth[_0xf11f('0xb')](),controller[_0xf11f('0x14')]);router[_0xf11f('0x11')]('/:id/reject',auth['isAuthenticated'](),controller[_0xf11f('0x15')]);router[_0xf11f('0x16')](_0xf11f('0x17'),auth[_0xf11f('0xb')](),controller['destroy']);module[_0xf11f('0x18')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 55d2110..ed68f0b 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 _0xc99e=['STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x5c587d,_0x332e3e){var _0x2e99ba=function(_0x5e7648){while(--_0x5e7648){_0x5c587d['push'](_0x5c587d['shift']());}};_0x2e99ba(++_0x332e3e);}(_0xc99e,0x6e));var _0xec99=function(_0x409e35,_0x53d341){_0x409e35=_0x409e35-0x0;var _0x1332e9=_0xc99e[_0x409e35];return _0x1332e9;};'use strict';var Sequelize=require(_0xec99('0x0'));module[_0xec99('0x1')]={'body':{'type':Sequelize[_0xec99('0x2')](_0xec99('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xec99('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xec99('0x5')]('in','out'),'defaultValue':_0xec99('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xec99('0x7')](0xbe)},'phone':{'type':Sequelize[_0xec99('0x7')]},'readAt':{'type':Sequelize[_0xec99('0x8')]},'secret':{'type':Sequelize[_0xec99('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x0619=['sequelize','exports','TEXT','medium','ENUM','out','STRING','DATE','BOOLEAN'];(function(_0x45533f,_0x3c7d00){var _0x32b208=function(_0x559d52){while(--_0x559d52){_0x45533f['push'](_0x45533f['shift']());}};_0x32b208(++_0x3c7d00);}(_0x0619,0x90));var _0x9061=function(_0x461578,_0x7586e0){_0x461578=_0x461578-0x0;var _0x42d46d=_0x0619[_0x461578];return _0x42d46d;};'use strict';var Sequelize=require(_0x9061('0x0'));module[_0x9061('0x1')]={'body':{'type':Sequelize[_0x9061('0x2')](_0x9061('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9061('0x4')]('in',_0x9061('0x5')),'defaultValue':_0x9061('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9061('0x6')](0xbe)},'phone':{'type':Sequelize[_0x9061('0x6')]},'readAt':{'type':Sequelize[_0x9061('0x7')]},'secret':{'type':Sequelize[_0x9061('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index cde3f05..8ff80c6 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 _0x0cce=['filters','intersection','attributes','fields','hasOwnProperty','sort','pick','where','merge','key','VIRTUAL','filter','count','include','rows','show','params','keys','includeAll','options','find','create','body','describe','sms-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','SmsInteraction','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','type','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','client','http','test','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','limit','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','SmsMessage','rawAttributes','model','query'];(function(_0x26c407,_0x198f82){var _0x55d669=function(_0x2a3bff){while(--_0x2a3bff){_0x26c407['push'](_0x26c407['shift']());}};_0x55d669(++_0x198f82);}(_0x0cce,0x1df));var _0xe0cc=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x0cce[_0x5a9c0c];return _0x53c77d;};'use strict';var pdf=require(_0xe0cc('0x0'));var emlformat=require(_0xe0cc('0x1'));var rimraf=require(_0xe0cc('0x2'));var zipdir=require(_0xe0cc('0x3'));var jsonpatch=require(_0xe0cc('0x4'));var rp=require(_0xe0cc('0x5'));var moment=require(_0xe0cc('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xe0cc('0x7'));var util=require(_0xe0cc('0x8'));var path=require(_0xe0cc('0x9'));var sox=require('sox');var csv=require(_0xe0cc('0xa'));var ejs=require(_0xe0cc('0xb'));var fs=require('fs');var _=require(_0xe0cc('0xc'));var squel=require(_0xe0cc('0xd'));var crypto=require('crypto');var jsforce=require(_0xe0cc('0xe'));var deskjs=require(_0xe0cc('0xf'));var toCsv=require(_0xe0cc('0xa'));var querystring=require('querystring');var Papa=require(_0xe0cc('0x10'));var Redis=require(_0xe0cc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe0cc('0x12'));var hardwareService=require(_0xe0cc('0x13'));var logger=require(_0xe0cc('0x14'))(_0xe0cc('0x15'));var utils=require(_0xe0cc('0x16'));var config=require(_0xe0cc('0x17'));var db=require(_0xe0cc('0x18'))['db'];config[_0xe0cc('0x19')]=_[_0xe0cc('0x1a')](config[_0xe0cc('0x19')],{'host':_0xe0cc('0x1b'),'port':0x18eb});var socket=require(_0xe0cc('0x1c'))(new Redis(config[_0xe0cc('0x19')]));require(_0xe0cc('0x1d'))[_0xe0cc('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe0cc('0x1f')][_0xe0cc('0x20')]({'port':0x232c});var client9002=jayson[_0xe0cc('0x1f')][_0xe0cc('0x20')]({'port':0x232a});function checkPasswordPattern(_0x5c22fd,_0x881a72,_0x4f1dd5){if(_0x4f1dd5){var _0x167e45=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x167e45[_0xe0cc('0x21')](_0x881a72)){return _0x5c22fd;}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 _0x5c22fd;}}function respondWithRpcPromise(_0x503d0e,_0x465d5c,_0x4c32b4,_0x42f5c7){return new BPromise(function(_0x910538,_0x3c6614){var _0x505070=_0x42f5c7||client;return _0x505070[_0xe0cc('0x22')](_0x503d0e,_0x4c32b4)[_0xe0cc('0x23')](function(_0x3987e1){logger[_0xe0cc('0x24')](_0xe0cc('0x25'),_0x465d5c,_0xe0cc('0x26'));logger[_0xe0cc('0x27')](_0xe0cc('0x28'),_0x465d5c,_0xe0cc('0x26'),JSON[_0xe0cc('0x29')](_0x3987e1));if(_0x3987e1[_0xe0cc('0x2a')]){if(_0x3987e1[_0xe0cc('0x2a')][_0xe0cc('0x2b')]===0x1f4){logger[_0xe0cc('0x2a')](_0xe0cc('0x25'),_0x465d5c,_0x3987e1[_0xe0cc('0x2a')][_0xe0cc('0x2c')]);return _0x3c6614(_0x3987e1[_0xe0cc('0x2a')][_0xe0cc('0x2c')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x465d5c,_0x3987e1[_0xe0cc('0x2a')][_0xe0cc('0x2c')]);return _0x910538(_0x3987e1[_0xe0cc('0x2a')]['message']);}else{logger[_0xe0cc('0x24')](_0xe0cc('0x25'),_0x465d5c,_0xe0cc('0x26'));_0x910538(_0x3987e1['result'][_0xe0cc('0x2c')]);}})[_0xe0cc('0x2d')](function(_0x355954){logger[_0xe0cc('0x2a')](_0xe0cc('0x25'),_0x465d5c,_0x355954);_0x3c6614(_0x355954);});});}function respondWithStatusCode(_0x10d830,_0x5ec43a){_0x5ec43a=_0x5ec43a||0xcc;return function(_0x52e543){if(_0x52e543){return _0x10d830['sendStatus'](_0x5ec43a);}return _0x10d830[_0xe0cc('0x2e')](_0x5ec43a)[_0xe0cc('0x2f')]();};}function respondWithResult(_0x3e9c70,_0xa1d999){_0xa1d999=_0xa1d999||0xc8;return function(_0x9bc2b4){if(_0x9bc2b4){return _0x3e9c70[_0xe0cc('0x2e')](_0xa1d999)[_0xe0cc('0x30')](_0x9bc2b4);}};}function respondWithFilteredResult(_0x2a3dbf,_0x266d9c){return function(_0x28a5d1){if(_0x28a5d1){var _0x497502=_0x28a5d1['count'],_0x77305d=_0x266d9c[_0xe0cc('0x31')],_0x1f896e=_0x266d9c['offset']+_0x266d9c[_0xe0cc('0x32')],_0x3a0acd;if(_0x1f896e>=_0x497502){_0x1f896e=_0x497502;_0x3a0acd=0xc8;}else{_0x3a0acd=0xce;}_0x2a3dbf[_0xe0cc('0x2e')](_0x3a0acd);return _0x2a3dbf['set'](_0xe0cc('0x33'),_0x77305d+'-'+_0x1f896e+'/'+_0x497502)['json'](_0x28a5d1);}return null;};}function patchUpdates(_0x26bc63){return function(_0x4357db){try{jsonpatch[_0xe0cc('0x34')](_0x4357db,_0x26bc63,!![]);}catch(_0x14858a){return BPromise[_0xe0cc('0x35')](_0x14858a);}return _0x4357db[_0xe0cc('0x36')]();};}function saveUpdates(_0x8291f8,_0x5525e1){return function(_0x1aaaac){if(_0x1aaaac){return _0x1aaaac[_0xe0cc('0x37')](_0x8291f8)[_0xe0cc('0x23')](function(_0x4dd07b){return _0x4dd07b;});}return null;};}function removeEntity(_0x303112,_0x510f0d){return function(_0x55b5bb){if(_0x55b5bb){return _0x55b5bb[_0xe0cc('0x38')]()[_0xe0cc('0x23')](function(){_0x303112[_0xe0cc('0x2e')](0xcc)[_0xe0cc('0x2f')]();});}};}function handleEntityNotFound(_0x3c4a3f,_0x470ac1){return function(_0x3c1372){if(!_0x3c1372){_0x3c4a3f[_0xe0cc('0x39')](0x194);}return _0x3c1372;};}function handleError(_0x576898,_0x4a329a){_0x4a329a=_0x4a329a||0x1f4;return function(_0x594565){logger['error'](_0x594565[_0xe0cc('0x3a')]);if(_0x594565[_0xe0cc('0x3b')]){delete _0x594565['name'];}_0x576898[_0xe0cc('0x2e')](_0x4a329a)[_0xe0cc('0x3c')](_0x594565);};}exports['index']=function(_0x3b6f37,_0x29dfd7){var _0x12f1d8={},_0x515f83={},_0x3d8983={'count':0x0,'rows':[]};var _0x5db15a=db[_0xe0cc('0x3d')][_0xe0cc('0x3e')];_0x515f83[_0xe0cc('0x3f')]=_['keys'](_0x5db15a);_0x515f83['query']=_['keys'](_0x3b6f37[_0xe0cc('0x40')]);_0x515f83[_0xe0cc('0x41')]=_[_0xe0cc('0x42')](_0x515f83[_0xe0cc('0x3f')],_0x515f83['query']);_0x12f1d8[_0xe0cc('0x43')]=_['intersection'](_0x515f83[_0xe0cc('0x3f')],qs[_0xe0cc('0x44')](_0x3b6f37[_0xe0cc('0x40')][_0xe0cc('0x44')]));_0x12f1d8['attributes']=_0x12f1d8[_0xe0cc('0x43')]['length']?_0x12f1d8[_0xe0cc('0x43')]:_0x515f83['model'];if(!_0x3b6f37[_0xe0cc('0x40')][_0xe0cc('0x45')]('nolimit')){_0x12f1d8[_0xe0cc('0x32')]=qs[_0xe0cc('0x32')](_0x3b6f37['query'][_0xe0cc('0x32')]);_0x12f1d8[_0xe0cc('0x31')]=qs[_0xe0cc('0x31')](_0x3b6f37[_0xe0cc('0x40')][_0xe0cc('0x31')]);}_0x12f1d8['order']=qs[_0xe0cc('0x46')](_0x3b6f37['query'][_0xe0cc('0x46')]);_0x12f1d8['where']=qs['filters'](_[_0xe0cc('0x47')](_0x3b6f37['query'],_0x515f83[_0xe0cc('0x41')]));if(_0x3b6f37[_0xe0cc('0x40')]['filter']){_0x12f1d8[_0xe0cc('0x48')]=_[_0xe0cc('0x49')](_0x12f1d8[_0xe0cc('0x48')],{'$or':_['map'](_0x5db15a,function(_0x3eb3a1){if(_0x3eb3a1['type'][_0xe0cc('0x4a')]!==_0xe0cc('0x4b')){var _0x1bf3fa={};_0x1bf3fa[_0x3eb3a1['field']]={'$like':'%'+_0x3b6f37[_0xe0cc('0x40')][_0xe0cc('0x4c')]+'%'};return _0x1bf3fa;}})});}_0x12f1d8=_[_0xe0cc('0x49')]({},_0x12f1d8,_0x3b6f37['options']);var _0x2e3bc6={'where':_0x12f1d8['where']};return db[_0xe0cc('0x3d')][_0xe0cc('0x4d')](_0x2e3bc6)['then'](function(_0x19d53a){_0x3d8983[_0xe0cc('0x4d')]=_0x19d53a;if(_0x3b6f37[_0xe0cc('0x40')]['includeAll']){_0x12f1d8[_0xe0cc('0x4e')]=[{'all':!![]}];}return db[_0xe0cc('0x3d')]['findAll'](_0x12f1d8);})[_0xe0cc('0x23')](function(_0x38d86b){_0x3d8983[_0xe0cc('0x4f')]=_0x38d86b;return _0x3d8983;})[_0xe0cc('0x23')](respondWithFilteredResult(_0x29dfd7,_0x12f1d8))['catch'](handleError(_0x29dfd7,null));};exports[_0xe0cc('0x50')]=function(_0x49945a,_0x57a02b){var _0x2263af={'raw':!![],'where':{'id':_0x49945a[_0xe0cc('0x51')]['id']}},_0x4ca77d={};_0x4ca77d[_0xe0cc('0x3f')]=_['keys'](db[_0xe0cc('0x3d')][_0xe0cc('0x3e')]);_0x4ca77d[_0xe0cc('0x40')]=_[_0xe0cc('0x52')](_0x49945a[_0xe0cc('0x40')]);_0x4ca77d[_0xe0cc('0x41')]=_[_0xe0cc('0x42')](_0x4ca77d[_0xe0cc('0x3f')],_0x4ca77d[_0xe0cc('0x40')]);_0x2263af[_0xe0cc('0x43')]=_[_0xe0cc('0x42')](_0x4ca77d[_0xe0cc('0x3f')],qs[_0xe0cc('0x44')](_0x49945a[_0xe0cc('0x40')][_0xe0cc('0x44')]));_0x2263af[_0xe0cc('0x43')]=_0x2263af[_0xe0cc('0x43')]['length']?_0x2263af[_0xe0cc('0x43')]:_0x4ca77d[_0xe0cc('0x3f')];if(_0x49945a['query'][_0xe0cc('0x53')]){_0x2263af['include']=[{'all':!![]}];}_0x2263af=_[_0xe0cc('0x49')]({},_0x2263af,_0x49945a[_0xe0cc('0x54')]);return db[_0xe0cc('0x3d')][_0xe0cc('0x55')](_0x2263af)[_0xe0cc('0x23')](handleEntityNotFound(_0x57a02b,null))[_0xe0cc('0x23')](respondWithResult(_0x57a02b,null))[_0xe0cc('0x2d')](handleError(_0x57a02b,null));};exports[_0xe0cc('0x56')]=function(_0x31b473,_0x33c116){return db[_0xe0cc('0x3d')][_0xe0cc('0x56')](_0x31b473[_0xe0cc('0x57')],{})['then'](respondWithResult(_0x33c116,0xc9))[_0xe0cc('0x2d')](handleError(_0x33c116,null));};exports[_0xe0cc('0x37')]=function(_0x47e864,_0x56243a){if(_0x47e864[_0xe0cc('0x57')]['id']){delete _0x47e864[_0xe0cc('0x57')]['id'];}return db[_0xe0cc('0x3d')]['find']({'where':{'id':_0x47e864[_0xe0cc('0x51')]['id']}})[_0xe0cc('0x23')](handleEntityNotFound(_0x56243a,null))['then'](saveUpdates(_0x47e864[_0xe0cc('0x57')],null))['then'](respondWithResult(_0x56243a,null))['catch'](handleError(_0x56243a,null));};exports[_0xe0cc('0x38')]=function(_0x35c242,_0x4a95e4){return db[_0xe0cc('0x3d')][_0xe0cc('0x55')]({'where':{'id':_0x35c242[_0xe0cc('0x51')]['id']}})[_0xe0cc('0x23')](handleEntityNotFound(_0x4a95e4,null))['then'](removeEntity(_0x4a95e4,null))[_0xe0cc('0x2d')](handleError(_0x4a95e4,null));};exports[_0xe0cc('0x58')]=function(_0x33b03d,_0x1910ec){return db['SmsMessage'][_0xe0cc('0x58')]()[_0xe0cc('0x23')](respondWithResult(_0x1910ec,null))[_0xe0cc('0x2d')](handleError(_0x1910ec,null));};var interaction_log=require('../../config/logger')(_0xe0cc('0x59'));exports[_0xe0cc('0x5a')]=function(_0x4849a5,_0xf822b8,_0x1986b9){var _0x10d07d={'channel':'sms'};if(_0x4849a5[_0xe0cc('0x57')]['id']){delete _0x4849a5[_0xe0cc('0x57')]['id'];}_0x4849a5[_0xe0cc('0x57')][_0xe0cc('0x5b')]=!![];_0x4849a5[_0xe0cc('0x57')][_0xe0cc('0x5c')]=moment()[_0xe0cc('0x5d')](_0xe0cc('0x5e'));_0x4849a5[_0xe0cc('0x57')][_0xe0cc('0x5f')]=_0x4849a5[_0xe0cc('0x57')][_0xe0cc('0x5f')]||_0x4849a5[_0xe0cc('0x60')]['id'];return db[_0xe0cc('0x3d')][_0xe0cc('0x55')]({'where':{'id':_0x4849a5['params']['id'],'UserId':null},'include':[{'model':db[_0xe0cc('0x61')],'as':_0xe0cc('0x62')}]})[_0xe0cc('0x23')](handleEntityNotFound(_0xf822b8,null))['then'](saveUpdates(_0x4849a5[_0xe0cc('0x57')],null))['then'](function(_0x3b2755){if(_0x3b2755){_0x10d07d[_0xe0cc('0x2c')]=_0x3b2755[_0xe0cc('0x63')]({'plain':!![]});return db['SmsInteraction'][_0xe0cc('0x55')]({'where':{'id':_0x3b2755['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0xf822b8,null))[_0xe0cc('0x23')](function(_0x5f3393){if(_0x5f3393){return _0x5f3393[_0xe0cc('0x37')]({'UserId':_0x4849a5[_0xe0cc('0x57')][_0xe0cc('0x5f')],'read1stAt':_[_0xe0cc('0x64')](_0x5f3393[_0xe0cc('0x65')])?moment()[_0xe0cc('0x5d')](_0xe0cc('0x5e')):undefined});}return null;})[_0xe0cc('0x23')](function(_0x461955){if(_0x461955){_0x10d07d[_0xe0cc('0x66')]=_0x461955[_0xe0cc('0x63')]({'plain':!![]});interaction_log[_0xe0cc('0x24')](_0xe0cc('0x67'),_0x4849a5[_0xe0cc('0x60')]['id'],_0x4849a5['user'][_0xe0cc('0x3b')],_0x4849a5[_0xe0cc('0x60')]['role'],_0x10d07d[_0xe0cc('0x66')]['id'],_0x4849a5[_0xe0cc('0x57')]?JSON[_0xe0cc('0x29')](_0x4849a5[_0xe0cc('0x57')]):_0xe0cc('0x68'));return respondWithRpcPromise(_0xe0cc('0x69'),'acceptMessage',_0x10d07d);}return null;})['then'](function(_0xaddf72){if(_0xaddf72){if(_0x4849a5[_0xe0cc('0x57')]['manual']){_0x10d07d[_0xe0cc('0x2c')][_0xe0cc('0x6a')]=util[_0xe0cc('0x5d')](_0xe0cc('0x6b'),_0x4849a5[_0xe0cc('0x60')][_0xe0cc('0x3b')]);_0x10d07d[_0xe0cc('0x2c')][_0xe0cc('0x6c')]=_0x10d07d['channel'];_0x10d07d[_0xe0cc('0x2c')][_0xe0cc('0x6d')]=_0xe0cc('0x5a');return respondWithRpcPromise('EventManager',_0xe0cc('0x6e'),{'event':_0xe0cc('0x6f'),'message':_0x10d07d['message']},client9002)['then'](function(){return _0x10d07d;});}return _0x10d07d;}return null;})[_0xe0cc('0x23')](respondWithResult(_0xf822b8,null))[_0xe0cc('0x2d')](handleError(_0xf822b8,null));};var interaction_log=require(_0xe0cc('0x14'))('sms-interactions');exports[_0xe0cc('0x35')]=function(_0x539fd6,_0x145be1,_0x41a500){var _0x4e84de={'agent':{},'channel':'sms'};if(_0x539fd6['body']['id']){delete _0x539fd6[_0xe0cc('0x57')]['id'];}_0x539fd6['body']['UserId']=_0x539fd6[_0xe0cc('0x57')][_0xe0cc('0x5f')]||_0x539fd6[_0xe0cc('0x60')]['id'];_0x4e84de[_0xe0cc('0x70')]['id']=_0x539fd6['body'][_0xe0cc('0x5f')];return db['SmsMessage']['find']({'where':{'id':_0x539fd6[_0xe0cc('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x145be1,null))[_0xe0cc('0x23')](function(_0x4dc271){if(_0x4dc271){_0x4e84de[_0xe0cc('0x2c')]=_0x4dc271[_0xe0cc('0x63')]({'plain':!![]});return db[_0xe0cc('0x71')][_0xe0cc('0x55')]({'where':{'id':_0x4dc271[_0xe0cc('0x72')]}});}return null;})[_0xe0cc('0x23')](handleEntityNotFound(_0x145be1,null))[_0xe0cc('0x23')](function(_0x11a129){if(_0x11a129){_0x4e84de[_0xe0cc('0x66')]=_0x11a129['get']({'plain':!![]});interaction_log[_0xe0cc('0x24')](_0xe0cc('0x73'),_0x539fd6[_0xe0cc('0x60')]['id'],_0x539fd6['user'][_0xe0cc('0x3b')],_0x539fd6['user']['role'],_0x4e84de[_0xe0cc('0x66')]['id'],_0x539fd6[_0xe0cc('0x57')]?JSON[_0xe0cc('0x29')](_0x539fd6['body']):_0xe0cc('0x68'));return respondWithRpcPromise(_0xe0cc('0x74'),_0xe0cc('0x75'),_0x4e84de);}return null;})[_0xe0cc('0x23')](function(_0x125c85){if(_0x125c85){_0x125c85[_0xe0cc('0x2c')][_0xe0cc('0x6a')]=util[_0xe0cc('0x5d')](_0xe0cc('0x6b'),_0x539fd6[_0xe0cc('0x60')][_0xe0cc('0x3b')]);_0x125c85[_0xe0cc('0x2c')][_0xe0cc('0x6c')]=_0x4e84de[_0xe0cc('0x6c')];_0x125c85[_0xe0cc('0x2c')][_0xe0cc('0x6d')]=_0xe0cc('0x35');respondWithRpcPromise(_0xe0cc('0x6e'),_0xe0cc('0x6e'),{'event':'rejectmessage','message':_0x125c85[_0xe0cc('0x2c')]},client9002);return _0x4e84de;}return null;})[_0xe0cc('0x23')](respondWithResult(_0x145be1,null))[_0xe0cc('0x2d')](handleError(_0x145be1,null));};exports[_0xe0cc('0x2e')]=function(_0xeb2d77,_0x2d7b3f,_0x1edebd){if(_0xeb2d77['body']['id']){delete _0xeb2d77[_0xe0cc('0x57')]['id'];}var _0x551b25;return db[_0xe0cc('0x3d')]['find']({'where':{'id':_0xeb2d77[_0xe0cc('0x51')]['id']}})[_0xe0cc('0x23')](handleEntityNotFound(_0x2d7b3f,null))[_0xe0cc('0x23')](function(_0xd419db){if(_0xd419db){_0x551b25=_0xd419db;return db[_0xe0cc('0x76')][_0xe0cc('0x55')]({'where':{'id':_0xd419db[_0xe0cc('0x77')]}});}})[_0xe0cc('0x23')](handleEntityNotFound(_0x2d7b3f,null))[_0xe0cc('0x23')](function(_0x20fa9c){if(_0x20fa9c){logger[_0xe0cc('0x27')](_0xe0cc('0x28'),_0xe0cc('0x2e'),_0xe0cc('0x78'),_0x20fa9c['type'],util[_0xe0cc('0x79')](_0xeb2d77[_0xe0cc('0x57')],{'showHidden':![],'depth':null}));switch(_0x20fa9c[_0xe0cc('0x7a')]){case _0xe0cc('0x7b'):if(_0xeb2d77[_0xe0cc('0x57')][_0xe0cc('0x7c')]&&_0xeb2d77[_0xe0cc('0x57')][_0xe0cc('0x7c')]===_0x551b25[_0xe0cc('0x7d')]){return _0x551b25[_0xe0cc('0x37')]({'read':!![]});}else{logger[_0xe0cc('0x2a')](_0xe0cc('0x7e'),_0xe0cc('0x2e'),'twilio',util[_0xe0cc('0x79')](_0xeb2d77[_0xe0cc('0x57')],{'showHidden':![],'depth':null}));}break;case _0xe0cc('0x7f'):if(_0xeb2d77[_0xe0cc('0x57')]['MessageUUID']&&_0xeb2d77[_0xe0cc('0x57')]['MessageUUID']===_0x551b25['messageId']&&_['indexOf']([_0xe0cc('0x80'),_0xe0cc('0x81')],_0xeb2d77[_0xe0cc('0x57')][_0xe0cc('0x82')])>=0x0){return _0x551b25[_0xe0cc('0x37')]({'read':!![]});}else{logger[_0xe0cc('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xe0cc('0x83'),util['inspect'](_0xeb2d77['body'],{'showHidden':![],'depth':null}));}break;case _0xe0cc('0x84'):var _0xef913e=_0xeb2d77[_0xe0cc('0x57')][_0xe0cc('0x85')][0x0];if(_0xef913e['status'][_0xe0cc('0x86')]===_0xe0cc('0x87')){return _0x551b25[_0xe0cc('0x37')]({'read':!![]});}else{logger['error'](_0xe0cc('0x7e'),_0xe0cc('0x2e'),_0xe0cc('0x84'),util[_0xe0cc('0x79')](_0xeb2d77['body'],{'showHidden':![],'depth':null}));}break;}return _0x551b25;}})[_0xe0cc('0x23')](respondWithResult(_0x2d7b3f,null))[_0xe0cc('0x2d')](handleError(_0x2d7b3f,null));}; \ No newline at end of file +var _0x018b=['received\x20delivery\x20report\x20from','inspect','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','messageId','indexOf','sent','delivered','Status','plivio','results','groupName','DELIVERED','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','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','info','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','SmsMessage','rawAttributes','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','length','find','create','body','params','describe','sms-interactions','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','SmsInteraction','SmsInteractionId','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','EventManager','acceptmessage','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface','rejectmessage','SmsAccount','SmsAccountId'];(function(_0x351f93,_0x99fd5d){var _0x2ff279=function(_0x26bb64){while(--_0x26bb64){_0x351f93['push'](_0x351f93['shift']());}};_0x2ff279(++_0x99fd5d);}(_0x018b,0x9b));var _0xb018=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x018b[_0x50007c];return _0x5c1ec7;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xb018('0x0'));var zipdir=require(_0xb018('0x1'));var jsonpatch=require(_0xb018('0x2'));var rp=require(_0xb018('0x3'));var moment=require(_0xb018('0x4'));var BPromise=require(_0xb018('0x5'));var Mustache=require(_0xb018('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb018('0x7'));var csv=require('to-csv');var ejs=require(_0xb018('0x8'));var fs=require('fs');var _=require(_0xb018('0x9'));var squel=require(_0xb018('0xa'));var crypto=require(_0xb018('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb018('0xc'));var querystring=require('querystring');var Papa=require(_0xb018('0xd'));var Redis=require(_0xb018('0xe'));var authService=require(_0xb018('0xf'));var qs=require(_0xb018('0x10'));var hardwareService=require(_0xb018('0x11'));var logger=require(_0xb018('0x12'))(_0xb018('0x13'));var utils=require(_0xb018('0x14'));var config=require('../../config/environment');var db=require(_0xb018('0x15'))['db'];config[_0xb018('0x16')]=_[_0xb018('0x17')](config[_0xb018('0x16')],{'host':_0xb018('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsMessage.socket')[_0xb018('0x19')](socket);var jayson=require(_0xb018('0x1a'));var client=jayson[_0xb018('0x1b')][_0xb018('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0xb018('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x5eecb8,_0x2141fb,_0x2d9fa2){if(_0x2d9fa2){var _0x3a9d3b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3a9d3b[_0xb018('0x1d')](_0x2141fb)){return _0x5eecb8;}else{throw new Error(_0xb018('0x1e'));}}else{return _0x5eecb8;}}function respondWithRpcPromise(_0x44e825,_0x59437f,_0x2ef887,_0x4e6bab){return new BPromise(function(_0x125bd1,_0x5c3902){var _0x2927a1=_0x4e6bab||client;return _0x2927a1['request'](_0x44e825,_0x2ef887)[_0xb018('0x1f')](function(_0x197ec7){logger[_0xb018('0x20')]('SmsMessage,\x20%s,\x20%s',_0x59437f,'request\x20sent');logger[_0xb018('0x21')](_0xb018('0x22'),_0x59437f,_0xb018('0x23'),JSON['stringify'](_0x197ec7));if(_0x197ec7[_0xb018('0x24')]){if(_0x197ec7[_0xb018('0x24')][_0xb018('0x25')]===0x1f4){logger[_0xb018('0x24')](_0xb018('0x26'),_0x59437f,_0x197ec7[_0xb018('0x24')][_0xb018('0x27')]);return _0x5c3902(_0x197ec7[_0xb018('0x24')][_0xb018('0x27')]);}logger['error'](_0xb018('0x26'),_0x59437f,_0x197ec7[_0xb018('0x24')]['message']);return _0x125bd1(_0x197ec7[_0xb018('0x24')][_0xb018('0x27')]);}else{logger[_0xb018('0x20')](_0xb018('0x26'),_0x59437f,_0xb018('0x23'));_0x125bd1(_0x197ec7[_0xb018('0x28')][_0xb018('0x27')]);}})[_0xb018('0x29')](function(_0x56f540){logger[_0xb018('0x24')](_0xb018('0x26'),_0x59437f,_0x56f540);_0x5c3902(_0x56f540);});});}function respondWithStatusCode(_0x2d6e61,_0xc27db9){_0xc27db9=_0xc27db9||0xcc;return function(_0x2ee49b){if(_0x2ee49b){return _0x2d6e61[_0xb018('0x2a')](_0xc27db9);}return _0x2d6e61['status'](_0xc27db9)[_0xb018('0x2b')]();};}function respondWithResult(_0x244fd7,_0x3833f8){_0x3833f8=_0x3833f8||0xc8;return function(_0x2c4973){if(_0x2c4973){return _0x244fd7[_0xb018('0x2c')](_0x3833f8)[_0xb018('0x2d')](_0x2c4973);}};}function respondWithFilteredResult(_0x3dd18c,_0x58929c){return function(_0x2112b4){if(_0x2112b4){var _0x24d330=_0x2112b4['count'],_0x5e7a22=_0x58929c[_0xb018('0x2e')],_0x1cdc65=_0x58929c[_0xb018('0x2e')]+_0x58929c[_0xb018('0x2f')],_0x3ead07;if(_0x1cdc65>=_0x24d330){_0x1cdc65=_0x24d330;_0x3ead07=0xc8;}else{_0x3ead07=0xce;}_0x3dd18c[_0xb018('0x2c')](_0x3ead07);return _0x3dd18c[_0xb018('0x30')](_0xb018('0x31'),_0x5e7a22+'-'+_0x1cdc65+'/'+_0x24d330)[_0xb018('0x2d')](_0x2112b4);}return null;};}function patchUpdates(_0x1d65d2){return function(_0x47e924){try{jsonpatch[_0xb018('0x32')](_0x47e924,_0x1d65d2,!![]);}catch(_0x586075){return BPromise[_0xb018('0x33')](_0x586075);}return _0x47e924['save']();};}function saveUpdates(_0x43f2d5,_0x10c374){return function(_0x4c2a0e){if(_0x4c2a0e){return _0x4c2a0e[_0xb018('0x34')](_0x43f2d5)['then'](function(_0x410120){return _0x410120;});}return null;};}function removeEntity(_0x101f56,_0x4b7c51){return function(_0x5aa6ef){if(_0x5aa6ef){return _0x5aa6ef[_0xb018('0x35')]()['then'](function(){_0x101f56['status'](0xcc)[_0xb018('0x2b')]();});}};}function handleEntityNotFound(_0x9473e1,_0x48a177){return function(_0x19244e){if(!_0x19244e){_0x9473e1[_0xb018('0x2a')](0x194);}return _0x19244e;};}function handleError(_0x1733f6,_0x2a6805){_0x2a6805=_0x2a6805||0x1f4;return function(_0x270d8e){logger[_0xb018('0x24')](_0x270d8e[_0xb018('0x36')]);if(_0x270d8e[_0xb018('0x37')]){delete _0x270d8e[_0xb018('0x37')];}_0x1733f6[_0xb018('0x2c')](_0x2a6805)[_0xb018('0x38')](_0x270d8e);};}exports[_0xb018('0x39')]=function(_0x50ba1b,_0x3614cc){var _0x3eaa43={},_0x20d484={},_0x531dfc={'count':0x0,'rows':[]};var _0x1a6fe9=db[_0xb018('0x3a')][_0xb018('0x3b')];_0x20d484[_0xb018('0x3c')]=_['keys'](_0x1a6fe9);_0x20d484[_0xb018('0x3d')]=_[_0xb018('0x3e')](_0x50ba1b['query']);_0x20d484[_0xb018('0x3f')]=_['intersection'](_0x20d484['model'],_0x20d484[_0xb018('0x3d')]);_0x3eaa43[_0xb018('0x40')]=_[_0xb018('0x41')](_0x20d484[_0xb018('0x3c')],qs[_0xb018('0x42')](_0x50ba1b[_0xb018('0x3d')][_0xb018('0x42')]));_0x3eaa43['attributes']=_0x3eaa43[_0xb018('0x40')]['length']?_0x3eaa43[_0xb018('0x40')]:_0x20d484[_0xb018('0x3c')];if(!_0x50ba1b[_0xb018('0x3d')][_0xb018('0x43')](_0xb018('0x44'))){_0x3eaa43[_0xb018('0x2f')]=qs['limit'](_0x50ba1b['query'][_0xb018('0x2f')]);_0x3eaa43[_0xb018('0x2e')]=qs[_0xb018('0x2e')](_0x50ba1b[_0xb018('0x3d')][_0xb018('0x2e')]);}_0x3eaa43[_0xb018('0x45')]=qs[_0xb018('0x46')](_0x50ba1b[_0xb018('0x3d')][_0xb018('0x46')]);_0x3eaa43[_0xb018('0x47')]=qs[_0xb018('0x3f')](_[_0xb018('0x48')](_0x50ba1b[_0xb018('0x3d')],_0x20d484[_0xb018('0x3f')]));if(_0x50ba1b[_0xb018('0x3d')][_0xb018('0x49')]){_0x3eaa43[_0xb018('0x47')]=_[_0xb018('0x4a')](_0x3eaa43[_0xb018('0x47')],{'$or':_['map'](_0x1a6fe9,function(_0x48d88b){if(_0x48d88b[_0xb018('0x4b')][_0xb018('0x4c')]!==_0xb018('0x4d')){var _0x8dc0a6={};_0x8dc0a6[_0x48d88b[_0xb018('0x4e')]]={'$like':'%'+_0x50ba1b[_0xb018('0x3d')][_0xb018('0x49')]+'%'};return _0x8dc0a6;}})});}_0x3eaa43=_[_0xb018('0x4a')]({},_0x3eaa43,_0x50ba1b[_0xb018('0x4f')]);var _0x1c1e96={'where':_0x3eaa43[_0xb018('0x47')]};return db[_0xb018('0x3a')][_0xb018('0x50')](_0x1c1e96)[_0xb018('0x1f')](function(_0x1b1b76){_0x531dfc[_0xb018('0x50')]=_0x1b1b76;if(_0x50ba1b['query'][_0xb018('0x51')]){_0x3eaa43[_0xb018('0x52')]=[{'all':!![]}];}return db[_0xb018('0x3a')][_0xb018('0x53')](_0x3eaa43);})[_0xb018('0x1f')](function(_0x2d4342){_0x531dfc[_0xb018('0x54')]=_0x2d4342;return _0x531dfc;})['then'](respondWithFilteredResult(_0x3614cc,_0x3eaa43))[_0xb018('0x29')](handleError(_0x3614cc,null));};exports['show']=function(_0x53d56d,_0x436698){var _0x2e2371={'raw':!![],'where':{'id':_0x53d56d['params']['id']}},_0x2eab98={};_0x2eab98[_0xb018('0x3c')]=_[_0xb018('0x3e')](db[_0xb018('0x3a')][_0xb018('0x3b')]);_0x2eab98[_0xb018('0x3d')]=_[_0xb018('0x3e')](_0x53d56d[_0xb018('0x3d')]);_0x2eab98[_0xb018('0x3f')]=_[_0xb018('0x41')](_0x2eab98[_0xb018('0x3c')],_0x2eab98[_0xb018('0x3d')]);_0x2e2371[_0xb018('0x40')]=_['intersection'](_0x2eab98[_0xb018('0x3c')],qs[_0xb018('0x42')](_0x53d56d[_0xb018('0x3d')][_0xb018('0x42')]));_0x2e2371[_0xb018('0x40')]=_0x2e2371['attributes'][_0xb018('0x55')]?_0x2e2371['attributes']:_0x2eab98[_0xb018('0x3c')];if(_0x53d56d['query']['includeAll']){_0x2e2371[_0xb018('0x52')]=[{'all':!![]}];}_0x2e2371=_[_0xb018('0x4a')]({},_0x2e2371,_0x53d56d['options']);return db[_0xb018('0x3a')][_0xb018('0x56')](_0x2e2371)['then'](handleEntityNotFound(_0x436698,null))[_0xb018('0x1f')](respondWithResult(_0x436698,null))[_0xb018('0x29')](handleError(_0x436698,null));};exports[_0xb018('0x57')]=function(_0x5a3faf,_0x365520){return db['SmsMessage'][_0xb018('0x57')](_0x5a3faf[_0xb018('0x58')],{})[_0xb018('0x1f')](respondWithResult(_0x365520,0xc9))[_0xb018('0x29')](handleError(_0x365520,null));};exports[_0xb018('0x34')]=function(_0x516e55,_0x1125d6){if(_0x516e55[_0xb018('0x58')]['id']){delete _0x516e55[_0xb018('0x58')]['id'];}return db[_0xb018('0x3a')][_0xb018('0x56')]({'where':{'id':_0x516e55[_0xb018('0x59')]['id']}})[_0xb018('0x1f')](handleEntityNotFound(_0x1125d6,null))[_0xb018('0x1f')](saveUpdates(_0x516e55[_0xb018('0x58')],null))[_0xb018('0x1f')](respondWithResult(_0x1125d6,null))[_0xb018('0x29')](handleError(_0x1125d6,null));};exports[_0xb018('0x35')]=function(_0xafbe1,_0x11ce28){return db[_0xb018('0x3a')][_0xb018('0x56')]({'where':{'id':_0xafbe1['params']['id']}})[_0xb018('0x1f')](handleEntityNotFound(_0x11ce28,null))[_0xb018('0x1f')](removeEntity(_0x11ce28,null))[_0xb018('0x29')](handleError(_0x11ce28,null));};exports[_0xb018('0x5a')]=function(_0x17a402,_0x25d5b0){return db['SmsMessage'][_0xb018('0x5a')]()[_0xb018('0x1f')](respondWithResult(_0x25d5b0,null))['catch'](handleError(_0x25d5b0,null));};var interaction_log=require(_0xb018('0x12'))(_0xb018('0x5b'));exports[_0xb018('0x5c')]=function(_0xddb476,_0x3e1998,_0x36ca06){var _0x381364={'channel':_0xb018('0x5d')};if(_0xddb476[_0xb018('0x58')]['id']){delete _0xddb476['body']['id'];}_0xddb476[_0xb018('0x58')][_0xb018('0x5e')]=!![];_0xddb476[_0xb018('0x58')]['readAt']=moment()[_0xb018('0x5f')](_0xb018('0x60'));_0xddb476[_0xb018('0x58')][_0xb018('0x61')]=_0xddb476['body'][_0xb018('0x61')]||_0xddb476[_0xb018('0x62')]['id'];return db[_0xb018('0x3a')]['find']({'where':{'id':_0xddb476[_0xb018('0x59')]['id'],'UserId':null},'include':[{'model':db[_0xb018('0x63')],'as':_0xb018('0x64')}]})[_0xb018('0x1f')](handleEntityNotFound(_0x3e1998,null))[_0xb018('0x1f')](saveUpdates(_0xddb476[_0xb018('0x58')],null))[_0xb018('0x1f')](function(_0x45f981){if(_0x45f981){_0x381364['message']=_0x45f981[_0xb018('0x65')]({'plain':!![]});return db[_0xb018('0x66')][_0xb018('0x56')]({'where':{'id':_0x45f981[_0xb018('0x67')]}});}return null;})[_0xb018('0x1f')](handleEntityNotFound(_0x3e1998,null))[_0xb018('0x1f')](function(_0x6d09e6){if(_0x6d09e6){return _0x6d09e6[_0xb018('0x34')]({'UserId':_0xddb476[_0xb018('0x58')][_0xb018('0x61')],'read1stAt':_['isNil'](_0x6d09e6[_0xb018('0x68')])?moment()[_0xb018('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb018('0x1f')](function(_0x227f33){if(_0x227f33){_0x381364['interaction']=_0x227f33[_0xb018('0x65')]({'plain':!![]});interaction_log[_0xb018('0x20')](_0xb018('0x69'),_0xddb476['user']['id'],_0xddb476['user']['name'],_0xddb476['user'][_0xb018('0x6a')],_0x381364[_0xb018('0x6b')]['id'],_0xddb476[_0xb018('0x58')]?JSON[_0xb018('0x6c')](_0xddb476[_0xb018('0x58')]):'null');return respondWithRpcPromise(_0xb018('0x6d'),_0xb018('0x6e'),_0x381364);}return null;})['then'](function(_0x290f69){if(_0x290f69){if(_0xddb476[_0xb018('0x58')][_0xb018('0x6f')]){_0x381364[_0xb018('0x27')]['interface']=util['format'](_0xb018('0x70'),_0xddb476[_0xb018('0x62')]['name']);_0x381364['message'][_0xb018('0x71')]=_0x381364[_0xb018('0x71')];_0x381364[_0xb018('0x27')][_0xb018('0x72')]=_0xb018('0x5c');return respondWithRpcPromise(_0xb018('0x73'),_0xb018('0x73'),{'event':_0xb018('0x74'),'message':_0x381364[_0xb018('0x27')]},client9002)[_0xb018('0x1f')](function(){return _0x381364;});}return _0x381364;}return null;})[_0xb018('0x1f')](respondWithResult(_0x3e1998,null))['catch'](handleError(_0x3e1998,null));};var interaction_log=require(_0xb018('0x12'))('sms-interactions');exports['reject']=function(_0x460ecd,_0x3900f7,_0x3fba62){var _0x2a6573={'agent':{},'channel':_0xb018('0x5d')};if(_0x460ecd['body']['id']){delete _0x460ecd['body']['id'];}_0x460ecd[_0xb018('0x58')][_0xb018('0x61')]=_0x460ecd[_0xb018('0x58')][_0xb018('0x61')]||_0x460ecd['user']['id'];_0x2a6573[_0xb018('0x75')]['id']=_0x460ecd[_0xb018('0x58')]['UserId'];return db[_0xb018('0x3a')][_0xb018('0x56')]({'where':{'id':_0x460ecd[_0xb018('0x59')]['id'],'UserId':null}})[_0xb018('0x1f')](handleEntityNotFound(_0x3900f7,null))[_0xb018('0x1f')](function(_0x447e1c){if(_0x447e1c){_0x2a6573[_0xb018('0x27')]=_0x447e1c[_0xb018('0x65')]({'plain':!![]});return db[_0xb018('0x66')][_0xb018('0x56')]({'where':{'id':_0x447e1c['SmsInteractionId']}});}return null;})[_0xb018('0x1f')](handleEntityNotFound(_0x3900f7,null))[_0xb018('0x1f')](function(_0x3af703){if(_0x3af703){_0x2a6573[_0xb018('0x6b')]=_0x3af703[_0xb018('0x65')]({'plain':!![]});interaction_log[_0xb018('0x20')](_0xb018('0x76'),_0x460ecd[_0xb018('0x62')]['id'],_0x460ecd[_0xb018('0x62')][_0xb018('0x37')],_0x460ecd['user']['role'],_0x2a6573['interaction']['id'],_0x460ecd[_0xb018('0x58')]?JSON[_0xb018('0x6c')](_0x460ecd[_0xb018('0x58')]):'null');return respondWithRpcPromise(_0xb018('0x77'),_0xb018('0x78'),_0x2a6573);}return null;})[_0xb018('0x1f')](function(_0x3a2ff1){if(_0x3a2ff1){_0x3a2ff1[_0xb018('0x27')][_0xb018('0x79')]=util[_0xb018('0x5f')](_0xb018('0x70'),_0x460ecd[_0xb018('0x62')][_0xb018('0x37')]);_0x3a2ff1['message'][_0xb018('0x71')]=_0x2a6573[_0xb018('0x71')];_0x3a2ff1[_0xb018('0x27')][_0xb018('0x72')]=_0xb018('0x33');respondWithRpcPromise(_0xb018('0x73'),_0xb018('0x73'),{'event':_0xb018('0x7a'),'message':_0x3a2ff1[_0xb018('0x27')]},client9002);return _0x2a6573;}return null;})['then'](respondWithResult(_0x3900f7,null))['catch'](handleError(_0x3900f7,null));};exports['status']=function(_0x2f2fc9,_0x2b8c92,_0x2b6f1d){if(_0x2f2fc9['body']['id']){delete _0x2f2fc9[_0xb018('0x58')]['id'];}var _0x48d065;return db['SmsMessage']['find']({'where':{'id':_0x2f2fc9[_0xb018('0x59')]['id']}})[_0xb018('0x1f')](handleEntityNotFound(_0x2b8c92,null))['then'](function(_0x1a70ee){if(_0x1a70ee){_0x48d065=_0x1a70ee;return db[_0xb018('0x7b')]['find']({'where':{'id':_0x1a70ee[_0xb018('0x7c')]}});}})[_0xb018('0x1f')](handleEntityNotFound(_0x2b8c92,null))[_0xb018('0x1f')](function(_0x5d7c65){if(_0x5d7c65){logger[_0xb018('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb018('0x2c'),_0xb018('0x7d'),_0x5d7c65['type'],util[_0xb018('0x7e')](_0x2f2fc9[_0xb018('0x58')],{'showHidden':![],'depth':null}));switch(_0x5d7c65[_0xb018('0x4b')]){case'twilio':if(_0x2f2fc9['body']['MessageSid']&&_0x2f2fc9[_0xb018('0x58')]['MessageSid']===_0x48d065['messageId']){return _0x48d065['update']({'read':!![]});}else{logger[_0xb018('0x24')](_0xb018('0x7f'),'status',_0xb018('0x80'),util[_0xb018('0x7e')](_0x2f2fc9[_0xb018('0x58')],{'showHidden':![],'depth':null}));}break;case _0xb018('0x81'):if(_0x2f2fc9[_0xb018('0x58')][_0xb018('0x82')]&&_0x2f2fc9['body'][_0xb018('0x82')]===_0x48d065[_0xb018('0x83')]&&_[_0xb018('0x84')]([_0xb018('0x85'),_0xb018('0x86')],_0x2f2fc9['body'][_0xb018('0x87')])>=0x0){return _0x48d065[_0xb018('0x34')]({'read':!![]});}else{logger[_0xb018('0x24')](_0xb018('0x7f'),_0xb018('0x2c'),_0xb018('0x88'),util[_0xb018('0x7e')](_0x2f2fc9[_0xb018('0x58')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0xcba33b=_0x2f2fc9[_0xb018('0x58')][_0xb018('0x89')][0x0];if(_0xcba33b[_0xb018('0x2c')][_0xb018('0x8a')]===_0xb018('0x8b')){return _0x48d065['update']({'read':!![]});}else{logger[_0xb018('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb018('0x2c'),'infobip',util['inspect'](_0x2f2fc9[_0xb018('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x48d065;}})[_0xb018('0x1f')](respondWithResult(_0x2b8c92,null))[_0xb018('0x29')](handleError(_0x2b8c92,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 00dd41b..67843a3 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 _0x9f4d=['events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x31abee,_0x11ff0c){var _0x3c1761=function(_0x2b5062){while(--_0x2b5062){_0x31abee['push'](_0x31abee['shift']());}};_0x3c1761(++_0x11ff0c);}(_0x9f4d,0xb0));var _0xd9f4=function(_0x1e6aa7,_0x3282c6){_0x1e6aa7=_0x1e6aa7-0x0;var _0x5f20c3=_0x9f4d[_0x1e6aa7];return _0x5f20c3;};'use strict';var EventEmitter=require(_0xd9f4('0x0'));var SmsMessage=require(_0xd9f4('0x1'))['db'][_0xd9f4('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xd9f4('0x3')](0x0);var events={'afterCreate':_0xd9f4('0x4'),'afterUpdate':_0xd9f4('0x5'),'afterDestroy':_0xd9f4('0x6')};function emitEvent(_0x273eb9){return function(_0x7dccea,_0x5e0ab0,_0x2c39cb){SmsMessageEvents['emit'](_0x273eb9+':'+_0x7dccea['id'],_0x7dccea);SmsMessageEvents[_0xd9f4('0x7')](_0x273eb9,_0x7dccea);_0x2c39cb(null);};}for(var e in events){if(events[_0xd9f4('0x8')](e)){var event=events[e];SmsMessage[_0xd9f4('0x9')](e,emitEvent(event));}}module[_0xd9f4('0xa')]=SmsMessageEvents; \ No newline at end of file +var _0xbdb7=['save','update','remove','hasOwnProperty','hook','events','../../mysqldb','SmsMessage','setMaxListeners'];(function(_0x56a728,_0x39c4f6){var _0x2765b9=function(_0x57edac){while(--_0x57edac){_0x56a728['push'](_0x56a728['shift']());}};_0x2765b9(++_0x39c4f6);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x492f45,_0x4bbf55){_0x492f45=_0x492f45-0x0;var _0x297b67=_0xbdb7[_0x492f45];return _0x297b67;};'use strict';var EventEmitter=require(_0x7bdb('0x0'));var SmsMessage=require(_0x7bdb('0x1'))['db'][_0x7bdb('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x7bdb('0x3')](0x0);var events={'afterCreate':_0x7bdb('0x4'),'afterUpdate':_0x7bdb('0x5'),'afterDestroy':_0x7bdb('0x6')};function emitEvent(_0x2c7e07){return function(_0x46c068,_0x47aec5,_0x28542c){SmsMessageEvents['emit'](_0x2c7e07+':'+_0x46c068['id'],_0x46c068);SmsMessageEvents['emit'](_0x2c7e07,_0x46c068);_0x28542c(null);};}for(var e in events){if(events[_0x7bdb('0x7')](e)){var event=events[e];SmsMessage[_0x7bdb('0x8')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index e5bf224..8bc617b 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 _0x3f0f=['Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','timestamp','keys','sort','createHash','md5','hex','signature=','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','./smsMessage.attributes','exports','define','messageId','fti_sms_messages','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','error','SmsAccount','SmsAccountId','type','twilio','accountSid','phone','authToken','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','catch','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','username','&password=','GET','split','POST','user_key','session_key','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','body','senderString','https://smsapi.connectel.se/api/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','Basic\x20%s','toString','base64','http_code','queued_count','head','message_id','clickSend','authId','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo'];(function(_0x53c88e,_0x53d742){var _0x42734a=function(_0x7a79bc){while(--_0x7a79bc){_0x53c88e['push'](_0x53c88e['shift']());}};_0x42734a(++_0x53d742);}(_0x3f0f,0x9b));var _0xf3f0=function(_0x487b78,_0x49bb51){_0x487b78=_0x487b78-0x0;var _0x350c47=_0x3f0f[_0x487b78];return _0x350c47;};'use strict';var _=require(_0xf3f0('0x0'));var util=require(_0xf3f0('0x1'));var logger=require('../../config/logger')(_0xf3f0('0x2'));var moment=require(_0xf3f0('0x3'));var BPromise=require(_0xf3f0('0x4'));var rp=require(_0xf3f0('0x5'));var fs=require('fs');var path=require(_0xf3f0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf3f0('0x7'));module[_0xf3f0('0x8')]=function(_0x332090,_0x4d28d7){return _0x332090[_0xf3f0('0x9')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xf3f0('0xa'),'fields':[_0xf3f0('0xa')]},{'name':_0xf3f0('0xb'),'fields':['body'],'type':_0xf3f0('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5e0d1f,_0x42e83d,_0x1a6be9){var _0x18dc4b=_0x332090[_0xf3f0('0xd')];var _0x1348b5=_0x5e0d1f[_0xf3f0('0xe')]({'plain':!![]});if(_0x1348b5['direction'][_0xf3f0('0xf')]()==='in'||_0x1348b5[_0xf3f0('0x10')][_0xf3f0('0xf')]()===_0xf3f0('0x11')&&!_0x1348b5[_0xf3f0('0x12')]&&!_[_0xf3f0('0x13')](_0x1348b5['UserId'])){_0x18dc4b[_0xf3f0('0x14')][_0xf3f0('0x15')]({'where':{'id':_0x1348b5[_0xf3f0('0x16')]}})[_0xf3f0('0x17')](function(_0x310147){if(_0x310147){_0x310147[_0xf3f0('0x18')]({'lastMsgAt':_0x1348b5[_0xf3f0('0x19')],'lastMsgDirection':_0x1348b5[_0xf3f0('0x10')][_0xf3f0('0xf')]()});}})['catch'](function(_0x4fcb80){console[_0xf3f0('0x1a')](_0x4fcb80);});}if(_0x1348b5['direction']===_0xf3f0('0x11')&&!_0x1348b5[_0xf3f0('0x12')]){var _0x934311;_0x18dc4b[_0xf3f0('0x1b')]['find']({'where':{'id':_0x1348b5[_0xf3f0('0x1c')]},'raw':!![]})[_0xf3f0('0x17')](function(_0x13739){_0x934311=_0x13739;if(_0x934311&&_0x934311[_0xf3f0('0x1d')]){switch(_0x934311['type']){case _0xf3f0('0x1e'):var _0x11b85c=require(_0xf3f0('0x1e'));if(_0x934311[_0xf3f0('0x1f')]&&_0x934311['authToken']&&_0x934311[_0xf3f0('0x20')]){var _0x3e81e3=new _0x11b85c(_0x934311[_0xf3f0('0x1f')],_0x934311[_0xf3f0('0x21')]);_0x3e81e3[_0xf3f0('0x22')][_0xf3f0('0x23')]({'body':_0x1348b5['body'],'to':_0x1348b5[_0xf3f0('0x20')],'from':_0x934311[_0xf3f0('0x20')],'statusCallback':_0x934311[_0xf3f0('0x24')]+_0xf3f0('0x25')+_0x1348b5['id']+_0xf3f0('0x26')+_0x934311[_0xf3f0('0x27')]})[_0xf3f0('0x17')](function(_0x4e7c9d){if(_0x4e7c9d[_0xf3f0('0x28')]){return _0x5e0d1f['update']({'messageId':_0x4e7c9d[_0xf3f0('0x28')]});}})[_0xf3f0('0x29')](function(_0x5cc794){logger[_0xf3f0('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf3f0('0x2a'),_0xf3f0('0x1e'),util[_0xf3f0('0x2b')](_0x5cc794,{'showHidden':![],'depth':null}));});}else{logger[_0xf3f0('0x1a')](_0xf3f0('0x2c'),_0xf3f0('0x2a'),_0xf3f0('0x1e'),_0xf3f0('0x2d'));}break;case _0xf3f0('0x2e'):var _0xcbe131=_0xf3f0('0x2f');if(_0x934311['username']&&_0x934311[_0xf3f0('0x30')]){var _0x30a5c0={'recipient':[_0x1348b5[_0xf3f0('0x20')]],'message':_0x1348b5['body'],'message_type':_0x934311[_0xf3f0('0x31')]};if(_0x934311[_0xf3f0('0x31')]&&_0x934311[_0xf3f0('0x31')]!=='SI'){_0x30a5c0[_0xf3f0('0x32')]=_0x934311[_0xf3f0('0x20')];}var _0x472f58={'url':_0xcbe131+_0xf3f0('0x33')+_0x934311[_0xf3f0('0x34')]+_0xf3f0('0x35')+_0x934311[_0xf3f0('0x30')],'method':_0xf3f0('0x36')};rp(_0x472f58)[_0xf3f0('0x17')](function(_0x5e74c0){var _0x5bca4a=_0x5e74c0[_0xf3f0('0x37')](';');var _0x30f784={'user_key':_0x5bca4a[0x0],'session_key':_0x5bca4a[0x1]};_0x472f58={'url':_0xcbe131+'sms','method':_0xf3f0('0x38'),'headers':{'user_key':_0x30f784[_0xf3f0('0x39')],'Session_key':_0x30f784[_0xf3f0('0x3a')]},'json':!![],'body':_0x30a5c0};return rp(_0x472f58);})[_0xf3f0('0x17')](function(_0x154e7b){if(_0x154e7b['total_sent']>=0x1){var _0xb1314c={'messageId':_0x154e7b[_0xf3f0('0x3b')]};if(_0x934311[_0xf3f0('0x31')]!=='GP'||!_0x934311[_0xf3f0('0x3c')]){_0xb1314c[_0xf3f0('0x3d')]=!![];}return _0x5e0d1f['update'](_0xb1314c);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf3f0('0x2a'),_0xf3f0('0x2e'),util[_0xf3f0('0x2b')](_0x154e7b,{'showHidden':![],'depth':null}));}})[_0xf3f0('0x29')](function(_0x50ffce){return logger[_0xf3f0('0x1a')](_0xf3f0('0x2c'),_0xf3f0('0x2a'),_0xf3f0('0x2e'),util[_0xf3f0('0x2b')](_0x50ffce,{'showHidden':![],'depth':null}));});}else{logger[_0xf3f0('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf3f0('0x2a'),_0xf3f0('0x2e'),_0xf3f0('0x3e'));}break;case _0xf3f0('0x3f'):if(_0x934311[_0xf3f0('0x21')]){var _0x15ddc0={'recipient':_0x1348b5[_0xf3f0('0x20')],'message':_0x1348b5[_0xf3f0('0x40')],'sender':_0x934311[_0xf3f0('0x41')]||_0x934311[_0xf3f0('0x20')],'authorization':_0x934311['authToken']};var _0x42e83d={'method':_0xf3f0('0x38'),'uri':_0xf3f0('0x42'),'body':_0x15ddc0,'json':!![]};rp(_0x42e83d)[_0xf3f0('0x17')](function(_0x181ef6){var _0x3d6b38={'messageId':_0x181ef6[_0xf3f0('0x43')]};if(!_0x934311['deliveryReport']){_0x3d6b38[_0xf3f0('0x3d')]=!![];}return _0x5e0d1f[_0xf3f0('0x18')](_0x3d6b38);})[_0xf3f0('0x29')](function(_0x40d338){logger[_0xf3f0('0x1a')](_0xf3f0('0x2c'),'afterCreate','connectel',util[_0xf3f0('0x2b')](_0x40d338,{'showHidden':![],'depth':null}));});}else{logger[_0xf3f0('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf3f0('0x2a'),'connectel',_0xf3f0('0x44'));}break;case _0xf3f0('0x45'):if(_0x934311[_0xf3f0('0x34')]&&_0x934311[_0xf3f0('0x30')]){var _0x15ddc0={'messages':[{'source':_0xf3f0('0x46'),'to':_0x1348b5['phone'],'body':_0x1348b5[_0xf3f0('0x40')],'from':_0x934311[_0xf3f0('0x41')]||_0x934311[_0xf3f0('0x20')]}]};var _0x26aeb0=util[_0xf3f0('0x47')]('%s:%s',_0x934311[_0xf3f0('0x34')],_0x934311['password']);var _0x42e83d={'method':_0xf3f0('0x38'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x15ddc0,'headers':{'Authorization':util['format'](_0xf3f0('0x48'),new Buffer(_0x26aeb0)[_0xf3f0('0x49')](_0xf3f0('0x4a')))},'json':!![]};rp(_0x42e83d)[_0xf3f0('0x17')](function(_0x95662a){if(_0x95662a[_0xf3f0('0x4b')]>=0xc8&&_0x95662a[_0xf3f0('0x4b')]<=0xce){if(_0x95662a['data']&&_0x95662a['data'][_0xf3f0('0x4c')]>0x0){var _0x10636a=_[_0xf3f0('0x4d')](_0x95662a['data'][_0xf3f0('0x22')]);var _0x17b2cf={'messageId':_0x10636a[_0xf3f0('0x4e')]};if(!_0x934311[_0xf3f0('0x3c')]){_0x17b2cf[_0xf3f0('0x3d')]=!![];}return _0x5e0d1f[_0xf3f0('0x18')](_0x17b2cf);}else{logger[_0xf3f0('0x1a')](_0xf3f0('0x2c'),_0xf3f0('0x2a'),_0xf3f0('0x4f'),util['inspect'](_0x95662a,{'showHidden':![],'depth':null}));}}else{logger[_0xf3f0('0x1a')](_0xf3f0('0x2c'),'afterCreate',_0xf3f0('0x4f'),util[_0xf3f0('0x2b')](_0x95662a,{'showHidden':![],'depth':null}));}})[_0xf3f0('0x29')](function(_0x498d06){logger[_0xf3f0('0x1a')](_0xf3f0('0x2c'),_0xf3f0('0x2a'),_0xf3f0('0x4f'),util[_0xf3f0('0x2b')](_0x498d06,{'showHidden':![],'depth':null}));});}else{logger[_0xf3f0('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf3f0('0x2a'),'clickSend',_0xf3f0('0x3e'));}break;case'plivo':if(_0x934311[_0xf3f0('0x50')]&&_0x934311[_0xf3f0('0x21')]){var _0x15ddc0={'dst':_0x1348b5[_0xf3f0('0x20')],'text':_0x1348b5[_0xf3f0('0x40')],'src':_0x934311[_0xf3f0('0x41')]||_0x934311[_0xf3f0('0x20')],'url':_0x934311['remote']+'/api/sms/messages/'+_0x1348b5['id']+_0xf3f0('0x26')+_0x934311[_0xf3f0('0x27')]};var _0x26aeb0=util[_0xf3f0('0x47')](_0xf3f0('0x51'),_0x934311['authId'],_0x934311[_0xf3f0('0x21')]);var _0x42e83d={'method':_0xf3f0('0x38'),'uri':util['format'](_0xf3f0('0x52'),_0x934311[_0xf3f0('0x50')]),'body':_0x15ddc0,'headers':{'Authorization':util[_0xf3f0('0x47')](_0xf3f0('0x48'),new Buffer(_0x26aeb0)['toString']('base64'))},'json':!![]};rp(_0x42e83d)['then'](function(_0x123c26){var _0xb5a6ad={'messageId':_0x123c26[_0xf3f0('0x53')][0x0]};return _0x5e0d1f['update'](_0xb5a6ad);})[_0xf3f0('0x29')](function(_0x149686){logger[_0xf3f0('0x1a')](_0xf3f0('0x2c'),_0xf3f0('0x2a'),_0xf3f0('0x54'),util['inspect'](_0x149686,{'showHidden':![],'depth':null}));});}else{logger[_0xf3f0('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf3f0('0x54'),_0xf3f0('0x55'));}break;case'infobip':if(_0x934311[_0xf3f0('0x34')]&&_0x934311['password']){if(_0x934311['baseUrl']){var _0x194864={'method':_0xf3f0('0x38'),'uri':_0x934311[_0xf3f0('0x56')]+_0xf3f0('0x57'),'body':{'username':_0x934311[_0xf3f0('0x34')],'password':_0x934311[_0xf3f0('0x30')]},'json':!![]};return rp(_0x194864)[_0xf3f0('0x17')](function(_0xde070){var _0xb77e6f={'method':_0xf3f0('0x38'),'uri':_0x934311['baseUrl']+_0xf3f0('0x58'),'body':{'messages':[{'from':_0x934311[_0xf3f0('0x20')],'destinations':[{'to':_0x1348b5['phone']}],'text':_0x1348b5['body'],'notifyUrl':_0x934311[_0xf3f0('0x24')]+_0xf3f0('0x25')+_0x1348b5['id']+'/status?token='+_0x934311[_0xf3f0('0x27')],'notifyContentType':_0xf3f0('0x59'),'callbackData':_0x934311[_0xf3f0('0x20')]+';'+_0x1348b5[_0xf3f0('0x40')]}]},'headers':{'Authorization':_0xf3f0('0x5a')+_0xde070[_0xf3f0('0x27')]},'json':!![]};return rp(_0xb77e6f)['then'](function(_0x3949d){if(_0x3949d['messages']){var _0x15084d={'messageId':_0x3949d['messages'][0x0][_0xf3f0('0xa')]};if(!_0x934311['deliveryReport']){_0x15084d[_0xf3f0('0x3d')]=!![];}return _0x5e0d1f['update'](_0x15084d);}else{return logger[_0xf3f0('0x1a')](_0xf3f0('0x2c'),'afterCreate',_0xf3f0('0x5b'),util[_0xf3f0('0x2b')](_0x3949d,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x4d9f8e){return logger[_0xf3f0('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf3f0('0x2a'),_0xf3f0('0x5b'),util[_0xf3f0('0x2b')](_0x4d9f8e,{'showHidden':![],'depth':null}));});}else{logger[_0xf3f0('0x1a')](_0xf3f0('0x2c'),_0xf3f0('0x2a'),_0xf3f0('0x5b'),_0xf3f0('0x5c'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf3f0('0x2a'),_0xf3f0('0x5b'),_0xf3f0('0x3e'));}break;case _0xf3f0('0x5d'):var _0x14feed=require(_0xf3f0('0x5e'));if(_0x934311[_0xf3f0('0x5f')]){var _0xb71266={};_0xb71266['login']=_0x934311[_0xf3f0('0x34')];_0xb71266[_0xf3f0('0x20')]=_0x1348b5[_0xf3f0('0x20')];_0xb71266[_0xf3f0('0x32')]=_0x934311['phone'];_0xb71266['text']=_0x1348b5['body'];_0xb71266[_0xf3f0('0x60')]=+new Date();var _0x41b8ba='';var _0x5b27b5='';var _0x435550=Object[_0xf3f0('0x61')](_0xb71266);_0x435550[_0xf3f0('0x62')]();for(var _0x7ef8c6=0x0;_0x7ef8c6<_0x435550['length'];_0x7ef8c6++){if(_0x41b8ba!=''){_0x41b8ba+='&';}_0x41b8ba+=_0x435550[_0x7ef8c6]+'='+encodeURIComponent(_0xb71266[_0x435550[_0x7ef8c6]]);_0x5b27b5+=_0xb71266[_0x435550[_0x7ef8c6]];}_0x5b27b5+=_0x934311[_0xf3f0('0x5f')];_0x5b27b5=_0x14feed[_0xf3f0('0x63')](_0xf3f0('0x64'))[_0xf3f0('0x18')](_0x5b27b5)['digest'](_0xf3f0('0x65'));if(_0x41b8ba!==''){_0x41b8ba+='&';}_0x41b8ba+=_0xf3f0('0x66')+_0x5b27b5;var _0x472f58={'method':_0xf3f0('0x36'),'uri':'https://sms.csc.lv/external/get/send.php?'+_0x41b8ba,'json':!![]};return rp(_0x472f58)[_0xf3f0('0x17')](function(_0x2e1dce){var _0x52e7e2=Object['keys'](_0x2e1dce);if(_0x2e1dce[_0x52e7e2[0x0]][_0xf3f0('0x1a')]&&parseInt(_0x2e1dce[_0x52e7e2[0x0]]['error'])===0x0){var _0x3802a2={'messageId':_0x2e1dce[_0x52e7e2[0x0]][_0xf3f0('0x67')]};if(!_0x934311[_0xf3f0('0x3c')]){_0x3802a2[_0xf3f0('0x3d')]=!![];}return _0x5e0d1f['update'](_0x3802a2);}else{return logger[_0xf3f0('0x1a')](_0xf3f0('0x2c'),_0xf3f0('0x2a'),'csc',util['inspect'](_0x2e1dce['error'],{'showHidden':![],'depth':null}));}})[_0xf3f0('0x29')](function(_0x10af25){return logger['error'](_0xf3f0('0x2c'),_0xf3f0('0x2a'),_0xf3f0('0x5d'),util[_0xf3f0('0x2b')](_0x10af25,{'showHidden':![],'depth':null}));});}else{logger[_0xf3f0('0x1a')](_0xf3f0('0x2c'),'afterCreate',_0xf3f0('0x5d'),_0xf3f0('0x68'));}break;case _0xf3f0('0x69'):if(_0x934311[_0xf3f0('0x5f')]){var _0x569a24={'method':_0xf3f0('0x38'),'uri':_0xf3f0('0x6a'),'headers':{'Authorization':_0x934311[_0xf3f0('0x5f')]},'body':{'content':_0x1348b5[_0xf3f0('0x40')],'to':[_0x1348b5[_0xf3f0('0x20')]],'from':_0x934311[_0xf3f0('0x20')],'binary':![],'clientMessageId':_0xf3f0('0x6b'),'charset':'UTF-8'},'json':!![]};rp(_0x569a24)[_0xf3f0('0x17')](function(_0x2fec9b){if(!_0x2fec9b['error']){var _0x34859a={'messageId':_0x2fec9b[_0xf3f0('0x22')][0x0][_0xf3f0('0x6c')]};if(!_0x934311[_0xf3f0('0x3c')]){_0x34859a[_0xf3f0('0x3d')]=!![];}return _0x5e0d1f[_0xf3f0('0x18')](_0x34859a);}else{return logger[_0xf3f0('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf3f0('0x69'),util[_0xf3f0('0x2b')](_0x2fec9b[_0xf3f0('0x1a')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x511a20){return logger['error'](_0xf3f0('0x2c'),'afterCreate','clickatell',util[_0xf3f0('0x2b')](_0x511a20,{'showHidden':![],'depth':null}));});}else{logger[_0xf3f0('0x1a')](_0xf3f0('0x2c'),_0xf3f0('0x2a'),_0xf3f0('0x69'),_0xf3f0('0x68'));}break;case _0xf3f0('0x6d'):if(_0x934311[_0xf3f0('0x5f')]){var _0x201d54={};var _0x472f58={'method':'POST','uri':_0xf3f0('0x6e'),'headers':{'Authorization':'Bearer\x20'+_0x934311[_0xf3f0('0x5f')],'Content-Type':_0xf3f0('0x59')},'body':{'from':_0x934311[_0xf3f0('0x20')],'to':_0x1348b5['phone'],'text':_0x1348b5[_0xf3f0('0x40')]},'json':!![]};return rp(_0x472f58)[_0xf3f0('0x17')](function(_0x286aff){if(_0x286aff[_0xf3f0('0x6f')]==0xca){_0x201d54[_0xf3f0('0x70')]=_0x286aff;var _0x1a0c4f={'method':_0xf3f0('0x38'),'uri':_0xf3f0('0x71'),'headers':{'Authorization':_0xf3f0('0x72')+_0x934311[_0xf3f0('0x5f')],'Content-Type':_0xf3f0('0x59')},'body':{'refid':_0x201d54[_0xf3f0('0x70')][_0xf3f0('0x73')]},'json':!![]};return rp(_0x1a0c4f)['then'](function(_0x5fc93a){_0x201d54[_0xf3f0('0x74')]=_0x5fc93a;var _0x2164df={'messageId':_0x201d54[_0xf3f0('0x70')][_0xf3f0('0x73')],'read':!![]};return _0x5e0d1f['update'](_0x2164df);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf3f0('0x2a'),_0xf3f0('0x6d'),util[_0xf3f0('0x2b')](_0x286aff,{'showHidden':![],'depth':null}));}})[_0xf3f0('0x29')](function(_0x53cb37){return logger[_0xf3f0('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf3f0('0x2a'),_0xf3f0('0x6d'),util[_0xf3f0('0x2b')](_0x53cb37,{'showHidden':![],'depth':null}));});}else{return logger[_0xf3f0('0x1a')](_0xf3f0('0x2c'),'afterCreate','intelepeer',_0xf3f0('0x75'));}break;}}})['finally'](function(){_0x1a6be9();});}else{_0x1a6be9();}}},'charset':_0xf3f0('0x76'),'collate':_0xf3f0('0x77')});}; \ No newline at end of file +var _0xdbdc=['isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','catch','error','SmsAccount','find','type','twilio','authToken','phone','accountSid','messages','create','body','remote','/api/sms/messages/','token','sid','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','GET','split','session_key','internal_order_id','read','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','https://smsapi.connectel.se/api/send/','deliveryReport','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','head','message_id','clickSend','authId','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','login','text','sort','length','apiKey','createHash','md5','hex','signature=','https://sms.csc.lv/external/get/send.php?','keys','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','intelepeer','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','FULLTEXT','models','get','direction','toLowerCase','out'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xdbdc,0x1cd));var _0xcdbd=function(_0x2cb4c1,_0x453ec0){_0x2cb4c1=_0x2cb4c1-0x0;var _0x3eafe6=_0xdbdc[_0x2cb4c1];return _0x3eafe6;};'use strict';var _=require(_0xcdbd('0x0'));var util=require(_0xcdbd('0x1'));var logger=require(_0xcdbd('0x2'))(_0xcdbd('0x3'));var moment=require(_0xcdbd('0x4'));var BPromise=require('bluebird');var rp=require(_0xcdbd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcdbd('0x6'));var config=require(_0xcdbd('0x7'));var attributes=require('./smsMessage.attributes');module[_0xcdbd('0x8')]=function(_0x321070,_0x5b73ab){return _0x321070[_0xcdbd('0x9')](_0xcdbd('0xa'),attributes,{'tableName':_0xcdbd('0xb'),'paranoid':![],'indexes':[{'name':_0xcdbd('0xc'),'fields':[_0xcdbd('0xc')]},{'name':'fti_sms_messages','fields':['body'],'type':_0xcdbd('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1d5795,_0xb31d33,_0x12abae){var _0x439b3f=_0x321070[_0xcdbd('0xe')];var _0x6ce58b=_0x1d5795[_0xcdbd('0xf')]({'plain':!![]});if(_0x6ce58b[_0xcdbd('0x10')][_0xcdbd('0x11')]()==='in'||_0x6ce58b[_0xcdbd('0x10')]['toLowerCase']()===_0xcdbd('0x12')&&!_0x6ce58b['secret']&&!_[_0xcdbd('0x13')](_0x6ce58b[_0xcdbd('0x14')])){_0x439b3f[_0xcdbd('0x15')][_0xcdbd('0x16')]({'where':{'id':_0x6ce58b[_0xcdbd('0x17')]}})[_0xcdbd('0x18')](function(_0x6056b9){if(_0x6056b9){_0x6056b9[_0xcdbd('0x19')]({'lastMsgAt':_0x6ce58b[_0xcdbd('0x1a')],'lastMsgDirection':_0x6ce58b[_0xcdbd('0x10')][_0xcdbd('0x11')]()});}})[_0xcdbd('0x1b')](function(_0x490c19){console[_0xcdbd('0x1c')](_0x490c19);});}if(_0x6ce58b['direction']==='out'&&!_0x6ce58b['secret']){var _0x1baa92;_0x439b3f[_0xcdbd('0x1d')][_0xcdbd('0x1e')]({'where':{'id':_0x6ce58b['SmsAccountId']},'raw':!![]})[_0xcdbd('0x18')](function(_0x54fdee){_0x1baa92=_0x54fdee;if(_0x1baa92&&_0x1baa92[_0xcdbd('0x1f')]){switch(_0x1baa92[_0xcdbd('0x1f')]){case _0xcdbd('0x20'):var _0x204e86=require('twilio');if(_0x1baa92['accountSid']&&_0x1baa92[_0xcdbd('0x21')]&&_0x1baa92[_0xcdbd('0x22')]){var _0x1a7635=new _0x204e86(_0x1baa92[_0xcdbd('0x23')],_0x1baa92['authToken']);_0x1a7635[_0xcdbd('0x24')][_0xcdbd('0x25')]({'body':_0x6ce58b[_0xcdbd('0x26')],'to':_0x6ce58b[_0xcdbd('0x22')],'from':_0x1baa92[_0xcdbd('0x22')],'statusCallback':_0x1baa92[_0xcdbd('0x27')]+_0xcdbd('0x28')+_0x6ce58b['id']+'/status?token='+_0x1baa92[_0xcdbd('0x29')]})[_0xcdbd('0x18')](function(_0x280b66){if(_0x280b66[_0xcdbd('0x2a')]){return _0x1d5795['update']({'messageId':_0x280b66[_0xcdbd('0x2a')]});}})['catch'](function(_0x2b8b48){logger[_0xcdbd('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio',util[_0xcdbd('0x2b')](_0x2b8b48,{'showHidden':![],'depth':null}));});}else{logger[_0xcdbd('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcdbd('0x2c'),'twilio',_0xcdbd('0x2d'));}break;case _0xcdbd('0x2e'):var _0x35e9bd=_0xcdbd('0x2f');if(_0x1baa92[_0xcdbd('0x30')]&&_0x1baa92[_0xcdbd('0x31')]){var _0x34125d={'recipient':[_0x6ce58b['phone']],'message':_0x6ce58b[_0xcdbd('0x26')],'message_type':_0x1baa92[_0xcdbd('0x32')]};if(_0x1baa92[_0xcdbd('0x32')]&&_0x1baa92[_0xcdbd('0x32')]!=='SI'){_0x34125d['sender']=_0x1baa92[_0xcdbd('0x22')];}var _0x4256c8={'url':_0x35e9bd+_0xcdbd('0x33')+_0x1baa92[_0xcdbd('0x30')]+_0xcdbd('0x34')+_0x1baa92[_0xcdbd('0x31')],'method':_0xcdbd('0x35')};rp(_0x4256c8)[_0xcdbd('0x18')](function(_0x1ec2f0){var _0x3ec138=_0x1ec2f0[_0xcdbd('0x36')](';');var _0x58d8a9={'user_key':_0x3ec138[0x0],'session_key':_0x3ec138[0x1]};_0x4256c8={'url':_0x35e9bd+'sms','method':'POST','headers':{'user_key':_0x58d8a9['user_key'],'Session_key':_0x58d8a9[_0xcdbd('0x37')]},'json':!![],'body':_0x34125d};return rp(_0x4256c8);})[_0xcdbd('0x18')](function(_0x520b7e){if(_0x520b7e['total_sent']>=0x1){var _0x5ebba2={'messageId':_0x520b7e[_0xcdbd('0x38')]};if(_0x1baa92['smsMethod']!=='GP'||!_0x1baa92['deliveryReport']){_0x5ebba2[_0xcdbd('0x39')]=!![];}return _0x1d5795[_0xcdbd('0x19')](_0x5ebba2);}else{return logger[_0xcdbd('0x1c')](_0xcdbd('0x3a'),'afterCreate',_0xcdbd('0x2e'),util[_0xcdbd('0x2b')](_0x520b7e,{'showHidden':![],'depth':null}));}})[_0xcdbd('0x1b')](function(_0x4fa4c1){return logger[_0xcdbd('0x1c')](_0xcdbd('0x3a'),'afterCreate',_0xcdbd('0x2e'),util[_0xcdbd('0x2b')](_0x4fa4c1,{'showHidden':![],'depth':null}));});}else{logger[_0xcdbd('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcdbd('0x2c'),_0xcdbd('0x2e'),_0xcdbd('0x3b'));}break;case _0xcdbd('0x3c'):if(_0x1baa92['authToken']){var _0x330b5e={'recipient':_0x6ce58b[_0xcdbd('0x22')],'message':_0x6ce58b['body'],'sender':_0x1baa92[_0xcdbd('0x3d')]||_0x1baa92[_0xcdbd('0x22')],'authorization':_0x1baa92['authToken']};var _0xb31d33={'method':_0xcdbd('0x3e'),'uri':_0xcdbd('0x3f'),'body':_0x330b5e,'json':!![]};rp(_0xb31d33)['then'](function(_0x528ef5){var _0x5395c3={'messageId':_0x528ef5['requestid']};if(!_0x1baa92[_0xcdbd('0x40')]){_0x5395c3[_0xcdbd('0x39')]=!![];}return _0x1d5795['update'](_0x5395c3);})[_0xcdbd('0x1b')](function(_0x84495){logger[_0xcdbd('0x1c')](_0xcdbd('0x3a'),_0xcdbd('0x2c'),_0xcdbd('0x3c'),util[_0xcdbd('0x2b')](_0x84495,{'showHidden':![],'depth':null}));});}else{logger[_0xcdbd('0x1c')](_0xcdbd('0x3a'),_0xcdbd('0x2c'),_0xcdbd('0x3c'),'Missing\x20parameters:\x20authToken');}break;case _0xcdbd('0x41'):if(_0x1baa92[_0xcdbd('0x30')]&&_0x1baa92['password']){var _0x330b5e={'messages':[{'source':_0xcdbd('0x42'),'to':_0x6ce58b[_0xcdbd('0x22')],'body':_0x6ce58b['body'],'from':_0x1baa92[_0xcdbd('0x3d')]||_0x1baa92[_0xcdbd('0x22')]}]};var _0x1e80ed=util[_0xcdbd('0x43')]('%s:%s',_0x1baa92[_0xcdbd('0x30')],_0x1baa92['password']);var _0xb31d33={'method':_0xcdbd('0x3e'),'uri':_0xcdbd('0x44'),'body':_0x330b5e,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x1e80ed)[_0xcdbd('0x45')](_0xcdbd('0x46')))},'json':!![]};rp(_0xb31d33)[_0xcdbd('0x18')](function(_0x5a80c6){if(_0x5a80c6[_0xcdbd('0x47')]>=0xc8&&_0x5a80c6[_0xcdbd('0x47')]<=0xce){if(_0x5a80c6['data']&&_0x5a80c6[_0xcdbd('0x48')][_0xcdbd('0x49')]>0x0){var _0x31a4f3=_[_0xcdbd('0x4a')](_0x5a80c6[_0xcdbd('0x48')][_0xcdbd('0x24')]);var _0x26bb8d={'messageId':_0x31a4f3[_0xcdbd('0x4b')]};if(!_0x1baa92[_0xcdbd('0x40')]){_0x26bb8d['read']=!![];}return _0x1d5795[_0xcdbd('0x19')](_0x26bb8d);}else{logger[_0xcdbd('0x1c')](_0xcdbd('0x3a'),_0xcdbd('0x2c'),_0xcdbd('0x4c'),util[_0xcdbd('0x2b')](_0x5a80c6,{'showHidden':![],'depth':null}));}}else{logger[_0xcdbd('0x1c')](_0xcdbd('0x3a'),_0xcdbd('0x2c'),'clickSend',util[_0xcdbd('0x2b')](_0x5a80c6,{'showHidden':![],'depth':null}));}})[_0xcdbd('0x1b')](function(_0x2d1424){logger[_0xcdbd('0x1c')](_0xcdbd('0x3a'),'afterCreate','clickSend',util[_0xcdbd('0x2b')](_0x2d1424,{'showHidden':![],'depth':null}));});}else{logger[_0xcdbd('0x1c')](_0xcdbd('0x3a'),_0xcdbd('0x2c'),'clickSend',_0xcdbd('0x3b'));}break;case'plivo':if(_0x1baa92[_0xcdbd('0x4d')]&&_0x1baa92[_0xcdbd('0x21')]){var _0x330b5e={'dst':_0x6ce58b[_0xcdbd('0x22')],'text':_0x6ce58b['body'],'src':_0x1baa92[_0xcdbd('0x3d')]||_0x1baa92['phone'],'url':_0x1baa92[_0xcdbd('0x27')]+_0xcdbd('0x28')+_0x6ce58b['id']+_0xcdbd('0x4e')+_0x1baa92[_0xcdbd('0x29')]};var _0x1e80ed=util[_0xcdbd('0x43')]('%s:%s',_0x1baa92[_0xcdbd('0x4d')],_0x1baa92[_0xcdbd('0x21')]);var _0xb31d33={'method':_0xcdbd('0x3e'),'uri':util[_0xcdbd('0x43')](_0xcdbd('0x4f'),_0x1baa92[_0xcdbd('0x4d')]),'body':_0x330b5e,'headers':{'Authorization':util[_0xcdbd('0x43')](_0xcdbd('0x50'),new Buffer(_0x1e80ed)[_0xcdbd('0x45')](_0xcdbd('0x46')))},'json':!![]};rp(_0xb31d33)[_0xcdbd('0x18')](function(_0x120f40){var _0x4689e5={'messageId':_0x120f40[_0xcdbd('0x51')][0x0]};return _0x1d5795[_0xcdbd('0x19')](_0x4689e5);})[_0xcdbd('0x1b')](function(_0x26e058){logger[_0xcdbd('0x1c')](_0xcdbd('0x3a'),_0xcdbd('0x2c'),_0xcdbd('0x52'),util['inspect'](_0x26e058,{'showHidden':![],'depth':null}));});}else{logger[_0xcdbd('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcdbd('0x2c'),_0xcdbd('0x52'),_0xcdbd('0x53'));}break;case _0xcdbd('0x54'):if(_0x1baa92[_0xcdbd('0x30')]&&_0x1baa92[_0xcdbd('0x31')]){if(_0x1baa92[_0xcdbd('0x55')]){var _0x1d6161={'method':_0xcdbd('0x3e'),'uri':_0x1baa92[_0xcdbd('0x55')]+_0xcdbd('0x56'),'body':{'username':_0x1baa92[_0xcdbd('0x30')],'password':_0x1baa92[_0xcdbd('0x31')]},'json':!![]};return rp(_0x1d6161)[_0xcdbd('0x18')](function(_0x19956c){var _0x7cfca9={'method':'POST','uri':_0x1baa92[_0xcdbd('0x55')]+_0xcdbd('0x57'),'body':{'messages':[{'from':_0x1baa92['phone'],'destinations':[{'to':_0x6ce58b[_0xcdbd('0x22')]}],'text':_0x6ce58b[_0xcdbd('0x26')],'notifyUrl':_0x1baa92[_0xcdbd('0x27')]+_0xcdbd('0x28')+_0x6ce58b['id']+_0xcdbd('0x4e')+_0x1baa92[_0xcdbd('0x29')],'notifyContentType':_0xcdbd('0x58'),'callbackData':_0x1baa92['phone']+';'+_0x6ce58b[_0xcdbd('0x26')]}]},'headers':{'Authorization':_0xcdbd('0x59')+_0x19956c[_0xcdbd('0x29')]},'json':!![]};return rp(_0x7cfca9)['then'](function(_0x702667){if(_0x702667[_0xcdbd('0x24')]){var _0xe0b119={'messageId':_0x702667['messages'][0x0]['messageId']};if(!_0x1baa92[_0xcdbd('0x40')]){_0xe0b119[_0xcdbd('0x39')]=!![];}return _0x1d5795['update'](_0xe0b119);}else{return logger[_0xcdbd('0x1c')](_0xcdbd('0x3a'),_0xcdbd('0x2c'),_0xcdbd('0x54'),util[_0xcdbd('0x2b')](_0x702667,{'showHidden':![],'depth':null}));}});})[_0xcdbd('0x1b')](function(_0x516b82){return logger[_0xcdbd('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcdbd('0x2c'),'infobip',util[_0xcdbd('0x2b')](_0x516b82,{'showHidden':![],'depth':null}));});}else{logger[_0xcdbd('0x1c')](_0xcdbd('0x3a'),_0xcdbd('0x2c'),'infobip',_0xcdbd('0x5a'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcdbd('0x2c'),_0xcdbd('0x54'),_0xcdbd('0x3b'));}break;case'csc':var _0x294541=require('crypto');if(_0x1baa92['apiKey']){var _0xcf42a6={};_0xcf42a6[_0xcdbd('0x5b')]=_0x1baa92[_0xcdbd('0x30')];_0xcf42a6[_0xcdbd('0x22')]=_0x6ce58b['phone'];_0xcf42a6['sender']=_0x1baa92[_0xcdbd('0x22')];_0xcf42a6[_0xcdbd('0x5c')]=_0x6ce58b[_0xcdbd('0x26')];_0xcf42a6['timestamp']=+new Date();var _0x14c3e0='';var _0x55c9b2='';var _0x58cf4d=Object['keys'](_0xcf42a6);_0x58cf4d[_0xcdbd('0x5d')]();for(var _0x4fe9a7=0x0;_0x4fe9a7<_0x58cf4d[_0xcdbd('0x5e')];_0x4fe9a7++){if(_0x14c3e0!=''){_0x14c3e0+='&';}_0x14c3e0+=_0x58cf4d[_0x4fe9a7]+'='+encodeURIComponent(_0xcf42a6[_0x58cf4d[_0x4fe9a7]]);_0x55c9b2+=_0xcf42a6[_0x58cf4d[_0x4fe9a7]];}_0x55c9b2+=_0x1baa92[_0xcdbd('0x5f')];_0x55c9b2=_0x294541[_0xcdbd('0x60')](_0xcdbd('0x61'))[_0xcdbd('0x19')](_0x55c9b2)['digest'](_0xcdbd('0x62'));if(_0x14c3e0!==''){_0x14c3e0+='&';}_0x14c3e0+=_0xcdbd('0x63')+_0x55c9b2;var _0x4256c8={'method':_0xcdbd('0x35'),'uri':_0xcdbd('0x64')+_0x14c3e0,'json':!![]};return rp(_0x4256c8)['then'](function(_0x587b03){var _0x5384c6=Object[_0xcdbd('0x65')](_0x587b03);if(_0x587b03[_0x5384c6[0x0]][_0xcdbd('0x1c')]&&parseInt(_0x587b03[_0x5384c6[0x0]]['error'])===0x0){var _0x3ea950={'messageId':_0x587b03[_0x5384c6[0x0]][_0xcdbd('0x66')]};if(!_0x1baa92['deliveryReport']){_0x3ea950[_0xcdbd('0x39')]=!![];}return _0x1d5795[_0xcdbd('0x19')](_0x3ea950);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcdbd('0x2c'),_0xcdbd('0x67'),util[_0xcdbd('0x2b')](_0x587b03[_0xcdbd('0x1c')],{'showHidden':![],'depth':null}));}})[_0xcdbd('0x1b')](function(_0x3068b8){return logger['error'](_0xcdbd('0x3a'),_0xcdbd('0x2c'),'csc',util[_0xcdbd('0x2b')](_0x3068b8,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xcdbd('0x3a'),_0xcdbd('0x2c'),_0xcdbd('0x67'),_0xcdbd('0x68'));}break;case _0xcdbd('0x69'):if(_0x1baa92[_0xcdbd('0x5f')]){var _0x598636={'method':'POST','uri':_0xcdbd('0x6a'),'headers':{'Authorization':_0x1baa92[_0xcdbd('0x5f')]},'body':{'content':_0x6ce58b['body'],'to':[_0x6ce58b['phone']],'from':_0x1baa92[_0xcdbd('0x22')],'binary':![],'clientMessageId':_0xcdbd('0x6b'),'charset':_0xcdbd('0x6c')},'json':!![]};rp(_0x598636)['then'](function(_0x43b350){if(!_0x43b350['error']){var _0xc6e8f1={'messageId':_0x43b350[_0xcdbd('0x24')][0x0]['apiMessageId']};if(!_0x1baa92[_0xcdbd('0x40')]){_0xc6e8f1[_0xcdbd('0x39')]=!![];}return _0x1d5795[_0xcdbd('0x19')](_0xc6e8f1);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcdbd('0x2c'),_0xcdbd('0x69'),util[_0xcdbd('0x2b')](_0x43b350[_0xcdbd('0x1c')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x161c3a){return logger[_0xcdbd('0x1c')](_0xcdbd('0x3a'),_0xcdbd('0x2c'),_0xcdbd('0x69'),util[_0xcdbd('0x2b')](_0x161c3a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xcdbd('0x3a'),_0xcdbd('0x2c'),_0xcdbd('0x69'),_0xcdbd('0x68'));}break;case _0xcdbd('0x6d'):if(_0x1baa92[_0xcdbd('0x5f')]){var _0x451aaf={};var _0x4256c8={'method':_0xcdbd('0x3e'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xcdbd('0x6e')+_0x1baa92['apiKey'],'Content-Type':_0xcdbd('0x58')},'body':{'from':_0x1baa92['phone'],'to':_0x6ce58b[_0xcdbd('0x22')],'text':_0x6ce58b[_0xcdbd('0x26')]},'json':!![]};return rp(_0x4256c8)[_0xcdbd('0x18')](function(_0xdffa8e){if(_0xdffa8e[_0xcdbd('0x6f')]==0xca){_0x451aaf[_0xcdbd('0x70')]=_0xdffa8e;var _0xc398c0={'method':'POST','uri':_0xcdbd('0x71'),'headers':{'Authorization':_0xcdbd('0x6e')+_0x1baa92[_0xcdbd('0x5f')],'Content-Type':_0xcdbd('0x58')},'body':{'refid':_0x451aaf['message']['refid']},'json':!![]};return rp(_0xc398c0)[_0xcdbd('0x18')](function(_0x1b04e0){_0x451aaf[_0xcdbd('0x72')]=_0x1b04e0;var _0x5ea722={'messageId':_0x451aaf[_0xcdbd('0x70')][_0xcdbd('0x73')],'read':!![]};return _0x1d5795[_0xcdbd('0x19')](_0x5ea722);});}else{return logger[_0xcdbd('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcdbd('0x2c'),_0xcdbd('0x6d'),util[_0xcdbd('0x2b')](_0xdffa8e,{'showHidden':![],'depth':null}));}})['catch'](function(_0x13c0e4){return logger['error'](_0xcdbd('0x3a'),'afterCreate',_0xcdbd('0x6d'),util[_0xcdbd('0x2b')](_0x13c0e4,{'showHidden':![],'depth':null}));});}else{return logger[_0xcdbd('0x1c')](_0xcdbd('0x3a'),_0xcdbd('0x2c'),_0xcdbd('0x6d'),_0xcdbd('0x74'));}break;}}})[_0xcdbd('0x75')](function(){_0x12abae();});}else{_0x12abae();}}},'charset':_0xcdbd('0x76'),'collate':_0xcdbd('0x77')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 47771ae..8a7d0f9 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 _0xd2c8=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','SmsMessage','body','options','CreateSmsMessage','debug'];(function(_0x1ad21d,_0x350794){var _0x276651=function(_0x2fd970){while(--_0x2fd970){_0x1ad21d['push'](_0x1ad21d['shift']());}};_0x276651(++_0x350794);}(_0xd2c8,0x1dc));var _0x8d2c=function(_0x2700e7,_0x41242a){_0x2700e7=_0x2700e7-0x0;var _0x260f95=_0xd2c8[_0x2700e7];return _0x260f95;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8d2c('0x0'));var BPromise=require(_0x8d2c('0x1'));var rs=require(_0x8d2c('0x2'));var fs=require('fs');var Redis=require(_0x8d2c('0x3'));var db=require(_0x8d2c('0x4'))['db'];var utils=require(_0x8d2c('0x5'));var logger=require(_0x8d2c('0x6'))(_0x8d2c('0x7'));var config=require(_0x8d2c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8d2c('0x9')][_0x8d2c('0xa')]({'port':0x232a});config[_0x8d2c('0xb')]=_[_0x8d2c('0xc')](config[_0x8d2c('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8d2c('0xd'))(new Redis(config[_0x8d2c('0xb')]));require('./smsMessage.socket')['register'](socket);function respondWithRpcPromise(_0x53e105,_0x1632cb,_0x33eb9d){return new BPromise(function(_0x8d92b9,_0x24cb6e){return client[_0x8d2c('0xe')](_0x53e105,_0x33eb9d)['then'](function(_0x432a07){logger[_0x8d2c('0xf')](_0x8d2c('0x10'),_0x1632cb,_0x8d2c('0x11'));logger['debug'](_0x8d2c('0x12'),_0x1632cb,_0x8d2c('0x11'),JSON[_0x8d2c('0x13')](_0x432a07));if(_0x432a07['error']){if(_0x432a07['error']['code']===0x1f4){logger[_0x8d2c('0x14')](_0x8d2c('0x10'),_0x1632cb,_0x432a07[_0x8d2c('0x14')]['message']);return _0x24cb6e(_0x432a07[_0x8d2c('0x14')]['message']);}logger[_0x8d2c('0x14')](_0x8d2c('0x10'),_0x1632cb,_0x432a07[_0x8d2c('0x14')][_0x8d2c('0x15')]);return _0x8d92b9(_0x432a07[_0x8d2c('0x14')][_0x8d2c('0x15')]);}else{logger[_0x8d2c('0xf')]('SmsMessage,\x20%s,\x20%s',_0x1632cb,_0x8d2c('0x11'));_0x8d92b9(_0x432a07['result'][_0x8d2c('0x15')]);}})[_0x8d2c('0x16')](function(_0x287c4d){logger[_0x8d2c('0x14')](_0x8d2c('0x10'),_0x1632cb,_0x287c4d);_0x24cb6e(_0x287c4d);});});}exports['CreateSmsMessage']=function(_0x224af6){var _0xde155a=this;return new Promise(function(_0x42b55d,_0x3eecfa){return db[_0x8d2c('0x17')]['create'](_0x224af6[_0x8d2c('0x18')],{'raw':_0x224af6[_0x8d2c('0x19')]?_0x224af6[_0x8d2c('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3a4d57){logger[_0x8d2c('0xf')](_0x8d2c('0x1a'),_0x224af6);logger[_0x8d2c('0x1b')](_0x8d2c('0x1a'),_0x224af6,JSON[_0x8d2c('0x13')](_0x3a4d57));_0x42b55d(_0x3a4d57);})['catch'](function(_0x1438be){logger[_0x8d2c('0x14')](_0x8d2c('0x1a'),_0x1438be['message'],_0x224af6);_0x3eecfa(_0xde155a['error'](0x1f4,_0x1438be[_0x8d2c('0x15')]));});});}; \ No newline at end of file +var _0x307d=['register','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','error','code','result','message','CreateSmsMessage','SmsMessage','create','body','options','raw','debug','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x307d,0x131));var _0xd307=function(_0x3df9c5,_0x4fbc9f){_0x3df9c5=_0x3df9c5-0x0;var _0x25c08f=_0x307d[_0x3df9c5];return _0x25c08f;};'use strict';var _=require(_0xd307('0x0'));var util=require('util');var moment=require(_0xd307('0x1'));var BPromise=require(_0xd307('0x2'));var rs=require(_0xd307('0x3'));var fs=require('fs');var Redis=require(_0xd307('0x4'));var db=require(_0xd307('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd307('0x6'))(_0xd307('0x7'));var config=require(_0xd307('0x8'));var jayson=require(_0xd307('0x9'));var client=jayson[_0xd307('0xa')][_0xd307('0xb')]({'port':0x232a});config[_0xd307('0xc')]=_[_0xd307('0xd')](config[_0xd307('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd307('0xe'))(new Redis(config[_0xd307('0xc')]));require('./smsMessage.socket')[_0xd307('0xf')](socket);function respondWithRpcPromise(_0x367f46,_0x16823d,_0x27753a){return new BPromise(function(_0x2aaead,_0x412627){return client['request'](_0x367f46,_0x27753a)[_0xd307('0x10')](function(_0x1da846){logger[_0xd307('0x11')](_0xd307('0x12'),_0x16823d,_0xd307('0x13'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x16823d,_0xd307('0x13'),JSON['stringify'](_0x1da846));if(_0x1da846[_0xd307('0x14')]){if(_0x1da846[_0xd307('0x14')][_0xd307('0x15')]===0x1f4){logger[_0xd307('0x14')](_0xd307('0x12'),_0x16823d,_0x1da846[_0xd307('0x14')]['message']);return _0x412627(_0x1da846[_0xd307('0x14')]['message']);}logger[_0xd307('0x14')](_0xd307('0x12'),_0x16823d,_0x1da846[_0xd307('0x14')]['message']);return _0x2aaead(_0x1da846[_0xd307('0x14')]['message']);}else{logger[_0xd307('0x11')](_0xd307('0x12'),_0x16823d,_0xd307('0x13'));_0x2aaead(_0x1da846[_0xd307('0x16')][_0xd307('0x17')]);}})['catch'](function(_0x1d9f7c){logger['error'](_0xd307('0x12'),_0x16823d,_0x1d9f7c);_0x412627(_0x1d9f7c);});});}exports[_0xd307('0x18')]=function(_0x5834df){var _0x276dac=this;return new Promise(function(_0x4516f4,_0xfcf3f2){return db[_0xd307('0x19')][_0xd307('0x1a')](_0x5834df[_0xd307('0x1b')],{'raw':_0x5834df['options']?_0x5834df[_0xd307('0x1c')][_0xd307('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x5e1614){logger[_0xd307('0x11')]('CreateSmsMessage',_0x5834df);logger[_0xd307('0x1e')](_0xd307('0x18'),_0x5834df,JSON['stringify'](_0x5e1614));_0x4516f4(_0x5e1614);})[_0xd307('0x1f')](function(_0x2721bc){logger[_0xd307('0x14')](_0xd307('0x18'),_0x2721bc[_0xd307('0x17')],_0x5834df);_0xfcf3f2(_0x276dac[_0xd307('0x14')](0x1f4,_0x2721bc[_0xd307('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index e9b0aac..55200a1 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 _0xf051=['removeListener','length','smsMessage:','save','remove','update','emit'];(function(_0x656c05,_0x1d4b18){var _0x28475a=function(_0x21ef6a){while(--_0x21ef6a){_0x656c05['push'](_0x656c05['shift']());}};_0x28475a(++_0x1d4b18);}(_0xf051,0xff));var _0x1f05=function(_0x55af20,_0x199105){_0x55af20=_0x55af20-0x0;var _0x3b6db9=_0xf051[_0x55af20];return _0x3b6db9;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x1f05('0x0'),_0x1f05('0x1'),_0x1f05('0x2')];function createListener(_0x110bf9,_0x470160){return function(_0xbf007){_0x470160[_0x1f05('0x3')](_0x110bf9,_0xbf007);};}function removeListener(_0x5ca8e9,_0x5a68c2){return function(){SmsMessageEvents[_0x1f05('0x4')](_0x5ca8e9,_0x5a68c2);};}exports['register']=function(_0x350d4d){for(var _0x34e69c=0x0,_0x2ae7e2=events[_0x1f05('0x5')];_0x34e69c<_0x2ae7e2;_0x34e69c++){var _0x189406=events[_0x34e69c];var _0x2be013=createListener(_0x1f05('0x6')+_0x189406,_0x350d4d);SmsMessageEvents['on'](_0x189406,_0x2be013);}}; \ No newline at end of file +var _0xf66f=['register','length','smsMessage:','./smsMessage.events','save','remove','update','emit','removeListener'];(function(_0x1614bf,_0x1d67c1){var _0x5136fc=function(_0x18eb81){while(--_0x18eb81){_0x1614bf['push'](_0x1614bf['shift']());}};_0x5136fc(++_0x1d67c1);}(_0xf66f,0x8a));var _0xff66=function(_0x5d0d1b,_0x44b391){_0x5d0d1b=_0x5d0d1b-0x0;var _0x196810=_0xf66f[_0x5d0d1b];return _0x196810;};'use strict';var SmsMessageEvents=require(_0xff66('0x0'));var events=[_0xff66('0x1'),_0xff66('0x2'),_0xff66('0x3')];function createListener(_0x4501e4,_0x1df3d0){return function(_0x4e8b6f){_0x1df3d0[_0xff66('0x4')](_0x4501e4,_0x4e8b6f);};}function removeListener(_0x30f7bc,_0x312493){return function(){SmsMessageEvents[_0xff66('0x5')](_0x30f7bc,_0x312493);};}exports[_0xff66('0x6')]=function(_0x52c35b){for(var _0x4cc192=0x0,_0x22c5f3=events[_0xff66('0x7')];_0x4cc192<_0x22c5f3;_0x4cc192++){var _0x5e9a33=events[_0x4cc192];var _0x3bdf83=createListener(_0xff66('0x8')+_0x5e9a33,_0x52c35b);SmsMessageEvents['on'](_0x5e9a33,_0x3bdf83);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 2c873a2..0c5540b 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 _0x4f18=['/:id/teams','addTeams','/:id/users','addAgents','put','delete','destroy','removeAgents','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','/:id/members','getAgents','post','create'];(function(_0x2a13d1,_0x4aa898){var _0x397b96=function(_0x522f05){while(--_0x522f05){_0x2a13d1['push'](_0x2a13d1['shift']());}};_0x397b96(++_0x4aa898);}(_0x4f18,0x1b9));var _0x84f1=function(_0x2fa635,_0x3c6af9){_0x2fa635=_0x2fa635-0x0;var _0x2767e4=_0x4f18[_0x2fa635];return _0x2767e4;};'use strict';var multer=require('multer');var util=require(_0x84f1('0x0'));var path=require(_0x84f1('0x1'));var timeout=require(_0x84f1('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x84f1('0x3'));var interaction=require(_0x84f1('0x4'));var config=require(_0x84f1('0x5'));var controller=require('./smsQueue.controller');router[_0x84f1('0x6')]('/',auth[_0x84f1('0x7')](),controller['index']);router['get'](_0x84f1('0x8'),auth[_0x84f1('0x7')](),controller['describe']);router[_0x84f1('0x6')](_0x84f1('0x9'),auth[_0x84f1('0x7')](),controller[_0x84f1('0xa')]);router[_0x84f1('0x6')](_0x84f1('0xb'),auth['isAuthenticated'](),controller['getMembers']);router['get']('/:id/teams',auth[_0x84f1('0x7')](),controller['getTeams']);router[_0x84f1('0x6')]('/:id/users',auth[_0x84f1('0x7')](),controller[_0x84f1('0xc')]);router[_0x84f1('0xd')]('/',auth[_0x84f1('0x7')](),controller[_0x84f1('0xe')]);router[_0x84f1('0xd')](_0x84f1('0xf'),auth[_0x84f1('0x7')](),controller[_0x84f1('0x10')]);router[_0x84f1('0xd')](_0x84f1('0x11'),auth[_0x84f1('0x7')](),controller[_0x84f1('0x12')]);router[_0x84f1('0x13')]('/:id',auth[_0x84f1('0x7')](),controller['update']);router[_0x84f1('0x14')]('/:id',auth[_0x84f1('0x7')](),controller[_0x84f1('0x15')]);router['delete'](_0x84f1('0xf'),auth[_0x84f1('0x7')](),controller['removeTeams']);router['delete'](_0x84f1('0x11'),auth[_0x84f1('0x7')](),controller[_0x84f1('0x16')]);module[_0x84f1('0x17')]=router; \ No newline at end of file +var _0xac51=['destroy','removeTeams','removeAgents','exports','path','express','../../config/environment','./smsQueue.controller','get','describe','/:id','isAuthenticated','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete'];(function(_0x4032cd,_0x3d95e5){var _0x525fe6=function(_0x3368e7){while(--_0x3368e7){_0x4032cd['push'](_0x4032cd['shift']());}};_0x525fe6(++_0x3d95e5);}(_0xac51,0x9a));var _0x1ac5=function(_0x4fbbda,_0x5a2f19){_0x4fbbda=_0x4fbbda-0x0;var _0x56c213=_0xac51[_0x4fbbda];return _0x56c213;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1ac5('0x0'));var timeout=require('connect-timeout');var express=require(_0x1ac5('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1ac5('0x2'));var controller=require(_0x1ac5('0x3'));router[_0x1ac5('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1ac5('0x4')]('/describe',auth['isAuthenticated'](),controller[_0x1ac5('0x5')]);router[_0x1ac5('0x4')](_0x1ac5('0x6'),auth[_0x1ac5('0x7')](),controller['show']);router[_0x1ac5('0x4')](_0x1ac5('0x8'),auth['isAuthenticated'](),controller[_0x1ac5('0x9')]);router[_0x1ac5('0x4')](_0x1ac5('0xa'),auth[_0x1ac5('0x7')](),controller[_0x1ac5('0xb')]);router[_0x1ac5('0x4')](_0x1ac5('0xc'),auth[_0x1ac5('0x7')](),controller[_0x1ac5('0xd')]);router[_0x1ac5('0xe')]('/',auth[_0x1ac5('0x7')](),controller[_0x1ac5('0xf')]);router[_0x1ac5('0xe')](_0x1ac5('0xa'),auth[_0x1ac5('0x7')](),controller[_0x1ac5('0x10')]);router[_0x1ac5('0xe')](_0x1ac5('0xc'),auth[_0x1ac5('0x7')](),controller[_0x1ac5('0x11')]);router[_0x1ac5('0x12')](_0x1ac5('0x6'),auth[_0x1ac5('0x7')](),controller[_0x1ac5('0x13')]);router[_0x1ac5('0x14')](_0x1ac5('0x6'),auth[_0x1ac5('0x7')](),controller[_0x1ac5('0x15')]);router[_0x1ac5('0x14')]('/:id/teams',auth[_0x1ac5('0x7')](),controller[_0x1ac5('0x16')]);router['delete'](_0x1ac5('0xc'),auth[_0x1ac5('0x7')](),controller[_0x1ac5('0x17')]);module[_0x1ac5('0x18')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 7bcae00..151a723 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 _0xf7f9=['ENUM','rrmemory','beepall','sequelize','exports','STRING','INTEGER'];(function(_0x3bf7c4,_0x2176ae){var _0x38587b=function(_0x18a6d5){while(--_0x18a6d5){_0x3bf7c4['push'](_0x3bf7c4['shift']());}};_0x38587b(++_0x2176ae);}(_0xf7f9,0x17d));var _0x9f7f=function(_0x3bb2ac,_0x1c7310){_0x3bb2ac=_0x3bb2ac-0x0;var _0x5ec771=_0xf7f9[_0x3bb2ac];return _0x5ec771;};'use strict';var Sequelize=require(_0x9f7f('0x0'));module[_0x9f7f('0x1')]={'name':{'type':Sequelize[_0x9f7f('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9f7f('0x2')]},'timeout':{'type':Sequelize[_0x9f7f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9f7f('0x4')](_0x9f7f('0x5'),_0x9f7f('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x39d9=['beepall','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x283e7e,_0x513284){var _0x50b0c6=function(_0x409b0e){while(--_0x409b0e){_0x283e7e['push'](_0x283e7e['shift']());}};_0x50b0c6(++_0x513284);}(_0x39d9,0xf1));var _0x939d=function(_0x172baa,_0x33b7f6){_0x172baa=_0x172baa-0x0;var _0x3f5836=_0x39d9[_0x172baa];return _0x3f5836;};'use strict';var Sequelize=require(_0x939d('0x0'));module[_0x939d('0x1')]={'name':{'type':Sequelize[_0x939d('0x2')],'unique':_0x939d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x939d('0x2')]},'timeout':{'type':Sequelize[_0x939d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x939d('0x5')](_0x939d('0x6'),_0x939d('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 2e3c3a7..f451e57 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 _0xaab2=['filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserSmsQueue','order','User','findAndCountAll','UserId','smsPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','teams','Agents','voicePause','interface','flatMap','sequelize','addTeams','each','emit','removeTeams','ids','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','includes','value','isEmpty','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','spread','userSmsQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsQueue.socket','register','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','SmsQueues','UserProfileResource','sendStatus','error','stack','name','send','index','SmsQueue','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','merge','where','map','type','key','field'];(function(_0x3bd52b,_0xbbc735){var _0x1e5b89=function(_0x29ccc3){while(--_0x29ccc3){_0x3bd52b['push'](_0x3bd52b['shift']());}};_0x1e5b89(++_0xbbc735);}(_0xaab2,0xca));var _0x2aab=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xaab2[_0x618414];return _0x21c19a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2aab('0x0'));var rimraf=require(_0x2aab('0x1'));var zipdir=require(_0x2aab('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2aab('0x3'));var moment=require(_0x2aab('0x4'));var BPromise=require(_0x2aab('0x5'));var Mustache=require(_0x2aab('0x6'));var util=require(_0x2aab('0x7'));var path=require('path');var sox=require(_0x2aab('0x8'));var csv=require('to-csv');var ejs=require(_0x2aab('0x9'));var fs=require('fs');var _=require(_0x2aab('0xa'));var squel=require(_0x2aab('0xb'));var crypto=require(_0x2aab('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2aab('0xd'));var toCsv=require(_0x2aab('0xe'));var querystring=require(_0x2aab('0xf'));var Papa=require(_0x2aab('0x10'));var Redis=require(_0x2aab('0x11'));var authService=require(_0x2aab('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2aab('0x13'))(_0x2aab('0x14'));var utils=require('../../config/utils');var config=require(_0x2aab('0x15'));var db=require(_0x2aab('0x16'))['db'];config[_0x2aab('0x17')]=_['defaults'](config[_0x2aab('0x17')],{'host':_0x2aab('0x18'),'port':0x18eb});var socket=require(_0x2aab('0x19'))(new Redis(config[_0x2aab('0x17')]));require(_0x2aab('0x1a'))[_0x2aab('0x1b')](socket);function respondWithStatusCode(_0x536a85,_0x490240){_0x490240=_0x490240||0xcc;return function(_0x3039f1){if(_0x3039f1){return _0x536a85['sendStatus'](_0x490240);}return _0x536a85['status'](_0x490240)[_0x2aab('0x1c')]();};}function respondWithResult(_0xcabe88,_0x2e5c20){_0x2e5c20=_0x2e5c20||0xc8;return function(_0xb0ff8c){if(_0xb0ff8c){return _0xcabe88[_0x2aab('0x1d')](_0x2e5c20)[_0x2aab('0x1e')](_0xb0ff8c);}};}function respondWithFilteredResult(_0x543ca0,_0x3437c2){return function(_0x4ebce7){if(_0x4ebce7){var _0x3855b7=_0x4ebce7[_0x2aab('0x1f')],_0x332d6b=_0x3437c2[_0x2aab('0x20')],_0x1baf22=_0x3437c2[_0x2aab('0x20')]+_0x3437c2[_0x2aab('0x21')],_0x10af82;if(_0x1baf22>=_0x3855b7){_0x1baf22=_0x3855b7;_0x10af82=0xc8;}else{_0x10af82=0xce;}_0x543ca0[_0x2aab('0x1d')](_0x10af82);return _0x543ca0[_0x2aab('0x22')](_0x2aab('0x23'),_0x332d6b+'-'+_0x1baf22+'/'+_0x3855b7)[_0x2aab('0x1e')](_0x4ebce7);}return null;};}function patchUpdates(_0x1ec2d8){return function(_0x1b4367){try{jsonpatch[_0x2aab('0x24')](_0x1b4367,_0x1ec2d8,!![]);}catch(_0x2c243f){return BPromise[_0x2aab('0x25')](_0x2c243f);}return _0x1b4367[_0x2aab('0x26')]();};}function saveUpdates(_0x1bb2bb,_0x118021){return function(_0x58aad7){if(_0x58aad7){return _0x58aad7[_0x2aab('0x27')](_0x1bb2bb)[_0x2aab('0x28')](function(_0x42544d){return _0x42544d;});}return null;};}function removeEntity(_0x4d20ab,_0x163a50){return function(_0x11bef2){if(_0x11bef2){return _0x11bef2[_0x2aab('0x29')]()[_0x2aab('0x28')](function(){var _0x295c66=_0x11bef2['get']({'plain':!![]});var _0x429481=_0x2aab('0x2a');return db[_0x2aab('0x2b')][_0x2aab('0x29')]({'where':{'type':_0x429481,'resourceId':_0x295c66['id']}})['then'](function(){return _0x11bef2;});})[_0x2aab('0x28')](function(){_0x4d20ab[_0x2aab('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34e311,_0x2c0174){return function(_0x86cbd3){if(!_0x86cbd3){_0x34e311[_0x2aab('0x2c')](0x194);}return _0x86cbd3;};}function handleError(_0x52d702,_0x574f2d){_0x574f2d=_0x574f2d||0x1f4;return function(_0x1942bd){logger[_0x2aab('0x2d')](_0x1942bd[_0x2aab('0x2e')]);if(_0x1942bd[_0x2aab('0x2f')]){delete _0x1942bd[_0x2aab('0x2f')];}_0x52d702[_0x2aab('0x1d')](_0x574f2d)[_0x2aab('0x30')](_0x1942bd);};}exports[_0x2aab('0x31')]=function(_0x59b891,_0x2986b9){var _0x4233ac={},_0x5b53a6={},_0x150676={'count':0x0,'rows':[]};var _0x325cb9=db[_0x2aab('0x32')][_0x2aab('0x33')];_0x5b53a6['model']=_[_0x2aab('0x34')](_0x325cb9);_0x5b53a6[_0x2aab('0x35')]=_[_0x2aab('0x34')](_0x59b891[_0x2aab('0x35')]);_0x5b53a6[_0x2aab('0x36')]=_['intersection'](_0x5b53a6[_0x2aab('0x37')],_0x5b53a6['query']);_0x4233ac[_0x2aab('0x38')]=_[_0x2aab('0x39')](_0x5b53a6[_0x2aab('0x37')],qs[_0x2aab('0x3a')](_0x59b891['query'][_0x2aab('0x3a')]));_0x4233ac['attributes']=_0x4233ac[_0x2aab('0x38')][_0x2aab('0x3b')]?_0x4233ac[_0x2aab('0x38')]:_0x5b53a6[_0x2aab('0x37')];if(!_0x59b891[_0x2aab('0x35')][_0x2aab('0x3c')](_0x2aab('0x3d'))){_0x4233ac[_0x2aab('0x21')]=qs[_0x2aab('0x21')](_0x59b891[_0x2aab('0x35')][_0x2aab('0x21')]);_0x4233ac['offset']=qs[_0x2aab('0x20')](_0x59b891[_0x2aab('0x35')]['offset']);}_0x4233ac['order']=qs[_0x2aab('0x3e')](_0x59b891[_0x2aab('0x35')][_0x2aab('0x3e')]);_0x4233ac['where']=qs['filters'](_[_0x2aab('0x3f')](_0x59b891[_0x2aab('0x35')],_0x5b53a6[_0x2aab('0x36')]));if(_0x59b891['query']['filter']){_0x4233ac['where']=_[_0x2aab('0x40')](_0x4233ac[_0x2aab('0x41')],{'$or':_[_0x2aab('0x42')](_0x325cb9,function(_0x29d588){if(_0x29d588[_0x2aab('0x43')][_0x2aab('0x44')]!=='VIRTUAL'){var _0x5e44b9={};_0x5e44b9[_0x29d588[_0x2aab('0x45')]]={'$like':'%'+_0x59b891['query'][_0x2aab('0x46')]+'%'};return _0x5e44b9;}})});}_0x4233ac=_[_0x2aab('0x40')]({},_0x4233ac,_0x59b891[_0x2aab('0x47')]);var _0x59ff45={'where':_0x4233ac[_0x2aab('0x41')]};return db['SmsQueue'][_0x2aab('0x1f')](_0x59ff45)[_0x2aab('0x28')](function(_0x4bebc0){_0x150676['count']=_0x4bebc0;if(_0x59b891[_0x2aab('0x35')][_0x2aab('0x48')]){_0x4233ac[_0x2aab('0x49')]=[{'all':!![]}];}return db['SmsQueue'][_0x2aab('0x4a')](_0x4233ac);})[_0x2aab('0x28')](function(_0x23cfa6){_0x150676[_0x2aab('0x4b')]=_0x23cfa6;return _0x150676;})[_0x2aab('0x28')](respondWithFilteredResult(_0x2986b9,_0x4233ac))[_0x2aab('0x4c')](handleError(_0x2986b9,null));};exports['show']=function(_0xdb9a44,_0x49acde){var _0x4a6104={'raw':!![],'where':{'id':_0xdb9a44[_0x2aab('0x4d')]['id']}},_0x252ba3={};_0x252ba3['model']=_[_0x2aab('0x34')](db[_0x2aab('0x32')][_0x2aab('0x33')]);_0x252ba3['query']=_[_0x2aab('0x34')](_0xdb9a44[_0x2aab('0x35')]);_0x252ba3[_0x2aab('0x36')]=_[_0x2aab('0x39')](_0x252ba3['model'],_0x252ba3[_0x2aab('0x35')]);_0x4a6104[_0x2aab('0x38')]=_[_0x2aab('0x39')](_0x252ba3[_0x2aab('0x37')],qs[_0x2aab('0x3a')](_0xdb9a44[_0x2aab('0x35')][_0x2aab('0x3a')]));_0x4a6104[_0x2aab('0x38')]=_0x4a6104[_0x2aab('0x38')][_0x2aab('0x3b')]?_0x4a6104['attributes']:_0x252ba3[_0x2aab('0x37')];if(_0xdb9a44[_0x2aab('0x35')][_0x2aab('0x48')]){_0x4a6104['include']=[{'all':!![]}];}_0x4a6104=_[_0x2aab('0x40')]({},_0x4a6104,_0xdb9a44[_0x2aab('0x47')]);return db[_0x2aab('0x32')][_0x2aab('0x4e')](_0x4a6104)['then'](handleEntityNotFound(_0x49acde,null))[_0x2aab('0x28')](respondWithResult(_0x49acde,null))[_0x2aab('0x4c')](handleError(_0x49acde,null));};exports[_0x2aab('0x4f')]=function(_0x224549,_0x43aba7){return db['SmsQueue']['create'](_0x224549[_0x2aab('0x50')],{})[_0x2aab('0x28')](function(_0xaed168){var _0x5caf4a=_0x224549[_0x2aab('0x51')][_0x2aab('0x52')]({'plain':!![]});if(!_0x5caf4a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5caf4a[_0x2aab('0x53')]==='user'){var _0x482f4b=_0xaed168['get']({'plain':!![]});var _0x23e0f0=_0x2aab('0x2a');return db[_0x2aab('0x54')][_0x2aab('0x4e')]({'where':{'name':_0x23e0f0,'userProfileId':_0x5caf4a[_0x2aab('0x55')]},'raw':!![]})[_0x2aab('0x28')](function(_0x12744e){if(_0x12744e&&_0x12744e['autoAssociation']===0x0){return db[_0x2aab('0x2b')][_0x2aab('0x4f')]({'name':_0x482f4b[_0x2aab('0x2f')],'resourceId':_0x482f4b['id'],'type':_0x12744e[_0x2aab('0x2f')],'sectionId':_0x12744e['id']},{})[_0x2aab('0x28')](function(){return _0xaed168;});}else{return _0xaed168;}})[_0x2aab('0x4c')](function(_0x116aec){logger[_0x2aab('0x2d')](_0x2aab('0x56'),_0x116aec);throw _0x116aec;});}return _0xaed168;})[_0x2aab('0x28')](respondWithResult(_0x43aba7,0xc9))['catch'](handleError(_0x43aba7,null));};exports[_0x2aab('0x27')]=function(_0x5ddad3,_0x2c8a9c){if(_0x5ddad3['body']['id']){delete _0x5ddad3['body']['id'];}return db[_0x2aab('0x32')]['find']({'where':{'id':_0x5ddad3['params']['id']}})[_0x2aab('0x28')](handleEntityNotFound(_0x2c8a9c,null))[_0x2aab('0x28')](saveUpdates(_0x5ddad3[_0x2aab('0x50')],null))[_0x2aab('0x28')](respondWithResult(_0x2c8a9c,null))['catch'](handleError(_0x2c8a9c,null));};exports[_0x2aab('0x29')]=function(_0xd5b75a,_0x44eea1){return db['SmsQueue']['find']({'where':{'id':_0xd5b75a['params']['id']}})[_0x2aab('0x28')](handleEntityNotFound(_0x44eea1,null))['then'](removeEntity(_0x44eea1,null))['catch'](handleError(_0x44eea1,null));};exports['describe']=function(_0x12bb94,_0x1aefa0){return db[_0x2aab('0x32')][_0x2aab('0x57')]()['then'](respondWithResult(_0x1aefa0,null))[_0x2aab('0x4c')](handleError(_0x1aefa0,null));};exports[_0x2aab('0x58')]=function(_0x57d976,_0x554c64,_0x33b7de){var _0x55072f={'raw':!![],'where':{}},_0x20b2a4={},_0x1351e6;return db[_0x2aab('0x32')]['findOne']({'where':{'id':_0x57d976['params']['id']}})['then'](handleEntityNotFound(_0x554c64,null))['then'](function(_0x1c648a){if(_0x1c648a){_0x1351e6=_0x1c648a['get']({'plain':!![]});_0x20b2a4[_0x2aab('0x37')]=_[_0x2aab('0x34')](db[_0x2aab('0x59')][_0x2aab('0x33')]);_0x20b2a4[_0x2aab('0x35')]=_[_0x2aab('0x34')](_0x57d976[_0x2aab('0x35')]);_0x20b2a4[_0x2aab('0x36')]=_[_0x2aab('0x39')](_0x20b2a4[_0x2aab('0x37')],_0x20b2a4[_0x2aab('0x35')]);_0x55072f[_0x2aab('0x38')]=_[_0x2aab('0x39')](_0x20b2a4['model'],qs[_0x2aab('0x3a')](_0x57d976[_0x2aab('0x35')][_0x2aab('0x3a')]));_0x55072f[_0x2aab('0x38')]=_0x55072f[_0x2aab('0x38')]['length']?_0x55072f[_0x2aab('0x38')]:_0x20b2a4['model'];if(!_0x57d976[_0x2aab('0x35')][_0x2aab('0x3c')](_0x2aab('0x3d'))){_0x55072f[_0x2aab('0x21')]=qs[_0x2aab('0x21')](_0x57d976[_0x2aab('0x35')]['limit']);_0x55072f[_0x2aab('0x20')]=qs[_0x2aab('0x20')](_0x57d976[_0x2aab('0x35')][_0x2aab('0x20')]);}_0x55072f[_0x2aab('0x5a')]=qs[_0x2aab('0x3e')](_0x57d976[_0x2aab('0x35')]['sort']);_0x55072f[_0x2aab('0x41')]=qs[_0x2aab('0x36')](_[_0x2aab('0x3f')](_0x57d976[_0x2aab('0x35')],_0x20b2a4[_0x2aab('0x36')]));_0x55072f[_0x2aab('0x41')]['SmsQueueId']=_0x1c648a['id'];if(_0x57d976[_0x2aab('0x35')]['filter']){_0x55072f[_0x2aab('0x41')]=_[_0x2aab('0x40')](_0x55072f[_0x2aab('0x41')],{'$or':_[_0x2aab('0x42')](_0x55072f[_0x2aab('0x38')],function(_0x297b45){var _0x1dbcaa={};_0x1dbcaa[_0x297b45]={'$like':'%'+_0x57d976[_0x2aab('0x35')][_0x2aab('0x46')]+'%'};return _0x1dbcaa;})});}_0x55072f=_[_0x2aab('0x40')]({},_0x55072f,_0x57d976['options']);return db[_0x2aab('0x59')][_0x2aab('0x4a')](_0x55072f);}})[_0x2aab('0x28')](function(_0x4802aa){if(_0x4802aa){return db[_0x2aab('0x5b')][_0x2aab('0x5c')]({'where':{'id':_[_0x2aab('0x42')](_0x4802aa,_0x2aab('0x5d')),'role':'agent'},'attributes':['id',_0x2aab('0x2f'),_0x2aab('0x5e'),_0x2aab('0x5f'),_0x2aab('0x60')]});}})['then'](function(_0x21f7c9){if(_0x21f7c9){return{'count':_0x21f7c9[_0x2aab('0x1f')],'rows':_['map'](_0x21f7c9[_0x2aab('0x4b')],function(_0x16cc54){return{'membername':_0x16cc54['name'],'UserId':_0x16cc54['id'],'queue_name':_0x1351e6['name'],'SmsQueueId':_0x1351e6['id'],'interface':util[_0x2aab('0x61')](_0x2aab('0x62'),'SIP',_0x16cc54['name']),'penalty':0x0,'paused':_0x16cc54['smsPause'],'createdAt':_0x16cc54['createdAt'],'updatedAt':_0x16cc54[_0x2aab('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2aab('0x28')](respondWithFilteredResult(_0x554c64,_0x55072f))['catch'](handleError(_0x554c64,null));};exports[_0x2aab('0x63')]=function(_0x2df7d3,_0x2b5927,_0x1d50e9){var _0x112aaf={};var _0x3023ec={};var _0x4eb391;var _0x54ffb5;return db[_0x2aab('0x32')][_0x2aab('0x64')]({'where':{'id':_0x2df7d3[_0x2aab('0x4d')]['id']}})[_0x2aab('0x28')](handleEntityNotFound(_0x2b5927,null))[_0x2aab('0x28')](function(_0x59653f){if(_0x59653f){_0x4eb391=_0x59653f;_0x3023ec[_0x2aab('0x37')]=_['keys'](db[_0x2aab('0x65')][_0x2aab('0x33')]);_0x3023ec[_0x2aab('0x35')]=_['keys'](_0x2df7d3[_0x2aab('0x35')]);_0x3023ec[_0x2aab('0x36')]=_[_0x2aab('0x39')](_0x3023ec[_0x2aab('0x37')],_0x3023ec[_0x2aab('0x35')]);_0x112aaf[_0x2aab('0x38')]=_[_0x2aab('0x39')](_0x3023ec['model'],qs['fields'](_0x2df7d3[_0x2aab('0x35')]['fields']));_0x112aaf[_0x2aab('0x38')]=_0x112aaf[_0x2aab('0x38')][_0x2aab('0x3b')]?_0x112aaf['attributes']:_0x3023ec[_0x2aab('0x37')];_0x112aaf[_0x2aab('0x5a')]=qs[_0x2aab('0x3e')](_0x2df7d3[_0x2aab('0x35')][_0x2aab('0x3e')]);_0x112aaf['where']=qs[_0x2aab('0x36')](_['pick'](_0x2df7d3['query'],_0x3023ec[_0x2aab('0x36')]));if(_0x2df7d3['query'][_0x2aab('0x46')]){_0x112aaf[_0x2aab('0x41')]=_[_0x2aab('0x40')](_0x112aaf[_0x2aab('0x41')],{'$or':_[_0x2aab('0x42')](_0x112aaf[_0x2aab('0x38')],function(_0x3d37ea){var _0x4f9145={};_0x4f9145[_0x3d37ea]={'$like':'%'+_0x2df7d3['query']['filter']+'%'};return _0x4f9145;})});}_0x112aaf=_[_0x2aab('0x40')]({},_0x112aaf,_0x2df7d3['options']);return _0x4eb391[_0x2aab('0x63')](_0x112aaf);}})['then'](function(_0x21b1eb){if(_0x21b1eb){_0x54ffb5=_0x21b1eb[_0x2aab('0x3b')];if(!_0x2df7d3['query'][_0x2aab('0x3c')](_0x2aab('0x3d'))){_0x112aaf['limit']=qs[_0x2aab('0x21')](_0x2df7d3[_0x2aab('0x35')]['limit']);_0x112aaf[_0x2aab('0x20')]=qs[_0x2aab('0x20')](_0x2df7d3['query'][_0x2aab('0x20')]);}return _0x4eb391['getTeams'](_0x112aaf);}})['then'](function(_0x56a1a3){if(_0x56a1a3){return _0x56a1a3?{'count':_0x54ffb5,'rows':_0x56a1a3}:null;}})[_0x2aab('0x28')](respondWithResult(_0x2b5927,null))[_0x2aab('0x4c')](handleError(_0x2b5927,null));};exports['addTeams']=function(_0x454279,_0x37b407,_0x240024){var _0x1467c4=_0x454279['body'][_0x2aab('0x66')];return db[_0x2aab('0x65')][_0x2aab('0x4a')]({'where':{'id':_[_0x2aab('0x42')](_0x1467c4,'id')},'attributes':['id'],'include':[{'model':db[_0x2aab('0x5b')],'as':_0x2aab('0x67'),'attributes':['id',_0x2aab('0x2f'),'online',_0x2aab('0x68'),_0x2aab('0x69')],'raw':!![]}]})[_0x2aab('0x28')](function(_0xe4ac6f){if(_0xe4ac6f){var _0x261149=_[_0x2aab('0x6a')](_0xe4ac6f,function(_0x2cab8f){var _0x47e72b=_0x2cab8f[_0x2aab('0x52')]({'plain':!![]});return _0x47e72b[_0x2aab('0x67')];});return db[_0x2aab('0x32')][_0x2aab('0x4e')]({'where':{'id':_0x454279['params']['id']}})['then'](function(_0x25d61a){return db[_0x2aab('0x6b')]['transaction'](function(_0x5c375c){return _0x25d61a[_0x2aab('0x6c')](_['map'](_0x1467c4,'id'),{'transaction':_0x5c375c})['then'](function(){return BPromise[_0x2aab('0x6d')](_0x261149,function(_0x1b0266){return db[_0x2aab('0x59')]['findOrCreate']({'where':{'UserId':_0x1b0266['id'],'SmsQueueId':_0x454279['params']['id']},'transaction':_0x5c375c});});})[_0x2aab('0x28')](function(){_0x261149['forEach'](function(_0x816dca){socket[_0x2aab('0x6e')]('userSmsQueue:save',{'UserId':_0x816dca['id'],'SmsQueueId':_0x25d61a['id']});});});});});}})['then'](respondWithStatusCode(_0x37b407,null))['catch'](handleError(_0x37b407,null));};exports[_0x2aab('0x6f')]=function(_0x433e55,_0x25c4a2,_0x43251e){return db[_0x2aab('0x65')][_0x2aab('0x4a')]({'where':{'id':_0x433e55[_0x2aab('0x35')][_0x2aab('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2aab('0x67'),'attributes':['id'],'raw':!![]}]})[_0x2aab('0x28')](handleEntityNotFound(_0x25c4a2,null))[_0x2aab('0x28')](function(_0x56c7c9){var _0x9c1dd2=_[_0x2aab('0x42')](_0x56c7c9,'id');var _0x1f15f5=[];var _0x1bb59f=[];var _0xfd0f71=squel['select']();_0xfd0f71[_0x2aab('0x45')](_0x2aab('0x71'))[_0x2aab('0x72')]('team_has_sms_queues','tq')[_0x2aab('0x73')](_0x2aab('0x74'),'ut',_0x2aab('0x75'))[_0x2aab('0x41')](_0x2aab('0x76'),_0x433e55[_0x2aab('0x4d')]['id']);for(var _0x3d77d5=0x0;_0x3d77d5<_0x56c7c9[_0x2aab('0x3b')];_0x3d77d5+=0x1){let _0x1f55e4=_0x56c7c9[_0x3d77d5];for(var _0xcee8ed=0x0;_0xcee8ed<_0x1f55e4[_0x2aab('0x67')][_0x2aab('0x3b')];_0xcee8ed+=0x1){let _0x3eeded=_0x1f55e4['Agents'][_0xcee8ed];var _0x56a750=_0xfd0f71[_0x2aab('0x77')]();_0x56a750['where'](_0x2aab('0x78'),_0x3eeded['id']);_0x1bb59f['push'](db[_0x2aab('0x6b')][_0x2aab('0x35')](_0x56a750['toString'](),{'type':db[_0x2aab('0x6b')][_0x2aab('0x79')][_0x2aab('0x7a')]})[_0x2aab('0x28')](function(_0x5d28eb){if(_0x5d28eb[_0x2aab('0x3b')]===0x1){return _0x3eeded['id'];}else{var _0x19c9d7=_[_0x2aab('0x7b')](_[_0x2aab('0x42')](_0x5d28eb,'TeamId'),function(_0x83c617){return _[_0x2aab('0x7c')](_0x9c1dd2,_0x83c617);});if(_0x19c9d7){return _0x3eeded['id'];}}}));}}return BPromise['all'](_0x1bb59f)['then'](function(_0x58cba9){_0x1f15f5=_(_0x1f15f5)['union'](_0x58cba9)['compact']()[_0x2aab('0x7d')]();return db[_0x2aab('0x32')]['find']({'where':{'id':_0x433e55[_0x2aab('0x4d')]['id']}})[_0x2aab('0x28')](function(_0x290abb){return db[_0x2aab('0x6b')]['transaction'](function(_0xc15f9a){return _0x290abb[_0x2aab('0x6f')](_0x433e55[_0x2aab('0x35')][_0x2aab('0x70')],{'transaction':_0xc15f9a})[_0x2aab('0x28')](function(){if(!_[_0x2aab('0x7e')](_0x1f15f5)){return _0x290abb[_0x2aab('0x7f')](_0x1f15f5,{'transaction':_0xc15f9a});}})['then'](function(){_0x1f15f5[_0x2aab('0x80')](function(_0x2ee9f8){socket[_0x2aab('0x6e')](_0x2aab('0x81'),{'UserId':_0x2ee9f8,'SmsQueueId':_0x290abb['id']});});});});});});})['then'](respondWithStatusCode(_0x25c4a2,null))[_0x2aab('0x4c')](handleError(_0x25c4a2,null));};exports[_0x2aab('0x82')]=function(_0x14c7f5,_0x15f666,_0x266d64){return db[_0x2aab('0x32')][_0x2aab('0x4e')]({'where':{'id':_0x14c7f5[_0x2aab('0x4d')]['id']}})[_0x2aab('0x28')](handleEntityNotFound(_0x15f666,null))['then'](function(_0x589af6){if(_0x589af6){return _0x589af6[_0x2aab('0x82')](_0x14c7f5[_0x2aab('0x50')][_0x2aab('0x70')],_[_0x2aab('0x83')](_0x14c7f5[_0x2aab('0x50')],[_0x2aab('0x70'),'id'])||{})[_0x2aab('0x84')](function(_0x3e26ab){for(var _0x704b2d=0x0;_0x704b2d<_0x14c7f5['body'][_0x2aab('0x70')]['length'];_0x704b2d+=0x1){socket['emit'](_0x2aab('0x85'),{'UserId':_0x14c7f5[_0x2aab('0x50')][_0x2aab('0x70')][_0x704b2d],'SmsQueueId':_0x14c7f5[_0x2aab('0x4d')]['id']});}return _0x3e26ab;});}})[_0x2aab('0x28')](respondWithResult(_0x15f666,null))[_0x2aab('0x4c')](handleError(_0x15f666,null));};exports[_0x2aab('0x7f')]=function(_0x2d793a,_0x54d6d7,_0x34db7a){return db['SmsQueue'][_0x2aab('0x4e')]({'where':{'id':_0x2d793a['params']['id']}})['then'](handleEntityNotFound(_0x54d6d7,null))['then'](function(_0x161da5){if(_0x161da5){return _0x161da5[_0x2aab('0x7f')](_0x2d793a[_0x2aab('0x35')][_0x2aab('0x70')])[_0x2aab('0x28')](function(){if(_[_0x2aab('0x86')](_0x2d793a[_0x2aab('0x35')][_0x2aab('0x70')])){for(var _0x6de850=0x0;_0x6de850<_0x2d793a[_0x2aab('0x35')][_0x2aab('0x70')]['length'];_0x6de850+=0x1){socket[_0x2aab('0x6e')](_0x2aab('0x81'),{'UserId':Number(_0x2d793a[_0x2aab('0x35')]['ids'][_0x6de850]),'SmsQueueId':Number(_0x2d793a['params']['id'])});}}else{socket['emit'](_0x2aab('0x81'),{'UserId':Number(_0x2d793a[_0x2aab('0x35')][_0x2aab('0x70')]),'SmsQueueId':Number(_0x2d793a['params']['id'])});}});}})['then'](respondWithStatusCode(_0x54d6d7,null))[_0x2aab('0x4c')](handleError(_0x54d6d7,null));};exports['getAgents']=function(_0x54daca,_0x1ae236,_0x1c5044){var _0x13ea94={};var _0x1581fb={};var _0x5c3d1d;var _0x489d4d;return db[_0x2aab('0x32')][_0x2aab('0x64')]({'where':{'id':_0x54daca[_0x2aab('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1ae236,null))[_0x2aab('0x28')](function(_0x1fd9d0){if(_0x1fd9d0){_0x5c3d1d=_0x1fd9d0;_0x1581fb[_0x2aab('0x37')]=_[_0x2aab('0x34')](db['User']['rawAttributes']);_0x1581fb['query']=_[_0x2aab('0x34')](_0x54daca[_0x2aab('0x35')]);_0x1581fb['filters']=_[_0x2aab('0x39')](_0x1581fb[_0x2aab('0x37')],_0x1581fb[_0x2aab('0x35')]);_0x13ea94['attributes']=_[_0x2aab('0x39')](_0x1581fb['model'],qs[_0x2aab('0x3a')](_0x54daca[_0x2aab('0x35')][_0x2aab('0x3a')]));_0x13ea94[_0x2aab('0x38')]=_0x13ea94[_0x2aab('0x38')]['length']?_0x13ea94[_0x2aab('0x38')]:_0x1581fb[_0x2aab('0x37')];_0x13ea94['order']=qs['sort'](_0x54daca['query']['sort']);_0x13ea94[_0x2aab('0x41')]=qs[_0x2aab('0x36')](_['pick'](_0x54daca[_0x2aab('0x35')],_0x1581fb[_0x2aab('0x36')]));if(_0x54daca['query']['filter']){_0x13ea94['where']=_['merge'](_0x13ea94[_0x2aab('0x41')],{'$or':_['map'](_0x13ea94[_0x2aab('0x38')],function(_0x38d423){var _0x5f2d87={};_0x5f2d87[_0x38d423]={'$like':'%'+_0x54daca[_0x2aab('0x35')][_0x2aab('0x46')]+'%'};return _0x5f2d87;})});}_0x13ea94=_[_0x2aab('0x40')]({},_0x13ea94,_0x54daca[_0x2aab('0x47')]);return _0x5c3d1d['getAgents'](_0x13ea94);}})['then'](function(_0x52dc53){if(_0x52dc53){_0x489d4d=_0x52dc53[_0x2aab('0x3b')];if(!_0x54daca[_0x2aab('0x35')]['hasOwnProperty'](_0x2aab('0x3d'))){_0x13ea94[_0x2aab('0x21')]=qs['limit'](_0x54daca[_0x2aab('0x35')][_0x2aab('0x21')]);_0x13ea94[_0x2aab('0x20')]=qs[_0x2aab('0x20')](_0x54daca['query'][_0x2aab('0x20')]);}return _0x5c3d1d[_0x2aab('0x87')](_0x13ea94);}})[_0x2aab('0x28')](function(_0x26a23c){if(_0x26a23c){return _0x26a23c?{'count':_0x489d4d,'rows':_0x26a23c}:null;}})[_0x2aab('0x28')](respondWithResult(_0x1ae236,null))[_0x2aab('0x4c')](handleError(_0x1ae236,null));}; \ No newline at end of file +var _0xaba6=['stack','name','index','SmsQueue','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filter','map','type','key','VIRTUAL','field','merge','options','count','include','findAll','rows','catch','show','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserSmsQueue','nolimit','pick','User','findAndCountAll','smsPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','teams','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','tq.TeamId','from','team_has_sms_queues','user_has_teams','SmsQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','every','TeamId','includes','all','union','removeTeams','ids','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','moment','bluebird','util','path','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','Content-Range','apply','reject','update','then','destroy','get','SmsQueues','UserProfileResource','error'];(function(_0x64e687,_0x345aef){var _0x294cf8=function(_0x4f8992){while(--_0x4f8992){_0x64e687['push'](_0x64e687['shift']());}};_0x294cf8(++_0x345aef);}(_0xaba6,0xe2));var _0x6aba=function(_0x17c283,_0x587fcc){_0x17c283=_0x17c283-0x0;var _0x4e0800=_0xaba6[_0x17c283];return _0x4e0800;};'use strict';var pdf=require(_0x6aba('0x0'));var emlformat=require(_0x6aba('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6aba('0x2'));var BPromise=require(_0x6aba('0x3'));var Mustache=require('mustache');var util=require(_0x6aba('0x4'));var path=require(_0x6aba('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6aba('0x6'));var squel=require('squel');var crypto=require(_0x6aba('0x7'));var jsforce=require(_0x6aba('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x6aba('0x9'));var querystring=require(_0x6aba('0xa'));var Papa=require('papaparse');var Redis=require(_0x6aba('0xb'));var authService=require(_0x6aba('0xc'));var qs=require(_0x6aba('0xd'));var hardwareService=require(_0x6aba('0xe'));var logger=require(_0x6aba('0xf'))(_0x6aba('0x10'));var utils=require(_0x6aba('0x11'));var config=require('../../config/environment');var db=require(_0x6aba('0x12'))['db'];config[_0x6aba('0x13')]=_[_0x6aba('0x14')](config[_0x6aba('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x6aba('0x15'))(new Redis(config[_0x6aba('0x13')]));require('./smsQueue.socket')[_0x6aba('0x16')](socket);function respondWithStatusCode(_0x2934c3,_0x252574){_0x252574=_0x252574||0xcc;return function(_0x515272){if(_0x515272){return _0x2934c3[_0x6aba('0x17')](_0x252574);}return _0x2934c3[_0x6aba('0x18')](_0x252574)[_0x6aba('0x19')]();};}function respondWithResult(_0x4ae616,_0x117235){_0x117235=_0x117235||0xc8;return function(_0xe0c63f){if(_0xe0c63f){return _0x4ae616[_0x6aba('0x18')](_0x117235)[_0x6aba('0x1a')](_0xe0c63f);}};}function respondWithFilteredResult(_0x379b17,_0x26c91d){return function(_0x3009a9){if(_0x3009a9){var _0x564827=_0x3009a9['count'],_0x2291d7=_0x26c91d[_0x6aba('0x1b')],_0x448f29=_0x26c91d['offset']+_0x26c91d['limit'],_0x1c2efe;if(_0x448f29>=_0x564827){_0x448f29=_0x564827;_0x1c2efe=0xc8;}else{_0x1c2efe=0xce;}_0x379b17[_0x6aba('0x18')](_0x1c2efe);return _0x379b17['set'](_0x6aba('0x1c'),_0x2291d7+'-'+_0x448f29+'/'+_0x564827)[_0x6aba('0x1a')](_0x3009a9);}return null;};}function patchUpdates(_0x37b275){return function(_0xb2f624){try{jsonpatch[_0x6aba('0x1d')](_0xb2f624,_0x37b275,!![]);}catch(_0x41a3d2){return BPromise[_0x6aba('0x1e')](_0x41a3d2);}return _0xb2f624['save']();};}function saveUpdates(_0x2e5f65,_0x41464f){return function(_0x41744c){if(_0x41744c){return _0x41744c[_0x6aba('0x1f')](_0x2e5f65)[_0x6aba('0x20')](function(_0x43eef9){return _0x43eef9;});}return null;};}function removeEntity(_0x44f723,_0x67ba6e){return function(_0x2b02c5){if(_0x2b02c5){return _0x2b02c5[_0x6aba('0x21')]()[_0x6aba('0x20')](function(){var _0x3e18e3=_0x2b02c5[_0x6aba('0x22')]({'plain':!![]});var _0x3aafa3=_0x6aba('0x23');return db[_0x6aba('0x24')][_0x6aba('0x21')]({'where':{'type':_0x3aafa3,'resourceId':_0x3e18e3['id']}})[_0x6aba('0x20')](function(){return _0x2b02c5;});})[_0x6aba('0x20')](function(){_0x44f723['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x335e82,_0x5b0845){return function(_0x30ecf9){if(!_0x30ecf9){_0x335e82[_0x6aba('0x17')](0x194);}return _0x30ecf9;};}function handleError(_0x3ca593,_0x1725d2){_0x1725d2=_0x1725d2||0x1f4;return function(_0x5eef59){logger[_0x6aba('0x25')](_0x5eef59[_0x6aba('0x26')]);if(_0x5eef59[_0x6aba('0x27')]){delete _0x5eef59[_0x6aba('0x27')];}_0x3ca593[_0x6aba('0x18')](_0x1725d2)['send'](_0x5eef59);};}exports[_0x6aba('0x28')]=function(_0x5d89aa,_0x6e5f02){var _0x3fd125={},_0x54e780={},_0x4d601a={'count':0x0,'rows':[]};var _0x202a81=db[_0x6aba('0x29')][_0x6aba('0x2a')];_0x54e780[_0x6aba('0x2b')]=_[_0x6aba('0x2c')](_0x202a81);_0x54e780[_0x6aba('0x2d')]=_[_0x6aba('0x2c')](_0x5d89aa['query']);_0x54e780[_0x6aba('0x2e')]=_[_0x6aba('0x2f')](_0x54e780[_0x6aba('0x2b')],_0x54e780['query']);_0x3fd125[_0x6aba('0x30')]=_[_0x6aba('0x2f')](_0x54e780[_0x6aba('0x2b')],qs['fields'](_0x5d89aa[_0x6aba('0x2d')][_0x6aba('0x31')]));_0x3fd125['attributes']=_0x3fd125[_0x6aba('0x30')]['length']?_0x3fd125[_0x6aba('0x30')]:_0x54e780['model'];if(!_0x5d89aa[_0x6aba('0x2d')][_0x6aba('0x32')]('nolimit')){_0x3fd125['limit']=qs[_0x6aba('0x33')](_0x5d89aa['query'][_0x6aba('0x33')]);_0x3fd125[_0x6aba('0x1b')]=qs['offset'](_0x5d89aa[_0x6aba('0x2d')][_0x6aba('0x1b')]);}_0x3fd125[_0x6aba('0x34')]=qs[_0x6aba('0x35')](_0x5d89aa[_0x6aba('0x2d')][_0x6aba('0x35')]);_0x3fd125[_0x6aba('0x36')]=qs['filters'](_['pick'](_0x5d89aa[_0x6aba('0x2d')],_0x54e780['filters']));if(_0x5d89aa[_0x6aba('0x2d')][_0x6aba('0x37')]){_0x3fd125[_0x6aba('0x36')]=_['merge'](_0x3fd125[_0x6aba('0x36')],{'$or':_[_0x6aba('0x38')](_0x202a81,function(_0x2e5b0f){if(_0x2e5b0f[_0x6aba('0x39')][_0x6aba('0x3a')]!==_0x6aba('0x3b')){var _0x7cc00c={};_0x7cc00c[_0x2e5b0f[_0x6aba('0x3c')]]={'$like':'%'+_0x5d89aa[_0x6aba('0x2d')]['filter']+'%'};return _0x7cc00c;}})});}_0x3fd125=_[_0x6aba('0x3d')]({},_0x3fd125,_0x5d89aa[_0x6aba('0x3e')]);var _0x3f4d29={'where':_0x3fd125[_0x6aba('0x36')]};return db['SmsQueue'][_0x6aba('0x3f')](_0x3f4d29)['then'](function(_0x34f899){_0x4d601a['count']=_0x34f899;if(_0x5d89aa['query']['includeAll']){_0x3fd125[_0x6aba('0x40')]=[{'all':!![]}];}return db['SmsQueue'][_0x6aba('0x41')](_0x3fd125);})[_0x6aba('0x20')](function(_0x291983){_0x4d601a[_0x6aba('0x42')]=_0x291983;return _0x4d601a;})[_0x6aba('0x20')](respondWithFilteredResult(_0x6e5f02,_0x3fd125))[_0x6aba('0x43')](handleError(_0x6e5f02,null));};exports[_0x6aba('0x44')]=function(_0x5cfea2,_0x46e693){var _0xe75150={'raw':!![],'where':{'id':_0x5cfea2['params']['id']}},_0x44255b={};_0x44255b['model']=_[_0x6aba('0x2c')](db[_0x6aba('0x29')][_0x6aba('0x2a')]);_0x44255b[_0x6aba('0x2d')]=_[_0x6aba('0x2c')](_0x5cfea2['query']);_0x44255b[_0x6aba('0x2e')]=_[_0x6aba('0x2f')](_0x44255b[_0x6aba('0x2b')],_0x44255b[_0x6aba('0x2d')]);_0xe75150[_0x6aba('0x30')]=_[_0x6aba('0x2f')](_0x44255b[_0x6aba('0x2b')],qs['fields'](_0x5cfea2[_0x6aba('0x2d')][_0x6aba('0x31')]));_0xe75150[_0x6aba('0x30')]=_0xe75150[_0x6aba('0x30')][_0x6aba('0x45')]?_0xe75150[_0x6aba('0x30')]:_0x44255b['model'];if(_0x5cfea2[_0x6aba('0x2d')]['includeAll']){_0xe75150['include']=[{'all':!![]}];}_0xe75150=_[_0x6aba('0x3d')]({},_0xe75150,_0x5cfea2[_0x6aba('0x3e')]);return db[_0x6aba('0x29')][_0x6aba('0x46')](_0xe75150)[_0x6aba('0x20')](handleEntityNotFound(_0x46e693,null))[_0x6aba('0x20')](respondWithResult(_0x46e693,null))[_0x6aba('0x43')](handleError(_0x46e693,null));};exports[_0x6aba('0x47')]=function(_0x109b5d,_0x1b0601){return db['SmsQueue'][_0x6aba('0x47')](_0x109b5d[_0x6aba('0x48')],{})[_0x6aba('0x20')](function(_0xee64df){var _0x40ce81=_0x109b5d[_0x6aba('0x49')][_0x6aba('0x22')]({'plain':!![]});if(!_0x40ce81)throw new Error(_0x6aba('0x4a'));if(_0x40ce81[_0x6aba('0x4b')]===_0x6aba('0x49')){var _0x24f87c=_0xee64df[_0x6aba('0x22')]({'plain':!![]});var _0x3f7003='SmsQueues';return db[_0x6aba('0x4c')][_0x6aba('0x46')]({'where':{'name':_0x3f7003,'userProfileId':_0x40ce81[_0x6aba('0x4d')]},'raw':!![]})['then'](function(_0x12383d){if(_0x12383d&&_0x12383d['autoAssociation']===0x0){return db['UserProfileResource'][_0x6aba('0x47')]({'name':_0x24f87c[_0x6aba('0x27')],'resourceId':_0x24f87c['id'],'type':_0x12383d[_0x6aba('0x27')],'sectionId':_0x12383d['id']},{})['then'](function(){return _0xee64df;});}else{return _0xee64df;}})[_0x6aba('0x43')](function(_0x31cc76){logger[_0x6aba('0x25')](_0x6aba('0x4e'),_0x31cc76);throw _0x31cc76;});}return _0xee64df;})[_0x6aba('0x20')](respondWithResult(_0x1b0601,0xc9))[_0x6aba('0x43')](handleError(_0x1b0601,null));};exports['update']=function(_0x24f237,_0x1e2460){if(_0x24f237['body']['id']){delete _0x24f237[_0x6aba('0x48')]['id'];}return db[_0x6aba('0x29')][_0x6aba('0x46')]({'where':{'id':_0x24f237[_0x6aba('0x4f')]['id']}})[_0x6aba('0x20')](handleEntityNotFound(_0x1e2460,null))[_0x6aba('0x20')](saveUpdates(_0x24f237['body'],null))['then'](respondWithResult(_0x1e2460,null))[_0x6aba('0x43')](handleError(_0x1e2460,null));};exports[_0x6aba('0x21')]=function(_0x4b67ca,_0x31720e){return db[_0x6aba('0x29')]['find']({'where':{'id':_0x4b67ca[_0x6aba('0x4f')]['id']}})['then'](handleEntityNotFound(_0x31720e,null))[_0x6aba('0x20')](removeEntity(_0x31720e,null))[_0x6aba('0x43')](handleError(_0x31720e,null));};exports[_0x6aba('0x50')]=function(_0x50e717,_0x20d58e){return db[_0x6aba('0x29')][_0x6aba('0x50')]()[_0x6aba('0x20')](respondWithResult(_0x20d58e,null))[_0x6aba('0x43')](handleError(_0x20d58e,null));};exports['getMembers']=function(_0x4ed26c,_0x353798,_0x36449f){var _0x585468={'raw':!![],'where':{}},_0x1b6d7d={},_0x145903;return db[_0x6aba('0x29')][_0x6aba('0x51')]({'where':{'id':_0x4ed26c[_0x6aba('0x4f')]['id']}})[_0x6aba('0x20')](handleEntityNotFound(_0x353798,null))['then'](function(_0x419290){if(_0x419290){_0x145903=_0x419290[_0x6aba('0x22')]({'plain':!![]});_0x1b6d7d[_0x6aba('0x2b')]=_[_0x6aba('0x2c')](db[_0x6aba('0x52')][_0x6aba('0x2a')]);_0x1b6d7d[_0x6aba('0x2d')]=_[_0x6aba('0x2c')](_0x4ed26c[_0x6aba('0x2d')]);_0x1b6d7d[_0x6aba('0x2e')]=_[_0x6aba('0x2f')](_0x1b6d7d[_0x6aba('0x2b')],_0x1b6d7d[_0x6aba('0x2d')]);_0x585468[_0x6aba('0x30')]=_[_0x6aba('0x2f')](_0x1b6d7d[_0x6aba('0x2b')],qs[_0x6aba('0x31')](_0x4ed26c[_0x6aba('0x2d')]['fields']));_0x585468['attributes']=_0x585468[_0x6aba('0x30')]['length']?_0x585468[_0x6aba('0x30')]:_0x1b6d7d[_0x6aba('0x2b')];if(!_0x4ed26c[_0x6aba('0x2d')][_0x6aba('0x32')](_0x6aba('0x53'))){_0x585468[_0x6aba('0x33')]=qs[_0x6aba('0x33')](_0x4ed26c[_0x6aba('0x2d')][_0x6aba('0x33')]);_0x585468['offset']=qs[_0x6aba('0x1b')](_0x4ed26c[_0x6aba('0x2d')][_0x6aba('0x1b')]);}_0x585468['order']=qs[_0x6aba('0x35')](_0x4ed26c[_0x6aba('0x2d')]['sort']);_0x585468[_0x6aba('0x36')]=qs[_0x6aba('0x2e')](_[_0x6aba('0x54')](_0x4ed26c[_0x6aba('0x2d')],_0x1b6d7d[_0x6aba('0x2e')]));_0x585468[_0x6aba('0x36')]['SmsQueueId']=_0x419290['id'];if(_0x4ed26c[_0x6aba('0x2d')][_0x6aba('0x37')]){_0x585468['where']=_[_0x6aba('0x3d')](_0x585468[_0x6aba('0x36')],{'$or':_['map'](_0x585468[_0x6aba('0x30')],function(_0x17934f){var _0x51cb76={};_0x51cb76[_0x17934f]={'$like':'%'+_0x4ed26c[_0x6aba('0x2d')][_0x6aba('0x37')]+'%'};return _0x51cb76;})});}_0x585468=_['merge']({},_0x585468,_0x4ed26c[_0x6aba('0x3e')]);return db[_0x6aba('0x52')][_0x6aba('0x41')](_0x585468);}})[_0x6aba('0x20')](function(_0x141b8e){if(_0x141b8e){return db[_0x6aba('0x55')][_0x6aba('0x56')]({'where':{'id':_[_0x6aba('0x38')](_0x141b8e,'UserId'),'role':'agent'},'attributes':['id',_0x6aba('0x27'),_0x6aba('0x57'),_0x6aba('0x58'),_0x6aba('0x59')]});}})[_0x6aba('0x20')](function(_0x1355e6){if(_0x1355e6){return{'count':_0x1355e6[_0x6aba('0x3f')],'rows':_[_0x6aba('0x38')](_0x1355e6[_0x6aba('0x42')],function(_0x3107aa){return{'membername':_0x3107aa[_0x6aba('0x27')],'UserId':_0x3107aa['id'],'queue_name':_0x145903['name'],'SmsQueueId':_0x145903['id'],'interface':util[_0x6aba('0x5a')](_0x6aba('0x5b'),_0x6aba('0x5c'),_0x3107aa[_0x6aba('0x27')]),'penalty':0x0,'paused':_0x3107aa[_0x6aba('0x57')],'createdAt':_0x3107aa[_0x6aba('0x59')],'updatedAt':_0x3107aa[_0x6aba('0x58')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6aba('0x20')](respondWithFilteredResult(_0x353798,_0x585468))[_0x6aba('0x43')](handleError(_0x353798,null));};exports['getTeams']=function(_0x4cab0f,_0x15d2a3,_0x533d3e){var _0x4e4ae7={};var _0x11f714={};var _0x1c1786;var _0x2fd378;return db[_0x6aba('0x29')][_0x6aba('0x51')]({'where':{'id':_0x4cab0f[_0x6aba('0x4f')]['id']}})[_0x6aba('0x20')](handleEntityNotFound(_0x15d2a3,null))[_0x6aba('0x20')](function(_0x9d40fb){if(_0x9d40fb){_0x1c1786=_0x9d40fb;_0x11f714[_0x6aba('0x2b')]=_[_0x6aba('0x2c')](db[_0x6aba('0x5d')]['rawAttributes']);_0x11f714[_0x6aba('0x2d')]=_[_0x6aba('0x2c')](_0x4cab0f['query']);_0x11f714[_0x6aba('0x2e')]=_[_0x6aba('0x2f')](_0x11f714[_0x6aba('0x2b')],_0x11f714['query']);_0x4e4ae7[_0x6aba('0x30')]=_['intersection'](_0x11f714['model'],qs['fields'](_0x4cab0f[_0x6aba('0x2d')][_0x6aba('0x31')]));_0x4e4ae7[_0x6aba('0x30')]=_0x4e4ae7['attributes'][_0x6aba('0x45')]?_0x4e4ae7[_0x6aba('0x30')]:_0x11f714[_0x6aba('0x2b')];_0x4e4ae7[_0x6aba('0x34')]=qs[_0x6aba('0x35')](_0x4cab0f['query']['sort']);_0x4e4ae7[_0x6aba('0x36')]=qs['filters'](_[_0x6aba('0x54')](_0x4cab0f[_0x6aba('0x2d')],_0x11f714[_0x6aba('0x2e')]));if(_0x4cab0f[_0x6aba('0x2d')][_0x6aba('0x37')]){_0x4e4ae7[_0x6aba('0x36')]=_[_0x6aba('0x3d')](_0x4e4ae7[_0x6aba('0x36')],{'$or':_[_0x6aba('0x38')](_0x4e4ae7['attributes'],function(_0x16a8ee){var _0x260a7b={};_0x260a7b[_0x16a8ee]={'$like':'%'+_0x4cab0f[_0x6aba('0x2d')]['filter']+'%'};return _0x260a7b;})});}_0x4e4ae7=_[_0x6aba('0x3d')]({},_0x4e4ae7,_0x4cab0f['options']);return _0x1c1786[_0x6aba('0x5e')](_0x4e4ae7);}})[_0x6aba('0x20')](function(_0x53f530){if(_0x53f530){_0x2fd378=_0x53f530[_0x6aba('0x45')];if(!_0x4cab0f[_0x6aba('0x2d')][_0x6aba('0x32')](_0x6aba('0x53'))){_0x4e4ae7[_0x6aba('0x33')]=qs['limit'](_0x4cab0f[_0x6aba('0x2d')][_0x6aba('0x33')]);_0x4e4ae7[_0x6aba('0x1b')]=qs[_0x6aba('0x1b')](_0x4cab0f['query'][_0x6aba('0x1b')]);}return _0x1c1786[_0x6aba('0x5e')](_0x4e4ae7);}})['then'](function(_0x72bf2e){if(_0x72bf2e){return _0x72bf2e?{'count':_0x2fd378,'rows':_0x72bf2e}:null;}})[_0x6aba('0x20')](respondWithResult(_0x15d2a3,null))[_0x6aba('0x43')](handleError(_0x15d2a3,null));};exports[_0x6aba('0x5f')]=function(_0x150042,_0x206a2e,_0x5cdd88){var _0x1ae259=_0x150042[_0x6aba('0x48')][_0x6aba('0x60')];return db[_0x6aba('0x5d')][_0x6aba('0x41')]({'where':{'id':_['map'](_0x1ae259,'id')},'attributes':['id'],'include':[{'model':db[_0x6aba('0x55')],'as':_0x6aba('0x61'),'attributes':['id',_0x6aba('0x27'),_0x6aba('0x62'),_0x6aba('0x63'),_0x6aba('0x64')],'raw':!![]}]})[_0x6aba('0x20')](function(_0x2cc5b8){if(_0x2cc5b8){var _0x20e8f4=_['flatMap'](_0x2cc5b8,function(_0x2cdb29){var _0x66df64=_0x2cdb29[_0x6aba('0x22')]({'plain':!![]});return _0x66df64[_0x6aba('0x61')];});return db[_0x6aba('0x29')][_0x6aba('0x46')]({'where':{'id':_0x150042[_0x6aba('0x4f')]['id']}})['then'](function(_0x4f623b){return db[_0x6aba('0x65')][_0x6aba('0x66')](function(_0x1a504d){return _0x4f623b[_0x6aba('0x5f')](_[_0x6aba('0x38')](_0x1ae259,'id'),{'transaction':_0x1a504d})[_0x6aba('0x20')](function(){return BPromise[_0x6aba('0x67')](_0x20e8f4,function(_0x122a53){return db[_0x6aba('0x52')][_0x6aba('0x68')]({'where':{'UserId':_0x122a53['id'],'SmsQueueId':_0x150042[_0x6aba('0x4f')]['id']},'transaction':_0x1a504d});});})[_0x6aba('0x20')](function(){_0x20e8f4[_0x6aba('0x69')](function(_0x328a8b){socket[_0x6aba('0x6a')](_0x6aba('0x6b'),{'UserId':_0x328a8b['id'],'SmsQueueId':_0x4f623b['id']});});});});});}})[_0x6aba('0x20')](respondWithStatusCode(_0x206a2e,null))[_0x6aba('0x43')](handleError(_0x206a2e,null));};exports['removeTeams']=function(_0x497c50,_0x1cafcb,_0x18204){return db[_0x6aba('0x5d')]['findAll']({'where':{'id':_0x497c50[_0x6aba('0x2d')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6aba('0x55')],'as':_0x6aba('0x61'),'attributes':['id'],'raw':!![]}]})[_0x6aba('0x20')](handleEntityNotFound(_0x1cafcb,null))['then'](function(_0x19150e){var _0x37a703=_[_0x6aba('0x38')](_0x19150e,'id');var _0x56854e=[];var _0x438371=[];var _0x282ad3=squel['select']();_0x282ad3[_0x6aba('0x3c')](_0x6aba('0x6c'))[_0x6aba('0x6d')](_0x6aba('0x6e'),'tq')['join'](_0x6aba('0x6f'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x6aba('0x70'),_0x497c50[_0x6aba('0x4f')]['id']);for(var _0x58d8c0=0x0;_0x58d8c0<_0x19150e[_0x6aba('0x45')];_0x58d8c0+=0x1){let _0x50fbae=_0x19150e[_0x58d8c0];for(var _0x551d5d=0x0;_0x551d5d<_0x50fbae[_0x6aba('0x61')]['length'];_0x551d5d+=0x1){let _0x33f861=_0x50fbae[_0x6aba('0x61')][_0x551d5d];var _0x1ca580=_0x282ad3[_0x6aba('0x71')]();_0x1ca580['where']('ut.UserId\x20=\x20?',_0x33f861['id']);_0x438371[_0x6aba('0x72')](db[_0x6aba('0x65')][_0x6aba('0x2d')](_0x1ca580['toString'](),{'type':db[_0x6aba('0x65')][_0x6aba('0x73')][_0x6aba('0x74')]})[_0x6aba('0x20')](function(_0x58b7b8){if(_0x58b7b8['length']===0x1){return _0x33f861['id'];}else{var _0x2cbd40=_[_0x6aba('0x75')](_[_0x6aba('0x38')](_0x58b7b8,_0x6aba('0x76')),function(_0x7b16cc){return _[_0x6aba('0x77')](_0x37a703,_0x7b16cc);});if(_0x2cbd40){return _0x33f861['id'];}}}));}}return BPromise[_0x6aba('0x78')](_0x438371)['then'](function(_0x456ae4){_0x56854e=_(_0x56854e)[_0x6aba('0x79')](_0x456ae4)['compact']()['value']();return db['SmsQueue'][_0x6aba('0x46')]({'where':{'id':_0x497c50[_0x6aba('0x4f')]['id']}})[_0x6aba('0x20')](function(_0x37d04a){return db['sequelize']['transaction'](function(_0xf92c11){return _0x37d04a[_0x6aba('0x7a')](_0x497c50[_0x6aba('0x2d')][_0x6aba('0x7b')],{'transaction':_0xf92c11})[_0x6aba('0x20')](function(){if(!_[_0x6aba('0x7c')](_0x56854e)){return _0x37d04a[_0x6aba('0x7d')](_0x56854e,{'transaction':_0xf92c11});}})[_0x6aba('0x20')](function(){_0x56854e[_0x6aba('0x69')](function(_0x775670){socket[_0x6aba('0x6a')](_0x6aba('0x7e'),{'UserId':_0x775670,'SmsQueueId':_0x37d04a['id']});});});});});});})['then'](respondWithStatusCode(_0x1cafcb,null))[_0x6aba('0x43')](handleError(_0x1cafcb,null));};exports['addAgents']=function(_0x168eaa,_0x3236a2,_0x3379f0){return db['SmsQueue'][_0x6aba('0x46')]({'where':{'id':_0x168eaa[_0x6aba('0x4f')]['id']}})[_0x6aba('0x20')](handleEntityNotFound(_0x3236a2,null))['then'](function(_0x2f9106){if(_0x2f9106){return _0x2f9106[_0x6aba('0x7f')](_0x168eaa[_0x6aba('0x48')]['ids'],_[_0x6aba('0x80')](_0x168eaa[_0x6aba('0x48')],[_0x6aba('0x7b'),'id'])||{})[_0x6aba('0x81')](function(_0x27d3e4){for(var _0x44cc1f=0x0;_0x44cc1f<_0x168eaa[_0x6aba('0x48')][_0x6aba('0x7b')]['length'];_0x44cc1f+=0x1){socket[_0x6aba('0x6a')]('userSmsQueue:save',{'UserId':_0x168eaa[_0x6aba('0x48')][_0x6aba('0x7b')][_0x44cc1f],'SmsQueueId':_0x168eaa[_0x6aba('0x4f')]['id']});}return _0x27d3e4;});}})[_0x6aba('0x20')](respondWithResult(_0x3236a2,null))[_0x6aba('0x43')](handleError(_0x3236a2,null));};exports[_0x6aba('0x7d')]=function(_0x1cc285,_0x44c837,_0x425d7a){return db[_0x6aba('0x29')][_0x6aba('0x46')]({'where':{'id':_0x1cc285['params']['id']}})[_0x6aba('0x20')](handleEntityNotFound(_0x44c837,null))[_0x6aba('0x20')](function(_0xf0771e){if(_0xf0771e){return _0xf0771e[_0x6aba('0x7d')](_0x1cc285[_0x6aba('0x2d')][_0x6aba('0x7b')])[_0x6aba('0x20')](function(){if(_[_0x6aba('0x82')](_0x1cc285[_0x6aba('0x2d')][_0x6aba('0x7b')])){for(var _0x275137=0x0;_0x275137<_0x1cc285[_0x6aba('0x2d')][_0x6aba('0x7b')][_0x6aba('0x45')];_0x275137+=0x1){socket[_0x6aba('0x6a')](_0x6aba('0x7e'),{'UserId':Number(_0x1cc285[_0x6aba('0x2d')][_0x6aba('0x7b')][_0x275137]),'SmsQueueId':Number(_0x1cc285['params']['id'])});}}else{socket[_0x6aba('0x6a')](_0x6aba('0x7e'),{'UserId':Number(_0x1cc285[_0x6aba('0x2d')]['ids']),'SmsQueueId':Number(_0x1cc285[_0x6aba('0x4f')]['id'])});}});}})['then'](respondWithStatusCode(_0x44c837,null))[_0x6aba('0x43')](handleError(_0x44c837,null));};exports['getAgents']=function(_0x244c59,_0x4860dc,_0x5f06a2){var _0x560529={};var _0x13fec0={};var _0x5b36c7;var _0x4eb466;return db[_0x6aba('0x29')]['findOne']({'where':{'id':_0x244c59[_0x6aba('0x4f')]['id']}})[_0x6aba('0x20')](handleEntityNotFound(_0x4860dc,null))['then'](function(_0x3a7433){if(_0x3a7433){_0x5b36c7=_0x3a7433;_0x13fec0[_0x6aba('0x2b')]=_['keys'](db[_0x6aba('0x55')]['rawAttributes']);_0x13fec0[_0x6aba('0x2d')]=_['keys'](_0x244c59['query']);_0x13fec0[_0x6aba('0x2e')]=_[_0x6aba('0x2f')](_0x13fec0['model'],_0x13fec0[_0x6aba('0x2d')]);_0x560529[_0x6aba('0x30')]=_[_0x6aba('0x2f')](_0x13fec0['model'],qs[_0x6aba('0x31')](_0x244c59[_0x6aba('0x2d')][_0x6aba('0x31')]));_0x560529[_0x6aba('0x30')]=_0x560529[_0x6aba('0x30')][_0x6aba('0x45')]?_0x560529[_0x6aba('0x30')]:_0x13fec0[_0x6aba('0x2b')];_0x560529[_0x6aba('0x34')]=qs[_0x6aba('0x35')](_0x244c59[_0x6aba('0x2d')][_0x6aba('0x35')]);_0x560529['where']=qs[_0x6aba('0x2e')](_[_0x6aba('0x54')](_0x244c59['query'],_0x13fec0[_0x6aba('0x2e')]));if(_0x244c59[_0x6aba('0x2d')][_0x6aba('0x37')]){_0x560529['where']=_['merge'](_0x560529[_0x6aba('0x36')],{'$or':_[_0x6aba('0x38')](_0x560529[_0x6aba('0x30')],function(_0x1ac32e){var _0x299fc0={};_0x299fc0[_0x1ac32e]={'$like':'%'+_0x244c59[_0x6aba('0x2d')][_0x6aba('0x37')]+'%'};return _0x299fc0;})});}_0x560529=_[_0x6aba('0x3d')]({},_0x560529,_0x244c59[_0x6aba('0x3e')]);return _0x5b36c7[_0x6aba('0x83')](_0x560529);}})[_0x6aba('0x20')](function(_0x1869aa){if(_0x1869aa){_0x4eb466=_0x1869aa[_0x6aba('0x45')];if(!_0x244c59['query'][_0x6aba('0x32')](_0x6aba('0x53'))){_0x560529[_0x6aba('0x33')]=qs['limit'](_0x244c59['query']['limit']);_0x560529[_0x6aba('0x1b')]=qs[_0x6aba('0x1b')](_0x244c59[_0x6aba('0x2d')][_0x6aba('0x1b')]);}return _0x5b36c7[_0x6aba('0x83')](_0x560529);}})['then'](function(_0x5cb70f){if(_0x5cb70f){return _0x5cb70f?{'count':_0x4eb466,'rows':_0x5cb70f}:null;}})[_0x6aba('0x20')](respondWithResult(_0x4860dc,null))['catch'](handleError(_0x4860dc,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 783e234..8a459bd 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 _0xb071=['remove','emit','hasOwnProperty','hook','../../mysqldb','SmsQueue','setMaxListeners','save','update'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xb071,0x1e1));var _0x1b07=function(_0x501b4c,_0x55e4a5){_0x501b4c=_0x501b4c-0x0;var _0x1a6616=_0xb071[_0x501b4c];return _0x1a6616;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x1b07('0x0'))['db'][_0x1b07('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x1b07('0x2')](0x0);var events={'afterCreate':_0x1b07('0x3'),'afterUpdate':_0x1b07('0x4'),'afterDestroy':_0x1b07('0x5')};function emitEvent(_0x33c00a){return function(_0x34ca14,_0x416a3f,_0x57467e){SmsQueueEvents[_0x1b07('0x6')](_0x33c00a+':'+_0x34ca14['id'],_0x34ca14);SmsQueueEvents['emit'](_0x33c00a,_0x34ca14);_0x57467e(null);};}for(var e in events){if(events[_0x1b07('0x7')](e)){var event=events[e];SmsQueue[_0x1b07('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x4c91=['../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x3e5d45,_0x21494c){var _0x567665=function(_0x46566d){while(--_0x46566d){_0x3e5d45['push'](_0x3e5d45['shift']());}};_0x567665(++_0x21494c);}(_0x4c91,0x1d5));var _0x14c9=function(_0x392284,_0x378a50){_0x392284=_0x392284-0x0;var _0x2a877f=_0x4c91[_0x392284];return _0x2a877f;};'use strict';var EventEmitter=require(_0x14c9('0x0'));var SmsQueue=require(_0x14c9('0x1'))['db'][_0x14c9('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x14c9('0x3')](0x0);var events={'afterCreate':_0x14c9('0x4'),'afterUpdate':_0x14c9('0x5'),'afterDestroy':_0x14c9('0x6')};function emitEvent(_0x531bfe){return function(_0xfb6ad2,_0x252a9d,_0x5dbf09){SmsQueueEvents[_0x14c9('0x7')](_0x531bfe+':'+_0xfb6ad2['id'],_0xfb6ad2);SmsQueueEvents[_0x14c9('0x7')](_0x531bfe,_0xfb6ad2);_0x5dbf09(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x14c9('0x8')](e,emitEvent(event));}}module[_0x14c9('0x9')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index ec97aef..003f2ef 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 _0xb145=['request-promise','path','rimraf','./smsQueue.attributes','exports','SmsQueue','sms_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x27fe50,_0x4ca2fa){var _0x5ca322=function(_0x22e6a5){while(--_0x22e6a5){_0x27fe50['push'](_0x27fe50['shift']());}};_0x5ca322(++_0x4ca2fa);}(_0xb145,0xa3));var _0x5b14=function(_0x1776c3,_0x5bfaed){_0x1776c3=_0x1776c3-0x0;var _0x5f1430=_0xb145[_0x1776c3];return _0x5f1430;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var logger=require(_0x5b14('0x1'))(_0x5b14('0x2'));var moment=require(_0x5b14('0x3'));var BPromise=require(_0x5b14('0x4'));var rp=require(_0x5b14('0x5'));var fs=require('fs');var path=require(_0x5b14('0x6'));var rimraf=require(_0x5b14('0x7'));var config=require('../../config/environment');var attributes=require(_0x5b14('0x8'));module[_0x5b14('0x9')]=function(_0x392425,_0x4d82ad){return _0x392425['define'](_0x5b14('0xa'),attributes,{'tableName':_0x5b14('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeae8=['../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xeae8,0x66));var _0x8eae=function(_0x576cea,_0x199f89){_0x576cea=_0x576cea-0x0;var _0x3ebf57=_0xeae8[_0x576cea];return _0x3ebf57;};'use strict';var _=require(_0x8eae('0x0'));var util=require(_0x8eae('0x1'));var logger=require(_0x8eae('0x2'))('api');var moment=require(_0x8eae('0x3'));var BPromise=require('bluebird');var rp=require(_0x8eae('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8eae('0x5'));var config=require(_0x8eae('0x6'));var attributes=require(_0x8eae('0x7'));module[_0x8eae('0x8')]=function(_0xcc5f34,_0x123053){return _0xcc5f34[_0x8eae('0x9')](_0x8eae('0xa'),attributes,{'tableName':_0x8eae('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 abb2830..400224a 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 _0x96ea=['socket.io-emitter','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetSmsQueue','ShowSmsQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x5580c6,_0x23a48b){var _0x223e69=function(_0x305308){while(--_0x305308){_0x5580c6['push'](_0x5580c6['shift']());}};_0x223e69(++_0x23a48b);}(_0x96ea,0xc3));var _0xa96e=function(_0x533110,_0x20937f){_0x533110=_0x533110-0x0;var _0xc3c866=_0x96ea[_0x533110];return _0xc3c866;};'use strict';var _=require(_0xa96e('0x0'));var util=require(_0xa96e('0x1'));var moment=require(_0xa96e('0x2'));var BPromise=require(_0xa96e('0x3'));var rs=require(_0xa96e('0x4'));var fs=require('fs');var Redis=require(_0xa96e('0x5'));var db=require(_0xa96e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa96e('0x7'))('rpc');var config=require(_0xa96e('0x8'));var jayson=require(_0xa96e('0x9'));var client=jayson[_0xa96e('0xa')][_0xa96e('0xb')]({'port':0x232a});config['redis']=_[_0xa96e('0xc')](config[_0xa96e('0xd')],{'host':_0xa96e('0xe'),'port':0x18eb});var socket=require(_0xa96e('0xf'))(new Redis(config[_0xa96e('0xd')]));require(_0xa96e('0x10'))[_0xa96e('0x11')](socket);function respondWithRpcPromise(_0x2b71ce,_0x26d1b2,_0x5da3a8){return new BPromise(function(_0x2db021,_0x32acad){return client[_0xa96e('0x12')](_0x2b71ce,_0x5da3a8)['then'](function(_0x27037c){logger[_0xa96e('0x13')](_0xa96e('0x14'),_0x26d1b2,_0xa96e('0x15'));logger[_0xa96e('0x16')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x26d1b2,_0xa96e('0x15'),JSON[_0xa96e('0x17')](_0x27037c));if(_0x27037c[_0xa96e('0x18')]){if(_0x27037c[_0xa96e('0x18')][_0xa96e('0x19')]===0x1f4){logger[_0xa96e('0x18')](_0xa96e('0x14'),_0x26d1b2,_0x27037c[_0xa96e('0x18')]['message']);return _0x32acad(_0x27037c[_0xa96e('0x18')][_0xa96e('0x1a')]);}logger[_0xa96e('0x18')](_0xa96e('0x14'),_0x26d1b2,_0x27037c['error'][_0xa96e('0x1a')]);return _0x2db021(_0x27037c['error']['message']);}else{logger[_0xa96e('0x13')](_0xa96e('0x14'),_0x26d1b2,_0xa96e('0x15'));_0x2db021(_0x27037c[_0xa96e('0x1b')][_0xa96e('0x1a')]);}})[_0xa96e('0x1c')](function(_0x212f3a){logger[_0xa96e('0x18')](_0xa96e('0x14'),_0x26d1b2,_0x212f3a);_0x32acad(_0x212f3a);});});}exports['GetSmsQueue']=function(_0x136ecd){var _0x11aa2f=this;return new Promise(function(_0x43861b,_0x273f02){return db[_0xa96e('0x1d')][_0xa96e('0x1e')]({'raw':_0x136ecd[_0xa96e('0x1f')]?_0x136ecd[_0xa96e('0x1f')][_0xa96e('0x20')]===undefined?!![]:![]:!![],'where':_0x136ecd[_0xa96e('0x1f')]?_0x136ecd['options'][_0xa96e('0x21')]||null:null,'attributes':_0x136ecd[_0xa96e('0x1f')]?_0x136ecd[_0xa96e('0x1f')][_0xa96e('0x22')]||null:null,'limit':_0x136ecd['options']?_0x136ecd[_0xa96e('0x1f')][_0xa96e('0x23')]||null:null,'include':_0x136ecd['options']?_0x136ecd[_0xa96e('0x1f')][_0xa96e('0x24')]?_[_0xa96e('0x25')](_0x136ecd[_0xa96e('0x1f')][_0xa96e('0x24')],function(_0x1a3682){return{'model':db[_0x1a3682['model']],'as':_0x1a3682['as'],'attributes':_0x1a3682[_0xa96e('0x22')],'include':_0x1a3682['include']?_[_0xa96e('0x25')](_0x1a3682[_0xa96e('0x24')],function(_0x4f06d7){return{'model':db[_0x4f06d7[_0xa96e('0x26')]],'as':_0x4f06d7['as'],'attributes':_0x4f06d7[_0xa96e('0x22')],'include':_0x4f06d7['include']?_[_0xa96e('0x25')](_0x4f06d7[_0xa96e('0x24')],function(_0x249e83){return{'model':db[_0x249e83[_0xa96e('0x26')]],'as':_0x249e83['as'],'attributes':_0x249e83[_0xa96e('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44a6f0){logger[_0xa96e('0x13')](_0xa96e('0x27'),_0x136ecd);logger['debug'](_0xa96e('0x27'),_0x136ecd,JSON[_0xa96e('0x17')](_0x44a6f0));_0x43861b(_0x44a6f0);})[_0xa96e('0x1c')](function(_0x4a1b49){logger['error'](_0xa96e('0x27'),_0x4a1b49[_0xa96e('0x1a')],_0x136ecd);_0x273f02(_0x11aa2f[_0xa96e('0x18')](0x1f4,_0x4a1b49['message']));});});};exports[_0xa96e('0x28')]=function(_0x170f8b){var _0x5087d0=this;return new Promise(function(_0xc13028,_0x3b0f3e){return db[_0xa96e('0x1d')][_0xa96e('0x29')]({'raw':_0x170f8b['options']?_0x170f8b[_0xa96e('0x1f')][_0xa96e('0x20')]===undefined?!![]:![]:!![],'where':_0x170f8b[_0xa96e('0x1f')]?_0x170f8b[_0xa96e('0x1f')][_0xa96e('0x21')]||null:null,'attributes':_0x170f8b[_0xa96e('0x1f')]?_0x170f8b['options'][_0xa96e('0x22')]||null:null,'include':_0x170f8b[_0xa96e('0x1f')]?_0x170f8b[_0xa96e('0x1f')][_0xa96e('0x24')]?_[_0xa96e('0x25')](_0x170f8b[_0xa96e('0x1f')]['include'],function(_0xa54b71){return{'model':db[_0xa54b71[_0xa96e('0x26')]],'as':_0xa54b71['as'],'attributes':_0xa54b71[_0xa96e('0x22')],'include':_0xa54b71[_0xa96e('0x24')]?_[_0xa96e('0x25')](_0xa54b71[_0xa96e('0x24')],function(_0x22f36){return{'model':db[_0x22f36['model']],'as':_0x22f36['as'],'attributes':_0x22f36[_0xa96e('0x22')],'include':_0x22f36['include']?_['map'](_0x22f36[_0xa96e('0x24')],function(_0x6fd165){return{'model':db[_0x6fd165[_0xa96e('0x26')]],'as':_0x6fd165['as'],'attributes':_0x6fd165[_0xa96e('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x13871b){logger['info'](_0xa96e('0x28'),_0x170f8b);logger['debug'](_0xa96e('0x28'),_0x170f8b,JSON['stringify'](_0x13871b));_0xc13028(_0x13871b);})['catch'](function(_0x520e5f){logger['error'](_0xa96e('0x28'),_0x520e5f[_0xa96e('0x1a')],_0x170f8b);_0x3b0f3e(_0x5087d0[_0xa96e('0x18')](0x1f4,_0x520e5f[_0xa96e('0x1a')]));});});}; \ No newline at end of file +var _0x039b=['catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','include','map','model','ShowSmsQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','request','then','info','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','result'];(function(_0x28f54a,_0x353fcd){var _0x1e681c=function(_0x241f21){while(--_0x241f21){_0x28f54a['push'](_0x28f54a['shift']());}};_0x1e681c(++_0x353fcd);}(_0x039b,0x15d));var _0xb039=function(_0x392599,_0x2fe063){_0x392599=_0x392599-0x0;var _0x5926e2=_0x039b[_0x392599];return _0x5926e2;};'use strict';var _=require(_0xb039('0x0'));var util=require(_0xb039('0x1'));var moment=require(_0xb039('0x2'));var BPromise=require(_0xb039('0x3'));var rs=require(_0xb039('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb039('0x5'))['db'];var utils=require(_0xb039('0x6'));var logger=require(_0xb039('0x7'))(_0xb039('0x8'));var config=require(_0xb039('0x9'));var jayson=require(_0xb039('0xa'));var client=jayson[_0xb039('0xb')][_0xb039('0xc')]({'port':0x232a});config['redis']=_[_0xb039('0xd')](config[_0xb039('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xb039('0xf'))(new Redis(config['redis']));require('./smsQueue.socket')[_0xb039('0x10')](socket);function respondWithRpcPromise(_0x1a42c7,_0x52b2d5,_0x1709b8){return new BPromise(function(_0x4fd5e0,_0x14ab7d){return client[_0xb039('0x11')](_0x1a42c7,_0x1709b8)[_0xb039('0x12')](function(_0x35aaf4){logger[_0xb039('0x13')]('SmsQueue,\x20%s,\x20%s',_0x52b2d5,_0xb039('0x14'));logger[_0xb039('0x15')](_0xb039('0x16'),_0x52b2d5,_0xb039('0x14'),JSON[_0xb039('0x17')](_0x35aaf4));if(_0x35aaf4[_0xb039('0x18')]){if(_0x35aaf4[_0xb039('0x18')][_0xb039('0x19')]===0x1f4){logger[_0xb039('0x18')](_0xb039('0x1a'),_0x52b2d5,_0x35aaf4[_0xb039('0x18')]['message']);return _0x14ab7d(_0x35aaf4[_0xb039('0x18')][_0xb039('0x1b')]);}logger[_0xb039('0x18')]('SmsQueue,\x20%s,\x20%s',_0x52b2d5,_0x35aaf4[_0xb039('0x18')][_0xb039('0x1b')]);return _0x4fd5e0(_0x35aaf4['error']['message']);}else{logger[_0xb039('0x13')](_0xb039('0x1a'),_0x52b2d5,_0xb039('0x14'));_0x4fd5e0(_0x35aaf4[_0xb039('0x1c')][_0xb039('0x1b')]);}})[_0xb039('0x1d')](function(_0x1bc03e){logger['error'](_0xb039('0x1a'),_0x52b2d5,_0x1bc03e);_0x14ab7d(_0x1bc03e);});});}exports[_0xb039('0x1e')]=function(_0x26ba43){var _0x529313=this;return new Promise(function(_0x7cffb3,_0x34b876){return db[_0xb039('0x1f')][_0xb039('0x20')]({'raw':_0x26ba43[_0xb039('0x21')]?_0x26ba43[_0xb039('0x21')][_0xb039('0x22')]===undefined?!![]:![]:!![],'where':_0x26ba43['options']?_0x26ba43[_0xb039('0x21')][_0xb039('0x23')]||null:null,'attributes':_0x26ba43[_0xb039('0x21')]?_0x26ba43[_0xb039('0x21')][_0xb039('0x24')]||null:null,'limit':_0x26ba43[_0xb039('0x21')]?_0x26ba43[_0xb039('0x21')]['limit']||null:null,'include':_0x26ba43[_0xb039('0x21')]?_0x26ba43[_0xb039('0x21')][_0xb039('0x25')]?_[_0xb039('0x26')](_0x26ba43[_0xb039('0x21')][_0xb039('0x25')],function(_0x2ba5d2){return{'model':db[_0x2ba5d2[_0xb039('0x27')]],'as':_0x2ba5d2['as'],'attributes':_0x2ba5d2[_0xb039('0x24')],'include':_0x2ba5d2[_0xb039('0x25')]?_[_0xb039('0x26')](_0x2ba5d2[_0xb039('0x25')],function(_0x159c07){return{'model':db[_0x159c07[_0xb039('0x27')]],'as':_0x159c07['as'],'attributes':_0x159c07[_0xb039('0x24')],'include':_0x159c07[_0xb039('0x25')]?_['map'](_0x159c07['include'],function(_0x464fbb){return{'model':db[_0x464fbb[_0xb039('0x27')]],'as':_0x464fbb['as'],'attributes':_0x464fbb[_0xb039('0x24')]};}):[]};}):[]};}):[]:[]})[_0xb039('0x12')](function(_0x1d0240){logger[_0xb039('0x13')](_0xb039('0x1e'),_0x26ba43);logger['debug'](_0xb039('0x1e'),_0x26ba43,JSON[_0xb039('0x17')](_0x1d0240));_0x7cffb3(_0x1d0240);})[_0xb039('0x1d')](function(_0x436f93){logger[_0xb039('0x18')](_0xb039('0x1e'),_0x436f93['message'],_0x26ba43);_0x34b876(_0x529313[_0xb039('0x18')](0x1f4,_0x436f93['message']));});});};exports[_0xb039('0x28')]=function(_0x3ea309){var _0x33fc8c=this;return new Promise(function(_0x4b939c,_0x44fcfc){return db[_0xb039('0x1f')][_0xb039('0x29')]({'raw':_0x3ea309[_0xb039('0x21')]?_0x3ea309[_0xb039('0x21')][_0xb039('0x22')]===undefined?!![]:![]:!![],'where':_0x3ea309[_0xb039('0x21')]?_0x3ea309[_0xb039('0x21')][_0xb039('0x23')]||null:null,'attributes':_0x3ea309[_0xb039('0x21')]?_0x3ea309[_0xb039('0x21')]['attributes']||null:null,'include':_0x3ea309['options']?_0x3ea309[_0xb039('0x21')][_0xb039('0x25')]?_[_0xb039('0x26')](_0x3ea309['options']['include'],function(_0x4ea8f8){return{'model':db[_0x4ea8f8['model']],'as':_0x4ea8f8['as'],'attributes':_0x4ea8f8[_0xb039('0x24')],'include':_0x4ea8f8[_0xb039('0x25')]?_[_0xb039('0x26')](_0x4ea8f8[_0xb039('0x25')],function(_0x21b333){return{'model':db[_0x21b333[_0xb039('0x27')]],'as':_0x21b333['as'],'attributes':_0x21b333[_0xb039('0x24')],'include':_0x21b333[_0xb039('0x25')]?_[_0xb039('0x26')](_0x21b333[_0xb039('0x25')],function(_0x3d9310){return{'model':db[_0x3d9310[_0xb039('0x27')]],'as':_0x3d9310['as'],'attributes':_0x3d9310[_0xb039('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xcdc95a){logger[_0xb039('0x13')](_0xb039('0x28'),_0x3ea309);logger[_0xb039('0x15')](_0xb039('0x28'),_0x3ea309,JSON[_0xb039('0x17')](_0xcdc95a));_0x4b939c(_0xcdc95a);})[_0xb039('0x1d')](function(_0x35df47){logger['error'](_0xb039('0x28'),_0x35df47['message'],_0x3ea309);_0x44fcfc(_0x33fc8c[_0xb039('0x18')](0x1f4,_0x35df47[_0xb039('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 6d9600f..aaa2eda 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 _0xb9e0=['./smsQueue.events','save','remove','update','emit','removeListener','register','length','smsQueue:'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xb9e0,0x18c));var _0x0b9e=function(_0x4a248b,_0x29e290){_0x4a248b=_0x4a248b-0x0;var _0x565f8c=_0xb9e0[_0x4a248b];return _0x565f8c;};'use strict';var SmsQueueEvents=require(_0x0b9e('0x0'));var events=[_0x0b9e('0x1'),_0x0b9e('0x2'),_0x0b9e('0x3')];function createListener(_0x2bcf53,_0x396f73){return function(_0x1fe27e){_0x396f73[_0x0b9e('0x4')](_0x2bcf53,_0x1fe27e);};}function removeListener(_0x6220c8,_0x1b5d2d){return function(){SmsQueueEvents[_0x0b9e('0x5')](_0x6220c8,_0x1b5d2d);};}exports[_0x0b9e('0x6')]=function(_0x101c1c){for(var _0x1c94fa=0x0,_0x2cf5dd=events[_0x0b9e('0x7')];_0x1c94fa<_0x2cf5dd;_0x1c94fa++){var _0x4e580d=events[_0x1c94fa];var _0x6bf316=createListener(_0x0b9e('0x8')+_0x4e580d,_0x101c1c);SmsQueueEvents['on'](_0x4e580d,_0x6bf316);}}; \ No newline at end of file +var _0xf8bb=['smsQueue:','./smsQueue.events','save','remove','emit','removeListener','register','length'];(function(_0x4fca8e,_0x4c2162){var _0x23f51d=function(_0x4e42ae){while(--_0x4e42ae){_0x4fca8e['push'](_0x4fca8e['shift']());}};_0x23f51d(++_0x4c2162);}(_0xf8bb,0x111));var _0xbf8b=function(_0xf84414,_0x47012e){_0xf84414=_0xf84414-0x0;var _0x420759=_0xf8bb[_0xf84414];return _0x420759;};'use strict';var SmsQueueEvents=require(_0xbf8b('0x0'));var events=[_0xbf8b('0x1'),_0xbf8b('0x2'),'update'];function createListener(_0x3b85fe,_0x27af0c){return function(_0x2d4a12){_0x27af0c[_0xbf8b('0x3')](_0x3b85fe,_0x2d4a12);};}function removeListener(_0x1d5006,_0x1a0b38){return function(){SmsQueueEvents[_0xbf8b('0x4')](_0x1d5006,_0x1a0b38);};}exports[_0xbf8b('0x5')]=function(_0x441686){for(var _0x8d5666=0x0,_0x3b5f9e=events[_0xbf8b('0x6')];_0x8d5666<_0x3b5f9e;_0x8d5666++){var _0xd17f35=events[_0x8d5666];var _0x4b554f=createListener(_0xbf8b('0x7')+_0xd17f35,_0x441686);SmsQueueEvents['on'](_0xd17f35,_0x4b554f);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 36b5469..a721df3 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 _0x432b=['exports','multer','path','connect-timeout','express','Router','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','post','create','put'];(function(_0x3d6bfb,_0x531ffa){var _0x35f9ad=function(_0x1e8fa7){while(--_0x1e8fa7){_0x3d6bfb['push'](_0x3d6bfb['shift']());}};_0x35f9ad(++_0x531ffa);}(_0x432b,0x161));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb432('0x0'));var util=require('util');var path=require(_0xb432('0x1'));var timeout=require(_0xb432('0x2'));var express=require(_0xb432('0x3'));var router=express[_0xb432('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb432('0x5'));var controller=require('./smsQueueReport.controller');router[_0xb432('0x6')]('/',auth['isAuthenticated'](),controller[_0xb432('0x7')]);router[_0xb432('0x6')](_0xb432('0x8'),auth[_0xb432('0x9')](),controller[_0xb432('0xa')]);router[_0xb432('0x6')](_0xb432('0xb'),auth[_0xb432('0x9')](),controller['show']);router[_0xb432('0xc')]('/',auth[_0xb432('0x9')](),controller[_0xb432('0xd')]);router[_0xb432('0xe')](_0xb432('0xb'),auth[_0xb432('0x9')](),controller['update']);router['delete'](_0xb432('0xb'),auth[_0xb432('0x9')](),controller['destroy']);module[_0xb432('0xf')]=router; \ No newline at end of file +var _0x81d4=['isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','./smsQueueReport.controller','get'];(function(_0x51bc84,_0x519320){var _0x3a953e=function(_0x568464){while(--_0x568464){_0x51bc84['push'](_0x51bc84['shift']());}};_0x3a953e(++_0x519320);}(_0x81d4,0x197));var _0x481d=function(_0x1a4ed0,_0x4edc4c){_0x1a4ed0=_0x1a4ed0-0x0;var _0x4f6462=_0x81d4[_0x1a4ed0];return _0x4f6462;};'use strict';var multer=require('multer');var util=require(_0x481d('0x0'));var path=require(_0x481d('0x1'));var timeout=require('connect-timeout');var express=require(_0x481d('0x2'));var router=express[_0x481d('0x3')]();var auth=require(_0x481d('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x481d('0x5'));router[_0x481d('0x6')]('/',auth[_0x481d('0x7')](),controller['index']);router[_0x481d('0x6')](_0x481d('0x8'),auth[_0x481d('0x7')](),controller[_0x481d('0x9')]);router[_0x481d('0x6')](_0x481d('0xa'),auth['isAuthenticated'](),controller[_0x481d('0xb')]);router[_0x481d('0xc')]('/',auth[_0x481d('0x7')](),controller['create']);router[_0x481d('0xd')](_0x481d('0xa'),auth['isAuthenticated'](),controller[_0x481d('0xe')]);router[_0x481d('0xf')](_0x481d('0xa'),auth[_0x481d('0x7')](),controller[_0x481d('0x10')]);module[_0x481d('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 3306590..5188c8c 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 _0x55d3=['STRING','DATE','moment','sequelize'];(function(_0x4600f3,_0x6a6260){var _0x20483c=function(_0x52e6ca){while(--_0x52e6ca){_0x4600f3['push'](_0x4600f3['shift']());}};_0x20483c(++_0x6a6260);}(_0x55d3,0x7a));var _0x355d=function(_0x510915,_0x117a80){_0x510915=_0x510915-0x0;var _0x1618b8=_0x55d3[_0x510915];return _0x1618b8;};'use strict';var moment=require(_0x355d('0x0'));var Sequelize=require(_0x355d('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x355d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x355d('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x355d('0x3')]},'acceptAt':{'type':Sequelize[_0x355d('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x355d('0x2')]}}; \ No newline at end of file +var _0xf081=['DATE','moment','exports','STRING'];(function(_0x1a9142,_0x5539e6){var _0x3f14f6=function(_0x399e79){while(--_0x399e79){_0x1a9142['push'](_0x1a9142['shift']());}};_0x3f14f6(++_0x5539e6);}(_0xf081,0x139));var _0x1f08=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xf081[_0x4ae6ef];return _0x3cbb4e;};'use strict';var moment=require(_0x1f08('0x0'));var Sequelize=require('sequelize');module[_0x1f08('0x1')]={'uniqueid':{'type':Sequelize[_0x1f08('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1f08('0x2')]},'joinAt':{'type':Sequelize[_0x1f08('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x1f08('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x1f08('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 9cfe9e9..b1da837 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 _0x0738=['model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','catch','show','params','keys','find','body','destroy','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','index','SmsQueueReport','rawAttributes'];(function(_0x3bbaa1,_0x292fc7){var _0x447a9e=function(_0x46c1ae){while(--_0x46c1ae){_0x3bbaa1['push'](_0x3bbaa1['shift']());}};_0x447a9e(++_0x292fc7);}(_0x0738,0x6e));var _0x8073=function(_0x57fc2a,_0x14bbe5){_0x57fc2a=_0x57fc2a-0x0;var _0xa839b=_0x0738[_0x57fc2a];return _0xa839b;};'use strict';var pdf=require(_0x8073('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8073('0x1'));var zipdir=require(_0x8073('0x2'));var jsonpatch=require(_0x8073('0x3'));var rp=require(_0x8073('0x4'));var moment=require(_0x8073('0x5'));var BPromise=require(_0x8073('0x6'));var Mustache=require(_0x8073('0x7'));var util=require(_0x8073('0x8'));var path=require(_0x8073('0x9'));var sox=require(_0x8073('0xa'));var csv=require(_0x8073('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8073('0xc'));var squel=require(_0x8073('0xd'));var crypto=require(_0x8073('0xe'));var jsforce=require(_0x8073('0xf'));var deskjs=require(_0x8073('0x10'));var toCsv=require(_0x8073('0xb'));var querystring=require(_0x8073('0x11'));var Papa=require(_0x8073('0x12'));var Redis=require(_0x8073('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8073('0x14'));var logger=require(_0x8073('0x15'))(_0x8073('0x16'));var utils=require(_0x8073('0x17'));var config=require('../../config/environment');var db=require(_0x8073('0x18'))['db'];function respondWithStatusCode(_0x19d9cb,_0x4d0fed){_0x4d0fed=_0x4d0fed||0xcc;return function(_0x27ab23){if(_0x27ab23){return _0x19d9cb['sendStatus'](_0x4d0fed);}return _0x19d9cb[_0x8073('0x19')](_0x4d0fed)[_0x8073('0x1a')]();};}function respondWithResult(_0x10c69a,_0xb12b73){_0xb12b73=_0xb12b73||0xc8;return function(_0x4fc688){if(_0x4fc688){return _0x10c69a[_0x8073('0x19')](_0xb12b73)[_0x8073('0x1b')](_0x4fc688);}};}function respondWithFilteredResult(_0x116aa,_0x3b13ce){return function(_0x2ec7af){if(_0x2ec7af){var _0x5314ab=_0x2ec7af['count'],_0x3dde4d=_0x3b13ce[_0x8073('0x1c')],_0x5c0b97=_0x3b13ce[_0x8073('0x1c')]+_0x3b13ce[_0x8073('0x1d')],_0x2e41e2;if(_0x5c0b97>=_0x5314ab){_0x5c0b97=_0x5314ab;_0x2e41e2=0xc8;}else{_0x2e41e2=0xce;}_0x116aa[_0x8073('0x19')](_0x2e41e2);return _0x116aa[_0x8073('0x1e')](_0x8073('0x1f'),_0x3dde4d+'-'+_0x5c0b97+'/'+_0x5314ab)[_0x8073('0x1b')](_0x2ec7af);}return null;};}function patchUpdates(_0x8b8f1a){return function(_0x7c8cf0){try{jsonpatch[_0x8073('0x20')](_0x7c8cf0,_0x8b8f1a,!![]);}catch(_0x4998f7){return BPromise['reject'](_0x4998f7);}return _0x7c8cf0[_0x8073('0x21')]();};}function saveUpdates(_0x2fec07,_0x5baaf9){return function(_0x1c4b9a){if(_0x1c4b9a){return _0x1c4b9a[_0x8073('0x22')](_0x2fec07)[_0x8073('0x23')](function(_0x38a6f7){return _0x38a6f7;});}return null;};}function removeEntity(_0x14a6ce,_0x32069f){return function(_0x402fb6){if(_0x402fb6){return _0x402fb6['destroy']()[_0x8073('0x23')](function(){_0x14a6ce['status'](0xcc)[_0x8073('0x1a')]();});}};}function handleEntityNotFound(_0x46392c,_0x447106){return function(_0x52245a){if(!_0x52245a){_0x46392c[_0x8073('0x24')](0x194);}return _0x52245a;};}function handleError(_0x22c754,_0x18633f){_0x18633f=_0x18633f||0x1f4;return function(_0x484dd2){logger[_0x8073('0x25')](_0x484dd2[_0x8073('0x26')]);if(_0x484dd2[_0x8073('0x27')]){delete _0x484dd2[_0x8073('0x27')];}_0x22c754['status'](_0x18633f)[_0x8073('0x28')](_0x484dd2);};}exports[_0x8073('0x29')]=function(_0x282efe,_0xc98501){var _0x1d1a4c={},_0x22b34a={},_0x4da7d9={'count':0x0,'rows':[]};var _0x2f2f99=db[_0x8073('0x2a')][_0x8073('0x2b')];_0x22b34a[_0x8073('0x2c')]=_['keys'](_0x2f2f99);_0x22b34a[_0x8073('0x2d')]=_['keys'](_0x282efe['query']);_0x22b34a['filters']=_[_0x8073('0x2e')](_0x22b34a['model'],_0x22b34a['query']);_0x1d1a4c['attributes']=_[_0x8073('0x2e')](_0x22b34a[_0x8073('0x2c')],qs[_0x8073('0x2f')](_0x282efe['query'][_0x8073('0x2f')]));_0x1d1a4c[_0x8073('0x30')]=_0x1d1a4c['attributes'][_0x8073('0x31')]?_0x1d1a4c[_0x8073('0x30')]:_0x22b34a['model'];if(!_0x282efe[_0x8073('0x2d')][_0x8073('0x32')](_0x8073('0x33'))){_0x1d1a4c['limit']=qs[_0x8073('0x1d')](_0x282efe[_0x8073('0x2d')]['limit']);_0x1d1a4c[_0x8073('0x1c')]=qs[_0x8073('0x1c')](_0x282efe[_0x8073('0x2d')][_0x8073('0x1c')]);}_0x1d1a4c[_0x8073('0x34')]=qs[_0x8073('0x35')](_0x282efe['query']['sort']);_0x1d1a4c[_0x8073('0x36')]=qs[_0x8073('0x37')](_[_0x8073('0x38')](_0x282efe['query'],_0x22b34a['filters']));if(_0x282efe[_0x8073('0x2d')][_0x8073('0x39')]){_0x1d1a4c[_0x8073('0x36')]=_[_0x8073('0x3a')](_0x1d1a4c[_0x8073('0x36')],{'$or':_[_0x8073('0x3b')](_0x2f2f99,function(_0x2a01cb){if(_0x2a01cb[_0x8073('0x3c')][_0x8073('0x3d')]!==_0x8073('0x3e')){var _0x59ddd2={};_0x59ddd2[_0x2a01cb[_0x8073('0x3f')]]={'$like':'%'+_0x282efe['query'][_0x8073('0x39')]+'%'};return _0x59ddd2;}})});}_0x1d1a4c=_[_0x8073('0x3a')]({},_0x1d1a4c,_0x282efe[_0x8073('0x40')]);var _0x5e6388={'where':_0x1d1a4c['where']};return db[_0x8073('0x2a')][_0x8073('0x41')](_0x5e6388)['then'](function(_0x52fb6a){_0x4da7d9[_0x8073('0x41')]=_0x52fb6a;if(_0x282efe[_0x8073('0x2d')][_0x8073('0x42')]){_0x1d1a4c[_0x8073('0x43')]=[{'all':!![]}];}return db[_0x8073('0x2a')][_0x8073('0x44')](_0x1d1a4c);})[_0x8073('0x23')](function(_0x48adda){_0x4da7d9['rows']=_0x48adda;return _0x4da7d9;})[_0x8073('0x23')](respondWithFilteredResult(_0xc98501,_0x1d1a4c))[_0x8073('0x45')](handleError(_0xc98501,null));};exports[_0x8073('0x46')]=function(_0x59030c,_0x5dcbca){var _0x5abbf4={'raw':!![],'where':{'id':_0x59030c[_0x8073('0x47')]['id']}},_0x32159c={};_0x32159c[_0x8073('0x2c')]=_[_0x8073('0x48')](db[_0x8073('0x2a')][_0x8073('0x2b')]);_0x32159c['query']=_[_0x8073('0x48')](_0x59030c[_0x8073('0x2d')]);_0x32159c['filters']=_['intersection'](_0x32159c['model'],_0x32159c[_0x8073('0x2d')]);_0x5abbf4['attributes']=_[_0x8073('0x2e')](_0x32159c[_0x8073('0x2c')],qs[_0x8073('0x2f')](_0x59030c[_0x8073('0x2d')]['fields']));_0x5abbf4[_0x8073('0x30')]=_0x5abbf4[_0x8073('0x30')][_0x8073('0x31')]?_0x5abbf4['attributes']:_0x32159c['model'];if(_0x59030c[_0x8073('0x2d')][_0x8073('0x42')]){_0x5abbf4[_0x8073('0x43')]=[{'all':!![]}];}_0x5abbf4=_[_0x8073('0x3a')]({},_0x5abbf4,_0x59030c[_0x8073('0x40')]);return db[_0x8073('0x2a')][_0x8073('0x49')](_0x5abbf4)['then'](handleEntityNotFound(_0x5dcbca,null))[_0x8073('0x23')](respondWithResult(_0x5dcbca,null))[_0x8073('0x45')](handleError(_0x5dcbca,null));};exports['create']=function(_0x4382e4,_0x5577d6){return db[_0x8073('0x2a')]['create'](_0x4382e4[_0x8073('0x4a')],{})['then'](respondWithResult(_0x5577d6,0xc9))[_0x8073('0x45')](handleError(_0x5577d6,null));};exports[_0x8073('0x22')]=function(_0x59259d,_0x161974){if(_0x59259d[_0x8073('0x4a')]['id']){delete _0x59259d[_0x8073('0x4a')]['id'];}return db[_0x8073('0x2a')][_0x8073('0x49')]({'where':{'id':_0x59259d[_0x8073('0x47')]['id']}})[_0x8073('0x23')](handleEntityNotFound(_0x161974,null))['then'](saveUpdates(_0x59259d['body'],null))['then'](respondWithResult(_0x161974,null))[_0x8073('0x45')](handleError(_0x161974,null));};exports[_0x8073('0x4b')]=function(_0x4b8d05,_0x2ab68b){return db[_0x8073('0x2a')][_0x8073('0x49')]({'where':{'id':_0x4b8d05['params']['id']}})['then'](handleEntityNotFound(_0x2ab68b,null))[_0x8073('0x23')](removeEntity(_0x2ab68b,null))['catch'](handleError(_0x2ab68b,null));};exports['describe']=function(_0x8a5ab9,_0x536ffb){return db[_0x8073('0x2a')][_0x8073('0x4c')]()[_0x8073('0x23')](respondWithResult(_0x536ffb,null))['catch'](handleError(_0x536ffb,null));}; \ No newline at end of file +var _0xbf07=['status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','SmsQueueReport','rawAttributes','keys','query','filters','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','map','type','key','field','options','includeAll','include','rows','catch','show','params','intersection','merge','find','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','path','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x269f37,_0x57fd73){var _0x572fad=function(_0x67a900){while(--_0x67a900){_0x269f37['push'](_0x269f37['shift']());}};_0x572fad(++_0x57fd73);}(_0xbf07,0x77));var _0x7bf0=function(_0x4d08b8,_0x34c445){_0x4d08b8=_0x4d08b8-0x0;var _0x70214a=_0xbf07[_0x4d08b8];return _0x70214a;};'use strict';var pdf=require(_0x7bf0('0x0'));var emlformat=require(_0x7bf0('0x1'));var rimraf=require(_0x7bf0('0x2'));var zipdir=require(_0x7bf0('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7bf0('0x4'));var moment=require(_0x7bf0('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7bf0('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7bf0('0x7'));var squel=require('squel');var crypto=require(_0x7bf0('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x7bf0('0x9'));var toCsv=require(_0x7bf0('0xa'));var querystring=require(_0x7bf0('0xb'));var Papa=require(_0x7bf0('0xc'));var Redis=require(_0x7bf0('0xd'));var authService=require(_0x7bf0('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7bf0('0xf'));var logger=require('../../config/logger')(_0x7bf0('0x10'));var utils=require(_0x7bf0('0x11'));var config=require(_0x7bf0('0x12'));var db=require(_0x7bf0('0x13'))['db'];function respondWithStatusCode(_0x13fe51,_0x1e2507){_0x1e2507=_0x1e2507||0xcc;return function(_0xf81111){if(_0xf81111){return _0x13fe51[_0x7bf0('0x14')](_0x1e2507);}return _0x13fe51[_0x7bf0('0x15')](_0x1e2507)[_0x7bf0('0x16')]();};}function respondWithResult(_0x40608b,_0x4300ce){_0x4300ce=_0x4300ce||0xc8;return function(_0xf15732){if(_0xf15732){return _0x40608b[_0x7bf0('0x15')](_0x4300ce)[_0x7bf0('0x17')](_0xf15732);}};}function respondWithFilteredResult(_0x16a7a4,_0x4424a5){return function(_0x383be0){if(_0x383be0){var _0x20fc70=_0x383be0[_0x7bf0('0x18')],_0x182df9=_0x4424a5[_0x7bf0('0x19')],_0x4f551c=_0x4424a5[_0x7bf0('0x19')]+_0x4424a5[_0x7bf0('0x1a')],_0x319809;if(_0x4f551c>=_0x20fc70){_0x4f551c=_0x20fc70;_0x319809=0xc8;}else{_0x319809=0xce;}_0x16a7a4['status'](_0x319809);return _0x16a7a4[_0x7bf0('0x1b')](_0x7bf0('0x1c'),_0x182df9+'-'+_0x4f551c+'/'+_0x20fc70)[_0x7bf0('0x17')](_0x383be0);}return null;};}function patchUpdates(_0x117342){return function(_0x15f9d0){try{jsonpatch[_0x7bf0('0x1d')](_0x15f9d0,_0x117342,!![]);}catch(_0xf97278){return BPromise[_0x7bf0('0x1e')](_0xf97278);}return _0x15f9d0[_0x7bf0('0x1f')]();};}function saveUpdates(_0x1cde3b,_0x5ca332){return function(_0x115f78){if(_0x115f78){return _0x115f78[_0x7bf0('0x20')](_0x1cde3b)[_0x7bf0('0x21')](function(_0x3a74b6){return _0x3a74b6;});}return null;};}function removeEntity(_0x2cdc59,_0x2fe5e2){return function(_0x4e41b6){if(_0x4e41b6){return _0x4e41b6['destroy']()[_0x7bf0('0x21')](function(){_0x2cdc59[_0x7bf0('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4345a3,_0x4b5278){return function(_0x157e0f){if(!_0x157e0f){_0x4345a3[_0x7bf0('0x14')](0x194);}return _0x157e0f;};}function handleError(_0x7c7be6,_0x2b8c6f){_0x2b8c6f=_0x2b8c6f||0x1f4;return function(_0x37d539){logger[_0x7bf0('0x22')](_0x37d539[_0x7bf0('0x23')]);if(_0x37d539[_0x7bf0('0x24')]){delete _0x37d539[_0x7bf0('0x24')];}_0x7c7be6[_0x7bf0('0x15')](_0x2b8c6f)[_0x7bf0('0x25')](_0x37d539);};}exports['index']=function(_0x366c54,_0x113e17){var _0x358efe={},_0x368f9f={},_0x2ba0a3={'count':0x0,'rows':[]};var _0x59cb00=db[_0x7bf0('0x26')][_0x7bf0('0x27')];_0x368f9f['model']=_[_0x7bf0('0x28')](_0x59cb00);_0x368f9f['query']=_[_0x7bf0('0x28')](_0x366c54[_0x7bf0('0x29')]);_0x368f9f[_0x7bf0('0x2a')]=_['intersection'](_0x368f9f[_0x7bf0('0x2b')],_0x368f9f[_0x7bf0('0x29')]);_0x358efe[_0x7bf0('0x2c')]=_['intersection'](_0x368f9f[_0x7bf0('0x2b')],qs[_0x7bf0('0x2d')](_0x366c54[_0x7bf0('0x29')][_0x7bf0('0x2d')]));_0x358efe['attributes']=_0x358efe[_0x7bf0('0x2c')][_0x7bf0('0x2e')]?_0x358efe[_0x7bf0('0x2c')]:_0x368f9f[_0x7bf0('0x2b')];if(!_0x366c54[_0x7bf0('0x29')]['hasOwnProperty'](_0x7bf0('0x2f'))){_0x358efe[_0x7bf0('0x1a')]=qs['limit'](_0x366c54[_0x7bf0('0x29')][_0x7bf0('0x1a')]);_0x358efe['offset']=qs[_0x7bf0('0x19')](_0x366c54[_0x7bf0('0x29')][_0x7bf0('0x19')]);}_0x358efe[_0x7bf0('0x30')]=qs[_0x7bf0('0x31')](_0x366c54[_0x7bf0('0x29')][_0x7bf0('0x31')]);_0x358efe[_0x7bf0('0x32')]=qs[_0x7bf0('0x2a')](_[_0x7bf0('0x33')](_0x366c54[_0x7bf0('0x29')],_0x368f9f[_0x7bf0('0x2a')]));if(_0x366c54[_0x7bf0('0x29')][_0x7bf0('0x34')]){_0x358efe[_0x7bf0('0x32')]=_['merge'](_0x358efe[_0x7bf0('0x32')],{'$or':_[_0x7bf0('0x35')](_0x59cb00,function(_0x351336){if(_0x351336[_0x7bf0('0x36')][_0x7bf0('0x37')]!=='VIRTUAL'){var _0x777078={};_0x777078[_0x351336[_0x7bf0('0x38')]]={'$like':'%'+_0x366c54['query'][_0x7bf0('0x34')]+'%'};return _0x777078;}})});}_0x358efe=_['merge']({},_0x358efe,_0x366c54[_0x7bf0('0x39')]);var _0x3e6ed3={'where':_0x358efe[_0x7bf0('0x32')]};return db[_0x7bf0('0x26')][_0x7bf0('0x18')](_0x3e6ed3)[_0x7bf0('0x21')](function(_0x2e3800){_0x2ba0a3['count']=_0x2e3800;if(_0x366c54['query'][_0x7bf0('0x3a')]){_0x358efe[_0x7bf0('0x3b')]=[{'all':!![]}];}return db[_0x7bf0('0x26')]['findAll'](_0x358efe);})[_0x7bf0('0x21')](function(_0x1704a0){_0x2ba0a3[_0x7bf0('0x3c')]=_0x1704a0;return _0x2ba0a3;})[_0x7bf0('0x21')](respondWithFilteredResult(_0x113e17,_0x358efe))[_0x7bf0('0x3d')](handleError(_0x113e17,null));};exports[_0x7bf0('0x3e')]=function(_0x1acdeb,_0x56cfa0){var _0x28ba44={'raw':!![],'where':{'id':_0x1acdeb[_0x7bf0('0x3f')]['id']}},_0x4d656d={};_0x4d656d[_0x7bf0('0x2b')]=_[_0x7bf0('0x28')](db[_0x7bf0('0x26')][_0x7bf0('0x27')]);_0x4d656d[_0x7bf0('0x29')]=_[_0x7bf0('0x28')](_0x1acdeb[_0x7bf0('0x29')]);_0x4d656d[_0x7bf0('0x2a')]=_[_0x7bf0('0x40')](_0x4d656d[_0x7bf0('0x2b')],_0x4d656d[_0x7bf0('0x29')]);_0x28ba44['attributes']=_['intersection'](_0x4d656d[_0x7bf0('0x2b')],qs[_0x7bf0('0x2d')](_0x1acdeb[_0x7bf0('0x29')][_0x7bf0('0x2d')]));_0x28ba44['attributes']=_0x28ba44[_0x7bf0('0x2c')][_0x7bf0('0x2e')]?_0x28ba44[_0x7bf0('0x2c')]:_0x4d656d['model'];if(_0x1acdeb['query']['includeAll']){_0x28ba44[_0x7bf0('0x3b')]=[{'all':!![]}];}_0x28ba44=_[_0x7bf0('0x41')]({},_0x28ba44,_0x1acdeb['options']);return db[_0x7bf0('0x26')][_0x7bf0('0x42')](_0x28ba44)[_0x7bf0('0x21')](handleEntityNotFound(_0x56cfa0,null))['then'](respondWithResult(_0x56cfa0,null))['catch'](handleError(_0x56cfa0,null));};exports['create']=function(_0x549e81,_0x134371){return db['SmsQueueReport']['create'](_0x549e81['body'],{})[_0x7bf0('0x21')](respondWithResult(_0x134371,0xc9))[_0x7bf0('0x3d')](handleError(_0x134371,null));};exports[_0x7bf0('0x20')]=function(_0x272b9c,_0x5353cc){if(_0x272b9c[_0x7bf0('0x43')]['id']){delete _0x272b9c[_0x7bf0('0x43')]['id'];}return db[_0x7bf0('0x26')]['find']({'where':{'id':_0x272b9c['params']['id']}})[_0x7bf0('0x21')](handleEntityNotFound(_0x5353cc,null))[_0x7bf0('0x21')](saveUpdates(_0x272b9c[_0x7bf0('0x43')],null))[_0x7bf0('0x21')](respondWithResult(_0x5353cc,null))[_0x7bf0('0x3d')](handleError(_0x5353cc,null));};exports[_0x7bf0('0x44')]=function(_0xe1e7d2,_0x2df1ad){return db[_0x7bf0('0x26')][_0x7bf0('0x42')]({'where':{'id':_0xe1e7d2[_0x7bf0('0x3f')]['id']}})[_0x7bf0('0x21')](handleEntityNotFound(_0x2df1ad,null))[_0x7bf0('0x21')](removeEntity(_0x2df1ad,null))[_0x7bf0('0x3d')](handleError(_0x2df1ad,null));};exports['describe']=function(_0x5c2a84,_0x5c4cb2){return db[_0x7bf0('0x26')][_0x7bf0('0x45')]()[_0x7bf0('0x21')](respondWithResult(_0x5c4cb2,null))[_0x7bf0('0x3d')](handleError(_0x5c4cb2,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 5908473..de6bba9 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 _0x6a92=['util','../../config/logger','moment','path','../../config/environment','./smsQueueReport.attributes','define','report_sms_queue','uniqueid','lodash'];(function(_0x279368,_0x41c002){var _0x40b6d0=function(_0x493776){while(--_0x493776){_0x279368['push'](_0x279368['shift']());}};_0x40b6d0(++_0x41c002);}(_0x6a92,0x13f));var _0x26a9=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x6a92[_0x40a825];return _0x273a54;};'use strict';var _=require(_0x26a9('0x0'));var util=require(_0x26a9('0x1'));var logger=require(_0x26a9('0x2'))('api');var moment=require(_0x26a9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x26a9('0x4'));var rimraf=require('rimraf');var config=require(_0x26a9('0x5'));var attributes=require(_0x26a9('0x6'));module['exports']=function(_0x292d1e,_0x446ae7){return _0x292d1e[_0x26a9('0x7')]('SmsQueueReport',attributes,{'tableName':_0x26a9('0x8'),'paranoid':![],'indexes':[{'name':_0x26a9('0x9'),'fields':[_0x26a9('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8074=['../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x28e0ac,_0x286a26){var _0x1cf013=function(_0xb3ad20){while(--_0xb3ad20){_0x28e0ac['push'](_0x28e0ac['shift']());}};_0x1cf013(++_0x286a26);}(_0x8074,0x177));var _0x4807=function(_0x117e68,_0x3cc5ed){_0x117e68=_0x117e68-0x0;var _0x5a79cb=_0x8074[_0x117e68];return _0x5a79cb;};'use strict';var _=require(_0x4807('0x0'));var util=require(_0x4807('0x1'));var logger=require(_0x4807('0x2'))(_0x4807('0x3'));var moment=require(_0x4807('0x4'));var BPromise=require(_0x4807('0x5'));var rp=require(_0x4807('0x6'));var fs=require('fs');var path=require(_0x4807('0x7'));var rimraf=require(_0x4807('0x8'));var config=require(_0x4807('0x9'));var attributes=require(_0x4807('0xa'));module[_0x4807('0xb')]=function(_0x44717f,_0x5c5ec0){return _0x44717f[_0x4807('0xc')](_0x4807('0xd'),attributes,{'tableName':_0x4807('0xe'),'paranoid':![],'indexes':[{'name':_0x4807('0xf'),'fields':[_0x4807('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 3228bad..461e1cd 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 _0x2713=['http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSmsQueueReport','create','body','options','raw','then','SmsQueueReport','update','where','attributes','UpdateSmsQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0xfa4f34,_0x19cae2){var _0x398677=function(_0x193274){while(--_0x193274){_0xfa4f34['push'](_0xfa4f34['shift']());}};_0x398677(++_0x19cae2);}(_0x2713,0x127));var _0x3271=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x2713[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x3271('0x0'));var util=require(_0x3271('0x1'));var moment=require(_0x3271('0x2'));var BPromise=require('bluebird');var rs=require(_0x3271('0x3'));var fs=require('fs');var Redis=require(_0x3271('0x4'));var db=require(_0x3271('0x5'))['db'];var utils=require(_0x3271('0x6'));var logger=require(_0x3271('0x7'))(_0x3271('0x8'));var config=require(_0x3271('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3271('0xa')][_0x3271('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x537cf8,_0x240f0d,_0x5b5a43){return new BPromise(function(_0x356017,_0x4cfed2){return client[_0x3271('0xc')](_0x537cf8,_0x5b5a43)['then'](function(_0x488380){logger[_0x3271('0xd')](_0x3271('0xe'),_0x240f0d,_0x3271('0xf'));logger[_0x3271('0x10')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x240f0d,_0x3271('0xf'),JSON[_0x3271('0x11')](_0x488380));if(_0x488380['error']){if(_0x488380[_0x3271('0x12')][_0x3271('0x13')]===0x1f4){logger[_0x3271('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x240f0d,_0x488380[_0x3271('0x12')][_0x3271('0x14')]);return _0x4cfed2(_0x488380[_0x3271('0x12')][_0x3271('0x14')]);}logger[_0x3271('0x12')](_0x3271('0xe'),_0x240f0d,_0x488380['error'][_0x3271('0x14')]);return _0x356017(_0x488380[_0x3271('0x12')][_0x3271('0x14')]);}else{logger[_0x3271('0xd')](_0x3271('0xe'),_0x240f0d,'request\x20sent');_0x356017(_0x488380[_0x3271('0x15')][_0x3271('0x14')]);}})[_0x3271('0x16')](function(_0x1f1ac3){logger['error'](_0x3271('0xe'),_0x240f0d,_0x1f1ac3);_0x4cfed2(_0x1f1ac3);});});}exports[_0x3271('0x17')]=function(_0x2c35b8){var _0x3247f0=this;return new Promise(function(_0x3f0f97,_0x147f55){return db['SmsQueueReport'][_0x3271('0x18')](_0x2c35b8[_0x3271('0x19')],{'raw':_0x2c35b8[_0x3271('0x1a')]?_0x2c35b8['options'][_0x3271('0x1b')]===undefined?!![]:![]:!![]})[_0x3271('0x1c')](function(_0x55159b){logger[_0x3271('0xd')](_0x3271('0x17'),_0x2c35b8);logger['debug'](_0x3271('0x17'),_0x2c35b8,JSON['stringify'](_0x55159b));_0x3f0f97(_0x55159b);})[_0x3271('0x16')](function(_0x335ae0){logger[_0x3271('0x12')](_0x3271('0x17'),_0x335ae0[_0x3271('0x14')],_0x2c35b8);_0x147f55(_0x3247f0[_0x3271('0x12')](0x1f4,_0x335ae0[_0x3271('0x14')]));});});};exports['UpdateSmsQueueReport']=function(_0x48d74e){var _0xa17a2a=this;return new Promise(function(_0x3deaec,_0x4936d6){return db[_0x3271('0x1d')][_0x3271('0x1e')](_0x48d74e[_0x3271('0x19')],{'raw':_0x48d74e[_0x3271('0x1a')]?_0x48d74e[_0x3271('0x1a')][_0x3271('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48d74e[_0x3271('0x1a')]?_0x48d74e[_0x3271('0x1a')][_0x3271('0x1f')]||null:null,'attributes':_0x48d74e[_0x3271('0x1a')]?_0x48d74e[_0x3271('0x1a')][_0x3271('0x20')]||null:null,'limit':_0x48d74e['options']?_0x48d74e['options']['limit']||null:null})[_0x3271('0x1c')](function(_0x5ce7e6){logger[_0x3271('0xd')](_0x3271('0x21'),_0x48d74e);logger[_0x3271('0x10')]('UpdateSmsQueueReport',_0x48d74e,JSON[_0x3271('0x11')](_0x5ce7e6));_0x3deaec(_0x5ce7e6);})[_0x3271('0x16')](function(_0xfacc8d){logger[_0x3271('0x12')]('UpdateSmsQueueReport',_0xfacc8d[_0x3271('0x14')],_0x48d74e);_0x4936d6(_0xa17a2a[_0x3271('0x12')](0x1f4,_0xfacc8d['message']));});});}; \ No newline at end of file +var _0xd8f6=['attributes','limit','lodash','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateSmsQueueReport','SmsQueueReport','options','raw','debug','UpdateSmsQueueReport','update','body','where'];(function(_0x321504,_0xfde0ac){var _0xf9f5ac=function(_0x462ed7){while(--_0x462ed7){_0x321504['push'](_0x321504['shift']());}};_0xf9f5ac(++_0xfde0ac);}(_0xd8f6,0x1f2));var _0x6d8f=function(_0x150d37,_0x53de6f){_0x150d37=_0x150d37-0x0;var _0x556363=_0xd8f6[_0x150d37];return _0x556363;};'use strict';var _=require(_0x6d8f('0x0'));var util=require('util');var moment=require(_0x6d8f('0x1'));var BPromise=require(_0x6d8f('0x2'));var rs=require(_0x6d8f('0x3'));var fs=require('fs');var Redis=require(_0x6d8f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6d8f('0x5'));var config=require(_0x6d8f('0x6'));var jayson=require(_0x6d8f('0x7'));var client=jayson[_0x6d8f('0x8')][_0x6d8f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d91a8,_0x4ba5d6,_0x393c59){return new BPromise(function(_0x126b1a,_0x181cc5){return client[_0x6d8f('0xa')](_0x5d91a8,_0x393c59)[_0x6d8f('0xb')](function(_0x7f3ff9){logger[_0x6d8f('0xc')](_0x6d8f('0xd'),_0x4ba5d6,'request\x20sent');logger['debug'](_0x6d8f('0xe'),_0x4ba5d6,_0x6d8f('0xf'),JSON['stringify'](_0x7f3ff9));if(_0x7f3ff9[_0x6d8f('0x10')]){if(_0x7f3ff9[_0x6d8f('0x10')][_0x6d8f('0x11')]===0x1f4){logger[_0x6d8f('0x10')](_0x6d8f('0xd'),_0x4ba5d6,_0x7f3ff9[_0x6d8f('0x10')][_0x6d8f('0x12')]);return _0x181cc5(_0x7f3ff9['error']['message']);}logger[_0x6d8f('0x10')](_0x6d8f('0xd'),_0x4ba5d6,_0x7f3ff9[_0x6d8f('0x10')][_0x6d8f('0x12')]);return _0x126b1a(_0x7f3ff9[_0x6d8f('0x10')][_0x6d8f('0x12')]);}else{logger[_0x6d8f('0xc')](_0x6d8f('0xd'),_0x4ba5d6,_0x6d8f('0xf'));_0x126b1a(_0x7f3ff9['result'][_0x6d8f('0x12')]);}})[_0x6d8f('0x13')](function(_0x441fd1){logger[_0x6d8f('0x10')](_0x6d8f('0xd'),_0x4ba5d6,_0x441fd1);_0x181cc5(_0x441fd1);});});}exports[_0x6d8f('0x14')]=function(_0x28990e){var _0x2a2721=this;return new Promise(function(_0x298a1d,_0x792a19){return db[_0x6d8f('0x15')]['create'](_0x28990e['body'],{'raw':_0x28990e[_0x6d8f('0x16')]?_0x28990e[_0x6d8f('0x16')][_0x6d8f('0x17')]===undefined?!![]:![]:!![]})[_0x6d8f('0xb')](function(_0x1cce2a){logger[_0x6d8f('0xc')](_0x6d8f('0x14'),_0x28990e);logger[_0x6d8f('0x18')](_0x6d8f('0x14'),_0x28990e,JSON['stringify'](_0x1cce2a));_0x298a1d(_0x1cce2a);})[_0x6d8f('0x13')](function(_0x56d917){logger['error']('CreateSmsQueueReport',_0x56d917[_0x6d8f('0x12')],_0x28990e);_0x792a19(_0x2a2721[_0x6d8f('0x10')](0x1f4,_0x56d917[_0x6d8f('0x12')]));});});};exports[_0x6d8f('0x19')]=function(_0x514ba8){var _0xc1b2ab=this;return new Promise(function(_0x5d67f6,_0x3d7b21){return db[_0x6d8f('0x15')][_0x6d8f('0x1a')](_0x514ba8[_0x6d8f('0x1b')],{'raw':_0x514ba8[_0x6d8f('0x16')]?_0x514ba8[_0x6d8f('0x16')][_0x6d8f('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x514ba8[_0x6d8f('0x16')]?_0x514ba8[_0x6d8f('0x16')][_0x6d8f('0x1c')]||null:null,'attributes':_0x514ba8[_0x6d8f('0x16')]?_0x514ba8[_0x6d8f('0x16')][_0x6d8f('0x1d')]||null:null,'limit':_0x514ba8[_0x6d8f('0x16')]?_0x514ba8[_0x6d8f('0x16')][_0x6d8f('0x1e')]||null:null})[_0x6d8f('0xb')](function(_0x290be2){logger[_0x6d8f('0xc')]('UpdateSmsQueueReport',_0x514ba8);logger['debug']('UpdateSmsQueueReport',_0x514ba8,JSON['stringify'](_0x290be2));_0x5d67f6(_0x290be2);})[_0x6d8f('0x13')](function(_0x119e89){logger[_0x6d8f('0x10')](_0x6d8f('0x19'),_0x119e89['message'],_0x514ba8);_0x3d7b21(_0xc1b2ab['error'](0x1f4,_0x119e89['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 6ae9e8e..70690b8 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 _0x9783=['put','/:id','update','delete','destroy','util','connect-timeout','Router','../../components/auth/service','get','isAuthenticated','/describe','describe','show','post','create'];(function(_0x334651,_0x6e99f6){var _0x29657c=function(_0x420a94){while(--_0x420a94){_0x334651['push'](_0x334651['shift']());}};_0x29657c(++_0x6e99f6);}(_0x9783,0x85));var _0x3978=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9783[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x3978('0x0'));var path=require('path');var timeout=require(_0x3978('0x1'));var express=require('express');var router=express[_0x3978('0x2')]();var auth=require(_0x3978('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsTransferReport.controller');router[_0x3978('0x4')]('/',auth[_0x3978('0x5')](),controller['index']);router[_0x3978('0x4')](_0x3978('0x6'),auth[_0x3978('0x5')](),controller[_0x3978('0x7')]);router['get']('/:id',auth[_0x3978('0x5')](),controller[_0x3978('0x8')]);router[_0x3978('0x9')]('/',auth['isAuthenticated'](),controller[_0x3978('0xa')]);router[_0x3978('0xb')](_0x3978('0xc'),auth[_0x3978('0x5')](),controller[_0x3978('0xd')]);router[_0x3978('0xe')]('/:id',auth[_0x3978('0x5')](),controller[_0x3978('0xf')]);module['exports']=router; \ No newline at end of file +var _0xf4f7=['index','/describe','describe','/:id','post','create','put','update','delete','destroy','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x4c6c46,_0x4d5b50){var _0x4eca5e=function(_0x2478b3){while(--_0x2478b3){_0x4c6c46['push'](_0x4c6c46['shift']());}};_0x4eca5e(++_0x4d5b50);}(_0xf4f7,0x1ac));var _0x7f4f=function(_0x569fef,_0x49c37a){_0x569fef=_0x569fef-0x0;var _0x11f20b=_0xf4f7[_0x569fef];return _0x11f20b;};'use strict';var multer=require(_0x7f4f('0x0'));var util=require(_0x7f4f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7f4f('0x2'));var router=express[_0x7f4f('0x3')]();var auth=require(_0x7f4f('0x4'));var interaction=require(_0x7f4f('0x5'));var config=require(_0x7f4f('0x6'));var controller=require('./smsTransferReport.controller');router[_0x7f4f('0x7')]('/',auth[_0x7f4f('0x8')](),controller[_0x7f4f('0x9')]);router[_0x7f4f('0x7')](_0x7f4f('0xa'),auth[_0x7f4f('0x8')](),controller[_0x7f4f('0xb')]);router[_0x7f4f('0x7')](_0x7f4f('0xc'),auth[_0x7f4f('0x8')](),controller['show']);router[_0x7f4f('0xd')]('/',auth[_0x7f4f('0x8')](),controller[_0x7f4f('0xe')]);router[_0x7f4f('0xf')]('/:id',auth[_0x7f4f('0x8')](),controller[_0x7f4f('0x10')]);router[_0x7f4f('0x11')]('/:id',auth[_0x7f4f('0x8')](),controller[_0x7f4f('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index cf994fe..42e9213 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 _0x0ace=['exports','STRING','ENUM','account','agent','queue','moment','sequelize'];(function(_0x4e38bf,_0x1186f7){var _0x31bd13=function(_0x3a0216){while(--_0x3a0216){_0x4e38bf['push'](_0x4e38bf['shift']());}};_0x31bd13(++_0x1186f7);}(_0x0ace,0x15e));var _0xe0ac=function(_0x133e3b,_0x443cd6){_0x133e3b=_0x133e3b-0x0;var _0x199e72=_0x0ace[_0x133e3b];return _0x199e72;};'use strict';var moment=require(_0xe0ac('0x0'));var Sequelize=require(_0xe0ac('0x1'));module[_0xe0ac('0x2')]={'uniqueid':{'type':Sequelize[_0xe0ac('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xe0ac('0x4')](_0xe0ac('0x5'),_0xe0ac('0x6'),_0xe0ac('0x7')),'allowNull':![],'defaultValue':_0xe0ac('0x7')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xe10f=['agent','queue','DATE','NOW','moment','exports','STRING','ENUM'];(function(_0x21d92c,_0x64277c){var _0x2310a9=function(_0x3b8c9c){while(--_0x3b8c9c){_0x21d92c['push'](_0x21d92c['shift']());}};_0x2310a9(++_0x64277c);}(_0xe10f,0x1a4));var _0xfe10=function(_0x298584,_0x5056dc){_0x298584=_0x298584-0x0;var _0x17d06f=_0xe10f[_0x298584];return _0x17d06f;};'use strict';var moment=require(_0xfe10('0x0'));var Sequelize=require('sequelize');module[_0xfe10('0x1')]={'uniqueid':{'type':Sequelize[_0xfe10('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xfe10('0x3')]('account',_0xfe10('0x4'),_0xfe10('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xfe10('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xfe10('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 95f7912..0de39ba 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 _0xed49=['model','query','keys','filters','intersection','attributes','fields','limit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','includeAll','findAll','rows','catch','params','include','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','destroy','then','stack','name','send','index','SmsTransferReport','rawAttributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xed49,0x1ba));var _0x9ed4=function(_0x18c9be,_0x2c3e32){_0x18c9be=_0x18c9be-0x0;var _0x451d84=_0xed49[_0x18c9be];return _0x451d84;};'use strict';var pdf=require(_0x9ed4('0x0'));var emlformat=require(_0x9ed4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9ed4('0x2'));var jsonpatch=require(_0x9ed4('0x3'));var rp=require(_0x9ed4('0x4'));var moment=require('moment');var BPromise=require(_0x9ed4('0x5'));var Mustache=require(_0x9ed4('0x6'));var util=require(_0x9ed4('0x7'));var path=require('path');var sox=require(_0x9ed4('0x8'));var csv=require('to-csv');var ejs=require(_0x9ed4('0x9'));var fs=require('fs');var _=require(_0x9ed4('0xa'));var squel=require('squel');var crypto=require(_0x9ed4('0xb'));var jsforce=require(_0x9ed4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9ed4('0xd'));var querystring=require(_0x9ed4('0xe'));var Papa=require('papaparse');var Redis=require(_0x9ed4('0xf'));var authService=require(_0x9ed4('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x9ed4('0x11'));var logger=require(_0x9ed4('0x12'))('api');var utils=require(_0x9ed4('0x13'));var config=require(_0x9ed4('0x14'));var db=require(_0x9ed4('0x15'))['db'];function respondWithStatusCode(_0x2cd242,_0x5b5e62){_0x5b5e62=_0x5b5e62||0xcc;return function(_0x17e6a0){if(_0x17e6a0){return _0x2cd242[_0x9ed4('0x16')](_0x5b5e62);}return _0x2cd242[_0x9ed4('0x17')](_0x5b5e62)[_0x9ed4('0x18')]();};}function respondWithResult(_0x31e6bf,_0x14eaa7){_0x14eaa7=_0x14eaa7||0xc8;return function(_0x64a0f6){if(_0x64a0f6){return _0x31e6bf[_0x9ed4('0x17')](_0x14eaa7)[_0x9ed4('0x19')](_0x64a0f6);}};}function respondWithFilteredResult(_0xd9ef85,_0x45cfa8){return function(_0x24efe9){if(_0x24efe9){var _0x228a38=_0x24efe9[_0x9ed4('0x1a')],_0x2c1aab=_0x45cfa8['offset'],_0x2d5d4f=_0x45cfa8[_0x9ed4('0x1b')]+_0x45cfa8['limit'],_0x522837;if(_0x2d5d4f>=_0x228a38){_0x2d5d4f=_0x228a38;_0x522837=0xc8;}else{_0x522837=0xce;}_0xd9ef85[_0x9ed4('0x17')](_0x522837);return _0xd9ef85[_0x9ed4('0x1c')]('Content-Range',_0x2c1aab+'-'+_0x2d5d4f+'/'+_0x228a38)['json'](_0x24efe9);}return null;};}function patchUpdates(_0x43d8ec){return function(_0x175714){try{jsonpatch[_0x9ed4('0x1d')](_0x175714,_0x43d8ec,!![]);}catch(_0x5bb412){return BPromise[_0x9ed4('0x1e')](_0x5bb412);}return _0x175714[_0x9ed4('0x1f')]();};}function saveUpdates(_0x548964,_0x53caaf){return function(_0x24c780){if(_0x24c780){return _0x24c780[_0x9ed4('0x20')](_0x548964)['then'](function(_0x293054){return _0x293054;});}return null;};}function removeEntity(_0xd4b49d,_0x66d167){return function(_0x35bcde){if(_0x35bcde){return _0x35bcde[_0x9ed4('0x21')]()[_0x9ed4('0x22')](function(){_0xd4b49d[_0x9ed4('0x17')](0xcc)[_0x9ed4('0x18')]();});}};}function handleEntityNotFound(_0x9e85f4,_0x2fbe06){return function(_0x4903e2){if(!_0x4903e2){_0x9e85f4['sendStatus'](0x194);}return _0x4903e2;};}function handleError(_0x19525e,_0x185b48){_0x185b48=_0x185b48||0x1f4;return function(_0x25f8c0){logger['error'](_0x25f8c0[_0x9ed4('0x23')]);if(_0x25f8c0[_0x9ed4('0x24')]){delete _0x25f8c0['name'];}_0x19525e['status'](_0x185b48)[_0x9ed4('0x25')](_0x25f8c0);};}exports[_0x9ed4('0x26')]=function(_0x434a50,_0x39f86d){var _0x2eabda={},_0x59bd6e={},_0x45d4e8={'count':0x0,'rows':[]};var _0x5ab302=db[_0x9ed4('0x27')][_0x9ed4('0x28')];_0x59bd6e[_0x9ed4('0x29')]=_['keys'](_0x5ab302);_0x59bd6e[_0x9ed4('0x2a')]=_[_0x9ed4('0x2b')](_0x434a50[_0x9ed4('0x2a')]);_0x59bd6e[_0x9ed4('0x2c')]=_[_0x9ed4('0x2d')](_0x59bd6e['model'],_0x59bd6e[_0x9ed4('0x2a')]);_0x2eabda[_0x9ed4('0x2e')]=_[_0x9ed4('0x2d')](_0x59bd6e[_0x9ed4('0x29')],qs[_0x9ed4('0x2f')](_0x434a50[_0x9ed4('0x2a')][_0x9ed4('0x2f')]));_0x2eabda['attributes']=_0x2eabda[_0x9ed4('0x2e')]['length']?_0x2eabda[_0x9ed4('0x2e')]:_0x59bd6e[_0x9ed4('0x29')];if(!_0x434a50[_0x9ed4('0x2a')]['hasOwnProperty']('nolimit')){_0x2eabda[_0x9ed4('0x30')]=qs['limit'](_0x434a50[_0x9ed4('0x2a')][_0x9ed4('0x30')]);_0x2eabda[_0x9ed4('0x1b')]=qs[_0x9ed4('0x1b')](_0x434a50[_0x9ed4('0x2a')]['offset']);}_0x2eabda[_0x9ed4('0x31')]=qs['sort'](_0x434a50[_0x9ed4('0x2a')][_0x9ed4('0x32')]);_0x2eabda[_0x9ed4('0x33')]=qs[_0x9ed4('0x2c')](_[_0x9ed4('0x34')](_0x434a50[_0x9ed4('0x2a')],_0x59bd6e['filters']));if(_0x434a50[_0x9ed4('0x2a')][_0x9ed4('0x35')]){_0x2eabda[_0x9ed4('0x33')]=_[_0x9ed4('0x36')](_0x2eabda[_0x9ed4('0x33')],{'$or':_['map'](_0x5ab302,function(_0x3b6552){if(_0x3b6552[_0x9ed4('0x37')][_0x9ed4('0x38')]!==_0x9ed4('0x39')){var _0x22e719={};_0x22e719[_0x3b6552[_0x9ed4('0x3a')]]={'$like':'%'+_0x434a50['query'][_0x9ed4('0x35')]+'%'};return _0x22e719;}})});}_0x2eabda=_['merge']({},_0x2eabda,_0x434a50['options']);var _0x4c24fe={'where':_0x2eabda[_0x9ed4('0x33')]};return db['SmsTransferReport'][_0x9ed4('0x1a')](_0x4c24fe)[_0x9ed4('0x22')](function(_0x521128){_0x45d4e8[_0x9ed4('0x1a')]=_0x521128;if(_0x434a50['query'][_0x9ed4('0x3b')]){_0x2eabda['include']=[{'all':!![]}];}return db[_0x9ed4('0x27')][_0x9ed4('0x3c')](_0x2eabda);})[_0x9ed4('0x22')](function(_0x4e8809){_0x45d4e8[_0x9ed4('0x3d')]=_0x4e8809;return _0x45d4e8;})[_0x9ed4('0x22')](respondWithFilteredResult(_0x39f86d,_0x2eabda))[_0x9ed4('0x3e')](handleError(_0x39f86d,null));};exports['show']=function(_0x232890,_0xb85fe8){var _0xa6a15={'raw':!![],'where':{'id':_0x232890[_0x9ed4('0x3f')]['id']}},_0x21c1e2={};_0x21c1e2['model']=_[_0x9ed4('0x2b')](db[_0x9ed4('0x27')][_0x9ed4('0x28')]);_0x21c1e2[_0x9ed4('0x2a')]=_[_0x9ed4('0x2b')](_0x232890[_0x9ed4('0x2a')]);_0x21c1e2[_0x9ed4('0x2c')]=_[_0x9ed4('0x2d')](_0x21c1e2[_0x9ed4('0x29')],_0x21c1e2[_0x9ed4('0x2a')]);_0xa6a15[_0x9ed4('0x2e')]=_[_0x9ed4('0x2d')](_0x21c1e2[_0x9ed4('0x29')],qs[_0x9ed4('0x2f')](_0x232890['query']['fields']));_0xa6a15[_0x9ed4('0x2e')]=_0xa6a15[_0x9ed4('0x2e')]['length']?_0xa6a15['attributes']:_0x21c1e2[_0x9ed4('0x29')];if(_0x232890[_0x9ed4('0x2a')][_0x9ed4('0x3b')]){_0xa6a15[_0x9ed4('0x40')]=[{'all':!![]}];}_0xa6a15=_[_0x9ed4('0x36')]({},_0xa6a15,_0x232890['options']);return db[_0x9ed4('0x27')][_0x9ed4('0x41')](_0xa6a15)['then'](handleEntityNotFound(_0xb85fe8,null))[_0x9ed4('0x22')](respondWithResult(_0xb85fe8,null))[_0x9ed4('0x3e')](handleError(_0xb85fe8,null));};exports[_0x9ed4('0x42')]=function(_0x1e75e0,_0x28912b){return db[_0x9ed4('0x27')]['create'](_0x1e75e0['body'],{})[_0x9ed4('0x22')](respondWithResult(_0x28912b,0xc9))[_0x9ed4('0x3e')](handleError(_0x28912b,null));};exports[_0x9ed4('0x20')]=function(_0x1e873b,_0xb18e7a){if(_0x1e873b[_0x9ed4('0x43')]['id']){delete _0x1e873b[_0x9ed4('0x43')]['id'];}return db['SmsTransferReport'][_0x9ed4('0x41')]({'where':{'id':_0x1e873b[_0x9ed4('0x3f')]['id']}})[_0x9ed4('0x22')](handleEntityNotFound(_0xb18e7a,null))[_0x9ed4('0x22')](saveUpdates(_0x1e873b['body'],null))['then'](respondWithResult(_0xb18e7a,null))[_0x9ed4('0x3e')](handleError(_0xb18e7a,null));};exports[_0x9ed4('0x21')]=function(_0x4423d2,_0x46eee1){return db[_0x9ed4('0x27')][_0x9ed4('0x41')]({'where':{'id':_0x4423d2[_0x9ed4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x46eee1,null))[_0x9ed4('0x22')](removeEntity(_0x46eee1,null))[_0x9ed4('0x3e')](handleError(_0x46eee1,null));};exports[_0x9ed4('0x44')]=function(_0x5b9156,_0xcafba0){return db['SmsTransferReport'][_0x9ed4('0x44')]()['then'](respondWithResult(_0xcafba0,null))[_0x9ed4('0x3e')](handleError(_0xcafba0,null));}; \ No newline at end of file +var _0x35f9=['../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','count','offset','limit','set','Content-Range','json','reject','update','then','destroy','sendStatus','error','stack','name','status','send','index','SmsTransferReport','rawAttributes','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','findAll','rows','catch','show','params','length','include','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service'];(function(_0x28cc9f,_0x592828){var _0x191597=function(_0x61fd0c){while(--_0x61fd0c){_0x28cc9f['push'](_0x28cc9f['shift']());}};_0x191597(++_0x592828);}(_0x35f9,0x80));var _0x935f=function(_0x5ba789,_0x2d3b9e){_0x5ba789=_0x5ba789-0x0;var _0x1227b3=_0x35f9[_0x5ba789];return _0x1227b3;};'use strict';var pdf=require(_0x935f('0x0'));var emlformat=require(_0x935f('0x1'));var rimraf=require(_0x935f('0x2'));var zipdir=require(_0x935f('0x3'));var jsonpatch=require(_0x935f('0x4'));var rp=require(_0x935f('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x935f('0x6'));var util=require(_0x935f('0x7'));var path=require(_0x935f('0x8'));var sox=require(_0x935f('0x9'));var csv=require(_0x935f('0xa'));var ejs=require(_0x935f('0xb'));var fs=require('fs');var _=require(_0x935f('0xc'));var squel=require(_0x935f('0xd'));var crypto=require('crypto');var jsforce=require(_0x935f('0xe'));var deskjs=require(_0x935f('0xf'));var toCsv=require(_0x935f('0xa'));var querystring=require(_0x935f('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x935f('0x11'));var qs=require(_0x935f('0x12'));var hardwareService=require(_0x935f('0x13'));var logger=require('../../config/logger')(_0x935f('0x14'));var utils=require(_0x935f('0x15'));var config=require(_0x935f('0x16'));var db=require(_0x935f('0x17'))['db'];function respondWithStatusCode(_0x3b99ac,_0x3d241c){_0x3d241c=_0x3d241c||0xcc;return function(_0x2c8d88){if(_0x2c8d88){return _0x3b99ac['sendStatus'](_0x3d241c);}return _0x3b99ac['status'](_0x3d241c)[_0x935f('0x18')]();};}function respondWithResult(_0x8b6e8,_0xb5af97){_0xb5af97=_0xb5af97||0xc8;return function(_0x211e84){if(_0x211e84){return _0x8b6e8['status'](_0xb5af97)['json'](_0x211e84);}};}function respondWithFilteredResult(_0x2ab1f8,_0x62c5aa){return function(_0x3914a7){if(_0x3914a7){var _0x45a54f=_0x3914a7[_0x935f('0x19')],_0x527d3e=_0x62c5aa[_0x935f('0x1a')],_0x33c782=_0x62c5aa[_0x935f('0x1a')]+_0x62c5aa[_0x935f('0x1b')],_0x46df63;if(_0x33c782>=_0x45a54f){_0x33c782=_0x45a54f;_0x46df63=0xc8;}else{_0x46df63=0xce;}_0x2ab1f8['status'](_0x46df63);return _0x2ab1f8[_0x935f('0x1c')](_0x935f('0x1d'),_0x527d3e+'-'+_0x33c782+'/'+_0x45a54f)[_0x935f('0x1e')](_0x3914a7);}return null;};}function patchUpdates(_0x20a2f1){return function(_0x5f5341){try{jsonpatch['apply'](_0x5f5341,_0x20a2f1,!![]);}catch(_0x2a808b){return BPromise[_0x935f('0x1f')](_0x2a808b);}return _0x5f5341['save']();};}function saveUpdates(_0x50054a,_0x3ce8fa){return function(_0x56d7bd){if(_0x56d7bd){return _0x56d7bd[_0x935f('0x20')](_0x50054a)[_0x935f('0x21')](function(_0x5dc590){return _0x5dc590;});}return null;};}function removeEntity(_0x46db63,_0x21d884){return function(_0x27dc11){if(_0x27dc11){return _0x27dc11[_0x935f('0x22')]()[_0x935f('0x21')](function(){_0x46db63['status'](0xcc)[_0x935f('0x18')]();});}};}function handleEntityNotFound(_0x1b1f8,_0x4bd980){return function(_0x170b50){if(!_0x170b50){_0x1b1f8[_0x935f('0x23')](0x194);}return _0x170b50;};}function handleError(_0x2fda27,_0x3087c2){_0x3087c2=_0x3087c2||0x1f4;return function(_0x2737aa){logger[_0x935f('0x24')](_0x2737aa[_0x935f('0x25')]);if(_0x2737aa['name']){delete _0x2737aa[_0x935f('0x26')];}_0x2fda27[_0x935f('0x27')](_0x3087c2)[_0x935f('0x28')](_0x2737aa);};}exports[_0x935f('0x29')]=function(_0x5ae50d,_0x592a3c){var _0x3611b6={},_0x53d73b={},_0x43c21b={'count':0x0,'rows':[]};var _0x599c72=db[_0x935f('0x2a')][_0x935f('0x2b')];_0x53d73b[_0x935f('0x2c')]=_['keys'](_0x599c72);_0x53d73b[_0x935f('0x2d')]=_['keys'](_0x5ae50d['query']);_0x53d73b[_0x935f('0x2e')]=_['intersection'](_0x53d73b[_0x935f('0x2c')],_0x53d73b[_0x935f('0x2d')]);_0x3611b6[_0x935f('0x2f')]=_[_0x935f('0x30')](_0x53d73b[_0x935f('0x2c')],qs[_0x935f('0x31')](_0x5ae50d['query']['fields']));_0x3611b6[_0x935f('0x2f')]=_0x3611b6[_0x935f('0x2f')]['length']?_0x3611b6[_0x935f('0x2f')]:_0x53d73b[_0x935f('0x2c')];if(!_0x5ae50d[_0x935f('0x2d')][_0x935f('0x32')](_0x935f('0x33'))){_0x3611b6[_0x935f('0x1b')]=qs[_0x935f('0x1b')](_0x5ae50d[_0x935f('0x2d')][_0x935f('0x1b')]);_0x3611b6['offset']=qs[_0x935f('0x1a')](_0x5ae50d[_0x935f('0x2d')][_0x935f('0x1a')]);}_0x3611b6['order']=qs[_0x935f('0x34')](_0x5ae50d[_0x935f('0x2d')][_0x935f('0x34')]);_0x3611b6['where']=qs['filters'](_[_0x935f('0x35')](_0x5ae50d[_0x935f('0x2d')],_0x53d73b[_0x935f('0x2e')]));if(_0x5ae50d['query'][_0x935f('0x36')]){_0x3611b6[_0x935f('0x37')]=_[_0x935f('0x38')](_0x3611b6['where'],{'$or':_[_0x935f('0x39')](_0x599c72,function(_0x183a16){if(_0x183a16[_0x935f('0x3a')][_0x935f('0x3b')]!==_0x935f('0x3c')){var _0x5bb427={};_0x5bb427[_0x183a16[_0x935f('0x3d')]]={'$like':'%'+_0x5ae50d['query'][_0x935f('0x36')]+'%'};return _0x5bb427;}})});}_0x3611b6=_[_0x935f('0x38')]({},_0x3611b6,_0x5ae50d[_0x935f('0x3e')]);var _0x47b782={'where':_0x3611b6[_0x935f('0x37')]};return db[_0x935f('0x2a')][_0x935f('0x19')](_0x47b782)['then'](function(_0x32e57a){_0x43c21b[_0x935f('0x19')]=_0x32e57a;if(_0x5ae50d[_0x935f('0x2d')]['includeAll']){_0x3611b6['include']=[{'all':!![]}];}return db[_0x935f('0x2a')][_0x935f('0x3f')](_0x3611b6);})['then'](function(_0x121307){_0x43c21b[_0x935f('0x40')]=_0x121307;return _0x43c21b;})['then'](respondWithFilteredResult(_0x592a3c,_0x3611b6))[_0x935f('0x41')](handleError(_0x592a3c,null));};exports[_0x935f('0x42')]=function(_0x13e3f0,_0x1cf8df){var _0x372ea2={'raw':!![],'where':{'id':_0x13e3f0[_0x935f('0x43')]['id']}},_0x464ffc={};_0x464ffc[_0x935f('0x2c')]=_['keys'](db['SmsTransferReport'][_0x935f('0x2b')]);_0x464ffc[_0x935f('0x2d')]=_['keys'](_0x13e3f0['query']);_0x464ffc['filters']=_[_0x935f('0x30')](_0x464ffc[_0x935f('0x2c')],_0x464ffc[_0x935f('0x2d')]);_0x372ea2[_0x935f('0x2f')]=_['intersection'](_0x464ffc[_0x935f('0x2c')],qs[_0x935f('0x31')](_0x13e3f0[_0x935f('0x2d')][_0x935f('0x31')]));_0x372ea2['attributes']=_0x372ea2[_0x935f('0x2f')][_0x935f('0x44')]?_0x372ea2['attributes']:_0x464ffc[_0x935f('0x2c')];if(_0x13e3f0[_0x935f('0x2d')]['includeAll']){_0x372ea2[_0x935f('0x45')]=[{'all':!![]}];}_0x372ea2=_[_0x935f('0x38')]({},_0x372ea2,_0x13e3f0[_0x935f('0x3e')]);return db[_0x935f('0x2a')]['find'](_0x372ea2)['then'](handleEntityNotFound(_0x1cf8df,null))[_0x935f('0x21')](respondWithResult(_0x1cf8df,null))['catch'](handleError(_0x1cf8df,null));};exports['create']=function(_0x25f48f,_0x1192fd){return db[_0x935f('0x2a')]['create'](_0x25f48f[_0x935f('0x46')],{})[_0x935f('0x21')](respondWithResult(_0x1192fd,0xc9))[_0x935f('0x41')](handleError(_0x1192fd,null));};exports[_0x935f('0x20')]=function(_0x126ace,_0x5cf830){if(_0x126ace[_0x935f('0x46')]['id']){delete _0x126ace['body']['id'];}return db[_0x935f('0x2a')][_0x935f('0x47')]({'where':{'id':_0x126ace[_0x935f('0x43')]['id']}})[_0x935f('0x21')](handleEntityNotFound(_0x5cf830,null))['then'](saveUpdates(_0x126ace[_0x935f('0x46')],null))['then'](respondWithResult(_0x5cf830,null))['catch'](handleError(_0x5cf830,null));};exports[_0x935f('0x22')]=function(_0x3cb92,_0x24b51f){return db[_0x935f('0x2a')][_0x935f('0x47')]({'where':{'id':_0x3cb92['params']['id']}})[_0x935f('0x21')](handleEntityNotFound(_0x24b51f,null))[_0x935f('0x21')](removeEntity(_0x24b51f,null))[_0x935f('0x41')](handleError(_0x24b51f,null));};exports[_0x935f('0x48')]=function(_0x4decad,_0x13c4dd){return db[_0x935f('0x2a')][_0x935f('0x48')]()[_0x935f('0x21')](respondWithResult(_0x13c4dd,null))[_0x935f('0x41')](handleError(_0x13c4dd,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 3906bba..7bb46f4 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 _0x6b6b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash'];(function(_0x2ba23c,_0x4eb582){var _0x3add9f=function(_0x5076f9){while(--_0x5076f9){_0x2ba23c['push'](_0x2ba23c['shift']());}};_0x3add9f(++_0x4eb582);}(_0x6b6b,0xb5));var _0xb6b6=function(_0x3eeeec,_0x12531a){_0x3eeeec=_0x3eeeec-0x0;var _0x1d0215=_0x6b6b[_0x3eeeec];return _0x1d0215;};'use strict';var _=require(_0xb6b6('0x0'));var util=require('util');var logger=require(_0xb6b6('0x1'))(_0xb6b6('0x2'));var moment=require(_0xb6b6('0x3'));var BPromise=require(_0xb6b6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb6b6('0x5'));var rimraf=require(_0xb6b6('0x6'));var config=require(_0xb6b6('0x7'));var attributes=require(_0xb6b6('0x8'));module[_0xb6b6('0x9')]=function(_0x4e1cdd,_0x4353a0){return _0x4e1cdd[_0xb6b6('0xa')](_0xb6b6('0xb'),attributes,{'tableName':_0xb6b6('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb6b6('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3ae0=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x567b5a,_0x5222ce){var _0xa68d37=function(_0xba822){while(--_0xba822){_0x567b5a['push'](_0x567b5a['shift']());}};_0xa68d37(++_0x5222ce);}(_0x3ae0,0xbf));var _0x03ae=function(_0x200029,_0x584d71){_0x200029=_0x200029-0x0;var _0x4d9579=_0x3ae0[_0x200029];return _0x4d9579;};'use strict';var _=require(_0x03ae('0x0'));var util=require(_0x03ae('0x1'));var logger=require(_0x03ae('0x2'))(_0x03ae('0x3'));var moment=require(_0x03ae('0x4'));var BPromise=require(_0x03ae('0x5'));var rp=require(_0x03ae('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x03ae('0x7'));var config=require(_0x03ae('0x8'));var attributes=require('./smsTransferReport.attributes');module[_0x03ae('0x9')]=function(_0x17abf0,_0x4ad5a9){return _0x17abf0[_0x03ae('0xa')]('SmsTransferReport',attributes,{'tableName':_0x03ae('0xb'),'paranoid':![],'indexes':[{'name':_0x03ae('0xc'),'fields':[_0x03ae('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 5657399..5f00fb2 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 _0x61f1=['jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x1c6526,_0x504d90){var _0x3e5124=function(_0x4de731){while(--_0x4de731){_0x1c6526['push'](_0x1c6526['shift']());}};_0x3e5124(++_0x504d90);}(_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')]('SmsTransferReport,\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);});});} \ No newline at end of file +var _0xed5c=['client','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x296809,_0x1c9665){var _0x18c0d3=function(_0x249156){while(--_0x249156){_0x296809['push'](_0x296809['shift']());}};_0x18c0d3(++_0x1c9665);}(_0xed5c,0x81));var _0xced5=function(_0xd3c93d,_0xf7dd71){_0xd3c93d=_0xd3c93d-0x0;var _0x3924c3=_0xed5c[_0xd3c93d];return _0x3924c3;};'use strict';var _=require(_0xced5('0x0'));var util=require(_0xced5('0x1'));var moment=require(_0xced5('0x2'));var BPromise=require(_0xced5('0x3'));var rs=require(_0xced5('0x4'));var fs=require('fs');var Redis=require(_0xced5('0x5'));var db=require(_0xced5('0x6'))['db'];var utils=require(_0xced5('0x7'));var logger=require(_0xced5('0x8'))(_0xced5('0x9'));var config=require('../../config/environment');var jayson=require(_0xced5('0xa'));var client=jayson[_0xced5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c59d1,_0x31a495,_0xc738da){return new BPromise(function(_0x2857d8,_0x2113e4){return client[_0xced5('0xc')](_0x5c59d1,_0xc738da)['then'](function(_0x50d620){logger[_0xced5('0xd')](_0xced5('0xe'),_0x31a495,_0xced5('0xf'));logger[_0xced5('0x10')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x31a495,_0xced5('0xf'),JSON['stringify'](_0x50d620));if(_0x50d620[_0xced5('0x11')]){if(_0x50d620[_0xced5('0x11')]['code']===0x1f4){logger[_0xced5('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x31a495,_0x50d620[_0xced5('0x11')][_0xced5('0x12')]);return _0x2113e4(_0x50d620[_0xced5('0x11')][_0xced5('0x12')]);}logger[_0xced5('0x11')](_0xced5('0xe'),_0x31a495,_0x50d620[_0xced5('0x11')]['message']);return _0x2857d8(_0x50d620['error'][_0xced5('0x12')]);}else{logger[_0xced5('0xd')](_0xced5('0xe'),_0x31a495,'request\x20sent');_0x2857d8(_0x50d620['result'][_0xced5('0x12')]);}})[_0xced5('0x13')](function(_0x3e1dfc){logger[_0xced5('0x11')](_0xced5('0xe'),_0x31a495,_0x3e1dfc);_0x2113e4(_0x3e1dfc);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 20a8e7f..3f8c796 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 _0xb290=['download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','file','create','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0xd839e7,_0x4209e9){var _0xc3cf23=function(_0x16ace2){while(--_0x16ace2){_0xd839e7['push'](_0xd839e7['shift']());}};_0xc3cf23(++_0x4209e9);}(_0xb290,0xb7));var _0x0b29=function(_0x42749b,_0x16a7ba){_0x42749b=_0x42749b-0x0;var _0x19db46=_0xb290[_0x42749b];return _0x19db46;};'use strict';var multer=require(_0x0b29('0x0'));var util=require(_0x0b29('0x1'));var path=require(_0x0b29('0x2'));var timeout=require(_0x0b29('0x3'));var express=require(_0x0b29('0x4'));var router=express[_0x0b29('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x0b29('0x6'));var config=require(_0x0b29('0x7'));var controller=require(_0x0b29('0x8'));router[_0x0b29('0x9')]('/',auth[_0x0b29('0xa')](),controller[_0x0b29('0xb')]);router[_0x0b29('0x9')](_0x0b29('0xc'),auth[_0x0b29('0xa')](),controller[_0x0b29('0xd')]);router[_0x0b29('0x9')](_0x0b29('0xe'),auth[_0x0b29('0xa')](),controller[_0x0b29('0xf')]);var upload=multer({'storage':multer[_0x0b29('0x10')]({'destination':function(_0xdda2a3,_0x22b24f,_0x4f4abd){_0x4f4abd(null,path[_0x0b29('0x11')](config[_0x0b29('0x12')],_0x0b29('0x13')));},'filename':function(_0x160422,_0x1ff879,_0x39e72d){_0x1ff879[_0x0b29('0x14')]=_0x1ff879['originalname'][_0x0b29('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x39e72d(null,util[_0x0b29('0x16')](_0x0b29('0x17'),path[_0x0b29('0x18')](_0x1ff879[_0x0b29('0x14')],path[_0x0b29('0x19')](_0x1ff879['originalname'])),Date[_0x0b29('0x1a')](),path[_0x0b29('0x19')](_0x1ff879[_0x0b29('0x14')])));}})});router[_0x0b29('0x1b')]('/',upload['single'](_0x0b29('0x1c')),controller[_0x0b29('0x1d')]);router[_0x0b29('0x1e')](_0x0b29('0xc'),auth[_0x0b29('0xa')](),controller[_0x0b29('0x1f')]);router[_0x0b29('0x20')](_0x0b29('0xc'),auth[_0x0b29('0xa')](),controller[_0x0b29('0x20')]);module['exports']=router; \ No newline at end of file +var _0x1c6f=['Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','extname','post','single','file','create','put','delete','exports','multer','util','path','connect-timeout'];(function(_0x2e8775,_0x310049){var _0x4cbf35=function(_0x103483){while(--_0x103483){_0x2e8775['push'](_0x2e8775['shift']());}};_0x4cbf35(++_0x310049);}(_0x1c6f,0xe4));var _0xf1c6=function(_0x386cdd,_0x5706b1){_0x386cdd=_0x386cdd-0x0;var _0x4ebc51=_0x1c6f[_0x386cdd];return _0x4ebc51;};'use strict';var multer=require(_0xf1c6('0x0'));var util=require(_0xf1c6('0x1'));var path=require(_0xf1c6('0x2'));var timeout=require(_0xf1c6('0x3'));var express=require('express');var router=express[_0xf1c6('0x4')]();var auth=require(_0xf1c6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf1c6('0x6'));var controller=require('./sound.controller');router[_0xf1c6('0x7')]('/',auth[_0xf1c6('0x8')](),controller[_0xf1c6('0x9')]);router[_0xf1c6('0x7')](_0xf1c6('0xa'),auth[_0xf1c6('0x8')](),controller[_0xf1c6('0xb')]);router[_0xf1c6('0x7')](_0xf1c6('0xc'),auth['isAuthenticated'](),controller[_0xf1c6('0xd')]);var upload=multer({'storage':multer[_0xf1c6('0xe')]({'destination':function(_0x41688e,_0x41e0da,_0x3b6198){_0x3b6198(null,path[_0xf1c6('0xf')](config[_0xf1c6('0x10')],'server/files/sounds/original/'));},'filename':function(_0x5c3b35,_0xb77f26,_0x305403){_0xb77f26[_0xf1c6('0x11')]=_0xb77f26[_0xf1c6('0x11')][_0xf1c6('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x305403(null,util[_0xf1c6('0x13')](_0xf1c6('0x14'),path['basename'](_0xb77f26['originalname'],path[_0xf1c6('0x15')](_0xb77f26[_0xf1c6('0x11')])),Date['now'](),path['extname'](_0xb77f26[_0xf1c6('0x11')])));}})});router[_0xf1c6('0x16')]('/',upload[_0xf1c6('0x17')](_0xf1c6('0x18')),controller[_0xf1c6('0x19')]);router[_0xf1c6('0x1a')](_0xf1c6('0xa'),auth[_0xf1c6('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf1c6('0x1b')]);module[_0xf1c6('0x1c')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 4f054cf..33df157 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 _0x40ce=['name','FLOAT','INTEGER','BIGINT','sequelize','exports','STRING'];(function(_0x548323,_0x3f14c7){var _0xf55660=function(_0x2dd15e){while(--_0x2dd15e){_0x548323['push'](_0x548323['shift']());}};_0xf55660(++_0x3f14c7);}(_0x40ce,0x146));var _0xe40c=function(_0x35de26,_0x560533){_0x35de26=_0x35de26-0x0;var _0x5b7ca0=_0x40ce[_0x35de26];return _0x5b7ca0;};'use strict';var Sequelize=require(_0xe40c('0x0'));module[_0xe40c('0x1')]={'name':{'type':Sequelize[_0xe40c('0x2')],'unique':_0xe40c('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xe40c('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xe40c('0x2')]},'original_format':{'type':Sequelize[_0xe40c('0x2')]},'original_duration':{'type':Sequelize[_0xe40c('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xe40c('0x5')]},'original_bitRate':{'type':Sequelize[_0xe40c('0x6')]},'original_sampleRate':{'type':Sequelize[_0xe40c('0x5')]},'converted_format':{'type':Sequelize[_0xe40c('0x2')]},'converted_duration':{'type':Sequelize[_0xe40c('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xe40c('0x6')]},'converted_channelCount':{'type':Sequelize[_0xe40c('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x9d55=['name','STRING','BIGINT','INTEGER','exports'];(function(_0x2ae04f,_0x56a7cc){var _0x56485f=function(_0x5044d3){while(--_0x5044d3){_0x2ae04f['push'](_0x2ae04f['shift']());}};_0x56485f(++_0x56a7cc);}(_0x9d55,0x158));var _0x59d5=function(_0x5f336e,_0x40f8b4){_0x5f336e=_0x5f336e-0x0;var _0x473546=_0x9d55[_0x5f336e];return _0x473546;};'use strict';var Sequelize=require('sequelize');module[_0x59d5('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x59d5('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x59d5('0x2')]},'display_name':{'type':Sequelize[_0x59d5('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x59d5('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x59d5('0x3')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x59d5('0x3')]},'original_sampleRate':{'type':Sequelize[_0x59d5('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x59d5('0x3')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x59d5('0x3')]},'converted_sampleRate':{'type':Sequelize[_0x59d5('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index b35f3e3..f0f84e7 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 _0x7fe4=['sendStatus','status','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','end','error','stack','name','send','index','Sound','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','extname','filename','substring','wav','info','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','converted_duration','converted_channelCount','converted_sampleRate','body','role','userProfileId','user','UserProfileSection','autoAssociation','start','description','delete','server/files/sounds/original','original_format','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x2e000e,_0x527df8){var _0x1503cd=function(_0x2279f7){while(--_0x2279f7){_0x2e000e['push'](_0x2e000e['shift']());}};_0x1503cd(++_0x527df8);}(_0x7fe4,0xdf));var _0x47fe=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x7fe4[_0x40220a];return _0x3903cc;};'use strict';var pdf=require(_0x47fe('0x0'));var emlformat=require(_0x47fe('0x1'));var rimraf=require(_0x47fe('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47fe('0x3'));var rp=require(_0x47fe('0x4'));var moment=require(_0x47fe('0x5'));var BPromise=require(_0x47fe('0x6'));var Mustache=require(_0x47fe('0x7'));var util=require(_0x47fe('0x8'));var path=require(_0x47fe('0x9'));var sox=require('sox');var csv=require(_0x47fe('0xa'));var ejs=require(_0x47fe('0xb'));var fs=require('fs');var _=require(_0x47fe('0xc'));var squel=require(_0x47fe('0xd'));var crypto=require(_0x47fe('0xe'));var jsforce=require(_0x47fe('0xf'));var deskjs=require(_0x47fe('0x10'));var toCsv=require(_0x47fe('0xa'));var querystring=require(_0x47fe('0x11'));var Papa=require('papaparse');var Redis=require(_0x47fe('0x12'));var authService=require(_0x47fe('0x13'));var qs=require(_0x47fe('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x47fe('0x15'))(_0x47fe('0x16'));var utils=require('../../config/utils');var config=require(_0x47fe('0x17'));var db=require(_0x47fe('0x18'))['db'];function respondWithStatusCode(_0x4e0696,_0x1cd05c){_0x1cd05c=_0x1cd05c||0xcc;return function(_0x2ae56e){if(_0x2ae56e){return _0x4e0696[_0x47fe('0x19')](_0x1cd05c);}return _0x4e0696[_0x47fe('0x1a')](_0x1cd05c)['end']();};}function respondWithResult(_0x444fc4,_0x1e1b76){_0x1e1b76=_0x1e1b76||0xc8;return function(_0x230e6c){if(_0x230e6c){return _0x444fc4[_0x47fe('0x1a')](_0x1e1b76)['json'](_0x230e6c);}};}function respondWithFilteredResult(_0x30e070,_0x3d4e77){return function(_0x42a68c){if(_0x42a68c){var _0x1644a5=_0x42a68c[_0x47fe('0x1b')],_0x54ff88=_0x3d4e77[_0x47fe('0x1c')],_0x176e1b=_0x3d4e77[_0x47fe('0x1c')]+_0x3d4e77['limit'],_0x2af445;if(_0x176e1b>=_0x1644a5){_0x176e1b=_0x1644a5;_0x2af445=0xc8;}else{_0x2af445=0xce;}_0x30e070['status'](_0x2af445);return _0x30e070['set'](_0x47fe('0x1d'),_0x54ff88+'-'+_0x176e1b+'/'+_0x1644a5)[_0x47fe('0x1e')](_0x42a68c);}return null;};}function patchUpdates(_0x253fd5){return function(_0x3b2d7f){try{jsonpatch[_0x47fe('0x1f')](_0x3b2d7f,_0x253fd5,!![]);}catch(_0x11ed31){return BPromise[_0x47fe('0x20')](_0x11ed31);}return _0x3b2d7f[_0x47fe('0x21')]();};}function saveUpdates(_0x2a8d5c,_0x3e201b){return function(_0x16d2be){if(_0x16d2be){return _0x16d2be[_0x47fe('0x22')](_0x2a8d5c)[_0x47fe('0x23')](function(_0x450896){return _0x450896;});}return null;};}function removeEntity(_0x39ea68,_0x438356){return function(_0x262256){if(_0x262256){return _0x262256[_0x47fe('0x24')]()[_0x47fe('0x23')](function(){var _0x106ec1=_0x262256[_0x47fe('0x25')]({'plain':!![]});var _0x38677d=_0x47fe('0x26');return db[_0x47fe('0x27')][_0x47fe('0x24')]({'where':{'type':_0x38677d,'resourceId':_0x106ec1['id']}})[_0x47fe('0x23')](function(){return _0x262256;});})[_0x47fe('0x23')](function(){_0x39ea68['status'](0xcc)[_0x47fe('0x28')]();});}};}function handleEntityNotFound(_0x5b0c4b,_0x24c3df){return function(_0x377a53){if(!_0x377a53){_0x5b0c4b['sendStatus'](0x194);}return _0x377a53;};}function handleError(_0x1002c7,_0x5457d4){_0x5457d4=_0x5457d4||0x1f4;return function(_0x4b9257){logger[_0x47fe('0x29')](_0x4b9257[_0x47fe('0x2a')]);if(_0x4b9257[_0x47fe('0x2b')]){delete _0x4b9257[_0x47fe('0x2b')];}_0x1002c7['status'](_0x5457d4)[_0x47fe('0x2c')](_0x4b9257);};}exports[_0x47fe('0x2d')]=function(_0x5ab71c,_0x2427b9){var _0x3a7eb8={},_0x3f702b={},_0x518b86={'count':0x0,'rows':[]};var _0x418780=db[_0x47fe('0x2e')]['rawAttributes'];_0x3f702b[_0x47fe('0x2f')]=_[_0x47fe('0x30')](_0x418780);_0x3f702b[_0x47fe('0x31')]=_[_0x47fe('0x30')](_0x5ab71c['query']);_0x3f702b[_0x47fe('0x32')]=_['intersection'](_0x3f702b['model'],_0x3f702b[_0x47fe('0x31')]);_0x3a7eb8[_0x47fe('0x33')]=_[_0x47fe('0x34')](_0x3f702b[_0x47fe('0x2f')],qs[_0x47fe('0x35')](_0x5ab71c['query']['fields']));_0x3a7eb8['attributes']=_0x3a7eb8[_0x47fe('0x33')][_0x47fe('0x36')]?_0x3a7eb8[_0x47fe('0x33')]:_0x3f702b[_0x47fe('0x2f')];if(!_0x5ab71c['query'][_0x47fe('0x37')](_0x47fe('0x38'))){_0x3a7eb8[_0x47fe('0x39')]=qs['limit'](_0x5ab71c[_0x47fe('0x31')][_0x47fe('0x39')]);_0x3a7eb8[_0x47fe('0x1c')]=qs[_0x47fe('0x1c')](_0x5ab71c[_0x47fe('0x31')]['offset']);}_0x3a7eb8[_0x47fe('0x3a')]=qs[_0x47fe('0x3b')](_0x5ab71c[_0x47fe('0x31')][_0x47fe('0x3b')]);_0x3a7eb8[_0x47fe('0x3c')]=qs['filters'](_[_0x47fe('0x3d')](_0x5ab71c['query'],_0x3f702b[_0x47fe('0x32')]));if(_0x5ab71c[_0x47fe('0x31')][_0x47fe('0x3e')]){_0x3a7eb8[_0x47fe('0x3c')]=_[_0x47fe('0x3f')](_0x3a7eb8['where'],{'$or':_[_0x47fe('0x40')](_0x418780,function(_0x18d74e){if(_0x18d74e[_0x47fe('0x41')]['key']!==_0x47fe('0x42')){var _0x2b46ee={};_0x2b46ee[_0x18d74e[_0x47fe('0x43')]]={'$like':'%'+_0x5ab71c[_0x47fe('0x31')]['filter']+'%'};return _0x2b46ee;}})});}_0x3a7eb8=_[_0x47fe('0x3f')]({},_0x3a7eb8,_0x5ab71c[_0x47fe('0x44')]);var _0x14beac={'where':_0x3a7eb8[_0x47fe('0x3c')]};return db[_0x47fe('0x2e')][_0x47fe('0x1b')](_0x14beac)['then'](function(_0x52763f){_0x518b86['count']=_0x52763f;if(_0x5ab71c[_0x47fe('0x31')][_0x47fe('0x45')]){_0x3a7eb8[_0x47fe('0x46')]=[{'all':!![]}];}return db['Sound'][_0x47fe('0x47')](_0x3a7eb8);})['then'](function(_0x438efb){_0x518b86[_0x47fe('0x48')]=_0x438efb;return _0x518b86;})[_0x47fe('0x23')](respondWithFilteredResult(_0x2427b9,_0x3a7eb8))[_0x47fe('0x49')](handleError(_0x2427b9,null));};exports[_0x47fe('0x4a')]=function(_0x18d07a,_0x2e324e){var _0x207ebd={'raw':!![],'where':{'id':_0x18d07a[_0x47fe('0x4b')]['id']}},_0x23a499={};_0x23a499[_0x47fe('0x2f')]=_[_0x47fe('0x30')](db[_0x47fe('0x2e')][_0x47fe('0x4c')]);_0x23a499['query']=_[_0x47fe('0x30')](_0x18d07a[_0x47fe('0x31')]);_0x23a499[_0x47fe('0x32')]=_[_0x47fe('0x34')](_0x23a499[_0x47fe('0x2f')],_0x23a499[_0x47fe('0x31')]);_0x207ebd[_0x47fe('0x33')]=_[_0x47fe('0x34')](_0x23a499[_0x47fe('0x2f')],qs['fields'](_0x18d07a[_0x47fe('0x31')]['fields']));_0x207ebd[_0x47fe('0x33')]=_0x207ebd[_0x47fe('0x33')][_0x47fe('0x36')]?_0x207ebd['attributes']:_0x23a499[_0x47fe('0x2f')];if(_0x18d07a[_0x47fe('0x31')]['includeAll']){_0x207ebd[_0x47fe('0x46')]=[{'all':!![]}];}_0x207ebd=_[_0x47fe('0x3f')]({},_0x207ebd,_0x18d07a[_0x47fe('0x44')]);return db[_0x47fe('0x2e')][_0x47fe('0x4d')](_0x207ebd)[_0x47fe('0x23')](handleEntityNotFound(_0x2e324e,null))[_0x47fe('0x23')](respondWithResult(_0x2e324e,null))['catch'](handleError(_0x2e324e,null));};exports[_0x47fe('0x4e')]=function(_0x15baba,_0xa94650,_0x3bd514){return db[_0x47fe('0x2e')][_0x47fe('0x4d')]({'where':{'id':_0x15baba['params']['id']},'attributes':['name',_0x47fe('0x4f'),_0x47fe('0x50')],'raw':!![]})[_0x47fe('0x23')](handleEntityNotFound(_0xa94650,null))[_0x47fe('0x23')](function(_0x2a8616){if(_0x2a8616){if(!fs[_0x47fe('0x51')](path[_0x47fe('0x52')](config[_0x47fe('0x53')],_0x47fe('0x54'),_0x2a8616[_0x47fe('0x4f')]+'.'+_0x2a8616['converted_format']))){throw new db['Sequelize'][(_0x47fe('0x55'))](_0x47fe('0x56'));}return _0xa94650[_0x47fe('0x4e')](path[_0x47fe('0x52')](config[_0x47fe('0x53')],'server/files/sounds/converted',util[_0x47fe('0x57')]('%s.%s',_0x2a8616['save_name'],_0x2a8616[_0x47fe('0x50')])),util[_0x47fe('0x57')](_0x47fe('0x58'),_0x2a8616[_0x47fe('0x2b')],_0x2a8616[_0x47fe('0x50')]));}return null;})[_0x47fe('0x49')](handleError(_0xa94650,null));};exports[_0x47fe('0x59')]=function(_0x2101ef,_0x139064,_0x17cd2f){var _0x2d4f27={'name':path[_0x47fe('0x5a')](_0x2101ef[_0x47fe('0x5b')]['originalname'],path[_0x47fe('0x5c')](_0x2101ef[_0x47fe('0x5b')]['originalname'])),'save_name':path[_0x47fe('0x5a')](_0x2101ef[_0x47fe('0x5b')]['filename'],path['extname'](_0x2101ef[_0x47fe('0x5b')][_0x47fe('0x5d')])),'original_format':path[_0x47fe('0x5c')](_0x2101ef[_0x47fe('0x5b')]['originalname'])[_0x47fe('0x5e')](0x1),'converted_format':_0x47fe('0x5f')};var _0x495f1f=path[_0x47fe('0x52')](config[_0x47fe('0x53')],'server/files/sounds/original',_0x2101ef[_0x47fe('0x5b')]['filename']);var _0x10672a=path[_0x47fe('0x52')](config[_0x47fe('0x53')],'server/files/sounds/converted',util[_0x47fe('0x57')](_0x47fe('0x58'),path[_0x47fe('0x5a')](_0x2101ef[_0x47fe('0x5b')][_0x47fe('0x5d')],path[_0x47fe('0x5c')](_0x2101ef['file'][_0x47fe('0x5d')])),_0x2d4f27[_0x47fe('0x50')]));logger[_0x47fe('0x60')]('Sound\x20upload\x20filepath:\x20%s',_0x495f1f);logger[_0x47fe('0x60')]('Sound\x20upload\x20destination:\x20%s',_0x10672a);try{fs[_0x47fe('0x61')](_0x495f1f,parseInt(_0x47fe('0x62'),0x8));var _0x13ea59=sox[_0x47fe('0x63')](_0x495f1f,_0x10672a,{'sampleRate':0x1f40,'format':_0x47fe('0x5f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x13ea59['on'](_0x47fe('0x29'),function(_0x254bfb){fs[_0x47fe('0x64')](_0x495f1f);_0x139064['status'](0x1f4)[_0x47fe('0x2c')](_0x254bfb);});_0x13ea59['on'](_0x47fe('0x65'),function(_0x5e0aa0){_0x2d4f27[_0x47fe('0x66')]=isNaN(_0x5e0aa0[_0x47fe('0x67')])?null:_0x5e0aa0['duration']*0x3e8;_0x2d4f27[_0x47fe('0x68')]=isNaN(_0x5e0aa0['sampleCount'])?null:_0x5e0aa0[_0x47fe('0x69')];_0x2d4f27['original_channelCount']=isNaN(_0x5e0aa0['channelCount'])?null:_0x5e0aa0[_0x47fe('0x6a')];_0x2d4f27[_0x47fe('0x6b')]=isNaN(_0x5e0aa0[_0x47fe('0x6c')])?null:_0x5e0aa0[_0x47fe('0x6c')];_0x2d4f27[_0x47fe('0x6d')]=isNaN(_0x5e0aa0['sampleRate'])?null:_0x5e0aa0['sampleRate'];});_0x13ea59['on']('dest',function(_0x195a1f){_0x2d4f27[_0x47fe('0x6e')]=isNaN(_0x195a1f[_0x47fe('0x67')])?null:_0x195a1f[_0x47fe('0x67')]*0x3e8;_0x2d4f27['converted_sampleCount']=isNaN(_0x195a1f[_0x47fe('0x69')])?null:_0x195a1f['sampleCount'];_0x2d4f27[_0x47fe('0x6f')]=isNaN(_0x195a1f[_0x47fe('0x6a')])?null:_0x195a1f[_0x47fe('0x6a')];_0x2d4f27['converted_bitRate']=isNaN(_0x195a1f[_0x47fe('0x6c')])?null:_0x195a1f['bitRate'];_0x2d4f27[_0x47fe('0x70')]=isNaN(_0x195a1f['sampleRate'])?null:_0x195a1f['sampleRate'];});_0x13ea59['on'](_0x47fe('0x28'),function(){fs[_0x47fe('0x61')](_0x10672a,parseInt(_0x47fe('0x62'),0x8));return db['Sound'][_0x47fe('0x59')](_0x2d4f27)['then'](function(_0x5af410){var _0x5ae7d8={'role':_0x2101ef[_0x47fe('0x71')][_0x47fe('0x72')],'userProfileId':_0x2101ef[_0x47fe('0x71')][_0x47fe('0x73')]};if(!_0x5ae7d8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ae7d8[_0x47fe('0x72')]===_0x47fe('0x74')){var _0x3e529e=_0x5af410[_0x47fe('0x25')]({'plain':!![]});return db[_0x47fe('0x75')][_0x47fe('0x4d')]({'where':{'name':_0x47fe('0x26'),'userProfileId':_0x5ae7d8[_0x47fe('0x73')]},'raw':!![]})[_0x47fe('0x23')](function(_0x2cc7d4){if(_0x2cc7d4&&_0x2cc7d4[_0x47fe('0x76')]===0x0){return db[_0x47fe('0x27')][_0x47fe('0x59')]({'name':_0x3e529e[_0x47fe('0x2b')],'resourceId':_0x3e529e['id'],'type':_0x2cc7d4[_0x47fe('0x2b')],'sectionId':_0x2cc7d4['id']},{})['then'](function(){return _0x5af410;});}else{return _0x5af410;}})[_0x47fe('0x49')](function(_0x5c62bc){logger[_0x47fe('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c62bc);throw _0x5c62bc;});}return _0x5af410;})[_0x47fe('0x23')](respondWithResult(_0x139064,null))[_0x47fe('0x49')](handleError(_0x139064,null));});_0x13ea59[_0x47fe('0x77')]();}catch(_0x2f2791){_0x139064[_0x47fe('0x1a')](0x1f4)[_0x47fe('0x2c')](_0x2f2791);}};exports[_0x47fe('0x22')]=function(_0x4adf0b,_0xabf109,_0x2ca1b1){return db[_0x47fe('0x2e')][_0x47fe('0x4d')]({'where':{'id':_0x4adf0b[_0x47fe('0x4b')]['id']}})['then'](handleEntityNotFound(_0xabf109,null))[_0x47fe('0x23')](saveUpdates(_[_0x47fe('0x3d')](_0x4adf0b[_0x47fe('0x71')],[_0x47fe('0x2b'),_0x47fe('0x78')]),null))[_0x47fe('0x23')](respondWithResult(_0xabf109,null))[_0x47fe('0x49')](handleError(_0xabf109,null));};exports[_0x47fe('0x79')]=function(_0x5d2749,_0x4a392f,_0x169e1b){return db[_0x47fe('0x2e')][_0x47fe('0x4d')]({'where':{'id':_0x5d2749[_0x47fe('0x4b')]['id']}})['then'](function(_0x394adb){if(_0x394adb){return _0x394adb[_0x47fe('0x24')]();}})[_0x47fe('0x23')](function(_0x463bbc){var _0x43a91f=path[_0x47fe('0x52')](config[_0x47fe('0x53')],_0x47fe('0x7a'),util[_0x47fe('0x57')](_0x47fe('0x58'),_0x463bbc['save_name'],_0x463bbc[_0x47fe('0x7b')]));var _0xf8b1c9=path[_0x47fe('0x52')](config[_0x47fe('0x53')],'server/files/sounds/converted',util[_0x47fe('0x57')](_0x47fe('0x58'),_0x463bbc[_0x47fe('0x4f')],_0x463bbc[_0x47fe('0x50')]));fs[_0x47fe('0x64')](_0x43a91f);fs[_0x47fe('0x64')](_0xf8b1c9);return _0x463bbc;})[_0x47fe('0x23')](function(_0x57fa75){if(_0x57fa75){return _0x4a392f[_0x47fe('0x1a')](0xcc)['end']();}})[_0x47fe('0x23')](handleEntityNotFound(_0x4a392f,null))[_0x47fe('0x49')](handleError(_0x4a392f,null));}; \ No newline at end of file +var _0x6464=['UserProfileResource','error','stack','name','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','nolimit','limit','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','Sound','includeAll','include','findAll','rows','catch','show','length','find','download','params','converted_format','existsSync','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','join','format','%s.%s','create','basename','extname','file','filename','substring','wav','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_sampleRate','0777','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','description','save_name','original_format','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','destroy','then','Sounds'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6464,0x14e));var _0x4646=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6464[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x4646('0x0'));var emlformat=require(_0x4646('0x1'));var rimraf=require(_0x4646('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4646('0x3'));var rp=require(_0x4646('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4646('0x5'));var util=require('util');var path=require(_0x4646('0x6'));var sox=require('sox');var csv=require(_0x4646('0x7'));var ejs=require(_0x4646('0x8'));var fs=require('fs');var _=require(_0x4646('0x9'));var squel=require(_0x4646('0xa'));var crypto=require(_0x4646('0xb'));var jsforce=require(_0x4646('0xc'));var deskjs=require(_0x4646('0xd'));var toCsv=require(_0x4646('0x7'));var querystring=require(_0x4646('0xe'));var Papa=require(_0x4646('0xf'));var Redis=require(_0x4646('0x10'));var authService=require(_0x4646('0x11'));var qs=require(_0x4646('0x12'));var hardwareService=require(_0x4646('0x13'));var logger=require(_0x4646('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4646('0x15'))['db'];function respondWithStatusCode(_0x180fc0,_0x452d5b){_0x452d5b=_0x452d5b||0xcc;return function(_0x4d40ec){if(_0x4d40ec){return _0x180fc0[_0x4646('0x16')](_0x452d5b);}return _0x180fc0[_0x4646('0x17')](_0x452d5b)[_0x4646('0x18')]();};}function respondWithResult(_0xd975c1,_0x16c075){_0x16c075=_0x16c075||0xc8;return function(_0xa8da0d){if(_0xa8da0d){return _0xd975c1['status'](_0x16c075)[_0x4646('0x19')](_0xa8da0d);}};}function respondWithFilteredResult(_0x20a13b,_0xdc427){return function(_0x1b22b4){if(_0x1b22b4){var _0x2371c7=_0x1b22b4[_0x4646('0x1a')],_0x4a436c=_0xdc427[_0x4646('0x1b')],_0x84774c=_0xdc427['offset']+_0xdc427['limit'],_0x4ea8ca;if(_0x84774c>=_0x2371c7){_0x84774c=_0x2371c7;_0x4ea8ca=0xc8;}else{_0x4ea8ca=0xce;}_0x20a13b[_0x4646('0x17')](_0x4ea8ca);return _0x20a13b[_0x4646('0x1c')]('Content-Range',_0x4a436c+'-'+_0x84774c+'/'+_0x2371c7)[_0x4646('0x19')](_0x1b22b4);}return null;};}function patchUpdates(_0x3034c8){return function(_0x43feb6){try{jsonpatch[_0x4646('0x1d')](_0x43feb6,_0x3034c8,!![]);}catch(_0x172a6e){return BPromise[_0x4646('0x1e')](_0x172a6e);}return _0x43feb6[_0x4646('0x1f')]();};}function saveUpdates(_0xc9fda6,_0x22d5e1){return function(_0x12b863){if(_0x12b863){return _0x12b863['update'](_0xc9fda6)['then'](function(_0x4871f0){return _0x4871f0;});}return null;};}function removeEntity(_0x2982f9,_0x22a5fe){return function(_0x16e2aa){if(_0x16e2aa){return _0x16e2aa[_0x4646('0x20')]()[_0x4646('0x21')](function(){var _0x3c1bb9=_0x16e2aa['get']({'plain':!![]});var _0xd059c3=_0x4646('0x22');return db[_0x4646('0x23')][_0x4646('0x20')]({'where':{'type':_0xd059c3,'resourceId':_0x3c1bb9['id']}})[_0x4646('0x21')](function(){return _0x16e2aa;});})[_0x4646('0x21')](function(){_0x2982f9['status'](0xcc)[_0x4646('0x18')]();});}};}function handleEntityNotFound(_0x4b1fce,_0x51fb16){return function(_0xdf0a11){if(!_0xdf0a11){_0x4b1fce['sendStatus'](0x194);}return _0xdf0a11;};}function handleError(_0x52a84f,_0x26993c){_0x26993c=_0x26993c||0x1f4;return function(_0xb6c653){logger[_0x4646('0x24')](_0xb6c653[_0x4646('0x25')]);if(_0xb6c653[_0x4646('0x26')]){delete _0xb6c653[_0x4646('0x26')];}_0x52a84f[_0x4646('0x17')](_0x26993c)['send'](_0xb6c653);};}exports[_0x4646('0x27')]=function(_0xec3784,_0x22c124){var _0x496e34={},_0x5684d8={},_0x2b5c06={'count':0x0,'rows':[]};var _0x42a311=db['Sound'][_0x4646('0x28')];_0x5684d8[_0x4646('0x29')]=_[_0x4646('0x2a')](_0x42a311);_0x5684d8[_0x4646('0x2b')]=_[_0x4646('0x2a')](_0xec3784[_0x4646('0x2b')]);_0x5684d8[_0x4646('0x2c')]=_[_0x4646('0x2d')](_0x5684d8[_0x4646('0x29')],_0x5684d8[_0x4646('0x2b')]);_0x496e34['attributes']=_[_0x4646('0x2d')](_0x5684d8[_0x4646('0x29')],qs[_0x4646('0x2e')](_0xec3784[_0x4646('0x2b')]['fields']));_0x496e34['attributes']=_0x496e34[_0x4646('0x2f')]['length']?_0x496e34['attributes']:_0x5684d8['model'];if(!_0xec3784['query']['hasOwnProperty'](_0x4646('0x30'))){_0x496e34['limit']=qs[_0x4646('0x31')](_0xec3784[_0x4646('0x2b')][_0x4646('0x31')]);_0x496e34[_0x4646('0x1b')]=qs[_0x4646('0x1b')](_0xec3784['query']['offset']);}_0x496e34['order']=qs['sort'](_0xec3784[_0x4646('0x2b')][_0x4646('0x32')]);_0x496e34[_0x4646('0x33')]=qs[_0x4646('0x2c')](_['pick'](_0xec3784['query'],_0x5684d8['filters']));if(_0xec3784[_0x4646('0x2b')][_0x4646('0x34')]){_0x496e34[_0x4646('0x33')]=_[_0x4646('0x35')](_0x496e34[_0x4646('0x33')],{'$or':_[_0x4646('0x36')](_0x42a311,function(_0x47509d){if(_0x47509d[_0x4646('0x37')][_0x4646('0x38')]!==_0x4646('0x39')){var _0x52c6f2={};_0x52c6f2[_0x47509d[_0x4646('0x3a')]]={'$like':'%'+_0xec3784['query']['filter']+'%'};return _0x52c6f2;}})});}_0x496e34=_[_0x4646('0x35')]({},_0x496e34,_0xec3784[_0x4646('0x3b')]);var _0x1c07cd={'where':_0x496e34[_0x4646('0x33')]};return db[_0x4646('0x3c')][_0x4646('0x1a')](_0x1c07cd)[_0x4646('0x21')](function(_0x152516){_0x2b5c06[_0x4646('0x1a')]=_0x152516;if(_0xec3784[_0x4646('0x2b')][_0x4646('0x3d')]){_0x496e34[_0x4646('0x3e')]=[{'all':!![]}];}return db[_0x4646('0x3c')][_0x4646('0x3f')](_0x496e34);})[_0x4646('0x21')](function(_0x4fee88){_0x2b5c06[_0x4646('0x40')]=_0x4fee88;return _0x2b5c06;})[_0x4646('0x21')](respondWithFilteredResult(_0x22c124,_0x496e34))[_0x4646('0x41')](handleError(_0x22c124,null));};exports[_0x4646('0x42')]=function(_0x17c195,_0x5968fc){var _0x405ebe={'raw':!![],'where':{'id':_0x17c195['params']['id']}},_0x1d6612={};_0x1d6612[_0x4646('0x29')]=_[_0x4646('0x2a')](db[_0x4646('0x3c')][_0x4646('0x28')]);_0x1d6612[_0x4646('0x2b')]=_[_0x4646('0x2a')](_0x17c195['query']);_0x1d6612[_0x4646('0x2c')]=_['intersection'](_0x1d6612[_0x4646('0x29')],_0x1d6612[_0x4646('0x2b')]);_0x405ebe['attributes']=_[_0x4646('0x2d')](_0x1d6612[_0x4646('0x29')],qs[_0x4646('0x2e')](_0x17c195[_0x4646('0x2b')][_0x4646('0x2e')]));_0x405ebe[_0x4646('0x2f')]=_0x405ebe[_0x4646('0x2f')][_0x4646('0x43')]?_0x405ebe['attributes']:_0x1d6612[_0x4646('0x29')];if(_0x17c195[_0x4646('0x2b')][_0x4646('0x3d')]){_0x405ebe['include']=[{'all':!![]}];}_0x405ebe=_['merge']({},_0x405ebe,_0x17c195[_0x4646('0x3b')]);return db[_0x4646('0x3c')][_0x4646('0x44')](_0x405ebe)[_0x4646('0x21')](handleEntityNotFound(_0x5968fc,null))[_0x4646('0x21')](respondWithResult(_0x5968fc,null))['catch'](handleError(_0x5968fc,null));};exports[_0x4646('0x45')]=function(_0xbe7289,_0x307636,_0xdf1c2e){return db[_0x4646('0x3c')][_0x4646('0x44')]({'where':{'id':_0xbe7289[_0x4646('0x46')]['id']},'attributes':[_0x4646('0x26'),'save_name',_0x4646('0x47')],'raw':!![]})[_0x4646('0x21')](handleEntityNotFound(_0x307636,null))[_0x4646('0x21')](function(_0x22fc1d){if(_0x22fc1d){if(!fs[_0x4646('0x48')](path['join'](config[_0x4646('0x49')],_0x4646('0x4a'),_0x22fc1d['save_name']+'.'+_0x22fc1d[_0x4646('0x47')]))){throw new db[(_0x4646('0x4b'))][(_0x4646('0x4c'))](_0x4646('0x4d'));}return _0x307636['download'](path[_0x4646('0x4e')](config[_0x4646('0x49')],_0x4646('0x4a'),util[_0x4646('0x4f')](_0x4646('0x50'),_0x22fc1d['save_name'],_0x22fc1d[_0x4646('0x47')])),util[_0x4646('0x4f')](_0x4646('0x50'),_0x22fc1d[_0x4646('0x26')],_0x22fc1d['converted_format']));}return null;})[_0x4646('0x41')](handleError(_0x307636,null));};exports[_0x4646('0x51')]=function(_0x18db49,_0x2a9226,_0xc0eb80){var _0x333368={'name':path[_0x4646('0x52')](_0x18db49['file']['originalname'],path[_0x4646('0x53')](_0x18db49[_0x4646('0x54')]['originalname'])),'save_name':path['basename'](_0x18db49[_0x4646('0x54')]['filename'],path[_0x4646('0x53')](_0x18db49[_0x4646('0x54')][_0x4646('0x55')])),'original_format':path[_0x4646('0x53')](_0x18db49[_0x4646('0x54')]['originalname'])[_0x4646('0x56')](0x1),'converted_format':_0x4646('0x57')};var _0x374f46=path[_0x4646('0x4e')](config[_0x4646('0x49')],_0x4646('0x58'),_0x18db49['file'][_0x4646('0x55')]);var _0x51350e=path[_0x4646('0x4e')](config[_0x4646('0x49')],_0x4646('0x4a'),util[_0x4646('0x4f')](_0x4646('0x50'),path[_0x4646('0x52')](_0x18db49['file'][_0x4646('0x55')],path[_0x4646('0x53')](_0x18db49[_0x4646('0x54')]['filename'])),_0x333368['converted_format']));logger['info'](_0x4646('0x59'),_0x374f46);logger['info'](_0x4646('0x5a'),_0x51350e);try{fs[_0x4646('0x5b')](_0x374f46,parseInt('0777',0x8));var _0xb02ff0=sox[_0x4646('0x5c')](_0x374f46,_0x51350e,{'sampleRate':0x1f40,'format':_0x4646('0x57'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xb02ff0['on'](_0x4646('0x24'),function(_0x5505d9){fs[_0x4646('0x5d')](_0x374f46);_0x2a9226['status'](0x1f4)['send'](_0x5505d9);});_0xb02ff0['on'](_0x4646('0x5e'),function(_0x1a04c4){_0x333368[_0x4646('0x5f')]=isNaN(_0x1a04c4[_0x4646('0x60')])?null:_0x1a04c4[_0x4646('0x60')]*0x3e8;_0x333368[_0x4646('0x61')]=isNaN(_0x1a04c4[_0x4646('0x62')])?null:_0x1a04c4[_0x4646('0x62')];_0x333368[_0x4646('0x63')]=isNaN(_0x1a04c4[_0x4646('0x64')])?null:_0x1a04c4[_0x4646('0x64')];_0x333368[_0x4646('0x65')]=isNaN(_0x1a04c4['bitRate'])?null:_0x1a04c4[_0x4646('0x66')];_0x333368[_0x4646('0x67')]=isNaN(_0x1a04c4[_0x4646('0x68')])?null:_0x1a04c4[_0x4646('0x68')];});_0xb02ff0['on'](_0x4646('0x69'),function(_0xecbb9b){_0x333368['converted_duration']=isNaN(_0xecbb9b[_0x4646('0x60')])?null:_0xecbb9b[_0x4646('0x60')]*0x3e8;_0x333368[_0x4646('0x6a')]=isNaN(_0xecbb9b[_0x4646('0x62')])?null:_0xecbb9b['sampleCount'];_0x333368[_0x4646('0x6b')]=isNaN(_0xecbb9b[_0x4646('0x64')])?null:_0xecbb9b[_0x4646('0x64')];_0x333368['converted_bitRate']=isNaN(_0xecbb9b['bitRate'])?null:_0xecbb9b[_0x4646('0x66')];_0x333368[_0x4646('0x6c')]=isNaN(_0xecbb9b[_0x4646('0x68')])?null:_0xecbb9b[_0x4646('0x68')];});_0xb02ff0['on'](_0x4646('0x18'),function(){fs['chmodSync'](_0x51350e,parseInt(_0x4646('0x6d'),0x8));return db[_0x4646('0x3c')][_0x4646('0x51')](_0x333368)[_0x4646('0x21')](function(_0x3b80de){var _0x562091={'role':_0x18db49[_0x4646('0x6e')][_0x4646('0x6f')],'userProfileId':_0x18db49[_0x4646('0x6e')][_0x4646('0x70')]};if(!_0x562091)throw new Error(_0x4646('0x71'));if(_0x562091[_0x4646('0x6f')]===_0x4646('0x72')){var _0x2b9727=_0x3b80de['get']({'plain':!![]});return db[_0x4646('0x73')][_0x4646('0x44')]({'where':{'name':_0x4646('0x22'),'userProfileId':_0x562091['userProfileId']},'raw':!![]})[_0x4646('0x21')](function(_0x333bd7){if(_0x333bd7&&_0x333bd7[_0x4646('0x74')]===0x0){return db[_0x4646('0x23')][_0x4646('0x51')]({'name':_0x2b9727['name'],'resourceId':_0x2b9727['id'],'type':_0x333bd7[_0x4646('0x26')],'sectionId':_0x333bd7['id']},{})[_0x4646('0x21')](function(){return _0x3b80de;});}else{return _0x3b80de;}})[_0x4646('0x41')](function(_0x56a979){logger[_0x4646('0x24')](_0x4646('0x75'),_0x56a979);throw _0x56a979;});}return _0x3b80de;})[_0x4646('0x21')](respondWithResult(_0x2a9226,null))[_0x4646('0x41')](handleError(_0x2a9226,null));});_0xb02ff0[_0x4646('0x76')]();}catch(_0x598fb0){_0x2a9226['status'](0x1f4)['send'](_0x598fb0);}};exports['update']=function(_0x57aab7,_0x1a1981,_0x50436e){return db[_0x4646('0x3c')][_0x4646('0x44')]({'where':{'id':_0x57aab7[_0x4646('0x46')]['id']}})['then'](handleEntityNotFound(_0x1a1981,null))[_0x4646('0x21')](saveUpdates(_[_0x4646('0x77')](_0x57aab7[_0x4646('0x6e')],[_0x4646('0x26'),_0x4646('0x78')]),null))[_0x4646('0x21')](respondWithResult(_0x1a1981,null))[_0x4646('0x41')](handleError(_0x1a1981,null));};exports['delete']=function(_0x2323f1,_0x3fe6dd,_0x5090c4){return db[_0x4646('0x3c')]['find']({'where':{'id':_0x2323f1['params']['id']}})[_0x4646('0x21')](function(_0x3d6a01){if(_0x3d6a01){return _0x3d6a01[_0x4646('0x20')]();}})[_0x4646('0x21')](function(_0x4e4c8f){var _0x5f03de=path['join'](config[_0x4646('0x49')],'server/files/sounds/original',util['format'](_0x4646('0x50'),_0x4e4c8f[_0x4646('0x79')],_0x4e4c8f[_0x4646('0x7a')]));var _0x5399d7=path[_0x4646('0x4e')](config[_0x4646('0x49')],_0x4646('0x4a'),util[_0x4646('0x4f')](_0x4646('0x50'),_0x4e4c8f[_0x4646('0x79')],_0x4e4c8f[_0x4646('0x47')]));fs[_0x4646('0x5d')](_0x5f03de);fs[_0x4646('0x5d')](_0x5399d7);return _0x4e4c8f;})[_0x4646('0x21')](function(_0x4a2ead){if(_0x4a2ead){return _0x3fe6dd[_0x4646('0x17')](0xcc)[_0x4646('0x18')]();}})['then'](handleEntityNotFound(_0x3fe6dd,null))['catch'](handleError(_0x3fe6dd,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 94ae0a3..322271c 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 _0x0637=['define','tools_sounds','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports'];(function(_0x181ed3,_0x5b3ce6){var _0x736c8d=function(_0x421c51){while(--_0x421c51){_0x181ed3['push'](_0x181ed3['shift']());}};_0x736c8d(++_0x5b3ce6);}(_0x0637,0x1f0));var _0x7063=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0637[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7063('0x0'));var util=require(_0x7063('0x1'));var logger=require(_0x7063('0x2'))('api');var moment=require(_0x7063('0x3'));var BPromise=require(_0x7063('0x4'));var rp=require(_0x7063('0x5'));var fs=require('fs');var path=require(_0x7063('0x6'));var rimraf=require(_0x7063('0x7'));var config=require(_0x7063('0x8'));var attributes=require(_0x7063('0x9'));module[_0x7063('0xa')]=function(_0x3f123a,_0x47ab16){return _0x3f123a[_0x7063('0xb')]('Sound',attributes,{'tableName':_0x7063('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3caf=['api','moment','request-promise','rimraf','../../config/environment','exports','Sound','tools_sounds','lodash','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3caf,0x1e8));var _0xf3ca=function(_0x54d5b2,_0x293bbf){_0x54d5b2=_0x54d5b2-0x0;var _0x179c95=_0x3caf[_0x54d5b2];return _0x179c95;};'use strict';var _=require(_0xf3ca('0x0'));var util=require('util');var logger=require(_0xf3ca('0x1'))(_0xf3ca('0x2'));var moment=require(_0xf3ca('0x3'));var BPromise=require('bluebird');var rp=require(_0xf3ca('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf3ca('0x5'));var config=require(_0xf3ca('0x6'));var attributes=require('./sound.attributes');module[_0xf3ca('0x7')]=function(_0x1ceb0c,_0xc06dcf){return _0x1ceb0c['define'](_0xf3ca('0x8'),attributes,{'tableName':_0xf3ca('0x9'),'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 6af6cd1..e676264 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(_0x2fa081,_0x18c185){var _0xb3f8f2=function(_0x201d8e){while(--_0x201d8e){_0x2fa081['push'](_0x2fa081['shift']());}};_0xb3f8f2(++_0x18c185);}(_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 _0xa9e0=['then','stringify','ShowSound','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','Sound','find','options','raw','where','attributes','include','model','map'];(function(_0x9df3d8,_0x4074e3){var _0x366da1=function(_0x5af940){while(--_0x5af940){_0x9df3d8['push'](_0x9df3d8['shift']());}};_0x366da1(++_0x4074e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['ShowSound']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['include']?_['map'](_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')],function(_0x38e7c4){return{'model':db[_0x38e7c4[_0x0a9e('0x1b')]],'as':_0x38e7c4['as'],'attributes':_0x38e7c4['attributes'],'include':_0x38e7c4[_0x0a9e('0x1a')]?_[_0x0a9e('0x1c')](_0x38e7c4[_0x0a9e('0x1a')],function(_0x4d00e6){return{'model':db[_0x4d00e6[_0x0a9e('0x1b')]],'as':_0x4d00e6['as'],'attributes':_0x4d00e6[_0x0a9e('0x19')],'include':_0x4d00e6[_0x0a9e('0x1a')]?_['map'](_0x4d00e6['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x1b')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x1d')](function(_0x526cf3){logger[_0x0a9e('0xa')]('ShowSound',_0x459eb1);logger[_0x0a9e('0xd')]('ShowSound',_0x459eb1,JSON[_0x0a9e('0x1e')](_0x526cf3));_0x106033(_0x526cf3);})[_0x0a9e('0x13')](function(_0x25fba9){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x25fba9[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x25fba9[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index c70a522..23277ad 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 _0x1364=['../../config/environment','./squareMessage.controller','index','/:id','isAuthenticated','show','post','create','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x38bef5,_0x326567){var _0x10e210=function(_0x334cac){while(--_0x334cac){_0x38bef5['push'](_0x38bef5['shift']());}};_0x10e210(++_0x326567);}(_0x1364,0x1eb));var _0x4136=function(_0x1f98ee,_0x1d1dcd){_0x1f98ee=_0x1f98ee-0x0;var _0x269add=_0x1364[_0x1f98ee];return _0x269add;};'use strict';var multer=require(_0x4136('0x0'));var util=require('util');var path=require(_0x4136('0x1'));var timeout=require(_0x4136('0x2'));var express=require('express');var router=express[_0x4136('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4136('0x4'));var config=require(_0x4136('0x5'));var controller=require(_0x4136('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x4136('0x7')]);router['get'](_0x4136('0x8'),auth[_0x4136('0x9')](),controller[_0x4136('0xa')]);router[_0x4136('0xb')]('/',auth[_0x4136('0x9')](),controller[_0x4136('0xc')]);router['put'](_0x4136('0x8'),auth[_0x4136('0x9')](),controller['update']);router[_0x4136('0xd')](_0x4136('0x8'),auth[_0x4136('0x9')](),controller[_0x4136('0xe')]);module[_0x4136('0xf')]=router; \ No newline at end of file +var _0x9efc=['express','../../components/interaction/service','./squareMessage.controller','isAuthenticated','get','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout'];(function(_0x2c5021,_0x5a03c7){var _0x1bce1f=function(_0x2576f3){while(--_0x2576f3){_0x2c5021['push'](_0x2c5021['shift']());}};_0x1bce1f(++_0x5a03c7);}(_0x9efc,0x19c));var _0xc9ef=function(_0xbec2cd,_0xcf1938){_0xbec2cd=_0xbec2cd-0x0;var _0x38142e=_0x9efc[_0xbec2cd];return _0x38142e;};'use strict';var multer=require(_0xc9ef('0x0'));var util=require(_0xc9ef('0x1'));var path=require(_0xc9ef('0x2'));var timeout=require(_0xc9ef('0x3'));var express=require(_0xc9ef('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xc9ef('0x5'));var config=require('../../config/environment');var controller=require(_0xc9ef('0x6'));router['get']('/',auth[_0xc9ef('0x7')](),controller['index']);router[_0xc9ef('0x8')](_0xc9ef('0x9'),auth[_0xc9ef('0x7')](),controller[_0xc9ef('0xa')]);router[_0xc9ef('0xb')]('/',auth[_0xc9ef('0x7')](),controller[_0xc9ef('0xc')]);router[_0xc9ef('0xd')](_0xc9ef('0x9'),auth[_0xc9ef('0x7')](),controller[_0xc9ef('0xe')]);router['delete']('/:id',auth[_0xc9ef('0x7')](),controller['destroy']);module[_0xc9ef('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 9094e83..64775d4 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 _0x3114=['ENUM','out','sequelize','exports','TEXT','medium'];(function(_0x5d5ddd,_0x1d4279){var _0x3e6e7a=function(_0x5a033d){while(--_0x5a033d){_0x5d5ddd['push'](_0x5d5ddd['shift']());}};_0x3e6e7a(++_0x1d4279);}(_0x3114,0xfe));var _0x4311=function(_0x538902,_0x9608c9){_0x538902=_0x538902-0x0;var _0x3339da=_0x3114[_0x538902];return _0x3339da;};'use strict';var Sequelize=require(_0x4311('0x0'));module[_0x4311('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x4311('0x2')](_0x4311('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x4311('0x4')]('in',_0x4311('0x5')),'defaultValue':_0x4311('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0xc1c5=['ENUM','STRING','TEXT'];(function(_0x30696d,_0x2e636f){var _0x459f73=function(_0x1403d0){while(--_0x1403d0){_0x30696d['push'](_0x30696d['shift']());}};_0x459f73(++_0x2e636f);}(_0xc1c5,0x1bd));var _0x5c1c=function(_0x478d46,_0x4d5462){_0x478d46=_0x478d46-0x0;var _0x7dce19=_0xc1c5[_0x478d46];return _0x7dce19;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x5c1c('0x0')]},'body':{'type':Sequelize[_0x5c1c('0x1')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x5c1c('0x2')]('in','out'),'defaultValue':'out','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 14a56f5..ef7db63 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 _0xeb74=['rows','catch','show','params','options','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','SquareMessage','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','type','key','field','includeAll','include'];(function(_0xd53b14,_0x54d7e7){var _0x542de3=function(_0x167428){while(--_0x167428){_0xd53b14['push'](_0xd53b14['shift']());}};_0x542de3(++_0x54d7e7);}(_0xeb74,0xe3));var _0x4eb7=function(_0x62fd2b,_0x29ecd2){_0x62fd2b=_0x62fd2b-0x0;var _0x490954=_0xeb74[_0x62fd2b];return _0x490954;};'use strict';var pdf=require(_0x4eb7('0x0'));var emlformat=require(_0x4eb7('0x1'));var rimraf=require(_0x4eb7('0x2'));var zipdir=require(_0x4eb7('0x3'));var jsonpatch=require(_0x4eb7('0x4'));var rp=require(_0x4eb7('0x5'));var moment=require(_0x4eb7('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x4eb7('0x7'));var util=require(_0x4eb7('0x8'));var path=require(_0x4eb7('0x9'));var sox=require(_0x4eb7('0xa'));var csv=require(_0x4eb7('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4eb7('0xc'));var squel=require('squel');var crypto=require(_0x4eb7('0xd'));var jsforce=require(_0x4eb7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4eb7('0xf'));var Papa=require(_0x4eb7('0x10'));var Redis=require('ioredis');var authService=require(_0x4eb7('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4eb7('0x12'));var logger=require(_0x4eb7('0x13'))(_0x4eb7('0x14'));var utils=require('../../config/utils');var config=require(_0x4eb7('0x15'));var db=require(_0x4eb7('0x16'))['db'];function respondWithStatusCode(_0x3c0e15,_0x3273b1){_0x3273b1=_0x3273b1||0xcc;return function(_0x35fa89){if(_0x35fa89){return _0x3c0e15[_0x4eb7('0x17')](_0x3273b1);}return _0x3c0e15[_0x4eb7('0x18')](_0x3273b1)['end']();};}function respondWithResult(_0x4c33a9,_0x5c6bc9){_0x5c6bc9=_0x5c6bc9||0xc8;return function(_0x17fb81){if(_0x17fb81){return _0x4c33a9['status'](_0x5c6bc9)[_0x4eb7('0x19')](_0x17fb81);}};}function respondWithFilteredResult(_0x119afa,_0x24db56){return function(_0x1c4a97){if(_0x1c4a97){var _0x5d6d5=_0x1c4a97[_0x4eb7('0x1a')],_0x21433d=_0x24db56[_0x4eb7('0x1b')],_0x11674f=_0x24db56['offset']+_0x24db56[_0x4eb7('0x1c')],_0x76988;if(_0x11674f>=_0x5d6d5){_0x11674f=_0x5d6d5;_0x76988=0xc8;}else{_0x76988=0xce;}_0x119afa[_0x4eb7('0x18')](_0x76988);return _0x119afa[_0x4eb7('0x1d')](_0x4eb7('0x1e'),_0x21433d+'-'+_0x11674f+'/'+_0x5d6d5)[_0x4eb7('0x19')](_0x1c4a97);}return null;};}function patchUpdates(_0x44f1b9){return function(_0x2d0ea7){try{jsonpatch[_0x4eb7('0x1f')](_0x2d0ea7,_0x44f1b9,!![]);}catch(_0x5f4780){return BPromise[_0x4eb7('0x20')](_0x5f4780);}return _0x2d0ea7[_0x4eb7('0x21')]();};}function saveUpdates(_0x4250cc,_0x21377b){return function(_0x32f0f5){if(_0x32f0f5){return _0x32f0f5[_0x4eb7('0x22')](_0x4250cc)[_0x4eb7('0x23')](function(_0x4ddbe4){return _0x4ddbe4;});}return null;};}function removeEntity(_0x214a28,_0x28ad09){return function(_0x4783b1){if(_0x4783b1){return _0x4783b1[_0x4eb7('0x24')]()[_0x4eb7('0x23')](function(){_0x214a28[_0x4eb7('0x18')](0xcc)[_0x4eb7('0x25')]();});}};}function handleEntityNotFound(_0x2df1b1,_0x1a2b8b){return function(_0x13e871){if(!_0x13e871){_0x2df1b1['sendStatus'](0x194);}return _0x13e871;};}function handleError(_0x3e72cd,_0x2f7a05){_0x2f7a05=_0x2f7a05||0x1f4;return function(_0x2e8de8){logger[_0x4eb7('0x26')](_0x2e8de8[_0x4eb7('0x27')]);if(_0x2e8de8[_0x4eb7('0x28')]){delete _0x2e8de8[_0x4eb7('0x28')];}_0x3e72cd[_0x4eb7('0x18')](_0x2f7a05)[_0x4eb7('0x29')](_0x2e8de8);};}exports[_0x4eb7('0x2a')]=function(_0xf83c11,_0x2984b2){var _0x2d1773={},_0x1b56a8={},_0x433794={'count':0x0,'rows':[]};var _0x1c0665=db[_0x4eb7('0x2b')][_0x4eb7('0x2c')];_0x1b56a8[_0x4eb7('0x2d')]=_[_0x4eb7('0x2e')](_0x1c0665);_0x1b56a8[_0x4eb7('0x2f')]=_[_0x4eb7('0x2e')](_0xf83c11[_0x4eb7('0x2f')]);_0x1b56a8['filters']=_[_0x4eb7('0x30')](_0x1b56a8['model'],_0x1b56a8[_0x4eb7('0x2f')]);_0x2d1773[_0x4eb7('0x31')]=_[_0x4eb7('0x30')](_0x1b56a8[_0x4eb7('0x2d')],qs[_0x4eb7('0x32')](_0xf83c11[_0x4eb7('0x2f')][_0x4eb7('0x32')]));_0x2d1773[_0x4eb7('0x31')]=_0x2d1773[_0x4eb7('0x31')]['length']?_0x2d1773[_0x4eb7('0x31')]:_0x1b56a8['model'];if(!_0xf83c11[_0x4eb7('0x2f')][_0x4eb7('0x33')]('nolimit')){_0x2d1773['limit']=qs[_0x4eb7('0x1c')](_0xf83c11[_0x4eb7('0x2f')][_0x4eb7('0x1c')]);_0x2d1773[_0x4eb7('0x1b')]=qs['offset'](_0xf83c11[_0x4eb7('0x2f')][_0x4eb7('0x1b')]);}_0x2d1773[_0x4eb7('0x34')]=qs[_0x4eb7('0x35')](_0xf83c11[_0x4eb7('0x2f')]['sort']);_0x2d1773[_0x4eb7('0x36')]=qs[_0x4eb7('0x37')](_[_0x4eb7('0x38')](_0xf83c11['query'],_0x1b56a8[_0x4eb7('0x37')]));if(_0xf83c11[_0x4eb7('0x2f')][_0x4eb7('0x39')]){_0x2d1773['where']=_[_0x4eb7('0x3a')](_0x2d1773['where'],{'$or':_[_0x4eb7('0x3b')](_0x1c0665,function(_0x4c990){if(_0x4c990[_0x4eb7('0x3c')][_0x4eb7('0x3d')]!=='VIRTUAL'){var _0x1e8759={};_0x1e8759[_0x4c990[_0x4eb7('0x3e')]]={'$like':'%'+_0xf83c11[_0x4eb7('0x2f')][_0x4eb7('0x39')]+'%'};return _0x1e8759;}})});}_0x2d1773=_['merge']({},_0x2d1773,_0xf83c11['options']);var _0x5bb5f5={'where':_0x2d1773[_0x4eb7('0x36')]};return db[_0x4eb7('0x2b')][_0x4eb7('0x1a')](_0x5bb5f5)[_0x4eb7('0x23')](function(_0x210c20){_0x433794[_0x4eb7('0x1a')]=_0x210c20;if(_0xf83c11[_0x4eb7('0x2f')][_0x4eb7('0x3f')]){_0x2d1773[_0x4eb7('0x40')]=[{'all':!![]}];}return db[_0x4eb7('0x2b')]['findAll'](_0x2d1773);})[_0x4eb7('0x23')](function(_0x38218f){_0x433794[_0x4eb7('0x41')]=_0x38218f;return _0x433794;})[_0x4eb7('0x23')](respondWithFilteredResult(_0x2984b2,_0x2d1773))[_0x4eb7('0x42')](handleError(_0x2984b2,null));};exports[_0x4eb7('0x43')]=function(_0x704d4d,_0xef998f){var _0x3eac50={'raw':!![],'where':{'id':_0x704d4d[_0x4eb7('0x44')]['id']}},_0x3a31ce={};_0x3a31ce[_0x4eb7('0x2d')]=_[_0x4eb7('0x2e')](db[_0x4eb7('0x2b')][_0x4eb7('0x2c')]);_0x3a31ce[_0x4eb7('0x2f')]=_[_0x4eb7('0x2e')](_0x704d4d[_0x4eb7('0x2f')]);_0x3a31ce[_0x4eb7('0x37')]=_[_0x4eb7('0x30')](_0x3a31ce['model'],_0x3a31ce[_0x4eb7('0x2f')]);_0x3eac50[_0x4eb7('0x31')]=_[_0x4eb7('0x30')](_0x3a31ce[_0x4eb7('0x2d')],qs[_0x4eb7('0x32')](_0x704d4d[_0x4eb7('0x2f')][_0x4eb7('0x32')]));_0x3eac50[_0x4eb7('0x31')]=_0x3eac50[_0x4eb7('0x31')]['length']?_0x3eac50[_0x4eb7('0x31')]:_0x3a31ce['model'];if(_0x704d4d[_0x4eb7('0x2f')][_0x4eb7('0x3f')]){_0x3eac50[_0x4eb7('0x40')]=[{'all':!![]}];}_0x3eac50=_['merge']({},_0x3eac50,_0x704d4d[_0x4eb7('0x45')]);return db[_0x4eb7('0x2b')][_0x4eb7('0x46')](_0x3eac50)[_0x4eb7('0x23')](handleEntityNotFound(_0xef998f,null))['then'](respondWithResult(_0xef998f,null))[_0x4eb7('0x42')](handleError(_0xef998f,null));};exports['create']=function(_0x112eb8,_0x3bafa2){return db[_0x4eb7('0x2b')][_0x4eb7('0x47')](_0x112eb8[_0x4eb7('0x48')],{})['then'](respondWithResult(_0x3bafa2,0xc9))['catch'](handleError(_0x3bafa2,null));};exports[_0x4eb7('0x22')]=function(_0x1092b9,_0x289780){if(_0x1092b9[_0x4eb7('0x48')]['id']){delete _0x1092b9[_0x4eb7('0x48')]['id'];}return db['SquareMessage'][_0x4eb7('0x46')]({'where':{'id':_0x1092b9[_0x4eb7('0x44')]['id']}})['then'](handleEntityNotFound(_0x289780,null))[_0x4eb7('0x23')](saveUpdates(_0x1092b9[_0x4eb7('0x48')],null))['then'](respondWithResult(_0x289780,null))[_0x4eb7('0x42')](handleError(_0x289780,null));};exports[_0x4eb7('0x24')]=function(_0x3c8049,_0x5774d5){return db[_0x4eb7('0x2b')]['find']({'where':{'id':_0x3c8049['params']['id']}})[_0x4eb7('0x23')](handleEntityNotFound(_0x5774d5,null))[_0x4eb7('0x23')](removeEntity(_0x5774d5,null))[_0x4eb7('0x42')](handleError(_0x5774d5,null));}; \ No newline at end of file +var _0xae60=['filter','merge','map','key','options','includeAll','SquareMessage','findAll','rows','show','params','intersection','include','catch','create','body','find','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','name','index','rawAttributes','model','keys','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x2c5213,_0x67673){var _0x14c88d=function(_0x19e559){while(--_0x19e559){_0x2c5213['push'](_0x2c5213['shift']());}};_0x14c88d(++_0x67673);}(_0xae60,0x1c7));var _0x0ae6=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xae60[_0x7e2eb0];return _0xd92de4;};'use strict';var pdf=require(_0x0ae6('0x0'));var emlformat=require(_0x0ae6('0x1'));var rimraf=require(_0x0ae6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0ae6('0x3'));var rp=require(_0x0ae6('0x4'));var moment=require(_0x0ae6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0ae6('0x6'));var util=require(_0x0ae6('0x7'));var path=require('path');var sox=require(_0x0ae6('0x8'));var csv=require(_0x0ae6('0x9'));var ejs=require(_0x0ae6('0xa'));var fs=require('fs');var _=require(_0x0ae6('0xb'));var squel=require(_0x0ae6('0xc'));var crypto=require(_0x0ae6('0xd'));var jsforce=require(_0x0ae6('0xe'));var deskjs=require(_0x0ae6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0ae6('0x10'));var Papa=require(_0x0ae6('0x11'));var Redis=require(_0x0ae6('0x12'));var authService=require(_0x0ae6('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x0ae6('0x14'));var logger=require(_0x0ae6('0x15'))(_0x0ae6('0x16'));var utils=require(_0x0ae6('0x17'));var config=require(_0x0ae6('0x18'));var db=require(_0x0ae6('0x19'))['db'];function respondWithStatusCode(_0x13d5c1,_0x1473ea){_0x1473ea=_0x1473ea||0xcc;return function(_0x3b05a4){if(_0x3b05a4){return _0x13d5c1[_0x0ae6('0x1a')](_0x1473ea);}return _0x13d5c1[_0x0ae6('0x1b')](_0x1473ea)[_0x0ae6('0x1c')]();};}function respondWithResult(_0x39681a,_0xf311f7){_0xf311f7=_0xf311f7||0xc8;return function(_0x4d2da8){if(_0x4d2da8){return _0x39681a[_0x0ae6('0x1b')](_0xf311f7)[_0x0ae6('0x1d')](_0x4d2da8);}};}function respondWithFilteredResult(_0x1c997a,_0x20e866){return function(_0xce3e23){if(_0xce3e23){var _0x3a1e26=_0xce3e23[_0x0ae6('0x1e')],_0x151144=_0x20e866[_0x0ae6('0x1f')],_0x3b64ac=_0x20e866[_0x0ae6('0x1f')]+_0x20e866[_0x0ae6('0x20')],_0xa797bb;if(_0x3b64ac>=_0x3a1e26){_0x3b64ac=_0x3a1e26;_0xa797bb=0xc8;}else{_0xa797bb=0xce;}_0x1c997a[_0x0ae6('0x1b')](_0xa797bb);return _0x1c997a[_0x0ae6('0x21')](_0x0ae6('0x22'),_0x151144+'-'+_0x3b64ac+'/'+_0x3a1e26)[_0x0ae6('0x1d')](_0xce3e23);}return null;};}function patchUpdates(_0x1735ba){return function(_0x2ca2a3){try{jsonpatch[_0x0ae6('0x23')](_0x2ca2a3,_0x1735ba,!![]);}catch(_0x26b369){return BPromise[_0x0ae6('0x24')](_0x26b369);}return _0x2ca2a3['save']();};}function saveUpdates(_0x401f49,_0x6fab99){return function(_0x140a3b){if(_0x140a3b){return _0x140a3b[_0x0ae6('0x25')](_0x401f49)[_0x0ae6('0x26')](function(_0xb4e6af){return _0xb4e6af;});}return null;};}function removeEntity(_0x210ca4,_0x829039){return function(_0x515f3d){if(_0x515f3d){return _0x515f3d[_0x0ae6('0x27')]()[_0x0ae6('0x26')](function(){_0x210ca4[_0x0ae6('0x1b')](0xcc)[_0x0ae6('0x1c')]();});}};}function handleEntityNotFound(_0x31ad85,_0x4eba72){return function(_0x296a9d){if(!_0x296a9d){_0x31ad85[_0x0ae6('0x1a')](0x194);}return _0x296a9d;};}function handleError(_0xccd1c5,_0x3955d8){_0x3955d8=_0x3955d8||0x1f4;return function(_0x3c43d8){logger[_0x0ae6('0x28')](_0x3c43d8['stack']);if(_0x3c43d8[_0x0ae6('0x29')]){delete _0x3c43d8[_0x0ae6('0x29')];}_0xccd1c5['status'](_0x3955d8)['send'](_0x3c43d8);};}exports[_0x0ae6('0x2a')]=function(_0x3255a7,_0x17360e){var _0x4fe77b={},_0x3b5f8f={},_0xb68cbe={'count':0x0,'rows':[]};var _0x2533c2=db['SquareMessage'][_0x0ae6('0x2b')];_0x3b5f8f[_0x0ae6('0x2c')]=_[_0x0ae6('0x2d')](_0x2533c2);_0x3b5f8f[_0x0ae6('0x2e')]=_[_0x0ae6('0x2d')](_0x3255a7[_0x0ae6('0x2e')]);_0x3b5f8f['filters']=_['intersection'](_0x3b5f8f[_0x0ae6('0x2c')],_0x3b5f8f[_0x0ae6('0x2e')]);_0x4fe77b['attributes']=_['intersection'](_0x3b5f8f[_0x0ae6('0x2c')],qs[_0x0ae6('0x2f')](_0x3255a7[_0x0ae6('0x2e')][_0x0ae6('0x2f')]));_0x4fe77b['attributes']=_0x4fe77b[_0x0ae6('0x30')][_0x0ae6('0x31')]?_0x4fe77b[_0x0ae6('0x30')]:_0x3b5f8f['model'];if(!_0x3255a7[_0x0ae6('0x2e')][_0x0ae6('0x32')](_0x0ae6('0x33'))){_0x4fe77b[_0x0ae6('0x20')]=qs[_0x0ae6('0x20')](_0x3255a7[_0x0ae6('0x2e')][_0x0ae6('0x20')]);_0x4fe77b[_0x0ae6('0x1f')]=qs[_0x0ae6('0x1f')](_0x3255a7[_0x0ae6('0x2e')]['offset']);}_0x4fe77b[_0x0ae6('0x34')]=qs[_0x0ae6('0x35')](_0x3255a7['query'][_0x0ae6('0x35')]);_0x4fe77b[_0x0ae6('0x36')]=qs[_0x0ae6('0x37')](_['pick'](_0x3255a7[_0x0ae6('0x2e')],_0x3b5f8f['filters']));if(_0x3255a7['query'][_0x0ae6('0x38')]){_0x4fe77b[_0x0ae6('0x36')]=_[_0x0ae6('0x39')](_0x4fe77b[_0x0ae6('0x36')],{'$or':_[_0x0ae6('0x3a')](_0x2533c2,function(_0x5bf771){if(_0x5bf771['type'][_0x0ae6('0x3b')]!=='VIRTUAL'){var _0x5a4403={};_0x5a4403[_0x5bf771['field']]={'$like':'%'+_0x3255a7[_0x0ae6('0x2e')]['filter']+'%'};return _0x5a4403;}})});}_0x4fe77b=_[_0x0ae6('0x39')]({},_0x4fe77b,_0x3255a7[_0x0ae6('0x3c')]);var _0x6b8cf5={'where':_0x4fe77b[_0x0ae6('0x36')]};return db['SquareMessage']['count'](_0x6b8cf5)[_0x0ae6('0x26')](function(_0x34b547){_0xb68cbe[_0x0ae6('0x1e')]=_0x34b547;if(_0x3255a7['query'][_0x0ae6('0x3d')]){_0x4fe77b['include']=[{'all':!![]}];}return db[_0x0ae6('0x3e')][_0x0ae6('0x3f')](_0x4fe77b);})[_0x0ae6('0x26')](function(_0x19403c){_0xb68cbe[_0x0ae6('0x40')]=_0x19403c;return _0xb68cbe;})[_0x0ae6('0x26')](respondWithFilteredResult(_0x17360e,_0x4fe77b))['catch'](handleError(_0x17360e,null));};exports[_0x0ae6('0x41')]=function(_0x601ef9,_0x24d9ec){var _0x2e3a07={'raw':!![],'where':{'id':_0x601ef9[_0x0ae6('0x42')]['id']}},_0x1ad562={};_0x1ad562[_0x0ae6('0x2c')]=_[_0x0ae6('0x2d')](db['SquareMessage'][_0x0ae6('0x2b')]);_0x1ad562[_0x0ae6('0x2e')]=_[_0x0ae6('0x2d')](_0x601ef9[_0x0ae6('0x2e')]);_0x1ad562[_0x0ae6('0x37')]=_[_0x0ae6('0x43')](_0x1ad562[_0x0ae6('0x2c')],_0x1ad562[_0x0ae6('0x2e')]);_0x2e3a07[_0x0ae6('0x30')]=_[_0x0ae6('0x43')](_0x1ad562[_0x0ae6('0x2c')],qs[_0x0ae6('0x2f')](_0x601ef9[_0x0ae6('0x2e')][_0x0ae6('0x2f')]));_0x2e3a07[_0x0ae6('0x30')]=_0x2e3a07[_0x0ae6('0x30')][_0x0ae6('0x31')]?_0x2e3a07[_0x0ae6('0x30')]:_0x1ad562['model'];if(_0x601ef9[_0x0ae6('0x2e')][_0x0ae6('0x3d')]){_0x2e3a07[_0x0ae6('0x44')]=[{'all':!![]}];}_0x2e3a07=_[_0x0ae6('0x39')]({},_0x2e3a07,_0x601ef9[_0x0ae6('0x3c')]);return db[_0x0ae6('0x3e')]['find'](_0x2e3a07)[_0x0ae6('0x26')](handleEntityNotFound(_0x24d9ec,null))[_0x0ae6('0x26')](respondWithResult(_0x24d9ec,null))[_0x0ae6('0x45')](handleError(_0x24d9ec,null));};exports[_0x0ae6('0x46')]=function(_0x5dd2dc,_0x59f048){return db['SquareMessage'][_0x0ae6('0x46')](_0x5dd2dc[_0x0ae6('0x47')],{})[_0x0ae6('0x26')](respondWithResult(_0x59f048,0xc9))['catch'](handleError(_0x59f048,null));};exports[_0x0ae6('0x25')]=function(_0x17a674,_0x595de5){if(_0x17a674[_0x0ae6('0x47')]['id']){delete _0x17a674[_0x0ae6('0x47')]['id'];}return db['SquareMessage'][_0x0ae6('0x48')]({'where':{'id':_0x17a674[_0x0ae6('0x42')]['id']}})['then'](handleEntityNotFound(_0x595de5,null))[_0x0ae6('0x26')](saveUpdates(_0x17a674[_0x0ae6('0x47')],null))[_0x0ae6('0x26')](respondWithResult(_0x595de5,null))['catch'](handleError(_0x595de5,null));};exports[_0x0ae6('0x27')]=function(_0x21de54,_0x46075a){return db[_0x0ae6('0x3e')][_0x0ae6('0x48')]({'where':{'id':_0x21de54[_0x0ae6('0x42')]['id']}})[_0x0ae6('0x26')](handleEntityNotFound(_0x46075a,null))['then'](removeEntity(_0x46075a,null))['catch'](handleError(_0x46075a,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 609f4c5..c87a56f 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 _0xe818=['SquareMessage','square_messages','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareMessage.attributes','define'];(function(_0x6c8b9b,_0xc36fb5){var _0x3c9b08=function(_0x27b754){while(--_0x27b754){_0x6c8b9b['push'](_0x6c8b9b['shift']());}};_0x3c9b08(++_0xc36fb5);}(_0xe818,0x122));var _0x8e81=function(_0x4ba35f,_0x347f26){_0x4ba35f=_0x4ba35f-0x0;var _0x434133=_0xe818[_0x4ba35f];return _0x434133;};'use strict';var _=require(_0x8e81('0x0'));var util=require('util');var logger=require(_0x8e81('0x1'))(_0x8e81('0x2'));var moment=require(_0x8e81('0x3'));var BPromise=require(_0x8e81('0x4'));var rp=require(_0x8e81('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8e81('0x6'));var config=require(_0x8e81('0x7'));var attributes=require(_0x8e81('0x8'));module['exports']=function(_0x13b653,_0x458c7f){return _0x13b653[_0x8e81('0x9')](_0x8e81('0xa'),attributes,{'tableName':_0x8e81('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3081=['path','exports','SquareMessage','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x53d578,_0x4ca37f){var _0x5ce805=function(_0x237705){while(--_0x237705){_0x53d578['push'](_0x53d578['shift']());}};_0x5ce805(++_0x4ca37f);}(_0x3081,0x153));var _0x1308=function(_0x283bef,_0x1f27f4){_0x283bef=_0x283bef-0x0;var _0xcd0ec8=_0x3081[_0x283bef];return _0xcd0ec8;};'use strict';var _=require(_0x1308('0x0'));var util=require(_0x1308('0x1'));var logger=require(_0x1308('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1308('0x3'));var rp=require(_0x1308('0x4'));var fs=require('fs');var path=require(_0x1308('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module[_0x1308('0x6')]=function(_0x4696ab,_0x75b55f){return _0x4696ab['define'](_0x1308('0x7'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index e6dd54e..14cc748 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 _0x4e34=['jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','CreateSquareMessage','SquareMessage','create','body','raw','then','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x13157b,_0x34e6aa){var _0x3a79bf=function(_0x2b711f){while(--_0x2b711f){_0x13157b['push'](_0x13157b['shift']());}};_0x3a79bf(++_0x34e6aa);}(_0x4e34,0x122));var _0x44e3=function(_0x5ad559,_0x268c51){_0x5ad559=_0x5ad559-0x0;var _0xfb672d=_0x4e34[_0x5ad559];return _0xfb672d;};'use strict';var _=require(_0x44e3('0x0'));var util=require('util');var moment=require(_0x44e3('0x1'));var BPromise=require(_0x44e3('0x2'));var rs=require(_0x44e3('0x3'));var fs=require('fs');var Redis=require(_0x44e3('0x4'));var db=require(_0x44e3('0x5'))['db'];var utils=require(_0x44e3('0x6'));var logger=require(_0x44e3('0x7'))(_0x44e3('0x8'));var config=require(_0x44e3('0x9'));var jayson=require(_0x44e3('0xa'));var client=jayson[_0x44e3('0xb')][_0x44e3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5f4f33,_0x5c862b,_0x4b6214){return new BPromise(function(_0x568787,_0x3b83ed){return client[_0x44e3('0xd')](_0x5f4f33,_0x4b6214)['then'](function(_0x4d1a3f){logger[_0x44e3('0xe')](_0x44e3('0xf'),_0x5c862b,'request\x20sent');logger[_0x44e3('0x10')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x5c862b,_0x44e3('0x11'),JSON['stringify'](_0x4d1a3f));if(_0x4d1a3f[_0x44e3('0x12')]){if(_0x4d1a3f[_0x44e3('0x12')][_0x44e3('0x13')]===0x1f4){logger[_0x44e3('0x12')](_0x44e3('0xf'),_0x5c862b,_0x4d1a3f[_0x44e3('0x12')][_0x44e3('0x14')]);return _0x3b83ed(_0x4d1a3f['error'][_0x44e3('0x14')]);}logger[_0x44e3('0x12')](_0x44e3('0xf'),_0x5c862b,_0x4d1a3f[_0x44e3('0x12')][_0x44e3('0x14')]);return _0x568787(_0x4d1a3f[_0x44e3('0x12')]['message']);}else{logger['info'](_0x44e3('0xf'),_0x5c862b,_0x44e3('0x11'));_0x568787(_0x4d1a3f[_0x44e3('0x15')][_0x44e3('0x14')]);}})[_0x44e3('0x16')](function(_0x53f428){logger[_0x44e3('0x12')](_0x44e3('0xf'),_0x5c862b,_0x53f428);_0x3b83ed(_0x53f428);});});}exports[_0x44e3('0x17')]=function(_0x39db2f){var _0x426c83=this;return new Promise(function(_0x12c205,_0x1dc698){return db[_0x44e3('0x18')][_0x44e3('0x19')](_0x39db2f[_0x44e3('0x1a')],{'raw':_0x39db2f['options']?_0x39db2f['options'][_0x44e3('0x1b')]===undefined?!![]:![]:!![]})[_0x44e3('0x1c')](function(_0x4cf5bd){logger[_0x44e3('0xe')](_0x44e3('0x17'),_0x39db2f);logger['debug'](_0x44e3('0x17'),_0x39db2f,JSON[_0x44e3('0x1d')](_0x4cf5bd));_0x12c205(_0x4cf5bd);})['catch'](function(_0x184c39){logger[_0x44e3('0x12')](_0x44e3('0x17'),_0x184c39[_0x44e3('0x14')],_0x39db2f);_0x1dc698(_0x426c83['error'](0x1f4,_0x184c39['message']));});});}; \ No newline at end of file +var _0xe6f3=['jayson/promise','client','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','body','options','raw','debug','CreateSquareMessage','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x392be3,_0xf1d603){var _0x1453b2=function(_0x5bdce8){while(--_0x5bdce8){_0x392be3['push'](_0x392be3['shift']());}};_0x1453b2(++_0xf1d603);}(_0xe6f3,0x171));var _0x3e6f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe6f3[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3e6f('0x0'));var util=require(_0x3e6f('0x1'));var moment=require(_0x3e6f('0x2'));var BPromise=require(_0x3e6f('0x3'));var rs=require(_0x3e6f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e6f('0x5'))['db'];var utils=require(_0x3e6f('0x6'));var logger=require(_0x3e6f('0x7'))('rpc');var config=require(_0x3e6f('0x8'));var jayson=require(_0x3e6f('0x9'));var client=jayson[_0x3e6f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x342771,_0x376dc7,_0x4f9e8d){return new BPromise(function(_0x5cee7d,_0xa3cee0){return client[_0x3e6f('0xb')](_0x342771,_0x4f9e8d)[_0x3e6f('0xc')](function(_0x2d17be){logger[_0x3e6f('0xd')](_0x3e6f('0xe'),_0x376dc7,'request\x20sent');logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x376dc7,_0x3e6f('0xf'),JSON[_0x3e6f('0x10')](_0x2d17be));if(_0x2d17be[_0x3e6f('0x11')]){if(_0x2d17be['error'][_0x3e6f('0x12')]===0x1f4){logger[_0x3e6f('0x11')](_0x3e6f('0xe'),_0x376dc7,_0x2d17be['error']['message']);return _0xa3cee0(_0x2d17be['error'][_0x3e6f('0x13')]);}logger[_0x3e6f('0x11')](_0x3e6f('0xe'),_0x376dc7,_0x2d17be['error'][_0x3e6f('0x13')]);return _0x5cee7d(_0x2d17be[_0x3e6f('0x11')][_0x3e6f('0x13')]);}else{logger[_0x3e6f('0xd')](_0x3e6f('0xe'),_0x376dc7,_0x3e6f('0xf'));_0x5cee7d(_0x2d17be[_0x3e6f('0x14')][_0x3e6f('0x13')]);}})[_0x3e6f('0x15')](function(_0x40170f){logger[_0x3e6f('0x11')](_0x3e6f('0xe'),_0x376dc7,_0x40170f);_0xa3cee0(_0x40170f);});});}exports['CreateSquareMessage']=function(_0xbc1ab3){var _0x4cb7bd=this;return new Promise(function(_0xb9c1a0,_0x54563e){return db['SquareMessage']['create'](_0xbc1ab3[_0x3e6f('0x16')],{'raw':_0xbc1ab3[_0x3e6f('0x17')]?_0xbc1ab3['options'][_0x3e6f('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x10ca60){logger[_0x3e6f('0xd')]('CreateSquareMessage',_0xbc1ab3);logger[_0x3e6f('0x19')]('CreateSquareMessage',_0xbc1ab3,JSON['stringify'](_0x10ca60));_0xb9c1a0(_0x10ca60);})[_0x3e6f('0x15')](function(_0x438c34){logger[_0x3e6f('0x11')](_0x3e6f('0x1a'),_0x438c34[_0x3e6f('0x13')],_0xbc1ab3);_0x54563e(_0x4cb7bd[_0x3e6f('0x11')](0x1f4,_0x438c34[_0x3e6f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 046da60..4b50bd2 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 _0x4627=['isAuthenticated','index','/:id','show','/:id/test','15s','test','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get'];(function(_0x3a73a0,_0x2fc398){var _0x3e1626=function(_0x5217bd){while(--_0x5217bd){_0x3a73a0['push'](_0x3a73a0['shift']());}};_0x3e1626(++_0x2fc398);}(_0x4627,0x115));var _0x7462=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x4627[_0x20589d];return _0x422de9;};'use strict';var multer=require(_0x7462('0x0'));var util=require(_0x7462('0x1'));var path=require(_0x7462('0x2'));var timeout=require(_0x7462('0x3'));var express=require(_0x7462('0x4'));var router=express[_0x7462('0x5')]();var auth=require(_0x7462('0x6'));var interaction=require(_0x7462('0x7'));var config=require(_0x7462('0x8'));var controller=require(_0x7462('0x9'));router[_0x7462('0xa')]('/',auth[_0x7462('0xb')](),controller[_0x7462('0xc')]);router['get'](_0x7462('0xd'),auth[_0x7462('0xb')](),controller[_0x7462('0xe')]);router[_0x7462('0xa')](_0x7462('0xf'),auth[_0x7462('0xb')](),timeout(_0x7462('0x10')),controller[_0x7462('0x11')]);router[_0x7462('0x12')]('/',auth[_0x7462('0xb')](),controller[_0x7462('0x13')]);router['put']('/:id',auth[_0x7462('0xb')](),controller[_0x7462('0x14')]);router[_0x7462('0x15')](_0x7462('0xd'),auth[_0x7462('0xb')](),controller[_0x7462('0x16')]);module[_0x7462('0x17')]=router; \ No newline at end of file +var _0x37f8=['destroy','util','path','connect-timeout','express','../../components/auth/service','index','get','/:id','isAuthenticated','show','/:id/test','15s','test','post','create','put','update','delete'];(function(_0x5a4989,_0x4f119f){var _0x40a3ac=function(_0x43f0fd){while(--_0x43f0fd){_0x5a4989['push'](_0x5a4989['shift']());}};_0x40a3ac(++_0x4f119f);}(_0x37f8,0xd2));var _0x837f=function(_0x523ebe,_0x78c93f){_0x523ebe=_0x523ebe-0x0;var _0x3d9156=_0x37f8[_0x523ebe];return _0x3d9156;};'use strict';var multer=require('multer');var util=require(_0x837f('0x0'));var path=require(_0x837f('0x1'));var timeout=require(_0x837f('0x2'));var express=require(_0x837f('0x3'));var router=express['Router']();var auth=require(_0x837f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x837f('0x5')]);router[_0x837f('0x6')](_0x837f('0x7'),auth[_0x837f('0x8')](),controller[_0x837f('0x9')]);router[_0x837f('0x6')](_0x837f('0xa'),auth[_0x837f('0x8')](),timeout(_0x837f('0xb')),controller[_0x837f('0xc')]);router[_0x837f('0xd')]('/',auth[_0x837f('0x8')](),controller[_0x837f('0xe')]);router[_0x837f('0xf')](_0x837f('0x7'),auth['isAuthenticated'](),controller[_0x837f('0x10')]);router[_0x837f('0x11')](_0x837f('0x7'),auth[_0x837f('0x8')](),controller[_0x837f('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 477a24c..ae85b99 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 _0x5c43=['name','STRING','sequelize'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x5c43,0xb9));var _0x35c4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5c43[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x35c4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x35c4('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0x35c4('0x2')]},'description':{'type':Sequelize[_0x35c4('0x2')]}}; \ No newline at end of file +var _0x9b50=['STRING','name','sequelize','exports'];(function(_0x147e73,_0x526aa2){var _0xe94f18=function(_0x25f894){while(--_0x25f894){_0x147e73['push'](_0x147e73['shift']());}};_0xe94f18(++_0x526aa2);}(_0x9b50,0x102));var _0x09b5=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9b50[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x09b5('0x0'));module[_0x09b5('0x1')]={'name':{'type':Sequelize[_0x09b5('0x2')],'unique':_0x09b5('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x09b5('0x2')]},'description':{'type':Sequelize[_0x09b5('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 87c8110..6d984df 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 _0xa9e0=['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','SquareOdbc','rows','catch','show','params','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','test','dsn','openSync','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(_0x42419d,_0x51f54b){var _0x36e92f=function(_0xb56a0a){while(--_0xb56a0a){_0x42419d['push'](_0x42419d['shift']());}};_0x36e92f(++_0x51f54b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var 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='ODBC';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['SquareOdbc'][_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['SquareOdbc']['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['SquareOdbc'][_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='ODBC';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['SquareOdbc'][_0x0a9e('0x42')]({'where':{'id':_0x161aa7['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x53d113,null))['then'](removeEntity(_0x53d113,null))[_0x0a9e('0x3e')](handleError(_0x53d113,null));};exports[_0x0a9e('0x4c')]=function(_0x439340,_0x53613a,_0x2f82da){var _0x1bf38a;return db['SquareOdbc']['find']({'where':{'id':_0x439340[_0x0a9e('0x40')]['id']},'attributes':['id',_0x0a9e('0x4d')]})['then'](handleEntityNotFound(_0x53613a,null))[_0x0a9e('0x1f')](function(_0x5ce9ac){if(_0x5ce9ac){var _0x211ef9=require('odbc')();_0x211ef9[_0x0a9e('0x4e')](_0x5ce9ac['dsn']);_0x211ef9['closeSync']();return _0x5ce9ac;}})['then'](respondWithResult(_0x53613a,null))[_0x0a9e('0x3e')](handleError(_0x53613a,null));}; \ No newline at end of file +var _0xa9e0=['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','SquareOdbc','rows','catch','show','params','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','test','dsn','openSync','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(_0x43eaba,_0x2b6077){var _0x44133e=function(_0x10f9a7){while(--_0x10f9a7){_0x43eaba['push'](_0x43eaba['shift']());}};_0x44133e(++_0x2b6077);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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='ODBC';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['SquareOdbc'][_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['SquareOdbc']['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['SquareOdbc'][_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='ODBC';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['SquareOdbc'][_0x0a9e('0x42')]({'where':{'id':_0x161aa7['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x53d113,null))['then'](removeEntity(_0x53d113,null))[_0x0a9e('0x3e')](handleError(_0x53d113,null));};exports[_0x0a9e('0x4c')]=function(_0x439340,_0x53613a,_0x2f82da){var _0x1bf38a;return db['SquareOdbc']['find']({'where':{'id':_0x439340[_0x0a9e('0x40')]['id']},'attributes':['id',_0x0a9e('0x4d')]})['then'](handleEntityNotFound(_0x53613a,null))[_0x0a9e('0x1f')](function(_0x5ce9ac){if(_0x5ce9ac){var _0x211ef9=require('odbc')();_0x211ef9[_0x0a9e('0x4e')](_0x5ce9ac['dsn']);_0x211ef9['closeSync']();return _0x5ce9ac;}})['then'](respondWithResult(_0x53613a,null))[_0x0a9e('0x3e')](handleError(_0x53613a,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index a94c21e..d24c760 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 _0x5ef9=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','square_odbc'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x5ef9,0x1e1));var _0x95ef=function(_0xce6f11,_0x3c3137){_0xce6f11=_0xce6f11-0x0;var _0x35b709=_0x5ef9[_0xce6f11];return _0x35b709;};'use strict';var _=require(_0x95ef('0x0'));var util=require(_0x95ef('0x1'));var logger=require(_0x95ef('0x2'))(_0x95ef('0x3'));var moment=require(_0x95ef('0x4'));var BPromise=require(_0x95ef('0x5'));var rp=require(_0x95ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x95ef('0x7'));var config=require(_0x95ef('0x8'));var attributes=require(_0x95ef('0x9'));module[_0x95ef('0xa')]=function(_0x26eb80,_0x2781e1){return _0x26eb80[_0x95ef('0xb')]('SquareOdbc',attributes,{'tableName':_0x95ef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb368=['request-promise','path','rimraf','../../config/environment','exports','define','SquareOdbc','square_odbc','util','../../config/logger','api','moment','bluebird'];(function(_0x2ef44b,_0x553359){var _0x2405b9=function(_0x278290){while(--_0x278290){_0x2ef44b['push'](_0x2ef44b['shift']());}};_0x2405b9(++_0x553359);}(_0xb368,0x70));var _0x8b36=function(_0x1b7915,_0x2d6a3f){_0x1b7915=_0x1b7915-0x0;var _0x480d41=_0xb368[_0x1b7915];return _0x480d41;};'use strict';var _=require('lodash');var util=require(_0x8b36('0x0'));var logger=require(_0x8b36('0x1'))(_0x8b36('0x2'));var moment=require(_0x8b36('0x3'));var BPromise=require(_0x8b36('0x4'));var rp=require(_0x8b36('0x5'));var fs=require('fs');var path=require(_0x8b36('0x6'));var rimraf=require(_0x8b36('0x7'));var config=require(_0x8b36('0x8'));var attributes=require('./squareOdbc.attributes');module[_0x8b36('0x9')]=function(_0x1bd412,_0x271ca6){return _0x1bd412[_0x8b36('0xa')](_0x8b36('0xb'),attributes,{'tableName':_0x8b36('0xc'),'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 9b40240..3252e84 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 _0xea8e=['options','raw','where','attributes','include','map','model','ShowSquareOdbc','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','SquareOdbc'];(function(_0x4bb782,_0x41ed02){var _0x244bf4=function(_0x1053ef){while(--_0x1053ef){_0x4bb782['push'](_0x4bb782['shift']());}};_0x244bf4(++_0x41ed02);}(_0xea8e,0x17f));var _0xeea8=function(_0x5527c3,_0x571434){_0x5527c3=_0x5527c3-0x0;var _0xed3601=_0xea8e[_0x5527c3];return _0xed3601;};'use strict';var _=require(_0xeea8('0x0'));var util=require(_0xeea8('0x1'));var moment=require(_0xeea8('0x2'));var BPromise=require(_0xeea8('0x3'));var rs=require(_0xeea8('0x4'));var fs=require('fs');var Redis=require(_0xeea8('0x5'));var db=require(_0xeea8('0x6'))['db'];var utils=require(_0xeea8('0x7'));var logger=require(_0xeea8('0x8'))(_0xeea8('0x9'));var config=require(_0xeea8('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xeea8('0xb')][_0xeea8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x51a1a8,_0x2a303b,_0x468aab){return new BPromise(function(_0x5b97c9,_0xd085a2){return client['request'](_0x51a1a8,_0x468aab)[_0xeea8('0xd')](function(_0x38eb9e){logger['info'](_0xeea8('0xe'),_0x2a303b,'request\x20sent');logger[_0xeea8('0xf')](_0xeea8('0x10'),_0x2a303b,_0xeea8('0x11'),JSON['stringify'](_0x38eb9e));if(_0x38eb9e[_0xeea8('0x12')]){if(_0x38eb9e[_0xeea8('0x12')][_0xeea8('0x13')]===0x1f4){logger['error'](_0xeea8('0xe'),_0x2a303b,_0x38eb9e[_0xeea8('0x12')][_0xeea8('0x14')]);return _0xd085a2(_0x38eb9e['error']['message']);}logger[_0xeea8('0x12')](_0xeea8('0xe'),_0x2a303b,_0x38eb9e['error'][_0xeea8('0x14')]);return _0x5b97c9(_0x38eb9e['error'][_0xeea8('0x14')]);}else{logger[_0xeea8('0x15')](_0xeea8('0xe'),_0x2a303b,'request\x20sent');_0x5b97c9(_0x38eb9e[_0xeea8('0x16')][_0xeea8('0x14')]);}})[_0xeea8('0x17')](function(_0x933ae7){logger[_0xeea8('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x2a303b,_0x933ae7);_0xd085a2(_0x933ae7);});});}exports['ShowSquareOdbc']=function(_0x10384){var _0x479db7=this;return new Promise(function(_0x5c982e,_0xfcf1d9){return db[_0xeea8('0x18')]['find']({'raw':_0x10384[_0xeea8('0x19')]?_0x10384[_0xeea8('0x19')][_0xeea8('0x1a')]===undefined?!![]:![]:!![],'where':_0x10384[_0xeea8('0x19')]?_0x10384[_0xeea8('0x19')][_0xeea8('0x1b')]||null:null,'attributes':_0x10384[_0xeea8('0x19')]?_0x10384[_0xeea8('0x19')][_0xeea8('0x1c')]||null:null,'include':_0x10384[_0xeea8('0x19')]?_0x10384[_0xeea8('0x19')][_0xeea8('0x1d')]?_[_0xeea8('0x1e')](_0x10384['options'][_0xeea8('0x1d')],function(_0x266e79){return{'model':db[_0x266e79[_0xeea8('0x1f')]],'as':_0x266e79['as'],'attributes':_0x266e79[_0xeea8('0x1c')],'include':_0x266e79[_0xeea8('0x1d')]?_[_0xeea8('0x1e')](_0x266e79['include'],function(_0x4a024b){return{'model':db[_0x4a024b['model']],'as':_0x4a024b['as'],'attributes':_0x4a024b[_0xeea8('0x1c')],'include':_0x4a024b[_0xeea8('0x1d')]?_[_0xeea8('0x1e')](_0x4a024b[_0xeea8('0x1d')],function(_0x3c336a){return{'model':db[_0x3c336a['model']],'as':_0x3c336a['as'],'attributes':_0x3c336a[_0xeea8('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ffaaf){logger[_0xeea8('0x15')](_0xeea8('0x20'),_0x10384);logger['debug']('ShowSquareOdbc',_0x10384,JSON[_0xeea8('0x21')](_0x2ffaaf));_0x5c982e(_0x2ffaaf);})['catch'](function(_0x344e92){logger[_0xeea8('0x12')](_0xeea8('0x20'),_0x344e92[_0xeea8('0x14')],_0x10384);_0xfcf1d9(_0x479db7[_0xeea8('0x12')](0x1f4,_0x344e92[_0xeea8('0x14')]));});});}; \ No newline at end of file +var _0x27c5=['include','model','map','info','catch','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','then','SquareOdbc,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes'];(function(_0x2b742f,_0x2d427d){var _0x353fbe=function(_0xdfcb02){while(--_0xdfcb02){_0x2b742f['push'](_0x2b742f['shift']());}};_0x353fbe(++_0x2d427d);}(_0x27c5,0xb3));var _0x527c=function(_0x24a7c9,_0x157c78){_0x24a7c9=_0x24a7c9-0x0;var _0x451a81=_0x27c5[_0x24a7c9];return _0x451a81;};'use strict';var _=require('lodash');var util=require(_0x527c('0x0'));var moment=require('moment');var BPromise=require(_0x527c('0x1'));var rs=require(_0x527c('0x2'));var fs=require('fs');var Redis=require(_0x527c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x527c('0x4'));var logger=require('../../config/logger')(_0x527c('0x5'));var config=require(_0x527c('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x527c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x58d4a5,_0x8e5abf,_0x3e5159){return new BPromise(function(_0x1ddb74,_0x1cb4b0){return client[_0x527c('0x8')](_0x58d4a5,_0x3e5159)[_0x527c('0x9')](function(_0x1dd448){logger['info'](_0x527c('0xa'),_0x8e5abf,'request\x20sent');logger[_0x527c('0xb')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x8e5abf,_0x527c('0xc'),JSON[_0x527c('0xd')](_0x1dd448));if(_0x1dd448[_0x527c('0xe')]){if(_0x1dd448[_0x527c('0xe')]['code']===0x1f4){logger['error'](_0x527c('0xa'),_0x8e5abf,_0x1dd448[_0x527c('0xe')][_0x527c('0xf')]);return _0x1cb4b0(_0x1dd448[_0x527c('0xe')][_0x527c('0xf')]);}logger[_0x527c('0xe')](_0x527c('0xa'),_0x8e5abf,_0x1dd448['error'][_0x527c('0xf')]);return _0x1ddb74(_0x1dd448[_0x527c('0xe')]['message']);}else{logger['info'](_0x527c('0xa'),_0x8e5abf,_0x527c('0xc'));_0x1ddb74(_0x1dd448[_0x527c('0x10')][_0x527c('0xf')]);}})['catch'](function(_0x4d741d){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x8e5abf,_0x4d741d);_0x1cb4b0(_0x4d741d);});});}exports[_0x527c('0x11')]=function(_0x42abcc){var _0xf9659e=this;return new Promise(function(_0x2ea316,_0x45c5f7){return db[_0x527c('0x12')][_0x527c('0x13')]({'raw':_0x42abcc[_0x527c('0x14')]?_0x42abcc[_0x527c('0x14')][_0x527c('0x15')]===undefined?!![]:![]:!![],'where':_0x42abcc['options']?_0x42abcc[_0x527c('0x14')][_0x527c('0x16')]||null:null,'attributes':_0x42abcc['options']?_0x42abcc[_0x527c('0x14')][_0x527c('0x17')]||null:null,'include':_0x42abcc[_0x527c('0x14')]?_0x42abcc['options'][_0x527c('0x18')]?_['map'](_0x42abcc[_0x527c('0x14')][_0x527c('0x18')],function(_0xc2b21e){return{'model':db[_0xc2b21e[_0x527c('0x19')]],'as':_0xc2b21e['as'],'attributes':_0xc2b21e[_0x527c('0x17')],'include':_0xc2b21e[_0x527c('0x18')]?_[_0x527c('0x1a')](_0xc2b21e['include'],function(_0x413a19){return{'model':db[_0x413a19[_0x527c('0x19')]],'as':_0x413a19['as'],'attributes':_0x413a19['attributes'],'include':_0x413a19[_0x527c('0x18')]?_[_0x527c('0x1a')](_0x413a19[_0x527c('0x18')],function(_0x4c94f2){return{'model':db[_0x4c94f2[_0x527c('0x19')]],'as':_0x4c94f2['as'],'attributes':_0x4c94f2[_0x527c('0x17')]};}):[]};}):[]};}):[]:[]})[_0x527c('0x9')](function(_0x1cb8f9){logger[_0x527c('0x1b')](_0x527c('0x11'),_0x42abcc);logger[_0x527c('0xb')](_0x527c('0x11'),_0x42abcc,JSON[_0x527c('0xd')](_0x1cb8f9));_0x2ea316(_0x1cb8f9);})[_0x527c('0x1c')](function(_0x381ab0){logger[_0x527c('0xe')](_0x527c('0x11'),_0x381ab0[_0x527c('0xf')],_0x42abcc);_0x45c5f7(_0xf9659e[_0x527c('0xe')](0x1f4,_0x381ab0[_0x527c('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 3d443df..dd7ade2 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 _0x8c81=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareProject.controller','get','isAuthenticated','index','show','/:id/users','getUsers','post','create','put','update','delete','/:id','destroy','removeUsers'];(function(_0x2d643c,_0x5b9204){var _0x17d037=function(_0xf7194b){while(--_0xf7194b){_0x2d643c['push'](_0x2d643c['shift']());}};_0x17d037(++_0x5b9204);}(_0x8c81,0x169));var _0x18c8=function(_0x18cf2b,_0x12bf8c){_0x18cf2b=_0x18cf2b-0x0;var _0x28de3f=_0x8c81[_0x18cf2b];return _0x28de3f;};'use strict';var multer=require(_0x18c8('0x0'));var util=require(_0x18c8('0x1'));var path=require(_0x18c8('0x2'));var timeout=require(_0x18c8('0x3'));var express=require(_0x18c8('0x4'));var router=express[_0x18c8('0x5')]();var auth=require(_0x18c8('0x6'));var interaction=require(_0x18c8('0x7'));var config=require('../../config/environment');var controller=require(_0x18c8('0x8'));router[_0x18c8('0x9')]('/',auth[_0x18c8('0xa')](),controller[_0x18c8('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x18c8('0xc')]);router[_0x18c8('0x9')](_0x18c8('0xd'),auth[_0x18c8('0xa')](),controller[_0x18c8('0xe')]);router[_0x18c8('0xf')]('/',auth[_0x18c8('0xa')](),controller[_0x18c8('0x10')]);router[_0x18c8('0xf')](_0x18c8('0xd'),auth[_0x18c8('0xa')](),controller['addUsers']);router[_0x18c8('0x11')]('/:id',auth[_0x18c8('0xa')](),controller[_0x18c8('0x12')]);router[_0x18c8('0x13')](_0x18c8('0x14'),auth[_0x18c8('0xa')](),controller[_0x18c8('0x15')]);router[_0x18c8('0x13')](_0x18c8('0xd'),auth[_0x18c8('0xa')](),controller[_0x18c8('0x16')]);module[_0x18c8('0x17')]=router; \ No newline at end of file +var _0xa81f=['isAuthenticated','show','get','/:id/users','getUsers','post','addUsers','update','delete','/:id','destroy','removeUsers','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller'];(function(_0x3e15e4,_0xc28af8){var _0x4bb92c=function(_0x23b1e4){while(--_0x23b1e4){_0x3e15e4['push'](_0x3e15e4['shift']());}};_0x4bb92c(++_0xc28af8);}(_0xa81f,0xf4));var _0xfa81=function(_0x3c2722,_0x1c4748){_0x3c2722=_0x3c2722-0x0;var _0x99c954=_0xa81f[_0x3c2722];return _0x99c954;};'use strict';var multer=require(_0xfa81('0x0'));var util=require(_0xfa81('0x1'));var path=require('path');var timeout=require(_0xfa81('0x2'));var express=require(_0xfa81('0x3'));var router=express['Router']();var auth=require(_0xfa81('0x4'));var interaction=require(_0xfa81('0x5'));var config=require(_0xfa81('0x6'));var controller=require(_0xfa81('0x7'));router['get']('/',auth[_0xfa81('0x8')](),controller['index']);router['get']('/:id',auth[_0xfa81('0x8')](),controller[_0xfa81('0x9')]);router[_0xfa81('0xa')](_0xfa81('0xb'),auth['isAuthenticated'](),controller[_0xfa81('0xc')]);router[_0xfa81('0xd')]('/',auth[_0xfa81('0x8')](),controller['create']);router[_0xfa81('0xd')](_0xfa81('0xb'),auth[_0xfa81('0x8')](),controller[_0xfa81('0xe')]);router['put']('/:id',auth[_0xfa81('0x8')](),controller[_0xfa81('0xf')]);router[_0xfa81('0x10')](_0xfa81('0x11'),auth[_0xfa81('0x8')](),controller[_0xfa81('0x12')]);router[_0xfa81('0x10')](_0xfa81('0xb'),auth['isAuthenticated'](),controller[_0xfa81('0x13')]);module[_0xfa81('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 1c64bdd..d10339e 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 _0xb242=['preproduction','utf8','production','toString','exports','STRING','name','TEXT','BLOB','long','getDataValue'];(function(_0x3ffd8b,_0x1f89b9){var _0x29d491=function(_0x2dac02){while(--_0x2dac02){_0x3ffd8b['push'](_0x3ffd8b['shift']());}};_0x29d491(++_0x1f89b9);}(_0xb242,0x1f3));var _0x2b24=function(_0x231dda,_0x5b04cc){_0x231dda=_0x231dda-0x0;var _0x3f88cb=_0xb242[_0x231dda];return _0x3f88cb;};'use strict';var Sequelize=require('sequelize');module[_0x2b24('0x0')]={'name':{'type':Sequelize[_0x2b24('0x1')],'unique':_0x2b24('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x2b24('0x1')]},'notes':{'type':Sequelize[_0x2b24('0x3')]},'preproduction':{'type':Sequelize[_0x2b24('0x4')](_0x2b24('0x5')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0x2b24('0x6')](_0x2b24('0x7'))['toString'](_0x2b24('0x8'));}}},'production':{'type':Sequelize[_0x2b24('0x4')](_0x2b24('0x5')),'get':function(){if(this['getDataValue'](_0x2b24('0x9'))){return this['getDataValue'](_0x2b24('0x9'))[_0x2b24('0xa')]('utf8');}}}}; \ No newline at end of file +var _0x90ec=['sequelize','exports','name','STRING','TEXT','BLOB','long','preproduction','getDataValue','utf8','production','toString'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0x90ec,0x1d4));var _0xc90e=function(_0x4af20c,_0x31dd5b){_0x4af20c=_0x4af20c-0x0;var _0x3e5504=_0x90ec[_0x4af20c];return _0x3e5504;};'use strict';var Sequelize=require(_0xc90e('0x0'));module[_0xc90e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc90e('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xc90e('0x3')]},'notes':{'type':Sequelize[_0xc90e('0x4')]},'preproduction':{'type':Sequelize[_0xc90e('0x5')](_0xc90e('0x6')),'get':function(){if(this['getDataValue'](_0xc90e('0x7'))){return this[_0xc90e('0x8')](_0xc90e('0x7'))['toString'](_0xc90e('0x9'));}}},'production':{'type':Sequelize['BLOB'](_0xc90e('0x6')),'get':function(){if(this[_0xc90e('0x8')]('production')){return this[_0xc90e('0x8')](_0xc90e('0xa'))[_0xc90e('0xb')](_0xc90e('0x9'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index df59dbc..6283963 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 _0xec3b=['update','then','destroy','get','SquareProjects','UserProfileResource','error','stack','model','keys','query','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','merge','map','type','key','VIRTUAL','filter','options','SquareProject','findAll','rows','catch','rawAttributes','include','find','body','user','role','UserProfileSection','userProfileId','create','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addUsers','omit','removeUsers','ids','isArray','userSquareProject:remove','emit','getUsers','length','order','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xec3b,0x1b1));var _0xbec3=function(_0x38cfc0,_0x1965e3){_0x38cfc0=_0x38cfc0-0x0;var _0x1080f0=_0xec3b[_0x38cfc0];return _0x1080f0;};'use strict';var pdf=require(_0xbec3('0x0'));var emlformat=require(_0xbec3('0x1'));var rimraf=require(_0xbec3('0x2'));var zipdir=require(_0xbec3('0x3'));var jsonpatch=require(_0xbec3('0x4'));var rp=require('request-promise');var moment=require(_0xbec3('0x5'));var BPromise=require(_0xbec3('0x6'));var Mustache=require(_0xbec3('0x7'));var util=require(_0xbec3('0x8'));var path=require(_0xbec3('0x9'));var sox=require(_0xbec3('0xa'));var csv=require('to-csv');var ejs=require(_0xbec3('0xb'));var fs=require('fs');var _=require(_0xbec3('0xc'));var squel=require(_0xbec3('0xd'));var crypto=require(_0xbec3('0xe'));var jsforce=require(_0xbec3('0xf'));var deskjs=require(_0xbec3('0x10'));var toCsv=require('to-csv');var querystring=require(_0xbec3('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbec3('0x12'));var qs=require(_0xbec3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbec3('0x14'))(_0xbec3('0x15'));var utils=require(_0xbec3('0x16'));var config=require(_0xbec3('0x17'));var db=require(_0xbec3('0x18'))['db'];config[_0xbec3('0x19')]=_['defaults'](config[_0xbec3('0x19')],{'host':_0xbec3('0x1a'),'port':0x18eb});var socket=require(_0xbec3('0x1b'))(new Redis(config[_0xbec3('0x19')]));require(_0xbec3('0x1c'))[_0xbec3('0x1d')](socket);function respondWithStatusCode(_0x8c45ef,_0x177e78){_0x177e78=_0x177e78||0xcc;return function(_0x38a900){if(_0x38a900){return _0x8c45ef[_0xbec3('0x1e')](_0x177e78);}return _0x8c45ef['status'](_0x177e78)[_0xbec3('0x1f')]();};}function respondWithResult(_0x1861e2,_0x1635ed){_0x1635ed=_0x1635ed||0xc8;return function(_0x5c9551){if(_0x5c9551){return _0x1861e2[_0xbec3('0x20')](_0x1635ed)[_0xbec3('0x21')](_0x5c9551);}};}function respondWithFilteredResult(_0x36ad6a,_0x13e957){return function(_0x3b9629){if(_0x3b9629){var _0x4fe02d=_0x3b9629[_0xbec3('0x22')],_0xfc8c69=_0x13e957[_0xbec3('0x23')],_0x41a1ad=_0x13e957[_0xbec3('0x23')]+_0x13e957[_0xbec3('0x24')],_0x588bac;if(_0x41a1ad>=_0x4fe02d){_0x41a1ad=_0x4fe02d;_0x588bac=0xc8;}else{_0x588bac=0xce;}_0x36ad6a[_0xbec3('0x20')](_0x588bac);return _0x36ad6a[_0xbec3('0x25')](_0xbec3('0x26'),_0xfc8c69+'-'+_0x41a1ad+'/'+_0x4fe02d)[_0xbec3('0x21')](_0x3b9629);}return null;};}function patchUpdates(_0x341d96){return function(_0x544f66){try{jsonpatch[_0xbec3('0x27')](_0x544f66,_0x341d96,!![]);}catch(_0x48f48e){return BPromise[_0xbec3('0x28')](_0x48f48e);}return _0x544f66[_0xbec3('0x29')]();};}function saveUpdates(_0x553ca1,_0x36fe47){return function(_0x321227){if(_0x321227){return _0x321227[_0xbec3('0x2a')](_0x553ca1)[_0xbec3('0x2b')](function(_0x74ac27){return _0x74ac27;});}return null;};}function removeEntity(_0x3f4d2f,_0x1a471e){return function(_0x3f382d){if(_0x3f382d){return _0x3f382d[_0xbec3('0x2c')]()[_0xbec3('0x2b')](function(){var _0x4361a4=_0x3f382d[_0xbec3('0x2d')]({'plain':!![]});var _0x4b0776=_0xbec3('0x2e');return db[_0xbec3('0x2f')][_0xbec3('0x2c')]({'where':{'type':_0x4b0776,'resourceId':_0x4361a4['id']}})[_0xbec3('0x2b')](function(){return _0x3f382d;});})[_0xbec3('0x2b')](function(){_0x3f4d2f[_0xbec3('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f33fa,_0x4757d1){return function(_0x57bc42){if(!_0x57bc42){_0x3f33fa['sendStatus'](0x194);}return _0x57bc42;};}function handleError(_0x195406,_0x85d23){_0x85d23=_0x85d23||0x1f4;return function(_0x2b6e73){logger[_0xbec3('0x30')](_0x2b6e73[_0xbec3('0x31')]);if(_0x2b6e73['name']){delete _0x2b6e73['name'];}_0x195406[_0xbec3('0x20')](_0x85d23)['send'](_0x2b6e73);};}exports['index']=function(_0xa812c4,_0x5a793f){var _0x8d17cd={},_0x625675={},_0x316aee={'count':0x0,'rows':[]};var _0x566eda=db['SquareProject']['rawAttributes'];_0x625675[_0xbec3('0x32')]=_[_0xbec3('0x33')](_0x566eda);_0x625675[_0xbec3('0x34')]=_['keys'](_0xa812c4[_0xbec3('0x34')]);_0x625675['filters']=_[_0xbec3('0x35')](_0x625675[_0xbec3('0x32')],_0x625675['query']);_0x8d17cd[_0xbec3('0x36')]=_[_0xbec3('0x35')](_0x625675[_0xbec3('0x32')],qs[_0xbec3('0x37')](_0xa812c4[_0xbec3('0x34')][_0xbec3('0x37')]));_0x8d17cd[_0xbec3('0x36')]=_0x8d17cd[_0xbec3('0x36')]['length']?_0x8d17cd['attributes']:_0x625675[_0xbec3('0x32')];if(!_0xa812c4[_0xbec3('0x34')][_0xbec3('0x38')]('nolimit')){_0x8d17cd[_0xbec3('0x24')]=qs[_0xbec3('0x24')](_0xa812c4[_0xbec3('0x34')][_0xbec3('0x24')]);_0x8d17cd[_0xbec3('0x23')]=qs[_0xbec3('0x23')](_0xa812c4[_0xbec3('0x34')][_0xbec3('0x23')]);}_0x8d17cd['order']=qs[_0xbec3('0x39')](_0xa812c4[_0xbec3('0x34')][_0xbec3('0x39')]);_0x8d17cd[_0xbec3('0x3a')]=qs[_0xbec3('0x3b')](_[_0xbec3('0x3c')](_0xa812c4[_0xbec3('0x34')],_0x625675['filters']));if(_0xa812c4[_0xbec3('0x34')]['filter']){_0x8d17cd['where']=_[_0xbec3('0x3d')](_0x8d17cd[_0xbec3('0x3a')],{'$or':_[_0xbec3('0x3e')](_0x566eda,function(_0x72a8e6){if(_0x72a8e6[_0xbec3('0x3f')][_0xbec3('0x40')]!==_0xbec3('0x41')){var _0x98c0ba={};_0x98c0ba[_0x72a8e6['field']]={'$like':'%'+_0xa812c4[_0xbec3('0x34')][_0xbec3('0x42')]+'%'};return _0x98c0ba;}})});}_0x8d17cd=_[_0xbec3('0x3d')]({},_0x8d17cd,_0xa812c4[_0xbec3('0x43')]);var _0x48e748={'where':_0x8d17cd[_0xbec3('0x3a')]};return db[_0xbec3('0x44')][_0xbec3('0x22')](_0x48e748)[_0xbec3('0x2b')](function(_0x109afa){_0x316aee[_0xbec3('0x22')]=_0x109afa;if(_0xa812c4[_0xbec3('0x34')]['includeAll']){_0x8d17cd['include']=[{'all':!![]}];}return db[_0xbec3('0x44')][_0xbec3('0x45')](_0x8d17cd);})[_0xbec3('0x2b')](function(_0x1d8a46){_0x316aee[_0xbec3('0x46')]=_0x1d8a46;return _0x316aee;})['then'](respondWithFilteredResult(_0x5a793f,_0x8d17cd))[_0xbec3('0x47')](handleError(_0x5a793f,null));};exports['show']=function(_0x3b7a9d,_0x2bf401){var _0x1dae42={'raw':![],'where':{'id':_0x3b7a9d['params']['id']}},_0x2563e2={};_0x2563e2['model']=_['keys'](db[_0xbec3('0x44')][_0xbec3('0x48')]);_0x2563e2[_0xbec3('0x34')]=_[_0xbec3('0x33')](_0x3b7a9d[_0xbec3('0x34')]);_0x2563e2[_0xbec3('0x3b')]=_[_0xbec3('0x35')](_0x2563e2['model'],_0x2563e2['query']);_0x1dae42[_0xbec3('0x36')]=_[_0xbec3('0x35')](_0x2563e2['model'],qs[_0xbec3('0x37')](_0x3b7a9d[_0xbec3('0x34')]['fields']));_0x1dae42[_0xbec3('0x36')]=_0x1dae42['attributes']['length']?_0x1dae42['attributes']:_0x2563e2[_0xbec3('0x32')];if(_0x3b7a9d[_0xbec3('0x34')]['includeAll']){_0x1dae42[_0xbec3('0x49')]=[{'all':!![]}];}_0x1dae42=_[_0xbec3('0x3d')]({},_0x1dae42,_0x3b7a9d[_0xbec3('0x43')]);return db[_0xbec3('0x44')][_0xbec3('0x4a')](_0x1dae42)[_0xbec3('0x2b')](handleEntityNotFound(_0x2bf401,null))[_0xbec3('0x2b')](respondWithResult(_0x2bf401,null))['catch'](handleError(_0x2bf401,null));};exports['create']=function(_0x102c21,_0x415323){return db[_0xbec3('0x44')]['create'](_0x102c21[_0xbec3('0x4b')],{})[_0xbec3('0x2b')](function(_0x4297e4){var _0x5db403=_0x102c21[_0xbec3('0x4c')][_0xbec3('0x2d')]({'plain':!![]});if(!_0x5db403)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5db403[_0xbec3('0x4d')]===_0xbec3('0x4c')){var _0xccabf=_0x4297e4[_0xbec3('0x2d')]({'plain':!![]});var _0x263634=_0xbec3('0x2e');return db[_0xbec3('0x4e')][_0xbec3('0x4a')]({'where':{'name':_0x263634,'userProfileId':_0x5db403[_0xbec3('0x4f')]},'raw':!![]})[_0xbec3('0x2b')](function(_0x22a9a4){if(_0x22a9a4&&_0x22a9a4['autoAssociation']===0x0){return db['UserProfileResource'][_0xbec3('0x50')]({'name':_0xccabf[_0xbec3('0x51')],'resourceId':_0xccabf['id'],'type':_0x22a9a4[_0xbec3('0x51')],'sectionId':_0x22a9a4['id']},{})['then'](function(){return _0x4297e4;});}else{return _0x4297e4;}})[_0xbec3('0x47')](function(_0x2e9bf8){logger[_0xbec3('0x30')](_0xbec3('0x52'),_0x2e9bf8);throw _0x2e9bf8;});}return _0x4297e4;})[_0xbec3('0x2b')](respondWithResult(_0x415323,0xc9))[_0xbec3('0x47')](handleError(_0x415323,null));};exports[_0xbec3('0x2a')]=function(_0x4480d6,_0x27e106){if(_0x4480d6[_0xbec3('0x4b')]['id']){delete _0x4480d6['body']['id'];}return db[_0xbec3('0x44')][_0xbec3('0x4a')]({'where':{'id':_0x4480d6[_0xbec3('0x53')]['id']}})['then'](handleEntityNotFound(_0x27e106,null))['then'](saveUpdates(_0x4480d6[_0xbec3('0x4b')],null))[_0xbec3('0x2b')](respondWithResult(_0x27e106,null))[_0xbec3('0x47')](handleError(_0x27e106,null));};exports['destroy']=function(_0x23a06f,_0x182359){return db['SquareProject']['find']({'where':{'id':_0x23a06f[_0xbec3('0x53')]['id']}})[_0xbec3('0x2b')](handleEntityNotFound(_0x182359,null))[_0xbec3('0x2b')](removeEntity(_0x182359,null))[_0xbec3('0x47')](handleError(_0x182359,null));};exports[_0xbec3('0x54')]=function(_0x4111ae,_0x3b1bac,_0xb01580){return db[_0xbec3('0x44')][_0xbec3('0x4a')]({'where':{'id':_0x4111ae[_0xbec3('0x53')]['id']}})['then'](handleEntityNotFound(_0x3b1bac,null))[_0xbec3('0x2b')](function(_0x4461e3){if(_0x4461e3){return _0x4461e3[_0xbec3('0x54')](_0x4111ae[_0xbec3('0x4b')]['ids'],_[_0xbec3('0x55')](_0x4111ae['body'],['ids','id'])||{});}})[_0xbec3('0x2b')](respondWithResult(_0x3b1bac,null))['catch'](handleError(_0x3b1bac,null));};exports['removeUsers']=function(_0x2b4518,_0x548116,_0x389179){return db['SquareProject'][_0xbec3('0x4a')]({'where':{'id':_0x2b4518[_0xbec3('0x53')]['id']}})[_0xbec3('0x2b')](handleEntityNotFound(_0x548116,null))['then'](function(_0x1f88c9){if(_0x1f88c9){return _0x1f88c9[_0xbec3('0x56')](_0x2b4518['query'][_0xbec3('0x57')])[_0xbec3('0x2b')](function(){if(_[_0xbec3('0x58')](_0x2b4518['query'][_0xbec3('0x57')])){for(var _0x3b90e4=0x0;_0x3b90e4<_0x2b4518[_0xbec3('0x34')]['ids']['length'];_0x3b90e4+=0x1){socket['emit'](_0xbec3('0x59'),{'UserId':Number(_0x2b4518[_0xbec3('0x34')]['ids'][_0x3b90e4]),'SquareProjectId':Number(_0x2b4518[_0xbec3('0x53')]['id'])});}}else{socket[_0xbec3('0x5a')](_0xbec3('0x59'),{'UserId':Number(_0x2b4518['query'][_0xbec3('0x57')]),'SquareProjectId':Number(_0x2b4518[_0xbec3('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x548116,null))[_0xbec3('0x47')](handleError(_0x548116,null));};exports[_0xbec3('0x5b')]=function(_0x2b97b4,_0x47aba3,_0x47a461){var _0x213874={};var _0x2ff466={};var _0x54adee;var _0x47a564;return db[_0xbec3('0x44')]['findOne']({'where':{'id':_0x2b97b4[_0xbec3('0x53')]['id']}})[_0xbec3('0x2b')](handleEntityNotFound(_0x47aba3,null))[_0xbec3('0x2b')](function(_0x520c38){if(_0x520c38){_0x54adee=_0x520c38;_0x2ff466[_0xbec3('0x32')]=_[_0xbec3('0x33')](db['User'][_0xbec3('0x48')]);_0x2ff466['query']=_['keys'](_0x2b97b4[_0xbec3('0x34')]);_0x2ff466[_0xbec3('0x3b')]=_[_0xbec3('0x35')](_0x2ff466['model'],_0x2ff466[_0xbec3('0x34')]);_0x213874['attributes']=_[_0xbec3('0x35')](_0x2ff466[_0xbec3('0x32')],qs['fields'](_0x2b97b4[_0xbec3('0x34')][_0xbec3('0x37')]));_0x213874['attributes']=_0x213874[_0xbec3('0x36')][_0xbec3('0x5c')]?_0x213874[_0xbec3('0x36')]:_0x2ff466[_0xbec3('0x32')];_0x213874[_0xbec3('0x5d')]=qs[_0xbec3('0x39')](_0x2b97b4['query'][_0xbec3('0x39')]);_0x213874['where']=qs[_0xbec3('0x3b')](_[_0xbec3('0x3c')](_0x2b97b4['query'],_0x2ff466[_0xbec3('0x3b')]));if(_0x2b97b4['query'][_0xbec3('0x42')]){_0x213874[_0xbec3('0x3a')]=_['merge'](_0x213874[_0xbec3('0x3a')],{'$or':_[_0xbec3('0x3e')](_0x213874[_0xbec3('0x36')],function(_0x3e319d){var _0x56c09e={};_0x56c09e[_0x3e319d]={'$like':'%'+_0x2b97b4[_0xbec3('0x34')][_0xbec3('0x42')]+'%'};return _0x56c09e;})});}_0x213874=_[_0xbec3('0x3d')]({},_0x213874,_0x2b97b4[_0xbec3('0x43')]);return _0x54adee[_0xbec3('0x5b')](_0x213874);}})[_0xbec3('0x2b')](function(_0xff27bf){if(_0xff27bf){_0x47a564=_0xff27bf[_0xbec3('0x5c')];if(!_0x2b97b4['query']['hasOwnProperty'](_0xbec3('0x5e'))){_0x213874[_0xbec3('0x24')]=qs[_0xbec3('0x24')](_0x2b97b4[_0xbec3('0x34')][_0xbec3('0x24')]);_0x213874[_0xbec3('0x23')]=qs[_0xbec3('0x23')](_0x2b97b4[_0xbec3('0x34')][_0xbec3('0x23')]);}return _0x54adee[_0xbec3('0x5b')](_0x213874);}})[_0xbec3('0x2b')](function(_0x5f480d){if(_0x5f480d){return _0x5f480d?{'count':_0x47a564,'rows':_0x5f480d}:null;}})[_0xbec3('0x2b')](respondWithResult(_0x47aba3,null))[_0xbec3('0x47')](handleError(_0x47aba3,null));}; \ No newline at end of file +var _0x5be8=['update','then','get','UserProfileResource','destroy','stack','name','send','index','rawAttributes','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','map','type','VIRTUAL','field','merge','options','count','includeAll','rows','show','model','SquareProject','include','find','catch','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SquareProjects','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','json','offset','limit','status','Content-Range','reject','save'];(function(_0x14442e,_0x5bdef3){var _0x357fd8=function(_0x3157d8){while(--_0x3157d8){_0x14442e['push'](_0x14442e['shift']());}};_0x357fd8(++_0x5bdef3);}(_0x5be8,0x15b));var _0x85be=function(_0x59507e,_0x271d3a){_0x59507e=_0x59507e-0x0;var _0x3094e7=_0x5be8[_0x59507e];return _0x3094e7;};'use strict';var pdf=require(_0x85be('0x0'));var emlformat=require(_0x85be('0x1'));var rimraf=require(_0x85be('0x2'));var zipdir=require(_0x85be('0x3'));var jsonpatch=require(_0x85be('0x4'));var rp=require(_0x85be('0x5'));var moment=require('moment');var BPromise=require(_0x85be('0x6'));var Mustache=require(_0x85be('0x7'));var util=require(_0x85be('0x8'));var path=require(_0x85be('0x9'));var sox=require(_0x85be('0xa'));var csv=require(_0x85be('0xb'));var ejs=require(_0x85be('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x85be('0xd'));var deskjs=require(_0x85be('0xe'));var toCsv=require(_0x85be('0xb'));var querystring=require(_0x85be('0xf'));var Papa=require(_0x85be('0x10'));var Redis=require(_0x85be('0x11'));var authService=require(_0x85be('0x12'));var qs=require(_0x85be('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x85be('0x14'))('api');var utils=require(_0x85be('0x15'));var config=require(_0x85be('0x16'));var db=require(_0x85be('0x17'))['db'];config[_0x85be('0x18')]=_[_0x85be('0x19')](config['redis'],{'host':_0x85be('0x1a'),'port':0x18eb});var socket=require(_0x85be('0x1b'))(new Redis(config[_0x85be('0x18')]));require('./squareProject.socket')[_0x85be('0x1c')](socket);function respondWithStatusCode(_0x3b3731,_0x5e89f8){_0x5e89f8=_0x5e89f8||0xcc;return function(_0x2e51f2){if(_0x2e51f2){return _0x3b3731[_0x85be('0x1d')](_0x5e89f8);}return _0x3b3731['status'](_0x5e89f8)['end']();};}function respondWithResult(_0x3b5538,_0x1034f5){_0x1034f5=_0x1034f5||0xc8;return function(_0x24df08){if(_0x24df08){return _0x3b5538['status'](_0x1034f5)[_0x85be('0x1e')](_0x24df08);}};}function respondWithFilteredResult(_0x5cbcf8,_0x15eb26){return function(_0x54ce09){if(_0x54ce09){var _0x2c6d2b=_0x54ce09['count'],_0x53c389=_0x15eb26[_0x85be('0x1f')],_0x5ec978=_0x15eb26['offset']+_0x15eb26[_0x85be('0x20')],_0x3cf809;if(_0x5ec978>=_0x2c6d2b){_0x5ec978=_0x2c6d2b;_0x3cf809=0xc8;}else{_0x3cf809=0xce;}_0x5cbcf8[_0x85be('0x21')](_0x3cf809);return _0x5cbcf8['set'](_0x85be('0x22'),_0x53c389+'-'+_0x5ec978+'/'+_0x2c6d2b)[_0x85be('0x1e')](_0x54ce09);}return null;};}function patchUpdates(_0x2987a3){return function(_0x4e78e5){try{jsonpatch['apply'](_0x4e78e5,_0x2987a3,!![]);}catch(_0x320ef1){return BPromise[_0x85be('0x23')](_0x320ef1);}return _0x4e78e5[_0x85be('0x24')]();};}function saveUpdates(_0x286567,_0x56dd55){return function(_0x4ed511){if(_0x4ed511){return _0x4ed511[_0x85be('0x25')](_0x286567)[_0x85be('0x26')](function(_0x31f06e){return _0x31f06e;});}return null;};}function removeEntity(_0x5988ba,_0x59f643){return function(_0x27b1e8){if(_0x27b1e8){return _0x27b1e8['destroy']()['then'](function(){var _0x38b5a3=_0x27b1e8[_0x85be('0x27')]({'plain':!![]});var _0x22e1c7='SquareProjects';return db[_0x85be('0x28')][_0x85be('0x29')]({'where':{'type':_0x22e1c7,'resourceId':_0x38b5a3['id']}})['then'](function(){return _0x27b1e8;});})[_0x85be('0x26')](function(){_0x5988ba[_0x85be('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33e735,_0x4e51fc){return function(_0x1198e0){if(!_0x1198e0){_0x33e735[_0x85be('0x1d')](0x194);}return _0x1198e0;};}function handleError(_0x15d9f8,_0x4c31b7){_0x4c31b7=_0x4c31b7||0x1f4;return function(_0x446057){logger['error'](_0x446057[_0x85be('0x2a')]);if(_0x446057[_0x85be('0x2b')]){delete _0x446057[_0x85be('0x2b')];}_0x15d9f8[_0x85be('0x21')](_0x4c31b7)[_0x85be('0x2c')](_0x446057);};}exports[_0x85be('0x2d')]=function(_0x37b358,_0x243903){var _0x1742d9={},_0x54141d={},_0x3a9bf2={'count':0x0,'rows':[]};var _0x4f07c8=db['SquareProject'][_0x85be('0x2e')];_0x54141d['model']=_[_0x85be('0x2f')](_0x4f07c8);_0x54141d['query']=_[_0x85be('0x2f')](_0x37b358[_0x85be('0x30')]);_0x54141d[_0x85be('0x31')]=_[_0x85be('0x32')](_0x54141d['model'],_0x54141d[_0x85be('0x30')]);_0x1742d9[_0x85be('0x33')]=_['intersection'](_0x54141d['model'],qs[_0x85be('0x34')](_0x37b358['query'][_0x85be('0x34')]));_0x1742d9[_0x85be('0x33')]=_0x1742d9[_0x85be('0x33')][_0x85be('0x35')]?_0x1742d9[_0x85be('0x33')]:_0x54141d['model'];if(!_0x37b358[_0x85be('0x30')][_0x85be('0x36')]('nolimit')){_0x1742d9[_0x85be('0x20')]=qs[_0x85be('0x20')](_0x37b358[_0x85be('0x30')][_0x85be('0x20')]);_0x1742d9[_0x85be('0x1f')]=qs[_0x85be('0x1f')](_0x37b358[_0x85be('0x30')][_0x85be('0x1f')]);}_0x1742d9[_0x85be('0x37')]=qs[_0x85be('0x38')](_0x37b358[_0x85be('0x30')]['sort']);_0x1742d9['where']=qs[_0x85be('0x31')](_[_0x85be('0x39')](_0x37b358[_0x85be('0x30')],_0x54141d[_0x85be('0x31')]));if(_0x37b358[_0x85be('0x30')][_0x85be('0x3a')]){_0x1742d9[_0x85be('0x3b')]=_['merge'](_0x1742d9[_0x85be('0x3b')],{'$or':_[_0x85be('0x3c')](_0x4f07c8,function(_0x591161){if(_0x591161[_0x85be('0x3d')]['key']!==_0x85be('0x3e')){var _0x2da7be={};_0x2da7be[_0x591161[_0x85be('0x3f')]]={'$like':'%'+_0x37b358[_0x85be('0x30')][_0x85be('0x3a')]+'%'};return _0x2da7be;}})});}_0x1742d9=_[_0x85be('0x40')]({},_0x1742d9,_0x37b358[_0x85be('0x41')]);var _0x5089af={'where':_0x1742d9[_0x85be('0x3b')]};return db['SquareProject']['count'](_0x5089af)['then'](function(_0x4c7662){_0x3a9bf2[_0x85be('0x42')]=_0x4c7662;if(_0x37b358[_0x85be('0x30')][_0x85be('0x43')]){_0x1742d9['include']=[{'all':!![]}];}return db['SquareProject']['findAll'](_0x1742d9);})['then'](function(_0x7dd072){_0x3a9bf2[_0x85be('0x44')]=_0x7dd072;return _0x3a9bf2;})[_0x85be('0x26')](respondWithFilteredResult(_0x243903,_0x1742d9))['catch'](handleError(_0x243903,null));};exports[_0x85be('0x45')]=function(_0x10b0c4,_0x3bc7f){var _0x57e70e={'raw':![],'where':{'id':_0x10b0c4['params']['id']}},_0x40a4bd={};_0x40a4bd[_0x85be('0x46')]=_['keys'](db[_0x85be('0x47')][_0x85be('0x2e')]);_0x40a4bd[_0x85be('0x30')]=_[_0x85be('0x2f')](_0x10b0c4[_0x85be('0x30')]);_0x40a4bd[_0x85be('0x31')]=_[_0x85be('0x32')](_0x40a4bd['model'],_0x40a4bd[_0x85be('0x30')]);_0x57e70e[_0x85be('0x33')]=_['intersection'](_0x40a4bd[_0x85be('0x46')],qs[_0x85be('0x34')](_0x10b0c4[_0x85be('0x30')][_0x85be('0x34')]));_0x57e70e[_0x85be('0x33')]=_0x57e70e[_0x85be('0x33')][_0x85be('0x35')]?_0x57e70e[_0x85be('0x33')]:_0x40a4bd[_0x85be('0x46')];if(_0x10b0c4['query']['includeAll']){_0x57e70e[_0x85be('0x48')]=[{'all':!![]}];}_0x57e70e=_[_0x85be('0x40')]({},_0x57e70e,_0x10b0c4[_0x85be('0x41')]);return db['SquareProject'][_0x85be('0x49')](_0x57e70e)[_0x85be('0x26')](handleEntityNotFound(_0x3bc7f,null))[_0x85be('0x26')](respondWithResult(_0x3bc7f,null))[_0x85be('0x4a')](handleError(_0x3bc7f,null));};exports['create']=function(_0x149757,_0x107fcb){return db[_0x85be('0x47')]['create'](_0x149757['body'],{})['then'](function(_0x7fc06b){var _0x106b7c=_0x149757[_0x85be('0x4b')][_0x85be('0x27')]({'plain':!![]});if(!_0x106b7c)throw new Error(_0x85be('0x4c'));if(_0x106b7c['role']===_0x85be('0x4b')){var _0x320b84=_0x7fc06b[_0x85be('0x27')]({'plain':!![]});var _0x467a40=_0x85be('0x4d');return db[_0x85be('0x4e')][_0x85be('0x49')]({'where':{'name':_0x467a40,'userProfileId':_0x106b7c[_0x85be('0x4f')]},'raw':!![]})['then'](function(_0x46856a){if(_0x46856a&&_0x46856a[_0x85be('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x320b84['name'],'resourceId':_0x320b84['id'],'type':_0x46856a[_0x85be('0x2b')],'sectionId':_0x46856a['id']},{})['then'](function(){return _0x7fc06b;});}else{return _0x7fc06b;}})['catch'](function(_0x3e80e1){logger[_0x85be('0x51')](_0x85be('0x52'),_0x3e80e1);throw _0x3e80e1;});}return _0x7fc06b;})[_0x85be('0x26')](respondWithResult(_0x107fcb,0xc9))[_0x85be('0x4a')](handleError(_0x107fcb,null));};exports[_0x85be('0x25')]=function(_0x1beb4c,_0x2644b7){if(_0x1beb4c['body']['id']){delete _0x1beb4c['body']['id'];}return db[_0x85be('0x47')][_0x85be('0x49')]({'where':{'id':_0x1beb4c['params']['id']}})[_0x85be('0x26')](handleEntityNotFound(_0x2644b7,null))[_0x85be('0x26')](saveUpdates(_0x1beb4c[_0x85be('0x53')],null))[_0x85be('0x26')](respondWithResult(_0x2644b7,null))[_0x85be('0x4a')](handleError(_0x2644b7,null));};exports['destroy']=function(_0x5299e1,_0x1fdf64){return db[_0x85be('0x47')][_0x85be('0x49')]({'where':{'id':_0x5299e1[_0x85be('0x54')]['id']}})[_0x85be('0x26')](handleEntityNotFound(_0x1fdf64,null))[_0x85be('0x26')](removeEntity(_0x1fdf64,null))['catch'](handleError(_0x1fdf64,null));};exports['addUsers']=function(_0x194853,_0x567742,_0x36f5e2){return db['SquareProject'][_0x85be('0x49')]({'where':{'id':_0x194853[_0x85be('0x54')]['id']}})['then'](handleEntityNotFound(_0x567742,null))['then'](function(_0x139cf9){if(_0x139cf9){return _0x139cf9[_0x85be('0x55')](_0x194853[_0x85be('0x53')][_0x85be('0x56')],_[_0x85be('0x57')](_0x194853['body'],[_0x85be('0x56'),'id'])||{});}})['then'](respondWithResult(_0x567742,null))[_0x85be('0x4a')](handleError(_0x567742,null));};exports[_0x85be('0x58')]=function(_0x4612cd,_0x295334,_0xae1ee6){return db[_0x85be('0x47')][_0x85be('0x49')]({'where':{'id':_0x4612cd[_0x85be('0x54')]['id']}})[_0x85be('0x26')](handleEntityNotFound(_0x295334,null))['then'](function(_0x34eec9){if(_0x34eec9){return _0x34eec9[_0x85be('0x58')](_0x4612cd[_0x85be('0x30')]['ids'])['then'](function(){if(_[_0x85be('0x59')](_0x4612cd[_0x85be('0x30')][_0x85be('0x56')])){for(var _0x3ae1e3=0x0;_0x3ae1e3<_0x4612cd[_0x85be('0x30')][_0x85be('0x56')][_0x85be('0x35')];_0x3ae1e3+=0x1){socket[_0x85be('0x5a')](_0x85be('0x5b'),{'UserId':Number(_0x4612cd[_0x85be('0x30')][_0x85be('0x56')][_0x3ae1e3]),'SquareProjectId':Number(_0x4612cd[_0x85be('0x54')]['id'])});}}else{socket[_0x85be('0x5a')](_0x85be('0x5b'),{'UserId':Number(_0x4612cd['query'][_0x85be('0x56')]),'SquareProjectId':Number(_0x4612cd['params']['id'])});}});}})[_0x85be('0x26')](respondWithStatusCode(_0x295334,null))[_0x85be('0x4a')](handleError(_0x295334,null));};exports[_0x85be('0x5c')]=function(_0x593684,_0x988c16,_0x1c75ed){var _0x2ddbdc={};var _0x21fe70={};var _0x6b4298;var _0x156f5a;return db['SquareProject'][_0x85be('0x5d')]({'where':{'id':_0x593684['params']['id']}})[_0x85be('0x26')](handleEntityNotFound(_0x988c16,null))['then'](function(_0x335dba){if(_0x335dba){_0x6b4298=_0x335dba;_0x21fe70[_0x85be('0x46')]=_[_0x85be('0x2f')](db[_0x85be('0x5e')]['rawAttributes']);_0x21fe70['query']=_[_0x85be('0x2f')](_0x593684['query']);_0x21fe70[_0x85be('0x31')]=_['intersection'](_0x21fe70[_0x85be('0x46')],_0x21fe70['query']);_0x2ddbdc['attributes']=_[_0x85be('0x32')](_0x21fe70[_0x85be('0x46')],qs[_0x85be('0x34')](_0x593684[_0x85be('0x30')][_0x85be('0x34')]));_0x2ddbdc[_0x85be('0x33')]=_0x2ddbdc[_0x85be('0x33')][_0x85be('0x35')]?_0x2ddbdc[_0x85be('0x33')]:_0x21fe70['model'];_0x2ddbdc[_0x85be('0x37')]=qs[_0x85be('0x38')](_0x593684[_0x85be('0x30')][_0x85be('0x38')]);_0x2ddbdc[_0x85be('0x3b')]=qs[_0x85be('0x31')](_[_0x85be('0x39')](_0x593684[_0x85be('0x30')],_0x21fe70['filters']));if(_0x593684[_0x85be('0x30')]['filter']){_0x2ddbdc['where']=_[_0x85be('0x40')](_0x2ddbdc[_0x85be('0x3b')],{'$or':_[_0x85be('0x3c')](_0x2ddbdc[_0x85be('0x33')],function(_0xf23e2a){var _0x1fb88a={};_0x1fb88a[_0xf23e2a]={'$like':'%'+_0x593684[_0x85be('0x30')]['filter']+'%'};return _0x1fb88a;})});}_0x2ddbdc=_['merge']({},_0x2ddbdc,_0x593684[_0x85be('0x41')]);return _0x6b4298[_0x85be('0x5c')](_0x2ddbdc);}})[_0x85be('0x26')](function(_0x518aa1){if(_0x518aa1){_0x156f5a=_0x518aa1['length'];if(!_0x593684['query'][_0x85be('0x36')](_0x85be('0x5f'))){_0x2ddbdc[_0x85be('0x20')]=qs[_0x85be('0x20')](_0x593684[_0x85be('0x30')]['limit']);_0x2ddbdc['offset']=qs['offset'](_0x593684[_0x85be('0x30')][_0x85be('0x1f')]);}return _0x6b4298[_0x85be('0x5c')](_0x2ddbdc);}})['then'](function(_0x37bf7c){if(_0x37bf7c){return _0x37bf7c?{'count':_0x156f5a,'rows':_0x37bf7c}:null;}})[_0x85be('0x26')](respondWithResult(_0x988c16,null))['catch'](handleError(_0x988c16,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index cba2042..6d4a9a1 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 _0xb260=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject'];(function(_0x174e6b,_0x124a26){var _0x10ab0e=function(_0x704225){while(--_0x704225){_0x174e6b['push'](_0x174e6b['shift']());}};_0x10ab0e(++_0x124a26);}(_0xb260,0x1c9));var _0x0b26=function(_0x23fc23,_0x5d8742){_0x23fc23=_0x23fc23-0x0;var _0x50ad8a=_0xb260[_0x23fc23];return _0x50ad8a;};'use strict';var EventEmitter=require(_0x0b26('0x0'));var SquareProject=require(_0x0b26('0x1'))['db'][_0x0b26('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x0b26('0x3')](0x0);var events={'afterCreate':_0x0b26('0x4'),'afterUpdate':_0x0b26('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1b0d5a){return function(_0x2eb033,_0x3e0cdf,_0x26ac41){SquareProjectEvents[_0x0b26('0x6')](_0x1b0d5a+':'+_0x2eb033['id'],_0x2eb033);SquareProjectEvents[_0x0b26('0x6')](_0x1b0d5a,_0x2eb033);_0x26ac41(null);};}for(var e in events){if(events[_0x0b26('0x7')](e)){var event=events[e];SquareProject[_0x0b26('0x8')](e,emitEvent(event));}}module[_0x0b26('0x9')]=SquareProjectEvents; \ No newline at end of file +var _0xefc7=['setMaxListeners','update','remove','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x20e8ed,_0x48b76d){var _0x1122fc=function(_0x1ff75b){while(--_0x1ff75b){_0x20e8ed['push'](_0x20e8ed['shift']());}};_0x1122fc(++_0x48b76d);}(_0xefc7,0xb6));var _0x7efc=function(_0x590dae,_0x11d022){_0x590dae=_0x590dae-0x0;var _0x2b9643=_0xefc7[_0x590dae];return _0x2b9643;};'use strict';var EventEmitter=require(_0x7efc('0x0'));var SquareProject=require(_0x7efc('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x7efc('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7efc('0x3'),'afterDestroy':_0x7efc('0x4')};function emitEvent(_0xa65632){return function(_0x1ddbf0,_0x52c21d,_0x4df68b){SquareProjectEvents['emit'](_0xa65632+':'+_0x1ddbf0['id'],_0x1ddbf0);SquareProjectEvents['emit'](_0xa65632,_0x1ddbf0);_0x4df68b(null);};}for(var e in events){if(events[_0x7efc('0x5')](e)){var event=events[e];SquareProject[_0x7efc('0x6')](e,emitEvent(event));}}module[_0x7efc('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index b39e806..2c6079c 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 _0x9bb7=['SquareProject','square_projects','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./squareProject.attributes','exports','define'];(function(_0x18d143,_0x446ec8){var _0x32a9dc=function(_0x55d60c){while(--_0x55d60c){_0x18d143['push'](_0x18d143['shift']());}};_0x32a9dc(++_0x446ec8);}(_0x9bb7,0x1f0));var _0x79bb=function(_0x2de81b,_0x322f1d){_0x2de81b=_0x2de81b-0x0;var _0x3df553=_0x9bb7[_0x2de81b];return _0x3df553;};'use strict';var _=require(_0x79bb('0x0'));var util=require(_0x79bb('0x1'));var logger=require(_0x79bb('0x2'))(_0x79bb('0x3'));var moment=require('moment');var BPromise=require(_0x79bb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x79bb('0x5'));var rimraf=require(_0x79bb('0x6'));var config=require(_0x79bb('0x7'));var attributes=require(_0x79bb('0x8'));module[_0x79bb('0x9')]=function(_0x1d3f3f,_0x223ca8){return _0x1d3f3f[_0x79bb('0xa')](_0x79bb('0xb'),attributes,{'tableName':_0x79bb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe00b=['path','rimraf','../../config/environment','exports','define','SquareProject','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x257a28,_0x2cd00d){var _0x13bccc=function(_0x32c46f){while(--_0x32c46f){_0x257a28['push'](_0x257a28['shift']());}};_0x13bccc(++_0x2cd00d);}(_0xe00b,0x1c0));var _0xbe00=function(_0x48c76a,_0x4d52f5){_0x48c76a=_0x48c76a-0x0;var _0x2062b4=_0xe00b[_0x48c76a];return _0x2062b4;};'use strict';var _=require(_0xbe00('0x0'));var util=require(_0xbe00('0x1'));var logger=require(_0xbe00('0x2'))(_0xbe00('0x3'));var moment=require(_0xbe00('0x4'));var BPromise=require(_0xbe00('0x5'));var rp=require(_0xbe00('0x6'));var fs=require('fs');var path=require(_0xbe00('0x7'));var rimraf=require(_0xbe00('0x8'));var config=require(_0xbe00('0x9'));var attributes=require('./squareProject.attributes');module[_0xbe00('0xa')]=function(_0x477031,_0x56acd3){return _0x477031[_0xbe00('0xb')](_0xbe00('0xc'),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 63ad1cf..68d086a 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(_0x21ada4,_0xc89442){var _0x2c157d=function(_0x4e5558){while(--_0x4e5558){_0x21ada4['push'](_0x21ada4['shift']());}};_0x2c157d(++_0xc89442);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});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(_0x15682e,_0x45dcb6){var _0x199dc9=function(_0x2840e8){while(--_0x2840e8){_0x15682e['push'](_0x15682e['shift']());}};_0x199dc9(++_0x45dcb6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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 f3b2cfe..1a78bf7 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 _0x18e0=['squareProject:','save','update','emit','removeListener','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x18e0,0xa2));var _0x018e=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x18e0[_0x599f41];return _0x2e4d58;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x018e('0x0'),'remove',_0x018e('0x1')];function createListener(_0x110f22,_0x356418){return function(_0x4d12a5){_0x356418[_0x018e('0x2')](_0x110f22,_0x4d12a5);};}function removeListener(_0x4e570f,_0x504293){return function(){SquareProjectEvents[_0x018e('0x3')](_0x4e570f,_0x504293);};}exports[_0x018e('0x4')]=function(_0x1b90dd){for(var _0x50450b=0x0,_0x5b6638=events[_0x018e('0x5')];_0x50450b<_0x5b6638;_0x50450b++){var _0x24e838=events[_0x50450b];var _0x5b2267=createListener(_0x018e('0x6')+_0x24e838,_0x1b90dd);SquareProjectEvents['on'](_0x24e838,_0x5b2267);}}; \ No newline at end of file +var _0x61a5=['./squareProject.events','remove','update','register','length'];(function(_0x8c6164,_0x1dc7db){var _0x1ca172=function(_0x1c8d48){while(--_0x1c8d48){_0x8c6164['push'](_0x8c6164['shift']());}};_0x1ca172(++_0x1dc7db);}(_0x61a5,0xf0));var _0x561a=function(_0x55d7c2,_0x4ce6fb){_0x55d7c2=_0x55d7c2-0x0;var _0x1755ef=_0x61a5[_0x55d7c2];return _0x1755ef;};'use strict';var SquareProjectEvents=require(_0x561a('0x0'));var events=['save',_0x561a('0x1'),_0x561a('0x2')];function createListener(_0xc164c0,_0x862a0e){return function(_0x29ccea){_0x862a0e['emit'](_0xc164c0,_0x29ccea);};}function removeListener(_0xe92b4d,_0x33c0f5){return function(){SquareProjectEvents['removeListener'](_0xe92b4d,_0x33c0f5);};}exports[_0x561a('0x3')]=function(_0x31f762){for(var _0x24c89a=0x0,_0x2646bd=events[_0x561a('0x4')];_0x24c89a<_0x2646bd;_0x24c89a++){var _0xfe091=events[_0x24c89a];var _0x1d5814=createListener('squareProject:'+_0xfe091,_0x31f762);SquareProjectEvents['on'](_0xfe091,_0x1d5814);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 792a50e..69c1351 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 _0x0b64=['create','put','update','delete','destroy','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','post'];(function(_0x3cc709,_0x32cdb1){var _0x47f715=function(_0x56eda5){while(--_0x56eda5){_0x3cc709['push'](_0x3cc709['shift']());}};_0x47f715(++_0x32cdb1);}(_0x0b64,0x9d));var _0x40b6=function(_0x5999e7,_0x2af700){_0x5999e7=_0x5999e7-0x0;var _0x16cb4c=_0x0b64[_0x5999e7];return _0x16cb4c;};'use strict';var multer=require('multer');var util=require(_0x40b6('0x0'));var path=require(_0x40b6('0x1'));var timeout=require('connect-timeout');var express=require(_0x40b6('0x2'));var router=express[_0x40b6('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x40b6('0x4'));var config=require(_0x40b6('0x5'));var controller=require(_0x40b6('0x6'));router[_0x40b6('0x7')]('/',auth[_0x40b6('0x8')](),controller[_0x40b6('0x9')]);router[_0x40b6('0x7')](_0x40b6('0xa'),auth[_0x40b6('0x8')](),controller[_0x40b6('0xb')]);router[_0x40b6('0x7')](_0x40b6('0xc'),auth[_0x40b6('0x8')](),controller['download']);router[_0x40b6('0xd')]('/',auth['isAuthenticated'](),controller[_0x40b6('0xe')]);router[_0x40b6('0xf')](_0x40b6('0xa'),auth['isAuthenticated'](),controller[_0x40b6('0x10')]);router[_0x40b6('0x11')](_0x40b6('0xa'),auth[_0x40b6('0x8')](),controller[_0x40b6('0x12')]);module['exports']=router; \ No newline at end of file +var _0x3e1f=['../../components/interaction/service','../../config/environment','./squareRecording.controller','isAuthenticated','index','get','/:id','/:id/download','download','post','put','update','delete','exports','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x211118,_0x47e09e){var _0x463d8c=function(_0x286e30){while(--_0x286e30){_0x211118['push'](_0x211118['shift']());}};_0x463d8c(++_0x47e09e);}(_0x3e1f,0x18a));var _0xf3e1=function(_0xf44d98,_0x12a472){_0xf44d98=_0xf44d98-0x0;var _0x5ebb04=_0x3e1f[_0xf44d98];return _0x5ebb04;};'use strict';var multer=require('multer');var util=require(_0xf3e1('0x0'));var path=require(_0xf3e1('0x1'));var timeout=require(_0xf3e1('0x2'));var express=require('express');var router=express[_0xf3e1('0x3')]();var auth=require(_0xf3e1('0x4'));var interaction=require(_0xf3e1('0x5'));var config=require(_0xf3e1('0x6'));var controller=require(_0xf3e1('0x7'));router['get']('/',auth[_0xf3e1('0x8')](),controller[_0xf3e1('0x9')]);router[_0xf3e1('0xa')](_0xf3e1('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xf3e1('0xa')](_0xf3e1('0xc'),auth['isAuthenticated'](),controller[_0xf3e1('0xd')]);router[_0xf3e1('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf3e1('0xf')]('/:id',auth[_0xf3e1('0x8')](),controller[_0xf3e1('0x10')]);router[_0xf3e1('0x11')](_0xf3e1('0xb'),auth[_0xf3e1('0x8')](),controller['destroy']);module[_0xf3e1('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 0f00e46..a30b6a3 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 _0xf526=['sequelize','exports','STRING'];(function(_0x3f25b2,_0x412bd4){var _0xd8caeb=function(_0x52d252){while(--_0x52d252){_0x3f25b2['push'](_0x3f25b2['shift']());}};_0xd8caeb(++_0x412bd4);}(_0xf526,0x90));var _0x6f52=function(_0xfa4111,_0x371830){_0xfa4111=_0xfa4111-0x0;var _0x435b0d=_0xf526[_0xfa4111];return _0x435b0d;};'use strict';var Sequelize=require(_0x6f52('0x0'));module[_0x6f52('0x1')]={'uniqueid':{'type':Sequelize[_0x6f52('0x2')]},'callerid':{'type':Sequelize[_0x6f52('0x2')]},'calleridname':{'type':Sequelize[_0x6f52('0x2')]},'context':{'type':Sequelize[_0x6f52('0x2')]},'extension':{'type':Sequelize[_0x6f52('0x2')]},'priority':{'type':Sequelize[_0x6f52('0x2')]},'accountcode':{'type':Sequelize[_0x6f52('0x2')]},'dnid':{'type':Sequelize[_0x6f52('0x2')]},'projectName':{'type':Sequelize[_0x6f52('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x6f52('0x2')]},'savePath':{'type':Sequelize[_0x6f52('0x2')]}}; \ No newline at end of file +var _0xc446=['STRING','sequelize'];(function(_0x903228,_0x42c429){var _0xcec81d=function(_0x4da97a){while(--_0x4da97a){_0x903228['push'](_0x903228['shift']());}};_0xcec81d(++_0x42c429);}(_0xc446,0xb7));var _0x6c44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc446[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6c44('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x6c44('0x1')]},'callerid':{'type':Sequelize[_0x6c44('0x1')]},'calleridname':{'type':Sequelize[_0x6c44('0x1')]},'context':{'type':Sequelize[_0x6c44('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x6c44('0x1')]},'accountcode':{'type':Sequelize[_0x6c44('0x1')]},'dnid':{'type':Sequelize[_0x6c44('0x1')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x6c44('0x1')]},'filename':{'type':Sequelize[_0x6c44('0x1')]},'savePath':{'type':Sequelize[_0x6c44('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 173e23a..e2a026b 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 _0x2f8b=['status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','SquareRecording','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','key','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','extname','unlink','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x54e631,_0x3b8396){var _0x3c6b6a=function(_0x48cea6){while(--_0x48cea6){_0x54e631['push'](_0x54e631['shift']());}};_0x3c6b6a(++_0x3b8396);}(_0x2f8b,0x96));var _0xb2f8=function(_0x39e574,_0x3d8574){_0x39e574=_0x39e574-0x0;var _0x2dddef=_0x2f8b[_0x39e574];return _0x2dddef;};'use strict';var pdf=require(_0xb2f8('0x0'));var emlformat=require(_0xb2f8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb2f8('0x2'));var jsonpatch=require(_0xb2f8('0x3'));var rp=require(_0xb2f8('0x4'));var moment=require(_0xb2f8('0x5'));var BPromise=require(_0xb2f8('0x6'));var Mustache=require(_0xb2f8('0x7'));var util=require(_0xb2f8('0x8'));var path=require('path');var sox=require(_0xb2f8('0x9'));var csv=require(_0xb2f8('0xa'));var ejs=require(_0xb2f8('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb2f8('0xc'));var crypto=require('crypto');var jsforce=require(_0xb2f8('0xd'));var deskjs=require(_0xb2f8('0xe'));var toCsv=require(_0xb2f8('0xa'));var querystring=require(_0xb2f8('0xf'));var Papa=require(_0xb2f8('0x10'));var Redis=require(_0xb2f8('0x11'));var authService=require(_0xb2f8('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb2f8('0x13'));var logger=require(_0xb2f8('0x14'))(_0xb2f8('0x15'));var utils=require(_0xb2f8('0x16'));var config=require(_0xb2f8('0x17'));var db=require(_0xb2f8('0x18'))['db'];function respondWithStatusCode(_0xcce486,_0x39350f){_0x39350f=_0x39350f||0xcc;return function(_0x3aeb83){if(_0x3aeb83){return _0xcce486[_0xb2f8('0x19')](_0x39350f);}return _0xcce486[_0xb2f8('0x1a')](_0x39350f)[_0xb2f8('0x1b')]();};}function respondWithResult(_0x357819,_0x51bdb9){_0x51bdb9=_0x51bdb9||0xc8;return function(_0x56b9b7){if(_0x56b9b7){return _0x357819[_0xb2f8('0x1a')](_0x51bdb9)[_0xb2f8('0x1c')](_0x56b9b7);}};}function respondWithFilteredResult(_0x52105e,_0xe6f94e){return function(_0x6d73fd){if(_0x6d73fd){var _0x3c30a6=_0x6d73fd[_0xb2f8('0x1d')],_0x2097e7=_0xe6f94e[_0xb2f8('0x1e')],_0x57d3c8=_0xe6f94e['offset']+_0xe6f94e[_0xb2f8('0x1f')],_0x4aabd4;if(_0x57d3c8>=_0x3c30a6){_0x57d3c8=_0x3c30a6;_0x4aabd4=0xc8;}else{_0x4aabd4=0xce;}_0x52105e[_0xb2f8('0x1a')](_0x4aabd4);return _0x52105e['set'](_0xb2f8('0x20'),_0x2097e7+'-'+_0x57d3c8+'/'+_0x3c30a6)['json'](_0x6d73fd);}return null;};}function patchUpdates(_0x4285ed){return function(_0x46333f){try{jsonpatch[_0xb2f8('0x21')](_0x46333f,_0x4285ed,!![]);}catch(_0x3f54c4){return BPromise[_0xb2f8('0x22')](_0x3f54c4);}return _0x46333f[_0xb2f8('0x23')]();};}function saveUpdates(_0x2da267,_0x9e53ef){return function(_0x3f1efa){if(_0x3f1efa){return _0x3f1efa[_0xb2f8('0x24')](_0x2da267)['then'](function(_0x4501eb){return _0x4501eb;});}return null;};}function removeEntity(_0x4b2817,_0x25d13a){return function(_0x2b190c){if(_0x2b190c){return _0x2b190c[_0xb2f8('0x25')]()[_0xb2f8('0x26')](function(){_0x4b2817['status'](0xcc)[_0xb2f8('0x1b')]();});}};}function handleEntityNotFound(_0x32dc7d,_0x43f6ed){return function(_0x5a8466){if(!_0x5a8466){_0x32dc7d[_0xb2f8('0x19')](0x194);}return _0x5a8466;};}function handleError(_0x59243d,_0x4d1a03){_0x4d1a03=_0x4d1a03||0x1f4;return function(_0x184b24){logger[_0xb2f8('0x27')](_0x184b24['stack']);if(_0x184b24[_0xb2f8('0x28')]){delete _0x184b24[_0xb2f8('0x28')];}_0x59243d[_0xb2f8('0x1a')](_0x4d1a03)[_0xb2f8('0x29')](_0x184b24);};}exports[_0xb2f8('0x2a')]=function(_0x3b92d7,_0x55e4a3){var _0x42355d={},_0x3ca25b={},_0x3f9e32={'count':0x0,'rows':[]};var _0x2352dc=db[_0xb2f8('0x2b')]['rawAttributes'];_0x3ca25b[_0xb2f8('0x2c')]=_[_0xb2f8('0x2d')](_0x2352dc);_0x3ca25b['query']=_[_0xb2f8('0x2d')](_0x3b92d7[_0xb2f8('0x2e')]);_0x3ca25b[_0xb2f8('0x2f')]=_[_0xb2f8('0x30')](_0x3ca25b['model'],_0x3ca25b[_0xb2f8('0x2e')]);_0x42355d[_0xb2f8('0x31')]=_[_0xb2f8('0x30')](_0x3ca25b['model'],qs[_0xb2f8('0x32')](_0x3b92d7['query'][_0xb2f8('0x32')]));_0x42355d[_0xb2f8('0x31')]=_0x42355d[_0xb2f8('0x31')][_0xb2f8('0x33')]?_0x42355d[_0xb2f8('0x31')]:_0x3ca25b[_0xb2f8('0x2c')];if(!_0x3b92d7[_0xb2f8('0x2e')][_0xb2f8('0x34')](_0xb2f8('0x35'))){_0x42355d[_0xb2f8('0x1f')]=qs['limit'](_0x3b92d7[_0xb2f8('0x2e')][_0xb2f8('0x1f')]);_0x42355d[_0xb2f8('0x1e')]=qs[_0xb2f8('0x1e')](_0x3b92d7['query'][_0xb2f8('0x1e')]);}_0x42355d[_0xb2f8('0x36')]=qs[_0xb2f8('0x37')](_0x3b92d7[_0xb2f8('0x2e')][_0xb2f8('0x37')]);_0x42355d['where']=qs[_0xb2f8('0x2f')](_['pick'](_0x3b92d7['query'],_0x3ca25b[_0xb2f8('0x2f')]));if(_0x3b92d7[_0xb2f8('0x2e')][_0xb2f8('0x38')]){_0x42355d[_0xb2f8('0x39')]=_[_0xb2f8('0x3a')](_0x42355d[_0xb2f8('0x39')],{'$or':_['map'](_0x2352dc,function(_0x2d9a9a){if(_0x2d9a9a[_0xb2f8('0x3b')][_0xb2f8('0x3c')]!=='VIRTUAL'){var _0x4ca67a={};_0x4ca67a[_0x2d9a9a['field']]={'$like':'%'+_0x3b92d7[_0xb2f8('0x2e')][_0xb2f8('0x38')]+'%'};return _0x4ca67a;}})});}_0x42355d=_[_0xb2f8('0x3a')]({},_0x42355d,_0x3b92d7['options']);var _0x28dfb1={'where':_0x42355d[_0xb2f8('0x39')]};return db[_0xb2f8('0x2b')][_0xb2f8('0x1d')](_0x28dfb1)[_0xb2f8('0x26')](function(_0x11ad54){_0x3f9e32[_0xb2f8('0x1d')]=_0x11ad54;if(_0x3b92d7['query'][_0xb2f8('0x3d')]){_0x42355d[_0xb2f8('0x3e')]=[{'all':!![]}];}return db['SquareRecording'][_0xb2f8('0x3f')](_0x42355d);})[_0xb2f8('0x26')](function(_0x4032ef){_0x3f9e32[_0xb2f8('0x40')]=_0x4032ef;return _0x3f9e32;})[_0xb2f8('0x26')](respondWithFilteredResult(_0x55e4a3,_0x42355d))[_0xb2f8('0x41')](handleError(_0x55e4a3,null));};exports[_0xb2f8('0x42')]=function(_0x23d928,_0x2a76b6){var _0x475521={'raw':!![],'where':{'id':_0x23d928[_0xb2f8('0x43')]['id']}},_0x4bb3e7={};_0x4bb3e7[_0xb2f8('0x2c')]=_[_0xb2f8('0x2d')](db[_0xb2f8('0x2b')][_0xb2f8('0x44')]);_0x4bb3e7[_0xb2f8('0x2e')]=_['keys'](_0x23d928[_0xb2f8('0x2e')]);_0x4bb3e7[_0xb2f8('0x2f')]=_['intersection'](_0x4bb3e7[_0xb2f8('0x2c')],_0x4bb3e7[_0xb2f8('0x2e')]);_0x475521[_0xb2f8('0x31')]=_['intersection'](_0x4bb3e7[_0xb2f8('0x2c')],qs[_0xb2f8('0x32')](_0x23d928['query']['fields']));_0x475521[_0xb2f8('0x31')]=_0x475521[_0xb2f8('0x31')]['length']?_0x475521[_0xb2f8('0x31')]:_0x4bb3e7['model'];if(_0x23d928[_0xb2f8('0x2e')][_0xb2f8('0x3d')]){_0x475521[_0xb2f8('0x3e')]=[{'all':!![]}];}_0x475521=_[_0xb2f8('0x3a')]({},_0x475521,_0x23d928[_0xb2f8('0x45')]);return db['SquareRecording'][_0xb2f8('0x46')](_0x475521)[_0xb2f8('0x26')](handleEntityNotFound(_0x2a76b6,null))['then'](respondWithResult(_0x2a76b6,null))[_0xb2f8('0x41')](handleError(_0x2a76b6,null));};exports[_0xb2f8('0x47')]=function(_0x3e7866,_0x43d811){return db['SquareRecording'][_0xb2f8('0x47')](_0x3e7866['body'],{})[_0xb2f8('0x26')](respondWithResult(_0x43d811,0xc9))['catch'](handleError(_0x43d811,null));};exports[_0xb2f8('0x24')]=function(_0x4a8a11,_0x17f02e){if(_0x4a8a11[_0xb2f8('0x48')]['id']){delete _0x4a8a11[_0xb2f8('0x48')]['id'];}return db[_0xb2f8('0x2b')]['find']({'where':{'id':_0x4a8a11[_0xb2f8('0x43')]['id']}})[_0xb2f8('0x26')](handleEntityNotFound(_0x17f02e,null))[_0xb2f8('0x26')](saveUpdates(_0x4a8a11[_0xb2f8('0x48')],null))['then'](respondWithResult(_0x17f02e,null))[_0xb2f8('0x41')](handleError(_0x17f02e,null));};exports['destroy']=function(_0x1291b6,_0x405b2){return db['SquareRecording'][_0xb2f8('0x46')]({'where':{'id':_0x1291b6[_0xb2f8('0x43')]['id']}})[_0xb2f8('0x26')](handleEntityNotFound(_0x405b2,null))[_0xb2f8('0x26')](removeEntity(_0x405b2,null))[_0xb2f8('0x41')](handleError(_0x405b2,null));};exports['download']=function(_0x1fc9f3,_0x284ded,_0x139354){var _0x4980ac=require(_0xb2f8('0x49'));var _0x48969d=![];var _0x3d77cb={};if(_0x1fc9f3[_0xb2f8('0x2e')][_0xb2f8('0x3b')]&&_0x1fc9f3[_0xb2f8('0x2e')]['type']===_0xb2f8('0x4a')){_0x3d77cb[_0xb2f8('0x4a')]=_0x1fc9f3[_0xb2f8('0x43')]['id'];}else{_0x3d77cb['id']=_0x1fc9f3[_0xb2f8('0x43')]['id'];}return db['SquareRecording']['find']({'where':_0x3d77cb,'attributes':['id',_0xb2f8('0x4b'),_0xb2f8('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x284ded,null))[_0xb2f8('0x26')](function(_0x5c3213){if(_0x5c3213){var _0x190958=_0x5c3213[_0xb2f8('0x4b')];var _0x18bd71=util[_0xb2f8('0x4d')](_0xb2f8('0x4e'),_0x190958);if(fs[_0xb2f8('0x4f')](_0x18bd71)){_0x48969d=!![];return _0x4980ac['decryptFile'](_0x18bd71,_0x190958,config[_0xb2f8('0x50')][_0xb2f8('0x51')])[_0xb2f8('0x26')](function(){return _0x5c3213;});}return _0x5c3213;}})[_0xb2f8('0x26')](function(_0x4de000){if(_0x4de000){var _0x3d2e39=_0x4de000['savePath'];if(!fs[_0xb2f8('0x4f')](_0x3d2e39)){throw new db[(_0xb2f8('0x52'))][(_0xb2f8('0x53'))](_0xb2f8('0x54'));}if(_0x4de000[_0xb2f8('0x4c')]){return _0x284ded[_0xb2f8('0x55')](_0x3d2e39,_0x4de000[_0xb2f8('0x4c')]+path[_0xb2f8('0x56')](_0x3d2e39),function(){if(_0x48969d){fs[_0xb2f8('0x57')](_0x3d2e39);}});}else{return _0x284ded[_0xb2f8('0x55')](_0x3d2e39,function(_0x498798){if(_0x48969d){fs['unlink'](_0x3d2e39);}});}}})[_0xb2f8('0x41')](function(_0x2a19af){if(_0x2a19af['message']==='SquareRecording\x20not\x20found'){_0x284ded['status'](0x194)[_0xb2f8('0x29')]('Not\x20found');}else{return handleError(_0x284ded,null);}});}; \ No newline at end of file +var _0xee4e=['options','SquareRecording','includeAll','include','findAll','show','params','rawAttributes','intersection','find','catch','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','SquareRecording\x20not\x20found','extname','unlink','message','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','Content-Range','apply','reject','update','destroy','then','stack','name','send','index','model','keys','query','filters','fields','attributes','length','limit','order','sort','pick','filter','where','map','type','key','VIRTUAL','field','merge'];(function(_0x43f5c7,_0x118763){var _0x46be5f=function(_0x1a43f2){while(--_0x1a43f2){_0x43f5c7['push'](_0x43f5c7['shift']());}};_0x46be5f(++_0x118763);}(_0xee4e,0x122));var _0xeee4=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xee4e[_0x3ab9ee];return _0x82ee88;};'use strict';var pdf=require(_0xeee4('0x0'));var emlformat=require(_0xeee4('0x1'));var rimraf=require(_0xeee4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeee4('0x3'));var rp=require(_0xeee4('0x4'));var moment=require(_0xeee4('0x5'));var BPromise=require(_0xeee4('0x6'));var Mustache=require(_0xeee4('0x7'));var util=require(_0xeee4('0x8'));var path=require(_0xeee4('0x9'));var sox=require(_0xeee4('0xa'));var csv=require('to-csv');var ejs=require(_0xeee4('0xb'));var fs=require('fs');var _=require(_0xeee4('0xc'));var squel=require(_0xeee4('0xd'));var crypto=require('crypto');var jsforce=require(_0xeee4('0xe'));var deskjs=require(_0xeee4('0xf'));var toCsv=require(_0xeee4('0x10'));var querystring=require('querystring');var Papa=require(_0xeee4('0x11'));var Redis=require(_0xeee4('0x12'));var authService=require(_0xeee4('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xeee4('0x14'));var logger=require('../../config/logger')(_0xeee4('0x15'));var utils=require(_0xeee4('0x16'));var config=require(_0xeee4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x203074,_0xab281b){_0xab281b=_0xab281b||0xcc;return function(_0x348c96){if(_0x348c96){return _0x203074[_0xeee4('0x18')](_0xab281b);}return _0x203074['status'](_0xab281b)['end']();};}function respondWithResult(_0x3d2721,_0x2433dd){_0x2433dd=_0x2433dd||0xc8;return function(_0xa32975){if(_0xa32975){return _0x3d2721[_0xeee4('0x19')](_0x2433dd)[_0xeee4('0x1a')](_0xa32975);}};}function respondWithFilteredResult(_0x52ea81,_0x4c35e1){return function(_0x288ded){if(_0x288ded){var _0x44631d=_0x288ded[_0xeee4('0x1b')],_0x1fc948=_0x4c35e1['offset'],_0x1e0af2=_0x4c35e1[_0xeee4('0x1c')]+_0x4c35e1['limit'],_0xf3e60b;if(_0x1e0af2>=_0x44631d){_0x1e0af2=_0x44631d;_0xf3e60b=0xc8;}else{_0xf3e60b=0xce;}_0x52ea81[_0xeee4('0x19')](_0xf3e60b);return _0x52ea81['set'](_0xeee4('0x1d'),_0x1fc948+'-'+_0x1e0af2+'/'+_0x44631d)[_0xeee4('0x1a')](_0x288ded);}return null;};}function patchUpdates(_0x2b37dd){return function(_0x557433){try{jsonpatch[_0xeee4('0x1e')](_0x557433,_0x2b37dd,!![]);}catch(_0x3decdf){return BPromise[_0xeee4('0x1f')](_0x3decdf);}return _0x557433['save']();};}function saveUpdates(_0x133d76,_0x33765d){return function(_0x3a981c){if(_0x3a981c){return _0x3a981c[_0xeee4('0x20')](_0x133d76)['then'](function(_0x378f92){return _0x378f92;});}return null;};}function removeEntity(_0x1e470d,_0x4970df){return function(_0x3a3c63){if(_0x3a3c63){return _0x3a3c63[_0xeee4('0x21')]()[_0xeee4('0x22')](function(){_0x1e470d[_0xeee4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27f951,_0x446f79){return function(_0x28276e){if(!_0x28276e){_0x27f951['sendStatus'](0x194);}return _0x28276e;};}function handleError(_0x497833,_0x2c27e0){_0x2c27e0=_0x2c27e0||0x1f4;return function(_0x414644){logger['error'](_0x414644[_0xeee4('0x23')]);if(_0x414644['name']){delete _0x414644[_0xeee4('0x24')];}_0x497833[_0xeee4('0x19')](_0x2c27e0)[_0xeee4('0x25')](_0x414644);};}exports[_0xeee4('0x26')]=function(_0x1f9e12,_0x42b4f9){var _0x41ef12={},_0x42c89c={},_0x2cdee7={'count':0x0,'rows':[]};var _0x23b33c=db['SquareRecording']['rawAttributes'];_0x42c89c[_0xeee4('0x27')]=_[_0xeee4('0x28')](_0x23b33c);_0x42c89c['query']=_['keys'](_0x1f9e12[_0xeee4('0x29')]);_0x42c89c[_0xeee4('0x2a')]=_['intersection'](_0x42c89c[_0xeee4('0x27')],_0x42c89c[_0xeee4('0x29')]);_0x41ef12['attributes']=_['intersection'](_0x42c89c['model'],qs[_0xeee4('0x2b')](_0x1f9e12[_0xeee4('0x29')][_0xeee4('0x2b')]));_0x41ef12[_0xeee4('0x2c')]=_0x41ef12[_0xeee4('0x2c')][_0xeee4('0x2d')]?_0x41ef12[_0xeee4('0x2c')]:_0x42c89c[_0xeee4('0x27')];if(!_0x1f9e12['query']['hasOwnProperty']('nolimit')){_0x41ef12[_0xeee4('0x2e')]=qs['limit'](_0x1f9e12[_0xeee4('0x29')][_0xeee4('0x2e')]);_0x41ef12[_0xeee4('0x1c')]=qs[_0xeee4('0x1c')](_0x1f9e12[_0xeee4('0x29')][_0xeee4('0x1c')]);}_0x41ef12[_0xeee4('0x2f')]=qs['sort'](_0x1f9e12[_0xeee4('0x29')][_0xeee4('0x30')]);_0x41ef12['where']=qs['filters'](_[_0xeee4('0x31')](_0x1f9e12['query'],_0x42c89c[_0xeee4('0x2a')]));if(_0x1f9e12[_0xeee4('0x29')][_0xeee4('0x32')]){_0x41ef12[_0xeee4('0x33')]=_['merge'](_0x41ef12['where'],{'$or':_[_0xeee4('0x34')](_0x23b33c,function(_0x4d32c5){if(_0x4d32c5[_0xeee4('0x35')][_0xeee4('0x36')]!==_0xeee4('0x37')){var _0x382f64={};_0x382f64[_0x4d32c5[_0xeee4('0x38')]]={'$like':'%'+_0x1f9e12[_0xeee4('0x29')]['filter']+'%'};return _0x382f64;}})});}_0x41ef12=_[_0xeee4('0x39')]({},_0x41ef12,_0x1f9e12[_0xeee4('0x3a')]);var _0x1f65c3={'where':_0x41ef12[_0xeee4('0x33')]};return db[_0xeee4('0x3b')][_0xeee4('0x1b')](_0x1f65c3)[_0xeee4('0x22')](function(_0x5ceb9a){_0x2cdee7[_0xeee4('0x1b')]=_0x5ceb9a;if(_0x1f9e12[_0xeee4('0x29')][_0xeee4('0x3c')]){_0x41ef12[_0xeee4('0x3d')]=[{'all':!![]}];}return db[_0xeee4('0x3b')][_0xeee4('0x3e')](_0x41ef12);})['then'](function(_0x3e12b9){_0x2cdee7['rows']=_0x3e12b9;return _0x2cdee7;})['then'](respondWithFilteredResult(_0x42b4f9,_0x41ef12))['catch'](handleError(_0x42b4f9,null));};exports[_0xeee4('0x3f')]=function(_0x408951,_0x5bdf2d){var _0x22c853={'raw':!![],'where':{'id':_0x408951[_0xeee4('0x40')]['id']}},_0xe3d540={};_0xe3d540[_0xeee4('0x27')]=_[_0xeee4('0x28')](db[_0xeee4('0x3b')][_0xeee4('0x41')]);_0xe3d540[_0xeee4('0x29')]=_[_0xeee4('0x28')](_0x408951[_0xeee4('0x29')]);_0xe3d540[_0xeee4('0x2a')]=_[_0xeee4('0x42')](_0xe3d540[_0xeee4('0x27')],_0xe3d540[_0xeee4('0x29')]);_0x22c853[_0xeee4('0x2c')]=_['intersection'](_0xe3d540['model'],qs[_0xeee4('0x2b')](_0x408951[_0xeee4('0x29')][_0xeee4('0x2b')]));_0x22c853[_0xeee4('0x2c')]=_0x22c853['attributes']['length']?_0x22c853[_0xeee4('0x2c')]:_0xe3d540[_0xeee4('0x27')];if(_0x408951[_0xeee4('0x29')]['includeAll']){_0x22c853['include']=[{'all':!![]}];}_0x22c853=_[_0xeee4('0x39')]({},_0x22c853,_0x408951[_0xeee4('0x3a')]);return db[_0xeee4('0x3b')][_0xeee4('0x43')](_0x22c853)[_0xeee4('0x22')](handleEntityNotFound(_0x5bdf2d,null))[_0xeee4('0x22')](respondWithResult(_0x5bdf2d,null))[_0xeee4('0x44')](handleError(_0x5bdf2d,null));};exports[_0xeee4('0x45')]=function(_0x33d349,_0x2f117f){return db[_0xeee4('0x3b')][_0xeee4('0x45')](_0x33d349[_0xeee4('0x46')],{})[_0xeee4('0x22')](respondWithResult(_0x2f117f,0xc9))[_0xeee4('0x44')](handleError(_0x2f117f,null));};exports[_0xeee4('0x20')]=function(_0x36fd5d,_0x379bed){if(_0x36fd5d[_0xeee4('0x46')]['id']){delete _0x36fd5d[_0xeee4('0x46')]['id'];}return db['SquareRecording'][_0xeee4('0x43')]({'where':{'id':_0x36fd5d['params']['id']}})['then'](handleEntityNotFound(_0x379bed,null))['then'](saveUpdates(_0x36fd5d[_0xeee4('0x46')],null))[_0xeee4('0x22')](respondWithResult(_0x379bed,null))['catch'](handleError(_0x379bed,null));};exports[_0xeee4('0x21')]=function(_0x55587b,_0x1b8196){return db['SquareRecording'][_0xeee4('0x43')]({'where':{'id':_0x55587b[_0xeee4('0x40')]['id']}})[_0xeee4('0x22')](handleEntityNotFound(_0x1b8196,null))[_0xeee4('0x22')](removeEntity(_0x1b8196,null))[_0xeee4('0x44')](handleError(_0x1b8196,null));};exports[_0xeee4('0x47')]=function(_0x5742dc,_0x38e712,_0xe43112){var _0x429f9a=require(_0xeee4('0x48'));var _0x1636a9=![];var _0x3063de={};if(_0x5742dc['query'][_0xeee4('0x35')]&&_0x5742dc[_0xeee4('0x29')]['type']===_0xeee4('0x49')){_0x3063de[_0xeee4('0x49')]=_0x5742dc[_0xeee4('0x40')]['id'];}else{_0x3063de['id']=_0x5742dc[_0xeee4('0x40')]['id'];}return db['SquareRecording'][_0xeee4('0x43')]({'where':_0x3063de,'attributes':['id',_0xeee4('0x4a'),_0xeee4('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x38e712,null))[_0xeee4('0x22')](function(_0x4729da){if(_0x4729da){var _0x46ddc6=_0x4729da['savePath'];var _0x4784b2=util[_0xeee4('0x4c')](_0xeee4('0x4d'),_0x46ddc6);if(fs[_0xeee4('0x4e')](_0x4784b2)){_0x1636a9=!![];return _0x429f9a[_0xeee4('0x4f')](_0x4784b2,_0x46ddc6,config[_0xeee4('0x50')][_0xeee4('0x51')])['then'](function(){return _0x4729da;});}return _0x4729da;}})[_0xeee4('0x22')](function(_0x53a06e){if(_0x53a06e){var _0x133e3e=_0x53a06e[_0xeee4('0x4a')];if(!fs['existsSync'](_0x133e3e)){throw new db[(_0xeee4('0x52'))]['ValidationError'](_0xeee4('0x53'));}if(_0x53a06e[_0xeee4('0x4b')]){return _0x38e712['download'](_0x133e3e,_0x53a06e[_0xeee4('0x4b')]+path[_0xeee4('0x54')](_0x133e3e),function(){if(_0x1636a9){fs[_0xeee4('0x55')](_0x133e3e);}});}else{return _0x38e712[_0xeee4('0x47')](_0x133e3e,function(_0x23bc60){if(_0x1636a9){fs[_0xeee4('0x55')](_0x133e3e);}});}}})['catch'](function(_0x3d56a2){if(_0x3d56a2[_0xeee4('0x56')]==='SquareRecording\x20not\x20found'){_0x38e712['status'](0x194)['send']('Not\x20found');}else{return handleError(_0x38e712,null);}});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 3676e35..a3504a3 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 _0xa248=['./squareRecording.attributes','exports','define','SquareRecording','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1adf50,_0x254b5b){var _0x376413=function(_0x103c44){while(--_0x103c44){_0x1adf50['push'](_0x1adf50['shift']());}};_0x376413(++_0x254b5b);}(_0xa248,0xc4));var _0x8a24=function(_0x1a22e7,_0xe4d078){_0x1a22e7=_0x1a22e7-0x0;var _0x35fb61=_0xa248[_0x1a22e7];return _0x35fb61;};'use strict';var _=require('lodash');var util=require(_0x8a24('0x0'));var logger=require(_0x8a24('0x1'))(_0x8a24('0x2'));var moment=require('moment');var BPromise=require(_0x8a24('0x3'));var rp=require(_0x8a24('0x4'));var fs=require('fs');var path=require(_0x8a24('0x5'));var rimraf=require(_0x8a24('0x6'));var config=require(_0x8a24('0x7'));var attributes=require(_0x8a24('0x8'));module[_0x8a24('0x9')]=function(_0x511849,_0x2f9ff9){return _0x511849[_0x8a24('0xa')](_0x8a24('0xb'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70c5=['square_recordings','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','exports','define','SquareRecording'];(function(_0x1c8a56,_0x4529d4){var _0x205185=function(_0x507513){while(--_0x507513){_0x1c8a56['push'](_0x1c8a56['shift']());}};_0x205185(++_0x4529d4);}(_0x70c5,0xe7));var _0x570c=function(_0x216e1e,_0x5587d0){_0x216e1e=_0x216e1e-0x0;var _0xc109a=_0x70c5[_0x216e1e];return _0xc109a;};'use strict';var _=require(_0x570c('0x0'));var util=require('util');var logger=require(_0x570c('0x1'))(_0x570c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x570c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x570c('0x4'));var config=require(_0x570c('0x5'));var attributes=require('./squareRecording.attributes');module[_0x570c('0x6')]=function(_0x30fae7,_0x55f5c0){return _0x30fae7[_0x570c('0x7')](_0x570c('0x8'),attributes,{'tableName':_0x570c('0x9'),'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 44a3892..1e6b692 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 _0x8489=['../../config/logger','rpc','client','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateSquareRecording','SquareRecording','create','body','options','raw','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x31c5e9,_0x30e373){var _0x517a8d=function(_0x7f9a48){while(--_0x7f9a48){_0x31c5e9['push'](_0x31c5e9['shift']());}};_0x517a8d(++_0x30e373);}(_0x8489,0x159));var _0x9848=function(_0x13b183,_0x187e53){_0x13b183=_0x13b183-0x0;var _0x44f841=_0x8489[_0x13b183];return _0x44f841;};'use strict';var _=require('lodash');var util=require(_0x9848('0x0'));var moment=require(_0x9848('0x1'));var BPromise=require(_0x9848('0x2'));var rs=require(_0x9848('0x3'));var fs=require('fs');var Redis=require(_0x9848('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9848('0x5'));var logger=require(_0x9848('0x6'))(_0x9848('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9848('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa960d7,_0x9e6934,_0x9203fb){return new BPromise(function(_0x2b6a04,_0x52c0b6){return client[_0x9848('0x9')](_0xa960d7,_0x9203fb)[_0x9848('0xa')](function(_0x515085){logger[_0x9848('0xb')](_0x9848('0xc'),_0x9e6934,_0x9848('0xd'));logger[_0x9848('0xe')](_0x9848('0xf'),_0x9e6934,_0x9848('0xd'),JSON[_0x9848('0x10')](_0x515085));if(_0x515085[_0x9848('0x11')]){if(_0x515085[_0x9848('0x11')][_0x9848('0x12')]===0x1f4){logger['error'](_0x9848('0xc'),_0x9e6934,_0x515085[_0x9848('0x11')]['message']);return _0x52c0b6(_0x515085[_0x9848('0x11')][_0x9848('0x13')]);}logger[_0x9848('0x11')]('SquareRecording,\x20%s,\x20%s',_0x9e6934,_0x515085[_0x9848('0x11')]['message']);return _0x2b6a04(_0x515085[_0x9848('0x11')][_0x9848('0x13')]);}else{logger[_0x9848('0xb')](_0x9848('0xc'),_0x9e6934,'request\x20sent');_0x2b6a04(_0x515085['result'][_0x9848('0x13')]);}})['catch'](function(_0x25dab8){logger[_0x9848('0x11')]('SquareRecording,\x20%s,\x20%s',_0x9e6934,_0x25dab8);_0x52c0b6(_0x25dab8);});});}exports[_0x9848('0x14')]=function(_0x299da9){var _0x5d0058=this;return new Promise(function(_0x17ed54,_0x49f0ef){return db[_0x9848('0x15')][_0x9848('0x16')](_0x299da9[_0x9848('0x17')],{'raw':_0x299da9[_0x9848('0x18')]?_0x299da9[_0x9848('0x18')][_0x9848('0x19')]===undefined?!![]:![]:!![]})[_0x9848('0xa')](function(_0x472925){logger['info'](_0x9848('0x14'),_0x299da9);logger[_0x9848('0xe')]('CreateSquareRecording',_0x299da9,JSON[_0x9848('0x10')](_0x472925));_0x17ed54(_0x472925);})[_0x9848('0x1a')](function(_0x1b200c){logger['error']('CreateSquareRecording',_0x1b200c['message'],_0x299da9);_0x49f0ef(_0x5d0058[_0x9848('0x11')](0x1f4,_0x1b200c[_0x9848('0x13')]));});});}; \ No newline at end of file +var _0x114e=['SquareRecording','create','body','options','CreateSquareRecording','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x114e,0x19c));var _0xe114=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x114e[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0xe114('0x0'));var moment=require(_0xe114('0x1'));var BPromise=require(_0xe114('0x2'));var rs=require(_0xe114('0x3'));var fs=require('fs');var Redis=require(_0xe114('0x4'));var db=require(_0xe114('0x5'))['db'];var utils=require(_0xe114('0x6'));var logger=require(_0xe114('0x7'))(_0xe114('0x8'));var config=require(_0xe114('0x9'));var jayson=require(_0xe114('0xa'));var client=jayson[_0xe114('0xb')][_0xe114('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x28c3ed,_0x425da9,_0x1e1cdd){return new BPromise(function(_0x3b5b77,_0x8531df){return client['request'](_0x28c3ed,_0x1e1cdd)[_0xe114('0xd')](function(_0x131df2){logger[_0xe114('0xe')](_0xe114('0xf'),_0x425da9,_0xe114('0x10'));logger[_0xe114('0x11')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x425da9,'request\x20sent',JSON['stringify'](_0x131df2));if(_0x131df2[_0xe114('0x12')]){if(_0x131df2['error'][_0xe114('0x13')]===0x1f4){logger['error'](_0xe114('0xf'),_0x425da9,_0x131df2['error'][_0xe114('0x14')]);return _0x8531df(_0x131df2[_0xe114('0x12')][_0xe114('0x14')]);}logger['error'](_0xe114('0xf'),_0x425da9,_0x131df2[_0xe114('0x12')][_0xe114('0x14')]);return _0x3b5b77(_0x131df2[_0xe114('0x12')][_0xe114('0x14')]);}else{logger[_0xe114('0xe')](_0xe114('0xf'),_0x425da9,'request\x20sent');_0x3b5b77(_0x131df2[_0xe114('0x15')][_0xe114('0x14')]);}})[_0xe114('0x16')](function(_0x815f76){logger[_0xe114('0x12')](_0xe114('0xf'),_0x425da9,_0x815f76);_0x8531df(_0x815f76);});});}exports['CreateSquareRecording']=function(_0x2866a1){var _0x3f0548=this;return new Promise(function(_0x6ab355,_0x1c2812){return db[_0xe114('0x17')][_0xe114('0x18')](_0x2866a1[_0xe114('0x19')],{'raw':_0x2866a1['options']?_0x2866a1[_0xe114('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xe114('0xd')](function(_0x2c6da5){logger[_0xe114('0xe')](_0xe114('0x1b'),_0x2866a1);logger[_0xe114('0x11')]('CreateSquareRecording',_0x2866a1,JSON[_0xe114('0x1c')](_0x2c6da5));_0x6ab355(_0x2c6da5);})['catch'](function(_0x4e214c){logger[_0xe114('0x12')]('CreateSquareRecording',_0x4e214c[_0xe114('0x14')],_0x2866a1);_0x1c2812(_0x3f0548['error'](0x1f4,_0x4e214c[_0xe114('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 6c2201c..d28d1cd 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 _0x68ae=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','show','post','create','put','/:id','delete','destroy','multer','path','express','Router'];(function(_0x45d0fa,_0x2d3c76){var _0x17490c=function(_0x1b567b){while(--_0x1b567b){_0x45d0fa['push'](_0x45d0fa['shift']());}};_0x17490c(++_0x2d3c76);}(_0x68ae,0x150));var _0xe68a=function(_0x337b1d,_0x38425d){_0x337b1d=_0x337b1d-0x0;var _0x491490=_0x68ae[_0x337b1d];return _0x491490;};'use strict';var multer=require(_0xe68a('0x0'));var util=require('util');var path=require(_0xe68a('0x1'));var timeout=require('connect-timeout');var express=require(_0xe68a('0x2'));var router=express[_0xe68a('0x3')]();var auth=require(_0xe68a('0x4'));var interaction=require(_0xe68a('0x5'));var config=require('../../config/environment');var controller=require('./squareReport.controller');router[_0xe68a('0x6')]('/',auth[_0xe68a('0x7')](),controller[_0xe68a('0x8')]);router[_0xe68a('0x6')]('/describe',auth[_0xe68a('0x7')](),controller[_0xe68a('0x9')]);router[_0xe68a('0x6')]('/:id',auth[_0xe68a('0x7')](),controller[_0xe68a('0xa')]);router[_0xe68a('0xb')]('/',auth[_0xe68a('0x7')](),controller[_0xe68a('0xc')]);router[_0xe68a('0xd')](_0xe68a('0xe'),auth[_0xe68a('0x7')](),controller['update']);router[_0xe68a('0xf')]('/:id',auth[_0xe68a('0x7')](),controller[_0xe68a('0x10')]);module['exports']=router; \ No newline at end of file +var _0x2c34=['create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','show','post'];(function(_0x2ec7ac,_0x22abf3){var _0x1423b4=function(_0x13f1de){while(--_0x13f1de){_0x2ec7ac['push'](_0x2ec7ac['shift']());}};_0x1423b4(++_0x22abf3);}(_0x2c34,0x17c));var _0x42c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2c34[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x42c3('0x0'));var util=require(_0x42c3('0x1'));var path=require('path');var timeout=require(_0x42c3('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x42c3('0x3'));var interaction=require(_0x42c3('0x4'));var config=require(_0x42c3('0x5'));var controller=require('./squareReport.controller');router[_0x42c3('0x6')]('/',auth[_0x42c3('0x7')](),controller['index']);router[_0x42c3('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x42c3('0x8')]);router[_0x42c3('0x6')]('/:id',auth[_0x42c3('0x7')](),controller[_0x42c3('0x9')]);router[_0x42c3('0xa')]('/',auth[_0x42c3('0x7')](),controller[_0x42c3('0xb')]);router[_0x42c3('0xc')](_0x42c3('0xd'),auth[_0x42c3('0x7')](),controller['update']);router[_0x42c3('0xe')](_0x42c3('0xd'),auth[_0x42c3('0x7')](),controller[_0x42c3('0xf')]);module[_0x42c3('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 89706c9..48a1f42 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 _0x50a6=['sequelize','exports','STRING','DATE'];(function(_0x1e36de,_0x23a0e7){var _0x33bea5=function(_0x20036f){while(--_0x20036f){_0x1e36de['push'](_0x1e36de['shift']());}};_0x33bea5(++_0x23a0e7);}(_0x50a6,0xa4));var _0x650a=function(_0x442ede,_0x2c3376){_0x442ede=_0x442ede-0x0;var _0x3b7c68=_0x50a6[_0x442ede];return _0x3b7c68;};'use strict';var Sequelize=require(_0x650a('0x0'));module[_0x650a('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x650a('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x650a('0x2')]},'type':{'type':Sequelize[_0x650a('0x2')]},'uniqueid':{'type':Sequelize[_0x650a('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x650a('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x650a('0x2')]},'callington':{'type':Sequelize[_0x650a('0x2')]},'callingtns':{'type':Sequelize[_0x650a('0x2')]},'dnid':{'type':Sequelize[_0x650a('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x650a('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x650a('0x2')]},'enhanced':{'type':Sequelize[_0x650a('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x650a('0x2')]},'project_name':{'type':Sequelize[_0x650a('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x650a('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xc125=['exports','STRING','DATE'];(function(_0x246115,_0x398123){var _0x385878=function(_0x534a9c){while(--_0x534a9c){_0x246115['push'](_0x246115['shift']());}};_0x385878(++_0x398123);}(_0xc125,0x150));var _0x5c12=function(_0x3d408d,_0x17dd04){_0x3d408d=_0x3d408d-0x0;var _0x219f72=_0xc125[_0x3d408d];return _0x219f72;};'use strict';var Sequelize=require('sequelize');module[_0x5c12('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x5c12('0x1')]},'request':{'type':Sequelize[_0x5c12('0x1')]},'channel':{'type':Sequelize[_0x5c12('0x1')]},'language':{'type':Sequelize[_0x5c12('0x1')]},'type':{'type':Sequelize[_0x5c12('0x1')]},'uniqueid':{'type':Sequelize[_0x5c12('0x1')]},'version':{'type':Sequelize[_0x5c12('0x1')]},'callerid':{'type':Sequelize[_0x5c12('0x1')]},'calleridname':{'type':Sequelize[_0x5c12('0x1')]},'callingpres':{'type':Sequelize[_0x5c12('0x1')]},'callingani2':{'type':Sequelize[_0x5c12('0x1')]},'callington':{'type':Sequelize[_0x5c12('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x5c12('0x1')]},'rdnis':{'type':Sequelize[_0x5c12('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x5c12('0x1')]},'priority':{'type':Sequelize[_0x5c12('0x1')]},'enhanced':{'type':Sequelize[_0x5c12('0x1')]},'accountcode':{'type':Sequelize[_0x5c12('0x1')]},'threadid':{'type':Sequelize[_0x5c12('0x1')]},'project_name':{'type':Sequelize[_0x5c12('0x1')]},'joinAt':{'type':Sequelize[_0x5c12('0x2')]},'leaveAt':{'type':Sequelize[_0x5c12('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index e415605..5f55885 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 _0x3632=['name','index','SquareReport','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','map','type','VIRTUAL','field','merge','includeAll','findAll','rows','params','rawAttributes','length','options','find','catch','create','body','destroy','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack'];(function(_0x22fcf0,_0x2827c5){var _0x2f4637=function(_0x14c781){while(--_0x14c781){_0x22fcf0['push'](_0x22fcf0['shift']());}};_0x2f4637(++_0x2827c5);}(_0x3632,0x6d));var _0x2363=function(_0xc8d0c0,_0x4c31b1){_0xc8d0c0=_0xc8d0c0-0x0;var _0x399f14=_0x3632[_0xc8d0c0];return _0x399f14;};'use strict';var pdf=require(_0x2363('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2363('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2363('0x2'));var rp=require(_0x2363('0x3'));var moment=require(_0x2363('0x4'));var BPromise=require(_0x2363('0x5'));var Mustache=require(_0x2363('0x6'));var util=require(_0x2363('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x2363('0x8'));var ejs=require(_0x2363('0x9'));var fs=require('fs');var _=require(_0x2363('0xa'));var squel=require(_0x2363('0xb'));var crypto=require(_0x2363('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2363('0xd'));var toCsv=require(_0x2363('0x8'));var querystring=require(_0x2363('0xe'));var Papa=require('papaparse');var Redis=require(_0x2363('0xf'));var authService=require(_0x2363('0x10'));var qs=require(_0x2363('0x11'));var hardwareService=require(_0x2363('0x12'));var logger=require(_0x2363('0x13'))(_0x2363('0x14'));var utils=require(_0x2363('0x15'));var config=require(_0x2363('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46d6ac,_0x5c2371){_0x5c2371=_0x5c2371||0xcc;return function(_0xa92150){if(_0xa92150){return _0x46d6ac[_0x2363('0x17')](_0x5c2371);}return _0x46d6ac[_0x2363('0x18')](_0x5c2371)[_0x2363('0x19')]();};}function respondWithResult(_0x52957e,_0x1103e7){_0x1103e7=_0x1103e7||0xc8;return function(_0x256384){if(_0x256384){return _0x52957e['status'](_0x1103e7)['json'](_0x256384);}};}function respondWithFilteredResult(_0x14ed6c,_0x55c5ce){return function(_0x502019){if(_0x502019){var _0x4cdd9d=_0x502019[_0x2363('0x1a')],_0x20c57a=_0x55c5ce['offset'],_0x5952fc=_0x55c5ce[_0x2363('0x1b')]+_0x55c5ce[_0x2363('0x1c')],_0x573077;if(_0x5952fc>=_0x4cdd9d){_0x5952fc=_0x4cdd9d;_0x573077=0xc8;}else{_0x573077=0xce;}_0x14ed6c[_0x2363('0x18')](_0x573077);return _0x14ed6c[_0x2363('0x1d')](_0x2363('0x1e'),_0x20c57a+'-'+_0x5952fc+'/'+_0x4cdd9d)[_0x2363('0x1f')](_0x502019);}return null;};}function patchUpdates(_0x580da1){return function(_0x4da4f4){try{jsonpatch[_0x2363('0x20')](_0x4da4f4,_0x580da1,!![]);}catch(_0x4f6650){return BPromise[_0x2363('0x21')](_0x4f6650);}return _0x4da4f4[_0x2363('0x22')]();};}function saveUpdates(_0x1cdce3,_0x9c076d){return function(_0x1995a1){if(_0x1995a1){return _0x1995a1[_0x2363('0x23')](_0x1cdce3)[_0x2363('0x24')](function(_0x197745){return _0x197745;});}return null;};}function removeEntity(_0x4d8b50,_0x49c56e){return function(_0x7f61aa){if(_0x7f61aa){return _0x7f61aa['destroy']()['then'](function(){_0x4d8b50['status'](0xcc)[_0x2363('0x19')]();});}};}function handleEntityNotFound(_0x5e8469,_0x1981e5){return function(_0x88ac0a){if(!_0x88ac0a){_0x5e8469[_0x2363('0x17')](0x194);}return _0x88ac0a;};}function handleError(_0xbf711b,_0x44f2cf){_0x44f2cf=_0x44f2cf||0x1f4;return function(_0x319b7f){logger[_0x2363('0x25')](_0x319b7f[_0x2363('0x26')]);if(_0x319b7f[_0x2363('0x27')]){delete _0x319b7f[_0x2363('0x27')];}_0xbf711b[_0x2363('0x18')](_0x44f2cf)['send'](_0x319b7f);};}exports[_0x2363('0x28')]=function(_0x7329fe,_0x1c059a){var _0x148056={},_0x31f99b={},_0x453326={'count':0x0,'rows':[]};var _0x27cc64=db[_0x2363('0x29')]['rawAttributes'];_0x31f99b[_0x2363('0x2a')]=_['keys'](_0x27cc64);_0x31f99b[_0x2363('0x2b')]=_[_0x2363('0x2c')](_0x7329fe[_0x2363('0x2b')]);_0x31f99b['filters']=_[_0x2363('0x2d')](_0x31f99b[_0x2363('0x2a')],_0x31f99b[_0x2363('0x2b')]);_0x148056[_0x2363('0x2e')]=_['intersection'](_0x31f99b['model'],qs[_0x2363('0x2f')](_0x7329fe[_0x2363('0x2b')][_0x2363('0x2f')]));_0x148056[_0x2363('0x2e')]=_0x148056[_0x2363('0x2e')]['length']?_0x148056[_0x2363('0x2e')]:_0x31f99b[_0x2363('0x2a')];if(!_0x7329fe['query'][_0x2363('0x30')](_0x2363('0x31'))){_0x148056['limit']=qs[_0x2363('0x1c')](_0x7329fe[_0x2363('0x2b')]['limit']);_0x148056[_0x2363('0x1b')]=qs[_0x2363('0x1b')](_0x7329fe[_0x2363('0x2b')]['offset']);}_0x148056[_0x2363('0x32')]=qs[_0x2363('0x33')](_0x7329fe[_0x2363('0x2b')][_0x2363('0x33')]);_0x148056['where']=qs[_0x2363('0x34')](_[_0x2363('0x35')](_0x7329fe['query'],_0x31f99b['filters']));if(_0x7329fe[_0x2363('0x2b')][_0x2363('0x36')]){_0x148056[_0x2363('0x37')]=_['merge'](_0x148056[_0x2363('0x37')],{'$or':_[_0x2363('0x38')](_0x27cc64,function(_0x53f912){if(_0x53f912[_0x2363('0x39')]['key']!==_0x2363('0x3a')){var _0x172691={};_0x172691[_0x53f912[_0x2363('0x3b')]]={'$like':'%'+_0x7329fe[_0x2363('0x2b')][_0x2363('0x36')]+'%'};return _0x172691;}})});}_0x148056=_[_0x2363('0x3c')]({},_0x148056,_0x7329fe['options']);var _0x2e2b11={'where':_0x148056[_0x2363('0x37')]};return db[_0x2363('0x29')][_0x2363('0x1a')](_0x2e2b11)[_0x2363('0x24')](function(_0x14c065){_0x453326[_0x2363('0x1a')]=_0x14c065;if(_0x7329fe[_0x2363('0x2b')][_0x2363('0x3d')]){_0x148056['include']=[{'all':!![]}];}return db[_0x2363('0x29')][_0x2363('0x3e')](_0x148056);})[_0x2363('0x24')](function(_0x164afa){_0x453326[_0x2363('0x3f')]=_0x164afa;return _0x453326;})[_0x2363('0x24')](respondWithFilteredResult(_0x1c059a,_0x148056))['catch'](handleError(_0x1c059a,null));};exports['show']=function(_0x496707,_0x5f0a45){var _0x50d24c={'raw':!![],'where':{'id':_0x496707[_0x2363('0x40')]['id']}},_0x3c3667={};_0x3c3667[_0x2363('0x2a')]=_[_0x2363('0x2c')](db[_0x2363('0x29')][_0x2363('0x41')]);_0x3c3667[_0x2363('0x2b')]=_[_0x2363('0x2c')](_0x496707[_0x2363('0x2b')]);_0x3c3667[_0x2363('0x34')]=_[_0x2363('0x2d')](_0x3c3667[_0x2363('0x2a')],_0x3c3667[_0x2363('0x2b')]);_0x50d24c['attributes']=_[_0x2363('0x2d')](_0x3c3667['model'],qs[_0x2363('0x2f')](_0x496707['query'][_0x2363('0x2f')]));_0x50d24c[_0x2363('0x2e')]=_0x50d24c[_0x2363('0x2e')][_0x2363('0x42')]?_0x50d24c[_0x2363('0x2e')]:_0x3c3667[_0x2363('0x2a')];if(_0x496707['query'][_0x2363('0x3d')]){_0x50d24c['include']=[{'all':!![]}];}_0x50d24c=_[_0x2363('0x3c')]({},_0x50d24c,_0x496707[_0x2363('0x43')]);return db[_0x2363('0x29')][_0x2363('0x44')](_0x50d24c)[_0x2363('0x24')](handleEntityNotFound(_0x5f0a45,null))[_0x2363('0x24')](respondWithResult(_0x5f0a45,null))[_0x2363('0x45')](handleError(_0x5f0a45,null));};exports[_0x2363('0x46')]=function(_0x303b90,_0xdc9f49){return db[_0x2363('0x29')]['create'](_0x303b90[_0x2363('0x47')],{})[_0x2363('0x24')](respondWithResult(_0xdc9f49,0xc9))[_0x2363('0x45')](handleError(_0xdc9f49,null));};exports['update']=function(_0x55e9f0,_0x4e1b2f){if(_0x55e9f0[_0x2363('0x47')]['id']){delete _0x55e9f0['body']['id'];}return db['SquareReport'][_0x2363('0x44')]({'where':{'id':_0x55e9f0['params']['id']}})['then'](handleEntityNotFound(_0x4e1b2f,null))[_0x2363('0x24')](saveUpdates(_0x55e9f0[_0x2363('0x47')],null))['then'](respondWithResult(_0x4e1b2f,null))[_0x2363('0x45')](handleError(_0x4e1b2f,null));};exports[_0x2363('0x48')]=function(_0x47d521,_0x2a1551){return db[_0x2363('0x29')][_0x2363('0x44')]({'where':{'id':_0x47d521['params']['id']}})[_0x2363('0x24')](handleEntityNotFound(_0x2a1551,null))['then'](removeEntity(_0x2a1551,null))[_0x2363('0x45')](handleError(_0x2a1551,null));};exports[_0x2363('0x49')]=function(_0x13651c,_0x326b9f){return db['SquareReport'][_0x2363('0x49')]()[_0x2363('0x24')](respondWithResult(_0x326b9f,null))[_0x2363('0x45')](handleError(_0x326b9f,null));}; \ No newline at end of file +var _0x68a6=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','SquareReport','rawAttributes','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','type','key','count','includeAll','findAll','rows','catch','show','length','include','find','create','body','params','html-pdf','rimraf','zip-dir','fast-json-patch'];(function(_0x5bd7a3,_0x304931){var _0xb92d65=function(_0x5eab0a){while(--_0x5eab0a){_0x5bd7a3['push'](_0x5bd7a3['shift']());}};_0xb92d65(++_0x304931);}(_0x68a6,0x164));var _0x668a=function(_0x1b141d,_0x53f13e){_0x1b141d=_0x1b141d-0x0;var _0xdaf938=_0x68a6[_0x1b141d];return _0xdaf938;};'use strict';var pdf=require(_0x668a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x668a('0x1'));var zipdir=require(_0x668a('0x2'));var jsonpatch=require(_0x668a('0x3'));var rp=require(_0x668a('0x4'));var moment=require(_0x668a('0x5'));var BPromise=require(_0x668a('0x6'));var Mustache=require(_0x668a('0x7'));var util=require(_0x668a('0x8'));var path=require(_0x668a('0x9'));var sox=require(_0x668a('0xa'));var csv=require(_0x668a('0xb'));var ejs=require(_0x668a('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x668a('0xd'));var crypto=require(_0x668a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x668a('0xf'));var toCsv=require(_0x668a('0xb'));var querystring=require('querystring');var Papa=require(_0x668a('0x10'));var Redis=require(_0x668a('0x11'));var authService=require(_0x668a('0x12'));var qs=require(_0x668a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x668a('0x14'));var utils=require(_0x668a('0x15'));var config=require(_0x668a('0x16'));var db=require(_0x668a('0x17'))['db'];function respondWithStatusCode(_0x556b51,_0x1d24f3){_0x1d24f3=_0x1d24f3||0xcc;return function(_0x1592d2){if(_0x1592d2){return _0x556b51['sendStatus'](_0x1d24f3);}return _0x556b51[_0x668a('0x18')](_0x1d24f3)[_0x668a('0x19')]();};}function respondWithResult(_0x56e060,_0x3b5b0d){_0x3b5b0d=_0x3b5b0d||0xc8;return function(_0x16b0d6){if(_0x16b0d6){return _0x56e060[_0x668a('0x18')](_0x3b5b0d)[_0x668a('0x1a')](_0x16b0d6);}};}function respondWithFilteredResult(_0x465d56,_0x999794){return function(_0x16e8e3){if(_0x16e8e3){var _0x4eb579=_0x16e8e3['count'],_0x209d6f=_0x999794[_0x668a('0x1b')],_0x3ba232=_0x999794['offset']+_0x999794[_0x668a('0x1c')],_0x35d4a7;if(_0x3ba232>=_0x4eb579){_0x3ba232=_0x4eb579;_0x35d4a7=0xc8;}else{_0x35d4a7=0xce;}_0x465d56[_0x668a('0x18')](_0x35d4a7);return _0x465d56['set'](_0x668a('0x1d'),_0x209d6f+'-'+_0x3ba232+'/'+_0x4eb579)[_0x668a('0x1a')](_0x16e8e3);}return null;};}function patchUpdates(_0x59608c){return function(_0x1a1e6a){try{jsonpatch[_0x668a('0x1e')](_0x1a1e6a,_0x59608c,!![]);}catch(_0x3a8887){return BPromise[_0x668a('0x1f')](_0x3a8887);}return _0x1a1e6a[_0x668a('0x20')]();};}function saveUpdates(_0x3cb5ef,_0x9a638a){return function(_0x3c366a){if(_0x3c366a){return _0x3c366a[_0x668a('0x21')](_0x3cb5ef)[_0x668a('0x22')](function(_0x26c9ef){return _0x26c9ef;});}return null;};}function removeEntity(_0x5c1336,_0x398774){return function(_0x1b35c4){if(_0x1b35c4){return _0x1b35c4[_0x668a('0x23')]()[_0x668a('0x22')](function(){_0x5c1336[_0x668a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dd17b,_0x554dfd){return function(_0x17f5ff){if(!_0x17f5ff){_0x2dd17b[_0x668a('0x24')](0x194);}return _0x17f5ff;};}function handleError(_0x4ef220,_0x470f03){_0x470f03=_0x470f03||0x1f4;return function(_0x144a1b){logger[_0x668a('0x25')](_0x144a1b['stack']);if(_0x144a1b[_0x668a('0x26')]){delete _0x144a1b[_0x668a('0x26')];}_0x4ef220['status'](_0x470f03)[_0x668a('0x27')](_0x144a1b);};}exports[_0x668a('0x28')]=function(_0x112f55,_0x2f15f5){var _0xe92162={},_0x459643={},_0xac6dd4={'count':0x0,'rows':[]};var _0x280a50=db[_0x668a('0x29')][_0x668a('0x2a')];_0x459643[_0x668a('0x2b')]=_[_0x668a('0x2c')](_0x280a50);_0x459643[_0x668a('0x2d')]=_[_0x668a('0x2c')](_0x112f55[_0x668a('0x2d')]);_0x459643['filters']=_['intersection'](_0x459643['model'],_0x459643['query']);_0xe92162[_0x668a('0x2e')]=_[_0x668a('0x2f')](_0x459643['model'],qs[_0x668a('0x30')](_0x112f55[_0x668a('0x2d')][_0x668a('0x30')]));_0xe92162[_0x668a('0x2e')]=_0xe92162[_0x668a('0x2e')]['length']?_0xe92162[_0x668a('0x2e')]:_0x459643[_0x668a('0x2b')];if(!_0x112f55[_0x668a('0x2d')][_0x668a('0x31')](_0x668a('0x32'))){_0xe92162['limit']=qs[_0x668a('0x1c')](_0x112f55[_0x668a('0x2d')][_0x668a('0x1c')]);_0xe92162[_0x668a('0x1b')]=qs[_0x668a('0x1b')](_0x112f55[_0x668a('0x2d')][_0x668a('0x1b')]);}_0xe92162['order']=qs[_0x668a('0x33')](_0x112f55[_0x668a('0x2d')][_0x668a('0x33')]);_0xe92162[_0x668a('0x34')]=qs[_0x668a('0x35')](_[_0x668a('0x36')](_0x112f55[_0x668a('0x2d')],_0x459643[_0x668a('0x35')]));if(_0x112f55['query'][_0x668a('0x37')]){_0xe92162[_0x668a('0x34')]=_[_0x668a('0x38')](_0xe92162['where'],{'$or':_[_0x668a('0x39')](_0x280a50,function(_0x40a60c){if(_0x40a60c[_0x668a('0x3a')][_0x668a('0x3b')]!=='VIRTUAL'){var _0x26d364={};_0x26d364[_0x40a60c['field']]={'$like':'%'+_0x112f55[_0x668a('0x2d')][_0x668a('0x37')]+'%'};return _0x26d364;}})});}_0xe92162=_[_0x668a('0x38')]({},_0xe92162,_0x112f55['options']);var _0x49850a={'where':_0xe92162['where']};return db[_0x668a('0x29')][_0x668a('0x3c')](_0x49850a)[_0x668a('0x22')](function(_0x2728a5){_0xac6dd4[_0x668a('0x3c')]=_0x2728a5;if(_0x112f55[_0x668a('0x2d')][_0x668a('0x3d')]){_0xe92162['include']=[{'all':!![]}];}return db[_0x668a('0x29')][_0x668a('0x3e')](_0xe92162);})[_0x668a('0x22')](function(_0x6907e){_0xac6dd4[_0x668a('0x3f')]=_0x6907e;return _0xac6dd4;})[_0x668a('0x22')](respondWithFilteredResult(_0x2f15f5,_0xe92162))[_0x668a('0x40')](handleError(_0x2f15f5,null));};exports[_0x668a('0x41')]=function(_0x84a0f2,_0x2317ec){var _0x401daa={'raw':!![],'where':{'id':_0x84a0f2['params']['id']}},_0x3d46cf={};_0x3d46cf['model']=_[_0x668a('0x2c')](db[_0x668a('0x29')]['rawAttributes']);_0x3d46cf[_0x668a('0x2d')]=_[_0x668a('0x2c')](_0x84a0f2[_0x668a('0x2d')]);_0x3d46cf[_0x668a('0x35')]=_['intersection'](_0x3d46cf[_0x668a('0x2b')],_0x3d46cf['query']);_0x401daa[_0x668a('0x2e')]=_['intersection'](_0x3d46cf['model'],qs['fields'](_0x84a0f2[_0x668a('0x2d')][_0x668a('0x30')]));_0x401daa[_0x668a('0x2e')]=_0x401daa[_0x668a('0x2e')][_0x668a('0x42')]?_0x401daa[_0x668a('0x2e')]:_0x3d46cf[_0x668a('0x2b')];if(_0x84a0f2[_0x668a('0x2d')][_0x668a('0x3d')]){_0x401daa[_0x668a('0x43')]=[{'all':!![]}];}_0x401daa=_[_0x668a('0x38')]({},_0x401daa,_0x84a0f2['options']);return db[_0x668a('0x29')][_0x668a('0x44')](_0x401daa)['then'](handleEntityNotFound(_0x2317ec,null))['then'](respondWithResult(_0x2317ec,null))[_0x668a('0x40')](handleError(_0x2317ec,null));};exports[_0x668a('0x45')]=function(_0x5b2a73,_0x2f693b){return db['SquareReport']['create'](_0x5b2a73['body'],{})[_0x668a('0x22')](respondWithResult(_0x2f693b,0xc9))[_0x668a('0x40')](handleError(_0x2f693b,null));};exports[_0x668a('0x21')]=function(_0x37aa1b,_0x30da16){if(_0x37aa1b[_0x668a('0x46')]['id']){delete _0x37aa1b[_0x668a('0x46')]['id'];}return db[_0x668a('0x29')][_0x668a('0x44')]({'where':{'id':_0x37aa1b['params']['id']}})[_0x668a('0x22')](handleEntityNotFound(_0x30da16,null))['then'](saveUpdates(_0x37aa1b[_0x668a('0x46')],null))[_0x668a('0x22')](respondWithResult(_0x30da16,null))[_0x668a('0x40')](handleError(_0x30da16,null));};exports['destroy']=function(_0x432729,_0x5d501b){return db[_0x668a('0x29')][_0x668a('0x44')]({'where':{'id':_0x432729[_0x668a('0x47')]['id']}})[_0x668a('0x22')](handleEntityNotFound(_0x5d501b,null))[_0x668a('0x22')](removeEntity(_0x5d501b,null))['catch'](handleError(_0x5d501b,null));};exports['describe']=function(_0x4e47a0,_0x2942dc){return db[_0x668a('0x29')]['describe']()['then'](respondWithResult(_0x2942dc,null))[_0x668a('0x40')](handleError(_0x2942dc,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 876405a..1f89d81 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(_0x8fe611,_0x236673){var _0x6a87b2=function(_0x1beaed){while(--_0x1beaed){_0x8fe611['push'](_0x8fe611['shift']());}};_0x6a87b2(++_0x236673);}(_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'));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 _0x9957=['api','bluebird','request-promise','path','rimraf','./squareReport.attributes','exports','define','SquareReport','uid_pname','uniqueid','leaveAt','lodash','util','../../config/logger'];(function(_0x561ad0,_0x38f681){var _0x32ed09=function(_0x32f6df){while(--_0x32f6df){_0x561ad0['push'](_0x561ad0['shift']());}};_0x32ed09(++_0x38f681);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 1df4160..0807f46 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 _0x8cc2=['rpc','jayson/promise','client','http','SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','CreateSquareReport','SquareReport','body','options','then','UpdateSquareReport','update','raw','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5575cd,_0x73ab7a){var _0x4979a0=function(_0x1ac744){while(--_0x1ac744){_0x5575cd['push'](_0x5575cd['shift']());}};_0x4979a0(++_0x73ab7a);}(_0x8cc2,0x1d8));var _0x28cc=function(_0x46bec2,_0x36cde0){_0x46bec2=_0x46bec2-0x0;var _0x39b857=_0x8cc2[_0x46bec2];return _0x39b857;};'use strict';var _=require(_0x28cc('0x0'));var util=require(_0x28cc('0x1'));var moment=require(_0x28cc('0x2'));var BPromise=require(_0x28cc('0x3'));var rs=require(_0x28cc('0x4'));var fs=require('fs');var Redis=require(_0x28cc('0x5'));var db=require(_0x28cc('0x6'))['db'];var utils=require(_0x28cc('0x7'));var logger=require('../../config/logger')(_0x28cc('0x8'));var config=require('../../config/environment');var jayson=require(_0x28cc('0x9'));var client=jayson[_0x28cc('0xa')][_0x28cc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ac662,_0x37cc6b,_0x157241){return new BPromise(function(_0x422a95,_0x4f3c7b){return client['request'](_0x1ac662,_0x157241)['then'](function(_0x30a971){logger['info'](_0x28cc('0xc'),_0x37cc6b,_0x28cc('0xd'));logger[_0x28cc('0xe')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x37cc6b,_0x28cc('0xd'),JSON[_0x28cc('0xf')](_0x30a971));if(_0x30a971[_0x28cc('0x10')]){if(_0x30a971[_0x28cc('0x10')][_0x28cc('0x11')]===0x1f4){logger[_0x28cc('0x10')]('SquareReport,\x20%s,\x20%s',_0x37cc6b,_0x30a971[_0x28cc('0x10')][_0x28cc('0x12')]);return _0x4f3c7b(_0x30a971[_0x28cc('0x10')]['message']);}logger['error']('SquareReport,\x20%s,\x20%s',_0x37cc6b,_0x30a971['error'][_0x28cc('0x12')]);return _0x422a95(_0x30a971[_0x28cc('0x10')][_0x28cc('0x12')]);}else{logger[_0x28cc('0x13')](_0x28cc('0xc'),_0x37cc6b,_0x28cc('0xd'));_0x422a95(_0x30a971['result'][_0x28cc('0x12')]);}})['catch'](function(_0x32545f){logger['error'](_0x28cc('0xc'),_0x37cc6b,_0x32545f);_0x4f3c7b(_0x32545f);});});}exports[_0x28cc('0x14')]=function(_0x2df9af){var _0x35200b=this;return new Promise(function(_0xd75f3b,_0xcfabc9){return db[_0x28cc('0x15')]['create'](_0x2df9af[_0x28cc('0x16')],{'raw':_0x2df9af['options']?_0x2df9af[_0x28cc('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x28cc('0x18')](function(_0x4a6f9b){logger[_0x28cc('0x13')]('CreateSquareReport',_0x2df9af);logger[_0x28cc('0xe')]('CreateSquareReport',_0x2df9af,JSON[_0x28cc('0xf')](_0x4a6f9b));_0xd75f3b(_0x4a6f9b);})['catch'](function(_0x43249c){logger[_0x28cc('0x10')](_0x28cc('0x14'),_0x43249c[_0x28cc('0x12')],_0x2df9af);_0xcfabc9(_0x35200b[_0x28cc('0x10')](0x1f4,_0x43249c[_0x28cc('0x12')]));});});};exports[_0x28cc('0x19')]=function(_0x18a800){var _0x447fef=this;return new Promise(function(_0x420159,_0x51d9ff){return db['SquareReport'][_0x28cc('0x1a')](_0x18a800[_0x28cc('0x16')],{'raw':_0x18a800[_0x28cc('0x17')]?_0x18a800[_0x28cc('0x17')][_0x28cc('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18a800[_0x28cc('0x17')]?_0x18a800[_0x28cc('0x17')][_0x28cc('0x1c')]||null:null,'attributes':_0x18a800[_0x28cc('0x17')]?_0x18a800[_0x28cc('0x17')][_0x28cc('0x1d')]||null:null,'limit':_0x18a800[_0x28cc('0x17')]?_0x18a800[_0x28cc('0x17')]['limit']||null:null})['then'](function(_0x1b34cb){logger[_0x28cc('0x13')](_0x28cc('0x19'),_0x18a800);logger['debug'](_0x28cc('0x19'),_0x18a800,JSON['stringify'](_0x1b34cb));_0x420159(_0x1b34cb);})['catch'](function(_0x48461e){logger[_0x28cc('0x10')](_0x28cc('0x19'),_0x48461e[_0x28cc('0x12')],_0x18a800);_0x51d9ff(_0x447fef['error'](0x1f4,_0x48461e['message']));});});}; \ No newline at end of file +var _0x4799=['debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','create','options','raw','UpdateSquareReport','update','where','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','SquareReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1a8bbc,_0x17a086){var _0x212fc2=function(_0x55c718){while(--_0x55c718){_0x1a8bbc['push'](_0x1a8bbc['shift']());}};_0x212fc2(++_0x17a086);}(_0x4799,0x191));var _0x9479=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4799[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9479('0x0'));var util=require(_0x9479('0x1'));var moment=require('moment');var BPromise=require(_0x9479('0x2'));var rs=require(_0x9479('0x3'));var fs=require('fs');var Redis=require(_0x9479('0x4'));var db=require(_0x9479('0x5'))['db'];var utils=require(_0x9479('0x6'));var logger=require(_0x9479('0x7'))(_0x9479('0x8'));var config=require('../../config/environment');var jayson=require(_0x9479('0x9'));var client=jayson['client'][_0x9479('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9d85fe,_0x2d5863,_0x3909){return new BPromise(function(_0x168629,_0x2b8d74){return client['request'](_0x9d85fe,_0x3909)[_0x9479('0xb')](function(_0x36722a){logger[_0x9479('0xc')](_0x9479('0xd'),_0x2d5863,_0x9479('0xe'));logger[_0x9479('0xf')](_0x9479('0x10'),_0x2d5863,_0x9479('0xe'),JSON[_0x9479('0x11')](_0x36722a));if(_0x36722a[_0x9479('0x12')]){if(_0x36722a[_0x9479('0x12')][_0x9479('0x13')]===0x1f4){logger[_0x9479('0x12')](_0x9479('0xd'),_0x2d5863,_0x36722a[_0x9479('0x12')][_0x9479('0x14')]);return _0x2b8d74(_0x36722a[_0x9479('0x12')][_0x9479('0x14')]);}logger[_0x9479('0x12')](_0x9479('0xd'),_0x2d5863,_0x36722a[_0x9479('0x12')][_0x9479('0x14')]);return _0x168629(_0x36722a[_0x9479('0x12')][_0x9479('0x14')]);}else{logger['info'](_0x9479('0xd'),_0x2d5863,_0x9479('0xe'));_0x168629(_0x36722a[_0x9479('0x15')]['message']);}})[_0x9479('0x16')](function(_0x4b7e4a){logger[_0x9479('0x12')](_0x9479('0xd'),_0x2d5863,_0x4b7e4a);_0x2b8d74(_0x4b7e4a);});});}exports[_0x9479('0x17')]=function(_0x72248e){var _0x1d375=this;return new Promise(function(_0x1c8141,_0xc5251){return db[_0x9479('0x18')][_0x9479('0x19')](_0x72248e['body'],{'raw':_0x72248e[_0x9479('0x1a')]?_0x72248e[_0x9479('0x1a')][_0x9479('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x28de11){logger[_0x9479('0xc')](_0x9479('0x17'),_0x72248e);logger[_0x9479('0xf')](_0x9479('0x17'),_0x72248e,JSON[_0x9479('0x11')](_0x28de11));_0x1c8141(_0x28de11);})['catch'](function(_0x28cf89){logger[_0x9479('0x12')](_0x9479('0x17'),_0x28cf89[_0x9479('0x14')],_0x72248e);_0xc5251(_0x1d375[_0x9479('0x12')](0x1f4,_0x28cf89[_0x9479('0x14')]));});});};exports[_0x9479('0x1c')]=function(_0x5be357){var _0x17b1b5=this;return new Promise(function(_0x4b9964,_0x293c6e){return db['SquareReport'][_0x9479('0x1d')](_0x5be357['body'],{'raw':_0x5be357['options']?_0x5be357[_0x9479('0x1a')][_0x9479('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5be357['options']?_0x5be357[_0x9479('0x1a')][_0x9479('0x1e')]||null:null,'attributes':_0x5be357[_0x9479('0x1a')]?_0x5be357['options']['attributes']||null:null,'limit':_0x5be357['options']?_0x5be357[_0x9479('0x1a')][_0x9479('0x1f')]||null:null})[_0x9479('0xb')](function(_0x527b19){logger[_0x9479('0xc')](_0x9479('0x1c'),_0x5be357);logger[_0x9479('0xf')](_0x9479('0x1c'),_0x5be357,JSON['stringify'](_0x527b19));_0x4b9964(_0x527b19);})[_0x9479('0x16')](function(_0x3821d9){logger[_0x9479('0x12')]('UpdateSquareReport',_0x3821d9[_0x9479('0x14')],_0x5be357);_0x293c6e(_0x17b1b5[_0x9479('0x12')](0x1f4,_0x3821d9['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 89d8c60..a5b6051 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 _0xc72a=['isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','express','../../components/interaction/service','../../config/environment','get','describe','/:id','show','post'];(function(_0x42826e,_0x538edc){var _0x3661cd=function(_0x25519d){while(--_0x25519d){_0x42826e['push'](_0x42826e['shift']());}};_0x3661cd(++_0x538edc);}(_0xc72a,0x97));var _0xac72=function(_0x4cf0b7,_0x560029){_0x4cf0b7=_0x4cf0b7-0x0;var _0x545f10=_0xc72a[_0x4cf0b7];return _0x545f10;};'use strict';var multer=require(_0xac72('0x0'));var util=require(_0xac72('0x1'));var path=require(_0xac72('0x2'));var timeout=require('connect-timeout');var express=require(_0xac72('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xac72('0x4'));var config=require(_0xac72('0x5'));var controller=require('./squareReportDetail.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xac72('0x6')]('/describe',auth['isAuthenticated'](),controller[_0xac72('0x7')]);router['get'](_0xac72('0x8'),auth['isAuthenticated'](),controller[_0xac72('0x9')]);router[_0xac72('0xa')]('/',auth[_0xac72('0xb')](),controller[_0xac72('0xc')]);router[_0xac72('0xd')](_0xac72('0x8'),auth[_0xac72('0xb')](),controller[_0xac72('0xe')]);router[_0xac72('0xf')](_0xac72('0x8'),auth[_0xac72('0xb')](),controller[_0xac72('0x10')]);module[_0xac72('0x11')]=router; \ No newline at end of file +var _0x23e8=['util','path','connect-timeout','express','Router','../../components/auth/service','./squareReportDetail.controller','isAuthenticated','index','get','/describe','/:id','show','post','put','update','delete','destroy','multer'];(function(_0x1748de,_0x2c6093){var _0x1648cd=function(_0x3cf585){while(--_0x3cf585){_0x1748de['push'](_0x1748de['shift']());}};_0x1648cd(++_0x2c6093);}(_0x23e8,0x17b));var _0x823e=function(_0x9d71be,_0x59397c){_0x9d71be=_0x9d71be-0x0;var _0x4091b4=_0x23e8[_0x9d71be];return _0x4091b4;};'use strict';var multer=require(_0x823e('0x0'));var util=require(_0x823e('0x1'));var path=require(_0x823e('0x2'));var timeout=require(_0x823e('0x3'));var express=require(_0x823e('0x4'));var router=express[_0x823e('0x5')]();var auth=require(_0x823e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x823e('0x7'));router['get']('/',auth[_0x823e('0x8')](),controller[_0x823e('0x9')]);router[_0x823e('0xa')](_0x823e('0xb'),auth[_0x823e('0x8')](),controller['describe']);router[_0x823e('0xa')](_0x823e('0xc'),auth['isAuthenticated'](),controller[_0x823e('0xd')]);router[_0x823e('0xe')]('/',auth[_0x823e('0x8')](),controller['create']);router[_0x823e('0xf')](_0x823e('0xc'),auth['isAuthenticated'](),controller[_0x823e('0x10')]);router[_0x823e('0x11')](_0x823e('0xc'),auth[_0x823e('0x8')](),controller[_0x823e('0x12')]);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 0998513..7ed3b0c 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 _0x25a6=['STRING','TEXT','sequelize'];(function(_0x2fc130,_0x1e4dc0){var _0xd5a6d1=function(_0x1375f8){while(--_0x1375f8){_0x2fc130['push'](_0x2fc130['shift']());}};_0xd5a6d1(++_0x1e4dc0);}(_0x25a6,0xef));var _0x625a=function(_0x10e6be,_0x1edf28){_0x10e6be=_0x10e6be-0x0;var _0x5e6961=_0x25a6[_0x10e6be];return _0x5e6961;};'use strict';var Sequelize=require(_0x625a('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x625a('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x625a('0x2')]},'project_name':{'type':Sequelize[_0x625a('0x1')]},'callerid':{'type':Sequelize[_0x625a('0x1')]}}; \ No newline at end of file +var _0x054b=['exports','STRING','TEXT','sequelize'];(function(_0x468172,_0x18c36c){var _0xe35d1a=function(_0x580888){while(--_0x580888){_0x468172['push'](_0x468172['shift']());}};_0xe35d1a(++_0x18c36c);}(_0x054b,0x18b));var _0xb054=function(_0x258ec7,_0x2990c3){_0x258ec7=_0x258ec7-0x0;var _0x2c630d=_0x054b[_0x258ec7];return _0x2c630d;};'use strict';var Sequelize=require(_0xb054('0x0'));module[_0xb054('0x1')]={'uniqueid':{'type':Sequelize[_0xb054('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xb054('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xb054('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 2d97897..9789031 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 _0x436e=['sox','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','offset','limit','set','Content-Range','json','apply','reject','then','status','stack','name','send','index','SquareDetailsReport','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','type','VIRTUAL','field','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','update','find','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x436e,0x191));var _0xe436=function(_0x16ee89,_0x3a8fab){_0x16ee89=_0x16ee89-0x0;var _0x43b5a3=_0x436e[_0x16ee89];return _0x43b5a3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe436('0x0'));var rimraf=require(_0xe436('0x1'));var zipdir=require(_0xe436('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe436('0x3'));var moment=require(_0xe436('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe436('0x5'));var util=require(_0xe436('0x6'));var path=require('path');var sox=require(_0xe436('0x7'));var csv=require('to-csv');var ejs=require(_0xe436('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe436('0x9'));var jsforce=require(_0xe436('0xa'));var deskjs=require(_0xe436('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe436('0xc'));var Papa=require('papaparse');var Redis=require(_0xe436('0xd'));var authService=require(_0xe436('0xe'));var qs=require(_0xe436('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe436('0x10'))(_0xe436('0x11'));var utils=require(_0xe436('0x12'));var config=require(_0xe436('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fe24f,_0x24874c){_0x24874c=_0x24874c||0xcc;return function(_0x3f1950){if(_0x3f1950){return _0x2fe24f[_0xe436('0x14')](_0x24874c);}return _0x2fe24f['status'](_0x24874c)[_0xe436('0x15')]();};}function respondWithResult(_0x10bc7a,_0x58e658){_0x58e658=_0x58e658||0xc8;return function(_0x90717d){if(_0x90717d){return _0x10bc7a['status'](_0x58e658)['json'](_0x90717d);}};}function respondWithFilteredResult(_0x2bf3d7,_0x2b6b3c){return function(_0x3f4f2a){if(_0x3f4f2a){var _0x2a695b=_0x3f4f2a['count'],_0x1a3d12=_0x2b6b3c['offset'],_0x4a6b1e=_0x2b6b3c[_0xe436('0x16')]+_0x2b6b3c[_0xe436('0x17')],_0x369876;if(_0x4a6b1e>=_0x2a695b){_0x4a6b1e=_0x2a695b;_0x369876=0xc8;}else{_0x369876=0xce;}_0x2bf3d7['status'](_0x369876);return _0x2bf3d7[_0xe436('0x18')](_0xe436('0x19'),_0x1a3d12+'-'+_0x4a6b1e+'/'+_0x2a695b)[_0xe436('0x1a')](_0x3f4f2a);}return null;};}function patchUpdates(_0x3ba689){return function(_0x5b5abb){try{jsonpatch[_0xe436('0x1b')](_0x5b5abb,_0x3ba689,!![]);}catch(_0x5cc610){return BPromise[_0xe436('0x1c')](_0x5cc610);}return _0x5b5abb['save']();};}function saveUpdates(_0xc2425c,_0x287c9c){return function(_0x548714){if(_0x548714){return _0x548714['update'](_0xc2425c)[_0xe436('0x1d')](function(_0x13b83c){return _0x13b83c;});}return null;};}function removeEntity(_0x2fe0a1,_0x4c8ddf){return function(_0xb45d41){if(_0xb45d41){return _0xb45d41['destroy']()[_0xe436('0x1d')](function(){_0x2fe0a1[_0xe436('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50d1f3,_0x468c61){return function(_0x30ea1c){if(!_0x30ea1c){_0x50d1f3[_0xe436('0x14')](0x194);}return _0x30ea1c;};}function handleError(_0x24a3e1,_0x5c623c){_0x5c623c=_0x5c623c||0x1f4;return function(_0x31c654){logger['error'](_0x31c654[_0xe436('0x1f')]);if(_0x31c654[_0xe436('0x20')]){delete _0x31c654['name'];}_0x24a3e1[_0xe436('0x1e')](_0x5c623c)[_0xe436('0x21')](_0x31c654);};}exports[_0xe436('0x22')]=function(_0x226583,_0x49c25f){var _0x2d5071={},_0x74d59c={},_0x1897fe={'count':0x0,'rows':[]};var _0x2fac6d=db[_0xe436('0x23')]['rawAttributes'];_0x74d59c[_0xe436('0x24')]=_[_0xe436('0x25')](_0x2fac6d);_0x74d59c[_0xe436('0x26')]=_[_0xe436('0x25')](_0x226583[_0xe436('0x26')]);_0x74d59c['filters']=_[_0xe436('0x27')](_0x74d59c[_0xe436('0x24')],_0x74d59c[_0xe436('0x26')]);_0x2d5071['attributes']=_[_0xe436('0x27')](_0x74d59c[_0xe436('0x24')],qs[_0xe436('0x28')](_0x226583[_0xe436('0x26')][_0xe436('0x28')]));_0x2d5071['attributes']=_0x2d5071[_0xe436('0x29')][_0xe436('0x2a')]?_0x2d5071['attributes']:_0x74d59c[_0xe436('0x24')];if(!_0x226583['query'][_0xe436('0x2b')](_0xe436('0x2c'))){_0x2d5071[_0xe436('0x17')]=qs[_0xe436('0x17')](_0x226583[_0xe436('0x26')][_0xe436('0x17')]);_0x2d5071['offset']=qs['offset'](_0x226583[_0xe436('0x26')][_0xe436('0x16')]);}_0x2d5071[_0xe436('0x2d')]=qs[_0xe436('0x2e')](_0x226583[_0xe436('0x26')]['sort']);_0x2d5071[_0xe436('0x2f')]=qs['filters'](_['pick'](_0x226583[_0xe436('0x26')],_0x74d59c[_0xe436('0x30')]));if(_0x226583[_0xe436('0x26')]['filter']){_0x2d5071[_0xe436('0x2f')]=_['merge'](_0x2d5071[_0xe436('0x2f')],{'$or':_['map'](_0x2fac6d,function(_0xbc08e1){if(_0xbc08e1[_0xe436('0x31')]['key']!==_0xe436('0x32')){var _0x5f0a8d={};_0x5f0a8d[_0xbc08e1[_0xe436('0x33')]]={'$like':'%'+_0x226583[_0xe436('0x26')][_0xe436('0x34')]+'%'};return _0x5f0a8d;}})});}_0x2d5071=_[_0xe436('0x35')]({},_0x2d5071,_0x226583[_0xe436('0x36')]);var _0x2695cd={'where':_0x2d5071[_0xe436('0x2f')]};return db[_0xe436('0x23')]['count'](_0x2695cd)[_0xe436('0x1d')](function(_0x4f7f0a){_0x1897fe['count']=_0x4f7f0a;if(_0x226583[_0xe436('0x26')][_0xe436('0x37')]){_0x2d5071[_0xe436('0x38')]=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x2d5071);})[_0xe436('0x1d')](function(_0x35ebf9){_0x1897fe[_0xe436('0x39')]=_0x35ebf9;return _0x1897fe;})[_0xe436('0x1d')](respondWithFilteredResult(_0x49c25f,_0x2d5071))[_0xe436('0x3a')](handleError(_0x49c25f,null));};exports[_0xe436('0x3b')]=function(_0x5535f9,_0x4f9c6d){var _0x5c4834={'raw':!![],'where':{'id':_0x5535f9[_0xe436('0x3c')]['id']}},_0x3091a0={};_0x3091a0[_0xe436('0x24')]=_[_0xe436('0x25')](db[_0xe436('0x23')][_0xe436('0x3d')]);_0x3091a0['query']=_[_0xe436('0x25')](_0x5535f9[_0xe436('0x26')]);_0x3091a0[_0xe436('0x30')]=_[_0xe436('0x27')](_0x3091a0[_0xe436('0x24')],_0x3091a0[_0xe436('0x26')]);_0x5c4834[_0xe436('0x29')]=_['intersection'](_0x3091a0[_0xe436('0x24')],qs[_0xe436('0x28')](_0x5535f9['query'][_0xe436('0x28')]));_0x5c4834['attributes']=_0x5c4834[_0xe436('0x29')][_0xe436('0x2a')]?_0x5c4834[_0xe436('0x29')]:_0x3091a0[_0xe436('0x24')];if(_0x5535f9[_0xe436('0x26')][_0xe436('0x37')]){_0x5c4834[_0xe436('0x38')]=[{'all':!![]}];}_0x5c4834=_[_0xe436('0x35')]({},_0x5c4834,_0x5535f9[_0xe436('0x36')]);return db[_0xe436('0x23')]['find'](_0x5c4834)[_0xe436('0x1d')](handleEntityNotFound(_0x4f9c6d,null))['then'](respondWithResult(_0x4f9c6d,null))[_0xe436('0x3a')](handleError(_0x4f9c6d,null));};exports['create']=function(_0x284d89,_0xb2c9ea){return db[_0xe436('0x23')][_0xe436('0x3e')](_0x284d89[_0xe436('0x3f')],{})['then'](respondWithResult(_0xb2c9ea,0xc9))[_0xe436('0x3a')](handleError(_0xb2c9ea,null));};exports[_0xe436('0x40')]=function(_0x4518ce,_0x16eab5){if(_0x4518ce[_0xe436('0x3f')]['id']){delete _0x4518ce[_0xe436('0x3f')]['id'];}return db['SquareDetailsReport'][_0xe436('0x41')]({'where':{'id':_0x4518ce[_0xe436('0x3c')]['id']}})[_0xe436('0x1d')](handleEntityNotFound(_0x16eab5,null))[_0xe436('0x1d')](saveUpdates(_0x4518ce[_0xe436('0x3f')],null))[_0xe436('0x1d')](respondWithResult(_0x16eab5,null))[_0xe436('0x3a')](handleError(_0x16eab5,null));};exports[_0xe436('0x42')]=function(_0x4e1ed1,_0x109aa4){return db[_0xe436('0x23')][_0xe436('0x41')]({'where':{'id':_0x4e1ed1[_0xe436('0x3c')]['id']}})[_0xe436('0x1d')](handleEntityNotFound(_0x109aa4,null))[_0xe436('0x1d')](removeEntity(_0x109aa4,null))['catch'](handleError(_0x109aa4,null));};exports[_0xe436('0x43')]=function(_0x225f54,_0x2af1ac){return db['SquareDetailsReport'][_0xe436('0x43')]()[_0xe436('0x1d')](respondWithResult(_0x2af1ac,null))[_0xe436('0x3a')](handleError(_0x2af1ac,null));}; \ No newline at end of file +var _0xa058=['keys','query','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','key','field','options','includeAll','findAll','rows','catch','show','length','include','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','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','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','index','SquareDetailsReport','rawAttributes'];(function(_0xd8f451,_0xb2c18a){var _0x5bbd35=function(_0x41d120){while(--_0x41d120){_0xd8f451['push'](_0xd8f451['shift']());}};_0x5bbd35(++_0xb2c18a);}(_0xa058,0x196));var _0x8a05=function(_0x277107,_0x3420dc){_0x277107=_0x277107-0x0;var _0x1da046=_0xa058[_0x277107];return _0x1da046;};'use strict';var pdf=require(_0x8a05('0x0'));var emlformat=require(_0x8a05('0x1'));var rimraf=require(_0x8a05('0x2'));var zipdir=require(_0x8a05('0x3'));var jsonpatch=require(_0x8a05('0x4'));var rp=require('request-promise');var moment=require(_0x8a05('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8a05('0x6'));var util=require('util');var path=require(_0x8a05('0x7'));var sox=require(_0x8a05('0x8'));var csv=require(_0x8a05('0x9'));var ejs=require(_0x8a05('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8a05('0xb'));var jsforce=require(_0x8a05('0xc'));var deskjs=require(_0x8a05('0xd'));var toCsv=require(_0x8a05('0x9'));var querystring=require(_0x8a05('0xe'));var Papa=require(_0x8a05('0xf'));var Redis=require(_0x8a05('0x10'));var authService=require(_0x8a05('0x11'));var qs=require(_0x8a05('0x12'));var hardwareService=require(_0x8a05('0x13'));var logger=require('../../config/logger')(_0x8a05('0x14'));var utils=require(_0x8a05('0x15'));var config=require(_0x8a05('0x16'));var db=require(_0x8a05('0x17'))['db'];function respondWithStatusCode(_0x3cf981,_0x53bcff){_0x53bcff=_0x53bcff||0xcc;return function(_0x5d68c2){if(_0x5d68c2){return _0x3cf981['sendStatus'](_0x53bcff);}return _0x3cf981['status'](_0x53bcff)[_0x8a05('0x18')]();};}function respondWithResult(_0x2d01fb,_0x3e08c2){_0x3e08c2=_0x3e08c2||0xc8;return function(_0x34f105){if(_0x34f105){return _0x2d01fb[_0x8a05('0x19')](_0x3e08c2)[_0x8a05('0x1a')](_0x34f105);}};}function respondWithFilteredResult(_0xe2c2cb,_0x55d9f0){return function(_0xf6ea14){if(_0xf6ea14){var _0x2289bd=_0xf6ea14[_0x8a05('0x1b')],_0x35ab8f=_0x55d9f0[_0x8a05('0x1c')],_0x1d2fa9=_0x55d9f0[_0x8a05('0x1c')]+_0x55d9f0[_0x8a05('0x1d')],_0x47d8b6;if(_0x1d2fa9>=_0x2289bd){_0x1d2fa9=_0x2289bd;_0x47d8b6=0xc8;}else{_0x47d8b6=0xce;}_0xe2c2cb[_0x8a05('0x19')](_0x47d8b6);return _0xe2c2cb[_0x8a05('0x1e')](_0x8a05('0x1f'),_0x35ab8f+'-'+_0x1d2fa9+'/'+_0x2289bd)[_0x8a05('0x1a')](_0xf6ea14);}return null;};}function patchUpdates(_0x59165f){return function(_0xd060c3){try{jsonpatch['apply'](_0xd060c3,_0x59165f,!![]);}catch(_0x5ac72b){return BPromise[_0x8a05('0x20')](_0x5ac72b);}return _0xd060c3[_0x8a05('0x21')]();};}function saveUpdates(_0xd3b9eb,_0xa208c7){return function(_0x2a551b){if(_0x2a551b){return _0x2a551b[_0x8a05('0x22')](_0xd3b9eb)[_0x8a05('0x23')](function(_0x46d6c7){return _0x46d6c7;});}return null;};}function removeEntity(_0x1360b4,_0x3d0772){return function(_0x3f6862){if(_0x3f6862){return _0x3f6862[_0x8a05('0x24')]()[_0x8a05('0x23')](function(){_0x1360b4['status'](0xcc)[_0x8a05('0x18')]();});}};}function handleEntityNotFound(_0x4fb0ef,_0x4c8ebf){return function(_0x56bed8){if(!_0x56bed8){_0x4fb0ef[_0x8a05('0x25')](0x194);}return _0x56bed8;};}function handleError(_0x3c1548,_0x3b3194){_0x3b3194=_0x3b3194||0x1f4;return function(_0x749573){logger['error'](_0x749573[_0x8a05('0x26')]);if(_0x749573[_0x8a05('0x27')]){delete _0x749573[_0x8a05('0x27')];}_0x3c1548[_0x8a05('0x19')](_0x3b3194)[_0x8a05('0x28')](_0x749573);};}exports[_0x8a05('0x29')]=function(_0x57cff3,_0x5a8ee){var _0x5a5262={},_0xa2f5c9={},_0x1995e8={'count':0x0,'rows':[]};var _0x26553f=db[_0x8a05('0x2a')][_0x8a05('0x2b')];_0xa2f5c9['model']=_[_0x8a05('0x2c')](_0x26553f);_0xa2f5c9[_0x8a05('0x2d')]=_[_0x8a05('0x2c')](_0x57cff3['query']);_0xa2f5c9['filters']=_['intersection'](_0xa2f5c9[_0x8a05('0x2e')],_0xa2f5c9['query']);_0x5a5262[_0x8a05('0x2f')]=_[_0x8a05('0x30')](_0xa2f5c9[_0x8a05('0x2e')],qs[_0x8a05('0x31')](_0x57cff3[_0x8a05('0x2d')][_0x8a05('0x31')]));_0x5a5262[_0x8a05('0x2f')]=_0x5a5262[_0x8a05('0x2f')]['length']?_0x5a5262[_0x8a05('0x2f')]:_0xa2f5c9[_0x8a05('0x2e')];if(!_0x57cff3['query'][_0x8a05('0x32')](_0x8a05('0x33'))){_0x5a5262[_0x8a05('0x1d')]=qs[_0x8a05('0x1d')](_0x57cff3[_0x8a05('0x2d')][_0x8a05('0x1d')]);_0x5a5262[_0x8a05('0x1c')]=qs[_0x8a05('0x1c')](_0x57cff3[_0x8a05('0x2d')][_0x8a05('0x1c')]);}_0x5a5262[_0x8a05('0x34')]=qs[_0x8a05('0x35')](_0x57cff3[_0x8a05('0x2d')][_0x8a05('0x35')]);_0x5a5262[_0x8a05('0x36')]=qs['filters'](_[_0x8a05('0x37')](_0x57cff3[_0x8a05('0x2d')],_0xa2f5c9[_0x8a05('0x38')]));if(_0x57cff3[_0x8a05('0x2d')][_0x8a05('0x39')]){_0x5a5262[_0x8a05('0x36')]=_[_0x8a05('0x3a')](_0x5a5262[_0x8a05('0x36')],{'$or':_[_0x8a05('0x3b')](_0x26553f,function(_0x3d0d76){if(_0x3d0d76['type'][_0x8a05('0x3c')]!=='VIRTUAL'){var _0xa6788d={};_0xa6788d[_0x3d0d76[_0x8a05('0x3d')]]={'$like':'%'+_0x57cff3[_0x8a05('0x2d')][_0x8a05('0x39')]+'%'};return _0xa6788d;}})});}_0x5a5262=_[_0x8a05('0x3a')]({},_0x5a5262,_0x57cff3[_0x8a05('0x3e')]);var _0x52949a={'where':_0x5a5262[_0x8a05('0x36')]};return db[_0x8a05('0x2a')]['count'](_0x52949a)['then'](function(_0x414531){_0x1995e8[_0x8a05('0x1b')]=_0x414531;if(_0x57cff3[_0x8a05('0x2d')][_0x8a05('0x3f')]){_0x5a5262['include']=[{'all':!![]}];}return db[_0x8a05('0x2a')][_0x8a05('0x40')](_0x5a5262);})[_0x8a05('0x23')](function(_0x492d02){_0x1995e8[_0x8a05('0x41')]=_0x492d02;return _0x1995e8;})[_0x8a05('0x23')](respondWithFilteredResult(_0x5a8ee,_0x5a5262))[_0x8a05('0x42')](handleError(_0x5a8ee,null));};exports[_0x8a05('0x43')]=function(_0xdf0111,_0x140ef4){var _0x321622={'raw':!![],'where':{'id':_0xdf0111['params']['id']}},_0x18f9ba={};_0x18f9ba[_0x8a05('0x2e')]=_['keys'](db[_0x8a05('0x2a')][_0x8a05('0x2b')]);_0x18f9ba[_0x8a05('0x2d')]=_[_0x8a05('0x2c')](_0xdf0111[_0x8a05('0x2d')]);_0x18f9ba[_0x8a05('0x38')]=_[_0x8a05('0x30')](_0x18f9ba[_0x8a05('0x2e')],_0x18f9ba[_0x8a05('0x2d')]);_0x321622['attributes']=_['intersection'](_0x18f9ba[_0x8a05('0x2e')],qs[_0x8a05('0x31')](_0xdf0111[_0x8a05('0x2d')]['fields']));_0x321622[_0x8a05('0x2f')]=_0x321622[_0x8a05('0x2f')][_0x8a05('0x44')]?_0x321622[_0x8a05('0x2f')]:_0x18f9ba[_0x8a05('0x2e')];if(_0xdf0111['query'][_0x8a05('0x3f')]){_0x321622[_0x8a05('0x45')]=[{'all':!![]}];}_0x321622=_[_0x8a05('0x3a')]({},_0x321622,_0xdf0111[_0x8a05('0x3e')]);return db[_0x8a05('0x2a')][_0x8a05('0x46')](_0x321622)[_0x8a05('0x23')](handleEntityNotFound(_0x140ef4,null))['then'](respondWithResult(_0x140ef4,null))['catch'](handleError(_0x140ef4,null));};exports['create']=function(_0x732172,_0x255212){return db[_0x8a05('0x2a')][_0x8a05('0x47')](_0x732172[_0x8a05('0x48')],{})[_0x8a05('0x23')](respondWithResult(_0x255212,0xc9))['catch'](handleError(_0x255212,null));};exports['update']=function(_0x4a57c4,_0x2ae94c){if(_0x4a57c4[_0x8a05('0x48')]['id']){delete _0x4a57c4[_0x8a05('0x48')]['id'];}return db['SquareDetailsReport'][_0x8a05('0x46')]({'where':{'id':_0x4a57c4[_0x8a05('0x49')]['id']}})['then'](handleEntityNotFound(_0x2ae94c,null))[_0x8a05('0x23')](saveUpdates(_0x4a57c4[_0x8a05('0x48')],null))['then'](respondWithResult(_0x2ae94c,null))[_0x8a05('0x42')](handleError(_0x2ae94c,null));};exports[_0x8a05('0x24')]=function(_0x4349ea,_0x1a89f8){return db['SquareDetailsReport'][_0x8a05('0x46')]({'where':{'id':_0x4349ea[_0x8a05('0x49')]['id']}})[_0x8a05('0x23')](handleEntityNotFound(_0x1a89f8,null))[_0x8a05('0x23')](removeEntity(_0x1a89f8,null))[_0x8a05('0x42')](handleError(_0x1a89f8,null));};exports[_0x8a05('0x4a')]=function(_0x324e56,_0x4ae5c9){return db[_0x8a05('0x2a')][_0x8a05('0x4a')]()[_0x8a05('0x23')](respondWithResult(_0x4ae5c9,null))[_0x8a05('0x42')](handleError(_0x4ae5c9,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 8986d85..7f1b295 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 _0x980e=['api','bluebird','path','rimraf','exports','define','SquareDetailsReport','report_square_details','lodash'];(function(_0x7e39d6,_0x18f794){var _0x3ee0b8=function(_0x146c3b){while(--_0x146c3b){_0x7e39d6['push'](_0x7e39d6['shift']());}};_0x3ee0b8(++_0x18f794);}(_0x980e,0x1a6));var _0xe980=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x980e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe980('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe980('0x1'));var moment=require('moment');var BPromise=require(_0xe980('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe980('0x3'));var rimraf=require(_0xe980('0x4'));var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0xe980('0x5')]=function(_0x55b114,_0x539945){return _0x55b114[_0xe980('0x6')](_0xe980('0x7'),attributes,{'tableName':_0xe980('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdfa0=['path','../../config/environment','exports','define','SquareDetailsReport','report_square_details','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x1b42f9,_0x52c76d){var _0x167257=function(_0x253763){while(--_0x253763){_0x1b42f9['push'](_0x1b42f9['shift']());}};_0x167257(++_0x52c76d);}(_0xdfa0,0x69));var _0x0dfa=function(_0x343a47,_0x12ba35){_0x343a47=_0x343a47-0x0;var _0x25d38f=_0xdfa0[_0x343a47];return _0x25d38f;};'use strict';var _=require(_0x0dfa('0x0'));var util=require('util');var logger=require(_0x0dfa('0x1'))(_0x0dfa('0x2'));var moment=require('moment');var BPromise=require(_0x0dfa('0x3'));var rp=require(_0x0dfa('0x4'));var fs=require('fs');var path=require(_0x0dfa('0x5'));var rimraf=require('rimraf');var config=require(_0x0dfa('0x6'));var attributes=require('./squareReportDetail.attributes');module[_0x0dfa('0x7')]=function(_0x2efe20,_0x4830b6){return _0x2efe20[_0x0dfa('0x8')](_0x0dfa('0x9'),attributes,{'tableName':_0x0dfa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index d7126c4..0aeca75 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 _0x95f4=['CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','debug','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','result'];(function(_0xc5775d,_0x3701ab){var _0x3b4edd=function(_0x37c3cb){while(--_0x37c3cb){_0xc5775d['push'](_0xc5775d['shift']());}};_0x3b4edd(++_0x3701ab);}(_0x95f4,0xf1));var _0x495f=function(_0x222508,_0x2b9eb5){_0x222508=_0x222508-0x0;var _0x4681d9=_0x95f4[_0x222508];return _0x4681d9;};'use strict';var _=require(_0x495f('0x0'));var util=require(_0x495f('0x1'));var moment=require(_0x495f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x495f('0x3'));var db=require(_0x495f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x495f('0x5'));var config=require(_0x495f('0x6'));var jayson=require(_0x495f('0x7'));var client=jayson['client'][_0x495f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x435e2a,_0x304274,_0x4c17af){return new BPromise(function(_0x2103a4,_0x4610a7){return client[_0x495f('0x9')](_0x435e2a,_0x4c17af)['then'](function(_0x55dc23){logger[_0x495f('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0x304274,_0x495f('0xb'));logger['debug'](_0x495f('0xc'),_0x304274,_0x495f('0xb'),JSON[_0x495f('0xd')](_0x55dc23));if(_0x55dc23[_0x495f('0xe')]){if(_0x55dc23['error'][_0x495f('0xf')]===0x1f4){logger[_0x495f('0xe')](_0x495f('0x10'),_0x304274,_0x55dc23[_0x495f('0xe')][_0x495f('0x11')]);return _0x4610a7(_0x55dc23['error'][_0x495f('0x11')]);}logger[_0x495f('0xe')](_0x495f('0x10'),_0x304274,_0x55dc23[_0x495f('0xe')][_0x495f('0x11')]);return _0x2103a4(_0x55dc23[_0x495f('0xe')][_0x495f('0x11')]);}else{logger['info'](_0x495f('0x10'),_0x304274,_0x495f('0xb'));_0x2103a4(_0x55dc23[_0x495f('0x12')][_0x495f('0x11')]);}})['catch'](function(_0x20f97c){logger[_0x495f('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x304274,_0x20f97c);_0x4610a7(_0x20f97c);});});}exports[_0x495f('0x13')]=function(_0x18eb80){var _0x12b102=this;return new Promise(function(_0x58bcc9,_0x11ff26){return db[_0x495f('0x14')][_0x495f('0x15')](_0x18eb80[_0x495f('0x16')],{'raw':_0x18eb80['options']?_0x18eb80[_0x495f('0x17')][_0x495f('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x401fed){logger['info'](_0x495f('0x13'),_0x18eb80);logger[_0x495f('0x19')](_0x495f('0x13'),_0x18eb80,JSON[_0x495f('0xd')](_0x401fed));_0x58bcc9(_0x401fed);})['catch'](function(_0x5d3d92){logger[_0x495f('0xe')]('CreateSquareDetailsReport',_0x5d3d92[_0x495f('0x11')],_0x18eb80);_0x11ff26(_0x12b102[_0x495f('0xe')](0x1f4,_0x5d3d92['message']));});});}; \ No newline at end of file +var _0x9f7a=['then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','http','request'];(function(_0xd93b26,_0x12bbf2){var _0x25f668=function(_0x133ff7){while(--_0x133ff7){_0xd93b26['push'](_0xd93b26['shift']());}};_0x25f668(++_0x12bbf2);}(_0x9f7a,0xf1));var _0xa9f7=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x9f7a[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0xa9f7('0x0'));var util=require(_0xa9f7('0x1'));var moment=require(_0xa9f7('0x2'));var BPromise=require(_0xa9f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9f7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa9f7('0x5'));var config=require(_0xa9f7('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa9f7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5497c8,_0x48e791,_0x5bf7ca){return new BPromise(function(_0x21010f,_0x58a3f3){return client[_0xa9f7('0x8')](_0x5497c8,_0x5bf7ca)[_0xa9f7('0x9')](function(_0x287478){logger['info'](_0xa9f7('0xa'),_0x48e791,_0xa9f7('0xb'));logger['debug'](_0xa9f7('0xc'),_0x48e791,_0xa9f7('0xb'),JSON[_0xa9f7('0xd')](_0x287478));if(_0x287478[_0xa9f7('0xe')]){if(_0x287478[_0xa9f7('0xe')][_0xa9f7('0xf')]===0x1f4){logger[_0xa9f7('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x48e791,_0x287478[_0xa9f7('0xe')]['message']);return _0x58a3f3(_0x287478[_0xa9f7('0xe')][_0xa9f7('0x10')]);}logger[_0xa9f7('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x48e791,_0x287478['error'][_0xa9f7('0x10')]);return _0x21010f(_0x287478['error']['message']);}else{logger[_0xa9f7('0x11')](_0xa9f7('0xa'),_0x48e791,_0xa9f7('0xb'));_0x21010f(_0x287478['result'][_0xa9f7('0x10')]);}})[_0xa9f7('0x12')](function(_0x2aeadd){logger['error'](_0xa9f7('0xa'),_0x48e791,_0x2aeadd);_0x58a3f3(_0x2aeadd);});});}exports[_0xa9f7('0x13')]=function(_0x230904){var _0x11652b=this;return new Promise(function(_0x8da225,_0xf01914){return db[_0xa9f7('0x14')][_0xa9f7('0x15')](_0x230904[_0xa9f7('0x16')],{'raw':_0x230904['options']?_0x230904[_0xa9f7('0x17')][_0xa9f7('0x18')]===undefined?!![]:![]:!![]})[_0xa9f7('0x9')](function(_0x28590b){logger[_0xa9f7('0x11')]('CreateSquareDetailsReport',_0x230904);logger['debug']('CreateSquareDetailsReport',_0x230904,JSON['stringify'](_0x28590b));_0x8da225(_0x28590b);})['catch'](function(_0x4b7202){logger['error'](_0xa9f7('0x13'),_0x4b7202['message'],_0x230904);_0xf01914(_0x11652b['error'](0x1f4,_0x4b7202[_0xa9f7('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index ae0d2d0..7527a84 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 _0xa2b6=['get','isAuthenticated','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0xa2b6,0xdd));var _0x6a2b=function(_0x3f3120,_0x2d9f08){_0x3f3120=_0x3f3120-0x0;var _0x9b438d=_0xa2b6[_0x3f3120];return _0x9b438d;};'use strict';var express=require(_0x6a2b('0x0'));var router=express[_0x6a2b('0x1')]();var auth=require(_0x6a2b('0x2'));var controller=require('./system.controller');router[_0x6a2b('0x3')]('/',auth[_0x6a2b('0x4')](),controller['index']);router['get'](_0x6a2b('0x5'),auth['isAuthenticated'](),controller[_0x6a2b('0x6')]);module[_0x6a2b('0x7')]=router; \ No newline at end of file +var _0x1fc3=['get','index','/process/:pid/kill','killProcess','exports','Router','../../components/auth/service'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x1fc3,0x116));var _0x31fc=function(_0x272f51,_0x4acb53){_0x272f51=_0x272f51-0x0;var _0x44b5c3=_0x1fc3[_0x272f51];return _0x44b5c3;};'use strict';var express=require('express');var router=express[_0x31fc('0x0')]();var auth=require(_0x31fc('0x1'));var controller=require('./system.controller');router[_0x31fc('0x2')]('/',auth['isAuthenticated'](),controller[_0x31fc('0x3')]);router[_0x31fc('0x2')](_0x31fc('0x4'),auth['isAuthenticated'](),controller[_0x31fc('0x5')]);module[_0x31fc('0x6')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 07a13dd..a27263c 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 _0x7b24=['systeminformation','exec','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','send','index','then','status','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b24,0x10e));var _0x47b2=function(_0x35d1e8,_0x5f514c){_0x35d1e8=_0x35d1e8-0x0;var _0x18fa84=_0x7b24[_0x35d1e8];return _0x18fa84;};'use strict';var info=require(_0x47b2('0x0'));var exec=require('child_process')[_0x47b2('0x1')];var logger=require('../../config/logger')(_0x47b2('0x2'));var util=require(_0x47b2('0x3'));var BPromise=require(_0x47b2('0x4'));var _=require(_0x47b2('0x5'));function handleError(_0xcecbdd,_0x2793fc,_0x542b92){_0x2793fc=_0x2793fc||0x1f4;return function(_0x3abed0){logger[_0x47b2('0x6')](_0x47b2('0x7'),_0x542b92,_0x2793fc,util[_0x47b2('0x8')](_0x3abed0,{'showHidden':![],'depth':null}));delete _0x3abed0['name'];_0xcecbdd['status'](_0x2793fc)[_0x47b2('0x9')](_0x3abed0);};}exports[_0x47b2('0xa')]=function(_0x1a75e9,_0x1ac98c){return info['getAllData']()[_0x47b2('0xb')](function(_0x5e7d2f){return _0x1ac98c[_0x47b2('0xc')](0xc8)['json'](_0x5e7d2f);})['catch'](function(_0x23ec1e){return _0x1ac98c[_0x47b2('0xc')](0x1f4)[_0x47b2('0xd')](_0x23ec1e);});};exports[_0x47b2('0xe')]=function(_0x440d32,_0x5f4235){var _0x251b3c=[_0x47b2('0xf')];return new BPromise(function(_0x215f4c,_0x314555){return exec(util[_0x47b2('0x10')](_0x47b2('0x11'),_0x440d32['params']['pid']),function(_0x406097,_0x2e0c85,_0x237ceb){if(_0x406097){return _0x314555(_0x406097);}return _0x215f4c(_0x2e0c85);});})[_0x47b2('0xb')](function(_0x5d7ddb){var _0x5a0cc7=![];var _0x6c359d=_0x5d7ddb['split'](/\n/);for(var _0x447f40=0x0,_0x4d739c=_0x251b3c[_0x47b2('0x12')];_0x447f40<_0x4d739c,_0x5a0cc7===![];_0x447f40+=0x1){if(_0x5d7ddb[_0x47b2('0x13')](_0x251b3c[_0x447f40])>=0x0){_0x5a0cc7=!![];}}if(!_0x5a0cc7){throw new Error(util[_0x47b2('0x10')](_0x47b2('0x14'),_0x440d32[_0x47b2('0x15')][_0x47b2('0x16')]));}process[_0x47b2('0x17')](_0x440d32[_0x47b2('0x15')]['pid'],_0x47b2('0x18'));return _0x5f4235[_0x47b2('0xc')](0xc8)[_0x47b2('0xd')]({'message':util[_0x47b2('0x10')](_0x47b2('0x19'),_0x440d32[_0x47b2('0x15')]['pid'])});})[_0x47b2('0x1a')](handleError(_0x5f4235,null,_0x47b2('0xe')));}; \ No newline at end of file +var _0x4a5b=['length','Process\x20with\x20pid\x20%s\x20not\x20found!','params','pid','SIGINT','catch','killProcess','systeminformation','exec','api','util','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','components/import/cm','format','split'];(function(_0x7eaf9f,_0x400e11){var _0x2cd2bc=function(_0x50eba9){while(--_0x50eba9){_0x7eaf9f['push'](_0x7eaf9f['shift']());}};_0x2cd2bc(++_0x400e11);}(_0x4a5b,0xf7));var _0xb4a5=function(_0x3b5851,_0x27c4ec){_0x3b5851=_0x3b5851-0x0;var _0x2e7965=_0x4a5b[_0x3b5851];return _0x2e7965;};'use strict';var info=require(_0xb4a5('0x0'));var exec=require('child_process')[_0xb4a5('0x1')];var logger=require('../../config/logger')(_0xb4a5('0x2'));var util=require(_0xb4a5('0x3'));var BPromise=require('bluebird');var _=require(_0xb4a5('0x4'));function handleError(_0x83cd5a,_0x460061,_0x51ad3a){_0x460061=_0x460061||0x1f4;return function(_0x17fe0e){logger['error'](_0xb4a5('0x5'),_0x51ad3a,_0x460061,util[_0xb4a5('0x6')](_0x17fe0e,{'showHidden':![],'depth':null}));delete _0x17fe0e[_0xb4a5('0x7')];_0x83cd5a[_0xb4a5('0x8')](_0x460061)[_0xb4a5('0x9')](_0x17fe0e);};}exports[_0xb4a5('0xa')]=function(_0x4477b5,_0x249398){return info[_0xb4a5('0xb')]()[_0xb4a5('0xc')](function(_0xefb742){return _0x249398[_0xb4a5('0x8')](0xc8)[_0xb4a5('0xd')](_0xefb742);})['catch'](function(_0x4a3014){return _0x249398['status'](0x1f4)[_0xb4a5('0xd')](_0x4a3014);});};exports['killProcess']=function(_0xd28b29,_0x589650){var _0x4df038=[_0xb4a5('0xe')];return new BPromise(function(_0x496690,_0x3ca4de){return exec(util[_0xb4a5('0xf')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0xd28b29['params']['pid']),function(_0x17995e,_0x537395,_0x34c85d){if(_0x17995e){return _0x3ca4de(_0x17995e);}return _0x496690(_0x537395);});})[_0xb4a5('0xc')](function(_0x48a7b0){var _0x4d3769=![];var _0x2436a3=_0x48a7b0[_0xb4a5('0x10')](/\n/);for(var _0x237792=0x0,_0x5b052c=_0x4df038[_0xb4a5('0x11')];_0x237792<_0x5b052c,_0x4d3769===![];_0x237792+=0x1){if(_0x48a7b0['indexOf'](_0x4df038[_0x237792])>=0x0){_0x4d3769=!![];}}if(!_0x4d3769){throw new Error(util[_0xb4a5('0xf')](_0xb4a5('0x12'),_0xd28b29[_0xb4a5('0x13')][_0xb4a5('0x14')]));}process['kill'](_0xd28b29[_0xb4a5('0x13')]['pid'],_0xb4a5('0x15'));return _0x589650[_0xb4a5('0x8')](0xc8)[_0xb4a5('0xd')]({'message':util[_0xb4a5('0xf')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0xd28b29[_0xb4a5('0x13')][_0xb4a5('0x14')])});})[_0xb4a5('0x16')](handleError(_0x589650,null,_0xb4a5('0x17')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index a01dfda..4ee04bd 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 _0xbaf0=['get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./tag.controller'];(function(_0x1cbcb2,_0x1237a3){var _0x41ac9f=function(_0xe32e6f){while(--_0xe32e6f){_0x1cbcb2['push'](_0x1cbcb2['shift']());}};_0x41ac9f(++_0x1237a3);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['post']('/',auth[_0x0baf('0x9')](),controller['create']);router[_0x0baf('0xd')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);module[_0x0baf('0x11')]=router; \ No newline at end of file +var _0x5eb8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','path','connect-timeout','express','Router'];(function(_0x5bf82d,_0x290676){var _0x35122d=function(_0x1d5569){while(--_0x1d5569){_0x5bf82d['push'](_0x5bf82d['shift']());}};_0x35122d(++_0x290676);}(_0x5eb8,0xb0));var _0x85eb=function(_0x1fd3e2,_0x1a6772){_0x1fd3e2=_0x1fd3e2-0x0;var _0x5a9210=_0x5eb8[_0x1fd3e2];return _0x5a9210;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var auth=require(_0x85eb('0x4'));var interaction=require(_0x85eb('0x5'));var config=require(_0x85eb('0x6'));var controller=require(_0x85eb('0x7'));router[_0x85eb('0x8')]('/',auth[_0x85eb('0x9')](),controller[_0x85eb('0xa')]);router[_0x85eb('0x8')]('/:id',auth[_0x85eb('0x9')](),controller[_0x85eb('0xb')]);router[_0x85eb('0xc')]('/',auth['isAuthenticated'](),controller[_0x85eb('0xd')]);router['put'](_0x85eb('0xe'),auth[_0x85eb('0x9')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xe'),auth[_0x85eb('0x9')](),controller[_0x85eb('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 5fff413..99b84a5 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 _0xacc5=['exports','STRING','name','#0091EA','sequelize'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xacc5,0xc2));var _0x5acc=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xacc5[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x5acc('0x0'));module[_0x5acc('0x1')]={'name':{'type':Sequelize[_0x5acc('0x2')],'unique':_0x5acc('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x5acc('0x2')],'defaultValue':_0x5acc('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8e37=['STRING','name','#0091EA','sequelize','exports'];(function(_0x539f16,_0xaa0bc2){var _0x2e8781=function(_0xd98c37){while(--_0xd98c37){_0x539f16['push'](_0x539f16['shift']());}};_0x2e8781(++_0xaa0bc2);}(_0x8e37,0x1ed));var _0x78e3=function(_0x3642f1,_0x7ff13a){_0x3642f1=_0x3642f1-0x0;var _0x558a21=_0x8e37[_0x3642f1];return _0x558a21;};'use strict';var Sequelize=require(_0x78e3('0x0'));module[_0x78e3('0x1')]={'name':{'type':Sequelize[_0x78e3('0x2')],'unique':_0x78e3('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x78e3('0x2')],'defaultValue':_0x78e3('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index e014c96..dc0a0c3 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 _0x053f=['sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','Tags','UserProfileResource','name','send','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','type','key','field','Tag','includeAll','include','rows','params','rawAttributes','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','api','../../config/utils'];(function(_0x4d4b14,_0x159755){var _0x400a89=function(_0x3186d4){while(--_0x3186d4){_0x4d4b14['push'](_0x4d4b14['shift']());}};_0x400a89(++_0x159755);}(_0x053f,0x7d));var _0xf053=function(_0x47bb71,_0x4da94f){_0x47bb71=_0x47bb71-0x0;var _0x46005c=_0x053f[_0x47bb71];return _0x46005c;};'use strict';var pdf=require(_0xf053('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf053('0x1'));var zipdir=require(_0xf053('0x2'));var jsonpatch=require(_0xf053('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf053('0x4'));var util=require(_0xf053('0x5'));var path=require(_0xf053('0x6'));var sox=require(_0xf053('0x7'));var csv=require('to-csv');var ejs=require(_0xf053('0x8'));var fs=require('fs');var _=require(_0xf053('0x9'));var squel=require(_0xf053('0xa'));var crypto=require(_0xf053('0xb'));var jsforce=require(_0xf053('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf053('0xd'));var querystring=require(_0xf053('0xe'));var Papa=require(_0xf053('0xf'));var Redis=require(_0xf053('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf053('0x11'));var utils=require(_0xf053('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f2a0c,_0x4bd8ba){_0x4bd8ba=_0x4bd8ba||0xcc;return function(_0x3b40d2){if(_0x3b40d2){return _0x5f2a0c[_0xf053('0x13')](_0x4bd8ba);}return _0x5f2a0c['status'](_0x4bd8ba)[_0xf053('0x14')]();};}function respondWithResult(_0x15d94c,_0x1e6711){_0x1e6711=_0x1e6711||0xc8;return function(_0x573b4c){if(_0x573b4c){return _0x15d94c[_0xf053('0x15')](_0x1e6711)[_0xf053('0x16')](_0x573b4c);}};}function respondWithFilteredResult(_0x188464,_0x114f63){return function(_0x4688ae){if(_0x4688ae){var _0x2a798a=_0x4688ae[_0xf053('0x17')],_0x3204c2=_0x114f63[_0xf053('0x18')],_0x5e97f6=_0x114f63[_0xf053('0x18')]+_0x114f63[_0xf053('0x19')],_0x1aab71;if(_0x5e97f6>=_0x2a798a){_0x5e97f6=_0x2a798a;_0x1aab71=0xc8;}else{_0x1aab71=0xce;}_0x188464['status'](_0x1aab71);return _0x188464[_0xf053('0x1a')](_0xf053('0x1b'),_0x3204c2+'-'+_0x5e97f6+'/'+_0x2a798a)['json'](_0x4688ae);}return null;};}function patchUpdates(_0x2b6efa){return function(_0x5b0bd7){try{jsonpatch['apply'](_0x5b0bd7,_0x2b6efa,!![]);}catch(_0xf1bf25){return BPromise[_0xf053('0x1c')](_0xf1bf25);}return _0x5b0bd7[_0xf053('0x1d')]();};}function saveUpdates(_0x13d3a9,_0xcdb29a){return function(_0x3901b0){if(_0x3901b0){return _0x3901b0[_0xf053('0x1e')](_0x13d3a9)[_0xf053('0x1f')](function(_0x3abe34){return _0x3abe34;});}return null;};}function removeEntity(_0x11b3d,_0x1fbf35){return function(_0x179dcc){if(_0x179dcc){return _0x179dcc[_0xf053('0x20')]()[_0xf053('0x1f')](function(){var _0x45c3e0=_0x179dcc['get']({'plain':!![]});var _0x378c1a=_0xf053('0x21');return db[_0xf053('0x22')]['destroy']({'where':{'type':_0x378c1a,'resourceId':_0x45c3e0['id']}})[_0xf053('0x1f')](function(){return _0x179dcc;});})['then'](function(){_0x11b3d[_0xf053('0x15')](0xcc)[_0xf053('0x14')]();});}};}function handleEntityNotFound(_0x2f8813,_0x23adc9){return function(_0x23bc0a){if(!_0x23bc0a){_0x2f8813[_0xf053('0x13')](0x194);}return _0x23bc0a;};}function handleError(_0x2d6e50,_0x247484){_0x247484=_0x247484||0x1f4;return function(_0x24f86f){logger['error'](_0x24f86f['stack']);if(_0x24f86f['name']){delete _0x24f86f[_0xf053('0x23')];}_0x2d6e50[_0xf053('0x15')](_0x247484)[_0xf053('0x24')](_0x24f86f);};}exports['index']=function(_0x108d3f,_0x206878){var _0x2bdad4={},_0x131021={},_0x44cdf7={'count':0x0,'rows':[]};var _0x5d728d=db['Tag']['rawAttributes'];_0x131021[_0xf053('0x25')]=_[_0xf053('0x26')](_0x5d728d);_0x131021[_0xf053('0x27')]=_[_0xf053('0x26')](_0x108d3f[_0xf053('0x27')]);_0x131021[_0xf053('0x28')]=_[_0xf053('0x29')](_0x131021[_0xf053('0x25')],_0x131021[_0xf053('0x27')]);_0x2bdad4[_0xf053('0x2a')]=_[_0xf053('0x29')](_0x131021[_0xf053('0x25')],qs['fields'](_0x108d3f[_0xf053('0x27')][_0xf053('0x2b')]));_0x2bdad4[_0xf053('0x2a')]=_0x2bdad4[_0xf053('0x2a')][_0xf053('0x2c')]?_0x2bdad4[_0xf053('0x2a')]:_0x131021[_0xf053('0x25')];if(!_0x108d3f['query']['hasOwnProperty']('nolimit')){_0x2bdad4[_0xf053('0x19')]=qs['limit'](_0x108d3f['query'][_0xf053('0x19')]);_0x2bdad4['offset']=qs[_0xf053('0x18')](_0x108d3f[_0xf053('0x27')]['offset']);}_0x2bdad4[_0xf053('0x2d')]=qs[_0xf053('0x2e')](_0x108d3f['query']['sort']);_0x2bdad4[_0xf053('0x2f')]=qs[_0xf053('0x28')](_['pick'](_0x108d3f[_0xf053('0x27')],_0x131021[_0xf053('0x28')]));if(_0x108d3f[_0xf053('0x27')][_0xf053('0x30')]){_0x2bdad4[_0xf053('0x2f')]=_[_0xf053('0x31')](_0x2bdad4[_0xf053('0x2f')],{'$or':_['map'](_0x5d728d,function(_0x62d308){if(_0x62d308[_0xf053('0x32')][_0xf053('0x33')]!=='VIRTUAL'){var _0x3f4c47={};_0x3f4c47[_0x62d308[_0xf053('0x34')]]={'$like':'%'+_0x108d3f[_0xf053('0x27')]['filter']+'%'};return _0x3f4c47;}})});}_0x2bdad4=_['merge']({},_0x2bdad4,_0x108d3f['options']);var _0x5de38b={'where':_0x2bdad4[_0xf053('0x2f')]};return db[_0xf053('0x35')][_0xf053('0x17')](_0x5de38b)[_0xf053('0x1f')](function(_0x479104){_0x44cdf7[_0xf053('0x17')]=_0x479104;if(_0x108d3f['query'][_0xf053('0x36')]){_0x2bdad4[_0xf053('0x37')]=[{'all':!![]}];}return db[_0xf053('0x35')]['findAll'](_0x2bdad4);})[_0xf053('0x1f')](function(_0x3bf2fb){_0x44cdf7[_0xf053('0x38')]=_0x3bf2fb;return _0x44cdf7;})[_0xf053('0x1f')](respondWithFilteredResult(_0x206878,_0x2bdad4))['catch'](handleError(_0x206878,null));};exports['show']=function(_0x261c34,_0x5332b4){var _0x3f60ec={'raw':!![],'where':{'id':_0x261c34[_0xf053('0x39')]['id']}},_0x4c7d0c={};_0x4c7d0c[_0xf053('0x25')]=_['keys'](db[_0xf053('0x35')][_0xf053('0x3a')]);_0x4c7d0c[_0xf053('0x27')]=_[_0xf053('0x26')](_0x261c34['query']);_0x4c7d0c[_0xf053('0x28')]=_['intersection'](_0x4c7d0c['model'],_0x4c7d0c['query']);_0x3f60ec[_0xf053('0x2a')]=_[_0xf053('0x29')](_0x4c7d0c[_0xf053('0x25')],qs[_0xf053('0x2b')](_0x261c34['query']['fields']));_0x3f60ec[_0xf053('0x2a')]=_0x3f60ec[_0xf053('0x2a')][_0xf053('0x2c')]?_0x3f60ec[_0xf053('0x2a')]:_0x4c7d0c[_0xf053('0x25')];if(_0x261c34['query'][_0xf053('0x36')]){_0x3f60ec[_0xf053('0x37')]=[{'all':!![]}];}_0x3f60ec=_[_0xf053('0x31')]({},_0x3f60ec,_0x261c34[_0xf053('0x3b')]);return db[_0xf053('0x35')][_0xf053('0x3c')](_0x3f60ec)[_0xf053('0x1f')](handleEntityNotFound(_0x5332b4,null))[_0xf053('0x1f')](respondWithResult(_0x5332b4,null))[_0xf053('0x3d')](handleError(_0x5332b4,null));};exports[_0xf053('0x3e')]=function(_0x5084cd,_0x235358){return db['Tag'][_0xf053('0x3e')](_0x5084cd[_0xf053('0x3f')],{})['then'](function(_0xcf1b33){var _0x216118=_0x5084cd[_0xf053('0x40')][_0xf053('0x41')]({'plain':!![]});if(!_0x216118)throw new Error(_0xf053('0x42'));if(_0x216118[_0xf053('0x43')]===_0xf053('0x40')){var _0x277239=_0xcf1b33[_0xf053('0x41')]({'plain':!![]});var _0x414477=_0xf053('0x21');return db[_0xf053('0x44')][_0xf053('0x3c')]({'where':{'name':_0x414477,'userProfileId':_0x216118[_0xf053('0x45')]},'raw':!![]})[_0xf053('0x1f')](function(_0x2df0a2){if(_0x2df0a2&&_0x2df0a2['autoAssociation']===0x0){return db[_0xf053('0x22')][_0xf053('0x3e')]({'name':_0x277239[_0xf053('0x23')],'resourceId':_0x277239['id'],'type':_0x2df0a2[_0xf053('0x23')],'sectionId':_0x2df0a2['id']},{})[_0xf053('0x1f')](function(){return _0xcf1b33;});}else{return _0xcf1b33;}})['catch'](function(_0x265e00){logger[_0xf053('0x46')](_0xf053('0x47'),_0x265e00);throw _0x265e00;});}return _0xcf1b33;})[_0xf053('0x1f')](respondWithResult(_0x235358,0xc9))[_0xf053('0x3d')](handleError(_0x235358,null));};exports[_0xf053('0x1e')]=function(_0x342cde,_0x2ebdcb){if(_0x342cde['body']['id']){delete _0x342cde[_0xf053('0x3f')]['id'];}return db[_0xf053('0x35')][_0xf053('0x3c')]({'where':{'id':_0x342cde['params']['id']}})[_0xf053('0x1f')](handleEntityNotFound(_0x2ebdcb,null))[_0xf053('0x1f')](saveUpdates(_0x342cde[_0xf053('0x3f')],null))['then'](respondWithResult(_0x2ebdcb,null))['catch'](handleError(_0x2ebdcb,null));};exports[_0xf053('0x20')]=function(_0x5cbf21,_0x57e7d3){return db[_0xf053('0x35')][_0xf053('0x3c')]({'where':{'id':_0x5cbf21[_0xf053('0x39')]['id']}})[_0xf053('0x1f')](handleEntityNotFound(_0x57e7d3,null))[_0xf053('0x1f')](removeEntity(_0x57e7d3,null))[_0xf053('0x3d')](handleError(_0x57e7d3,null));}; \ No newline at end of file +var _0xb3e9=['key','field','options','Tag','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','get','Tags','end','error','stack','name','send','index','rawAttributes','model','keys','query','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','map','type'];(function(_0x5712d5,_0x23eb3f){var _0x247550=function(_0x4383a2){while(--_0x4383a2){_0x5712d5['push'](_0x5712d5['shift']());}};_0x247550(++_0x23eb3f);}(_0xb3e9,0x1eb));var _0x9b3e=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xb3e9[_0x26f702];return _0x11417d;};'use strict';var pdf=require(_0x9b3e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9b3e('0x1'));var zipdir=require(_0x9b3e('0x2'));var jsonpatch=require(_0x9b3e('0x3'));var rp=require(_0x9b3e('0x4'));var moment=require(_0x9b3e('0x5'));var BPromise=require(_0x9b3e('0x6'));var Mustache=require(_0x9b3e('0x7'));var util=require('util');var path=require(_0x9b3e('0x8'));var sox=require('sox');var csv=require(_0x9b3e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9b3e('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9b3e('0x9'));var querystring=require(_0x9b3e('0xb'));var Papa=require(_0x9b3e('0xc'));var Redis=require(_0x9b3e('0xd'));var authService=require(_0x9b3e('0xe'));var qs=require(_0x9b3e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9b3e('0x10'));var config=require(_0x9b3e('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5dc028,_0x9b9f6c){_0x9b9f6c=_0x9b9f6c||0xcc;return function(_0x455b4e){if(_0x455b4e){return _0x5dc028[_0x9b3e('0x12')](_0x9b9f6c);}return _0x5dc028[_0x9b3e('0x13')](_0x9b9f6c)['end']();};}function respondWithResult(_0x5824c0,_0x30c2b8){_0x30c2b8=_0x30c2b8||0xc8;return function(_0x38d9fd){if(_0x38d9fd){return _0x5824c0[_0x9b3e('0x13')](_0x30c2b8)[_0x9b3e('0x14')](_0x38d9fd);}};}function respondWithFilteredResult(_0x82ec8d,_0x1ab7cf){return function(_0x1351c7){if(_0x1351c7){var _0x15a7cf=_0x1351c7[_0x9b3e('0x15')],_0x1095f2=_0x1ab7cf[_0x9b3e('0x16')],_0x12aabe=_0x1ab7cf[_0x9b3e('0x16')]+_0x1ab7cf[_0x9b3e('0x17')],_0x2a98ec;if(_0x12aabe>=_0x15a7cf){_0x12aabe=_0x15a7cf;_0x2a98ec=0xc8;}else{_0x2a98ec=0xce;}_0x82ec8d[_0x9b3e('0x13')](_0x2a98ec);return _0x82ec8d['set'](_0x9b3e('0x18'),_0x1095f2+'-'+_0x12aabe+'/'+_0x15a7cf)[_0x9b3e('0x14')](_0x1351c7);}return null;};}function patchUpdates(_0x310039){return function(_0x5f11c6){try{jsonpatch[_0x9b3e('0x19')](_0x5f11c6,_0x310039,!![]);}catch(_0x28e537){return BPromise[_0x9b3e('0x1a')](_0x28e537);}return _0x5f11c6['save']();};}function saveUpdates(_0x3991e8,_0x582f16){return function(_0x275153){if(_0x275153){return _0x275153[_0x9b3e('0x1b')](_0x3991e8)[_0x9b3e('0x1c')](function(_0x54a1bb){return _0x54a1bb;});}return null;};}function removeEntity(_0x5c709f,_0x2b6798){return function(_0x21d863){if(_0x21d863){return _0x21d863[_0x9b3e('0x1d')]()[_0x9b3e('0x1c')](function(){var _0x591ae8=_0x21d863[_0x9b3e('0x1e')]({'plain':!![]});var _0x2123e5=_0x9b3e('0x1f');return db['UserProfileResource'][_0x9b3e('0x1d')]({'where':{'type':_0x2123e5,'resourceId':_0x591ae8['id']}})[_0x9b3e('0x1c')](function(){return _0x21d863;});})[_0x9b3e('0x1c')](function(){_0x5c709f[_0x9b3e('0x13')](0xcc)[_0x9b3e('0x20')]();});}};}function handleEntityNotFound(_0x501541,_0x162875){return function(_0x47b276){if(!_0x47b276){_0x501541[_0x9b3e('0x12')](0x194);}return _0x47b276;};}function handleError(_0x19d9c4,_0x2bdb0a){_0x2bdb0a=_0x2bdb0a||0x1f4;return function(_0x4cd6f0){logger[_0x9b3e('0x21')](_0x4cd6f0[_0x9b3e('0x22')]);if(_0x4cd6f0[_0x9b3e('0x23')]){delete _0x4cd6f0[_0x9b3e('0x23')];}_0x19d9c4['status'](_0x2bdb0a)[_0x9b3e('0x24')](_0x4cd6f0);};}exports[_0x9b3e('0x25')]=function(_0x109e04,_0x4be9c1){var _0x1bbdf0={},_0x5b2fb1={},_0x1292f8={'count':0x0,'rows':[]};var _0x32133b=db['Tag'][_0x9b3e('0x26')];_0x5b2fb1[_0x9b3e('0x27')]=_[_0x9b3e('0x28')](_0x32133b);_0x5b2fb1[_0x9b3e('0x29')]=_[_0x9b3e('0x28')](_0x109e04['query']);_0x5b2fb1['filters']=_['intersection'](_0x5b2fb1[_0x9b3e('0x27')],_0x5b2fb1[_0x9b3e('0x29')]);_0x1bbdf0[_0x9b3e('0x2a')]=_['intersection'](_0x5b2fb1[_0x9b3e('0x27')],qs[_0x9b3e('0x2b')](_0x109e04['query']['fields']));_0x1bbdf0[_0x9b3e('0x2a')]=_0x1bbdf0['attributes'][_0x9b3e('0x2c')]?_0x1bbdf0['attributes']:_0x5b2fb1[_0x9b3e('0x27')];if(!_0x109e04[_0x9b3e('0x29')]['hasOwnProperty'](_0x9b3e('0x2d'))){_0x1bbdf0['limit']=qs['limit'](_0x109e04[_0x9b3e('0x29')][_0x9b3e('0x17')]);_0x1bbdf0[_0x9b3e('0x16')]=qs[_0x9b3e('0x16')](_0x109e04[_0x9b3e('0x29')]['offset']);}_0x1bbdf0[_0x9b3e('0x2e')]=qs[_0x9b3e('0x2f')](_0x109e04['query'][_0x9b3e('0x2f')]);_0x1bbdf0[_0x9b3e('0x30')]=qs[_0x9b3e('0x31')](_[_0x9b3e('0x32')](_0x109e04['query'],_0x5b2fb1[_0x9b3e('0x31')]));if(_0x109e04[_0x9b3e('0x29')][_0x9b3e('0x33')]){_0x1bbdf0[_0x9b3e('0x30')]=_[_0x9b3e('0x34')](_0x1bbdf0[_0x9b3e('0x30')],{'$or':_[_0x9b3e('0x35')](_0x32133b,function(_0x5b68db){if(_0x5b68db[_0x9b3e('0x36')][_0x9b3e('0x37')]!=='VIRTUAL'){var _0x2b0b15={};_0x2b0b15[_0x5b68db[_0x9b3e('0x38')]]={'$like':'%'+_0x109e04['query'][_0x9b3e('0x33')]+'%'};return _0x2b0b15;}})});}_0x1bbdf0=_[_0x9b3e('0x34')]({},_0x1bbdf0,_0x109e04[_0x9b3e('0x39')]);var _0x48df08={'where':_0x1bbdf0[_0x9b3e('0x30')]};return db[_0x9b3e('0x3a')][_0x9b3e('0x15')](_0x48df08)[_0x9b3e('0x1c')](function(_0x223aec){_0x1292f8[_0x9b3e('0x15')]=_0x223aec;if(_0x109e04[_0x9b3e('0x29')][_0x9b3e('0x3b')]){_0x1bbdf0[_0x9b3e('0x3c')]=[{'all':!![]}];}return db[_0x9b3e('0x3a')][_0x9b3e('0x3d')](_0x1bbdf0);})[_0x9b3e('0x1c')](function(_0x4b9074){_0x1292f8[_0x9b3e('0x3e')]=_0x4b9074;return _0x1292f8;})[_0x9b3e('0x1c')](respondWithFilteredResult(_0x4be9c1,_0x1bbdf0))[_0x9b3e('0x3f')](handleError(_0x4be9c1,null));};exports[_0x9b3e('0x40')]=function(_0x227a34,_0x263c7d){var _0x5ddc0c={'raw':!![],'where':{'id':_0x227a34[_0x9b3e('0x41')]['id']}},_0x3cab51={};_0x3cab51[_0x9b3e('0x27')]=_[_0x9b3e('0x28')](db[_0x9b3e('0x3a')][_0x9b3e('0x26')]);_0x3cab51[_0x9b3e('0x29')]=_[_0x9b3e('0x28')](_0x227a34[_0x9b3e('0x29')]);_0x3cab51[_0x9b3e('0x31')]=_['intersection'](_0x3cab51[_0x9b3e('0x27')],_0x3cab51['query']);_0x5ddc0c[_0x9b3e('0x2a')]=_[_0x9b3e('0x42')](_0x3cab51[_0x9b3e('0x27')],qs[_0x9b3e('0x2b')](_0x227a34[_0x9b3e('0x29')][_0x9b3e('0x2b')]));_0x5ddc0c[_0x9b3e('0x2a')]=_0x5ddc0c[_0x9b3e('0x2a')][_0x9b3e('0x2c')]?_0x5ddc0c[_0x9b3e('0x2a')]:_0x3cab51[_0x9b3e('0x27')];if(_0x227a34[_0x9b3e('0x29')][_0x9b3e('0x3b')]){_0x5ddc0c['include']=[{'all':!![]}];}_0x5ddc0c=_[_0x9b3e('0x34')]({},_0x5ddc0c,_0x227a34[_0x9b3e('0x39')]);return db['Tag'][_0x9b3e('0x43')](_0x5ddc0c)[_0x9b3e('0x1c')](handleEntityNotFound(_0x263c7d,null))[_0x9b3e('0x1c')](respondWithResult(_0x263c7d,null))[_0x9b3e('0x3f')](handleError(_0x263c7d,null));};exports[_0x9b3e('0x44')]=function(_0x1770ce,_0x2a6440){return db[_0x9b3e('0x3a')]['create'](_0x1770ce[_0x9b3e('0x45')],{})[_0x9b3e('0x1c')](function(_0x5523e9){var _0x3209cf=_0x1770ce['user'][_0x9b3e('0x1e')]({'plain':!![]});if(!_0x3209cf)throw new Error(_0x9b3e('0x46'));if(_0x3209cf[_0x9b3e('0x47')]===_0x9b3e('0x48')){var _0x422375=_0x5523e9[_0x9b3e('0x1e')]({'plain':!![]});var _0x5adce1=_0x9b3e('0x1f');return db[_0x9b3e('0x49')][_0x9b3e('0x43')]({'where':{'name':_0x5adce1,'userProfileId':_0x3209cf[_0x9b3e('0x4a')]},'raw':!![]})[_0x9b3e('0x1c')](function(_0x4ee2ca){if(_0x4ee2ca&&_0x4ee2ca[_0x9b3e('0x4b')]===0x0){return db[_0x9b3e('0x4c')][_0x9b3e('0x44')]({'name':_0x422375[_0x9b3e('0x23')],'resourceId':_0x422375['id'],'type':_0x4ee2ca[_0x9b3e('0x23')],'sectionId':_0x4ee2ca['id']},{})['then'](function(){return _0x5523e9;});}else{return _0x5523e9;}})[_0x9b3e('0x3f')](function(_0x4ef759){logger['error'](_0x9b3e('0x4d'),_0x4ef759);throw _0x4ef759;});}return _0x5523e9;})['then'](respondWithResult(_0x2a6440,0xc9))[_0x9b3e('0x3f')](handleError(_0x2a6440,null));};exports[_0x9b3e('0x1b')]=function(_0x4822fc,_0x2ed6cd){if(_0x4822fc[_0x9b3e('0x45')]['id']){delete _0x4822fc[_0x9b3e('0x45')]['id'];}return db[_0x9b3e('0x3a')][_0x9b3e('0x43')]({'where':{'id':_0x4822fc[_0x9b3e('0x41')]['id']}})[_0x9b3e('0x1c')](handleEntityNotFound(_0x2ed6cd,null))[_0x9b3e('0x1c')](saveUpdates(_0x4822fc['body'],null))[_0x9b3e('0x1c')](respondWithResult(_0x2ed6cd,null))['catch'](handleError(_0x2ed6cd,null));};exports[_0x9b3e('0x1d')]=function(_0x42411e,_0x33f3c6){return db[_0x9b3e('0x3a')]['find']({'where':{'id':_0x42411e['params']['id']}})[_0x9b3e('0x1c')](handleEntityNotFound(_0x33f3c6,null))[_0x9b3e('0x1c')](removeEntity(_0x33f3c6,null))['catch'](handleError(_0x33f3c6,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 6d793bf..0a0e6ba 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 _0xda31=['moment','bluebird','path','rimraf','../../config/environment','./tag.attributes','define','tools_tags','lodash','util','../../config/logger','api'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xda31,0xbc));var _0x1da3=function(_0x24ff13,_0x27f278){_0x24ff13=_0x24ff13-0x0;var _0x4e2ea2=_0xda31[_0x24ff13];return _0x4e2ea2;};'use strict';var _=require(_0x1da3('0x0'));var util=require(_0x1da3('0x1'));var logger=require(_0x1da3('0x2'))(_0x1da3('0x3'));var moment=require(_0x1da3('0x4'));var BPromise=require(_0x1da3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1da3('0x6'));var rimraf=require(_0x1da3('0x7'));var config=require(_0x1da3('0x8'));var attributes=require(_0x1da3('0x9'));module['exports']=function(_0x12b53c,_0x2a7a1f){return _0x12b53c[_0x1da3('0xa')]('Tag',attributes,{'tableName':_0x1da3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfef3=['moment','request-promise','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util','../../config/logger','api'];(function(_0x307296,_0x49b881){var _0x32f975=function(_0x4ed150){while(--_0x4ed150){_0x307296['push'](_0x307296['shift']());}};_0x32f975(++_0x49b881);}(_0xfef3,0x128));var _0x3fef=function(_0x3674f2,_0x4802c9){_0x3674f2=_0x3674f2-0x0;var _0x5b7aeb=_0xfef3[_0x3674f2];return _0x5b7aeb;};'use strict';var _=require(_0x3fef('0x0'));var util=require(_0x3fef('0x1'));var logger=require(_0x3fef('0x2'))(_0x3fef('0x3'));var moment=require(_0x3fef('0x4'));var BPromise=require('bluebird');var rp=require(_0x3fef('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3fef('0x6'));var attributes=require(_0x3fef('0x7'));module[_0x3fef('0x8')]=function(_0x1e9394,_0x55e948){return _0x1e9394[_0x3fef('0x9')](_0x3fef('0xa'),attributes,{'tableName':_0x3fef('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 39e118a..d77aa4f 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 _0x5fb3=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x5fb3,0x112));var _0x35fb=function(_0x4fd10b,_0x27122d){_0x4fd10b=_0x4fd10b-0x0;var _0x527053=_0x5fb3[_0x4fd10b];return _0x527053;};'use strict';var _=require(_0x35fb('0x0'));var util=require(_0x35fb('0x1'));var moment=require(_0x35fb('0x2'));var BPromise=require(_0x35fb('0x3'));var rs=require(_0x35fb('0x4'));var fs=require('fs');var Redis=require(_0x35fb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x35fb('0x6'));var logger=require(_0x35fb('0x7'))('rpc');var config=require(_0x35fb('0x8'));var jayson=require(_0x35fb('0x9'));var client=jayson[_0x35fb('0xa')][_0x35fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1fd50f,_0x1dc8f4,_0x5e94db){return new BPromise(function(_0x543e0c,_0x99152a){return client[_0x35fb('0xc')](_0x1fd50f,_0x5e94db)[_0x35fb('0xd')](function(_0x1ddf2d){logger[_0x35fb('0xe')](_0x35fb('0xf'),_0x1dc8f4,'request\x20sent');logger['debug']('Tag,\x20%s,\x20%s,\x20%s',_0x1dc8f4,_0x35fb('0x10'),JSON[_0x35fb('0x11')](_0x1ddf2d));if(_0x1ddf2d[_0x35fb('0x12')]){if(_0x1ddf2d[_0x35fb('0x12')]['code']===0x1f4){logger[_0x35fb('0x12')](_0x35fb('0xf'),_0x1dc8f4,_0x1ddf2d[_0x35fb('0x12')][_0x35fb('0x13')]);return _0x99152a(_0x1ddf2d[_0x35fb('0x12')][_0x35fb('0x13')]);}logger['error'](_0x35fb('0xf'),_0x1dc8f4,_0x1ddf2d[_0x35fb('0x12')][_0x35fb('0x13')]);return _0x543e0c(_0x1ddf2d[_0x35fb('0x12')]['message']);}else{logger[_0x35fb('0xe')](_0x35fb('0xf'),_0x1dc8f4,_0x35fb('0x10'));_0x543e0c(_0x1ddf2d['result'][_0x35fb('0x13')]);}})[_0x35fb('0x14')](function(_0x314816){logger[_0x35fb('0x12')](_0x35fb('0xf'),_0x1dc8f4,_0x314816);_0x99152a(_0x314816);});});} \ No newline at end of file +var _0x7bd1=['client','http','then','info','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','error','code','Tag,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xc09511,_0x5129ae){var _0x56192b=function(_0x520469){while(--_0x520469){_0xc09511['push'](_0xc09511['shift']());}};_0x56192b(++_0x5129ae);}(_0x7bd1,0x1c1));var _0x17bd=function(_0x387cb,_0x2151bc){_0x387cb=_0x387cb-0x0;var _0x50595a=_0x7bd1[_0x387cb];return _0x50595a;};'use strict';var _=require(_0x17bd('0x0'));var util=require(_0x17bd('0x1'));var moment=require(_0x17bd('0x2'));var BPromise=require('bluebird');var rs=require(_0x17bd('0x3'));var fs=require('fs');var Redis=require(_0x17bd('0x4'));var db=require(_0x17bd('0x5'))['db'];var utils=require(_0x17bd('0x6'));var logger=require(_0x17bd('0x7'))(_0x17bd('0x8'));var config=require(_0x17bd('0x9'));var jayson=require(_0x17bd('0xa'));var client=jayson[_0x17bd('0xb')][_0x17bd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x164c5d,_0xeff48c,_0x1d2c81){return new BPromise(function(_0x3e265c,_0xbdf0cd){return client['request'](_0x164c5d,_0x1d2c81)[_0x17bd('0xd')](function(_0x43cea7){logger[_0x17bd('0xe')]('Tag,\x20%s,\x20%s',_0xeff48c,_0x17bd('0xf'));logger['debug'](_0x17bd('0x10'),_0xeff48c,_0x17bd('0xf'),JSON['stringify'](_0x43cea7));if(_0x43cea7[_0x17bd('0x11')]){if(_0x43cea7[_0x17bd('0x11')][_0x17bd('0x12')]===0x1f4){logger[_0x17bd('0x11')](_0x17bd('0x13'),_0xeff48c,_0x43cea7[_0x17bd('0x11')]['message']);return _0xbdf0cd(_0x43cea7['error'][_0x17bd('0x14')]);}logger['error'](_0x17bd('0x13'),_0xeff48c,_0x43cea7[_0x17bd('0x11')][_0x17bd('0x14')]);return _0x3e265c(_0x43cea7[_0x17bd('0x11')]['message']);}else{logger[_0x17bd('0xe')](_0x17bd('0x13'),_0xeff48c,_0x17bd('0xf'));_0x3e265c(_0x43cea7[_0x17bd('0x15')][_0x17bd('0x14')]);}})[_0x17bd('0x16')](function(_0x507250){logger[_0x17bd('0x11')](_0x17bd('0x13'),_0xeff48c,_0x507250);_0xbdf0cd(_0x507250);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 6072f47..e0df145 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 _0x2085=['/:id','show','getQueues','/:id/users','getAgents','post','create','/:id/queues','addQueues','addAgents','put','destroy','delete','removeQueues','removeAgents','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./team.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2085,0xab));var _0x5208=function(_0x137d2f,_0x3b714c){_0x137d2f=_0x137d2f-0x0;var _0x21664a=_0x2085[_0x137d2f];return _0x21664a;};'use strict';var multer=require(_0x5208('0x0'));var util=require(_0x5208('0x1'));var path=require(_0x5208('0x2'));var timeout=require(_0x5208('0x3'));var express=require(_0x5208('0x4'));var router=express['Router']();var auth=require(_0x5208('0x5'));var interaction=require(_0x5208('0x6'));var config=require('../../config/environment');var controller=require(_0x5208('0x7'));router[_0x5208('0x8')]('/',auth[_0x5208('0x9')](),controller[_0x5208('0xa')]);router[_0x5208('0x8')](_0x5208('0xb'),auth[_0x5208('0x9')](),controller[_0x5208('0xc')]);router['get']('/:id/queues',auth['isAuthenticated'](),controller[_0x5208('0xd')]);router['get'](_0x5208('0xe'),auth['isAuthenticated'](),controller[_0x5208('0xf')]);router[_0x5208('0x10')]('/',auth[_0x5208('0x9')](),controller[_0x5208('0x11')]);router['post'](_0x5208('0x12'),auth[_0x5208('0x9')](),controller[_0x5208('0x13')]);router['post'](_0x5208('0xe'),auth[_0x5208('0x9')](),controller[_0x5208('0x14')]);router[_0x5208('0x15')](_0x5208('0xb'),auth[_0x5208('0x9')](),controller['update']);router['delete'](_0x5208('0xb'),auth['isAuthenticated'](),controller[_0x5208('0x16')]);router[_0x5208('0x17')]('/:id/queues',auth['isAuthenticated'](),controller[_0x5208('0x18')]);router[_0x5208('0x17')](_0x5208('0xe'),auth[_0x5208('0x9')](),controller[_0x5208('0x19')]);module['exports']=router; \ No newline at end of file +var _0x6c54=['delete','destroy','removeQueues','removeAgents','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/queues','getQueues','getAgents','create','addQueues','post','/:id/users','addAgents','put','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6c54,0x6c));var _0x46c5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6c54[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x46c5('0x0'));var util=require(_0x46c5('0x1'));var path=require(_0x46c5('0x2'));var timeout=require(_0x46c5('0x3'));var express=require(_0x46c5('0x4'));var router=express['Router']();var auth=require(_0x46c5('0x5'));var interaction=require(_0x46c5('0x6'));var config=require(_0x46c5('0x7'));var controller=require('./team.controller');router[_0x46c5('0x8')]('/',auth['isAuthenticated'](),controller[_0x46c5('0x9')]);router['get'](_0x46c5('0xa'),auth[_0x46c5('0xb')](),controller['show']);router[_0x46c5('0x8')](_0x46c5('0xc'),auth[_0x46c5('0xb')](),controller[_0x46c5('0xd')]);router['get']('/:id/users',auth[_0x46c5('0xb')](),controller[_0x46c5('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x46c5('0xf')]);router['post']('/:id/queues',auth['isAuthenticated'](),controller[_0x46c5('0x10')]);router[_0x46c5('0x11')](_0x46c5('0x12'),auth[_0x46c5('0xb')](),controller[_0x46c5('0x13')]);router[_0x46c5('0x14')](_0x46c5('0xa'),auth['isAuthenticated'](),controller[_0x46c5('0x15')]);router[_0x46c5('0x16')](_0x46c5('0xa'),auth[_0x46c5('0xb')](),controller[_0x46c5('0x17')]);router['delete'](_0x46c5('0xc'),auth['isAuthenticated'](),controller[_0x46c5('0x18')]);router['delete'](_0x46c5('0x12'),auth[_0x46c5('0xb')](),controller[_0x46c5('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 1378e44..d39c6da 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 _0xae46=['exports','STRING','name','sequelize'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xae46,0xd3));var _0x6ae4=function(_0x430c7a,_0x30e44e){_0x430c7a=_0x430c7a-0x0;var _0x52ddd3=_0xae46[_0x430c7a];return _0x52ddd3;};'use strict';var Sequelize=require(_0x6ae4('0x0'));module[_0x6ae4('0x1')]={'name':{'type':Sequelize[_0x6ae4('0x2')],'allowNull':![],'unique':_0x6ae4('0x3')},'description':{'type':Sequelize[_0x6ae4('0x2')]}}; \ No newline at end of file +var _0xf4da=['exports','STRING','sequelize'];(function(_0x740ca3,_0x197fd3){var _0x42d5f2=function(_0x250342){while(--_0x250342){_0x740ca3['push'](_0x740ca3['shift']());}};_0x42d5f2(++_0x197fd3);}(_0xf4da,0x1a6));var _0xaf4d=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xf4da[_0x3e112d];return _0x531c31;};'use strict';var Sequelize=require(_0xaf4d('0x0'));module[_0xaf4d('0x1')]={'name':{'type':Sequelize[_0xaf4d('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index c4c728c..b4fd6e5 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 _0x865f=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','includeAll','findAll','rows','show','params','keys','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','add','ids','Voice','Mail','Sms','Fax','Openchannel','each','addAgents','User','online','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','interface','spread','emit','userTeam:save','removeAgents','chat','mail','sms','openchannel','isArray','userTeam:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','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','redis','defaults','socket.io-emitter','./team.socket','status','end','count','offset','limit','json','apply','reject','save','update','then','destroy','get','Teams','UserProfileResource','sendStatus','error','stack','name','send','index','Team','rawAttributes','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x865f,0x14a));var _0xf865=function(_0x217537,_0x4e786a){_0x217537=_0x217537-0x0;var _0x236d2f=_0x865f[_0x217537];return _0x236d2f;};'use strict';var pdf=require(_0xf865('0x0'));var emlformat=require(_0xf865('0x1'));var rimraf=require(_0xf865('0x2'));var zipdir=require(_0xf865('0x3'));var jsonpatch=require(_0xf865('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf865('0x5'));var Mustache=require(_0xf865('0x6'));var util=require(_0xf865('0x7'));var path=require(_0xf865('0x8'));var sox=require(_0xf865('0x9'));var csv=require('to-csv');var ejs=require(_0xf865('0xa'));var fs=require('fs');var _=require(_0xf865('0xb'));var squel=require(_0xf865('0xc'));var crypto=require(_0xf865('0xd'));var jsforce=require(_0xf865('0xe'));var deskjs=require(_0xf865('0xf'));var toCsv=require(_0xf865('0x10'));var querystring=require(_0xf865('0x11'));var Papa=require(_0xf865('0x12'));var Redis=require(_0xf865('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xf865('0x14'));var hardwareService=require(_0xf865('0x15'));var logger=require(_0xf865('0x16'))(_0xf865('0x17'));var utils=require(_0xf865('0x18'));var config=require(_0xf865('0x19'));var db=require('../../mysqldb')['db'];config[_0xf865('0x1a')]=_[_0xf865('0x1b')](config[_0xf865('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xf865('0x1c'))(new Redis(config[_0xf865('0x1a')]));require(_0xf865('0x1d'))['register'](socket);function respondWithStatusCode(_0x1e4b06,_0x5b685c){_0x5b685c=_0x5b685c||0xcc;return function(_0x230711){if(_0x230711){return _0x1e4b06['sendStatus'](_0x5b685c);}return _0x1e4b06[_0xf865('0x1e')](_0x5b685c)[_0xf865('0x1f')]();};}function respondWithResult(_0x2f1a16,_0x969597){_0x969597=_0x969597||0xc8;return function(_0xbc6e67){if(_0xbc6e67){return _0x2f1a16[_0xf865('0x1e')](_0x969597)['json'](_0xbc6e67);}};}function respondWithFilteredResult(_0x28ca3c,_0x27b4aa){return function(_0x22f8b3){if(_0x22f8b3){var _0x133c58=_0x22f8b3[_0xf865('0x20')],_0x1e6e4b=_0x27b4aa[_0xf865('0x21')],_0x62b36d=_0x27b4aa[_0xf865('0x21')]+_0x27b4aa[_0xf865('0x22')],_0x1872a4;if(_0x62b36d>=_0x133c58){_0x62b36d=_0x133c58;_0x1872a4=0xc8;}else{_0x1872a4=0xce;}_0x28ca3c['status'](_0x1872a4);return _0x28ca3c['set']('Content-Range',_0x1e6e4b+'-'+_0x62b36d+'/'+_0x133c58)[_0xf865('0x23')](_0x22f8b3);}return null;};}function patchUpdates(_0x538e92){return function(_0x35ad73){try{jsonpatch[_0xf865('0x24')](_0x35ad73,_0x538e92,!![]);}catch(_0x529539){return BPromise[_0xf865('0x25')](_0x529539);}return _0x35ad73[_0xf865('0x26')]();};}function saveUpdates(_0x28419f,_0x304461){return function(_0xd7f609){if(_0xd7f609){return _0xd7f609[_0xf865('0x27')](_0x28419f)[_0xf865('0x28')](function(_0x3f625c){return _0x3f625c;});}return null;};}function removeEntity(_0x48310c,_0x1d48c5){return function(_0x1ad849){if(_0x1ad849){return _0x1ad849[_0xf865('0x29')]()[_0xf865('0x28')](function(){var _0xce321a=_0x1ad849[_0xf865('0x2a')]({'plain':!![]});var _0x59ac9b=_0xf865('0x2b');return db[_0xf865('0x2c')][_0xf865('0x29')]({'where':{'type':_0x59ac9b,'resourceId':_0xce321a['id']}})[_0xf865('0x28')](function(){return _0x1ad849;});})[_0xf865('0x28')](function(){_0x48310c[_0xf865('0x1e')](0xcc)[_0xf865('0x1f')]();});}};}function handleEntityNotFound(_0x27a177,_0x41fc06){return function(_0x2fa6b9){if(!_0x2fa6b9){_0x27a177[_0xf865('0x2d')](0x194);}return _0x2fa6b9;};}function handleError(_0x3cc67f,_0x5d657d){_0x5d657d=_0x5d657d||0x1f4;return function(_0x207bb0){logger[_0xf865('0x2e')](_0x207bb0[_0xf865('0x2f')]);if(_0x207bb0[_0xf865('0x30')]){delete _0x207bb0[_0xf865('0x30')];}_0x3cc67f[_0xf865('0x1e')](_0x5d657d)[_0xf865('0x31')](_0x207bb0);};}exports[_0xf865('0x32')]=function(_0x53a9e0,_0x4b70c5){var _0x2d43e9={},_0x17b90d={},_0x37eb52={'count':0x0,'rows':[]};var _0x1a5219=db[_0xf865('0x33')][_0xf865('0x34')];_0x17b90d[_0xf865('0x35')]=_['keys'](_0x1a5219);_0x17b90d[_0xf865('0x36')]=_['keys'](_0x53a9e0[_0xf865('0x36')]);_0x17b90d[_0xf865('0x37')]=_[_0xf865('0x38')](_0x17b90d[_0xf865('0x35')],_0x17b90d[_0xf865('0x36')]);_0x2d43e9[_0xf865('0x39')]=_[_0xf865('0x38')](_0x17b90d[_0xf865('0x35')],qs['fields'](_0x53a9e0[_0xf865('0x36')][_0xf865('0x3a')]));_0x2d43e9[_0xf865('0x39')]=_0x2d43e9['attributes'][_0xf865('0x3b')]?_0x2d43e9[_0xf865('0x39')]:_0x17b90d[_0xf865('0x35')];if(!_0x53a9e0['query'][_0xf865('0x3c')](_0xf865('0x3d'))){_0x2d43e9[_0xf865('0x22')]=qs[_0xf865('0x22')](_0x53a9e0[_0xf865('0x36')][_0xf865('0x22')]);_0x2d43e9[_0xf865('0x21')]=qs[_0xf865('0x21')](_0x53a9e0[_0xf865('0x36')]['offset']);}_0x2d43e9[_0xf865('0x3e')]=qs['sort'](_0x53a9e0[_0xf865('0x36')][_0xf865('0x3f')]);_0x2d43e9[_0xf865('0x40')]=qs['filters'](_[_0xf865('0x41')](_0x53a9e0[_0xf865('0x36')],_0x17b90d[_0xf865('0x37')]));if(_0x53a9e0[_0xf865('0x36')][_0xf865('0x42')]){_0x2d43e9[_0xf865('0x40')]=_[_0xf865('0x43')](_0x2d43e9[_0xf865('0x40')],{'$or':_[_0xf865('0x44')](_0x1a5219,function(_0x9133d){if(_0x9133d[_0xf865('0x45')][_0xf865('0x46')]!==_0xf865('0x47')){var _0x59c7f4={};_0x59c7f4[_0x9133d[_0xf865('0x48')]]={'$like':'%'+_0x53a9e0[_0xf865('0x36')][_0xf865('0x42')]+'%'};return _0x59c7f4;}})});}_0x2d43e9=_[_0xf865('0x43')]({},_0x2d43e9,_0x53a9e0['options']);var _0x50ee22={'where':_0x2d43e9['where']};return db[_0xf865('0x33')]['count'](_0x50ee22)['then'](function(_0x3770ae){_0x37eb52[_0xf865('0x20')]=_0x3770ae;if(_0x53a9e0[_0xf865('0x36')][_0xf865('0x49')]){_0x2d43e9['include']=[{'all':!![]}];}return db['Team'][_0xf865('0x4a')](_0x2d43e9);})[_0xf865('0x28')](function(_0xe3e837){_0x37eb52[_0xf865('0x4b')]=_0xe3e837;return _0x37eb52;})['then'](respondWithFilteredResult(_0x4b70c5,_0x2d43e9))['catch'](handleError(_0x4b70c5,null));};exports[_0xf865('0x4c')]=function(_0x189d0e,_0x1dcfd2){var _0x447efd={'raw':![],'where':{'id':_0x189d0e[_0xf865('0x4d')]['id']}},_0x39b6fb={};_0x39b6fb[_0xf865('0x35')]=_['keys'](db[_0xf865('0x33')][_0xf865('0x34')]);_0x39b6fb[_0xf865('0x36')]=_[_0xf865('0x4e')](_0x189d0e[_0xf865('0x36')]);_0x39b6fb[_0xf865('0x37')]=_[_0xf865('0x38')](_0x39b6fb[_0xf865('0x35')],_0x39b6fb['query']);_0x447efd[_0xf865('0x39')]=_['intersection'](_0x39b6fb[_0xf865('0x35')],qs[_0xf865('0x3a')](_0x189d0e[_0xf865('0x36')][_0xf865('0x3a')]));_0x447efd['attributes']=_0x447efd[_0xf865('0x39')][_0xf865('0x3b')]?_0x447efd[_0xf865('0x39')]:_0x39b6fb[_0xf865('0x35')];if(_0x189d0e['query'][_0xf865('0x49')]){_0x447efd['include']=[{'all':!![]}];}_0x447efd=_['merge']({},_0x447efd,_0x189d0e[_0xf865('0x4f')]);return db[_0xf865('0x33')][_0xf865('0x50')](_0x447efd)[_0xf865('0x28')](handleEntityNotFound(_0x1dcfd2,null))['then'](respondWithResult(_0x1dcfd2,null))[_0xf865('0x51')](handleError(_0x1dcfd2,null));};exports[_0xf865('0x52')]=function(_0x2fb7bc,_0x234fb5){return db[_0xf865('0x33')]['create'](_0x2fb7bc[_0xf865('0x53')],{})[_0xf865('0x28')](function(_0x5f4091){var _0x580070=_0x2fb7bc[_0xf865('0x54')][_0xf865('0x2a')]({'plain':!![]});if(!_0x580070)throw new Error(_0xf865('0x55'));if(_0x580070['role']===_0xf865('0x54')){var _0x2c6d8a=_0x5f4091[_0xf865('0x2a')]({'plain':!![]});var _0x93520=_0xf865('0x2b');return db[_0xf865('0x56')][_0xf865('0x50')]({'where':{'name':_0x93520,'userProfileId':_0x580070['userProfileId']},'raw':!![]})[_0xf865('0x28')](function(_0x5ec634){if(_0x5ec634&&_0x5ec634[_0xf865('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x2c6d8a[_0xf865('0x30')],'resourceId':_0x2c6d8a['id'],'type':_0x5ec634['name'],'sectionId':_0x5ec634['id']},{})[_0xf865('0x28')](function(){return _0x5f4091;});}else{return _0x5f4091;}})[_0xf865('0x51')](function(_0x5d90e1){logger[_0xf865('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d90e1);throw _0x5d90e1;});}return _0x5f4091;})[_0xf865('0x28')](respondWithResult(_0x234fb5,0xc9))[_0xf865('0x51')](handleError(_0x234fb5,null));};exports[_0xf865('0x27')]=function(_0x495303,_0x42cd49){if(_0x495303['body']['id']){delete _0x495303[_0xf865('0x53')]['id'];}return db[_0xf865('0x33')][_0xf865('0x50')]({'where':{'id':_0x495303[_0xf865('0x4d')]['id']}})['then'](handleEntityNotFound(_0x42cd49,null))[_0xf865('0x28')](saveUpdates(_0x495303[_0xf865('0x53')],null))[_0xf865('0x28')](respondWithResult(_0x42cd49,null))['catch'](handleError(_0x42cd49,null));};exports[_0xf865('0x29')]=function(_0x52f301,_0x31c4c7){return db['Team'][_0xf865('0x50')]({'where':{'id':_0x52f301[_0xf865('0x4d')]['id']}})[_0xf865('0x28')](handleEntityNotFound(_0x31c4c7,null))[_0xf865('0x28')](removeEntity(_0x31c4c7,null))[_0xf865('0x51')](handleError(_0x31c4c7,null));};exports[_0xf865('0x58')]=function(_0x38ff37,_0x27deee,_0x1b3335){return db[_0xf865('0x33')][_0xf865('0x59')]({'where':{'id':_0x38ff37[_0xf865('0x4d')]['id']}})[_0xf865('0x28')](handleEntityNotFound(_0x27deee,null))[_0xf865('0x28')](function(_0x5f75f4){if(!_0x38ff37[_0xf865('0x36')][_0xf865('0x5a')]||!utils[_0xf865('0x5b')](_0x38ff37[_0xf865('0x36')][_0xf865('0x5a')])){throw new db[(_0xf865('0x5c'))][(_0xf865('0x5d'))](_0xf865('0x5e'));}var _0x17147c={};var _0x8fdf8f={};_0x8fdf8f[_0xf865('0x35')]=_[_0xf865('0x4e')](db[_[_0xf865('0x5f')](_0x38ff37[_0xf865('0x36')][_0xf865('0x5a')][_0xf865('0x60')]())+_0xf865('0x61')][_0xf865('0x34')]);_0x8fdf8f[_0xf865('0x36')]=_[_0xf865('0x4e')](_0x38ff37[_0xf865('0x36')]);_0x8fdf8f[_0xf865('0x37')]=_[_0xf865('0x38')](_0x8fdf8f[_0xf865('0x35')],_0x8fdf8f[_0xf865('0x36')]);_0x17147c[_0xf865('0x39')]=_[_0xf865('0x38')](_0x8fdf8f[_0xf865('0x35')],qs['fields'](_0x38ff37[_0xf865('0x36')][_0xf865('0x3a')]));_0x17147c[_0xf865('0x39')]=_0x17147c['attributes'][_0xf865('0x3b')]?_0x17147c[_0xf865('0x39')]:_0x8fdf8f['model'];_0x17147c[_0xf865('0x22')]=qs[_0xf865('0x22')](_0x38ff37['query'][_0xf865('0x22')]);_0x17147c['offset']=qs[_0xf865('0x21')](_0x38ff37[_0xf865('0x36')][_0xf865('0x21')]);_0x17147c[_0xf865('0x3e')]=qs['sort'](_0x38ff37[_0xf865('0x36')][_0xf865('0x3f')]);_0x17147c[_0xf865('0x40')]=qs['filters'](_[_0xf865('0x41')](_0x38ff37[_0xf865('0x36')],_0x8fdf8f[_0xf865('0x37')]));_0x17147c=_[_0xf865('0x43')]({},_0x17147c,_0x38ff37['options']);return _0x5f75f4['get'+_['capitalize'](_0x38ff37[_0xf865('0x36')]['channel'][_0xf865('0x60')]())+_0xf865('0x62')](_0x17147c);})[_0xf865('0x28')](respondWithResult(_0x27deee,null))[_0xf865('0x51')](handleError(_0x27deee,null));};exports[_0xf865('0x63')]=function(_0x5cbe6f,_0x2f897c,_0x30106d){return db[_0xf865('0x33')]['findOne']({'where':{'id':_0x5cbe6f[_0xf865('0x4d')]['id']}})[_0xf865('0x28')](function(_0x1cdb75){if(_0x1cdb75){if(!_0x5cbe6f[_0xf865('0x53')][_0xf865('0x5a')]||!utils[_0xf865('0x5b')](_0x5cbe6f[_0xf865('0x53')][_0xf865('0x5a')])){throw new db[(_0xf865('0x5c'))][(_0xf865('0x5d'))](_0xf865('0x5e'));}return _0x1cdb75[_0xf865('0x64')+_[_0xf865('0x5f')](_0x5cbe6f[_0xf865('0x53')][_0xf865('0x5a')][_0xf865('0x60')]())+_0xf865('0x62')](_0x5cbe6f[_0xf865('0x53')][_0xf865('0x65')]);}return null;})[_0xf865('0x28')](handleEntityNotFound(_0x2f897c,null))[_0xf865('0x28')](respondWithStatusCode(_0x2f897c,null))[_0xf865('0x51')](handleError(_0x2f897c,null));};exports['removeQueues']=function(_0x3f90f6,_0x55c927,_0x303a9c){return db['Team'][_0xf865('0x59')]({'where':{'id':_0x3f90f6['params']['id']}})['then'](function(_0x121af2){if(_0x121af2){if(!_0x3f90f6[_0xf865('0x36')][_0xf865('0x5a')]||!utils[_0xf865('0x5b')](_0x3f90f6[_0xf865('0x36')][_0xf865('0x5a')])){throw new db[(_0xf865('0x5c'))][(_0xf865('0x5d'))](_0xf865('0x5e'));}return _0x121af2['remove'+_[_0xf865('0x5f')](_0x3f90f6[_0xf865('0x36')][_0xf865('0x5a')]['toLowerCase']())+_0xf865('0x62')](_0x3f90f6['query'][_0xf865('0x65')]);}return null;})[_0xf865('0x28')](handleEntityNotFound(_0x55c927,null))[_0xf865('0x28')](respondWithStatusCode(_0x55c927,null))[_0xf865('0x51')](handleError(_0x55c927,null));};exports['addAgents']=function(_0xc0e915,_0x327e04,_0x10a1c2){return db[_0xf865('0x33')][_0xf865('0x50')]({'where':{'id':_0xc0e915[_0xf865('0x4d')]['id']}})['then'](handleEntityNotFound(_0x327e04,null))[_0xf865('0x28')](function(_0x7d5afa){if(_0x7d5afa){var _0x29c5c7=[_0xf865('0x66'),'Chat',_0xf865('0x67'),_0xf865('0x68'),_0xf865('0x69'),_0xf865('0x6a')];return BPromise[_0xf865('0x6b')](_0x29c5c7,function(_0x3dee10){return _0x7d5afa[_0xf865('0x2a')+_0x3dee10+_0xf865('0x62')]({'attributes':['id',_0xf865('0x30')]})['then'](function(_0x3d91e9){return BPromise[_0xf865('0x6b')](_0x3d91e9,function(_0x5a798b){return _0x5a798b[_0xf865('0x6c')](_0xc0e915[_0xf865('0x53')]['ids'])[_0xf865('0x28')](function(){if(_0x3dee10==='Voice'){return db[_0xf865('0x6d')][_0xf865('0x4a')]({'where':{'id':_0xc0e915[_0xf865('0x53')]['ids']},'attributes':['id',_0xf865('0x30'),_0xf865('0x6e'),'voicePause','interface'],'raw':!![]})[_0xf865('0x28')](function(_0x4dd8bb){return BPromise['each'](_[_0xf865('0x42')](_0x4dd8bb,{'online':0x1}),function(_0xc9812e){return db[_0xf865('0x6f')][_0xf865('0x70')]({'membername':_0xc9812e[_0xf865('0x30')],'UserId':_0xc9812e['id'],'queue_name':_0x5a798b[_0xf865('0x30')],'VoiceQueueId':_0x5a798b['id'],'interface':_[_0xf865('0x71')](_0xc9812e['interface'])?util[_0xf865('0x72')](_0xf865('0x73'),_0xc9812e[_0xf865('0x30')]):_0xc9812e[_0xf865('0x74')],'paused':_0xc9812e['voicePause']||![],'penalty':0x0});});});}});});})[_0xf865('0x28')](function(){return _0x7d5afa;});})['then'](function(){return _0x7d5afa;});}})[_0xf865('0x28')](function(_0x1ce6b1){if(_0x1ce6b1){return _0x1ce6b1[_0xf865('0x6c')](_0xc0e915['body'][_0xf865('0x65')],_['omit'](_0xc0e915[_0xf865('0x53')],['ids','id'])||{})[_0xf865('0x75')](function(_0x25aa59){for(var _0x302c81=0x0;_0x302c81<_0xc0e915[_0xf865('0x53')][_0xf865('0x65')][_0xf865('0x3b')];_0x302c81+=0x1){socket[_0xf865('0x76')](_0xf865('0x77'),{'UserId':_0xc0e915[_0xf865('0x53')][_0xf865('0x65')][_0x302c81],'TeamId':_0xc0e915['params']['id']});}return _0x25aa59;});}})['then'](respondWithResult(_0x327e04,null))[_0xf865('0x51')](handleError(_0x327e04,null));};exports[_0xf865('0x78')]=function(_0x4b4551,_0x5026ef,_0x1a9777){return db[_0xf865('0x33')][_0xf865('0x50')]({'where':{'id':_0x4b4551[_0xf865('0x4d')]['id']}})[_0xf865('0x28')](handleEntityNotFound(_0x5026ef,null))['then'](function(_0xc85253){if(_0xc85253){return BPromise['each'](['voice',_0xf865('0x79'),_0xf865('0x7a'),_0xf865('0x7b'),'fax',_0xf865('0x7c')],function(_0x26965c){return _0xc85253['get'+_[_0xf865('0x5f')](_0x26965c)+_0xf865('0x62')]({'attributes':['id',_0xf865('0x30')]})[_0xf865('0x28')](function(_0x28b23b){return BPromise[_0xf865('0x6b')](_0x28b23b,function(_0xa5d2ac){return _0xa5d2ac[_0xf865('0x78')](_0x4b4551[_0xf865('0x36')][_0xf865('0x65')])['then'](function(){if(_0x26965c==='voice'){return db[_0xf865('0x6f')][_0xf865('0x29')]({'where':{'VoiceQueueId':_0xa5d2ac['id'],'UserId':_0x4b4551['query']['ids']}});}});});})[_0xf865('0x28')](function(){return _0xc85253;});})[_0xf865('0x28')](function(){return _0xc85253;});}})[_0xf865('0x28')](function(_0x3324f0){if(_0x3324f0){return _0x3324f0[_0xf865('0x78')](_0x4b4551[_0xf865('0x36')][_0xf865('0x65')])[_0xf865('0x28')](function(){if(_[_0xf865('0x7d')](_0x4b4551[_0xf865('0x36')][_0xf865('0x65')])){for(var _0x56fbda=0x0;_0x56fbda<_0x4b4551['query'][_0xf865('0x65')][_0xf865('0x3b')];_0x56fbda+=0x1){socket[_0xf865('0x76')](_0xf865('0x7e'),{'UserId':Number(_0x4b4551[_0xf865('0x36')]['ids'][_0x56fbda]),'TeamId':Number(_0x4b4551[_0xf865('0x4d')]['id'])});}}else{socket[_0xf865('0x76')]('userTeam:remove',{'UserId':Number(_0x4b4551['query']['ids']),'TeamId':Number(_0x4b4551[_0xf865('0x4d')]['id'])});}});}})[_0xf865('0x28')](respondWithStatusCode(_0x5026ef,null))['catch'](handleError(_0x5026ef,null));};exports[_0xf865('0x7f')]=function(_0x2ab028,_0x313915,_0x425639){var _0x114535={};var _0x2f3631={};var _0x23de98;var _0x2edfbf;return db['Team'][_0xf865('0x59')]({'where':{'id':_0x2ab028[_0xf865('0x4d')]['id']}})['then'](handleEntityNotFound(_0x313915,null))[_0xf865('0x28')](function(_0x269440){if(_0x269440){_0x23de98=_0x269440;_0x2f3631[_0xf865('0x35')]=_[_0xf865('0x4e')](db[_0xf865('0x6d')][_0xf865('0x34')]);_0x2f3631[_0xf865('0x36')]=_[_0xf865('0x4e')](_0x2ab028[_0xf865('0x36')]);_0x2f3631['filters']=_[_0xf865('0x38')](_0x2f3631[_0xf865('0x35')],_0x2f3631[_0xf865('0x36')]);_0x114535[_0xf865('0x39')]=_[_0xf865('0x38')](_0x2f3631['model'],qs[_0xf865('0x3a')](_0x2ab028[_0xf865('0x36')]['fields']));_0x114535[_0xf865('0x39')]=_0x114535[_0xf865('0x39')][_0xf865('0x3b')]?_0x114535['attributes']:_0x2f3631['model'];_0x114535[_0xf865('0x3e')]=qs[_0xf865('0x3f')](_0x2ab028[_0xf865('0x36')]['sort']);_0x114535[_0xf865('0x40')]=qs[_0xf865('0x37')](_[_0xf865('0x41')](_0x2ab028['query'],_0x2f3631['filters']));if(_0x2ab028[_0xf865('0x36')][_0xf865('0x42')]){_0x114535[_0xf865('0x40')]=_['merge'](_0x114535['where'],{'$or':_['map'](_0x114535[_0xf865('0x39')],function(_0x4d968f){var _0x1e77da={};_0x1e77da[_0x4d968f]={'$like':'%'+_0x2ab028[_0xf865('0x36')]['filter']+'%'};return _0x1e77da;})});}_0x114535=_[_0xf865('0x43')]({},_0x114535,_0x2ab028['options']);return _0x23de98['getAgents'](_0x114535);}})[_0xf865('0x28')](function(_0xa6393){if(_0xa6393){_0x2edfbf=_0xa6393[_0xf865('0x3b')];if(!_0x2ab028['query'][_0xf865('0x3c')](_0xf865('0x3d'))){_0x114535['limit']=qs[_0xf865('0x22')](_0x2ab028[_0xf865('0x36')]['limit']);_0x114535[_0xf865('0x21')]=qs[_0xf865('0x21')](_0x2ab028['query'][_0xf865('0x21')]);}return _0x23de98[_0xf865('0x7f')](_0x114535);}})[_0xf865('0x28')](function(_0x3870c5){if(_0x3870c5){return _0x3870c5?{'count':_0x2edfbf,'rows':_0x3870c5}:null;}})['then'](respondWithResult(_0x313915,null))[_0xf865('0x51')](handleError(_0x313915,null));}; \ No newline at end of file +var _0x8636=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','Team','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','user','Teams','UserProfileSection','userProfileId','autoAssociation','error','getQueues','findOne','channel','Sequelize','Unknown\x20channel','capitalize','toLowerCase','Queue','rawAttributes','order','Queues','isValidChannel','ValidationError','add','ids','removeQueues','remove','addAgents','Voice','Chat','Fax','Openchannel','each','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','omit','spread','userTeam:save','removeAgents','chat','mail','sms','fax','openchannel','voice','isArray','userTeam:remove','emit','getAgents','User','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis'];(function(_0x57ae71,_0x4f793f){var _0xdab35d=function(_0x5d88db){while(--_0x5d88db){_0x57ae71['push'](_0x57ae71['shift']());}};_0xdab35d(++_0x4f793f);}(_0x8636,0x73));var _0x6863=function(_0x3b0e74,_0x295ca1){_0x3b0e74=_0x3b0e74-0x0;var _0x2ebdc1=_0x8636[_0x3b0e74];return _0x2ebdc1;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x6863('0x0'));var zipdir=require(_0x6863('0x1'));var jsonpatch=require(_0x6863('0x2'));var rp=require('request-promise');var moment=require(_0x6863('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6863('0x4'));var util=require(_0x6863('0x5'));var path=require('path');var sox=require(_0x6863('0x6'));var csv=require('to-csv');var ejs=require(_0x6863('0x7'));var fs=require('fs');var _=require(_0x6863('0x8'));var squel=require(_0x6863('0x9'));var crypto=require('crypto');var jsforce=require(_0x6863('0xa'));var deskjs=require(_0x6863('0xb'));var toCsv=require(_0x6863('0xc'));var querystring=require('querystring');var Papa=require(_0x6863('0xd'));var Redis=require(_0x6863('0xe'));var authService=require(_0x6863('0xf'));var qs=require(_0x6863('0x10'));var hardwareService=require(_0x6863('0x11'));var logger=require(_0x6863('0x12'))(_0x6863('0x13'));var utils=require('../../config/utils');var config=require(_0x6863('0x14'));var db=require(_0x6863('0x15'))['db'];config[_0x6863('0x16')]=_[_0x6863('0x17')](config[_0x6863('0x16')],{'host':_0x6863('0x18'),'port':0x18eb});var socket=require(_0x6863('0x19'))(new Redis(config[_0x6863('0x16')]));require(_0x6863('0x1a'))[_0x6863('0x1b')](socket);function respondWithStatusCode(_0x25f7a1,_0x584384){_0x584384=_0x584384||0xcc;return function(_0x3b129b){if(_0x3b129b){return _0x25f7a1[_0x6863('0x1c')](_0x584384);}return _0x25f7a1['status'](_0x584384)[_0x6863('0x1d')]();};}function respondWithResult(_0x5c6204,_0x2d11ad){_0x2d11ad=_0x2d11ad||0xc8;return function(_0x576cb6){if(_0x576cb6){return _0x5c6204[_0x6863('0x1e')](_0x2d11ad)[_0x6863('0x1f')](_0x576cb6);}};}function respondWithFilteredResult(_0x3be79f,_0x4db862){return function(_0x102bfe){if(_0x102bfe){var _0xfe4c25=_0x102bfe[_0x6863('0x20')],_0x97424=_0x4db862[_0x6863('0x21')],_0x730e3a=_0x4db862['offset']+_0x4db862[_0x6863('0x22')],_0x37a0ad;if(_0x730e3a>=_0xfe4c25){_0x730e3a=_0xfe4c25;_0x37a0ad=0xc8;}else{_0x37a0ad=0xce;}_0x3be79f[_0x6863('0x1e')](_0x37a0ad);return _0x3be79f[_0x6863('0x23')]('Content-Range',_0x97424+'-'+_0x730e3a+'/'+_0xfe4c25)['json'](_0x102bfe);}return null;};}function patchUpdates(_0x298952){return function(_0x34f348){try{jsonpatch[_0x6863('0x24')](_0x34f348,_0x298952,!![]);}catch(_0x504b10){return BPromise[_0x6863('0x25')](_0x504b10);}return _0x34f348[_0x6863('0x26')]();};}function saveUpdates(_0x520d46,_0x5398c8){return function(_0x562750){if(_0x562750){return _0x562750[_0x6863('0x27')](_0x520d46)[_0x6863('0x28')](function(_0x1e8c85){return _0x1e8c85;});}return null;};}function removeEntity(_0x2b7557,_0x387d8d){return function(_0x502c58){if(_0x502c58){return _0x502c58[_0x6863('0x29')]()[_0x6863('0x28')](function(){var _0x47a1ad=_0x502c58[_0x6863('0x2a')]({'plain':!![]});var _0x2957e5='Teams';return db[_0x6863('0x2b')][_0x6863('0x29')]({'where':{'type':_0x2957e5,'resourceId':_0x47a1ad['id']}})[_0x6863('0x28')](function(){return _0x502c58;});})['then'](function(){_0x2b7557[_0x6863('0x1e')](0xcc)[_0x6863('0x1d')]();});}};}function handleEntityNotFound(_0xd9152a,_0x29cdad){return function(_0x430638){if(!_0x430638){_0xd9152a[_0x6863('0x1c')](0x194);}return _0x430638;};}function handleError(_0xd683d,_0x37237a){_0x37237a=_0x37237a||0x1f4;return function(_0x1fbcf1){logger['error'](_0x1fbcf1[_0x6863('0x2c')]);if(_0x1fbcf1['name']){delete _0x1fbcf1[_0x6863('0x2d')];}_0xd683d['status'](_0x37237a)[_0x6863('0x2e')](_0x1fbcf1);};}exports[_0x6863('0x2f')]=function(_0xb63a38,_0x1c5e47){var _0x1a80c2={},_0x536ebc={},_0x4adc14={'count':0x0,'rows':[]};var _0x3068b0=db[_0x6863('0x30')]['rawAttributes'];_0x536ebc[_0x6863('0x31')]=_['keys'](_0x3068b0);_0x536ebc[_0x6863('0x32')]=_[_0x6863('0x33')](_0xb63a38[_0x6863('0x32')]);_0x536ebc[_0x6863('0x34')]=_[_0x6863('0x35')](_0x536ebc['model'],_0x536ebc['query']);_0x1a80c2[_0x6863('0x36')]=_['intersection'](_0x536ebc['model'],qs[_0x6863('0x37')](_0xb63a38['query'][_0x6863('0x37')]));_0x1a80c2[_0x6863('0x36')]=_0x1a80c2[_0x6863('0x36')]['length']?_0x1a80c2['attributes']:_0x536ebc['model'];if(!_0xb63a38[_0x6863('0x32')][_0x6863('0x38')](_0x6863('0x39'))){_0x1a80c2[_0x6863('0x22')]=qs[_0x6863('0x22')](_0xb63a38[_0x6863('0x32')][_0x6863('0x22')]);_0x1a80c2[_0x6863('0x21')]=qs[_0x6863('0x21')](_0xb63a38[_0x6863('0x32')][_0x6863('0x21')]);}_0x1a80c2['order']=qs[_0x6863('0x3a')](_0xb63a38[_0x6863('0x32')]['sort']);_0x1a80c2[_0x6863('0x3b')]=qs[_0x6863('0x34')](_[_0x6863('0x3c')](_0xb63a38[_0x6863('0x32')],_0x536ebc[_0x6863('0x34')]));if(_0xb63a38[_0x6863('0x32')][_0x6863('0x3d')]){_0x1a80c2[_0x6863('0x3b')]=_['merge'](_0x1a80c2[_0x6863('0x3b')],{'$or':_[_0x6863('0x3e')](_0x3068b0,function(_0x36b7d0){if(_0x36b7d0[_0x6863('0x3f')][_0x6863('0x40')]!==_0x6863('0x41')){var _0x2c774e={};_0x2c774e[_0x36b7d0[_0x6863('0x42')]]={'$like':'%'+_0xb63a38[_0x6863('0x32')][_0x6863('0x3d')]+'%'};return _0x2c774e;}})});}_0x1a80c2=_[_0x6863('0x43')]({},_0x1a80c2,_0xb63a38['options']);var _0x5ba0b3={'where':_0x1a80c2[_0x6863('0x3b')]};return db['Team'][_0x6863('0x20')](_0x5ba0b3)[_0x6863('0x28')](function(_0x67bc85){_0x4adc14[_0x6863('0x20')]=_0x67bc85;if(_0xb63a38[_0x6863('0x32')][_0x6863('0x44')]){_0x1a80c2[_0x6863('0x45')]=[{'all':!![]}];}return db[_0x6863('0x30')][_0x6863('0x46')](_0x1a80c2);})['then'](function(_0x5af630){_0x4adc14[_0x6863('0x47')]=_0x5af630;return _0x4adc14;})['then'](respondWithFilteredResult(_0x1c5e47,_0x1a80c2))[_0x6863('0x48')](handleError(_0x1c5e47,null));};exports[_0x6863('0x49')]=function(_0xd25dbd,_0xbde838){var _0x499399={'raw':![],'where':{'id':_0xd25dbd[_0x6863('0x4a')]['id']}},_0x172f26={};_0x172f26[_0x6863('0x31')]=_['keys'](db[_0x6863('0x30')]['rawAttributes']);_0x172f26[_0x6863('0x32')]=_[_0x6863('0x33')](_0xd25dbd['query']);_0x172f26[_0x6863('0x34')]=_[_0x6863('0x35')](_0x172f26[_0x6863('0x31')],_0x172f26[_0x6863('0x32')]);_0x499399[_0x6863('0x36')]=_['intersection'](_0x172f26[_0x6863('0x31')],qs[_0x6863('0x37')](_0xd25dbd[_0x6863('0x32')][_0x6863('0x37')]));_0x499399[_0x6863('0x36')]=_0x499399['attributes'][_0x6863('0x4b')]?_0x499399[_0x6863('0x36')]:_0x172f26['model'];if(_0xd25dbd['query']['includeAll']){_0x499399[_0x6863('0x45')]=[{'all':!![]}];}_0x499399=_[_0x6863('0x43')]({},_0x499399,_0xd25dbd[_0x6863('0x4c')]);return db[_0x6863('0x30')][_0x6863('0x4d')](_0x499399)[_0x6863('0x28')](handleEntityNotFound(_0xbde838,null))[_0x6863('0x28')](respondWithResult(_0xbde838,null))[_0x6863('0x48')](handleError(_0xbde838,null));};exports[_0x6863('0x4e')]=function(_0xe3a0b7,_0x2c4c50){return db[_0x6863('0x30')][_0x6863('0x4e')](_0xe3a0b7[_0x6863('0x4f')],{})[_0x6863('0x28')](function(_0x447b8b){var _0x10bf1d=_0xe3a0b7['user'][_0x6863('0x2a')]({'plain':!![]});if(!_0x10bf1d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10bf1d['role']===_0x6863('0x50')){var _0x4ba548=_0x447b8b[_0x6863('0x2a')]({'plain':!![]});var _0x3e10a0=_0x6863('0x51');return db[_0x6863('0x52')]['find']({'where':{'name':_0x3e10a0,'userProfileId':_0x10bf1d[_0x6863('0x53')]},'raw':!![]})[_0x6863('0x28')](function(_0x3393d5){if(_0x3393d5&&_0x3393d5[_0x6863('0x54')]===0x0){return db[_0x6863('0x2b')][_0x6863('0x4e')]({'name':_0x4ba548[_0x6863('0x2d')],'resourceId':_0x4ba548['id'],'type':_0x3393d5[_0x6863('0x2d')],'sectionId':_0x3393d5['id']},{})[_0x6863('0x28')](function(){return _0x447b8b;});}else{return _0x447b8b;}})[_0x6863('0x48')](function(_0xb94b15){logger[_0x6863('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb94b15);throw _0xb94b15;});}return _0x447b8b;})[_0x6863('0x28')](respondWithResult(_0x2c4c50,0xc9))['catch'](handleError(_0x2c4c50,null));};exports['update']=function(_0x545f16,_0x2c2054){if(_0x545f16[_0x6863('0x4f')]['id']){delete _0x545f16[_0x6863('0x4f')]['id'];}return db['Team'][_0x6863('0x4d')]({'where':{'id':_0x545f16[_0x6863('0x4a')]['id']}})[_0x6863('0x28')](handleEntityNotFound(_0x2c2054,null))[_0x6863('0x28')](saveUpdates(_0x545f16[_0x6863('0x4f')],null))[_0x6863('0x28')](respondWithResult(_0x2c2054,null))[_0x6863('0x48')](handleError(_0x2c2054,null));};exports[_0x6863('0x29')]=function(_0x2b0361,_0x1a9074){return db[_0x6863('0x30')][_0x6863('0x4d')]({'where':{'id':_0x2b0361[_0x6863('0x4a')]['id']}})[_0x6863('0x28')](handleEntityNotFound(_0x1a9074,null))[_0x6863('0x28')](removeEntity(_0x1a9074,null))[_0x6863('0x48')](handleError(_0x1a9074,null));};exports[_0x6863('0x56')]=function(_0xe0fec4,_0x502a8b,_0x26d2c8){return db[_0x6863('0x30')][_0x6863('0x57')]({'where':{'id':_0xe0fec4['params']['id']}})[_0x6863('0x28')](handleEntityNotFound(_0x502a8b,null))[_0x6863('0x28')](function(_0x254cab){if(!_0xe0fec4[_0x6863('0x32')][_0x6863('0x58')]||!utils['isValidChannel'](_0xe0fec4[_0x6863('0x32')][_0x6863('0x58')])){throw new db[(_0x6863('0x59'))]['ValidationError'](_0x6863('0x5a'));}var _0x2fe578={};var _0x1e3346={};_0x1e3346[_0x6863('0x31')]=_[_0x6863('0x33')](db[_[_0x6863('0x5b')](_0xe0fec4['query']['channel'][_0x6863('0x5c')]())+_0x6863('0x5d')][_0x6863('0x5e')]);_0x1e3346['query']=_[_0x6863('0x33')](_0xe0fec4[_0x6863('0x32')]);_0x1e3346[_0x6863('0x34')]=_[_0x6863('0x35')](_0x1e3346[_0x6863('0x31')],_0x1e3346['query']);_0x2fe578['attributes']=_['intersection'](_0x1e3346[_0x6863('0x31')],qs['fields'](_0xe0fec4[_0x6863('0x32')][_0x6863('0x37')]));_0x2fe578[_0x6863('0x36')]=_0x2fe578['attributes']['length']?_0x2fe578[_0x6863('0x36')]:_0x1e3346[_0x6863('0x31')];_0x2fe578[_0x6863('0x22')]=qs[_0x6863('0x22')](_0xe0fec4['query'][_0x6863('0x22')]);_0x2fe578[_0x6863('0x21')]=qs[_0x6863('0x21')](_0xe0fec4[_0x6863('0x32')][_0x6863('0x21')]);_0x2fe578[_0x6863('0x5f')]=qs['sort'](_0xe0fec4[_0x6863('0x32')][_0x6863('0x3a')]);_0x2fe578[_0x6863('0x3b')]=qs[_0x6863('0x34')](_[_0x6863('0x3c')](_0xe0fec4[_0x6863('0x32')],_0x1e3346[_0x6863('0x34')]));_0x2fe578=_['merge']({},_0x2fe578,_0xe0fec4[_0x6863('0x4c')]);return _0x254cab[_0x6863('0x2a')+_[_0x6863('0x5b')](_0xe0fec4[_0x6863('0x32')][_0x6863('0x58')][_0x6863('0x5c')]())+_0x6863('0x60')](_0x2fe578);})[_0x6863('0x28')](respondWithResult(_0x502a8b,null))['catch'](handleError(_0x502a8b,null));};exports['addQueues']=function(_0x44e964,_0x89027e,_0x40ee94){return db[_0x6863('0x30')][_0x6863('0x57')]({'where':{'id':_0x44e964[_0x6863('0x4a')]['id']}})[_0x6863('0x28')](function(_0x18420a){if(_0x18420a){if(!_0x44e964[_0x6863('0x4f')][_0x6863('0x58')]||!utils[_0x6863('0x61')](_0x44e964[_0x6863('0x4f')][_0x6863('0x58')])){throw new db[(_0x6863('0x59'))][(_0x6863('0x62'))]('Unknown\x20channel');}return _0x18420a[_0x6863('0x63')+_['capitalize'](_0x44e964[_0x6863('0x4f')][_0x6863('0x58')]['toLowerCase']())+_0x6863('0x60')](_0x44e964[_0x6863('0x4f')][_0x6863('0x64')]);}return null;})['then'](handleEntityNotFound(_0x89027e,null))[_0x6863('0x28')](respondWithStatusCode(_0x89027e,null))[_0x6863('0x48')](handleError(_0x89027e,null));};exports[_0x6863('0x65')]=function(_0x19a98c,_0x5b56ef,_0x2b8a62){return db['Team'][_0x6863('0x57')]({'where':{'id':_0x19a98c[_0x6863('0x4a')]['id']}})[_0x6863('0x28')](function(_0x3f502e){if(_0x3f502e){if(!_0x19a98c[_0x6863('0x32')]['channel']||!utils[_0x6863('0x61')](_0x19a98c[_0x6863('0x32')]['channel'])){throw new db[(_0x6863('0x59'))][(_0x6863('0x62'))](_0x6863('0x5a'));}return _0x3f502e[_0x6863('0x66')+_[_0x6863('0x5b')](_0x19a98c[_0x6863('0x32')][_0x6863('0x58')][_0x6863('0x5c')]())+'Queues'](_0x19a98c[_0x6863('0x32')][_0x6863('0x64')]);}return null;})[_0x6863('0x28')](handleEntityNotFound(_0x5b56ef,null))[_0x6863('0x28')](respondWithStatusCode(_0x5b56ef,null))[_0x6863('0x48')](handleError(_0x5b56ef,null));};exports[_0x6863('0x67')]=function(_0x163a6f,_0x14f3b4,_0x351a79){return db[_0x6863('0x30')][_0x6863('0x4d')]({'where':{'id':_0x163a6f[_0x6863('0x4a')]['id']}})[_0x6863('0x28')](handleEntityNotFound(_0x14f3b4,null))[_0x6863('0x28')](function(_0x19afe6){if(_0x19afe6){var _0x1167c1=[_0x6863('0x68'),_0x6863('0x69'),'Mail','Sms',_0x6863('0x6a'),_0x6863('0x6b')];return BPromise[_0x6863('0x6c')](_0x1167c1,function(_0x1ca260){return _0x19afe6[_0x6863('0x2a')+_0x1ca260+_0x6863('0x60')]({'attributes':['id',_0x6863('0x2d')]})[_0x6863('0x28')](function(_0x5c916f){return BPromise[_0x6863('0x6c')](_0x5c916f,function(_0x292c5a){return _0x292c5a['addAgents'](_0x163a6f[_0x6863('0x4f')][_0x6863('0x64')])[_0x6863('0x28')](function(){if(_0x1ca260===_0x6863('0x68')){return db['User'][_0x6863('0x46')]({'where':{'id':_0x163a6f[_0x6863('0x4f')][_0x6863('0x64')]},'attributes':['id',_0x6863('0x2d'),_0x6863('0x6d'),_0x6863('0x6e'),_0x6863('0x6f')],'raw':!![]})[_0x6863('0x28')](function(_0xb83f1b){return BPromise[_0x6863('0x6c')](_[_0x6863('0x3d')](_0xb83f1b,{'online':0x1}),function(_0x3459ae){return db[_0x6863('0x70')][_0x6863('0x71')]({'membername':_0x3459ae[_0x6863('0x2d')],'UserId':_0x3459ae['id'],'queue_name':_0x292c5a['name'],'VoiceQueueId':_0x292c5a['id'],'interface':_[_0x6863('0x72')](_0x3459ae[_0x6863('0x6f')])?util['format']('SIP/%s',_0x3459ae[_0x6863('0x2d')]):_0x3459ae[_0x6863('0x6f')],'paused':_0x3459ae[_0x6863('0x6e')]||![],'penalty':0x0});});});}});});})[_0x6863('0x28')](function(){return _0x19afe6;});})[_0x6863('0x28')](function(){return _0x19afe6;});}})[_0x6863('0x28')](function(_0x13025d){if(_0x13025d){return _0x13025d[_0x6863('0x67')](_0x163a6f[_0x6863('0x4f')][_0x6863('0x64')],_[_0x6863('0x73')](_0x163a6f[_0x6863('0x4f')],['ids','id'])||{})[_0x6863('0x74')](function(_0x403857){for(var _0x4a04e9=0x0;_0x4a04e9<_0x163a6f[_0x6863('0x4f')]['ids'][_0x6863('0x4b')];_0x4a04e9+=0x1){socket['emit'](_0x6863('0x75'),{'UserId':_0x163a6f['body'][_0x6863('0x64')][_0x4a04e9],'TeamId':_0x163a6f['params']['id']});}return _0x403857;});}})[_0x6863('0x28')](respondWithResult(_0x14f3b4,null))[_0x6863('0x48')](handleError(_0x14f3b4,null));};exports[_0x6863('0x76')]=function(_0x166df1,_0x52c7e1,_0x45e76a){return db[_0x6863('0x30')][_0x6863('0x4d')]({'where':{'id':_0x166df1['params']['id']}})[_0x6863('0x28')](handleEntityNotFound(_0x52c7e1,null))[_0x6863('0x28')](function(_0x3812f3){if(_0x3812f3){return BPromise[_0x6863('0x6c')](['voice',_0x6863('0x77'),_0x6863('0x78'),_0x6863('0x79'),_0x6863('0x7a'),_0x6863('0x7b')],function(_0x30cd47){return _0x3812f3['get'+_[_0x6863('0x5b')](_0x30cd47)+_0x6863('0x60')]({'attributes':['id','name']})[_0x6863('0x28')](function(_0x17f734){return BPromise[_0x6863('0x6c')](_0x17f734,function(_0xe93c5a){return _0xe93c5a[_0x6863('0x76')](_0x166df1[_0x6863('0x32')]['ids'])['then'](function(){if(_0x30cd47===_0x6863('0x7c')){return db[_0x6863('0x70')][_0x6863('0x29')]({'where':{'VoiceQueueId':_0xe93c5a['id'],'UserId':_0x166df1[_0x6863('0x32')][_0x6863('0x64')]}});}});});})[_0x6863('0x28')](function(){return _0x3812f3;});})[_0x6863('0x28')](function(){return _0x3812f3;});}})[_0x6863('0x28')](function(_0x393379){if(_0x393379){return _0x393379['removeAgents'](_0x166df1[_0x6863('0x32')][_0x6863('0x64')])['then'](function(){if(_[_0x6863('0x7d')](_0x166df1[_0x6863('0x32')]['ids'])){for(var _0x571770=0x0;_0x571770<_0x166df1['query'][_0x6863('0x64')][_0x6863('0x4b')];_0x571770+=0x1){socket['emit'](_0x6863('0x7e'),{'UserId':Number(_0x166df1[_0x6863('0x32')][_0x6863('0x64')][_0x571770]),'TeamId':Number(_0x166df1[_0x6863('0x4a')]['id'])});}}else{socket[_0x6863('0x7f')](_0x6863('0x7e'),{'UserId':Number(_0x166df1[_0x6863('0x32')]['ids']),'TeamId':Number(_0x166df1[_0x6863('0x4a')]['id'])});}});}})[_0x6863('0x28')](respondWithStatusCode(_0x52c7e1,null))[_0x6863('0x48')](handleError(_0x52c7e1,null));};exports[_0x6863('0x80')]=function(_0x3ee7ca,_0x281f8b,_0x44adcc){var _0x36cfe={};var _0x190378={};var _0x45665f;var _0x409a78;return db[_0x6863('0x30')]['findOne']({'where':{'id':_0x3ee7ca[_0x6863('0x4a')]['id']}})[_0x6863('0x28')](handleEntityNotFound(_0x281f8b,null))[_0x6863('0x28')](function(_0x308785){if(_0x308785){_0x45665f=_0x308785;_0x190378[_0x6863('0x31')]=_[_0x6863('0x33')](db[_0x6863('0x81')][_0x6863('0x5e')]);_0x190378['query']=_[_0x6863('0x33')](_0x3ee7ca[_0x6863('0x32')]);_0x190378[_0x6863('0x34')]=_[_0x6863('0x35')](_0x190378[_0x6863('0x31')],_0x190378[_0x6863('0x32')]);_0x36cfe['attributes']=_[_0x6863('0x35')](_0x190378['model'],qs[_0x6863('0x37')](_0x3ee7ca[_0x6863('0x32')][_0x6863('0x37')]));_0x36cfe[_0x6863('0x36')]=_0x36cfe[_0x6863('0x36')]['length']?_0x36cfe['attributes']:_0x190378[_0x6863('0x31')];_0x36cfe[_0x6863('0x5f')]=qs[_0x6863('0x3a')](_0x3ee7ca[_0x6863('0x32')][_0x6863('0x3a')]);_0x36cfe[_0x6863('0x3b')]=qs[_0x6863('0x34')](_[_0x6863('0x3c')](_0x3ee7ca[_0x6863('0x32')],_0x190378[_0x6863('0x34')]));if(_0x3ee7ca[_0x6863('0x32')]['filter']){_0x36cfe[_0x6863('0x3b')]=_[_0x6863('0x43')](_0x36cfe[_0x6863('0x3b')],{'$or':_[_0x6863('0x3e')](_0x36cfe[_0x6863('0x36')],function(_0x56fe76){var _0x6167c2={};_0x6167c2[_0x56fe76]={'$like':'%'+_0x3ee7ca[_0x6863('0x32')][_0x6863('0x3d')]+'%'};return _0x6167c2;})});}_0x36cfe=_['merge']({},_0x36cfe,_0x3ee7ca[_0x6863('0x4c')]);return _0x45665f[_0x6863('0x80')](_0x36cfe);}})[_0x6863('0x28')](function(_0x3f85e0){if(_0x3f85e0){_0x409a78=_0x3f85e0['length'];if(!_0x3ee7ca[_0x6863('0x32')][_0x6863('0x38')]('nolimit')){_0x36cfe['limit']=qs[_0x6863('0x22')](_0x3ee7ca[_0x6863('0x32')][_0x6863('0x22')]);_0x36cfe[_0x6863('0x21')]=qs[_0x6863('0x21')](_0x3ee7ca[_0x6863('0x32')][_0x6863('0x21')]);}return _0x45665f[_0x6863('0x80')](_0x36cfe);}})[_0x6863('0x28')](function(_0x2af42a){if(_0x2af42a){return _0x2af42a?{'count':_0x409a78,'rows':_0x2af42a}:null;}})[_0x6863('0x28')](respondWithResult(_0x281f8b,null))[_0x6863('0x48')](handleError(_0x281f8b,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index f072531..9bf5b6e 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 _0xa456=['Team','setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x4c4648,_0x551057){var _0x23f1cb=function(_0x291aaf){while(--_0x291aaf){_0x4c4648['push'](_0x4c4648['shift']());}};_0x23f1cb(++_0x551057);}(_0xa456,0x142));var _0x6a45=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0xa456[_0xfa634c];return _0x73e478;};'use strict';var EventEmitter=require(_0x6a45('0x0'));var Team=require(_0x6a45('0x1'))['db'][_0x6a45('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x6a45('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6a45('0x4'),'afterDestroy':_0x6a45('0x5')};function emitEvent(_0x3f7448){return function(_0x500c72,_0x1f0701,_0x40acad){TeamEvents[_0x6a45('0x6')](_0x3f7448+':'+_0x500c72['id'],_0x500c72);TeamEvents[_0x6a45('0x6')](_0x3f7448,_0x500c72);_0x40acad(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x6a45('0x7')](e,emitEvent(event));}}module[_0x6a45('0x8')]=TeamEvents; \ No newline at end of file +var _0x06ae=['save','update','remove','hasOwnProperty','hook','exports','../../mysqldb','Team','setMaxListeners'];(function(_0x3f381d,_0x267abc){var _0x18ea26=function(_0x3be35e){while(--_0x3be35e){_0x3f381d['push'](_0x3f381d['shift']());}};_0x18ea26(++_0x267abc);}(_0x06ae,0x16e));var _0xe06a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x06ae[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var Team=require(_0xe06a('0x0'))['db'][_0xe06a('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xe06a('0x2')](0x0);var events={'afterCreate':_0xe06a('0x3'),'afterUpdate':_0xe06a('0x4'),'afterDestroy':_0xe06a('0x5')};function emitEvent(_0x2dfe68){return function(_0x1d695f,_0x1e7706,_0x4de363){TeamEvents['emit'](_0x2dfe68+':'+_0x1d695f['id'],_0x1d695f);TeamEvents['emit'](_0x2dfe68,_0x1d695f);_0x4de363(null);};}for(var e in events){if(events[_0xe06a('0x6')](e)){var event=events[e];Team[_0xe06a('0x7')](e,emitEvent(event));}}module[_0xe06a('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 171fe13..8c2d3a5 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 _0xf97e=['define','teams','util','../../config/logger','api','moment','bluebird','../../config/environment','./team.attributes'];(function(_0x4b4d46,_0x17b946){var _0x52b5c6=function(_0x2b42d4){while(--_0x2b42d4){_0x4b4d46['push'](_0x4b4d46['shift']());}};_0x52b5c6(++_0x17b946);}(_0xf97e,0xa4));var _0xef97=function(_0x257fd4,_0x446a74){_0x257fd4=_0x257fd4-0x0;var _0x3bbcba=_0xf97e[_0x257fd4];return _0x3bbcba;};'use strict';var _=require('lodash');var util=require(_0xef97('0x0'));var logger=require(_0xef97('0x1'))(_0xef97('0x2'));var moment=require(_0xef97('0x3'));var BPromise=require(_0xef97('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xef97('0x5'));var attributes=require(_0xef97('0x6'));module['exports']=function(_0x5bdf5f,_0x1fe83a){return _0x5bdf5f[_0xef97('0x7')]('Team',attributes,{'tableName':_0xef97('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c7e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','define','Team','teams','lodash','util'];(function(_0x48b3a0,_0x5ed808){var _0x1d0c6d=function(_0x2126c1){while(--_0x2126c1){_0x48b3a0['push'](_0x48b3a0['shift']());}};_0x1d0c6d(++_0x5ed808);}(_0x4c7e,0x1cc));var _0xe4c7=function(_0x43997b,_0x17bd44){_0x43997b=_0x43997b-0x0;var _0x4ac8c1=_0x4c7e[_0x43997b];return _0x4ac8c1;};'use strict';var _=require(_0xe4c7('0x0'));var util=require(_0xe4c7('0x1'));var logger=require('../../config/logger')(_0xe4c7('0x2'));var moment=require(_0xe4c7('0x3'));var BPromise=require(_0xe4c7('0x4'));var rp=require(_0xe4c7('0x5'));var fs=require('fs');var path=require(_0xe4c7('0x6'));var rimraf=require(_0xe4c7('0x7'));var config=require(_0xe4c7('0x8'));var attributes=require(_0xe4c7('0x9'));module[_0xe4c7('0xa')]=function(_0xf5680a,_0x4a6527){return _0xf5680a[_0xe4c7('0xb')](_0xe4c7('0xc'),attributes,{'tableName':_0xe4c7('0xd'),'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 141f1e6..7acc0e5 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 _0x1633=['Team,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults','./team.socket','register','request','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x55af20,_0x4565f6){var _0x330a2f=function(_0x1231d0){while(--_0x1231d0){_0x55af20['push'](_0x55af20['shift']());}};_0x330a2f(++_0x4565f6);}(_0x1633,0x67));var _0x3163=function(_0x45e93c,_0x2b4de2){_0x45e93c=_0x45e93c-0x0;var _0x20f00c=_0x1633[_0x45e93c];return _0x20f00c;};'use strict';var _=require(_0x3163('0x0'));var util=require(_0x3163('0x1'));var moment=require(_0x3163('0x2'));var BPromise=require(_0x3163('0x3'));var rs=require(_0x3163('0x4'));var fs=require('fs');var Redis=require(_0x3163('0x5'));var db=require(_0x3163('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x3163('0x7'));var jayson=require(_0x3163('0x8'));var client=jayson[_0x3163('0x9')][_0x3163('0xa')]({'port':0x232a});config[_0x3163('0xb')]=_[_0x3163('0xc')](config[_0x3163('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3163('0xd'))[_0x3163('0xe')](socket);function respondWithRpcPromise(_0x3c95c4,_0x426fcd,_0x3fc91e){return new BPromise(function(_0x5be05f,_0x4be770){return client[_0x3163('0xf')](_0x3c95c4,_0x3fc91e)['then'](function(_0x2c1e45){logger['info']('Team,\x20%s,\x20%s',_0x426fcd,_0x3163('0x10'));logger[_0x3163('0x11')](_0x3163('0x12'),_0x426fcd,_0x3163('0x10'),JSON[_0x3163('0x13')](_0x2c1e45));if(_0x2c1e45[_0x3163('0x14')]){if(_0x2c1e45[_0x3163('0x14')][_0x3163('0x15')]===0x1f4){logger[_0x3163('0x14')](_0x3163('0x16'),_0x426fcd,_0x2c1e45[_0x3163('0x14')]['message']);return _0x4be770(_0x2c1e45[_0x3163('0x14')][_0x3163('0x17')]);}logger[_0x3163('0x14')](_0x3163('0x16'),_0x426fcd,_0x2c1e45[_0x3163('0x14')]['message']);return _0x5be05f(_0x2c1e45['error'][_0x3163('0x17')]);}else{logger['info'](_0x3163('0x16'),_0x426fcd,_0x3163('0x10'));_0x5be05f(_0x2c1e45['result']['message']);}})[_0x3163('0x18')](function(_0x2b184c){logger[_0x3163('0x14')](_0x3163('0x16'),_0x426fcd,_0x2b184c);_0x4be770(_0x2b184c);});});} \ No newline at end of file +var _0x68f9=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./team.socket','register','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0xb7c009,_0x4333ca){var _0x626b24=function(_0x3a03b1){while(--_0x3a03b1){_0xb7c009['push'](_0xb7c009['shift']());}};_0x626b24(++_0x4333ca);}(_0x68f9,0x113));var _0x968f=function(_0x59a31c,_0x2bc00c){_0x59a31c=_0x59a31c-0x0;var _0x218a6f=_0x68f9[_0x59a31c];return _0x218a6f;};'use strict';var _=require(_0x968f('0x0'));var util=require('util');var moment=require(_0x968f('0x1'));var BPromise=require(_0x968f('0x2'));var rs=require(_0x968f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x968f('0x4'))['db'];var utils=require(_0x968f('0x5'));var logger=require(_0x968f('0x6'))(_0x968f('0x7'));var config=require(_0x968f('0x8'));var jayson=require(_0x968f('0x9'));var client=jayson['client'][_0x968f('0xa')]({'port':0x232a});config[_0x968f('0xb')]=_['defaults'](config['redis'],{'host':_0x968f('0xc'),'port':0x18eb});var socket=require(_0x968f('0xd'))(new Redis(config[_0x968f('0xb')]));require(_0x968f('0xe'))[_0x968f('0xf')](socket);function respondWithRpcPromise(_0x3afe48,_0x342503,_0x43286b){return new BPromise(function(_0x120d4e,_0x4b734e){return client['request'](_0x3afe48,_0x43286b)['then'](function(_0x556864){logger[_0x968f('0x10')](_0x968f('0x11'),_0x342503,_0x968f('0x12'));logger['debug'](_0x968f('0x13'),_0x342503,'request\x20sent',JSON[_0x968f('0x14')](_0x556864));if(_0x556864[_0x968f('0x15')]){if(_0x556864[_0x968f('0x15')][_0x968f('0x16')]===0x1f4){logger[_0x968f('0x15')](_0x968f('0x11'),_0x342503,_0x556864['error'][_0x968f('0x17')]);return _0x4b734e(_0x556864[_0x968f('0x15')][_0x968f('0x17')]);}logger[_0x968f('0x15')]('Team,\x20%s,\x20%s',_0x342503,_0x556864[_0x968f('0x15')][_0x968f('0x17')]);return _0x120d4e(_0x556864[_0x968f('0x15')][_0x968f('0x17')]);}else{logger[_0x968f('0x10')]('Team,\x20%s,\x20%s',_0x342503,_0x968f('0x12'));_0x120d4e(_0x556864[_0x968f('0x18')][_0x968f('0x17')]);}})['catch'](function(_0x3ebde3){logger['error']('Team,\x20%s,\x20%s',_0x342503,_0x3ebde3);_0x4b734e(_0x3ebde3);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 24f1b4c..c8a4cf6 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 _0x4c83=['./team.events','save','remove','update','emit','removeListener','register','team:'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4c83,0xb8));var _0x34c8=function(_0x246d2b,_0x2d124f){_0x246d2b=_0x246d2b-0x0;var _0x59e2db=_0x4c83[_0x246d2b];return _0x59e2db;};'use strict';var TeamEvents=require(_0x34c8('0x0'));var events=[_0x34c8('0x1'),_0x34c8('0x2'),_0x34c8('0x3')];function createListener(_0x10f17e,_0x108a8d){return function(_0x3bd0e3){_0x108a8d[_0x34c8('0x4')](_0x10f17e,_0x3bd0e3);};}function removeListener(_0x3c88c7,_0x46342a){return function(){TeamEvents[_0x34c8('0x5')](_0x3c88c7,_0x46342a);};}exports[_0x34c8('0x6')]=function(_0x2db3c6){for(var _0x24532c=0x0,_0x5dfb91=events['length'];_0x24532c<_0x5dfb91;_0x24532c++){var _0x561121=events[_0x24532c];var _0x52c1ee=createListener(_0x34c8('0x7')+_0x561121,_0x2db3c6);TeamEvents['on'](_0x561121,_0x52c1ee);}}; \ No newline at end of file +var _0x69c6=['save','remove','update','emit','register','length','team:'];(function(_0x420918,_0x3eebe4){var _0x500dc4=function(_0x388d24){while(--_0x388d24){_0x420918['push'](_0x420918['shift']());}};_0x500dc4(++_0x3eebe4);}(_0x69c6,0x13b));var _0x669c=function(_0x349d51,_0x514406){_0x349d51=_0x349d51-0x0;var _0x5ab01a=_0x69c6[_0x349d51];return _0x5ab01a;};'use strict';var TeamEvents=require('./team.events');var events=[_0x669c('0x0'),_0x669c('0x1'),_0x669c('0x2')];function createListener(_0x209e81,_0x1339af){return function(_0x18d595){_0x1339af[_0x669c('0x3')](_0x209e81,_0x18d595);};}function removeListener(_0x520dfa,_0x38c6ea){return function(){TeamEvents['removeListener'](_0x520dfa,_0x38c6ea);};}exports[_0x669c('0x4')]=function(_0x1e598d){for(var _0x554fde=0x0,_0x551c52=events[_0x669c('0x5')];_0x554fde<_0x551c52;_0x554fde++){var _0x2b7456=events[_0x554fde];var _0x39a546=createListener(_0x669c('0x6')+_0x2b7456,_0x1e598d);TeamEvents['on'](_0x2b7456,_0x39a546);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 2c82193..ab93309 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 _0x091b=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','exports','util','path'];(function(_0x113876,_0x2d243d){var _0x3da554=function(_0x4df645){while(--_0x4df645){_0x113876['push'](_0x113876['shift']());}};_0x3da554(++_0x2d243d);}(_0x091b,0xb2));var _0xb091=function(_0x4e7b8b,_0x1a84db){_0x4e7b8b=_0x4e7b8b-0x0;var _0x40141e=_0x091b[_0x4e7b8b];return _0x40141e;};'use strict';var multer=require('multer');var util=require(_0xb091('0x0'));var path=require(_0xb091('0x1'));var timeout=require('connect-timeout');var express=require(_0xb091('0x2'));var router=express['Router']();var auth=require(_0xb091('0x3'));var interaction=require(_0xb091('0x4'));var config=require(_0xb091('0x5'));var controller=require(_0xb091('0x6'));router['get']('/',auth[_0xb091('0x7')](),controller[_0xb091('0x8')]);router[_0xb091('0x9')](_0xb091('0xa'),auth[_0xb091('0x7')](),controller[_0xb091('0xb')]);router[_0xb091('0xc')]('/',auth['isAuthenticated'](),controller[_0xb091('0xd')]);router[_0xb091('0xe')]('/:id',auth[_0xb091('0x7')](),controller[_0xb091('0xf')]);router[_0xb091('0x10')](_0xb091('0xa'),auth[_0xb091('0x7')](),controller['destroy']);module[_0xb091('0x11')]=router; \ No newline at end of file +var _0x070e=['destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','show','post','isAuthenticated','create','put','/:id','update','delete'];(function(_0x11cc54,_0x1b3e76){var _0x2b04c0=function(_0x400e76){while(--_0x400e76){_0x11cc54['push'](_0x11cc54['shift']());}};_0x2b04c0(++_0x1b3e76);}(_0x070e,0xc0));var _0xe070=function(_0x522dbf,_0x37abca){_0x522dbf=_0x522dbf-0x0;var _0x5d80d3=_0x070e[_0x522dbf];return _0x5d80d3;};'use strict';var multer=require(_0xe070('0x0'));var util=require('util');var path=require(_0xe070('0x1'));var timeout=require(_0xe070('0x2'));var express=require(_0xe070('0x3'));var router=express['Router']();var auth=require(_0xe070('0x4'));var interaction=require(_0xe070('0x5'));var config=require(_0xe070('0x6'));var controller=require('./template.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe070('0x7')]);router[_0xe070('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xe070('0x9')]);router[_0xe070('0xa')]('/',auth[_0xe070('0xb')](),controller[_0xe070('0xc')]);router[_0xe070('0xd')](_0xe070('0xe'),auth[_0xe070('0xb')](),controller[_0xe070('0xf')]);router[_0xe070('0x10')](_0xe070('0xe'),auth[_0xe070('0xb')](),controller[_0xe070('0x11')]);module[_0xe070('0x12')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 60aca62..0e48fab 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 _0x2c5c=['STRING','exports'];(function(_0x808033,_0x4e7c76){var _0x38f77e=function(_0x78e4d5){while(--_0x78e4d5){_0x808033['push'](_0x808033['shift']());}};_0x38f77e(++_0x4e7c76);}(_0x2c5c,0x159));var _0xc2c5=function(_0x15bd45,_0x49f738){_0x15bd45=_0x15bd45-0x0;var _0x3a9660=_0x2c5c[_0x15bd45];return _0x3a9660;};'use strict';var Sequelize=require('sequelize');module[_0xc2c5('0x0')]={'name':{'type':Sequelize[_0xc2c5('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x4223=['STRING','TEXT','sequelize','exports'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x4223,0xf2));var _0x3422=function(_0xc3cda2,_0x427c98){_0xc3cda2=_0xc3cda2-0x0;var _0x1649ca=_0x4223[_0xc3cda2];return _0x1649ca;};'use strict';var Sequelize=require(_0x3422('0x0'));module[_0x3422('0x1')]={'name':{'type':Sequelize[_0x3422('0x2')]},'description':{'type':Sequelize[_0x3422('0x2')]},'html':{'type':Sequelize[_0x3422('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 4af652c..e27c276 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 _0x1fb2=['query','intersection','model','attributes','fields','hasOwnProperty','order','sort','filters','filter','where','merge','type','key','VIRTUAL','includeAll','include','Template','rows','catch','show','params','rawAttributes','keys','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','json','apply','reject','save','then','get','Templates','UserProfileResource','destroy','end','name','index'];(function(_0x209da3,_0x23f962){var _0x15f3eb=function(_0x2614c4){while(--_0x2614c4){_0x209da3['push'](_0x209da3['shift']());}};_0x15f3eb(++_0x23f962);}(_0x1fb2,0x18f));var _0x21fb=function(_0x2fc35c,_0x402fab){_0x2fc35c=_0x2fc35c-0x0;var _0x1ba7ab=_0x1fb2[_0x2fc35c];return _0x1ba7ab;};'use strict';var pdf=require(_0x21fb('0x0'));var emlformat=require(_0x21fb('0x1'));var rimraf=require(_0x21fb('0x2'));var zipdir=require(_0x21fb('0x3'));var jsonpatch=require(_0x21fb('0x4'));var rp=require('request-promise');var moment=require(_0x21fb('0x5'));var BPromise=require(_0x21fb('0x6'));var Mustache=require('mustache');var util=require(_0x21fb('0x7'));var path=require(_0x21fb('0x8'));var sox=require(_0x21fb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x21fb('0xa'));var squel=require(_0x21fb('0xb'));var crypto=require('crypto');var jsforce=require(_0x21fb('0xc'));var deskjs=require(_0x21fb('0xd'));var toCsv=require(_0x21fb('0xe'));var querystring=require(_0x21fb('0xf'));var Papa=require('papaparse');var Redis=require(_0x21fb('0x10'));var authService=require(_0x21fb('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x21fb('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x21fb('0x13'));var db=require(_0x21fb('0x14'))['db'];function respondWithStatusCode(_0x43b5c9,_0x26d819){_0x26d819=_0x26d819||0xcc;return function(_0x4b0267){if(_0x4b0267){return _0x43b5c9[_0x21fb('0x15')](_0x26d819);}return _0x43b5c9[_0x21fb('0x16')](_0x26d819)['end']();};}function respondWithResult(_0x4b3a10,_0x41cc9a){_0x41cc9a=_0x41cc9a||0xc8;return function(_0x3376a6){if(_0x3376a6){return _0x4b3a10[_0x21fb('0x16')](_0x41cc9a)['json'](_0x3376a6);}};}function respondWithFilteredResult(_0x43d010,_0x133456){return function(_0x3b0df7){if(_0x3b0df7){var _0x23016c=_0x3b0df7[_0x21fb('0x17')],_0x58109a=_0x133456[_0x21fb('0x18')],_0x216b7d=_0x133456[_0x21fb('0x18')]+_0x133456[_0x21fb('0x19')],_0x1ff64e;if(_0x216b7d>=_0x23016c){_0x216b7d=_0x23016c;_0x1ff64e=0xc8;}else{_0x1ff64e=0xce;}_0x43d010['status'](_0x1ff64e);return _0x43d010[_0x21fb('0x1a')]('Content-Range',_0x58109a+'-'+_0x216b7d+'/'+_0x23016c)[_0x21fb('0x1b')](_0x3b0df7);}return null;};}function patchUpdates(_0x84e66b){return function(_0x5e4f70){try{jsonpatch[_0x21fb('0x1c')](_0x5e4f70,_0x84e66b,!![]);}catch(_0x34cd53){return BPromise[_0x21fb('0x1d')](_0x34cd53);}return _0x5e4f70[_0x21fb('0x1e')]();};}function saveUpdates(_0x59453b,_0xf6fdf9){return function(_0x221e25){if(_0x221e25){return _0x221e25['update'](_0x59453b)[_0x21fb('0x1f')](function(_0x445de0){return _0x445de0;});}return null;};}function removeEntity(_0x100cf2,_0x3a7ab1){return function(_0x36d893){if(_0x36d893){return _0x36d893['destroy']()[_0x21fb('0x1f')](function(){var _0xb8b74c=_0x36d893[_0x21fb('0x20')]({'plain':!![]});var _0x456496=_0x21fb('0x21');return db[_0x21fb('0x22')][_0x21fb('0x23')]({'where':{'type':_0x456496,'resourceId':_0xb8b74c['id']}})[_0x21fb('0x1f')](function(){return _0x36d893;});})['then'](function(){_0x100cf2[_0x21fb('0x16')](0xcc)[_0x21fb('0x24')]();});}};}function handleEntityNotFound(_0x1b1608,_0xc71b15){return function(_0x563d50){if(!_0x563d50){_0x1b1608[_0x21fb('0x15')](0x194);}return _0x563d50;};}function handleError(_0x5b49c3,_0x3f9e1f){_0x3f9e1f=_0x3f9e1f||0x1f4;return function(_0x53f8a6){logger['error'](_0x53f8a6['stack']);if(_0x53f8a6[_0x21fb('0x25')]){delete _0x53f8a6['name'];}_0x5b49c3[_0x21fb('0x16')](_0x3f9e1f)['send'](_0x53f8a6);};}exports[_0x21fb('0x26')]=function(_0x277522,_0x3c9a8c){var _0x5be631={},_0xbf4b7a={},_0x2cbec3={'count':0x0,'rows':[]};var _0x24cf51=db['Template']['rawAttributes'];_0xbf4b7a['model']=_['keys'](_0x24cf51);_0xbf4b7a[_0x21fb('0x27')]=_['keys'](_0x277522[_0x21fb('0x27')]);_0xbf4b7a['filters']=_[_0x21fb('0x28')](_0xbf4b7a[_0x21fb('0x29')],_0xbf4b7a[_0x21fb('0x27')]);_0x5be631[_0x21fb('0x2a')]=_[_0x21fb('0x28')](_0xbf4b7a[_0x21fb('0x29')],qs[_0x21fb('0x2b')](_0x277522['query'][_0x21fb('0x2b')]));_0x5be631['attributes']=_0x5be631[_0x21fb('0x2a')]['length']?_0x5be631[_0x21fb('0x2a')]:_0xbf4b7a[_0x21fb('0x29')];if(!_0x277522[_0x21fb('0x27')][_0x21fb('0x2c')]('nolimit')){_0x5be631[_0x21fb('0x19')]=qs[_0x21fb('0x19')](_0x277522[_0x21fb('0x27')][_0x21fb('0x19')]);_0x5be631[_0x21fb('0x18')]=qs[_0x21fb('0x18')](_0x277522[_0x21fb('0x27')][_0x21fb('0x18')]);}_0x5be631[_0x21fb('0x2d')]=qs[_0x21fb('0x2e')](_0x277522[_0x21fb('0x27')][_0x21fb('0x2e')]);_0x5be631['where']=qs[_0x21fb('0x2f')](_['pick'](_0x277522[_0x21fb('0x27')],_0xbf4b7a[_0x21fb('0x2f')]));if(_0x277522[_0x21fb('0x27')][_0x21fb('0x30')]){_0x5be631[_0x21fb('0x31')]=_[_0x21fb('0x32')](_0x5be631[_0x21fb('0x31')],{'$or':_['map'](_0x24cf51,function(_0xdf98f6){if(_0xdf98f6[_0x21fb('0x33')][_0x21fb('0x34')]!==_0x21fb('0x35')){var _0x374b12={};_0x374b12[_0xdf98f6['field']]={'$like':'%'+_0x277522['query'][_0x21fb('0x30')]+'%'};return _0x374b12;}})});}_0x5be631=_[_0x21fb('0x32')]({},_0x5be631,_0x277522['options']);var _0x21bf11={'where':_0x5be631[_0x21fb('0x31')]};return db['Template'][_0x21fb('0x17')](_0x21bf11)[_0x21fb('0x1f')](function(_0x200766){_0x2cbec3[_0x21fb('0x17')]=_0x200766;if(_0x277522[_0x21fb('0x27')][_0x21fb('0x36')]){_0x5be631[_0x21fb('0x37')]=[{'all':!![]}];}return db[_0x21fb('0x38')]['findAll'](_0x5be631);})['then'](function(_0x3f42e6){_0x2cbec3[_0x21fb('0x39')]=_0x3f42e6;return _0x2cbec3;})['then'](respondWithFilteredResult(_0x3c9a8c,_0x5be631))[_0x21fb('0x3a')](handleError(_0x3c9a8c,null));};exports[_0x21fb('0x3b')]=function(_0x350c51,_0x2595ae){var _0xbec947={'raw':!![],'where':{'id':_0x350c51[_0x21fb('0x3c')]['id']}},_0x271516={};_0x271516['model']=_['keys'](db[_0x21fb('0x38')][_0x21fb('0x3d')]);_0x271516[_0x21fb('0x27')]=_[_0x21fb('0x3e')](_0x350c51['query']);_0x271516['filters']=_['intersection'](_0x271516[_0x21fb('0x29')],_0x271516[_0x21fb('0x27')]);_0xbec947['attributes']=_[_0x21fb('0x28')](_0x271516[_0x21fb('0x29')],qs[_0x21fb('0x2b')](_0x350c51[_0x21fb('0x27')][_0x21fb('0x2b')]));_0xbec947[_0x21fb('0x2a')]=_0xbec947[_0x21fb('0x2a')][_0x21fb('0x3f')]?_0xbec947['attributes']:_0x271516[_0x21fb('0x29')];if(_0x350c51[_0x21fb('0x27')]['includeAll']){_0xbec947[_0x21fb('0x37')]=[{'all':!![]}];}_0xbec947=_[_0x21fb('0x32')]({},_0xbec947,_0x350c51[_0x21fb('0x40')]);return db[_0x21fb('0x38')][_0x21fb('0x41')](_0xbec947)[_0x21fb('0x1f')](handleEntityNotFound(_0x2595ae,null))['then'](respondWithResult(_0x2595ae,null))['catch'](handleError(_0x2595ae,null));};exports[_0x21fb('0x42')]=function(_0x459218,_0xd98d00){return db['Template']['create'](_0x459218[_0x21fb('0x43')],{})['then'](function(_0x5409ec){var _0x20d069=_0x459218[_0x21fb('0x44')][_0x21fb('0x20')]({'plain':!![]});if(!_0x20d069)throw new Error(_0x21fb('0x45'));if(_0x20d069['role']===_0x21fb('0x44')){var _0x582804=_0x5409ec[_0x21fb('0x20')]({'plain':!![]});var _0x586e87=_0x21fb('0x21');return db[_0x21fb('0x46')]['find']({'where':{'name':_0x586e87,'userProfileId':_0x20d069['userProfileId']},'raw':!![]})[_0x21fb('0x1f')](function(_0x26c3d6){if(_0x26c3d6&&_0x26c3d6['autoAssociation']===0x0){return db[_0x21fb('0x22')][_0x21fb('0x42')]({'name':_0x582804[_0x21fb('0x25')],'resourceId':_0x582804['id'],'type':_0x26c3d6[_0x21fb('0x25')],'sectionId':_0x26c3d6['id']},{})[_0x21fb('0x1f')](function(){return _0x5409ec;});}else{return _0x5409ec;}})[_0x21fb('0x3a')](function(_0x25d6c4){logger['error'](_0x21fb('0x47'),_0x25d6c4);throw _0x25d6c4;});}return _0x5409ec;})[_0x21fb('0x1f')](respondWithResult(_0xd98d00,0xc9))[_0x21fb('0x3a')](handleError(_0xd98d00,null));};exports[_0x21fb('0x48')]=function(_0x57765b,_0x3b0e2c){if(_0x57765b[_0x21fb('0x43')]['id']){delete _0x57765b[_0x21fb('0x43')]['id'];}return db[_0x21fb('0x38')][_0x21fb('0x41')]({'where':{'id':_0x57765b['params']['id']}})[_0x21fb('0x1f')](handleEntityNotFound(_0x3b0e2c,null))[_0x21fb('0x1f')](saveUpdates(_0x57765b[_0x21fb('0x43')],null))[_0x21fb('0x1f')](respondWithResult(_0x3b0e2c,null))['catch'](handleError(_0x3b0e2c,null));};exports[_0x21fb('0x23')]=function(_0x229c76,_0x1a5053){return db[_0x21fb('0x38')]['find']({'where':{'id':_0x229c76[_0x21fb('0x3c')]['id']}})[_0x21fb('0x1f')](handleEntityNotFound(_0x1a5053,null))['then'](removeEntity(_0x1a5053,null))[_0x21fb('0x3a')](handleError(_0x1a5053,null));}; \ No newline at end of file +var _0xcae6=['show','params','include','create','body','user','get','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','Templates','UserProfileResource','destroy','error','stack','name','send','index','Template','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','findAll','rows','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcae6,0x1ae));var _0x6cae=function(_0x367336,_0x18c229){_0x367336=_0x367336-0x0;var _0x3423a7=_0xcae6[_0x367336];return _0x3423a7;};'use strict';var pdf=require(_0x6cae('0x0'));var emlformat=require(_0x6cae('0x1'));var rimraf=require(_0x6cae('0x2'));var zipdir=require(_0x6cae('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6cae('0x4'));var moment=require(_0x6cae('0x5'));var BPromise=require(_0x6cae('0x6'));var Mustache=require('mustache');var util=require(_0x6cae('0x7'));var path=require(_0x6cae('0x8'));var sox=require(_0x6cae('0x9'));var csv=require(_0x6cae('0xa'));var ejs=require(_0x6cae('0xb'));var fs=require('fs');var _=require(_0x6cae('0xc'));var squel=require('squel');var crypto=require(_0x6cae('0xd'));var jsforce=require(_0x6cae('0xe'));var deskjs=require(_0x6cae('0xf'));var toCsv=require(_0x6cae('0xa'));var querystring=require(_0x6cae('0x10'));var Papa=require(_0x6cae('0x11'));var Redis=require(_0x6cae('0x12'));var authService=require(_0x6cae('0x13'));var qs=require(_0x6cae('0x14'));var hardwareService=require(_0x6cae('0x15'));var logger=require(_0x6cae('0x16'))(_0x6cae('0x17'));var utils=require('../../config/utils');var config=require(_0x6cae('0x18'));var db=require(_0x6cae('0x19'))['db'];function respondWithStatusCode(_0x1c8b8f,_0x34b814){_0x34b814=_0x34b814||0xcc;return function(_0x22ace9){if(_0x22ace9){return _0x1c8b8f[_0x6cae('0x1a')](_0x34b814);}return _0x1c8b8f[_0x6cae('0x1b')](_0x34b814)[_0x6cae('0x1c')]();};}function respondWithResult(_0x1b0454,_0x403d65){_0x403d65=_0x403d65||0xc8;return function(_0xe2da53){if(_0xe2da53){return _0x1b0454[_0x6cae('0x1b')](_0x403d65)[_0x6cae('0x1d')](_0xe2da53);}};}function respondWithFilteredResult(_0x48e474,_0x52a861){return function(_0x4eba2c){if(_0x4eba2c){var _0x5656d6=_0x4eba2c[_0x6cae('0x1e')],_0x2c3587=_0x52a861['offset'],_0x46dcd6=_0x52a861[_0x6cae('0x1f')]+_0x52a861[_0x6cae('0x20')],_0x461af2;if(_0x46dcd6>=_0x5656d6){_0x46dcd6=_0x5656d6;_0x461af2=0xc8;}else{_0x461af2=0xce;}_0x48e474['status'](_0x461af2);return _0x48e474[_0x6cae('0x21')](_0x6cae('0x22'),_0x2c3587+'-'+_0x46dcd6+'/'+_0x5656d6)[_0x6cae('0x1d')](_0x4eba2c);}return null;};}function patchUpdates(_0x1faca1){return function(_0x7bdc12){try{jsonpatch[_0x6cae('0x23')](_0x7bdc12,_0x1faca1,!![]);}catch(_0x1acb3b){return BPromise[_0x6cae('0x24')](_0x1acb3b);}return _0x7bdc12['save']();};}function saveUpdates(_0x13d8ce,_0x29a49a){return function(_0x2a33cb){if(_0x2a33cb){return _0x2a33cb[_0x6cae('0x25')](_0x13d8ce)[_0x6cae('0x26')](function(_0x297241){return _0x297241;});}return null;};}function removeEntity(_0x16d420,_0x545c1d){return function(_0xb13967){if(_0xb13967){return _0xb13967['destroy']()[_0x6cae('0x26')](function(){var _0x249b98=_0xb13967['get']({'plain':!![]});var _0x12ad3a=_0x6cae('0x27');return db[_0x6cae('0x28')][_0x6cae('0x29')]({'where':{'type':_0x12ad3a,'resourceId':_0x249b98['id']}})[_0x6cae('0x26')](function(){return _0xb13967;});})[_0x6cae('0x26')](function(){_0x16d420[_0x6cae('0x1b')](0xcc)[_0x6cae('0x1c')]();});}};}function handleEntityNotFound(_0x55f644,_0x599060){return function(_0x11e178){if(!_0x11e178){_0x55f644['sendStatus'](0x194);}return _0x11e178;};}function handleError(_0x15fb5b,_0x5094db){_0x5094db=_0x5094db||0x1f4;return function(_0xa0ffb4){logger[_0x6cae('0x2a')](_0xa0ffb4[_0x6cae('0x2b')]);if(_0xa0ffb4[_0x6cae('0x2c')]){delete _0xa0ffb4[_0x6cae('0x2c')];}_0x15fb5b[_0x6cae('0x1b')](_0x5094db)[_0x6cae('0x2d')](_0xa0ffb4);};}exports[_0x6cae('0x2e')]=function(_0x2fe3fc,_0x513543){var _0x3a466c={},_0x4dc3cb={},_0x550224={'count':0x0,'rows':[]};var _0x13e379=db[_0x6cae('0x2f')][_0x6cae('0x30')];_0x4dc3cb[_0x6cae('0x31')]=_['keys'](_0x13e379);_0x4dc3cb['query']=_[_0x6cae('0x32')](_0x2fe3fc[_0x6cae('0x33')]);_0x4dc3cb[_0x6cae('0x34')]=_[_0x6cae('0x35')](_0x4dc3cb[_0x6cae('0x31')],_0x4dc3cb[_0x6cae('0x33')]);_0x3a466c[_0x6cae('0x36')]=_[_0x6cae('0x35')](_0x4dc3cb['model'],qs['fields'](_0x2fe3fc[_0x6cae('0x33')][_0x6cae('0x37')]));_0x3a466c[_0x6cae('0x36')]=_0x3a466c[_0x6cae('0x36')][_0x6cae('0x38')]?_0x3a466c[_0x6cae('0x36')]:_0x4dc3cb['model'];if(!_0x2fe3fc[_0x6cae('0x33')][_0x6cae('0x39')](_0x6cae('0x3a'))){_0x3a466c[_0x6cae('0x20')]=qs[_0x6cae('0x20')](_0x2fe3fc[_0x6cae('0x33')][_0x6cae('0x20')]);_0x3a466c[_0x6cae('0x1f')]=qs['offset'](_0x2fe3fc[_0x6cae('0x33')][_0x6cae('0x1f')]);}_0x3a466c[_0x6cae('0x3b')]=qs[_0x6cae('0x3c')](_0x2fe3fc[_0x6cae('0x33')]['sort']);_0x3a466c[_0x6cae('0x3d')]=qs[_0x6cae('0x34')](_[_0x6cae('0x3e')](_0x2fe3fc[_0x6cae('0x33')],_0x4dc3cb[_0x6cae('0x34')]));if(_0x2fe3fc[_0x6cae('0x33')][_0x6cae('0x3f')]){_0x3a466c[_0x6cae('0x3d')]=_[_0x6cae('0x40')](_0x3a466c[_0x6cae('0x3d')],{'$or':_[_0x6cae('0x41')](_0x13e379,function(_0x47cf89){if(_0x47cf89[_0x6cae('0x42')]['key']!==_0x6cae('0x43')){var _0x545337={};_0x545337[_0x47cf89[_0x6cae('0x44')]]={'$like':'%'+_0x2fe3fc['query'][_0x6cae('0x3f')]+'%'};return _0x545337;}})});}_0x3a466c=_['merge']({},_0x3a466c,_0x2fe3fc[_0x6cae('0x45')]);var _0x142d46={'where':_0x3a466c[_0x6cae('0x3d')]};return db['Template']['count'](_0x142d46)[_0x6cae('0x26')](function(_0x5de3fa){_0x550224[_0x6cae('0x1e')]=_0x5de3fa;if(_0x2fe3fc[_0x6cae('0x33')][_0x6cae('0x46')]){_0x3a466c['include']=[{'all':!![]}];}return db[_0x6cae('0x2f')][_0x6cae('0x47')](_0x3a466c);})[_0x6cae('0x26')](function(_0x6b92dc){_0x550224[_0x6cae('0x48')]=_0x6b92dc;return _0x550224;})[_0x6cae('0x26')](respondWithFilteredResult(_0x513543,_0x3a466c))[_0x6cae('0x49')](handleError(_0x513543,null));};exports[_0x6cae('0x4a')]=function(_0x3c2d2a,_0x97ead8){var _0x23ddcb={'raw':!![],'where':{'id':_0x3c2d2a[_0x6cae('0x4b')]['id']}},_0x2c1519={};_0x2c1519[_0x6cae('0x31')]=_[_0x6cae('0x32')](db['Template'][_0x6cae('0x30')]);_0x2c1519[_0x6cae('0x33')]=_[_0x6cae('0x32')](_0x3c2d2a[_0x6cae('0x33')]);_0x2c1519[_0x6cae('0x34')]=_[_0x6cae('0x35')](_0x2c1519[_0x6cae('0x31')],_0x2c1519['query']);_0x23ddcb[_0x6cae('0x36')]=_[_0x6cae('0x35')](_0x2c1519['model'],qs['fields'](_0x3c2d2a[_0x6cae('0x33')][_0x6cae('0x37')]));_0x23ddcb[_0x6cae('0x36')]=_0x23ddcb['attributes']['length']?_0x23ddcb[_0x6cae('0x36')]:_0x2c1519[_0x6cae('0x31')];if(_0x3c2d2a[_0x6cae('0x33')]['includeAll']){_0x23ddcb[_0x6cae('0x4c')]=[{'all':!![]}];}_0x23ddcb=_[_0x6cae('0x40')]({},_0x23ddcb,_0x3c2d2a[_0x6cae('0x45')]);return db[_0x6cae('0x2f')]['find'](_0x23ddcb)[_0x6cae('0x26')](handleEntityNotFound(_0x97ead8,null))['then'](respondWithResult(_0x97ead8,null))[_0x6cae('0x49')](handleError(_0x97ead8,null));};exports[_0x6cae('0x4d')]=function(_0x366b63,_0x468030){return db[_0x6cae('0x2f')][_0x6cae('0x4d')](_0x366b63[_0x6cae('0x4e')],{})[_0x6cae('0x26')](function(_0x392b72){var _0x4c7abf=_0x366b63[_0x6cae('0x4f')][_0x6cae('0x50')]({'plain':!![]});if(!_0x4c7abf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c7abf['role']===_0x6cae('0x4f')){var _0x4fdf4d=_0x392b72['get']({'plain':!![]});var _0x1a9b14=_0x6cae('0x27');return db['UserProfileSection'][_0x6cae('0x51')]({'where':{'name':_0x1a9b14,'userProfileId':_0x4c7abf['userProfileId']},'raw':!![]})[_0x6cae('0x26')](function(_0x3ed14d){if(_0x3ed14d&&_0x3ed14d[_0x6cae('0x52')]===0x0){return db[_0x6cae('0x28')][_0x6cae('0x4d')]({'name':_0x4fdf4d[_0x6cae('0x2c')],'resourceId':_0x4fdf4d['id'],'type':_0x3ed14d[_0x6cae('0x2c')],'sectionId':_0x3ed14d['id']},{})[_0x6cae('0x26')](function(){return _0x392b72;});}else{return _0x392b72;}})[_0x6cae('0x49')](function(_0x5c637e){logger[_0x6cae('0x2a')](_0x6cae('0x53'),_0x5c637e);throw _0x5c637e;});}return _0x392b72;})[_0x6cae('0x26')](respondWithResult(_0x468030,0xc9))['catch'](handleError(_0x468030,null));};exports[_0x6cae('0x25')]=function(_0x4c17ac,_0x18a657){if(_0x4c17ac['body']['id']){delete _0x4c17ac[_0x6cae('0x4e')]['id'];}return db[_0x6cae('0x2f')][_0x6cae('0x51')]({'where':{'id':_0x4c17ac[_0x6cae('0x4b')]['id']}})[_0x6cae('0x26')](handleEntityNotFound(_0x18a657,null))['then'](saveUpdates(_0x4c17ac[_0x6cae('0x4e')],null))[_0x6cae('0x26')](respondWithResult(_0x18a657,null))[_0x6cae('0x49')](handleError(_0x18a657,null));};exports[_0x6cae('0x29')]=function(_0x24a78b,_0x3502ce){return db['Template']['find']({'where':{'id':_0x24a78b[_0x6cae('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3502ce,null))[_0x6cae('0x26')](removeEntity(_0x3502ce,null))[_0x6cae('0x49')](handleError(_0x3502ce,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index e4608ad..e9d065a 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 _0x9ffd=['Template','tools_templates','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./template.attributes','define'];(function(_0x42fbdd,_0xbb21a3){var _0x525b95=function(_0x330481){while(--_0x330481){_0x42fbdd['push'](_0x42fbdd['shift']());}};_0x525b95(++_0xbb21a3);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x2cf580,_0x306bcf){_0x2cf580=_0x2cf580-0x0;var _0x377678=_0x9ffd[_0x2cf580];return _0x377678;};'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 +var _0x9354=['../../config/environment','./template.attributes','exports','define','Template','tools_templates','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x4ea955,_0x1eda76){var _0x558561=function(_0x5b20f4){while(--_0x5b20f4){_0x4ea955['push'](_0x4ea955['shift']());}};_0x558561(++_0x1eda76);}(_0x9354,0x96));var _0x4935=function(_0x3071ab,_0x574a59){_0x3071ab=_0x3071ab-0x0;var _0x2f458c=_0x9354[_0x3071ab];return _0x2f458c;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var logger=require(_0x4935('0x1'))('api');var moment=require(_0x4935('0x2'));var BPromise=require(_0x4935('0x3'));var rp=require(_0x4935('0x4'));var fs=require('fs');var path=require(_0x4935('0x5'));var rimraf=require('rimraf');var config=require(_0x4935('0x6'));var attributes=require(_0x4935('0x7'));module[_0x4935('0x8')]=function(_0x2d518a,_0x263864){return _0x2d518a[_0x4935('0x9')](_0x4935('0xa'),attributes,{'tableName':_0x4935('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 6b2e56b..aa3a402 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 _0xbdbe=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Template','findAll','options','raw','attributes','limit','include','map','model','GetTemplate','lodash'];(function(_0x12a2a6,_0x374ff1){var _0x1754ae=function(_0x49d787){while(--_0x49d787){_0x12a2a6['push'](_0x12a2a6['shift']());}};_0x1754ae(++_0x374ff1);}(_0xbdbe,0x153));var _0xebdb=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xbdbe[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xebdb('0x0'));var util=require(_0xebdb('0x1'));var moment=require(_0xebdb('0x2'));var BPromise=require(_0xebdb('0x3'));var rs=require(_0xebdb('0x4'));var fs=require('fs');var Redis=require(_0xebdb('0x5'));var db=require(_0xebdb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xebdb('0x7'))(_0xebdb('0x8'));var config=require('../../config/environment');var jayson=require(_0xebdb('0x9'));var client=jayson['client'][_0xebdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16404c,_0x193e88,_0x1cb876){return new BPromise(function(_0x1afe4c,_0x5cadc8){return client[_0xebdb('0xb')](_0x16404c,_0x1cb876)[_0xebdb('0xc')](function(_0x21ffab){logger[_0xebdb('0xd')](_0xebdb('0xe'),_0x193e88,_0xebdb('0xf'));logger[_0xebdb('0x10')](_0xebdb('0x11'),_0x193e88,_0xebdb('0xf'),JSON[_0xebdb('0x12')](_0x21ffab));if(_0x21ffab['error']){if(_0x21ffab[_0xebdb('0x13')][_0xebdb('0x14')]===0x1f4){logger[_0xebdb('0x13')](_0xebdb('0xe'),_0x193e88,_0x21ffab[_0xebdb('0x13')][_0xebdb('0x15')]);return _0x5cadc8(_0x21ffab[_0xebdb('0x13')][_0xebdb('0x15')]);}logger[_0xebdb('0x13')](_0xebdb('0xe'),_0x193e88,_0x21ffab[_0xebdb('0x13')][_0xebdb('0x15')]);return _0x1afe4c(_0x21ffab[_0xebdb('0x13')]['message']);}else{logger[_0xebdb('0xd')](_0xebdb('0xe'),_0x193e88,_0xebdb('0xf'));_0x1afe4c(_0x21ffab[_0xebdb('0x16')][_0xebdb('0x15')]);}})[_0xebdb('0x17')](function(_0x40eefa){logger['error'](_0xebdb('0xe'),_0x193e88,_0x40eefa);_0x5cadc8(_0x40eefa);});});}exports['GetTemplate']=function(_0x51d670){var _0x2ea004=this;return new Promise(function(_0x363d2e,_0x3926c6){return db[_0xebdb('0x18')][_0xebdb('0x19')]({'raw':_0x51d670['options']?_0x51d670[_0xebdb('0x1a')][_0xebdb('0x1b')]===undefined?!![]:![]:!![],'where':_0x51d670[_0xebdb('0x1a')]?_0x51d670[_0xebdb('0x1a')]['where']||null:null,'attributes':_0x51d670[_0xebdb('0x1a')]?_0x51d670[_0xebdb('0x1a')][_0xebdb('0x1c')]||null:null,'limit':_0x51d670[_0xebdb('0x1a')]?_0x51d670['options'][_0xebdb('0x1d')]||null:null,'include':_0x51d670['options']?_0x51d670[_0xebdb('0x1a')][_0xebdb('0x1e')]?_[_0xebdb('0x1f')](_0x51d670[_0xebdb('0x1a')][_0xebdb('0x1e')],function(_0x2887ac){return{'model':db[_0x2887ac[_0xebdb('0x20')]],'as':_0x2887ac['as'],'attributes':_0x2887ac['attributes'],'include':_0x2887ac['include']?_[_0xebdb('0x1f')](_0x2887ac['include'],function(_0x1a99ac){return{'model':db[_0x1a99ac[_0xebdb('0x20')]],'as':_0x1a99ac['as'],'attributes':_0x1a99ac[_0xebdb('0x1c')],'include':_0x1a99ac[_0xebdb('0x1e')]?_[_0xebdb('0x1f')](_0x1a99ac[_0xebdb('0x1e')],function(_0xeb4356){return{'model':db[_0xeb4356[_0xebdb('0x20')]],'as':_0xeb4356['as'],'attributes':_0xeb4356[_0xebdb('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59a4b2){logger['info'](_0xebdb('0x21'),_0x51d670);logger[_0xebdb('0x10')](_0xebdb('0x21'),_0x51d670,JSON[_0xebdb('0x12')](_0x59a4b2));_0x363d2e(_0x59a4b2);})[_0xebdb('0x17')](function(_0x50074b){logger[_0xebdb('0x13')](_0xebdb('0x21'),_0x50074b[_0xebdb('0x15')],_0x51d670);_0x3926c6(_0x2ea004[_0xebdb('0x13')](0x1f4,_0x50074b[_0xebdb('0x15')]));});});}; \ No newline at end of file +var _0xe9d0=['request','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTemplate','findAll','options','raw','attributes','limit','include','map','model','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x544072,_0xc41ee1){var _0x590bf6=function(_0x41107f){while(--_0x41107f){_0x544072['push'](_0x544072['shift']());}};_0x590bf6(++_0xc41ee1);}(_0xe9d0,0x6b));var _0x0e9d=function(_0x14f9b9,_0x102f56){_0x14f9b9=_0x14f9b9-0x0;var _0xab268f=_0xe9d0[_0x14f9b9];return _0xab268f;};'use strict';var _=require('lodash');var util=require(_0x0e9d('0x0'));var moment=require('moment');var BPromise=require(_0x0e9d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e9d('0x2'));var db=require(_0x0e9d('0x3'))['db'];var utils=require(_0x0e9d('0x4'));var logger=require(_0x0e9d('0x5'))('rpc');var config=require(_0x0e9d('0x6'));var jayson=require(_0x0e9d('0x7'));var client=jayson['client'][_0x0e9d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ba7cc,_0x1ba306,_0x4958b4){return new BPromise(function(_0x32ee78,_0xf4af1d){return client[_0x0e9d('0x9')](_0x3ba7cc,_0x4958b4)[_0x0e9d('0xa')](function(_0xa25b9b){logger[_0x0e9d('0xb')](_0x0e9d('0xc'),_0x1ba306,'request\x20sent');logger[_0x0e9d('0xd')](_0x0e9d('0xe'),_0x1ba306,'request\x20sent',JSON[_0x0e9d('0xf')](_0xa25b9b));if(_0xa25b9b[_0x0e9d('0x10')]){if(_0xa25b9b['error'][_0x0e9d('0x11')]===0x1f4){logger[_0x0e9d('0x10')](_0x0e9d('0xc'),_0x1ba306,_0xa25b9b[_0x0e9d('0x10')][_0x0e9d('0x12')]);return _0xf4af1d(_0xa25b9b[_0x0e9d('0x10')][_0x0e9d('0x12')]);}logger['error'](_0x0e9d('0xc'),_0x1ba306,_0xa25b9b[_0x0e9d('0x10')][_0x0e9d('0x12')]);return _0x32ee78(_0xa25b9b[_0x0e9d('0x10')]['message']);}else{logger[_0x0e9d('0xb')](_0x0e9d('0xc'),_0x1ba306,'request\x20sent');_0x32ee78(_0xa25b9b['result'][_0x0e9d('0x12')]);}})[_0x0e9d('0x13')](function(_0x19bb9a){logger[_0x0e9d('0x10')]('Template,\x20%s,\x20%s',_0x1ba306,_0x19bb9a);_0xf4af1d(_0x19bb9a);});});}exports[_0x0e9d('0x14')]=function(_0x2aadd){var _0x19db32=this;return new Promise(function(_0x21abbd,_0x29da01){return db['Template'][_0x0e9d('0x15')]({'raw':_0x2aadd[_0x0e9d('0x16')]?_0x2aadd[_0x0e9d('0x16')][_0x0e9d('0x17')]===undefined?!![]:![]:!![],'where':_0x2aadd['options']?_0x2aadd['options']['where']||null:null,'attributes':_0x2aadd['options']?_0x2aadd[_0x0e9d('0x16')][_0x0e9d('0x18')]||null:null,'limit':_0x2aadd[_0x0e9d('0x16')]?_0x2aadd[_0x0e9d('0x16')][_0x0e9d('0x19')]||null:null,'include':_0x2aadd[_0x0e9d('0x16')]?_0x2aadd['options'][_0x0e9d('0x1a')]?_[_0x0e9d('0x1b')](_0x2aadd['options'][_0x0e9d('0x1a')],function(_0x547d9c){return{'model':db[_0x547d9c[_0x0e9d('0x1c')]],'as':_0x547d9c['as'],'attributes':_0x547d9c['attributes'],'include':_0x547d9c['include']?_[_0x0e9d('0x1b')](_0x547d9c[_0x0e9d('0x1a')],function(_0x1cfdb6){return{'model':db[_0x1cfdb6[_0x0e9d('0x1c')]],'as':_0x1cfdb6['as'],'attributes':_0x1cfdb6[_0x0e9d('0x18')],'include':_0x1cfdb6['include']?_[_0x0e9d('0x1b')](_0x1cfdb6[_0x0e9d('0x1a')],function(_0x5cc1c6){return{'model':db[_0x5cc1c6[_0x0e9d('0x1c')]],'as':_0x5cc1c6['as'],'attributes':_0x5cc1c6[_0x0e9d('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0e9d('0xa')](function(_0xf3ef84){logger[_0x0e9d('0xb')](_0x0e9d('0x14'),_0x2aadd);logger[_0x0e9d('0xd')](_0x0e9d('0x14'),_0x2aadd,JSON[_0x0e9d('0xf')](_0xf3ef84));_0x21abbd(_0xf3ef84);})[_0x0e9d('0x13')](function(_0x53d385){logger['error']('GetTemplate',_0x53d385[_0x0e9d('0x12')],_0x2aadd);_0x29da01(_0x19db32['error'](0x1f4,_0x53d385[_0x0e9d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 3de470f..0789567 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(_0x2b343b,_0x40308a){var _0x22ed77=function(_0x246cbc){while(--_0x246cbc){_0x2b343b['push'](_0x2b343b['shift']());}};_0x22ed77(++_0x40308a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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(_0x40b802,_0x319c3d){var _0x5b8c14=function(_0x1780af){while(--_0x1780af){_0x40b802['push'](_0x40b802['shift']());}};_0x5b8c14(++_0x319c3d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 b2ce501..f38012b 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 _0x43db=['sequelize','exports','STRING'];(function(_0x6d24eb,_0x2d4928){var _0x53346f=function(_0x3a2967){while(--_0x3a2967){_0x6d24eb['push'](_0x6d24eb['shift']());}};_0x53346f(++_0x2d4928);}(_0x43db,0x162));var _0xb43d=function(_0x504f4c,_0x1aedf0){_0x504f4c=_0x504f4c-0x0;var _0x3e7570=_0x43db[_0x504f4c];return _0x3e7570;};'use strict';var Sequelize=require(_0xb43d('0x0'));module[_0xb43d('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb43d('0x2')]},'description':{'type':Sequelize[_0xb43d('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x6ed5=['exports','STRING','BOOLEAN'];(function(_0x42d15d,_0x4ae429){var _0x8dd70b=function(_0x210d0e){while(--_0x210d0e){_0x42d15d['push'](_0x42d15d['shift']());}};_0x8dd70b(++_0x4ae429);}(_0x6ed5,0x1d7));var _0x56ed=function(_0x2c95a9,_0x28230b){_0x2c95a9=_0x2c95a9-0x0;var _0xd6a3a0=_0x6ed5[_0x2c95a9];return _0xd6a3a0;};'use strict';var Sequelize=require('sequelize');module[_0x56ed('0x0')]={'name':{'type':Sequelize[_0x56ed('0x1')]},'channel':{'type':Sequelize[_0x56ed('0x1')]},'description':{'type':Sequelize[_0x56ed('0x1')]},'status':{'type':Sequelize[_0x56ed('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 3f655ae..59001c4 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 _0x0ab1=['options','Trigger','include','findAll','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','addAllCondition','TriggerAllId','addAnyCondition','Condition','findOne','getAllConditions','hasOwnProperty','nolimit','getAnyConditions','TriggerId','Action','getActions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','limit','set','Content-Range','reject','save','then','get','Triggers','UserProfileResource','sendStatus','error','stack','name','send','index','rawAttributes','keys','query','intersection','model','fields','attributes','length','offset','order','sort','filters','pick','filter','where','map','type','VIRTUAL','field','merge'];(function(_0x2b118d,_0x40e9e9){var _0x31d80b=function(_0x2c1071){while(--_0x2c1071){_0x2b118d['push'](_0x2b118d['shift']());}};_0x31d80b(++_0x40e9e9);}(_0x0ab1,0x7c));var _0x10ab=function(_0x4e8aa2,_0x2ecb6e){_0x4e8aa2=_0x4e8aa2-0x0;var _0x373896=_0x0ab1[_0x4e8aa2];return _0x373896;};'use strict';var pdf=require(_0x10ab('0x0'));var emlformat=require(_0x10ab('0x1'));var rimraf=require(_0x10ab('0x2'));var zipdir=require(_0x10ab('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x10ab('0x4'));var moment=require(_0x10ab('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x10ab('0x6'));var path=require(_0x10ab('0x7'));var sox=require(_0x10ab('0x8'));var csv=require('to-csv');var ejs=require(_0x10ab('0x9'));var fs=require('fs');var _=require(_0x10ab('0xa'));var squel=require(_0x10ab('0xb'));var crypto=require(_0x10ab('0xc'));var jsforce=require(_0x10ab('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x10ab('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x10ab('0xf'));var qs=require(_0x10ab('0x10'));var hardwareService=require(_0x10ab('0x11'));var logger=require(_0x10ab('0x12'))(_0x10ab('0x13'));var utils=require(_0x10ab('0x14'));var config=require(_0x10ab('0x15'));var db=require(_0x10ab('0x16'))['db'];function respondWithStatusCode(_0x118454,_0x31172e){_0x31172e=_0x31172e||0xcc;return function(_0x3be4c1){if(_0x3be4c1){return _0x118454['sendStatus'](_0x31172e);}return _0x118454[_0x10ab('0x17')](_0x31172e)[_0x10ab('0x18')]();};}function respondWithResult(_0x27800b,_0x54cc08){_0x54cc08=_0x54cc08||0xc8;return function(_0x233963){if(_0x233963){return _0x27800b['status'](_0x54cc08)[_0x10ab('0x19')](_0x233963);}};}function respondWithFilteredResult(_0x531914,_0x2b1497){return function(_0x113a94){if(_0x113a94){var _0x38caf2=_0x113a94[_0x10ab('0x1a')],_0x1abd80=_0x2b1497['offset'],_0x54b107=_0x2b1497['offset']+_0x2b1497[_0x10ab('0x1b')],_0x5fb1b8;if(_0x54b107>=_0x38caf2){_0x54b107=_0x38caf2;_0x5fb1b8=0xc8;}else{_0x5fb1b8=0xce;}_0x531914[_0x10ab('0x17')](_0x5fb1b8);return _0x531914[_0x10ab('0x1c')](_0x10ab('0x1d'),_0x1abd80+'-'+_0x54b107+'/'+_0x38caf2)[_0x10ab('0x19')](_0x113a94);}return null;};}function patchUpdates(_0x435c7c){return function(_0x17bd61){try{jsonpatch['apply'](_0x17bd61,_0x435c7c,!![]);}catch(_0x57caaa){return BPromise[_0x10ab('0x1e')](_0x57caaa);}return _0x17bd61[_0x10ab('0x1f')]();};}function saveUpdates(_0x35e908,_0xc8324){return function(_0x1af1c2){if(_0x1af1c2){return _0x1af1c2['update'](_0x35e908)[_0x10ab('0x20')](function(_0x33d391){return _0x33d391;});}return null;};}function removeEntity(_0x80b47e,_0x50ee81){return function(_0x30cd9f){if(_0x30cd9f){return _0x30cd9f['destroy']()['then'](function(){var _0x5b8516=_0x30cd9f[_0x10ab('0x21')]({'plain':!![]});var _0x5f5438=_0x10ab('0x22');return db[_0x10ab('0x23')]['destroy']({'where':{'type':_0x5f5438,'resourceId':_0x5b8516['id']}})[_0x10ab('0x20')](function(){return _0x30cd9f;});})[_0x10ab('0x20')](function(){_0x80b47e[_0x10ab('0x17')](0xcc)[_0x10ab('0x18')]();});}};}function handleEntityNotFound(_0x309592,_0x4d6d33){return function(_0x408d8c){if(!_0x408d8c){_0x309592[_0x10ab('0x24')](0x194);}return _0x408d8c;};}function handleError(_0x5e9a62,_0x117f1f){_0x117f1f=_0x117f1f||0x1f4;return function(_0x5d8fb6){logger[_0x10ab('0x25')](_0x5d8fb6[_0x10ab('0x26')]);if(_0x5d8fb6[_0x10ab('0x27')]){delete _0x5d8fb6[_0x10ab('0x27')];}_0x5e9a62['status'](_0x117f1f)[_0x10ab('0x28')](_0x5d8fb6);};}exports[_0x10ab('0x29')]=function(_0x9ebeb1,_0x37108d){var _0x447825={},_0x7e2e18={},_0x5387f5={'count':0x0,'rows':[]};var _0xa8fc00=db['Trigger'][_0x10ab('0x2a')];_0x7e2e18['model']=_['keys'](_0xa8fc00);_0x7e2e18['query']=_[_0x10ab('0x2b')](_0x9ebeb1[_0x10ab('0x2c')]);_0x7e2e18['filters']=_[_0x10ab('0x2d')](_0x7e2e18['model'],_0x7e2e18[_0x10ab('0x2c')]);_0x447825['attributes']=_[_0x10ab('0x2d')](_0x7e2e18[_0x10ab('0x2e')],qs[_0x10ab('0x2f')](_0x9ebeb1['query'][_0x10ab('0x2f')]));_0x447825[_0x10ab('0x30')]=_0x447825[_0x10ab('0x30')][_0x10ab('0x31')]?_0x447825[_0x10ab('0x30')]:_0x7e2e18[_0x10ab('0x2e')];if(!_0x9ebeb1[_0x10ab('0x2c')]['hasOwnProperty']('nolimit')){_0x447825[_0x10ab('0x1b')]=qs['limit'](_0x9ebeb1[_0x10ab('0x2c')][_0x10ab('0x1b')]);_0x447825['offset']=qs['offset'](_0x9ebeb1[_0x10ab('0x2c')][_0x10ab('0x32')]);}_0x447825[_0x10ab('0x33')]=qs[_0x10ab('0x34')](_0x9ebeb1['query'][_0x10ab('0x34')]);_0x447825['where']=qs[_0x10ab('0x35')](_[_0x10ab('0x36')](_0x9ebeb1[_0x10ab('0x2c')],_0x7e2e18[_0x10ab('0x35')]));if(_0x9ebeb1[_0x10ab('0x2c')][_0x10ab('0x37')]){_0x447825[_0x10ab('0x38')]=_['merge'](_0x447825[_0x10ab('0x38')],{'$or':_[_0x10ab('0x39')](_0xa8fc00,function(_0x247f92){if(_0x247f92[_0x10ab('0x3a')]['key']!==_0x10ab('0x3b')){var _0x55ee58={};_0x55ee58[_0x247f92[_0x10ab('0x3c')]]={'$like':'%'+_0x9ebeb1['query'][_0x10ab('0x37')]+'%'};return _0x55ee58;}})});}_0x447825=_[_0x10ab('0x3d')]({},_0x447825,_0x9ebeb1[_0x10ab('0x3e')]);var _0x5ad22c={'where':_0x447825[_0x10ab('0x38')]};return db[_0x10ab('0x3f')][_0x10ab('0x1a')](_0x5ad22c)[_0x10ab('0x20')](function(_0x35cf45){_0x5387f5[_0x10ab('0x1a')]=_0x35cf45;if(_0x9ebeb1[_0x10ab('0x2c')]['includeAll']){_0x447825[_0x10ab('0x40')]=[{'all':!![]}];}return db[_0x10ab('0x3f')][_0x10ab('0x41')](_0x447825);})[_0x10ab('0x20')](function(_0x54a49b){_0x5387f5['rows']=_0x54a49b;return _0x5387f5;})[_0x10ab('0x20')](respondWithFilteredResult(_0x37108d,_0x447825))['catch'](handleError(_0x37108d,null));};exports['show']=function(_0xccbfb4,_0x59c33f){var _0x5704a2={'raw':![],'where':{'id':_0xccbfb4[_0x10ab('0x42')]['id']}},_0x5d0df3={};_0x5d0df3['model']=_[_0x10ab('0x2b')](db[_0x10ab('0x3f')][_0x10ab('0x2a')]);_0x5d0df3['query']=_[_0x10ab('0x2b')](_0xccbfb4[_0x10ab('0x2c')]);_0x5d0df3[_0x10ab('0x35')]=_[_0x10ab('0x2d')](_0x5d0df3[_0x10ab('0x2e')],_0x5d0df3[_0x10ab('0x2c')]);_0x5704a2[_0x10ab('0x30')]=_['intersection'](_0x5d0df3[_0x10ab('0x2e')],qs['fields'](_0xccbfb4[_0x10ab('0x2c')][_0x10ab('0x2f')]));_0x5704a2[_0x10ab('0x30')]=_0x5704a2[_0x10ab('0x30')]['length']?_0x5704a2[_0x10ab('0x30')]:_0x5d0df3[_0x10ab('0x2e')];if(_0xccbfb4['query'][_0x10ab('0x43')]){_0x5704a2['include']=[{'all':!![]}];}_0x5704a2=_[_0x10ab('0x3d')]({},_0x5704a2,_0xccbfb4[_0x10ab('0x3e')]);return db[_0x10ab('0x3f')]['find'](_0x5704a2)['then'](handleEntityNotFound(_0x59c33f,null))[_0x10ab('0x20')](respondWithResult(_0x59c33f,null))['catch'](handleError(_0x59c33f,null));};exports[_0x10ab('0x44')]=function(_0x181827,_0x329acb){return db[_0x10ab('0x3f')]['create'](_0x181827[_0x10ab('0x45')],{})[_0x10ab('0x20')](function(_0x160fe7){var _0xd847bd=_0x181827[_0x10ab('0x46')]['get']({'plain':!![]});if(!_0xd847bd)throw new Error(_0x10ab('0x47'));if(_0xd847bd[_0x10ab('0x48')]===_0x10ab('0x46')){var _0x3258e2=_0x160fe7['get']({'plain':!![]});var _0x1add72=_0x10ab('0x22');return db[_0x10ab('0x49')][_0x10ab('0x4a')]({'where':{'name':_0x1add72,'userProfileId':_0xd847bd[_0x10ab('0x4b')]},'raw':!![]})[_0x10ab('0x20')](function(_0x58ba35){if(_0x58ba35&&_0x58ba35[_0x10ab('0x4c')]===0x0){return db[_0x10ab('0x23')][_0x10ab('0x44')]({'name':_0x3258e2[_0x10ab('0x27')],'resourceId':_0x3258e2['id'],'type':_0x58ba35[_0x10ab('0x27')],'sectionId':_0x58ba35['id']},{})[_0x10ab('0x20')](function(){return _0x160fe7;});}else{return _0x160fe7;}})[_0x10ab('0x4d')](function(_0x472ccf){logger['error'](_0x10ab('0x4e'),_0x472ccf);throw _0x472ccf;});}return _0x160fe7;})[_0x10ab('0x20')](respondWithResult(_0x329acb,0xc9))['catch'](handleError(_0x329acb,null));};exports[_0x10ab('0x4f')]=function(_0x12152e,_0x4321e7){if(_0x12152e['body']['id']){delete _0x12152e[_0x10ab('0x45')]['id'];}return db[_0x10ab('0x3f')][_0x10ab('0x4a')]({'where':{'id':_0x12152e['params']['id']}})[_0x10ab('0x20')](handleEntityNotFound(_0x4321e7,null))[_0x10ab('0x20')](saveUpdates(_0x12152e[_0x10ab('0x45')],null))[_0x10ab('0x20')](respondWithResult(_0x4321e7,null))[_0x10ab('0x4d')](handleError(_0x4321e7,null));};exports[_0x10ab('0x50')]=function(_0x51cc8c,_0x5da3ff){return db[_0x10ab('0x3f')]['find']({'where':{'id':_0x51cc8c[_0x10ab('0x42')]['id']}})[_0x10ab('0x20')](handleEntityNotFound(_0x5da3ff,null))['then'](removeEntity(_0x5da3ff,null))[_0x10ab('0x4d')](handleError(_0x5da3ff,null));};exports[_0x10ab('0x51')]=function(_0x147feb,_0x4e5bd5,_0x589a17){if(_0x147feb[_0x10ab('0x45')]['id']){delete _0x147feb[_0x10ab('0x45')]['id'];}return db['Trigger'][_0x10ab('0x4a')]({'where':{'id':_0x147feb[_0x10ab('0x42')]['id']}})[_0x10ab('0x20')](handleEntityNotFound(_0x4e5bd5,null))[_0x10ab('0x20')](function(_0x556513){if(_0x556513){_0x147feb[_0x10ab('0x45')][_0x10ab('0x52')]=_0x556513['id'];return db['Condition'][_0x10ab('0x44')](_0x147feb[_0x10ab('0x45')]);}})[_0x10ab('0x20')](respondWithResult(_0x4e5bd5,null))['catch'](handleError(_0x4e5bd5,null));};exports[_0x10ab('0x53')]=function(_0x593359,_0x251ec4,_0x32e303){if(_0x593359[_0x10ab('0x45')]['id']){delete _0x593359['body']['id'];}return db['Trigger'][_0x10ab('0x4a')]({'where':{'id':_0x593359[_0x10ab('0x42')]['id']}})[_0x10ab('0x20')](handleEntityNotFound(_0x251ec4,null))[_0x10ab('0x20')](function(_0x671f68){if(_0x671f68){_0x593359[_0x10ab('0x45')]['TriggerAnyId']=_0x671f68['id'];return db[_0x10ab('0x54')][_0x10ab('0x44')](_0x593359[_0x10ab('0x45')]);}})[_0x10ab('0x20')](respondWithResult(_0x251ec4,null))[_0x10ab('0x4d')](handleError(_0x251ec4,null));};exports['getAllConditions']=function(_0x5675d4,_0x991a1b,_0x3bb228){var _0x3b7a96={};var _0x2c8d6c={};var _0x1a5420;var _0x175ec3;return db[_0x10ab('0x3f')][_0x10ab('0x55')]({'where':{'id':_0x5675d4[_0x10ab('0x42')]['id']}})[_0x10ab('0x20')](handleEntityNotFound(_0x991a1b,null))[_0x10ab('0x20')](function(_0x19b074){if(_0x19b074){_0x1a5420=_0x19b074;_0x2c8d6c[_0x10ab('0x2e')]=_[_0x10ab('0x2b')](db[_0x10ab('0x54')][_0x10ab('0x2a')]);_0x2c8d6c[_0x10ab('0x2c')]=_[_0x10ab('0x2b')](_0x5675d4[_0x10ab('0x2c')]);_0x2c8d6c[_0x10ab('0x35')]=_[_0x10ab('0x2d')](_0x2c8d6c['model'],_0x2c8d6c[_0x10ab('0x2c')]);_0x3b7a96['attributes']=_['intersection'](_0x2c8d6c[_0x10ab('0x2e')],qs[_0x10ab('0x2f')](_0x5675d4[_0x10ab('0x2c')]['fields']));_0x3b7a96[_0x10ab('0x30')]=_0x3b7a96[_0x10ab('0x30')][_0x10ab('0x31')]?_0x3b7a96[_0x10ab('0x30')]:_0x2c8d6c[_0x10ab('0x2e')];_0x3b7a96['order']=qs[_0x10ab('0x34')](_0x5675d4[_0x10ab('0x2c')][_0x10ab('0x34')]);_0x3b7a96[_0x10ab('0x38')]=qs[_0x10ab('0x35')](_[_0x10ab('0x36')](_0x5675d4[_0x10ab('0x2c')],_0x2c8d6c[_0x10ab('0x35')]));if(_0x5675d4[_0x10ab('0x2c')]['filter']){_0x3b7a96[_0x10ab('0x38')]=_[_0x10ab('0x3d')](_0x3b7a96['where'],{'$or':_[_0x10ab('0x39')](_0x3b7a96[_0x10ab('0x30')],function(_0x1bb48c){var _0xb497af={};_0xb497af[_0x1bb48c]={'$like':'%'+_0x5675d4[_0x10ab('0x2c')][_0x10ab('0x37')]+'%'};return _0xb497af;})});}_0x3b7a96=_[_0x10ab('0x3d')]({},_0x3b7a96,_0x5675d4[_0x10ab('0x3e')]);return _0x1a5420[_0x10ab('0x56')](_0x3b7a96);}})[_0x10ab('0x20')](function(_0x40b7d4){if(_0x40b7d4){_0x175ec3=_0x40b7d4[_0x10ab('0x31')];if(!_0x5675d4['query'][_0x10ab('0x57')](_0x10ab('0x58'))){_0x3b7a96[_0x10ab('0x1b')]=qs[_0x10ab('0x1b')](_0x5675d4[_0x10ab('0x2c')][_0x10ab('0x1b')]);_0x3b7a96[_0x10ab('0x32')]=qs[_0x10ab('0x32')](_0x5675d4[_0x10ab('0x2c')]['offset']);}return _0x1a5420['getAllConditions'](_0x3b7a96);}})[_0x10ab('0x20')](function(_0x6c4f01){if(_0x6c4f01){return _0x6c4f01?{'count':_0x175ec3,'rows':_0x6c4f01}:null;}})[_0x10ab('0x20')](respondWithResult(_0x991a1b,null))[_0x10ab('0x4d')](handleError(_0x991a1b,null));};exports[_0x10ab('0x59')]=function(_0x60096a,_0x4b8415,_0x1429e7){var _0x2e6720={};var _0x225136={};var _0x150d60;var _0x2d1133;return db['Trigger'][_0x10ab('0x55')]({'where':{'id':_0x60096a[_0x10ab('0x42')]['id']}})[_0x10ab('0x20')](handleEntityNotFound(_0x4b8415,null))['then'](function(_0xb775c9){if(_0xb775c9){_0x150d60=_0xb775c9;_0x225136[_0x10ab('0x2e')]=_[_0x10ab('0x2b')](db[_0x10ab('0x54')][_0x10ab('0x2a')]);_0x225136[_0x10ab('0x2c')]=_[_0x10ab('0x2b')](_0x60096a[_0x10ab('0x2c')]);_0x225136[_0x10ab('0x35')]=_[_0x10ab('0x2d')](_0x225136[_0x10ab('0x2e')],_0x225136[_0x10ab('0x2c')]);_0x2e6720[_0x10ab('0x30')]=_[_0x10ab('0x2d')](_0x225136[_0x10ab('0x2e')],qs[_0x10ab('0x2f')](_0x60096a[_0x10ab('0x2c')]['fields']));_0x2e6720[_0x10ab('0x30')]=_0x2e6720['attributes'][_0x10ab('0x31')]?_0x2e6720[_0x10ab('0x30')]:_0x225136[_0x10ab('0x2e')];_0x2e6720[_0x10ab('0x33')]=qs['sort'](_0x60096a[_0x10ab('0x2c')]['sort']);_0x2e6720[_0x10ab('0x38')]=qs[_0x10ab('0x35')](_['pick'](_0x60096a['query'],_0x225136[_0x10ab('0x35')]));if(_0x60096a[_0x10ab('0x2c')]['filter']){_0x2e6720['where']=_[_0x10ab('0x3d')](_0x2e6720[_0x10ab('0x38')],{'$or':_[_0x10ab('0x39')](_0x2e6720[_0x10ab('0x30')],function(_0x363887){var _0x5174ea={};_0x5174ea[_0x363887]={'$like':'%'+_0x60096a['query'][_0x10ab('0x37')]+'%'};return _0x5174ea;})});}_0x2e6720=_[_0x10ab('0x3d')]({},_0x2e6720,_0x60096a['options']);return _0x150d60[_0x10ab('0x59')](_0x2e6720);}})[_0x10ab('0x20')](function(_0x3e9772){if(_0x3e9772){_0x2d1133=_0x3e9772[_0x10ab('0x31')];if(!_0x60096a['query'][_0x10ab('0x57')]('nolimit')){_0x2e6720[_0x10ab('0x1b')]=qs[_0x10ab('0x1b')](_0x60096a[_0x10ab('0x2c')][_0x10ab('0x1b')]);_0x2e6720[_0x10ab('0x32')]=qs[_0x10ab('0x32')](_0x60096a[_0x10ab('0x2c')][_0x10ab('0x32')]);}return _0x150d60[_0x10ab('0x59')](_0x2e6720);}})[_0x10ab('0x20')](function(_0x3906bb){if(_0x3906bb){return _0x3906bb?{'count':_0x2d1133,'rows':_0x3906bb}:null;}})[_0x10ab('0x20')](respondWithResult(_0x4b8415,null))['catch'](handleError(_0x4b8415,null));};exports['addAction']=function(_0x23ce8e,_0x5bc8a7,_0x5b60c8){if(_0x23ce8e[_0x10ab('0x45')]['id']){delete _0x23ce8e[_0x10ab('0x45')]['id'];}return db[_0x10ab('0x3f')][_0x10ab('0x4a')]({'where':{'id':_0x23ce8e[_0x10ab('0x42')]['id']}})[_0x10ab('0x20')](handleEntityNotFound(_0x5bc8a7,null))[_0x10ab('0x20')](function(_0x10b680){if(_0x10b680){_0x23ce8e['body'][_0x10ab('0x5a')]=_0x10b680['id'];return db[_0x10ab('0x5b')][_0x10ab('0x44')](_0x23ce8e[_0x10ab('0x45')]);}})['then'](respondWithResult(_0x5bc8a7,null))[_0x10ab('0x4d')](handleError(_0x5bc8a7,null));};exports['getActions']=function(_0x3b2f6f,_0x1e1cf4,_0x5ccee8){var _0x46723b={};var _0x281faf={};var _0x3a5137;var _0x503c57;return db[_0x10ab('0x3f')]['findOne']({'where':{'id':_0x3b2f6f[_0x10ab('0x42')]['id']}})[_0x10ab('0x20')](handleEntityNotFound(_0x1e1cf4,null))[_0x10ab('0x20')](function(_0x647696){if(_0x647696){_0x3a5137=_0x647696;_0x281faf[_0x10ab('0x2e')]=_[_0x10ab('0x2b')](db[_0x10ab('0x5b')][_0x10ab('0x2a')]);_0x281faf[_0x10ab('0x2c')]=_[_0x10ab('0x2b')](_0x3b2f6f[_0x10ab('0x2c')]);_0x281faf['filters']=_[_0x10ab('0x2d')](_0x281faf[_0x10ab('0x2e')],_0x281faf['query']);_0x46723b[_0x10ab('0x30')]=_[_0x10ab('0x2d')](_0x281faf[_0x10ab('0x2e')],qs[_0x10ab('0x2f')](_0x3b2f6f[_0x10ab('0x2c')][_0x10ab('0x2f')]));_0x46723b['attributes']=_0x46723b[_0x10ab('0x30')][_0x10ab('0x31')]?_0x46723b['attributes']:_0x281faf[_0x10ab('0x2e')];_0x46723b['order']=qs[_0x10ab('0x34')](_0x3b2f6f['query']['sort']);_0x46723b['where']=qs['filters'](_[_0x10ab('0x36')](_0x3b2f6f[_0x10ab('0x2c')],_0x281faf[_0x10ab('0x35')]));if(_0x3b2f6f[_0x10ab('0x2c')][_0x10ab('0x37')]){_0x46723b[_0x10ab('0x38')]=_[_0x10ab('0x3d')](_0x46723b[_0x10ab('0x38')],{'$or':_[_0x10ab('0x39')](_0x46723b[_0x10ab('0x30')],function(_0x415ddf){var _0x502dd9={};_0x502dd9[_0x415ddf]={'$like':'%'+_0x3b2f6f['query'][_0x10ab('0x37')]+'%'};return _0x502dd9;})});}_0x46723b=_[_0x10ab('0x3d')]({},_0x46723b,_0x3b2f6f[_0x10ab('0x3e')]);return _0x3a5137[_0x10ab('0x5c')](_0x46723b);}})['then'](function(_0x17e378){if(_0x17e378){_0x503c57=_0x17e378[_0x10ab('0x31')];if(!_0x3b2f6f[_0x10ab('0x2c')][_0x10ab('0x57')](_0x10ab('0x58'))){_0x46723b[_0x10ab('0x1b')]=qs[_0x10ab('0x1b')](_0x3b2f6f[_0x10ab('0x2c')]['limit']);_0x46723b[_0x10ab('0x32')]=qs['offset'](_0x3b2f6f[_0x10ab('0x2c')][_0x10ab('0x32')]);}return _0x3a5137[_0x10ab('0x5c')](_0x46723b);}})[_0x10ab('0x20')](function(_0x1b1a75){if(_0x1b1a75){return _0x1b1a75?{'count':_0x503c57,'rows':_0x1b1a75}:null;}})[_0x10ab('0x20')](respondWithResult(_0x1e1cf4,null))[_0x10ab('0x4d')](handleError(_0x1e1cf4,null));}; \ No newline at end of file +var _0xdd43=['save','update','then','destroy','get','Triggers','UserProfileResource','status','end','sendStatus','stack','name','send','index','Trigger','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','key','merge','count','includeAll','include','findAll','rows','show','keys','rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','Condition','TriggerAnyId','getAllConditions','findOne','map','getAnyConditions','addAction','TriggerId','Action','getActions','html-pdf','eml-format','rimraf','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','json','offset','limit','set','Content-Range'];(function(_0x2129a3,_0x48f17a){var _0x18842b=function(_0x254d06){while(--_0x254d06){_0x2129a3['push'](_0x2129a3['shift']());}};_0x18842b(++_0x48f17a);}(_0xdd43,0x19a));var _0x3dd4=function(_0x20fbe3,_0x3eef04){_0x20fbe3=_0x20fbe3-0x0;var _0x405c31=_0xdd43[_0x20fbe3];return _0x405c31;};'use strict';var pdf=require(_0x3dd4('0x0'));var emlformat=require(_0x3dd4('0x1'));var rimraf=require(_0x3dd4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3dd4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3dd4('0x4'));var util=require(_0x3dd4('0x5'));var path=require(_0x3dd4('0x6'));var sox=require(_0x3dd4('0x7'));var csv=require('to-csv');var ejs=require(_0x3dd4('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3dd4('0x9'));var crypto=require(_0x3dd4('0xa'));var jsforce=require(_0x3dd4('0xb'));var deskjs=require(_0x3dd4('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3dd4('0xd'));var Papa=require(_0x3dd4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3dd4('0xf'));var hardwareService=require(_0x3dd4('0x10'));var logger=require('../../config/logger')(_0x3dd4('0x11'));var utils=require('../../config/utils');var config=require(_0x3dd4('0x12'));var db=require(_0x3dd4('0x13'))['db'];function respondWithStatusCode(_0x4e86b5,_0x3bd41e){_0x3bd41e=_0x3bd41e||0xcc;return function(_0x30398a){if(_0x30398a){return _0x4e86b5['sendStatus'](_0x3bd41e);}return _0x4e86b5['status'](_0x3bd41e)['end']();};}function respondWithResult(_0x4db20d,_0x4d8b2a){_0x4d8b2a=_0x4d8b2a||0xc8;return function(_0x18c2d4){if(_0x18c2d4){return _0x4db20d['status'](_0x4d8b2a)[_0x3dd4('0x14')](_0x18c2d4);}};}function respondWithFilteredResult(_0x1cfe9e,_0xf41bfb){return function(_0x1ebf56){if(_0x1ebf56){var _0x1d4469=_0x1ebf56['count'],_0x5be3b4=_0xf41bfb[_0x3dd4('0x15')],_0x3b88af=_0xf41bfb[_0x3dd4('0x15')]+_0xf41bfb[_0x3dd4('0x16')],_0x2567cd;if(_0x3b88af>=_0x1d4469){_0x3b88af=_0x1d4469;_0x2567cd=0xc8;}else{_0x2567cd=0xce;}_0x1cfe9e['status'](_0x2567cd);return _0x1cfe9e[_0x3dd4('0x17')](_0x3dd4('0x18'),_0x5be3b4+'-'+_0x3b88af+'/'+_0x1d4469)[_0x3dd4('0x14')](_0x1ebf56);}return null;};}function patchUpdates(_0x3f910d){return function(_0xf4bdc2){try{jsonpatch['apply'](_0xf4bdc2,_0x3f910d,!![]);}catch(_0x364679){return BPromise['reject'](_0x364679);}return _0xf4bdc2[_0x3dd4('0x19')]();};}function saveUpdates(_0x418c50,_0x4a4a56){return function(_0x3b91ea){if(_0x3b91ea){return _0x3b91ea[_0x3dd4('0x1a')](_0x418c50)[_0x3dd4('0x1b')](function(_0x1a71c2){return _0x1a71c2;});}return null;};}function removeEntity(_0x4bdbf1,_0x37e770){return function(_0x1f0cc2){if(_0x1f0cc2){return _0x1f0cc2[_0x3dd4('0x1c')]()[_0x3dd4('0x1b')](function(){var _0x9bf2ce=_0x1f0cc2[_0x3dd4('0x1d')]({'plain':!![]});var _0x41cb7b=_0x3dd4('0x1e');return db[_0x3dd4('0x1f')][_0x3dd4('0x1c')]({'where':{'type':_0x41cb7b,'resourceId':_0x9bf2ce['id']}})[_0x3dd4('0x1b')](function(){return _0x1f0cc2;});})[_0x3dd4('0x1b')](function(){_0x4bdbf1[_0x3dd4('0x20')](0xcc)[_0x3dd4('0x21')]();});}};}function handleEntityNotFound(_0x54965c,_0x414e8d){return function(_0x330e8f){if(!_0x330e8f){_0x54965c[_0x3dd4('0x22')](0x194);}return _0x330e8f;};}function handleError(_0x5a1464,_0x7aa829){_0x7aa829=_0x7aa829||0x1f4;return function(_0x3c166f){logger['error'](_0x3c166f[_0x3dd4('0x23')]);if(_0x3c166f[_0x3dd4('0x24')]){delete _0x3c166f['name'];}_0x5a1464['status'](_0x7aa829)[_0x3dd4('0x25')](_0x3c166f);};}exports[_0x3dd4('0x26')]=function(_0x221887,_0x1af25a){var _0x3435a4={},_0x38122f={},_0x350e82={'count':0x0,'rows':[]};var _0x392a3e=db[_0x3dd4('0x27')]['rawAttributes'];_0x38122f[_0x3dd4('0x28')]=_['keys'](_0x392a3e);_0x38122f[_0x3dd4('0x29')]=_['keys'](_0x221887[_0x3dd4('0x29')]);_0x38122f['filters']=_[_0x3dd4('0x2a')](_0x38122f['model'],_0x38122f[_0x3dd4('0x29')]);_0x3435a4[_0x3dd4('0x2b')]=_[_0x3dd4('0x2a')](_0x38122f[_0x3dd4('0x28')],qs[_0x3dd4('0x2c')](_0x221887[_0x3dd4('0x29')]['fields']));_0x3435a4[_0x3dd4('0x2b')]=_0x3435a4['attributes'][_0x3dd4('0x2d')]?_0x3435a4[_0x3dd4('0x2b')]:_0x38122f['model'];if(!_0x221887[_0x3dd4('0x29')][_0x3dd4('0x2e')](_0x3dd4('0x2f'))){_0x3435a4[_0x3dd4('0x16')]=qs[_0x3dd4('0x16')](_0x221887[_0x3dd4('0x29')][_0x3dd4('0x16')]);_0x3435a4['offset']=qs['offset'](_0x221887[_0x3dd4('0x29')][_0x3dd4('0x15')]);}_0x3435a4[_0x3dd4('0x30')]=qs[_0x3dd4('0x31')](_0x221887[_0x3dd4('0x29')]['sort']);_0x3435a4[_0x3dd4('0x32')]=qs[_0x3dd4('0x33')](_[_0x3dd4('0x34')](_0x221887[_0x3dd4('0x29')],_0x38122f['filters']));if(_0x221887[_0x3dd4('0x29')][_0x3dd4('0x35')]){_0x3435a4[_0x3dd4('0x32')]=_['merge'](_0x3435a4[_0x3dd4('0x32')],{'$or':_['map'](_0x392a3e,function(_0x1facf7){if(_0x1facf7[_0x3dd4('0x36')][_0x3dd4('0x37')]!=='VIRTUAL'){var _0x3d600e={};_0x3d600e[_0x1facf7['field']]={'$like':'%'+_0x221887[_0x3dd4('0x29')][_0x3dd4('0x35')]+'%'};return _0x3d600e;}})});}_0x3435a4=_[_0x3dd4('0x38')]({},_0x3435a4,_0x221887['options']);var _0x2ac928={'where':_0x3435a4['where']};return db[_0x3dd4('0x27')][_0x3dd4('0x39')](_0x2ac928)[_0x3dd4('0x1b')](function(_0x140057){_0x350e82[_0x3dd4('0x39')]=_0x140057;if(_0x221887[_0x3dd4('0x29')][_0x3dd4('0x3a')]){_0x3435a4[_0x3dd4('0x3b')]=[{'all':!![]}];}return db[_0x3dd4('0x27')][_0x3dd4('0x3c')](_0x3435a4);})[_0x3dd4('0x1b')](function(_0x34a71b){_0x350e82[_0x3dd4('0x3d')]=_0x34a71b;return _0x350e82;})['then'](respondWithFilteredResult(_0x1af25a,_0x3435a4))['catch'](handleError(_0x1af25a,null));};exports[_0x3dd4('0x3e')]=function(_0x518de5,_0x21a33b){var _0x572fa7={'raw':![],'where':{'id':_0x518de5['params']['id']}},_0x2a9794={};_0x2a9794[_0x3dd4('0x28')]=_[_0x3dd4('0x3f')](db[_0x3dd4('0x27')][_0x3dd4('0x40')]);_0x2a9794['query']=_['keys'](_0x518de5[_0x3dd4('0x29')]);_0x2a9794[_0x3dd4('0x33')]=_[_0x3dd4('0x2a')](_0x2a9794[_0x3dd4('0x28')],_0x2a9794['query']);_0x572fa7[_0x3dd4('0x2b')]=_[_0x3dd4('0x2a')](_0x2a9794[_0x3dd4('0x28')],qs['fields'](_0x518de5[_0x3dd4('0x29')]['fields']));_0x572fa7[_0x3dd4('0x2b')]=_0x572fa7[_0x3dd4('0x2b')][_0x3dd4('0x2d')]?_0x572fa7[_0x3dd4('0x2b')]:_0x2a9794[_0x3dd4('0x28')];if(_0x518de5[_0x3dd4('0x29')][_0x3dd4('0x3a')]){_0x572fa7['include']=[{'all':!![]}];}_0x572fa7=_[_0x3dd4('0x38')]({},_0x572fa7,_0x518de5[_0x3dd4('0x41')]);return db[_0x3dd4('0x27')][_0x3dd4('0x42')](_0x572fa7)[_0x3dd4('0x1b')](handleEntityNotFound(_0x21a33b,null))[_0x3dd4('0x1b')](respondWithResult(_0x21a33b,null))['catch'](handleError(_0x21a33b,null));};exports[_0x3dd4('0x43')]=function(_0x2e222b,_0x23f2a7){return db[_0x3dd4('0x27')][_0x3dd4('0x43')](_0x2e222b[_0x3dd4('0x44')],{})[_0x3dd4('0x1b')](function(_0x69d522){var _0x1533b4=_0x2e222b['user'][_0x3dd4('0x1d')]({'plain':!![]});if(!_0x1533b4)throw new Error(_0x3dd4('0x45'));if(_0x1533b4[_0x3dd4('0x46')]===_0x3dd4('0x47')){var _0x1d229b=_0x69d522[_0x3dd4('0x1d')]({'plain':!![]});var _0x17c0c0=_0x3dd4('0x1e');return db[_0x3dd4('0x48')]['find']({'where':{'name':_0x17c0c0,'userProfileId':_0x1533b4['userProfileId']},'raw':!![]})['then'](function(_0x147423){if(_0x147423&&_0x147423['autoAssociation']===0x0){return db[_0x3dd4('0x1f')][_0x3dd4('0x43')]({'name':_0x1d229b[_0x3dd4('0x24')],'resourceId':_0x1d229b['id'],'type':_0x147423['name'],'sectionId':_0x147423['id']},{})[_0x3dd4('0x1b')](function(){return _0x69d522;});}else{return _0x69d522;}})[_0x3dd4('0x49')](function(_0x1b5cf3){logger[_0x3dd4('0x4a')](_0x3dd4('0x4b'),_0x1b5cf3);throw _0x1b5cf3;});}return _0x69d522;})[_0x3dd4('0x1b')](respondWithResult(_0x23f2a7,0xc9))[_0x3dd4('0x49')](handleError(_0x23f2a7,null));};exports[_0x3dd4('0x1a')]=function(_0x56b861,_0x22d47d){if(_0x56b861['body']['id']){delete _0x56b861[_0x3dd4('0x44')]['id'];}return db[_0x3dd4('0x27')][_0x3dd4('0x42')]({'where':{'id':_0x56b861[_0x3dd4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x22d47d,null))[_0x3dd4('0x1b')](saveUpdates(_0x56b861[_0x3dd4('0x44')],null))[_0x3dd4('0x1b')](respondWithResult(_0x22d47d,null))['catch'](handleError(_0x22d47d,null));};exports['destroy']=function(_0x557285,_0xa7d569){return db[_0x3dd4('0x27')][_0x3dd4('0x42')]({'where':{'id':_0x557285[_0x3dd4('0x4c')]['id']}})[_0x3dd4('0x1b')](handleEntityNotFound(_0xa7d569,null))[_0x3dd4('0x1b')](removeEntity(_0xa7d569,null))[_0x3dd4('0x49')](handleError(_0xa7d569,null));};exports['addAllCondition']=function(_0x3949f8,_0x32fcf3,_0x38ff63){if(_0x3949f8[_0x3dd4('0x44')]['id']){delete _0x3949f8[_0x3dd4('0x44')]['id'];}return db[_0x3dd4('0x27')][_0x3dd4('0x42')]({'where':{'id':_0x3949f8[_0x3dd4('0x4c')]['id']}})[_0x3dd4('0x1b')](handleEntityNotFound(_0x32fcf3,null))[_0x3dd4('0x1b')](function(_0xd3f5e){if(_0xd3f5e){_0x3949f8[_0x3dd4('0x44')]['TriggerAllId']=_0xd3f5e['id'];return db[_0x3dd4('0x4d')]['create'](_0x3949f8[_0x3dd4('0x44')]);}})[_0x3dd4('0x1b')](respondWithResult(_0x32fcf3,null))[_0x3dd4('0x49')](handleError(_0x32fcf3,null));};exports['addAnyCondition']=function(_0x399a1d,_0x56118c,_0x34ca67){if(_0x399a1d[_0x3dd4('0x44')]['id']){delete _0x399a1d[_0x3dd4('0x44')]['id'];}return db[_0x3dd4('0x27')]['find']({'where':{'id':_0x399a1d['params']['id']}})['then'](handleEntityNotFound(_0x56118c,null))['then'](function(_0x39e659){if(_0x39e659){_0x399a1d[_0x3dd4('0x44')][_0x3dd4('0x4e')]=_0x39e659['id'];return db[_0x3dd4('0x4d')][_0x3dd4('0x43')](_0x399a1d[_0x3dd4('0x44')]);}})['then'](respondWithResult(_0x56118c,null))['catch'](handleError(_0x56118c,null));};exports[_0x3dd4('0x4f')]=function(_0x4f44a7,_0x4d70b0,_0x55c8c0){var _0x5564ac={};var _0x3d5ef9={};var _0xcc7ed2;var _0x3efe63;return db[_0x3dd4('0x27')][_0x3dd4('0x50')]({'where':{'id':_0x4f44a7[_0x3dd4('0x4c')]['id']}})[_0x3dd4('0x1b')](handleEntityNotFound(_0x4d70b0,null))[_0x3dd4('0x1b')](function(_0x2834ff){if(_0x2834ff){_0xcc7ed2=_0x2834ff;_0x3d5ef9[_0x3dd4('0x28')]=_[_0x3dd4('0x3f')](db[_0x3dd4('0x4d')]['rawAttributes']);_0x3d5ef9['query']=_['keys'](_0x4f44a7[_0x3dd4('0x29')]);_0x3d5ef9[_0x3dd4('0x33')]=_['intersection'](_0x3d5ef9[_0x3dd4('0x28')],_0x3d5ef9[_0x3dd4('0x29')]);_0x5564ac[_0x3dd4('0x2b')]=_['intersection'](_0x3d5ef9[_0x3dd4('0x28')],qs[_0x3dd4('0x2c')](_0x4f44a7['query']['fields']));_0x5564ac[_0x3dd4('0x2b')]=_0x5564ac['attributes'][_0x3dd4('0x2d')]?_0x5564ac[_0x3dd4('0x2b')]:_0x3d5ef9[_0x3dd4('0x28')];_0x5564ac[_0x3dd4('0x30')]=qs[_0x3dd4('0x31')](_0x4f44a7[_0x3dd4('0x29')][_0x3dd4('0x31')]);_0x5564ac[_0x3dd4('0x32')]=qs[_0x3dd4('0x33')](_[_0x3dd4('0x34')](_0x4f44a7['query'],_0x3d5ef9[_0x3dd4('0x33')]));if(_0x4f44a7[_0x3dd4('0x29')][_0x3dd4('0x35')]){_0x5564ac['where']=_['merge'](_0x5564ac[_0x3dd4('0x32')],{'$or':_[_0x3dd4('0x51')](_0x5564ac['attributes'],function(_0x439aed){var _0x335bc0={};_0x335bc0[_0x439aed]={'$like':'%'+_0x4f44a7[_0x3dd4('0x29')]['filter']+'%'};return _0x335bc0;})});}_0x5564ac=_[_0x3dd4('0x38')]({},_0x5564ac,_0x4f44a7['options']);return _0xcc7ed2[_0x3dd4('0x4f')](_0x5564ac);}})['then'](function(_0x1211da){if(_0x1211da){_0x3efe63=_0x1211da[_0x3dd4('0x2d')];if(!_0x4f44a7[_0x3dd4('0x29')][_0x3dd4('0x2e')]('nolimit')){_0x5564ac[_0x3dd4('0x16')]=qs[_0x3dd4('0x16')](_0x4f44a7[_0x3dd4('0x29')]['limit']);_0x5564ac[_0x3dd4('0x15')]=qs[_0x3dd4('0x15')](_0x4f44a7[_0x3dd4('0x29')][_0x3dd4('0x15')]);}return _0xcc7ed2[_0x3dd4('0x4f')](_0x5564ac);}})[_0x3dd4('0x1b')](function(_0x3b54f3){if(_0x3b54f3){return _0x3b54f3?{'count':_0x3efe63,'rows':_0x3b54f3}:null;}})['then'](respondWithResult(_0x4d70b0,null))[_0x3dd4('0x49')](handleError(_0x4d70b0,null));};exports[_0x3dd4('0x52')]=function(_0x5628ed,_0x2a4483,_0x29a20e){var _0x938343={};var _0x4be5f1={};var _0x578aa8;var _0x5525cf;return db['Trigger'][_0x3dd4('0x50')]({'where':{'id':_0x5628ed[_0x3dd4('0x4c')]['id']}})[_0x3dd4('0x1b')](handleEntityNotFound(_0x2a4483,null))[_0x3dd4('0x1b')](function(_0x10e893){if(_0x10e893){_0x578aa8=_0x10e893;_0x4be5f1[_0x3dd4('0x28')]=_['keys'](db['Condition'][_0x3dd4('0x40')]);_0x4be5f1['query']=_[_0x3dd4('0x3f')](_0x5628ed[_0x3dd4('0x29')]);_0x4be5f1[_0x3dd4('0x33')]=_[_0x3dd4('0x2a')](_0x4be5f1[_0x3dd4('0x28')],_0x4be5f1[_0x3dd4('0x29')]);_0x938343[_0x3dd4('0x2b')]=_['intersection'](_0x4be5f1[_0x3dd4('0x28')],qs[_0x3dd4('0x2c')](_0x5628ed[_0x3dd4('0x29')][_0x3dd4('0x2c')]));_0x938343[_0x3dd4('0x2b')]=_0x938343['attributes'][_0x3dd4('0x2d')]?_0x938343[_0x3dd4('0x2b')]:_0x4be5f1['model'];_0x938343[_0x3dd4('0x30')]=qs[_0x3dd4('0x31')](_0x5628ed['query'][_0x3dd4('0x31')]);_0x938343['where']=qs['filters'](_[_0x3dd4('0x34')](_0x5628ed[_0x3dd4('0x29')],_0x4be5f1[_0x3dd4('0x33')]));if(_0x5628ed[_0x3dd4('0x29')][_0x3dd4('0x35')]){_0x938343[_0x3dd4('0x32')]=_[_0x3dd4('0x38')](_0x938343['where'],{'$or':_['map'](_0x938343[_0x3dd4('0x2b')],function(_0x17be59){var _0x1c5423={};_0x1c5423[_0x17be59]={'$like':'%'+_0x5628ed[_0x3dd4('0x29')][_0x3dd4('0x35')]+'%'};return _0x1c5423;})});}_0x938343=_['merge']({},_0x938343,_0x5628ed[_0x3dd4('0x41')]);return _0x578aa8['getAnyConditions'](_0x938343);}})[_0x3dd4('0x1b')](function(_0x36da0b){if(_0x36da0b){_0x5525cf=_0x36da0b[_0x3dd4('0x2d')];if(!_0x5628ed['query'][_0x3dd4('0x2e')](_0x3dd4('0x2f'))){_0x938343['limit']=qs[_0x3dd4('0x16')](_0x5628ed[_0x3dd4('0x29')][_0x3dd4('0x16')]);_0x938343[_0x3dd4('0x15')]=qs['offset'](_0x5628ed[_0x3dd4('0x29')]['offset']);}return _0x578aa8[_0x3dd4('0x52')](_0x938343);}})[_0x3dd4('0x1b')](function(_0x58e8e7){if(_0x58e8e7){return _0x58e8e7?{'count':_0x5525cf,'rows':_0x58e8e7}:null;}})['then'](respondWithResult(_0x2a4483,null))[_0x3dd4('0x49')](handleError(_0x2a4483,null));};exports[_0x3dd4('0x53')]=function(_0x4abad6,_0x2f05a0,_0x1f8616){if(_0x4abad6[_0x3dd4('0x44')]['id']){delete _0x4abad6['body']['id'];}return db[_0x3dd4('0x27')][_0x3dd4('0x42')]({'where':{'id':_0x4abad6[_0x3dd4('0x4c')]['id']}})[_0x3dd4('0x1b')](handleEntityNotFound(_0x2f05a0,null))[_0x3dd4('0x1b')](function(_0x5981a3){if(_0x5981a3){_0x4abad6[_0x3dd4('0x44')][_0x3dd4('0x54')]=_0x5981a3['id'];return db[_0x3dd4('0x55')][_0x3dd4('0x43')](_0x4abad6[_0x3dd4('0x44')]);}})['then'](respondWithResult(_0x2f05a0,null))[_0x3dd4('0x49')](handleError(_0x2f05a0,null));};exports[_0x3dd4('0x56')]=function(_0x1f38f2,_0x5ac1b1,_0x58ba59){var _0x88e249={};var _0x4ee699={};var _0x1d057f;var _0x14c04f;return db['Trigger'][_0x3dd4('0x50')]({'where':{'id':_0x1f38f2[_0x3dd4('0x4c')]['id']}})[_0x3dd4('0x1b')](handleEntityNotFound(_0x5ac1b1,null))[_0x3dd4('0x1b')](function(_0x451a07){if(_0x451a07){_0x1d057f=_0x451a07;_0x4ee699[_0x3dd4('0x28')]=_[_0x3dd4('0x3f')](db['Action'][_0x3dd4('0x40')]);_0x4ee699[_0x3dd4('0x29')]=_[_0x3dd4('0x3f')](_0x1f38f2['query']);_0x4ee699[_0x3dd4('0x33')]=_[_0x3dd4('0x2a')](_0x4ee699[_0x3dd4('0x28')],_0x4ee699[_0x3dd4('0x29')]);_0x88e249[_0x3dd4('0x2b')]=_[_0x3dd4('0x2a')](_0x4ee699[_0x3dd4('0x28')],qs['fields'](_0x1f38f2[_0x3dd4('0x29')][_0x3dd4('0x2c')]));_0x88e249['attributes']=_0x88e249[_0x3dd4('0x2b')][_0x3dd4('0x2d')]?_0x88e249[_0x3dd4('0x2b')]:_0x4ee699[_0x3dd4('0x28')];_0x88e249[_0x3dd4('0x30')]=qs[_0x3dd4('0x31')](_0x1f38f2[_0x3dd4('0x29')][_0x3dd4('0x31')]);_0x88e249['where']=qs[_0x3dd4('0x33')](_[_0x3dd4('0x34')](_0x1f38f2[_0x3dd4('0x29')],_0x4ee699['filters']));if(_0x1f38f2[_0x3dd4('0x29')][_0x3dd4('0x35')]){_0x88e249[_0x3dd4('0x32')]=_[_0x3dd4('0x38')](_0x88e249[_0x3dd4('0x32')],{'$or':_['map'](_0x88e249[_0x3dd4('0x2b')],function(_0x2c51fb){var _0x46fb05={};_0x46fb05[_0x2c51fb]={'$like':'%'+_0x1f38f2[_0x3dd4('0x29')][_0x3dd4('0x35')]+'%'};return _0x46fb05;})});}_0x88e249=_[_0x3dd4('0x38')]({},_0x88e249,_0x1f38f2[_0x3dd4('0x41')]);return _0x1d057f[_0x3dd4('0x56')](_0x88e249);}})[_0x3dd4('0x1b')](function(_0xc90d4f){if(_0xc90d4f){_0x14c04f=_0xc90d4f['length'];if(!_0x1f38f2[_0x3dd4('0x29')][_0x3dd4('0x2e')](_0x3dd4('0x2f'))){_0x88e249['limit']=qs['limit'](_0x1f38f2[_0x3dd4('0x29')][_0x3dd4('0x16')]);_0x88e249[_0x3dd4('0x15')]=qs[_0x3dd4('0x15')](_0x1f38f2[_0x3dd4('0x29')][_0x3dd4('0x15')]);}return _0x1d057f[_0x3dd4('0x56')](_0x88e249);}})['then'](function(_0x51e8ba){if(_0x51e8ba){return _0x51e8ba?{'count':_0x14c04f,'rows':_0x51e8ba}:null;}})['then'](respondWithResult(_0x5ac1b1,null))[_0x3dd4('0x49')](handleError(_0x5ac1b1,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 46b3b4b..c2c0ca5 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 _0xa9e0=['../../config/environment','./trigger.attributes','exports','define','Trigger','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x27904e,_0x405ee9){var _0x4a6d50=function(_0x14f178){while(--_0x14f178){_0x27904e['push'](_0x27904e['shift']());}};_0x4a6d50(++_0x405ee9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ffd=['Trigger','tools_triggers','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./trigger.attributes','define'];(function(_0x21c81e,_0x5de28f){var _0x16a6d7=function(_0x91beeb){while(--_0x91beeb){_0x21c81e['push'](_0x21c81e['shift']());}};_0x16a6d7(++_0x5de28f);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x322d3a,_0x22dfe4){_0x322d3a=_0x322d3a-0x0;var _0x563368=_0x9ffd[_0x322d3a];return _0x563368;};'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/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 8dd5945..755a52c 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 _0x91d9=['stringify','error','code','message','result','Trigger','findAll','options','where','attributes','limit','include','map','model','GetTrigger','catch','find','raw','ShowTrigger','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s'];(function(_0x3f4f4c,_0x152171){var _0x3d48b3=function(_0x18a8a4){while(--_0x18a8a4){_0x3f4f4c['push'](_0x3f4f4c['shift']());}};_0x3d48b3(++_0x152171);}(_0x91d9,0x185));var _0x991d=function(_0x265311,_0xe82872){_0x265311=_0x265311-0x0;var _0x479949=_0x91d9[_0x265311];return _0x479949;};'use strict';var _=require(_0x991d('0x0'));var util=require(_0x991d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x991d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x991d('0x3'))['db'];var utils=require(_0x991d('0x4'));var logger=require(_0x991d('0x5'))(_0x991d('0x6'));var config=require(_0x991d('0x7'));var jayson=require(_0x991d('0x8'));var client=jayson[_0x991d('0x9')][_0x991d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a685b,_0x55891b,_0xe2b8e6){return new BPromise(function(_0x87e644,_0x1de82e){return client[_0x991d('0xb')](_0x3a685b,_0xe2b8e6)[_0x991d('0xc')](function(_0x3bbfd3){logger[_0x991d('0xd')](_0x991d('0xe'),_0x55891b,_0x991d('0xf'));logger[_0x991d('0x10')](_0x991d('0x11'),_0x55891b,'request\x20sent',JSON[_0x991d('0x12')](_0x3bbfd3));if(_0x3bbfd3['error']){if(_0x3bbfd3[_0x991d('0x13')][_0x991d('0x14')]===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x55891b,_0x3bbfd3[_0x991d('0x13')][_0x991d('0x15')]);return _0x1de82e(_0x3bbfd3[_0x991d('0x13')]['message']);}logger['error'](_0x991d('0xe'),_0x55891b,_0x3bbfd3[_0x991d('0x13')]['message']);return _0x87e644(_0x3bbfd3['error'][_0x991d('0x15')]);}else{logger[_0x991d('0xd')](_0x991d('0xe'),_0x55891b,_0x991d('0xf'));_0x87e644(_0x3bbfd3[_0x991d('0x16')]['message']);}})['catch'](function(_0x4ff774){logger[_0x991d('0x13')](_0x991d('0xe'),_0x55891b,_0x4ff774);_0x1de82e(_0x4ff774);});});}exports['GetTrigger']=function(_0x1b45db){var _0x38b43d=this;return new Promise(function(_0x1db20c,_0x49e836){return db[_0x991d('0x17')][_0x991d('0x18')]({'raw':_0x1b45db[_0x991d('0x19')]?_0x1b45db[_0x991d('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1b45db[_0x991d('0x19')]?_0x1b45db[_0x991d('0x19')][_0x991d('0x1a')]||null:null,'attributes':_0x1b45db[_0x991d('0x19')]?_0x1b45db[_0x991d('0x19')][_0x991d('0x1b')]||null:null,'limit':_0x1b45db[_0x991d('0x19')]?_0x1b45db[_0x991d('0x19')][_0x991d('0x1c')]||null:null,'include':_0x1b45db[_0x991d('0x19')]?_0x1b45db[_0x991d('0x19')][_0x991d('0x1d')]?_[_0x991d('0x1e')](_0x1b45db[_0x991d('0x19')][_0x991d('0x1d')],function(_0x2dab97){return{'model':db[_0x2dab97[_0x991d('0x1f')]],'as':_0x2dab97['as'],'attributes':_0x2dab97[_0x991d('0x1b')],'include':_0x2dab97[_0x991d('0x1d')]?_[_0x991d('0x1e')](_0x2dab97[_0x991d('0x1d')],function(_0x49f9fa){return{'model':db[_0x49f9fa['model']],'as':_0x49f9fa['as'],'attributes':_0x49f9fa[_0x991d('0x1b')],'include':_0x49f9fa[_0x991d('0x1d')]?_[_0x991d('0x1e')](_0x49f9fa[_0x991d('0x1d')],function(_0x77d96){return{'model':db[_0x77d96[_0x991d('0x1f')]],'as':_0x77d96['as'],'attributes':_0x77d96[_0x991d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x991d('0xc')](function(_0x5b96d2){logger[_0x991d('0xd')](_0x991d('0x20'),_0x1b45db);logger[_0x991d('0x10')]('GetTrigger',_0x1b45db,JSON[_0x991d('0x12')](_0x5b96d2));_0x1db20c(_0x5b96d2);})[_0x991d('0x21')](function(_0x3548f9){logger[_0x991d('0x13')](_0x991d('0x20'),_0x3548f9[_0x991d('0x15')],_0x1b45db);_0x49e836(_0x38b43d[_0x991d('0x13')](0x1f4,_0x3548f9['message']));});});};exports['ShowTrigger']=function(_0x10746f){var _0x54c763=this;return new Promise(function(_0x20ef05,_0x532a12){return db[_0x991d('0x17')][_0x991d('0x22')]({'raw':_0x10746f[_0x991d('0x19')]?_0x10746f[_0x991d('0x19')][_0x991d('0x23')]===undefined?!![]:![]:!![],'where':_0x10746f[_0x991d('0x19')]?_0x10746f[_0x991d('0x19')][_0x991d('0x1a')]||null:null,'attributes':_0x10746f[_0x991d('0x19')]?_0x10746f[_0x991d('0x19')][_0x991d('0x1b')]||null:null,'include':_0x10746f[_0x991d('0x19')]?_0x10746f[_0x991d('0x19')][_0x991d('0x1d')]?_[_0x991d('0x1e')](_0x10746f['options'][_0x991d('0x1d')],function(_0x279d55){return{'model':db[_0x279d55['model']],'as':_0x279d55['as'],'attributes':_0x279d55[_0x991d('0x1b')],'include':_0x279d55[_0x991d('0x1d')]?_[_0x991d('0x1e')](_0x279d55[_0x991d('0x1d')],function(_0x1714d3){return{'model':db[_0x1714d3[_0x991d('0x1f')]],'as':_0x1714d3['as'],'attributes':_0x1714d3[_0x991d('0x1b')],'include':_0x1714d3['include']?_[_0x991d('0x1e')](_0x1714d3[_0x991d('0x1d')],function(_0x5bb7d7){return{'model':db[_0x5bb7d7[_0x991d('0x1f')]],'as':_0x5bb7d7['as'],'attributes':_0x5bb7d7['attributes']};}):[]};}):[]};}):[]:[]})[_0x991d('0xc')](function(_0x593bf5){logger['info'](_0x991d('0x24'),_0x10746f);logger['debug'](_0x991d('0x24'),_0x10746f,JSON[_0x991d('0x12')](_0x593bf5));_0x20ef05(_0x593bf5);})['catch'](function(_0x2b4d17){logger['error'](_0x991d('0x24'),_0x2b4d17['message'],_0x10746f);_0x532a12(_0x54c763[_0x991d('0x13')](0x1f4,_0x2b4d17[_0x991d('0x15')]));});});}; \ No newline at end of file +var _0x0b7c=['info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','catch','GetTrigger','Trigger','findAll','options','raw','attributes','limit','include','map','model','ShowTrigger','find','where','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x42fc55,_0x392c56){var _0xae146b=function(_0x32c8d6){while(--_0x32c8d6){_0x42fc55['push'](_0x42fc55['shift']());}};_0xae146b(++_0x392c56);}(_0x0b7c,0x175));var _0xc0b7=function(_0xe501ff,_0x955b7e){_0xe501ff=_0xe501ff-0x0;var _0x17135d=_0x0b7c[_0xe501ff];return _0x17135d;};'use strict';var _=require(_0xc0b7('0x0'));var util=require(_0xc0b7('0x1'));var moment=require('moment');var BPromise=require(_0xc0b7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc0b7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc0b7('0x4'));var logger=require(_0xc0b7('0x5'))(_0xc0b7('0x6'));var config=require(_0xc0b7('0x7'));var jayson=require(_0xc0b7('0x8'));var client=jayson[_0xc0b7('0x9')][_0xc0b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d36e1,_0x3fe368,_0x121adc){return new BPromise(function(_0x3b758f,_0xedef56){return client['request'](_0x1d36e1,_0x121adc)[_0xc0b7('0xb')](function(_0x26bab3){logger[_0xc0b7('0xc')]('Trigger,\x20%s,\x20%s',_0x3fe368,_0xc0b7('0xd'));logger[_0xc0b7('0xe')](_0xc0b7('0xf'),_0x3fe368,_0xc0b7('0xd'),JSON[_0xc0b7('0x10')](_0x26bab3));if(_0x26bab3[_0xc0b7('0x11')]){if(_0x26bab3[_0xc0b7('0x11')][_0xc0b7('0x12')]===0x1f4){logger['error'](_0xc0b7('0x13'),_0x3fe368,_0x26bab3['error'][_0xc0b7('0x14')]);return _0xedef56(_0x26bab3[_0xc0b7('0x11')][_0xc0b7('0x14')]);}logger['error'](_0xc0b7('0x13'),_0x3fe368,_0x26bab3['error'][_0xc0b7('0x14')]);return _0x3b758f(_0x26bab3[_0xc0b7('0x11')][_0xc0b7('0x14')]);}else{logger[_0xc0b7('0xc')]('Trigger,\x20%s,\x20%s',_0x3fe368,_0xc0b7('0xd'));_0x3b758f(_0x26bab3['result'][_0xc0b7('0x14')]);}})[_0xc0b7('0x15')](function(_0x12cdcd){logger['error'](_0xc0b7('0x13'),_0x3fe368,_0x12cdcd);_0xedef56(_0x12cdcd);});});}exports[_0xc0b7('0x16')]=function(_0x2e3119){var _0x2b21cb=this;return new Promise(function(_0x2516a7,_0xdc8345){return db[_0xc0b7('0x17')][_0xc0b7('0x18')]({'raw':_0x2e3119['options']?_0x2e3119[_0xc0b7('0x19')][_0xc0b7('0x1a')]===undefined?!![]:![]:!![],'where':_0x2e3119[_0xc0b7('0x19')]?_0x2e3119[_0xc0b7('0x19')]['where']||null:null,'attributes':_0x2e3119[_0xc0b7('0x19')]?_0x2e3119[_0xc0b7('0x19')][_0xc0b7('0x1b')]||null:null,'limit':_0x2e3119['options']?_0x2e3119[_0xc0b7('0x19')][_0xc0b7('0x1c')]||null:null,'include':_0x2e3119['options']?_0x2e3119[_0xc0b7('0x19')][_0xc0b7('0x1d')]?_[_0xc0b7('0x1e')](_0x2e3119['options']['include'],function(_0x31fa89){return{'model':db[_0x31fa89['model']],'as':_0x31fa89['as'],'attributes':_0x31fa89['attributes'],'include':_0x31fa89[_0xc0b7('0x1d')]?_[_0xc0b7('0x1e')](_0x31fa89[_0xc0b7('0x1d')],function(_0x47e270){return{'model':db[_0x47e270[_0xc0b7('0x1f')]],'as':_0x47e270['as'],'attributes':_0x47e270[_0xc0b7('0x1b')],'include':_0x47e270[_0xc0b7('0x1d')]?_[_0xc0b7('0x1e')](_0x47e270[_0xc0b7('0x1d')],function(_0x6ccc22){return{'model':db[_0x6ccc22[_0xc0b7('0x1f')]],'as':_0x6ccc22['as'],'attributes':_0x6ccc22[_0xc0b7('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x473873){logger[_0xc0b7('0xc')](_0xc0b7('0x16'),_0x2e3119);logger[_0xc0b7('0xe')](_0xc0b7('0x16'),_0x2e3119,JSON[_0xc0b7('0x10')](_0x473873));_0x2516a7(_0x473873);})[_0xc0b7('0x15')](function(_0x387d5e){logger[_0xc0b7('0x11')]('GetTrigger',_0x387d5e['message'],_0x2e3119);_0xdc8345(_0x2b21cb[_0xc0b7('0x11')](0x1f4,_0x387d5e[_0xc0b7('0x14')]));});});};exports[_0xc0b7('0x20')]=function(_0xc0aeda){var _0x2b5d70=this;return new Promise(function(_0x2d7a4f,_0x1d8f5d){return db['Trigger'][_0xc0b7('0x21')]({'raw':_0xc0aeda[_0xc0b7('0x19')]?_0xc0aeda['options'][_0xc0b7('0x1a')]===undefined?!![]:![]:!![],'where':_0xc0aeda[_0xc0b7('0x19')]?_0xc0aeda[_0xc0b7('0x19')][_0xc0b7('0x22')]||null:null,'attributes':_0xc0aeda[_0xc0b7('0x19')]?_0xc0aeda[_0xc0b7('0x19')]['attributes']||null:null,'include':_0xc0aeda['options']?_0xc0aeda[_0xc0b7('0x19')][_0xc0b7('0x1d')]?_[_0xc0b7('0x1e')](_0xc0aeda['options'][_0xc0b7('0x1d')],function(_0x1bc297){return{'model':db[_0x1bc297[_0xc0b7('0x1f')]],'as':_0x1bc297['as'],'attributes':_0x1bc297[_0xc0b7('0x1b')],'include':_0x1bc297[_0xc0b7('0x1d')]?_['map'](_0x1bc297[_0xc0b7('0x1d')],function(_0x103ac3){return{'model':db[_0x103ac3['model']],'as':_0x103ac3['as'],'attributes':_0x103ac3[_0xc0b7('0x1b')],'include':_0x103ac3[_0xc0b7('0x1d')]?_[_0xc0b7('0x1e')](_0x103ac3['include'],function(_0x3ffca9){return{'model':db[_0x3ffca9[_0xc0b7('0x1f')]],'as':_0x3ffca9['as'],'attributes':_0x3ffca9[_0xc0b7('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52e633){logger[_0xc0b7('0xc')](_0xc0b7('0x20'),_0xc0aeda);logger[_0xc0b7('0xe')]('ShowTrigger',_0xc0aeda,JSON[_0xc0b7('0x10')](_0x52e633));_0x2d7a4f(_0x52e633);})['catch'](function(_0x5cd4d0){logger[_0xc0b7('0x11')](_0xc0b7('0x20'),_0x5cd4d0[_0xc0b7('0x14')],_0xc0aeda);_0x1d8f5d(_0x2b5d70['error'](0x1f4,_0x5cd4d0[_0xc0b7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index ee3efff..f613721 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 _0xaed4=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','get','/:id','show','post','/:id/clone','clone','delete','destroy','util'];(function(_0x874709,_0x20b492){var _0x351b20=function(_0x87c907){while(--_0x87c907){_0x874709['push'](_0x874709['shift']());}};_0x351b20(++_0x20b492);}(_0xaed4,0x1db));var _0x4aed=function(_0x5d8fbc,_0x103696){_0x5d8fbc=_0x5d8fbc-0x0;var _0x364a05=_0xaed4[_0x5d8fbc];return _0x364a05;};'use strict';var multer=require('multer');var util=require(_0x4aed('0x0'));var path=require(_0x4aed('0x1'));var timeout=require(_0x4aed('0x2'));var express=require(_0x4aed('0x3'));var router=express[_0x4aed('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4aed('0x5'));var config=require(_0x4aed('0x6'));var controller=require(_0x4aed('0x7'));router['get']('/',auth[_0x4aed('0x8')](),controller['index']);router[_0x4aed('0x9')](_0x4aed('0xa'),auth[_0x4aed('0x8')](),controller[_0x4aed('0xb')]);router[_0x4aed('0xc')](_0x4aed('0xd'),auth[_0x4aed('0x8')](),controller[_0x4aed('0xe')]);router[_0x4aed('0xc')]('/',auth[_0x4aed('0x8')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x4aed('0xf')](_0x4aed('0xa'),auth[_0x4aed('0x8')](),controller[_0x4aed('0x10')]);module['exports']=router; \ No newline at end of file +var _0x977a=['show','/:id/clone','clone','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','isAuthenticated','index','/:id'];(function(_0x2f4d07,_0x3c1c9c){var _0x5a9ec3=function(_0x419f4b){while(--_0x419f4b){_0x2f4d07['push'](_0x2f4d07['shift']());}};_0x5a9ec3(++_0x3c1c9c);}(_0x977a,0xfc));var _0xa977=function(_0x4093b8,_0x1fb72f){_0x4093b8=_0x4093b8-0x0;var _0x203449=_0x977a[_0x4093b8];return _0x203449;};'use strict';var multer=require('multer');var util=require(_0xa977('0x0'));var path=require(_0xa977('0x1'));var timeout=require(_0xa977('0x2'));var express=require(_0xa977('0x3'));var router=express[_0xa977('0x4')]();var auth=require(_0xa977('0x5'));var interaction=require(_0xa977('0x6'));var config=require('../../config/environment');var controller=require(_0xa977('0x7'));router[_0xa977('0x8')]('/',auth[_0xa977('0x9')](),controller[_0xa977('0xa')]);router[_0xa977('0x8')](_0xa977('0xb'),auth[_0xa977('0x9')](),controller[_0xa977('0xc')]);router['post'](_0xa977('0xd'),auth['isAuthenticated'](),controller[_0xa977('0xe')]);router[_0xa977('0xf')]('/',auth[_0xa977('0x9')](),controller[_0xa977('0x10')]);router[_0xa977('0x11')](_0xa977('0xb'),auth[_0xa977('0x9')](),controller[_0xa977('0x12')]);router[_0xa977('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xa977('0x14')]);module[_0xa977('0x15')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index cd7b143..a65b97a 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(_0x4f3722,_0x183736){var _0x30cdad=function(_0x99f103){while(--_0x99f103){_0x4f3722['push'](_0x4f3722['shift']());}};_0x30cdad(++_0x183736);}(_0x757a,0xde));var _0xa757=function(_0x2d29d0,_0xeb7d9e){_0x2d29d0=_0x2d29d0-0x0;var _0x17c467=_0x757a[_0x2d29d0];return _0x17c467;};'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 _0xd8b0=['update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','accept','originate','uac','uas','pai','active','passive','dynamic','update,nonat','BOOLEAN','sequelize','exports','friend','user','peer','STRING','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','rfc2833','info','shortinfo','inband','auto','yes','nonat'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_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')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0d8b('0x2'),_0x0d8b('0x3'),_0x0d8b('0x4')),'allowNull':![],'defaultValue':_0x0d8b('0x2')},'context':{'type':Sequelize[_0x0d8b('0x5')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0x0d8b('0x6'),_0x0d8b('0x7'),_0x0d8b('0x8'),'ALLOWED',_0x0d8b('0x9'),_0x0d8b('0xa'),'PROHIB_FAILED_SCREEN',_0x0d8b('0xb'))},'deny':{'type':Sequelize[_0x0d8b('0x5')]},'permit':{'type':Sequelize[_0x0d8b('0x5')]},'secret':{'type':Sequelize[_0x0d8b('0x5')]},'md5secret':{'type':Sequelize[_0x0d8b('0x5')]},'remotesecret':{'type':Sequelize[_0x0d8b('0x5')]},'transport':{'type':Sequelize[_0x0d8b('0x5')],'defaultValue':_0x0d8b('0xc'),'set':function(_0x48fa16){this[_0x0d8b('0xd')]('transport',_0x48fa16?_0x48fa16[_0x0d8b('0xe')](','):null);},'get':function(){return this[_0x0d8b('0xf')](_0x0d8b('0x10'))?this[_0x0d8b('0xf')](_0x0d8b('0x10'))[_0x0d8b('0x11')](','):null;},'comment':_0x0d8b('0x12')},'dtmfmode':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x14'),_0x0d8b('0x15'),_0x0d8b('0x16'),_0x0d8b('0x17'),_0x0d8b('0x18')),'defaultValue':_0x0d8b('0x14')},'directmedia':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no',_0x0d8b('0x1a'),_0x0d8b('0x1b'),_0x0d8b('0x1c')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0d8b('0x13')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0d8b('0x5')]},'directmediadeny':{'type':Sequelize[_0x0d8b('0x5')]},'nat':{'type':Sequelize[_0x0d8b('0x5')],'defaultValue':_0x0d8b('0x1d'),'set':function(_0x333674){this[_0x0d8b('0xd')](_0x0d8b('0x1e'),_0x333674?_0x333674[_0x0d8b('0xe')](','):null);},'get':function(){return this['getDataValue'](_0x0d8b('0x1e'))?this[_0x0d8b('0xf')](_0x0d8b('0x1e'))[_0x0d8b('0x11')](','):null;},'comment':_0x0d8b('0x1f')},'callgroup':{'type':Sequelize[_0x0d8b('0x5')]},'namedcallgroup':{'type':Sequelize[_0x0d8b('0x5')]},'pickupgroup':{'type':Sequelize[_0x0d8b('0x5')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0d8b('0x5')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0d8b('0x20'),'set':function(_0x2b924f){this[_0x0d8b('0xd')](_0x0d8b('0x21'),_0x2b924f?_0x2b924f[_0x0d8b('0xe')](';'):_0x0d8b('0x20'));},'get':function(){return this[_0x0d8b('0xf')](_0x0d8b('0x21'))?this[_0x0d8b('0xf')]('allow')[_0x0d8b('0x11')](';'):null;},'comment':_0x0d8b('0x22')},'autoframing':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x0d8b('0x23'),'set':function(_0x234bdd){this[_0x0d8b('0xd')]('insecure',_0x234bdd?_0x234bdd['join'](','):null);},'get':function(){return this[_0x0d8b('0xf')](_0x0d8b('0x24'))?this['getDataValue'](_0x0d8b('0x24'))['split'](','):null;},'comment':_0x0d8b('0x25')},'trustrpid':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no','never')},'promiscredir':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'useclientcode':{'type':Sequelize[_0x0d8b('0x13')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x0d8b('0x5')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x0d8b('0x5')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x0d8b('0x19')},'busylevel':{'type':Sequelize[_0x0d8b('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0x0d8b('0x5')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no',_0x0d8b('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'mailbox':{'type':Sequelize[_0x0d8b('0x5')]},'session_timers':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x28'),'refuse',_0x0d8b('0x29'))},'session_expires':{'type':Sequelize[_0x0d8b('0x26')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x2a'),_0x0d8b('0x2b')),'defaultValue':_0x0d8b('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x0d8b('0x5')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x0d8b('0x5')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no'),'defaultValue':_0x0d8b('0x19')},'keepalive':{'type':Sequelize[_0x0d8b('0x26')](0xb)},'defaultip':{'type':Sequelize[_0x0d8b('0x5')]},'defaultuser':{'type':Sequelize[_0x0d8b('0x5')]},'rtptimeout':{'type':Sequelize[_0x0d8b('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x0d8b('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no',_0x0d8b('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0d8b('0x5')]},'callbackextension':{'type':Sequelize[_0x0d8b('0x5')]},'timert1':{'type':Sequelize[_0x0d8b('0x26')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x0d8b('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x0d8b('0x5')]},'contactdeny':{'type':Sequelize[_0x0d8b('0x5')]},'contactacl':{'type':Sequelize[_0x0d8b('0x5')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x0d8b('0x5')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'force_avp':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'icesupport':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x0d8b('0x5')]},'dtlsprivatekey':{'type':Sequelize[_0x0d8b('0x5')]},'dtlscipher':{'type':Sequelize[_0x0d8b('0x5')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x2d'),_0x0d8b('0x2e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0d8b('0x5')]},'usereqphone':{'type':Sequelize[_0x0d8b('0x13')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x0d8b('0x5')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x0d8b('0x13')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no')},'vmexten':{'type':Sequelize[_0x0d8b('0x5')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x0d8b('0x5')],'defaultValue':_0x0d8b('0x2f')},'canreinvite':{'type':Sequelize[_0x0d8b('0x13')]('yes','no',_0x0d8b('0x1a'),_0x0d8b('0x1b'),_0x0d8b('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x0d8b('0x5')]},'otherFields':{'type':Sequelize[_0x0d8b('0x5')]},'active':{'type':Sequelize[_0x0d8b('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x0d8b('0x5')],'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 1ffc3b8..aced87d 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 _0xea1e=['join','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','server/files/templates/registry.ejs','chan_sip.so','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','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','Trunk,\x20%s,\x20%s,\x20%s','error','code','Trunk,\x20%s,\x20%s','message','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','get','Trunks','UserProfileResource','name','index','Trunk','rawAttributes','keys','query','filters','model','intersection','length','hasOwnProperty','order','sort','where','filter','merge','map','type','key','field','options','includeAll','include','findAll','show','attributes','fields','find','catch','clone','params','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','server/files/templates/trunk.ejs'];(function(_0x22532e,_0xcbeaed){var _0x3ce18b=function(_0x57adde){while(--_0x57adde){_0x22532e['push'](_0x22532e['shift']());}};_0x3ce18b(++_0xcbeaed);}(_0xea1e,0x1be));var _0xeea1=function(_0x84d696,_0x35a3e0){_0x84d696=_0x84d696-0x0;var _0x5cdf79=_0xea1e[_0x84d696];return _0x5cdf79;};'use strict';var pdf=require(_0xeea1('0x0'));var emlformat=require(_0xeea1('0x1'));var rimraf=require(_0xeea1('0x2'));var zipdir=require(_0xeea1('0x3'));var jsonpatch=require(_0xeea1('0x4'));var rp=require(_0xeea1('0x5'));var moment=require(_0xeea1('0x6'));var BPromise=require(_0xeea1('0x7'));var Mustache=require(_0xeea1('0x8'));var util=require(_0xeea1('0x9'));var path=require('path');var sox=require(_0xeea1('0xa'));var csv=require(_0xeea1('0xb'));var ejs=require(_0xeea1('0xc'));var fs=require('fs');var _=require(_0xeea1('0xd'));var squel=require(_0xeea1('0xe'));var crypto=require(_0xeea1('0xf'));var jsforce=require(_0xeea1('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xeea1('0xb'));var querystring=require(_0xeea1('0x11'));var Papa=require(_0xeea1('0x12'));var Redis=require('ioredis');var authService=require(_0xeea1('0x13'));var qs=require(_0xeea1('0x14'));var hardwareService=require(_0xeea1('0x15'));var logger=require(_0xeea1('0x16'))('api');var utils=require(_0xeea1('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xeea1('0x18')][_0xeea1('0x19')]({'port':0x232a});function checkPasswordPattern(_0x1e510a,_0x323c1d,_0x479409){if(_0x479409){var _0x3515a0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3515a0[_0xeea1('0x1a')](_0x323c1d)){return _0x1e510a;}else{throw new Error(_0xeea1('0x1b'));}}else{return _0x1e510a;}}function respondWithRpcPromise(_0x5e7117,_0x47b3de,_0x3085ce,_0xc358ff){return new BPromise(function(_0x32e3bf,_0x2e2979){var _0x46210f=_0xc358ff||client;return _0x46210f[_0xeea1('0x1c')](_0x5e7117,_0x3085ce)[_0xeea1('0x1d')](function(_0x5de0c8){logger[_0xeea1('0x1e')]('Trunk,\x20%s,\x20%s',_0x47b3de,_0xeea1('0x1f'));logger['debug'](_0xeea1('0x20'),_0x47b3de,_0xeea1('0x1f'),JSON['stringify'](_0x5de0c8));if(_0x5de0c8['error']){if(_0x5de0c8[_0xeea1('0x21')][_0xeea1('0x22')]===0x1f4){logger[_0xeea1('0x21')](_0xeea1('0x23'),_0x47b3de,_0x5de0c8[_0xeea1('0x21')][_0xeea1('0x24')]);return _0x2e2979(_0x5de0c8[_0xeea1('0x21')][_0xeea1('0x24')]);}logger[_0xeea1('0x21')](_0xeea1('0x23'),_0x47b3de,_0x5de0c8[_0xeea1('0x21')][_0xeea1('0x24')]);return _0x32e3bf(_0x5de0c8[_0xeea1('0x21')]['message']);}else{logger[_0xeea1('0x1e')](_0xeea1('0x23'),_0x47b3de,_0xeea1('0x1f'));_0x32e3bf(_0x5de0c8['result'][_0xeea1('0x24')]);}})['catch'](function(_0x3a1f09){logger[_0xeea1('0x21')](_0xeea1('0x23'),_0x47b3de,_0x3a1f09);_0x2e2979(_0x3a1f09);});});}function respondWithStatusCode(_0x2c11dc,_0x3d5394){_0x3d5394=_0x3d5394||0xcc;return function(_0x13c96e){if(_0x13c96e){return _0x2c11dc[_0xeea1('0x25')](_0x3d5394);}return _0x2c11dc[_0xeea1('0x26')](_0x3d5394)[_0xeea1('0x27')]();};}function respondWithResult(_0x3b7e8a,_0x5bfb10){_0x5bfb10=_0x5bfb10||0xc8;return function(_0x54ab0f){if(_0x54ab0f){return _0x3b7e8a[_0xeea1('0x26')](_0x5bfb10)[_0xeea1('0x28')](_0x54ab0f);}};}function respondWithFilteredResult(_0x4b6f53,_0x5bacb2){return function(_0x375c34){if(_0x375c34){var _0x41ad8a=_0x375c34[_0xeea1('0x29')],_0x33bfa4=_0x5bacb2[_0xeea1('0x2a')],_0x508c77=_0x5bacb2['offset']+_0x5bacb2[_0xeea1('0x2b')],_0x9b642f;if(_0x508c77>=_0x41ad8a){_0x508c77=_0x41ad8a;_0x9b642f=0xc8;}else{_0x9b642f=0xce;}_0x4b6f53[_0xeea1('0x26')](_0x9b642f);return _0x4b6f53[_0xeea1('0x2c')]('Content-Range',_0x33bfa4+'-'+_0x508c77+'/'+_0x41ad8a)[_0xeea1('0x28')](_0x375c34);}return null;};}function patchUpdates(_0x503349){return function(_0x1cf8d7){try{jsonpatch[_0xeea1('0x2d')](_0x1cf8d7,_0x503349,!![]);}catch(_0x1142cc){return BPromise[_0xeea1('0x2e')](_0x1142cc);}return _0x1cf8d7[_0xeea1('0x2f')]();};}function saveUpdates(_0x16c883,_0x203d06){return function(_0x409871){if(_0x409871){return _0x409871[_0xeea1('0x30')](_0x16c883)[_0xeea1('0x1d')](function(_0x12c8b2){return _0x12c8b2;});}return null;};}function removeEntity(_0x428e30,_0x47d41e){return function(_0xc252bd){if(_0xc252bd){return _0xc252bd[_0xeea1('0x31')]()['then'](function(){var _0x203892=_0xc252bd[_0xeea1('0x32')]({'plain':!![]});var _0x2514bd=_0xeea1('0x33');return db[_0xeea1('0x34')]['destroy']({'where':{'type':_0x2514bd,'resourceId':_0x203892['id']}})[_0xeea1('0x1d')](function(){return _0xc252bd;});})[_0xeea1('0x1d')](function(){_0x428e30[_0xeea1('0x26')](0xcc)[_0xeea1('0x27')]();});}};}function handleEntityNotFound(_0x130a14,_0xcb7342){return function(_0x49bbe0){if(!_0x49bbe0){_0x130a14['sendStatus'](0x194);}return _0x49bbe0;};}function handleError(_0x4d1237,_0x574fbc){_0x574fbc=_0x574fbc||0x1f4;return function(_0x414ece){logger[_0xeea1('0x21')](_0x414ece['stack']);if(_0x414ece[_0xeea1('0x35')]){delete _0x414ece[_0xeea1('0x35')];}_0x4d1237[_0xeea1('0x26')](_0x574fbc)['send'](_0x414ece);};}exports[_0xeea1('0x36')]=function(_0x3928a5,_0x4a14e0){var _0x5f28ef={},_0x41087e={},_0xf8f90b={'count':0x0,'rows':[]};var _0x435e2b=db[_0xeea1('0x37')][_0xeea1('0x38')];_0x41087e['model']=_[_0xeea1('0x39')](_0x435e2b);_0x41087e[_0xeea1('0x3a')]=_[_0xeea1('0x39')](_0x3928a5['query']);_0x41087e[_0xeea1('0x3b')]=_['intersection'](_0x41087e[_0xeea1('0x3c')],_0x41087e[_0xeea1('0x3a')]);_0x5f28ef['attributes']=_[_0xeea1('0x3d')](_0x41087e[_0xeea1('0x3c')],qs['fields'](_0x3928a5[_0xeea1('0x3a')]['fields']));_0x5f28ef['attributes']=_0x5f28ef['attributes'][_0xeea1('0x3e')]?_0x5f28ef['attributes']:_0x41087e[_0xeea1('0x3c')];if(!_0x3928a5[_0xeea1('0x3a')][_0xeea1('0x3f')]('nolimit')){_0x5f28ef[_0xeea1('0x2b')]=qs['limit'](_0x3928a5[_0xeea1('0x3a')][_0xeea1('0x2b')]);_0x5f28ef[_0xeea1('0x2a')]=qs['offset'](_0x3928a5[_0xeea1('0x3a')]['offset']);}_0x5f28ef[_0xeea1('0x40')]=qs[_0xeea1('0x41')](_0x3928a5['query'][_0xeea1('0x41')]);_0x5f28ef[_0xeea1('0x42')]=qs[_0xeea1('0x3b')](_['pick'](_0x3928a5[_0xeea1('0x3a')],_0x41087e['filters']));if(_0x3928a5['query'][_0xeea1('0x43')]){_0x5f28ef[_0xeea1('0x42')]=_[_0xeea1('0x44')](_0x5f28ef[_0xeea1('0x42')],{'$or':_[_0xeea1('0x45')](_0x435e2b,function(_0x23b1c7){if(_0x23b1c7[_0xeea1('0x46')][_0xeea1('0x47')]!=='VIRTUAL'){var _0x5ce835={};_0x5ce835[_0x23b1c7[_0xeea1('0x48')]]={'$like':'%'+_0x3928a5[_0xeea1('0x3a')][_0xeea1('0x43')]+'%'};return _0x5ce835;}})});}_0x5f28ef=_['merge']({},_0x5f28ef,_0x3928a5[_0xeea1('0x49')]);var _0x4f165c={'where':_0x5f28ef[_0xeea1('0x42')]};return db['Trunk'][_0xeea1('0x29')](_0x4f165c)['then'](function(_0x3e14e9){_0xf8f90b[_0xeea1('0x29')]=_0x3e14e9;if(_0x3928a5['query'][_0xeea1('0x4a')]){_0x5f28ef[_0xeea1('0x4b')]=[{'all':!![]}];}return db[_0xeea1('0x37')][_0xeea1('0x4c')](_0x5f28ef);})[_0xeea1('0x1d')](function(_0x15fc7b){_0xf8f90b['rows']=_0x15fc7b;return _0xf8f90b;})[_0xeea1('0x1d')](respondWithFilteredResult(_0x4a14e0,_0x5f28ef))['catch'](handleError(_0x4a14e0,null));};exports[_0xeea1('0x4d')]=function(_0x38cb11,_0x354e94){var _0x41d6f8={'raw':![],'where':{'id':_0x38cb11['params']['id']}},_0x5bd18c={};_0x5bd18c[_0xeea1('0x3c')]=_[_0xeea1('0x39')](db[_0xeea1('0x37')]['rawAttributes']);_0x5bd18c[_0xeea1('0x3a')]=_[_0xeea1('0x39')](_0x38cb11['query']);_0x5bd18c['filters']=_[_0xeea1('0x3d')](_0x5bd18c[_0xeea1('0x3c')],_0x5bd18c['query']);_0x41d6f8[_0xeea1('0x4e')]=_[_0xeea1('0x3d')](_0x5bd18c['model'],qs[_0xeea1('0x4f')](_0x38cb11[_0xeea1('0x3a')][_0xeea1('0x4f')]));_0x41d6f8[_0xeea1('0x4e')]=_0x41d6f8[_0xeea1('0x4e')][_0xeea1('0x3e')]?_0x41d6f8[_0xeea1('0x4e')]:_0x5bd18c[_0xeea1('0x3c')];if(_0x38cb11[_0xeea1('0x3a')][_0xeea1('0x4a')]){_0x41d6f8[_0xeea1('0x4b')]=[{'all':!![]}];}_0x41d6f8=_[_0xeea1('0x44')]({},_0x41d6f8,_0x38cb11['options']);return db['Trunk'][_0xeea1('0x50')](_0x41d6f8)[_0xeea1('0x1d')](handleEntityNotFound(_0x354e94,null))[_0xeea1('0x1d')](respondWithResult(_0x354e94,null))[_0xeea1('0x51')](handleError(_0x354e94,null));};exports[_0xeea1('0x52')]=function(_0x31605e,_0x26c097){var _0xf609df={'raw':![],'where':{'id':_0x31605e[_0xeea1('0x53')]['id']}},_0x5e289d={};_0x5e289d[_0xeea1('0x3c')]=_[_0xeea1('0x39')](db[_0xeea1('0x37')][_0xeea1('0x38')]);_0xf609df[_0xeea1('0x4e')]=_[_0xeea1('0x3d')](_0x5e289d['model'],qs['fields'](_0x31605e[_0xeea1('0x3a')][_0xeea1('0x4f')]));_0xf609df[_0xeea1('0x4e')]=_0xf609df['attributes'][_0xeea1('0x3e')]?_0xf609df['attributes']:_0x5e289d[_0xeea1('0x3c')];if(_0x31605e[_0xeea1('0x3a')][_0xeea1('0x4a')]){_0xf609df[_0xeea1('0x4b')]=[{'all':!![]}];}_0xf609df=_[_0xeea1('0x44')]({},_0xf609df,_0x31605e['options']);return db[_0xeea1('0x37')][_0xeea1('0x50')](_0xf609df)[_0xeea1('0x1d')](handleEntityNotFound(_0x26c097,null))['then'](function(_0x4c9b5b){if(_0x4c9b5b){var _0x367c27=_0x4c9b5b['get']({'plain':!![]});_0x367c27=qs[_0xeea1('0x54')](_0x367c27,['id',_0xeea1('0x55'),_0xeea1('0x56')]);_0x31605e[_0xeea1('0x57')]=_[_0xeea1('0x54')](_0x31605e[_0xeea1('0x57')],['id',_0xeea1('0x55'),_0xeea1('0x56')]);return db[_0xeea1('0x37')][_0xeea1('0x58')](_[_0xeea1('0x44')](_0x367c27,_0x31605e[_0xeea1('0x57')]),{'include':_0x31605e[_0xeea1('0x3a')][_0xeea1('0x4a')]?[{'all':!![]}]:undefined})[_0xeea1('0x1d')](function(_0x1031d2){var _0x4958cb=_0x31605e[_0xeea1('0x59')]['get']({'plain':!![]});if(!_0x4958cb)throw new Error(_0xeea1('0x5a'));if(_0x4958cb[_0xeea1('0x5b')]===_0xeea1('0x59')){var _0x1f9b4e=_0x1031d2[_0xeea1('0x32')]({'plain':!![]});var _0x2660c3='Trunks';return db[_0xeea1('0x5c')]['find']({'where':{'name':_0x2660c3,'userProfileId':_0x4958cb[_0xeea1('0x5d')]},'raw':!![]})[_0xeea1('0x1d')](function(_0x255865){if(_0x255865&&_0x255865[_0xeea1('0x5e')]===0x0){return db['UserProfileResource'][_0xeea1('0x58')]({'name':_0x1f9b4e[_0xeea1('0x35')],'resourceId':_0x1f9b4e['id'],'type':_0x255865[_0xeea1('0x35')],'sectionId':_0x255865['id']},{})[_0xeea1('0x1d')](function(){return _0x1031d2;});}else{return _0x1031d2;}})[_0xeea1('0x51')](function(_0x409120){logger['error'](_0xeea1('0x5f'),_0x409120);throw _0x409120;});}return _0x1031d2;});}})[_0xeea1('0x1d')](respondWithResult(_0x26c097,0xc9))[_0xeea1('0x51')](handleError(_0x26c097,null));};exports[_0xeea1('0x58')]=function(_0x5422bc,_0x3e7c62,_0x3109a6){var _0x3f6b1d;return db[_0xeea1('0x37')]['create'](_0x5422bc[_0xeea1('0x57')],{'raw':!![]})['then'](function(_0x5a7abb){_0x3f6b1d=_0x5a7abb;return db[_0xeea1('0x37')]['findAll']({'raw':!![]});})[_0xeea1('0x1d')](function(_0x10a08b){var _0x1b273b=fs[_0xeea1('0x60')](path['join'](config[_0xeea1('0x61')],_0xeea1('0x62')),'utf8');var _0x58f528=fs[_0xeea1('0x60')](path[_0xeea1('0x63')](config[_0xeea1('0x61')],'server/files/templates/registry.ejs'),_0xeea1('0x64'));var _0x4139d1=ejs[_0xeea1('0x65')](_0x1b273b,{'trunks':_0x10a08b||[]});fs[_0xeea1('0x66')](_0xeea1('0x67'),_0x4139d1);if(_0x3f6b1d[_0xeea1('0x68')]){var _0x4685d0=ejs[_0xeea1('0x65')](_0x58f528,{'trunks':_0x10a08b||[]});fs['writeFileSync'](_0xeea1('0x69'),_0x4685d0);}})[_0xeea1('0x1d')](function(){return respondWithRpcPromise(_0xeea1('0x6a'),_0xeea1('0x58'),{'module':'chan_sip.so'});})[_0xeea1('0x1d')](function(){var _0x5d3d74=_0x5422bc[_0xeea1('0x59')][_0xeea1('0x32')]({'plain':!![]});if(!_0x5d3d74)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d3d74[_0xeea1('0x5b')]===_0xeea1('0x59')){var _0x401d96=_0x3f6b1d[_0xeea1('0x32')]({'plain':!![]});return db[_0xeea1('0x5c')][_0xeea1('0x50')]({'where':{'name':_0xeea1('0x33'),'userProfileId':_0x5d3d74[_0xeea1('0x5d')]},'raw':!![]})[_0xeea1('0x1d')](function(_0x1b6512){if(_0x1b6512&&_0x1b6512['autoAssociation']===0x0){return db[_0xeea1('0x34')][_0xeea1('0x58')]({'name':_0x401d96['name'],'resourceId':_0x401d96['id'],'type':_0x1b6512[_0xeea1('0x35')],'sectionId':_0x1b6512['id']},{})[_0xeea1('0x1d')](function(){return _0x3f6b1d;});}else{return _0x3f6b1d;}})[_0xeea1('0x51')](function(_0x168930){logger[_0xeea1('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x168930);throw _0x168930;});}return _0x3f6b1d;})[_0xeea1('0x1d')](respondWithResult(_0x3e7c62,0xc9))[_0xeea1('0x51')](handleError(_0x3e7c62,null));};exports[_0xeea1('0x30')]=function(_0x9ede9c,_0x461764,_0x36ff25){var _0x28c6b9;return db[_0xeea1('0x37')][_0xeea1('0x50')]({'where':{'id':_0x9ede9c[_0xeea1('0x53')]['id']}})['then'](handleEntityNotFound(_0x461764,null))[_0xeea1('0x1d')](saveUpdates(_0x9ede9c[_0xeea1('0x57')],null))[_0xeea1('0x1d')](function(_0x284da5){if(_0x284da5){_0x28c6b9=_0x284da5;return db[_0xeea1('0x37')][_0xeea1('0x4c')]({'raw':!![]});}})['then'](function(_0x4ae24e){if(_0x4ae24e){var _0x1358a0=fs[_0xeea1('0x60')](path[_0xeea1('0x63')](config['root'],_0xeea1('0x62')),_0xeea1('0x64'));var _0x135a2d=fs[_0xeea1('0x60')](path['join'](config[_0xeea1('0x61')],_0xeea1('0x6b')),_0xeea1('0x64'));var _0x49dc93=ejs[_0xeea1('0x65')](_0x1358a0,{'trunks':_0x4ae24e||[]});fs[_0xeea1('0x66')](_0xeea1('0x67'),_0x49dc93);var _0x2cc560=ejs[_0xeea1('0x65')](_0x135a2d,{'trunks':_0x4ae24e||[]});fs['writeFileSync'](_0xeea1('0x69'),_0x2cc560);return respondWithRpcPromise(_0xeea1('0x6a'),_0xeea1('0x30'),{'module':_0xeea1('0x6c')});}return null;})['then'](function(_0xf6833f){if(_0xf6833f){return _0x28c6b9;}})[_0xeea1('0x1d')](respondWithResult(_0x461764,null))[_0xeea1('0x51')](handleError(_0x461764,null));};exports[_0xeea1('0x31')]=function(_0x3eac8a,_0x155d9c,_0x3f9dda){var _0x121c81;return db['Trunk'][_0xeea1('0x50')]({'where':{'id':_0x3eac8a[_0xeea1('0x53')]['id']}})[_0xeea1('0x1d')](handleEntityNotFound(_0x155d9c,null))[_0xeea1('0x1d')](removeEntity(_0x155d9c,null))[_0xeea1('0x1d')](function(){return db['Trunk'][_0xeea1('0x4c')]({'raw':!![]});})[_0xeea1('0x1d')](function(_0x23721b){var _0x1358a9=fs[_0xeea1('0x60')](path[_0xeea1('0x63')](config[_0xeea1('0x61')],'server/files/templates/trunk.ejs'),_0xeea1('0x64'));var _0x41f4e6=fs['readFileSync'](path['join'](config[_0xeea1('0x61')],_0xeea1('0x6b')),_0xeea1('0x64'));var _0x4a3303=ejs[_0xeea1('0x65')](_0x1358a9,{'trunks':_0x23721b});var _0xb3bb8b=ejs['render'](_0x41f4e6,{'trunks':_0x23721b});fs[_0xeea1('0x66')](_0xeea1('0x67'),_0x4a3303);fs[_0xeea1('0x66')]('/etc/asterisk/sip_xcally_registers.conf',_0xb3bb8b);return respondWithRpcPromise(_0xeea1('0x6a'),_0xeea1('0x31'),{'module':_0xeea1('0x6c')});})[_0xeea1('0x51')](handleError(_0x155d9c,null));}; \ No newline at end of file +var _0xad3f=['type','VIRTUAL','field','options','count','includeAll','findAll','rows','catch','show','include','find','clone','params','rawAttributes','createdAt','updatedAt','omit','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_trunks.conf','render','writeFileSync','Reload','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../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~!@#$%^&-_=+[{]}.','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','status','end','json','offset','limit','Content-Range','apply','save','update','destroy','get','Trunks','UserProfileResource','then','sendStatus','name','send','index','Trunk','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map'];(function(_0x36f8c5,_0x173213){var _0x3dee1a=function(_0x575953){while(--_0x575953){_0x36f8c5['push'](_0x36f8c5['shift']());}};_0x3dee1a(++_0x173213);}(_0xad3f,0x105));var _0xfad3=function(_0x3fbbe7,_0x503fe7){_0x3fbbe7=_0x3fbbe7-0x0;var _0x200d07=_0xad3f[_0x3fbbe7];return _0x200d07;};'use strict';var pdf=require(_0xfad3('0x0'));var emlformat=require(_0xfad3('0x1'));var rimraf=require(_0xfad3('0x2'));var zipdir=require(_0xfad3('0x3'));var jsonpatch=require(_0xfad3('0x4'));var rp=require(_0xfad3('0x5'));var moment=require('moment');var BPromise=require(_0xfad3('0x6'));var Mustache=require('mustache');var util=require(_0xfad3('0x7'));var path=require(_0xfad3('0x8'));var sox=require(_0xfad3('0x9'));var csv=require(_0xfad3('0xa'));var ejs=require(_0xfad3('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xfad3('0xc'));var crypto=require(_0xfad3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfad3('0xe'));var toCsv=require(_0xfad3('0xa'));var querystring=require('querystring');var Papa=require(_0xfad3('0xf'));var Redis=require(_0xfad3('0x10'));var authService=require(_0xfad3('0x11'));var qs=require(_0xfad3('0x12'));var hardwareService=require(_0xfad3('0x13'));var logger=require(_0xfad3('0x14'))(_0xfad3('0x15'));var utils=require('../../config/utils');var config=require(_0xfad3('0x16'));var db=require(_0xfad3('0x17'))['db'];var jayson=require(_0xfad3('0x18'));var client=jayson[_0xfad3('0x19')][_0xfad3('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x3757c6,_0x9de8b1,_0x4e9675){if(_0x4e9675){var _0x1a51aa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1a51aa[_0xfad3('0x1b')](_0x9de8b1)){return _0x3757c6;}else{throw new Error(_0xfad3('0x1c'));}}else{return _0x3757c6;}}function respondWithRpcPromise(_0x429be8,_0x19a7e5,_0xf7e64e,_0x3604ea){return new BPromise(function(_0x39ddc2,_0x553aed){var _0x18bf69=_0x3604ea||client;return _0x18bf69['request'](_0x429be8,_0xf7e64e)['then'](function(_0x49966d){logger['info'](_0xfad3('0x1d'),_0x19a7e5,'request\x20sent');logger[_0xfad3('0x1e')](_0xfad3('0x1f'),_0x19a7e5,_0xfad3('0x20'),JSON['stringify'](_0x49966d));if(_0x49966d[_0xfad3('0x21')]){if(_0x49966d[_0xfad3('0x21')][_0xfad3('0x22')]===0x1f4){logger[_0xfad3('0x21')](_0xfad3('0x1d'),_0x19a7e5,_0x49966d[_0xfad3('0x21')][_0xfad3('0x23')]);return _0x553aed(_0x49966d[_0xfad3('0x21')][_0xfad3('0x23')]);}logger[_0xfad3('0x21')](_0xfad3('0x1d'),_0x19a7e5,_0x49966d[_0xfad3('0x21')][_0xfad3('0x23')]);return _0x39ddc2(_0x49966d[_0xfad3('0x21')][_0xfad3('0x23')]);}else{logger['info'](_0xfad3('0x1d'),_0x19a7e5,_0xfad3('0x20'));_0x39ddc2(_0x49966d[_0xfad3('0x24')][_0xfad3('0x23')]);}})['catch'](function(_0x35a8b2){logger[_0xfad3('0x21')](_0xfad3('0x1d'),_0x19a7e5,_0x35a8b2);_0x553aed(_0x35a8b2);});});}function respondWithStatusCode(_0x3694be,_0x3468d8){_0x3468d8=_0x3468d8||0xcc;return function(_0x1b63ad){if(_0x1b63ad){return _0x3694be['sendStatus'](_0x3468d8);}return _0x3694be[_0xfad3('0x25')](_0x3468d8)[_0xfad3('0x26')]();};}function respondWithResult(_0x560b10,_0x105f88){_0x105f88=_0x105f88||0xc8;return function(_0x1d188f){if(_0x1d188f){return _0x560b10[_0xfad3('0x25')](_0x105f88)[_0xfad3('0x27')](_0x1d188f);}};}function respondWithFilteredResult(_0x44015f,_0x37cbf5){return function(_0x165392){if(_0x165392){var _0x37c7a5=_0x165392['count'],_0x2f49cc=_0x37cbf5[_0xfad3('0x28')],_0x15be81=_0x37cbf5[_0xfad3('0x28')]+_0x37cbf5[_0xfad3('0x29')],_0x58d4c5;if(_0x15be81>=_0x37c7a5){_0x15be81=_0x37c7a5;_0x58d4c5=0xc8;}else{_0x58d4c5=0xce;}_0x44015f['status'](_0x58d4c5);return _0x44015f['set'](_0xfad3('0x2a'),_0x2f49cc+'-'+_0x15be81+'/'+_0x37c7a5)[_0xfad3('0x27')](_0x165392);}return null;};}function patchUpdates(_0x296093){return function(_0xbca157){try{jsonpatch[_0xfad3('0x2b')](_0xbca157,_0x296093,!![]);}catch(_0xb404a5){return BPromise['reject'](_0xb404a5);}return _0xbca157[_0xfad3('0x2c')]();};}function saveUpdates(_0x42f30f,_0x3fc89d){return function(_0xd69168){if(_0xd69168){return _0xd69168[_0xfad3('0x2d')](_0x42f30f)['then'](function(_0x33e886){return _0x33e886;});}return null;};}function removeEntity(_0x48fe59,_0x5b0d22){return function(_0x17965c){if(_0x17965c){return _0x17965c[_0xfad3('0x2e')]()['then'](function(){var _0x196359=_0x17965c[_0xfad3('0x2f')]({'plain':!![]});var _0x1e2599=_0xfad3('0x30');return db[_0xfad3('0x31')][_0xfad3('0x2e')]({'where':{'type':_0x1e2599,'resourceId':_0x196359['id']}})[_0xfad3('0x32')](function(){return _0x17965c;});})['then'](function(){_0x48fe59['status'](0xcc)[_0xfad3('0x26')]();});}};}function handleEntityNotFound(_0x4dde38,_0x5f2a73){return function(_0x3c6736){if(!_0x3c6736){_0x4dde38[_0xfad3('0x33')](0x194);}return _0x3c6736;};}function handleError(_0x59e607,_0x36aae5){_0x36aae5=_0x36aae5||0x1f4;return function(_0x4e7e41){logger['error'](_0x4e7e41['stack']);if(_0x4e7e41[_0xfad3('0x34')]){delete _0x4e7e41[_0xfad3('0x34')];}_0x59e607[_0xfad3('0x25')](_0x36aae5)[_0xfad3('0x35')](_0x4e7e41);};}exports[_0xfad3('0x36')]=function(_0x475c25,_0x18098e){var _0x2c34c2={},_0x22b776={},_0xbb7030={'count':0x0,'rows':[]};var _0x5a7b19=db[_0xfad3('0x37')]['rawAttributes'];_0x22b776[_0xfad3('0x38')]=_[_0xfad3('0x39')](_0x5a7b19);_0x22b776[_0xfad3('0x3a')]=_['keys'](_0x475c25[_0xfad3('0x3a')]);_0x22b776['filters']=_[_0xfad3('0x3b')](_0x22b776['model'],_0x22b776[_0xfad3('0x3a')]);_0x2c34c2[_0xfad3('0x3c')]=_[_0xfad3('0x3b')](_0x22b776[_0xfad3('0x38')],qs['fields'](_0x475c25[_0xfad3('0x3a')][_0xfad3('0x3d')]));_0x2c34c2[_0xfad3('0x3c')]=_0x2c34c2[_0xfad3('0x3c')][_0xfad3('0x3e')]?_0x2c34c2[_0xfad3('0x3c')]:_0x22b776[_0xfad3('0x38')];if(!_0x475c25[_0xfad3('0x3a')][_0xfad3('0x3f')]('nolimit')){_0x2c34c2[_0xfad3('0x29')]=qs[_0xfad3('0x29')](_0x475c25['query'][_0xfad3('0x29')]);_0x2c34c2[_0xfad3('0x28')]=qs['offset'](_0x475c25[_0xfad3('0x3a')][_0xfad3('0x28')]);}_0x2c34c2[_0xfad3('0x40')]=qs[_0xfad3('0x41')](_0x475c25[_0xfad3('0x3a')][_0xfad3('0x41')]);_0x2c34c2[_0xfad3('0x42')]=qs[_0xfad3('0x43')](_[_0xfad3('0x44')](_0x475c25[_0xfad3('0x3a')],_0x22b776['filters']));if(_0x475c25['query'][_0xfad3('0x45')]){_0x2c34c2[_0xfad3('0x42')]=_[_0xfad3('0x46')](_0x2c34c2[_0xfad3('0x42')],{'$or':_[_0xfad3('0x47')](_0x5a7b19,function(_0x409377){if(_0x409377[_0xfad3('0x48')]['key']!==_0xfad3('0x49')){var _0xb50875={};_0xb50875[_0x409377[_0xfad3('0x4a')]]={'$like':'%'+_0x475c25[_0xfad3('0x3a')]['filter']+'%'};return _0xb50875;}})});}_0x2c34c2=_[_0xfad3('0x46')]({},_0x2c34c2,_0x475c25[_0xfad3('0x4b')]);var _0x5db606={'where':_0x2c34c2[_0xfad3('0x42')]};return db['Trunk']['count'](_0x5db606)[_0xfad3('0x32')](function(_0x45aa3c){_0xbb7030[_0xfad3('0x4c')]=_0x45aa3c;if(_0x475c25['query'][_0xfad3('0x4d')]){_0x2c34c2['include']=[{'all':!![]}];}return db[_0xfad3('0x37')][_0xfad3('0x4e')](_0x2c34c2);})[_0xfad3('0x32')](function(_0x4491fe){_0xbb7030[_0xfad3('0x4f')]=_0x4491fe;return _0xbb7030;})['then'](respondWithFilteredResult(_0x18098e,_0x2c34c2))[_0xfad3('0x50')](handleError(_0x18098e,null));};exports[_0xfad3('0x51')]=function(_0x47aed0,_0x233b43){var _0x20e037={'raw':![],'where':{'id':_0x47aed0['params']['id']}},_0x296180={};_0x296180[_0xfad3('0x38')]=_[_0xfad3('0x39')](db[_0xfad3('0x37')]['rawAttributes']);_0x296180['query']=_['keys'](_0x47aed0[_0xfad3('0x3a')]);_0x296180[_0xfad3('0x43')]=_[_0xfad3('0x3b')](_0x296180[_0xfad3('0x38')],_0x296180[_0xfad3('0x3a')]);_0x20e037[_0xfad3('0x3c')]=_['intersection'](_0x296180['model'],qs[_0xfad3('0x3d')](_0x47aed0[_0xfad3('0x3a')]['fields']));_0x20e037[_0xfad3('0x3c')]=_0x20e037[_0xfad3('0x3c')][_0xfad3('0x3e')]?_0x20e037[_0xfad3('0x3c')]:_0x296180[_0xfad3('0x38')];if(_0x47aed0[_0xfad3('0x3a')][_0xfad3('0x4d')]){_0x20e037[_0xfad3('0x52')]=[{'all':!![]}];}_0x20e037=_[_0xfad3('0x46')]({},_0x20e037,_0x47aed0[_0xfad3('0x4b')]);return db[_0xfad3('0x37')][_0xfad3('0x53')](_0x20e037)[_0xfad3('0x32')](handleEntityNotFound(_0x233b43,null))[_0xfad3('0x32')](respondWithResult(_0x233b43,null))['catch'](handleError(_0x233b43,null));};exports[_0xfad3('0x54')]=function(_0x1702dc,_0x43753b){var _0x368557={'raw':![],'where':{'id':_0x1702dc[_0xfad3('0x55')]['id']}},_0xded815={};_0xded815['model']=_[_0xfad3('0x39')](db[_0xfad3('0x37')][_0xfad3('0x56')]);_0x368557[_0xfad3('0x3c')]=_['intersection'](_0xded815[_0xfad3('0x38')],qs['fields'](_0x1702dc[_0xfad3('0x3a')]['fields']));_0x368557['attributes']=_0x368557[_0xfad3('0x3c')]['length']?_0x368557[_0xfad3('0x3c')]:_0xded815[_0xfad3('0x38')];if(_0x1702dc['query'][_0xfad3('0x4d')]){_0x368557[_0xfad3('0x52')]=[{'all':!![]}];}_0x368557=_['merge']({},_0x368557,_0x1702dc[_0xfad3('0x4b')]);return db[_0xfad3('0x37')][_0xfad3('0x53')](_0x368557)['then'](handleEntityNotFound(_0x43753b,null))[_0xfad3('0x32')](function(_0x154665){if(_0x154665){var _0x38ed62=_0x154665['get']({'plain':!![]});_0x38ed62=qs['omit'](_0x38ed62,['id',_0xfad3('0x57'),_0xfad3('0x58')]);_0x1702dc['body']=_[_0xfad3('0x59')](_0x1702dc[_0xfad3('0x5a')],['id',_0xfad3('0x57'),'updatedAt']);return db[_0xfad3('0x37')][_0xfad3('0x5b')](_[_0xfad3('0x46')](_0x38ed62,_0x1702dc['body']),{'include':_0x1702dc[_0xfad3('0x3a')]['includeAll']?[{'all':!![]}]:undefined})[_0xfad3('0x32')](function(_0x51e68a){var _0x5afd7d=_0x1702dc[_0xfad3('0x5c')][_0xfad3('0x2f')]({'plain':!![]});if(!_0x5afd7d)throw new Error(_0xfad3('0x5d'));if(_0x5afd7d[_0xfad3('0x5e')]===_0xfad3('0x5c')){var _0x27e90e=_0x51e68a['get']({'plain':!![]});var _0x4d946c=_0xfad3('0x30');return db[_0xfad3('0x5f')][_0xfad3('0x53')]({'where':{'name':_0x4d946c,'userProfileId':_0x5afd7d[_0xfad3('0x60')]},'raw':!![]})[_0xfad3('0x32')](function(_0x25c923){if(_0x25c923&&_0x25c923[_0xfad3('0x61')]===0x0){return db['UserProfileResource'][_0xfad3('0x5b')]({'name':_0x27e90e[_0xfad3('0x34')],'resourceId':_0x27e90e['id'],'type':_0x25c923[_0xfad3('0x34')],'sectionId':_0x25c923['id']},{})[_0xfad3('0x32')](function(){return _0x51e68a;});}else{return _0x51e68a;}})[_0xfad3('0x50')](function(_0x31fa1b){logger['error'](_0xfad3('0x62'),_0x31fa1b);throw _0x31fa1b;});}return _0x51e68a;});}})[_0xfad3('0x32')](respondWithResult(_0x43753b,0xc9))['catch'](handleError(_0x43753b,null));};exports[_0xfad3('0x5b')]=function(_0x26e864,_0x1585f3,_0x35b694){var _0x76757d;return db[_0xfad3('0x37')][_0xfad3('0x5b')](_0x26e864[_0xfad3('0x5a')],{'raw':!![]})[_0xfad3('0x32')](function(_0x3b8401){_0x76757d=_0x3b8401;return db[_0xfad3('0x37')][_0xfad3('0x4e')]({'raw':!![]});})[_0xfad3('0x32')](function(_0x4c0e20){var _0x33f42c=fs[_0xfad3('0x63')](path[_0xfad3('0x64')](config[_0xfad3('0x65')],_0xfad3('0x66')),_0xfad3('0x67'));var _0x1d082e=fs[_0xfad3('0x63')](path[_0xfad3('0x64')](config[_0xfad3('0x65')],_0xfad3('0x68')),_0xfad3('0x67'));var _0x374932=ejs['render'](_0x33f42c,{'trunks':_0x4c0e20||[]});fs['writeFileSync'](_0xfad3('0x69'),_0x374932);if(_0x76757d['registry']){var _0xed2da5=ejs[_0xfad3('0x6a')](_0x1d082e,{'trunks':_0x4c0e20||[]});fs[_0xfad3('0x6b')]('/etc/asterisk/sip_xcally_registers.conf',_0xed2da5);}})[_0xfad3('0x32')](function(){return respondWithRpcPromise(_0xfad3('0x6c'),_0xfad3('0x5b'),{'module':'chan_sip.so'});})[_0xfad3('0x32')](function(){var _0x58a996=_0x26e864['user'][_0xfad3('0x2f')]({'plain':!![]});if(!_0x58a996)throw new Error(_0xfad3('0x5d'));if(_0x58a996[_0xfad3('0x5e')]===_0xfad3('0x5c')){var _0x3e8042=_0x76757d[_0xfad3('0x2f')]({'plain':!![]});return db[_0xfad3('0x5f')][_0xfad3('0x53')]({'where':{'name':_0xfad3('0x30'),'userProfileId':_0x58a996[_0xfad3('0x60')]},'raw':!![]})[_0xfad3('0x32')](function(_0x12ba20){if(_0x12ba20&&_0x12ba20[_0xfad3('0x61')]===0x0){return db[_0xfad3('0x31')]['create']({'name':_0x3e8042[_0xfad3('0x34')],'resourceId':_0x3e8042['id'],'type':_0x12ba20[_0xfad3('0x34')],'sectionId':_0x12ba20['id']},{})['then'](function(){return _0x76757d;});}else{return _0x76757d;}})[_0xfad3('0x50')](function(_0x54f90e){logger[_0xfad3('0x21')](_0xfad3('0x62'),_0x54f90e);throw _0x54f90e;});}return _0x76757d;})['then'](respondWithResult(_0x1585f3,0xc9))['catch'](handleError(_0x1585f3,null));};exports[_0xfad3('0x2d')]=function(_0x48c47c,_0x13483f,_0x1ae480){var _0x1b6a32;return db['Trunk'][_0xfad3('0x53')]({'where':{'id':_0x48c47c[_0xfad3('0x55')]['id']}})[_0xfad3('0x32')](handleEntityNotFound(_0x13483f,null))[_0xfad3('0x32')](saveUpdates(_0x48c47c[_0xfad3('0x5a')],null))['then'](function(_0x550d47){if(_0x550d47){_0x1b6a32=_0x550d47;return db[_0xfad3('0x37')][_0xfad3('0x4e')]({'raw':!![]});}})[_0xfad3('0x32')](function(_0x3abeb6){if(_0x3abeb6){var _0x2edd29=fs[_0xfad3('0x63')](path[_0xfad3('0x64')](config['root'],_0xfad3('0x66')),_0xfad3('0x67'));var _0x16ef44=fs[_0xfad3('0x63')](path[_0xfad3('0x64')](config[_0xfad3('0x65')],_0xfad3('0x68')),_0xfad3('0x67'));var _0x44f7e2=ejs[_0xfad3('0x6a')](_0x2edd29,{'trunks':_0x3abeb6||[]});fs[_0xfad3('0x6b')](_0xfad3('0x69'),_0x44f7e2);var _0x2266ed=ejs[_0xfad3('0x6a')](_0x16ef44,{'trunks':_0x3abeb6||[]});fs['writeFileSync'](_0xfad3('0x6d'),_0x2266ed);return respondWithRpcPromise(_0xfad3('0x6c'),_0xfad3('0x2d'),{'module':_0xfad3('0x6e')});}return null;})['then'](function(_0x5338d5){if(_0x5338d5){return _0x1b6a32;}})[_0xfad3('0x32')](respondWithResult(_0x13483f,null))['catch'](handleError(_0x13483f,null));};exports['destroy']=function(_0x613877,_0x502bba,_0x3f4896){var _0x35e1c7;return db[_0xfad3('0x37')]['find']({'where':{'id':_0x613877[_0xfad3('0x55')]['id']}})[_0xfad3('0x32')](handleEntityNotFound(_0x502bba,null))['then'](removeEntity(_0x502bba,null))[_0xfad3('0x32')](function(){return db[_0xfad3('0x37')][_0xfad3('0x4e')]({'raw':!![]});})[_0xfad3('0x32')](function(_0x27fe2e){var _0x24c78f=fs[_0xfad3('0x63')](path[_0xfad3('0x64')](config[_0xfad3('0x65')],'server/files/templates/trunk.ejs'),_0xfad3('0x67'));var _0x15423a=fs[_0xfad3('0x63')](path['join'](config['root'],'server/files/templates/registry.ejs'),'utf8');var _0x3e731c=ejs[_0xfad3('0x6a')](_0x24c78f,{'trunks':_0x27fe2e});var _0x2ee4b9=ejs['render'](_0x15423a,{'trunks':_0x27fe2e});fs[_0xfad3('0x6b')]('/etc/asterisk/sip_xcally_trunks.conf',_0x3e731c);fs[_0xfad3('0x6b')](_0xfad3('0x6d'),_0x2ee4b9);return respondWithRpcPromise(_0xfad3('0x6c'),_0xfad3('0x2e'),{'module':_0xfad3('0x6e')});})['catch'](handleError(_0x502bba,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index b9d0f7a..6b10a6c 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 _0x425d=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./trunk.attributes','exports','define','Trunk'];(function(_0x1427c2,_0x86239f){var _0xab9e1c=function(_0x348e3a){while(--_0x348e3a){_0x1427c2['push'](_0x1427c2['shift']());}};_0xab9e1c(++_0x86239f);}(_0x425d,0x1e0));var _0xd425=function(_0x57862e,_0x2c787f){_0x57862e=_0x57862e-0x0;var _0x1f44ba=_0x425d[_0x57862e];return _0x1f44ba;};'use strict';var _=require(_0xd425('0x0'));var util=require('util');var logger=require(_0xd425('0x1'))(_0xd425('0x2'));var moment=require(_0xd425('0x3'));var BPromise=require(_0xd425('0x4'));var rp=require(_0xd425('0x5'));var fs=require('fs');var path=require(_0xd425('0x6'));var rimraf=require(_0xd425('0x7'));var config=require('../../config/environment');var attributes=require(_0xd425('0x8'));module[_0xd425('0x9')]=function(_0xc4e080,_0x36866e){return _0xc4e080[_0xd425('0xa')](_0xd425('0xb'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4bc3=['./trunk.attributes','exports','define','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x33555e,_0x51ca07){var _0x3d32f3=function(_0x59f1fd){while(--_0x59f1fd){_0x33555e['push'](_0x33555e['shift']());}};_0x3d32f3(++_0x51ca07);}(_0x4bc3,0x16e));var _0x34bc=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x4bc3[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var logger=require('../../config/logger')(_0x34bc('0x2'));var moment=require(_0x34bc('0x3'));var BPromise=require('bluebird');var rp=require(_0x34bc('0x4'));var fs=require('fs');var path=require(_0x34bc('0x5'));var rimraf=require(_0x34bc('0x6'));var config=require(_0x34bc('0x7'));var attributes=require(_0x34bc('0x8'));module[_0x34bc('0x9')]=function(_0x2cc9c2,_0x4c63a1){return _0x2cc9c2[_0x34bc('0xa')]('Trunk',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 447c6a0..e060d30 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 _0xcbea=['GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','then','find','ShowTrunk','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x275a90,_0xa0f3cc){var _0x17b092=function(_0x45ec5a){while(--_0x45ec5a){_0x275a90['push'](_0x275a90['shift']());}};_0x17b092(++_0xa0f3cc);}(_0xcbea,0x16c));var _0xacbe=function(_0xe3d850,_0x181789){_0xe3d850=_0xe3d850-0x0;var _0x2f3953=_0xcbea[_0xe3d850];return _0x2f3953;};'use strict';var _=require('lodash');var util=require(_0xacbe('0x0'));var moment=require('moment');var BPromise=require(_0xacbe('0x1'));var rs=require(_0xacbe('0x2'));var fs=require('fs');var Redis=require(_0xacbe('0x3'));var db=require(_0xacbe('0x4'))['db'];var utils=require(_0xacbe('0x5'));var logger=require(_0xacbe('0x6'))(_0xacbe('0x7'));var config=require('../../config/environment');var jayson=require(_0xacbe('0x8'));var client=jayson[_0xacbe('0x9')][_0xacbe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b11c3,_0x3e9fd2,_0x390820){return new BPromise(function(_0x2eb074,_0x3a628e){return client['request'](_0x3b11c3,_0x390820)['then'](function(_0x1546e9){logger[_0xacbe('0xb')](_0xacbe('0xc'),_0x3e9fd2,_0xacbe('0xd'));logger[_0xacbe('0xe')]('Trunk,\x20%s,\x20%s,\x20%s',_0x3e9fd2,'request\x20sent',JSON[_0xacbe('0xf')](_0x1546e9));if(_0x1546e9['error']){if(_0x1546e9[_0xacbe('0x10')][_0xacbe('0x11')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x3e9fd2,_0x1546e9[_0xacbe('0x10')][_0xacbe('0x12')]);return _0x3a628e(_0x1546e9['error'][_0xacbe('0x12')]);}logger['error'](_0xacbe('0xc'),_0x3e9fd2,_0x1546e9[_0xacbe('0x10')]['message']);return _0x2eb074(_0x1546e9[_0xacbe('0x10')][_0xacbe('0x12')]);}else{logger[_0xacbe('0xb')](_0xacbe('0xc'),_0x3e9fd2,_0xacbe('0xd'));_0x2eb074(_0x1546e9[_0xacbe('0x13')][_0xacbe('0x12')]);}})[_0xacbe('0x14')](function(_0x3d23da){logger['error'](_0xacbe('0xc'),_0x3e9fd2,_0x3d23da);_0x3a628e(_0x3d23da);});});}exports[_0xacbe('0x15')]=function(_0x41ac9e){var _0x5b709a=this;return new Promise(function(_0x4c038d,_0x289a3e){return db[_0xacbe('0x16')][_0xacbe('0x17')]({'raw':_0x41ac9e[_0xacbe('0x18')]?_0x41ac9e[_0xacbe('0x18')][_0xacbe('0x19')]===undefined?!![]:![]:!![],'where':_0x41ac9e[_0xacbe('0x18')]?_0x41ac9e[_0xacbe('0x18')][_0xacbe('0x1a')]||null:null,'attributes':_0x41ac9e[_0xacbe('0x18')]?_0x41ac9e['options'][_0xacbe('0x1b')]||null:null,'limit':_0x41ac9e[_0xacbe('0x18')]?_0x41ac9e[_0xacbe('0x18')][_0xacbe('0x1c')]||null:null,'include':_0x41ac9e['options']?_0x41ac9e['options'][_0xacbe('0x1d')]?_[_0xacbe('0x1e')](_0x41ac9e['options'][_0xacbe('0x1d')],function(_0x57f6c4){return{'model':db[_0x57f6c4['model']],'as':_0x57f6c4['as'],'attributes':_0x57f6c4['attributes'],'include':_0x57f6c4[_0xacbe('0x1d')]?_[_0xacbe('0x1e')](_0x57f6c4[_0xacbe('0x1d')],function(_0x400ec4){return{'model':db[_0x400ec4[_0xacbe('0x1f')]],'as':_0x400ec4['as'],'attributes':_0x400ec4[_0xacbe('0x1b')],'include':_0x400ec4[_0xacbe('0x1d')]?_['map'](_0x400ec4[_0xacbe('0x1d')],function(_0x31178b){return{'model':db[_0x31178b[_0xacbe('0x1f')]],'as':_0x31178b['as'],'attributes':_0x31178b[_0xacbe('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xacbe('0x20')](function(_0x55777e){logger[_0xacbe('0xb')](_0xacbe('0x15'),_0x41ac9e);logger['debug'](_0xacbe('0x15'),_0x41ac9e,JSON[_0xacbe('0xf')](_0x55777e));_0x4c038d(_0x55777e);})[_0xacbe('0x14')](function(_0x1e8def){logger['error']('GetTrunk',_0x1e8def[_0xacbe('0x12')],_0x41ac9e);_0x289a3e(_0x5b709a[_0xacbe('0x10')](0x1f4,_0x1e8def['message']));});});};exports['ShowTrunk']=function(_0x2fd791){var _0x295e0a=this;return new Promise(function(_0x59e79e,_0x3eee80){return db[_0xacbe('0x16')][_0xacbe('0x21')]({'raw':_0x2fd791[_0xacbe('0x18')]?_0x2fd791[_0xacbe('0x18')][_0xacbe('0x19')]===undefined?!![]:![]:!![],'where':_0x2fd791[_0xacbe('0x18')]?_0x2fd791[_0xacbe('0x18')][_0xacbe('0x1a')]||null:null,'attributes':_0x2fd791[_0xacbe('0x18')]?_0x2fd791[_0xacbe('0x18')]['attributes']||null:null,'include':_0x2fd791['options']?_0x2fd791[_0xacbe('0x18')][_0xacbe('0x1d')]?_[_0xacbe('0x1e')](_0x2fd791['options'][_0xacbe('0x1d')],function(_0x3896c5){return{'model':db[_0x3896c5[_0xacbe('0x1f')]],'as':_0x3896c5['as'],'attributes':_0x3896c5[_0xacbe('0x1b')],'include':_0x3896c5[_0xacbe('0x1d')]?_[_0xacbe('0x1e')](_0x3896c5['include'],function(_0x3d5c9e){return{'model':db[_0x3d5c9e['model']],'as':_0x3d5c9e['as'],'attributes':_0x3d5c9e[_0xacbe('0x1b')],'include':_0x3d5c9e[_0xacbe('0x1d')]?_[_0xacbe('0x1e')](_0x3d5c9e[_0xacbe('0x1d')],function(_0x29a100){return{'model':db[_0x29a100[_0xacbe('0x1f')]],'as':_0x29a100['as'],'attributes':_0x29a100['attributes']};}):[]};}):[]};}):[]:[]})[_0xacbe('0x20')](function(_0x51285e){logger[_0xacbe('0xb')](_0xacbe('0x22'),_0x2fd791);logger[_0xacbe('0xe')](_0xacbe('0x22'),_0x2fd791,JSON['stringify'](_0x51285e));_0x59e79e(_0x51285e);})[_0xacbe('0x14')](function(_0x34b81f){logger['error'](_0xacbe('0x22'),_0x34b81f[_0xacbe('0x12')],_0x2fd791);_0x3eee80(_0x295e0a[_0xacbe('0x10')](0x1f4,_0x34b81f[_0xacbe('0x12')]));});});}; \ No newline at end of file +var _0x41d9=['Trunk','findAll','options','raw','where','limit','include','map','model','attributes','debug','ShowTrunk','find','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','client','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk'];(function(_0x4e07c6,_0x5d8c10){var _0x37023e=function(_0x339588){while(--_0x339588){_0x4e07c6['push'](_0x4e07c6['shift']());}};_0x37023e(++_0x5d8c10);}(_0x41d9,0x178));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x941d('0x0'));var moment=require(_0x941d('0x1'));var BPromise=require(_0x941d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x941d('0x3'))['db'];var utils=require(_0x941d('0x4'));var logger=require(_0x941d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x941d('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x577fe6,_0x35e1a0,_0x52c71e){return new BPromise(function(_0x589784,_0x3c36c5){return client[_0x941d('0x7')](_0x577fe6,_0x52c71e)[_0x941d('0x8')](function(_0x166e12){logger[_0x941d('0x9')](_0x941d('0xa'),_0x35e1a0,_0x941d('0xb'));logger['debug'](_0x941d('0xc'),_0x35e1a0,_0x941d('0xb'),JSON[_0x941d('0xd')](_0x166e12));if(_0x166e12[_0x941d('0xe')]){if(_0x166e12[_0x941d('0xe')][_0x941d('0xf')]===0x1f4){logger[_0x941d('0xe')](_0x941d('0xa'),_0x35e1a0,_0x166e12[_0x941d('0xe')][_0x941d('0x10')]);return _0x3c36c5(_0x166e12[_0x941d('0xe')][_0x941d('0x10')]);}logger[_0x941d('0xe')](_0x941d('0xa'),_0x35e1a0,_0x166e12[_0x941d('0xe')]['message']);return _0x589784(_0x166e12[_0x941d('0xe')][_0x941d('0x10')]);}else{logger[_0x941d('0x9')](_0x941d('0xa'),_0x35e1a0,_0x941d('0xb'));_0x589784(_0x166e12[_0x941d('0x11')][_0x941d('0x10')]);}})[_0x941d('0x12')](function(_0x273a57){logger[_0x941d('0xe')](_0x941d('0xa'),_0x35e1a0,_0x273a57);_0x3c36c5(_0x273a57);});});}exports[_0x941d('0x13')]=function(_0x290581){var _0xc11f64=this;return new Promise(function(_0x1bcff2,_0x42c680){return db[_0x941d('0x14')][_0x941d('0x15')]({'raw':_0x290581[_0x941d('0x16')]?_0x290581[_0x941d('0x16')][_0x941d('0x17')]===undefined?!![]:![]:!![],'where':_0x290581[_0x941d('0x16')]?_0x290581[_0x941d('0x16')][_0x941d('0x18')]||null:null,'attributes':_0x290581[_0x941d('0x16')]?_0x290581['options']['attributes']||null:null,'limit':_0x290581[_0x941d('0x16')]?_0x290581[_0x941d('0x16')][_0x941d('0x19')]||null:null,'include':_0x290581[_0x941d('0x16')]?_0x290581['options'][_0x941d('0x1a')]?_[_0x941d('0x1b')](_0x290581[_0x941d('0x16')][_0x941d('0x1a')],function(_0x14d37a){return{'model':db[_0x14d37a[_0x941d('0x1c')]],'as':_0x14d37a['as'],'attributes':_0x14d37a[_0x941d('0x1d')],'include':_0x14d37a[_0x941d('0x1a')]?_['map'](_0x14d37a['include'],function(_0x4a5cff){return{'model':db[_0x4a5cff[_0x941d('0x1c')]],'as':_0x4a5cff['as'],'attributes':_0x4a5cff[_0x941d('0x1d')],'include':_0x4a5cff['include']?_['map'](_0x4a5cff[_0x941d('0x1a')],function(_0x4a5077){return{'model':db[_0x4a5077[_0x941d('0x1c')]],'as':_0x4a5077['as'],'attributes':_0x4a5077['attributes']};}):[]};}):[]};}):[]:[]})[_0x941d('0x8')](function(_0x5e83ca){logger['info'](_0x941d('0x13'),_0x290581);logger[_0x941d('0x1e')]('GetTrunk',_0x290581,JSON[_0x941d('0xd')](_0x5e83ca));_0x1bcff2(_0x5e83ca);})[_0x941d('0x12')](function(_0x45cc34){logger[_0x941d('0xe')]('GetTrunk',_0x45cc34[_0x941d('0x10')],_0x290581);_0x42c680(_0xc11f64[_0x941d('0xe')](0x1f4,_0x45cc34['message']));});});};exports[_0x941d('0x1f')]=function(_0x3b0428){var _0x22adc4=this;return new Promise(function(_0x45b223,_0x36fd1e){return db[_0x941d('0x14')][_0x941d('0x20')]({'raw':_0x3b0428['options']?_0x3b0428[_0x941d('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3b0428[_0x941d('0x16')]?_0x3b0428[_0x941d('0x16')]['where']||null:null,'attributes':_0x3b0428[_0x941d('0x16')]?_0x3b0428[_0x941d('0x16')][_0x941d('0x1d')]||null:null,'include':_0x3b0428[_0x941d('0x16')]?_0x3b0428['options'][_0x941d('0x1a')]?_['map'](_0x3b0428[_0x941d('0x16')][_0x941d('0x1a')],function(_0x14c98f){return{'model':db[_0x14c98f[_0x941d('0x1c')]],'as':_0x14c98f['as'],'attributes':_0x14c98f[_0x941d('0x1d')],'include':_0x14c98f[_0x941d('0x1a')]?_[_0x941d('0x1b')](_0x14c98f['include'],function(_0x1fc26b){return{'model':db[_0x1fc26b[_0x941d('0x1c')]],'as':_0x1fc26b['as'],'attributes':_0x1fc26b[_0x941d('0x1d')],'include':_0x1fc26b[_0x941d('0x1a')]?_['map'](_0x1fc26b[_0x941d('0x1a')],function(_0x52844d){return{'model':db[_0x52844d[_0x941d('0x1c')]],'as':_0x52844d['as'],'attributes':_0x52844d[_0x941d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3512b1){logger['info']('ShowTrunk',_0x3b0428);logger[_0x941d('0x1e')](_0x941d('0x1f'),_0x3b0428,JSON[_0x941d('0xd')](_0x3512b1));_0x45b223(_0x3512b1);})[_0x941d('0x12')](function(_0x501067){logger[_0x941d('0xe')](_0x941d('0x1f'),_0x501067[_0x941d('0x10')],_0x3b0428);_0x36fd1e(_0x22adc4[_0x941d('0xe')](0x1f4,_0x501067[_0x941d('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index c7b76ff..0278e99 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 _0xa5fa=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./user.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/avatar','/:id/contacts','getQueues','/:id/queues_rt','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/scheduled_calls','getApiKey','/create_many','bulkCreate','post','/:id/queues','addQueues','diskStorage','join','root','server/files/images/','%s-%s','now','originalname','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','removeChatInteractions','removeFaxInteractions','removeSmsInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','/:id/chat_websites','removeChatWebsites','removeSquareProjects','removeApiKey'];(function(_0x372df8,_0x28bc10){var _0x447006=function(_0x16a14d){while(--_0x16a14d){_0x372df8['push'](_0x372df8['shift']());}};_0x447006(++_0x28bc10);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x4a440b,_0xedaa5b){_0x4a440b=_0x4a440b-0x0;var _0x25c667=_0xa5fa[_0x4a440b];return _0x25c667;};'use strict';var multer=require('multer');var util=require(_0xaa5f('0x0'));var path=require(_0xaa5f('0x1'));var timeout=require(_0xaa5f('0x2'));var express=require(_0xaa5f('0x3'));var router=express['Router']();var auth=require(_0xaa5f('0x4'));var interaction=require(_0xaa5f('0x5'));var config=require('../../config/environment');var controller=require(_0xaa5f('0x6'));router[_0xaa5f('0x7')]('/',auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x9')]);router[_0xaa5f('0x7')](_0xaa5f('0xa'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0xb')]);router[_0xaa5f('0x7')](_0xaa5f('0xc'),auth[_0xaa5f('0x8')](),controller['show']);router[_0xaa5f('0x7')](_0xaa5f('0xd'),controller['getAvatar']);router['get'](_0xaa5f('0xe'),auth['isAuthenticated'](),controller['getContacts']);router[_0xaa5f('0x7')]('/:id/queues',auth[_0xaa5f('0x8')](),controller[_0xaa5f('0xf')]);router[_0xaa5f('0x7')](_0xaa5f('0x10'),auth[_0xaa5f('0x8')](),controller['getVoiceQueuesRt']);router[_0xaa5f('0x7')]('/:id/groups',auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x11')]);router[_0xaa5f('0x7')](_0xaa5f('0x12'),auth[_0xaa5f('0x8')](),controller['getRecordings']);router['get'](_0xaa5f('0x13'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x14')]);router[_0xaa5f('0x7')](_0xaa5f('0x15'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x16')]);router[_0xaa5f('0x7')](_0xaa5f('0x17'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x18')]);router[_0xaa5f('0x7')]('/:id/mail/interactions',auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x19')]);router[_0xaa5f('0x7')](_0xaa5f('0x1a'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x1b')]);router[_0xaa5f('0x7')](_0xaa5f('0x1c'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x1d')]);router[_0xaa5f('0x7')](_0xaa5f('0x1e'),auth[_0xaa5f('0x8')](),controller['getTeams']);router[_0xaa5f('0x7')]('/:id/lists',auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x1f')]);router['get'](_0xaa5f('0x20'),auth[_0xaa5f('0x8')](),controller['getAgents']);router[_0xaa5f('0x7')](_0xaa5f('0x21'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x22')]);router[_0xaa5f('0x7')](_0xaa5f('0x23'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x24')]);router['get'](_0xaa5f('0x25'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x26')]);router['get'](_0xaa5f('0x27'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x28')]);router['get'](_0xaa5f('0x29'),auth['isAuthenticated'](),controller['getSmsAccounts']);router[_0xaa5f('0x7')]('/:id/chat_websites',auth[_0xaa5f('0x8')](),controller['getChatWebsites']);router['get']('/:id/square_projects',auth[_0xaa5f('0x8')](),controller['getSquareProjects']);router[_0xaa5f('0x7')](_0xaa5f('0x2a'),auth['isAuthenticated'](),controller['getScheduledCalls']);router[_0xaa5f('0x7')]('/:id/api_key',auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x2b')]);router['post'](_0xaa5f('0x2c'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x2d')]);router['post'](_0xaa5f('0xe'),auth[_0xaa5f('0x8')](),controller['addContacts']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xaa5f('0x2e')](_0xaa5f('0x2f'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x30')]);var upload=multer({'storage':multer[_0xaa5f('0x31')]({'destination':function(_0x3bcaf6,_0x3887dd,_0x501dc3){_0x501dc3(null,path[_0xaa5f('0x32')](config[_0xaa5f('0x33')],_0xaa5f('0x34')));},'filename':function(_0x1f3268,_0x3fd269,_0x3c3133){_0x3c3133(null,util['format'](_0xaa5f('0x35'),Date[_0xaa5f('0x36')](),_0x3fd269[_0xaa5f('0x37')]));}})});router[_0xaa5f('0x2e')](_0xaa5f('0xd'),upload['single']('file'),controller[_0xaa5f('0x38')]);router[_0xaa5f('0x2e')](_0xaa5f('0x39'),auth[_0xaa5f('0x8')](),controller['login']);router[_0xaa5f('0x2e')](_0xaa5f('0x3a'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x3b')]);router[_0xaa5f('0x2e')](_0xaa5f('0x3c'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x3d')]);router[_0xaa5f('0x2e')](_0xaa5f('0x3e'),auth[_0xaa5f('0x8')](),controller['unpause']);router[_0xaa5f('0x2e')](_0xaa5f('0x1e'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x3f')]);router[_0xaa5f('0x2e')](_0xaa5f('0x40'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x41')]);router[_0xaa5f('0x2e')](_0xaa5f('0x42'),auth['isAuthenticated'](),controller[_0xaa5f('0x43')]);router['post'](_0xaa5f('0x44'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x45')]);router['post'](_0xaa5f('0x46'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x47')]);router['post'](_0xaa5f('0x48'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x49')]);router[_0xaa5f('0x2e')]('/:id/fax_accounts',auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x4a')]);router[_0xaa5f('0x2e')](_0xaa5f('0x25'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x4b')]);router[_0xaa5f('0x2e')](_0xaa5f('0x27'),auth['isAuthenticated'](),controller[_0xaa5f('0x4c')]);router['post'](_0xaa5f('0x29'),auth['isAuthenticated'](),controller[_0xaa5f('0x4d')]);router[_0xaa5f('0x2e')]('/:id/chat_websites',auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x4e')]);router[_0xaa5f('0x2e')]('/:id/square_projects',auth['isAuthenticated'](),controller['addSquareProjects']);router[_0xaa5f('0x2e')]('/:id/api_key',auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x4f')]);router[_0xaa5f('0x50')](_0xaa5f('0xc'),auth['isAuthenticated'](),controller[_0xaa5f('0x51')]);router[_0xaa5f('0x50')](_0xaa5f('0x52'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x53')]);router[_0xaa5f('0x54')](_0xaa5f('0x2f'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x55')]);router[_0xaa5f('0x54')](_0xaa5f('0x1e'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x56')]);router[_0xaa5f('0x54')](_0xaa5f('0xc'),auth[_0xaa5f('0x8')](),controller['destroy']);router[_0xaa5f('0x54')](_0xaa5f('0x40'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x57')]);router[_0xaa5f('0x54')](_0xaa5f('0x42'),auth[_0xaa5f('0x8')](),controller['removeMailInteractions']);router[_0xaa5f('0x54')](_0xaa5f('0x44'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x58')]);router['delete'](_0xaa5f('0x46'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x59')]);router['delete']('/:id/openchannel_interactions',auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router['delete']('/:id/fax_accounts',auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x5a')]);router[_0xaa5f('0x54')](_0xaa5f('0x25'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x5b')]);router['delete']('/:id/openchannel_accounts',auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x5c')]);router['delete'](_0xaa5f('0x29'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x5d')]);router[_0xaa5f('0x54')](_0xaa5f('0x5e'),auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x5f')]);router['delete']('/:id/square_projects',auth[_0xaa5f('0x8')](),controller[_0xaa5f('0x60')]);router['delete']('/:id/api_key',auth['isAuthenticated'](),controller[_0xaa5f('0x61')]);module['exports']=router; \ No newline at end of file +var _0xbe0f=['format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addSquareProjects','createApiKey','put','update','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','/:id/fax_interactions','removeFaxInteractions','/:id/sms_interactions','removeOpenchannelInteractions','/:id/fax_accounts','removeFaxAccounts','removeMailAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','multer','util','express','../../components/auth/service','../../config/environment','./user.controller','get','index','isAuthenticated','describe','/:id','/:id/avatar','getAvatar','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/agents','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','/create_many','bulkCreate','addContacts','create','diskStorage','join','root','server/files/images/'];(function(_0x50ce0c,_0x541b68){var _0x3c988c=function(_0x1684ee){while(--_0x1684ee){_0x50ce0c['push'](_0x50ce0c['shift']());}};_0x3c988c(++_0x541b68);}(_0xbe0f,0x1d3));var _0xfbe0=function(_0x2a3da5,_0x4e8280){_0x2a3da5=_0x2a3da5-0x0;var _0x4a11c6=_0xbe0f[_0x2a3da5];return _0x4a11c6;};'use strict';var multer=require(_0xfbe0('0x0'));var util=require(_0xfbe0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfbe0('0x2'));var router=express['Router']();var auth=require(_0xfbe0('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xfbe0('0x4'));var controller=require(_0xfbe0('0x5'));router[_0xfbe0('0x6')]('/',auth['isAuthenticated'](),controller[_0xfbe0('0x7')]);router[_0xfbe0('0x6')]('/describe',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x9')]);router[_0xfbe0('0x6')](_0xfbe0('0xa'),auth[_0xfbe0('0x8')](),controller['show']);router[_0xfbe0('0x6')](_0xfbe0('0xb'),controller[_0xfbe0('0xc')]);router[_0xfbe0('0x6')]('/:id/contacts',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0xd')]);router[_0xfbe0('0x6')](_0xfbe0('0xe'),auth[_0xfbe0('0x8')](),controller['getQueues']);router[_0xfbe0('0x6')](_0xfbe0('0xf'),auth['isAuthenticated'](),controller[_0xfbe0('0x10')]);router[_0xfbe0('0x6')](_0xfbe0('0x11'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x12')]);router[_0xfbe0('0x6')](_0xfbe0('0x13'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x14')]);router[_0xfbe0('0x6')](_0xfbe0('0x15'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x16')]);router[_0xfbe0('0x6')](_0xfbe0('0x17'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x18')]);router['get']('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0xfbe0('0x19')]);router[_0xfbe0('0x6')](_0xfbe0('0x1a'),auth['isAuthenticated'](),controller[_0xfbe0('0x1b')]);router[_0xfbe0('0x6')]('/:id/sms/interactions',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x1c')]);router[_0xfbe0('0x6')](_0xfbe0('0x1d'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x1e')]);router[_0xfbe0('0x6')](_0xfbe0('0x1f'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x20')]);router[_0xfbe0('0x6')]('/:id/lists',auth[_0xfbe0('0x8')](),controller['getLists']);router[_0xfbe0('0x6')](_0xfbe0('0x21'),auth[_0xfbe0('0x8')](),controller['getAgents']);router[_0xfbe0('0x6')]('/:id/prefixes',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x22')]);router['get']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xfbe0('0x23')]);router[_0xfbe0('0x6')](_0xfbe0('0x24'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x25')]);router['get'](_0xfbe0('0x26'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x27')]);router[_0xfbe0('0x6')](_0xfbe0('0x28'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x29')]);router[_0xfbe0('0x6')](_0xfbe0('0x2a'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x2b')]);router[_0xfbe0('0x6')](_0xfbe0('0x2c'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x2d')]);router[_0xfbe0('0x6')](_0xfbe0('0x2e'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x2f')]);router[_0xfbe0('0x6')](_0xfbe0('0x30'),auth[_0xfbe0('0x8')](),controller['getApiKey']);router[_0xfbe0('0x31')](_0xfbe0('0x32'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x33')]);router[_0xfbe0('0x31')]('/:id/contacts',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x34')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfbe0('0x35')]);router[_0xfbe0('0x31')](_0xfbe0('0xe'),auth[_0xfbe0('0x8')](),controller['addQueues']);var upload=multer({'storage':multer[_0xfbe0('0x36')]({'destination':function(_0x2fcc2d,_0x403851,_0x1b6bc9){_0x1b6bc9(null,path[_0xfbe0('0x37')](config[_0xfbe0('0x38')],_0xfbe0('0x39')));},'filename':function(_0x3dd806,_0x46b8c2,_0x2a89bc){_0x2a89bc(null,util[_0xfbe0('0x3a')](_0xfbe0('0x3b'),Date[_0xfbe0('0x3c')](),_0x46b8c2[_0xfbe0('0x3d')]));}})});router['post'](_0xfbe0('0xb'),upload[_0xfbe0('0x3e')](_0xfbe0('0x3f')),controller[_0xfbe0('0x40')]);router[_0xfbe0('0x31')](_0xfbe0('0x41'),auth['isAuthenticated'](),controller['login']);router[_0xfbe0('0x31')](_0xfbe0('0x42'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x43')]);router[_0xfbe0('0x31')](_0xfbe0('0x44'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x45')]);router[_0xfbe0('0x31')](_0xfbe0('0x46'),auth['isAuthenticated'](),controller[_0xfbe0('0x47')]);router[_0xfbe0('0x31')](_0xfbe0('0x1f'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x48')]);router['post'](_0xfbe0('0x49'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x4a')]);router[_0xfbe0('0x31')](_0xfbe0('0x4b'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x4c')]);router[_0xfbe0('0x31')]('/:id/fax_interactions',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x4d')]);router[_0xfbe0('0x31')]('/:id/sms_interactions',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x4e')]);router[_0xfbe0('0x31')](_0xfbe0('0x4f'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x50')]);router[_0xfbe0('0x31')]('/:id/fax_accounts',auth[_0xfbe0('0x8')](),controller['addFaxAccounts']);router[_0xfbe0('0x31')]('/:id/mail_accounts',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x51')]);router['post'](_0xfbe0('0x26'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x52')]);router[_0xfbe0('0x31')]('/:id/sms_accounts',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x53')]);router[_0xfbe0('0x31')](_0xfbe0('0x2a'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x54')]);router[_0xfbe0('0x31')](_0xfbe0('0x2c'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x55')]);router['post'](_0xfbe0('0x30'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x56')]);router[_0xfbe0('0x57')]('/:id',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x58')]);router[_0xfbe0('0x57')]('/:id/password',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x59')]);router[_0xfbe0('0x5a')]('/:id/queues',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x5b')]);router['delete'](_0xfbe0('0x1f'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x5c')]);router[_0xfbe0('0x5a')](_0xfbe0('0xa'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x5d')]);router[_0xfbe0('0x5a')](_0xfbe0('0x49'),auth['isAuthenticated'](),controller[_0xfbe0('0x5e')]);router[_0xfbe0('0x5a')](_0xfbe0('0x4b'),auth[_0xfbe0('0x8')](),controller['removeMailInteractions']);router[_0xfbe0('0x5a')](_0xfbe0('0x5f'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x60')]);router['delete'](_0xfbe0('0x61'),auth[_0xfbe0('0x8')](),controller['removeSmsInteractions']);router[_0xfbe0('0x5a')](_0xfbe0('0x4f'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x62')]);router[_0xfbe0('0x5a')](_0xfbe0('0x63'),auth['isAuthenticated'](),controller[_0xfbe0('0x64')]);router['delete'](_0xfbe0('0x24'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x65')]);router[_0xfbe0('0x5a')]('/:id/openchannel_accounts',auth[_0xfbe0('0x8')](),controller['removeOpenchannelAccounts']);router[_0xfbe0('0x5a')](_0xfbe0('0x28'),auth[_0xfbe0('0x8')](),controller['removeSmsAccounts']);router[_0xfbe0('0x5a')](_0xfbe0('0x2a'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x66')]);router[_0xfbe0('0x5a')](_0xfbe0('0x2c'),auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x67')]);router[_0xfbe0('0x5a')]('/:id/api_key',auth[_0xfbe0('0x8')](),controller[_0xfbe0('0x68')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index a135d19..1a3eb50 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(_0x3a7fe5,_0x371426){_0x3a7fe5=_0x3a7fe5-0x0;var _0x18ed66=_0xe706[_0x3a7fe5];return _0x18ed66;};'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 _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0xd4e66a,_0x1c2992){var _0x21dadd=function(_0x35b9da){while(--_0x35b9da){_0xd4e66a['push'](_0xd4e66a['shift']());}};_0x21dadd(++_0x1c2992);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 7f71e67..3f0a049 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 _0x7f53=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','oldPassword','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20one','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','findOne','channel','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','QueueId','emit','Queue:save','voice','VoiceQueue','online','SIP/%s','each','upsert','removeQueues','addAvatar','userpic','file','filename','join','server/files/images/logos/default_profile.png','download','existsSync','root','server/files/images/','getContacts','CmContact','CmList','List','Tag','Tags','tag','nolimit','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','rows','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','login','phone','mobile','loginInPause','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','connection','remoteAddress','socket','UserVoiceQueueRt','destroy','getVoiceQueues','push','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','all','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','resolve','logout','QueuePause','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','openchannelPause','pauseType','lastPauseAt','mail','chat','fax','sms','manual','getTeams','addTeams','omit','removeTeams','getLists','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','isArray','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','concat','$and','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$notILike','$like','$overlap','$contains','firstName','lastName','Contact','dialActive','CmHopper','getApiKey','createApiKey','apiKeyNonce','apiKeyIat','You\x20don\x27t\x20have\x20sufficient\x20privelages\x20to\x20access\x20this\x20resource.','removeApiKey','API\x20key\x20not\x20available','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','jayson/promise','http','test','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','get','user','Agents','agent','Telephones','filter','ignore','map','value','includes','role','name','UserProfileResource','stack','send','index','rawAttributes','differenceBy','keys','password','salt','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','where','pick','merge','type','key','sequelize','lower','col','field','options','User','count','includeAll','findAll','show','include','find','bulkCreate','body','params','addContacts','ids','agent\x20role','telephone','admin','getLicense','telephones','isNil','License\x20limit\x20reached','format','count\x20%s:\x20%s','create','internal','Setting','findById','securePassword','min_internal','max','QueryTypes','mailbox','VoiceMail','fullname','email','permissions','101','102','103','110','106','107','108','109','userProfileId','autoAssociation'];(function(_0x5d6916,_0x4023f5){var _0x16e351=function(_0x5e8ba4){while(--_0x5e8ba4){_0x5d6916['push'](_0x5d6916['shift']());}};_0x16e351(++_0x4023f5);}(_0x7f53,0xc0));var _0x37f5=function(_0x4191bc,_0x3096c5){_0x4191bc=_0x4191bc-0x0;var _0x1ffd4e=_0x7f53[_0x4191bc];return _0x1ffd4e;};'use strict';var pdf=require(_0x37f5('0x0'));var emlformat=require(_0x37f5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x37f5('0x2'));var jsonpatch=require(_0x37f5('0x3'));var rp=require(_0x37f5('0x4'));var moment=require('moment');var BPromise=require(_0x37f5('0x5'));var Mustache=require('mustache');var util=require(_0x37f5('0x6'));var path=require(_0x37f5('0x7'));var sox=require(_0x37f5('0x8'));var csv=require(_0x37f5('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x37f5('0xa'));var squel=require(_0x37f5('0xb'));var crypto=require(_0x37f5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x37f5('0xd'));var toCsv=require(_0x37f5('0x9'));var querystring=require(_0x37f5('0xe'));var Papa=require(_0x37f5('0xf'));var Redis=require(_0x37f5('0x10'));var authService=require(_0x37f5('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x37f5('0x12'));var logger=require(_0x37f5('0x13'))(_0x37f5('0x14'));var utils=require(_0x37f5('0x15'));var config=require(_0x37f5('0x16'));var db=require(_0x37f5('0x17'))['db'];config[_0x37f5('0x18')]=_['defaults'](config[_0x37f5('0x18')],{'host':_0x37f5('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x37f5('0x18')]));require('./user.socket')[_0x37f5('0x1a')](socket);var jayson=require(_0x37f5('0x1b'));var client=jayson['client'][_0x37f5('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x3b27c5,_0x48fb52,_0x550486){if(_0x550486){var _0x3a1f56=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3a1f56[_0x37f5('0x1d')](_0x48fb52)){return _0x3b27c5;}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 _0x3b27c5;}}function respondWithRpcPromise(_0x28793b,_0x42ee41,_0x58b9b7,_0x5142c){return new BPromise(function(_0x13c327,_0x26415f){var _0x3c3414=_0x5142c||client;return _0x3c3414['request'](_0x28793b,_0x58b9b7)[_0x37f5('0x1e')](function(_0xa77459){logger[_0x37f5('0x1f')](_0x37f5('0x20'),_0x42ee41,_0x37f5('0x21'));logger[_0x37f5('0x22')](_0x37f5('0x23'),_0x42ee41,_0x37f5('0x21'),JSON[_0x37f5('0x24')](_0xa77459));if(_0xa77459[_0x37f5('0x25')]){if(_0xa77459[_0x37f5('0x25')][_0x37f5('0x26')]===0x1f4){logger[_0x37f5('0x25')](_0x37f5('0x20'),_0x42ee41,_0xa77459[_0x37f5('0x25')]['message']);return _0x26415f(_0xa77459[_0x37f5('0x25')][_0x37f5('0x27')]);}logger[_0x37f5('0x25')](_0x37f5('0x20'),_0x42ee41,_0xa77459['error'][_0x37f5('0x27')]);return _0x13c327(_0xa77459[_0x37f5('0x25')]['message']);}else{logger[_0x37f5('0x1f')](_0x37f5('0x20'),_0x42ee41,_0x37f5('0x21'));_0x13c327(_0xa77459[_0x37f5('0x28')]['message']);}})[_0x37f5('0x29')](function(_0x46e541){logger['error'](_0x37f5('0x20'),_0x42ee41,_0x46e541);_0x26415f(_0x46e541);});});}function respondWithStatusCode(_0x391283,_0xb022ab){_0xb022ab=_0xb022ab||0xcc;return function(_0x59d1da){if(_0x59d1da){return _0x391283[_0x37f5('0x2a')](_0xb022ab);}return _0x391283[_0x37f5('0x2b')](_0xb022ab)['end']();};}function respondWithResult(_0x5b10f7,_0x44afcd){_0x44afcd=_0x44afcd||0xc8;return function(_0x3ee6f1){if(_0x3ee6f1){return _0x5b10f7[_0x37f5('0x2b')](_0x44afcd)[_0x37f5('0x2c')](_0x3ee6f1);}};}function respondWithFilteredResult(_0x57a07d,_0x391149){return function(_0x231250){if(_0x231250){var _0x3bef4a=_0x231250['count'],_0x2a5f4a=_0x391149[_0x37f5('0x2d')],_0x269b60=_0x391149[_0x37f5('0x2d')]+_0x391149[_0x37f5('0x2e')],_0x3595d0;if(_0x269b60>=_0x3bef4a){_0x269b60=_0x3bef4a;_0x3595d0=0xc8;}else{_0x3595d0=0xce;}_0x57a07d['status'](_0x3595d0);return _0x57a07d[_0x37f5('0x2f')](_0x37f5('0x30'),_0x2a5f4a+'-'+_0x269b60+'/'+_0x3bef4a)[_0x37f5('0x2c')](_0x231250);}return null;};}function patchUpdates(_0x41caf5){return function(_0x59c7c9){try{jsonpatch[_0x37f5('0x31')](_0x59c7c9,_0x41caf5,!![]);}catch(_0x71c090){return BPromise[_0x37f5('0x32')](_0x71c090);}return _0x59c7c9[_0x37f5('0x33')]();};}function saveUpdates(_0x4c2f68,_0x2a1a4e){return function(_0x3fe329){if(_0x3fe329){return _0x3fe329[_0x37f5('0x34')](_0x4c2f68)[_0x37f5('0x1e')](function(_0x107c03){return _0x107c03;});}return null;};}function removeEntity(_0x2caebe,_0x3251ea){return function(_0x33e74e){if(_0x33e74e){return _0x33e74e['destroy']()[_0x37f5('0x1e')](function(){var _0x38720e=_0x33e74e[_0x37f5('0x35')]({'plain':!![]});var _0x435000=[{'name':'Users','value':_0x37f5('0x36'),'ignore':!![]},{'name':_0x37f5('0x37'),'value':_0x37f5('0x38'),'ignore':![]},{'name':_0x37f5('0x39'),'value':'telephone','ignore':![]}];var _0x40ba82=_(_0x435000)[_0x37f5('0x3a')](_0x37f5('0x3b'))[_0x37f5('0x3c')](_0x37f5('0x3d'))[_0x37f5('0x3d')]();if(_[_0x37f5('0x3e')](_0x40ba82,_0x38720e[_0x37f5('0x3f')])){return;}var _0x1fb095=_['find'](_0x435000,[_0x37f5('0x3d'),_0x38720e['role']])[_0x37f5('0x40')];return db[_0x37f5('0x41')]['destroy']({'where':{'type':_0x1fb095,'resourceId':_0x38720e['id']}})[_0x37f5('0x1e')](function(){return _0x33e74e;});})[_0x37f5('0x1e')](function(){_0x2caebe[_0x37f5('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32fcd7,_0x584000){return function(_0xef20cf){if(!_0xef20cf){_0x32fcd7[_0x37f5('0x2a')](0x194);}return _0xef20cf;};}function handleError(_0x181770,_0x116fba){_0x116fba=_0x116fba||0x1f4;return function(_0x4cbe42){logger['error'](_0x4cbe42[_0x37f5('0x42')]);if(_0x4cbe42[_0x37f5('0x40')]){delete _0x4cbe42['name'];}_0x181770[_0x37f5('0x2b')](_0x116fba)[_0x37f5('0x43')](_0x4cbe42);};}exports[_0x37f5('0x44')]=function(_0x2c473f,_0x1fa0ec){var _0x5636e9={},_0x20c57c={},_0x4c8a8c={'count':0x0,'rows':[]};var _0xf32b8c=db['User'][_0x37f5('0x45')];_0x20c57c['model']=_[_0x37f5('0x46')](_[_0x37f5('0x47')](_0xf32b8c),[_0x37f5('0x48'),_0x37f5('0x49')]);_0x20c57c['query']=_['keys'](_0x2c473f[_0x37f5('0x4a')]);_0x20c57c[_0x37f5('0x4b')]=_[_0x37f5('0x4c')](_0x20c57c['model'],_0x20c57c['query']);_0x5636e9[_0x37f5('0x4d')]=_['intersection'](_0x20c57c['model'],qs[_0x37f5('0x4e')](_0x2c473f[_0x37f5('0x4a')][_0x37f5('0x4e')]));_0x5636e9[_0x37f5('0x4d')]=_0x5636e9[_0x37f5('0x4d')][_0x37f5('0x4f')]?_0x5636e9[_0x37f5('0x4d')]:_0x20c57c[_0x37f5('0x50')];if(!_0x2c473f[_0x37f5('0x4a')][_0x37f5('0x51')]('nolimit')){_0x5636e9[_0x37f5('0x2e')]=qs[_0x37f5('0x2e')](_0x2c473f[_0x37f5('0x4a')][_0x37f5('0x2e')]);_0x5636e9['offset']=qs[_0x37f5('0x2d')](_0x2c473f['query']['offset']);}_0x5636e9[_0x37f5('0x52')]=qs[_0x37f5('0x53')](_0x2c473f[_0x37f5('0x4a')]['sort']);_0x5636e9[_0x37f5('0x54')]=qs[_0x37f5('0x4b')](_[_0x37f5('0x55')](_0x2c473f[_0x37f5('0x4a')],_0x20c57c[_0x37f5('0x4b')]));if(_0x2c473f[_0x37f5('0x4a')][_0x37f5('0x3a')]){_0x5636e9[_0x37f5('0x54')]=_[_0x37f5('0x56')](_0x5636e9[_0x37f5('0x54')],{'$or':_[_0x37f5('0x3c')](_0xf32b8c,function(_0x5d2f4e){if(_0x5d2f4e[_0x37f5('0x57')][_0x37f5('0x58')]!=='VIRTUAL'){return db[_0x37f5('0x59')][_0x37f5('0x54')](db[_0x37f5('0x59')]['fn'](_0x37f5('0x5a'),db[_0x37f5('0x59')][_0x37f5('0x5b')](_0x5d2f4e[_0x37f5('0x5c')])),{'$like':db[_0x37f5('0x59')]['fn'](_0x37f5('0x5a'),'%'+_0x2c473f[_0x37f5('0x4a')]['filter']+'%')});}})});}_0x5636e9=_['merge']({},_0x5636e9,_0x2c473f[_0x37f5('0x5d')]);var _0x437b69={'where':_0x5636e9[_0x37f5('0x54')]};return db[_0x37f5('0x5e')][_0x37f5('0x5f')](_0x437b69)[_0x37f5('0x1e')](function(_0x429324){_0x4c8a8c[_0x37f5('0x5f')]=_0x429324;if(_0x2c473f[_0x37f5('0x4a')][_0x37f5('0x60')]){_0x5636e9['include']=[{'all':!![]}];}return db[_0x37f5('0x5e')][_0x37f5('0x61')](_0x5636e9);})[_0x37f5('0x1e')](function(_0xd6c1f8){_0x4c8a8c['rows']=_0xd6c1f8;return _0x4c8a8c;})['then'](respondWithFilteredResult(_0x1fa0ec,_0x5636e9))['catch'](handleError(_0x1fa0ec,null));};exports[_0x37f5('0x62')]=function(_0x59b6be,_0x26fc5f){var _0x187bc1={'raw':![],'where':{'id':_0x59b6be['params']['id']}},_0x32c908={};_0x32c908['model']=_[_0x37f5('0x46')](_['keys'](db[_0x37f5('0x5e')][_0x37f5('0x45')]),['password','salt']);_0x32c908[_0x37f5('0x4a')]=_[_0x37f5('0x47')](_0x59b6be['query']);_0x32c908['filters']=_[_0x37f5('0x4c')](_0x32c908[_0x37f5('0x50')],_0x32c908['query']);_0x187bc1['attributes']=_[_0x37f5('0x4c')](_0x32c908[_0x37f5('0x50')],qs[_0x37f5('0x4e')](_0x59b6be[_0x37f5('0x4a')][_0x37f5('0x4e')]));_0x187bc1[_0x37f5('0x4d')]=_0x187bc1['attributes'][_0x37f5('0x4f')]?_0x187bc1[_0x37f5('0x4d')]:_0x32c908[_0x37f5('0x50')];if(_0x59b6be['query']['includeAll']){_0x187bc1[_0x37f5('0x63')]=[{'all':!![]}];}_0x187bc1=_[_0x37f5('0x56')]({},_0x187bc1,_0x59b6be[_0x37f5('0x5d')]);return db[_0x37f5('0x5e')][_0x37f5('0x64')](_0x187bc1)[_0x37f5('0x1e')](handleEntityNotFound(_0x26fc5f,null))[_0x37f5('0x1e')](respondWithResult(_0x26fc5f,null))[_0x37f5('0x29')](handleError(_0x26fc5f,null));};exports[_0x37f5('0x65')]=function(_0x30893e,_0x2082c5){return db[_0x37f5('0x5e')]['bulkCreate'](_0x30893e[_0x37f5('0x66')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2082c5,0xc9))[_0x37f5('0x29')](handleError(_0x2082c5,null));};exports[_0x37f5('0x34')]=function(_0x509086,_0x3a3198){if(_0x509086['body']['id']){delete _0x509086[_0x37f5('0x66')]['id'];}delete _0x509086['body']['role'];return db[_0x37f5('0x5e')]['find']({'where':{'id':_0x509086[_0x37f5('0x67')]['id']}})['then'](handleEntityNotFound(_0x3a3198,null))[_0x37f5('0x1e')](saveUpdates(_0x509086[_0x37f5('0x66')],null))['then'](respondWithResult(_0x3a3198,null))['catch'](handleError(_0x3a3198,null));};exports['describe']=function(_0x2763fa,_0x54060d){return db[_0x37f5('0x5e')]['describe']()['then'](respondWithResult(_0x54060d,null))[_0x37f5('0x29')](handleError(_0x54060d,null));};exports[_0x37f5('0x68')]=function(_0xbacfe5,_0x386f9f,_0x25bb0d){return db[_0x37f5('0x5e')][_0x37f5('0x64')]({'where':{'id':_0xbacfe5['params']['id']}})['then'](handleEntityNotFound(_0x386f9f,null))[_0x37f5('0x1e')](function(_0x5cc0e7){if(_0x5cc0e7){return _0x5cc0e7[_0x37f5('0x68')](_0xbacfe5[_0x37f5('0x66')][_0x37f5('0x69')],_['omit'](_0xbacfe5['body'],[_0x37f5('0x69'),'id'])||{});}})['then'](respondWithResult(_0x386f9f,null))['catch'](handleError(_0x386f9f,null));};var getLicense=function(_0x131587){return new BPromise(function(_0x7bf99b,_0x1ea696){var _0x5b717c=0x0;_0x131587['body']['role']===_0x37f5('0x38')&&_0x7bf99b(_0x37f5('0x6a'));return db[_0x37f5('0x5e')][_0x37f5('0x5f')]({'where':{'$or':[{'role':_0x131587[_0x37f5('0x66')]['role']===_0x37f5('0x6b')?'telephone':[_0x37f5('0x6c'),_0x37f5('0x36')]}]}})[_0x37f5('0x1e')](function(_0x5548ba){_0x5b717c=_0x5548ba;return require('../../config/license/util')[_0x37f5('0x6d')]();})[_0x37f5('0x1e')](function(_0x494ab8){var _0x3f73c2=_0x131587[_0x37f5('0x66')][_0x37f5('0x3f')]==='telephone'?_0x37f5('0x6e'):'users';if(!_[_0x37f5('0x6f')](_0x494ab8[_0x3f73c2])&&_0x5b717c>=_0x494ab8[_0x3f73c2]){return _0x1ea696({'message':_0x37f5('0x70')});}return _0x7bf99b(util[_0x37f5('0x71')](_0x37f5('0x72'),_0x3f73c2,_0x5b717c));})[_0x37f5('0x29')](function(_0x367351){return _0x1ea696(_0x367351);});});};exports[_0x37f5('0x73')]=function(_0x39f9b2,_0x56d462){return getLicense(_0x39f9b2)['then'](function(_0x1bbb75){if(!_0x39f9b2['body'][_0x37f5('0x74')]){var _0x188e59;return db[_0x37f5('0x75')][_0x37f5('0x76')](0x1)[_0x37f5('0x1e')](function(_0x40fa3d){_0x40fa3d[_0x37f5('0x77')]=!![];return checkPasswordPattern(_0x40fa3d,_0x39f9b2[_0x37f5('0x66')][_0x37f5('0x48')],_0x40fa3d[_0x37f5('0x77')]);})[_0x37f5('0x1e')](function(_0x53f44a){_0x188e59=_0x53f44a[_0x37f5('0x78')];return db['User'][_0x37f5('0x79')]('internal');})[_0x37f5('0x1e')](function(_0x5d678f){if(_[_0x37f5('0x6f')](_0x5d678f)){if(_0x188e59){_0x39f9b2[_0x37f5('0x66')][_0x37f5('0x74')]=_0x188e59;}else{_0x39f9b2[_0x37f5('0x66')][_0x37f5('0x74')]=0x1;}}else{if(_[_0x37f5('0x6f')](_0x188e59)||_0x188e59==_0x5d678f){_0x39f9b2['body'][_0x37f5('0x74')]=_0x5d678f+0x1;}else if(_0x188e59>_0x5d678f){_0x39f9b2[_0x37f5('0x66')][_0x37f5('0x74')]=_0x188e59;}else{return db[_0x37f5('0x59')][_0x37f5('0x4a')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x37f5('0x59')][_0x37f5('0x7a')]['SELECT']})[_0x37f5('0x1e')](function(_0x164766){if(_0x164766&&_0x164766[_0x37f5('0x4f')]){for(var _0xf539d=0x0,_0x4ed8bd=_0x164766[_0x37f5('0x4f')];_0xf539d<_0x4ed8bd&&_[_0x37f5('0x6f')](_0x39f9b2[_0x37f5('0x66')][_0x37f5('0x74')]);_0xf539d++){if(_0x188e59<=_0x164766[_0xf539d]['from']){_0x39f9b2[_0x37f5('0x66')][_0x37f5('0x74')]=_0x164766[_0xf539d]['from'];}else if(_0x188e59>_0x164766[_0xf539d]['from']&&_0x188e59<=_0x164766[_0xf539d]['to']){_0x39f9b2[_0x37f5('0x66')][_0x37f5('0x74')]=_0x188e59;}}}if(_[_0x37f5('0x6f')](_0x39f9b2[_0x37f5('0x66')][_0x37f5('0x74')])){_0x39f9b2[_0x37f5('0x66')][_0x37f5('0x74')]=_0x5d678f+0x1;}});}}});}})[_0x37f5('0x1e')](function(){if(_0x39f9b2[_0x37f5('0x66')]['voicemail']){_0x39f9b2[_0x37f5('0x66')][_0x37f5('0x7b')]=_0x39f9b2[_0x37f5('0x66')][_0x37f5('0x74')];_0x39f9b2[_0x37f5('0x66')][_0x37f5('0x7c')]={'mailbox':_0x39f9b2['body'][_0x37f5('0x74')],'password':_0x39f9b2[_0x37f5('0x66')][_0x37f5('0x48')],'fullname':_0x39f9b2[_0x37f5('0x66')][_0x37f5('0x7d')],'email':_0x39f9b2[_0x37f5('0x66')][_0x37f5('0x7e')]};}if(_0x39f9b2['body']&&_0x39f9b2[_0x37f5('0x66')]['role']===_0x37f5('0x38')){_0x39f9b2[_0x37f5('0x66')][_0x37f5('0x7f')]=[_0x37f5('0x80'),_0x37f5('0x81'),_0x37f5('0x82'),_0x37f5('0x83'),'104','105',_0x37f5('0x84'),_0x37f5('0x85'),_0x37f5('0x86'),_0x37f5('0x87'),'100','111'];}return db[_0x37f5('0x5e')][_0x37f5('0x73')](_0x39f9b2[_0x37f5('0x66')],{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})[_0x37f5('0x1e')](function(_0x15a594){if(_0x39f9b2[_0x37f5('0x66')]['role']==='user')return _0x15a594;var _0x5fd516=_0x39f9b2[_0x37f5('0x36')][_0x37f5('0x35')]({'plain':!![]});if(!_0x5fd516)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5fd516[_0x37f5('0x3f')]===_0x37f5('0x36')){var _0x2fab05=_0x15a594['get']({'plain':!![]});var _0x301150=[{'name':_0x37f5('0x37'),'value':_0x37f5('0x38')},{'name':'Telephones','value':_0x37f5('0x6b')}];var _0x1e9016=_[_0x37f5('0x64')](_0x301150,[_0x37f5('0x3d'),_0x2fab05[_0x37f5('0x3f')]])['name'];return db['UserProfileSection'][_0x37f5('0x64')]({'where':{'name':_0x1e9016,'userProfileId':_0x5fd516[_0x37f5('0x88')]},'raw':!![]})[_0x37f5('0x1e')](function(_0x746b53){if(_0x746b53&&_0x746b53[_0x37f5('0x89')]===0x0){return db[_0x37f5('0x41')][_0x37f5('0x73')]({'name':_0x2fab05[_0x37f5('0x40')],'resourceId':_0x2fab05['id'],'type':_0x746b53[_0x37f5('0x40')],'sectionId':_0x746b53['id']},{})[_0x37f5('0x1e')](function(){return _0x15a594;});}else{return _0x15a594;}})[_0x37f5('0x29')](function(_0x2d7186){logger['error'](_0x37f5('0x8a'),_0x2d7186);throw _0x2d7186;});}return _0x15a594;})[_0x37f5('0x1e')](respondWithResult(_0x56d462,0xc9))[_0x37f5('0x29')](handleError(_0x56d462,null));};exports['changePassword']=function(_0x12bba1,_0x1e5fb6,_0x13e1f0){var _0x19d18a=![];if(_0x12bba1[_0x37f5('0x66')]['id']){delete _0x12bba1[_0x37f5('0x66')]['id'];}if(!_[_0x37f5('0x6f')](_0x12bba1['body']['oldPassword'])){if(_0x12bba1['body'][_0x37f5('0x8b')]===_0x12bba1['body'][_0x37f5('0x8c')]){throw new Error(_0x37f5('0x8d'));}}return db['User']['find']({'where':{'id':_0x12bba1['params']['id']}})[_0x37f5('0x1e')](function(_0x3e281c){if(_0x3e281c){if(_0x3e281c['id']==_0x12bba1[_0x37f5('0x36')]['id']){if(!_0x12bba1['body'][_0x37f5('0x8b')]||!_0x12bba1[_0x37f5('0x66')][_0x37f5('0x8c')]){throw new db[(_0x37f5('0x8e'))][(_0x37f5('0x8f'))](_0x37f5('0x90'));}if(!_0x3e281c['authenticate'](_0x12bba1['body'][_0x37f5('0x8b')])){throw new db['Sequelize'][(_0x37f5('0x8f'))](_0x37f5('0x91'));}if(_0x12bba1['body'][_0x37f5('0x8b')]==_0x12bba1['body'][_0x37f5('0x8c')]){throw new db[(_0x37f5('0x8e'))][(_0x37f5('0x8f'))](_0x37f5('0x92'));}return _0x3e281c;}else if(_0x12bba1[_0x37f5('0x36')][_0x37f5('0x3f')]==_0x37f5('0x6c')){if(!_0x12bba1[_0x37f5('0x66')]['newPassword']){throw new db[(_0x37f5('0x8e'))][(_0x37f5('0x8f'))](_0x37f5('0x93'));}return _0x3e281c;}else if(_0x12bba1['user'][_0x37f5('0x3f')]==_0x37f5('0x36')){if(!_0x12bba1[_0x37f5('0x66')][_0x37f5('0x8c')]){throw new db[(_0x37f5('0x8e'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x3e281c['role']!=_0x37f5('0x38')){throw new db[(_0x37f5('0x8e'))][(_0x37f5('0x8f'))](_0x37f5('0x94'));}return _0x3e281c;}else{throw new db['Sequelize'][(_0x37f5('0x8f'))](_0x37f5('0x94'));}}return null;})[_0x37f5('0x1e')](handleEntityNotFound(_0x1e5fb6,null))[_0x37f5('0x1e')](function(_0x3fbca6){return db[_0x37f5('0x75')][_0x37f5('0x95')]({'attributes':['id',_0x37f5('0x77')]})[_0x37f5('0x1e')](function(_0x2937a8){_0x19d18a=_0x2937a8[_0x37f5('0x77')];return checkPasswordPattern(_0x3fbca6,_0x12bba1[_0x37f5('0x66')][_0x37f5('0x8c')],_0x19d18a);});})['then'](saveUpdates({'password':_0x12bba1['body'][_0x37f5('0x8c')],'passwordResetAt':_0x12bba1[_0x37f5('0x36')]['id']==_0x12bba1[_0x37f5('0x67')]['id']?moment():null},null))['then'](respondWithResult(_0x1e5fb6,null))[_0x37f5('0x29')](handleError(_0x1e5fb6,null));};exports['addQueues']=function(_0x58bd75,_0x3710c4,_0x4198d9){var _0x1ae451=_0x58bd75[_0x37f5('0x66')][_0x37f5('0x96')];return db[_0x37f5('0x5e')][_0x37f5('0x64')]({'where':{'id':_0x58bd75['params']['id']},'attributes':['id','name',_0x37f5('0x3f'),'online','loginInPause',_0x37f5('0x97'),_0x37f5('0x98')]})[_0x37f5('0x1e')](handleEntityNotFound(_0x3710c4,null))[_0x37f5('0x1e')](function(_0x51cf40){if(_0x51cf40){if(!utils[_0x37f5('0x99')](_0x1ae451)){throw new db[(_0x37f5('0x8e'))][(_0x37f5('0x8f'))](_0x37f5('0x9a'));}return _0x51cf40[_0x37f5('0x9b')+_[_0x37f5('0x9c')](_0x1ae451[_0x37f5('0x9d')]())+_0x37f5('0x9e')](_0x58bd75['body'][_0x37f5('0x69')],{'penalty':_0x58bd75[_0x37f5('0x66')]['penalty']||0x0})['spread'](function(_0x26d3fd){for(var _0x474d32=0x0;_0x474d32<_0x58bd75[_0x37f5('0x66')][_0x37f5('0x69')]['length'];_0x474d32+=0x1){var _0x401738={'UserId':_0x58bd75[_0x37f5('0x67')]['id']};_0x401738[_[_0x37f5('0x9c')](_0x1ae451['toLowerCase']())+_0x37f5('0x9f')]=_0x58bd75[_0x37f5('0x66')][_0x37f5('0x69')][_0x474d32];socket[_0x37f5('0xa0')]('user'+_[_0x37f5('0x9c')](_0x1ae451['toLowerCase']())+_0x37f5('0xa1'),_0x401738);}return _0x26d3fd;})[_0x37f5('0x1e')](function(){if(_0x1ae451===_0x37f5('0xa2')){return db[_0x37f5('0xa3')][_0x37f5('0x61')]({'where':{'id':_0x58bd75[_0x37f5('0x66')]['ids']||[]},'raw':!![],'attributes':['id',_0x37f5('0x40')]});}})['then'](function(_0x268cfc){var _0x21c862=_0x51cf40[_0x37f5('0x35')]({'plain':!![]});var _0xc5ee65=[];if(_0x1ae451===_0x37f5('0xa2')&&_0x21c862['role']===_0x37f5('0x38')&&_0x21c862[_0x37f5('0xa4')]){for(var _0x181d37=0x0;_0x181d37<_0x268cfc[_0x37f5('0x4f')];_0x181d37+=0x1){_0xc5ee65['push']({'membername':_0x21c862['name'],'UserId':_0x21c862['id'],'queue_name':_0x268cfc[_0x181d37][_0x37f5('0x40')],'VoiceQueueId':_0x268cfc[_0x181d37]['id'],'interface':_['isNil'](_0x21c862[_0x37f5('0x98')])?util[_0x37f5('0x71')](_0x37f5('0xa5'),_0x21c862[_0x37f5('0x40')]):_0x21c862[_0x37f5('0x98')],'paused':_0x21c862[_0x37f5('0x97')]||![],'penalty':_0x58bd75['body']['penalty']||0x0});}return BPromise[_0x37f5('0xa6')](_0xc5ee65,function(_0xe29ace){return db['UserVoiceQueueRt'][_0x37f5('0xa7')](_0xe29ace);});}return _0x51cf40;});}})[_0x37f5('0x1e')](respondWithStatusCode(_0x3710c4,null))[_0x37f5('0x29')](handleError(_0x3710c4,null));};exports[_0x37f5('0xa8')]=function(_0x5a820c,_0x53b447,_0x4dd873){var _0x383796;return db['User']['find']({'where':{'id':_0x5a820c[_0x37f5('0x67')]['id']},'attributes':['id',_0x37f5('0x40'),'role']})['then'](handleEntityNotFound(_0x53b447,null))[_0x37f5('0x1e')](function(_0x36b048){if(_0x36b048){_0x383796=_0x36b048;if(!_0x5a820c[_0x37f5('0x4a')][_0x37f5('0x96')]||!utils[_0x37f5('0x99')](_0x5a820c['query']['channel'])){throw new db['Sequelize']['ValidationError'](_0x37f5('0x9a'));}return _0x36b048['remove'+_['capitalize'](_0x5a820c['query'][_0x37f5('0x96')][_0x37f5('0x9d')]())+_0x37f5('0x9e')](_0x5a820c[_0x37f5('0x4a')]['ids']);}})[_0x37f5('0x1e')](function(_0x2c3527){for(var _0x1bff8c=0x0;_0x1bff8c<_0x5a820c['query']['ids'][_0x37f5('0x4f')];_0x1bff8c+=0x1){var _0x3ad6c8={'UserId':_0x5a820c[_0x37f5('0x67')]['id']};_0x3ad6c8[_[_0x37f5('0x9c')](_0x5a820c[_0x37f5('0x4a')][_0x37f5('0x96')][_0x37f5('0x9d')]())+'QueueId']=_0x5a820c[_0x37f5('0x4a')][_0x37f5('0x69')][_0x1bff8c];socket['emit'](_0x37f5('0x36')+_[_0x37f5('0x9c')](_0x5a820c[_0x37f5('0x4a')][_0x37f5('0x96')][_0x37f5('0x9d')]())+'Queue:remove',_0x3ad6c8);}return _0x2c3527;})['then'](function(){if(_0x5a820c['query']['channel']===_0x37f5('0xa2')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x5a820c['params']['id'],'VoiceQueueId':_0x5a820c['query'][_0x37f5('0x69')]},'individualHooks':!![]})[_0x37f5('0x1e')](function(){return _0x383796;});}return _0x383796;})[_0x37f5('0x1e')](respondWithStatusCode(_0x53b447,null))[_0x37f5('0x29')](handleError(_0x53b447,null));};exports[_0x37f5('0xa9')]=function(_0x5bcce8,_0x7a3b55,_0x38ccf4){_0x5bcce8[_0x37f5('0x66')][_0x37f5('0xaa')]=_0x5bcce8[_0x37f5('0xab')][_0x37f5('0xac')];return db['User'][_0x37f5('0x64')]({'where':{'id':_0x5bcce8[_0x37f5('0x67')]['id']}})[_0x37f5('0x1e')](handleEntityNotFound(_0x7a3b55,null))[_0x37f5('0x1e')](saveUpdates(_0x5bcce8[_0x37f5('0x66')],null))[_0x37f5('0x1e')](respondWithResult(_0x7a3b55,null))[_0x37f5('0x29')](handleError(_0x7a3b55,null));};exports['getAvatar']=function(_0xad3d0b,_0xb42a6f,_0x8e7ab1){var _0xfe1df2=path[_0x37f5('0xad')](config['root'],_0x37f5('0xae'));return db[_0x37f5('0x5e')][_0x37f5('0x64')]({'where':{'id':_0xad3d0b[_0x37f5('0x67')]['id']},'attributes':['id',_0x37f5('0xaa')],'raw':!![]})[_0x37f5('0x1e')](handleEntityNotFound(_0xb42a6f,null))[_0x37f5('0x1e')](function(_0x1f294f){if(_0x1f294f){if(_[_0x37f5('0x6f')](_0x1f294f[_0x37f5('0xaa')])){return _0xb42a6f[_0x37f5('0xaf')](_0xfe1df2);}else{if(!fs[_0x37f5('0xb0')](path[_0x37f5('0xad')](config[_0x37f5('0xb1')],'server/files/images/',_0x1f294f[_0x37f5('0xaa')]))){return _0xb42a6f[_0x37f5('0xaf')](_0xfe1df2);}return _0xb42a6f[_0x37f5('0xaf')](path['join'](config[_0x37f5('0xb1')],_0x37f5('0xb2'),_0x1f294f[_0x37f5('0xaa')]));}}})['catch'](handleError(_0xb42a6f,null));};exports[_0x37f5('0xb3')]=function(_0xafac99,_0x454d4a,_0x313a27){var _0x2a6d1c={};var _0x51c181={};var _0x58685c;var _0x1b696f;return db['User']['findOne']({'where':{'id':_0xafac99[_0x37f5('0x67')]['id']}})[_0x37f5('0x1e')](handleEntityNotFound(_0x454d4a,null))[_0x37f5('0x1e')](function(_0x4b46a1){if(_0x4b46a1){_0x58685c=_0x4b46a1;_0x51c181[_0x37f5('0x50')]=_[_0x37f5('0x47')](db[_0x37f5('0xb4')][_0x37f5('0x45')]);_0x51c181[_0x37f5('0x4a')]=_[_0x37f5('0x47')](_0xafac99[_0x37f5('0x4a')]);_0x51c181[_0x37f5('0x4b')]=_[_0x37f5('0x4c')](_0x51c181[_0x37f5('0x50')],_0x51c181['query']);_0x2a6d1c[_0x37f5('0x4d')]=_[_0x37f5('0x4c')](_0x51c181[_0x37f5('0x50')],qs[_0x37f5('0x4e')](_0xafac99[_0x37f5('0x4a')]['fields']));_0x2a6d1c[_0x37f5('0x4d')]=_0x2a6d1c[_0x37f5('0x4d')][_0x37f5('0x4f')]?_0x2a6d1c['attributes']:_0x51c181[_0x37f5('0x50')];_0x2a6d1c['order']=qs[_0x37f5('0x53')](_0xafac99['query'][_0x37f5('0x53')]);_0x2a6d1c[_0x37f5('0x54')]=qs[_0x37f5('0x4b')](_['pick'](_0xafac99['query'],_0x51c181['filters']));if(_0xafac99[_0x37f5('0x4a')][_0x37f5('0x3a')]){_0x2a6d1c['where']=_[_0x37f5('0x56')](_0x2a6d1c[_0x37f5('0x54')],{'$or':_[_0x37f5('0x3c')](_0x2a6d1c['attributes'],function(_0x3b2d1d){var _0x343b1e={};_0x343b1e[_0x3b2d1d]={'$like':'%'+_0xafac99[_0x37f5('0x4a')]['filter']+'%'};return _0x343b1e;})});}_0x2a6d1c=_[_0x37f5('0x56')]({},_0x2a6d1c,_0xafac99[_0x37f5('0x5d')]);return _0x58685c[_0x37f5('0xb3')](_0x2a6d1c);}})['then'](function(_0x25837d){if(_0x25837d){_0x1b696f=_0x25837d['length'];if(_0xafac99['query'][_0x37f5('0x51')]('includeAll')){_0x2a6d1c[_0x37f5('0x63')]=[{'model':db[_0x37f5('0xb5')],'as':_0x37f5('0xb6'),'required':![]},{'model':db[_0x37f5('0xb7')],'as':_0x37f5('0xb8'),'attributes':['id',_0x37f5('0x40'),'color'],'where':_0xafac99[_0x37f5('0x4a')]['tag']?{'id':_0xafac99[_0x37f5('0x4a')][_0x37f5('0xb9')]}:undefined,'required':_0xafac99['query'][_0x37f5('0xb9')]?!![]:![]}];}if(!_0xafac99[_0x37f5('0x4a')][_0x37f5('0x51')](_0x37f5('0xba'))){_0x2a6d1c[_0x37f5('0x2e')]=qs[_0x37f5('0x2e')](_0xafac99[_0x37f5('0x4a')][_0x37f5('0x2e')]);_0x2a6d1c['offset']=qs['offset'](_0xafac99['query'][_0x37f5('0x2d')]);}return _0x58685c[_0x37f5('0xb3')](_0x2a6d1c);}})['then'](function(_0x765aff){if(_0x765aff){return _0x765aff?{'count':_0x1b696f,'rows':_0x765aff}:null;}})[_0x37f5('0x1e')](respondWithResult(_0x454d4a,null))[_0x37f5('0x29')](handleError(_0x454d4a,null));};exports[_0x37f5('0xbb')]=function(_0xd4225f,_0x2e6b59,_0x340a59){var _0x3d262e;var _0x1b0558;var _0x55da8a={};var _0x1d5484;return db[_0x37f5('0x5e')][_0x37f5('0x95')]({'where':{'id':_0xd4225f[_0x37f5('0x67')]['id']},'attributes':['id',_0x37f5('0x40'),'role']})['then'](handleEntityNotFound(_0x2e6b59,null))['then'](function(_0x5a9915){if(!utils['isValidChannel'](_0xd4225f[_0x37f5('0x4a')][_0x37f5('0x96')])){throw new db[(_0x37f5('0x8e'))]['ValidationError'](_0x37f5('0x9a'));}_0x3d262e=_0x5a9915;var _0x528c99={};_0x528c99[_0x37f5('0x50')]=_['keys'](db[_[_0x37f5('0x9c')](_0xd4225f[_0x37f5('0x4a')][_0x37f5('0x96')])+_0x37f5('0xbc')][_0x37f5('0x45')]);_0x528c99['query']=_['keys'](_0xd4225f[_0x37f5('0x4a')]);_0x528c99[_0x37f5('0x4b')]=_[_0x37f5('0x4c')](_0x528c99['model'],_0x528c99['query']);_0x55da8a[_0x37f5('0x4d')]=_[_0x37f5('0x4c')](_0x528c99[_0x37f5('0x50')],qs[_0x37f5('0x4e')](_0xd4225f[_0x37f5('0x4a')][_0x37f5('0x4e')]));_0x55da8a[_0x37f5('0x4d')]=_0x55da8a['attributes'][_0x37f5('0x4f')]?_0x55da8a['attributes']:_0x528c99[_0x37f5('0x50')];_0x55da8a[_0x37f5('0x52')]=qs[_0x37f5('0x53')](_0xd4225f[_0x37f5('0x4a')]['sort']);_0x55da8a[_0x37f5('0x54')]=qs[_0x37f5('0x4b')](_[_0x37f5('0x55')](_0xd4225f[_0x37f5('0x4a')],_0x528c99[_0x37f5('0x4b')]));if(_0xd4225f[_0x37f5('0x4a')][_0x37f5('0x3a')]){_0x55da8a[_0x37f5('0x54')]=_[_0x37f5('0x56')](_0x55da8a[_0x37f5('0x54')],{'$or':_[_0x37f5('0x3c')](_0x55da8a[_0x37f5('0x4d')],function(_0x567cc7){var _0x3badae={};_0x3badae[_0x567cc7]={'$like':'%'+_0xd4225f[_0x37f5('0x4a')][_0x37f5('0x3a')]+'%'};return _0x3badae;})});}_0x55da8a=_['merge']({},_0x55da8a,_0xd4225f[_0x37f5('0x5d')]);switch(_0x3d262e[_0x37f5('0x3f')]){case _0x37f5('0x6c'):return db[_[_0x37f5('0x9c')](_0xd4225f[_0x37f5('0x4a')]['channel'])+_0x37f5('0xbc')]['findAll'](_0x55da8a);case _0x37f5('0x36'):case _0x37f5('0x38'):return _0x3d262e[_0x37f5('0x35')+_[_0x37f5('0x9c')](_0xd4225f[_0x37f5('0x4a')][_0x37f5('0x96')])+'Queues'](_0x55da8a);default:throw new db[(_0x37f5('0x8e'))][(_0x37f5('0x8f'))](_0x37f5('0xbd'));}})['then'](function(_0x2d8699){_0x1d5484=_0x2d8699[_0x37f5('0x4f')];if(!_0xd4225f[_0x37f5('0x4a')]['hasOwnProperty']('nolimit')){_0x55da8a['limit']=qs[_0x37f5('0x2e')](_0xd4225f['query'][_0x37f5('0x2e')]);_0x55da8a['offset']=qs[_0x37f5('0x2d')](_0xd4225f[_0x37f5('0x4a')][_0x37f5('0x2d')]);}switch(_0x3d262e[_0x37f5('0x3f')]){case _0x37f5('0x6c'):return db[_[_0x37f5('0x9c')](_0xd4225f[_0x37f5('0x4a')][_0x37f5('0x96')])+_0x37f5('0xbc')][_0x37f5('0x61')](_0x55da8a);case'user':case _0x37f5('0x38'):return _0x3d262e[_0x37f5('0x35')+_[_0x37f5('0x9c')](_0xd4225f['query'][_0x37f5('0x96')])+_0x37f5('0x9e')](_0x55da8a);}})[_0x37f5('0x1e')](function(_0x2aa2c8){return{'count':_0x1d5484,'rows':_0x2aa2c8};})[_0x37f5('0x1e')](respondWithResult(_0x2e6b59,null))[_0x37f5('0x29')](handleError(_0x2e6b59,null));};exports[_0x37f5('0xbe')]=function(_0x4b7e42,_0xa8cb1c,_0x2abb0a){var _0x1447d2={};var _0x230036={};var _0x4b44e6;var _0x16b87f;return db[_0x37f5('0x5e')][_0x37f5('0x95')]({'where':{'id':_0x4b7e42['params']['id']}})['then'](handleEntityNotFound(_0xa8cb1c,null))[_0x37f5('0x1e')](function(_0x477b64){if(_0x477b64){_0x4b44e6=_0x477b64;_0x230036[_0x37f5('0x50')]=_['keys'](db['UserVoiceQueueRt'][_0x37f5('0x45')]);_0x230036['query']=_[_0x37f5('0x47')](_0x4b7e42[_0x37f5('0x4a')]);_0x230036[_0x37f5('0x4b')]=_[_0x37f5('0x4c')](_0x230036[_0x37f5('0x50')],_0x230036[_0x37f5('0x4a')]);_0x1447d2[_0x37f5('0x4d')]=_[_0x37f5('0x4c')](_0x230036[_0x37f5('0x50')],qs[_0x37f5('0x4e')](_0x4b7e42[_0x37f5('0x4a')][_0x37f5('0x4e')]));_0x1447d2[_0x37f5('0x4d')]=_0x1447d2['attributes'][_0x37f5('0x4f')]?_0x1447d2[_0x37f5('0x4d')]:_0x230036[_0x37f5('0x50')];_0x1447d2['order']=qs[_0x37f5('0x53')](_0x4b7e42[_0x37f5('0x4a')]['sort']);_0x1447d2[_0x37f5('0x54')]=qs[_0x37f5('0x4b')](_[_0x37f5('0x55')](_0x4b7e42[_0x37f5('0x4a')],_0x230036['filters']));if(_0x4b7e42['query']['filter']){_0x1447d2[_0x37f5('0x54')]=_['merge'](_0x1447d2[_0x37f5('0x54')],{'$or':_[_0x37f5('0x3c')](_0x1447d2[_0x37f5('0x4d')],function(_0x243073){var _0x1b3d67={};_0x1b3d67[_0x243073]={'$like':'%'+_0x4b7e42['query'][_0x37f5('0x3a')]+'%'};return _0x1b3d67;})});}_0x1447d2=_[_0x37f5('0x56')]({},_0x1447d2,_0x4b7e42[_0x37f5('0x5d')]);return _0x4b44e6[_0x37f5('0xbe')](_0x1447d2);}})[_0x37f5('0x1e')](function(_0x317a49){if(_0x317a49){_0x16b87f=_0x317a49[_0x37f5('0x4f')];if(!_0x4b7e42[_0x37f5('0x4a')]['hasOwnProperty'](_0x37f5('0xba'))){_0x1447d2[_0x37f5('0x2e')]=qs[_0x37f5('0x2e')](_0x4b7e42['query'][_0x37f5('0x2e')]);_0x1447d2[_0x37f5('0x2d')]=qs[_0x37f5('0x2d')](_0x4b7e42[_0x37f5('0x4a')][_0x37f5('0x2d')]);}return _0x4b44e6['getVoiceQueuesRt'](_0x1447d2);}})['then'](function(_0x3f9630){if(_0x3f9630){return _0x3f9630?{'count':_0x16b87f,'rows':_0x3f9630}:null;}})['then'](respondWithResult(_0xa8cb1c,null))[_0x37f5('0x29')](handleError(_0xa8cb1c,null));};exports[_0x37f5('0xbf')]=function(_0x5c9296,_0x456c39,_0x4a15a2){var _0x142b9f={};var _0x11c841={};var _0x3c301a;var _0x314b4d;return db[_0x37f5('0x5e')][_0x37f5('0x95')]({'where':{'id':_0x5c9296[_0x37f5('0x67')]['id']}})[_0x37f5('0x1e')](handleEntityNotFound(_0x456c39,null))['then'](function(_0x4d570a){if(_0x4d570a){_0x3c301a=_0x4d570a;_0x11c841[_0x37f5('0x50')]=_[_0x37f5('0x47')](db[_0x37f5('0xc0')][_0x37f5('0x45')]);_0x11c841[_0x37f5('0x4a')]=_['keys'](_0x5c9296[_0x37f5('0x4a')]);_0x11c841[_0x37f5('0x4b')]=_['intersection'](_0x11c841[_0x37f5('0x50')],_0x11c841[_0x37f5('0x4a')]);_0x142b9f[_0x37f5('0x4d')]=_['intersection'](_0x11c841[_0x37f5('0x50')],qs[_0x37f5('0x4e')](_0x5c9296['query'][_0x37f5('0x4e')]));_0x142b9f[_0x37f5('0x4d')]=_0x142b9f[_0x37f5('0x4d')][_0x37f5('0x4f')]?_0x142b9f[_0x37f5('0x4d')]:_0x11c841['model'];_0x142b9f[_0x37f5('0x52')]=qs[_0x37f5('0x53')](_0x5c9296[_0x37f5('0x4a')]['sort']);_0x142b9f[_0x37f5('0x54')]=qs[_0x37f5('0x4b')](_[_0x37f5('0x55')](_0x5c9296[_0x37f5('0x4a')],_0x11c841[_0x37f5('0x4b')]));if(_0x5c9296[_0x37f5('0x4a')][_0x37f5('0x3a')]){_0x142b9f[_0x37f5('0x54')]=_['merge'](_0x142b9f[_0x37f5('0x54')],{'$or':_[_0x37f5('0x3c')](_0x142b9f[_0x37f5('0x4d')],function(_0x36383c){var _0x4005c8={};_0x4005c8[_0x36383c]={'$like':'%'+_0x5c9296[_0x37f5('0x4a')]['filter']+'%'};return _0x4005c8;})});}_0x142b9f=_[_0x37f5('0x56')]({},_0x142b9f,_0x5c9296[_0x37f5('0x5d')]);return _0x3c301a[_0x37f5('0xbf')](_0x142b9f);}})[_0x37f5('0x1e')](function(_0x41ba6d){if(_0x41ba6d){_0x314b4d=_0x41ba6d[_0x37f5('0x4f')];if(!_0x5c9296[_0x37f5('0x4a')][_0x37f5('0x51')](_0x37f5('0xba'))){_0x142b9f[_0x37f5('0x2e')]=qs[_0x37f5('0x2e')](_0x5c9296[_0x37f5('0x4a')][_0x37f5('0x2e')]);_0x142b9f[_0x37f5('0x2d')]=qs[_0x37f5('0x2d')](_0x5c9296[_0x37f5('0x4a')]['offset']);}return _0x3c301a[_0x37f5('0xbf')](_0x142b9f);}})[_0x37f5('0x1e')](function(_0x5a8e99){if(_0x5a8e99){return _0x5a8e99?{'count':_0x314b4d,'rows':_0x5a8e99}:null;}})['then'](respondWithResult(_0x456c39,null))['catch'](handleError(_0x456c39,null));};exports[_0x37f5('0xc1')]=function(_0x4a303d,_0x1ee2ac,_0x4e6035){var _0x2a3fb9={'raw':!![],'where':{}};var _0x122039={};var _0x2cd252={'count':0x0,'rows':[]};return db[_0x37f5('0x5e')][_0x37f5('0x95')]({'where':{'id':_0x4a303d[_0x37f5('0x67')]['id']}})[_0x37f5('0x1e')](handleEntityNotFound(_0x1ee2ac,null))[_0x37f5('0x1e')](function(_0xc86632){if(_0xc86632){_0x122039[_0x37f5('0x50')]=_[_0x37f5('0x47')](db[_0x37f5('0xc2')][_0x37f5('0x45')]);_0x122039['query']=_[_0x37f5('0x47')](_0x4a303d[_0x37f5('0x4a')]);_0x122039[_0x37f5('0x4b')]=_[_0x37f5('0x4c')](_0x122039[_0x37f5('0x50')],_0x122039[_0x37f5('0x4a')]);_0x2a3fb9[_0x37f5('0x4d')]=_[_0x37f5('0x4c')](_0x122039[_0x37f5('0x50')],qs[_0x37f5('0x4e')](_0x4a303d[_0x37f5('0x4a')][_0x37f5('0x4e')]));_0x2a3fb9[_0x37f5('0x4d')]=_0x2a3fb9[_0x37f5('0x4d')][_0x37f5('0x4f')]?_0x2a3fb9[_0x37f5('0x4d')]:_0x122039['model'];if(!_0x4a303d[_0x37f5('0x4a')][_0x37f5('0x51')](_0x37f5('0xba'))){_0x2a3fb9[_0x37f5('0x2e')]=qs[_0x37f5('0x2e')](_0x4a303d[_0x37f5('0x4a')][_0x37f5('0x2e')]);_0x2a3fb9[_0x37f5('0x2d')]=qs['offset'](_0x4a303d['query']['offset']);}_0x2a3fb9[_0x37f5('0x52')]=qs[_0x37f5('0x53')](_0x4a303d[_0x37f5('0x4a')]['sort']);_0x2a3fb9[_0x37f5('0x54')]=qs[_0x37f5('0x4b')](_['pick'](_0x4a303d[_0x37f5('0x4a')],_0x122039['filters']));_0x2a3fb9[_0x37f5('0x54')][_0x37f5('0xc3')]=_0xc86632['id'];if(_0x4a303d[_0x37f5('0x4a')][_0x37f5('0x3a')]){_0x2a3fb9[_0x37f5('0x54')]=_[_0x37f5('0x56')](_0x2a3fb9[_0x37f5('0x54')],{'$or':_[_0x37f5('0x3c')](_0x2a3fb9[_0x37f5('0x4d')],function(_0x582ac1){var _0x92ece4={};_0x92ece4[_0x582ac1]={'$like':'%'+_0x4a303d[_0x37f5('0x4a')][_0x37f5('0x3a')]+'%'};return _0x92ece4;})});}_0x2a3fb9=_['merge']({},_0x2a3fb9,_0x4a303d[_0x37f5('0x5d')]);return db[_0x37f5('0xc2')][_0x37f5('0x5f')]({'where':_0x2a3fb9[_0x37f5('0x54')]})[_0x37f5('0x1e')](function(_0x38f657){_0x2cd252[_0x37f5('0x5f')]=_0x38f657;if(_0x4a303d[_0x37f5('0x4a')][_0x37f5('0x60')]){_0x2a3fb9['include']=[{'all':!![]}];}return db[_0x37f5('0xc2')][_0x37f5('0x61')](_0x2a3fb9);})[_0x37f5('0x1e')](function(_0xb3f488){_0x2cd252[_0x37f5('0xc4')]=_0xb3f488;return _0x2cd252;});}})['then'](respondWithFilteredResult(_0x1ee2ac,_0x2a3fb9))[_0x37f5('0x29')](handleError(_0x1ee2ac,null));};exports[_0x37f5('0xc5')]=function(_0x4271ff,_0x211619,_0x277db8){var _0x4ffb63={'raw':!![],'where':{}};var _0x194a7d={};var _0x71d5a7={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x4271ff[_0x37f5('0x67')]['id']}})[_0x37f5('0x1e')](handleEntityNotFound(_0x211619,null))[_0x37f5('0x1e')](function(_0x401665){if(_0x401665){_0x194a7d[_0x37f5('0x50')]=_['keys'](db[_0x37f5('0xc6')][_0x37f5('0x45')]);_0x194a7d[_0x37f5('0x4a')]=_['keys'](_0x4271ff['query']);_0x194a7d['filters']=_[_0x37f5('0x4c')](_0x194a7d[_0x37f5('0x50')],_0x194a7d['query']);_0x4ffb63[_0x37f5('0x4d')]=_[_0x37f5('0x4c')](_0x194a7d[_0x37f5('0x50')],qs[_0x37f5('0x4e')](_0x4271ff[_0x37f5('0x4a')][_0x37f5('0x4e')]));_0x4ffb63[_0x37f5('0x4d')]=_0x4ffb63[_0x37f5('0x4d')][_0x37f5('0x4f')]?_0x4ffb63[_0x37f5('0x4d')]:_0x194a7d['model'];if(!_0x4271ff[_0x37f5('0x4a')][_0x37f5('0x51')](_0x37f5('0xba'))){_0x4ffb63[_0x37f5('0x2e')]=qs[_0x37f5('0x2e')](_0x4271ff[_0x37f5('0x4a')][_0x37f5('0x2e')]);_0x4ffb63['offset']=qs[_0x37f5('0x2d')](_0x4271ff[_0x37f5('0x4a')][_0x37f5('0x2d')]);}_0x4ffb63[_0x37f5('0x52')]=qs[_0x37f5('0x53')](_0x4271ff['query']['sort']);_0x4ffb63[_0x37f5('0x54')]=qs[_0x37f5('0x4b')](_[_0x37f5('0x55')](_0x4271ff['query'],_0x194a7d[_0x37f5('0x4b')]));_0x4ffb63[_0x37f5('0x54')][_0x37f5('0xc3')]=_0x401665['id'];if(_0x4271ff[_0x37f5('0x4a')][_0x37f5('0x3a')]){_0x4ffb63['where']=_['merge'](_0x4ffb63['where'],{'$or':_[_0x37f5('0x3c')](_0x4ffb63[_0x37f5('0x4d')],function(_0x4f501e){var _0x35fb30={};_0x35fb30[_0x4f501e]={'$like':'%'+_0x4271ff['query']['filter']+'%'};return _0x35fb30;})});}_0x4ffb63=_[_0x37f5('0x56')]({},_0x4ffb63,_0x4271ff[_0x37f5('0x5d')]);return db[_0x37f5('0xc6')][_0x37f5('0x5f')]({'where':_0x4ffb63[_0x37f5('0x54')]})[_0x37f5('0x1e')](function(_0x421c4d){_0x71d5a7['count']=_0x421c4d;if(_0x4271ff[_0x37f5('0x4a')]['includeAll']){_0x4ffb63['include']=[{'all':!![]}];}return db[_0x37f5('0xc6')]['findAll'](_0x4ffb63);})['then'](function(_0x397c34){_0x71d5a7[_0x37f5('0xc4')]=_0x397c34;return _0x71d5a7;});}})[_0x37f5('0x1e')](respondWithFilteredResult(_0x211619,_0x4ffb63))[_0x37f5('0x29')](handleError(_0x211619,null));};exports['getChatInteractions']=function(_0xf96421,_0x5e9471,_0x8e9353){var _0x447491={};var _0x1bd57={};var _0x15d77d;var _0x26d25c;return db[_0x37f5('0x5e')][_0x37f5('0x95')]({'where':{'id':_0xf96421[_0x37f5('0x67')]['id']}})['then'](handleEntityNotFound(_0x5e9471,null))[_0x37f5('0x1e')](function(_0x5dfd5f){if(_0x5dfd5f){_0x15d77d=_0x5dfd5f;_0x1bd57[_0x37f5('0x50')]=_[_0x37f5('0x47')](db[_0x37f5('0xc7')]['rawAttributes']);_0x1bd57[_0x37f5('0x4a')]=_[_0x37f5('0x47')](_0xf96421[_0x37f5('0x4a')]);_0x1bd57[_0x37f5('0x4b')]=_[_0x37f5('0x4c')](_0x1bd57[_0x37f5('0x50')],_0x1bd57[_0x37f5('0x4a')]);_0x447491[_0x37f5('0x4d')]=_[_0x37f5('0x4c')](_0x1bd57['model'],qs['fields'](_0xf96421[_0x37f5('0x4a')][_0x37f5('0x4e')]));_0x447491[_0x37f5('0x4d')]=_0x447491[_0x37f5('0x4d')]['length']?_0x447491[_0x37f5('0x4d')]:_0x1bd57[_0x37f5('0x50')];_0x447491[_0x37f5('0x52')]=qs['sort'](_0xf96421[_0x37f5('0x4a')][_0x37f5('0x53')]);_0x447491[_0x37f5('0x54')]=qs[_0x37f5('0x4b')](_[_0x37f5('0x55')](_0xf96421[_0x37f5('0x4a')],_0x1bd57[_0x37f5('0x4b')]));if(_0xf96421['query']['filter']){_0x447491[_0x37f5('0x54')]=_[_0x37f5('0x56')](_0x447491[_0x37f5('0x54')],{'$or':_['map'](_0x447491[_0x37f5('0x4d')],function(_0x24f319){var _0x28344a={};_0x28344a[_0x24f319]={'$like':'%'+_0xf96421[_0x37f5('0x4a')][_0x37f5('0x3a')]+'%'};return _0x28344a;})});}_0x447491=_[_0x37f5('0x56')]({},_0x447491,_0xf96421[_0x37f5('0x5d')]);return _0x15d77d['getChatInteractions'](_0x447491);}})[_0x37f5('0x1e')](function(_0x369dfc){if(_0x369dfc){_0x26d25c=_0x369dfc[_0x37f5('0x4f')];if(!_0xf96421['query'][_0x37f5('0x51')](_0x37f5('0xba'))){_0x447491[_0x37f5('0x2e')]=qs[_0x37f5('0x2e')](_0xf96421[_0x37f5('0x4a')]['limit']);_0x447491['offset']=qs[_0x37f5('0x2d')](_0xf96421[_0x37f5('0x4a')][_0x37f5('0x2d')]);}return _0x15d77d[_0x37f5('0xc8')](_0x447491);}})[_0x37f5('0x1e')](function(_0x1ca059){if(_0x1ca059){return _0x1ca059?{'count':_0x26d25c,'rows':_0x1ca059}:null;}})[_0x37f5('0x1e')](respondWithResult(_0x5e9471,null))[_0x37f5('0x29')](handleError(_0x5e9471,null));};exports[_0x37f5('0xc9')]=function(_0x2c0d7b,_0x6c92c1,_0x4a17e8){var _0x401591={};var _0x997c27={};var _0x18c596;var _0x1e1829;return db[_0x37f5('0x5e')]['findOne']({'where':{'id':_0x2c0d7b[_0x37f5('0x67')]['id']}})[_0x37f5('0x1e')](handleEntityNotFound(_0x6c92c1,null))[_0x37f5('0x1e')](function(_0x21a42a){if(_0x21a42a){_0x18c596=_0x21a42a;_0x997c27[_0x37f5('0x50')]=_[_0x37f5('0x47')](db[_0x37f5('0xca')][_0x37f5('0x45')]);_0x997c27['query']=_[_0x37f5('0x47')](_0x2c0d7b[_0x37f5('0x4a')]);_0x997c27[_0x37f5('0x4b')]=_[_0x37f5('0x4c')](_0x997c27[_0x37f5('0x50')],_0x997c27[_0x37f5('0x4a')]);_0x401591[_0x37f5('0x4d')]=_[_0x37f5('0x4c')](_0x997c27[_0x37f5('0x50')],qs['fields'](_0x2c0d7b[_0x37f5('0x4a')]['fields']));_0x401591[_0x37f5('0x4d')]=_0x401591[_0x37f5('0x4d')][_0x37f5('0x4f')]?_0x401591[_0x37f5('0x4d')]:_0x997c27[_0x37f5('0x50')];_0x401591[_0x37f5('0x52')]=qs['sort'](_0x2c0d7b[_0x37f5('0x4a')][_0x37f5('0x53')]);_0x401591[_0x37f5('0x54')]=qs[_0x37f5('0x4b')](_['pick'](_0x2c0d7b['query'],_0x997c27[_0x37f5('0x4b')]));if(_0x2c0d7b['query'][_0x37f5('0x3a')]){_0x401591['where']=_[_0x37f5('0x56')](_0x401591[_0x37f5('0x54')],{'$or':_[_0x37f5('0x3c')](_0x401591[_0x37f5('0x4d')],function(_0x4d125c){var _0x413e67={};_0x413e67[_0x4d125c]={'$like':'%'+_0x2c0d7b['query'][_0x37f5('0x3a')]+'%'};return _0x413e67;})});}_0x401591=_[_0x37f5('0x56')]({},_0x401591,_0x2c0d7b[_0x37f5('0x5d')]);return _0x18c596[_0x37f5('0xc9')](_0x401591);}})[_0x37f5('0x1e')](function(_0x4371c3){if(_0x4371c3){_0x1e1829=_0x4371c3[_0x37f5('0x4f')];if(!_0x2c0d7b['query'][_0x37f5('0x51')](_0x37f5('0xba'))){_0x401591[_0x37f5('0x2e')]=qs[_0x37f5('0x2e')](_0x2c0d7b[_0x37f5('0x4a')][_0x37f5('0x2e')]);_0x401591['offset']=qs[_0x37f5('0x2d')](_0x2c0d7b[_0x37f5('0x4a')][_0x37f5('0x2d')]);}return _0x18c596[_0x37f5('0xc9')](_0x401591);}})[_0x37f5('0x1e')](function(_0x3b0783){if(_0x3b0783){return _0x3b0783?{'count':_0x1e1829,'rows':_0x3b0783}:null;}})[_0x37f5('0x1e')](respondWithResult(_0x6c92c1,null))[_0x37f5('0x29')](handleError(_0x6c92c1,null));};exports[_0x37f5('0xcb')]=function(_0x599513,_0x42bc5a,_0x3c3a9e){var _0x1b5c90={'raw':!![],'where':{}};var _0x4bdf52={};var _0x296cba={'count':0x0,'rows':[]};return db[_0x37f5('0x5e')][_0x37f5('0x95')]({'where':{'id':_0x599513[_0x37f5('0x67')]['id']}})['then'](handleEntityNotFound(_0x42bc5a,null))[_0x37f5('0x1e')](function(_0x396a6a){if(_0x396a6a){_0x4bdf52['model']=_[_0x37f5('0x47')](db[_0x37f5('0xcc')][_0x37f5('0x45')]);_0x4bdf52[_0x37f5('0x4a')]=_[_0x37f5('0x47')](_0x599513['query']);_0x4bdf52['filters']=_[_0x37f5('0x4c')](_0x4bdf52[_0x37f5('0x50')],_0x4bdf52['query']);_0x1b5c90[_0x37f5('0x4d')]=_[_0x37f5('0x4c')](_0x4bdf52[_0x37f5('0x50')],qs[_0x37f5('0x4e')](_0x599513['query']['fields']));_0x1b5c90[_0x37f5('0x4d')]=_0x1b5c90['attributes']['length']?_0x1b5c90['attributes']:_0x4bdf52[_0x37f5('0x50')];if(!_0x599513[_0x37f5('0x4a')][_0x37f5('0x51')](_0x37f5('0xba'))){_0x1b5c90['limit']=qs[_0x37f5('0x2e')](_0x599513[_0x37f5('0x4a')][_0x37f5('0x2e')]);_0x1b5c90[_0x37f5('0x2d')]=qs['offset'](_0x599513['query'][_0x37f5('0x2d')]);}_0x1b5c90[_0x37f5('0x52')]=qs[_0x37f5('0x53')](_0x599513[_0x37f5('0x4a')][_0x37f5('0x53')]);_0x1b5c90[_0x37f5('0x54')]=qs['filters'](_['pick'](_0x599513[_0x37f5('0x4a')],_0x4bdf52[_0x37f5('0x4b')]));_0x1b5c90[_0x37f5('0x54')]['UserId']=_0x396a6a['id'];if(_0x599513[_0x37f5('0x4a')]['filter']){_0x1b5c90['where']=_[_0x37f5('0x56')](_0x1b5c90[_0x37f5('0x54')],{'$or':_[_0x37f5('0x3c')](_0x1b5c90[_0x37f5('0x4d')],function(_0x54b32e){var _0x556111={};_0x556111[_0x54b32e]={'$like':'%'+_0x599513['query'][_0x37f5('0x3a')]+'%'};return _0x556111;})});}_0x1b5c90=_[_0x37f5('0x56')]({},_0x1b5c90,_0x599513[_0x37f5('0x5d')]);return db['MailInteraction']['count']({'where':_0x1b5c90['where']})['then'](function(_0x49116f){_0x296cba[_0x37f5('0x5f')]=_0x49116f;if(_0x599513['query']['includeAll']){_0x1b5c90[_0x37f5('0x63')]=[{'all':!![]}];}return db[_0x37f5('0xcc')][_0x37f5('0x61')](_0x1b5c90);})[_0x37f5('0x1e')](function(_0x54fb5e){_0x296cba[_0x37f5('0xc4')]=_0x54fb5e;return _0x296cba;});}})[_0x37f5('0x1e')](respondWithFilteredResult(_0x42bc5a,_0x1b5c90))[_0x37f5('0x29')](handleError(_0x42bc5a,null));};exports[_0x37f5('0xcd')]=function(_0x4bf51e,_0x12c377,_0x41f01d){var _0x1061b2={};var _0x30719c={};var _0x381dae;var _0x207a9f;return db[_0x37f5('0x5e')][_0x37f5('0x95')]({'where':{'id':_0x4bf51e[_0x37f5('0x67')]['id']}})[_0x37f5('0x1e')](handleEntityNotFound(_0x12c377,null))[_0x37f5('0x1e')](function(_0x347d37){if(_0x347d37){_0x381dae=_0x347d37;_0x30719c[_0x37f5('0x50')]=_[_0x37f5('0x47')](db[_0x37f5('0xce')]['rawAttributes']);_0x30719c[_0x37f5('0x4a')]=_['keys'](_0x4bf51e[_0x37f5('0x4a')]);_0x30719c[_0x37f5('0x4b')]=_['intersection'](_0x30719c[_0x37f5('0x50')],_0x30719c[_0x37f5('0x4a')]);_0x1061b2[_0x37f5('0x4d')]=_[_0x37f5('0x4c')](_0x30719c[_0x37f5('0x50')],qs['fields'](_0x4bf51e['query'][_0x37f5('0x4e')]));_0x1061b2['attributes']=_0x1061b2[_0x37f5('0x4d')]['length']?_0x1061b2[_0x37f5('0x4d')]:_0x30719c[_0x37f5('0x50')];_0x1061b2[_0x37f5('0x52')]=qs['sort'](_0x4bf51e[_0x37f5('0x4a')][_0x37f5('0x53')]);_0x1061b2[_0x37f5('0x54')]=qs[_0x37f5('0x4b')](_[_0x37f5('0x55')](_0x4bf51e['query'],_0x30719c[_0x37f5('0x4b')]));if(_0x4bf51e[_0x37f5('0x4a')][_0x37f5('0x3a')]){_0x1061b2[_0x37f5('0x54')]=_[_0x37f5('0x56')](_0x1061b2[_0x37f5('0x54')],{'$or':_[_0x37f5('0x3c')](_0x1061b2[_0x37f5('0x4d')],function(_0x1f0be5){var _0x4db3c9={};_0x4db3c9[_0x1f0be5]={'$like':'%'+_0x4bf51e['query'][_0x37f5('0x3a')]+'%'};return _0x4db3c9;})});}_0x1061b2=_[_0x37f5('0x56')]({},_0x1061b2,_0x4bf51e[_0x37f5('0x5d')]);return _0x381dae[_0x37f5('0xcd')](_0x1061b2);}})[_0x37f5('0x1e')](function(_0x2cf83f){if(_0x2cf83f){_0x207a9f=_0x2cf83f[_0x37f5('0x4f')];if(!_0x4bf51e[_0x37f5('0x4a')][_0x37f5('0x51')](_0x37f5('0xba'))){_0x1061b2[_0x37f5('0x2e')]=qs[_0x37f5('0x2e')](_0x4bf51e[_0x37f5('0x4a')][_0x37f5('0x2e')]);_0x1061b2['offset']=qs[_0x37f5('0x2d')](_0x4bf51e['query'][_0x37f5('0x2d')]);}return _0x381dae[_0x37f5('0xcd')](_0x1061b2);}})[_0x37f5('0x1e')](function(_0x56e8f0){if(_0x56e8f0){return _0x56e8f0?{'count':_0x207a9f,'rows':_0x56e8f0}:null;}})[_0x37f5('0x1e')](respondWithResult(_0x12c377,null))['catch'](handleError(_0x12c377,null));};exports[_0x37f5('0xcf')]=function(_0x3528ec,_0x9b9767,_0x4e13cf){var _0x2e7b81={};var _0x3f0a62={};var _0x53e383;var _0x3f5523;return db['User'][_0x37f5('0x95')]({'where':{'id':_0x3528ec[_0x37f5('0x67')]['id']}})[_0x37f5('0x1e')](handleEntityNotFound(_0x9b9767,null))['then'](function(_0x5d441a){if(_0x5d441a){_0x53e383=_0x5d441a;_0x3f0a62['model']=_[_0x37f5('0x47')](db[_0x37f5('0xd0')][_0x37f5('0x45')]);_0x3f0a62[_0x37f5('0x4a')]=_[_0x37f5('0x47')](_0x3528ec['query']);_0x3f0a62[_0x37f5('0x4b')]=_[_0x37f5('0x4c')](_0x3f0a62[_0x37f5('0x50')],_0x3f0a62[_0x37f5('0x4a')]);_0x2e7b81[_0x37f5('0x4d')]=_[_0x37f5('0x4c')](_0x3f0a62[_0x37f5('0x50')],qs[_0x37f5('0x4e')](_0x3528ec[_0x37f5('0x4a')][_0x37f5('0x4e')]));_0x2e7b81[_0x37f5('0x4d')]=_0x2e7b81[_0x37f5('0x4d')][_0x37f5('0x4f')]?_0x2e7b81['attributes']:_0x3f0a62[_0x37f5('0x50')];_0x2e7b81[_0x37f5('0x52')]=qs[_0x37f5('0x53')](_0x3528ec[_0x37f5('0x4a')]['sort']);_0x2e7b81[_0x37f5('0x54')]=qs[_0x37f5('0x4b')](_[_0x37f5('0x55')](_0x3528ec['query'],_0x3f0a62[_0x37f5('0x4b')]));if(_0x3528ec[_0x37f5('0x4a')][_0x37f5('0x3a')]){_0x2e7b81['where']=_[_0x37f5('0x56')](_0x2e7b81[_0x37f5('0x54')],{'$or':_[_0x37f5('0x3c')](_0x2e7b81[_0x37f5('0x4d')],function(_0x3e323a){var _0x159182={};_0x159182[_0x3e323a]={'$like':'%'+_0x3528ec[_0x37f5('0x4a')][_0x37f5('0x3a')]+'%'};return _0x159182;})});}_0x2e7b81=_[_0x37f5('0x56')]({},_0x2e7b81,_0x3528ec[_0x37f5('0x5d')]);return _0x53e383[_0x37f5('0xcf')](_0x2e7b81);}})[_0x37f5('0x1e')](function(_0x5d46e2){if(_0x5d46e2){_0x3f5523=_0x5d46e2['length'];if(!_0x3528ec[_0x37f5('0x4a')][_0x37f5('0x51')](_0x37f5('0xba'))){_0x2e7b81[_0x37f5('0x2e')]=qs[_0x37f5('0x2e')](_0x3528ec['query'][_0x37f5('0x2e')]);_0x2e7b81['offset']=qs['offset'](_0x3528ec[_0x37f5('0x4a')]['offset']);}return _0x53e383[_0x37f5('0xcf')](_0x2e7b81);}})[_0x37f5('0x1e')](function(_0x33b2cb){if(_0x33b2cb){return _0x33b2cb?{'count':_0x3f5523,'rows':_0x33b2cb}:null;}})[_0x37f5('0x1e')](respondWithResult(_0x9b9767,null))[_0x37f5('0x29')](handleError(_0x9b9767,null));};exports[_0x37f5('0xd1')]=function(_0x421503,_0x445c2e,_0x2fd98c){var _0x2120a3;var _0xc7db48;var _0x10a05b;var _0x591c1e=!_[_0x37f5('0x6f')](_0x421503['params']['id'])?_0x421503[_0x37f5('0x67')]['id']:!_[_0x37f5('0x6f')](_0x421503[_0x37f5('0x36')]['id'])?_0x421503['user']['id']:null;return db[_0x37f5('0x5e')]['find']({'where':{'id':_0x591c1e,'role':'agent'},'attributes':['id','name',_0x37f5('0xd2'),_0x37f5('0xd3'),_0x37f5('0x3f'),_0x37f5('0x74'),_0x37f5('0xd4')]})[_0x37f5('0x1e')](handleEntityNotFound(_0x445c2e,null))[_0x37f5('0x1e')](function(_0xbea524){if(_0xbea524){_0x2120a3=_0xbea524;if(_0x421503[_0x37f5('0x66')][_0x37f5('0x98')]){_0x10a05b=util[_0x37f5('0x71')](_0x37f5('0xd5'),_0x2120a3[_0x421503[_0x37f5('0x66')][_0x37f5('0x98')]]);}else if(_0x421503[_0x37f5('0x66')][_0x37f5('0xd6')]){_0x10a05b=util[_0x37f5('0x71')](_0x37f5('0xa5'),_0x421503[_0x37f5('0x66')][_0x37f5('0xd6')]);}else{_0x10a05b=util[_0x37f5('0x71')](_0x37f5('0xa5'),_0x2120a3[_0x37f5('0x40')]);}socket['to'](util[_0x37f5('0x71')](_0x37f5('0xd7'),_0x2120a3[_0x37f5('0x40')]))[_0x37f5('0xa0')](_0x37f5('0xd8'),{'ip':_0x421503['headers']['x-forwarded-for']||_0x421503[_0x37f5('0xd9')][_0x37f5('0xda')]||_0x421503[_0x37f5('0xdb')]['remoteAddress']||_0x421503[_0x37f5('0xd9')]['socket'][_0x37f5('0xda')]});return db[_0x37f5('0xdc')][_0x37f5('0xdd')]({'where':{'membername':_0x2120a3[_0x37f5('0x40')]},'individualHooks':!![]});}})[_0x37f5('0x1e')](function(_0x3980a0){if(_0x2120a3){return _0x2120a3[_0x37f5('0xde')]({'raw':!![]});}})[_0x37f5('0x1e')](function(_0x485fe1){var _0x693507=[];if(_0x485fe1){_0xc7db48=_0x485fe1;if(_0xc7db48[_0x37f5('0x4f')]){for(var _0x1db6ef=0x0;_0x1db6ef<_0xc7db48[_0x37f5('0x4f')];_0x1db6ef++){_0x693507[_0x37f5('0xdf')]({'membername':_0x2120a3[_0x37f5('0x40')],'UserId':_0x2120a3['id'],'queue_name':_0xc7db48[_0x1db6ef][_0x37f5('0x40')],'VoiceQueueId':_0xc7db48[_0x1db6ef]['id'],'interface':_0x10a05b,'paused':_0x2120a3[_0x37f5('0xd4')]||![],'penalty':_0xc7db48[_0x1db6ef]['UserVoiceQueue.penalty']||0x0});}return BPromise[_0x37f5('0xa6')](_0x693507,function(_0x792fd){return db[_0x37f5('0xdc')][_0x37f5('0xa7')](_0x792fd);});}}})[_0x37f5('0x1e')](function(){return db[_0x37f5('0xe0')]['findAll']({'where':{'membername':_0x2120a3[_0x37f5('0x40')],'exitAt':null}});})[_0x37f5('0x1e')](function(_0x11892c){var _0x1c7644=[];_0x11892c[_0x37f5('0xe1')](function(_0x2fe95d){_0x1c7644[_0x37f5('0xdf')](_0x2fe95d[_0x37f5('0x34')]({'exitAt':moment()[_0x37f5('0x71')](_0x37f5('0xe2'))}));});return BPromise[_0x37f5('0xe3')](_0x1c7644);})[_0x37f5('0x1e')](function(){var _0x484dbf=[];var _0x3a90b6=[];var _0x45f9e3=utils[_0x37f5('0xe4')]();var _0xba3ee4={'membername':_0x2120a3[_0x37f5('0x40')],'interface':_0x10a05b,'enterAt':moment()[_0x37f5('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x2120a3['role'],'internal':_0x2120a3[_0x37f5('0x74')]};_0x45f9e3[_0x37f5('0xe1')](function(_0x35d11a){_0x484dbf['push'](_['merge']({'channel':_0x35d11a,'type':_0x37f5('0xe5'),'data1':_0x421503[_0x37f5('0x66')][_0x37f5('0xe6')],'data2':_0x10a05b},_0xba3ee4));if(_0x2120a3['loginInPause']){_0x3a90b6[_0x37f5('0xdf')](_[_0x37f5('0x56')]({'channel':_0x35d11a,'type':_0x37f5('0xe7'),'data1':'LOGININPAUSE'},_0xba3ee4));}});return db[_0x37f5('0xe0')][_0x37f5('0x65')](_0x484dbf['concat'](_0x3a90b6),{'individualHooks':!![]});})['then'](function(){return _0x2120a3[_0x37f5('0x34')]({'online':!![],'lastLoginAt':moment()[_0x37f5('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x2120a3[_0x37f5('0xd4')]||![],'mailPause':_0x2120a3[_0x37f5('0xd4')]||![],'chatPause':_0x2120a3[_0x37f5('0xd4')]||![],'faxPause':_0x2120a3[_0x37f5('0xd4')]||![],'smsPause':_0x2120a3['loginInPause']||![],'openchannelPause':_0x2120a3[_0x37f5('0xd4')]||![],'pauseType':_0x2120a3[_0x37f5('0xd4')]?_0x37f5('0xe8'):null,'interface':_0x10a05b,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x37f5('0x1e')](function(_0x167308){if(_0x421503[_0x37f5('0xe9')]){return _0x2fd98c();}else{return BPromise[_0x37f5('0xea')](_0x167308)[_0x37f5('0x1e')](respondWithResult(_0x445c2e,null));}})[_0x37f5('0x29')](handleError(_0x445c2e,null));};exports[_0x37f5('0xeb')]=function(_0x3ece12,_0x4ed70e,_0x158faa){var _0x53196f;return db['User'][_0x37f5('0x64')]({'where':{'id':_0x3ece12[_0x37f5('0x67')]['id'],'role':_0x37f5('0x38')},'attributes':['id','name',_0x37f5('0x3f')]})['then'](handleEntityNotFound(_0x4ed70e,null))['then'](function(_0x16997b){if(_0x16997b){_0x53196f=_0x16997b;return db[_0x37f5('0xdc')][_0x37f5('0xdd')]({'where':{'membername':_0x53196f[_0x37f5('0x40')]},'individualHooks':!![]});}})[_0x37f5('0x1e')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x53196f[_0x37f5('0x40')],'exitAt':null}});})[_0x37f5('0x1e')](function(_0x310d19){var _0x171552=[];_0x310d19[_0x37f5('0xe1')](function(_0x278dfd){_0x171552['push'](_0x278dfd['update']({'exitAt':moment()['format'](_0x37f5('0xe2'))}));});return BPromise[_0x37f5('0xe3')](_0x171552);})[_0x37f5('0x1e')](function(){return _0x53196f[_0x37f5('0x34')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x37f5('0x1e')](respondWithResult(_0x4ed70e,null))[_0x37f5('0x29')](handleError(_0x4ed70e,null));};exports['pause']=function(_0x3036a7,_0x442672,_0x128256){var _0x4391d6;return db[_0x37f5('0xdc')][_0x37f5('0x34')]({'paused':0x1},{'where':{'UserId':_0x3036a7[_0x37f5('0x67')]['id']},'individualHooks':!![]})['then'](function(){return db[_0x37f5('0x5e')][_0x37f5('0x64')]({'where':{'id':_0x3036a7[_0x37f5('0x67')]['id'],'role':_0x37f5('0x38')},'attributes':['id','name',_0x37f5('0x3f'),_0x37f5('0x74'),_0x37f5('0x98')]});})[_0x37f5('0x1e')](handleEntityNotFound(_0x442672,null))[_0x37f5('0x1e')](function(_0x2979b2){if(_0x2979b2){_0x4391d6=_0x2979b2;return respondWithRpcPromise(_0x37f5('0xec'),_0x37f5('0xed'),{'id':_0x4391d6['id'],'name':_0x4391d6[_0x37f5('0x40')],'pause':!![]});}})[_0x37f5('0x1e')](function(){if(_0x4391d6){return db[_0x37f5('0xe0')][_0x37f5('0x61')]({'where':{'membername':_0x4391d6['name'],'type':_0x37f5('0xe7'),'exitAt':null}});}})[_0x37f5('0x1e')](function(_0x5281f1){if(_0x5281f1[_0x37f5('0x4f')]){var _0xa7735a=moment()[_0x37f5('0x71')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x25f3fb=0x0,_0x12a65e=_0x5281f1['length'];_0x25f3fb<_0x12a65e;_0x25f3fb++){_0x5281f1[_0x25f3fb][_0x37f5('0xee')]({'exitAt':_0xa7735a});}}})[_0x37f5('0x1e')](function(){var _0x3a390c=[];var _0x20c2ce=utils[_0x37f5('0xe4')]();_0x20c2ce[_0x37f5('0xe1')](function(_0x3ea7fe){_0x3a390c[_0x37f5('0xdf')]({'channel':_0x3ea7fe,'membername':_0x4391d6[_0x37f5('0x40')],'interface':_[_0x37f5('0x6f')](_0x4391d6['interface'])?util['format'](_0x37f5('0xa5'),_0x4391d6[_0x37f5('0x40')]):_0x4391d6[_0x37f5('0x98')],'type':_0x37f5('0xe7'),'enterAt':moment()['format'](_0x37f5('0xe2')),'data1':_0x3036a7[_0x37f5('0x66')][_0x37f5('0x57')]||_0x37f5('0xef'),'role':_0x4391d6[_0x37f5('0x3f')],'internal':_0x4391d6[_0x37f5('0x74')]});});return db[_0x37f5('0xe0')]['bulkCreate'](_0x3a390c,{'individualHooks':!![]});})[_0x37f5('0x1e')](function(){return _0x4391d6['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x3036a7['body'][_0x37f5('0x57')]||_0x37f5('0xef'),'lastPauseAt':moment()['format'](_0x37f5('0xe2'))});})[_0x37f5('0x1e')](respondWithResult(_0x442672,null))['catch'](handleError(_0x442672,null));};exports[_0x37f5('0xf0')]=function(_0x3cefeb,_0x1bafb2,_0xd032a0){var _0x4f50f5;return db[_0x37f5('0x5e')][_0x37f5('0x64')]({'where':{'id':_0x3cefeb[_0x37f5('0x67')]['id']},'attributes':['id',_0x37f5('0x40'),_0x37f5('0x3f'),_0x37f5('0x97'),_0x37f5('0xf1'),_0x37f5('0xf2'),'faxPause',_0x37f5('0xf3'),'smsPause',_0x37f5('0xf4'),_0x37f5('0xf5')]})['then'](handleEntityNotFound(_0x1bafb2,null))[_0x37f5('0x1e')](function(_0x481256){if(_0x481256){_0x4f50f5=_0x481256;if(_0x3cefeb[_0x37f5('0x66')][_0x37f5('0x96')]&&!utils[_0x37f5('0x99')](_0x3cefeb[_0x37f5('0x66')][_0x37f5('0x96')])){throw new db[(_0x37f5('0x8e'))][(_0x37f5('0x8f'))](_0x37f5('0x9a'));}switch(_0x3cefeb[_0x37f5('0x66')][_0x37f5('0x96')]){case _0x37f5('0xa2'):return respondWithRpcPromise(_0x37f5('0xec'),_0x37f5('0xf0'),{'id':_0x4f50f5['id'],'name':_0x4f50f5['name'],'pause':![]})[_0x37f5('0x1e')](function(){return db[_0x37f5('0xdc')][_0x37f5('0x34')]({'paused':0x0},{'where':{'UserId':_0x4f50f5['id']},'individualHooks':!![]});})[_0x37f5('0x1e')](function(){return db[_0x37f5('0xe0')][_0x37f5('0x64')]({'where':{'channel':_0x3cefeb[_0x37f5('0x66')][_0x37f5('0x96')],'membername':_0x4f50f5[_0x37f5('0x40')],'type':_0x37f5('0xe7'),'exitAt':null}});})[_0x37f5('0x1e')](function(_0x58d6cb){if(_0x58d6cb){return _0x58d6cb[_0x37f5('0x34')]({'exitAt':moment()[_0x37f5('0x71')](_0x37f5('0xe2')),'data2':'manual'},{'individualHooks':!![]});}return null;})['then'](function(){return _0x4f50f5[_0x37f5('0x34')]({'voicePause':![]});});case _0x37f5('0xf6'):case _0x37f5('0xf7'):case _0x37f5('0xf8'):case _0x37f5('0xf9'):case'openchannel':return db[_0x37f5('0xe0')][_0x37f5('0x64')]({'where':{'channel':_0x3cefeb[_0x37f5('0x66')][_0x37f5('0x96')],'membername':_0x4f50f5[_0x37f5('0x40')],'type':_0x37f5('0xe7'),'exitAt':null}})[_0x37f5('0x1e')](function(_0x36f4f0){if(_0x36f4f0){return _0x36f4f0[_0x37f5('0x34')]({'exitAt':moment()[_0x37f5('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x37f5('0xfa')},{'individualHooks':!![]});}return null;})[_0x37f5('0x1e')](function(){var _0x4dfadd={};_[_0x37f5('0x2f')](_0x4dfadd,util[_0x37f5('0x71')]('%s%s',_0x3cefeb[_0x37f5('0x66')][_0x37f5('0x96')],'Pause'),![]);return _0x4f50f5[_0x37f5('0x34')](_0x4dfadd);});default:return respondWithRpcPromise(_0x37f5('0xec'),_0x37f5('0xf0'),{'id':_0x4f50f5['id'],'name':_0x4f50f5['name'],'pause':![]})['then'](function(){return db[_0x37f5('0xdc')][_0x37f5('0x34')]({'paused':0x0},{'where':{'UserId':_0x4f50f5['id']}});})[_0x37f5('0x1e')](function(){return db[_0x37f5('0xe0')]['findAll']({'where':{'membername':_0x4f50f5['name'],'type':'PAUSE','exitAt':null}});})[_0x37f5('0x1e')](function(_0x9d5022){var _0x5695a4=[];_0x9d5022[_0x37f5('0xe1')](function(_0x2e9728){_0x5695a4[_0x37f5('0xdf')](_0x2e9728[_0x37f5('0x34')]({'exitAt':moment()[_0x37f5('0x71')](_0x37f5('0xe2')),'data2':_0x37f5('0xfa')}));});return BPromise[_0x37f5('0xe3')](_0x5695a4);})[_0x37f5('0x1e')](function(){return _0x4f50f5[_0x37f5('0x34')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x1bafb2,null))[_0x37f5('0x29')](handleError(_0x1bafb2,null));};exports[_0x37f5('0xfb')]=function(_0x2fcf6d,_0x3b7a6c,_0x3f748f){var _0x5ee0f2={};var _0xaa0f5a={};var _0x2fd9bb;var _0x4bac74;return db[_0x37f5('0x5e')][_0x37f5('0x95')]({'where':{'id':_0x2fcf6d[_0x37f5('0x67')]['id']}})[_0x37f5('0x1e')](handleEntityNotFound(_0x3b7a6c,null))[_0x37f5('0x1e')](function(_0x1e9a4f){if(_0x1e9a4f){_0x2fd9bb=_0x1e9a4f;_0xaa0f5a['model']=_[_0x37f5('0x47')](db['Team'][_0x37f5('0x45')]);_0xaa0f5a[_0x37f5('0x4a')]=_[_0x37f5('0x47')](_0x2fcf6d[_0x37f5('0x4a')]);_0xaa0f5a[_0x37f5('0x4b')]=_[_0x37f5('0x4c')](_0xaa0f5a[_0x37f5('0x50')],_0xaa0f5a['query']);_0x5ee0f2[_0x37f5('0x4d')]=_[_0x37f5('0x4c')](_0xaa0f5a[_0x37f5('0x50')],qs[_0x37f5('0x4e')](_0x2fcf6d[_0x37f5('0x4a')]['fields']));_0x5ee0f2[_0x37f5('0x4d')]=_0x5ee0f2[_0x37f5('0x4d')][_0x37f5('0x4f')]?_0x5ee0f2['attributes']:_0xaa0f5a[_0x37f5('0x50')];_0x5ee0f2[_0x37f5('0x52')]=qs[_0x37f5('0x53')](_0x2fcf6d['query'][_0x37f5('0x53')]);_0x5ee0f2[_0x37f5('0x54')]=qs['filters'](_['pick'](_0x2fcf6d['query'],_0xaa0f5a[_0x37f5('0x4b')]));if(_0x2fcf6d[_0x37f5('0x4a')][_0x37f5('0x3a')]){_0x5ee0f2[_0x37f5('0x54')]=_['merge'](_0x5ee0f2['where'],{'$or':_['map'](_0x5ee0f2[_0x37f5('0x4d')],function(_0x13bf6f){var _0x515876={};_0x515876[_0x13bf6f]={'$like':'%'+_0x2fcf6d[_0x37f5('0x4a')][_0x37f5('0x3a')]+'%'};return _0x515876;})});}_0x5ee0f2=_[_0x37f5('0x56')]({},_0x5ee0f2,_0x2fcf6d['options']);return _0x2fd9bb[_0x37f5('0xfb')](_0x5ee0f2);}})[_0x37f5('0x1e')](function(_0x1b2761){if(_0x1b2761){_0x4bac74=_0x1b2761[_0x37f5('0x4f')];if(!_0x2fcf6d[_0x37f5('0x4a')][_0x37f5('0x51')](_0x37f5('0xba'))){_0x5ee0f2[_0x37f5('0x2e')]=qs['limit'](_0x2fcf6d[_0x37f5('0x4a')][_0x37f5('0x2e')]);_0x5ee0f2[_0x37f5('0x2d')]=qs[_0x37f5('0x2d')](_0x2fcf6d['query'][_0x37f5('0x2d')]);}return _0x2fd9bb[_0x37f5('0xfb')](_0x5ee0f2);}})[_0x37f5('0x1e')](function(_0x226b59){if(_0x226b59){return _0x226b59?{'count':_0x4bac74,'rows':_0x226b59}:null;}})[_0x37f5('0x1e')](respondWithResult(_0x3b7a6c,null))[_0x37f5('0x29')](handleError(_0x3b7a6c,null));};exports[_0x37f5('0xfc')]=function(_0x40e53c,_0x49ed05,_0x72a01){return db['User'][_0x37f5('0x64')]({'where':{'id':_0x40e53c[_0x37f5('0x67')]['id']}})[_0x37f5('0x1e')](handleEntityNotFound(_0x49ed05,null))['then'](function(_0x250b85){if(_0x250b85){return _0x250b85[_0x37f5('0xfc')](_0x40e53c[_0x37f5('0x66')][_0x37f5('0x69')],_[_0x37f5('0xfd')](_0x40e53c[_0x37f5('0x66')],[_0x37f5('0x69'),'id'])||{});}})[_0x37f5('0x1e')](respondWithResult(_0x49ed05,null))[_0x37f5('0x29')](handleError(_0x49ed05,null));};exports[_0x37f5('0xfe')]=function(_0x3bbd3a,_0x11072d,_0x1647e2){return db[_0x37f5('0x5e')][_0x37f5('0x64')]({'where':{'id':_0x3bbd3a[_0x37f5('0x67')]['id']}})[_0x37f5('0x1e')](handleEntityNotFound(_0x11072d,null))['then'](function(_0x22ea1c){if(_0x22ea1c){return _0x22ea1c[_0x37f5('0xfe')](_0x3bbd3a[_0x37f5('0x4a')]['ids']);}})['then'](respondWithStatusCode(_0x11072d,null))['catch'](handleError(_0x11072d,null));};exports[_0x37f5('0xff')]=function(_0x1a07cd,_0x2b2c32,_0x9ab0f6){var _0x206858={};var _0x15111f={};var _0x91a20e;var _0x202e0a;return db[_0x37f5('0x5e')][_0x37f5('0x95')]({'where':{'id':_0x1a07cd[_0x37f5('0x67')]['id']}})[_0x37f5('0x1e')](handleEntityNotFound(_0x2b2c32,null))[_0x37f5('0x1e')](function(_0x897b3a){if(_0x897b3a){_0x91a20e=_0x897b3a;_0x15111f[_0x37f5('0x50')]=_['keys'](db['CmList'][_0x37f5('0x45')]);_0x15111f[_0x37f5('0x4a')]=_[_0x37f5('0x47')](_0x1a07cd[_0x37f5('0x4a')]);_0x15111f['filters']=_[_0x37f5('0x4c')](_0x15111f[_0x37f5('0x50')],_0x15111f[_0x37f5('0x4a')]);_0x206858[_0x37f5('0x4d')]=_[_0x37f5('0x4c')](_0x15111f[_0x37f5('0x50')],qs[_0x37f5('0x4e')](_0x1a07cd[_0x37f5('0x4a')][_0x37f5('0x4e')]));_0x206858[_0x37f5('0x4d')]=_0x206858[_0x37f5('0x4d')][_0x37f5('0x4f')]?_0x206858[_0x37f5('0x4d')]:_0x15111f[_0x37f5('0x50')];_0x206858[_0x37f5('0x52')]=qs[_0x37f5('0x53')](_0x1a07cd[_0x37f5('0x4a')][_0x37f5('0x53')]);_0x206858['where']=qs[_0x37f5('0x4b')](_[_0x37f5('0x55')](_0x1a07cd['query'],_0x15111f[_0x37f5('0x4b')]));if(_0x1a07cd[_0x37f5('0x4a')][_0x37f5('0x3a')]){_0x206858[_0x37f5('0x54')]=_['merge'](_0x206858[_0x37f5('0x54')],{'$or':_[_0x37f5('0x3c')](_0x206858[_0x37f5('0x4d')],function(_0x5a6e6a){var _0xe664be={};_0xe664be[_0x5a6e6a]={'$like':'%'+_0x1a07cd[_0x37f5('0x4a')][_0x37f5('0x3a')]+'%'};return _0xe664be;})});}_0x206858=_[_0x37f5('0x56')]({},_0x206858,_0x1a07cd['options']);return _0x91a20e[_0x37f5('0xff')](_0x206858);}})[_0x37f5('0x1e')](function(_0x3abb2f){if(_0x3abb2f){_0x202e0a=_0x3abb2f[_0x37f5('0x4f')];if(!_0x1a07cd[_0x37f5('0x4a')][_0x37f5('0x51')](_0x37f5('0xba'))){_0x206858[_0x37f5('0x2e')]=qs[_0x37f5('0x2e')](_0x1a07cd[_0x37f5('0x4a')][_0x37f5('0x2e')]);_0x206858[_0x37f5('0x2d')]=qs[_0x37f5('0x2d')](_0x1a07cd[_0x37f5('0x4a')][_0x37f5('0x2d')]);}return _0x91a20e[_0x37f5('0xff')](_0x206858);}})['then'](function(_0x2ea94){if(_0x2ea94){return _0x2ea94?{'count':_0x202e0a,'rows':_0x2ea94}:null;}})[_0x37f5('0x1e')](respondWithResult(_0x2b2c32,null))['catch'](handleError(_0x2b2c32,null));};exports['getAgents']=function(_0x270b3f,_0x1d1e08,_0x45295a){var _0x48ea52={};var _0x4136d1={};var _0x18cb4a;var _0x7205f6;return db[_0x37f5('0x5e')]['findOne']({'where':{'id':_0x270b3f[_0x37f5('0x67')]['id']}})[_0x37f5('0x1e')](handleEntityNotFound(_0x1d1e08,null))['then'](function(_0x4f44cf){if(_0x4f44cf){_0x18cb4a=_0x4f44cf;_0x4136d1[_0x37f5('0x50')]=_[_0x37f5('0x47')](db['User'][_0x37f5('0x45')]);_0x4136d1['query']=_['keys'](_0x270b3f[_0x37f5('0x4a')]);_0x4136d1[_0x37f5('0x4b')]=_[_0x37f5('0x4c')](_0x4136d1['model'],_0x4136d1[_0x37f5('0x4a')]);_0x48ea52['attributes']=_[_0x37f5('0x4c')](_0x4136d1[_0x37f5('0x50')],qs[_0x37f5('0x4e')](_0x270b3f['query']['fields']));_0x48ea52[_0x37f5('0x4d')]=_0x48ea52[_0x37f5('0x4d')][_0x37f5('0x4f')]?_0x48ea52[_0x37f5('0x4d')]:_0x4136d1[_0x37f5('0x50')];_0x48ea52['order']=qs[_0x37f5('0x53')](_0x270b3f[_0x37f5('0x4a')][_0x37f5('0x53')]);_0x48ea52[_0x37f5('0x54')]=qs['filters'](_[_0x37f5('0x55')](_0x270b3f['query'],_0x4136d1[_0x37f5('0x4b')]));if(_0x270b3f[_0x37f5('0x4a')][_0x37f5('0x3a')]){_0x48ea52[_0x37f5('0x54')]=_[_0x37f5('0x56')](_0x48ea52[_0x37f5('0x54')],{'$or':_['map'](_0x48ea52[_0x37f5('0x4d')],function(_0x11f77f){var _0x262165={};_0x262165[_0x11f77f]={'$like':'%'+_0x270b3f[_0x37f5('0x4a')][_0x37f5('0x3a')]+'%'};return _0x262165;})});}_0x48ea52[_0x37f5('0x50')]=db[_0x37f5('0x5e')];_0x48ea52['as']='Agents';_0x48ea52=_[_0x37f5('0x56')]({},_0x48ea52,_0x270b3f[_0x37f5('0x5d')]);return _0x18cb4a[_0x37f5('0xde')]({'include':[_0x48ea52]});}})[_0x37f5('0x1e')](function(_0x18127d){if(_0x18127d){var _0x4f3430={},_0x49657a=[],_0x519a18=0x0;for(var _0xd0fdf1=0x0;_0xd0fdf1<_0x18127d['length'];_0xd0fdf1+=0x1){for(var _0x20e763=0x0,_0x590721;_0x20e763<_0x18127d[_0xd0fdf1][_0x37f5('0x37')][_0x37f5('0x4f')];_0x20e763+=0x1){_0x590721=_0x18127d[_0xd0fdf1][_0x37f5('0x37')][_0x20e763][_0x37f5('0x35')]({'plain':!![]});_0x4f3430[_0x590721['id']]=_0x590721;}}_0x4f3430=_[_0x37f5('0x100')](_0x4f3430);for(var _0x24ab7e=qs['offset'](_0x270b3f[_0x37f5('0x4a')]['offset']);_0x24ab7e<_0x4f3430[_0x37f5('0x4f')]&&_0x49657a['length']=_0x255259){_0x4bf202=_0x255259;_0x2dcd53=0xc8;}else{_0x2dcd53=0xce;}_0x16a1a2[_0x5a14('0x2e')](_0x2dcd53);return _0x16a1a2['set']('Content-Range',_0x95d322+'-'+_0x4bf202+'/'+_0x255259)[_0x5a14('0x30')](_0x153d45);}return null;};}function patchUpdates(_0x5230bf){return function(_0x3dbf2f){try{jsonpatch['apply'](_0x3dbf2f,_0x5230bf,!![]);}catch(_0x138b01){return BPromise['reject'](_0x138b01);}return _0x3dbf2f['save']();};}function saveUpdates(_0x548393,_0x1fdcd0){return function(_0x36972b){if(_0x36972b){return _0x36972b[_0x5a14('0x33')](_0x548393)[_0x5a14('0x22')](function(_0x4c51ea){return _0x4c51ea;});}return null;};}function removeEntity(_0x3909e1,_0x4a29d3){return function(_0xa80cfe){if(_0xa80cfe){return _0xa80cfe[_0x5a14('0x34')]()[_0x5a14('0x22')](function(){var _0x1e6fe4=_0xa80cfe[_0x5a14('0x35')]({'plain':!![]});var _0x507937=[{'name':'Users','value':_0x5a14('0x36'),'ignore':!![]},{'name':_0x5a14('0x37'),'value':'agent','ignore':![]},{'name':'Telephones','value':_0x5a14('0x38'),'ignore':![]}];var _0x269ae5=_(_0x507937)[_0x5a14('0x39')](_0x5a14('0x3a'))[_0x5a14('0x3b')]('value')['value']();if(_[_0x5a14('0x3c')](_0x269ae5,_0x1e6fe4[_0x5a14('0x3d')])){return;}var _0x512ed3=_[_0x5a14('0x3e')](_0x507937,['value',_0x1e6fe4['role']])[_0x5a14('0x3f')];return db[_0x5a14('0x40')][_0x5a14('0x34')]({'where':{'type':_0x512ed3,'resourceId':_0x1e6fe4['id']}})[_0x5a14('0x22')](function(){return _0xa80cfe;});})[_0x5a14('0x22')](function(){_0x3909e1[_0x5a14('0x2e')](0xcc)[_0x5a14('0x2f')]();});}};}function handleEntityNotFound(_0x9f91c2,_0x4c72ef){return function(_0x1aae2e){if(!_0x1aae2e){_0x9f91c2[_0x5a14('0x2d')](0x194);}return _0x1aae2e;};}function handleError(_0x72b3ce,_0x1c5d58){_0x1c5d58=_0x1c5d58||0x1f4;return function(_0x651125){logger[_0x5a14('0x29')](_0x651125[_0x5a14('0x41')]);if(_0x651125['name']){delete _0x651125['name'];}_0x72b3ce['status'](_0x1c5d58)[_0x5a14('0x42')](_0x651125);};}exports[_0x5a14('0x43')]=function(_0x422cf3,_0x33d4c7){var _0x3a04f8={},_0x3ad8b0={},_0xe6db98={'count':0x0,'rows':[]};var _0x5279d5=db[_0x5a14('0x44')][_0x5a14('0x45')];_0x3ad8b0[_0x5a14('0x46')]=_['differenceBy'](_[_0x5a14('0x47')](_0x5279d5),[_0x5a14('0x48'),'salt']);_0x3ad8b0['query']=_['keys'](_0x422cf3[_0x5a14('0x49')]);_0x3ad8b0[_0x5a14('0x4a')]=_[_0x5a14('0x4b')](_0x3ad8b0['model'],_0x3ad8b0[_0x5a14('0x49')]);_0x3a04f8[_0x5a14('0x4c')]=_['intersection'](_0x3ad8b0[_0x5a14('0x46')],qs[_0x5a14('0x4d')](_0x422cf3[_0x5a14('0x49')]['fields']));_0x3a04f8[_0x5a14('0x4c')]=_0x3a04f8[_0x5a14('0x4c')][_0x5a14('0x4e')]?_0x3a04f8[_0x5a14('0x4c')]:_0x3ad8b0['model'];if(!_0x422cf3['query'][_0x5a14('0x4f')](_0x5a14('0x50'))){_0x3a04f8[_0x5a14('0x32')]=qs[_0x5a14('0x32')](_0x422cf3[_0x5a14('0x49')]['limit']);_0x3a04f8['offset']=qs['offset'](_0x422cf3['query'][_0x5a14('0x31')]);}_0x3a04f8[_0x5a14('0x51')]=qs['sort'](_0x422cf3[_0x5a14('0x49')][_0x5a14('0x52')]);_0x3a04f8['where']=qs[_0x5a14('0x4a')](_[_0x5a14('0x53')](_0x422cf3[_0x5a14('0x49')],_0x3ad8b0['filters']));if(_0x422cf3['query']['filter']){_0x3a04f8[_0x5a14('0x54')]=_['merge'](_0x3a04f8[_0x5a14('0x54')],{'$or':_['map'](_0x5279d5,function(_0x263a7c){if(_0x263a7c[_0x5a14('0x55')][_0x5a14('0x56')]!==_0x5a14('0x57')){return db[_0x5a14('0x58')][_0x5a14('0x54')](db[_0x5a14('0x58')]['fn'](_0x5a14('0x59'),db[_0x5a14('0x58')][_0x5a14('0x5a')](_0x263a7c[_0x5a14('0x5b')])),{'$like':db[_0x5a14('0x58')]['fn']('lower','%'+_0x422cf3[_0x5a14('0x49')]['filter']+'%')});}})});}_0x3a04f8=_['merge']({},_0x3a04f8,_0x422cf3[_0x5a14('0x5c')]);var _0x4bae94={'where':_0x3a04f8['where']};return db[_0x5a14('0x44')][_0x5a14('0x5d')](_0x4bae94)['then'](function(_0x35c516){_0xe6db98[_0x5a14('0x5d')]=_0x35c516;if(_0x422cf3[_0x5a14('0x49')][_0x5a14('0x5e')]){_0x3a04f8[_0x5a14('0x5f')]=[{'all':!![]}];}return db[_0x5a14('0x44')][_0x5a14('0x60')](_0x3a04f8);})[_0x5a14('0x22')](function(_0x3fd8c5){_0xe6db98['rows']=_0x3fd8c5;return _0xe6db98;})[_0x5a14('0x22')](respondWithFilteredResult(_0x33d4c7,_0x3a04f8))[_0x5a14('0x2c')](handleError(_0x33d4c7,null));};exports[_0x5a14('0x61')]=function(_0x5bd386,_0x46fd5e){var _0x5bb2a2={'raw':![],'where':{'id':_0x5bd386[_0x5a14('0x62')]['id']}},_0x134c94={};_0x134c94[_0x5a14('0x46')]=_['differenceBy'](_['keys'](db['User'][_0x5a14('0x45')]),[_0x5a14('0x48'),_0x5a14('0x63')]);_0x134c94[_0x5a14('0x49')]=_[_0x5a14('0x47')](_0x5bd386['query']);_0x134c94[_0x5a14('0x4a')]=_[_0x5a14('0x4b')](_0x134c94[_0x5a14('0x46')],_0x134c94['query']);_0x5bb2a2[_0x5a14('0x4c')]=_[_0x5a14('0x4b')](_0x134c94['model'],qs[_0x5a14('0x4d')](_0x5bd386['query'][_0x5a14('0x4d')]));_0x5bb2a2['attributes']=_0x5bb2a2[_0x5a14('0x4c')]['length']?_0x5bb2a2[_0x5a14('0x4c')]:_0x134c94[_0x5a14('0x46')];if(_0x5bd386[_0x5a14('0x49')][_0x5a14('0x5e')]){_0x5bb2a2[_0x5a14('0x5f')]=[{'all':!![]}];}_0x5bb2a2=_[_0x5a14('0x64')]({},_0x5bb2a2,_0x5bd386['options']);return db[_0x5a14('0x44')][_0x5a14('0x3e')](_0x5bb2a2)[_0x5a14('0x22')](handleEntityNotFound(_0x46fd5e,null))[_0x5a14('0x22')](respondWithResult(_0x46fd5e,null))[_0x5a14('0x2c')](handleError(_0x46fd5e,null));};exports['bulkCreate']=function(_0x1260ed,_0x51a034){return db[_0x5a14('0x44')][_0x5a14('0x65')](_0x1260ed[_0x5a14('0x66')],{'raw':![],'individualHooks':!![]})[_0x5a14('0x22')](respondWithResult(_0x51a034,0xc9))[_0x5a14('0x2c')](handleError(_0x51a034,null));};exports[_0x5a14('0x33')]=function(_0x1f87ae,_0xffaf3b){if(_0x1f87ae[_0x5a14('0x66')]['id']){delete _0x1f87ae[_0x5a14('0x66')]['id'];}delete _0x1f87ae[_0x5a14('0x66')]['role'];return db['User']['find']({'where':{'id':_0x1f87ae['params']['id']}})[_0x5a14('0x22')](handleEntityNotFound(_0xffaf3b,null))[_0x5a14('0x22')](saveUpdates(_0x1f87ae[_0x5a14('0x66')],null))[_0x5a14('0x22')](respondWithResult(_0xffaf3b,null))[_0x5a14('0x2c')](handleError(_0xffaf3b,null));};exports['describe']=function(_0x4e9755,_0x4a5cdd){return db[_0x5a14('0x44')][_0x5a14('0x67')]()[_0x5a14('0x22')](respondWithResult(_0x4a5cdd,null))['catch'](handleError(_0x4a5cdd,null));};exports['addContacts']=function(_0x21823e,_0x472172,_0x30e246){return db[_0x5a14('0x44')]['find']({'where':{'id':_0x21823e[_0x5a14('0x62')]['id']}})[_0x5a14('0x22')](handleEntityNotFound(_0x472172,null))[_0x5a14('0x22')](function(_0x5431c6){if(_0x5431c6){return _0x5431c6[_0x5a14('0x68')](_0x21823e[_0x5a14('0x66')][_0x5a14('0x69')],_[_0x5a14('0x6a')](_0x21823e['body'],[_0x5a14('0x69'),'id'])||{});}})[_0x5a14('0x22')](respondWithResult(_0x472172,null))[_0x5a14('0x2c')](handleError(_0x472172,null));};var getLicense=function(_0x18922d){return new BPromise(function(_0xdc7c01,_0x31c78c){var _0x20e0ad=0x0;_0x18922d[_0x5a14('0x66')][_0x5a14('0x3d')]===_0x5a14('0x6b')&&_0xdc7c01(_0x5a14('0x6c'));return db[_0x5a14('0x44')][_0x5a14('0x5d')]({'where':{'$or':[{'role':_0x18922d[_0x5a14('0x66')][_0x5a14('0x3d')]===_0x5a14('0x38')?_0x5a14('0x38'):[_0x5a14('0x6d'),_0x5a14('0x36')]}]}})[_0x5a14('0x22')](function(_0x474c42){_0x20e0ad=_0x474c42;return require(_0x5a14('0x6e'))[_0x5a14('0x6f')]();})['then'](function(_0x5cf527){var _0x34d044=_0x18922d[_0x5a14('0x66')][_0x5a14('0x3d')]===_0x5a14('0x38')?_0x5a14('0x70'):_0x5a14('0x71');if(!_['isNil'](_0x5cf527[_0x34d044])&&_0x20e0ad>=_0x5cf527[_0x34d044]){return _0x31c78c({'message':'License\x20limit\x20reached'});}return _0xdc7c01(util[_0x5a14('0x72')](_0x5a14('0x73'),_0x34d044,_0x20e0ad));})[_0x5a14('0x2c')](function(_0x4108bc){return _0x31c78c(_0x4108bc);});});};exports['create']=function(_0x125960,_0x3739db){return getLicense(_0x125960)['then'](function(_0x42c8ca){if(!_0x125960[_0x5a14('0x66')][_0x5a14('0x74')]){var _0x160b83;return db[_0x5a14('0x75')][_0x5a14('0x76')](0x1)[_0x5a14('0x22')](function(_0x31f898){_0x31f898[_0x5a14('0x77')]=!![];return checkPasswordPattern(_0x31f898,_0x125960[_0x5a14('0x66')][_0x5a14('0x48')],_0x31f898['securePassword']);})[_0x5a14('0x22')](function(_0x1b2732){_0x160b83=_0x1b2732[_0x5a14('0x78')];return db[_0x5a14('0x44')][_0x5a14('0x79')](_0x5a14('0x74'));})[_0x5a14('0x22')](function(_0x28c99c){if(_['isNil'](_0x28c99c)){if(_0x160b83){_0x125960['body'][_0x5a14('0x74')]=_0x160b83;}else{_0x125960['body'][_0x5a14('0x74')]=0x1;}}else{if(_['isNil'](_0x160b83)||_0x160b83==_0x28c99c){_0x125960[_0x5a14('0x66')][_0x5a14('0x74')]=_0x28c99c+0x1;}else if(_0x160b83>_0x28c99c){_0x125960[_0x5a14('0x66')]['internal']=_0x160b83;}else{return db['sequelize']['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x5a14('0x58')][_0x5a14('0x7a')][_0x5a14('0x7b')]})['then'](function(_0x3bcba5){if(_0x3bcba5&&_0x3bcba5[_0x5a14('0x4e')]){for(var _0x25f1f9=0x0,_0x50cafa=_0x3bcba5[_0x5a14('0x4e')];_0x25f1f9<_0x50cafa&&_['isNil'](_0x125960[_0x5a14('0x66')][_0x5a14('0x74')]);_0x25f1f9++){if(_0x160b83<=_0x3bcba5[_0x25f1f9][_0x5a14('0x7c')]){_0x125960[_0x5a14('0x66')][_0x5a14('0x74')]=_0x3bcba5[_0x25f1f9][_0x5a14('0x7c')];}else if(_0x160b83>_0x3bcba5[_0x25f1f9]['from']&&_0x160b83<=_0x3bcba5[_0x25f1f9]['to']){_0x125960[_0x5a14('0x66')][_0x5a14('0x74')]=_0x160b83;}}}if(_['isNil'](_0x125960['body']['internal'])){_0x125960['body'][_0x5a14('0x74')]=_0x28c99c+0x1;}});}}});}})[_0x5a14('0x22')](function(){if(_0x125960[_0x5a14('0x66')][_0x5a14('0x7d')]){_0x125960[_0x5a14('0x66')]['mailbox']=_0x125960[_0x5a14('0x66')]['internal'];_0x125960[_0x5a14('0x66')][_0x5a14('0x7e')]={'mailbox':_0x125960[_0x5a14('0x66')][_0x5a14('0x74')],'password':_0x125960[_0x5a14('0x66')][_0x5a14('0x48')],'fullname':_0x125960['body']['fullname'],'email':_0x125960[_0x5a14('0x66')][_0x5a14('0x7f')]};}if(_0x125960[_0x5a14('0x66')]&&_0x125960[_0x5a14('0x66')][_0x5a14('0x3d')]==='agent'){_0x125960[_0x5a14('0x66')][_0x5a14('0x80')]=[_0x5a14('0x81'),_0x5a14('0x82'),_0x5a14('0x83'),_0x5a14('0x84'),_0x5a14('0x85'),_0x5a14('0x86'),_0x5a14('0x87'),_0x5a14('0x88'),_0x5a14('0x89'),'109',_0x5a14('0x8a'),_0x5a14('0x8b')];}return db[_0x5a14('0x44')][_0x5a14('0x8c')](_0x125960[_0x5a14('0x66')],{'include':[{'model':db[_0x5a14('0x7e')],'as':_0x5a14('0x7e')}]});})[_0x5a14('0x22')](function(_0x4f7cfa){if(_0x125960[_0x5a14('0x66')]['role']===_0x5a14('0x36'))return _0x4f7cfa;var _0x3214bd=_0x125960[_0x5a14('0x36')][_0x5a14('0x35')]({'plain':!![]});if(!_0x3214bd)throw new Error(_0x5a14('0x8d'));if(_0x3214bd[_0x5a14('0x3d')]===_0x5a14('0x36')){var _0x48c2eb=_0x4f7cfa[_0x5a14('0x35')]({'plain':!![]});var _0x5ec251=[{'name':_0x5a14('0x37'),'value':_0x5a14('0x6b')},{'name':_0x5a14('0x8e'),'value':'telephone'}];var _0x432cf0=_[_0x5a14('0x3e')](_0x5ec251,['value',_0x48c2eb[_0x5a14('0x3d')]])[_0x5a14('0x3f')];return db[_0x5a14('0x8f')]['find']({'where':{'name':_0x432cf0,'userProfileId':_0x3214bd[_0x5a14('0x90')]},'raw':!![]})[_0x5a14('0x22')](function(_0x4eed6a){if(_0x4eed6a&&_0x4eed6a[_0x5a14('0x91')]===0x0){return db[_0x5a14('0x40')][_0x5a14('0x8c')]({'name':_0x48c2eb[_0x5a14('0x3f')],'resourceId':_0x48c2eb['id'],'type':_0x4eed6a[_0x5a14('0x3f')],'sectionId':_0x4eed6a['id']},{})[_0x5a14('0x22')](function(){return _0x4f7cfa;});}else{return _0x4f7cfa;}})['catch'](function(_0x3c83ec){logger[_0x5a14('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c83ec);throw _0x3c83ec;});}return _0x4f7cfa;})[_0x5a14('0x22')](respondWithResult(_0x3739db,0xc9))[_0x5a14('0x2c')](handleError(_0x3739db,null));};exports[_0x5a14('0x92')]=function(_0x1fda6c,_0x7a56df,_0x1cc363){var _0x128788=![];if(_0x1fda6c[_0x5a14('0x66')]['id']){delete _0x1fda6c['body']['id'];}if(!_[_0x5a14('0x93')](_0x1fda6c[_0x5a14('0x66')][_0x5a14('0x94')])){if(_0x1fda6c['body'][_0x5a14('0x94')]===_0x1fda6c[_0x5a14('0x66')][_0x5a14('0x95')]){throw new Error(_0x5a14('0x96'));}}return db[_0x5a14('0x44')][_0x5a14('0x3e')]({'where':{'id':_0x1fda6c[_0x5a14('0x62')]['id']}})['then'](function(_0x46c198){if(_0x46c198){if(_0x46c198['id']==_0x1fda6c[_0x5a14('0x36')]['id']){if(!_0x1fda6c['body'][_0x5a14('0x94')]||!_0x1fda6c[_0x5a14('0x66')][_0x5a14('0x95')]){throw new db[(_0x5a14('0x97'))][(_0x5a14('0x98'))](_0x5a14('0x99'));}if(!_0x46c198['authenticate'](_0x1fda6c[_0x5a14('0x66')][_0x5a14('0x94')])){throw new db[(_0x5a14('0x97'))][(_0x5a14('0x98'))](_0x5a14('0x9a'));}if(_0x1fda6c[_0x5a14('0x66')][_0x5a14('0x94')]==_0x1fda6c[_0x5a14('0x66')]['newPassword']){throw new db[(_0x5a14('0x97'))]['ValidationError'](_0x5a14('0x9b'));}return _0x46c198;}else if(_0x1fda6c[_0x5a14('0x36')][_0x5a14('0x3d')]==_0x5a14('0x6d')){if(!_0x1fda6c['body'][_0x5a14('0x95')]){throw new db[(_0x5a14('0x97'))][(_0x5a14('0x98'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x46c198;}else if(_0x1fda6c[_0x5a14('0x36')]['role']=='user'){if(!_0x1fda6c[_0x5a14('0x66')]['newPassword']){throw new db[(_0x5a14('0x97'))][(_0x5a14('0x98'))](_0x5a14('0x9c'));}if(_0x46c198[_0x5a14('0x3d')]!=_0x5a14('0x6b')){throw new db[(_0x5a14('0x97'))][(_0x5a14('0x98'))]('Unauthorized');}return _0x46c198;}else{throw new db[(_0x5a14('0x97'))]['ValidationError']('Unauthorized');}}return null;})[_0x5a14('0x22')](handleEntityNotFound(_0x7a56df,null))[_0x5a14('0x22')](function(_0x2b55cb){return db[_0x5a14('0x75')][_0x5a14('0x9d')]({'attributes':['id','securePassword']})[_0x5a14('0x22')](function(_0x1a6deb){_0x128788=_0x1a6deb[_0x5a14('0x77')];return checkPasswordPattern(_0x2b55cb,_0x1fda6c[_0x5a14('0x66')][_0x5a14('0x95')],_0x128788);});})[_0x5a14('0x22')](saveUpdates({'password':_0x1fda6c['body'][_0x5a14('0x95')],'passwordResetAt':_0x1fda6c[_0x5a14('0x36')]['id']==_0x1fda6c[_0x5a14('0x62')]['id']?moment():null},null))['then'](respondWithResult(_0x7a56df,null))[_0x5a14('0x2c')](handleError(_0x7a56df,null));};exports['addQueues']=function(_0x467d8,_0x3b3a6e,_0x49f111){var _0x2818d8=_0x467d8[_0x5a14('0x66')][_0x5a14('0x9e')];return db['User'][_0x5a14('0x3e')]({'where':{'id':_0x467d8['params']['id']},'attributes':['id','name',_0x5a14('0x3d'),_0x5a14('0x9f'),'loginInPause',_0x5a14('0xa0'),'interface']})[_0x5a14('0x22')](handleEntityNotFound(_0x3b3a6e,null))[_0x5a14('0x22')](function(_0x3cf839){if(_0x3cf839){if(!utils['isValidChannel'](_0x2818d8)){throw new db['Sequelize']['ValidationError'](_0x5a14('0xa1'));}return _0x3cf839[_0x5a14('0xa2')+_['capitalize'](_0x2818d8['toLowerCase']())+_0x5a14('0xa3')](_0x467d8['body'][_0x5a14('0x69')],{'penalty':_0x467d8['body'][_0x5a14('0xa4')]||0x0})[_0x5a14('0xa5')](function(_0x1a5362){for(var _0x969989=0x0;_0x969989<_0x467d8[_0x5a14('0x66')]['ids'][_0x5a14('0x4e')];_0x969989+=0x1){var _0x281eab={'UserId':_0x467d8[_0x5a14('0x62')]['id']};_0x281eab[_[_0x5a14('0xa6')](_0x2818d8[_0x5a14('0xa7')]())+_0x5a14('0xa8')]=_0x467d8['body']['ids'][_0x969989];socket['emit'](_0x5a14('0x36')+_[_0x5a14('0xa6')](_0x2818d8['toLowerCase']())+_0x5a14('0xa9'),_0x281eab);}return _0x1a5362;})[_0x5a14('0x22')](function(){if(_0x2818d8===_0x5a14('0xaa')){return db[_0x5a14('0xab')]['findAll']({'where':{'id':_0x467d8[_0x5a14('0x66')][_0x5a14('0x69')]||[]},'raw':!![],'attributes':['id',_0x5a14('0x3f')]});}})[_0x5a14('0x22')](function(_0x1d4acc){var _0x160c11=_0x3cf839[_0x5a14('0x35')]({'plain':!![]});var _0x21a36c=[];if(_0x2818d8==='voice'&&_0x160c11[_0x5a14('0x3d')]===_0x5a14('0x6b')&&_0x160c11['online']){for(var _0x149a08=0x0;_0x149a08<_0x1d4acc[_0x5a14('0x4e')];_0x149a08+=0x1){_0x21a36c[_0x5a14('0xac')]({'membername':_0x160c11['name'],'UserId':_0x160c11['id'],'queue_name':_0x1d4acc[_0x149a08]['name'],'VoiceQueueId':_0x1d4acc[_0x149a08]['id'],'interface':_[_0x5a14('0x93')](_0x160c11[_0x5a14('0xad')])?util[_0x5a14('0x72')](_0x5a14('0xae'),_0x160c11[_0x5a14('0x3f')]):_0x160c11[_0x5a14('0xad')],'paused':_0x160c11[_0x5a14('0xa0')]||![],'penalty':_0x467d8[_0x5a14('0x66')][_0x5a14('0xa4')]||0x0});}return BPromise['each'](_0x21a36c,function(_0x628a69){return db[_0x5a14('0xaf')][_0x5a14('0xb0')](_0x628a69);});}return _0x3cf839;});}})[_0x5a14('0x22')](respondWithStatusCode(_0x3b3a6e,null))[_0x5a14('0x2c')](handleError(_0x3b3a6e,null));};exports[_0x5a14('0xb1')]=function(_0x34b098,_0x477ee0,_0x5099a3){var _0x151b98;return db[_0x5a14('0x44')][_0x5a14('0x3e')]({'where':{'id':_0x34b098[_0x5a14('0x62')]['id']},'attributes':['id',_0x5a14('0x3f'),_0x5a14('0x3d')]})[_0x5a14('0x22')](handleEntityNotFound(_0x477ee0,null))['then'](function(_0x115a12){if(_0x115a12){_0x151b98=_0x115a12;if(!_0x34b098[_0x5a14('0x49')][_0x5a14('0x9e')]||!utils[_0x5a14('0xb2')](_0x34b098[_0x5a14('0x49')][_0x5a14('0x9e')])){throw new db[(_0x5a14('0x97'))][(_0x5a14('0x98'))](_0x5a14('0xa1'));}return _0x115a12['remove'+_[_0x5a14('0xa6')](_0x34b098['query'][_0x5a14('0x9e')][_0x5a14('0xa7')]())+'Queues'](_0x34b098['query'][_0x5a14('0x69')]);}})['then'](function(_0x593a55){for(var _0x1cb317=0x0;_0x1cb317<_0x34b098[_0x5a14('0x49')][_0x5a14('0x69')][_0x5a14('0x4e')];_0x1cb317+=0x1){var _0x393596={'UserId':_0x34b098[_0x5a14('0x62')]['id']};_0x393596[_[_0x5a14('0xa6')](_0x34b098[_0x5a14('0x49')][_0x5a14('0x9e')][_0x5a14('0xa7')]())+_0x5a14('0xa8')]=_0x34b098[_0x5a14('0x49')][_0x5a14('0x69')][_0x1cb317];socket[_0x5a14('0xb3')](_0x5a14('0x36')+_['capitalize'](_0x34b098['query'][_0x5a14('0x9e')][_0x5a14('0xa7')]())+'Queue:remove',_0x393596);}return _0x593a55;})[_0x5a14('0x22')](function(){if(_0x34b098[_0x5a14('0x49')]['channel']===_0x5a14('0xaa')){return db[_0x5a14('0xaf')][_0x5a14('0x34')]({'where':{'UserId':_0x34b098[_0x5a14('0x62')]['id'],'VoiceQueueId':_0x34b098[_0x5a14('0x49')][_0x5a14('0x69')]},'individualHooks':!![]})['then'](function(){return _0x151b98;});}return _0x151b98;})['then'](respondWithStatusCode(_0x477ee0,null))[_0x5a14('0x2c')](handleError(_0x477ee0,null));};exports[_0x5a14('0xb4')]=function(_0x5d525a,_0x4c9936,_0x5ab586){_0x5d525a['body'][_0x5a14('0xb5')]=_0x5d525a[_0x5a14('0xb6')][_0x5a14('0xb7')];return db['User'][_0x5a14('0x3e')]({'where':{'id':_0x5d525a[_0x5a14('0x62')]['id']}})['then'](handleEntityNotFound(_0x4c9936,null))['then'](saveUpdates(_0x5d525a['body'],null))[_0x5a14('0x22')](respondWithResult(_0x4c9936,null))['catch'](handleError(_0x4c9936,null));};exports[_0x5a14('0xb8')]=function(_0x70e15a,_0x270f0b,_0x1dfadf){var _0x42945f=path[_0x5a14('0xb9')](config['root'],_0x5a14('0xba'));return db[_0x5a14('0x44')]['find']({'where':{'id':_0x70e15a[_0x5a14('0x62')]['id']},'attributes':['id',_0x5a14('0xb5')],'raw':!![]})[_0x5a14('0x22')](handleEntityNotFound(_0x270f0b,null))['then'](function(_0xd5aa6d){if(_0xd5aa6d){if(_[_0x5a14('0x93')](_0xd5aa6d[_0x5a14('0xb5')])){return _0x270f0b[_0x5a14('0xbb')](_0x42945f);}else{if(!fs[_0x5a14('0xbc')](path[_0x5a14('0xb9')](config[_0x5a14('0xbd')],_0x5a14('0xbe'),_0xd5aa6d[_0x5a14('0xb5')]))){return _0x270f0b[_0x5a14('0xbb')](_0x42945f);}return _0x270f0b[_0x5a14('0xbb')](path[_0x5a14('0xb9')](config[_0x5a14('0xbd')],_0x5a14('0xbe'),_0xd5aa6d['userpic']));}}})['catch'](handleError(_0x270f0b,null));};exports[_0x5a14('0xbf')]=function(_0x199c5e,_0x347581,_0x48a628){var _0x52fc02={};var _0x65089a={};var _0x1807e2;var _0x3b7d17;return db[_0x5a14('0x44')][_0x5a14('0x9d')]({'where':{'id':_0x199c5e[_0x5a14('0x62')]['id']}})[_0x5a14('0x22')](handleEntityNotFound(_0x347581,null))['then'](function(_0x1cf11c){if(_0x1cf11c){_0x1807e2=_0x1cf11c;_0x65089a[_0x5a14('0x46')]=_['keys'](db['CmContact'][_0x5a14('0x45')]);_0x65089a[_0x5a14('0x49')]=_[_0x5a14('0x47')](_0x199c5e[_0x5a14('0x49')]);_0x65089a['filters']=_['intersection'](_0x65089a[_0x5a14('0x46')],_0x65089a[_0x5a14('0x49')]);_0x52fc02[_0x5a14('0x4c')]=_['intersection'](_0x65089a[_0x5a14('0x46')],qs[_0x5a14('0x4d')](_0x199c5e[_0x5a14('0x49')][_0x5a14('0x4d')]));_0x52fc02[_0x5a14('0x4c')]=_0x52fc02[_0x5a14('0x4c')][_0x5a14('0x4e')]?_0x52fc02['attributes']:_0x65089a['model'];_0x52fc02[_0x5a14('0x51')]=qs[_0x5a14('0x52')](_0x199c5e['query'][_0x5a14('0x52')]);_0x52fc02['where']=qs[_0x5a14('0x4a')](_['pick'](_0x199c5e[_0x5a14('0x49')],_0x65089a[_0x5a14('0x4a')]));if(_0x199c5e[_0x5a14('0x49')][_0x5a14('0x39')]){_0x52fc02[_0x5a14('0x54')]=_['merge'](_0x52fc02[_0x5a14('0x54')],{'$or':_[_0x5a14('0x3b')](_0x52fc02['attributes'],function(_0x58471a){var _0x3e948d={};_0x3e948d[_0x58471a]={'$like':'%'+_0x199c5e[_0x5a14('0x49')][_0x5a14('0x39')]+'%'};return _0x3e948d;})});}_0x52fc02=_[_0x5a14('0x64')]({},_0x52fc02,_0x199c5e[_0x5a14('0x5c')]);return _0x1807e2[_0x5a14('0xbf')](_0x52fc02);}})[_0x5a14('0x22')](function(_0xcc36c){if(_0xcc36c){_0x3b7d17=_0xcc36c['length'];if(_0x199c5e[_0x5a14('0x49')][_0x5a14('0x4f')](_0x5a14('0x5e'))){_0x52fc02[_0x5a14('0x5f')]=[{'model':db[_0x5a14('0xc0')],'as':'List','required':![]},{'model':db[_0x5a14('0xc1')],'as':_0x5a14('0xc2'),'attributes':['id',_0x5a14('0x3f'),'color'],'where':_0x199c5e[_0x5a14('0x49')]['tag']?{'id':_0x199c5e['query'][_0x5a14('0xc3')]}:undefined,'required':_0x199c5e[_0x5a14('0x49')][_0x5a14('0xc3')]?!![]:![]}];}if(!_0x199c5e[_0x5a14('0x49')]['hasOwnProperty'](_0x5a14('0x50'))){_0x52fc02[_0x5a14('0x32')]=qs[_0x5a14('0x32')](_0x199c5e[_0x5a14('0x49')][_0x5a14('0x32')]);_0x52fc02['offset']=qs[_0x5a14('0x31')](_0x199c5e[_0x5a14('0x49')]['offset']);}return _0x1807e2[_0x5a14('0xbf')](_0x52fc02);}})[_0x5a14('0x22')](function(_0x3540fa){if(_0x3540fa){return _0x3540fa?{'count':_0x3b7d17,'rows':_0x3540fa}:null;}})['then'](respondWithResult(_0x347581,null))['catch'](handleError(_0x347581,null));};exports[_0x5a14('0xc4')]=function(_0xed0379,_0x3f4b43,_0xc511e7){var _0x4f1c3e;var _0x593cb2;var _0x55bd6b={};var _0x47e85c;return db[_0x5a14('0x44')]['findOne']({'where':{'id':_0xed0379[_0x5a14('0x62')]['id']},'attributes':['id',_0x5a14('0x3f'),'role']})[_0x5a14('0x22')](handleEntityNotFound(_0x3f4b43,null))[_0x5a14('0x22')](function(_0x1de435){if(!utils[_0x5a14('0xb2')](_0xed0379[_0x5a14('0x49')][_0x5a14('0x9e')])){throw new db[(_0x5a14('0x97'))]['ValidationError']('Unknown\x20channel');}_0x4f1c3e=_0x1de435;var _0x14dbd6={};_0x14dbd6['model']=_[_0x5a14('0x47')](db[_[_0x5a14('0xa6')](_0xed0379['query']['channel'])+_0x5a14('0xc5')]['rawAttributes']);_0x14dbd6['query']=_[_0x5a14('0x47')](_0xed0379[_0x5a14('0x49')]);_0x14dbd6[_0x5a14('0x4a')]=_['intersection'](_0x14dbd6[_0x5a14('0x46')],_0x14dbd6['query']);_0x55bd6b[_0x5a14('0x4c')]=_[_0x5a14('0x4b')](_0x14dbd6[_0x5a14('0x46')],qs[_0x5a14('0x4d')](_0xed0379[_0x5a14('0x49')][_0x5a14('0x4d')]));_0x55bd6b[_0x5a14('0x4c')]=_0x55bd6b[_0x5a14('0x4c')][_0x5a14('0x4e')]?_0x55bd6b['attributes']:_0x14dbd6['model'];_0x55bd6b[_0x5a14('0x51')]=qs['sort'](_0xed0379[_0x5a14('0x49')][_0x5a14('0x52')]);_0x55bd6b[_0x5a14('0x54')]=qs[_0x5a14('0x4a')](_[_0x5a14('0x53')](_0xed0379[_0x5a14('0x49')],_0x14dbd6['filters']));if(_0xed0379[_0x5a14('0x49')][_0x5a14('0x39')]){_0x55bd6b['where']=_['merge'](_0x55bd6b[_0x5a14('0x54')],{'$or':_[_0x5a14('0x3b')](_0x55bd6b['attributes'],function(_0x550b7e){var _0x532b13={};_0x532b13[_0x550b7e]={'$like':'%'+_0xed0379[_0x5a14('0x49')][_0x5a14('0x39')]+'%'};return _0x532b13;})});}_0x55bd6b=_[_0x5a14('0x64')]({},_0x55bd6b,_0xed0379['options']);switch(_0x4f1c3e[_0x5a14('0x3d')]){case _0x5a14('0x6d'):return db[_[_0x5a14('0xa6')](_0xed0379[_0x5a14('0x49')]['channel'])+_0x5a14('0xc5')][_0x5a14('0x60')](_0x55bd6b);case _0x5a14('0x36'):case _0x5a14('0x6b'):return _0x4f1c3e[_0x5a14('0x35')+_[_0x5a14('0xa6')](_0xed0379[_0x5a14('0x49')]['channel'])+_0x5a14('0xa3')](_0x55bd6b);default:throw new db[(_0x5a14('0x97'))][(_0x5a14('0x98'))](_0x5a14('0xc6'));}})['then'](function(_0x4e8996){_0x47e85c=_0x4e8996[_0x5a14('0x4e')];if(!_0xed0379['query'][_0x5a14('0x4f')](_0x5a14('0x50'))){_0x55bd6b['limit']=qs['limit'](_0xed0379[_0x5a14('0x49')][_0x5a14('0x32')]);_0x55bd6b[_0x5a14('0x31')]=qs[_0x5a14('0x31')](_0xed0379[_0x5a14('0x49')][_0x5a14('0x31')]);}switch(_0x4f1c3e[_0x5a14('0x3d')]){case _0x5a14('0x6d'):return db[_[_0x5a14('0xa6')](_0xed0379[_0x5a14('0x49')][_0x5a14('0x9e')])+_0x5a14('0xc5')][_0x5a14('0x60')](_0x55bd6b);case _0x5a14('0x36'):case _0x5a14('0x6b'):return _0x4f1c3e['get'+_[_0x5a14('0xa6')](_0xed0379[_0x5a14('0x49')][_0x5a14('0x9e')])+_0x5a14('0xa3')](_0x55bd6b);}})[_0x5a14('0x22')](function(_0x3587cd){return{'count':_0x47e85c,'rows':_0x3587cd};})[_0x5a14('0x22')](respondWithResult(_0x3f4b43,null))['catch'](handleError(_0x3f4b43,null));};exports['getVoiceQueuesRt']=function(_0x4625f4,_0x33ab94,_0x1fe468){var _0x262ebd={};var _0x2f61be={};var _0x51847d;var _0x1eeefb;return db[_0x5a14('0x44')][_0x5a14('0x9d')]({'where':{'id':_0x4625f4[_0x5a14('0x62')]['id']}})['then'](handleEntityNotFound(_0x33ab94,null))['then'](function(_0x180923){if(_0x180923){_0x51847d=_0x180923;_0x2f61be[_0x5a14('0x46')]=_[_0x5a14('0x47')](db[_0x5a14('0xaf')][_0x5a14('0x45')]);_0x2f61be['query']=_[_0x5a14('0x47')](_0x4625f4[_0x5a14('0x49')]);_0x2f61be['filters']=_[_0x5a14('0x4b')](_0x2f61be[_0x5a14('0x46')],_0x2f61be[_0x5a14('0x49')]);_0x262ebd['attributes']=_[_0x5a14('0x4b')](_0x2f61be[_0x5a14('0x46')],qs[_0x5a14('0x4d')](_0x4625f4[_0x5a14('0x49')][_0x5a14('0x4d')]));_0x262ebd['attributes']=_0x262ebd[_0x5a14('0x4c')]['length']?_0x262ebd['attributes']:_0x2f61be[_0x5a14('0x46')];_0x262ebd['order']=qs[_0x5a14('0x52')](_0x4625f4[_0x5a14('0x49')][_0x5a14('0x52')]);_0x262ebd[_0x5a14('0x54')]=qs[_0x5a14('0x4a')](_[_0x5a14('0x53')](_0x4625f4['query'],_0x2f61be[_0x5a14('0x4a')]));if(_0x4625f4[_0x5a14('0x49')][_0x5a14('0x39')]){_0x262ebd['where']=_[_0x5a14('0x64')](_0x262ebd[_0x5a14('0x54')],{'$or':_[_0x5a14('0x3b')](_0x262ebd['attributes'],function(_0x56155e){var _0x5213ec={};_0x5213ec[_0x56155e]={'$like':'%'+_0x4625f4[_0x5a14('0x49')][_0x5a14('0x39')]+'%'};return _0x5213ec;})});}_0x262ebd=_[_0x5a14('0x64')]({},_0x262ebd,_0x4625f4[_0x5a14('0x5c')]);return _0x51847d[_0x5a14('0xc7')](_0x262ebd);}})[_0x5a14('0x22')](function(_0xc17c55){if(_0xc17c55){_0x1eeefb=_0xc17c55['length'];if(!_0x4625f4[_0x5a14('0x49')]['hasOwnProperty'](_0x5a14('0x50'))){_0x262ebd[_0x5a14('0x32')]=qs['limit'](_0x4625f4[_0x5a14('0x49')][_0x5a14('0x32')]);_0x262ebd[_0x5a14('0x31')]=qs['offset'](_0x4625f4[_0x5a14('0x49')]['offset']);}return _0x51847d['getVoiceQueuesRt'](_0x262ebd);}})[_0x5a14('0x22')](function(_0x55bbf1){if(_0x55bbf1){return _0x55bbf1?{'count':_0x1eeefb,'rows':_0x55bbf1}:null;}})[_0x5a14('0x22')](respondWithResult(_0x33ab94,null))[_0x5a14('0x2c')](handleError(_0x33ab94,null));};exports['getGroups']=function(_0x42d9f3,_0x32568c,_0x14fb99){var _0xcc580a={};var _0x2c7cba={};var _0x40da54;var _0x3485a7;return db[_0x5a14('0x44')][_0x5a14('0x9d')]({'where':{'id':_0x42d9f3[_0x5a14('0x62')]['id']}})[_0x5a14('0x22')](handleEntityNotFound(_0x32568c,null))[_0x5a14('0x22')](function(_0x142a3c){if(_0x142a3c){_0x40da54=_0x142a3c;_0x2c7cba['model']=_[_0x5a14('0x47')](db[_0x5a14('0xc8')]['rawAttributes']);_0x2c7cba[_0x5a14('0x49')]=_['keys'](_0x42d9f3[_0x5a14('0x49')]);_0x2c7cba[_0x5a14('0x4a')]=_[_0x5a14('0x4b')](_0x2c7cba['model'],_0x2c7cba[_0x5a14('0x49')]);_0xcc580a['attributes']=_[_0x5a14('0x4b')](_0x2c7cba[_0x5a14('0x46')],qs['fields'](_0x42d9f3[_0x5a14('0x49')]['fields']));_0xcc580a[_0x5a14('0x4c')]=_0xcc580a[_0x5a14('0x4c')][_0x5a14('0x4e')]?_0xcc580a['attributes']:_0x2c7cba[_0x5a14('0x46')];_0xcc580a['order']=qs[_0x5a14('0x52')](_0x42d9f3['query'][_0x5a14('0x52')]);_0xcc580a[_0x5a14('0x54')]=qs[_0x5a14('0x4a')](_[_0x5a14('0x53')](_0x42d9f3['query'],_0x2c7cba[_0x5a14('0x4a')]));if(_0x42d9f3[_0x5a14('0x49')][_0x5a14('0x39')]){_0xcc580a[_0x5a14('0x54')]=_['merge'](_0xcc580a['where'],{'$or':_[_0x5a14('0x3b')](_0xcc580a['attributes'],function(_0x5365c3){var _0x504cf1={};_0x504cf1[_0x5365c3]={'$like':'%'+_0x42d9f3[_0x5a14('0x49')][_0x5a14('0x39')]+'%'};return _0x504cf1;})});}_0xcc580a=_[_0x5a14('0x64')]({},_0xcc580a,_0x42d9f3['options']);return _0x40da54['getGroups'](_0xcc580a);}})[_0x5a14('0x22')](function(_0x38b55e){if(_0x38b55e){_0x3485a7=_0x38b55e['length'];if(!_0x42d9f3['query'][_0x5a14('0x4f')](_0x5a14('0x50'))){_0xcc580a[_0x5a14('0x32')]=qs['limit'](_0x42d9f3[_0x5a14('0x49')]['limit']);_0xcc580a[_0x5a14('0x31')]=qs[_0x5a14('0x31')](_0x42d9f3['query']['offset']);}return _0x40da54['getGroups'](_0xcc580a);}})[_0x5a14('0x22')](function(_0xdd0794){if(_0xdd0794){return _0xdd0794?{'count':_0x3485a7,'rows':_0xdd0794}:null;}})['then'](respondWithResult(_0x32568c,null))['catch'](handleError(_0x32568c,null));};exports[_0x5a14('0xc9')]=function(_0x19f1f1,_0x447041,_0x3d9883){var _0x5b9e2a={'raw':!![],'where':{}};var _0x2c45b0={};var _0x23dedf={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x19f1f1[_0x5a14('0x62')]['id']}})['then'](handleEntityNotFound(_0x447041,null))['then'](function(_0x1c771f){if(_0x1c771f){_0x2c45b0[_0x5a14('0x46')]=_[_0x5a14('0x47')](db[_0x5a14('0xca')][_0x5a14('0x45')]);_0x2c45b0[_0x5a14('0x49')]=_[_0x5a14('0x47')](_0x19f1f1[_0x5a14('0x49')]);_0x2c45b0['filters']=_[_0x5a14('0x4b')](_0x2c45b0['model'],_0x2c45b0[_0x5a14('0x49')]);_0x5b9e2a[_0x5a14('0x4c')]=_[_0x5a14('0x4b')](_0x2c45b0[_0x5a14('0x46')],qs[_0x5a14('0x4d')](_0x19f1f1[_0x5a14('0x49')][_0x5a14('0x4d')]));_0x5b9e2a[_0x5a14('0x4c')]=_0x5b9e2a[_0x5a14('0x4c')][_0x5a14('0x4e')]?_0x5b9e2a[_0x5a14('0x4c')]:_0x2c45b0[_0x5a14('0x46')];if(!_0x19f1f1[_0x5a14('0x49')]['hasOwnProperty'](_0x5a14('0x50'))){_0x5b9e2a[_0x5a14('0x32')]=qs[_0x5a14('0x32')](_0x19f1f1['query'][_0x5a14('0x32')]);_0x5b9e2a[_0x5a14('0x31')]=qs[_0x5a14('0x31')](_0x19f1f1[_0x5a14('0x49')][_0x5a14('0x31')]);}_0x5b9e2a[_0x5a14('0x51')]=qs[_0x5a14('0x52')](_0x19f1f1['query'][_0x5a14('0x52')]);_0x5b9e2a[_0x5a14('0x54')]=qs[_0x5a14('0x4a')](_[_0x5a14('0x53')](_0x19f1f1[_0x5a14('0x49')],_0x2c45b0[_0x5a14('0x4a')]));_0x5b9e2a['where'][_0x5a14('0xcb')]=_0x1c771f['id'];if(_0x19f1f1[_0x5a14('0x49')][_0x5a14('0x39')]){_0x5b9e2a[_0x5a14('0x54')]=_['merge'](_0x5b9e2a[_0x5a14('0x54')],{'$or':_['map'](_0x5b9e2a[_0x5a14('0x4c')],function(_0x20bef7){var _0x51436d={};_0x51436d[_0x20bef7]={'$like':'%'+_0x19f1f1[_0x5a14('0x49')][_0x5a14('0x39')]+'%'};return _0x51436d;})});}_0x5b9e2a=_['merge']({},_0x5b9e2a,_0x19f1f1['options']);return db['VoiceRecording'][_0x5a14('0x5d')]({'where':_0x5b9e2a[_0x5a14('0x54')]})[_0x5a14('0x22')](function(_0x6390a1){_0x23dedf[_0x5a14('0x5d')]=_0x6390a1;if(_0x19f1f1['query'][_0x5a14('0x5e')]){_0x5b9e2a[_0x5a14('0x5f')]=[{'all':!![]}];}return db[_0x5a14('0xca')][_0x5a14('0x60')](_0x5b9e2a);})[_0x5a14('0x22')](function(_0x2adf9d){_0x23dedf[_0x5a14('0xcc')]=_0x2adf9d;return _0x23dedf;});}})[_0x5a14('0x22')](respondWithFilteredResult(_0x447041,_0x5b9e2a))['catch'](handleError(_0x447041,null));};exports[_0x5a14('0xcd')]=function(_0x394d22,_0x5d854a,_0x375de8){var _0x3b5c12={'raw':!![],'where':{}};var _0x495077={};var _0x54262c={'count':0x0,'rows':[]};return db['User'][_0x5a14('0x9d')]({'where':{'id':_0x394d22[_0x5a14('0x62')]['id']}})[_0x5a14('0x22')](handleEntityNotFound(_0x5d854a,null))['then'](function(_0x49bbff){if(_0x49bbff){_0x495077['model']=_['keys'](db['ScreenRecording']['rawAttributes']);_0x495077['query']=_['keys'](_0x394d22['query']);_0x495077[_0x5a14('0x4a')]=_[_0x5a14('0x4b')](_0x495077['model'],_0x495077['query']);_0x3b5c12[_0x5a14('0x4c')]=_[_0x5a14('0x4b')](_0x495077[_0x5a14('0x46')],qs[_0x5a14('0x4d')](_0x394d22[_0x5a14('0x49')][_0x5a14('0x4d')]));_0x3b5c12['attributes']=_0x3b5c12[_0x5a14('0x4c')][_0x5a14('0x4e')]?_0x3b5c12['attributes']:_0x495077[_0x5a14('0x46')];if(!_0x394d22['query'][_0x5a14('0x4f')](_0x5a14('0x50'))){_0x3b5c12['limit']=qs[_0x5a14('0x32')](_0x394d22[_0x5a14('0x49')]['limit']);_0x3b5c12[_0x5a14('0x31')]=qs['offset'](_0x394d22['query'][_0x5a14('0x31')]);}_0x3b5c12['order']=qs[_0x5a14('0x52')](_0x394d22[_0x5a14('0x49')]['sort']);_0x3b5c12[_0x5a14('0x54')]=qs[_0x5a14('0x4a')](_['pick'](_0x394d22[_0x5a14('0x49')],_0x495077[_0x5a14('0x4a')]));_0x3b5c12['where'][_0x5a14('0xcb')]=_0x49bbff['id'];if(_0x394d22[_0x5a14('0x49')][_0x5a14('0x39')]){_0x3b5c12[_0x5a14('0x54')]=_[_0x5a14('0x64')](_0x3b5c12[_0x5a14('0x54')],{'$or':_['map'](_0x3b5c12[_0x5a14('0x4c')],function(_0x1384da){var _0x3af3b2={};_0x3af3b2[_0x1384da]={'$like':'%'+_0x394d22[_0x5a14('0x49')]['filter']+'%'};return _0x3af3b2;})});}_0x3b5c12=_[_0x5a14('0x64')]({},_0x3b5c12,_0x394d22[_0x5a14('0x5c')]);return db[_0x5a14('0xce')][_0x5a14('0x5d')]({'where':_0x3b5c12[_0x5a14('0x54')]})[_0x5a14('0x22')](function(_0x25a541){_0x54262c[_0x5a14('0x5d')]=_0x25a541;if(_0x394d22['query'][_0x5a14('0x5e')]){_0x3b5c12[_0x5a14('0x5f')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x3b5c12);})[_0x5a14('0x22')](function(_0x7144f9){_0x54262c[_0x5a14('0xcc')]=_0x7144f9;return _0x54262c;});}})[_0x5a14('0x22')](respondWithFilteredResult(_0x5d854a,_0x3b5c12))[_0x5a14('0x2c')](handleError(_0x5d854a,null));};exports[_0x5a14('0xcf')]=function(_0x1cf652,_0x5f0ede,_0x31b3d8){var _0x508ad2={};var _0x5ab1da={};var _0xf532a6;var _0x534eb9;return db[_0x5a14('0x44')][_0x5a14('0x9d')]({'where':{'id':_0x1cf652[_0x5a14('0x62')]['id']}})['then'](handleEntityNotFound(_0x5f0ede,null))[_0x5a14('0x22')](function(_0x17b729){if(_0x17b729){_0xf532a6=_0x17b729;_0x5ab1da[_0x5a14('0x46')]=_[_0x5a14('0x47')](db[_0x5a14('0xd0')][_0x5a14('0x45')]);_0x5ab1da[_0x5a14('0x49')]=_[_0x5a14('0x47')](_0x1cf652['query']);_0x5ab1da[_0x5a14('0x4a')]=_[_0x5a14('0x4b')](_0x5ab1da[_0x5a14('0x46')],_0x5ab1da['query']);_0x508ad2['attributes']=_['intersection'](_0x5ab1da[_0x5a14('0x46')],qs[_0x5a14('0x4d')](_0x1cf652[_0x5a14('0x49')][_0x5a14('0x4d')]));_0x508ad2[_0x5a14('0x4c')]=_0x508ad2[_0x5a14('0x4c')]['length']?_0x508ad2['attributes']:_0x5ab1da[_0x5a14('0x46')];_0x508ad2[_0x5a14('0x51')]=qs['sort'](_0x1cf652[_0x5a14('0x49')]['sort']);_0x508ad2[_0x5a14('0x54')]=qs[_0x5a14('0x4a')](_[_0x5a14('0x53')](_0x1cf652[_0x5a14('0x49')],_0x5ab1da[_0x5a14('0x4a')]));if(_0x1cf652[_0x5a14('0x49')]['filter']){_0x508ad2[_0x5a14('0x54')]=_['merge'](_0x508ad2[_0x5a14('0x54')],{'$or':_[_0x5a14('0x3b')](_0x508ad2[_0x5a14('0x4c')],function(_0xcd8ed7){var _0x5eb7b8={};_0x5eb7b8[_0xcd8ed7]={'$like':'%'+_0x1cf652['query'][_0x5a14('0x39')]+'%'};return _0x5eb7b8;})});}_0x508ad2=_['merge']({},_0x508ad2,_0x1cf652['options']);return _0xf532a6[_0x5a14('0xcf')](_0x508ad2);}})['then'](function(_0x5d870e){if(_0x5d870e){_0x534eb9=_0x5d870e[_0x5a14('0x4e')];if(!_0x1cf652[_0x5a14('0x49')][_0x5a14('0x4f')]('nolimit')){_0x508ad2[_0x5a14('0x32')]=qs['limit'](_0x1cf652[_0x5a14('0x49')]['limit']);_0x508ad2[_0x5a14('0x31')]=qs[_0x5a14('0x31')](_0x1cf652[_0x5a14('0x49')][_0x5a14('0x31')]);}return _0xf532a6[_0x5a14('0xcf')](_0x508ad2);}})['then'](function(_0x588f04){if(_0x588f04){return _0x588f04?{'count':_0x534eb9,'rows':_0x588f04}:null;}})['then'](respondWithResult(_0x5f0ede,null))[_0x5a14('0x2c')](handleError(_0x5f0ede,null));};exports['getOpenchannelInteractions']=function(_0x240b8a,_0x17d3e4,_0x1689ca){var _0x2ba562={};var _0x596ec5={};var _0x5239f7;var _0x118427;return db[_0x5a14('0x44')][_0x5a14('0x9d')]({'where':{'id':_0x240b8a[_0x5a14('0x62')]['id']}})[_0x5a14('0x22')](handleEntityNotFound(_0x17d3e4,null))[_0x5a14('0x22')](function(_0x111a44){if(_0x111a44){_0x5239f7=_0x111a44;_0x596ec5['model']=_[_0x5a14('0x47')](db['OpenchannelInteraction'][_0x5a14('0x45')]);_0x596ec5[_0x5a14('0x49')]=_['keys'](_0x240b8a[_0x5a14('0x49')]);_0x596ec5['filters']=_[_0x5a14('0x4b')](_0x596ec5['model'],_0x596ec5[_0x5a14('0x49')]);_0x2ba562[_0x5a14('0x4c')]=_['intersection'](_0x596ec5[_0x5a14('0x46')],qs[_0x5a14('0x4d')](_0x240b8a[_0x5a14('0x49')][_0x5a14('0x4d')]));_0x2ba562['attributes']=_0x2ba562[_0x5a14('0x4c')][_0x5a14('0x4e')]?_0x2ba562['attributes']:_0x596ec5[_0x5a14('0x46')];_0x2ba562[_0x5a14('0x51')]=qs[_0x5a14('0x52')](_0x240b8a[_0x5a14('0x49')][_0x5a14('0x52')]);_0x2ba562['where']=qs['filters'](_[_0x5a14('0x53')](_0x240b8a[_0x5a14('0x49')],_0x596ec5['filters']));if(_0x240b8a[_0x5a14('0x49')]['filter']){_0x2ba562[_0x5a14('0x54')]=_['merge'](_0x2ba562[_0x5a14('0x54')],{'$or':_[_0x5a14('0x3b')](_0x2ba562[_0x5a14('0x4c')],function(_0x36d160){var _0x3f2d1e={};_0x3f2d1e[_0x36d160]={'$like':'%'+_0x240b8a[_0x5a14('0x49')][_0x5a14('0x39')]+'%'};return _0x3f2d1e;})});}_0x2ba562=_[_0x5a14('0x64')]({},_0x2ba562,_0x240b8a[_0x5a14('0x5c')]);return _0x5239f7[_0x5a14('0xd1')](_0x2ba562);}})[_0x5a14('0x22')](function(_0x8efadb){if(_0x8efadb){_0x118427=_0x8efadb['length'];if(!_0x240b8a[_0x5a14('0x49')]['hasOwnProperty'](_0x5a14('0x50'))){_0x2ba562[_0x5a14('0x32')]=qs['limit'](_0x240b8a['query']['limit']);_0x2ba562[_0x5a14('0x31')]=qs[_0x5a14('0x31')](_0x240b8a['query'][_0x5a14('0x31')]);}return _0x5239f7[_0x5a14('0xd1')](_0x2ba562);}})[_0x5a14('0x22')](function(_0x56ff9b){if(_0x56ff9b){return _0x56ff9b?{'count':_0x118427,'rows':_0x56ff9b}:null;}})[_0x5a14('0x22')](respondWithResult(_0x17d3e4,null))['catch'](handleError(_0x17d3e4,null));};exports['getMailInteractions']=function(_0x21fa04,_0x4a1f3f,_0x5a38cf){var _0x362847={'raw':!![],'where':{}};var _0x4a95b2={};var _0x388724={'count':0x0,'rows':[]};return db[_0x5a14('0x44')][_0x5a14('0x9d')]({'where':{'id':_0x21fa04[_0x5a14('0x62')]['id']}})['then'](handleEntityNotFound(_0x4a1f3f,null))['then'](function(_0x4c4706){if(_0x4c4706){_0x4a95b2[_0x5a14('0x46')]=_['keys'](db['MailInteraction'][_0x5a14('0x45')]);_0x4a95b2[_0x5a14('0x49')]=_[_0x5a14('0x47')](_0x21fa04[_0x5a14('0x49')]);_0x4a95b2[_0x5a14('0x4a')]=_[_0x5a14('0x4b')](_0x4a95b2[_0x5a14('0x46')],_0x4a95b2['query']);_0x362847[_0x5a14('0x4c')]=_['intersection'](_0x4a95b2['model'],qs['fields'](_0x21fa04[_0x5a14('0x49')][_0x5a14('0x4d')]));_0x362847[_0x5a14('0x4c')]=_0x362847[_0x5a14('0x4c')][_0x5a14('0x4e')]?_0x362847['attributes']:_0x4a95b2[_0x5a14('0x46')];if(!_0x21fa04[_0x5a14('0x49')][_0x5a14('0x4f')](_0x5a14('0x50'))){_0x362847['limit']=qs['limit'](_0x21fa04['query'][_0x5a14('0x32')]);_0x362847[_0x5a14('0x31')]=qs[_0x5a14('0x31')](_0x21fa04[_0x5a14('0x49')][_0x5a14('0x31')]);}_0x362847[_0x5a14('0x51')]=qs[_0x5a14('0x52')](_0x21fa04[_0x5a14('0x49')][_0x5a14('0x52')]);_0x362847['where']=qs[_0x5a14('0x4a')](_[_0x5a14('0x53')](_0x21fa04[_0x5a14('0x49')],_0x4a95b2[_0x5a14('0x4a')]));_0x362847['where'][_0x5a14('0xcb')]=_0x4c4706['id'];if(_0x21fa04[_0x5a14('0x49')]['filter']){_0x362847[_0x5a14('0x54')]=_['merge'](_0x362847[_0x5a14('0x54')],{'$or':_['map'](_0x362847[_0x5a14('0x4c')],function(_0xc2a9fb){var _0x26e607={};_0x26e607[_0xc2a9fb]={'$like':'%'+_0x21fa04[_0x5a14('0x49')][_0x5a14('0x39')]+'%'};return _0x26e607;})});}_0x362847=_[_0x5a14('0x64')]({},_0x362847,_0x21fa04[_0x5a14('0x5c')]);return db[_0x5a14('0xd2')][_0x5a14('0x5d')]({'where':_0x362847[_0x5a14('0x54')]})[_0x5a14('0x22')](function(_0x1f358a){_0x388724[_0x5a14('0x5d')]=_0x1f358a;if(_0x21fa04[_0x5a14('0x49')][_0x5a14('0x5e')]){_0x362847[_0x5a14('0x5f')]=[{'all':!![]}];}return db[_0x5a14('0xd2')]['findAll'](_0x362847);})['then'](function(_0x498f65){_0x388724[_0x5a14('0xcc')]=_0x498f65;return _0x388724;});}})[_0x5a14('0x22')](respondWithFilteredResult(_0x4a1f3f,_0x362847))[_0x5a14('0x2c')](handleError(_0x4a1f3f,null));};exports[_0x5a14('0xd3')]=function(_0xecfad3,_0x2cdbf2,_0x100325){var _0x5d922a={};var _0x4d90a9={};var _0x3a604c;var _0x39d207;return db[_0x5a14('0x44')][_0x5a14('0x9d')]({'where':{'id':_0xecfad3[_0x5a14('0x62')]['id']}})['then'](handleEntityNotFound(_0x2cdbf2,null))['then'](function(_0x452a14){if(_0x452a14){_0x3a604c=_0x452a14;_0x4d90a9[_0x5a14('0x46')]=_['keys'](db[_0x5a14('0xd4')][_0x5a14('0x45')]);_0x4d90a9[_0x5a14('0x49')]=_[_0x5a14('0x47')](_0xecfad3['query']);_0x4d90a9[_0x5a14('0x4a')]=_[_0x5a14('0x4b')](_0x4d90a9['model'],_0x4d90a9[_0x5a14('0x49')]);_0x5d922a[_0x5a14('0x4c')]=_[_0x5a14('0x4b')](_0x4d90a9[_0x5a14('0x46')],qs[_0x5a14('0x4d')](_0xecfad3[_0x5a14('0x49')]['fields']));_0x5d922a['attributes']=_0x5d922a[_0x5a14('0x4c')][_0x5a14('0x4e')]?_0x5d922a[_0x5a14('0x4c')]:_0x4d90a9[_0x5a14('0x46')];_0x5d922a[_0x5a14('0x51')]=qs['sort'](_0xecfad3[_0x5a14('0x49')]['sort']);_0x5d922a[_0x5a14('0x54')]=qs[_0x5a14('0x4a')](_['pick'](_0xecfad3[_0x5a14('0x49')],_0x4d90a9[_0x5a14('0x4a')]));if(_0xecfad3[_0x5a14('0x49')][_0x5a14('0x39')]){_0x5d922a[_0x5a14('0x54')]=_[_0x5a14('0x64')](_0x5d922a[_0x5a14('0x54')],{'$or':_[_0x5a14('0x3b')](_0x5d922a['attributes'],function(_0x134034){var _0x42899c={};_0x42899c[_0x134034]={'$like':'%'+_0xecfad3[_0x5a14('0x49')][_0x5a14('0x39')]+'%'};return _0x42899c;})});}_0x5d922a=_[_0x5a14('0x64')]({},_0x5d922a,_0xecfad3['options']);return _0x3a604c[_0x5a14('0xd3')](_0x5d922a);}})[_0x5a14('0x22')](function(_0x147ce9){if(_0x147ce9){_0x39d207=_0x147ce9[_0x5a14('0x4e')];if(!_0xecfad3['query'][_0x5a14('0x4f')](_0x5a14('0x50'))){_0x5d922a['limit']=qs[_0x5a14('0x32')](_0xecfad3[_0x5a14('0x49')][_0x5a14('0x32')]);_0x5d922a[_0x5a14('0x31')]=qs['offset'](_0xecfad3['query']['offset']);}return _0x3a604c[_0x5a14('0xd3')](_0x5d922a);}})[_0x5a14('0x22')](function(_0x2ee230){if(_0x2ee230){return _0x2ee230?{'count':_0x39d207,'rows':_0x2ee230}:null;}})[_0x5a14('0x22')](respondWithResult(_0x2cdbf2,null))[_0x5a14('0x2c')](handleError(_0x2cdbf2,null));};exports['getFaxInteractions']=function(_0x1cf818,_0x4de039,_0x554710){var _0x552b06={};var _0x45da24={};var _0xecfb29;var _0x434c49;return db[_0x5a14('0x44')][_0x5a14('0x9d')]({'where':{'id':_0x1cf818['params']['id']}})['then'](handleEntityNotFound(_0x4de039,null))['then'](function(_0xf82b6f){if(_0xf82b6f){_0xecfb29=_0xf82b6f;_0x45da24[_0x5a14('0x46')]=_[_0x5a14('0x47')](db[_0x5a14('0xd5')][_0x5a14('0x45')]);_0x45da24[_0x5a14('0x49')]=_[_0x5a14('0x47')](_0x1cf818[_0x5a14('0x49')]);_0x45da24[_0x5a14('0x4a')]=_[_0x5a14('0x4b')](_0x45da24[_0x5a14('0x46')],_0x45da24[_0x5a14('0x49')]);_0x552b06[_0x5a14('0x4c')]=_['intersection'](_0x45da24[_0x5a14('0x46')],qs[_0x5a14('0x4d')](_0x1cf818[_0x5a14('0x49')][_0x5a14('0x4d')]));_0x552b06[_0x5a14('0x4c')]=_0x552b06[_0x5a14('0x4c')][_0x5a14('0x4e')]?_0x552b06[_0x5a14('0x4c')]:_0x45da24[_0x5a14('0x46')];_0x552b06[_0x5a14('0x51')]=qs['sort'](_0x1cf818[_0x5a14('0x49')][_0x5a14('0x52')]);_0x552b06[_0x5a14('0x54')]=qs[_0x5a14('0x4a')](_[_0x5a14('0x53')](_0x1cf818[_0x5a14('0x49')],_0x45da24[_0x5a14('0x4a')]));if(_0x1cf818[_0x5a14('0x49')][_0x5a14('0x39')]){_0x552b06['where']=_[_0x5a14('0x64')](_0x552b06[_0x5a14('0x54')],{'$or':_['map'](_0x552b06['attributes'],function(_0x1473ce){var _0x4dc5fd={};_0x4dc5fd[_0x1473ce]={'$like':'%'+_0x1cf818[_0x5a14('0x49')][_0x5a14('0x39')]+'%'};return _0x4dc5fd;})});}_0x552b06=_[_0x5a14('0x64')]({},_0x552b06,_0x1cf818[_0x5a14('0x5c')]);return _0xecfb29['getFaxInteractions'](_0x552b06);}})[_0x5a14('0x22')](function(_0x347b28){if(_0x347b28){_0x434c49=_0x347b28['length'];if(!_0x1cf818[_0x5a14('0x49')]['hasOwnProperty'](_0x5a14('0x50'))){_0x552b06[_0x5a14('0x32')]=qs[_0x5a14('0x32')](_0x1cf818['query'][_0x5a14('0x32')]);_0x552b06[_0x5a14('0x31')]=qs[_0x5a14('0x31')](_0x1cf818[_0x5a14('0x49')]['offset']);}return _0xecfb29[_0x5a14('0xd6')](_0x552b06);}})[_0x5a14('0x22')](function(_0x300ffb){if(_0x300ffb){return _0x300ffb?{'count':_0x434c49,'rows':_0x300ffb}:null;}})['then'](respondWithResult(_0x4de039,null))[_0x5a14('0x2c')](handleError(_0x4de039,null));};exports[_0x5a14('0xd7')]=function(_0x43e72c,_0x4ae0f7,_0x4d2bd9){var _0x55fc49;var _0x1834c5;var _0x5520cd;var _0x226d5d=!_[_0x5a14('0x93')](_0x43e72c[_0x5a14('0x62')]['id'])?_0x43e72c[_0x5a14('0x62')]['id']:!_[_0x5a14('0x93')](_0x43e72c[_0x5a14('0x36')]['id'])?_0x43e72c[_0x5a14('0x36')]['id']:null;return db['User'][_0x5a14('0x3e')]({'where':{'id':_0x226d5d,'role':_0x5a14('0x6b')},'attributes':['id',_0x5a14('0x3f'),_0x5a14('0xd8'),_0x5a14('0xd9'),'role',_0x5a14('0x74'),_0x5a14('0xda')]})['then'](handleEntityNotFound(_0x4ae0f7,null))['then'](function(_0x3e7c7c){if(_0x3e7c7c){_0x55fc49=_0x3e7c7c;if(_0x43e72c[_0x5a14('0x66')]['interface']){_0x5520cd=util[_0x5a14('0x72')](_0x5a14('0xdb'),_0x55fc49[_0x43e72c[_0x5a14('0x66')][_0x5a14('0xad')]]);}else if(_0x43e72c['body'][_0x5a14('0xdc')]){_0x5520cd=util[_0x5a14('0x72')](_0x5a14('0xae'),_0x43e72c[_0x5a14('0x66')][_0x5a14('0xdc')]);}else{_0x5520cd=util[_0x5a14('0x72')](_0x5a14('0xae'),_0x55fc49['name']);}socket['to'](util[_0x5a14('0x72')]('user:%s',_0x55fc49[_0x5a14('0x3f')]))['emit'](_0x5a14('0xdd'),{'ip':_0x43e72c[_0x5a14('0xde')][_0x5a14('0xdf')]||_0x43e72c[_0x5a14('0xe0')][_0x5a14('0xe1')]||_0x43e72c[_0x5a14('0xe2')]['remoteAddress']||_0x43e72c['connection'][_0x5a14('0xe2')]['remoteAddress']});return db[_0x5a14('0xaf')][_0x5a14('0x34')]({'where':{'membername':_0x55fc49[_0x5a14('0x3f')]},'individualHooks':!![]});}})[_0x5a14('0x22')](function(_0x50b3ad){if(_0x55fc49){return _0x55fc49['getVoiceQueues']({'raw':!![]});}})[_0x5a14('0x22')](function(_0x281bbf){var _0x4accb5=[];if(_0x281bbf){_0x1834c5=_0x281bbf;if(_0x1834c5[_0x5a14('0x4e')]){for(var _0x4c69ff=0x0;_0x4c69ff<_0x1834c5[_0x5a14('0x4e')];_0x4c69ff++){_0x4accb5[_0x5a14('0xac')]({'membername':_0x55fc49[_0x5a14('0x3f')],'UserId':_0x55fc49['id'],'queue_name':_0x1834c5[_0x4c69ff]['name'],'VoiceQueueId':_0x1834c5[_0x4c69ff]['id'],'interface':_0x5520cd,'paused':_0x55fc49[_0x5a14('0xda')]||![],'penalty':_0x1834c5[_0x4c69ff][_0x5a14('0xe3')]||0x0});}return BPromise[_0x5a14('0xe4')](_0x4accb5,function(_0x5c00a1){return db[_0x5a14('0xaf')][_0x5a14('0xb0')](_0x5c00a1);});}}})[_0x5a14('0x22')](function(){return db[_0x5a14('0xe5')]['findAll']({'where':{'membername':_0x55fc49['name'],'exitAt':null}});})['then'](function(_0x1fa8ec){var _0x34062a=[];_0x1fa8ec[_0x5a14('0xe6')](function(_0x177e7c){_0x34062a[_0x5a14('0xac')](_0x177e7c[_0x5a14('0x33')]({'exitAt':moment()[_0x5a14('0x72')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x5a14('0xe7')](_0x34062a);})[_0x5a14('0x22')](function(){var _0x20f650=[];var _0x45862e=[];var _0x1b7e70=utils[_0x5a14('0xe8')]();var _0xfa896b={'membername':_0x55fc49[_0x5a14('0x3f')],'interface':_0x5520cd,'enterAt':moment()[_0x5a14('0x72')](_0x5a14('0xe9')),'role':_0x55fc49[_0x5a14('0x3d')],'internal':_0x55fc49[_0x5a14('0x74')]};_0x1b7e70[_0x5a14('0xe6')](function(_0x4e4c2d){_0x20f650[_0x5a14('0xac')](_['merge']({'channel':_0x4e4c2d,'type':_0x5a14('0xea'),'data1':_0x43e72c[_0x5a14('0x66')][_0x5a14('0xeb')],'data2':_0x5520cd},_0xfa896b));if(_0x55fc49[_0x5a14('0xda')]){_0x45862e[_0x5a14('0xac')](_['merge']({'channel':_0x4e4c2d,'type':_0x5a14('0xec'),'data1':_0x5a14('0xed')},_0xfa896b));}});return db['MemberReport']['bulkCreate'](_0x20f650[_0x5a14('0xee')](_0x45862e),{'individualHooks':!![]});})[_0x5a14('0x22')](function(){return _0x55fc49[_0x5a14('0x33')]({'online':!![],'lastLoginAt':moment()[_0x5a14('0x72')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x55fc49['loginInPause']||![],'mailPause':_0x55fc49['loginInPause']||![],'chatPause':_0x55fc49[_0x5a14('0xda')]||![],'faxPause':_0x55fc49[_0x5a14('0xda')]||![],'smsPause':_0x55fc49[_0x5a14('0xda')]||![],'openchannelPause':_0x55fc49[_0x5a14('0xda')]||![],'pauseType':_0x55fc49[_0x5a14('0xda')]?_0x5a14('0xed'):null,'interface':_0x5520cd,'lastPauseAt':moment()[_0x5a14('0x72')](_0x5a14('0xe9'))});})[_0x5a14('0x22')](function(_0x54d536){if(_0x43e72c[_0x5a14('0xef')]){return _0x4d2bd9();}else{return BPromise[_0x5a14('0xf0')](_0x54d536)[_0x5a14('0x22')](respondWithResult(_0x4ae0f7,null));}})['catch'](handleError(_0x4ae0f7,null));};exports[_0x5a14('0xf1')]=function(_0x713abc,_0x192d89,_0x431be4){var _0x3a6973;return db[_0x5a14('0x44')][_0x5a14('0x3e')]({'where':{'id':_0x713abc[_0x5a14('0x62')]['id'],'role':'agent'},'attributes':['id',_0x5a14('0x3f'),'role']})[_0x5a14('0x22')](handleEntityNotFound(_0x192d89,null))[_0x5a14('0x22')](function(_0x396f23){if(_0x396f23){_0x3a6973=_0x396f23;return db[_0x5a14('0xaf')][_0x5a14('0x34')]({'where':{'membername':_0x3a6973['name']},'individualHooks':!![]});}})[_0x5a14('0x22')](function(){return db[_0x5a14('0xe5')][_0x5a14('0x60')]({'where':{'membername':_0x3a6973[_0x5a14('0x3f')],'exitAt':null}});})[_0x5a14('0x22')](function(_0x4e6d30){var _0xd375=[];_0x4e6d30[_0x5a14('0xe6')](function(_0x1c22cc){_0xd375['push'](_0x1c22cc[_0x5a14('0x33')]({'exitAt':moment()[_0x5a14('0x72')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0xd375);})[_0x5a14('0x22')](function(){return _0x3a6973[_0x5a14('0x33')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})['then'](respondWithResult(_0x192d89,null))['catch'](handleError(_0x192d89,null));};exports['pause']=function(_0x5b3915,_0x35db2a,_0x2fa986){var _0x326d9e;return db['UserVoiceQueueRt'][_0x5a14('0x33')]({'paused':0x1},{'where':{'UserId':_0x5b3915[_0x5a14('0x62')]['id']},'individualHooks':!![]})[_0x5a14('0x22')](function(){return db[_0x5a14('0x44')]['find']({'where':{'id':_0x5b3915[_0x5a14('0x62')]['id'],'role':_0x5a14('0x6b')},'attributes':['id',_0x5a14('0x3f'),'role',_0x5a14('0x74'),'interface']});})[_0x5a14('0x22')](handleEntityNotFound(_0x35db2a,null))[_0x5a14('0x22')](function(_0x39e518){if(_0x39e518){_0x326d9e=_0x39e518;return respondWithRpcPromise('QueuePause',_0x5a14('0xf2'),{'id':_0x326d9e['id'],'name':_0x326d9e[_0x5a14('0x3f')],'pause':!![]});}})[_0x5a14('0x22')](function(){if(_0x326d9e){return db['MemberReport'][_0x5a14('0x60')]({'where':{'membername':_0x326d9e['name'],'type':_0x5a14('0xec'),'exitAt':null}});}})[_0x5a14('0x22')](function(_0x449821){if(_0x449821[_0x5a14('0x4e')]){var _0x1d9db8=moment()['format'](_0x5a14('0xe9'));for(var _0x12fb61=0x0,_0x5aafa8=_0x449821[_0x5a14('0x4e')];_0x12fb61<_0x5aafa8;_0x12fb61++){_0x449821[_0x12fb61][_0x5a14('0xf3')]({'exitAt':_0x1d9db8});}}})['then'](function(){var _0x80be12=[];var _0x1111c9=utils[_0x5a14('0xe8')]();_0x1111c9[_0x5a14('0xe6')](function(_0x3e33e3){_0x80be12[_0x5a14('0xac')]({'channel':_0x3e33e3,'membername':_0x326d9e[_0x5a14('0x3f')],'interface':_[_0x5a14('0x93')](_0x326d9e['interface'])?util[_0x5a14('0x72')](_0x5a14('0xae'),_0x326d9e['name']):_0x326d9e[_0x5a14('0xad')],'type':'PAUSE','enterAt':moment()[_0x5a14('0x72')](_0x5a14('0xe9')),'data1':_0x5b3915[_0x5a14('0x66')]['type']||_0x5a14('0xf4'),'role':_0x326d9e['role'],'internal':_0x326d9e[_0x5a14('0x74')]});});return db[_0x5a14('0xe5')][_0x5a14('0x65')](_0x80be12,{'individualHooks':!![]});})[_0x5a14('0x22')](function(){return _0x326d9e[_0x5a14('0x33')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x5b3915[_0x5a14('0x66')][_0x5a14('0x55')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x5a14('0x72')](_0x5a14('0xe9'))});})[_0x5a14('0x22')](respondWithResult(_0x35db2a,null))[_0x5a14('0x2c')](handleError(_0x35db2a,null));};exports[_0x5a14('0xf5')]=function(_0xfaeba7,_0x5be2bf,_0x34da1e){var _0x4e394f;return db[_0x5a14('0x44')][_0x5a14('0x3e')]({'where':{'id':_0xfaeba7[_0x5a14('0x62')]['id']},'attributes':['id',_0x5a14('0x3f'),_0x5a14('0x3d'),_0x5a14('0xa0'),'mailPause',_0x5a14('0xf6'),_0x5a14('0xf7'),_0x5a14('0xf8'),_0x5a14('0xf9'),_0x5a14('0xfa'),_0x5a14('0xfb')]})['then'](handleEntityNotFound(_0x5be2bf,null))[_0x5a14('0x22')](function(_0x5e728c){if(_0x5e728c){_0x4e394f=_0x5e728c;if(_0xfaeba7[_0x5a14('0x66')]['channel']&&!utils[_0x5a14('0xb2')](_0xfaeba7[_0x5a14('0x66')][_0x5a14('0x9e')])){throw new db[(_0x5a14('0x97'))][(_0x5a14('0x98'))](_0x5a14('0xa1'));}switch(_0xfaeba7[_0x5a14('0x66')]['channel']){case _0x5a14('0xaa'):return respondWithRpcPromise(_0x5a14('0xfc'),_0x5a14('0xf5'),{'id':_0x4e394f['id'],'name':_0x4e394f[_0x5a14('0x3f')],'pause':![]})['then'](function(){return db[_0x5a14('0xaf')]['update']({'paused':0x0},{'where':{'UserId':_0x4e394f['id']},'individualHooks':!![]});})[_0x5a14('0x22')](function(){return db['MemberReport'][_0x5a14('0x3e')]({'where':{'channel':_0xfaeba7[_0x5a14('0x66')][_0x5a14('0x9e')],'membername':_0x4e394f[_0x5a14('0x3f')],'type':'PAUSE','exitAt':null}});})[_0x5a14('0x22')](function(_0xb32eac){if(_0xb32eac){return _0xb32eac[_0x5a14('0x33')]({'exitAt':moment()['format'](_0x5a14('0xe9')),'data2':_0x5a14('0xfd')},{'individualHooks':!![]});}return null;})[_0x5a14('0x22')](function(){return _0x4e394f['update']({'voicePause':![]});});case'mail':case _0x5a14('0xfe'):case _0x5a14('0xff'):case'sms':case'openchannel':return db[_0x5a14('0xe5')][_0x5a14('0x3e')]({'where':{'channel':_0xfaeba7[_0x5a14('0x66')]['channel'],'membername':_0x4e394f['name'],'type':_0x5a14('0xec'),'exitAt':null}})[_0x5a14('0x22')](function(_0x5377fc){if(_0x5377fc){return _0x5377fc[_0x5a14('0x33')]({'exitAt':moment()[_0x5a14('0x72')](_0x5a14('0xe9')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x5a14('0x22')](function(){var _0x5cfbf8={};_[_0x5a14('0x100')](_0x5cfbf8,util['format']('%s%s',_0xfaeba7[_0x5a14('0x66')][_0x5a14('0x9e')],_0x5a14('0x101')),![]);return _0x4e394f['update'](_0x5cfbf8);});default:return respondWithRpcPromise(_0x5a14('0xfc'),_0x5a14('0xf5'),{'id':_0x4e394f['id'],'name':_0x4e394f[_0x5a14('0x3f')],'pause':![]})[_0x5a14('0x22')](function(){return db[_0x5a14('0xaf')][_0x5a14('0x33')]({'paused':0x0},{'where':{'UserId':_0x4e394f['id']}});})['then'](function(){return db[_0x5a14('0xe5')][_0x5a14('0x60')]({'where':{'membername':_0x4e394f[_0x5a14('0x3f')],'type':_0x5a14('0xec'),'exitAt':null}});})[_0x5a14('0x22')](function(_0x178807){var _0x39dbf1=[];_0x178807[_0x5a14('0xe6')](function(_0x3c421e){_0x39dbf1[_0x5a14('0xac')](_0x3c421e[_0x5a14('0x33')]({'exitAt':moment()[_0x5a14('0x72')](_0x5a14('0xe9')),'data2':_0x5a14('0xfd')}));});return BPromise[_0x5a14('0xe7')](_0x39dbf1);})[_0x5a14('0x22')](function(){return _0x4e394f[_0x5a14('0x33')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x5be2bf,null))[_0x5a14('0x2c')](handleError(_0x5be2bf,null));};exports[_0x5a14('0x102')]=function(_0x52bd6a,_0x4bd8b8,_0x322318){var _0x1297f9={};var _0xb9f3d9={};var _0xf5389a;var _0x5b8014;return db[_0x5a14('0x44')]['findOne']({'where':{'id':_0x52bd6a[_0x5a14('0x62')]['id']}})[_0x5a14('0x22')](handleEntityNotFound(_0x4bd8b8,null))[_0x5a14('0x22')](function(_0x5a76c5){if(_0x5a76c5){_0xf5389a=_0x5a76c5;_0xb9f3d9[_0x5a14('0x46')]=_['keys'](db['Team'][_0x5a14('0x45')]);_0xb9f3d9[_0x5a14('0x49')]=_[_0x5a14('0x47')](_0x52bd6a['query']);_0xb9f3d9['filters']=_['intersection'](_0xb9f3d9[_0x5a14('0x46')],_0xb9f3d9['query']);_0x1297f9[_0x5a14('0x4c')]=_[_0x5a14('0x4b')](_0xb9f3d9['model'],qs[_0x5a14('0x4d')](_0x52bd6a[_0x5a14('0x49')][_0x5a14('0x4d')]));_0x1297f9[_0x5a14('0x4c')]=_0x1297f9[_0x5a14('0x4c')][_0x5a14('0x4e')]?_0x1297f9['attributes']:_0xb9f3d9[_0x5a14('0x46')];_0x1297f9[_0x5a14('0x51')]=qs[_0x5a14('0x52')](_0x52bd6a[_0x5a14('0x49')][_0x5a14('0x52')]);_0x1297f9[_0x5a14('0x54')]=qs['filters'](_[_0x5a14('0x53')](_0x52bd6a[_0x5a14('0x49')],_0xb9f3d9['filters']));if(_0x52bd6a['query']['filter']){_0x1297f9['where']=_[_0x5a14('0x64')](_0x1297f9[_0x5a14('0x54')],{'$or':_[_0x5a14('0x3b')](_0x1297f9[_0x5a14('0x4c')],function(_0x46d2e9){var _0x270985={};_0x270985[_0x46d2e9]={'$like':'%'+_0x52bd6a[_0x5a14('0x49')][_0x5a14('0x39')]+'%'};return _0x270985;})});}_0x1297f9=_[_0x5a14('0x64')]({},_0x1297f9,_0x52bd6a[_0x5a14('0x5c')]);return _0xf5389a['getTeams'](_0x1297f9);}})['then'](function(_0x5e74db){if(_0x5e74db){_0x5b8014=_0x5e74db[_0x5a14('0x4e')];if(!_0x52bd6a[_0x5a14('0x49')]['hasOwnProperty'](_0x5a14('0x50'))){_0x1297f9[_0x5a14('0x32')]=qs[_0x5a14('0x32')](_0x52bd6a['query'][_0x5a14('0x32')]);_0x1297f9[_0x5a14('0x31')]=qs[_0x5a14('0x31')](_0x52bd6a[_0x5a14('0x49')][_0x5a14('0x31')]);}return _0xf5389a['getTeams'](_0x1297f9);}})['then'](function(_0x3830fc){if(_0x3830fc){return _0x3830fc?{'count':_0x5b8014,'rows':_0x3830fc}:null;}})[_0x5a14('0x22')](respondWithResult(_0x4bd8b8,null))['catch'](handleError(_0x4bd8b8,null));};exports[_0x5a14('0x103')]=function(_0xc29ec8,_0x5ed157,_0x1c9339){return db[_0x5a14('0x44')]['find']({'where':{'id':_0xc29ec8[_0x5a14('0x62')]['id']}})[_0x5a14('0x22')](handleEntityNotFound(_0x5ed157,null))[_0x5a14('0x22')](function(_0x25d624){if(_0x25d624){return _0x25d624['addTeams'](_0xc29ec8[_0x5a14('0x66')][_0x5a14('0x69')],_['omit'](_0xc29ec8['body'],[_0x5a14('0x69'),'id'])||{});}})[_0x5a14('0x22')](respondWithResult(_0x5ed157,null))[_0x5a14('0x2c')](handleError(_0x5ed157,null));};exports[_0x5a14('0x104')]=function(_0x2bae06,_0x563afa,_0x50a7a6){return db[_0x5a14('0x44')][_0x5a14('0x3e')]({'where':{'id':_0x2bae06[_0x5a14('0x62')]['id']}})[_0x5a14('0x22')](handleEntityNotFound(_0x563afa,null))[_0x5a14('0x22')](function(_0x3dc45e){if(_0x3dc45e){return _0x3dc45e[_0x5a14('0x104')](_0x2bae06[_0x5a14('0x49')][_0x5a14('0x69')]);}})[_0x5a14('0x22')](respondWithStatusCode(_0x563afa,null))[_0x5a14('0x2c')](handleError(_0x563afa,null));};exports[_0x5a14('0x105')]=function(_0x2142c0,_0x539a33,_0x5e53eb){var _0x28ddbf={};var _0x5d3b60={};var _0x57fa6f;var _0x49476e;return db[_0x5a14('0x44')][_0x5a14('0x9d')]({'where':{'id':_0x2142c0[_0x5a14('0x62')]['id']}})['then'](handleEntityNotFound(_0x539a33,null))['then'](function(_0x570e2d){if(_0x570e2d){_0x57fa6f=_0x570e2d;_0x5d3b60[_0x5a14('0x46')]=_[_0x5a14('0x47')](db[_0x5a14('0xc0')][_0x5a14('0x45')]);_0x5d3b60['query']=_['keys'](_0x2142c0[_0x5a14('0x49')]);_0x5d3b60['filters']=_['intersection'](_0x5d3b60[_0x5a14('0x46')],_0x5d3b60[_0x5a14('0x49')]);_0x28ddbf[_0x5a14('0x4c')]=_[_0x5a14('0x4b')](_0x5d3b60[_0x5a14('0x46')],qs[_0x5a14('0x4d')](_0x2142c0[_0x5a14('0x49')][_0x5a14('0x4d')]));_0x28ddbf[_0x5a14('0x4c')]=_0x28ddbf[_0x5a14('0x4c')]['length']?_0x28ddbf[_0x5a14('0x4c')]:_0x5d3b60['model'];_0x28ddbf['order']=qs[_0x5a14('0x52')](_0x2142c0[_0x5a14('0x49')][_0x5a14('0x52')]);_0x28ddbf[_0x5a14('0x54')]=qs[_0x5a14('0x4a')](_['pick'](_0x2142c0['query'],_0x5d3b60[_0x5a14('0x4a')]));if(_0x2142c0[_0x5a14('0x49')][_0x5a14('0x39')]){_0x28ddbf[_0x5a14('0x54')]=_['merge'](_0x28ddbf[_0x5a14('0x54')],{'$or':_[_0x5a14('0x3b')](_0x28ddbf[_0x5a14('0x4c')],function(_0x5e21f6){var _0x397757={};_0x397757[_0x5e21f6]={'$like':'%'+_0x2142c0[_0x5a14('0x49')][_0x5a14('0x39')]+'%'};return _0x397757;})});}_0x28ddbf=_[_0x5a14('0x64')]({},_0x28ddbf,_0x2142c0[_0x5a14('0x5c')]);return _0x57fa6f['getLists'](_0x28ddbf);}})[_0x5a14('0x22')](function(_0x15a4dd){if(_0x15a4dd){_0x49476e=_0x15a4dd[_0x5a14('0x4e')];if(!_0x2142c0[_0x5a14('0x49')]['hasOwnProperty'](_0x5a14('0x50'))){_0x28ddbf[_0x5a14('0x32')]=qs[_0x5a14('0x32')](_0x2142c0['query'][_0x5a14('0x32')]);_0x28ddbf['offset']=qs['offset'](_0x2142c0['query']['offset']);}return _0x57fa6f[_0x5a14('0x105')](_0x28ddbf);}})['then'](function(_0x1b905e){if(_0x1b905e){return _0x1b905e?{'count':_0x49476e,'rows':_0x1b905e}:null;}})[_0x5a14('0x22')](respondWithResult(_0x539a33,null))['catch'](handleError(_0x539a33,null));};exports[_0x5a14('0x106')]=function(_0x4d3abe,_0x39bc8d,_0x12f2ff){var _0x59dfbf={};var _0x300f6d={};var _0x1cea7c;var _0x21da71;return db[_0x5a14('0x44')][_0x5a14('0x9d')]({'where':{'id':_0x4d3abe['params']['id']}})[_0x5a14('0x22')](handleEntityNotFound(_0x39bc8d,null))['then'](function(_0x3c1dde){if(_0x3c1dde){_0x1cea7c=_0x3c1dde;_0x300f6d[_0x5a14('0x46')]=_['keys'](db[_0x5a14('0x44')][_0x5a14('0x45')]);_0x300f6d['query']=_[_0x5a14('0x47')](_0x4d3abe[_0x5a14('0x49')]);_0x300f6d[_0x5a14('0x4a')]=_[_0x5a14('0x4b')](_0x300f6d[_0x5a14('0x46')],_0x300f6d['query']);_0x59dfbf[_0x5a14('0x4c')]=_['intersection'](_0x300f6d[_0x5a14('0x46')],qs[_0x5a14('0x4d')](_0x4d3abe[_0x5a14('0x49')][_0x5a14('0x4d')]));_0x59dfbf[_0x5a14('0x4c')]=_0x59dfbf['attributes'][_0x5a14('0x4e')]?_0x59dfbf[_0x5a14('0x4c')]:_0x300f6d[_0x5a14('0x46')];_0x59dfbf['order']=qs[_0x5a14('0x52')](_0x4d3abe[_0x5a14('0x49')][_0x5a14('0x52')]);_0x59dfbf['where']=qs['filters'](_[_0x5a14('0x53')](_0x4d3abe['query'],_0x300f6d[_0x5a14('0x4a')]));if(_0x4d3abe['query']['filter']){_0x59dfbf[_0x5a14('0x54')]=_[_0x5a14('0x64')](_0x59dfbf[_0x5a14('0x54')],{'$or':_[_0x5a14('0x3b')](_0x59dfbf[_0x5a14('0x4c')],function(_0x19c573){var _0x49b491={};_0x49b491[_0x19c573]={'$like':'%'+_0x4d3abe[_0x5a14('0x49')]['filter']+'%'};return _0x49b491;})});}_0x59dfbf[_0x5a14('0x46')]=db['User'];_0x59dfbf['as']=_0x5a14('0x37');_0x59dfbf=_[_0x5a14('0x64')]({},_0x59dfbf,_0x4d3abe[_0x5a14('0x5c')]);return _0x1cea7c[_0x5a14('0x107')]({'include':[_0x59dfbf]});}})[_0x5a14('0x22')](function(_0x2660b3){if(_0x2660b3){var _0x19d806={},_0x5269a7=[],_0x545e5f=0x0;for(var _0x3954ab=0x0;_0x3954ab<_0x2660b3['length'];_0x3954ab+=0x1){for(var _0xa99fd3=0x0,_0x1497ad;_0xa99fd3<_0x2660b3[_0x3954ab][_0x5a14('0x37')][_0x5a14('0x4e')];_0xa99fd3+=0x1){_0x1497ad=_0x2660b3[_0x3954ab]['Agents'][_0xa99fd3][_0x5a14('0x35')]({'plain':!![]});_0x19d806[_0x1497ad['id']]=_0x1497ad;}}_0x19d806=_[_0x5a14('0x108')](_0x19d806);for(var _0x4bfd9b=qs['offset'](_0x4d3abe['query'][_0x5a14('0x31')]);_0x4bfd9b<_0x19d806[_0x5a14('0x4e')]&&_0x5269a7['length']=_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 _0xb10b=['destroy','length','LoginUser','loginInPause','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./user.socket','register','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','result','catch','GetUser','User','options','where','attributes','limit','include','map','model','ShowUser','find','raw','PauseUser','name','role','interface','UserVoiceQueueRt','MemberReport','findAll','format','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','PAUSE','YYYY-MM-DD\x20HH:mm:ss','body','DEFAULT\x20PAUSE','internal','uniqueid','bulkCreate','type','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','update','system','chat','fax','sms','openchannel','set','Pause','all','LogoutUser'];(function(_0x39b08c,_0x16b55e){var _0x2c7201=function(_0x52db73){while(--_0x52db73){_0x39b08c['push'](_0x39b08c['shift']());}};_0x2c7201(++_0x16b55e);}(_0xb10b,0x12a));var _0xbb10=function(_0x447ef1,_0x374cd2){_0x447ef1=_0x447ef1-0x0;var _0x3d72ec=_0xb10b[_0x447ef1];return _0x3d72ec;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});config[_0xbb10('0xb')]=_['defaults'](config[_0xbb10('0xb')],{'host':_0xbb10('0xc'),'port':0x18eb});var socket=require(_0xbb10('0xd'))(new Redis(config[_0xbb10('0xb')]));require(_0xbb10('0xe'))[_0xbb10('0xf')](socket);function respondWithRpcPromise(_0x229887,_0xa3adc8,_0x5ab04a){return new BPromise(function(_0x4e47f8,_0x20bd61){return client[_0xbb10('0x10')](_0x229887,_0x5ab04a)[_0xbb10('0x11')](function(_0x5e136d){logger[_0xbb10('0x12')]('User,\x20%s,\x20%s',_0xa3adc8,_0xbb10('0x13'));logger[_0xbb10('0x14')](_0xbb10('0x15'),_0xa3adc8,_0xbb10('0x13'),JSON[_0xbb10('0x16')](_0x5e136d));if(_0x5e136d[_0xbb10('0x17')]){if(_0x5e136d['error'][_0xbb10('0x18')]===0x1f4){logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);return _0x20bd61(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')]['message']);return _0x4e47f8(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}else{logger[_0xbb10('0x12')](_0xbb10('0x19'),_0xa3adc8,_0xbb10('0x13'));_0x4e47f8(_0x5e136d[_0xbb10('0x1b')][_0xbb10('0x1a')]);}})[_0xbb10('0x1c')](function(_0xbf2906){logger[_0xbb10('0x17')]('User,\x20%s,\x20%s',_0xa3adc8,_0xbf2906);_0x20bd61(_0xbf2906);});});}exports[_0xbb10('0x1d')]=function(_0x19f48d){var _0x388fab=this;return new Promise(function(_0x109908,_0xdf237d){return db[_0xbb10('0x1e')]['findAll']({'raw':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x19f48d['options']?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x20')]||null:null,'attributes':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x21')]||null:null,'limit':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x22')]||null:null,'include':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x19f48d['options']['include'],function(_0x4fb5e0){return{'model':db[_0x4fb5e0[_0xbb10('0x25')]],'as':_0x4fb5e0['as'],'attributes':_0x4fb5e0[_0xbb10('0x21')],'include':_0x4fb5e0[_0xbb10('0x23')]?_['map'](_0x4fb5e0[_0xbb10('0x23')],function(_0x24d586){return{'model':db[_0x24d586[_0xbb10('0x25')]],'as':_0x24d586['as'],'attributes':_0x24d586[_0xbb10('0x21')],'include':_0x24d586[_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x24d586[_0xbb10('0x23')],function(_0x4aabb9){return{'model':db[_0x4aabb9[_0xbb10('0x25')]],'as':_0x4aabb9['as'],'attributes':_0x4aabb9[_0xbb10('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0x11')](function(_0x2e0249){logger[_0xbb10('0x12')](_0xbb10('0x1d'),_0x19f48d);logger['debug'](_0xbb10('0x1d'),_0x19f48d,JSON['stringify'](_0x2e0249));_0x109908(_0x2e0249);})[_0xbb10('0x1c')](function(_0x56f2da){logger[_0xbb10('0x17')](_0xbb10('0x1d'),_0x56f2da[_0xbb10('0x1a')],_0x19f48d);_0xdf237d(_0x388fab['error'](0x1f4,_0x56f2da['message']));});});};exports[_0xbb10('0x26')]=function(_0x34f65e){var _0x4f590d=this;return new Promise(function(_0x359ad4,_0x37dde7){return db[_0xbb10('0x1e')][_0xbb10('0x27')]({'raw':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x28')]===undefined?!![]:![]:!![],'where':_0x34f65e['options']?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x20')]||null:null,'attributes':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x21')]||null:null,'include':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x34f65e['options'][_0xbb10('0x23')],function(_0x150107){return{'model':db[_0x150107[_0xbb10('0x25')]],'as':_0x150107['as'],'attributes':_0x150107[_0xbb10('0x21')],'include':_0x150107['include']?_[_0xbb10('0x24')](_0x150107['include'],function(_0x4e2754){return{'model':db[_0x4e2754[_0xbb10('0x25')]],'as':_0x4e2754['as'],'attributes':_0x4e2754[_0xbb10('0x21')],'include':_0x4e2754[_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x4e2754[_0xbb10('0x23')],function(_0x29d11a){return{'model':db[_0x29d11a['model']],'as':_0x29d11a['as'],'attributes':_0x29d11a[_0xbb10('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0x11')](function(_0x52de31){logger['info']('ShowUser',_0x34f65e);logger[_0xbb10('0x14')](_0xbb10('0x26'),_0x34f65e,JSON[_0xbb10('0x16')](_0x52de31));_0x359ad4(_0x52de31);})['catch'](function(_0x3c0cd7){logger[_0xbb10('0x17')](_0xbb10('0x26'),_0x3c0cd7['message'],_0x34f65e);_0x37dde7(_0x4f590d[_0xbb10('0x17')](0x1f4,_0x3c0cd7[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x29')]=function(_0x446f49){var _0x4f1cdd=this;return new Promise(function(_0xd238e9,_0x110eb5){var _0x5835fd;return db[_0xbb10('0x1e')][_0xbb10('0x27')]({'where':_0x446f49[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a'),_0xbb10('0x2b'),'internal',_0xbb10('0x2c')]})[_0xbb10('0x11')](function(_0x3e7b4c){if(_0x3e7b4c){_0x5835fd=_0x3e7b4c;return db[_0xbb10('0x2d')]['update']({'paused':0x1},{'where':{'UserId':_0x5835fd['id']},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0x5835fd){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x5835fd[_0xbb10('0x2a')],'type':'PAUSE','exitAt':null}});}})[_0xbb10('0x11')](function(_0x202c60){if(_0x5835fd){if(_0x202c60&&_0x202c60['length']){var _0x5d9a4f=moment()[_0xbb10('0x30')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x318984=0x0,_0x180933=_0x202c60['length'];_0x318984<_0x180933;_0x318984++){_0x202c60[_0x318984][_0xbb10('0x31')]({'exitAt':_0x5d9a4f});}}}})[_0xbb10('0x11')](function(){if(_0x5835fd){var _0x474e99=[];var _0x5cf4f8=utils[_0xbb10('0x32')]();_0x5cf4f8[_0xbb10('0x33')](function(_0x3b9fdf){_0x474e99[_0xbb10('0x34')]({'channel':_0x3b9fdf,'membername':_0x5835fd[_0xbb10('0x2a')],'interface':_[_0xbb10('0x35')](_0x5835fd[_0xbb10('0x2c')])?util[_0xbb10('0x30')](_0xbb10('0x36'),_0x5835fd[_0xbb10('0x2a')]):_0x5835fd[_0xbb10('0x2c')],'type':_0xbb10('0x37'),'enterAt':moment()['format'](_0xbb10('0x38')),'data1':_0x446f49[_0xbb10('0x39')]['type']||_0xbb10('0x3a'),'role':_0x5835fd[_0xbb10('0x2b')],'internal':_0x5835fd[_0xbb10('0x3b')],'uniqueid':_0x446f49[_0xbb10('0x39')][_0xbb10('0x3c')]||null});});return db[_0xbb10('0x2e')][_0xbb10('0x3d')](_0x474e99,{'individualHooks':!![]});}})['then'](function(){if(_0x5835fd){return _0x5835fd['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x446f49[_0xbb10('0x39')][_0xbb10('0x3e')]||_0xbb10('0x3a'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xbb10('0x11')](function(_0x34cf4e){_0xd238e9(_0x34cf4e);})[_0xbb10('0x1c')](function(_0xf820fe){_0x110eb5(_0x4f1cdd[_0xbb10('0x17')](0x1f4,_0xf820fe[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x3f')]=function(_0x460788){var _0x2626d8=this;return new Promise(function(_0x3d7e7e,_0x550111){var _0x5eafac;return db[_0xbb10('0x1e')][_0xbb10('0x40')]({'where':_0x460788[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a')]})[_0xbb10('0x11')](function(_0x358e7e){if(_0x358e7e){_0x5eafac=_0x358e7e;if(_0x460788[_0xbb10('0x39')][_0xbb10('0x41')]&&!utils[_0xbb10('0x42')](_0x460788[_0xbb10('0x39')][_0xbb10('0x41')])){throw new Error(_0xbb10('0x43'));}switch(_0x460788[_0xbb10('0x39')][_0xbb10('0x41')]){case'voice':return db[_0xbb10('0x2d')]['update']({'paused':0x0},{'where':{'UserId':_0x5eafac['id']}})[_0xbb10('0x11')](function(){return db[_0xbb10('0x2e')][_0xbb10('0x27')]({'where':{'channel':_0x460788[_0xbb10('0x39')][_0xbb10('0x41')],'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}});})[_0xbb10('0x11')](function(_0x180400){if(_0x180400){return _0x180400[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'data2':_0xbb10('0x45')},{'individualHooks':!![]});}return null;})[_0xbb10('0x11')](function(){return _0x5eafac[_0xbb10('0x44')]({'voicePause':![]});});case'mail':case _0xbb10('0x46'):case _0xbb10('0x47'):case _0xbb10('0x48'):case _0xbb10('0x49'):return db[_0xbb10('0x2e')][_0xbb10('0x27')]({'where':{'channel':_0x460788['body'][_0xbb10('0x41')],'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}})[_0xbb10('0x11')](function(_0x432728){return _0x432728[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'data2':_0xbb10('0x45')},{'individualHooks':!![]});})[_0xbb10('0x11')](function(){var _0x2eb05a={};_[_0xbb10('0x4a')](_0x2eb05a,util[_0xbb10('0x30')]('%s%s',_0x460788['body'][_0xbb10('0x41')],_0xbb10('0x4b')),![]);return _0x5eafac[_0xbb10('0x44')](_0x2eb05a);});default:return db[_0xbb10('0x2d')]['update']({'paused':0x0},{'where':{'UserId':_0x5eafac['id']}})['then'](function(){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}});})[_0xbb10('0x11')](function(_0x3e9753){var _0x45c0dc=[];_0x3e9753['forEach'](function(_0x117e84){_0x45c0dc[_0xbb10('0x34')](_0x117e84['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xbb10('0x45')}));});return BPromise[_0xbb10('0x4c')](_0x45c0dc);})[_0xbb10('0x11')](function(){return _0x5eafac['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](function(_0x5846d1){_0x3d7e7e(_0x5846d1);})[_0xbb10('0x1c')](function(_0x249b33){_0x550111(_0x2626d8[_0xbb10('0x17')](0x1f4,_0x249b33['message']));});});};exports[_0xbb10('0x4d')]=function(_0x13131c){var _0x5a6538=this;return new Promise(function(_0x4a560c,_0x27d7b9){var _0x308896;return db[_0xbb10('0x1e')][_0xbb10('0x40')]({'where':_0x13131c['options'][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a')]})[_0xbb10('0x11')](function(_0x5202d7){if(_0x5202d7){_0x308896=_0x5202d7;return db[_0xbb10('0x2d')][_0xbb10('0x4e')]({'where':{'membername':_0x308896[_0xbb10('0x2a')]},'individualHooks':!![]});}})['then'](function(){if(_0x308896){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x308896[_0xbb10('0x2a')],'exitAt':null}});}})[_0xbb10('0x11')](function(_0x5e4a6e){if(_0x308896){if(_0x5e4a6e&&_0x5e4a6e[_0xbb10('0x4f')]){var _0x258e55=[];_0x5e4a6e[_0xbb10('0x33')](function(_0x2d0f4b){_0x258e55['push'](_0x2d0f4b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x258e55);}}})[_0xbb10('0x11')](function(){if(_0x308896){return _0x308896[_0xbb10('0x44')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xbb10('0x11')](function(_0x4a30c5){_0x4a560c(_0x4a30c5);})['catch'](function(_0x5acd5e){_0x27d7b9(_0x5a6538[_0xbb10('0x17')](0x1f4,_0x5acd5e[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x50')]=function(_0x5c9afc){var _0x5cd089=this;return new Promise(function(_0x46f462,_0x1b11c0){var _0xd9e743;var _0x3a9677;var _0x260e06;var _0x1ad2ed;return db['User'][_0xbb10('0x40')]({'where':_0x5c9afc[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a'),_0xbb10('0x2b'),'mobile','phone','internal',_0xbb10('0x51'),_0xbb10('0x2c')]})[_0xbb10('0x11')](function(_0x21459e){if(_0x21459e){_0xd9e743=_0x21459e;_0x1ad2ed=_0x5c9afc[_0xbb10('0x39')][_0xbb10('0x2c')]?_0x5c9afc['body'][_0xbb10('0x2c')]:util['format']('SIP/%s',_0xd9e743['name']);return db[_0xbb10('0x1e')][_0xbb10('0x52')]({'where':{'role':_0xbb10('0x53'),'online':!![],'id':{'$ne':_0xd9e743['id']}}});}})[_0xbb10('0x11')](function(_0x5ce94f){if(_0x5ce94f){_0x260e06=_0x5ce94f;return require(_0xbb10('0x54'))['getLicense']();}})['then'](function(_0x165fe9){if(_0x165fe9&&_0x165fe9[_0xbb10('0x55')]&&_0x260e06>=_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 diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 9c7724b..43c7f3c 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 _0x653b=['user:','./user.events','save','remove','update','emit','removeListener','register'];(function(_0x2cba09,_0x23ee85){var _0x10d084=function(_0x11d2e4){while(--_0x11d2e4){_0x2cba09['push'](_0x2cba09['shift']());}};_0x10d084(++_0x23ee85);}(_0x653b,0x179));var _0xb653=function(_0xd39959,_0x302d09){_0xd39959=_0xd39959-0x0;var _0x1ff69c=_0x653b[_0xd39959];return _0x1ff69c;};'use strict';var UserEvents=require(_0xb653('0x0'));var events=[_0xb653('0x1'),_0xb653('0x2'),_0xb653('0x3')];function createListener(_0x39cc63,_0x1797ce){return function(_0x1afa7d){_0x1797ce[_0xb653('0x4')](_0x39cc63,_0x1afa7d);};}function removeListener(_0x1df469,_0x4e2bd3){return function(){UserEvents[_0xb653('0x5')](_0x1df469,_0x4e2bd3);};}exports[_0xb653('0x6')]=function(_0x6f2b82){for(var _0x36b6ed=0x0,_0x2d4a9b=events['length'];_0x36b6ed<_0x2d4a9b;_0x36b6ed++){var _0x26067e=events[_0x36b6ed];var _0x1cbd29=createListener(_0xb653('0x7')+_0x26067e,_0x6f2b82);UserEvents['on'](_0x26067e,_0x1cbd29);}}; \ No newline at end of file +var _0x817a=['./user.events','save','remove','update','emit','removeListener','register','length','user:'];(function(_0x1acefc,_0x5da0bf){var _0x543527=function(_0x27040d){while(--_0x27040d){_0x1acefc['push'](_0x1acefc['shift']());}};_0x543527(++_0x5da0bf);}(_0x817a,0x156));var _0xa817=function(_0x41b85a,_0x244458){_0x41b85a=_0x41b85a-0x0;var _0x84b490=_0x817a[_0x41b85a];return _0x84b490;};'use strict';var UserEvents=require(_0xa817('0x0'));var events=[_0xa817('0x1'),_0xa817('0x2'),_0xa817('0x3')];function createListener(_0x349816,_0x188fb3){return function(_0x1b6479){_0x188fb3[_0xa817('0x4')](_0x349816,_0x1b6479);};}function removeListener(_0xcf3291,_0x4a5194){return function(){UserEvents[_0xa817('0x5')](_0xcf3291,_0x4a5194);};}exports[_0xa817('0x6')]=function(_0x23fd20){for(var _0x145ad5=0x0,_0x371737=events[_0xa817('0x7')];_0x145ad5<_0x371737;_0x145ad5++){var _0x4294a7=events[_0x145ad5];var _0xf032e3=createListener(_0xa817('0x8')+_0x4294a7,_0x23fd20);UserEvents['on'](_0x4294a7,_0xf032e3);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index b151fbf..bfc67e5 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 _0x2975=['express','Router','../../components/auth/service','util','path','connect-timeout'];(function(_0x56867f,_0x3e0c5e){var _0x48ebb0=function(_0x4a44d8){while(--_0x4a44d8){_0x56867f['push'](_0x56867f['shift']());}};_0x48ebb0(++_0x3e0c5e);}(_0x2975,0x1c5));var _0x5297=function(_0x273125,_0x34f28b){_0x273125=_0x273125-0x0;var _0xe6a772=_0x2975[_0x273125];return _0xe6a772;};'use strict';var multer=require('multer');var util=require(_0x5297('0x0'));var path=require(_0x5297('0x1'));var timeout=require(_0x5297('0x2'));var express=require(_0x5297('0x3'));var router=express[_0x5297('0x4')]();var auth=require(_0x5297('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module['exports']=router; \ No newline at end of file +var _0x4fb4=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports'];(function(_0x5f25db,_0x4381a8){var _0x1544fa=function(_0x3637ed){while(--_0x3637ed){_0x5f25db['push'](_0x5f25db['shift']());}};_0x1544fa(++_0x4381a8);}(_0x4fb4,0x190));var _0x44fb=function(_0x998070,_0x466496){_0x998070=_0x998070-0x0;var _0x314d8c=_0x4fb4[_0x998070];return _0x314d8c;};'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'));module[_0x44fb('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 ceb39ba..4a1d729 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 _0x3e6f=['exports','sequelize'];(function(_0x4b4f05,_0x39a268){var _0x2dbf4f=function(_0x36f6fa){while(--_0x36f6fa){_0x4b4f05['push'](_0x4b4f05['shift']());}};_0x2dbf4f(++_0x39a268);}(_0x3e6f,0x17d));var _0xf3e6=function(_0x400521,_0x12020e){_0x400521=_0x400521-0x0;var _0xe69aef=_0x3e6f[_0x400521];return _0xe69aef;};'use strict';var Sequelize=require(_0xf3e6('0x0'));module[_0xf3e6('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3f1c=['exports'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0x3f1c,0xdc));var _0xc3f1=function(_0x1cd199,_0x22fefa){_0x1cd199=_0x1cd199-0x0;var _0x35ff91=_0x3f1c[_0x1cd199];return _0x35ff91;};'use strict';var Sequelize=require('sequelize');module[_0xc3f1('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'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 644eb09..5d2f0f5 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 _0x5ef4=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','user_has_chat_queues','lodash'];(function(_0x52fe18,_0x2e9bb7){var _0x30abbf=function(_0x312d59){while(--_0x312d59){_0x52fe18['push'](_0x52fe18['shift']());}};_0x30abbf(++_0x2e9bb7);}(_0x5ef4,0x18b));var _0x45ef=function(_0x3a4f1e,_0x557069){_0x3a4f1e=_0x3a4f1e-0x0;var _0x242b5b=_0x5ef4[_0x3a4f1e];return _0x242b5b;};'use strict';var _=require(_0x45ef('0x0'));var util=require(_0x45ef('0x1'));var logger=require(_0x45ef('0x2'))(_0x45ef('0x3'));var moment=require('moment');var BPromise=require(_0x45ef('0x4'));var rp=require(_0x45ef('0x5'));var fs=require('fs');var path=require(_0x45ef('0x6'));var rimraf=require(_0x45ef('0x7'));var config=require(_0x45ef('0x8'));var attributes=require(_0x45ef('0x9'));module[_0x45ef('0xa')]=function(_0x2b901a,_0x36cd56){return _0x2b901a['define']('UserChatQueue',attributes,{'tableName':_0x45ef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81a8=['user_has_chat_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x81a8,0x151));var _0x881a=function(_0x49cb71,_0x2f0149){_0x49cb71=_0x49cb71-0x0;var _0x3a50fd=_0x81a8[_0x49cb71];return _0x3a50fd;};'use strict';var _=require(_0x881a('0x0'));var util=require('util');var logger=require(_0x881a('0x1'))(_0x881a('0x2'));var moment=require(_0x881a('0x3'));var BPromise=require(_0x881a('0x4'));var rp=require(_0x881a('0x5'));var fs=require('fs');var path=require(_0x881a('0x6'));var rimraf=require(_0x881a('0x7'));var config=require(_0x881a('0x8'));var attributes=require(_0x881a('0x9'));module[_0x881a('0xa')]=function(_0x4601b4,_0x393e97){return _0x4601b4[_0x881a('0xb')](_0x881a('0xc'),attributes,{'tableName':_0x881a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 27517cc..d5b0c4e 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 _0xb6a9=['client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xb6a9,0x1c7));var _0x9b6a=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xb6a9[_0xa6cc5c];return _0x44803d;};'use strict';var _=require('lodash');var util=require(_0x9b6a('0x0'));var moment=require(_0x9b6a('0x1'));var BPromise=require('bluebird');var rs=require(_0x9b6a('0x2'));var fs=require('fs');var Redis=require(_0x9b6a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b6a('0x4'));var logger=require(_0x9b6a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9b6a('0x6'));var client=jayson[_0x9b6a('0x7')][_0x9b6a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3b7ef5,_0xccb975,_0x407285){return new BPromise(function(_0x58da2f,_0x45681a){return client[_0x9b6a('0x9')](_0x3b7ef5,_0x407285)[_0x9b6a('0xa')](function(_0x4cdbfd){logger[_0x9b6a('0xb')](_0x9b6a('0xc'),_0xccb975,'request\x20sent');logger[_0x9b6a('0xd')](_0x9b6a('0xe'),_0xccb975,_0x9b6a('0xf'),JSON[_0x9b6a('0x10')](_0x4cdbfd));if(_0x4cdbfd['error']){if(_0x4cdbfd[_0x9b6a('0x11')][_0x9b6a('0x12')]===0x1f4){logger['error'](_0x9b6a('0xc'),_0xccb975,_0x4cdbfd[_0x9b6a('0x11')][_0x9b6a('0x13')]);return _0x45681a(_0x4cdbfd[_0x9b6a('0x11')][_0x9b6a('0x13')]);}logger[_0x9b6a('0x11')](_0x9b6a('0xc'),_0xccb975,_0x4cdbfd[_0x9b6a('0x11')][_0x9b6a('0x13')]);return _0x58da2f(_0x4cdbfd['error'][_0x9b6a('0x13')]);}else{logger[_0x9b6a('0xb')](_0x9b6a('0xc'),_0xccb975,_0x9b6a('0xf'));_0x58da2f(_0x4cdbfd['result'][_0x9b6a('0x13')]);}})[_0x9b6a('0x14')](function(_0x546a31){logger[_0x9b6a('0x11')](_0x9b6a('0xc'),_0xccb975,_0x546a31);_0x45681a(_0x546a31);});});} \ No newline at end of file +var _0x17da=['stringify','code','error','message','result','catch','UserChatQueue,\x20%s,\x20%s','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x93428c,_0x4194cb){var _0x466d10=function(_0x17d803){while(--_0x17d803){_0x93428c['push'](_0x93428c['shift']());}};_0x466d10(++_0x4194cb);}(_0x17da,0x167));var _0xa17d=function(_0xfc6b9e,_0x5ad8c8){_0xfc6b9e=_0xfc6b9e-0x0;var _0x26b581=_0x17da[_0xfc6b9e];return _0x26b581;};'use strict';var _=require(_0xa17d('0x0'));var util=require('util');var moment=require(_0xa17d('0x1'));var BPromise=require(_0xa17d('0x2'));var rs=require(_0xa17d('0x3'));var fs=require('fs');var Redis=require(_0xa17d('0x4'));var db=require(_0xa17d('0x5'))['db'];var utils=require(_0xa17d('0x6'));var logger=require('../../config/logger')(_0xa17d('0x7'));var config=require('../../config/environment');var jayson=require(_0xa17d('0x8'));var client=jayson[_0xa17d('0x9')][_0xa17d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d0d8b,_0x237eef,_0x1762c8){return new BPromise(function(_0x26236f,_0x3af17c){return client[_0xa17d('0xb')](_0x4d0d8b,_0x1762c8)[_0xa17d('0xc')](function(_0x4b130f){logger[_0xa17d('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x237eef,_0xa17d('0xe'));logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x237eef,_0xa17d('0xe'),JSON[_0xa17d('0xf')](_0x4b130f));if(_0x4b130f['error']){if(_0x4b130f['error'][_0xa17d('0x10')]===0x1f4){logger[_0xa17d('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x237eef,_0x4b130f[_0xa17d('0x11')][_0xa17d('0x12')]);return _0x3af17c(_0x4b130f[_0xa17d('0x11')][_0xa17d('0x12')]);}logger[_0xa17d('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x237eef,_0x4b130f[_0xa17d('0x11')][_0xa17d('0x12')]);return _0x26236f(_0x4b130f[_0xa17d('0x11')][_0xa17d('0x12')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x237eef,'request\x20sent');_0x26236f(_0x4b130f[_0xa17d('0x13')][_0xa17d('0x12')]);}})[_0xa17d('0x14')](function(_0x5161aa){logger[_0xa17d('0x11')](_0xa17d('0x15'),_0x237eef,_0x5161aa);_0x3af17c(_0x5161aa);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 09cb42a..e51c33c 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 _0x627e=['../../components/interaction/service','../../config/environment','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x174c24,_0x97fde0){var _0x32cbc1=function(_0x4961b9){while(--_0x4961b9){_0x174c24['push'](_0x174c24['shift']());}};_0x32cbc1(++_0x97fde0);}(_0x627e,0x14a));var _0xe627=function(_0x8fe9f1,_0x21861e){_0x8fe9f1=_0x8fe9f1-0x0;var _0x48866c=_0x627e[_0x8fe9f1];return _0x48866c;};'use strict';var multer=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var path=require(_0xe627('0x2'));var timeout=require(_0xe627('0x3'));var express=require(_0xe627('0x4'));var router=express['Router']();var auth=require(_0xe627('0x5'));var interaction=require(_0xe627('0x6'));var config=require(_0xe627('0x7'));module['exports']=router; \ No newline at end of file +var _0x1574=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1574,0x148));var _0x4157=function(_0xc6e6d5,_0x5e7f66){_0xc6e6d5=_0xc6e6d5-0x0;var _0x16498b=_0x1574[_0xc6e6d5];return _0x16498b;};'use strict';var multer=require(_0x4157('0x0'));var util=require(_0x4157('0x1'));var path=require(_0x4157('0x2'));var timeout=require(_0x4157('0x3'));var express=require('express');var router=express[_0x4157('0x4')]();var auth=require(_0x4157('0x5'));var interaction=require(_0x4157('0x6'));var config=require(_0x4157('0x7'));module[_0x4157('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 be0d5ce..c5c3431 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 _0xf19e=['sequelize','exports','STRING'];(function(_0x39d819,_0x2842c0){var _0x2f47a3=function(_0x527490){while(--_0x527490){_0x39d819['push'](_0x39d819['shift']());}};_0x2f47a3(++_0x2842c0);}(_0xf19e,0x12f));var _0xef19=function(_0x415d28,_0x36693e){_0x415d28=_0x415d28-0x0;var _0x1ff4ac=_0xf19e[_0x415d28];return _0x1ff4ac;};'use strict';var Sequelize=require(_0xef19('0x0'));module[_0xef19('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xef19('0x2')]}}; \ No newline at end of file +var _0x8288=['exports','INTEGER'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x8288,0x78));var _0x8828=function(_0x52b008,_0x4b6ad3){_0x52b008=_0x52b008-0x0;var _0x3ad797=_0x8288[_0x52b008];return _0x3ad797;};'use strict';var Sequelize=require('sequelize');module[_0x8828('0x0')]={'penalty':{'type':Sequelize[_0x8828('0x1')],'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 19ca6ff..50cdc57 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 _0x0ad6=['path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x72df4,_0x158df6){var _0x52cab4=function(_0x2a866b){while(--_0x2a866b){_0x72df4['push'](_0x72df4['shift']());}};_0x52cab4(++_0x158df6);}(_0x0ad6,0x1ca));var _0x60ad=function(_0x320c57,_0x30bd8f){_0x320c57=_0x320c57-0x0;var _0x279a54=_0x0ad6[_0x320c57];return _0x279a54;};'use strict';var _=require(_0x60ad('0x0'));var util=require(_0x60ad('0x1'));var logger=require(_0x60ad('0x2'))(_0x60ad('0x3'));var moment=require(_0x60ad('0x4'));var BPromise=require(_0x60ad('0x5'));var rp=require(_0x60ad('0x6'));var fs=require('fs');var path=require(_0x60ad('0x7'));var rimraf=require(_0x60ad('0x8'));var config=require(_0x60ad('0x9'));var attributes=require(_0x60ad('0xa'));module[_0x60ad('0xb')]=function(_0x248537,_0x151211){return _0x248537[_0x60ad('0xc')](_0x60ad('0xd'),attributes,{'tableName':_0x60ad('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8514=['exports','user_has_fax_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes'];(function(_0x9f0f1d,_0x511c69){var _0x19feed=function(_0x2a4559){while(--_0x2a4559){_0x9f0f1d['push'](_0x9f0f1d['shift']());}};_0x19feed(++_0x511c69);}(_0x8514,0xb6));var _0x4851=function(_0x518d92,_0x47db3b){_0x518d92=_0x518d92-0x0;var _0x122b9e=_0x8514[_0x518d92];return _0x122b9e;};'use strict';var _=require(_0x4851('0x0'));var util=require(_0x4851('0x1'));var logger=require(_0x4851('0x2'))('api');var moment=require(_0x4851('0x3'));var BPromise=require(_0x4851('0x4'));var rp=require(_0x4851('0x5'));var fs=require('fs');var path=require(_0x4851('0x6'));var rimraf=require(_0x4851('0x7'));var config=require(_0x4851('0x8'));var attributes=require(_0x4851('0x9'));module[_0x4851('0xa')]=function(_0x50a51a,_0x32b344){return _0x50a51a['define']('UserFaxQueue',attributes,{'tableName':_0x4851('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index d2f5b92..de78c43 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 _0x61ff=['../../config/environment','jayson/promise','client','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x52b40b,_0x221f83){var _0x30a250=function(_0x2d050b){while(--_0x2d050b){_0x52b40b['push'](_0x52b40b['shift']());}};_0x30a250(++_0x221f83);}(_0x61ff,0xde));var _0xf61f=function(_0x5aa373,_0x54c7f4){_0x5aa373=_0x5aa373-0x0;var _0x590e8e=_0x61ff[_0x5aa373];return _0x590e8e;};'use strict';var _=require(_0xf61f('0x0'));var util=require(_0xf61f('0x1'));var moment=require(_0xf61f('0x2'));var BPromise=require(_0xf61f('0x3'));var rs=require(_0xf61f('0x4'));var fs=require('fs');var Redis=require(_0xf61f('0x5'));var db=require(_0xf61f('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf61f('0x7'));var config=require(_0xf61f('0x8'));var jayson=require(_0xf61f('0x9'));var client=jayson[_0xf61f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c94dc,_0x434de9,_0x4cd8c1){return new BPromise(function(_0xf6df36,_0x34fab8){return client[_0xf61f('0xb')](_0x3c94dc,_0x4cd8c1)['then'](function(_0x5c0390){logger[_0xf61f('0xc')](_0xf61f('0xd'),_0x434de9,_0xf61f('0xe'));logger[_0xf61f('0xf')](_0xf61f('0x10'),_0x434de9,'request\x20sent',JSON[_0xf61f('0x11')](_0x5c0390));if(_0x5c0390[_0xf61f('0x12')]){if(_0x5c0390[_0xf61f('0x12')][_0xf61f('0x13')]===0x1f4){logger[_0xf61f('0x12')](_0xf61f('0xd'),_0x434de9,_0x5c0390[_0xf61f('0x12')]['message']);return _0x34fab8(_0x5c0390[_0xf61f('0x12')]['message']);}logger[_0xf61f('0x12')](_0xf61f('0xd'),_0x434de9,_0x5c0390[_0xf61f('0x12')][_0xf61f('0x14')]);return _0xf6df36(_0x5c0390[_0xf61f('0x12')][_0xf61f('0x14')]);}else{logger['info'](_0xf61f('0xd'),_0x434de9,'request\x20sent');_0xf6df36(_0x5c0390[_0xf61f('0x15')][_0xf61f('0x14')]);}})[_0xf61f('0x16')](function(_0x46ac99){logger[_0xf61f('0x12')](_0xf61f('0xd'),_0x434de9,_0x46ac99);_0x34fab8(_0x46ac99);});});} \ No newline at end of file +var _0x0574=['http','request','info','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UserFaxQueue,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x526f80,_0xcd4942){var _0x3c4ea0=function(_0x11526e){while(--_0x11526e){_0x526f80['push'](_0x526f80['shift']());}};_0x3c4ea0(++_0xcd4942);}(_0x0574,0x75));var _0x4057=function(_0x4353fe,_0x3433c7){_0x4353fe=_0x4353fe-0x0;var _0x3451aa=_0x0574[_0x4353fe];return _0x3451aa;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4057('0x0'));var BPromise=require(_0x4057('0x1'));var rs=require(_0x4057('0x2'));var fs=require('fs');var Redis=require(_0x4057('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4057('0x4'));var logger=require('../../config/logger')(_0x4057('0x5'));var config=require(_0x4057('0x6'));var jayson=require(_0x4057('0x7'));var client=jayson[_0x4057('0x8')][_0x4057('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23ed7a,_0x518ae8,_0x524cb4){return new BPromise(function(_0x226df6,_0x278b27){return client[_0x4057('0xa')](_0x23ed7a,_0x524cb4)['then'](function(_0x4360fb){logger[_0x4057('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x518ae8,'request\x20sent');logger['debug'](_0x4057('0xc'),_0x518ae8,_0x4057('0xd'),JSON[_0x4057('0xe')](_0x4360fb));if(_0x4360fb[_0x4057('0xf')]){if(_0x4360fb['error'][_0x4057('0x10')]===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x518ae8,_0x4360fb[_0x4057('0xf')][_0x4057('0x11')]);return _0x278b27(_0x4360fb['error'][_0x4057('0x11')]);}logger['error'](_0x4057('0x12'),_0x518ae8,_0x4360fb['error']['message']);return _0x226df6(_0x4360fb[_0x4057('0xf')][_0x4057('0x11')]);}else{logger[_0x4057('0xb')](_0x4057('0x12'),_0x518ae8,'request\x20sent');_0x226df6(_0x4360fb[_0x4057('0x13')][_0x4057('0x11')]);}})[_0x4057('0x14')](function(_0x31890b){logger[_0x4057('0xf')](_0x4057('0x12'),_0x518ae8,_0x31890b);_0x278b27(_0x31890b);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 812a30e..48f6959 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 _0xeff8=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x4e5133,_0x5f1945){var _0x3a039a=function(_0x39b18a){while(--_0x39b18a){_0x4e5133['push'](_0x4e5133['shift']());}};_0x3a039a(++_0x5f1945);}(_0xeff8,0x186));var _0x8eff=function(_0x37b7b6,_0x165a5c){_0x37b7b6=_0x37b7b6-0x0;var _0x10c4c3=_0xeff8[_0x37b7b6];return _0x10c4c3;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8eff('0x5'));var config=require(_0x8eff('0x6'));module[_0x8eff('0x7')]=router; \ No newline at end of file +var _0xba18=['Router','../../components/auth/service','../../components/interaction/service','exports','multer','util','path','connect-timeout','express'];(function(_0x46801e,_0xd51eb9){var _0x21f830=function(_0x8e0d8a){while(--_0x8e0d8a){_0x46801e['push'](_0x46801e['shift']());}};_0x21f830(++_0xd51eb9);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8ba1('0x0'));var util=require(_0x8ba1('0x1'));var path=require(_0x8ba1('0x2'));var timeout=require(_0x8ba1('0x3'));var express=require(_0x8ba1('0x4'));var router=express[_0x8ba1('0x5')]();var auth=require(_0x8ba1('0x6'));var interaction=require(_0x8ba1('0x7'));var config=require('../../config/environment');module[_0x8ba1('0x8')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 9006424..e92a1c8 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. * // * * // ************************************************************************* -'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb93a=['sequelize','exports','INTEGER'];(function(_0x1e6abb,_0x370a20){var _0x3503b4=function(_0x1b4edd){while(--_0x1b4edd){_0x1e6abb['push'](_0x1e6abb['shift']());}};_0x3503b4(++_0x370a20);}(_0xb93a,0x120));var _0xab93=function(_0x10022b,_0x3b19e2){_0x10022b=_0x10022b-0x0;var _0x2e9392=_0xb93a[_0x10022b];return _0x2e9392;};'use strict';var Sequelize=require(_0xab93('0x0'));module[_0xab93('0x1')]={'penalty':{'type':Sequelize[_0xab93('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 b10ea3c..39b3578 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 _0x430c=['user_has_mail_queues','lodash','api','moment','bluebird','./userMailQueue.attributes','exports','UserMailQueue'];(function(_0x31f29c,_0x300853){var _0x1bb741=function(_0x1d63af){while(--_0x1d63af){_0x31f29c['push'](_0x31f29c['shift']());}};_0x1bb741(++_0x300853);}(_0x430c,0x1a1));var _0xc430=function(_0x53f897,_0x539857){_0x53f897=_0x53f897-0x0;var _0x6879f8=_0x430c[_0x53f897];return _0x6879f8;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc430('0x1'));var moment=require(_0xc430('0x2'));var BPromise=require(_0xc430('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc430('0x4'));module[_0xc430('0x5')]=function(_0x50b256,_0x42aa9c){return _0x50b256['define'](_0xc430('0x6'),attributes,{'tableName':_0xc430('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4975=['./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5a017a,_0x1a71fa){var _0x136046=function(_0x385c39){while(--_0x385c39){_0x5a017a['push'](_0x5a017a['shift']());}};_0x136046(++_0x1a71fa);}(_0x4975,0x86));var _0x5497=function(_0x545bb8,_0x2296fd){_0x545bb8=_0x545bb8-0x0;var _0x502516=_0x4975[_0x545bb8];return _0x502516;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index e696186..3f36e2e 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 _0x0654=['result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x0654,0x155));var _0x4065=function(_0x4cfd7d,_0x460d18){_0x4cfd7d=_0x4cfd7d-0x0;var _0x2a3269=_0x0654[_0x4cfd7d];return _0x2a3269;};'use strict';var _=require(_0x4065('0x0'));var util=require(_0x4065('0x1'));var moment=require(_0x4065('0x2'));var BPromise=require(_0x4065('0x3'));var rs=require(_0x4065('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4065('0x5'))['db'];var utils=require(_0x4065('0x6'));var logger=require(_0x4065('0x7'))('rpc');var config=require(_0x4065('0x8'));var jayson=require(_0x4065('0x9'));var client=jayson[_0x4065('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2296aa,_0x23778b,_0x3d0fbf){return new BPromise(function(_0x42bc60,_0x2eab0a){return client[_0x4065('0xb')](_0x2296aa,_0x3d0fbf)[_0x4065('0xc')](function(_0x3f5cd5){logger[_0x4065('0xd')](_0x4065('0xe'),_0x23778b,'request\x20sent');logger['debug']('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x23778b,_0x4065('0xf'),JSON['stringify'](_0x3f5cd5));if(_0x3f5cd5[_0x4065('0x10')]){if(_0x3f5cd5[_0x4065('0x10')][_0x4065('0x11')]===0x1f4){logger[_0x4065('0x10')](_0x4065('0xe'),_0x23778b,_0x3f5cd5[_0x4065('0x10')][_0x4065('0x12')]);return _0x2eab0a(_0x3f5cd5[_0x4065('0x10')][_0x4065('0x12')]);}logger[_0x4065('0x10')](_0x4065('0xe'),_0x23778b,_0x3f5cd5[_0x4065('0x10')][_0x4065('0x12')]);return _0x42bc60(_0x3f5cd5[_0x4065('0x10')]['message']);}else{logger['info'](_0x4065('0xe'),_0x23778b,_0x4065('0xf'));_0x42bc60(_0x3f5cd5[_0x4065('0x13')][_0x4065('0x12')]);}})['catch'](function(_0x5d9334){logger[_0x4065('0x10')](_0x4065('0xe'),_0x23778b,_0x5d9334);_0x2eab0a(_0x5d9334);});});} \ No newline at end of file +var _0x9009=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','UserMailQueue,\x20%s,\x20%s','catch'];(function(_0x2c98eb,_0x2fed30){var _0x5f4fcd=function(_0x2b5439){while(--_0x2b5439){_0x2c98eb['push'](_0x2c98eb['shift']());}};_0x5f4fcd(++_0x2fed30);}(_0x9009,0x12b));var _0x9900=function(_0x3b6513,_0x5e0774){_0x3b6513=_0x3b6513-0x0;var _0x25b445=_0x9009[_0x3b6513];return _0x25b445;};'use strict';var _=require(_0x9900('0x0'));var util=require(_0x9900('0x1'));var moment=require(_0x9900('0x2'));var BPromise=require(_0x9900('0x3'));var rs=require(_0x9900('0x4'));var fs=require('fs');var Redis=require(_0x9900('0x5'));var db=require(_0x9900('0x6'))['db'];var utils=require(_0x9900('0x7'));var logger=require(_0x9900('0x8'))(_0x9900('0x9'));var config=require(_0x9900('0xa'));var jayson=require(_0x9900('0xb'));var client=jayson['client'][_0x9900('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x39c7dd,_0x530b12,_0x3590a9){return new BPromise(function(_0x533365,_0x59a8a1){return client[_0x9900('0xd')](_0x39c7dd,_0x3590a9)[_0x9900('0xe')](function(_0x2b1124){logger[_0x9900('0xf')]('UserMailQueue,\x20%s,\x20%s',_0x530b12,_0x9900('0x10'));logger[_0x9900('0x11')](_0x9900('0x12'),_0x530b12,_0x9900('0x10'),JSON['stringify'](_0x2b1124));if(_0x2b1124[_0x9900('0x13')]){if(_0x2b1124[_0x9900('0x13')]['code']===0x1f4){logger[_0x9900('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x530b12,_0x2b1124[_0x9900('0x13')][_0x9900('0x14')]);return _0x59a8a1(_0x2b1124['error'][_0x9900('0x14')]);}logger[_0x9900('0x13')](_0x9900('0x15'),_0x530b12,_0x2b1124[_0x9900('0x13')]['message']);return _0x533365(_0x2b1124['error'][_0x9900('0x14')]);}else{logger[_0x9900('0xf')](_0x9900('0x15'),_0x530b12,_0x9900('0x10'));_0x533365(_0x2b1124['result']['message']);}})[_0x9900('0x16')](function(_0x3f9480){logger[_0x9900('0x13')](_0x9900('0x15'),_0x530b12,_0x3f9480);_0x59a8a1(_0x3f9480);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 71c552b..acc336e 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 _0xc359=['connect-timeout','express','Router','../../components/interaction/service','exports','util'];(function(_0x446faa,_0x4b5a20){var _0xe4195a=function(_0x35871a){while(--_0x35871a){_0x446faa['push'](_0x446faa['shift']());}};_0xe4195a(++_0x4b5a20);}(_0xc359,0x1d9));var _0x9c35=function(_0x2db667,_0x193cf5){_0x2db667=_0x2db667-0x0;var _0x83ff9=_0xc359[_0x2db667];return _0x83ff9;};'use strict';var multer=require('multer');var util=require(_0x9c35('0x0'));var path=require('path');var timeout=require(_0x9c35('0x1'));var express=require(_0x9c35('0x2'));var router=express[_0x9c35('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x9c35('0x4'));var config=require('../../config/environment');module[_0x9c35('0x5')]=router; \ No newline at end of file +var _0x11e5=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','exports','multer'];(function(_0xe4a30d,_0x407bea){var _0x4b7e1e=function(_0x5d4d87){while(--_0x5d4d87){_0xe4a30d['push'](_0xe4a30d['shift']());}};_0x4b7e1e(++_0x407bea);}(_0x11e5,0x8b));var _0x511e=function(_0x3f8d23,_0x16f5ee){_0x3f8d23=_0x3f8d23-0x0;var _0x1ffe51=_0x11e5[_0x3f8d23];return _0x1ffe51;};'use strict';var multer=require(_0x511e('0x0'));var util=require('util');var path=require(_0x511e('0x1'));var timeout=require(_0x511e('0x2'));var express=require('express');var router=express[_0x511e('0x3')]();var auth=require(_0x511e('0x4'));var interaction=require(_0x511e('0x5'));var config=require('../../config/environment');module[_0x511e('0x6')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 24b92e4..b83baf1 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 _0x9733=['exports','INTEGER','sequelize'];(function(_0x4fd9b9,_0x4baad2){var _0x41907a=function(_0x9d862a){while(--_0x9d862a){_0x4fd9b9['push'](_0x4fd9b9['shift']());}};_0x41907a(++_0x4baad2);}(_0x9733,0x8c));var _0x3973=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9733[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x3973('0x0'));module[_0x3973('0x1')]={'penalty':{'type':Sequelize[_0x3973('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf327=['sequelize','exports','INTEGER'];(function(_0x1404c3,_0x588b81){var _0x5740a9=function(_0x22d98f){while(--_0x22d98f){_0x1404c3['push'](_0x1404c3['shift']());}};_0x5740a9(++_0x588b81);}(_0xf327,0x156));var _0x7f32=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf327[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x7f32('0x0'));module[_0x7f32('0x1')]={'penalty':{'type':Sequelize[_0x7f32('0x2')],'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 e80827e..66020b0 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 _0xaa65=['util','api','bluebird','request-promise','path','rimraf','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash'];(function(_0x28fbf0,_0x2a3ced){var _0x44e78b=function(_0x3e1726){while(--_0x3e1726){_0x28fbf0['push'](_0x28fbf0['shift']());}};_0x44e78b(++_0x2a3ced);}(_0xaa65,0x9b));var _0x5aa6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa65[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5aa6('0x0'));var util=require(_0x5aa6('0x1'));var logger=require('../../config/logger')(_0x5aa6('0x2'));var moment=require('moment');var BPromise=require(_0x5aa6('0x3'));var rp=require(_0x5aa6('0x4'));var fs=require('fs');var path=require(_0x5aa6('0x5'));var rimraf=require(_0x5aa6('0x6'));var config=require('../../config/environment');var attributes=require(_0x5aa6('0x7'));module[_0x5aa6('0x8')]=function(_0x282c52,_0xc20275){return _0x282c52[_0x5aa6('0x9')](_0x5aa6('0xa'),attributes,{'tableName':_0x5aa6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x91c8=['request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment'];(function(_0x3aea7c,_0x538eca){var _0x2ac5c2=function(_0x181063){while(--_0x181063){_0x3aea7c['push'](_0x3aea7c['shift']());}};_0x2ac5c2(++_0x538eca);}(_0x91c8,0x175));var _0x891c=function(_0x42eccc,_0x20b3eb){_0x42eccc=_0x42eccc-0x0;var _0x40c464=_0x91c8[_0x42eccc];return _0x40c464;};'use strict';var _=require(_0x891c('0x0'));var util=require(_0x891c('0x1'));var logger=require(_0x891c('0x2'))(_0x891c('0x3'));var moment=require(_0x891c('0x4'));var BPromise=require('bluebird');var rp=require(_0x891c('0x5'));var fs=require('fs');var path=require(_0x891c('0x6'));var rimraf=require(_0x891c('0x7'));var config=require(_0x891c('0x8'));var attributes=require(_0x891c('0x9'));module[_0x891c('0xa')]=function(_0xf36a88,_0x2026e6){return _0xf36a88[_0x891c('0xb')](_0x891c('0xc'),attributes,{'tableName':_0x891c('0xd'),'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 996ffb8..6c2501e 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 _0xea1b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x1f81dd,_0x10fb17){var _0x49d583=function(_0x1e7c29){while(--_0x1e7c29){_0x1f81dd['push'](_0x1f81dd['shift']());}};_0x49d583(++_0x10fb17);}(_0xea1b,0xd5));var _0xbea1=function(_0x4bd534,_0x36aeef){_0x4bd534=_0x4bd534-0x0;var _0x1aea21=_0xea1b[_0x4bd534];return _0x1aea21;};'use strict';var _=require(_0xbea1('0x0'));var util=require(_0xbea1('0x1'));var moment=require(_0xbea1('0x2'));var BPromise=require(_0xbea1('0x3'));var rs=require(_0xbea1('0x4'));var fs=require('fs');var Redis=require(_0xbea1('0x5'));var db=require(_0xbea1('0x6'))['db'];var utils=require(_0xbea1('0x7'));var logger=require('../../config/logger')(_0xbea1('0x8'));var config=require(_0xbea1('0x9'));var jayson=require(_0xbea1('0xa'));var client=jayson[_0xbea1('0xb')][_0xbea1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xdd403a,_0x4154f6,_0x1a2c6c){return new BPromise(function(_0x59cb31,_0x9b8b13){return client[_0xbea1('0xd')](_0xdd403a,_0x1a2c6c)['then'](function(_0xa21c49){logger[_0xbea1('0xe')](_0xbea1('0xf'),_0x4154f6,_0xbea1('0x10'));logger[_0xbea1('0x11')](_0xbea1('0x12'),_0x4154f6,_0xbea1('0x10'),JSON[_0xbea1('0x13')](_0xa21c49));if(_0xa21c49[_0xbea1('0x14')]){if(_0xa21c49[_0xbea1('0x14')][_0xbea1('0x15')]===0x1f4){logger[_0xbea1('0x14')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4154f6,_0xa21c49[_0xbea1('0x14')][_0xbea1('0x16')]);return _0x9b8b13(_0xa21c49[_0xbea1('0x14')][_0xbea1('0x16')]);}logger[_0xbea1('0x14')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4154f6,_0xa21c49[_0xbea1('0x14')][_0xbea1('0x16')]);return _0x59cb31(_0xa21c49[_0xbea1('0x14')][_0xbea1('0x16')]);}else{logger[_0xbea1('0xe')](_0xbea1('0xf'),_0x4154f6,_0xbea1('0x10'));_0x59cb31(_0xa21c49['result']['message']);}})[_0xbea1('0x17')](function(_0x53b612){logger['error'](_0xbea1('0xf'),_0x4154f6,_0x53b612);_0x9b8b13(_0x53b612);});});} \ No newline at end of file +var _0xcb1b=['UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserOpenchannelQueue,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent'];(function(_0x3f1621,_0x1d481d){var _0x146414=function(_0x5bb03f){while(--_0x5bb03f){_0x3f1621['push'](_0x3f1621['shift']());}};_0x146414(++_0x1d481d);}(_0xcb1b,0x1e1));var _0xbcb1=function(_0x267d36,_0x44f9fc){_0x267d36=_0x267d36-0x0;var _0x3f7c58=_0xcb1b[_0x267d36];return _0x3f7c58;};'use strict';var _=require(_0xbcb1('0x0'));var util=require('util');var moment=require(_0xbcb1('0x1'));var BPromise=require(_0xbcb1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbcb1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbcb1('0x4'));var logger=require(_0xbcb1('0x5'))(_0xbcb1('0x6'));var config=require(_0xbcb1('0x7'));var jayson=require(_0xbcb1('0x8'));var client=jayson[_0xbcb1('0x9')][_0xbcb1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18d3f7,_0x26f8d2,_0x4fa124){return new BPromise(function(_0x37d8b0,_0x1ee764){return client['request'](_0x18d3f7,_0x4fa124)['then'](function(_0x5e2e38){logger[_0xbcb1('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x26f8d2,_0xbcb1('0xc'));logger['debug'](_0xbcb1('0xd'),_0x26f8d2,'request\x20sent',JSON[_0xbcb1('0xe')](_0x5e2e38));if(_0x5e2e38['error']){if(_0x5e2e38[_0xbcb1('0xf')]['code']===0x1f4){logger[_0xbcb1('0xf')](_0xbcb1('0x10'),_0x26f8d2,_0x5e2e38[_0xbcb1('0xf')][_0xbcb1('0x11')]);return _0x1ee764(_0x5e2e38[_0xbcb1('0xf')]['message']);}logger[_0xbcb1('0xf')](_0xbcb1('0x10'),_0x26f8d2,_0x5e2e38['error'][_0xbcb1('0x11')]);return _0x37d8b0(_0x5e2e38[_0xbcb1('0xf')][_0xbcb1('0x11')]);}else{logger['info'](_0xbcb1('0x10'),_0x26f8d2,'request\x20sent');_0x37d8b0(_0x5e2e38['result'][_0xbcb1('0x11')]);}})[_0xbcb1('0x12')](function(_0x5897ef){logger[_0xbcb1('0xf')](_0xbcb1('0x10'),_0x26f8d2,_0x5897ef);_0x1ee764(_0x5897ef);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index e9a5c08..99d6a3d 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 _0xf2a0=['/:id','show','/:id/resources','getResources','post','create','/:id/clone','clone','/:id/sections','addSections','put','update','delete','destroy','removeSections','removeResources','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x44ffb3,_0x1775d6){var _0x767763=function(_0x1778e6){while(--_0x1778e6){_0x44ffb3['push'](_0x44ffb3['shift']());}};_0x767763(++_0x1775d6);}(_0xf2a0,0x116));var _0x0f2a=function(_0x560485,_0x244601){_0x560485=_0x560485-0x0;var _0x3e7f69=_0xf2a0[_0x560485];return _0x3e7f69;};'use strict';var multer=require(_0x0f2a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0f2a('0x1'));var express=require(_0x0f2a('0x2'));var router=express[_0x0f2a('0x3')]();var auth=require(_0x0f2a('0x4'));var interaction=require(_0x0f2a('0x5'));var config=require(_0x0f2a('0x6'));var controller=require('./userProfile.controller');router[_0x0f2a('0x7')]('/',auth[_0x0f2a('0x8')](),controller[_0x0f2a('0x9')]);router[_0x0f2a('0x7')](_0x0f2a('0xa'),auth[_0x0f2a('0x8')](),controller[_0x0f2a('0xb')]);router[_0x0f2a('0x7')](_0x0f2a('0xc'),auth[_0x0f2a('0x8')](),controller[_0x0f2a('0xd')]);router[_0x0f2a('0x7')](_0x0f2a('0xe'),auth['isAuthenticated'](),controller[_0x0f2a('0xf')]);router[_0x0f2a('0x10')]('/',auth[_0x0f2a('0x8')](),controller[_0x0f2a('0x11')]);router[_0x0f2a('0x10')](_0x0f2a('0x12'),auth['isAuthenticated'](),controller[_0x0f2a('0x13')]);router[_0x0f2a('0x10')](_0x0f2a('0x14'),auth['isAuthenticated'](),controller[_0x0f2a('0x15')]);router[_0x0f2a('0x10')](_0x0f2a('0xe'),auth[_0x0f2a('0x8')](),controller['addResources']);router[_0x0f2a('0x16')](_0x0f2a('0xc'),auth[_0x0f2a('0x8')](),controller[_0x0f2a('0x17')]);router[_0x0f2a('0x18')]('/:id',auth[_0x0f2a('0x8')](),controller[_0x0f2a('0x19')]);router[_0x0f2a('0x18')](_0x0f2a('0x14'),auth[_0x0f2a('0x8')](),controller[_0x0f2a('0x1a')]);router[_0x0f2a('0x18')](_0x0f2a('0xe'),auth[_0x0f2a('0x8')](),controller[_0x0f2a('0x1b')]);module[_0x0f2a('0x1c')]=router; \ No newline at end of file +var _0xaef8=['../../components/auth/service','../../components/interaction/service','./userProfile.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/resources','getResources','post','create','/:id/clone','/:id/sections','addSections','addResources','update','delete','destroy','removeResources','exports','util','connect-timeout','express','Router'];(function(_0x45793b,_0x543050){var _0xa21b36=function(_0x29ab36){while(--_0x29ab36){_0x45793b['push'](_0x45793b['shift']());}};_0xa21b36(++_0x543050);}(_0xaef8,0x15b));var _0x8aef=function(_0x2a1338,_0x29f7aa){_0x2a1338=_0x2a1338-0x0;var _0xc02469=_0xaef8[_0x2a1338];return _0xc02469;};'use strict';var multer=require('multer');var util=require(_0x8aef('0x0'));var path=require('path');var timeout=require(_0x8aef('0x1'));var express=require(_0x8aef('0x2'));var router=express[_0x8aef('0x3')]();var auth=require(_0x8aef('0x4'));var interaction=require(_0x8aef('0x5'));var config=require('../../config/environment');var controller=require(_0x8aef('0x6'));router['get']('/',auth[_0x8aef('0x7')](),controller[_0x8aef('0x8')]);router[_0x8aef('0x9')](_0x8aef('0xa'),auth[_0x8aef('0x7')](),controller[_0x8aef('0xb')]);router[_0x8aef('0x9')](_0x8aef('0xc'),auth[_0x8aef('0x7')](),controller[_0x8aef('0xd')]);router['get'](_0x8aef('0xe'),auth[_0x8aef('0x7')](),controller[_0x8aef('0xf')]);router[_0x8aef('0x10')]('/',auth[_0x8aef('0x7')](),controller[_0x8aef('0x11')]);router[_0x8aef('0x10')](_0x8aef('0x12'),auth['isAuthenticated'](),controller['clone']);router[_0x8aef('0x10')](_0x8aef('0x13'),auth[_0x8aef('0x7')](),controller[_0x8aef('0x14')]);router[_0x8aef('0x10')](_0x8aef('0xe'),auth[_0x8aef('0x7')](),controller[_0x8aef('0x15')]);router['put']('/:id',auth[_0x8aef('0x7')](),controller[_0x8aef('0x16')]);router[_0x8aef('0x17')](_0x8aef('0xc'),auth[_0x8aef('0x7')](),controller[_0x8aef('0x18')]);router[_0x8aef('0x17')](_0x8aef('0x13'),auth['isAuthenticated'](),controller['removeSections']);router['delete']('/:id/resources',auth['isAuthenticated'](),controller[_0x8aef('0x19')]);module[_0x8aef('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 e75cb32..05d4da0 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 _0xf528=['split','sequelize','exports','STRING','name','setDataValue','join','crudPermissions','getDataValue'];(function(_0x120a47,_0xba7618){var _0x6d33a7=function(_0x10d9c0){while(--_0x10d9c0){_0x120a47['push'](_0x120a47['shift']());}};_0x6d33a7(++_0xba7618);}(_0xf528,0xbe));var _0x8f52=function(_0xecb15,_0x16855a){_0xecb15=_0xecb15-0x0;var _0x56e379=_0xf528[_0xecb15];return _0x56e379;};'use strict';var Sequelize=require(_0x8f52('0x0'));module[_0x8f52('0x1')]={'name':{'type':Sequelize[_0x8f52('0x2')],'allowNull':![],'unique':_0x8f52('0x3')},'crudPermissions':{'type':Sequelize[_0x8f52('0x2')],'set':function(_0x519c3c){this[_0x8f52('0x4')]('crudPermissions',_0x519c3c?_0x519c3c[_0x8f52('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x8f52('0x6'))?this[_0x8f52('0x7')](_0x8f52('0x6'))[_0x8f52('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x8f52('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xe4c2=['exports','STRING','setDataValue','join','getDataValue','crudPermissions','split','sequelize'];(function(_0x1e4f2d,_0x22e2bb){var _0xd05ce5=function(_0x4c7b43){while(--_0x4c7b43){_0x1e4f2d['push'](_0x1e4f2d['shift']());}};_0xd05ce5(++_0x22e2bb);}(_0xe4c2,0x87));var _0x2e4c=function(_0x3de4f8,_0x336c7d){_0x3de4f8=_0x3de4f8-0x0;var _0x3d81fc=_0xe4c2[_0x3de4f8];return _0x3d81fc;};'use strict';var Sequelize=require(_0x2e4c('0x0'));module[_0x2e4c('0x1')]={'name':{'type':Sequelize[_0x2e4c('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x2e4c('0x2')],'set':function(_0x57cd48){this[_0x2e4c('0x3')]('crudPermissions',_0x57cd48?_0x57cd48[_0x2e4c('0x4')](''):[]);},'get':function(){return this[_0x2e4c('0x5')](_0x2e4c('0x6'))?this['getDataValue'](_0x2e4c('0x6'))[_0x2e4c('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 6dd864a..4b2eac4 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 _0xeaab=['field','options','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','clone','get','crudPermissions','omit','transaction','UserProfileSection','autoAssociation','UserProfileResource','createdAt','sectionId','updatedAt','userProfileId','Resources','describe','each','push','removeSections','ids','addResources','sequelize','bulkCreate','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','isEmpty','parentSections','findOne','all','ignore','union','VIRTUAL','foreignKey','associatedResources','forEach','AnalyticExtractedReport','reportType','default','reportId','DefaultReports','custom','CustomReports','rows','CmContact','Tag','tag','ThroughTags','color','value','resourceId','toLowerCase','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','JscriptyProject','contacts','Lists','lists','CmList','companies','CmCustomField','chatqueues','FaxQueue','faxaccounts','inboundroutes','internalroutes','contexts','voicemails','VoiceMail','voicerecordings','membername','role','agent','Telephones','User','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','Team','voicequeues','queuecampaigns','agents','user','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','vtigeraccounts','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Pause','scheduler','sounds','Sound','tags','templates','Template','triggers','Trigger','trunks','variables','Variable','Plugin','metrics','AnalyticMetric','saproducts','sapricelists','SAPriceList','paymentmethod','SAPaymentMethod','html-pdf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','end','json','offset','status','set','Content-Range','save','update','then','destroy','error','stack','name','index','UserProfile','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type'];(function(_0x2d47bd,_0x54b903){var _0x1b49ed=function(_0x2683ab){while(--_0x2683ab){_0x2d47bd['push'](_0x2d47bd['shift']());}};_0x1b49ed(++_0x54b903);}(_0xeaab,0x9d));var _0xbeaa=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xeaab[_0x17d9e3];return _0x14192d;};'use strict';var pdf=require(_0xbeaa('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbeaa('0x1'));var moment=require(_0xbeaa('0x2'));var BPromise=require(_0xbeaa('0x3'));var Mustache=require(_0xbeaa('0x4'));var util=require(_0xbeaa('0x5'));var path=require(_0xbeaa('0x6'));var sox=require(_0xbeaa('0x7'));var csv=require(_0xbeaa('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbeaa('0x9'));var squel=require(_0xbeaa('0xa'));var crypto=require(_0xbeaa('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbeaa('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbeaa('0xc'));var authService=require(_0xbeaa('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbeaa('0xe'))(_0xbeaa('0xf'));var utils=require('../../config/utils');var config=require(_0xbeaa('0x10'));var db=require(_0xbeaa('0x11'))['db'];config[_0xbeaa('0x12')]=_['defaults'](config['redis'],{'host':_0xbeaa('0x13'),'port':0x18eb});var socket=require(_0xbeaa('0x14'))(new Redis(config[_0xbeaa('0x12')]));require(_0xbeaa('0x15'))[_0xbeaa('0x16')](socket);function respondWithStatusCode(_0x2c5d49,_0x313a65){_0x313a65=_0x313a65||0xcc;return function(_0x2fd0c0){if(_0x2fd0c0){return _0x2c5d49[_0xbeaa('0x17')](_0x313a65);}return _0x2c5d49['status'](_0x313a65)[_0xbeaa('0x18')]();};}function respondWithResult(_0x5227d0,_0x1a8fb8){_0x1a8fb8=_0x1a8fb8||0xc8;return function(_0x424bb8){if(_0x424bb8){return _0x5227d0['status'](_0x1a8fb8)[_0xbeaa('0x19')](_0x424bb8);}};}function respondWithFilteredResult(_0x38f8bf,_0x4b7d97){return function(_0x199695){if(_0x199695){var _0x3ec38e=_0x199695['count'],_0x177145=_0x4b7d97[_0xbeaa('0x1a')],_0x293327=_0x4b7d97[_0xbeaa('0x1a')]+_0x4b7d97['limit'],_0x2060b8;if(_0x293327>=_0x3ec38e){_0x293327=_0x3ec38e;_0x2060b8=0xc8;}else{_0x2060b8=0xce;}_0x38f8bf[_0xbeaa('0x1b')](_0x2060b8);return _0x38f8bf[_0xbeaa('0x1c')](_0xbeaa('0x1d'),_0x177145+'-'+_0x293327+'/'+_0x3ec38e)[_0xbeaa('0x19')](_0x199695);}return null;};}function patchUpdates(_0xe0342c){return function(_0x335428){try{jsonpatch['apply'](_0x335428,_0xe0342c,!![]);}catch(_0x38fc77){return BPromise['reject'](_0x38fc77);}return _0x335428[_0xbeaa('0x1e')]();};}function saveUpdates(_0x5c3db0,_0x429600){return function(_0x11f133){if(_0x11f133){return _0x11f133[_0xbeaa('0x1f')](_0x5c3db0)[_0xbeaa('0x20')](function(_0x508456){return _0x508456;});}return null;};}function removeEntity(_0x1d765e,_0x3577db){return function(_0x3e52d6){if(_0x3e52d6){return _0x3e52d6[_0xbeaa('0x21')]()['then'](function(){_0x1d765e[_0xbeaa('0x1b')](0xcc)[_0xbeaa('0x18')]();});}};}function handleEntityNotFound(_0x107739,_0x557716){return function(_0x1d198c){if(!_0x1d198c){_0x107739[_0xbeaa('0x17')](0x194);}return _0x1d198c;};}function handleError(_0x45db6d,_0x473a9d){_0x473a9d=_0x473a9d||0x1f4;return function(_0x2b20c0){logger[_0xbeaa('0x22')](_0x2b20c0[_0xbeaa('0x23')]);if(_0x2b20c0[_0xbeaa('0x24')]){delete _0x2b20c0[_0xbeaa('0x24')];}_0x45db6d[_0xbeaa('0x1b')](_0x473a9d)['send'](_0x2b20c0);};}exports[_0xbeaa('0x25')]=function(_0x4f893d,_0x449c35){var _0x46d5a6={},_0x15b1b9={},_0x4a56b0={'count':0x0,'rows':[]};var _0x376009=db[_0xbeaa('0x26')]['rawAttributes'];_0x15b1b9[_0xbeaa('0x27')]=_[_0xbeaa('0x28')](_0x376009);_0x15b1b9[_0xbeaa('0x29')]=_['keys'](_0x4f893d[_0xbeaa('0x29')]);_0x15b1b9[_0xbeaa('0x2a')]=_[_0xbeaa('0x2b')](_0x15b1b9[_0xbeaa('0x27')],_0x15b1b9['query']);_0x46d5a6[_0xbeaa('0x2c')]=_[_0xbeaa('0x2b')](_0x15b1b9[_0xbeaa('0x27')],qs[_0xbeaa('0x2d')](_0x4f893d['query'][_0xbeaa('0x2d')]));_0x46d5a6[_0xbeaa('0x2c')]=_0x46d5a6['attributes'][_0xbeaa('0x2e')]?_0x46d5a6[_0xbeaa('0x2c')]:_0x15b1b9[_0xbeaa('0x27')];if(!_0x4f893d['query'][_0xbeaa('0x2f')]('nolimit')){_0x46d5a6['limit']=qs['limit'](_0x4f893d[_0xbeaa('0x29')][_0xbeaa('0x30')]);_0x46d5a6['offset']=qs['offset'](_0x4f893d[_0xbeaa('0x29')][_0xbeaa('0x1a')]);}_0x46d5a6[_0xbeaa('0x31')]=qs[_0xbeaa('0x32')](_0x4f893d[_0xbeaa('0x29')][_0xbeaa('0x32')]);_0x46d5a6[_0xbeaa('0x33')]=qs[_0xbeaa('0x2a')](_[_0xbeaa('0x34')](_0x4f893d[_0xbeaa('0x29')],_0x15b1b9[_0xbeaa('0x2a')]));if(_0x4f893d[_0xbeaa('0x29')][_0xbeaa('0x35')]){_0x46d5a6[_0xbeaa('0x33')]=_[_0xbeaa('0x36')](_0x46d5a6['where'],{'$or':_[_0xbeaa('0x37')](_0x376009,function(_0x1c093f){if(_0x1c093f[_0xbeaa('0x38')]['key']!=='VIRTUAL'){var _0x1c743b={};_0x1c743b[_0x1c093f[_0xbeaa('0x39')]]={'$like':'%'+_0x4f893d[_0xbeaa('0x29')][_0xbeaa('0x35')]+'%'};return _0x1c743b;}})});}_0x46d5a6=_[_0xbeaa('0x36')]({},_0x46d5a6,_0x4f893d[_0xbeaa('0x3a')]);var _0x4b7180={'where':_0x46d5a6[_0xbeaa('0x33')]};return db[_0xbeaa('0x26')][_0xbeaa('0x3b')](_0x4b7180)[_0xbeaa('0x20')](function(_0x2de5a4){_0x4a56b0[_0xbeaa('0x3b')]=_0x2de5a4;if(_0x4f893d[_0xbeaa('0x29')][_0xbeaa('0x3c')]){_0x46d5a6[_0xbeaa('0x3d')]=[{'all':!![]}];}return db[_0xbeaa('0x26')][_0xbeaa('0x3e')](_0x46d5a6);})[_0xbeaa('0x20')](function(_0x8f58e5){_0x4a56b0['rows']=_0x8f58e5;return _0x4a56b0;})['then'](respondWithFilteredResult(_0x449c35,_0x46d5a6))[_0xbeaa('0x3f')](handleError(_0x449c35,null));};exports[_0xbeaa('0x40')]=function(_0x19afa3,_0x1536b8){var _0x2dadaa={'raw':![],'where':{'id':_0x19afa3[_0xbeaa('0x41')]['id']}},_0x154a74={};_0x154a74[_0xbeaa('0x27')]=_[_0xbeaa('0x28')](db[_0xbeaa('0x26')][_0xbeaa('0x42')]);_0x154a74[_0xbeaa('0x29')]=_[_0xbeaa('0x28')](_0x19afa3['query']);_0x154a74['filters']=_['intersection'](_0x154a74['model'],_0x154a74[_0xbeaa('0x29')]);_0x2dadaa['attributes']=_['intersection'](_0x154a74[_0xbeaa('0x27')],qs['fields'](_0x19afa3['query'][_0xbeaa('0x2d')]));_0x2dadaa[_0xbeaa('0x2c')]=_0x2dadaa[_0xbeaa('0x2c')][_0xbeaa('0x2e')]?_0x2dadaa['attributes']:_0x154a74[_0xbeaa('0x27')];if(_0x19afa3[_0xbeaa('0x29')]['includeAll']){_0x2dadaa[_0xbeaa('0x3d')]=[{'all':!![]}];}_0x2dadaa=_[_0xbeaa('0x36')]({},_0x2dadaa,_0x19afa3['options']);return db['UserProfile'][_0xbeaa('0x43')](_0x2dadaa)[_0xbeaa('0x20')](handleEntityNotFound(_0x1536b8,null))[_0xbeaa('0x20')](respondWithResult(_0x1536b8,null))[_0xbeaa('0x3f')](handleError(_0x1536b8,null));};exports[_0xbeaa('0x44')]=function(_0x33cdfc,_0x5a279f){return db[_0xbeaa('0x26')][_0xbeaa('0x44')](_0x33cdfc[_0xbeaa('0x45')],{})[_0xbeaa('0x20')](respondWithResult(_0x5a279f,0xc9))[_0xbeaa('0x3f')](handleError(_0x5a279f,null));};exports[_0xbeaa('0x46')]=function(_0x1dbbaa,_0x1b684d){var _0x22b0f9={'raw':![],'where':{'id':_0x1dbbaa[_0xbeaa('0x41')]['id']}},_0x4ff8dc={};_0x4ff8dc['model']=_[_0xbeaa('0x28')](db[_0xbeaa('0x26')][_0xbeaa('0x42')]);_0x22b0f9[_0xbeaa('0x2c')]=_[_0xbeaa('0x2b')](_0x4ff8dc['model'],qs[_0xbeaa('0x2d')](_0x1dbbaa[_0xbeaa('0x29')][_0xbeaa('0x2d')]));_0x22b0f9[_0xbeaa('0x2c')]=_0x22b0f9[_0xbeaa('0x2c')]['length']?_0x22b0f9[_0xbeaa('0x2c')]:_0x4ff8dc[_0xbeaa('0x27')];if(_0x1dbbaa['query'][_0xbeaa('0x3c')]){_0x22b0f9[_0xbeaa('0x3d')]=[{'all':!![]}];}_0x22b0f9=_['merge']({},_0x22b0f9,_0x1dbbaa[_0xbeaa('0x3a')]);return db[_0xbeaa('0x26')][_0xbeaa('0x43')](_0x22b0f9)[_0xbeaa('0x20')](handleEntityNotFound(_0x1b684d,null))[_0xbeaa('0x20')](function(_0x2953d5){if(_0x2953d5){var _0x345d0e=_0x2953d5[_0xbeaa('0x47')]({'plain':!![]});_0x345d0e=qs['omit'](_0x345d0e,['id','createdAt','updatedAt',_0xbeaa('0x48')]);_0x1dbbaa['body']=_[_0xbeaa('0x49')](_0x1dbbaa[_0xbeaa('0x45')],['id','createdAt','updatedAt']);return db['sequelize'][_0xbeaa('0x4a')](function(_0x476d80){return db[_0xbeaa('0x26')]['create'](_[_0xbeaa('0x36')](_0x345d0e,_0x1dbbaa['body']),{'include':_0x1dbbaa[_0xbeaa('0x29')][_0xbeaa('0x3c')]?[{'all':!![]}]:undefined,'transaction':_0x476d80})[_0xbeaa('0x20')](function(_0x418288){var _0x1b9961=_0x418288[_0xbeaa('0x47')]({'plain':!![]});return db[_0xbeaa('0x4b')][_0xbeaa('0x3e')]({'where':{'userProfileId':_0x1dbbaa[_0xbeaa('0x41')]['id']},'raw':!![]})[_0xbeaa('0x20')](function(_0x25781f){if(_0x25781f){return BPromise['each'](_0x25781f,function(_0x5aa6fc){return new BPromise(function(_0x52f776,_0x543473){if(_0x5aa6fc[_0xbeaa('0x4c')]===null||_0x5aa6fc[_0xbeaa('0x4c')]===0x1)_0x52f776(null);return db[_0xbeaa('0x4d')][_0xbeaa('0x3e')]({'where':{'sectionId':_0x5aa6fc['id']},'raw':!![]})[_0xbeaa('0x20')](function(_0x2e9980){var _0x290dad=_[_0xbeaa('0x37')](_0x2e9980,function(_0x28cacf){return qs[_0xbeaa('0x49')](_0x28cacf,['id',_0xbeaa('0x4e'),'updatedAt',_0xbeaa('0x4f')]);});_0x52f776(_0x290dad);})[_0xbeaa('0x3f')](function(_0x26edd9){_0x543473(_0x26edd9);});})['then'](function(_0x37eea8){var _0x561eca=qs['omit'](_0x5aa6fc,['id',_0xbeaa('0x4e'),_0xbeaa('0x50')]);_0x561eca[_0xbeaa('0x51')]=_0x1b9961['id'];if(_0x37eea8)_0x561eca[_0xbeaa('0x52')]=_0x37eea8;return _0x561eca;})['then'](function(_0x4b7b01){return db[_0xbeaa('0x4b')][_0xbeaa('0x44')](_0x4b7b01,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x476d80});});})['then'](function(){return _0x1b9961;});}});});});}})[_0xbeaa('0x20')](respondWithResult(_0x1b684d,0xc9))[_0xbeaa('0x3f')](handleError(_0x1b684d,null));};exports['update']=function(_0x275155,_0x3dc560){if(_0x275155[_0xbeaa('0x45')]['id']){delete _0x275155[_0xbeaa('0x45')]['id'];}return db[_0xbeaa('0x26')][_0xbeaa('0x43')]({'where':{'id':_0x275155[_0xbeaa('0x41')]['id']}})['then'](handleEntityNotFound(_0x3dc560,null))[_0xbeaa('0x20')](saveUpdates(_0x275155[_0xbeaa('0x45')],null))[_0xbeaa('0x20')](respondWithResult(_0x3dc560,null))[_0xbeaa('0x3f')](handleError(_0x3dc560,null));};exports['destroy']=function(_0x354fff,_0x3dc024){return db['UserProfile']['find']({'where':{'id':_0x354fff[_0xbeaa('0x41')]['id']}})[_0xbeaa('0x20')](handleEntityNotFound(_0x3dc024,null))['then'](removeEntity(_0x3dc024,null))['catch'](handleError(_0x3dc024,null));};exports[_0xbeaa('0x53')]=function(_0x19424c,_0x50c9cb){return db[_0xbeaa('0x26')][_0xbeaa('0x53')]()[_0xbeaa('0x20')](respondWithResult(_0x50c9cb,null))[_0xbeaa('0x3f')](handleError(_0x50c9cb,null));};exports['addSections']=function(_0x374fea,_0x162625){var _0x432c2e=_0x374fea[_0xbeaa('0x45')];return db[_0xbeaa('0x26')]['find']({'where':{'id':_0x374fea[_0xbeaa('0x41')]['id']}})[_0xbeaa('0x20')](handleEntityNotFound(_0x162625,null))[_0xbeaa('0x20')](function(_0x523c03){if(_0x523c03){return db['sequelize']['transaction'](function(_0x36e11f){return db[_0xbeaa('0x4b')][_0xbeaa('0x21')]({'where':{'userProfileId':_0x374fea['params']['id'],'sectionId':_[_0xbeaa('0x37')](_0x432c2e,function(_0x3d9cda){return _0x3d9cda[_0xbeaa('0x4f')];})},'transaction':_0x36e11f})[_0xbeaa('0x20')](function(){var _0x2e5655=_[_0xbeaa('0x37')](_0x432c2e,function(_0x49d7d5){_0x49d7d5['userProfileId']=_0x374fea[_0xbeaa('0x41')]['id'];return _0x49d7d5;});var _0x464398=[];return BPromise[_0xbeaa('0x54')](_0x2e5655,function(_0x3c51a5){return db[_0xbeaa('0x4b')][_0xbeaa('0x44')](_0x3c51a5,{'include':[{'model':db[_0xbeaa('0x4d')],'as':'Resources'}],'raw':!![],'transaction':_0x36e11f})['then'](function(_0x2497d3){_0x464398[_0xbeaa('0x55')](_0x2497d3[_0xbeaa('0x47')]({'plain':!![]}));});})[_0xbeaa('0x20')](function(){return _0x464398;});});});}})[_0xbeaa('0x20')](function(_0x17c8ec){return _0x17c8ec;})['then'](respondWithResult(_0x162625,null))[_0xbeaa('0x3f')](handleError(_0x162625,null));};exports[_0xbeaa('0x56')]=function(_0x436378,_0x538f23){var _0x6c525;return db['UserProfile'][_0xbeaa('0x43')]({'where':{'id':_0x436378[_0xbeaa('0x41')]['id']},'attributes':['id','name']})[_0xbeaa('0x20')](handleEntityNotFound(_0x538f23,null))[_0xbeaa('0x20')](function(_0x46d684){if(_0x46d684){_0x6c525=_0x46d684;return db[_0xbeaa('0x4b')][_0xbeaa('0x21')]({'where':{'userProfileId':_0x436378['params']['id'],'sectionId':_0x436378['query'][_0xbeaa('0x57')]}});}})['then'](function(){return _0x6c525;})[_0xbeaa('0x20')](respondWithStatusCode(_0x538f23,null))['catch'](handleError(_0x538f23,null));};exports[_0xbeaa('0x58')]=function(_0x22a4cb,_0x20161c){return db[_0xbeaa('0x26')][_0xbeaa('0x43')]({'where':{'id':_0x22a4cb['params']['id']}})[_0xbeaa('0x20')](handleEntityNotFound(_0x20161c,null))[_0xbeaa('0x20')](function(_0x3b0054){if(_0x3b0054){return db[_0xbeaa('0x59')][_0xbeaa('0x4a')](function(_0x48d60e){return db[_0xbeaa('0x4b')][_0xbeaa('0x3e')]({'where':{'userProfileId':_0x22a4cb[_0xbeaa('0x41')]['id']},'attributes':['id'],'raw':!![]})[_0xbeaa('0x20')](function(_0xe76138){if(_0xe76138){return db['UserProfileSection'][_0xbeaa('0x21')]({'where':{'userProfileId':_0x22a4cb[_0xbeaa('0x41')]['id'],'id':_[_0xbeaa('0x37')](_0xe76138,function(_0x1f3559){return _0x1f3559['id'];})},'transaction':_0x48d60e});}})[_0xbeaa('0x20')](function(_0x405b93){var _0x3f8d15=_['map'](_0x22a4cb[_0xbeaa('0x45')],function(_0x4eefa7){_0x4eefa7[_0xbeaa('0x51')]=_0x22a4cb[_0xbeaa('0x41')]['id'];return _0x4eefa7;});return db[_0xbeaa('0x4b')][_0xbeaa('0x5a')](_0x3f8d15,{'raw':!![],'transaction':_0x48d60e});})[_0xbeaa('0x20')](function(_0x509c39){var _0x5dd52a=_[_0xbeaa('0x35')](_[_0xbeaa('0x37')](_0x509c39,function(_0x29b9a){return _0x29b9a[_0xbeaa('0x47')]({'plain':!![]});}),{'includeAll':![]});if(_0x5dd52a){return db[_0xbeaa('0x4b')][_0xbeaa('0x3e')]({'where':{'userProfileId':_0x22a4cb[_0xbeaa('0x41')]['id'],'sectionId':_[_0xbeaa('0x37')](_0x5dd52a,function(_0x3d50dc){return _0x3d50dc[_0xbeaa('0x4f')];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x268a98){var _0x3bcd02=_['map'](_0x22a4cb['body'],function(_0xf4f9ac){_0xf4f9ac[_0xbeaa('0x51')]=_0x22a4cb['params']['id'];return _0xf4f9ac;});return db['UserProfileResource'][_0xbeaa('0x5a')](_0x3bcd02,{'raw':!![],'transaction':_0x48d60e});});}})['catch'](handleError(_0x20161c,null));});}})['then'](function(_0x46873a){var _0xaa3d5e=_[_0xbeaa('0x37')](_0x46873a,function(_0xe8c02b){return _0xe8c02b[_0xbeaa('0x47')]({'plain':!![]});});})[_0xbeaa('0x20')](respondWithResult(_0x20161c,null))[_0xbeaa('0x3f')](handleError(_0x20161c,null));};exports['removeResources']=function(_0x44937e,_0x862320,_0x597d43){return db[_0xbeaa('0x26')][_0xbeaa('0x43')]({'where':{'id':_0x44937e['params']['id']}})[_0xbeaa('0x20')](handleEntityNotFound(_0x862320,null))[_0xbeaa('0x20')](function(_0x22d6e9){if(_0x22d6e9){return _0x22d6e9['removeResources'](_0x44937e[_0xbeaa('0x29')][_0xbeaa('0x57')]);}})['then'](respondWithStatusCode(_0x862320,null))[_0xbeaa('0x3f')](handleError(_0x862320,null));};exports[_0xbeaa('0x5b')]=function(_0x4ebe8e,_0x385b2d){var _0x3746fb={'raw':![],'where':{}};var _0x54e013={};var _0xd5e916={'count':0x0,'rows':[]};var _0x49fc61=_0x4ebe8e[_0xbeaa('0x29')][_0xbeaa('0x5c')];if(typeof _0x49fc61===_0xbeaa('0x5d')){throw new db[(_0xbeaa('0x5e'))][(_0xbeaa('0x5f'))](_0xbeaa('0x60'));}var _0x29c02d=_0x4ebe8e[_0xbeaa('0x29')][_0xbeaa('0x61')]||![];var _0xcf631f=getQueryModels(_0x49fc61,_0x29c02d);if(typeof _0xcf631f[_0xbeaa('0x62')]==='undefined'){throw new db['Sequelize']['ValidationError']('Invalid\x20section\x20\x27'+_0x49fc61+'\x27');}var _0x222573=[];if(!_[_0xbeaa('0x63')](_0xcf631f['parentSections'])){_0x222573=_0xcf631f[_0xbeaa('0x64')];}else{_0x222573=[{'name':_0x49fc61}];}return db[_0xbeaa('0x26')][_0xbeaa('0x65')]({'where':{'id':_0x4ebe8e[_0xbeaa('0x41')]['id']}})[_0xbeaa('0x20')](handleEntityNotFound(_0x385b2d,null))['then'](function(_0x1cdd69){if(_0x1cdd69){var _0x431547=[];for(var _0x1da67a=0x0;_0x1da67a<_0x222573['length'];_0x1da67a++){_0x431547[_0xbeaa('0x55')](db[_0xbeaa('0x4b')][_0xbeaa('0x65')]({'where':{'userProfileId':_0x1cdd69['id'],'name':_0x222573[_0x1da67a]['name']},'raw':!![]}));}return BPromise[_0xbeaa('0x66')](_0x431547);}})[_0xbeaa('0x20')](function(_0x1392f4){var _0x35b8c9=_[_0xbeaa('0x35')](_0x1392f4,function(_0x1774bf){return _0x1774bf?_0x1774bf:undefined;});var _0xabe1a5=_[_0xbeaa('0x35')](_0x222573,[_0xbeaa('0x67'),!![]]);var _0x2da26c=_[_0xbeaa('0x63')](_0x35b8c9)&&_[_0xbeaa('0x63')](_0xabe1a5)?null:_[_0xbeaa('0x68')](_0xabe1a5,_0x35b8c9);if(_0x2da26c){var _0x4d7b9d=[];for(var _0x10e5d4=0x0;_0x10e5d4<_0x2da26c['length'];_0x10e5d4++){var _0x344a8a=_[_0xbeaa('0x43')](_0x222573,function(_0x2384a1){return _0x2da26c[_0x10e5d4]?_0x2384a1['name']===_0x2da26c[_0x10e5d4][_0xbeaa('0x24')]:null;});if(_0x344a8a){if(_0x2da26c[_0x10e5d4]['ignore']){_0x4d7b9d[_0xbeaa('0x55')](getAllResources(_0xcf631f[_0xbeaa('0x62')],_0x2da26c[_0x10e5d4]));}else{if(!_0x2da26c[_0x10e5d4][_0xbeaa('0x4c')]){_0x4d7b9d['push'](getAllowedResources(_0x344a8a,_0x2da26c[_0x10e5d4],_0xcf631f['childModel']));}else{if(_0x344a8a[_0xbeaa('0x27')]){_0x4d7b9d[_0xbeaa('0x55')](getAllFilteredResources(_0x344a8a,_0x2da26c[_0x10e5d4]));}}}}}return BPromise[_0xbeaa('0x66')](_0x4d7b9d);}else{return null;}})[_0xbeaa('0x20')](function(_0x221466){var _0x451b43=_0x221466;var _0x2708d4=null;if(_0x451b43){_0x2708d4=_0x451b43[_0xbeaa('0x2e')]===0x1?_0x451b43[0x0]:null;}if(_0x2708d4||_0x451b43){var _0x3397f3=db[_0xcf631f['childModel']]['rawAttributes'];_0x54e013[_0xbeaa('0x27')]=_[_0xbeaa('0x28')](_0x3397f3);_0x54e013['query']=_[_0xbeaa('0x28')](_0x4ebe8e[_0xbeaa('0x29')]);_0x54e013[_0xbeaa('0x2a')]=_[_0xbeaa('0x2b')](_0x54e013[_0xbeaa('0x27')],_0x54e013[_0xbeaa('0x29')]);_0x3746fb['attributes']=_['intersection'](_0x54e013[_0xbeaa('0x27')],qs[_0xbeaa('0x2d')](_0x4ebe8e[_0xbeaa('0x29')]['fields']));_0x3746fb[_0xbeaa('0x2c')]=_0x3746fb[_0xbeaa('0x2c')][_0xbeaa('0x2e')]?_0x3746fb['attributes']:_0x54e013[_0xbeaa('0x27')];if(!_0x4ebe8e[_0xbeaa('0x29')]['hasOwnProperty']('nolimit')){_0x3746fb['limit']=qs[_0xbeaa('0x30')](_0x4ebe8e['query'][_0xbeaa('0x30')]);_0x3746fb[_0xbeaa('0x1a')]=qs['offset'](_0x4ebe8e[_0xbeaa('0x29')]['offset']);}_0x3746fb[_0xbeaa('0x31')]=qs[_0xbeaa('0x32')](_0x4ebe8e['query'][_0xbeaa('0x32')]);_0x3746fb[_0xbeaa('0x33')]=qs[_0xbeaa('0x2a')](_[_0xbeaa('0x34')](_0x4ebe8e[_0xbeaa('0x29')],_0x54e013[_0xbeaa('0x2a')]));if(_0x4ebe8e[_0xbeaa('0x29')][_0xbeaa('0x35')]){_0x3746fb[_0xbeaa('0x33')]=_[_0xbeaa('0x36')](_0x3746fb[_0xbeaa('0x33')],{'$or':_[_0xbeaa('0x37')](_0x3397f3,function(_0x1c400c){if(_0x1c400c[_0xbeaa('0x38')]['key']!==_0xbeaa('0x69')){var _0x351929={};_0x351929[_0x1c400c['field']]={'$like':'%'+_0x4ebe8e['query'][_0xbeaa('0x35')]+'%'};return _0x351929;}})});}var _0x307b68=[];if(_0x2708d4){var _0x171c39=_[_0xbeaa('0x43')](_0x222573,[_0xbeaa('0x24'),_0x2708d4[_0xbeaa('0x24')]]);if(_0x171c39[_0xbeaa('0x39')]){var _0x20a85e={};if(_0xcf631f[_0xbeaa('0x62')]==='AnalyticExtractedReport'){_0x20a85e[_0x171c39[_0xbeaa('0x6a')]]=_[_0xbeaa('0x37')](_0x2708d4[_0xbeaa('0x6b')],'id');}else{_0x20a85e[_0x171c39[_0xbeaa('0x6a')]]=_0x2708d4[_0xbeaa('0x6b')];}_0x307b68[_0xbeaa('0x55')](_0x20a85e);}else{_0x3746fb[_0xbeaa('0x33')]['id']=_0x2708d4[_0xbeaa('0x6b')];}}else{for(var _0x18bb58=0x0;_0x18bb58<_0x451b43[_0xbeaa('0x2e')];_0x18bb58++){var _0x171c39=_['find'](_0x222573,['name',_0x451b43[_0x18bb58][_0xbeaa('0x24')]]);if(_0x171c39[_0xbeaa('0x39')]){var _0x20a85e={};_0x20a85e[_0x171c39[_0xbeaa('0x6a')]]=_0x451b43[_0x18bb58][_0xbeaa('0x6b')];_0x307b68['push'](_0x20a85e);}else{if(!_0x3746fb[_0xbeaa('0x33')]['id'])_0x3746fb[_0xbeaa('0x33')]['id']=[];_0x451b43[_0x18bb58][_0xbeaa('0x6b')][_0xbeaa('0x6c')](function(_0x150dea){_0x3746fb[_0xbeaa('0x33')]['id'][_0xbeaa('0x55')](_0x150dea);});}}}if(!_[_0xbeaa('0x63')](_0x307b68)){_0x3746fb['where']=_[_0xbeaa('0x36')](_0x3746fb[_0xbeaa('0x33')],{'$and':{'$or':_0x307b68}});}_0x3746fb=_[_0xbeaa('0x36')]({},_0x3746fb,_0x4ebe8e[_0xbeaa('0x3a')]);if(_0x2708d4&&!_0x2708d4[_0xbeaa('0x4c')]&&_0xcf631f[_0xbeaa('0x62')]===_0xbeaa('0x6d')){if(_0x4ebe8e[_0xbeaa('0x29')][_0xbeaa('0x3c')]){_0x3746fb[_0xbeaa('0x3d')]=[{'all':!![]}];}return db[_0xcf631f[_0xbeaa('0x62')]][_0xbeaa('0x3e')](_0x3746fb)[_0xbeaa('0x20')](function(_0x4769a6){var _0x313ad5=[];_0x4769a6[_0xbeaa('0x6c')](function(_0x3ec548){var _0x36e29d;switch(_0x3ec548[_0xbeaa('0x6e')]){case _0xbeaa('0x6f'):_0x36e29d=_[_0xbeaa('0x43')](_0x2708d4[_0xbeaa('0x6b')],function(_0x4a8c77){return _0x4a8c77['id']===_0x3ec548[_0xbeaa('0x70')]&&_0x4a8c77[_0xbeaa('0x38')]===_0xbeaa('0x71');});break;case _0xbeaa('0x72'):_0x36e29d=_['find'](_0x2708d4[_0xbeaa('0x6b')],function(_0x244c31){return _0x244c31['id']===_0x3ec548[_0xbeaa('0x70')]&&_0x244c31[_0xbeaa('0x38')]===_0xbeaa('0x73');});break;}if(_0x36e29d)_0x313ad5['push'](_0x3ec548);});_0xd5e916['count']=_0x313ad5[_0xbeaa('0x2e')];_0xd5e916[_0xbeaa('0x74')]=_0x313ad5;return _0xd5e916;});}else{return db[_0xcf631f[_0xbeaa('0x62')]][_0xbeaa('0x3b')]({'where':_0x3746fb['where']})[_0xbeaa('0x20')](function(_0x3879e9){_0xd5e916[_0xbeaa('0x3b')]=_0x3879e9;if(_0x4ebe8e['query']['includeAll']){if(_0xcf631f['childModel']===_0xbeaa('0x75')){_0x3746fb[_0xbeaa('0x3d')]=[{'model':db[_0xbeaa('0x76')],'as':'Tags','attributes':['id','name','color'],'required':_0x4ebe8e[_0xbeaa('0x29')][_0xbeaa('0x77')]?!![]:![]},{'model':db[_0xbeaa('0x76')],'as':_0xbeaa('0x78'),'attributes':['id',_0xbeaa('0x24'),_0xbeaa('0x79')],'through':_0x4ebe8e[_0xbeaa('0x29')][_0xbeaa('0x77')]?{'attributes':[],'where':{'TagId':_0x4ebe8e['query'][_0xbeaa('0x77')]||undefined}}:{},'required':_0x4ebe8e['query']['tag']?!![]:![]}];}else{_0x3746fb['include']=[{'all':!![]}];}}return db[_0xcf631f['childModel']]['findAll'](_0x3746fb);})[_0xbeaa('0x20')](function(_0x57f96e){_0xd5e916['rows']=_0x57f96e;return _0xd5e916;});}}else{return _0xd5e916;}})[_0xbeaa('0x20')](respondWithFilteredResult(_0x385b2d,_0x3746fb))['catch'](handleError(_0x385b2d,null));};function getAllResources(_0x57e76c,_0x2ab97c){return new BPromise(function(_0x3db78e,_0x3c0827){if(_0x2ab97c){var _0x41c815=_0x2ab97c[_0xbeaa('0x35')]?{[_0x2ab97c['filter']['field']]:_0x2ab97c['filter'][_0xbeaa('0x7a')]}:undefined;return db[_0x57e76c][_0xbeaa('0x3e')]({'where':_0x41c815,'raw':!![]})[_0xbeaa('0x20')](function(_0x4c5e36){_0x2ab97c['associatedResources']=_[_0xbeaa('0x37')](_0x4c5e36,'id');_0x3db78e(_0x2ab97c);})[_0xbeaa('0x3f')](function(_0x1267be){_0x3c0827(_0x1267be);});}else{_0x3db78e(null);}});}function getAllFilteredResources(_0x15d639,_0x47fe86){return new BPromise(function(_0x7b2716,_0x465f60){var _0x3695b6=_0x15d639['filter']?{[_0x15d639[_0xbeaa('0x35')][_0xbeaa('0x39')]]:_0x15d639[_0xbeaa('0x35')]['value']}:undefined;return db[_0x15d639['model']][_0xbeaa('0x3e')]({'where':_0x3695b6,'raw':!![]})[_0xbeaa('0x20')](function(_0x57952f){_0x47fe86[_0xbeaa('0x6b')]=_[_0xbeaa('0x37')](_0x57952f,function(_0x4b81aa){return _0x4b81aa['name'];});_0x7b2716(_0x47fe86);})[_0xbeaa('0x3f')](function(_0x3faec8){_0x465f60(_0x3faec8);});});}function getAllowedResources(_0xe6c671,_0x57baea,_0x430f94){return new BPromise(function(_0x532b56,_0x313f43){if(_0x57baea){return db[_0xbeaa('0x4d')]['findAll']({'where':{'sectionId':_0x57baea['id']},'raw':!![]})[_0xbeaa('0x20')](function(_0x3061e4){if(_0xe6c671['field']&&_0xe6c671[_0xbeaa('0x39')]!=='id'){_0x57baea['associatedResources']=_[_0xbeaa('0x37')](_0x3061e4,function(_0x45d795){return _0x45d795[_0xe6c671['field']];});}else{if(_0x430f94===_0xbeaa('0x6d')){_0x57baea[_0xbeaa('0x6b')]=_[_0xbeaa('0x37')](_0x3061e4,function(_0x14cf95){return{'id':_0x14cf95[_0xbeaa('0x7b')],'type':_0x14cf95[_0xbeaa('0x38')]};});}else{_0x57baea[_0xbeaa('0x6b')]=_[_0xbeaa('0x37')](_0x3061e4,function(_0x7705f3){return _0x7705f3['resourceId'];});}}_0x532b56(_0x57baea);})[_0xbeaa('0x3f')](function(_0x2c7adc){_0x313f43(_0x2c7adc);});}else{_0x532b56(null);}});}function getQueryModels(_0x4deeab,_0x57168c){var _0x1af94c=_0x4deeab[_0xbeaa('0x7c')]();var _0x1208a5={'childModel':undefined,'parentSections':[]};switch(_0x1af94c){case'squareprojects':_0x1208a5[_0xbeaa('0x62')]='SquareProject';break;case'odbc':_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0x7d');break;case _0xbeaa('0x7e'):_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0x7f');_0x1208a5[_0xbeaa('0x64')]=[{'name':_0xbeaa('0x80'),'field':'name','foreignKey':_0xbeaa('0x81')}];break;case'projects':_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0x82');break;case _0xbeaa('0x83'):_0x1208a5[_0xbeaa('0x62')]='CmContact';_0x1208a5[_0xbeaa('0x64')]=[{'name':_0xbeaa('0x84'),'field':'id','foreignKey':'ListId'}];break;case _0xbeaa('0x85'):_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0x86');break;case _0xbeaa('0x87'):_0x1208a5['childModel']='CmCompany';break;case'globalcustomfields':_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0x88');break;case _0xbeaa('0x89'):_0x1208a5[_0xbeaa('0x62')]='ChatQueue';break;case'chatwebsites':_0x1208a5[_0xbeaa('0x62')]='ChatWebsite';break;case'faxqueues':_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0x8a');break;case _0xbeaa('0x8b'):_0x1208a5[_0xbeaa('0x62')]='FaxAccount';break;case _0xbeaa('0x8c'):case _0xbeaa('0x8d'):case'outboundroutes':_0x1208a5[_0xbeaa('0x62')]='VoiceExtension';break;case _0xbeaa('0x8e'):_0x1208a5[_0xbeaa('0x62')]='VoiceContext';break;case _0xbeaa('0x8f'):_0x1208a5['childModel']=_0xbeaa('0x90');break;case _0xbeaa('0x91'):_0x1208a5[_0xbeaa('0x62')]='VoiceRecording';_0x1208a5['parentSections']=[{'name':'Agents','field':_0xbeaa('0x24'),'foreignKey':_0xbeaa('0x92'),'model':'User','filter':{'field':_0xbeaa('0x93'),'value':[_0xbeaa('0x94')]}},{'name':_0xbeaa('0x95'),'field':_0xbeaa('0x24'),'foreignKey':_0xbeaa('0x92'),'model':_0xbeaa('0x96'),'filter':{'field':_0xbeaa('0x93'),'value':[_0xbeaa('0x97')]}},{'name':_0xbeaa('0x98'),'field':'name','foreignKey':_0xbeaa('0x99'),'model':_0xbeaa('0x9a'),'filter':{'field':_0xbeaa('0x38'),'value':[_0xbeaa('0x9b')]}},{'name':_0xbeaa('0x9c'),'field':_0xbeaa('0x24'),'foreignKey':_0xbeaa('0x99'),'model':_0xbeaa('0x9a'),'filter':{'field':_0xbeaa('0x38'),'value':[_0xbeaa('0x9d')]}}];break;case _0xbeaa('0x9e'):_0x1208a5[_0xbeaa('0x62')]='VoiceMusicOnHold';break;case'chanspies':_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0x9f');break;case _0xbeaa('0xa0'):_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0xa1');break;case _0xbeaa('0xa2'):_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0xa3');break;case _0xbeaa('0xa4'):_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0xa5');break;case _0xbeaa('0xa6'):_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0xa7');break;case'mailsubstatuses':_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0xa8');break;case'openchannelqueues':_0x1208a5[_0xbeaa('0x62')]='OpenchannelQueue';break;case _0xbeaa('0xa9'):_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0xaa');break;case'smsqueues':_0x1208a5['childModel']=_0xbeaa('0xab');break;case _0xbeaa('0xac'):_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0xad');break;case'teams':_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0xae');break;case _0xbeaa('0xaf'):case _0xbeaa('0xb0'):_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0x9a');if(_0x57168c){_0x1208a5[_0xbeaa('0x64')]=[{'name':_0xbeaa('0x98')},{'name':_0xbeaa('0x9c')}];}break;case'users':case _0xbeaa('0xb1'):case'telephones':_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0x96');if(_0x57168c){_0x1208a5[_0xbeaa('0x64')]=[{'name':'Users','filter':{'field':'role','value':['admin',_0xbeaa('0xb2')]},'ignore':!![]},{'name':'Agents'},{'name':_0xbeaa('0x95')}];}break;case'zendeskaccounts':_0x1208a5['childModel']=_0xbeaa('0xb3');break;case _0xbeaa('0xb4'):_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0xb5');break;case _0xbeaa('0xb6'):_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0xb7');break;case'sugarcrmaccounts':_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0xb8');break;case _0xbeaa('0xb9'):_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0xba');break;case'zohoaccounts':_0x1208a5[_0xbeaa('0x62')]='ZohoAccount';break;case _0xbeaa('0xbb'):_0x1208a5[_0xbeaa('0x62')]='User';break;case'cannedanswers':_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0xbc');break;case _0xbeaa('0xbd'):_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0xbe');break;case _0xbeaa('0xbf'):_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0xc0');break;case _0xbeaa('0xc1'):_0x1208a5[_0xbeaa('0x62')]='Interval';break;case'pauses':_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0xc2');break;case _0xbeaa('0xc3'):_0x1208a5[_0xbeaa('0x62')]='Schedule';break;case _0xbeaa('0xc4'):_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0xc5');break;case _0xbeaa('0xc6'):_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0x76');break;case _0xbeaa('0xc7'):_0x1208a5['childModel']=_0xbeaa('0xc8');break;case _0xbeaa('0xc9'):_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0xca');break;case _0xbeaa('0xcb'):_0x1208a5[_0xbeaa('0x62')]='Trunk';break;case _0xbeaa('0xcc'):_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0xcd');break;case'plugins':_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0xce');break;case'extractedreports':_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0x6d');_0x1208a5[_0xbeaa('0x64')]=[{'name':'Reports','field':'id','foreignKey':_0xbeaa('0x70')}];break;case _0xbeaa('0xcf'):_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0xd0');break;case _0xbeaa('0xd1'):_0x1208a5[_0xbeaa('0x62')]='SAProduct';break;case _0xbeaa('0xd2'):_0x1208a5['childModel']=_0xbeaa('0xd3');break;case _0xbeaa('0xd4'):_0x1208a5[_0xbeaa('0x62')]=_0xbeaa('0xd5');break;default:return _0x1208a5;}return _0x1208a5;} \ No newline at end of file +var _0x49d9=['includeAll','include','catch','create','body','clone','find','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','Resources','destroy','describe','addSections','sectionId','push','removeSections','ids','addResources','userProfileId','removeResources','getResources','section','Sequelize','Unknown\x20section','mergeResources','parentSections','findOne','all','ignore','isEmpty','union','childModel','foreignKey','associatedResources','forEach','reportType','reportId','DefaultReports','custom','CustomReports','CmContact','Tag','Tags','color','tag','ThroughTags','value','AnalyticExtractedReport','resourceId','squareprojects','odbc','SquareOdbc','squarerecordings','SquareRecording','projectName','projects','JscriptyProject','contacts','ListId','lists','CmList','companies','CmCompany','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','inboundroutes','VoiceExtension','contexts','VoiceContext','voicerecordings','VoiceRecording','membername','role','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','VoicePrefix','ivrcampaigns','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','SmsAccount','teams','Team','queuecampaigns','agents','telephones','Users','admin','user','Agents','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','User','cannedanswers','CannedAnswer','customdashboards','Dashboard','intervals','Interval','pauses','Pause','Schedule','sounds','Sound','tags','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','metrics','AnalyticMetric','SAProduct','sapricelists','SAPriceList','paymentmethod','SAPaymentMethod','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','status','end','json','offset','limit','set','apply','reject','save','update','sendStatus','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','UserProfile','count','then','findAll','rows','params'];(function(_0x333798,_0x9f6561){var _0x389f4e=function(_0x193b28){while(--_0x193b28){_0x333798['push'](_0x333798['shift']());}};_0x389f4e(++_0x9f6561);}(_0x49d9,0x190));var _0x949d=function(_0x50246f,_0x41564e){_0x50246f=_0x50246f-0x0;var _0x57bb1d=_0x49d9[_0x50246f];return _0x57bb1d;};'use strict';var pdf=require(_0x949d('0x0'));var emlformat=require(_0x949d('0x1'));var rimraf=require(_0x949d('0x2'));var zipdir=require(_0x949d('0x3'));var jsonpatch=require(_0x949d('0x4'));var rp=require(_0x949d('0x5'));var moment=require(_0x949d('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x949d('0x7'));var util=require(_0x949d('0x8'));var path=require(_0x949d('0x9'));var sox=require(_0x949d('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x949d('0xb'));var squel=require(_0x949d('0xc'));var crypto=require(_0x949d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x949d('0xe'));var toCsv=require(_0x949d('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x949d('0x10'));var authService=require(_0x949d('0x11'));var qs=require(_0x949d('0x12'));var hardwareService=require(_0x949d('0x13'));var logger=require(_0x949d('0x14'))(_0x949d('0x15'));var utils=require('../../config/utils');var config=require(_0x949d('0x16'));var db=require(_0x949d('0x17'))['db'];config['redis']=_[_0x949d('0x18')](config[_0x949d('0x19')],{'host':_0x949d('0x1a'),'port':0x18eb});var socket=require(_0x949d('0x1b'))(new Redis(config[_0x949d('0x19')]));require(_0x949d('0x1c'))[_0x949d('0x1d')](socket);function respondWithStatusCode(_0x3807e0,_0x541e29){_0x541e29=_0x541e29||0xcc;return function(_0x52d4e6){if(_0x52d4e6){return _0x3807e0['sendStatus'](_0x541e29);}return _0x3807e0[_0x949d('0x1e')](_0x541e29)[_0x949d('0x1f')]();};}function respondWithResult(_0x565747,_0x33750c){_0x33750c=_0x33750c||0xc8;return function(_0x9abda2){if(_0x9abda2){return _0x565747[_0x949d('0x1e')](_0x33750c)[_0x949d('0x20')](_0x9abda2);}};}function respondWithFilteredResult(_0xdf5c4f,_0x186763){return function(_0xc5da0d){if(_0xc5da0d){var _0x43e695=_0xc5da0d['count'],_0x43e563=_0x186763[_0x949d('0x21')],_0x3c7a4e=_0x186763[_0x949d('0x21')]+_0x186763[_0x949d('0x22')],_0x332fd8;if(_0x3c7a4e>=_0x43e695){_0x3c7a4e=_0x43e695;_0x332fd8=0xc8;}else{_0x332fd8=0xce;}_0xdf5c4f['status'](_0x332fd8);return _0xdf5c4f[_0x949d('0x23')]('Content-Range',_0x43e563+'-'+_0x3c7a4e+'/'+_0x43e695)['json'](_0xc5da0d);}return null;};}function patchUpdates(_0x3d1545){return function(_0x28aa0d){try{jsonpatch[_0x949d('0x24')](_0x28aa0d,_0x3d1545,!![]);}catch(_0x256758){return BPromise[_0x949d('0x25')](_0x256758);}return _0x28aa0d[_0x949d('0x26')]();};}function saveUpdates(_0x302c41,_0x5deaf0){return function(_0x52cb2b){if(_0x52cb2b){return _0x52cb2b[_0x949d('0x27')](_0x302c41)['then'](function(_0x274efc){return _0x274efc;});}return null;};}function removeEntity(_0x5a9978,_0x1d7f2b){return function(_0x5c2ea3){if(_0x5c2ea3){return _0x5c2ea3['destroy']()['then'](function(){_0x5a9978[_0x949d('0x1e')](0xcc)[_0x949d('0x1f')]();});}};}function handleEntityNotFound(_0x553a8a,_0x52e128){return function(_0xa5da5){if(!_0xa5da5){_0x553a8a[_0x949d('0x28')](0x194);}return _0xa5da5;};}function handleError(_0x10676c,_0x483690){_0x483690=_0x483690||0x1f4;return function(_0x127580){logger['error'](_0x127580[_0x949d('0x29')]);if(_0x127580[_0x949d('0x2a')]){delete _0x127580[_0x949d('0x2a')];}_0x10676c['status'](_0x483690)[_0x949d('0x2b')](_0x127580);};}exports[_0x949d('0x2c')]=function(_0x49d322,_0x1ad7d9){var _0xeb7b6f={},_0x4073f5={},_0xecb294={'count':0x0,'rows':[]};var _0x5a48c2=db['UserProfile'][_0x949d('0x2d')];_0x4073f5[_0x949d('0x2e')]=_[_0x949d('0x2f')](_0x5a48c2);_0x4073f5['query']=_[_0x949d('0x2f')](_0x49d322[_0x949d('0x30')]);_0x4073f5[_0x949d('0x31')]=_[_0x949d('0x32')](_0x4073f5[_0x949d('0x2e')],_0x4073f5['query']);_0xeb7b6f[_0x949d('0x33')]=_['intersection'](_0x4073f5[_0x949d('0x2e')],qs['fields'](_0x49d322['query'][_0x949d('0x34')]));_0xeb7b6f[_0x949d('0x33')]=_0xeb7b6f['attributes'][_0x949d('0x35')]?_0xeb7b6f[_0x949d('0x33')]:_0x4073f5['model'];if(!_0x49d322[_0x949d('0x30')][_0x949d('0x36')](_0x949d('0x37'))){_0xeb7b6f[_0x949d('0x22')]=qs[_0x949d('0x22')](_0x49d322[_0x949d('0x30')][_0x949d('0x22')]);_0xeb7b6f['offset']=qs[_0x949d('0x21')](_0x49d322['query'][_0x949d('0x21')]);}_0xeb7b6f[_0x949d('0x38')]=qs[_0x949d('0x39')](_0x49d322[_0x949d('0x30')][_0x949d('0x39')]);_0xeb7b6f[_0x949d('0x3a')]=qs[_0x949d('0x31')](_[_0x949d('0x3b')](_0x49d322[_0x949d('0x30')],_0x4073f5['filters']));if(_0x49d322[_0x949d('0x30')][_0x949d('0x3c')]){_0xeb7b6f[_0x949d('0x3a')]=_[_0x949d('0x3d')](_0xeb7b6f[_0x949d('0x3a')],{'$or':_[_0x949d('0x3e')](_0x5a48c2,function(_0x100051){if(_0x100051[_0x949d('0x3f')][_0x949d('0x40')]!==_0x949d('0x41')){var _0x4f54f6={};_0x4f54f6[_0x100051[_0x949d('0x42')]]={'$like':'%'+_0x49d322[_0x949d('0x30')][_0x949d('0x3c')]+'%'};return _0x4f54f6;}})});}_0xeb7b6f=_[_0x949d('0x3d')]({},_0xeb7b6f,_0x49d322[_0x949d('0x43')]);var _0x30767e={'where':_0xeb7b6f['where']};return db[_0x949d('0x44')][_0x949d('0x45')](_0x30767e)[_0x949d('0x46')](function(_0x30a0a4){_0xecb294[_0x949d('0x45')]=_0x30a0a4;if(_0x49d322['query']['includeAll']){_0xeb7b6f['include']=[{'all':!![]}];}return db['UserProfile'][_0x949d('0x47')](_0xeb7b6f);})[_0x949d('0x46')](function(_0x8faa51){_0xecb294[_0x949d('0x48')]=_0x8faa51;return _0xecb294;})['then'](respondWithFilteredResult(_0x1ad7d9,_0xeb7b6f))['catch'](handleError(_0x1ad7d9,null));};exports['show']=function(_0x370db3,_0x311131){var _0x1becdd={'raw':![],'where':{'id':_0x370db3[_0x949d('0x49')]['id']}},_0x825a5c={};_0x825a5c[_0x949d('0x2e')]=_['keys'](db[_0x949d('0x44')][_0x949d('0x2d')]);_0x825a5c[_0x949d('0x30')]=_[_0x949d('0x2f')](_0x370db3[_0x949d('0x30')]);_0x825a5c[_0x949d('0x31')]=_[_0x949d('0x32')](_0x825a5c[_0x949d('0x2e')],_0x825a5c['query']);_0x1becdd[_0x949d('0x33')]=_[_0x949d('0x32')](_0x825a5c[_0x949d('0x2e')],qs[_0x949d('0x34')](_0x370db3[_0x949d('0x30')]['fields']));_0x1becdd[_0x949d('0x33')]=_0x1becdd[_0x949d('0x33')][_0x949d('0x35')]?_0x1becdd[_0x949d('0x33')]:_0x825a5c[_0x949d('0x2e')];if(_0x370db3[_0x949d('0x30')][_0x949d('0x4a')]){_0x1becdd[_0x949d('0x4b')]=[{'all':!![]}];}_0x1becdd=_['merge']({},_0x1becdd,_0x370db3[_0x949d('0x43')]);return db[_0x949d('0x44')]['find'](_0x1becdd)[_0x949d('0x46')](handleEntityNotFound(_0x311131,null))[_0x949d('0x46')](respondWithResult(_0x311131,null))[_0x949d('0x4c')](handleError(_0x311131,null));};exports[_0x949d('0x4d')]=function(_0x3ca070,_0x5022f5){return db[_0x949d('0x44')]['create'](_0x3ca070[_0x949d('0x4e')],{})[_0x949d('0x46')](respondWithResult(_0x5022f5,0xc9))['catch'](handleError(_0x5022f5,null));};exports[_0x949d('0x4f')]=function(_0x313dde,_0x169f78){var _0x31ee99={'raw':![],'where':{'id':_0x313dde['params']['id']}},_0x25b8be={};_0x25b8be[_0x949d('0x2e')]=_[_0x949d('0x2f')](db[_0x949d('0x44')][_0x949d('0x2d')]);_0x31ee99[_0x949d('0x33')]=_[_0x949d('0x32')](_0x25b8be[_0x949d('0x2e')],qs['fields'](_0x313dde['query'][_0x949d('0x34')]));_0x31ee99[_0x949d('0x33')]=_0x31ee99[_0x949d('0x33')][_0x949d('0x35')]?_0x31ee99[_0x949d('0x33')]:_0x25b8be['model'];if(_0x313dde[_0x949d('0x30')][_0x949d('0x4a')]){_0x31ee99[_0x949d('0x4b')]=[{'all':!![]}];}_0x31ee99=_[_0x949d('0x3d')]({},_0x31ee99,_0x313dde['options']);return db['UserProfile'][_0x949d('0x50')](_0x31ee99)[_0x949d('0x46')](handleEntityNotFound(_0x169f78,null))[_0x949d('0x46')](function(_0x2bd8d3){if(_0x2bd8d3){var _0x4751fa=_0x2bd8d3[_0x949d('0x51')]({'plain':!![]});_0x4751fa=qs[_0x949d('0x52')](_0x4751fa,['id',_0x949d('0x53'),_0x949d('0x54'),_0x949d('0x55')]);_0x313dde[_0x949d('0x4e')]=_[_0x949d('0x52')](_0x313dde[_0x949d('0x4e')],['id',_0x949d('0x53'),_0x949d('0x54')]);return db[_0x949d('0x56')][_0x949d('0x57')](function(_0x396fd8){return db[_0x949d('0x44')][_0x949d('0x4d')](_[_0x949d('0x3d')](_0x4751fa,_0x313dde[_0x949d('0x4e')]),{'include':_0x313dde[_0x949d('0x30')][_0x949d('0x4a')]?[{'all':!![]}]:undefined,'transaction':_0x396fd8})[_0x949d('0x46')](function(_0x350855){var _0x17a2e3=_0x350855[_0x949d('0x51')]({'plain':!![]});return db[_0x949d('0x58')][_0x949d('0x47')]({'where':{'userProfileId':_0x313dde[_0x949d('0x49')]['id']},'raw':!![]})[_0x949d('0x46')](function(_0x296c49){if(_0x296c49){return BPromise[_0x949d('0x59')](_0x296c49,function(_0x479249){return new BPromise(function(_0x2caf05,_0x2aa3b5){if(_0x479249[_0x949d('0x5a')]===null||_0x479249[_0x949d('0x5a')]===0x1)_0x2caf05(null);return db[_0x949d('0x5b')][_0x949d('0x47')]({'where':{'sectionId':_0x479249['id']},'raw':!![]})[_0x949d('0x46')](function(_0x4b84ec){var _0x5d11c7=_[_0x949d('0x3e')](_0x4b84ec,function(_0x1ab9e5){return qs[_0x949d('0x52')](_0x1ab9e5,['id',_0x949d('0x53'),_0x949d('0x54'),'sectionId']);});_0x2caf05(_0x5d11c7);})['catch'](function(_0x3cd409){_0x2aa3b5(_0x3cd409);});})[_0x949d('0x46')](function(_0x1f64ac){var _0x2feb99=qs[_0x949d('0x52')](_0x479249,['id',_0x949d('0x53'),'updatedAt']);_0x2feb99['userProfileId']=_0x17a2e3['id'];if(_0x1f64ac)_0x2feb99[_0x949d('0x5c')]=_0x1f64ac;return _0x2feb99;})[_0x949d('0x46')](function(_0x3ecca7){return db[_0x949d('0x58')][_0x949d('0x4d')](_0x3ecca7,{'include':[{'model':db[_0x949d('0x5b')],'as':_0x949d('0x5c')}],'raw':!![],'transaction':_0x396fd8});});})['then'](function(){return _0x17a2e3;});}});});});}})[_0x949d('0x46')](respondWithResult(_0x169f78,0xc9))['catch'](handleError(_0x169f78,null));};exports[_0x949d('0x27')]=function(_0x5bfcf3,_0x36fe2f){if(_0x5bfcf3[_0x949d('0x4e')]['id']){delete _0x5bfcf3[_0x949d('0x4e')]['id'];}return db[_0x949d('0x44')][_0x949d('0x50')]({'where':{'id':_0x5bfcf3[_0x949d('0x49')]['id']}})[_0x949d('0x46')](handleEntityNotFound(_0x36fe2f,null))['then'](saveUpdates(_0x5bfcf3[_0x949d('0x4e')],null))[_0x949d('0x46')](respondWithResult(_0x36fe2f,null))['catch'](handleError(_0x36fe2f,null));};exports[_0x949d('0x5d')]=function(_0x3c51af,_0x1c2ad8){return db['UserProfile'][_0x949d('0x50')]({'where':{'id':_0x3c51af[_0x949d('0x49')]['id']}})['then'](handleEntityNotFound(_0x1c2ad8,null))[_0x949d('0x46')](removeEntity(_0x1c2ad8,null))[_0x949d('0x4c')](handleError(_0x1c2ad8,null));};exports[_0x949d('0x5e')]=function(_0x4f7f33,_0x3a1e90){return db[_0x949d('0x44')][_0x949d('0x5e')]()[_0x949d('0x46')](respondWithResult(_0x3a1e90,null))[_0x949d('0x4c')](handleError(_0x3a1e90,null));};exports[_0x949d('0x5f')]=function(_0x3711ab,_0x401d86){var _0x4422b5=_0x3711ab['body'];return db['UserProfile']['find']({'where':{'id':_0x3711ab[_0x949d('0x49')]['id']}})[_0x949d('0x46')](handleEntityNotFound(_0x401d86,null))['then'](function(_0x26eb37){if(_0x26eb37){return db[_0x949d('0x56')][_0x949d('0x57')](function(_0x21dce1){return db[_0x949d('0x58')]['destroy']({'where':{'userProfileId':_0x3711ab[_0x949d('0x49')]['id'],'sectionId':_[_0x949d('0x3e')](_0x4422b5,function(_0x1d8f22){return _0x1d8f22[_0x949d('0x60')];})},'transaction':_0x21dce1})[_0x949d('0x46')](function(){var _0x5b5bbc=_['map'](_0x4422b5,function(_0x4de046){_0x4de046['userProfileId']=_0x3711ab[_0x949d('0x49')]['id'];return _0x4de046;});var _0x287b31=[];return BPromise[_0x949d('0x59')](_0x5b5bbc,function(_0x9f270){return db[_0x949d('0x58')][_0x949d('0x4d')](_0x9f270,{'include':[{'model':db[_0x949d('0x5b')],'as':_0x949d('0x5c')}],'raw':!![],'transaction':_0x21dce1})[_0x949d('0x46')](function(_0xdcdfc3){_0x287b31[_0x949d('0x61')](_0xdcdfc3[_0x949d('0x51')]({'plain':!![]}));});})[_0x949d('0x46')](function(){return _0x287b31;});});});}})['then'](function(_0x541cbb){return _0x541cbb;})[_0x949d('0x46')](respondWithResult(_0x401d86,null))['catch'](handleError(_0x401d86,null));};exports[_0x949d('0x62')]=function(_0x394a38,_0x330333){var _0x316754;return db[_0x949d('0x44')][_0x949d('0x50')]({'where':{'id':_0x394a38['params']['id']},'attributes':['id',_0x949d('0x2a')]})[_0x949d('0x46')](handleEntityNotFound(_0x330333,null))[_0x949d('0x46')](function(_0x26409c){if(_0x26409c){_0x316754=_0x26409c;return db[_0x949d('0x58')][_0x949d('0x5d')]({'where':{'userProfileId':_0x394a38[_0x949d('0x49')]['id'],'sectionId':_0x394a38['query'][_0x949d('0x63')]}});}})['then'](function(){return _0x316754;})[_0x949d('0x46')](respondWithStatusCode(_0x330333,null))[_0x949d('0x4c')](handleError(_0x330333,null));};exports[_0x949d('0x64')]=function(_0x510f1b,_0x4338d4){return db[_0x949d('0x44')][_0x949d('0x50')]({'where':{'id':_0x510f1b[_0x949d('0x49')]['id']}})[_0x949d('0x46')](handleEntityNotFound(_0x4338d4,null))[_0x949d('0x46')](function(_0x49fbdc){if(_0x49fbdc){return db['sequelize']['transaction'](function(_0x4a07e1){return db['UserProfileSection'][_0x949d('0x47')]({'where':{'userProfileId':_0x510f1b[_0x949d('0x49')]['id']},'attributes':['id'],'raw':!![]})[_0x949d('0x46')](function(_0x48c449){if(_0x48c449){return db[_0x949d('0x58')][_0x949d('0x5d')]({'where':{'userProfileId':_0x510f1b['params']['id'],'id':_['map'](_0x48c449,function(_0xd9f6b3){return _0xd9f6b3['id'];})},'transaction':_0x4a07e1});}})[_0x949d('0x46')](function(_0x57a4ac){var _0x10223a=_[_0x949d('0x3e')](_0x510f1b[_0x949d('0x4e')],function(_0x26e718){_0x26e718[_0x949d('0x65')]=_0x510f1b['params']['id'];return _0x26e718;});return db[_0x949d('0x58')]['bulkCreate'](_0x10223a,{'raw':!![],'transaction':_0x4a07e1});})[_0x949d('0x46')](function(_0x2cf862){var _0x270b3a=_[_0x949d('0x3c')](_['map'](_0x2cf862,function(_0x32c7db){return _0x32c7db[_0x949d('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x270b3a){return db[_0x949d('0x58')][_0x949d('0x47')]({'where':{'userProfileId':_0x510f1b[_0x949d('0x49')]['id'],'sectionId':_[_0x949d('0x3e')](_0x270b3a,function(_0x1f0f87){return _0x1f0f87[_0x949d('0x60')];})},'attributes':['id',_0x949d('0x60')],'raw':!![]})[_0x949d('0x46')](function(_0x397717){var _0x3c8dca=_['map'](_0x510f1b[_0x949d('0x4e')],function(_0x35ea2e){_0x35ea2e[_0x949d('0x65')]=_0x510f1b[_0x949d('0x49')]['id'];return _0x35ea2e;});return db[_0x949d('0x5b')]['bulkCreate'](_0x3c8dca,{'raw':!![],'transaction':_0x4a07e1});});}})[_0x949d('0x4c')](handleError(_0x4338d4,null));});}})[_0x949d('0x46')](function(_0x26e488){var _0xbf2e70=_[_0x949d('0x3e')](_0x26e488,function(_0x37a791){return _0x37a791['get']({'plain':!![]});});})[_0x949d('0x46')](respondWithResult(_0x4338d4,null))['catch'](handleError(_0x4338d4,null));};exports['removeResources']=function(_0x416973,_0xda5750,_0xa858bf){return db['UserProfile'][_0x949d('0x50')]({'where':{'id':_0x416973[_0x949d('0x49')]['id']}})[_0x949d('0x46')](handleEntityNotFound(_0xda5750,null))[_0x949d('0x46')](function(_0x51f622){if(_0x51f622){return _0x51f622[_0x949d('0x66')](_0x416973[_0x949d('0x30')][_0x949d('0x63')]);}})['then'](respondWithStatusCode(_0xda5750,null))[_0x949d('0x4c')](handleError(_0xda5750,null));};exports[_0x949d('0x67')]=function(_0xeed998,_0x4d54ea){var _0x2acbae={'raw':![],'where':{}};var _0x1e947e={};var _0x41f0c3={'count':0x0,'rows':[]};var _0x262451=_0xeed998[_0x949d('0x30')][_0x949d('0x68')];if(typeof _0x262451==='undefined'){throw new db[(_0x949d('0x69'))]['ValidationError'](_0x949d('0x6a'));}var _0x411843=_0xeed998[_0x949d('0x30')][_0x949d('0x6b')]||![];var _0x434789=getQueryModels(_0x262451,_0x411843);if(typeof _0x434789['childModel']==='undefined'){throw new db[(_0x949d('0x69'))]['ValidationError']('Invalid\x20section\x20\x27'+_0x262451+'\x27');}var _0xcf09e2=[];if(!_['isEmpty'](_0x434789['parentSections'])){_0xcf09e2=_0x434789[_0x949d('0x6c')];}else{_0xcf09e2=[{'name':_0x262451}];}return db['UserProfile'][_0x949d('0x6d')]({'where':{'id':_0xeed998[_0x949d('0x49')]['id']}})['then'](handleEntityNotFound(_0x4d54ea,null))['then'](function(_0x335aac){if(_0x335aac){var _0x8cd26d=[];for(var _0x2b13a8=0x0;_0x2b13a8<_0xcf09e2['length'];_0x2b13a8++){_0x8cd26d[_0x949d('0x61')](db[_0x949d('0x58')]['findOne']({'where':{'userProfileId':_0x335aac['id'],'name':_0xcf09e2[_0x2b13a8]['name']},'raw':!![]}));}return BPromise[_0x949d('0x6e')](_0x8cd26d);}})[_0x949d('0x46')](function(_0x4a7fbf){var _0x4fa7a6=_[_0x949d('0x3c')](_0x4a7fbf,function(_0x4860fe){return _0x4860fe?_0x4860fe:undefined;});var _0x465e7d=_['filter'](_0xcf09e2,[_0x949d('0x6f'),!![]]);var _0x591f47=_['isEmpty'](_0x4fa7a6)&&_[_0x949d('0x70')](_0x465e7d)?null:_[_0x949d('0x71')](_0x465e7d,_0x4fa7a6);if(_0x591f47){var _0x27c21a=[];for(var _0x4366e1=0x0;_0x4366e1<_0x591f47[_0x949d('0x35')];_0x4366e1++){var _0x3b5613=_['find'](_0xcf09e2,function(_0x16888f){return _0x591f47[_0x4366e1]?_0x16888f[_0x949d('0x2a')]===_0x591f47[_0x4366e1][_0x949d('0x2a')]:null;});if(_0x3b5613){if(_0x591f47[_0x4366e1][_0x949d('0x6f')]){_0x27c21a[_0x949d('0x61')](getAllResources(_0x434789[_0x949d('0x72')],_0x591f47[_0x4366e1]));}else{if(!_0x591f47[_0x4366e1]['autoAssociation']){_0x27c21a[_0x949d('0x61')](getAllowedResources(_0x3b5613,_0x591f47[_0x4366e1],_0x434789['childModel']));}else{if(_0x3b5613['model']){_0x27c21a[_0x949d('0x61')](getAllFilteredResources(_0x3b5613,_0x591f47[_0x4366e1]));}}}}}return BPromise[_0x949d('0x6e')](_0x27c21a);}else{return null;}})[_0x949d('0x46')](function(_0x1ab7e7){var _0x29d075=_0x1ab7e7;var _0xeb9b62=null;if(_0x29d075){_0xeb9b62=_0x29d075[_0x949d('0x35')]===0x1?_0x29d075[0x0]:null;}if(_0xeb9b62||_0x29d075){var _0x3b770c=db[_0x434789[_0x949d('0x72')]][_0x949d('0x2d')];_0x1e947e[_0x949d('0x2e')]=_[_0x949d('0x2f')](_0x3b770c);_0x1e947e[_0x949d('0x30')]=_['keys'](_0xeed998[_0x949d('0x30')]);_0x1e947e[_0x949d('0x31')]=_['intersection'](_0x1e947e[_0x949d('0x2e')],_0x1e947e[_0x949d('0x30')]);_0x2acbae[_0x949d('0x33')]=_[_0x949d('0x32')](_0x1e947e['model'],qs['fields'](_0xeed998['query'][_0x949d('0x34')]));_0x2acbae[_0x949d('0x33')]=_0x2acbae[_0x949d('0x33')][_0x949d('0x35')]?_0x2acbae[_0x949d('0x33')]:_0x1e947e[_0x949d('0x2e')];if(!_0xeed998[_0x949d('0x30')][_0x949d('0x36')]('nolimit')){_0x2acbae['limit']=qs[_0x949d('0x22')](_0xeed998[_0x949d('0x30')][_0x949d('0x22')]);_0x2acbae[_0x949d('0x21')]=qs['offset'](_0xeed998[_0x949d('0x30')][_0x949d('0x21')]);}_0x2acbae[_0x949d('0x38')]=qs[_0x949d('0x39')](_0xeed998[_0x949d('0x30')][_0x949d('0x39')]);_0x2acbae[_0x949d('0x3a')]=qs[_0x949d('0x31')](_['pick'](_0xeed998[_0x949d('0x30')],_0x1e947e[_0x949d('0x31')]));if(_0xeed998['query'][_0x949d('0x3c')]){_0x2acbae[_0x949d('0x3a')]=_['merge'](_0x2acbae[_0x949d('0x3a')],{'$or':_[_0x949d('0x3e')](_0x3b770c,function(_0x55b94f){if(_0x55b94f[_0x949d('0x3f')][_0x949d('0x40')]!==_0x949d('0x41')){var _0x424a70={};_0x424a70[_0x55b94f['field']]={'$like':'%'+_0xeed998[_0x949d('0x30')][_0x949d('0x3c')]+'%'};return _0x424a70;}})});}var _0x31ac1e=[];if(_0xeb9b62){var _0x1211b0=_[_0x949d('0x50')](_0xcf09e2,[_0x949d('0x2a'),_0xeb9b62[_0x949d('0x2a')]]);if(_0x1211b0[_0x949d('0x42')]){var _0x5d55ce={};if(_0x434789[_0x949d('0x72')]==='AnalyticExtractedReport'){_0x5d55ce[_0x1211b0[_0x949d('0x73')]]=_['map'](_0xeb9b62['associatedResources'],'id');}else{_0x5d55ce[_0x1211b0[_0x949d('0x73')]]=_0xeb9b62[_0x949d('0x74')];}_0x31ac1e['push'](_0x5d55ce);}else{_0x2acbae['where']['id']=_0xeb9b62['associatedResources'];}}else{for(var _0x4e0bd6=0x0;_0x4e0bd6<_0x29d075[_0x949d('0x35')];_0x4e0bd6++){var _0x1211b0=_[_0x949d('0x50')](_0xcf09e2,[_0x949d('0x2a'),_0x29d075[_0x4e0bd6]['name']]);if(_0x1211b0[_0x949d('0x42')]){var _0x5d55ce={};_0x5d55ce[_0x1211b0[_0x949d('0x73')]]=_0x29d075[_0x4e0bd6][_0x949d('0x74')];_0x31ac1e[_0x949d('0x61')](_0x5d55ce);}else{if(!_0x2acbae[_0x949d('0x3a')]['id'])_0x2acbae[_0x949d('0x3a')]['id']=[];_0x29d075[_0x4e0bd6][_0x949d('0x74')]['forEach'](function(_0x292e02){_0x2acbae[_0x949d('0x3a')]['id']['push'](_0x292e02);});}}}if(!_[_0x949d('0x70')](_0x31ac1e)){_0x2acbae['where']=_[_0x949d('0x3d')](_0x2acbae['where'],{'$and':{'$or':_0x31ac1e}});}_0x2acbae=_['merge']({},_0x2acbae,_0xeed998[_0x949d('0x43')]);if(_0xeb9b62&&!_0xeb9b62[_0x949d('0x5a')]&&_0x434789['childModel']==='AnalyticExtractedReport'){if(_0xeed998[_0x949d('0x30')][_0x949d('0x4a')]){_0x2acbae[_0x949d('0x4b')]=[{'all':!![]}];}return db[_0x434789[_0x949d('0x72')]][_0x949d('0x47')](_0x2acbae)[_0x949d('0x46')](function(_0x595f58){var _0x106a79=[];_0x595f58[_0x949d('0x75')](function(_0x35b185){var _0x41fb1d;switch(_0x35b185[_0x949d('0x76')]){case'default':_0x41fb1d=_[_0x949d('0x50')](_0xeb9b62[_0x949d('0x74')],function(_0x82819f){return _0x82819f['id']===_0x35b185[_0x949d('0x77')]&&_0x82819f[_0x949d('0x3f')]===_0x949d('0x78');});break;case _0x949d('0x79'):_0x41fb1d=_[_0x949d('0x50')](_0xeb9b62[_0x949d('0x74')],function(_0x2ecc83){return _0x2ecc83['id']===_0x35b185[_0x949d('0x77')]&&_0x2ecc83[_0x949d('0x3f')]===_0x949d('0x7a');});break;}if(_0x41fb1d)_0x106a79[_0x949d('0x61')](_0x35b185);});_0x41f0c3[_0x949d('0x45')]=_0x106a79[_0x949d('0x35')];_0x41f0c3[_0x949d('0x48')]=_0x106a79;return _0x41f0c3;});}else{return db[_0x434789['childModel']][_0x949d('0x45')]({'where':_0x2acbae['where']})[_0x949d('0x46')](function(_0x5d4216){_0x41f0c3[_0x949d('0x45')]=_0x5d4216;if(_0xeed998[_0x949d('0x30')][_0x949d('0x4a')]){if(_0x434789[_0x949d('0x72')]===_0x949d('0x7b')){_0x2acbae['include']=[{'model':db[_0x949d('0x7c')],'as':_0x949d('0x7d'),'attributes':['id',_0x949d('0x2a'),_0x949d('0x7e')],'required':_0xeed998[_0x949d('0x30')][_0x949d('0x7f')]?!![]:![]},{'model':db[_0x949d('0x7c')],'as':_0x949d('0x80'),'attributes':['id',_0x949d('0x2a'),_0x949d('0x7e')],'through':_0xeed998[_0x949d('0x30')][_0x949d('0x7f')]?{'attributes':[],'where':{'TagId':_0xeed998[_0x949d('0x30')][_0x949d('0x7f')]||undefined}}:{},'required':_0xeed998[_0x949d('0x30')][_0x949d('0x7f')]?!![]:![]}];}else{_0x2acbae[_0x949d('0x4b')]=[{'all':!![]}];}}return db[_0x434789[_0x949d('0x72')]][_0x949d('0x47')](_0x2acbae);})[_0x949d('0x46')](function(_0x3b3293){_0x41f0c3[_0x949d('0x48')]=_0x3b3293;return _0x41f0c3;});}}else{return _0x41f0c3;}})[_0x949d('0x46')](respondWithFilteredResult(_0x4d54ea,_0x2acbae))['catch'](handleError(_0x4d54ea,null));};function getAllResources(_0x3e1472,_0x17cb55){return new BPromise(function(_0x561a4a,_0x34a437){if(_0x17cb55){var _0x11ea22=_0x17cb55[_0x949d('0x3c')]?{[_0x17cb55[_0x949d('0x3c')][_0x949d('0x42')]]:_0x17cb55[_0x949d('0x3c')][_0x949d('0x81')]}:undefined;return db[_0x3e1472][_0x949d('0x47')]({'where':_0x11ea22,'raw':!![]})[_0x949d('0x46')](function(_0x43ed82){_0x17cb55[_0x949d('0x74')]=_[_0x949d('0x3e')](_0x43ed82,'id');_0x561a4a(_0x17cb55);})[_0x949d('0x4c')](function(_0x2a2774){_0x34a437(_0x2a2774);});}else{_0x561a4a(null);}});}function getAllFilteredResources(_0x3a816b,_0x4994b2){return new BPromise(function(_0x151f97,_0x338bbe){var _0x25f96a=_0x3a816b[_0x949d('0x3c')]?{[_0x3a816b[_0x949d('0x3c')][_0x949d('0x42')]]:_0x3a816b[_0x949d('0x3c')][_0x949d('0x81')]}:undefined;return db[_0x3a816b[_0x949d('0x2e')]][_0x949d('0x47')]({'where':_0x25f96a,'raw':!![]})[_0x949d('0x46')](function(_0x703887){_0x4994b2[_0x949d('0x74')]=_[_0x949d('0x3e')](_0x703887,function(_0x554a21){return _0x554a21[_0x949d('0x2a')];});_0x151f97(_0x4994b2);})['catch'](function(_0x51d294){_0x338bbe(_0x51d294);});});}function getAllowedResources(_0x5f901,_0xeef98f,_0x2835bc){return new BPromise(function(_0x53595f,_0x7b5834){if(_0xeef98f){return db[_0x949d('0x5b')][_0x949d('0x47')]({'where':{'sectionId':_0xeef98f['id']},'raw':!![]})['then'](function(_0x9d0192){if(_0x5f901[_0x949d('0x42')]&&_0x5f901['field']!=='id'){_0xeef98f['associatedResources']=_[_0x949d('0x3e')](_0x9d0192,function(_0x366789){return _0x366789[_0x5f901[_0x949d('0x42')]];});}else{if(_0x2835bc===_0x949d('0x82')){_0xeef98f[_0x949d('0x74')]=_[_0x949d('0x3e')](_0x9d0192,function(_0x56b3ec){return{'id':_0x56b3ec[_0x949d('0x83')],'type':_0x56b3ec[_0x949d('0x3f')]};});}else{_0xeef98f['associatedResources']=_[_0x949d('0x3e')](_0x9d0192,function(_0x47666f){return _0x47666f['resourceId'];});}}_0x53595f(_0xeef98f);})[_0x949d('0x4c')](function(_0x29e16d){_0x7b5834(_0x29e16d);});}else{_0x53595f(null);}});}function getQueryModels(_0x39fc9c,_0x317700){var _0x557f17=_0x39fc9c['toLowerCase']();var _0x21ad16={'childModel':undefined,'parentSections':[]};switch(_0x557f17){case _0x949d('0x84'):_0x21ad16['childModel']='SquareProject';break;case _0x949d('0x85'):_0x21ad16[_0x949d('0x72')]=_0x949d('0x86');break;case _0x949d('0x87'):_0x21ad16[_0x949d('0x72')]=_0x949d('0x88');_0x21ad16['parentSections']=[{'name':'SquareProjects','field':_0x949d('0x2a'),'foreignKey':_0x949d('0x89')}];break;case _0x949d('0x8a'):_0x21ad16[_0x949d('0x72')]=_0x949d('0x8b');break;case _0x949d('0x8c'):_0x21ad16['childModel']=_0x949d('0x7b');_0x21ad16[_0x949d('0x6c')]=[{'name':'Lists','field':'id','foreignKey':_0x949d('0x8d')}];break;case _0x949d('0x8e'):_0x21ad16[_0x949d('0x72')]=_0x949d('0x8f');break;case _0x949d('0x90'):_0x21ad16[_0x949d('0x72')]=_0x949d('0x91');break;case'globalcustomfields':_0x21ad16[_0x949d('0x72')]=_0x949d('0x92');break;case _0x949d('0x93'):_0x21ad16[_0x949d('0x72')]=_0x949d('0x94');break;case _0x949d('0x95'):_0x21ad16[_0x949d('0x72')]=_0x949d('0x96');break;case _0x949d('0x97'):_0x21ad16[_0x949d('0x72')]=_0x949d('0x98');break;case _0x949d('0x99'):_0x21ad16['childModel']='FaxAccount';break;case _0x949d('0x9a'):case'internalroutes':case'outboundroutes':_0x21ad16['childModel']=_0x949d('0x9b');break;case _0x949d('0x9c'):_0x21ad16['childModel']=_0x949d('0x9d');break;case'voicemails':_0x21ad16[_0x949d('0x72')]='VoiceMail';break;case _0x949d('0x9e'):_0x21ad16[_0x949d('0x72')]=_0x949d('0x9f');_0x21ad16[_0x949d('0x6c')]=[{'name':'Agents','field':_0x949d('0x2a'),'foreignKey':_0x949d('0xa0'),'model':'User','filter':{'field':_0x949d('0xa1'),'value':['agent']}},{'name':_0x949d('0xa2'),'field':_0x949d('0x2a'),'foreignKey':_0x949d('0xa0'),'model':'User','filter':{'field':_0x949d('0xa1'),'value':[_0x949d('0xa3')]}},{'name':_0x949d('0xa4'),'field':_0x949d('0x2a'),'foreignKey':_0x949d('0xa5'),'model':_0x949d('0xa6'),'filter':{'field':'type','value':[_0x949d('0xa7')]}},{'name':_0x949d('0xa8'),'field':_0x949d('0x2a'),'foreignKey':_0x949d('0xa5'),'model':_0x949d('0xa6'),'filter':{'field':_0x949d('0x3f'),'value':[_0x949d('0xa9')]}}];break;case _0x949d('0xaa'):_0x21ad16[_0x949d('0x72')]=_0x949d('0xab');break;case'chanspies':_0x21ad16[_0x949d('0x72')]=_0x949d('0xac');break;case'voiceprefixes':_0x21ad16[_0x949d('0x72')]=_0x949d('0xad');break;case _0x949d('0xae'):_0x21ad16['childModel']='Campaign';break;case _0x949d('0xaf'):_0x21ad16[_0x949d('0x72')]=_0x949d('0xb0');break;case _0x949d('0xb1'):_0x21ad16[_0x949d('0x72')]=_0x949d('0xb2');break;case'mailsubstatuses':_0x21ad16[_0x949d('0x72')]=_0x949d('0xb3');break;case _0x949d('0xb4'):_0x21ad16[_0x949d('0x72')]=_0x949d('0xb5');break;case _0x949d('0xb6'):_0x21ad16['childModel']='OpenchannelAccount';break;case _0x949d('0xb7'):_0x21ad16[_0x949d('0x72')]=_0x949d('0xb8');break;case _0x949d('0xb9'):_0x21ad16[_0x949d('0x72')]=_0x949d('0xba');break;case _0x949d('0xbb'):_0x21ad16['childModel']=_0x949d('0xbc');break;case'voicequeues':case _0x949d('0xbd'):_0x21ad16[_0x949d('0x72')]='VoiceQueue';if(_0x317700){_0x21ad16[_0x949d('0x6c')]=[{'name':'VoiceQueues'},{'name':_0x949d('0xa8')}];}break;case'users':case _0x949d('0xbe'):case _0x949d('0xbf'):_0x21ad16[_0x949d('0x72')]='User';if(_0x317700){_0x21ad16['parentSections']=[{'name':_0x949d('0xc0'),'filter':{'field':_0x949d('0xa1'),'value':[_0x949d('0xc1'),_0x949d('0xc2')]},'ignore':!![]},{'name':_0x949d('0xc3')},{'name':_0x949d('0xa2')}];}break;case _0x949d('0xc4'):_0x21ad16['childModel']='ZendeskAccount';break;case _0x949d('0xc5'):_0x21ad16[_0x949d('0x72')]=_0x949d('0xc6');break;case _0x949d('0xc7'):_0x21ad16[_0x949d('0x72')]=_0x949d('0xc8');break;case _0x949d('0xc9'):_0x21ad16[_0x949d('0x72')]=_0x949d('0xca');break;case _0x949d('0xcb'):_0x21ad16[_0x949d('0x72')]='DeskAccount';break;case _0x949d('0xcc'):_0x21ad16['childModel']=_0x949d('0xcd');break;case _0x949d('0xce'):_0x21ad16[_0x949d('0x72')]=_0x949d('0xcf');break;case _0x949d('0xd0'):_0x21ad16[_0x949d('0x72')]=_0x949d('0xd1');break;case'dispositions':_0x21ad16[_0x949d('0x72')]='Disposition';break;case _0x949d('0xd2'):_0x21ad16['childModel']=_0x949d('0xd3');break;case _0x949d('0xd4'):_0x21ad16[_0x949d('0x72')]=_0x949d('0xd5');break;case _0x949d('0xd6'):_0x21ad16[_0x949d('0x72')]=_0x949d('0xd7');break;case'scheduler':_0x21ad16['childModel']=_0x949d('0xd8');break;case _0x949d('0xd9'):_0x21ad16['childModel']=_0x949d('0xda');break;case _0x949d('0xdb'):_0x21ad16[_0x949d('0x72')]='Tag';break;case _0x949d('0xdc'):_0x21ad16[_0x949d('0x72')]=_0x949d('0xdd');break;case _0x949d('0xde'):_0x21ad16[_0x949d('0x72')]=_0x949d('0xdf');break;case _0x949d('0xe0'):_0x21ad16['childModel']=_0x949d('0xe1');break;case _0x949d('0xe2'):_0x21ad16[_0x949d('0x72')]=_0x949d('0xe3');break;case _0x949d('0xe4'):_0x21ad16[_0x949d('0x72')]='Plugin';break;case _0x949d('0xe5'):_0x21ad16['childModel']=_0x949d('0x82');_0x21ad16['parentSections']=[{'name':'Reports','field':'id','foreignKey':_0x949d('0x77')}];break;case _0x949d('0xe6'):_0x21ad16[_0x949d('0x72')]=_0x949d('0xe7');break;case'saproducts':_0x21ad16[_0x949d('0x72')]=_0x949d('0xe8');break;case _0x949d('0xe9'):_0x21ad16[_0x949d('0x72')]=_0x949d('0xea');break;case _0x949d('0xeb'):_0x21ad16['childModel']=_0x949d('0xec');break;default:return _0x21ad16;}return _0x21ad16;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 898e392..fd98c1c 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 _0x02e7=['update','remove','emit','hasOwnProperty','hook','exports','events','UserProfile','setMaxListeners','save'];(function(_0x26ac31,_0x13d398){var _0x451d18=function(_0x34c062){while(--_0x34c062){_0x26ac31['push'](_0x26ac31['shift']());}};_0x451d18(++_0x13d398);}(_0x02e7,0x146));var _0x702e=function(_0x2cae48,_0x2c2ed7){_0x2cae48=_0x2cae48-0x0;var _0x1c3824=_0x02e7[_0x2cae48];return _0x1c3824;};'use strict';var EventEmitter=require(_0x702e('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x702e('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x702e('0x2')](0x0);var events={'afterCreate':_0x702e('0x3'),'afterUpdate':_0x702e('0x4'),'afterDestroy':_0x702e('0x5')};function emitEvent(_0x2db323){return function(_0x440f15,_0x25cdeb,_0x14e1fc){UserProfileEvents[_0x702e('0x6')](_0x2db323+':'+_0x440f15['id'],_0x440f15);UserProfileEvents[_0x702e('0x6')](_0x2db323,_0x440f15);_0x14e1fc(null);};}for(var e in events){if(events[_0x702e('0x7')](e)){var event=events[e];UserProfile[_0x702e('0x8')](e,emitEvent(event));}}module[_0x702e('0x9')]=UserProfileEvents; \ No newline at end of file +var _0x41b8=['events','../../mysqldb','UserProfile','setMaxListeners','save','update','emit','hook','exports'];(function(_0x3add96,_0x1e76f8){var _0x2f43fb=function(_0x178048){while(--_0x178048){_0x3add96['push'](_0x3add96['shift']());}};_0x2f43fb(++_0x1e76f8);}(_0x41b8,0xc6));var _0x841b=function(_0x5597a4,_0x161921){_0x5597a4=_0x5597a4-0x0;var _0x26ed19=_0x41b8[_0x5597a4];return _0x26ed19;};'use strict';var EventEmitter=require(_0x841b('0x0'));var UserProfile=require(_0x841b('0x1'))['db'][_0x841b('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x841b('0x3')](0x0);var events={'afterCreate':_0x841b('0x4'),'afterUpdate':_0x841b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x57a1ab){return function(_0x3cd185,_0x1a9f8c,_0x4752e4){UserProfileEvents['emit'](_0x57a1ab+':'+_0x3cd185['id'],_0x3cd185);UserProfileEvents[_0x841b('0x6')](_0x57a1ab,_0x3cd185);_0x4752e4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x841b('0x7')](e,emitEvent(event));}}module[_0x841b('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 91bcf68..ffa19bd 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 _0xa098=['define','UserProfile','user_profiles','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./userProfile.attributes','exports'];(function(_0x36434c,_0x37dd8b){var _0x435666=function(_0x47407c){while(--_0x47407c){_0x36434c['push'](_0x36434c['shift']());}};_0x435666(++_0x37dd8b);}(_0xa098,0x87));var _0x8a09=function(_0x3bed3f,_0x539f01){_0x3bed3f=_0x3bed3f-0x0;var _0x4c9dbd=_0xa098[_0x3bed3f];return _0x4c9dbd;};'use strict';var _=require(_0x8a09('0x0'));var util=require('util');var logger=require(_0x8a09('0x1'))(_0x8a09('0x2'));var moment=require('moment');var BPromise=require(_0x8a09('0x3'));var rp=require(_0x8a09('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8a09('0x5'));var config=require(_0x8a09('0x6'));var attributes=require(_0x8a09('0x7'));module[_0x8a09('0x8')]=function(_0x51622c,_0xbaeb3c){return _0x51622c[_0x8a09('0x9')](_0x8a09('0xa'),attributes,{'tableName':_0x8a09('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe73e=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfile.attributes','UserProfile','user_profiles','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe73e,0x137));var _0xee73=function(_0x3e15d8,_0x33c13e){_0x3e15d8=_0x3e15d8-0x0;var _0x54ff22=_0xe73e[_0x3e15d8];return _0x54ff22;};'use strict';var _=require('lodash');var util=require(_0xee73('0x0'));var logger=require(_0xee73('0x1'))(_0xee73('0x2'));var moment=require(_0xee73('0x3'));var BPromise=require(_0xee73('0x4'));var rp=require(_0xee73('0x5'));var fs=require('fs');var path=require(_0xee73('0x6'));var rimraf=require(_0xee73('0x7'));var config=require(_0xee73('0x8'));var attributes=require(_0xee73('0x9'));module['exports']=function(_0x545f2c,_0x5e1cb7){return _0x545f2c['define'](_0xee73('0xa'),attributes,{'tableName':_0xee73('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 8404c99..fe07169 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 _0xb8d3=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2f41dd,_0x5bd3a1){var _0x3b377d=function(_0x3bd677){while(--_0x3bd677){_0x2f41dd['push'](_0x2f41dd['shift']());}};_0x3b377d(++_0x5bd3a1);}(_0xb8d3,0x139));var _0x3b8d=function(_0x42c118,_0x197006){_0x42c118=_0x42c118-0x0;var _0x112ebd=_0xb8d3[_0x42c118];return _0x112ebd;};'use strict';var _=require(_0x3b8d('0x0'));var util=require(_0x3b8d('0x1'));var moment=require(_0x3b8d('0x2'));var BPromise=require(_0x3b8d('0x3'));var rs=require(_0x3b8d('0x4'));var fs=require('fs');var Redis=require(_0x3b8d('0x5'));var db=require(_0x3b8d('0x6'))['db'];var utils=require(_0x3b8d('0x7'));var logger=require(_0x3b8d('0x8'))(_0x3b8d('0x9'));var config=require(_0x3b8d('0xa'));var jayson=require(_0x3b8d('0xb'));var client=jayson[_0x3b8d('0xc')][_0x3b8d('0xd')]({'port':0x232a});config[_0x3b8d('0xe')]=_[_0x3b8d('0xf')](config[_0x3b8d('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b8d('0xe')]));require(_0x3b8d('0x10'))[_0x3b8d('0x11')](socket);function respondWithRpcPromise(_0x43d50e,_0x56d8bc,_0x5abd2c){return new BPromise(function(_0x1f04a7,_0x23c9b1){return client[_0x3b8d('0x12')](_0x43d50e,_0x5abd2c)[_0x3b8d('0x13')](function(_0x4f6009){logger['info'](_0x3b8d('0x14'),_0x56d8bc,_0x3b8d('0x15'));logger[_0x3b8d('0x16')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x56d8bc,_0x3b8d('0x15'),JSON[_0x3b8d('0x17')](_0x4f6009));if(_0x4f6009[_0x3b8d('0x18')]){if(_0x4f6009[_0x3b8d('0x18')]['code']===0x1f4){logger['error'](_0x3b8d('0x14'),_0x56d8bc,_0x4f6009[_0x3b8d('0x18')][_0x3b8d('0x19')]);return _0x23c9b1(_0x4f6009[_0x3b8d('0x18')][_0x3b8d('0x19')]);}logger['error'](_0x3b8d('0x14'),_0x56d8bc,_0x4f6009[_0x3b8d('0x18')][_0x3b8d('0x19')]);return _0x1f04a7(_0x4f6009[_0x3b8d('0x18')][_0x3b8d('0x19')]);}else{logger[_0x3b8d('0x1a')]('UserProfile,\x20%s,\x20%s',_0x56d8bc,_0x3b8d('0x15'));_0x1f04a7(_0x4f6009[_0x3b8d('0x1b')][_0x3b8d('0x19')]);}})[_0x3b8d('0x1c')](function(_0x707ac9){logger[_0x3b8d('0x18')]('UserProfile,\x20%s,\x20%s',_0x56d8bc,_0x707ac9);_0x23c9b1(_0x707ac9);});});} \ No newline at end of file +var _0x7c42=['UserProfile,\x20%s,\x20%s','message','info','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','then','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x484312,_0x5a0a77){var _0x6ba7b4=function(_0x1bcded){while(--_0x1bcded){_0x484312['push'](_0x484312['shift']());}};_0x6ba7b4(++_0x5a0a77);}(_0x7c42,0x18b));var _0x27c4=function(_0x412766,_0x2a55e6){_0x412766=_0x412766-0x0;var _0x8d1282=_0x7c42[_0x412766];return _0x8d1282;};'use strict';var _=require('lodash');var util=require(_0x27c4('0x0'));var moment=require(_0x27c4('0x1'));var BPromise=require(_0x27c4('0x2'));var rs=require(_0x27c4('0x3'));var fs=require('fs');var Redis=require(_0x27c4('0x4'));var db=require(_0x27c4('0x5'))['db'];var utils=require(_0x27c4('0x6'));var logger=require(_0x27c4('0x7'))(_0x27c4('0x8'));var config=require(_0x27c4('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x27c4('0xa')]({'port':0x232a});config[_0x27c4('0xb')]=_[_0x27c4('0xc')](config[_0x27c4('0xb')],{'host':_0x27c4('0xd'),'port':0x18eb});var socket=require(_0x27c4('0xe'))(new Redis(config['redis']));require(_0x27c4('0xf'))['register'](socket);function respondWithRpcPromise(_0xa5ffe4,_0x2963bf,_0x5872ce){return new BPromise(function(_0x5cea01,_0x781034){return client['request'](_0xa5ffe4,_0x5872ce)[_0x27c4('0x10')](function(_0x2d9b05){logger['info']('UserProfile,\x20%s,\x20%s',_0x2963bf,'request\x20sent');logger[_0x27c4('0x11')](_0x27c4('0x12'),_0x2963bf,'request\x20sent',JSON['stringify'](_0x2d9b05));if(_0x2d9b05[_0x27c4('0x13')]){if(_0x2d9b05[_0x27c4('0x13')][_0x27c4('0x14')]===0x1f4){logger['error'](_0x27c4('0x15'),_0x2963bf,_0x2d9b05[_0x27c4('0x13')][_0x27c4('0x16')]);return _0x781034(_0x2d9b05['error'][_0x27c4('0x16')]);}logger[_0x27c4('0x13')]('UserProfile,\x20%s,\x20%s',_0x2963bf,_0x2d9b05['error'][_0x27c4('0x16')]);return _0x5cea01(_0x2d9b05[_0x27c4('0x13')]['message']);}else{logger[_0x27c4('0x17')]('UserProfile,\x20%s,\x20%s',_0x2963bf,_0x27c4('0x18'));_0x5cea01(_0x2d9b05['result'][_0x27c4('0x16')]);}})[_0x27c4('0x19')](function(_0x326174){logger[_0x27c4('0x13')](_0x27c4('0x15'),_0x2963bf,_0x326174);_0x781034(_0x326174);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 5ae78e7..9e23eaa 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 _0x7c49=['save','emit','removeListener','register','length','userProfile:','./userProfile.events'];(function(_0x3d69b8,_0x53e6ff){var _0x314917=function(_0x3c4fca){while(--_0x3c4fca){_0x3d69b8['push'](_0x3d69b8['shift']());}};_0x314917(++_0x53e6ff);}(_0x7c49,0x141));var _0x97c4=function(_0x1928b0,_0x376040){_0x1928b0=_0x1928b0-0x0;var _0x259304=_0x7c49[_0x1928b0];return _0x259304;};'use strict';var UserProfileEvents=require(_0x97c4('0x0'));var events=[_0x97c4('0x1'),'remove','update'];function createListener(_0x3205fc,_0x47910d){return function(_0x14b5e5){_0x47910d[_0x97c4('0x2')](_0x3205fc,_0x14b5e5);};}function removeListener(_0x5e3808,_0x596686){return function(){UserProfileEvents[_0x97c4('0x3')](_0x5e3808,_0x596686);};}exports[_0x97c4('0x4')]=function(_0x2f02ec){for(var _0x538c14=0x0,_0x249c86=events[_0x97c4('0x5')];_0x538c14<_0x249c86;_0x538c14++){var _0x585222=events[_0x538c14];var _0x373855=createListener(_0x97c4('0x6')+_0x585222,_0x2f02ec);UserProfileEvents['on'](_0x585222,_0x373855);}}; \ No newline at end of file +var _0x3561=['userProfile:','./userProfile.events','remove','update','emit','removeListener','register'];(function(_0x2bcc37,_0x515bf4){var _0x4ee193=function(_0x2c0459){while(--_0x2c0459){_0x2bcc37['push'](_0x2bcc37['shift']());}};_0x4ee193(++_0x515bf4);}(_0x3561,0x94));var _0x1356=function(_0x528329,_0xd5138b){_0x528329=_0x528329-0x0;var _0x4ede82=_0x3561[_0x528329];return _0x4ede82;};'use strict';var UserProfileEvents=require(_0x1356('0x0'));var events=['save',_0x1356('0x1'),_0x1356('0x2')];function createListener(_0x8ef5f,_0x14465e){return function(_0x442fbc){_0x14465e[_0x1356('0x3')](_0x8ef5f,_0x442fbc);};}function removeListener(_0x1634de,_0x116ff0){return function(){UserProfileEvents[_0x1356('0x4')](_0x1634de,_0x116ff0);};}exports[_0x1356('0x5')]=function(_0x417d11){for(var _0x36e81f=0x0,_0x45ac56=events['length'];_0x36e81f<_0x45ac56;_0x36e81f++){var _0x105aaf=events[_0x36e81f];var _0x33529f=createListener(_0x1356('0x6')+_0x105aaf,_0x417d11);UserProfileEvents['on'](_0x105aaf,_0x33529f);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index ed151d7..b9e1c15 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 _0xdf4d=['./userProfileResource.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x527aeb,_0x25e12b){var _0xa55860=function(_0x55766e){while(--_0x55766e){_0x527aeb['push'](_0x527aeb['shift']());}};_0xa55860(++_0x25e12b);}(_0xdf4d,0xcb));var _0xddf4=function(_0x42cd95,_0x3128e3){_0x42cd95=_0x42cd95-0x0;var _0x2c503b=_0xdf4d[_0x42cd95];return _0x2c503b;};'use strict';var multer=require('multer');var util=require(_0xddf4('0x0'));var path=require(_0xddf4('0x1'));var timeout=require('connect-timeout');var express=require(_0xddf4('0x2'));var router=express[_0xddf4('0x3')]();var auth=require(_0xddf4('0x4'));var interaction=require(_0xddf4('0x5'));var config=require(_0xddf4('0x6'));var controller=require(_0xddf4('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xddf4('0x8')]);router[_0xddf4('0x9')](_0xddf4('0xa'),auth[_0xddf4('0xb')](),controller[_0xddf4('0xc')]);router[_0xddf4('0x9')](_0xddf4('0xd'),auth[_0xddf4('0xb')](),controller[_0xddf4('0xe')]);router[_0xddf4('0xf')]('/',auth[_0xddf4('0xb')](),controller['create']);router[_0xddf4('0x10')]('/:id',auth[_0xddf4('0xb')](),controller[_0xddf4('0x11')]);router[_0xddf4('0x12')](_0xddf4('0xd'),auth['isAuthenticated'](),controller[_0xddf4('0x13')]);module[_0xddf4('0x14')]=router; \ No newline at end of file +var _0xcd6f=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','describe','isAuthenticated','post','/:id','delete','destroy','exports','multer'];(function(_0x347a4b,_0x5e492f){var _0x4273a3=function(_0x2f82ae){while(--_0x2f82ae){_0x347a4b['push'](_0x347a4b['shift']());}};_0x4273a3(++_0x5e492f);}(_0xcd6f,0x17b));var _0xfcd6=function(_0x597ba5,_0x5720f5){_0x597ba5=_0x597ba5-0x0;var _0x5d69a2=_0xcd6f[_0x597ba5];return _0x5d69a2;};'use strict';var multer=require(_0xfcd6('0x0'));var util=require(_0xfcd6('0x1'));var path=require(_0xfcd6('0x2'));var timeout=require(_0xfcd6('0x3'));var express=require(_0xfcd6('0x4'));var router=express[_0xfcd6('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xfcd6('0x6'));var config=require(_0xfcd6('0x7'));var controller=require(_0xfcd6('0x8'));router[_0xfcd6('0x9')]('/',auth['isAuthenticated'](),controller[_0xfcd6('0xa')]);router['get'](_0xfcd6('0xb'),auth['isAuthenticated'](),controller[_0xfcd6('0xc')]);router[_0xfcd6('0x9')]('/:id',auth[_0xfcd6('0xd')](),controller['show']);router[_0xfcd6('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xfcd6('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xfcd6('0x10')](_0xfcd6('0xf'),auth['isAuthenticated'](),controller[_0xfcd6('0x11')]);module[_0xfcd6('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 fc19382..a1a0b30 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 _0x39a3=['INTEGER','sequelize','exports','STRING'];(function(_0x6a627d,_0x5420ce){var _0x3002e1=function(_0x927f6b){while(--_0x927f6b){_0x6a627d['push'](_0x6a627d['shift']());}};_0x3002e1(++_0x5420ce);}(_0x39a3,0x13d));var _0x339a=function(_0x216586,_0x2e9346){_0x216586=_0x216586-0x0;var _0x2c0807=_0x39a3[_0x216586];return _0x2c0807;};'use strict';var Sequelize=require(_0x339a('0x0'));module[_0x339a('0x1')]={'name':{'type':Sequelize[_0x339a('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x339a('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x339a('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x0b6f=['STRING','exports','INTEGER'];(function(_0x5c97a7,_0x3896d6){var _0x26be80=function(_0x19ddf1){while(--_0x19ddf1){_0x5c97a7['push'](_0x5c97a7['shift']());}};_0x26be80(++_0x3896d6);}(_0x0b6f,0x169));var _0xf0b6=function(_0x4ea955,_0x1eda76){_0x4ea955=_0x4ea955-0x0;var _0x558561=_0x0b6f[_0x4ea955];return _0x558561;};'use strict';var Sequelize=require('sequelize');module[_0xf0b6('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xf0b6('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xf0b6('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 4b9bbbd..231e81b 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 _0x489d=['intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','type','key','VIRTUAL','field','include','findAll','catch','params','includeAll','options','find','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','destroy','then','end','stack','name','send','UserProfileResource','rawAttributes','model','keys','query','filters'];(function(_0x2d6836,_0x11baa8){var _0x488865=function(_0x4e7bf7){while(--_0x4e7bf7){_0x2d6836['push'](_0x2d6836['shift']());}};_0x488865(++_0x11baa8);}(_0x489d,0x127));var _0xd489=function(_0x38cd10,_0x112ac7){_0x38cd10=_0x38cd10-0x0;var _0x242bcc=_0x489d[_0x38cd10];return _0x242bcc;};'use strict';var pdf=require(_0xd489('0x0'));var emlformat=require(_0xd489('0x1'));var rimraf=require(_0xd489('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd489('0x3'));var rp=require(_0xd489('0x4'));var moment=require(_0xd489('0x5'));var BPromise=require(_0xd489('0x6'));var Mustache=require(_0xd489('0x7'));var util=require(_0xd489('0x8'));var path=require(_0xd489('0x9'));var sox=require(_0xd489('0xa'));var csv=require(_0xd489('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd489('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd489('0xd'));var deskjs=require(_0xd489('0xe'));var toCsv=require(_0xd489('0xb'));var querystring=require(_0xd489('0xf'));var Papa=require(_0xd489('0x10'));var Redis=require(_0xd489('0x11'));var authService=require(_0xd489('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd489('0x13'));var logger=require(_0xd489('0x14'))('api');var utils=require(_0xd489('0x15'));var config=require('../../config/environment');var db=require(_0xd489('0x16'))['db'];function respondWithStatusCode(_0x929eaa,_0xd67ddf){_0xd67ddf=_0xd67ddf||0xcc;return function(_0xf97ad2){if(_0xf97ad2){return _0x929eaa[_0xd489('0x17')](_0xd67ddf);}return _0x929eaa[_0xd489('0x18')](_0xd67ddf)['end']();};}function respondWithResult(_0x579c56,_0x1468de){_0x1468de=_0x1468de||0xc8;return function(_0x5aaab8){if(_0x5aaab8){return _0x579c56[_0xd489('0x18')](_0x1468de)[_0xd489('0x19')](_0x5aaab8);}};}function respondWithFilteredResult(_0x2bba3b,_0x42b230){return function(_0x384c8e){if(_0x384c8e){var _0xea076d=_0x384c8e[_0xd489('0x1a')],_0x49f3f5=_0x42b230[_0xd489('0x1b')],_0x2dedf0=_0x42b230[_0xd489('0x1b')]+_0x42b230[_0xd489('0x1c')],_0x38dc39;if(_0x2dedf0>=_0xea076d){_0x2dedf0=_0xea076d;_0x38dc39=0xc8;}else{_0x38dc39=0xce;}_0x2bba3b['status'](_0x38dc39);return _0x2bba3b[_0xd489('0x1d')](_0xd489('0x1e'),_0x49f3f5+'-'+_0x2dedf0+'/'+_0xea076d)[_0xd489('0x19')](_0x384c8e);}return null;};}function patchUpdates(_0x31bcfc){return function(_0x2ce708){try{jsonpatch[_0xd489('0x1f')](_0x2ce708,_0x31bcfc,!![]);}catch(_0x118722){return BPromise[_0xd489('0x20')](_0x118722);}return _0x2ce708['save']();};}function saveUpdates(_0xeb0b1e,_0x5b5576){return function(_0x547bb5){if(_0x547bb5){return _0x547bb5['update'](_0xeb0b1e)['then'](function(_0xb68177){return _0xb68177;});}return null;};}function removeEntity(_0x364513,_0x135b1e){return function(_0x3dfdf3){if(_0x3dfdf3){return _0x3dfdf3[_0xd489('0x21')]()[_0xd489('0x22')](function(){_0x364513[_0xd489('0x18')](0xcc)[_0xd489('0x23')]();});}};}function handleEntityNotFound(_0x45ab89,_0x205308){return function(_0x162286){if(!_0x162286){_0x45ab89[_0xd489('0x17')](0x194);}return _0x162286;};}function handleError(_0x5f4e27,_0x3520f0){_0x3520f0=_0x3520f0||0x1f4;return function(_0x385b71){logger['error'](_0x385b71[_0xd489('0x24')]);if(_0x385b71[_0xd489('0x25')]){delete _0x385b71[_0xd489('0x25')];}_0x5f4e27[_0xd489('0x18')](_0x3520f0)[_0xd489('0x26')](_0x385b71);};}exports['index']=function(_0x281e19,_0x3a05f2){var _0x5ddabf={},_0x1b1c76={},_0xe17896={'count':0x0,'rows':[]};var _0x41ba2f=db[_0xd489('0x27')][_0xd489('0x28')];_0x1b1c76[_0xd489('0x29')]=_[_0xd489('0x2a')](_0x41ba2f);_0x1b1c76[_0xd489('0x2b')]=_['keys'](_0x281e19[_0xd489('0x2b')]);_0x1b1c76[_0xd489('0x2c')]=_[_0xd489('0x2d')](_0x1b1c76[_0xd489('0x29')],_0x1b1c76[_0xd489('0x2b')]);_0x5ddabf['attributes']=_[_0xd489('0x2d')](_0x1b1c76['model'],qs['fields'](_0x281e19['query'][_0xd489('0x2e')]));_0x5ddabf[_0xd489('0x2f')]=_0x5ddabf[_0xd489('0x2f')][_0xd489('0x30')]?_0x5ddabf[_0xd489('0x2f')]:_0x1b1c76[_0xd489('0x29')];if(!_0x281e19['query']['hasOwnProperty'](_0xd489('0x31'))){_0x5ddabf['limit']=qs[_0xd489('0x1c')](_0x281e19[_0xd489('0x2b')]['limit']);_0x5ddabf[_0xd489('0x1b')]=qs[_0xd489('0x1b')](_0x281e19[_0xd489('0x2b')][_0xd489('0x1b')]);}_0x5ddabf['order']=qs[_0xd489('0x32')](_0x281e19['query'][_0xd489('0x32')]);_0x5ddabf[_0xd489('0x33')]=qs['filters'](_[_0xd489('0x34')](_0x281e19['query'],_0x1b1c76[_0xd489('0x2c')]));if(_0x281e19[_0xd489('0x2b')][_0xd489('0x35')]){_0x5ddabf['where']=_[_0xd489('0x36')](_0x5ddabf[_0xd489('0x33')],{'$or':_['map'](_0x41ba2f,function(_0x5f1d2e){if(_0x5f1d2e[_0xd489('0x37')][_0xd489('0x38')]!==_0xd489('0x39')){var _0x243464={};_0x243464[_0x5f1d2e[_0xd489('0x3a')]]={'$like':'%'+_0x281e19[_0xd489('0x2b')][_0xd489('0x35')]+'%'};return _0x243464;}})});}_0x5ddabf=_[_0xd489('0x36')]({},_0x5ddabf,_0x281e19['options']);var _0x13ac55={'where':_0x5ddabf[_0xd489('0x33')]};return db['UserProfileResource']['count'](_0x13ac55)[_0xd489('0x22')](function(_0x464a6b){_0xe17896[_0xd489('0x1a')]=_0x464a6b;if(_0x281e19[_0xd489('0x2b')]['includeAll']){_0x5ddabf[_0xd489('0x3b')]=[{'all':!![]}];}return db[_0xd489('0x27')][_0xd489('0x3c')](_0x5ddabf);})[_0xd489('0x22')](function(_0x2c7fe1){_0xe17896['rows']=_0x2c7fe1;return _0xe17896;})[_0xd489('0x22')](respondWithFilteredResult(_0x3a05f2,_0x5ddabf))[_0xd489('0x3d')](handleError(_0x3a05f2,null));};exports['show']=function(_0x3a5276,_0x439b59){var _0x2ac25e={'raw':![],'where':{'id':_0x3a5276[_0xd489('0x3e')]['id']}},_0x596c35={};_0x596c35['model']=_['keys'](db[_0xd489('0x27')]['rawAttributes']);_0x596c35[_0xd489('0x2b')]=_[_0xd489('0x2a')](_0x3a5276[_0xd489('0x2b')]);_0x596c35[_0xd489('0x2c')]=_[_0xd489('0x2d')](_0x596c35['model'],_0x596c35['query']);_0x2ac25e['attributes']=_[_0xd489('0x2d')](_0x596c35[_0xd489('0x29')],qs['fields'](_0x3a5276[_0xd489('0x2b')]['fields']));_0x2ac25e['attributes']=_0x2ac25e[_0xd489('0x2f')][_0xd489('0x30')]?_0x2ac25e[_0xd489('0x2f')]:_0x596c35[_0xd489('0x29')];if(_0x3a5276['query'][_0xd489('0x3f')]){_0x2ac25e[_0xd489('0x3b')]=[{'all':!![]}];}_0x2ac25e=_['merge']({},_0x2ac25e,_0x3a5276[_0xd489('0x40')]);return db[_0xd489('0x27')][_0xd489('0x41')](_0x2ac25e)['then'](handleEntityNotFound(_0x439b59,null))[_0xd489('0x22')](respondWithResult(_0x439b59,null))[_0xd489('0x3d')](handleError(_0x439b59,null));};exports['create']=function(_0x479cef,_0x42011e){return db[_0xd489('0x27')]['create'](_0x479cef[_0xd489('0x42')],{})[_0xd489('0x22')](respondWithResult(_0x42011e,0xc9))[_0xd489('0x3d')](handleError(_0x42011e,null));};exports['update']=function(_0x6d8143,_0x36fd0e){if(_0x6d8143['body']['id']){delete _0x6d8143[_0xd489('0x42')]['id'];}return db[_0xd489('0x27')][_0xd489('0x41')]({'where':{'id':_0x6d8143[_0xd489('0x3e')]['id']}})[_0xd489('0x22')](handleEntityNotFound(_0x36fd0e,null))[_0xd489('0x22')](saveUpdates(_0x6d8143['body'],null))['then'](respondWithResult(_0x36fd0e,null))[_0xd489('0x3d')](handleError(_0x36fd0e,null));};exports[_0xd489('0x21')]=function(_0xeb1cf6,_0x1ae221){return db[_0xd489('0x27')][_0xd489('0x41')]({'where':{'id':_0xeb1cf6[_0xd489('0x3e')]['id']}})[_0xd489('0x22')](handleEntityNotFound(_0x1ae221,null))[_0xd489('0x22')](removeEntity(_0x1ae221,null))[_0xd489('0x3d')](handleError(_0x1ae221,null));};exports[_0xd489('0x43')]=function(_0x1fce09,_0x50d77){return db[_0xd489('0x27')]['describe']()[_0xd489('0x22')](respondWithResult(_0x50d77,null))[_0xd489('0x3d')](handleError(_0x50d77,null));}; \ No newline at end of file +var _0xaf1c=['status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','UserProfileResource','rawAttributes','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','type','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','describe','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x3a58c9,_0x18f9e8){var _0x228fe2=function(_0x2b3034){while(--_0x2b3034){_0x3a58c9['push'](_0x3a58c9['shift']());}};_0x228fe2(++_0x18f9e8);}(_0xaf1c,0x164));var _0xcaf1=function(_0x16ecd1,_0x19fe46){_0x16ecd1=_0x16ecd1-0x0;var _0x4ac2af=_0xaf1c[_0x16ecd1];return _0x4ac2af;};'use strict';var pdf=require(_0xcaf1('0x0'));var emlformat=require(_0xcaf1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xcaf1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcaf1('0x3'));var moment=require('moment');var BPromise=require(_0xcaf1('0x4'));var Mustache=require(_0xcaf1('0x5'));var util=require('util');var path=require(_0xcaf1('0x6'));var sox=require(_0xcaf1('0x7'));var csv=require(_0xcaf1('0x8'));var ejs=require(_0xcaf1('0x9'));var fs=require('fs');var _=require(_0xcaf1('0xa'));var squel=require(_0xcaf1('0xb'));var crypto=require('crypto');var jsforce=require(_0xcaf1('0xc'));var deskjs=require(_0xcaf1('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcaf1('0xe'));var Papa=require(_0xcaf1('0xf'));var Redis=require(_0xcaf1('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xcaf1('0x11'));var logger=require(_0xcaf1('0x12'))(_0xcaf1('0x13'));var utils=require(_0xcaf1('0x14'));var config=require(_0xcaf1('0x15'));var db=require(_0xcaf1('0x16'))['db'];function respondWithStatusCode(_0x4ec261,_0x27babe){_0x27babe=_0x27babe||0xcc;return function(_0x7eb20b){if(_0x7eb20b){return _0x4ec261[_0xcaf1('0x17')](_0x27babe);}return _0x4ec261[_0xcaf1('0x18')](_0x27babe)[_0xcaf1('0x19')]();};}function respondWithResult(_0x5d2aec,_0x1ccb17){_0x1ccb17=_0x1ccb17||0xc8;return function(_0x1683a0){if(_0x1683a0){return _0x5d2aec[_0xcaf1('0x18')](_0x1ccb17)['json'](_0x1683a0);}};}function respondWithFilteredResult(_0x270246,_0x4cf823){return function(_0x40b1f1){if(_0x40b1f1){var _0x3bd5d5=_0x40b1f1[_0xcaf1('0x1a')],_0x5e06c2=_0x4cf823[_0xcaf1('0x1b')],_0x913974=_0x4cf823[_0xcaf1('0x1b')]+_0x4cf823[_0xcaf1('0x1c')],_0x266c6b;if(_0x913974>=_0x3bd5d5){_0x913974=_0x3bd5d5;_0x266c6b=0xc8;}else{_0x266c6b=0xce;}_0x270246[_0xcaf1('0x18')](_0x266c6b);return _0x270246[_0xcaf1('0x1d')](_0xcaf1('0x1e'),_0x5e06c2+'-'+_0x913974+'/'+_0x3bd5d5)['json'](_0x40b1f1);}return null;};}function patchUpdates(_0xb7e943){return function(_0x1928e6){try{jsonpatch[_0xcaf1('0x1f')](_0x1928e6,_0xb7e943,!![]);}catch(_0xe25c54){return BPromise[_0xcaf1('0x20')](_0xe25c54);}return _0x1928e6[_0xcaf1('0x21')]();};}function saveUpdates(_0xffa18f,_0x2934ed){return function(_0x4a2dc2){if(_0x4a2dc2){return _0x4a2dc2[_0xcaf1('0x22')](_0xffa18f)['then'](function(_0x48fac7){return _0x48fac7;});}return null;};}function removeEntity(_0x58d002,_0x2f419b){return function(_0xa6a208){if(_0xa6a208){return _0xa6a208[_0xcaf1('0x23')]()[_0xcaf1('0x24')](function(){_0x58d002[_0xcaf1('0x18')](0xcc)[_0xcaf1('0x19')]();});}};}function handleEntityNotFound(_0x3c8aa8,_0x487844){return function(_0x56d31d){if(!_0x56d31d){_0x3c8aa8[_0xcaf1('0x17')](0x194);}return _0x56d31d;};}function handleError(_0x3c0f7a,_0x29ca2a){_0x29ca2a=_0x29ca2a||0x1f4;return function(_0x2a38f0){logger[_0xcaf1('0x25')](_0x2a38f0[_0xcaf1('0x26')]);if(_0x2a38f0[_0xcaf1('0x27')]){delete _0x2a38f0['name'];}_0x3c0f7a[_0xcaf1('0x18')](_0x29ca2a)[_0xcaf1('0x28')](_0x2a38f0);};}exports[_0xcaf1('0x29')]=function(_0x19033a,_0xc46f45){var _0x4117d1={},_0x5159b5={},_0x4ef625={'count':0x0,'rows':[]};var _0x49e221=db[_0xcaf1('0x2a')][_0xcaf1('0x2b')];_0x5159b5['model']=_[_0xcaf1('0x2c')](_0x49e221);_0x5159b5[_0xcaf1('0x2d')]=_['keys'](_0x19033a[_0xcaf1('0x2d')]);_0x5159b5['filters']=_[_0xcaf1('0x2e')](_0x5159b5[_0xcaf1('0x2f')],_0x5159b5[_0xcaf1('0x2d')]);_0x4117d1[_0xcaf1('0x30')]=_['intersection'](_0x5159b5[_0xcaf1('0x2f')],qs[_0xcaf1('0x31')](_0x19033a['query'][_0xcaf1('0x31')]));_0x4117d1[_0xcaf1('0x30')]=_0x4117d1['attributes'][_0xcaf1('0x32')]?_0x4117d1[_0xcaf1('0x30')]:_0x5159b5[_0xcaf1('0x2f')];if(!_0x19033a[_0xcaf1('0x2d')][_0xcaf1('0x33')](_0xcaf1('0x34'))){_0x4117d1['limit']=qs[_0xcaf1('0x1c')](_0x19033a[_0xcaf1('0x2d')]['limit']);_0x4117d1[_0xcaf1('0x1b')]=qs[_0xcaf1('0x1b')](_0x19033a[_0xcaf1('0x2d')][_0xcaf1('0x1b')]);}_0x4117d1[_0xcaf1('0x35')]=qs[_0xcaf1('0x36')](_0x19033a[_0xcaf1('0x2d')][_0xcaf1('0x36')]);_0x4117d1['where']=qs[_0xcaf1('0x37')](_[_0xcaf1('0x38')](_0x19033a[_0xcaf1('0x2d')],_0x5159b5['filters']));if(_0x19033a[_0xcaf1('0x2d')][_0xcaf1('0x39')]){_0x4117d1[_0xcaf1('0x3a')]=_[_0xcaf1('0x3b')](_0x4117d1[_0xcaf1('0x3a')],{'$or':_[_0xcaf1('0x3c')](_0x49e221,function(_0x54b982){if(_0x54b982[_0xcaf1('0x3d')]['key']!==_0xcaf1('0x3e')){var _0x478255={};_0x478255[_0x54b982[_0xcaf1('0x3f')]]={'$like':'%'+_0x19033a[_0xcaf1('0x2d')][_0xcaf1('0x39')]+'%'};return _0x478255;}})});}_0x4117d1=_['merge']({},_0x4117d1,_0x19033a[_0xcaf1('0x40')]);var _0x5441c6={'where':_0x4117d1['where']};return db[_0xcaf1('0x2a')][_0xcaf1('0x1a')](_0x5441c6)[_0xcaf1('0x24')](function(_0x334b51){_0x4ef625[_0xcaf1('0x1a')]=_0x334b51;if(_0x19033a[_0xcaf1('0x2d')][_0xcaf1('0x41')]){_0x4117d1['include']=[{'all':!![]}];}return db[_0xcaf1('0x2a')][_0xcaf1('0x42')](_0x4117d1);})[_0xcaf1('0x24')](function(_0x969cb1){_0x4ef625[_0xcaf1('0x43')]=_0x969cb1;return _0x4ef625;})[_0xcaf1('0x24')](respondWithFilteredResult(_0xc46f45,_0x4117d1))[_0xcaf1('0x44')](handleError(_0xc46f45,null));};exports[_0xcaf1('0x45')]=function(_0xe5674c,_0x289fc1){var _0x55566e={'raw':![],'where':{'id':_0xe5674c[_0xcaf1('0x46')]['id']}},_0x2b186a={};_0x2b186a[_0xcaf1('0x2f')]=_[_0xcaf1('0x2c')](db[_0xcaf1('0x2a')][_0xcaf1('0x2b')]);_0x2b186a['query']=_[_0xcaf1('0x2c')](_0xe5674c[_0xcaf1('0x2d')]);_0x2b186a[_0xcaf1('0x37')]=_[_0xcaf1('0x2e')](_0x2b186a[_0xcaf1('0x2f')],_0x2b186a[_0xcaf1('0x2d')]);_0x55566e[_0xcaf1('0x30')]=_[_0xcaf1('0x2e')](_0x2b186a[_0xcaf1('0x2f')],qs[_0xcaf1('0x31')](_0xe5674c['query'][_0xcaf1('0x31')]));_0x55566e[_0xcaf1('0x30')]=_0x55566e[_0xcaf1('0x30')][_0xcaf1('0x32')]?_0x55566e[_0xcaf1('0x30')]:_0x2b186a['model'];if(_0xe5674c[_0xcaf1('0x2d')]['includeAll']){_0x55566e[_0xcaf1('0x47')]=[{'all':!![]}];}_0x55566e=_['merge']({},_0x55566e,_0xe5674c['options']);return db[_0xcaf1('0x2a')]['find'](_0x55566e)['then'](handleEntityNotFound(_0x289fc1,null))[_0xcaf1('0x24')](respondWithResult(_0x289fc1,null))[_0xcaf1('0x44')](handleError(_0x289fc1,null));};exports[_0xcaf1('0x48')]=function(_0x592ee7,_0x34432f){return db[_0xcaf1('0x2a')][_0xcaf1('0x48')](_0x592ee7[_0xcaf1('0x49')],{})[_0xcaf1('0x24')](respondWithResult(_0x34432f,0xc9))['catch'](handleError(_0x34432f,null));};exports['update']=function(_0x3c0fd3,_0x3de2c5){if(_0x3c0fd3['body']['id']){delete _0x3c0fd3[_0xcaf1('0x49')]['id'];}return db[_0xcaf1('0x2a')][_0xcaf1('0x4a')]({'where':{'id':_0x3c0fd3[_0xcaf1('0x46')]['id']}})[_0xcaf1('0x24')](handleEntityNotFound(_0x3de2c5,null))['then'](saveUpdates(_0x3c0fd3[_0xcaf1('0x49')],null))[_0xcaf1('0x24')](respondWithResult(_0x3de2c5,null))[_0xcaf1('0x44')](handleError(_0x3de2c5,null));};exports[_0xcaf1('0x23')]=function(_0x26eed1,_0x2ca3c7){return db[_0xcaf1('0x2a')][_0xcaf1('0x4a')]({'where':{'id':_0x26eed1[_0xcaf1('0x46')]['id']}})[_0xcaf1('0x24')](handleEntityNotFound(_0x2ca3c7,null))[_0xcaf1('0x24')](removeEntity(_0x2ca3c7,null))['catch'](handleError(_0x2ca3c7,null));};exports[_0xcaf1('0x4b')]=function(_0x4f5e29,_0x3e2ec2){return db[_0xcaf1('0x2a')]['describe']()[_0xcaf1('0x24')](respondWithResult(_0x3e2ec2,null))[_0xcaf1('0x44')](handleError(_0x3e2ec2,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 5f6de77..1819c1d 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 _0xcc13=['sectionId','lodash','api','./userProfileResource.attributes','exports','define','UserProfileResource','resourceId'];(function(_0x55d52c,_0x922990){var _0x45cd50=function(_0x53ca1c){while(--_0x53ca1c){_0x55d52c['push'](_0x55d52c['shift']());}};_0x45cd50(++_0x922990);}(_0xcc13,0xf9));var _0x3cc1=function(_0x1caa47,_0x2c5ede){_0x1caa47=_0x1caa47-0x0;var _0x140df9=_0xcc13[_0x1caa47];return _0x140df9;};'use strict';var _=require(_0x3cc1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3cc1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3cc1('0x2'));module[_0x3cc1('0x3')]=function(_0x45fef2,_0x2a40fe){return _0x45fef2[_0x3cc1('0x4')](_0x3cc1('0x5'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x3cc1('0x6'),_0x3cc1('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xab1b=['sectionId','util','../../config/logger','api','moment','rimraf','../../config/environment','define','UserProfileResource','compositeIndex','resourceId'];(function(_0x2459a1,_0x4a397c){var _0x43ab1c=function(_0x4794ec){while(--_0x4794ec){_0x2459a1['push'](_0x2459a1['shift']());}};_0x43ab1c(++_0x4a397c);}(_0xab1b,0x114));var _0xbab1=function(_0x42abd4,_0x2e391f){_0x42abd4=_0x42abd4-0x0;var _0x2ca283=_0xab1b[_0x42abd4];return _0x2ca283;};'use strict';var _=require('lodash');var util=require(_0xbab1('0x0'));var logger=require(_0xbab1('0x1'))(_0xbab1('0x2'));var moment=require(_0xbab1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbab1('0x4'));var config=require(_0xbab1('0x5'));var attributes=require('./userProfileResource.attributes');module['exports']=function(_0x4110dc,_0x1a4436){return _0x4110dc[_0xbab1('0x6')](_0xbab1('0x7'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xbab1('0x8'),'fields':[_0xbab1('0x9'),_0xbab1('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index caafd52..bd644c6 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 _0x11e5=['request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s'];(function(_0xf44d98,_0x12a472){var _0x5ebb04=function(_0x930c33){while(--_0x930c33){_0xf44d98['push'](_0xf44d98['shift']());}};_0x5ebb04(++_0x12a472);}(_0x11e5,0x8b));var _0x511e=function(_0x1d2a77,_0x3bcfe5){_0x1d2a77=_0x1d2a77-0x0;var _0x5bab7d=_0x11e5[_0x1d2a77];return _0x5bab7d;};'use strict';var _=require(_0x511e('0x0'));var util=require('util');var moment=require(_0x511e('0x1'));var BPromise=require(_0x511e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x511e('0x3'));var db=require(_0x511e('0x4'))['db'];var utils=require(_0x511e('0x5'));var logger=require('../../config/logger')(_0x511e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x511e('0x7')][_0x511e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x466dec,_0x57cac3,_0x47cf56){return new BPromise(function(_0x3ebc4b,_0xf0ba86){return client[_0x511e('0x9')](_0x466dec,_0x47cf56)[_0x511e('0xa')](function(_0x4449c4){logger[_0x511e('0xb')](_0x511e('0xc'),_0x57cac3,_0x511e('0xd'));logger[_0x511e('0xe')](_0x511e('0xf'),_0x57cac3,_0x511e('0xd'),JSON['stringify'](_0x4449c4));if(_0x4449c4[_0x511e('0x10')]){if(_0x4449c4['error']['code']===0x1f4){logger[_0x511e('0x10')](_0x511e('0xc'),_0x57cac3,_0x4449c4[_0x511e('0x10')][_0x511e('0x11')]);return _0xf0ba86(_0x4449c4[_0x511e('0x10')][_0x511e('0x11')]);}logger['error'](_0x511e('0xc'),_0x57cac3,_0x4449c4[_0x511e('0x10')]['message']);return _0x3ebc4b(_0x4449c4[_0x511e('0x10')][_0x511e('0x11')]);}else{logger['info'](_0x511e('0xc'),_0x57cac3,_0x511e('0xd'));_0x3ebc4b(_0x4449c4[_0x511e('0x12')][_0x511e('0x11')]);}})['catch'](function(_0x3e0415){logger[_0x511e('0x10')](_0x511e('0xc'),_0x57cac3,_0x3e0415);_0xf0ba86(_0x3e0415);});});} \ No newline at end of file +var _0xb091=['UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','then','info'];(function(_0x468147,_0x52533e){var _0x13de08=function(_0x429fbd){while(--_0x429fbd){_0x468147['push'](_0x468147['shift']());}};_0x13de08(++_0x52533e);}(_0xb091,0x16e));var _0x1b09=function(_0xcf7d9d,_0x1d4799){_0xcf7d9d=_0xcf7d9d-0x0;var _0x4762f0=_0xb091[_0xcf7d9d];return _0x4762f0;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var moment=require(_0x1b09('0x1'));var BPromise=require(_0x1b09('0x2'));var rs=require(_0x1b09('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b09('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1b09('0x5'));var config=require(_0x1b09('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1b09('0x7')][_0x1b09('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2bf4f6,_0x5ce726,_0x142c33){return new BPromise(function(_0x8c26a5,_0x2f359f){return client[_0x1b09('0x9')](_0x2bf4f6,_0x142c33)[_0x1b09('0xa')](function(_0x3362e4){logger[_0x1b09('0xb')](_0x1b09('0xc'),_0x5ce726,_0x1b09('0xd'));logger[_0x1b09('0xe')](_0x1b09('0xf'),_0x5ce726,'request\x20sent',JSON[_0x1b09('0x10')](_0x3362e4));if(_0x3362e4[_0x1b09('0x11')]){if(_0x3362e4['error']['code']===0x1f4){logger[_0x1b09('0x11')](_0x1b09('0xc'),_0x5ce726,_0x3362e4[_0x1b09('0x11')][_0x1b09('0x12')]);return _0x2f359f(_0x3362e4[_0x1b09('0x11')][_0x1b09('0x12')]);}logger[_0x1b09('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x5ce726,_0x3362e4[_0x1b09('0x11')]['message']);return _0x8c26a5(_0x3362e4[_0x1b09('0x11')][_0x1b09('0x12')]);}else{logger[_0x1b09('0xb')](_0x1b09('0xc'),_0x5ce726,_0x1b09('0xd'));_0x8c26a5(_0x3362e4[_0x1b09('0x13')][_0x1b09('0x12')]);}})[_0x1b09('0x14')](function(_0x1196b2){logger[_0x1b09('0x11')](_0x1b09('0xc'),_0x5ce726,_0x1196b2);_0x2f359f(_0x1196b2);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index aec4b41..d330cb5 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 _0x62aa=['../../config/environment','get','isAuthenticated','describe','/:id','show','create','put','update','delete','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x36f11a,_0x447ae7){var _0x453980=function(_0x8d8533){while(--_0x8d8533){_0x36f11a['push'](_0x36f11a['shift']());}};_0x453980(++_0x447ae7);}(_0x62aa,0x16a));var _0xa62a=function(_0x2255c1,_0x47d921){_0x2255c1=_0x2255c1-0x0;var _0x36701a=_0x62aa[_0x2255c1];return _0x36701a;};'use strict';var multer=require('multer');var util=require(_0xa62a('0x0'));var path=require(_0xa62a('0x1'));var timeout=require(_0xa62a('0x2'));var express=require(_0xa62a('0x3'));var router=express[_0xa62a('0x4')]();var auth=require(_0xa62a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa62a('0x6'));var controller=require('./userProfileSection.controller');router[_0xa62a('0x7')]('/',auth[_0xa62a('0x8')](),controller['index']);router[_0xa62a('0x7')]('/describe',auth[_0xa62a('0x8')](),controller[_0xa62a('0x9')]);router['get'](_0xa62a('0xa'),auth[_0xa62a('0x8')](),controller[_0xa62a('0xb')]);router['post']('/',auth[_0xa62a('0x8')](),controller[_0xa62a('0xc')]);router[_0xa62a('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xa62a('0xe')]);router[_0xa62a('0xf')](_0xa62a('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1ace=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x295d32,_0x33e562){var _0x4f2be2=function(_0x3af204){while(--_0x3af204){_0x295d32['push'](_0x295d32['shift']());}};_0x4f2be2(++_0x33e562);}(_0x1ace,0x12b));var _0xe1ac=function(_0x363130,_0x4c4335){_0x363130=_0x363130-0x0;var _0x13ef9e=_0x1ace[_0x363130];return _0x13ef9e;};'use strict';var multer=require(_0xe1ac('0x0'));var util=require(_0xe1ac('0x1'));var path=require('path');var timeout=require(_0xe1ac('0x2'));var express=require(_0xe1ac('0x3'));var router=express['Router']();var auth=require(_0xe1ac('0x4'));var interaction=require(_0xe1ac('0x5'));var config=require(_0xe1ac('0x6'));var controller=require('./userProfileSection.controller');router[_0xe1ac('0x7')]('/',auth[_0xe1ac('0x8')](),controller[_0xe1ac('0x9')]);router[_0xe1ac('0x7')]('/describe',auth[_0xe1ac('0x8')](),controller['describe']);router['get'](_0xe1ac('0xa'),auth['isAuthenticated'](),controller[_0xe1ac('0xb')]);router[_0xe1ac('0xc')]('/',auth[_0xe1ac('0x8')](),controller[_0xe1ac('0xd')]);router[_0xe1ac('0xe')](_0xe1ac('0xa'),auth['isAuthenticated'](),controller[_0xe1ac('0xf')]);router[_0xe1ac('0x10')](_0xe1ac('0xa'),auth['isAuthenticated'](),controller[_0xe1ac('0x11')]);module[_0xe1ac('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 1340abd..76aec6d 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(_0x31d3fa,_0x48cb26){var _0xdd0a9b=function(_0x11059b){while(--_0x11059b){_0x31d3fa['push'](_0x31d3fa['shift']());}};_0xdd0a9b(++_0x48cb26);}(_0xedd9,0xfc));var _0x9edd=function(_0x32e748,_0x5d9581){_0x32e748=_0x32e748-0x0;var _0x2871ef=_0xedd9[_0x32e748];return _0x2871ef;};'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 _0x3e74=['setDataValue','crudPermissions','join','getDataValue','split','sequelize','STRING','INTEGER'];(function(_0x1ffff7,_0x2f9ff6){var _0x49d017=function(_0x1d2483){while(--_0x1d2483){_0x1ffff7['push'](_0x1ffff7['shift']());}};_0x49d017(++_0x2f9ff6);}(_0x3e74,0x175));var _0x43e7=function(_0x1c204f,_0x4b41e8){_0x1c204f=_0x1c204f-0x0;var _0x460df4=_0x3e74[_0x1c204f];return _0x460df4;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'name':{'type':Sequelize[_0x43e7('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x43e7('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x43e7('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x43e7('0x1')],'set':function(_0x4f9bbe){this[_0x43e7('0x3')](_0x43e7('0x4'),_0x4f9bbe?_0x4f9bbe[_0x43e7('0x5')](''):[]);},'get':function(){return this[_0x43e7('0x6')](_0x43e7('0x4'))?this['getDataValue'](_0x43e7('0x4'))[_0x43e7('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 9c85d54..741c601 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 _0x0b0e=['limit','Content-Range','apply','save','update','then','stack','name','send','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','filter','options','UserProfileSection','includeAll','include','findAll','rows','catch','find','create','body','params','describe','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','sendStatus','status','end','json','count','offset'];(function(_0x9658dc,_0x4b1905){var _0x2ad48e=function(_0x3691e9){while(--_0x3691e9){_0x9658dc['push'](_0x9658dc['shift']());}};_0x2ad48e(++_0x4b1905);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3eff21,_0x5bf36c){_0x3eff21=_0x3eff21-0x0;var _0x1945bb=_0x0b0e[_0x3eff21];return _0x1945bb;};'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'];function respondWithStatusCode(_0x585615,_0x3068c0){_0x3068c0=_0x3068c0||0xcc;return function(_0x1c358a){if(_0x1c358a){return _0x585615[_0xe0b0('0x17')](_0x3068c0);}return _0x585615[_0xe0b0('0x18')](_0x3068c0)[_0xe0b0('0x19')]();};}function respondWithResult(_0x4d2bf7,_0x3782be){_0x3782be=_0x3782be||0xc8;return function(_0x154de6){if(_0x154de6){return _0x4d2bf7[_0xe0b0('0x18')](_0x3782be)[_0xe0b0('0x1a')](_0x154de6);}};}function respondWithFilteredResult(_0x177c24,_0x55d884){return function(_0x41a7e2){if(_0x41a7e2){var _0x5adb01=_0x41a7e2[_0xe0b0('0x1b')],_0x35cb40=_0x55d884['offset'],_0xadee6e=_0x55d884[_0xe0b0('0x1c')]+_0x55d884[_0xe0b0('0x1d')],_0x519ae8;if(_0xadee6e>=_0x5adb01){_0xadee6e=_0x5adb01;_0x519ae8=0xc8;}else{_0x519ae8=0xce;}_0x177c24['status'](_0x519ae8);return _0x177c24['set'](_0xe0b0('0x1e'),_0x35cb40+'-'+_0xadee6e+'/'+_0x5adb01)['json'](_0x41a7e2);}return null;};}function patchUpdates(_0x4df8da){return function(_0x4bce65){try{jsonpatch[_0xe0b0('0x1f')](_0x4bce65,_0x4df8da,!![]);}catch(_0x50fa4a){return BPromise['reject'](_0x50fa4a);}return _0x4bce65[_0xe0b0('0x20')]();};}function saveUpdates(_0x59dff5,_0x472286){return function(_0x5dba2f){if(_0x5dba2f){return _0x5dba2f[_0xe0b0('0x21')](_0x59dff5)[_0xe0b0('0x22')](function(_0x3e10b3){return _0x3e10b3;});}return null;};}function removeEntity(_0x310a6d,_0x2cf6a1){return function(_0x58b804){if(_0x58b804){return _0x58b804['destroy']()[_0xe0b0('0x22')](function(){_0x310a6d['status'](0xcc)[_0xe0b0('0x19')]();});}};}function handleEntityNotFound(_0x31b5f8,_0x513e63){return function(_0x170ad8){if(!_0x170ad8){_0x31b5f8['sendStatus'](0x194);}return _0x170ad8;};}function handleError(_0x2208d0,_0x49a727){_0x49a727=_0x49a727||0x1f4;return function(_0x28586d){logger['error'](_0x28586d[_0xe0b0('0x23')]);if(_0x28586d['name']){delete _0x28586d[_0xe0b0('0x24')];}_0x2208d0['status'](_0x49a727)[_0xe0b0('0x25')](_0x28586d);};}exports['index']=function(_0x362aba,_0x3c3bc2){var _0x1f1ebd={},_0x1d91ad={},_0x3ec2={'count':0x0,'rows':[]};var _0x10745d=db['UserProfileSection'][_0xe0b0('0x26')];_0x1d91ad[_0xe0b0('0x27')]=_['keys'](_0x10745d);_0x1d91ad[_0xe0b0('0x28')]=_[_0xe0b0('0x29')](_0x362aba[_0xe0b0('0x28')]);_0x1d91ad[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0x1d91ad[_0xe0b0('0x27')],_0x1d91ad[_0xe0b0('0x28')]);_0x1f1ebd['attributes']=_[_0xe0b0('0x2b')](_0x1d91ad[_0xe0b0('0x27')],qs['fields'](_0x362aba['query'][_0xe0b0('0x2c')]));_0x1f1ebd[_0xe0b0('0x2d')]=_0x1f1ebd[_0xe0b0('0x2d')][_0xe0b0('0x2e')]?_0x1f1ebd[_0xe0b0('0x2d')]:_0x1d91ad['model'];if(!_0x362aba[_0xe0b0('0x28')][_0xe0b0('0x2f')](_0xe0b0('0x30'))){_0x1f1ebd[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x362aba['query'][_0xe0b0('0x1d')]);_0x1f1ebd[_0xe0b0('0x1c')]=qs[_0xe0b0('0x1c')](_0x362aba[_0xe0b0('0x28')][_0xe0b0('0x1c')]);}_0x1f1ebd[_0xe0b0('0x31')]=qs[_0xe0b0('0x32')](_0x362aba[_0xe0b0('0x28')][_0xe0b0('0x32')]);_0x1f1ebd[_0xe0b0('0x33')]=qs[_0xe0b0('0x2a')](_[_0xe0b0('0x34')](_0x362aba[_0xe0b0('0x28')],_0x1d91ad[_0xe0b0('0x2a')]));if(_0x362aba[_0xe0b0('0x28')]['filter']){_0x1f1ebd[_0xe0b0('0x33')]=_[_0xe0b0('0x35')](_0x1f1ebd[_0xe0b0('0x33')],{'$or':_[_0xe0b0('0x36')](_0x10745d,function(_0x1a2d24){if(_0x1a2d24[_0xe0b0('0x37')][_0xe0b0('0x38')]!=='VIRTUAL'){var _0x521243={};_0x521243[_0x1a2d24['field']]={'$like':'%'+_0x362aba['query'][_0xe0b0('0x39')]+'%'};return _0x521243;}})});}_0x1f1ebd=_[_0xe0b0('0x35')]({},_0x1f1ebd,_0x362aba[_0xe0b0('0x3a')]);var _0x4e4b20={'where':_0x1f1ebd[_0xe0b0('0x33')]};return db[_0xe0b0('0x3b')][_0xe0b0('0x1b')](_0x4e4b20)[_0xe0b0('0x22')](function(_0x563e28){_0x3ec2[_0xe0b0('0x1b')]=_0x563e28;if(_0x362aba[_0xe0b0('0x28')][_0xe0b0('0x3c')]){_0x1f1ebd[_0xe0b0('0x3d')]=[{'all':!![]}];}return db[_0xe0b0('0x3b')][_0xe0b0('0x3e')](_0x1f1ebd);})[_0xe0b0('0x22')](function(_0x115a69){_0x3ec2[_0xe0b0('0x3f')]=_0x115a69;return _0x3ec2;})['then'](respondWithFilteredResult(_0x3c3bc2,_0x1f1ebd))[_0xe0b0('0x40')](handleError(_0x3c3bc2,null));};exports['show']=function(_0x34178d,_0x2d5f47){var _0x46c4ea={'raw':![],'where':{'id':_0x34178d['params']['id']}},_0x74f3fa={};_0x74f3fa[_0xe0b0('0x27')]=_[_0xe0b0('0x29')](db[_0xe0b0('0x3b')][_0xe0b0('0x26')]);_0x74f3fa[_0xe0b0('0x28')]=_[_0xe0b0('0x29')](_0x34178d[_0xe0b0('0x28')]);_0x74f3fa[_0xe0b0('0x2a')]=_['intersection'](_0x74f3fa[_0xe0b0('0x27')],_0x74f3fa[_0xe0b0('0x28')]);_0x46c4ea['attributes']=_['intersection'](_0x74f3fa[_0xe0b0('0x27')],qs[_0xe0b0('0x2c')](_0x34178d['query'][_0xe0b0('0x2c')]));_0x46c4ea[_0xe0b0('0x2d')]=_0x46c4ea[_0xe0b0('0x2d')][_0xe0b0('0x2e')]?_0x46c4ea[_0xe0b0('0x2d')]:_0x74f3fa['model'];if(_0x34178d['query']['includeAll']){_0x46c4ea[_0xe0b0('0x3d')]=[{'all':!![]}];}_0x46c4ea=_[_0xe0b0('0x35')]({},_0x46c4ea,_0x34178d['options']);return db[_0xe0b0('0x3b')][_0xe0b0('0x41')](_0x46c4ea)[_0xe0b0('0x22')](handleEntityNotFound(_0x2d5f47,null))[_0xe0b0('0x22')](respondWithResult(_0x2d5f47,null))[_0xe0b0('0x40')](handleError(_0x2d5f47,null));};exports['create']=function(_0x57d4b0,_0x2405ae){return db[_0xe0b0('0x3b')][_0xe0b0('0x42')](_0x57d4b0[_0xe0b0('0x43')],{})[_0xe0b0('0x22')](respondWithResult(_0x2405ae,0xc9))['catch'](handleError(_0x2405ae,null));};exports[_0xe0b0('0x21')]=function(_0x11d4fd,_0x534340){if(_0x11d4fd['body']['id']){delete _0x11d4fd['body']['id'];}return db[_0xe0b0('0x3b')][_0xe0b0('0x41')]({'where':{'id':_0x11d4fd[_0xe0b0('0x44')]['id']}})[_0xe0b0('0x22')](handleEntityNotFound(_0x534340,null))['then'](saveUpdates(_0x11d4fd[_0xe0b0('0x43')],null))[_0xe0b0('0x22')](respondWithResult(_0x534340,null))['catch'](handleError(_0x534340,null));};exports['destroy']=function(_0x2365be,_0x1bc6e0){return db['UserProfileSection'][_0xe0b0('0x41')]({'where':{'id':_0x2365be[_0xe0b0('0x44')]['id']}})['then'](handleEntityNotFound(_0x1bc6e0,null))['then'](removeEntity(_0x1bc6e0,null))[_0xe0b0('0x40')](handleError(_0x1bc6e0,null));};exports['describe']=function(_0x165dc8,_0x215f7d){return db[_0xe0b0('0x3b')][_0xe0b0('0x45')]()[_0xe0b0('0x22')](respondWithResult(_0x215f7d,null))[_0xe0b0('0x40')](handleError(_0x215f7d,null));}; \ No newline at end of file +var _0xb10b=['includeAll','findAll','catch','params','model','options','find','create','body','describe','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','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','send','index','UserProfileSection','rawAttributes','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','field','count'];(function(_0x38312b,_0xbddfbc){var _0x3df78a=function(_0x179424){while(--_0x179424){_0x38312b['push'](_0x38312b['shift']());}};_0x3df78a(++_0xbddfbc);}(_0xb10b,0x12a));var _0xbb10=function(_0x5c3c90,_0x5ba31e){_0x5c3c90=_0x5c3c90-0x0;var _0x1dff8b=_0xb10b[_0x5c3c90];return _0x1dff8b;};'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'];function respondWithStatusCode(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xcc;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x18')](_0x44fb19);}return _0x5be7e0[_0xbb10('0x19')](_0x44fb19)[_0xbb10('0x1a')]();};}function respondWithResult(_0x147230,_0x58a612){_0x58a612=_0x58a612||0xc8;return function(_0x26e021){if(_0x26e021){return _0x147230[_0xbb10('0x19')](_0x58a612)[_0xbb10('0x1b')](_0x26e021);}};}function respondWithFilteredResult(_0x17fd46,_0x3df17b){return function(_0x2f2ebf){if(_0x2f2ebf){var _0x24a57b=_0x2f2ebf['count'],_0x36b5e8=_0x3df17b[_0xbb10('0x1c')],_0x3e26f4=_0x3df17b[_0xbb10('0x1c')]+_0x3df17b[_0xbb10('0x1d')],_0x2b184e;if(_0x3e26f4>=_0x24a57b){_0x3e26f4=_0x24a57b;_0x2b184e=0xc8;}else{_0x2b184e=0xce;}_0x17fd46[_0xbb10('0x19')](_0x2b184e);return _0x17fd46[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x36b5e8+'-'+_0x3e26f4+'/'+_0x24a57b)[_0xbb10('0x1b')](_0x2f2ebf);}return null;};}function patchUpdates(_0x30efc6){return function(_0xbf2906){try{jsonpatch[_0xbb10('0x20')](_0xbf2906,_0x30efc6,!![]);}catch(_0x48b6e9){return BPromise[_0xbb10('0x21')](_0x48b6e9);}return _0xbf2906[_0xbb10('0x22')]();};}function saveUpdates(_0x388fab,_0x109908){return function(_0xdf237d){if(_0xdf237d){return _0xdf237d[_0xbb10('0x23')](_0x388fab)['then'](function(_0x12f888){return _0x12f888;});}return null;};}function removeEntity(_0x12ef77,_0x50aea1){return function(_0x4c4b0d){if(_0x4c4b0d){return _0x4c4b0d[_0xbb10('0x24')]()[_0xbb10('0x25')](function(){_0x12ef77[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x445761,_0x1824b7){return function(_0x407cb4){if(!_0x407cb4){_0x445761[_0xbb10('0x18')](0x194);}return _0x407cb4;};}function handleError(_0x7f2377,_0x395404){_0x395404=_0x395404||0x1f4;return function(_0x3ba6cd){logger[_0xbb10('0x26')](_0x3ba6cd['stack']);if(_0x3ba6cd['name']){delete _0x3ba6cd['name'];}_0x7f2377[_0xbb10('0x19')](_0x395404)[_0xbb10('0x27')](_0x3ba6cd);};}exports[_0xbb10('0x28')]=function(_0x4e25ff,_0x2fdde9){var _0x24d586={},_0x6ed43b={},_0x1d5e95={'count':0x0,'rows':[]};var _0x1acce9=db[_0xbb10('0x29')][_0xbb10('0x2a')];_0x6ed43b['model']=_[_0xbb10('0x2b')](_0x1acce9);_0x6ed43b[_0xbb10('0x2c')]=_[_0xbb10('0x2b')](_0x4e25ff[_0xbb10('0x2c')]);_0x6ed43b[_0xbb10('0x2d')]=_[_0xbb10('0x2e')](_0x6ed43b['model'],_0x6ed43b[_0xbb10('0x2c')]);_0x24d586['attributes']=_[_0xbb10('0x2e')](_0x6ed43b['model'],qs[_0xbb10('0x2f')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x2f')]));_0x24d586['attributes']=_0x24d586['attributes'][_0xbb10('0x30')]?_0x24d586[_0xbb10('0x31')]:_0x6ed43b['model'];if(!_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x32')](_0xbb10('0x33'))){_0x24d586[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x1d')]);_0x24d586['offset']=qs[_0xbb10('0x1c')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x1c')]);}_0x24d586[_0xbb10('0x34')]=qs[_0xbb10('0x35')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x35')]);_0x24d586[_0xbb10('0x36')]=qs[_0xbb10('0x2d')](_['pick'](_0x4e25ff[_0xbb10('0x2c')],_0x6ed43b[_0xbb10('0x2d')]));if(_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x37')]){_0x24d586['where']=_[_0xbb10('0x38')](_0x24d586['where'],{'$or':_['map'](_0x1acce9,function(_0x3eb3cc){if(_0x3eb3cc[_0xbb10('0x39')][_0xbb10('0x3a')]!==_0xbb10('0x3b')){var _0x15d895={};_0x15d895[_0x3eb3cc[_0xbb10('0x3c')]]={'$like':'%'+_0x4e25ff['query'][_0xbb10('0x37')]+'%'};return _0x15d895;}})});}_0x24d586=_[_0xbb10('0x38')]({},_0x24d586,_0x4e25ff['options']);var _0x5e3fbd={'where':_0x24d586['where']};return db[_0xbb10('0x29')][_0xbb10('0x3d')](_0x5e3fbd)[_0xbb10('0x25')](function(_0x4d5a9b){_0x1d5e95[_0xbb10('0x3d')]=_0x4d5a9b;if(_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x3e')]){_0x24d586['include']=[{'all':!![]}];}return db[_0xbb10('0x29')][_0xbb10('0x3f')](_0x24d586);})[_0xbb10('0x25')](function(_0x446f49){_0x1d5e95['rows']=_0x446f49;return _0x1d5e95;})[_0xbb10('0x25')](respondWithFilteredResult(_0x2fdde9,_0x24d586))[_0xbb10('0x40')](handleError(_0x2fdde9,null));};exports['show']=function(_0xe2040f,_0x2e3214){var _0x44d6ae={'raw':![],'where':{'id':_0xe2040f[_0xbb10('0x41')]['id']}},_0x3a9934={};_0x3a9934[_0xbb10('0x42')]=_['keys'](db[_0xbb10('0x29')][_0xbb10('0x2a')]);_0x3a9934[_0xbb10('0x2c')]=_[_0xbb10('0x2b')](_0xe2040f['query']);_0x3a9934[_0xbb10('0x2d')]=_[_0xbb10('0x2e')](_0x3a9934[_0xbb10('0x42')],_0x3a9934[_0xbb10('0x2c')]);_0x44d6ae['attributes']=_[_0xbb10('0x2e')](_0x3a9934[_0xbb10('0x42')],qs['fields'](_0xe2040f['query'][_0xbb10('0x2f')]));_0x44d6ae['attributes']=_0x44d6ae[_0xbb10('0x31')][_0xbb10('0x30')]?_0x44d6ae['attributes']:_0x3a9934[_0xbb10('0x42')];if(_0xe2040f[_0xbb10('0x2c')][_0xbb10('0x3e')]){_0x44d6ae['include']=[{'all':!![]}];}_0x44d6ae=_[_0xbb10('0x38')]({},_0x44d6ae,_0xe2040f[_0xbb10('0x43')]);return db[_0xbb10('0x29')][_0xbb10('0x44')](_0x44d6ae)[_0xbb10('0x25')](handleEntityNotFound(_0x2e3214,null))[_0xbb10('0x25')](respondWithResult(_0x2e3214,null))[_0xbb10('0x40')](handleError(_0x2e3214,null));};exports[_0xbb10('0x45')]=function(_0x205bb4,_0x43b948){return db[_0xbb10('0x29')][_0xbb10('0x45')](_0x205bb4['body'],{})[_0xbb10('0x25')](respondWithResult(_0x43b948,0xc9))[_0xbb10('0x40')](handleError(_0x43b948,null));};exports['update']=function(_0x14e1cb,_0x2f5027){if(_0x14e1cb[_0xbb10('0x46')]['id']){delete _0x14e1cb[_0xbb10('0x46')]['id'];}return db[_0xbb10('0x29')][_0xbb10('0x44')]({'where':{'id':_0x14e1cb[_0xbb10('0x41')]['id']}})['then'](handleEntityNotFound(_0x2f5027,null))['then'](saveUpdates(_0x14e1cb[_0xbb10('0x46')],null))[_0xbb10('0x25')](respondWithResult(_0x2f5027,null))[_0xbb10('0x40')](handleError(_0x2f5027,null));};exports['destroy']=function(_0x5f0c12,_0x3cd6f3){return db[_0xbb10('0x29')][_0xbb10('0x44')]({'where':{'id':_0x5f0c12[_0xbb10('0x41')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x3cd6f3,null))[_0xbb10('0x25')](removeEntity(_0x3cd6f3,null))[_0xbb10('0x40')](handleError(_0x3cd6f3,null));};exports[_0xbb10('0x47')]=function(_0x2626d8,_0x3d7e7e){return db['UserProfileSection']['describe']()[_0xbb10('0x25')](respondWithResult(_0x3d7e7e,null))[_0xbb10('0x40')](handleError(_0x3d7e7e,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index ede49d1..fe55631 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 _0xf0ba=['user_profile_has_sections','compositeIndex','sectionId','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','UserProfileSection'];(function(_0x1a4f8a,_0x3abeac){var _0x16dcf3=function(_0x5cdc73){while(--_0x5cdc73){_0x1a4f8a['push'](_0x1a4f8a['shift']());}};_0x16dcf3(++_0x3abeac);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf0ba[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaf0b('0x0'));var util=require(_0xaf0b('0x1'));var logger=require(_0xaf0b('0x2'))(_0xaf0b('0x3'));var moment=require(_0xaf0b('0x4'));var BPromise=require('bluebird');var rp=require(_0xaf0b('0x5'));var fs=require('fs');var path=require(_0xaf0b('0x6'));var rimraf=require('rimraf');var config=require(_0xaf0b('0x7'));var attributes=require('./userProfileSection.attributes');module[_0xaf0b('0x8')]=function(_0x4b3b85,_0x4d1479){return _0x4b3b85[_0xaf0b('0x9')](_0xaf0b('0xa'),attributes,{'tableName':_0xaf0b('0xb'),'paranoid':![],'indexes':[{'name':_0xaf0b('0xc'),'fields':[_0xaf0b('0xd'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x963a=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userProfileSection.attributes','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x963a,0xbe));var _0xa963=function(_0x98b6e7,_0x2ce39a){_0x98b6e7=_0x98b6e7-0x0;var _0x2123da=_0x963a[_0x98b6e7];return _0x2123da;};'use strict';var _=require(_0xa963('0x0'));var util=require(_0xa963('0x1'));var logger=require(_0xa963('0x2'))(_0xa963('0x3'));var moment=require(_0xa963('0x4'));var BPromise=require(_0xa963('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa963('0x6'));var rimraf=require(_0xa963('0x7'));var config=require(_0xa963('0x8'));var attributes=require(_0xa963('0x9'));module['exports']=function(_0x34110d,_0x4c9765){return _0x34110d[_0xa963('0xa')](_0xa963('0xb'),attributes,{'tableName':_0xa963('0xc'),'paranoid':![],'indexes':[{'name':_0xa963('0xd'),'fields':[_0xa963('0xe'),_0xa963('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 453d0db..3712d0e 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 _0xaf2d=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','util','randomstring'];(function(_0x2af114,_0x3f77ca){var _0xc49b66=function(_0x12d81a){while(--_0x12d81a){_0x2af114['push'](_0x2af114['shift']());}};_0xc49b66(++_0x3f77ca);}(_0xaf2d,0xbc));var _0xdaf2=function(_0xa44271,_0x10611e){_0xa44271=_0xa44271-0x0;var _0x409346=_0xaf2d[_0xa44271];return _0x409346;};'use strict';var _=require('lodash');var util=require(_0xdaf2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdaf2('0x1'));var fs=require('fs');var Redis=require(_0xdaf2('0x2'));var db=require(_0xdaf2('0x3'))['db'];var utils=require(_0xdaf2('0x4'));var logger=require('../../config/logger')(_0xdaf2('0x5'));var config=require(_0xdaf2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xdaf2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x228c93,_0x4be205,_0xdd5146){return new BPromise(function(_0x3269c7,_0x396682){return client[_0xdaf2('0x8')](_0x228c93,_0xdd5146)[_0xdaf2('0x9')](function(_0x44b495){logger['info'](_0xdaf2('0xa'),_0x4be205,_0xdaf2('0xb'));logger['debug'](_0xdaf2('0xc'),_0x4be205,'request\x20sent',JSON['stringify'](_0x44b495));if(_0x44b495['error']){if(_0x44b495['error'][_0xdaf2('0xd')]===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x4be205,_0x44b495[_0xdaf2('0xe')]['message']);return _0x396682(_0x44b495[_0xdaf2('0xe')][_0xdaf2('0xf')]);}logger[_0xdaf2('0xe')](_0xdaf2('0xa'),_0x4be205,_0x44b495[_0xdaf2('0xe')][_0xdaf2('0xf')]);return _0x3269c7(_0x44b495[_0xdaf2('0xe')][_0xdaf2('0xf')]);}else{logger[_0xdaf2('0x10')](_0xdaf2('0xa'),_0x4be205,_0xdaf2('0xb'));_0x3269c7(_0x44b495[_0xdaf2('0x11')][_0xdaf2('0xf')]);}})[_0xdaf2('0x12')](function(_0x152fb1){logger[_0xdaf2('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x4be205,_0x152fb1);_0x396682(_0x152fb1);});});} \ No newline at end of file +var _0x167b=['request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x167b,0xd0));var _0xb167=function(_0x779529,_0x2bf466){_0x779529=_0x779529-0x0;var _0x38191f=_0x167b[_0x779529];return _0x38191f;};'use strict';var _=require(_0xb167('0x0'));var util=require('util');var moment=require(_0xb167('0x1'));var BPromise=require(_0xb167('0x2'));var rs=require(_0xb167('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb167('0x4'));var logger=require(_0xb167('0x5'))(_0xb167('0x6'));var config=require('../../config/environment');var jayson=require(_0xb167('0x7'));var client=jayson[_0xb167('0x8')][_0xb167('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13411b,_0x4ffc17,_0x5d5e0e){return new BPromise(function(_0x5b13af,_0x2cf461){return client[_0xb167('0xa')](_0x13411b,_0x5d5e0e)['then'](function(_0x57bd3f){logger[_0xb167('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x4ffc17,_0xb167('0xc'));logger[_0xb167('0xd')](_0xb167('0xe'),_0x4ffc17,_0xb167('0xc'),JSON['stringify'](_0x57bd3f));if(_0x57bd3f[_0xb167('0xf')]){if(_0x57bd3f[_0xb167('0xf')]['code']===0x1f4){logger[_0xb167('0xf')](_0xb167('0x10'),_0x4ffc17,_0x57bd3f[_0xb167('0xf')]['message']);return _0x2cf461(_0x57bd3f[_0xb167('0xf')]['message']);}logger[_0xb167('0xf')](_0xb167('0x10'),_0x4ffc17,_0x57bd3f[_0xb167('0xf')]['message']);return _0x5b13af(_0x57bd3f[_0xb167('0xf')][_0xb167('0x11')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x4ffc17,_0xb167('0xc'));_0x5b13af(_0x57bd3f[_0xb167('0x12')][_0xb167('0x11')]);}})[_0xb167('0x13')](function(_0x461703){logger[_0xb167('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x4ffc17,_0x461703);_0x2cf461(_0x461703);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index f9d9dd4..0536ceb 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 _0x0d91=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','exports','multer','util'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0d91,0x76));var _0x10d9=function(_0x31ddff,_0x332c4f){_0x31ddff=_0x31ddff-0x0;var _0xabf5b=_0x0d91[_0x31ddff];return _0xabf5b;};'use strict';var multer=require(_0x10d9('0x0'));var util=require(_0x10d9('0x1'));var path=require(_0x10d9('0x2'));var timeout=require(_0x10d9('0x3'));var express=require('express');var router=express[_0x10d9('0x4')]();var auth=require(_0x10d9('0x5'));var interaction=require(_0x10d9('0x6'));var config=require('../../config/environment');module[_0x10d9('0x7')]=router; \ No newline at end of file +var _0x8b52=['exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x8b52,0x151));var _0x28b5=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8b52[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x28b5('0x0'));var util=require(_0x28b5('0x1'));var path=require(_0x28b5('0x2'));var timeout=require('connect-timeout');var express=require(_0x28b5('0x3'));var router=express[_0x28b5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x28b5('0x5'));var config=require(_0x28b5('0x6'));module[_0x28b5('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 ce919af..174d153 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 _0xec3f=['sequelize','exports','INTEGER'];(function(_0x48801e,_0x2d545f){var _0x2a6a00=function(_0x17162e){while(--_0x17162e){_0x48801e['push'](_0x48801e['shift']());}};_0x2a6a00(++_0x2d545f);}(_0xec3f,0x69));var _0xfec3=function(_0x51fd88,_0x2a1d38){_0x51fd88=_0x51fd88-0x0;var _0x1ee823=_0xec3f[_0x51fd88];return _0x1ee823;};'use strict';var Sequelize=require(_0xfec3('0x0'));module[_0xfec3('0x1')]={'penalty':{'type':Sequelize[_0xfec3('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xce5f=['INTEGER','exports'];(function(_0x50e082,_0x57e3c1){var _0x130474=function(_0x2fa4bb){while(--_0x2fa4bb){_0x50e082['push'](_0x50e082['shift']());}};_0x130474(++_0x57e3c1);}(_0xce5f,0x14b));var _0xfce5=function(_0x5c0d05,_0x1d4c5b){_0x5c0d05=_0x5c0d05-0x0;var _0x1d8fce=_0xce5f[_0x5c0d05];return _0x1d8fce;};'use strict';var Sequelize=require('sequelize');module[_0xfce5('0x0')]={'penalty':{'type':Sequelize[_0xfce5('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index ae4656b..96d32f8 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 _0xf903=['define','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./userSmsQueue.attributes','exports'];(function(_0x16715a,_0x41b9bb){var _0x511c46=function(_0x3260c7){while(--_0x3260c7){_0x16715a['push'](_0x16715a['shift']());}};_0x511c46(++_0x41b9bb);}(_0xf903,0x10b));var _0x3f90=function(_0x35ff7b,_0x22d6f0){_0x35ff7b=_0x35ff7b-0x0;var _0x4c0ea8=_0xf903[_0x35ff7b];return _0x4c0ea8;};'use strict';var _=require('lodash');var util=require(_0x3f90('0x0'));var logger=require(_0x3f90('0x1'))(_0x3f90('0x2'));var moment=require('moment');var BPromise=require(_0x3f90('0x3'));var rp=require(_0x3f90('0x4'));var fs=require('fs');var path=require(_0x3f90('0x5'));var rimraf=require(_0x3f90('0x6'));var config=require('../../config/environment');var attributes=require(_0x3f90('0x7'));module[_0x3f90('0x8')]=function(_0x452c98,_0x5888e3){return _0x452c98[_0x3f90('0x9')](_0x3f90('0xa'),attributes,{'tableName':_0x3f90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x620b=['util','../../config/logger','path','../../config/environment','define','UserSmsQueue','user_has_sms_queues','lodash'];(function(_0x363eb6,_0x28d16c){var _0x546fa6=function(_0xcf1362){while(--_0xcf1362){_0x363eb6['push'](_0x363eb6['shift']());}};_0x546fa6(++_0x28d16c);}(_0x620b,0x167));var _0xb620=function(_0x1213b7,_0x58b9de){_0x1213b7=_0x1213b7-0x0;var _0x29b25b=_0x620b[_0x1213b7];return _0x29b25b;};'use strict';var _=require(_0xb620('0x0'));var util=require(_0xb620('0x1'));var logger=require(_0xb620('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb620('0x3'));var rimraf=require('rimraf');var config=require(_0xb620('0x4'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x4294a3,_0x591814){return _0x4294a3[_0xb620('0x5')](_0xb620('0x6'),attributes,{'tableName':_0xb620('0x7'),'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 67014c5..d49736e 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 _0xa8c8=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','code','error','message','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4f5781,_0x4d65cd){var _0x28f81a=function(_0x4b1af8){while(--_0x4b1af8){_0x4f5781['push'](_0x4f5781['shift']());}};_0x28f81a(++_0x4d65cd);}(_0xa8c8,0x199));var _0x8a8c=function(_0x14f413,_0x106bb0){_0x14f413=_0x14f413-0x0;var _0xa8a98=_0xa8c8[_0x14f413];return _0xa8a98;};'use strict';var _=require('lodash');var util=require(_0x8a8c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8a8c('0x1'));var fs=require('fs');var Redis=require(_0x8a8c('0x2'));var db=require(_0x8a8c('0x3'))['db'];var utils=require(_0x8a8c('0x4'));var logger=require(_0x8a8c('0x5'))(_0x8a8c('0x6'));var config=require(_0x8a8c('0x7'));var jayson=require(_0x8a8c('0x8'));var client=jayson[_0x8a8c('0x9')][_0x8a8c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x79e924,_0x268ee6,_0x187f7f){return new BPromise(function(_0x570c90,_0xfa7e83){return client['request'](_0x79e924,_0x187f7f)['then'](function(_0xf182d1){logger['info'](_0x8a8c('0xb'),_0x268ee6,_0x8a8c('0xc'));logger[_0x8a8c('0xd')](_0x8a8c('0xe'),_0x268ee6,'request\x20sent',JSON['stringify'](_0xf182d1));if(_0xf182d1['error']){if(_0xf182d1['error'][_0x8a8c('0xf')]===0x1f4){logger[_0x8a8c('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x268ee6,_0xf182d1['error'][_0x8a8c('0x11')]);return _0xfa7e83(_0xf182d1[_0x8a8c('0x10')][_0x8a8c('0x11')]);}logger[_0x8a8c('0x10')](_0x8a8c('0xb'),_0x268ee6,_0xf182d1[_0x8a8c('0x10')]['message']);return _0x570c90(_0xf182d1[_0x8a8c('0x10')][_0x8a8c('0x11')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x268ee6,_0x8a8c('0xc'));_0x570c90(_0xf182d1['result']['message']);}})['catch'](function(_0x46bd48){logger[_0x8a8c('0x10')](_0x8a8c('0xb'),_0x268ee6,_0x46bd48);_0xfa7e83(_0x46bd48);});});} \ No newline at end of file +var _0x00e0=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring'];(function(_0x4b5493,_0x3c291b){var _0x345be4=function(_0x4057d1){while(--_0x4057d1){_0x4b5493['push'](_0x4b5493['shift']());}};_0x345be4(++_0x3c291b);}(_0x00e0,0x1e0));var _0x000e=function(_0x1b51ba,_0x55de77){_0x1b51ba=_0x1b51ba-0x0;var _0x4f8b20=_0x00e0[_0x1b51ba];return _0x4f8b20;};'use strict';var _=require(_0x000e('0x0'));var util=require(_0x000e('0x1'));var moment=require('moment');var BPromise=require(_0x000e('0x2'));var rs=require(_0x000e('0x3'));var fs=require('fs');var Redis=require(_0x000e('0x4'));var db=require(_0x000e('0x5'))['db'];var utils=require(_0x000e('0x6'));var logger=require(_0x000e('0x7'))(_0x000e('0x8'));var config=require('../../config/environment');var jayson=require(_0x000e('0x9'));var client=jayson['client'][_0x000e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ba8aa,_0x1aa8bf,_0x485026){return new BPromise(function(_0x3711e5,_0x3302b6){return client[_0x000e('0xb')](_0x5ba8aa,_0x485026)[_0x000e('0xc')](function(_0x4ee6f3){logger[_0x000e('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x1aa8bf,_0x000e('0xe'));logger['debug'](_0x000e('0xf'),_0x1aa8bf,_0x000e('0xe'),JSON[_0x000e('0x10')](_0x4ee6f3));if(_0x4ee6f3[_0x000e('0x11')]){if(_0x4ee6f3[_0x000e('0x11')][_0x000e('0x12')]===0x1f4){logger['error'](_0x000e('0x13'),_0x1aa8bf,_0x4ee6f3[_0x000e('0x11')][_0x000e('0x14')]);return _0x3302b6(_0x4ee6f3[_0x000e('0x11')][_0x000e('0x14')]);}logger[_0x000e('0x11')](_0x000e('0x13'),_0x1aa8bf,_0x4ee6f3['error'][_0x000e('0x14')]);return _0x3711e5(_0x4ee6f3[_0x000e('0x11')][_0x000e('0x14')]);}else{logger[_0x000e('0xd')](_0x000e('0x13'),_0x1aa8bf,_0x000e('0xe'));_0x3711e5(_0x4ee6f3[_0x000e('0x15')]['message']);}})['catch'](function(_0x223d4d){logger[_0x000e('0x11')](_0x000e('0x13'),_0x1aa8bf,_0x223d4d);_0x3302b6(_0x223d4d);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index b36733b..8a89655 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 _0xaf5a=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','util','path'];(function(_0x237ceb,_0x32f96a){var _0xd6b296=function(_0x5df106){while(--_0x5df106){_0x237ceb['push'](_0x237ceb['shift']());}};_0xd6b296(++_0x32f96a);}(_0xaf5a,0x116));var _0xaaf5=function(_0x41b4df,_0x15b067){_0x41b4df=_0x41b4df-0x0;var _0x55d4dc=_0xaf5a[_0x41b4df];return _0x55d4dc;};'use strict';var multer=require('multer');var util=require(_0xaaf5('0x0'));var path=require(_0xaaf5('0x1'));var timeout=require(_0xaaf5('0x2'));var express=require(_0xaaf5('0x3'));var router=express[_0xaaf5('0x4')]();var auth=require(_0xaaf5('0x5'));var interaction=require(_0xaaf5('0x6'));var config=require(_0xaaf5('0x7'));module['exports']=router; \ No newline at end of file +var _0xbc48=['../../config/environment','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3548f9,_0x16d920){var _0x3ee621=function(_0x517120){while(--_0x517120){_0x3548f9['push'](_0x3548f9['shift']());}};_0x3ee621(++_0x16d920);}(_0xbc48,0x111));var _0x8bc4=function(_0x21abf1,_0xcd06d){_0x21abf1=_0x21abf1-0x0;var _0x8f3ba=_0xbc48[_0x21abf1];return _0x8f3ba;};'use strict';var multer=require(_0x8bc4('0x0'));var util=require(_0x8bc4('0x1'));var path=require(_0x8bc4('0x2'));var timeout=require(_0x8bc4('0x3'));var express=require('express');var router=express[_0x8bc4('0x4')]();var auth=require(_0x8bc4('0x5'));var interaction=require(_0x8bc4('0x6'));var config=require(_0x8bc4('0x7'));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 5413216..839c2cd 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 _0xa304=['INTEGER','sequelize','exports'];(function(_0x1e4910,_0x1ad685){var _0x2dd260=function(_0x4c18dd){while(--_0x4c18dd){_0x1e4910['push'](_0x1e4910['shift']());}};_0x2dd260(++_0x1ad685);}(_0xa304,0x1ab));var _0x4a30=function(_0x9df3d8,_0x4074e3){_0x9df3d8=_0x9df3d8-0x0;var _0x366da1=_0xa304[_0x9df3d8];return _0x366da1;};'use strict';var Sequelize=require(_0x4a30('0x0'));module[_0x4a30('0x1')]={'penalty':{'type':Sequelize[_0x4a30('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1f5e=['exports','sequelize'];(function(_0x2c0ded,_0x3de22c){var _0x4473e5=function(_0x3705bc){while(--_0x3705bc){_0x2c0ded['push'](_0x2c0ded['shift']());}};_0x4473e5(++_0x3de22c);}(_0x1f5e,0x1e9));var _0xe1f5=function(_0x2c4f56,_0x2318d7){_0x2c4f56=_0x2c4f56-0x0;var _0x3fadf3=_0x1f5e[_0x2c4f56];return _0x3fadf3;};'use strict';var Sequelize=require(_0xe1f5('0x0'));module[_0xe1f5('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 d314856..caecd38 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 _0x566a=['lodash','../../config/logger','request-promise','path','rimraf','./userVoiceQueue.attributes','exports','define'];(function(_0x418549,_0x11b13d){var _0x288826=function(_0x3c0411){while(--_0x3c0411){_0x418549['push'](_0x418549['shift']());}};_0x288826(++_0x11b13d);}(_0x566a,0xc8));var _0xa566=function(_0x1598e0,_0x14d88c){_0x1598e0=_0x1598e0-0x0;var _0x118be1=_0x566a[_0x1598e0];return _0x118be1;};'use strict';var _=require(_0xa566('0x0'));var util=require('util');var logger=require(_0xa566('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa566('0x2'));var fs=require('fs');var path=require(_0xa566('0x3'));var rimraf=require(_0xa566('0x4'));var config=require('../../config/environment');var attributes=require(_0xa566('0x5'));module[_0xa566('0x6')]=function(_0x4b03ce,_0x4b7394){return _0x4b03ce[_0xa566('0x7')]('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa501=['user_has_voice_queues','lodash','util','api','moment','request-promise','path','exports','define'];(function(_0x565fed,_0xb85768){var _0x3e018f=function(_0x104d8e){while(--_0x104d8e){_0x565fed['push'](_0x565fed['shift']());}};_0x3e018f(++_0xb85768);}(_0xa501,0x18d));var _0x1a50=function(_0x332a92,_0x57f175){_0x332a92=_0x332a92-0x0;var _0x285f14=_0xa501[_0x332a92];return _0x285f14;};'use strict';var _=require(_0x1a50('0x0'));var util=require(_0x1a50('0x1'));var logger=require('../../config/logger')(_0x1a50('0x2'));var moment=require(_0x1a50('0x3'));var BPromise=require('bluebird');var rp=require(_0x1a50('0x4'));var fs=require('fs');var path=require(_0x1a50('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userVoiceQueue.attributes');module[_0x1a50('0x6')]=function(_0x394029,_0x56fe32){return _0x394029[_0x1a50('0x7')]('UserVoiceQueue',attributes,{'tableName':_0x1a50('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index bd7ccd7..84820a1 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 _0xbbc3=['jayson/promise','client','http','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment'];(function(_0x2508d4,_0x5a53f8){var _0x27c0ca=function(_0x546492){while(--_0x546492){_0x2508d4['push'](_0x2508d4['shift']());}};_0x27c0ca(++_0x5a53f8);}(_0xbbc3,0x93));var _0x3bbc=function(_0x133750,_0x33cef8){_0x133750=_0x133750-0x0;var _0x3de986=_0xbbc3[_0x133750];return _0x3de986;};'use strict';var _=require('lodash');var util=require(_0x3bbc('0x0'));var moment=require(_0x3bbc('0x1'));var BPromise=require(_0x3bbc('0x2'));var rs=require(_0x3bbc('0x3'));var fs=require('fs');var Redis=require(_0x3bbc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3bbc('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3bbc('0x6'));var jayson=require(_0x3bbc('0x7'));var client=jayson[_0x3bbc('0x8')][_0x3bbc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x140766,_0x2f0f4d,_0x1cce5c){return new BPromise(function(_0x467a32,_0x4a06d6){return client['request'](_0x140766,_0x1cce5c)[_0x3bbc('0xa')](function(_0x4b5252){logger['info'](_0x3bbc('0xb'),_0x2f0f4d,_0x3bbc('0xc'));logger[_0x3bbc('0xd')](_0x3bbc('0xe'),_0x2f0f4d,'request\x20sent',JSON[_0x3bbc('0xf')](_0x4b5252));if(_0x4b5252[_0x3bbc('0x10')]){if(_0x4b5252[_0x3bbc('0x10')][_0x3bbc('0x11')]===0x1f4){logger[_0x3bbc('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x2f0f4d,_0x4b5252['error'][_0x3bbc('0x12')]);return _0x4a06d6(_0x4b5252[_0x3bbc('0x10')][_0x3bbc('0x12')]);}logger[_0x3bbc('0x10')](_0x3bbc('0xb'),_0x2f0f4d,_0x4b5252['error'][_0x3bbc('0x12')]);return _0x467a32(_0x4b5252['error']['message']);}else{logger[_0x3bbc('0x13')](_0x3bbc('0xb'),_0x2f0f4d,_0x3bbc('0xc'));_0x467a32(_0x4b5252[_0x3bbc('0x14')][_0x3bbc('0x12')]);}})[_0x3bbc('0x15')](function(_0x4a2dd5){logger['error'](_0x3bbc('0xb'),_0x2f0f4d,_0x4a2dd5);_0x4a06d6(_0x4a2dd5);});});} \ No newline at end of file +var _0x25fe=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring'];(function(_0x1689c0,_0x55c70f){var _0x3bb750=function(_0x231022){while(--_0x231022){_0x1689c0['push'](_0x1689c0['shift']());}};_0x3bb750(++_0x55c70f);}(_0x25fe,0x1f4));var _0xe25f=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x25fe[_0x138f59];return _0x3d114d;};'use strict';var _=require('lodash');var util=require(_0xe25f('0x0'));var moment=require(_0xe25f('0x1'));var BPromise=require(_0xe25f('0x2'));var rs=require(_0xe25f('0x3'));var fs=require('fs');var Redis=require(_0xe25f('0x4'));var db=require(_0xe25f('0x5'))['db'];var utils=require(_0xe25f('0x6'));var logger=require(_0xe25f('0x7'))(_0xe25f('0x8'));var config=require(_0xe25f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe25f('0xa')][_0xe25f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c8e43,_0x2dbc4e,_0x305c95){return new BPromise(function(_0x568053,_0x4c25de){return client[_0xe25f('0xc')](_0x2c8e43,_0x305c95)[_0xe25f('0xd')](function(_0x580ed2){logger[_0xe25f('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x2dbc4e,'request\x20sent');logger[_0xe25f('0xf')](_0xe25f('0x10'),_0x2dbc4e,_0xe25f('0x11'),JSON[_0xe25f('0x12')](_0x580ed2));if(_0x580ed2['error']){if(_0x580ed2[_0xe25f('0x13')][_0xe25f('0x14')]===0x1f4){logger['error'](_0xe25f('0x15'),_0x2dbc4e,_0x580ed2[_0xe25f('0x13')][_0xe25f('0x16')]);return _0x4c25de(_0x580ed2[_0xe25f('0x13')]['message']);}logger[_0xe25f('0x13')](_0xe25f('0x15'),_0x2dbc4e,_0x580ed2[_0xe25f('0x13')]['message']);return _0x568053(_0x580ed2[_0xe25f('0x13')][_0xe25f('0x16')]);}else{logger['info'](_0xe25f('0x15'),_0x2dbc4e,_0xe25f('0x11'));_0x568053(_0x580ed2['result'][_0xe25f('0x16')]);}})[_0xe25f('0x17')](function(_0x2be09b){logger[_0xe25f('0x13')](_0xe25f('0x15'),_0x2dbc4e,_0x2be09b);_0x4c25de(_0x2be09b);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index fed8224..1ad1f5e 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 _0xee87=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util'];(function(_0x4cb081,_0xdf68cb){var _0x291cc4=function(_0x1161b8){while(--_0x1161b8){_0x4cb081['push'](_0x4cb081['shift']());}};_0x291cc4(++_0xdf68cb);}(_0xee87,0x10d));var _0x7ee8=function(_0x422e74,_0x21c850){_0x422e74=_0x422e74-0x0;var _0x3efefd=_0xee87[_0x422e74];return _0x3efefd;};'use strict';var multer=require('multer');var util=require(_0x7ee8('0x0'));var path=require(_0x7ee8('0x1'));var timeout=require(_0x7ee8('0x2'));var express=require(_0x7ee8('0x3'));var router=express[_0x7ee8('0x4')]();var auth=require(_0x7ee8('0x5'));var interaction=require(_0x7ee8('0x6'));var config=require(_0x7ee8('0x7'));module[_0x7ee8('0x8')]=router; \ No newline at end of file +var _0x1a61=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x1a61,0x1e6));var _0x11a6=function(_0x3db56a,_0xd09496){_0x3db56a=_0x3db56a-0x0;var _0x2ecc83=_0x1a61[_0x3db56a];return _0x2ecc83;};'use strict';var multer=require(_0x11a6('0x0'));var util=require('util');var path=require(_0x11a6('0x1'));var timeout=require('connect-timeout');var express=require(_0x11a6('0x2'));var router=express[_0x11a6('0x3')]();var auth=require(_0x11a6('0x4'));var interaction=require(_0x11a6('0x5'));var config=require('../../config/environment');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 bd6a5f0..81fbee1 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 _0x4baf=['Required\x20by\x20Asterisk','STRING','queue_interface','INTEGER'];(function(_0x24c970,_0x1199ef){var _0x48f700=function(_0x5d22fe){while(--_0x5d22fe){_0x24c970['push'](_0x24c970['shift']());}};_0x48f700(++_0x1199ef);}(_0x4baf,0xac));var _0xf4ba=function(_0x1e4180,_0x4d8d35){_0x1e4180=_0x1e4180-0x0;var _0x86f6e7=_0x4baf[_0x1e4180];return _0x86f6e7;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xf4ba('0x0')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xf4ba('0x0')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xf4ba('0x1')],'allowNull':![],'unique':_0xf4ba('0x2'),'comment':_0xf4ba('0x0')},'VoiceQueueId':{'type':Sequelize[_0xf4ba('0x3')],'allowNull':![]},'interface':{'type':Sequelize[_0xf4ba('0x1')],'allowNull':![],'unique':_0xf4ba('0x2'),'comment':_0xf4ba('0x0')},'penalty':{'type':Sequelize[_0xf4ba('0x3')](0xb),'defaultValue':0x0,'comment':_0xf4ba('0x0')},'paused':{'type':Sequelize[_0xf4ba('0x3')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x43a0=['STRING','INTEGER','queue_interface','sequelize','exports','Required\x20by\x20Asterisk'];(function(_0x366a4c,_0x4eae67){var _0x2132b4=function(_0x56c000){while(--_0x56c000){_0x366a4c['push'](_0x366a4c['shift']());}};_0x2132b4(++_0x4eae67);}(_0x43a0,0x15f));var _0x043a=function(_0x23c07e,_0x5d59ea){_0x23c07e=_0x23c07e-0x0;var _0x5036a0=_0x43a0[_0x23c07e];return _0x5036a0;};'use strict';var Sequelize=require(_0x043a('0x0'));module[_0x043a('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x043a('0x2')},'membername':{'type':Sequelize[_0x043a('0x3')],'allowNull':![],'comment':_0x043a('0x2')},'UserId':{'type':Sequelize[_0x043a('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x043a('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x043a('0x2')},'VoiceQueueId':{'type':Sequelize[_0x043a('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0x043a('0x3')],'allowNull':![],'unique':_0x043a('0x5'),'comment':_0x043a('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x043a('0x2')},'paused':{'type':Sequelize[_0x043a('0x4')](0xb),'defaultValue':0x0,'comment':_0x043a('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 6e1b394..3346978 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 _0xdd4f=['events','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x3ef45e,_0xe84f33){var _0x69e7c=function(_0x43ba11){while(--_0x43ba11){_0x3ef45e['push'](_0x3ef45e['shift']());}};_0x69e7c(++_0xe84f33);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x94a081,_0x2b206c){_0x94a081=_0x94a081-0x0;var _0x21b547=_0xdd4f[_0x94a081];return _0x21b547;};'use strict';var EventEmitter=require(_0xfdd4('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfdd4('0x1'),'afterUpdate':_0xfdd4('0x2'),'afterDestroy':'remove'};function emitEvent(_0x1e9394){return function(_0x3175f6,_0x6b2b0d,_0x554e44){UserVoiceQueueRtEvents[_0xfdd4('0x3')](_0x1e9394+':'+_0x3175f6['id'],_0x3175f6);UserVoiceQueueRtEvents[_0xfdd4('0x3')](_0x1e9394,_0x3175f6);_0x554e44(null);};}for(var e in events){if(events[_0xfdd4('0x4')](e)){var event=events[e];UserVoiceQueueRt[_0xfdd4('0x5')](e,emitEvent(event));}}module[_0xfdd4('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x1a85=['save','emit','hasOwnProperty','exports','UserVoiceQueueRt','setMaxListeners'];(function(_0x146608,_0x1c102a){var _0x57dab8=function(_0x425f00){while(--_0x425f00){_0x146608['push'](_0x146608['shift']());}};_0x57dab8(++_0x1c102a);}(_0x1a85,0x178));var _0x51a8=function(_0x1e73fc,_0x533750){_0x1e73fc=_0x1e73fc-0x0;var _0xeceac4=_0x1a85[_0x1e73fc];return _0xeceac4;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x51a8('0x0')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x51a8('0x1')](0x0);var events={'afterCreate':_0x51a8('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3fba94){return function(_0x1377a4,_0x99e371,_0x48a21b){UserVoiceQueueRtEvents[_0x51a8('0x3')](_0x3fba94+':'+_0x1377a4['id'],_0x1377a4);UserVoiceQueueRtEvents['emit'](_0x3fba94,_0x1377a4);_0x48a21b(null);};}for(var e in events){if(events[_0x51a8('0x4')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x51a8('0x5')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index ce9d597..4fca425 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 _0xb6ce=['exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1ccc9b,_0x3e7ec5){var _0x546c41=function(_0x15a0b4){while(--_0x15a0b4){_0x1ccc9b['push'](_0x1ccc9b['shift']());}};_0x546c41(++_0x3e7ec5);}(_0xb6ce,0xad));var _0xeb6c=function(_0x7befb3,_0x357b01){_0x7befb3=_0x7befb3-0x0;var _0x45cca0=_0xb6ce[_0x7befb3];return _0x45cca0;};'use strict';var _=require(_0xeb6c('0x0'));var util=require(_0xeb6c('0x1'));var logger=require('../../config/logger')(_0xeb6c('0x2'));var moment=require(_0xeb6c('0x3'));var BPromise=require(_0xeb6c('0x4'));var rp=require(_0xeb6c('0x5'));var fs=require('fs');var path=require(_0xeb6c('0x6'));var rimraf=require(_0xeb6c('0x7'));var config=require(_0xeb6c('0x8'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xeb6c('0x9')]=function(_0x5b4eff,_0xdbd9e6){return _0x5b4eff[_0xeb6c('0xa')](_0xeb6c('0xb'),attributes,{'tableName':_0xeb6c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe375=['bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment'];(function(_0x35acd8,_0x2ba62d){var _0x4d7dfb=function(_0x345de6){while(--_0x345de6){_0x35acd8['push'](_0x35acd8['shift']());}};_0x4d7dfb(++_0x2ba62d);}(_0xe375,0x167));var _0x5e37=function(_0x50f458,_0x29ba8e){_0x50f458=_0x50f458-0x0;var _0x435d49=_0xe375[_0x50f458];return _0x435d49;};'use strict';var _=require(_0x5e37('0x0'));var util=require(_0x5e37('0x1'));var logger=require(_0x5e37('0x2'))(_0x5e37('0x3'));var moment=require(_0x5e37('0x4'));var BPromise=require(_0x5e37('0x5'));var rp=require(_0x5e37('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5e37('0x7'));var config=require(_0x5e37('0x8'));var attributes=require(_0x5e37('0x9'));module[_0x5e37('0xa')]=function(_0x444873,_0x3702d1){return _0x444873[_0x5e37('0xb')]('UserVoiceQueueRt',attributes,{'tableName':_0x5e37('0xc'),'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 de42d7b..54e68ab 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 _0x72d3=['request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','catch','util','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s'];(function(_0x377abd,_0x25df89){var _0x486c2d=function(_0x2f68e9){while(--_0x2f68e9){_0x377abd['push'](_0x377abd['shift']());}};_0x486c2d(++_0x25df89);}(_0x72d3,0x1bf));var _0x372d=function(_0x58a070,_0xec54a5){_0x58a070=_0x58a070-0x0;var _0x18b084=_0x72d3[_0x58a070];return _0x18b084;};'use strict';var _=require('lodash');var util=require(_0x372d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x372d('0x1'));var db=require(_0x372d('0x2'))['db'];var utils=require(_0x372d('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x372d('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x372d('0x5')][_0x372d('0x6')]({'port':0x232a});config[_0x372d('0x7')]=_[_0x372d('0x8')](config[_0x372d('0x7')],{'host':_0x372d('0x9'),'port':0x18eb});var socket=require(_0x372d('0xa'))(new Redis(config[_0x372d('0x7')]));require('./userVoiceQueueRt.socket')[_0x372d('0xb')](socket);function respondWithRpcPromise(_0xaab5a1,_0x5e45aa,_0x1b7a3c){return new BPromise(function(_0x5965c4,_0x267c89){return client['request'](_0xaab5a1,_0x1b7a3c)[_0x372d('0xc')](function(_0x4726bc){logger[_0x372d('0xd')](_0x372d('0xe'),_0x5e45aa,_0x372d('0xf'));logger[_0x372d('0x10')](_0x372d('0x11'),_0x5e45aa,_0x372d('0xf'),JSON[_0x372d('0x12')](_0x4726bc));if(_0x4726bc[_0x372d('0x13')]){if(_0x4726bc[_0x372d('0x13')]['code']===0x1f4){logger[_0x372d('0x13')](_0x372d('0xe'),_0x5e45aa,_0x4726bc['error'][_0x372d('0x14')]);return _0x267c89(_0x4726bc[_0x372d('0x13')][_0x372d('0x14')]);}logger[_0x372d('0x13')](_0x372d('0xe'),_0x5e45aa,_0x4726bc[_0x372d('0x13')][_0x372d('0x14')]);return _0x5965c4(_0x4726bc['error'][_0x372d('0x14')]);}else{logger[_0x372d('0xd')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x5e45aa,_0x372d('0xf'));_0x5965c4(_0x4726bc[_0x372d('0x15')][_0x372d('0x14')]);}})['catch'](function(_0x2855fa){logger[_0x372d('0x13')](_0x372d('0xe'),_0x5e45aa,_0x2855fa);_0x267c89(_0x2855fa);});});}exports[_0x372d('0x16')]=function(_0xc5573e){var _0x1cd316=this;return new Promise(function(_0x5bf65e,_0x40633e){return db['UserVoiceQueueRt'][_0x372d('0x17')]({'raw':_0xc5573e[_0x372d('0x18')]?_0xc5573e[_0x372d('0x18')][_0x372d('0x19')]===undefined?!![]:![]:!![],'where':_0xc5573e[_0x372d('0x18')]?_0xc5573e[_0x372d('0x18')][_0x372d('0x1a')]||null:null,'attributes':[[db[_0x372d('0x1b')]['fn'](_0x372d('0x1c'),db[_0x372d('0x1b')]['fn']('IF',db['sequelize'][_0x372d('0x1d')](_0x372d('0x1e')))),_0x372d('0x1f')]]})['then'](function(_0x4660b0){logger['info'](_0x372d('0x16'),_0xc5573e);logger[_0x372d('0x10')](_0x372d('0x16'),_0xc5573e,JSON['stringify'](_0x4660b0));_0x5bf65e(_0x4660b0);})[_0x372d('0x20')](function(_0x1b4b7c){logger[_0x372d('0x13')]('GetVoiceQueueRtPauses',_0x1b4b7c['message'],_0xc5573e);_0x40633e(_0x1cd316[_0x372d('0x13')](0x1f4,_0x1b4b7c['message']));});});}; \ No newline at end of file +var _0x7004=['rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./userVoiceQueueRt.socket','then','info','UserVoiceQueueRt,\x20%s,\x20%s','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','debug','lodash','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0xecb86f,_0x75addc){var _0xdb9e3b=function(_0x4fb429){while(--_0x4fb429){_0xecb86f['push'](_0xecb86f['shift']());}};_0xdb9e3b(++_0x75addc);}(_0x7004,0xe8));var _0x4700=function(_0x467b5d,_0x22ca71){_0x467b5d=_0x467b5d-0x0;var _0x3a64da=_0x7004[_0x467b5d];return _0x3a64da;};'use strict';var _=require(_0x4700('0x0'));var util=require('util');var moment=require(_0x4700('0x1'));var BPromise=require(_0x4700('0x2'));var rs=require(_0x4700('0x3'));var fs=require('fs');var Redis=require(_0x4700('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4700('0x5'))(_0x4700('0x6'));var config=require(_0x4700('0x7'));var jayson=require(_0x4700('0x8'));var client=jayson['client'][_0x4700('0x9')]({'port':0x232a});config[_0x4700('0xa')]=_['defaults'](config[_0x4700('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4700('0xb'))(new Redis(config['redis']));require(_0x4700('0xc'))['register'](socket);function respondWithRpcPromise(_0x2df667,_0x544281,_0x263aee){return new BPromise(function(_0x1a7b33,_0x5ba224){return client['request'](_0x2df667,_0x263aee)[_0x4700('0xd')](function(_0x33768b){logger[_0x4700('0xe')](_0x4700('0xf'),_0x544281,'request\x20sent');logger['debug'](_0x4700('0x10'),_0x544281,_0x4700('0x11'),JSON[_0x4700('0x12')](_0x33768b));if(_0x33768b['error']){if(_0x33768b[_0x4700('0x13')]['code']===0x1f4){logger[_0x4700('0x13')](_0x4700('0xf'),_0x544281,_0x33768b[_0x4700('0x13')]['message']);return _0x5ba224(_0x33768b[_0x4700('0x13')][_0x4700('0x14')]);}logger[_0x4700('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x544281,_0x33768b['error'][_0x4700('0x14')]);return _0x1a7b33(_0x33768b['error'][_0x4700('0x14')]);}else{logger[_0x4700('0xe')](_0x4700('0xf'),_0x544281,_0x4700('0x11'));_0x1a7b33(_0x33768b[_0x4700('0x15')]['message']);}})[_0x4700('0x16')](function(_0x40029a){logger[_0x4700('0x13')](_0x4700('0xf'),_0x544281,_0x40029a);_0x5ba224(_0x40029a);});});}exports[_0x4700('0x17')]=function(_0x2c1089){var _0x3b9def=this;return new Promise(function(_0xfe8e86,_0x5740b5){return db[_0x4700('0x18')]['findAll']({'raw':_0x2c1089[_0x4700('0x19')]?_0x2c1089[_0x4700('0x19')][_0x4700('0x1a')]===undefined?!![]:![]:!![],'where':_0x2c1089[_0x4700('0x19')]?_0x2c1089[_0x4700('0x19')][_0x4700('0x1b')]||null:null,'attributes':[[db['sequelize']['fn'](_0x4700('0x1c'),db[_0x4700('0x1d')]['fn']('IF',db[_0x4700('0x1d')][_0x4700('0x1e')](_0x4700('0x1f')))),_0x4700('0x20')]]})[_0x4700('0xd')](function(_0x4253f5){logger[_0x4700('0xe')](_0x4700('0x17'),_0x2c1089);logger[_0x4700('0x21')](_0x4700('0x17'),_0x2c1089,JSON[_0x4700('0x12')](_0x4253f5));_0xfe8e86(_0x4253f5);})[_0x4700('0x16')](function(_0x4a8f2a){logger[_0x4700('0x13')](_0x4700('0x17'),_0x4a8f2a[_0x4700('0x14')],_0x2c1089);_0x5740b5(_0x3b9def['error'](0x1f4,_0x4a8f2a[_0x4700('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 7b8f4b0..4be6c0f 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 _0x9c5a=['userVoiceQueueRt:','./userVoiceQueueRt.events','save','update','register'];(function(_0x4e9811,_0x3269d2){var _0x50d2dd=function(_0x30c263){while(--_0x30c263){_0x4e9811['push'](_0x4e9811['shift']());}};_0x50d2dd(++_0x3269d2);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x161365,_0x18e27e){_0x161365=_0x161365-0x0;var _0x5b48e0=_0x9c5a[_0x161365];return _0x5b48e0;};'use strict';var UserVoiceQueueRtEvents=require(_0xa9c5('0x0'));var events=[_0xa9c5('0x1'),'remove',_0xa9c5('0x2')];function createListener(_0x1cd14d,_0x1d0ee9){return function(_0x32e75a){_0x1d0ee9['emit'](_0x1cd14d,_0x32e75a);};}function removeListener(_0x2acfaf,_0x3051b1){return function(){UserVoiceQueueRtEvents['removeListener'](_0x2acfaf,_0x3051b1);};}exports[_0xa9c5('0x3')]=function(_0x4d9c7a){for(var _0x394d84=0x0,_0x3df556=events['length'];_0x394d84<_0x3df556;_0x394d84++){var _0x4b6db6=events[_0x394d84];var _0x3d6b50=createListener(_0xa9c5('0x4')+_0x4b6db6,_0x4d9c7a);UserVoiceQueueRtEvents['on'](_0x4b6db6,_0x3d6b50);}}; \ No newline at end of file +var _0x56e7=['emit','removeListener','length','save','remove'];(function(_0x3125d1,_0x221e5b){var _0x1d9a7e=function(_0x529b16){while(--_0x529b16){_0x3125d1['push'](_0x3125d1['shift']());}};_0x1d9a7e(++_0x221e5b);}(_0x56e7,0x7b));var _0x756e=function(_0xa8bddd,_0x410a04){_0xa8bddd=_0xa8bddd-0x0;var _0x1e60fe=_0x56e7[_0xa8bddd];return _0x1e60fe;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x756e('0x0'),_0x756e('0x1'),'update'];function createListener(_0x2eadee,_0x3efe5c){return function(_0x46a672){_0x3efe5c[_0x756e('0x2')](_0x2eadee,_0x46a672);};}function removeListener(_0x11ce5f,_0x38546a){return function(){UserVoiceQueueRtEvents[_0x756e('0x3')](_0x11ce5f,_0x38546a);};}exports['register']=function(_0x3b3b8f){for(var _0x404189=0x0,_0x26519d=events[_0x756e('0x4')];_0x404189<_0x26519d;_0x404189++){var _0x5c8589=events[_0x404189];var _0x1c6a22=createListener('userVoiceQueueRt:'+_0x5c8589,_0x3b3b8f);UserVoiceQueueRtEvents['on'](_0x5c8589,_0x1c6a22);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index e02c63a..c92b6cc 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 _0x4522=['destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete'];(function(_0x492221,_0x9e2521){var _0x398bf9=function(_0x303c5b){while(--_0x303c5b){_0x492221['push'](_0x492221['shift']());}};_0x398bf9(++_0x9e2521);}(_0x4522,0x1a0));var _0x2452=function(_0x15e19c,_0x193a43){_0x15e19c=_0x15e19c-0x0;var _0x22bfa6=_0x4522[_0x15e19c];return _0x22bfa6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2452('0x0'));var timeout=require(_0x2452('0x1'));var express=require(_0x2452('0x2'));var router=express['Router']();var auth=require(_0x2452('0x3'));var interaction=require(_0x2452('0x4'));var config=require(_0x2452('0x5'));var controller=require(_0x2452('0x6'));router[_0x2452('0x7')]('/',auth[_0x2452('0x8')](),controller[_0x2452('0x9')]);router[_0x2452('0x7')](_0x2452('0xa'),auth[_0x2452('0x8')](),controller[_0x2452('0xb')]);router[_0x2452('0xc')]('/',auth[_0x2452('0x8')](),controller[_0x2452('0xd')]);router[_0x2452('0xe')](_0x2452('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x2452('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x2452('0x10')]);module[_0x2452('0x11')]=router; \ No newline at end of file +var _0x22fb=['delete','destroy','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x179314,_0x32d3a2){var _0x3556f7=function(_0x16244e){while(--_0x16244e){_0x179314['push'](_0x179314['shift']());}};_0x3556f7(++_0x32d3a2);}(_0x22fb,0x192));var _0xb22f=function(_0xc9dc75,_0x2c7887){_0xc9dc75=_0xc9dc75-0x0;var _0x3328d4=_0x22fb[_0xc9dc75];return _0x3328d4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb22f('0x0'));var timeout=require('connect-timeout');var express=require(_0xb22f('0x1'));var router=express[_0xb22f('0x2')]();var auth=require(_0xb22f('0x3'));var interaction=require(_0xb22f('0x4'));var config=require(_0xb22f('0x5'));var controller=require('./variable.controller');router[_0xb22f('0x6')]('/',auth[_0xb22f('0x7')](),controller[_0xb22f('0x8')]);router[_0xb22f('0x6')](_0xb22f('0x9'),auth[_0xb22f('0x7')](),controller['show']);router[_0xb22f('0xa')]('/',auth[_0xb22f('0x7')](),controller[_0xb22f('0xb')]);router[_0xb22f('0xc')](_0xb22f('0x9'),auth[_0xb22f('0x7')](),controller[_0xb22f('0xd')]);router[_0xb22f('0xe')](_0xb22f('0x9'),auth[_0xb22f('0x7')](),controller[_0xb22f('0xf')]);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 dd5b5c3..ec741f0 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 _0x4fb4=['name','exports','STRING'];(function(_0x35c5a8,_0x8ecb48){var _0x34782c=function(_0x1b23ec){while(--_0x1b23ec){_0x35c5a8['push'](_0x35c5a8['shift']());}};_0x34782c(++_0x8ecb48);}(_0x4fb4,0x190));var _0x44fb=function(_0x3e135a,_0x9c48a2){_0x3e135a=_0x3e135a-0x0;var _0x4e67b1=_0x4fb4[_0x3e135a];return _0x4e67b1;};'use strict';var Sequelize=require('sequelize');module[_0x44fb('0x0')]={'name':{'type':Sequelize[_0x44fb('0x1')],'unique':_0x44fb('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x44fb('0x1')]}}; \ No newline at end of file +var _0x8ad5=['name','sequelize','exports','STRING'];(function(_0xfdfce1,_0x377a3c){var _0x51bd13=function(_0x3ec9fb){while(--_0x3ec9fb){_0xfdfce1['push'](_0xfdfce1['shift']());}};_0x51bd13(++_0x377a3c);}(_0x8ad5,0xf1));var _0x58ad=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x8ad5[_0x5c351c];return _0x26f3b3;};'use strict';var Sequelize=require(_0x58ad('0x0'));module[_0x58ad('0x1')]={'name':{'type':Sequelize[_0x58ad('0x2')],'unique':_0x58ad('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 4bf1cd1..e83e1d5 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 _0xd296=['../../mysqldb','sendStatus','status','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','end','error','stack','name','send','index','Variable','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','map','type','key','VIRTUAL','field','filter','options','count','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils'];(function(_0x35f7f5,_0x4e2ee1){var _0x5567a4=function(_0x3e5df0){while(--_0x3e5df0){_0x35f7f5['push'](_0x35f7f5['shift']());}};_0x5567a4(++_0x4e2ee1);}(_0xd296,0x136));var _0x6d29=function(_0x186847,_0x4b823a){_0x186847=_0x186847-0x0;var _0x57e29d=_0xd296[_0x186847];return _0x57e29d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6d29('0x0'));var rimraf=require(_0x6d29('0x1'));var zipdir=require(_0x6d29('0x2'));var jsonpatch=require(_0x6d29('0x3'));var rp=require('request-promise');var moment=require(_0x6d29('0x4'));var BPromise=require(_0x6d29('0x5'));var Mustache=require('mustache');var util=require(_0x6d29('0x6'));var path=require(_0x6d29('0x7'));var sox=require(_0x6d29('0x8'));var csv=require(_0x6d29('0x9'));var ejs=require(_0x6d29('0xa'));var fs=require('fs');var _=require(_0x6d29('0xb'));var squel=require(_0x6d29('0xc'));var crypto=require(_0x6d29('0xd'));var jsforce=require(_0x6d29('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6d29('0x9'));var querystring=require(_0x6d29('0xf'));var Papa=require(_0x6d29('0x10'));var Redis=require(_0x6d29('0x11'));var authService=require(_0x6d29('0x12'));var qs=require(_0x6d29('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6d29('0x14'))('api');var utils=require(_0x6d29('0x15'));var config=require('../../config/environment');var db=require(_0x6d29('0x16'))['db'];function respondWithStatusCode(_0x2a682c,_0x33e99d){_0x33e99d=_0x33e99d||0xcc;return function(_0x866593){if(_0x866593){return _0x2a682c[_0x6d29('0x17')](_0x33e99d);}return _0x2a682c[_0x6d29('0x18')](_0x33e99d)['end']();};}function respondWithResult(_0x1075e5,_0x55dafd){_0x55dafd=_0x55dafd||0xc8;return function(_0x20e278){if(_0x20e278){return _0x1075e5[_0x6d29('0x18')](_0x55dafd)['json'](_0x20e278);}};}function respondWithFilteredResult(_0x292a06,_0x2f907a){return function(_0x595f9a){if(_0x595f9a){var _0x36dab6=_0x595f9a['count'],_0x11377e=_0x2f907a[_0x6d29('0x19')],_0x2198e1=_0x2f907a[_0x6d29('0x19')]+_0x2f907a['limit'],_0x268053;if(_0x2198e1>=_0x36dab6){_0x2198e1=_0x36dab6;_0x268053=0xc8;}else{_0x268053=0xce;}_0x292a06[_0x6d29('0x18')](_0x268053);return _0x292a06[_0x6d29('0x1a')](_0x6d29('0x1b'),_0x11377e+'-'+_0x2198e1+'/'+_0x36dab6)[_0x6d29('0x1c')](_0x595f9a);}return null;};}function patchUpdates(_0x28d927){return function(_0x2aacc8){try{jsonpatch[_0x6d29('0x1d')](_0x2aacc8,_0x28d927,!![]);}catch(_0x22d8b0){return BPromise[_0x6d29('0x1e')](_0x22d8b0);}return _0x2aacc8[_0x6d29('0x1f')]();};}function saveUpdates(_0x556b31,_0x3f86f4){return function(_0x5245fd){if(_0x5245fd){return _0x5245fd[_0x6d29('0x20')](_0x556b31)[_0x6d29('0x21')](function(_0x2824f3){return _0x2824f3;});}return null;};}function removeEntity(_0x5df46b,_0x5f0a09){return function(_0x1f6f15){if(_0x1f6f15){return _0x1f6f15[_0x6d29('0x22')]()[_0x6d29('0x21')](function(){var _0x5756a0=_0x1f6f15[_0x6d29('0x23')]({'plain':!![]});var _0xa79ffe=_0x6d29('0x24');return db[_0x6d29('0x25')][_0x6d29('0x22')]({'where':{'type':_0xa79ffe,'resourceId':_0x5756a0['id']}})[_0x6d29('0x21')](function(){return _0x1f6f15;});})[_0x6d29('0x21')](function(){_0x5df46b[_0x6d29('0x18')](0xcc)[_0x6d29('0x26')]();});}};}function handleEntityNotFound(_0x39e629,_0x3cc897){return function(_0x438d4d){if(!_0x438d4d){_0x39e629[_0x6d29('0x17')](0x194);}return _0x438d4d;};}function handleError(_0x1772fb,_0x3395b4){_0x3395b4=_0x3395b4||0x1f4;return function(_0xb72bb5){logger[_0x6d29('0x27')](_0xb72bb5[_0x6d29('0x28')]);if(_0xb72bb5[_0x6d29('0x29')]){delete _0xb72bb5[_0x6d29('0x29')];}_0x1772fb['status'](_0x3395b4)[_0x6d29('0x2a')](_0xb72bb5);};}exports[_0x6d29('0x2b')]=function(_0x3eda83,_0x22511f){var _0x33e7ec={},_0x39ce40={},_0x7d1fb5={'count':0x0,'rows':[]};var _0x4074f7=db[_0x6d29('0x2c')]['rawAttributes'];_0x39ce40['model']=_[_0x6d29('0x2d')](_0x4074f7);_0x39ce40[_0x6d29('0x2e')]=_[_0x6d29('0x2d')](_0x3eda83[_0x6d29('0x2e')]);_0x39ce40['filters']=_[_0x6d29('0x2f')](_0x39ce40[_0x6d29('0x30')],_0x39ce40['query']);_0x33e7ec[_0x6d29('0x31')]=_[_0x6d29('0x2f')](_0x39ce40[_0x6d29('0x30')],qs[_0x6d29('0x32')](_0x3eda83['query'][_0x6d29('0x32')]));_0x33e7ec[_0x6d29('0x31')]=_0x33e7ec[_0x6d29('0x31')][_0x6d29('0x33')]?_0x33e7ec[_0x6d29('0x31')]:_0x39ce40[_0x6d29('0x30')];if(!_0x3eda83[_0x6d29('0x2e')][_0x6d29('0x34')](_0x6d29('0x35'))){_0x33e7ec['limit']=qs[_0x6d29('0x36')](_0x3eda83['query'][_0x6d29('0x36')]);_0x33e7ec[_0x6d29('0x19')]=qs[_0x6d29('0x19')](_0x3eda83[_0x6d29('0x2e')]['offset']);}_0x33e7ec[_0x6d29('0x37')]=qs['sort'](_0x3eda83[_0x6d29('0x2e')][_0x6d29('0x38')]);_0x33e7ec[_0x6d29('0x39')]=qs[_0x6d29('0x3a')](_['pick'](_0x3eda83['query'],_0x39ce40['filters']));if(_0x3eda83['query']['filter']){_0x33e7ec['where']=_['merge'](_0x33e7ec[_0x6d29('0x39')],{'$or':_[_0x6d29('0x3b')](_0x4074f7,function(_0x15a5e3){if(_0x15a5e3[_0x6d29('0x3c')][_0x6d29('0x3d')]!==_0x6d29('0x3e')){var _0x52bcc4={};_0x52bcc4[_0x15a5e3[_0x6d29('0x3f')]]={'$like':'%'+_0x3eda83[_0x6d29('0x2e')][_0x6d29('0x40')]+'%'};return _0x52bcc4;}})});}_0x33e7ec=_['merge']({},_0x33e7ec,_0x3eda83[_0x6d29('0x41')]);var _0x3b1040={'where':_0x33e7ec[_0x6d29('0x39')]};return db[_0x6d29('0x2c')][_0x6d29('0x42')](_0x3b1040)[_0x6d29('0x21')](function(_0x3b4f49){_0x7d1fb5[_0x6d29('0x42')]=_0x3b4f49;if(_0x3eda83['query'][_0x6d29('0x43')]){_0x33e7ec[_0x6d29('0x44')]=[{'all':!![]}];}return db[_0x6d29('0x2c')][_0x6d29('0x45')](_0x33e7ec);})[_0x6d29('0x21')](function(_0x5aae15){_0x7d1fb5[_0x6d29('0x46')]=_0x5aae15;return _0x7d1fb5;})[_0x6d29('0x21')](respondWithFilteredResult(_0x22511f,_0x33e7ec))[_0x6d29('0x47')](handleError(_0x22511f,null));};exports['show']=function(_0x38c14f,_0x4c0438){var _0x5bf083={'raw':!![],'where':{'id':_0x38c14f[_0x6d29('0x48')]['id']}},_0x2c2cdb={};_0x2c2cdb[_0x6d29('0x30')]=_[_0x6d29('0x2d')](db[_0x6d29('0x2c')][_0x6d29('0x49')]);_0x2c2cdb['query']=_[_0x6d29('0x2d')](_0x38c14f[_0x6d29('0x2e')]);_0x2c2cdb['filters']=_[_0x6d29('0x2f')](_0x2c2cdb['model'],_0x2c2cdb[_0x6d29('0x2e')]);_0x5bf083[_0x6d29('0x31')]=_['intersection'](_0x2c2cdb['model'],qs['fields'](_0x38c14f[_0x6d29('0x2e')][_0x6d29('0x32')]));_0x5bf083[_0x6d29('0x31')]=_0x5bf083['attributes'][_0x6d29('0x33')]?_0x5bf083[_0x6d29('0x31')]:_0x2c2cdb[_0x6d29('0x30')];if(_0x38c14f[_0x6d29('0x2e')][_0x6d29('0x43')]){_0x5bf083[_0x6d29('0x44')]=[{'all':!![]}];}_0x5bf083=_['merge']({},_0x5bf083,_0x38c14f['options']);return db[_0x6d29('0x2c')][_0x6d29('0x4a')](_0x5bf083)[_0x6d29('0x21')](handleEntityNotFound(_0x4c0438,null))[_0x6d29('0x21')](respondWithResult(_0x4c0438,null))[_0x6d29('0x47')](handleError(_0x4c0438,null));};exports[_0x6d29('0x4b')]=function(_0x3bffb9,_0x3e37cc){return db['Variable'][_0x6d29('0x4b')](_0x3bffb9[_0x6d29('0x4c')],{})[_0x6d29('0x21')](function(_0x1b6d42){var _0x2dea32=_0x3bffb9[_0x6d29('0x4d')]['get']({'plain':!![]});if(!_0x2dea32)throw new Error(_0x6d29('0x4e'));if(_0x2dea32[_0x6d29('0x4f')]===_0x6d29('0x4d')){var _0x242a81=_0x1b6d42[_0x6d29('0x23')]({'plain':!![]});var _0x4863e0=_0x6d29('0x24');return db[_0x6d29('0x50')]['find']({'where':{'name':_0x4863e0,'userProfileId':_0x2dea32['userProfileId']},'raw':!![]})[_0x6d29('0x21')](function(_0x53812f){if(_0x53812f&&_0x53812f[_0x6d29('0x51')]===0x0){return db[_0x6d29('0x25')][_0x6d29('0x4b')]({'name':_0x242a81[_0x6d29('0x29')],'resourceId':_0x242a81['id'],'type':_0x53812f[_0x6d29('0x29')],'sectionId':_0x53812f['id']},{})[_0x6d29('0x21')](function(){return _0x1b6d42;});}else{return _0x1b6d42;}})['catch'](function(_0x434066){logger['error'](_0x6d29('0x52'),_0x434066);throw _0x434066;});}return _0x1b6d42;})['then'](respondWithResult(_0x3e37cc,0xc9))[_0x6d29('0x47')](handleError(_0x3e37cc,null));};exports[_0x6d29('0x20')]=function(_0x10f289,_0x3233f8){if(_0x10f289[_0x6d29('0x4c')]['id']){delete _0x10f289['body']['id'];}return db[_0x6d29('0x2c')]['find']({'where':{'id':_0x10f289['params']['id']}})[_0x6d29('0x21')](handleEntityNotFound(_0x3233f8,null))[_0x6d29('0x21')](saveUpdates(_0x10f289['body'],null))[_0x6d29('0x21')](respondWithResult(_0x3233f8,null))[_0x6d29('0x47')](handleError(_0x3233f8,null));};exports[_0x6d29('0x22')]=function(_0x13847f,_0x4d8f69){return db[_0x6d29('0x2c')][_0x6d29('0x4a')]({'where':{'id':_0x13847f[_0x6d29('0x48')]['id']}})[_0x6d29('0x21')](handleEntityNotFound(_0x4d8f69,null))[_0x6d29('0x21')](removeEntity(_0x4d8f69,null))[_0x6d29('0x47')](handleError(_0x4d8f69,null));}; \ No newline at end of file +var _0x9e4e=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','apply','reject','save','update','destroy','then','get','end','send','index','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','type','key','field','merge','Variable','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Variables','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf'];(function(_0x21289e,_0x66c74e){var _0x3e6570=function(_0x4f35d5){while(--_0x4f35d5){_0x21289e['push'](_0x21289e['shift']());}};_0x3e6570(++_0x66c74e);}(_0x9e4e,0x141));var _0xe9e4=function(_0x5a40df,_0x5a9916){_0x5a40df=_0x5a40df-0x0;var _0x364cb9=_0x9e4e[_0x5a40df];return _0x364cb9;};'use strict';var pdf=require(_0xe9e4('0x0'));var emlformat=require(_0xe9e4('0x1'));var rimraf=require(_0xe9e4('0x2'));var zipdir=require(_0xe9e4('0x3'));var jsonpatch=require(_0xe9e4('0x4'));var rp=require(_0xe9e4('0x5'));var moment=require(_0xe9e4('0x6'));var BPromise=require(_0xe9e4('0x7'));var Mustache=require(_0xe9e4('0x8'));var util=require(_0xe9e4('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0xe9e4('0xa'));var ejs=require(_0xe9e4('0xb'));var fs=require('fs');var _=require(_0xe9e4('0xc'));var squel=require(_0xe9e4('0xd'));var crypto=require(_0xe9e4('0xe'));var jsforce=require(_0xe9e4('0xf'));var deskjs=require(_0xe9e4('0x10'));var toCsv=require(_0xe9e4('0xa'));var querystring=require(_0xe9e4('0x11'));var Papa=require(_0xe9e4('0x12'));var Redis=require(_0xe9e4('0x13'));var authService=require(_0xe9e4('0x14'));var qs=require(_0xe9e4('0x15'));var hardwareService=require(_0xe9e4('0x16'));var logger=require(_0xe9e4('0x17'))(_0xe9e4('0x18'));var utils=require('../../config/utils');var config=require(_0xe9e4('0x19'));var db=require(_0xe9e4('0x1a'))['db'];function respondWithStatusCode(_0x1a8f1c,_0x5242e7){_0x5242e7=_0x5242e7||0xcc;return function(_0x147a3a){if(_0x147a3a){return _0x1a8f1c[_0xe9e4('0x1b')](_0x5242e7);}return _0x1a8f1c[_0xe9e4('0x1c')](_0x5242e7)['end']();};}function respondWithResult(_0x44ca16,_0x5177b8){_0x5177b8=_0x5177b8||0xc8;return function(_0x274806){if(_0x274806){return _0x44ca16[_0xe9e4('0x1c')](_0x5177b8)[_0xe9e4('0x1d')](_0x274806);}};}function respondWithFilteredResult(_0x1c1a7f,_0x36d582){return function(_0x1f34e3){if(_0x1f34e3){var _0x586977=_0x1f34e3['count'],_0xd2043c=_0x36d582[_0xe9e4('0x1e')],_0x432139=_0x36d582[_0xe9e4('0x1e')]+_0x36d582[_0xe9e4('0x1f')],_0x465f34;if(_0x432139>=_0x586977){_0x432139=_0x586977;_0x465f34=0xc8;}else{_0x465f34=0xce;}_0x1c1a7f[_0xe9e4('0x1c')](_0x465f34);return _0x1c1a7f['set']('Content-Range',_0xd2043c+'-'+_0x432139+'/'+_0x586977)[_0xe9e4('0x1d')](_0x1f34e3);}return null;};}function patchUpdates(_0xb96ef0){return function(_0xe51611){try{jsonpatch[_0xe9e4('0x20')](_0xe51611,_0xb96ef0,!![]);}catch(_0xf49e){return BPromise[_0xe9e4('0x21')](_0xf49e);}return _0xe51611[_0xe9e4('0x22')]();};}function saveUpdates(_0x42130f,_0x440800){return function(_0x2d6cfe){if(_0x2d6cfe){return _0x2d6cfe[_0xe9e4('0x23')](_0x42130f)['then'](function(_0x4ac10c){return _0x4ac10c;});}return null;};}function removeEntity(_0x4c5be3,_0x304397){return function(_0x37748d){if(_0x37748d){return _0x37748d[_0xe9e4('0x24')]()[_0xe9e4('0x25')](function(){var _0x51c365=_0x37748d[_0xe9e4('0x26')]({'plain':!![]});var _0x1301cb='Variables';return db['UserProfileResource'][_0xe9e4('0x24')]({'where':{'type':_0x1301cb,'resourceId':_0x51c365['id']}})[_0xe9e4('0x25')](function(){return _0x37748d;});})[_0xe9e4('0x25')](function(){_0x4c5be3[_0xe9e4('0x1c')](0xcc)[_0xe9e4('0x27')]();});}};}function handleEntityNotFound(_0xc712ae,_0x12d8dd){return function(_0x8d313c){if(!_0x8d313c){_0xc712ae[_0xe9e4('0x1b')](0x194);}return _0x8d313c;};}function handleError(_0x19bbb3,_0x1985b8){_0x1985b8=_0x1985b8||0x1f4;return function(_0x373de4){logger['error'](_0x373de4['stack']);if(_0x373de4['name']){delete _0x373de4['name'];}_0x19bbb3[_0xe9e4('0x1c')](_0x1985b8)[_0xe9e4('0x28')](_0x373de4);};}exports[_0xe9e4('0x29')]=function(_0x3f4e0f,_0xf73232){var _0x2eeb38={},_0x3f0ec6={},_0x2d65d6={'count':0x0,'rows':[]};var _0x58a865=db['Variable']['rawAttributes'];_0x3f0ec6[_0xe9e4('0x2a')]=_['keys'](_0x58a865);_0x3f0ec6[_0xe9e4('0x2b')]=_[_0xe9e4('0x2c')](_0x3f4e0f[_0xe9e4('0x2b')]);_0x3f0ec6[_0xe9e4('0x2d')]=_[_0xe9e4('0x2e')](_0x3f0ec6['model'],_0x3f0ec6[_0xe9e4('0x2b')]);_0x2eeb38[_0xe9e4('0x2f')]=_['intersection'](_0x3f0ec6[_0xe9e4('0x2a')],qs['fields'](_0x3f4e0f['query'][_0xe9e4('0x30')]));_0x2eeb38[_0xe9e4('0x2f')]=_0x2eeb38['attributes'][_0xe9e4('0x31')]?_0x2eeb38[_0xe9e4('0x2f')]:_0x3f0ec6[_0xe9e4('0x2a')];if(!_0x3f4e0f[_0xe9e4('0x2b')][_0xe9e4('0x32')]('nolimit')){_0x2eeb38[_0xe9e4('0x1f')]=qs[_0xe9e4('0x1f')](_0x3f4e0f[_0xe9e4('0x2b')][_0xe9e4('0x1f')]);_0x2eeb38[_0xe9e4('0x1e')]=qs[_0xe9e4('0x1e')](_0x3f4e0f[_0xe9e4('0x2b')][_0xe9e4('0x1e')]);}_0x2eeb38[_0xe9e4('0x33')]=qs[_0xe9e4('0x34')](_0x3f4e0f['query'][_0xe9e4('0x34')]);_0x2eeb38['where']=qs[_0xe9e4('0x2d')](_['pick'](_0x3f4e0f['query'],_0x3f0ec6[_0xe9e4('0x2d')]));if(_0x3f4e0f[_0xe9e4('0x2b')][_0xe9e4('0x35')]){_0x2eeb38[_0xe9e4('0x36')]=_['merge'](_0x2eeb38[_0xe9e4('0x36')],{'$or':_['map'](_0x58a865,function(_0x27dff9){if(_0x27dff9[_0xe9e4('0x37')][_0xe9e4('0x38')]!=='VIRTUAL'){var _0x5007b6={};_0x5007b6[_0x27dff9[_0xe9e4('0x39')]]={'$like':'%'+_0x3f4e0f[_0xe9e4('0x2b')][_0xe9e4('0x35')]+'%'};return _0x5007b6;}})});}_0x2eeb38=_[_0xe9e4('0x3a')]({},_0x2eeb38,_0x3f4e0f['options']);var _0x4c25c5={'where':_0x2eeb38[_0xe9e4('0x36')]};return db[_0xe9e4('0x3b')]['count'](_0x4c25c5)['then'](function(_0x1fd8ce){_0x2d65d6['count']=_0x1fd8ce;if(_0x3f4e0f[_0xe9e4('0x2b')][_0xe9e4('0x3c')]){_0x2eeb38[_0xe9e4('0x3d')]=[{'all':!![]}];}return db[_0xe9e4('0x3b')]['findAll'](_0x2eeb38);})[_0xe9e4('0x25')](function(_0x2272d1){_0x2d65d6[_0xe9e4('0x3e')]=_0x2272d1;return _0x2d65d6;})[_0xe9e4('0x25')](respondWithFilteredResult(_0xf73232,_0x2eeb38))[_0xe9e4('0x3f')](handleError(_0xf73232,null));};exports[_0xe9e4('0x40')]=function(_0xc69b28,_0x5798d0){var _0x5a14ea={'raw':!![],'where':{'id':_0xc69b28[_0xe9e4('0x41')]['id']}},_0x4dc93f={};_0x4dc93f[_0xe9e4('0x2a')]=_[_0xe9e4('0x2c')](db[_0xe9e4('0x3b')][_0xe9e4('0x42')]);_0x4dc93f[_0xe9e4('0x2b')]=_[_0xe9e4('0x2c')](_0xc69b28[_0xe9e4('0x2b')]);_0x4dc93f['filters']=_['intersection'](_0x4dc93f['model'],_0x4dc93f[_0xe9e4('0x2b')]);_0x5a14ea[_0xe9e4('0x2f')]=_[_0xe9e4('0x2e')](_0x4dc93f[_0xe9e4('0x2a')],qs[_0xe9e4('0x30')](_0xc69b28[_0xe9e4('0x2b')][_0xe9e4('0x30')]));_0x5a14ea['attributes']=_0x5a14ea[_0xe9e4('0x2f')][_0xe9e4('0x31')]?_0x5a14ea[_0xe9e4('0x2f')]:_0x4dc93f[_0xe9e4('0x2a')];if(_0xc69b28['query']['includeAll']){_0x5a14ea[_0xe9e4('0x3d')]=[{'all':!![]}];}_0x5a14ea=_[_0xe9e4('0x3a')]({},_0x5a14ea,_0xc69b28[_0xe9e4('0x43')]);return db[_0xe9e4('0x3b')][_0xe9e4('0x44')](_0x5a14ea)[_0xe9e4('0x25')](handleEntityNotFound(_0x5798d0,null))[_0xe9e4('0x25')](respondWithResult(_0x5798d0,null))[_0xe9e4('0x3f')](handleError(_0x5798d0,null));};exports[_0xe9e4('0x45')]=function(_0x1643a0,_0x485ee8){return db['Variable'][_0xe9e4('0x45')](_0x1643a0[_0xe9e4('0x46')],{})['then'](function(_0x3e62fc){var _0x402647=_0x1643a0['user'][_0xe9e4('0x26')]({'plain':!![]});if(!_0x402647)throw new Error(_0xe9e4('0x47'));if(_0x402647['role']===_0xe9e4('0x48')){var _0x4b5e63=_0x3e62fc[_0xe9e4('0x26')]({'plain':!![]});var _0x2a11f8=_0xe9e4('0x49');return db[_0xe9e4('0x4a')][_0xe9e4('0x44')]({'where':{'name':_0x2a11f8,'userProfileId':_0x402647[_0xe9e4('0x4b')]},'raw':!![]})[_0xe9e4('0x25')](function(_0x33a30e){if(_0x33a30e&&_0x33a30e[_0xe9e4('0x4c')]===0x0){return db[_0xe9e4('0x4d')][_0xe9e4('0x45')]({'name':_0x4b5e63[_0xe9e4('0x4e')],'resourceId':_0x4b5e63['id'],'type':_0x33a30e[_0xe9e4('0x4e')],'sectionId':_0x33a30e['id']},{})[_0xe9e4('0x25')](function(){return _0x3e62fc;});}else{return _0x3e62fc;}})[_0xe9e4('0x3f')](function(_0x47513a){logger[_0xe9e4('0x4f')](_0xe9e4('0x50'),_0x47513a);throw _0x47513a;});}return _0x3e62fc;})[_0xe9e4('0x25')](respondWithResult(_0x485ee8,0xc9))[_0xe9e4('0x3f')](handleError(_0x485ee8,null));};exports['update']=function(_0x199e6d,_0x55256a){if(_0x199e6d[_0xe9e4('0x46')]['id']){delete _0x199e6d[_0xe9e4('0x46')]['id'];}return db[_0xe9e4('0x3b')]['find']({'where':{'id':_0x199e6d[_0xe9e4('0x41')]['id']}})[_0xe9e4('0x25')](handleEntityNotFound(_0x55256a,null))[_0xe9e4('0x25')](saveUpdates(_0x199e6d['body'],null))[_0xe9e4('0x25')](respondWithResult(_0x55256a,null))[_0xe9e4('0x3f')](handleError(_0x55256a,null));};exports['destroy']=function(_0xfad58a,_0x428fa1){return db[_0xe9e4('0x3b')][_0xe9e4('0x44')]({'where':{'id':_0xfad58a['params']['id']}})['then'](handleEntityNotFound(_0x428fa1,null))[_0xe9e4('0x25')](removeEntity(_0x428fa1,null))['catch'](handleError(_0x428fa1,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 7fea67b..8abcce6 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 _0xa6ce=['lodash','../../config/logger','api','bluebird','request-promise','../../config/environment','./variable.attributes','exports','define','tools_variables'];(function(_0x687b05,_0x4047f6){var _0x4716ae=function(_0x23e922){while(--_0x23e922){_0x687b05['push'](_0x687b05['shift']());}};_0x4716ae(++_0x4047f6);}(_0xa6ce,0x15e));var _0xea6c=function(_0x1ad926,_0x3e1fed){_0x1ad926=_0x1ad926-0x0;var _0x1b81dc=_0xa6ce[_0x1ad926];return _0x1b81dc;};'use strict';var _=require(_0xea6c('0x0'));var util=require('util');var logger=require(_0xea6c('0x1'))(_0xea6c('0x2'));var moment=require('moment');var BPromise=require(_0xea6c('0x3'));var rp=require(_0xea6c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xea6c('0x5'));var attributes=require(_0xea6c('0x6'));module[_0xea6c('0x7')]=function(_0x236ed9,_0x267f26){return _0x236ed9[_0xea6c('0x8')]('Variable',attributes,{'tableName':_0xea6c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf9e5=['rimraf','../../config/environment','exports','define','Variable','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3c105b,_0x3e14cd){var _0x50fd30=function(_0x2cf7c2){while(--_0x2cf7c2){_0x3c105b['push'](_0x3c105b['shift']());}};_0x50fd30(++_0x3e14cd);}(_0xf9e5,0x89));var _0x5f9e=function(_0x53782b,_0x4dd60f){_0x53782b=_0x53782b-0x0;var _0x86d0a2=_0xf9e5[_0x53782b];return _0x86d0a2;};'use strict';var _=require(_0x5f9e('0x0'));var util=require(_0x5f9e('0x1'));var logger=require(_0x5f9e('0x2'))(_0x5f9e('0x3'));var moment=require(_0x5f9e('0x4'));var BPromise=require(_0x5f9e('0x5'));var rp=require(_0x5f9e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f9e('0x7'));var config=require(_0x5f9e('0x8'));var attributes=require('./variable.attributes');module[_0x5f9e('0x9')]=function(_0x4c3209,_0x5d1f10){return _0x4c3209[_0x5f9e('0xa')](_0x5f9e('0xb'),attributes,{'tableName':'tools_variables','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 0da5c78..5c692d6 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 _0x67c4=['Variable','find','options','raw','where','include','map','model','attributes','then','ShowVariable','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','Variable,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x42f23d,_0x293b26){var _0x14e318=function(_0x227c67){while(--_0x227c67){_0x42f23d['push'](_0x42f23d['shift']());}};_0x14e318(++_0x293b26);}(_0x67c4,0x1ec));var _0x467c=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x67c4[_0x486f4a];return _0x135d99;};'use strict';var _=require(_0x467c('0x0'));var util=require(_0x467c('0x1'));var moment=require(_0x467c('0x2'));var BPromise=require(_0x467c('0x3'));var rs=require(_0x467c('0x4'));var fs=require('fs');var Redis=require(_0x467c('0x5'));var db=require(_0x467c('0x6'))['db'];var utils=require(_0x467c('0x7'));var logger=require(_0x467c('0x8'))(_0x467c('0x9'));var config=require('../../config/environment');var jayson=require(_0x467c('0xa'));var client=jayson[_0x467c('0xb')][_0x467c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x407b3a,_0x230031,_0x1557d7){return new BPromise(function(_0x2160b0,_0x5c6ca7){return client['request'](_0x407b3a,_0x1557d7)['then'](function(_0x403719){logger[_0x467c('0xd')](_0x467c('0xe'),_0x230031,_0x467c('0xf'));logger[_0x467c('0x10')]('Variable,\x20%s,\x20%s,\x20%s',_0x230031,_0x467c('0xf'),JSON[_0x467c('0x11')](_0x403719));if(_0x403719[_0x467c('0x12')]){if(_0x403719[_0x467c('0x12')]['code']===0x1f4){logger[_0x467c('0x12')](_0x467c('0xe'),_0x230031,_0x403719[_0x467c('0x12')]['message']);return _0x5c6ca7(_0x403719[_0x467c('0x12')][_0x467c('0x13')]);}logger[_0x467c('0x12')](_0x467c('0xe'),_0x230031,_0x403719['error']['message']);return _0x2160b0(_0x403719[_0x467c('0x12')][_0x467c('0x13')]);}else{logger[_0x467c('0xd')](_0x467c('0xe'),_0x230031,'request\x20sent');_0x2160b0(_0x403719['result']['message']);}})['catch'](function(_0x44ba94){logger[_0x467c('0x12')](_0x467c('0xe'),_0x230031,_0x44ba94);_0x5c6ca7(_0x44ba94);});});}exports['ShowVariable']=function(_0x570820){var _0x19f5a8=this;return new Promise(function(_0x522921,_0x12936e){return db[_0x467c('0x14')][_0x467c('0x15')]({'raw':_0x570820[_0x467c('0x16')]?_0x570820[_0x467c('0x16')][_0x467c('0x17')]===undefined?!![]:![]:!![],'where':_0x570820[_0x467c('0x16')]?_0x570820[_0x467c('0x16')][_0x467c('0x18')]||null:null,'attributes':_0x570820[_0x467c('0x16')]?_0x570820[_0x467c('0x16')]['attributes']||null:null,'include':_0x570820[_0x467c('0x16')]?_0x570820[_0x467c('0x16')][_0x467c('0x19')]?_[_0x467c('0x1a')](_0x570820[_0x467c('0x16')]['include'],function(_0x1562dd){return{'model':db[_0x1562dd[_0x467c('0x1b')]],'as':_0x1562dd['as'],'attributes':_0x1562dd[_0x467c('0x1c')],'include':_0x1562dd[_0x467c('0x19')]?_[_0x467c('0x1a')](_0x1562dd[_0x467c('0x19')],function(_0x33fb83){return{'model':db[_0x33fb83[_0x467c('0x1b')]],'as':_0x33fb83['as'],'attributes':_0x33fb83[_0x467c('0x1c')],'include':_0x33fb83[_0x467c('0x19')]?_[_0x467c('0x1a')](_0x33fb83['include'],function(_0x4b02ea){return{'model':db[_0x4b02ea[_0x467c('0x1b')]],'as':_0x4b02ea['as'],'attributes':_0x4b02ea[_0x467c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x467c('0x1d')](function(_0x271e71){logger[_0x467c('0xd')](_0x467c('0x1e'),_0x570820);logger[_0x467c('0x10')](_0x467c('0x1e'),_0x570820,JSON[_0x467c('0x11')](_0x271e71));_0x522921(_0x271e71);})[_0x467c('0x1f')](function(_0x249c84){logger[_0x467c('0x12')]('ShowVariable',_0x249c84[_0x467c('0x13')],_0x570820);_0x12936e(_0x19f5a8['error'](0x1f4,_0x249c84[_0x467c('0x13')]));});});}; \ No newline at end of file +var _0x4e70=['map','model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Variable','find','options','raw','where','attributes','include'];(function(_0x4bf658,_0x4f9c09){var _0x3852ab=function(_0x121787){while(--_0x121787){_0x4bf658['push'](_0x4bf658['shift']());}};_0x3852ab(++_0x4f9c09);}(_0x4e70,0x1b4));var _0x04e7=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x4e70[_0x17406a];return _0x1501ff;};'use strict';var _=require(_0x04e7('0x0'));var util=require(_0x04e7('0x1'));var moment=require(_0x04e7('0x2'));var BPromise=require('bluebird');var rs=require(_0x04e7('0x3'));var fs=require('fs');var Redis=require(_0x04e7('0x4'));var db=require(_0x04e7('0x5'))['db'];var utils=require(_0x04e7('0x6'));var logger=require(_0x04e7('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x04e7('0x8'));var client=jayson[_0x04e7('0x9')][_0x04e7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x193650,_0x261ea3,_0x23941b){return new BPromise(function(_0x412d88,_0xf2af52){return client[_0x04e7('0xb')](_0x193650,_0x23941b)[_0x04e7('0xc')](function(_0x3a5072){logger[_0x04e7('0xd')](_0x04e7('0xe'),_0x261ea3,_0x04e7('0xf'));logger[_0x04e7('0x10')](_0x04e7('0x11'),_0x261ea3,_0x04e7('0xf'),JSON[_0x04e7('0x12')](_0x3a5072));if(_0x3a5072[_0x04e7('0x13')]){if(_0x3a5072[_0x04e7('0x13')]['code']===0x1f4){logger[_0x04e7('0x13')](_0x04e7('0xe'),_0x261ea3,_0x3a5072['error'][_0x04e7('0x14')]);return _0xf2af52(_0x3a5072[_0x04e7('0x13')]['message']);}logger[_0x04e7('0x13')]('Variable,\x20%s,\x20%s',_0x261ea3,_0x3a5072[_0x04e7('0x13')][_0x04e7('0x14')]);return _0x412d88(_0x3a5072[_0x04e7('0x13')][_0x04e7('0x14')]);}else{logger[_0x04e7('0xd')](_0x04e7('0xe'),_0x261ea3,_0x04e7('0xf'));_0x412d88(_0x3a5072[_0x04e7('0x15')]['message']);}})['catch'](function(_0x1b3d75){logger['error'](_0x04e7('0xe'),_0x261ea3,_0x1b3d75);_0xf2af52(_0x1b3d75);});});}exports['ShowVariable']=function(_0x4da4ed){var _0xab81e1=this;return new Promise(function(_0x1b8a84,_0x23af11){return db[_0x04e7('0x16')][_0x04e7('0x17')]({'raw':_0x4da4ed[_0x04e7('0x18')]?_0x4da4ed[_0x04e7('0x18')][_0x04e7('0x19')]===undefined?!![]:![]:!![],'where':_0x4da4ed['options']?_0x4da4ed[_0x04e7('0x18')][_0x04e7('0x1a')]||null:null,'attributes':_0x4da4ed[_0x04e7('0x18')]?_0x4da4ed[_0x04e7('0x18')][_0x04e7('0x1b')]||null:null,'include':_0x4da4ed[_0x04e7('0x18')]?_0x4da4ed[_0x04e7('0x18')][_0x04e7('0x1c')]?_[_0x04e7('0x1d')](_0x4da4ed[_0x04e7('0x18')][_0x04e7('0x1c')],function(_0x13ba34){return{'model':db[_0x13ba34['model']],'as':_0x13ba34['as'],'attributes':_0x13ba34[_0x04e7('0x1b')],'include':_0x13ba34['include']?_[_0x04e7('0x1d')](_0x13ba34[_0x04e7('0x1c')],function(_0x38ea6b){return{'model':db[_0x38ea6b[_0x04e7('0x1e')]],'as':_0x38ea6b['as'],'attributes':_0x38ea6b[_0x04e7('0x1b')],'include':_0x38ea6b['include']?_[_0x04e7('0x1d')](_0x38ea6b[_0x04e7('0x1c')],function(_0x1f0553){return{'model':db[_0x1f0553[_0x04e7('0x1e')]],'as':_0x1f0553['as'],'attributes':_0x1f0553[_0x04e7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x04e7('0xc')](function(_0x13c308){logger[_0x04e7('0xd')]('ShowVariable',_0x4da4ed);logger[_0x04e7('0x10')]('ShowVariable',_0x4da4ed,JSON[_0x04e7('0x12')](_0x13c308));_0x1b8a84(_0x13c308);})['catch'](function(_0x114f67){logger[_0x04e7('0x13')]('ShowVariable',_0x114f67['message'],_0x4da4ed);_0x23af11(_0xab81e1[_0x04e7('0x13')](0x1f4,_0x114f67['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 54365f9..f285992 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 _0x292d=['/pull','pull','/restart','/migrations','migrations','exports','express','Router','../../components/auth/service','get','/fetch','isAuthenticated','canUpdate','fetch','/reset'];(function(_0x292124,_0x1c4dcd){var _0x1c1f38=function(_0x4fa28e){while(--_0x4fa28e){_0x292124['push'](_0x292124['shift']());}};_0x1c1f38(++_0x1c4dcd);}(_0x292d,0x132));var _0xd292=function(_0x545bed,_0x221e96){_0x545bed=_0x545bed-0x0;var _0x16c79c=_0x292d[_0x545bed];return _0x16c79c;};'use strict';var express=require(_0xd292('0x0'));var router=express[_0xd292('0x1')]();var auth=require(_0xd292('0x2'));var controller=require('./version.controller');router[_0xd292('0x3')]('/',controller['index']);router[_0xd292('0x3')](_0xd292('0x4'),auth[_0xd292('0x5')](),auth[_0xd292('0x6')](),controller[_0xd292('0x7')]);router[_0xd292('0x3')](_0xd292('0x8'),auth[_0xd292('0x5')](),auth[_0xd292('0x6')](),controller['reset']);router[_0xd292('0x3')](_0xd292('0x9'),auth[_0xd292('0x5')](),auth[_0xd292('0x6')](),controller[_0xd292('0xa')]);router[_0xd292('0x3')](_0xd292('0xb'),auth[_0xd292('0x5')](),controller['restart']);router['get'](_0xd292('0xc'),controller[_0xd292('0xd')]);module[_0xd292('0xe')]=router; \ No newline at end of file +var _0x071a=['index','/fetch','isAuthenticated','fetch','/reset','canUpdate','reset','/pull','pull','/restart','restart','/migrations','exports','express','Router','get'];(function(_0x3a54c1,_0x1b19a7){var _0x532e71=function(_0x232423){while(--_0x232423){_0x3a54c1['push'](_0x3a54c1['shift']());}};_0x532e71(++_0x1b19a7);}(_0x071a,0x19d));var _0xa071=function(_0x15294d,_0x4f6a0d){_0x15294d=_0x15294d-0x0;var _0x4f6dab=_0x071a[_0x15294d];return _0x4f6dab;};'use strict';var express=require(_0xa071('0x0'));var router=express[_0xa071('0x1')]();var auth=require('../../components/auth/service');var controller=require('./version.controller');router[_0xa071('0x2')]('/',controller[_0xa071('0x3')]);router[_0xa071('0x2')](_0xa071('0x4'),auth[_0xa071('0x5')](),auth['canUpdate'](),controller[_0xa071('0x6')]);router[_0xa071('0x2')](_0xa071('0x7'),auth[_0xa071('0x5')](),auth[_0xa071('0x8')](),controller[_0xa071('0x9')]);router[_0xa071('0x2')](_0xa071('0xa'),auth[_0xa071('0x5')](),auth[_0xa071('0x8')](),controller[_0xa071('0xb')]);router[_0xa071('0x2')](_0xa071('0xc'),auth[_0xa071('0x5')](),controller[_0xa071('0xd')]);router[_0xa071('0x2')](_0xa071('0xe'),controller['migrations']);module[_0xa071('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 3c3597c..db7529b 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 _0x834d=['error','info','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','join','length','.js','push','sort','Migration','sequelize','constructor','server','map','last','Database\x20already\x20up-to-date','umzug','path','pkginfo','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','root','index','exports','version','query','latest','tags','2.0.0','status','json','fetch','origin','master'];(function(_0x16bfc5,_0x4f9dc3){var _0x43b820=function(_0x363ced){while(--_0x363ced){_0x16bfc5['push'](_0x16bfc5['shift']());}};_0x43b820(++_0x4f9dc3);}(_0x834d,0x140));var _0xd834=function(_0x35e62c,_0x43557a){_0x35e62c=_0x35e62c-0x0;var _0x3764a4=_0x834d[_0x35e62c];return _0x3764a4;};'use strict';var Umzug=require(_0xd834('0x0'));var path=require(_0xd834('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xd834('0x2'))(module,'version');var compareVersions=require('compare-versions');var exec=require(_0xd834('0x3'))[_0xd834('0x4')];var db=require(_0xd834('0x5'))['db'];var config=require(_0xd834('0x6'));var pm2=require('../../config/pm2');var logger=require(_0xd834('0x7'))(_0xd834('0x8'));var git=require(_0xd834('0x9'))(config[_0xd834('0xa')]);exports[_0xd834('0xb')]=function(_0x256853,_0x51c989){var _0x6ab9ae={'current':module[_0xd834('0xc')][_0xd834('0xd')],'phonebar':0x2};if(_0x256853['query']&&_0x256853[_0xd834('0xe')][_0xd834('0xf')]){return git['fetch']()[_0xd834('0x10')](function(_0x1d2557,_0x4e9e43){_0x6ab9ae[_0xd834('0xf')]=(_0x1d2557?module[_0xd834('0xc')][_0xd834('0xd')]:_0x4e9e43[_0xd834('0xf')])||_0xd834('0x11');return _0x51c989[_0xd834('0x12')](0xc8)[_0xd834('0x13')](_0x6ab9ae);});}else{return _0x51c989[_0xd834('0x12')](0xc8)[_0xd834('0x13')](_0x6ab9ae);}};exports[_0xd834('0x14')]=function(_0x3d6374,_0x5d6c9a){return git[_0xd834('0x14')]([_0xd834('0x15'),_0xd834('0x16')],function(_0x4b41d9){if(_0x4b41d9){logger[_0xd834('0x17')](_0x4b41d9);return _0x5d6c9a[_0xd834('0x12')](0x1f4)[_0xd834('0x13')](_0x4b41d9);}logger[_0xd834('0x18')]('git\x20fetch');return _0x5d6c9a[_0xd834('0x12')](0xc8)[_0xd834('0x13')]({'output':_0xd834('0x19')});});};exports[_0xd834('0x1a')]=function(_0x4ab468,_0x21ce1a){return git[_0xd834('0x1a')](['--hard',_0xd834('0x1b')],function(_0x46d26a){if(_0x46d26a){logger[_0xd834('0x17')](_0x46d26a);return _0x21ce1a['status'](0x1f4)[_0xd834('0x13')](_0x46d26a);}logger['info'](_0xd834('0x1c'));return _0x21ce1a[_0xd834('0x12')](0xc8)['json']({'output':_0xd834('0x1d')});});};exports[_0xd834('0x1e')]=function(_0x32b86b,_0x23b6a7){exec(_0xd834('0x1f'),function(_0x45d83f,_0x59b604,_0x6cec0d){logger['info'](_0x59b604);logger[_0xd834('0x18')](_0x6cec0d);if(_0x45d83f){logger['error'](_0x45d83f);return _0x23b6a7[_0xd834('0x12')](0x1f4)[_0xd834('0x13')](_0x45d83f);}return _0x23b6a7[_0xd834('0x12')](0xc8)['json']({'output':_0x59b604});});};exports['restart']=function(_0x4b89b5,_0x2a5921){return pm2['restart'](_0xd834('0x20'))['then'](function(_0x31aa56){logger['info'](_0xd834('0x21'),_0x31aa56);return _0x2a5921[_0xd834('0x12')](0xc8)[_0xd834('0x13')]({'output':_0xd834('0x22')});})[_0xd834('0x23')](function(_0x570c95){logger[_0xd834('0x17')](_0x570c95);return _0x2a5921['status'](0x1f4)[_0xd834('0x13')](_0x570c95);});};exports[_0xd834('0x24')]=function(_0x1f55f4,_0xf8813d){var _0x52dd66=fs['readdirSync'](path[_0xd834('0x25')](config['root'],'server','migrations'));var _0xc5b1a3=[];for(var _0x2737ac=0x0;_0x2737ac<_0x52dd66[_0xd834('0x26')];_0x2737ac++){var _0x4f4602=_0x52dd66[_0x2737ac]['replace'](_0xd834('0x27'),'');if(compareVersions(module[_0xd834('0xc')][_0xd834('0xd')],_0x4f4602)===-0x1){_0xc5b1a3[_0xd834('0x28')](_0x4f4602);}}if(_0xc5b1a3[_0xd834('0x26')]){var _0x132236=_0xc5b1a3[_0xd834('0x29')](compareVersions);var _0x3234a4=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xd834('0x2a')],'modelName':'Migration','columnName':_0xd834('0xd')},'migrations':{'params':[db[_0xd834('0x2b')]['getQueryInterface'](),db[_0xd834('0x2b')][_0xd834('0x2c')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0xd834('0x25')](config['root'],_0xd834('0x2d'),_0xd834('0x24')),'pattern':/\.js$/}});_0x3234a4['up']({'migrations':_[_0xd834('0x2e')](_0x132236,function(_0x4b7a64){return _0x4b7a64+_0xd834('0x27');})})['then'](function(){return _0xf8813d[_0xd834('0x12')](0xc8)[_0xd834('0x13')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xd834('0xc')][_0xd834('0xd')]+'\x20to\x20'+_[_0xd834('0x2f')](_0x132236),'migrations':_[_0xd834('0x25')](_0x132236)});})[_0xd834('0x23')](function(_0x5629c4){if(_0x5629c4 instanceof db[_0xd834('0x2b')]['UniqueConstraintError']){return _0xf8813d[_0xd834('0x12')](0xc8)['json']({'output':_0xd834('0x30')});}else{return _0xf8813d[_0xd834('0x12')](0x1f4)[_0xd834('0x13')](_0x5629c4);}});}else{return _0xf8813d['status'](0xc8)[_0xd834('0x13')]({'output':_0xd834('0x30')});}}; \ No newline at end of file +var _0x85c8=['npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','join','server','length','.js','push','sort','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','Database\x20already\x20up-to-date','umzug','lodash','version','compare-versions','child_process','exec','../../config/environment','../../config/logger','update','simple-git','root','index','exports','latest','fetch','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','pull'];(function(_0xf3ee5b,_0x448ee6){var _0x42916f=function(_0x464319){while(--_0x464319){_0xf3ee5b['push'](_0xf3ee5b['shift']());}};_0x42916f(++_0x448ee6);}(_0x85c8,0x129));var _0x885c=function(_0x278bbe,_0x32999a){_0x278bbe=_0x278bbe-0x0;var _0xd18d13=_0x85c8[_0x278bbe];return _0xd18d13;};'use strict';var Umzug=require(_0x885c('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x885c('0x1'));var pkginfo=require('pkginfo')(module,_0x885c('0x2'));var compareVersions=require(_0x885c('0x3'));var exec=require(_0x885c('0x4'))[_0x885c('0x5')];var db=require('../../mysqldb')['db'];var config=require(_0x885c('0x6'));var pm2=require('../../config/pm2');var logger=require(_0x885c('0x7'))(_0x885c('0x8'));var git=require(_0x885c('0x9'))(config[_0x885c('0xa')]);exports[_0x885c('0xb')]=function(_0x4b8157,_0x2389d7){var _0x3edd6e={'current':module[_0x885c('0xc')]['version'],'phonebar':0x2};if(_0x4b8157['query']&&_0x4b8157['query'][_0x885c('0xd')]){return git[_0x885c('0xe')]()['tags'](function(_0x569d1d,_0x4a0af0){_0x3edd6e[_0x885c('0xd')]=(_0x569d1d?module[_0x885c('0xc')]['version']:_0x4a0af0['latest'])||'2.0.0';return _0x2389d7[_0x885c('0xf')](0xc8)[_0x885c('0x10')](_0x3edd6e);});}else{return _0x2389d7[_0x885c('0xf')](0xc8)[_0x885c('0x10')](_0x3edd6e);}};exports[_0x885c('0xe')]=function(_0x3b6dd6,_0x1a82ae){return git[_0x885c('0xe')]([_0x885c('0x11'),_0x885c('0x12')],function(_0x38e2ff){if(_0x38e2ff){logger[_0x885c('0x13')](_0x38e2ff);return _0x1a82ae[_0x885c('0xf')](0x1f4)['json'](_0x38e2ff);}logger[_0x885c('0x14')](_0x885c('0x15'));return _0x1a82ae[_0x885c('0xf')](0xc8)[_0x885c('0x10')]({'output':_0x885c('0x16')});});};exports[_0x885c('0x17')]=function(_0x34ea2a,_0x5c56e3){return git[_0x885c('0x17')](['--hard','FETCH_HEAD'],function(_0x14d87a){if(_0x14d87a){logger[_0x885c('0x13')](_0x14d87a);return _0x5c56e3[_0x885c('0xf')](0x1f4)[_0x885c('0x10')](_0x14d87a);}logger[_0x885c('0x14')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x5c56e3['status'](0xc8)[_0x885c('0x10')]({'output':'git\x20reset\x20--hard'});});};exports[_0x885c('0x18')]=function(_0x5c2826,_0x16e111){exec(_0x885c('0x19'),function(_0x2ea9fc,_0x385b1d,_0x9b45a3){logger[_0x885c('0x14')](_0x385b1d);logger[_0x885c('0x14')](_0x9b45a3);if(_0x2ea9fc){logger[_0x885c('0x13')](_0x2ea9fc);return _0x16e111['status'](0x1f4)[_0x885c('0x10')](_0x2ea9fc);}return _0x16e111['status'](0xc8)[_0x885c('0x10')]({'output':_0x385b1d});});};exports[_0x885c('0x1a')]=function(_0x36666e,_0x571652){return pm2[_0x885c('0x1a')](_0x885c('0x1b'))['then'](function(_0x2e1f2d){logger[_0x885c('0x14')](_0x885c('0x1c'),_0x2e1f2d);return _0x571652[_0x885c('0xf')](0xc8)[_0x885c('0x10')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x885c('0x1d')](function(_0x3e9f4e){logger['error'](_0x3e9f4e);return _0x571652[_0x885c('0xf')](0x1f4)[_0x885c('0x10')](_0x3e9f4e);});};exports[_0x885c('0x1e')]=function(_0xe9a020,_0x4beafd){var _0x47789d=fs[_0x885c('0x1f')](path[_0x885c('0x20')](config[_0x885c('0xa')],_0x885c('0x21'),'migrations'));var _0x2f38ee=[];for(var _0x1001ca=0x0;_0x1001ca<_0x47789d[_0x885c('0x22')];_0x1001ca++){var _0x53bf13=_0x47789d[_0x1001ca]['replace'](_0x885c('0x23'),'');if(compareVersions(module[_0x885c('0xc')][_0x885c('0x2')],_0x53bf13)===-0x1){_0x2f38ee[_0x885c('0x24')](_0x53bf13);}}if(_0x2f38ee['length']){var _0x4924f8=_0x2f38ee[_0x885c('0x25')](compareVersions);var _0x4c403a=new Umzug({'storage':_0x885c('0x26'),'storageOptions':{'model':db['Migration'],'modelName':_0x885c('0x27'),'columnName':_0x885c('0x2')},'migrations':{'params':[db[_0x885c('0x26')][_0x885c('0x28')](),db[_0x885c('0x26')]['constructor'],function(){throw new Error(_0x885c('0x29'));}],'path':path['join'](config[_0x885c('0xa')],'server',_0x885c('0x1e')),'pattern':/\.js$/}});_0x4c403a['up']({'migrations':_[_0x885c('0x2a')](_0x4924f8,function(_0x41524e){return _0x41524e+_0x885c('0x23');})})['then'](function(){return _0x4beafd['status'](0xc8)[_0x885c('0x10')]({'output':_0x885c('0x2b')+module['exports']['version']+_0x885c('0x2c')+_['last'](_0x4924f8),'migrations':_['join'](_0x4924f8)});})[_0x885c('0x1d')](function(_0x2ecb33){if(_0x2ecb33 instanceof db[_0x885c('0x26')]['UniqueConstraintError']){return _0x4beafd[_0x885c('0xf')](0xc8)[_0x885c('0x10')]({'output':_0x885c('0x2d')});}else{return _0x4beafd[_0x885c('0xf')](0x1f4)[_0x885c('0x10')](_0x2ecb33);}});}else{return _0x4beafd['status'](0xc8)[_0x885c('0x10')]({'output':_0x885c('0x2d')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 7393cf7..fd4186a 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 _0xb016=['delete','/:id','destroy','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','index','get','describe','show','post','create','put','update'];(function(_0x1061b4,_0x126827){var _0x3dc1e7=function(_0x1877f9){while(--_0x1877f9){_0x1061b4['push'](_0x1061b4['shift']());}};_0x3dc1e7(++_0x126827);}(_0xb016,0x159));var _0x6b01=function(_0x15f2df,_0x2034ef){_0x15f2df=_0x15f2df-0x0;var _0x436b90=_0xb016[_0x15f2df];return _0x436b90;};'use strict';var multer=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b01('0x2'));var router=express['Router']();var auth=require(_0x6b01('0x3'));var interaction=require(_0x6b01('0x4'));var config=require(_0x6b01('0x5'));var controller=require(_0x6b01('0x6'));router['get']('/',auth[_0x6b01('0x7')](),controller[_0x6b01('0x8')]);router[_0x6b01('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x6b01('0xa')]);router[_0x6b01('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6b01('0xb')]);router[_0x6b01('0xc')]('/',auth[_0x6b01('0x7')](),controller[_0x6b01('0xd')]);router[_0x6b01('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x6b01('0xf')]);router[_0x6b01('0x10')](_0x6b01('0x11'),auth['isAuthenticated'](),controller[_0x6b01('0x12')]);module['exports']=router; \ No newline at end of file +var _0x71ab=['post','put','update','delete','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x23fe61,_0x10ccec){var _0x656bce=function(_0x492e51){while(--_0x492e51){_0x23fe61['push'](_0x23fe61['shift']());}};_0x656bce(++_0x10ccec);}(_0x71ab,0x64));var _0xb71a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x71ab[_0xa464c9];return _0x3d73c4;};'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('0xe')]('/',auth[_0xb71a('0x8')](),controller['create']);router[_0xb71a('0xf')]('/:id',auth[_0xb71a('0x8')](),controller[_0xb71a('0x10')]);router[_0xb71a('0x11')]('/:id',auth[_0xb71a('0x8')](),controller['destroy']);module[_0xb71a('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 2f1abf7..01fe812 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 _0xa14c=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','STRING'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xa14c,0x1c6));var _0xca14=function(_0x70eaf9,_0x58f036){_0x70eaf9=_0x70eaf9-0x0;var _0x40fe73=_0xa14c[_0x70eaf9];return _0x40fe73;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xca14('0x0')]},'uniqueid':{'type':Sequelize[_0xca14('0x0')]},'calleridnum':{'type':Sequelize[_0xca14('0x0')]},'calleridname':{'type':Sequelize[_0xca14('0x0')]},'queue':{'type':Sequelize[_0xca14('0x0')]},'interface':{'type':Sequelize[_0xca14('0x0')]},'membername':{'type':Sequelize[_0xca14('0x0')]},'agentcalledAt':{'type':Sequelize[_0xca14('0x1')]},'agentconnectAt':{'type':Sequelize[_0xca14('0x1')]},'agentcompleteAt':{'type':Sequelize[_0xca14('0x1')]},'agentringnoanswerAt':{'type':Sequelize[_0xca14('0x1')]},'agentdumpAt':{'type':Sequelize[_0xca14('0x1')]},'holdtime':{'type':Sequelize[_0xca14('0x2')]},'agentcomplete':{'type':Sequelize[_0xca14('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xca14('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xca14('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xca14('0x2')]},'agentacw':{'type':Sequelize[_0xca14('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xca14('0x2')]},'reason':{'type':Sequelize[_0xca14('0x0')]},'lastevent':{'type':Sequelize[_0xca14('0x0')]},'channel':{'type':Sequelize[_0xca14('0x0')]},'channelstate':{'type':Sequelize[_0xca14('0x2')]},'channelstatedesc':{'type':Sequelize[_0xca14('0x0')]},'connectedlinenum':{'type':Sequelize[_0xca14('0x0')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xca14('0x0')]},'accountcode':{'type':Sequelize[_0xca14('0x0')]},'context':{'type':Sequelize[_0xca14('0x0')]},'exten':{'type':Sequelize[_0xca14('0x0')]},'priority':{'type':Sequelize[_0xca14('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xca14('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xca14('0x0')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xca14('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0xca14('0x0')]},'destconnectedlinename':{'type':Sequelize[_0xca14('0x0')]},'destlanguage':{'type':Sequelize[_0xca14('0x0')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xca14('0x0')]},'destexten':{'type':Sequelize[_0xca14('0x0')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xca14('0x0')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xca14('0x0')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xca14('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xca14('0x0')],'comment':_0xca14('0x4')},'transferexten':{'type':Sequelize[_0xca14('0x0')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xca14('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd0f0=['DATE','INTEGER','BOOLEAN','exports','STRING'];(function(_0x425976,_0x137951){var _0x5dccaf=function(_0x19bacb){while(--_0x19bacb){_0x425976['push'](_0x425976['shift']());}};_0x5dccaf(++_0x137951);}(_0xd0f0,0x139));var _0x0d0f=function(_0x3f52ee,_0x468aab){_0x3f52ee=_0x3f52ee-0x0;var _0x4f7924=_0xd0f0[_0x3f52ee];return _0x4f7924;};'use strict';var Sequelize=require('sequelize');module[_0x0d0f('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0d0f('0x1')]},'calleridnum':{'type':Sequelize[_0x0d0f('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x0d0f('0x1')]},'agentcalledAt':{'type':Sequelize[_0x0d0f('0x2')]},'agentconnectAt':{'type':Sequelize[_0x0d0f('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x0d0f('0x2')]},'agentdumpAt':{'type':Sequelize[_0x0d0f('0x2')]},'holdtime':{'type':Sequelize[_0x0d0f('0x3')]},'agentcomplete':{'type':Sequelize[_0x0d0f('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x0d0f('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x0d0f('0x3')]},'reason':{'type':Sequelize[_0x0d0f('0x1')]},'lastevent':{'type':Sequelize[_0x0d0f('0x1')]},'channel':{'type':Sequelize[_0x0d0f('0x1')]},'channelstate':{'type':Sequelize[_0x0d0f('0x3')]},'channelstatedesc':{'type':Sequelize[_0x0d0f('0x1')]},'connectedlinenum':{'type':Sequelize[_0x0d0f('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0d0f('0x1')]},'accountcode':{'type':Sequelize[_0x0d0f('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x0d0f('0x1')]},'priority':{'type':Sequelize[_0x0d0f('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x0d0f('0x1')]},'destcalleridnum':{'type':Sequelize[_0x0d0f('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x0d0f('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x0d0f('0x1')]},'destlanguage':{'type':Sequelize[_0x0d0f('0x1')]},'destaccountcode':{'type':Sequelize[_0x0d0f('0x1')]},'destcontext':{'type':Sequelize[_0x0d0f('0x1')]},'destexten':{'type':Sequelize[_0x0d0f('0x1')]},'destpriority':{'type':Sequelize[_0x0d0f('0x1')]},'destuniqueid':{'type':Sequelize[_0x0d0f('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x0d0f('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x0d0f('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x0d0f('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x0d0f('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 2b2352e..34f9cdb 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 _0x1b2d=['options','includeAll','findAll','catch','show','params','length','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','set','json','apply','reject','update','then','destroy','sendStatus','error','name','send','VoiceAgentReport','rawAttributes','keys','query','filters','intersection','model','attributes','fields','limit','order','sort','where','pick','filter','type','key'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x1b2d,0x1ee));var _0xd1b2=function(_0x24e25e,_0x1a6c37){_0x24e25e=_0x24e25e-0x0;var _0x5a14cd=_0x1b2d[_0x24e25e];return _0x5a14cd;};'use strict';var pdf=require(_0xd1b2('0x0'));var emlformat=require(_0xd1b2('0x1'));var rimraf=require(_0xd1b2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd1b2('0x3'));var rp=require(_0xd1b2('0x4'));var moment=require(_0xd1b2('0x5'));var BPromise=require(_0xd1b2('0x6'));var Mustache=require(_0xd1b2('0x7'));var util=require(_0xd1b2('0x8'));var path=require('path');var sox=require(_0xd1b2('0x9'));var csv=require(_0xd1b2('0xa'));var ejs=require(_0xd1b2('0xb'));var fs=require('fs');var _=require(_0xd1b2('0xc'));var squel=require(_0xd1b2('0xd'));var crypto=require(_0xd1b2('0xe'));var jsforce=require(_0xd1b2('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd1b2('0xa'));var querystring=require(_0xd1b2('0x10'));var Papa=require(_0xd1b2('0x11'));var Redis=require(_0xd1b2('0x12'));var authService=require(_0xd1b2('0x13'));var qs=require(_0xd1b2('0x14'));var hardwareService=require(_0xd1b2('0x15'));var logger=require('../../config/logger')(_0xd1b2('0x16'));var utils=require(_0xd1b2('0x17'));var config=require(_0xd1b2('0x18'));var db=require(_0xd1b2('0x19'))['db'];function respondWithStatusCode(_0x259417,_0x2512cd){_0x2512cd=_0x2512cd||0xcc;return function(_0x360d2a){if(_0x360d2a){return _0x259417['sendStatus'](_0x2512cd);}return _0x259417[_0xd1b2('0x1a')](_0x2512cd)[_0xd1b2('0x1b')]();};}function respondWithResult(_0x340d6c,_0x33dd0f){_0x33dd0f=_0x33dd0f||0xc8;return function(_0x294f5d){if(_0x294f5d){return _0x340d6c['status'](_0x33dd0f)['json'](_0x294f5d);}};}function respondWithFilteredResult(_0x155f4d,_0x1b4dbc){return function(_0x545fba){if(_0x545fba){var _0x12d1e1=_0x545fba[_0xd1b2('0x1c')],_0x330a51=_0x1b4dbc[_0xd1b2('0x1d')],_0x191a67=_0x1b4dbc[_0xd1b2('0x1d')]+_0x1b4dbc['limit'],_0x2c14cd;if(_0x191a67>=_0x12d1e1){_0x191a67=_0x12d1e1;_0x2c14cd=0xc8;}else{_0x2c14cd=0xce;}_0x155f4d[_0xd1b2('0x1a')](_0x2c14cd);return _0x155f4d[_0xd1b2('0x1e')]('Content-Range',_0x330a51+'-'+_0x191a67+'/'+_0x12d1e1)[_0xd1b2('0x1f')](_0x545fba);}return null;};}function patchUpdates(_0xafaa6){return function(_0x7a5a96){try{jsonpatch[_0xd1b2('0x20')](_0x7a5a96,_0xafaa6,!![]);}catch(_0x1fde3a){return BPromise[_0xd1b2('0x21')](_0x1fde3a);}return _0x7a5a96['save']();};}function saveUpdates(_0x3f235b,_0x59fba1){return function(_0x274737){if(_0x274737){return _0x274737[_0xd1b2('0x22')](_0x3f235b)[_0xd1b2('0x23')](function(_0x2dd10c){return _0x2dd10c;});}return null;};}function removeEntity(_0xfffdc9,_0x16f622){return function(_0x428a25){if(_0x428a25){return _0x428a25[_0xd1b2('0x24')]()[_0xd1b2('0x23')](function(){_0xfffdc9[_0xd1b2('0x1a')](0xcc)[_0xd1b2('0x1b')]();});}};}function handleEntityNotFound(_0x2ec45b,_0x1f3cfd){return function(_0x26c984){if(!_0x26c984){_0x2ec45b[_0xd1b2('0x25')](0x194);}return _0x26c984;};}function handleError(_0x2ecc63,_0xd07a96){_0xd07a96=_0xd07a96||0x1f4;return function(_0x5ab8dd){logger[_0xd1b2('0x26')](_0x5ab8dd['stack']);if(_0x5ab8dd['name']){delete _0x5ab8dd[_0xd1b2('0x27')];}_0x2ecc63[_0xd1b2('0x1a')](_0xd07a96)[_0xd1b2('0x28')](_0x5ab8dd);};}exports['index']=function(_0x1fbdad,_0x239186){var _0x4efd7f={},_0x470c78={},_0x1c7b3f={'count':0x0,'rows':[]};var _0x380f81=db[_0xd1b2('0x29')][_0xd1b2('0x2a')];_0x470c78['model']=_[_0xd1b2('0x2b')](_0x380f81);_0x470c78[_0xd1b2('0x2c')]=_[_0xd1b2('0x2b')](_0x1fbdad[_0xd1b2('0x2c')]);_0x470c78[_0xd1b2('0x2d')]=_[_0xd1b2('0x2e')](_0x470c78[_0xd1b2('0x2f')],_0x470c78['query']);_0x4efd7f[_0xd1b2('0x30')]=_[_0xd1b2('0x2e')](_0x470c78['model'],qs[_0xd1b2('0x31')](_0x1fbdad['query'][_0xd1b2('0x31')]));_0x4efd7f[_0xd1b2('0x30')]=_0x4efd7f[_0xd1b2('0x30')]['length']?_0x4efd7f[_0xd1b2('0x30')]:_0x470c78[_0xd1b2('0x2f')];if(!_0x1fbdad[_0xd1b2('0x2c')]['hasOwnProperty']('nolimit')){_0x4efd7f[_0xd1b2('0x32')]=qs[_0xd1b2('0x32')](_0x1fbdad[_0xd1b2('0x2c')]['limit']);_0x4efd7f[_0xd1b2('0x1d')]=qs['offset'](_0x1fbdad[_0xd1b2('0x2c')]['offset']);}_0x4efd7f[_0xd1b2('0x33')]=qs[_0xd1b2('0x34')](_0x1fbdad[_0xd1b2('0x2c')][_0xd1b2('0x34')]);_0x4efd7f[_0xd1b2('0x35')]=qs[_0xd1b2('0x2d')](_[_0xd1b2('0x36')](_0x1fbdad[_0xd1b2('0x2c')],_0x470c78[_0xd1b2('0x2d')]));if(_0x1fbdad[_0xd1b2('0x2c')][_0xd1b2('0x37')]){_0x4efd7f[_0xd1b2('0x35')]=_['merge'](_0x4efd7f['where'],{'$or':_['map'](_0x380f81,function(_0x5c3074){if(_0x5c3074[_0xd1b2('0x38')][_0xd1b2('0x39')]!=='VIRTUAL'){var _0x15d4af={};_0x15d4af[_0x5c3074['field']]={'$like':'%'+_0x1fbdad[_0xd1b2('0x2c')]['filter']+'%'};return _0x15d4af;}})});}_0x4efd7f=_['merge']({},_0x4efd7f,_0x1fbdad[_0xd1b2('0x3a')]);var _0x4764b6={'where':_0x4efd7f[_0xd1b2('0x35')]};return db[_0xd1b2('0x29')][_0xd1b2('0x1c')](_0x4764b6)[_0xd1b2('0x23')](function(_0x2d0fb2){_0x1c7b3f['count']=_0x2d0fb2;if(_0x1fbdad[_0xd1b2('0x2c')][_0xd1b2('0x3b')]){_0x4efd7f['include']=[{'all':!![]}];}return db[_0xd1b2('0x29')][_0xd1b2('0x3c')](_0x4efd7f);})[_0xd1b2('0x23')](function(_0x2dce40){_0x1c7b3f['rows']=_0x2dce40;return _0x1c7b3f;})[_0xd1b2('0x23')](respondWithFilteredResult(_0x239186,_0x4efd7f))[_0xd1b2('0x3d')](handleError(_0x239186,null));};exports[_0xd1b2('0x3e')]=function(_0x27603d,_0x461471){var _0x3af2ea={'raw':![],'where':{'id':_0x27603d[_0xd1b2('0x3f')]['id']}},_0x36fa8b={};_0x36fa8b[_0xd1b2('0x2f')]=_[_0xd1b2('0x2b')](db[_0xd1b2('0x29')][_0xd1b2('0x2a')]);_0x36fa8b[_0xd1b2('0x2c')]=_[_0xd1b2('0x2b')](_0x27603d[_0xd1b2('0x2c')]);_0x36fa8b[_0xd1b2('0x2d')]=_[_0xd1b2('0x2e')](_0x36fa8b[_0xd1b2('0x2f')],_0x36fa8b[_0xd1b2('0x2c')]);_0x3af2ea[_0xd1b2('0x30')]=_[_0xd1b2('0x2e')](_0x36fa8b[_0xd1b2('0x2f')],qs[_0xd1b2('0x31')](_0x27603d['query'][_0xd1b2('0x31')]));_0x3af2ea[_0xd1b2('0x30')]=_0x3af2ea[_0xd1b2('0x30')][_0xd1b2('0x40')]?_0x3af2ea[_0xd1b2('0x30')]:_0x36fa8b[_0xd1b2('0x2f')];if(_0x27603d[_0xd1b2('0x2c')][_0xd1b2('0x3b')]){_0x3af2ea['include']=[{'all':!![]}];}_0x3af2ea=_['merge']({},_0x3af2ea,_0x27603d[_0xd1b2('0x3a')]);return db[_0xd1b2('0x29')][_0xd1b2('0x41')](_0x3af2ea)[_0xd1b2('0x23')](handleEntityNotFound(_0x461471,null))[_0xd1b2('0x23')](respondWithResult(_0x461471,null))[_0xd1b2('0x3d')](handleError(_0x461471,null));};exports['create']=function(_0x4090e6,_0x183d1c){return db[_0xd1b2('0x29')][_0xd1b2('0x42')](_0x4090e6[_0xd1b2('0x43')],{})[_0xd1b2('0x23')](respondWithResult(_0x183d1c,0xc9))[_0xd1b2('0x3d')](handleError(_0x183d1c,null));};exports[_0xd1b2('0x22')]=function(_0x3a9e43,_0x164816){if(_0x3a9e43[_0xd1b2('0x43')]['id']){delete _0x3a9e43[_0xd1b2('0x43')]['id'];}return db['VoiceAgentReport']['find']({'where':{'id':_0x3a9e43[_0xd1b2('0x3f')]['id']}})[_0xd1b2('0x23')](handleEntityNotFound(_0x164816,null))[_0xd1b2('0x23')](saveUpdates(_0x3a9e43[_0xd1b2('0x43')],null))[_0xd1b2('0x23')](respondWithResult(_0x164816,null))[_0xd1b2('0x3d')](handleError(_0x164816,null));};exports[_0xd1b2('0x24')]=function(_0x51f595,_0x3f3a80){return db[_0xd1b2('0x29')][_0xd1b2('0x41')]({'where':{'id':_0x51f595[_0xd1b2('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3f3a80,null))[_0xd1b2('0x23')](removeEntity(_0x3f3a80,null))[_0xd1b2('0x3d')](handleError(_0x3f3a80,null));};exports[_0xd1b2('0x44')]=function(_0x4ecdd4,_0x48d0ca){return db[_0xd1b2('0x29')][_0xd1b2('0x44')]()[_0xd1b2('0x23')](respondWithResult(_0x48d0ca,null))['catch'](handleError(_0x48d0ca,null));}; \ No newline at end of file +var _0xc89f=['create','body','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','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','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','send','index','VoiceAgentReport','rawAttributes','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','limit','order','where','filters','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','find'];(function(_0x55d85b,_0x4a39d0){var _0x183bb0=function(_0x30494f){while(--_0x30494f){_0x55d85b['push'](_0x55d85b['shift']());}};_0x183bb0(++_0x4a39d0);}(_0xc89f,0x96));var _0xfc89=function(_0x420a02,_0x91fee){_0x420a02=_0x420a02-0x0;var _0x46ad48=_0xc89f[_0x420a02];return _0x46ad48;};'use strict';var pdf=require(_0xfc89('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfc89('0x1'));var zipdir=require(_0xfc89('0x2'));var jsonpatch=require(_0xfc89('0x3'));var rp=require('request-promise');var moment=require(_0xfc89('0x4'));var BPromise=require(_0xfc89('0x5'));var Mustache=require('mustache');var util=require(_0xfc89('0x6'));var path=require(_0xfc89('0x7'));var sox=require('sox');var csv=require(_0xfc89('0x8'));var ejs=require(_0xfc89('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xfc89('0xa'));var crypto=require(_0xfc89('0xb'));var jsforce=require(_0xfc89('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfc89('0x8'));var querystring=require(_0xfc89('0xd'));var Papa=require(_0xfc89('0xe'));var Redis=require(_0xfc89('0xf'));var authService=require(_0xfc89('0x10'));var qs=require(_0xfc89('0x11'));var hardwareService=require(_0xfc89('0x12'));var logger=require(_0xfc89('0x13'))(_0xfc89('0x14'));var utils=require(_0xfc89('0x15'));var config=require(_0xfc89('0x16'));var db=require(_0xfc89('0x17'))['db'];function respondWithStatusCode(_0x1d45f4,_0x329cb0){_0x329cb0=_0x329cb0||0xcc;return function(_0x382d74){if(_0x382d74){return _0x1d45f4['sendStatus'](_0x329cb0);}return _0x1d45f4[_0xfc89('0x18')](_0x329cb0)[_0xfc89('0x19')]();};}function respondWithResult(_0x56a0fb,_0x382b0b){_0x382b0b=_0x382b0b||0xc8;return function(_0x1e4b02){if(_0x1e4b02){return _0x56a0fb[_0xfc89('0x18')](_0x382b0b)[_0xfc89('0x1a')](_0x1e4b02);}};}function respondWithFilteredResult(_0x4811dc,_0x9db918){return function(_0x4d6286){if(_0x4d6286){var _0x263832=_0x4d6286[_0xfc89('0x1b')],_0x3ccc95=_0x9db918[_0xfc89('0x1c')],_0x1ca04d=_0x9db918['offset']+_0x9db918['limit'],_0x5ef01e;if(_0x1ca04d>=_0x263832){_0x1ca04d=_0x263832;_0x5ef01e=0xc8;}else{_0x5ef01e=0xce;}_0x4811dc[_0xfc89('0x18')](_0x5ef01e);return _0x4811dc[_0xfc89('0x1d')](_0xfc89('0x1e'),_0x3ccc95+'-'+_0x1ca04d+'/'+_0x263832)['json'](_0x4d6286);}return null;};}function patchUpdates(_0x1ee097){return function(_0x53f3a0){try{jsonpatch[_0xfc89('0x1f')](_0x53f3a0,_0x1ee097,!![]);}catch(_0x10033e){return BPromise[_0xfc89('0x20')](_0x10033e);}return _0x53f3a0[_0xfc89('0x21')]();};}function saveUpdates(_0x35f641,_0x163dba){return function(_0x35ffb3){if(_0x35ffb3){return _0x35ffb3[_0xfc89('0x22')](_0x35f641)[_0xfc89('0x23')](function(_0x1a9334){return _0x1a9334;});}return null;};}function removeEntity(_0xaba2bd,_0x2d0eed){return function(_0x5108fb){if(_0x5108fb){return _0x5108fb[_0xfc89('0x24')]()[_0xfc89('0x23')](function(){_0xaba2bd[_0xfc89('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17ad60,_0x12cb72){return function(_0x4a71f8){if(!_0x4a71f8){_0x17ad60[_0xfc89('0x25')](0x194);}return _0x4a71f8;};}function handleError(_0x5846c1,_0x4b3cdf){_0x4b3cdf=_0x4b3cdf||0x1f4;return function(_0x5490da){logger[_0xfc89('0x26')](_0x5490da[_0xfc89('0x27')]);if(_0x5490da['name']){delete _0x5490da['name'];}_0x5846c1[_0xfc89('0x18')](_0x4b3cdf)[_0xfc89('0x28')](_0x5490da);};}exports[_0xfc89('0x29')]=function(_0x1e6d80,_0x2a831b){var _0x2aa4f4={},_0x1f705b={},_0xc456e6={'count':0x0,'rows':[]};var _0x5ac400=db[_0xfc89('0x2a')][_0xfc89('0x2b')];_0x1f705b[_0xfc89('0x2c')]=_['keys'](_0x5ac400);_0x1f705b[_0xfc89('0x2d')]=_[_0xfc89('0x2e')](_0x1e6d80[_0xfc89('0x2d')]);_0x1f705b['filters']=_['intersection'](_0x1f705b['model'],_0x1f705b[_0xfc89('0x2d')]);_0x2aa4f4[_0xfc89('0x2f')]=_[_0xfc89('0x30')](_0x1f705b[_0xfc89('0x2c')],qs[_0xfc89('0x31')](_0x1e6d80[_0xfc89('0x2d')][_0xfc89('0x31')]));_0x2aa4f4[_0xfc89('0x2f')]=_0x2aa4f4[_0xfc89('0x2f')][_0xfc89('0x32')]?_0x2aa4f4[_0xfc89('0x2f')]:_0x1f705b[_0xfc89('0x2c')];if(!_0x1e6d80[_0xfc89('0x2d')][_0xfc89('0x33')]('nolimit')){_0x2aa4f4['limit']=qs[_0xfc89('0x34')](_0x1e6d80['query'][_0xfc89('0x34')]);_0x2aa4f4[_0xfc89('0x1c')]=qs['offset'](_0x1e6d80[_0xfc89('0x2d')][_0xfc89('0x1c')]);}_0x2aa4f4[_0xfc89('0x35')]=qs['sort'](_0x1e6d80[_0xfc89('0x2d')]['sort']);_0x2aa4f4[_0xfc89('0x36')]=qs[_0xfc89('0x37')](_[_0xfc89('0x38')](_0x1e6d80[_0xfc89('0x2d')],_0x1f705b[_0xfc89('0x37')]));if(_0x1e6d80['query'][_0xfc89('0x39')]){_0x2aa4f4[_0xfc89('0x36')]=_[_0xfc89('0x3a')](_0x2aa4f4[_0xfc89('0x36')],{'$or':_['map'](_0x5ac400,function(_0x193733){if(_0x193733[_0xfc89('0x3b')][_0xfc89('0x3c')]!==_0xfc89('0x3d')){var _0x2f92e8={};_0x2f92e8[_0x193733['field']]={'$like':'%'+_0x1e6d80[_0xfc89('0x2d')][_0xfc89('0x39')]+'%'};return _0x2f92e8;}})});}_0x2aa4f4=_[_0xfc89('0x3a')]({},_0x2aa4f4,_0x1e6d80[_0xfc89('0x3e')]);var _0x1202f6={'where':_0x2aa4f4[_0xfc89('0x36')]};return db[_0xfc89('0x2a')][_0xfc89('0x1b')](_0x1202f6)[_0xfc89('0x23')](function(_0x1c68a4){_0xc456e6[_0xfc89('0x1b')]=_0x1c68a4;if(_0x1e6d80[_0xfc89('0x2d')][_0xfc89('0x3f')]){_0x2aa4f4[_0xfc89('0x40')]=[{'all':!![]}];}return db['VoiceAgentReport']['findAll'](_0x2aa4f4);})[_0xfc89('0x23')](function(_0x166985){_0xc456e6[_0xfc89('0x41')]=_0x166985;return _0xc456e6;})[_0xfc89('0x23')](respondWithFilteredResult(_0x2a831b,_0x2aa4f4))[_0xfc89('0x42')](handleError(_0x2a831b,null));};exports[_0xfc89('0x43')]=function(_0x1ac234,_0x197f3d){var _0x49030c={'raw':![],'where':{'id':_0x1ac234['params']['id']}},_0x43bdc4={};_0x43bdc4[_0xfc89('0x2c')]=_[_0xfc89('0x2e')](db['VoiceAgentReport']['rawAttributes']);_0x43bdc4[_0xfc89('0x2d')]=_['keys'](_0x1ac234[_0xfc89('0x2d')]);_0x43bdc4[_0xfc89('0x37')]=_[_0xfc89('0x30')](_0x43bdc4[_0xfc89('0x2c')],_0x43bdc4['query']);_0x49030c['attributes']=_[_0xfc89('0x30')](_0x43bdc4['model'],qs[_0xfc89('0x31')](_0x1ac234[_0xfc89('0x2d')]['fields']));_0x49030c['attributes']=_0x49030c[_0xfc89('0x2f')]['length']?_0x49030c[_0xfc89('0x2f')]:_0x43bdc4[_0xfc89('0x2c')];if(_0x1ac234[_0xfc89('0x2d')][_0xfc89('0x3f')]){_0x49030c[_0xfc89('0x40')]=[{'all':!![]}];}_0x49030c=_[_0xfc89('0x3a')]({},_0x49030c,_0x1ac234[_0xfc89('0x3e')]);return db['VoiceAgentReport'][_0xfc89('0x44')](_0x49030c)[_0xfc89('0x23')](handleEntityNotFound(_0x197f3d,null))[_0xfc89('0x23')](respondWithResult(_0x197f3d,null))[_0xfc89('0x42')](handleError(_0x197f3d,null));};exports[_0xfc89('0x45')]=function(_0x3053d7,_0x5b09b4){return db[_0xfc89('0x2a')]['create'](_0x3053d7[_0xfc89('0x46')],{})[_0xfc89('0x23')](respondWithResult(_0x5b09b4,0xc9))[_0xfc89('0x42')](handleError(_0x5b09b4,null));};exports[_0xfc89('0x22')]=function(_0x5d7e68,_0xe9480c){if(_0x5d7e68['body']['id']){delete _0x5d7e68[_0xfc89('0x46')]['id'];}return db[_0xfc89('0x2a')][_0xfc89('0x44')]({'where':{'id':_0x5d7e68[_0xfc89('0x47')]['id']}})[_0xfc89('0x23')](handleEntityNotFound(_0xe9480c,null))[_0xfc89('0x23')](saveUpdates(_0x5d7e68[_0xfc89('0x46')],null))['then'](respondWithResult(_0xe9480c,null))[_0xfc89('0x42')](handleError(_0xe9480c,null));};exports[_0xfc89('0x24')]=function(_0x4c82d4,_0x397e53){return db[_0xfc89('0x2a')]['find']({'where':{'id':_0x4c82d4['params']['id']}})[_0xfc89('0x23')](handleEntityNotFound(_0x397e53,null))[_0xfc89('0x23')](removeEntity(_0x397e53,null))[_0xfc89('0x42')](handleError(_0x397e53,null));};exports[_0xfc89('0x48')]=function(_0x38b45b,_0x1de5ae){return db[_0xfc89('0x2a')]['describe']()[_0xfc89('0x23')](respondWithResult(_0x1de5ae,null))[_0xfc89('0x42')](handleError(_0x1de5ae,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index b798e5a..1b91aad 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 _0xa100=['VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','../../config/logger','api','moment','bluebird','path','./voiceAgentReport.attributes','exports','define'];(function(_0x4ceb0b,_0x5a880d){var _0xa709be=function(_0x277397){while(--_0x277397){_0x4ceb0b['push'](_0x4ceb0b['shift']());}};_0xa709be(++_0x5a880d);}(_0xa100,0x122));var _0x0a10=function(_0x33d8d0,_0x4dd6e5){_0x33d8d0=_0x33d8d0-0x0;var _0x2462f9=_0xa100[_0x33d8d0];return _0x2462f9;};'use strict';var _=require(_0x0a10('0x0'));var util=require('util');var logger=require(_0x0a10('0x1'))(_0x0a10('0x2'));var moment=require(_0x0a10('0x3'));var BPromise=require(_0x0a10('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a10('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0a10('0x6'));module[_0x0a10('0x7')]=function(_0x4613ed,_0x1b5fd6){return _0x4613ed[_0x0a10('0x8')](_0x0a10('0x9'),attributes,{'tableName':_0x0a10('0xa'),'paranoid':![],'indexes':[{'fields':[_0x0a10('0xb'),_0x0a10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdd32=['exports','define','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./voiceAgentReport.attributes'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xdd32,0x1b2));var _0x2dd3=function(_0x4147b2,_0xbecc53){_0x4147b2=_0x4147b2-0x0;var _0x1ae16b=_0xdd32[_0x4147b2];return _0x1ae16b;};'use strict';var _=require(_0x2dd3('0x0'));var util=require(_0x2dd3('0x1'));var logger=require(_0x2dd3('0x2'))(_0x2dd3('0x3'));var moment=require('moment');var BPromise=require(_0x2dd3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2dd3('0x5'));var config=require(_0x2dd3('0x6'));var attributes=require(_0x2dd3('0x7'));module[_0x2dd3('0x8')]=function(_0x270974,_0x1d1398){return _0x270974[_0x2dd3('0x9')]('VoiceAgentReport',attributes,{'tableName':_0x2dd3('0xa'),'paranoid':![],'indexes':[{'fields':[_0x2dd3('0xb'),_0x2dd3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 81e9e3c..ea29c9a 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 _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(_0x3318fe,_0x3f5d89){var _0x574ad=function(_0x2e843e){while(--_0x2e843e){_0x3318fe['push'](_0x3318fe['shift']());}};_0x574ad(++_0x3f5d89);}(_0x814b,0x1a2));var _0xb814=function(_0x4aa4af,_0x210cde){_0x4aa4af=_0x4aa4af-0x0;var _0x3bf44a=_0x814b[_0x4aa4af];return _0x3bf44a;};'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 +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(_0x52340a,_0x2eb911){var _0x153811=function(_0x41becb){while(--_0x41becb){_0x52340a['push'](_0x52340a['shift']());}};_0x153811(++_0x2eb911);}(_0x7a54,0x106));var _0x47a5=function(_0x3947f6,_0x20437d){_0x3947f6=_0x3947f6-0x0;var _0x3d01c2=_0x7a54[_0x3947f6];return _0x3d01c2;};'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 diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index f08af6d..6109af5 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 _0x5026=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','util','path'];(function(_0x1e363d,_0x5b5953){var _0x37512d=function(_0xaa95bc){while(--_0xaa95bc){_0x1e363d['push'](_0x1e363d['shift']());}};_0x37512d(++_0x5b5953);}(_0x5026,0xa0));var _0x6502=function(_0xb8de9a,_0x50b8e0){_0xb8de9a=_0xb8de9a-0x0;var _0x214385=_0x5026[_0xb8de9a];return _0x214385;};'use strict';var multer=require('multer');var util=require(_0x6502('0x0'));var path=require(_0x6502('0x1'));var timeout=require('connect-timeout');var express=require(_0x6502('0x2'));var router=express[_0x6502('0x3')]();var auth=require(_0x6502('0x4'));var interaction=require(_0x6502('0x5'));var config=require(_0x6502('0x6'));var controller=require(_0x6502('0x7'));router[_0x6502('0x8')]('/',auth[_0x6502('0x9')](),controller[_0x6502('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x6502('0x8')](_0x6502('0xb'),auth['isAuthenticated'](),controller[_0x6502('0xc')]);router['post']('/',auth[_0x6502('0x9')](),controller[_0x6502('0xd')]);router[_0x6502('0xe')](_0x6502('0xb'),auth[_0x6502('0x9')](),controller[_0x6502('0xf')]);router['delete'](_0x6502('0xb'),auth[_0x6502('0x9')](),controller[_0x6502('0x10')]);module[_0x6502('0x11')]=router; \ No newline at end of file +var _0x56b3=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','describe','/:id','isAuthenticated','post','create','put','update','delete','destroy','multer','path','connect-timeout'];(function(_0x31ecd4,_0x28022c){var _0x5b053a=function(_0x26e807){while(--_0x26e807){_0x31ecd4['push'](_0x31ecd4['shift']());}};_0x5b053a(++_0x28022c);}(_0x56b3,0xe4));var _0x356b=function(_0x2e819c,_0x3f99a5){_0x2e819c=_0x2e819c-0x0;var _0x24e271=_0x56b3[_0x2e819c];return _0x24e271;};'use strict';var multer=require(_0x356b('0x0'));var util=require('util');var path=require(_0x356b('0x1'));var timeout=require(_0x356b('0x2'));var express=require(_0x356b('0x3'));var router=express[_0x356b('0x4')]();var auth=require(_0x356b('0x5'));var interaction=require(_0x356b('0x6'));var config=require(_0x356b('0x7'));var controller=require(_0x356b('0x8'));router[_0x356b('0x9')]('/',auth['isAuthenticated'](),controller[_0x356b('0xa')]);router[_0x356b('0x9')](_0x356b('0xb'),auth['isAuthenticated'](),controller[_0x356b('0xc')]);router[_0x356b('0x9')](_0x356b('0xd'),auth[_0x356b('0xe')](),controller['show']);router[_0x356b('0xf')]('/',auth[_0x356b('0xe')](),controller[_0x356b('0x10')]);router[_0x356b('0x11')](_0x356b('0xd'),auth['isAuthenticated'](),controller[_0x356b('0x12')]);router[_0x356b('0x13')](_0x356b('0xd'),auth[_0x356b('0xe')](),controller[_0x356b('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 37becd9..dd36c27 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 _0xbc58=['INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','outbound','outbound-fax','DATE'];(function(_0x567d48,_0x4a6798){var _0x7af946=function(_0x249f14){while(--_0x249f14){_0x567d48['push'](_0x567d48['shift']());}};_0x7af946(++_0x4a6798);}(_0xbc58,0x137));var _0x8bc5=function(_0x13da9a,_0x3a50ab){_0x13da9a=_0x13da9a-0x0;var _0x2e510f=_0xbc58[_0x13da9a];return _0x2e510f;};'use strict';var Sequelize=require(_0x8bc5('0x0'));module[_0x8bc5('0x1')]={'uniqueid':{'type':Sequelize[_0x8bc5('0x2')]},'type':{'type':Sequelize[_0x8bc5('0x3')](_0x8bc5('0x4'),_0x8bc5('0x5'),_0x8bc5('0x6'),'inbound-fax',_0x8bc5('0x7'),'dialer')},'tag':{'type':Sequelize[_0x8bc5('0x2')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x8bc5('0x2')]},'destination':{'type':Sequelize[_0x8bc5('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8bc5('0x2')]},'destinationchannel':{'type':Sequelize[_0x8bc5('0x2')]},'lastapplication':{'type':Sequelize[_0x8bc5('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x8bc5('0x8')]},'systemanswertime':{'type':Sequelize[_0x8bc5('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x8bc5('0x8')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x8bc5('0x9')]},'mohtime':{'type':Sequelize[_0x8bc5('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x8bc5('0x2')]},'userfield':{'type':Sequelize[_0x8bc5('0x2')]},'userDisposition':{'type':Sequelize[_0x8bc5('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x8bc5('0x2')]},'routeid':{'type':Sequelize[_0x8bc5('0x9')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7e94=['outbound','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound'];(function(_0x5d72c8,_0x85e2e1){var _0x3abc9e=function(_0x1311b){while(--_0x1311b){_0x5d72c8['push'](_0x5d72c8['shift']());}};_0x3abc9e(++_0x85e2e1);}(_0x7e94,0x7f));var _0x47e9=function(_0x2fc2f5,_0x68b39d){_0x2fc2f5=_0x2fc2f5-0x0;var _0x590209=_0x7e94[_0x2fc2f5];return _0x590209;};'use strict';var Sequelize=require(_0x47e9('0x0'));module[_0x47e9('0x1')]={'uniqueid':{'type':Sequelize[_0x47e9('0x2')]},'type':{'type':Sequelize[_0x47e9('0x3')](_0x47e9('0x4'),'internal',_0x47e9('0x5'),'inbound-fax',_0x47e9('0x6'),_0x47e9('0x7'))},'tag':{'type':Sequelize[_0x47e9('0x2')]},'accountcode':{'type':Sequelize[_0x47e9('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x47e9('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x47e9('0x8')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x47e9('0x9')]},'answertime':{'type':Sequelize[_0x47e9('0x9')]},'endtime':{'type':Sequelize[_0x47e9('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x47e9('0xa')]},'mohtime':{'type':Sequelize[_0x47e9('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x47e9('0x2')]},'userfield':{'type':Sequelize[_0x47e9('0x2')]},'userDisposition':{'type':Sequelize[_0x47e9('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x47e9('0x2')]},'routeid':{'type':Sequelize[_0x47e9('0xa')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 97363a5..e77b0c0 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 _0xa6ab=['options','count','fullname','User','findAll','rows','catch','params','length','includeAll','include','find','create','body','describe','uniqueid','user','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','end','limit','status','set','json','reject','save','update','destroy','then','stack','name','send','VoiceCallReport','rawAttributes','keys','query','filters','intersection','model','attributes','fields','offset','order','sort','where','pick','merge','map','type','key','filter'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0xa6ab,0x16a));var _0xba6a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa6ab[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xba6a('0x0'));var emlformat=require(_0xba6a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xba6a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xba6a('0x3'));var moment=require('moment');var BPromise=require(_0xba6a('0x4'));var Mustache=require(_0xba6a('0x5'));var util=require('util');var path=require(_0xba6a('0x6'));var sox=require(_0xba6a('0x7'));var csv=require(_0xba6a('0x8'));var ejs=require(_0xba6a('0x9'));var fs=require('fs');var _=require(_0xba6a('0xa'));var squel=require(_0xba6a('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xba6a('0xc'));var toCsv=require(_0xba6a('0x8'));var querystring=require(_0xba6a('0xd'));var Papa=require('papaparse');var Redis=require(_0xba6a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xba6a('0xf'));var hardwareService=require(_0xba6a('0x10'));var logger=require(_0xba6a('0x11'))('api');var utils=require(_0xba6a('0x12'));var config=require(_0xba6a('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c6474,_0x6e62f4){_0x6e62f4=_0x6e62f4||0xcc;return function(_0x5ac1d7){if(_0x5ac1d7){return _0x5c6474['sendStatus'](_0x6e62f4);}return _0x5c6474['status'](_0x6e62f4)[_0xba6a('0x14')]();};}function respondWithResult(_0x26085b,_0x406fb0){_0x406fb0=_0x406fb0||0xc8;return function(_0x276fd9){if(_0x276fd9){return _0x26085b['status'](_0x406fb0)['json'](_0x276fd9);}};}function respondWithFilteredResult(_0x1d1f14,_0x23f235){return function(_0x3e2111){if(_0x3e2111){var _0x42eaf7=_0x3e2111['count'],_0x282264=_0x23f235['offset'],_0x247815=_0x23f235['offset']+_0x23f235[_0xba6a('0x15')],_0x52d141;if(_0x247815>=_0x42eaf7){_0x247815=_0x42eaf7;_0x52d141=0xc8;}else{_0x52d141=0xce;}_0x1d1f14[_0xba6a('0x16')](_0x52d141);return _0x1d1f14[_0xba6a('0x17')]('Content-Range',_0x282264+'-'+_0x247815+'/'+_0x42eaf7)[_0xba6a('0x18')](_0x3e2111);}return null;};}function patchUpdates(_0x850e90){return function(_0x205f96){try{jsonpatch['apply'](_0x205f96,_0x850e90,!![]);}catch(_0x5ec959){return BPromise[_0xba6a('0x19')](_0x5ec959);}return _0x205f96[_0xba6a('0x1a')]();};}function saveUpdates(_0xd8d2d3,_0x218ead){return function(_0xf92312){if(_0xf92312){return _0xf92312[_0xba6a('0x1b')](_0xd8d2d3)['then'](function(_0x3c2795){return _0x3c2795;});}return null;};}function removeEntity(_0x270c16,_0x28b781){return function(_0x43fcdc){if(_0x43fcdc){return _0x43fcdc[_0xba6a('0x1c')]()[_0xba6a('0x1d')](function(){_0x270c16[_0xba6a('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e464a,_0x10fdf8){return function(_0x213f74){if(!_0x213f74){_0x3e464a['sendStatus'](0x194);}return _0x213f74;};}function handleError(_0x164bcf,_0x39e5a2){_0x39e5a2=_0x39e5a2||0x1f4;return function(_0x56b4ac){logger['error'](_0x56b4ac[_0xba6a('0x1e')]);if(_0x56b4ac[_0xba6a('0x1f')]){delete _0x56b4ac[_0xba6a('0x1f')];}_0x164bcf['status'](_0x39e5a2)[_0xba6a('0x20')](_0x56b4ac);};}exports['index']=function(_0x52eaa3,_0xb910b0){var _0x1c9c3f={},_0x339127={},_0x41c2a0={'count':0x0,'rows':[]};var _0x208ee3=db[_0xba6a('0x21')][_0xba6a('0x22')];_0x339127['model']=_[_0xba6a('0x23')](_0x208ee3);_0x339127[_0xba6a('0x24')]=_[_0xba6a('0x23')](_0x52eaa3['query']);_0x339127[_0xba6a('0x25')]=_[_0xba6a('0x26')](_0x339127[_0xba6a('0x27')],_0x339127[_0xba6a('0x24')]);_0x1c9c3f[_0xba6a('0x28')]=_[_0xba6a('0x26')](_0x339127[_0xba6a('0x27')],qs[_0xba6a('0x29')](_0x52eaa3[_0xba6a('0x24')][_0xba6a('0x29')]));_0x1c9c3f[_0xba6a('0x28')]=_0x1c9c3f[_0xba6a('0x28')]['length']?_0x1c9c3f[_0xba6a('0x28')]:_0x339127['model'];if(!_0x52eaa3['query']['hasOwnProperty']('nolimit')){_0x1c9c3f['limit']=qs[_0xba6a('0x15')](_0x52eaa3[_0xba6a('0x24')][_0xba6a('0x15')]);_0x1c9c3f['offset']=qs[_0xba6a('0x2a')](_0x52eaa3['query'][_0xba6a('0x2a')]);}_0x1c9c3f[_0xba6a('0x2b')]=qs[_0xba6a('0x2c')](_0x52eaa3[_0xba6a('0x24')]['sort']);_0x1c9c3f[_0xba6a('0x2d')]=qs[_0xba6a('0x25')](_[_0xba6a('0x2e')](_0x52eaa3[_0xba6a('0x24')],_0x339127[_0xba6a('0x25')]));if(_0x52eaa3['query']['filter']){_0x1c9c3f['where']=_[_0xba6a('0x2f')](_0x1c9c3f[_0xba6a('0x2d')],{'$or':_[_0xba6a('0x30')](_0x208ee3,function(_0xfdc3d5){if(_0xfdc3d5[_0xba6a('0x31')][_0xba6a('0x32')]!=='VIRTUAL'){var _0x338efb={};_0x338efb[_0xfdc3d5['field']]={'$like':'%'+_0x52eaa3[_0xba6a('0x24')][_0xba6a('0x33')]+'%'};return _0x338efb;}})});}_0x1c9c3f=_[_0xba6a('0x2f')]({},_0x1c9c3f,_0x52eaa3[_0xba6a('0x34')]);var _0x4d9dfe={'where':_0x1c9c3f['where']};return db[_0xba6a('0x21')][_0xba6a('0x35')](_0x4d9dfe)[_0xba6a('0x1d')](function(_0xfc94e4){_0x41c2a0['count']=_0xfc94e4;if(_0x52eaa3[_0xba6a('0x24')]['includeAll']){_0x1c9c3f['include']=[{'attributes':['id',_0xba6a('0x1f'),_0xba6a('0x36'),'alias'],'model':db[_0xba6a('0x37')],'as':_0xba6a('0x37')}];}return db[_0xba6a('0x21')][_0xba6a('0x38')](_0x1c9c3f);})[_0xba6a('0x1d')](function(_0x2adb39){_0x41c2a0[_0xba6a('0x39')]=_0x2adb39;return _0x41c2a0;})[_0xba6a('0x1d')](respondWithFilteredResult(_0xb910b0,_0x1c9c3f))[_0xba6a('0x3a')](handleError(_0xb910b0,null));};exports['show']=function(_0x17dbc0,_0x8d5a7){var _0x45894e={'raw':!![],'where':{'id':_0x17dbc0[_0xba6a('0x3b')]['id']}},_0x398614={};_0x398614[_0xba6a('0x27')]=_['keys'](db[_0xba6a('0x21')][_0xba6a('0x22')]);_0x398614[_0xba6a('0x24')]=_['keys'](_0x17dbc0['query']);_0x398614['filters']=_['intersection'](_0x398614[_0xba6a('0x27')],_0x398614['query']);_0x45894e[_0xba6a('0x28')]=_[_0xba6a('0x26')](_0x398614[_0xba6a('0x27')],qs[_0xba6a('0x29')](_0x17dbc0[_0xba6a('0x24')][_0xba6a('0x29')]));_0x45894e['attributes']=_0x45894e[_0xba6a('0x28')][_0xba6a('0x3c')]?_0x45894e['attributes']:_0x398614[_0xba6a('0x27')];if(_0x17dbc0[_0xba6a('0x24')][_0xba6a('0x3d')]){_0x45894e[_0xba6a('0x3e')]=[{'all':!![]}];}_0x45894e=_[_0xba6a('0x2f')]({},_0x45894e,_0x17dbc0[_0xba6a('0x34')]);return db[_0xba6a('0x21')][_0xba6a('0x3f')](_0x45894e)['then'](handleEntityNotFound(_0x8d5a7,null))[_0xba6a('0x1d')](respondWithResult(_0x8d5a7,null))[_0xba6a('0x3a')](handleError(_0x8d5a7,null));};exports[_0xba6a('0x40')]=function(_0x89906e,_0x38e956){return db['VoiceCallReport'][_0xba6a('0x40')](_0x89906e[_0xba6a('0x41')],{})[_0xba6a('0x1d')](respondWithResult(_0x38e956,0xc9))[_0xba6a('0x3a')](handleError(_0x38e956,null));};exports[_0xba6a('0x1c')]=function(_0x5cde62,_0x341471){return db[_0xba6a('0x21')][_0xba6a('0x3f')]({'where':{'id':_0x5cde62[_0xba6a('0x3b')]['id']}})['then'](handleEntityNotFound(_0x341471,null))[_0xba6a('0x1d')](removeEntity(_0x341471,null))[_0xba6a('0x3a')](handleError(_0x341471,null));};exports[_0xba6a('0x42')]=function(_0x216e4b,_0x173090){return db['VoiceCallReport']['describe']()[_0xba6a('0x1d')](respondWithResult(_0x173090,null))[_0xba6a('0x3a')](handleError(_0x173090,null));};exports[_0xba6a('0x1b')]=function(_0x59724b,_0x1c0410){if(_0x59724b[_0xba6a('0x41')]['uniqueid']){delete _0x59724b[_0xba6a('0x41')][_0xba6a('0x43')];}return db[_0xba6a('0x21')][_0xba6a('0x3f')]({'where':{'uniqueid':_0x59724b[_0xba6a('0x3b')]['id'],'UserId':{'$or':[null,_0x59724b[_0xba6a('0x44')]['id']]}}})[_0xba6a('0x1d')](handleEntityNotFound(_0x1c0410,null))[_0xba6a('0x1d')](saveUpdates(_0x59724b[_0xba6a('0x41')],null))[_0xba6a('0x1d')](respondWithResult(_0x1c0410,null))['catch'](handleError(_0x1c0410,null));}; \ No newline at end of file +var _0x6459=['query','intersection','attributes','fields','length','limit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','alias','User','rows','catch','params','find','create','body','describe','update','uniqueid','user','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','set','Content-Range','apply','reject','destroy','then','error','stack','name','send','VoiceCallReport','rawAttributes','model','keys'];(function(_0x34ba55,_0x4b5c29){var _0x3ee73e=function(_0x450fd6){while(--_0x450fd6){_0x34ba55['push'](_0x34ba55['shift']());}};_0x3ee73e(++_0x4b5c29);}(_0x6459,0x6e));var _0x9645=function(_0x33d5ad,_0x1b7f64){_0x33d5ad=_0x33d5ad-0x0;var _0x36269e=_0x6459[_0x33d5ad];return _0x36269e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9645('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9645('0x1'));var jsonpatch=require(_0x9645('0x2'));var rp=require(_0x9645('0x3'));var moment=require(_0x9645('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9645('0x5'));var util=require(_0x9645('0x6'));var path=require(_0x9645('0x7'));var sox=require(_0x9645('0x8'));var csv=require(_0x9645('0x9'));var ejs=require(_0x9645('0xa'));var fs=require('fs');var _=require(_0x9645('0xb'));var squel=require(_0x9645('0xc'));var crypto=require(_0x9645('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9645('0xe'));var toCsv=require(_0x9645('0x9'));var querystring=require(_0x9645('0xf'));var Papa=require(_0x9645('0x10'));var Redis=require(_0x9645('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9645('0x12'));var hardwareService=require(_0x9645('0x13'));var logger=require(_0x9645('0x14'))(_0x9645('0x15'));var utils=require(_0x9645('0x16'));var config=require(_0x9645('0x17'));var db=require(_0x9645('0x18'))['db'];function respondWithStatusCode(_0x2883df,_0x494e28){_0x494e28=_0x494e28||0xcc;return function(_0x25974a){if(_0x25974a){return _0x2883df[_0x9645('0x19')](_0x494e28);}return _0x2883df['status'](_0x494e28)[_0x9645('0x1a')]();};}function respondWithResult(_0x444f5b,_0x5dc893){_0x5dc893=_0x5dc893||0xc8;return function(_0x1a51cd){if(_0x1a51cd){return _0x444f5b[_0x9645('0x1b')](_0x5dc893)['json'](_0x1a51cd);}};}function respondWithFilteredResult(_0x373123,_0x3506ee){return function(_0x54de39){if(_0x54de39){var _0x5d73fd=_0x54de39[_0x9645('0x1c')],_0x26c3ea=_0x3506ee[_0x9645('0x1d')],_0x556641=_0x3506ee[_0x9645('0x1d')]+_0x3506ee['limit'],_0x374354;if(_0x556641>=_0x5d73fd){_0x556641=_0x5d73fd;_0x374354=0xc8;}else{_0x374354=0xce;}_0x373123[_0x9645('0x1b')](_0x374354);return _0x373123[_0x9645('0x1e')](_0x9645('0x1f'),_0x26c3ea+'-'+_0x556641+'/'+_0x5d73fd)['json'](_0x54de39);}return null;};}function patchUpdates(_0x57baa4){return function(_0x1b4d98){try{jsonpatch[_0x9645('0x20')](_0x1b4d98,_0x57baa4,!![]);}catch(_0x5306df){return BPromise[_0x9645('0x21')](_0x5306df);}return _0x1b4d98['save']();};}function saveUpdates(_0x3d0b62,_0x3714a1){return function(_0x17cfa6){if(_0x17cfa6){return _0x17cfa6['update'](_0x3d0b62)['then'](function(_0x3b01c4){return _0x3b01c4;});}return null;};}function removeEntity(_0x49e097,_0x325903){return function(_0x3bfeea){if(_0x3bfeea){return _0x3bfeea[_0x9645('0x22')]()[_0x9645('0x23')](function(){_0x49e097[_0x9645('0x1b')](0xcc)[_0x9645('0x1a')]();});}};}function handleEntityNotFound(_0x2b0104,_0x5aee74){return function(_0x109d11){if(!_0x109d11){_0x2b0104[_0x9645('0x19')](0x194);}return _0x109d11;};}function handleError(_0x40b5a3,_0x39a1af){_0x39a1af=_0x39a1af||0x1f4;return function(_0x10eff7){logger[_0x9645('0x24')](_0x10eff7[_0x9645('0x25')]);if(_0x10eff7['name']){delete _0x10eff7[_0x9645('0x26')];}_0x40b5a3[_0x9645('0x1b')](_0x39a1af)[_0x9645('0x27')](_0x10eff7);};}exports['index']=function(_0x3486f6,_0x5005fd){var _0x124c30={},_0x39dea4={},_0x2f696b={'count':0x0,'rows':[]};var _0x1ca23b=db[_0x9645('0x28')][_0x9645('0x29')];_0x39dea4[_0x9645('0x2a')]=_[_0x9645('0x2b')](_0x1ca23b);_0x39dea4['query']=_[_0x9645('0x2b')](_0x3486f6[_0x9645('0x2c')]);_0x39dea4['filters']=_[_0x9645('0x2d')](_0x39dea4[_0x9645('0x2a')],_0x39dea4[_0x9645('0x2c')]);_0x124c30[_0x9645('0x2e')]=_[_0x9645('0x2d')](_0x39dea4[_0x9645('0x2a')],qs[_0x9645('0x2f')](_0x3486f6[_0x9645('0x2c')]['fields']));_0x124c30['attributes']=_0x124c30[_0x9645('0x2e')][_0x9645('0x30')]?_0x124c30[_0x9645('0x2e')]:_0x39dea4[_0x9645('0x2a')];if(!_0x3486f6['query']['hasOwnProperty']('nolimit')){_0x124c30[_0x9645('0x31')]=qs[_0x9645('0x31')](_0x3486f6[_0x9645('0x2c')][_0x9645('0x31')]);_0x124c30[_0x9645('0x1d')]=qs[_0x9645('0x1d')](_0x3486f6[_0x9645('0x2c')]['offset']);}_0x124c30[_0x9645('0x32')]=qs[_0x9645('0x33')](_0x3486f6[_0x9645('0x2c')][_0x9645('0x33')]);_0x124c30[_0x9645('0x34')]=qs[_0x9645('0x35')](_[_0x9645('0x36')](_0x3486f6[_0x9645('0x2c')],_0x39dea4[_0x9645('0x35')]));if(_0x3486f6['query'][_0x9645('0x37')]){_0x124c30['where']=_[_0x9645('0x38')](_0x124c30[_0x9645('0x34')],{'$or':_[_0x9645('0x39')](_0x1ca23b,function(_0x3ab31f){if(_0x3ab31f[_0x9645('0x3a')][_0x9645('0x3b')]!==_0x9645('0x3c')){var _0xb56bf7={};_0xb56bf7[_0x3ab31f[_0x9645('0x3d')]]={'$like':'%'+_0x3486f6[_0x9645('0x2c')][_0x9645('0x37')]+'%'};return _0xb56bf7;}})});}_0x124c30=_[_0x9645('0x38')]({},_0x124c30,_0x3486f6[_0x9645('0x3e')]);var _0x40473a={'where':_0x124c30[_0x9645('0x34')]};return db[_0x9645('0x28')][_0x9645('0x1c')](_0x40473a)[_0x9645('0x23')](function(_0x43e7fe){_0x2f696b[_0x9645('0x1c')]=_0x43e7fe;if(_0x3486f6[_0x9645('0x2c')][_0x9645('0x3f')]){_0x124c30[_0x9645('0x40')]=[{'attributes':['id',_0x9645('0x26'),'fullname',_0x9645('0x41')],'model':db[_0x9645('0x42')],'as':_0x9645('0x42')}];}return db[_0x9645('0x28')]['findAll'](_0x124c30);})[_0x9645('0x23')](function(_0x15cd24){_0x2f696b[_0x9645('0x43')]=_0x15cd24;return _0x2f696b;})['then'](respondWithFilteredResult(_0x5005fd,_0x124c30))[_0x9645('0x44')](handleError(_0x5005fd,null));};exports['show']=function(_0x269bb3,_0x4ea107){var _0x3ba38a={'raw':!![],'where':{'id':_0x269bb3[_0x9645('0x45')]['id']}},_0x4ba947={};_0x4ba947[_0x9645('0x2a')]=_[_0x9645('0x2b')](db['VoiceCallReport'][_0x9645('0x29')]);_0x4ba947['query']=_['keys'](_0x269bb3[_0x9645('0x2c')]);_0x4ba947[_0x9645('0x35')]=_[_0x9645('0x2d')](_0x4ba947[_0x9645('0x2a')],_0x4ba947['query']);_0x3ba38a['attributes']=_[_0x9645('0x2d')](_0x4ba947['model'],qs['fields'](_0x269bb3[_0x9645('0x2c')][_0x9645('0x2f')]));_0x3ba38a[_0x9645('0x2e')]=_0x3ba38a[_0x9645('0x2e')][_0x9645('0x30')]?_0x3ba38a[_0x9645('0x2e')]:_0x4ba947[_0x9645('0x2a')];if(_0x269bb3[_0x9645('0x2c')][_0x9645('0x3f')]){_0x3ba38a['include']=[{'all':!![]}];}_0x3ba38a=_[_0x9645('0x38')]({},_0x3ba38a,_0x269bb3[_0x9645('0x3e')]);return db['VoiceCallReport'][_0x9645('0x46')](_0x3ba38a)['then'](handleEntityNotFound(_0x4ea107,null))[_0x9645('0x23')](respondWithResult(_0x4ea107,null))[_0x9645('0x44')](handleError(_0x4ea107,null));};exports['create']=function(_0x2072c2,_0xd70af0){return db['VoiceCallReport'][_0x9645('0x47')](_0x2072c2[_0x9645('0x48')],{})[_0x9645('0x23')](respondWithResult(_0xd70af0,0xc9))['catch'](handleError(_0xd70af0,null));};exports[_0x9645('0x22')]=function(_0x54f040,_0x2376f4){return db['VoiceCallReport'][_0x9645('0x46')]({'where':{'id':_0x54f040['params']['id']}})[_0x9645('0x23')](handleEntityNotFound(_0x2376f4,null))[_0x9645('0x23')](removeEntity(_0x2376f4,null))[_0x9645('0x44')](handleError(_0x2376f4,null));};exports[_0x9645('0x49')]=function(_0x153c77,_0x2adefb){return db[_0x9645('0x28')][_0x9645('0x49')]()[_0x9645('0x23')](respondWithResult(_0x2adefb,null))[_0x9645('0x44')](handleError(_0x2adefb,null));};exports[_0x9645('0x4a')]=function(_0x9475a6,_0x28bb7d){if(_0x9475a6[_0x9645('0x48')][_0x9645('0x4b')]){delete _0x9475a6[_0x9645('0x48')][_0x9645('0x4b')];}return db[_0x9645('0x28')][_0x9645('0x46')]({'where':{'uniqueid':_0x9475a6['params']['id'],'UserId':{'$or':[null,_0x9475a6[_0x9645('0x4c')]['id']]}}})['then'](handleEntityNotFound(_0x28bb7d,null))[_0x9645('0x23')](saveUpdates(_0x9475a6[_0x9645('0x48')],null))['then'](respondWithResult(_0x28bb7d,null))[_0x9645('0x44')](handleError(_0x28bb7d,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 807c8db..4b86f06 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 _0x8df7=['bluebird','request-promise','path','../../config/environment','./voiceCallReport.attributes','exports','define','report_call','lodash','util','../../config/logger','moment'];(function(_0x2e84f1,_0x404fb6){var _0x24abc2=function(_0x57fe1c){while(--_0x57fe1c){_0x2e84f1['push'](_0x2e84f1['shift']());}};_0x24abc2(++_0x404fb6);}(_0x8df7,0xa4));var _0x78df=function(_0xefac2a,_0x599961){_0xefac2a=_0xefac2a-0x0;var _0x47e602=_0x8df7[_0xefac2a];return _0x47e602;};'use strict';var _=require(_0x78df('0x0'));var util=require(_0x78df('0x1'));var logger=require(_0x78df('0x2'))('api');var moment=require(_0x78df('0x3'));var BPromise=require(_0x78df('0x4'));var rp=require(_0x78df('0x5'));var fs=require('fs');var path=require(_0x78df('0x6'));var rimraf=require('rimraf');var config=require(_0x78df('0x7'));var attributes=require(_0x78df('0x8'));module[_0x78df('0x9')]=function(_0x243dbb,_0x2d147d){return _0x243dbb[_0x78df('0xa')]('VoiceCallReport',attributes,{'tableName':_0x78df('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x468b=['../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2cfa08,_0x23a555){var _0x528029=function(_0x119fbf){while(--_0x119fbf){_0x2cfa08['push'](_0x2cfa08['shift']());}};_0x528029(++_0x23a555);}(_0x468b,0x117));var _0xb468=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x468b[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xb468('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb468('0x1'));var moment=require(_0xb468('0x2'));var BPromise=require(_0xb468('0x3'));var rp=require(_0xb468('0x4'));var fs=require('fs');var path=require(_0xb468('0x5'));var rimraf=require(_0xb468('0x6'));var config=require(_0xb468('0x7'));var attributes=require(_0xb468('0x8'));module[_0xb468('0x9')]=function(_0x5abefd,_0x54cb13){return _0x5abefd[_0xb468('0xa')](_0xb468('0xb'),attributes,{'tableName':_0xb468('0xc'),'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 8cc0092..0085acb 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 _0x69ea=['create','body','update','where','UpdateVoiceCallReport','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','code','message','error','info','VoiceCallReport','findAll','options','raw','attributes','limit','include','map','model','GetVoiceCallReport','stringify','catch','CreateVoiceCallReport'];(function(_0x1ba024,_0x56ea6b){var _0x107d32=function(_0x4bcc21){while(--_0x4bcc21){_0x1ba024['push'](_0x1ba024['shift']());}};_0x107d32(++_0x56ea6b);}(_0x69ea,0x10f));var _0xa69e=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x69ea[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xa69e('0x0'));var util=require('util');var moment=require(_0xa69e('0x1'));var BPromise=require(_0xa69e('0x2'));var rs=require(_0xa69e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa69e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa69e('0x5'))(_0xa69e('0x6'));var config=require('../../config/environment');var jayson=require(_0xa69e('0x7'));var client=jayson[_0xa69e('0x8')][_0xa69e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x61a9f7,_0x26ef6d,_0x34b967){return new BPromise(function(_0x3e5310,_0x1c75eb){return client[_0xa69e('0xa')](_0x61a9f7,_0x34b967)[_0xa69e('0xb')](function(_0x462e9f){logger['info'](_0xa69e('0xc'),_0x26ef6d,_0xa69e('0xd'));logger[_0xa69e('0xe')](_0xa69e('0xf'),_0x26ef6d,_0xa69e('0xd'),JSON['stringify'](_0x462e9f));if(_0x462e9f['error']){if(_0x462e9f['error'][_0xa69e('0x10')]===0x1f4){logger['error'](_0xa69e('0xc'),_0x26ef6d,_0x462e9f['error'][_0xa69e('0x11')]);return _0x1c75eb(_0x462e9f[_0xa69e('0x12')][_0xa69e('0x11')]);}logger[_0xa69e('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x26ef6d,_0x462e9f['error'][_0xa69e('0x11')]);return _0x3e5310(_0x462e9f[_0xa69e('0x12')]['message']);}else{logger[_0xa69e('0x13')](_0xa69e('0xc'),_0x26ef6d,_0xa69e('0xd'));_0x3e5310(_0x462e9f['result'][_0xa69e('0x11')]);}})['catch'](function(_0x33b2ef){logger[_0xa69e('0x12')](_0xa69e('0xc'),_0x26ef6d,_0x33b2ef);_0x1c75eb(_0x33b2ef);});});}exports['GetVoiceCallReport']=function(_0x5eb7fb){var _0x5b1b76=this;return new Promise(function(_0x1e01b2,_0x1e9512){return db[_0xa69e('0x14')][_0xa69e('0x15')]({'raw':_0x5eb7fb[_0xa69e('0x16')]?_0x5eb7fb[_0xa69e('0x16')][_0xa69e('0x17')]===undefined?!![]:![]:!![],'where':_0x5eb7fb[_0xa69e('0x16')]?_0x5eb7fb['options']['where']||null:null,'attributes':_0x5eb7fb['options']?_0x5eb7fb[_0xa69e('0x16')][_0xa69e('0x18')]||null:null,'limit':_0x5eb7fb[_0xa69e('0x16')]?_0x5eb7fb[_0xa69e('0x16')][_0xa69e('0x19')]||null:null,'include':_0x5eb7fb[_0xa69e('0x16')]?_0x5eb7fb[_0xa69e('0x16')][_0xa69e('0x1a')]?_[_0xa69e('0x1b')](_0x5eb7fb[_0xa69e('0x16')][_0xa69e('0x1a')],function(_0x7cc4b8){return{'model':db[_0x7cc4b8['model']],'as':_0x7cc4b8['as'],'attributes':_0x7cc4b8[_0xa69e('0x18')],'include':_0x7cc4b8['include']?_[_0xa69e('0x1b')](_0x7cc4b8[_0xa69e('0x1a')],function(_0x6c4a42){return{'model':db[_0x6c4a42[_0xa69e('0x1c')]],'as':_0x6c4a42['as'],'attributes':_0x6c4a42[_0xa69e('0x18')],'include':_0x6c4a42['include']?_[_0xa69e('0x1b')](_0x6c4a42[_0xa69e('0x1a')],function(_0x2262b0){return{'model':db[_0x2262b0[_0xa69e('0x1c')]],'as':_0x2262b0['as'],'attributes':_0x2262b0[_0xa69e('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3df074){logger[_0xa69e('0x13')]('GetVoiceCallReport',_0x5eb7fb);logger[_0xa69e('0xe')](_0xa69e('0x1d'),_0x5eb7fb,JSON[_0xa69e('0x1e')](_0x3df074));_0x1e01b2(_0x3df074);})[_0xa69e('0x1f')](function(_0x69bb5c){logger[_0xa69e('0x12')](_0xa69e('0x1d'),_0x69bb5c[_0xa69e('0x11')],_0x5eb7fb);_0x1e9512(_0x5b1b76['error'](0x1f4,_0x69bb5c[_0xa69e('0x11')]));});});};exports[_0xa69e('0x20')]=function(_0x302a98){var _0x38f6b9=this;return new Promise(function(_0x15fa3d,_0x4cf9f7){return db[_0xa69e('0x14')][_0xa69e('0x21')](_0x302a98[_0xa69e('0x22')],{'raw':_0x302a98[_0xa69e('0x16')]?_0x302a98[_0xa69e('0x16')][_0xa69e('0x17')]===undefined?!![]:![]:!![]})[_0xa69e('0xb')](function(_0x23a851){logger[_0xa69e('0x13')]('CreateVoiceCallReport',_0x302a98);logger['debug'](_0xa69e('0x20'),_0x302a98,JSON[_0xa69e('0x1e')](_0x23a851));_0x15fa3d(_0x23a851);})['catch'](function(_0x24582e){logger[_0xa69e('0x12')](_0xa69e('0x20'),_0x24582e['message'],_0x302a98);_0x4cf9f7(_0x38f6b9[_0xa69e('0x12')](0x1f4,_0x24582e[_0xa69e('0x11')]));});});};exports['UpdateVoiceCallReport']=function(_0x5995c3){var _0x41b703=this;return new Promise(function(_0x3770be,_0x3b5405){return db[_0xa69e('0x14')][_0xa69e('0x23')](_0x5995c3[_0xa69e('0x22')],{'raw':_0x5995c3['options']?_0x5995c3[_0xa69e('0x16')][_0xa69e('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5995c3[_0xa69e('0x16')]?_0x5995c3[_0xa69e('0x16')][_0xa69e('0x24')]||null:null,'attributes':_0x5995c3[_0xa69e('0x16')]?_0x5995c3['options']['attributes']||null:null,'limit':_0x5995c3['options']?_0x5995c3[_0xa69e('0x16')][_0xa69e('0x19')]||null:null})[_0xa69e('0xb')](function(_0x2f9579){logger['info']('UpdateVoiceCallReport',_0x5995c3);logger['debug']('UpdateVoiceCallReport',_0x5995c3,JSON[_0xa69e('0x1e')](_0x2f9579));_0x3770be(_0x2f9579);})[_0xa69e('0x1f')](function(_0xc40f35){logger['error'](_0xa69e('0x25'),_0xc40f35[_0xa69e('0x11')],_0x5995c3);_0x3b5405(_0x41b703['error'](0x1f4,_0xc40f35[_0xa69e('0x11')]));});});}; \ No newline at end of file +var _0x4f3a=['moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceCallReport','findAll','options','raw','where','attributes','include','model','map','then','CreateVoiceCallReport','VoiceCallReport','create','body','UpdateVoiceCallReport','update','limit','util'];(function(_0x558f3b,_0x51b08d){var _0x38b565=function(_0x4454b6){while(--_0x4454b6){_0x558f3b['push'](_0x558f3b['shift']());}};_0x38b565(++_0x51b08d);}(_0x4f3a,0x6e));var _0xa4f3=function(_0x185d2a,_0x308609){_0x185d2a=_0x185d2a-0x0;var _0x4dea27=_0x4f3a[_0x185d2a];return _0x4dea27;};'use strict';var _=require('lodash');var util=require(_0xa4f3('0x0'));var moment=require(_0xa4f3('0x1'));var BPromise=require(_0xa4f3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa4f3('0x3'))['db'];var utils=require(_0xa4f3('0x4'));var logger=require('../../config/logger')(_0xa4f3('0x5'));var config=require(_0xa4f3('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa4f3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x42633c,_0x1d2fe7,_0x5a92ec){return new BPromise(function(_0x139873,_0x1a797f){return client[_0xa4f3('0x8')](_0x42633c,_0x5a92ec)['then'](function(_0xe379b1){logger['info'](_0xa4f3('0x9'),_0x1d2fe7,_0xa4f3('0xa'));logger[_0xa4f3('0xb')](_0xa4f3('0xc'),_0x1d2fe7,'request\x20sent',JSON[_0xa4f3('0xd')](_0xe379b1));if(_0xe379b1[_0xa4f3('0xe')]){if(_0xe379b1['error'][_0xa4f3('0xf')]===0x1f4){logger[_0xa4f3('0xe')](_0xa4f3('0x9'),_0x1d2fe7,_0xe379b1[_0xa4f3('0xe')][_0xa4f3('0x10')]);return _0x1a797f(_0xe379b1[_0xa4f3('0xe')]['message']);}logger['error'](_0xa4f3('0x9'),_0x1d2fe7,_0xe379b1[_0xa4f3('0xe')][_0xa4f3('0x10')]);return _0x139873(_0xe379b1[_0xa4f3('0xe')][_0xa4f3('0x10')]);}else{logger[_0xa4f3('0x11')](_0xa4f3('0x9'),_0x1d2fe7,_0xa4f3('0xa'));_0x139873(_0xe379b1[_0xa4f3('0x12')][_0xa4f3('0x10')]);}})[_0xa4f3('0x13')](function(_0x473d9e){logger['error'](_0xa4f3('0x9'),_0x1d2fe7,_0x473d9e);_0x1a797f(_0x473d9e);});});}exports[_0xa4f3('0x14')]=function(_0x4232c1){var _0x51ea72=this;return new Promise(function(_0x40a6e9,_0x35ff64){return db['VoiceCallReport'][_0xa4f3('0x15')]({'raw':_0x4232c1[_0xa4f3('0x16')]?_0x4232c1['options'][_0xa4f3('0x17')]===undefined?!![]:![]:!![],'where':_0x4232c1[_0xa4f3('0x16')]?_0x4232c1['options'][_0xa4f3('0x18')]||null:null,'attributes':_0x4232c1['options']?_0x4232c1['options'][_0xa4f3('0x19')]||null:null,'limit':_0x4232c1[_0xa4f3('0x16')]?_0x4232c1[_0xa4f3('0x16')]['limit']||null:null,'include':_0x4232c1['options']?_0x4232c1['options'][_0xa4f3('0x1a')]?_['map'](_0x4232c1[_0xa4f3('0x16')][_0xa4f3('0x1a')],function(_0x3d16ad){return{'model':db[_0x3d16ad[_0xa4f3('0x1b')]],'as':_0x3d16ad['as'],'attributes':_0x3d16ad['attributes'],'include':_0x3d16ad['include']?_[_0xa4f3('0x1c')](_0x3d16ad[_0xa4f3('0x1a')],function(_0x3cff6b){return{'model':db[_0x3cff6b['model']],'as':_0x3cff6b['as'],'attributes':_0x3cff6b[_0xa4f3('0x19')],'include':_0x3cff6b[_0xa4f3('0x1a')]?_['map'](_0x3cff6b['include'],function(_0x47a43f){return{'model':db[_0x47a43f[_0xa4f3('0x1b')]],'as':_0x47a43f['as'],'attributes':_0x47a43f['attributes']};}):[]};}):[]};}):[]:[]})[_0xa4f3('0x1d')](function(_0xc28a50){logger['info'](_0xa4f3('0x14'),_0x4232c1);logger[_0xa4f3('0xb')](_0xa4f3('0x14'),_0x4232c1,JSON[_0xa4f3('0xd')](_0xc28a50));_0x40a6e9(_0xc28a50);})[_0xa4f3('0x13')](function(_0x36d7aa){logger['error']('GetVoiceCallReport',_0x36d7aa[_0xa4f3('0x10')],_0x4232c1);_0x35ff64(_0x51ea72[_0xa4f3('0xe')](0x1f4,_0x36d7aa[_0xa4f3('0x10')]));});});};exports[_0xa4f3('0x1e')]=function(_0x31ca19){var _0x478bfd=this;return new Promise(function(_0x4a0eca,_0x1abc2e){return db[_0xa4f3('0x1f')][_0xa4f3('0x20')](_0x31ca19[_0xa4f3('0x21')],{'raw':_0x31ca19['options']?_0x31ca19[_0xa4f3('0x16')][_0xa4f3('0x17')]===undefined?!![]:![]:!![]})[_0xa4f3('0x1d')](function(_0x508a48){logger[_0xa4f3('0x11')](_0xa4f3('0x1e'),_0x31ca19);logger[_0xa4f3('0xb')](_0xa4f3('0x1e'),_0x31ca19,JSON[_0xa4f3('0xd')](_0x508a48));_0x4a0eca(_0x508a48);})[_0xa4f3('0x13')](function(_0xbafdd8){logger[_0xa4f3('0xe')](_0xa4f3('0x1e'),_0xbafdd8['message'],_0x31ca19);_0x1abc2e(_0x478bfd[_0xa4f3('0xe')](0x1f4,_0xbafdd8[_0xa4f3('0x10')]));});});};exports[_0xa4f3('0x22')]=function(_0x4b89ca){var _0x4ba2cb=this;return new Promise(function(_0x5567f5,_0x1eb588){return db[_0xa4f3('0x1f')][_0xa4f3('0x23')](_0x4b89ca[_0xa4f3('0x21')],{'raw':_0x4b89ca[_0xa4f3('0x16')]?_0x4b89ca[_0xa4f3('0x16')][_0xa4f3('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b89ca['options']?_0x4b89ca[_0xa4f3('0x16')][_0xa4f3('0x18')]||null:null,'attributes':_0x4b89ca[_0xa4f3('0x16')]?_0x4b89ca['options'][_0xa4f3('0x19')]||null:null,'limit':_0x4b89ca[_0xa4f3('0x16')]?_0x4b89ca['options'][_0xa4f3('0x24')]||null:null})[_0xa4f3('0x1d')](function(_0x5970c5){logger[_0xa4f3('0x11')](_0xa4f3('0x22'),_0x4b89ca);logger[_0xa4f3('0xb')](_0xa4f3('0x22'),_0x4b89ca,JSON['stringify'](_0x5970c5));_0x5567f5(_0x5970c5);})['catch'](function(_0x4b0777){logger[_0xa4f3('0xe')]('UpdateVoiceCallReport',_0x4b0777[_0xa4f3('0x10')],_0x4b89ca);_0x1eb588(_0x4ba2cb[_0xa4f3('0xe')](0x1f4,_0x4b0777[_0xa4f3('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 6aec5a2..b0c9184 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 _0x46af=['../../components/interaction/service','get','/:id','show','post','isAuthenticated','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0x46af,0x11a));var _0xf46a=function(_0x228c47,_0x330805){_0x228c47=_0x228c47-0x0;var _0x44ac67=_0x46af[_0x228c47];return _0x44ac67;};'use strict';var multer=require(_0xf46a('0x0'));var util=require(_0xf46a('0x1'));var path=require('path');var timeout=require(_0xf46a('0x2'));var express=require(_0xf46a('0x3'));var router=express[_0xf46a('0x4')]();var auth=require(_0xf46a('0x5'));var interaction=require(_0xf46a('0x6'));var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0xf46a('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf46a('0x7')](_0xf46a('0x8'),auth['isAuthenticated'](),controller[_0xf46a('0x9')]);router[_0xf46a('0xa')]('/',auth[_0xf46a('0xb')](),controller['create']);router[_0xf46a('0xc')](_0xf46a('0x8'),auth[_0xf46a('0xb')](),controller[_0xf46a('0xd')]);router[_0xf46a('0xe')](_0xf46a('0x8'),auth[_0xf46a('0xb')](),controller['destroy']);module[_0xf46a('0xf')]=router; \ No newline at end of file +var _0x3fb5=['post','create','put','multer','util','path','express','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','get','/:id','show'];(function(_0x81e6e2,_0x3565ca){var _0x56bb71=function(_0x49c2b7){while(--_0x49c2b7){_0x81e6e2['push'](_0x81e6e2['shift']());}};_0x56bb71(++_0x3565ca);}(_0x3fb5,0x73));var _0x53fb=function(_0x2b859f,_0x259e16){_0x2b859f=_0x2b859f-0x0;var _0x3ccf60=_0x3fb5[_0x2b859f];return _0x3ccf60;};'use strict';var multer=require(_0x53fb('0x0'));var util=require(_0x53fb('0x1'));var path=require(_0x53fb('0x2'));var timeout=require('connect-timeout');var express=require(_0x53fb('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x53fb('0x4'));var config=require(_0x53fb('0x5'));var controller=require(_0x53fb('0x6'));router['get']('/',auth[_0x53fb('0x7')](),controller['index']);router[_0x53fb('0x8')](_0x53fb('0x9'),auth['isAuthenticated'](),controller[_0x53fb('0xa')]);router[_0x53fb('0xb')]('/',auth[_0x53fb('0x7')](),controller[_0x53fb('0xc')]);router[_0x53fb('0xd')]('/:id',auth[_0x53fb('0x7')](),controller['update']);router['delete'](_0x53fb('0x9'),auth[_0x53fb('0x7')](),controller['destroy']);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 8bc9460..804c719 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 _0x5146=['STRING','join','getDataValue','options','BOOLEAN','sequelize','exports'];(function(_0x26d15c,_0x42ba47){var _0x12fc9c=function(_0x1f341b){while(--_0x1f341b){_0x26d15c['push'](_0x26d15c['shift']());}};_0x12fc9c(++_0x42ba47);}(_0x5146,0xc9));var _0x6514=function(_0x470ea2,_0x3dea8b){_0x470ea2=_0x470ea2-0x0;var _0x3ae848=_0x5146[_0x470ea2];return _0x3ae848;};'use strict';var Sequelize=require(_0x6514('0x0'));module[_0x6514('0x1')]={'name':{'type':Sequelize[_0x6514('0x2')]},'prefix':{'type':Sequelize[_0x6514('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x6514('0x2')],'set':function(_0x225d52){this['setDataValue']('options',_0x225d52?_0x225d52[_0x6514('0x3')](''):[]);},'get':function(){return this[_0x6514('0x4')](_0x6514('0x5'))?this['getDataValue']('options')['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x6514('0x2')]},'record':{'type':Sequelize[_0x6514('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x6514('0x2')]},'description':{'type':Sequelize[_0x6514('0x2')]}}; \ No newline at end of file +var _0x91e4=['getDataValue','options','BOOLEAN','exports','STRING','name','join'];(function(_0xd2b76f,_0x339398){var _0xf277f4=function(_0x144974){while(--_0x144974){_0xd2b76f['push'](_0xd2b76f['shift']());}};_0xf277f4(++_0x339398);}(_0x91e4,0x1d8));var _0x491e=function(_0x1b8adf,_0x3e3765){_0x1b8adf=_0x1b8adf-0x0;var _0x4f476e=_0x91e4[_0x1b8adf];return _0x4f476e;};'use strict';var Sequelize=require('sequelize');module[_0x491e('0x0')]={'name':{'type':Sequelize[_0x491e('0x1')]},'prefix':{'type':Sequelize[_0x491e('0x1')],'unique':_0x491e('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x44c3a3){this['setDataValue']('options',_0x44c3a3?_0x44c3a3[_0x491e('0x3')](''):[]);},'get':function(){return this[_0x491e('0x4')]('options')?this[_0x491e('0x4')](_0x491e('0x5'))['split'](''):[];}},'auth':{'type':Sequelize[_0x491e('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0x491e('0x1')]},'record':{'type':Sequelize[_0x491e('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x491e('0x1')]},'description':{'type':Sequelize[_0x491e('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index cba9223..397751a 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 _0x1688=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','apply','reject','save','then','ChanSpies','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','key','VIRTUAL','filter','VoiceChanSpy','includeAll','include','findAll','rows','catch','length','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','update','params','html-pdf','eml-format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1688,0xee));var _0x8168=function(_0x5b8c9a,_0x479deb){_0x5b8c9a=_0x5b8c9a-0x0;var _0x32786f=_0x1688[_0x5b8c9a];return _0x32786f;};'use strict';var pdf=require(_0x8168('0x0'));var emlformat=require(_0x8168('0x1'));var rimraf=require(_0x8168('0x2'));var zipdir=require(_0x8168('0x3'));var jsonpatch=require(_0x8168('0x4'));var rp=require(_0x8168('0x5'));var moment=require('moment');var BPromise=require(_0x8168('0x6'));var Mustache=require('mustache');var util=require(_0x8168('0x7'));var path=require(_0x8168('0x8'));var sox=require(_0x8168('0x9'));var csv=require('to-csv');var ejs=require(_0x8168('0xa'));var fs=require('fs');var _=require(_0x8168('0xb'));var squel=require(_0x8168('0xc'));var crypto=require(_0x8168('0xd'));var jsforce=require(_0x8168('0xe'));var deskjs=require(_0x8168('0xf'));var toCsv=require(_0x8168('0x10'));var querystring=require(_0x8168('0x11'));var Papa=require(_0x8168('0x12'));var Redis=require(_0x8168('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8168('0x14'));var logger=require(_0x8168('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x8168('0x16'));var db=require(_0x8168('0x17'))['db'];function respondWithStatusCode(_0x406990,_0x37e597){_0x37e597=_0x37e597||0xcc;return function(_0x5327cc){if(_0x5327cc){return _0x406990['sendStatus'](_0x37e597);}return _0x406990['status'](_0x37e597)['end']();};}function respondWithResult(_0x269869,_0x530c1c){_0x530c1c=_0x530c1c||0xc8;return function(_0x383acc){if(_0x383acc){return _0x269869[_0x8168('0x18')](_0x530c1c)[_0x8168('0x19')](_0x383acc);}};}function respondWithFilteredResult(_0x51f060,_0x45c2d4){return function(_0x25991f){if(_0x25991f){var _0x59e4a0=_0x25991f[_0x8168('0x1a')],_0x1ac44=_0x45c2d4[_0x8168('0x1b')],_0x4af170=_0x45c2d4[_0x8168('0x1b')]+_0x45c2d4[_0x8168('0x1c')],_0x126707;if(_0x4af170>=_0x59e4a0){_0x4af170=_0x59e4a0;_0x126707=0xc8;}else{_0x126707=0xce;}_0x51f060[_0x8168('0x18')](_0x126707);return _0x51f060[_0x8168('0x1d')]('Content-Range',_0x1ac44+'-'+_0x4af170+'/'+_0x59e4a0)[_0x8168('0x19')](_0x25991f);}return null;};}function patchUpdates(_0x5cb3af){return function(_0x3646c3){try{jsonpatch[_0x8168('0x1e')](_0x3646c3,_0x5cb3af,!![]);}catch(_0x11cdcc){return BPromise[_0x8168('0x1f')](_0x11cdcc);}return _0x3646c3[_0x8168('0x20')]();};}function saveUpdates(_0x53e7d0,_0x4236c0){return function(_0x116ae4){if(_0x116ae4){return _0x116ae4['update'](_0x53e7d0)[_0x8168('0x21')](function(_0x2ea97e){return _0x2ea97e;});}return null;};}function removeEntity(_0xbe67f5,_0x25de9f){return function(_0x5e8cc6){if(_0x5e8cc6){return _0x5e8cc6['destroy']()[_0x8168('0x21')](function(){var _0x52eb9d=_0x5e8cc6['get']({'plain':!![]});var _0x36afb6=_0x8168('0x22');return db[_0x8168('0x23')][_0x8168('0x24')]({'where':{'type':_0x36afb6,'resourceId':_0x52eb9d['id']}})[_0x8168('0x21')](function(){return _0x5e8cc6;});})[_0x8168('0x21')](function(){_0xbe67f5[_0x8168('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a1378,_0xddcacd){return function(_0x484312){if(!_0x484312){_0x4a1378[_0x8168('0x25')](0x194);}return _0x484312;};}function handleError(_0x2413c7,_0x424b53){_0x424b53=_0x424b53||0x1f4;return function(_0x5e5d7c){logger[_0x8168('0x26')](_0x5e5d7c[_0x8168('0x27')]);if(_0x5e5d7c[_0x8168('0x28')]){delete _0x5e5d7c[_0x8168('0x28')];}_0x2413c7[_0x8168('0x18')](_0x424b53)[_0x8168('0x29')](_0x5e5d7c);};}exports[_0x8168('0x2a')]=function(_0x425902,_0x2c134e){var _0x4db55a={},_0x25415e={},_0x4b680f={'count':0x0,'rows':[]};var _0x55458c=db['VoiceChanSpy'][_0x8168('0x2b')];_0x25415e[_0x8168('0x2c')]=_[_0x8168('0x2d')](_0x55458c);_0x25415e[_0x8168('0x2e')]=_[_0x8168('0x2d')](_0x425902['query']);_0x25415e[_0x8168('0x2f')]=_[_0x8168('0x30')](_0x25415e['model'],_0x25415e[_0x8168('0x2e')]);_0x4db55a[_0x8168('0x31')]=_[_0x8168('0x30')](_0x25415e['model'],qs['fields'](_0x425902[_0x8168('0x2e')][_0x8168('0x32')]));_0x4db55a[_0x8168('0x31')]=_0x4db55a[_0x8168('0x31')]['length']?_0x4db55a[_0x8168('0x31')]:_0x25415e[_0x8168('0x2c')];if(!_0x425902[_0x8168('0x2e')][_0x8168('0x33')](_0x8168('0x34'))){_0x4db55a[_0x8168('0x1c')]=qs['limit'](_0x425902[_0x8168('0x2e')][_0x8168('0x1c')]);_0x4db55a[_0x8168('0x1b')]=qs[_0x8168('0x1b')](_0x425902[_0x8168('0x2e')]['offset']);}_0x4db55a[_0x8168('0x35')]=qs[_0x8168('0x36')](_0x425902[_0x8168('0x2e')][_0x8168('0x36')]);_0x4db55a[_0x8168('0x37')]=qs['filters'](_[_0x8168('0x38')](_0x425902[_0x8168('0x2e')],_0x25415e[_0x8168('0x2f')]));if(_0x425902['query']['filter']){_0x4db55a[_0x8168('0x37')]=_[_0x8168('0x39')](_0x4db55a['where'],{'$or':_[_0x8168('0x3a')](_0x55458c,function(_0x54d590){if(_0x54d590['type'][_0x8168('0x3b')]!==_0x8168('0x3c')){var _0x22da21={};_0x22da21[_0x54d590['field']]={'$like':'%'+_0x425902[_0x8168('0x2e')][_0x8168('0x3d')]+'%'};return _0x22da21;}})});}_0x4db55a=_[_0x8168('0x39')]({},_0x4db55a,_0x425902['options']);var _0x1efb8e={'where':_0x4db55a[_0x8168('0x37')]};return db[_0x8168('0x3e')]['count'](_0x1efb8e)['then'](function(_0x14a3d5){_0x4b680f[_0x8168('0x1a')]=_0x14a3d5;if(_0x425902[_0x8168('0x2e')][_0x8168('0x3f')]){_0x4db55a[_0x8168('0x40')]=[{'all':!![]}];}return db[_0x8168('0x3e')][_0x8168('0x41')](_0x4db55a);})['then'](function(_0x5852c0){_0x4b680f[_0x8168('0x42')]=_0x5852c0;return _0x4b680f;})['then'](respondWithFilteredResult(_0x2c134e,_0x4db55a))[_0x8168('0x43')](handleError(_0x2c134e,null));};exports['show']=function(_0x35b40a,_0x1cda92){var _0x42d024={'raw':![],'where':{'id':_0x35b40a['params']['id']}},_0x596c6c={};_0x596c6c[_0x8168('0x2c')]=_['keys'](db[_0x8168('0x3e')][_0x8168('0x2b')]);_0x596c6c[_0x8168('0x2e')]=_['keys'](_0x35b40a['query']);_0x596c6c['filters']=_[_0x8168('0x30')](_0x596c6c[_0x8168('0x2c')],_0x596c6c[_0x8168('0x2e')]);_0x42d024[_0x8168('0x31')]=_[_0x8168('0x30')](_0x596c6c['model'],qs['fields'](_0x35b40a['query'][_0x8168('0x32')]));_0x42d024[_0x8168('0x31')]=_0x42d024[_0x8168('0x31')][_0x8168('0x44')]?_0x42d024[_0x8168('0x31')]:_0x596c6c['model'];if(_0x35b40a['query']['includeAll']){_0x42d024[_0x8168('0x40')]=[{'all':!![]}];}_0x42d024=_['merge']({},_0x42d024,_0x35b40a['options']);return db[_0x8168('0x3e')][_0x8168('0x45')](_0x42d024)['then'](handleEntityNotFound(_0x1cda92,null))[_0x8168('0x21')](respondWithResult(_0x1cda92,null))['catch'](handleError(_0x1cda92,null));};exports['create']=function(_0x4f9b03,_0x44f9e2){return db[_0x8168('0x3e')][_0x8168('0x46')](_0x4f9b03[_0x8168('0x47')],{})[_0x8168('0x21')](function(_0x1572fe){var _0x303448=_0x4f9b03[_0x8168('0x48')][_0x8168('0x49')]({'plain':!![]});if(!_0x303448)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x303448[_0x8168('0x4a')]===_0x8168('0x48')){var _0x127f2e=_0x1572fe[_0x8168('0x49')]({'plain':!![]});var _0x26db5c=_0x8168('0x22');return db[_0x8168('0x4b')][_0x8168('0x45')]({'where':{'name':_0x26db5c,'userProfileId':_0x303448[_0x8168('0x4c')]},'raw':!![]})[_0x8168('0x21')](function(_0x5a816a){if(_0x5a816a&&_0x5a816a[_0x8168('0x4d')]===0x0){return db['UserProfileResource'][_0x8168('0x46')]({'name':_0x127f2e['name'],'resourceId':_0x127f2e['id'],'type':_0x5a816a['name'],'sectionId':_0x5a816a['id']},{})[_0x8168('0x21')](function(){return _0x1572fe;});}else{return _0x1572fe;}})[_0x8168('0x43')](function(_0x22357f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22357f);throw _0x22357f;});}return _0x1572fe;})[_0x8168('0x21')](respondWithResult(_0x44f9e2,0xc9))[_0x8168('0x43')](handleError(_0x44f9e2,null));};exports[_0x8168('0x4e')]=function(_0x166040,_0x21a305){if(_0x166040[_0x8168('0x47')]['id']){delete _0x166040[_0x8168('0x47')]['id'];}return db['VoiceChanSpy'][_0x8168('0x45')]({'where':{'id':_0x166040[_0x8168('0x4f')]['id']}})[_0x8168('0x21')](handleEntityNotFound(_0x21a305,null))[_0x8168('0x21')](saveUpdates(_0x166040[_0x8168('0x47')],null))[_0x8168('0x21')](respondWithResult(_0x21a305,null))[_0x8168('0x43')](handleError(_0x21a305,null));};exports[_0x8168('0x24')]=function(_0x156024,_0x1b742b){return db[_0x8168('0x3e')][_0x8168('0x45')]({'where':{'id':_0x156024[_0x8168('0x4f')]['id']}})[_0x8168('0x21')](handleEntityNotFound(_0x1b742b,null))[_0x8168('0x21')](removeEntity(_0x1b742b,null))['catch'](handleError(_0x1b742b,null));}; \ No newline at end of file +var _0x451d=['../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','VoiceChanSpy','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','type','key','VIRTUAL','field','merge','include','findAll','rows','catch','show','includeAll','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x351509,_0x54725c){var _0x4e9861=function(_0x54f92c){while(--_0x54f92c){_0x351509['push'](_0x351509['shift']());}};_0x4e9861(++_0x54725c);}(_0x451d,0x1ed));var _0xd451=function(_0x5e08dd,_0x5ac938){_0x5e08dd=_0x5e08dd-0x0;var _0x2e82ef=_0x451d[_0x5e08dd];return _0x2e82ef;};'use strict';var pdf=require(_0xd451('0x0'));var emlformat=require(_0xd451('0x1'));var rimraf=require(_0xd451('0x2'));var zipdir=require(_0xd451('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd451('0x4'));var moment=require(_0xd451('0x5'));var BPromise=require(_0xd451('0x6'));var Mustache=require(_0xd451('0x7'));var util=require(_0xd451('0x8'));var path=require(_0xd451('0x9'));var sox=require(_0xd451('0xa'));var csv=require(_0xd451('0xb'));var ejs=require(_0xd451('0xc'));var fs=require('fs');var _=require(_0xd451('0xd'));var squel=require(_0xd451('0xe'));var crypto=require(_0xd451('0xf'));var jsforce=require(_0xd451('0x10'));var deskjs=require(_0xd451('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd451('0x12'));var Papa=require(_0xd451('0x13'));var Redis=require(_0xd451('0x14'));var authService=require(_0xd451('0x15'));var qs=require(_0xd451('0x16'));var hardwareService=require(_0xd451('0x17'));var logger=require('../../config/logger')(_0xd451('0x18'));var utils=require('../../config/utils');var config=require(_0xd451('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35a0e0,_0x13d0f0){_0x13d0f0=_0x13d0f0||0xcc;return function(_0x3ea380){if(_0x3ea380){return _0x35a0e0[_0xd451('0x1a')](_0x13d0f0);}return _0x35a0e0[_0xd451('0x1b')](_0x13d0f0)[_0xd451('0x1c')]();};}function respondWithResult(_0x5f0c52,_0x2039e6){_0x2039e6=_0x2039e6||0xc8;return function(_0xf0fc95){if(_0xf0fc95){return _0x5f0c52['status'](_0x2039e6)[_0xd451('0x1d')](_0xf0fc95);}};}function respondWithFilteredResult(_0x4268b4,_0x182a49){return function(_0x1cb285){if(_0x1cb285){var _0x5127d9=_0x1cb285[_0xd451('0x1e')],_0x5a7cc1=_0x182a49[_0xd451('0x1f')],_0x5b3345=_0x182a49[_0xd451('0x1f')]+_0x182a49['limit'],_0x1f5919;if(_0x5b3345>=_0x5127d9){_0x5b3345=_0x5127d9;_0x1f5919=0xc8;}else{_0x1f5919=0xce;}_0x4268b4['status'](_0x1f5919);return _0x4268b4[_0xd451('0x20')](_0xd451('0x21'),_0x5a7cc1+'-'+_0x5b3345+'/'+_0x5127d9)['json'](_0x1cb285);}return null;};}function patchUpdates(_0x20031c){return function(_0x4d2377){try{jsonpatch[_0xd451('0x22')](_0x4d2377,_0x20031c,!![]);}catch(_0x56d5cb){return BPromise[_0xd451('0x23')](_0x56d5cb);}return _0x4d2377[_0xd451('0x24')]();};}function saveUpdates(_0x371e88,_0xee97b0){return function(_0x5be7c0){if(_0x5be7c0){return _0x5be7c0['update'](_0x371e88)[_0xd451('0x25')](function(_0xf63a45){return _0xf63a45;});}return null;};}function removeEntity(_0x287b19,_0x48c81e){return function(_0x56ac8b){if(_0x56ac8b){return _0x56ac8b[_0xd451('0x26')]()[_0xd451('0x25')](function(){var _0x28631d=_0x56ac8b['get']({'plain':!![]});var _0x167a86='ChanSpies';return db['UserProfileResource']['destroy']({'where':{'type':_0x167a86,'resourceId':_0x28631d['id']}})[_0xd451('0x25')](function(){return _0x56ac8b;});})['then'](function(){_0x287b19['status'](0xcc)[_0xd451('0x1c')]();});}};}function handleEntityNotFound(_0x5643ab,_0x46737c){return function(_0x3d0161){if(!_0x3d0161){_0x5643ab[_0xd451('0x1a')](0x194);}return _0x3d0161;};}function handleError(_0x3ab4a4,_0x1733c6){_0x1733c6=_0x1733c6||0x1f4;return function(_0x420ec3){logger['error'](_0x420ec3[_0xd451('0x27')]);if(_0x420ec3[_0xd451('0x28')]){delete _0x420ec3[_0xd451('0x28')];}_0x3ab4a4[_0xd451('0x1b')](_0x1733c6)[_0xd451('0x29')](_0x420ec3);};}exports[_0xd451('0x2a')]=function(_0x160714,_0x322cda){var _0x8c010e={},_0x5e109e={},_0x5cfb2b={'count':0x0,'rows':[]};var _0x265f5a=db[_0xd451('0x2b')][_0xd451('0x2c')];_0x5e109e[_0xd451('0x2d')]=_['keys'](_0x265f5a);_0x5e109e['query']=_[_0xd451('0x2e')](_0x160714['query']);_0x5e109e[_0xd451('0x2f')]=_[_0xd451('0x30')](_0x5e109e[_0xd451('0x2d')],_0x5e109e[_0xd451('0x31')]);_0x8c010e[_0xd451('0x32')]=_[_0xd451('0x30')](_0x5e109e[_0xd451('0x2d')],qs[_0xd451('0x33')](_0x160714[_0xd451('0x31')][_0xd451('0x33')]));_0x8c010e['attributes']=_0x8c010e['attributes'][_0xd451('0x34')]?_0x8c010e[_0xd451('0x32')]:_0x5e109e[_0xd451('0x2d')];if(!_0x160714['query'][_0xd451('0x35')](_0xd451('0x36'))){_0x8c010e[_0xd451('0x37')]=qs[_0xd451('0x37')](_0x160714[_0xd451('0x31')][_0xd451('0x37')]);_0x8c010e[_0xd451('0x1f')]=qs['offset'](_0x160714[_0xd451('0x31')][_0xd451('0x1f')]);}_0x8c010e['order']=qs[_0xd451('0x38')](_0x160714[_0xd451('0x31')][_0xd451('0x38')]);_0x8c010e[_0xd451('0x39')]=qs[_0xd451('0x2f')](_[_0xd451('0x3a')](_0x160714[_0xd451('0x31')],_0x5e109e[_0xd451('0x2f')]));if(_0x160714[_0xd451('0x31')][_0xd451('0x3b')]){_0x8c010e[_0xd451('0x39')]=_['merge'](_0x8c010e[_0xd451('0x39')],{'$or':_['map'](_0x265f5a,function(_0x5a546c){if(_0x5a546c[_0xd451('0x3c')][_0xd451('0x3d')]!==_0xd451('0x3e')){var _0x3496f3={};_0x3496f3[_0x5a546c[_0xd451('0x3f')]]={'$like':'%'+_0x160714[_0xd451('0x31')]['filter']+'%'};return _0x3496f3;}})});}_0x8c010e=_[_0xd451('0x40')]({},_0x8c010e,_0x160714['options']);var _0x521419={'where':_0x8c010e[_0xd451('0x39')]};return db['VoiceChanSpy'][_0xd451('0x1e')](_0x521419)['then'](function(_0x17453d){_0x5cfb2b[_0xd451('0x1e')]=_0x17453d;if(_0x160714[_0xd451('0x31')]['includeAll']){_0x8c010e[_0xd451('0x41')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0xd451('0x42')](_0x8c010e);})[_0xd451('0x25')](function(_0xfd443f){_0x5cfb2b[_0xd451('0x43')]=_0xfd443f;return _0x5cfb2b;})['then'](respondWithFilteredResult(_0x322cda,_0x8c010e))[_0xd451('0x44')](handleError(_0x322cda,null));};exports[_0xd451('0x45')]=function(_0x260d4f,_0x20e845){var _0x315caa={'raw':![],'where':{'id':_0x260d4f['params']['id']}},_0x2b488b={};_0x2b488b[_0xd451('0x2d')]=_['keys'](db['VoiceChanSpy'][_0xd451('0x2c')]);_0x2b488b[_0xd451('0x31')]=_[_0xd451('0x2e')](_0x260d4f['query']);_0x2b488b['filters']=_['intersection'](_0x2b488b['model'],_0x2b488b[_0xd451('0x31')]);_0x315caa[_0xd451('0x32')]=_['intersection'](_0x2b488b[_0xd451('0x2d')],qs['fields'](_0x260d4f[_0xd451('0x31')][_0xd451('0x33')]));_0x315caa[_0xd451('0x32')]=_0x315caa[_0xd451('0x32')][_0xd451('0x34')]?_0x315caa[_0xd451('0x32')]:_0x2b488b[_0xd451('0x2d')];if(_0x260d4f[_0xd451('0x31')][_0xd451('0x46')]){_0x315caa[_0xd451('0x41')]=[{'all':!![]}];}_0x315caa=_['merge']({},_0x315caa,_0x260d4f[_0xd451('0x47')]);return db[_0xd451('0x2b')][_0xd451('0x48')](_0x315caa)['then'](handleEntityNotFound(_0x20e845,null))[_0xd451('0x25')](respondWithResult(_0x20e845,null))[_0xd451('0x44')](handleError(_0x20e845,null));};exports[_0xd451('0x49')]=function(_0x220d2d,_0x14a870){return db[_0xd451('0x2b')][_0xd451('0x49')](_0x220d2d[_0xd451('0x4a')],{})['then'](function(_0x33ce31){var _0x30dfbb=_0x220d2d[_0xd451('0x4b')][_0xd451('0x4c')]({'plain':!![]});if(!_0x30dfbb)throw new Error(_0xd451('0x4d'));if(_0x30dfbb[_0xd451('0x4e')]==='user'){var _0x2f293f=_0x33ce31[_0xd451('0x4c')]({'plain':!![]});var _0x11f17f=_0xd451('0x4f');return db[_0xd451('0x50')][_0xd451('0x48')]({'where':{'name':_0x11f17f,'userProfileId':_0x30dfbb[_0xd451('0x51')]},'raw':!![]})['then'](function(_0x1ab3af){if(_0x1ab3af&&_0x1ab3af['autoAssociation']===0x0){return db[_0xd451('0x52')][_0xd451('0x49')]({'name':_0x2f293f[_0xd451('0x28')],'resourceId':_0x2f293f['id'],'type':_0x1ab3af[_0xd451('0x28')],'sectionId':_0x1ab3af['id']},{})[_0xd451('0x25')](function(){return _0x33ce31;});}else{return _0x33ce31;}})[_0xd451('0x44')](function(_0x2f01cb){logger['error'](_0xd451('0x53'),_0x2f01cb);throw _0x2f01cb;});}return _0x33ce31;})[_0xd451('0x25')](respondWithResult(_0x14a870,0xc9))[_0xd451('0x44')](handleError(_0x14a870,null));};exports[_0xd451('0x54')]=function(_0x1928aa,_0x37966b){if(_0x1928aa['body']['id']){delete _0x1928aa[_0xd451('0x4a')]['id'];}return db[_0xd451('0x2b')][_0xd451('0x48')]({'where':{'id':_0x1928aa['params']['id']}})[_0xd451('0x25')](handleEntityNotFound(_0x37966b,null))['then'](saveUpdates(_0x1928aa[_0xd451('0x4a')],null))[_0xd451('0x25')](respondWithResult(_0x37966b,null))['catch'](handleError(_0x37966b,null));};exports[_0xd451('0x26')]=function(_0x3fc1f9,_0x21a070){return db['VoiceChanSpy']['find']({'where':{'id':_0x3fc1f9[_0xd451('0x55')]['id']}})[_0xd451('0x25')](handleEntityNotFound(_0x21a070,null))[_0xd451('0x25')](removeEntity(_0x21a070,null))[_0xd451('0x44')](handleError(_0x21a070,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 2ce0a02..0484be6 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 _0xd957=['models','define','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','./voiceChanSpy.attributes','context','from-sip','format','prefix','system','merge','Set','CDR(type)=%s','chanspy','push','MixMonitor','${UNIQUEID}.%s,ab','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','length','concat','internal','name','User','findAll','agent','then','catch','exports'];(function(_0x430373,_0x298143){var _0x5ad51c=function(_0x50f8d7){while(--_0x50f8d7){_0x430373['push'](_0x430373['shift']());}};_0x5ad51c(++_0x298143);}(_0xd957,0x153));var _0x7d95=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd957[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7d95('0x0'));var util=require(_0x7d95('0x1'));var BPromise=require('bluebird');var attributes=require(_0x7d95('0x2'));var getUserApplications=function(_0x2035b7,_0x5d0023,_0xf7608a){var _0x280af9=0x1;var _0x291309=[];var _0x9750e1={'context':_0x5d0023[_0x7d95('0x3')]||_0x7d95('0x4'),'exten':util[_0x7d95('0x5')]('%s%s',_0x2035b7[_0x7d95('0x6')],_0xf7608a),'type':_0x7d95('0x7'),'isApp':![],'ChanSpyId':_0x2035b7['id'],'UserId':_0x5d0023['id']};_0x291309['push'](_[_0x7d95('0x8')]({'app':_0x7d95('0x9'),'appdata':util[_0x7d95('0x5')](_0x7d95('0xa'),_0x7d95('0xb')),'priority':_0x280af9++},_0x9750e1));if(_0x2035b7['record']){_0x291309[_0x7d95('0xc')](_[_0x7d95('0x8')]({'app':_0x7d95('0xd'),'appdata':util[_0x7d95('0x5')](_0x7d95('0xe'),_0x2035b7['recordingFormat']),'priority':_0x280af9++},_0x9750e1));}if(_0x2035b7['auth']){_0x291309[_0x7d95('0xc')](_[_0x7d95('0x8')]({'app':'Authenticate','appdata':_0x2035b7[_0x7d95('0xf')],'priority':_0x280af9++},_0x9750e1));}_0x291309[_0x7d95('0xc')](_[_0x7d95('0x8')]({'app':_0x7d95('0x10'),'appdata':util[_0x7d95('0x5')](_0x7d95('0x11'),_0x5d0023['name'],_0x2035b7[_0x7d95('0x12')]?_0x2035b7['options'][_0x7d95('0x13')](''):''),'priority':_0x280af9++},_0x9750e1));if(_0x2035b7['record']){_0x291309[_0x7d95('0xc')](_['merge']({'app':_0x7d95('0x14'),'priority':_0x280af9++},_0x9750e1));}return _0x291309;};var getChanSpyApplications=function(_0x30c2f8,_0x293f87){var _0x45bf02=[];for(var _0x5ab72e=0x0,_0x595745=0x1;_0x5ab72e<_0x293f87[_0x7d95('0x15')];_0x5ab72e++,_0x595745=0x1){_0x45bf02=_0x45bf02[_0x7d95('0x16')](getUserApplications(_0x30c2f8,_0x293f87[_0x5ab72e],_0x293f87[_0x5ab72e][_0x7d95('0x17')]));if(_0x293f87[_0x5ab72e][_0x7d95('0x17')]!=_0x293f87[_0x5ab72e]['name']){_0x45bf02=_0x45bf02[_0x7d95('0x16')](getUserApplications(_0x30c2f8,_0x293f87[_0x5ab72e],_0x293f87[_0x5ab72e][_0x7d95('0x18')]));}}return _0x45bf02;};var getChanSpyPromise=function(_0x55e083,_0x3c264b){return new BPromise(function(_0x1b5629,_0x2d0627){return _0x55e083[_0x7d95('0x19')][_0x7d95('0x1a')]({'attributes':['id',_0x7d95('0x18'),_0x7d95('0x17')],'where':{'role':_0x7d95('0x1b'),'chanspy':!![]},'raw':!![]})[_0x7d95('0x1c')](function(_0x489e8a){if(_0x489e8a){return _0x1b5629(getChanSpyApplications(_0x3c264b,_0x489e8a));}return _0x1b5629([]);})[_0x7d95('0x1d')](function(_0x5a0f78){_0x2d0627(_0x5a0f78);});});};module[_0x7d95('0x1e')]=function(_0x4c0133,_0x49386b){var _0x3d5a4d=_0x4c0133[_0x7d95('0x1f')];return _0x4c0133[_0x7d95('0x20')]('VoiceChanSpy',attributes,{'tableName':_0x7d95('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xd7d5,_0x49e92f,_0x1938a5){return getChanSpyPromise(_0x3d5a4d,_0xd7d5)['then'](function(_0x4ec676){if(_0x4ec676&&_0x4ec676['length']){return _0x3d5a4d[_0x7d95('0x22')][_0x7d95('0x23')](_0x4ec676);}})['then'](function(){_0x1938a5();})[_0x7d95('0x1d')](function(_0x13f975){_0x1938a5(_0x13f975);});},'afterUpdate':function(_0x70c5cb,_0x51f5c6,_0x2583e2){return _0x3d5a4d[_0x7d95('0x22')][_0x7d95('0x24')]({'where':{'ChanSpyId':_0x70c5cb['id']}})['then'](function(){return getChanSpyPromise(_0x3d5a4d,_0x70c5cb);})[_0x7d95('0x1c')](function(_0x57b751){if(_0x57b751&&_0x57b751[_0x7d95('0x15')]){return _0x3d5a4d[_0x7d95('0x22')][_0x7d95('0x23')](_0x57b751);}})[_0x7d95('0x1c')](function(){_0x2583e2();})[_0x7d95('0x1d')](function(_0x109b37){_0x2583e2(_0x109b37);});},'afterDestroy':function(_0xb432be,_0x32ac56,_0x5e130a){return _0x3d5a4d[_0x7d95('0x22')]['destroy']({'where':{'ChanSpyId':_0xb432be['id']}})[_0x7d95('0x1c')](function(){_0x5e130a();})['catch'](function(_0x26c07c){_0x5e130a(_0x26c07c);});}}});}; \ No newline at end of file +var _0x5511=['destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','merge','CDR(type)=%s','record','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','auth','push','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','length','concat','internal','name','User','findAll','then','catch','exports','models','define','VoiceChanSpy','bulkCreate','VoiceExtension'];(function(_0x4e5606,_0x4dcff0){var _0xdc8d2c=function(_0x10864d){while(--_0x10864d){_0x4e5606['push'](_0x4e5606['shift']());}};_0xdc8d2c(++_0x4dcff0);}(_0x5511,0x10b));var _0x1551=function(_0x447f76,_0x47b6db){_0x447f76=_0x447f76-0x0;var _0x5cecc8=_0x5511[_0x447f76];return _0x5cecc8;};'use strict';var _=require(_0x1551('0x0'));var util=require(_0x1551('0x1'));var BPromise=require(_0x1551('0x2'));var attributes=require(_0x1551('0x3'));var getUserApplications=function(_0x89a752,_0x5b4719,_0x4dc9c3){var _0x16f26f=0x1;var _0x33192e=[];var _0x5865a8={'context':_0x5b4719[_0x1551('0x4')]||_0x1551('0x5'),'exten':util[_0x1551('0x6')](_0x1551('0x7'),_0x89a752['prefix'],_0x4dc9c3),'type':'system','isApp':![],'ChanSpyId':_0x89a752['id'],'UserId':_0x5b4719['id']};_0x33192e['push'](_[_0x1551('0x8')]({'app':'Set','appdata':util[_0x1551('0x6')](_0x1551('0x9'),'chanspy'),'priority':_0x16f26f++},_0x5865a8));if(_0x89a752[_0x1551('0xa')]){_0x33192e['push'](_[_0x1551('0x8')]({'app':_0x1551('0xb'),'appdata':util['format'](_0x1551('0xc'),_0x89a752[_0x1551('0xd')]),'priority':_0x16f26f++},_0x5865a8));}if(_0x89a752[_0x1551('0xe')]){_0x33192e[_0x1551('0xf')](_['merge']({'app':_0x1551('0x10'),'appdata':_0x89a752[_0x1551('0x11')],'priority':_0x16f26f++},_0x5865a8));}_0x33192e[_0x1551('0xf')](_['merge']({'app':_0x1551('0x12'),'appdata':util[_0x1551('0x6')](_0x1551('0x13'),_0x5b4719['name'],_0x89a752['options']?_0x89a752[_0x1551('0x14')][_0x1551('0x15')](''):''),'priority':_0x16f26f++},_0x5865a8));if(_0x89a752['record']){_0x33192e['push'](_['merge']({'app':_0x1551('0x16'),'priority':_0x16f26f++},_0x5865a8));}return _0x33192e;};var getChanSpyApplications=function(_0x154bc3,_0x3b4d88){var _0x5e9697=[];for(var _0x1e5417=0x0,_0x1736af=0x1;_0x1e5417<_0x3b4d88[_0x1551('0x17')];_0x1e5417++,_0x1736af=0x1){_0x5e9697=_0x5e9697[_0x1551('0x18')](getUserApplications(_0x154bc3,_0x3b4d88[_0x1e5417],_0x3b4d88[_0x1e5417][_0x1551('0x19')]));if(_0x3b4d88[_0x1e5417][_0x1551('0x19')]!=_0x3b4d88[_0x1e5417][_0x1551('0x1a')]){_0x5e9697=_0x5e9697[_0x1551('0x18')](getUserApplications(_0x154bc3,_0x3b4d88[_0x1e5417],_0x3b4d88[_0x1e5417][_0x1551('0x1a')]));}}return _0x5e9697;};var getChanSpyPromise=function(_0x5775aa,_0x417ba7){return new BPromise(function(_0x4fb76b,_0x2b0f21){return _0x5775aa[_0x1551('0x1b')][_0x1551('0x1c')]({'attributes':['id',_0x1551('0x1a'),_0x1551('0x19')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x1551('0x1d')](function(_0x5767ba){if(_0x5767ba){return _0x4fb76b(getChanSpyApplications(_0x417ba7,_0x5767ba));}return _0x4fb76b([]);})[_0x1551('0x1e')](function(_0x565a35){_0x2b0f21(_0x565a35);});});};module[_0x1551('0x1f')]=function(_0x2908a0,_0x5d4149){var _0x368bb2=_0x2908a0[_0x1551('0x20')];return _0x2908a0[_0x1551('0x21')](_0x1551('0x22'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x483842,_0x7d4ba4,_0x1b46f7){return getChanSpyPromise(_0x368bb2,_0x483842)[_0x1551('0x1d')](function(_0xc369b7){if(_0xc369b7&&_0xc369b7[_0x1551('0x17')]){return _0x368bb2['VoiceExtension'][_0x1551('0x23')](_0xc369b7);}})[_0x1551('0x1d')](function(){_0x1b46f7();})['catch'](function(_0x4ff0d7){_0x1b46f7(_0x4ff0d7);});},'afterUpdate':function(_0x4bca2a,_0x44a241,_0x24dfc5){return _0x368bb2[_0x1551('0x24')]['destroy']({'where':{'ChanSpyId':_0x4bca2a['id']}})[_0x1551('0x1d')](function(){return getChanSpyPromise(_0x368bb2,_0x4bca2a);})[_0x1551('0x1d')](function(_0x1caec1){if(_0x1caec1&&_0x1caec1[_0x1551('0x17')]){return _0x368bb2[_0x1551('0x24')][_0x1551('0x23')](_0x1caec1);}})['then'](function(){_0x24dfc5();})['catch'](function(_0x4a27e0){_0x24dfc5(_0x4a27e0);});},'afterDestroy':function(_0x1c10af,_0x30da9c,_0x4c0381){return _0x368bb2[_0x1551('0x24')][_0x1551('0x25')]({'where':{'ChanSpyId':_0x1c10af['id']}})[_0x1551('0x1d')](function(){_0x4c0381();})[_0x1551('0x1e')](function(_0x5cb20b){_0x4c0381(_0x5cb20b);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 66811b0..15ab179 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 _0xbb3e=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x30e575,_0x509a73){var _0x471710=function(_0x14b99b){while(--_0x14b99b){_0x30e575['push'](_0x30e575['shift']());}};_0x471710(++_0x509a73);}(_0xbb3e,0x116));var _0xebb3=function(_0x36f72f,_0x29ceed){_0x36f72f=_0x36f72f-0x0;var _0x809bc6=_0xbb3e[_0x36f72f];return _0x809bc6;};'use strict';var _=require(_0xebb3('0x0'));var util=require(_0xebb3('0x1'));var moment=require(_0xebb3('0x2'));var BPromise=require(_0xebb3('0x3'));var rs=require(_0xebb3('0x4'));var fs=require('fs');var Redis=require(_0xebb3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xebb3('0x6'));var logger=require(_0xebb3('0x7'))(_0xebb3('0x8'));var config=require(_0xebb3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xebb3('0xa')][_0xebb3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f1e82,_0x253dfe,_0x420cda){return new BPromise(function(_0x1ae362,_0x157c1c){return client[_0xebb3('0xc')](_0x4f1e82,_0x420cda)[_0xebb3('0xd')](function(_0x154a40){logger[_0xebb3('0xe')](_0xebb3('0xf'),_0x253dfe,_0xebb3('0x10'));logger[_0xebb3('0x11')](_0xebb3('0x12'),_0x253dfe,_0xebb3('0x10'),JSON[_0xebb3('0x13')](_0x154a40));if(_0x154a40['error']){if(_0x154a40['error'][_0xebb3('0x14')]===0x1f4){logger[_0xebb3('0x15')](_0xebb3('0xf'),_0x253dfe,_0x154a40['error'][_0xebb3('0x16')]);return _0x157c1c(_0x154a40[_0xebb3('0x15')][_0xebb3('0x16')]);}logger[_0xebb3('0x15')](_0xebb3('0xf'),_0x253dfe,_0x154a40[_0xebb3('0x15')]['message']);return _0x1ae362(_0x154a40[_0xebb3('0x15')][_0xebb3('0x16')]);}else{logger[_0xebb3('0xe')](_0xebb3('0xf'),_0x253dfe,_0xebb3('0x10'));_0x1ae362(_0x154a40[_0xebb3('0x17')]['message']);}})[_0xebb3('0x18')](function(_0x1ab19d){logger[_0xebb3('0x15')](_0xebb3('0xf'),_0x253dfe,_0x1ab19d);_0x157c1c(_0x1ab19d);});});} \ No newline at end of file +var _0x3eb3=['rpc','../../config/environment','jayson/promise','http','request','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ioredis','../../config/utils','../../config/logger'];(function(_0xf7def,_0x2b5edc){var _0x57c553=function(_0x1d47de){while(--_0x1d47de){_0xf7def['push'](_0xf7def['shift']());}};_0x57c553(++_0x2b5edc);}(_0x3eb3,0xf9));var _0x33eb=function(_0x186bfb,_0x4c089e){_0x186bfb=_0x186bfb-0x0;var _0x23c07b=_0x3eb3[_0x186bfb];return _0x23c07b;};'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(_0x33eb('0x0'));var db=require('../../mysqldb')['db'];var utils=require(_0x33eb('0x1'));var logger=require(_0x33eb('0x2'))(_0x33eb('0x3'));var config=require(_0x33eb('0x4'));var jayson=require(_0x33eb('0x5'));var client=jayson['client'][_0x33eb('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x12bd23,_0x5da863,_0x184182){return new BPromise(function(_0x3df49b,_0x33c72d){return client[_0x33eb('0x7')](_0x12bd23,_0x184182)['then'](function(_0x3647e0){logger[_0x33eb('0x8')](_0x33eb('0x9'),_0x5da863,'request\x20sent');logger[_0x33eb('0xa')](_0x33eb('0xb'),_0x5da863,_0x33eb('0xc'),JSON[_0x33eb('0xd')](_0x3647e0));if(_0x3647e0[_0x33eb('0xe')]){if(_0x3647e0['error'][_0x33eb('0xf')]===0x1f4){logger['error'](_0x33eb('0x9'),_0x5da863,_0x3647e0[_0x33eb('0xe')][_0x33eb('0x10')]);return _0x33c72d(_0x3647e0[_0x33eb('0xe')][_0x33eb('0x10')]);}logger[_0x33eb('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x5da863,_0x3647e0[_0x33eb('0xe')][_0x33eb('0x10')]);return _0x3df49b(_0x3647e0['error']['message']);}else{logger[_0x33eb('0x8')](_0x33eb('0x9'),_0x5da863,_0x33eb('0xc'));_0x3df49b(_0x3647e0['result'][_0x33eb('0x10')]);}})[_0x33eb('0x11')](function(_0x2ba09a){logger[_0x33eb('0xe')](_0x33eb('0x9'),_0x5da863,_0x2ba09a);_0x33c72d(_0x2ba09a);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index c3258cc..c4b26b2 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 _0x2ace=['index','/:id','show','post','create','put','update','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceContext.controller','get','isAuthenticated'];(function(_0x5e163f,_0x5343c8){var _0x282a35=function(_0x15578a){while(--_0x15578a){_0x5e163f['push'](_0x5e163f['shift']());}};_0x282a35(++_0x5343c8);}(_0x2ace,0x17e));var _0xe2ac=function(_0x319e2e,_0x2f727f){_0x319e2e=_0x319e2e-0x0;var _0x302524=_0x2ace[_0x319e2e];return _0x302524;};'use strict';var multer=require('multer');var util=require(_0xe2ac('0x0'));var path=require(_0xe2ac('0x1'));var timeout=require(_0xe2ac('0x2'));var express=require('express');var router=express[_0xe2ac('0x3')]();var auth=require(_0xe2ac('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe2ac('0x5'));var controller=require(_0xe2ac('0x6'));router[_0xe2ac('0x7')]('/',auth[_0xe2ac('0x8')](),controller[_0xe2ac('0x9')]);router[_0xe2ac('0x7')](_0xe2ac('0xa'),auth[_0xe2ac('0x8')](),controller[_0xe2ac('0xb')]);router[_0xe2ac('0xc')]('/',auth[_0xe2ac('0x8')](),controller[_0xe2ac('0xd')]);router[_0xe2ac('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xe2ac('0xf')]);router['delete'](_0xe2ac('0xa'),auth[_0xe2ac('0x8')](),controller['destroy']);module[_0xe2ac('0x10')]=router; \ No newline at end of file +var _0x1219=['destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x31b251,_0x56bc72){var _0x23af6d=function(_0x3dcea6){while(--_0x3dcea6){_0x31b251['push'](_0x31b251['shift']());}};_0x23af6d(++_0x56bc72);}(_0x1219,0x17c));var _0x9121=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1219[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x9121('0x0'));var util=require(_0x9121('0x1'));var path=require(_0x9121('0x2'));var timeout=require(_0x9121('0x3'));var express=require(_0x9121('0x4'));var router=express['Router']();var auth=require(_0x9121('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9121('0x6'));var controller=require(_0x9121('0x7'));router[_0x9121('0x8')]('/',auth[_0x9121('0x9')](),controller[_0x9121('0xa')]);router[_0x9121('0x8')](_0x9121('0xb'),auth[_0x9121('0x9')](),controller[_0x9121('0xc')]);router[_0x9121('0xd')]('/',auth[_0x9121('0x9')](),controller['create']);router[_0x9121('0xe')](_0x9121('0xb'),auth[_0x9121('0x9')](),controller[_0x9121('0xf')]);router['delete'](_0x9121('0xb'),auth[_0x9121('0x9')](),controller[_0x9121('0x10')]);module[_0x9121('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 43fb670..8e9aa13 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 _0x5968=['exports'];(function(_0x5ce3c8,_0x2503bd){var _0xa76867=function(_0x52815e){while(--_0x52815e){_0x5ce3c8['push'](_0x5ce3c8['shift']());}};_0xa76867(++_0x2503bd);}(_0x5968,0xae));var _0x8596=function(_0xdc9149,_0x2a85ab){_0xdc9149=_0xdc9149-0x0;var _0x4c18be=_0x5968[_0xdc9149];return _0x4c18be;};'use strict';var Sequelize=require('sequelize');module[_0x8596('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf18c=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0xfbc3f0,_0xa03f07){var _0x19ba5f=function(_0x10f46a){while(--_0x10f46a){_0xfbc3f0['push'](_0xfbc3f0['shift']());}};_0x19ba5f(++_0xa03f07);}(_0xf18c,0x115));var _0xcf18=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xf18c[_0x6cf19c];return _0xce14f3;};'use strict';var Sequelize=require(_0xcf18('0x0'));module[_0xcf18('0x1')]={'name':{'type':Sequelize[_0xcf18('0x2')],'unique':_0xcf18('0x3')},'description':{'type':Sequelize[_0xcf18('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xcf18('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 c2b9b59..ba07526 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 _0x44e8=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','/etc/asterisk/extensions_xcally_contexts.conf','root','utf8','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../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~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','VoiceContext','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','filters','pick','where','map','type','key','field','merge','options','includeAll','include','findAll','rows','catch','show','create','body','readFileSync','join','server/files/templates/context.ejs','render','writeFileSync','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation'];(function(_0x5f050a,_0x5d0475){var _0x341b02=function(_0x59fcf6){while(--_0x59fcf6){_0x5f050a['push'](_0x5f050a['shift']());}};_0x341b02(++_0x5d0475);}(_0x44e8,0xd7));var _0x844e=function(_0x48affe,_0xb717a){_0x48affe=_0x48affe-0x0;var _0x4e9b45=_0x44e8[_0x48affe];return _0x4e9b45;};'use strict';var pdf=require(_0x844e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x844e('0x1'));var jsonpatch=require(_0x844e('0x2'));var rp=require(_0x844e('0x3'));var moment=require(_0x844e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x844e('0x5'));var util=require(_0x844e('0x6'));var path=require(_0x844e('0x7'));var sox=require(_0x844e('0x8'));var csv=require('to-csv');var ejs=require(_0x844e('0x9'));var fs=require('fs');var _=require(_0x844e('0xa'));var squel=require(_0x844e('0xb'));var crypto=require(_0x844e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x844e('0xd'));var toCsv=require(_0x844e('0xe'));var querystring=require(_0x844e('0xf'));var Papa=require(_0x844e('0x10'));var Redis=require(_0x844e('0x11'));var authService=require(_0x844e('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x844e('0x13'));var logger=require(_0x844e('0x14'))(_0x844e('0x15'));var utils=require(_0x844e('0x16'));var config=require(_0x844e('0x17'));var db=require(_0x844e('0x18'))['db'];var jayson=require(_0x844e('0x19'));var client=jayson['client'][_0x844e('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x23df3f,_0x52ac76,_0x3a09d0){if(_0x3a09d0){var _0x1cd556=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1cd556['test'](_0x52ac76)){return _0x23df3f;}else{throw new Error(_0x844e('0x1b'));}}else{return _0x23df3f;}}function respondWithRpcPromise(_0x6b542d,_0x1c1689,_0x4ed3a4,_0x6cc6fb){return new BPromise(function(_0x465e49,_0x380eb4){var _0x935134=_0x6cc6fb||client;return _0x935134[_0x844e('0x1c')](_0x6b542d,_0x4ed3a4)[_0x844e('0x1d')](function(_0x2227c6){logger[_0x844e('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x1c1689,_0x844e('0x1f'));logger['debug'](_0x844e('0x20'),_0x1c1689,'request\x20sent',JSON[_0x844e('0x21')](_0x2227c6));if(_0x2227c6['error']){if(_0x2227c6[_0x844e('0x22')][_0x844e('0x23')]===0x1f4){logger[_0x844e('0x22')](_0x844e('0x24'),_0x1c1689,_0x2227c6[_0x844e('0x22')][_0x844e('0x25')]);return _0x380eb4(_0x2227c6[_0x844e('0x22')][_0x844e('0x25')]);}logger['error'](_0x844e('0x24'),_0x1c1689,_0x2227c6['error']['message']);return _0x465e49(_0x2227c6[_0x844e('0x22')][_0x844e('0x25')]);}else{logger[_0x844e('0x1e')](_0x844e('0x24'),_0x1c1689,'request\x20sent');_0x465e49(_0x2227c6[_0x844e('0x26')][_0x844e('0x25')]);}})['catch'](function(_0x2520f8){logger[_0x844e('0x22')](_0x844e('0x24'),_0x1c1689,_0x2520f8);_0x380eb4(_0x2520f8);});});}function respondWithStatusCode(_0xdba48d,_0x35236b){_0x35236b=_0x35236b||0xcc;return function(_0x3a65fc){if(_0x3a65fc){return _0xdba48d['sendStatus'](_0x35236b);}return _0xdba48d[_0x844e('0x27')](_0x35236b)[_0x844e('0x28')]();};}function respondWithResult(_0x11859a,_0x263702){_0x263702=_0x263702||0xc8;return function(_0x2c915f){if(_0x2c915f){return _0x11859a['status'](_0x263702)[_0x844e('0x29')](_0x2c915f);}};}function respondWithFilteredResult(_0x5080c1,_0x57b2ef){return function(_0x431a9c){if(_0x431a9c){var _0x130d87=_0x431a9c[_0x844e('0x2a')],_0x355456=_0x57b2ef[_0x844e('0x2b')],_0x587613=_0x57b2ef['offset']+_0x57b2ef[_0x844e('0x2c')],_0x489349;if(_0x587613>=_0x130d87){_0x587613=_0x130d87;_0x489349=0xc8;}else{_0x489349=0xce;}_0x5080c1[_0x844e('0x27')](_0x489349);return _0x5080c1[_0x844e('0x2d')](_0x844e('0x2e'),_0x355456+'-'+_0x587613+'/'+_0x130d87)[_0x844e('0x29')](_0x431a9c);}return null;};}function patchUpdates(_0x799cde){return function(_0x30d0a2){try{jsonpatch[_0x844e('0x2f')](_0x30d0a2,_0x799cde,!![]);}catch(_0x618bf6){return BPromise[_0x844e('0x30')](_0x618bf6);}return _0x30d0a2['save']();};}function saveUpdates(_0x54fc29,_0x397546){return function(_0x13fc3f){if(_0x13fc3f){return _0x13fc3f[_0x844e('0x31')](_0x54fc29)[_0x844e('0x1d')](function(_0x31754e){return _0x31754e;});}return null;};}function removeEntity(_0x27e5b3,_0x55c488){return function(_0x26d6f2){if(_0x26d6f2){return _0x26d6f2[_0x844e('0x32')]()[_0x844e('0x1d')](function(){var _0x599aed=_0x26d6f2[_0x844e('0x33')]({'plain':!![]});var _0x1592fb='Contexts';return db[_0x844e('0x34')][_0x844e('0x32')]({'where':{'type':_0x1592fb,'resourceId':_0x599aed['id']}})['then'](function(){return _0x26d6f2;});})[_0x844e('0x1d')](function(){_0x27e5b3[_0x844e('0x27')](0xcc)[_0x844e('0x28')]();});}};}function handleEntityNotFound(_0x3bddbd,_0x672265){return function(_0x3aa8ba){if(!_0x3aa8ba){_0x3bddbd[_0x844e('0x35')](0x194);}return _0x3aa8ba;};}function handleError(_0x4f3768,_0x31d896){_0x31d896=_0x31d896||0x1f4;return function(_0x387723){logger[_0x844e('0x22')](_0x387723[_0x844e('0x36')]);if(_0x387723[_0x844e('0x37')]){delete _0x387723[_0x844e('0x37')];}_0x4f3768[_0x844e('0x27')](_0x31d896)[_0x844e('0x38')](_0x387723);};}exports[_0x844e('0x39')]=function(_0x4155ad,_0x13614e){var _0x5d9544={},_0x5701d5={},_0x3ad6d5={'count':0x0,'rows':[]};var _0x302135=db[_0x844e('0x3a')][_0x844e('0x3b')];_0x5701d5[_0x844e('0x3c')]=_[_0x844e('0x3d')](_0x302135);_0x5701d5[_0x844e('0x3e')]=_[_0x844e('0x3d')](_0x4155ad[_0x844e('0x3e')]);_0x5701d5['filters']=_[_0x844e('0x3f')](_0x5701d5['model'],_0x5701d5[_0x844e('0x3e')]);_0x5d9544['attributes']=_[_0x844e('0x3f')](_0x5701d5['model'],qs[_0x844e('0x40')](_0x4155ad[_0x844e('0x3e')][_0x844e('0x40')]));_0x5d9544[_0x844e('0x41')]=_0x5d9544[_0x844e('0x41')][_0x844e('0x42')]?_0x5d9544[_0x844e('0x41')]:_0x5701d5[_0x844e('0x3c')];if(!_0x4155ad[_0x844e('0x3e')][_0x844e('0x43')](_0x844e('0x44'))){_0x5d9544['limit']=qs[_0x844e('0x2c')](_0x4155ad[_0x844e('0x3e')][_0x844e('0x2c')]);_0x5d9544['offset']=qs['offset'](_0x4155ad[_0x844e('0x3e')][_0x844e('0x2b')]);}_0x5d9544[_0x844e('0x45')]=qs['sort'](_0x4155ad['query']['sort']);_0x5d9544['where']=qs[_0x844e('0x46')](_[_0x844e('0x47')](_0x4155ad[_0x844e('0x3e')],_0x5701d5[_0x844e('0x46')]));if(_0x4155ad[_0x844e('0x3e')]['filter']){_0x5d9544[_0x844e('0x48')]=_['merge'](_0x5d9544['where'],{'$or':_[_0x844e('0x49')](_0x302135,function(_0x50d5d2){if(_0x50d5d2[_0x844e('0x4a')][_0x844e('0x4b')]!=='VIRTUAL'){var _0x1993d2={};_0x1993d2[_0x50d5d2[_0x844e('0x4c')]]={'$like':'%'+_0x4155ad[_0x844e('0x3e')]['filter']+'%'};return _0x1993d2;}})});}_0x5d9544=_[_0x844e('0x4d')]({},_0x5d9544,_0x4155ad[_0x844e('0x4e')]);var _0x558f21={'where':_0x5d9544[_0x844e('0x48')]};return db[_0x844e('0x3a')][_0x844e('0x2a')](_0x558f21)[_0x844e('0x1d')](function(_0x3c5a5e){_0x3ad6d5[_0x844e('0x2a')]=_0x3c5a5e;if(_0x4155ad['query'][_0x844e('0x4f')]){_0x5d9544[_0x844e('0x50')]=[{'all':!![]}];}return db[_0x844e('0x3a')][_0x844e('0x51')](_0x5d9544);})[_0x844e('0x1d')](function(_0x165078){_0x3ad6d5[_0x844e('0x52')]=_0x165078;return _0x3ad6d5;})[_0x844e('0x1d')](respondWithFilteredResult(_0x13614e,_0x5d9544))[_0x844e('0x53')](handleError(_0x13614e,null));};exports[_0x844e('0x54')]=function(_0x4a6924,_0x32e097){var _0x694791={'raw':![],'where':{'id':_0x4a6924['params']['id']}},_0x40410d={};_0x40410d[_0x844e('0x3c')]=_[_0x844e('0x3d')](db[_0x844e('0x3a')][_0x844e('0x3b')]);_0x40410d[_0x844e('0x3e')]=_[_0x844e('0x3d')](_0x4a6924[_0x844e('0x3e')]);_0x40410d['filters']=_[_0x844e('0x3f')](_0x40410d[_0x844e('0x3c')],_0x40410d[_0x844e('0x3e')]);_0x694791[_0x844e('0x41')]=_[_0x844e('0x3f')](_0x40410d[_0x844e('0x3c')],qs[_0x844e('0x40')](_0x4a6924[_0x844e('0x3e')][_0x844e('0x40')]));_0x694791[_0x844e('0x41')]=_0x694791[_0x844e('0x41')][_0x844e('0x42')]?_0x694791[_0x844e('0x41')]:_0x40410d['model'];if(_0x4a6924[_0x844e('0x3e')][_0x844e('0x4f')]){_0x694791[_0x844e('0x50')]=[{'all':!![]}];}_0x694791=_[_0x844e('0x4d')]({},_0x694791,_0x4a6924[_0x844e('0x4e')]);return db[_0x844e('0x3a')]['find'](_0x694791)[_0x844e('0x1d')](handleEntityNotFound(_0x32e097,null))[_0x844e('0x1d')](respondWithResult(_0x32e097,null))['catch'](handleError(_0x32e097,null));};exports[_0x844e('0x55')]=function(_0x2ce166,_0x2e94ac,_0x3355b3){var _0x26eec5;return db[_0x844e('0x3a')][_0x844e('0x55')](_0x2ce166[_0x844e('0x56')],{'raw':!![]})[_0x844e('0x1d')](function(_0x2690fc){_0x26eec5=_0x2690fc;return db[_0x844e('0x3a')][_0x844e('0x51')]({'raw':!![]});})[_0x844e('0x1d')](function(_0x3de2c0){var _0x5e723f=fs[_0x844e('0x57')](path[_0x844e('0x58')](config['root'],_0x844e('0x59')),'utf8');var _0x26186b=ejs[_0x844e('0x5a')](_0x5e723f,{'contexts':_0x3de2c0||[]});fs[_0x844e('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x26186b);})['then'](function(){return respondWithRpcPromise(_0x844e('0x5c'),_0x844e('0x55'),{'module':_0x844e('0x5d')});})[_0x844e('0x1d')](function(){var _0x8fd034=_0x2ce166['user'][_0x844e('0x33')]({'plain':!![]});if(!_0x8fd034)throw new Error(_0x844e('0x5e'));if(_0x8fd034[_0x844e('0x5f')]===_0x844e('0x60')){var _0x59f8ce=_0x26eec5[_0x844e('0x33')]({'plain':!![]});return db[_0x844e('0x61')][_0x844e('0x62')]({'where':{'name':'Contexts','userProfileId':_0x8fd034['userProfileId']},'raw':!![]})[_0x844e('0x1d')](function(_0x25ab9a){if(_0x25ab9a&&_0x25ab9a[_0x844e('0x63')]===0x0){return db['UserProfileResource']['create']({'name':_0x59f8ce[_0x844e('0x37')],'resourceId':_0x59f8ce['id'],'type':_0x25ab9a[_0x844e('0x37')],'sectionId':_0x25ab9a['id']},{})[_0x844e('0x1d')](function(){return _0x26eec5;});}else{return _0x26eec5;}})['catch'](function(_0x18834e){logger[_0x844e('0x22')](_0x844e('0x64'),_0x18834e);throw _0x18834e;});}return _0x26eec5;})['then'](respondWithResult(_0x2e94ac,0xc9))[_0x844e('0x53')](handleError(_0x2e94ac,null));};exports[_0x844e('0x31')]=function(_0x1f2741,_0x3254a1,_0x5521cd){var _0x241b22;return db[_0x844e('0x3a')][_0x844e('0x62')]({'where':{'id':_0x1f2741[_0x844e('0x65')]['id']}})[_0x844e('0x1d')](handleEntityNotFound(_0x3254a1,null))[_0x844e('0x1d')](saveUpdates(_0x1f2741[_0x844e('0x56')],null))[_0x844e('0x1d')](function(_0x53c07c){if(_0x53c07c){_0x241b22=_0x53c07c;return db['VoiceContext'][_0x844e('0x51')]({'raw':!![]});}})['then'](function(_0x252ff9){var _0x3bde32=fs[_0x844e('0x57')](path[_0x844e('0x58')](config['root'],'server/files/templates/context.ejs'),'utf8');var _0x4e4ece=ejs['render'](_0x3bde32,{'contexts':_0x252ff9||[]});fs['writeFileSync'](_0x844e('0x66'),_0x4e4ece);})[_0x844e('0x1d')](function(){return respondWithRpcPromise(_0x844e('0x5c'),'update',{'module':_0x844e('0x5d')});})[_0x844e('0x1d')](function(){return _0x241b22;})['then'](respondWithResult(_0x3254a1,null))[_0x844e('0x53')](handleError(_0x3254a1,null));};exports['destroy']=function(_0x30749c,_0x231136,_0x31ac08){var _0x361e36;return db['VoiceContext']['find']({'where':{'id':_0x30749c['params']['id']}})[_0x844e('0x1d')](handleEntityNotFound(_0x231136,null))[_0x844e('0x1d')](removeEntity(_0x231136,null))[_0x844e('0x1d')](function(){return db[_0x844e('0x3a')][_0x844e('0x51')]({'raw':!![]});})['then'](function(_0x566718){var _0x20b880=fs[_0x844e('0x57')](path[_0x844e('0x58')](config[_0x844e('0x67')],_0x844e('0x59')),_0x844e('0x68'));var _0x537dc5=ejs[_0x844e('0x5a')](_0x20b880,{'contexts':_0x566718});fs[_0x844e('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x537dc5);return respondWithRpcPromise(_0x844e('0x5c'),_0x844e('0x32'),{'module':'chan_sip.so'});})['catch'](handleError(_0x231136,null));}; \ No newline at end of file +var _0xa630=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','Contexts','UserProfileResource','sendStatus','stack','name','index','VoiceContext','rawAttributes','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','map','key','field','options','includeAll','include','findAll','rows','show','params','find','body','readFileSync','root','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','create','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','render','destroy','join','html-pdf','eml-format','fast-json-patch','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x4a75ea,_0x12ccc2){var _0x2ea257=function(_0x33c630){while(--_0x33c630){_0x4a75ea['push'](_0x4a75ea['shift']());}};_0x2ea257(++_0x12ccc2);}(_0xa630,0xbe));var _0x0a63=function(_0x1a80f9,_0x3b5e4b){_0x1a80f9=_0x1a80f9-0x0;var _0xd70b78=_0xa630[_0x1a80f9];return _0xd70b78;};'use strict';var pdf=require(_0x0a63('0x0'));var emlformat=require(_0x0a63('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0a63('0x2'));var rp=require('request-promise');var moment=require(_0x0a63('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a63('0x4'));var util=require(_0x0a63('0x5'));var path=require(_0x0a63('0x6'));var sox=require(_0x0a63('0x7'));var csv=require(_0x0a63('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0a63('0x9'));var squel=require(_0x0a63('0xa'));var crypto=require(_0x0a63('0xb'));var jsforce=require(_0x0a63('0xc'));var deskjs=require(_0x0a63('0xd'));var toCsv=require(_0x0a63('0x8'));var querystring=require('querystring');var Papa=require(_0x0a63('0xe'));var Redis=require(_0x0a63('0xf'));var authService=require(_0x0a63('0x10'));var qs=require(_0x0a63('0x11'));var hardwareService=require(_0x0a63('0x12'));var logger=require(_0x0a63('0x13'))(_0x0a63('0x14'));var utils=require(_0x0a63('0x15'));var config=require(_0x0a63('0x16'));var db=require(_0x0a63('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x0a63('0x18')][_0x0a63('0x19')]({'port':0x232a});function checkPasswordPattern(_0x2fce86,_0x3d6323,_0x55cb2f){if(_0x55cb2f){var _0x23f655=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x23f655['test'](_0x3d6323)){return _0x2fce86;}else{throw new Error(_0x0a63('0x1a'));}}else{return _0x2fce86;}}function respondWithRpcPromise(_0x19e922,_0x26b2bc,_0x23f8b5,_0x3ea3bb){return new BPromise(function(_0x23b49d,_0x552b1f){var _0x1e3251=_0x3ea3bb||client;return _0x1e3251['request'](_0x19e922,_0x23f8b5)[_0x0a63('0x1b')](function(_0x56b314){logger[_0x0a63('0x1c')](_0x0a63('0x1d'),_0x26b2bc,_0x0a63('0x1e'));logger[_0x0a63('0x1f')](_0x0a63('0x20'),_0x26b2bc,_0x0a63('0x1e'),JSON[_0x0a63('0x21')](_0x56b314));if(_0x56b314[_0x0a63('0x22')]){if(_0x56b314[_0x0a63('0x22')][_0x0a63('0x23')]===0x1f4){logger[_0x0a63('0x22')]('VoiceContext,\x20%s,\x20%s',_0x26b2bc,_0x56b314['error'][_0x0a63('0x24')]);return _0x552b1f(_0x56b314['error'][_0x0a63('0x24')]);}logger['error'](_0x0a63('0x1d'),_0x26b2bc,_0x56b314[_0x0a63('0x22')][_0x0a63('0x24')]);return _0x23b49d(_0x56b314[_0x0a63('0x22')]['message']);}else{logger[_0x0a63('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x26b2bc,_0x0a63('0x1e'));_0x23b49d(_0x56b314[_0x0a63('0x25')][_0x0a63('0x24')]);}})[_0x0a63('0x26')](function(_0x343273){logger[_0x0a63('0x22')](_0x0a63('0x1d'),_0x26b2bc,_0x343273);_0x552b1f(_0x343273);});});}function respondWithStatusCode(_0x53c6e3,_0x567017){_0x567017=_0x567017||0xcc;return function(_0x5e5987){if(_0x5e5987){return _0x53c6e3['sendStatus'](_0x567017);}return _0x53c6e3['status'](_0x567017)[_0x0a63('0x27')]();};}function respondWithResult(_0x4916b1,_0x496c93){_0x496c93=_0x496c93||0xc8;return function(_0x2133cf){if(_0x2133cf){return _0x4916b1[_0x0a63('0x28')](_0x496c93)[_0x0a63('0x29')](_0x2133cf);}};}function respondWithFilteredResult(_0x2e2526,_0x52e7ef){return function(_0x402692){if(_0x402692){var _0x498371=_0x402692[_0x0a63('0x2a')],_0x25ab82=_0x52e7ef[_0x0a63('0x2b')],_0x5772f8=_0x52e7ef[_0x0a63('0x2b')]+_0x52e7ef[_0x0a63('0x2c')],_0x34239b;if(_0x5772f8>=_0x498371){_0x5772f8=_0x498371;_0x34239b=0xc8;}else{_0x34239b=0xce;}_0x2e2526[_0x0a63('0x28')](_0x34239b);return _0x2e2526[_0x0a63('0x2d')](_0x0a63('0x2e'),_0x25ab82+'-'+_0x5772f8+'/'+_0x498371)['json'](_0x402692);}return null;};}function patchUpdates(_0x58cc71){return function(_0x574c06){try{jsonpatch[_0x0a63('0x2f')](_0x574c06,_0x58cc71,!![]);}catch(_0xc8caf6){return BPromise[_0x0a63('0x30')](_0xc8caf6);}return _0x574c06[_0x0a63('0x31')]();};}function saveUpdates(_0x80e408,_0x53a46b){return function(_0x22a70a){if(_0x22a70a){return _0x22a70a[_0x0a63('0x32')](_0x80e408)[_0x0a63('0x1b')](function(_0x46fb40){return _0x46fb40;});}return null;};}function removeEntity(_0x59d06c,_0x28f321){return function(_0x28b3b4){if(_0x28b3b4){return _0x28b3b4['destroy']()['then'](function(){var _0x34a170=_0x28b3b4['get']({'plain':!![]});var _0x5708fc=_0x0a63('0x33');return db[_0x0a63('0x34')]['destroy']({'where':{'type':_0x5708fc,'resourceId':_0x34a170['id']}})[_0x0a63('0x1b')](function(){return _0x28b3b4;});})[_0x0a63('0x1b')](function(){_0x59d06c[_0x0a63('0x28')](0xcc)[_0x0a63('0x27')]();});}};}function handleEntityNotFound(_0x395cce,_0x4dcacb){return function(_0x5c7b56){if(!_0x5c7b56){_0x395cce[_0x0a63('0x35')](0x194);}return _0x5c7b56;};}function handleError(_0x15429e,_0x14ab42){_0x14ab42=_0x14ab42||0x1f4;return function(_0x245179){logger[_0x0a63('0x22')](_0x245179[_0x0a63('0x36')]);if(_0x245179['name']){delete _0x245179[_0x0a63('0x37')];}_0x15429e[_0x0a63('0x28')](_0x14ab42)['send'](_0x245179);};}exports[_0x0a63('0x38')]=function(_0x5b62b7,_0x4ed1e1){var _0x283465={},_0x232388={},_0xdc602c={'count':0x0,'rows':[]};var _0x4ae850=db[_0x0a63('0x39')][_0x0a63('0x3a')];_0x232388[_0x0a63('0x3b')]=_[_0x0a63('0x3c')](_0x4ae850);_0x232388[_0x0a63('0x3d')]=_[_0x0a63('0x3c')](_0x5b62b7[_0x0a63('0x3d')]);_0x232388['filters']=_[_0x0a63('0x3e')](_0x232388[_0x0a63('0x3b')],_0x232388[_0x0a63('0x3d')]);_0x283465['attributes']=_['intersection'](_0x232388[_0x0a63('0x3b')],qs['fields'](_0x5b62b7[_0x0a63('0x3d')][_0x0a63('0x3f')]));_0x283465[_0x0a63('0x40')]=_0x283465['attributes'][_0x0a63('0x41')]?_0x283465[_0x0a63('0x40')]:_0x232388[_0x0a63('0x3b')];if(!_0x5b62b7[_0x0a63('0x3d')]['hasOwnProperty'](_0x0a63('0x42'))){_0x283465[_0x0a63('0x2c')]=qs[_0x0a63('0x2c')](_0x5b62b7[_0x0a63('0x3d')][_0x0a63('0x2c')]);_0x283465[_0x0a63('0x2b')]=qs['offset'](_0x5b62b7[_0x0a63('0x3d')][_0x0a63('0x2b')]);}_0x283465[_0x0a63('0x43')]=qs[_0x0a63('0x44')](_0x5b62b7[_0x0a63('0x3d')][_0x0a63('0x44')]);_0x283465[_0x0a63('0x45')]=qs[_0x0a63('0x46')](_[_0x0a63('0x47')](_0x5b62b7[_0x0a63('0x3d')],_0x232388[_0x0a63('0x46')]));if(_0x5b62b7[_0x0a63('0x3d')][_0x0a63('0x48')]){_0x283465[_0x0a63('0x45')]=_[_0x0a63('0x49')](_0x283465[_0x0a63('0x45')],{'$or':_[_0x0a63('0x4a')](_0x4ae850,function(_0x32d387){if(_0x32d387['type'][_0x0a63('0x4b')]!=='VIRTUAL'){var _0x5b9d72={};_0x5b9d72[_0x32d387[_0x0a63('0x4c')]]={'$like':'%'+_0x5b62b7[_0x0a63('0x3d')][_0x0a63('0x48')]+'%'};return _0x5b9d72;}})});}_0x283465=_[_0x0a63('0x49')]({},_0x283465,_0x5b62b7[_0x0a63('0x4d')]);var _0x9c89ed={'where':_0x283465[_0x0a63('0x45')]};return db[_0x0a63('0x39')][_0x0a63('0x2a')](_0x9c89ed)[_0x0a63('0x1b')](function(_0x9e5009){_0xdc602c[_0x0a63('0x2a')]=_0x9e5009;if(_0x5b62b7[_0x0a63('0x3d')][_0x0a63('0x4e')]){_0x283465[_0x0a63('0x4f')]=[{'all':!![]}];}return db[_0x0a63('0x39')][_0x0a63('0x50')](_0x283465);})[_0x0a63('0x1b')](function(_0x366887){_0xdc602c[_0x0a63('0x51')]=_0x366887;return _0xdc602c;})['then'](respondWithFilteredResult(_0x4ed1e1,_0x283465))[_0x0a63('0x26')](handleError(_0x4ed1e1,null));};exports[_0x0a63('0x52')]=function(_0x5905ce,_0x511b0f){var _0x58e686={'raw':![],'where':{'id':_0x5905ce[_0x0a63('0x53')]['id']}},_0x485f20={};_0x485f20[_0x0a63('0x3b')]=_['keys'](db[_0x0a63('0x39')]['rawAttributes']);_0x485f20[_0x0a63('0x3d')]=_[_0x0a63('0x3c')](_0x5905ce['query']);_0x485f20['filters']=_['intersection'](_0x485f20[_0x0a63('0x3b')],_0x485f20[_0x0a63('0x3d')]);_0x58e686[_0x0a63('0x40')]=_[_0x0a63('0x3e')](_0x485f20[_0x0a63('0x3b')],qs['fields'](_0x5905ce[_0x0a63('0x3d')][_0x0a63('0x3f')]));_0x58e686[_0x0a63('0x40')]=_0x58e686[_0x0a63('0x40')][_0x0a63('0x41')]?_0x58e686['attributes']:_0x485f20[_0x0a63('0x3b')];if(_0x5905ce[_0x0a63('0x3d')][_0x0a63('0x4e')]){_0x58e686[_0x0a63('0x4f')]=[{'all':!![]}];}_0x58e686=_['merge']({},_0x58e686,_0x5905ce[_0x0a63('0x4d')]);return db[_0x0a63('0x39')][_0x0a63('0x54')](_0x58e686)[_0x0a63('0x1b')](handleEntityNotFound(_0x511b0f,null))[_0x0a63('0x1b')](respondWithResult(_0x511b0f,null))[_0x0a63('0x26')](handleError(_0x511b0f,null));};exports['create']=function(_0x7e79e3,_0x200523,_0x33380e){var _0x272b3a;return db['VoiceContext']['create'](_0x7e79e3[_0x0a63('0x55')],{'raw':!![]})[_0x0a63('0x1b')](function(_0x42514e){_0x272b3a=_0x42514e;return db[_0x0a63('0x39')][_0x0a63('0x50')]({'raw':!![]});})['then'](function(_0x5e6aae){var _0x58b3a8=fs[_0x0a63('0x56')](path['join'](config[_0x0a63('0x57')],_0x0a63('0x58')),_0x0a63('0x59'));var _0x5d77e3=ejs['render'](_0x58b3a8,{'contexts':_0x5e6aae||[]});fs[_0x0a63('0x5a')](_0x0a63('0x5b'),_0x5d77e3);})[_0x0a63('0x1b')](function(){return respondWithRpcPromise(_0x0a63('0x5c'),_0x0a63('0x5d'),{'module':_0x0a63('0x5e')});})[_0x0a63('0x1b')](function(){var _0xc3415c=_0x7e79e3[_0x0a63('0x5f')][_0x0a63('0x60')]({'plain':!![]});if(!_0xc3415c)throw new Error(_0x0a63('0x61'));if(_0xc3415c[_0x0a63('0x62')]===_0x0a63('0x5f')){var _0x24727f=_0x272b3a['get']({'plain':!![]});return db['UserProfileSection'][_0x0a63('0x54')]({'where':{'name':_0x0a63('0x33'),'userProfileId':_0xc3415c['userProfileId']},'raw':!![]})[_0x0a63('0x1b')](function(_0x24fae8){if(_0x24fae8&&_0x24fae8['autoAssociation']===0x0){return db[_0x0a63('0x34')][_0x0a63('0x5d')]({'name':_0x24727f['name'],'resourceId':_0x24727f['id'],'type':_0x24fae8['name'],'sectionId':_0x24fae8['id']},{})[_0x0a63('0x1b')](function(){return _0x272b3a;});}else{return _0x272b3a;}})[_0x0a63('0x26')](function(_0x2d0d9a){logger['error'](_0x0a63('0x63'),_0x2d0d9a);throw _0x2d0d9a;});}return _0x272b3a;})[_0x0a63('0x1b')](respondWithResult(_0x200523,0xc9))[_0x0a63('0x26')](handleError(_0x200523,null));};exports[_0x0a63('0x32')]=function(_0x15fc2e,_0x5a1a9c,_0x2d6a76){var _0x28becf;return db[_0x0a63('0x39')][_0x0a63('0x54')]({'where':{'id':_0x15fc2e[_0x0a63('0x53')]['id']}})[_0x0a63('0x1b')](handleEntityNotFound(_0x5a1a9c,null))[_0x0a63('0x1b')](saveUpdates(_0x15fc2e['body'],null))[_0x0a63('0x1b')](function(_0x1e25cd){if(_0x1e25cd){_0x28becf=_0x1e25cd;return db[_0x0a63('0x39')][_0x0a63('0x50')]({'raw':!![]});}})[_0x0a63('0x1b')](function(_0xf814c7){var _0x4c4f98=fs[_0x0a63('0x56')](path['join'](config['root'],_0x0a63('0x58')),_0x0a63('0x59'));var _0x4137bc=ejs[_0x0a63('0x64')](_0x4c4f98,{'contexts':_0xf814c7||[]});fs[_0x0a63('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4137bc);})[_0x0a63('0x1b')](function(){return respondWithRpcPromise(_0x0a63('0x5c'),_0x0a63('0x32'),{'module':_0x0a63('0x5e')});})[_0x0a63('0x1b')](function(){return _0x28becf;})[_0x0a63('0x1b')](respondWithResult(_0x5a1a9c,null))[_0x0a63('0x26')](handleError(_0x5a1a9c,null));};exports[_0x0a63('0x65')]=function(_0x3d9dce,_0x35083d,_0x4acde8){var _0x485969;return db[_0x0a63('0x39')]['find']({'where':{'id':_0x3d9dce[_0x0a63('0x53')]['id']}})[_0x0a63('0x1b')](handleEntityNotFound(_0x35083d,null))['then'](removeEntity(_0x35083d,null))['then'](function(){return db['VoiceContext'][_0x0a63('0x50')]({'raw':!![]});})[_0x0a63('0x1b')](function(_0x3f28e3){var _0x4684dc=fs[_0x0a63('0x56')](path[_0x0a63('0x66')](config['root'],'server/files/templates/context.ejs'),'utf8');var _0x1213a5=ejs[_0x0a63('0x64')](_0x4684dc,{'contexts':_0x3f28e3});fs[_0x0a63('0x5a')](_0x0a63('0x5b'),_0x1213a5);return respondWithRpcPromise('Reload',_0x0a63('0x65'),{'module':'chan_sip.so'});})['catch'](handleError(_0x35083d,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 574f88a..cea8adc 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 _0x5ca1=['VoiceContext','voice_contexts','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./voiceContext.attributes','exports','define'];(function(_0x4c8201,_0x248e60){var _0x575832=function(_0x3f7ed1){while(--_0x3f7ed1){_0x4c8201['push'](_0x4c8201['shift']());}};_0x575832(++_0x248e60);}(_0x5ca1,0x13a));var _0x15ca=function(_0x33e776,_0x90f1fd){_0x33e776=_0x33e776-0x0;var _0xc32c2a=_0x5ca1[_0x33e776];return _0xc32c2a;};'use strict';var _=require(_0x15ca('0x0'));var util=require(_0x15ca('0x1'));var logger=require(_0x15ca('0x2'))('api');var moment=require(_0x15ca('0x3'));var BPromise=require('bluebird');var rp=require(_0x15ca('0x4'));var fs=require('fs');var path=require(_0x15ca('0x5'));var rimraf=require(_0x15ca('0x6'));var config=require('../../config/environment');var attributes=require(_0x15ca('0x7'));module[_0x15ca('0x8')]=function(_0x5ec1da,_0x3771a5){return _0x5ec1da[_0x15ca('0x9')](_0x15ca('0xa'),attributes,{'tableName':_0x15ca('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06a1=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','define','VoiceContext','voice_contexts','lodash'];(function(_0x1cca94,_0x320ef2){var _0x2ab1d5=function(_0x5ed0b5){while(--_0x5ed0b5){_0x1cca94['push'](_0x1cca94['shift']());}};_0x2ab1d5(++_0x320ef2);}(_0x06a1,0x78));var _0x106a=function(_0x67ed97,_0x374cce){_0x67ed97=_0x67ed97-0x0;var _0x500996=_0x06a1[_0x67ed97];return _0x500996;};'use strict';var _=require(_0x106a('0x0'));var util=require(_0x106a('0x1'));var logger=require(_0x106a('0x2'))(_0x106a('0x3'));var moment=require('moment');var BPromise=require(_0x106a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x106a('0x5'));var rimraf=require(_0x106a('0x6'));var config=require(_0x106a('0x7'));var attributes=require('./voiceContext.attributes');module['exports']=function(_0x5ab5ac,_0x35db20){return _0x5ab5ac[_0x106a('0x8')](_0x106a('0x9'),attributes,{'tableName':_0x106a('0xa'),'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 a27cd0b..1517f58 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 _0x0599=['debug','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceContext,\x20%s,\x20%s'];(function(_0x408508,_0x3c3740){var _0x30fbf6=function(_0x256fd7){while(--_0x256fd7){_0x408508['push'](_0x408508['shift']());}};_0x30fbf6(++_0x3c3740);}(_0x0599,0xc0));var _0x9059=function(_0x1d92b2,_0x33c480){_0x1d92b2=_0x1d92b2-0x0;var _0x317904=_0x0599[_0x1d92b2];return _0x317904;};'use strict';var _=require(_0x9059('0x0'));var util=require('util');var moment=require(_0x9059('0x1'));var BPromise=require(_0x9059('0x2'));var rs=require(_0x9059('0x3'));var fs=require('fs');var Redis=require(_0x9059('0x4'));var db=require(_0x9059('0x5'))['db'];var utils=require(_0x9059('0x6'));var logger=require(_0x9059('0x7'))(_0x9059('0x8'));var config=require(_0x9059('0x9'));var jayson=require(_0x9059('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x22191c,_0x2959fd,_0x57b102){return new BPromise(function(_0xaae9bd,_0x4bef96){return client[_0x9059('0xb')](_0x22191c,_0x57b102)[_0x9059('0xc')](function(_0x11251f){logger[_0x9059('0xd')](_0x9059('0xe'),_0x2959fd,'request\x20sent');logger[_0x9059('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x2959fd,_0x9059('0x10'),JSON[_0x9059('0x11')](_0x11251f));if(_0x11251f[_0x9059('0x12')]){if(_0x11251f[_0x9059('0x12')][_0x9059('0x13')]===0x1f4){logger[_0x9059('0x12')](_0x9059('0xe'),_0x2959fd,_0x11251f[_0x9059('0x12')][_0x9059('0x14')]);return _0x4bef96(_0x11251f[_0x9059('0x12')][_0x9059('0x14')]);}logger[_0x9059('0x12')](_0x9059('0xe'),_0x2959fd,_0x11251f[_0x9059('0x12')][_0x9059('0x14')]);return _0xaae9bd(_0x11251f[_0x9059('0x12')][_0x9059('0x14')]);}else{logger[_0x9059('0xd')]('VoiceContext,\x20%s,\x20%s',_0x2959fd,_0x9059('0x10'));_0xaae9bd(_0x11251f[_0x9059('0x15')][_0x9059('0x14')]);}})[_0x9059('0x16')](function(_0x228acc){logger[_0x9059('0x12')]('VoiceContext,\x20%s,\x20%s',_0x2959fd,_0x228acc);_0x4bef96(_0x228acc);});});} \ No newline at end of file +var _0xf919=['lodash','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x564b0a,_0x4dd651){var _0x350a24=function(_0x200bb4){while(--_0x200bb4){_0x564b0a['push'](_0x564b0a['shift']());}};_0x350a24(++_0x4dd651);}(_0xf919,0x130));var _0x9f91=function(_0x24b477,_0x30393b){_0x24b477=_0x24b477-0x0;var _0x4041a6=_0xf919[_0x24b477];return _0x4041a6;};'use strict';var _=require(_0x9f91('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f91('0x1'))['db'];var utils=require(_0x9f91('0x2'));var logger=require(_0x9f91('0x3'))(_0x9f91('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9f91('0x5')][_0x9f91('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x15e4ca,_0x47c0f7,_0x3fc210){return new BPromise(function(_0x595e5b,_0x29e680){return client['request'](_0x15e4ca,_0x3fc210)[_0x9f91('0x7')](function(_0x29fd33){logger[_0x9f91('0x8')](_0x9f91('0x9'),_0x47c0f7,_0x9f91('0xa'));logger[_0x9f91('0xb')](_0x9f91('0xc'),_0x47c0f7,_0x9f91('0xa'),JSON[_0x9f91('0xd')](_0x29fd33));if(_0x29fd33[_0x9f91('0xe')]){if(_0x29fd33[_0x9f91('0xe')][_0x9f91('0xf')]===0x1f4){logger[_0x9f91('0xe')](_0x9f91('0x9'),_0x47c0f7,_0x29fd33['error'][_0x9f91('0x10')]);return _0x29e680(_0x29fd33[_0x9f91('0xe')]['message']);}logger['error'](_0x9f91('0x9'),_0x47c0f7,_0x29fd33[_0x9f91('0xe')][_0x9f91('0x10')]);return _0x595e5b(_0x29fd33[_0x9f91('0xe')][_0x9f91('0x10')]);}else{logger['info'](_0x9f91('0x9'),_0x47c0f7,'request\x20sent');_0x595e5b(_0x29fd33[_0x9f91('0x11')]['message']);}})[_0x9f91('0x12')](function(_0x2f3169){logger[_0x9f91('0xe')](_0x9f91('0x9'),_0x47c0f7,_0x2f3169);_0x29e680(_0x2f3169);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index b316acb..3960fdc 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 _0x41c9=['get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller'];(function(_0x3c32d4,_0x5f4ccb){var _0x39a2e5=function(_0x221b2a){while(--_0x221b2a){_0x3c32d4['push'](_0x3c32d4['shift']());}};_0x39a2e5(++_0x5f4ccb);}(_0x41c9,0x1f2));var _0x941c=function(_0x245b40,_0x3df136){_0x245b40=_0x245b40-0x0;var _0x4e5dbd=_0x41c9[_0x245b40];return _0x4e5dbd;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x941c('0x0'));var express=require(_0x941c('0x1'));var router=express[_0x941c('0x2')]();var auth=require(_0x941c('0x3'));var interaction=require(_0x941c('0x4'));var config=require('../../config/environment');var controller=require(_0x941c('0x5'));router[_0x941c('0x6')]('/',auth[_0x941c('0x7')](),controller[_0x941c('0x8')]);router[_0x941c('0x6')](_0x941c('0x9'),auth[_0x941c('0x7')](),controller[_0x941c('0xa')]);router[_0x941c('0x6')](_0x941c('0xb'),auth[_0x941c('0x7')](),controller[_0x941c('0xc')]);router['post']('/',auth[_0x941c('0x7')](),controller[_0x941c('0xd')]);router[_0x941c('0xe')](_0x941c('0xb'),auth[_0x941c('0x7')](),controller[_0x941c('0xf')]);router['delete'](_0x941c('0xb'),auth['isAuthenticated'](),controller[_0x941c('0x10')]);module[_0x941c('0x11')]=router; \ No newline at end of file +var _0x958f=['index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated'];(function(_0x4d2b3f,_0x408d7e){var _0x47bef1=function(_0x42dc60){while(--_0x42dc60){_0x4d2b3f['push'](_0x4d2b3f['shift']());}};_0x47bef1(++_0x408d7e);}(_0x958f,0x1c0));var _0xf958=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x958f[_0x40220a];return _0x3903cc;};'use strict';var multer=require(_0xf958('0x0'));var util=require(_0xf958('0x1'));var path=require(_0xf958('0x2'));var timeout=require(_0xf958('0x3'));var express=require(_0xf958('0x4'));var router=express[_0xf958('0x5')]();var auth=require(_0xf958('0x6'));var interaction=require(_0xf958('0x7'));var config=require(_0xf958('0x8'));var controller=require(_0xf958('0x9'));router[_0xf958('0xa')]('/',auth[_0xf958('0xb')](),controller[_0xf958('0xc')]);router[_0xf958('0xa')](_0xf958('0xd'),auth[_0xf958('0xb')](),controller[_0xf958('0xe')]);router[_0xf958('0xa')](_0xf958('0xf'),auth[_0xf958('0xb')](),controller['show']);router[_0xf958('0x10')]('/',auth[_0xf958('0xb')](),controller[_0xf958('0x11')]);router[_0xf958('0x12')]('/:id',auth[_0xf958('0xb')](),controller[_0xf958('0x13')]);router[_0xf958('0x14')](_0xf958('0xf'),auth[_0xf958('0xb')](),controller[_0xf958('0x15')]);module[_0xf958('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 71e4cd5..14412e6 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 _0xf58b=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x26241c,_0x199d30){var _0x153ae9=function(_0xef71de){while(--_0xef71de){_0x26241c['push'](_0x26241c['shift']());}};_0x153ae9(++_0x199d30);}(_0xf58b,0x1bc));var _0xbf58=function(_0x3a833e,_0x5a1878){_0x3a833e=_0x3a833e-0x0;var _0xdff445=_0xf58b[_0x3a833e];return _0xdff445;};'use strict';var Sequelize=require(_0xbf58('0x0'));module[_0xbf58('0x1')]={'privilege':{'type':Sequelize[_0xbf58('0x2')]},'channel':{'type':Sequelize[_0xbf58('0x2')]},'channelstate':{'type':Sequelize[_0xbf58('0x3')]},'channelstatedesc':{'type':Sequelize[_0xbf58('0x2')]},'calleridnum':{'type':Sequelize[_0xbf58('0x2')]},'calleridname':{'type':Sequelize[_0xbf58('0x2')]},'connectedlinenum':{'type':Sequelize[_0xbf58('0x2')]},'connectedlinename':{'type':Sequelize[_0xbf58('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xbf58('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xbf58('0x2')]},'priority':{'type':Sequelize[_0xbf58('0x3')]},'uniqueid':{'type':Sequelize[_0xbf58('0x2')]},'linkedid':{'type':Sequelize[_0xbf58('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xbf58('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xbf58('0x2')]},'destcalleridnum':{'type':Sequelize[_0xbf58('0x2')]},'destcalleridname':{'type':Sequelize[_0xbf58('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xbf58('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xbf58('0x2')]},'destlanguage':{'type':Sequelize[_0xbf58('0x2')]},'destaccountcode':{'type':Sequelize[_0xbf58('0x2')]},'destcontext':{'type':Sequelize[_0xbf58('0x2')]},'destexten':{'type':Sequelize[_0xbf58('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xbf58('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xbf58('0x4')]},'answertime':{'type':Sequelize[_0xbf58('0x4')]},'endtime':{'type':Sequelize[_0xbf58('0x4')]},'lastevent':{'type':Sequelize[_0xbf58('0x2')],'comment':_0xbf58('0x5')},'routeId':{'type':Sequelize[_0xbf58('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xbf58('0x3')]},'billableseconds':{'type':Sequelize[_0xbf58('0x3')]}}; \ No newline at end of file +var _0x5956=['DATE','sequelize','exports','STRING','INTEGER'];(function(_0x4e4e25,_0x200975){var _0xbd68c0=function(_0x215f58){while(--_0x215f58){_0x4e4e25['push'](_0x4e4e25['shift']());}};_0xbd68c0(++_0x200975);}(_0x5956,0x65));var _0x6595=function(_0x1972ee,_0x4709d6){_0x1972ee=_0x1972ee-0x0;var _0x56117f=_0x5956[_0x1972ee];return _0x56117f;};'use strict';var Sequelize=require(_0x6595('0x0'));module[_0x6595('0x1')]={'privilege':{'type':Sequelize[_0x6595('0x2')]},'channel':{'type':Sequelize[_0x6595('0x2')]},'channelstate':{'type':Sequelize[_0x6595('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6595('0x2')]},'connectedlinenum':{'type':Sequelize[_0x6595('0x2')]},'connectedlinename':{'type':Sequelize[_0x6595('0x2')]},'language':{'type':Sequelize[_0x6595('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x6595('0x3')]},'uniqueid':{'type':Sequelize[_0x6595('0x2')]},'linkedid':{'type':Sequelize[_0x6595('0x2')]},'destchannel':{'type':Sequelize[_0x6595('0x2')]},'destchannelstate':{'type':Sequelize[_0x6595('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x6595('0x2')]},'destcalleridname':{'type':Sequelize[_0x6595('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x6595('0x2')]},'destlanguage':{'type':Sequelize[_0x6595('0x2')]},'destaccountcode':{'type':Sequelize[_0x6595('0x2')]},'destcontext':{'type':Sequelize[_0x6595('0x2')]},'destexten':{'type':Sequelize[_0x6595('0x2')]},'destpriority':{'type':Sequelize[_0x6595('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x6595('0x2')]},'dialstring':{'type':Sequelize[_0x6595('0x2')]},'dialstatus':{'type':Sequelize[_0x6595('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x6595('0x4')]},'endtime':{'type':Sequelize[_0x6595('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x6595('0x3')]},'duration':{'type':Sequelize[_0x6595('0x3')]},'holdtime':{'type':Sequelize[_0x6595('0x3')]},'billableseconds':{'type':Sequelize[_0x6595('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 971a7d5..69e5b2d 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 _0x710d=['filters','filter','merge','type','key','field','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','index','VoiceDialReport','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x255ac0,_0x3f6645){var _0x437bf1=function(_0x5baff0){while(--_0x5baff0){_0x255ac0['push'](_0x255ac0['shift']());}};_0x437bf1(++_0x3f6645);}(_0x710d,0xd1));var _0xd710=function(_0x4d7116,_0xdb8175){_0x4d7116=_0x4d7116-0x0;var _0x4593dc=_0x710d[_0x4d7116];return _0x4593dc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd710('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd710('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd710('0x2'));var moment=require(_0xd710('0x3'));var BPromise=require(_0xd710('0x4'));var Mustache=require(_0xd710('0x5'));var util=require('util');var path=require(_0xd710('0x6'));var sox=require(_0xd710('0x7'));var csv=require(_0xd710('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd710('0x9'));var jsforce=require(_0xd710('0xa'));var deskjs=require(_0xd710('0xb'));var toCsv=require(_0xd710('0x8'));var querystring=require(_0xd710('0xc'));var Papa=require(_0xd710('0xd'));var Redis=require(_0xd710('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd710('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xd710('0x10'));var config=require(_0xd710('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17e84f,_0x122d12){_0x122d12=_0x122d12||0xcc;return function(_0x19ec3d){if(_0x19ec3d){return _0x17e84f[_0xd710('0x12')](_0x122d12);}return _0x17e84f[_0xd710('0x13')](_0x122d12)[_0xd710('0x14')]();};}function respondWithResult(_0x2cf195,_0x164997){_0x164997=_0x164997||0xc8;return function(_0x3e32ec){if(_0x3e32ec){return _0x2cf195[_0xd710('0x13')](_0x164997)[_0xd710('0x15')](_0x3e32ec);}};}function respondWithFilteredResult(_0xddd3d,_0x526207){return function(_0x32efb7){if(_0x32efb7){var _0x44d479=_0x32efb7[_0xd710('0x16')],_0x4d36d7=_0x526207[_0xd710('0x17')],_0xb62fe=_0x526207[_0xd710('0x17')]+_0x526207[_0xd710('0x18')],_0x34f3e0;if(_0xb62fe>=_0x44d479){_0xb62fe=_0x44d479;_0x34f3e0=0xc8;}else{_0x34f3e0=0xce;}_0xddd3d['status'](_0x34f3e0);return _0xddd3d[_0xd710('0x19')]('Content-Range',_0x4d36d7+'-'+_0xb62fe+'/'+_0x44d479)[_0xd710('0x15')](_0x32efb7);}return null;};}function patchUpdates(_0x1c2b46){return function(_0x2e82a9){try{jsonpatch[_0xd710('0x1a')](_0x2e82a9,_0x1c2b46,!![]);}catch(_0x5357a3){return BPromise[_0xd710('0x1b')](_0x5357a3);}return _0x2e82a9[_0xd710('0x1c')]();};}function saveUpdates(_0x433c6a,_0x20481c){return function(_0x5e7997){if(_0x5e7997){return _0x5e7997[_0xd710('0x1d')](_0x433c6a)[_0xd710('0x1e')](function(_0x1f1ed1){return _0x1f1ed1;});}return null;};}function removeEntity(_0x1c111a,_0x4e2d4c){return function(_0x2a88e7){if(_0x2a88e7){return _0x2a88e7[_0xd710('0x1f')]()['then'](function(){_0x1c111a[_0xd710('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b8df8,_0x5d8459){return function(_0x4c9a29){if(!_0x4c9a29){_0x4b8df8[_0xd710('0x12')](0x194);}return _0x4c9a29;};}function handleError(_0x308608,_0xf64e82){_0xf64e82=_0xf64e82||0x1f4;return function(_0x1f7ad0){logger[_0xd710('0x20')](_0x1f7ad0['stack']);if(_0x1f7ad0[_0xd710('0x21')]){delete _0x1f7ad0[_0xd710('0x21')];}_0x308608['status'](_0xf64e82)['send'](_0x1f7ad0);};}exports[_0xd710('0x22')]=function(_0x47e157,_0x109e2f){var _0x540dad={},_0x544f2b={},_0x2197ad={'count':0x0,'rows':[]};var _0x5ab9e7=db[_0xd710('0x23')]['rawAttributes'];_0x544f2b[_0xd710('0x24')]=_[_0xd710('0x25')](_0x5ab9e7);_0x544f2b[_0xd710('0x26')]=_[_0xd710('0x25')](_0x47e157[_0xd710('0x26')]);_0x544f2b['filters']=_[_0xd710('0x27')](_0x544f2b[_0xd710('0x24')],_0x544f2b[_0xd710('0x26')]);_0x540dad[_0xd710('0x28')]=_[_0xd710('0x27')](_0x544f2b[_0xd710('0x24')],qs[_0xd710('0x29')](_0x47e157[_0xd710('0x26')][_0xd710('0x29')]));_0x540dad[_0xd710('0x28')]=_0x540dad[_0xd710('0x28')]['length']?_0x540dad[_0xd710('0x28')]:_0x544f2b[_0xd710('0x24')];if(!_0x47e157[_0xd710('0x26')][_0xd710('0x2a')](_0xd710('0x2b'))){_0x540dad[_0xd710('0x18')]=qs[_0xd710('0x18')](_0x47e157['query'][_0xd710('0x18')]);_0x540dad[_0xd710('0x17')]=qs['offset'](_0x47e157[_0xd710('0x26')][_0xd710('0x17')]);}_0x540dad[_0xd710('0x2c')]=qs['sort'](_0x47e157['query'][_0xd710('0x2d')]);_0x540dad[_0xd710('0x2e')]=qs[_0xd710('0x2f')](_['pick'](_0x47e157[_0xd710('0x26')],_0x544f2b[_0xd710('0x2f')]));if(_0x47e157['query'][_0xd710('0x30')]){_0x540dad['where']=_[_0xd710('0x31')](_0x540dad[_0xd710('0x2e')],{'$or':_['map'](_0x5ab9e7,function(_0x6df517){if(_0x6df517[_0xd710('0x32')][_0xd710('0x33')]!=='VIRTUAL'){var _0x1e0bd3={};_0x1e0bd3[_0x6df517[_0xd710('0x34')]]={'$like':'%'+_0x47e157[_0xd710('0x26')][_0xd710('0x30')]+'%'};return _0x1e0bd3;}})});}_0x540dad=_[_0xd710('0x31')]({},_0x540dad,_0x47e157[_0xd710('0x35')]);var _0x393fb8={'where':_0x540dad[_0xd710('0x2e')]};return db[_0xd710('0x23')][_0xd710('0x16')](_0x393fb8)[_0xd710('0x1e')](function(_0x4089ca){_0x2197ad[_0xd710('0x16')]=_0x4089ca;if(_0x47e157[_0xd710('0x26')][_0xd710('0x36')]){_0x540dad[_0xd710('0x37')]=[{'all':!![]}];}return db[_0xd710('0x23')][_0xd710('0x38')](_0x540dad);})['then'](function(_0x1b4c6d){_0x2197ad['rows']=_0x1b4c6d;return _0x2197ad;})[_0xd710('0x1e')](respondWithFilteredResult(_0x109e2f,_0x540dad))[_0xd710('0x39')](handleError(_0x109e2f,null));};exports[_0xd710('0x3a')]=function(_0x5b1a61,_0x1facc5){var _0xf1dbb4={'raw':!![],'where':{'id':_0x5b1a61[_0xd710('0x3b')]['id']}},_0x57afce={};_0x57afce[_0xd710('0x24')]=_['keys'](db[_0xd710('0x23')]['rawAttributes']);_0x57afce['query']=_[_0xd710('0x25')](_0x5b1a61[_0xd710('0x26')]);_0x57afce[_0xd710('0x2f')]=_[_0xd710('0x27')](_0x57afce[_0xd710('0x24')],_0x57afce[_0xd710('0x26')]);_0xf1dbb4[_0xd710('0x28')]=_[_0xd710('0x27')](_0x57afce[_0xd710('0x24')],qs[_0xd710('0x29')](_0x5b1a61[_0xd710('0x26')]['fields']));_0xf1dbb4[_0xd710('0x28')]=_0xf1dbb4['attributes']['length']?_0xf1dbb4[_0xd710('0x28')]:_0x57afce[_0xd710('0x24')];if(_0x5b1a61[_0xd710('0x26')][_0xd710('0x36')]){_0xf1dbb4[_0xd710('0x37')]=[{'all':!![]}];}_0xf1dbb4=_[_0xd710('0x31')]({},_0xf1dbb4,_0x5b1a61['options']);return db[_0xd710('0x23')][_0xd710('0x3c')](_0xf1dbb4)[_0xd710('0x1e')](handleEntityNotFound(_0x1facc5,null))[_0xd710('0x1e')](respondWithResult(_0x1facc5,null))[_0xd710('0x39')](handleError(_0x1facc5,null));};exports[_0xd710('0x3d')]=function(_0x1db50b,_0x45c037){return db['VoiceDialReport'][_0xd710('0x3d')](_0x1db50b[_0xd710('0x3e')],{})[_0xd710('0x1e')](respondWithResult(_0x45c037,0xc9))[_0xd710('0x39')](handleError(_0x45c037,null));};exports[_0xd710('0x1d')]=function(_0x46fd71,_0x58ae44){if(_0x46fd71['body']['id']){delete _0x46fd71[_0xd710('0x3e')]['id'];}return db[_0xd710('0x23')][_0xd710('0x3c')]({'where':{'id':_0x46fd71['params']['id']}})[_0xd710('0x1e')](handleEntityNotFound(_0x58ae44,null))[_0xd710('0x1e')](saveUpdates(_0x46fd71[_0xd710('0x3e')],null))[_0xd710('0x1e')](respondWithResult(_0x58ae44,null))[_0xd710('0x39')](handleError(_0x58ae44,null));};exports[_0xd710('0x1f')]=function(_0x24f65b,_0x7df9a8){return db[_0xd710('0x23')][_0xd710('0x3c')]({'where':{'id':_0x24f65b[_0xd710('0x3b')]['id']}})[_0xd710('0x1e')](handleEntityNotFound(_0x7df9a8,null))[_0xd710('0x1e')](removeEntity(_0x7df9a8,null))[_0xd710('0x39')](handleError(_0x7df9a8,null));};exports[_0xd710('0x3f')]=function(_0x250e20,_0x5d970a){return db[_0xd710('0x23')]['describe']()[_0xd710('0x1e')](respondWithResult(_0x5d970a,null))['catch'](handleError(_0x5d970a,null));}; \ No newline at end of file +var _0x2850=['rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','VoiceDialReport'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x2850,0x17e));var _0x0285=function(_0x4d74fa,_0x439f20){_0x4d74fa=_0x4d74fa-0x0;var _0x4a3c07=_0x2850[_0x4d74fa];return _0x4a3c07;};'use strict';var pdf=require(_0x0285('0x0'));var emlformat=require(_0x0285('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0285('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0285('0x3'));var Mustache=require(_0x0285('0x4'));var util=require(_0x0285('0x5'));var path=require(_0x0285('0x6'));var sox=require(_0x0285('0x7'));var csv=require(_0x0285('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x0285('0x9'));var crypto=require('crypto');var jsforce=require(_0x0285('0xa'));var deskjs=require(_0x0285('0xb'));var toCsv=require(_0x0285('0x8'));var querystring=require(_0x0285('0xc'));var Papa=require(_0x0285('0xd'));var Redis=require(_0x0285('0xe'));var authService=require(_0x0285('0xf'));var qs=require(_0x0285('0x10'));var hardwareService=require(_0x0285('0x11'));var logger=require(_0x0285('0x12'))(_0x0285('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10e8c1,_0x4dfb5f){_0x4dfb5f=_0x4dfb5f||0xcc;return function(_0x5bae03){if(_0x5bae03){return _0x10e8c1[_0x0285('0x14')](_0x4dfb5f);}return _0x10e8c1['status'](_0x4dfb5f)[_0x0285('0x15')]();};}function respondWithResult(_0x435739,_0x3a8f51){_0x3a8f51=_0x3a8f51||0xc8;return function(_0x5de3c1){if(_0x5de3c1){return _0x435739[_0x0285('0x16')](_0x3a8f51)[_0x0285('0x17')](_0x5de3c1);}};}function respondWithFilteredResult(_0x24ba7c,_0x2ee131){return function(_0x2c6b46){if(_0x2c6b46){var _0x1148ad=_0x2c6b46['count'],_0x19aeca=_0x2ee131[_0x0285('0x18')],_0x3ce33a=_0x2ee131['offset']+_0x2ee131[_0x0285('0x19')],_0x4a6954;if(_0x3ce33a>=_0x1148ad){_0x3ce33a=_0x1148ad;_0x4a6954=0xc8;}else{_0x4a6954=0xce;}_0x24ba7c[_0x0285('0x16')](_0x4a6954);return _0x24ba7c[_0x0285('0x1a')](_0x0285('0x1b'),_0x19aeca+'-'+_0x3ce33a+'/'+_0x1148ad)[_0x0285('0x17')](_0x2c6b46);}return null;};}function patchUpdates(_0x548c2f){return function(_0x46f9b9){try{jsonpatch[_0x0285('0x1c')](_0x46f9b9,_0x548c2f,!![]);}catch(_0x6919a8){return BPromise[_0x0285('0x1d')](_0x6919a8);}return _0x46f9b9[_0x0285('0x1e')]();};}function saveUpdates(_0x4a7f3c,_0xacb750){return function(_0x55250d){if(_0x55250d){return _0x55250d[_0x0285('0x1f')](_0x4a7f3c)[_0x0285('0x20')](function(_0x5f312b){return _0x5f312b;});}return null;};}function removeEntity(_0x34fe73,_0x3077f8){return function(_0x2d576e){if(_0x2d576e){return _0x2d576e[_0x0285('0x21')]()[_0x0285('0x20')](function(){_0x34fe73[_0x0285('0x16')](0xcc)[_0x0285('0x15')]();});}};}function handleEntityNotFound(_0x36df65,_0x351872){return function(_0x3eb24c){if(!_0x3eb24c){_0x36df65['sendStatus'](0x194);}return _0x3eb24c;};}function handleError(_0x23363f,_0x116344){_0x116344=_0x116344||0x1f4;return function(_0x1c8f18){logger['error'](_0x1c8f18[_0x0285('0x22')]);if(_0x1c8f18['name']){delete _0x1c8f18[_0x0285('0x23')];}_0x23363f[_0x0285('0x16')](_0x116344)['send'](_0x1c8f18);};}exports[_0x0285('0x24')]=function(_0x1f7731,_0x4fbec5){var _0x251124={},_0x1fa07e={},_0x4e7f4c={'count':0x0,'rows':[]};var _0x21dbb9=db[_0x0285('0x25')][_0x0285('0x26')];_0x1fa07e[_0x0285('0x27')]=_[_0x0285('0x28')](_0x21dbb9);_0x1fa07e['query']=_[_0x0285('0x28')](_0x1f7731[_0x0285('0x29')]);_0x1fa07e[_0x0285('0x2a')]=_[_0x0285('0x2b')](_0x1fa07e[_0x0285('0x27')],_0x1fa07e[_0x0285('0x29')]);_0x251124['attributes']=_[_0x0285('0x2b')](_0x1fa07e['model'],qs[_0x0285('0x2c')](_0x1f7731[_0x0285('0x29')][_0x0285('0x2c')]));_0x251124[_0x0285('0x2d')]=_0x251124['attributes'][_0x0285('0x2e')]?_0x251124[_0x0285('0x2d')]:_0x1fa07e[_0x0285('0x27')];if(!_0x1f7731[_0x0285('0x29')][_0x0285('0x2f')]('nolimit')){_0x251124[_0x0285('0x19')]=qs['limit'](_0x1f7731[_0x0285('0x29')]['limit']);_0x251124[_0x0285('0x18')]=qs['offset'](_0x1f7731['query'][_0x0285('0x18')]);}_0x251124[_0x0285('0x30')]=qs[_0x0285('0x31')](_0x1f7731[_0x0285('0x29')]['sort']);_0x251124[_0x0285('0x32')]=qs[_0x0285('0x2a')](_[_0x0285('0x33')](_0x1f7731[_0x0285('0x29')],_0x1fa07e['filters']));if(_0x1f7731['query'][_0x0285('0x34')]){_0x251124[_0x0285('0x32')]=_[_0x0285('0x35')](_0x251124[_0x0285('0x32')],{'$or':_[_0x0285('0x36')](_0x21dbb9,function(_0x4c59d5){if(_0x4c59d5['type'][_0x0285('0x37')]!==_0x0285('0x38')){var _0x196847={};_0x196847[_0x4c59d5[_0x0285('0x39')]]={'$like':'%'+_0x1f7731[_0x0285('0x29')][_0x0285('0x34')]+'%'};return _0x196847;}})});}_0x251124=_['merge']({},_0x251124,_0x1f7731['options']);var _0x55ef68={'where':_0x251124['where']};return db[_0x0285('0x25')]['count'](_0x55ef68)[_0x0285('0x20')](function(_0x2f9ec4){_0x4e7f4c[_0x0285('0x3a')]=_0x2f9ec4;if(_0x1f7731['query'][_0x0285('0x3b')]){_0x251124[_0x0285('0x3c')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x0285('0x3d')](_0x251124);})[_0x0285('0x20')](function(_0x2e8646){_0x4e7f4c[_0x0285('0x3e')]=_0x2e8646;return _0x4e7f4c;})[_0x0285('0x20')](respondWithFilteredResult(_0x4fbec5,_0x251124))[_0x0285('0x3f')](handleError(_0x4fbec5,null));};exports[_0x0285('0x40')]=function(_0x41dbf4,_0xeb6661){var _0x157d7b={'raw':!![],'where':{'id':_0x41dbf4[_0x0285('0x41')]['id']}},_0x54090f={};_0x54090f[_0x0285('0x27')]=_[_0x0285('0x28')](db[_0x0285('0x25')][_0x0285('0x26')]);_0x54090f[_0x0285('0x29')]=_[_0x0285('0x28')](_0x41dbf4[_0x0285('0x29')]);_0x54090f['filters']=_['intersection'](_0x54090f[_0x0285('0x27')],_0x54090f['query']);_0x157d7b['attributes']=_['intersection'](_0x54090f[_0x0285('0x27')],qs[_0x0285('0x2c')](_0x41dbf4[_0x0285('0x29')][_0x0285('0x2c')]));_0x157d7b[_0x0285('0x2d')]=_0x157d7b[_0x0285('0x2d')][_0x0285('0x2e')]?_0x157d7b[_0x0285('0x2d')]:_0x54090f[_0x0285('0x27')];if(_0x41dbf4[_0x0285('0x29')][_0x0285('0x3b')]){_0x157d7b[_0x0285('0x3c')]=[{'all':!![]}];}_0x157d7b=_['merge']({},_0x157d7b,_0x41dbf4['options']);return db[_0x0285('0x25')][_0x0285('0x42')](_0x157d7b)[_0x0285('0x20')](handleEntityNotFound(_0xeb6661,null))['then'](respondWithResult(_0xeb6661,null))[_0x0285('0x3f')](handleError(_0xeb6661,null));};exports[_0x0285('0x43')]=function(_0x4eaa19,_0x405e0f){return db[_0x0285('0x25')]['create'](_0x4eaa19[_0x0285('0x44')],{})[_0x0285('0x20')](respondWithResult(_0x405e0f,0xc9))['catch'](handleError(_0x405e0f,null));};exports[_0x0285('0x1f')]=function(_0x20df8c,_0x232102){if(_0x20df8c[_0x0285('0x44')]['id']){delete _0x20df8c[_0x0285('0x44')]['id'];}return db[_0x0285('0x25')][_0x0285('0x42')]({'where':{'id':_0x20df8c[_0x0285('0x41')]['id']}})[_0x0285('0x20')](handleEntityNotFound(_0x232102,null))[_0x0285('0x20')](saveUpdates(_0x20df8c[_0x0285('0x44')],null))[_0x0285('0x20')](respondWithResult(_0x232102,null))[_0x0285('0x3f')](handleError(_0x232102,null));};exports[_0x0285('0x21')]=function(_0x44ccd0,_0x43640c){return db[_0x0285('0x25')][_0x0285('0x42')]({'where':{'id':_0x44ccd0[_0x0285('0x41')]['id']}})[_0x0285('0x20')](handleEntityNotFound(_0x43640c,null))[_0x0285('0x20')](removeEntity(_0x43640c,null))[_0x0285('0x3f')](handleError(_0x43640c,null));};exports[_0x0285('0x45')]=function(_0x2fee41,_0x282159){return db[_0x0285('0x25')][_0x0285('0x45')]()[_0x0285('0x20')](respondWithResult(_0x282159,null))[_0x0285('0x3f')](handleError(_0x282159,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 657a269..4a6d6c2 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 _0x4c71=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','uniqueid'];(function(_0x3ef2b3,_0x1ca524){var _0xe7016d=function(_0x2c7f00){while(--_0x2c7f00){_0x3ef2b3['push'](_0x3ef2b3['shift']());}};_0xe7016d(++_0x1ca524);}(_0x4c71,0x12b));var _0x14c7=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x4c71[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x14c7('0x0'));var util=require(_0x14c7('0x1'));var logger=require('../../config/logger')(_0x14c7('0x2'));var moment=require(_0x14c7('0x3'));var BPromise=require(_0x14c7('0x4'));var rp=require(_0x14c7('0x5'));var fs=require('fs');var path=require(_0x14c7('0x6'));var rimraf=require('rimraf');var config=require(_0x14c7('0x7'));var attributes=require(_0x14c7('0x8'));module[_0x14c7('0x9')]=function(_0x3c6929,_0x5b50b6){return _0x3c6929['define'](_0x14c7('0xa'),attributes,{'tableName':_0x14c7('0xb'),'paranoid':![],'indexes':[{'fields':[_0x14c7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcea2=['moment','bluebird','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','define','VoiceDialReport','report_dial','uniqueid','lodash','../../config/logger'];(function(_0x398306,_0x560fd1){var _0x42644b=function(_0x49bae1){while(--_0x49bae1){_0x398306['push'](_0x398306['shift']());}};_0x42644b(++_0x560fd1);}(_0xcea2,0x15a));var _0x2cea=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xcea2[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x2cea('0x0'));var util=require('util');var logger=require(_0x2cea('0x1'))('api');var moment=require(_0x2cea('0x2'));var BPromise=require(_0x2cea('0x3'));var rp=require(_0x2cea('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2cea('0x5'));var config=require(_0x2cea('0x6'));var attributes=require(_0x2cea('0x7'));module['exports']=function(_0x34f0f2,_0x485c26){return _0x34f0f2[_0x2cea('0x8')](_0x2cea('0x9'),attributes,{'tableName':_0x2cea('0xa'),'paranoid':![],'indexes':[{'fields':[_0x2cea('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 8a4644c..09efb76 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 _0xbf6e=['request','then','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','UpdateVoiceDialReport','update','where','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x5d8694,_0x12b8c2){var _0x442111=function(_0x52f1eb){while(--_0x52f1eb){_0x5d8694['push'](_0x5d8694['shift']());}};_0x442111(++_0x12b8c2);}(_0xbf6e,0x149));var _0xebf6=function(_0x4eabbb,_0x8ac99a){_0x4eabbb=_0x4eabbb-0x0;var _0x1d9d1e=_0xbf6e[_0x4eabbb];return _0x1d9d1e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xebf6('0x0'));var BPromise=require(_0xebf6('0x1'));var rs=require(_0xebf6('0x2'));var fs=require('fs');var Redis=require(_0xebf6('0x3'));var db=require(_0xebf6('0x4'))['db'];var utils=require(_0xebf6('0x5'));var logger=require(_0xebf6('0x6'))('rpc');var config=require(_0xebf6('0x7'));var jayson=require(_0xebf6('0x8'));var client=jayson[_0xebf6('0x9')][_0xebf6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x143344,_0x1e02b3,_0x137e39){return new BPromise(function(_0x548e9e,_0x1d8035){return client[_0xebf6('0xb')](_0x143344,_0x137e39)[_0xebf6('0xc')](function(_0x591132){logger[_0xebf6('0xd')](_0xebf6('0xe'),_0x1e02b3,'request\x20sent');logger[_0xebf6('0xf')](_0xebf6('0x10'),_0x1e02b3,_0xebf6('0x11'),JSON[_0xebf6('0x12')](_0x591132));if(_0x591132[_0xebf6('0x13')]){if(_0x591132[_0xebf6('0x13')]['code']===0x1f4){logger[_0xebf6('0x13')](_0xebf6('0xe'),_0x1e02b3,_0x591132['error'][_0xebf6('0x14')]);return _0x1d8035(_0x591132[_0xebf6('0x13')][_0xebf6('0x14')]);}logger[_0xebf6('0x13')](_0xebf6('0xe'),_0x1e02b3,_0x591132['error']['message']);return _0x548e9e(_0x591132['error'][_0xebf6('0x14')]);}else{logger[_0xebf6('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x1e02b3,_0xebf6('0x11'));_0x548e9e(_0x591132[_0xebf6('0x15')][_0xebf6('0x14')]);}})[_0xebf6('0x16')](function(_0x3100ee){logger[_0xebf6('0x13')](_0xebf6('0xe'),_0x1e02b3,_0x3100ee);_0x1d8035(_0x3100ee);});});}exports[_0xebf6('0x17')]=function(_0x2d3984){var _0x308480=this;return new Promise(function(_0x55fa31,_0x496dea){return db[_0xebf6('0x18')][_0xebf6('0x19')](_0x2d3984[_0xebf6('0x1a')],{'raw':_0x2d3984[_0xebf6('0x1b')]?_0x2d3984[_0xebf6('0x1b')][_0xebf6('0x1c')]===undefined?!![]:![]:!![]})[_0xebf6('0xc')](function(_0x80f523){logger['info'](_0xebf6('0x17'),_0x2d3984);logger[_0xebf6('0xf')](_0xebf6('0x17'),_0x2d3984,JSON[_0xebf6('0x12')](_0x80f523));_0x55fa31(_0x80f523);})[_0xebf6('0x16')](function(_0x14c8ac){logger[_0xebf6('0x13')](_0xebf6('0x17'),_0x14c8ac[_0xebf6('0x14')],_0x2d3984);_0x496dea(_0x308480[_0xebf6('0x13')](0x1f4,_0x14c8ac[_0xebf6('0x14')]));});});};exports[_0xebf6('0x1d')]=function(_0x43c4e2){var _0x3b8bc1=this;return new Promise(function(_0x2f6e5d,_0x1d0078){return db[_0xebf6('0x18')][_0xebf6('0x1e')](_0x43c4e2[_0xebf6('0x1a')],{'raw':_0x43c4e2['options']?_0x43c4e2['options'][_0xebf6('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43c4e2['options']?_0x43c4e2[_0xebf6('0x1b')][_0xebf6('0x1f')]||null:null,'attributes':_0x43c4e2['options']?_0x43c4e2['options'][_0xebf6('0x20')]||null:null,'limit':_0x43c4e2[_0xebf6('0x1b')]?_0x43c4e2[_0xebf6('0x1b')][_0xebf6('0x21')]||null:null})[_0xebf6('0xc')](function(_0x2dc0cf){logger[_0xebf6('0xd')](_0xebf6('0x1d'),_0x43c4e2);logger['debug'](_0xebf6('0x1d'),_0x43c4e2,JSON[_0xebf6('0x12')](_0x2dc0cf));_0x2f6e5d(_0x2dc0cf);})['catch'](function(_0x2fe3ee){logger[_0xebf6('0x13')]('UpdateVoiceDialReport',_0x2fe3ee[_0xebf6('0x14')],_0x43c4e2);_0x1d0078(_0x3b8bc1[_0xebf6('0x13')](0x1f4,_0x2fe3ee[_0xebf6('0x14')]));});});}; \ No newline at end of file +var _0x2333=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateVoiceDialReport','options','raw','stringify','UpdateVoiceDialReport','VoiceDialReport','body','where','attributes','limit','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x4605dc,_0x3f7ae5){var _0x5d3e81=function(_0x1d0375){while(--_0x1d0375){_0x4605dc['push'](_0x4605dc['shift']());}};_0x5d3e81(++_0x3f7ae5);}(_0x2333,0x11a));var _0x3233=function(_0x2b097b,_0x579154){_0x2b097b=_0x2b097b-0x0;var _0xa14060=_0x2333[_0x2b097b];return _0xa14060;};'use strict';var _=require(_0x3233('0x0'));var util=require(_0x3233('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3233('0x2'));var fs=require('fs');var Redis=require(_0x3233('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3233('0x4'));var logger=require(_0x3233('0x5'))(_0x3233('0x6'));var config=require(_0x3233('0x7'));var jayson=require(_0x3233('0x8'));var client=jayson[_0x3233('0x9')][_0x3233('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33a56d,_0x1e93e8,_0x1842a1){return new BPromise(function(_0x1837b6,_0x2ee6df){return client[_0x3233('0xb')](_0x33a56d,_0x1842a1)[_0x3233('0xc')](function(_0x7ff4bd){logger[_0x3233('0xd')](_0x3233('0xe'),_0x1e93e8,_0x3233('0xf'));logger[_0x3233('0x10')](_0x3233('0x11'),_0x1e93e8,_0x3233('0xf'),JSON['stringify'](_0x7ff4bd));if(_0x7ff4bd[_0x3233('0x12')]){if(_0x7ff4bd[_0x3233('0x12')][_0x3233('0x13')]===0x1f4){logger[_0x3233('0x12')](_0x3233('0xe'),_0x1e93e8,_0x7ff4bd[_0x3233('0x12')][_0x3233('0x14')]);return _0x2ee6df(_0x7ff4bd[_0x3233('0x12')][_0x3233('0x14')]);}logger[_0x3233('0x12')](_0x3233('0xe'),_0x1e93e8,_0x7ff4bd[_0x3233('0x12')][_0x3233('0x14')]);return _0x1837b6(_0x7ff4bd['error']['message']);}else{logger[_0x3233('0xd')](_0x3233('0xe'),_0x1e93e8,_0x3233('0xf'));_0x1837b6(_0x7ff4bd['result'][_0x3233('0x14')]);}})[_0x3233('0x15')](function(_0x127227){logger['error'](_0x3233('0xe'),_0x1e93e8,_0x127227);_0x2ee6df(_0x127227);});});}exports[_0x3233('0x16')]=function(_0x55fa30){var _0x38a9c0=this;return new Promise(function(_0x58420c,_0x233141){return db['VoiceDialReport']['create'](_0x55fa30['body'],{'raw':_0x55fa30[_0x3233('0x17')]?_0x55fa30['options'][_0x3233('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x305227){logger[_0x3233('0xd')](_0x3233('0x16'),_0x55fa30);logger[_0x3233('0x10')]('CreateVoiceDialReport',_0x55fa30,JSON[_0x3233('0x19')](_0x305227));_0x58420c(_0x305227);})[_0x3233('0x15')](function(_0x56fa5a){logger['error'](_0x3233('0x16'),_0x56fa5a['message'],_0x55fa30);_0x233141(_0x38a9c0[_0x3233('0x12')](0x1f4,_0x56fa5a[_0x3233('0x14')]));});});};exports[_0x3233('0x1a')]=function(_0x4c3875){var _0x3ca20d=this;return new Promise(function(_0x55aa7b,_0x33916b){return db[_0x3233('0x1b')]['update'](_0x4c3875[_0x3233('0x1c')],{'raw':_0x4c3875['options']?_0x4c3875['options'][_0x3233('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c3875[_0x3233('0x17')]?_0x4c3875['options'][_0x3233('0x1d')]||null:null,'attributes':_0x4c3875[_0x3233('0x17')]?_0x4c3875[_0x3233('0x17')][_0x3233('0x1e')]||null:null,'limit':_0x4c3875[_0x3233('0x17')]?_0x4c3875['options'][_0x3233('0x1f')]||null:null})[_0x3233('0xc')](function(_0xabcf54){logger[_0x3233('0xd')](_0x3233('0x1a'),_0x4c3875);logger[_0x3233('0x10')](_0x3233('0x1a'),_0x4c3875,JSON[_0x3233('0x19')](_0xabcf54));_0x55aa7b(_0xabcf54);})[_0x3233('0x15')](function(_0x5a35b5){logger[_0x3233('0x12')](_0x3233('0x1a'),_0x5a35b5['message'],_0x4c3875);_0x33916b(_0x3ca20d[_0x3233('0x12')](0x1f4,_0x5a35b5[_0x3233('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index ba68d4c..77156a4 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 _0x3e22=['Router','../../components/auth/service','./voiceExtension.controller','get','index','/:id','isAuthenticated','show','create','post','/:id/applications','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x5515d1,_0x40adf6){var _0x1c4c55=function(_0x13dec3){while(--_0x13dec3){_0x5515d1['push'](_0x5515d1['shift']());}};_0x1c4c55(++_0x40adf6);}(_0x3e22,0xa8));var _0x23e2=function(_0x3a374c,_0x979a58){_0x3a374c=_0x3a374c-0x0;var _0x79a1e9=_0x3e22[_0x3a374c];return _0x79a1e9;};'use strict';var multer=require('multer');var util=require(_0x23e2('0x0'));var path=require('path');var timeout=require(_0x23e2('0x1'));var express=require(_0x23e2('0x2'));var router=express[_0x23e2('0x3')]();var auth=require(_0x23e2('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x23e2('0x5'));router[_0x23e2('0x6')]('/',auth['isAuthenticated'](),controller[_0x23e2('0x7')]);router[_0x23e2('0x6')](_0x23e2('0x8'),auth[_0x23e2('0x9')](),controller[_0x23e2('0xa')]);router['post']('/',auth[_0x23e2('0x9')](),controller[_0x23e2('0xb')]);router[_0x23e2('0xc')](_0x23e2('0xd'),auth[_0x23e2('0x9')](),controller['addApplications']);router[_0x23e2('0xe')](_0x23e2('0x8'),auth[_0x23e2('0x9')](),controller[_0x23e2('0xf')]);router[_0x23e2('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x23e2('0x11')]);module[_0x23e2('0x12')]=router; \ No newline at end of file +var _0x79e2=['exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','/:id','show','post','/:id/applications','put','update','delete','destroy'];(function(_0x5e07a7,_0x1438b3){var _0x22ced5=function(_0x7c975b){while(--_0x7c975b){_0x5e07a7['push'](_0x5e07a7['shift']());}};_0x22ced5(++_0x1438b3);}(_0x79e2,0x1c3));var _0x279e=function(_0xb8ba53,_0x51bf17){_0xb8ba53=_0xb8ba53-0x0;var _0x32a9df=_0x79e2[_0xb8ba53];return _0x32a9df;};'use strict';var multer=require(_0x279e('0x0'));var util=require('util');var path=require(_0x279e('0x1'));var timeout=require(_0x279e('0x2'));var express=require(_0x279e('0x3'));var router=express['Router']();var auth=require(_0x279e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x279e('0x5'));var controller=require(_0x279e('0x6'));router[_0x279e('0x7')]('/',auth[_0x279e('0x8')](),controller['index']);router['get'](_0x279e('0x9'),auth[_0x279e('0x8')](),controller[_0x279e('0xa')]);router[_0x279e('0xb')]('/',auth[_0x279e('0x8')](),controller['create']);router[_0x279e('0xb')](_0x279e('0xc'),auth[_0x279e('0x8')](),controller['addApplications']);router[_0x279e('0xd')](_0x279e('0x9'),auth['isAuthenticated'](),controller[_0x279e('0xe')]);router[_0x279e('0xf')](_0x279e('0x9'),auth[_0x279e('0x8')](),controller[_0x279e('0x10')]);module[_0x279e('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 6626e59..45bcdae 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 _0xd404=['BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex','STRING','NoOp','ENUM','inbound','outbound','inbound-fax','outbound-fax','any','*,*,*,*','INTEGER'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0xd404,0x15b));var _0x4d40=function(_0x511a69,_0x5535fb){_0x511a69=_0x511a69-0x0;var _0x13be84=_0xd404[_0x511a69];return _0x13be84;};'use strict';var Sequelize=require(_0x4d40('0x0'));module[_0x4d40('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4d40('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x4d40('0x3')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x4d40('0x3')],'allowNull':![],'defaultValue':'1','unique':_0x4d40('0x2')},'tag':{'type':Sequelize[_0x4d40('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x4d40('0x3')],'allowNull':![],'defaultValue':_0x4d40('0x4')},'appdata':{'type':Sequelize[_0x4d40('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x4d40('0x5')](_0x4d40('0x6'),_0x4d40('0x7'),'internal',_0x4d40('0x8'),_0x4d40('0x9'),'system',_0x4d40('0xa')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4d40('0xb')},'IntervalId':{'type':Sequelize[_0x4d40('0xc')]},'isApp':{'type':Sequelize[_0x4d40('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x4d40('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0x4d40('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0x4d40('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x4d40('0xc')]},'recordingFormat':{'type':Sequelize[_0x4d40('0x3')],'defaultValue':_0x4d40('0xe')},'answer':{'type':Sequelize[_0x4d40('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x4d40('0xf')],'get':function(_0x3c3b7e){return this[_0x4d40('0x10')](_0x4d40('0x11'));}}}; \ No newline at end of file +var _0xda55=['system','any','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','outbound','internal','inbound-fax','outbound-fax'];(function(_0x29fe3e,_0x2c2225){var _0x467e5b=function(_0xa21c33){while(--_0xa21c33){_0x29fe3e['push'](_0x29fe3e['shift']());}};_0x467e5b(++_0x2c2225);}(_0xda55,0x6d));var _0x5da5=function(_0x3dbb87,_0x47419d){_0x3dbb87=_0x3dbb87-0x0;var _0x141ca0=_0xda55[_0x3dbb87];return _0x141ca0;};'use strict';var Sequelize=require(_0x5da5('0x0'));module[_0x5da5('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x5da5('0x2')],'allowNull':![],'unique':_0x5da5('0x3')},'priority':{'type':Sequelize[_0x5da5('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x5da5('0x3')},'tag':{'type':Sequelize[_0x5da5('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5da5('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x5da5('0x5')]('inbound',_0x5da5('0x6'),_0x5da5('0x7'),_0x5da5('0x8'),_0x5da5('0x9'),_0x5da5('0xa'),_0x5da5('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x5da5('0x2')]},'interval':{'type':Sequelize[_0x5da5('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x5da5('0xc')]},'isApp':{'type':Sequelize[_0x5da5('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x5da5('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x5da5('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x5da5('0xc')]},'recordingFormat':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x5da5('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x5da5('0xe')],'get':function(_0x4f813b){return this[_0x5da5('0xf')](_0x5da5('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index cd6565c..689b3c2 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 _0x6fcd=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','value','includes','find','type','name','UserProfileResource','end','error','stack','send','index','VoiceExtension','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','show','params','create','startsWith','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize','map','VoiceExtensionId','findAndCountAll','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','squel','jsforce','querystring'];(function(_0x28c42b,_0x2f6a9f){var _0x3ded57=function(_0x20d308){while(--_0x20d308){_0x28c42b['push'](_0x28c42b['shift']());}};_0x3ded57(++_0x2f6a9f);}(_0x6fcd,0x19b));var _0xd6fc=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x6fcd[_0x11005e];return _0x29338f;};'use strict';var pdf=require(_0xd6fc('0x0'));var emlformat=require(_0xd6fc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd6fc('0x2'));var jsonpatch=require(_0xd6fc('0x3'));var rp=require(_0xd6fc('0x4'));var moment=require('moment');var BPromise=require(_0xd6fc('0x5'));var Mustache=require(_0xd6fc('0x6'));var util=require(_0xd6fc('0x7'));var path=require(_0xd6fc('0x8'));var sox=require('sox');var csv=require(_0xd6fc('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd6fc('0xa'));var crypto=require('crypto');var jsforce=require(_0xd6fc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd6fc('0x9'));var querystring=require(_0xd6fc('0xc'));var Papa=require(_0xd6fc('0xd'));var Redis=require('ioredis');var authService=require(_0xd6fc('0xe'));var qs=require(_0xd6fc('0xf'));var hardwareService=require(_0xd6fc('0x10'));var logger=require(_0xd6fc('0x11'))(_0xd6fc('0x12'));var utils=require(_0xd6fc('0x13'));var config=require(_0xd6fc('0x14'));var db=require(_0xd6fc('0x15'))['db'];config[_0xd6fc('0x16')]=_[_0xd6fc('0x17')](config[_0xd6fc('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xd6fc('0x18'))(new Redis(config[_0xd6fc('0x16')]));require('./voiceExtension.socket')[_0xd6fc('0x19')](socket);function respondWithStatusCode(_0x35f3fa,_0x4b0801){_0x4b0801=_0x4b0801||0xcc;return function(_0xfa083){if(_0xfa083){return _0x35f3fa[_0xd6fc('0x1a')](_0x4b0801);}return _0x35f3fa['status'](_0x4b0801)['end']();};}function respondWithResult(_0x4d6e7e,_0x423a39){_0x423a39=_0x423a39||0xc8;return function(_0x85d3f7){if(_0x85d3f7){return _0x4d6e7e[_0xd6fc('0x1b')](_0x423a39)[_0xd6fc('0x1c')](_0x85d3f7);}};}function respondWithFilteredResult(_0x5bbf6b,_0x5d3b11){return function(_0x52a331){if(_0x52a331){var _0x3cfaf1=_0x52a331[_0xd6fc('0x1d')],_0x1fabea=_0x5d3b11[_0xd6fc('0x1e')],_0x3b1400=_0x5d3b11[_0xd6fc('0x1e')]+_0x5d3b11[_0xd6fc('0x1f')],_0x3a5bcf;if(_0x3b1400>=_0x3cfaf1){_0x3b1400=_0x3cfaf1;_0x3a5bcf=0xc8;}else{_0x3a5bcf=0xce;}_0x5bbf6b[_0xd6fc('0x1b')](_0x3a5bcf);return _0x5bbf6b['set'](_0xd6fc('0x20'),_0x1fabea+'-'+_0x3b1400+'/'+_0x3cfaf1)['json'](_0x52a331);}return null;};}function patchUpdates(_0x4c9803){return function(_0x509a17){try{jsonpatch[_0xd6fc('0x21')](_0x509a17,_0x4c9803,!![]);}catch(_0x4b1984){return BPromise[_0xd6fc('0x22')](_0x4b1984);}return _0x509a17[_0xd6fc('0x23')]();};}function saveUpdates(_0x2d2022,_0x4a20c6){return function(_0x3446b3){if(_0x3446b3){return _0x3446b3[_0xd6fc('0x24')](_0x2d2022)['then'](function(_0x3c0734){return _0x3c0734;});}return null;};}function removeEntity(_0x34196e,_0x24cdf0){return function(_0x31e516){if(_0x31e516){return _0x31e516[_0xd6fc('0x25')]()[_0xd6fc('0x26')](function(){var _0x429c88=_0x31e516[_0xd6fc('0x27')]({'plain':!![]});var _0x19c304=[{'name':_0xd6fc('0x28'),'value':'inbound','ignore':![]},{'name':_0xd6fc('0x29'),'value':_0xd6fc('0x2a'),'ignore':![]},{'name':_0xd6fc('0x2b'),'value':_0xd6fc('0x2c'),'ignore':![]}];var _0x3d9050=_(_0x19c304)[_0xd6fc('0x2d')](_0xd6fc('0x2e'))['map'](_0xd6fc('0x2f'))[_0xd6fc('0x2f')]();if(_[_0xd6fc('0x30')](_0x3d9050,_0x429c88['type'])){return;}var _0x5c9521=_[_0xd6fc('0x31')](_0x19c304,['value',_0x429c88[_0xd6fc('0x32')]])[_0xd6fc('0x33')];return db[_0xd6fc('0x34')][_0xd6fc('0x25')]({'where':{'type':_0x5c9521,'resourceId':_0x429c88['id']}})[_0xd6fc('0x26')](function(){return _0x31e516;});})['then'](function(){_0x34196e[_0xd6fc('0x1b')](0xcc)[_0xd6fc('0x35')]();});}};}function handleEntityNotFound(_0x948c33,_0x8fed79){return function(_0x4f1efa){if(!_0x4f1efa){_0x948c33[_0xd6fc('0x1a')](0x194);}return _0x4f1efa;};}function handleError(_0x6387c0,_0x1502df){_0x1502df=_0x1502df||0x1f4;return function(_0x46f243){logger[_0xd6fc('0x36')](_0x46f243[_0xd6fc('0x37')]);if(_0x46f243[_0xd6fc('0x33')]){delete _0x46f243['name'];}_0x6387c0[_0xd6fc('0x1b')](_0x1502df)[_0xd6fc('0x38')](_0x46f243);};}exports[_0xd6fc('0x39')]=function(_0x23a23b,_0x36e3b6){var _0x7a9cfb={},_0x4294f8={},_0x2a5a4c={'count':0x0,'rows':[]};var _0x2e98bf=db[_0xd6fc('0x3a')][_0xd6fc('0x3b')];_0x4294f8[_0xd6fc('0x3c')]=_['keys'](_0x2e98bf);_0x4294f8[_0xd6fc('0x3d')]=_[_0xd6fc('0x3e')](_0x23a23b[_0xd6fc('0x3d')]);_0x4294f8[_0xd6fc('0x3f')]=_[_0xd6fc('0x40')](_0x4294f8['model'],_0x4294f8[_0xd6fc('0x3d')]);_0x7a9cfb[_0xd6fc('0x41')]=_[_0xd6fc('0x40')](_0x4294f8['model'],qs[_0xd6fc('0x42')](_0x23a23b[_0xd6fc('0x3d')][_0xd6fc('0x42')]));_0x7a9cfb[_0xd6fc('0x41')]=_0x7a9cfb['attributes'][_0xd6fc('0x43')]?_0x7a9cfb[_0xd6fc('0x41')]:_0x4294f8[_0xd6fc('0x3c')];if(!_0x23a23b[_0xd6fc('0x3d')][_0xd6fc('0x44')]('nolimit')){_0x7a9cfb['limit']=qs['limit'](_0x23a23b['query'][_0xd6fc('0x1f')]);_0x7a9cfb[_0xd6fc('0x1e')]=qs['offset'](_0x23a23b['query'][_0xd6fc('0x1e')]);}_0x7a9cfb[_0xd6fc('0x45')]=qs[_0xd6fc('0x46')](_0x23a23b[_0xd6fc('0x3d')][_0xd6fc('0x46')]);_0x7a9cfb[_0xd6fc('0x47')]=qs[_0xd6fc('0x3f')](_[_0xd6fc('0x48')](_0x23a23b[_0xd6fc('0x3d')],_0x4294f8[_0xd6fc('0x3f')]));if(_0x23a23b[_0xd6fc('0x3d')][_0xd6fc('0x2d')]){_0x7a9cfb[_0xd6fc('0x47')]=_['merge'](_0x7a9cfb[_0xd6fc('0x47')],{'$or':_['map'](_0x2e98bf,function(_0x54ca7b){if(_0x54ca7b['type'][_0xd6fc('0x49')]!==_0xd6fc('0x4a')){var _0x5feb04={};_0x5feb04[_0x54ca7b[_0xd6fc('0x4b')]]={'$like':'%'+_0x23a23b['query'][_0xd6fc('0x2d')]+'%'};return _0x5feb04;}})});}_0x7a9cfb=_[_0xd6fc('0x4c')]({},_0x7a9cfb,_0x23a23b[_0xd6fc('0x4d')]);var _0x15ef59={'where':_0x7a9cfb[_0xd6fc('0x47')]};return db[_0xd6fc('0x3a')]['count'](_0x15ef59)[_0xd6fc('0x26')](function(_0x23faa7){_0x2a5a4c[_0xd6fc('0x1d')]=_0x23faa7;if(_0x23a23b[_0xd6fc('0x3d')][_0xd6fc('0x4e')]){_0x7a9cfb[_0xd6fc('0x4f')]=[{'all':!![]}];}return db[_0xd6fc('0x3a')][_0xd6fc('0x50')](_0x7a9cfb);})[_0xd6fc('0x26')](function(_0x3646f2){_0x2a5a4c[_0xd6fc('0x51')]=_0x3646f2;return _0x2a5a4c;})[_0xd6fc('0x26')](respondWithFilteredResult(_0x36e3b6,_0x7a9cfb))[_0xd6fc('0x52')](handleError(_0x36e3b6,null));};exports[_0xd6fc('0x53')]=function(_0x529a3d,_0x5ab692){var _0x1561b9={'raw':![],'where':{'id':_0x529a3d[_0xd6fc('0x54')]['id']}},_0x298f2a={};_0x298f2a[_0xd6fc('0x3c')]=_[_0xd6fc('0x3e')](db[_0xd6fc('0x3a')][_0xd6fc('0x3b')]);_0x298f2a['query']=_[_0xd6fc('0x3e')](_0x529a3d[_0xd6fc('0x3d')]);_0x298f2a[_0xd6fc('0x3f')]=_[_0xd6fc('0x40')](_0x298f2a[_0xd6fc('0x3c')],_0x298f2a[_0xd6fc('0x3d')]);_0x1561b9['attributes']=_['intersection'](_0x298f2a[_0xd6fc('0x3c')],qs[_0xd6fc('0x42')](_0x529a3d[_0xd6fc('0x3d')]['fields']));_0x1561b9[_0xd6fc('0x41')]=_0x1561b9[_0xd6fc('0x41')]['length']?_0x1561b9[_0xd6fc('0x41')]:_0x298f2a['model'];if(_0x529a3d[_0xd6fc('0x3d')][_0xd6fc('0x4e')]){_0x1561b9[_0xd6fc('0x4f')]=[{'all':!![]}];}_0x1561b9=_[_0xd6fc('0x4c')]({},_0x1561b9,_0x529a3d[_0xd6fc('0x4d')]);return db[_0xd6fc('0x3a')][_0xd6fc('0x31')](_0x1561b9)[_0xd6fc('0x26')](handleEntityNotFound(_0x5ab692,null))[_0xd6fc('0x26')](respondWithResult(_0x5ab692,null))[_0xd6fc('0x52')](handleError(_0x5ab692,null));};exports[_0xd6fc('0x25')]=function(_0x2ce24b,_0x26b7a5){return db['VoiceExtension'][_0xd6fc('0x31')]({'where':{'id':_0x2ce24b['params']['id']}})['then'](handleEntityNotFound(_0x26b7a5,null))[_0xd6fc('0x26')](removeEntity(_0x26b7a5,null))[_0xd6fc('0x52')](handleError(_0x26b7a5,null));};exports[_0xd6fc('0x55')]=function(_0x351d00,_0x27b570){if(_0x351d00['body']['type']===_0xd6fc('0x2a')&&!_[_0xd6fc('0x56')](_0x351d00[_0xd6fc('0x57')][_0xd6fc('0x58')],'_')){_0x351d00[_0xd6fc('0x57')]['exten']='_'[_0xd6fc('0x59')](_0x351d00['body'][_0xd6fc('0x58')]);}return db[_0xd6fc('0x3a')]['create'](_0x351d00[_0xd6fc('0x57')],{'raw':![]})[_0xd6fc('0x26')](function(_0x2fb8a4){var _0x148673=_0x351d00[_0xd6fc('0x5a')]['get']({'plain':!![]});if(!_0x148673)throw new Error(_0xd6fc('0x5b'));if(_0x148673['role']===_0xd6fc('0x5a')){var _0x5285b5=_0x2fb8a4[_0xd6fc('0x27')]({'plain':!![]});var _0x1fdcec=[{'name':_0xd6fc('0x28'),'value':_0xd6fc('0x5c')},{'name':_0xd6fc('0x29'),'value':_0xd6fc('0x2a')},{'name':_0xd6fc('0x2b'),'value':_0xd6fc('0x2c')}];var _0x5d7ee3=_[_0xd6fc('0x31')](_0x1fdcec,[_0xd6fc('0x2f'),_0x5285b5[_0xd6fc('0x32')]])[_0xd6fc('0x33')];return db[_0xd6fc('0x5d')][_0xd6fc('0x31')]({'where':{'name':_0x5d7ee3,'userProfileId':_0x148673['userProfileId']},'raw':!![]})['then'](function(_0xfe2749){if(_0xfe2749&&_0xfe2749['autoAssociation']===0x0){return db[_0xd6fc('0x34')]['create']({'name':_0x5285b5[_0xd6fc('0x33')],'resourceId':_0x5285b5['id'],'type':_0xfe2749[_0xd6fc('0x33')],'sectionId':_0xfe2749['id']},{})[_0xd6fc('0x26')](function(){return _0x2fb8a4;});}else{return _0x2fb8a4;}})[_0xd6fc('0x52')](function(_0x4934f6){logger[_0xd6fc('0x36')](_0xd6fc('0x5e'),_0x4934f6);throw _0x4934f6;});}return _0x2fb8a4;})[_0xd6fc('0x26')](respondWithResult(_0x27b570,0xc9))['catch'](handleError(_0x27b570,null));};exports[_0xd6fc('0x24')]=function(_0x1454fc,_0x12699e){if(_0x1454fc['body']['id']){delete _0x1454fc[_0xd6fc('0x57')]['id'];}return db[_0xd6fc('0x3a')][_0xd6fc('0x31')]({'where':{'id':_0x1454fc[_0xd6fc('0x54')]['id']}})['then'](handleEntityNotFound(_0x12699e,null))[_0xd6fc('0x26')](function(_0x15e72d){if(_0x15e72d){return db['VoiceExtension'][_0xd6fc('0x24')](_[_0xd6fc('0x48')](_0x1454fc[_0xd6fc('0x57')],[_0xd6fc('0x58'),_0xd6fc('0x5f'),_0xd6fc('0x60'),_0xd6fc('0x61'),_0xd6fc('0x62'),_0xd6fc('0x63')]),{'where':{'context':_0x15e72d[_0xd6fc('0x5f')],'exten':_0x15e72d['exten']},'individualHooks':!![]})['then'](function(_0x214fa2){return _0x214fa2;});}return null;})[_0xd6fc('0x26')](respondWithStatusCode(_0x12699e,null))[_0xd6fc('0x52')](handleError(_0x12699e,null));};exports[_0xd6fc('0x64')]=function(_0x4c9629,_0x26f35b,_0x17e5e0){return db[_0xd6fc('0x3a')][_0xd6fc('0x65')]({'where':{'id':_0x4c9629[_0xd6fc('0x54')]['id']}})[_0xd6fc('0x26')](handleEntityNotFound(_0x26f35b,null))[_0xd6fc('0x26')](function(_0x3061af){if(_0x3061af){return db[_0xd6fc('0x66')]['transaction'](function(_0x46bb3b){return db[_0xd6fc('0x3a')][_0xd6fc('0x25')]({'where':{'VoiceExtensionId':_0x4c9629['params']['id']},'transaction':_0x46bb3b})['then'](function(_0x534dd5){var _0x5091c1=_[_0xd6fc('0x67')](_0x4c9629[_0xd6fc('0x57')],function(_0x47bf7e){_0x47bf7e[_0xd6fc('0x68')]=_0x4c9629[_0xd6fc('0x54')]['id'];return _0x47bf7e;});return db['VoiceExtension']['bulkCreate'](_0x5091c1,{'transaction':_0x46bb3b});});})[_0xd6fc('0x26')](function(){return db[_0xd6fc('0x3a')][_0xd6fc('0x69')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4c9629['params']['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0xd6fc('0x26')](respondWithResult(_0x26f35b,null))[_0xd6fc('0x52')](handleError(_0x26f35b,null));}; \ No newline at end of file +var _0x8411=['filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','key','VIRTUAL','field','include','rows','params','rawAttributes','length','includeAll','options','catch','create','body','exten','user','role','OutboundRoutes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','recordingFormat','context','addApplications','findOne','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','count','offset','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','get','InboundRoutes','inbound','outbound','InternalRoutes','internal','filter','ignore','map','value','find','name','UserProfileResource','end','error','stack','send','index','VoiceExtension','model','keys','query'];(function(_0x347cbf,_0x29fcc3){var _0x255cd5=function(_0x3be1cb){while(--_0x3be1cb){_0x347cbf['push'](_0x347cbf['shift']());}};_0x255cd5(++_0x29fcc3);}(_0x8411,0x168));var _0x1841=function(_0x3f2e02,_0x244d26){_0x3f2e02=_0x3f2e02-0x0;var _0x25010e=_0x8411[_0x3f2e02];return _0x25010e;};'use strict';var pdf=require(_0x1841('0x0'));var emlformat=require(_0x1841('0x1'));var rimraf=require(_0x1841('0x2'));var zipdir=require(_0x1841('0x3'));var jsonpatch=require(_0x1841('0x4'));var rp=require(_0x1841('0x5'));var moment=require(_0x1841('0x6'));var BPromise=require(_0x1841('0x7'));var Mustache=require(_0x1841('0x8'));var util=require(_0x1841('0x9'));var path=require(_0x1841('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1841('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1841('0xc'));var crypto=require(_0x1841('0xd'));var jsforce=require(_0x1841('0xe'));var deskjs=require(_0x1841('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1841('0x10'));var Redis=require(_0x1841('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x1841('0x12'));var logger=require(_0x1841('0x13'))(_0x1841('0x14'));var utils=require(_0x1841('0x15'));var config=require(_0x1841('0x16'));var db=require(_0x1841('0x17'))['db'];config[_0x1841('0x18')]=_[_0x1841('0x19')](config[_0x1841('0x18')],{'host':_0x1841('0x1a'),'port':0x18eb});var socket=require(_0x1841('0x1b'))(new Redis(config[_0x1841('0x18')]));require('./voiceExtension.socket')[_0x1841('0x1c')](socket);function respondWithStatusCode(_0x549252,_0x373721){_0x373721=_0x373721||0xcc;return function(_0x41cfea){if(_0x41cfea){return _0x549252[_0x1841('0x1d')](_0x373721);}return _0x549252['status'](_0x373721)['end']();};}function respondWithResult(_0x2c50f6,_0x543aff){_0x543aff=_0x543aff||0xc8;return function(_0x5b42a6){if(_0x5b42a6){return _0x2c50f6['status'](_0x543aff)['json'](_0x5b42a6);}};}function respondWithFilteredResult(_0x4fd48a,_0x364b50){return function(_0x3be46f){if(_0x3be46f){var _0x1d0395=_0x3be46f[_0x1841('0x1e')],_0x4a3372=_0x364b50[_0x1841('0x1f')],_0x17af45=_0x364b50[_0x1841('0x1f')]+_0x364b50[_0x1841('0x20')],_0x1ba390;if(_0x17af45>=_0x1d0395){_0x17af45=_0x1d0395;_0x1ba390=0xc8;}else{_0x1ba390=0xce;}_0x4fd48a[_0x1841('0x21')](_0x1ba390);return _0x4fd48a[_0x1841('0x22')](_0x1841('0x23'),_0x4a3372+'-'+_0x17af45+'/'+_0x1d0395)['json'](_0x3be46f);}return null;};}function patchUpdates(_0x52b216){return function(_0x3a0e4d){try{jsonpatch[_0x1841('0x24')](_0x3a0e4d,_0x52b216,!![]);}catch(_0x4f08e0){return BPromise[_0x1841('0x25')](_0x4f08e0);}return _0x3a0e4d[_0x1841('0x26')]();};}function saveUpdates(_0x88793d,_0x67e457){return function(_0x136940){if(_0x136940){return _0x136940[_0x1841('0x27')](_0x88793d)['then'](function(_0x264970){return _0x264970;});}return null;};}function removeEntity(_0x199418,_0x3ad75a){return function(_0x4064f2){if(_0x4064f2){return _0x4064f2[_0x1841('0x28')]()[_0x1841('0x29')](function(){var _0xcd1d5d=_0x4064f2[_0x1841('0x2a')]({'plain':!![]});var _0x469e06=[{'name':_0x1841('0x2b'),'value':_0x1841('0x2c'),'ignore':![]},{'name':'OutboundRoutes','value':_0x1841('0x2d'),'ignore':![]},{'name':_0x1841('0x2e'),'value':_0x1841('0x2f'),'ignore':![]}];var _0x32fe43=_(_0x469e06)[_0x1841('0x30')](_0x1841('0x31'))[_0x1841('0x32')](_0x1841('0x33'))[_0x1841('0x33')]();if(_['includes'](_0x32fe43,_0xcd1d5d['type'])){return;}var _0xb03eb3=_[_0x1841('0x34')](_0x469e06,[_0x1841('0x33'),_0xcd1d5d['type']])[_0x1841('0x35')];return db[_0x1841('0x36')][_0x1841('0x28')]({'where':{'type':_0xb03eb3,'resourceId':_0xcd1d5d['id']}})[_0x1841('0x29')](function(){return _0x4064f2;});})[_0x1841('0x29')](function(){_0x199418[_0x1841('0x21')](0xcc)[_0x1841('0x37')]();});}};}function handleEntityNotFound(_0x3c8015,_0x50b060){return function(_0x1a1652){if(!_0x1a1652){_0x3c8015[_0x1841('0x1d')](0x194);}return _0x1a1652;};}function handleError(_0x2c0d59,_0x2bcddf){_0x2bcddf=_0x2bcddf||0x1f4;return function(_0x383c79){logger[_0x1841('0x38')](_0x383c79[_0x1841('0x39')]);if(_0x383c79[_0x1841('0x35')]){delete _0x383c79[_0x1841('0x35')];}_0x2c0d59[_0x1841('0x21')](_0x2bcddf)[_0x1841('0x3a')](_0x383c79);};}exports[_0x1841('0x3b')]=function(_0xa01aaf,_0x47ddf4){var _0x4461b7={},_0xc621ed={},_0x3965a8={'count':0x0,'rows':[]};var _0x4d07ad=db[_0x1841('0x3c')]['rawAttributes'];_0xc621ed[_0x1841('0x3d')]=_[_0x1841('0x3e')](_0x4d07ad);_0xc621ed['query']=_[_0x1841('0x3e')](_0xa01aaf[_0x1841('0x3f')]);_0xc621ed[_0x1841('0x40')]=_['intersection'](_0xc621ed[_0x1841('0x3d')],_0xc621ed['query']);_0x4461b7[_0x1841('0x41')]=_[_0x1841('0x42')](_0xc621ed[_0x1841('0x3d')],qs[_0x1841('0x43')](_0xa01aaf[_0x1841('0x3f')][_0x1841('0x43')]));_0x4461b7[_0x1841('0x41')]=_0x4461b7['attributes']['length']?_0x4461b7['attributes']:_0xc621ed[_0x1841('0x3d')];if(!_0xa01aaf[_0x1841('0x3f')][_0x1841('0x44')](_0x1841('0x45'))){_0x4461b7[_0x1841('0x20')]=qs[_0x1841('0x20')](_0xa01aaf[_0x1841('0x3f')][_0x1841('0x20')]);_0x4461b7['offset']=qs[_0x1841('0x1f')](_0xa01aaf[_0x1841('0x3f')][_0x1841('0x1f')]);}_0x4461b7[_0x1841('0x46')]=qs[_0x1841('0x47')](_0xa01aaf[_0x1841('0x3f')][_0x1841('0x47')]);_0x4461b7[_0x1841('0x48')]=qs[_0x1841('0x40')](_[_0x1841('0x49')](_0xa01aaf['query'],_0xc621ed['filters']));if(_0xa01aaf['query'][_0x1841('0x30')]){_0x4461b7[_0x1841('0x48')]=_[_0x1841('0x4a')](_0x4461b7[_0x1841('0x48')],{'$or':_['map'](_0x4d07ad,function(_0x3a0a66){if(_0x3a0a66[_0x1841('0x4b')][_0x1841('0x4c')]!==_0x1841('0x4d')){var _0x574aba={};_0x574aba[_0x3a0a66[_0x1841('0x4e')]]={'$like':'%'+_0xa01aaf['query'][_0x1841('0x30')]+'%'};return _0x574aba;}})});}_0x4461b7=_['merge']({},_0x4461b7,_0xa01aaf['options']);var _0x4babb7={'where':_0x4461b7[_0x1841('0x48')]};return db[_0x1841('0x3c')][_0x1841('0x1e')](_0x4babb7)[_0x1841('0x29')](function(_0x34e260){_0x3965a8[_0x1841('0x1e')]=_0x34e260;if(_0xa01aaf[_0x1841('0x3f')]['includeAll']){_0x4461b7[_0x1841('0x4f')]=[{'all':!![]}];}return db[_0x1841('0x3c')]['findAll'](_0x4461b7);})[_0x1841('0x29')](function(_0x145208){_0x3965a8[_0x1841('0x50')]=_0x145208;return _0x3965a8;})[_0x1841('0x29')](respondWithFilteredResult(_0x47ddf4,_0x4461b7))['catch'](handleError(_0x47ddf4,null));};exports['show']=function(_0xfcdf20,_0x580f3b){var _0x5957ce={'raw':![],'where':{'id':_0xfcdf20[_0x1841('0x51')]['id']}},_0x2f2c33={};_0x2f2c33[_0x1841('0x3d')]=_[_0x1841('0x3e')](db[_0x1841('0x3c')][_0x1841('0x52')]);_0x2f2c33[_0x1841('0x3f')]=_[_0x1841('0x3e')](_0xfcdf20['query']);_0x2f2c33[_0x1841('0x40')]=_[_0x1841('0x42')](_0x2f2c33[_0x1841('0x3d')],_0x2f2c33[_0x1841('0x3f')]);_0x5957ce[_0x1841('0x41')]=_[_0x1841('0x42')](_0x2f2c33[_0x1841('0x3d')],qs[_0x1841('0x43')](_0xfcdf20[_0x1841('0x3f')][_0x1841('0x43')]));_0x5957ce['attributes']=_0x5957ce[_0x1841('0x41')][_0x1841('0x53')]?_0x5957ce[_0x1841('0x41')]:_0x2f2c33[_0x1841('0x3d')];if(_0xfcdf20['query'][_0x1841('0x54')]){_0x5957ce['include']=[{'all':!![]}];}_0x5957ce=_[_0x1841('0x4a')]({},_0x5957ce,_0xfcdf20[_0x1841('0x55')]);return db[_0x1841('0x3c')]['find'](_0x5957ce)['then'](handleEntityNotFound(_0x580f3b,null))[_0x1841('0x29')](respondWithResult(_0x580f3b,null))[_0x1841('0x56')](handleError(_0x580f3b,null));};exports[_0x1841('0x28')]=function(_0x3e2b4a,_0x5cccb0){return db[_0x1841('0x3c')][_0x1841('0x34')]({'where':{'id':_0x3e2b4a['params']['id']}})[_0x1841('0x29')](handleEntityNotFound(_0x5cccb0,null))[_0x1841('0x29')](removeEntity(_0x5cccb0,null))['catch'](handleError(_0x5cccb0,null));};exports[_0x1841('0x57')]=function(_0x290c9a,_0x515c49){if(_0x290c9a[_0x1841('0x58')]['type']===_0x1841('0x2d')&&!_['startsWith'](_0x290c9a[_0x1841('0x58')]['exten'],'_')){_0x290c9a['body'][_0x1841('0x59')]='_'['concat'](_0x290c9a[_0x1841('0x58')][_0x1841('0x59')]);}return db[_0x1841('0x3c')][_0x1841('0x57')](_0x290c9a['body'],{'raw':![]})[_0x1841('0x29')](function(_0x5d9c82){var _0x467a1d=_0x290c9a[_0x1841('0x5a')][_0x1841('0x2a')]({'plain':!![]});if(!_0x467a1d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x467a1d[_0x1841('0x5b')]===_0x1841('0x5a')){var _0x75433f=_0x5d9c82[_0x1841('0x2a')]({'plain':!![]});var _0x603276=[{'name':_0x1841('0x2b'),'value':_0x1841('0x2c')},{'name':_0x1841('0x5c'),'value':_0x1841('0x2d')},{'name':_0x1841('0x2e'),'value':_0x1841('0x2f')}];var _0x11b6c8=_[_0x1841('0x34')](_0x603276,[_0x1841('0x33'),_0x75433f[_0x1841('0x4b')]])[_0x1841('0x35')];return db['UserProfileSection']['find']({'where':{'name':_0x11b6c8,'userProfileId':_0x467a1d[_0x1841('0x5d')]},'raw':!![]})[_0x1841('0x29')](function(_0x42bfdc){if(_0x42bfdc&&_0x42bfdc[_0x1841('0x5e')]===0x0){return db[_0x1841('0x36')]['create']({'name':_0x75433f[_0x1841('0x35')],'resourceId':_0x75433f['id'],'type':_0x42bfdc[_0x1841('0x35')],'sectionId':_0x42bfdc['id']},{})['then'](function(){return _0x5d9c82;});}else{return _0x5d9c82;}})[_0x1841('0x56')](function(_0x4cef59){logger[_0x1841('0x38')](_0x1841('0x5f'),_0x4cef59);throw _0x4cef59;});}return _0x5d9c82;})[_0x1841('0x29')](respondWithResult(_0x515c49,0xc9))[_0x1841('0x56')](handleError(_0x515c49,null));};exports['update']=function(_0x5d0870,_0x256d3d){if(_0x5d0870[_0x1841('0x58')]['id']){delete _0x5d0870[_0x1841('0x58')]['id'];}return db[_0x1841('0x3c')][_0x1841('0x34')]({'where':{'id':_0x5d0870[_0x1841('0x51')]['id']}})['then'](handleEntityNotFound(_0x256d3d,null))[_0x1841('0x29')](function(_0x47ae1){if(_0x47ae1){return db[_0x1841('0x3c')][_0x1841('0x27')](_[_0x1841('0x49')](_0x5d0870[_0x1841('0x58')],[_0x1841('0x59'),'context',_0x1841('0x60'),_0x1841('0x61'),'cutdigits','mandatoryDisposition']),{'where':{'context':_0x47ae1[_0x1841('0x62')],'exten':_0x47ae1[_0x1841('0x59')]},'individualHooks':!![]})['then'](function(_0x48cbff){return _0x48cbff;});}return null;})[_0x1841('0x29')](respondWithStatusCode(_0x256d3d,null))['catch'](handleError(_0x256d3d,null));};exports[_0x1841('0x63')]=function(_0x5e82a8,_0x578a86,_0x2a8b99){return db[_0x1841('0x3c')][_0x1841('0x64')]({'where':{'id':_0x5e82a8[_0x1841('0x51')]['id']}})[_0x1841('0x29')](handleEntityNotFound(_0x578a86,null))['then'](function(_0x1140f7){if(_0x1140f7){return db['sequelize'][_0x1841('0x65')](function(_0x17e04d){return db[_0x1841('0x3c')][_0x1841('0x28')]({'where':{'VoiceExtensionId':_0x5e82a8[_0x1841('0x51')]['id']},'transaction':_0x17e04d})[_0x1841('0x29')](function(_0x247a3a){var _0x363871=_[_0x1841('0x32')](_0x5e82a8[_0x1841('0x58')],function(_0xb18c0e){_0xb18c0e[_0x1841('0x66')]=_0x5e82a8[_0x1841('0x51')]['id'];return _0xb18c0e;});return db[_0x1841('0x3c')][_0x1841('0x67')](_0x363871,{'transaction':_0x17e04d});});})['then'](function(){return db[_0x1841('0x3c')][_0x1841('0x68')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5e82a8[_0x1841('0x51')]['id']},'order':_0x1841('0x69')});});}})['then'](respondWithResult(_0x578a86,null))['catch'](handleError(_0x578a86,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index cae68ce..8e50495 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(_0x3a9d89,_0x5a966f){var _0x1a5b5e=function(_0x16520a){while(--_0x16520a){_0x3a9d89['push'](_0x3a9d89['shift']());}};_0x1a5b5e(++_0x5a966f);}(_0x00bb,0x1d8));var _0xb00b=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x00bb[_0xbca1b1];return _0x4e1686;};'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 _0x9bde=['exports','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x5ce34a,_0x57887e){var _0x309350=function(_0x52a947){while(--_0x52a947){_0x5ce34a['push'](_0x5ce34a['shift']());}};_0x309350(++_0x57887e);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2707f9,_0x2d73b3){_0x2707f9=_0x2707f9-0x0;var _0x365e17=_0x9bde[_0x2707f9];return _0x365e17;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xe9bd('0x0'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xe9bd('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe9bd('0x2'),'afterDestroy':_0xe9bd('0x3')};function emitEvent(_0x131f6a){return function(_0x1c1b34,_0x10822d,_0x1a4d14){VoiceExtensionEvents[_0xe9bd('0x4')](_0x131f6a+':'+_0x1c1b34['id'],_0x1c1b34);VoiceExtensionEvents['emit'](_0x131f6a,_0x1c1b34);_0x1a4d14(null);};}for(var e in events){if(events[_0xe9bd('0x5')](e)){var event=events[e];VoiceExtension[_0xe9bd('0x6')](e,emitEvent(event));}}module[_0xe9bd('0x7')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 87bc4f5..ff5d49c 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 _0xba33=['VoiceExtension','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceExtension.attributes','define'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xba33,0x85));var _0x3ba3=function(_0x5ac918,_0x40234e){_0x5ac918=_0x5ac918-0x0;var _0x217317=_0xba33[_0x5ac918];return _0x217317;};'use strict';var _=require(_0x3ba3('0x0'));var util=require('util');var logger=require(_0x3ba3('0x1'))(_0x3ba3('0x2'));var moment=require(_0x3ba3('0x3'));var BPromise=require(_0x3ba3('0x4'));var rp=require(_0x3ba3('0x5'));var fs=require('fs');var path=require(_0x3ba3('0x6'));var rimraf=require(_0x3ba3('0x7'));var config=require(_0x3ba3('0x8'));var attributes=require(_0x3ba3('0x9'));module['exports']=function(_0x1251e1,_0x408a02){return _0x1251e1[_0x3ba3('0xa')](_0x3ba3('0xb'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x789b=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','VoiceExtension'];(function(_0x1db251,_0xf0443d){var _0x56685a=function(_0x6ec6b7){while(--_0x6ec6b7){_0x1db251['push'](_0x1db251['shift']());}};_0x56685a(++_0xf0443d);}(_0x789b,0xf0));var _0xb789=function(_0x3e85a3,_0x3a399f){_0x3e85a3=_0x3e85a3-0x0;var _0x12789b=_0x789b[_0x3e85a3];return _0x12789b;};'use strict';var _=require(_0xb789('0x0'));var util=require(_0xb789('0x1'));var logger=require(_0xb789('0x2'))(_0xb789('0x3'));var moment=require(_0xb789('0x4'));var BPromise=require(_0xb789('0x5'));var rp=require(_0xb789('0x6'));var fs=require('fs');var path=require(_0xb789('0x7'));var rimraf=require(_0xb789('0x8'));var config=require(_0xb789('0x9'));var attributes=require('./voiceExtension.attributes');module['exports']=function(_0xed2dda,_0x5f15cf){return _0xed2dda[_0xb789('0xa')](_0xb789('0xb'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 4412195..e6e12ad 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 _0xbaf0=['socket.io-emitter','./voiceExtension.socket','register','request','then','info','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceExtension,\x20%s,\x20%s','message','result','catch','VoiceExtension','findAll','options','raw','attributes','limit','include','map','model','GetVoiceExtension','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x2254db,_0x29677a){var _0x38bf76=function(_0x3ef9f4){while(--_0x3ef9f4){_0x2254db['push'](_0x2254db['shift']());}};_0x38bf76(++_0x29677a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});config[_0x0baf('0xc')]=_[_0x0baf('0xd')](config[_0x0baf('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0baf('0xe'))(new Redis(config['redis']));require(_0x0baf('0xf'))[_0x0baf('0x10')](socket);function respondWithRpcPromise(_0x465528,_0x2f46e8,_0x7f54d4){return new BPromise(function(_0xf4c8ac,_0x41cead){return client[_0x0baf('0x11')](_0x465528,_0x7f54d4)[_0x0baf('0x12')](function(_0x1d60a2){logger[_0x0baf('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x2f46e8,'request\x20sent');logger[_0x0baf('0x14')](_0x0baf('0x15'),_0x2f46e8,_0x0baf('0x16'),JSON[_0x0baf('0x17')](_0x1d60a2));if(_0x1d60a2['error']){if(_0x1d60a2[_0x0baf('0x18')]['code']===0x1f4){logger[_0x0baf('0x18')](_0x0baf('0x19'),_0x2f46e8,_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);return _0x41cead(_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x2f46e8,_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);return _0xf4c8ac(_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);}else{logger[_0x0baf('0x13')](_0x0baf('0x19'),_0x2f46e8,'request\x20sent');_0xf4c8ac(_0x1d60a2[_0x0baf('0x1b')][_0x0baf('0x1a')]);}})[_0x0baf('0x1c')](function(_0x3e9cb4){logger[_0x0baf('0x18')](_0x0baf('0x19'),_0x2f46e8,_0x3e9cb4);_0x41cead(_0x3e9cb4);});});}exports['GetVoiceExtension']=function(_0x5cff5d){var _0x1410ec=this;return new Promise(function(_0x154f48,_0x32e839){return db[_0x0baf('0x1d')][_0x0baf('0x1e')]({'raw':_0x5cff5d[_0x0baf('0x1f')]?_0x5cff5d[_0x0baf('0x1f')][_0x0baf('0x20')]===undefined?!![]:![]:!![],'where':_0x5cff5d[_0x0baf('0x1f')]?_0x5cff5d[_0x0baf('0x1f')]['where']||null:null,'attributes':_0x5cff5d[_0x0baf('0x1f')]?_0x5cff5d['options'][_0x0baf('0x21')]||null:null,'limit':_0x5cff5d['options']?_0x5cff5d['options'][_0x0baf('0x22')]||null:null,'include':_0x5cff5d['options']?_0x5cff5d['options'][_0x0baf('0x23')]?_[_0x0baf('0x24')](_0x5cff5d[_0x0baf('0x1f')][_0x0baf('0x23')],function(_0x3a1ba1){return{'model':db[_0x3a1ba1['model']],'as':_0x3a1ba1['as'],'attributes':_0x3a1ba1[_0x0baf('0x21')],'include':_0x3a1ba1[_0x0baf('0x23')]?_[_0x0baf('0x24')](_0x3a1ba1[_0x0baf('0x23')],function(_0x3843b8){return{'model':db[_0x3843b8[_0x0baf('0x25')]],'as':_0x3843b8['as'],'attributes':_0x3843b8[_0x0baf('0x21')],'include':_0x3843b8['include']?_[_0x0baf('0x24')](_0x3843b8[_0x0baf('0x23')],function(_0xcaf13d){return{'model':db[_0xcaf13d[_0x0baf('0x25')]],'as':_0xcaf13d['as'],'attributes':_0xcaf13d['attributes']};}):[]};}):[]};}):[]:[]})[_0x0baf('0x12')](function(_0x34a58a){logger['info'](_0x0baf('0x26'),_0x5cff5d);logger[_0x0baf('0x14')](_0x0baf('0x26'),_0x5cff5d,JSON[_0x0baf('0x17')](_0x34a58a));_0x154f48(_0x34a58a);})[_0x0baf('0x1c')](function(_0x366924){logger[_0x0baf('0x18')]('GetVoiceExtension',_0x366924[_0x0baf('0x1a')],_0x5cff5d);_0x32e839(_0x1410ec[_0x0baf('0x18')](0x1f4,_0x366924[_0x0baf('0x1a')]));});});}; \ No newline at end of file +var _0xbaf0=['socket.io-emitter','./voiceExtension.socket','register','request','then','info','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceExtension,\x20%s,\x20%s','message','result','catch','VoiceExtension','findAll','options','raw','attributes','limit','include','map','model','GetVoiceExtension','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x3bf3f1,_0x5b8238){var _0x5a0c0c=function(_0x303fac){while(--_0x303fac){_0x3bf3f1['push'](_0x3bf3f1['shift']());}};_0x5a0c0c(++_0x5b8238);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});config[_0x0baf('0xc')]=_[_0x0baf('0xd')](config[_0x0baf('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0baf('0xe'))(new Redis(config['redis']));require(_0x0baf('0xf'))[_0x0baf('0x10')](socket);function respondWithRpcPromise(_0x465528,_0x2f46e8,_0x7f54d4){return new BPromise(function(_0xf4c8ac,_0x41cead){return client[_0x0baf('0x11')](_0x465528,_0x7f54d4)[_0x0baf('0x12')](function(_0x1d60a2){logger[_0x0baf('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x2f46e8,'request\x20sent');logger[_0x0baf('0x14')](_0x0baf('0x15'),_0x2f46e8,_0x0baf('0x16'),JSON[_0x0baf('0x17')](_0x1d60a2));if(_0x1d60a2['error']){if(_0x1d60a2[_0x0baf('0x18')]['code']===0x1f4){logger[_0x0baf('0x18')](_0x0baf('0x19'),_0x2f46e8,_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);return _0x41cead(_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x2f46e8,_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);return _0xf4c8ac(_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);}else{logger[_0x0baf('0x13')](_0x0baf('0x19'),_0x2f46e8,'request\x20sent');_0xf4c8ac(_0x1d60a2[_0x0baf('0x1b')][_0x0baf('0x1a')]);}})[_0x0baf('0x1c')](function(_0x3e9cb4){logger[_0x0baf('0x18')](_0x0baf('0x19'),_0x2f46e8,_0x3e9cb4);_0x41cead(_0x3e9cb4);});});}exports['GetVoiceExtension']=function(_0x5cff5d){var _0x1410ec=this;return new Promise(function(_0x154f48,_0x32e839){return db[_0x0baf('0x1d')][_0x0baf('0x1e')]({'raw':_0x5cff5d[_0x0baf('0x1f')]?_0x5cff5d[_0x0baf('0x1f')][_0x0baf('0x20')]===undefined?!![]:![]:!![],'where':_0x5cff5d[_0x0baf('0x1f')]?_0x5cff5d[_0x0baf('0x1f')]['where']||null:null,'attributes':_0x5cff5d[_0x0baf('0x1f')]?_0x5cff5d['options'][_0x0baf('0x21')]||null:null,'limit':_0x5cff5d['options']?_0x5cff5d['options'][_0x0baf('0x22')]||null:null,'include':_0x5cff5d['options']?_0x5cff5d['options'][_0x0baf('0x23')]?_[_0x0baf('0x24')](_0x5cff5d[_0x0baf('0x1f')][_0x0baf('0x23')],function(_0x3a1ba1){return{'model':db[_0x3a1ba1['model']],'as':_0x3a1ba1['as'],'attributes':_0x3a1ba1[_0x0baf('0x21')],'include':_0x3a1ba1[_0x0baf('0x23')]?_[_0x0baf('0x24')](_0x3a1ba1[_0x0baf('0x23')],function(_0x3843b8){return{'model':db[_0x3843b8[_0x0baf('0x25')]],'as':_0x3843b8['as'],'attributes':_0x3843b8[_0x0baf('0x21')],'include':_0x3843b8['include']?_[_0x0baf('0x24')](_0x3843b8[_0x0baf('0x23')],function(_0xcaf13d){return{'model':db[_0xcaf13d[_0x0baf('0x25')]],'as':_0xcaf13d['as'],'attributes':_0xcaf13d['attributes']};}):[]};}):[]};}):[]:[]})[_0x0baf('0x12')](function(_0x34a58a){logger['info'](_0x0baf('0x26'),_0x5cff5d);logger[_0x0baf('0x14')](_0x0baf('0x26'),_0x5cff5d,JSON[_0x0baf('0x17')](_0x34a58a));_0x154f48(_0x34a58a);})[_0x0baf('0x1c')](function(_0x366924){logger[_0x0baf('0x18')]('GetVoiceExtension',_0x366924[_0x0baf('0x1a')],_0x5cff5d);_0x32e839(_0x1410ec[_0x0baf('0x18')](0x1f4,_0x366924[_0x0baf('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 2059659..2e0b6a3 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 _0x89d9=['voiceExtension:','save','remove','update','emit','removeListener','register','length'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0x89d9,0x109));var _0x989d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x89d9[_0x59ee6f];return _0x4c0979;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x989d('0x0'),_0x989d('0x1'),_0x989d('0x2')];function createListener(_0x113d8a,_0x3a5ef3){return function(_0x37a041){_0x3a5ef3[_0x989d('0x3')](_0x113d8a,_0x37a041);};}function removeListener(_0x5d7bdc,_0x1f28dd){return function(){VoiceExtensionEvents[_0x989d('0x4')](_0x5d7bdc,_0x1f28dd);};}exports[_0x989d('0x5')]=function(_0x4bec68){for(var _0x59b4fc=0x0,_0x13ab15=events[_0x989d('0x6')];_0x59b4fc<_0x13ab15;_0x59b4fc++){var _0x1b3859=events[_0x59b4fc];var _0x95e91d=createListener(_0x989d('0x7')+_0x1b3859,_0x4bec68);VoiceExtensionEvents['on'](_0x1b3859,_0x95e91d);}}; \ No newline at end of file +var _0x08b5=['emit','removeListener','length','voiceExtension:','./voiceExtension.events','save','update'];(function(_0x108de1,_0x10f21b){var _0x244bfc=function(_0x5bb7f5){while(--_0x5bb7f5){_0x108de1['push'](_0x108de1['shift']());}};_0x244bfc(++_0x10f21b);}(_0x08b5,0x1c4));var _0x508b=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x08b5[_0x160c73];return _0xd9302;};'use strict';var VoiceExtensionEvents=require(_0x508b('0x0'));var events=[_0x508b('0x1'),'remove',_0x508b('0x2')];function createListener(_0x125cf9,_0x7f6066){return function(_0x3622aa){_0x7f6066[_0x508b('0x3')](_0x125cf9,_0x3622aa);};}function removeListener(_0x55dae2,_0x1112e9){return function(){VoiceExtensionEvents[_0x508b('0x4')](_0x55dae2,_0x1112e9);};}exports['register']=function(_0x358b87){for(var _0xf0415c=0x0,_0x4377b8=events[_0x508b('0x5')];_0xf0415c<_0x4377b8;_0xf0415c++){var _0x168c19=events[_0xf0415c];var _0x2c5c84=createListener(_0x508b('0x6')+_0x168c19,_0x358b87);VoiceExtensionEvents['on'](_0x168c19,_0x2c5c84);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 33b2b05..b9098d7 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 _0x1633=['../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x1bf4da,_0x730577){var _0x47aea0=function(_0x2a5a3d){while(--_0x2a5a3d){_0x1bf4da['push'](_0x1bf4da['shift']());}};_0x47aea0(++_0x730577);}(_0x1633,0x189));var _0x3163=function(_0x5c07b1,_0x5a4674){_0x5c07b1=_0x5c07b1-0x0;var _0x497174=_0x1633[_0x5c07b1];return _0x497174;};'use strict';var multer=require(_0x3163('0x0'));var util=require('util');var path=require(_0x3163('0x1'));var timeout=require(_0x3163('0x2'));var express=require(_0x3163('0x3'));var router=express['Router']();var auth=require(_0x3163('0x4'));var interaction=require(_0x3163('0x5'));var config=require(_0x3163('0x6'));var controller=require(_0x3163('0x7'));router[_0x3163('0x8')]('/',auth[_0x3163('0x9')](),controller[_0x3163('0xa')]);router[_0x3163('0x8')](_0x3163('0xb'),auth[_0x3163('0x9')](),controller[_0x3163('0xc')]);router[_0x3163('0x8')](_0x3163('0xd'),auth['isAuthenticated'](),controller[_0x3163('0xe')]);router[_0x3163('0xf')]('/',auth[_0x3163('0x9')](),controller[_0x3163('0x10')]);router['put']('/:id',auth[_0x3163('0x9')](),controller[_0x3163('0x11')]);router[_0x3163('0x12')](_0x3163('0xb'),auth[_0x3163('0x9')](),controller[_0x3163('0x13')]);module[_0x3163('0x14')]=router; \ No newline at end of file +var _0x99b6=['../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','post','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x178e48,_0x51ea1b){var _0x46187f=function(_0x5aab2d){while(--_0x5aab2d){_0x178e48['push'](_0x178e48['shift']());}};_0x46187f(++_0x51ea1b);}(_0x99b6,0xc1));var _0x699b=function(_0x95f0fe,_0x1f7cce){_0x95f0fe=_0x95f0fe-0x0;var _0x18f387=_0x99b6[_0x95f0fe];return _0x18f387;};'use strict';var multer=require(_0x699b('0x0'));var util=require(_0x699b('0x1'));var path=require('path');var timeout=require(_0x699b('0x2'));var express=require(_0x699b('0x3'));var router=express[_0x699b('0x4')]();var auth=require(_0x699b('0x5'));var interaction=require(_0x699b('0x6'));var config=require(_0x699b('0x7'));var controller=require(_0x699b('0x8'));router[_0x699b('0x9')]('/',auth[_0x699b('0xa')](),controller[_0x699b('0xb')]);router[_0x699b('0x9')](_0x699b('0xc'),auth['isAuthenticated'](),controller[_0x699b('0xd')]);router['get']('/:id/messages',auth[_0x699b('0xa')](),controller[_0x699b('0xe')]);router[_0x699b('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x699b('0x10')](_0x699b('0xc'),auth['isAuthenticated'](),controller[_0x699b('0x11')]);router[_0x699b('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x699b('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index faa5d8a..4ffe4f4 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 _0xe3c8=['sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox'];(function(_0x5de54f,_0x3dc2ea){var _0x53ef19=function(_0x47863f){while(--_0x47863f){_0x5de54f['push'](_0x5de54f['shift']());}};_0x53ef19(++_0x3dc2ea);}(_0xe3c8,0x1a2));var _0x8e3c=function(_0x1a370c,_0x5ccdb0){_0x1a370c=_0x1a370c-0x0;var _0x49b783=_0xe3c8[_0x1a370c];return _0x49b783;};'use strict';var Sequelize=require(_0x8e3c('0x0'));module[_0x8e3c('0x1')]={'customer_id':{'type':Sequelize[_0x8e3c('0x2')]},'context':{'type':Sequelize[_0x8e3c('0x2')],'defaultValue':_0x8e3c('0x3'),'unique':_0x8e3c('0x4')},'mailbox':{'type':Sequelize[_0x8e3c('0x2')],'defaultValue':'','allowNull':![],'unique':_0x8e3c('0x4')},'password':{'type':Sequelize[_0x8e3c('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x8e3c('0x2')],'validate':{'isEmail':!![]},'set':function(_0x110d6c){this[_0x8e3c('0x5')](_0x8e3c('0x6'),typeof _0x110d6c==='string'&&_0x110d6c[_0x8e3c('0x7')]()?_0x110d6c[_0x8e3c('0x7')]():null);}},'pager':{'type':Sequelize[_0x8e3c('0x2')]},'tz':{'type':Sequelize[_0x8e3c('0x2')],'defaultValue':_0x8e3c('0x8')},'attach':{'type':Sequelize[_0x8e3c('0x9')]('yes','no'),'defaultValue':_0x8e3c('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x8e3c('0x9')]('yes','no'),'defaultValue':_0x8e3c('0xa'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x8e3c('0x9')](_0x8e3c('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x8e3c('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x8e3c('0x9')](_0x8e3c('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x8e3c('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x8e3c('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x8e3c('0x9')](_0x8e3c('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x8e3c('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x8e3c('0x9')]('yes','no'),'defaultValue':_0x8e3c('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x8e3c('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x8e3c('0x9')](_0x8e3c('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x8e3c('0x9')](_0x8e3c('0xa'),'no'),'defaultValue':_0x8e3c('0xa'),'allowNull':![]},'stamp':{'type':_0x8e3c('0xc')},'emailsubject':{'type':Sequelize[_0x8e3c('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x8e3c('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x8e3c('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x8e3c('0xe')],'get':function(){return this[_0x8e3c('0xf')](_0x8e3c('0x10'))+_0x8e3c('0x11')+this[_0x8e3c('0xf')](_0x8e3c('0x12'));}}}; \ No newline at end of file +var _0xf2ee=['exports','STRING','from-voicemail','setDataValue','email','string','trim','central','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize'];(function(_0x1635fe,_0x5f1d9f){var _0x3c512a=function(_0x26b53d){while(--_0x26b53d){_0x1635fe['push'](_0x1635fe['shift']());}};_0x3c512a(++_0x5f1d9f);}(_0xf2ee,0xb3));var _0xef2e=function(_0x51b086,_0x85d3c8){_0x51b086=_0x51b086-0x0;var _0x34b182=_0xf2ee[_0x51b086];return _0x34b182;};'use strict';var Sequelize=require(_0xef2e('0x0'));module[_0xef2e('0x1')]={'customer_id':{'type':Sequelize[_0xef2e('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0xef2e('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0xef2e('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xef2e('0x2')]},'fullname':{'type':Sequelize[_0xef2e('0x2')]},'email':{'type':Sequelize[_0xef2e('0x2')],'validate':{'isEmail':!![]},'set':function(_0x4bb616){this[_0xef2e('0x4')](_0xef2e('0x5'),typeof _0x4bb616===_0xef2e('0x6')&&_0x4bb616[_0xef2e('0x7')]()?_0x4bb616[_0xef2e('0x7')]():null);}},'pager':{'type':Sequelize[_0xef2e('0x2')]},'tz':{'type':Sequelize[_0xef2e('0x2')],'defaultValue':_0xef2e('0x8')},'attach':{'type':Sequelize[_0xef2e('0x9')]('yes','no'),'defaultValue':_0xef2e('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0xef2e('0x9')](_0xef2e('0xa'),'no'),'defaultValue':_0xef2e('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0xef2e('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xef2e('0x9')](_0xef2e('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xef2e('0x9')](_0xef2e('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xef2e('0x9')](_0xef2e('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xef2e('0x9')](_0xef2e('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xef2e('0x9')](_0xef2e('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xef2e('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xef2e('0x9')](_0xef2e('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xef2e('0x9')](_0xef2e('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xef2e('0x9')](_0xef2e('0xa'),'no'),'defaultValue':_0xef2e('0xa'),'allowNull':![]},'stamp':{'type':_0xef2e('0xb')},'emailsubject':{'type':Sequelize[_0xef2e('0x2')]},'emailbody':{'type':Sequelize[_0xef2e('0x2')]},'maxsecs':{'type':Sequelize[_0xef2e('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xef2e('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xef2e('0xd')],'get':function(){return this[_0xef2e('0xe')](_0xef2e('0xf'))+_0xef2e('0x10')+this[_0xef2e('0xe')](_0xef2e('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index fb8c5e4..8731ac4 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 _0x52a1=['html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','Content-Range','json','apply','reject','save','update','destroy','Voicemails','UserProfileResource','then','error','name','index','VoiceMail','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','limit','order','where','pick','filter','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','intersection','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','findOne','nolimit','sort','merge','map','mailbox','VoiceMailMessage','findAndCountAll'];(function(_0x36e580,_0x1018b5){var _0xa2ccea=function(_0x23fcc5){while(--_0x23fcc5){_0x36e580['push'](_0x36e580['shift']());}};_0xa2ccea(++_0x1018b5);}(_0x52a1,0x1a9));var _0x152a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x52a1[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x152a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x152a('0x1'));var zipdir=require(_0x152a('0x2'));var jsonpatch=require(_0x152a('0x3'));var rp=require(_0x152a('0x4'));var moment=require('moment');var BPromise=require(_0x152a('0x5'));var Mustache=require(_0x152a('0x6'));var util=require(_0x152a('0x7'));var path=require(_0x152a('0x8'));var sox=require(_0x152a('0x9'));var csv=require(_0x152a('0xa'));var ejs=require(_0x152a('0xb'));var fs=require('fs');var _=require(_0x152a('0xc'));var squel=require(_0x152a('0xd'));var crypto=require('crypto');var jsforce=require(_0x152a('0xe'));var deskjs=require(_0x152a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x152a('0x10'));var Papa=require('papaparse');var Redis=require(_0x152a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x152a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x152a('0x13'))('api');var utils=require(_0x152a('0x14'));var config=require(_0x152a('0x15'));var db=require(_0x152a('0x16'))['db'];function respondWithStatusCode(_0x3ee7d2,_0x18b2f8){_0x18b2f8=_0x18b2f8||0xcc;return function(_0x4fee4a){if(_0x4fee4a){return _0x3ee7d2[_0x152a('0x17')](_0x18b2f8);}return _0x3ee7d2['status'](_0x18b2f8)[_0x152a('0x18')]();};}function respondWithResult(_0x271b9c,_0x1ae115){_0x1ae115=_0x1ae115||0xc8;return function(_0x8ca852){if(_0x8ca852){return _0x271b9c[_0x152a('0x19')](_0x1ae115)['json'](_0x8ca852);}};}function respondWithFilteredResult(_0x51a7ea,_0x42bc2c){return function(_0xb81f6f){if(_0xb81f6f){var _0x377e12=_0xb81f6f[_0x152a('0x1a')],_0x44c3f2=_0x42bc2c[_0x152a('0x1b')],_0x41e14f=_0x42bc2c[_0x152a('0x1b')]+_0x42bc2c['limit'],_0x2144a5;if(_0x41e14f>=_0x377e12){_0x41e14f=_0x377e12;_0x2144a5=0xc8;}else{_0x2144a5=0xce;}_0x51a7ea['status'](_0x2144a5);return _0x51a7ea['set'](_0x152a('0x1c'),_0x44c3f2+'-'+_0x41e14f+'/'+_0x377e12)[_0x152a('0x1d')](_0xb81f6f);}return null;};}function patchUpdates(_0x324d53){return function(_0x1cec2b){try{jsonpatch[_0x152a('0x1e')](_0x1cec2b,_0x324d53,!![]);}catch(_0x336c60){return BPromise[_0x152a('0x1f')](_0x336c60);}return _0x1cec2b[_0x152a('0x20')]();};}function saveUpdates(_0x5a9a12,_0x3e6722){return function(_0x5d0d88){if(_0x5d0d88){return _0x5d0d88[_0x152a('0x21')](_0x5a9a12)['then'](function(_0x5b7765){return _0x5b7765;});}return null;};}function removeEntity(_0x241f03,_0x38e294){return function(_0x521ba5){if(_0x521ba5){return _0x521ba5[_0x152a('0x22')]()['then'](function(){var _0x43a8a7=_0x521ba5['get']({'plain':!![]});var _0x5c00ac=_0x152a('0x23');return db[_0x152a('0x24')][_0x152a('0x22')]({'where':{'type':_0x5c00ac,'resourceId':_0x43a8a7['id']}})[_0x152a('0x25')](function(){return _0x521ba5;});})['then'](function(){_0x241f03[_0x152a('0x19')](0xcc)[_0x152a('0x18')]();});}};}function handleEntityNotFound(_0x53ff24,_0xedfa76){return function(_0x3ae60e){if(!_0x3ae60e){_0x53ff24[_0x152a('0x17')](0x194);}return _0x3ae60e;};}function handleError(_0x595abb,_0x5a345d){_0x5a345d=_0x5a345d||0x1f4;return function(_0x342d4c){logger[_0x152a('0x26')](_0x342d4c['stack']);if(_0x342d4c[_0x152a('0x27')]){delete _0x342d4c['name'];}_0x595abb[_0x152a('0x19')](_0x5a345d)['send'](_0x342d4c);};}exports[_0x152a('0x28')]=function(_0x4e7a95,_0x24efd7){var _0x39597d={},_0x5e55dc={},_0x1f2c43={'count':0x0,'rows':[]};var _0x152896=db[_0x152a('0x29')][_0x152a('0x2a')];_0x5e55dc[_0x152a('0x2b')]=_[_0x152a('0x2c')](_0x152896);_0x5e55dc[_0x152a('0x2d')]=_[_0x152a('0x2c')](_0x4e7a95[_0x152a('0x2d')]);_0x5e55dc[_0x152a('0x2e')]=_['intersection'](_0x5e55dc['model'],_0x5e55dc['query']);_0x39597d[_0x152a('0x2f')]=_['intersection'](_0x5e55dc[_0x152a('0x2b')],qs[_0x152a('0x30')](_0x4e7a95[_0x152a('0x2d')][_0x152a('0x30')]));_0x39597d[_0x152a('0x2f')]=_0x39597d[_0x152a('0x2f')][_0x152a('0x31')]?_0x39597d[_0x152a('0x2f')]:_0x5e55dc['model'];if(!_0x4e7a95[_0x152a('0x2d')][_0x152a('0x32')]('nolimit')){_0x39597d[_0x152a('0x33')]=qs[_0x152a('0x33')](_0x4e7a95[_0x152a('0x2d')][_0x152a('0x33')]);_0x39597d[_0x152a('0x1b')]=qs['offset'](_0x4e7a95['query'][_0x152a('0x1b')]);}_0x39597d[_0x152a('0x34')]=qs['sort'](_0x4e7a95[_0x152a('0x2d')]['sort']);_0x39597d[_0x152a('0x35')]=qs['filters'](_[_0x152a('0x36')](_0x4e7a95[_0x152a('0x2d')],_0x5e55dc[_0x152a('0x2e')]));if(_0x4e7a95[_0x152a('0x2d')][_0x152a('0x37')]){_0x39597d[_0x152a('0x35')]=_['merge'](_0x39597d[_0x152a('0x35')],{'$or':_['map'](_0x152896,function(_0x5c3da1){if(_0x5c3da1[_0x152a('0x38')]['key']!==_0x152a('0x39')){var _0x5aa266={};_0x5aa266[_0x5c3da1[_0x152a('0x3a')]]={'$like':'%'+_0x4e7a95['query'][_0x152a('0x37')]+'%'};return _0x5aa266;}})});}_0x39597d=_['merge']({},_0x39597d,_0x4e7a95[_0x152a('0x3b')]);var _0x2c756a={'where':_0x39597d[_0x152a('0x35')]};return db['VoiceMail'][_0x152a('0x1a')](_0x2c756a)[_0x152a('0x25')](function(_0x4f7789){_0x1f2c43[_0x152a('0x1a')]=_0x4f7789;if(_0x4e7a95['query'][_0x152a('0x3c')]){_0x39597d[_0x152a('0x3d')]=[{'all':!![]}];}return db[_0x152a('0x29')][_0x152a('0x3e')](_0x39597d);})[_0x152a('0x25')](function(_0x3ec6d5){_0x1f2c43[_0x152a('0x3f')]=_0x3ec6d5;return _0x1f2c43;})[_0x152a('0x25')](respondWithFilteredResult(_0x24efd7,_0x39597d))[_0x152a('0x40')](handleError(_0x24efd7,null));};exports['show']=function(_0x576fd7,_0x2af510){var _0x3b7c11={'raw':!![],'where':{'id':_0x576fd7[_0x152a('0x41')]['id']}},_0x2b855b={};_0x2b855b['model']=_[_0x152a('0x2c')](db[_0x152a('0x29')][_0x152a('0x2a')]);_0x2b855b[_0x152a('0x2d')]=_[_0x152a('0x2c')](_0x576fd7[_0x152a('0x2d')]);_0x2b855b[_0x152a('0x2e')]=_['intersection'](_0x2b855b[_0x152a('0x2b')],_0x2b855b[_0x152a('0x2d')]);_0x3b7c11[_0x152a('0x2f')]=_[_0x152a('0x42')](_0x2b855b[_0x152a('0x2b')],qs['fields'](_0x576fd7['query']['fields']));_0x3b7c11[_0x152a('0x2f')]=_0x3b7c11[_0x152a('0x2f')]['length']?_0x3b7c11[_0x152a('0x2f')]:_0x2b855b['model'];if(_0x576fd7[_0x152a('0x2d')][_0x152a('0x3c')]){_0x3b7c11['include']=[{'all':!![]}];}_0x3b7c11=_['merge']({},_0x3b7c11,_0x576fd7[_0x152a('0x3b')]);return db[_0x152a('0x29')]['find'](_0x3b7c11)[_0x152a('0x25')](handleEntityNotFound(_0x2af510,null))[_0x152a('0x25')](respondWithResult(_0x2af510,null))[_0x152a('0x40')](handleError(_0x2af510,null));};exports['create']=function(_0x53a467,_0x418ce9){return db[_0x152a('0x29')][_0x152a('0x43')](_0x53a467[_0x152a('0x44')],{})['then'](function(_0x1c9d28){var _0x4d5291=_0x53a467[_0x152a('0x45')][_0x152a('0x46')]({'plain':!![]});if(!_0x4d5291)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d5291[_0x152a('0x47')]===_0x152a('0x45')){var _0x44aad9=_0x1c9d28[_0x152a('0x46')]({'plain':!![]});var _0x3975b8=_0x152a('0x23');return db[_0x152a('0x48')]['find']({'where':{'name':_0x3975b8,'userProfileId':_0x4d5291[_0x152a('0x49')]},'raw':!![]})[_0x152a('0x25')](function(_0x2257cc){if(_0x2257cc&&_0x2257cc[_0x152a('0x4a')]===0x0){return db['UserProfileResource'][_0x152a('0x43')]({'name':_0x44aad9[_0x152a('0x27')],'resourceId':_0x44aad9['id'],'type':_0x2257cc[_0x152a('0x27')],'sectionId':_0x2257cc['id']},{})[_0x152a('0x25')](function(){return _0x1c9d28;});}else{return _0x1c9d28;}})['catch'](function(_0x4f7db3){logger[_0x152a('0x26')](_0x152a('0x4b'),_0x4f7db3);throw _0x4f7db3;});}return _0x1c9d28;})[_0x152a('0x25')](respondWithResult(_0x418ce9,0xc9))[_0x152a('0x40')](handleError(_0x418ce9,null));};exports['update']=function(_0x2f7128,_0x434b79){if(_0x2f7128['body']['id']){delete _0x2f7128['body']['id'];}return db[_0x152a('0x29')][_0x152a('0x4c')]({'where':{'id':_0x2f7128[_0x152a('0x41')]['id']}})[_0x152a('0x25')](handleEntityNotFound(_0x434b79,null))[_0x152a('0x25')](saveUpdates(_0x2f7128[_0x152a('0x44')],null))['then'](respondWithResult(_0x434b79,null))[_0x152a('0x40')](handleError(_0x434b79,null));};exports[_0x152a('0x22')]=function(_0x43550a,_0x24b167){return db['VoiceMail'][_0x152a('0x4c')]({'where':{'id':_0x43550a[_0x152a('0x41')]['id']}})[_0x152a('0x25')](handleEntityNotFound(_0x24b167,null))[_0x152a('0x25')](removeEntity(_0x24b167,null))[_0x152a('0x40')](handleError(_0x24b167,null));};exports['getMessages']=function(_0x2942a0,_0x39077e,_0x3ea115){return db[_0x152a('0x29')][_0x152a('0x4d')]({'where':{'id':_0x2942a0[_0x152a('0x41')]['id']}})[_0x152a('0x25')](handleEntityNotFound(_0x39077e,null))[_0x152a('0x25')](function(_0xaf31f2){var _0x37ad5e;var _0x1645b7={},_0x33751c={};_0x33751c[_0x152a('0x2b')]=_[_0x152a('0x2c')](db['VoiceMailMessage']['rawAttributes']);_0x33751c[_0x152a('0x2d')]=_['keys'](_0x2942a0[_0x152a('0x2d')]);_0x33751c['filters']=_[_0x152a('0x42')](_0x33751c[_0x152a('0x2b')],_0x33751c['query']);_0x1645b7[_0x152a('0x2f')]=_[_0x152a('0x42')](_0x33751c[_0x152a('0x2b')],qs[_0x152a('0x30')](_0x2942a0['query'][_0x152a('0x30')]));_0x1645b7[_0x152a('0x2f')]=_0x1645b7[_0x152a('0x2f')][_0x152a('0x31')]?_0x1645b7['attributes']:_0x33751c[_0x152a('0x2b')];if(!_0x2942a0[_0x152a('0x2d')][_0x152a('0x32')](_0x152a('0x4e'))){_0x1645b7[_0x152a('0x33')]=qs[_0x152a('0x33')](_0x2942a0['query'][_0x152a('0x33')]);_0x1645b7['offset']=qs['offset'](_0x2942a0[_0x152a('0x2d')]['offset']);}_0x1645b7[_0x152a('0x34')]=qs[_0x152a('0x4f')](_0x2942a0[_0x152a('0x2d')]['sort']);_0x1645b7['where']=qs[_0x152a('0x2e')](_[_0x152a('0x36')](_0x2942a0[_0x152a('0x2d')],_0x33751c[_0x152a('0x2e')]));if(_0x2942a0[_0x152a('0x2d')][_0x152a('0x37')]){_0x1645b7[_0x152a('0x35')]=_[_0x152a('0x50')](_0x1645b7['where'],{'$or':_[_0x152a('0x51')](_0x1645b7[_0x152a('0x2f')],function(_0x54ef67){var _0x49d495={};_0x49d495[_0x54ef67]={'$like':'%'+_0x2942a0[_0x152a('0x2d')][_0x152a('0x37')]+'%'};return _0x49d495;})});}_0x1645b7[_0x152a('0x35')]=_[_0x152a('0x50')](_0x1645b7[_0x152a('0x35')],{'mailboxuser':_0xaf31f2[_0x152a('0x52')]});_0x1645b7=_['merge']({},_0x1645b7,_0x2942a0[_0x152a('0x3b')]);return db[_0x152a('0x53')][_0x152a('0x54')](_0x1645b7)[_0x152a('0x25')](respondWithFilteredResult(_0x39077e,_0x1645b7));})[_0x152a('0x40')](handleError(_0x39077e,null));}; \ No newline at end of file +var _0x2045=['sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','get','Voicemails','UserProfileResource','error','stack','name','send','index','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','key','VIRTUAL','field','filter','VoiceMail','include','findAll','catch','show','params','includeAll','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','findOne','VoiceMailMessage','rawAttributes','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0x59387c,_0x200b33){var _0x8a12be=function(_0x5a9005){while(--_0x5a9005){_0x59387c['push'](_0x59387c['shift']());}};_0x8a12be(++_0x200b33);}(_0x2045,0x1a4));var _0x5204=function(_0x4dedd3,_0x175841){_0x4dedd3=_0x4dedd3-0x0;var _0x48f768=_0x2045[_0x4dedd3];return _0x48f768;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5204('0x0'));var rimraf=require(_0x5204('0x1'));var zipdir=require(_0x5204('0x2'));var jsonpatch=require(_0x5204('0x3'));var rp=require(_0x5204('0x4'));var moment=require(_0x5204('0x5'));var BPromise=require(_0x5204('0x6'));var Mustache=require(_0x5204('0x7'));var util=require(_0x5204('0x8'));var path=require(_0x5204('0x9'));var sox=require('sox');var csv=require(_0x5204('0xa'));var ejs=require(_0x5204('0xb'));var fs=require('fs');var _=require(_0x5204('0xc'));var squel=require('squel');var crypto=require(_0x5204('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5204('0xe'));var toCsv=require(_0x5204('0xa'));var querystring=require(_0x5204('0xf'));var Papa=require(_0x5204('0x10'));var Redis=require(_0x5204('0x11'));var authService=require(_0x5204('0x12'));var qs=require(_0x5204('0x13'));var hardwareService=require(_0x5204('0x14'));var logger=require(_0x5204('0x15'))(_0x5204('0x16'));var utils=require(_0x5204('0x17'));var config=require('../../config/environment');var db=require(_0x5204('0x18'))['db'];function respondWithStatusCode(_0x3ad533,_0xec17a2){_0xec17a2=_0xec17a2||0xcc;return function(_0xf8dc3e){if(_0xf8dc3e){return _0x3ad533[_0x5204('0x19')](_0xec17a2);}return _0x3ad533[_0x5204('0x1a')](_0xec17a2)[_0x5204('0x1b')]();};}function respondWithResult(_0x556157,_0x5f4f97){_0x5f4f97=_0x5f4f97||0xc8;return function(_0x53ae2a){if(_0x53ae2a){return _0x556157[_0x5204('0x1a')](_0x5f4f97)[_0x5204('0x1c')](_0x53ae2a);}};}function respondWithFilteredResult(_0x307432,_0x13ac56){return function(_0x4d1c1c){if(_0x4d1c1c){var _0x307371=_0x4d1c1c[_0x5204('0x1d')],_0x4127e9=_0x13ac56[_0x5204('0x1e')],_0x43f80f=_0x13ac56[_0x5204('0x1e')]+_0x13ac56[_0x5204('0x1f')],_0x4af20e;if(_0x43f80f>=_0x307371){_0x43f80f=_0x307371;_0x4af20e=0xc8;}else{_0x4af20e=0xce;}_0x307432['status'](_0x4af20e);return _0x307432[_0x5204('0x20')](_0x5204('0x21'),_0x4127e9+'-'+_0x43f80f+'/'+_0x307371)[_0x5204('0x1c')](_0x4d1c1c);}return null;};}function patchUpdates(_0x4d441d){return function(_0x36688c){try{jsonpatch['apply'](_0x36688c,_0x4d441d,!![]);}catch(_0x4f474c){return BPromise[_0x5204('0x22')](_0x4f474c);}return _0x36688c[_0x5204('0x23')]();};}function saveUpdates(_0x14fa6b,_0x493e45){return function(_0x437d9f){if(_0x437d9f){return _0x437d9f[_0x5204('0x24')](_0x14fa6b)['then'](function(_0x9b401){return _0x9b401;});}return null;};}function removeEntity(_0x2451bb,_0x4f0d6e){return function(_0x4d78d6){if(_0x4d78d6){return _0x4d78d6[_0x5204('0x25')]()[_0x5204('0x26')](function(){var _0x2d76d1=_0x4d78d6[_0x5204('0x27')]({'plain':!![]});var _0x1e2f50=_0x5204('0x28');return db[_0x5204('0x29')][_0x5204('0x25')]({'where':{'type':_0x1e2f50,'resourceId':_0x2d76d1['id']}})[_0x5204('0x26')](function(){return _0x4d78d6;});})[_0x5204('0x26')](function(){_0x2451bb[_0x5204('0x1a')](0xcc)[_0x5204('0x1b')]();});}};}function handleEntityNotFound(_0x5acfd1,_0x35fc74){return function(_0x453749){if(!_0x453749){_0x5acfd1['sendStatus'](0x194);}return _0x453749;};}function handleError(_0xeaf066,_0x39a21f){_0x39a21f=_0x39a21f||0x1f4;return function(_0x2a42dd){logger[_0x5204('0x2a')](_0x2a42dd[_0x5204('0x2b')]);if(_0x2a42dd[_0x5204('0x2c')]){delete _0x2a42dd[_0x5204('0x2c')];}_0xeaf066[_0x5204('0x1a')](_0x39a21f)[_0x5204('0x2d')](_0x2a42dd);};}exports[_0x5204('0x2e')]=function(_0x1eaf0f,_0x3fae4c){var _0x17df21={},_0x2698b3={},_0x3b2c55={'count':0x0,'rows':[]};var _0x31bbdd=db['VoiceMail']['rawAttributes'];_0x2698b3[_0x5204('0x2f')]=_['keys'](_0x31bbdd);_0x2698b3[_0x5204('0x30')]=_[_0x5204('0x31')](_0x1eaf0f[_0x5204('0x30')]);_0x2698b3[_0x5204('0x32')]=_[_0x5204('0x33')](_0x2698b3[_0x5204('0x2f')],_0x2698b3[_0x5204('0x30')]);_0x17df21['attributes']=_[_0x5204('0x33')](_0x2698b3[_0x5204('0x2f')],qs['fields'](_0x1eaf0f['query'][_0x5204('0x34')]));_0x17df21[_0x5204('0x35')]=_0x17df21[_0x5204('0x35')][_0x5204('0x36')]?_0x17df21[_0x5204('0x35')]:_0x2698b3['model'];if(!_0x1eaf0f[_0x5204('0x30')][_0x5204('0x37')](_0x5204('0x38'))){_0x17df21['limit']=qs[_0x5204('0x1f')](_0x1eaf0f['query']['limit']);_0x17df21[_0x5204('0x1e')]=qs[_0x5204('0x1e')](_0x1eaf0f[_0x5204('0x30')][_0x5204('0x1e')]);}_0x17df21[_0x5204('0x39')]=qs['sort'](_0x1eaf0f[_0x5204('0x30')][_0x5204('0x3a')]);_0x17df21[_0x5204('0x3b')]=qs[_0x5204('0x32')](_[_0x5204('0x3c')](_0x1eaf0f[_0x5204('0x30')],_0x2698b3['filters']));if(_0x1eaf0f[_0x5204('0x30')]['filter']){_0x17df21['where']=_[_0x5204('0x3d')](_0x17df21['where'],{'$or':_[_0x5204('0x3e')](_0x31bbdd,function(_0x1762b0){if(_0x1762b0['type'][_0x5204('0x3f')]!==_0x5204('0x40')){var _0x46a5b1={};_0x46a5b1[_0x1762b0[_0x5204('0x41')]]={'$like':'%'+_0x1eaf0f[_0x5204('0x30')][_0x5204('0x42')]+'%'};return _0x46a5b1;}})});}_0x17df21=_['merge']({},_0x17df21,_0x1eaf0f['options']);var _0x1bab39={'where':_0x17df21[_0x5204('0x3b')]};return db[_0x5204('0x43')][_0x5204('0x1d')](_0x1bab39)[_0x5204('0x26')](function(_0x4db296){_0x3b2c55['count']=_0x4db296;if(_0x1eaf0f[_0x5204('0x30')]['includeAll']){_0x17df21[_0x5204('0x44')]=[{'all':!![]}];}return db['VoiceMail'][_0x5204('0x45')](_0x17df21);})[_0x5204('0x26')](function(_0x4013db){_0x3b2c55['rows']=_0x4013db;return _0x3b2c55;})[_0x5204('0x26')](respondWithFilteredResult(_0x3fae4c,_0x17df21))[_0x5204('0x46')](handleError(_0x3fae4c,null));};exports[_0x5204('0x47')]=function(_0x36d3e0,_0xdc6f07){var _0x413e26={'raw':!![],'where':{'id':_0x36d3e0[_0x5204('0x48')]['id']}},_0x26f249={};_0x26f249[_0x5204('0x2f')]=_[_0x5204('0x31')](db[_0x5204('0x43')]['rawAttributes']);_0x26f249[_0x5204('0x30')]=_[_0x5204('0x31')](_0x36d3e0[_0x5204('0x30')]);_0x26f249[_0x5204('0x32')]=_['intersection'](_0x26f249[_0x5204('0x2f')],_0x26f249[_0x5204('0x30')]);_0x413e26[_0x5204('0x35')]=_['intersection'](_0x26f249[_0x5204('0x2f')],qs['fields'](_0x36d3e0['query'][_0x5204('0x34')]));_0x413e26['attributes']=_0x413e26[_0x5204('0x35')][_0x5204('0x36')]?_0x413e26[_0x5204('0x35')]:_0x26f249[_0x5204('0x2f')];if(_0x36d3e0[_0x5204('0x30')][_0x5204('0x49')]){_0x413e26[_0x5204('0x44')]=[{'all':!![]}];}_0x413e26=_[_0x5204('0x3d')]({},_0x413e26,_0x36d3e0[_0x5204('0x4a')]);return db['VoiceMail'][_0x5204('0x4b')](_0x413e26)[_0x5204('0x26')](handleEntityNotFound(_0xdc6f07,null))[_0x5204('0x26')](respondWithResult(_0xdc6f07,null))[_0x5204('0x46')](handleError(_0xdc6f07,null));};exports[_0x5204('0x4c')]=function(_0x3d66df,_0x3851ab){return db[_0x5204('0x43')][_0x5204('0x4c')](_0x3d66df['body'],{})[_0x5204('0x26')](function(_0x3e8ece){var _0x543fbb=_0x3d66df[_0x5204('0x4d')][_0x5204('0x27')]({'plain':!![]});if(!_0x543fbb)throw new Error(_0x5204('0x4e'));if(_0x543fbb[_0x5204('0x4f')]===_0x5204('0x4d')){var _0x102fdd=_0x3e8ece[_0x5204('0x27')]({'plain':!![]});var _0x5558fb=_0x5204('0x28');return db['UserProfileSection'][_0x5204('0x4b')]({'where':{'name':_0x5558fb,'userProfileId':_0x543fbb[_0x5204('0x50')]},'raw':!![]})[_0x5204('0x26')](function(_0x14c10c){if(_0x14c10c&&_0x14c10c[_0x5204('0x51')]===0x0){return db[_0x5204('0x29')][_0x5204('0x4c')]({'name':_0x102fdd[_0x5204('0x2c')],'resourceId':_0x102fdd['id'],'type':_0x14c10c[_0x5204('0x2c')],'sectionId':_0x14c10c['id']},{})['then'](function(){return _0x3e8ece;});}else{return _0x3e8ece;}})[_0x5204('0x46')](function(_0x2f2667){logger[_0x5204('0x2a')](_0x5204('0x52'),_0x2f2667);throw _0x2f2667;});}return _0x3e8ece;})[_0x5204('0x26')](respondWithResult(_0x3851ab,0xc9))['catch'](handleError(_0x3851ab,null));};exports['update']=function(_0x399913,_0x1f5d53){if(_0x399913[_0x5204('0x53')]['id']){delete _0x399913['body']['id'];}return db[_0x5204('0x43')][_0x5204('0x4b')]({'where':{'id':_0x399913[_0x5204('0x48')]['id']}})[_0x5204('0x26')](handleEntityNotFound(_0x1f5d53,null))[_0x5204('0x26')](saveUpdates(_0x399913[_0x5204('0x53')],null))[_0x5204('0x26')](respondWithResult(_0x1f5d53,null))['catch'](handleError(_0x1f5d53,null));};exports[_0x5204('0x25')]=function(_0x149705,_0x596998){return db[_0x5204('0x43')][_0x5204('0x4b')]({'where':{'id':_0x149705[_0x5204('0x48')]['id']}})[_0x5204('0x26')](handleEntityNotFound(_0x596998,null))[_0x5204('0x26')](removeEntity(_0x596998,null))[_0x5204('0x46')](handleError(_0x596998,null));};exports[_0x5204('0x54')]=function(_0x306ec3,_0x36ba42,_0x5ab825){return db[_0x5204('0x43')][_0x5204('0x55')]({'where':{'id':_0x306ec3[_0x5204('0x48')]['id']}})[_0x5204('0x26')](handleEntityNotFound(_0x36ba42,null))['then'](function(_0x33eff6){var _0x25e64d;var _0x47b716={},_0x1e0d66={};_0x1e0d66[_0x5204('0x2f')]=_[_0x5204('0x31')](db[_0x5204('0x56')][_0x5204('0x57')]);_0x1e0d66[_0x5204('0x30')]=_[_0x5204('0x31')](_0x306ec3['query']);_0x1e0d66[_0x5204('0x32')]=_['intersection'](_0x1e0d66[_0x5204('0x2f')],_0x1e0d66[_0x5204('0x30')]);_0x47b716[_0x5204('0x35')]=_[_0x5204('0x33')](_0x1e0d66[_0x5204('0x2f')],qs[_0x5204('0x34')](_0x306ec3[_0x5204('0x30')][_0x5204('0x34')]));_0x47b716[_0x5204('0x35')]=_0x47b716[_0x5204('0x35')]['length']?_0x47b716[_0x5204('0x35')]:_0x1e0d66[_0x5204('0x2f')];if(!_0x306ec3[_0x5204('0x30')][_0x5204('0x37')](_0x5204('0x38'))){_0x47b716[_0x5204('0x1f')]=qs[_0x5204('0x1f')](_0x306ec3['query'][_0x5204('0x1f')]);_0x47b716[_0x5204('0x1e')]=qs[_0x5204('0x1e')](_0x306ec3[_0x5204('0x30')]['offset']);}_0x47b716[_0x5204('0x39')]=qs[_0x5204('0x3a')](_0x306ec3[_0x5204('0x30')][_0x5204('0x3a')]);_0x47b716['where']=qs[_0x5204('0x32')](_[_0x5204('0x3c')](_0x306ec3[_0x5204('0x30')],_0x1e0d66[_0x5204('0x32')]));if(_0x306ec3[_0x5204('0x30')][_0x5204('0x42')]){_0x47b716[_0x5204('0x3b')]=_['merge'](_0x47b716['where'],{'$or':_[_0x5204('0x3e')](_0x47b716[_0x5204('0x35')],function(_0x431d28){var _0x5247b7={};_0x5247b7[_0x431d28]={'$like':'%'+_0x306ec3[_0x5204('0x30')]['filter']+'%'};return _0x5247b7;})});}_0x47b716[_0x5204('0x3b')]=_[_0x5204('0x3d')](_0x47b716[_0x5204('0x3b')],{'mailboxuser':_0x33eff6['mailbox']});_0x47b716=_[_0x5204('0x3d')]({},_0x47b716,_0x306ec3[_0x5204('0x4a')]);return db[_0x5204('0x56')][_0x5204('0x58')](_0x47b716)['then'](respondWithFilteredResult(_0x36ba42,_0x47b716));})['catch'](handleError(_0x36ba42,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 033d56d..ebf5fe4 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 _0x9d3a=['voice_voicemail','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','exports','define','VoiceMail'];(function(_0xf4f343,_0x41fe4a){var _0x4cda68=function(_0x3850e6){while(--_0x3850e6){_0xf4f343['push'](_0xf4f343['shift']());}};_0x4cda68(++_0x41fe4a);}(_0x9d3a,0x18d));var _0xa9d3=function(_0x4d897d,_0x2cd517){_0x4d897d=_0x4d897d-0x0;var _0x33676e=_0x9d3a[_0x4d897d];return _0x33676e;};'use strict';var _=require(_0xa9d3('0x0'));var util=require(_0xa9d3('0x1'));var logger=require(_0xa9d3('0x2'))('api');var moment=require(_0xa9d3('0x3'));var BPromise=require(_0xa9d3('0x4'));var rp=require(_0xa9d3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9d3('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMail.attributes');module[_0xa9d3('0x7')]=function(_0x3fe4e5,_0x3ea6f7){return _0x3fe4e5[_0xa9d3('0x8')](_0xa9d3('0x9'),attributes,{'tableName':_0xa9d3('0xa'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox','context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0d03=['path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox','context','lodash','util','api','request-promise'];(function(_0x30962d,_0x21cfa2){var _0x21fc89=function(_0x4456c3){while(--_0x4456c3){_0x30962d['push'](_0x30962d['shift']());}};_0x21fc89(++_0x21cfa2);}(_0x0d03,0x96));var _0x30d0=function(_0x4cfd80,_0x235308){_0x4cfd80=_0x4cfd80-0x0;var _0x1fdddd=_0x0d03[_0x4cfd80];return _0x1fdddd;};'use strict';var _=require(_0x30d0('0x0'));var util=require(_0x30d0('0x1'));var logger=require('../../config/logger')(_0x30d0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x30d0('0x3'));var fs=require('fs');var path=require(_0x30d0('0x4'));var rimraf=require(_0x30d0('0x5'));var config=require(_0x30d0('0x6'));var attributes=require(_0x30d0('0x7'));module[_0x30d0('0x8')]=function(_0x373cdd,_0x222ac3){return _0x373cdd[_0x30d0('0x9')](_0x30d0('0xa'),attributes,{'tableName':_0x30d0('0xb'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x30d0('0xc'),_0x30d0('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 5842ef6..8ef427b 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 _0x1b0e=['request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http'];(function(_0x547d1e,_0x3097b0){var _0x5e957b=function(_0x23866f){while(--_0x23866f){_0x547d1e['push'](_0x547d1e['shift']());}};_0x5e957b(++_0x3097b0);}(_0x1b0e,0x1da));var _0xe1b0=function(_0x4c0e82,_0x1cfd33){_0x4c0e82=_0x4c0e82-0x0;var _0xc52631=_0x1b0e[_0x4c0e82];return _0xc52631;};'use strict';var _=require('lodash');var util=require(_0xe1b0('0x0'));var moment=require(_0xe1b0('0x1'));var BPromise=require(_0xe1b0('0x2'));var rs=require(_0xe1b0('0x3'));var fs=require('fs');var Redis=require(_0xe1b0('0x4'));var db=require(_0xe1b0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe1b0('0x6'));var config=require(_0xe1b0('0x7'));var jayson=require(_0xe1b0('0x8'));var client=jayson['client'][_0xe1b0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a0e77,_0x566b44,_0x157745){return new BPromise(function(_0x2170a9,_0x5c3944){return client[_0xe1b0('0xa')](_0x3a0e77,_0x157745)[_0xe1b0('0xb')](function(_0x4feed8){logger[_0xe1b0('0xc')](_0xe1b0('0xd'),_0x566b44,_0xe1b0('0xe'));logger[_0xe1b0('0xf')](_0xe1b0('0x10'),_0x566b44,_0xe1b0('0xe'),JSON['stringify'](_0x4feed8));if(_0x4feed8[_0xe1b0('0x11')]){if(_0x4feed8[_0xe1b0('0x11')][_0xe1b0('0x12')]===0x1f4){logger[_0xe1b0('0x11')]('VoiceMail,\x20%s,\x20%s',_0x566b44,_0x4feed8[_0xe1b0('0x11')][_0xe1b0('0x13')]);return _0x5c3944(_0x4feed8[_0xe1b0('0x11')][_0xe1b0('0x13')]);}logger[_0xe1b0('0x11')](_0xe1b0('0xd'),_0x566b44,_0x4feed8[_0xe1b0('0x11')][_0xe1b0('0x13')]);return _0x2170a9(_0x4feed8[_0xe1b0('0x11')]['message']);}else{logger[_0xe1b0('0xc')]('VoiceMail,\x20%s,\x20%s',_0x566b44,_0xe1b0('0xe'));_0x2170a9(_0x4feed8[_0xe1b0('0x14')][_0xe1b0('0x13')]);}})[_0xe1b0('0x15')](function(_0x312a6a){logger[_0xe1b0('0x11')]('VoiceMail,\x20%s,\x20%s',_0x566b44,_0x312a6a);_0x5c3944(_0x312a6a);});});} \ No newline at end of file +var _0x9db7=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4a599b,_0x1d2125){var _0x2d53d3=function(_0x5e7982){while(--_0x5e7982){_0x4a599b['push'](_0x4a599b['shift']());}};_0x2d53d3(++_0x1d2125);}(_0x9db7,0x1b8));var _0x79db=function(_0x321458,_0x362516){_0x321458=_0x321458-0x0;var _0x485778=_0x9db7[_0x321458];return _0x485778;};'use strict';var _=require('lodash');var util=require(_0x79db('0x0'));var moment=require(_0x79db('0x1'));var BPromise=require(_0x79db('0x2'));var rs=require(_0x79db('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x79db('0x4'))['db'];var utils=require(_0x79db('0x5'));var logger=require(_0x79db('0x6'))(_0x79db('0x7'));var config=require(_0x79db('0x8'));var jayson=require(_0x79db('0x9'));var client=jayson[_0x79db('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f31c1,_0x4f75f6,_0x34f8c9){return new BPromise(function(_0x2639e1,_0x1c872b){return client[_0x79db('0xb')](_0x1f31c1,_0x34f8c9)[_0x79db('0xc')](function(_0x2ec15b){logger[_0x79db('0xd')](_0x79db('0xe'),_0x4f75f6,_0x79db('0xf'));logger[_0x79db('0x10')](_0x79db('0x11'),_0x4f75f6,_0x79db('0xf'),JSON[_0x79db('0x12')](_0x2ec15b));if(_0x2ec15b[_0x79db('0x13')]){if(_0x2ec15b['error'][_0x79db('0x14')]===0x1f4){logger[_0x79db('0x13')](_0x79db('0xe'),_0x4f75f6,_0x2ec15b[_0x79db('0x13')][_0x79db('0x15')]);return _0x1c872b(_0x2ec15b[_0x79db('0x13')][_0x79db('0x15')]);}logger[_0x79db('0x13')]('VoiceMail,\x20%s,\x20%s',_0x4f75f6,_0x2ec15b[_0x79db('0x13')][_0x79db('0x15')]);return _0x2639e1(_0x2ec15b[_0x79db('0x13')][_0x79db('0x15')]);}else{logger[_0x79db('0xd')](_0x79db('0xe'),_0x4f75f6,'request\x20sent');_0x2639e1(_0x2ec15b['result']['message']);}})['catch'](function(_0x3f07b7){logger[_0x79db('0x13')](_0x79db('0xe'),_0x4f75f6,_0x3f07b7);_0x1c872b(_0x3f07b7);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index f5189bb..5ca2158 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 _0x025b=['util','connect-timeout','../../components/interaction/service','./voiceMailMessage.controller','isAuthenticated','index','get','show','/:id/download','download','post','create','put','update','delete','/:id','multer'];(function(_0x46f8d1,_0x4bc4a7){var _0x3a9d29=function(_0x5a9d0b){while(--_0x5a9d0b){_0x46f8d1['push'](_0x46f8d1['shift']());}};_0x3a9d29(++_0x4bc4a7);}(_0x025b,0xfe));var _0xb025=function(_0x5d4d4a,_0x23f908){_0x5d4d4a=_0x5d4d4a-0x0;var _0x25eaaa=_0x025b[_0x5d4d4a];return _0x25eaaa;};'use strict';var multer=require(_0xb025('0x0'));var util=require(_0xb025('0x1'));var path=require('path');var timeout=require(_0xb025('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xb025('0x3'));var config=require('../../config/environment');var controller=require(_0xb025('0x4'));router['get']('/',auth[_0xb025('0x5')](),controller[_0xb025('0x6')]);router[_0xb025('0x7')]('/:id',auth[_0xb025('0x5')](),controller[_0xb025('0x8')]);router[_0xb025('0x7')](_0xb025('0x9'),auth[_0xb025('0x5')](),controller[_0xb025('0xa')]);router[_0xb025('0xb')]('/',auth[_0xb025('0x5')](),controller[_0xb025('0xc')]);router[_0xb025('0xd')]('/:id',auth[_0xb025('0x5')](),controller[_0xb025('0xe')]);router[_0xb025('0xf')](_0xb025('0x10'),auth[_0xb025('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf217=['show','isAuthenticated','download','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/interaction/service','./voiceMailMessage.controller','get','/:id'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xf217,0x13c));var _0x7f21=function(_0x541ea6,_0x51cab6){_0x541ea6=_0x541ea6-0x0;var _0x3c3e84=_0xf217[_0x541ea6];return _0x3c3e84;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7f21('0x0'));var timeout=require(_0x7f21('0x1'));var express=require(_0x7f21('0x2'));var router=express[_0x7f21('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x7f21('0x4'));var config=require('../../config/environment');var controller=require(_0x7f21('0x5'));router[_0x7f21('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7f21('0x6')](_0x7f21('0x7'),auth['isAuthenticated'](),controller[_0x7f21('0x8')]);router[_0x7f21('0x6')]('/:id/download',auth[_0x7f21('0x9')](),controller[_0x7f21('0xa')]);router[_0x7f21('0xb')]('/',auth[_0x7f21('0x9')](),controller[_0x7f21('0xc')]);router[_0x7f21('0xd')](_0x7f21('0x7'),auth[_0x7f21('0x9')](),controller[_0x7f21('0xe')]);router[_0x7f21('0xf')](_0x7f21('0x7'),auth['isAuthenticated'](),controller[_0x7f21('0x10')]);module[_0x7f21('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 3983504..f486d0f 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 _0xa24d=['TIMESTAMP','exports','VIRTUAL','INTEGER','STRING','BLOB','long'];(function(_0x595d80,_0x465a9b){var _0x362ccb=function(_0x38776f){while(--_0x38776f){_0x595d80['push'](_0x595d80['shift']());}};_0x362ccb(++_0x465a9b);}(_0xa24d,0x182));var _0xda24=function(_0x3e5b7b,_0x1ca279){_0x3e5b7b=_0x3e5b7b-0x0;var _0x441af8=_0xa24d[_0x3e5b7b];return _0x441af8;};'use strict';var Sequelize=require('sequelize');module[_0xda24('0x0')]={'name':{'type':Sequelize[_0xda24('0x1')],'get':function(_0x33adaf){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xda24('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xda24('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xda24('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xda24('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0xda24('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xda24('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xda24('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xda24('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xda24('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xda24('0x4')](_0xda24('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xda24('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xda24('0x3')],'defaultValue':''},'stamp':{'type':_0xda24('0x6'),'allowNull':![]}}; \ No newline at end of file +var _0x2502=['INTEGER','STRING','BLOB','TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x1fcbe2,_0x2b5199){var _0x2d22ef=function(_0x591e27){while(--_0x591e27){_0x1fcbe2['push'](_0x1fcbe2['shift']());}};_0x2d22ef(++_0x2b5199);}(_0x2502,0x1f4));var _0x2250=function(_0x178171,_0x2b00ba){_0x178171=_0x178171-0x0;var _0x3ae949=_0x2502[_0x178171];return _0x3ae949;};'use strict';var Sequelize=require(_0x2250('0x0'));module[_0x2250('0x1')]={'name':{'type':Sequelize[_0x2250('0x2')],'get':function(_0x51e2c0){return this[_0x2250('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x2250('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x2250('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x2250('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x2250('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x2250('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x2250('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x2250('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x2250('0x6')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x2250('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x2250('0x5')],'defaultValue':''},'stamp':{'type':_0x2250('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 3d5f76b..06ea565 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 _0x2337=['json','offset','limit','set','Content-Range','save','sendStatus','error','name','send','index','VoiceMailMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','key','field','options','count','then','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','destroy','download','msg_id','recording','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end'];(function(_0x3c8543,_0x11fef7){var _0x5d6046=function(_0x3a4dcc){while(--_0x3a4dcc){_0x3c8543['push'](_0x3c8543['shift']());}};_0x5d6046(++_0x11fef7);}(_0x2337,0x8c));var _0x7233=function(_0x158a26,_0x4e8d1a){_0x158a26=_0x158a26-0x0;var _0x379842=_0x2337[_0x158a26];return _0x379842;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7233('0x0'));var rimraf=require(_0x7233('0x1'));var zipdir=require(_0x7233('0x2'));var jsonpatch=require(_0x7233('0x3'));var rp=require(_0x7233('0x4'));var moment=require(_0x7233('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7233('0x6'));var path=require(_0x7233('0x7'));var sox=require('sox');var csv=require(_0x7233('0x8'));var ejs=require(_0x7233('0x9'));var fs=require('fs');var _=require(_0x7233('0xa'));var squel=require(_0x7233('0xb'));var crypto=require(_0x7233('0xc'));var jsforce=require(_0x7233('0xd'));var deskjs=require(_0x7233('0xe'));var toCsv=require(_0x7233('0x8'));var querystring=require(_0x7233('0xf'));var Papa=require(_0x7233('0x10'));var Redis=require(_0x7233('0x11'));var authService=require(_0x7233('0x12'));var qs=require(_0x7233('0x13'));var hardwareService=require(_0x7233('0x14'));var logger=require(_0x7233('0x15'))(_0x7233('0x16'));var utils=require(_0x7233('0x17'));var config=require(_0x7233('0x18'));var db=require(_0x7233('0x19'))['db'];function respondWithStatusCode(_0x1d69ee,_0x5e15d7){_0x5e15d7=_0x5e15d7||0xcc;return function(_0x314858){if(_0x314858){return _0x1d69ee['sendStatus'](_0x5e15d7);}return _0x1d69ee[_0x7233('0x1a')](_0x5e15d7)[_0x7233('0x1b')]();};}function respondWithResult(_0x4b1ba0,_0x54027f){_0x54027f=_0x54027f||0xc8;return function(_0xe7aa74){if(_0xe7aa74){return _0x4b1ba0[_0x7233('0x1a')](_0x54027f)[_0x7233('0x1c')](_0xe7aa74);}};}function respondWithFilteredResult(_0x4c5ce2,_0x130ab2){return function(_0x5f2e4e){if(_0x5f2e4e){var _0x199f5f=_0x5f2e4e['count'],_0x269e79=_0x130ab2[_0x7233('0x1d')],_0x15f442=_0x130ab2[_0x7233('0x1d')]+_0x130ab2[_0x7233('0x1e')],_0x151ced;if(_0x15f442>=_0x199f5f){_0x15f442=_0x199f5f;_0x151ced=0xc8;}else{_0x151ced=0xce;}_0x4c5ce2['status'](_0x151ced);return _0x4c5ce2[_0x7233('0x1f')](_0x7233('0x20'),_0x269e79+'-'+_0x15f442+'/'+_0x199f5f)[_0x7233('0x1c')](_0x5f2e4e);}return null;};}function patchUpdates(_0x13e370){return function(_0x381220){try{jsonpatch['apply'](_0x381220,_0x13e370,!![]);}catch(_0x7a6ac3){return BPromise['reject'](_0x7a6ac3);}return _0x381220[_0x7233('0x21')]();};}function saveUpdates(_0x25ac04,_0x291308){return function(_0x4f16c9){if(_0x4f16c9){return _0x4f16c9['update'](_0x25ac04)['then'](function(_0x51efdd){return _0x51efdd;});}return null;};}function removeEntity(_0x31dda1,_0x4b4ccd){return function(_0x353b23){if(_0x353b23){return _0x353b23['destroy']()['then'](function(){_0x31dda1[_0x7233('0x1a')](0xcc)[_0x7233('0x1b')]();});}};}function handleEntityNotFound(_0x11417c,_0x3bacc1){return function(_0xcead66){if(!_0xcead66){_0x11417c[_0x7233('0x22')](0x194);}return _0xcead66;};}function handleError(_0x52de18,_0x1761fe){_0x1761fe=_0x1761fe||0x1f4;return function(_0x33a7b8){logger[_0x7233('0x23')](_0x33a7b8['stack']);if(_0x33a7b8[_0x7233('0x24')]){delete _0x33a7b8[_0x7233('0x24')];}_0x52de18[_0x7233('0x1a')](_0x1761fe)[_0x7233('0x25')](_0x33a7b8);};}exports[_0x7233('0x26')]=function(_0x687378,_0x181683){var _0x244934={},_0x827b32={},_0x4f9f2c={'count':0x0,'rows':[]};var _0x3b1699=db[_0x7233('0x27')][_0x7233('0x28')];_0x827b32[_0x7233('0x29')]=_['differenceBy'](_[_0x7233('0x2a')](_0x3b1699),['name']);_0x827b32[_0x7233('0x2b')]=_[_0x7233('0x2a')](_0x687378[_0x7233('0x2b')]);_0x827b32[_0x7233('0x2c')]=_[_0x7233('0x2d')](_0x827b32[_0x7233('0x29')],_0x827b32[_0x7233('0x2b')]);_0x244934[_0x7233('0x2e')]=_[_0x7233('0x2d')](_0x827b32['model'],qs[_0x7233('0x2f')](_0x687378[_0x7233('0x2b')][_0x7233('0x2f')]));_0x244934[_0x7233('0x2e')]=_0x244934[_0x7233('0x2e')][_0x7233('0x30')]?_0x244934[_0x7233('0x2e')]:_0x827b32[_0x7233('0x29')];if(!_0x687378[_0x7233('0x2b')][_0x7233('0x31')](_0x7233('0x32'))){_0x244934[_0x7233('0x1e')]=qs['limit'](_0x687378[_0x7233('0x2b')][_0x7233('0x1e')]);_0x244934[_0x7233('0x1d')]=qs['offset'](_0x687378[_0x7233('0x2b')][_0x7233('0x1d')]);}_0x244934[_0x7233('0x33')]=qs[_0x7233('0x34')](_0x687378[_0x7233('0x2b')]['sort']);_0x244934['where']=qs[_0x7233('0x2c')](_[_0x7233('0x35')](_0x687378[_0x7233('0x2b')],_0x827b32[_0x7233('0x2c')]));if(_0x687378[_0x7233('0x2b')][_0x7233('0x36')]){_0x244934[_0x7233('0x37')]=_[_0x7233('0x38')](_0x244934[_0x7233('0x37')],{'$or':_['map'](_0x3b1699,function(_0x34c46b){if(_0x34c46b[_0x7233('0x39')][_0x7233('0x3a')]!=='VIRTUAL'){var _0x147763={};_0x147763[_0x34c46b[_0x7233('0x3b')]]={'$like':'%'+_0x687378['query']['filter']+'%'};return _0x147763;}})});}_0x244934=_[_0x7233('0x38')]({},_0x244934,_0x687378[_0x7233('0x3c')]);var _0x279824={'where':_0x244934[_0x7233('0x37')]};return db[_0x7233('0x27')][_0x7233('0x3d')](_0x279824)[_0x7233('0x3e')](function(_0x4a96dc){_0x4f9f2c[_0x7233('0x3d')]=_0x4a96dc;if(_0x687378[_0x7233('0x2b')]['includeAll']){_0x244934[_0x7233('0x3f')]=[{'all':!![]}];}return db[_0x7233('0x27')][_0x7233('0x40')](_0x244934);})[_0x7233('0x3e')](function(_0xc18b20){_0x4f9f2c[_0x7233('0x41')]=_0xc18b20;return _0x4f9f2c;})[_0x7233('0x3e')](respondWithFilteredResult(_0x181683,_0x244934))[_0x7233('0x42')](handleError(_0x181683,null));};exports[_0x7233('0x43')]=function(_0xc01b7f,_0x100317){var _0x59390d={'raw':!![],'where':{'id':_0xc01b7f[_0x7233('0x44')]['id']}},_0x33b3ab={};_0x33b3ab[_0x7233('0x29')]=_[_0x7233('0x2a')](db[_0x7233('0x27')]['rawAttributes']);_0x33b3ab[_0x7233('0x2b')]=_[_0x7233('0x2a')](_0xc01b7f[_0x7233('0x2b')]);_0x33b3ab['filters']=_['intersection'](_0x33b3ab[_0x7233('0x29')],_0x33b3ab[_0x7233('0x2b')]);_0x59390d['attributes']=_[_0x7233('0x2d')](_0x33b3ab['model'],qs[_0x7233('0x2f')](_0xc01b7f[_0x7233('0x2b')][_0x7233('0x2f')]));_0x59390d[_0x7233('0x2e')]=_0x59390d[_0x7233('0x2e')]['length']?_0x59390d[_0x7233('0x2e')]:_0x33b3ab['model'];if(_0xc01b7f['query'][_0x7233('0x45')]){_0x59390d[_0x7233('0x3f')]=[{'all':!![]}];}_0x59390d=_[_0x7233('0x38')]({},_0x59390d,_0xc01b7f[_0x7233('0x3c')]);return db['VoiceMailMessage'][_0x7233('0x46')](_0x59390d)[_0x7233('0x3e')](handleEntityNotFound(_0x100317,null))[_0x7233('0x3e')](respondWithResult(_0x100317,null))[_0x7233('0x42')](handleError(_0x100317,null));};exports[_0x7233('0x47')]=function(_0x4635d8,_0x54a18f){return db[_0x7233('0x27')][_0x7233('0x47')](_0x4635d8[_0x7233('0x48')],{})['then'](respondWithResult(_0x54a18f,0xc9))['catch'](handleError(_0x54a18f,null));};exports[_0x7233('0x49')]=function(_0x158328,_0x5c3fab){if(_0x158328[_0x7233('0x48')]['id']){delete _0x158328[_0x7233('0x48')]['id'];}return db[_0x7233('0x27')]['find']({'where':{'id':_0x158328[_0x7233('0x44')]['id']}})['then'](handleEntityNotFound(_0x5c3fab,null))[_0x7233('0x3e')](saveUpdates(_0x158328[_0x7233('0x48')],null))[_0x7233('0x3e')](respondWithResult(_0x5c3fab,null))[_0x7233('0x42')](handleError(_0x5c3fab,null));};exports[_0x7233('0x4a')]=function(_0x17b62a,_0x101400){return db[_0x7233('0x27')][_0x7233('0x46')]({'where':{'id':_0x17b62a[_0x7233('0x44')]['id']}})[_0x7233('0x3e')](handleEntityNotFound(_0x101400,null))[_0x7233('0x3e')](removeEntity(_0x101400,null))['catch'](handleError(_0x101400,null));};exports[_0x7233('0x4b')]=function(_0x401dbc,_0x1474b3,_0x534412){return db[_0x7233('0x27')][_0x7233('0x46')]({'where':{'id':_0x401dbc[_0x7233('0x44')]['id']},'attributes':['id','recording',_0x7233('0x4c')]})[_0x7233('0x3e')](handleEntityNotFound(_0x1474b3,null))[_0x7233('0x3e')](function(_0x18f254){if(_0x18f254){if(!_0x18f254[_0x7233('0x4d')]){throw new db[(_0x7233('0x4e'))]['ValidationError'](_0x7233('0x4f'));}var _0x17bcaf={'Content-Type':_0x7233('0x50'),'Content-Disposition':_0x7233('0x51')};if(_0x18f254[_0x7233('0x4c')]){_0x17bcaf[_0x7233('0x52')]=_0x7233('0x53')+_0x18f254[_0x7233('0x4c')]+'.wav\x22';}_0x1474b3[_0x7233('0x1f')](_0x17bcaf);return _0x1474b3['send'](new Buffer(_0x18f254[_0x7233('0x4d')]));}})[_0x7233('0x42')](handleError(_0x1474b3,null));}; \ No newline at end of file +var _0xf98b=['fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','status','set','apply','reject','save','update','then','stack','name','send','index','VoiceMailMessage','rawAttributes','model','keys','query','filters','intersection','attributes','length','nolimit','limit','order','sort','where','map','type','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment','msg_id','.wav\x22','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x3350d7,_0x31e7a6){var _0x3888d5=function(_0x17ff3b){while(--_0x17ff3b){_0x3350d7['push'](_0x3350d7['shift']());}};_0x3888d5(++_0x31e7a6);}(_0xf98b,0xe9));var _0xbf98=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xf98b[_0x3b380d];return _0x54502b;};'use strict';var pdf=require(_0xbf98('0x0'));var emlformat=require(_0xbf98('0x1'));var rimraf=require(_0xbf98('0x2'));var zipdir=require(_0xbf98('0x3'));var jsonpatch=require(_0xbf98('0x4'));var rp=require(_0xbf98('0x5'));var moment=require('moment');var BPromise=require(_0xbf98('0x6'));var Mustache=require(_0xbf98('0x7'));var util=require('util');var path=require(_0xbf98('0x8'));var sox=require(_0xbf98('0x9'));var csv=require('to-csv');var ejs=require(_0xbf98('0xa'));var fs=require('fs');var _=require(_0xbf98('0xb'));var squel=require(_0xbf98('0xc'));var crypto=require(_0xbf98('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbf98('0xe'));var toCsv=require(_0xbf98('0xf'));var querystring=require(_0xbf98('0x10'));var Papa=require(_0xbf98('0x11'));var Redis=require(_0xbf98('0x12'));var authService=require(_0xbf98('0x13'));var qs=require(_0xbf98('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf98('0x15'))(_0xbf98('0x16'));var utils=require(_0xbf98('0x17'));var config=require(_0xbf98('0x18'));var db=require(_0xbf98('0x19'))['db'];function respondWithStatusCode(_0x2c302f,_0xf063de){_0xf063de=_0xf063de||0xcc;return function(_0x4a10b4){if(_0x4a10b4){return _0x2c302f[_0xbf98('0x1a')](_0xf063de);}return _0x2c302f['status'](_0xf063de)[_0xbf98('0x1b')]();};}function respondWithResult(_0x1ae8b8,_0x28f006){_0x28f006=_0x28f006||0xc8;return function(_0x21a30e){if(_0x21a30e){return _0x1ae8b8['status'](_0x28f006)[_0xbf98('0x1c')](_0x21a30e);}};}function respondWithFilteredResult(_0x50113e,_0xe8d92d){return function(_0x39657d){if(_0x39657d){var _0x32add4=_0x39657d['count'],_0x9756f6=_0xe8d92d['offset'],_0x3ee122=_0xe8d92d[_0xbf98('0x1d')]+_0xe8d92d['limit'],_0x186dec;if(_0x3ee122>=_0x32add4){_0x3ee122=_0x32add4;_0x186dec=0xc8;}else{_0x186dec=0xce;}_0x50113e[_0xbf98('0x1e')](_0x186dec);return _0x50113e[_0xbf98('0x1f')]('Content-Range',_0x9756f6+'-'+_0x3ee122+'/'+_0x32add4)[_0xbf98('0x1c')](_0x39657d);}return null;};}function patchUpdates(_0x8228ce){return function(_0x205394){try{jsonpatch[_0xbf98('0x20')](_0x205394,_0x8228ce,!![]);}catch(_0x2b2e14){return BPromise[_0xbf98('0x21')](_0x2b2e14);}return _0x205394[_0xbf98('0x22')]();};}function saveUpdates(_0x2e18d0,_0x1757af){return function(_0x28623a){if(_0x28623a){return _0x28623a[_0xbf98('0x23')](_0x2e18d0)[_0xbf98('0x24')](function(_0x43e9db){return _0x43e9db;});}return null;};}function removeEntity(_0x303eec,_0x24aeec){return function(_0x49e317){if(_0x49e317){return _0x49e317['destroy']()[_0xbf98('0x24')](function(){_0x303eec[_0xbf98('0x1e')](0xcc)[_0xbf98('0x1b')]();});}};}function handleEntityNotFound(_0x2fe4f1,_0x59f1dc){return function(_0x1876aa){if(!_0x1876aa){_0x2fe4f1[_0xbf98('0x1a')](0x194);}return _0x1876aa;};}function handleError(_0x5def02,_0x403047){_0x403047=_0x403047||0x1f4;return function(_0x259aed){logger['error'](_0x259aed[_0xbf98('0x25')]);if(_0x259aed[_0xbf98('0x26')]){delete _0x259aed[_0xbf98('0x26')];}_0x5def02[_0xbf98('0x1e')](_0x403047)[_0xbf98('0x27')](_0x259aed);};}exports[_0xbf98('0x28')]=function(_0x38d81d,_0x38dacc){var _0x28d77a={},_0x347c62={},_0x5947b3={'count':0x0,'rows':[]};var _0x22675e=db[_0xbf98('0x29')][_0xbf98('0x2a')];_0x347c62[_0xbf98('0x2b')]=_['differenceBy'](_[_0xbf98('0x2c')](_0x22675e),[_0xbf98('0x26')]);_0x347c62['query']=_[_0xbf98('0x2c')](_0x38d81d[_0xbf98('0x2d')]);_0x347c62[_0xbf98('0x2e')]=_[_0xbf98('0x2f')](_0x347c62[_0xbf98('0x2b')],_0x347c62[_0xbf98('0x2d')]);_0x28d77a['attributes']=_[_0xbf98('0x2f')](_0x347c62[_0xbf98('0x2b')],qs['fields'](_0x38d81d[_0xbf98('0x2d')]['fields']));_0x28d77a[_0xbf98('0x30')]=_0x28d77a['attributes'][_0xbf98('0x31')]?_0x28d77a['attributes']:_0x347c62[_0xbf98('0x2b')];if(!_0x38d81d[_0xbf98('0x2d')]['hasOwnProperty'](_0xbf98('0x32'))){_0x28d77a['limit']=qs[_0xbf98('0x33')](_0x38d81d['query'][_0xbf98('0x33')]);_0x28d77a[_0xbf98('0x1d')]=qs['offset'](_0x38d81d['query'][_0xbf98('0x1d')]);}_0x28d77a[_0xbf98('0x34')]=qs[_0xbf98('0x35')](_0x38d81d['query']['sort']);_0x28d77a[_0xbf98('0x36')]=qs['filters'](_['pick'](_0x38d81d[_0xbf98('0x2d')],_0x347c62[_0xbf98('0x2e')]));if(_0x38d81d[_0xbf98('0x2d')]['filter']){_0x28d77a[_0xbf98('0x36')]=_['merge'](_0x28d77a['where'],{'$or':_[_0xbf98('0x37')](_0x22675e,function(_0x2cfd54){if(_0x2cfd54[_0xbf98('0x38')]['key']!==_0xbf98('0x39')){var _0x59e347={};_0x59e347[_0x2cfd54['field']]={'$like':'%'+_0x38d81d[_0xbf98('0x2d')]['filter']+'%'};return _0x59e347;}})});}_0x28d77a=_[_0xbf98('0x3a')]({},_0x28d77a,_0x38d81d[_0xbf98('0x3b')]);var _0x4d85e9={'where':_0x28d77a[_0xbf98('0x36')]};return db['VoiceMailMessage'][_0xbf98('0x3c')](_0x4d85e9)[_0xbf98('0x24')](function(_0x24d2e2){_0x5947b3[_0xbf98('0x3c')]=_0x24d2e2;if(_0x38d81d[_0xbf98('0x2d')][_0xbf98('0x3d')]){_0x28d77a[_0xbf98('0x3e')]=[{'all':!![]}];}return db[_0xbf98('0x29')][_0xbf98('0x3f')](_0x28d77a);})[_0xbf98('0x24')](function(_0x1c6e9a){_0x5947b3[_0xbf98('0x40')]=_0x1c6e9a;return _0x5947b3;})['then'](respondWithFilteredResult(_0x38dacc,_0x28d77a))[_0xbf98('0x41')](handleError(_0x38dacc,null));};exports[_0xbf98('0x42')]=function(_0x40948d,_0x8d9e30){var _0x1844f3={'raw':!![],'where':{'id':_0x40948d[_0xbf98('0x43')]['id']}},_0xf8e3d9={};_0xf8e3d9['model']=_['keys'](db['VoiceMailMessage'][_0xbf98('0x2a')]);_0xf8e3d9[_0xbf98('0x2d')]=_[_0xbf98('0x2c')](_0x40948d[_0xbf98('0x2d')]);_0xf8e3d9['filters']=_[_0xbf98('0x2f')](_0xf8e3d9[_0xbf98('0x2b')],_0xf8e3d9[_0xbf98('0x2d')]);_0x1844f3['attributes']=_['intersection'](_0xf8e3d9[_0xbf98('0x2b')],qs[_0xbf98('0x44')](_0x40948d[_0xbf98('0x2d')]['fields']));_0x1844f3['attributes']=_0x1844f3[_0xbf98('0x30')][_0xbf98('0x31')]?_0x1844f3[_0xbf98('0x30')]:_0xf8e3d9[_0xbf98('0x2b')];if(_0x40948d[_0xbf98('0x2d')][_0xbf98('0x3d')]){_0x1844f3['include']=[{'all':!![]}];}_0x1844f3=_[_0xbf98('0x3a')]({},_0x1844f3,_0x40948d[_0xbf98('0x3b')]);return db['VoiceMailMessage'][_0xbf98('0x45')](_0x1844f3)['then'](handleEntityNotFound(_0x8d9e30,null))[_0xbf98('0x24')](respondWithResult(_0x8d9e30,null))[_0xbf98('0x41')](handleError(_0x8d9e30,null));};exports[_0xbf98('0x46')]=function(_0x52a450,_0x158b4c){return db[_0xbf98('0x29')][_0xbf98('0x46')](_0x52a450['body'],{})[_0xbf98('0x24')](respondWithResult(_0x158b4c,0xc9))[_0xbf98('0x41')](handleError(_0x158b4c,null));};exports[_0xbf98('0x23')]=function(_0x24ce1f,_0xdad300){if(_0x24ce1f[_0xbf98('0x47')]['id']){delete _0x24ce1f[_0xbf98('0x47')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x24ce1f[_0xbf98('0x43')]['id']}})['then'](handleEntityNotFound(_0xdad300,null))[_0xbf98('0x24')](saveUpdates(_0x24ce1f[_0xbf98('0x47')],null))[_0xbf98('0x24')](respondWithResult(_0xdad300,null))['catch'](handleError(_0xdad300,null));};exports['destroy']=function(_0x41686a,_0x4d72ba){return db[_0xbf98('0x29')][_0xbf98('0x45')]({'where':{'id':_0x41686a[_0xbf98('0x43')]['id']}})[_0xbf98('0x24')](handleEntityNotFound(_0x4d72ba,null))[_0xbf98('0x24')](removeEntity(_0x4d72ba,null))['catch'](handleError(_0x4d72ba,null));};exports['download']=function(_0x5cce15,_0x1ce90b,_0x1adb13){return db[_0xbf98('0x29')][_0xbf98('0x45')]({'where':{'id':_0x5cce15[_0xbf98('0x43')]['id']},'attributes':['id',_0xbf98('0x48'),'msg_id']})[_0xbf98('0x24')](handleEntityNotFound(_0x1ce90b,null))[_0xbf98('0x24')](function(_0x315e03){if(_0x315e03){if(!_0x315e03['recording']){throw new db[(_0xbf98('0x49'))][(_0xbf98('0x4a'))](_0xbf98('0x4b'));}var _0x4e1df2={'Content-Type':'audio/wav','Content-Disposition':_0xbf98('0x4c')};if(_0x315e03[_0xbf98('0x4d')]){_0x4e1df2['Content-Disposition']='attachment;\x20filename=\x22'+_0x315e03['msg_id']+_0xbf98('0x4e');}_0x1ce90b[_0xbf98('0x1f')](_0x4e1df2);return _0x1ce90b['send'](new Buffer(_0x315e03[_0xbf98('0x48')]));}})[_0xbf98('0x41')](handleError(_0x1ce90b,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 0bbe9a3..9fd5663 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 _0x877f=['dir','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','VoiceMailMessage'];(function(_0x2f31f5,_0x61259f){var _0x52a845=function(_0x3d0b0b){while(--_0x3d0b0b){_0x2f31f5['push'](_0x2f31f5['shift']());}};_0x52a845(++_0x61259f);}(_0x877f,0xdd));var _0xf877=function(_0xa12e5d,_0x44cfa1){_0xa12e5d=_0xa12e5d-0x0;var _0x47266e=_0x877f[_0xa12e5d];return _0x47266e;};'use strict';var _=require(_0xf877('0x0'));var util=require(_0xf877('0x1'));var logger=require(_0xf877('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf877('0x3'));var rp=require(_0xf877('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf877('0x5'));var config=require(_0xf877('0x6'));var attributes=require(_0xf877('0x7'));module['exports']=function(_0x89f5c3,_0x137d79){return _0x89f5c3['define'](_0xf877('0x8'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xf877('0x9'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0xa069=['moment','request-promise','path','./voiceMailMessage.attributes','define','VoiceMailMessage','dir','lodash','util','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa069,0x10b));var _0x9a06=function(_0x36a692,_0x440e7a){_0x36a692=_0x36a692-0x0;var _0x5454ca=_0xa069[_0x36a692];return _0x5454ca;};'use strict';var _=require(_0x9a06('0x0'));var util=require(_0x9a06('0x1'));var logger=require('../../config/logger')(_0x9a06('0x2'));var moment=require(_0x9a06('0x3'));var BPromise=require('bluebird');var rp=require(_0x9a06('0x4'));var fs=require('fs');var path=require(_0x9a06('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9a06('0x6'));module['exports']=function(_0x160107,_0x4314bb){return _0x160107[_0x9a06('0x7')](_0x9a06('0x8'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x9a06('0x9'),'fields':[_0x9a06('0x9')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 136c651..6d2d8d5 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 _0xdfdf=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x15ff7e,_0x2846b2){var _0x5da84c=function(_0x2297f7){while(--_0x2297f7){_0x15ff7e['push'](_0x15ff7e['shift']());}};_0x5da84c(++_0x2846b2);}(_0xdfdf,0xb0));var _0xfdfd=function(_0x376b6b,_0x44cd61){_0x376b6b=_0x376b6b-0x0;var _0x3a9d2f=_0xdfdf[_0x376b6b];return _0x3a9d2f;};'use strict';var _=require(_0xfdfd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfdfd('0x1'));var rs=require(_0xfdfd('0x2'));var fs=require('fs');var Redis=require(_0xfdfd('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfdfd('0x4'))(_0xfdfd('0x5'));var config=require(_0xfdfd('0x6'));var jayson=require(_0xfdfd('0x7'));var client=jayson['client'][_0xfdfd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xab27d2,_0x24beaa,_0x3fb82e){return new BPromise(function(_0x574ab0,_0x5003ea){return client[_0xfdfd('0x9')](_0xab27d2,_0x3fb82e)['then'](function(_0x420352){logger[_0xfdfd('0xa')](_0xfdfd('0xb'),_0x24beaa,_0xfdfd('0xc'));logger[_0xfdfd('0xd')](_0xfdfd('0xe'),_0x24beaa,_0xfdfd('0xc'),JSON['stringify'](_0x420352));if(_0x420352[_0xfdfd('0xf')]){if(_0x420352[_0xfdfd('0xf')][_0xfdfd('0x10')]===0x1f4){logger[_0xfdfd('0xf')](_0xfdfd('0xb'),_0x24beaa,_0x420352[_0xfdfd('0xf')][_0xfdfd('0x11')]);return _0x5003ea(_0x420352[_0xfdfd('0xf')]['message']);}logger[_0xfdfd('0xf')](_0xfdfd('0xb'),_0x24beaa,_0x420352['error'][_0xfdfd('0x11')]);return _0x574ab0(_0x420352[_0xfdfd('0xf')][_0xfdfd('0x11')]);}else{logger[_0xfdfd('0xa')]('VoiceMailMessage,\x20%s,\x20%s',_0x24beaa,'request\x20sent');_0x574ab0(_0x420352[_0xfdfd('0x12')]['message']);}})[_0xfdfd('0x13')](function(_0x3d2b4c){logger['error'](_0xfdfd('0xb'),_0x24beaa,_0x3d2b4c);_0x5003ea(_0x3d2b4c);});});} \ No newline at end of file +var _0xbf0e=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x239450,_0x301b07){var _0x5ceae3=function(_0x38aa87){while(--_0x38aa87){_0x239450['push'](_0x239450['shift']());}};_0x5ceae3(++_0x301b07);}(_0xbf0e,0x14a));var _0xebf0=function(_0x38256e,_0x53c232){_0x38256e=_0x38256e-0x0;var _0x2af08a=_0xbf0e[_0x38256e];return _0x2af08a;};'use strict';var _=require(_0xebf0('0x0'));var util=require(_0xebf0('0x1'));var moment=require(_0xebf0('0x2'));var BPromise=require(_0xebf0('0x3'));var rs=require(_0xebf0('0x4'));var fs=require('fs');var Redis=require(_0xebf0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xebf0('0x6'));var logger=require(_0xebf0('0x7'))(_0xebf0('0x8'));var config=require(_0xebf0('0x9'));var jayson=require(_0xebf0('0xa'));var client=jayson[_0xebf0('0xb')][_0xebf0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xcdb473,_0x37398c,_0x33b99a){return new BPromise(function(_0x4eb168,_0x2b255c){return client['request'](_0xcdb473,_0x33b99a)[_0xebf0('0xd')](function(_0x12b7d7){logger[_0xebf0('0xe')](_0xebf0('0xf'),_0x37398c,_0xebf0('0x10'));logger['debug'](_0xebf0('0x11'),_0x37398c,'request\x20sent',JSON['stringify'](_0x12b7d7));if(_0x12b7d7[_0xebf0('0x12')]){if(_0x12b7d7[_0xebf0('0x12')][_0xebf0('0x13')]===0x1f4){logger['error'](_0xebf0('0xf'),_0x37398c,_0x12b7d7[_0xebf0('0x12')][_0xebf0('0x14')]);return _0x2b255c(_0x12b7d7[_0xebf0('0x12')][_0xebf0('0x14')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x37398c,_0x12b7d7[_0xebf0('0x12')][_0xebf0('0x14')]);return _0x4eb168(_0x12b7d7[_0xebf0('0x12')][_0xebf0('0x14')]);}else{logger[_0xebf0('0xe')](_0xebf0('0xf'),_0x37398c,'request\x20sent');_0x4eb168(_0x12b7d7[_0xebf0('0x15')][_0xebf0('0x14')]);}})['catch'](function(_0x1230e0){logger[_0xebf0('0x12')](_0xebf0('0xf'),_0x37398c,_0x1230e0);_0x2b255c(_0x1230e0);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 885a606..a1b11fa 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 _0x222f=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','get','/:id','show','getSounds','post','create','addSound','put','update','delete','destroy','/:id/sounds/:id2'];(function(_0x5ad2fb,_0x4a6620){var _0x5833f2=function(_0x387f40){while(--_0x387f40){_0x5ad2fb['push'](_0x5ad2fb['shift']());}};_0x5833f2(++_0x4a6620);}(_0x222f,0x1a4));var _0xf222=function(_0x446a9b,_0x48468a){_0x446a9b=_0x446a9b-0x0;var _0x371972=_0x222f[_0x446a9b];return _0x371972;};'use strict';var multer=require(_0xf222('0x0'));var util=require(_0xf222('0x1'));var path=require(_0xf222('0x2'));var timeout=require(_0xf222('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xf222('0x4'));var interaction=require(_0xf222('0x5'));var config=require(_0xf222('0x6'));var controller=require(_0xf222('0x7'));router['get']('/',auth[_0xf222('0x8')](),controller['index']);router[_0xf222('0x9')](_0xf222('0xa'),auth['isAuthenticated'](),controller[_0xf222('0xb')]);router[_0xf222('0x9')]('/:id/sounds',auth[_0xf222('0x8')](),controller[_0xf222('0xc')]);router[_0xf222('0xd')]('/',auth[_0xf222('0x8')](),controller[_0xf222('0xe')]);router[_0xf222('0xd')]('/:id/sounds',auth[_0xf222('0x8')](),controller[_0xf222('0xf')]);router[_0xf222('0x10')](_0xf222('0xa'),auth['isAuthenticated'](),controller[_0xf222('0x11')]);router[_0xf222('0x12')](_0xf222('0xa'),auth[_0xf222('0x8')](),controller[_0xf222('0x13')]);router[_0xf222('0x12')](_0xf222('0x14'),auth[_0xf222('0x8')](),controller['removeSound']);module['exports']=router; \ No newline at end of file +var _0xbf6e=['get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','create','addSound','put','delete','destroy','/:id/sounds/:id2','removeSound','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x30012b,_0x40c26f){var _0x4880c1=function(_0x23e00e){while(--_0x23e00e){_0x30012b['push'](_0x30012b['shift']());}};_0x4880c1(++_0x40c26f);}(_0xbf6e,0x149));var _0xebf6=function(_0x593a25,_0x37b3ea){_0x593a25=_0x593a25-0x0;var _0x1c9aef=_0xbf6e[_0x593a25];return _0x1c9aef;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xebf6('0x0'));var timeout=require(_0xebf6('0x1'));var express=require(_0xebf6('0x2'));var router=express[_0xebf6('0x3')]();var auth=require(_0xebf6('0x4'));var interaction=require(_0xebf6('0x5'));var config=require(_0xebf6('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0xebf6('0x7')]('/',auth[_0xebf6('0x8')](),controller[_0xebf6('0x9')]);router[_0xebf6('0x7')](_0xebf6('0xa'),auth[_0xebf6('0x8')](),controller[_0xebf6('0xb')]);router['get'](_0xebf6('0xc'),auth[_0xebf6('0x8')](),controller[_0xebf6('0xd')]);router['post']('/',auth[_0xebf6('0x8')](),controller[_0xebf6('0xe')]);router['post'](_0xebf6('0xc'),auth[_0xebf6('0x8')](),controller[_0xebf6('0xf')]);router[_0xebf6('0x10')](_0xebf6('0xa'),auth[_0xebf6('0x8')](),controller['update']);router[_0xebf6('0x11')](_0xebf6('0xa'),auth['isAuthenticated'](),controller[_0xebf6('0x12')]);router[_0xebf6('0x11')](_0xebf6('0x13'),auth[_0xebf6('0x8')](),controller[_0xebf6('0x14')]);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 7c6b3df..a685120 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 _0xf767=['TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','files','quietmp3nb','mp3'];(function(_0x2411fe,_0x2bc1b1){var _0x4ab625=function(_0x4714f5){while(--_0x4714f5){_0x2411fe['push'](_0x2411fe['shift']());}};_0x4ab625(++_0x2bc1b1);}(_0xf767,0x178));var _0x7f76=function(_0x3d78d7,_0x44acea){_0x3d78d7=_0x3d78d7-0x0;var _0x4b6784=_0xf767[_0x3d78d7];return _0x4b6784;};'use strict';var Sequelize=require(_0x7f76('0x0'));module[_0x7f76('0x1')]={'name':{'type':Sequelize[_0x7f76('0x2')],'allowNull':![],'unique':_0x7f76('0x3')},'mode':{'type':Sequelize[_0x7f76('0x4')](_0x7f76('0x5'),_0x7f76('0x6'),'mp3nb',_0x7f76('0x7'),'quietmp3',_0x7f76('0x8')),'allowNull':!![],'defaultValue':_0x7f76('0x6')},'directory':{'type':Sequelize[_0x7f76('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x7f76('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x7f76('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x7f76('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x7f76('0x9')},'defaultEntry':{'type':Sequelize[_0x7f76('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x43df=['files','mp3nb','quietmp3nb','quietmp3','mp3','BOOLEAN','exports','STRING','ENUM','custom'];(function(_0x2a032f,_0x1180b4){var _0x3904f7=function(_0xabe42b){while(--_0xabe42b){_0x2a032f['push'](_0x2a032f['shift']());}};_0x3904f7(++_0x1180b4);}(_0x43df,0x1c8));var _0xf43d=function(_0x3bbf08,_0x484ae7){_0x3bbf08=_0x3bbf08-0x0;var _0x1f308d=_0x43df[_0x3bbf08];return _0x1f308d;};'use strict';var Sequelize=require('sequelize');module[_0xf43d('0x0')]={'name':{'type':Sequelize[_0xf43d('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xf43d('0x2')](_0xf43d('0x3'),_0xf43d('0x4'),_0xf43d('0x5'),_0xf43d('0x6'),_0xf43d('0x7'),_0xf43d('0x8')),'allowNull':!![],'defaultValue':_0xf43d('0x4')},'directory':{'type':Sequelize[_0xf43d('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0xf43d('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xf43d('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xf43d('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xf43d('0x1')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0xf43d('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 bc3b66d..fcf3cab 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 _0x950a=['find','body','params','create','sequelize','transaction','directory','join','root','server/files/moh','mode','mkdirSync','0777','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','MusicOnHolds','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','save_name','converted_format','createdAt','format','%s.%s','basename','symlinkSync','findOne','removeSound','id2','getSounds','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','count','offset','set','Content-Range','apply','update','destroy','then','UserProfileResource','sendStatus','stack','name','send','index','VoiceMusicOnHold','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','merge'];(function(_0x130905,_0x1d14c4){var _0x403b26=function(_0x3f0634){while(--_0x3f0634){_0x130905['push'](_0x130905['shift']());}};_0x403b26(++_0x1d14c4);}(_0x950a,0x174));var _0xa950=function(_0x140d56,_0x431981){_0x140d56=_0x140d56-0x0;var _0xdb0651=_0x950a[_0x140d56];return _0xdb0651;};'use strict';var pdf=require(_0xa950('0x0'));var emlformat=require(_0xa950('0x1'));var rimraf=require(_0xa950('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa950('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa950('0x4'));var Mustache=require(_0xa950('0x5'));var util=require(_0xa950('0x6'));var path=require(_0xa950('0x7'));var sox=require(_0xa950('0x8'));var csv=require(_0xa950('0x9'));var ejs=require(_0xa950('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa950('0xb'));var crypto=require(_0xa950('0xc'));var jsforce=require(_0xa950('0xd'));var deskjs=require(_0xa950('0xe'));var toCsv=require(_0xa950('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa950('0xf'));var qs=require(_0xa950('0x10'));var hardwareService=require(_0xa950('0x11'));var logger=require(_0xa950('0x12'))(_0xa950('0x13'));var utils=require(_0xa950('0x14'));var config=require(_0xa950('0x15'));var db=require(_0xa950('0x16'))['db'];function respondWithStatusCode(_0x2ac16b,_0x54b484){_0x54b484=_0x54b484||0xcc;return function(_0x57329a){if(_0x57329a){return _0x2ac16b['sendStatus'](_0x54b484);}return _0x2ac16b['status'](_0x54b484)[_0xa950('0x17')]();};}function respondWithResult(_0x420fdd,_0x21ff25){_0x21ff25=_0x21ff25||0xc8;return function(_0x5dc76f){if(_0x5dc76f){return _0x420fdd[_0xa950('0x18')](_0x21ff25)['json'](_0x5dc76f);}};}function respondWithFilteredResult(_0x12f428,_0x548323){return function(_0x3224e6){if(_0x3224e6){var _0x1fff1c=_0x3224e6[_0xa950('0x19')],_0x1dc1f4=_0x548323['offset'],_0x42361b=_0x548323[_0xa950('0x1a')]+_0x548323['limit'],_0x4d73a2;if(_0x42361b>=_0x1fff1c){_0x42361b=_0x1fff1c;_0x4d73a2=0xc8;}else{_0x4d73a2=0xce;}_0x12f428[_0xa950('0x18')](_0x4d73a2);return _0x12f428[_0xa950('0x1b')](_0xa950('0x1c'),_0x1dc1f4+'-'+_0x42361b+'/'+_0x1fff1c)['json'](_0x3224e6);}return null;};}function patchUpdates(_0x297e82){return function(_0x1e5283){try{jsonpatch[_0xa950('0x1d')](_0x1e5283,_0x297e82,!![]);}catch(_0x333d4c){return BPromise['reject'](_0x333d4c);}return _0x1e5283['save']();};}function saveUpdates(_0x137f27,_0x46ec09){return function(_0x255dfc){if(_0x255dfc){return _0x255dfc[_0xa950('0x1e')](_0x137f27)['then'](function(_0xd010c1){return _0xd010c1;});}return null;};}function removeEntity(_0x422231,_0x219963){return function(_0x1e1b49){if(_0x1e1b49){return _0x1e1b49[_0xa950('0x1f')]()[_0xa950('0x20')](function(){var _0x34eb49=_0x1e1b49['get']({'plain':!![]});var _0x103e70='MusicOnHolds';return db[_0xa950('0x21')][_0xa950('0x1f')]({'where':{'type':_0x103e70,'resourceId':_0x34eb49['id']}})[_0xa950('0x20')](function(){return _0x1e1b49;});})['then'](function(){_0x422231['status'](0xcc)[_0xa950('0x17')]();});}};}function handleEntityNotFound(_0x3b2732,_0x350005){return function(_0x168b87){if(!_0x168b87){_0x3b2732[_0xa950('0x22')](0x194);}return _0x168b87;};}function handleError(_0x195e97,_0x52bd41){_0x52bd41=_0x52bd41||0x1f4;return function(_0x48e7bc){logger['error'](_0x48e7bc[_0xa950('0x23')]);if(_0x48e7bc[_0xa950('0x24')]){delete _0x48e7bc['name'];}_0x195e97[_0xa950('0x18')](_0x52bd41)[_0xa950('0x25')](_0x48e7bc);};}exports[_0xa950('0x26')]=function(_0x28e0e5,_0x28fe0c){var _0x20744e={},_0x48a711={},_0x1f332c={'count':0x0,'rows':[]};var _0x6d5632=db[_0xa950('0x27')]['rawAttributes'];_0x48a711['model']=_[_0xa950('0x28')](_0x6d5632);_0x48a711['query']=_[_0xa950('0x28')](_0x28e0e5[_0xa950('0x29')]);_0x48a711[_0xa950('0x2a')]=_[_0xa950('0x2b')](_0x48a711[_0xa950('0x2c')],_0x48a711['query']);_0x20744e[_0xa950('0x2d')]=_['intersection'](_0x48a711[_0xa950('0x2c')],qs[_0xa950('0x2e')](_0x28e0e5[_0xa950('0x29')]['fields']));_0x20744e[_0xa950('0x2d')]=_0x20744e['attributes']['length']?_0x20744e[_0xa950('0x2d')]:_0x48a711[_0xa950('0x2c')];if(!_0x28e0e5[_0xa950('0x29')][_0xa950('0x2f')](_0xa950('0x30'))){_0x20744e[_0xa950('0x31')]=qs[_0xa950('0x31')](_0x28e0e5[_0xa950('0x29')][_0xa950('0x31')]);_0x20744e[_0xa950('0x1a')]=qs[_0xa950('0x1a')](_0x28e0e5['query'][_0xa950('0x1a')]);}_0x20744e[_0xa950('0x32')]=qs[_0xa950('0x33')](_0x28e0e5['query'][_0xa950('0x33')]);_0x20744e[_0xa950('0x34')]=qs[_0xa950('0x2a')](_[_0xa950('0x35')](_0x28e0e5[_0xa950('0x29')],_0x48a711[_0xa950('0x2a')]));if(_0x28e0e5[_0xa950('0x29')][_0xa950('0x36')]){_0x20744e[_0xa950('0x34')]=_['merge'](_0x20744e['where'],{'$or':_[_0xa950('0x37')](_0x6d5632,function(_0x32541a){if(_0x32541a[_0xa950('0x38')]['key']!==_0xa950('0x39')){var _0x5252d1={};_0x5252d1[_0x32541a['field']]={'$like':'%'+_0x28e0e5[_0xa950('0x29')][_0xa950('0x36')]+'%'};return _0x5252d1;}})});}_0x20744e=_['merge']({},_0x20744e,_0x28e0e5[_0xa950('0x3a')]);var _0x2d23eb={'where':_0x20744e[_0xa950('0x34')]};return db[_0xa950('0x27')]['count'](_0x2d23eb)[_0xa950('0x20')](function(_0x2ef4c8){_0x1f332c['count']=_0x2ef4c8;if(_0x28e0e5['query'][_0xa950('0x3b')]){_0x20744e[_0xa950('0x3c')]=[{'all':!![]}];}return db[_0xa950('0x27')][_0xa950('0x3d')](_0x20744e);})['then'](function(_0x5345bd){_0x1f332c[_0xa950('0x3e')]=_0x5345bd;return _0x1f332c;})[_0xa950('0x20')](respondWithFilteredResult(_0x28fe0c,_0x20744e))[_0xa950('0x3f')](handleError(_0x28fe0c,null));};exports[_0xa950('0x40')]=function(_0x5a400d,_0x1ab8b6){var _0x5cd6db={'raw':![],'where':{'id':_0x5a400d['params']['id']}},_0x4fdfd9={};_0x4fdfd9['model']=_[_0xa950('0x28')](db[_0xa950('0x27')][_0xa950('0x41')]);_0x4fdfd9['query']=_[_0xa950('0x28')](_0x5a400d[_0xa950('0x29')]);_0x4fdfd9[_0xa950('0x2a')]=_[_0xa950('0x2b')](_0x4fdfd9[_0xa950('0x2c')],_0x4fdfd9[_0xa950('0x29')]);_0x5cd6db[_0xa950('0x2d')]=_[_0xa950('0x2b')](_0x4fdfd9[_0xa950('0x2c')],qs[_0xa950('0x2e')](_0x5a400d[_0xa950('0x29')]['fields']));_0x5cd6db[_0xa950('0x2d')]=_0x5cd6db[_0xa950('0x2d')][_0xa950('0x42')]?_0x5cd6db[_0xa950('0x2d')]:_0x4fdfd9['model'];if(_0x5a400d[_0xa950('0x29')][_0xa950('0x3b')]){_0x5cd6db[_0xa950('0x3c')]=[{'all':!![]}];}_0x5cd6db=_[_0xa950('0x43')]({},_0x5cd6db,_0x5a400d[_0xa950('0x3a')]);return db['VoiceMusicOnHold'][_0xa950('0x44')](_0x5cd6db)['then'](handleEntityNotFound(_0x1ab8b6,null))['then'](respondWithResult(_0x1ab8b6,null))[_0xa950('0x3f')](handleError(_0x1ab8b6,null));};exports[_0xa950('0x1e')]=function(_0x286c95,_0x551b45){if(_0x286c95[_0xa950('0x45')]['id']){delete _0x286c95[_0xa950('0x45')]['id'];}return db[_0xa950('0x27')]['find']({'where':{'id':_0x286c95[_0xa950('0x46')]['id']}})['then'](handleEntityNotFound(_0x551b45,null))[_0xa950('0x20')](saveUpdates(_0x286c95[_0xa950('0x45')],null))[_0xa950('0x20')](respondWithResult(_0x551b45,null))['catch'](handleError(_0x551b45,null));};exports[_0xa950('0x47')]=function(_0x44fc78,_0x1725e8,_0x4cb698){return db[_0xa950('0x48')][_0xa950('0x49')](function(_0x46ed68){if(_0x44fc78[_0xa950('0x45')]['mode']==='files'){_0x44fc78[_0xa950('0x45')][_0xa950('0x4a')]=path[_0xa950('0x4b')](config[_0xa950('0x4c')],_0xa950('0x4d'),_0x44fc78[_0xa950('0x45')]['name']);}return db[_0xa950('0x27')][_0xa950('0x47')](_0x44fc78[_0xa950('0x45')],{'transaction':_0x46ed68})['then'](function(_0x4602cb){if(_0x44fc78['body'][_0xa950('0x4e')]==='files'){fs[_0xa950('0x4f')](_0x4602cb['directory'],parseInt(_0xa950('0x50'),0x8));}var _0x1cfdbf=_0x44fc78['user'][_0xa950('0x51')]({'plain':!![]});if(!_0x1cfdbf)throw new Error(_0xa950('0x52'));if(_0x1cfdbf[_0xa950('0x53')]===_0xa950('0x54')){var _0x531c30=_0x4602cb['get']({'plain':!![]});return db['UserProfileSection'][_0xa950('0x44')]({'where':{'name':_0xa950('0x55'),'userProfileId':_0x1cfdbf[_0xa950('0x56')]},'raw':!![]})[_0xa950('0x20')](function(_0x9b5eaa){if(_0x9b5eaa&&_0x9b5eaa[_0xa950('0x57')]===0x0){return db[_0xa950('0x21')][_0xa950('0x47')]({'name':_0x531c30['name'],'resourceId':_0x531c30['id'],'type':_0x9b5eaa['name'],'sectionId':_0x9b5eaa['id']},{})['then'](function(){return _0x4602cb;});}else{return _0x4602cb;}})[_0xa950('0x3f')](function(_0x396c2d){logger[_0xa950('0x58')](_0xa950('0x59'),_0x396c2d);});}return _0x4602cb;});})[_0xa950('0x20')](respondWithResult(_0x1725e8,0xc9))[_0xa950('0x3f')](handleError(_0x1725e8,null));};exports[_0xa950('0x1f')]=function(_0x511dee,_0xe74897,_0x15a769){var _0x3471ee;return db[_0xa950('0x27')][_0xa950('0x44')]({'where':{'id':_0x511dee['params']['id']}})[_0xa950('0x20')](function(_0x2c07ea){if(_0x2c07ea){return db['sequelize'][_0xa950('0x49')](function(_0x1bc805){return _0x2c07ea[_0xa950('0x1f')]({'transaction':_0x1bc805,'raw':!![]})['then'](function(_0x56e817){if(_0x56e817['directory']){fs[_0xa950('0x5a')](_0x56e817['directory'])[_0xa950('0x5b')](function(_0xb80d0a){fs[_0xa950('0x5c')](path[_0xa950('0x4b')](_0x56e817[_0xa950('0x4a')],_0xb80d0a));});fs[_0xa950('0x5d')](_0x56e817[_0xa950('0x4a')]);}return _0x56e817;});})[_0xa950('0x3f')](function(_0x5de6c2){throw new db[(_0xa950('0x5e'))][(_0xa950('0x5f'))](_0x5de6c2[_0xa950('0x60')]);});}})[_0xa950('0x20')](handleEntityNotFound(_0xe74897,null))['then'](removeEntity(_0xe74897,null))[_0xa950('0x3f')](handleError(_0xe74897,null));};exports[_0xa950('0x61')]=function(_0x3dcb07,_0x37aef9,_0x9de6b4){return db[_0xa950('0x48')]['transaction'](function(_0x7a2ae2){var _0x2e5d17;return db['VoiceMusicOnHold'][_0xa950('0x44')]({'where':{'id':_0x3dcb07['params']['id']}})['then'](function(_0x4321cf){if(_0x4321cf){_0x2e5d17=_0x4321cf;return _0x4321cf[_0xa950('0x61')](_0x3dcb07['body']['id'],{'transaction':_0x7a2ae2});}})[_0xa950('0x20')](function(_0x1a5b08){if(_0x1a5b08){return db[_0xa950('0x62')]['findOne']({'where':{'id':_0x3dcb07['body']['id']},'attributes':['id',_0xa950('0x24'),_0xa950('0x63'),_0xa950('0x64'),_0xa950('0x65')],'raw':!![]});}})['then'](function(_0x6cdf6){if(_0x6cdf6){var _0x435a1d=path['join'](config[_0xa950('0x4c')],'server/files/sounds/converted',util[_0xa950('0x66')](_0xa950('0x67'),path[_0xa950('0x68')](_0x6cdf6[_0xa950('0x63')],path['extname'](_0x6cdf6[_0xa950('0x63')])),_0x6cdf6['converted_format']));var _0x1764fd=path[_0xa950('0x4b')](config[_0xa950('0x4c')],_0xa950('0x4d'),_0x2e5d17['name'],util[_0xa950('0x66')](_0xa950('0x67'),_0x6cdf6[_0xa950('0x24')],_0x6cdf6[_0xa950('0x64')]));fs[_0xa950('0x69')](_0x435a1d,_0x1764fd);return _0x6cdf6;}})[_0xa950('0x3f')](function(_0x158d25){throw new db['Sequelize']['ValidationError'](_0x158d25[_0xa950('0x60')]);});})[_0xa950('0x20')](handleEntityNotFound(_0x37aef9,null))['then'](respondWithResult(_0x37aef9,0xc9))['catch'](handleError(_0x37aef9,null));};exports['removeSound']=function(_0x375d55,_0x5288e8,_0x5b7808){return db[_0xa950('0x48')][_0xa950('0x49')](function(_0x22f75d){var _0x41e012;return db[_0xa950('0x27')][_0xa950('0x6a')]({'where':{'id':_0x375d55['params']['id']}})[_0xa950('0x20')](handleEntityNotFound(_0x5288e8,null))['then'](function(_0x1eb8b7){if(_0x1eb8b7){_0x41e012=_0x1eb8b7;return _0x1eb8b7[_0xa950('0x6b')](_0x375d55[_0xa950('0x46')][_0xa950('0x6c')]);}})[_0xa950('0x20')](function(_0x55ace9){if(_0x55ace9){return db[_0xa950('0x62')][_0xa950('0x6a')]({'where':{'id':_0x375d55[_0xa950('0x46')][_0xa950('0x6c')]},'attributes':['id',_0xa950('0x24'),_0xa950('0x63'),'converted_format',_0xa950('0x65')],'raw':!![]});}})[_0xa950('0x20')](function(_0x38e151){if(_0x38e151){fs[_0xa950('0x5c')](path[_0xa950('0x4b')](_0x41e012['directory'],util['format']('%s.%s',_0x38e151[_0xa950('0x24')],_0x38e151['converted_format'])));return _0x38e151;}})[_0xa950('0x3f')](function(_0xf0754){throw new db[(_0xa950('0x5e'))][(_0xa950('0x5f'))](_0xf0754[_0xa950('0x60')]);});})['then'](handleEntityNotFound(_0x5288e8,null))['then'](respondWithStatusCode(_0x5288e8,0xcc))[_0xa950('0x3f')](handleError(_0x5288e8,null));};exports[_0xa950('0x6d')]=function(_0xfbcc2d,_0x322658,_0x4018cd){var _0x59d82a={};var _0x33d1ef={};var _0x23e2fd;var _0x5779f8;return db[_0xa950('0x27')][_0xa950('0x6a')]({'where':{'id':_0xfbcc2d[_0xa950('0x46')]['id']}})[_0xa950('0x20')](handleEntityNotFound(_0x322658,null))['then'](function(_0x798a5e){if(_0x798a5e){_0x23e2fd=_0x798a5e;_0x33d1ef['model']=_[_0xa950('0x28')](db[_0xa950('0x62')][_0xa950('0x41')]);_0x33d1ef[_0xa950('0x29')]=_['keys'](_0xfbcc2d[_0xa950('0x29')]);_0x33d1ef[_0xa950('0x2a')]=_[_0xa950('0x2b')](_0x33d1ef['model'],_0x33d1ef[_0xa950('0x29')]);_0x59d82a['attributes']=_['intersection'](_0x33d1ef['model'],qs['fields'](_0xfbcc2d[_0xa950('0x29')][_0xa950('0x2e')]));_0x59d82a[_0xa950('0x2d')]=_0x59d82a[_0xa950('0x2d')]['length']?_0x59d82a[_0xa950('0x2d')]:_0x33d1ef[_0xa950('0x2c')];_0x59d82a[_0xa950('0x32')]=qs[_0xa950('0x33')](_0xfbcc2d[_0xa950('0x29')]['sort']);_0x59d82a[_0xa950('0x34')]=qs[_0xa950('0x2a')](_[_0xa950('0x35')](_0xfbcc2d[_0xa950('0x29')],_0x33d1ef[_0xa950('0x2a')]));if(_0xfbcc2d[_0xa950('0x29')][_0xa950('0x36')]){_0x59d82a[_0xa950('0x34')]=_[_0xa950('0x43')](_0x59d82a['where'],{'$or':_[_0xa950('0x37')](_0x59d82a['attributes'],function(_0x2a2d56){var _0x582c1c={};_0x582c1c[_0x2a2d56]={'$like':'%'+_0xfbcc2d[_0xa950('0x29')][_0xa950('0x36')]+'%'};return _0x582c1c;})});}_0x59d82a=_['merge']({},_0x59d82a,_0xfbcc2d[_0xa950('0x3a')]);return _0x23e2fd[_0xa950('0x6d')](_0x59d82a);}})['then'](function(_0x2b4ff6){if(_0x2b4ff6){_0x5779f8=_0x2b4ff6[_0xa950('0x42')];if(!_0xfbcc2d[_0xa950('0x29')][_0xa950('0x2f')](_0xa950('0x30'))){_0x59d82a[_0xa950('0x31')]=qs['limit'](_0xfbcc2d['query'][_0xa950('0x31')]);_0x59d82a[_0xa950('0x1a')]=qs[_0xa950('0x1a')](_0xfbcc2d[_0xa950('0x29')][_0xa950('0x1a')]);}return _0x23e2fd[_0xa950('0x6d')](_0x59d82a);}})[_0xa950('0x20')](function(_0x321b67){if(_0x321b67){return _0x321b67?{'count':_0x5779f8,'rows':_0x321b67}:null;}})[_0xa950('0x20')](respondWithResult(_0x322658,null))[_0xa950('0x3f')](handleError(_0x322658,null));}; \ No newline at end of file +var _0x0269=['sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','MusicOnHolds','UserProfileResource','error','stack','name','send','index','VoiceMusicOnHold','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','key','VIRTUAL','field','includeAll','include','rows','catch','show','params','options','find','body','create','transaction','mode','files','join','server/files/moh','mkdirSync','directory','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','Sequelize','message','addSound','save_name','createdAt','root','format','%s.%s','basename','extname','converted_format','symlinkSync','ValidationError','sequelize','findOne','removeSound','id2','getSounds','Sound','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb'];(function(_0x20f023,_0x1e2118){var _0x3cd8c5=function(_0x1b6f06){while(--_0x1b6f06){_0x20f023['push'](_0x20f023['shift']());}};_0x3cd8c5(++_0x1e2118);}(_0x0269,0x135));var _0x9026=function(_0x4bf941,_0x21a597){_0x4bf941=_0x4bf941-0x0;var _0x2c8d00=_0x0269[_0x4bf941];return _0x2c8d00;};'use strict';var pdf=require(_0x9026('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9026('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9026('0x2'));var rp=require('request-promise');var moment=require(_0x9026('0x3'));var BPromise=require(_0x9026('0x4'));var Mustache=require(_0x9026('0x5'));var util=require(_0x9026('0x6'));var path=require('path');var sox=require(_0x9026('0x7'));var csv=require(_0x9026('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x9026('0x9'));var crypto=require(_0x9026('0xa'));var jsforce=require(_0x9026('0xb'));var deskjs=require(_0x9026('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9026('0xd'));var Papa=require(_0x9026('0xe'));var Redis=require(_0x9026('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9026('0x10'));var hardwareService=require(_0x9026('0x11'));var logger=require(_0x9026('0x12'))('api');var utils=require(_0x9026('0x13'));var config=require('../../config/environment');var db=require(_0x9026('0x14'))['db'];function respondWithStatusCode(_0x389f69,_0x4f4ddd){_0x4f4ddd=_0x4f4ddd||0xcc;return function(_0x2148f0){if(_0x2148f0){return _0x389f69[_0x9026('0x15')](_0x4f4ddd);}return _0x389f69[_0x9026('0x16')](_0x4f4ddd)[_0x9026('0x17')]();};}function respondWithResult(_0x51aba6,_0x1f794b){_0x1f794b=_0x1f794b||0xc8;return function(_0x4ee699){if(_0x4ee699){return _0x51aba6[_0x9026('0x16')](_0x1f794b)[_0x9026('0x18')](_0x4ee699);}};}function respondWithFilteredResult(_0xd2473f,_0xe7b66a){return function(_0x11c0d1){if(_0x11c0d1){var _0x421ee2=_0x11c0d1[_0x9026('0x19')],_0x142465=_0xe7b66a[_0x9026('0x1a')],_0x1eb679=_0xe7b66a['offset']+_0xe7b66a[_0x9026('0x1b')],_0x5d5053;if(_0x1eb679>=_0x421ee2){_0x1eb679=_0x421ee2;_0x5d5053=0xc8;}else{_0x5d5053=0xce;}_0xd2473f[_0x9026('0x16')](_0x5d5053);return _0xd2473f[_0x9026('0x1c')](_0x9026('0x1d'),_0x142465+'-'+_0x1eb679+'/'+_0x421ee2)[_0x9026('0x18')](_0x11c0d1);}return null;};}function patchUpdates(_0x3e57f7){return function(_0x42c928){try{jsonpatch[_0x9026('0x1e')](_0x42c928,_0x3e57f7,!![]);}catch(_0x52edf1){return BPromise[_0x9026('0x1f')](_0x52edf1);}return _0x42c928['save']();};}function saveUpdates(_0x2203f0,_0x5e6c46){return function(_0x2a9bf0){if(_0x2a9bf0){return _0x2a9bf0[_0x9026('0x20')](_0x2203f0)[_0x9026('0x21')](function(_0x22a77c){return _0x22a77c;});}return null;};}function removeEntity(_0xdce1d6,_0x25b9f2){return function(_0x71a263){if(_0x71a263){return _0x71a263[_0x9026('0x22')]()[_0x9026('0x21')](function(){var _0x4d01d4=_0x71a263['get']({'plain':!![]});var _0x7b962=_0x9026('0x23');return db[_0x9026('0x24')][_0x9026('0x22')]({'where':{'type':_0x7b962,'resourceId':_0x4d01d4['id']}})[_0x9026('0x21')](function(){return _0x71a263;});})[_0x9026('0x21')](function(){_0xdce1d6[_0x9026('0x16')](0xcc)[_0x9026('0x17')]();});}};}function handleEntityNotFound(_0x775596,_0x4293df){return function(_0xde5c83){if(!_0xde5c83){_0x775596[_0x9026('0x15')](0x194);}return _0xde5c83;};}function handleError(_0x38fd9c,_0x2ace13){_0x2ace13=_0x2ace13||0x1f4;return function(_0x28dba4){logger[_0x9026('0x25')](_0x28dba4[_0x9026('0x26')]);if(_0x28dba4[_0x9026('0x27')]){delete _0x28dba4[_0x9026('0x27')];}_0x38fd9c['status'](_0x2ace13)[_0x9026('0x28')](_0x28dba4);};}exports[_0x9026('0x29')]=function(_0x30c988,_0x103ce7){var _0x17dc25={},_0x3cead8={},_0x23cf05={'count':0x0,'rows':[]};var _0xedb8bb=db[_0x9026('0x2a')][_0x9026('0x2b')];_0x3cead8[_0x9026('0x2c')]=_['keys'](_0xedb8bb);_0x3cead8[_0x9026('0x2d')]=_[_0x9026('0x2e')](_0x30c988[_0x9026('0x2d')]);_0x3cead8[_0x9026('0x2f')]=_[_0x9026('0x30')](_0x3cead8[_0x9026('0x2c')],_0x3cead8[_0x9026('0x2d')]);_0x17dc25['attributes']=_[_0x9026('0x30')](_0x3cead8['model'],qs[_0x9026('0x31')](_0x30c988[_0x9026('0x2d')][_0x9026('0x31')]));_0x17dc25[_0x9026('0x32')]=_0x17dc25[_0x9026('0x32')][_0x9026('0x33')]?_0x17dc25['attributes']:_0x3cead8[_0x9026('0x2c')];if(!_0x30c988[_0x9026('0x2d')][_0x9026('0x34')](_0x9026('0x35'))){_0x17dc25['limit']=qs[_0x9026('0x1b')](_0x30c988[_0x9026('0x2d')]['limit']);_0x17dc25[_0x9026('0x1a')]=qs[_0x9026('0x1a')](_0x30c988[_0x9026('0x2d')][_0x9026('0x1a')]);}_0x17dc25[_0x9026('0x36')]=qs[_0x9026('0x37')](_0x30c988[_0x9026('0x2d')][_0x9026('0x37')]);_0x17dc25['where']=qs[_0x9026('0x2f')](_[_0x9026('0x38')](_0x30c988['query'],_0x3cead8[_0x9026('0x2f')]));if(_0x30c988[_0x9026('0x2d')][_0x9026('0x39')]){_0x17dc25[_0x9026('0x3a')]=_[_0x9026('0x3b')](_0x17dc25[_0x9026('0x3a')],{'$or':_[_0x9026('0x3c')](_0xedb8bb,function(_0x13c084){if(_0x13c084['type'][_0x9026('0x3d')]!==_0x9026('0x3e')){var _0x120da4={};_0x120da4[_0x13c084[_0x9026('0x3f')]]={'$like':'%'+_0x30c988[_0x9026('0x2d')][_0x9026('0x39')]+'%'};return _0x120da4;}})});}_0x17dc25=_[_0x9026('0x3b')]({},_0x17dc25,_0x30c988['options']);var _0x20d1fe={'where':_0x17dc25['where']};return db[_0x9026('0x2a')][_0x9026('0x19')](_0x20d1fe)[_0x9026('0x21')](function(_0x3e106a){_0x23cf05['count']=_0x3e106a;if(_0x30c988['query'][_0x9026('0x40')]){_0x17dc25[_0x9026('0x41')]=[{'all':!![]}];}return db['VoiceMusicOnHold']['findAll'](_0x17dc25);})['then'](function(_0x18272e){_0x23cf05[_0x9026('0x42')]=_0x18272e;return _0x23cf05;})['then'](respondWithFilteredResult(_0x103ce7,_0x17dc25))[_0x9026('0x43')](handleError(_0x103ce7,null));};exports[_0x9026('0x44')]=function(_0x1a77bd,_0x475c22){var _0x14ee99={'raw':![],'where':{'id':_0x1a77bd[_0x9026('0x45')]['id']}},_0x7c5b43={};_0x7c5b43[_0x9026('0x2c')]=_['keys'](db[_0x9026('0x2a')][_0x9026('0x2b')]);_0x7c5b43['query']=_['keys'](_0x1a77bd['query']);_0x7c5b43[_0x9026('0x2f')]=_[_0x9026('0x30')](_0x7c5b43[_0x9026('0x2c')],_0x7c5b43[_0x9026('0x2d')]);_0x14ee99[_0x9026('0x32')]=_['intersection'](_0x7c5b43[_0x9026('0x2c')],qs['fields'](_0x1a77bd[_0x9026('0x2d')][_0x9026('0x31')]));_0x14ee99[_0x9026('0x32')]=_0x14ee99[_0x9026('0x32')]['length']?_0x14ee99['attributes']:_0x7c5b43[_0x9026('0x2c')];if(_0x1a77bd[_0x9026('0x2d')][_0x9026('0x40')]){_0x14ee99[_0x9026('0x41')]=[{'all':!![]}];}_0x14ee99=_[_0x9026('0x3b')]({},_0x14ee99,_0x1a77bd[_0x9026('0x46')]);return db['VoiceMusicOnHold'][_0x9026('0x47')](_0x14ee99)['then'](handleEntityNotFound(_0x475c22,null))[_0x9026('0x21')](respondWithResult(_0x475c22,null))[_0x9026('0x43')](handleError(_0x475c22,null));};exports['update']=function(_0x29e091,_0x4dfc21){if(_0x29e091[_0x9026('0x48')]['id']){delete _0x29e091['body']['id'];}return db[_0x9026('0x2a')]['find']({'where':{'id':_0x29e091['params']['id']}})[_0x9026('0x21')](handleEntityNotFound(_0x4dfc21,null))[_0x9026('0x21')](saveUpdates(_0x29e091[_0x9026('0x48')],null))['then'](respondWithResult(_0x4dfc21,null))[_0x9026('0x43')](handleError(_0x4dfc21,null));};exports[_0x9026('0x49')]=function(_0x446cd0,_0x442e5a,_0x3636c7){return db['sequelize'][_0x9026('0x4a')](function(_0x23d0e9){if(_0x446cd0[_0x9026('0x48')][_0x9026('0x4b')]===_0x9026('0x4c')){_0x446cd0[_0x9026('0x48')]['directory']=path[_0x9026('0x4d')](config['root'],_0x9026('0x4e'),_0x446cd0[_0x9026('0x48')]['name']);}return db[_0x9026('0x2a')][_0x9026('0x49')](_0x446cd0[_0x9026('0x48')],{'transaction':_0x23d0e9})[_0x9026('0x21')](function(_0x257310){if(_0x446cd0[_0x9026('0x48')][_0x9026('0x4b')]===_0x9026('0x4c')){fs[_0x9026('0x4f')](_0x257310[_0x9026('0x50')],parseInt('0777',0x8));}var _0x207ab6=_0x446cd0[_0x9026('0x51')]['get']({'plain':!![]});if(!_0x207ab6)throw new Error(_0x9026('0x52'));if(_0x207ab6[_0x9026('0x53')]===_0x9026('0x51')){var _0x3fbfba=_0x257310[_0x9026('0x54')]({'plain':!![]});return db[_0x9026('0x55')]['find']({'where':{'name':_0x9026('0x23'),'userProfileId':_0x207ab6['userProfileId']},'raw':!![]})[_0x9026('0x21')](function(_0x4212df){if(_0x4212df&&_0x4212df[_0x9026('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x3fbfba[_0x9026('0x27')],'resourceId':_0x3fbfba['id'],'type':_0x4212df[_0x9026('0x27')],'sectionId':_0x4212df['id']},{})[_0x9026('0x21')](function(){return _0x257310;});}else{return _0x257310;}})[_0x9026('0x43')](function(_0x3a4a30){logger[_0x9026('0x25')](_0x9026('0x57'),_0x3a4a30);});}return _0x257310;});})[_0x9026('0x21')](respondWithResult(_0x442e5a,0xc9))[_0x9026('0x43')](handleError(_0x442e5a,null));};exports[_0x9026('0x22')]=function(_0x47b72e,_0x56c18a,_0x2f8bd5){var _0x325f4d;return db[_0x9026('0x2a')][_0x9026('0x47')]({'where':{'id':_0x47b72e[_0x9026('0x45')]['id']}})[_0x9026('0x21')](function(_0x2b0d97){if(_0x2b0d97){return db['sequelize'][_0x9026('0x4a')](function(_0x499371){return _0x2b0d97[_0x9026('0x22')]({'transaction':_0x499371,'raw':!![]})[_0x9026('0x21')](function(_0x5e7075){if(_0x5e7075[_0x9026('0x50')]){fs[_0x9026('0x58')](_0x5e7075[_0x9026('0x50')])[_0x9026('0x59')](function(_0x4c3236){fs[_0x9026('0x5a')](path[_0x9026('0x4d')](_0x5e7075['directory'],_0x4c3236));});fs['rmdirSync'](_0x5e7075[_0x9026('0x50')]);}return _0x5e7075;});})['catch'](function(_0x2f9b95){throw new db[(_0x9026('0x5b'))]['ValidationError'](_0x2f9b95[_0x9026('0x5c')]);});}})[_0x9026('0x21')](handleEntityNotFound(_0x56c18a,null))[_0x9026('0x21')](removeEntity(_0x56c18a,null))[_0x9026('0x43')](handleError(_0x56c18a,null));};exports[_0x9026('0x5d')]=function(_0x22a704,_0x1c6f13,_0x1dc37d){return db['sequelize'][_0x9026('0x4a')](function(_0x3ba101){var _0xefd4df;return db[_0x9026('0x2a')][_0x9026('0x47')]({'where':{'id':_0x22a704[_0x9026('0x45')]['id']}})[_0x9026('0x21')](function(_0x7bc2e8){if(_0x7bc2e8){_0xefd4df=_0x7bc2e8;return _0x7bc2e8[_0x9026('0x5d')](_0x22a704[_0x9026('0x48')]['id'],{'transaction':_0x3ba101});}})['then'](function(_0x23c380){if(_0x23c380){return db['Sound']['findOne']({'where':{'id':_0x22a704[_0x9026('0x48')]['id']},'attributes':['id',_0x9026('0x27'),_0x9026('0x5e'),'converted_format',_0x9026('0x5f')],'raw':!![]});}})['then'](function(_0x1e125b){if(_0x1e125b){var _0x434014=path['join'](config[_0x9026('0x60')],'server/files/sounds/converted',util[_0x9026('0x61')](_0x9026('0x62'),path[_0x9026('0x63')](_0x1e125b[_0x9026('0x5e')],path[_0x9026('0x64')](_0x1e125b[_0x9026('0x5e')])),_0x1e125b['converted_format']));var _0x5f15ba=path[_0x9026('0x4d')](config[_0x9026('0x60')],_0x9026('0x4e'),_0xefd4df[_0x9026('0x27')],util[_0x9026('0x61')](_0x9026('0x62'),_0x1e125b['name'],_0x1e125b[_0x9026('0x65')]));fs[_0x9026('0x66')](_0x434014,_0x5f15ba);return _0x1e125b;}})[_0x9026('0x43')](function(_0x4cf45f){throw new db[(_0x9026('0x5b'))][(_0x9026('0x67'))](_0x4cf45f[_0x9026('0x5c')]);});})[_0x9026('0x21')](handleEntityNotFound(_0x1c6f13,null))[_0x9026('0x21')](respondWithResult(_0x1c6f13,0xc9))[_0x9026('0x43')](handleError(_0x1c6f13,null));};exports['removeSound']=function(_0x56498d,_0x2dc324,_0x15e1a9){return db[_0x9026('0x68')]['transaction'](function(_0x212f37){var _0x4d4e41;return db[_0x9026('0x2a')][_0x9026('0x69')]({'where':{'id':_0x56498d[_0x9026('0x45')]['id']}})[_0x9026('0x21')](handleEntityNotFound(_0x2dc324,null))[_0x9026('0x21')](function(_0x52456a){if(_0x52456a){_0x4d4e41=_0x52456a;return _0x52456a[_0x9026('0x6a')](_0x56498d[_0x9026('0x45')][_0x9026('0x6b')]);}})[_0x9026('0x21')](function(_0x24dc00){if(_0x24dc00){return db['Sound'][_0x9026('0x69')]({'where':{'id':_0x56498d['params'][_0x9026('0x6b')]},'attributes':['id','name','save_name',_0x9026('0x65'),'createdAt'],'raw':!![]});}})[_0x9026('0x21')](function(_0x3c2736){if(_0x3c2736){fs[_0x9026('0x5a')](path[_0x9026('0x4d')](_0x4d4e41[_0x9026('0x50')],util[_0x9026('0x61')](_0x9026('0x62'),_0x3c2736['name'],_0x3c2736['converted_format'])));return _0x3c2736;}})[_0x9026('0x43')](function(_0x269406){throw new db[(_0x9026('0x5b'))]['ValidationError'](_0x269406[_0x9026('0x5c')]);});})[_0x9026('0x21')](handleEntityNotFound(_0x2dc324,null))[_0x9026('0x21')](respondWithStatusCode(_0x2dc324,0xcc))['catch'](handleError(_0x2dc324,null));};exports[_0x9026('0x6c')]=function(_0x440f96,_0x412c1e,_0x2f12f3){var _0x779fd1={};var _0x18813e={};var _0x5da133;var _0x19f6ba;return db['VoiceMusicOnHold'][_0x9026('0x69')]({'where':{'id':_0x440f96['params']['id']}})[_0x9026('0x21')](handleEntityNotFound(_0x412c1e,null))[_0x9026('0x21')](function(_0x2ed333){if(_0x2ed333){_0x5da133=_0x2ed333;_0x18813e[_0x9026('0x2c')]=_[_0x9026('0x2e')](db[_0x9026('0x6d')][_0x9026('0x2b')]);_0x18813e[_0x9026('0x2d')]=_[_0x9026('0x2e')](_0x440f96[_0x9026('0x2d')]);_0x18813e['filters']=_['intersection'](_0x18813e['model'],_0x18813e['query']);_0x779fd1['attributes']=_[_0x9026('0x30')](_0x18813e[_0x9026('0x2c')],qs[_0x9026('0x31')](_0x440f96[_0x9026('0x2d')][_0x9026('0x31')]));_0x779fd1['attributes']=_0x779fd1[_0x9026('0x32')][_0x9026('0x33')]?_0x779fd1[_0x9026('0x32')]:_0x18813e[_0x9026('0x2c')];_0x779fd1[_0x9026('0x36')]=qs[_0x9026('0x37')](_0x440f96[_0x9026('0x2d')][_0x9026('0x37')]);_0x779fd1[_0x9026('0x3a')]=qs[_0x9026('0x2f')](_[_0x9026('0x38')](_0x440f96[_0x9026('0x2d')],_0x18813e['filters']));if(_0x440f96[_0x9026('0x2d')][_0x9026('0x39')]){_0x779fd1[_0x9026('0x3a')]=_[_0x9026('0x3b')](_0x779fd1[_0x9026('0x3a')],{'$or':_['map'](_0x779fd1[_0x9026('0x32')],function(_0x51060b){var _0xd16e08={};_0xd16e08[_0x51060b]={'$like':'%'+_0x440f96[_0x9026('0x2d')][_0x9026('0x39')]+'%'};return _0xd16e08;})});}_0x779fd1=_[_0x9026('0x3b')]({},_0x779fd1,_0x440f96[_0x9026('0x46')]);return _0x5da133['getSounds'](_0x779fd1);}})[_0x9026('0x21')](function(_0x248586){if(_0x248586){_0x19f6ba=_0x248586[_0x9026('0x33')];if(!_0x440f96[_0x9026('0x2d')]['hasOwnProperty']('nolimit')){_0x779fd1[_0x9026('0x1b')]=qs[_0x9026('0x1b')](_0x440f96['query']['limit']);_0x779fd1[_0x9026('0x1a')]=qs['offset'](_0x440f96[_0x9026('0x2d')][_0x9026('0x1a')]);}return _0x5da133[_0x9026('0x6c')](_0x779fd1);}})['then'](function(_0x1fafb0){if(_0x1fafb0){return _0x1fafb0?{'count':_0x19f6ba,'rows':_0x1fafb0}:null;}})[_0x9026('0x21')](respondWithResult(_0x412c1e,null))[_0x9026('0x43')](handleError(_0x412c1e,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 91f53fb..8670902 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 _0x9b7a=['define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','exports'];(function(_0x8dded3,_0x295890){var _0x3b6715=function(_0x448437){while(--_0x448437){_0x8dded3['push'](_0x8dded3['shift']());}};_0x3b6715(++_0x295890);}(_0x9b7a,0x1ed));var _0xa9b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9b7a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa9b7('0x0'));var util=require(_0xa9b7('0x1'));var logger=require(_0xa9b7('0x2'))(_0xa9b7('0x3'));var moment=require(_0xa9b7('0x4'));var BPromise=require(_0xa9b7('0x5'));var rp=require(_0xa9b7('0x6'));var fs=require('fs');var path=require(_0xa9b7('0x7'));var rimraf=require('rimraf');var config=require(_0xa9b7('0x8'));var attributes=require(_0xa9b7('0x9'));module[_0xa9b7('0xa')]=function(_0x11d200,_0x40c37d){return _0x11d200[_0xa9b7('0xb')](_0xa9b7('0xc'),attributes,{'tableName':_0xa9b7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbfaf=['exports','VoiceMusicOnHold','voice_musiconhold','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMusicOnHold.attributes'];(function(_0x3582a1,_0x38314a){var _0x5054c0=function(_0x4bc158){while(--_0x4bc158){_0x3582a1['push'](_0x3582a1['shift']());}};_0x5054c0(++_0x38314a);}(_0xbfaf,0x12c));var _0xfbfa=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0xbfaf[_0x39e283];return _0x7de89f;};'use strict';var _=require(_0xfbfa('0x0'));var util=require(_0xfbfa('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfbfa('0x2'));var BPromise=require(_0xfbfa('0x3'));var rp=require(_0xfbfa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfbfa('0x5'));var config=require(_0xfbfa('0x6'));var attributes=require(_0xfbfa('0x7'));module[_0xfbfa('0x8')]=function(_0x5edf1b,_0x3e7c0a){return _0x5edf1b['define'](_0xfbfa('0x9'),attributes,{'tableName':_0xfbfa('0xa'),'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 2ef0e9a..f0dabec 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 _0x3d2a=['info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x1601a1,_0x2961b3){var _0x4b141b=function(_0x2b95bb){while(--_0x2b95bb){_0x1601a1['push'](_0x1601a1['shift']());}};_0x4b141b(++_0x2961b3);}(_0x3d2a,0x1d4));var _0xa3d2=function(_0x4dfb1b,_0x26850a){_0x4dfb1b=_0x4dfb1b-0x0;var _0x4dc88=_0x3d2a[_0x4dfb1b];return _0x4dc88;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa3d2('0x0'));var BPromise=require(_0xa3d2('0x1'));var rs=require(_0xa3d2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa3d2('0x3'));var logger=require(_0xa3d2('0x4'))(_0xa3d2('0x5'));var config=require(_0xa3d2('0x6'));var jayson=require(_0xa3d2('0x7'));var client=jayson[_0xa3d2('0x8')][_0xa3d2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x589059,_0x1b36bb,_0x374e77){return new BPromise(function(_0x30177c,_0x2e5796){return client[_0xa3d2('0xa')](_0x589059,_0x374e77)[_0xa3d2('0xb')](function(_0x21a528){logger[_0xa3d2('0xc')](_0xa3d2('0xd'),_0x1b36bb,_0xa3d2('0xe'));logger[_0xa3d2('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x1b36bb,_0xa3d2('0xe'),JSON['stringify'](_0x21a528));if(_0x21a528[_0xa3d2('0x10')]){if(_0x21a528[_0xa3d2('0x10')]['code']===0x1f4){logger[_0xa3d2('0x10')](_0xa3d2('0xd'),_0x1b36bb,_0x21a528[_0xa3d2('0x10')][_0xa3d2('0x11')]);return _0x2e5796(_0x21a528['error'][_0xa3d2('0x11')]);}logger[_0xa3d2('0x10')](_0xa3d2('0xd'),_0x1b36bb,_0x21a528[_0xa3d2('0x10')][_0xa3d2('0x11')]);return _0x30177c(_0x21a528[_0xa3d2('0x10')][_0xa3d2('0x11')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x1b36bb,_0xa3d2('0xe'));_0x30177c(_0x21a528[_0xa3d2('0x12')][_0xa3d2('0x11')]);}})[_0xa3d2('0x13')](function(_0x269c5d){logger[_0xa3d2('0x10')](_0xa3d2('0xd'),_0x1b36bb,_0x269c5d);_0x2e5796(_0x269c5d);});});} \ No newline at end of file +var _0x0379=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','request\x20sent','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','lodash','util','bluebird','randomstring'];(function(_0x1a3bca,_0x4e8807){var _0x1f7da7=function(_0x555fc2){while(--_0x555fc2){_0x1a3bca['push'](_0x1a3bca['shift']());}};_0x1f7da7(++_0x4e8807);}(_0x0379,0x114));var _0x9037=function(_0x30cea6,_0x3a5616){_0x30cea6=_0x30cea6-0x0;var _0x1b77d0=_0x0379[_0x30cea6];return _0x1b77d0;};'use strict';var _=require(_0x9037('0x0'));var util=require(_0x9037('0x1'));var moment=require('moment');var BPromise=require(_0x9037('0x2'));var rs=require(_0x9037('0x3'));var fs=require('fs');var Redis=require(_0x9037('0x4'));var db=require(_0x9037('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9037('0x6'))(_0x9037('0x7'));var config=require('../../config/environment');var jayson=require(_0x9037('0x8'));var client=jayson[_0x9037('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16018c,_0x30ba1e,_0x3d45ff){return new BPromise(function(_0x7ea517,_0x322b26){return client[_0x9037('0xa')](_0x16018c,_0x3d45ff)[_0x9037('0xb')](function(_0x4334c5){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x30ba1e,_0x9037('0xc'));logger['debug'](_0x9037('0xd'),_0x30ba1e,_0x9037('0xc'),JSON[_0x9037('0xe')](_0x4334c5));if(_0x4334c5[_0x9037('0xf')]){if(_0x4334c5[_0x9037('0xf')]['code']===0x1f4){logger[_0x9037('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x30ba1e,_0x4334c5['error'][_0x9037('0x10')]);return _0x322b26(_0x4334c5[_0x9037('0xf')]['message']);}logger[_0x9037('0xf')](_0x9037('0x11'),_0x30ba1e,_0x4334c5['error'][_0x9037('0x10')]);return _0x7ea517(_0x4334c5['error'][_0x9037('0x10')]);}else{logger[_0x9037('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x30ba1e,_0x9037('0xc'));_0x7ea517(_0x4334c5[_0x9037('0x13')][_0x9037('0x10')]);}})['catch'](function(_0x110dfa){logger[_0x9037('0xf')](_0x9037('0x11'),_0x30ba1e,_0x110dfa);_0x322b26(_0x110dfa);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index a910146..de1762a 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 _0x4c73=['/:id/users','addAgents','put','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','getAgents','post','create'];(function(_0x3ac322,_0xe480e2){var _0x58d119=function(_0x2b6f42){while(--_0x2b6f42){_0x3ac322['push'](_0x3ac322['shift']());}};_0x58d119(++_0xe480e2);}(_0x4c73,0x14c));var _0x34c7=function(_0x40b008,_0x460d25){_0x40b008=_0x40b008-0x0;var _0x3d3a9b=_0x4c73[_0x40b008];return _0x3d3a9b;};'use strict';var multer=require(_0x34c7('0x0'));var util=require(_0x34c7('0x1'));var path=require(_0x34c7('0x2'));var timeout=require(_0x34c7('0x3'));var express=require(_0x34c7('0x4'));var router=express[_0x34c7('0x5')]();var auth=require(_0x34c7('0x6'));var interaction=require(_0x34c7('0x7'));var config=require('../../config/environment');var controller=require(_0x34c7('0x8'));router[_0x34c7('0x9')]('/',auth[_0x34c7('0xa')](),controller[_0x34c7('0xb')]);router[_0x34c7('0x9')](_0x34c7('0xc'),auth['isAuthenticated'](),controller[_0x34c7('0xd')]);router['get'](_0x34c7('0xe'),auth[_0x34c7('0xa')](),controller['show']);router[_0x34c7('0x9')]('/:id/users',auth[_0x34c7('0xa')](),controller[_0x34c7('0xf')]);router[_0x34c7('0x10')]('/',auth[_0x34c7('0xa')](),controller[_0x34c7('0x11')]);router[_0x34c7('0x10')](_0x34c7('0x12'),auth[_0x34c7('0xa')](),controller[_0x34c7('0x13')]);router[_0x34c7('0x14')](_0x34c7('0xe'),auth[_0x34c7('0xa')](),controller[_0x34c7('0x15')]);router[_0x34c7('0x16')](_0x34c7('0xe'),auth[_0x34c7('0xa')](),controller[_0x34c7('0x17')]);router[_0x34c7('0x16')]('/:id/users',auth[_0x34c7('0xa')](),controller[_0x34c7('0x18')]);module['exports']=router; \ No newline at end of file +var _0x2227=['create','/:id/users','put','delete','/:id','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','post'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x2227,0x103));var _0x7222=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0x2227[_0x43b08];return _0x5e05f4;};'use strict';var multer=require('multer');var util=require(_0x7222('0x0'));var path=require(_0x7222('0x1'));var timeout=require(_0x7222('0x2'));var express=require(_0x7222('0x3'));var router=express['Router']();var auth=require(_0x7222('0x4'));var interaction=require(_0x7222('0x5'));var config=require(_0x7222('0x6'));var controller=require('./voicePrefix.controller');router['get']('/',auth[_0x7222('0x7')](),controller['index']);router['get']('/describe',auth[_0x7222('0x7')](),controller['describe']);router[_0x7222('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x7222('0x9')]);router['get']('/:id/users',auth[_0x7222('0x7')](),controller['getAgents']);router[_0x7222('0xa')]('/',auth['isAuthenticated'](),controller[_0x7222('0xb')]);router['post'](_0x7222('0xc'),auth['isAuthenticated'](),controller['addAgents']);router[_0x7222('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7222('0xe')](_0x7222('0xf'),auth[_0x7222('0x7')](),controller[_0x7222('0x10')]);router['delete']('/:id/users',auth[_0x7222('0x7')](),controller['removeAgents']);module[_0x7222('0x11')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 00b91e7..e78f582 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 _0xab46=['INTEGER','sequelize','name','VIRTUAL','getDataValue','STRING'];(function(_0x4793c2,_0x3aedab){var _0x567997=function(_0x3aa864){while(--_0x3aa864){_0x4793c2['push'](_0x4793c2['shift']());}};_0x567997(++_0x3aedab);}(_0xab46,0xb5));var _0x6ab4=function(_0x32bbb1,_0xa0e27e){_0x32bbb1=_0x32bbb1-0x0;var _0x42b415=_0xab46[_0x32bbb1];return _0x42b415;};'use strict';var Sequelize=require(_0x6ab4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6ab4('0x1')},'prefix':{'type':Sequelize[_0x6ab4('0x2')],'get':function(_0x27a0ca){return'system-'+this[_0x6ab4('0x3')](_0x6ab4('0x1'))+'-';}},'description':{'type':Sequelize[_0x6ab4('0x4')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x6ab4('0x5')]}}; \ No newline at end of file +var _0x10fa=['getDataValue','INTEGER','exports','STRING','name','VIRTUAL','system-'];(function(_0x1c6b3a,_0x1fd320){var _0xea6598=function(_0x63c616){while(--_0x63c616){_0x1c6b3a['push'](_0x1c6b3a['shift']());}};_0xea6598(++_0x1fd320);}(_0x10fa,0x105));var _0xa10f=function(_0x35ebfb,_0x4464d2){_0x35ebfb=_0x35ebfb-0x0;var _0x4cca3d=_0x10fa[_0x35ebfb];return _0x4cca3d;};'use strict';var Sequelize=require('sequelize');module[_0xa10f('0x0')]={'name':{'type':Sequelize[_0xa10f('0x1')],'allowNull':![],'unique':_0xa10f('0x2')},'prefix':{'type':Sequelize[_0xa10f('0x3')],'get':function(_0x3a4410){return _0xa10f('0x4')+this[_0xa10f('0x5')](_0xa10f('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xa10f('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xa10f('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 59077e8..da4d47f 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 _0x7217=['bulkCreate','Extensions\x20creation\x20failed','prefix','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','push','NoOp','No\x20callerid\x20available','goto','context','charAt','system-','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','pick','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','index','VoicePrefix','rawAttributes','keys','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','field','options','include','findAll','rows','show','params','intersection','catch','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','exten','Voice\x20Prefix\x20Extension','priority','appdata','VoicePrefixId'];(function(_0x5719df,_0x154331){var _0x3c70fc=function(_0x52586c){while(--_0x52586c){_0x5719df['push'](_0x5719df['shift']());}};_0x3c70fc(++_0x154331);}(_0x7217,0x19e));var _0x7721=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x7217[_0x4ea69d];return _0x5318e0;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7721('0x14'));var logger=require(_0x7721('0x15'))(_0x7721('0x16'));var utils=require(_0x7721('0x17'));var config=require(_0x7721('0x18'));var db=require(_0x7721('0x19'))['db'];config[_0x7721('0x1a')]=_[_0x7721('0x1b')](config['redis'],{'host':_0x7721('0x1c'),'port':0x18eb});var socket=require(_0x7721('0x1d'))(new Redis(config['redis']));require(_0x7721('0x1e'))[_0x7721('0x1f')](socket);function respondWithStatusCode(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xcc;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x20')](_0x2e9752);}return _0x3f01c5[_0x7721('0x21')](_0x2e9752)['end']();};}function respondWithResult(_0x4e199a,_0x4b183e){_0x4b183e=_0x4b183e||0xc8;return function(_0x5ed54){if(_0x5ed54){return _0x4e199a[_0x7721('0x21')](_0x4b183e)[_0x7721('0x22')](_0x5ed54);}};}function respondWithFilteredResult(_0x32550d,_0x5ed94b){return function(_0x20f669){if(_0x20f669){var _0x54a838=_0x20f669[_0x7721('0x23')],_0x3fc09e=_0x5ed94b[_0x7721('0x24')],_0x5cb0e6=_0x5ed94b[_0x7721('0x24')]+_0x5ed94b[_0x7721('0x25')],_0xfec626;if(_0x5cb0e6>=_0x54a838){_0x5cb0e6=_0x54a838;_0xfec626=0xc8;}else{_0xfec626=0xce;}_0x32550d[_0x7721('0x21')](_0xfec626);return _0x32550d[_0x7721('0x26')](_0x7721('0x27'),_0x3fc09e+'-'+_0x5cb0e6+'/'+_0x54a838)[_0x7721('0x22')](_0x20f669);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x28')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x29')](_0x2c1583);}return _0x4ce1db[_0x7721('0x2a')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x2b')](_0x57140c)[_0x7721('0x2c')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2d')]()['then'](function(){var _0x216f20=_0x395b15[_0x7721('0x2e')]({'plain':!![]});var _0x125564=_0x7721('0x2f');return db[_0x7721('0x30')][_0x7721('0x2d')]({'where':{'type':_0x125564,'resourceId':_0x216f20['id']}})[_0x7721('0x2c')](function(){return _0x395b15;});})[_0x7721('0x2c')](function(){_0x1caad8[_0x7721('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x258ddf,_0x5b0551){return function(_0x499b87){if(!_0x499b87){_0x258ddf[_0x7721('0x20')](0x194);}return _0x499b87;};}function handleError(_0x343c19,_0x53c904){_0x53c904=_0x53c904||0x1f4;return function(_0x158d98){logger[_0x7721('0x31')](_0x158d98[_0x7721('0x32')]);if(_0x158d98[_0x7721('0x33')]){delete _0x158d98[_0x7721('0x33')];}_0x343c19['status'](_0x53c904)[_0x7721('0x34')](_0x158d98);};}exports[_0x7721('0x35')]=function(_0x497f9f,_0x4a25c9){var _0xfde9ec={},_0x220bbf={},_0x48f329={'count':0x0,'rows':[]};var _0x46f772=db[_0x7721('0x36')][_0x7721('0x37')];_0x220bbf['model']=_[_0x7721('0x38')](_0x46f772);_0x220bbf[_0x7721('0x39')]=_[_0x7721('0x38')](_0x497f9f[_0x7721('0x39')]);_0x220bbf[_0x7721('0x3a')]=_['intersection'](_0x220bbf[_0x7721('0x3b')],_0x220bbf[_0x7721('0x39')]);_0xfde9ec[_0x7721('0x3c')]=_['intersection'](_0x220bbf[_0x7721('0x3b')],qs[_0x7721('0x3d')](_0x497f9f['query'][_0x7721('0x3d')]));_0xfde9ec['attributes']=_0xfde9ec[_0x7721('0x3c')][_0x7721('0x3e')]?_0xfde9ec[_0x7721('0x3c')]:_0x220bbf[_0x7721('0x3b')];if(!_0x497f9f[_0x7721('0x39')][_0x7721('0x3f')](_0x7721('0x40'))){_0xfde9ec[_0x7721('0x25')]=qs[_0x7721('0x25')](_0x497f9f[_0x7721('0x39')][_0x7721('0x25')]);_0xfde9ec['offset']=qs[_0x7721('0x24')](_0x497f9f['query'][_0x7721('0x24')]);}_0xfde9ec[_0x7721('0x41')]=qs[_0x7721('0x42')](_0x497f9f[_0x7721('0x39')][_0x7721('0x42')]);_0xfde9ec[_0x7721('0x43')]=qs['filters'](_['pick'](_0x497f9f['query'],_0x220bbf['filters']));if(_0x497f9f[_0x7721('0x39')][_0x7721('0x44')]){_0xfde9ec[_0x7721('0x43')]=_[_0x7721('0x45')](_0xfde9ec['where'],{'$or':_[_0x7721('0x46')](_0x46f772,function(_0x4cf659){if(_0x4cf659[_0x7721('0x47')][_0x7721('0x48')]!=='VIRTUAL'){var _0x2041a2={};_0x2041a2[_0x4cf659[_0x7721('0x49')]]={'$like':'%'+_0x497f9f['query']['filter']+'%'};return _0x2041a2;}})});}_0xfde9ec=_[_0x7721('0x45')]({},_0xfde9ec,_0x497f9f[_0x7721('0x4a')]);var _0xf3b5ca={'where':_0xfde9ec[_0x7721('0x43')]};return db['VoicePrefix'][_0x7721('0x23')](_0xf3b5ca)[_0x7721('0x2c')](function(_0x40ce8c){_0x48f329[_0x7721('0x23')]=_0x40ce8c;if(_0x497f9f[_0x7721('0x39')]['includeAll']){_0xfde9ec[_0x7721('0x4b')]=[{'all':!![]}];}return db['VoicePrefix'][_0x7721('0x4c')](_0xfde9ec);})['then'](function(_0x2333b8){_0x48f329[_0x7721('0x4d')]=_0x2333b8;return _0x48f329;})[_0x7721('0x2c')](respondWithFilteredResult(_0x4a25c9,_0xfde9ec))['catch'](handleError(_0x4a25c9,null));};exports[_0x7721('0x4e')]=function(_0x11d853,_0x1ad315){var _0x481fa8={'raw':![],'where':{'id':_0x11d853[_0x7721('0x4f')]['id']}},_0x9f7b1d={};_0x9f7b1d[_0x7721('0x3b')]=_[_0x7721('0x38')](db[_0x7721('0x36')][_0x7721('0x37')]);_0x9f7b1d[_0x7721('0x39')]=_['keys'](_0x11d853['query']);_0x9f7b1d[_0x7721('0x3a')]=_[_0x7721('0x50')](_0x9f7b1d[_0x7721('0x3b')],_0x9f7b1d[_0x7721('0x39')]);_0x481fa8[_0x7721('0x3c')]=_[_0x7721('0x50')](_0x9f7b1d[_0x7721('0x3b')],qs[_0x7721('0x3d')](_0x11d853[_0x7721('0x39')][_0x7721('0x3d')]));_0x481fa8['attributes']=_0x481fa8['attributes'][_0x7721('0x3e')]?_0x481fa8[_0x7721('0x3c')]:_0x9f7b1d[_0x7721('0x3b')];if(_0x11d853[_0x7721('0x39')]['includeAll']){_0x481fa8[_0x7721('0x4b')]=[{'all':!![]}];}_0x481fa8=_[_0x7721('0x45')]({},_0x481fa8,_0x11d853['options']);return db[_0x7721('0x36')]['find'](_0x481fa8)[_0x7721('0x2c')](handleEntityNotFound(_0x1ad315,null))['then'](respondWithResult(_0x1ad315,null))[_0x7721('0x51')](handleError(_0x1ad315,null));};exports[_0x7721('0x2d')]=function(_0xf17c40,_0x4eda58){return db[_0x7721('0x36')][_0x7721('0x52')]({'where':{'id':_0xf17c40['params']['id']}})[_0x7721('0x2c')](handleEntityNotFound(_0x4eda58,null))[_0x7721('0x2c')](removeEntity(_0x4eda58,null))[_0x7721('0x51')](handleError(_0x4eda58,null));};exports['describe']=function(_0x20ba21,_0x5a32b6){return db[_0x7721('0x36')][_0x7721('0x53')]()[_0x7721('0x2c')](respondWithResult(_0x5a32b6,null))[_0x7721('0x51')](handleError(_0x5a32b6,null));};exports[_0x7721('0x54')]=function(_0x7de310,_0x163a23){var _0x7fbb73;return db[_0x7721('0x55')][_0x7721('0x56')](function(_0x31770e){return db[_0x7721('0x36')][_0x7721('0x54')](_0x7de310[_0x7721('0x57')],{'transaction':_0x31770e})[_0x7721('0x2c')](function(_0x5b741d){_0x7fbb73=_0x5b741d[_0x7721('0x2e')]({'plain':!![]});return db[_0x7721('0x58')][_0x7721('0x52')]({'where':{'id':_0x7fbb73[_0x7721('0x59')]},'raw':!![]})[_0x7721('0x2c')](function(_0x315127){return createVoicePrefixExtensions(_0x7fbb73,_0x315127,_0x31770e);});});})[_0x7721('0x2c')](function(){var _0x57484c=_0x7de310[_0x7721('0x5a')][_0x7721('0x2e')]({'plain':!![]});if(!_0x57484c)throw new Error(_0x7721('0x5b'));if(_0x57484c[_0x7721('0x5c')]===_0x7721('0x5a')){var _0x9c0d4=_0x7fbb73;return db[_0x7721('0x5d')][_0x7721('0x52')]({'where':{'name':_0x7721('0x2f'),'userProfileId':_0x57484c[_0x7721('0x5e')]},'raw':!![]})[_0x7721('0x2c')](function(_0x52e870){if(_0x52e870&&_0x52e870[_0x7721('0x5f')]===0x0){return db[_0x7721('0x30')][_0x7721('0x54')]({'name':_0x9c0d4[_0x7721('0x33')],'resourceId':_0x9c0d4['id'],'type':_0x52e870[_0x7721('0x33')],'sectionId':_0x52e870['id']},{})[_0x7721('0x2c')](function(){return _0x7fbb73;});}else{return _0x7fbb73;}})[_0x7721('0x51')](function(_0x36fe6f){logger[_0x7721('0x31')](_0x7721('0x60'),_0x36fe6f);throw _0x36fe6f;});}return _0x7fbb73;})[_0x7721('0x2c')](respondWithResult(_0x163a23,null))[_0x7721('0x51')](handleError(_0x163a23,null));};function Extension(_0x106664,_0x18f7f6,_0x300ea4,_0x577f47){this['context']='from-sip';this[_0x7721('0x61')]=_0x106664;this['app']=_0x300ea4;this['type']='system';this['description']=_0x7721('0x62');this[_0x7721('0x63')]=_0x18f7f6;this[_0x7721('0x64')]=_0x577f47;}function createVoicePrefixExtensions(_0x5343a1,_0x5181d7,_0x5925b7){return new BPromise(function(_0x51a3a2,_0x484b8e){var _0x24d1dc=new Extension(formatPrefixName(_0x5343a1['prefix']),0x1,'NoOp','Voice\x20Prefix');_0x24d1dc[_0x7721('0x65')]=_0x5343a1['id'];return db[_0x7721('0x58')][_0x7721('0x54')](_0x24d1dc,{'transaction':_0x5925b7})['then'](function(_0x2a025c){var _0x1f1890=_0x2a025c[_0x7721('0x2e')]({'plain':!![]});var _0x168343=_[_0x7721('0x46')](addVoicePrefixExtensions(_0x5343a1,_0x5181d7),function(_0x16e80b){_0x16e80b[_0x7721('0x59')]=_0x1f1890['id'];_0x16e80b[_0x7721('0x65')]=_0x5343a1['id'];return _0x16e80b;});return db[_0x7721('0x58')][_0x7721('0x66')](_0x168343,{'transaction':_0x5925b7})[_0x7721('0x2c')](function(_0x10666e){if(!_0x10666e){return _0x484b8e(_0x7721('0x67'));}else{return _0x51a3a2(_0x10666e);}})[_0x7721('0x51')](function(_0x44de7a){return _0x484b8e(_0x44de7a);});});;});};function addVoicePrefixExtensions(_0x4cbd28,_0x233e5d){var _0x2c93b0=[];var _0x1b1433=formatPrefixName(_0x4cbd28[_0x7721('0x68')]);_0x2c93b0['push'](new Extension(_0x1b1433,0x2,_0x7721('0x69'),_0x7721('0x6a')+_0x4cbd28['name']));if(_0x4cbd28[_0x7721('0x6b')]){_0x2c93b0['push'](new Extension(_0x1b1433,0x3,_0x7721('0x69'),_0x7721('0x6c')+_0x4cbd28[_0x7721('0x6b')]));}else{_0x2c93b0[_0x7721('0x6d')](new Extension(_0x1b1433,0x3,_0x7721('0x6e'),_0x7721('0x6f')));}_0x2c93b0[_0x7721('0x6d')](new Extension(_0x1b1433,0x4,_0x7721('0x70'),_0x233e5d[_0x7721('0x71')]+','+'${EXTEN:'+(0x8+_0x4cbd28[_0x7721('0x33')][_0x7721('0x3e')])+'}'+','+0x1));return _0x2c93b0;}function formatPrefixName(_0x112033){var _0x3a11e2='_';for(var _0x56a988=0x0;_0x56a988<_0x112033[_0x7721('0x3e')];_0x56a988++){if(_0x112033[_0x7721('0x72')](_0x56a988)=='-'){_0x3a11e2+=_0x112033['charAt'](_0x56a988);}else{_0x3a11e2+='['+_0x112033[_0x7721('0x72')](_0x56a988)+']';}}_0x3a11e2+='.';return _0x3a11e2;}exports[_0x7721('0x2b')]=function(_0x53c918,_0x192f2e,_0x565c49){var _0x14b543=_0x53c918[_0x7721('0x57')];_0x14b543[_0x7721('0x68')]=_0x7721('0x73')+_0x14b543[_0x7721('0x33')]+'-';return db[_0x7721('0x55')][_0x7721('0x56')](function(_0x5dca04){return db[_0x7721('0x36')][_0x7721('0x2b')](_0x14b543,{'where':{'id':_0x14b543['id']},'transaction':_0x5dca04})[_0x7721('0x2c')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x14b543['id']},'transaction':_0x5dca04})['then'](function(){return db['VoiceExtension']['find']({'where':{'id':_0x14b543[_0x7721('0x59')]},'raw':!![]})[_0x7721('0x2c')](function(_0x580473){return createVoicePrefixExtensions(_0x14b543,_0x580473,_0x5dca04);});});});})[_0x7721('0x2c')](function(){return db[_0x7721('0x36')][_0x7721('0x74')](_0x14b543['id']);})[_0x7721('0x2c')](respondWithResult(_0x192f2e,null))['catch'](handleError(_0x192f2e,null));};exports[_0x7721('0x75')]=function(_0xfe9fb8,_0x322afc,_0x1bea13){return db[_0x7721('0x36')]['find']({'where':{'id':_0xfe9fb8[_0x7721('0x4f')]['id']}})[_0x7721('0x2c')](handleEntityNotFound(_0x322afc,null))[_0x7721('0x2c')](function(_0x5f515e){if(_0x5f515e){return _0x5f515e['addAgents'](_0xfe9fb8[_0x7721('0x57')][_0x7721('0x76')],_[_0x7721('0x77')](_0xfe9fb8[_0x7721('0x57')],[_0x7721('0x76'),'id'])||{})['spread'](function(_0x4ba35e){for(var _0x263070=0x0;_0x263070<_0xfe9fb8[_0x7721('0x57')][_0x7721('0x76')][_0x7721('0x3e')];_0x263070+=0x1){socket[_0x7721('0x78')](_0x7721('0x79'),{'UserId':_0xfe9fb8[_0x7721('0x57')]['ids'][_0x263070],'VoicePrefixId':_0xfe9fb8[_0x7721('0x4f')]['id']});}return _0x4ba35e;});}})[_0x7721('0x2c')](respondWithResult(_0x322afc,null))[_0x7721('0x51')](handleError(_0x322afc,null));};exports['removeAgents']=function(_0xdc60ee,_0x1a53d6,_0xdcd3e0){return db[_0x7721('0x36')]['find']({'where':{'id':_0xdc60ee['params']['id']}})[_0x7721('0x2c')](handleEntityNotFound(_0x1a53d6,null))[_0x7721('0x2c')](function(_0x177fe3){if(_0x177fe3){return _0x177fe3[_0x7721('0x7a')](_0xdc60ee[_0x7721('0x39')][_0x7721('0x76')])['then'](function(){if(_[_0x7721('0x7b')](_0xdc60ee[_0x7721('0x39')][_0x7721('0x76')])){for(var _0x5ca497=0x0;_0x5ca497<_0xdc60ee[_0x7721('0x39')][_0x7721('0x76')][_0x7721('0x3e')];_0x5ca497+=0x1){socket[_0x7721('0x78')](_0x7721('0x7c'),{'UserId':Number(_0xdc60ee['query'][_0x7721('0x76')][_0x5ca497]),'VoicePrefixId':Number(_0xdc60ee['params']['id'])});}}else{socket[_0x7721('0x78')](_0x7721('0x7c'),{'UserId':Number(_0xdc60ee[_0x7721('0x39')][_0x7721('0x76')]),'VoicePrefixId':Number(_0xdc60ee[_0x7721('0x4f')]['id'])});}});}})[_0x7721('0x2c')](respondWithStatusCode(_0x1a53d6,null))[_0x7721('0x51')](handleError(_0x1a53d6,null));};exports[_0x7721('0x7d')]=function(_0x2ec5f8,_0x3b78f5,_0x2c74d8){var _0x55d209={};var _0x19fad6={};var _0x19f451;var _0x39194e;return db['VoicePrefix'][_0x7721('0x7e')]({'where':{'id':_0x2ec5f8[_0x7721('0x4f')]['id']}})[_0x7721('0x2c')](handleEntityNotFound(_0x3b78f5,null))[_0x7721('0x2c')](function(_0xcd9f0d){if(_0xcd9f0d){_0x19f451=_0xcd9f0d;_0x19fad6['model']=_[_0x7721('0x38')](db[_0x7721('0x7f')][_0x7721('0x37')]);_0x19fad6[_0x7721('0x39')]=_[_0x7721('0x38')](_0x2ec5f8[_0x7721('0x39')]);_0x19fad6['filters']=_[_0x7721('0x50')](_0x19fad6[_0x7721('0x3b')],_0x19fad6['query']);_0x55d209[_0x7721('0x3c')]=_['intersection'](_0x19fad6[_0x7721('0x3b')],qs[_0x7721('0x3d')](_0x2ec5f8['query'][_0x7721('0x3d')]));_0x55d209['attributes']=_0x55d209['attributes']['length']?_0x55d209[_0x7721('0x3c')]:_0x19fad6[_0x7721('0x3b')];_0x55d209[_0x7721('0x41')]=qs['sort'](_0x2ec5f8['query']['sort']);_0x55d209[_0x7721('0x43')]=qs[_0x7721('0x3a')](_[_0x7721('0x80')](_0x2ec5f8[_0x7721('0x39')],_0x19fad6[_0x7721('0x3a')]));if(_0x2ec5f8[_0x7721('0x39')]['filter']){_0x55d209[_0x7721('0x43')]=_[_0x7721('0x45')](_0x55d209[_0x7721('0x43')],{'$or':_[_0x7721('0x46')](_0x55d209[_0x7721('0x3c')],function(_0x1a0232){var _0x342da2={};_0x342da2[_0x1a0232]={'$like':'%'+_0x2ec5f8[_0x7721('0x39')][_0x7721('0x44')]+'%'};return _0x342da2;})});}_0x55d209=_[_0x7721('0x45')]({},_0x55d209,_0x2ec5f8[_0x7721('0x4a')]);return _0x19f451[_0x7721('0x7d')](_0x55d209);}})['then'](function(_0x4bfa29){if(_0x4bfa29){_0x39194e=_0x4bfa29[_0x7721('0x3e')];if(!_0x2ec5f8[_0x7721('0x39')]['hasOwnProperty'](_0x7721('0x40'))){_0x55d209['limit']=qs['limit'](_0x2ec5f8[_0x7721('0x39')]['limit']);_0x55d209['offset']=qs[_0x7721('0x24')](_0x2ec5f8[_0x7721('0x39')][_0x7721('0x24')]);}return _0x19f451[_0x7721('0x7d')](_0x55d209);}})[_0x7721('0x2c')](function(_0x494c5e){if(_0x494c5e){return _0x494c5e?{'count':_0x39194e,'rows':_0x494c5e}:null;}})[_0x7721('0x2c')](respondWithResult(_0x3b78f5,null))[_0x7721('0x51')](handleError(_0x3b78f5,null));}; \ No newline at end of file +var _0x55ca=['intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','catch','params','rawAttributes','describe','create','sequelize','transaction','body','VoiceExtension','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','callerIdAll','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','system-','findById','addAgents','omit','ids','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','html-pdf','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','end','json','count','offset','limit','reject','update','then','get','VoicePrefixes','UserProfileResource','destroy','stack','name','send','index','VoicePrefix','model','keys','query','filters'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x55ca,0x126));var _0xa55c=function(_0x142d3e,_0x353e86){_0x142d3e=_0x142d3e-0x0;var _0x493084=_0x55ca[_0x142d3e];return _0x493084;};'use strict';var pdf=require(_0xa55c('0x0'));var emlformat=require(_0xa55c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa55c('0x2'));var moment=require(_0xa55c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa55c('0x4'));var util=require(_0xa55c('0x5'));var path=require(_0xa55c('0x6'));var sox=require(_0xa55c('0x7'));var csv=require(_0xa55c('0x8'));var ejs=require(_0xa55c('0x9'));var fs=require('fs');var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x8'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var hardwareService=require(_0xa55c('0x10'));var logger=require(_0xa55c('0x11'))(_0xa55c('0x12'));var utils=require(_0xa55c('0x13'));var config=require(_0xa55c('0x14'));var db=require(_0xa55c('0x15'))['db'];config[_0xa55c('0x16')]=_[_0xa55c('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa55c('0x18'))(new Redis(config['redis']));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xcc;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x19')](_0x3930e4);}return _0x18ee85[_0xa55c('0x1a')](_0x3930e4)[_0xa55c('0x1b')]();};}function respondWithResult(_0x4e0b2f,_0x3ccf65){_0x3ccf65=_0x3ccf65||0xc8;return function(_0x3dcf4f){if(_0x3dcf4f){return _0x4e0b2f[_0xa55c('0x1a')](_0x3ccf65)[_0xa55c('0x1c')](_0x3dcf4f);}};}function respondWithFilteredResult(_0x1c4cfd,_0x3ae86b){return function(_0x51590e){if(_0x51590e){var _0x2d09d8=_0x51590e[_0xa55c('0x1d')],_0x24783b=_0x3ae86b[_0xa55c('0x1e')],_0x4cee3c=_0x3ae86b[_0xa55c('0x1e')]+_0x3ae86b[_0xa55c('0x1f')],_0x3d4c9e;if(_0x4cee3c>=_0x2d09d8){_0x4cee3c=_0x2d09d8;_0x3d4c9e=0xc8;}else{_0x3d4c9e=0xce;}_0x1c4cfd[_0xa55c('0x1a')](_0x3d4c9e);return _0x1c4cfd['set']('Content-Range',_0x24783b+'-'+_0x4cee3c+'/'+_0x2d09d8)[_0xa55c('0x1c')](_0x51590e);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x20')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x21')](_0x187a87)[_0xa55c('0x22')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x22')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x23')]({'plain':!![]});var _0x190757=_0xa55c('0x24');return db[_0xa55c('0x25')][_0xa55c('0x26')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x22')](function(){return _0x5ba836;});})[_0xa55c('0x22')](function(){_0x1fc828[_0xa55c('0x1a')](0xcc)[_0xa55c('0x1b')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x19')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x1a')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=db[_0xa55c('0x2b')]['rawAttributes'];_0x35c9c2[_0xa55c('0x2c')]=_[_0xa55c('0x2d')](_0x1cc53e);_0x35c9c2[_0xa55c('0x2e')]=_[_0xa55c('0x2d')](_0x52d37f[_0xa55c('0x2e')]);_0x35c9c2[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x35c9c2[_0xa55c('0x2c')],_0x35c9c2[_0xa55c('0x2e')]);_0x490b7d[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x35c9c2['model'],qs['fields'](_0x52d37f[_0xa55c('0x2e')][_0xa55c('0x32')]));_0x490b7d['attributes']=_0x490b7d[_0xa55c('0x31')][_0xa55c('0x33')]?_0x490b7d[_0xa55c('0x31')]:_0x35c9c2[_0xa55c('0x2c')];if(!_0x52d37f[_0xa55c('0x2e')][_0xa55c('0x34')](_0xa55c('0x35'))){_0x490b7d[_0xa55c('0x1f')]=qs[_0xa55c('0x1f')](_0x52d37f['query']['limit']);_0x490b7d['offset']=qs[_0xa55c('0x1e')](_0x52d37f[_0xa55c('0x2e')][_0xa55c('0x1e')]);}_0x490b7d['order']=qs[_0xa55c('0x36')](_0x52d37f['query'][_0xa55c('0x36')]);_0x490b7d['where']=qs[_0xa55c('0x2f')](_[_0xa55c('0x37')](_0x52d37f[_0xa55c('0x2e')],_0x35c9c2['filters']));if(_0x52d37f[_0xa55c('0x2e')][_0xa55c('0x38')]){_0x490b7d['where']=_[_0xa55c('0x39')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x529ff8){if(_0x529ff8[_0xa55c('0x3b')]['key']!==_0xa55c('0x3c')){var _0x284bcf={};_0x284bcf[_0x529ff8['field']]={'$like':'%'+_0x52d37f['query']['filter']+'%'};return _0x284bcf;}})});}_0x490b7d=_['merge']({},_0x490b7d,_0x52d37f[_0xa55c('0x3d')]);var _0x45bd15={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x2b')][_0xa55c('0x1d')](_0x45bd15)['then'](function(_0x3d52d8){_0x1d730b[_0xa55c('0x1d')]=_0x3d52d8;if(_0x52d37f[_0xa55c('0x2e')][_0xa55c('0x3e')]){_0x490b7d[_0xa55c('0x3f')]=[{'all':!![]}];}return db[_0xa55c('0x2b')]['findAll'](_0x490b7d);})[_0xa55c('0x22')](function(_0x5ee63d){_0x1d730b['rows']=_0x5ee63d;return _0x1d730b;})[_0xa55c('0x22')](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports['show']=function(_0x2bd98b,_0x508bd3){var _0x5f25f7={'raw':![],'where':{'id':_0x2bd98b[_0xa55c('0x41')]['id']}},_0x2f8449={};_0x2f8449[_0xa55c('0x2c')]=_['keys'](db[_0xa55c('0x2b')][_0xa55c('0x42')]);_0x2f8449['query']=_[_0xa55c('0x2d')](_0x2bd98b['query']);_0x2f8449[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x2f8449['model'],_0x2f8449[_0xa55c('0x2e')]);_0x5f25f7[_0xa55c('0x31')]=_['intersection'](_0x2f8449[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x2bd98b[_0xa55c('0x2e')]['fields']));_0x5f25f7[_0xa55c('0x31')]=_0x5f25f7['attributes'][_0xa55c('0x33')]?_0x5f25f7[_0xa55c('0x31')]:_0x2f8449[_0xa55c('0x2c')];if(_0x2bd98b['query'][_0xa55c('0x3e')]){_0x5f25f7[_0xa55c('0x3f')]=[{'all':!![]}];}_0x5f25f7=_['merge']({},_0x5f25f7,_0x2bd98b[_0xa55c('0x3d')]);return db[_0xa55c('0x2b')]['find'](_0x5f25f7)[_0xa55c('0x22')](handleEntityNotFound(_0x508bd3,null))[_0xa55c('0x22')](respondWithResult(_0x508bd3,null))['catch'](handleError(_0x508bd3,null));};exports[_0xa55c('0x26')]=function(_0x81cee8,_0x219a68){return db[_0xa55c('0x2b')]['find']({'where':{'id':_0x81cee8[_0xa55c('0x41')]['id']}})['then'](handleEntityNotFound(_0x219a68,null))[_0xa55c('0x22')](removeEntity(_0x219a68,null))[_0xa55c('0x40')](handleError(_0x219a68,null));};exports[_0xa55c('0x43')]=function(_0x4a7adc,_0x39bd3d){return db[_0xa55c('0x2b')]['describe']()[_0xa55c('0x22')](respondWithResult(_0x39bd3d,null))[_0xa55c('0x40')](handleError(_0x39bd3d,null));};exports[_0xa55c('0x44')]=function(_0xcd78c5,_0x36b7e9){var _0x1c84d9;return db[_0xa55c('0x45')][_0xa55c('0x46')](function(_0x3c147b){return db[_0xa55c('0x2b')]['create'](_0xcd78c5[_0xa55c('0x47')],{'transaction':_0x3c147b})[_0xa55c('0x22')](function(_0x216de8){_0x1c84d9=_0x216de8['get']({'plain':!![]});return db[_0xa55c('0x48')][_0xa55c('0x49')]({'where':{'id':_0x1c84d9['VoiceExtensionId']},'raw':!![]})[_0xa55c('0x22')](function(_0x4fa412){return createVoicePrefixExtensions(_0x1c84d9,_0x4fa412,_0x3c147b);});});})[_0xa55c('0x22')](function(){var _0x228df4=_0xcd78c5[_0xa55c('0x4a')][_0xa55c('0x23')]({'plain':!![]});if(!_0x228df4)throw new Error(_0xa55c('0x4b'));if(_0x228df4['role']===_0xa55c('0x4a')){var _0x4607ca=_0x1c84d9;return db['UserProfileSection'][_0xa55c('0x49')]({'where':{'name':_0xa55c('0x24'),'userProfileId':_0x228df4[_0xa55c('0x4c')]},'raw':!![]})[_0xa55c('0x22')](function(_0x50176b){if(_0x50176b&&_0x50176b['autoAssociation']===0x0){return db[_0xa55c('0x25')][_0xa55c('0x44')]({'name':_0x4607ca[_0xa55c('0x28')],'resourceId':_0x4607ca['id'],'type':_0x50176b[_0xa55c('0x28')],'sectionId':_0x50176b['id']},{})['then'](function(){return _0x1c84d9;});}else{return _0x1c84d9;}})[_0xa55c('0x40')](function(_0x5ce463){logger[_0xa55c('0x4d')](_0xa55c('0x4e'),_0x5ce463);throw _0x5ce463;});}return _0x1c84d9;})[_0xa55c('0x22')](respondWithResult(_0x36b7e9,null))[_0xa55c('0x40')](handleError(_0x36b7e9,null));};function Extension(_0xec640,_0x53b2f7,_0x1cb73b,_0x54f776){this[_0xa55c('0x4f')]=_0xa55c('0x50');this[_0xa55c('0x51')]=_0xec640;this[_0xa55c('0x52')]=_0x1cb73b;this[_0xa55c('0x3b')]=_0xa55c('0x53');this[_0xa55c('0x54')]='Voice\x20Prefix\x20Extension';this[_0xa55c('0x55')]=_0x53b2f7;this[_0xa55c('0x56')]=_0x54f776;}function createVoicePrefixExtensions(_0x2f2d21,_0x23a30e,_0x3fa00f){return new BPromise(function(_0x5ba2b0,_0xa72718){var _0x3cd40d=new Extension(formatPrefixName(_0x2f2d21[_0xa55c('0x57')]),0x1,_0xa55c('0x58'),_0xa55c('0x59'));_0x3cd40d['VoicePrefixId']=_0x2f2d21['id'];return db[_0xa55c('0x48')][_0xa55c('0x44')](_0x3cd40d,{'transaction':_0x3fa00f})[_0xa55c('0x22')](function(_0x16d9b2){var _0x3ba56d=_0x16d9b2['get']({'plain':!![]});var _0x419fc3=_['map'](addVoicePrefixExtensions(_0x2f2d21,_0x23a30e),function(_0x2e482a){_0x2e482a['VoiceExtensionId']=_0x3ba56d['id'];_0x2e482a[_0xa55c('0x5a')]=_0x2f2d21['id'];return _0x2e482a;});return db['VoiceExtension'][_0xa55c('0x5b')](_0x419fc3,{'transaction':_0x3fa00f})[_0xa55c('0x22')](function(_0x21d6b4){if(!_0x21d6b4){return _0xa72718(_0xa55c('0x5c'));}else{return _0x5ba2b0(_0x21d6b4);}})[_0xa55c('0x40')](function(_0x3a5a52){return _0xa72718(_0x3a5a52);});});;});};function addVoicePrefixExtensions(_0xafaf8c,_0x2f2226){var _0x14b515=[];var _0x1acf50=formatPrefixName(_0xafaf8c['prefix']);_0x14b515[_0xa55c('0x5d')](new Extension(_0x1acf50,0x2,_0xa55c('0x5e'),'CDR(prefix)='+_0xafaf8c[_0xa55c('0x28')]));if(_0xafaf8c[_0xa55c('0x5f')]){_0x14b515[_0xa55c('0x5d')](new Extension(_0x1acf50,0x3,_0xa55c('0x5e'),_0xa55c('0x60')+_0xafaf8c[_0xa55c('0x5f')]));}else{_0x14b515[_0xa55c('0x5d')](new Extension(_0x1acf50,0x3,_0xa55c('0x58'),'No\x20callerid\x20available'));}_0x14b515[_0xa55c('0x5d')](new Extension(_0x1acf50,0x4,_0xa55c('0x61'),_0x2f2226[_0xa55c('0x4f')]+','+_0xa55c('0x62')+(0x8+_0xafaf8c[_0xa55c('0x28')][_0xa55c('0x33')])+'}'+','+0x1));return _0x14b515;}function formatPrefixName(_0x2f1237){var _0x4249c1='_';for(var _0x25d5a1=0x0;_0x25d5a1<_0x2f1237['length'];_0x25d5a1++){if(_0x2f1237[_0xa55c('0x63')](_0x25d5a1)=='-'){_0x4249c1+=_0x2f1237[_0xa55c('0x63')](_0x25d5a1);}else{_0x4249c1+='['+_0x2f1237[_0xa55c('0x63')](_0x25d5a1)+']';}}_0x4249c1+='.';return _0x4249c1;}exports[_0xa55c('0x21')]=function(_0x3a269d,_0x10e711,_0x3ea755){var _0x3606b2=_0x3a269d[_0xa55c('0x47')];_0x3606b2[_0xa55c('0x57')]=_0xa55c('0x64')+_0x3606b2['name']+'-';return db[_0xa55c('0x45')]['transaction'](function(_0x1228a4){return db[_0xa55c('0x2b')][_0xa55c('0x21')](_0x3606b2,{'where':{'id':_0x3606b2['id']},'transaction':_0x1228a4})['then'](function(){return db['VoiceExtension'][_0xa55c('0x26')]({'where':{'VoicePrefixId':_0x3606b2['id']},'transaction':_0x1228a4})[_0xa55c('0x22')](function(){return db[_0xa55c('0x48')][_0xa55c('0x49')]({'where':{'id':_0x3606b2['VoiceExtensionId']},'raw':!![]})[_0xa55c('0x22')](function(_0xd02251){return createVoicePrefixExtensions(_0x3606b2,_0xd02251,_0x1228a4);});});});})[_0xa55c('0x22')](function(){return db[_0xa55c('0x2b')][_0xa55c('0x65')](_0x3606b2['id']);})['then'](respondWithResult(_0x10e711,null))['catch'](handleError(_0x10e711,null));};exports[_0xa55c('0x66')]=function(_0x38689e,_0x3f9d0a,_0x36ee32){return db[_0xa55c('0x2b')]['find']({'where':{'id':_0x38689e[_0xa55c('0x41')]['id']}})[_0xa55c('0x22')](handleEntityNotFound(_0x3f9d0a,null))['then'](function(_0x2ce255){if(_0x2ce255){return _0x2ce255[_0xa55c('0x66')](_0x38689e[_0xa55c('0x47')]['ids'],_[_0xa55c('0x67')](_0x38689e[_0xa55c('0x47')],[_0xa55c('0x68'),'id'])||{})[_0xa55c('0x69')](function(_0x232143){for(var _0x506f74=0x0;_0x506f74<_0x38689e[_0xa55c('0x47')][_0xa55c('0x68')]['length'];_0x506f74+=0x1){socket['emit'](_0xa55c('0x6a'),{'UserId':_0x38689e['body'][_0xa55c('0x68')][_0x506f74],'VoicePrefixId':_0x38689e[_0xa55c('0x41')]['id']});}return _0x232143;});}})[_0xa55c('0x22')](respondWithResult(_0x3f9d0a,null))[_0xa55c('0x40')](handleError(_0x3f9d0a,null));};exports[_0xa55c('0x6b')]=function(_0x3f1132,_0x22b06f,_0xff7b1c){return db[_0xa55c('0x2b')]['find']({'where':{'id':_0x3f1132[_0xa55c('0x41')]['id']}})[_0xa55c('0x22')](handleEntityNotFound(_0x22b06f,null))[_0xa55c('0x22')](function(_0x20ddd0){if(_0x20ddd0){return _0x20ddd0['removeAgents'](_0x3f1132[_0xa55c('0x2e')][_0xa55c('0x68')])[_0xa55c('0x22')](function(){if(_[_0xa55c('0x6c')](_0x3f1132['query']['ids'])){for(var _0x367470=0x0;_0x367470<_0x3f1132[_0xa55c('0x2e')][_0xa55c('0x68')][_0xa55c('0x33')];_0x367470+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x3f1132[_0xa55c('0x2e')][_0xa55c('0x68')][_0x367470]),'VoicePrefixId':Number(_0x3f1132[_0xa55c('0x41')]['id'])});}}else{socket[_0xa55c('0x6d')](_0xa55c('0x6e'),{'UserId':Number(_0x3f1132[_0xa55c('0x2e')][_0xa55c('0x68')]),'VoicePrefixId':Number(_0x3f1132['params']['id'])});}});}})[_0xa55c('0x22')](respondWithStatusCode(_0x22b06f,null))['catch'](handleError(_0x22b06f,null));};exports[_0xa55c('0x6f')]=function(_0x4845c3,_0x36ded7,_0x313cdc){var _0x441c11={};var _0xcc187f={};var _0xe3444f;var _0x402f02;return db[_0xa55c('0x2b')][_0xa55c('0x70')]({'where':{'id':_0x4845c3['params']['id']}})['then'](handleEntityNotFound(_0x36ded7,null))[_0xa55c('0x22')](function(_0x2948b1){if(_0x2948b1){_0xe3444f=_0x2948b1;_0xcc187f[_0xa55c('0x2c')]=_[_0xa55c('0x2d')](db[_0xa55c('0x71')][_0xa55c('0x42')]);_0xcc187f['query']=_[_0xa55c('0x2d')](_0x4845c3[_0xa55c('0x2e')]);_0xcc187f[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0xcc187f[_0xa55c('0x2c')],_0xcc187f[_0xa55c('0x2e')]);_0x441c11[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0xcc187f['model'],qs[_0xa55c('0x32')](_0x4845c3[_0xa55c('0x2e')][_0xa55c('0x32')]));_0x441c11[_0xa55c('0x31')]=_0x441c11[_0xa55c('0x31')]['length']?_0x441c11[_0xa55c('0x31')]:_0xcc187f[_0xa55c('0x2c')];_0x441c11['order']=qs['sort'](_0x4845c3[_0xa55c('0x2e')][_0xa55c('0x36')]);_0x441c11['where']=qs['filters'](_['pick'](_0x4845c3['query'],_0xcc187f[_0xa55c('0x2f')]));if(_0x4845c3[_0xa55c('0x2e')][_0xa55c('0x38')]){_0x441c11[_0xa55c('0x3a')]=_[_0xa55c('0x39')](_0x441c11[_0xa55c('0x3a')],{'$or':_['map'](_0x441c11[_0xa55c('0x31')],function(_0x3b6abe){var _0x2c89b1={};_0x2c89b1[_0x3b6abe]={'$like':'%'+_0x4845c3[_0xa55c('0x2e')]['filter']+'%'};return _0x2c89b1;})});}_0x441c11=_[_0xa55c('0x39')]({},_0x441c11,_0x4845c3[_0xa55c('0x3d')]);return _0xe3444f[_0xa55c('0x6f')](_0x441c11);}})['then'](function(_0x3459fd){if(_0x3459fd){_0x402f02=_0x3459fd['length'];if(!_0x4845c3['query'][_0xa55c('0x34')](_0xa55c('0x35'))){_0x441c11[_0xa55c('0x1f')]=qs[_0xa55c('0x1f')](_0x4845c3[_0xa55c('0x2e')][_0xa55c('0x1f')]);_0x441c11[_0xa55c('0x1e')]=qs['offset'](_0x4845c3['query'][_0xa55c('0x1e')]);}return _0xe3444f[_0xa55c('0x6f')](_0x441c11);}})[_0xa55c('0x22')](function(_0x1f4bc8){if(_0x1f4bc8){return _0x1f4bc8?{'count':_0x402f02,'rows':_0x1f4bc8}:null;}})[_0xa55c('0x22')](respondWithResult(_0x36ded7,null))[_0xa55c('0x40')](handleError(_0x36ded7,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 72d0b59..05a8419 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 _0xb10b=['hasOwnProperty','hook','events','VoicePrefix','setMaxListeners','save','remove','emit'];(function(_0x49c50d,_0x31f8c0){var _0x56c3cd=function(_0x1c6671){while(--_0x1c6671){_0x49c50d['push'](_0x49c50d['shift']());}};_0x56c3cd(++_0x31f8c0);}(_0xb10b,0x12a));var _0xbb10=function(_0x1d0458,_0x4ed6d4){_0x1d0458=_0x1d0458-0x0;var _0x2fad3c=_0xb10b[_0x1d0458];return _0x2fad3c;};'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 +var _0xb10b=['hasOwnProperty','hook','events','VoicePrefix','setMaxListeners','save','remove','emit'];(function(_0x23e22d,_0x430196){var _0x47eaf4=function(_0x128e42){while(--_0x128e42){_0x23e22d['push'](_0x23e22d['shift']());}};_0x47eaf4(++_0x430196);}(_0xb10b,0x12a));var _0xbb10=function(_0x547af,_0x17abff){_0x547af=_0x547af-0x0;var _0x22f7f4=_0xb10b[_0x547af];return _0x22f7f4;};'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 ac9ed68..22be90f 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 _0xedf7=['voice_prefixes','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix'];(function(_0x584d69,_0x4b83e4){var _0x35fbfe=function(_0x216d84){while(--_0x216d84){_0x584d69['push'](_0x584d69['shift']());}};_0x35fbfe(++_0x4b83e4);}(_0xedf7,0x17b));var _0x7edf=function(_0x4f4d1c,_0x3fc75b){_0x4f4d1c=_0x4f4d1c-0x0;var _0xa2b2a=_0xedf7[_0x4f4d1c];return _0xa2b2a;};'use strict';var _=require('lodash');var util=require(_0x7edf('0x0'));var logger=require(_0x7edf('0x1'))(_0x7edf('0x2'));var moment=require(_0x7edf('0x3'));var BPromise=require(_0x7edf('0x4'));var rp=require(_0x7edf('0x5'));var fs=require('fs');var path=require(_0x7edf('0x6'));var rimraf=require(_0x7edf('0x7'));var config=require(_0x7edf('0x8'));var attributes=require(_0x7edf('0x9'));module[_0x7edf('0xa')]=function(_0x3eb9bc,_0x59d414){return _0x3eb9bc[_0x7edf('0xb')](_0x7edf('0xc'),attributes,{'tableName':_0x7edf('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8862=['rimraf','../../config/environment','./voicePrefix.attributes','exports','define','voice_prefixes','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x23603b,_0x50ca05){var _0x8dbfe9=function(_0x5e7452){while(--_0x5e7452){_0x23603b['push'](_0x23603b['shift']());}};_0x8dbfe9(++_0x50ca05);}(_0x8862,0x14b));var _0x2886=function(_0xd5b991,_0x4ff0c4){_0xd5b991=_0xd5b991-0x0;var _0x38a3e6=_0x8862[_0xd5b991];return _0x38a3e6;};'use strict';var _=require(_0x2886('0x0'));var util=require(_0x2886('0x1'));var logger=require('../../config/logger')(_0x2886('0x2'));var moment=require(_0x2886('0x3'));var BPromise=require(_0x2886('0x4'));var rp=require(_0x2886('0x5'));var fs=require('fs');var path=require(_0x2886('0x6'));var rimraf=require(_0x2886('0x7'));var config=require(_0x2886('0x8'));var attributes=require(_0x2886('0x9'));module[_0x2886('0xa')]=function(_0x212a38,_0x4210e8){return _0x212a38[_0x2886('0xb')]('VoicePrefix',attributes,{'tableName':_0x2886('0xc'),'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 dbbab63..2e2071a 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 _0xa851=['../../config/environment','jayson/promise','client','http','redis','defaults','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x2f5fe5,_0x1ec001){var _0x2772cb=function(_0x5b60a4){while(--_0x5b60a4){_0x2f5fe5['push'](_0x2f5fe5['shift']());}};_0x2772cb(++_0x1ec001);}(_0xa851,0xa2));var _0x1a85=function(_0x41db07,_0x57027e){_0x41db07=_0x41db07-0x0;var _0x4949c4=_0xa851[_0x41db07];return _0x4949c4;};'use strict';var _=require(_0x1a85('0x0'));var util=require(_0x1a85('0x1'));var moment=require('moment');var BPromise=require(_0x1a85('0x2'));var rs=require(_0x1a85('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a85('0x4'))['db'];var utils=require(_0x1a85('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x1a85('0x6'));var jayson=require(_0x1a85('0x7'));var client=jayson[_0x1a85('0x8')][_0x1a85('0x9')]({'port':0x232a});config[_0x1a85('0xa')]=_[_0x1a85('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1a85('0xa')]));require(_0x1a85('0xc'))[_0x1a85('0xd')](socket);function respondWithRpcPromise(_0x4e9bc1,_0x55594e,_0x4d120c){return new BPromise(function(_0x34f1d7,_0x5740fb){return client[_0x1a85('0xe')](_0x4e9bc1,_0x4d120c)[_0x1a85('0xf')](function(_0x5bf2f8){logger[_0x1a85('0x10')](_0x1a85('0x11'),_0x55594e,_0x1a85('0x12'));logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x55594e,'request\x20sent',JSON[_0x1a85('0x13')](_0x5bf2f8));if(_0x5bf2f8[_0x1a85('0x14')]){if(_0x5bf2f8[_0x1a85('0x14')][_0x1a85('0x15')]===0x1f4){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x55594e,_0x5bf2f8[_0x1a85('0x14')][_0x1a85('0x16')]);return _0x5740fb(_0x5bf2f8[_0x1a85('0x14')][_0x1a85('0x16')]);}logger[_0x1a85('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x55594e,_0x5bf2f8[_0x1a85('0x14')][_0x1a85('0x16')]);return _0x34f1d7(_0x5bf2f8[_0x1a85('0x14')]['message']);}else{logger[_0x1a85('0x10')](_0x1a85('0x11'),_0x55594e,'request\x20sent');_0x34f1d7(_0x5bf2f8['result'][_0x1a85('0x16')]);}})[_0x1a85('0x17')](function(_0x85bd81){logger[_0x1a85('0x14')](_0x1a85('0x11'),_0x55594e,_0x85bd81);_0x5740fb(_0x85bd81);});});} \ No newline at end of file +var _0xb950=['then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket'];(function(_0x25ea36,_0x5e765a){var _0x2953ce=function(_0x19bf86){while(--_0x19bf86){_0x25ea36['push'](_0x25ea36['shift']());}};_0x2953ce(++_0x5e765a);}(_0xb950,0x1b2));var _0x0b95=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xb950[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x0b95('0x0'));var util=require(_0x0b95('0x1'));var moment=require(_0x0b95('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b95('0x3'));var db=require(_0x0b95('0x4'))['db'];var utils=require(_0x0b95('0x5'));var logger=require('../../config/logger')(_0x0b95('0x6'));var config=require(_0x0b95('0x7'));var jayson=require(_0x0b95('0x8'));var client=jayson[_0x0b95('0x9')][_0x0b95('0xa')]({'port':0x232a});config[_0x0b95('0xb')]=_[_0x0b95('0xc')](config[_0x0b95('0xb')],{'host':_0x0b95('0xd'),'port':0x18eb});var socket=require(_0x0b95('0xe'))(new Redis(config[_0x0b95('0xb')]));require(_0x0b95('0xf'))['register'](socket);function respondWithRpcPromise(_0x4dbec7,_0x7020a6,_0x17b4e9){return new BPromise(function(_0xa84f8c,_0x4a301f){return client['request'](_0x4dbec7,_0x17b4e9)[_0x0b95('0x10')](function(_0x31dba7){logger['info'](_0x0b95('0x11'),_0x7020a6,_0x0b95('0x12'));logger[_0x0b95('0x13')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x7020a6,_0x0b95('0x12'),JSON['stringify'](_0x31dba7));if(_0x31dba7[_0x0b95('0x14')]){if(_0x31dba7[_0x0b95('0x14')][_0x0b95('0x15')]===0x1f4){logger[_0x0b95('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x7020a6,_0x31dba7['error'][_0x0b95('0x16')]);return _0x4a301f(_0x31dba7['error'][_0x0b95('0x16')]);}logger[_0x0b95('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x7020a6,_0x31dba7[_0x0b95('0x14')][_0x0b95('0x16')]);return _0xa84f8c(_0x31dba7[_0x0b95('0x14')]['message']);}else{logger[_0x0b95('0x17')](_0x0b95('0x11'),_0x7020a6,_0x0b95('0x12'));_0xa84f8c(_0x31dba7[_0x0b95('0x18')][_0x0b95('0x16')]);}})['catch'](function(_0x143553){logger[_0x0b95('0x14')](_0x0b95('0x11'),_0x7020a6,_0x143553);_0x4a301f(_0x143553);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 277b01f..1d21fa0 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 _0x05e0=['emit','removeListener','./voicePrefix.events','save'];(function(_0x309458,_0xba6e63){var _0x3306ee=function(_0x47e10c){while(--_0x47e10c){_0x309458['push'](_0x309458['shift']());}};_0x3306ee(++_0xba6e63);}(_0x05e0,0x112));var _0x005e=function(_0x1fa5aa,_0x32648f){_0x1fa5aa=_0x1fa5aa-0x0;var _0x1c532f=_0x05e0[_0x1fa5aa];return _0x1c532f;};'use strict';var VoicePrefixEvents=require(_0x005e('0x0'));var events=[_0x005e('0x1'),'remove','update'];function createListener(_0x382d77,_0x215cf4){return function(_0x51bcb0){_0x215cf4[_0x005e('0x2')](_0x382d77,_0x51bcb0);};}function removeListener(_0x449906,_0x31fd9e){return function(){VoicePrefixEvents[_0x005e('0x3')](_0x449906,_0x31fd9e);};}exports['register']=function(_0x488776){for(var _0x4e623f=0x0,_0x5d623a=events['length'];_0x4e623f<_0x5d623a;_0x4e623f++){var _0x4a8d24=events[_0x4e623f];var _0x567c3d=createListener('voicePrefix:'+_0x4a8d24,_0x488776);VoicePrefixEvents['on'](_0x4a8d24,_0x567c3d);}}; \ No newline at end of file +var _0x7d67=['remove','emit','removeListener','register','length','voicePrefix:','./voicePrefix.events'];(function(_0x39a4c5,_0x504a9a){var _0x362340=function(_0x527dcb){while(--_0x527dcb){_0x39a4c5['push'](_0x39a4c5['shift']());}};_0x362340(++_0x504a9a);}(_0x7d67,0xa7));var _0x77d6=function(_0xe49ac3,_0x541a15){_0xe49ac3=_0xe49ac3-0x0;var _0x9cfbe7=_0x7d67[_0xe49ac3];return _0x9cfbe7;};'use strict';var VoicePrefixEvents=require(_0x77d6('0x0'));var events=['save',_0x77d6('0x1'),'update'];function createListener(_0x417bce,_0x5289a3){return function(_0x2bc7bb){_0x5289a3[_0x77d6('0x2')](_0x417bce,_0x2bc7bb);};}function removeListener(_0x49e204,_0x2cf6c3){return function(){VoicePrefixEvents[_0x77d6('0x3')](_0x49e204,_0x2cf6c3);};}exports[_0x77d6('0x4')]=function(_0x38a0ca){for(var _0x207000=0x0,_0x36f274=events[_0x77d6('0x5')];_0x207000<_0x36f274;_0x207000++){var _0x59fa83=events[_0x207000];var _0xcc00f0=createListener(_0x77d6('0x6')+_0x59fa83,_0x38a0ca);VoicePrefixEvents['on'](_0x59fa83,_0xcc00f0);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index de268a3..567b065 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 _0x6e69=['get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone','addTeams','addAgents','addLists','/:id/blacklists','addBlackLists','put','update','destroy','delete','removeTeams','removeLists','removeBlackLists','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x6e69,0x167));var _0x96e6=function(_0x3ff3f7,_0x479859){_0x3ff3f7=_0x3ff3f7-0x0;var _0x43d2c5=_0x6e69[_0x3ff3f7];return _0x43d2c5;};'use strict';var multer=require('multer');var util=require(_0x96e6('0x0'));var path=require(_0x96e6('0x1'));var timeout=require(_0x96e6('0x2'));var express=require(_0x96e6('0x3'));var router=express[_0x96e6('0x4')]();var auth=require(_0x96e6('0x5'));var interaction=require(_0x96e6('0x6'));var config=require(_0x96e6('0x7'));var controller=require(_0x96e6('0x8'));router[_0x96e6('0x9')]('/',auth[_0x96e6('0xa')](),controller[_0x96e6('0xb')]);router['get'](_0x96e6('0xc'),auth[_0x96e6('0xa')](),controller[_0x96e6('0xd')]);router[_0x96e6('0x9')](_0x96e6('0xe'),auth[_0x96e6('0xa')](),controller[_0x96e6('0xf')]);router[_0x96e6('0x9')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x96e6('0x10')]);router[_0x96e6('0x9')](_0x96e6('0x11'),auth[_0x96e6('0xa')](),controller[_0x96e6('0x12')]);router[_0x96e6('0x9')](_0x96e6('0x13'),auth[_0x96e6('0xa')](),controller[_0x96e6('0x14')]);router[_0x96e6('0x9')]('/:id/teams',auth['isAuthenticated'](),controller[_0x96e6('0x15')]);router[_0x96e6('0x9')](_0x96e6('0x16'),auth['isAuthenticated'](),controller[_0x96e6('0x17')]);router['get'](_0x96e6('0x18'),auth['isAuthenticated'](),controller[_0x96e6('0x19')]);router['get'](_0x96e6('0x1a'),auth[_0x96e6('0xa')](),controller[_0x96e6('0x1b')]);router[_0x96e6('0x9')]('/:id/blacklists',auth[_0x96e6('0xa')](),controller[_0x96e6('0x1c')]);router[_0x96e6('0x1d')]('/',auth[_0x96e6('0xa')](),controller[_0x96e6('0x1e')]);router['post'](_0x96e6('0x1f'),auth[_0x96e6('0xa')](),controller[_0x96e6('0x20')]);router[_0x96e6('0x1d')]('/:id/teams',auth['isAuthenticated'](),controller[_0x96e6('0x21')]);router[_0x96e6('0x1d')](_0x96e6('0x16'),auth[_0x96e6('0xa')](),controller[_0x96e6('0x22')]);router[_0x96e6('0x1d')](_0x96e6('0x1a'),auth[_0x96e6('0xa')](),controller[_0x96e6('0x23')]);router[_0x96e6('0x1d')](_0x96e6('0x24'),auth['isAuthenticated'](),controller[_0x96e6('0x25')]);router[_0x96e6('0x26')](_0x96e6('0xc'),auth[_0x96e6('0xa')](),controller[_0x96e6('0x27')]);router['delete'](_0x96e6('0xc'),auth[_0x96e6('0xa')](),controller[_0x96e6('0x28')]);router[_0x96e6('0x29')]('/:id/teams',auth['isAuthenticated'](),controller[_0x96e6('0x2a')]);router[_0x96e6('0x29')](_0x96e6('0x16'),auth['isAuthenticated'](),controller['removeAgents']);router[_0x96e6('0x29')]('/:id/lists',auth[_0x96e6('0xa')](),controller[_0x96e6('0x2b')]);router[_0x96e6('0x29')](_0x96e6('0x24'),auth[_0x96e6('0xa')](),controller[_0x96e6('0x2c')]);module[_0x96e6('0x2d')]=router; \ No newline at end of file +var _0x758a=['/:id/clone','addTeams','addAgents','addLists','put','delete','removeTeams','removeAgents','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','./voiceQueue.controller','isAuthenticated','index','get','show','/:id/hoppers','getHoppers','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','/:id/members','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create'];(function(_0x4489e0,_0x270759){var _0x2aa740=function(_0x495b95){while(--_0x495b95){_0x4489e0['push'](_0x4489e0['shift']());}};_0x2aa740(++_0x270759);}(_0x758a,0x1d1));var _0xa758=function(_0x51ae2b,_0x21cac5){_0x51ae2b=_0x51ae2b-0x0;var _0x39d335=_0x758a[_0x51ae2b];return _0x39d335;};'use strict';var multer=require(_0xa758('0x0'));var util=require(_0xa758('0x1'));var path=require(_0xa758('0x2'));var timeout=require(_0xa758('0x3'));var express=require(_0xa758('0x4'));var router=express[_0xa758('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa758('0x6'));router['get']('/',auth[_0xa758('0x7')](),controller[_0xa758('0x8')]);router[_0xa758('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xa758('0xa')]);router[_0xa758('0x9')](_0xa758('0xb'),auth[_0xa758('0x7')](),controller[_0xa758('0xc')]);router[_0xa758('0x9')]('/:id/hopper_histories',auth[_0xa758('0x7')](),controller['getHopperHistories']);router['get'](_0xa758('0xd'),auth[_0xa758('0x7')](),controller['getHopperFinals']);router[_0xa758('0x9')](_0xa758('0xe'),auth[_0xa758('0x7')](),controller[_0xa758('0xf')]);router[_0xa758('0x9')](_0xa758('0x10'),auth[_0xa758('0x7')](),controller['getTeams']);router['get'](_0xa758('0x11'),auth['isAuthenticated'](),controller['getAgents']);router[_0xa758('0x9')](_0xa758('0x12'),auth[_0xa758('0x7')](),controller['getMembers']);router['get'](_0xa758('0x13'),auth['isAuthenticated'](),controller[_0xa758('0x14')]);router['get'](_0xa758('0x15'),auth['isAuthenticated'](),controller[_0xa758('0x16')]);router[_0xa758('0x17')]('/',auth[_0xa758('0x7')](),controller[_0xa758('0x18')]);router[_0xa758('0x17')](_0xa758('0x19'),auth[_0xa758('0x7')](),controller['clone']);router[_0xa758('0x17')]('/:id/teams',auth[_0xa758('0x7')](),controller[_0xa758('0x1a')]);router[_0xa758('0x17')](_0xa758('0x11'),auth['isAuthenticated'](),controller[_0xa758('0x1b')]);router['post']('/:id/lists',auth[_0xa758('0x7')](),controller[_0xa758('0x1c')]);router[_0xa758('0x17')]('/:id/blacklists',auth[_0xa758('0x7')](),controller['addBlackLists']);router[_0xa758('0x1d')]('/:id',auth[_0xa758('0x7')](),controller['update']);router[_0xa758('0x1e')]('/:id',auth[_0xa758('0x7')](),controller['destroy']);router[_0xa758('0x1e')](_0xa758('0x10'),auth[_0xa758('0x7')](),controller[_0xa758('0x1f')]);router[_0xa758('0x1e')](_0xa758('0x11'),auth[_0xa758('0x7')](),controller[_0xa758('0x20')]);router['delete']('/:id/lists',auth['isAuthenticated'](),controller['removeLists']);router[_0xa758('0x1e')](_0xa758('0x15'),auth['isAuthenticated'](),controller[_0xa758('0x21')]);module[_0xa758('0x22')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 18c9a3e..9bd7545 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 _0xe8c9=['wrandom','rrordered','strategy','getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','TEXT','setDataValue','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','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)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','inbound','outbound','ENUM','ringall','leastrecent','fewestcalls','rrmemory','linear'];(function(_0x44e9eb,_0x57fb46){var _0x412b17=function(_0x5f4d51){while(--_0x5f4d51){_0x44e9eb['push'](_0x44e9eb['shift']());}};_0x412b17(++_0x57fb46);}(_0xe8c9,0x1d8));var _0x9e8c=function(_0x4b9f34,_0x44dd24){_0x4b9f34=_0x4b9f34-0x0;var _0x435a7e=_0xe8c9[_0x4b9f34];return _0x435a7e;};'use strict';var Sequelize=require('sequelize');module[_0x9e8c('0x0')]={'name':{'type':Sequelize[_0x9e8c('0x1')],'allowNull':![],'unique':_0x9e8c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x9e8c('0x3'),_0x9e8c('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x9e8c('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x9e8c('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x9e8c('0x5')]('rr',_0x9e8c('0x6'),_0x9e8c('0x7'),_0x9e8c('0x8'),'random',_0x9e8c('0x9'),_0x9e8c('0xa'),_0x9e8c('0xb'),_0x9e8c('0xc')),'allowNull':![],'defaultValue':'ringall','set':function(_0x4a0c2e){this['setDataValue'](_0x9e8c('0xd'),_0x4a0c2e?_0x4a0c2e:_0x9e8c('0x9'));},'get':function(){var _0x2c83ec=this[_0x9e8c('0xe')]('type');var _0x48f790=this[_0x9e8c('0xe')]('dialMethod');var _0x10b06e=this[_0x9e8c('0xe')](_0x9e8c('0xd'));if(_0x2c83ec===_0x9e8c('0x3')){return _0x10b06e;}if(_0x48f790===_0x9e8c('0xf')&&_0x10b06e===_0x9e8c('0x9')||_0x48f790===_0x9e8c('0xf')&&_0x10b06e===_0x9e8c('0x10')){return _0x10b06e;}if(_0x48f790===_0x9e8c('0x11')||_0x48f790===_0x9e8c('0x12')||_0x48f790===_0x9e8c('0x13')){return _0x10b06e;}return null;}},'servicelevel':{'type':Sequelize[_0x9e8c('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x9e8c('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x9e8c('0x14')](0xb)},'timeout':{'type':Sequelize[_0x9e8c('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x9e8c('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x9e8c('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x9e8c('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x9e8c('0x5')](_0x9e8c('0x15'),'no'),'defaultValue':_0x9e8c('0x15')},'autopause':{'type':Sequelize[_0x9e8c('0x5')](_0x9e8c('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x9e8c('0x5')](_0x9e8c('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x9e8c('0x5')](_0x9e8c('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x9e8c('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x9e8c('0x5')](_0x9e8c('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x9e8c('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x9e8c('0x5')](_0x9e8c('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x9e8c('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x9e8c('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x9e8c('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x9e8c('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x9e8c('0x5')](_0x9e8c('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x9e8c('0x5')](_0x9e8c('0x15'),'no'),'defaultValue':_0x9e8c('0x15')},'announce_holdtime':{'type':Sequelize[_0x9e8c('0x5')]('yes','no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x9e8c('0x5')](_0x9e8c('0x15'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x9e8c('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x9e8c('0x1')]},'queue_youarenext':{'type':Sequelize[_0x9e8c('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x9e8c('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x9e8c('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x9e8c('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x9e8c('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x9e8c('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x9e8c('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x9e8c('0x1')]},'queue_quantity1':{'type':Sequelize[_0x9e8c('0x1')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x9e8c('0x1')]},'queue_less_than':{'type':Sequelize[_0x9e8c('0x1')]},'periodic_announce':{'type':Sequelize[_0x9e8c('0x16')],'set':function(_0x59b8c6){this[_0x9e8c('0x17')](_0x9e8c('0x18'),_0x59b8c6?_0x59b8c6[_0x9e8c('0x19')](','):[]);},'get':function(){return this[_0x9e8c('0xe')](_0x9e8c('0x18'))?this[_0x9e8c('0xe')](_0x9e8c('0x18'))[_0x9e8c('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x9e8c('0x1')],'defaultValue':_0x9e8c('0x15'),'set':function(_0x1fab92){this[_0x9e8c('0x17')]('joinempty',_0x1fab92?_0x1fab92[_0x9e8c('0x19')](','):[]);},'get':function(){return this[_0x9e8c('0xe')]('joinempty')?this[_0x9e8c('0xe')](_0x9e8c('0x1b'))[_0x9e8c('0x1a')](','):[];}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x540fbe){this['setDataValue'](_0x9e8c('0x1c'),_0x540fbe?_0x540fbe[_0x9e8c('0x19')](','):[]);},'get':function(){return this[_0x9e8c('0xe')]('leavewhenempty')?this[_0x9e8c('0xe')](_0x9e8c('0x1c'))[_0x9e8c('0x1a')](','):[];}},'reportholdtime':{'type':Sequelize['ENUM'](_0x9e8c('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x9e8c('0x5')](_0x9e8c('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x9e8c('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x9e8c('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x9e8c('0x1')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x9e8c('0x1d')],'defaultValue':0x0,'set':function(_0x1e9aa4){this[_0x9e8c('0x17')](_0x9e8c('0x1e'),_0x1e9aa4);if(_0x1e9aa4){if(this[_0x9e8c('0xe')](_0x9e8c('0x1f'))<0x2){this[_0x9e8c('0x17')](_0x9e8c('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x9e8c('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x9e8c('0x1d')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x9e8c('0x5')](_0x9e8c('0x20'),_0x9e8c('0x11'),'power','predictive',_0x9e8c('0xf')),'defaultValue':_0x9e8c('0x11'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x9e8c('0x14')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9e8c('0x21')},'dialLimitQueue':{'type':Sequelize[_0x9e8c('0x14')](0x4)[_0x9e8c('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9e8c('0x23')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor',_0x9e8c('0x24')),'defaultValue':_0x9e8c('0x24'),'comment':_0x9e8c('0x25')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x9e8c('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x9e8c('0x26')},'dialPredictiveInterval':{'type':Sequelize[_0x9e8c('0x14')](0x3)[_0x9e8c('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x9e8c('0x27')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9e8c('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x9e8c('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9e8c('0x28')},'dialQueueOptions':{'type':Sequelize[_0x9e8c('0x1')],'defaultValue':_0x9e8c('0x29'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x9e8c('0x14')](0x3)[_0x9e8c('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9e8c('0x2a')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x9e8c('0x2b')},'dialCongestionMaxRetry':{'type':Sequelize[_0x9e8c('0x14')](0x3)[_0x9e8c('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9e8c('0x2c')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9e8c('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9e8c('0x2d')},'dialBusyMaxRetry':{'type':Sequelize[_0x9e8c('0x14')](0x3)[_0x9e8c('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9e8c('0x2e')},'dialBusyRetryFrequency':{'type':Sequelize[_0x9e8c('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9e8c('0x2f')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9e8c('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9e8c('0x30')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9e8c('0x14')](0x3)[_0x9e8c('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9e8c('0x31')},'dialTimezone':{'type':Sequelize[_0x9e8c('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x9e8c('0x1')],'defaultValue':_0x9e8c('0x32')},'dialPrefix':{'type':Sequelize[_0x9e8c('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x9e8c('0x5')]('always','never',_0x9e8c('0x33')),'defaultValue':_0x9e8c('0x34')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x9e8c('0x35')},'dialAMDInitialSilence':{'type':Sequelize[_0x9e8c('0x14')](0x9)[_0x9e8c('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x9e8c('0x36')},'dialAMDGreeting':{'type':Sequelize[_0x9e8c('0x14')](0x9)[_0x9e8c('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9e8c('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9e8c('0x14')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x9e8c('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9e8c('0x38')},'dialAMDMinWordLength':{'type':Sequelize[_0x9e8c('0x14')](0x9)[_0x9e8c('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x9e8c('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9e8c('0x39')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9e8c('0x3a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9e8c('0x14')](0x5)[_0x9e8c('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9e8c('0x14')](0x9)[_0x9e8c('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9e8c('0x3b')},'dialRecallMeTimeout':{'type':Sequelize[_0x9e8c('0x14')](0x5)[_0x9e8c('0x22')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x9e8c('0x3c')},'dialRecallInQueue':{'type':Sequelize[_0x9e8c('0x1d')],'defaultValue':0x0,'comment':_0x9e8c('0x3d')},'dialOrderByScheduledAt':{'type':Sequelize[_0x9e8c('0x5')](_0x9e8c('0x3e'),_0x9e8c('0x3f')),'defaultValue':_0x9e8c('0x3e')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x9e8c('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x9e8c('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x9e8c('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9e8c('0x40')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x9e8c('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9e8c('0x14')],'allowNull':!![],'comment':_0x9e8c('0x41')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9e8c('0x42'),'set':function(_0x439d7a){if(!_0x439d7a)this['setDataValue'](_0x9e8c('0x43'),null);this[_0x9e8c('0x17')](_0x9e8c('0x44'),_0x439d7a);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x9e8c('0x14')](0x3)[_0x9e8c('0x22')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x9e8c('0x14')](0x3)[_0x9e8c('0x22')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xdaa0=['wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','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)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','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','STRING','ENUM','inbound','outbound','default','leastrecent','fewestcalls','random','rrmemory','linear','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','acw'];(function(_0x894c63,_0x5c8fa5){var _0xaa35eb=function(_0x33dbda){while(--_0x33dbda){_0x894c63['push'](_0x894c63['shift']());}};_0xaa35eb(++_0x5c8fa5);}(_0xdaa0,0xc5));var _0x0daa=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xdaa0[_0x1b349a];return _0x5d1f7c;};'use strict';var Sequelize=require(_0x0daa('0x0'));module[_0x0daa('0x1')]={'name':{'type':Sequelize[_0x0daa('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0daa('0x3')](_0x0daa('0x4'),_0x0daa('0x5')),'allowNull':![],'defaultValue':_0x0daa('0x4')},'musiconhold':{'type':Sequelize[_0x0daa('0x2')],'defaultValue':_0x0daa('0x6')},'announce':{'type':Sequelize[_0x0daa('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall',_0x0daa('0x7'),_0x0daa('0x8'),_0x0daa('0x9'),_0x0daa('0xa'),_0x0daa('0xb'),'wrandom','rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x27442c){this[_0x0daa('0xc')](_0x0daa('0xd'),_0x27442c?_0x27442c:'rrmemory');},'get':function(){var _0x122208=this[_0x0daa('0xe')](_0x0daa('0xf'));var _0x2ea159=this[_0x0daa('0xe')](_0x0daa('0x10'));var _0x14a425=this[_0x0daa('0xe')]('strategy');if(_0x122208===_0x0daa('0x4')){return _0x14a425;}if(_0x2ea159===_0x0daa('0x11')&&_0x14a425==='rrmemory'||_0x2ea159===_0x0daa('0x11')&&_0x14a425===_0x0daa('0x12')){return _0x14a425;}if(_0x2ea159===_0x0daa('0x13')||_0x2ea159===_0x0daa('0x14')||_0x2ea159===_0x0daa('0x15')){return _0x14a425;}return null;}},'servicelevel':{'type':Sequelize[_0x0daa('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x0daa('0x16')](0xb)},'timeout':{'type':Sequelize[_0x0daa('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x0daa('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x0daa('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0daa('0x3')](_0x0daa('0x17'),'no'),'defaultValue':_0x0daa('0x17')},'autopause':{'type':Sequelize['ENUM']('yes','no',_0x0daa('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0daa('0x16')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x0daa('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0daa('0x3')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x0daa('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x0daa('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x0daa('0x3')](_0x0daa('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0daa('0x3')](_0x0daa('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0daa('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x0daa('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x0daa('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0daa('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0daa('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0daa('0x3')](_0x0daa('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0daa('0x17'),'no'),'defaultValue':_0x0daa('0x17')},'announce_holdtime':{'type':Sequelize[_0x0daa('0x3')]('yes','no',_0x0daa('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0daa('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x0daa('0x17'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0daa('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0daa('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0daa('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x0daa('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0daa('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x0daa('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0daa('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x0daa('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0daa('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x0daa('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0daa('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x0daa('0x1a')],'set':function(_0x579c35){this['setDataValue'](_0x0daa('0x1b'),_0x579c35?_0x579c35['join'](','):[]);},'get':function(){return this['getDataValue'](_0x0daa('0x1b'))?this['getDataValue'](_0x0daa('0x1b'))[_0x0daa('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x0daa('0x2')],'defaultValue':_0x0daa('0x17'),'set':function(_0x2b6777){this[_0x0daa('0xc')](_0x0daa('0x1d'),_0x2b6777?_0x2b6777[_0x0daa('0x1e')](','):[]);},'get':function(){return this['getDataValue'](_0x0daa('0x1d'))?this[_0x0daa('0xe')](_0x0daa('0x1d'))[_0x0daa('0x1c')](','):[];}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x42c405){this[_0x0daa('0xc')](_0x0daa('0x1f'),_0x42c405?_0x42c405[_0x0daa('0x1e')](','):[]);},'get':function(){return this[_0x0daa('0xe')](_0x0daa('0x1f'))?this[_0x0daa('0xe')](_0x0daa('0x1f'))[_0x0daa('0x1c')](','):[];}},'reportholdtime':{'type':Sequelize['ENUM'](_0x0daa('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x0daa('0x3')](_0x0daa('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x0daa('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x0daa('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0daa('0x2')]},'description':{'type':Sequelize[_0x0daa('0x2')]},'acw':{'type':Sequelize[_0x0daa('0x20')],'defaultValue':0x0,'set':function(_0x44bae0){this['setDataValue'](_0x0daa('0x21'),_0x44bae0);if(_0x44bae0){if(this[_0x0daa('0xe')](_0x0daa('0x22'))<0x2){this['setDataValue'](_0x0daa('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x0daa('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x0daa('0x23')},'dialMethod':{'type':Sequelize[_0x0daa('0x3')](_0x0daa('0x24'),_0x0daa('0x13'),_0x0daa('0x15'),_0x0daa('0x14'),'booked'),'defaultValue':'progressive','comment':_0x0daa('0x25')},'dialLimitChannel':{'type':Sequelize[_0x0daa('0x16')](0x4)[_0x0daa('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0daa('0x27')},'dialLimitQueue':{'type':Sequelize[_0x0daa('0x16')](0x4)[_0x0daa('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0daa('0x28')},'dialPowerLevel':{'type':Sequelize[_0x0daa('0x29')](0x2)[_0x0daa('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0daa('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x0daa('0x3')]('agentBusyFactor',_0x0daa('0x2b')),'defaultValue':_0x0daa('0x2b'),'comment':_0x0daa('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0daa('0x29')](0x2)[_0x0daa('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x0daa('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x0daa('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0daa('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0daa('0x16')](0x3)[_0x0daa('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0daa('0x2e')},'dialQueueOptions':{'type':Sequelize[_0x0daa('0x2')],'defaultValue':_0x0daa('0x2f'),'comment':_0x0daa('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x0daa('0x16')](0x3)[_0x0daa('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0daa('0x31')},'dialQueueProject':{'type':Sequelize[_0x0daa('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x0daa('0x16')](0x3)[_0x0daa('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0daa('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0daa('0x16')](0x5)[_0x0daa('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0daa('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x0daa('0x16')](0x3)[_0x0daa('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0daa('0x34')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0daa('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0daa('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0daa('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x0daa('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0daa('0x16')](0x5)[_0x0daa('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x0daa('0x16')](0x3)[_0x0daa('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0daa('0x37')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x0daa('0x38')},'dialPrefix':{'type':Sequelize[_0x0daa('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x0daa('0x3')](_0x0daa('0x39'),_0x0daa('0x3a'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x0daa('0x20')],'defaultValue':0x0,'comment':_0x0daa('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0x0daa('0x16')](0x9)[_0x0daa('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0daa('0x3c')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x0daa('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0daa('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0daa('0x16')](0x9)[_0x0daa('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0daa('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0x0daa('0x16')](0x9)[_0x0daa('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0daa('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0daa('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0daa('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0daa('0x16')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0daa('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0daa('0x16')](0x5)[_0x0daa('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0daa('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x0daa('0x16')](0x5)[_0x0daa('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0daa('0x42')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x0daa('0x43')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x0daa('0x44'),_0x0daa('0x45')),'defaultValue':_0x0daa('0x44')},'dialQueueProject2':{'type':Sequelize[_0x0daa('0x2')],'comment':_0x0daa('0x46')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0daa('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0daa('0x16')](0x3)[_0x0daa('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0daa('0x47')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0daa('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0daa('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0daa('0x16')],'allowNull':!![],'comment':_0x0daa('0x49')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0daa('0x4a'),'set':function(_0x4b873e){if(!_0x4b873e)this['setDataValue'](_0x0daa('0x4b'),null);this[_0x0daa('0xc')](_0x0daa('0x4c'),_0x4b873e);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x0daa('0x16')](0x3)[_0x0daa('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x0daa('0x16')](0x3)[_0x0daa('0x26')],'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 feb3b3e..68391e3 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 _0xf144=['Agents','online','forEach','penalty','transaction','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','emit','removeTeams','ids','select','tq.TeamId','from','team_has_voice_queues','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','userVoiceQueue:remove','addAgents','omit','spread','userVoiceQueue:save','voicePause','removeAgents','isArray','getAgents','getLists','addLists','dialCheckDuplicateType','insert','into','phone','NOW()','scheduledAt','CmListId','ListId','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','fromQuery','ContactId','cm_contacts','ListId\x20=\x20?','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','VoiceQueues','QueueCampaigns','outbound','filter','map','value','type','find','name','error','stack','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','key','VIRTUAL','field','options','VoiceQueue','include','findAll','rows','catch','create','body','role','user','inbound','UserProfileSection','userProfileId','UserProfileResource','clone','params','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','getHopperHistories','findOne','VoiceQueueId','CmHopperHistory','includeAll','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User'];(function(_0x35b76f,_0x324c48){var _0x582906=function(_0x5e4a7b){while(--_0x5e4a7b){_0x35b76f['push'](_0x35b76f['shift']());}};_0x582906(++_0x324c48);}(_0xf144,0xfc));var _0x4f14=function(_0x15b3fa,_0x5d12fe){_0x15b3fa=_0x15b3fa-0x0;var _0x406232=_0xf144[_0x15b3fa];return _0x406232;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4f14('0x0'));var BPromise=require(_0x4f14('0x1'));var Mustache=require(_0x4f14('0x2'));var util=require(_0x4f14('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x4f14('0x4'));var ejs=require(_0x4f14('0x5'));var fs=require('fs');var _=require(_0x4f14('0x6'));var squel=require(_0x4f14('0x7'));var crypto=require('crypto');var jsforce=require(_0x4f14('0x8'));var deskjs=require(_0x4f14('0x9'));var toCsv=require(_0x4f14('0x4'));var querystring=require(_0x4f14('0xa'));var Papa=require(_0x4f14('0xb'));var Redis=require(_0x4f14('0xc'));var authService=require(_0x4f14('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4f14('0xe'));var logger=require('../../config/logger')(_0x4f14('0xf'));var utils=require(_0x4f14('0x10'));var config=require(_0x4f14('0x11'));var db=require(_0x4f14('0x12'))['db'];config[_0x4f14('0x13')]=_[_0x4f14('0x14')](config[_0x4f14('0x13')],{'host':_0x4f14('0x15'),'port':0x18eb});var socket=require(_0x4f14('0x16'))(new Redis(config['redis']));require(_0x4f14('0x17'))[_0x4f14('0x18')](socket);function respondWithStatusCode(_0x3e9444,_0x354601){_0x354601=_0x354601||0xcc;return function(_0x393c4a){if(_0x393c4a){return _0x3e9444[_0x4f14('0x19')](_0x354601);}return _0x3e9444[_0x4f14('0x1a')](_0x354601)[_0x4f14('0x1b')]();};}function respondWithResult(_0x47a7d4,_0x462d77){_0x462d77=_0x462d77||0xc8;return function(_0x371e3a){if(_0x371e3a){return _0x47a7d4[_0x4f14('0x1a')](_0x462d77)['json'](_0x371e3a);}};}function respondWithFilteredResult(_0x13cef7,_0x26442c){return function(_0x561445){if(_0x561445){var _0x3819ee=_0x561445[_0x4f14('0x1c')],_0x2dbcd5=_0x26442c[_0x4f14('0x1d')],_0x5d1d23=_0x26442c[_0x4f14('0x1d')]+_0x26442c[_0x4f14('0x1e')],_0x43438a;if(_0x5d1d23>=_0x3819ee){_0x5d1d23=_0x3819ee;_0x43438a=0xc8;}else{_0x43438a=0xce;}_0x13cef7['status'](_0x43438a);return _0x13cef7[_0x4f14('0x1f')](_0x4f14('0x20'),_0x2dbcd5+'-'+_0x5d1d23+'/'+_0x3819ee)[_0x4f14('0x21')](_0x561445);}return null;};}function patchUpdates(_0x300ae8){return function(_0x47b6f2){try{jsonpatch[_0x4f14('0x22')](_0x47b6f2,_0x300ae8,!![]);}catch(_0x2e89b0){return BPromise[_0x4f14('0x23')](_0x2e89b0);}return _0x47b6f2['save']();};}function saveUpdates(_0xe504d6,_0x91fd03){return function(_0x31322b){if(_0x31322b){return _0x31322b[_0x4f14('0x24')](_0xe504d6)[_0x4f14('0x25')](function(_0xe06bca){return _0xe06bca;});}return null;};}function removeEntity(_0x3df3db,_0x5b15dc){return function(_0x39c46c){if(_0x39c46c){return _0x39c46c[_0x4f14('0x26')]()['then'](function(){var _0x1abd98=_0x39c46c[_0x4f14('0x27')]({'plain':!![]});var _0xb1dfc7=[{'name':_0x4f14('0x28'),'value':'inbound','ignore':![]},{'name':_0x4f14('0x29'),'value':_0x4f14('0x2a'),'ignore':![]}];var _0x37b607=_(_0xb1dfc7)[_0x4f14('0x2b')]('ignore')[_0x4f14('0x2c')](_0x4f14('0x2d'))['value']();if(_['includes'](_0x37b607,_0x1abd98[_0x4f14('0x2e')])){return;}var _0x45c8ee=_[_0x4f14('0x2f')](_0xb1dfc7,[_0x4f14('0x2d'),_0x1abd98[_0x4f14('0x2e')]])[_0x4f14('0x30')];return db['UserProfileResource'][_0x4f14('0x26')]({'where':{'type':_0x45c8ee,'resourceId':_0x1abd98['id']}})[_0x4f14('0x25')](function(){return _0x39c46c;});})['then'](function(){_0x3df3db[_0x4f14('0x1a')](0xcc)[_0x4f14('0x1b')]();});}};}function handleEntityNotFound(_0x5d2d3b,_0x40827e){return function(_0x1e02d0){if(!_0x1e02d0){_0x5d2d3b[_0x4f14('0x19')](0x194);}return _0x1e02d0;};}function handleError(_0x4d0353,_0x2632cd){_0x2632cd=_0x2632cd||0x1f4;return function(_0x4e336d){logger[_0x4f14('0x31')](_0x4e336d[_0x4f14('0x32')]);if(_0x4e336d[_0x4f14('0x30')]){delete _0x4e336d[_0x4f14('0x30')];}_0x4d0353['status'](_0x2632cd)[_0x4f14('0x33')](_0x4e336d);};}exports[_0x4f14('0x34')]=function(_0x37f97e,_0x4bb53d){var _0xc48291={},_0x1dac20={},_0x117a66={'count':0x0,'rows':[]};var _0xb9c782=db['VoiceQueue'][_0x4f14('0x35')];_0x1dac20['model']=_[_0x4f14('0x36')](_0xb9c782);_0x1dac20['query']=_[_0x4f14('0x36')](_0x37f97e[_0x4f14('0x37')]);_0x1dac20[_0x4f14('0x38')]=_[_0x4f14('0x39')](_0x1dac20[_0x4f14('0x3a')],_0x1dac20[_0x4f14('0x37')]);_0xc48291[_0x4f14('0x3b')]=_[_0x4f14('0x39')](_0x1dac20[_0x4f14('0x3a')],qs[_0x4f14('0x3c')](_0x37f97e[_0x4f14('0x37')][_0x4f14('0x3c')]));_0xc48291[_0x4f14('0x3b')]=_0xc48291[_0x4f14('0x3b')][_0x4f14('0x3d')]?_0xc48291[_0x4f14('0x3b')]:_0x1dac20[_0x4f14('0x3a')];if(!_0x37f97e[_0x4f14('0x37')][_0x4f14('0x3e')](_0x4f14('0x3f'))){_0xc48291[_0x4f14('0x1e')]=qs[_0x4f14('0x1e')](_0x37f97e[_0x4f14('0x37')][_0x4f14('0x1e')]);_0xc48291[_0x4f14('0x1d')]=qs['offset'](_0x37f97e[_0x4f14('0x37')][_0x4f14('0x1d')]);}_0xc48291[_0x4f14('0x40')]=qs['sort'](_0x37f97e['query'][_0x4f14('0x41')]);_0xc48291[_0x4f14('0x42')]=qs[_0x4f14('0x38')](_[_0x4f14('0x43')](_0x37f97e[_0x4f14('0x37')],_0x1dac20[_0x4f14('0x38')]));if(_0x37f97e[_0x4f14('0x37')]['filter']){_0xc48291['where']=_[_0x4f14('0x44')](_0xc48291[_0x4f14('0x42')],{'$or':_[_0x4f14('0x2c')](_0xb9c782,function(_0x35607a){if(_0x35607a[_0x4f14('0x2e')][_0x4f14('0x45')]!==_0x4f14('0x46')){var _0x1a2b32={};_0x1a2b32[_0x35607a[_0x4f14('0x47')]]={'$like':'%'+_0x37f97e[_0x4f14('0x37')][_0x4f14('0x2b')]+'%'};return _0x1a2b32;}})});}_0xc48291=_[_0x4f14('0x44')]({},_0xc48291,_0x37f97e[_0x4f14('0x48')]);var _0x42d49c={'where':_0xc48291[_0x4f14('0x42')]};return db[_0x4f14('0x49')][_0x4f14('0x1c')](_0x42d49c)[_0x4f14('0x25')](function(_0x5e8c48){_0x117a66[_0x4f14('0x1c')]=_0x5e8c48;if(_0x37f97e[_0x4f14('0x37')]['includeAll']){_0xc48291[_0x4f14('0x4a')]=[{'all':!![]}];}return db['VoiceQueue'][_0x4f14('0x4b')](_0xc48291);})[_0x4f14('0x25')](function(_0x33aa58){_0x117a66[_0x4f14('0x4c')]=_0x33aa58;return _0x117a66;})['then'](respondWithFilteredResult(_0x4bb53d,_0xc48291))[_0x4f14('0x4d')](handleError(_0x4bb53d,null));};exports['show']=function(_0x2ce736,_0x113823){var _0x2608f8={'raw':![],'where':{'id':_0x2ce736['params']['id']}},_0x639f0={};_0x639f0[_0x4f14('0x3a')]=_[_0x4f14('0x36')](db['VoiceQueue']['rawAttributes']);_0x639f0[_0x4f14('0x37')]=_[_0x4f14('0x36')](_0x2ce736['query']);_0x639f0[_0x4f14('0x38')]=_[_0x4f14('0x39')](_0x639f0[_0x4f14('0x3a')],_0x639f0['query']);_0x2608f8['attributes']=_[_0x4f14('0x39')](_0x639f0[_0x4f14('0x3a')],qs[_0x4f14('0x3c')](_0x2ce736['query']['fields']));_0x2608f8[_0x4f14('0x3b')]=_0x2608f8[_0x4f14('0x3b')][_0x4f14('0x3d')]?_0x2608f8[_0x4f14('0x3b')]:_0x639f0[_0x4f14('0x3a')];if(_0x2ce736[_0x4f14('0x37')]['includeAll']){_0x2608f8[_0x4f14('0x4a')]=[{'all':!![]}];}_0x2608f8=_['merge']({},_0x2608f8,_0x2ce736[_0x4f14('0x48')]);return db['VoiceQueue']['find'](_0x2608f8)['then'](handleEntityNotFound(_0x113823,null))[_0x4f14('0x25')](respondWithResult(_0x113823,null))['catch'](handleError(_0x113823,null));};exports[_0x4f14('0x4e')]=function(_0x44323b,_0x4fa2e7){return db[_0x4f14('0x49')]['create'](_0x44323b[_0x4f14('0x4f')],{})['then'](function(_0x16f599){var _0x5d9218=_0x44323b['user'][_0x4f14('0x27')]({'plain':!![]});if(!_0x5d9218)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d9218[_0x4f14('0x50')]===_0x4f14('0x51')){var _0x4be346=_0x16f599[_0x4f14('0x27')]({'plain':!![]});var _0x351d02=[{'name':_0x4f14('0x28'),'value':_0x4f14('0x52')},{'name':_0x4f14('0x29'),'value':_0x4f14('0x2a')}];var _0x31c9f1=_['find'](_0x351d02,[_0x4f14('0x2d'),_0x4be346['type']])[_0x4f14('0x30')];return db[_0x4f14('0x53')]['find']({'where':{'name':_0x31c9f1,'userProfileId':_0x5d9218[_0x4f14('0x54')]},'raw':!![]})[_0x4f14('0x25')](function(_0x5c519d){if(_0x5c519d&&_0x5c519d['autoAssociation']===0x0){return db[_0x4f14('0x55')]['create']({'name':_0x4be346[_0x4f14('0x30')],'resourceId':_0x4be346['id'],'type':_0x5c519d[_0x4f14('0x30')],'sectionId':_0x5c519d['id']},{})[_0x4f14('0x25')](function(){return _0x16f599;});}else{return _0x16f599;}})[_0x4f14('0x4d')](function(_0x5a2b88){logger[_0x4f14('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a2b88);throw _0x5a2b88;});}return _0x16f599;})[_0x4f14('0x25')](respondWithResult(_0x4fa2e7,0xc9))[_0x4f14('0x4d')](handleError(_0x4fa2e7,null));};exports[_0x4f14('0x56')]=function(_0x33ca61,_0x4126d9){var _0x11cc71={'raw':![],'where':{'id':_0x33ca61[_0x4f14('0x57')]['id']}},_0x50cd99={};_0x50cd99[_0x4f14('0x3a')]=_['keys'](db[_0x4f14('0x49')][_0x4f14('0x35')]);_0x11cc71[_0x4f14('0x3b')]=_['intersection'](_0x50cd99['model'],qs[_0x4f14('0x3c')](_0x33ca61['query'][_0x4f14('0x3c')]));_0x11cc71[_0x4f14('0x3b')]=_0x11cc71[_0x4f14('0x3b')][_0x4f14('0x3d')]?_0x11cc71[_0x4f14('0x3b')]:_0x50cd99['model'];if(_0x33ca61[_0x4f14('0x37')]['includeAll']){_0x11cc71[_0x4f14('0x4a')]=[{'all':!![]}];}_0x11cc71=_[_0x4f14('0x44')]({},_0x11cc71,_0x33ca61[_0x4f14('0x48')]);return db[_0x4f14('0x49')][_0x4f14('0x2f')](_0x11cc71)['then'](handleEntityNotFound(_0x4126d9,null))[_0x4f14('0x25')](function(_0x5072ce){if(_0x5072ce){var _0x127495=_0x5072ce['get']({'plain':!![]});_0x127495=qs['omit'](_0x127495,['id',_0x4f14('0x58'),'updatedAt']);_0x33ca61[_0x4f14('0x4f')]=_['omit'](_0x33ca61[_0x4f14('0x4f')],['id',_0x4f14('0x58'),_0x4f14('0x59')]);return db[_0x4f14('0x49')]['create'](_['merge'](_0x127495,_0x33ca61['body']),{'include':_0x33ca61[_0x4f14('0x37')]['includeAll']?[{'all':!![]}]:undefined})[_0x4f14('0x25')](function(_0x3d6448){var _0x256995=_0x33ca61[_0x4f14('0x51')][_0x4f14('0x27')]({'plain':!![]});if(!_0x256995)throw new Error(_0x4f14('0x5a'));if(_0x256995['role']==='user'){var _0xf4c59b=_0x3d6448[_0x4f14('0x27')]({'plain':!![]});var _0xf7e901=[{'name':'VoiceQueues','value':_0x4f14('0x52')},{'name':_0x4f14('0x29'),'value':_0x4f14('0x2a')}];var _0x460697=_[_0x4f14('0x2f')](_0xf7e901,[_0x4f14('0x2d'),_0xf4c59b['type']])[_0x4f14('0x30')];return db[_0x4f14('0x53')][_0x4f14('0x2f')]({'where':{'name':_0x460697,'userProfileId':_0x256995[_0x4f14('0x54')]},'raw':!![]})[_0x4f14('0x25')](function(_0x5a9b23){if(_0x5a9b23&&_0x5a9b23[_0x4f14('0x5b')]===0x0){return db[_0x4f14('0x55')][_0x4f14('0x4e')]({'name':_0xf4c59b[_0x4f14('0x30')],'resourceId':_0xf4c59b['id'],'type':_0x5a9b23[_0x4f14('0x30')],'sectionId':_0x5a9b23['id']},{})[_0x4f14('0x25')](function(){return _0x3d6448;});}else{return _0x3d6448;}})[_0x4f14('0x4d')](function(_0x32aefb){logger[_0x4f14('0x31')](_0x4f14('0x5c'),_0x32aefb);throw _0x32aefb;});}return _0x3d6448;});}})[_0x4f14('0x25')](respondWithResult(_0x4126d9,0xc9))[_0x4f14('0x4d')](handleError(_0x4126d9,null));};exports['update']=function(_0xa6afe4,_0x24c44e){if(_0xa6afe4['body']['id']){delete _0xa6afe4[_0x4f14('0x4f')]['id'];}return db[_0x4f14('0x49')]['find']({'where':{'id':_0xa6afe4[_0x4f14('0x57')]['id']}})[_0x4f14('0x25')](handleEntityNotFound(_0x24c44e,null))[_0x4f14('0x25')](saveUpdates(_0xa6afe4[_0x4f14('0x4f')],null))[_0x4f14('0x25')](respondWithResult(_0x24c44e,null))[_0x4f14('0x4d')](handleError(_0x24c44e,null));};exports['destroy']=function(_0x55b1d2,_0x11d191){return db[_0x4f14('0x49')][_0x4f14('0x2f')]({'where':{'id':_0x55b1d2['params']['id']}})[_0x4f14('0x25')](handleEntityNotFound(_0x11d191,null))[_0x4f14('0x25')](removeEntity(_0x11d191,null))['catch'](handleError(_0x11d191,null));};exports[_0x4f14('0x5d')]=function(_0x236ab7,_0xbd7eba,_0x24b0be){var _0x18c03c={'raw':![],'where':{}};var _0x301244={};var _0x1932de={'count':0x0,'rows':[]};return db[_0x4f14('0x49')]['findOne']({'where':{'id':_0x236ab7[_0x4f14('0x57')]['id']}})[_0x4f14('0x25')](handleEntityNotFound(_0xbd7eba,null))[_0x4f14('0x25')](function(_0x440515){if(_0x440515){_0x301244[_0x4f14('0x3a')]=_[_0x4f14('0x36')](db['CmHopper'][_0x4f14('0x35')]);_0x301244['query']=_['keys'](_0x236ab7[_0x4f14('0x37')]);_0x301244[_0x4f14('0x38')]=_[_0x4f14('0x39')](_0x301244[_0x4f14('0x3a')],_0x301244[_0x4f14('0x37')]);_0x18c03c[_0x4f14('0x3b')]=_[_0x4f14('0x39')](_0x301244[_0x4f14('0x3a')],qs[_0x4f14('0x3c')](_0x236ab7[_0x4f14('0x37')]['fields']));_0x18c03c[_0x4f14('0x3b')]=_0x18c03c['attributes']['length']?_0x18c03c[_0x4f14('0x3b')]:_0x301244[_0x4f14('0x3a')];if(!_0x236ab7[_0x4f14('0x37')][_0x4f14('0x3e')](_0x4f14('0x3f'))){_0x18c03c['limit']=qs[_0x4f14('0x1e')](_0x236ab7[_0x4f14('0x37')][_0x4f14('0x1e')]);_0x18c03c['offset']=qs[_0x4f14('0x1d')](_0x236ab7[_0x4f14('0x37')][_0x4f14('0x1d')]);}_0x18c03c['order']=qs[_0x4f14('0x41')](_0x236ab7[_0x4f14('0x37')][_0x4f14('0x41')]);_0x18c03c[_0x4f14('0x42')]=qs['filters'](_[_0x4f14('0x43')](_0x236ab7[_0x4f14('0x37')],_0x301244[_0x4f14('0x38')]));_0x18c03c['where']['VoiceQueueId']=_0x440515['id'];if(_0x236ab7[_0x4f14('0x37')][_0x4f14('0x2b')]){_0x18c03c[_0x4f14('0x42')]=_['merge'](_0x18c03c[_0x4f14('0x42')],{'$or':_[_0x4f14('0x2c')](_0x18c03c[_0x4f14('0x3b')],function(_0x3e34a2){var _0x1ea721={};_0x1ea721[_0x3e34a2]={'$like':'%'+_0x236ab7[_0x4f14('0x37')]['filter']+'%'};return _0x1ea721;})});}_0x18c03c=_[_0x4f14('0x44')]({},_0x18c03c,_0x236ab7[_0x4f14('0x48')]);return db[_0x4f14('0x5e')][_0x4f14('0x1c')]({'where':_0x18c03c[_0x4f14('0x42')]})[_0x4f14('0x25')](function(_0x4a6ece){_0x1932de[_0x4f14('0x1c')]=_0x4a6ece;if(_0x236ab7[_0x4f14('0x37')]['includeAll']){_0x18c03c[_0x4f14('0x4a')]=[{'all':!![]}];}return db[_0x4f14('0x5e')]['findAll'](_0x18c03c);})[_0x4f14('0x25')](function(_0x1dcff1){_0x1932de['rows']=_0x1dcff1;return _0x1932de;});}})['then'](respondWithFilteredResult(_0xbd7eba,_0x18c03c))[_0x4f14('0x4d')](handleError(_0xbd7eba,null));};exports[_0x4f14('0x5f')]=function(_0x5e32b7,_0xac213b,_0xe2cc0d){var _0x41a126={'raw':!![],'where':{}};var _0x9d5592={};var _0x4467e9={'count':0x0,'rows':[]};return db[_0x4f14('0x49')][_0x4f14('0x60')]({'where':{'id':_0x5e32b7['params']['id']}})[_0x4f14('0x25')](handleEntityNotFound(_0xac213b,null))[_0x4f14('0x25')](function(_0x3ae48c){if(_0x3ae48c){_0x9d5592[_0x4f14('0x3a')]=_['keys'](db['CmHopperHistory'][_0x4f14('0x35')]);_0x9d5592[_0x4f14('0x37')]=_[_0x4f14('0x36')](_0x5e32b7[_0x4f14('0x37')]);_0x9d5592[_0x4f14('0x38')]=_[_0x4f14('0x39')](_0x9d5592[_0x4f14('0x3a')],_0x9d5592['query']);_0x41a126['attributes']=_['intersection'](_0x9d5592[_0x4f14('0x3a')],qs[_0x4f14('0x3c')](_0x5e32b7[_0x4f14('0x37')][_0x4f14('0x3c')]));_0x41a126[_0x4f14('0x3b')]=_0x41a126[_0x4f14('0x3b')][_0x4f14('0x3d')]?_0x41a126[_0x4f14('0x3b')]:_0x9d5592[_0x4f14('0x3a')];if(!_0x5e32b7['query'][_0x4f14('0x3e')](_0x4f14('0x3f'))){_0x41a126['limit']=qs[_0x4f14('0x1e')](_0x5e32b7[_0x4f14('0x37')][_0x4f14('0x1e')]);_0x41a126[_0x4f14('0x1d')]=qs['offset'](_0x5e32b7['query'][_0x4f14('0x1d')]);}_0x41a126[_0x4f14('0x40')]=qs['sort'](_0x5e32b7['query'][_0x4f14('0x41')]);_0x41a126['where']=qs['filters'](_['pick'](_0x5e32b7[_0x4f14('0x37')],_0x9d5592[_0x4f14('0x38')]));_0x41a126[_0x4f14('0x42')][_0x4f14('0x61')]=_0x3ae48c['id'];if(_0x5e32b7['query'][_0x4f14('0x2b')]){_0x41a126[_0x4f14('0x42')]=_[_0x4f14('0x44')](_0x41a126['where'],{'$or':_[_0x4f14('0x2c')](_0x41a126[_0x4f14('0x3b')],function(_0x222270){var _0x59047f={};_0x59047f[_0x222270]={'$like':'%'+_0x5e32b7[_0x4f14('0x37')][_0x4f14('0x2b')]+'%'};return _0x59047f;})});}_0x41a126=_[_0x4f14('0x44')]({},_0x41a126,_0x5e32b7['options']);return db[_0x4f14('0x62')][_0x4f14('0x1c')]({'where':_0x41a126[_0x4f14('0x42')]})[_0x4f14('0x25')](function(_0x428d7f){_0x4467e9[_0x4f14('0x1c')]=_0x428d7f;if(_0x5e32b7[_0x4f14('0x37')][_0x4f14('0x63')]){_0x41a126[_0x4f14('0x4a')]=[{'all':!![]}];}return db[_0x4f14('0x62')][_0x4f14('0x4b')](_0x41a126);})['then'](function(_0x2b7fa1){_0x4467e9[_0x4f14('0x4c')]=_0x2b7fa1;return _0x4467e9;});}})['then'](respondWithFilteredResult(_0xac213b,_0x41a126))[_0x4f14('0x4d')](handleError(_0xac213b,null));};exports['getHopperFinals']=function(_0x24c90c,_0x39ecd0,_0x671301){var _0x4ce36e={'raw':!![],'where':{}};var _0x3a4b3b={};var _0x2e98b0={'count':0x0,'rows':[]};return db[_0x4f14('0x49')][_0x4f14('0x60')]({'where':{'id':_0x24c90c[_0x4f14('0x57')]['id']}})[_0x4f14('0x25')](handleEntityNotFound(_0x39ecd0,null))[_0x4f14('0x25')](function(_0x1e8dd9){if(_0x1e8dd9){_0x3a4b3b['model']=_[_0x4f14('0x36')](db[_0x4f14('0x64')]['rawAttributes']);_0x3a4b3b['query']=_[_0x4f14('0x36')](_0x24c90c[_0x4f14('0x37')]);_0x3a4b3b[_0x4f14('0x38')]=_[_0x4f14('0x39')](_0x3a4b3b[_0x4f14('0x3a')],_0x3a4b3b[_0x4f14('0x37')]);_0x4ce36e[_0x4f14('0x3b')]=_[_0x4f14('0x39')](_0x3a4b3b[_0x4f14('0x3a')],qs[_0x4f14('0x3c')](_0x24c90c[_0x4f14('0x37')][_0x4f14('0x3c')]));_0x4ce36e[_0x4f14('0x3b')]=_0x4ce36e['attributes'][_0x4f14('0x3d')]?_0x4ce36e[_0x4f14('0x3b')]:_0x3a4b3b[_0x4f14('0x3a')];if(!_0x24c90c['query'][_0x4f14('0x3e')](_0x4f14('0x3f'))){_0x4ce36e[_0x4f14('0x1e')]=qs[_0x4f14('0x1e')](_0x24c90c['query'][_0x4f14('0x1e')]);_0x4ce36e[_0x4f14('0x1d')]=qs[_0x4f14('0x1d')](_0x24c90c['query']['offset']);}_0x4ce36e[_0x4f14('0x40')]=qs[_0x4f14('0x41')](_0x24c90c['query'][_0x4f14('0x41')]);_0x4ce36e[_0x4f14('0x42')]=qs[_0x4f14('0x38')](_[_0x4f14('0x43')](_0x24c90c[_0x4f14('0x37')],_0x3a4b3b[_0x4f14('0x38')]));_0x4ce36e['where'][_0x4f14('0x61')]=_0x1e8dd9['id'];if(_0x24c90c[_0x4f14('0x37')][_0x4f14('0x2b')]){_0x4ce36e[_0x4f14('0x42')]=_['merge'](_0x4ce36e['where'],{'$or':_[_0x4f14('0x2c')](_0x4ce36e['attributes'],function(_0x5e8001){var _0x4bb2c9={};_0x4bb2c9[_0x5e8001]={'$like':'%'+_0x24c90c[_0x4f14('0x37')][_0x4f14('0x2b')]+'%'};return _0x4bb2c9;})});}_0x4ce36e=_['merge']({},_0x4ce36e,_0x24c90c['options']);return db[_0x4f14('0x64')][_0x4f14('0x1c')]({'where':_0x4ce36e[_0x4f14('0x42')]})[_0x4f14('0x25')](function(_0x5df16f){_0x2e98b0[_0x4f14('0x1c')]=_0x5df16f;if(_0x24c90c[_0x4f14('0x37')]['includeAll']){_0x4ce36e['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x4f14('0x4b')](_0x4ce36e);})[_0x4f14('0x25')](function(_0x47695f){_0x2e98b0['rows']=_0x47695f;return _0x2e98b0;});}})[_0x4f14('0x25')](respondWithFilteredResult(_0x39ecd0,_0x4ce36e))[_0x4f14('0x4d')](handleError(_0x39ecd0,null));};exports[_0x4f14('0x65')]=function(_0x5539b1,_0x1225f2,_0x599ab4){var _0x5e8b03={'raw':!![],'where':{}};var _0x4bca09={};var _0x348a19={'count':0x0,'rows':[]};return db[_0x4f14('0x49')][_0x4f14('0x60')]({'where':{'id':_0x5539b1[_0x4f14('0x57')]['id']}})[_0x4f14('0x25')](handleEntityNotFound(_0x1225f2,null))[_0x4f14('0x25')](function(_0x1f4f5e){if(_0x1f4f5e){_0x4bca09[_0x4f14('0x3a')]=_['keys'](db['CmHopperBlack'][_0x4f14('0x35')]);_0x4bca09[_0x4f14('0x37')]=_[_0x4f14('0x36')](_0x5539b1[_0x4f14('0x37')]);_0x4bca09[_0x4f14('0x38')]=_[_0x4f14('0x39')](_0x4bca09[_0x4f14('0x3a')],_0x4bca09[_0x4f14('0x37')]);_0x5e8b03[_0x4f14('0x3b')]=_[_0x4f14('0x39')](_0x4bca09['model'],qs[_0x4f14('0x3c')](_0x5539b1[_0x4f14('0x37')]['fields']));_0x5e8b03['attributes']=_0x5e8b03[_0x4f14('0x3b')][_0x4f14('0x3d')]?_0x5e8b03[_0x4f14('0x3b')]:_0x4bca09['model'];if(!_0x5539b1['query']['hasOwnProperty']('nolimit')){_0x5e8b03[_0x4f14('0x1e')]=qs[_0x4f14('0x1e')](_0x5539b1[_0x4f14('0x37')][_0x4f14('0x1e')]);_0x5e8b03['offset']=qs[_0x4f14('0x1d')](_0x5539b1[_0x4f14('0x37')][_0x4f14('0x1d')]);}_0x5e8b03[_0x4f14('0x40')]=qs['sort'](_0x5539b1[_0x4f14('0x37')][_0x4f14('0x41')]);_0x5e8b03['where']=qs[_0x4f14('0x38')](_[_0x4f14('0x43')](_0x5539b1[_0x4f14('0x37')],_0x4bca09['filters']));_0x5e8b03['where'][_0x4f14('0x61')]=_0x1f4f5e['id'];if(_0x5539b1['query'][_0x4f14('0x2b')]){_0x5e8b03[_0x4f14('0x42')]=_[_0x4f14('0x44')](_0x5e8b03[_0x4f14('0x42')],{'$or':_[_0x4f14('0x2c')](_0x5e8b03[_0x4f14('0x3b')],function(_0x5373b7){var _0x99cd7d={};_0x99cd7d[_0x5373b7]={'$like':'%'+_0x5539b1[_0x4f14('0x37')][_0x4f14('0x2b')]+'%'};return _0x99cd7d;})});}_0x5e8b03=_['merge']({},_0x5e8b03,_0x5539b1[_0x4f14('0x48')]);return db[_0x4f14('0x66')][_0x4f14('0x1c')]({'where':_0x5e8b03[_0x4f14('0x42')]})[_0x4f14('0x25')](function(_0x19b410){_0x348a19['count']=_0x19b410;if(_0x5539b1[_0x4f14('0x37')]['includeAll']){_0x5e8b03['include']=[{'all':!![]}];}return db[_0x4f14('0x66')]['findAll'](_0x5e8b03);})[_0x4f14('0x25')](function(_0x3e109c){_0x348a19['rows']=_0x3e109c;return _0x348a19;});}})['then'](respondWithFilteredResult(_0x1225f2,_0x5e8b03))[_0x4f14('0x4d')](handleError(_0x1225f2,null));};exports[_0x4f14('0x67')]=function(_0x4fde42,_0x1d155e,_0x46aa43){var _0x5071f8={};var _0x20afc7={};var _0x3a39e9;var _0x45d691;return db[_0x4f14('0x49')][_0x4f14('0x60')]({'where':{'id':_0x4fde42[_0x4f14('0x57')]['id']}})['then'](handleEntityNotFound(_0x1d155e,null))[_0x4f14('0x25')](function(_0x2cf770){if(_0x2cf770){_0x3a39e9=_0x2cf770;_0x20afc7[_0x4f14('0x3a')]=_[_0x4f14('0x36')](db[_0x4f14('0x68')]['rawAttributes']);_0x20afc7['query']=_['keys'](_0x4fde42['query']);_0x20afc7[_0x4f14('0x38')]=_[_0x4f14('0x39')](_0x20afc7[_0x4f14('0x3a')],_0x20afc7[_0x4f14('0x37')]);_0x5071f8[_0x4f14('0x3b')]=_[_0x4f14('0x39')](_0x20afc7['model'],qs['fields'](_0x4fde42[_0x4f14('0x37')][_0x4f14('0x3c')]));_0x5071f8[_0x4f14('0x3b')]=_0x5071f8[_0x4f14('0x3b')][_0x4f14('0x3d')]?_0x5071f8[_0x4f14('0x3b')]:_0x20afc7[_0x4f14('0x3a')];_0x5071f8[_0x4f14('0x40')]=qs['sort'](_0x4fde42[_0x4f14('0x37')]['sort']);_0x5071f8['where']=qs[_0x4f14('0x38')](_['pick'](_0x4fde42[_0x4f14('0x37')],_0x20afc7[_0x4f14('0x38')]));if(_0x4fde42[_0x4f14('0x37')][_0x4f14('0x2b')]){_0x5071f8['where']=_[_0x4f14('0x44')](_0x5071f8[_0x4f14('0x42')],{'$or':_[_0x4f14('0x2c')](_0x5071f8[_0x4f14('0x3b')],function(_0x39a6be){var _0xe66de={};_0xe66de[_0x39a6be]={'$like':'%'+_0x4fde42[_0x4f14('0x37')][_0x4f14('0x2b')]+'%'};return _0xe66de;})});}_0x5071f8=_[_0x4f14('0x44')]({},_0x5071f8,_0x4fde42['options']);return _0x3a39e9['getTeams'](_0x5071f8);}})[_0x4f14('0x25')](function(_0x4117e6){if(_0x4117e6){_0x45d691=_0x4117e6[_0x4f14('0x3d')];if(!_0x4fde42[_0x4f14('0x37')][_0x4f14('0x3e')](_0x4f14('0x3f'))){_0x5071f8[_0x4f14('0x1e')]=qs[_0x4f14('0x1e')](_0x4fde42[_0x4f14('0x37')][_0x4f14('0x1e')]);_0x5071f8[_0x4f14('0x1d')]=qs['offset'](_0x4fde42[_0x4f14('0x37')][_0x4f14('0x1d')]);}return _0x3a39e9[_0x4f14('0x67')](_0x5071f8);}})['then'](function(_0x48249a){if(_0x48249a){return _0x48249a?{'count':_0x45d691,'rows':_0x48249a}:null;}})[_0x4f14('0x25')](respondWithResult(_0x1d155e,null))['catch'](handleError(_0x1d155e,null));};exports[_0x4f14('0x69')]=function(_0x27dd45,_0xa26125,_0x982ead){var _0x2cff94=_0x27dd45[_0x4f14('0x4f')][_0x4f14('0x6a')];return db['Team'][_0x4f14('0x4b')]({'where':{'id':_['map'](_0x2cff94,'id')},'attributes':['id'],'include':[{'model':db[_0x4f14('0x6b')],'as':_0x4f14('0x6c'),'attributes':['id',_0x4f14('0x30'),_0x4f14('0x6d'),'voicePause','interface'],'raw':!![]}]})[_0x4f14('0x25')](function(_0x32737d){if(_0x32737d){var _0x4727a0=_['flatMap'](_0x32737d,function(_0x308eb0){var _0x5c953c=_0x308eb0[_0x4f14('0x27')]({'plain':!![]});_0x5c953c[_0x4f14('0x6c')][_0x4f14('0x6e')](function(_0x50e0f1){_0x50e0f1[_0x4f14('0x6f')]=_[_0x4f14('0x2f')](_0x2cff94,{'id':_0x5c953c['id']})['penalty'];});return _0x5c953c[_0x4f14('0x6c')];});return db['VoiceQueue'][_0x4f14('0x2f')]({'where':{'id':_0x27dd45[_0x4f14('0x57')]['id']}})[_0x4f14('0x25')](function(_0x5cb124){return db['sequelize'][_0x4f14('0x70')](function(_0x1d46bf){return _0x5cb124[_0x4f14('0x69')](_['map'](_0x2cff94,'id'),{'transaction':_0x1d46bf})[_0x4f14('0x25')](function(){return BPromise[_0x4f14('0x71')](_0x4727a0,function(_0x450953){return db[_0x4f14('0x72')][_0x4f14('0x73')]({'where':{'UserId':_0x450953['id'],'VoiceQueueId':_0x27dd45[_0x4f14('0x57')]['id']},'defaults':{'penalty':_0x450953[_0x4f14('0x6f')]},'transaction':_0x1d46bf});});})[_0x4f14('0x25')](function(){return BPromise[_0x4f14('0x71')](_['filter'](_0x4727a0,{'online':!![]}),function(_0x59fa0d){return db[_0x4f14('0x74')][_0x4f14('0x75')]({'membername':_0x59fa0d[_0x4f14('0x30')],'UserId':_0x59fa0d['id'],'queue_name':_0x5cb124[_0x4f14('0x30')],'VoiceQueueId':_0x5cb124['id'],'interface':_[_0x4f14('0x76')](_0x59fa0d[_0x4f14('0x77')])?util[_0x4f14('0x78')](_0x4f14('0x79'),_0x59fa0d[_0x4f14('0x30')]):_0x59fa0d['interface'],'paused':_0x59fa0d['voicePause']||![],'penalty':_0x59fa0d[_0x4f14('0x6f')]},{'transaction':_0x1d46bf});});})['then'](function(){_0x4727a0[_0x4f14('0x6e')](function(_0x21e165){socket[_0x4f14('0x7a')]('userVoiceQueue:save',{'UserId':_0x21e165['id'],'VoiceQueueId':_0x5cb124['id']});});});});});}})[_0x4f14('0x25')](respondWithStatusCode(_0xa26125,null))[_0x4f14('0x4d')](handleError(_0xa26125,null));};exports[_0x4f14('0x7b')]=function(_0x18ad95,_0x176bd3,_0x1dfaea){return db[_0x4f14('0x68')][_0x4f14('0x4b')]({'where':{'id':_0x18ad95[_0x4f14('0x37')][_0x4f14('0x7c')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4f14('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x4f14('0x25')](handleEntityNotFound(_0x176bd3,null))[_0x4f14('0x25')](function(_0x446646){var _0x38251b=_[_0x4f14('0x2c')](_0x446646,'id');var _0xde2e53=[];var _0x4fe7db=[];var _0x2acf77=squel[_0x4f14('0x7d')]();_0x2acf77[_0x4f14('0x47')](_0x4f14('0x7e'))[_0x4f14('0x7f')](_0x4f14('0x80'),'tq')['join']('user_has_teams','ut',_0x4f14('0x81'))[_0x4f14('0x42')](_0x4f14('0x82'),_0x18ad95[_0x4f14('0x57')]['id']);for(var _0x4836b8=0x0;_0x4836b8<_0x446646[_0x4f14('0x3d')];_0x4836b8+=0x1){let _0x3a954b=_0x446646[_0x4836b8];for(var _0x3dfe36=0x0;_0x3dfe36<_0x3a954b['Agents'][_0x4f14('0x3d')];_0x3dfe36+=0x1){let _0x2c27c7=_0x3a954b['Agents'][_0x3dfe36];var _0xc5c41a=_0x2acf77[_0x4f14('0x56')]();_0xc5c41a[_0x4f14('0x42')](_0x4f14('0x83'),_0x2c27c7['id']);_0x4fe7db[_0x4f14('0x84')](db['sequelize'][_0x4f14('0x37')](_0xc5c41a[_0x4f14('0x85')](),{'type':db[_0x4f14('0x86')][_0x4f14('0x87')][_0x4f14('0x88')]})[_0x4f14('0x25')](function(_0x439d87){if(_0x439d87[_0x4f14('0x3d')]===0x1){return _0x2c27c7['id'];}else{var _0x3f0bc9=_[_0x4f14('0x89')](_[_0x4f14('0x2c')](_0x439d87,_0x4f14('0x8a')),function(_0x5e28b8){return _[_0x4f14('0x8b')](_0x38251b,_0x5e28b8);});if(_0x3f0bc9){return _0x2c27c7['id'];}}}));}}return BPromise[_0x4f14('0x8c')](_0x4fe7db)[_0x4f14('0x25')](function(_0x2f2ffd){_0xde2e53=_(_0xde2e53)[_0x4f14('0x8d')](_0x2f2ffd)[_0x4f14('0x8e')]()[_0x4f14('0x2d')]();return db['VoiceQueue'][_0x4f14('0x2f')]({'where':{'id':_0x18ad95[_0x4f14('0x57')]['id']}})[_0x4f14('0x25')](function(_0x8fce36){return db[_0x4f14('0x86')][_0x4f14('0x70')](function(_0x230830){return _0x8fce36[_0x4f14('0x7b')](_0x18ad95[_0x4f14('0x37')][_0x4f14('0x7c')],{'transaction':_0x230830})[_0x4f14('0x25')](function(){if(!_[_0x4f14('0x8f')](_0xde2e53)){return _0x8fce36['removeAgents'](_0xde2e53,{'transaction':_0x230830})['then'](function(){return db[_0x4f14('0x74')][_0x4f14('0x26')]({'where':{'VoiceQueueId':_0x18ad95[_0x4f14('0x57')]['id'],'UserId':_0xde2e53},'transaction':_0x230830});});}})[_0x4f14('0x25')](function(){_0xde2e53['forEach'](function(_0x4fae0a){socket[_0x4f14('0x7a')](_0x4f14('0x90'),{'UserId':_0x4fae0a,'VoiceQueueId':_0x8fce36['id']});});});});});});})[_0x4f14('0x25')](respondWithStatusCode(_0x176bd3,null))[_0x4f14('0x4d')](handleError(_0x176bd3,null));};exports[_0x4f14('0x91')]=function(_0x1e7c95,_0x1673db,_0x12e7b6){var _0x3e795c,_0x55fd9d;return db[_0x4f14('0x49')][_0x4f14('0x2f')]({'where':{'id':_0x1e7c95['params']['id']}})['then'](handleEntityNotFound(_0x1673db,null))['then'](function(_0x43ce3c){if(_0x43ce3c){_0x55fd9d=_0x43ce3c;return _0x43ce3c[_0x4f14('0x91')](_0x1e7c95[_0x4f14('0x4f')][_0x4f14('0x7c')],_[_0x4f14('0x92')](_0x1e7c95[_0x4f14('0x4f')],[_0x4f14('0x7c'),'id'])||{})[_0x4f14('0x93')](function(_0x5d9d81){for(var _0x37b077=0x0;_0x37b077<_0x1e7c95[_0x4f14('0x4f')]['ids'][_0x4f14('0x3d')];_0x37b077+=0x1){socket[_0x4f14('0x7a')](_0x4f14('0x94'),{'UserId':_0x1e7c95[_0x4f14('0x4f')][_0x4f14('0x7c')][_0x37b077],'VoiceQueueId':_0x1e7c95[_0x4f14('0x57')]['id']});}return _0x5d9d81;});}})[_0x4f14('0x25')](function(_0xaea6b7){_0x3e795c=_0xaea6b7||[];if(_0x55fd9d){return db[_0x4f14('0x6b')]['findAll']({'where':{'id':_0x1e7c95[_0x4f14('0x4f')]['ids']},'attributes':['id','name',_0x4f14('0x6d'),'voicePause','interface'],'raw':!![]});}})[_0x4f14('0x25')](function(_0x5c55ee){if(!_['isEmpty'](_0x5c55ee)){var _0x50970d=[];for(var _0x183d8c=0x0;_0x183d8c<_0x5c55ee[_0x4f14('0x3d')];_0x183d8c++){if(_0x5c55ee[_0x183d8c][_0x4f14('0x6d')]){_0x50970d['push'](db[_0x4f14('0x74')][_0x4f14('0x75')]({'membername':_0x5c55ee[_0x183d8c][_0x4f14('0x30')],'UserId':_0x5c55ee[_0x183d8c]['id'],'queue_name':_0x55fd9d[_0x4f14('0x30')],'VoiceQueueId':_0x55fd9d['id'],'interface':_[_0x4f14('0x76')](_0x5c55ee[_0x183d8c]['interface'])?util[_0x4f14('0x78')](_0x4f14('0x79'),_0x5c55ee[_0x183d8c][_0x4f14('0x30')]):_0x5c55ee[_0x183d8c][_0x4f14('0x77')],'paused':_0x5c55ee[_0x183d8c][_0x4f14('0x95')]||![],'penalty':_0x1e7c95[_0x4f14('0x4f')][_0x4f14('0x6f')]||0x0}));}}return BPromise['all'](_0x50970d);}})[_0x4f14('0x25')](function(){return _0x3e795c;})['then'](respondWithResult(_0x1673db,null))[_0x4f14('0x4d')](handleError(_0x1673db,null));};exports[_0x4f14('0x96')]=function(_0x32d913,_0xa57d37,_0x23e2b5){return db[_0x4f14('0x49')][_0x4f14('0x2f')]({'where':{'id':_0x32d913[_0x4f14('0x57')]['id']}})['then'](handleEntityNotFound(_0xa57d37,null))[_0x4f14('0x25')](function(_0x2c977b){if(_0x2c977b){return _0x2c977b[_0x4f14('0x96')](_0x32d913[_0x4f14('0x37')][_0x4f14('0x7c')])[_0x4f14('0x25')](function(){if(_[_0x4f14('0x97')](_0x32d913[_0x4f14('0x37')][_0x4f14('0x7c')])){for(var _0x5b2dfd=0x0;_0x5b2dfd<_0x32d913[_0x4f14('0x37')]['ids'][_0x4f14('0x3d')];_0x5b2dfd+=0x1){socket[_0x4f14('0x7a')](_0x4f14('0x90'),{'UserId':Number(_0x32d913[_0x4f14('0x37')][_0x4f14('0x7c')][_0x5b2dfd]),'VoiceQueueId':Number(_0x32d913['params']['id'])});}}else{socket[_0x4f14('0x7a')]('userVoiceQueue:remove',{'UserId':Number(_0x32d913['query'][_0x4f14('0x7c')]),'VoiceQueueId':Number(_0x32d913['params']['id'])});}});}})['then'](function(_0x22317c){return db[_0x4f14('0x74')][_0x4f14('0x26')]({'where':{'VoiceQueueId':_0x32d913[_0x4f14('0x57')]['id'],'UserId':_0x32d913[_0x4f14('0x37')]['ids']}})['then'](function(){return _0x22317c;});})[_0x4f14('0x25')](respondWithStatusCode(_0xa57d37,null))['catch'](handleError(_0xa57d37,null));};exports['getAgents']=function(_0x56d822,_0x5c04f8,_0x2a08d9){var _0x4eb90f={};var _0x2242fe={};var _0x55366d;var _0xc21ab8;return db[_0x4f14('0x49')][_0x4f14('0x60')]({'where':{'id':_0x56d822['params']['id']}})[_0x4f14('0x25')](handleEntityNotFound(_0x5c04f8,null))['then'](function(_0x24ee6d){if(_0x24ee6d){_0x55366d=_0x24ee6d;_0x2242fe[_0x4f14('0x3a')]=_['keys'](db[_0x4f14('0x6b')][_0x4f14('0x35')]);_0x2242fe['query']=_[_0x4f14('0x36')](_0x56d822['query']);_0x2242fe[_0x4f14('0x38')]=_[_0x4f14('0x39')](_0x2242fe[_0x4f14('0x3a')],_0x2242fe['query']);_0x4eb90f[_0x4f14('0x3b')]=_[_0x4f14('0x39')](_0x2242fe[_0x4f14('0x3a')],qs[_0x4f14('0x3c')](_0x56d822[_0x4f14('0x37')][_0x4f14('0x3c')]));_0x4eb90f[_0x4f14('0x3b')]=_0x4eb90f[_0x4f14('0x3b')][_0x4f14('0x3d')]?_0x4eb90f[_0x4f14('0x3b')]:_0x2242fe[_0x4f14('0x3a')];_0x4eb90f[_0x4f14('0x40')]=qs[_0x4f14('0x41')](_0x56d822['query'][_0x4f14('0x41')]);_0x4eb90f['where']=qs[_0x4f14('0x38')](_['pick'](_0x56d822[_0x4f14('0x37')],_0x2242fe[_0x4f14('0x38')]));if(_0x56d822[_0x4f14('0x37')][_0x4f14('0x2b')]){_0x4eb90f[_0x4f14('0x42')]=_[_0x4f14('0x44')](_0x4eb90f[_0x4f14('0x42')],{'$or':_[_0x4f14('0x2c')](_0x4eb90f[_0x4f14('0x3b')],function(_0x367f58){var _0x416f74={};_0x416f74[_0x367f58]={'$like':'%'+_0x56d822[_0x4f14('0x37')][_0x4f14('0x2b')]+'%'};return _0x416f74;})});}_0x4eb90f=_['merge']({},_0x4eb90f,_0x56d822[_0x4f14('0x48')]);return _0x55366d[_0x4f14('0x98')](_0x4eb90f);}})['then'](function(_0x25b864){if(_0x25b864){_0xc21ab8=_0x25b864[_0x4f14('0x3d')];if(!_0x56d822[_0x4f14('0x37')][_0x4f14('0x3e')]('nolimit')){_0x4eb90f[_0x4f14('0x1e')]=qs[_0x4f14('0x1e')](_0x56d822[_0x4f14('0x37')]['limit']);_0x4eb90f[_0x4f14('0x1d')]=qs[_0x4f14('0x1d')](_0x56d822[_0x4f14('0x37')][_0x4f14('0x1d')]);}return _0x55366d['getAgents'](_0x4eb90f);}})[_0x4f14('0x25')](function(_0x5db498){if(_0x5db498){return _0x5db498?{'count':_0xc21ab8,'rows':_0x5db498}:null;}})['then'](respondWithResult(_0x5c04f8,null))[_0x4f14('0x4d')](handleError(_0x5c04f8,null));};exports['getMembers']=function(_0x390826,_0x97e722,_0x114ceb){var _0x2807df={};var _0x5864c3={};var _0x51b35b;var _0x111512;return db[_0x4f14('0x49')]['findOne']({'where':{'id':_0x390826['params']['id']}})[_0x4f14('0x25')](handleEntityNotFound(_0x97e722,null))['then'](function(_0x32a1c1){if(_0x32a1c1){_0x51b35b=_0x32a1c1;_0x5864c3[_0x4f14('0x3a')]=_[_0x4f14('0x36')](db[_0x4f14('0x74')][_0x4f14('0x35')]);_0x5864c3[_0x4f14('0x37')]=_[_0x4f14('0x36')](_0x390826[_0x4f14('0x37')]);_0x5864c3[_0x4f14('0x38')]=_[_0x4f14('0x39')](_0x5864c3[_0x4f14('0x3a')],_0x5864c3['query']);_0x2807df[_0x4f14('0x3b')]=_['intersection'](_0x5864c3[_0x4f14('0x3a')],qs[_0x4f14('0x3c')](_0x390826[_0x4f14('0x37')][_0x4f14('0x3c')]));_0x2807df['attributes']=_0x2807df[_0x4f14('0x3b')]['length']?_0x2807df[_0x4f14('0x3b')]:_0x5864c3[_0x4f14('0x3a')];_0x2807df[_0x4f14('0x40')]=qs['sort'](_0x390826[_0x4f14('0x37')][_0x4f14('0x41')]);_0x2807df[_0x4f14('0x42')]=qs[_0x4f14('0x38')](_[_0x4f14('0x43')](_0x390826['query'],_0x5864c3[_0x4f14('0x38')]));if(_0x390826['query'][_0x4f14('0x2b')]){_0x2807df[_0x4f14('0x42')]=_[_0x4f14('0x44')](_0x2807df[_0x4f14('0x42')],{'$or':_[_0x4f14('0x2c')](_0x2807df[_0x4f14('0x3b')],function(_0x2fb7b5){var _0xe9e604={};_0xe9e604[_0x2fb7b5]={'$like':'%'+_0x390826[_0x4f14('0x37')]['filter']+'%'};return _0xe9e604;})});}_0x2807df=_[_0x4f14('0x44')]({},_0x2807df,_0x390826[_0x4f14('0x48')]);return _0x51b35b['getMembers'](_0x2807df);}})[_0x4f14('0x25')](function(_0x4b718d){if(_0x4b718d){_0x111512=_0x4b718d[_0x4f14('0x3d')];if(!_0x390826['query'][_0x4f14('0x3e')](_0x4f14('0x3f'))){_0x2807df[_0x4f14('0x1e')]=qs['limit'](_0x390826['query'][_0x4f14('0x1e')]);_0x2807df[_0x4f14('0x1d')]=qs[_0x4f14('0x1d')](_0x390826['query']['offset']);}return _0x51b35b['getMembers'](_0x2807df);}})[_0x4f14('0x25')](function(_0x24c26a){return _0x24c26a?{'count':_0x111512,'rows':_0x24c26a}:null;})[_0x4f14('0x25')](respondWithResult(_0x97e722,null))[_0x4f14('0x4d')](handleError(_0x97e722,null));};exports[_0x4f14('0x99')]=function(_0x106ff2,_0x1711ee,_0x4b0657){var _0x2da25d={};var _0x59dafc={};var _0x293b3c;var _0x21f95c;return db['VoiceQueue'][_0x4f14('0x60')]({'where':{'id':_0x106ff2[_0x4f14('0x57')]['id']}})['then'](handleEntityNotFound(_0x1711ee,null))[_0x4f14('0x25')](function(_0x253a52){if(_0x253a52){_0x293b3c=_0x253a52;_0x59dafc[_0x4f14('0x3a')]=_['keys'](db['CmList'][_0x4f14('0x35')]);_0x59dafc[_0x4f14('0x37')]=_['keys'](_0x106ff2['query']);_0x59dafc['filters']=_['intersection'](_0x59dafc[_0x4f14('0x3a')],_0x59dafc[_0x4f14('0x37')]);_0x2da25d['attributes']=_['intersection'](_0x59dafc[_0x4f14('0x3a')],qs['fields'](_0x106ff2['query'][_0x4f14('0x3c')]));_0x2da25d[_0x4f14('0x3b')]=_0x2da25d[_0x4f14('0x3b')]['length']?_0x2da25d[_0x4f14('0x3b')]:_0x59dafc['model'];_0x2da25d['order']=qs[_0x4f14('0x41')](_0x106ff2[_0x4f14('0x37')][_0x4f14('0x41')]);_0x2da25d[_0x4f14('0x42')]=qs['filters'](_[_0x4f14('0x43')](_0x106ff2[_0x4f14('0x37')],_0x59dafc[_0x4f14('0x38')]));if(_0x106ff2[_0x4f14('0x37')][_0x4f14('0x2b')]){_0x2da25d[_0x4f14('0x42')]=_[_0x4f14('0x44')](_0x2da25d[_0x4f14('0x42')],{'$or':_[_0x4f14('0x2c')](_0x2da25d[_0x4f14('0x3b')],function(_0x1a60f0){var _0x2fc1fe={};_0x2fc1fe[_0x1a60f0]={'$like':'%'+_0x106ff2['query'][_0x4f14('0x2b')]+'%'};return _0x2fc1fe;})});}_0x2da25d=_[_0x4f14('0x44')]({},_0x2da25d,_0x106ff2[_0x4f14('0x48')]);return _0x293b3c['getLists'](_0x2da25d);}})[_0x4f14('0x25')](function(_0x787777){if(_0x787777){_0x21f95c=_0x787777[_0x4f14('0x3d')];if(!_0x106ff2[_0x4f14('0x37')][_0x4f14('0x3e')](_0x4f14('0x3f'))){_0x2da25d[_0x4f14('0x1e')]=qs[_0x4f14('0x1e')](_0x106ff2[_0x4f14('0x37')][_0x4f14('0x1e')]);_0x2da25d[_0x4f14('0x1d')]=qs['offset'](_0x106ff2[_0x4f14('0x37')][_0x4f14('0x1d')]);}return _0x293b3c[_0x4f14('0x99')](_0x2da25d);}})[_0x4f14('0x25')](function(_0x5a2a87){if(_0x5a2a87){return _0x5a2a87?{'count':_0x21f95c,'rows':_0x5a2a87}:null;}})[_0x4f14('0x25')](respondWithResult(_0x1711ee,null))[_0x4f14('0x4d')](handleError(_0x1711ee,null));};exports['addLists']=function(_0x2bbd39,_0x194e0b,_0x47b360){var _0x4d89fc,_0x29b730;return db[_0x4f14('0x49')][_0x4f14('0x2f')]({'where':{'id':_0x2bbd39[_0x4f14('0x57')]['id']}})[_0x4f14('0x25')](handleEntityNotFound(_0x194e0b,null))[_0x4f14('0x25')](function(_0x402bb4){if(_0x402bb4){_0x29b730=_0x402bb4;return _0x402bb4[_0x4f14('0x9a')](_0x2bbd39[_0x4f14('0x4f')][_0x4f14('0x7c')],_[_0x4f14('0x92')](_0x2bbd39[_0x4f14('0x4f')],[_0x4f14('0x7c'),'id'])||{});}return null;})[_0x4f14('0x93')](function(_0x2ab08a){var _0x33b3bc;_0x4d89fc=_0x2ab08a||[];var _0x1b4ff8=[];if(_0x2ab08a){for(var _0x41a491=0x0;_0x41a491<_0x2ab08a[_0x4f14('0x3d')];_0x41a491+=0x1){var _0x2bc671=_0x2ab08a[_0x41a491][_0x4f14('0x27')]({'plain':!![]});_0x29b730['dialCheckDuplicateType']=_0x2bbd39[_0x4f14('0x4f')][_0x4f14('0x9b')]?_0x2bbd39[_0x4f14('0x4f')][_0x4f14('0x9b')]:_0x29b730[_0x4f14('0x9b')];switch(_0x29b730[_0x4f14('0x9b')]){case'always':_0x33b3bc=squel[_0x4f14('0x9c')]()[_0x4f14('0x9d')]('cm_hopper')['fromQuery']([_0x4f14('0x9e'),'scheduledAt','ContactId','ListId',_0x4f14('0x61'),'createdAt','updatedAt'],squel['select']()['field']('phone','phone')[_0x4f14('0x47')](_0x4f14('0x9f'),_0x4f14('0xa0'))[_0x4f14('0x47')]('id','ContactId')[_0x4f14('0x47')](_0x2bc671[_0x4f14('0xa1')][_0x4f14('0x85')](),_0x4f14('0xa2'))[_0x4f14('0x47')](_0x2bbd39[_0x4f14('0x57')]['id'][_0x4f14('0x85')](),_0x4f14('0x61'))[_0x4f14('0x47')](_0x4f14('0x9f'),_0x4f14('0x58'))[_0x4f14('0x47')](_0x4f14('0x9f'),_0x4f14('0x59'))[_0x4f14('0x7f')]('cm_contacts')['where'](_0x4f14('0xa3'))[_0x4f14('0x42')]('ListId\x20=\x20?',_0x2bc671[_0x4f14('0xa1')][_0x4f14('0x85')]())[_0x4f14('0x42')](_0x4f14('0xa4'))[_0x4f14('0x42')](_0x4f14('0xa5'),squel['select']()[_0x4f14('0x47')](_0x4f14('0xa6'))['from'](_0x4f14('0xa7'))['where']('VoiceQueueId\x20=\x20?',_0x2bbd39[_0x4f14('0x57')]['id'][_0x4f14('0x85')]()))['where'](_0x4f14('0xa5'),squel[_0x4f14('0x7d')]()[_0x4f14('0x47')](_0x4f14('0xa8'))[_0x4f14('0x7f')](_0x4f14('0xa9'))[_0x4f14('0x42')]('VoiceQueueId\x20=\x20?',_0x2bbd39[_0x4f14('0x57')]['id'][_0x4f14('0x85')]())))[_0x4f14('0x85')]();break;case'onlyIfOpen':_0x33b3bc=squel[_0x4f14('0x9c')]()[_0x4f14('0x9d')](_0x4f14('0xa9'))[_0x4f14('0xaa')]([_0x4f14('0x9e'),_0x4f14('0xa0'),_0x4f14('0xab'),_0x4f14('0xa2'),_0x4f14('0x61'),_0x4f14('0x58'),_0x4f14('0x59')],squel[_0x4f14('0x7d')]()['field'](_0x4f14('0x9e'),_0x4f14('0x9e'))[_0x4f14('0x47')](_0x4f14('0x9f'),_0x4f14('0xa0'))['field']('id','ContactId')['field'](_0x2bc671[_0x4f14('0xa1')][_0x4f14('0x85')](),'ListId')[_0x4f14('0x47')](_0x2bbd39[_0x4f14('0x57')]['id'][_0x4f14('0x85')](),_0x4f14('0x61'))['field']('NOW()',_0x4f14('0x58'))['field'](_0x4f14('0x9f'),_0x4f14('0x59'))[_0x4f14('0x7f')](_0x4f14('0xac'))[_0x4f14('0x42')]('deletedAt\x20IS\x20NULL')['where'](_0x4f14('0xad'),_0x2bc671[_0x4f14('0xa1')]['toString']())[_0x4f14('0x42')](_0x4f14('0xa4'))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0x4f14('0x7f')]('cm_hopper')[_0x4f14('0x42')]('VoiceQueueId\x20=\x20?',_0x2bbd39['params']['id'][_0x4f14('0x85')]())))[_0x4f14('0x85')]();break;default:_0x33b3bc=squel[_0x4f14('0x9c')]()[_0x4f14('0x9d')](_0x4f14('0xa9'))[_0x4f14('0xaa')]([_0x4f14('0x9e'),_0x4f14('0xa0'),_0x4f14('0xab'),'ListId',_0x4f14('0x61'),_0x4f14('0x58'),_0x4f14('0x59')],squel['select']()[_0x4f14('0x47')](_0x4f14('0x9e'),_0x4f14('0x9e'))[_0x4f14('0x47')](_0x4f14('0x9f'),_0x4f14('0xa0'))['field']('id',_0x4f14('0xab'))[_0x4f14('0x47')](_0x2bc671[_0x4f14('0xa1')][_0x4f14('0x85')](),'ListId')[_0x4f14('0x47')](_0x2bbd39[_0x4f14('0x57')]['id'][_0x4f14('0x85')](),_0x4f14('0x61'))[_0x4f14('0x47')](_0x4f14('0x9f'),'createdAt')[_0x4f14('0x47')]('NOW()',_0x4f14('0x59'))['from'](_0x4f14('0xac'))['where']('deletedAt\x20IS\x20NULL')[_0x4f14('0x42')]('ListId\x20=\x20?',_0x2bc671[_0x4f14('0xa1')][_0x4f14('0x85')]())[_0x4f14('0x42')](_0x4f14('0xa4')))[_0x4f14('0x85')]();}_0x1b4ff8['push'](db[_0x4f14('0x86')]['query'](_0x33b3bc));}return BPromise['all'](_0x1b4ff8);}})['then'](function(){return _0x4d89fc;})[_0x4f14('0x25')](respondWithResult(_0x194e0b,null))[_0x4f14('0x4d')](handleError(_0x194e0b,null));};exports[_0x4f14('0xae')]=function(_0x214f9b,_0x61eed0,_0x565dc1){return db[_0x4f14('0x49')][_0x4f14('0x2f')]({'where':{'id':_0x214f9b[_0x4f14('0x57')]['id']}})[_0x4f14('0x25')](handleEntityNotFound(_0x61eed0,null))['then'](function(_0x297efe){if(_0x297efe){return _0x297efe[_0x4f14('0xae')](_0x214f9b['query'][_0x4f14('0x7c')]);}})[_0x4f14('0x25')](function(_0x20bfd1){if(_0x20bfd1){return db['CmHopper']['destroy']({'where':{'ListId':_0x214f9b[_0x4f14('0x37')]['ids'],'VoiceQueueId':_0x214f9b[_0x4f14('0x57')]['id']}})[_0x4f14('0x25')](function(){return _0x20bfd1;});}})[_0x4f14('0x25')](respondWithStatusCode(_0x61eed0,null))[_0x4f14('0x4d')](handleError(_0x61eed0,null));};exports[_0x4f14('0xaf')]=function(_0x2859e2,_0x2abaaf,_0x4e7b5c){var _0x561a49={};var _0x19b35a={};var _0x2f4d38;var _0x533015;return db[_0x4f14('0x49')][_0x4f14('0x60')]({'where':{'id':_0x2859e2['params']['id']}})[_0x4f14('0x25')](handleEntityNotFound(_0x2abaaf,null))[_0x4f14('0x25')](function(_0x17672a){if(_0x17672a){_0x2f4d38=_0x17672a;_0x19b35a[_0x4f14('0x3a')]=_[_0x4f14('0x36')](db[_0x4f14('0xb0')][_0x4f14('0x35')]);_0x19b35a[_0x4f14('0x37')]=_[_0x4f14('0x36')](_0x2859e2[_0x4f14('0x37')]);_0x19b35a[_0x4f14('0x38')]=_['intersection'](_0x19b35a[_0x4f14('0x3a')],_0x19b35a['query']);_0x561a49[_0x4f14('0x3b')]=_[_0x4f14('0x39')](_0x19b35a[_0x4f14('0x3a')],qs['fields'](_0x2859e2[_0x4f14('0x37')][_0x4f14('0x3c')]));_0x561a49[_0x4f14('0x3b')]=_0x561a49[_0x4f14('0x3b')][_0x4f14('0x3d')]?_0x561a49[_0x4f14('0x3b')]:_0x19b35a['model'];_0x561a49['order']=qs[_0x4f14('0x41')](_0x2859e2[_0x4f14('0x37')][_0x4f14('0x41')]);_0x561a49[_0x4f14('0x42')]=qs[_0x4f14('0x38')](_[_0x4f14('0x43')](_0x2859e2[_0x4f14('0x37')],_0x19b35a[_0x4f14('0x38')]));if(_0x2859e2[_0x4f14('0x37')]['filter']){_0x561a49[_0x4f14('0x42')]=_[_0x4f14('0x44')](_0x561a49[_0x4f14('0x42')],{'$or':_[_0x4f14('0x2c')](_0x561a49['attributes'],function(_0x1fcb4e){var _0xcc8341={};_0xcc8341[_0x1fcb4e]={'$like':'%'+_0x2859e2[_0x4f14('0x37')][_0x4f14('0x2b')]+'%'};return _0xcc8341;})});}_0x561a49=_['merge']({},_0x561a49,_0x2859e2['options']);return _0x2f4d38['getBlackLists'](_0x561a49);}})['then'](function(_0x18db38){if(_0x18db38){_0x533015=_0x18db38['length'];if(!_0x2859e2[_0x4f14('0x37')][_0x4f14('0x3e')](_0x4f14('0x3f'))){_0x561a49[_0x4f14('0x1e')]=qs[_0x4f14('0x1e')](_0x2859e2[_0x4f14('0x37')][_0x4f14('0x1e')]);_0x561a49[_0x4f14('0x1d')]=qs[_0x4f14('0x1d')](_0x2859e2[_0x4f14('0x37')][_0x4f14('0x1d')]);}return _0x2f4d38[_0x4f14('0xaf')](_0x561a49);}})[_0x4f14('0x25')](function(_0x389997){if(_0x389997){return _0x389997?{'count':_0x533015,'rows':_0x389997}:null;}})[_0x4f14('0x25')](respondWithResult(_0x2abaaf,null))[_0x4f14('0x4d')](handleError(_0x2abaaf,null));};exports[_0x4f14('0xb1')]=function(_0x3cf628,_0x1c2c89,_0x2d3fb2){var _0x5ab07c,_0x2f50d7;return db['VoiceQueue']['find']({'where':{'id':_0x3cf628[_0x4f14('0x57')]['id']}})[_0x4f14('0x25')](handleEntityNotFound(_0x1c2c89,null))[_0x4f14('0x25')](function(_0x2eed41){if(_0x2eed41){_0x2f50d7=_0x2eed41;return _0x2eed41[_0x4f14('0xb1')](_0x3cf628[_0x4f14('0x4f')][_0x4f14('0x7c')],_[_0x4f14('0x92')](_0x3cf628[_0x4f14('0x4f')],[_0x4f14('0x7c'),'id'])||{});}return null;})[_0x4f14('0x93')](function(_0x36eef2){var _0x43f01b;_0x5ab07c=_0x36eef2||[];var _0x2ac99c=[];if(_0x36eef2){for(var _0x282267=0x0;_0x282267<_0x36eef2[_0x4f14('0x3d')];_0x282267+=0x1){var _0x201105=_0x36eef2[_0x282267]['get']({'plain':!![]});_0x43f01b=squel[_0x4f14('0x9c')]()[_0x4f14('0x9d')](_0x4f14('0xb2'))[_0x4f14('0xaa')]([_0x4f14('0x9e'),_0x4f14('0xab'),_0x4f14('0xa2'),'VoiceQueueId',_0x4f14('0x58'),'updatedAt'],squel[_0x4f14('0x7d')]()[_0x4f14('0x47')](_0x4f14('0x9e'),_0x4f14('0x9e'))[_0x4f14('0x47')]('id','ContactId')['field'](_0x201105['CmListId'][_0x4f14('0x85')](),'ListId')[_0x4f14('0x47')](_0x3cf628[_0x4f14('0x57')]['id']['toString'](),_0x4f14('0x61'))['field']('NOW()',_0x4f14('0x58'))[_0x4f14('0x47')](_0x4f14('0x9f'),'updatedAt')[_0x4f14('0x7f')](_0x4f14('0xac'))['where']('deletedAt\x20IS\x20NULL')[_0x4f14('0x42')](_0x4f14('0xad'),_0x201105['CmListId'][_0x4f14('0x85')]())[_0x4f14('0x42')]('phone\x20IS\x20NOT\x20NULL'))[_0x4f14('0x85')]();_0x2ac99c[_0x4f14('0x84')](db['sequelize'][_0x4f14('0x37')](_0x43f01b));}return BPromise[_0x4f14('0x8c')](_0x2ac99c);}})[_0x4f14('0x25')](function(){return _0x5ab07c;})[_0x4f14('0x25')](respondWithResult(_0x1c2c89,null))[_0x4f14('0x4d')](handleError(_0x1c2c89,null));};exports[_0x4f14('0xb3')]=function(_0xba7c81,_0x257cc7,_0x1a1bb4){return db['VoiceQueue'][_0x4f14('0x2f')]({'where':{'id':_0xba7c81[_0x4f14('0x57')]['id']}})['then'](handleEntityNotFound(_0x257cc7,null))[_0x4f14('0x25')](function(_0x32f9a1){if(_0x32f9a1){return _0x32f9a1[_0x4f14('0xb3')](_0xba7c81['query'][_0x4f14('0x7c')]);}})[_0x4f14('0x25')](function(_0x4b742a){if(_0x4b742a){return db[_0x4f14('0x66')][_0x4f14('0x26')]({'where':{'ListId':_0xba7c81[_0x4f14('0x37')]['ids'],'VoiceQueueId':_0xba7c81[_0x4f14('0x57')]['id']}})[_0x4f14('0x25')](function(){return _0x4b742a;});}})['then'](respondWithStatusCode(_0x257cc7,null))[_0x4f14('0x4d')](handleError(_0x257cc7,null));}; \ No newline at end of file +var _0x2de0=['fromQuery','phone','scheduledAt','ContactId','field','NOW()','CmListId','toString','ListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','ListId\x20=\x20?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','redis','defaults','localhost','./voiceQueue.socket','register','sendStatus','status','end','json','offset','limit','Content-Range','reject','save','update','then','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','stack','index','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','merge','key','VIRTUAL','options','include','VoiceQueue','findAll','catch','rawAttributes','includeAll','create','user','get','VoiceQueues','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','body','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','params','getHoppers','CmHopper','order','count','rows','getHopperHistories','findOne','CmHopperHistory','hasOwnProperty','VoiceQueueId','CmHopperFinal','CmHopperBlack','Team','getTeams','addTeams','teams','User','Agents','voicePause','interface','forEach','penalty','sequelize','transaction','findOrCreate','each','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','SELECT','all','union','compact','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','spread','online','isEmpty','upsert','isNil','removeAgents','isArray','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','always','insert','into'];(function(_0x9cd4d7,_0x3ae015){var _0x17bb28=function(_0x2bb44a){while(--_0x2bb44a){_0x9cd4d7['push'](_0x9cd4d7['shift']());}};_0x17bb28(++_0x3ae015);}(_0x2de0,0x17d));var _0x02de=function(_0x5f3a4f,_0x4e6780){_0x5f3a4f=_0x5f3a4f-0x0;var _0x349c98=_0x2de0[_0x5f3a4f];return _0x349c98;};'use strict';var pdf=require(_0x02de('0x0'));var emlformat=require(_0x02de('0x1'));var rimraf=require(_0x02de('0x2'));var zipdir=require(_0x02de('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x02de('0x4'));var moment=require(_0x02de('0x5'));var BPromise=require(_0x02de('0x6'));var Mustache=require(_0x02de('0x7'));var util=require(_0x02de('0x8'));var path=require(_0x02de('0x9'));var sox=require(_0x02de('0xa'));var csv=require(_0x02de('0xb'));var ejs=require(_0x02de('0xc'));var fs=require('fs');var _=require(_0x02de('0xd'));var squel=require(_0x02de('0xe'));var crypto=require(_0x02de('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x02de('0x10'));var Papa=require('papaparse');var Redis=require(_0x02de('0x11'));var authService=require(_0x02de('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x02de('0x13'));var utils=require(_0x02de('0x14'));var config=require(_0x02de('0x15'));var db=require('../../mysqldb')['db'];config[_0x02de('0x16')]=_[_0x02de('0x17')](config['redis'],{'host':_0x02de('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x02de('0x16')]));require(_0x02de('0x19'))[_0x02de('0x1a')](socket);function respondWithStatusCode(_0x1160dd,_0x8b44b4){_0x8b44b4=_0x8b44b4||0xcc;return function(_0x492e37){if(_0x492e37){return _0x1160dd[_0x02de('0x1b')](_0x8b44b4);}return _0x1160dd[_0x02de('0x1c')](_0x8b44b4)[_0x02de('0x1d')]();};}function respondWithResult(_0x27584a,_0xff29c1){_0xff29c1=_0xff29c1||0xc8;return function(_0x2e5110){if(_0x2e5110){return _0x27584a[_0x02de('0x1c')](_0xff29c1)[_0x02de('0x1e')](_0x2e5110);}};}function respondWithFilteredResult(_0x2f7d55,_0x17646a){return function(_0x4899ff){if(_0x4899ff){var _0x2a3327=_0x4899ff['count'],_0x2aca88=_0x17646a[_0x02de('0x1f')],_0x30a6cf=_0x17646a[_0x02de('0x1f')]+_0x17646a[_0x02de('0x20')],_0x3b9243;if(_0x30a6cf>=_0x2a3327){_0x30a6cf=_0x2a3327;_0x3b9243=0xc8;}else{_0x3b9243=0xce;}_0x2f7d55[_0x02de('0x1c')](_0x3b9243);return _0x2f7d55['set'](_0x02de('0x21'),_0x2aca88+'-'+_0x30a6cf+'/'+_0x2a3327)['json'](_0x4899ff);}return null;};}function patchUpdates(_0x286bef){return function(_0x39b624){try{jsonpatch['apply'](_0x39b624,_0x286bef,!![]);}catch(_0x373055){return BPromise[_0x02de('0x22')](_0x373055);}return _0x39b624[_0x02de('0x23')]();};}function saveUpdates(_0xdeeaf6,_0x46d15e){return function(_0x22a179){if(_0x22a179){return _0x22a179[_0x02de('0x24')](_0xdeeaf6)[_0x02de('0x25')](function(_0x2668c2){return _0x2668c2;});}return null;};}function removeEntity(_0x50c6d1,_0x4eb390){return function(_0x729853){if(_0x729853){return _0x729853['destroy']()['then'](function(){var _0x2c98c3=_0x729853['get']({'plain':!![]});var _0x579598=[{'name':'VoiceQueues','value':_0x02de('0x26'),'ignore':![]},{'name':_0x02de('0x27'),'value':_0x02de('0x28'),'ignore':![]}];var _0x2071ce=_(_0x579598)[_0x02de('0x29')](_0x02de('0x2a'))[_0x02de('0x2b')](_0x02de('0x2c'))['value']();if(_[_0x02de('0x2d')](_0x2071ce,_0x2c98c3[_0x02de('0x2e')])){return;}var _0x5d9361=_[_0x02de('0x2f')](_0x579598,['value',_0x2c98c3[_0x02de('0x2e')]])[_0x02de('0x30')];return db[_0x02de('0x31')][_0x02de('0x32')]({'where':{'type':_0x5d9361,'resourceId':_0x2c98c3['id']}})[_0x02de('0x25')](function(){return _0x729853;});})[_0x02de('0x25')](function(){_0x50c6d1[_0x02de('0x1c')](0xcc)[_0x02de('0x1d')]();});}};}function handleEntityNotFound(_0x5daab6,_0x30182d){return function(_0x39c3bc){if(!_0x39c3bc){_0x5daab6[_0x02de('0x1b')](0x194);}return _0x39c3bc;};}function handleError(_0x160307,_0x280524){_0x280524=_0x280524||0x1f4;return function(_0x48850d){logger['error'](_0x48850d[_0x02de('0x33')]);if(_0x48850d[_0x02de('0x30')]){delete _0x48850d[_0x02de('0x30')];}_0x160307[_0x02de('0x1c')](_0x280524)['send'](_0x48850d);};}exports[_0x02de('0x34')]=function(_0xe8e25e,_0x249926){var _0x2f2999={},_0x546cd5={},_0x564018={'count':0x0,'rows':[]};var _0x448a0c=db['VoiceQueue']['rawAttributes'];_0x546cd5[_0x02de('0x35')]=_[_0x02de('0x36')](_0x448a0c);_0x546cd5['query']=_[_0x02de('0x36')](_0xe8e25e[_0x02de('0x37')]);_0x546cd5[_0x02de('0x38')]=_[_0x02de('0x39')](_0x546cd5[_0x02de('0x35')],_0x546cd5[_0x02de('0x37')]);_0x2f2999['attributes']=_['intersection'](_0x546cd5[_0x02de('0x35')],qs[_0x02de('0x3a')](_0xe8e25e[_0x02de('0x37')][_0x02de('0x3a')]));_0x2f2999[_0x02de('0x3b')]=_0x2f2999[_0x02de('0x3b')][_0x02de('0x3c')]?_0x2f2999['attributes']:_0x546cd5[_0x02de('0x35')];if(!_0xe8e25e['query']['hasOwnProperty'](_0x02de('0x3d'))){_0x2f2999['limit']=qs[_0x02de('0x20')](_0xe8e25e[_0x02de('0x37')][_0x02de('0x20')]);_0x2f2999['offset']=qs[_0x02de('0x1f')](_0xe8e25e[_0x02de('0x37')][_0x02de('0x1f')]);}_0x2f2999['order']=qs[_0x02de('0x3e')](_0xe8e25e['query'][_0x02de('0x3e')]);_0x2f2999[_0x02de('0x3f')]=qs[_0x02de('0x38')](_[_0x02de('0x40')](_0xe8e25e['query'],_0x546cd5[_0x02de('0x38')]));if(_0xe8e25e[_0x02de('0x37')]['filter']){_0x2f2999['where']=_[_0x02de('0x41')](_0x2f2999[_0x02de('0x3f')],{'$or':_[_0x02de('0x2b')](_0x448a0c,function(_0x4dafdb){if(_0x4dafdb['type'][_0x02de('0x42')]!==_0x02de('0x43')){var _0x78e768={};_0x78e768[_0x4dafdb['field']]={'$like':'%'+_0xe8e25e[_0x02de('0x37')][_0x02de('0x29')]+'%'};return _0x78e768;}})});}_0x2f2999=_[_0x02de('0x41')]({},_0x2f2999,_0xe8e25e[_0x02de('0x44')]);var _0x587237={'where':_0x2f2999['where']};return db['VoiceQueue']['count'](_0x587237)[_0x02de('0x25')](function(_0x5365e4){_0x564018['count']=_0x5365e4;if(_0xe8e25e['query']['includeAll']){_0x2f2999[_0x02de('0x45')]=[{'all':!![]}];}return db[_0x02de('0x46')][_0x02de('0x47')](_0x2f2999);})[_0x02de('0x25')](function(_0x39600b){_0x564018['rows']=_0x39600b;return _0x564018;})[_0x02de('0x25')](respondWithFilteredResult(_0x249926,_0x2f2999))[_0x02de('0x48')](handleError(_0x249926,null));};exports['show']=function(_0x5122fc,_0xb0ec7b){var _0x268b42={'raw':![],'where':{'id':_0x5122fc['params']['id']}},_0x148122={};_0x148122[_0x02de('0x35')]=_[_0x02de('0x36')](db['VoiceQueue'][_0x02de('0x49')]);_0x148122[_0x02de('0x37')]=_['keys'](_0x5122fc[_0x02de('0x37')]);_0x148122[_0x02de('0x38')]=_['intersection'](_0x148122[_0x02de('0x35')],_0x148122[_0x02de('0x37')]);_0x268b42[_0x02de('0x3b')]=_[_0x02de('0x39')](_0x148122[_0x02de('0x35')],qs['fields'](_0x5122fc[_0x02de('0x37')][_0x02de('0x3a')]));_0x268b42[_0x02de('0x3b')]=_0x268b42[_0x02de('0x3b')]['length']?_0x268b42[_0x02de('0x3b')]:_0x148122[_0x02de('0x35')];if(_0x5122fc[_0x02de('0x37')][_0x02de('0x4a')]){_0x268b42['include']=[{'all':!![]}];}_0x268b42=_[_0x02de('0x41')]({},_0x268b42,_0x5122fc[_0x02de('0x44')]);return db['VoiceQueue']['find'](_0x268b42)[_0x02de('0x25')](handleEntityNotFound(_0xb0ec7b,null))[_0x02de('0x25')](respondWithResult(_0xb0ec7b,null))[_0x02de('0x48')](handleError(_0xb0ec7b,null));};exports['create']=function(_0x251072,_0x53bdaa){return db[_0x02de('0x46')][_0x02de('0x4b')](_0x251072['body'],{})[_0x02de('0x25')](function(_0x3ffadf){var _0x3eecf5=_0x251072[_0x02de('0x4c')][_0x02de('0x4d')]({'plain':!![]});if(!_0x3eecf5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3eecf5['role']==='user'){var _0x165474=_0x3ffadf[_0x02de('0x4d')]({'plain':!![]});var _0x57a58b=[{'name':_0x02de('0x4e'),'value':_0x02de('0x26')},{'name':_0x02de('0x27'),'value':_0x02de('0x28')}];var _0x2e4c9c=_[_0x02de('0x2f')](_0x57a58b,['value',_0x165474['type']])[_0x02de('0x30')];return db[_0x02de('0x4f')][_0x02de('0x2f')]({'where':{'name':_0x2e4c9c,'userProfileId':_0x3eecf5['userProfileId']},'raw':!![]})[_0x02de('0x25')](function(_0x188936){if(_0x188936&&_0x188936[_0x02de('0x50')]===0x0){return db['UserProfileResource'][_0x02de('0x4b')]({'name':_0x165474['name'],'resourceId':_0x165474['id'],'type':_0x188936[_0x02de('0x30')],'sectionId':_0x188936['id']},{})[_0x02de('0x25')](function(){return _0x3ffadf;});}else{return _0x3ffadf;}})[_0x02de('0x48')](function(_0x5c4214){logger[_0x02de('0x51')](_0x02de('0x52'),_0x5c4214);throw _0x5c4214;});}return _0x3ffadf;})[_0x02de('0x25')](respondWithResult(_0x53bdaa,0xc9))[_0x02de('0x48')](handleError(_0x53bdaa,null));};exports[_0x02de('0x53')]=function(_0x30ed1c,_0x1b1035){var _0x36c255={'raw':![],'where':{'id':_0x30ed1c['params']['id']}},_0x520b0a={};_0x520b0a['model']=_[_0x02de('0x36')](db[_0x02de('0x46')][_0x02de('0x49')]);_0x36c255['attributes']=_[_0x02de('0x39')](_0x520b0a[_0x02de('0x35')],qs[_0x02de('0x3a')](_0x30ed1c[_0x02de('0x37')][_0x02de('0x3a')]));_0x36c255[_0x02de('0x3b')]=_0x36c255[_0x02de('0x3b')][_0x02de('0x3c')]?_0x36c255[_0x02de('0x3b')]:_0x520b0a[_0x02de('0x35')];if(_0x30ed1c[_0x02de('0x37')][_0x02de('0x4a')]){_0x36c255[_0x02de('0x45')]=[{'all':!![]}];}_0x36c255=_[_0x02de('0x41')]({},_0x36c255,_0x30ed1c[_0x02de('0x44')]);return db[_0x02de('0x46')]['find'](_0x36c255)[_0x02de('0x25')](handleEntityNotFound(_0x1b1035,null))[_0x02de('0x25')](function(_0x4d6d65){if(_0x4d6d65){var _0x22fe23=_0x4d6d65[_0x02de('0x4d')]({'plain':!![]});_0x22fe23=qs[_0x02de('0x54')](_0x22fe23,['id','createdAt',_0x02de('0x55')]);_0x30ed1c[_0x02de('0x56')]=_[_0x02de('0x54')](_0x30ed1c[_0x02de('0x56')],['id',_0x02de('0x57'),_0x02de('0x55')]);return db[_0x02de('0x46')][_0x02de('0x4b')](_[_0x02de('0x41')](_0x22fe23,_0x30ed1c[_0x02de('0x56')]),{'include':_0x30ed1c[_0x02de('0x37')]['includeAll']?[{'all':!![]}]:undefined})[_0x02de('0x25')](function(_0x37fc9e){var _0x494286=_0x30ed1c[_0x02de('0x4c')][_0x02de('0x4d')]({'plain':!![]});if(!_0x494286)throw new Error(_0x02de('0x58'));if(_0x494286['role']===_0x02de('0x4c')){var _0x1905c7=_0x37fc9e[_0x02de('0x4d')]({'plain':!![]});var _0x263c0f=[{'name':_0x02de('0x4e'),'value':_0x02de('0x26')},{'name':'QueueCampaigns','value':_0x02de('0x28')}];var _0x26bcf0=_['find'](_0x263c0f,[_0x02de('0x2c'),_0x1905c7[_0x02de('0x2e')]])[_0x02de('0x30')];return db['UserProfileSection'][_0x02de('0x2f')]({'where':{'name':_0x26bcf0,'userProfileId':_0x494286[_0x02de('0x59')]},'raw':!![]})[_0x02de('0x25')](function(_0x4d568d){if(_0x4d568d&&_0x4d568d['autoAssociation']===0x0){return db[_0x02de('0x31')][_0x02de('0x4b')]({'name':_0x1905c7[_0x02de('0x30')],'resourceId':_0x1905c7['id'],'type':_0x4d568d[_0x02de('0x30')],'sectionId':_0x4d568d['id']},{})[_0x02de('0x25')](function(){return _0x37fc9e;});}else{return _0x37fc9e;}})[_0x02de('0x48')](function(_0x7c4c0c){logger[_0x02de('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7c4c0c);throw _0x7c4c0c;});}return _0x37fc9e;});}})[_0x02de('0x25')](respondWithResult(_0x1b1035,0xc9))[_0x02de('0x48')](handleError(_0x1b1035,null));};exports[_0x02de('0x24')]=function(_0x3b9d4d,_0x2e5b45){if(_0x3b9d4d[_0x02de('0x56')]['id']){delete _0x3b9d4d[_0x02de('0x56')]['id'];}return db['VoiceQueue'][_0x02de('0x2f')]({'where':{'id':_0x3b9d4d[_0x02de('0x5a')]['id']}})[_0x02de('0x25')](handleEntityNotFound(_0x2e5b45,null))[_0x02de('0x25')](saveUpdates(_0x3b9d4d[_0x02de('0x56')],null))[_0x02de('0x25')](respondWithResult(_0x2e5b45,null))[_0x02de('0x48')](handleError(_0x2e5b45,null));};exports[_0x02de('0x32')]=function(_0x4284b4,_0x36bf72){return db[_0x02de('0x46')][_0x02de('0x2f')]({'where':{'id':_0x4284b4[_0x02de('0x5a')]['id']}})[_0x02de('0x25')](handleEntityNotFound(_0x36bf72,null))[_0x02de('0x25')](removeEntity(_0x36bf72,null))[_0x02de('0x48')](handleError(_0x36bf72,null));};exports[_0x02de('0x5b')]=function(_0x3078fd,_0x2b8bfd,_0xe045e3){var _0x354ace={'raw':![],'where':{}};var _0x43903f={};var _0x44b3f5={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x3078fd[_0x02de('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2b8bfd,null))[_0x02de('0x25')](function(_0x52dfc5){if(_0x52dfc5){_0x43903f[_0x02de('0x35')]=_[_0x02de('0x36')](db[_0x02de('0x5c')][_0x02de('0x49')]);_0x43903f['query']=_['keys'](_0x3078fd['query']);_0x43903f['filters']=_[_0x02de('0x39')](_0x43903f[_0x02de('0x35')],_0x43903f[_0x02de('0x37')]);_0x354ace[_0x02de('0x3b')]=_['intersection'](_0x43903f['model'],qs[_0x02de('0x3a')](_0x3078fd[_0x02de('0x37')][_0x02de('0x3a')]));_0x354ace['attributes']=_0x354ace[_0x02de('0x3b')][_0x02de('0x3c')]?_0x354ace['attributes']:_0x43903f[_0x02de('0x35')];if(!_0x3078fd[_0x02de('0x37')]['hasOwnProperty'](_0x02de('0x3d'))){_0x354ace[_0x02de('0x20')]=qs[_0x02de('0x20')](_0x3078fd[_0x02de('0x37')][_0x02de('0x20')]);_0x354ace[_0x02de('0x1f')]=qs[_0x02de('0x1f')](_0x3078fd[_0x02de('0x37')]['offset']);}_0x354ace[_0x02de('0x5d')]=qs[_0x02de('0x3e')](_0x3078fd[_0x02de('0x37')][_0x02de('0x3e')]);_0x354ace[_0x02de('0x3f')]=qs[_0x02de('0x38')](_[_0x02de('0x40')](_0x3078fd[_0x02de('0x37')],_0x43903f[_0x02de('0x38')]));_0x354ace[_0x02de('0x3f')]['VoiceQueueId']=_0x52dfc5['id'];if(_0x3078fd['query'][_0x02de('0x29')]){_0x354ace[_0x02de('0x3f')]=_['merge'](_0x354ace[_0x02de('0x3f')],{'$or':_['map'](_0x354ace['attributes'],function(_0x4316c5){var _0x3e190d={};_0x3e190d[_0x4316c5]={'$like':'%'+_0x3078fd['query'][_0x02de('0x29')]+'%'};return _0x3e190d;})});}_0x354ace=_[_0x02de('0x41')]({},_0x354ace,_0x3078fd[_0x02de('0x44')]);return db['CmHopper'][_0x02de('0x5e')]({'where':_0x354ace[_0x02de('0x3f')]})[_0x02de('0x25')](function(_0x4db155){_0x44b3f5[_0x02de('0x5e')]=_0x4db155;if(_0x3078fd[_0x02de('0x37')][_0x02de('0x4a')]){_0x354ace['include']=[{'all':!![]}];}return db[_0x02de('0x5c')]['findAll'](_0x354ace);})[_0x02de('0x25')](function(_0x45a395){_0x44b3f5[_0x02de('0x5f')]=_0x45a395;return _0x44b3f5;});}})[_0x02de('0x25')](respondWithFilteredResult(_0x2b8bfd,_0x354ace))['catch'](handleError(_0x2b8bfd,null));};exports[_0x02de('0x60')]=function(_0x236ea2,_0x3cea6a,_0x3853ae){var _0xbff3f={'raw':!![],'where':{}};var _0x2e136b={};var _0x5b1f7d={'count':0x0,'rows':[]};return db[_0x02de('0x46')][_0x02de('0x61')]({'where':{'id':_0x236ea2[_0x02de('0x5a')]['id']}})[_0x02de('0x25')](handleEntityNotFound(_0x3cea6a,null))[_0x02de('0x25')](function(_0x203204){if(_0x203204){_0x2e136b['model']=_['keys'](db[_0x02de('0x62')]['rawAttributes']);_0x2e136b[_0x02de('0x37')]=_[_0x02de('0x36')](_0x236ea2[_0x02de('0x37')]);_0x2e136b[_0x02de('0x38')]=_[_0x02de('0x39')](_0x2e136b[_0x02de('0x35')],_0x2e136b[_0x02de('0x37')]);_0xbff3f[_0x02de('0x3b')]=_[_0x02de('0x39')](_0x2e136b['model'],qs['fields'](_0x236ea2[_0x02de('0x37')]['fields']));_0xbff3f[_0x02de('0x3b')]=_0xbff3f[_0x02de('0x3b')][_0x02de('0x3c')]?_0xbff3f[_0x02de('0x3b')]:_0x2e136b[_0x02de('0x35')];if(!_0x236ea2[_0x02de('0x37')][_0x02de('0x63')](_0x02de('0x3d'))){_0xbff3f[_0x02de('0x20')]=qs[_0x02de('0x20')](_0x236ea2[_0x02de('0x37')][_0x02de('0x20')]);_0xbff3f['offset']=qs['offset'](_0x236ea2['query'][_0x02de('0x1f')]);}_0xbff3f[_0x02de('0x5d')]=qs[_0x02de('0x3e')](_0x236ea2['query'][_0x02de('0x3e')]);_0xbff3f['where']=qs[_0x02de('0x38')](_[_0x02de('0x40')](_0x236ea2[_0x02de('0x37')],_0x2e136b[_0x02de('0x38')]));_0xbff3f[_0x02de('0x3f')][_0x02de('0x64')]=_0x203204['id'];if(_0x236ea2[_0x02de('0x37')]['filter']){_0xbff3f[_0x02de('0x3f')]=_[_0x02de('0x41')](_0xbff3f[_0x02de('0x3f')],{'$or':_[_0x02de('0x2b')](_0xbff3f[_0x02de('0x3b')],function(_0x199954){var _0x8217b7={};_0x8217b7[_0x199954]={'$like':'%'+_0x236ea2[_0x02de('0x37')][_0x02de('0x29')]+'%'};return _0x8217b7;})});}_0xbff3f=_[_0x02de('0x41')]({},_0xbff3f,_0x236ea2[_0x02de('0x44')]);return db['CmHopperHistory']['count']({'where':_0xbff3f[_0x02de('0x3f')]})[_0x02de('0x25')](function(_0xa22dab){_0x5b1f7d[_0x02de('0x5e')]=_0xa22dab;if(_0x236ea2['query'][_0x02de('0x4a')]){_0xbff3f['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x02de('0x47')](_0xbff3f);})[_0x02de('0x25')](function(_0x18c442){_0x5b1f7d[_0x02de('0x5f')]=_0x18c442;return _0x5b1f7d;});}})[_0x02de('0x25')](respondWithFilteredResult(_0x3cea6a,_0xbff3f))['catch'](handleError(_0x3cea6a,null));};exports['getHopperFinals']=function(_0x5b619e,_0x5a683a,_0x18f6ee){var _0xd87192={'raw':!![],'where':{}};var _0x4a779d={};var _0x41098c={'count':0x0,'rows':[]};return db[_0x02de('0x46')][_0x02de('0x61')]({'where':{'id':_0x5b619e['params']['id']}})[_0x02de('0x25')](handleEntityNotFound(_0x5a683a,null))[_0x02de('0x25')](function(_0x3b7d24){if(_0x3b7d24){_0x4a779d['model']=_['keys'](db[_0x02de('0x65')][_0x02de('0x49')]);_0x4a779d[_0x02de('0x37')]=_[_0x02de('0x36')](_0x5b619e[_0x02de('0x37')]);_0x4a779d['filters']=_[_0x02de('0x39')](_0x4a779d[_0x02de('0x35')],_0x4a779d[_0x02de('0x37')]);_0xd87192[_0x02de('0x3b')]=_[_0x02de('0x39')](_0x4a779d[_0x02de('0x35')],qs[_0x02de('0x3a')](_0x5b619e[_0x02de('0x37')][_0x02de('0x3a')]));_0xd87192[_0x02de('0x3b')]=_0xd87192[_0x02de('0x3b')][_0x02de('0x3c')]?_0xd87192[_0x02de('0x3b')]:_0x4a779d[_0x02de('0x35')];if(!_0x5b619e[_0x02de('0x37')][_0x02de('0x63')](_0x02de('0x3d'))){_0xd87192[_0x02de('0x20')]=qs['limit'](_0x5b619e[_0x02de('0x37')][_0x02de('0x20')]);_0xd87192['offset']=qs[_0x02de('0x1f')](_0x5b619e[_0x02de('0x37')]['offset']);}_0xd87192[_0x02de('0x5d')]=qs[_0x02de('0x3e')](_0x5b619e[_0x02de('0x37')]['sort']);_0xd87192[_0x02de('0x3f')]=qs['filters'](_[_0x02de('0x40')](_0x5b619e[_0x02de('0x37')],_0x4a779d[_0x02de('0x38')]));_0xd87192['where'][_0x02de('0x64')]=_0x3b7d24['id'];if(_0x5b619e[_0x02de('0x37')][_0x02de('0x29')]){_0xd87192[_0x02de('0x3f')]=_[_0x02de('0x41')](_0xd87192['where'],{'$or':_[_0x02de('0x2b')](_0xd87192[_0x02de('0x3b')],function(_0x2cd622){var _0x59de68={};_0x59de68[_0x2cd622]={'$like':'%'+_0x5b619e[_0x02de('0x37')]['filter']+'%'};return _0x59de68;})});}_0xd87192=_[_0x02de('0x41')]({},_0xd87192,_0x5b619e[_0x02de('0x44')]);return db[_0x02de('0x65')][_0x02de('0x5e')]({'where':_0xd87192[_0x02de('0x3f')]})[_0x02de('0x25')](function(_0x189d07){_0x41098c[_0x02de('0x5e')]=_0x189d07;if(_0x5b619e[_0x02de('0x37')][_0x02de('0x4a')]){_0xd87192['include']=[{'all':!![]}];}return db[_0x02de('0x65')][_0x02de('0x47')](_0xd87192);})[_0x02de('0x25')](function(_0x594183){_0x41098c[_0x02de('0x5f')]=_0x594183;return _0x41098c;});}})[_0x02de('0x25')](respondWithFilteredResult(_0x5a683a,_0xd87192))[_0x02de('0x48')](handleError(_0x5a683a,null));};exports['getHopperBlacks']=function(_0x59104d,_0x2e770f,_0x42818d){var _0x202b26={'raw':!![],'where':{}};var _0x4c15ff={};var _0x4b966c={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x02de('0x61')]({'where':{'id':_0x59104d[_0x02de('0x5a')]['id']}})[_0x02de('0x25')](handleEntityNotFound(_0x2e770f,null))[_0x02de('0x25')](function(_0xbf83bd){if(_0xbf83bd){_0x4c15ff[_0x02de('0x35')]=_[_0x02de('0x36')](db[_0x02de('0x66')][_0x02de('0x49')]);_0x4c15ff[_0x02de('0x37')]=_[_0x02de('0x36')](_0x59104d[_0x02de('0x37')]);_0x4c15ff[_0x02de('0x38')]=_[_0x02de('0x39')](_0x4c15ff[_0x02de('0x35')],_0x4c15ff['query']);_0x202b26[_0x02de('0x3b')]=_[_0x02de('0x39')](_0x4c15ff['model'],qs[_0x02de('0x3a')](_0x59104d[_0x02de('0x37')][_0x02de('0x3a')]));_0x202b26[_0x02de('0x3b')]=_0x202b26[_0x02de('0x3b')][_0x02de('0x3c')]?_0x202b26[_0x02de('0x3b')]:_0x4c15ff['model'];if(!_0x59104d['query'][_0x02de('0x63')]('nolimit')){_0x202b26[_0x02de('0x20')]=qs[_0x02de('0x20')](_0x59104d[_0x02de('0x37')][_0x02de('0x20')]);_0x202b26['offset']=qs[_0x02de('0x1f')](_0x59104d[_0x02de('0x37')][_0x02de('0x1f')]);}_0x202b26[_0x02de('0x5d')]=qs[_0x02de('0x3e')](_0x59104d[_0x02de('0x37')]['sort']);_0x202b26['where']=qs['filters'](_[_0x02de('0x40')](_0x59104d[_0x02de('0x37')],_0x4c15ff[_0x02de('0x38')]));_0x202b26[_0x02de('0x3f')]['VoiceQueueId']=_0xbf83bd['id'];if(_0x59104d['query'][_0x02de('0x29')]){_0x202b26[_0x02de('0x3f')]=_[_0x02de('0x41')](_0x202b26[_0x02de('0x3f')],{'$or':_[_0x02de('0x2b')](_0x202b26[_0x02de('0x3b')],function(_0x243f90){var _0x3c0e2c={};_0x3c0e2c[_0x243f90]={'$like':'%'+_0x59104d['query'][_0x02de('0x29')]+'%'};return _0x3c0e2c;})});}_0x202b26=_[_0x02de('0x41')]({},_0x202b26,_0x59104d[_0x02de('0x44')]);return db[_0x02de('0x66')][_0x02de('0x5e')]({'where':_0x202b26[_0x02de('0x3f')]})[_0x02de('0x25')](function(_0x354f69){_0x4b966c[_0x02de('0x5e')]=_0x354f69;if(_0x59104d['query'][_0x02de('0x4a')]){_0x202b26[_0x02de('0x45')]=[{'all':!![]}];}return db[_0x02de('0x66')][_0x02de('0x47')](_0x202b26);})[_0x02de('0x25')](function(_0x25f76b){_0x4b966c[_0x02de('0x5f')]=_0x25f76b;return _0x4b966c;});}})[_0x02de('0x25')](respondWithFilteredResult(_0x2e770f,_0x202b26))[_0x02de('0x48')](handleError(_0x2e770f,null));};exports['getTeams']=function(_0x501d8a,_0x282075,_0x4b742f){var _0x406265={};var _0x1e823a={};var _0x1408b9;var _0x3b692a;return db['VoiceQueue'][_0x02de('0x61')]({'where':{'id':_0x501d8a[_0x02de('0x5a')]['id']}})['then'](handleEntityNotFound(_0x282075,null))[_0x02de('0x25')](function(_0x2ea376){if(_0x2ea376){_0x1408b9=_0x2ea376;_0x1e823a['model']=_[_0x02de('0x36')](db[_0x02de('0x67')][_0x02de('0x49')]);_0x1e823a['query']=_[_0x02de('0x36')](_0x501d8a[_0x02de('0x37')]);_0x1e823a[_0x02de('0x38')]=_[_0x02de('0x39')](_0x1e823a[_0x02de('0x35')],_0x1e823a['query']);_0x406265[_0x02de('0x3b')]=_[_0x02de('0x39')](_0x1e823a[_0x02de('0x35')],qs['fields'](_0x501d8a['query'][_0x02de('0x3a')]));_0x406265[_0x02de('0x3b')]=_0x406265[_0x02de('0x3b')]['length']?_0x406265[_0x02de('0x3b')]:_0x1e823a[_0x02de('0x35')];_0x406265[_0x02de('0x5d')]=qs[_0x02de('0x3e')](_0x501d8a['query']['sort']);_0x406265[_0x02de('0x3f')]=qs[_0x02de('0x38')](_['pick'](_0x501d8a[_0x02de('0x37')],_0x1e823a[_0x02de('0x38')]));if(_0x501d8a['query'][_0x02de('0x29')]){_0x406265[_0x02de('0x3f')]=_[_0x02de('0x41')](_0x406265['where'],{'$or':_['map'](_0x406265[_0x02de('0x3b')],function(_0x2ff249){var _0x4267f1={};_0x4267f1[_0x2ff249]={'$like':'%'+_0x501d8a[_0x02de('0x37')][_0x02de('0x29')]+'%'};return _0x4267f1;})});}_0x406265=_[_0x02de('0x41')]({},_0x406265,_0x501d8a[_0x02de('0x44')]);return _0x1408b9['getTeams'](_0x406265);}})['then'](function(_0x490269){if(_0x490269){_0x3b692a=_0x490269['length'];if(!_0x501d8a['query'][_0x02de('0x63')](_0x02de('0x3d'))){_0x406265[_0x02de('0x20')]=qs['limit'](_0x501d8a['query'][_0x02de('0x20')]);_0x406265[_0x02de('0x1f')]=qs[_0x02de('0x1f')](_0x501d8a[_0x02de('0x37')][_0x02de('0x1f')]);}return _0x1408b9[_0x02de('0x68')](_0x406265);}})['then'](function(_0x51ea41){if(_0x51ea41){return _0x51ea41?{'count':_0x3b692a,'rows':_0x51ea41}:null;}})[_0x02de('0x25')](respondWithResult(_0x282075,null))[_0x02de('0x48')](handleError(_0x282075,null));};exports[_0x02de('0x69')]=function(_0x1e16ea,_0x504b31,_0x597630){var _0x21c2da=_0x1e16ea[_0x02de('0x56')][_0x02de('0x6a')];return db[_0x02de('0x67')][_0x02de('0x47')]({'where':{'id':_[_0x02de('0x2b')](_0x21c2da,'id')},'attributes':['id'],'include':[{'model':db[_0x02de('0x6b')],'as':_0x02de('0x6c'),'attributes':['id','name','online',_0x02de('0x6d'),_0x02de('0x6e')],'raw':!![]}]})[_0x02de('0x25')](function(_0x520644){if(_0x520644){var _0x5a725c=_['flatMap'](_0x520644,function(_0x18270a){var _0x367d2c=_0x18270a[_0x02de('0x4d')]({'plain':!![]});_0x367d2c[_0x02de('0x6c')][_0x02de('0x6f')](function(_0x374ec8){_0x374ec8[_0x02de('0x70')]=_[_0x02de('0x2f')](_0x21c2da,{'id':_0x367d2c['id']})[_0x02de('0x70')];});return _0x367d2c[_0x02de('0x6c')];});return db['VoiceQueue']['find']({'where':{'id':_0x1e16ea[_0x02de('0x5a')]['id']}})[_0x02de('0x25')](function(_0x542eae){return db[_0x02de('0x71')][_0x02de('0x72')](function(_0x48e941){return _0x542eae[_0x02de('0x69')](_[_0x02de('0x2b')](_0x21c2da,'id'),{'transaction':_0x48e941})[_0x02de('0x25')](function(){return BPromise['each'](_0x5a725c,function(_0x27991f){return db['UserVoiceQueue'][_0x02de('0x73')]({'where':{'UserId':_0x27991f['id'],'VoiceQueueId':_0x1e16ea[_0x02de('0x5a')]['id']},'defaults':{'penalty':_0x27991f['penalty']},'transaction':_0x48e941});});})[_0x02de('0x25')](function(){return BPromise[_0x02de('0x74')](_[_0x02de('0x29')](_0x5a725c,{'online':!![]}),function(_0x10beba){return db['UserVoiceQueueRt']['upsert']({'membername':_0x10beba[_0x02de('0x30')],'UserId':_0x10beba['id'],'queue_name':_0x542eae[_0x02de('0x30')],'VoiceQueueId':_0x542eae['id'],'interface':_['isNil'](_0x10beba[_0x02de('0x6e')])?util[_0x02de('0x75')](_0x02de('0x76'),_0x10beba[_0x02de('0x30')]):_0x10beba[_0x02de('0x6e')],'paused':_0x10beba['voicePause']||![],'penalty':_0x10beba['penalty']},{'transaction':_0x48e941});});})[_0x02de('0x25')](function(){_0x5a725c['forEach'](function(_0x3c2ebf){socket[_0x02de('0x77')](_0x02de('0x78'),{'UserId':_0x3c2ebf['id'],'VoiceQueueId':_0x542eae['id']});});});});});}})[_0x02de('0x25')](respondWithStatusCode(_0x504b31,null))[_0x02de('0x48')](handleError(_0x504b31,null));};exports[_0x02de('0x79')]=function(_0x359d5f,_0x452a28,_0x53d4b4){return db[_0x02de('0x67')][_0x02de('0x47')]({'where':{'id':_0x359d5f['query'][_0x02de('0x7a')]},'attributes':['id'],'include':[{'model':db[_0x02de('0x6b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x02de('0x25')](handleEntityNotFound(_0x452a28,null))[_0x02de('0x25')](function(_0x47a6df){var _0x272b1e=_['map'](_0x47a6df,'id');var _0x268325=[];var _0x492cd1=[];var _0x5043c5=squel[_0x02de('0x7b')]();_0x5043c5['field'](_0x02de('0x7c'))[_0x02de('0x7d')](_0x02de('0x7e'),'tq')[_0x02de('0x7f')](_0x02de('0x80'),'ut',_0x02de('0x81'))[_0x02de('0x3f')](_0x02de('0x82'),_0x359d5f['params']['id']);for(var _0x128a29=0x0;_0x128a29<_0x47a6df[_0x02de('0x3c')];_0x128a29+=0x1){let _0x1cc3f3=_0x47a6df[_0x128a29];for(var _0x316167=0x0;_0x316167<_0x1cc3f3['Agents']['length'];_0x316167+=0x1){let _0x1421ed=_0x1cc3f3[_0x02de('0x6c')][_0x316167];var _0xc375e6=_0x5043c5['clone']();_0xc375e6[_0x02de('0x3f')](_0x02de('0x83'),_0x1421ed['id']);_0x492cd1[_0x02de('0x84')](db[_0x02de('0x71')][_0x02de('0x37')](_0xc375e6['toString'](),{'type':db[_0x02de('0x71')]['QueryTypes'][_0x02de('0x85')]})[_0x02de('0x25')](function(_0x44c70e){if(_0x44c70e[_0x02de('0x3c')]===0x1){return _0x1421ed['id'];}else{var _0x118622=_['every'](_[_0x02de('0x2b')](_0x44c70e,'TeamId'),function(_0x518539){return _[_0x02de('0x2d')](_0x272b1e,_0x518539);});if(_0x118622){return _0x1421ed['id'];}}}));}}return BPromise[_0x02de('0x86')](_0x492cd1)[_0x02de('0x25')](function(_0xaad436){_0x268325=_(_0x268325)[_0x02de('0x87')](_0xaad436)[_0x02de('0x88')]()['value']();return db['VoiceQueue'][_0x02de('0x2f')]({'where':{'id':_0x359d5f[_0x02de('0x5a')]['id']}})[_0x02de('0x25')](function(_0x4904af){return db[_0x02de('0x71')][_0x02de('0x72')](function(_0x1c6f8b){return _0x4904af[_0x02de('0x79')](_0x359d5f['query'][_0x02de('0x7a')],{'transaction':_0x1c6f8b})[_0x02de('0x25')](function(){if(!_['isEmpty'](_0x268325)){return _0x4904af['removeAgents'](_0x268325,{'transaction':_0x1c6f8b})['then'](function(){return db[_0x02de('0x89')][_0x02de('0x32')]({'where':{'VoiceQueueId':_0x359d5f[_0x02de('0x5a')]['id'],'UserId':_0x268325},'transaction':_0x1c6f8b});});}})[_0x02de('0x25')](function(){_0x268325['forEach'](function(_0x59e354){socket[_0x02de('0x77')](_0x02de('0x8a'),{'UserId':_0x59e354,'VoiceQueueId':_0x4904af['id']});});});});});});})[_0x02de('0x25')](respondWithStatusCode(_0x452a28,null))[_0x02de('0x48')](handleError(_0x452a28,null));};exports[_0x02de('0x8b')]=function(_0x4dd83f,_0x2442f6,_0x28cb93){var _0x555016,_0x31026b;return db[_0x02de('0x46')][_0x02de('0x2f')]({'where':{'id':_0x4dd83f[_0x02de('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2442f6,null))[_0x02de('0x25')](function(_0x38ceef){if(_0x38ceef){_0x31026b=_0x38ceef;return _0x38ceef[_0x02de('0x8b')](_0x4dd83f[_0x02de('0x56')]['ids'],_[_0x02de('0x54')](_0x4dd83f[_0x02de('0x56')],[_0x02de('0x7a'),'id'])||{})[_0x02de('0x8c')](function(_0x4f82e0){for(var _0x2a141c=0x0;_0x2a141c<_0x4dd83f[_0x02de('0x56')][_0x02de('0x7a')][_0x02de('0x3c')];_0x2a141c+=0x1){socket[_0x02de('0x77')](_0x02de('0x78'),{'UserId':_0x4dd83f['body']['ids'][_0x2a141c],'VoiceQueueId':_0x4dd83f[_0x02de('0x5a')]['id']});}return _0x4f82e0;});}})[_0x02de('0x25')](function(_0x23ea8f){_0x555016=_0x23ea8f||[];if(_0x31026b){return db['User'][_0x02de('0x47')]({'where':{'id':_0x4dd83f[_0x02de('0x56')][_0x02de('0x7a')]},'attributes':['id','name',_0x02de('0x8d'),_0x02de('0x6d'),'interface'],'raw':!![]});}})[_0x02de('0x25')](function(_0x52c972){if(!_[_0x02de('0x8e')](_0x52c972)){var _0x116298=[];for(var _0x2706ab=0x0;_0x2706ab<_0x52c972['length'];_0x2706ab++){if(_0x52c972[_0x2706ab][_0x02de('0x8d')]){_0x116298[_0x02de('0x84')](db[_0x02de('0x89')][_0x02de('0x8f')]({'membername':_0x52c972[_0x2706ab][_0x02de('0x30')],'UserId':_0x52c972[_0x2706ab]['id'],'queue_name':_0x31026b[_0x02de('0x30')],'VoiceQueueId':_0x31026b['id'],'interface':_[_0x02de('0x90')](_0x52c972[_0x2706ab]['interface'])?util['format'](_0x02de('0x76'),_0x52c972[_0x2706ab][_0x02de('0x30')]):_0x52c972[_0x2706ab][_0x02de('0x6e')],'paused':_0x52c972[_0x2706ab][_0x02de('0x6d')]||![],'penalty':_0x4dd83f[_0x02de('0x56')]['penalty']||0x0}));}}return BPromise[_0x02de('0x86')](_0x116298);}})[_0x02de('0x25')](function(){return _0x555016;})[_0x02de('0x25')](respondWithResult(_0x2442f6,null))[_0x02de('0x48')](handleError(_0x2442f6,null));};exports[_0x02de('0x91')]=function(_0x46b540,_0x307f74,_0x27f727){return db[_0x02de('0x46')][_0x02de('0x2f')]({'where':{'id':_0x46b540[_0x02de('0x5a')]['id']}})[_0x02de('0x25')](handleEntityNotFound(_0x307f74,null))[_0x02de('0x25')](function(_0x1900e0){if(_0x1900e0){return _0x1900e0['removeAgents'](_0x46b540[_0x02de('0x37')][_0x02de('0x7a')])[_0x02de('0x25')](function(){if(_[_0x02de('0x92')](_0x46b540[_0x02de('0x37')][_0x02de('0x7a')])){for(var _0x46d7bc=0x0;_0x46d7bc<_0x46b540[_0x02de('0x37')][_0x02de('0x7a')][_0x02de('0x3c')];_0x46d7bc+=0x1){socket[_0x02de('0x77')](_0x02de('0x8a'),{'UserId':Number(_0x46b540['query']['ids'][_0x46d7bc]),'VoiceQueueId':Number(_0x46b540[_0x02de('0x5a')]['id'])});}}else{socket[_0x02de('0x77')](_0x02de('0x8a'),{'UserId':Number(_0x46b540[_0x02de('0x37')]['ids']),'VoiceQueueId':Number(_0x46b540['params']['id'])});}});}})['then'](function(_0x595c1f){return db[_0x02de('0x89')][_0x02de('0x32')]({'where':{'VoiceQueueId':_0x46b540[_0x02de('0x5a')]['id'],'UserId':_0x46b540['query']['ids']}})[_0x02de('0x25')](function(){return _0x595c1f;});})[_0x02de('0x25')](respondWithStatusCode(_0x307f74,null))[_0x02de('0x48')](handleError(_0x307f74,null));};exports[_0x02de('0x93')]=function(_0x4cb9eb,_0x592a09,_0x5eff37){var _0x191af5={};var _0x145401={};var _0x4522e4;var _0x4b26b3;return db[_0x02de('0x46')]['findOne']({'where':{'id':_0x4cb9eb[_0x02de('0x5a')]['id']}})[_0x02de('0x25')](handleEntityNotFound(_0x592a09,null))[_0x02de('0x25')](function(_0x4c8e2a){if(_0x4c8e2a){_0x4522e4=_0x4c8e2a;_0x145401[_0x02de('0x35')]=_[_0x02de('0x36')](db[_0x02de('0x6b')][_0x02de('0x49')]);_0x145401['query']=_['keys'](_0x4cb9eb[_0x02de('0x37')]);_0x145401[_0x02de('0x38')]=_[_0x02de('0x39')](_0x145401[_0x02de('0x35')],_0x145401[_0x02de('0x37')]);_0x191af5[_0x02de('0x3b')]=_[_0x02de('0x39')](_0x145401['model'],qs[_0x02de('0x3a')](_0x4cb9eb[_0x02de('0x37')][_0x02de('0x3a')]));_0x191af5[_0x02de('0x3b')]=_0x191af5[_0x02de('0x3b')][_0x02de('0x3c')]?_0x191af5['attributes']:_0x145401['model'];_0x191af5['order']=qs[_0x02de('0x3e')](_0x4cb9eb[_0x02de('0x37')][_0x02de('0x3e')]);_0x191af5[_0x02de('0x3f')]=qs[_0x02de('0x38')](_[_0x02de('0x40')](_0x4cb9eb[_0x02de('0x37')],_0x145401['filters']));if(_0x4cb9eb[_0x02de('0x37')][_0x02de('0x29')]){_0x191af5['where']=_[_0x02de('0x41')](_0x191af5[_0x02de('0x3f')],{'$or':_[_0x02de('0x2b')](_0x191af5[_0x02de('0x3b')],function(_0x28f2b8){var _0xb89678={};_0xb89678[_0x28f2b8]={'$like':'%'+_0x4cb9eb[_0x02de('0x37')][_0x02de('0x29')]+'%'};return _0xb89678;})});}_0x191af5=_['merge']({},_0x191af5,_0x4cb9eb[_0x02de('0x44')]);return _0x4522e4[_0x02de('0x93')](_0x191af5);}})[_0x02de('0x25')](function(_0x1c8357){if(_0x1c8357){_0x4b26b3=_0x1c8357[_0x02de('0x3c')];if(!_0x4cb9eb[_0x02de('0x37')][_0x02de('0x63')](_0x02de('0x3d'))){_0x191af5[_0x02de('0x20')]=qs[_0x02de('0x20')](_0x4cb9eb[_0x02de('0x37')][_0x02de('0x20')]);_0x191af5[_0x02de('0x1f')]=qs[_0x02de('0x1f')](_0x4cb9eb['query']['offset']);}return _0x4522e4[_0x02de('0x93')](_0x191af5);}})[_0x02de('0x25')](function(_0x2f8bf9){if(_0x2f8bf9){return _0x2f8bf9?{'count':_0x4b26b3,'rows':_0x2f8bf9}:null;}})[_0x02de('0x25')](respondWithResult(_0x592a09,null))['catch'](handleError(_0x592a09,null));};exports['getMembers']=function(_0x25927c,_0x17ee5e,_0x3779de){var _0x544bd9={};var _0x2cc2e2={};var _0x9e9878;var _0x217b86;return db[_0x02de('0x46')][_0x02de('0x61')]({'where':{'id':_0x25927c[_0x02de('0x5a')]['id']}})[_0x02de('0x25')](handleEntityNotFound(_0x17ee5e,null))[_0x02de('0x25')](function(_0x458459){if(_0x458459){_0x9e9878=_0x458459;_0x2cc2e2[_0x02de('0x35')]=_[_0x02de('0x36')](db[_0x02de('0x89')][_0x02de('0x49')]);_0x2cc2e2[_0x02de('0x37')]=_[_0x02de('0x36')](_0x25927c[_0x02de('0x37')]);_0x2cc2e2[_0x02de('0x38')]=_[_0x02de('0x39')](_0x2cc2e2[_0x02de('0x35')],_0x2cc2e2[_0x02de('0x37')]);_0x544bd9[_0x02de('0x3b')]=_['intersection'](_0x2cc2e2[_0x02de('0x35')],qs['fields'](_0x25927c[_0x02de('0x37')]['fields']));_0x544bd9[_0x02de('0x3b')]=_0x544bd9[_0x02de('0x3b')][_0x02de('0x3c')]?_0x544bd9['attributes']:_0x2cc2e2[_0x02de('0x35')];_0x544bd9[_0x02de('0x5d')]=qs[_0x02de('0x3e')](_0x25927c['query'][_0x02de('0x3e')]);_0x544bd9[_0x02de('0x3f')]=qs['filters'](_['pick'](_0x25927c[_0x02de('0x37')],_0x2cc2e2[_0x02de('0x38')]));if(_0x25927c[_0x02de('0x37')][_0x02de('0x29')]){_0x544bd9['where']=_[_0x02de('0x41')](_0x544bd9['where'],{'$or':_[_0x02de('0x2b')](_0x544bd9[_0x02de('0x3b')],function(_0x4d9f32){var _0x5624f5={};_0x5624f5[_0x4d9f32]={'$like':'%'+_0x25927c[_0x02de('0x37')][_0x02de('0x29')]+'%'};return _0x5624f5;})});}_0x544bd9=_[_0x02de('0x41')]({},_0x544bd9,_0x25927c[_0x02de('0x44')]);return _0x9e9878['getMembers'](_0x544bd9);}})[_0x02de('0x25')](function(_0x51ea9f){if(_0x51ea9f){_0x217b86=_0x51ea9f[_0x02de('0x3c')];if(!_0x25927c[_0x02de('0x37')]['hasOwnProperty'](_0x02de('0x3d'))){_0x544bd9[_0x02de('0x20')]=qs[_0x02de('0x20')](_0x25927c['query'][_0x02de('0x20')]);_0x544bd9['offset']=qs[_0x02de('0x1f')](_0x25927c[_0x02de('0x37')][_0x02de('0x1f')]);}return _0x9e9878[_0x02de('0x94')](_0x544bd9);}})[_0x02de('0x25')](function(_0x30599b){return _0x30599b?{'count':_0x217b86,'rows':_0x30599b}:null;})['then'](respondWithResult(_0x17ee5e,null))[_0x02de('0x48')](handleError(_0x17ee5e,null));};exports['getLists']=function(_0x266c04,_0x5dbd6f,_0x4df661){var _0x62e77f={};var _0xbddd51={};var _0x1e2f36;var _0x97696a;return db['VoiceQueue']['findOne']({'where':{'id':_0x266c04[_0x02de('0x5a')]['id']}})[_0x02de('0x25')](handleEntityNotFound(_0x5dbd6f,null))[_0x02de('0x25')](function(_0x4c64a4){if(_0x4c64a4){_0x1e2f36=_0x4c64a4;_0xbddd51['model']=_[_0x02de('0x36')](db[_0x02de('0x95')]['rawAttributes']);_0xbddd51[_0x02de('0x37')]=_[_0x02de('0x36')](_0x266c04[_0x02de('0x37')]);_0xbddd51[_0x02de('0x38')]=_['intersection'](_0xbddd51[_0x02de('0x35')],_0xbddd51[_0x02de('0x37')]);_0x62e77f[_0x02de('0x3b')]=_['intersection'](_0xbddd51[_0x02de('0x35')],qs['fields'](_0x266c04[_0x02de('0x37')][_0x02de('0x3a')]));_0x62e77f[_0x02de('0x3b')]=_0x62e77f['attributes'][_0x02de('0x3c')]?_0x62e77f[_0x02de('0x3b')]:_0xbddd51['model'];_0x62e77f[_0x02de('0x5d')]=qs[_0x02de('0x3e')](_0x266c04['query'][_0x02de('0x3e')]);_0x62e77f[_0x02de('0x3f')]=qs[_0x02de('0x38')](_['pick'](_0x266c04[_0x02de('0x37')],_0xbddd51[_0x02de('0x38')]));if(_0x266c04[_0x02de('0x37')][_0x02de('0x29')]){_0x62e77f[_0x02de('0x3f')]=_[_0x02de('0x41')](_0x62e77f[_0x02de('0x3f')],{'$or':_[_0x02de('0x2b')](_0x62e77f[_0x02de('0x3b')],function(_0x32f3fc){var _0x52f2b3={};_0x52f2b3[_0x32f3fc]={'$like':'%'+_0x266c04[_0x02de('0x37')]['filter']+'%'};return _0x52f2b3;})});}_0x62e77f=_['merge']({},_0x62e77f,_0x266c04[_0x02de('0x44')]);return _0x1e2f36[_0x02de('0x96')](_0x62e77f);}})[_0x02de('0x25')](function(_0x1c1fdf){if(_0x1c1fdf){_0x97696a=_0x1c1fdf[_0x02de('0x3c')];if(!_0x266c04[_0x02de('0x37')][_0x02de('0x63')](_0x02de('0x3d'))){_0x62e77f[_0x02de('0x20')]=qs[_0x02de('0x20')](_0x266c04[_0x02de('0x37')][_0x02de('0x20')]);_0x62e77f[_0x02de('0x1f')]=qs[_0x02de('0x1f')](_0x266c04['query'][_0x02de('0x1f')]);}return _0x1e2f36[_0x02de('0x96')](_0x62e77f);}})[_0x02de('0x25')](function(_0x3ed251){if(_0x3ed251){return _0x3ed251?{'count':_0x97696a,'rows':_0x3ed251}:null;}})[_0x02de('0x25')](respondWithResult(_0x5dbd6f,null))[_0x02de('0x48')](handleError(_0x5dbd6f,null));};exports[_0x02de('0x97')]=function(_0x44ca1e,_0x3e1ea2,_0x4a2a14){var _0x3d30dd,_0x4b392d;return db[_0x02de('0x46')][_0x02de('0x2f')]({'where':{'id':_0x44ca1e[_0x02de('0x5a')]['id']}})[_0x02de('0x25')](handleEntityNotFound(_0x3e1ea2,null))[_0x02de('0x25')](function(_0x39f9bb){if(_0x39f9bb){_0x4b392d=_0x39f9bb;return _0x39f9bb[_0x02de('0x97')](_0x44ca1e[_0x02de('0x56')]['ids'],_[_0x02de('0x54')](_0x44ca1e[_0x02de('0x56')],[_0x02de('0x7a'),'id'])||{});}return null;})[_0x02de('0x8c')](function(_0x4823f0){var _0x4fff86;_0x3d30dd=_0x4823f0||[];var _0x5e56bf=[];if(_0x4823f0){for(var _0xd15fb8=0x0;_0xd15fb8<_0x4823f0[_0x02de('0x3c')];_0xd15fb8+=0x1){var _0x4f7b1e=_0x4823f0[_0xd15fb8][_0x02de('0x4d')]({'plain':!![]});_0x4b392d[_0x02de('0x98')]=_0x44ca1e[_0x02de('0x56')][_0x02de('0x98')]?_0x44ca1e['body'][_0x02de('0x98')]:_0x4b392d['dialCheckDuplicateType'];switch(_0x4b392d[_0x02de('0x98')]){case _0x02de('0x99'):_0x4fff86=squel[_0x02de('0x9a')]()[_0x02de('0x9b')]('cm_hopper')[_0x02de('0x9c')]([_0x02de('0x9d'),_0x02de('0x9e'),_0x02de('0x9f'),'ListId',_0x02de('0x64'),'createdAt','updatedAt'],squel[_0x02de('0x7b')]()[_0x02de('0xa0')]('phone',_0x02de('0x9d'))[_0x02de('0xa0')](_0x02de('0xa1'),_0x02de('0x9e'))['field']('id','ContactId')[_0x02de('0xa0')](_0x4f7b1e[_0x02de('0xa2')][_0x02de('0xa3')](),_0x02de('0xa4'))['field'](_0x44ca1e[_0x02de('0x5a')]['id'][_0x02de('0xa3')](),_0x02de('0x64'))['field'](_0x02de('0xa1'),'createdAt')['field'](_0x02de('0xa1'),_0x02de('0x55'))[_0x02de('0x7d')](_0x02de('0xa5'))[_0x02de('0x3f')](_0x02de('0xa6'))[_0x02de('0x3f')]('ListId\x20=\x20?',_0x4f7b1e[_0x02de('0xa2')][_0x02de('0xa3')]())['where'](_0x02de('0xa7'))[_0x02de('0x3f')](_0x02de('0xa8'),squel[_0x02de('0x7b')]()[_0x02de('0xa0')]('COALESCE(calleridnum,\x27\x27)')[_0x02de('0x7d')](_0x02de('0xa9'))[_0x02de('0x3f')](_0x02de('0x82'),_0x44ca1e[_0x02de('0x5a')]['id'][_0x02de('0xa3')]()))[_0x02de('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x02de('0x7b')]()[_0x02de('0xa0')](_0x02de('0xaa'))[_0x02de('0x7d')](_0x02de('0xab'))[_0x02de('0x3f')](_0x02de('0x82'),_0x44ca1e['params']['id']['toString']())))[_0x02de('0xa3')]();break;case _0x02de('0xac'):_0x4fff86=squel[_0x02de('0x9a')]()[_0x02de('0x9b')](_0x02de('0xab'))[_0x02de('0x9c')]([_0x02de('0x9d'),_0x02de('0x9e'),_0x02de('0x9f'),_0x02de('0xa4'),_0x02de('0x64'),_0x02de('0x57'),'updatedAt'],squel[_0x02de('0x7b')]()[_0x02de('0xa0')]('phone',_0x02de('0x9d'))[_0x02de('0xa0')]('NOW()',_0x02de('0x9e'))[_0x02de('0xa0')]('id',_0x02de('0x9f'))[_0x02de('0xa0')](_0x4f7b1e[_0x02de('0xa2')][_0x02de('0xa3')](),_0x02de('0xa4'))['field'](_0x44ca1e['params']['id']['toString'](),'VoiceQueueId')[_0x02de('0xa0')]('NOW()',_0x02de('0x57'))['field']('NOW()',_0x02de('0x55'))[_0x02de('0x7d')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where'](_0x02de('0xad'),_0x4f7b1e[_0x02de('0xa2')][_0x02de('0xa3')]())[_0x02de('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0x02de('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x02de('0xa0')](_0x02de('0xaa'))['from'](_0x02de('0xab'))[_0x02de('0x3f')](_0x02de('0x82'),_0x44ca1e[_0x02de('0x5a')]['id'][_0x02de('0xa3')]())))['toString']();break;default:_0x4fff86=squel[_0x02de('0x9a')]()[_0x02de('0x9b')](_0x02de('0xab'))[_0x02de('0x9c')]([_0x02de('0x9d'),_0x02de('0x9e'),_0x02de('0x9f'),'ListId',_0x02de('0x64'),'createdAt',_0x02de('0x55')],squel['select']()[_0x02de('0xa0')](_0x02de('0x9d'),_0x02de('0x9d'))[_0x02de('0xa0')](_0x02de('0xa1'),'scheduledAt')['field']('id','ContactId')[_0x02de('0xa0')](_0x4f7b1e['CmListId'][_0x02de('0xa3')](),_0x02de('0xa4'))[_0x02de('0xa0')](_0x44ca1e[_0x02de('0x5a')]['id'][_0x02de('0xa3')](),'VoiceQueueId')['field'](_0x02de('0xa1'),_0x02de('0x57'))['field'](_0x02de('0xa1'),_0x02de('0x55'))[_0x02de('0x7d')](_0x02de('0xa5'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x02de('0xad'),_0x4f7b1e[_0x02de('0xa2')][_0x02de('0xa3')]())[_0x02de('0x3f')]('phone\x20IS\x20NOT\x20NULL'))[_0x02de('0xa3')]();}_0x5e56bf[_0x02de('0x84')](db[_0x02de('0x71')][_0x02de('0x37')](_0x4fff86));}return BPromise[_0x02de('0x86')](_0x5e56bf);}})['then'](function(){return _0x3d30dd;})[_0x02de('0x25')](respondWithResult(_0x3e1ea2,null))[_0x02de('0x48')](handleError(_0x3e1ea2,null));};exports['removeLists']=function(_0xacb950,_0x389aa4,_0x59869a){return db['VoiceQueue'][_0x02de('0x2f')]({'where':{'id':_0xacb950[_0x02de('0x5a')]['id']}})[_0x02de('0x25')](handleEntityNotFound(_0x389aa4,null))[_0x02de('0x25')](function(_0x374bd1){if(_0x374bd1){return _0x374bd1[_0x02de('0xae')](_0xacb950[_0x02de('0x37')][_0x02de('0x7a')]);}})[_0x02de('0x25')](function(_0x2683a6){if(_0x2683a6){return db[_0x02de('0x5c')][_0x02de('0x32')]({'where':{'ListId':_0xacb950[_0x02de('0x37')][_0x02de('0x7a')],'VoiceQueueId':_0xacb950[_0x02de('0x5a')]['id']}})[_0x02de('0x25')](function(){return _0x2683a6;});}})[_0x02de('0x25')](respondWithStatusCode(_0x389aa4,null))[_0x02de('0x48')](handleError(_0x389aa4,null));};exports['getBlackLists']=function(_0xc09806,_0x4b7017,_0x16e005){var _0x514079={};var _0x4e2003={};var _0x200e1f;var _0x43c704;return db[_0x02de('0x46')][_0x02de('0x61')]({'where':{'id':_0xc09806['params']['id']}})['then'](handleEntityNotFound(_0x4b7017,null))['then'](function(_0x20fe58){if(_0x20fe58){_0x200e1f=_0x20fe58;_0x4e2003[_0x02de('0x35')]=_['keys'](db[_0x02de('0x95')][_0x02de('0x49')]);_0x4e2003['query']=_[_0x02de('0x36')](_0xc09806[_0x02de('0x37')]);_0x4e2003[_0x02de('0x38')]=_[_0x02de('0x39')](_0x4e2003['model'],_0x4e2003[_0x02de('0x37')]);_0x514079[_0x02de('0x3b')]=_[_0x02de('0x39')](_0x4e2003[_0x02de('0x35')],qs['fields'](_0xc09806[_0x02de('0x37')][_0x02de('0x3a')]));_0x514079[_0x02de('0x3b')]=_0x514079[_0x02de('0x3b')][_0x02de('0x3c')]?_0x514079[_0x02de('0x3b')]:_0x4e2003[_0x02de('0x35')];_0x514079[_0x02de('0x5d')]=qs[_0x02de('0x3e')](_0xc09806[_0x02de('0x37')]['sort']);_0x514079['where']=qs[_0x02de('0x38')](_[_0x02de('0x40')](_0xc09806[_0x02de('0x37')],_0x4e2003[_0x02de('0x38')]));if(_0xc09806['query']['filter']){_0x514079[_0x02de('0x3f')]=_[_0x02de('0x41')](_0x514079[_0x02de('0x3f')],{'$or':_['map'](_0x514079[_0x02de('0x3b')],function(_0x3d4197){var _0x173971={};_0x173971[_0x3d4197]={'$like':'%'+_0xc09806[_0x02de('0x37')]['filter']+'%'};return _0x173971;})});}_0x514079=_[_0x02de('0x41')]({},_0x514079,_0xc09806[_0x02de('0x44')]);return _0x200e1f[_0x02de('0xaf')](_0x514079);}})[_0x02de('0x25')](function(_0x1595bd){if(_0x1595bd){_0x43c704=_0x1595bd[_0x02de('0x3c')];if(!_0xc09806[_0x02de('0x37')][_0x02de('0x63')]('nolimit')){_0x514079[_0x02de('0x20')]=qs[_0x02de('0x20')](_0xc09806['query']['limit']);_0x514079[_0x02de('0x1f')]=qs[_0x02de('0x1f')](_0xc09806[_0x02de('0x37')]['offset']);}return _0x200e1f[_0x02de('0xaf')](_0x514079);}})[_0x02de('0x25')](function(_0x10d99d){if(_0x10d99d){return _0x10d99d?{'count':_0x43c704,'rows':_0x10d99d}:null;}})[_0x02de('0x25')](respondWithResult(_0x4b7017,null))[_0x02de('0x48')](handleError(_0x4b7017,null));};exports['addBlackLists']=function(_0x14f8e9,_0x40aea6,_0x4ff5bf){var _0x61e095,_0x4ec16a;return db[_0x02de('0x46')]['find']({'where':{'id':_0x14f8e9[_0x02de('0x5a')]['id']}})[_0x02de('0x25')](handleEntityNotFound(_0x40aea6,null))[_0x02de('0x25')](function(_0x28180e){if(_0x28180e){_0x4ec16a=_0x28180e;return _0x28180e[_0x02de('0xb0')](_0x14f8e9['body'][_0x02de('0x7a')],_[_0x02de('0x54')](_0x14f8e9['body'],[_0x02de('0x7a'),'id'])||{});}return null;})[_0x02de('0x8c')](function(_0x39c885){var _0xdcc075;_0x61e095=_0x39c885||[];var _0x2ca358=[];if(_0x39c885){for(var _0x23adbc=0x0;_0x23adbc<_0x39c885['length'];_0x23adbc+=0x1){var _0x2cd2a6=_0x39c885[_0x23adbc]['get']({'plain':!![]});_0xdcc075=squel['insert']()[_0x02de('0x9b')](_0x02de('0xb1'))['fromQuery']([_0x02de('0x9d'),'ContactId',_0x02de('0xa4'),_0x02de('0x64'),_0x02de('0x57'),_0x02de('0x55')],squel[_0x02de('0x7b')]()[_0x02de('0xa0')]('phone',_0x02de('0x9d'))[_0x02de('0xa0')]('id','ContactId')[_0x02de('0xa0')](_0x2cd2a6['CmListId'][_0x02de('0xa3')](),_0x02de('0xa4'))[_0x02de('0xa0')](_0x14f8e9[_0x02de('0x5a')]['id']['toString'](),_0x02de('0x64'))[_0x02de('0xa0')](_0x02de('0xa1'),_0x02de('0x57'))[_0x02de('0xa0')](_0x02de('0xa1'),'updatedAt')[_0x02de('0x7d')](_0x02de('0xa5'))[_0x02de('0x3f')]('deletedAt\x20IS\x20NULL')['where'](_0x02de('0xad'),_0x2cd2a6[_0x02de('0xa2')][_0x02de('0xa3')]())[_0x02de('0x3f')](_0x02de('0xa7')))['toString']();_0x2ca358[_0x02de('0x84')](db[_0x02de('0x71')][_0x02de('0x37')](_0xdcc075));}return BPromise[_0x02de('0x86')](_0x2ca358);}})[_0x02de('0x25')](function(){return _0x61e095;})[_0x02de('0x25')](respondWithResult(_0x40aea6,null))[_0x02de('0x48')](handleError(_0x40aea6,null));};exports['removeBlackLists']=function(_0x2ff277,_0x1f77d6,_0x57c1fe){return db[_0x02de('0x46')][_0x02de('0x2f')]({'where':{'id':_0x2ff277['params']['id']}})['then'](handleEntityNotFound(_0x1f77d6,null))[_0x02de('0x25')](function(_0x158c9c){if(_0x158c9c){return _0x158c9c[_0x02de('0xb2')](_0x2ff277[_0x02de('0x37')][_0x02de('0x7a')]);}})[_0x02de('0x25')](function(_0x198df7){if(_0x198df7){return db[_0x02de('0x66')]['destroy']({'where':{'ListId':_0x2ff277[_0x02de('0x37')]['ids'],'VoiceQueueId':_0x2ff277['params']['id']}})[_0x02de('0x25')](function(){return _0x198df7;});}})[_0x02de('0x25')](respondWithStatusCode(_0x1f77d6,null))[_0x02de('0x48')](handleError(_0x1f77d6,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 6890207..8009ac0 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 _0xcd4d=['exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','remove','emit','hook'];(function(_0x4ce9f7,_0x3e2b74){var _0x47cb35=function(_0x4dce37){while(--_0x4dce37){_0x4ce9f7['push'](_0x4ce9f7['shift']());}};_0x47cb35(++_0x3e2b74);}(_0xcd4d,0x1a8));var _0xdcd4=function(_0xd0cd1,_0x328b6c){_0xd0cd1=_0xd0cd1-0x0;var _0x1da412=_0xcd4d[_0xd0cd1];return _0x1da412;};'use strict';var EventEmitter=require(_0xdcd4('0x0'));var VoiceQueue=require(_0xdcd4('0x1'))['db'][_0xdcd4('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xdcd4('0x3')](0x0);var events={'afterCreate':_0xdcd4('0x4'),'afterUpdate':'update','afterDestroy':_0xdcd4('0x5')};function emitEvent(_0x233968){return function(_0x54f49b,_0x4e291c,_0x250397){VoiceQueueEvents[_0xdcd4('0x6')](_0x233968+':'+_0x54f49b['id'],_0x54f49b);VoiceQueueEvents[_0xdcd4('0x6')](_0x233968,_0x54f49b);_0x250397(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xdcd4('0x7')](e,emitEvent(event));}}module[_0xdcd4('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0x709b=['events','../../mysqldb','VoiceQueue','save','emit','hasOwnProperty','hook'];(function(_0x2b2180,_0x54daf6){var _0x57e103=function(_0x431bb3){while(--_0x431bb3){_0x2b2180['push'](_0x2b2180['shift']());}};_0x57e103(++_0x54daf6);}(_0x709b,0x150));var _0xb709=function(_0x57a511,_0x1ca00a){_0x57a511=_0x57a511-0x0;var _0x947f30=_0x709b[_0x57a511];return _0x947f30;};'use strict';var EventEmitter=require(_0xb709('0x0'));var VoiceQueue=require(_0xb709('0x1'))['db'][_0xb709('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb709('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5778e0){return function(_0x389391,_0x3cf780,_0x3290dd){VoiceQueueEvents[_0xb709('0x4')](_0x5778e0+':'+_0x389391['id'],_0x389391);VoiceQueueEvents['emit'](_0x5778e0,_0x389391);_0x3290dd(null);};}for(var e in events){if(events[_0xb709('0x5')](e)){var event=events[e];VoiceQueue[_0xb709('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 9cba4f0..2a620bb 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 _0x153f=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./voiceQueue.attributes','exports','define','voice_queues','lodash'];(function(_0x49552f,_0x36761f){var _0x5debcb=function(_0x58f032){while(--_0x58f032){_0x49552f['push'](_0x49552f['shift']());}};_0x5debcb(++_0x36761f);}(_0x153f,0x15b));var _0xf153=function(_0x1993a0,_0x431e69){_0x1993a0=_0x1993a0-0x0;var _0x4466d8=_0x153f[_0x1993a0];return _0x4466d8;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var logger=require(_0xf153('0x2'))(_0xf153('0x3'));var moment=require(_0xf153('0x4'));var BPromise=require(_0xf153('0x5'));var rp=require(_0xf153('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf153('0x7'));var config=require('../../config/environment');var attributes=require(_0xf153('0x8'));module[_0xf153('0x9')]=function(_0x342a45,_0xafd987){return _0x342a45[_0xf153('0xa')]('VoiceQueue',attributes,{'tableName':_0xf153('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9354=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','voice_queues','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x32b122,_0x1ad490){var _0x4ad25a=function(_0x590ee6){while(--_0x590ee6){_0x32b122['push'](_0x32b122['shift']());}};_0x4ad25a(++_0x1ad490);}(_0x9354,0x96));var _0x4935=function(_0x3cbe3a,_0x78bfce){_0x3cbe3a=_0x3cbe3a-0x0;var _0x24ffc1=_0x9354[_0x3cbe3a];return _0x24ffc1;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var logger=require(_0x4935('0x1'))('api');var moment=require(_0x4935('0x2'));var BPromise=require(_0x4935('0x3'));var rp=require(_0x4935('0x4'));var fs=require('fs');var path=require(_0x4935('0x5'));var rimraf=require('rimraf');var config=require(_0x4935('0x6'));var attributes=require(_0x4935('0x7'));module[_0x4935('0x8')]=function(_0x2d518a,_0x263864){return _0x2d518a[_0x4935('0x9')](_0x4935('0xa'),attributes,{'tableName':_0x4935('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 6fca31d..882f48c 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 _0x9957=['register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','options','raw','where','attributes','limit','include','model','map','catch','GetVoiceQueue','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket'];(function(_0x2163fc,_0x58ea83){var _0xd34cbf=function(_0x3b10a6){while(--_0x3b10a6){_0x2163fc['push'](_0x2163fc['shift']());}};_0xd34cbf(++_0x58ea83);}(_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 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});config[_0x7995('0xc')]=_[_0x7995('0xd')](config['redis'],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require(_0x7995('0xf'))(new Redis(config['redis']));require(_0x7995('0x10'))[_0x7995('0x11')](socket);function respondWithRpcPromise(_0x18c8a3,_0x35b5fe,_0x3c1d19){return new BPromise(function(_0x1e400a,_0x341672){return client['request'](_0x18c8a3,_0x3c1d19)[_0x7995('0x12')](function(_0x41c652){logger['info'](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));logger[_0x7995('0x15')](_0x7995('0x16'),_0x35b5fe,_0x7995('0x14'),JSON[_0x7995('0x17')](_0x41c652));if(_0x41c652[_0x7995('0x18')]){if(_0x41c652['error']['code']===0x1f4){logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);return _0x341672(_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);}logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652['error'][_0x7995('0x19')]);return _0x1e400a(_0x41c652['error'][_0x7995('0x19')]);}else{logger[_0x7995('0x1a')](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));_0x1e400a(_0x41c652[_0x7995('0x1b')][_0x7995('0x19')]);}})['catch'](function(_0x54c9ae){logger[_0x7995('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x35b5fe,_0x54c9ae);_0x341672(_0x54c9ae);});});}exports['GetVoiceQueue']=function(_0x3ec178){var _0x3d463e=this;return new Promise(function(_0x4cbe10,_0x3a9b54){return db['VoiceQueue']['findAll']({'raw':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1e')]||null:null,'attributes':_0x3ec178['options']?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1f')]||null:null,'limit':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x20')]||null:null,'include':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')]?_['map'](_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')],function(_0x401dc3){return{'model':db[_0x401dc3[_0x7995('0x22')]],'as':_0x401dc3['as'],'attributes':_0x401dc3[_0x7995('0x1f')],'include':_0x401dc3[_0x7995('0x21')]?_['map'](_0x401dc3[_0x7995('0x21')],function(_0x5911c3){return{'model':db[_0x5911c3[_0x7995('0x22')]],'as':_0x5911c3['as'],'attributes':_0x5911c3[_0x7995('0x1f')],'include':_0x5911c3[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5911c3[_0x7995('0x21')],function(_0x4b6f99){return{'model':db[_0x4b6f99[_0x7995('0x22')]],'as':_0x4b6f99['as'],'attributes':_0x4b6f99['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x3250e0){logger[_0x7995('0x1a')]('GetVoiceQueue',_0x3ec178);logger['debug']('GetVoiceQueue',_0x3ec178,JSON[_0x7995('0x17')](_0x3250e0));_0x4cbe10(_0x3250e0);})[_0x7995('0x24')](function(_0x327a81){logger[_0x7995('0x18')](_0x7995('0x25'),_0x327a81[_0x7995('0x19')],_0x3ec178);_0x3a9b54(_0x3d463e['error'](0x1f4,_0x327a81['message']));});});};exports[_0x7995('0x26')]=function(_0x5524af){var _0x553671=this;return new Promise(function(_0x3eb566,_0x29fac5){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':_0x5524af['options']?_0x5524af[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x5524af['options']?_0x5524af['options']['where']||null:null,'attributes':_0x5524af[_0x7995('0x1c')]?_0x5524af[_0x7995('0x1c')]['attributes']||null:null,'include':_0x5524af[_0x7995('0x1c')]?_0x5524af['options'][_0x7995('0x21')]?_[_0x7995('0x23')](_0x5524af[_0x7995('0x1c')]['include'],function(_0x52d76d){return{'model':db[_0x52d76d[_0x7995('0x22')]],'as':_0x52d76d['as'],'attributes':_0x52d76d['attributes'],'include':_0x52d76d['include']?_[_0x7995('0x23')](_0x52d76d[_0x7995('0x21')],function(_0x5212ff){return{'model':db[_0x5212ff[_0x7995('0x22')]],'as':_0x5212ff['as'],'attributes':_0x5212ff[_0x7995('0x1f')],'include':_0x5212ff[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5212ff[_0x7995('0x21')],function(_0x53002a){return{'model':db[_0x53002a[_0x7995('0x22')]],'as':_0x53002a['as'],'attributes':_0x53002a[_0x7995('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x1d60b8){logger['info'](_0x7995('0x26'),_0x5524af);logger[_0x7995('0x15')](_0x7995('0x26'),_0x5524af,JSON[_0x7995('0x17')](_0x1d60b8));_0x3eb566(_0x1d60b8);})[_0x7995('0x24')](function(_0x1035dc){logger['error'](_0x7995('0x26'),_0x1035dc[_0x7995('0x19')],_0x5524af);_0x29fac5(_0x553671[_0x7995('0x18')](0x1f4,_0x1035dc[_0x7995('0x19')]));});});}; \ No newline at end of file +var _0x9957=['register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','options','raw','where','attributes','limit','include','model','map','catch','GetVoiceQueue','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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});config[_0x7995('0xc')]=_[_0x7995('0xd')](config['redis'],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require(_0x7995('0xf'))(new Redis(config['redis']));require(_0x7995('0x10'))[_0x7995('0x11')](socket);function respondWithRpcPromise(_0x18c8a3,_0x35b5fe,_0x3c1d19){return new BPromise(function(_0x1e400a,_0x341672){return client['request'](_0x18c8a3,_0x3c1d19)[_0x7995('0x12')](function(_0x41c652){logger['info'](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));logger[_0x7995('0x15')](_0x7995('0x16'),_0x35b5fe,_0x7995('0x14'),JSON[_0x7995('0x17')](_0x41c652));if(_0x41c652[_0x7995('0x18')]){if(_0x41c652['error']['code']===0x1f4){logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);return _0x341672(_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);}logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652['error'][_0x7995('0x19')]);return _0x1e400a(_0x41c652['error'][_0x7995('0x19')]);}else{logger[_0x7995('0x1a')](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));_0x1e400a(_0x41c652[_0x7995('0x1b')][_0x7995('0x19')]);}})['catch'](function(_0x54c9ae){logger[_0x7995('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x35b5fe,_0x54c9ae);_0x341672(_0x54c9ae);});});}exports['GetVoiceQueue']=function(_0x3ec178){var _0x3d463e=this;return new Promise(function(_0x4cbe10,_0x3a9b54){return db['VoiceQueue']['findAll']({'raw':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1e')]||null:null,'attributes':_0x3ec178['options']?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1f')]||null:null,'limit':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x20')]||null:null,'include':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')]?_['map'](_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')],function(_0x401dc3){return{'model':db[_0x401dc3[_0x7995('0x22')]],'as':_0x401dc3['as'],'attributes':_0x401dc3[_0x7995('0x1f')],'include':_0x401dc3[_0x7995('0x21')]?_['map'](_0x401dc3[_0x7995('0x21')],function(_0x5911c3){return{'model':db[_0x5911c3[_0x7995('0x22')]],'as':_0x5911c3['as'],'attributes':_0x5911c3[_0x7995('0x1f')],'include':_0x5911c3[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5911c3[_0x7995('0x21')],function(_0x4b6f99){return{'model':db[_0x4b6f99[_0x7995('0x22')]],'as':_0x4b6f99['as'],'attributes':_0x4b6f99['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x3250e0){logger[_0x7995('0x1a')]('GetVoiceQueue',_0x3ec178);logger['debug']('GetVoiceQueue',_0x3ec178,JSON[_0x7995('0x17')](_0x3250e0));_0x4cbe10(_0x3250e0);})[_0x7995('0x24')](function(_0x327a81){logger[_0x7995('0x18')](_0x7995('0x25'),_0x327a81[_0x7995('0x19')],_0x3ec178);_0x3a9b54(_0x3d463e['error'](0x1f4,_0x327a81['message']));});});};exports[_0x7995('0x26')]=function(_0x5524af){var _0x553671=this;return new Promise(function(_0x3eb566,_0x29fac5){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':_0x5524af['options']?_0x5524af[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x5524af['options']?_0x5524af['options']['where']||null:null,'attributes':_0x5524af[_0x7995('0x1c')]?_0x5524af[_0x7995('0x1c')]['attributes']||null:null,'include':_0x5524af[_0x7995('0x1c')]?_0x5524af['options'][_0x7995('0x21')]?_[_0x7995('0x23')](_0x5524af[_0x7995('0x1c')]['include'],function(_0x52d76d){return{'model':db[_0x52d76d[_0x7995('0x22')]],'as':_0x52d76d['as'],'attributes':_0x52d76d['attributes'],'include':_0x52d76d['include']?_[_0x7995('0x23')](_0x52d76d[_0x7995('0x21')],function(_0x5212ff){return{'model':db[_0x5212ff[_0x7995('0x22')]],'as':_0x5212ff['as'],'attributes':_0x5212ff[_0x7995('0x1f')],'include':_0x5212ff[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5212ff[_0x7995('0x21')],function(_0x53002a){return{'model':db[_0x53002a[_0x7995('0x22')]],'as':_0x53002a['as'],'attributes':_0x53002a[_0x7995('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x1d60b8){logger['info'](_0x7995('0x26'),_0x5524af);logger[_0x7995('0x15')](_0x7995('0x26'),_0x5524af,JSON[_0x7995('0x17')](_0x1d60b8));_0x3eb566(_0x1d60b8);})[_0x7995('0x24')](function(_0x1035dc){logger['error'](_0x7995('0x26'),_0x1035dc[_0x7995('0x19')],_0x5524af);_0x29fac5(_0x553671[_0x7995('0x18')](0x1f4,_0x1035dc[_0x7995('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 0e6c367..481db37 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 _0xb8f9=['register','length','./voiceQueue.events','save','remove','update','emit','removeListener'];(function(_0x3e5a2a,_0x996518){var _0x5d4b7b=function(_0x82f12d){while(--_0x82f12d){_0x3e5a2a['push'](_0x3e5a2a['shift']());}};_0x5d4b7b(++_0x996518);}(_0xb8f9,0x132));var _0x9b8f=function(_0x5c0a22,_0x3e0eb3){_0x5c0a22=_0x5c0a22-0x0;var _0x292d8e=_0xb8f9[_0x5c0a22];return _0x292d8e;};'use strict';var VoiceQueueEvents=require(_0x9b8f('0x0'));var events=[_0x9b8f('0x1'),_0x9b8f('0x2'),_0x9b8f('0x3')];function createListener(_0x2b21ba,_0x30db50){return function(_0x124281){_0x30db50[_0x9b8f('0x4')](_0x2b21ba,_0x124281);};}function removeListener(_0x21f4e9,_0x4627f5){return function(){VoiceQueueEvents[_0x9b8f('0x5')](_0x21f4e9,_0x4627f5);};}exports[_0x9b8f('0x6')]=function(_0x1b80a6){for(var _0x4854f9=0x0,_0x5eb03d=events[_0x9b8f('0x7')];_0x4854f9<_0x5eb03d;_0x4854f9++){var _0x5318eb=events[_0x4854f9];var _0x3dbe0d=createListener('voiceQueue:'+_0x5318eb,_0x1b80a6);VoiceQueueEvents['on'](_0x5318eb,_0x3dbe0d);}}; \ No newline at end of file +var _0xd012=['emit','removeListener','register','voiceQueue:','./voiceQueue.events','remove','update'];(function(_0x4521e3,_0x10a8a4){var _0x46a272=function(_0x2f4c64){while(--_0x2f4c64){_0x4521e3['push'](_0x4521e3['shift']());}};_0x46a272(++_0x10a8a4);}(_0xd012,0x169));var _0x2d01=function(_0x3c6821,_0x8850f0){_0x3c6821=_0x3c6821-0x0;var _0xd19c80=_0xd012[_0x3c6821];return _0xd19c80;};'use strict';var VoiceQueueEvents=require(_0x2d01('0x0'));var events=['save',_0x2d01('0x1'),_0x2d01('0x2')];function createListener(_0x4eec7e,_0x20e45f){return function(_0x13b2e1){_0x20e45f[_0x2d01('0x3')](_0x4eec7e,_0x13b2e1);};}function removeListener(_0x2b3e59,_0x5c9437){return function(){VoiceQueueEvents[_0x2d01('0x4')](_0x2b3e59,_0x5c9437);};}exports[_0x2d01('0x5')]=function(_0x50ad2e){for(var _0x1f29f6=0x0,_0x3cc964=events['length'];_0x1f29f6<_0x3cc964;_0x1f29f6++){var _0x2e15e5=events[_0x1f29f6];var _0x2254f8=createListener(_0x2d01('0x6')+_0x2e15e5,_0x50ad2e);VoiceQueueEvents['on'](_0x2e15e5,_0x2254f8);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index aac2425..7f89b6e 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 _0x9810=['destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','create','put'];(function(_0x227591,_0x4f60b2){var _0x4c899a=function(_0x146bef){while(--_0x146bef){_0x227591['push'](_0x227591['shift']());}};_0x4c899a(++_0x4f60b2);}(_0x9810,0x145));var _0x0981=function(_0x30f5bb,_0x4db4bd){_0x30f5bb=_0x30f5bb-0x0;var _0x1cfc00=_0x9810[_0x30f5bb];return _0x1cfc00;};'use strict';var multer=require(_0x0981('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0981('0x1'));var express=require(_0x0981('0x2'));var router=express[_0x0981('0x3')]();var auth=require(_0x0981('0x4'));var interaction=require(_0x0981('0x5'));var config=require('../../config/environment');var controller=require(_0x0981('0x6'));router[_0x0981('0x7')]('/',auth[_0x0981('0x8')](),controller[_0x0981('0x9')]);router[_0x0981('0x7')](_0x0981('0xa'),auth[_0x0981('0x8')](),controller[_0x0981('0xb')]);router[_0x0981('0x7')](_0x0981('0xc'),auth[_0x0981('0x8')](),controller[_0x0981('0xd')]);router['get'](_0x0981('0xe'),auth[_0x0981('0x8')](),controller['show']);router['post']('/',auth[_0x0981('0x8')](),controller[_0x0981('0xf')]);router[_0x0981('0x10')](_0x0981('0xe'),auth[_0x0981('0x8')](),controller['update']);router['delete'](_0x0981('0xe'),auth[_0x0981('0x8')](),controller[_0x0981('0x11')]);module[_0x0981('0x12')]=router; \ No newline at end of file +var _0xf8c1=['connect-timeout','express','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','/:id','show','post','create','put','delete','destroy','exports','util','path'];(function(_0x4cb4bb,_0x4db619){var _0x30aa2b=function(_0x1c76a4){while(--_0x1c76a4){_0x4cb4bb['push'](_0x4cb4bb['shift']());}};_0x30aa2b(++_0x4db619);}(_0xf8c1,0x91));var _0x1f8c=function(_0x269d0f,_0x544169){_0x269d0f=_0x269d0f-0x0;var _0x2d0ba3=_0xf8c1[_0x269d0f];return _0x2d0ba3;};'use strict';var multer=require('multer');var util=require(_0x1f8c('0x0'));var path=require(_0x1f8c('0x1'));var timeout=require(_0x1f8c('0x2'));var express=require(_0x1f8c('0x3'));var router=express['Router']();var auth=require(_0x1f8c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1f8c('0x5'));var controller=require(_0x1f8c('0x6'));router[_0x1f8c('0x7')]('/',auth[_0x1f8c('0x8')](),controller[_0x1f8c('0x9')]);router['get'](_0x1f8c('0xa'),auth[_0x1f8c('0x8')](),controller[_0x1f8c('0xb')]);router[_0x1f8c('0x7')](_0x1f8c('0xc'),auth[_0x1f8c('0x8')](),controller['getVoiceQueuesReport']);router[_0x1f8c('0x7')](_0x1f8c('0xd'),auth[_0x1f8c('0x8')](),controller[_0x1f8c('0xe')]);router[_0x1f8c('0xf')]('/',auth[_0x1f8c('0x8')](),controller[_0x1f8c('0x10')]);router[_0x1f8c('0x11')](_0x1f8c('0xd'),auth[_0x1f8c('0x8')](),controller['update']);router[_0x1f8c('0x12')](_0x1f8c('0xd'),auth[_0x1f8c('0x8')](),controller[_0x1f8c('0x13')]);module[_0x1f8c('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index a394fac..f075cab 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 _0x7448=['sequelize','exports','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x106214,_0x454b8d){var _0x5f5cea=function(_0x247841){while(--_0x247841){_0x106214['push'](_0x106214['shift']());}};_0x5f5cea(++_0x454b8d);}(_0x7448,0xc4));var _0x8744=function(_0xa634ad,_0x27959e){_0xa634ad=_0xa634ad-0x0;var _0x4defef=_0x7448[_0xa634ad];return _0x4defef;};'use strict';var Sequelize=require(_0x8744('0x0'));var moment=require('moment');module[_0x8744('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8744('0x2')]},'calleridnum':{'type':Sequelize[_0x8744('0x2')]},'calleridname':{'type':Sequelize[_0x8744('0x2')]},'queue':{'type':Sequelize[_0x8744('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x8744('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x44dd45){var _0x3186e7=moment(_0x44dd45);var _0x5e28ff=moment(this[_0x8744('0x4')](_0x8744('0x5')))['format'](_0x8744('0x6'));var _0xab8841=_0x3186e7[_0x8744('0x7')](_0x5e28ff,'seconds');this[_0x8744('0x8')](_0x8744('0x9'),_0x44dd45);this['setDataValue'](_0x8744('0xa'),_0xab8841||null);}},'position':{'type':Sequelize[_0x8744('0xb')]},'count':{'type':Sequelize[_0x8744('0xb')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x8744('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x8744('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x8744('0x3')]},'queuecallerexit':{'type':Sequelize[_0x8744('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x8744('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x8744('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x8744('0xb')]},'channel':{'type':Sequelize[_0x8744('0x2')]},'connectedlinenum':{'type':Sequelize[_0x8744('0x2')]},'connectedlinename':{'type':Sequelize[_0x8744('0x2')]},'accountcode':{'type':Sequelize[_0x8744('0x2')]},'context':{'type':Sequelize[_0x8744('0x2')]},'exten':{'type':Sequelize[_0x8744('0x2')]},'priority':{'type':Sequelize[_0x8744('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x8744('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8744('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x8744('0x2')]},'transfer':{'type':Sequelize[_0x8744('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8744('0x2')],'comment':_0x8744('0xd')},'transferexten':{'type':Sequelize[_0x8744('0x2')]},'transferuniqueid':{'type':Sequelize[_0x8744('0x2')]},'disposition':{'type':Sequelize[_0x8744('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4a02=['setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','diff','queuecallerleaveAt'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x4a02,0x18d));var _0x24a0=function(_0x902037,_0x1ea45c){_0x902037=_0x902037-0x0;var _0x12982c=_0x4a02[_0x902037];return _0x12982c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x24a0('0x0'));module[_0x24a0('0x1')]={'type':{'type':Sequelize[_0x24a0('0x2')]},'uniqueid':{'type':Sequelize[_0x24a0('0x2')]},'calleridnum':{'type':Sequelize[_0x24a0('0x2')]},'calleridname':{'type':Sequelize[_0x24a0('0x2')]},'queue':{'type':Sequelize[_0x24a0('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x24a0('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x24a0('0x3')],'set':function(_0x55e962){var _0x40ac94=moment(_0x55e962);var _0x116490=moment(this[_0x24a0('0x4')](_0x24a0('0x5')))[_0x24a0('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0xb519f6=_0x40ac94[_0x24a0('0x7')](_0x116490,'seconds');this['setDataValue'](_0x24a0('0x8'),_0x55e962);this[_0x24a0('0x9')](_0x24a0('0xa'),_0xb519f6||null);}},'position':{'type':Sequelize[_0x24a0('0xb')]},'count':{'type':Sequelize[_0x24a0('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x24a0('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x24a0('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x24a0('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x24a0('0x2')],'comment':_0x24a0('0xd')},'originalposition':{'type':Sequelize[_0x24a0('0xb')]},'channel':{'type':Sequelize[_0x24a0('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x24a0('0x2')]},'accountcode':{'type':Sequelize[_0x24a0('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x24a0('0x2')]},'priority':{'type':Sequelize[_0x24a0('0x2')]},'holdtime':{'type':Sequelize[_0x24a0('0xb')]},'mohtime':{'type':Sequelize[_0x24a0('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x24a0('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x24a0('0x2')]},'transfer':{'type':Sequelize[_0x24a0('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x24a0('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x24a0('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x24a0('0x2')]},'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 e66d2f2..5ceb79e 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 _0x3617=['options','create','body','find','describe','getVoiceQueuesReport','findAll','rows','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./voiceQueueReport.socket','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','update','destroy','error','stack','name','send','VoiceQueueReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','key','VIRTUAL','field','filter','then','includeAll','include','catch','show','params'];(function(_0x3485cd,_0x2d6e90){var _0x3209fc=function(_0x85c116){while(--_0x85c116){_0x3485cd['push'](_0x3485cd['shift']());}};_0x3209fc(++_0x2d6e90);}(_0x3617,0xec));var _0x7361=function(_0xa8407a,_0x434b7a){_0xa8407a=_0xa8407a-0x0;var _0x168283=_0x3617[_0xa8407a];return _0x168283;};'use strict';var pdf=require(_0x7361('0x0'));var emlformat=require(_0x7361('0x1'));var rimraf=require(_0x7361('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7361('0x3'));var moment=require('moment');var BPromise=require(_0x7361('0x4'));var Mustache=require(_0x7361('0x5'));var util=require(_0x7361('0x6'));var path=require(_0x7361('0x7'));var sox=require(_0x7361('0x8'));var csv=require('to-csv');var ejs=require(_0x7361('0x9'));var fs=require('fs');var _=require(_0x7361('0xa'));var squel=require('squel');var crypto=require(_0x7361('0xb'));var jsforce=require(_0x7361('0xc'));var deskjs=require(_0x7361('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7361('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7361('0xf'));var qs=require(_0x7361('0x10'));var hardwareService=require(_0x7361('0x11'));var logger=require('../../config/logger')(_0x7361('0x12'));var utils=require(_0x7361('0x13'));var config=require(_0x7361('0x14'));var db=require(_0x7361('0x15'))['db'];config['redis']=_[_0x7361('0x16')](config[_0x7361('0x17')],{'host':_0x7361('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7361('0x17')]));require(_0x7361('0x19'))['register'](socket);function respondWithStatusCode(_0x4a1eb8,_0x4579fb){_0x4579fb=_0x4579fb||0xcc;return function(_0x1654a4){if(_0x1654a4){return _0x4a1eb8[_0x7361('0x1a')](_0x4579fb);}return _0x4a1eb8[_0x7361('0x1b')](_0x4579fb)[_0x7361('0x1c')]();};}function respondWithResult(_0x9d55a2,_0x4da9b3){_0x4da9b3=_0x4da9b3||0xc8;return function(_0x5a4257){if(_0x5a4257){return _0x9d55a2[_0x7361('0x1b')](_0x4da9b3)[_0x7361('0x1d')](_0x5a4257);}};}function respondWithFilteredResult(_0x2cd410,_0x440bfa){return function(_0x1dc33b){if(_0x1dc33b){var _0x69ee5e=_0x1dc33b[_0x7361('0x1e')],_0x23dae2=_0x440bfa[_0x7361('0x1f')],_0x529194=_0x440bfa['offset']+_0x440bfa[_0x7361('0x20')],_0x41665b;if(_0x529194>=_0x69ee5e){_0x529194=_0x69ee5e;_0x41665b=0xc8;}else{_0x41665b=0xce;}_0x2cd410[_0x7361('0x1b')](_0x41665b);return _0x2cd410['set'](_0x7361('0x21'),_0x23dae2+'-'+_0x529194+'/'+_0x69ee5e)['json'](_0x1dc33b);}return null;};}function patchUpdates(_0x2daec2){return function(_0x559611){try{jsonpatch[_0x7361('0x22')](_0x559611,_0x2daec2,!![]);}catch(_0x2927c6){return BPromise['reject'](_0x2927c6);}return _0x559611['save']();};}function saveUpdates(_0x51074f,_0x4ed1af){return function(_0x83e8bf){if(_0x83e8bf){return _0x83e8bf[_0x7361('0x23')](_0x51074f)['then'](function(_0x243f27){return _0x243f27;});}return null;};}function removeEntity(_0x2a3b7e,_0x3855e5){return function(_0x292939){if(_0x292939){return _0x292939[_0x7361('0x24')]()['then'](function(){_0x2a3b7e[_0x7361('0x1b')](0xcc)[_0x7361('0x1c')]();});}};}function handleEntityNotFound(_0x26531a,_0x2d9fc0){return function(_0x184b66){if(!_0x184b66){_0x26531a['sendStatus'](0x194);}return _0x184b66;};}function handleError(_0x5e691b,_0x21a8f8){_0x21a8f8=_0x21a8f8||0x1f4;return function(_0x2654ef){logger[_0x7361('0x25')](_0x2654ef[_0x7361('0x26')]);if(_0x2654ef[_0x7361('0x27')]){delete _0x2654ef['name'];}_0x5e691b['status'](_0x21a8f8)[_0x7361('0x28')](_0x2654ef);};}exports['index']=function(_0x568ef1,_0x292e72){var _0x5a385b={},_0x4e12b7={},_0x4225fb={'count':0x0,'rows':[]};var _0x407f0e=db[_0x7361('0x29')][_0x7361('0x2a')];_0x4e12b7[_0x7361('0x2b')]=_[_0x7361('0x2c')](_0x407f0e);_0x4e12b7[_0x7361('0x2d')]=_[_0x7361('0x2c')](_0x568ef1['query']);_0x4e12b7[_0x7361('0x2e')]=_[_0x7361('0x2f')](_0x4e12b7[_0x7361('0x2b')],_0x4e12b7[_0x7361('0x2d')]);_0x5a385b[_0x7361('0x30')]=_[_0x7361('0x2f')](_0x4e12b7[_0x7361('0x2b')],qs[_0x7361('0x31')](_0x568ef1[_0x7361('0x2d')][_0x7361('0x31')]));_0x5a385b[_0x7361('0x30')]=_0x5a385b[_0x7361('0x30')][_0x7361('0x32')]?_0x5a385b[_0x7361('0x30')]:_0x4e12b7[_0x7361('0x2b')];if(!_0x568ef1[_0x7361('0x2d')][_0x7361('0x33')](_0x7361('0x34'))){_0x5a385b[_0x7361('0x20')]=qs[_0x7361('0x20')](_0x568ef1[_0x7361('0x2d')][_0x7361('0x20')]);_0x5a385b[_0x7361('0x1f')]=qs[_0x7361('0x1f')](_0x568ef1['query'][_0x7361('0x1f')]);}_0x5a385b[_0x7361('0x35')]=qs[_0x7361('0x36')](_0x568ef1[_0x7361('0x2d')]['sort']);_0x5a385b[_0x7361('0x37')]=qs[_0x7361('0x2e')](_[_0x7361('0x38')](_0x568ef1[_0x7361('0x2d')],_0x4e12b7[_0x7361('0x2e')]));if(_0x568ef1['query']['filter']){_0x5a385b[_0x7361('0x37')]=_[_0x7361('0x39')](_0x5a385b[_0x7361('0x37')],{'$or':_['map'](_0x407f0e,function(_0x5e1334){if(_0x5e1334['type'][_0x7361('0x3a')]!==_0x7361('0x3b')){var _0x122722={};_0x122722[_0x5e1334[_0x7361('0x3c')]]={'$like':'%'+_0x568ef1['query'][_0x7361('0x3d')]+'%'};return _0x122722;}})});}_0x5a385b=_[_0x7361('0x39')]({},_0x5a385b,_0x568ef1['options']);var _0x4a5ebb={'where':_0x5a385b[_0x7361('0x37')]};return db[_0x7361('0x29')]['count'](_0x4a5ebb)[_0x7361('0x3e')](function(_0x4b7da8){_0x4225fb['count']=_0x4b7da8;if(_0x568ef1[_0x7361('0x2d')][_0x7361('0x3f')]){_0x5a385b[_0x7361('0x40')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x5a385b);})[_0x7361('0x3e')](function(_0x504594){_0x4225fb['rows']=_0x504594;return _0x4225fb;})[_0x7361('0x3e')](respondWithFilteredResult(_0x292e72,_0x5a385b))[_0x7361('0x41')](handleError(_0x292e72,null));};exports[_0x7361('0x42')]=function(_0x2f511c,_0x534a6f){var _0x288327={'raw':![],'where':{'id':_0x2f511c[_0x7361('0x43')]['id']}},_0x51effa={};_0x51effa[_0x7361('0x2b')]=_[_0x7361('0x2c')](db[_0x7361('0x29')][_0x7361('0x2a')]);_0x51effa[_0x7361('0x2d')]=_[_0x7361('0x2c')](_0x2f511c[_0x7361('0x2d')]);_0x51effa[_0x7361('0x2e')]=_[_0x7361('0x2f')](_0x51effa[_0x7361('0x2b')],_0x51effa[_0x7361('0x2d')]);_0x288327['attributes']=_[_0x7361('0x2f')](_0x51effa[_0x7361('0x2b')],qs[_0x7361('0x31')](_0x2f511c['query']['fields']));_0x288327[_0x7361('0x30')]=_0x288327[_0x7361('0x30')][_0x7361('0x32')]?_0x288327['attributes']:_0x51effa[_0x7361('0x2b')];if(_0x2f511c[_0x7361('0x2d')]['includeAll']){_0x288327[_0x7361('0x40')]=[{'all':!![]}];}_0x288327=_[_0x7361('0x39')]({},_0x288327,_0x2f511c[_0x7361('0x44')]);return db[_0x7361('0x29')]['find'](_0x288327)[_0x7361('0x3e')](handleEntityNotFound(_0x534a6f,null))[_0x7361('0x3e')](respondWithResult(_0x534a6f,null))[_0x7361('0x41')](handleError(_0x534a6f,null));};exports[_0x7361('0x45')]=function(_0x2ce7a0,_0x84bd85){return db[_0x7361('0x29')][_0x7361('0x45')](_0x2ce7a0[_0x7361('0x46')],{})['then'](respondWithResult(_0x84bd85,0xc9))['catch'](handleError(_0x84bd85,null));};exports[_0x7361('0x23')]=function(_0x148313,_0x531ae4){if(_0x148313[_0x7361('0x46')]['id']){delete _0x148313[_0x7361('0x46')]['id'];}return db[_0x7361('0x29')][_0x7361('0x47')]({'where':{'id':_0x148313[_0x7361('0x43')]['id']}})[_0x7361('0x3e')](handleEntityNotFound(_0x531ae4,null))[_0x7361('0x3e')](saveUpdates(_0x148313['body'],null))[_0x7361('0x3e')](respondWithResult(_0x531ae4,null))[_0x7361('0x41')](handleError(_0x531ae4,null));};exports[_0x7361('0x24')]=function(_0x2f0fdb,_0x22dc7d){return db[_0x7361('0x29')][_0x7361('0x47')]({'where':{'id':_0x2f0fdb['params']['id']}})[_0x7361('0x3e')](handleEntityNotFound(_0x22dc7d,null))[_0x7361('0x3e')](removeEntity(_0x22dc7d,null))[_0x7361('0x41')](handleError(_0x22dc7d,null));};exports['describe']=function(_0x55aa25,_0x3085c3){return db['VoiceQueueReport'][_0x7361('0x48')]()[_0x7361('0x3e')](respondWithResult(_0x3085c3,null))[_0x7361('0x41')](handleError(_0x3085c3,null));};exports[_0x7361('0x49')]=function(_0x5725d6,_0x5362db){var _0x26b660={},_0x1c05b0={},_0x3a912a={'count':0x0,'rows':[]};_0x1c05b0[_0x7361('0x2b')]=_['keys'](db[_0x7361('0x29')][_0x7361('0x2a')]);_0x1c05b0[_0x7361('0x2d')]=_[_0x7361('0x2c')](_0x5725d6[_0x7361('0x2d')]);_0x1c05b0[_0x7361('0x2e')]=_[_0x7361('0x2f')](_0x1c05b0[_0x7361('0x2b')],_0x1c05b0[_0x7361('0x2d')]);_0x26b660[_0x7361('0x30')]=_[_0x7361('0x2f')](_0x1c05b0[_0x7361('0x2b')],qs[_0x7361('0x31')](_0x5725d6[_0x7361('0x2d')][_0x7361('0x31')]));_0x26b660[_0x7361('0x30')]=_0x26b660[_0x7361('0x30')]['length']?_0x26b660['attributes']:_0x1c05b0['model'];if(!_0x5725d6['query'][_0x7361('0x33')](_0x7361('0x34'))){_0x26b660['limit']=qs[_0x7361('0x20')](_0x5725d6[_0x7361('0x2d')][_0x7361('0x20')]);_0x26b660[_0x7361('0x1f')]=qs[_0x7361('0x1f')](_0x5725d6['query'][_0x7361('0x1f')]);}_0x26b660[_0x7361('0x35')]=qs['sort'](_0x5725d6[_0x7361('0x2d')][_0x7361('0x36')]);_0x26b660[_0x7361('0x37')]=qs[_0x7361('0x2e')](_['pick'](_0x5725d6[_0x7361('0x2d')],_0x1c05b0['filters']));if(_0x5725d6[_0x7361('0x2d')][_0x7361('0x3d')]){_0x26b660[_0x7361('0x37')]=_[_0x7361('0x39')](_0x26b660[_0x7361('0x37')],{'$or':_['map'](_0x26b660['attributes'],function(_0x33b679){var _0x19f1e1={};_0x19f1e1[_0x33b679]={'$like':'%'+_0x5725d6[_0x7361('0x2d')][_0x7361('0x3d')]+'%'};return _0x19f1e1;})});}_0x26b660=_[_0x7361('0x39')]({},_0x26b660,_0x5725d6[_0x7361('0x44')]);var _0x44f76c={'where':_0x26b660['where']};return db[_0x7361('0x29')][_0x7361('0x1e')](_0x44f76c)['then'](function(_0x56ab7d){_0x3a912a[_0x7361('0x1e')]=_0x56ab7d;if(_0x5725d6['query'][_0x7361('0x3f')]){_0x26b660[_0x7361('0x40')]=[{'all':!![]}];}return db[_0x7361('0x29')][_0x7361('0x4a')](_0x26b660);})[_0x7361('0x3e')](function(_0x43647e){_0x3a912a[_0x7361('0x4b')]=_0x43647e;return _0x3a912a;})['then'](respondWithFilteredResult(_0x5362db,_0x26b660,_0x7361('0x49')))[_0x7361('0x41')](handleError(_0x5362db,null,_0x7361('0x49')));}; \ No newline at end of file +var _0xc38e=['redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','error','name','send','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','key','VIRTUAL','field','VoiceQueueReport','includeAll','findAll','rows','catch','show','include','options','create','body','find','destroy','params','describe','map','getVoiceQueuesReport','eml-format','rimraf','zip-dir','request-promise','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb'];(function(_0x21b993,_0x276857){var _0x2d9fbc=function(_0x4aadcc){while(--_0x4aadcc){_0x21b993['push'](_0x21b993['shift']());}};_0x2d9fbc(++_0x276857);}(_0xc38e,0x115));var _0xec38=function(_0xbf9c9e,_0x18bada){_0xbf9c9e=_0xbf9c9e-0x0;var _0x1cb6ad=_0xc38e[_0xbf9c9e];return _0x1cb6ad;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xec38('0x0'));var rimraf=require(_0xec38('0x1'));var zipdir=require(_0xec38('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec38('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xec38('0x4'));var sox=require('sox');var csv=require(_0xec38('0x5'));var ejs=require(_0xec38('0x6'));var fs=require('fs');var _=require(_0xec38('0x7'));var squel=require(_0xec38('0x8'));var crypto=require('crypto');var jsforce=require(_0xec38('0x9'));var deskjs=require(_0xec38('0xa'));var toCsv=require(_0xec38('0x5'));var querystring=require(_0xec38('0xb'));var Papa=require(_0xec38('0xc'));var Redis=require(_0xec38('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xec38('0xe'));var hardwareService=require(_0xec38('0xf'));var logger=require('../../config/logger')(_0xec38('0x10'));var utils=require(_0xec38('0x11'));var config=require('../../config/environment');var db=require(_0xec38('0x12'))['db'];config[_0xec38('0x13')]=_['defaults'](config[_0xec38('0x13')],{'host':_0xec38('0x14'),'port':0x18eb});var socket=require(_0xec38('0x15'))(new Redis(config[_0xec38('0x13')]));require('./voiceQueueReport.socket')[_0xec38('0x16')](socket);function respondWithStatusCode(_0x4f6ac6,_0x3da210){_0x3da210=_0x3da210||0xcc;return function(_0x4af656){if(_0x4af656){return _0x4f6ac6[_0xec38('0x17')](_0x3da210);}return _0x4f6ac6[_0xec38('0x18')](_0x3da210)[_0xec38('0x19')]();};}function respondWithResult(_0x26f1c0,_0x7d6177){_0x7d6177=_0x7d6177||0xc8;return function(_0x4987b7){if(_0x4987b7){return _0x26f1c0[_0xec38('0x18')](_0x7d6177)[_0xec38('0x1a')](_0x4987b7);}};}function respondWithFilteredResult(_0x5764f9,_0x2aa560){return function(_0x3a93c7){if(_0x3a93c7){var _0xa369ff=_0x3a93c7[_0xec38('0x1b')],_0x307188=_0x2aa560['offset'],_0x577db1=_0x2aa560[_0xec38('0x1c')]+_0x2aa560[_0xec38('0x1d')],_0x5840c1;if(_0x577db1>=_0xa369ff){_0x577db1=_0xa369ff;_0x5840c1=0xc8;}else{_0x5840c1=0xce;}_0x5764f9[_0xec38('0x18')](_0x5840c1);return _0x5764f9[_0xec38('0x1e')](_0xec38('0x1f'),_0x307188+'-'+_0x577db1+'/'+_0xa369ff)['json'](_0x3a93c7);}return null;};}function patchUpdates(_0x294feb){return function(_0x521ec0){try{jsonpatch['apply'](_0x521ec0,_0x294feb,!![]);}catch(_0x108f16){return BPromise['reject'](_0x108f16);}return _0x521ec0[_0xec38('0x20')]();};}function saveUpdates(_0x500f79,_0x590b72){return function(_0x347fb4){if(_0x347fb4){return _0x347fb4[_0xec38('0x21')](_0x500f79)[_0xec38('0x22')](function(_0x2eb69f){return _0x2eb69f;});}return null;};}function removeEntity(_0x216464,_0x171270){return function(_0x1347bc){if(_0x1347bc){return _0x1347bc['destroy']()['then'](function(){_0x216464[_0xec38('0x18')](0xcc)[_0xec38('0x19')]();});}};}function handleEntityNotFound(_0x8f2797,_0xf60710){return function(_0x30326){if(!_0x30326){_0x8f2797[_0xec38('0x17')](0x194);}return _0x30326;};}function handleError(_0x35598c,_0x25d547){_0x25d547=_0x25d547||0x1f4;return function(_0x349f74){logger[_0xec38('0x23')](_0x349f74['stack']);if(_0x349f74[_0xec38('0x24')]){delete _0x349f74['name'];}_0x35598c[_0xec38('0x18')](_0x25d547)[_0xec38('0x25')](_0x349f74);};}exports['index']=function(_0x55749b,_0x4545cc){var _0x205efc={},_0x51730e={},_0x507765={'count':0x0,'rows':[]};var _0x1a17ba=db['VoiceQueueReport'][_0xec38('0x26')];_0x51730e[_0xec38('0x27')]=_[_0xec38('0x28')](_0x1a17ba);_0x51730e['query']=_['keys'](_0x55749b[_0xec38('0x29')]);_0x51730e['filters']=_[_0xec38('0x2a')](_0x51730e[_0xec38('0x27')],_0x51730e[_0xec38('0x29')]);_0x205efc[_0xec38('0x2b')]=_[_0xec38('0x2a')](_0x51730e[_0xec38('0x27')],qs['fields'](_0x55749b[_0xec38('0x29')][_0xec38('0x2c')]));_0x205efc[_0xec38('0x2b')]=_0x205efc[_0xec38('0x2b')][_0xec38('0x2d')]?_0x205efc[_0xec38('0x2b')]:_0x51730e[_0xec38('0x27')];if(!_0x55749b['query'][_0xec38('0x2e')](_0xec38('0x2f'))){_0x205efc[_0xec38('0x1d')]=qs[_0xec38('0x1d')](_0x55749b['query'][_0xec38('0x1d')]);_0x205efc['offset']=qs['offset'](_0x55749b[_0xec38('0x29')][_0xec38('0x1c')]);}_0x205efc[_0xec38('0x30')]=qs[_0xec38('0x31')](_0x55749b[_0xec38('0x29')][_0xec38('0x31')]);_0x205efc[_0xec38('0x32')]=qs[_0xec38('0x33')](_[_0xec38('0x34')](_0x55749b[_0xec38('0x29')],_0x51730e[_0xec38('0x33')]));if(_0x55749b[_0xec38('0x29')][_0xec38('0x35')]){_0x205efc[_0xec38('0x32')]=_[_0xec38('0x36')](_0x205efc[_0xec38('0x32')],{'$or':_['map'](_0x1a17ba,function(_0x3def62){if(_0x3def62['type'][_0xec38('0x37')]!==_0xec38('0x38')){var _0x22792e={};_0x22792e[_0x3def62[_0xec38('0x39')]]={'$like':'%'+_0x55749b[_0xec38('0x29')][_0xec38('0x35')]+'%'};return _0x22792e;}})});}_0x205efc=_['merge']({},_0x205efc,_0x55749b['options']);var _0x50ccfe={'where':_0x205efc[_0xec38('0x32')]};return db[_0xec38('0x3a')][_0xec38('0x1b')](_0x50ccfe)[_0xec38('0x22')](function(_0x204ff6){_0x507765[_0xec38('0x1b')]=_0x204ff6;if(_0x55749b[_0xec38('0x29')][_0xec38('0x3b')]){_0x205efc['include']=[{'all':!![]}];}return db[_0xec38('0x3a')][_0xec38('0x3c')](_0x205efc);})[_0xec38('0x22')](function(_0x20797d){_0x507765[_0xec38('0x3d')]=_0x20797d;return _0x507765;})[_0xec38('0x22')](respondWithFilteredResult(_0x4545cc,_0x205efc))[_0xec38('0x3e')](handleError(_0x4545cc,null));};exports[_0xec38('0x3f')]=function(_0x30540f,_0x340361){var _0x353d9a={'raw':![],'where':{'id':_0x30540f['params']['id']}},_0x418ee1={};_0x418ee1['model']=_[_0xec38('0x28')](db[_0xec38('0x3a')][_0xec38('0x26')]);_0x418ee1[_0xec38('0x29')]=_[_0xec38('0x28')](_0x30540f['query']);_0x418ee1['filters']=_[_0xec38('0x2a')](_0x418ee1[_0xec38('0x27')],_0x418ee1[_0xec38('0x29')]);_0x353d9a['attributes']=_[_0xec38('0x2a')](_0x418ee1[_0xec38('0x27')],qs['fields'](_0x30540f[_0xec38('0x29')]['fields']));_0x353d9a[_0xec38('0x2b')]=_0x353d9a['attributes']['length']?_0x353d9a[_0xec38('0x2b')]:_0x418ee1[_0xec38('0x27')];if(_0x30540f['query'][_0xec38('0x3b')]){_0x353d9a[_0xec38('0x40')]=[{'all':!![]}];}_0x353d9a=_[_0xec38('0x36')]({},_0x353d9a,_0x30540f[_0xec38('0x41')]);return db['VoiceQueueReport']['find'](_0x353d9a)[_0xec38('0x22')](handleEntityNotFound(_0x340361,null))[_0xec38('0x22')](respondWithResult(_0x340361,null))[_0xec38('0x3e')](handleError(_0x340361,null));};exports[_0xec38('0x42')]=function(_0xfd84c5,_0x5c696c){return db[_0xec38('0x3a')][_0xec38('0x42')](_0xfd84c5[_0xec38('0x43')],{})[_0xec38('0x22')](respondWithResult(_0x5c696c,0xc9))['catch'](handleError(_0x5c696c,null));};exports[_0xec38('0x21')]=function(_0x16d7ed,_0x2bd76f){if(_0x16d7ed[_0xec38('0x43')]['id']){delete _0x16d7ed['body']['id'];}return db['VoiceQueueReport'][_0xec38('0x44')]({'where':{'id':_0x16d7ed['params']['id']}})[_0xec38('0x22')](handleEntityNotFound(_0x2bd76f,null))['then'](saveUpdates(_0x16d7ed[_0xec38('0x43')],null))[_0xec38('0x22')](respondWithResult(_0x2bd76f,null))[_0xec38('0x3e')](handleError(_0x2bd76f,null));};exports[_0xec38('0x45')]=function(_0x392636,_0x1910a1){return db[_0xec38('0x3a')][_0xec38('0x44')]({'where':{'id':_0x392636[_0xec38('0x46')]['id']}})[_0xec38('0x22')](handleEntityNotFound(_0x1910a1,null))[_0xec38('0x22')](removeEntity(_0x1910a1,null))[_0xec38('0x3e')](handleError(_0x1910a1,null));};exports[_0xec38('0x47')]=function(_0x282e4e,_0x59a653){return db['VoiceQueueReport'][_0xec38('0x47')]()[_0xec38('0x22')](respondWithResult(_0x59a653,null))[_0xec38('0x3e')](handleError(_0x59a653,null));};exports['getVoiceQueuesReport']=function(_0x46e464,_0x520103){var _0x2b2533={},_0x341f49={},_0x204efa={'count':0x0,'rows':[]};_0x341f49[_0xec38('0x27')]=_[_0xec38('0x28')](db[_0xec38('0x3a')][_0xec38('0x26')]);_0x341f49[_0xec38('0x29')]=_['keys'](_0x46e464[_0xec38('0x29')]);_0x341f49[_0xec38('0x33')]=_['intersection'](_0x341f49['model'],_0x341f49['query']);_0x2b2533['attributes']=_[_0xec38('0x2a')](_0x341f49[_0xec38('0x27')],qs[_0xec38('0x2c')](_0x46e464['query'][_0xec38('0x2c')]));_0x2b2533[_0xec38('0x2b')]=_0x2b2533[_0xec38('0x2b')]['length']?_0x2b2533['attributes']:_0x341f49[_0xec38('0x27')];if(!_0x46e464[_0xec38('0x29')][_0xec38('0x2e')]('nolimit')){_0x2b2533[_0xec38('0x1d')]=qs[_0xec38('0x1d')](_0x46e464['query'][_0xec38('0x1d')]);_0x2b2533[_0xec38('0x1c')]=qs[_0xec38('0x1c')](_0x46e464[_0xec38('0x29')]['offset']);}_0x2b2533[_0xec38('0x30')]=qs[_0xec38('0x31')](_0x46e464[_0xec38('0x29')][_0xec38('0x31')]);_0x2b2533[_0xec38('0x32')]=qs[_0xec38('0x33')](_[_0xec38('0x34')](_0x46e464[_0xec38('0x29')],_0x341f49[_0xec38('0x33')]));if(_0x46e464['query'][_0xec38('0x35')]){_0x2b2533[_0xec38('0x32')]=_[_0xec38('0x36')](_0x2b2533[_0xec38('0x32')],{'$or':_[_0xec38('0x48')](_0x2b2533['attributes'],function(_0x5a0b13){var _0x43ef17={};_0x43ef17[_0x5a0b13]={'$like':'%'+_0x46e464['query'][_0xec38('0x35')]+'%'};return _0x43ef17;})});}_0x2b2533=_[_0xec38('0x36')]({},_0x2b2533,_0x46e464[_0xec38('0x41')]);var _0x241c4b={'where':_0x2b2533[_0xec38('0x32')]};return db[_0xec38('0x3a')][_0xec38('0x1b')](_0x241c4b)[_0xec38('0x22')](function(_0x4dfb5c){_0x204efa[_0xec38('0x1b')]=_0x4dfb5c;if(_0x46e464[_0xec38('0x29')][_0xec38('0x3b')]){_0x2b2533['include']=[{'all':!![]}];}return db[_0xec38('0x3a')]['findAll'](_0x2b2533);})[_0xec38('0x22')](function(_0x32ea10){_0x204efa[_0xec38('0x3d')]=_0x32ea10;return _0x204efa;})[_0xec38('0x22')](respondWithFilteredResult(_0x520103,_0x2b2533,_0xec38('0x49')))[_0xec38('0x3e')](handleError(_0x520103,null,_0xec38('0x49')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index ac5f8b7..33fe7ed 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 _0x028b=['VoiceQueueReport','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x028b,0x1c0));var _0xb028=function(_0x5f5646,_0xfc2504){_0x5f5646=_0x5f5646-0x0;var _0x27f98f=_0x028b[_0x5f5646];return _0x27f98f;};'use strict';var EventEmitter=require(_0xb028('0x0'));var VoiceQueueReport=require(_0xb028('0x1'))['db'][_0xb028('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xb028('0x3')](0x0);var events={'afterCreate':_0xb028('0x4'),'afterUpdate':'update','afterDestroy':_0xb028('0x5')};function emitEvent(_0x372f94){return function(_0x694462,_0x26207a,_0x173d27){VoiceQueueReportEvents[_0xb028('0x6')](_0x372f94+':'+_0x694462['id'],_0x694462);VoiceQueueReportEvents[_0xb028('0x6')](_0x372f94,_0x694462);_0x173d27(null);};}for(var e in events){if(events[_0xb028('0x7')](e)){var event=events[e];VoiceQueueReport[_0xb028('0x8')](e,emitEvent(event));}}module[_0xb028('0x9')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x2fda=['save','update','remove','emit','hook','exports','events','setMaxListeners'];(function(_0x1eb8d0,_0x32d702){var _0x21f5a3=function(_0x5e8218){while(--_0x5e8218){_0x1eb8d0['push'](_0x1eb8d0['shift']());}};_0x21f5a3(++_0x32d702);}(_0x2fda,0x186));var _0xa2fd=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x2fda[_0x4c7fb5];return _0x2e10ac;};'use strict';var EventEmitter=require(_0xa2fd('0x0'));var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xa2fd('0x1')](0x0);var events={'afterCreate':_0xa2fd('0x2'),'afterUpdate':_0xa2fd('0x3'),'afterDestroy':_0xa2fd('0x4')};function emitEvent(_0x34cafb){return function(_0x5a36d9,_0x497c5f,_0x4e2ec8){VoiceQueueReportEvents[_0xa2fd('0x5')](_0x34cafb+':'+_0x5a36d9['id'],_0x5a36d9);VoiceQueueReportEvents[_0xa2fd('0x5')](_0x34cafb,_0x5a36d9);_0x4e2ec8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xa2fd('0x6')](e,emitEvent(event));}}module[_0xa2fd('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 90a8d8f..7831125 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 _0x9f37=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','./voiceQueueReport.attributes','exports','define','report_queue','uniqueid','calleridnum'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x9f37,0x1ee));var _0x79f3=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x9f37[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0x79f3('0x0'));var util=require(_0x79f3('0x1'));var logger=require(_0x79f3('0x2'))(_0x79f3('0x3'));var moment=require(_0x79f3('0x4'));var BPromise=require('bluebird');var rp=require(_0x79f3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x79f3('0x6'));var config=require('../../config/environment');var attributes=require(_0x79f3('0x7'));module[_0x79f3('0x8')]=function(_0x28bfe4,_0x1c976c){return _0x28bfe4[_0x79f3('0x9')]('VoiceQueueReport',attributes,{'tableName':_0x79f3('0xa'),'paranoid':![],'indexes':[{'fields':[_0x79f3('0xb')]},{'fields':[_0x79f3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2ba0=['../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x260343,_0x2af95e){var _0x5966de=function(_0x44b1ba){while(--_0x44b1ba){_0x260343['push'](_0x260343['shift']());}};_0x5966de(++_0x2af95e);}(_0x2ba0,0xd8));var _0x02ba=function(_0x29e83a,_0x4f14cd){_0x29e83a=_0x29e83a-0x0;var _0x31e3bb=_0x2ba0[_0x29e83a];return _0x31e3bb;};'use strict';var _=require(_0x02ba('0x0'));var util=require(_0x02ba('0x1'));var logger=require(_0x02ba('0x2'))(_0x02ba('0x3'));var moment=require(_0x02ba('0x4'));var BPromise=require(_0x02ba('0x5'));var rp=require(_0x02ba('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x02ba('0x7'));var config=require(_0x02ba('0x8'));var attributes=require(_0x02ba('0x9'));module[_0x02ba('0xa')]=function(_0x23b3ee,_0x2c5f55){return _0x23b3ee[_0x02ba('0xb')](_0x02ba('0xc'),attributes,{'tableName':_0x02ba('0xd'),'paranoid':![],'indexes':[{'fields':[_0x02ba('0xe')]},{'fields':[_0x02ba('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 5eba5e9..b94f44a 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 _0xbf68=['debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','attributes','limit','include','model','map','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','where','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x5097ad,_0x218598){var _0x5bb6ac=function(_0x283e0f){while(--_0x283e0f){_0x5097ad['push'](_0x5097ad['shift']());}};_0x5bb6ac(++_0x218598);}(_0xbf68,0xb6));var _0x8bf6=function(_0x14c9d3,_0x370839){_0x14c9d3=_0x14c9d3-0x0;var _0x40bbd6=_0xbf68[_0x14c9d3];return _0x40bbd6;};'use strict';var _=require('lodash');var util=require(_0x8bf6('0x0'));var moment=require('moment');var BPromise=require(_0x8bf6('0x1'));var rs=require(_0x8bf6('0x2'));var fs=require('fs');var Redis=require(_0x8bf6('0x3'));var db=require(_0x8bf6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8bf6('0x5'))(_0x8bf6('0x6'));var config=require(_0x8bf6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8bf6('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x8bf6('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x8bf6('0xa'))(new Redis(config[_0x8bf6('0x9')]));require(_0x8bf6('0xb'))[_0x8bf6('0xc')](socket);function respondWithRpcPromise(_0x1c9fff,_0xef01a3,_0x52722b){return new BPromise(function(_0x1aec1e,_0x3ff941){return client[_0x8bf6('0xd')](_0x1c9fff,_0x52722b)[_0x8bf6('0xe')](function(_0x511476){logger[_0x8bf6('0xf')](_0x8bf6('0x10'),_0xef01a3,_0x8bf6('0x11'));logger[_0x8bf6('0x12')](_0x8bf6('0x13'),_0xef01a3,'request\x20sent',JSON[_0x8bf6('0x14')](_0x511476));if(_0x511476[_0x8bf6('0x15')]){if(_0x511476[_0x8bf6('0x15')][_0x8bf6('0x16')]===0x1f4){logger[_0x8bf6('0x15')](_0x8bf6('0x10'),_0xef01a3,_0x511476[_0x8bf6('0x15')][_0x8bf6('0x17')]);return _0x3ff941(_0x511476[_0x8bf6('0x15')][_0x8bf6('0x17')]);}logger[_0x8bf6('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0xef01a3,_0x511476[_0x8bf6('0x15')][_0x8bf6('0x17')]);return _0x1aec1e(_0x511476[_0x8bf6('0x15')]['message']);}else{logger[_0x8bf6('0xf')](_0x8bf6('0x10'),_0xef01a3,_0x8bf6('0x11'));_0x1aec1e(_0x511476[_0x8bf6('0x18')][_0x8bf6('0x17')]);}})[_0x8bf6('0x19')](function(_0x34a719){logger[_0x8bf6('0x15')](_0x8bf6('0x10'),_0xef01a3,_0x34a719);_0x3ff941(_0x34a719);});});}exports[_0x8bf6('0x1a')]=function(_0x57ca90){var _0x3b2d1a=this;return new Promise(function(_0x3117cd,_0x5bc16a){return db[_0x8bf6('0x1b')][_0x8bf6('0x1c')]({'raw':_0x57ca90[_0x8bf6('0x1d')]?_0x57ca90[_0x8bf6('0x1d')][_0x8bf6('0x1e')]===undefined?!![]:![]:!![],'where':_0x57ca90['options']?_0x57ca90['options']['where']||null:null,'attributes':_0x57ca90[_0x8bf6('0x1d')]?_0x57ca90[_0x8bf6('0x1d')][_0x8bf6('0x1f')]||null:null,'limit':_0x57ca90[_0x8bf6('0x1d')]?_0x57ca90[_0x8bf6('0x1d')][_0x8bf6('0x20')]||null:null,'include':_0x57ca90['options']?_0x57ca90[_0x8bf6('0x1d')][_0x8bf6('0x21')]?_['map'](_0x57ca90[_0x8bf6('0x1d')][_0x8bf6('0x21')],function(_0x187783){return{'model':db[_0x187783[_0x8bf6('0x22')]],'as':_0x187783['as'],'attributes':_0x187783[_0x8bf6('0x1f')],'include':_0x187783['include']?_[_0x8bf6('0x23')](_0x187783[_0x8bf6('0x21')],function(_0x5b4857){return{'model':db[_0x5b4857[_0x8bf6('0x22')]],'as':_0x5b4857['as'],'attributes':_0x5b4857[_0x8bf6('0x1f')],'include':_0x5b4857[_0x8bf6('0x21')]?_['map'](_0x5b4857[_0x8bf6('0x21')],function(_0x2dcbbb){return{'model':db[_0x2dcbbb['model']],'as':_0x2dcbbb['as'],'attributes':_0x2dcbbb[_0x8bf6('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x292e12){logger[_0x8bf6('0xf')]('GetVoiceQueueReport',_0x57ca90);logger['debug'](_0x8bf6('0x1a'),_0x57ca90,JSON[_0x8bf6('0x14')](_0x292e12));_0x3117cd(_0x292e12);})[_0x8bf6('0x19')](function(_0x52422c){logger[_0x8bf6('0x15')]('GetVoiceQueueReport',_0x52422c[_0x8bf6('0x17')],_0x57ca90);_0x5bc16a(_0x3b2d1a[_0x8bf6('0x15')](0x1f4,_0x52422c[_0x8bf6('0x17')]));});});};exports[_0x8bf6('0x24')]=function(_0x5af3c5){var _0xe36529=this;return new Promise(function(_0x54ce2c,_0x2558a5){return db[_0x8bf6('0x1b')]['create'](_0x5af3c5[_0x8bf6('0x25')],{'raw':_0x5af3c5[_0x8bf6('0x1d')]?_0x5af3c5['options'][_0x8bf6('0x1e')]===undefined?!![]:![]:!![]})[_0x8bf6('0xe')](function(_0xe530b1){logger[_0x8bf6('0xf')]('CreateVoiceQueueReport',_0x5af3c5);logger[_0x8bf6('0x12')](_0x8bf6('0x24'),_0x5af3c5,JSON[_0x8bf6('0x14')](_0xe530b1));_0x54ce2c(_0xe530b1);})[_0x8bf6('0x19')](function(_0xe49e24){logger[_0x8bf6('0x15')](_0x8bf6('0x24'),_0xe49e24[_0x8bf6('0x17')],_0x5af3c5);_0x2558a5(_0xe36529['error'](0x1f4,_0xe49e24[_0x8bf6('0x17')]));});});};exports[_0x8bf6('0x26')]=function(_0x1cd6b1){var _0x7f20ea=this;return new Promise(function(_0x400d7f,_0x274c7e){return db[_0x8bf6('0x1b')]['update'](_0x1cd6b1[_0x8bf6('0x25')],{'raw':_0x1cd6b1[_0x8bf6('0x1d')]?_0x1cd6b1['options'][_0x8bf6('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cd6b1[_0x8bf6('0x1d')]?_0x1cd6b1[_0x8bf6('0x1d')][_0x8bf6('0x27')]||null:null,'attributes':_0x1cd6b1[_0x8bf6('0x1d')]?_0x1cd6b1[_0x8bf6('0x1d')]['attributes']||null:null,'limit':_0x1cd6b1['options']?_0x1cd6b1[_0x8bf6('0x1d')]['limit']||null:null})['then'](function(_0x3f06db){logger[_0x8bf6('0xf')](_0x8bf6('0x26'),_0x1cd6b1);logger['debug'](_0x8bf6('0x26'),_0x1cd6b1,JSON[_0x8bf6('0x14')](_0x3f06db));_0x400d7f(_0x3f06db);})[_0x8bf6('0x19')](function(_0x4251bc){logger[_0x8bf6('0x15')](_0x8bf6('0x26'),_0x4251bc['message'],_0x1cd6b1);_0x274c7e(_0x7f20ea[_0x8bf6('0x15')](0x1f4,_0x4251bc[_0x8bf6('0x17')]));});});}; \ No newline at end of file +var _0x2284=['then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','raw','options','where','attributes','include','map','model','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register'];(function(_0x2b6e79,_0x33cb5d){var _0x4e3eef=function(_0x4e7606){while(--_0x4e7606){_0x2b6e79['push'](_0x2b6e79['shift']());}};_0x4e3eef(++_0x33cb5d);}(_0x2284,0x18b));var _0x4228=function(_0x84d66c,_0x7fd8de){_0x84d66c=_0x84d66c-0x0;var _0xcd7052=_0x2284[_0x84d66c];return _0xcd7052;};'use strict';var _=require(_0x4228('0x0'));var util=require('util');var moment=require(_0x4228('0x1'));var BPromise=require(_0x4228('0x2'));var rs=require(_0x4228('0x3'));var fs=require('fs');var Redis=require(_0x4228('0x4'));var db=require(_0x4228('0x5'))['db'];var utils=require(_0x4228('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4228('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4228('0x8')][_0x4228('0x9')]({'port':0x232a});config[_0x4228('0xa')]=_['defaults'](config['redis'],{'host':_0x4228('0xb'),'port':0x18eb});var socket=require(_0x4228('0xc'))(new Redis(config[_0x4228('0xa')]));require(_0x4228('0xd'))[_0x4228('0xe')](socket);function respondWithRpcPromise(_0x466119,_0x95b77a,_0x3f1072){return new BPromise(function(_0x51a625,_0x223fbc){return client['request'](_0x466119,_0x3f1072)[_0x4228('0xf')](function(_0x4fae95){logger[_0x4228('0x10')](_0x4228('0x11'),_0x95b77a,_0x4228('0x12'));logger[_0x4228('0x13')](_0x4228('0x14'),_0x95b77a,_0x4228('0x12'),JSON[_0x4228('0x15')](_0x4fae95));if(_0x4fae95[_0x4228('0x16')]){if(_0x4fae95[_0x4228('0x16')][_0x4228('0x17')]===0x1f4){logger[_0x4228('0x16')](_0x4228('0x11'),_0x95b77a,_0x4fae95[_0x4228('0x16')]['message']);return _0x223fbc(_0x4fae95[_0x4228('0x16')]['message']);}logger[_0x4228('0x16')](_0x4228('0x11'),_0x95b77a,_0x4fae95[_0x4228('0x16')][_0x4228('0x18')]);return _0x51a625(_0x4fae95[_0x4228('0x16')]['message']);}else{logger['info'](_0x4228('0x11'),_0x95b77a,_0x4228('0x12'));_0x51a625(_0x4fae95[_0x4228('0x19')][_0x4228('0x18')]);}})[_0x4228('0x1a')](function(_0x29e9c7){logger[_0x4228('0x16')](_0x4228('0x11'),_0x95b77a,_0x29e9c7);_0x223fbc(_0x29e9c7);});});}exports[_0x4228('0x1b')]=function(_0x3276e3){var _0x3551a1=this;return new Promise(function(_0x5e7483,_0x1a99e8){return db[_0x4228('0x1c')][_0x4228('0x1d')]({'raw':_0x3276e3['options']?_0x3276e3['options'][_0x4228('0x1e')]===undefined?!![]:![]:!![],'where':_0x3276e3[_0x4228('0x1f')]?_0x3276e3[_0x4228('0x1f')][_0x4228('0x20')]||null:null,'attributes':_0x3276e3['options']?_0x3276e3[_0x4228('0x1f')][_0x4228('0x21')]||null:null,'limit':_0x3276e3[_0x4228('0x1f')]?_0x3276e3['options']['limit']||null:null,'include':_0x3276e3[_0x4228('0x1f')]?_0x3276e3['options'][_0x4228('0x22')]?_[_0x4228('0x23')](_0x3276e3['options'][_0x4228('0x22')],function(_0x10cde0){return{'model':db[_0x10cde0[_0x4228('0x24')]],'as':_0x10cde0['as'],'attributes':_0x10cde0['attributes'],'include':_0x10cde0['include']?_[_0x4228('0x23')](_0x10cde0[_0x4228('0x22')],function(_0x2396d6){return{'model':db[_0x2396d6[_0x4228('0x24')]],'as':_0x2396d6['as'],'attributes':_0x2396d6['attributes'],'include':_0x2396d6[_0x4228('0x22')]?_[_0x4228('0x23')](_0x2396d6[_0x4228('0x22')],function(_0x3b9184){return{'model':db[_0x3b9184[_0x4228('0x24')]],'as':_0x3b9184['as'],'attributes':_0x3b9184[_0x4228('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4228('0xf')](function(_0x9c6fd8){logger['info'](_0x4228('0x1b'),_0x3276e3);logger[_0x4228('0x13')](_0x4228('0x1b'),_0x3276e3,JSON[_0x4228('0x15')](_0x9c6fd8));_0x5e7483(_0x9c6fd8);})[_0x4228('0x1a')](function(_0x2d0b29){logger[_0x4228('0x16')]('GetVoiceQueueReport',_0x2d0b29['message'],_0x3276e3);_0x1a99e8(_0x3551a1[_0x4228('0x16')](0x1f4,_0x2d0b29[_0x4228('0x18')]));});});};exports[_0x4228('0x25')]=function(_0x1880da){var _0x226173=this;return new Promise(function(_0x19be3a,_0x36d723){return db[_0x4228('0x1c')][_0x4228('0x26')](_0x1880da['body'],{'raw':_0x1880da[_0x4228('0x1f')]?_0x1880da['options']['raw']===undefined?!![]:![]:!![]})[_0x4228('0xf')](function(_0x676f65){logger[_0x4228('0x10')]('CreateVoiceQueueReport',_0x1880da);logger['debug']('CreateVoiceQueueReport',_0x1880da,JSON[_0x4228('0x15')](_0x676f65));_0x19be3a(_0x676f65);})['catch'](function(_0x23b389){logger[_0x4228('0x16')]('CreateVoiceQueueReport',_0x23b389['message'],_0x1880da);_0x36d723(_0x226173[_0x4228('0x16')](0x1f4,_0x23b389[_0x4228('0x18')]));});});};exports[_0x4228('0x27')]=function(_0x2402d3){var _0x52053b=this;return new Promise(function(_0x47642e,_0x3e30cd){return db[_0x4228('0x1c')][_0x4228('0x28')](_0x2402d3['body'],{'raw':_0x2402d3[_0x4228('0x1f')]?_0x2402d3[_0x4228('0x1f')][_0x4228('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2402d3[_0x4228('0x1f')]?_0x2402d3[_0x4228('0x1f')]['where']||null:null,'attributes':_0x2402d3[_0x4228('0x1f')]?_0x2402d3['options'][_0x4228('0x21')]||null:null,'limit':_0x2402d3[_0x4228('0x1f')]?_0x2402d3[_0x4228('0x1f')]['limit']||null:null})[_0x4228('0xf')](function(_0x47eeec){logger[_0x4228('0x10')](_0x4228('0x27'),_0x2402d3);logger[_0x4228('0x13')]('UpdateVoiceQueueReport',_0x2402d3,JSON[_0x4228('0x15')](_0x47eeec));_0x47642e(_0x47eeec);})['catch'](function(_0x422021){logger['error'](_0x4228('0x27'),_0x422021[_0x4228('0x18')],_0x2402d3);_0x3e30cd(_0x52053b[_0x4228('0x16')](0x1f4,_0x422021[_0x4228('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 679d757..656c324 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 _0xe07e=['voiceQueueReport:','remove','update','emit','removeListener','register'];(function(_0x1a6cb8,_0x431948){var _0x524e8c=function(_0x2febf8){while(--_0x2febf8){_0x1a6cb8['push'](_0x1a6cb8['shift']());}};_0x524e8c(++_0x431948);}(_0xe07e,0xa3));var _0xee07=function(_0x3c5e54,_0x2b991b){_0x3c5e54=_0x3c5e54-0x0;var _0x3ae1f3=_0xe07e[_0x3c5e54];return _0x3ae1f3;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=['save',_0xee07('0x0'),_0xee07('0x1')];function createListener(_0x2d6c90,_0xfef0bd){return function(_0x15c9e1){_0xfef0bd[_0xee07('0x2')](_0x2d6c90,_0x15c9e1);};}function removeListener(_0x4cf4f5,_0xffcc84){return function(){VoiceQueueReportEvents[_0xee07('0x3')](_0x4cf4f5,_0xffcc84);};}exports[_0xee07('0x4')]=function(_0x154030){for(var _0x7b75be=0x0,_0x52b205=events['length'];_0x7b75be<_0x52b205;_0x7b75be++){var _0x166c7c=events[_0x7b75be];var _0x404021=createListener(_0xee07('0x5')+_0x166c7c,_0x154030);VoiceQueueReportEvents['on'](_0x166c7c,_0x404021);}}; \ No newline at end of file +var _0x04ed=['register','length','voiceQueueReport:','./voiceQueueReport.events','remove','removeListener'];(function(_0xa30766,_0x6f613e){var _0x24e780=function(_0x3d58fb){while(--_0x3d58fb){_0xa30766['push'](_0xa30766['shift']());}};_0x24e780(++_0x6f613e);}(_0x04ed,0x15f));var _0xd04e=function(_0x5825de,_0x5db5af){_0x5825de=_0x5825de-0x0;var _0x24b3ab=_0x04ed[_0x5825de];return _0x24b3ab;};'use strict';var VoiceQueueReportEvents=require(_0xd04e('0x0'));var events=['save',_0xd04e('0x1'),'update'];function createListener(_0x1a9ed2,_0x58cbba){return function(_0x2d7301){_0x58cbba['emit'](_0x1a9ed2,_0x2d7301);};}function removeListener(_0x122baa,_0x40ecf3){return function(){VoiceQueueReportEvents[_0xd04e('0x2')](_0x122baa,_0x40ecf3);};}exports[_0xd04e('0x3')]=function(_0x558c47){for(var _0x16cca0=0x0,_0x48e202=events[_0xd04e('0x4')];_0x16cca0<_0x48e202;_0x16cca0++){var _0x5f062=events[_0x16cca0];var _0x5a7e02=createListener(_0xd04e('0x5')+_0x5f062,_0x558c47);VoiceQueueReportEvents['on'](_0x5f062,_0x5a7e02);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 69ce5cc..037e7bf 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 _0xb934=['create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb934,0x92));var _0x4b93=function(_0x490d0a,_0x274b2a){_0x490d0a=_0x490d0a-0x0;var _0x502e0a=_0xb934[_0x490d0a];return _0x502e0a;};'use strict';var multer=require(_0x4b93('0x0'));var util=require(_0x4b93('0x1'));var path=require(_0x4b93('0x2'));var timeout=require('connect-timeout');var express=require(_0x4b93('0x3'));var router=express[_0x4b93('0x4')]();var auth=require(_0x4b93('0x5'));var interaction=require(_0x4b93('0x6'));var config=require(_0x4b93('0x7'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth[_0x4b93('0x8')](),controller[_0x4b93('0x9')]);router[_0x4b93('0xa')](_0x4b93('0xb'),auth['isAuthenticated'](),controller[_0x4b93('0xc')]);router[_0x4b93('0xd')]('/',auth[_0x4b93('0x8')](),controller[_0x4b93('0xe')]);router[_0x4b93('0xf')](_0x4b93('0xb'),auth[_0x4b93('0x8')](),controller[_0x4b93('0x10')]);router[_0x4b93('0x11')]('/:id',auth[_0x4b93('0x8')](),controller[_0x4b93('0x12')]);module[_0x4b93('0x13')]=router; \ No newline at end of file +var _0x5226=['post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show'];(function(_0x4b96bd,_0xe341d){var _0x515ad8=function(_0x166deb){while(--_0x166deb){_0x4b96bd['push'](_0x4b96bd['shift']());}};_0x515ad8(++_0xe341d);}(_0x5226,0x137));var _0x6522=function(_0x2cb03e,_0x3ff6e6){_0x2cb03e=_0x2cb03e-0x0;var _0x292cf5=_0x5226[_0x2cb03e];return _0x292cf5;};'use strict';var multer=require(_0x6522('0x0'));var util=require(_0x6522('0x1'));var path=require(_0x6522('0x2'));var timeout=require(_0x6522('0x3'));var express=require(_0x6522('0x4'));var router=express['Router']();var auth=require(_0x6522('0x5'));var interaction=require(_0x6522('0x6'));var config=require(_0x6522('0x7'));var controller=require('./voiceQueuesLog.controller');router[_0x6522('0x8')]('/',auth['isAuthenticated'](),controller[_0x6522('0x9')]);router[_0x6522('0x8')](_0x6522('0xa'),auth[_0x6522('0xb')](),controller[_0x6522('0xc')]);router[_0x6522('0xd')]('/',auth[_0x6522('0xb')](),controller['create']);router['put'](_0x6522('0xa'),auth[_0x6522('0xb')](),controller[_0x6522('0xe')]);router[_0x6522('0xf')](_0x6522('0xa'),auth[_0x6522('0xb')](),controller[_0x6522('0x10')]);module[_0x6522('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 8a9de9c..c061ea9 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 _0x33c5=['format','YYYY-MM-DD\x20HH:mm:ss','moment','exports','STRING','DATE'];(function(_0x1e6b59,_0x5eca5d){var _0x40d7c5=function(_0x2dd544){while(--_0x2dd544){_0x1e6b59['push'](_0x1e6b59['shift']());}};_0x40d7c5(++_0x5eca5d);}(_0x33c5,0xe6));var _0x533c=function(_0x469665,_0x394876){_0x469665=_0x469665-0x0;var _0x291ab5=_0x33c5[_0x469665];return _0x291ab5;};'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 +var _0x00bb=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING'];(function(_0x4f2ff4,_0x1694e5){var _0x3a4ca4=function(_0x2eead5){while(--_0x2eead5){_0x4f2ff4['push'](_0x4f2ff4['shift']());}};_0x3a4ca4(++_0x1694e5);}(_0x00bb,0x1d8));var _0xb00b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x00bb[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xb00b('0x0'));var moment=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xb00b('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xb00b('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xb00b('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xb00b('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xb00b('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xb00b('0x4')],'allowNull':![],'defaultValue':moment()[_0xb00b('0x5')](_0xb00b('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 8904140..8398e9f 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 _0x5288=['body','catch','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','stack','name','send','index','VoiceQueuesLog','rawAttributes','keys','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','map','key','VIRTUAL','field','filter','includeAll','include','findAll','rows','options','find','create'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x5288,0x1ed));var _0x8528=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x5288[_0x5c9307];return _0x373e29;};'use strict';var pdf=require(_0x8528('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8528('0x1'));var zipdir=require(_0x8528('0x2'));var jsonpatch=require(_0x8528('0x3'));var rp=require(_0x8528('0x4'));var moment=require(_0x8528('0x5'));var BPromise=require(_0x8528('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8528('0x7'));var sox=require(_0x8528('0x8'));var csv=require(_0x8528('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8528('0xa'));var squel=require(_0x8528('0xb'));var crypto=require(_0x8528('0xc'));var jsforce=require(_0x8528('0xd'));var deskjs=require(_0x8528('0xe'));var toCsv=require(_0x8528('0x9'));var querystring=require(_0x8528('0xf'));var Papa=require(_0x8528('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8528('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8528('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x8528('0x13'));var db=require(_0x8528('0x14'))['db'];function respondWithStatusCode(_0x22eafe,_0x5d70a2){_0x5d70a2=_0x5d70a2||0xcc;return function(_0x762a2){if(_0x762a2){return _0x22eafe[_0x8528('0x15')](_0x5d70a2);}return _0x22eafe['status'](_0x5d70a2)['end']();};}function respondWithResult(_0x4affc9,_0x54a386){_0x54a386=_0x54a386||0xc8;return function(_0x309e34){if(_0x309e34){return _0x4affc9[_0x8528('0x16')](_0x54a386)[_0x8528('0x17')](_0x309e34);}};}function respondWithFilteredResult(_0x1dc634,_0xb135bf){return function(_0x5cbb2e){if(_0x5cbb2e){var _0x17db94=_0x5cbb2e[_0x8528('0x18')],_0x4daf42=_0xb135bf['offset'],_0x5aac73=_0xb135bf[_0x8528('0x19')]+_0xb135bf[_0x8528('0x1a')],_0x30f4e6;if(_0x5aac73>=_0x17db94){_0x5aac73=_0x17db94;_0x30f4e6=0xc8;}else{_0x30f4e6=0xce;}_0x1dc634[_0x8528('0x16')](_0x30f4e6);return _0x1dc634[_0x8528('0x1b')](_0x8528('0x1c'),_0x4daf42+'-'+_0x5aac73+'/'+_0x17db94)[_0x8528('0x17')](_0x5cbb2e);}return null;};}function patchUpdates(_0xa50c3a){return function(_0x1d31f4){try{jsonpatch[_0x8528('0x1d')](_0x1d31f4,_0xa50c3a,!![]);}catch(_0x536d94){return BPromise['reject'](_0x536d94);}return _0x1d31f4[_0x8528('0x1e')]();};}function saveUpdates(_0x573dd0,_0x4ef770){return function(_0x549778){if(_0x549778){return _0x549778[_0x8528('0x1f')](_0x573dd0)[_0x8528('0x20')](function(_0x25d9d7){return _0x25d9d7;});}return null;};}function removeEntity(_0x3ba93c,_0x1a15f5){return function(_0x7a4de8){if(_0x7a4de8){return _0x7a4de8[_0x8528('0x21')]()[_0x8528('0x20')](function(){_0x3ba93c[_0x8528('0x16')](0xcc)[_0x8528('0x22')]();});}};}function handleEntityNotFound(_0x612377,_0x2229b6){return function(_0x2249c8){if(!_0x2249c8){_0x612377['sendStatus'](0x194);}return _0x2249c8;};}function handleError(_0x36c74b,_0x3d09ff){_0x3d09ff=_0x3d09ff||0x1f4;return function(_0x24cfe7){logger['error'](_0x24cfe7[_0x8528('0x23')]);if(_0x24cfe7[_0x8528('0x24')]){delete _0x24cfe7[_0x8528('0x24')];}_0x36c74b[_0x8528('0x16')](_0x3d09ff)[_0x8528('0x25')](_0x24cfe7);};}exports[_0x8528('0x26')]=function(_0x287c1d,_0x3acfc2){var _0x58f6fe={},_0x1769ed={},_0x3397d3={'count':0x0,'rows':[]};var _0x18d430=db[_0x8528('0x27')][_0x8528('0x28')];_0x1769ed['model']=_['keys'](_0x18d430);_0x1769ed['query']=_[_0x8528('0x29')](_0x287c1d['query']);_0x1769ed['filters']=_[_0x8528('0x2a')](_0x1769ed[_0x8528('0x2b')],_0x1769ed[_0x8528('0x2c')]);_0x58f6fe['attributes']=_[_0x8528('0x2a')](_0x1769ed[_0x8528('0x2b')],qs[_0x8528('0x2d')](_0x287c1d[_0x8528('0x2c')]['fields']));_0x58f6fe[_0x8528('0x2e')]=_0x58f6fe[_0x8528('0x2e')][_0x8528('0x2f')]?_0x58f6fe[_0x8528('0x2e')]:_0x1769ed[_0x8528('0x2b')];if(!_0x287c1d[_0x8528('0x2c')][_0x8528('0x30')](_0x8528('0x31'))){_0x58f6fe[_0x8528('0x1a')]=qs[_0x8528('0x1a')](_0x287c1d[_0x8528('0x2c')][_0x8528('0x1a')]);_0x58f6fe[_0x8528('0x19')]=qs['offset'](_0x287c1d[_0x8528('0x2c')][_0x8528('0x19')]);}_0x58f6fe['order']=qs[_0x8528('0x32')](_0x287c1d[_0x8528('0x2c')][_0x8528('0x32')]);_0x58f6fe[_0x8528('0x33')]=qs[_0x8528('0x34')](_[_0x8528('0x35')](_0x287c1d[_0x8528('0x2c')],_0x1769ed[_0x8528('0x34')]));if(_0x287c1d[_0x8528('0x2c')]['filter']){_0x58f6fe['where']=_[_0x8528('0x36')](_0x58f6fe[_0x8528('0x33')],{'$or':_[_0x8528('0x37')](_0x18d430,function(_0x88cd25){if(_0x88cd25['type'][_0x8528('0x38')]!==_0x8528('0x39')){var _0x19519f={};_0x19519f[_0x88cd25[_0x8528('0x3a')]]={'$like':'%'+_0x287c1d['query'][_0x8528('0x3b')]+'%'};return _0x19519f;}})});}_0x58f6fe=_[_0x8528('0x36')]({},_0x58f6fe,_0x287c1d['options']);var _0x27312a={'where':_0x58f6fe[_0x8528('0x33')]};return db[_0x8528('0x27')][_0x8528('0x18')](_0x27312a)[_0x8528('0x20')](function(_0xd7b98d){_0x3397d3[_0x8528('0x18')]=_0xd7b98d;if(_0x287c1d[_0x8528('0x2c')][_0x8528('0x3c')]){_0x58f6fe[_0x8528('0x3d')]=[{'all':!![]}];}return db[_0x8528('0x27')][_0x8528('0x3e')](_0x58f6fe);})[_0x8528('0x20')](function(_0x2ac303){_0x3397d3[_0x8528('0x3f')]=_0x2ac303;return _0x3397d3;})['then'](respondWithFilteredResult(_0x3acfc2,_0x58f6fe))['catch'](handleError(_0x3acfc2,null));};exports['show']=function(_0x30d42e,_0x41027e){var _0x1d81a4={'raw':!![],'where':{'id':_0x30d42e['params']['id']}},_0x4adfd4={};_0x4adfd4[_0x8528('0x2b')]=_['keys'](db[_0x8528('0x27')]['rawAttributes']);_0x4adfd4['query']=_[_0x8528('0x29')](_0x30d42e['query']);_0x4adfd4[_0x8528('0x34')]=_[_0x8528('0x2a')](_0x4adfd4[_0x8528('0x2b')],_0x4adfd4[_0x8528('0x2c')]);_0x1d81a4[_0x8528('0x2e')]=_[_0x8528('0x2a')](_0x4adfd4[_0x8528('0x2b')],qs[_0x8528('0x2d')](_0x30d42e[_0x8528('0x2c')][_0x8528('0x2d')]));_0x1d81a4['attributes']=_0x1d81a4[_0x8528('0x2e')][_0x8528('0x2f')]?_0x1d81a4[_0x8528('0x2e')]:_0x4adfd4[_0x8528('0x2b')];if(_0x30d42e['query'][_0x8528('0x3c')]){_0x1d81a4[_0x8528('0x3d')]=[{'all':!![]}];}_0x1d81a4=_[_0x8528('0x36')]({},_0x1d81a4,_0x30d42e[_0x8528('0x40')]);return db[_0x8528('0x27')][_0x8528('0x41')](_0x1d81a4)[_0x8528('0x20')](handleEntityNotFound(_0x41027e,null))['then'](respondWithResult(_0x41027e,null))['catch'](handleError(_0x41027e,null));};exports[_0x8528('0x42')]=function(_0x5f436d,_0x51f74e){return db[_0x8528('0x27')][_0x8528('0x42')](_0x5f436d[_0x8528('0x43')],{})[_0x8528('0x20')](respondWithResult(_0x51f74e,0xc9))[_0x8528('0x44')](handleError(_0x51f74e,null));};exports[_0x8528('0x1f')]=function(_0x4cc5c1,_0x2ee6f1){if(_0x4cc5c1[_0x8528('0x43')]['id']){delete _0x4cc5c1['body']['id'];}return db[_0x8528('0x27')][_0x8528('0x41')]({'where':{'id':_0x4cc5c1[_0x8528('0x45')]['id']}})[_0x8528('0x20')](handleEntityNotFound(_0x2ee6f1,null))[_0x8528('0x20')](saveUpdates(_0x4cc5c1['body'],null))[_0x8528('0x20')](respondWithResult(_0x2ee6f1,null))[_0x8528('0x44')](handleError(_0x2ee6f1,null));};exports[_0x8528('0x21')]=function(_0x3e5974,_0x2d5bb6){return db[_0x8528('0x27')][_0x8528('0x41')]({'where':{'id':_0x3e5974[_0x8528('0x45')]['id']}})[_0x8528('0x20')](handleEntityNotFound(_0x2d5bb6,null))[_0x8528('0x20')](removeEntity(_0x2d5bb6,null))[_0x8528('0x44')](handleError(_0x2d5bb6,null));}; \ No newline at end of file +var _0xfa4d=['merge','map','type','key','field','options','includeAll','catch','show','find','create','body','params','destroy','html-pdf','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','save','update','then','error','stack','name','send','VoiceQueuesLog','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','where'];(function(_0x415e8b,_0x426977){var _0x5c9e10=function(_0xa5b19a){while(--_0xa5b19a){_0x415e8b['push'](_0x415e8b['shift']());}};_0x5c9e10(++_0x426977);}(_0xfa4d,0x90));var _0xdfa4=function(_0xb1f2ce,_0x4c5d6f){_0xb1f2ce=_0xb1f2ce-0x0;var _0x37cd37=_0xfa4d[_0xb1f2ce];return _0x37cd37;};'use strict';var pdf=require(_0xdfa4('0x0'));var emlformat=require(_0xdfa4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xdfa4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdfa4('0x3'));var Mustache=require(_0xdfa4('0x4'));var util=require(_0xdfa4('0x5'));var path=require(_0xdfa4('0x6'));var sox=require(_0xdfa4('0x7'));var csv=require(_0xdfa4('0x8'));var ejs=require(_0xdfa4('0x9'));var fs=require('fs');var _=require(_0xdfa4('0xa'));var squel=require(_0xdfa4('0xb'));var crypto=require(_0xdfa4('0xc'));var jsforce=require(_0xdfa4('0xd'));var deskjs=require(_0xdfa4('0xe'));var toCsv=require(_0xdfa4('0x8'));var querystring=require(_0xdfa4('0xf'));var Papa=require(_0xdfa4('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdfa4('0x11'));var hardwareService=require(_0xdfa4('0x12'));var logger=require('../../config/logger')(_0xdfa4('0x13'));var utils=require('../../config/utils');var config=require(_0xdfa4('0x14'));var db=require(_0xdfa4('0x15'))['db'];function respondWithStatusCode(_0x249d8f,_0xfa1d4b){_0xfa1d4b=_0xfa1d4b||0xcc;return function(_0x1f45d6){if(_0x1f45d6){return _0x249d8f[_0xdfa4('0x16')](_0xfa1d4b);}return _0x249d8f[_0xdfa4('0x17')](_0xfa1d4b)[_0xdfa4('0x18')]();};}function respondWithResult(_0x30fce7,_0x87d032){_0x87d032=_0x87d032||0xc8;return function(_0x3889eb){if(_0x3889eb){return _0x30fce7[_0xdfa4('0x17')](_0x87d032)[_0xdfa4('0x19')](_0x3889eb);}};}function respondWithFilteredResult(_0x58ed13,_0x464b22){return function(_0x5d604b){if(_0x5d604b){var _0x1e0140=_0x5d604b['count'],_0x566c09=_0x464b22[_0xdfa4('0x1a')],_0x1284de=_0x464b22[_0xdfa4('0x1a')]+_0x464b22[_0xdfa4('0x1b')],_0x1163ed;if(_0x1284de>=_0x1e0140){_0x1284de=_0x1e0140;_0x1163ed=0xc8;}else{_0x1163ed=0xce;}_0x58ed13[_0xdfa4('0x17')](_0x1163ed);return _0x58ed13[_0xdfa4('0x1c')]('Content-Range',_0x566c09+'-'+_0x1284de+'/'+_0x1e0140)['json'](_0x5d604b);}return null;};}function patchUpdates(_0x280808){return function(_0x162bfb){try{jsonpatch[_0xdfa4('0x1d')](_0x162bfb,_0x280808,!![]);}catch(_0x5d4412){return BPromise['reject'](_0x5d4412);}return _0x162bfb[_0xdfa4('0x1e')]();};}function saveUpdates(_0x4ac23a,_0x449a22){return function(_0x36dd54){if(_0x36dd54){return _0x36dd54[_0xdfa4('0x1f')](_0x4ac23a)[_0xdfa4('0x20')](function(_0x34fd7a){return _0x34fd7a;});}return null;};}function removeEntity(_0x2ca5e2,_0x2e5a0a){return function(_0x29d1e3){if(_0x29d1e3){return _0x29d1e3['destroy']()[_0xdfa4('0x20')](function(){_0x2ca5e2[_0xdfa4('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3024b6,_0x405d50){return function(_0x5ab8f6){if(!_0x5ab8f6){_0x3024b6[_0xdfa4('0x16')](0x194);}return _0x5ab8f6;};}function handleError(_0x12c765,_0x46301b){_0x46301b=_0x46301b||0x1f4;return function(_0x4c44aa){logger[_0xdfa4('0x21')](_0x4c44aa[_0xdfa4('0x22')]);if(_0x4c44aa[_0xdfa4('0x23')]){delete _0x4c44aa['name'];}_0x12c765[_0xdfa4('0x17')](_0x46301b)[_0xdfa4('0x24')](_0x4c44aa);};}exports['index']=function(_0x4fb820,_0x1d6411){var _0x733fc={},_0x633aa7={},_0x442974={'count':0x0,'rows':[]};var _0x1fd295=db[_0xdfa4('0x25')][_0xdfa4('0x26')];_0x633aa7[_0xdfa4('0x27')]=_[_0xdfa4('0x28')](_0x1fd295);_0x633aa7[_0xdfa4('0x29')]=_[_0xdfa4('0x28')](_0x4fb820[_0xdfa4('0x29')]);_0x633aa7[_0xdfa4('0x2a')]=_[_0xdfa4('0x2b')](_0x633aa7['model'],_0x633aa7[_0xdfa4('0x29')]);_0x733fc[_0xdfa4('0x2c')]=_[_0xdfa4('0x2b')](_0x633aa7[_0xdfa4('0x27')],qs[_0xdfa4('0x2d')](_0x4fb820[_0xdfa4('0x29')][_0xdfa4('0x2d')]));_0x733fc[_0xdfa4('0x2c')]=_0x733fc['attributes']['length']?_0x733fc[_0xdfa4('0x2c')]:_0x633aa7[_0xdfa4('0x27')];if(!_0x4fb820[_0xdfa4('0x29')][_0xdfa4('0x2e')](_0xdfa4('0x2f'))){_0x733fc[_0xdfa4('0x1b')]=qs[_0xdfa4('0x1b')](_0x4fb820[_0xdfa4('0x29')][_0xdfa4('0x1b')]);_0x733fc[_0xdfa4('0x1a')]=qs[_0xdfa4('0x1a')](_0x4fb820['query'][_0xdfa4('0x1a')]);}_0x733fc['order']=qs[_0xdfa4('0x30')](_0x4fb820[_0xdfa4('0x29')][_0xdfa4('0x30')]);_0x733fc['where']=qs[_0xdfa4('0x2a')](_['pick'](_0x4fb820[_0xdfa4('0x29')],_0x633aa7[_0xdfa4('0x2a')]));if(_0x4fb820['query'][_0xdfa4('0x31')]){_0x733fc[_0xdfa4('0x32')]=_[_0xdfa4('0x33')](_0x733fc[_0xdfa4('0x32')],{'$or':_[_0xdfa4('0x34')](_0x1fd295,function(_0x58df04){if(_0x58df04[_0xdfa4('0x35')][_0xdfa4('0x36')]!=='VIRTUAL'){var _0x506ae0={};_0x506ae0[_0x58df04[_0xdfa4('0x37')]]={'$like':'%'+_0x4fb820[_0xdfa4('0x29')][_0xdfa4('0x31')]+'%'};return _0x506ae0;}})});}_0x733fc=_[_0xdfa4('0x33')]({},_0x733fc,_0x4fb820[_0xdfa4('0x38')]);var _0x1c0481={'where':_0x733fc['where']};return db['VoiceQueuesLog']['count'](_0x1c0481)['then'](function(_0x55e15d){_0x442974['count']=_0x55e15d;if(_0x4fb820[_0xdfa4('0x29')][_0xdfa4('0x39')]){_0x733fc['include']=[{'all':!![]}];}return db[_0xdfa4('0x25')]['findAll'](_0x733fc);})[_0xdfa4('0x20')](function(_0x4f7c07){_0x442974['rows']=_0x4f7c07;return _0x442974;})[_0xdfa4('0x20')](respondWithFilteredResult(_0x1d6411,_0x733fc))[_0xdfa4('0x3a')](handleError(_0x1d6411,null));};exports[_0xdfa4('0x3b')]=function(_0x262a0a,_0x4433e9){var _0x1cc5da={'raw':!![],'where':{'id':_0x262a0a['params']['id']}},_0x4e7e67={};_0x4e7e67[_0xdfa4('0x27')]=_[_0xdfa4('0x28')](db[_0xdfa4('0x25')]['rawAttributes']);_0x4e7e67[_0xdfa4('0x29')]=_[_0xdfa4('0x28')](_0x262a0a['query']);_0x4e7e67[_0xdfa4('0x2a')]=_[_0xdfa4('0x2b')](_0x4e7e67['model'],_0x4e7e67[_0xdfa4('0x29')]);_0x1cc5da[_0xdfa4('0x2c')]=_['intersection'](_0x4e7e67[_0xdfa4('0x27')],qs['fields'](_0x262a0a[_0xdfa4('0x29')][_0xdfa4('0x2d')]));_0x1cc5da['attributes']=_0x1cc5da[_0xdfa4('0x2c')]['length']?_0x1cc5da[_0xdfa4('0x2c')]:_0x4e7e67['model'];if(_0x262a0a['query'][_0xdfa4('0x39')]){_0x1cc5da['include']=[{'all':!![]}];}_0x1cc5da=_[_0xdfa4('0x33')]({},_0x1cc5da,_0x262a0a['options']);return db[_0xdfa4('0x25')][_0xdfa4('0x3c')](_0x1cc5da)[_0xdfa4('0x20')](handleEntityNotFound(_0x4433e9,null))[_0xdfa4('0x20')](respondWithResult(_0x4433e9,null))['catch'](handleError(_0x4433e9,null));};exports[_0xdfa4('0x3d')]=function(_0x374705,_0xa6dddc){return db[_0xdfa4('0x25')][_0xdfa4('0x3d')](_0x374705[_0xdfa4('0x3e')],{})[_0xdfa4('0x20')](respondWithResult(_0xa6dddc,0xc9))[_0xdfa4('0x3a')](handleError(_0xa6dddc,null));};exports['update']=function(_0xd5c04a,_0x47c4f2){if(_0xd5c04a[_0xdfa4('0x3e')]['id']){delete _0xd5c04a['body']['id'];}return db[_0xdfa4('0x25')][_0xdfa4('0x3c')]({'where':{'id':_0xd5c04a[_0xdfa4('0x3f')]['id']}})[_0xdfa4('0x20')](handleEntityNotFound(_0x47c4f2,null))[_0xdfa4('0x20')](saveUpdates(_0xd5c04a[_0xdfa4('0x3e')],null))[_0xdfa4('0x20')](respondWithResult(_0x47c4f2,null))[_0xdfa4('0x3a')](handleError(_0x47c4f2,null));};exports[_0xdfa4('0x40')]=function(_0x1be5ca,_0xd06b1c){return db[_0xdfa4('0x25')]['find']({'where':{'id':_0x1be5ca[_0xdfa4('0x3f')]['id']}})[_0xdfa4('0x20')](handleEntityNotFound(_0xd06b1c,null))[_0xdfa4('0x20')](removeEntity(_0xd06b1c,null))[_0xdfa4('0x3a')](handleError(_0xd06b1c,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 98485b9..d67a235 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 _0xa89b=['voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','VoiceQueuesLog'];(function(_0x158862,_0x235697){var _0x5ff8f9=function(_0x1562e1){while(--_0x1562e1){_0x158862['push'](_0x158862['shift']());}};_0x5ff8f9(++_0x235697);}(_0xa89b,0x112));var _0xba89=function(_0x229101,_0x31339d){_0x229101=_0x229101-0x0;var _0xc93cb=_0xa89b[_0x229101];return _0xc93cb;};'use strict';var _=require(_0xba89('0x0'));var util=require(_0xba89('0x1'));var logger=require(_0xba89('0x2'))(_0xba89('0x3'));var moment=require(_0xba89('0x4'));var BPromise=require('bluebird');var rp=require(_0xba89('0x5'));var fs=require('fs');var path=require(_0xba89('0x6'));var rimraf=require(_0xba89('0x7'));var config=require(_0xba89('0x8'));var attributes=require(_0xba89('0x9'));module['exports']=function(_0x51e6a4,_0x5f273c){return _0x51e6a4['define'](_0xba89('0xa'),attributes,{'tableName':_0xba89('0xb'),'paranoid':![],'indexes':[{'name':_0xba89('0xc'),'fields':[_0xba89('0xd'),_0xba89('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9b47=['dtm','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','event_dtm'];(function(_0x130318,_0x3a3183){var _0x2196fd=function(_0xa826c3){while(--_0xa826c3){_0x130318['push'](_0x130318['shift']());}};_0x2196fd(++_0x3a3183);}(_0x9b47,0x1a5));var _0x79b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9b47[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x79b4('0x0'));var logger=require(_0x79b4('0x1'))(_0x79b4('0x2'));var moment=require(_0x79b4('0x3'));var BPromise=require(_0x79b4('0x4'));var rp=require(_0x79b4('0x5'));var fs=require('fs');var path=require(_0x79b4('0x6'));var rimraf=require(_0x79b4('0x7'));var config=require(_0x79b4('0x8'));var attributes=require(_0x79b4('0x9'));module['exports']=function(_0x370c73,_0x2ee04a){return _0x370c73[_0x79b4('0xa')](_0x79b4('0xb'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x79b4('0xc'),'fields':['event',_0x79b4('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 05edbe5..31c39b8 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 _0xa5fa=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','request\x20sent','result','catch','util','moment'];(function(_0xefc003,_0x578123){var _0x41ca1b=function(_0x2cb712){while(--_0x2cb712){_0xefc003['push'](_0xefc003['shift']());}};_0x41ca1b(++_0x578123);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0xa5fa[_0x1147ab];return _0x55cb5a;};'use strict';var _=require('lodash');var util=require(_0xaa5f('0x0'));var moment=require(_0xaa5f('0x1'));var BPromise=require(_0xaa5f('0x2'));var rs=require(_0xaa5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa5f('0x4'))['db'];var utils=require(_0xaa5f('0x5'));var logger=require('../../config/logger')(_0xaa5f('0x6'));var config=require(_0xaa5f('0x7'));var jayson=require(_0xaa5f('0x8'));var client=jayson[_0xaa5f('0x9')][_0xaa5f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13b606,_0x302138,_0xc326df){return new BPromise(function(_0x74f64f,_0x3f550e){return client[_0xaa5f('0xb')](_0x13b606,_0xc326df)['then'](function(_0x1674c2){logger[_0xaa5f('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x302138,'request\x20sent');logger[_0xaa5f('0xd')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x302138,'request\x20sent',JSON[_0xaa5f('0xe')](_0x1674c2));if(_0x1674c2['error']){if(_0x1674c2[_0xaa5f('0xf')][_0xaa5f('0x10')]===0x1f4){logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1674c2[_0xaa5f('0xf')]['message']);return _0x3f550e(_0x1674c2[_0xaa5f('0xf')]['message']);}logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1674c2[_0xaa5f('0xf')][_0xaa5f('0x12')]);return _0x74f64f(_0x1674c2[_0xaa5f('0xf')]['message']);}else{logger['info'](_0xaa5f('0x11'),_0x302138,_0xaa5f('0x13'));_0x74f64f(_0x1674c2[_0xaa5f('0x14')][_0xaa5f('0x12')]);}})[_0xaa5f('0x15')](function(_0x1fa36a){logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1fa36a);_0x3f550e(_0x1fa36a);});});} \ No newline at end of file +var _0x2eb6=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch'];(function(_0x4c5ad8,_0x1e67b1){var _0x2904df=function(_0x404015){while(--_0x404015){_0x4c5ad8['push'](_0x4c5ad8['shift']());}};_0x2904df(++_0x1e67b1);}(_0x2eb6,0x1ce));var _0x62eb=function(_0x1c3b04,_0xd0417e){_0x1c3b04=_0x1c3b04-0x0;var _0x28d5b5=_0x2eb6[_0x1c3b04];return _0x28d5b5;};'use strict';var _=require(_0x62eb('0x0'));var util=require(_0x62eb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x62eb('0x2'));var fs=require('fs');var Redis=require(_0x62eb('0x3'));var db=require(_0x62eb('0x4'))['db'];var utils=require(_0x62eb('0x5'));var logger=require(_0x62eb('0x6'))('rpc');var config=require(_0x62eb('0x7'));var jayson=require(_0x62eb('0x8'));var client=jayson[_0x62eb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e4779,_0x352d6,_0x1b009d){return new BPromise(function(_0x470a45,_0x4cadcd){return client[_0x62eb('0xa')](_0x2e4779,_0x1b009d)[_0x62eb('0xb')](function(_0x5be9dc){logger[_0x62eb('0xc')](_0x62eb('0xd'),_0x352d6,_0x62eb('0xe'));logger[_0x62eb('0xf')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x352d6,_0x62eb('0xe'),JSON['stringify'](_0x5be9dc));if(_0x5be9dc['error']){if(_0x5be9dc[_0x62eb('0x10')][_0x62eb('0x11')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x352d6,_0x5be9dc['error']['message']);return _0x4cadcd(_0x5be9dc[_0x62eb('0x10')]['message']);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x352d6,_0x5be9dc['error']['message']);return _0x470a45(_0x5be9dc['error'][_0x62eb('0x12')]);}else{logger['info'](_0x62eb('0xd'),_0x352d6,_0x62eb('0xe'));_0x470a45(_0x5be9dc[_0x62eb('0x13')][_0x62eb('0x12')]);}})[_0x62eb('0x14')](function(_0x100bf7){logger[_0x62eb('0x10')](_0x62eb('0xd'),_0x352d6,_0x100bf7);_0x4cadcd(_0x100bf7);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 76bf4fb..fbd6356 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 _0x4fef=['../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','/:id/downloads','post','create','put','update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service'];(function(_0x21097d,_0xfa326){var _0xee23bd=function(_0x30af6f){while(--_0x30af6f){_0x21097d['push'](_0x21097d['shift']());}};_0xee23bd(++_0xfa326);}(_0x4fef,0x10f));var _0xf4fe=function(_0x57c3f5,_0x4ddeba){_0x57c3f5=_0x57c3f5-0x0;var _0x205bd6=_0x4fef[_0x57c3f5];return _0x205bd6;};'use strict';var multer=require(_0xf4fe('0x0'));var util=require(_0xf4fe('0x1'));var path=require('path');var timeout=require(_0xf4fe('0x2'));var express=require('express');var router=express[_0xf4fe('0x3')]();var auth=require(_0xf4fe('0x4'));var interaction=require(_0xf4fe('0x5'));var config=require(_0xf4fe('0x6'));var controller=require(_0xf4fe('0x7'));router[_0xf4fe('0x8')]('/',auth[_0xf4fe('0x9')](),controller[_0xf4fe('0xa')]);router['get'](_0xf4fe('0xb'),auth[_0xf4fe('0x9')](),controller['describe']);router[_0xf4fe('0x8')](_0xf4fe('0xc'),auth[_0xf4fe('0x9')](),controller[_0xf4fe('0xd')]);router[_0xf4fe('0x8')](_0xf4fe('0xe'),auth[_0xf4fe('0x9')](),controller[_0xf4fe('0xf')]);router['get'](_0xf4fe('0x10'),controller['downloads']);router[_0xf4fe('0x11')]('/',auth[_0xf4fe('0x9')](),controller[_0xf4fe('0x12')]);router[_0xf4fe('0x13')](_0xf4fe('0xc'),auth['isAuthenticated'](),controller[_0xf4fe('0x14')]);router[_0xf4fe('0x15')](_0xf4fe('0xc'),auth['isAuthenticated'](),controller[_0xf4fe('0x16')]);module['exports']=router; \ No newline at end of file +var _0x54f3=['update','delete','destroy','util','path','connect-timeout','express','Router','../../config/environment','./voiceRecording.controller','get','isAuthenticated','describe','/:id','show','/:id/download','/:id/downloads','downloads','create'];(function(_0xb7b878,_0x5c3b92){var _0x3c84b9=function(_0x21d5a2){while(--_0x21d5a2){_0xb7b878['push'](_0xb7b878['shift']());}};_0x3c84b9(++_0x5c3b92);}(_0x54f3,0x120));var _0x354f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x54f3[_0x40a045];return _0x1a687c;};'use strict';var multer=require('multer');var util=require(_0x354f('0x0'));var path=require(_0x354f('0x1'));var timeout=require(_0x354f('0x2'));var express=require(_0x354f('0x3'));var router=express[_0x354f('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x354f('0x5'));var controller=require(_0x354f('0x6'));router[_0x354f('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x354f('0x7')]('/describe',auth[_0x354f('0x8')](),controller[_0x354f('0x9')]);router[_0x354f('0x7')](_0x354f('0xa'),auth['isAuthenticated'](),controller[_0x354f('0xb')]);router['get'](_0x354f('0xc'),auth[_0x354f('0x8')](),controller['download']);router['get'](_0x354f('0xd'),controller[_0x354f('0xe')]);router['post']('/',auth[_0x354f('0x8')](),controller[_0x354f('0xf')]);router['put'](_0x354f('0xa'),auth[_0x354f('0x8')](),controller[_0x354f('0x10')]);router[_0x354f('0x11')](_0x354f('0xa'),auth[_0x354f('0x8')](),controller[_0x354f('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index bbfd333..d29a97f 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 _0xc698=['sequelize','moment','path','exports','VIRTUAL','getDataValue','value','STRING','setDataValue','channel','membername','format','toString','DATE','MM-DD-YYYY\x20HH:mm'];(function(_0x1064bc,_0x206f12){var _0x5edc45=function(_0x5087bd){while(--_0x5087bd){_0x1064bc['push'](_0x1064bc['shift']());}};_0x5edc45(++_0x206f12);}(_0xc698,0x10e));var _0x8c69=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xc698[_0x5c351c];return _0x26f3b3;};'use strict';var Sequelize=require(_0x8c69('0x0'));var moment=require(_0x8c69('0x1'));var path=require(_0x8c69('0x2'));module[_0x8c69('0x3')]={'format':{'type':Sequelize[_0x8c69('0x4')],'get':function(){return this[_0x8c69('0x5')](_0x8c69('0x6'))?path['extname'](this[_0x8c69('0x5')]('value')):undefined;}},'uniqueid':{'type':Sequelize[_0x8c69('0x7')]},'channel':{'type':Sequelize[_0x8c69('0x7')],'set':function(_0x69a18a){if(_0x69a18a){this[_0x8c69('0x8')](_0x8c69('0x9'),_0x69a18a);this[_0x8c69('0x8')](_0x8c69('0xa'),_0x69a18a['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x8c69('0x7')]},'calleridnum':{'type':Sequelize[_0x8c69('0x7')]},'calleridname':{'type':Sequelize[_0x8c69('0x7')]},'connectedlinenum':{'type':Sequelize[_0x8c69('0x7')]},'connectedlinename':{'type':Sequelize[_0x8c69('0x7')]},'accountcode':{'type':Sequelize[_0x8c69('0x7')]},'context':{'type':Sequelize[_0x8c69('0x7')]},'exten':{'type':Sequelize[_0x8c69('0x7')]},'value':{'type':Sequelize[_0x8c69('0x7')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x8c69('0x7')]},'userDisposition':{'type':Sequelize[_0x8c69('0x7')]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x8c69('0x5')]('createdAt'))[_0x8c69('0xb')]('MM-DD-YYYY\x20HH:mm')[_0x8c69('0xc')]();}},'updatedAt':{'type':Sequelize[_0x8c69('0xd')],'get':function(){return moment(this[_0x8c69('0x5')]('updatedAt'))[_0x8c69('0xb')](_0x8c69('0xe'))[_0x8c69('0xc')]();}}}; \ No newline at end of file +var _0x0300=['split','DATE','createdAt','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','path','exports','VIRTUAL','value','extname','getDataValue','STRING','setDataValue','membername'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0x0300,0xa0));var _0x0030=function(_0x4dc8f3,_0x358547){_0x4dc8f3=_0x4dc8f3-0x0;var _0x22eaf5=_0x0300[_0x4dc8f3];return _0x22eaf5;};'use strict';var Sequelize=require(_0x0030('0x0'));var moment=require('moment');var path=require(_0x0030('0x1'));module[_0x0030('0x2')]={'format':{'type':Sequelize[_0x0030('0x3')],'get':function(){return this['getDataValue'](_0x0030('0x4'))?path[_0x0030('0x5')](this[_0x0030('0x6')](_0x0030('0x4'))):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0030('0x7')],'set':function(_0x2e8d99){if(_0x2e8d99){this[_0x0030('0x8')]('channel',_0x2e8d99);this[_0x0030('0x8')](_0x0030('0x9'),_0x2e8d99[_0x0030('0xa')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0030('0x7')]},'calleridnum':{'type':Sequelize[_0x0030('0x7')]},'calleridname':{'type':Sequelize[_0x0030('0x7')]},'connectedlinenum':{'type':Sequelize[_0x0030('0x7')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x0030('0x7')]},'context':{'type':Sequelize[_0x0030('0x7')]},'exten':{'type':Sequelize[_0x0030('0x7')]},'value':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x0030('0x7')]},'createdAt':{'type':Sequelize[_0x0030('0xb')],'get':function(){return moment(this[_0x0030('0x6')](_0x0030('0xc')))[_0x0030('0xd')](_0x0030('0xe'))[_0x0030('0xf')]();}},'updatedAt':{'type':Sequelize[_0x0030('0xb')],'get':function(){return moment(this[_0x0030('0x6')](_0x0030('0x10')))['format'](_0x0030('0xe'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 0c4b5d8..3b7e0bc 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 _0x86d6=['set','apply','reject','save','update','destroy','then','error','name','VoiceRecording','rawAttributes','model','differenceBy','keys','format','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','params','options','find','create','describe','download','type','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','filename','extname','unlink','VoiceRecording\x20not\x20found','send','Not\x20found','sequelize','MD5','col','push','Sequelize','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit'];(function(_0x1ee25a,_0x5d1815){var _0x2ff89b=function(_0x23de8b){while(--_0x23de8b){_0x1ee25a['push'](_0x1ee25a['shift']());}};_0x2ff89b(++_0x5d1815);}(_0x86d6,0x149));var _0x686d=function(_0x5ad4b8,_0x5afa80){_0x5ad4b8=_0x5ad4b8-0x0;var _0x3b097e=_0x86d6[_0x5ad4b8];return _0x3b097e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x686d('0x0'));var zipdir=require(_0x686d('0x1'));var jsonpatch=require(_0x686d('0x2'));var rp=require(_0x686d('0x3'));var moment=require(_0x686d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x686d('0x5'));var util=require('util');var path=require(_0x686d('0x6'));var sox=require(_0x686d('0x7'));var csv=require(_0x686d('0x8'));var ejs=require(_0x686d('0x9'));var fs=require('fs');var _=require(_0x686d('0xa'));var squel=require(_0x686d('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x686d('0xc'));var Papa=require(_0x686d('0xd'));var Redis=require(_0x686d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x686d('0xf'));var hardwareService=require(_0x686d('0x10'));var logger=require(_0x686d('0x11'))('api');var utils=require(_0x686d('0x12'));var config=require('../../config/environment');var db=require(_0x686d('0x13'))['db'];function respondWithStatusCode(_0x3b568f,_0x300b3e){_0x300b3e=_0x300b3e||0xcc;return function(_0x2116cb){if(_0x2116cb){return _0x3b568f[_0x686d('0x14')](_0x300b3e);}return _0x3b568f[_0x686d('0x15')](_0x300b3e)[_0x686d('0x16')]();};}function respondWithResult(_0x11b685,_0x32a827){_0x32a827=_0x32a827||0xc8;return function(_0x38fdbc){if(_0x38fdbc){return _0x11b685['status'](_0x32a827)[_0x686d('0x17')](_0x38fdbc);}};}function respondWithFilteredResult(_0x45c398,_0x58c606){return function(_0xf49f7d){if(_0xf49f7d){var _0x212333=_0xf49f7d[_0x686d('0x18')],_0x28a1e2=_0x58c606[_0x686d('0x19')],_0xc98724=_0x58c606['offset']+_0x58c606[_0x686d('0x1a')],_0x440d75;if(_0xc98724>=_0x212333){_0xc98724=_0x212333;_0x440d75=0xc8;}else{_0x440d75=0xce;}_0x45c398['status'](_0x440d75);return _0x45c398[_0x686d('0x1b')]('Content-Range',_0x28a1e2+'-'+_0xc98724+'/'+_0x212333)[_0x686d('0x17')](_0xf49f7d);}return null;};}function patchUpdates(_0x589c93){return function(_0xea6531){try{jsonpatch[_0x686d('0x1c')](_0xea6531,_0x589c93,!![]);}catch(_0x175489){return BPromise[_0x686d('0x1d')](_0x175489);}return _0xea6531[_0x686d('0x1e')]();};}function saveUpdates(_0x2d04c7,_0x3ba875){return function(_0x265b81){if(_0x265b81){return _0x265b81[_0x686d('0x1f')](_0x2d04c7)['then'](function(_0x40f98e){return _0x40f98e;});}return null;};}function removeEntity(_0x485fe3,_0x7d9ac5){return function(_0x31a13e){if(_0x31a13e){return _0x31a13e[_0x686d('0x20')]()[_0x686d('0x21')](function(){_0x485fe3[_0x686d('0x15')](0xcc)[_0x686d('0x16')]();});}};}function handleEntityNotFound(_0xf5763d,_0x1139c1){return function(_0x49095f){if(!_0x49095f){_0xf5763d['sendStatus'](0x194);}return _0x49095f;};}function handleError(_0x452fe6,_0x2b5dc9){_0x2b5dc9=_0x2b5dc9||0x1f4;return function(_0x5e02ad){logger[_0x686d('0x22')](_0x5e02ad['stack']);if(_0x5e02ad[_0x686d('0x23')]){delete _0x5e02ad['name'];}_0x452fe6[_0x686d('0x15')](_0x2b5dc9)['send'](_0x5e02ad);};}exports['index']=function(_0x123305,_0x34c586){var _0x2b3c59={},_0xae720b={},_0x11a1c9={'count':0x0,'rows':[]};var _0x1d9515=db[_0x686d('0x24')][_0x686d('0x25')];_0xae720b[_0x686d('0x26')]=_[_0x686d('0x27')](_[_0x686d('0x28')](_0x1d9515),[_0x686d('0x29')]);_0xae720b[_0x686d('0x2a')]=_[_0x686d('0x28')](_0x123305['query']);_0xae720b[_0x686d('0x2b')]=_['intersection'](_0xae720b[_0x686d('0x26')],_0xae720b['query']);_0x2b3c59[_0x686d('0x2c')]=_[_0x686d('0x2d')](_0xae720b[_0x686d('0x26')],qs[_0x686d('0x2e')](_0x123305[_0x686d('0x2a')]['fields']));_0x2b3c59[_0x686d('0x2c')]=_0x2b3c59[_0x686d('0x2c')][_0x686d('0x2f')]?_0x2b3c59[_0x686d('0x2c')]:_0xae720b[_0x686d('0x26')];if(!_0x123305[_0x686d('0x2a')][_0x686d('0x30')](_0x686d('0x31'))){_0x2b3c59[_0x686d('0x1a')]=qs[_0x686d('0x1a')](_0x123305[_0x686d('0x2a')][_0x686d('0x1a')]);_0x2b3c59['offset']=qs['offset'](_0x123305[_0x686d('0x2a')]['offset']);}_0x2b3c59['order']=qs['sort'](_0x123305[_0x686d('0x2a')][_0x686d('0x32')]);_0x2b3c59[_0x686d('0x33')]=qs[_0x686d('0x2b')](_[_0x686d('0x34')](_0x123305[_0x686d('0x2a')],_0xae720b[_0x686d('0x2b')]));if(_0x123305[_0x686d('0x2a')][_0x686d('0x35')]){_0x2b3c59[_0x686d('0x33')]=_[_0x686d('0x36')](_0x2b3c59['where'],{'$or':_['map'](_0x1d9515,function(_0x5f14f9){if(_0x5f14f9['type']['key']!==_0x686d('0x37')){var _0x55cfe8={};_0x55cfe8[_0x5f14f9[_0x686d('0x38')]]={'$like':'%'+_0x123305[_0x686d('0x2a')][_0x686d('0x35')]+'%'};return _0x55cfe8;}})});}_0x2b3c59=_[_0x686d('0x36')]({},_0x2b3c59,_0x123305['options']);var _0xd10d3d={'where':_0x2b3c59[_0x686d('0x33')]};return db[_0x686d('0x24')][_0x686d('0x18')](_0xd10d3d)[_0x686d('0x21')](function(_0x421aa2){_0x11a1c9['count']=_0x421aa2;if(_0x123305[_0x686d('0x2a')][_0x686d('0x39')]){_0x2b3c59[_0x686d('0x3a')]=[{'all':!![]}];}return db[_0x686d('0x24')][_0x686d('0x3b')](_0x2b3c59);})['then'](function(_0xa6fe03){_0x11a1c9[_0x686d('0x3c')]=_0xa6fe03;return _0x11a1c9;})[_0x686d('0x21')](respondWithFilteredResult(_0x34c586,_0x2b3c59))[_0x686d('0x3d')](handleError(_0x34c586,null));};exports[_0x686d('0x3e')]=function(_0x3bc38a,_0x221861){var _0x26597d={'raw':![],'where':{'id':_0x3bc38a[_0x686d('0x3f')]['id']}},_0x1b3d35={};_0x1b3d35[_0x686d('0x26')]=_[_0x686d('0x28')](db['VoiceRecording'][_0x686d('0x25')]);_0x1b3d35[_0x686d('0x2a')]=_['keys'](_0x3bc38a[_0x686d('0x2a')]);_0x1b3d35['filters']=_['intersection'](_0x1b3d35['model'],_0x1b3d35[_0x686d('0x2a')]);_0x26597d[_0x686d('0x2c')]=_[_0x686d('0x2d')](_0x1b3d35[_0x686d('0x26')],qs['fields'](_0x3bc38a['query'][_0x686d('0x2e')]));_0x26597d['attributes']=_0x26597d[_0x686d('0x2c')][_0x686d('0x2f')]?_0x26597d[_0x686d('0x2c')]:_0x1b3d35[_0x686d('0x26')];if(_0x3bc38a[_0x686d('0x2a')][_0x686d('0x39')]){_0x26597d['include']=[{'all':!![]}];}_0x26597d=_['merge']({},_0x26597d,_0x3bc38a[_0x686d('0x40')]);return db[_0x686d('0x24')][_0x686d('0x41')](_0x26597d)[_0x686d('0x21')](handleEntityNotFound(_0x221861,null))[_0x686d('0x21')](respondWithResult(_0x221861,null))[_0x686d('0x3d')](handleError(_0x221861,null));};exports[_0x686d('0x42')]=function(_0x3a171e,_0x5e3342){return db[_0x686d('0x24')]['create'](_0x3a171e['body'],{})[_0x686d('0x21')](respondWithResult(_0x5e3342,0xc9))[_0x686d('0x3d')](handleError(_0x5e3342,null));};exports['update']=function(_0x1da609,_0x249cf0){if(_0x1da609['body']['id']){delete _0x1da609['body']['id'];}return db[_0x686d('0x24')][_0x686d('0x41')]({'where':{'id':_0x1da609[_0x686d('0x3f')]['id']}})[_0x686d('0x21')](handleEntityNotFound(_0x249cf0,null))[_0x686d('0x21')](saveUpdates(_0x1da609['body'],null))[_0x686d('0x21')](respondWithResult(_0x249cf0,null))['catch'](handleError(_0x249cf0,null));};exports[_0x686d('0x20')]=function(_0x4cac49,_0x2a55df){return db[_0x686d('0x24')][_0x686d('0x41')]({'where':{'id':_0x4cac49[_0x686d('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2a55df,null))['then'](removeEntity(_0x2a55df,null))[_0x686d('0x3d')](handleError(_0x2a55df,null));};exports[_0x686d('0x43')]=function(_0x1eefc2,_0x49ba6e){return db[_0x686d('0x24')]['describe']()[_0x686d('0x21')](respondWithResult(_0x49ba6e,null))[_0x686d('0x3d')](handleError(_0x49ba6e,null));};exports[_0x686d('0x44')]=function(_0xc99498,_0x6c6689,_0x273064){var _0x3b97de=require('../../components/encryptor');var _0x3b85a5=![];var _0x52f581={};if(_0xc99498['query'][_0x686d('0x45')]&&_0xc99498['query'][_0x686d('0x45')]===_0x686d('0x46')){_0x52f581[_0x686d('0x46')]=_0xc99498[_0x686d('0x3f')]['id'];}else{_0x52f581['id']=_0xc99498['params']['id'];}return db[_0x686d('0x24')][_0x686d('0x41')]({'where':_0x52f581,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x6c6689,null))[_0x686d('0x21')](function(_0x2fd0f9){if(_0x2fd0f9){var _0x32c643=_0x2fd0f9[_0x686d('0x47')];var _0x2cb3ba=util[_0x686d('0x29')](_0x686d('0x48'),_0x32c643);if(fs[_0x686d('0x49')](_0x2cb3ba)){_0x3b85a5=!![];return _0x3b97de[_0x686d('0x4a')](_0x2cb3ba,_0x32c643,config[_0x686d('0x4b')][_0x686d('0x4c')])[_0x686d('0x21')](function(){return _0x2fd0f9;});}return _0x2fd0f9;}})[_0x686d('0x21')](function(_0x42f99d){if(_0x42f99d){var _0x6b7e1b=_0x42f99d[_0x686d('0x47')];if(!fs['existsSync'](_0x6b7e1b)){throw new db['Sequelize'][(_0x686d('0x4d'))]('VoiceRecording\x20not\x20found');}if(_0x42f99d[_0x686d('0x4e')]){return _0x6c6689[_0x686d('0x44')](_0x6b7e1b,_0x42f99d[_0x686d('0x4e')]+path[_0x686d('0x4f')](_0x6b7e1b),function(){if(_0x3b85a5){fs[_0x686d('0x50')](_0x6b7e1b);}});}else{return _0x6c6689[_0x686d('0x44')](_0x6b7e1b,function(_0x257400){if(_0x3b85a5){fs[_0x686d('0x50')](_0x6b7e1b);}});}}})[_0x686d('0x3d')](function(_0x1b86bc){if(_0x1b86bc['message']===_0x686d('0x51')){_0x6c6689[_0x686d('0x15')](0x194)[_0x686d('0x52')](_0x686d('0x53'));}else{return handleError(_0x6c6689,null);}});};exports['downloads']=function(_0x2d2be9,_0xa349f4,_0x20f697){var _0x2f3b84=require('../../components/encryptor');var _0x27ae69=![];var _0x5acee8={'$and':[db[_0x686d('0x54')]['where'](db['sequelize']['fn'](_0x686d('0x55'),db[_0x686d('0x54')][_0x686d('0x56')]('uniqueid')),_0x2d2be9[_0x686d('0x2a')]['token'])]};if(_0x2d2be9['query'][_0x686d('0x45')]&&_0x2d2be9[_0x686d('0x2a')][_0x686d('0x45')]===_0x686d('0x46')){_0x5acee8['$and']['push']({'uniqueid':_0x2d2be9[_0x686d('0x3f')]['id']});}else{_0x5acee8['$and'][_0x686d('0x57')]({'id':_0x2d2be9[_0x686d('0x3f')]['id']});}return db['VoiceRecording'][_0x686d('0x41')]({'where':_0x5acee8,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0xa349f4,null))[_0x686d('0x21')](function(_0x206266){if(_0x206266){var _0x923076=util[_0x686d('0x29')](_0x686d('0x48'),_0x206266[_0x686d('0x47')]);if(fs[_0x686d('0x49')](_0x923076)){_0x27ae69=!![];return _0x2f3b84['decryptFile'](_0x923076,_0x206266[_0x686d('0x47')],config[_0x686d('0x4b')][_0x686d('0x4c')])[_0x686d('0x21')](function(){return _0x206266;});}return _0x206266;}})['then'](function(_0x4b0230){if(_0x4b0230){if(!fs[_0x686d('0x49')](_0x4b0230[_0x686d('0x47')])){throw new db[(_0x686d('0x58'))][(_0x686d('0x4d'))](_0x686d('0x51'));}if(_0x4b0230['filename']){return _0xa349f4[_0x686d('0x44')](_0x4b0230[_0x686d('0x47')],_0x4b0230['filename']+path[_0x686d('0x4f')](_0x4b0230[_0x686d('0x47')]),function(){if(_0x27ae69){fs[_0x686d('0x50')](_0x4b0230[_0x686d('0x47')]);}});}else{return _0xa349f4[_0x686d('0x44')](_0x4b0230['value'],function(_0x1248d8){if(_0x27ae69){fs[_0x686d('0x50')](_0x4b0230[_0x686d('0x47')]);}});}}})[_0x686d('0x3d')](handleError(_0xa349f4,null));}; \ No newline at end of file +var _0x9ae4=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','reject','save','destroy','then','end','stack','name','send','index','VoiceRecording','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','options','includeAll','catch','show','length','include','merge','find','create','body','update','params','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','sequelize','col','token','$and','push','format','Sequelize','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x2637ac,_0x377857){var _0x4a5758=function(_0x5d5043){while(--_0x5d5043){_0x2637ac['push'](_0x2637ac['shift']());}};_0x4a5758(++_0x377857);}(_0x9ae4,0x1c9));var _0x49ae=function(_0x47241c,_0x2f6104){_0x47241c=_0x47241c-0x0;var _0x4e02bf=_0x9ae4[_0x47241c];return _0x4e02bf;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x49ae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x49ae('0x1'));var jsonpatch=require(_0x49ae('0x2'));var rp=require('request-promise');var moment=require(_0x49ae('0x3'));var BPromise=require(_0x49ae('0x4'));var Mustache=require(_0x49ae('0x5'));var util=require(_0x49ae('0x6'));var path=require(_0x49ae('0x7'));var sox=require(_0x49ae('0x8'));var csv=require(_0x49ae('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x49ae('0xa'));var squel=require('squel');var crypto=require(_0x49ae('0xb'));var jsforce=require(_0x49ae('0xc'));var deskjs=require(_0x49ae('0xd'));var toCsv=require('to-csv');var querystring=require(_0x49ae('0xe'));var Papa=require(_0x49ae('0xf'));var Redis=require(_0x49ae('0x10'));var authService=require(_0x49ae('0x11'));var qs=require(_0x49ae('0x12'));var hardwareService=require(_0x49ae('0x13'));var logger=require(_0x49ae('0x14'))(_0x49ae('0x15'));var utils=require(_0x49ae('0x16'));var config=require('../../config/environment');var db=require(_0x49ae('0x17'))['db'];function respondWithStatusCode(_0x570771,_0x1ce694){_0x1ce694=_0x1ce694||0xcc;return function(_0x23da13){if(_0x23da13){return _0x570771[_0x49ae('0x18')](_0x1ce694);}return _0x570771[_0x49ae('0x19')](_0x1ce694)['end']();};}function respondWithResult(_0x3b5be5,_0x316571){_0x316571=_0x316571||0xc8;return function(_0x3c5490){if(_0x3c5490){return _0x3b5be5[_0x49ae('0x19')](_0x316571)['json'](_0x3c5490);}};}function respondWithFilteredResult(_0x1d842a,_0x1b43e7){return function(_0x16fc2b){if(_0x16fc2b){var _0x8092dd=_0x16fc2b[_0x49ae('0x1a')],_0x25e7bf=_0x1b43e7[_0x49ae('0x1b')],_0x45bc54=_0x1b43e7[_0x49ae('0x1b')]+_0x1b43e7[_0x49ae('0x1c')],_0x136658;if(_0x45bc54>=_0x8092dd){_0x45bc54=_0x8092dd;_0x136658=0xc8;}else{_0x136658=0xce;}_0x1d842a[_0x49ae('0x19')](_0x136658);return _0x1d842a[_0x49ae('0x1d')](_0x49ae('0x1e'),_0x25e7bf+'-'+_0x45bc54+'/'+_0x8092dd)['json'](_0x16fc2b);}return null;};}function patchUpdates(_0x4d233f){return function(_0x3aae71){try{jsonpatch['apply'](_0x3aae71,_0x4d233f,!![]);}catch(_0x2283ef){return BPromise[_0x49ae('0x1f')](_0x2283ef);}return _0x3aae71[_0x49ae('0x20')]();};}function saveUpdates(_0x1c9c1f,_0x31bfc1){return function(_0x39b2dd){if(_0x39b2dd){return _0x39b2dd['update'](_0x1c9c1f)['then'](function(_0x919719){return _0x919719;});}return null;};}function removeEntity(_0xa12f7b,_0x532ce9){return function(_0x24a873){if(_0x24a873){return _0x24a873[_0x49ae('0x21')]()[_0x49ae('0x22')](function(){_0xa12f7b[_0x49ae('0x19')](0xcc)[_0x49ae('0x23')]();});}};}function handleEntityNotFound(_0x40c495,_0x4545fa){return function(_0x25224e){if(!_0x25224e){_0x40c495['sendStatus'](0x194);}return _0x25224e;};}function handleError(_0x4ca109,_0x353521){_0x353521=_0x353521||0x1f4;return function(_0x56816e){logger['error'](_0x56816e[_0x49ae('0x24')]);if(_0x56816e[_0x49ae('0x25')]){delete _0x56816e[_0x49ae('0x25')];}_0x4ca109['status'](_0x353521)[_0x49ae('0x26')](_0x56816e);};}exports[_0x49ae('0x27')]=function(_0x265ac8,_0x52c318){var _0x2d1229={},_0x10edc3={},_0x310a08={'count':0x0,'rows':[]};var _0x3c3aed=db[_0x49ae('0x28')][_0x49ae('0x29')];_0x10edc3[_0x49ae('0x2a')]=_['differenceBy'](_[_0x49ae('0x2b')](_0x3c3aed),['format']);_0x10edc3[_0x49ae('0x2c')]=_[_0x49ae('0x2b')](_0x265ac8[_0x49ae('0x2c')]);_0x10edc3[_0x49ae('0x2d')]=_[_0x49ae('0x2e')](_0x10edc3['model'],_0x10edc3[_0x49ae('0x2c')]);_0x2d1229[_0x49ae('0x2f')]=_[_0x49ae('0x2e')](_0x10edc3[_0x49ae('0x2a')],qs[_0x49ae('0x30')](_0x265ac8[_0x49ae('0x2c')][_0x49ae('0x30')]));_0x2d1229['attributes']=_0x2d1229[_0x49ae('0x2f')]['length']?_0x2d1229[_0x49ae('0x2f')]:_0x10edc3[_0x49ae('0x2a')];if(!_0x265ac8[_0x49ae('0x2c')][_0x49ae('0x31')](_0x49ae('0x32'))){_0x2d1229[_0x49ae('0x1c')]=qs[_0x49ae('0x1c')](_0x265ac8['query'][_0x49ae('0x1c')]);_0x2d1229[_0x49ae('0x1b')]=qs[_0x49ae('0x1b')](_0x265ac8[_0x49ae('0x2c')][_0x49ae('0x1b')]);}_0x2d1229[_0x49ae('0x33')]=qs[_0x49ae('0x34')](_0x265ac8['query'][_0x49ae('0x34')]);_0x2d1229[_0x49ae('0x35')]=qs[_0x49ae('0x2d')](_[_0x49ae('0x36')](_0x265ac8[_0x49ae('0x2c')],_0x10edc3['filters']));if(_0x265ac8['query'][_0x49ae('0x37')]){_0x2d1229[_0x49ae('0x35')]=_['merge'](_0x2d1229['where'],{'$or':_[_0x49ae('0x38')](_0x3c3aed,function(_0x1c61b7){if(_0x1c61b7[_0x49ae('0x39')][_0x49ae('0x3a')]!=='VIRTUAL'){var _0x393b33={};_0x393b33[_0x1c61b7['field']]={'$like':'%'+_0x265ac8[_0x49ae('0x2c')][_0x49ae('0x37')]+'%'};return _0x393b33;}})});}_0x2d1229=_['merge']({},_0x2d1229,_0x265ac8[_0x49ae('0x3b')]);var _0xf51666={'where':_0x2d1229[_0x49ae('0x35')]};return db[_0x49ae('0x28')][_0x49ae('0x1a')](_0xf51666)[_0x49ae('0x22')](function(_0x3eba6e){_0x310a08[_0x49ae('0x1a')]=_0x3eba6e;if(_0x265ac8[_0x49ae('0x2c')][_0x49ae('0x3c')]){_0x2d1229['include']=[{'all':!![]}];}return db[_0x49ae('0x28')]['findAll'](_0x2d1229);})['then'](function(_0x26cc59){_0x310a08['rows']=_0x26cc59;return _0x310a08;})[_0x49ae('0x22')](respondWithFilteredResult(_0x52c318,_0x2d1229))[_0x49ae('0x3d')](handleError(_0x52c318,null));};exports[_0x49ae('0x3e')]=function(_0x5c392e,_0x2c4669){var _0x1a29a2={'raw':![],'where':{'id':_0x5c392e['params']['id']}},_0x57f7c7={};_0x57f7c7[_0x49ae('0x2a')]=_[_0x49ae('0x2b')](db[_0x49ae('0x28')][_0x49ae('0x29')]);_0x57f7c7['query']=_['keys'](_0x5c392e[_0x49ae('0x2c')]);_0x57f7c7[_0x49ae('0x2d')]=_[_0x49ae('0x2e')](_0x57f7c7['model'],_0x57f7c7['query']);_0x1a29a2[_0x49ae('0x2f')]=_[_0x49ae('0x2e')](_0x57f7c7['model'],qs['fields'](_0x5c392e[_0x49ae('0x2c')][_0x49ae('0x30')]));_0x1a29a2['attributes']=_0x1a29a2['attributes'][_0x49ae('0x3f')]?_0x1a29a2[_0x49ae('0x2f')]:_0x57f7c7[_0x49ae('0x2a')];if(_0x5c392e[_0x49ae('0x2c')][_0x49ae('0x3c')]){_0x1a29a2[_0x49ae('0x40')]=[{'all':!![]}];}_0x1a29a2=_[_0x49ae('0x41')]({},_0x1a29a2,_0x5c392e['options']);return db['VoiceRecording'][_0x49ae('0x42')](_0x1a29a2)[_0x49ae('0x22')](handleEntityNotFound(_0x2c4669,null))[_0x49ae('0x22')](respondWithResult(_0x2c4669,null))[_0x49ae('0x3d')](handleError(_0x2c4669,null));};exports['create']=function(_0x576285,_0x59b967){return db['VoiceRecording'][_0x49ae('0x43')](_0x576285[_0x49ae('0x44')],{})[_0x49ae('0x22')](respondWithResult(_0x59b967,0xc9))[_0x49ae('0x3d')](handleError(_0x59b967,null));};exports[_0x49ae('0x45')]=function(_0x101d8f,_0x8902c9){if(_0x101d8f[_0x49ae('0x44')]['id']){delete _0x101d8f['body']['id'];}return db[_0x49ae('0x28')][_0x49ae('0x42')]({'where':{'id':_0x101d8f[_0x49ae('0x46')]['id']}})[_0x49ae('0x22')](handleEntityNotFound(_0x8902c9,null))[_0x49ae('0x22')](saveUpdates(_0x101d8f[_0x49ae('0x44')],null))[_0x49ae('0x22')](respondWithResult(_0x8902c9,null))['catch'](handleError(_0x8902c9,null));};exports[_0x49ae('0x21')]=function(_0x7a314a,_0x3cbef2){return db[_0x49ae('0x28')][_0x49ae('0x42')]({'where':{'id':_0x7a314a[_0x49ae('0x46')]['id']}})[_0x49ae('0x22')](handleEntityNotFound(_0x3cbef2,null))[_0x49ae('0x22')](removeEntity(_0x3cbef2,null))[_0x49ae('0x3d')](handleError(_0x3cbef2,null));};exports[_0x49ae('0x47')]=function(_0x26fd23,_0x493e9c){return db[_0x49ae('0x28')][_0x49ae('0x47')]()[_0x49ae('0x22')](respondWithResult(_0x493e9c,null))[_0x49ae('0x3d')](handleError(_0x493e9c,null));};exports[_0x49ae('0x48')]=function(_0x1b6636,_0x4295cd,_0x4b944a){var _0x12be05=require(_0x49ae('0x49'));var _0x2541a1=![];var _0x16f737={};if(_0x1b6636[_0x49ae('0x2c')][_0x49ae('0x39')]&&_0x1b6636[_0x49ae('0x2c')][_0x49ae('0x39')]==='uniqueid'){_0x16f737[_0x49ae('0x4a')]=_0x1b6636['params']['id'];}else{_0x16f737['id']=_0x1b6636[_0x49ae('0x46')]['id'];}return db['VoiceRecording'][_0x49ae('0x42')]({'where':_0x16f737,'attributes':['id',_0x49ae('0x4b')],'raw':!![]})[_0x49ae('0x22')](handleEntityNotFound(_0x4295cd,null))[_0x49ae('0x22')](function(_0x3154a0){if(_0x3154a0){var _0x8b4a55=_0x3154a0[_0x49ae('0x4b')];var _0x1a4214=util['format'](_0x49ae('0x4c'),_0x8b4a55);if(fs[_0x49ae('0x4d')](_0x1a4214)){_0x2541a1=!![];return _0x12be05[_0x49ae('0x4e')](_0x1a4214,_0x8b4a55,config[_0x49ae('0x4f')][_0x49ae('0x50')])[_0x49ae('0x22')](function(){return _0x3154a0;});}return _0x3154a0;}})[_0x49ae('0x22')](function(_0x352546){if(_0x352546){var _0xd602d8=_0x352546[_0x49ae('0x4b')];if(!fs[_0x49ae('0x4d')](_0xd602d8)){throw new db['Sequelize'][(_0x49ae('0x51'))](_0x49ae('0x52'));}if(_0x352546[_0x49ae('0x53')]){return _0x4295cd['download'](_0xd602d8,_0x352546[_0x49ae('0x53')]+path[_0x49ae('0x54')](_0xd602d8),function(){if(_0x2541a1){fs[_0x49ae('0x55')](_0xd602d8);}});}else{return _0x4295cd[_0x49ae('0x48')](_0xd602d8,function(_0x3295af){if(_0x2541a1){fs[_0x49ae('0x55')](_0xd602d8);}});}}})[_0x49ae('0x3d')](function(_0xae23bb){if(_0xae23bb[_0x49ae('0x56')]===_0x49ae('0x52')){_0x4295cd[_0x49ae('0x19')](0x194)[_0x49ae('0x26')](_0x49ae('0x57'));}else{return handleError(_0x4295cd,null);}});};exports['downloads']=function(_0x3bea63,_0x4115cc,_0x13c61c){var _0x24d347=require(_0x49ae('0x49'));var _0x3b77f9=![];var _0x318578={'$and':[db[_0x49ae('0x58')][_0x49ae('0x35')](db[_0x49ae('0x58')]['fn']('MD5',db[_0x49ae('0x58')][_0x49ae('0x59')](_0x49ae('0x4a'))),_0x3bea63[_0x49ae('0x2c')][_0x49ae('0x5a')])]};if(_0x3bea63[_0x49ae('0x2c')]['type']&&_0x3bea63['query'][_0x49ae('0x39')]===_0x49ae('0x4a')){_0x318578[_0x49ae('0x5b')][_0x49ae('0x5c')]({'uniqueid':_0x3bea63[_0x49ae('0x46')]['id']});}else{_0x318578[_0x49ae('0x5b')][_0x49ae('0x5c')]({'id':_0x3bea63[_0x49ae('0x46')]['id']});}return db[_0x49ae('0x28')][_0x49ae('0x42')]({'where':_0x318578,'attributes':['id',_0x49ae('0x4b')],'raw':!![]})[_0x49ae('0x22')](handleEntityNotFound(_0x4115cc,null))[_0x49ae('0x22')](function(_0x9c1c6f){if(_0x9c1c6f){var _0x2e8bfe=util[_0x49ae('0x5d')]('%s.cypher',_0x9c1c6f[_0x49ae('0x4b')]);if(fs[_0x49ae('0x4d')](_0x2e8bfe)){_0x3b77f9=!![];return _0x24d347[_0x49ae('0x4e')](_0x2e8bfe,_0x9c1c6f[_0x49ae('0x4b')],config[_0x49ae('0x4f')][_0x49ae('0x50')])[_0x49ae('0x22')](function(){return _0x9c1c6f;});}return _0x9c1c6f;}})[_0x49ae('0x22')](function(_0x53e326){if(_0x53e326){if(!fs['existsSync'](_0x53e326[_0x49ae('0x4b')])){throw new db[(_0x49ae('0x5e'))][(_0x49ae('0x51'))](_0x49ae('0x52'));}if(_0x53e326[_0x49ae('0x53')]){return _0x4115cc['download'](_0x53e326[_0x49ae('0x4b')],_0x53e326['filename']+path[_0x49ae('0x54')](_0x53e326[_0x49ae('0x4b')]),function(){if(_0x3b77f9){fs['unlink'](_0x53e326['value']);}});}else{return _0x4115cc[_0x49ae('0x48')](_0x53e326[_0x49ae('0x4b')],function(_0x55d1a5){if(_0x3b77f9){fs[_0x49ae('0x55')](_0x53e326[_0x49ae('0x4b')]);}});}}})[_0x49ae('0x3d')](handleError(_0x4115cc,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 0efa928..955b97c 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 _0x6207=['util','api','moment','bluebird','../../config/environment','define','VoiceRecording','uniqueid','lodash'];(function(_0xce6912,_0x431cb9){var _0x506443=function(_0x57178f){while(--_0x57178f){_0xce6912['push'](_0xce6912['shift']());}};_0x506443(++_0x431cb9);}(_0x6207,0xe0));var _0x7620=function(_0x51ec88,_0x4b9505){_0x51ec88=_0x51ec88-0x0;var _0x211f91=_0x6207[_0x51ec88];return _0x211f91;};'use strict';var _=require(_0x7620('0x0'));var util=require(_0x7620('0x1'));var logger=require('../../config/logger')(_0x7620('0x2'));var moment=require(_0x7620('0x3'));var BPromise=require(_0x7620('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7620('0x5'));var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x1a747a,_0x2d2428){return _0x1a747a[_0x7620('0x6')](_0x7620('0x7'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x7620('0x8'),'fields':[_0x7620('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x76e8=['moment','path','rimraf','../../config/environment','exports','voice_recordings','uniqueid','lodash','util','../../config/logger'];(function(_0x2f55d7,_0x42d1b9){var _0xbde18f=function(_0x23fc10){while(--_0x23fc10){_0x2f55d7['push'](_0x2f55d7['shift']());}};_0xbde18f(++_0x42d1b9);}(_0x76e8,0x179));var _0x876e=function(_0x35694b,_0x1314ec){_0x35694b=_0x35694b-0x0;var _0x1dc8bd=_0x76e8[_0x35694b];return _0x1dc8bd;};'use strict';var _=require(_0x876e('0x0'));var util=require(_0x876e('0x1'));var logger=require(_0x876e('0x2'))('api');var moment=require(_0x876e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x876e('0x4'));var rimraf=require(_0x876e('0x5'));var config=require(_0x876e('0x6'));var attributes=require('./voiceRecording.attributes');module[_0x876e('0x7')]=function(_0x4d9c95,_0x259454){return _0x4d9c95['define']('VoiceRecording',attributes,{'tableName':_0x876e('0x8'),'paranoid':![],'indexes':[{'name':_0x876e('0x9'),'fields':[_0x876e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 2c67dcc..d83978d 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 _0x06cc=['options','where','attributes','limit','stringify','catch','CreateVoiceRecording','../../components/encryptor','findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','VoiceRecording,\x20%s,\x20%s','message','result','UpdateVoiceRecording','VoiceRecording','update','body'];(function(_0x181b99,_0x45713f){var _0x1bd30c=function(_0x409405){while(--_0x409405){_0x181b99['push'](_0x181b99['shift']());}};_0x1bd30c(++_0x45713f);}(_0x06cc,0x17b));var _0xc06c=function(_0x1fdb72,_0x61e0d4){_0x1fdb72=_0x1fdb72-0x0;var _0x8efbcd=_0x06cc[_0x1fdb72];return _0x8efbcd;};'use strict';var _=require(_0xc06c('0x0'));var util=require(_0xc06c('0x1'));var moment=require(_0xc06c('0x2'));var BPromise=require(_0xc06c('0x3'));var rs=require(_0xc06c('0x4'));var fs=require('fs');var Redis=require(_0xc06c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc06c('0x6'));var logger=require(_0xc06c('0x7'))('rpc');var config=require(_0xc06c('0x8'));var jayson=require(_0xc06c('0x9'));var client=jayson[_0xc06c('0xa')][_0xc06c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18ef77,_0xc11254,_0x494b66){return new BPromise(function(_0x19c1e2,_0x3fc2a3){return client['request'](_0x18ef77,_0x494b66)[_0xc06c('0xc')](function(_0x16dd24){logger[_0xc06c('0xd')]('VoiceRecording,\x20%s,\x20%s',_0xc11254,_0xc06c('0xe'));logger[_0xc06c('0xf')](_0xc06c('0x10'),_0xc11254,_0xc06c('0xe'),JSON['stringify'](_0x16dd24));if(_0x16dd24['error']){if(_0x16dd24[_0xc06c('0x11')][_0xc06c('0x12')]===0x1f4){logger[_0xc06c('0x11')](_0xc06c('0x13'),_0xc11254,_0x16dd24[_0xc06c('0x11')][_0xc06c('0x14')]);return _0x3fc2a3(_0x16dd24['error']['message']);}logger[_0xc06c('0x11')](_0xc06c('0x13'),_0xc11254,_0x16dd24['error']['message']);return _0x19c1e2(_0x16dd24['error'][_0xc06c('0x14')]);}else{logger['info'](_0xc06c('0x13'),_0xc11254,_0xc06c('0xe'));_0x19c1e2(_0x16dd24[_0xc06c('0x15')][_0xc06c('0x14')]);}})['catch'](function(_0x4c1da3){logger[_0xc06c('0x11')](_0xc06c('0x13'),_0xc11254,_0x4c1da3);_0x3fc2a3(_0x4c1da3);});});}exports[_0xc06c('0x16')]=function(_0x361841){var _0x225f3c=this;return new Promise(function(_0x3846ca,_0x3f13be){return db[_0xc06c('0x17')][_0xc06c('0x18')](_0x361841[_0xc06c('0x19')],{'raw':_0x361841[_0xc06c('0x1a')]?_0x361841['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x361841[_0xc06c('0x1a')]?_0x361841['options'][_0xc06c('0x1b')]||null:null,'attributes':_0x361841['options']?_0x361841['options'][_0xc06c('0x1c')]||null:null,'limit':_0x361841[_0xc06c('0x1a')]?_0x361841[_0xc06c('0x1a')][_0xc06c('0x1d')]||null:null})['then'](function(_0x3ba05b){logger[_0xc06c('0xd')](_0xc06c('0x16'),_0x361841);logger[_0xc06c('0xf')](_0xc06c('0x16'),_0x361841,JSON[_0xc06c('0x1e')](_0x3ba05b));_0x3846ca(_0x3ba05b);})[_0xc06c('0x1f')](function(_0x3fb84f){logger[_0xc06c('0x11')](_0xc06c('0x16'),_0x3fb84f[_0xc06c('0x14')],_0x361841);_0x3f13be(_0x225f3c['error'](0x1f4,_0x3fb84f[_0xc06c('0x14')]));});});};exports[_0xc06c('0x20')]=function(_0x2827ef){var _0x47236d=this;return new Promise(function(_0x386310,_0x3266b6){var _0x1d4584=require(_0xc06c('0x21'));var _0x59a7a7;return db['Setting'][_0xc06c('0x22')]({'attributes':['id',_0xc06c('0x23')],'where':{'id':0x1},'raw':!![]})[_0xc06c('0xc')](function(_0x472c01){_0x59a7a7=_0x472c01;return db['VoiceRecording'][_0xc06c('0x24')](_0x2827ef[_0xc06c('0x19')]);})[_0xc06c('0xc')](function(_0x4491c8){if(_0x59a7a7[_0xc06c('0x23')]&&fs[_0xc06c('0x25')](_0x4491c8[_0xc06c('0x26')])){var _0x57d429=util['format'](_0xc06c('0x27'),_0x4491c8[_0xc06c('0x26')]);return _0x1d4584[_0xc06c('0x28')](_0x4491c8[_0xc06c('0x26')],_0x57d429,config[_0xc06c('0x29')][_0xc06c('0x2a')])['then'](function(){fs[_0xc06c('0x2b')](_0x4491c8['value']);logger[_0xc06c('0xd')](_0xc06c('0x2c'));return _0x4491c8;});}return _0x4491c8;})[_0xc06c('0xc')](function(_0x736a9b){logger[_0xc06c('0xd')](_0xc06c('0x20'),_0x2827ef);logger[_0xc06c('0xf')](_0xc06c('0x20'),_0x2827ef,JSON[_0xc06c('0x1e')](_0x736a9b));_0x386310(_0x736a9b);})[_0xc06c('0x1f')](function(_0x4cd856){logger['error'](_0xc06c('0x20'),_0x4cd856[_0xc06c('0x14')],_0x2827ef);_0x3266b6(_0x47236d[_0xc06c('0x11')](0x1f4,_0x4cd856[_0xc06c('0x14')]));});});}; \ No newline at end of file +var _0x27d1=['limit','UpdateVoiceRecording','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','body','existsSync','value','format','%s.cypher','encryptFile','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','catch','VoiceRecording','update','options','raw','where','attributes'];(function(_0x54a6c9,_0x15da10){var _0x3ad256=function(_0x185c90){while(--_0x185c90){_0x54a6c9['push'](_0x54a6c9['shift']());}};_0x3ad256(++_0x15da10);}(_0x27d1,0xe6));var _0x127d=function(_0x53f83e,_0x90f607){_0x53f83e=_0x53f83e-0x0;var _0x4cbdd4=_0x27d1[_0x53f83e];return _0x4cbdd4;};'use strict';var _=require(_0x127d('0x0'));var util=require(_0x127d('0x1'));var moment=require(_0x127d('0x2'));var BPromise=require(_0x127d('0x3'));var rs=require(_0x127d('0x4'));var fs=require('fs');var Redis=require(_0x127d('0x5'));var db=require(_0x127d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x127d('0x7'));var config=require(_0x127d('0x8'));var jayson=require(_0x127d('0x9'));var client=jayson['client'][_0x127d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x303089,_0x356007,_0x40080e){return new BPromise(function(_0x3ef904,_0x3bc48b){return client[_0x127d('0xb')](_0x303089,_0x40080e)[_0x127d('0xc')](function(_0x1d86a7){logger[_0x127d('0xd')]('VoiceRecording,\x20%s,\x20%s',_0x356007,_0x127d('0xe'));logger['debug'](_0x127d('0xf'),_0x356007,'request\x20sent',JSON[_0x127d('0x10')](_0x1d86a7));if(_0x1d86a7[_0x127d('0x11')]){if(_0x1d86a7[_0x127d('0x11')][_0x127d('0x12')]===0x1f4){logger[_0x127d('0x11')](_0x127d('0x13'),_0x356007,_0x1d86a7['error'][_0x127d('0x14')]);return _0x3bc48b(_0x1d86a7[_0x127d('0x11')][_0x127d('0x14')]);}logger[_0x127d('0x11')](_0x127d('0x13'),_0x356007,_0x1d86a7['error']['message']);return _0x3ef904(_0x1d86a7['error'][_0x127d('0x14')]);}else{logger['info'](_0x127d('0x13'),_0x356007,_0x127d('0xe'));_0x3ef904(_0x1d86a7['result'][_0x127d('0x14')]);}})[_0x127d('0x15')](function(_0x24ea68){logger[_0x127d('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x356007,_0x24ea68);_0x3bc48b(_0x24ea68);});});}exports['UpdateVoiceRecording']=function(_0x51fb61){var _0x196a59=this;return new Promise(function(_0x42b70e,_0x2c229a){return db[_0x127d('0x16')][_0x127d('0x17')](_0x51fb61['body'],{'raw':_0x51fb61[_0x127d('0x18')]?_0x51fb61[_0x127d('0x18')][_0x127d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51fb61['options']?_0x51fb61['options'][_0x127d('0x1a')]||null:null,'attributes':_0x51fb61[_0x127d('0x18')]?_0x51fb61[_0x127d('0x18')][_0x127d('0x1b')]||null:null,'limit':_0x51fb61['options']?_0x51fb61[_0x127d('0x18')][_0x127d('0x1c')]||null:null})[_0x127d('0xc')](function(_0x15e43d){logger[_0x127d('0xd')]('UpdateVoiceRecording',_0x51fb61);logger['debug'](_0x127d('0x1d'),_0x51fb61,JSON[_0x127d('0x10')](_0x15e43d));_0x42b70e(_0x15e43d);})['catch'](function(_0x38f6ab){logger['error'](_0x127d('0x1d'),_0x38f6ab['message'],_0x51fb61);_0x2c229a(_0x196a59[_0x127d('0x11')](0x1f4,_0x38f6ab[_0x127d('0x14')]));});});};exports[_0x127d('0x1e')]=function(_0x45d1d5){var _0x4e2946=this;return new Promise(function(_0x534900,_0x102f7c){var _0x4b4ec=require('../../components/encryptor');var _0x5af4f5;return db[_0x127d('0x1f')][_0x127d('0x20')]({'attributes':['id',_0x127d('0x21')],'where':{'id':0x1},'raw':!![]})[_0x127d('0xc')](function(_0x5d10e5){_0x5af4f5=_0x5d10e5;return db['VoiceRecording'][_0x127d('0x22')](_0x45d1d5[_0x127d('0x23')]);})['then'](function(_0x5da3e5){if(_0x5af4f5['callRecordingEncryption']&&fs[_0x127d('0x24')](_0x5da3e5[_0x127d('0x25')])){var _0x359b0d=util[_0x127d('0x26')](_0x127d('0x27'),_0x5da3e5[_0x127d('0x25')]);return _0x4b4ec[_0x127d('0x28')](_0x5da3e5[_0x127d('0x25')],_0x359b0d,config['secrets']['recording'])[_0x127d('0xc')](function(){fs[_0x127d('0x29')](_0x5da3e5['value']);logger[_0x127d('0xd')](_0x127d('0x2a'));return _0x5da3e5;});}return _0x5da3e5;})[_0x127d('0xc')](function(_0x4e2707){logger[_0x127d('0xd')](_0x127d('0x1e'),_0x45d1d5);logger['debug'](_0x127d('0x1e'),_0x45d1d5,JSON[_0x127d('0x10')](_0x4e2707));_0x534900(_0x4e2707);})[_0x127d('0x15')](function(_0x48340a){logger['error']('CreateVoiceRecording',_0x48340a['message'],_0x45d1d5);_0x102f7c(_0x4e2946[_0x127d('0x11')](0x1f4,_0x48340a[_0x127d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 094130b..b8b00a3 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 _0xb52e=['isAuthenticated','/:id','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xb52e,0xa1));var _0xeb52=function(_0x11d4f6,_0x2bd39){_0x11d4f6=_0x11d4f6-0x0;var _0x4a29f6=_0xb52e[_0x11d4f6];return _0x4a29f6;};'use strict';var multer=require(_0xeb52('0x0'));var util=require(_0xeb52('0x1'));var path=require(_0xeb52('0x2'));var timeout=require(_0xeb52('0x3'));var express=require(_0xeb52('0x4'));var router=express['Router']();var auth=require(_0xeb52('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xeb52('0x6'));var controller=require(_0xeb52('0x7'));router[_0xeb52('0x8')]('/',auth[_0xeb52('0x9')](),controller['index']);router[_0xeb52('0x8')](_0xeb52('0xa'),auth[_0xeb52('0x9')](),controller['show']);router[_0xeb52('0xb')]('/',auth[_0xeb52('0x9')](),controller[_0xeb52('0xc')]);router[_0xeb52('0xd')](_0xeb52('0xa'),auth[_0xeb52('0x9')](),controller[_0xeb52('0xe')]);router['delete'](_0xeb52('0xa'),auth[_0xeb52('0x9')](),controller[_0xeb52('0xf')]);module[_0xeb52('0x10')]=router; \ No newline at end of file +var _0xf095=['update','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','index','show','isAuthenticated','put','/:id'];(function(_0x5ab926,_0x35c016){var _0x4b18be=function(_0x3c6d6f){while(--_0x3c6d6f){_0x5ab926['push'](_0x5ab926['shift']());}};_0x4b18be(++_0x35c016);}(_0xf095,0x8d));var _0x5f09=function(_0x41582d,_0x291b1c){_0x41582d=_0x41582d-0x0;var _0x59c504=_0xf095[_0x41582d];return _0x59c504;};'use strict';var multer=require('multer');var util=require(_0x5f09('0x0'));var path=require(_0x5f09('0x1'));var timeout=require(_0x5f09('0x2'));var express=require('express');var router=express[_0x5f09('0x3')]();var auth=require(_0x5f09('0x4'));var interaction=require(_0x5f09('0x5'));var config=require('../../config/environment');var controller=require(_0x5f09('0x6'));router[_0x5f09('0x7')]('/',auth['isAuthenticated'](),controller[_0x5f09('0x8')]);router[_0x5f09('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x5f09('0x9')]);router['post']('/',auth[_0x5f09('0xa')](),controller['create']);router[_0x5f09('0xb')](_0x5f09('0xc'),auth[_0x5f09('0xa')](),controller[_0x5f09('0xd')]);router['delete'](_0x5f09('0xc'),auth[_0x5f09('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 95daef1..0f86c08 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 _0x4b36=['ENUM','Yes','sequelize','moment','blind','attended','STRING'];(function(_0x392390,_0x450b39){var _0x148182=function(_0x14306e){while(--_0x14306e){_0x392390['push'](_0x392390['shift']());}};_0x148182(++_0x450b39);}(_0x4b36,0x1d7));var _0x64b3=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x4b36[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require(_0x64b3('0x0'));var moment=require(_0x64b3('0x1'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x64b3('0x2'),_0x64b3('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x64b3('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x64b3('0x4')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x64b3('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x64b3('0x4')]},'transfereechannel':{'type':Sequelize[_0x64b3('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x64b3('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x64b3('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x64b3('0x4')]},'transfereeexten':{'type':Sequelize[_0x64b3('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x64b3('0x4')]},'isexternal':{'type':Sequelize[_0x64b3('0x5')](_0x64b3('0x6'),'No')},'context':{'type':Sequelize[_0x64b3('0x4')]},'extension':{'type':Sequelize[_0x64b3('0x4')]}}; \ No newline at end of file +var _0x5d7b=['sequelize','moment','exports','ENUM','blind','attended','STRING','Yes'];(function(_0x468e0e,_0x153833){var _0x454c80=function(_0x2d88f2){while(--_0x2d88f2){_0x468e0e['push'](_0x468e0e['shift']());}};_0x454c80(++_0x153833);}(_0x5d7b,0xd8));var _0xb5d7=function(_0x2582e6,_0x1c15f1){_0x2582e6=_0x2582e6-0x0;var _0x391e57=_0x5d7b[_0x2582e6];return _0x391e57;};'use strict';var Sequelize=require(_0xb5d7('0x0'));var moment=require(_0xb5d7('0x1'));module[_0xb5d7('0x2')]={'type':{'type':Sequelize[_0xb5d7('0x3')](_0xb5d7('0x4'),_0xb5d7('0x5'))},'result':{'type':Sequelize[_0xb5d7('0x6')]},'transfererchannel':{'type':Sequelize[_0xb5d7('0x6')]},'transferercalleridnum':{'type':Sequelize[_0xb5d7('0x6')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xb5d7('0x6')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xb5d7('0x6')]},'transferercontext':{'type':Sequelize[_0xb5d7('0x6')]},'transfererexten':{'type':Sequelize[_0xb5d7('0x6')]},'transfererlinkedid':{'type':Sequelize[_0xb5d7('0x6')]},'transfereechannel':{'type':Sequelize[_0xb5d7('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0xb5d7('0x6')]},'transfereecalleridname':{'type':Sequelize[_0xb5d7('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xb5d7('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0xb5d7('0x6')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xb5d7('0x6')]},'transfereelinkedid':{'type':Sequelize[_0xb5d7('0x6')]},'isexternal':{'type':Sequelize['ENUM'](_0xb5d7('0x7'),'No')},'context':{'type':Sequelize[_0xb5d7('0x6')]},'extension':{'type':Sequelize[_0xb5d7('0x6')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index a8617e6..01e03b9 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 _0x9918=['show','params','catch','create','body','find','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','status','end','offset','limit','set','json','apply','reject','save','update','then','error','stack','name','index','VoiceTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','type','key','VIRTUAL','filter','options','count','includeAll','include','findAll','rows'];(function(_0x16b133,_0x1fc6f3){var _0x248b99=function(_0x10639a){while(--_0x10639a){_0x16b133['push'](_0x16b133['shift']());}};_0x248b99(++_0x1fc6f3);}(_0x9918,0x11b));var _0x8991=function(_0x29638f,_0x319dfd){_0x29638f=_0x29638f-0x0;var _0x227642=_0x9918[_0x29638f];return _0x227642;};'use strict';var pdf=require(_0x8991('0x0'));var emlformat=require(_0x8991('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8991('0x2'));var jsonpatch=require(_0x8991('0x3'));var rp=require('request-promise');var moment=require(_0x8991('0x4'));var BPromise=require(_0x8991('0x5'));var Mustache=require(_0x8991('0x6'));var util=require(_0x8991('0x7'));var path=require(_0x8991('0x8'));var sox=require('sox');var csv=require(_0x8991('0x9'));var ejs=require(_0x8991('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8991('0xb'));var deskjs=require(_0x8991('0xc'));var toCsv=require(_0x8991('0x9'));var querystring=require(_0x8991('0xd'));var Papa=require(_0x8991('0xe'));var Redis=require('ioredis');var authService=require(_0x8991('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8991('0x10'))(_0x8991('0x11'));var utils=require(_0x8991('0x12'));var config=require(_0x8991('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5cf428,_0x57990b){_0x57990b=_0x57990b||0xcc;return function(_0x2568c4){if(_0x2568c4){return _0x5cf428['sendStatus'](_0x57990b);}return _0x5cf428[_0x8991('0x14')](_0x57990b)[_0x8991('0x15')]();};}function respondWithResult(_0x181aad,_0x2a61ee){_0x2a61ee=_0x2a61ee||0xc8;return function(_0x591e7e){if(_0x591e7e){return _0x181aad[_0x8991('0x14')](_0x2a61ee)['json'](_0x591e7e);}};}function respondWithFilteredResult(_0x5212cf,_0x496f8a){return function(_0x33f049){if(_0x33f049){var _0x316d39=_0x33f049['count'],_0x18d98e=_0x496f8a[_0x8991('0x16')],_0x34a830=_0x496f8a[_0x8991('0x16')]+_0x496f8a[_0x8991('0x17')],_0x470736;if(_0x34a830>=_0x316d39){_0x34a830=_0x316d39;_0x470736=0xc8;}else{_0x470736=0xce;}_0x5212cf['status'](_0x470736);return _0x5212cf[_0x8991('0x18')]('Content-Range',_0x18d98e+'-'+_0x34a830+'/'+_0x316d39)[_0x8991('0x19')](_0x33f049);}return null;};}function patchUpdates(_0x538feb){return function(_0x543f59){try{jsonpatch[_0x8991('0x1a')](_0x543f59,_0x538feb,!![]);}catch(_0x149062){return BPromise[_0x8991('0x1b')](_0x149062);}return _0x543f59[_0x8991('0x1c')]();};}function saveUpdates(_0x297324,_0x53240e){return function(_0xfc8b35){if(_0xfc8b35){return _0xfc8b35[_0x8991('0x1d')](_0x297324)['then'](function(_0x4412ff){return _0x4412ff;});}return null;};}function removeEntity(_0x55cbed,_0xdc4f25){return function(_0x4a12ce){if(_0x4a12ce){return _0x4a12ce['destroy']()[_0x8991('0x1e')](function(){_0x55cbed[_0x8991('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a2c89,_0x2cf693){return function(_0x5d2346){if(!_0x5d2346){_0x4a2c89['sendStatus'](0x194);}return _0x5d2346;};}function handleError(_0x265ea9,_0x524d2b){_0x524d2b=_0x524d2b||0x1f4;return function(_0x1234d3){logger[_0x8991('0x1f')](_0x1234d3[_0x8991('0x20')]);if(_0x1234d3[_0x8991('0x21')]){delete _0x1234d3[_0x8991('0x21')];}_0x265ea9[_0x8991('0x14')](_0x524d2b)['send'](_0x1234d3);};}exports[_0x8991('0x22')]=function(_0x1f3879,_0x55abe7){var _0x114387={},_0x52a2a4={},_0xc168fc={'count':0x0,'rows':[]};var _0x527b0d=db[_0x8991('0x23')][_0x8991('0x24')];_0x52a2a4[_0x8991('0x25')]=_[_0x8991('0x26')](_0x527b0d);_0x52a2a4['query']=_['keys'](_0x1f3879[_0x8991('0x27')]);_0x52a2a4[_0x8991('0x28')]=_[_0x8991('0x29')](_0x52a2a4[_0x8991('0x25')],_0x52a2a4[_0x8991('0x27')]);_0x114387[_0x8991('0x2a')]=_['intersection'](_0x52a2a4['model'],qs[_0x8991('0x2b')](_0x1f3879['query']['fields']));_0x114387[_0x8991('0x2a')]=_0x114387['attributes'][_0x8991('0x2c')]?_0x114387[_0x8991('0x2a')]:_0x52a2a4[_0x8991('0x25')];if(!_0x1f3879['query'][_0x8991('0x2d')]('nolimit')){_0x114387[_0x8991('0x17')]=qs[_0x8991('0x17')](_0x1f3879[_0x8991('0x27')]['limit']);_0x114387['offset']=qs['offset'](_0x1f3879[_0x8991('0x27')][_0x8991('0x16')]);}_0x114387[_0x8991('0x2e')]=qs[_0x8991('0x2f')](_0x1f3879['query'][_0x8991('0x2f')]);_0x114387[_0x8991('0x30')]=qs[_0x8991('0x28')](_[_0x8991('0x31')](_0x1f3879[_0x8991('0x27')],_0x52a2a4[_0x8991('0x28')]));if(_0x1f3879[_0x8991('0x27')]['filter']){_0x114387['where']=_[_0x8991('0x32')](_0x114387[_0x8991('0x30')],{'$or':_[_0x8991('0x33')](_0x527b0d,function(_0x2da066){if(_0x2da066[_0x8991('0x34')][_0x8991('0x35')]!==_0x8991('0x36')){var _0x45adf8={};_0x45adf8[_0x2da066['field']]={'$like':'%'+_0x1f3879[_0x8991('0x27')][_0x8991('0x37')]+'%'};return _0x45adf8;}})});}_0x114387=_[_0x8991('0x32')]({},_0x114387,_0x1f3879[_0x8991('0x38')]);var _0x4ba12a={'where':_0x114387[_0x8991('0x30')]};return db[_0x8991('0x23')][_0x8991('0x39')](_0x4ba12a)[_0x8991('0x1e')](function(_0x5f0897){_0xc168fc[_0x8991('0x39')]=_0x5f0897;if(_0x1f3879[_0x8991('0x27')][_0x8991('0x3a')]){_0x114387[_0x8991('0x3b')]=[{'all':!![]}];}return db[_0x8991('0x23')][_0x8991('0x3c')](_0x114387);})['then'](function(_0x394332){_0xc168fc[_0x8991('0x3d')]=_0x394332;return _0xc168fc;})[_0x8991('0x1e')](respondWithFilteredResult(_0x55abe7,_0x114387))['catch'](handleError(_0x55abe7,null));};exports[_0x8991('0x3e')]=function(_0x1eed5d,_0x3ca2ac){var _0x3e92cf={'raw':!![],'where':{'id':_0x1eed5d[_0x8991('0x3f')]['id']}},_0x3440db={};_0x3440db[_0x8991('0x25')]=_[_0x8991('0x26')](db[_0x8991('0x23')][_0x8991('0x24')]);_0x3440db[_0x8991('0x27')]=_[_0x8991('0x26')](_0x1eed5d[_0x8991('0x27')]);_0x3440db[_0x8991('0x28')]=_['intersection'](_0x3440db['model'],_0x3440db[_0x8991('0x27')]);_0x3e92cf[_0x8991('0x2a')]=_[_0x8991('0x29')](_0x3440db[_0x8991('0x25')],qs[_0x8991('0x2b')](_0x1eed5d['query'][_0x8991('0x2b')]));_0x3e92cf[_0x8991('0x2a')]=_0x3e92cf[_0x8991('0x2a')][_0x8991('0x2c')]?_0x3e92cf[_0x8991('0x2a')]:_0x3440db[_0x8991('0x25')];if(_0x1eed5d['query']['includeAll']){_0x3e92cf[_0x8991('0x3b')]=[{'all':!![]}];}_0x3e92cf=_[_0x8991('0x32')]({},_0x3e92cf,_0x1eed5d[_0x8991('0x38')]);return db[_0x8991('0x23')]['find'](_0x3e92cf)[_0x8991('0x1e')](handleEntityNotFound(_0x3ca2ac,null))[_0x8991('0x1e')](respondWithResult(_0x3ca2ac,null))[_0x8991('0x40')](handleError(_0x3ca2ac,null));};exports[_0x8991('0x41')]=function(_0x441ad4,_0x586cff){return db['VoiceTransferReport'][_0x8991('0x41')](_0x441ad4[_0x8991('0x42')],{})[_0x8991('0x1e')](respondWithResult(_0x586cff,0xc9))[_0x8991('0x40')](handleError(_0x586cff,null));};exports['update']=function(_0xf106ba,_0x5c596e){if(_0xf106ba[_0x8991('0x42')]['id']){delete _0xf106ba[_0x8991('0x42')]['id'];}return db['VoiceTransferReport'][_0x8991('0x43')]({'where':{'id':_0xf106ba[_0x8991('0x3f')]['id']}})[_0x8991('0x1e')](handleEntityNotFound(_0x5c596e,null))[_0x8991('0x1e')](saveUpdates(_0xf106ba[_0x8991('0x42')],null))[_0x8991('0x1e')](respondWithResult(_0x5c596e,null))[_0x8991('0x40')](handleError(_0x5c596e,null));};exports[_0x8991('0x44')]=function(_0x2bc4c6,_0x1b58b9){return db[_0x8991('0x23')][_0x8991('0x43')]({'where':{'id':_0x2bc4c6[_0x8991('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1b58b9,null))[_0x8991('0x1e')](removeEntity(_0x1b58b9,null))['catch'](handleError(_0x1b58b9,null));}; \ No newline at end of file +var _0xd651=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','status','end','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','VoiceTransferReport','count','include','findAll','catch','show','params','rawAttributes','create','body','update','find'];(function(_0x3d5351,_0x27bc80){var _0x1db4db=function(_0x3f572b){while(--_0x3f572b){_0x3d5351['push'](_0x3d5351['shift']());}};_0x1db4db(++_0x27bc80);}(_0xd651,0x1ea));var _0x1d65=function(_0x7bf298,_0x2cf354){_0x7bf298=_0x7bf298-0x0;var _0x28c485=_0xd651[_0x7bf298];return _0x28c485;};'use strict';var pdf=require(_0x1d65('0x0'));var emlformat=require(_0x1d65('0x1'));var rimraf=require(_0x1d65('0x2'));var zipdir=require(_0x1d65('0x3'));var jsonpatch=require(_0x1d65('0x4'));var rp=require(_0x1d65('0x5'));var moment=require('moment');var BPromise=require(_0x1d65('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1d65('0x7'));var sox=require('sox');var csv=require(_0x1d65('0x8'));var ejs=require(_0x1d65('0x9'));var fs=require('fs');var _=require(_0x1d65('0xa'));var squel=require(_0x1d65('0xb'));var crypto=require(_0x1d65('0xc'));var jsforce=require(_0x1d65('0xd'));var deskjs=require(_0x1d65('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1d65('0xf'));var Papa=require(_0x1d65('0x10'));var Redis=require('ioredis');var authService=require(_0x1d65('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d65('0x12'))(_0x1d65('0x13'));var utils=require(_0x1d65('0x14'));var config=require('../../config/environment');var db=require(_0x1d65('0x15'))['db'];function respondWithStatusCode(_0x392bb9,_0x5d9a1a){_0x5d9a1a=_0x5d9a1a||0xcc;return function(_0x33f88e){if(_0x33f88e){return _0x392bb9['sendStatus'](_0x5d9a1a);}return _0x392bb9[_0x1d65('0x16')](_0x5d9a1a)[_0x1d65('0x17')]();};}function respondWithResult(_0x346f70,_0x627316){_0x627316=_0x627316||0xc8;return function(_0xe0197c){if(_0xe0197c){return _0x346f70['status'](_0x627316)['json'](_0xe0197c);}};}function respondWithFilteredResult(_0x3ff1fd,_0x1559c6){return function(_0x223f37){if(_0x223f37){var _0x14b405=_0x223f37['count'],_0xdcf309=_0x1559c6[_0x1d65('0x18')],_0x25093a=_0x1559c6[_0x1d65('0x18')]+_0x1559c6[_0x1d65('0x19')],_0x4b3ef3;if(_0x25093a>=_0x14b405){_0x25093a=_0x14b405;_0x4b3ef3=0xc8;}else{_0x4b3ef3=0xce;}_0x3ff1fd[_0x1d65('0x16')](_0x4b3ef3);return _0x3ff1fd[_0x1d65('0x1a')]('Content-Range',_0xdcf309+'-'+_0x25093a+'/'+_0x14b405)[_0x1d65('0x1b')](_0x223f37);}return null;};}function patchUpdates(_0x56479c){return function(_0x33ac1){try{jsonpatch[_0x1d65('0x1c')](_0x33ac1,_0x56479c,!![]);}catch(_0x51e7c9){return BPromise[_0x1d65('0x1d')](_0x51e7c9);}return _0x33ac1[_0x1d65('0x1e')]();};}function saveUpdates(_0x3751d3,_0x3f950b){return function(_0x1da289){if(_0x1da289){return _0x1da289['update'](_0x3751d3)[_0x1d65('0x1f')](function(_0x55a981){return _0x55a981;});}return null;};}function removeEntity(_0x119c3c,_0x3ec0a9){return function(_0x46fbd6){if(_0x46fbd6){return _0x46fbd6[_0x1d65('0x20')]()[_0x1d65('0x1f')](function(){_0x119c3c['status'](0xcc)[_0x1d65('0x17')]();});}};}function handleEntityNotFound(_0x1169ed,_0x20a919){return function(_0x55c578){if(!_0x55c578){_0x1169ed['sendStatus'](0x194);}return _0x55c578;};}function handleError(_0x29ace3,_0x4bddde){_0x4bddde=_0x4bddde||0x1f4;return function(_0x5cd8dc){logger[_0x1d65('0x21')](_0x5cd8dc[_0x1d65('0x22')]);if(_0x5cd8dc[_0x1d65('0x23')]){delete _0x5cd8dc[_0x1d65('0x23')];}_0x29ace3[_0x1d65('0x16')](_0x4bddde)['send'](_0x5cd8dc);};}exports[_0x1d65('0x24')]=function(_0x48f8a7,_0x5bc7eb){var _0x15e597={},_0x3a3cd4={},_0x3327cb={'count':0x0,'rows':[]};var _0x1e55b2=db['VoiceTransferReport']['rawAttributes'];_0x3a3cd4['model']=_['keys'](_0x1e55b2);_0x3a3cd4[_0x1d65('0x25')]=_[_0x1d65('0x26')](_0x48f8a7[_0x1d65('0x25')]);_0x3a3cd4[_0x1d65('0x27')]=_[_0x1d65('0x28')](_0x3a3cd4[_0x1d65('0x29')],_0x3a3cd4[_0x1d65('0x25')]);_0x15e597[_0x1d65('0x2a')]=_['intersection'](_0x3a3cd4[_0x1d65('0x29')],qs[_0x1d65('0x2b')](_0x48f8a7['query'][_0x1d65('0x2b')]));_0x15e597[_0x1d65('0x2a')]=_0x15e597[_0x1d65('0x2a')][_0x1d65('0x2c')]?_0x15e597[_0x1d65('0x2a')]:_0x3a3cd4[_0x1d65('0x29')];if(!_0x48f8a7[_0x1d65('0x25')][_0x1d65('0x2d')](_0x1d65('0x2e'))){_0x15e597['limit']=qs[_0x1d65('0x19')](_0x48f8a7[_0x1d65('0x25')]['limit']);_0x15e597['offset']=qs[_0x1d65('0x18')](_0x48f8a7[_0x1d65('0x25')][_0x1d65('0x18')]);}_0x15e597[_0x1d65('0x2f')]=qs[_0x1d65('0x30')](_0x48f8a7[_0x1d65('0x25')][_0x1d65('0x30')]);_0x15e597[_0x1d65('0x31')]=qs[_0x1d65('0x27')](_[_0x1d65('0x32')](_0x48f8a7[_0x1d65('0x25')],_0x3a3cd4['filters']));if(_0x48f8a7['query'][_0x1d65('0x33')]){_0x15e597[_0x1d65('0x31')]=_[_0x1d65('0x34')](_0x15e597[_0x1d65('0x31')],{'$or':_['map'](_0x1e55b2,function(_0x5dc75d){if(_0x5dc75d[_0x1d65('0x35')][_0x1d65('0x36')]!==_0x1d65('0x37')){var _0x14478d={};_0x14478d[_0x5dc75d[_0x1d65('0x38')]]={'$like':'%'+_0x48f8a7['query'][_0x1d65('0x33')]+'%'};return _0x14478d;}})});}_0x15e597=_[_0x1d65('0x34')]({},_0x15e597,_0x48f8a7[_0x1d65('0x39')]);var _0x2844ef={'where':_0x15e597['where']};return db[_0x1d65('0x3a')][_0x1d65('0x3b')](_0x2844ef)[_0x1d65('0x1f')](function(_0x5c90d7){_0x3327cb[_0x1d65('0x3b')]=_0x5c90d7;if(_0x48f8a7[_0x1d65('0x25')]['includeAll']){_0x15e597[_0x1d65('0x3c')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x1d65('0x3d')](_0x15e597);})[_0x1d65('0x1f')](function(_0x18ddc4){_0x3327cb['rows']=_0x18ddc4;return _0x3327cb;})[_0x1d65('0x1f')](respondWithFilteredResult(_0x5bc7eb,_0x15e597))[_0x1d65('0x3e')](handleError(_0x5bc7eb,null));};exports[_0x1d65('0x3f')]=function(_0xb5059a,_0x2672c9){var _0x143bff={'raw':!![],'where':{'id':_0xb5059a[_0x1d65('0x40')]['id']}},_0xd74857={};_0xd74857[_0x1d65('0x29')]=_[_0x1d65('0x26')](db[_0x1d65('0x3a')][_0x1d65('0x41')]);_0xd74857[_0x1d65('0x25')]=_[_0x1d65('0x26')](_0xb5059a[_0x1d65('0x25')]);_0xd74857[_0x1d65('0x27')]=_[_0x1d65('0x28')](_0xd74857[_0x1d65('0x29')],_0xd74857[_0x1d65('0x25')]);_0x143bff['attributes']=_['intersection'](_0xd74857[_0x1d65('0x29')],qs[_0x1d65('0x2b')](_0xb5059a['query'][_0x1d65('0x2b')]));_0x143bff[_0x1d65('0x2a')]=_0x143bff[_0x1d65('0x2a')][_0x1d65('0x2c')]?_0x143bff['attributes']:_0xd74857['model'];if(_0xb5059a[_0x1d65('0x25')]['includeAll']){_0x143bff[_0x1d65('0x3c')]=[{'all':!![]}];}_0x143bff=_[_0x1d65('0x34')]({},_0x143bff,_0xb5059a['options']);return db[_0x1d65('0x3a')]['find'](_0x143bff)['then'](handleEntityNotFound(_0x2672c9,null))[_0x1d65('0x1f')](respondWithResult(_0x2672c9,null))[_0x1d65('0x3e')](handleError(_0x2672c9,null));};exports[_0x1d65('0x42')]=function(_0x314be5,_0x5d9f45){return db['VoiceTransferReport'][_0x1d65('0x42')](_0x314be5[_0x1d65('0x43')],{})[_0x1d65('0x1f')](respondWithResult(_0x5d9f45,0xc9))[_0x1d65('0x3e')](handleError(_0x5d9f45,null));};exports[_0x1d65('0x44')]=function(_0x46aecb,_0x2ee3ac){if(_0x46aecb[_0x1d65('0x43')]['id']){delete _0x46aecb['body']['id'];}return db[_0x1d65('0x3a')]['find']({'where':{'id':_0x46aecb[_0x1d65('0x40')]['id']}})[_0x1d65('0x1f')](handleEntityNotFound(_0x2ee3ac,null))[_0x1d65('0x1f')](saveUpdates(_0x46aecb[_0x1d65('0x43')],null))[_0x1d65('0x1f')](respondWithResult(_0x2ee3ac,null))['catch'](handleError(_0x2ee3ac,null));};exports[_0x1d65('0x20')]=function(_0x93b0a2,_0x2f831a){return db[_0x1d65('0x3a')][_0x1d65('0x45')]({'where':{'id':_0x93b0a2[_0x1d65('0x40')]['id']}})['then'](handleEntityNotFound(_0x2f831a,null))[_0x1d65('0x1f')](removeEntity(_0x2f831a,null))[_0x1d65('0x3e')](handleError(_0x2f831a,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index ab1c28e..bb3a6f3 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 _0x9f69=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash'];(function(_0x132f48,_0x37229b){var _0x1851b4=function(_0x5404b2){while(--_0x5404b2){_0x132f48['push'](_0x132f48['shift']());}};_0x1851b4(++_0x37229b);}(_0x9f69,0x1ac));var _0x99f6=function(_0x5ebcc4,_0x24356a){_0x5ebcc4=_0x5ebcc4-0x0;var _0xff2552=_0x9f69[_0x5ebcc4];return _0xff2552;};'use strict';var _=require(_0x99f6('0x0'));var util=require(_0x99f6('0x1'));var logger=require(_0x99f6('0x2'))('api');var moment=require(_0x99f6('0x3'));var BPromise=require(_0x99f6('0x4'));var rp=require(_0x99f6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x99f6('0x6'));var config=require(_0x99f6('0x7'));var attributes=require(_0x99f6('0x8'));module[_0x99f6('0x9')]=function(_0x506f2f,_0x237123){return _0x506f2f[_0x99f6('0xa')](_0x99f6('0xb'),attributes,{'tableName':_0x99f6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b60=['../../config/logger','bluebird','./voiceTransferReport.attributes','define','report_call_transfer','lodash','util'];(function(_0x1ef676,_0x4fc8a6){var _0x151519=function(_0x53df0b){while(--_0x53df0b){_0x1ef676['push'](_0x1ef676['shift']());}};_0x151519(++_0x4fc8a6);}(_0x2b60,0x124));var _0x02b6=function(_0x3f08df,_0x4d6c79){_0x3f08df=_0x3f08df-0x0;var _0x5e2bdc=_0x2b60[_0x3f08df];return _0x5e2bdc;};'use strict';var _=require(_0x02b6('0x0'));var util=require(_0x02b6('0x1'));var logger=require(_0x02b6('0x2'))('api');var moment=require('moment');var BPromise=require(_0x02b6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x02b6('0x4'));module['exports']=function(_0xb31459,_0x1e0c55){return _0xb31459[_0x02b6('0x5')]('VoiceTransferReport',attributes,{'tableName':_0x02b6('0x6'),'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 f84e218..76c063d 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 _0xae2d=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','VoiceTransferReport','body','options','CreateVoiceTransferReport','catch','lodash','bluebird','randomstring'];(function(_0x442ad0,_0x4ebbdf){var _0x29af57=function(_0x2cd172){while(--_0x2cd172){_0x442ad0['push'](_0x442ad0['shift']());}};_0x29af57(++_0x4ebbdf);}(_0xae2d,0x18d));var _0xdae2=function(_0x2ac71a,_0x1d2a02){_0x2ac71a=_0x2ac71a-0x0;var _0x3ee904=_0xae2d[_0x2ac71a];return _0x3ee904;};'use strict';var _=require(_0xdae2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdae2('0x1'));var rs=require(_0xdae2('0x2'));var fs=require('fs');var Redis=require(_0xdae2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdae2('0x4'));var logger=require('../../config/logger')(_0xdae2('0x5'));var config=require(_0xdae2('0x6'));var jayson=require(_0xdae2('0x7'));var client=jayson[_0xdae2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f1816,_0x22390b,_0x5ee7b9){return new BPromise(function(_0x36f7f2,_0x4d39c7){return client[_0xdae2('0x9')](_0x2f1816,_0x5ee7b9)[_0xdae2('0xa')](function(_0x21898e){logger[_0xdae2('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x22390b,_0xdae2('0xc'));logger['debug'](_0xdae2('0xd'),_0x22390b,'request\x20sent',JSON[_0xdae2('0xe')](_0x21898e));if(_0x21898e['error']){if(_0x21898e[_0xdae2('0xf')][_0xdae2('0x10')]===0x1f4){logger['error'](_0xdae2('0x11'),_0x22390b,_0x21898e[_0xdae2('0xf')][_0xdae2('0x12')]);return _0x4d39c7(_0x21898e['error'][_0xdae2('0x12')]);}logger[_0xdae2('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x22390b,_0x21898e[_0xdae2('0xf')][_0xdae2('0x12')]);return _0x36f7f2(_0x21898e[_0xdae2('0xf')][_0xdae2('0x12')]);}else{logger[_0xdae2('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x22390b,_0xdae2('0xc'));_0x36f7f2(_0x21898e[_0xdae2('0x13')]['message']);}})['catch'](function(_0x4311ea){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x22390b,_0x4311ea);_0x4d39c7(_0x4311ea);});});}exports['CreateVoiceTransferReport']=function(_0x25226b){var _0x11a220=this;return new Promise(function(_0x406d42,_0x139c6b){return db[_0xdae2('0x14')]['create'](_0x25226b[_0xdae2('0x15')],{'raw':_0x25226b[_0xdae2('0x16')]?_0x25226b[_0xdae2('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xdae2('0xa')](function(_0x57c986){logger['info'](_0xdae2('0x17'),_0x25226b);logger['debug'](_0xdae2('0x17'),_0x25226b,JSON['stringify'](_0x57c986));_0x406d42(_0x57c986);})[_0xdae2('0x18')](function(_0x15b7b7){logger['error'](_0xdae2('0x17'),_0x15b7b7[_0xdae2('0x12')],_0x25226b);_0x139c6b(_0x11a220[_0xdae2('0xf')](0x1f4,_0x15b7b7[_0xdae2('0x12')]));});});}; \ No newline at end of file +var _0x5e8a=['request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceTransferReport','create','body','options','raw','CreateVoiceTransferReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s'];(function(_0x286a44,_0x2e04a7){var _0x15bf33=function(_0x582d44){while(--_0x582d44){_0x286a44['push'](_0x286a44['shift']());}};_0x15bf33(++_0x2e04a7);}(_0x5e8a,0x11d));var _0xa5e8=function(_0x2456f1,_0x2e08d9){_0x2456f1=_0x2456f1-0x0;var _0x317be7=_0x5e8a[_0x2456f1];return _0x317be7;};'use strict';var _=require(_0xa5e8('0x0'));var util=require(_0xa5e8('0x1'));var moment=require(_0xa5e8('0x2'));var BPromise=require(_0xa5e8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa5e8('0x4'));var db=require(_0xa5e8('0x5'))['db'];var utils=require(_0xa5e8('0x6'));var logger=require('../../config/logger')(_0xa5e8('0x7'));var config=require(_0xa5e8('0x8'));var jayson=require(_0xa5e8('0x9'));var client=jayson['client'][_0xa5e8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4882aa,_0x308131,_0x2fb31e){return new BPromise(function(_0x501cdd,_0x2b79b6){return client[_0xa5e8('0xb')](_0x4882aa,_0x2fb31e)[_0xa5e8('0xc')](function(_0x39b097){logger[_0xa5e8('0xd')](_0xa5e8('0xe'),_0x308131,_0xa5e8('0xf'));logger[_0xa5e8('0x10')](_0xa5e8('0x11'),_0x308131,_0xa5e8('0xf'),JSON[_0xa5e8('0x12')](_0x39b097));if(_0x39b097[_0xa5e8('0x13')]){if(_0x39b097[_0xa5e8('0x13')][_0xa5e8('0x14')]===0x1f4){logger[_0xa5e8('0x13')](_0xa5e8('0xe'),_0x308131,_0x39b097[_0xa5e8('0x13')]['message']);return _0x2b79b6(_0x39b097['error'][_0xa5e8('0x15')]);}logger[_0xa5e8('0x13')](_0xa5e8('0xe'),_0x308131,_0x39b097[_0xa5e8('0x13')][_0xa5e8('0x15')]);return _0x501cdd(_0x39b097[_0xa5e8('0x13')][_0xa5e8('0x15')]);}else{logger['info'](_0xa5e8('0xe'),_0x308131,_0xa5e8('0xf'));_0x501cdd(_0x39b097[_0xa5e8('0x16')]['message']);}})[_0xa5e8('0x17')](function(_0x194535){logger[_0xa5e8('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x308131,_0x194535);_0x2b79b6(_0x194535);});});}exports['CreateVoiceTransferReport']=function(_0x2e4eb9){var _0x432689=this;return new Promise(function(_0x253e93,_0x21fd68){return db[_0xa5e8('0x18')][_0xa5e8('0x19')](_0x2e4eb9[_0xa5e8('0x1a')],{'raw':_0x2e4eb9[_0xa5e8('0x1b')]?_0x2e4eb9[_0xa5e8('0x1b')][_0xa5e8('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x92a178){logger[_0xa5e8('0xd')](_0xa5e8('0x1d'),_0x2e4eb9);logger[_0xa5e8('0x10')](_0xa5e8('0x1d'),_0x2e4eb9,JSON[_0xa5e8('0x12')](_0x92a178));_0x253e93(_0x92a178);})[_0xa5e8('0x17')](function(_0x15ec4c){logger[_0xa5e8('0x13')]('CreateVoiceTransferReport',_0x15ec4c[_0xa5e8('0x15')],_0x2e4eb9);_0x21fd68(_0x432689['error'](0x1f4,_0x15ec4c[_0xa5e8('0x15')]));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index b9042ec..17e9e67 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff1f=['map','filter','online','join','status','None','seedDB','./config/seedDB','default','./config/license','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./rpc','./config/environment','app','./config/pm2','./config/schedule','sequelize','sync','listen','info','start','then','Online\x20apps:'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0xff1f,0xdd));var _0xfff1=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xff1f[_0x500419];return _0x241c1a;};'use strict';var _=require(_0xfff1('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0xfff1('0x1'));var config=require(_0xfff1('0x2'));var logger=require('./config/logger')(_0xfff1('0x3'));var pm2=require(_0xfff1('0x4'));var pm2Config=require('./config/pm2/config');var schedule=require(_0xfff1('0x5'));var chat=require('./config/schedule/chat');function main(){return mysqldb['db'][_0xfff1('0x6')][_0xfff1('0x7')]()['then'](function(){return rpc[_0xfff1('0x8')]();})['then'](function(_0x3e79d7){logger[_0xfff1('0x9')](_0x3e79d7);return chat[_0xfff1('0xa')]();})[_0xfff1('0xb')](function(){return schedule[_0xfff1('0xa')]();})[_0xfff1('0xb')](function(_0x119f37){logger[_0xfff1('0x9')](_0x119f37);return pm2[_0xfff1('0xa')](pm2Config);})['then'](function(_0x3b87e0){logger['info'](_0xfff1('0xc'),_[_0xfff1('0xd')](_[_0xfff1('0xe')](_0x3b87e0,{'status':_0xfff1('0xf')}),'name')[_0xfff1('0x10')]());logger[_0xfff1('0x9')]('Offline\x20apps:',_[_0xfff1('0xd')](_['filter'](_0x3b87e0,function(_0x351be7){return _0x351be7[_0xfff1('0x11')]!==_0xfff1('0xf');}),'name')[_0xfff1('0x10')]()||_0xfff1('0x12'));config[_0xfff1('0x13')]&&require(_0xfff1('0x14'))[_0xfff1('0x15')]();require(_0xfff1('0x16'))[_0xfff1('0x15')]();})[_0xfff1('0x17')](function(_0x1aa0a3){logger['error'](_0xfff1('0x18'),_0x1aa0a3);process[_0xfff1('0x19')](0x1);});}main(); \ No newline at end of file +var _0x569d=['./mysqldb','./rpc','./config/environment','./config/pm2','./config/pm2/config','./config/schedule','sync','then','start','info','Online\x20apps:','map','online','join','Offline\x20apps:','filter','status','seedDB','./config/seedDB','default','./config/license','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash'];(function(_0x56f7b9,_0x1ba86f){var _0x31995b=function(_0x149be7){while(--_0x149be7){_0x56f7b9['push'](_0x56f7b9['shift']());}};_0x31995b(++_0x1ba86f);}(_0x569d,0x12b));var _0xd569=function(_0x49d19d,_0x245cf5){_0x49d19d=_0x49d19d-0x0;var _0x4ebef1=_0x569d[_0x49d19d];return _0x4ebef1;};'use strict';var _=require(_0xd569('0x0'));var mysqldb=require(_0xd569('0x1'));var rpc=require(_0xd569('0x2'));var config=require(_0xd569('0x3'));var logger=require('./config/logger')('app');var pm2=require(_0xd569('0x4'));var pm2Config=require(_0xd569('0x5'));var schedule=require(_0xd569('0x6'));var chat=require('./config/schedule/chat');function main(){return mysqldb['db']['sequelize'][_0xd569('0x7')]()[_0xd569('0x8')](function(){return rpc['listen']();})['then'](function(_0x4d8525){logger['info'](_0x4d8525);return chat['start']();})['then'](function(){return schedule[_0xd569('0x9')]();})[_0xd569('0x8')](function(_0x5cb285){logger[_0xd569('0xa')](_0x5cb285);return pm2[_0xd569('0x9')](pm2Config);})[_0xd569('0x8')](function(_0x3f3462){logger['info'](_0xd569('0xb'),_[_0xd569('0xc')](_['filter'](_0x3f3462,{'status':_0xd569('0xd')}),'name')[_0xd569('0xe')]());logger[_0xd569('0xa')](_0xd569('0xf'),_[_0xd569('0xc')](_[_0xd569('0x10')](_0x3f3462,function(_0x20f178){return _0x20f178[_0xd569('0x11')]!==_0xd569('0xd');}),'name')[_0xd569('0xe')]()||'None');config[_0xd569('0x12')]&&require(_0xd569('0x13'))[_0xd569('0x14')]();require(_0xd569('0x15'))['default']();})[_0xd569('0x16')](function(_0x4c3594){logger['error'](_0xd569('0x17'),_0x4c3594);process[_0xd569('0x18')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 0b435c0..c7eaf07 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 _0x6c7a=['../../config/license/util','getLicense','update','canUpdate','sign','signToken','Required\x20role\x20needs\x20to\x20be\x20set','indexOf','role','userRoles','Forbidden','isMiddleware','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','motion.user','stringify','pick','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','randomBytes','toString','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','../../mysqldb','../../config/environment','lodash','jsonwebtoken','express-jwt','composable-middleware','crypto','ipaddr.js','session','fullname','internal','email','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','pauseType','showWebBar','phoneBarRemoteControlPort','interface','isChatInteractionAuthorized','user','findOne','params','disposition','then','json','unmanaged','Unmanaged.','Forbidden.','catch','use','authorization','headers','User','find','name','authenticate','pass','status','Wrong\x20credentials.','startsWith','Bearer','Unknown\x20authorization\x20format','query','apikey','verify','secrets','getUuid','sub','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','log','Unrecognized\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','isAuthenticated'];(function(_0x5173a2,_0x428a41){var _0x1cc12e=function(_0x2250a7){while(--_0x2250a7){_0x5173a2['push'](_0x5173a2['shift']());}};_0x1cc12e(++_0x428a41);}(_0x6c7a,0xc9));var _0xa6c7=function(_0x56bd4d,_0x1d65d4){_0x56bd4d=_0x56bd4d-0x0;var _0x4dbba3=_0x6c7a[_0x56bd4d];return _0x4dbba3;};'use strict';var db=require(_0xa6c7('0x0'))['db'];var config=require(_0xa6c7('0x1'));var hardwareConf=require('../../config/license/hardware');var _=require(_0xa6c7('0x2'));var jwt=require(_0xa6c7('0x3'));var expressJwt=require(_0xa6c7('0x4'));var compose=require(_0xa6c7('0x5'));var basicAuth=require('basic-auth');var crypto=require(_0xa6c7('0x6'));var ipaddr=require(_0xa6c7('0x7'));var validateJwt=expressJwt({'secret':config['secrets'][_0xa6c7('0x8')]});var userAttributes=['id','role',_0xa6c7('0x9'),'name',_0xa6c7('0xa'),_0xa6c7('0xb'),'userpic',_0xa6c7('0xc'),_0xa6c7('0xd'),_0xa6c7('0xe'),_0xa6c7('0xf'),_0xa6c7('0x10'),_0xa6c7('0x11'),'openchannelPause',_0xa6c7('0x12'),_0xa6c7('0x13'),_0xa6c7('0x14'),'phoneBarRemoteControl',_0xa6c7('0x15'),'userProfileId'];exports[_0xa6c7('0x16')]=function(){return isAuthenticated(!![])['use'](function(_0x2a4216,_0x324048,_0xebb5ac){if(_0x2a4216[_0xa6c7('0x17')]){_0xebb5ac();}else{return db['ChatInteraction'][_0xa6c7('0x18')]({'where':{'id':_0x2a4216[_0xa6c7('0x19')]['id']},'attributes':['id','closed',_0xa6c7('0x1a')],'raw':!![]})[_0xa6c7('0x1b')](function(_0x38ad91){if(_0x38ad91&&_0x38ad91['closed']){return _0x324048['status'](_0x38ad91[_0xa6c7('0x1a')]==='unmanaged'?0x195:0x193)[_0xa6c7('0x1c')]({'message':_0x38ad91[_0xa6c7('0x1a')]===_0xa6c7('0x1d')?_0xa6c7('0x1e'):_0xa6c7('0x1f')});}else{_0xebb5ac();}})[_0xa6c7('0x20')](function(_0x19a42b){_0xebb5ac(_0x19a42b);});}});};function isAuthenticated(_0x10c2bd){return compose()[_0xa6c7('0x21')](function(_0x147ea5,_0xd5793a,_0x22df90){if(_0x147ea5['headers'][_0xa6c7('0x22')]){if(_['startsWith'](_0x147ea5[_0xa6c7('0x23')][_0xa6c7('0x22')],'Basic')){var _0x2e24cf=basicAuth(_0x147ea5);db[_0xa6c7('0x24')][_0xa6c7('0x25')]({'where':{'name':_0x2e24cf[_0xa6c7('0x26')]}})[_0xa6c7('0x1b')](function(_0x4792a8){if(!_0x4792a8||!_0x4792a8[_0xa6c7('0x27')](_0x2e24cf[_0xa6c7('0x28')])){return _0xd5793a[_0xa6c7('0x29')](0x191)[_0xa6c7('0x1c')]({'message':_0xa6c7('0x2a')});}_0x147ea5[_0xa6c7('0x17')]={'id':_0x4792a8['id']};_0x22df90();})[_0xa6c7('0x20')](function(_0xa6c49e){_0x22df90(_0xa6c49e);});}else if(_[_0xa6c7('0x2b')](_0x147ea5[_0xa6c7('0x23')]['authorization'],_0xa6c7('0x2c'))){validateJwt(_0x147ea5,_0xd5793a,_0x22df90);}else{if(_0x10c2bd){_0x22df90();}else{return _0xd5793a[_0xa6c7('0x29')](0x193)['json']({'message':_0xa6c7('0x2d')});}}}else if(_0x147ea5[_0xa6c7('0x2e')][_0xa6c7('0x2f')]){try{var _0x317618=jwt[_0xa6c7('0x30')](_0x147ea5[_0xa6c7('0x2e')]['apikey'],config[_0xa6c7('0x31')][_0xa6c7('0x8')],{'audience':hardwareConf[_0xa6c7('0x32')](),'issuer':hardwareConf[_0xa6c7('0x32')]()});db[_0xa6c7('0x24')]['find']({'where':{'id':_0x317618[_0xa6c7('0x33')]}})[_0xa6c7('0x1b')](function(_0xd03ffd){if(!_0xd03ffd||!_['isEqual'](_0xd03ffd[_0xa6c7('0x34')],_0x317618[_0xa6c7('0x35')])){return _0xd5793a['status'](0x193)[_0xa6c7('0x1c')]({'message':_0xa6c7('0x36')});}_0x147ea5[_0xa6c7('0x17')]={'id':_0xd03ffd['id']};_0x22df90();})['catch'](function(_0x4732df){_0x22df90(_0x4732df);});}catch(_0x352764){console[_0xa6c7('0x37')](_0x352764);return _0xd5793a[_0xa6c7('0x29')](0x193)[_0xa6c7('0x1c')]({'message':_0xa6c7('0x38')});}}else if(_0x10c2bd){_0x22df90();}else{return _0xd5793a['status'](0x193)[_0xa6c7('0x1c')]({'message':'Unknown\x20authorization\x20format'});}})[_0xa6c7('0x21')](function(_0x342f09,_0x4994b1,_0xa028b1){if(_0x342f09[_0xa6c7('0x17')]){db[_0xa6c7('0x24')]['find']({'where':{'id':_0x342f09[_0xa6c7('0x17')]['id']},'attributes':userAttributes})[_0xa6c7('0x1b')](function(_0x1e7fd9){if(!_0x1e7fd9){return _0x4994b1[_0xa6c7('0x29')](0x194)[_0xa6c7('0x1c')]({'message':_0xa6c7('0x39')});}_0x342f09[_0xa6c7('0x17')]=_0x1e7fd9;_0xa028b1();})[_0xa6c7('0x20')](function(_0x3989cc){_0xa028b1(_0x3989cc);});}else if(_0x10c2bd){_0xa028b1();}else{return _0x4994b1['status'](0x194)['json']({'message':_0xa6c7('0x3a')});}});}exports[_0xa6c7('0x3b')]=isAuthenticated;function canUpdate(){return compose()[_0xa6c7('0x21')](function(_0x1ef575,_0x4770b3,_0x13f61c){return require(_0xa6c7('0x3c'))[_0xa6c7('0x3d')]()[_0xa6c7('0x1b')](function(_0xe253a6){if(_0xe253a6[_0xa6c7('0x3e')]){_0x13f61c();}else{return _0x4770b3['status'](0x193)[_0xa6c7('0x1c')]({'message':'Forbidden'});}})[_0xa6c7('0x20')](function(_0x4de7ad){_0x13f61c(_0x4de7ad);});});}exports[_0xa6c7('0x3f')]=canUpdate;function signToken(_0x23d1b4,_0x53126f){return jwt[_0xa6c7('0x40')]({'id':_0x23d1b4,'role':_0x53126f},config[_0xa6c7('0x31')][_0xa6c7('0x8')],{'expiresIn':0x15180});}exports[_0xa6c7('0x41')]=signToken;exports['hasRole']=function(_0x1d268d){if(!_0x1d268d){throw new Error(_0xa6c7('0x42'));}return compose()[_0xa6c7('0x21')](isAuthenticated())['use'](function meetsRequirements(_0x2debcb,_0x2d840e,_0x1e73b0){if(config['userRoles'][_0xa6c7('0x43')](_0x2debcb[_0xa6c7('0x17')][_0xa6c7('0x44')])>=config[_0xa6c7('0x45')][_0xa6c7('0x43')](_0x1d268d)){return _0x1e73b0();}else{return _0x2d840e[_0xa6c7('0x29')](0x193)[_0xa6c7('0x1c')]({'message':_0xa6c7('0x46')});}});};exports['isMiddleware']=function(_0x599a71,_0x5edcfd,_0x592763){_0x599a71[_0xa6c7('0x47')]=!![];return _0x592763();};exports['setTokenCookie']=function(_0x59d66b,_0x3069c1){if(!_0x59d66b[_0xa6c7('0x17')]){return _0x3069c1['status'](0x194)[_0xa6c7('0x1c')]({'message':_0xa6c7('0x48')});}var _0x351ceb=signToken(_0x59d66b['user']['id'],_0x59d66b['user'][_0xa6c7('0x44')]);_0x3069c1[_0xa6c7('0x49')](_0xa6c7('0x4a'),_0x351ceb);_0x3069c1[_0xa6c7('0x49')](_0xa6c7('0x4b'),JSON[_0xa6c7('0x4c')](_[_0xa6c7('0x4d')](_0x59d66b[_0xa6c7('0x17')],userAttributes)));_0x3069c1['redirect'](_0xa6c7('0x4e'));};exports[_0xa6c7('0x4f')]=function(_0x593169){if(_['isNil'](_0x593169[_0xa6c7('0x34')])||_[_0xa6c7('0x50')](_0x593169[_0xa6c7('0x51')]))return null;else return createJwt(_0x593169);};exports[_0xa6c7('0x52')]=function(_0x13106a){_0x13106a[_0xa6c7('0x34')]=crypto[_0xa6c7('0x53')](0x10)[_0xa6c7('0x54')]('hex');_0x13106a[_0xa6c7('0x51')]=Math['floor'](Date['now']()/0x3e8)[_0xa6c7('0x54')]();return createJwt(_0x13106a);};exports[_0xa6c7('0x55')]=function(_0x2fbba4,_0x46497b){if(_0x2fbba4[_0xa6c7('0x2e')]['apikey']){jwt['verify'](_0x2fbba4[_0xa6c7('0x2e')][_0xa6c7('0x2f')],config[_0xa6c7('0x31')]['session'],{'nonce':_0x46497b['apiKeyNonce'],'iat':_0x46497b[_0xa6c7('0x51')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()});return generateApiKey(_0x46497b);}else{throw{'message':_0xa6c7('0x56')};}};function createJwt(_0x3009d9){return jwt[_0xa6c7('0x40')]({'iat':_0x3009d9[_0xa6c7('0x51')],'nonce':_0x3009d9[_0xa6c7('0x34')]},config[_0xa6c7('0x31')][_0xa6c7('0x8')],{'algorithm':'HS512','subject':_0x3009d9['id']['toString'](),'issuer':hardwareConf[_0xa6c7('0x32')](),'audience':hardwareConf['getUuid']()});} \ No newline at end of file +var _0x0c7d=['isAuthenticated','../../config/license/util','getLicense','update','Forbidden','sign','signToken','hasRole','Required\x20role\x20needs\x20to\x20be\x20set','userRoles','indexOf','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','stringify','pick','redirect','retrieveApiKey','isNil','apiKeyIat','generateApiKey','randomBytes','toString','floor','now','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','HS512','../../mysqldb','../../config/environment','lodash','jsonwebtoken','express-jwt','ipaddr.js','session','role','fullname','internal','email','userpic','voicePause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','phoneBarRemoteControlPort','interface','userProfileId','use','findOne','closed','disposition','then','status','json','unmanaged','Forbidden.','headers','authorization','startsWith','Basic','User','find','authenticate','Bearer','Unknown\x20authorization\x20format','query','apikey','verify','secrets','getUuid','sub','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','user','catch','log','User\x20not\x20found.','User\x20object\x20not\x20found.'];(function(_0x46bb55,_0x2cb49f){var _0x101ffc=function(_0x22f0b8){while(--_0x22f0b8){_0x46bb55['push'](_0x46bb55['shift']());}};_0x101ffc(++_0x2cb49f);}(_0x0c7d,0x71));var _0xd0c7=function(_0x55d76f,_0x3ec4e8){_0x55d76f=_0x55d76f-0x0;var _0x27f726=_0x0c7d[_0x55d76f];return _0x27f726;};'use strict';var db=require(_0xd0c7('0x0'))['db'];var config=require(_0xd0c7('0x1'));var hardwareConf=require('../../config/license/hardware');var _=require(_0xd0c7('0x2'));var jwt=require(_0xd0c7('0x3'));var expressJwt=require(_0xd0c7('0x4'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require('crypto');var ipaddr=require(_0xd0c7('0x5'));var validateJwt=expressJwt({'secret':config['secrets'][_0xd0c7('0x6')]});var userAttributes=['id',_0xd0c7('0x7'),_0xd0c7('0x8'),'name',_0xd0c7('0x9'),_0xd0c7('0xa'),_0xd0c7('0xb'),'permissions',_0xd0c7('0xc'),'chatPause','mailPause',_0xd0c7('0xd'),_0xd0c7('0xe'),_0xd0c7('0xf'),_0xd0c7('0x10'),_0xd0c7('0x11'),_0xd0c7('0x12'),'phoneBarRemoteControl',_0xd0c7('0x13'),_0xd0c7('0x14')];exports['isChatInteractionAuthorized']=function(){return isAuthenticated(!![])[_0xd0c7('0x15')](function(_0x2ef1b2,_0xb7bb08,_0x57b9b1){if(_0x2ef1b2['user']){_0x57b9b1();}else{return db['ChatInteraction'][_0xd0c7('0x16')]({'where':{'id':_0x2ef1b2['params']['id']},'attributes':['id',_0xd0c7('0x17'),_0xd0c7('0x18')],'raw':!![]})[_0xd0c7('0x19')](function(_0x110763){if(_0x110763&&_0x110763[_0xd0c7('0x17')]){return _0xb7bb08[_0xd0c7('0x1a')](_0x110763[_0xd0c7('0x18')]==='unmanaged'?0x195:0x193)[_0xd0c7('0x1b')]({'message':_0x110763[_0xd0c7('0x18')]===_0xd0c7('0x1c')?'Unmanaged.':_0xd0c7('0x1d')});}else{_0x57b9b1();}})['catch'](function(_0x204e7f){_0x57b9b1(_0x204e7f);});}});};function isAuthenticated(_0x513d48){return compose()[_0xd0c7('0x15')](function(_0x1702db,_0x76d931,_0x4cf5df){if(_0x1702db[_0xd0c7('0x1e')][_0xd0c7('0x1f')]){if(_[_0xd0c7('0x20')](_0x1702db[_0xd0c7('0x1e')][_0xd0c7('0x1f')],_0xd0c7('0x21'))){var _0x415631=basicAuth(_0x1702db);db[_0xd0c7('0x22')][_0xd0c7('0x23')]({'where':{'name':_0x415631['name']}})[_0xd0c7('0x19')](function(_0x12e030){if(!_0x12e030||!_0x12e030[_0xd0c7('0x24')](_0x415631['pass'])){return _0x76d931[_0xd0c7('0x1a')](0x191)[_0xd0c7('0x1b')]({'message':'Wrong\x20credentials.'});}_0x1702db['user']={'id':_0x12e030['id']};_0x4cf5df();})['catch'](function(_0x58f2a2){_0x4cf5df(_0x58f2a2);});}else if(_[_0xd0c7('0x20')](_0x1702db['headers'][_0xd0c7('0x1f')],_0xd0c7('0x25'))){validateJwt(_0x1702db,_0x76d931,_0x4cf5df);}else{if(_0x513d48){_0x4cf5df();}else{return _0x76d931[_0xd0c7('0x1a')](0x193)['json']({'message':_0xd0c7('0x26')});}}}else if(_0x1702db[_0xd0c7('0x27')][_0xd0c7('0x28')]){try{var _0x5dde04=jwt[_0xd0c7('0x29')](_0x1702db[_0xd0c7('0x27')][_0xd0c7('0x28')],config[_0xd0c7('0x2a')][_0xd0c7('0x6')],{'audience':hardwareConf[_0xd0c7('0x2b')](),'issuer':hardwareConf[_0xd0c7('0x2b')]()});db['User'][_0xd0c7('0x23')]({'where':{'id':_0x5dde04[_0xd0c7('0x2c')]}})[_0xd0c7('0x19')](function(_0x3ad476){if(!_0x3ad476||!_[_0xd0c7('0x2d')](_0x3ad476[_0xd0c7('0x2e')],_0x5dde04['nonce'])){return _0x76d931['status'](0x193)[_0xd0c7('0x1b')]({'message':_0xd0c7('0x2f')});}_0x1702db[_0xd0c7('0x30')]={'id':_0x3ad476['id']};_0x4cf5df();})[_0xd0c7('0x31')](function(_0x1b9dbd){_0x4cf5df(_0x1b9dbd);});}catch(_0x447008){console[_0xd0c7('0x32')](_0x447008);return _0x76d931[_0xd0c7('0x1a')](0x193)[_0xd0c7('0x1b')]({'message':'Unrecognized\x20API\x20access\x20key'});}}else if(_0x513d48){_0x4cf5df();}else{return _0x76d931['status'](0x193)[_0xd0c7('0x1b')]({'message':_0xd0c7('0x26')});}})['use'](function(_0x435b7d,_0x1e29fb,_0x4a4d25){if(_0x435b7d['user']){db['User'][_0xd0c7('0x23')]({'where':{'id':_0x435b7d['user']['id']},'attributes':userAttributes})['then'](function(_0x4f680b){if(!_0x4f680b){return _0x1e29fb[_0xd0c7('0x1a')](0x194)['json']({'message':_0xd0c7('0x33')});}_0x435b7d[_0xd0c7('0x30')]=_0x4f680b;_0x4a4d25();})[_0xd0c7('0x31')](function(_0x2c1e41){_0x4a4d25(_0x2c1e41);});}else if(_0x513d48){_0x4a4d25();}else{return _0x1e29fb[_0xd0c7('0x1a')](0x194)[_0xd0c7('0x1b')]({'message':_0xd0c7('0x34')});}});}exports[_0xd0c7('0x35')]=isAuthenticated;function canUpdate(){return compose()['use'](function(_0xf44b46,_0x2bff2d,_0x576b09){return require(_0xd0c7('0x36'))[_0xd0c7('0x37')]()[_0xd0c7('0x19')](function(_0x5b0f4d){if(_0x5b0f4d[_0xd0c7('0x38')]){_0x576b09();}else{return _0x2bff2d[_0xd0c7('0x1a')](0x193)['json']({'message':_0xd0c7('0x39')});}})['catch'](function(_0x59c7ce){_0x576b09(_0x59c7ce);});});}exports['canUpdate']=canUpdate;function signToken(_0x38131f,_0xf2e174){return jwt[_0xd0c7('0x3a')]({'id':_0x38131f,'role':_0xf2e174},config['secrets']['session'],{'expiresIn':0x15180});}exports[_0xd0c7('0x3b')]=signToken;exports[_0xd0c7('0x3c')]=function(_0x2b5ad9){if(!_0x2b5ad9){throw new Error(_0xd0c7('0x3d'));}return compose()['use'](isAuthenticated())[_0xd0c7('0x15')](function meetsRequirements(_0x1704b2,_0x4cc9d9,_0x4da57c){if(config[_0xd0c7('0x3e')][_0xd0c7('0x3f')](_0x1704b2[_0xd0c7('0x30')][_0xd0c7('0x7')])>=config[_0xd0c7('0x3e')][_0xd0c7('0x3f')](_0x2b5ad9)){return _0x4da57c();}else{return _0x4cc9d9[_0xd0c7('0x1a')](0x193)[_0xd0c7('0x1b')]({'message':_0xd0c7('0x39')});}});};exports[_0xd0c7('0x40')]=function(_0x32ae24,_0x2f7927,_0x137724){_0x32ae24[_0xd0c7('0x40')]=!![];return _0x137724();};exports[_0xd0c7('0x41')]=function(_0x27deb9,_0x210736){if(!_0x27deb9[_0xd0c7('0x30')]){return _0x210736['status'](0x194)[_0xd0c7('0x1b')]({'message':_0xd0c7('0x42')});}var _0x15889c=signToken(_0x27deb9[_0xd0c7('0x30')]['id'],_0x27deb9[_0xd0c7('0x30')][_0xd0c7('0x7')]);_0x210736[_0xd0c7('0x43')](_0xd0c7('0x44'),_0x15889c);_0x210736['cookie']('motion.user',JSON[_0xd0c7('0x45')](_[_0xd0c7('0x46')](_0x27deb9[_0xd0c7('0x30')],userAttributes)));_0x210736[_0xd0c7('0x47')]('/dashboards/general');};exports[_0xd0c7('0x48')]=function(_0xa910af){if(_[_0xd0c7('0x49')](_0xa910af[_0xd0c7('0x2e')])||_[_0xd0c7('0x49')](_0xa910af[_0xd0c7('0x4a')]))return null;else return createJwt(_0xa910af);};exports[_0xd0c7('0x4b')]=function(_0xe48976){_0xe48976[_0xd0c7('0x2e')]=crypto[_0xd0c7('0x4c')](0x10)[_0xd0c7('0x4d')]('hex');_0xe48976[_0xd0c7('0x4a')]=Math[_0xd0c7('0x4e')](Date[_0xd0c7('0x4f')]()/0x3e8)['toString']();return createJwt(_0xe48976);};exports[_0xd0c7('0x50')]=function(_0x287219,_0x32204b){if(_0x287219[_0xd0c7('0x27')][_0xd0c7('0x28')]){jwt[_0xd0c7('0x29')](_0x287219[_0xd0c7('0x27')][_0xd0c7('0x28')],config[_0xd0c7('0x2a')][_0xd0c7('0x6')],{'nonce':_0x32204b['apiKeyNonce'],'iat':_0x32204b[_0xd0c7('0x4a')],'audience':hardwareConf[_0xd0c7('0x2b')](),'issuer':hardwareConf[_0xd0c7('0x2b')]()});return generateApiKey(_0x32204b);}else{throw{'message':_0xd0c7('0x51')};}};function createJwt(_0x5d4a7c){return jwt[_0xd0c7('0x3a')]({'iat':_0x5d4a7c[_0xd0c7('0x4a')],'nonce':_0x5d4a7c[_0xd0c7('0x2e')]},config[_0xd0c7('0x2a')][_0xd0c7('0x6')],{'algorithm':_0xd0c7('0x52'),'subject':_0x5d4a7c['id'][_0xd0c7('0x4d')](),'issuer':hardwareConf[_0xd0c7('0x2b')](),'audience':hardwareConf[_0xd0c7('0x2b')]()});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index e659d50..2950227 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 _0xf69f=['createCipher','algorithm','update','write','end','final','binary','close','decryptFile','createDecipher','data','unlink','crypto','bluebird','aes192','hasOwnProperty','createReadStream','createWriteStream'];(function(_0x2b1acd,_0x4f772f){var _0x393d25=function(_0x979f03){while(--_0x979f03){_0x2b1acd['push'](_0x2b1acd['shift']());}};_0x393d25(++_0x4f772f);}(_0xf69f,0x1aa));var _0xff69=function(_0x29e1c8,_0x5eb49c){_0x29e1c8=_0x29e1c8-0x0;var _0x1a0a3f=_0xf69f[_0x29e1c8];return _0x1a0a3f;};'use strict';var crypto=require(_0xff69('0x0'));var fs=require('fs');var BPromise=require(_0xff69('0x1'));var defaultOptions={'algorithm':_0xff69('0x2')};function combineOptions(_0x3ee190){var _0x2b4ba3={};for(var _0x2ebfdd in defaultOptions){if(defaultOptions[_0xff69('0x3')](_0x2ebfdd)){_0x2b4ba3[_0x2ebfdd]=defaultOptions[_0x2ebfdd];}}if(_0x3ee190){for(var _0x566a1d in _0x3ee190){if(_0x3ee190['hasOwnProperty'](_0x566a1d)){_0x2b4ba3[_0x566a1d]=_0x3ee190[_0x566a1d];}}}return _0x2b4ba3;}exports['encryptFile']=function(_0x39b84c,_0x3afbc9,_0x2cd704,_0x4bf389){return new BPromise(function(_0x460fec,_0x7d948e){_0x4bf389=combineOptions(_0x4bf389);var _0xd8c486=new Buffer(_0x2cd704);var _0x303f9a=fs[_0xff69('0x4')](_0x39b84c);var _0x551d68=fs[_0xff69('0x5')](_0x3afbc9);var _0x272588=crypto[_0xff69('0x6')](_0x4bf389[_0xff69('0x7')],_0xd8c486);_0x303f9a['on']('data',function(_0xbe0ca0){var _0x4e45ac=new Buffer(_0x272588[_0xff69('0x8')](_0xbe0ca0),'binary');_0x551d68[_0xff69('0x9')](_0x4e45ac);});_0x303f9a['on'](_0xff69('0xa'),function(){try{var _0x57e5ac=new Buffer(_0x272588[_0xff69('0xb')](_0xff69('0xc')),'binary');_0x551d68[_0xff69('0x9')](_0x57e5ac);_0x551d68[_0xff69('0xa')]();_0x551d68['on'](_0xff69('0xd'),function(){return _0x460fec(_0x3afbc9);});}catch(_0xf8bddc){fs['unlink'](_0x3afbc9);return _0x7d948e(_0xf8bddc);}});});};exports[_0xff69('0xe')]=function(_0x2b34aa,_0x3ab6dc,_0x55839e,_0x43e4ba){return new BPromise(function(_0x29b4fd,_0x354777){_0x43e4ba=combineOptions(_0x43e4ba);var _0x2dd61d=new Buffer(_0x55839e);var _0x312e08=fs[_0xff69('0x4')](_0x2b34aa);var _0x244ad8=fs[_0xff69('0x5')](_0x3ab6dc);var _0x27114a=crypto[_0xff69('0xf')](_0x43e4ba[_0xff69('0x7')],_0x2dd61d);_0x312e08['on'](_0xff69('0x10'),function(_0x134393){var _0x328045=new Buffer(_0x27114a['update'](_0x134393),_0xff69('0xc'));_0x244ad8['write'](_0x328045);});_0x312e08['on'](_0xff69('0xa'),function(){try{var _0x14e10c=new Buffer(_0x27114a['final'](_0xff69('0xc')),_0xff69('0xc'));_0x244ad8[_0xff69('0x9')](_0x14e10c);_0x244ad8[_0xff69('0xa')]();_0x244ad8['on'](_0xff69('0xd'),function(){return _0x29b4fd(_0x3ab6dc);});}catch(_0x4c382c){fs[_0xff69('0x11')](_0x3ab6dc);return _0x354777(_0x4c382c);}});});}; \ No newline at end of file +var _0xe1e0=['encryptFile','algorithm','data','update','binary','write','end','final','close','unlink','decryptFile','createWriteStream','createDecipher','crypto','bluebird','aes192','hasOwnProperty'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe1e0,0x150));var _0x0e1e=function(_0xf81567,_0x142e5b){_0xf81567=_0xf81567-0x0;var _0x4c6cb5=_0xe1e0[_0xf81567];return _0x4c6cb5;};'use strict';var crypto=require(_0x0e1e('0x0'));var fs=require('fs');var BPromise=require(_0x0e1e('0x1'));var defaultOptions={'algorithm':_0x0e1e('0x2')};function combineOptions(_0x23259b){var _0x19fe4c={};for(var _0x298c2c in defaultOptions){if(defaultOptions[_0x0e1e('0x3')](_0x298c2c)){_0x19fe4c[_0x298c2c]=defaultOptions[_0x298c2c];}}if(_0x23259b){for(var _0x55cf89 in _0x23259b){if(_0x23259b[_0x0e1e('0x3')](_0x55cf89)){_0x19fe4c[_0x55cf89]=_0x23259b[_0x55cf89];}}}return _0x19fe4c;}exports[_0x0e1e('0x4')]=function(_0x20aee8,_0x3c32cc,_0x1694c2,_0x3695d1){return new BPromise(function(_0x5cff76,_0x2fd206){_0x3695d1=combineOptions(_0x3695d1);var _0x1344bd=new Buffer(_0x1694c2);var _0x20c590=fs['createReadStream'](_0x20aee8);var _0x95a102=fs['createWriteStream'](_0x3c32cc);var _0x4fc478=crypto['createCipher'](_0x3695d1[_0x0e1e('0x5')],_0x1344bd);_0x20c590['on'](_0x0e1e('0x6'),function(_0x257393){var _0x2ce9d3=new Buffer(_0x4fc478[_0x0e1e('0x7')](_0x257393),_0x0e1e('0x8'));_0x95a102[_0x0e1e('0x9')](_0x2ce9d3);});_0x20c590['on'](_0x0e1e('0xa'),function(){try{var _0x21891a=new Buffer(_0x4fc478[_0x0e1e('0xb')]('binary'),_0x0e1e('0x8'));_0x95a102['write'](_0x21891a);_0x95a102['end']();_0x95a102['on'](_0x0e1e('0xc'),function(){return _0x5cff76(_0x3c32cc);});}catch(_0x222739){fs[_0x0e1e('0xd')](_0x3c32cc);return _0x2fd206(_0x222739);}});});};exports[_0x0e1e('0xe')]=function(_0x5e288d,_0x5828df,_0x546103,_0x24d573){return new BPromise(function(_0x1c798e,_0x34e9a7){_0x24d573=combineOptions(_0x24d573);var _0x154d78=new Buffer(_0x546103);var _0x42aba5=fs['createReadStream'](_0x5e288d);var _0x1ea84b=fs[_0x0e1e('0xf')](_0x5828df);var _0x31decc=crypto[_0x0e1e('0x10')](_0x24d573['algorithm'],_0x154d78);_0x42aba5['on'](_0x0e1e('0x6'),function(_0x4fe5c7){var _0x22f81b=new Buffer(_0x31decc[_0x0e1e('0x7')](_0x4fe5c7),'binary');_0x1ea84b[_0x0e1e('0x9')](_0x22f81b);});_0x42aba5['on'](_0x0e1e('0xa'),function(){try{var _0x22fc8d=new Buffer(_0x31decc[_0x0e1e('0xb')]('binary'),_0x0e1e('0x8'));_0x1ea84b[_0x0e1e('0x9')](_0x22fc8d);_0x1ea84b[_0x0e1e('0xa')]();_0x1ea84b['on'](_0x0e1e('0xc'),function(){return _0x1c798e(_0x5828df);});}catch(_0x2f0bd3){fs[_0x0e1e('0xd')](_0x5828df);return _0x34e9a7(_0x2f0bd3);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index c50e373..df1a5a1 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 _0x425b=['../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','length','split','push','basename','join','each','%s%d.%s','csv','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','%s.%s','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x425b,0xa3));var _0xb425=function(_0x276c40,_0x4463cc){_0x276c40=_0x276c40-0x0;var _0x54d2ec=_0x425b[_0x276c40];return _0x54d2ec;};'use strict';var util=require(_0xb425('0x0'));var path=require(_0xb425('0x1'));var _=require(_0xb425('0x2'));var csv=require(_0xb425('0x3'));var fs=require('fs');var BPromise=require(_0xb425('0x4'));var zipdir=require(_0xb425('0x5'));var rimraf=require(_0xb425('0x6'));var db=require(_0xb425('0x7'))['db'];var dbH=require(_0xb425('0x7'))[_0xb425('0x8')];var logger=require(_0xb425('0x9'))(_0xb425('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xb425('0xb')][0x2]);var QUERY=process[_0xb425('0xb')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x3ab358,_0x365001){var _0x535fc7={'status':_0x3ab358};var _0x59a26d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x365001){_0x535fc7['savename']=_0x365001;}return db[_0xb425('0xc')][_0xb425('0xd')](_0x535fc7,_0x59a26d);}function main(){var _0x66ce92=0x1388;var _0x21d0db;logger[_0xb425('0xe')](util[_0xb425('0xf')](_0xb425('0x10'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xb425('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xb425('0x12')]})[_0xb425('0x13')](function(_0x616b90){if(_0x616b90){_0x21d0db=_0x616b90;_0x66ce92=_0x21d0db[_0xb425('0x12')]||0x1388;}})[_0xb425('0x13')](function(){return dbH['sequelize'][_0xb425('0x14')](util[_0xb425('0xf')](_0xb425('0x15'),QUERY),{'type':dbH[_0xb425('0x16')][_0xb425('0x17')][_0xb425('0x18')]});})[_0xb425('0x13')](function(_0x34a6fe){if(!_0x34a6fe[0x0][_0xb425('0x19')]){return analyticExtractedReport(_0xb425('0x1a'));}var _0xbcb82f=[];var _0x53ebe0=0x0;var _0x33ed73=!![];if(_0x34a6fe&&_0x34a6fe[_0xb425('0x1b')]){var _0x58e2b1=_0x34a6fe[0x0]['num']%(_0x53ebe0+_0x66ce92);if(_0x21d0db[_0xb425('0x1c')]){for(;_0x33ed73;_0x53ebe0+=_0x66ce92,_0x58e2b1=_0x34a6fe[0x0][_0xb425('0x19')]%(_0x53ebe0+_0x66ce92)){if(_0x58e2b1==0x0||_0x58e2b1==_0x34a6fe[0x0][_0xb425('0x19')]){_0x33ed73=![];}_0xbcb82f[_0xb425('0x1d')](dbH[_0xb425('0x16')][_0xb425('0x14')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x66ce92,_0x53ebe0),{'type':dbH[_0xb425('0x16')][_0xb425('0x17')]['SELECT']}));}}else{_0xbcb82f[_0xb425('0x1d')](dbH[_0xb425('0x16')]['query'](QUERY,{'type':dbH[_0xb425('0x16')][_0xb425('0x17')][_0xb425('0x18')]}));}}var _0x548ad6=path['dirname'](PATH);var _0x14b023=path[_0xb425('0x1e')](PATH,'.csv');var _0x3dab11=_0x21d0db['split']&&_0xbcb82f[_0xb425('0x1b')]>0x1;var _0x51e979=[];if(!fs['existsSync'](path[_0xb425('0x1f')](_0x548ad6,_0x14b023))&&_0x3dab11){fs['mkdirSync'](path[_0xb425('0x1f')](_0x548ad6,_0x14b023));}return BPromise[_0xb425('0x20')](_0xbcb82f,function(_0xf81ca1){_0x51e979[_0xb425('0x1d')](_0xf81ca1);})[_0xb425('0x13')](function(){for(var _0x171b41=0x0;_0x171b41<_0x51e979[_0xb425('0x1b')];_0x171b41+=0x1){var _0x1fc13e;var _0x3a01fc=_0x51e979[_0x171b41];if(_0x3dab11){_0x1fc13e=path[_0xb425('0x1f')](_0x548ad6,_0x14b023,util[_0xb425('0xf')](_0xb425('0x21'),_0x14b023,_0x171b41,'csv'));}else{_0x1fc13e=path[_0xb425('0x1f')](_0x548ad6,util[_0xb425('0xf')]('%s.%s',_0x14b023,_0xb425('0x22')));}fs['writeFileSync'](_0x1fc13e,csv(_0x3a01fc));}})[_0xb425('0x13')](function(){if(_0x3dab11){zipdir(path['join'](_0x548ad6,_0x14b023),{'saveTo':path[_0xb425('0x1f')](_0x548ad6,util['format']('%s.%s',_0x14b023,_0xb425('0x23')))},function(_0x2e46f8,_0x538ae5){});rimraf(path['join'](_0x548ad6,_0x14b023),function(){});}})[_0xb425('0x13')](function(){logger[_0xb425('0xe')](util['format'](_0xb425('0x24'),EXTRACTED_REPORT_ID,_0xb425('0x25')));return analyticExtractedReport('Completed',_0x3dab11?util['format'](_0xb425('0x26'),_0x14b023,_0x3dab11?_0xb425('0x23'):_0xb425('0x22')):null);});})[_0xb425('0x27')](function(_0x31e652){logger[_0xb425('0xe')](util['format'](_0xb425('0x28'),EXTRACTED_REPORT_ID,_0xb425('0x25')),util[_0xb425('0x29')](_0x31e652,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xb425('0x2a'));});}main(); \ No newline at end of file +var _0x77ea=['bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','length','num','split','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','.csv','existsSync','join','mkdirSync','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','util','path','to-csv'];(function(_0x58e9c7,_0x378dfa){var _0x1d3ff4=function(_0xfca779){while(--_0xfca779){_0x58e9c7['push'](_0x58e9c7['shift']());}};_0x1d3ff4(++_0x378dfa);}(_0x77ea,0xff));var _0xa77e=function(_0x3aab86,_0x36ab92){_0x3aab86=_0x3aab86-0x0;var _0x2480fb=_0x77ea[_0x3aab86];return _0x2480fb;};'use strict';var util=require(_0xa77e('0x0'));var path=require(_0xa77e('0x1'));var _=require('lodash');var csv=require(_0xa77e('0x2'));var fs=require('fs');var BPromise=require(_0xa77e('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xa77e('0x4'));var db=require(_0xa77e('0x5'))['db'];var dbH=require(_0xa77e('0x5'))[_0xa77e('0x6')];var logger=require(_0xa77e('0x7'))(_0xa77e('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xa77e('0x9')][0x2]);var QUERY=process[_0xa77e('0x9')][0x3];var PATH=process[_0xa77e('0x9')][0x4];function analyticExtractedReport(_0x58a19c,_0x353462){var _0x1b0853={'status':_0x58a19c};var _0x43f375={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x353462){_0x1b0853[_0xa77e('0xa')]=_0x353462;}return db[_0xa77e('0xb')][_0xa77e('0xc')](_0x1b0853,_0x43f375);}function main(){var _0x3677be=0x1388;var _0x3f8f53;logger[_0xa77e('0xd')](util[_0xa77e('0xe')](_0xa77e('0xf'),EXTRACTED_REPORT_ID,_0xa77e('0x10')));return db[_0xa77e('0x11')][_0xa77e('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xa77e('0x13')]})[_0xa77e('0x14')](function(_0x17f2c5){if(_0x17f2c5){_0x3f8f53=_0x17f2c5;_0x3677be=_0x3f8f53[_0xa77e('0x13')]||0x1388;}})['then'](function(){return dbH[_0xa77e('0x15')]['query'](util[_0xa77e('0xe')](_0xa77e('0x16'),QUERY),{'type':dbH[_0xa77e('0x15')][_0xa77e('0x17')][_0xa77e('0x18')]});})[_0xa77e('0x14')](function(_0xfb80bd){if(!_0xfb80bd[0x0]['num']){return analyticExtractedReport('Empty');}var _0x324f23=[];var _0x31c68b=0x0;var _0x114db9=!![];if(_0xfb80bd&&_0xfb80bd[_0xa77e('0x19')]){var _0x20391c=_0xfb80bd[0x0][_0xa77e('0x1a')]%(_0x31c68b+_0x3677be);if(_0x3f8f53[_0xa77e('0x1b')]){for(;_0x114db9;_0x31c68b+=_0x3677be,_0x20391c=_0xfb80bd[0x0][_0xa77e('0x1a')]%(_0x31c68b+_0x3677be)){if(_0x20391c==0x0||_0x20391c==_0xfb80bd[0x0][_0xa77e('0x1a')]){_0x114db9=![];}_0x324f23[_0xa77e('0x1c')](dbH[_0xa77e('0x15')][_0xa77e('0x1d')](util[_0xa77e('0xe')](_0xa77e('0x1e'),QUERY,_0x3677be,_0x31c68b),{'type':dbH['sequelize']['QueryTypes'][_0xa77e('0x18')]}));}}else{_0x324f23[_0xa77e('0x1c')](dbH[_0xa77e('0x15')][_0xa77e('0x1d')](QUERY,{'type':dbH[_0xa77e('0x15')][_0xa77e('0x17')][_0xa77e('0x18')]}));}}var _0x5cd430=path['dirname'](PATH);var _0x27d951=path['basename'](PATH,_0xa77e('0x1f'));var _0x4c5fb1=_0x3f8f53[_0xa77e('0x1b')]&&_0x324f23[_0xa77e('0x19')]>0x1;var _0x1725ed=[];if(!fs[_0xa77e('0x20')](path[_0xa77e('0x21')](_0x5cd430,_0x27d951))&&_0x4c5fb1){fs[_0xa77e('0x22')](path[_0xa77e('0x21')](_0x5cd430,_0x27d951));}return BPromise['each'](_0x324f23,function(_0x5c5da1){_0x1725ed[_0xa77e('0x1c')](_0x5c5da1);})[_0xa77e('0x14')](function(){for(var _0x5c8716=0x0;_0x5c8716<_0x1725ed[_0xa77e('0x19')];_0x5c8716+=0x1){var _0x5b3a04;var _0xcae6e1=_0x1725ed[_0x5c8716];if(_0x4c5fb1){_0x5b3a04=path[_0xa77e('0x21')](_0x5cd430,_0x27d951,util[_0xa77e('0xe')](_0xa77e('0x23'),_0x27d951,_0x5c8716,_0xa77e('0x24')));}else{_0x5b3a04=path[_0xa77e('0x21')](_0x5cd430,util[_0xa77e('0xe')](_0xa77e('0x25'),_0x27d951,_0xa77e('0x24')));}fs[_0xa77e('0x26')](_0x5b3a04,csv(_0xcae6e1));}})['then'](function(){if(_0x4c5fb1){zipdir(path[_0xa77e('0x21')](_0x5cd430,_0x27d951),{'saveTo':path[_0xa77e('0x21')](_0x5cd430,util['format'](_0xa77e('0x25'),_0x27d951,_0xa77e('0x27')))},function(_0x16424c,_0x8965c5){});rimraf(path['join'](_0x5cd430,_0x27d951),function(){});}})['then'](function(){logger[_0xa77e('0xd')](util[_0xa77e('0xe')](_0xa77e('0x28'),EXTRACTED_REPORT_ID,_0xa77e('0x10')));return analyticExtractedReport(_0xa77e('0x29'),_0x4c5fb1?util[_0xa77e('0xe')](_0xa77e('0x25'),_0x27d951,_0x4c5fb1?_0xa77e('0x27'):'csv'):null);});})[_0xa77e('0x2a')](function(_0x47fe4c){logger[_0xa77e('0xd')](util[_0xa77e('0xe')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xa77e('0x10')),util['inspect'](_0x47fe4c,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 0deb77d..96ae841 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 _0x5664=['body','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','createWriteStream','finish','error','log','err','end','%s.%s','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','pdf','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','inspect','Failed','lodash','bluebird','util','path','pdfmake/src/printer','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','hasOwnProperty','push','tableHeader','num','Empty','dirname','.pdf','Setting','find','splitSizePdf','then','length','sequelize','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','header','black'];(function(_0x152136,_0x4f14f1){var _0x20df44=function(_0x362877){while(--_0x362877){_0x152136['push'](_0x152136['shift']());}};_0x20df44(++_0x4f14f1);}(_0x5664,0x127));var _0x4566=function(_0x43e4b3,_0x1444de){_0x43e4b3=_0x43e4b3-0x0;var _0x10c655=_0x5664[_0x43e4b3];return _0x10c655;};'use strict';var _=require(_0x4566('0x0'));var fs=require('fs');var BPromise=require(_0x4566('0x1'));var util=require(_0x4566('0x2'));var path=require(_0x4566('0x3'));var moment=require('moment');var PdfPrinter=require(_0x4566('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x4566('0x5'))['db'];var dbH=require(_0x4566('0x5'))[_0x4566('0x6')];var logger=require(_0x4566('0x7'))(_0x4566('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x4566('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x4566('0x9')][0x4];var NAME=process[_0x4566('0x9')][0x5];var FORMAT=_0x4566('0xa');var _extractedReport;function analyticExtractedReport(_0x50872a,_0x3953e4){var _0x1d010d={'status':_0x50872a};var _0x5554dd={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3953e4){_0x1d010d['savename']=_0x3953e4;}return db[_0x4566('0xb')][_0x4566('0xc')](_0x1d010d,_0x5554dd);}function getHeader(_0x4307e5){var _0x485186=[];for(var _0x5a6368 in _0x4307e5){if(_0x4307e5[_0x4566('0xd')](_0x5a6368)){_0x485186[_0x4566('0xe')]({'text':_0x5a6368,'style':_0x4566('0xf')});}}return _0x485186;}function extractReport(_0x41b1d9){var _0x11e577=0x1388;var _0x4b7611;if(!_0x41b1d9[0x0][_0x4566('0x10')]){return analyticExtractedReport(_0x4566('0x11'));}var _0x364f6d=[];var _0x496d55=0x0;var _0x56c1fc=!![];var _0x5f052c=path[_0x4566('0x12')](PATH);var _0x317597=path['basename'](PATH,_0x4566('0x13'));var _0x2a03d5=![];var _0x56e20b=[];return db[_0x4566('0x14')][_0x4566('0x15')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x4566('0x16')]})[_0x4566('0x17')](function(_0xa4f5c0){if(_0xa4f5c0){_0x4b7611=_0xa4f5c0;_0x11e577=_0x4b7611[_0x4566('0x16')]||0x3e8;}})[_0x4566('0x17')](function(){if(_0x41b1d9&&_0x41b1d9[_0x4566('0x18')]){var _0x3a5597=_0x41b1d9[0x0][_0x4566('0x10')]%(_0x496d55+_0x11e577);if(_0x4b7611['split']){for(;_0x56c1fc;_0x496d55+=_0x11e577,_0x3a5597=_0x41b1d9[0x0][_0x4566('0x10')]%(_0x496d55+_0x11e577)){if(_0x3a5597==0x0||_0x3a5597==_0x41b1d9[0x0][_0x4566('0x10')]){_0x56c1fc=![];}_0x364f6d['push'](dbH[_0x4566('0x19')][_0x4566('0x1a')](util[_0x4566('0x1b')](_0x4566('0x1c'),QUERY,_0x11e577,_0x496d55),{'type':dbH['sequelize'][_0x4566('0x1d')][_0x4566('0x1e')]}));}}else{_0x364f6d[_0x4566('0xe')](dbH[_0x4566('0x19')][_0x4566('0x1a')](QUERY,{'type':dbH[_0x4566('0x19')][_0x4566('0x1d')][_0x4566('0x1e')]}));}}_0x2a03d5=_0x4b7611['split']&&_0x364f6d[_0x4566('0x18')]>0x1;if(!fs[_0x4566('0x1f')](path[_0x4566('0x20')](_0x5f052c,_0x317597))&&_0x2a03d5){fs[_0x4566('0x21')](path['join'](_0x5f052c,_0x317597));}return BPromise[_0x4566('0x22')](_0x364f6d,function(_0x4a164d){_0x56e20b[_0x4566('0xe')](_0x4a164d);});})[_0x4566('0x17')](function(){return BPromise[_0x4566('0x22')](_0x364f6d,function(_0x30a37f,_0x105d40){var _0x5336f4;var _0x99cf5=util['format'](_0x4566('0x23'),NAME,_extractedReport['name'],moment(_extractedReport[_0x4566('0x24')])[_0x4566('0x1b')](FORMAT),moment(_extractedReport[_0x4566('0x25')])[_0x4566('0x1b')](FORMAT));var _0x31282d={'pageSize':'A4','pageOrientation':'landscape','content':[{'text':_0x99cf5,'style':_0x4566('0x26')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x4566('0x27')}}};var _0x14f691={'headerRows':0x1,'body':[]};_0x14f691[_0x4566('0x28')][_0x4566('0xe')](getHeader(_0x30a37f[0x0]));var _0x334fa;for(var _0x3ee00b=0x0;_0x3ee00b<_0x30a37f[_0x4566('0x18')];_0x3ee00b+=0x1){_0x334fa=[];for(var _0x5f586f in _0x30a37f[_0x3ee00b]){if(_0x30a37f[_0x3ee00b][_0x4566('0xd')](_0x5f586f)){_0x334fa['push'](_0x30a37f[_0x3ee00b][_0x5f586f]?_[_0x4566('0x29')](_0x30a37f[_0x3ee00b][_0x5f586f]):'');}}_0x14f691[_0x4566('0x28')][_0x4566('0xe')](_0x334fa);}_0x31282d[_0x4566('0x2a')][_0x4566('0xe')]({'table':_0x14f691});return new BPromise(function(_0x5f508e,_0x2ffdae){var _0xb5deb8=new PdfPrinter({'Roboto':{'normal':__dirname+_0x4566('0x2b'),'bold':__dirname+_0x4566('0x2c'),'italics':__dirname+_0x4566('0x2d'),'bolditalics':__dirname+_0x4566('0x2e')}});var _0x4c8399=_0xb5deb8[_0x4566('0x2f')](_0x31282d);if(_0x2a03d5){_0x5336f4=path[_0x4566('0x20')](_0x5f052c,_0x317597,util[_0x4566('0x1b')]('%s%d.%s',_0x317597,_0x105d40,'pdf'));}else{_0x5336f4=path[_0x4566('0x20')](_0x5f052c,util[_0x4566('0x1b')]('%s.%s',_0x317597,'pdf'));}var _0x47021e=_0x4c8399['pipe'](fs[_0x4566('0x30')](_0x5336f4));_0x47021e['on'](_0x4566('0x31'),function(){_0x5f508e();});_0x47021e['on'](_0x4566('0x32'),function(_0x2e84c7){console[_0x4566('0x33')](_0x4566('0x34'),_0x2e84c7);_0x2ffdae(_0x2e84c7);});_0x4c8399[_0x4566('0x35')]();});});})[_0x4566('0x17')](function(){if(_0x2a03d5){return new BPromise(function(_0x4fa548,_0x54f168){zipdir(path[_0x4566('0x20')](_0x5f052c,_0x317597),{'saveTo':path[_0x4566('0x20')](_0x5f052c,util[_0x4566('0x1b')](_0x4566('0x36'),_0x317597,'zip'))},function(_0x43f2d1){if(_0x43f2d1){_0x54f168(_0x43f2d1);}else{_0x4fa548();}});});}})[_0x4566('0x17')](function(){if(_0x2a03d5){rimraf(path[_0x4566('0x20')](_0x5f052c,_0x317597),function(){});}})[_0x4566('0x17')](function(){logger[_0x4566('0x37')](util[_0x4566('0x1b')](_0x4566('0x38'),EXTRACTED_REPORT_ID,_0x4566('0x39')));return analyticExtractedReport(_0x4566('0x3a'),_0x2a03d5?util[_0x4566('0x1b')]('%s.%s',_0x317597,_0x2a03d5?'zip':_0x4566('0x3b')):null);});}function main(){logger[_0x4566('0x37')](util[_0x4566('0x1b')](_0x4566('0x3c'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x4566('0xb')][_0x4566('0x3d')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x4566('0x17')](function(_0x4e69ee){_extractedReport=_0x4e69ee;return dbH[_0x4566('0x19')]['query'](util['format'](_0x4566('0x3e'),QUERY),{'type':dbH['sequelize'][_0x4566('0x1d')][_0x4566('0x1e')]});})[_0x4566('0x17')](extractReport)['catch'](function(_0x2837df){logger[_0x4566('0x37')](util[_0x4566('0x1b')](_0x4566('0x3f'),EXTRACTED_REPORT_ID,_0x4566('0x40')),util[_0x4566('0x41')](_0x2837df,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x4566('0x42'));});}main(); \ No newline at end of file +var _0xa9a0=['/fonts/Roboto-MediumItalic.ttf','%s%d.%s','pdf','createWriteStream','finish','error','log','err','end','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','util','path','pdfmake/src/printer','rimraf','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','tableHeader','num','dirname','basename','.pdf','Setting','find','split','splitSizePdf','then','length','push','sequelize','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','join','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','header','black','body','hasOwnProperty','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf'];(function(_0x55b1f9,_0x5512e8){var _0x39c4d1=function(_0x119587){while(--_0x119587){_0x55b1f9['push'](_0x55b1f9['shift']());}};_0x39c4d1(++_0x5512e8);}(_0xa9a0,0x122));var _0x0a9a=function(_0x330fb8,_0x548de4){_0x330fb8=_0x330fb8-0x0;var _0x443a15=_0xa9a0[_0x330fb8];return _0x443a15;};'use strict';var _=require(_0x0a9a('0x0'));var fs=require('fs');var BPromise=require(_0x0a9a('0x1'));var util=require(_0x0a9a('0x2'));var path=require(_0x0a9a('0x3'));var moment=require('moment');var PdfPrinter=require(_0x0a9a('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x0a9a('0x5'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x0a9a('0x6')];var logger=require(_0x0a9a('0x7'))(_0x0a9a('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x0a9a('0x9')][0x2]);var QUERY=process[_0x0a9a('0x9')][0x3];var PATH=process[_0x0a9a('0x9')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x0a9a('0xa');var _extractedReport;function analyticExtractedReport(_0x2f484d,_0x5469c5){var _0x162fd5={'status':_0x2f484d};var _0x4f9fab={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5469c5){_0x162fd5[_0x0a9a('0xb')]=_0x5469c5;}return db[_0x0a9a('0xc')][_0x0a9a('0xd')](_0x162fd5,_0x4f9fab);}function getHeader(_0x5a0309){var _0x18c59d=[];for(var _0x4b053f in _0x5a0309){if(_0x5a0309['hasOwnProperty'](_0x4b053f)){_0x18c59d['push']({'text':_0x4b053f,'style':_0x0a9a('0xe')});}}return _0x18c59d;}function extractReport(_0x14322d){var _0x865ccc=0x1388;var _0x1959e2;if(!_0x14322d[0x0][_0x0a9a('0xf')]){return analyticExtractedReport('Empty');}var _0x30738c=[];var _0x520861=0x0;var _0x476724=!![];var _0x355c36=path[_0x0a9a('0x10')](PATH);var _0x3cd6c0=path[_0x0a9a('0x11')](PATH,_0x0a9a('0x12'));var _0x3015ee=![];var _0xf0676f=[];return db[_0x0a9a('0x13')][_0x0a9a('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0a9a('0x15'),_0x0a9a('0x16')]})['then'](function(_0x4a019a){if(_0x4a019a){_0x1959e2=_0x4a019a;_0x865ccc=_0x1959e2['splitSizePdf']||0x3e8;}})[_0x0a9a('0x17')](function(){if(_0x14322d&&_0x14322d[_0x0a9a('0x18')]){var _0x4ae2c1=_0x14322d[0x0][_0x0a9a('0xf')]%(_0x520861+_0x865ccc);if(_0x1959e2['split']){for(;_0x476724;_0x520861+=_0x865ccc,_0x4ae2c1=_0x14322d[0x0][_0x0a9a('0xf')]%(_0x520861+_0x865ccc)){if(_0x4ae2c1==0x0||_0x4ae2c1==_0x14322d[0x0][_0x0a9a('0xf')]){_0x476724=![];}_0x30738c[_0x0a9a('0x19')](dbH[_0x0a9a('0x1a')][_0x0a9a('0x1b')](util[_0x0a9a('0x1c')](_0x0a9a('0x1d'),QUERY,_0x865ccc,_0x520861),{'type':dbH['sequelize'][_0x0a9a('0x1e')]['SELECT']}));}}else{_0x30738c[_0x0a9a('0x19')](dbH[_0x0a9a('0x1a')][_0x0a9a('0x1b')](QUERY,{'type':dbH[_0x0a9a('0x1a')][_0x0a9a('0x1e')][_0x0a9a('0x1f')]}));}}_0x3015ee=_0x1959e2[_0x0a9a('0x15')]&&_0x30738c[_0x0a9a('0x18')]>0x1;if(!fs['existsSync'](path[_0x0a9a('0x20')](_0x355c36,_0x3cd6c0))&&_0x3015ee){fs['mkdirSync'](path[_0x0a9a('0x20')](_0x355c36,_0x3cd6c0));}return BPromise['each'](_0x30738c,function(_0x439361){_0xf0676f['push'](_0x439361);});})[_0x0a9a('0x17')](function(){return BPromise[_0x0a9a('0x21')](_0x30738c,function(_0x55d894,_0x280664){var _0xb2ae6d;var _0x1fc723=util[_0x0a9a('0x1c')](_0x0a9a('0x22'),NAME,_extractedReport[_0x0a9a('0x23')],moment(_extractedReport['startDate'])['format'](FORMAT),moment(_extractedReport[_0x0a9a('0x24')])[_0x0a9a('0x1c')](FORMAT));var _0x4068f6={'pageSize':'A4','pageOrientation':'landscape','content':[{'text':_0x1fc723,'style':_0x0a9a('0x25')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0a9a('0x26')}}};var _0x2a994a={'headerRows':0x1,'body':[]};_0x2a994a[_0x0a9a('0x27')][_0x0a9a('0x19')](getHeader(_0x55d894[0x0]));var _0x475067;for(var _0x464622=0x0;_0x464622<_0x55d894[_0x0a9a('0x18')];_0x464622+=0x1){_0x475067=[];for(var _0x324932 in _0x55d894[_0x464622]){if(_0x55d894[_0x464622][_0x0a9a('0x28')](_0x324932)){_0x475067[_0x0a9a('0x19')](_0x55d894[_0x464622][_0x324932]?_[_0x0a9a('0x29')](_0x55d894[_0x464622][_0x324932]):'');}}_0x2a994a[_0x0a9a('0x27')]['push'](_0x475067);}_0x4068f6[_0x0a9a('0x2a')]['push']({'table':_0x2a994a});return new BPromise(function(_0x2a105e,_0x220c76){var _0x1c0885=new PdfPrinter({'Roboto':{'normal':__dirname+_0x0a9a('0x2b'),'bold':__dirname+_0x0a9a('0x2c'),'italics':__dirname+'/fonts/Roboto-Italic.ttf','bolditalics':__dirname+_0x0a9a('0x2d')}});var _0xd7135c=_0x1c0885['createPdfKitDocument'](_0x4068f6);if(_0x3015ee){_0xb2ae6d=path[_0x0a9a('0x20')](_0x355c36,_0x3cd6c0,util[_0x0a9a('0x1c')](_0x0a9a('0x2e'),_0x3cd6c0,_0x280664,_0x0a9a('0x2f')));}else{_0xb2ae6d=path[_0x0a9a('0x20')](_0x355c36,util[_0x0a9a('0x1c')]('%s.%s',_0x3cd6c0,_0x0a9a('0x2f')));}var _0x19de0d=_0xd7135c['pipe'](fs[_0x0a9a('0x30')](_0xb2ae6d));_0x19de0d['on'](_0x0a9a('0x31'),function(){_0x2a105e();});_0x19de0d['on'](_0x0a9a('0x32'),function(_0x46d92e){console[_0x0a9a('0x33')](_0x0a9a('0x34'),_0x46d92e);_0x220c76(_0x46d92e);});_0xd7135c[_0x0a9a('0x35')]();});});})['then'](function(){if(_0x3015ee){return new BPromise(function(_0x2456a1,_0x3e362b){zipdir(path[_0x0a9a('0x20')](_0x355c36,_0x3cd6c0),{'saveTo':path['join'](_0x355c36,util[_0x0a9a('0x1c')](_0x0a9a('0x36'),_0x3cd6c0,_0x0a9a('0x37')))},function(_0x6bbb3b){if(_0x6bbb3b){_0x3e362b(_0x6bbb3b);}else{_0x2456a1();}});});}})[_0x0a9a('0x17')](function(){if(_0x3015ee){rimraf(path[_0x0a9a('0x20')](_0x355c36,_0x3cd6c0),function(){});}})[_0x0a9a('0x17')](function(){logger[_0x0a9a('0x38')](util[_0x0a9a('0x1c')](_0x0a9a('0x39'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x0a9a('0x3a'),_0x3015ee?util[_0x0a9a('0x1c')](_0x0a9a('0x36'),_0x3cd6c0,_0x3015ee?_0x0a9a('0x37'):_0x0a9a('0x2f')):null);});}function main(){logger[_0x0a9a('0x38')](util[_0x0a9a('0x1c')](_0x0a9a('0x3b'),EXTRACTED_REPORT_ID,_0x0a9a('0x3c')));return db['AnalyticExtractedReport'][_0x0a9a('0x3d')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x0a9a('0x17')](function(_0x21d62f){_extractedReport=_0x21d62f;return dbH['sequelize'][_0x0a9a('0x1b')](util[_0x0a9a('0x1c')](_0x0a9a('0x3e'),QUERY),{'type':dbH[_0x0a9a('0x1a')][_0x0a9a('0x1e')][_0x0a9a('0x1f')]});})[_0x0a9a('0x17')](extractReport)[_0x0a9a('0x3f')](function(_0x2a0beb){logger['info'](util['format'](_0x0a9a('0x40'),EXTRACTED_REPORT_ID,_0x0a9a('0x3c')),util[_0x0a9a('0x41')](_0x2a0beb,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x0a9a('0x42'));});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 6471c3a..37d482e 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 _0x5be6=['XLSX','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','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','lodash','json2xls','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x556bc5,_0x44738c){var _0xb7774a=function(_0xfa3871){while(--_0xfa3871){_0x556bc5['push'](_0x556bc5['shift']());}};_0xb7774a(++_0x44738c);}(_0x5be6,0x171));var _0x65be=function(_0x34a583,_0x5c2ae8){_0x34a583=_0x34a583-0x0;var _0x3fa5cf=_0x5be6[_0x34a583];return _0x3fa5cf;};'use strict';var util=require(_0x65be('0x0'));var path=require(_0x65be('0x1'));var _=require(_0x65be('0x2'));var fs=require('fs');var json2xls=require(_0x65be('0x3'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x65be('0x4'));var db=require(_0x65be('0x5'))['db'];var dbH=require(_0x65be('0x5'))[_0x65be('0x6')];var logger=require(_0x65be('0x7'))(_0x65be('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x65be('0x9')][0x2]);var QUERY=process[_0x65be('0x9')][0x3];var PATH=process[_0x65be('0x9')][0x4];function analyticExtractedReport(_0x1b33fd,_0x50340c){var _0x34b12c={'status':_0x1b33fd};var _0xb76a6c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x50340c){_0x34b12c[_0x65be('0xa')]=_0x50340c;}return db['AnalyticExtractedReport'][_0x65be('0xb')](_0x34b12c,_0xb76a6c);}function main(){var _0x18abba=0x1388;var _0x771fdd;logger[_0x65be('0xc')](util[_0x65be('0xd')](_0x65be('0xe'),EXTRACTED_REPORT_ID,_0x65be('0xf')));return db['Setting'][_0x65be('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x65be('0x11'),_0x65be('0x12')]})[_0x65be('0x13')](function(_0x951b61){if(_0x951b61){_0x771fdd=_0x951b61;_0x18abba=_0x771fdd[_0x65be('0x12')]||0x1388;}})['then'](function(){return dbH[_0x65be('0x14')][_0x65be('0x15')](util['format'](_0x65be('0x16'),QUERY),{'type':dbH[_0x65be('0x14')][_0x65be('0x17')][_0x65be('0x18')]});})[_0x65be('0x13')](function(_0xcfd127){if(!_0xcfd127[0x0]['num']){return analyticExtractedReport(_0x65be('0x19'));}var _0x2bd9ef=[];var _0x8ce366=0x0;var _0xb3f096=!![];if(_0x771fdd[_0x65be('0x11')]){if(_0xcfd127&&_0xcfd127[_0x65be('0x1a')]){var _0x2e1d28=_0xcfd127[0x0][_0x65be('0x1b')]%(_0x8ce366+_0x18abba);for(;_0xb3f096;_0x8ce366+=_0x18abba,_0x2e1d28=_0xcfd127[0x0][_0x65be('0x1b')]%(_0x8ce366+_0x18abba)){if(_0x2e1d28==0x0||_0x2e1d28==_0xcfd127[0x0][_0x65be('0x1b')]){_0xb3f096=![];}_0x2bd9ef[_0x65be('0x1c')](dbH[_0x65be('0x14')][_0x65be('0x15')](util[_0x65be('0xd')](_0x65be('0x1d'),QUERY,_0x18abba,_0x8ce366),{'type':dbH[_0x65be('0x14')][_0x65be('0x17')][_0x65be('0x18')]}));}}}else{_0x2bd9ef['push'](dbH[_0x65be('0x14')][_0x65be('0x15')](QUERY,{'type':dbH[_0x65be('0x14')]['QueryTypes'][_0x65be('0x18')]}));}var _0x305454=path[_0x65be('0x1e')](PATH);var _0x4c07e7=path[_0x65be('0x1f')](PATH,_0x65be('0x20'));var _0x55564d=_0x771fdd[_0x65be('0x11')]&&_0x2bd9ef['length']>0x1;var _0x21f680=[];if(!fs[_0x65be('0x21')](path[_0x65be('0x22')](_0x305454,_0x4c07e7))&&_0x55564d){fs[_0x65be('0x23')](path[_0x65be('0x22')](_0x305454,_0x4c07e7));}return BPromise[_0x65be('0x24')](_0x2bd9ef,function(_0x5572c8){_0x21f680['push'](_0x5572c8);})['then'](function(){for(var _0x24f336=0x0;_0x24f336<_0x21f680[_0x65be('0x1a')];_0x24f336+=0x1){var _0x881de5;var _0x3c0be2=_0x21f680[_0x24f336];if(_0x55564d){_0x881de5=path['join'](_0x305454,_0x4c07e7,util[_0x65be('0xd')]('%s%d.%s',_0x4c07e7,_0x24f336,_0x65be('0x25')));}else{_0x881de5=path['join'](_0x305454,util[_0x65be('0xd')](_0x65be('0x26'),_0x4c07e7,_0x65be('0x25')));}fs[_0x65be('0x27')](_0x881de5,json2xls(_0x3c0be2),_0x65be('0x28'));}})['then'](function(){if(_0x55564d){zipdir(path['join'](_0x305454,_0x4c07e7),{'saveTo':path[_0x65be('0x22')](_0x305454,util[_0x65be('0xd')](_0x65be('0x26'),_0x4c07e7,_0x65be('0x29')))},function(_0x46de5f,_0x4e7b89){});rimraf(path[_0x65be('0x22')](_0x305454,_0x4c07e7),function(){});}})[_0x65be('0x13')](function(){logger[_0x65be('0xc')](util[_0x65be('0xd')](_0x65be('0x2a'),EXTRACTED_REPORT_ID,_0x65be('0xf')));return analyticExtractedReport(_0x65be('0x2b'),_0x55564d?util[_0x65be('0xd')](_0x65be('0x26'),_0x4c07e7,_0x55564d?_0x65be('0x29'):_0x65be('0x25')):null);});})[_0x65be('0x2c')](function(_0x3eb0b4){logger['info'](util[_0x65be('0xd')](_0x65be('0x2d'),EXTRACTED_REPORT_ID,_0x65be('0xf')),util[_0x65be('0x2e')](_0x3eb0b4,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x65be('0x2f'));});}main(); \ No newline at end of file +var _0x6943=['length','existsSync','mkdirSync','join','%s%d.%s','%s.%s','xlsx','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','Failed','util','lodash','json2xls','bluebird','rimraf','../../mysqldb','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','query','QueryTypes','num','split','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.xlsx'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6943,0x88));var _0x3694=function(_0x5aa1e2,_0x2b5adb){_0x5aa1e2=_0x5aa1e2-0x0;var _0x399098=_0x6943[_0x5aa1e2];return _0x399098;};'use strict';var util=require(_0x3694('0x0'));var path=require('path');var _=require(_0x3694('0x1'));var fs=require('fs');var json2xls=require(_0x3694('0x2'));var BPromise=require(_0x3694('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x3694('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x3694('0x5'))['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x3694('0x6')][0x2]);var QUERY=process[_0x3694('0x6')][0x3];var PATH=process[_0x3694('0x6')][0x4];function analyticExtractedReport(_0x25cae3,_0x3c0d95){var _0x52914d={'status':_0x25cae3};var _0x4fef4d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3c0d95){_0x52914d[_0x3694('0x7')]=_0x3c0d95;}return db['AnalyticExtractedReport'][_0x3694('0x8')](_0x52914d,_0x4fef4d);}function main(){var _0x2b25dc=0x1388;var _0x34b7bc;logger[_0x3694('0x9')](util[_0x3694('0xa')](_0x3694('0xb'),EXTRACTED_REPORT_ID,_0x3694('0xc')));return db[_0x3694('0xd')][_0x3694('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x3694('0xf')]})[_0x3694('0x10')](function(_0x27274c){if(_0x27274c){_0x34b7bc=_0x27274c;_0x2b25dc=_0x34b7bc[_0x3694('0xf')]||0x1388;}})[_0x3694('0x10')](function(){return dbH[_0x3694('0x11')][_0x3694('0x12')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x3694('0x13')]['SELECT']});})[_0x3694('0x10')](function(_0x330844){if(!_0x330844[0x0][_0x3694('0x14')]){return analyticExtractedReport('Empty');}var _0x42b54d=[];var _0x2308d9=0x0;var _0x2dfbd9=!![];if(_0x34b7bc[_0x3694('0x15')]){if(_0x330844&&_0x330844['length']){var _0x24c64c=_0x330844[0x0][_0x3694('0x14')]%(_0x2308d9+_0x2b25dc);for(;_0x2dfbd9;_0x2308d9+=_0x2b25dc,_0x24c64c=_0x330844[0x0][_0x3694('0x14')]%(_0x2308d9+_0x2b25dc)){if(_0x24c64c==0x0||_0x24c64c==_0x330844[0x0][_0x3694('0x14')]){_0x2dfbd9=![];}_0x42b54d[_0x3694('0x16')](dbH[_0x3694('0x11')][_0x3694('0x12')](util[_0x3694('0xa')](_0x3694('0x17'),QUERY,_0x2b25dc,_0x2308d9),{'type':dbH['sequelize'][_0x3694('0x13')]['SELECT']}));}}}else{_0x42b54d[_0x3694('0x16')](dbH[_0x3694('0x11')][_0x3694('0x12')](QUERY,{'type':dbH['sequelize'][_0x3694('0x13')][_0x3694('0x18')]}));}var _0x35659c=path[_0x3694('0x19')](PATH);var _0x389256=path[_0x3694('0x1a')](PATH,_0x3694('0x1b'));var _0x76f379=_0x34b7bc[_0x3694('0x15')]&&_0x42b54d[_0x3694('0x1c')]>0x1;var _0x14ff13=[];if(!fs[_0x3694('0x1d')](path['join'](_0x35659c,_0x389256))&&_0x76f379){fs[_0x3694('0x1e')](path[_0x3694('0x1f')](_0x35659c,_0x389256));}return BPromise['each'](_0x42b54d,function(_0x59ba34){_0x14ff13[_0x3694('0x16')](_0x59ba34);})[_0x3694('0x10')](function(){for(var _0x5529de=0x0;_0x5529de<_0x14ff13[_0x3694('0x1c')];_0x5529de+=0x1){var _0x24d7d7;var _0x224d27=_0x14ff13[_0x5529de];if(_0x76f379){_0x24d7d7=path[_0x3694('0x1f')](_0x35659c,_0x389256,util[_0x3694('0xa')](_0x3694('0x20'),_0x389256,_0x5529de,'xlsx'));}else{_0x24d7d7=path[_0x3694('0x1f')](_0x35659c,util[_0x3694('0xa')](_0x3694('0x21'),_0x389256,_0x3694('0x22')));}fs['writeFileSync'](_0x24d7d7,json2xls(_0x224d27),'binary');}})['then'](function(){if(_0x76f379){zipdir(path[_0x3694('0x1f')](_0x35659c,_0x389256),{'saveTo':path[_0x3694('0x1f')](_0x35659c,util[_0x3694('0xa')](_0x3694('0x21'),_0x389256,_0x3694('0x23')))},function(_0x334728,_0x1e7723){});rimraf(path[_0x3694('0x1f')](_0x35659c,_0x389256),function(){});}})[_0x3694('0x10')](function(){logger[_0x3694('0x9')](util['format'](_0x3694('0x24'),EXTRACTED_REPORT_ID,_0x3694('0xc')));return analyticExtractedReport(_0x3694('0x25'),_0x76f379?util[_0x3694('0xa')]('%s.%s',_0x389256,_0x76f379?_0x3694('0x23'):'xlsx'):null);});})[_0x3694('0x26')](function(_0x32f42a){logger[_0x3694('0x9')](util['format'](_0x3694('0x27'),EXTRACTED_REPORT_ID,_0x3694('0xc')),util['inspect'](_0x32f42a,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x3694('0x28'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 2d8569d..a199923 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 _0x3e16=['ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','indexOf','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','bulkCreate','error','rewrite','util','models','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','playback','hasOwnProperty','priority','extensions','extension','type','CDR(type)=%s','context','VoiceExtensionId','outbound','push','Set','CDR(destination)=','cutdigits','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','callerID'];(function(_0x2ff238,_0x1811d2){var _0x204a56=function(_0x5bf2e1){while(--_0x5bf2e1){_0x2ff238['push'](_0x2ff238['shift']());}};_0x204a56(++_0x1811d2);}(_0x3e16,0x19f));var _0x63e1=function(_0x2da1ef,_0x4c0fbd){_0x2da1ef=_0x2da1ef-0x0;var _0x5900a4=_0x3e16[_0x2da1ef];return _0x5900a4;};'use strict';var _=require('lodash');var util=require(_0x63e1('0x0'));function rewrite(_0x4c2cf6,_0x234d3d){var _0x16e999=this;return _0x4c2cf6[_0x63e1('0x1')]['Interval'][_0x63e1('0x2')]({'raw':!![]})[_0x63e1('0x3')](function(_0x1dc983){_0x16e999[_0x63e1('0x4')]=_0x1dc983;return _0x4c2cf6[_0x63e1('0x1')][_0x63e1('0x5')][_0x63e1('0x2')]({'where':{'IntervalId':_0x234d3d[_0x63e1('0x6')]},'raw':!![]});})['then'](function(_0x301f4c){return _0x4c2cf6['models']['VoiceExtension'][_0x63e1('0x2')]({'where':{'exten':{'$in':_[_0x63e1('0x7')](_[_0x63e1('0x8')](_0x301f4c,_0x63e1('0x9')))}},'order':[{'raw':_0x63e1('0xa')}],'raw':!![]});})[_0x63e1('0x3')](function(_0x2a60da){var _0x301bf8=_[_0x63e1('0xb')](_0x2a60da,{'priority':'1'});var _0x1a4cde=_['filter'](_0x2a60da,{'isApp':0x1});var _0x569171=_['groupBy'](_0x1a4cde,'exten');var _0x36be0a=[_0x63e1('0xc'),_0x63e1('0xd')];var _0x1b0499=[];var _0x515083=[];for(var _0x532a1c in _0x569171){if(_0x569171[_0x63e1('0xe')](_0x532a1c)){_0x16e999[_0x63e1('0xf')]=0x2;_0x16e999[_0x63e1('0x10')]=[];_0x16e999[_0x63e1('0x11')]=_['find'](_0x301bf8,{'exten':_0x569171[_0x532a1c][0x0]['exten']});_0x16e999['extensions']['push']({'type':_0x569171[_0x532a1c][0x0][_0x63e1('0x12')],'app':'Set','appdata':util['format'](_0x63e1('0x13'),_0x569171[_0x532a1c][0x0][_0x63e1('0x12')]),'context':_0x569171[_0x532a1c][0x0][_0x63e1('0x14')],'exten':_0x569171[_0x532a1c][0x0][_0x63e1('0x9')],'priority':_0x16e999['priority']++,'VoiceExtensionId':_0x569171[_0x532a1c][0x0][_0x63e1('0x15')]});if(_0x569171[_0x532a1c][0x0]['type']===_0x63e1('0x16')){if(_0x16e999[_0x63e1('0x11')]){_0x16e999[_0x63e1('0x10')][_0x63e1('0x17')]({'type':_0x569171[_0x532a1c][0x0][_0x63e1('0x12')],'app':_0x63e1('0x18'),'appdata':_0x63e1('0x19')+(_0x16e999[_0x63e1('0x11')]['cutdigits']?'${EXTEN:'+_0x16e999[_0x63e1('0x11')][_0x63e1('0x1a')]+'}':'${EXTEN}'),'context':_0x569171[_0x532a1c][0x0][_0x63e1('0x14')],'exten':_0x569171[_0x532a1c][0x0][_0x63e1('0x9')],'priority':_0x16e999[_0x63e1('0xf')]++,'VoiceExtensionId':_0x569171[_0x532a1c][0x0][_0x63e1('0x15')]});}_0x16e999[_0x63e1('0x10')][_0x63e1('0x17')]({'type':_0x569171[_0x532a1c][0x0]['type'],'app':'Set','appdata':_0x63e1('0x1b')+_0x569171[_0x532a1c][0x0][_0x63e1('0x15')],'context':_0x569171[_0x532a1c][0x0][_0x63e1('0x14')],'exten':_0x569171[_0x532a1c][0x0][_0x63e1('0x9')],'priority':_0x16e999[_0x63e1('0xf')]++,'VoiceExtensionId':_0x569171[_0x532a1c][0x0][_0x63e1('0x15')]});var _0x163f25=_0x16e999[_0x63e1('0xf')]++;_0x16e999[_0x63e1('0x10')][_0x63e1('0x17')]({'type':_0x569171[_0x532a1c][0x0]['type'],'app':'ExecIf','appdata':_0x63e1('0x1c')+(_0x163f25+0x2)+_0x63e1('0x1d')+(_0x163f25+0x1)+')','context':_0x569171[_0x532a1c][0x0][_0x63e1('0x14')],'exten':_0x569171[_0x532a1c][0x0][_0x63e1('0x9')],'priority':_0x163f25,'VoiceExtensionId':_0x569171[_0x532a1c][0x0][_0x63e1('0x15')]});if(_0x16e999[_0x63e1('0x11')]){_0x16e999[_0x63e1('0x10')][_0x63e1('0x17')]({'type':_0x569171[_0x532a1c][0x0][_0x63e1('0x12')],'app':'Set','appdata':_0x16e999['extension'][_0x63e1('0x1a')]?_0x63e1('0x1e')+_0x16e999[_0x63e1('0x11')][_0x63e1('0x1a')]+'}':'CDR(prefix)=noprefix','context':_0x569171[_0x532a1c][0x0][_0x63e1('0x14')],'exten':_0x569171[_0x532a1c][0x0]['exten'],'priority':_0x16e999[_0x63e1('0xf')]++,'VoiceExtensionId':_0x569171[_0x532a1c][0x0][_0x63e1('0x15')]});}_0x16e999[_0x63e1('0x10')][_0x63e1('0x17')]({'type':_0x569171[_0x532a1c][0x0][_0x63e1('0x12')],'app':_0x63e1('0x18'),'appdata':_0x63e1('0x1f')+_0x569171[_0x532a1c][0x0][_0x63e1('0x15')],'context':_0x569171[_0x532a1c][0x0][_0x63e1('0x14')],'exten':_0x569171[_0x532a1c][0x0]['exten'],'priority':_0x16e999['priority']++,'VoiceExtensionId':_0x569171[_0x532a1c][0x0][_0x63e1('0x15')]});if(_0x16e999[_0x63e1('0x11')]&&_0x16e999['extension']['hasOwnProperty'](_0x63e1('0x20'))&&_0x16e999[_0x63e1('0x11')][_0x63e1('0x20')]!=='none'){_0x16e999[_0x63e1('0x10')][_0x63e1('0x17')]({'type':_0x569171[_0x532a1c][0x0][_0x63e1('0x12')],'app':_0x63e1('0x18'),'appdata':_0x63e1('0x21'),'context':_0x569171[_0x532a1c][0x0][_0x63e1('0x14')],'exten':_0x569171[_0x532a1c][0x0]['exten'],'priority':_0x16e999[_0x63e1('0xf')]++,'VoiceExtensionId':_0x569171[_0x532a1c][0x0]['VoiceExtensionId']});_0x16e999[_0x63e1('0x10')][_0x63e1('0x17')]({'type':_0x569171[_0x532a1c][0x0][_0x63e1('0x12')],'app':_0x63e1('0x18'),'appdata':_0x63e1('0x22')+_0x16e999['extension'][_0x63e1('0x20')]||_0x63e1('0x23'),'context':_0x569171[_0x532a1c][0x0][_0x63e1('0x14')],'exten':_0x569171[_0x532a1c][0x0][_0x63e1('0x9')],'priority':_0x16e999[_0x63e1('0xf')]++,'VoiceExtensionId':_0x569171[_0x532a1c][0x0][_0x63e1('0x15')]});}}_0x16e999[_0x63e1('0x10')][_0x63e1('0x17')]({'type':_0x569171[_0x532a1c][0x0][_0x63e1('0x12')],'app':'Set','appdata':_0x63e1('0x24'),'context':_0x569171[_0x532a1c][0x0][_0x63e1('0x14')],'exten':_0x569171[_0x532a1c][0x0][_0x63e1('0x9')],'priority':_0x16e999['priority']++,'VoiceExtensionId':_0x569171[_0x532a1c][0x0][_0x63e1('0x15')]});_0x16e999['extensions'][_0x63e1('0x17')]({'type':_0x569171[_0x532a1c][0x0][_0x63e1('0x12')],'app':_0x63e1('0x18'),'appdata':_0x63e1('0x25'),'context':_0x569171[_0x532a1c][0x0][_0x63e1('0x14')],'exten':_0x569171[_0x532a1c][0x0][_0x63e1('0x9')],'priority':_0x16e999[_0x63e1('0xf')]++,'VoiceExtensionId':_0x569171[_0x532a1c][0x0]['VoiceExtensionId']});_0x16e999[_0x63e1('0x10')][_0x63e1('0x17')]({'type':_0x569171[_0x532a1c][0x0][_0x63e1('0x12')],'app':'Set','appdata':_0x63e1('0x26'),'context':_0x569171[_0x532a1c][0x0]['context'],'exten':_0x569171[_0x532a1c][0x0][_0x63e1('0x9')],'priority':_0x16e999[_0x63e1('0xf')]++,'VoiceExtensionId':_0x569171[_0x532a1c][0x0][_0x63e1('0x15')]});for(var _0x1f1241=0x0,_0x780eda=0x0;_0x1f1241<_0x569171[_0x532a1c][_0x63e1('0x27')];_0x1f1241+=0x1,_0x780eda=0x0){var _0x46ce51=_0x569171[_0x532a1c][_0x1f1241];if(_0x46ce51[_0x63e1('0x12')]){_0x46ce51[_0x63e1('0x12')]=_0x46ce51['type'][_0x63e1('0x28')]();}var _0x358a88=[];var _0x1d3ccf=[];delete _0x46ce51['id'];delete _0x46ce51[_0x63e1('0x29')];delete _0x46ce51[_0x63e1('0x2a')];var _0x1e5b57=_0x46ce51[_0x63e1('0x2b')]!==_0x63e1('0x2c')?[_0x46ce51[_0x63e1('0x2b')]]:_0x46ce51[_0x63e1('0x6')]?_['map'](_[_0x63e1('0xb')](_0x16e999[_0x63e1('0x4')],{'IntervalId':_0x46ce51['IntervalId']}),'interval'):[];if(_0x46ce51[_0x63e1('0xe')](_0x63e1('0x2d'))){if(_0x46ce51[_0x63e1('0x2d')]&&_0x46ce51[_0x63e1('0x2d')]!=='--'){_0x358a88[_0x63e1('0x17')]({'type':_0x46ce51[_0x63e1('0x12')],'app':_0x63e1('0x18'),'appdata':'CDR(tag)='+_0x46ce51[_0x63e1('0x2d')],'context':_0x46ce51[_0x63e1('0x14')],'exten':_0x46ce51['exten'],'priority':_0x1e5b57['length']+_0x16e999['priority']+_0x780eda++,'VoiceExtensionId':_0x46ce51[_0x63e1('0x15')]});}}if(_0x46ce51[_0x63e1('0x12')]==='outbound'&&_0x46ce51[_0x63e1('0xe')](_0x63e1('0x2e'))){if(_0x46ce51[_0x63e1('0x2e')]){_0x358a88['push']({'type':_0x46ce51['type'],'app':_0x63e1('0x2f'),'appdata':_0x63e1('0x30')+_0x46ce51[_0x63e1('0x2e')]+')','context':_0x46ce51['context'],'exten':_0x46ce51['exten'],'priority':_0x1e5b57['length']+_0x16e999[_0x63e1('0xf')]+_0x780eda++,'VoiceExtensionId':_0x46ce51[_0x63e1('0x15')]});}else{_0x358a88['push']({'type':_0x46ce51['type'],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x46ce51['context'],'exten':_0x46ce51[_0x63e1('0x9')],'priority':_0x1e5b57[_0x63e1('0x27')]+_0x16e999[_0x63e1('0xf')]+_0x780eda++,'VoiceExtensionId':_0x46ce51[_0x63e1('0x15')]});}}if(_0x46ce51[_0x63e1('0xe')]('answer')){if(_0x36be0a[_0x63e1('0x31')](_0x46ce51[_0x63e1('0x32')][_0x63e1('0x28')]())>=0x0&&_0x46ce51[_0x63e1('0x33')]!==_0x63e1('0x34')){if(_0x46ce51[_0x63e1('0x35')]){_0x358a88[_0x63e1('0x17')]({'type':_0x46ce51['type'],'app':_0x63e1('0x2f'),'appdata':_0x63e1('0x36'),'context':_0x46ce51[_0x63e1('0x14')],'exten':_0x46ce51[_0x63e1('0x9')],'priority':_0x1e5b57[_0x63e1('0x27')]+_0x16e999[_0x63e1('0xf')]+_0x780eda++,'VoiceExtensionId':_0x46ce51[_0x63e1('0x15')]});_0x358a88[_0x63e1('0x17')]({'type':_0x46ce51[_0x63e1('0x12')],'app':_0x63e1('0x18'),'appdata':_0x63e1('0x37'),'context':_0x46ce51['context'],'exten':_0x46ce51['exten'],'priority':_0x1e5b57[_0x63e1('0x27')]+_0x16e999[_0x63e1('0xf')]+_0x780eda++,'VoiceExtensionId':_0x46ce51[_0x63e1('0x15')]});}else{_0x358a88[_0x63e1('0x17')]({'type':_0x46ce51[_0x63e1('0x12')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x46ce51[_0x63e1('0x14')],'exten':_0x46ce51[_0x63e1('0x9')],'priority':_0x1e5b57[_0x63e1('0x27')]+_0x16e999[_0x63e1('0xf')]+_0x780eda++,'VoiceExtensionId':_0x46ce51[_0x63e1('0x15')]});_0x358a88[_0x63e1('0x17')]({'type':_0x46ce51[_0x63e1('0x12')],'app':_0x63e1('0x18'),'appdata':_0x63e1('0x38'),'context':_0x46ce51[_0x63e1('0x14')],'exten':_0x46ce51[_0x63e1('0x9')],'priority':_0x1e5b57[_0x63e1('0x27')]+_0x16e999[_0x63e1('0xf')]+_0x780eda++,'VoiceExtensionId':_0x46ce51[_0x63e1('0x15')]});}}}for(var _0xcbff00=0x0;_0xcbff00<_0x1e5b57['length'];_0xcbff00+=0x1){var _0x15d98e=_0x16e999['priority']+_0x1e5b57[_0x63e1('0x27')];var _0x248954=_0xcbff00===_0x1e5b57[_0x63e1('0x27')]-0x1?_0x16e999[_0x63e1('0xf')]+_0x358a88[_0x63e1('0x27')]+_0x1d3ccf[_0x63e1('0x27')]+0x2:_0x16e999['priority']+_0xcbff00+0x1;_0x358a88['splice'](_0xcbff00,0x0,{'type':_0x46ce51[_0x63e1('0x12')],'app':_0x63e1('0x39'),'appdata':_0x1e5b57[_0xcbff00]+'?'+_0x46ce51[_0x63e1('0x14')]+_0x63e1('0x3a')+_0x15d98e+':'+_0x46ce51[_0x63e1('0x14')]+',${EXTEN},'+_0x248954,'exten':_0x46ce51[_0x63e1('0x9')],'context':_0x46ce51[_0x63e1('0x14')],'priority':_0x16e999[_0x63e1('0xf')]+_0xcbff00,'VoiceExtensionId':_0x569171[_0x532a1c][0x0][_0x63e1('0x15')]});}_0x46ce51[_0x63e1('0xf')]=_0x358a88['length']?_[_0x63e1('0x3b')](_0x358a88)['priority']+0x1:_0x16e999[_0x63e1('0xf')];_0x16e999['priority']=(_0x1d3ccf['length']?_[_0x63e1('0x3b')](_0x1d3ccf)[_0x63e1('0xf')]:_0x46ce51[_0x63e1('0xf')])+0x1;_0x16e999[_0x63e1('0x10')]=_[_0x63e1('0x3c')](_0x16e999[_0x63e1('0x10')],_0x358a88,[_0x46ce51],_0x1d3ccf);}_0x16e999['extensions'][_0x63e1('0x17')]({'type':_0x569171[_0x532a1c][0x0][_0x63e1('0x12')],'app':_0x63e1('0x3d'),'exten':_0x569171[_0x532a1c][0x0][_0x63e1('0x9')],'context':_0x569171[_0x532a1c][0x0][_0x63e1('0x14')],'priority':_0x16e999[_0x63e1('0xf')],'VoiceExtensionId':_0x569171[_0x532a1c][0x0][_0x63e1('0x15')]});_0x1b0499[_0x63e1('0x17')](_0x569171[_0x532a1c][0x0][_0x63e1('0x15')]);_0x515083=_[_0x63e1('0x3c')](_0x515083,_0x16e999[_0x63e1('0x10')]);}}return _0x4c2cf6['transaction'](function(_0x4e8a02){return _0x4c2cf6['models'][_0x63e1('0x5')][_0x63e1('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x1b0499}},'transaction':_0x4e8a02})[_0x63e1('0x3')](function(_0x1c3060){return _0x4c2cf6[_0x63e1('0x1')][_0x63e1('0x5')][_0x63e1('0x3f')](_['sortBy'](_0x515083,_0x63e1('0xf')),{'transaction':_0x4e8a02});});});})['catch'](function(_0x26de5f){console[_0x63e1('0x40')](_0x26de5f);});}exports[_0x63e1('0x41')]=rewrite; \ No newline at end of file +var _0x1dd0=['IntervalId','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','extension','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','length','outbound','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','destroy','bulkCreate','sortBy','catch','error','rewrite','util','Interval','findAll','then','intervals','models','VoiceExtension'];(function(_0x2fa4e0,_0x165e23){var _0x1afcb4=function(_0x350f2e){while(--_0x350f2e){_0x2fa4e0['push'](_0x2fa4e0['shift']());}};_0x1afcb4(++_0x165e23);}(_0x1dd0,0x157));var _0x01dd=function(_0x3b79df,_0x11f95f){_0x3b79df=_0x3b79df-0x0;var _0x7d6985=_0x1dd0[_0x3b79df];return _0x7d6985;};'use strict';var _=require('lodash');var util=require(_0x01dd('0x0'));function rewrite(_0x41772e,_0x335ac7){var _0x3f61b2=this;return _0x41772e['models'][_0x01dd('0x1')][_0x01dd('0x2')]({'raw':!![]})[_0x01dd('0x3')](function(_0x4bdad6){_0x3f61b2[_0x01dd('0x4')]=_0x4bdad6;return _0x41772e[_0x01dd('0x5')][_0x01dd('0x6')][_0x01dd('0x2')]({'where':{'IntervalId':_0x335ac7[_0x01dd('0x7')]},'raw':!![]});})[_0x01dd('0x3')](function(_0x5ef37f){return _0x41772e[_0x01dd('0x5')][_0x01dd('0x6')][_0x01dd('0x2')]({'where':{'exten':{'$in':_['uniq'](_[_0x01dd('0x8')](_0x5ef37f,_0x01dd('0x9')))}},'order':[{'raw':_0x01dd('0xa')}],'raw':!![]});})[_0x01dd('0x3')](function(_0x30e97c){var _0x5ea450=_[_0x01dd('0xb')](_0x30e97c,{'priority':'1'});var _0x197fcd=_[_0x01dd('0xb')](_0x30e97c,{'isApp':0x1});var _0xb98281=_[_0x01dd('0xc')](_0x197fcd,_0x01dd('0x9'));var _0x4cd648=[_0x01dd('0xd'),_0x01dd('0xe')];var _0x182ca7=[];var _0x2c1826=[];for(var _0xf0352d in _0xb98281){if(_0xb98281[_0x01dd('0xf')](_0xf0352d)){_0x3f61b2[_0x01dd('0x10')]=0x2;_0x3f61b2[_0x01dd('0x11')]=[];_0x3f61b2['extension']=_['find'](_0x5ea450,{'exten':_0xb98281[_0xf0352d][0x0][_0x01dd('0x9')]});_0x3f61b2[_0x01dd('0x11')][_0x01dd('0x12')]({'type':_0xb98281[_0xf0352d][0x0][_0x01dd('0x13')],'app':_0x01dd('0x14'),'appdata':util[_0x01dd('0x15')](_0x01dd('0x16'),_0xb98281[_0xf0352d][0x0][_0x01dd('0x13')]),'context':_0xb98281[_0xf0352d][0x0][_0x01dd('0x17')],'exten':_0xb98281[_0xf0352d][0x0][_0x01dd('0x9')],'priority':_0x3f61b2[_0x01dd('0x10')]++,'VoiceExtensionId':_0xb98281[_0xf0352d][0x0][_0x01dd('0x18')]});if(_0xb98281[_0xf0352d][0x0][_0x01dd('0x13')]==='outbound'){if(_0x3f61b2[_0x01dd('0x19')]){_0x3f61b2[_0x01dd('0x11')]['push']({'type':_0xb98281[_0xf0352d][0x0][_0x01dd('0x13')],'app':_0x01dd('0x14'),'appdata':_0x01dd('0x1a')+(_0x3f61b2[_0x01dd('0x19')][_0x01dd('0x1b')]?_0x01dd('0x1c')+_0x3f61b2[_0x01dd('0x19')]['cutdigits']+'}':_0x01dd('0x1d')),'context':_0xb98281[_0xf0352d][0x0][_0x01dd('0x17')],'exten':_0xb98281[_0xf0352d][0x0][_0x01dd('0x9')],'priority':_0x3f61b2[_0x01dd('0x10')]++,'VoiceExtensionId':_0xb98281[_0xf0352d][0x0][_0x01dd('0x18')]});}_0x3f61b2[_0x01dd('0x11')]['push']({'type':_0xb98281[_0xf0352d][0x0][_0x01dd('0x13')],'app':_0x01dd('0x14'),'appdata':_0x01dd('0x1e')+_0xb98281[_0xf0352d][0x0][_0x01dd('0x18')],'context':_0xb98281[_0xf0352d][0x0][_0x01dd('0x17')],'exten':_0xb98281[_0xf0352d][0x0][_0x01dd('0x9')],'priority':_0x3f61b2[_0x01dd('0x10')]++,'VoiceExtensionId':_0xb98281[_0xf0352d][0x0]['VoiceExtensionId']});var _0x54a42a=_0x3f61b2['priority']++;_0x3f61b2['extensions'][_0x01dd('0x12')]({'type':_0xb98281[_0xf0352d][0x0][_0x01dd('0x13')],'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x54a42a+0x2)+_0x01dd('0x1f')+(_0x54a42a+0x1)+')','context':_0xb98281[_0xf0352d][0x0]['context'],'exten':_0xb98281[_0xf0352d][0x0]['exten'],'priority':_0x54a42a,'VoiceExtensionId':_0xb98281[_0xf0352d][0x0][_0x01dd('0x18')]});if(_0x3f61b2['extension']){_0x3f61b2[_0x01dd('0x11')]['push']({'type':_0xb98281[_0xf0352d][0x0][_0x01dd('0x13')],'app':_0x01dd('0x14'),'appdata':_0x3f61b2[_0x01dd('0x19')]['cutdigits']?_0x01dd('0x20')+_0x3f61b2['extension']['cutdigits']+'}':_0x01dd('0x21'),'context':_0xb98281[_0xf0352d][0x0]['context'],'exten':_0xb98281[_0xf0352d][0x0][_0x01dd('0x9')],'priority':_0x3f61b2['priority']++,'VoiceExtensionId':_0xb98281[_0xf0352d][0x0]['VoiceExtensionId']});}_0x3f61b2[_0x01dd('0x11')][_0x01dd('0x12')]({'type':_0xb98281[_0xf0352d][0x0][_0x01dd('0x13')],'app':_0x01dd('0x14'),'appdata':'outboundrouteid='+_0xb98281[_0xf0352d][0x0]['VoiceExtensionId'],'context':_0xb98281[_0xf0352d][0x0][_0x01dd('0x17')],'exten':_0xb98281[_0xf0352d][0x0][_0x01dd('0x9')],'priority':_0x3f61b2['priority']++,'VoiceExtensionId':_0xb98281[_0xf0352d][0x0]['VoiceExtensionId']});if(_0x3f61b2[_0x01dd('0x19')]&&_0x3f61b2[_0x01dd('0x19')]['hasOwnProperty'](_0x01dd('0x22'))&&_0x3f61b2[_0x01dd('0x19')][_0x01dd('0x22')]!==_0x01dd('0x23')){_0x3f61b2[_0x01dd('0x11')][_0x01dd('0x12')]({'type':_0xb98281[_0xf0352d][0x0]['type'],'app':_0x01dd('0x14'),'appdata':_0x01dd('0x24'),'context':_0xb98281[_0xf0352d][0x0]['context'],'exten':_0xb98281[_0xf0352d][0x0]['exten'],'priority':_0x3f61b2['priority']++,'VoiceExtensionId':_0xb98281[_0xf0352d][0x0][_0x01dd('0x18')]});_0x3f61b2[_0x01dd('0x11')]['push']({'type':_0xb98281[_0xf0352d][0x0]['type'],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x3f61b2[_0x01dd('0x19')][_0x01dd('0x22')]||_0x01dd('0x25'),'context':_0xb98281[_0xf0352d][0x0][_0x01dd('0x17')],'exten':_0xb98281[_0xf0352d][0x0][_0x01dd('0x9')],'priority':_0x3f61b2['priority']++,'VoiceExtensionId':_0xb98281[_0xf0352d][0x0][_0x01dd('0x18')]});}}_0x3f61b2[_0x01dd('0x11')][_0x01dd('0x12')]({'type':_0xb98281[_0xf0352d][0x0][_0x01dd('0x13')],'app':_0x01dd('0x14'),'appdata':_0x01dd('0x26'),'context':_0xb98281[_0xf0352d][0x0]['context'],'exten':_0xb98281[_0xf0352d][0x0][_0x01dd('0x9')],'priority':_0x3f61b2['priority']++,'VoiceExtensionId':_0xb98281[_0xf0352d][0x0][_0x01dd('0x18')]});_0x3f61b2[_0x01dd('0x11')][_0x01dd('0x12')]({'type':_0xb98281[_0xf0352d][0x0]['type'],'app':_0x01dd('0x14'),'appdata':_0x01dd('0x27'),'context':_0xb98281[_0xf0352d][0x0][_0x01dd('0x17')],'exten':_0xb98281[_0xf0352d][0x0]['exten'],'priority':_0x3f61b2[_0x01dd('0x10')]++,'VoiceExtensionId':_0xb98281[_0xf0352d][0x0][_0x01dd('0x18')]});_0x3f61b2[_0x01dd('0x11')][_0x01dd('0x12')]({'type':_0xb98281[_0xf0352d][0x0][_0x01dd('0x13')],'app':_0x01dd('0x14'),'appdata':_0x01dd('0x28'),'context':_0xb98281[_0xf0352d][0x0]['context'],'exten':_0xb98281[_0xf0352d][0x0][_0x01dd('0x9')],'priority':_0x3f61b2[_0x01dd('0x10')]++,'VoiceExtensionId':_0xb98281[_0xf0352d][0x0][_0x01dd('0x18')]});for(var _0x18a3ac=0x0,_0x45a64e=0x0;_0x18a3ac<_0xb98281[_0xf0352d]['length'];_0x18a3ac+=0x1,_0x45a64e=0x0){var _0x2e5490=_0xb98281[_0xf0352d][_0x18a3ac];if(_0x2e5490['type']){_0x2e5490[_0x01dd('0x13')]=_0x2e5490[_0x01dd('0x13')][_0x01dd('0x29')]();}var _0x416fb8=[];var _0x485326=[];delete _0x2e5490['id'];delete _0x2e5490['createdAt'];delete _0x2e5490[_0x01dd('0x2a')];var _0xfbe8a4=_0x2e5490[_0x01dd('0x2b')]!==_0x01dd('0x2c')?[_0x2e5490['interval']]:_0x2e5490[_0x01dd('0x7')]?_[_0x01dd('0x8')](_[_0x01dd('0xb')](_0x3f61b2['intervals'],{'IntervalId':_0x2e5490[_0x01dd('0x7')]}),'interval'):[];if(_0x2e5490[_0x01dd('0xf')](_0x01dd('0x2d'))){if(_0x2e5490[_0x01dd('0x2d')]&&_0x2e5490[_0x01dd('0x2d')]!=='--'){_0x416fb8['push']({'type':_0x2e5490[_0x01dd('0x13')],'app':_0x01dd('0x14'),'appdata':_0x01dd('0x2e')+_0x2e5490[_0x01dd('0x2d')],'context':_0x2e5490['context'],'exten':_0x2e5490[_0x01dd('0x9')],'priority':_0xfbe8a4[_0x01dd('0x2f')]+_0x3f61b2[_0x01dd('0x10')]+_0x45a64e++,'VoiceExtensionId':_0x2e5490[_0x01dd('0x18')]});}}if(_0x2e5490['type']===_0x01dd('0x30')&&_0x2e5490[_0x01dd('0xf')]('callerID')){if(_0x2e5490[_0x01dd('0x31')]){_0x416fb8[_0x01dd('0x12')]({'type':_0x2e5490['type'],'app':_0x01dd('0x32'),'appdata':_0x01dd('0x33')+_0x2e5490[_0x01dd('0x31')]+')','context':_0x2e5490['context'],'exten':_0x2e5490['exten'],'priority':_0xfbe8a4['length']+_0x3f61b2['priority']+_0x45a64e++,'VoiceExtensionId':_0x2e5490[_0x01dd('0x18')]});}else{_0x416fb8[_0x01dd('0x12')]({'type':_0x2e5490[_0x01dd('0x13')],'app':'ExecIf','appdata':_0x01dd('0x34'),'context':_0x2e5490[_0x01dd('0x17')],'exten':_0x2e5490['exten'],'priority':_0xfbe8a4[_0x01dd('0x2f')]+_0x3f61b2[_0x01dd('0x10')]+_0x45a64e++,'VoiceExtensionId':_0x2e5490[_0x01dd('0x18')]});}}if(_0x2e5490[_0x01dd('0xf')](_0x01dd('0x35'))){if(_0x4cd648['indexOf'](_0x2e5490['app'][_0x01dd('0x29')]())>=0x0&&_0x2e5490['appType']!==_0x01dd('0x36')){if(_0x2e5490[_0x01dd('0x35')]){_0x416fb8[_0x01dd('0x12')]({'type':_0x2e5490['type'],'app':_0x01dd('0x32'),'appdata':_0x01dd('0x37'),'context':_0x2e5490[_0x01dd('0x17')],'exten':_0x2e5490[_0x01dd('0x9')],'priority':_0xfbe8a4[_0x01dd('0x2f')]+_0x3f61b2['priority']+_0x45a64e++,'VoiceExtensionId':_0x2e5490['VoiceExtensionId']});_0x416fb8['push']({'type':_0x2e5490[_0x01dd('0x13')],'app':_0x01dd('0x14'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x2e5490[_0x01dd('0x17')],'exten':_0x2e5490[_0x01dd('0x9')],'priority':_0xfbe8a4[_0x01dd('0x2f')]+_0x3f61b2[_0x01dd('0x10')]+_0x45a64e++,'VoiceExtensionId':_0x2e5490[_0x01dd('0x18')]});}else{_0x416fb8['push']({'type':_0x2e5490[_0x01dd('0x13')],'app':_0x01dd('0x32'),'appdata':_0x01dd('0x38'),'context':_0x2e5490[_0x01dd('0x17')],'exten':_0x2e5490[_0x01dd('0x9')],'priority':_0xfbe8a4[_0x01dd('0x2f')]+_0x3f61b2[_0x01dd('0x10')]+_0x45a64e++,'VoiceExtensionId':_0x2e5490[_0x01dd('0x18')]});_0x416fb8[_0x01dd('0x12')]({'type':_0x2e5490[_0x01dd('0x13')],'app':_0x01dd('0x14'),'appdata':_0x01dd('0x39'),'context':_0x2e5490[_0x01dd('0x17')],'exten':_0x2e5490[_0x01dd('0x9')],'priority':_0xfbe8a4[_0x01dd('0x2f')]+_0x3f61b2[_0x01dd('0x10')]+_0x45a64e++,'VoiceExtensionId':_0x2e5490[_0x01dd('0x18')]});}}}for(var _0x12c16e=0x0;_0x12c16e<_0xfbe8a4[_0x01dd('0x2f')];_0x12c16e+=0x1){var _0x18bbbb=_0x3f61b2[_0x01dd('0x10')]+_0xfbe8a4['length'];var _0x3b1c19=_0x12c16e===_0xfbe8a4[_0x01dd('0x2f')]-0x1?_0x3f61b2['priority']+_0x416fb8[_0x01dd('0x2f')]+_0x485326[_0x01dd('0x2f')]+0x2:_0x3f61b2[_0x01dd('0x10')]+_0x12c16e+0x1;_0x416fb8[_0x01dd('0x3a')](_0x12c16e,0x0,{'type':_0x2e5490[_0x01dd('0x13')],'app':_0x01dd('0x3b'),'appdata':_0xfbe8a4[_0x12c16e]+'?'+_0x2e5490[_0x01dd('0x17')]+',${EXTEN},'+_0x18bbbb+':'+_0x2e5490[_0x01dd('0x17')]+_0x01dd('0x3c')+_0x3b1c19,'exten':_0x2e5490['exten'],'context':_0x2e5490[_0x01dd('0x17')],'priority':_0x3f61b2[_0x01dd('0x10')]+_0x12c16e,'VoiceExtensionId':_0xb98281[_0xf0352d][0x0][_0x01dd('0x18')]});}_0x2e5490[_0x01dd('0x10')]=_0x416fb8[_0x01dd('0x2f')]?_[_0x01dd('0x3d')](_0x416fb8)['priority']+0x1:_0x3f61b2[_0x01dd('0x10')];_0x3f61b2[_0x01dd('0x10')]=(_0x485326[_0x01dd('0x2f')]?_[_0x01dd('0x3d')](_0x485326)[_0x01dd('0x10')]:_0x2e5490['priority'])+0x1;_0x3f61b2['extensions']=_['concat'](_0x3f61b2[_0x01dd('0x11')],_0x416fb8,[_0x2e5490],_0x485326);}_0x3f61b2['extensions'][_0x01dd('0x12')]({'type':_0xb98281[_0xf0352d][0x0]['type'],'app':_0x01dd('0x3e'),'exten':_0xb98281[_0xf0352d][0x0]['exten'],'context':_0xb98281[_0xf0352d][0x0][_0x01dd('0x17')],'priority':_0x3f61b2['priority'],'VoiceExtensionId':_0xb98281[_0xf0352d][0x0][_0x01dd('0x18')]});_0x182ca7['push'](_0xb98281[_0xf0352d][0x0][_0x01dd('0x18')]);_0x2c1826=_[_0x01dd('0x3f')](_0x2c1826,_0x3f61b2[_0x01dd('0x11')]);}}return _0x41772e['transaction'](function(_0x57ccb5){return _0x41772e[_0x01dd('0x5')][_0x01dd('0x6')][_0x01dd('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x182ca7}},'transaction':_0x57ccb5})[_0x01dd('0x3')](function(_0x4924b3){return _0x41772e[_0x01dd('0x5')][_0x01dd('0x6')][_0x01dd('0x41')](_[_0x01dd('0x42')](_0x2c1826,_0x01dd('0x10')),{'transaction':_0x57ccb5});});});})[_0x01dd('0x43')](function(_0xd23241){console[_0x01dd('0x44')](_0xd23241);});}exports[_0x01dd('0x45')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 5baa33d..5fa520e 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 _0x3103=['cmContact','inspect','insert','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','select','field','scheduledAt','toString','NOW()','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_hopper_final','VoiceQueue','Lists','then','get','always','sequelize','onlyIfOpen','query','VoiceQueueId','findAll','outbound','CmList','BlackLists','all','Campaign','dialCheckDuplicateType','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','emit','resume','resolve','unlinkSync','info','CSV\x20import\x20process\x20stopped!','parse','duplicate','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','papaparse','ioredis','../../../config/logger','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CmContact','create','push','pick','catch','Error\x20while\x20creating\x20contact:\x20'];(function(_0x39451a,_0x10e95f){var _0x1cf0ca=function(_0x19c1d7){while(--_0x19c1d7){_0x39451a['push'](_0x39451a['shift']());}};_0x1cf0ca(++_0x10e95f);}(_0x3103,0x1e4));var _0x3310=function(_0x5debd6,_0x554e98){_0x5debd6=_0x5debd6-0x0;var _0x458cb2=_0x3103[_0x5debd6];return _0x458cb2;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x3310('0x0'));var fs=require('fs');var squel=require(_0x3310('0x1'));var Papa=require(_0x3310('0x2'));var Redis=require(_0x3310('0x3'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0x3310('0x4'))('api');config['redis']=_[_0x3310('0x5')](config[_0x3310('0x6')],{'host':_0x3310('0x7'),'port':0x18eb});var socket=require(_0x3310('0x8'))(new Redis(config[_0x3310('0x6')]));require(_0x3310('0x9'))[_0x3310('0xa')](socket);try{if(!process[_0x3310('0xb')][0x2]||process[_0x3310('0xb')][0x2]===_0x3310('0xc')||process['argv'][0x2]===_0x3310('0xd')){throw new Error(_0x3310('0xe'));}var FILEPATH=process[_0x3310('0xb')][0x2];if(!process[_0x3310('0xb')][0x3]||process[_0x3310('0xb')][0x3]===_0x3310('0xc')||process[_0x3310('0xb')][0x3]===_0x3310('0xd')||!process[_0x3310('0xb')][0x4]||process[_0x3310('0xb')][0x4]===_0x3310('0xc')||process[_0x3310('0xb')][0x4]===_0x3310('0xd')){throw new Error(_0x3310('0xf'));}var FIELDS=_[_0x3310('0x10')](process[_0x3310('0xb')][0x3]['split'](','),process[_0x3310('0xb')][0x4][_0x3310('0x11')](','));if(!process['argv'][0x5]||process[_0x3310('0xb')][0x5]===_0x3310('0xc')||process[_0x3310('0xb')][0x5]===_0x3310('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x3310('0xb')][0x5];var COMPANYID=process[_0x3310('0xb')][0x6]&&process[_0x3310('0xb')][0x6]!==_0x3310('0xc')&&process[_0x3310('0xb')][0x6]!==_0x3310('0xd')?process['argv'][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x3310('0xb')][0x7]!=='undefined'&&process['argv'][0x7]!==_0x3310('0xd')?process[_0x3310('0xb')][0x7]:null;if(!process['argv'][0x8]||process['argv'][0x8]===_0x3310('0xc')||process['argv'][0x8]==='null'){throw new Error(_0x3310('0x12'));}var SOCKET_TIMESTAMP=process[_0x3310('0xb')][0x8];}catch(_0x567704){logger[_0x3310('0x13')](_0x567704);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(_0x5dc7df,_0xcd1e7f,_0x5e3b6e,_0x1bb839){var _0x2185d9={'message':_0xcd1e7f};_0x2185d9[_0x5dc7df]=!![];if(_0x5e3b6e){_0x2185d9[_0x3310('0x14')]=_0x5e3b6e;}if(_0x1bb839){_0x2185d9[_0x3310('0x15')]=_0x1bb839;}return _0x2185d9;}function isEmail(_0x37dd76){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'](_0x37dd76);}function checkRow(_0x2ac8c7,_0xf1cd4f,_0x5f7e12){return new BPromise(function(_0x335f6a,_0x2322de){if(_[_0x3310('0x16')](_0x2ac8c7)){return _0x2322de(handleCheckRowError('error',_0x3310('0x17'),null,_0x5f7e12));}if(_0x2ac8c7[_0x3310('0x18')]&&_0x2ac8c7[_0x3310('0x18')][_0x3310('0x19')]){var _0x586372=_[_0x3310('0x1a')](_0x2ac8c7[_0x3310('0x18')],_0x3310('0x1b'))[_0x3310('0x1c')](';');return _0x2322de(handleCheckRowError(_0x3310('0x13'),_0x586372,null,_0x5f7e12));}var _0x38f7b8={};for(var _0xe4fc17 in FIELDS){if(FIELDS[_0x3310('0x1d')](_0xe4fc17)&&FIELDS[_0xe4fc17]){_0x38f7b8[_0xe4fc17]=_0x2ac8c7[_0x3310('0x1e')][0x0][FIELDS[_0xe4fc17]]||_0x2ac8c7[_0x3310('0x1e')][0x0]['\ufeff'+FIELDS[_0xe4fc17]];}}if(!_0x38f7b8[_0x3310('0x1f')]){return _0x2322de(handleCheckRowError('error',_0x3310('0x20'),null,_0x5f7e12));}if(!_0x38f7b8[_0x3310('0x21')]){return _0x2322de(handleCheckRowError(_0x3310('0x13'),_0x3310('0x22'),null,_0x5f7e12));}if(_0x38f7b8[_0x3310('0x23')]){var _0x19950c=moment(_0x38f7b8[_0x3310('0x23')],_0x3310('0x24'));if(!_0x19950c['isValid']()){return _0x2322de(handleCheckRowError(_0x3310('0x13'),_0x3310('0x25'),null,_0x5f7e12));}}if(_0x38f7b8[_0x3310('0x26')]){if(!isEmail(_0x38f7b8['email'])){return _0x2322de(handleCheckRowError(_0x3310('0x13'),_0x3310('0x27'),null,_0x5f7e12));}}_0x38f7b8['ListId']=LISTID;_0x38f7b8['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x3310('0x19')]&&_0xf1cd4f){var _0x1c095f={};for(var _0x47a047=0x0,_0xf4fdda=DUPLICATES[_0x3310('0x19')];_0x47a047<_0xf4fdda;_0x47a047+=0x1){_0x1c095f[DUPLICATES[_0x47a047]]=_0x38f7b8[DUPLICATES[_0x47a047]];}var _0x1b9209=_['find'](_0xf1cd4f,_0x1c095f);if(_0x1b9209){return _0x2322de(handleCheckRowError('duplicate','Duplicate\x20Contact',_0x1b9209,_0x5f7e12));}}return db[_0x3310('0x28')][_0x3310('0x29')](_0x38f7b8,{'raw':!![],'hooks':![],'fields':_['keys'](_0x38f7b8)})['then'](function(_0xff57a3){if(DUPLICATES&&DUPLICATES[_0x3310('0x19')]&&_0xf1cd4f){_0xf1cd4f[_0x3310('0x2a')](_[_0x3310('0x2b')](_0x38f7b8,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xff57a3['id'];return _0x335f6a();})[_0x3310('0x2c')](function(_0x5758ce){return _0x2322de(handleCheckRowError('error',_0x3310('0x2d')+(_0x5758ce[_0x3310('0x1b')]||JSON['stringify'](_0x5758ce)),null,_0x5f7e12));});});}function checkHopper(){function _0x4f3b73(){return function(_0xeae103){logger['error'](_0x3310('0x2e'),'checkHopper',util[_0x3310('0x2f')](_0xeae103,{'showHidden':![],'depth':null}));};}var _0x773743=function(_0x2d0a4b,_0x212b71){var _0x57f387=squel[_0x3310('0x30')]()[_0x3310('0x31')](_0x3310('0x32'))[_0x3310('0x33')]([_0x3310('0x21'),'scheduledAt',_0x3310('0x34'),_0x3310('0x35'),_0x212b71,_0x3310('0x36'),_0x3310('0x37')],squel[_0x3310('0x38')]()[_0x3310('0x39')](_0x3310('0x21'),_0x3310('0x21'))[_0x3310('0x39')]('NOW()',_0x3310('0x3a'))[_0x3310('0x39')]('id','ContactId')[_0x3310('0x39')](LISTID[_0x3310('0x3b')](),_0x3310('0x35'))[_0x3310('0x39')](_0x2d0a4b['id'][_0x3310('0x3b')](),_0x212b71)[_0x3310('0x39')](_0x3310('0x3c'),'createdAt')[_0x3310('0x39')](_0x3310('0x3c'),_0x3310('0x37'))[_0x3310('0x3d')](_0x3310('0x3e'))[_0x3310('0x3f')](_0x3310('0x40'))[_0x3310('0x3f')](_0x3310('0x41'),LISTID[_0x3310('0x3b')]())['where'](_0x3310('0x42'))[_0x3310('0x3f')](_0x3310('0x43'),squel[_0x3310('0x38')]()[_0x3310('0x39')](_0x3310('0x21'))['from'](_0x3310('0x32'))[_0x3310('0x3f')](_0x212b71+_0x3310('0x44'),_0x2d0a4b['id']['toString']())))['toString']();return _0x57f387;};var _0x49deeb=function(_0x2612c3,_0x19c6cd){var _0xb5717=squel[_0x3310('0x30')]()[_0x3310('0x31')](_0x3310('0x32'))[_0x3310('0x33')]([_0x3310('0x21'),'scheduledAt',_0x3310('0x34'),_0x3310('0x35'),_0x19c6cd,'createdAt',_0x3310('0x37')],squel[_0x3310('0x38')]()[_0x3310('0x39')](_0x3310('0x21'),_0x3310('0x21'))['field'](_0x3310('0x3c'),_0x3310('0x3a'))[_0x3310('0x39')]('id',_0x3310('0x34'))[_0x3310('0x39')](LISTID['toString'](),_0x3310('0x35'))[_0x3310('0x39')](_0x2612c3['id'][_0x3310('0x3b')](),_0x19c6cd)[_0x3310('0x39')](_0x3310('0x3c'),_0x3310('0x36'))['field'](_0x3310('0x3c'),'updatedAt')['from'](_0x3310('0x3e'))[_0x3310('0x3f')](_0x3310('0x40'))[_0x3310('0x3f')]('ListId\x20=\x20?',LISTID[_0x3310('0x3b')]())['where'](_0x3310('0x45'),squel[_0x3310('0x46')](hopperContacts))[_0x3310('0x3f')](_0x3310('0x42'))[_0x3310('0x3f')](_0x3310('0x43'),squel[_0x3310('0x38')]()[_0x3310('0x39')](_0x3310('0x47'))[_0x3310('0x3d')](_0x3310('0x48'))[_0x3310('0x3f')](_0x19c6cd+_0x3310('0x44'),_0x2612c3['id']['toString']()))[_0x3310('0x3f')](_0x3310('0x43'),squel[_0x3310('0x38')]()[_0x3310('0x39')](_0x3310('0x21'))[_0x3310('0x3d')](_0x3310('0x32'))[_0x3310('0x3f')](_0x19c6cd+_0x3310('0x44'),_0x2612c3['id'][_0x3310('0x3b')]())))['toString']();return _0xb5717;};function _0x303ef8(_0x9d9d0b,_0x4cd1b2){var _0x5bfa61=squel[_0x3310('0x30')]()[_0x3310('0x31')](_0x3310('0x32'))[_0x3310('0x33')]([_0x3310('0x21'),_0x3310('0x3a'),_0x3310('0x34'),_0x3310('0x35'),_0x4cd1b2,_0x3310('0x36'),_0x3310('0x37')],squel[_0x3310('0x38')]()[_0x3310('0x39')](_0x3310('0x21'),_0x3310('0x21'))[_0x3310('0x39')](_0x3310('0x3c'),'scheduledAt')[_0x3310('0x39')]('id',_0x3310('0x34'))[_0x3310('0x39')](LISTID[_0x3310('0x3b')](),_0x3310('0x35'))['field'](_0x9d9d0b['id']['toString'](),_0x4cd1b2)['field'](_0x3310('0x3c'),_0x3310('0x36'))[_0x3310('0x39')](_0x3310('0x3c'),_0x3310('0x37'))[_0x3310('0x3d')](_0x3310('0x3e'))[_0x3310('0x3f')]('deletedAt\x20IS\x20NULL')[_0x3310('0x3f')](_0x3310('0x41'),LISTID[_0x3310('0x3b')]())[_0x3310('0x3f')](_0x3310('0x45'),squel[_0x3310('0x46')](hopperContacts))[_0x3310('0x3f')]('phone\x20IS\x20NOT\x20NULL'))[_0x3310('0x3b')]();return _0x5bfa61;}function _0x25d191(_0x3e3651,_0x1b6b7c){var _0x53f2f3=squel[_0x3310('0x30')]()[_0x3310('0x31')]('cm_hopper_black')['fromQuery']([_0x3310('0x21'),_0x3310('0x34'),_0x3310('0x35'),_0x1b6b7c,'createdAt',_0x3310('0x37')],squel[_0x3310('0x38')]()[_0x3310('0x39')](_0x3310('0x21'),_0x3310('0x21'))['field']('id',_0x3310('0x34'))['field'](LISTID[_0x3310('0x3b')](),'ListId')['field'](_0x3e3651['id'][_0x3310('0x3b')](),_0x1b6b7c)[_0x3310('0x39')](_0x3310('0x3c'),_0x3310('0x36'))[_0x3310('0x39')](_0x3310('0x3c'),_0x3310('0x37'))[_0x3310('0x3d')](_0x3310('0x3e'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x3310('0x41'),LISTID[_0x3310('0x3b')]())[_0x3310('0x3f')](_0x3310('0x45'),squel[_0x3310('0x46')](hopperContacts))[_0x3310('0x3f')](_0x3310('0x42')))['toString']();return _0x53f2f3;}return db[_0x3310('0x49')]['findAll']({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x3310('0x4a'),'where':{'id':LISTID}}]})[_0x3310('0x4b')](function(_0x508963){var _0x116fbc=[];if(_0x508963){var _0x54b619;for(var _0x2e32b6=0x0,_0x51f68f;_0x2e32b6<_0x508963['length'];_0x2e32b6+=0x1){_0x51f68f=_0x508963[_0x2e32b6][_0x3310('0x4c')]({'plain':!![]});switch(_0x51f68f['dialCheckDuplicateType']){case _0x3310('0x4d'):_0x116fbc[_0x3310('0x2a')](db[_0x3310('0x4e')]['query'](_0x49deeb(_0x51f68f,'VoiceQueueId'))['then'](function(){})[_0x3310('0x2c')](_0x4f3b73()));break;case _0x3310('0x4f'):_0x116fbc[_0x3310('0x2a')](db['sequelize'][_0x3310('0x50')](_0x773743(_0x51f68f,_0x3310('0x51')))[_0x3310('0x4b')](function(){})[_0x3310('0x2c')](_0x4f3b73()));break;default:_0x116fbc[_0x3310('0x2a')](db['sequelize']['query'](_0x303ef8(_0x51f68f,_0x3310('0x51')))['then'](function(){})['catch'](_0x4f3b73()));}}}return _0x116fbc;})['all']()['then'](function(){return db[_0x3310('0x49')][_0x3310('0x52')]({'where':{'type':_0x3310('0x53')},'attributes':['id'],'include':[{'model':db[_0x3310('0x54')],'as':_0x3310('0x55'),'where':{'id':LISTID}}]})[_0x3310('0x4b')](function(_0x2055cb){var _0x470d69=[];if(_0x2055cb){var _0x59a94d;for(var _0x4a377f=0x0,_0x3c7404;_0x4a377f<_0x2055cb[_0x3310('0x19')];_0x4a377f+=0x1){_0x3c7404=_0x2055cb[_0x4a377f]['get']({'plain':!![]});_0x470d69['push'](db[_0x3310('0x4e')][_0x3310('0x50')](_0x25d191(_0x3c7404,_0x3310('0x51')))['then'](function(){})[_0x3310('0x2c')](_0x4f3b73()));}}return _0x470d69;})[_0x3310('0x56')]();})[_0x3310('0x4b')](function(){return db[_0x3310('0x57')]['findAll']({'attributes':['id',_0x3310('0x58')],'include':[{'model':db['CmList'],'as':_0x3310('0x4a'),'where':{'id':LISTID}}]})[_0x3310('0x4b')](function(_0x12f1cc){var _0x4f1776=[];if(_0x12f1cc){for(var _0x3d9d97=0x0,_0x48cdd1;_0x3d9d97<_0x12f1cc[_0x3310('0x19')];_0x3d9d97+=0x1){_0x48cdd1=_0x12f1cc[_0x3d9d97][_0x3310('0x4c')]({'plain':!![]});switch(_0x48cdd1[_0x3310('0x58')]){case _0x3310('0x4d'):_0x4f1776['push'](db[_0x3310('0x4e')][_0x3310('0x50')](_0x49deeb(_0x48cdd1,_0x3310('0x59')))[_0x3310('0x4b')](function(){})[_0x3310('0x2c')](_0x4f3b73()));break;case _0x3310('0x4f'):_0x4f1776[_0x3310('0x2a')](db[_0x3310('0x4e')][_0x3310('0x50')](_0x773743(_0x48cdd1,'CampaignId'))[_0x3310('0x4b')](function(){})[_0x3310('0x2c')](_0x4f3b73()));break;default:_0x4f1776['push'](db[_0x3310('0x4e')][_0x3310('0x50')](_0x303ef8(_0x48cdd1,_0x3310('0x59')))['then'](function(){})[_0x3310('0x2c')](_0x4f3b73()));}}}return _0x4f1776;})[_0x3310('0x56')]();})[_0x3310('0x4b')](function(){return db[_0x3310('0x57')][_0x3310('0x52')]({'attributes':['id'],'include':[{'model':db[_0x3310('0x54')],'as':_0x3310('0x55'),'where':{'id':LISTID}}]})[_0x3310('0x4b')](function(_0x51d697){var _0x550dbb=[];if(_0x51d697){for(var _0x13a303=0x0,_0x500ce6;_0x13a303<_0x51d697['length'];_0x13a303+=0x1){_0x500ce6=_0x51d697[_0x13a303][_0x3310('0x4c')]({'plain':!![]});_0x550dbb[_0x3310('0x2a')](db[_0x3310('0x4e')]['query'](_0x25d191(_0x500ce6,_0x3310('0x59')))[_0x3310('0x4b')](function(){})['catch'](_0x4f3b73()));}}return _0x550dbb;})['all']();})[_0x3310('0x2c')](function(_0x11603d){logger['error'](_0x3310('0x5a'),_0x3310('0x5b'),_0x11603d[_0x3310('0x1b')]);});}var processPromises=function(_0x39ed1e){return BPromise[_0x3310('0x56')](promises)[_0x3310('0x4b')](function(_0x4b84eb){})[_0x3310('0x2c')](function(_0x34bce4){logger[_0x3310('0x13')](_0x3310('0x5c'),JSON[_0x3310('0x5d')](_0x34bce4));})[_0x3310('0x5e')](function(){socket[_0x3310('0x5f')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x39ed1e){return _0x39ed1e[_0x3310('0x60')]();}});};var endCsv=function(){return BPromise[_0x3310('0x61')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x3310('0x4b')](function(){socket[_0x3310('0x5f')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x3310('0x62')](FILEPATH);}catch(_0xfdadaa){logger[_0x3310('0x13')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x3310('0x5d')](_0xfdadaa));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0x3310('0x63')](_0x3310('0x64'));endCsv();});function main(){return BPromise[_0x3310('0x61')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x3310('0x11')](',');return db['CmContact']['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x3310('0x4b')](function(_0x3997e8){var _0x4ba2f1=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x3310('0x65')](_0x4ba2f1,{'header':!![],'skipEmptyLines':!![],'step':function(_0x16ff70,_0x2f85a8){total+=0x1;var _0x1dcbf3=total;promises[_0x3310('0x2a')](checkRow(_0x16ff70,_0x3997e8,_0x1dcbf3)[_0x3310('0x4b')](function(){success+=0x1;})[_0x3310('0x2c')](function(_0x3e7d64){if(_0x3e7d64[_0x3310('0x13')]){errors+=0x1;delete _0x3e7d64[_0x3310('0x13')];}else if(_0x3e7d64['duplicate']){duplicates+=0x1;delete _0x3e7d64[_0x3310('0x66')];}rows[_0x3310('0x2a')](_0x3e7d64);}));if(total%0xc8===0x0){_0x2f85a8[_0x3310('0x67')]();return processPromises(_0x2f85a8);}},'complete':function(){return processPromises()[_0x3310('0x4b')](function(){logger[_0x3310('0x63')](_0x3310('0x68'));endCsv();});},'error':function(_0x1bdce6,_0x2c1edc){logger[_0x3310('0x63')]('CSV\x20parse\x20error',JSON[_0x3310('0x5d')](_0x1bdce6));endCsv();}});})['catch'](function(_0x2a6229){logger[_0x3310('0x13')](_0x3310('0x69'),JSON[_0x3310('0x5d')](_0x2a6229));});}main(); \ No newline at end of file +var _0x15c9=['ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','get','dialCheckDuplicateType','sequelize','query','VoiceQueueId','onlyIfOpen','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','parse','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','../../../mysqldb','redis','localhost','register','argv','null','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','join','hasOwnProperty','data','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','duplicate','CmContact','then','push','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','checkHopper','inspect','insert','into','cm_hopper','fromQuery','phone','scheduledAt'];(function(_0x11f0e3,_0x5170bc){var _0x2892e8=function(_0x3292b2){while(--_0x3292b2){_0x11f0e3['push'](_0x11f0e3['shift']());}};_0x2892e8(++_0x5170bc);}(_0x15c9,0x102));var _0x915c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x15c9[_0x2641f9];return _0x585741;};'use strict';var BPromise=require(_0x915c('0x0'));var util=require(_0x915c('0x1'));var _=require(_0x915c('0x2'));var fs=require('fs');var squel=require(_0x915c('0x3'));var Papa=require(_0x915c('0x4'));var Redis=require('ioredis');var db=require(_0x915c('0x5'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')('api');config[_0x915c('0x6')]=_['defaults'](config[_0x915c('0x6')],{'host':_0x915c('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x915c('0x6')]));require('../../../api/cmContact/cmContact.socket')[_0x915c('0x8')](socket);try{if(!process[_0x915c('0x9')][0x2]||process[_0x915c('0x9')][0x2]==='undefined'||process[_0x915c('0x9')][0x2]===_0x915c('0xa')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process[_0x915c('0x9')][0x3]===_0x915c('0xb')||process[_0x915c('0x9')][0x3]==='null'||!process[_0x915c('0x9')][0x4]||process[_0x915c('0x9')][0x4]==='undefined'||process[_0x915c('0x9')][0x4]===_0x915c('0xa')){throw new Error(_0x915c('0xc'));}var FIELDS=_[_0x915c('0xd')](process[_0x915c('0x9')][0x3][_0x915c('0xe')](','),process[_0x915c('0x9')][0x4][_0x915c('0xe')](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0x915c('0xb')||process[_0x915c('0x9')][0x5]===_0x915c('0xa')){throw new Error(_0x915c('0xf'));}var LISTID=process[_0x915c('0x9')][0x5];var COMPANYID=process[_0x915c('0x9')][0x6]&&process[_0x915c('0x9')][0x6]!=='undefined'&&process[_0x915c('0x9')][0x6]!==_0x915c('0xa')?process[_0x915c('0x9')][0x6]:null;var DUPLICATES=process[_0x915c('0x9')][0x7]&&process['argv'][0x7]!==_0x915c('0xb')&&process[_0x915c('0x9')][0x7]!=='null'?process[_0x915c('0x9')][0x7]:null;if(!process[_0x915c('0x9')][0x8]||process['argv'][0x8]==='undefined'||process[_0x915c('0x9')][0x8]==='null'){throw new Error(_0x915c('0x10'));}var SOCKET_TIMESTAMP=process[_0x915c('0x9')][0x8];}catch(_0x193974){logger[_0x915c('0x11')](_0x193974);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(_0x4fd7a1,_0x3c96fc,_0x4f18ac,_0x4c23a8){var _0xb8bbd1={'message':_0x3c96fc};_0xb8bbd1[_0x4fd7a1]=!![];if(_0x4f18ac){_0xb8bbd1['contact']=_0x4f18ac;}if(_0x4c23a8){_0xb8bbd1[_0x915c('0x12')]=_0x4c23a8;}return _0xb8bbd1;}function isEmail(_0x37cb3b){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))*$/[_0x915c('0x13')](_0x37cb3b);}function checkRow(_0x57740a,_0x4649af,_0xb4d5ae){return new BPromise(function(_0x4bcb78,_0x2c7ba1){if(_[_0x915c('0x14')](_0x57740a)){return _0x2c7ba1(handleCheckRowError('error',_0x915c('0x15'),null,_0xb4d5ae));}if(_0x57740a['errors']&&_0x57740a[_0x915c('0x16')][_0x915c('0x17')]){var _0x21d20c=_['map'](_0x57740a[_0x915c('0x16')],'message')[_0x915c('0x18')](';');return _0x2c7ba1(handleCheckRowError(_0x915c('0x11'),_0x21d20c,null,_0xb4d5ae));}var _0x459d99={};for(var _0x282ab6 in FIELDS){if(FIELDS[_0x915c('0x19')](_0x282ab6)&&FIELDS[_0x282ab6]){_0x459d99[_0x282ab6]=_0x57740a['data'][0x0][FIELDS[_0x282ab6]]||_0x57740a[_0x915c('0x1a')][0x0]['\ufeff'+FIELDS[_0x282ab6]];}}if(!_0x459d99['firstName']){return _0x2c7ba1(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0xb4d5ae));}if(!_0x459d99['phone']){return _0x2c7ba1(handleCheckRowError(_0x915c('0x11'),_0x915c('0x1b'),null,_0xb4d5ae));}if(_0x459d99[_0x915c('0x1c')]){var _0xbeb445=moment(_0x459d99[_0x915c('0x1c')],_0x915c('0x1d'));if(!_0xbeb445[_0x915c('0x1e')]()){return _0x2c7ba1(handleCheckRowError('error',_0x915c('0x1f'),null,_0xb4d5ae));}}if(_0x459d99[_0x915c('0x20')]){if(!isEmail(_0x459d99['email'])){return _0x2c7ba1(handleCheckRowError('error','email\x20format\x20is\x20not\x20valid!',null,_0xb4d5ae));}}_0x459d99[_0x915c('0x21')]=LISTID;_0x459d99[_0x915c('0x22')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x915c('0x17')]&&_0x4649af){var _0x347342={};for(var _0x5c7db5=0x0,_0x5dcb5e=DUPLICATES[_0x915c('0x17')];_0x5c7db5<_0x5dcb5e;_0x5c7db5+=0x1){_0x347342[DUPLICATES[_0x5c7db5]]=_0x459d99[DUPLICATES[_0x5c7db5]];}var _0x3cc2de=_['find'](_0x4649af,_0x347342);if(_0x3cc2de){return _0x2c7ba1(handleCheckRowError(_0x915c('0x23'),'Duplicate\x20Contact',_0x3cc2de,_0xb4d5ae));}}return db[_0x915c('0x24')]['create'](_0x459d99,{'raw':!![],'hooks':![],'fields':_['keys'](_0x459d99)})[_0x915c('0x25')](function(_0x4487eb){if(DUPLICATES&&DUPLICATES['length']&&_0x4649af){_0x4649af[_0x915c('0x26')](_['pick'](_0x459d99,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4487eb['id'];return _0x4bcb78();})[_0x915c('0x27')](function(_0x46ad6b){return _0x2c7ba1(handleCheckRowError('error',_0x915c('0x28')+(_0x46ad6b[_0x915c('0x29')]||JSON[_0x915c('0x2a')](_0x46ad6b)),null,_0xb4d5ae));});});}function checkHopper(){function _0x295016(){return function(_0xa25746){logger[_0x915c('0x11')]('cmContact',_0x915c('0x2b'),util[_0x915c('0x2c')](_0xa25746,{'showHidden':![],'depth':null}));};}var _0x455956=function(_0x1f115d,_0x192b53){var _0x4011db=squel[_0x915c('0x2d')]()[_0x915c('0x2e')](_0x915c('0x2f'))[_0x915c('0x30')]([_0x915c('0x31'),_0x915c('0x32'),_0x915c('0x33'),_0x915c('0x21'),_0x192b53,_0x915c('0x34'),_0x915c('0x35')],squel[_0x915c('0x36')]()['field'](_0x915c('0x31'),_0x915c('0x31'))[_0x915c('0x37')](_0x915c('0x38'),'scheduledAt')[_0x915c('0x37')]('id',_0x915c('0x33'))[_0x915c('0x37')](LISTID[_0x915c('0x39')](),_0x915c('0x21'))[_0x915c('0x37')](_0x1f115d['id'][_0x915c('0x39')](),_0x192b53)[_0x915c('0x37')](_0x915c('0x38'),_0x915c('0x34'))[_0x915c('0x37')](_0x915c('0x38'),_0x915c('0x35'))[_0x915c('0x3a')](_0x915c('0x3b'))['where'](_0x915c('0x3c'))[_0x915c('0x3d')](_0x915c('0x3e'),LISTID['toString']())['where'](_0x915c('0x3f'))[_0x915c('0x3d')](_0x915c('0x40'),squel[_0x915c('0x36')]()['field'](_0x915c('0x31'))['from'](_0x915c('0x2f'))[_0x915c('0x3d')](_0x192b53+_0x915c('0x41'),_0x1f115d['id'][_0x915c('0x39')]())))[_0x915c('0x39')]();return _0x4011db;};var _0x1a7999=function(_0x3c11ca,_0x5ac716){var _0x3a9f54=squel[_0x915c('0x2d')]()[_0x915c('0x2e')](_0x915c('0x2f'))['fromQuery']([_0x915c('0x31'),'scheduledAt',_0x915c('0x33'),'ListId',_0x5ac716,_0x915c('0x34'),_0x915c('0x35')],squel[_0x915c('0x36')]()['field'](_0x915c('0x31'),'phone')['field']('NOW()',_0x915c('0x32'))[_0x915c('0x37')]('id',_0x915c('0x33'))[_0x915c('0x37')](LISTID[_0x915c('0x39')](),_0x915c('0x21'))[_0x915c('0x37')](_0x3c11ca['id']['toString'](),_0x5ac716)['field'](_0x915c('0x38'),_0x915c('0x34'))[_0x915c('0x37')](_0x915c('0x38'),'updatedAt')[_0x915c('0x3a')](_0x915c('0x3b'))['where'](_0x915c('0x3c'))[_0x915c('0x3d')](_0x915c('0x3e'),LISTID['toString']())[_0x915c('0x3d')](_0x915c('0x42'),squel[_0x915c('0x43')](hopperContacts))[_0x915c('0x3d')](_0x915c('0x3f'))[_0x915c('0x3d')](_0x915c('0x40'),squel[_0x915c('0x36')]()['field'](_0x915c('0x44'))[_0x915c('0x3a')](_0x915c('0x45'))[_0x915c('0x3d')](_0x5ac716+_0x915c('0x41'),_0x3c11ca['id']['toString']()))[_0x915c('0x3d')](_0x915c('0x40'),squel[_0x915c('0x36')]()['field'](_0x915c('0x31'))[_0x915c('0x3a')](_0x915c('0x2f'))[_0x915c('0x3d')](_0x5ac716+_0x915c('0x41'),_0x3c11ca['id']['toString']())))[_0x915c('0x39')]();return _0x3a9f54;};function _0x31a178(_0x38726d,_0x152639){var _0x452591=squel[_0x915c('0x2d')]()['into']('cm_hopper')[_0x915c('0x30')]([_0x915c('0x31'),'scheduledAt',_0x915c('0x33'),_0x915c('0x21'),_0x152639,_0x915c('0x34'),'updatedAt'],squel[_0x915c('0x36')]()['field'](_0x915c('0x31'),_0x915c('0x31'))[_0x915c('0x37')](_0x915c('0x38'),_0x915c('0x32'))[_0x915c('0x37')]('id','ContactId')[_0x915c('0x37')](LISTID[_0x915c('0x39')](),_0x915c('0x21'))['field'](_0x38726d['id'][_0x915c('0x39')](),_0x152639)[_0x915c('0x37')](_0x915c('0x38'),_0x915c('0x34'))[_0x915c('0x37')](_0x915c('0x38'),_0x915c('0x35'))[_0x915c('0x3a')](_0x915c('0x3b'))['where'](_0x915c('0x3c'))[_0x915c('0x3d')](_0x915c('0x3e'),LISTID[_0x915c('0x39')]())[_0x915c('0x3d')](_0x915c('0x42'),squel[_0x915c('0x43')](hopperContacts))[_0x915c('0x3d')](_0x915c('0x3f')))[_0x915c('0x39')]();return _0x452591;}function _0x34e82(_0x3d2510,_0x402280){var _0x15cb53=squel['insert']()[_0x915c('0x2e')](_0x915c('0x46'))[_0x915c('0x30')]([_0x915c('0x31'),_0x915c('0x33'),_0x915c('0x21'),_0x402280,'createdAt',_0x915c('0x35')],squel[_0x915c('0x36')]()[_0x915c('0x37')]('phone',_0x915c('0x31'))[_0x915c('0x37')]('id',_0x915c('0x33'))[_0x915c('0x37')](LISTID['toString'](),_0x915c('0x21'))[_0x915c('0x37')](_0x3d2510['id'][_0x915c('0x39')](),_0x402280)[_0x915c('0x37')](_0x915c('0x38'),'createdAt')[_0x915c('0x37')](_0x915c('0x38'),_0x915c('0x35'))[_0x915c('0x3a')](_0x915c('0x3b'))[_0x915c('0x3d')](_0x915c('0x3c'))[_0x915c('0x3d')](_0x915c('0x3e'),LISTID[_0x915c('0x39')]())['where']('id\x20IN\x20?',squel[_0x915c('0x43')](hopperContacts))[_0x915c('0x3d')]('phone\x20IS\x20NOT\x20NULL'))[_0x915c('0x39')]();return _0x15cb53;}return db[_0x915c('0x47')][_0x915c('0x48')]({'where':{'type':_0x915c('0x49')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x915c('0x4a')],'as':_0x915c('0x4b'),'where':{'id':LISTID}}]})[_0x915c('0x25')](function(_0x179627){var _0x2aa5ad=[];if(_0x179627){var _0x118144;for(var _0x31002e=0x0,_0x381b1b;_0x31002e<_0x179627[_0x915c('0x17')];_0x31002e+=0x1){_0x381b1b=_0x179627[_0x31002e][_0x915c('0x4c')]({'plain':!![]});switch(_0x381b1b[_0x915c('0x4d')]){case'always':_0x2aa5ad[_0x915c('0x26')](db[_0x915c('0x4e')][_0x915c('0x4f')](_0x1a7999(_0x381b1b,_0x915c('0x50')))[_0x915c('0x25')](function(){})[_0x915c('0x27')](_0x295016()));break;case _0x915c('0x51'):_0x2aa5ad[_0x915c('0x26')](db[_0x915c('0x4e')]['query'](_0x455956(_0x381b1b,_0x915c('0x50')))['then'](function(){})[_0x915c('0x27')](_0x295016()));break;default:_0x2aa5ad[_0x915c('0x26')](db[_0x915c('0x4e')][_0x915c('0x4f')](_0x31a178(_0x381b1b,_0x915c('0x50')))[_0x915c('0x25')](function(){})[_0x915c('0x27')](_0x295016()));}}}return _0x2aa5ad;})[_0x915c('0x52')]()[_0x915c('0x25')](function(){return db[_0x915c('0x47')][_0x915c('0x48')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x915c('0x53'),'where':{'id':LISTID}}]})[_0x915c('0x25')](function(_0x50f944){var _0x3ebf78=[];if(_0x50f944){var _0x501cc1;for(var _0x1e9d25=0x0,_0x310ca0;_0x1e9d25<_0x50f944['length'];_0x1e9d25+=0x1){_0x310ca0=_0x50f944[_0x1e9d25][_0x915c('0x4c')]({'plain':!![]});_0x3ebf78[_0x915c('0x26')](db['sequelize'][_0x915c('0x4f')](_0x34e82(_0x310ca0,_0x915c('0x50')))['then'](function(){})['catch'](_0x295016()));}}return _0x3ebf78;})[_0x915c('0x52')]();})['then'](function(){return db[_0x915c('0x54')][_0x915c('0x48')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x915c('0x4a')],'as':_0x915c('0x4b'),'where':{'id':LISTID}}]})[_0x915c('0x25')](function(_0x13861c){var _0x408f8b=[];if(_0x13861c){for(var _0x352630=0x0,_0x5d45eb;_0x352630<_0x13861c[_0x915c('0x17')];_0x352630+=0x1){_0x5d45eb=_0x13861c[_0x352630][_0x915c('0x4c')]({'plain':!![]});switch(_0x5d45eb['dialCheckDuplicateType']){case'always':_0x408f8b[_0x915c('0x26')](db[_0x915c('0x4e')][_0x915c('0x4f')](_0x1a7999(_0x5d45eb,_0x915c('0x55')))[_0x915c('0x25')](function(){})[_0x915c('0x27')](_0x295016()));break;case _0x915c('0x51'):_0x408f8b['push'](db[_0x915c('0x4e')][_0x915c('0x4f')](_0x455956(_0x5d45eb,_0x915c('0x55')))[_0x915c('0x25')](function(){})[_0x915c('0x27')](_0x295016()));break;default:_0x408f8b[_0x915c('0x26')](db[_0x915c('0x4e')][_0x915c('0x4f')](_0x31a178(_0x5d45eb,_0x915c('0x55')))['then'](function(){})[_0x915c('0x27')](_0x295016()));}}}return _0x408f8b;})[_0x915c('0x52')]();})[_0x915c('0x25')](function(){return db[_0x915c('0x54')][_0x915c('0x48')]({'attributes':['id'],'include':[{'model':db[_0x915c('0x4a')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x915c('0x25')](function(_0x220ffe){var _0x33876d=[];if(_0x220ffe){for(var _0x3c25da=0x0,_0x3eb466;_0x3c25da<_0x220ffe[_0x915c('0x17')];_0x3c25da+=0x1){_0x3eb466=_0x220ffe[_0x3c25da][_0x915c('0x4c')]({'plain':!![]});_0x33876d[_0x915c('0x26')](db[_0x915c('0x4e')][_0x915c('0x4f')](_0x34e82(_0x3eb466,_0x915c('0x55')))[_0x915c('0x25')](function(){})[_0x915c('0x27')](_0x295016()));}}return _0x33876d;})['all']();})[_0x915c('0x27')](function(_0x3b303c){logger[_0x915c('0x11')](_0x915c('0x56'),_0x915c('0x57'),_0x3b303c[_0x915c('0x29')]);});}var processPromises=function(_0x2479f0){return BPromise[_0x915c('0x52')](promises)['then'](function(_0x45690f){})[_0x915c('0x27')](function(_0x12e8e6){logger[_0x915c('0x11')](_0x915c('0x58'),JSON[_0x915c('0x2a')](_0x12e8e6));})['finally'](function(){socket[_0x915c('0x59')](_0x915c('0x5a')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2479f0){return _0x2479f0[_0x915c('0x5b')]();}});};var endCsv=function(){return BPromise[_0x915c('0x5c')]()[_0x915c('0x25')](function(){if(hopperContacts){return checkHopper();}})[_0x915c('0x25')](function(){socket[_0x915c('0x59')](_0x915c('0x5a')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x915c('0x5d')](FILEPATH);}catch(_0x336ac4){logger[_0x915c('0x11')](_0x915c('0x5e'),JSON[_0x915c('0x2a')](_0x336ac4));}finally{process['exit'](0x0);}});};process['on'](_0x915c('0x5f'),function(){logger['info'](_0x915c('0x60'));endCsv();});function main(){return BPromise['resolve']()[_0x915c('0x25')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x915c('0xe')](',');return db[_0x915c('0x24')][_0x915c('0x48')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x53c23c){var _0x585b6d=fs[_0x915c('0x61')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x915c('0x62')](_0x585b6d,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3445e7,_0xb77e66){total+=0x1;var _0x462b4c=total;promises['push'](checkRow(_0x3445e7,_0x53c23c,_0x462b4c)['then'](function(){success+=0x1;})[_0x915c('0x27')](function(_0x27a94e){if(_0x27a94e[_0x915c('0x11')]){errors+=0x1;delete _0x27a94e[_0x915c('0x11')];}else if(_0x27a94e[_0x915c('0x23')]){duplicates+=0x1;delete _0x27a94e[_0x915c('0x23')];}rows[_0x915c('0x26')](_0x27a94e);}));if(total%0xc8===0x0){_0xb77e66['pause']();return processPromises(_0xb77e66);}},'complete':function(){return processPromises()['then'](function(){logger[_0x915c('0x63')](_0x915c('0x64'));endCsv();});},'error':function(_0x11a78f,_0x2e0a2a){logger['info'](_0x915c('0x65'),JSON[_0x915c('0x2a')](_0x11a78f));endCsv();}});})['catch'](function(_0x4605ac){logger[_0x915c('0x11')](_0x915c('0x66'),JSON[_0x915c('0x2a')](_0x4605ac));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index b130391..4eeee3c 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 _0xe0bc=['errors','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','UserId','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','SystemRow','appendFileSync','rows','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','campaigns','each','then','finish','affectedRows','unlink','catch','error','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','import','redis','localhost','socket.io-emitter','format','test','select','field','phone','join','where','\x20=\x20','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','into','cm_hopper','scheduledat','ContactId','createdAt','updatedAt','recallme','fields','from','cm_contacts','cm_contacts.ListId\x20=\x20','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','insert','cm_hopper_black','fromQuery','ListId','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','concat','CompanyId',')\x20NOT\x20IN\x20?','MIN(id)','info','message','exit','sequelize','query','spread','push','main','stringify','start','binding','socket_timestamp','root','.csv','keys','header','writeFileSync','parse','createReadStream','length','data'];(function(_0x2c0931,_0x503573){var _0x3d781f=function(_0x3f84ac){while(--_0x3f84ac){_0x2c0931['push'](_0x2c0931['shift']());}};_0x3d781f(++_0x503573);}(_0xe0bc,0x1b9));var _0xce0b=function(_0x10cb08,_0x225784){_0x10cb08=_0x10cb08-0x0;var _0x45a993=_0xe0bc[_0x10cb08];return _0x45a993;};'use strict';var fs=require('fs');var path=require(_0xce0b('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require(_0xce0b('0x1'));var BPromise=require(_0xce0b('0x2'));var moment=require(_0xce0b('0x3'));var squel=require(_0xce0b('0x4'));var Redis=require('ioredis');var db=require(_0xce0b('0x5'))['db'];var config=require(_0xce0b('0x6'));var logger=require('../../../config/logger')(_0xce0b('0x7'));config[_0xce0b('0x8')]=_['defaults'](config[_0xce0b('0x8')],{'host':_0xce0b('0x9'),'port':0x18eb});var socket=require(_0xce0b('0xa'))(new Redis(config[_0xce0b('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xce0b('0xb')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x5cc7da){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))*$/[_0xce0b('0xc')](_0x5cc7da);}function selectNotIn(_0x3f4e0e,_0x21665b,_0x1c1609,_0x2674ab,_0x1809a1){return squel[_0xce0b('0xd')]()[_0xce0b('0xe')](_0xce0b('0xf'))['from'](_0x2674ab)[_0xce0b('0x10')](_0x21665b,null,_0x21665b+'.id\x20=\x20'+_0x2674ab+'.'+_0x1c1609)[_0xce0b('0x11')](_0x2674ab+'.'+_0x1c1609+_0xce0b('0x12')+_0x3f4e0e+'.'+_0x1c1609)[_0xce0b('0x11')](_0x21665b+'.dialCheckDuplicateType\x20IN\x20('+_0x1809a1[_0xce0b('0x10')]()+')');}function insertCmHopper(_0x41c589,_0x5be5a1,_0xcb4cd2,_0x52af0b,_0x2412ff){var _0x15246b=[_0xce0b('0x13'),_0xce0b('0x14'),_0xce0b('0x15'),'cm_contacts.ListId',_0x5be5a1+'.'+_0x52af0b,_0xce0b('0x16'),_0xce0b('0x17'),'cm_contacts.priority',_0xce0b('0x18'),'\x22'+_0x2412ff+'\x22'];return squel['insert']()[_0xce0b('0x19')](_0xce0b('0x1a'))['fromQuery']([_0xce0b('0xf'),_0xce0b('0x1b'),_0xce0b('0x1c'),'ListId',_0x52af0b,_0xce0b('0x1d'),_0xce0b('0x1e'),'priority','UserId',_0xce0b('0x1f')],squel[_0xce0b('0xd')]()[_0xce0b('0x20')](_0x15246b)[_0xce0b('0x21')](_0x5be5a1)[_0xce0b('0x10')](_0xce0b('0x22'),null,_0xce0b('0x23')+_0x5be5a1+'.CmListId')[_0xce0b('0x10')](_0xcb4cd2,null,_0xcb4cd2+_0xce0b('0x24')+_0x5be5a1+'.'+_0x52af0b)[_0xce0b('0x11')](_0x5be5a1+_0xce0b('0x25'),_0x41c589)[_0xce0b('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xce0b('0x11')](_0xce0b('0x26'),selectNotIn(_0x5be5a1,_0xcb4cd2,_0x52af0b,_0xce0b('0x1a'),[_0xce0b('0x27'),_0xce0b('0x28')]))[_0xce0b('0x11')](_0xce0b('0x26'),selectNotIn(_0x5be5a1,_0xcb4cd2,_0x52af0b,'cm_hopper',[_0xce0b('0x27')])))[_0xce0b('0x29')]();}function insertCmHopperBlack(_0x1afbe1,_0x3e49fa,_0xee751e,_0x41ba94){var _0x51b36e=[_0xce0b('0x13'),_0xce0b('0x15'),_0xce0b('0x2a'),_0x3e49fa+'.'+_0x41ba94,_0xce0b('0x16'),_0xce0b('0x17')];return squel[_0xce0b('0x2b')]()[_0xce0b('0x19')](_0xce0b('0x2c'))[_0xce0b('0x2d')]([_0xce0b('0xf'),_0xce0b('0x1c'),_0xce0b('0x2e'),_0x41ba94,_0xce0b('0x1d'),_0xce0b('0x1e')],squel[_0xce0b('0xd')]()[_0xce0b('0x20')](_0x51b36e)[_0xce0b('0x21')](_0x3e49fa)['join'](_0xce0b('0x22'),null,_0xce0b('0x23')+_0x3e49fa+'.CmListId')['join'](_0xee751e,null,_0xee751e+_0xce0b('0x24')+_0x3e49fa+'.'+_0x41ba94)[_0xce0b('0x11')](_0x3e49fa+_0xce0b('0x25'),_0x1afbe1)[_0xce0b('0x11')](_0xce0b('0x2f'),NOW)[_0xce0b('0x11')](_0xce0b('0x26'),squel['select']()['field'](_0xce0b('0xf'))[_0xce0b('0x21')]('cm_hopper_black')['where'](_0xce0b('0x30'),_0x1afbe1)['where'](_0x41ba94+_0xce0b('0x31'),_0x3e49fa+'.'+_0x41ba94)))[_0xce0b('0x29')]();}function insertCmContact(_0x42a04a,_0x594ee8,_0xf73602,_0x20190f){var _0x2a2539=_[_0xce0b('0x32')](_['keys'](_0x20190f),[_0xce0b('0x2e'),_0xce0b('0x33'),_0xce0b('0x1d'),'updatedAt']);return squel[_0xce0b('0x2b')]()[_0xce0b('0x19')](_0xce0b('0x22'))[_0xce0b('0x2d')](_0x2a2539,squel[_0xce0b('0xd')]()['fields'](_0x2a2539)['from'](_0x594ee8)['where']('('+_0xf73602['join'](',')+_0xce0b('0x34'),squel[_0xce0b('0xd')]()['fields'](_0xf73602)[_0xce0b('0x21')](_0xce0b('0x22'))[_0xce0b('0x11')]('ListId\x20=\x20?',_0x42a04a))[_0xce0b('0x11')]('id\x20IN\x20?',squel[_0xce0b('0xd')]()[_0xce0b('0xe')](_0xce0b('0x35'),'min_id')['from'](_0x594ee8)['group'](_0xf73602['join'](','))))[_0xce0b('0x29')]();}function handleStop(){logger[_0xce0b('0x36')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x39e46f){logger['error'](_0x39e46f[_0xce0b('0x37')]);process[_0xce0b('0x38')](0x1);}function handleError(_0x4fba22,_0x58e582){stats['errors']['push']({'name':_0x58e582['code'],'message':_0x58e582[_0xce0b('0x37')],'row':_0x4fba22});}function handleQuery(_0xcb1b7d){logger[_0xce0b('0x36')](_0xcb1b7d);return db[_0xce0b('0x39')][_0xce0b('0x3a')](_0xcb1b7d)[_0xce0b('0x3b')](function(_0x3164d1){results[_0xce0b('0x3c')](_0x3164d1);})['catch'](function(_0x8531fd){logger['error'](_0x8531fd[_0xce0b('0x37')]);});}function main(_0x1a8e78,_0x4557a4,_0x2d033d,_0x240d60){logger[_0xce0b('0x36')](_0xce0b('0x3d'),_0x1a8e78,JSON[_0xce0b('0x3e')](_0x4557a4));process['send'](_0xce0b('0x3f'));var _0x1fad68=_0x4557a4[_0xce0b('0x40')];var _0x24a493=_0x4557a4[_0xce0b('0x41')];var _0x4d738c=path[_0xce0b('0x10')](config[_0xce0b('0x42')],'server/files/tmp',_0x24a493+_0xce0b('0x43'));var _0xb25617=_[_0xce0b('0x44')](_0x1fad68)[_0xce0b('0x10')]();logger[_0xce0b('0x36')](_0xce0b('0x45'),_0xb25617);fs[_0xce0b('0x46')](_0x4d738c,_0xb25617+'\x0a');Papa[_0xce0b('0x47')](fs[_0xce0b('0x48')](_0x1a8e78),{'header':!![],'skipEmptyLines':!![],'step':function(_0x35590a,_0xf041cf){try{for(var _0x440de3=0x0,_0x5050da=[];_0x440de3<_0x35590a['data'][_0xce0b('0x49')];_0x440de3++){stats['rows']+=0x1;if(_0x35590a['errors'][_0x440de3]){handleError(_0x35590a[_0xce0b('0x4a')][_0x440de3],_0x35590a[_0xce0b('0x4b')][_0x440de3]);}else{var _0x28a60e=[];for(var _0x3b82ca in _0x1fad68){if(_0x1fad68['hasOwnProperty'](_0x3b82ca)){if(_0x35590a['data'][_0x440de3][_0x1fad68[_0x3b82ca]]){var _0x31dd48=_[_0xce0b('0x4c')](_0x35590a['data'][_0x440de3][_0x1fad68[_0x3b82ca]][_0xce0b('0x4d')](/"/g,'\x27'));switch(_0x3b82ca){case'scheduledat':var _0x4fa486=moment(_0x31dd48,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x4fa486[_0xce0b('0x4e')]()){_0x5050da[_0xce0b('0x3c')]('\x22'+_0x31dd48+'\x22');}else{_0x28a60e[_0xce0b('0x3c')](_0xce0b('0x4f'));}break;case _0xce0b('0x50'):var _0x16d91b=parseInt(_0x31dd48);_0x31dd48=_[_0xce0b('0x51')](_0x16d91b)||_0x16d91b<0x0||_0x16d91b>0x4?_0x240d60?0x3:0x2:_0x16d91b;_0x5050da['push']('\x22'+_0x31dd48+'\x22');break;case _0xce0b('0x52'):var _0x5dfe72=parseInt(_0x31dd48);if(_[_0xce0b('0x53')](_0x5dfe72)&&_['includes'](_0x2d033d,_0x5dfe72)){_0x5050da['push']('\x22'+_0x5dfe72+'\x22');}else{_0x28a60e[_0xce0b('0x3c')](_0xce0b('0x54'));}break;case'email':if(isEmail(_0x31dd48)){_0x5050da[_0xce0b('0x3c')]('\x22'+_0x31dd48+'\x22');}else{_0x28a60e[_0xce0b('0x3c')](_0xce0b('0x55'));}break;case'dateOfBirth':var _0x1aca30=moment(_0x31dd48,_0xce0b('0x56'),!![]);if(_0x1aca30['isValid']()){_0x5050da[_0xce0b('0x3c')]('\x22'+_0x31dd48+'\x22');}else{_0x28a60e[_0xce0b('0x3c')](_0xce0b('0x57'));}break;default:_0x5050da[_0xce0b('0x3c')]('\x22'+_0x31dd48+'\x22');}}else{switch(_0x3b82ca){case _0xce0b('0x58'):case _0xce0b('0xf'):_0x28a60e['push'](_0x3b82ca+'\x20not\x20specified');break;default:_0x5050da[_0xce0b('0x3c')]('\x22\x22');}}}}if(_0x28a60e['length']){handleError(_0x35590a[_0xce0b('0x4a')][_0x440de3],{'code':_0xce0b('0x59'),'message':_0x28a60e[_0xce0b('0x10')]()});}else{fs[_0xce0b('0x5a')](_0x4d738c,_0x5050da[_0xce0b('0x10')]()+'\x0a');}_0x5050da=[];}if(!(stats[_0xce0b('0x5b')]%0xc8)){socket['emit'](_0xce0b('0x5c')+_0x24a493,stats);stats[_0xce0b('0x4b')]=[];}}if(stopped){logger[_0xce0b('0x36')](_0xce0b('0x5d'));_0xf041cf[_0xce0b('0x5e')]();}}catch(_0x345b46){handleError(_0x35590a[_0xce0b('0x4a')][_0x440de3],{'code':_0xce0b('0x5f'),'message':_0x345b46[_0xce0b('0x37')]});logger['error'](_0xce0b('0x60'),_0x345b46['message']);}},'complete':function(){try{var _0x4d854e=[];var _0x3f4558=_0xce0b('0x22');if(_0x4557a4[_0xce0b('0x61')]&&_0x4557a4['duplicates'][_0xce0b('0x49')]){_0x3f4558=_0xce0b('0x62')+_0x24a493;_0x4d854e[_0xce0b('0x3c')](_0xce0b('0x63')+_0x3f4558+_0xce0b('0x64'));}var _0x42257f=util[_0xce0b('0xb')]('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',_0x4d738c,_0x3f4558,_0xb25617,_0x4557a4[_0xce0b('0x2e')],_0x4557a4[_0xce0b('0x33')]||null,NOW,NOW);if(_[_0xce0b('0x65')](_0x1fad68['scheduledat'])){_0x42257f+=_0xce0b('0x66');}_0x4d854e[_0xce0b('0x3c')](_0x42257f);if(_0x4557a4[_0xce0b('0x61')]&&_0x4557a4['duplicates'][_0xce0b('0x49')]){_0x4d854e[_0xce0b('0x3c')](insertCmContact(_0x4557a4[_0xce0b('0x2e')],_0x3f4558,_0x4557a4[_0xce0b('0x61')],_0x1fad68));_0x4d854e['push'](_0xce0b('0x67')+_0x3f4558+';');}_0x4d854e[_0xce0b('0x3c')](insertCmHopper(_0x4557a4[_0xce0b('0x2e')],_0xce0b('0x68'),'voice_queues',_0xce0b('0x69'),_0x240d60));_0x4d854e[_0xce0b('0x3c')](insertCmHopperBlack(_0x4557a4[_0xce0b('0x2e')],_0xce0b('0x6a'),_0xce0b('0x6b'),_0xce0b('0x69')));_0x4d854e[_0xce0b('0x3c')](insertCmHopper(_0x4557a4[_0xce0b('0x2e')],_0xce0b('0x6c'),'campaigns',_0xce0b('0x6d'),_0x240d60));_0x4d854e[_0xce0b('0x3c')](insertCmHopperBlack(_0x4557a4['ListId'],_0xce0b('0x6e'),_0xce0b('0x6f'),_0xce0b('0x6d')));BPromise[_0xce0b('0x70')](_0x4d854e,handleQuery)[_0xce0b('0x71')](function(_0x272eba){stats[_0xce0b('0x72')]=!![];stats[_0xce0b('0x73')]=_0x4557a4[_0xce0b('0x61')]&&_0x4557a4[_0xce0b('0x61')][_0xce0b('0x49')]?results[0x2][_0xce0b('0x73')]:results[0x0][_0xce0b('0x73')];socket['emit'](_0xce0b('0x5c')+_0x24a493,stats);fs[_0xce0b('0x74')](_0x1a8e78);fs['unlink'](_0x4d738c);process['exit'](0x0);})[_0xce0b('0x75')](function(_0x3c19a0){logger[_0xce0b('0x76')](_0x3c19a0[_0xce0b('0x37')]);process['exit'](0x1);});}catch(_0x42f06a){logger[_0xce0b('0x76')]('complete',_0x42f06a[_0xce0b('0x37')]);process['exit'](0x1);}},'error':function(_0x1f8049,_0x42eefa,_0x47f3f5,_0x18696f){throw new Error(_0x18696f);}});}function validate(){if(process[_0xce0b('0x77')]&&process[_0xce0b('0x77')][_0xce0b('0x49')]<0x4){throw new Error(_0xce0b('0x78'));}var _0x3c693c=path['join'](config['root'],'server/files/tmp',process['argv'][0x2]);if(!fs[_0xce0b('0x79')](_0x3c693c)){throw new Error(_0xce0b('0x7a'));}var _0x4f17dd={};try{_0x4f17dd=JSON[_0xce0b('0x47')](process[_0xce0b('0x77')][0x3]);if(!_0x4f17dd[_0xce0b('0x40')]){throw new Error(_0xce0b('0x7b'));}if(!_0x4f17dd[_0xce0b('0x40')][_0xce0b('0xf')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x4f17dd[_0xce0b('0x40')][_0xce0b('0x58')]){throw new Error('firstName\x20is\x20mandatory');}var _0x47ef55=0x0;if(_0x4f17dd[_0xce0b('0x40')]['UserId']){_0x47ef55=0x1;}if(!_0x4f17dd[_0xce0b('0x2e')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x19deaf){throw new Error(_0xce0b('0x7c'));}var _0x2d5841=[];try{_0x2d5841=_[_0xce0b('0x7d')](JSON[_0xce0b('0x47')](process[_0xce0b('0x77')][0x4]),'id');}catch(_0x15ff2f){logger[_0xce0b('0x36')](_0xce0b('0x7e'));}main(_0x3c693c,_0x4f17dd,_0x2d5841,_0x47ef55);}validate();process['on'](_0xce0b('0x7f'),handleStop);process['on'](_0xce0b('0x80'),handleUncaughtException); \ No newline at end of file +var _0xab42=['join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.id','cm_contacts.ListId','cm_hopper_black','ListId\x20=\x20?','concat','keys','CompanyId','id\x20IN\x20?','min_id','group','toString','info','Received\x20SIGINT','message','errors','push','code','sequelize','query','spread','catch','main','start','binding','socket_timestamp','root','server/files/tmp','.csv','header','createReadStream','data','length','rows','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','campaigns','each','then','finish','affectedRows','unlink','exit','error','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from'];(function(_0x195e2,_0x5d4b51){var _0x1fde26=function(_0x54794d){while(--_0x54794d){_0x195e2['push'](_0x195e2['shift']());}};_0x1fde26(++_0x5d4b51);}(_0xab42,0xfc));var _0x2ab4=function(_0x4acc2b,_0x5991a0){_0x4acc2b=_0x4acc2b-0x0;var _0x57283b=_0xab42[_0x4acc2b];return _0x57283b;};'use strict';var fs=require('fs');var path=require(_0x2ab4('0x0'));var _=require(_0x2ab4('0x1'));var Papa=require('papaparse');var util=require('util');var BPromise=require(_0x2ab4('0x2'));var moment=require(_0x2ab4('0x3'));var squel=require(_0x2ab4('0x4'));var Redis=require('ioredis');var db=require(_0x2ab4('0x5'))['db'];var config=require(_0x2ab4('0x6'));var logger=require(_0x2ab4('0x7'))(_0x2ab4('0x8'));config[_0x2ab4('0x9')]=_[_0x2ab4('0xa')](config[_0x2ab4('0x9')],{'host':_0x2ab4('0xb'),'port':0x18eb});var socket=require(_0x2ab4('0xc'))(new Redis(config[_0x2ab4('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x2ab4('0xd')](_0x2ab4('0xe'));function isEmail(_0x4c222d){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))*$/[_0x2ab4('0xf')](_0x4c222d);}function selectNotIn(_0x4b098c,_0x1c67a5,_0x41c2e2,_0xc328dc,_0x1baef4){return squel[_0x2ab4('0x10')]()[_0x2ab4('0x11')](_0x2ab4('0x12'))[_0x2ab4('0x13')](_0xc328dc)[_0x2ab4('0x14')](_0x1c67a5,null,_0x1c67a5+'.id\x20=\x20'+_0xc328dc+'.'+_0x41c2e2)[_0x2ab4('0x15')](_0xc328dc+'.'+_0x41c2e2+_0x2ab4('0x16')+_0x4b098c+'.'+_0x41c2e2)[_0x2ab4('0x15')](_0x1c67a5+_0x2ab4('0x17')+_0x1baef4[_0x2ab4('0x14')]()+')');}function insertCmHopper(_0x4d339c,_0x49fb64,_0x24fe3a,_0x264ccb,_0x1e759f){var _0x316c9c=[_0x2ab4('0x18'),_0x2ab4('0x19'),'cm_contacts.id','cm_contacts.ListId',_0x49fb64+'.'+_0x264ccb,_0x2ab4('0x1a'),_0x2ab4('0x1b'),_0x2ab4('0x1c'),_0x2ab4('0x1d'),'\x22'+_0x1e759f+'\x22'];return squel[_0x2ab4('0x1e')]()[_0x2ab4('0x1f')](_0x2ab4('0x20'))['fromQuery']([_0x2ab4('0x12'),_0x2ab4('0x21'),_0x2ab4('0x22'),_0x2ab4('0x23'),_0x264ccb,_0x2ab4('0x24'),_0x2ab4('0x25'),_0x2ab4('0x26'),_0x2ab4('0x27'),_0x2ab4('0x28')],squel[_0x2ab4('0x10')]()[_0x2ab4('0x29')](_0x316c9c)[_0x2ab4('0x13')](_0x49fb64)[_0x2ab4('0x14')](_0x2ab4('0x2a'),null,_0x2ab4('0x2b')+_0x49fb64+_0x2ab4('0x2c'))[_0x2ab4('0x14')](_0x24fe3a,null,_0x24fe3a+_0x2ab4('0x2d')+_0x49fb64+'.'+_0x264ccb)['where'](_0x49fb64+_0x2ab4('0x2e'),_0x4d339c)[_0x2ab4('0x15')](_0x2ab4('0x2f'),NOW)[_0x2ab4('0x15')](_0x2ab4('0x30'),selectNotIn(_0x49fb64,_0x24fe3a,_0x264ccb,_0x2ab4('0x20'),[_0x2ab4('0x31'),_0x2ab4('0x32')]))[_0x2ab4('0x15')](_0x2ab4('0x30'),selectNotIn(_0x49fb64,_0x24fe3a,_0x264ccb,_0x2ab4('0x20'),[_0x2ab4('0x31')])))['toString']();}function insertCmHopperBlack(_0x59d019,_0x32d93d,_0x274cd1,_0xc85fe0){var _0x49e537=[_0x2ab4('0x18'),_0x2ab4('0x33'),_0x2ab4('0x34'),_0x32d93d+'.'+_0xc85fe0,_0x2ab4('0x1a'),_0x2ab4('0x1b')];return squel[_0x2ab4('0x1e')]()[_0x2ab4('0x1f')](_0x2ab4('0x35'))['fromQuery']([_0x2ab4('0x12'),_0x2ab4('0x22'),_0x2ab4('0x23'),_0xc85fe0,_0x2ab4('0x24'),'updatedAt'],squel[_0x2ab4('0x10')]()[_0x2ab4('0x29')](_0x49e537)[_0x2ab4('0x13')](_0x32d93d)[_0x2ab4('0x14')]('cm_contacts',null,_0x2ab4('0x2b')+_0x32d93d+_0x2ab4('0x2c'))[_0x2ab4('0x14')](_0x274cd1,null,_0x274cd1+_0x2ab4('0x2d')+_0x32d93d+'.'+_0xc85fe0)[_0x2ab4('0x15')](_0x32d93d+_0x2ab4('0x2e'),_0x59d019)[_0x2ab4('0x15')](_0x2ab4('0x2f'),NOW)[_0x2ab4('0x15')](_0x2ab4('0x30'),squel['select']()[_0x2ab4('0x11')](_0x2ab4('0x12'))[_0x2ab4('0x13')]('cm_hopper_black')[_0x2ab4('0x15')](_0x2ab4('0x36'),_0x59d019)['where'](_0xc85fe0+'\x20=\x20?',_0x32d93d+'.'+_0xc85fe0)))['toString']();}function insertCmContact(_0xe47459,_0x15c814,_0x3dc097,_0x32cced){var _0xd9c515=_[_0x2ab4('0x37')](_[_0x2ab4('0x38')](_0x32cced),[_0x2ab4('0x23'),_0x2ab4('0x39'),_0x2ab4('0x24'),_0x2ab4('0x25')]);return squel[_0x2ab4('0x1e')]()['into'](_0x2ab4('0x2a'))['fromQuery'](_0xd9c515,squel[_0x2ab4('0x10')]()[_0x2ab4('0x29')](_0xd9c515)[_0x2ab4('0x13')](_0x15c814)[_0x2ab4('0x15')]('('+_0x3dc097[_0x2ab4('0x14')](',')+')\x20NOT\x20IN\x20?',squel[_0x2ab4('0x10')]()[_0x2ab4('0x29')](_0x3dc097)['from'](_0x2ab4('0x2a'))['where'](_0x2ab4('0x36'),_0xe47459))[_0x2ab4('0x15')](_0x2ab4('0x3a'),squel[_0x2ab4('0x10')]()['field']('MIN(id)',_0x2ab4('0x3b'))['from'](_0x15c814)[_0x2ab4('0x3c')](_0x3dc097[_0x2ab4('0x14')](','))))[_0x2ab4('0x3d')]();}function handleStop(){logger[_0x2ab4('0x3e')](_0x2ab4('0x3f'));stopped=!![];}function handleUncaughtException(_0x5428e2){logger['error'](_0x5428e2[_0x2ab4('0x40')]);process['exit'](0x1);}function handleError(_0x2ace2d,_0x23b8ea){stats[_0x2ab4('0x41')][_0x2ab4('0x42')]({'name':_0x23b8ea[_0x2ab4('0x43')],'message':_0x23b8ea['message'],'row':_0x2ace2d});}function handleQuery(_0x21f4ce){logger['info'](_0x21f4ce);return db[_0x2ab4('0x44')][_0x2ab4('0x45')](_0x21f4ce)[_0x2ab4('0x46')](function(_0x167fd9){results['push'](_0x167fd9);})[_0x2ab4('0x47')](function(_0x514f38){logger['error'](_0x514f38['message']);});}function main(_0x14a924,_0xf0a793,_0x29381a,_0x3ddc7b){logger[_0x2ab4('0x3e')](_0x2ab4('0x48'),_0x14a924,JSON['stringify'](_0xf0a793));process['send'](_0x2ab4('0x49'));var _0x1fcb01=_0xf0a793[_0x2ab4('0x4a')];var _0x7d2711=_0xf0a793[_0x2ab4('0x4b')];var _0x4b02b2=path[_0x2ab4('0x14')](config[_0x2ab4('0x4c')],_0x2ab4('0x4d'),_0x7d2711+_0x2ab4('0x4e'));var _0x573e0c=_[_0x2ab4('0x38')](_0x1fcb01)['join']();logger[_0x2ab4('0x3e')](_0x2ab4('0x4f'),_0x573e0c);fs['writeFileSync'](_0x4b02b2,_0x573e0c+'\x0a');Papa['parse'](fs[_0x2ab4('0x50')](_0x14a924),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4b3b6f,_0x2d9b85){try{for(var _0x3c00c2=0x0,_0x573246=[];_0x3c00c2<_0x4b3b6f[_0x2ab4('0x51')][_0x2ab4('0x52')];_0x3c00c2++){stats[_0x2ab4('0x53')]+=0x1;if(_0x4b3b6f[_0x2ab4('0x41')][_0x3c00c2]){handleError(_0x4b3b6f[_0x2ab4('0x51')][_0x3c00c2],_0x4b3b6f['errors'][_0x3c00c2]);}else{var _0x1d395a=[];for(var _0x30524e in _0x1fcb01){if(_0x1fcb01[_0x2ab4('0x54')](_0x30524e)){if(_0x4b3b6f[_0x2ab4('0x51')][_0x3c00c2][_0x1fcb01[_0x30524e]]){var _0x3ff60c=_[_0x2ab4('0x55')](_0x4b3b6f['data'][_0x3c00c2][_0x1fcb01[_0x30524e]][_0x2ab4('0x56')](/"/g,'\x27'));switch(_0x30524e){case _0x2ab4('0x21'):var _0x5eee4b=moment(_0x3ff60c,_0x2ab4('0xe'),!![]);if(_0x5eee4b[_0x2ab4('0x57')]()){_0x573246[_0x2ab4('0x42')]('\x22'+_0x3ff60c+'\x22');}else{_0x1d395a[_0x2ab4('0x42')](_0x2ab4('0x58'));}break;case'priority':var _0x59f5b2=parseInt(_0x3ff60c);_0x3ff60c=_[_0x2ab4('0x59')](_0x59f5b2)||_0x59f5b2<0x0||_0x59f5b2>0x4?_0x3ddc7b?0x3:0x2:_0x59f5b2;_0x573246[_0x2ab4('0x42')]('\x22'+_0x3ff60c+'\x22');break;case _0x2ab4('0x27'):var _0x44d8c8=parseInt(_0x3ff60c);if(_[_0x2ab4('0x5a')](_0x44d8c8)&&_[_0x2ab4('0x5b')](_0x29381a,_0x44d8c8)){_0x573246[_0x2ab4('0x42')]('\x22'+_0x44d8c8+'\x22');}else{_0x1d395a['push'](_0x2ab4('0x5c'));}break;case _0x2ab4('0x5d'):if(isEmail(_0x3ff60c)){_0x573246[_0x2ab4('0x42')]('\x22'+_0x3ff60c+'\x22');}else{_0x1d395a[_0x2ab4('0x42')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x3ff593=moment(_0x3ff60c,'YYYY-MM-DD',!![]);if(_0x3ff593[_0x2ab4('0x57')]()){_0x573246[_0x2ab4('0x42')]('\x22'+_0x3ff60c+'\x22');}else{_0x1d395a[_0x2ab4('0x42')](_0x2ab4('0x5e'));}break;default:_0x573246[_0x2ab4('0x42')]('\x22'+_0x3ff60c+'\x22');}}else{switch(_0x30524e){case _0x2ab4('0x5f'):case _0x2ab4('0x12'):_0x1d395a[_0x2ab4('0x42')](_0x30524e+_0x2ab4('0x60'));break;default:_0x573246[_0x2ab4('0x42')]('\x22\x22');}}}}if(_0x1d395a[_0x2ab4('0x52')]){handleError(_0x4b3b6f[_0x2ab4('0x51')][_0x3c00c2],{'code':'SystemRow','message':_0x1d395a[_0x2ab4('0x14')]()});}else{fs[_0x2ab4('0x61')](_0x4b02b2,_0x573246[_0x2ab4('0x14')]()+'\x0a');}_0x573246=[];}if(!(stats[_0x2ab4('0x53')]%0xc8)){socket[_0x2ab4('0x62')](_0x2ab4('0x63')+_0x7d2711,stats);stats[_0x2ab4('0x41')]=[];}}if(stopped){logger['info'](_0x2ab4('0x64'));_0x2d9b85[_0x2ab4('0x65')]();}}catch(_0x41f475){handleError(_0x4b3b6f[_0x2ab4('0x51')][_0x3c00c2],{'code':_0x2ab4('0x66'),'message':_0x41f475[_0x2ab4('0x40')]});logger['error'](_0x2ab4('0x67'),_0x41f475[_0x2ab4('0x40')]);}},'complete':function(){try{var _0x51352e=[];var _0x49c86e='cm_contacts';if(_0xf0a793[_0x2ab4('0x68')]&&_0xf0a793['duplicates']['length']){_0x49c86e=_0x2ab4('0x69')+_0x7d2711;_0x51352e[_0x2ab4('0x42')](_0x2ab4('0x6a')+_0x49c86e+_0x2ab4('0x6b'));}var _0x5301ee=util[_0x2ab4('0xd')](_0x2ab4('0x6c'),_0x4b02b2,_0x49c86e,_0x573e0c,_0xf0a793[_0x2ab4('0x23')],_0xf0a793[_0x2ab4('0x39')]||null,NOW,NOW);if(_['isNil'](_0x1fcb01[_0x2ab4('0x21')])){_0x5301ee+=_0x2ab4('0x6d');}_0x51352e[_0x2ab4('0x42')](_0x5301ee);if(_0xf0a793['duplicates']&&_0xf0a793[_0x2ab4('0x68')][_0x2ab4('0x52')]){_0x51352e[_0x2ab4('0x42')](insertCmContact(_0xf0a793[_0x2ab4('0x23')],_0x49c86e,_0xf0a793[_0x2ab4('0x68')],_0x1fcb01));_0x51352e[_0x2ab4('0x42')]('DROP\x20TABLE\x20'+_0x49c86e+';');}_0x51352e[_0x2ab4('0x42')](insertCmHopper(_0xf0a793[_0x2ab4('0x23')],'voice_queues_has_cm_lists','voice_queues',_0x2ab4('0x6e'),_0x3ddc7b));_0x51352e['push'](insertCmHopperBlack(_0xf0a793['ListId'],_0x2ab4('0x6f'),_0x2ab4('0x70'),_0x2ab4('0x6e')));_0x51352e[_0x2ab4('0x42')](insertCmHopper(_0xf0a793['ListId'],_0x2ab4('0x71'),'campaigns',_0x2ab4('0x72'),_0x3ddc7b));_0x51352e[_0x2ab4('0x42')](insertCmHopperBlack(_0xf0a793[_0x2ab4('0x23')],_0x2ab4('0x73'),_0x2ab4('0x74'),_0x2ab4('0x72')));BPromise[_0x2ab4('0x75')](_0x51352e,handleQuery)[_0x2ab4('0x76')](function(_0x1ea961){stats[_0x2ab4('0x77')]=!![];stats['affectedRows']=_0xf0a793[_0x2ab4('0x68')]&&_0xf0a793[_0x2ab4('0x68')][_0x2ab4('0x52')]?results[0x2][_0x2ab4('0x78')]:results[0x0][_0x2ab4('0x78')];socket[_0x2ab4('0x62')](_0x2ab4('0x63')+_0x7d2711,stats);fs['unlink'](_0x14a924);fs[_0x2ab4('0x79')](_0x4b02b2);process[_0x2ab4('0x7a')](0x0);})[_0x2ab4('0x47')](function(_0x3d16e2){logger[_0x2ab4('0x7b')](_0x3d16e2[_0x2ab4('0x40')]);process[_0x2ab4('0x7a')](0x1);});}catch(_0x4fdd9a){logger[_0x2ab4('0x7b')](_0x2ab4('0x7c'),_0x4fdd9a['message']);process[_0x2ab4('0x7a')](0x1);}},'error':function(_0x5bc90b,_0x2b9c97,_0x6ec10a,_0x69ea6e){throw new Error(_0x69ea6e);}});}function validate(){if(process[_0x2ab4('0x7d')]&&process[_0x2ab4('0x7d')][_0x2ab4('0x52')]<0x4){throw new Error(_0x2ab4('0x7e'));}var _0x49bd80=path['join'](config[_0x2ab4('0x4c')],_0x2ab4('0x4d'),process[_0x2ab4('0x7d')][0x2]);if(!fs[_0x2ab4('0x7f')](_0x49bd80)){throw new Error(_0x2ab4('0x80'));}var _0x40c458={};try{_0x40c458=JSON[_0x2ab4('0x81')](process[_0x2ab4('0x7d')][0x3]);if(!_0x40c458['binding']){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x40c458['binding'][_0x2ab4('0x12')]){throw new Error(_0x2ab4('0x82'));}if(!_0x40c458['binding'][_0x2ab4('0x5f')]){throw new Error('firstName\x20is\x20mandatory');}var _0x4a9596=0x0;if(_0x40c458[_0x2ab4('0x4a')][_0x2ab4('0x27')]){_0x4a9596=0x1;}if(!_0x40c458[_0x2ab4('0x23')]){throw new Error(_0x2ab4('0x83'));}}catch(_0x3cc959){throw new Error('body\x20id\x20mandatory');}var _0x3b100b=[];try{_0x3b100b=_[_0x2ab4('0x84')](JSON[_0x2ab4('0x81')](process[_0x2ab4('0x7d')][0x4]),'id');}catch(_0x215f89){logger[_0x2ab4('0x3e')](_0x2ab4('0x85'));}main(_0x49bd80,_0x40c458,_0x3b100b,_0x4a9596);}validate();process['on'](_0x2ab4('0x86'),handleStop);process['on'](_0x2ab4('0x87'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index da5585e..288a243 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 _0x5f2f=['Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Ring','agentconnectAt','Agent\x20Complete','Hold\x20Time','holdtime','Talk\x20Time','talktime','outbound','Called\x20Number','Member\x20Name','starttime','***\x20Time\x20Info\x20***','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','push','variable','queue','calleridnum','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1ef2ba,_0x3b45a7){_0x1ef2ba=_0x1ef2ba-0x0;var _0x14427c=_0x5f2f[_0x1ef2ba];return _0x14427c;};'use strict';exports[_0xf5f2('0x0')]=function(_0x423dd9,_0x2dcf60){var _0x1a7be1=[{'type':_0xf5f2('0x1'),'content':_0xf5f2('0x2'),'variableName':null}];switch(_0x423dd9[_0xf5f2('0x3')]()){case _0xf5f2('0x4'):switch(_0x2dcf60['toLowerCase']()){case'inbound':_0x1a7be1[_0xf5f2('0x5')]({'type':_0xf5f2('0x6'),'content':'','variableName':_0xf5f2('0x7')});_0x1a7be1[_0xf5f2('0x5')]({'type':_0xf5f2('0x6'),'content':'','variableName':_0xf5f2('0x8')});break;case'outbound':_0x1a7be1[_0xf5f2('0x5')]({'type':_0xf5f2('0x1'),'content':_0xf5f2('0x9'),'variableName':null});_0x1a7be1['push']({'type':_0xf5f2('0x6'),'content':'','variableName':_0xf5f2('0xa')});break;}}return _0x1a7be1;};exports[_0xf5f2('0xb')]=function(_0x4e0e6b,_0x977a59){var _0x4ebbbe=[];switch(_0x4e0e6b['toLowerCase']()){case _0xf5f2('0x4'):switch(_0x977a59[_0xf5f2('0x3')]()){case'inbound':_0x4ebbbe=[{'type':_0xf5f2('0x1'),'content':_0xf5f2('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0xe'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x8')},{'type':'keyValue','content':'','key':_0xf5f2('0xf'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x10')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x11'),'keyType':'variable','variableName':_0xf5f2('0x12')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x13'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x7')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x14'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x15')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x16'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x17')},{'type':_0xf5f2('0x1'),'content':_0xf5f2('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x19'),'keyType':'variable','variableName':_0xf5f2('0x1a')},{'type':_0xf5f2('0xd'),'content':'','key':'Agent\x20Number','keyType':'variable','variableName':_0xf5f2('0xa')},{'type':_0xf5f2('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x1b'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x17')},{'type':_0xf5f2('0xd'),'content':'','key':'Agent\x20Connect','keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x1c')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x1d'),'keyType':_0xf5f2('0x6'),'variableName':'agentcompleteAt'},{'type':'keyValue','content':'','key':_0xf5f2('0x1e'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x1f')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x20'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x21')}];break;case _0xf5f2('0x22'):_0x4ebbbe=[{'type':_0xf5f2('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x23'),'keyType':_0xf5f2('0x6'),'keyContent':'','variableName':_0xf5f2('0xa')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x24'),'keyType':'variable','keyContent':'','variableName':'membername'},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x14'),'keyType':_0xf5f2('0x6'),'keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0xf5f2('0x16'),'keyType':_0xf5f2('0x6'),'keyContent':'','variableName':_0xf5f2('0x25')},{'type':_0xf5f2('0x1'),'content':_0xf5f2('0x26')},{'type':'keyValue','content':'','key':'Answer\x20Time','keyType':_0xf5f2('0x6'),'keyContent':'','variableName':'answertime'},{'type':_0xf5f2('0xd'),'content':'','key':'Complete\x20Time','keyType':_0xf5f2('0x6'),'keyContent':'','variableName':_0xf5f2('0x27')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x28'),'keyType':_0xf5f2('0x6'),'keyContent':'','variableName':_0xf5f2('0x29')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x2a'),'keyType':'variable','keyContent':'','variableName':_0xf5f2('0x2b')}];break;}}return _0x4ebbbe;}; \ No newline at end of file +var _0xadb5=['uniqueid','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','agentcalledAt','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','Date','starttime','Answer\x20Time','answertime','Complete\x20Time','duration','Billable\x20Time','billableseconds','string','[xCALLY\x20Ticket]','voice','toLowerCase','inbound','variable','queue','push','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','keyValue','calleridname','Queue','UniqueId'];(function(_0x284c9f,_0x4c2672){var _0x16cdb9=function(_0x443069){while(--_0x443069){_0x284c9f['push'](_0x284c9f['shift']());}};_0x16cdb9(++_0x4c2672);}(_0xadb5,0xad));var _0x5adb=function(_0x133130,_0x13f085){_0x133130=_0x133130-0x0;var _0x2b4bdb=_0xadb5[_0x133130];return _0x2b4bdb;};'use strict';exports['getSubjects']=function(_0x2e4c9a,_0x49fc17){var _0x3d6340=[{'type':_0x5adb('0x0'),'content':_0x5adb('0x1'),'variableName':null}];switch(_0x2e4c9a['toLowerCase']()){case _0x5adb('0x2'):switch(_0x49fc17[_0x5adb('0x3')]()){case _0x5adb('0x4'):_0x3d6340['push']({'type':_0x5adb('0x5'),'content':'','variableName':_0x5adb('0x6')});_0x3d6340[_0x5adb('0x7')]({'type':_0x5adb('0x5'),'content':'','variableName':_0x5adb('0x8')});break;case _0x5adb('0x9'):_0x3d6340[_0x5adb('0x7')]({'type':_0x5adb('0x0'),'content':_0x5adb('0xa'),'variableName':null});_0x3d6340[_0x5adb('0x7')]({'type':_0x5adb('0x5'),'content':'','variableName':_0x5adb('0xb')});break;}}return _0x3d6340;};exports[_0x5adb('0xc')]=function(_0x275428,_0x563d86){var _0x4c268d=[];switch(_0x275428[_0x5adb('0x3')]()){case _0x5adb('0x2'):switch(_0x563d86[_0x5adb('0x3')]()){case'inbound':_0x4c268d=[{'type':_0x5adb('0x0'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x5adb('0xd'),'content':'','key':'Caller\x20Number','keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x8')},{'type':_0x5adb('0xd'),'content':'','key':'Caller\x20Name','keyType':_0x5adb('0x5'),'variableName':_0x5adb('0xe')},{'type':_0x5adb('0xd'),'content':'','key':'Call\x20To','keyType':_0x5adb('0x5'),'variableName':'destexten'},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0xf'),'keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x6')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x10'),'keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x11')},{'type':_0x5adb('0xd'),'content':'','key':'Date','keyType':_0x5adb('0x5'),'variableName':'agentcalledAt'},{'type':_0x5adb('0x0'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x5adb('0xd'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':_0x5adb('0x12')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x13'),'keyType':_0x5adb('0x5'),'variableName':_0x5adb('0xb')},{'type':'string','content':_0x5adb('0x14'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Ring','keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x15')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x16'),'keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x17')},{'type':_0x5adb('0xd'),'content':'','key':'Agent\x20Complete','keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x18')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x19'),'keyType':_0x5adb('0x5'),'variableName':'holdtime'},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x1a'),'keyType':'variable','variableName':_0x5adb('0x1b')}];break;case _0x5adb('0x9'):_0x4c268d=[{'type':_0x5adb('0x0'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x1c'),'keyType':_0x5adb('0x5'),'keyContent':'','variableName':_0x5adb('0xb')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x1d'),'keyType':'variable','keyContent':'','variableName':'membername'},{'type':'keyValue','content':'','key':_0x5adb('0x10'),'keyType':_0x5adb('0x5'),'keyContent':'','variableName':_0x5adb('0x11')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x1e'),'keyType':'variable','keyContent':'','variableName':_0x5adb('0x1f')},{'type':_0x5adb('0x0'),'content':_0x5adb('0x14')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x20'),'keyType':_0x5adb('0x5'),'keyContent':'','variableName':_0x5adb('0x21')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x22'),'keyType':_0x5adb('0x5'),'keyContent':'','variableName':'endtime'},{'type':_0x5adb('0xd'),'content':'','key':'Duration','keyType':_0x5adb('0x5'),'keyContent':'','variableName':_0x5adb('0x23')},{'type':'keyValue','content':'','key':_0x5adb('0x24'),'keyType':_0x5adb('0x5'),'keyContent':'','variableName':_0x5adb('0x25')}];break;}}return _0x4c268d;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index fc55f5e..6f9fe34 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 _0x3df4=['html','phone','mobile','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','Interaction','findOne','then','update','info','error','user','clone','body','omit'];(function(_0x4360c4,_0x2f8209){var _0x3168c8=function(_0x309523){while(--_0x309523){_0x4360c4['push'](_0x4360c4['shift']());}};_0x3168c8(++_0x2f8209);}(_0x3df4,0x137));var _0x43df=function(_0x8c0711,_0x588bba){_0x8c0711=_0x8c0711-0x0;var _0x51ae03=_0x3df4[_0x8c0711];return _0x51ae03;};'use strict';var _=require('lodash');var db=require(_0x43df('0x0'))['db'];var loggers={'openchannel':require(_0x43df('0x1'))('openchannel-interactions'),'mail':require('../../config/logger')(_0x43df('0x2')),'fax':require(_0x43df('0x1'))(_0x43df('0x3')),'sms':require(_0x43df('0x1'))(_0x43df('0x4')),'chat':require(_0x43df('0x1'))(_0x43df('0x5'))};function getInteractionId(_0x469cc5,_0x4bcdd4,_0x3465a8){if(_0x469cc5&&_0x469cc5[_[_0x43df('0x6')](_0x3465a8)+_0x43df('0x7')]){return _0x469cc5[_[_0x43df('0x6')](_0x3465a8)+_0x43df('0x7')];}else if(_0x469cc5&&_0x469cc5['id']){return _0x469cc5['id'];}else if(_0x4bcdd4&&_0x4bcdd4['id']){return _0x4bcdd4['id'];}else{return _0x43df('0x8');}}function log(_0x390853,_0x27b0cb,_0xfacabf,_0x2835e6,_0x2ed825,_0xeece08){loggers[_0x2ed825[_0x43df('0x9')]()][_0x390853](_0x43df('0xa'),_0xeece08['toUpperCase'](),_0x27b0cb?_0x27b0cb['id']:null,_0x27b0cb?_0x27b0cb[_0x43df('0xb')]:null,_0x27b0cb?_0x27b0cb[_0x43df('0xc')]:null,getInteractionId(_0xfacabf,_0x2835e6,_0x2ed825),_0xfacabf?JSON[_0x43df('0xd')](_0xfacabf):_0x43df('0xe'));}function updateUser(_0x256dd1,_0x564686,_0x576c5c,_0x3b5a09,_0x11ff9c){db[_[_0x43df('0x6')](_0x3b5a09)+_0x43df('0xf')][_0x43df('0x10')]({'where':{'id':getInteractionId(_0x564686,_0x576c5c,_0x3b5a09)}})[_0x43df('0x11')](function(_0x3728dc){if(_0x3728dc){return _0x3728dc[_0x43df('0x12')]({'UserId':_0x256dd1?_0x256dd1['id']:null});}})[_0x43df('0x11')](function(_0x5178b0){if(_0x5178b0){log(_0x43df('0x13'),_0x256dd1,_0x564686,_0x576c5c,_0x3b5a09,_0x11ff9c);}})['catch'](function(){log(_0x43df('0x14'),_0x256dd1,_0x564686,_0x576c5c,_0x3b5a09,_0x11ff9c);});}exports['tracked']=function(_0x75a61b,_0x500592){return function(_0x635699,_0x2078ed,_0x15c209){var _0x19f89a=_0x635699[_0x43df('0x15')];var _0x2aaf95={};var _0x1330f1=_0x635699['query'];if(_0x2aaf95){_0x2aaf95=_[_0x43df('0x16')](_0x635699[_0x43df('0x17')]);_0x2aaf95=_[_0x43df('0x18')](_0x2aaf95,[_0x43df('0x17'),_0x43df('0x19'),_0x43df('0x1a'),'fax',_0x43df('0x1b')]);}updateUser(_0x19f89a,_0x2aaf95,_0x1330f1,_0x75a61b,_0x500592);_0x15c209(null);};}; \ No newline at end of file +var _0x36f4=['update','info','catch','error','tracked','query','clone','body','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','Interaction','findOne','then'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x36f4,0x8d));var _0x436f=function(_0xc66f45,_0x3a99d2){_0xc66f45=_0xc66f45-0x0;var _0x30871e=_0x36f4[_0xc66f45];return _0x30871e;};'use strict';var _=require(_0x436f('0x0'));var db=require(_0x436f('0x1'))['db'];var loggers={'openchannel':require(_0x436f('0x2'))('openchannel-interactions'),'mail':require(_0x436f('0x2'))(_0x436f('0x3')),'fax':require('../../config/logger')(_0x436f('0x4')),'sms':require(_0x436f('0x2'))(_0x436f('0x5')),'chat':require(_0x436f('0x2'))(_0x436f('0x6'))};function getInteractionId(_0x2cdc94,_0xcaa108,_0x1f9f94){if(_0x2cdc94&&_0x2cdc94[_[_0x436f('0x7')](_0x1f9f94)+'InteractionId']){return _0x2cdc94[_[_0x436f('0x7')](_0x1f9f94)+'InteractionId'];}else if(_0x2cdc94&&_0x2cdc94['id']){return _0x2cdc94['id'];}else if(_0xcaa108&&_0xcaa108['id']){return _0xcaa108['id'];}else{return _0x436f('0x8');}}function log(_0x22238b,_0x210454,_0x8c9175,_0x3eb9c2,_0x2b2d20,_0xea3fdb){loggers[_0x2b2d20['toLowerCase']()][_0x22238b](_0x436f('0x9'),_0xea3fdb['toUpperCase'](),_0x210454?_0x210454['id']:null,_0x210454?_0x210454['name']:null,_0x210454?_0x210454[_0x436f('0xa')]:null,getInteractionId(_0x8c9175,_0x3eb9c2,_0x2b2d20),_0x8c9175?JSON[_0x436f('0xb')](_0x8c9175):'null');}function updateUser(_0x2f9a08,_0x49b456,_0x765baf,_0x2c5599,_0x52c44b){db[_['upperFirst'](_0x2c5599)+_0x436f('0xc')][_0x436f('0xd')]({'where':{'id':getInteractionId(_0x49b456,_0x765baf,_0x2c5599)}})[_0x436f('0xe')](function(_0x43b5d8){if(_0x43b5d8){return _0x43b5d8[_0x436f('0xf')]({'UserId':_0x2f9a08?_0x2f9a08['id']:null});}})[_0x436f('0xe')](function(_0xb4d447){if(_0xb4d447){log(_0x436f('0x10'),_0x2f9a08,_0x49b456,_0x765baf,_0x2c5599,_0x52c44b);}})[_0x436f('0x11')](function(){log(_0x436f('0x12'),_0x2f9a08,_0x49b456,_0x765baf,_0x2c5599,_0x52c44b);});}exports[_0x436f('0x13')]=function(_0x1edb4d,_0x377b54){return function(_0xbc1dde,_0x4a30ce,_0x3805da){var _0x4f9b9e=_0xbc1dde['user'];var _0x515ee8={};var _0x431a47=_0xbc1dde[_0x436f('0x14')];if(_0x515ee8){_0x515ee8=_[_0x436f('0x15')](_0xbc1dde[_0x436f('0x16')]);_0x515ee8=_['omit'](_0x515ee8,[_0x436f('0x16'),'html',_0x436f('0x17'),_0x436f('0x18'),_0x436f('0x19')]);}updateUser(_0x4f9b9e,_0x515ee8,_0x431a47,_0x1edb4d,_0x377b54);_0x3805da(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 98a6aca..0ca7467 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 _0xd0cd=['catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','data1','license','split','format','%s:%s:%s','base64','utf8','parse','hasOwnProperty','use','License','then','count','status','json'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd0cd,0xe7));var _0xdd0c=function(_0x1f55f3,_0xac0628){_0x1f55f3=_0x1f55f3-0x0;var _0x456d70=_0xd0cd[_0x1f55f3];return _0x456d70;};'use strict';var crypto=require(_0xdd0c('0x0'));var util=require(_0xdd0c('0x1'));var compose=require(_0xdd0c('0x2'));var db=require(_0xdd0c('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x16d093,_0x259190){if(_0x16d093&&_0x259190){if(_0x259190[_0xdd0c('0x4')]&&_0x259190[_0xdd0c('0x5')]){var _0x4a14fe=_0x259190[_0xdd0c('0x4')];var _0x3c0c55=_0x259190[_0xdd0c('0x5')];var _0x551800=_0x4a14fe['split']('-')[0x4];var _0xb3fe81=_0x4a14fe[_0xdd0c('0x6')]('-')[0x0];var _0x1a28ec=crypto['createDecipher']('aes-256-ctr',util[_0xdd0c('0x7')](_0xdd0c('0x8'),_0x551800,_0x4a14fe,_0xb3fe81));var _0x1e5b13=_0x1a28ec['update'](_0x3c0c55,_0xdd0c('0x9'),_0xdd0c('0xa'));_0x1e5b13+=_0x1a28ec['final'](_0xdd0c('0xa'));var _0x51bd77=JSON[_0xdd0c('0xb')](_0x1e5b13);return _0x51bd77[_0xdd0c('0xc')](_0x16d093)?_0x51bd77[_0x16d093]:null;}}return null;}function isLimit(_0x567962,_0x17d9b7,_0x80c14c,_0x2dbec6){var _0x35cfca=_0x17d9b7;return compose()[_0xdd0c('0xd')](function(_0x50f6e5,_0x830e43,_0x28eb5b){return db[_0xdd0c('0xe')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0xdd0c('0xf')](function(_0x5b3ae6){var _0x32cd62=getValueFromLicense(_0x567962,_0x5b3ae6);return _0x32cd62?_0x32cd62:_0x35cfca;})[_0xdd0c('0xf')](function(_0x2e26a0){_0x35cfca=_0x2e26a0;return _0x80c14c[_0xdd0c('0x10')](_0x2dbec6);})['then'](function(_0x5785ce){if(_0x5785ce>=_0x35cfca){return _0x830e43[_0xdd0c('0x11')](0x193)[_0xdd0c('0x12')]({'message':util[_0xdd0c('0x7')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x567962)});}_0x28eb5b();})[_0xdd0c('0x13')](function(_0x156479){_0x28eb5b(_0x156479);});});}function isUserLimit(){return isLimit(_0xdd0c('0x14'),0x1,db[_0xdd0c('0x15')],{'where':{'$or':[{'role':_0xdd0c('0x16')},{'role':_0xdd0c('0x17')}]}});}exports[_0xdd0c('0x18')]=isUserLimit; \ No newline at end of file +var _0xec18=['use','License','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','user','isUserLimit','util','composable-middleware','../../mysqldb','data1','license','split','aes-256-ctr','format','%s:%s:%s','base64','final','utf8','parse','hasOwnProperty'];(function(_0x1b776e,_0x1d341e){var _0x3b8294=function(_0x352b9a){while(--_0x352b9a){_0x1b776e['push'](_0x1b776e['shift']());}};_0x3b8294(++_0x1d341e);}(_0xec18,0x12a));var _0x8ec1=function(_0x429674,_0x274942){_0x429674=_0x429674-0x0;var _0x4b5742=_0xec18[_0x429674];return _0x4b5742;};'use strict';var crypto=require('crypto');var util=require(_0x8ec1('0x0'));var compose=require(_0x8ec1('0x1'));var db=require(_0x8ec1('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x2c330,_0x6de3fe){if(_0x2c330&&_0x6de3fe){if(_0x6de3fe[_0x8ec1('0x3')]&&_0x6de3fe[_0x8ec1('0x4')]){var _0x2c3c08=_0x6de3fe[_0x8ec1('0x3')];var _0x44fb9a=_0x6de3fe['license'];var _0x8fdcda=_0x2c3c08[_0x8ec1('0x5')]('-')[0x4];var _0x264288=_0x2c3c08[_0x8ec1('0x5')]('-')[0x0];var _0x5a2df5=crypto['createDecipher'](_0x8ec1('0x6'),util[_0x8ec1('0x7')](_0x8ec1('0x8'),_0x8fdcda,_0x2c3c08,_0x264288));var _0x521463=_0x5a2df5['update'](_0x44fb9a,_0x8ec1('0x9'),'utf8');_0x521463+=_0x5a2df5[_0x8ec1('0xa')](_0x8ec1('0xb'));var _0x2d26d4=JSON[_0x8ec1('0xc')](_0x521463);return _0x2d26d4[_0x8ec1('0xd')](_0x2c330)?_0x2d26d4[_0x2c330]:null;}}return null;}function isLimit(_0xcf8981,_0x37b6f3,_0x483a5e,_0x47f6e2){var _0x4e3f0d=_0x37b6f3;return compose()[_0x8ec1('0xe')](function(_0x1529b7,_0x599157,_0x37a768){return db[_0x8ec1('0xf')][_0x8ec1('0x10')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x650bca){var _0x5e30c9=getValueFromLicense(_0xcf8981,_0x650bca);return _0x5e30c9?_0x5e30c9:_0x4e3f0d;})[_0x8ec1('0x11')](function(_0x276c28){_0x4e3f0d=_0x276c28;return _0x483a5e['count'](_0x47f6e2);})[_0x8ec1('0x11')](function(_0x3f5d12){if(_0x3f5d12>=_0x4e3f0d){return _0x599157[_0x8ec1('0x12')](0x193)[_0x8ec1('0x13')]({'message':util['format'](_0x8ec1('0x14'),_0xcf8981)});}_0x37a768();})[_0x8ec1('0x15')](function(_0x29ee84){_0x37a768(_0x29ee84);});});}function isUserLimit(){return isLimit(_0x8ec1('0x16'),0x1,db[_0x8ec1('0x17')],{'where':{'$or':[{'role':'admin'},{'role':_0x8ec1('0x18')}]}});}exports[_0x8ec1('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 743588f..055c6eb 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 _0xe1cb=['moment','fields','filters','isEmpty','forOwn','isArray','parse','split','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','ASC','omit','isObject','isString','unset','hasOwnProperty','^[0-9]*$','lodash'];(function(_0x3bbc29,_0x4acaf){var _0x321477=function(_0xd3f554){while(--_0xd3f554){_0x3bbc29['push'](_0x3bbc29['shift']());}};_0x321477(++_0x4acaf);}(_0xe1cb,0x103));var _0xbe1c=function(_0xc24780,_0x53c1a7){_0xc24780=_0xc24780-0x0;var _0x1c160d=_0xe1cb[_0xc24780];return _0x1c160d;};'use strict';var _=require(_0xbe1c('0x0'));var moment=require(_0xbe1c('0x1'));var sequelize=require('sequelize');var LIMIT_VALUE=0xfa;exports[_0xbe1c('0x2')]=function(_0x52bf48){var _0x14c29b=null;if(_0x52bf48){_0x14c29b=_0x52bf48['split'](',');}return _0x14c29b;};exports[_0xbe1c('0x3')]=function(_0x125577){var _0x3f56ae={};if(!_[_0xbe1c('0x4')](_0x125577)){_0x3f56ae={};_[_0xbe1c('0x5')](_0x125577,function(_0xf756c1,_0x4bac9f){try{_0x3f56ae[_0x4bac9f]=_[_0xbe1c('0x6')](_0xf756c1)?_0xf756c1:JSON[_0xbe1c('0x7')](_0xf756c1);}catch(_0x583059){_0x3f56ae[_0x4bac9f]=_0xf756c1[_0xbe1c('0x8')](',');}});}return _0x3f56ae;};exports[_0xbe1c('0x9')]=function(_0x414bf8){_0x414bf8=parseInt(_0x414bf8,0xa);if(!_0x414bf8||_0x414bf8<0x0){_0x414bf8=LIMIT_VALUE;}return _0x414bf8;};exports[_0xbe1c('0xa')]=function(_0x5a5130){_0x5a5130=parseInt(_0x5a5130,0xa);if(!_0x5a5130||_0x5a5130<0x0){_0x5a5130=0x0;}return _0x5a5130;};exports[_0xbe1c('0xb')]=function(_0x2b628b){var _0xc4ae,_0x355851=null;if(_0x2b628b){_0xc4ae=_0x2b628b[_0xbe1c('0x8')](',');_0x355851=_[_0xbe1c('0xc')](_0xc4ae,function(_0x271d8f){if(_0x271d8f[_0xbe1c('0xd')]('-')===0x0){return[_0x271d8f===_0xbe1c('0xe')?sequelize[_0xbe1c('0xf')](sequelize[_0xbe1c('0x10')](_0xbe1c('0xe')),_0xbe1c('0x11')):_0x271d8f[_0xbe1c('0x12')](0x1),'DESC'];}else{return[_0x271d8f===_0xbe1c('0xe')?sequelize[_0xbe1c('0xf')](sequelize[_0xbe1c('0x10')](_0xbe1c('0xe')),'unsigned'):_0x271d8f,_0xbe1c('0x13')];}});}return _0x355851;};exports['omit']=function(_0x24bc8a,_0x49c5aa){if(_['isEmpty'](_0x24bc8a)){return _0x24bc8a;}if(_[_0xbe1c('0x6')](_0x24bc8a)){for(var _0x568934=0x0;_0x568934<_0x24bc8a['length'];_0x568934+=0x1){_0x24bc8a[_0x568934]=this[_0xbe1c('0x14')](_0x24bc8a[_0x568934],_0x49c5aa);}return _0x24bc8a;}if(!_[_0xbe1c('0x15')](_0x24bc8a)){return _0x24bc8a;}if(_[_0xbe1c('0x16')](_0x49c5aa)){_0x49c5aa=[_0x49c5aa];}if(!_[_0xbe1c('0x6')](_0x49c5aa)){return _0x24bc8a;}for(var _0x3fc7a7=0x0;_0x3fc7a7<_0x49c5aa['length'];_0x3fc7a7+=0x1){_[_0xbe1c('0x17')](_0x24bc8a,_0x49c5aa[_0x3fc7a7]);}for(var _0x51f973 in _0x24bc8a){if(_0x24bc8a[_0xbe1c('0x18')](_0x51f973)){_0x24bc8a[_0x51f973]=this[_0xbe1c('0x14')](_0x24bc8a[_0x51f973],_0x49c5aa);}}return _0x24bc8a;};exports['isNumeric']=function(_0x2fc01a){return _0x2fc01a['match'](RegExp(_0xbe1c('0x19')))?!![]:![];};exports['isEmail']=function(_0xb246ab){return _0xb246ab['match'](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file +var _0x52b6=['^[0-9]*$','isEmail','lodash','moment','fields','split','filters','forOwn','parse','limit','offset','sort','map','indexOf','priority','col','unsigned','substr','cast','ASC','omit','isEmpty','isObject','isString','isArray','unset','hasOwnProperty','isNumeric','match'];(function(_0xe6f219,_0x2a4bc7){var _0x3a2c32=function(_0x1d8319){while(--_0x1d8319){_0xe6f219['push'](_0xe6f219['shift']());}};_0x3a2c32(++_0x2a4bc7);}(_0x52b6,0xb0));var _0x652b=function(_0x182e61,_0x170cac){_0x182e61=_0x182e61-0x0;var _0x34fb86=_0x52b6[_0x182e61];return _0x34fb86;};'use strict';var _=require(_0x652b('0x0'));var moment=require(_0x652b('0x1'));var sequelize=require('sequelize');var LIMIT_VALUE=0xfa;exports[_0x652b('0x2')]=function(_0x24d98d){var _0x35ace0=null;if(_0x24d98d){_0x35ace0=_0x24d98d[_0x652b('0x3')](',');}return _0x35ace0;};exports[_0x652b('0x4')]=function(_0x24b685){var _0x3e1d48={};if(!_['isEmpty'](_0x24b685)){_0x3e1d48={};_[_0x652b('0x5')](_0x24b685,function(_0x396097,_0x253a36){try{_0x3e1d48[_0x253a36]=_['isArray'](_0x396097)?_0x396097:JSON[_0x652b('0x6')](_0x396097);}catch(_0x3cda18){_0x3e1d48[_0x253a36]=_0x396097[_0x652b('0x3')](',');}});}return _0x3e1d48;};exports[_0x652b('0x7')]=function(_0x264ed4){_0x264ed4=parseInt(_0x264ed4,0xa);if(!_0x264ed4||_0x264ed4<0x0){_0x264ed4=LIMIT_VALUE;}return _0x264ed4;};exports[_0x652b('0x8')]=function(_0x2e6e2a){_0x2e6e2a=parseInt(_0x2e6e2a,0xa);if(!_0x2e6e2a||_0x2e6e2a<0x0){_0x2e6e2a=0x0;}return _0x2e6e2a;};exports[_0x652b('0x9')]=function(_0x15b1c1){var _0x4682c9,_0x125115=null;if(_0x15b1c1){_0x4682c9=_0x15b1c1[_0x652b('0x3')](',');_0x125115=_[_0x652b('0xa')](_0x4682c9,function(_0x2ed1e0){if(_0x2ed1e0[_0x652b('0xb')]('-')===0x0){return[_0x2ed1e0===_0x652b('0xc')?sequelize['cast'](sequelize[_0x652b('0xd')](_0x652b('0xc')),_0x652b('0xe')):_0x2ed1e0[_0x652b('0xf')](0x1),'DESC'];}else{return[_0x2ed1e0===_0x652b('0xc')?sequelize[_0x652b('0x10')](sequelize['col'](_0x652b('0xc')),_0x652b('0xe')):_0x2ed1e0,_0x652b('0x11')];}});}return _0x125115;};exports[_0x652b('0x12')]=function(_0x3de284,_0x500b82){if(_[_0x652b('0x13')](_0x3de284)){return _0x3de284;}if(_['isArray'](_0x3de284)){for(var _0x1d4cd0=0x0;_0x1d4cd0<_0x3de284['length'];_0x1d4cd0+=0x1){_0x3de284[_0x1d4cd0]=this[_0x652b('0x12')](_0x3de284[_0x1d4cd0],_0x500b82);}return _0x3de284;}if(!_[_0x652b('0x14')](_0x3de284)){return _0x3de284;}if(_[_0x652b('0x15')](_0x500b82)){_0x500b82=[_0x500b82];}if(!_[_0x652b('0x16')](_0x500b82)){return _0x3de284;}for(var _0x2883fe=0x0;_0x2883fe<_0x500b82['length'];_0x2883fe+=0x1){_[_0x652b('0x17')](_0x3de284,_0x500b82[_0x2883fe]);}for(var _0x152f08 in _0x3de284){if(_0x3de284[_0x652b('0x18')](_0x152f08)){_0x3de284[_0x152f08]=this[_0x652b('0x12')](_0x3de284[_0x152f08],_0x500b82);}}return _0x3de284;};exports[_0x652b('0x19')]=function(_0x18298f){return _0x18298f[_0x652b('0x1a')](RegExp(_0x652b('0x1b')))?!![]:![];};exports[_0x652b('0x1c')]=function(_0x1fcbd6){return _0x1fcbd6[_0x652b('0x1a')](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 48d1571..40c96cb 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['passport','cors','moment','./environment','../mysqldb','get','env','production','use','join','root','public','favicon.ico','set','appPath','development','test','client','json\x20replacer','split','/server/views','engine','html','ejs','renderFile','urlencoded','50mb','json','express','serve-favicon','body-parser','method-override','errorhandler','path'];(function(_0x197185,_0x251145){var _0x2c8af1=function(_0x1dbcfd){while(--_0x1dbcfd){_0x197185['push'](_0x197185['shift']());}};_0x2c8af1(++_0x251145);}(_0x34e8,0x12c));var _0x834e=function(_0xe04894,_0x1e43de){_0xe04894=_0xe04894-0x0;var _0x3aea2a=_0x34e8[_0xe04894];return _0x3aea2a;};'use strict';var express=require(_0x834e('0x0'));var favicon=require(_0x834e('0x1'));var bodyParser=require(_0x834e('0x2'));var methodOverride=require(_0x834e('0x3'));var cookieParser=require('cookie-parser');var errorHandler=require(_0x834e('0x4'));var path=require(_0x834e('0x5'));var passport=require(_0x834e('0x6'));var cors=require(_0x834e('0x7'));var moment=require(_0x834e('0x8'));var config=require(_0x834e('0x9'));var db=require(_0x834e('0xa'))['db'];exports['default']=function(_0x858aa1){var _0x52056d=_0x858aa1[_0x834e('0xb')](_0x834e('0xc'));if(_0x52056d===_0x834e('0xd')){_0x858aa1[_0x834e('0xe')](favicon(path[_0x834e('0xf')](config[_0x834e('0x10')],_0x834e('0x11'),_0x834e('0x12'))));_0x858aa1[_0x834e('0x13')](_0x834e('0x14'),path[_0x834e('0xf')](config[_0x834e('0x10')],_0x834e('0x11')));}if(_0x52056d===_0x834e('0x15')||_0x52056d===_0x834e('0x16')){_0x858aa1[_0x834e('0xe')](favicon(path[_0x834e('0xf')](config['root'],_0x834e('0x17'),_0x834e('0x12'))));_0x858aa1['set'](_0x834e('0x14'),path[_0x834e('0xf')](config[_0x834e('0x10')],_0x834e('0x17')));_0x858aa1['use'](errorHandler());}_0x858aa1[_0x834e('0x13')](_0x834e('0x18'),function(_0x57274a,_0x316205){if(this[_0x57274a]instanceof Date){_0x316205=this[_0x57274a]['toISOString']()[_0x834e('0x19')]('.')[0x0]+'Z';}return _0x316205;});_0x858aa1[_0x834e('0xe')](express['static'](_0x858aa1[_0x834e('0xb')](_0x834e('0x14'))));_0x858aa1[_0x834e('0x13')]('views',config[_0x834e('0x10')]+_0x834e('0x1a'));_0x858aa1[_0x834e('0x1b')](_0x834e('0x1c'),require(_0x834e('0x1d'))[_0x834e('0x1e')]);_0x858aa1[_0x834e('0x13')]('view\x20engine',_0x834e('0x1c'));_0x858aa1[_0x834e('0xe')](bodyParser[_0x834e('0x1f')]({'limit':_0x834e('0x20'),'extended':!![]}));_0x858aa1['use'](bodyParser[_0x834e('0x21')]({'limit':_0x834e('0x20')}));_0x858aa1['use'](cors());_0x858aa1[_0x834e('0xe')](methodOverride());_0x858aa1[_0x834e('0xe')](cookieParser());_0x858aa1[_0x834e('0xe')](passport['initialize']());}; \ No newline at end of file +var _0xe706=['toISOString','engine','html','view\x20engine','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','env','production','use','join','root','public','favicon.ico','set','appPath','client'];(function(_0x262536,_0x45437c){var _0x1d252c=function(_0x3d5bac){while(--_0x3d5bac){_0x262536['push'](_0x262536['shift']());}};_0x1d252c(++_0x45437c);}(_0xe706,0xa3));var _0x6e70=function(_0x50bca7,_0xb23979){_0x50bca7=_0x50bca7-0x0;var _0x40e5ee=_0xe706[_0x50bca7];return _0x40e5ee;};'use strict';var express=require(_0x6e70('0x0'));var favicon=require(_0x6e70('0x1'));var bodyParser=require(_0x6e70('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x6e70('0x3'));var errorHandler=require(_0x6e70('0x4'));var path=require(_0x6e70('0x5'));var passport=require(_0x6e70('0x6'));var cors=require(_0x6e70('0x7'));var moment=require(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var db=require(_0x6e70('0xa'))['db'];exports[_0x6e70('0xb')]=function(_0x4381d1){var _0x36357b=_0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'));if(_0x36357b===_0x6e70('0xe')){_0x4381d1[_0x6e70('0xf')](favicon(path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x12'),_0x6e70('0x13'))));_0x4381d1[_0x6e70('0x14')](_0x6e70('0x15'),path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x12')));}if(_0x36357b==='development'||_0x36357b==='test'){_0x4381d1[_0x6e70('0xf')](favicon(path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x16'),_0x6e70('0x13'))));_0x4381d1[_0x6e70('0x14')](_0x6e70('0x15'),path[_0x6e70('0x10')](config['root'],'client'));_0x4381d1['use'](errorHandler());}_0x4381d1[_0x6e70('0x14')]('json\x20replacer',function(_0x53aed0,_0x304716){if(this[_0x53aed0]instanceof Date){_0x304716=this[_0x53aed0][_0x6e70('0x17')]()['split']('.')[0x0]+'Z';}return _0x304716;});_0x4381d1[_0x6e70('0xf')](express['static'](_0x4381d1[_0x6e70('0xc')](_0x6e70('0x15'))));_0x4381d1['set']('views',config[_0x6e70('0x11')]+'/server/views');_0x4381d1[_0x6e70('0x18')](_0x6e70('0x19'),require('ejs')['renderFile']);_0x4381d1[_0x6e70('0x14')](_0x6e70('0x1a'),_0x6e70('0x19'));_0x4381d1[_0x6e70('0xf')](bodyParser[_0x6e70('0x1b')]({'limit':_0x6e70('0x1c'),'extended':!![]}));_0x4381d1[_0x6e70('0xf')](bodyParser[_0x6e70('0x1d')]({'limit':_0x6e70('0x1c')}));_0x4381d1[_0x6e70('0xf')](cors());_0x4381d1['use'](methodOverride());_0x4381d1[_0x6e70('0xf')](cookieParser());_0x4381d1[_0x6e70('0xf')](passport[_0x6e70('0x1e')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 82370c4..f4cb203 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 _0x5e9a=['substring','bimedia-machine-uuid','child_process','networkInterfaces','keys','filter','family','head','mac','00:00:00:00:00:00','127.0.0.1','map','model','join','createHash','md5','update','platform','win32','replace','hostname','macAddress','digest'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x5e9a,0x8b));var _0xa5e9=function(_0x3d5c56,_0x1f3ba2){_0x3d5c56=_0x3d5c56-0x0;var _0x3906c8=_0x5e9a[_0x3d5c56];return _0x3906c8;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0xa5e9('0x0'));var exec=require(_0xa5e9('0x1'))['execSync'];function getInterfaces(){var _0x3cc8c9=[];var _0x485167=os[_0xa5e9('0x2')]();var _0x25a7b7=_['orderBy'](_[_0xa5e9('0x3')](_0x485167));for(var _0x4bed05=0x0;_0x4bed05<_0x25a7b7['length'];_0x4bed05++){var _0x3c84f4=_0x485167[_0x25a7b7[_0x4bed05]][_0xa5e9('0x4')](function(_0x5425ff){return _0x5425ff[_0xa5e9('0x5')]==='IPv4'&&_0x5425ff['internal']===![];});_0x3cc8c9=_0x3cc8c9['concat'](_0x3c84f4);}return _0x3cc8c9;}function getFirstInterface(){var _0x10f3af=_[_0xa5e9('0x6')](getInterfaces());return{'macAddress':_0x10f3af&&_0x10f3af[_0xa5e9('0x7')]?_0x10f3af[_0xa5e9('0x7')]:_0xa5e9('0x8'),'ipAddress':_0x10f3af&&_0x10f3af['address']?_0x10f3af['address']:_0xa5e9('0x9')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0xfdad40=_['orderBy'](os['cpus']()[_0xa5e9('0xa')](function(_0x3f1593){return _0x3f1593[_0xa5e9('0xb')];}))[_0xa5e9('0xc')](':');return crypto[_0xa5e9('0xd')](_0xa5e9('0xe'))[_0xa5e9('0xf')](_0xfdad40)['digest']('hex');}exports['getUuid']=function(){switch(os[_0xa5e9('0x10')]()){case _0xa5e9('0x11'):return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0xa5e9('0x12')]('\x0d\x0a','');default:var _0x53444f=getFirstInterface();var _0x4b4b9c=getCPUhash();var _0x16e312=_0x4b4b9c+'|'+os[_0xa5e9('0x13')]()+'|'+_0x53444f[_0xa5e9('0x14')]+'|'+_0x53444f['ipAddress'];var _0x2c7400=crypto[_0xa5e9('0xd')](_0xa5e9('0xe'))['update'](_0x16e312)[_0xa5e9('0x15')]('hex');return _0x2c7400[_0xa5e9('0x16')](0x0,0x8)+'-'+_0x2c7400[_0xa5e9('0x16')](0x8,0xc)+'-'+_0x2c7400[_0xa5e9('0x16')](0xc,0x10)+'-'+_0x2c7400['substring'](0x10,0x14)+'-'+_0x2c7400['substring'](0x14);}}; \ No newline at end of file +var _0x37cb=['md5','update','digest','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','replace','hostname','ipAddress','createHash','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','orderBy','keys','length','filter','family','IPv4','concat','head','mac','address','cpus','map','model','join'];(function(_0x3ef60f,_0x286809){var _0x9871c2=function(_0x9e3f7b){while(--_0x9e3f7b){_0x3ef60f['push'](_0x3ef60f['shift']());}};_0x9871c2(++_0x286809);}(_0x37cb,0x12d));var _0xb37c=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x37cb[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xb37c('0x0'));var os=require('os');var crypto=require(_0xb37c('0x1'));var machine=require(_0xb37c('0x2'));var exec=require(_0xb37c('0x3'))[_0xb37c('0x4')];function getInterfaces(){var _0x3dd800=[];var _0x3bdfba=os['networkInterfaces']();var _0x4afd86=_[_0xb37c('0x5')](_[_0xb37c('0x6')](_0x3bdfba));for(var _0x3a2bf1=0x0;_0x3a2bf1<_0x4afd86[_0xb37c('0x7')];_0x3a2bf1++){var _0xdcf896=_0x3bdfba[_0x4afd86[_0x3a2bf1]][_0xb37c('0x8')](function(_0x3d051b){return _0x3d051b[_0xb37c('0x9')]===_0xb37c('0xa')&&_0x3d051b['internal']===![];});_0x3dd800=_0x3dd800[_0xb37c('0xb')](_0xdcf896);}return _0x3dd800;}function getFirstInterface(){var _0x37dd1a=_[_0xb37c('0xc')](getInterfaces());return{'macAddress':_0x37dd1a&&_0x37dd1a[_0xb37c('0xd')]?_0x37dd1a[_0xb37c('0xd')]:'00:00:00:00:00:00','ipAddress':_0x37dd1a&&_0x37dd1a[_0xb37c('0xe')]?_0x37dd1a[_0xb37c('0xe')]:'127.0.0.1'};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x519175=_[_0xb37c('0x5')](os[_0xb37c('0xf')]()[_0xb37c('0x10')](function(_0x5449f9){return _0x5449f9[_0xb37c('0x11')];}))[_0xb37c('0x12')](':');return crypto['createHash'](_0xb37c('0x13'))[_0xb37c('0x14')](_0x519175)[_0xb37c('0x15')](_0xb37c('0x16'));}exports[_0xb37c('0x17')]=function(){switch(os[_0xb37c('0x18')]()){case _0xb37c('0x19'):return exec(_0xb37c('0x1a'),{'encoding':'utf8'})[_0xb37c('0x1b')]('\x0d\x0a','');default:var _0x4282c7=getFirstInterface();var _0x16635e=getCPUhash();var _0x178d95=_0x16635e+'|'+os[_0xb37c('0x1c')]()+'|'+_0x4282c7['macAddress']+'|'+_0x4282c7[_0xb37c('0x1d')];var _0x19b903=crypto[_0xb37c('0x1e')]('md5')[_0xb37c('0x14')](_0x178d95)['digest']('hex');return _0x19b903['substring'](0x0,0x8)+'-'+_0x19b903[_0xb37c('0x1f')](0x8,0xc)+'-'+_0x19b903[_0xb37c('0x1f')](0xc,0x10)+'-'+_0x19b903[_0xb37c('0x1f')](0x10,0x14)+'-'+_0x19b903[_0xb37c('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 0c9f2d1..148587a 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 _0xce46=['%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','message','getUuid','License','default','util','crypto','moment','bluebird','pkginfo','../../mysqldb','../environment','./hardware','../logger','../../api/jira/jira.controller','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','GET','catch','createCipher','aes-256-ctr','secrets','session','update','utf8','base64','final','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','then','|reason|','|uuid|','|machineUuid|','|name|','|email|','getFirstInterface','ipAddress','MOTLICENSE','email','get','active','license','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','info','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s'];(function(_0x4214af,_0x6ca1f9){var _0x976293=function(_0x210172){while(--_0x210172){_0x4214af['push'](_0x4214af['shift']());}};_0x976293(++_0x6ca1f9);}(_0xce46,0x1a6));var _0x6ce4=function(_0x163555,_0x27ce78){_0x163555=_0x163555-0x0;var _0x250307=_0xce46[_0x163555];return _0x250307;};'use strict';var util=require(_0x6ce4('0x0'));var crypto=require(_0x6ce4('0x1'));var moment=require(_0x6ce4('0x2'));var rp=require('request-promise');var BPromise=require(_0x6ce4('0x3'));var pkginfo=require(_0x6ce4('0x4'))(module,'version');var db=require(_0x6ce4('0x5'))['db'];var config=require(_0x6ce4('0x6'));var hardware=require(_0x6ce4('0x7'));var logger=require(_0x6ce4('0x8'))('license');var jira=require(_0x6ce4('0x9'));var HOST=_0x6ce4('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x4409a9){return new BPromise(function(_0x107299,_0x3cc107){var _0x2f9bd0=util[_0x6ce4('0xb')](_0x6ce4('0xc'),HOST,_0x4409a9,module[_0x6ce4('0xd')][_0x6ce4('0xe')]);if(oldToken){_0x2f9bd0=util[_0x6ce4('0xb')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x4409a9,module[_0x6ce4('0xd')][_0x6ce4('0xe')],oldToken);}var _0x45786c={'uri':_0x2f9bd0,'method':_0x6ce4('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x45786c)['then'](function(_0x1f53df){_0x107299(_0x1f53df);})[_0x6ce4('0x10')](function(_0x32ab21){_0x3cc107(_0x32ab21);});});}function encryptDate(_0x303573){var _0x23cf02=crypto[_0x6ce4('0x11')](_0x6ce4('0x12'),config[_0x6ce4('0x13')][_0x6ce4('0x14')]);var _0x1ebccd=_0x23cf02[_0x6ce4('0x15')](_0x303573,_0x6ce4('0x16'),_0x6ce4('0x17'));_0x1ebccd+=_0x23cf02[_0x6ce4('0x18')]('base64');return _0x1ebccd;}function decryptDate(_0x3fabe7){var _0x5181aa=crypto['createDecipher'](_0x6ce4('0x12'),config['secrets']['session']);var _0x30b698=_0x5181aa[_0x6ce4('0x15')](_0x3fabe7,_0x6ce4('0x17'),'utf8');_0x30b698+=_0x5181aa[_0x6ce4('0x18')](_0x6ce4('0x16'));return _0x30b698;}function sendJiraAlert(_0x1333f5,_0x45ae67,_0x3cffde){var _0xd24b8c=_0x6ce4('0x19');return db[_0x6ce4('0x1a')][_0x6ce4('0x1b')]({'where':{'role':_0x6ce4('0x1c')},'attributes':[_0x6ce4('0x1d'),'email'],'raw':!![]})[_0x6ce4('0x1e')](function(_0x36bb31){ADMIN=_0x36bb31;_0xd24b8c+=_0x6ce4('0x1f')+_0x3cffde+'|\x0a';_0xd24b8c+=_0x6ce4('0x20')+_0x1333f5+'|\x0a';_0xd24b8c+=_0x6ce4('0x21')+_0x45ae67+'|\x0a';_0xd24b8c+=_0x6ce4('0x22')+ADMIN['fullname']+'|\x0a';_0xd24b8c+=_0x6ce4('0x23')+ADMIN['email']+'|\x0a';return _0xd24b8c;})['then'](function(_0x5e358b){var _0x395575=hardware[_0x6ce4('0x24')]()[_0x6ce4('0x25')];return jira['openIssue']({'key':_0x6ce4('0x26'),'summary':'Motion\x20License\x20Alert','description':_0x5e358b,'issuetype':'Alert','oldToken':_0x1333f5,'newToken':_0x45ae67,'email':ADMIN[_0x6ce4('0x27')],'name':ADMIN[_0x6ce4('0x1d')],'reason':GRAY_PERIOD_REASON,'ip':_0x395575});});}function manageLicense(_0x50d83f,_0x488dec){var _0x3c716e=_0x488dec[_0x6ce4('0x28')]({'plain':!![]});httpRequest(_0x50d83f)['then'](function(_0x5d2d4d){if(oldToken){oldToken=undefined;}if(_0x5d2d4d[_0x6ce4('0x29')]){if(!_0x3c716e['license']&&_0x3c716e['license']!=_0x5d2d4d[_0x6ce4('0x2a')]||_0x3c716e[_0x6ce4('0x2a')]&&_0x3c716e[_0x6ce4('0x2b')]){logger['info'](_0x6ce4('0x2c'));}if(_0x3c716e[_0x6ce4('0x2a')]&&!_0x3c716e[_0x6ce4('0x2b')]&&_0x3c716e[_0x6ce4('0x2a')]!=_0x5d2d4d[_0x6ce4('0x2a')]){logger['info'](_0x6ce4('0x2d'));}if(_0x3c716e[_0x6ce4('0x2a')]&&!_0x3c716e[_0x6ce4('0x2b')]&&_0x3c716e[_0x6ce4('0x2a')]==_0x5d2d4d[_0x6ce4('0x2a')]){return _0x488dec;}return _0x488dec['update']({'data1':_0x50d83f,'data2':null,'license':_0x5d2d4d[_0x6ce4('0x2a')]});}else{if(_0x5d2d4d[_0x6ce4('0x2a')]||_0x3c716e[_0x6ce4('0x2a')]){if(!_0x3c716e['data2']){if(_0x3c716e[_0x6ce4('0x2e')]==_0x50d83f){GRAY_PERIOD_REASON='Disabled';logger[_0x6ce4('0x2f')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x6ce4('0x30');oldToken=_0x3c716e[_0x6ce4('0x2e')];logger[_0x6ce4('0x2f')](_0x6ce4('0x31'),_0x3c716e['data1'],_0x50d83f);}sendJiraAlert(_0x3c716e[_0x6ce4('0x2e')],_0x5d2d4d['uuid'],GRAY_PERIOD_REASON);logger[_0x6ce4('0x2f')](_0x6ce4('0x32'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x6ce4('0xb')](_0x6ce4('0x33')));return _0x488dec[_0x6ce4('0x15')]({'data2':encryptDate(moment()['format'](_0x6ce4('0x33')))});}else{if(moment()[_0x6ce4('0x34')](decryptDate(_0x3c716e[_0x6ce4('0x2b')]),_0x6ce4('0x35'))>DAYS){logger['info'](_0x6ce4('0x36'),moment()['format'](_0x6ce4('0x33')));return _0x488dec[_0x6ce4('0x15')]({'data1':_0x50d83f,'data2':null,'license':null});}}}else{if(_0x3c716e[_0x6ce4('0x2e')]!=_0x50d83f){logger[_0x6ce4('0x2f')](_0x6ce4('0x31'),_0x3c716e[_0x6ce4('0x2e')],_0x50d83f);return _0x488dec[_0x6ce4('0x15')]({'data1':_0x50d83f,'data2':null,'license':null});}}}return _0x488dec;})[_0x6ce4('0x1e')](function(_0x249fde){_0x488dec=_0x249fde;})[_0x6ce4('0x10')](function(_0xd33bd7){logger['error'](_0xd33bd7[_0x6ce4('0x37')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x6ce4('0x38')](),_0x488dec);},TIME);});}function defaultLicense(){var _0x38b5f0=hardware[_0x6ce4('0x38')]();if(_0x38b5f0){return db[_0x6ce4('0x39')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x38b5f0}})['spread'](function(_0x2f36b5,_0x4163c0){logger[_0x6ce4('0x2f')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x38b5f0);manageLicense(_0x38b5f0,_0x2f36b5);})['catch'](function(_0x2549c8){logger['error'](_0x2549c8[_0x6ce4('0x37')]);});}}exports[_0x6ce4('0x3a')]=defaultLicense; \ No newline at end of file +var _0x3c53=['info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','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','message','finally','getUuid','License','findOrCreate','default','util','crypto','moment','bluebird','../../mysqldb','./hardware','../logger','license','../../api/jira/jira.controller','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','version','format','%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','|uuid|','|machineUuid|','|name|','|email|','getFirstInterface','ipAddress','Motion\x20License\x20Alert','Alert','get','active','data2'];(function(_0x353b0d,_0x19b3fe){var _0xd193b0=function(_0xd512c5){while(--_0xd512c5){_0x353b0d['push'](_0x353b0d['shift']());}};_0xd193b0(++_0x19b3fe);}(_0x3c53,0x92));var _0x33c5=function(_0x52974e,_0x3abfa0){_0x52974e=_0x52974e-0x0;var _0x59016d=_0x3c53[_0x52974e];return _0x59016d;};'use strict';var util=require(_0x33c5('0x0'));var crypto=require(_0x33c5('0x1'));var moment=require(_0x33c5('0x2'));var rp=require('request-promise');var BPromise=require(_0x33c5('0x3'));var pkginfo=require('pkginfo')(module,'version');var db=require(_0x33c5('0x4'))['db'];var config=require('../environment');var hardware=require(_0x33c5('0x5'));var logger=require(_0x33c5('0x6'))(_0x33c5('0x7'));var jira=require(_0x33c5('0x8'));var HOST=_0x33c5('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x3f96bb){return new BPromise(function(_0x27b4b5,_0x28c98e){var _0x175511=util['format'](_0x33c5('0xa'),HOST,_0x3f96bb,module[_0x33c5('0xb')][_0x33c5('0xc')]);if(oldToken){_0x175511=util[_0x33c5('0xd')](_0x33c5('0xe'),HOST,_0x3f96bb,module[_0x33c5('0xb')][_0x33c5('0xc')],oldToken);}var _0x45fbbf={'uri':_0x175511,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x45fbbf)['then'](function(_0x293183){_0x27b4b5(_0x293183);})[_0x33c5('0xf')](function(_0x5cacac){_0x28c98e(_0x5cacac);});});}function encryptDate(_0x2e2af1){var _0x217a6d=crypto[_0x33c5('0x10')](_0x33c5('0x11'),config[_0x33c5('0x12')][_0x33c5('0x13')]);var _0x2b790a=_0x217a6d[_0x33c5('0x14')](_0x2e2af1,_0x33c5('0x15'),_0x33c5('0x16'));_0x2b790a+=_0x217a6d[_0x33c5('0x17')](_0x33c5('0x16'));return _0x2b790a;}function decryptDate(_0x14b317){var _0x45c8b0=crypto[_0x33c5('0x18')](_0x33c5('0x11'),config[_0x33c5('0x12')][_0x33c5('0x13')]);var _0x590de1=_0x45c8b0[_0x33c5('0x14')](_0x14b317,'base64','utf8');_0x590de1+=_0x45c8b0[_0x33c5('0x17')](_0x33c5('0x15'));return _0x590de1;}function sendJiraAlert(_0x57ba8b,_0x5a6136,_0x259855){var _0x189363=_0x33c5('0x19');return db[_0x33c5('0x1a')][_0x33c5('0x1b')]({'where':{'role':_0x33c5('0x1c')},'attributes':[_0x33c5('0x1d'),_0x33c5('0x1e')],'raw':!![]})[_0x33c5('0x1f')](function(_0x346af9){ADMIN=_0x346af9;_0x189363+='|reason|'+_0x259855+'|\x0a';_0x189363+=_0x33c5('0x20')+_0x57ba8b+'|\x0a';_0x189363+=_0x33c5('0x21')+_0x5a6136+'|\x0a';_0x189363+=_0x33c5('0x22')+ADMIN[_0x33c5('0x1d')]+'|\x0a';_0x189363+=_0x33c5('0x23')+ADMIN[_0x33c5('0x1e')]+'|\x0a';return _0x189363;})[_0x33c5('0x1f')](function(_0x166692){var _0x31c64b=hardware[_0x33c5('0x24')]()[_0x33c5('0x25')];return jira['openIssue']({'key':'MOTLICENSE','summary':_0x33c5('0x26'),'description':_0x166692,'issuetype':_0x33c5('0x27'),'oldToken':_0x57ba8b,'newToken':_0x5a6136,'email':ADMIN[_0x33c5('0x1e')],'name':ADMIN[_0x33c5('0x1d')],'reason':GRAY_PERIOD_REASON,'ip':_0x31c64b});});}function manageLicense(_0x2a5b44,_0x16edd3){var _0x26e0d9=_0x16edd3[_0x33c5('0x28')]({'plain':!![]});httpRequest(_0x2a5b44)[_0x33c5('0x1f')](function(_0x5c8470){if(oldToken){oldToken=undefined;}if(_0x5c8470[_0x33c5('0x29')]){if(!_0x26e0d9[_0x33c5('0x7')]&&_0x26e0d9[_0x33c5('0x7')]!=_0x5c8470['license']||_0x26e0d9[_0x33c5('0x7')]&&_0x26e0d9[_0x33c5('0x2a')]){logger[_0x33c5('0x2b')](_0x33c5('0x2c'));}if(_0x26e0d9[_0x33c5('0x7')]&&!_0x26e0d9['data2']&&_0x26e0d9[_0x33c5('0x7')]!=_0x5c8470[_0x33c5('0x7')]){logger[_0x33c5('0x2b')](_0x33c5('0x2d'));}if(_0x26e0d9[_0x33c5('0x7')]&&!_0x26e0d9['data2']&&_0x26e0d9[_0x33c5('0x7')]==_0x5c8470['license']){return _0x16edd3;}return _0x16edd3[_0x33c5('0x14')]({'data1':_0x2a5b44,'data2':null,'license':_0x5c8470[_0x33c5('0x7')]});}else{if(_0x5c8470[_0x33c5('0x7')]||_0x26e0d9[_0x33c5('0x7')]){if(!_0x26e0d9[_0x33c5('0x2a')]){if(_0x26e0d9[_0x33c5('0x2e')]==_0x2a5b44){GRAY_PERIOD_REASON='Disabled';logger[_0x33c5('0x2b')](_0x33c5('0x2f'));}else{GRAY_PERIOD_REASON=_0x33c5('0x30');oldToken=_0x26e0d9[_0x33c5('0x2e')];logger[_0x33c5('0x2b')](_0x33c5('0x31'),_0x26e0d9[_0x33c5('0x2e')],_0x2a5b44);}sendJiraAlert(_0x26e0d9[_0x33c5('0x2e')],_0x5c8470[_0x33c5('0x32')],GRAY_PERIOD_REASON);logger[_0x33c5('0x2b')](_0x33c5('0x33'),GRAY_PERIOD_REASON[_0x33c5('0x34')](),moment()[_0x33c5('0xd')](_0x33c5('0x35')));return _0x16edd3[_0x33c5('0x14')]({'data2':encryptDate(moment()[_0x33c5('0xd')](_0x33c5('0x35')))});}else{if(moment()[_0x33c5('0x36')](decryptDate(_0x26e0d9[_0x33c5('0x2a')]),_0x33c5('0x37'))>DAYS){logger[_0x33c5('0x2b')](_0x33c5('0x38'),moment()[_0x33c5('0xd')](_0x33c5('0x35')));return _0x16edd3['update']({'data1':_0x2a5b44,'data2':null,'license':null});}}}else{if(_0x26e0d9['data1']!=_0x2a5b44){logger[_0x33c5('0x2b')](_0x33c5('0x31'),_0x26e0d9[_0x33c5('0x2e')],_0x2a5b44);return _0x16edd3['update']({'data1':_0x2a5b44,'data2':null,'license':null});}}}return _0x16edd3;})[_0x33c5('0x1f')](function(_0x394f36){_0x16edd3=_0x394f36;})[_0x33c5('0xf')](function(_0x1455c5){logger['error'](_0x1455c5[_0x33c5('0x39')]);})[_0x33c5('0x3a')](function(){setTimeout(function(){manageLicense(hardware[_0x33c5('0x3b')](),_0x16edd3);},TIME);});}function defaultLicense(){var _0x3a0e57=hardware[_0x33c5('0x3b')]();if(_0x3a0e57){return db[_0x33c5('0x3c')][_0x33c5('0x3d')]({'where':{'id':0x1},'defaults':{'data1':_0x3a0e57}})['spread'](function(_0x1d8caf,_0x53dee5){logger[_0x33c5('0x2b')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x3a0e57);manageLicense(_0x3a0e57,_0x1d8caf);})['catch'](function(_0x1a938d){logger['error'](_0x1a938d[_0x33c5('0x39')]);});}}exports[_0x33c5('0x3e')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index c16d91c..b1be112 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 _0xb955=['Breaking\x20license','message','Demo\x20license','License','find','defaults','then','checkLicense','util','lodash','moment','./hardware','../environment','../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','%s:%s:%s','update','base64','utf8','demo','uuid','machineUuid','getUuid','aes-256-ctr','secrets','session','final','gray','add','format','grayReason','changed','disabled','2027-01-01T00:00:00.000Z'];(function(_0x465515,_0x26fdc0){var _0x22bf51=function(_0x12f9d5){while(--_0x12f9d5){_0x465515['push'](_0x465515['shift']());}};_0x22bf51(++_0x26fdc0);}(_0xb955,0x120));var _0x5b95=function(_0x55aa4e,_0x4683e1){_0x55aa4e=_0x55aa4e-0x0;var _0x19406b=_0xb955[_0x55aa4e];return _0x19406b;};'use strict';var crypto=require('crypto');var util=require(_0x5b95('0x0'));var _=require(_0x5b95('0x1'));var moment=require(_0x5b95('0x2'));var hardware=require(_0x5b95('0x3'));var config=require(_0x5b95('0x4'));var db=require(_0x5b95('0x5'))['db'];function checkLicense(_0x19a766,_0xbd7cbc){if(_0x19a766){try{var _0x3dd5ac=_0xbd7cbc||_0x19a766[_0x5b95('0x6')];if(_[_0x5b95('0x7')](_0x3dd5ac)){throw new Error(_0x5b95('0x8'));}var _0x33535b=_0x19a766[_0x5b95('0x9')];var _0x480a5b=_0x19a766[_0x5b95('0xa')];var _0x1531d6=_0x33535b['split']('-')[0x4];var _0x568492=_0x33535b[_0x5b95('0xb')]('-')[0x0];var _0x5d5bf1=crypto[_0x5b95('0xc')]('aes-256-ctr',util['format'](_0x5b95('0xd'),_0x1531d6,_0x33535b,_0x568492));var _0x2679c5=_0x5d5bf1[_0x5b95('0xe')](_0x3dd5ac,_0x5b95('0xf'),_0x5b95('0x10'));_0x2679c5+=_0x5d5bf1['final'](_0x5b95('0x10'));var _0x1ab708=JSON['parse'](_0x2679c5);_0x1ab708[_0x5b95('0x11')]=![];_0x1ab708[_0x5b95('0x12')]=_0x33535b;_0x1ab708[_0x5b95('0x13')]=hardware[_0x5b95('0x14')]();if(_0x480a5b){var _0x3376ad=crypto['createDecipher'](_0x5b95('0x15'),config[_0x5b95('0x16')][_0x5b95('0x17')]);var _0x17855f=_0x3376ad[_0x5b95('0xe')](_0x480a5b,_0x5b95('0xf'),_0x5b95('0x10'));_0x17855f+=_0x3376ad[_0x5b95('0x18')](_0x5b95('0x10'));_0x1ab708[_0x5b95('0x19')]=_0x17855f;_0x1ab708['deadline']=moment(_0x17855f)[_0x5b95('0x1a')](0x7,'days')[_0x5b95('0x1b')]();_0x1ab708[_0x5b95('0x1c')]=_0x1ab708[_0x5b95('0x12')]!=_0x1ab708[_0x5b95('0x13')]?_0x5b95('0x1d'):_0x5b95('0x1e');}return _0x1ab708;}catch(_0x297f8e){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5b95('0x1f'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x5b95('0x20'),'uuid':_0x19a766[_0x5b95('0x9')],'machineUuid':hardware[_0x5b95('0x14')](),'message':_0x297f8e[_0x5b95('0x21')],'virtual':0x0,'voice':!![],'preferred':![],'screenrecording':![],'sales':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5b95('0x1f'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x5b95('0x22'),'uuid':_0x19a766['data1'],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'preferred':![],'screenrecording':![],'sales':![]};}exports['getLicense']=function(_0x5601bb){return db[_0x5b95('0x23')][_0x5b95('0x24')](_[_0x5b95('0x25')](_0x5601bb,{'raw':!![],'where':{'id':0x1}}))[_0x5b95('0x26')](function(_0x59050b){return checkLicense(_0x59050b,null);});};exports[_0x5b95('0x27')]=checkLicense; \ No newline at end of file +var _0xdef6=['message','Demo\x20license','getLicense','License','defaults','moment','./hardware','../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','demo','machineUuid','secrets','gray','deadline','add','days','grayReason','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','getUuid'];(function(_0x1550d5,_0x330654){var _0x245ab6=function(_0x5abdd5){while(--_0x5abdd5){_0x1550d5['push'](_0x1550d5['shift']());}};_0x245ab6(++_0x330654);}(_0xdef6,0x11d));var _0x6def=function(_0x3bea4,_0x56a1a5){_0x3bea4=_0x3bea4-0x0;var _0xf8e956=_0xdef6[_0x3bea4];return _0xf8e956;};'use strict';var crypto=require('crypto');var util=require('util');var _=require('lodash');var moment=require(_0x6def('0x0'));var hardware=require(_0x6def('0x1'));var config=require('../environment');var db=require(_0x6def('0x2'))['db'];function checkLicense(_0x4361c4,_0x1d4ada){if(_0x4361c4){try{var _0x4ae9f2=_0x1d4ada||_0x4361c4[_0x6def('0x3')];if(_[_0x6def('0x4')](_0x4ae9f2)){throw new Error(_0x6def('0x5'));}var _0x231bad=_0x4361c4[_0x6def('0x6')];var _0x36a54d=_0x4361c4['data2'];var _0x2c5bf0=_0x231bad[_0x6def('0x7')]('-')[0x4];var _0xc318d6=_0x231bad[_0x6def('0x7')]('-')[0x0];var _0x42f080=crypto[_0x6def('0x8')](_0x6def('0x9'),util[_0x6def('0xa')](_0x6def('0xb'),_0x2c5bf0,_0x231bad,_0xc318d6));var _0x27688f=_0x42f080[_0x6def('0xc')](_0x4ae9f2,_0x6def('0xd'),_0x6def('0xe'));_0x27688f+=_0x42f080[_0x6def('0xf')](_0x6def('0xe'));var _0x5ad572=JSON[_0x6def('0x10')](_0x27688f);_0x5ad572[_0x6def('0x11')]=![];_0x5ad572['uuid']=_0x231bad;_0x5ad572[_0x6def('0x12')]=hardware['getUuid']();if(_0x36a54d){var _0x592ac1=crypto[_0x6def('0x8')]('aes-256-ctr',config[_0x6def('0x13')]['session']);var _0xe78459=_0x592ac1[_0x6def('0xc')](_0x36a54d,_0x6def('0xd'),_0x6def('0xe'));_0xe78459+=_0x592ac1[_0x6def('0xf')](_0x6def('0xe'));_0x5ad572[_0x6def('0x14')]=_0xe78459;_0x5ad572[_0x6def('0x15')]=moment(_0xe78459)[_0x6def('0x16')](0x7,_0x6def('0x17'))[_0x6def('0xa')]();_0x5ad572[_0x6def('0x18')]=_0x5ad572['uuid']!=_0x5ad572[_0x6def('0x12')]?_0x6def('0x19'):_0x6def('0x1a');}return _0x5ad572;}catch(_0x594637){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6def('0x1b'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x6def('0x1c'),'uuid':_0x4361c4['data1'],'machineUuid':hardware[_0x6def('0x1d')](),'message':_0x594637[_0x6def('0x1e')],'virtual':0x0,'voice':!![],'preferred':![],'screenrecording':![],'sales':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6def('0x1b'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x6def('0x1f'),'uuid':_0x4361c4[_0x6def('0x6')],'machineUuid':hardware[_0x6def('0x1d')](),'virtual':0x0,'voice':!![],'preferred':![],'screenrecording':![],'sales':![]};}exports[_0x6def('0x20')]=function(_0x127384){return db[_0x6def('0x21')]['find'](_[_0x6def('0x22')](_0x127384,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x8993c3){return checkLicense(_0x8993c3,null);});};exports['checkLicense']=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 180a65d..da925d1 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 _0xdeb7=['http://localhost:9000','myappanuglar-secret','secret','exports'];(function(_0x16faf4,_0x10a360){var _0x13bb85=function(_0x457176){while(--_0x457176){_0x16faf4['push'](_0x16faf4['shift']());}};_0x13bb85(++_0x10a360);}(_0xdeb7,0x77));var _0x7deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb7[_0x2641f9];return _0x585741;};'use strict';module[_0x7deb('0x0')]={'DOMAIN':_0x7deb('0x1'),'SESSION_SECRET':_0x7deb('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x7deb('0x3'),'DEBUG':''}; \ No newline at end of file +var _0xc1c4=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x285ac0,_0x5a59db){var _0x65e7ed=function(_0x358466){while(--_0x358466){_0x285ac0['push'](_0x285ac0['shift']());}};_0x65e7ed(++_0x5a59db);}(_0xc1c4,0x1c7));var _0x4c1c=function(_0x1917c7,_0x3480b6){_0x1917c7=_0x1917c7-0x0;var _0x1b1867=_0xc1c4[_0x1917c7];return _0x1b1867;};'use strict';module[_0x4c1c('0x0')]={'DOMAIN':_0x4c1c('0x1'),'SESSION_SECRET':_0x4c1c('0x2'),'GOOGLE_ID':_0x4c1c('0x3'),'GOOGLE_SECRET':_0x4c1c('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 9a3782c..7b1328c 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f04=['transports','%s-%s','error','File','info','debugLevel','moment','path','join','/var','log','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','exports','Logger'];(function(_0x5a3b31,_0x47b7a0){var _0x3924d6=function(_0x59ebee){while(--_0x59ebee){_0x5a3b31['push'](_0x5a3b31['shift']());}};_0x3924d6(++_0x47b7a0);}(_0x3f04,0x1e9));var _0x43f0=function(_0xf5fafb,_0xdc4ceb){_0xf5fafb=_0xf5fafb-0x0;var _0x35f5a7=_0x3f04[_0xf5fafb];return _0x35f5a7;};'use strict';var moment=require(_0x43f0('0x0'));var winston=require('winston');var util=require('util');var path=require(_0x43f0('0x1'));var debugLevel='INFO';function filename(_0x18574d,_0x2f1649){return path[_0x43f0('0x2')](_0x43f0('0x3'),_0x43f0('0x4'),_0x43f0('0x5'),util[_0x43f0('0x6')](_0x43f0('0x7'),_0x18574d,_0x2f1649));}function formatter(_0x178531,_0x18527e){return util[_0x43f0('0x6')](_0x43f0('0x8'),moment()['format'](_0x43f0('0x9')),_0x18527e[_0x43f0('0xa')][_0x43f0('0xb')](),_0x178531,_0x18527e[_0x43f0('0xc')]);}module[_0x43f0('0xd')]=function(_0x3e818d){return new winston[(_0x43f0('0xe'))]({'transports':[new winston[(_0x43f0('0xf'))]['File']({'name':util[_0x43f0('0x6')](_0x43f0('0x10'),_0x3e818d,'error'),'filename':filename(_0x3e818d,_0x43f0('0x11')),'level':_0x43f0('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x7e434e){return formatter(_0x3e818d,_0x7e434e);}}),new winston[(_0x43f0('0xf'))][(_0x43f0('0x12'))]({'name':util['format'](_0x43f0('0x10'),_0x3e818d,'info'),'filename':filename(_0x3e818d,_0x43f0('0x13')),'level':_0x43f0('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3010e9){return formatter(_0x3e818d,_0x3010e9);}}),new winston[(_0x43f0('0xf'))]['Console']({'level':process['env'][_0x43f0('0x14')]||debugLevel,'json':![],'formatter':function(_0x243a75){return formatter(_0x3e818d,_0x243a75);}})]});}; \ No newline at end of file +var _0xa173=['exports','transports','File','%s-%s','error','info','Console','env','debugLevel','winston','path','INFO','join','/var','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa173,0x126));var _0x3a17=function(_0x23bad0,_0x2f68c1){_0x23bad0=_0x23bad0-0x0;var _0xf8c963=_0xa173[_0x23bad0];return _0xf8c963;};'use strict';var moment=require('moment');var winston=require(_0x3a17('0x0'));var util=require('util');var path=require(_0x3a17('0x1'));var debugLevel=_0x3a17('0x2');function filename(_0x3e99e6,_0x1b76a6){return path[_0x3a17('0x3')](_0x3a17('0x4'),'log',_0x3a17('0x5'),util[_0x3a17('0x6')](_0x3a17('0x7'),_0x3e99e6,_0x1b76a6));}function formatter(_0x409cdb,_0xc60288){return util[_0x3a17('0x6')](_0x3a17('0x8'),moment()[_0x3a17('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),_0xc60288['level']['toUpperCase'](),_0x409cdb,_0xc60288[_0x3a17('0x9')]);}module[_0x3a17('0xa')]=function(_0x589dad){return new winston['Logger']({'transports':[new winston[(_0x3a17('0xb'))][(_0x3a17('0xc'))]({'name':util[_0x3a17('0x6')](_0x3a17('0xd'),_0x589dad,_0x3a17('0xe')),'filename':filename(_0x589dad,'error'),'level':_0x3a17('0xe'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5097c4){return formatter(_0x589dad,_0x5097c4);}}),new winston['transports'][(_0x3a17('0xc'))]({'name':util['format'](_0x3a17('0xd'),_0x589dad,_0x3a17('0xf')),'filename':filename(_0x589dad,_0x3a17('0xf')),'level':_0x3a17('0xf'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x8cf939){return formatter(_0x589dad,_0x8cf939);}}),new winston[(_0x3a17('0xb'))][(_0x3a17('0x10'))]({'level':process[_0x3a17('0x11')][_0x3a17('0x12')]||debugLevel,'json':![],'formatter':function(_0x48fff0){return formatter(_0x589dad,_0x48fff0);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index e974daf..6b8fe18 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 _0x15ae=['exports','express','../../services/express/index.js','../../services/ami/index.js','agi','join','../../services/email/index.js','routing','xdr'];(function(_0x66524f,_0x437009){var _0x1f1b8e=function(_0xc30b81){while(--_0xc30b81){_0x66524f['push'](_0x66524f['shift']());}};_0x1f1b8e(++_0x437009);}(_0x15ae,0x10f));var _0xe15a=function(_0x4e8bd0,_0x52374f){_0x4e8bd0=_0x4e8bd0-0x0;var _0x466282=_0x15ae[_0x4e8bd0];return _0x466282;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xe15a('0x0'),'script':path['join'](__dirname,_0xe15a('0x1'))},{'name':'ami','script':path['join'](__dirname,_0xe15a('0x2'))},{'name':_0xe15a('0x3'),'script':path[_0xe15a('0x4')](__dirname,'../../services/agi/index.js')},{'name':'email','script':path[_0xe15a('0x4')](__dirname,_0xe15a('0x5'))},{'name':_0xe15a('0x6'),'script':path['join'](__dirname,'../../services/routing/index.js')},{'name':_0xe15a('0x7'),'script':path[_0xe15a('0x4')](__dirname,'../../services/xdr/index.js')}]};module[_0xe15a('0x8')]=config; \ No newline at end of file +var _0xa35d=['routing','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','ami','agi','../../services/agi/index.js','email','../../services/email/index.js'];(function(_0x3172de,_0x1aaf61){var _0x209a33=function(_0x2fb0b9){while(--_0x2fb0b9){_0x3172de['push'](_0x3172de['shift']());}};_0x209a33(++_0x1aaf61);}(_0xa35d,0x1d8));var _0xda35=function(_0x2734ba,_0x5e672){_0x2734ba=_0x2734ba-0x0;var _0x4b74c9=_0xa35d[_0x2734ba];return _0x4b74c9;};'use strict';var path=require(_0xda35('0x0'));var os=require('os');var config={'apps':[{'name':_0xda35('0x1'),'script':path[_0xda35('0x2')](__dirname,_0xda35('0x3'))},{'name':_0xda35('0x4'),'script':path[_0xda35('0x2')](__dirname,'../../services/ami/index.js')},{'name':_0xda35('0x5'),'script':path[_0xda35('0x2')](__dirname,_0xda35('0x6'))},{'name':_0xda35('0x7'),'script':path[_0xda35('0x2')](__dirname,_0xda35('0x8'))},{'name':_0xda35('0x9'),'script':path[_0xda35('0x2')](__dirname,'../../services/routing/index.js')},{'name':_0xda35('0xa'),'script':path[_0xda35('0x2')](__dirname,_0xda35('0xb'))}]};module[_0xda35('0xc')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 52171b5..7d4ce44 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 _0x9957=['stop','disconnect','restart','list','describe','delete','dump','pm2','bluebird','./config','connect','connected','start','then'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var pm2=require(_0x7995('0x0'));var BPromise=require(_0x7995('0x1'));var config=require(_0x7995('0x2'));function connect(){return new BPromise(function(_0x10a05d,_0x5b96eb){return pm2[_0x7995('0x3')](function(_0x3c58eb){if(_0x3c58eb){return _0x5b96eb(_0x3c58eb);}return _0x10a05d(_0x7995('0x4'));});});};exports[_0x7995('0x5')]=function(_0x576d89){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x1a36d8,_0x137b6b){return pm2[_0x7995('0x5')](_0x576d89,function(_0xbda126,_0x326741){if(_0xbda126){return _0x137b6b(_0xbda126);}pm2['disconnect']();return _0x1a36d8(_0x326741);});});});};exports[_0x7995('0x7')]=function(_0x1cad37){return connect()['then'](function(){return new BPromise(function(_0xa2e5f0,_0x3116fb){return pm2[_0x7995('0x7')](_0x1cad37,function(_0x35b5fe,_0x3c1d19){if(_0x35b5fe){return _0x3116fb(_0x35b5fe);}pm2[_0x7995('0x8')]();return _0xa2e5f0(_0x3c1d19);});});});};exports[_0x7995('0x9')]=function(_0x524f7b){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x41c652,_0x581f22){return pm2[_0x7995('0x9')](_0x524f7b,function(_0x2cb37a,_0x19a27e){if(_0x2cb37a){return _0x581f22(_0x2cb37a);}pm2[_0x7995('0x8')]();return _0x41c652(_0x19a27e);});});});};exports[_0x7995('0xa')]=function(){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x2bbe7a,_0x4cc004){return pm2['list'](function(_0x2b4e94,_0x2233dd){if(_0x2b4e94){return _0x4cc004(_0x2b4e94);}pm2[_0x7995('0x8')]();return _0x2bbe7a(_0x2233dd);});});});};exports[_0x7995('0xb')]=function(_0x3f1d3e){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x2202ce,_0x41cbf0){return pm2['describe'](_0x3f1d3e,function(_0x2eeacc,_0x565d97){if(_0x2eeacc){return _0x41cbf0(_0x2eeacc);}pm2[_0x7995('0x8')]();return _0x2202ce(_0x565d97);});});});};exports[_0x7995('0xc')]=function(_0x43d4b8){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x1e1415,_0x37a7d4){return pm2['delete'](_0x43d4b8,function(_0x54c9ae,_0x2536c8){if(_0x54c9ae){return _0x37a7d4(_0x54c9ae);}pm2['disconnect']();return _0x1e1415(_0x2536c8);});});});};exports['dump']=function(){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x3d463e,_0x4cbe10){return pm2[_0x7995('0xd')](function(_0x51f276){if(_0x51f276){return _0x4cbe10(_0x51f276);}return _0x3d463e('saved');});});});}; \ No newline at end of file +var _0xedd9=['restart','list','describe','delete','saved','bluebird','./config','connect','connected','start','then','stop','disconnect'];(function(_0x2d4dd3,_0x1d3e26){var _0x558e45=function(_0x3f58bd){while(--_0x3f58bd){_0x2d4dd3['push'](_0x2d4dd3['shift']());}};_0x558e45(++_0x1d3e26);}(_0xedd9,0xfc));var _0x9edd=function(_0x557028,_0x350a11){_0x557028=_0x557028-0x0;var _0x501db5=_0xedd9[_0x557028];return _0x501db5;};'use strict';var pm2=require('pm2');var BPromise=require(_0x9edd('0x0'));var config=require(_0x9edd('0x1'));function connect(){return new BPromise(function(_0x2af857,_0x2c16b8){return pm2[_0x9edd('0x2')](function(_0x127cbe){if(_0x127cbe){return _0x2c16b8(_0x127cbe);}return _0x2af857(_0x9edd('0x3'));});});};exports[_0x9edd('0x4')]=function(_0x5943b3){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x2cd163,_0x268f9e){return pm2[_0x9edd('0x4')](_0x5943b3,function(_0x5319f7,_0xf0b2d8){if(_0x5319f7){return _0x268f9e(_0x5319f7);}pm2['disconnect']();return _0x2cd163(_0xf0b2d8);});});});};exports[_0x9edd('0x6')]=function(_0x190185){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x3280fd,_0x49d5e3){return pm2[_0x9edd('0x6')](_0x190185,function(_0x5d2f90,_0x2076fc){if(_0x5d2f90){return _0x49d5e3(_0x5d2f90);}pm2[_0x9edd('0x7')]();return _0x3280fd(_0x2076fc);});});});};exports['restart']=function(_0xbf9da6){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x5b6c00,_0x30c0d7){return pm2[_0x9edd('0x8')](_0xbf9da6,function(_0x25e64c,_0xfd544a){if(_0x25e64c){return _0x30c0d7(_0x25e64c);}pm2[_0x9edd('0x7')]();return _0x5b6c00(_0xfd544a);});});});};exports[_0x9edd('0x9')]=function(){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0xef5498,_0x47eb64){return pm2[_0x9edd('0x9')](function(_0x44fc7c,_0x891832){if(_0x44fc7c){return _0x47eb64(_0x44fc7c);}pm2[_0x9edd('0x7')]();return _0xef5498(_0x891832);});});});};exports[_0x9edd('0xa')]=function(_0x338f3c){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x75a4ab,_0x4ea60f){return pm2[_0x9edd('0xa')](_0x338f3c,function(_0x448996,_0x449cee){if(_0x448996){return _0x4ea60f(_0x448996);}pm2['disconnect']();return _0x75a4ab(_0x449cee);});});});};exports[_0x9edd('0xb')]=function(_0x35f454){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x4d8f33,_0x43dc70){return pm2['delete'](_0x35f454,function(_0x2cdcef,_0x1083e4){if(_0x2cdcef){return _0x43dc70(_0x2cdcef);}pm2['disconnect']();return _0x4d8f33(_0x1083e4);});});});};exports['dump']=function(){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x50338f,_0x27a95a){return pm2['dump'](function(_0x535f37){if(_0x535f37){return _0x27a95a(_0x535f37);}return _0x50338f(_0x9edd('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/automaticRenewSubscription.js b/server/config/schedule/automaticRenewSubscription.js index f452a47..2e96192 100644 --- a/server/config/schedule/automaticRenewSubscription.js +++ b/server/config/schedule/automaticRenewSubscription.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb27e=['findAll','lastMsgAt','subtract','minutes','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','emit','catch','error','startSubscription','lodash','moment','ioredis','../../mysqldb','../../config/environment','Setting','chatTimeout','then','ChatInteraction'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xb27e,0x1da));var _0xeb27=function(_0x5ca893,_0x3cce68){_0x5ca893=_0x5ca893-0x0;var _0x3d8f48=_0xb27e[_0x5ca893];return _0x3d8f48;};'use strict';var _=require(_0xeb27('0x0'));var moment=require(_0xeb27('0x1'));var Redis=require(_0xeb27('0x2'));var db=require(_0xeb27('0x3'))['db'];var config=require(_0xeb27('0x4'));function subscriptionsAutomatic(){var _0x42a52d=0x0;var _0x660258=[];return db[_0xeb27('0x5')]['find']({'raw':!![],'attributes':['id',_0xeb27('0x6')],'where':{'id':0x1}})[_0xeb27('0x7')](function(_0x348aa9){_0x42a52d=_0x348aa9['chatTimeout'];if(_0x42a52d){return db[_0xeb27('0x8')][_0xeb27('0x9')]({'raw':!![],'attributes':['id',_0xeb27('0xa')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xeb27('0xb')](_0x348aa9[_0xeb27('0x6')],_0xeb27('0xc'))}}});}else{return[];}})[_0xeb27('0x7')](function(_0x32dd7f){_0x660258=_0x32dd7f;if(_0x42a52d){return db[_0xeb27('0x8')]['update']({'closeReason':'system','disposition':_0xeb27('0xd'),'closed':!![],'closedAt':moment()[_0xeb27('0xe')](_0xeb27('0xf'))},{'where':{'id':_['map'](_0x660258||[],'id')}});}})[_0xeb27('0x7')](function(_0x48844f){for(var _0x45f795=0x0;_0x45f795<_0x660258[_0xeb27('0x10')];_0x45f795++){io[_0xeb27('0x11')]('chatInteraction:update',{'id':_0x660258[_0x45f795]['id'],'closed':!![]});}})[_0xeb27('0x12')](function(_0x4b125e){console[_0xeb27('0x13')](_0x4b125e);});}exports[_0xeb27('0x14')]=function(){setInterval(function(){return subscriptionsAutomatic();},0x3c*0x3e8);return subscriptionsAutomatic();}; \ No newline at end of file +var _0xbb51=['lastMsgAt','minutes','then','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map','emit','chatInteraction:update','catch','error','startSubscription','lodash','moment','../../mysqldb','../../config/environment','Setting','find','chatTimeout','ChatInteraction','findAll'];(function(_0x226bdd,_0x5bca05){var _0x48a9cd=function(_0x5c2931){while(--_0x5c2931){_0x226bdd['push'](_0x226bdd['shift']());}};_0x48a9cd(++_0x5bca05);}(_0xbb51,0x150));var _0x1bb5=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0xbb51[_0x58afd5];return _0x3e503b;};'use strict';var _=require(_0x1bb5('0x0'));var moment=require(_0x1bb5('0x1'));var Redis=require('ioredis');var db=require(_0x1bb5('0x2'))['db'];var config=require(_0x1bb5('0x3'));function subscriptionsAutomatic(){var _0xeab3ed=0x0;var _0x54209a=[];return db[_0x1bb5('0x4')][_0x1bb5('0x5')]({'raw':!![],'attributes':['id',_0x1bb5('0x6')],'where':{'id':0x1}})['then'](function(_0x28a3f2){_0xeab3ed=_0x28a3f2[_0x1bb5('0x6')];if(_0xeab3ed){return db[_0x1bb5('0x7')][_0x1bb5('0x8')]({'raw':!![],'attributes':['id',_0x1bb5('0x9')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x28a3f2[_0x1bb5('0x6')],_0x1bb5('0xa'))}}});}else{return[];}})[_0x1bb5('0xb')](function(_0x3697ff){_0x54209a=_0x3697ff;if(_0xeab3ed){return db[_0x1bb5('0x7')][_0x1bb5('0xc')]({'closeReason':_0x1bb5('0xd'),'disposition':_0x1bb5('0xe'),'closed':!![],'closedAt':moment()[_0x1bb5('0xf')](_0x1bb5('0x10'))},{'where':{'id':_[_0x1bb5('0x11')](_0x54209a||[],'id')}});}})['then'](function(_0x1bf6d2){for(var _0x1e0fcd=0x0;_0x1e0fcd<_0x54209a['length'];_0x1e0fcd++){io[_0x1bb5('0x12')](_0x1bb5('0x13'),{'id':_0x54209a[_0x1e0fcd]['id'],'closed':!![]});}})[_0x1bb5('0x14')](function(_0xd8f47a){console[_0x1bb5('0x15')](_0xd8f47a);});}exports[_0x1bb5('0x16')]=function(){setInterval(function(){return subscriptionsAutomatic();},0x3c*0x3e8);return subscriptionsAutomatic();}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 55f6ae4..8b8f4a1 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 _0x9f3e=['find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','update','timeout','format','map','length','catch','start','lodash','moment','ioredis','../../mysqldb','../../config/environment','localhost','redis','Setting'];(function(_0xb24b6d,_0x49f15e){var _0xc88ebd=function(_0x310bd5){while(--_0x310bd5){_0xb24b6d['push'](_0xb24b6d['shift']());}};_0xc88ebd(++_0x49f15e);}(_0x9f3e,0x1c4));var _0xe9f3=function(_0xbe76c5,_0x1fb3aa){_0xbe76c5=_0xbe76c5-0x0;var _0x135641=_0x9f3e[_0xbe76c5];return _0x135641;};'use strict';var _=require(_0xe9f3('0x0'));var moment=require(_0xe9f3('0x1'));var Redis=require(_0xe9f3('0x2'));var db=require(_0xe9f3('0x3'))['db'];var config=require(_0xe9f3('0x4'));config['redis']=_['defaults'](config['redis'],{'host':_0xe9f3('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe9f3('0x6')]));function closeInteractions(){var _0x33f11b=0x0;var _0x46f926=[];return db[_0xe9f3('0x7')][_0xe9f3('0x8')]({'raw':!![],'attributes':['id',_0xe9f3('0x9')],'where':{'id':0x1}})[_0xe9f3('0xa')](function(_0x4014b1){_0x33f11b=_0x4014b1[_0xe9f3('0x9')];if(_0x33f11b){return db[_0xe9f3('0xb')][_0xe9f3('0xc')]({'raw':!![],'attributes':['id',_0xe9f3('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xe9f3('0xe')](_0x4014b1['chatTimeout'],_0xe9f3('0xf'))}}});}else{return[];}})[_0xe9f3('0xa')](function(_0x250599){_0x46f926=_0x250599;if(_0x33f11b){return db[_0xe9f3('0xb')][_0xe9f3('0x10')]({'closeReason':'system','disposition':_0xe9f3('0x11'),'closed':!![],'closedAt':moment()[_0xe9f3('0x12')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_[_0xe9f3('0x13')](_0x46f926||[],'id')}});}})['then'](function(_0x14af9f){for(var _0x421058=0x0;_0x421058<_0x46f926[_0xe9f3('0x14')];_0x421058++){io['emit']('chatInteraction:update',{'id':_0x46f926[_0x421058]['id'],'closed':!![]});}})[_0xe9f3('0x15')](function(_0x158f4c){console['error'](_0x158f4c);});}exports[_0xe9f3('0x16')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xf150=['ChatInteraction','lastMsgAt','subtract','system','YYYY-MM-DD\x20HH:mm:ss','map','length','emit','chatInteraction:update','start','lodash','moment','ioredis','../../config/environment','redis','defaults','localhost','socket.io-emitter','find','chatTimeout','then'];(function(_0x266298,_0x1e49e4){var _0x338a74=function(_0x13522b){while(--_0x13522b){_0x266298['push'](_0x266298['shift']());}};_0x338a74(++_0x1e49e4);}(_0xf150,0x106));var _0x0f15=function(_0x36624a,_0x30e139){_0x36624a=_0x36624a-0x0;var _0xe84671=_0xf150[_0x36624a];return _0xe84671;};'use strict';var _=require(_0x0f15('0x0'));var moment=require(_0x0f15('0x1'));var Redis=require(_0x0f15('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x0f15('0x3'));config[_0x0f15('0x4')]=_[_0x0f15('0x5')](config[_0x0f15('0x4')],{'host':_0x0f15('0x6'),'port':0x18eb});var io=require(_0x0f15('0x7'))(new Redis(config[_0x0f15('0x4')]));function closeInteractions(){var _0x3cf80f=0x0;var _0x55717b=[];return db['Setting'][_0x0f15('0x8')]({'raw':!![],'attributes':['id',_0x0f15('0x9')],'where':{'id':0x1}})[_0x0f15('0xa')](function(_0x3928e2){_0x3cf80f=_0x3928e2['chatTimeout'];if(_0x3cf80f){return db[_0x0f15('0xb')]['findAll']({'raw':!![],'attributes':['id',_0x0f15('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x0f15('0xd')](_0x3928e2['chatTimeout'],'minutes')}}});}else{return[];}})[_0x0f15('0xa')](function(_0xb2ed56){_0x55717b=_0xb2ed56;if(_0x3cf80f){return db[_0x0f15('0xb')]['update']({'closeReason':_0x0f15('0xe'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x0f15('0xf'))},{'where':{'id':_[_0x0f15('0x10')](_0x55717b||[],'id')}});}})[_0x0f15('0xa')](function(_0x446cce){for(var _0x4ecf84=0x0;_0x4ecf84<_0x55717b[_0x0f15('0x11')];_0x4ecf84++){io[_0x0f15('0x12')](_0x0f15('0x13'),{'id':_0x55717b[_0x4ecf84]['id'],'closed':!![]});}})['catch'](function(_0x5ab21b){console['error'](_0x5ab21b);});}exports[_0x0f15('0x14')]=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 e5c2311..b8c46b7 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 _0x7eac=['add\x20cron','cron','stop\x20cron','endAt','run','util','path','lodash','moment','jayson/promise','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','Smtp','service','host','MailAccount','port','secure','authentication','user','pass','format','\x22%s\x22\x20<%s>','email','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','extname','join','existsSync','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','MailServerOut','keys','jobs','map','toString','difference','intersection','exists','stop','deleteJob','delete\x20cron','toRun','length','index','my\x20id','resolve','active','isBetween','startAt','add','start'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7eac,0x169));var _0xc7ea=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x7eac[_0x243b2f];return _0xcb3c2d;};'use strict';var fs=require('fs');var util=require(_0xc7ea('0x0'));var path=require(_0xc7ea('0x1'));var _=require(_0xc7ea('0x2'));var moment=require(_0xc7ea('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xc7ea('0x4'));var BPromise=require('bluebird');var logger=require(_0xc7ea('0x5'))(_0xc7ea('0x6'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xc7ea('0x7'));var analyticDefaultReportController=require(_0xc7ea('0x8'));var client=jayson[_0xc7ea('0x9')][_0xc7ea('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4c30ec,_0x3b55b7){return function(){logger['info'](_0xc7ea('0xb'),_0x4c30ec['email']);var _0x3391d7=!![];var _0x3968d3={'tls':{'rejectUnauthorized':![]}};if(_0x4c30ec['MailAccount'][_0xc7ea('0xc')][_0xc7ea('0xd')]){_0x3968d3[_0xc7ea('0xd')]=_0x4c30ec['MailAccount'][_0xc7ea('0xc')][_0xc7ea('0xd')];}else{_0x3968d3[_0xc7ea('0xe')]=_0x4c30ec[_0xc7ea('0xf')][_0xc7ea('0xc')][_0xc7ea('0xe')];_0x3968d3[_0xc7ea('0x10')]=_0x4c30ec[_0xc7ea('0xf')][_0xc7ea('0xc')][_0xc7ea('0x10')];_0x3968d3[_0xc7ea('0x11')]=_0x4c30ec[_0xc7ea('0xf')][_0xc7ea('0xc')][_0xc7ea('0x11')];}if(_0x4c30ec[_0xc7ea('0xf')][_0xc7ea('0xc')][_0xc7ea('0x12')]){_0x3968d3['auth']={'user':_0x4c30ec[_0xc7ea('0xf')]['Smtp'][_0xc7ea('0x13')],'pass':_0x4c30ec[_0xc7ea('0xf')][_0xc7ea('0xc')][_0xc7ea('0x14')]};}var _0x3de3ed={'account':_0x3968d3,'message':{'from':util[_0xc7ea('0x15')](_0xc7ea('0x16'),_0x4c30ec[_0xc7ea('0xf')]['name'],_0x4c30ec['MailAccount']['email']||_0x4c30ec[_0xc7ea('0xf')]['Smtp']['user']),'to':_0x4c30ec[_0xc7ea('0x17')],'cc':_0x4c30ec['cc'],'bcc':_0x4c30ec[_0xc7ea('0x18')],'subject':util[_0xc7ea('0x15')](_0xc7ea('0x19'),_0x3b55b7[_0xc7ea('0x1a')],_0x4c30ec[_0xc7ea('0x1b')],_0x4c30ec[_0xc7ea('0x1c')])}};var _0x4cb72a=path['join'](__dirname,_0xc7ea('0x1d'));var _0x3d2d2e=_0x3b55b7[_0xc7ea('0x1e')];var _0x232ff4=util[_0xc7ea('0x15')](_0xc7ea('0x1f'),path['basename'](_0x3b55b7[_0xc7ea('0x1e')],path[_0xc7ea('0x20')](_0x3b55b7['savename'])),'zip');var _0x3ab9a6=path[_0xc7ea('0x21')](_0x4cb72a,_0x3d2d2e);var _0x524886=path[_0xc7ea('0x21')](_0x4cb72a,_0x232ff4);if(fs[_0xc7ea('0x22')](_0x3ab9a6)){_0x3b55b7['status']=_0xc7ea('0x23');_0x3de3ed[_0xc7ea('0x24')][_0xc7ea('0x25')]=[{'filename':_0x3d2d2e,'path':_0x3ab9a6}];_0x3de3ed[_0xc7ea('0x24')][_0xc7ea('0x26')]=util[_0xc7ea('0x15')](_0xc7ea('0x27'),JSON[_0xc7ea('0x28')](_0x3b55b7,null,0x2));}else if(fs[_0xc7ea('0x22')](_0x524886)){_0x3b55b7[_0xc7ea('0x29')]='Sent';_0x3de3ed[_0xc7ea('0x24')][_0xc7ea('0x25')]=[{'filename':_0x232ff4,'path':_0x524886}];}else{_0x3de3ed[_0xc7ea('0x24')][_0xc7ea('0x26')]=_0xc7ea('0x2a');if(!_0x4c30ec['sendIfEmpty']){_0x3391d7=![];logger[_0xc7ea('0x2b')](_0xc7ea('0x2c'));}}if(_0x3391d7){return client[_0xc7ea('0x2d')](_0xc7ea('0x2e'),_0x3de3ed)[_0xc7ea('0x2f')](function(_0x203131){if(_0x203131[_0xc7ea('0x30')]){return logger['error'](_0xc7ea('0x31'),JSON[_0xc7ea('0x28')](_0x203131));}return logger['info']('email\x20sent');})[_0xc7ea('0x32')](function(_0x194587){return logger[_0xc7ea('0x30')](_0xc7ea('0x31'),JSON[_0xc7ea('0x28')](_0x194587));});}};}function handleError(){return function(_0x539e43){return logger[_0xc7ea('0x30')](JSON['stringify'](_0x539e43));};}function handleResult(_0x15cd65){return function(_0x13eef8){logger['info'](_0xc7ea('0x33'),JSON[_0xc7ea('0x28')](_0x13eef8));if(_0x15cd65[_0xc7ea('0xf')]&&_0x15cd65['MailAccount'][_0xc7ea('0xc')]&&!_[_0xc7ea('0x34')](_0x15cd65[_0xc7ea('0x17')])){setTimeout(handleSendEmail(_0x15cd65,_0x13eef8),0x3c*0x3e8);}};}function handleJob(_0x550cab){return function(){try{if(_[_0xc7ea('0x34')](_0x550cab[_0xc7ea('0x1b')])){return logger[_0xc7ea('0x2b')](_0xc7ea('0x35'));}if(_[_0xc7ea('0x34')](_0x550cab['subtractUnit'])){return logger[_0xc7ea('0x2b')](_0xc7ea('0x36'));}var _0x235945={'startDate':moment()[_0xc7ea('0x37')](_0x550cab['subtractNumber'],_0x550cab[_0xc7ea('0x1c')])[_0xc7ea('0x15')](_0xc7ea('0x38')),'endDate':moment()[_0xc7ea('0x15')](_0xc7ea('0x38')),'type':_0xc7ea('0x39'),'output':_0x550cab['output'],'name':_0x550cab['name']};if(!_['isNil'](_0x550cab['DefaultReportId'])){logger[_0xc7ea('0x2b')](_0xc7ea('0x3a'),_0x550cab[_0xc7ea('0x3b')]);return analyticDefaultReportController[_0xc7ea('0x3c')]({'id':_0x550cab[_0xc7ea('0x3b')]},_0x235945)[_0xc7ea('0x2f')](handleResult(_0x550cab))['catch'](handleError());}if(!_[_0xc7ea('0x34')](_0x550cab['CustomReportId'])){logger[_0xc7ea('0x2b')](_0xc7ea('0x3d'),_0x550cab['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x550cab[_0xc7ea('0x3e')]},_0x235945)[_0xc7ea('0x2f')](handleResult(_0x550cab))[_0xc7ea('0x32')](handleError());}}catch(_0x2727b0){logger[_0xc7ea('0x30')](JSON[_0xc7ea('0x28')](_0x2727b0));}return logger[_0xc7ea('0x2b')]('no\x20report\x20id');};}function getJobs(_0x55748e){var _0x1e2e2c={};if(_0x55748e){_0x1e2e2c['id']=_0x55748e;}return db['Schedule']['findAll']({'where':_0x1e2e2c,'include':[{'model':db['MailAccount'],'attributes':['id',_0xc7ea('0x1a'),_0xc7ea('0x17')],'include':[{'model':db[_0xc7ea('0x3f')],'as':_0xc7ea('0xc')}]}]})[_0xc7ea('0x2f')](function(_0x2d1842){var _0x3fe478=_[_0xc7ea('0x40')](manager[_0xc7ea('0x41')]);var _0xc9917e=_[_0xc7ea('0x42')](_0x2d1842,function(_0x39b140){return _0x39b140['id']['toString']();});var _0x4d464b=_['keyBy'](_0x2d1842,function(_0x30a189){return _0x30a189['id'][_0xc7ea('0x43')]();});var _0x21c9ad=_0x55748e?_0xc9917e:_[_0xc7ea('0x44')](_0xc9917e,_0x3fe478);var _0x13199b=_[_0xc7ea('0x45')](_0xc9917e,_0x3fe478);var _0x399d55=_['difference'](_0x3fe478,_0xc9917e);var _0x341ff8;var _0xb5435b;for(_0x341ff8=0x0;_0x341ff8<_0x399d55['length']&&!_0x55748e;_0x341ff8+=0x1){_0xb5435b=_0x399d55[_0x341ff8]['toString']();if(manager[_0xc7ea('0x46')](_0xb5435b)){manager[_0xc7ea('0x47')](_0xb5435b);manager[_0xc7ea('0x48')](_0xb5435b);logger[_0xc7ea('0x2b')](_0xc7ea('0x49'),_0xb5435b);}}logger[_0xc7ea('0x2b')](_0xc7ea('0x4a'),JSON[_0xc7ea('0x28')](_0x21c9ad));for(_0x341ff8=0x0;_0x341ff8<_0x21c9ad[_0xc7ea('0x4b')];_0x341ff8+=0x1){_0xb5435b=_0x21c9ad[_0x341ff8][_0xc7ea('0x43')]();logger[_0xc7ea('0x2b')](_0xc7ea('0x4c'),_0xb5435b);if(_0x55748e){logger[_0xc7ea('0x2b')](_0xc7ea('0x4d'),_0x55748e);logger[_0xc7ea('0x2b')](JSON[_0xc7ea('0x28')](_0x4d464b[_0xb5435b]));BPromise[_0xc7ea('0x4e')]()[_0xc7ea('0x2f')](handleJob(_0x4d464b[_0xb5435b]));logger[_0xc7ea('0x2b')]('run\x20job',_0x4d464b[_0xb5435b][_0xc7ea('0x1a')],_0x4d464b[_0xb5435b]['cron']);}else if(_0x4d464b[_0xb5435b]['cron']&&_0x4d464b[_0xb5435b][_0xc7ea('0x4f')]&&moment()[_0xc7ea('0x50')](_0x4d464b[_0xb5435b][_0xc7ea('0x51')],_0x4d464b[_0xb5435b]['endAt'])){manager[_0xc7ea('0x52')](_0xb5435b,_0x4d464b[_0xb5435b]['cron'],handleJob(_0x4d464b[_0xb5435b]));manager[_0xc7ea('0x53')](_0xb5435b);logger['info'](_0xc7ea('0x54'),_0x4d464b[_0xb5435b][_0xc7ea('0x1a')],_0x4d464b[_0xb5435b][_0xc7ea('0x55')]);}else if(manager['exists'](_0xb5435b)){manager['stop'](_0xb5435b);manager[_0xc7ea('0x48')](_0xb5435b);logger[_0xc7ea('0x2b')](_0xc7ea('0x56'),_0x4d464b[_0xb5435b][_0xc7ea('0x1a')],_0x4d464b[_0xb5435b][_0xc7ea('0x55')]);}}for(_0x341ff8=0x0,_0xb5435b;_0x341ff8<_0x13199b[_0xc7ea('0x4b')]&&!_0x55748e;_0x341ff8+=0x1){_0xb5435b=_0x13199b[_0x341ff8][_0xc7ea('0x43')]();if(manager[_0xc7ea('0x46')](_0xb5435b)){if(_0x4d464b[_0xb5435b][_0xc7ea('0x55')]&&_0x4d464b[_0xb5435b][_0xc7ea('0x4f')]&&moment()['isBetween'](_0x4d464b[_0xb5435b]['startAt'],_0x4d464b[_0xb5435b][_0xc7ea('0x57')])){manager['update'](_0xb5435b,_0x4d464b[_0xb5435b][_0xc7ea('0x55')],handleJob(_0x4d464b[_0xb5435b]));logger[_0xc7ea('0x2b')]('update\x20cron',_0x4d464b[_0xb5435b]['name'],_0x4d464b[_0xb5435b][_0xc7ea('0x55')]);}else{manager[_0xc7ea('0x47')](_0xb5435b);manager[_0xc7ea('0x48')](_0xb5435b);logger[_0xc7ea('0x2b')](_0xc7ea('0x56'),_0x4d464b[_0xb5435b][_0xc7ea('0x1a')],_0x4d464b[_0xb5435b][_0xc7ea('0x55')]);}}}})['catch'](function(_0x8e8416){logger[_0xc7ea('0x30')](JSON[_0xc7ea('0x28')](_0x8e8416));});}exports[_0xc7ea('0x58')]=function(_0x2ad13c){return getJobs(_0x2ad13c);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xe432=['message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Sent','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','error','error\x20mail','email\x20sent','catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','then','no\x20report\x20id','findAll','keys','map','toString','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','index','my\x20id','resolve','run\x20job','cron','active','startAt','endAt','add','start','add\x20cron','stop\x20cron','isBetween','update\x20cron','run','path','moment','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','Smtp','host','port','secure','auth','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','zip','status'];(function(_0xe6b674,_0x267db9){var _0x2a6236=function(_0x4b6f69){while(--_0x4b6f69){_0xe6b674['push'](_0xe6b674['shift']());}};_0x2a6236(++_0x267db9);}(_0xe432,0x1e3));var _0x2e43=function(_0x46dfb8,_0x57b422){_0x46dfb8=_0x46dfb8-0x0;var _0xe04c07=_0xe432[_0x46dfb8];return _0xe04c07;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x2e43('0x0'));var _=require('lodash');var moment=require(_0x2e43('0x1'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0x2e43('0x2'));var logger=require(_0x2e43('0x3'))(_0x2e43('0x4'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x2e43('0x5'));var analyticDefaultReportController=require(_0x2e43('0x6'));var client=jayson[_0x2e43('0x7')][_0x2e43('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4bed3e,_0x2b1e7f){return function(){logger['info'](_0x2e43('0x9'),_0x4bed3e[_0x2e43('0xa')]);var _0x364ee9=!![];var _0x120020={'tls':{'rejectUnauthorized':![]}};if(_0x4bed3e[_0x2e43('0xb')]['Smtp'][_0x2e43('0xc')]){_0x120020[_0x2e43('0xc')]=_0x4bed3e[_0x2e43('0xb')][_0x2e43('0xd')][_0x2e43('0xc')];}else{_0x120020['host']=_0x4bed3e[_0x2e43('0xb')][_0x2e43('0xd')][_0x2e43('0xe')];_0x120020[_0x2e43('0xf')]=_0x4bed3e[_0x2e43('0xb')][_0x2e43('0xd')][_0x2e43('0xf')];_0x120020[_0x2e43('0x10')]=_0x4bed3e[_0x2e43('0xb')][_0x2e43('0xd')][_0x2e43('0x10')];}if(_0x4bed3e[_0x2e43('0xb')][_0x2e43('0xd')]['authentication']){_0x120020[_0x2e43('0x11')]={'user':_0x4bed3e[_0x2e43('0xb')]['Smtp'][_0x2e43('0x12')],'pass':_0x4bed3e[_0x2e43('0xb')][_0x2e43('0xd')][_0x2e43('0x13')]};}var _0x1f6665={'account':_0x120020,'message':{'from':util[_0x2e43('0x14')](_0x2e43('0x15'),_0x4bed3e['MailAccount'][_0x2e43('0x16')],_0x4bed3e['MailAccount'][_0x2e43('0xa')]||_0x4bed3e['MailAccount'][_0x2e43('0xd')]['user']),'to':_0x4bed3e[_0x2e43('0xa')],'cc':_0x4bed3e['cc'],'bcc':_0x4bed3e[_0x2e43('0x17')],'subject':util[_0x2e43('0x14')](_0x2e43('0x18'),_0x2b1e7f[_0x2e43('0x16')],_0x4bed3e[_0x2e43('0x19')],_0x4bed3e[_0x2e43('0x1a')])}};var _0x1736e7=path[_0x2e43('0x1b')](__dirname,_0x2e43('0x1c'));var _0x284e04=_0x2b1e7f[_0x2e43('0x1d')];var _0x21e308=util[_0x2e43('0x14')](_0x2e43('0x1e'),path['basename'](_0x2b1e7f[_0x2e43('0x1d')],path['extname'](_0x2b1e7f[_0x2e43('0x1d')])),_0x2e43('0x1f'));var _0x181afa=path['join'](_0x1736e7,_0x284e04);var _0x3acd5c=path[_0x2e43('0x1b')](_0x1736e7,_0x21e308);if(fs['existsSync'](_0x181afa)){_0x2b1e7f[_0x2e43('0x20')]='Sent';_0x1f6665[_0x2e43('0x21')]['attachments']=[{'filename':_0x284e04,'path':_0x181afa}];_0x1f6665['message'][_0x2e43('0x22')]=util[_0x2e43('0x14')](_0x2e43('0x23'),JSON[_0x2e43('0x24')](_0x2b1e7f,null,0x2));}else if(fs['existsSync'](_0x3acd5c)){_0x2b1e7f['status']=_0x2e43('0x25');_0x1f6665['message'][_0x2e43('0x26')]=[{'filename':_0x21e308,'path':_0x3acd5c}];}else{_0x1f6665[_0x2e43('0x21')]['text']=_0x2e43('0x27');if(!_0x4bed3e[_0x2e43('0x28')]){_0x364ee9=![];logger[_0x2e43('0x29')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x364ee9){return client['request']('SendMail',_0x1f6665)['then'](function(_0x4c605b){if(_0x4c605b['error']){return logger[_0x2e43('0x2a')](_0x2e43('0x2b'),JSON[_0x2e43('0x24')](_0x4c605b));}return logger['info'](_0x2e43('0x2c'));})[_0x2e43('0x2d')](function(_0x3ac31a){return logger[_0x2e43('0x2a')](_0x2e43('0x2b'),JSON[_0x2e43('0x24')](_0x3ac31a));});}};}function handleError(){return function(_0x1459e1){return logger['error'](JSON[_0x2e43('0x24')](_0x1459e1));};}function handleResult(_0x4b532d){return function(_0x272b7d){logger['info'](_0x2e43('0x2e'),JSON['stringify'](_0x272b7d));if(_0x4b532d[_0x2e43('0xb')]&&_0x4b532d[_0x2e43('0xb')]['Smtp']&&!_[_0x2e43('0x2f')](_0x4b532d[_0x2e43('0xa')])){setTimeout(handleSendEmail(_0x4b532d,_0x272b7d),0x3c*0x3e8);}};}function handleJob(_0x449707){return function(){try{if(_[_0x2e43('0x2f')](_0x449707[_0x2e43('0x19')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x2e43('0x2f')](_0x449707['subtractUnit'])){return logger[_0x2e43('0x29')](_0x2e43('0x30'));}var _0x513ffb={'startDate':moment()[_0x2e43('0x31')](_0x449707['subtractNumber'],_0x449707[_0x2e43('0x1a')])['format'](_0x2e43('0x32')),'endDate':moment()[_0x2e43('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x2e43('0x33'),'output':_0x449707[_0x2e43('0x34')],'name':_0x449707['name']};if(!_[_0x2e43('0x2f')](_0x449707[_0x2e43('0x35')])){logger[_0x2e43('0x29')](_0x2e43('0x36'),_0x449707[_0x2e43('0x35')]);return analyticDefaultReportController[_0x2e43('0x37')]({'id':_0x449707[_0x2e43('0x35')]},_0x513ffb)['then'](handleResult(_0x449707))[_0x2e43('0x2d')](handleError());}if(!_[_0x2e43('0x2f')](_0x449707[_0x2e43('0x38')])){logger[_0x2e43('0x29')](_0x2e43('0x39'),_0x449707['CustomReportId']);return analyticCustomReportController[_0x2e43('0x37')]({'id':_0x449707[_0x2e43('0x38')]},_0x513ffb)[_0x2e43('0x3a')](handleResult(_0x449707))['catch'](handleError());}}catch(_0x2ab254){logger[_0x2e43('0x2a')](JSON[_0x2e43('0x24')](_0x2ab254));}return logger[_0x2e43('0x29')](_0x2e43('0x3b'));};}function getJobs(_0x475c26){var _0xf2b064={};if(_0x475c26){_0xf2b064['id']=_0x475c26;}return db['Schedule'][_0x2e43('0x3c')]({'where':_0xf2b064,'include':[{'model':db[_0x2e43('0xb')],'attributes':['id',_0x2e43('0x16'),'email'],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]}]})['then'](function(_0xcf3a1d){var _0x17ffb3=_[_0x2e43('0x3d')](manager['jobs']);var _0x1e2620=_[_0x2e43('0x3e')](_0xcf3a1d,function(_0xfff940){return _0xfff940['id'][_0x2e43('0x3f')]();});var _0x22756f=_['keyBy'](_0xcf3a1d,function(_0x4859d7){return _0x4859d7['id'][_0x2e43('0x3f')]();});var _0x124343=_0x475c26?_0x1e2620:_[_0x2e43('0x40')](_0x1e2620,_0x17ffb3);var _0x5f16c7=_[_0x2e43('0x41')](_0x1e2620,_0x17ffb3);var _0x326c27=_[_0x2e43('0x40')](_0x17ffb3,_0x1e2620);var _0x256aea;var _0x127788;for(_0x256aea=0x0;_0x256aea<_0x326c27[_0x2e43('0x42')]&&!_0x475c26;_0x256aea+=0x1){_0x127788=_0x326c27[_0x256aea][_0x2e43('0x3f')]();if(manager[_0x2e43('0x43')](_0x127788)){manager[_0x2e43('0x44')](_0x127788);manager[_0x2e43('0x45')](_0x127788);logger[_0x2e43('0x29')](_0x2e43('0x46'),_0x127788);}}logger[_0x2e43('0x29')]('toRun',JSON[_0x2e43('0x24')](_0x124343));for(_0x256aea=0x0;_0x256aea<_0x124343['length'];_0x256aea+=0x1){_0x127788=_0x124343[_0x256aea][_0x2e43('0x3f')]();logger[_0x2e43('0x29')](_0x2e43('0x47'),_0x127788);if(_0x475c26){logger[_0x2e43('0x29')](_0x2e43('0x48'),_0x475c26);logger['info'](JSON[_0x2e43('0x24')](_0x22756f[_0x127788]));BPromise[_0x2e43('0x49')]()[_0x2e43('0x3a')](handleJob(_0x22756f[_0x127788]));logger[_0x2e43('0x29')](_0x2e43('0x4a'),_0x22756f[_0x127788]['name'],_0x22756f[_0x127788][_0x2e43('0x4b')]);}else if(_0x22756f[_0x127788]['cron']&&_0x22756f[_0x127788][_0x2e43('0x4c')]&&moment()['isBetween'](_0x22756f[_0x127788][_0x2e43('0x4d')],_0x22756f[_0x127788][_0x2e43('0x4e')])){manager[_0x2e43('0x4f')](_0x127788,_0x22756f[_0x127788]['cron'],handleJob(_0x22756f[_0x127788]));manager[_0x2e43('0x50')](_0x127788);logger[_0x2e43('0x29')](_0x2e43('0x51'),_0x22756f[_0x127788][_0x2e43('0x16')],_0x22756f[_0x127788][_0x2e43('0x4b')]);}else if(manager[_0x2e43('0x43')](_0x127788)){manager[_0x2e43('0x44')](_0x127788);manager[_0x2e43('0x45')](_0x127788);logger[_0x2e43('0x29')](_0x2e43('0x52'),_0x22756f[_0x127788][_0x2e43('0x16')],_0x22756f[_0x127788][_0x2e43('0x4b')]);}}for(_0x256aea=0x0,_0x127788;_0x256aea<_0x5f16c7['length']&&!_0x475c26;_0x256aea+=0x1){_0x127788=_0x5f16c7[_0x256aea][_0x2e43('0x3f')]();if(manager[_0x2e43('0x43')](_0x127788)){if(_0x22756f[_0x127788][_0x2e43('0x4b')]&&_0x22756f[_0x127788]['active']&&moment()[_0x2e43('0x53')](_0x22756f[_0x127788][_0x2e43('0x4d')],_0x22756f[_0x127788][_0x2e43('0x4e')])){manager['update'](_0x127788,_0x22756f[_0x127788][_0x2e43('0x4b')],handleJob(_0x22756f[_0x127788]));logger[_0x2e43('0x29')](_0x2e43('0x54'),_0x22756f[_0x127788][_0x2e43('0x16')],_0x22756f[_0x127788]['cron']);}else{manager[_0x2e43('0x44')](_0x127788);manager[_0x2e43('0x45')](_0x127788);logger[_0x2e43('0x29')](_0x2e43('0x52'),_0x22756f[_0x127788][_0x2e43('0x16')],_0x22756f[_0x127788][_0x2e43('0x4b')]);}}}})[_0x2e43('0x2d')](function(_0x51da4c){logger['error'](JSON[_0x2e43('0x24')](_0x51da4c));});}exports[_0x2e43('0x55')]=function(_0x52fdd1){return getJobs(_0x52fdd1);};exports[_0x2e43('0x50')]=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 9a9ff3e..26e5b93 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9836=['hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','destroy','CmContact','bulkCreate','then','log','finished\x20populating','contacts1','CmHopper','contacts2'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x9836,0x1f0));var _0x6983=function(_0x7eadd1,_0x48a71b){_0x7eadd1=_0x7eadd1-0x0;var _0x51d796=_0x9836[_0x7eadd1];return _0x51d796;};'use strict';var util=require(_0x6983('0x0'));var db=require(_0x6983('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x6983('0x2')]({'id':i,'firstName':_0x6983('0x3')+i,'lastName':_0x6983('0x4')+i,'phone':0xf879fb460+i,'email':_0x6983('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x6983('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x6983('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6983('0x6')](),'updatedAt':Date[_0x6983('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x6983('0x3')+i,'lastName':_0x6983('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x6983('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x6983('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6983('0x6')](),'updatedAt':Date['now']()});}db['CmContact'][_0x6983('0x8')]({'where':{}})['then'](function(){return db[_0x6983('0x9')][_0x6983('0xa')](contacts);})[_0x6983('0xb')](function(){console[_0x6983('0xc')](_0x6983('0xd'),_0x6983('0xe'));return db[_0x6983('0xf')][_0x6983('0x8')]({'where':{}});})[_0x6983('0xb')](function(){return db['CmHopper'][_0x6983('0xa')](hopper);})[_0x6983('0xb')](function(){console[_0x6983('0xc')](_0x6983('0xd'),'hopper1');return db['CmContact'][_0x6983('0xa')](contacts2);})['then'](function(){console[_0x6983('0xc')](_0x6983('0xd'),_0x6983('0x10'));return db[_0x6983('0xf')]['bulkCreate'](hopper2);})['then'](function(){console[_0x6983('0xc')]('finished\x20populating',_0x6983('0x11'));})[_0x6983('0x12')](function(_0x302fb6){console[_0x6983('0xc')](_0x302fb6);}); \ No newline at end of file +var _0x5453=['@xcally.com','CmContact','then','log','contacts1','CmHopper','bulkCreate','finished\x20populating','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','now','innocenzo.biondo'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x5453,0x1d4));var _0x3545=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x5453[_0x2c91e9];return _0x13f0ff;};'use strict';var util=require(_0x3545('0x0'));var db=require(_0x3545('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x3545('0x2')]({'id':i,'firstName':_0x3545('0x3')+i,'lastName':_0x3545('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x3545('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x3545('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3545('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x3545('0x2')]({'id':i,'firstName':_0x3545('0x3')+i,'lastName':_0x3545('0x4')+i,'phone':0xf879fb460+i,'email':_0x3545('0x6')+i+_0x3545('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x3545('0x5')]()});}db[_0x3545('0x8')]['destroy']({'where':{}})[_0x3545('0x9')](function(){return db[_0x3545('0x8')]['bulkCreate'](contacts);})[_0x3545('0x9')](function(){console[_0x3545('0xa')]('finished\x20populating',_0x3545('0xb'));return db[_0x3545('0xc')]['destroy']({'where':{}});})[_0x3545('0x9')](function(){return db[_0x3545('0xc')][_0x3545('0xd')](hopper);})[_0x3545('0x9')](function(){console[_0x3545('0xa')](_0x3545('0xe'),_0x3545('0xf'));return db[_0x3545('0x8')][_0x3545('0xd')](contacts2);})['then'](function(){console[_0x3545('0xa')]('finished\x20populating',_0x3545('0x10'));return db['CmHopper'][_0x3545('0xd')](hopper2);})[_0x3545('0x9')](function(){console['log'](_0x3545('0xe'),_0x3545('0x11'));})[_0x3545('0x12')](function(_0x4bf732){console[_0x3545('0xa')](_0x4bf732);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 94feb86..80a9a5b 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dbb=['log','util','../mysqldb','format','%s%s','agent','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','User','then','catch'];(function(_0x1cb801,_0x1327b6){var _0x31dc49=function(_0x3bac2b){while(--_0x3bac2b){_0x1cb801['push'](_0x1cb801['shift']());}};_0x31dc49(++_0x1327b6);}(_0x7dbb,0x1e7));var _0xb7db=function(_0x1841a7,_0x106404){_0x1841a7=_0x1841a7-0x0;var _0x1f668c=_0x7dbb[_0x1841a7];return _0x1f668c;};'use strict';var util=require(_0xb7db('0x0'));var db=require(_0xb7db('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0xb7db('0x2')](_0xb7db('0x3'),_0xb7db('0x4'),i),'fullname':util[_0xb7db('0x2')](_0xb7db('0x3'),_0xb7db('0x4'),i),'email':util['format']('%s%s@xcally.com',_0xb7db('0x4'),i),'role':_0xb7db('0x4'),'password':_0xb7db('0x5'),'internal':0xfa0+i,'type':_0xb7db('0x6'),'transport':[_0xb7db('0x7'),'ws',_0xb7db('0x8')],'disallow':[_0xb7db('0x9')],'allow':[_0xb7db('0xa')],'defaultuser':util[_0xb7db('0x2')](_0xb7db('0x3'),_0xb7db('0x4'),i),'encryption':_0xb7db('0xb'),'avpf':_0xb7db('0xb'),'force_avp':'yes','icesupport':'yes','dtlsenable':_0xb7db('0xb'),'dtlsverify':'no','dtlscertfile':_0xb7db('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xb7db('0xd'),'callerid':util['format']('\x22%s\x22\x20<%s>',util[_0xb7db('0x2')](_0xb7db('0x3'),_0xb7db('0x4'),i),0xfa0+i)});}db[_0xb7db('0xe')]['bulkCreate'](users)[_0xb7db('0xf')](function(){console['log']('add\x20user');})[_0xb7db('0x10')](function(_0x25eeab){console[_0xb7db('0x11')](_0x25eeab);}); \ No newline at end of file +var _0x03b2=['udp','wss','all','ulaw','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','then','log','add\x20user','catch','util','../mysqldb','push','format','agent','%s%s','password','friend'];(function(_0x117f4c,_0x36a9b1){var _0x2b24e9=function(_0x31761b){while(--_0x31761b){_0x117f4c['push'](_0x117f4c['shift']());}};_0x2b24e9(++_0x36a9b1);}(_0x03b2,0x1c6));var _0x203b=function(_0x1bbeeb,_0x29c94b){_0x1bbeeb=_0x1bbeeb-0x0;var _0x8ffaea=_0x03b2[_0x1bbeeb];return _0x8ffaea;};'use strict';var util=require(_0x203b('0x0'));var db=require(_0x203b('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x203b('0x2')]({'name':util[_0x203b('0x3')]('%s%s',_0x203b('0x4'),i),'fullname':util[_0x203b('0x3')](_0x203b('0x5'),_0x203b('0x4'),i),'email':util['format']('%s%s@xcally.com',_0x203b('0x4'),i),'role':'agent','password':_0x203b('0x6'),'internal':0xfa0+i,'type':_0x203b('0x7'),'transport':[_0x203b('0x8'),'ws',_0x203b('0x9')],'disallow':[_0x203b('0xa')],'allow':[_0x203b('0xb')],'defaultuser':util['format'](_0x203b('0x5'),_0x203b('0x4'),i),'encryption':_0x203b('0xc'),'avpf':_0x203b('0xc'),'force_avp':_0x203b('0xc'),'icesupport':_0x203b('0xc'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x203b('0xd'),'dtlssetup':_0x203b('0xe'),'callerid':util[_0x203b('0x3')](_0x203b('0xf'),util['format']('%s%s',_0x203b('0x4'),i),0xfa0+i)});}db[_0x203b('0x10')]['bulkCreate'](users)[_0x203b('0x11')](function(){console[_0x203b('0x12')](_0x203b('0x13'));})[_0x203b('0x14')](function(_0xdeb64a){console['log'](_0xdeb64a);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 248880f..630cac6 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d52=['remoteAddress','remotePort','log','nsp','disconnect','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','agent','type','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','telephone','Campaign','format','%s:queue:%s','length','user:%s','find','userProfileId','handshake','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','all','voice','chat','fax','sms','mail','openchannel','telephone:%s','campaign:%s:%s','map','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_openchannel_interactions:remove','connection','setMaxListeners','address','request'];(function(_0x535956,_0x411673){var _0x5b21ab=function(_0x428d54){while(--_0x428d54){_0x535956['push'](_0x535956['shift']());}};_0x5b21ab(++_0x411673);}(_0x9d52,0x120));var _0x29d5=function(_0x58c513,_0x15deec){_0x58c513=_0x58c513-0x0;var _0x4da4c4=_0x9d52[_0x58c513];return _0x4da4c4;};'use strict';var _=require(_0x29d5('0x0'));var util=require(_0x29d5('0x1'));var BPromise=require(_0x29d5('0x2'));var db=require(_0x29d5('0x3'))['db'];var config=require(_0x29d5('0x4'));var queryQueues={'attributes':['id',_0x29d5('0x5')],'include':[{'as':_0x29d5('0x6'),'model':db[_0x29d5('0x7')],'attributes':['id',_0x29d5('0x5'),'role'],'raw':!![],'where':{'role':_0x29d5('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x29d5('0x5')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x29d5('0x5')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x29d5('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x29d5('0x5'),_0x29d5('0x9')],'where':{'type':_0x29d5('0xa')}};function getAssociatedResources(_0x406223,_0x1145fa,_0x2a955b){return db[_0x29d5('0xb')]['findOne']({'where':{'name':_0x406223,'userProfileId':_0x1145fa},'raw':!![]})[_0x29d5('0xc')](function(_0x209950){if(_0x209950){if(_0x209950[_0x29d5('0xd')]){switch(_0x406223){case _0x29d5('0xe'):case _0x29d5('0xf'):case _0x29d5('0x10'):case _0x29d5('0x11'):case'MailQueues':case _0x29d5('0x12'):return db[_0x2a955b]['findAll'](queryQueues);case _0x29d5('0x13'):return db[_0x2a955b][_0x29d5('0x14')](queryTelephones);case _0x29d5('0x15'):return db[_0x2a955b][_0x29d5('0x14')](queryTrunks);case _0x29d5('0x16'):return db[_0x2a955b][_0x29d5('0x14')](queryCampaigns);}}else{return db[_0x29d5('0x17')]['findAll']({'attributes':[_0x29d5('0x18')],'where':{'sectionId':_0x209950['id']},'raw':!![]})[_0x29d5('0xc')](function(_0x3517d8){if(_0x3517d8){var _0x22ee5f={'where':{'id':_['map'](_0x3517d8,_0x29d5('0x18'))},'raw':!![]};switch(_0x2a955b){case _0x29d5('0x7'):_0x22ee5f['where']['role']=_0x29d5('0x19');break;case _0x29d5('0x1a'):_0x22ee5f['where'][_0x29d5('0x9')]='ivr';break;}return db[_0x2a955b][_0x29d5('0x14')](_0x22ee5f);}else{return[];}});}}else{return[];}})[_0x29d5('0xc')](function(_0x44ee32){return _0x44ee32;});}function joinOrLeaveQueues(_0x1252d2,_0x5b1b39,_0xe3e472,_0x3d341a){_0x1252d2[_0x5b1b39](util[_0x29d5('0x1b')](_0x29d5('0x1c'),_0xe3e472,_0x3d341a['name']));if(_0x3d341a[_0x29d5('0x6')]){for(var _0x11df0f=0x0;_0x11df0f<_0x3d341a[_0x29d5('0x6')][_0x29d5('0x1d')];_0x11df0f+=0x1){_0x1252d2[_0x5b1b39](util['format'](_0x29d5('0x1e'),_0x3d341a[_0x29d5('0x6')][_0x11df0f][_0x29d5('0x5')]));}}}function joinOrLeave(_0x4c748f,_0x581edf,_0x320a13){var _0x3aaf32;if(_0x4c748f['handshake']['query']['id']){db['User'][_0x29d5('0x1f')]({'attributes':['id',_0x29d5('0x5'),'role',_0x29d5('0x20')],'where':{'id':_0x4c748f[_0x29d5('0x21')][_0x29d5('0x22')]['id']},'include':[{'model':db[_0x29d5('0x23')],'as':_0x29d5('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x29d5('0x25')],'as':_0x29d5('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x29d5('0x27')],'as':_0x29d5('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x29d5('0x29')],'as':_0x29d5('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x29d5('0x2b')],'as':_0x29d5('0x2c'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x458ef7){if(_0x458ef7){_0x3aaf32=_0x458ef7;_0x4c748f[_0x581edf](util[_0x29d5('0x1b')](_0x29d5('0x1e'),_0x458ef7[_0x29d5('0x5')]));var _0x5d58fb=[];switch(_0x458ef7['role']){case _0x29d5('0x2d'):_0x4c748f[_0x581edf](_0x29d5('0x2e'));_0x4c748f[_0x581edf](_0x29d5('0x2f'));if(queryQueues[_0x29d5('0x30')]('include')){delete queryQueues[_0x29d5('0x31')];}_0x5d58fb[_0x29d5('0x32')](db[_0x29d5('0x33')]['findAll'](queryQueues));_0x5d58fb[_0x29d5('0x32')](db[_0x29d5('0x34')]['findAll'](queryQueues));_0x5d58fb[_0x29d5('0x32')](db[_0x29d5('0x35')][_0x29d5('0x14')](queryQueues));_0x5d58fb[_0x29d5('0x32')](db[_0x29d5('0x36')][_0x29d5('0x14')](queryQueues));_0x5d58fb[_0x29d5('0x32')](db[_0x29d5('0x37')]['findAll'](queryQueues));_0x5d58fb[_0x29d5('0x32')](db[_0x29d5('0x38')][_0x29d5('0x14')](queryQueues));_0x5d58fb[_0x29d5('0x32')](db[_0x29d5('0x7')][_0x29d5('0x14')](queryTelephones));_0x5d58fb[_0x29d5('0x32')](db[_0x29d5('0x39')][_0x29d5('0x14')](queryTrunks));_0x5d58fb[_0x29d5('0x32')](db['Campaign'][_0x29d5('0x14')](queryCampaigns));_0x5d58fb[_0x29d5('0x32')](db[_0x29d5('0x7')][_0x29d5('0x14')](queryAgents));break;case _0x29d5('0x3a'):_0x4c748f[_0x581edf](_0x29d5('0x2e'));_0x4c748f[_0x581edf]('voice:outbound');_0x5d58fb['push'](getAssociatedResources(_0x29d5('0xe'),_0x458ef7[_0x29d5('0x20')],_0x29d5('0x33')));_0x5d58fb[_0x29d5('0x32')](getAssociatedResources(_0x29d5('0xf'),_0x458ef7[_0x29d5('0x20')],'ChatQueue'));_0x5d58fb[_0x29d5('0x32')](getAssociatedResources(_0x29d5('0x10'),_0x458ef7[_0x29d5('0x20')],_0x29d5('0x35')));_0x5d58fb['push'](getAssociatedResources(_0x29d5('0x11'),_0x458ef7[_0x29d5('0x20')],_0x29d5('0x36')));_0x5d58fb['push'](getAssociatedResources('MailQueues',_0x458ef7['userProfileId'],_0x29d5('0x37')));_0x5d58fb['push'](getAssociatedResources(_0x29d5('0x12'),_0x458ef7['userProfileId'],'OpenchannelQueue'));_0x5d58fb['push'](getAssociatedResources(_0x29d5('0x13'),_0x458ef7['userProfileId'],'User'));_0x5d58fb[_0x29d5('0x32')](getAssociatedResources(_0x29d5('0x15'),_0x458ef7[_0x29d5('0x20')],_0x29d5('0x39')));_0x5d58fb['push'](getAssociatedResources('IvrCampaigns',_0x458ef7[_0x29d5('0x20')],_0x29d5('0x1a')));_0x5d58fb[_0x29d5('0x32')](db[_0x29d5('0x7')][_0x29d5('0x14')](queryAgents));break;case'agent':_0x4c748f[_0x581edf]('voice:inbound');_0x4c748f[_0x581edf]('voice:outbound');_0x5d58fb[_0x29d5('0x32')](_0x458ef7[_0x29d5('0x3b')]({'attributes':['id',_0x29d5('0x5')]}));_0x5d58fb['push'](_0x458ef7[_0x29d5('0x3c')]({'attributes':['id',_0x29d5('0x5')]}));_0x5d58fb['push'](_0x458ef7[_0x29d5('0x3d')]({'attributes':['id',_0x29d5('0x5')]}));_0x5d58fb[_0x29d5('0x32')](_0x458ef7[_0x29d5('0x3e')]({'attributes':['id','name']}));_0x5d58fb[_0x29d5('0x32')](_0x458ef7['getMailQueues']({'attributes':['id',_0x29d5('0x5')]}));_0x5d58fb[_0x29d5('0x32')](_0x458ef7[_0x29d5('0x3f')]({'attributes':['id',_0x29d5('0x5')]}));break;}return BPromise[_0x29d5('0x40')](_0x5d58fb);}})[_0x29d5('0xc')](function(_0xf2cede){if(_0xf2cede&&_0xf2cede[_0x29d5('0x1d')]){for(var _0x1cb3a0=0x0;_0x1cb3a0<_0xf2cede['length'];_0x1cb3a0+=0x1){for(var _0x2adecd=0x0;_0x2adecd<_0xf2cede[_0x1cb3a0][_0x29d5('0x1d')];_0x2adecd+=0x1){switch(_0x1cb3a0){case 0x0:joinOrLeaveQueues(_0x4c748f,_0x581edf,_0x29d5('0x41'),_0xf2cede[_0x1cb3a0][_0x2adecd]);break;case 0x1:joinOrLeaveQueues(_0x4c748f,_0x581edf,_0x29d5('0x42'),_0xf2cede[_0x1cb3a0][_0x2adecd]);break;case 0x2:joinOrLeaveQueues(_0x4c748f,_0x581edf,_0x29d5('0x43'),_0xf2cede[_0x1cb3a0][_0x2adecd]);break;case 0x3:joinOrLeaveQueues(_0x4c748f,_0x581edf,_0x29d5('0x44'),_0xf2cede[_0x1cb3a0][_0x2adecd]);break;case 0x4:joinOrLeaveQueues(_0x4c748f,_0x581edf,_0x29d5('0x45'),_0xf2cede[_0x1cb3a0][_0x2adecd]);break;case 0x5:joinOrLeaveQueues(_0x4c748f,_0x581edf,_0x29d5('0x46'),_0xf2cede[_0x1cb3a0][_0x2adecd]);break;case 0x6:_0x4c748f[_0x581edf](util[_0x29d5('0x1b')](_0x29d5('0x47'),_0xf2cede[_0x1cb3a0][_0x2adecd][_0x29d5('0x5')]));break;case 0x7:_0x4c748f[_0x581edf](util['format']('trunk:%s',_0xf2cede[_0x1cb3a0][_0x2adecd][_0x29d5('0x5')]));break;case 0x8:_0x4c748f[_0x581edf](util['format'](_0x29d5('0x48'),_0xf2cede[_0x1cb3a0][_0x2adecd][_0x29d5('0x9')],_0xf2cede[_0x1cb3a0][_0x2adecd]['name']));break;case 0x9:_0x4c748f[_0x581edf](util['format'](_0x29d5('0x1e'),_0xf2cede[_0x1cb3a0][_0x2adecd][_0x29d5('0x5')]));break;}}}}})[_0x29d5('0xc')](function(){if(_0x581edf==='leave'){var _0x4c76f6=_[_0x29d5('0x49')](_0x3aaf32[_0x29d5('0x24')],'id');return _0x3aaf32[_0x29d5('0x4a')](_0x4c76f6)['then'](function(){for(var _0x4e7b93=0x0;_0x4e7b93<_0x4c76f6[_0x29d5('0x1d')];_0x4e7b93+=0x1){_0x320a13[_0x29d5('0x4b')](_0x29d5('0x4c'),{'ChatInteractionId':Number(_0x4c76f6[_0x4e7b93]),'UserId':Number(_0x3aaf32['id'])});}});}})['then'](function(){if(_0x581edf===_0x29d5('0x4d')){var _0x10e30d=_[_0x29d5('0x49')](_0x3aaf32[_0x29d5('0x26')],'id');return _0x3aaf32[_0x29d5('0x4e')](_0x10e30d)[_0x29d5('0xc')](function(){for(var _0x54af92=0x0;_0x54af92<_0x10e30d['length'];_0x54af92+=0x1){_0x320a13[_0x29d5('0x4b')](_0x29d5('0x4f'),{'MailInteractionId':Number(_0x10e30d[_0x54af92]),'UserId':Number(_0x3aaf32['id'])});}});}})['then'](function(){if(_0x581edf==='leave'){var _0x37bf63=_[_0x29d5('0x49')](_0x3aaf32[_0x29d5('0x28')],'id');return _0x3aaf32[_0x29d5('0x50')](_0x37bf63)['then'](function(){for(var _0x4a8802=0x0;_0x4a8802<_0x37bf63[_0x29d5('0x1d')];_0x4a8802+=0x1){_0x320a13[_0x29d5('0x4b')](_0x29d5('0x51'),{'FaxInteractionId':Number(_0x37bf63[_0x4a8802]),'UserId':Number(_0x3aaf32['id'])});}});}})[_0x29d5('0xc')](function(){if(_0x581edf===_0x29d5('0x4d')){var _0x2ff338=_['map'](_0x3aaf32[_0x29d5('0x2a')],'id');return _0x3aaf32[_0x29d5('0x52')](_0x2ff338)[_0x29d5('0xc')](function(){for(var _0x356591=0x0;_0x356591<_0x2ff338[_0x29d5('0x1d')];_0x356591+=0x1){_0x320a13[_0x29d5('0x4b')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x2ff338[_0x356591]),'UserId':Number(_0x3aaf32['id'])});}});}})[_0x29d5('0xc')](function(){if(_0x581edf==='leave'){var _0x40505b=_[_0x29d5('0x49')](_0x3aaf32[_0x29d5('0x2c')],'id');return _0x3aaf32['removeOpenchannelInteractions'](_0x40505b)['then'](function(){for(var _0x4e1e10=0x0;_0x4e1e10<_0x40505b[_0x29d5('0x1d')];_0x4e1e10+=0x1){_0x320a13[_0x29d5('0x4b')](_0x29d5('0x53'),{'OpenchannelInteractionId':Number(_0x40505b[_0x4e1e10]),'UserId':Number(_0x3aaf32['id'])});}});}})['catch'](function(_0xca99ad){_0x4c748f['log'](_0xca99ad);});}}function onDisconnect(_0xdbb9f2,_0x2cba7a){joinOrLeave(_0xdbb9f2,_0x29d5('0x4d'),_0x2cba7a);}function onConnect(_0xd57a91){joinOrLeave(_0xd57a91,'join');}exports['default']=function(_0x3cffdb){_0x3cffdb['on'](_0x29d5('0x54'),function(_0x47b439){_0x47b439[_0x29d5('0x55')](0x0);_0x47b439[_0x29d5('0x56')]=_0x47b439[_0x29d5('0x57')]['connection'][_0x29d5('0x58')]+':'+_0x47b439['request']['connection'][_0x29d5('0x59')];_0x47b439['connectedAt']=new Date();_0x47b439['log']=function(_0x50d3d4){console[_0x29d5('0x5a')]('SocketIO\x20'+_0x47b439[_0x29d5('0x5b')][_0x29d5('0x5')]+'['+_0x47b439['address']+']',_0x50d3d4);};_0x47b439['on'](_0x29d5('0x5c'),function(){onDisconnect(_0x47b439,_0x3cffdb);_0x47b439['log']('DISCONNECTED');});onConnect(_0x47b439);_0x47b439[_0x29d5('0x5a')](_0x29d5('0x5d'));});}; \ No newline at end of file +var _0x7522=['MailQueues','OpenchannelQueues','Telephones','Trunks','findAll','IvrCampaigns','UserProfileResource','resourceId','then','map','where','Campaign','%s:queue:%s','length','format','user:%s','query','find','userProfileId','handshake','ChatInteractions','MailInteractions','FaxInteractions','SmsInteractions','OpenchannelInteraction','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','VoiceQueues','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','all','voice','chat','fax','sms','openchannel','telephone:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','setMaxListeners','address','request','connection','remoteAddress','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','util','bluebird','./environment','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','autoAssociation','ChatQueues','FaxQueues','SmsQueues'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7522,0x16c));var _0x2752=function(_0x2c4f98,_0x18d64f){_0x2c4f98=_0x2c4f98-0x0;var _0x4ee147=_0x7522[_0x2c4f98];return _0x4ee147;};'use strict';var _=require('lodash');var util=require(_0x2752('0x0'));var BPromise=require(_0x2752('0x1'));var db=require('../mysqldb')['db'];var config=require(_0x2752('0x2'));var queryQueues={'attributes':['id',_0x2752('0x3')],'include':[{'as':_0x2752('0x4'),'model':db[_0x2752('0x5')],'attributes':['id','name',_0x2752('0x6')],'raw':!![],'where':{'role':_0x2752('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x2752('0x3')],'where':{'role':_0x2752('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x2752('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x2752('0x3')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x2752('0x3'),_0x2752('0x9')],'where':{'type':_0x2752('0xa')}};function getAssociatedResources(_0x10ff3f,_0x55200b,_0x5353b7){return db[_0x2752('0xb')]['findOne']({'where':{'name':_0x10ff3f,'userProfileId':_0x55200b},'raw':!![]})['then'](function(_0x15fdcb){if(_0x15fdcb){if(_0x15fdcb[_0x2752('0xc')]){switch(_0x10ff3f){case'VoiceQueues':case _0x2752('0xd'):case _0x2752('0xe'):case _0x2752('0xf'):case _0x2752('0x10'):case _0x2752('0x11'):return db[_0x5353b7]['findAll'](queryQueues);case _0x2752('0x12'):return db[_0x5353b7]['findAll'](queryTelephones);case _0x2752('0x13'):return db[_0x5353b7][_0x2752('0x14')](queryTrunks);case _0x2752('0x15'):return db[_0x5353b7][_0x2752('0x14')](queryCampaigns);}}else{return db[_0x2752('0x16')][_0x2752('0x14')]({'attributes':[_0x2752('0x17')],'where':{'sectionId':_0x15fdcb['id']},'raw':!![]})[_0x2752('0x18')](function(_0x42ffcb){if(_0x42ffcb){var _0x7d4dff={'where':{'id':_[_0x2752('0x19')](_0x42ffcb,_0x2752('0x17'))},'raw':!![]};switch(_0x5353b7){case _0x2752('0x5'):_0x7d4dff[_0x2752('0x1a')]['role']=_0x2752('0x8');break;case _0x2752('0x1b'):_0x7d4dff[_0x2752('0x1a')][_0x2752('0x9')]=_0x2752('0xa');break;}return db[_0x5353b7][_0x2752('0x14')](_0x7d4dff);}else{return[];}});}}else{return[];}})[_0x2752('0x18')](function(_0x3a1873){return _0x3a1873;});}function joinOrLeaveQueues(_0x4fe47f,_0x114392,_0x258a04,_0x4a199b){_0x4fe47f[_0x114392](util['format'](_0x2752('0x1c'),_0x258a04,_0x4a199b[_0x2752('0x3')]));if(_0x4a199b[_0x2752('0x4')]){for(var _0xbff199=0x0;_0xbff199<_0x4a199b[_0x2752('0x4')][_0x2752('0x1d')];_0xbff199+=0x1){_0x4fe47f[_0x114392](util[_0x2752('0x1e')](_0x2752('0x1f'),_0x4a199b['Agents'][_0xbff199]['name']));}}}function joinOrLeave(_0x109518,_0x480cf3,_0x10616b){var _0x2ae027;if(_0x109518['handshake'][_0x2752('0x20')]['id']){db[_0x2752('0x5')][_0x2752('0x21')]({'attributes':['id',_0x2752('0x3'),_0x2752('0x6'),_0x2752('0x22')],'where':{'id':_0x109518[_0x2752('0x23')][_0x2752('0x20')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x2752('0x24'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x2752('0x25'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x2752('0x26'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x2752('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x2752('0x28')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})[_0x2752('0x18')](function(_0x213396){if(_0x213396){_0x2ae027=_0x213396;_0x109518[_0x480cf3](util[_0x2752('0x1e')](_0x2752('0x1f'),_0x213396[_0x2752('0x3')]));var _0x1972b6=[];switch(_0x213396[_0x2752('0x6')]){case _0x2752('0x29'):_0x109518[_0x480cf3](_0x2752('0x2a'));_0x109518[_0x480cf3](_0x2752('0x2b'));if(queryQueues[_0x2752('0x2c')](_0x2752('0x2d'))){delete queryQueues[_0x2752('0x2d')];}_0x1972b6[_0x2752('0x2e')](db[_0x2752('0x2f')][_0x2752('0x14')](queryQueues));_0x1972b6[_0x2752('0x2e')](db[_0x2752('0x30')][_0x2752('0x14')](queryQueues));_0x1972b6[_0x2752('0x2e')](db[_0x2752('0x31')][_0x2752('0x14')](queryQueues));_0x1972b6['push'](db[_0x2752('0x32')][_0x2752('0x14')](queryQueues));_0x1972b6[_0x2752('0x2e')](db[_0x2752('0x33')]['findAll'](queryQueues));_0x1972b6[_0x2752('0x2e')](db[_0x2752('0x34')][_0x2752('0x14')](queryQueues));_0x1972b6['push'](db[_0x2752('0x5')]['findAll'](queryTelephones));_0x1972b6['push'](db[_0x2752('0x35')][_0x2752('0x14')](queryTrunks));_0x1972b6[_0x2752('0x2e')](db[_0x2752('0x1b')]['findAll'](queryCampaigns));_0x1972b6[_0x2752('0x2e')](db['User']['findAll'](queryAgents));break;case _0x2752('0x36'):_0x109518[_0x480cf3]('voice:inbound');_0x109518[_0x480cf3](_0x2752('0x2b'));_0x1972b6[_0x2752('0x2e')](getAssociatedResources(_0x2752('0x37'),_0x213396[_0x2752('0x22')],_0x2752('0x2f')));_0x1972b6['push'](getAssociatedResources(_0x2752('0xd'),_0x213396[_0x2752('0x22')],_0x2752('0x30')));_0x1972b6['push'](getAssociatedResources(_0x2752('0xe'),_0x213396[_0x2752('0x22')],_0x2752('0x31')));_0x1972b6['push'](getAssociatedResources(_0x2752('0xf'),_0x213396['userProfileId'],'SmsQueue'));_0x1972b6['push'](getAssociatedResources(_0x2752('0x10'),_0x213396['userProfileId'],'MailQueue'));_0x1972b6[_0x2752('0x2e')](getAssociatedResources(_0x2752('0x11'),_0x213396[_0x2752('0x22')],_0x2752('0x34')));_0x1972b6[_0x2752('0x2e')](getAssociatedResources('Telephones',_0x213396[_0x2752('0x22')],_0x2752('0x5')));_0x1972b6[_0x2752('0x2e')](getAssociatedResources(_0x2752('0x13'),_0x213396[_0x2752('0x22')],_0x2752('0x35')));_0x1972b6[_0x2752('0x2e')](getAssociatedResources('IvrCampaigns',_0x213396['userProfileId'],_0x2752('0x1b')));_0x1972b6[_0x2752('0x2e')](db[_0x2752('0x5')][_0x2752('0x14')](queryAgents));break;case _0x2752('0x7'):_0x109518[_0x480cf3](_0x2752('0x2a'));_0x109518[_0x480cf3]('voice:outbound');_0x1972b6[_0x2752('0x2e')](_0x213396[_0x2752('0x38')]({'attributes':['id',_0x2752('0x3')]}));_0x1972b6['push'](_0x213396[_0x2752('0x39')]({'attributes':['id',_0x2752('0x3')]}));_0x1972b6[_0x2752('0x2e')](_0x213396[_0x2752('0x3a')]({'attributes':['id','name']}));_0x1972b6[_0x2752('0x2e')](_0x213396[_0x2752('0x3b')]({'attributes':['id',_0x2752('0x3')]}));_0x1972b6[_0x2752('0x2e')](_0x213396['getMailQueues']({'attributes':['id',_0x2752('0x3')]}));_0x1972b6[_0x2752('0x2e')](_0x213396[_0x2752('0x3c')]({'attributes':['id',_0x2752('0x3')]}));break;}return BPromise[_0x2752('0x3d')](_0x1972b6);}})['then'](function(_0x3fb716){if(_0x3fb716&&_0x3fb716[_0x2752('0x1d')]){for(var _0x4a7a40=0x0;_0x4a7a40<_0x3fb716[_0x2752('0x1d')];_0x4a7a40+=0x1){for(var _0x5e133b=0x0;_0x5e133b<_0x3fb716[_0x4a7a40][_0x2752('0x1d')];_0x5e133b+=0x1){switch(_0x4a7a40){case 0x0:joinOrLeaveQueues(_0x109518,_0x480cf3,_0x2752('0x3e'),_0x3fb716[_0x4a7a40][_0x5e133b]);break;case 0x1:joinOrLeaveQueues(_0x109518,_0x480cf3,_0x2752('0x3f'),_0x3fb716[_0x4a7a40][_0x5e133b]);break;case 0x2:joinOrLeaveQueues(_0x109518,_0x480cf3,_0x2752('0x40'),_0x3fb716[_0x4a7a40][_0x5e133b]);break;case 0x3:joinOrLeaveQueues(_0x109518,_0x480cf3,_0x2752('0x41'),_0x3fb716[_0x4a7a40][_0x5e133b]);break;case 0x4:joinOrLeaveQueues(_0x109518,_0x480cf3,'mail',_0x3fb716[_0x4a7a40][_0x5e133b]);break;case 0x5:joinOrLeaveQueues(_0x109518,_0x480cf3,_0x2752('0x42'),_0x3fb716[_0x4a7a40][_0x5e133b]);break;case 0x6:_0x109518[_0x480cf3](util[_0x2752('0x1e')](_0x2752('0x43'),_0x3fb716[_0x4a7a40][_0x5e133b][_0x2752('0x3')]));break;case 0x7:_0x109518[_0x480cf3](util[_0x2752('0x1e')]('trunk:%s',_0x3fb716[_0x4a7a40][_0x5e133b][_0x2752('0x3')]));break;case 0x8:_0x109518[_0x480cf3](util['format'](_0x2752('0x44'),_0x3fb716[_0x4a7a40][_0x5e133b][_0x2752('0x9')],_0x3fb716[_0x4a7a40][_0x5e133b][_0x2752('0x3')]));break;case 0x9:_0x109518[_0x480cf3](util[_0x2752('0x1e')](_0x2752('0x1f'),_0x3fb716[_0x4a7a40][_0x5e133b][_0x2752('0x3')]));break;}}}}})[_0x2752('0x18')](function(){if(_0x480cf3===_0x2752('0x45')){var _0x485fb1=_['map'](_0x2ae027['ChatInteractions'],'id');return _0x2ae027[_0x2752('0x46')](_0x485fb1)['then'](function(){for(var _0x455779=0x0;_0x455779<_0x485fb1['length'];_0x455779+=0x1){_0x10616b[_0x2752('0x47')](_0x2752('0x48'),{'ChatInteractionId':Number(_0x485fb1[_0x455779]),'UserId':Number(_0x2ae027['id'])});}});}})[_0x2752('0x18')](function(){if(_0x480cf3===_0x2752('0x45')){var _0x1e23f6=_[_0x2752('0x19')](_0x2ae027[_0x2752('0x25')],'id');return _0x2ae027[_0x2752('0x49')](_0x1e23f6)[_0x2752('0x18')](function(){for(var _0x5971ec=0x0;_0x5971ec<_0x1e23f6[_0x2752('0x1d')];_0x5971ec+=0x1){_0x10616b[_0x2752('0x47')](_0x2752('0x4a'),{'MailInteractionId':Number(_0x1e23f6[_0x5971ec]),'UserId':Number(_0x2ae027['id'])});}});}})[_0x2752('0x18')](function(){if(_0x480cf3===_0x2752('0x45')){var _0x3b3005=_[_0x2752('0x19')](_0x2ae027[_0x2752('0x26')],'id');return _0x2ae027[_0x2752('0x4b')](_0x3b3005)[_0x2752('0x18')](function(){for(var _0x5131a7=0x0;_0x5131a7<_0x3b3005[_0x2752('0x1d')];_0x5131a7+=0x1){_0x10616b[_0x2752('0x47')](_0x2752('0x4c'),{'FaxInteractionId':Number(_0x3b3005[_0x5131a7]),'UserId':Number(_0x2ae027['id'])});}});}})['then'](function(){if(_0x480cf3===_0x2752('0x45')){var _0x49f29e=_[_0x2752('0x19')](_0x2ae027[_0x2752('0x27')],'id');return _0x2ae027[_0x2752('0x4d')](_0x49f29e)[_0x2752('0x18')](function(){for(var _0x33a623=0x0;_0x33a623<_0x49f29e[_0x2752('0x1d')];_0x33a623+=0x1){_0x10616b[_0x2752('0x47')](_0x2752('0x4e'),{'SmsInteractionId':Number(_0x49f29e[_0x33a623]),'UserId':Number(_0x2ae027['id'])});}});}})[_0x2752('0x18')](function(){if(_0x480cf3===_0x2752('0x45')){var _0x45ca05=_[_0x2752('0x19')](_0x2ae027[_0x2752('0x4f')],'id');return _0x2ae027[_0x2752('0x50')](_0x45ca05)[_0x2752('0x18')](function(){for(var _0x34f057=0x0;_0x34f057<_0x45ca05[_0x2752('0x1d')];_0x34f057+=0x1){_0x10616b[_0x2752('0x47')](_0x2752('0x51'),{'OpenchannelInteractionId':Number(_0x45ca05[_0x34f057]),'UserId':Number(_0x2ae027['id'])});}});}})[_0x2752('0x52')](function(_0x5a7467){_0x109518[_0x2752('0x53')](_0x5a7467);});}}function onDisconnect(_0x58f69f,_0x20ad1e){joinOrLeave(_0x58f69f,_0x2752('0x45'),_0x20ad1e);}function onConnect(_0x126c25){joinOrLeave(_0x126c25,_0x2752('0x54'));}exports['default']=function(_0x434405){_0x434405['on']('connection',function(_0x478524){_0x478524[_0x2752('0x55')](0x0);_0x478524[_0x2752('0x56')]=_0x478524[_0x2752('0x57')][_0x2752('0x58')][_0x2752('0x59')]+':'+_0x478524[_0x2752('0x57')][_0x2752('0x58')]['remotePort'];_0x478524['connectedAt']=new Date();_0x478524[_0x2752('0x53')]=function(_0x3ab1ee){console[_0x2752('0x53')](_0x2752('0x5a')+_0x478524[_0x2752('0x5b')][_0x2752('0x3')]+'['+_0x478524[_0x2752('0x56')]+']',_0x3ab1ee);};_0x478524['on'](_0x2752('0x5c'),function(){onDisconnect(_0x478524,_0x434405);_0x478524['log'](_0x2752('0x5d'));});onConnect(_0x478524);_0x478524[_0x2752('0x53')](_0x2752('0x5e'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index fc28461..6d312ea 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 _0x460d=['ChatInteraction','afterCreate','afterUpdate','ChatMessage','newmessage','Sms','SmsInteraction','newinteraction','closedinteraction','SmsMessage','Fax','FaxInteraction','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','EventManager','Trigger,\x20%s','error','code','catch','channel','direction','UserId','find','then','interface','format','SIP/%s','name','incomingmessage','outgoingmessage','event','opened','closed','get','User','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','http','Chat'];(function(_0x223d11,_0x4062d7){var _0x258106=function(_0x31c024){while(--_0x31c024){_0x223d11['push'](_0x223d11['shift']());}};_0x258106(++_0x4062d7);}(_0x460d,0xcd));var _0xd460=function(_0x91d019,_0x5223c4){_0x91d019=_0x91d019-0x0;var _0x19de1f=_0x460d[_0x91d019];return _0x19de1f;};'use strict';var util=require(_0xd460('0x0'));var db=require(_0xd460('0x1'))['db'];var jayson=require(_0xd460('0x2'));var logger=require(_0xd460('0x3'))(_0xd460('0x4'));var client=jayson['client'][_0xd460('0x5')]({'port':0x232a});var triggers=[{'channel':_0xd460('0x6'),'model':_0xd460('0x7'),'event':_0xd460('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xd460('0x6'),'model':_0xd460('0x7'),'event':_0xd460('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xd460('0x6'),'model':_0xd460('0xa'),'event':'afterCreate','condition':_0xd460('0xb'),'callback':afterCreateMessage},{'channel':_0xd460('0xc'),'model':_0xd460('0xd'),'event':'afterCreate','condition':_0xd460('0xe'),'callback':afterCreate},{'channel':_0xd460('0xc'),'model':_0xd460('0xd'),'event':'afterUpdate','condition':_0xd460('0xf'),'callback':afterUpdate},{'channel':_0xd460('0xc'),'model':_0xd460('0x10'),'event':'afterCreate','condition':_0xd460('0xb'),'callback':afterCreateMessage},{'channel':_0xd460('0x11'),'model':'FaxInteraction','event':_0xd460('0x8'),'condition':_0xd460('0xe'),'callback':afterCreate},{'channel':_0xd460('0x11'),'model':_0xd460('0x12'),'event':'afterUpdate','condition':_0xd460('0xf'),'callback':afterUpdate},{'channel':_0xd460('0x11'),'model':'FaxMessage','event':_0xd460('0x8'),'condition':_0xd460('0xb'),'callback':afterCreateMessage},{'channel':_0xd460('0x13'),'model':_0xd460('0x14'),'event':_0xd460('0x8'),'condition':_0xd460('0xe'),'callback':afterCreate},{'channel':_0xd460('0x13'),'model':'MailInteraction','event':'afterUpdate','condition':_0xd460('0xf'),'callback':afterUpdate},{'channel':_0xd460('0x13'),'model':_0xd460('0x15'),'event':_0xd460('0x8'),'condition':_0xd460('0xb'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0xd460('0x16'),'event':_0xd460('0x8'),'condition':_0xd460('0xe'),'callback':afterCreate},{'channel':_0xd460('0x17'),'model':'OpenchannelInteraction','event':_0xd460('0x9'),'condition':_0xd460('0xf'),'callback':afterUpdate},{'channel':_0xd460('0x17'),'model':_0xd460('0x18'),'event':_0xd460('0x8'),'condition':_0xd460('0xb'),'callback':afterCreateMessage}];function request(_0x3d5a15){return client['request'](_0xd460('0x19'),_0x3d5a15)['then'](function(_0x2a56d2){logger['info'](_0xd460('0x1a'),_0xd460('0x19'),_0x2a56d2);if(_0x2a56d2[_0xd460('0x1b')]){if(_0x2a56d2[_0xd460('0x1b')][_0xd460('0x1c')]===0x1f4){logger['error'](_0xd460('0x1a'),_0xd460('0x19'),_0x2a56d2[_0xd460('0x1b')]);}}})[_0xd460('0x1d')](function(_0x1ef1c1){logger[_0xd460('0x1b')]('Trigger,\x20%s',_0xd460('0x19'),_0x1ef1c1);});}function afterCreateMessage(_0x3999bf,_0x33255d){return function(_0x3fb14d,_0x292596){_0x3fb14d=_0x3fb14d['get']({'plain':!![]});_0x3fb14d[_0xd460('0x1e')]=_0x3999bf;_0x3fb14d['event']=_0x3fb14d[_0xd460('0x1f')];if(_0x3fb14d[_0xd460('0x20')]){return db['User'][_0xd460('0x21')]({'where':{'id':_0x3fb14d['UserId']},'attributes':['id','name'],'raw':!![]})[_0xd460('0x22')](function(_0xa9598f){_0x3fb14d[_0xd460('0x23')]=util[_0xd460('0x24')](_0xd460('0x25'),_0xa9598f[_0xd460('0x26')]);_0x3fb14d[_0xd460('0x1e')]=_0x3999bf;return request({'event':_0xd460('0x27'),'message':_0x3fb14d});})[_0xd460('0x1d')](function(_0x157d44){console[_0xd460('0x1b')](_0x157d44);});}else{return request({'event':_0xd460('0x28'),'message':_0x3fb14d});}};}function afterCreate(_0x1727e0,_0x1a981d){return function(_0x3d20a8,_0xb273fa){_0x3d20a8=_0x3d20a8['get']({'plain':!![]});_0x3d20a8[_0xd460('0x1e')]=_0x1727e0;_0x3d20a8[_0xd460('0x29')]=_0xd460('0x2a');return request({'event':_0x1a981d,'message':_0x3d20a8});};}function afterUpdate(_0x3333e0,_0x156646){return function(_0x43aa86,_0xf96732){if(_0x43aa86['changed']('closed')&&_0x43aa86[_0xd460('0x2b')]){_0x43aa86=_0x43aa86[_0xd460('0x2c')]({'plain':!![]});_0x43aa86[_0xd460('0x1e')]=_0x3333e0;_0x43aa86[_0xd460('0x29')]=_0xd460('0x2b');if(_0x43aa86[_0xd460('0x20')]){return db[_0xd460('0x2d')][_0xd460('0x21')]({'where':{'id':_0x43aa86['UserId']},'attributes':['id','name'],'raw':!![]})[_0xd460('0x22')](function(_0x4111b5){_0x43aa86[_0xd460('0x23')]=util[_0xd460('0x24')]('SIP/%s',_0x4111b5[_0xd460('0x26')]);return request({'event':_0x156646,'message':_0x43aa86});})['catch'](function(_0x940bcb){console['error'](_0x940bcb);});}else{return request({'event':_0x156646,'message':_0x43aa86});}}};}exports['default']=function(){for(var _0x31d89f=0x0;_0x31d89f=_0x701879[_0xbc97('0x12')]){throw Error(_0xbc97('0x13'));}_0x1c4d22(_0x514053);})[_0xbc97('0x14')](function(_0x2cc7f7){_0x2b7e19(_0x2cc7f7);});});}; \ No newline at end of file +var _0xda27=['User','count','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','mail','chat','fax','sms','openchannel','getChannels','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role'];(function(_0x5ea6ae,_0xf58ebc){var _0x9812fc=function(_0xd63ba1){while(--_0xd63ba1){_0x5ea6ae['push'](_0x5ea6ae['shift']());}};_0x9812fc(++_0xf58ebc);}(_0xda27,0xb6));var _0x7da2=function(_0x38d23e,_0x5e4cd6){_0x38d23e=_0x38d23e-0x0;var _0x55a3eb=_0xda27[_0x38d23e];return _0x55a3eb;};'use strict';var _=require(_0x7da2('0x0'));var BPromise=require(_0x7da2('0x1'));var db=require(_0x7da2('0x2'))['db'];var util=require(_0x7da2('0x3'));var channels=['voice',_0x7da2('0x4'),_0x7da2('0x5'),_0x7da2('0x6'),_0x7da2('0x7'),_0x7da2('0x8')];exports[_0x7da2('0x9')]=function(){return channels;};exports['isValidChannel']=function(_0x5b3c67){_0x5b3c67=_0x5b3c67[_0x7da2('0xa')]();return _[_0x7da2('0xb')](channels,_0x5b3c67);};exports[_0x7da2('0xc')]=function(_0x20cb22,_0x6dab9a,_0x4083f,_0x2c3b72){var _0x179530={'loginAttempts':_0x6dab9a,'blocked':_0x4083f};if(!_[_0x7da2('0xd')](_0x2c3b72)){_0x179530[_0x7da2('0xe')]=_0x2c3b72;}return _0x20cb22[_0x7da2('0xf')](_0x179530);};exports[_0x7da2('0x10')]=function(_0x4c5eeb){return new BPromise(function(_0x430d23,_0x5c49a5){var _0x4832af=0x0;if(_0x4c5eeb[_0x7da2('0x11')]!=='agent'){_0x430d23(_0x4c5eeb);}db[_0x7da2('0x12')][_0x7da2('0x13')]({'where':{'role':_0x7da2('0x14'),'online':!![],'id':{'$ne':_0x4c5eeb['id']}}})[_0x7da2('0x15')](function(_0x54c863){_0x4832af=_0x54c863;return util['getLicense']();})[_0x7da2('0x15')](function(_0x452aeb){if(_0x452aeb&&_0x452aeb[_0x7da2('0x16')]&&_0x4832af>=_0x452aeb['agents']){throw Error(_0x7da2('0x17'));}_0x430d23(_0x4c5eeb);})[_0x7da2('0x18')](function(_0x45512f){_0x5c49a5(_0x45512f);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index bc5914e..db41953 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc69b=['status','json','send','exports','404'];(function(_0x5c3ef9,_0x5428d1){var _0x1b8a69=function(_0x31c2fd){while(--_0x31c2fd){_0x5c3ef9['push'](_0x5c3ef9['shift']());}};_0x1b8a69(++_0x5428d1);}(_0xc69b,0x17f));var _0xbc69=function(_0x57cb4f,_0x541f57){_0x57cb4f=_0x57cb4f-0x0;var _0x29bb45=_0xc69b[_0x57cb4f];return _0x29bb45;};'use strict';module[_0xbc69('0x0')][0x194]=function pageNotFound(_0x196cd0,_0x34f39e){var _0x4760d5=_0xbc69('0x1');var _0x8f374=0x194;var _0x487f42={'status':_0x8f374};_0x34f39e[_0xbc69('0x2')](_0x487f42[_0xbc69('0x2')]);_0x34f39e['render'](_0x4760d5,{},function(_0x3851c6,_0x7ba31e){if(_0x3851c6){return _0x34f39e[_0xbc69('0x2')](_0x487f42[_0xbc69('0x2')])[_0xbc69('0x3')](_0x487f42);}_0x34f39e[_0xbc69('0x4')](_0x7ba31e);});}; \ No newline at end of file +var _0xbfbb=['send','exports','404','status','render','json'];(function(_0x45d263,_0x539a82){var _0x39fe53=function(_0x4fa7db){while(--_0x4fa7db){_0x45d263['push'](_0x45d263['shift']());}};_0x39fe53(++_0x539a82);}(_0xbfbb,0x133));var _0xbbfb=function(_0x674cab,_0x5bffb7){_0x674cab=_0x674cab-0x0;var _0x257329=_0xbfbb[_0x674cab];return _0x257329;};'use strict';module[_0xbbfb('0x0')][0x194]=function pageNotFound(_0x2421a4,_0x13d802){var _0x5b0125=_0xbbfb('0x1');var _0x2dbcbf=0x194;var _0x5a44ea={'status':_0x2dbcbf};_0x13d802[_0xbbfb('0x2')](_0x5a44ea[_0xbbfb('0x2')]);_0x13d802[_0xbbfb('0x3')](_0x5b0125,{},function(_0x5c4c7e,_0xdfdc48){if(_0x5c4c7e){return _0x13d802[_0xbbfb('0x2')](_0x5a44ea['status'])[_0xbbfb('0x4')](_0x5a44ea);}_0x13d802[_0xbbfb('0x5')](_0xdfdc48);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 04b70cf..bc6bee2 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5649=['Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','Disposition','Dispositions','Answers','Interactions','ListId','TemplateId','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','Tag','ThroughTags','user_has_mail_interactions','Attachments','MailApplication','restrict','TagId','List','Items','CannedAnswer','FaxAccountId','Exntensions','fax_interaction_has_tags','Users','FaxInteractionId','Interaction','AttachmentId','team_has_fax_queues','SmsAccountId','user_has_sms_accounts','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','team_has_openchannel_queues','ChatWebsite','ChatWebsiteId','ProactiveActions','ChatMessage','ChatQueue','Queue','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatGroupId','CmCompany','RelatedCompany','Contacts','CompanyId','PriceLists','Dossiers','PaymentMethod','saPaymentMethod','Company','cm_contact_has_tags','Agent','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','OneAny','Actions','AutomationId','Intervals','MailApplications','ChatApplications','SmsApplications','CustomReportId','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Action','AnalyticCustomReport','Fields','DefaultReportId','MetricId','Configurations','Subjects','SubjectId','SalesforceField','Descriptions','DescriptionId','FieldId','Description','Field','VariableId','AccountId','Subject','int_desk_configuration_has_tags','ZohoAccount','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerField','VtigerAccount','int_vtiger_configuration_has_tags','FromId','ToId','SessionId','SmsQueueReport','ProjectId','OpenchannelQueues','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','ToAgent','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','FromAgent','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','Queues','UserProfileSections','Resources','sectionId','CrmWorkflowStep','SADossier','WorkflowId','WorkflowStepId','CrmWorkflowNextStep','crm_workflow_steps_has_crm_workflow_steps','TaskId','SATypeProduct','TypeProductId','ProductId','SASalesCondition','SaleCondition','TypeSalesConditionId','UnitMeasure','UnitMeasureId','TypeProduct','PriceListId','SAProductQuotation','ProductPriceList','ProductPriceListId','Pricelist','DossierId','Workflow','WorkflowStep','RequestId','Requests','Quotations','QuotationId','Request','Quotation','Proforma','ProformaId','Invoice','InvoiceId','Orders','OrderId','Dossier','Order','Payments','Companies','SACreditNoteDetail','CreditNote','CreditNoteId','CompanyType','CompanyRelationship','saCompanyRelationship','exports','path','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','mysql','utf8mb4','name','sequelizeHistory','xcall','database','username','password','options','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','UserFaxQueue','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.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','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../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','SquareMessage','../api/squareMessage/squareMessage.model','Team','License','../api/license/license.model','Campaign','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','CrmNation','../api/crmNation/crmNation.model','CrmWorkflow','CrmTask','CrmActionsList','../api/crmActionsList/crmActionsList.model','../api/saTypeProduct/saTypeProduct.model','SAUnitMeasure','../api/saUnitMeasure/saUnitMeasure.model','SAInvoiceLaw','../api/saInvoiceLaw/saInvoiceLaw.model','SAProduct','../api/saProduct/saProduct.model','../api/saSalesCondition/saSalesCondition.model','SAPriceList','../api/saPriceList/saPriceList.model','SAProductPricesList','../api/saProductPricesList/saProductPricesList.model','SARequest','SAQuotation','../api/saQuotation/saQuotation.model','SAOrder','../api/saOrder/saOrder.model','SAProforma','SAInvoice','../api/saInvoice/saInvoice.model','SAAsset','SAInvoiceDetail','../api/saInvoiceDetail/saInvoiceDetail.model','SAProformaDetail','../api/saProformaDetail/saProformaDetail.model','SAPayment','../api/saPayment/saPayment.model','SAPaymentMethod','../api/saPaymentMethod/saPaymentMethod.model','SACreditNote','../api/saCreditNote/saCreditNote.model','SAInvoiceNumber','../api/saInvoiceNumber/saInvoiceNumber.model','SACreditNoteNumber','SACompanyType','../api/saCompanyType/saCompanyType.model','SACompanyRelationship','hasOne','VoiceMail','cascade','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','OpenchannelInteractions','SmsInteraction','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','userProfileId','belongsToMany','Groups','chat_group_has_users','cm_user_has_contacts','Lists','user_has_teams','ChatInteractions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','VoiceQueues','MailQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueue','cm_user_has_lists','user_has_voice_prefixes','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','UserVoiceQueueRt'];(function(_0x4d76d9,_0x3bd265){var _0x55bae4=function(_0x25be1d){while(--_0x25be1d){_0x4d76d9['push'](_0x4d76d9['shift']());}};_0x55bae4(++_0x3bd265);}(_0x5649,0xde));var _0x9564=function(_0x51d22e,_0x276640){_0x51d22e=_0x51d22e-0x0;var _0x275be3=_0x5649[_0x51d22e];return _0x275be3;};'use strict';var path=require(_0x9564('0x0'));var config=require(_0x9564('0x1'));var Sequelize=require(_0x9564('0x2'));var _=require(_0x9564('0x3'));var jstz=require(_0x9564('0x4'));var timezone=jstz[_0x9564('0x5')]();config[_0x9564('0x2')]=_[_0x9564('0x6')](config[_0x9564('0x2')],{'database':_0x9564('0x7'),'username':'xcall','password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x9564('0x8'),'dialectOptions':{'charset':_0x9564('0x9')},'logging':![],'timezone':timezone[_0x9564('0xa')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});config[_0x9564('0xb')]=_['defaultsDeep'](config['sequelizeHistory'],{'database':_0x9564('0x7'),'username':_0x9564('0xc'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x9564('0x8'),'dialectOptions':{'charset':_0x9564('0x9')},'logging':![],'timezone':timezone[_0x9564('0xa')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9564('0x2')][_0x9564('0xd')],config[_0x9564('0x2')][_0x9564('0xe')],config[_0x9564('0x2')][_0x9564('0xf')],config[_0x9564('0x2')][_0x9564('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9564('0xb')][_0x9564('0xd')],config[_0x9564('0xb')][_0x9564('0xe')],config[_0x9564('0xb')][_0x9564('0xf')],config[_0x9564('0xb')][_0x9564('0x10')])};db[_0x9564('0x11')]=db['sequelize']['import'](_0x9564('0x12'));db[_0x9564('0x13')]=db['sequelize'][_0x9564('0x14')](_0x9564('0x15'));db[_0x9564('0x16')]=db[_0x9564('0x2')][_0x9564('0x14')]('../api/voiceContext/voiceContext.model');db[_0x9564('0x17')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x18'));db[_0x9564('0x19')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x1a'));db[_0x9564('0x1b')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x1c'));db[_0x9564('0x1d')]=db['sequelize']['import']('../api/voiceRecording/voiceRecording.model');db[_0x9564('0x1e')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x1f'));db['VoiceMail']=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x20'));db[_0x9564('0x21')]=db[_0x9564('0x2')]['import'](_0x9564('0x22'));db[_0x9564('0x23')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x24'));db['VoiceDialReport']=db['sequelize']['import'](_0x9564('0x25'));db[_0x9564('0x26')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x27'));db[_0x9564('0x28')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x29'));db['MemberReport']=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x2a'));db[_0x9564('0x2b')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x2c'));db['VoiceTransferReport']=db[_0x9564('0x2')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db['UserVoiceQueueRt']=db['sequelize'][_0x9564('0x14')](_0x9564('0x2d'));db[_0x9564('0x2e')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x2f'));db[_0x9564('0x30')]=db[_0x9564('0x2')][_0x9564('0x14')]('../api/userChatQueue/userChatQueue.model');db[_0x9564('0x31')]=db[_0x9564('0x2')][_0x9564('0x14')]('../api/userMailQueue/userMailQueue.model');db[_0x9564('0x32')]=db[_0x9564('0x2')][_0x9564('0x14')]('../api/userFaxQueue/userFaxQueue.model');db[_0x9564('0x33')]=db['sequelize'][_0x9564('0x14')]('../api/userSmsQueue/userSmsQueue.model');db[_0x9564('0x34')]=db['sequelize'][_0x9564('0x14')](_0x9564('0x35'));db[_0x9564('0x36')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x37'));db[_0x9564('0x38')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x39'));db[_0x9564('0x3a')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x3b'));db[_0x9564('0x3c')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x3d'));db[_0x9564('0x3e')]=db['sequelize'][_0x9564('0x14')](_0x9564('0x3f'));db['MailInteraction']=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x40'));db[_0x9564('0x41')]=db[_0x9564('0x2')]['import'](_0x9564('0x42'));db['MailApplication']=db['sequelize']['import']('../api/mailApplication/mailApplication.model');db[_0x9564('0x43')]=db['sequelize']['import'](_0x9564('0x44'));db[_0x9564('0x45')]=db['sequelize'][_0x9564('0x14')](_0x9564('0x46'));db[_0x9564('0x47')]=db[_0x9564('0x2')]['import']('../api/dashboardItem/dashboardItem.model');db[_0x9564('0x48')]=db['sequelize']['import'](_0x9564('0x49'));db[_0x9564('0x4a')]=db[_0x9564('0x2')]['import'](_0x9564('0x4b'));db['FaxInteraction']=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x4c'));db[_0x9564('0x4d')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x4e'));db[_0x9564('0x4f')]=db[_0x9564('0x2')]['import'](_0x9564('0x50'));db[_0x9564('0x51')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x52'));db[_0x9564('0x53')]=db['sequelize'][_0x9564('0x14')](_0x9564('0x54'));db[_0x9564('0x55')]=db['sequelize'][_0x9564('0x14')]('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db[_0x9564('0x2')]['import'](_0x9564('0x56'));db[_0x9564('0x57')]=db[_0x9564('0x2')][_0x9564('0x14')]('../api/smsMessage/smsMessage.model');db[_0x9564('0x58')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x59'));db[_0x9564('0x5a')]=db['sequelize'][_0x9564('0x14')](_0x9564('0x5b'));db[_0x9564('0x5c')]=db[_0x9564('0x2')]['import']('../api/openchannelApplication/openchannelApplication.model');db[_0x9564('0x5d')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x5e'));db[_0x9564('0x5f')]=db[_0x9564('0x2')]['import'](_0x9564('0x60'));db['OpenchannelQueue']=db['sequelize'][_0x9564('0x14')](_0x9564('0x61'));db['ChatWebsite']=db[_0x9564('0x2')][_0x9564('0x14')]('../api/chatWebsite/chatWebsite.model');db[_0x9564('0x62')]=db[_0x9564('0x2')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x9564('0x63')]=db[_0x9564('0x2')]['import'](_0x9564('0x64'));db[_0x9564('0x65')]=db[_0x9564('0x2')][_0x9564('0x14')]('../api/chatInteraction/chatInteraction.model');db['ChatMessage']=db['sequelize'][_0x9564('0x14')](_0x9564('0x66'));db[_0x9564('0x67')]=db[_0x9564('0x2')]['import'](_0x9564('0x68'));db['ChatQueue']=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x69'));db[_0x9564('0x6a')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x6b'));db[_0x9564('0x6c')]=db['sequelize'][_0x9564('0x14')]('../api/chatProactiveAction/chatProactiveAction.model');db['CmCompany']=db['sequelize'][_0x9564('0x14')](_0x9564('0x6d'));db[_0x9564('0x6e')]=db[_0x9564('0x2')]['import']('../api/cmContact/cmContact.model');db[_0x9564('0x6f')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x70'));db[_0x9564('0x71')]=db[_0x9564('0x2')][_0x9564('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x9564('0x72')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x73'));db[_0x9564('0x74')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x75'));db[_0x9564('0x76')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x77'));db[_0x9564('0x78')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x79'));db['Action']=db['sequelize']['import'](_0x9564('0x7a'));db[_0x9564('0x7b')]=db[_0x9564('0x2')]['import'](_0x9564('0x7c'));db['CannedAnswer']=db[_0x9564('0x2')][_0x9564('0x14')]('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db['sequelize']['import'](_0x9564('0x7d'));db[_0x9564('0x7e')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x7f'));db[_0x9564('0x80')]=db['sequelize'][_0x9564('0x14')]('../api/interval/interval.model');db[_0x9564('0x81')]=db['sequelize']['import'](_0x9564('0x82'));db[_0x9564('0x83')]=db[_0x9564('0x2')][_0x9564('0x14')]('../api/cdr/cdr.model');db[_0x9564('0x84')]=db[_0x9564('0x2')]['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x9564('0x85')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x86'));db[_0x9564('0x87')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x88'));db['Tag']=db[_0x9564('0x2')]['import']('../api/tag/tag.model');db[_0x9564('0x89')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x8a'));db[_0x9564('0x8b')]=db[_0x9564('0x2')]['import'](_0x9564('0x8c'));db[_0x9564('0x8d')]=db['sequelize'][_0x9564('0x14')](_0x9564('0x8e'));db[_0x9564('0x8f')]=db[_0x9564('0x2')]['import']('../api/integration/integration.model');db[_0x9564('0x90')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x91'));db['AnalyticCustomReport']=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x92'));db[_0x9564('0x93')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x94'));db['AnalyticExtractedReport']=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x95'));db[_0x9564('0x96')]=db['sequelize'][_0x9564('0x14')]('../api/analyticMetric/analyticMetric.model');db[_0x9564('0x97')]=db[_0x9564('0x2')]['import']('../api/analyticFieldReport/analyticFieldReport.model');db[_0x9564('0x98')]=db['sequelize']['import']('../api/analyticTreeReport/analyticTreeReport.model');db[_0x9564('0x99')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x9a'));db[_0x9564('0x9b')]=db['sequelize']['import'](_0x9564('0x9c'));db['SalesforceField']=db[_0x9564('0x2')][_0x9564('0x14')]('../api/intSalesforceField/intSalesforceField.model');db[_0x9564('0x9d')]=db[_0x9564('0x2')]['import'](_0x9564('0x9e'));db[_0x9564('0x9f')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xa0'));db[_0x9564('0xa1')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xa2'));db[_0x9564('0xa3')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xa4'));db[_0x9564('0xa5')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xa6'));db[_0x9564('0xa7')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xa8'));db['ZohoAccount']=db['sequelize'][_0x9564('0x14')]('../api/intZohoAccount/intZohoAccount.model');db[_0x9564('0xa9')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xaa'));db[_0x9564('0xab')]=db[_0x9564('0x2')]['import'](_0x9564('0xac'));db[_0x9564('0xad')]=db[_0x9564('0x2')][_0x9564('0x14')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x9564('0xae')]=db['sequelize'][_0x9564('0x14')](_0x9564('0xaf'));db['ZendeskField']=db[_0x9564('0x2')]['import'](_0x9564('0xb0'));db[_0x9564('0xb1')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xb2'));db[_0x9564('0xb3')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xb4'));db['FreshdeskField']=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xb5'));db['VtigerAccount']=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xb6'));db[_0x9564('0xb7')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xb8'));db['VtigerField']=db[_0x9564('0x2')]['import'](_0x9564('0xb9'));db[_0x9564('0xba')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xbb'));db[_0x9564('0xbc')]=db[_0x9564('0x2')]['import'](_0x9564('0xbd'));db[_0x9564('0xbe')]=db[_0x9564('0x2')]['import']('../api/intServicenowField/intServicenowField.model');db[_0x9564('0xbf')]=db[_0x9564('0x2')][_0x9564('0x14')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x9564('0xc0')]=db[_0x9564('0x2')]['import'](_0x9564('0xc1'));db[_0x9564('0xc2')]=db['sequelize'][_0x9564('0x14')](_0x9564('0xc3'));db[_0x9564('0x8f')]=db['sequelize'][_0x9564('0x14')]('../api/integration/integration.model');db[_0x9564('0xc4')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xc5'));db[_0x9564('0xc6')]=db['sequelize'][_0x9564('0x14')](_0x9564('0xc7'));db[_0x9564('0xc8')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xc9'));db[_0x9564('0xca')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xcb'));db[_0x9564('0xcc')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xcd'));db[_0x9564('0xce')]=db[_0x9564('0x2')]['import'](_0x9564('0xcf'));db['SmsQueueReport']=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xd0'));db[_0x9564('0xd1')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xd2'));db['SquareDetailsReport']=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xd3'));db[_0x9564('0xd4')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xd5'));db[_0x9564('0xd6')]=db[_0x9564('0x2')]['import'](_0x9564('0xd7'));db[_0x9564('0xd8')]=db['sequelize']['import'](_0x9564('0xd9'));db[_0x9564('0xda')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xdb'));db[_0x9564('0xdc')]=db[_0x9564('0x2')][_0x9564('0x14')]('../api/squareRecording/squareRecording.model');db[_0x9564('0xdd')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xde'));db[_0x9564('0xdf')]=db[_0x9564('0x2')][_0x9564('0x14')]('../api/team/team.model');db[_0x9564('0xe0')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xe1'));db[_0x9564('0xe2')]=db[_0x9564('0x2')][_0x9564('0x14')]('../api/campaign/campaign.model');db['Migration']=db['sequelize'][_0x9564('0x14')]('../api/migration/migration.model');db[_0x9564('0xe3')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xe4'));db[_0x9564('0xe5')]=db['sequelize'][_0x9564('0x14')]('../api/plugin/plugin.model');db[_0x9564('0xe6')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xe7'));db[_0x9564('0xe8')]=db[_0x9564('0x2')]['import']('../api/chatTransferReport/chatTransferReport.model');db[_0x9564('0xe9')]=db[_0x9564('0x2')]['import'](_0x9564('0xea'));db['OpenchannelTransferReport']=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xeb'));db[_0x9564('0xec')]=db['sequelize']['import'](_0x9564('0xed'));db[_0x9564('0xee')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xef'));db[_0x9564('0xf0')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xf1'));db[_0x9564('0xf2')]=db['sequelize'][_0x9564('0x14')](_0x9564('0xf3'));db[_0x9564('0xf4')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xf5'));db[_0x9564('0xf6')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xf7'));db[_0x9564('0xf8')]=db[_0x9564('0x2')]['import'](_0x9564('0xf9'));db[_0x9564('0xfa')]=db[_0x9564('0x2')][_0x9564('0x14')]('../api/crmWorkflow/crmWorkflow.model');db['CrmWorkflowStep']=db[_0x9564('0x2')][_0x9564('0x14')]('../api/crmWorkflowstep/crmWorkflowstep.model');db[_0x9564('0xfb')]=db[_0x9564('0x2')][_0x9564('0x14')]('../api/crmTask/crmTask.model');db[_0x9564('0xfc')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0xfd'));db['SATypeProduct']=db[_0x9564('0x2')]['import'](_0x9564('0xfe'));db[_0x9564('0xff')]=db[_0x9564('0x2')]['import'](_0x9564('0x100'));db[_0x9564('0x101')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x102'));db[_0x9564('0x103')]=db['sequelize']['import'](_0x9564('0x104'));db['SASalesCondition']=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x105'));db[_0x9564('0x106')]=db['sequelize'][_0x9564('0x14')](_0x9564('0x107'));db[_0x9564('0x108')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x109'));db['SADossier']=db[_0x9564('0x2')][_0x9564('0x14')]('../api/saDossier/saDossier.model');db[_0x9564('0x10a')]=db[_0x9564('0x2')][_0x9564('0x14')]('../api/saRequest/saRequest.model');db[_0x9564('0x10b')]=db['sequelize']['import'](_0x9564('0x10c'));db['SAProductQuotation']=db[_0x9564('0x2')][_0x9564('0x14')]('../api/saProductQuotation/saProductQuotation.model');db[_0x9564('0x10d')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x10e'));db[_0x9564('0x10f')]=db[_0x9564('0x2')][_0x9564('0x14')]('../api/saProforma/saProforma.model');db[_0x9564('0x110')]=db['sequelize'][_0x9564('0x14')](_0x9564('0x111'));db[_0x9564('0x112')]=db['sequelize'][_0x9564('0x14')]('../api/saAsset/saAsset.model');db[_0x9564('0x113')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x114'));db[_0x9564('0x115')]=db['sequelize']['import'](_0x9564('0x116'));db[_0x9564('0x117')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x118'));db[_0x9564('0x119')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x11a'));db[_0x9564('0x11b')]=db[_0x9564('0x2')][_0x9564('0x14')](_0x9564('0x11c'));db['SACreditNoteDetail']=db[_0x9564('0x2')][_0x9564('0x14')]('../api/saCreditNoteDetail/saCreditNoteDetail.model');db[_0x9564('0x11d')]=db['sequelize'][_0x9564('0x14')](_0x9564('0x11e'));db[_0x9564('0x11f')]=db[_0x9564('0x2')]['import']('../api/saCreditNoteNumber/saCreditNoteNumber.model');db[_0x9564('0x120')]=db['sequelize'][_0x9564('0x14')](_0x9564('0x121'));db[_0x9564('0x122')]=db['sequelize']['import']('../api/saCompanyRelationship/saCompanyRelationship.model');db[_0x9564('0x11')][_0x9564('0x123')](db[_0x9564('0x124')],{'as':'VoiceMail','onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x126')});db['User'][_0x9564('0x127')](db[_0x9564('0x1d')],{'as':'Recordings','foreignKey':_0x9564('0x126')});db['User'][_0x9564('0x127')](db['UserVoiceQueueRt'],{'as':_0x9564('0x128'),'foreignKey':_0x9564('0x126')});db[_0x9564('0x11')]['hasMany'](db[_0x9564('0x17')],{'as':_0x9564('0x129'),'onDelete':_0x9564('0x125'),'hooks':!![]});db[_0x9564('0x11')][_0x9564('0x127')](db[_0x9564('0x72')],{'as':_0x9564('0x12a'),'foreignKey':_0x9564('0x126')});db[_0x9564('0x11')][_0x9564('0x127')](db[_0x9564('0x74')],{'as':'HopperHistory','foreignKey':'UserId'});db[_0x9564('0x11')][_0x9564('0x127')](db[_0x9564('0x76')],{'as':'ReportAgentPreview','foreignKey':_0x9564('0x126')});db[_0x9564('0x11')][_0x9564('0x127')](db['OpenchannelInteraction'],{'as':_0x9564('0x12b'),'foreignKey':_0x9564('0x126')});db[_0x9564('0x11')][_0x9564('0x127')](db[_0x9564('0x65')],{'as':'ChatInteractions','foreignKey':'UserId'});db[_0x9564('0x11')][_0x9564('0x127')](db[_0x9564('0x12c')],{'as':_0x9564('0x12d'),'foreignKey':'UserId'});db[_0x9564('0x11')][_0x9564('0x127')](db[_0x9564('0x12e')],{'as':'FaxInteractions','foreignKey':'UserId'});db[_0x9564('0x11')][_0x9564('0x127')](db[_0x9564('0x12f')],{'as':_0x9564('0x130'),'foreignKey':'UserId'});db['User']['belongsTo'](db['UserProfile'],{'as':'UserProfile','foreignKey':_0x9564('0x131')});db[_0x9564('0x11')][_0x9564('0x132')](db[_0x9564('0x6a')],{'as':_0x9564('0x133'),'through':_0x9564('0x134')});db[_0x9564('0x11')][_0x9564('0x132')](db[_0x9564('0x6e')],{'as':'Contacts','through':_0x9564('0x135')});db['User'][_0x9564('0x132')](db[_0x9564('0xee')],{'as':_0x9564('0x136'),'through':'cm_user_has_lists'});db[_0x9564('0x11')]['belongsToMany'](db['Team'],{'through':_0x9564('0x137')});db[_0x9564('0x11')][_0x9564('0x132')](db[_0x9564('0x12f')],{'as':_0x9564('0x130'),'through':'user_has_mail_interactions'});db[_0x9564('0x11')]['belongsToMany'](db['ChatInteraction'],{'as':_0x9564('0x138'),'through':'user_has_chat_interactions'});db[_0x9564('0x11')][_0x9564('0x132')](db[_0x9564('0x12e')],{'as':_0x9564('0x139'),'through':_0x9564('0x13a')});db[_0x9564('0x11')][_0x9564('0x132')](db[_0x9564('0x12c')],{'as':_0x9564('0x12d'),'through':_0x9564('0x13b')});db[_0x9564('0x11')][_0x9564('0x132')](db[_0x9564('0x5d')],{'as':_0x9564('0x12b'),'through':'user_has_openchannel_interactions'});db[_0x9564('0x11')][_0x9564('0x132')](db[_0x9564('0x1b')],{'as':_0x9564('0x13c'),'through':_0x9564('0x2e'),'required':![]});db['User'][_0x9564('0x132')](db[_0x9564('0x3c')],{'as':_0x9564('0x13d'),'through':_0x9564('0x31'),'required':![]});db['User']['belongsToMany'](db['ChatQueue'],{'as':_0x9564('0x13e'),'through':_0x9564('0x30'),'required':![],'hooks':!![]});db['User']['belongsToMany'](db[_0x9564('0x4f')],{'as':_0x9564('0x13f'),'through':_0x9564('0x32'),'required':![]});db[_0x9564('0x11')]['belongsToMany'](db['SmsQueue'],{'as':_0x9564('0x140'),'through':_0x9564('0x33'),'required':![]});db['User']['belongsToMany'](db[_0x9564('0x141')],{'as':'OpenchannelQueues','through':_0x9564('0x34'),'required':![]});db[_0x9564('0x11')][_0x9564('0x132')](db[_0x9564('0xee')],{'through':_0x9564('0x142')});db[_0x9564('0x11')][_0x9564('0x132')](db[_0x9564('0xf0')],{'as':'VoicePrefixes','through':_0x9564('0x143'),'required':![]});db[_0x9564('0x11')]['belongsToMany'](db['ChatWebsite'],{'as':'ChatWebsites','through':_0x9564('0x144')});db[_0x9564('0x11')][_0x9564('0x132')](db[_0x9564('0x48')],{'as':'FaxAccounts','through':_0x9564('0x145')});db[_0x9564('0x11')]['belongsToMany'](db[_0x9564('0x3a')],{'as':_0x9564('0x146'),'through':_0x9564('0x147')});db['User'][_0x9564('0x132')](db[_0x9564('0x5a')],{'as':_0x9564('0x148'),'through':_0x9564('0x149')});db[_0x9564('0x11')]['belongsToMany'](db[_0x9564('0x53')],{'as':_0x9564('0x14a'),'through':'user_has_sms_accounts'});db[_0x9564('0x11')][_0x9564('0x132')](db[_0x9564('0xda')],{'as':'SquareProjects','through':_0x9564('0x14b')});db['VoiceChanSpy'][_0x9564('0x127')](db['VoiceExtension'],{'as':_0x9564('0x14c'),'onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x14d')});db[_0x9564('0x16')][_0x9564('0x127')](db[_0x9564('0x17')],{'onDelete':'cascade'});db['VoiceExtension'][_0x9564('0x127')](db[_0x9564('0x17')],{'as':_0x9564('0x14e'),'onDelete':_0x9564('0x125')});db['VoiceMusicOnHold'][_0x9564('0x132')](db[_0x9564('0x87')],{'as':_0x9564('0x14f'),'through':_0x9564('0x150')});db[_0x9564('0x1b')][_0x9564('0x127')](db[_0x9564('0x151')],{'as':_0x9564('0x152'),'foreignKey':_0x9564('0x153')});db[_0x9564('0x1b')][_0x9564('0x127')](db[_0x9564('0x6f')],{'as':_0x9564('0x154'),'foreignKey':_0x9564('0x153')});db[_0x9564('0x1b')]['hasMany'](db[_0x9564('0x72')],{'as':_0x9564('0x12a'),'foreignKey':_0x9564('0x153')});db['VoiceQueue'][_0x9564('0x127')](db[_0x9564('0x74')],{'as':_0x9564('0x155'),'foreignKey':_0x9564('0x153')});db[_0x9564('0x1b')][_0x9564('0x127')](db[_0x9564('0x76')],{'as':'ReportAgentPreview','foreignKey':_0x9564('0x153')});db[_0x9564('0x1b')][_0x9564('0x127')](db[_0x9564('0x71')],{'as':_0x9564('0x156'),'foreignKey':_0x9564('0x153')});db[_0x9564('0x1b')][_0x9564('0x127')](db['JscriptySessionReport'],{'as':_0x9564('0x157'),'foreignKey':'VoiceQueueId'});db[_0x9564('0x1b')]['belongsTo'](db[_0x9564('0x2b')],{'as':'Trunk','foreignKey':_0x9564('0x158')});db[_0x9564('0x1b')][_0x9564('0x159')](db[_0x9564('0x2b')],{'as':_0x9564('0x15a'),'foreignKey':_0x9564('0x15b')});db[_0x9564('0x1b')]['belongsTo'](db[_0x9564('0x80')],{'as':_0x9564('0x80'),'foreignKey':_0x9564('0x15c')});db['VoiceQueue'][_0x9564('0x159')](db['Pause'],{'as':_0x9564('0x15d'),'foreignKey':_0x9564('0x15e')});db['VoiceQueue'][_0x9564('0x132')](db[_0x9564('0xee')],{'as':'Lists','through':_0x9564('0x15f')});db[_0x9564('0x1b')][_0x9564('0x132')](db[_0x9564('0x11')],{'as':_0x9564('0x160'),'through':_0x9564('0x2e')});db[_0x9564('0x1b')][_0x9564('0x132')](db[_0x9564('0xdf')],{'as':_0x9564('0x161'),'through':_0x9564('0x162')});db[_0x9564('0x1b')][_0x9564('0x132')](db[_0x9564('0xee')],{'as':_0x9564('0x163'),'through':_0x9564('0x164')});db[_0x9564('0x1d')][_0x9564('0x159')](db['User'],{'as':'User','foreignKey':'UserId'});db[_0x9564('0x1e')][_0x9564('0x159')](db[_0x9564('0x11')],{'as':_0x9564('0x11'),'foreignKey':_0x9564('0x126')});db['VoiceMail'][_0x9564('0x127')](db[_0x9564('0x21')],{'as':_0x9564('0x165'),'onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x166'),'sourceKey':_0x9564('0x167')});db[_0x9564('0x21')][_0x9564('0x159')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0x9564('0x167')});db['VoiceCallReport'][_0x9564('0x127')](db[_0x9564('0x28')],{'as':_0x9564('0x168'),'foreignKey':_0x9564('0x169'),'constraints':![]});db['VoiceCallReport'][_0x9564('0x127')](db['VoiceAgentReport'],{'as':_0x9564('0x16a'),'foreignKey':'uniqueid','constraints':![]});db[_0x9564('0x23')][_0x9564('0x159')](db['User'],{'as':_0x9564('0x11'),'foreignKey':_0x9564('0x126')});db[_0x9564('0x23')]['belongsTo'](db[_0x9564('0x6e')],{'as':_0x9564('0x16b'),'foreignKey':_0x9564('0x16c')});db[_0x9564('0x36')][_0x9564('0x159')](db[_0x9564('0x3a')],{'as':_0x9564('0x3a'),'foreignKey':_0x9564('0x16d')});db[_0x9564('0x38')][_0x9564('0x159')](db[_0x9564('0x3a')],{'as':_0x9564('0x3a'),'foreignKey':_0x9564('0x16d')});db[_0x9564('0x3a')][_0x9564('0x123')](db['MailServerIn'],{'as':'Imap','onDelete':_0x9564('0x125')});db[_0x9564('0x3a')]['hasOne'](db[_0x9564('0x38')],{'as':'Smtp','onDelete':'cascade'});db[_0x9564('0x3a')][_0x9564('0x127')](db[_0x9564('0x16e')],{'as':_0x9564('0x16f'),'foreignKey':_0x9564('0x16d')});db['MailAccount'][_0x9564('0x127')](db['CannedAnswer'],{'as':_0x9564('0x170'),'foreignKey':_0x9564('0x16d')});db[_0x9564('0x3a')][_0x9564('0x127')](db[_0x9564('0x41')],{'as':_0x9564('0x165'),'foreignKey':'MailAccountId'});db[_0x9564('0x3a')][_0x9564('0x127')](db[_0x9564('0x12f')],{'as':_0x9564('0x171')});db['MailAccount'][_0x9564('0x127')](db['MailApplication'],{'as':_0x9564('0x14e')});db[_0x9564('0x3a')]['belongsTo'](db[_0x9564('0xee')],{'as':'List','foreignKey':_0x9564('0x172')});db['MailAccount'][_0x9564('0x159')](db['Template'],{'as':_0x9564('0x89'),'foreignKey':_0x9564('0x173')});db[_0x9564('0x3a')][_0x9564('0x159')](db[_0x9564('0x81')],{'as':_0x9564('0x15d'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x9564('0x3a')][_0x9564('0x132')](db[_0x9564('0x11')],{'as':_0x9564('0x160'),'through':_0x9564('0x147')});db[_0x9564('0x3c')]['belongsToMany'](db[_0x9564('0x11')],{'as':_0x9564('0x160'),'through':_0x9564('0x31')});db['MailQueue']['belongsToMany'](db[_0x9564('0xdf')],{'through':_0x9564('0x174'),'as':_0x9564('0x161')});db['MailInteraction'][_0x9564('0x127')](db[_0x9564('0x41')],{'as':_0x9564('0x165'),'onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x175')});db[_0x9564('0x12f')][_0x9564('0x159')](db[_0x9564('0x3a')],{'as':_0x9564('0x176'),'foreignKey':'MailAccountId'});db[_0x9564('0x12f')][_0x9564('0x159')](db[_0x9564('0x6e')],{'as':_0x9564('0x16b'),'foreignKey':_0x9564('0x16c')});db['MailInteraction'][_0x9564('0x159')](db[_0x9564('0x11')],{'as':_0x9564('0x177'),'foreignKey':'UserId'});db[_0x9564('0x12f')][_0x9564('0x132')](db['Tag'],{'through':_0x9564('0x178'),'as':_0x9564('0x179')});db[_0x9564('0x12f')]['belongsToMany'](db[_0x9564('0x17a')],{'through':_0x9564('0x178'),'as':_0x9564('0x17b')});db[_0x9564('0x12f')][_0x9564('0x132')](db[_0x9564('0x11')],{'as':'Users','through':_0x9564('0x17c'),'foreignKey':'MailInteractionId'});db[_0x9564('0x41')][_0x9564('0x127')](db[_0x9564('0xe3')],{'as':_0x9564('0x17d'),'onDelete':_0x9564('0x125')});db[_0x9564('0x41')]['belongsTo'](db[_0x9564('0x11')],{'as':'User'});db[_0x9564('0x41')][_0x9564('0x159')](db[_0x9564('0x6e')],{'onDelete':_0x9564('0x125'),'as':_0x9564('0x16b')});db[_0x9564('0x41')][_0x9564('0x159')](db['MailInteraction'],{'as':'Interaction','foreignKey':'MailInteractionId'});db['MailMessage'][_0x9564('0x159')](db['MailAccount'],{'as':_0x9564('0x176'),'foreignKey':_0x9564('0x16d')});db[_0x9564('0x17e')][_0x9564('0x159')](db[_0x9564('0x11')],{'onDelete':_0x9564('0x17f')});db[_0x9564('0x17e')]['belongsTo'](db[_0x9564('0x3c')],{'onDelete':_0x9564('0x17f')});db[_0x9564('0x17e')][_0x9564('0x159')](db[_0x9564('0x3a')],{'onDelete':_0x9564('0x17f')});db['MailApplication']['belongsTo'](db[_0x9564('0x80')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x9564('0x17e')][_0x9564('0x159')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x9564('0x180')});db[_0x9564('0x43')][_0x9564('0x159')](db['MailAccount'],{});db[_0x9564('0x43')][_0x9564('0x159')](db['CmList'],{'as':_0x9564('0x181'),'foreignKey':_0x9564('0x172')});db[_0x9564('0x43')]['belongsTo'](db['CmContact'],{'as':_0x9564('0x16b'),'foreignKey':_0x9564('0x16c')});db['MailQueueReport']['belongsTo'](db['MailInteraction'],{});db['MailQueueReport'][_0x9564('0x159')](db[_0x9564('0x41')],{});db[_0x9564('0x43')][_0x9564('0x159')](db['User'],{});db['MailQueueReport'][_0x9564('0x159')](db[_0x9564('0x3c')],{});db[_0x9564('0x45')][_0x9564('0x127')](db[_0x9564('0x47')],{'as':_0x9564('0x182'),'onDelete':_0x9564('0x125')});db[_0x9564('0x48')][_0x9564('0x127')](db[_0x9564('0x16e')],{'as':_0x9564('0x16f'),'foreignKey':'FaxAccountId'});db[_0x9564('0x48')]['hasMany'](db[_0x9564('0x183')],{'as':_0x9564('0x170'),'foreignKey':_0x9564('0x184')});db[_0x9564('0x48')]['hasMany'](db[_0x9564('0x12e')],{'as':_0x9564('0x171')});db['FaxAccount']['hasMany'](db[_0x9564('0x4a')],{'as':_0x9564('0x14e')});db[_0x9564('0x48')][_0x9564('0x127')](db[_0x9564('0x17')],{'as':_0x9564('0x185'),'onDelete':_0x9564('0x125')});db[_0x9564('0x48')][_0x9564('0x127')](db[_0x9564('0x4d')],{'as':'Messages'});db[_0x9564('0x48')]['belongsTo'](db[_0x9564('0x2b')],{'as':'Trunk'});db['FaxAccount'][_0x9564('0x159')](db[_0x9564('0xee')],{'as':_0x9564('0x181'),'foreignKey':_0x9564('0x172')});db['FaxAccount']['belongsTo'](db[_0x9564('0x81')],{'as':_0x9564('0x15d'),'foreignKey':_0x9564('0x15e')});db[_0x9564('0x48')]['belongsToMany'](db[_0x9564('0x11')],{'as':_0x9564('0x160'),'through':'user_has_fax_accounts'});db[_0x9564('0x4a')][_0x9564('0x159')](db['User'],{'onDelete':_0x9564('0x17f')});db[_0x9564('0x4a')][_0x9564('0x159')](db[_0x9564('0x4f')],{'onDelete':_0x9564('0x17f')});db[_0x9564('0x4a')][_0x9564('0x159')](db[_0x9564('0x48')],{'onDelete':_0x9564('0x17f')});db['FaxApplication']['belongsTo'](db[_0x9564('0x17a')],{'onDelete':_0x9564('0x17f'),'foreignKey':_0x9564('0x180')});db['FaxInteraction'][_0x9564('0x127')](db[_0x9564('0x4d')],{'as':_0x9564('0x165'),'onDelete':'cascade','foreignKey':'FaxInteractionId'});db[_0x9564('0x12e')][_0x9564('0x159')](db[_0x9564('0x48')],{'as':_0x9564('0x176'),'foreignKey':'FaxAccountId'});db[_0x9564('0x12e')][_0x9564('0x159')](db[_0x9564('0x6e')],{'as':_0x9564('0x16b'),'foreignKey':_0x9564('0x16c')});db['FaxInteraction'][_0x9564('0x159')](db[_0x9564('0x11')],{'as':_0x9564('0x177'),'foreignKey':'UserId'});db['FaxInteraction']['belongsToMany'](db[_0x9564('0x17a')],{'through':_0x9564('0x186'),'as':_0x9564('0x179')});db[_0x9564('0x12e')]['belongsToMany'](db['Tag'],{'through':_0x9564('0x186'),'as':_0x9564('0x17b')});db[_0x9564('0x12e')][_0x9564('0x132')](db[_0x9564('0x11')],{'as':_0x9564('0x187'),'through':_0x9564('0x13a'),'foreignKey':_0x9564('0x188')});db[_0x9564('0x4d')][_0x9564('0x159')](db[_0x9564('0x11')],{'onDelete':_0x9564('0x125'),'as':'User'});db[_0x9564('0x4d')][_0x9564('0x159')](db[_0x9564('0x12e')],{'as':_0x9564('0x189'),'foreignKey':'FaxInteractionId'});db[_0x9564('0x4d')][_0x9564('0x159')](db[_0x9564('0x6e')],{'onDelete':_0x9564('0x125'),'as':'Contact'});db[_0x9564('0x4d')][_0x9564('0x159')](db[_0x9564('0xe3')],{'as':_0x9564('0xe3'),'foreignKey':_0x9564('0x18a')});db[_0x9564('0x4d')][_0x9564('0x159')](db[_0x9564('0x48')],{'as':_0x9564('0x176'),'foreignKey':_0x9564('0x184')});db[_0x9564('0x4f')][_0x9564('0x132')](db['User'],{'as':'Agents','through':_0x9564('0x32')});db[_0x9564('0x4f')]['belongsToMany'](db[_0x9564('0xdf')],{'through':_0x9564('0x18b'),'as':_0x9564('0x161')});db[_0x9564('0x51')][_0x9564('0x159')](db['FaxAccount'],{});db[_0x9564('0x51')][_0x9564('0x159')](db[_0x9564('0xee')],{'as':_0x9564('0x181'),'foreignKey':'ListId'});db[_0x9564('0x51')][_0x9564('0x159')](db[_0x9564('0x6e')],{'as':'Contact','foreignKey':_0x9564('0x16c')});db[_0x9564('0x51')][_0x9564('0x159')](db[_0x9564('0x12e')],{});db[_0x9564('0x51')][_0x9564('0x159')](db['FaxMessage'],{});db[_0x9564('0x51')][_0x9564('0x159')](db[_0x9564('0x11')],{});db[_0x9564('0x51')][_0x9564('0x159')](db[_0x9564('0x4f')],{});db[_0x9564('0x53')]['hasMany'](db[_0x9564('0x16e')],{'as':'Dispositions','foreignKey':_0x9564('0x18c')});db[_0x9564('0x53')][_0x9564('0x127')](db[_0x9564('0x183')],{'as':_0x9564('0x170'),'foreignKey':_0x9564('0x18c')});db['SmsAccount'][_0x9564('0x127')](db[_0x9564('0x57')],{'as':_0x9564('0x165'),'foreignKey':_0x9564('0x18c')});db[_0x9564('0x53')][_0x9564('0x127')](db[_0x9564('0x12c')],{'as':_0x9564('0x171')});db['SmsAccount'][_0x9564('0x127')](db[_0x9564('0x55')],{'as':_0x9564('0x14e')});db[_0x9564('0x53')][_0x9564('0x159')](db[_0x9564('0xee')],{'as':_0x9564('0x181'),'foreignKey':'ListId'});db[_0x9564('0x53')][_0x9564('0x159')](db['Pause'],{'as':_0x9564('0x15d'),'foreignKey':_0x9564('0x15e')});db[_0x9564('0x53')][_0x9564('0x132')](db[_0x9564('0x11')],{'as':'Agents','through':_0x9564('0x18d')});db['SmsApplication'][_0x9564('0x159')](db[_0x9564('0x11')],{'onDelete':'restrict'});db[_0x9564('0x55')][_0x9564('0x159')](db[_0x9564('0x58')],{'onDelete':_0x9564('0x17f')});db[_0x9564('0x55')][_0x9564('0x159')](db[_0x9564('0x53')],{'onDelete':'restrict'});db[_0x9564('0x55')][_0x9564('0x159')](db['Interval'],{'onDelete':_0x9564('0x17f'),'foreignKey':_0x9564('0x15c')});db[_0x9564('0x55')][_0x9564('0x159')](db[_0x9564('0x17a')],{'onDelete':_0x9564('0x17f'),'foreignKey':_0x9564('0x180')});db[_0x9564('0x12c')][_0x9564('0x127')](db[_0x9564('0x57')],{'as':_0x9564('0x165'),'onDelete':'cascade','foreignKey':_0x9564('0x18e')});db[_0x9564('0x12c')]['belongsTo'](db[_0x9564('0x53')],{'as':_0x9564('0x176'),'foreignKey':_0x9564('0x18c')});db[_0x9564('0x12c')][_0x9564('0x159')](db['CmContact'],{'as':_0x9564('0x16b'),'foreignKey':_0x9564('0x16c')});db[_0x9564('0x12c')][_0x9564('0x159')](db[_0x9564('0x11')],{'as':_0x9564('0x177'),'foreignKey':_0x9564('0x126')});db['SmsInteraction'][_0x9564('0x132')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x9564('0x179')});db[_0x9564('0x12c')]['belongsToMany'](db[_0x9564('0x17a')],{'through':_0x9564('0x18f'),'as':'ThroughTags'});db[_0x9564('0x12c')][_0x9564('0x132')](db[_0x9564('0x11')],{'as':'Users','through':_0x9564('0x13b'),'foreignKey':_0x9564('0x18e')});db[_0x9564('0x57')][_0x9564('0x159')](db[_0x9564('0x11')],{'as':_0x9564('0x11')});db[_0x9564('0x57')][_0x9564('0x159')](db[_0x9564('0x6e')],{'onDelete':'cascade','as':_0x9564('0x16b')});db[_0x9564('0x57')][_0x9564('0x159')](db['SmsInteraction'],{'onDelete':'cascade','as':_0x9564('0x189'),'foreignKey':'SmsInteractionId'});db[_0x9564('0x57')]['belongsTo'](db[_0x9564('0x53')],{'as':_0x9564('0x176'),'foreignKey':'SmsAccountId'});db['SmsQueue'][_0x9564('0x132')](db[_0x9564('0x11')],{'as':'Agents','through':_0x9564('0x33'),'foreignKey':_0x9564('0x190')});db[_0x9564('0x58')][_0x9564('0x132')](db[_0x9564('0xdf')],{'through':_0x9564('0x191'),'as':_0x9564('0x161')});db['OpenchannelAccount'][_0x9564('0x127')](db['Disposition'],{'as':_0x9564('0x16f'),'foreignKey':'OpenchannelAccountId'});db[_0x9564('0x5a')]['hasMany'](db[_0x9564('0x183')],{'as':'Answers','foreignKey':_0x9564('0x192')});db['OpenchannelAccount'][_0x9564('0x127')](db['OpenchannelInteraction'],{'as':'Interactions','foreignKey':_0x9564('0x192')});db[_0x9564('0x5a')][_0x9564('0x127')](db[_0x9564('0x5f')],{'as':_0x9564('0x165'),'foreignKey':_0x9564('0x192')});db['OpenchannelAccount']['hasMany'](db[_0x9564('0x5c')],{'as':_0x9564('0x14e'),'foreignKey':_0x9564('0x192')});db[_0x9564('0x5a')][_0x9564('0x159')](db['CmList'],{'as':_0x9564('0x181'),'foreignKey':_0x9564('0x172')});db[_0x9564('0x5a')]['belongsTo'](db[_0x9564('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0x9564('0x15e')});db[_0x9564('0x5a')][_0x9564('0x132')](db[_0x9564('0x11')],{'as':_0x9564('0x160'),'through':_0x9564('0x149')});db['OpenchannelApplication'][_0x9564('0x159')](db[_0x9564('0x11')],{'onDelete':_0x9564('0x17f')});db[_0x9564('0x5c')][_0x9564('0x159')](db[_0x9564('0x141')],{'onDelete':'restrict','foreignKey':_0x9564('0x193')});db[_0x9564('0x5c')]['belongsTo'](db[_0x9564('0x5a')],{'onDelete':_0x9564('0x17f'),'foreignKey':_0x9564('0x192')});db[_0x9564('0x5c')][_0x9564('0x159')](db['Interval'],{'onDelete':_0x9564('0x17f'),'foreignKey':_0x9564('0x15c')});db[_0x9564('0x5c')][_0x9564('0x159')](db['Tag'],{'onDelete':_0x9564('0x17f'),'foreignKey':_0x9564('0x180')});db[_0x9564('0x5d')][_0x9564('0x127')](db[_0x9564('0x5f')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x9564('0x194')});db[_0x9564('0x5d')][_0x9564('0x159')](db['OpenchannelAccount'],{'as':_0x9564('0x176'),'foreignKey':_0x9564('0x192')});db[_0x9564('0x5d')][_0x9564('0x159')](db[_0x9564('0x6e')],{'as':_0x9564('0x16b'),'foreignKey':_0x9564('0x16c')});db['OpenchannelInteraction'][_0x9564('0x159')](db[_0x9564('0x11')],{'as':'Owner','foreignKey':_0x9564('0x126')});db[_0x9564('0x5d')][_0x9564('0x132')](db[_0x9564('0x17a')],{'through':'openchannel_interaction_has_tags','as':_0x9564('0x179')});db[_0x9564('0x5d')][_0x9564('0x132')](db['Tag'],{'through':_0x9564('0x195'),'as':_0x9564('0x17b')});db[_0x9564('0x5d')][_0x9564('0x132')](db['User'],{'as':_0x9564('0x187'),'through':_0x9564('0x196'),'foreignKey':_0x9564('0x194')});db[_0x9564('0x5f')][_0x9564('0x159')](db['User'],{'onDelete':'cascade','as':_0x9564('0x11')});db[_0x9564('0x5f')][_0x9564('0x159')](db['CmContact'],{'onDelete':_0x9564('0x125'),'as':_0x9564('0x16b')});db['OpenchannelMessage'][_0x9564('0x159')](db[_0x9564('0x5d')],{'onDelete':_0x9564('0x125'),'as':_0x9564('0x189'),'foreignKey':_0x9564('0x194')});db[_0x9564('0x5f')]['belongsTo'](db[_0x9564('0xe3')],{'as':'Attachment','foreignKey':_0x9564('0x18a')});db[_0x9564('0x5f')][_0x9564('0x159')](db[_0x9564('0x5a')],{'as':_0x9564('0x176'),'foreignKey':_0x9564('0x192')});db[_0x9564('0x141')][_0x9564('0x132')](db['User'],{'as':'Agents','through':'UserOpenchannelQueue','foreignKey':_0x9564('0x193')});db[_0x9564('0x141')][_0x9564('0x132')](db[_0x9564('0xdf')],{'through':_0x9564('0x197'),'as':_0x9564('0x161')});db['ChatWebsite']['hasMany'](db[_0x9564('0x16e')],{'as':'Dispositions','foreignKey':'ChatWebsiteId'});db[_0x9564('0x198')][_0x9564('0x127')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x9564('0x199')});db['ChatWebsite'][_0x9564('0x127')](db['ChatProactiveAction'],{'as':_0x9564('0x19a')});db[_0x9564('0x198')]['hasMany'](db[_0x9564('0x65')],{'as':_0x9564('0x171')});db[_0x9564('0x198')]['hasMany'](db[_0x9564('0x63')],{'as':_0x9564('0x14e')});db['ChatWebsite']['hasMany'](db[_0x9564('0x19b')],{'as':_0x9564('0x165')});db[_0x9564('0x198')][_0x9564('0x159')](db['CmList'],{'as':'List','foreignKey':_0x9564('0x172')});db[_0x9564('0x198')][_0x9564('0x159')](db[_0x9564('0x80')],{'as':'Interval','foreignKey':_0x9564('0x15c')});db['ChatWebsite'][_0x9564('0x159')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x9564('0x15e')});db[_0x9564('0x198')][_0x9564('0x132')](db[_0x9564('0x11')],{'as':'Agents','through':'user_has_chat_websites'});db['OpenchannelQueueReport']['belongsTo'](db[_0x9564('0x5a')],{});db[_0x9564('0x62')][_0x9564('0x159')](db[_0x9564('0xee')],{'as':_0x9564('0x181'),'foreignKey':_0x9564('0x172')});db[_0x9564('0x62')][_0x9564('0x159')](db[_0x9564('0x6e')],{'as':_0x9564('0x16b'),'foreignKey':_0x9564('0x16c')});db[_0x9564('0x62')][_0x9564('0x159')](db[_0x9564('0x5d')],{});db['OpenchannelQueueReport'][_0x9564('0x159')](db[_0x9564('0x5f')],{});db[_0x9564('0x62')][_0x9564('0x159')](db['User'],{});db['OpenchannelQueueReport'][_0x9564('0x159')](db[_0x9564('0x141')],{});db['ChatApplication']['belongsTo'](db[_0x9564('0x11')],{'as':'Agent','foreignKey':_0x9564('0x126'),'onDelete':'restrict'});db[_0x9564('0x63')][_0x9564('0x159')](db[_0x9564('0x19c')],{'as':_0x9564('0x19d'),'foreignKey':'ChatQueueId','onDelete':'restrict'});db[_0x9564('0x63')][_0x9564('0x159')](db['ChatWebsite'],{'as':_0x9564('0x19e'),'foreignKey':_0x9564('0x199'),'onDelete':_0x9564('0x17f')});db['ChatApplication'][_0x9564('0x159')](db['Tag'],{'onDelete':_0x9564('0x17f'),'foreignKey':_0x9564('0x180')});db[_0x9564('0x65')][_0x9564('0x127')](db[_0x9564('0x19b')],{'as':'Messages','onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x19f')});db[_0x9564('0x65')][_0x9564('0x159')](db[_0x9564('0x198')],{'as':_0x9564('0x176'),'foreignKey':_0x9564('0x199')});db['ChatInteraction'][_0x9564('0x159')](db['CmContact'],{'as':_0x9564('0x16b'),'foreignKey':_0x9564('0x16c')});db[_0x9564('0x65')][_0x9564('0x159')](db[_0x9564('0x11')],{'as':_0x9564('0x177'),'foreignKey':_0x9564('0x126')});db['ChatInteraction'][_0x9564('0x132')](db['Tag'],{'through':_0x9564('0x1a0'),'as':_0x9564('0x179')});db['ChatInteraction'][_0x9564('0x132')](db[_0x9564('0x17a')],{'through':_0x9564('0x1a0'),'as':_0x9564('0x17b')});db[_0x9564('0x65')][_0x9564('0x132')](db[_0x9564('0x11')],{'as':'Users','through':_0x9564('0x1a1'),'foreignKey':_0x9564('0x19f')});db['ChatMessage'][_0x9564('0x159')](db[_0x9564('0x11')],{'onDelete':_0x9564('0x125'),'as':'User'});db['ChatMessage'][_0x9564('0x159')](db[_0x9564('0x6e')],{'onDelete':_0x9564('0x125'),'as':_0x9564('0x16b'),'foreignKey':'ContactId'});db[_0x9564('0x19b')][_0x9564('0x159')](db[_0x9564('0x65')],{'onDelete':_0x9564('0x125'),'as':_0x9564('0x189'),'foreignKey':'ChatInteractionId'});db[_0x9564('0x19b')][_0x9564('0x159')](db[_0x9564('0xe3')],{'as':_0x9564('0xe3'),'foreignKey':'AttachmentId'});db[_0x9564('0x19b')][_0x9564('0x159')](db[_0x9564('0x198')],{'as':_0x9564('0x176'),'foreignKey':_0x9564('0x199')});db[_0x9564('0x67')][_0x9564('0x159')](db[_0x9564('0x6e')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x9564('0x16c')});db[_0x9564('0x67')][_0x9564('0x159')](db[_0x9564('0x198')],{'as':_0x9564('0x176'),'foreignKey':_0x9564('0x199')});db[_0x9564('0x19c')][_0x9564('0x132')](db[_0x9564('0x11')],{'as':_0x9564('0x160'),'through':'UserChatQueue','hooks':!![]});db[_0x9564('0x19c')][_0x9564('0x132')](db[_0x9564('0xdf')],{'through':_0x9564('0x1a2'),'as':'Teams'});db[_0x9564('0x6a')][_0x9564('0x127')](db['ChatInternalMessage'],{'as':'Messages','foreignKey':_0x9564('0x1a3'),'onDelete':_0x9564('0x125')});db[_0x9564('0x6a')][_0x9564('0x132')](db['User'],{'as':'Members','through':'chat_group_has_users'});db['ChatProactiveAction'][_0x9564('0x159')](db[_0x9564('0x198')],{'as':_0x9564('0x19e'),'foreignKey':_0x9564('0x199')});db[_0x9564('0x1a4')][_0x9564('0x123')](db[_0x9564('0x1a4')],{'as':_0x9564('0x1a5')});db[_0x9564('0x1a4')]['hasMany'](db['CmContact'],{'as':_0x9564('0x1a6'),'foreignKey':_0x9564('0x1a7')});db[_0x9564('0x1a4')]['hasMany'](db[_0x9564('0x106')],{'as':_0x9564('0x1a8'),'foreignKey':_0x9564('0x1a7')});db[_0x9564('0x1a4')][_0x9564('0x127')](db['SADossier'],{'as':_0x9564('0x1a9'),'foreignKey':_0x9564('0x1a7')});db[_0x9564('0x1a4')]['belongsTo'](db[_0x9564('0x119')],{'as':_0x9564('0x1aa'),'foreignKey':_0x9564('0x1ab')});db[_0x9564('0x6e')][_0x9564('0x127')](db[_0x9564('0x6f')],{'as':_0x9564('0x154'),'foreignKey':_0x9564('0x16c')});db[_0x9564('0x6e')][_0x9564('0x127')](db[_0x9564('0x72')],{'as':_0x9564('0x12a'),'foreignKey':_0x9564('0x16c')});db[_0x9564('0x6e')][_0x9564('0x127')](db[_0x9564('0x74')],{'as':_0x9564('0x155'),'foreignKey':_0x9564('0x16c')});db['CmContact']['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x9564('0x16c')});db[_0x9564('0x6e')]['hasMany'](db[_0x9564('0xce')],{'as':_0x9564('0x157'),'foreignKey':_0x9564('0x16c')});db[_0x9564('0x6e')][_0x9564('0x127')](db[_0x9564('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0x9564('0x6e')][_0x9564('0x127')](db[_0x9564('0x65')],{'as':'ChatInteractions','foreignKey':_0x9564('0x16c'),'onDelete':_0x9564('0x17f')});db['CmContact']['hasMany'](db[_0x9564('0x12c')],{'as':_0x9564('0x12d'),'foreignKey':_0x9564('0x16c'),'onDelete':'restrict'});db[_0x9564('0x6e')][_0x9564('0x127')](db['FaxInteraction'],{'as':_0x9564('0x139'),'foreignKey':_0x9564('0x16c'),'onDelete':'restrict'});db[_0x9564('0x6e')][_0x9564('0x127')](db['MailInteraction'],{'as':_0x9564('0x130'),'foreignKey':'ContactId','onDelete':_0x9564('0x17f')});db[_0x9564('0x6e')][_0x9564('0x127')](db['SADossier'],{'as':_0x9564('0x16b'),'foreignKey':_0x9564('0x16c'),'onDelete':'restrict'});db[_0x9564('0x6e')][_0x9564('0x159')](db[_0x9564('0x1a4')],{'as':_0x9564('0x1ac'),'foreignKey':'CompanyId'});db[_0x9564('0x6e')]['belongsTo'](db[_0x9564('0xee')],{'as':_0x9564('0x181'),'foreignKey':_0x9564('0x172'),'onDelete':_0x9564('0x125')});db[_0x9564('0x6e')][_0x9564('0x132')](db[_0x9564('0x11')],{'as':_0x9564('0x187'),'through':_0x9564('0x135')});db[_0x9564('0x6e')][_0x9564('0x132')](db[_0x9564('0x17a')],{'as':_0x9564('0x179'),'through':_0x9564('0x1ad')});db['CmContact']['belongsToMany'](db['Tag'],{'through':_0x9564('0x1ad'),'as':_0x9564('0x17b')});db[_0x9564('0x6f')][_0x9564('0x159')](db['CmContact'],{'as':_0x9564('0x16b'),'foreignKey':_0x9564('0x16c'),'onDelete':_0x9564('0x125')});db['CmHopper'][_0x9564('0x159')](db['CmList'],{'as':_0x9564('0x181'),'foreignKey':_0x9564('0x172'),'onDelete':_0x9564('0x125')});db[_0x9564('0x6f')][_0x9564('0x159')](db[_0x9564('0x11')],{'as':_0x9564('0x1ae'),'foreignKey':_0x9564('0x126')});db['CmHopper']['belongsTo'](db[_0x9564('0x1b')],{'as':_0x9564('0x19d'),'foreignKey':_0x9564('0x153'),'onDelete':'cascade'});db[_0x9564('0x6f')][_0x9564('0x159')](db['Campaign'],{'as':_0x9564('0xe2'),'foreignKey':_0x9564('0x1af'),'onDelete':_0x9564('0x125')});db[_0x9564('0x6f')][_0x9564('0x159')](db[_0x9564('0x11')],{'as':_0x9564('0x177'),'foreignKey':_0x9564('0x1b0')});db[_0x9564('0x71')][_0x9564('0x159')](db[_0x9564('0x6e')],{'as':_0x9564('0x16b'),'foreignKey':'ContactId','onDelete':_0x9564('0x125')});db[_0x9564('0x71')][_0x9564('0x159')](db['CmList'],{'as':_0x9564('0x181'),'foreignKey':_0x9564('0x172'),'onDelete':_0x9564('0x125')});db['CmHopperBlack'][_0x9564('0x159')](db[_0x9564('0x1b')],{'as':_0x9564('0x19d'),'foreignKey':_0x9564('0x153'),'onDelete':_0x9564('0x125')});db[_0x9564('0x71')][_0x9564('0x159')](db['Campaign'],{'as':_0x9564('0xe2'),'foreignKey':_0x9564('0x1af'),'onDelete':_0x9564('0x125')});db['Automation'][_0x9564('0x127')](db[_0x9564('0x7e')],{'as':{'plural':_0x9564('0x1b1'),'singular':_0x9564('0x1b2')},'foreignKey':_0x9564('0x1b3'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0x9564('0x127')](db['Condition'],{'as':{'plural':_0x9564('0x1b4'),'singular':_0x9564('0x1b5')},'foreignKey':'AutomationAnyId','onDelete':_0x9564('0x125'),'hooks':!![]});db[_0x9564('0x7b')][_0x9564('0x127')](db['Action'],{'as':_0x9564('0x1b6'),'foreignKey':_0x9564('0x1b7'),'onDelete':'cascade','hooks':!![]});db[_0x9564('0x80')][_0x9564('0x127')](db[_0x9564('0x80')],{'as':_0x9564('0x1b8'),'foreignKey':_0x9564('0x15c'),'onDelete':_0x9564('0x125'),'hooks':!![],'required':![]});db['Interval'][_0x9564('0x127')](db[_0x9564('0x17')],{'as':_0x9564('0x129'),'foreignKey':_0x9564('0x15c'),'onDelete':'restrict'});db[_0x9564('0x80')][_0x9564('0x127')](db[_0x9564('0x17e')],{'as':_0x9564('0x1b9'),'foreignKey':_0x9564('0x15c')});db[_0x9564('0x80')]['hasMany'](db['ChatApplication'],{'as':_0x9564('0x1ba'),'foreignKey':_0x9564('0x15c')});db[_0x9564('0x80')][_0x9564('0x127')](db[_0x9564('0x4a')],{'as':'FaxApplications','foreignKey':_0x9564('0x15c')});db[_0x9564('0x80')]['hasMany'](db[_0x9564('0x55')],{'as':_0x9564('0x1bb'),'foreignKey':_0x9564('0x15c')});db[_0x9564('0x85')][_0x9564('0x159')](db['MailAccount'],{});db[_0x9564('0x85')][_0x9564('0x159')](db[_0x9564('0x93')],{'foreignKey':'DefaultReportId'});db[_0x9564('0x85')]['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x9564('0x1bc')});db[_0x9564('0x87')]['belongsToMany'](db[_0x9564('0x19')],{'as':'Mohs','through':_0x9564('0x150'),'onDelete':'restrict'});db[_0x9564('0x17a')][_0x9564('0x132')](db['CmContact'],{'through':_0x9564('0x1ad')});db[_0x9564('0x17a')]['belongsToMany'](db[_0x9564('0x65')],{'through':'chat_interaction_has_tags'});db[_0x9564('0x17a')][_0x9564('0x132')](db['MailInteraction'],{'through':_0x9564('0x178')});db[_0x9564('0x17a')][_0x9564('0x132')](db[_0x9564('0x12c')],{'through':'sms_interaction_has_tags'});db[_0x9564('0x17a')][_0x9564('0x132')](db[_0x9564('0x12e')],{'through':_0x9564('0x186')});db[_0x9564('0x17a')][_0x9564('0x132')](db[_0x9564('0x5d')],{'through':_0x9564('0x195')});db['Trigger'][_0x9564('0x127')](db[_0x9564('0x7e')],{'as':{'plural':_0x9564('0x1bd'),'singular':_0x9564('0x1be')},'foreignKey':_0x9564('0x1bf'),'onDelete':_0x9564('0x125'),'hooks':!![]});db['Trigger'][_0x9564('0x127')](db[_0x9564('0x7e')],{'as':{'plural':_0x9564('0x1c0'),'singular':_0x9564('0x1c1')},'foreignKey':_0x9564('0x1c2'),'onDelete':_0x9564('0x125'),'hooks':!![]});db[_0x9564('0x8b')]['hasMany'](db[_0x9564('0x1c3')],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0x9564('0x125'),'hooks':!![]});db[_0x9564('0x1c4')][_0x9564('0x127')](db[_0x9564('0x97')],{'as':_0x9564('0x1c5'),'onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1bc'),'hooks':!![]});db['AnalyticDefaultReport'][_0x9564('0x127')](db[_0x9564('0x97')],{'as':_0x9564('0x1c5'),'onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1c6')});db[_0x9564('0x96')][_0x9564('0x127')](db[_0x9564('0x97')],{'as':_0x9564('0x1c5'),'onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1c7')});db[_0x9564('0x97')][_0x9564('0x159')](db[_0x9564('0x96')],{'foreignKey':_0x9564('0x1c7')});db[_0x9564('0x99')][_0x9564('0x127')](db[_0x9564('0x9b')],{'as':_0x9564('0x1c8'),'onDelete':_0x9564('0x125'),'foreignKey':'AccountId'});db['SalesforceConfiguration']['hasMany'](db['SalesforceField'],{'as':_0x9564('0x1c9'),'onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1ca')});db[_0x9564('0x9b')][_0x9564('0x127')](db[_0x9564('0x1cb')],{'as':_0x9564('0x1cc'),'onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1cd')});db['SalesforceConfiguration'][_0x9564('0x127')](db[_0x9564('0x1cb')],{'as':_0x9564('0x1c5'),'onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1ce')});db[_0x9564('0x9b')][_0x9564('0x159')](db['SalesforceAccount'],{'as':_0x9564('0x176'),'foreignKey':'AccountId'});db[_0x9564('0x1cb')][_0x9564('0x127')](db[_0x9564('0x1cb')],{'as':'Subject','foreignKey':_0x9564('0x1ca')});db[_0x9564('0x1cb')][_0x9564('0x127')](db['SalesforceField'],{'as':_0x9564('0x1cf'),'foreignKey':'DescriptionId'});db[_0x9564('0x1cb')][_0x9564('0x127')](db[_0x9564('0x1cb')],{'as':_0x9564('0x1d0'),'foreignKey':_0x9564('0x1ce')});db[_0x9564('0x1cb')][_0x9564('0x159')](db[_0x9564('0x8d')],{'as':'Variable','foreignKey':_0x9564('0x1d1')});db[_0x9564('0x9d')][_0x9564('0x127')](db[_0x9564('0x9f')],{'as':'Configurations','onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1d2')});db[_0x9564('0x9f')][_0x9564('0x127')](db[_0x9564('0xa1')],{'as':_0x9564('0x1c9'),'onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1ca')});db[_0x9564('0x9f')][_0x9564('0x127')](db[_0x9564('0xa1')],{'as':_0x9564('0x1cc'),'onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1cd')});db['SugarcrmConfiguration'][_0x9564('0x127')](db[_0x9564('0xa1')],{'as':'Fields','onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1ce')});db[_0x9564('0x9f')][_0x9564('0x159')](db[_0x9564('0x9d')],{'as':_0x9564('0x176'),'foreignKey':_0x9564('0x1d2')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x9564('0x1d3'),'foreignKey':_0x9564('0x1ca')});db[_0x9564('0xa1')][_0x9564('0x127')](db[_0x9564('0xa1')],{'as':'Description','foreignKey':_0x9564('0x1cd')});db['SugarcrmField'][_0x9564('0x127')](db['SugarcrmField'],{'as':_0x9564('0x1d0'),'foreignKey':_0x9564('0x1ce')});db[_0x9564('0xa1')][_0x9564('0x159')](db['Variable'],{'as':'Variable','foreignKey':_0x9564('0x1d1')});db[_0x9564('0xa3')][_0x9564('0x127')](db['DeskConfiguration'],{'as':'Configurations','onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1d2')});db['DeskConfiguration'][_0x9564('0x127')](db[_0x9564('0xa7')],{'as':_0x9564('0x1c9'),'onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1ca')});db['DeskConfiguration'][_0x9564('0x127')](db[_0x9564('0xa7')],{'as':_0x9564('0x1cc'),'onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1cd')});db['DeskConfiguration'][_0x9564('0x127')](db[_0x9564('0xa7')],{'as':_0x9564('0x1c5'),'onDelete':'cascade','foreignKey':'FieldId'});db['DeskConfiguration']['belongsTo'](db[_0x9564('0xa3')],{'as':'Account','foreignKey':_0x9564('0x1d2')});db['DeskConfiguration'][_0x9564('0x132')](db[_0x9564('0x17a')],{'through':_0x9564('0x1d4')});db[_0x9564('0xa7')][_0x9564('0x127')](db['DeskField'],{'as':_0x9564('0x1d3'),'foreignKey':_0x9564('0x1ca')});db[_0x9564('0xa7')][_0x9564('0x127')](db['DeskField'],{'as':_0x9564('0x1cf'),'foreignKey':_0x9564('0x1cd')});db[_0x9564('0xa7')]['hasMany'](db[_0x9564('0xa7')],{'as':_0x9564('0x1d0'),'foreignKey':_0x9564('0x1ce')});db[_0x9564('0xa7')][_0x9564('0x159')](db['Variable'],{'as':'Variable','foreignKey':_0x9564('0x1d1')});db[_0x9564('0x1d5')][_0x9564('0x127')](db[_0x9564('0xa9')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x9564('0x1d2')});db['ZohoConfiguration'][_0x9564('0x127')](db[_0x9564('0xab')],{'as':'Subjects','onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1ca')});db[_0x9564('0xa9')][_0x9564('0x127')](db[_0x9564('0xab')],{'as':_0x9564('0x1cc'),'onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1cd')});db['ZohoConfiguration']['hasMany'](db[_0x9564('0xab')],{'as':'Fields','onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1ce')});db[_0x9564('0xa9')]['belongsTo'](db['ZohoAccount'],{'as':_0x9564('0x176'),'foreignKey':_0x9564('0x1d2')});db[_0x9564('0xab')][_0x9564('0x127')](db[_0x9564('0xab')],{'as':_0x9564('0x1d3'),'foreignKey':'SubjectId'});db['ZohoField'][_0x9564('0x127')](db['ZohoField'],{'as':_0x9564('0x1cf'),'foreignKey':'DescriptionId'});db[_0x9564('0xab')]['hasMany'](db[_0x9564('0xab')],{'as':_0x9564('0x1d0'),'foreignKey':_0x9564('0x1ce')});db[_0x9564('0xab')]['belongsTo'](db[_0x9564('0x8d')],{'as':'Variable','foreignKey':_0x9564('0x1d1')});db['ZendeskAccount'][_0x9564('0x127')](db[_0x9564('0xae')],{'as':_0x9564('0x1c8'),'onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1d2')});db[_0x9564('0xae')]['hasMany'](db['ZendeskField'],{'as':_0x9564('0x1c9'),'foreignKey':_0x9564('0x1ca')});db[_0x9564('0xae')]['hasMany'](db[_0x9564('0x1d6')],{'as':_0x9564('0x1cc'),'foreignKey':_0x9564('0x1cd')});db[_0x9564('0xae')][_0x9564('0x127')](db[_0x9564('0x1d6')],{'as':_0x9564('0x1c5'),'foreignKey':_0x9564('0x1ce')});db[_0x9564('0xae')][_0x9564('0x159')](db[_0x9564('0xad')],{'as':_0x9564('0x176'),'foreignKey':_0x9564('0x1d2')});db['ZendeskConfiguration'][_0x9564('0x132')](db[_0x9564('0x17a')],{'through':_0x9564('0x1d7')});db[_0x9564('0x1d6')][_0x9564('0x127')](db[_0x9564('0x1d6')],{'as':_0x9564('0x1d3'),'foreignKey':'SubjectId'});db[_0x9564('0x1d6')][_0x9564('0x127')](db[_0x9564('0x1d6')],{'as':'Description','foreignKey':_0x9564('0x1cd')});db[_0x9564('0x1d6')]['hasMany'](db['ZendeskField'],{'as':_0x9564('0x1d0'),'foreignKey':_0x9564('0x1ce')});db['ZendeskField'][_0x9564('0x159')](db[_0x9564('0x8d')],{'as':'Variable','foreignKey':'VariableId'});db[_0x9564('0xb1')][_0x9564('0x127')](db[_0x9564('0xb3')],{'as':_0x9564('0x1c8'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x9564('0xb3')][_0x9564('0x127')](db[_0x9564('0x1d8')],{'as':_0x9564('0x1c9'),'onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1ca')});db['FreshdeskConfiguration'][_0x9564('0x127')](db[_0x9564('0x1d8')],{'as':'Descriptions','onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1cd')});db[_0x9564('0xb3')]['hasMany'](db['FreshdeskField'],{'as':_0x9564('0x1c5'),'onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1ce')});db[_0x9564('0xb3')][_0x9564('0x159')](db[_0x9564('0xb1')],{'as':_0x9564('0x176'),'foreignKey':_0x9564('0x1d2')});db[_0x9564('0xb3')]['belongsToMany'](db[_0x9564('0x17a')],{'through':_0x9564('0x1d9')});db[_0x9564('0x1d8')][_0x9564('0x127')](db[_0x9564('0x1d8')],{'as':_0x9564('0x1d3'),'foreignKey':_0x9564('0x1ca')});db[_0x9564('0x1d8')][_0x9564('0x127')](db[_0x9564('0x1d8')],{'as':'Description','foreignKey':_0x9564('0x1cd')});db['FreshdeskField']['hasMany'](db['FreshdeskField'],{'as':_0x9564('0x1d0'),'foreignKey':_0x9564('0x1ce')});db[_0x9564('0x1d8')][_0x9564('0x159')](db[_0x9564('0x8d')],{'as':_0x9564('0x8d'),'foreignKey':_0x9564('0x1d1')});db['VtigerAccount']['hasMany'](db[_0x9564('0xb7')],{'as':_0x9564('0x1c8'),'onDelete':'cascade','foreignKey':_0x9564('0x1d2')});db[_0x9564('0xb7')][_0x9564('0x127')](db[_0x9564('0x1da')],{'as':_0x9564('0x1c9'),'foreignKey':_0x9564('0x1ca')});db['VtigerConfiguration'][_0x9564('0x127')](db['VtigerField'],{'as':_0x9564('0x1cc'),'foreignKey':_0x9564('0x1cd')});db['VtigerConfiguration'][_0x9564('0x127')](db[_0x9564('0x1da')],{'as':_0x9564('0x1c5'),'foreignKey':_0x9564('0x1ce')});db['VtigerConfiguration']['belongsTo'](db[_0x9564('0x1db')],{'as':_0x9564('0x176'),'foreignKey':_0x9564('0x1d2')});db[_0x9564('0xb7')][_0x9564('0x132')](db[_0x9564('0x17a')],{'through':_0x9564('0x1dc')});db[_0x9564('0x1da')][_0x9564('0x127')](db[_0x9564('0x1da')],{'as':_0x9564('0x1d3'),'foreignKey':_0x9564('0x1ca')});db[_0x9564('0x1da')][_0x9564('0x127')](db[_0x9564('0x1da')],{'as':_0x9564('0x1cf'),'foreignKey':'DescriptionId'});db['VtigerField'][_0x9564('0x127')](db[_0x9564('0x1da')],{'as':_0x9564('0x1d0'),'foreignKey':_0x9564('0x1ce')});db[_0x9564('0x1da')][_0x9564('0x159')](db[_0x9564('0x8d')],{'as':_0x9564('0x8d'),'foreignKey':_0x9564('0x1d1')});db[_0x9564('0xba')][_0x9564('0x127')](db[_0x9564('0xbc')],{'as':_0x9564('0x1c8'),'onDelete':_0x9564('0x125'),'foreignKey':'AccountId'});db[_0x9564('0xbc')][_0x9564('0x127')](db['ServicenowField'],{'as':_0x9564('0x1c9'),'foreignKey':_0x9564('0x1ca')});db['ServicenowConfiguration'][_0x9564('0x127')](db[_0x9564('0xbe')],{'as':_0x9564('0x1cc'),'foreignKey':_0x9564('0x1cd')});db[_0x9564('0xbc')][_0x9564('0x127')](db[_0x9564('0xbe')],{'as':_0x9564('0x1c5'),'foreignKey':'FieldId'});db[_0x9564('0xbc')]['belongsTo'](db[_0x9564('0xba')],{'as':_0x9564('0x176'),'foreignKey':'AccountId'});db['ServicenowField'][_0x9564('0x127')](db[_0x9564('0xbe')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x9564('0xbe')]['hasMany'](db['ServicenowField'],{'as':_0x9564('0x1cf'),'foreignKey':_0x9564('0x1cd')});db['ServicenowField'][_0x9564('0x127')](db[_0x9564('0xbe')],{'as':'Field','foreignKey':_0x9564('0x1ce')});db[_0x9564('0xbe')]['belongsTo'](db[_0x9564('0x8d')],{'as':_0x9564('0x8d'),'foreignKey':_0x9564('0x1d1')});db['Dynamics365Account'][_0x9564('0x127')](db[_0x9564('0xc0')],{'as':_0x9564('0x1c8'),'onDelete':'cascade','foreignKey':_0x9564('0x1d2')});db[_0x9564('0xc0')]['hasMany'](db[_0x9564('0xc2')],{'as':_0x9564('0x1c9'),'onDelete':'cascade','foreignKey':_0x9564('0x1ca')});db['Dynamics365Configuration'][_0x9564('0x127')](db[_0x9564('0xc2')],{'as':_0x9564('0x1cc'),'onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1cd')});db[_0x9564('0xc0')][_0x9564('0x127')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1ce')});db[_0x9564('0xc0')][_0x9564('0x159')](db[_0x9564('0xbf')],{'as':_0x9564('0x176'),'foreignKey':'AccountId'});db[_0x9564('0xc2')]['hasMany'](db[_0x9564('0xc2')],{'as':_0x9564('0x1d3'),'foreignKey':_0x9564('0x1ca')});db['Dynamics365Field']['hasMany'](db[_0x9564('0xc2')],{'as':'Description','foreignKey':_0x9564('0x1cd')});db[_0x9564('0xc2')]['hasMany'](db[_0x9564('0xc2')],{'as':_0x9564('0x1d0'),'foreignKey':_0x9564('0x1ce')});db[_0x9564('0xc2')][_0x9564('0x159')](db['Variable'],{'as':'Variable','foreignKey':_0x9564('0x1d1')});db[_0x9564('0xc6')][_0x9564('0x159')](db[_0x9564('0x198')],{});db['ChatQueueReport'][_0x9564('0x159')](db[_0x9564('0xee')],{'as':_0x9564('0x181'),'foreignKey':_0x9564('0x172')});db[_0x9564('0xc6')][_0x9564('0x159')](db['CmContact'],{'as':_0x9564('0x16b'),'foreignKey':_0x9564('0x16c')});db[_0x9564('0xc6')][_0x9564('0x159')](db[_0x9564('0x65')],{});db[_0x9564('0xc6')]['belongsTo'](db['ChatMessage'],{});db[_0x9564('0xc6')][_0x9564('0x159')](db[_0x9564('0x11')],{});db[_0x9564('0xc6')][_0x9564('0x159')](db['ChatQueue'],{});db[_0x9564('0xc8')]['belongsTo'](db['User'],{'onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1dd')});db[_0x9564('0xc8')][_0x9564('0x159')](db['User'],{'onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x1de')});db['JscriptySessionReport'][_0x9564('0x127')](db[_0x9564('0xcc')],{'foreignKey':_0x9564('0x1df'),'onDelete':'cascade'});db[_0x9564('0xce')][_0x9564('0x127')](db[_0x9564('0xca')],{'foreignKey':_0x9564('0x1df'),'onDelete':_0x9564('0x125')});db[_0x9564('0x1e0')][_0x9564('0x159')](db['SmsAccount'],{});db[_0x9564('0x1e0')][_0x9564('0x159')](db[_0x9564('0xee')],{'as':_0x9564('0x181'),'foreignKey':'ListId'});db[_0x9564('0x1e0')][_0x9564('0x159')](db[_0x9564('0x6e')],{'as':_0x9564('0x16b'),'foreignKey':_0x9564('0x16c')});db[_0x9564('0x1e0')][_0x9564('0x159')](db[_0x9564('0x12c')],{});db[_0x9564('0x1e0')][_0x9564('0x159')](db['SmsMessage'],{});db[_0x9564('0x1e0')]['belongsTo'](db[_0x9564('0x11')],{});db[_0x9564('0x1e0')][_0x9564('0x159')](db[_0x9564('0x58')],{});db[_0x9564('0xd4')]['hasMany'](db['JscriptySessionReport'],{'foreignKey':_0x9564('0x1e1')});db[_0x9564('0xd4')]['hasMany'](db[_0x9564('0xcc')],{'foreignKey':_0x9564('0x1e1')});db['JscriptyProject'][_0x9564('0x127')](db[_0x9564('0xca')],{'foreignKey':_0x9564('0x1e1')});db[_0x9564('0xda')]['belongsToMany'](db[_0x9564('0x11')],{'as':'Users','through':_0x9564('0x14b')});db['Team'][_0x9564('0x132')](db[_0x9564('0x11')],{'as':_0x9564('0x160'),'through':'user_has_teams'});db[_0x9564('0xdf')][_0x9564('0x132')](db[_0x9564('0x1b')],{'through':_0x9564('0x162'),'as':_0x9564('0x13c')});db[_0x9564('0xdf')][_0x9564('0x132')](db[_0x9564('0x3c')],{'through':_0x9564('0x174'),'as':_0x9564('0x13d')});db[_0x9564('0xdf')][_0x9564('0x132')](db[_0x9564('0x19c')],{'through':_0x9564('0x1a2'),'as':'ChatQueues'});db[_0x9564('0xdf')][_0x9564('0x132')](db['FaxQueue'],{'through':_0x9564('0x18b'),'as':_0x9564('0x13f')});db[_0x9564('0xdf')]['belongsToMany'](db['SmsQueue'],{'through':_0x9564('0x191'),'as':'SmsQueues'});db[_0x9564('0xdf')][_0x9564('0x132')](db[_0x9564('0x141')],{'through':_0x9564('0x197'),'as':_0x9564('0x1e2')});db[_0x9564('0xe2')][_0x9564('0x127')](db[_0x9564('0x6f')],{'as':_0x9564('0x154'),'foreignKey':_0x9564('0x1af')});db[_0x9564('0xe2')]['hasMany'](db[_0x9564('0x72')],{'as':_0x9564('0x12a'),'foreignKey':_0x9564('0x1af')});db['Campaign'][_0x9564('0x127')](db[_0x9564('0x74')],{'as':'HopperHistories','foreignKey':_0x9564('0x1af')});db[_0x9564('0xe2')][_0x9564('0x127')](db[_0x9564('0x71')],{'as':_0x9564('0x156'),'foreignKey':_0x9564('0x1af')});db['Campaign'][_0x9564('0x159')](db['Trunk'],{'as':_0x9564('0x2b'),'foreignKey':'TrunkId'});db[_0x9564('0xe2')]['belongsTo'](db[_0x9564('0x2b')],{'as':'TrunkBackup','foreignKey':_0x9564('0x15b')});db[_0x9564('0xe2')][_0x9564('0x159')](db[_0x9564('0x80')],{'as':_0x9564('0x80'),'foreignKey':_0x9564('0x15c')});db[_0x9564('0xe2')][_0x9564('0x159')](db[_0x9564('0xda')],{'as':'SquareProject','foreignKey':'SquareProjectId'});db['Campaign'][_0x9564('0x132')](db['CmList'],{'as':_0x9564('0x136'),'through':_0x9564('0x1e3')});db[_0x9564('0xe2')]['belongsToMany'](db[_0x9564('0xee')],{'as':_0x9564('0x163'),'through':_0x9564('0x1e4')});db[_0x9564('0xe6')][_0x9564('0x159')](db[_0x9564('0x41')],{});db[_0x9564('0xe6')][_0x9564('0x159')](db['MailInteraction'],{});db[_0x9564('0xe6')][_0x9564('0x159')](db[_0x9564('0x3a')],{'foreignKey':_0x9564('0x1e5'),'as':_0x9564('0x1e6')});db['MailTransferReport'][_0x9564('0x159')](db[_0x9564('0x11')],{'foreignKey':'FromUserId','as':'FromAgent'});db['MailTransferReport'][_0x9564('0x159')](db[_0x9564('0x11')],{'foreignKey':'ToUserId','as':_0x9564('0x1e7')});db[_0x9564('0xe6')][_0x9564('0x159')](db[_0x9564('0x3c')],{'foreignKey':'ToMailQueueId','as':_0x9564('0x1e8')});db['MailTransferReport'][_0x9564('0x159')](db[_0x9564('0x3a')],{'foreignKey':_0x9564('0x1e9'),'as':_0x9564('0x1ea')});db[_0x9564('0xe8')][_0x9564('0x159')](db[_0x9564('0x19b')],{});db[_0x9564('0xe8')][_0x9564('0x159')](db[_0x9564('0x65')],{});db[_0x9564('0xe8')]['belongsTo'](db[_0x9564('0x198')],{'foreignKey':_0x9564('0x1eb'),'as':_0x9564('0x1e6')});db[_0x9564('0xe8')][_0x9564('0x159')](db[_0x9564('0x11')],{'foreignKey':_0x9564('0x1ec'),'as':_0x9564('0x1ed')});db[_0x9564('0xe8')][_0x9564('0x159')](db['User'],{'foreignKey':_0x9564('0x1ee'),'as':_0x9564('0x1e7')});db[_0x9564('0xe8')][_0x9564('0x159')](db[_0x9564('0x19c')],{'foreignKey':_0x9564('0x1ef'),'as':'ToQueue'});db['ChatTransferReport'][_0x9564('0x159')](db[_0x9564('0x198')],{'foreignKey':_0x9564('0x1f0'),'as':_0x9564('0x1ea')});db[_0x9564('0xe9')][_0x9564('0x159')](db[_0x9564('0x4d')],{});db['FaxTransferReport'][_0x9564('0x159')](db[_0x9564('0x12e')],{});db[_0x9564('0xe9')][_0x9564('0x159')](db['FaxAccount'],{'foreignKey':_0x9564('0x1f1'),'as':'FromAccount'});db['FaxTransferReport'][_0x9564('0x159')](db[_0x9564('0x11')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x9564('0xe9')]['belongsTo'](db[_0x9564('0x11')],{'foreignKey':_0x9564('0x1ee'),'as':_0x9564('0x1e7')});db['FaxTransferReport'][_0x9564('0x159')](db[_0x9564('0x4f')],{'foreignKey':_0x9564('0x1f2'),'as':_0x9564('0x1e8')});db[_0x9564('0xe9')][_0x9564('0x159')](db[_0x9564('0x48')],{'foreignKey':_0x9564('0x1f3'),'as':_0x9564('0x1ea')});db[_0x9564('0x1f4')][_0x9564('0x159')](db['OpenchannelMessage'],{});db[_0x9564('0x1f4')]['belongsTo'](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport'][_0x9564('0x159')](db[_0x9564('0x5a')],{'foreignKey':_0x9564('0x1f5'),'as':_0x9564('0x1e6')});db[_0x9564('0x1f4')][_0x9564('0x159')](db[_0x9564('0x11')],{'foreignKey':_0x9564('0x1ec'),'as':'FromAgent'});db['OpenchannelTransferReport'][_0x9564('0x159')](db[_0x9564('0x11')],{'foreignKey':_0x9564('0x1ee'),'as':_0x9564('0x1e7')});db['OpenchannelTransferReport'][_0x9564('0x159')](db['OpenchannelQueue'],{'foreignKey':_0x9564('0x1f6'),'as':'ToQueue'});db[_0x9564('0x1f4')]['belongsTo'](db['OpenchannelAccount'],{'foreignKey':_0x9564('0x1f7'),'as':_0x9564('0x1ea')});db['SmsTransferReport']['belongsTo'](db[_0x9564('0x57')],{});db[_0x9564('0xec')][_0x9564('0x159')](db[_0x9564('0x12c')],{});db[_0x9564('0xec')][_0x9564('0x159')](db[_0x9564('0x53')],{'foreignKey':_0x9564('0x1f8'),'as':_0x9564('0x1e6')});db[_0x9564('0xec')][_0x9564('0x159')](db[_0x9564('0x11')],{'foreignKey':_0x9564('0x1ec'),'as':_0x9564('0x1ed')});db['SmsTransferReport'][_0x9564('0x159')](db[_0x9564('0x11')],{'foreignKey':_0x9564('0x1ee'),'as':_0x9564('0x1e7')});db[_0x9564('0xec')][_0x9564('0x159')](db[_0x9564('0x58')],{'foreignKey':_0x9564('0x1f9'),'as':_0x9564('0x1e8')});db[_0x9564('0xec')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0x9564('0x1fa'),'as':_0x9564('0x1ea')});db[_0x9564('0xee')][_0x9564('0x127')](db[_0x9564('0x16e')],{'as':'Dispositions','foreignKey':_0x9564('0x172')});db[_0x9564('0xee')][_0x9564('0x127')](db[_0x9564('0x78')],{'as':_0x9564('0x1fb'),'foreignKey':_0x9564('0x172')});db['CmList'][_0x9564('0x127')](db['CmContact'],{'as':_0x9564('0x1a6'),'onDelete':_0x9564('0x125'),'foreignKey':_0x9564('0x172')});db[_0x9564('0xee')][_0x9564('0x127')](db[_0x9564('0x72')],{'as':_0x9564('0x12a'),'foreignKey':_0x9564('0x172')});db[_0x9564('0xee')][_0x9564('0x127')](db[_0x9564('0x74')],{'as':_0x9564('0x1fc'),'foreignKey':_0x9564('0x172')});db[_0x9564('0xee')][_0x9564('0x127')](db[_0x9564('0x76')],{'as':_0x9564('0x76'),'foreignKey':_0x9564('0x172')});db[_0x9564('0xee')][_0x9564('0x132')](db[_0x9564('0x1b')],{'as':_0x9564('0x1fd'),'through':'voice_queues_has_cm_lists'});db[_0x9564('0xee')][_0x9564('0x132')](db[_0x9564('0x11')],{'as':_0x9564('0x160'),'through':_0x9564('0x142')});db[_0x9564('0xf0')][_0x9564('0x127')](db[_0x9564('0x17')],{'as':_0x9564('0x129'),'onDelete':_0x9564('0x17f')});db[_0x9564('0xf0')][_0x9564('0x132')](db[_0x9564('0x11')],{'as':_0x9564('0x160'),'through':_0x9564('0x143')});db[_0x9564('0xf2')][_0x9564('0x127')](db['User'],{'as':_0x9564('0x187'),'foreignKey':_0x9564('0x131')});db[_0x9564('0xf2')]['hasMany'](db[_0x9564('0xf4')],{'as':_0x9564('0x1fe'),'foreignKey':_0x9564('0x131'),'onDelete':'cascade'});db[_0x9564('0xf4')][_0x9564('0x127')](db[_0x9564('0xf6')],{'as':_0x9564('0x1ff'),'foreignKey':_0x9564('0x200'),'onDelete':_0x9564('0x125')});db[_0x9564('0xfa')][_0x9564('0x127')](db[_0x9564('0x201')],{'foreignKey':'WorkflowId'});db[_0x9564('0xfa')][_0x9564('0x127')](db[_0x9564('0x202')],{'foreignKey':_0x9564('0x203')});db[_0x9564('0x201')][_0x9564('0x123')](db[_0x9564('0xfb')],{'foreignKey':_0x9564('0x204')});db[_0x9564('0x201')][_0x9564('0x127')](db[_0x9564('0x202')],{'foreignKey':'WorkflowStepId'});db[_0x9564('0x201')]['belongsToMany'](db[_0x9564('0x201')],{'as':_0x9564('0x205'),'through':_0x9564('0x206')});db[_0x9564('0xfb')][_0x9564('0x127')](db[_0x9564('0xfc')],{'foreignKey':_0x9564('0x207')});db[_0x9564('0xfb')]['belongsTo'](db['CrmWorkflowStep'],{'foreignKey':'WorkflowStepId','as':_0x9564('0x201')});db[_0x9564('0xfc')][_0x9564('0x159')](db[_0x9564('0xfb')],{'foreignKey':_0x9564('0x207'),'as':_0x9564('0xfb')});db[_0x9564('0x208')][_0x9564('0x127')](db[_0x9564('0x103')],{'foreignKey':_0x9564('0x209')});db[_0x9564('0xff')][_0x9564('0x127')](db[_0x9564('0x103')],{'foreignKey':'UnitMeasureId'});db[_0x9564('0x103')][_0x9564('0x127')](db[_0x9564('0x108')],{'foreignKey':_0x9564('0x20a')});db[_0x9564('0x103')]['belongsTo'](db[_0x9564('0x20b')],{'as':_0x9564('0x20c'),'foreignKey':_0x9564('0x20d')});db[_0x9564('0x103')][_0x9564('0x159')](db['SAUnitMeasure'],{'as':_0x9564('0x20e'),'foreignKey':_0x9564('0x20f')});db[_0x9564('0x103')][_0x9564('0x159')](db[_0x9564('0x208')],{'as':_0x9564('0x210'),'foreignKey':_0x9564('0x209')});db[_0x9564('0x20b')]['hasMany'](db['SAProduct'],{'foreignKey':'TypeSalesConditionId'});db[_0x9564('0x106')][_0x9564('0x127')](db[_0x9564('0x108')],{'foreignKey':_0x9564('0x211')});db['SAProductPricesList'][_0x9564('0x127')](db[_0x9564('0x212')],{'as':_0x9564('0x213'),'foreignKey':_0x9564('0x214')});db[_0x9564('0x108')]['belongsTo'](db[_0x9564('0x103')],{'as':'Product','foreignKey':_0x9564('0x20a')});db['SAProductPricesList'][_0x9564('0x159')](db['SAPriceList'],{'as':_0x9564('0x215'),'foreignKey':'PriceListId'});db[_0x9564('0x202')]['hasMany'](db[_0x9564('0x10a')],{'as':'Dossiers','foreignKey':_0x9564('0x216')});db['SADossier']['hasMany'](db[_0x9564('0x10b')],{'as':_0x9564('0x1a9'),'foreignKey':'DossierId'});db['SADossier'][_0x9564('0x127')](db[_0x9564('0x10d')],{'as':'Dossiers','foreignKey':_0x9564('0x216')});db['SADossier'][_0x9564('0x127')](db[_0x9564('0x10f')],{'as':_0x9564('0x1a9'),'foreignKey':_0x9564('0x216')});db[_0x9564('0x202')][_0x9564('0x159')](db[_0x9564('0x1a4')],{'as':_0x9564('0x1ac'),'foreignKey':_0x9564('0x1a7')});db[_0x9564('0x202')]['belongsTo'](db[_0x9564('0x6e')],{'as':_0x9564('0x16b'),'foreignKey':_0x9564('0x16c')});db[_0x9564('0x202')][_0x9564('0x159')](db[_0x9564('0xfa')],{'as':_0x9564('0x217'),'foreignKey':'WorkflowId'});db[_0x9564('0x202')]['belongsTo'](db[_0x9564('0x201')],{'as':_0x9564('0x218'),'foreignKey':_0x9564('0x204')});db[_0x9564('0x202')][_0x9564('0x159')](db[_0x9564('0x11')],{'as':'User','foreignKey':_0x9564('0x126')});db[_0x9564('0x10a')][_0x9564('0x127')](db[_0x9564('0x10b')],{'as':'Requests','foreignKey':_0x9564('0x219')});db[_0x9564('0x10a')][_0x9564('0x127')](db[_0x9564('0x10d')],{'as':_0x9564('0x21a'),'foreignKey':'RequestId'});db[_0x9564('0x10a')][_0x9564('0x127')](db[_0x9564('0x10f')],{'as':'Requests','foreignKey':_0x9564('0x219')});db[_0x9564('0x10a')]['belongsTo'](db[_0x9564('0x202')],{'as':'Dossier','foreignKey':_0x9564('0x216')});db[_0x9564('0x10b')][_0x9564('0x127')](db[_0x9564('0x212')],{'as':_0x9564('0x21b'),'foreignKey':'QuotationId'});db[_0x9564('0x10b')]['hasMany'](db['SAOrder'],{'as':_0x9564('0x21b'),'foreignKey':_0x9564('0x21c')});db['SAQuotation'][_0x9564('0x127')](db[_0x9564('0x10f')],{'as':_0x9564('0x21b'),'foreignKey':'QuotationId'});db['SAQuotation'][_0x9564('0x159')](db['SADossier'],{'as':'Dossier','foreignKey':_0x9564('0x216')});db[_0x9564('0x10b')][_0x9564('0x159')](db[_0x9564('0x10a')],{'as':_0x9564('0x21d'),'foreignKey':_0x9564('0x219')});db[_0x9564('0x212')][_0x9564('0x159')](db[_0x9564('0x108')],{'as':'ProductPricesList','foreignKey':_0x9564('0x214')});db[_0x9564('0x212')]['belongsTo'](db[_0x9564('0x10b')],{'as':_0x9564('0x21e'),'foreignKey':'QuotationId'});db[_0x9564('0x212')]['belongsTo'](db['SAProforma'],{'as':_0x9564('0x21f'),'foreignKey':_0x9564('0x220')});db[_0x9564('0x212')][_0x9564('0x159')](db[_0x9564('0x110')],{'as':_0x9564('0x221'),'foreignKey':_0x9564('0x222')});db[_0x9564('0x10d')][_0x9564('0x127')](db['SAProforma'],{'as':_0x9564('0x223'),'foreignKey':_0x9564('0x224')});db[_0x9564('0x10d')][_0x9564('0x159')](db[_0x9564('0x202')],{'as':_0x9564('0x225'),'foreignKey':'DossierId'});db['SAOrder'][_0x9564('0x159')](db['SARequest'],{'as':'Request','foreignKey':_0x9564('0x219')});db[_0x9564('0x10d')][_0x9564('0x159')](db['SAQuotation'],{'as':_0x9564('0x21e'),'foreignKey':'QuotationId'});db[_0x9564('0x10f')][_0x9564('0x127')](db[_0x9564('0x110')],{'as':_0x9564('0x21f'),'foreignKey':_0x9564('0x220')});db['SAProforma'][_0x9564('0x127')](db['SAProductQuotation'],{'as':_0x9564('0x21f'),'foreignKey':_0x9564('0x220')});db[_0x9564('0x10f')][_0x9564('0x127')](db['SAProformaDetail'],{'as':'Proforma','foreignKey':'ProformaId'});db['SAProforma'][_0x9564('0x127')](db['SAPayment'],{'as':_0x9564('0x21f'),'foreignKey':_0x9564('0x220')});db[_0x9564('0x10f')][_0x9564('0x159')](db[_0x9564('0x202')],{'as':_0x9564('0x225'),'foreignKey':_0x9564('0x216')});db[_0x9564('0x10f')][_0x9564('0x159')](db[_0x9564('0x10a')],{'as':_0x9564('0x21d'),'foreignKey':'RequestId'});db[_0x9564('0x10f')][_0x9564('0x159')](db[_0x9564('0x10b')],{'as':_0x9564('0x21e'),'foreignKey':_0x9564('0x21c')});db['SAProforma'][_0x9564('0x159')](db['SAOrder'],{'as':_0x9564('0x226'),'foreignKey':_0x9564('0x224')});db[_0x9564('0x110')][_0x9564('0x127')](db['SAProductQuotation'],{'as':_0x9564('0x21b'),'foreignKey':_0x9564('0x222')});db[_0x9564('0x110')][_0x9564('0x127')](db[_0x9564('0x113')],{'as':'Details','foreignKey':_0x9564('0x222')});db[_0x9564('0x110')][_0x9564('0x127')](db['SAPayment'],{'as':_0x9564('0x227'),'foreignKey':_0x9564('0x222')});db[_0x9564('0x110')][_0x9564('0x159')](db[_0x9564('0x202')],{'as':_0x9564('0x225'),'foreignKey':_0x9564('0x216')});db[_0x9564('0x110')]['belongsTo'](db['SARequest'],{'as':'Request','foreignKey':'RequestId'});db[_0x9564('0x110')][_0x9564('0x159')](db[_0x9564('0x10b')],{'as':_0x9564('0x21e'),'foreignKey':_0x9564('0x21c')});db[_0x9564('0x110')][_0x9564('0x159')](db[_0x9564('0x10d')],{'as':_0x9564('0x226'),'foreignKey':_0x9564('0x224')});db[_0x9564('0x113')][_0x9564('0x159')](db[_0x9564('0x110')],{'as':_0x9564('0x221'),'foreignKey':'InvoiceId'});db[_0x9564('0x115')]['belongsTo'](db['SAProforma'],{'as':'Proforma','foreignKey':_0x9564('0x220')});db[_0x9564('0x117')][_0x9564('0x159')](db[_0x9564('0x110')],{'as':_0x9564('0x221'),'foreignKey':_0x9564('0x222')});db[_0x9564('0x117')][_0x9564('0x159')](db[_0x9564('0x10f')],{'as':_0x9564('0x21f'),'foreignKey':'ProformaId'});db[_0x9564('0x119')][_0x9564('0x127')](db[_0x9564('0x1a4')],{'as':_0x9564('0x228'),'foreignKey':'saPaymentMethod'});db[_0x9564('0x229')][_0x9564('0x159')](db[_0x9564('0x11b')],{'as':_0x9564('0x22a'),'foreignKey':_0x9564('0x22b')});db['SACompanyType']['hasMany'](db[_0x9564('0x1a4')],{'as':_0x9564('0x22c'),'foreignKey':'saCompanyType'});db[_0x9564('0x122')][_0x9564('0x127')](db[_0x9564('0x1a4')],{'as':_0x9564('0x22d'),'foreignKey':_0x9564('0x22e')});module[_0x9564('0x22f')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xb9d9=['hasMany','VoiceRecording','Recordings','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteraction','ChatInteractions','FaxInteractions','belongsTo','UserProfile','userProfileId','Groups','chat_group_has_users','belongsToMany','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','UserMailQueue','ChatQueues','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueues','CmList','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','SquareProject','user_has_square_projects','SpiedAgents','ChanSpyId','Sound','moh_has_sounds','Hoppers','VoiceQueueId','CmHopperBlack','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','mandatoryDispositionPauseId','Agents','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','AgentReports','ContactId','MailAccountId','Imap','Smtp','Dispositions','Answers','List','ListId','TemplateId','user_has_mail_accounts','MailInteractionId','Account','Contact','Owner','mail_interaction_has_tags','Tags','Users','Attachment','Attachments','Interaction','restrict','IntervalId','TagId','Items','Interactions','Applications','Exntensions','FaxMessage','mandatoryDispositionPause','user_has_fax_accounts','FaxInteractionId','FaxAccountId','fax_interaction_has_tags','ThroughTags','user_has_fax_interactions','AttachmentId','team_has_fax_queues','SmsAccountId','user_has_sms_accounts','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccountId','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueueId','ChatWebsiteId','ChatMessage','ChatQueueId','chat_interaction_has_tags','ChatInteractionId','team_has_chat_queues','ChatGroupId','Members','Website','CmCompany','CompanyId','SAPriceList','PriceLists','Dossiers','PaymentMethod','saPaymentMethod','CmHopper','HopperHistories','SADossier','Company','Queue','OwnerId','CampaignId','Condition','All','OneAll','Any','OneAny','AutomationAnyId','Action','AutomationId','Intervals','MailApplications','SmsApplications','DefaultReportId','cm_contact_has_tags','Trigger','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerId','Fields','CustomReportId','MetricId','Configurations','AccountId','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Field','VariableId','DeskField','int_desk_configuration_has_tags','Description','ZohoField','ZendeskAccount','ZendeskField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerConfiguration','ChatQueueReport','FromId','SessionId','JscriptyProject','ProjectId','team_has_mail_queues','MailQueues','team_has_openchannel_queues','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromUserId','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','CustomFields','Queues','voice_queues_has_cm_lists','UserProfileSections','UserProfileResource','Resources','sectionId','CrmWorkflowStep','WorkflowId','WorkflowStepId','CrmWorkflowNextStep','CrmActionsList','TaskId','TypeProductId','UnitMeasureId','ProductId','SaleCondition','UnitMeasure','TypeProduct','TypeSalesConditionId','ProductPriceListId','Product','Pricelist','PriceListId','DossierId','SAProforma','Workflow','RequestId','Requests','Dossier','Quotations','QuotationId','ProductPricesList','Proforma','ProformaId','Invoice','Orders','OrderId','Request','Quotation','InvoiceId','Details','SAInvoiceDetail','Companies','CreditNoteId','SACompanyType','CompanyType','saCompanyType','SACompanyRelationship','CompanyRelationship','saCompanyRelationship','exports','path','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','127.0.0.1','mysql','name','utf8','utf8_general_ci','sequelizeHistory','utf8mb4','username','options','password','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerField','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','Network','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','CrmNation','../api/crmNation/crmNation.model','CrmWorkflow','../api/crmWorkflow/crmWorkflow.model','../api/crmWorkflowstep/crmWorkflowstep.model','CrmTask','../api/crmTask/crmTask.model','../api/crmActionsList/crmActionsList.model','SATypeProduct','../api/saTypeProduct/saTypeProduct.model','SAUnitMeasure','../api/saUnitMeasure/saUnitMeasure.model','SAInvoiceLaw','SAProduct','../api/saProduct/saProduct.model','SASalesCondition','../api/saSalesCondition/saSalesCondition.model','../api/saPriceList/saPriceList.model','SAProductPricesList','../api/saProductPricesList/saProductPricesList.model','SARequest','SAQuotation','SAProductQuotation','../api/saProductQuotation/saProductQuotation.model','SAOrder','SAInvoice','../api/saInvoice/saInvoice.model','SAAsset','../api/saAsset/saAsset.model','../api/saInvoiceDetail/saInvoiceDetail.model','SAProformaDetail','SAPayment','../api/saPayment/saPayment.model','SAPaymentMethod','../api/saPaymentMethod/saPaymentMethod.model','SACreditNote','../api/saCreditNote/saCreditNote.model','SACreditNoteDetail','../api/saCreditNoteDetail/saCreditNoteDetail.model','SACreditNoteNumber','../api/saCreditNoteNumber/saCreditNoteNumber.model','hasOne','cascade','UserId','User'];(function(_0x33e7da,_0x548192){var _0x4c50cb=function(_0x466dfe){while(--_0x466dfe){_0x33e7da['push'](_0x33e7da['shift']());}};_0x4c50cb(++_0x548192);}(_0xb9d9,0x104));var _0x9b9d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb9d9[_0x2dafbe];return _0x58a45a;};'use strict';var path=require(_0x9b9d('0x0'));var config=require(_0x9b9d('0x1'));var Sequelize=require(_0x9b9d('0x2'));var _=require(_0x9b9d('0x3'));var jstz=require(_0x9b9d('0x4'));var timezone=jstz[_0x9b9d('0x5')]();config['sequelize']=_[_0x9b9d('0x6')](config[_0x9b9d('0x2')],{'database':_0x9b9d('0x7'),'username':_0x9b9d('0x8'),'password':'xC@LL1234','options':{'host':_0x9b9d('0x9'),'port':0xcea,'dialect':_0x9b9d('0xa'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x9b9d('0xb')](),'define':{'charset':_0x9b9d('0xc'),'collate':_0x9b9d('0xd')}}});config[_0x9b9d('0xe')]=_['defaultsDeep'](config['sequelizeHistory'],{'database':'motion2','username':_0x9b9d('0x8'),'password':'xC@LL1234','options':{'host':_0x9b9d('0x9'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x9b9d('0xf')},'logging':![],'timezone':timezone[_0x9b9d('0xb')](),'define':{'charset':_0x9b9d('0xc'),'collate':_0x9b9d('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9b9d('0x2')]['database'],config['sequelize'][_0x9b9d('0x10')],config[_0x9b9d('0x2')]['password'],config[_0x9b9d('0x2')][_0x9b9d('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9b9d('0xe')]['database'],config[_0x9b9d('0xe')][_0x9b9d('0x10')],config[_0x9b9d('0xe')][_0x9b9d('0x12')],config[_0x9b9d('0xe')][_0x9b9d('0x11')])};db['User']=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0x14'));db[_0x9b9d('0x15')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x16'));db[_0x9b9d('0x17')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0x18'));db[_0x9b9d('0x19')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0x1a'));db[_0x9b9d('0x1b')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x1c'));db[_0x9b9d('0x1d')]=db['sequelize'][_0x9b9d('0x13')]('../api/voiceQueue/voiceQueue.model');db['VoiceRecording']=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x1e'));db[_0x9b9d('0x1f')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')]('../api/screenRecording/screenRecording.model');db[_0x9b9d('0x20')]=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0x21'));db[_0x9b9d('0x22')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x23'));db[_0x9b9d('0x24')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x25'));db[_0x9b9d('0x26')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0x27'));db[_0x9b9d('0x28')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x9b9d('0x29')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x2a'));db[_0x9b9d('0x2b')]=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0x2c'));db[_0x9b9d('0x2d')]=db['sequelize'][_0x9b9d('0x13')]('../api/trunk/trunk.model');db[_0x9b9d('0x2e')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x2f'));db[_0x9b9d('0x30')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x31'));db[_0x9b9d('0x32')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x33'));db[_0x9b9d('0x34')]=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0x35'));db['UserMailQueue']=db[_0x9b9d('0x2')]['import'](_0x9b9d('0x36'));db['UserFaxQueue']=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x37'));db[_0x9b9d('0x38')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x39'));db[_0x9b9d('0x3a')]=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0x3b'));db[_0x9b9d('0x3c')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x3d'));db[_0x9b9d('0x3e')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x3f'));db[_0x9b9d('0x40')]=db['sequelize']['import'](_0x9b9d('0x41'));db[_0x9b9d('0x42')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x43'));db[_0x9b9d('0x44')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x45'));db[_0x9b9d('0x46')]=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0x47'));db[_0x9b9d('0x48')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x49'));db[_0x9b9d('0x4a')]=db[_0x9b9d('0x2')]['import']('../api/mailQueueReport/mailQueueReport.model');db[_0x9b9d('0x4b')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')]('../api/dashboard/dashboard.model');db[_0x9b9d('0x4c')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x4d'));db[_0x9b9d('0x4e')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0x4f'));db[_0x9b9d('0x50')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')]('../api/faxApplication/faxApplication.model');db[_0x9b9d('0x51')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x52'));db['FaxMessage']=db[_0x9b9d('0x2')]['import'](_0x9b9d('0x53'));db[_0x9b9d('0x54')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')]('../api/faxQueue/faxQueue.model');db[_0x9b9d('0x55')]=db[_0x9b9d('0x2')]['import']('../api/faxQueueReport/faxQueueReport.model');db[_0x9b9d('0x56')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0x57'));db[_0x9b9d('0x58')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0x59'));db[_0x9b9d('0x5a')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x5b'));db[_0x9b9d('0x5c')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x5d'));db[_0x9b9d('0x5e')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0x5f'));db[_0x9b9d('0x60')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0x61'));db[_0x9b9d('0x62')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x63'));db[_0x9b9d('0x64')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x65'));db[_0x9b9d('0x66')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x67'));db[_0x9b9d('0x68')]=db['sequelize']['import']('../api/openchannelQueue/openchannelQueue.model');db[_0x9b9d('0x69')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x6a'));db[_0x9b9d('0x6b')]=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0x6c'));db[_0x9b9d('0x6d')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0x6e'));db['ChatInteraction']=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x6f'));db['ChatMessage']=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x70'));db[_0x9b9d('0x71')]=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0x72'));db[_0x9b9d('0x73')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x74'));db[_0x9b9d('0x75')]=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0x76'));db[_0x9b9d('0x77')]=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0x78'));db['CmCompany']=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0x79'));db[_0x9b9d('0x7a')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x7b'));db['CmHopper']=db[_0x9b9d('0x2')][_0x9b9d('0x13')]('../api/cmHopper/cmHopper.model');db['CmHopperBlack']=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x7c'));db[_0x9b9d('0x7d')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x7e'));db[_0x9b9d('0x7f')]=db['sequelize'][_0x9b9d('0x13')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x9b9d('0x80')]=db['sequelize']['import'](_0x9b9d('0x81'));db[_0x9b9d('0x82')]=db['sequelize']['import'](_0x9b9d('0x83'));db['Action']=db['sequelize'][_0x9b9d('0x13')]('../api/action/action.model');db[_0x9b9d('0x84')]=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0x85'));db[_0x9b9d('0x86')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x87'));db[_0x9b9d('0x88')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x89'));db['Condition']=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x8a'));db[_0x9b9d('0x8b')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x8c'));db[_0x9b9d('0x8d')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x8e'));db['Cdr']=db[_0x9b9d('0x2')][_0x9b9d('0x13')]('../api/cdr/cdr.model');db[_0x9b9d('0x8f')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x90'));db[_0x9b9d('0x91')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x92'));db['Sound']=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x93'));db[_0x9b9d('0x94')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x95'));db[_0x9b9d('0x96')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x97'));db['Trigger']=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x98'));db[_0x9b9d('0x99')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x9a'));db[_0x9b9d('0x9b')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')]('../api/integration/integration.model');db[_0x9b9d('0x9c')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x9d'));db[_0x9b9d('0x9e')]=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0x9f'));db[_0x9b9d('0xa0')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xa1'));db[_0x9b9d('0xa2')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0xa3'));db[_0x9b9d('0xa4')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0xa5'));db[_0x9b9d('0xa6')]=db[_0x9b9d('0x2')]['import']('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xa7'));db[_0x9b9d('0xa8')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xa9'));db[_0x9b9d('0xaa')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xab'));db['SalesforceField']=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xac'));db[_0x9b9d('0xad')]=db['sequelize']['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x9b9d('0xae')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0xaf'));db[_0x9b9d('0xb0')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xb1'));db[_0x9b9d('0xb2')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xb3'));db[_0x9b9d('0xb4')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0xb5'));db['DeskField']=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xb6'));db[_0x9b9d('0xb7')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xb8'));db[_0x9b9d('0xb9')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xba'));db['ZohoField']=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xbb'));db['ZendeskAccount']=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0xbc'));db[_0x9b9d('0xbd')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xbe'));db['ZendeskField']=db[_0x9b9d('0x2')]['import'](_0x9b9d('0xbf'));db[_0x9b9d('0xc0')]=db['sequelize']['import'](_0x9b9d('0xc1'));db[_0x9b9d('0xc2')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xc3'));db[_0x9b9d('0xc4')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xc5'));db[_0x9b9d('0xc6')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0xc7'));db['VtigerConfiguration']=db[_0x9b9d('0x2')]['import']('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x9b9d('0xc8')]=db['sequelize'][_0x9b9d('0x13')]('../api/intVtigerField/intVtigerField.model');db[_0x9b9d('0xc9')]=db[_0x9b9d('0x2')]['import']('../api/intServicenowAccount/intServicenowAccount.model');db[_0x9b9d('0xca')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xcb'));db[_0x9b9d('0xcc')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0xcd'));db[_0x9b9d('0xce')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xcf'));db[_0x9b9d('0xd0')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0xd1'));db[_0x9b9d('0xd2')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0xd3'));db[_0x9b9d('0x9b')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')]('../api/integration/integration.model');db[_0x9b9d('0xd4')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')]('../api/network/network.model');db['ChatQueueReport']=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xd5'));db[_0x9b9d('0xd6')]=db[_0x9b9d('0x2')]['import']('../api/chatInternalMessage/chatInternalMessage.model');db[_0x9b9d('0xd7')]=db[_0x9b9d('0x2')]['import']('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x9b9d('0xd8')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0xd9'));db[_0x9b9d('0xda')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xdb'));db[_0x9b9d('0xdc')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0xdd'));db[_0x9b9d('0xde')]=db[_0x9b9d('0x2')]['import']('../api/squareReport/squareReport.model');db[_0x9b9d('0xdf')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')]('../api/squareReportDetail/squareReportDetail.model');db['JscriptyProject']=db[_0x9b9d('0x2')]['import'](_0x9b9d('0xe0'));db[_0x9b9d('0xe1')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xe2'));db[_0x9b9d('0xe3')]=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0xe4'));db['SquareProject']=db[_0x9b9d('0x2')][_0x9b9d('0x13')]('../api/squareProject/squareProject.model');db['SquareRecording']=db[_0x9b9d('0x2')]['import']('../api/squareRecording/squareRecording.model');db[_0x9b9d('0xe5')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xe6'));db[_0x9b9d('0xe7')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xe8'));db[_0x9b9d('0xe9')]=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0xea'));db[_0x9b9d('0xeb')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0xec'));db[_0x9b9d('0xed')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0xee'));db['Attachment']=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xef'));db[_0x9b9d('0xf0')]=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0xf1'));db[_0x9b9d('0xf2')]=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0xf3'));db[_0x9b9d('0xf4')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xf5'));db[_0x9b9d('0xf6')]=db['sequelize']['import'](_0x9b9d('0xf7'));db[_0x9b9d('0xf8')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x9b9d('0xf9')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xfa'));db['CmList']=db['sequelize'][_0x9b9d('0x13')]('../api/cmList/cmList.model');db[_0x9b9d('0xfb')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xfc'));db['UserProfile']=db['sequelize']['import'](_0x9b9d('0xfd'));db[_0x9b9d('0xfe')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0xff'));db['UserProfileResource']=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x100'));db[_0x9b9d('0x101')]=db['sequelize']['import'](_0x9b9d('0x102'));db[_0x9b9d('0x103')]=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0x104'));db['CrmWorkflowStep']=db[_0x9b9d('0x2')]['import'](_0x9b9d('0x105'));db[_0x9b9d('0x106')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x107'));db['CrmActionsList']=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0x108'));db[_0x9b9d('0x109')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x10a'));db[_0x9b9d('0x10b')]=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0x10c'));db[_0x9b9d('0x10d')]=db['sequelize']['import']('../api/saInvoiceLaw/saInvoiceLaw.model');db[_0x9b9d('0x10e')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x10f'));db[_0x9b9d('0x110')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0x111'));db['SAPriceList']=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0x112'));db[_0x9b9d('0x113')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x114'));db['SADossier']=db['sequelize']['import']('../api/saDossier/saDossier.model');db[_0x9b9d('0x115')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')]('../api/saRequest/saRequest.model');db[_0x9b9d('0x116')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')]('../api/saQuotation/saQuotation.model');db[_0x9b9d('0x117')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0x118'));db[_0x9b9d('0x119')]=db['sequelize'][_0x9b9d('0x13')]('../api/saOrder/saOrder.model');db['SAProforma']=db['sequelize'][_0x9b9d('0x13')]('../api/saProforma/saProforma.model');db[_0x9b9d('0x11a')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x11b'));db[_0x9b9d('0x11c')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x11d'));db['SAInvoiceDetail']=db['sequelize']['import'](_0x9b9d('0x11e'));db[_0x9b9d('0x11f')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')]('../api/saProformaDetail/saProformaDetail.model');db[_0x9b9d('0x120')]=db['sequelize']['import'](_0x9b9d('0x121'));db[_0x9b9d('0x122')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x123'));db[_0x9b9d('0x124')]=db[_0x9b9d('0x2')][_0x9b9d('0x13')](_0x9b9d('0x125'));db[_0x9b9d('0x126')]=db['sequelize'][_0x9b9d('0x13')](_0x9b9d('0x127'));db['SAInvoiceNumber']=db[_0x9b9d('0x2')][_0x9b9d('0x13')]('../api/saInvoiceNumber/saInvoiceNumber.model');db[_0x9b9d('0x128')]=db[_0x9b9d('0x2')]['import'](_0x9b9d('0x129'));db['SACompanyType']=db[_0x9b9d('0x2')][_0x9b9d('0x13')]('../api/saCompanyType/saCompanyType.model');db['SACompanyRelationship']=db['sequelize']['import']('../api/saCompanyRelationship/saCompanyRelationship.model');db['User'][_0x9b9d('0x12a')](db[_0x9b9d('0x20')],{'as':'VoiceMail','onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x12c')});db[_0x9b9d('0x12d')][_0x9b9d('0x12e')](db[_0x9b9d('0x12f')],{'as':_0x9b9d('0x130'),'foreignKey':_0x9b9d('0x12c')});db['User'][_0x9b9d('0x12e')](db[_0x9b9d('0x30')],{'as':'VoiceQueuesRt','foreignKey':_0x9b9d('0x12c')});db['User'][_0x9b9d('0x12e')](db[_0x9b9d('0x19')],{'as':_0x9b9d('0x131'),'onDelete':_0x9b9d('0x12b'),'hooks':!![]});db['User'][_0x9b9d('0x12e')](db[_0x9b9d('0x7d')],{'as':_0x9b9d('0x132'),'foreignKey':_0x9b9d('0x12c')});db[_0x9b9d('0x12d')][_0x9b9d('0x12e')](db[_0x9b9d('0x7f')],{'as':_0x9b9d('0x133'),'foreignKey':_0x9b9d('0x12c')});db[_0x9b9d('0x12d')][_0x9b9d('0x12e')](db[_0x9b9d('0x80')],{'as':_0x9b9d('0x80'),'foreignKey':_0x9b9d('0x12c')});db[_0x9b9d('0x12d')][_0x9b9d('0x12e')](db['OpenchannelInteraction'],{'as':_0x9b9d('0x134'),'foreignKey':_0x9b9d('0x12c')});db['User'][_0x9b9d('0x12e')](db[_0x9b9d('0x135')],{'as':_0x9b9d('0x136'),'foreignKey':'UserId'});db[_0x9b9d('0x12d')][_0x9b9d('0x12e')](db[_0x9b9d('0x5a')],{'as':'SmsInteractions','foreignKey':_0x9b9d('0x12c')});db['User'][_0x9b9d('0x12e')](db[_0x9b9d('0x51')],{'as':_0x9b9d('0x137'),'foreignKey':_0x9b9d('0x12c')});db['User'][_0x9b9d('0x12e')](db[_0x9b9d('0x44')],{'as':'MailInteractions','foreignKey':_0x9b9d('0x12c')});db[_0x9b9d('0x12d')][_0x9b9d('0x138')](db[_0x9b9d('0x139')],{'as':_0x9b9d('0x139'),'foreignKey':_0x9b9d('0x13a')});db[_0x9b9d('0x12d')]['belongsToMany'](db[_0x9b9d('0x75')],{'as':_0x9b9d('0x13b'),'through':_0x9b9d('0x13c')});db[_0x9b9d('0x12d')][_0x9b9d('0x13d')](db[_0x9b9d('0x7a')],{'as':_0x9b9d('0x13e'),'through':_0x9b9d('0x13f')});db['User']['belongsToMany'](db['CmList'],{'as':_0x9b9d('0x140'),'through':_0x9b9d('0x141')});db[_0x9b9d('0x12d')]['belongsToMany'](db[_0x9b9d('0xe7')],{'through':_0x9b9d('0x142')});db[_0x9b9d('0x12d')][_0x9b9d('0x13d')](db[_0x9b9d('0x44')],{'as':_0x9b9d('0x143'),'through':_0x9b9d('0x144')});db[_0x9b9d('0x12d')][_0x9b9d('0x13d')](db[_0x9b9d('0x135')],{'as':'ChatInteractions','through':_0x9b9d('0x145')});db[_0x9b9d('0x12d')]['belongsToMany'](db['FaxInteraction'],{'as':_0x9b9d('0x137'),'through':'user_has_fax_interactions'});db[_0x9b9d('0x12d')][_0x9b9d('0x13d')](db[_0x9b9d('0x5a')],{'as':_0x9b9d('0x146'),'through':_0x9b9d('0x147')});db[_0x9b9d('0x12d')][_0x9b9d('0x13d')](db['OpenchannelInteraction'],{'as':_0x9b9d('0x134'),'through':_0x9b9d('0x148')});db[_0x9b9d('0x12d')][_0x9b9d('0x13d')](db[_0x9b9d('0x1d')],{'as':_0x9b9d('0x149'),'through':'UserVoiceQueue','required':![]});db['User'][_0x9b9d('0x13d')](db['MailQueue'],{'as':'MailQueues','through':_0x9b9d('0x14a'),'required':![]});db[_0x9b9d('0x12d')][_0x9b9d('0x13d')](db['ChatQueue'],{'as':_0x9b9d('0x14b'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x9b9d('0x12d')][_0x9b9d('0x13d')](db[_0x9b9d('0x54')],{'as':_0x9b9d('0x14c'),'through':_0x9b9d('0x14d'),'required':![]});db[_0x9b9d('0x12d')][_0x9b9d('0x13d')](db[_0x9b9d('0x5e')],{'as':_0x9b9d('0x14e'),'through':_0x9b9d('0x38'),'required':![]});db['User'][_0x9b9d('0x13d')](db[_0x9b9d('0x68')],{'as':_0x9b9d('0x14f'),'through':_0x9b9d('0x3a'),'required':![]});db[_0x9b9d('0x12d')]['belongsToMany'](db[_0x9b9d('0x150')],{'through':_0x9b9d('0x141')});db[_0x9b9d('0x12d')][_0x9b9d('0x13d')](db[_0x9b9d('0xfb')],{'as':_0x9b9d('0x151'),'through':_0x9b9d('0x152'),'required':![]});db[_0x9b9d('0x12d')][_0x9b9d('0x13d')](db[_0x9b9d('0x69')],{'as':_0x9b9d('0x153'),'through':_0x9b9d('0x154')});db[_0x9b9d('0x12d')]['belongsToMany'](db[_0x9b9d('0x4e')],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db[_0x9b9d('0x12d')][_0x9b9d('0x13d')](db[_0x9b9d('0x3e')],{'as':_0x9b9d('0x155'),'through':'user_has_mail_accounts'});db['User'][_0x9b9d('0x13d')](db[_0x9b9d('0x60')],{'as':_0x9b9d('0x156'),'through':_0x9b9d('0x157')});db[_0x9b9d('0x12d')][_0x9b9d('0x13d')](db[_0x9b9d('0x56')],{'as':_0x9b9d('0x158'),'through':'user_has_sms_accounts'});db[_0x9b9d('0x12d')]['belongsToMany'](db[_0x9b9d('0x159')],{'as':'SquareProjects','through':_0x9b9d('0x15a')});db[_0x9b9d('0x15')][_0x9b9d('0x12e')](db[_0x9b9d('0x19')],{'as':_0x9b9d('0x15b'),'onDelete':'cascade','foreignKey':_0x9b9d('0x15c')});db[_0x9b9d('0x17')][_0x9b9d('0x12e')](db['VoiceExtension'],{'onDelete':_0x9b9d('0x12b')});db[_0x9b9d('0x19')][_0x9b9d('0x12e')](db[_0x9b9d('0x19')],{'as':'Applications','onDelete':_0x9b9d('0x12b')});db['VoiceMusicOnHold'][_0x9b9d('0x13d')](db[_0x9b9d('0x15d')],{'as':'Sounds','through':_0x9b9d('0x15e')});db[_0x9b9d('0x1d')][_0x9b9d('0x12e')](db[_0x9b9d('0x30')],{'as':'Members','foreignKey':'VoiceQueueId'});db[_0x9b9d('0x1d')][_0x9b9d('0x12e')](db['CmHopper'],{'as':_0x9b9d('0x15f'),'foreignKey':_0x9b9d('0x160')});db[_0x9b9d('0x1d')][_0x9b9d('0x12e')](db[_0x9b9d('0x7d')],{'as':_0x9b9d('0x132'),'foreignKey':'VoiceQueueId'});db[_0x9b9d('0x1d')][_0x9b9d('0x12e')](db[_0x9b9d('0x7f')],{'as':'HopperHistories','foreignKey':_0x9b9d('0x160')});db[_0x9b9d('0x1d')][_0x9b9d('0x12e')](db[_0x9b9d('0x80')],{'as':'ReportAgentPreview','foreignKey':_0x9b9d('0x160')});db[_0x9b9d('0x1d')][_0x9b9d('0x12e')](db[_0x9b9d('0x161')],{'as':_0x9b9d('0x162'),'foreignKey':_0x9b9d('0x160')});db['VoiceQueue'][_0x9b9d('0x12e')](db[_0x9b9d('0xda')],{'as':_0x9b9d('0x163'),'foreignKey':'VoiceQueueId'});db[_0x9b9d('0x1d')][_0x9b9d('0x138')](db[_0x9b9d('0x2d')],{'as':_0x9b9d('0x2d'),'foreignKey':_0x9b9d('0x164')});db[_0x9b9d('0x1d')][_0x9b9d('0x138')](db[_0x9b9d('0x2d')],{'as':_0x9b9d('0x165'),'foreignKey':_0x9b9d('0x166')});db[_0x9b9d('0x1d')][_0x9b9d('0x138')](db[_0x9b9d('0x8b')],{'as':_0x9b9d('0x8b'),'foreignKey':'IntervalId'});db[_0x9b9d('0x1d')][_0x9b9d('0x138')](db[_0x9b9d('0x8d')],{'as':'mandatoryDispositionPause','foreignKey':_0x9b9d('0x167')});db[_0x9b9d('0x1d')][_0x9b9d('0x13d')](db[_0x9b9d('0x150')],{'as':_0x9b9d('0x140'),'through':'voice_queues_has_cm_lists'});db[_0x9b9d('0x1d')][_0x9b9d('0x13d')](db[_0x9b9d('0x12d')],{'as':_0x9b9d('0x168'),'through':_0x9b9d('0x32')});db[_0x9b9d('0x1d')][_0x9b9d('0x13d')](db[_0x9b9d('0xe7')],{'as':_0x9b9d('0x169'),'through':_0x9b9d('0x16a')});db[_0x9b9d('0x1d')][_0x9b9d('0x13d')](db[_0x9b9d('0x150')],{'as':_0x9b9d('0x16b'),'through':_0x9b9d('0x16c')});db[_0x9b9d('0x12f')][_0x9b9d('0x138')](db[_0x9b9d('0x12d')],{'as':_0x9b9d('0x12d'),'foreignKey':_0x9b9d('0x12c')});db['ScreenRecording'][_0x9b9d('0x138')](db['User'],{'as':_0x9b9d('0x12d'),'foreignKey':_0x9b9d('0x12c')});db[_0x9b9d('0x20')][_0x9b9d('0x12e')](db[_0x9b9d('0x22')],{'as':_0x9b9d('0x16d'),'onDelete':'cascade','foreignKey':_0x9b9d('0x16e'),'sourceKey':_0x9b9d('0x16f')});db['VoiceMailMessage']['belongsTo'](db[_0x9b9d('0x20')],{'foreignKey':_0x9b9d('0x16e'),'targetKey':_0x9b9d('0x16f')});db[_0x9b9d('0x24')][_0x9b9d('0x12e')](db['VoiceQueueReport'],{'as':_0x9b9d('0x170'),'foreignKey':'uniqueid','constraints':![]});db[_0x9b9d('0x24')][_0x9b9d('0x12e')](db[_0x9b9d('0x28')],{'as':_0x9b9d('0x171'),'foreignKey':'uniqueid','constraints':![]});db[_0x9b9d('0x24')][_0x9b9d('0x138')](db[_0x9b9d('0x12d')],{'as':_0x9b9d('0x12d'),'foreignKey':'UserId'});db[_0x9b9d('0x24')][_0x9b9d('0x138')](db[_0x9b9d('0x7a')],{'as':'Contact','foreignKey':_0x9b9d('0x172')});db['MailServerIn'][_0x9b9d('0x138')](db[_0x9b9d('0x3e')],{'as':'MailAccount','foreignKey':_0x9b9d('0x173')});db['MailServerOut'][_0x9b9d('0x138')](db['MailAccount'],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x9b9d('0x3e')][_0x9b9d('0x12a')](db[_0x9b9d('0x3c')],{'as':_0x9b9d('0x174'),'onDelete':'cascade'});db['MailAccount'][_0x9b9d('0x12a')](db['MailServerOut'],{'as':_0x9b9d('0x175'),'onDelete':_0x9b9d('0x12b')});db[_0x9b9d('0x3e')][_0x9b9d('0x12e')](db[_0x9b9d('0x88')],{'as':_0x9b9d('0x176'),'foreignKey':'MailAccountId'});db[_0x9b9d('0x3e')][_0x9b9d('0x12e')](db[_0x9b9d('0x86')],{'as':_0x9b9d('0x177'),'foreignKey':_0x9b9d('0x173')});db[_0x9b9d('0x3e')][_0x9b9d('0x12e')](db[_0x9b9d('0x46')],{'as':_0x9b9d('0x16d'),'foreignKey':_0x9b9d('0x173')});db[_0x9b9d('0x3e')][_0x9b9d('0x12e')](db[_0x9b9d('0x44')],{'as':'Interactions'});db[_0x9b9d('0x3e')][_0x9b9d('0x12e')](db[_0x9b9d('0x48')],{'as':'Applications'});db[_0x9b9d('0x3e')][_0x9b9d('0x138')](db[_0x9b9d('0x150')],{'as':_0x9b9d('0x178'),'foreignKey':_0x9b9d('0x179')});db[_0x9b9d('0x3e')][_0x9b9d('0x138')](db[_0x9b9d('0x96')],{'as':_0x9b9d('0x96'),'foreignKey':_0x9b9d('0x17a')});db[_0x9b9d('0x3e')][_0x9b9d('0x138')](db[_0x9b9d('0x8d')],{'as':'mandatoryDispositionPause','foreignKey':_0x9b9d('0x167')});db[_0x9b9d('0x3e')][_0x9b9d('0x13d')](db[_0x9b9d('0x12d')],{'as':'Agents','through':_0x9b9d('0x17b')});db[_0x9b9d('0x40')][_0x9b9d('0x13d')](db[_0x9b9d('0x12d')],{'as':'Agents','through':'UserMailQueue'});db[_0x9b9d('0x40')][_0x9b9d('0x13d')](db[_0x9b9d('0xe7')],{'through':'team_has_mail_queues','as':'Teams'});db[_0x9b9d('0x44')][_0x9b9d('0x12e')](db[_0x9b9d('0x46')],{'as':'Messages','onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x17c')});db[_0x9b9d('0x44')][_0x9b9d('0x138')](db[_0x9b9d('0x3e')],{'as':_0x9b9d('0x17d'),'foreignKey':_0x9b9d('0x173')});db[_0x9b9d('0x44')][_0x9b9d('0x138')](db['CmContact'],{'as':_0x9b9d('0x17e'),'foreignKey':'ContactId'});db[_0x9b9d('0x44')][_0x9b9d('0x138')](db[_0x9b9d('0x12d')],{'as':_0x9b9d('0x17f'),'foreignKey':'UserId'});db[_0x9b9d('0x44')][_0x9b9d('0x13d')](db['Tag'],{'through':_0x9b9d('0x180'),'as':_0x9b9d('0x181')});db[_0x9b9d('0x44')]['belongsToMany'](db[_0x9b9d('0x94')],{'through':_0x9b9d('0x180'),'as':'ThroughTags'});db[_0x9b9d('0x44')]['belongsToMany'](db[_0x9b9d('0x12d')],{'as':_0x9b9d('0x182'),'through':_0x9b9d('0x144'),'foreignKey':_0x9b9d('0x17c')});db[_0x9b9d('0x46')][_0x9b9d('0x12e')](db[_0x9b9d('0x183')],{'as':_0x9b9d('0x184'),'onDelete':_0x9b9d('0x12b')});db[_0x9b9d('0x46')]['belongsTo'](db[_0x9b9d('0x12d')],{'as':_0x9b9d('0x12d')});db['MailMessage'][_0x9b9d('0x138')](db[_0x9b9d('0x7a')],{'onDelete':_0x9b9d('0x12b'),'as':_0x9b9d('0x17e')});db[_0x9b9d('0x46')][_0x9b9d('0x138')](db[_0x9b9d('0x44')],{'as':_0x9b9d('0x185'),'foreignKey':'MailInteractionId'});db[_0x9b9d('0x46')][_0x9b9d('0x138')](db['MailAccount'],{'as':_0x9b9d('0x17d'),'foreignKey':_0x9b9d('0x173')});db['MailApplication']['belongsTo'](db[_0x9b9d('0x12d')],{'onDelete':_0x9b9d('0x186')});db['MailApplication'][_0x9b9d('0x138')](db['MailQueue'],{'onDelete':_0x9b9d('0x186')});db['MailApplication'][_0x9b9d('0x138')](db['MailAccount'],{'onDelete':'restrict'});db['MailApplication'][_0x9b9d('0x138')](db[_0x9b9d('0x8b')],{'onDelete':_0x9b9d('0x186'),'foreignKey':_0x9b9d('0x187')});db[_0x9b9d('0x48')][_0x9b9d('0x138')](db['Tag'],{'onDelete':_0x9b9d('0x186'),'foreignKey':_0x9b9d('0x188')});db[_0x9b9d('0x4a')]['belongsTo'](db[_0x9b9d('0x3e')],{});db[_0x9b9d('0x4a')][_0x9b9d('0x138')](db[_0x9b9d('0x150')],{'as':'List','foreignKey':_0x9b9d('0x179')});db[_0x9b9d('0x4a')]['belongsTo'](db[_0x9b9d('0x7a')],{'as':_0x9b9d('0x17e'),'foreignKey':_0x9b9d('0x172')});db[_0x9b9d('0x4a')]['belongsTo'](db[_0x9b9d('0x44')],{});db[_0x9b9d('0x4a')]['belongsTo'](db[_0x9b9d('0x46')],{});db[_0x9b9d('0x4a')][_0x9b9d('0x138')](db[_0x9b9d('0x12d')],{});db[_0x9b9d('0x4a')][_0x9b9d('0x138')](db[_0x9b9d('0x40')],{});db['Dashboard']['hasMany'](db[_0x9b9d('0x4c')],{'as':_0x9b9d('0x189'),'onDelete':_0x9b9d('0x12b')});db[_0x9b9d('0x4e')][_0x9b9d('0x12e')](db['Disposition'],{'as':_0x9b9d('0x176'),'foreignKey':'FaxAccountId'});db[_0x9b9d('0x4e')][_0x9b9d('0x12e')](db[_0x9b9d('0x86')],{'as':_0x9b9d('0x177'),'foreignKey':'FaxAccountId'});db[_0x9b9d('0x4e')][_0x9b9d('0x12e')](db[_0x9b9d('0x51')],{'as':_0x9b9d('0x18a')});db[_0x9b9d('0x4e')]['hasMany'](db[_0x9b9d('0x50')],{'as':_0x9b9d('0x18b')});db['FaxAccount'][_0x9b9d('0x12e')](db[_0x9b9d('0x19')],{'as':_0x9b9d('0x18c'),'onDelete':_0x9b9d('0x12b')});db[_0x9b9d('0x4e')][_0x9b9d('0x12e')](db[_0x9b9d('0x18d')],{'as':_0x9b9d('0x16d')});db[_0x9b9d('0x4e')]['belongsTo'](db[_0x9b9d('0x2d')],{'as':_0x9b9d('0x2d')});db['FaxAccount'][_0x9b9d('0x138')](db[_0x9b9d('0x150')],{'as':_0x9b9d('0x178'),'foreignKey':_0x9b9d('0x179')});db['FaxAccount'][_0x9b9d('0x138')](db['Pause'],{'as':_0x9b9d('0x18e'),'foreignKey':_0x9b9d('0x167')});db[_0x9b9d('0x4e')][_0x9b9d('0x13d')](db[_0x9b9d('0x12d')],{'as':'Agents','through':_0x9b9d('0x18f')});db[_0x9b9d('0x50')]['belongsTo'](db[_0x9b9d('0x12d')],{'onDelete':_0x9b9d('0x186')});db[_0x9b9d('0x50')][_0x9b9d('0x138')](db[_0x9b9d('0x54')],{'onDelete':_0x9b9d('0x186')});db[_0x9b9d('0x50')]['belongsTo'](db[_0x9b9d('0x4e')],{'onDelete':_0x9b9d('0x186')});db[_0x9b9d('0x50')][_0x9b9d('0x138')](db['Tag'],{'onDelete':_0x9b9d('0x186'),'foreignKey':_0x9b9d('0x188')});db[_0x9b9d('0x51')][_0x9b9d('0x12e')](db[_0x9b9d('0x18d')],{'as':'Messages','onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x190')});db['FaxInteraction'][_0x9b9d('0x138')](db['FaxAccount'],{'as':_0x9b9d('0x17d'),'foreignKey':_0x9b9d('0x191')});db[_0x9b9d('0x51')][_0x9b9d('0x138')](db[_0x9b9d('0x7a')],{'as':_0x9b9d('0x17e'),'foreignKey':_0x9b9d('0x172')});db[_0x9b9d('0x51')][_0x9b9d('0x138')](db[_0x9b9d('0x12d')],{'as':_0x9b9d('0x17f'),'foreignKey':'UserId'});db[_0x9b9d('0x51')]['belongsToMany'](db[_0x9b9d('0x94')],{'through':_0x9b9d('0x192'),'as':_0x9b9d('0x181')});db[_0x9b9d('0x51')][_0x9b9d('0x13d')](db[_0x9b9d('0x94')],{'through':'fax_interaction_has_tags','as':_0x9b9d('0x193')});db['FaxInteraction'][_0x9b9d('0x13d')](db[_0x9b9d('0x12d')],{'as':'Users','through':_0x9b9d('0x194'),'foreignKey':'FaxInteractionId'});db[_0x9b9d('0x18d')]['belongsTo'](db[_0x9b9d('0x12d')],{'onDelete':_0x9b9d('0x12b'),'as':_0x9b9d('0x12d')});db[_0x9b9d('0x18d')][_0x9b9d('0x138')](db[_0x9b9d('0x51')],{'as':_0x9b9d('0x185'),'foreignKey':_0x9b9d('0x190')});db['FaxMessage'][_0x9b9d('0x138')](db[_0x9b9d('0x7a')],{'onDelete':_0x9b9d('0x12b'),'as':'Contact'});db[_0x9b9d('0x18d')][_0x9b9d('0x138')](db[_0x9b9d('0x183')],{'as':_0x9b9d('0x183'),'foreignKey':_0x9b9d('0x195')});db[_0x9b9d('0x18d')][_0x9b9d('0x138')](db[_0x9b9d('0x4e')],{'as':_0x9b9d('0x17d'),'foreignKey':_0x9b9d('0x191')});db[_0x9b9d('0x54')]['belongsToMany'](db[_0x9b9d('0x12d')],{'as':_0x9b9d('0x168'),'through':_0x9b9d('0x14d')});db[_0x9b9d('0x54')][_0x9b9d('0x13d')](db[_0x9b9d('0xe7')],{'through':_0x9b9d('0x196'),'as':_0x9b9d('0x169')});db[_0x9b9d('0x55')][_0x9b9d('0x138')](db[_0x9b9d('0x4e')],{});db['FaxQueueReport'][_0x9b9d('0x138')](db['CmList'],{'as':_0x9b9d('0x178'),'foreignKey':'ListId'});db[_0x9b9d('0x55')]['belongsTo'](db[_0x9b9d('0x7a')],{'as':_0x9b9d('0x17e'),'foreignKey':_0x9b9d('0x172')});db[_0x9b9d('0x55')][_0x9b9d('0x138')](db[_0x9b9d('0x51')],{});db[_0x9b9d('0x55')]['belongsTo'](db[_0x9b9d('0x18d')],{});db['FaxQueueReport']['belongsTo'](db[_0x9b9d('0x12d')],{});db[_0x9b9d('0x55')][_0x9b9d('0x138')](db[_0x9b9d('0x54')],{});db[_0x9b9d('0x56')]['hasMany'](db[_0x9b9d('0x88')],{'as':'Dispositions','foreignKey':'SmsAccountId'});db[_0x9b9d('0x56')][_0x9b9d('0x12e')](db['CannedAnswer'],{'as':_0x9b9d('0x177'),'foreignKey':_0x9b9d('0x197')});db['SmsAccount'][_0x9b9d('0x12e')](db['SmsMessage'],{'as':_0x9b9d('0x16d'),'foreignKey':_0x9b9d('0x197')});db[_0x9b9d('0x56')]['hasMany'](db[_0x9b9d('0x5a')],{'as':_0x9b9d('0x18a')});db['SmsAccount'][_0x9b9d('0x12e')](db[_0x9b9d('0x58')],{'as':_0x9b9d('0x18b')});db[_0x9b9d('0x56')][_0x9b9d('0x138')](db[_0x9b9d('0x150')],{'as':'List','foreignKey':_0x9b9d('0x179')});db[_0x9b9d('0x56')][_0x9b9d('0x138')](db[_0x9b9d('0x8d')],{'as':_0x9b9d('0x18e'),'foreignKey':_0x9b9d('0x167')});db['SmsAccount'][_0x9b9d('0x13d')](db[_0x9b9d('0x12d')],{'as':'Agents','through':_0x9b9d('0x198')});db[_0x9b9d('0x58')][_0x9b9d('0x138')](db[_0x9b9d('0x12d')],{'onDelete':_0x9b9d('0x186')});db[_0x9b9d('0x58')][_0x9b9d('0x138')](db[_0x9b9d('0x5e')],{'onDelete':_0x9b9d('0x186')});db['SmsApplication'][_0x9b9d('0x138')](db[_0x9b9d('0x56')],{'onDelete':_0x9b9d('0x186')});db[_0x9b9d('0x58')][_0x9b9d('0x138')](db[_0x9b9d('0x8b')],{'onDelete':'restrict','foreignKey':_0x9b9d('0x187')});db[_0x9b9d('0x58')][_0x9b9d('0x138')](db[_0x9b9d('0x94')],{'onDelete':_0x9b9d('0x186'),'foreignKey':_0x9b9d('0x188')});db[_0x9b9d('0x5a')][_0x9b9d('0x12e')](db[_0x9b9d('0x5c')],{'as':_0x9b9d('0x16d'),'onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x199')});db['SmsInteraction'][_0x9b9d('0x138')](db[_0x9b9d('0x56')],{'as':_0x9b9d('0x17d'),'foreignKey':_0x9b9d('0x197')});db['SmsInteraction'][_0x9b9d('0x138')](db[_0x9b9d('0x7a')],{'as':_0x9b9d('0x17e'),'foreignKey':'ContactId'});db[_0x9b9d('0x5a')][_0x9b9d('0x138')](db[_0x9b9d('0x12d')],{'as':_0x9b9d('0x17f'),'foreignKey':'UserId'});db['SmsInteraction'][_0x9b9d('0x13d')](db[_0x9b9d('0x94')],{'through':_0x9b9d('0x19a'),'as':_0x9b9d('0x181')});db[_0x9b9d('0x5a')]['belongsToMany'](db[_0x9b9d('0x94')],{'through':_0x9b9d('0x19a'),'as':_0x9b9d('0x193')});db['SmsInteraction'][_0x9b9d('0x13d')](db['User'],{'as':_0x9b9d('0x182'),'through':_0x9b9d('0x147'),'foreignKey':_0x9b9d('0x199')});db[_0x9b9d('0x5c')]['belongsTo'](db['User'],{'as':_0x9b9d('0x12d')});db[_0x9b9d('0x5c')][_0x9b9d('0x138')](db['CmContact'],{'onDelete':_0x9b9d('0x12b'),'as':_0x9b9d('0x17e')});db[_0x9b9d('0x5c')][_0x9b9d('0x138')](db['SmsInteraction'],{'onDelete':_0x9b9d('0x12b'),'as':'Interaction','foreignKey':_0x9b9d('0x199')});db[_0x9b9d('0x5c')]['belongsTo'](db[_0x9b9d('0x56')],{'as':'Account','foreignKey':'SmsAccountId'});db[_0x9b9d('0x5e')][_0x9b9d('0x13d')](db[_0x9b9d('0x12d')],{'as':_0x9b9d('0x168'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db[_0x9b9d('0x5e')]['belongsToMany'](db[_0x9b9d('0xe7')],{'through':_0x9b9d('0x19b'),'as':_0x9b9d('0x169')});db[_0x9b9d('0x60')][_0x9b9d('0x12e')](db[_0x9b9d('0x88')],{'as':_0x9b9d('0x176'),'foreignKey':_0x9b9d('0x19c')});db['OpenchannelAccount'][_0x9b9d('0x12e')](db[_0x9b9d('0x86')],{'as':_0x9b9d('0x177'),'foreignKey':_0x9b9d('0x19c')});db[_0x9b9d('0x60')]['hasMany'](db[_0x9b9d('0x64')],{'as':_0x9b9d('0x18a'),'foreignKey':_0x9b9d('0x19c')});db[_0x9b9d('0x60')][_0x9b9d('0x12e')](db[_0x9b9d('0x66')],{'as':_0x9b9d('0x16d'),'foreignKey':_0x9b9d('0x19c')});db[_0x9b9d('0x60')]['hasMany'](db[_0x9b9d('0x62')],{'as':_0x9b9d('0x18b'),'foreignKey':_0x9b9d('0x19c')});db[_0x9b9d('0x60')][_0x9b9d('0x138')](db[_0x9b9d('0x150')],{'as':_0x9b9d('0x178'),'foreignKey':_0x9b9d('0x179')});db['OpenchannelAccount'][_0x9b9d('0x138')](db[_0x9b9d('0x8d')],{'as':'mandatoryDispositionPause','foreignKey':_0x9b9d('0x167')});db[_0x9b9d('0x60')][_0x9b9d('0x13d')](db[_0x9b9d('0x12d')],{'as':_0x9b9d('0x168'),'through':'user_has_openchannel_accounts'});db[_0x9b9d('0x62')][_0x9b9d('0x138')](db[_0x9b9d('0x12d')],{'onDelete':'restrict'});db['OpenchannelApplication'][_0x9b9d('0x138')](db[_0x9b9d('0x68')],{'onDelete':_0x9b9d('0x186'),'foreignKey':'OpenchannelQueueId'});db[_0x9b9d('0x62')]['belongsTo'](db[_0x9b9d('0x60')],{'onDelete':_0x9b9d('0x186'),'foreignKey':_0x9b9d('0x19c')});db[_0x9b9d('0x62')][_0x9b9d('0x138')](db[_0x9b9d('0x8b')],{'onDelete':_0x9b9d('0x186'),'foreignKey':_0x9b9d('0x187')});db['OpenchannelApplication'][_0x9b9d('0x138')](db[_0x9b9d('0x94')],{'onDelete':'restrict','foreignKey':_0x9b9d('0x188')});db[_0x9b9d('0x64')][_0x9b9d('0x12e')](db[_0x9b9d('0x66')],{'as':_0x9b9d('0x16d'),'onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x19d')});db[_0x9b9d('0x64')]['belongsTo'](db[_0x9b9d('0x60')],{'as':'Account','foreignKey':_0x9b9d('0x19c')});db[_0x9b9d('0x64')]['belongsTo'](db[_0x9b9d('0x7a')],{'as':_0x9b9d('0x17e'),'foreignKey':'ContactId'});db[_0x9b9d('0x64')]['belongsTo'](db[_0x9b9d('0x12d')],{'as':_0x9b9d('0x17f'),'foreignKey':_0x9b9d('0x12c')});db['OpenchannelInteraction'][_0x9b9d('0x13d')](db[_0x9b9d('0x94')],{'through':_0x9b9d('0x19e'),'as':_0x9b9d('0x181')});db['OpenchannelInteraction'][_0x9b9d('0x13d')](db[_0x9b9d('0x94')],{'through':_0x9b9d('0x19e'),'as':_0x9b9d('0x193')});db['OpenchannelInteraction']['belongsToMany'](db[_0x9b9d('0x12d')],{'as':_0x9b9d('0x182'),'through':'user_has_openchannel_interactions','foreignKey':_0x9b9d('0x19d')});db['OpenchannelMessage'][_0x9b9d('0x138')](db[_0x9b9d('0x12d')],{'onDelete':'cascade','as':_0x9b9d('0x12d')});db['OpenchannelMessage']['belongsTo'](db[_0x9b9d('0x7a')],{'onDelete':_0x9b9d('0x12b'),'as':_0x9b9d('0x17e')});db['OpenchannelMessage'][_0x9b9d('0x138')](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0x9b9d('0x185'),'foreignKey':_0x9b9d('0x19d')});db['OpenchannelMessage']['belongsTo'](db[_0x9b9d('0x183')],{'as':_0x9b9d('0x183'),'foreignKey':_0x9b9d('0x195')});db['OpenchannelMessage'][_0x9b9d('0x138')](db[_0x9b9d('0x60')],{'as':_0x9b9d('0x17d'),'foreignKey':_0x9b9d('0x19c')});db[_0x9b9d('0x68')][_0x9b9d('0x13d')](db[_0x9b9d('0x12d')],{'as':_0x9b9d('0x168'),'through':_0x9b9d('0x3a'),'foreignKey':_0x9b9d('0x19f')});db[_0x9b9d('0x68')][_0x9b9d('0x13d')](db[_0x9b9d('0xe7')],{'through':'team_has_openchannel_queues','as':'Teams'});db[_0x9b9d('0x69')][_0x9b9d('0x12e')](db[_0x9b9d('0x88')],{'as':_0x9b9d('0x176'),'foreignKey':_0x9b9d('0x1a0')});db[_0x9b9d('0x69')][_0x9b9d('0x12e')](db[_0x9b9d('0x86')],{'as':_0x9b9d('0x177'),'foreignKey':'ChatWebsiteId'});db[_0x9b9d('0x69')][_0x9b9d('0x12e')](db['ChatProactiveAction'],{'as':'ProactiveActions'});db[_0x9b9d('0x69')][_0x9b9d('0x12e')](db[_0x9b9d('0x135')],{'as':_0x9b9d('0x18a')});db[_0x9b9d('0x69')][_0x9b9d('0x12e')](db[_0x9b9d('0x6d')],{'as':_0x9b9d('0x18b')});db['ChatWebsite'][_0x9b9d('0x12e')](db[_0x9b9d('0x1a1')],{'as':_0x9b9d('0x16d')});db['ChatWebsite'][_0x9b9d('0x138')](db[_0x9b9d('0x150')],{'as':_0x9b9d('0x178'),'foreignKey':_0x9b9d('0x179')});db[_0x9b9d('0x69')]['belongsTo'](db[_0x9b9d('0x8b')],{'as':'Interval','foreignKey':_0x9b9d('0x187')});db['ChatWebsite'][_0x9b9d('0x138')](db['Pause'],{'as':_0x9b9d('0x18e'),'foreignKey':_0x9b9d('0x167')});db['ChatWebsite'][_0x9b9d('0x13d')](db[_0x9b9d('0x12d')],{'as':_0x9b9d('0x168'),'through':_0x9b9d('0x154')});db['OpenchannelQueueReport'][_0x9b9d('0x138')](db[_0x9b9d('0x60')],{});db[_0x9b9d('0x6b')][_0x9b9d('0x138')](db[_0x9b9d('0x150')],{'as':'List','foreignKey':'ListId'});db[_0x9b9d('0x6b')]['belongsTo'](db[_0x9b9d('0x7a')],{'as':_0x9b9d('0x17e'),'foreignKey':_0x9b9d('0x172')});db[_0x9b9d('0x6b')][_0x9b9d('0x138')](db[_0x9b9d('0x64')],{});db[_0x9b9d('0x6b')][_0x9b9d('0x138')](db[_0x9b9d('0x66')],{});db['OpenchannelQueueReport'][_0x9b9d('0x138')](db[_0x9b9d('0x12d')],{});db['OpenchannelQueueReport'][_0x9b9d('0x138')](db[_0x9b9d('0x68')],{});db[_0x9b9d('0x6d')]['belongsTo'](db[_0x9b9d('0x12d')],{'as':'Agent','foreignKey':_0x9b9d('0x12c'),'onDelete':_0x9b9d('0x186')});db[_0x9b9d('0x6d')][_0x9b9d('0x138')](db[_0x9b9d('0x73')],{'as':'Queue','foreignKey':_0x9b9d('0x1a2'),'onDelete':'restrict'});db['ChatApplication'][_0x9b9d('0x138')](db[_0x9b9d('0x69')],{'as':'Website','foreignKey':_0x9b9d('0x1a0'),'onDelete':'restrict'});db[_0x9b9d('0x6d')]['belongsTo'](db[_0x9b9d('0x94')],{'onDelete':_0x9b9d('0x186'),'foreignKey':'TagId'});db[_0x9b9d('0x135')][_0x9b9d('0x12e')](db[_0x9b9d('0x1a1')],{'as':_0x9b9d('0x16d'),'onDelete':_0x9b9d('0x12b'),'foreignKey':'ChatInteractionId'});db[_0x9b9d('0x135')][_0x9b9d('0x138')](db[_0x9b9d('0x69')],{'as':_0x9b9d('0x17d'),'foreignKey':'ChatWebsiteId'});db[_0x9b9d('0x135')][_0x9b9d('0x138')](db[_0x9b9d('0x7a')],{'as':_0x9b9d('0x17e'),'foreignKey':_0x9b9d('0x172')});db['ChatInteraction'][_0x9b9d('0x138')](db[_0x9b9d('0x12d')],{'as':_0x9b9d('0x17f'),'foreignKey':_0x9b9d('0x12c')});db[_0x9b9d('0x135')][_0x9b9d('0x13d')](db[_0x9b9d('0x94')],{'through':'chat_interaction_has_tags','as':_0x9b9d('0x181')});db[_0x9b9d('0x135')]['belongsToMany'](db[_0x9b9d('0x94')],{'through':_0x9b9d('0x1a3'),'as':'ThroughTags'});db[_0x9b9d('0x135')]['belongsToMany'](db['User'],{'as':_0x9b9d('0x182'),'through':'user_has_chat_interactions','foreignKey':'ChatInteractionId'});db['ChatMessage']['belongsTo'](db[_0x9b9d('0x12d')],{'onDelete':'cascade','as':'User'});db[_0x9b9d('0x1a1')][_0x9b9d('0x138')](db['CmContact'],{'onDelete':'cascade','as':'Contact','foreignKey':'ContactId'});db[_0x9b9d('0x1a1')][_0x9b9d('0x138')](db[_0x9b9d('0x135')],{'onDelete':_0x9b9d('0x12b'),'as':_0x9b9d('0x185'),'foreignKey':_0x9b9d('0x1a4')});db[_0x9b9d('0x1a1')][_0x9b9d('0x138')](db[_0x9b9d('0x183')],{'as':_0x9b9d('0x183'),'foreignKey':'AttachmentId'});db['ChatMessage']['belongsTo'](db[_0x9b9d('0x69')],{'as':_0x9b9d('0x17d'),'foreignKey':_0x9b9d('0x1a0')});db[_0x9b9d('0x71')]['belongsTo'](db[_0x9b9d('0x7a')],{'onDelete':_0x9b9d('0x12b'),'as':'Contact','foreignKey':_0x9b9d('0x172')});db[_0x9b9d('0x71')][_0x9b9d('0x138')](db[_0x9b9d('0x69')],{'as':_0x9b9d('0x17d'),'foreignKey':_0x9b9d('0x1a0')});db[_0x9b9d('0x73')][_0x9b9d('0x13d')](db['User'],{'as':'Agents','through':_0x9b9d('0x34'),'hooks':!![]});db['ChatQueue'][_0x9b9d('0x13d')](db[_0x9b9d('0xe7')],{'through':_0x9b9d('0x1a5'),'as':'Teams'});db[_0x9b9d('0x75')][_0x9b9d('0x12e')](db[_0x9b9d('0xd6')],{'as':_0x9b9d('0x16d'),'foreignKey':_0x9b9d('0x1a6'),'onDelete':_0x9b9d('0x12b')});db[_0x9b9d('0x75')]['belongsToMany'](db[_0x9b9d('0x12d')],{'as':_0x9b9d('0x1a7'),'through':_0x9b9d('0x13c')});db['ChatProactiveAction']['belongsTo'](db[_0x9b9d('0x69')],{'as':_0x9b9d('0x1a8'),'foreignKey':_0x9b9d('0x1a0')});db[_0x9b9d('0x1a9')][_0x9b9d('0x12a')](db['CmCompany'],{'as':'RelatedCompany'});db[_0x9b9d('0x1a9')]['hasMany'](db[_0x9b9d('0x7a')],{'as':_0x9b9d('0x13e'),'foreignKey':_0x9b9d('0x1aa')});db[_0x9b9d('0x1a9')][_0x9b9d('0x12e')](db[_0x9b9d('0x1ab')],{'as':_0x9b9d('0x1ac'),'foreignKey':_0x9b9d('0x1aa')});db[_0x9b9d('0x1a9')][_0x9b9d('0x12e')](db['SADossier'],{'as':_0x9b9d('0x1ad'),'foreignKey':_0x9b9d('0x1aa')});db[_0x9b9d('0x1a9')][_0x9b9d('0x138')](db['SAPaymentMethod'],{'as':_0x9b9d('0x1ae'),'foreignKey':_0x9b9d('0x1af')});db[_0x9b9d('0x7a')]['hasMany'](db[_0x9b9d('0x1b0')],{'as':'Hoppers','foreignKey':_0x9b9d('0x172')});db['CmContact'][_0x9b9d('0x12e')](db[_0x9b9d('0x7d')],{'as':_0x9b9d('0x132'),'foreignKey':_0x9b9d('0x172')});db[_0x9b9d('0x7a')][_0x9b9d('0x12e')](db['CmHopperHistory'],{'as':_0x9b9d('0x1b1'),'foreignKey':_0x9b9d('0x172')});db[_0x9b9d('0x7a')][_0x9b9d('0x12e')](db[_0x9b9d('0x80')],{'as':_0x9b9d('0x80'),'foreignKey':_0x9b9d('0x172')});db[_0x9b9d('0x7a')][_0x9b9d('0x12e')](db[_0x9b9d('0xda')],{'as':_0x9b9d('0x163'),'foreignKey':_0x9b9d('0x172')});db['CmContact'][_0x9b9d('0x12e')](db['OpenchannelInteraction'],{'as':_0x9b9d('0x134'),'foreignKey':_0x9b9d('0x172'),'onDelete':_0x9b9d('0x186')});db['CmContact'][_0x9b9d('0x12e')](db[_0x9b9d('0x135')],{'as':_0x9b9d('0x136'),'foreignKey':_0x9b9d('0x172'),'onDelete':_0x9b9d('0x186')});db['CmContact'][_0x9b9d('0x12e')](db[_0x9b9d('0x5a')],{'as':_0x9b9d('0x146'),'foreignKey':_0x9b9d('0x172'),'onDelete':_0x9b9d('0x186')});db[_0x9b9d('0x7a')][_0x9b9d('0x12e')](db[_0x9b9d('0x51')],{'as':_0x9b9d('0x137'),'foreignKey':'ContactId','onDelete':_0x9b9d('0x186')});db['CmContact'][_0x9b9d('0x12e')](db[_0x9b9d('0x44')],{'as':'MailInteractions','foreignKey':_0x9b9d('0x172'),'onDelete':'restrict'});db[_0x9b9d('0x7a')][_0x9b9d('0x12e')](db[_0x9b9d('0x1b2')],{'as':_0x9b9d('0x17e'),'foreignKey':_0x9b9d('0x172'),'onDelete':_0x9b9d('0x186')});db[_0x9b9d('0x7a')][_0x9b9d('0x138')](db[_0x9b9d('0x1a9')],{'as':_0x9b9d('0x1b3'),'foreignKey':_0x9b9d('0x1aa')});db[_0x9b9d('0x7a')][_0x9b9d('0x138')](db[_0x9b9d('0x150')],{'as':_0x9b9d('0x178'),'foreignKey':_0x9b9d('0x179'),'onDelete':'cascade'});db[_0x9b9d('0x7a')][_0x9b9d('0x13d')](db[_0x9b9d('0x12d')],{'as':_0x9b9d('0x182'),'through':_0x9b9d('0x13f')});db['CmContact'][_0x9b9d('0x13d')](db[_0x9b9d('0x94')],{'as':_0x9b9d('0x181'),'through':'cm_contact_has_tags'});db[_0x9b9d('0x7a')]['belongsToMany'](db[_0x9b9d('0x94')],{'through':'cm_contact_has_tags','as':_0x9b9d('0x193')});db[_0x9b9d('0x1b0')][_0x9b9d('0x138')](db[_0x9b9d('0x7a')],{'as':'Contact','foreignKey':_0x9b9d('0x172'),'onDelete':'cascade'});db[_0x9b9d('0x1b0')][_0x9b9d('0x138')](db['CmList'],{'as':_0x9b9d('0x178'),'foreignKey':_0x9b9d('0x179'),'onDelete':_0x9b9d('0x12b')});db[_0x9b9d('0x1b0')][_0x9b9d('0x138')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x9b9d('0x1b0')][_0x9b9d('0x138')](db['VoiceQueue'],{'as':_0x9b9d('0x1b4'),'foreignKey':_0x9b9d('0x160'),'onDelete':_0x9b9d('0x12b')});db[_0x9b9d('0x1b0')][_0x9b9d('0x138')](db[_0x9b9d('0xeb')],{'as':_0x9b9d('0xeb'),'foreignKey':'CampaignId','onDelete':_0x9b9d('0x12b')});db[_0x9b9d('0x1b0')][_0x9b9d('0x138')](db[_0x9b9d('0x12d')],{'as':_0x9b9d('0x17f'),'foreignKey':_0x9b9d('0x1b5')});db[_0x9b9d('0x161')][_0x9b9d('0x138')](db[_0x9b9d('0x7a')],{'as':_0x9b9d('0x17e'),'foreignKey':_0x9b9d('0x172'),'onDelete':_0x9b9d('0x12b')});db[_0x9b9d('0x161')][_0x9b9d('0x138')](db[_0x9b9d('0x150')],{'as':_0x9b9d('0x178'),'foreignKey':_0x9b9d('0x179'),'onDelete':_0x9b9d('0x12b')});db[_0x9b9d('0x161')][_0x9b9d('0x138')](db['VoiceQueue'],{'as':_0x9b9d('0x1b4'),'foreignKey':_0x9b9d('0x160'),'onDelete':'cascade'});db[_0x9b9d('0x161')][_0x9b9d('0x138')](db[_0x9b9d('0xeb')],{'as':_0x9b9d('0xeb'),'foreignKey':_0x9b9d('0x1b6'),'onDelete':_0x9b9d('0x12b')});db['Automation']['hasMany'](db[_0x9b9d('0x1b7')],{'as':{'plural':_0x9b9d('0x1b8'),'singular':_0x9b9d('0x1b9')},'foreignKey':'AutomationAllId','onDelete':_0x9b9d('0x12b'),'hooks':!![]});db['Automation'][_0x9b9d('0x12e')](db[_0x9b9d('0x1b7')],{'as':{'plural':_0x9b9d('0x1ba'),'singular':_0x9b9d('0x1bb')},'foreignKey':_0x9b9d('0x1bc'),'onDelete':_0x9b9d('0x12b'),'hooks':!![]});db[_0x9b9d('0x84')]['hasMany'](db[_0x9b9d('0x1bd')],{'as':'Actions','foreignKey':_0x9b9d('0x1be'),'onDelete':_0x9b9d('0x12b'),'hooks':!![]});db[_0x9b9d('0x8b')][_0x9b9d('0x12e')](db[_0x9b9d('0x8b')],{'as':_0x9b9d('0x1bf'),'foreignKey':_0x9b9d('0x187'),'onDelete':_0x9b9d('0x12b'),'hooks':!![],'required':![]});db['Interval'][_0x9b9d('0x12e')](db[_0x9b9d('0x19')],{'as':_0x9b9d('0x131'),'foreignKey':_0x9b9d('0x187'),'onDelete':'restrict'});db['Interval'][_0x9b9d('0x12e')](db[_0x9b9d('0x48')],{'as':_0x9b9d('0x1c0'),'foreignKey':_0x9b9d('0x187')});db[_0x9b9d('0x8b')]['hasMany'](db[_0x9b9d('0x6d')],{'as':'ChatApplications','foreignKey':_0x9b9d('0x187')});db[_0x9b9d('0x8b')][_0x9b9d('0x12e')](db[_0x9b9d('0x50')],{'as':'FaxApplications','foreignKey':_0x9b9d('0x187')});db[_0x9b9d('0x8b')][_0x9b9d('0x12e')](db[_0x9b9d('0x58')],{'as':_0x9b9d('0x1c1'),'foreignKey':_0x9b9d('0x187')});db['Schedule'][_0x9b9d('0x138')](db[_0x9b9d('0x3e')],{});db['Schedule']['belongsTo'](db[_0x9b9d('0xa0')],{'foreignKey':_0x9b9d('0x1c2')});db['Schedule'][_0x9b9d('0x138')](db['AnalyticCustomReport'],{'foreignKey':'CustomReportId'});db['Sound']['belongsToMany'](db[_0x9b9d('0x1b')],{'as':'Mohs','through':_0x9b9d('0x15e'),'onDelete':_0x9b9d('0x186')});db[_0x9b9d('0x94')][_0x9b9d('0x13d')](db[_0x9b9d('0x7a')],{'through':_0x9b9d('0x1c3')});db[_0x9b9d('0x94')][_0x9b9d('0x13d')](db[_0x9b9d('0x135')],{'through':_0x9b9d('0x1a3')});db[_0x9b9d('0x94')]['belongsToMany'](db['MailInteraction'],{'through':_0x9b9d('0x180')});db[_0x9b9d('0x94')][_0x9b9d('0x13d')](db[_0x9b9d('0x5a')],{'through':'sms_interaction_has_tags'});db['Tag']['belongsToMany'](db['FaxInteraction'],{'through':_0x9b9d('0x192')});db[_0x9b9d('0x94')][_0x9b9d('0x13d')](db[_0x9b9d('0x64')],{'through':_0x9b9d('0x19e')});db[_0x9b9d('0x1c4')][_0x9b9d('0x12e')](db[_0x9b9d('0x1b7')],{'as':{'plural':_0x9b9d('0x1c5'),'singular':'AllCondition'},'foreignKey':_0x9b9d('0x1c6'),'onDelete':'cascade','hooks':!![]});db['Trigger'][_0x9b9d('0x12e')](db[_0x9b9d('0x1b7')],{'as':{'plural':_0x9b9d('0x1c7'),'singular':_0x9b9d('0x1c8')},'foreignKey':'TriggerAnyId','onDelete':_0x9b9d('0x12b'),'hooks':!![]});db['Trigger'][_0x9b9d('0x12e')](db[_0x9b9d('0x1bd')],{'as':'Actions','foreignKey':_0x9b9d('0x1c9'),'onDelete':_0x9b9d('0x12b'),'hooks':!![]});db['AnalyticCustomReport'][_0x9b9d('0x12e')](db[_0x9b9d('0xa6')],{'as':_0x9b9d('0x1ca'),'onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x1cb'),'hooks':!![]});db[_0x9b9d('0xa0')][_0x9b9d('0x12e')](db[_0x9b9d('0xa6')],{'as':_0x9b9d('0x1ca'),'onDelete':'cascade','foreignKey':_0x9b9d('0x1c2')});db[_0x9b9d('0xa4')][_0x9b9d('0x12e')](db[_0x9b9d('0xa6')],{'as':_0x9b9d('0x1ca'),'onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x1cc')});db['AnalyticFieldReport'][_0x9b9d('0x138')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0x9b9d('0xa8')][_0x9b9d('0x12e')](db['SalesforceConfiguration'],{'as':_0x9b9d('0x1cd'),'onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x1ce')});db[_0x9b9d('0xaa')][_0x9b9d('0x12e')](db[_0x9b9d('0x1cf')],{'as':_0x9b9d('0x1d0'),'onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x1d1')});db['SalesforceConfiguration']['hasMany'](db['SalesforceField'],{'as':_0x9b9d('0x1d2'),'onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x1d3')});db[_0x9b9d('0xaa')][_0x9b9d('0x12e')](db[_0x9b9d('0x1cf')],{'as':_0x9b9d('0x1ca'),'onDelete':'cascade','foreignKey':_0x9b9d('0x1d4')});db[_0x9b9d('0xaa')][_0x9b9d('0x138')](db[_0x9b9d('0xa8')],{'as':_0x9b9d('0x17d'),'foreignKey':_0x9b9d('0x1ce')});db[_0x9b9d('0x1cf')][_0x9b9d('0x12e')](db[_0x9b9d('0x1cf')],{'as':'Subject','foreignKey':_0x9b9d('0x1d1')});db[_0x9b9d('0x1cf')][_0x9b9d('0x12e')](db['SalesforceField'],{'as':'Description','foreignKey':_0x9b9d('0x1d3')});db['SalesforceField'][_0x9b9d('0x12e')](db[_0x9b9d('0x1cf')],{'as':'Field','foreignKey':_0x9b9d('0x1d4')});db['SalesforceField'][_0x9b9d('0x138')](db[_0x9b9d('0x99')],{'as':_0x9b9d('0x99'),'foreignKey':'VariableId'});db[_0x9b9d('0xad')][_0x9b9d('0x12e')](db[_0x9b9d('0xae')],{'as':_0x9b9d('0x1cd'),'onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x1ce')});db[_0x9b9d('0xae')][_0x9b9d('0x12e')](db[_0x9b9d('0xb0')],{'as':_0x9b9d('0x1d0'),'onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x1d1')});db['SugarcrmConfiguration'][_0x9b9d('0x12e')](db[_0x9b9d('0xb0')],{'as':_0x9b9d('0x1d2'),'onDelete':'cascade','foreignKey':_0x9b9d('0x1d3')});db[_0x9b9d('0xae')][_0x9b9d('0x12e')](db['SugarcrmField'],{'as':_0x9b9d('0x1ca'),'onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x1d4')});db[_0x9b9d('0xae')][_0x9b9d('0x138')](db[_0x9b9d('0xad')],{'as':'Account','foreignKey':_0x9b9d('0x1ce')});db[_0x9b9d('0xb0')][_0x9b9d('0x12e')](db[_0x9b9d('0xb0')],{'as':_0x9b9d('0x1d5'),'foreignKey':_0x9b9d('0x1d1')});db['SugarcrmField'][_0x9b9d('0x12e')](db[_0x9b9d('0xb0')],{'as':'Description','foreignKey':_0x9b9d('0x1d3')});db[_0x9b9d('0xb0')][_0x9b9d('0x12e')](db[_0x9b9d('0xb0')],{'as':_0x9b9d('0x1d6'),'foreignKey':_0x9b9d('0x1d4')});db[_0x9b9d('0xb0')][_0x9b9d('0x138')](db['Variable'],{'as':'Variable','foreignKey':_0x9b9d('0x1d7')});db[_0x9b9d('0xb2')][_0x9b9d('0x12e')](db[_0x9b9d('0xb4')],{'as':'Configurations','onDelete':_0x9b9d('0x12b'),'foreignKey':'AccountId'});db[_0x9b9d('0xb4')][_0x9b9d('0x12e')](db[_0x9b9d('0x1d8')],{'as':_0x9b9d('0x1d0'),'onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x1d1')});db[_0x9b9d('0xb4')][_0x9b9d('0x12e')](db[_0x9b9d('0x1d8')],{'as':_0x9b9d('0x1d2'),'onDelete':'cascade','foreignKey':_0x9b9d('0x1d3')});db[_0x9b9d('0xb4')][_0x9b9d('0x12e')](db[_0x9b9d('0x1d8')],{'as':_0x9b9d('0x1ca'),'onDelete':_0x9b9d('0x12b'),'foreignKey':'FieldId'});db[_0x9b9d('0xb4')][_0x9b9d('0x138')](db['DeskAccount'],{'as':_0x9b9d('0x17d'),'foreignKey':_0x9b9d('0x1ce')});db['DeskConfiguration'][_0x9b9d('0x13d')](db[_0x9b9d('0x94')],{'through':_0x9b9d('0x1d9')});db[_0x9b9d('0x1d8')][_0x9b9d('0x12e')](db['DeskField'],{'as':_0x9b9d('0x1d5'),'foreignKey':_0x9b9d('0x1d1')});db[_0x9b9d('0x1d8')]['hasMany'](db[_0x9b9d('0x1d8')],{'as':_0x9b9d('0x1da'),'foreignKey':_0x9b9d('0x1d3')});db['DeskField']['hasMany'](db[_0x9b9d('0x1d8')],{'as':_0x9b9d('0x1d6'),'foreignKey':_0x9b9d('0x1d4')});db[_0x9b9d('0x1d8')][_0x9b9d('0x138')](db['Variable'],{'as':_0x9b9d('0x99'),'foreignKey':_0x9b9d('0x1d7')});db['ZohoAccount'][_0x9b9d('0x12e')](db[_0x9b9d('0xb9')],{'as':_0x9b9d('0x1cd'),'onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x1ce')});db['ZohoConfiguration']['hasMany'](db[_0x9b9d('0x1db')],{'as':_0x9b9d('0x1d0'),'onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x1d1')});db[_0x9b9d('0xb9')][_0x9b9d('0x12e')](db[_0x9b9d('0x1db')],{'as':'Descriptions','onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x1d3')});db[_0x9b9d('0xb9')][_0x9b9d('0x12e')](db[_0x9b9d('0x1db')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x9b9d('0x1d4')});db[_0x9b9d('0xb9')][_0x9b9d('0x138')](db[_0x9b9d('0xb7')],{'as':_0x9b9d('0x17d'),'foreignKey':_0x9b9d('0x1ce')});db[_0x9b9d('0x1db')][_0x9b9d('0x12e')](db['ZohoField'],{'as':_0x9b9d('0x1d5'),'foreignKey':_0x9b9d('0x1d1')});db[_0x9b9d('0x1db')][_0x9b9d('0x12e')](db[_0x9b9d('0x1db')],{'as':_0x9b9d('0x1da'),'foreignKey':_0x9b9d('0x1d3')});db[_0x9b9d('0x1db')][_0x9b9d('0x12e')](db[_0x9b9d('0x1db')],{'as':_0x9b9d('0x1d6'),'foreignKey':_0x9b9d('0x1d4')});db[_0x9b9d('0x1db')][_0x9b9d('0x138')](db['Variable'],{'as':_0x9b9d('0x99'),'foreignKey':'VariableId'});db[_0x9b9d('0x1dc')][_0x9b9d('0x12e')](db[_0x9b9d('0xbd')],{'as':_0x9b9d('0x1cd'),'onDelete':_0x9b9d('0x12b'),'foreignKey':'AccountId'});db[_0x9b9d('0xbd')]['hasMany'](db[_0x9b9d('0x1dd')],{'as':'Subjects','foreignKey':_0x9b9d('0x1d1')});db[_0x9b9d('0xbd')]['hasMany'](db[_0x9b9d('0x1dd')],{'as':_0x9b9d('0x1d2'),'foreignKey':_0x9b9d('0x1d3')});db[_0x9b9d('0xbd')][_0x9b9d('0x12e')](db[_0x9b9d('0x1dd')],{'as':_0x9b9d('0x1ca'),'foreignKey':_0x9b9d('0x1d4')});db[_0x9b9d('0xbd')]['belongsTo'](db[_0x9b9d('0x1dc')],{'as':_0x9b9d('0x17d'),'foreignKey':'AccountId'});db[_0x9b9d('0xbd')]['belongsToMany'](db[_0x9b9d('0x94')],{'through':_0x9b9d('0x1de')});db[_0x9b9d('0x1dd')][_0x9b9d('0x12e')](db[_0x9b9d('0x1dd')],{'as':_0x9b9d('0x1d5'),'foreignKey':_0x9b9d('0x1d1')});db[_0x9b9d('0x1dd')]['hasMany'](db[_0x9b9d('0x1dd')],{'as':_0x9b9d('0x1da'),'foreignKey':_0x9b9d('0x1d3')});db['ZendeskField'][_0x9b9d('0x12e')](db['ZendeskField'],{'as':'Field','foreignKey':'FieldId'});db[_0x9b9d('0x1dd')][_0x9b9d('0x138')](db[_0x9b9d('0x99')],{'as':_0x9b9d('0x99'),'foreignKey':'VariableId'});db[_0x9b9d('0xc0')]['hasMany'](db['FreshdeskConfiguration'],{'as':_0x9b9d('0x1cd'),'onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x1ce')});db[_0x9b9d('0xc2')][_0x9b9d('0x12e')](db[_0x9b9d('0xc4')],{'as':_0x9b9d('0x1d0'),'onDelete':'cascade','foreignKey':_0x9b9d('0x1d1')});db[_0x9b9d('0xc2')]['hasMany'](db['FreshdeskField'],{'as':_0x9b9d('0x1d2'),'onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x1d3')});db['FreshdeskConfiguration'][_0x9b9d('0x12e')](db[_0x9b9d('0xc4')],{'as':_0x9b9d('0x1ca'),'onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x1d4')});db['FreshdeskConfiguration'][_0x9b9d('0x138')](db[_0x9b9d('0xc0')],{'as':_0x9b9d('0x17d'),'foreignKey':_0x9b9d('0x1ce')});db['FreshdeskConfiguration'][_0x9b9d('0x13d')](db[_0x9b9d('0x94')],{'through':_0x9b9d('0x1df')});db['FreshdeskField'][_0x9b9d('0x12e')](db[_0x9b9d('0xc4')],{'as':_0x9b9d('0x1d5'),'foreignKey':_0x9b9d('0x1d1')});db[_0x9b9d('0xc4')][_0x9b9d('0x12e')](db[_0x9b9d('0xc4')],{'as':'Description','foreignKey':_0x9b9d('0x1d3')});db[_0x9b9d('0xc4')][_0x9b9d('0x12e')](db[_0x9b9d('0xc4')],{'as':_0x9b9d('0x1d6'),'foreignKey':_0x9b9d('0x1d4')});db[_0x9b9d('0xc4')][_0x9b9d('0x138')](db[_0x9b9d('0x99')],{'as':_0x9b9d('0x99'),'foreignKey':_0x9b9d('0x1d7')});db[_0x9b9d('0xc6')][_0x9b9d('0x12e')](db[_0x9b9d('0x1e0')],{'as':_0x9b9d('0x1cd'),'onDelete':'cascade','foreignKey':_0x9b9d('0x1ce')});db[_0x9b9d('0x1e0')][_0x9b9d('0x12e')](db[_0x9b9d('0xc8')],{'as':_0x9b9d('0x1d0'),'foreignKey':_0x9b9d('0x1d1')});db['VtigerConfiguration'][_0x9b9d('0x12e')](db[_0x9b9d('0xc8')],{'as':_0x9b9d('0x1d2'),'foreignKey':_0x9b9d('0x1d3')});db[_0x9b9d('0x1e0')][_0x9b9d('0x12e')](db[_0x9b9d('0xc8')],{'as':_0x9b9d('0x1ca'),'foreignKey':'FieldId'});db[_0x9b9d('0x1e0')][_0x9b9d('0x138')](db[_0x9b9d('0xc6')],{'as':_0x9b9d('0x17d'),'foreignKey':_0x9b9d('0x1ce')});db[_0x9b9d('0x1e0')][_0x9b9d('0x13d')](db[_0x9b9d('0x94')],{'through':'int_vtiger_configuration_has_tags'});db['VtigerField'][_0x9b9d('0x12e')](db[_0x9b9d('0xc8')],{'as':'Subject','foreignKey':_0x9b9d('0x1d1')});db['VtigerField'][_0x9b9d('0x12e')](db[_0x9b9d('0xc8')],{'as':'Description','foreignKey':_0x9b9d('0x1d3')});db['VtigerField'][_0x9b9d('0x12e')](db[_0x9b9d('0xc8')],{'as':'Field','foreignKey':_0x9b9d('0x1d4')});db[_0x9b9d('0xc8')][_0x9b9d('0x138')](db[_0x9b9d('0x99')],{'as':_0x9b9d('0x99'),'foreignKey':_0x9b9d('0x1d7')});db[_0x9b9d('0xc9')]['hasMany'](db['ServicenowConfiguration'],{'as':_0x9b9d('0x1cd'),'onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x1ce')});db[_0x9b9d('0xca')][_0x9b9d('0x12e')](db['ServicenowField'],{'as':_0x9b9d('0x1d0'),'foreignKey':_0x9b9d('0x1d1')});db[_0x9b9d('0xca')][_0x9b9d('0x12e')](db[_0x9b9d('0xcc')],{'as':'Descriptions','foreignKey':_0x9b9d('0x1d3')});db[_0x9b9d('0xca')][_0x9b9d('0x12e')](db[_0x9b9d('0xcc')],{'as':_0x9b9d('0x1ca'),'foreignKey':_0x9b9d('0x1d4')});db[_0x9b9d('0xca')]['belongsTo'](db['ServicenowAccount'],{'as':_0x9b9d('0x17d'),'foreignKey':_0x9b9d('0x1ce')});db['ServicenowField']['hasMany'](db['ServicenowField'],{'as':_0x9b9d('0x1d5'),'foreignKey':_0x9b9d('0x1d1')});db[_0x9b9d('0xcc')]['hasMany'](db[_0x9b9d('0xcc')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x9b9d('0xcc')][_0x9b9d('0x12e')](db[_0x9b9d('0xcc')],{'as':_0x9b9d('0x1d6'),'foreignKey':_0x9b9d('0x1d4')});db[_0x9b9d('0xcc')][_0x9b9d('0x138')](db[_0x9b9d('0x99')],{'as':_0x9b9d('0x99'),'foreignKey':_0x9b9d('0x1d7')});db[_0x9b9d('0xce')][_0x9b9d('0x12e')](db[_0x9b9d('0xd0')],{'as':_0x9b9d('0x1cd'),'onDelete':_0x9b9d('0x12b'),'foreignKey':'AccountId'});db[_0x9b9d('0xd0')][_0x9b9d('0x12e')](db[_0x9b9d('0xd2')],{'as':_0x9b9d('0x1d0'),'onDelete':'cascade','foreignKey':_0x9b9d('0x1d1')});db[_0x9b9d('0xd0')][_0x9b9d('0x12e')](db[_0x9b9d('0xd2')],{'as':'Descriptions','onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x1d3')});db[_0x9b9d('0xd0')][_0x9b9d('0x12e')](db['Dynamics365Field'],{'as':_0x9b9d('0x1ca'),'onDelete':_0x9b9d('0x12b'),'foreignKey':'FieldId'});db[_0x9b9d('0xd0')][_0x9b9d('0x138')](db[_0x9b9d('0xce')],{'as':_0x9b9d('0x17d'),'foreignKey':'AccountId'});db[_0x9b9d('0xd2')]['hasMany'](db[_0x9b9d('0xd2')],{'as':_0x9b9d('0x1d5'),'foreignKey':'SubjectId'});db[_0x9b9d('0xd2')][_0x9b9d('0x12e')](db[_0x9b9d('0xd2')],{'as':_0x9b9d('0x1da'),'foreignKey':_0x9b9d('0x1d3')});db['Dynamics365Field']['hasMany'](db['Dynamics365Field'],{'as':_0x9b9d('0x1d6'),'foreignKey':'FieldId'});db['Dynamics365Field']['belongsTo'](db[_0x9b9d('0x99')],{'as':'Variable','foreignKey':_0x9b9d('0x1d7')});db['ChatQueueReport'][_0x9b9d('0x138')](db[_0x9b9d('0x69')],{});db[_0x9b9d('0x1e1')][_0x9b9d('0x138')](db[_0x9b9d('0x150')],{'as':_0x9b9d('0x178'),'foreignKey':_0x9b9d('0x179')});db[_0x9b9d('0x1e1')][_0x9b9d('0x138')](db[_0x9b9d('0x7a')],{'as':'Contact','foreignKey':_0x9b9d('0x172')});db[_0x9b9d('0x1e1')][_0x9b9d('0x138')](db[_0x9b9d('0x135')],{});db['ChatQueueReport'][_0x9b9d('0x138')](db[_0x9b9d('0x1a1')],{});db[_0x9b9d('0x1e1')][_0x9b9d('0x138')](db[_0x9b9d('0x12d')],{});db['ChatQueueReport']['belongsTo'](db['ChatQueue'],{});db['ChatInternalMessage'][_0x9b9d('0x138')](db[_0x9b9d('0x12d')],{'onDelete':'cascade','foreignKey':_0x9b9d('0x1e2')});db['ChatInternalMessage'][_0x9b9d('0x138')](db['User'],{'onDelete':'cascade','foreignKey':'ToId'});db[_0x9b9d('0xda')][_0x9b9d('0x12e')](db[_0x9b9d('0xd8')],{'foreignKey':_0x9b9d('0x1e3'),'onDelete':_0x9b9d('0x12b')});db[_0x9b9d('0xda')]['hasMany'](db[_0x9b9d('0xd7')],{'foreignKey':_0x9b9d('0x1e3'),'onDelete':_0x9b9d('0x12b')});db['SmsQueueReport']['belongsTo'](db['SmsAccount'],{});db[_0x9b9d('0xdc')][_0x9b9d('0x138')](db[_0x9b9d('0x150')],{'as':_0x9b9d('0x178'),'foreignKey':'ListId'});db[_0x9b9d('0xdc')][_0x9b9d('0x138')](db['CmContact'],{'as':_0x9b9d('0x17e'),'foreignKey':_0x9b9d('0x172')});db[_0x9b9d('0xdc')][_0x9b9d('0x138')](db['SmsInteraction'],{});db[_0x9b9d('0xdc')][_0x9b9d('0x138')](db[_0x9b9d('0x5c')],{});db[_0x9b9d('0xdc')]['belongsTo'](db['User'],{});db[_0x9b9d('0xdc')][_0x9b9d('0x138')](db[_0x9b9d('0x5e')],{});db[_0x9b9d('0x1e4')][_0x9b9d('0x12e')](db[_0x9b9d('0xda')],{'foreignKey':_0x9b9d('0x1e5')});db['JscriptyProject']['hasMany'](db[_0x9b9d('0xd8')],{'foreignKey':'ProjectId'});db[_0x9b9d('0x1e4')][_0x9b9d('0x12e')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x9b9d('0x159')]['belongsToMany'](db[_0x9b9d('0x12d')],{'as':'Users','through':_0x9b9d('0x15a')});db[_0x9b9d('0xe7')]['belongsToMany'](db['User'],{'as':_0x9b9d('0x168'),'through':'user_has_teams'});db['Team'][_0x9b9d('0x13d')](db[_0x9b9d('0x1d')],{'through':_0x9b9d('0x16a'),'as':_0x9b9d('0x149')});db[_0x9b9d('0xe7')]['belongsToMany'](db[_0x9b9d('0x40')],{'through':_0x9b9d('0x1e6'),'as':_0x9b9d('0x1e7')});db[_0x9b9d('0xe7')][_0x9b9d('0x13d')](db[_0x9b9d('0x73')],{'through':_0x9b9d('0x1a5'),'as':_0x9b9d('0x14b')});db['Team'][_0x9b9d('0x13d')](db['FaxQueue'],{'through':_0x9b9d('0x196'),'as':_0x9b9d('0x14c')});db['Team']['belongsToMany'](db[_0x9b9d('0x5e')],{'through':_0x9b9d('0x19b'),'as':_0x9b9d('0x14e')});db[_0x9b9d('0xe7')]['belongsToMany'](db[_0x9b9d('0x68')],{'through':_0x9b9d('0x1e8'),'as':_0x9b9d('0x14f')});db['Campaign']['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x9b9d('0x1b6')});db['Campaign'][_0x9b9d('0x12e')](db[_0x9b9d('0x7d')],{'as':_0x9b9d('0x132'),'foreignKey':_0x9b9d('0x1b6')});db[_0x9b9d('0xeb')][_0x9b9d('0x12e')](db[_0x9b9d('0x7f')],{'as':_0x9b9d('0x1b1'),'foreignKey':_0x9b9d('0x1b6')});db['Campaign']['hasMany'](db[_0x9b9d('0x161')],{'as':_0x9b9d('0x162'),'foreignKey':'CampaignId'});db['Campaign']['belongsTo'](db['Trunk'],{'as':_0x9b9d('0x2d'),'foreignKey':_0x9b9d('0x164')});db[_0x9b9d('0xeb')][_0x9b9d('0x138')](db[_0x9b9d('0x2d')],{'as':_0x9b9d('0x165'),'foreignKey':_0x9b9d('0x166')});db['Campaign'][_0x9b9d('0x138')](db[_0x9b9d('0x8b')],{'as':_0x9b9d('0x8b'),'foreignKey':'IntervalId'});db[_0x9b9d('0xeb')]['belongsTo'](db[_0x9b9d('0x159')],{'as':_0x9b9d('0x159'),'foreignKey':'SquareProjectId'});db[_0x9b9d('0xeb')][_0x9b9d('0x13d')](db[_0x9b9d('0x150')],{'as':_0x9b9d('0x140'),'through':_0x9b9d('0x1e9')});db[_0x9b9d('0xeb')]['belongsToMany'](db[_0x9b9d('0x150')],{'as':_0x9b9d('0x16b'),'through':_0x9b9d('0x1ea')});db[_0x9b9d('0xf2')][_0x9b9d('0x138')](db[_0x9b9d('0x46')],{});db[_0x9b9d('0xf2')][_0x9b9d('0x138')](db[_0x9b9d('0x44')],{});db[_0x9b9d('0xf2')][_0x9b9d('0x138')](db['MailAccount'],{'foreignKey':_0x9b9d('0x1eb'),'as':_0x9b9d('0x1ec')});db[_0x9b9d('0xf2')]['belongsTo'](db[_0x9b9d('0x12d')],{'foreignKey':'FromUserId','as':_0x9b9d('0x1ed')});db[_0x9b9d('0xf2')][_0x9b9d('0x138')](db[_0x9b9d('0x12d')],{'foreignKey':'ToUserId','as':_0x9b9d('0x1ee')});db[_0x9b9d('0xf2')]['belongsTo'](db[_0x9b9d('0x40')],{'foreignKey':_0x9b9d('0x1ef'),'as':_0x9b9d('0x1f0')});db[_0x9b9d('0xf2')][_0x9b9d('0x138')](db[_0x9b9d('0x3e')],{'foreignKey':_0x9b9d('0x1f1'),'as':_0x9b9d('0x1f2')});db[_0x9b9d('0xf4')][_0x9b9d('0x138')](db[_0x9b9d('0x1a1')],{});db[_0x9b9d('0xf4')]['belongsTo'](db['ChatInteraction'],{});db['ChatTransferReport'][_0x9b9d('0x138')](db[_0x9b9d('0x69')],{'foreignKey':'FromChatWebsiteId','as':_0x9b9d('0x1ec')});db[_0x9b9d('0xf4')][_0x9b9d('0x138')](db[_0x9b9d('0x12d')],{'foreignKey':_0x9b9d('0x1f3'),'as':_0x9b9d('0x1ed')});db['ChatTransferReport'][_0x9b9d('0x138')](db[_0x9b9d('0x12d')],{'foreignKey':_0x9b9d('0x1f4'),'as':'ToAgent'});db['ChatTransferReport'][_0x9b9d('0x138')](db['ChatQueue'],{'foreignKey':_0x9b9d('0x1f5'),'as':'ToQueue'});db[_0x9b9d('0xf4')][_0x9b9d('0x138')](db[_0x9b9d('0x69')],{'foreignKey':_0x9b9d('0x1f6'),'as':_0x9b9d('0x1f2')});db[_0x9b9d('0xf6')][_0x9b9d('0x138')](db[_0x9b9d('0x18d')],{});db['FaxTransferReport']['belongsTo'](db[_0x9b9d('0x51')],{});db[_0x9b9d('0xf6')][_0x9b9d('0x138')](db[_0x9b9d('0x4e')],{'foreignKey':_0x9b9d('0x1f7'),'as':_0x9b9d('0x1ec')});db[_0x9b9d('0xf6')]['belongsTo'](db[_0x9b9d('0x12d')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x9b9d('0xf6')][_0x9b9d('0x138')](db[_0x9b9d('0x12d')],{'foreignKey':_0x9b9d('0x1f4'),'as':'ToAgent'});db['FaxTransferReport'][_0x9b9d('0x138')](db[_0x9b9d('0x54')],{'foreignKey':_0x9b9d('0x1f8'),'as':'ToQueue'});db[_0x9b9d('0xf6')][_0x9b9d('0x138')](db['FaxAccount'],{'foreignKey':_0x9b9d('0x1f9'),'as':_0x9b9d('0x1f2')});db[_0x9b9d('0xf8')]['belongsTo'](db['OpenchannelMessage'],{});db[_0x9b9d('0xf8')]['belongsTo'](db[_0x9b9d('0x64')],{});db[_0x9b9d('0xf8')][_0x9b9d('0x138')](db[_0x9b9d('0x60')],{'foreignKey':'FromOpenchannelAccountId','as':_0x9b9d('0x1ec')});db[_0x9b9d('0xf8')]['belongsTo'](db[_0x9b9d('0x12d')],{'foreignKey':_0x9b9d('0x1f3'),'as':_0x9b9d('0x1ed')});db[_0x9b9d('0xf8')][_0x9b9d('0x138')](db[_0x9b9d('0x12d')],{'foreignKey':_0x9b9d('0x1f4'),'as':'ToAgent'});db[_0x9b9d('0xf8')][_0x9b9d('0x138')](db[_0x9b9d('0x68')],{'foreignKey':_0x9b9d('0x1fa'),'as':_0x9b9d('0x1f0')});db[_0x9b9d('0xf8')][_0x9b9d('0x138')](db[_0x9b9d('0x60')],{'foreignKey':_0x9b9d('0x1fb'),'as':_0x9b9d('0x1f2')});db['SmsTransferReport'][_0x9b9d('0x138')](db[_0x9b9d('0x5c')],{});db[_0x9b9d('0xf9')][_0x9b9d('0x138')](db[_0x9b9d('0x5a')],{});db['SmsTransferReport'][_0x9b9d('0x138')](db['SmsAccount'],{'foreignKey':_0x9b9d('0x1fc'),'as':_0x9b9d('0x1ec')});db[_0x9b9d('0xf9')][_0x9b9d('0x138')](db[_0x9b9d('0x12d')],{'foreignKey':_0x9b9d('0x1f3'),'as':_0x9b9d('0x1ed')});db['SmsTransferReport'][_0x9b9d('0x138')](db[_0x9b9d('0x12d')],{'foreignKey':_0x9b9d('0x1f4'),'as':_0x9b9d('0x1ee')});db[_0x9b9d('0xf9')]['belongsTo'](db[_0x9b9d('0x5e')],{'foreignKey':_0x9b9d('0x1fd'),'as':'ToQueue'});db[_0x9b9d('0xf9')][_0x9b9d('0x138')](db[_0x9b9d('0x56')],{'foreignKey':'ToSmsAccountId','as':_0x9b9d('0x1f2')});db[_0x9b9d('0x150')][_0x9b9d('0x12e')](db['Disposition'],{'as':_0x9b9d('0x176'),'foreignKey':'ListId'});db[_0x9b9d('0x150')]['hasMany'](db['CmCustomField'],{'as':_0x9b9d('0x1fe'),'foreignKey':_0x9b9d('0x179')});db[_0x9b9d('0x150')][_0x9b9d('0x12e')](db[_0x9b9d('0x7a')],{'as':_0x9b9d('0x13e'),'onDelete':_0x9b9d('0x12b'),'foreignKey':_0x9b9d('0x179')});db[_0x9b9d('0x150')]['hasMany'](db[_0x9b9d('0x7d')],{'as':_0x9b9d('0x132'),'foreignKey':_0x9b9d('0x179')});db[_0x9b9d('0x150')][_0x9b9d('0x12e')](db['CmHopperHistory'],{'as':_0x9b9d('0x133'),'foreignKey':'ListId'});db[_0x9b9d('0x150')][_0x9b9d('0x12e')](db[_0x9b9d('0x80')],{'as':_0x9b9d('0x80'),'foreignKey':'ListId'});db[_0x9b9d('0x150')][_0x9b9d('0x13d')](db[_0x9b9d('0x1d')],{'as':_0x9b9d('0x1ff'),'through':_0x9b9d('0x200')});db[_0x9b9d('0x150')][_0x9b9d('0x13d')](db[_0x9b9d('0x12d')],{'as':_0x9b9d('0x168'),'through':_0x9b9d('0x141')});db[_0x9b9d('0xfb')][_0x9b9d('0x12e')](db[_0x9b9d('0x19')],{'as':_0x9b9d('0x131'),'onDelete':_0x9b9d('0x186')});db['VoicePrefix'][_0x9b9d('0x13d')](db['User'],{'as':_0x9b9d('0x168'),'through':'user_has_voice_prefixes'});db['UserProfile']['hasMany'](db['User'],{'as':_0x9b9d('0x182'),'foreignKey':_0x9b9d('0x13a')});db[_0x9b9d('0x139')][_0x9b9d('0x12e')](db[_0x9b9d('0xfe')],{'as':_0x9b9d('0x201'),'foreignKey':'userProfileId','onDelete':_0x9b9d('0x12b')});db[_0x9b9d('0xfe')]['hasMany'](db[_0x9b9d('0x202')],{'as':_0x9b9d('0x203'),'foreignKey':_0x9b9d('0x204'),'onDelete':_0x9b9d('0x12b')});db[_0x9b9d('0x103')][_0x9b9d('0x12e')](db[_0x9b9d('0x205')],{'foreignKey':_0x9b9d('0x206')});db[_0x9b9d('0x103')][_0x9b9d('0x12e')](db[_0x9b9d('0x1b2')],{'foreignKey':_0x9b9d('0x206')});db[_0x9b9d('0x205')]['hasOne'](db[_0x9b9d('0x106')],{'foreignKey':_0x9b9d('0x207')});db[_0x9b9d('0x205')][_0x9b9d('0x12e')](db[_0x9b9d('0x1b2')],{'foreignKey':_0x9b9d('0x207')});db[_0x9b9d('0x205')][_0x9b9d('0x13d')](db[_0x9b9d('0x205')],{'as':_0x9b9d('0x208'),'through':'crm_workflow_steps_has_crm_workflow_steps'});db[_0x9b9d('0x106')][_0x9b9d('0x12e')](db[_0x9b9d('0x209')],{'foreignKey':_0x9b9d('0x20a')});db['CrmTask'][_0x9b9d('0x138')](db[_0x9b9d('0x205')],{'foreignKey':_0x9b9d('0x207'),'as':_0x9b9d('0x205')});db[_0x9b9d('0x209')][_0x9b9d('0x138')](db[_0x9b9d('0x106')],{'foreignKey':_0x9b9d('0x20a'),'as':_0x9b9d('0x106')});db[_0x9b9d('0x109')][_0x9b9d('0x12e')](db['SAProduct'],{'foreignKey':_0x9b9d('0x20b')});db['SAUnitMeasure']['hasMany'](db[_0x9b9d('0x10e')],{'foreignKey':_0x9b9d('0x20c')});db[_0x9b9d('0x10e')]['hasMany'](db[_0x9b9d('0x113')],{'foreignKey':_0x9b9d('0x20d')});db['SAProduct'][_0x9b9d('0x138')](db['SASalesCondition'],{'as':_0x9b9d('0x20e'),'foreignKey':'TypeSalesConditionId'});db['SAProduct']['belongsTo'](db[_0x9b9d('0x10b')],{'as':_0x9b9d('0x20f'),'foreignKey':_0x9b9d('0x20c')});db[_0x9b9d('0x10e')][_0x9b9d('0x138')](db[_0x9b9d('0x109')],{'as':_0x9b9d('0x210'),'foreignKey':_0x9b9d('0x20b')});db['SASalesCondition'][_0x9b9d('0x12e')](db['SAProduct'],{'foreignKey':_0x9b9d('0x211')});db['SAPriceList'][_0x9b9d('0x12e')](db[_0x9b9d('0x113')],{'foreignKey':'PriceListId'});db[_0x9b9d('0x113')][_0x9b9d('0x12e')](db[_0x9b9d('0x117')],{'as':'ProductPriceList','foreignKey':_0x9b9d('0x212')});db[_0x9b9d('0x113')][_0x9b9d('0x138')](db[_0x9b9d('0x10e')],{'as':_0x9b9d('0x213'),'foreignKey':_0x9b9d('0x20d')});db['SAProductPricesList'][_0x9b9d('0x138')](db['SAPriceList'],{'as':_0x9b9d('0x214'),'foreignKey':_0x9b9d('0x215')});db[_0x9b9d('0x1b2')][_0x9b9d('0x12e')](db['SARequest'],{'as':_0x9b9d('0x1ad'),'foreignKey':'DossierId'});db[_0x9b9d('0x1b2')][_0x9b9d('0x12e')](db[_0x9b9d('0x116')],{'as':'Dossiers','foreignKey':_0x9b9d('0x216')});db['SADossier'][_0x9b9d('0x12e')](db[_0x9b9d('0x119')],{'as':_0x9b9d('0x1ad'),'foreignKey':_0x9b9d('0x216')});db[_0x9b9d('0x1b2')][_0x9b9d('0x12e')](db[_0x9b9d('0x217')],{'as':_0x9b9d('0x1ad'),'foreignKey':_0x9b9d('0x216')});db[_0x9b9d('0x1b2')][_0x9b9d('0x138')](db[_0x9b9d('0x1a9')],{'as':_0x9b9d('0x1b3'),'foreignKey':_0x9b9d('0x1aa')});db[_0x9b9d('0x1b2')][_0x9b9d('0x138')](db[_0x9b9d('0x7a')],{'as':_0x9b9d('0x17e'),'foreignKey':_0x9b9d('0x172')});db[_0x9b9d('0x1b2')][_0x9b9d('0x138')](db[_0x9b9d('0x103')],{'as':_0x9b9d('0x218'),'foreignKey':_0x9b9d('0x206')});db[_0x9b9d('0x1b2')][_0x9b9d('0x138')](db[_0x9b9d('0x205')],{'as':'WorkflowStep','foreignKey':_0x9b9d('0x207')});db['SADossier'][_0x9b9d('0x138')](db[_0x9b9d('0x12d')],{'as':_0x9b9d('0x12d'),'foreignKey':'UserId'});db[_0x9b9d('0x115')]['hasMany'](db['SAQuotation'],{'as':'Requests','foreignKey':_0x9b9d('0x219')});db['SARequest'][_0x9b9d('0x12e')](db[_0x9b9d('0x119')],{'as':'Requests','foreignKey':'RequestId'});db[_0x9b9d('0x115')][_0x9b9d('0x12e')](db[_0x9b9d('0x217')],{'as':_0x9b9d('0x21a'),'foreignKey':_0x9b9d('0x219')});db[_0x9b9d('0x115')][_0x9b9d('0x138')](db[_0x9b9d('0x1b2')],{'as':_0x9b9d('0x21b'),'foreignKey':_0x9b9d('0x216')});db[_0x9b9d('0x116')][_0x9b9d('0x12e')](db['SAProductQuotation'],{'as':_0x9b9d('0x21c'),'foreignKey':_0x9b9d('0x21d')});db[_0x9b9d('0x116')][_0x9b9d('0x12e')](db['SAOrder'],{'as':_0x9b9d('0x21c'),'foreignKey':_0x9b9d('0x21d')});db[_0x9b9d('0x116')][_0x9b9d('0x12e')](db[_0x9b9d('0x217')],{'as':_0x9b9d('0x21c'),'foreignKey':_0x9b9d('0x21d')});db[_0x9b9d('0x116')][_0x9b9d('0x138')](db[_0x9b9d('0x1b2')],{'as':_0x9b9d('0x21b'),'foreignKey':_0x9b9d('0x216')});db[_0x9b9d('0x116')][_0x9b9d('0x138')](db[_0x9b9d('0x115')],{'as':'Request','foreignKey':_0x9b9d('0x219')});db['SAProductQuotation']['belongsTo'](db[_0x9b9d('0x113')],{'as':_0x9b9d('0x21e'),'foreignKey':_0x9b9d('0x212')});db[_0x9b9d('0x117')][_0x9b9d('0x138')](db[_0x9b9d('0x116')],{'as':'Quotation','foreignKey':_0x9b9d('0x21d')});db[_0x9b9d('0x117')][_0x9b9d('0x138')](db[_0x9b9d('0x217')],{'as':_0x9b9d('0x21f'),'foreignKey':_0x9b9d('0x220')});db['SAProductQuotation'][_0x9b9d('0x138')](db['SAInvoice'],{'as':_0x9b9d('0x221'),'foreignKey':'InvoiceId'});db[_0x9b9d('0x119')][_0x9b9d('0x12e')](db[_0x9b9d('0x217')],{'as':_0x9b9d('0x222'),'foreignKey':_0x9b9d('0x223')});db[_0x9b9d('0x119')][_0x9b9d('0x138')](db[_0x9b9d('0x1b2')],{'as':'Dossier','foreignKey':_0x9b9d('0x216')});db['SAOrder'][_0x9b9d('0x138')](db[_0x9b9d('0x115')],{'as':'Request','foreignKey':_0x9b9d('0x219')});db[_0x9b9d('0x119')][_0x9b9d('0x138')](db['SAQuotation'],{'as':'Quotation','foreignKey':_0x9b9d('0x21d')});db[_0x9b9d('0x217')][_0x9b9d('0x12e')](db['SAInvoice'],{'as':_0x9b9d('0x21f'),'foreignKey':_0x9b9d('0x220')});db[_0x9b9d('0x217')][_0x9b9d('0x12e')](db['SAProductQuotation'],{'as':_0x9b9d('0x21f'),'foreignKey':_0x9b9d('0x220')});db[_0x9b9d('0x217')]['hasMany'](db[_0x9b9d('0x11f')],{'as':_0x9b9d('0x21f'),'foreignKey':_0x9b9d('0x220')});db[_0x9b9d('0x217')]['hasMany'](db[_0x9b9d('0x120')],{'as':_0x9b9d('0x21f'),'foreignKey':_0x9b9d('0x220')});db[_0x9b9d('0x217')][_0x9b9d('0x138')](db[_0x9b9d('0x1b2')],{'as':'Dossier','foreignKey':_0x9b9d('0x216')});db[_0x9b9d('0x217')][_0x9b9d('0x138')](db['SARequest'],{'as':_0x9b9d('0x224'),'foreignKey':_0x9b9d('0x219')});db[_0x9b9d('0x217')][_0x9b9d('0x138')](db[_0x9b9d('0x116')],{'as':_0x9b9d('0x225'),'foreignKey':'QuotationId'});db[_0x9b9d('0x217')][_0x9b9d('0x138')](db[_0x9b9d('0x119')],{'as':'Order','foreignKey':_0x9b9d('0x223')});db[_0x9b9d('0x11a')][_0x9b9d('0x12e')](db['SAProductQuotation'],{'as':_0x9b9d('0x21c'),'foreignKey':_0x9b9d('0x226')});db[_0x9b9d('0x11a')][_0x9b9d('0x12e')](db['SAInvoiceDetail'],{'as':_0x9b9d('0x227'),'foreignKey':_0x9b9d('0x226')});db[_0x9b9d('0x11a')][_0x9b9d('0x12e')](db['SAPayment'],{'as':'Payments','foreignKey':_0x9b9d('0x226')});db[_0x9b9d('0x11a')][_0x9b9d('0x138')](db['SADossier'],{'as':'Dossier','foreignKey':_0x9b9d('0x216')});db[_0x9b9d('0x11a')][_0x9b9d('0x138')](db['SARequest'],{'as':_0x9b9d('0x224'),'foreignKey':_0x9b9d('0x219')});db[_0x9b9d('0x11a')]['belongsTo'](db[_0x9b9d('0x116')],{'as':_0x9b9d('0x225'),'foreignKey':'QuotationId'});db['SAInvoice'][_0x9b9d('0x138')](db['SAOrder'],{'as':'Order','foreignKey':_0x9b9d('0x223')});db[_0x9b9d('0x228')][_0x9b9d('0x138')](db[_0x9b9d('0x11a')],{'as':_0x9b9d('0x221'),'foreignKey':'InvoiceId'});db[_0x9b9d('0x11f')]['belongsTo'](db[_0x9b9d('0x217')],{'as':_0x9b9d('0x21f'),'foreignKey':_0x9b9d('0x220')});db[_0x9b9d('0x120')][_0x9b9d('0x138')](db[_0x9b9d('0x11a')],{'as':'Invoice','foreignKey':_0x9b9d('0x226')});db['SAPayment'][_0x9b9d('0x138')](db[_0x9b9d('0x217')],{'as':_0x9b9d('0x21f'),'foreignKey':_0x9b9d('0x220')});db['SAPaymentMethod'][_0x9b9d('0x12e')](db[_0x9b9d('0x1a9')],{'as':_0x9b9d('0x229'),'foreignKey':_0x9b9d('0x1af')});db[_0x9b9d('0x126')][_0x9b9d('0x138')](db[_0x9b9d('0x124')],{'as':'CreditNote','foreignKey':_0x9b9d('0x22a')});db[_0x9b9d('0x22b')][_0x9b9d('0x12e')](db[_0x9b9d('0x1a9')],{'as':_0x9b9d('0x22c'),'foreignKey':_0x9b9d('0x22d')});db[_0x9b9d('0x22e')]['hasMany'](db[_0x9b9d('0x1a9')],{'as':_0x9b9d('0x22f'),'foreignKey':_0x9b9d('0x230')});module[_0x9b9d('0x231')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 0142fb7..d0d5515 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e3b=['./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/templates','./api/template','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/networks','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareMessage','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','/api/userProfile/resources','./api/userProfileResource','/api/crm/nations','/api/crm/workflows','./api/crmWorkflow','/api/crm/workflowsteps','/api/crm/tasks','./api/crmTask','/api/sa/typeproducts','./api/saTypeProduct','/api/sa/unitmeasures','./api/saUnitMeasure','/api/sa/invoicelaws','./api/saInvoiceLaw','/api/sa/products','./api/saProduct','/api/sa/salescondions','./api/saSalesCondition','./api/saPriceList','./api/saProductPricesList','/api/sa/dossiers','./api/saDossier','./api/saRequest','/api/sa/quotations','./api/saProductQuotation','/api/sa/orders','/api/sa/proformas','./api/saProforma','/api/sa/invoices','/api/sa/assets','./api/saAsset','/api/sa/proforma_details','/api/sa/payments','./api/saPayment','/api/sa/paymentMethods','./api/saPaymentMethod','/api/sa/creditNotes','/api/sa/creditNote_details','./api/saCreditNoteDetail','/api/sa/invoice_numberss','./api/saInvoiceNumber','/api/sa/company_types','./api/saCompanyType','./api/saCompanyRelationship','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','./api/version','/api/system','./api/system','./api/pm2','/apidoc','join','static','root','/demo','snippet','1.0.14','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','path','express','./errors','./config/environment','./config/logger','api','auth','default','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','remoteAddress','url','responseTime','user','role','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','statusCode','name','other','agent_id','agent_name','/api/users','./api/user','/api/voice/contexts','./api/voiceContext','/api/voice/mohs','/api/voice/queues'];(function(_0x272513,_0x2fe08f){var _0x309397=function(_0x120ee2){while(--_0x120ee2){_0x272513['push'](_0x272513['shift']());}};_0x309397(++_0x2fe08f);}(_0x9e3b,0x10a));var _0xb9e3=function(_0x5a012b,_0x522216){_0x5a012b=_0x5a012b-0x0;var _0x3aa42b=_0x9e3b[_0x5a012b];return _0x3aa42b;};'use strict';var path=require(_0xb9e3('0x0'));var express=require(_0xb9e3('0x1'));var ewinston=require('express-winston');var util=require('util');var errors=require(_0xb9e3('0x2'));var config=require(_0xb9e3('0x3'));var logger=require(_0xb9e3('0x4'))(_0xb9e3('0x5'));var authLogger=require(_0xb9e3('0x4'))(_0xb9e3('0x6'));exports[_0xb9e3('0x7')]=function(_0x761dbe){_0x761dbe['use'](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x24f206,_0x5d34de){return util[_0xb9e3('0x8')](_0xb9e3('0x9'),_0x24f206[_0xb9e3('0xa')],_0x24f206[_0xb9e3('0xb')][_0xb9e3('0xc')]?_0x24f206['headers']['x-forwarded-for']:_0x24f206[_0xb9e3('0xd')][_0xb9e3('0xe')]||_0x24f206['ip'],_0x24f206[_0xb9e3('0xf')],_0x5d34de['statusCode'],_0x5d34de[_0xb9e3('0x10')],_0x24f206[_0xb9e3('0x11')]?_0x24f206[_0xb9e3('0x11')]['id']:null,_0x24f206[_0xb9e3('0x11')]?_0x24f206['user']['name']:null,_0x24f206[_0xb9e3('0x11')]?_0x24f206[_0xb9e3('0x11')][_0xb9e3('0x12')]:null);}}));_0x761dbe[_0xb9e3('0x13')](ewinston[_0xb9e3('0x14')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x287179,_0x447347){var _0x4ecdc7=_0xb9e3('0x15');if(_0x287179['body']&&_0x287179[_0xb9e3('0x16')][_0xb9e3('0x17')]&&_0x287179['body']['agent_id']){_0x4ecdc7='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util['format'](_0x4ecdc7,_0x287179[_0xb9e3('0xa')],_0x287179[_0xb9e3('0xb')][_0xb9e3('0xc')]?_0x287179[_0xb9e3('0xb')][_0xb9e3('0xc')]:_0x287179['connection']['remoteAddress']||_0x287179['ip'],_0x287179[_0xb9e3('0xf')],_0x447347[_0xb9e3('0x18')],_0x447347[_0xb9e3('0x10')],_0x287179[_0xb9e3('0x11')]?_0x287179[_0xb9e3('0x11')]['id']:null,_0x287179[_0xb9e3('0x11')]?_0x287179[_0xb9e3('0x11')][_0xb9e3('0x19')]:null,_0x287179['user']?_0x287179[_0xb9e3('0x11')]['role']:null,_0x287179['body']&&_0x287179[_0xb9e3('0x16')][_0xb9e3('0x17')]?_0x287179[_0xb9e3('0x16')][_0xb9e3('0x17')]:_0xb9e3('0x1a'),_0x287179[_0xb9e3('0x16')]&&_0x287179[_0xb9e3('0x16')]['agent_id']?_0x287179[_0xb9e3('0x16')][_0xb9e3('0x1b')]:'',_0x287179['body']&&_0x287179[_0xb9e3('0x16')][_0xb9e3('0x1c')]?_0x287179[_0xb9e3('0x16')][_0xb9e3('0x1c')]:'');},'ignoreRoute':function(_0x1ec826){var _0x142681=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x142681['test'](_0x1ec826[_0xb9e3('0xf')]);}}));_0x761dbe['use'](_0xb9e3('0x1d'),require(_0xb9e3('0x1e')));_0x761dbe[_0xb9e3('0x13')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x1f'),require(_0xb9e3('0x20')));_0x761dbe[_0xb9e3('0x13')]('/api/voice/extensions',require('./api/voiceExtension'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x21'),require('./api/voiceMusicOnHold'));_0x761dbe['use'](_0xb9e3('0x22'),require(_0xb9e3('0x23')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x24'),require('./api/voiceRecording'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x25'),require('./api/screenRecording'));_0x761dbe[_0xb9e3('0x13')]('/api/voice/mails',require(_0xb9e3('0x26')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x27'),require(_0xb9e3('0x28')));_0x761dbe['use'](_0xb9e3('0x29'),require(_0xb9e3('0x2a')));_0x761dbe[_0xb9e3('0x13')]('/api/voice/dials/reports',require(_0xb9e3('0x2b')));_0x761dbe['use']('/api/voice/agents/reports',require(_0xb9e3('0x2c')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x2d'),require(_0xb9e3('0x2e')));_0x761dbe['use']('/api/members/reports',require(_0xb9e3('0x2f')));_0x761dbe[_0xb9e3('0x13')]('/api/trunks',require('./api/trunk'));_0x761dbe['use'](_0xb9e3('0x30'),require(_0xb9e3('0x31')));_0x761dbe['use']('/api/mail/out_servers',require(_0xb9e3('0x32')));_0x761dbe[_0xb9e3('0x13')]('/api/mail/accounts',require(_0xb9e3('0x33')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x34'),require(_0xb9e3('0x35')));_0x761dbe['use'](_0xb9e3('0x36'),require(_0xb9e3('0x37')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x38'),require(_0xb9e3('0x39')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x3a'),require(_0xb9e3('0x3b')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x3c'),require(_0xb9e3('0x3d')));_0x761dbe['use'](_0xb9e3('0x3e'),require(_0xb9e3('0x3f')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x40'),require(_0xb9e3('0x41')));_0x761dbe['use'](_0xb9e3('0x42'),require(_0xb9e3('0x43')));_0x761dbe['use'](_0xb9e3('0x44'),require('./api/faxAccount'));_0x761dbe['use']('/api/fax/applications',require(_0xb9e3('0x45')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x46'),require(_0xb9e3('0x47')));_0x761dbe[_0xb9e3('0x13')]('/api/fax/messages',require(_0xb9e3('0x48')));_0x761dbe[_0xb9e3('0x13')]('/api/fax/queues',require(_0xb9e3('0x49')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x4a'),require('./api/faxQueueReport'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x4b'),require(_0xb9e3('0x4c')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x4d'),require(_0xb9e3('0x4e')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x4f'),require('./api/smsInteraction'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x50'),require('./api/smsMessage'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x51'),require(_0xb9e3('0x52')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x53'),require(_0xb9e3('0x54')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x55'),require('./api/openchannelApplication'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x56'),require('./api/openchannelInteraction'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x57'),require('./api/openchannelMessage'));_0x761dbe['use'](_0xb9e3('0x58'),require(_0xb9e3('0x59')));_0x761dbe['use'](_0xb9e3('0x5a'),require(_0xb9e3('0x5b')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x5c'),require(_0xb9e3('0x5d')));_0x761dbe['use']('/api/chat/applications',require(_0xb9e3('0x5e')));_0x761dbe['use'](_0xb9e3('0x5f'),require(_0xb9e3('0x60')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x61'),require('./api/chatMessage'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x62'),require(_0xb9e3('0x63')));_0x761dbe['use'](_0xb9e3('0x64'),require(_0xb9e3('0x65')));_0x761dbe['use']('/api/chat/groups',require('./api/chatGroup'));_0x761dbe[_0xb9e3('0x13')]('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x761dbe['use'](_0xb9e3('0x66'),require(_0xb9e3('0x67')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x68'),require(_0xb9e3('0x69')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x6a'),require(_0xb9e3('0x6b')));_0x761dbe['use']('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x6c'),require(_0xb9e3('0x6d')));_0x761dbe['use'](_0xb9e3('0x6e'),require(_0xb9e3('0x6f')));_0x761dbe['use'](_0xb9e3('0x70'),require(_0xb9e3('0x71')));_0x761dbe['use']('/api/actions',require(_0xb9e3('0x72')));_0x761dbe['use'](_0xb9e3('0x73'),require('./api/automation'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x74'),require(_0xb9e3('0x75')));_0x761dbe[_0xb9e3('0x13')]('/api/dispositions',require('./api/disposition'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x76'),require(_0xb9e3('0x77')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x78'),require(_0xb9e3('0x79')));_0x761dbe['use'](_0xb9e3('0x7a'),require(_0xb9e3('0x7b')));_0x761dbe['use']('/api/cdr',require(_0xb9e3('0x7c')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x7d'),require(_0xb9e3('0x7e')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x7f'),require(_0xb9e3('0x80')));_0x761dbe['use'](_0xb9e3('0x81'),require(_0xb9e3('0x82')));_0x761dbe[_0xb9e3('0x13')]('/api/tags',require(_0xb9e3('0x83')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x84'),require(_0xb9e3('0x85')));_0x761dbe[_0xb9e3('0x13')]('/api/triggers',require(_0xb9e3('0x86')));_0x761dbe[_0xb9e3('0x13')]('/api/variables',require(_0xb9e3('0x87')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x88'),require(_0xb9e3('0x89')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x8a'),require('./api/integrationReport'));_0x761dbe[_0xb9e3('0x13')]('/api/analytics/custom_reports',require(_0xb9e3('0x8b')));_0x761dbe[_0xb9e3('0x13')]('/api/analytics/default_reports',require(_0xb9e3('0x8c')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x8d'),require(_0xb9e3('0x8e')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x8f'),require(_0xb9e3('0x90')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x91'),require(_0xb9e3('0x92')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x93'),require(_0xb9e3('0x94')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x95'),require(_0xb9e3('0x96')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x97'),require(_0xb9e3('0x98')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x99'),require(_0xb9e3('0x9a')));_0x761dbe['use']('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0x761dbe[_0xb9e3('0x13')]('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x9b'),require(_0xb9e3('0x9c')));_0x761dbe['use'](_0xb9e3('0x9d'),require(_0xb9e3('0x9e')));_0x761dbe[_0xb9e3('0x13')]('/api/integrations/desk/configurations',require(_0xb9e3('0x9f')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xa0'),require('./api/intDeskField'));_0x761dbe['use'](_0xb9e3('0xa1'),require(_0xb9e3('0xa2')));_0x761dbe['use']('/api/integrations/zoho/configurations',require(_0xb9e3('0xa3')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xa4'),require(_0xb9e3('0xa5')));_0x761dbe[_0xb9e3('0x13')]('/api/integrations/zendesk/accounts',require(_0xb9e3('0xa6')));_0x761dbe[_0xb9e3('0x13')]('/api/integrations/zendesk/configurations',require(_0xb9e3('0xa7')));_0x761dbe['use'](_0xb9e3('0xa8'),require(_0xb9e3('0xa9')));_0x761dbe['use'](_0xb9e3('0xaa'),require(_0xb9e3('0xab')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xac'),require(_0xb9e3('0xad')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xae'),require(_0xb9e3('0xaf')));_0x761dbe['use'](_0xb9e3('0xb0'),require(_0xb9e3('0xb1')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xb2'),require(_0xb9e3('0xb3')));_0x761dbe['use'](_0xb9e3('0xb4'),require(_0xb9e3('0xb5')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xb6'),require('./api/intServicenowAccount'));_0x761dbe['use'](_0xb9e3('0xb7'),require(_0xb9e3('0xb8')));_0x761dbe['use'](_0xb9e3('0xb9'),require(_0xb9e3('0xba')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xbb'),require(_0xb9e3('0xbc')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xbd'),require(_0xb9e3('0xbe')));_0x761dbe[_0xb9e3('0x13')]('/api/integrations/dynamics365/fields',require(_0xb9e3('0xbf')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xc0'),require('./api/network'));_0x761dbe[_0xb9e3('0x13')]('/api/chat/reports/queue',require(_0xb9e3('0xc1')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xc2'),require(_0xb9e3('0xc3')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xc4'),require(_0xb9e3('0xc5')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xc6'),require(_0xb9e3('0xc7')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xc8'),require(_0xb9e3('0xc9')));_0x761dbe['use'](_0xb9e3('0xca'),require(_0xb9e3('0xcb')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xcc'),require('./api/squareReport'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xcd'),require(_0xb9e3('0xce')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xcf'),require(_0xb9e3('0xd0')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xd1'),require(_0xb9e3('0xd2')));_0x761dbe['use'](_0xb9e3('0xd3'),require(_0xb9e3('0xd4')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xd5'),require('./api/squareProject'));_0x761dbe['use'](_0xb9e3('0xd6'),require('./api/squareRecording'));_0x761dbe[_0xb9e3('0x13')]('/api/square/messages',require(_0xb9e3('0xd7')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xd8'),require(_0xb9e3('0xd9')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xda'),require('./api/license'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xdb'),require(_0xb9e3('0xdc')));_0x761dbe['use']('/api/migrations',require(_0xb9e3('0xdd')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xde'),require('./api/attachment'));_0x761dbe['use']('/api/plugins',require(_0xb9e3('0xdf')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xe0'),require(_0xb9e3('0xe1')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xe2'),require('./api/chatTransferReport'));_0x761dbe[_0xb9e3('0x13')]('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xe3'),require('./api/openchannelTransferReport'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xe4'),require(_0xb9e3('0xe5')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xe6'),require(_0xb9e3('0xe7')));_0x761dbe['use']('/api/voice/prefixes',require(_0xb9e3('0xe8')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xe9'),require('./api/userProfile'));_0x761dbe[_0xb9e3('0x13')]('/api/userProfile/sections',require('./api/userProfileSection'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xea'),require(_0xb9e3('0xeb')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xec'),require('./api/crmNation'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xed'),require(_0xb9e3('0xee')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xef'),require('./api/crmWorkflowstep'));_0x761dbe['use'](_0xb9e3('0xf0'),require(_0xb9e3('0xf1')));_0x761dbe[_0xb9e3('0x13')]('/api/crm/actionslists',require('./api/crmActionsList'));_0x761dbe['use'](_0xb9e3('0xf2'),require(_0xb9e3('0xf3')));_0x761dbe['use'](_0xb9e3('0xf4'),require(_0xb9e3('0xf5')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xf6'),require(_0xb9e3('0xf7')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xf8'),require(_0xb9e3('0xf9')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xfa'),require(_0xb9e3('0xfb')));_0x761dbe['use']('/api/sa/pricelists',require(_0xb9e3('0xfc')));_0x761dbe[_0xb9e3('0x13')]('/api/sa/productpriceslists',require(_0xb9e3('0xfd')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0xfe'),require(_0xb9e3('0xff')));_0x761dbe[_0xb9e3('0x13')]('/api/sa/requests',require(_0xb9e3('0x100')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x101'),require('./api/saQuotation'));_0x761dbe[_0xb9e3('0x13')]('/api/sa/productquotations',require(_0xb9e3('0x102')));_0x761dbe['use'](_0xb9e3('0x103'),require('./api/saOrder'));_0x761dbe['use'](_0xb9e3('0x104'),require(_0xb9e3('0x105')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x106'),require('./api/saInvoice'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x107'),require(_0xb9e3('0x108')));_0x761dbe[_0xb9e3('0x13')]('/api/sa/invoice_details',require('./api/saInvoiceDetail'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x109'),require('./api/saProformaDetail'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x10a'),require(_0xb9e3('0x10b')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x10c'),require(_0xb9e3('0x10d')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x10e'),require('./api/saCreditNote'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x10f'),require(_0xb9e3('0x110')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x111'),require(_0xb9e3('0x112')));_0x761dbe['use']('/api/sa/creditNote_numberss',require('./api/saCreditNoteNumber'));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x113'),require(_0xb9e3('0x114')));_0x761dbe[_0xb9e3('0x13')]('/api/sa/company_relationshipes',require(_0xb9e3('0x115')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x116'),require(_0xb9e3('0x117')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x118'),require(_0xb9e3('0x119')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x11a'),require(_0xb9e3('0x11b')));_0x761dbe[_0xb9e3('0x13')]('/api/rpc',require('./api/rpc'));_0x761dbe[_0xb9e3('0x13')]('/api/version',require(_0xb9e3('0x11c')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x11d'),require(_0xb9e3('0x11e')));_0x761dbe[_0xb9e3('0x13')]('/api/pm2',require(_0xb9e3('0x11f')));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x120'),express['static'](path[_0xb9e3('0x121')](config['root'],_0xb9e3('0x120'))));_0x761dbe['use']('/www',express[_0xb9e3('0x122')](path[_0xb9e3('0x121')](config['root'],'/www')));_0x761dbe[_0xb9e3('0x13')]('/demo',express[_0xb9e3('0x122')](path[_0xb9e3('0x121')](config[_0xb9e3('0x123')],_0xb9e3('0x124'))));_0x761dbe[_0xb9e3('0x13')]('/snippet',express[_0xb9e3('0x122')](path[_0xb9e3('0x121')](config[_0xb9e3('0x123')],_0xb9e3('0x125'),_0xb9e3('0x126'))));_0x761dbe[_0xb9e3('0x13')](_0xb9e3('0x127'),express[_0xb9e3('0x122')](path[_0xb9e3('0x121')](config['root'],_0xb9e3('0x128'))));_0x761dbe[_0xb9e3('0x129')](_0xb9e3('0x12a'))['get'](errors[0x194]);_0x761dbe[_0xb9e3('0x129')]('/*')[_0xb9e3('0x12b')](function(_0x24255e,_0x59ded3){_0x59ded3['sendFile'](path[_0xb9e3('0x12c')](_0x761dbe[_0xb9e3('0x12b')]('appPath')+'/index.html'));});}; \ No newline at end of file +var _0xee98=['/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/crm/nations','./api/crmNation','/api/crm/workflows','./api/crmWorkflow','./api/crmWorkflowstep','/api/crm/tasks','./api/crmTask','/api/crm/actionslists','./api/crmActionsList','/api/sa/typeproducts','/api/sa/unitmeasures','./api/saInvoiceLaw','./api/saProduct','./api/saSalesCondition','/api/sa/pricelists','./api/saPriceList','/api/sa/productpriceslists','./api/saDossier','/api/sa/quotations','./api/saQuotation','/api/sa/proformas','./api/saProforma','/api/sa/invoices','./api/saInvoice','/api/sa/assets','./api/saAsset','./api/saInvoiceDetail','/api/sa/payments','./api/saPayment','./api/saPaymentMethod','/api/sa/creditNotes','/api/sa/creditNote_details','/api/sa/invoice_numberss','./api/saInvoiceNumber','/api/sa/creditNote_numberss','/api/sa/company_types','./api/saCompanyType','/api/sa/company_relationshipes','./api/saCompanyRelationship','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/jira','/api/rpc','/api/version','./api/version','./api/system','/api/pm2','./api/pm2','/apidoc','static','root','/www','join','/demo','/snippet','snippet','1.0.14','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','express-winston','util','./errors','./config/environment','./config/logger','api','default','use','logger','headers','connection','url','statusCode','responseTime','user','name','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','x-forwarded-for','remoteAddress','role','other','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceExtension','./api/voiceMusicOnHold','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/actions','./api/action','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/sounds','./api/sound','/api/tags','/api/templates','./api/template','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/metrics','/api/analytics/tree_reports','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./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/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/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/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/attachment','./api/plugin'];(function(_0x1ff58e,_0x59883f){var _0x365452=function(_0x4c1f95){while(--_0x4c1f95){_0x1ff58e['push'](_0x1ff58e['shift']());}};_0x365452(++_0x59883f);}(_0xee98,0x17b));var _0x8ee9=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xee98[_0x46e363];return _0x3fb059;};'use strict';var path=require('path');var express=require('express');var ewinston=require(_0x8ee9('0x0'));var util=require(_0x8ee9('0x1'));var errors=require(_0x8ee9('0x2'));var config=require(_0x8ee9('0x3'));var logger=require(_0x8ee9('0x4'))(_0x8ee9('0x5'));var authLogger=require(_0x8ee9('0x4'))('auth');exports[_0x8ee9('0x6')]=function(_0x510058){_0x510058[_0x8ee9('0x7')](ewinston[_0x8ee9('0x8')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x3ac9b3,_0x35e310){return util['format']('%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s',_0x3ac9b3['method'],_0x3ac9b3[_0x8ee9('0x9')]['x-forwarded-for']?_0x3ac9b3[_0x8ee9('0x9')]['x-forwarded-for']:_0x3ac9b3[_0x8ee9('0xa')]['remoteAddress']||_0x3ac9b3['ip'],_0x3ac9b3[_0x8ee9('0xb')],_0x35e310[_0x8ee9('0xc')],_0x35e310[_0x8ee9('0xd')],_0x3ac9b3[_0x8ee9('0xe')]?_0x3ac9b3[_0x8ee9('0xe')]['id']:null,_0x3ac9b3[_0x8ee9('0xe')]?_0x3ac9b3['user'][_0x8ee9('0xf')]:null,_0x3ac9b3[_0x8ee9('0xe')]?_0x3ac9b3[_0x8ee9('0xe')]['role']:null);}}));_0x510058[_0x8ee9('0x7')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x384f16,_0x72b71){var _0x32e7a8='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x384f16[_0x8ee9('0x10')]&&_0x384f16[_0x8ee9('0x10')][_0x8ee9('0x11')]&&_0x384f16['body'][_0x8ee9('0x12')]){_0x32e7a8=_0x8ee9('0x13');}return util['format'](_0x32e7a8,_0x384f16[_0x8ee9('0x14')],_0x384f16[_0x8ee9('0x9')][_0x8ee9('0x15')]?_0x384f16['headers'][_0x8ee9('0x15')]:_0x384f16['connection'][_0x8ee9('0x16')]||_0x384f16['ip'],_0x384f16[_0x8ee9('0xb')],_0x72b71[_0x8ee9('0xc')],_0x72b71['responseTime'],_0x384f16[_0x8ee9('0xe')]?_0x384f16[_0x8ee9('0xe')]['id']:null,_0x384f16[_0x8ee9('0xe')]?_0x384f16[_0x8ee9('0xe')][_0x8ee9('0xf')]:null,_0x384f16[_0x8ee9('0xe')]?_0x384f16[_0x8ee9('0xe')][_0x8ee9('0x17')]:null,_0x384f16[_0x8ee9('0x10')]&&_0x384f16[_0x8ee9('0x10')]['device']?_0x384f16[_0x8ee9('0x10')]['device']:_0x8ee9('0x18'),_0x384f16[_0x8ee9('0x10')]&&_0x384f16[_0x8ee9('0x10')][_0x8ee9('0x12')]?_0x384f16[_0x8ee9('0x10')][_0x8ee9('0x12')]:'',_0x384f16['body']&&_0x384f16[_0x8ee9('0x10')]['agent_name']?_0x384f16['body']['agent_name']:'');},'ignoreRoute':function(_0x537955){var _0x1c19b6=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1c19b6[_0x8ee9('0x19')](_0x537955['url']);}}));_0x510058['use'](_0x8ee9('0x1a'),require(_0x8ee9('0x1b')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x1c'),require(_0x8ee9('0x1d')));_0x510058[_0x8ee9('0x7')]('/api/voice/contexts',require('./api/voiceContext'));_0x510058[_0x8ee9('0x7')]('/api/voice/extensions',require(_0x8ee9('0x1e')));_0x510058[_0x8ee9('0x7')]('/api/voice/mohs',require(_0x8ee9('0x1f')));_0x510058[_0x8ee9('0x7')]('/api/voice/queues',require('./api/voiceQueue'));_0x510058[_0x8ee9('0x7')]('/api/voice/recordings',require(_0x8ee9('0x20')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x21'),require(_0x8ee9('0x22')));_0x510058['use'](_0x8ee9('0x23'),require(_0x8ee9('0x24')));_0x510058[_0x8ee9('0x7')]('/api/voice/mails/messages',require(_0x8ee9('0x25')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x26'),require(_0x8ee9('0x27')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x28'),require(_0x8ee9('0x29')));_0x510058['use']('/api/voice/agents/reports',require(_0x8ee9('0x2a')));_0x510058[_0x8ee9('0x7')]('/api/voice/queues/reports',require(_0x8ee9('0x2b')));_0x510058[_0x8ee9('0x7')]('/api/members/reports',require(_0x8ee9('0x2c')));_0x510058['use'](_0x8ee9('0x2d'),require(_0x8ee9('0x2e')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x2f'),require('./api/voiceTransferReport'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x30'),require(_0x8ee9('0x31')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x32'),require(_0x8ee9('0x33')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x34'),require('./api/mailQueue'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x35'),require('./api/mailSubstatus'));_0x510058['use']('/api/mail/interactions',require(_0x8ee9('0x36')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x37'),require(_0x8ee9('0x38')));_0x510058['use'](_0x8ee9('0x39'),require(_0x8ee9('0x3a')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x3b'),require(_0x8ee9('0x3c')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x3d'),require('./api/dashboard'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x3e'),require('./api/dashboardItem'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x3f'),require(_0x8ee9('0x40')));_0x510058[_0x8ee9('0x7')]('/api/fax/applications',require(_0x8ee9('0x41')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x42'),require(_0x8ee9('0x43')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x44'),require(_0x8ee9('0x45')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x46'),require(_0x8ee9('0x47')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x48'),require(_0x8ee9('0x49')));_0x510058['use'](_0x8ee9('0x4a'),require('./api/smsAccount'));_0x510058['use'](_0x8ee9('0x4b'),require(_0x8ee9('0x4c')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x4d'),require(_0x8ee9('0x4e')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x4f'),require(_0x8ee9('0x50')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x51'),require(_0x8ee9('0x52')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x53'),require(_0x8ee9('0x54')));_0x510058['use']('/api/openchannel/applications',require(_0x8ee9('0x55')));_0x510058['use'](_0x8ee9('0x56'),require('./api/openchannelInteraction'));_0x510058['use']('/api/openchannel/messages',require('./api/openchannelMessage'));_0x510058['use'](_0x8ee9('0x57'),require('./api/openchannelQueue'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x58'),require(_0x8ee9('0x59')));_0x510058['use'](_0x8ee9('0x5a'),require('./api/openchannelQueueReport'));_0x510058['use'](_0x8ee9('0x5b'),require('./api/chatApplication'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x5c'),require(_0x8ee9('0x5d')));_0x510058[_0x8ee9('0x7')]('/api/chat/messages',require(_0x8ee9('0x5e')));_0x510058[_0x8ee9('0x7')]('/api/chat/offline_messages',require('./api/chatOfflineMessage'));_0x510058['use']('/api/chat/queues',require(_0x8ee9('0x5f')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x60'),require(_0x8ee9('0x61')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x62'),require(_0x8ee9('0x63')));_0x510058['use'](_0x8ee9('0x64'),require('./api/cmCompany'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x65'),require(_0x8ee9('0x66')));_0x510058['use'](_0x8ee9('0x67'),require(_0x8ee9('0x68')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x69'),require(_0x8ee9('0x6a')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x6b'),require(_0x8ee9('0x6c')));_0x510058['use'](_0x8ee9('0x6d'),require(_0x8ee9('0x6e')));_0x510058['use']('/api/cm/custom_fields',require('./api/cmCustomField'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x6f'),require(_0x8ee9('0x70')));_0x510058[_0x8ee9('0x7')]('/api/automations',require('./api/automation'));_0x510058['use'](_0x8ee9('0x71'),require(_0x8ee9('0x72')));_0x510058[_0x8ee9('0x7')]('/api/dispositions',require(_0x8ee9('0x73')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x74'),require(_0x8ee9('0x75')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x76'),require(_0x8ee9('0x77')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x78'),require(_0x8ee9('0x79')));_0x510058['use'](_0x8ee9('0x7a'),require('./api/cdr'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x7b'),require(_0x8ee9('0x7c')));_0x510058[_0x8ee9('0x7')]('/api/schedules',require('./api/schedule'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x7d'),require(_0x8ee9('0x7e')));_0x510058['use'](_0x8ee9('0x7f'),require('./api/tag'));_0x510058['use'](_0x8ee9('0x80'),require(_0x8ee9('0x81')));_0x510058[_0x8ee9('0x7')]('/api/triggers',require(_0x8ee9('0x82')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x83'),require(_0x8ee9('0x84')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x85'),require('./api/integration'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x86'),require('./api/integrationReport'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x87'),require(_0x8ee9('0x88')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x89'),require(_0x8ee9('0x8a')));_0x510058[_0x8ee9('0x7')]('/api/analytics/extracted_reports',require('./api/analyticExtractedReport'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x8b'),require('./api/analyticMetric'));_0x510058[_0x8ee9('0x7')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x8c'),require('./api/analyticTreeReport'));_0x510058[_0x8ee9('0x7')]('/api/integrations/salesforce/accounts',require(_0x8ee9('0x8d')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x8e'),require('./api/intSalesforceConfiguration'));_0x510058[_0x8ee9('0x7')]('/api/integrations/salesforce/fields',require(_0x8ee9('0x8f')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x90'),require(_0x8ee9('0x91')));_0x510058[_0x8ee9('0x7')]('/api/integrations/sugarcrm/configurations',require(_0x8ee9('0x92')));_0x510058['use']('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x510058['use'](_0x8ee9('0x93'),require(_0x8ee9('0x94')));_0x510058['use'](_0x8ee9('0x95'),require(_0x8ee9('0x96')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x97'),require(_0x8ee9('0x98')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x99'),require('./api/intZohoAccount'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x9a'),require(_0x8ee9('0x9b')));_0x510058['use'](_0x8ee9('0x9c'),require('./api/intZohoField'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x9d'),require(_0x8ee9('0x9e')));_0x510058[_0x8ee9('0x7')]('/api/integrations/zendesk/configurations',require(_0x8ee9('0x9f')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xa0'),require(_0x8ee9('0xa1')));_0x510058['use'](_0x8ee9('0xa2'),require(_0x8ee9('0xa3')));_0x510058['use']('/api/integrations/freshdesk/configurations',require('./api/intFreshdeskConfiguration'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xa4'),require('./api/intFreshdeskField'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xa5'),require(_0x8ee9('0xa6')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xa7'),require(_0x8ee9('0xa8')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xa9'),require(_0x8ee9('0xaa')));_0x510058[_0x8ee9('0x7')]('/api/integrations/servicenow/accounts',require(_0x8ee9('0xab')));_0x510058[_0x8ee9('0x7')]('/api/integrations/servicenow/configurations',require(_0x8ee9('0xac')));_0x510058[_0x8ee9('0x7')]('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xad'),require(_0x8ee9('0xae')));_0x510058['use'](_0x8ee9('0xaf'),require(_0x8ee9('0xb0')));_0x510058[_0x8ee9('0x7')]('/api/integrations/dynamics365/fields',require(_0x8ee9('0xb1')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xb2'),require(_0x8ee9('0xb3')));_0x510058['use'](_0x8ee9('0xb4'),require(_0x8ee9('0xb5')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xb6'),require(_0x8ee9('0xb7')));_0x510058['use'](_0x8ee9('0xb8'),require(_0x8ee9('0xb9')));_0x510058[_0x8ee9('0x7')]('/api/jscripty/questions/reports',require('./api/jscriptyQuestionReport'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xba'),require(_0x8ee9('0xbb')));_0x510058[_0x8ee9('0x7')]('/api/sms/reports/queue',require('./api/smsQueueReport'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xbc'),require(_0x8ee9('0xbd')));_0x510058[_0x8ee9('0x7')]('/api/square/details/reports',require(_0x8ee9('0xbe')));_0x510058['use'](_0x8ee9('0xbf'),require(_0x8ee9('0xc0')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xc1'),require('./api/setting'));_0x510058['use'](_0x8ee9('0xc2'),require(_0x8ee9('0xc3')));_0x510058['use']('/api/square/projects',require('./api/squareProject'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xc4'),require(_0x8ee9('0xc5')));_0x510058['use']('/api/square/messages',require(_0x8ee9('0xc6')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xc7'),require(_0x8ee9('0xc8')));_0x510058['use'](_0x8ee9('0xc9'),require(_0x8ee9('0xca')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xcb'),require(_0x8ee9('0xcc')));_0x510058[_0x8ee9('0x7')]('/api/migrations',require(_0x8ee9('0xcd')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xce'),require(_0x8ee9('0xcf')));_0x510058[_0x8ee9('0x7')]('/api/plugins',require(_0x8ee9('0xd0')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xd1'),require(_0x8ee9('0xd2')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xd3'),require(_0x8ee9('0xd4')));_0x510058['use'](_0x8ee9('0xd5'),require(_0x8ee9('0xd6')));_0x510058['use'](_0x8ee9('0xd7'),require(_0x8ee9('0xd8')));_0x510058['use']('/api/sms/reports/transfer',require(_0x8ee9('0xd9')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xda'),require(_0x8ee9('0xdb')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xdc'),require(_0x8ee9('0xdd')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xde'),require(_0x8ee9('0xdf')));_0x510058[_0x8ee9('0x7')]('/api/userProfile/sections',require(_0x8ee9('0xe0')));_0x510058['use'](_0x8ee9('0xe1'),require(_0x8ee9('0xe2')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xe3'),require(_0x8ee9('0xe4')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xe5'),require(_0x8ee9('0xe6')));_0x510058[_0x8ee9('0x7')]('/api/crm/workflowsteps',require(_0x8ee9('0xe7')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xe8'),require(_0x8ee9('0xe9')));_0x510058['use'](_0x8ee9('0xea'),require(_0x8ee9('0xeb')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xec'),require('./api/saTypeProduct'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xed'),require('./api/saUnitMeasure'));_0x510058[_0x8ee9('0x7')]('/api/sa/invoicelaws',require(_0x8ee9('0xee')));_0x510058['use']('/api/sa/products',require(_0x8ee9('0xef')));_0x510058[_0x8ee9('0x7')]('/api/sa/salescondions',require(_0x8ee9('0xf0')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xf1'),require(_0x8ee9('0xf2')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xf3'),require('./api/saProductPricesList'));_0x510058['use']('/api/sa/dossiers',require(_0x8ee9('0xf4')));_0x510058[_0x8ee9('0x7')]('/api/sa/requests',require('./api/saRequest'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xf5'),require(_0x8ee9('0xf6')));_0x510058[_0x8ee9('0x7')]('/api/sa/productquotations',require('./api/saProductQuotation'));_0x510058[_0x8ee9('0x7')]('/api/sa/orders',require('./api/saOrder'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0xf7'),require(_0x8ee9('0xf8')));_0x510058['use'](_0x8ee9('0xf9'),require(_0x8ee9('0xfa')));_0x510058['use'](_0x8ee9('0xfb'),require(_0x8ee9('0xfc')));_0x510058[_0x8ee9('0x7')]('/api/sa/invoice_details',require(_0x8ee9('0xfd')));_0x510058[_0x8ee9('0x7')]('/api/sa/proforma_details',require('./api/saProformaDetail'));_0x510058['use'](_0x8ee9('0xfe'),require(_0x8ee9('0xff')));_0x510058['use']('/api/sa/paymentMethods',require(_0x8ee9('0x100')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x101'),require('./api/saCreditNote'));_0x510058['use'](_0x8ee9('0x102'),require('./api/saCreditNoteDetail'));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x103'),require(_0x8ee9('0x104')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x105'),require('./api/saCreditNoteNumber'));_0x510058['use'](_0x8ee9('0x106'),require(_0x8ee9('0x107')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x108'),require(_0x8ee9('0x109')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x10a'),require(_0x8ee9('0x10b')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x10c'),require(_0x8ee9('0x10d')));_0x510058[_0x8ee9('0x7')]('/api/jira',require(_0x8ee9('0x10e')));_0x510058['use'](_0x8ee9('0x10f'),require('./api/rpc'));_0x510058['use'](_0x8ee9('0x110'),require(_0x8ee9('0x111')));_0x510058['use']('/api/system',require(_0x8ee9('0x112')));_0x510058['use'](_0x8ee9('0x113'),require(_0x8ee9('0x114')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x115'),express[_0x8ee9('0x116')](path['join'](config[_0x8ee9('0x117')],'/apidoc')));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x118'),express['static'](path[_0x8ee9('0x119')](config[_0x8ee9('0x117')],_0x8ee9('0x118'))));_0x510058['use'](_0x8ee9('0x11a'),express[_0x8ee9('0x116')](path[_0x8ee9('0x119')](config[_0x8ee9('0x117')],_0x8ee9('0x11a'))));_0x510058[_0x8ee9('0x7')](_0x8ee9('0x11b'),express[_0x8ee9('0x116')](path[_0x8ee9('0x119')](config[_0x8ee9('0x117')],_0x8ee9('0x11c'),_0x8ee9('0x11d'))));_0x510058['use'](_0x8ee9('0x11e'),express[_0x8ee9('0x116')](path[_0x8ee9('0x119')](config[_0x8ee9('0x117')],_0x8ee9('0x11f'))));_0x510058[_0x8ee9('0x120')](_0x8ee9('0x121'))[_0x8ee9('0x122')](errors[0x194]);_0x510058[_0x8ee9('0x120')]('/*')[_0x8ee9('0x122')](function(_0x55225b,_0x4851f7){_0x4851f7['sendFile'](path[_0x8ee9('0x123')](_0x510058[_0x8ee9('0x122')](_0x8ee9('0x124'))+_0x8ee9('0x125')));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 040a8bc..223dcff 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x777f=['../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','server','http','port','rpc','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueueReport/openchannelQueueReport.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/template/template.rpc','../api/trigger/trigger.rpc'];(function(_0x26f619,_0x134bb1){var _0x1f8ac2=function(_0x371dc8){while(--_0x371dc8){_0x26f619['push'](_0x26f619['shift']());}};_0x1f8ac2(++_0x134bb1);}(_0x777f,0x9f));var _0xf777=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x777f[_0x2b10c6];return _0x3789d2;};'use strict';var jayson=require(_0xf777('0x0'));var BPromise=require(_0xf777('0x1'));var _=require(_0xf777('0x2'));var config=require(_0xf777('0x3'));exports[_0xf777('0x4')]=function(){return new BPromise(function(_0x43f439,_0x13e74d){var _0x2612fe={};_0x2612fe=_['merge'](_0x2612fe,require(_0xf777('0x5')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require('../api/voiceExtension/voiceExtension.rpc'));_0x2612fe=_['merge'](_0x2612fe,require('../api/voiceQueue/voiceQueue.rpc'));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x7')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x8')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x9')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0xa')));_0x2612fe=_['merge'](_0x2612fe,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x2612fe=_['merge'](_0x2612fe,require(_0xf777('0xb')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require('../api/trunk/trunk.rpc'));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0xc')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0xd')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0xe')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0xf')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require('../api/mailInteraction/mailInteraction.rpc'));_0x2612fe=_['merge'](_0x2612fe,require(_0xf777('0x10')));_0x2612fe=_['merge'](_0x2612fe,require(_0xf777('0x11')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x12')));_0x2612fe=_['merge'](_0x2612fe,require(_0xf777('0x13')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x14')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x15')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x16')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x17')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x18')));_0x2612fe=_['merge'](_0x2612fe,require(_0xf777('0x19')));_0x2612fe=_['merge'](_0x2612fe,require(_0xf777('0x1a')));_0x2612fe=_['merge'](_0x2612fe,require(_0xf777('0x1b')));_0x2612fe=_['merge'](_0x2612fe,require('../api/smsQueue/smsQueue.rpc'));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x1c')));_0x2612fe=_['merge'](_0x2612fe,require(_0xf777('0x1d')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x2612fe=_['merge'](_0x2612fe,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x1e')));_0x2612fe=_['merge'](_0x2612fe,require('../api/chatInteraction/chatInteraction.rpc'));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require('../api/chatMessage/chatMessage.rpc'));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require('../api/chatQueue/chatQueue.rpc'));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require('../api/cmContact/cmContact.rpc'));_0x2612fe=_['merge'](_0x2612fe,require(_0xf777('0x1f')));_0x2612fe=_['merge'](_0x2612fe,require(_0xf777('0x20')));_0x2612fe=_['merge'](_0x2612fe,require(_0xf777('0x21')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x22')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x23')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require('../api/interval/interval.rpc'));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x24')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require('../api/sound/sound.rpc'));_0x2612fe=_['merge'](_0x2612fe,require(_0xf777('0x25')));_0x2612fe=_['merge'](_0x2612fe,require(_0xf777('0x26')));_0x2612fe=_['merge'](_0x2612fe,require(_0xf777('0x27')));_0x2612fe=_['merge'](_0x2612fe,require(_0xf777('0x28')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x29')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x2a')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x2b')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x2c')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x2d')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x2e')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x2f')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x30')));_0x2612fe=_['merge'](_0x2612fe,require(_0xf777('0x31')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x32')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x33')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x34')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require('../api/squareRecording/squareRecording.rpc'));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x35')));_0x2612fe=_[_0xf777('0x6')](_0x2612fe,require(_0xf777('0x36')));_0x2612fe=_['merge'](_0x2612fe,require(_0xf777('0x37')));_0x2612fe=_['merge'](_0x2612fe,require(_0xf777('0x38')));var _0x2dfac5=jayson[_0xf777('0x39')](_0x2612fe)[_0xf777('0x3a')]();var _0x59835a=config['rpc'][_0xf777('0x3b')]||config[_0xf777('0x3b')]+0x1;var _0x451bd0=config[_0xf777('0x3c')]['ip']||'localhost';_0x2dfac5['on'](_0xf777('0x3d'),function(_0x47e847){return _0x13e74d(_0x47e847);});_0x2dfac5['listen'](_0x59835a,_0x451bd0,function(){console[_0xf777('0x3e')](_0xf777('0x3f'),_0x451bd0,_0x59835a);require('../config/triggers')[_0xf777('0x40')]();return _0x43f439(_0xf777('0x41')+_0x451bd0+':'+_0x59835a);});});}; \ No newline at end of file +var _0x79a8=['../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/plugin/plugin.rpc','server','http','rpc','port','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.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/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x79a8,0x1d0));var _0x879a=function(_0x5ecaab,_0x2f3053){_0x5ecaab=_0x5ecaab-0x0;var _0x3db1a8=_0x79a8[_0x5ecaab];return _0x3db1a8;};'use strict';var jayson=require(_0x879a('0x0'));var BPromise=require('bluebird');var _=require(_0x879a('0x1'));var config=require(_0x879a('0x2'));exports[_0x879a('0x3')]=function(){return new BPromise(function(_0x5bb4c9,_0x27630f){var _0x49b7c0={};_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x5')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x6')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x7')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x8')));_0x49b7c0=_['merge'](_0x49b7c0,require(_0x879a('0x9')));_0x49b7c0=_['merge'](_0x49b7c0,require(_0x879a('0xa')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0xb')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require('../api/memberReport/memberReport.rpc'));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0xc')));_0x49b7c0=_['merge'](_0x49b7c0,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0xd')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0xe')));_0x49b7c0=_['merge'](_0x49b7c0,require(_0x879a('0xf')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x10')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x11')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x12')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x13')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x49b7c0=_['merge'](_0x49b7c0,require(_0x879a('0x14')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require('../api/faxApplication/faxApplication.rpc'));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x15')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x16')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x17')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x18')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x19')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x1a')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x1b')));_0x49b7c0=_['merge'](_0x49b7c0,require(_0x879a('0x1c')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x1d')));_0x49b7c0=_['merge'](_0x49b7c0,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x49b7c0=_['merge'](_0x49b7c0,require(_0x879a('0x1e')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x1f')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require('../api/chatInteraction/chatInteraction.rpc'));_0x49b7c0=_['merge'](_0x49b7c0,require(_0x879a('0x20')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x21')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x22')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x23')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x24')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x25')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x26')));_0x49b7c0=_['merge'](_0x49b7c0,require(_0x879a('0x27')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x28')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x29')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x2a')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x2b')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x2c')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x2d')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x2e')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x2f')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x30')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x49b7c0=_['merge'](_0x49b7c0,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x49b7c0=_['merge'](_0x49b7c0,require(_0x879a('0x31')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x32')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require('../api/squareReport/squareReport.rpc'));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x33')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x34')));_0x49b7c0=_['merge'](_0x49b7c0,require(_0x879a('0x35')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x36')));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require('../api/squareMessage/squareMessage.rpc'));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require('../api/campaign/campaign.rpc'));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require('../api/attachment/attachment.rpc'));_0x49b7c0=_[_0x879a('0x4')](_0x49b7c0,require(_0x879a('0x37')));var _0x5bffea=jayson[_0x879a('0x38')](_0x49b7c0)[_0x879a('0x39')]();var _0x2988e4=config[_0x879a('0x3a')]['port']||config[_0x879a('0x3b')]+0x1;var _0x3e2867=config[_0x879a('0x3a')]['ip']||'localhost';_0x5bffea['on']('error',function(_0x4a4bfc){return _0x27630f(_0x4a4bfc);});_0x5bffea['listen'](_0x2988e4,_0x3e2867,function(){console['log'](_0x879a('0x3c'),_0x3e2867,_0x2988e4);require(_0x879a('0x3d'))[_0x879a('0x3e')]();return _0x5bb4c9('RPC\x20listening\x20on\x20'+_0x3e2867+':'+_0x2988e4);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 5ceb0b9..1c00c8a 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 _0x0530=['520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','replace','indexOf','substr','startsWith','length','error','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','write','inherits','prototype','sendRequest','command','answer','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','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','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','setTimeout','setEncoding','headers','emit','ready','hangup','substring'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x0530,0x1a9));var _0x0053=function(_0x9bbe1,_0x1abd0e){_0x9bbe1=_0x9bbe1-0x0;var _0x3d5f76=_0x0530[_0x9bbe1];return _0x3d5f76;};'use strict';var util=require(_0x0053('0x0'));var _=require(_0x0053('0x1'));var EventEmitter=require(_0x0053('0x2'))[_0x0053('0x3')];var AGIReply=require(_0x0053('0x4'));var AGIError=require(_0x0053('0x5'));function AGIChannel(_0x3d0648){var _0x4300fb=this,_0x537d2d=new AGIReply(),_0x496a28=![],_0x580918={};EventEmitter['call'](_0x4300fb);_0x3d0648['setEncoding']('utf8');_0x3d0648[_0x0053('0x6')](0x8*0x3c*0x3c*0x3e8);_0x537d2d[_0x0053('0x7')]('utf8');_0x537d2d['on'](_0x0053('0x8'),function(_0x29d802){for(var _0x519f80 in _0x29d802){_0x4300fb[_0x519f80]=_0x29d802[_0x519f80];}_0x4300fb[_0x0053('0x9')](_0x0053('0xa'));});_0x537d2d['on']('line',function(_0x295e08){if(_0x295e08['toLowerCase']()=='hangup'){_0x4300fb['emit'](_0x0053('0xb'));return;}if(_0x295e08[_0x0053('0xc')](0x0,0xb)==_0x0053('0xd')){_0x496a28=!![];}if(_0x496a28){_0x580918['rx']+=_0x295e08+'\x0a';if(_0x295e08['search'](_0x0053('0xe'))!=-0x1){_0x496a28=![];}}else{_0x580918['rx']=_0x295e08;}if(_0x496a28){return;}if(typeof _0x580918['cb']==_0x0053('0xf')){var _0x28136c=_0x580918['rx'][_0x0053('0xc')](0x0,0x3),_0x4fb30e=null,_0x4d2dd2=null;_0x28136c=parseInt(_0x28136c);if(isNaN(_0x28136c)){_0x580918['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x0053('0x10')});return;}if(_0x28136c!=0xc8){_0x580918['cb'](null,{'code':_0x28136c,'result':-0x1,'extra':'KO'});return;}_0x4fb30e=_0x580918['rx'][_0x0053('0xc')](0x4)[_0x0053('0x11')]('result=','');if(_0x4fb30e[_0x0053('0x12')]('\x20')!=-0x1){_0x4fb30e=_0x4fb30e[_0x0053('0x13')](0x0,_0x4fb30e[_0x0053('0x12')]('\x20'));}if(_[_0x0053('0x14')](_0x4fb30e,'-1')){_0x4fb30e=parseInt(_0x4fb30e);}_0x4d2dd2=_0x580918['rx']['split']('\x20');if(_0x4d2dd2[_0x0053('0x15')]==0x3){_0x4d2dd2=_0x4d2dd2[0x2]['substring'](0x1,_0x4d2dd2[0x2]['length']-0x1);}else if(_0x4d2dd2['length']>0x3){var _0x26d99a=/\((.+)\)/;var _0x11376b=_0x580918['rx']['match'](_0x26d99a);if(_0x11376b){_0x4d2dd2=_0x11376b[0x1];}else{_0x4d2dd2=null;}}else{_0x4d2dd2=null;}_0x580918['cb'](null,{'code':_0x28136c,'result':_0x4fb30e,'extra':_0x4d2dd2});}});_0x3d0648['on'](_0x0053('0x16'),function(_0x27cb0f){_0x4300fb[_0x0053('0x9')]('error',new AGIError('E_AGI_SOCKET_ERROR',_0x27cb0f['code']));});_0x3d0648['on'](_0x0053('0x17'),function(){_0x4300fb[_0x0053('0x9')](_0x0053('0x17'),new AGIError(_0x0053('0x18')));});_0x3d0648['on'](_0x0053('0x19'),function(){_0x4300fb[_0x0053('0x9')]('timeout',new AGIError(_0x0053('0x1a')));_0x3d0648['destroy']();});_0x3d0648[_0x0053('0x1b')](_0x537d2d);this['command']=function(_0x5857ad,_0x46e705){var _0x5857ad=_0x5857ad||'',_0x46e705=typeof _0x46e705==_0x0053('0xf')?_0x46e705:new Function();_0x580918={'tx':_0x5857ad,'rx':'','cb':_0x46e705};_0x3d0648[_0x0053('0x1c')](_0x5857ad+'\x0a');},this['close']=function(){_0x3d0648['destroy']();};}util[_0x0053('0x1d')](AGIChannel,EventEmitter);AGIChannel[_0x0053('0x1e')][_0x0053('0x1f')]=function(_0x566677){return this[_0x0053('0x20')]['sync'](this,_0x566677);};AGIChannel[_0x0053('0x1e')][_0x0053('0x21')]=function(){return this[_0x0053('0x1f')]('ANSWER');};AGIChannel['prototype'][_0x0053('0x22')]=function(_0xfbde8b,_0x5674ae,_0x222267){_0xfbde8b=_0xfbde8b===undefined?_0x0053('0x23'):_0xfbde8b;_0x5674ae=_0x5674ae===undefined?'5':_0x5674ae;_0x222267=_0x222267===undefined?'1':_0x222267;return this[_0x0053('0x1f')](util[_0x0053('0x24')](_0x0053('0x25'),_0xfbde8b,_0x5674ae*0x3e8,_0x222267));};AGIChannel[_0x0053('0x1e')]['noop']=function(_0x48bbc0){_0x48bbc0=_0x48bbc0||_0x0053('0x26');return this[_0x0053('0x1f')](util[_0x0053('0x24')]('VERBOSE\x20\x22%s\x22',_0x48bbc0));};AGIChannel['prototype']['exec']=function(_0x215b8a,_0x21e29b){if(_[_0x0053('0x27')](_0x21e29b)){return this[_0x0053('0x1f')](util[_0x0053('0x24')](_0x0053('0x28'),_0x215b8a,_0x21e29b[_0x0053('0x29')](',')));}return this[_0x0053('0x1f')](util[_0x0053('0x24')](_0x0053('0x28'),_0x215b8a,_0x21e29b));};AGIChannel[_0x0053('0x1e')][_0x0053('0x2a')]=function(_0x4463eb){return this['sendRequest'](util[_0x0053('0x24')](_0x0053('0x2b'),_0x4463eb));};AGIChannel[_0x0053('0x1e')][_0x0053('0x2c')]=function(_0x471ee1){return this[_0x0053('0x1f')](util['format'](_0x0053('0x2d'),_0x471ee1));};AGIChannel[_0x0053('0x1e')][_0x0053('0x2e')]=function(_0x12c6ee){return this[_0x0053('0x1f')](util['format'](_0x0053('0x2f'),_0x12c6ee));};AGIChannel[_0x0053('0x1e')][_0x0053('0xb')]=function(){return this['sendRequest'](_0x0053('0x30'));};AGIChannel[_0x0053('0x1e')][_0x0053('0x31')]=function(_0x2dbef1,_0x1f6c0a){return this[_0x0053('0x1f')](util['format'](_0x0053('0x32'),_0x2dbef1,_0x1f6c0a?_0x1f6c0a[_0x0053('0x33')]()[_0x0053('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x0053('0x1e')]['sayNumber']=function(_0x59a591,_0x5c4ab3){return this['sendRequest'](util['format'](_0x0053('0x34'),_0x59a591,_0x5c4ab3));};AGIChannel[_0x0053('0x1e')][_0x0053('0x35')]=function(_0x4c9299,_0x1ffbd7){return this[_0x0053('0x1f')](util['format'](_0x0053('0x36'),_0x4c9299,_0x1ffbd7));};AGIChannel['prototype'][_0x0053('0x37')]=function(_0x120db1,_0x5026ad){return this[_0x0053('0x1f')](util[_0x0053('0x24')](_0x0053('0x38'),_0x120db1,_0x5026ad));};AGIChannel[_0x0053('0x1e')][_0x0053('0x39')]=function(_0x3ec695,_0x2909e7,_0x3c91bd){_0x2909e7=_0x2909e7||this[_0x0053('0x3a')];_0x3c91bd=_0x3c91bd||0x1;this[_0x0053('0x2a')](_0x3ec695);this[_0x0053('0x2c')](_0x2909e7);this[_0x0053('0x2e')](_0x3c91bd);return this['noop'](util[_0x0053('0x24')](_0x0053('0x3b'),_0x3ec695,_0x2909e7,_0x3c91bd));};AGIChannel[_0x0053('0x1e')][_0x0053('0x3c')]=function(_0x227566){return this[_0x0053('0x1f')](util['format'](_0x0053('0x3d'),_0x227566));};AGIChannel[_0x0053('0x1e')]['recordFile']=function(_0x56bb4c,_0x11e76f,_0x51af7f,_0x2f6788,_0x555252,_0xf4831f){_0x11e76f=_0x11e76f||'wav';_0x51af7f=_0x51af7f||'';_0x2f6788=_0x2f6788===undefined?-0x1:_0x2f6788==='-1'?-0x1:_0x2f6788*0x3e8;_0x555252=_0x555252===undefined?'':'s='+_0x555252;_0xf4831f=_0xf4831f?_0x0053('0x3e'):'';return this[_0x0053('0x1f')](util[_0x0053('0x24')](_0x0053('0x3f'),_0x56bb4c,_0x11e76f,_0x51af7f,_0x2f6788,_0xf4831f,_0x555252));};AGIChannel[_0x0053('0x1e')][_0x0053('0x40')]=function(_0x505ae2,_0x3cccec){_0x3cccec=_0x3cccec||'';return this[_0x0053('0x1f')](util[_0x0053('0x24')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x505ae2,_0x3cccec));};AGIChannel[_0x0053('0x1e')][_0x0053('0x41')]=function(_0x449fa6){return this[_0x0053('0x42')](_0x0053('0x43'),_0x449fa6);};AGIChannel['prototype'][_0x0053('0x44')]=function(_0x5d3671){return this[_0x0053('0x42')](_0x0053('0x45'),_0x5d3671);};AGIChannel['prototype'][_0x0053('0x16')]=function(_0x2d7cd1,_0x51dc88){this['noop'](util['format'](_0x0053('0x46'),_0x2d7cd1['id'],_0x2d7cd1[_0x0053('0x47')],_0x51dc88));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x0053('0x48')]=AGIChannel; \ No newline at end of file +var _0x10c4=['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','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','call','utf8','setEncoding','headers','emit','ready','line','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','result=','indexOf','startsWith','split','length','substring','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','inherits','prototype','sync','answer','sendRequest','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','SET\x20VARIABLE\x20%s\x20\x22%s\x22','replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22'];(function(_0x57bb7c,_0x4cb1c8){var _0x412b58=function(_0x38be37){while(--_0x38be37){_0x57bb7c['push'](_0x57bb7c['shift']());}};_0x412b58(++_0x4cb1c8);}(_0x10c4,0x1d9));var _0x410c=function(_0x332307,_0xbf76f5){_0x332307=_0x332307-0x0;var _0x587079=_0x10c4[_0x332307];return _0x587079;};'use strict';var util=require(_0x410c('0x0'));var _=require(_0x410c('0x1'));var EventEmitter=require(_0x410c('0x2'))[_0x410c('0x3')];var AGIReply=require(_0x410c('0x4'));var AGIError=require(_0x410c('0x5'));function AGIChannel(_0x1b3ba8){var _0x26b4f1=this,_0x1cb058=new AGIReply(),_0x4b9300=![],_0xeeff18={};EventEmitter[_0x410c('0x6')](_0x26b4f1);_0x1b3ba8['setEncoding'](_0x410c('0x7'));_0x1b3ba8['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x1cb058[_0x410c('0x8')](_0x410c('0x7'));_0x1cb058['on'](_0x410c('0x9'),function(_0x3fa49d){for(var _0x3e36a9 in _0x3fa49d){_0x26b4f1[_0x3e36a9]=_0x3fa49d[_0x3e36a9];}_0x26b4f1[_0x410c('0xa')](_0x410c('0xb'));});_0x1cb058['on'](_0x410c('0xc'),function(_0x574f26){if(_0x574f26[_0x410c('0xd')]()=='hangup'){_0x26b4f1[_0x410c('0xa')](_0x410c('0xe'));return;}if(_0x574f26['substring'](0x0,0xb)==_0x410c('0xf')){_0x4b9300=!![];}if(_0x4b9300){_0xeeff18['rx']+=_0x574f26+'\x0a';if(_0x574f26[_0x410c('0x10')](_0x410c('0x11'))!=-0x1){_0x4b9300=![];}}else{_0xeeff18['rx']=_0x574f26;}if(_0x4b9300){return;}if(typeof _0xeeff18['cb']==_0x410c('0x12')){var _0x12d556=_0xeeff18['rx']['substring'](0x0,0x3),_0x338dbf=null,_0x4a8d55=null;_0x12d556=parseInt(_0x12d556);if(isNaN(_0x12d556)){_0xeeff18['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x410c('0x13')});return;}if(_0x12d556!=0xc8){_0xeeff18['cb'](null,{'code':_0x12d556,'result':-0x1,'extra':'KO'});return;}_0x338dbf=_0xeeff18['rx']['substring'](0x4)['replace'](_0x410c('0x14'),'');if(_0x338dbf[_0x410c('0x15')]('\x20')!=-0x1){_0x338dbf=_0x338dbf['substr'](0x0,_0x338dbf['indexOf']('\x20'));}if(_[_0x410c('0x16')](_0x338dbf,'-1')){_0x338dbf=parseInt(_0x338dbf);}_0x4a8d55=_0xeeff18['rx'][_0x410c('0x17')]('\x20');if(_0x4a8d55[_0x410c('0x18')]==0x3){_0x4a8d55=_0x4a8d55[0x2][_0x410c('0x19')](0x1,_0x4a8d55[0x2][_0x410c('0x18')]-0x1);}else if(_0x4a8d55[_0x410c('0x18')]>0x3){var _0x110bfb=/\((.+)\)/;var _0x5c5de3=_0xeeff18['rx'][_0x410c('0x1a')](_0x110bfb);if(_0x5c5de3){_0x4a8d55=_0x5c5de3[0x1];}else{_0x4a8d55=null;}}else{_0x4a8d55=null;}_0xeeff18['cb'](null,{'code':_0x12d556,'result':_0x338dbf,'extra':_0x4a8d55});}});_0x1b3ba8['on'](_0x410c('0x1b'),function(_0x29459a){_0x26b4f1[_0x410c('0xa')](_0x410c('0x1b'),new AGIError(_0x410c('0x1c'),_0x29459a['code']));});_0x1b3ba8['on'](_0x410c('0x1d'),function(){_0x26b4f1[_0x410c('0xa')](_0x410c('0x1d'),new AGIError(_0x410c('0x1e')));});_0x1b3ba8['on'](_0x410c('0x1f'),function(){_0x26b4f1[_0x410c('0xa')](_0x410c('0x1f'),new AGIError(_0x410c('0x20')));_0x1b3ba8[_0x410c('0x21')]();});_0x1b3ba8[_0x410c('0x22')](_0x1cb058);this['command']=function(_0x2e8174,_0x43572d){var _0x2e8174=_0x2e8174||'',_0x43572d=typeof _0x43572d==_0x410c('0x12')?_0x43572d:new Function();_0xeeff18={'tx':_0x2e8174,'rx':'','cb':_0x43572d};_0x1b3ba8['write'](_0x2e8174+'\x0a');},this[_0x410c('0x1d')]=function(){_0x1b3ba8[_0x410c('0x21')]();};}util[_0x410c('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x410c('0x24')]['sendRequest']=function(_0x2a783f){return this['command'][_0x410c('0x25')](this,_0x2a783f);};AGIChannel['prototype'][_0x410c('0x26')]=function(){return this[_0x410c('0x27')](_0x410c('0x28'));};AGIChannel['prototype'][_0x410c('0x29')]=function(_0x1f3567,_0xd316e3,_0x59f23f){_0x1f3567=_0x1f3567===undefined?_0x410c('0x2a'):_0x1f3567;_0xd316e3=_0xd316e3===undefined?'5':_0xd316e3;_0x59f23f=_0x59f23f===undefined?'1':_0x59f23f;return this[_0x410c('0x27')](util[_0x410c('0x2b')](_0x410c('0x2c'),_0x1f3567,_0xd316e3*0x3e8,_0x59f23f));};AGIChannel['prototype'][_0x410c('0x2d')]=function(_0x5519f2){_0x5519f2=_0x5519f2||'NO\x20MESSAGE';return this['sendRequest'](util['format'](_0x410c('0x2e'),_0x5519f2));};AGIChannel[_0x410c('0x24')][_0x410c('0x2f')]=function(_0x1cf961,_0xa0b1d6){if(_['isArray'](_0xa0b1d6)){return this[_0x410c('0x27')](util[_0x410c('0x2b')](_0x410c('0x30'),_0x1cf961,_0xa0b1d6['join'](',')));}return this['sendRequest'](util[_0x410c('0x2b')](_0x410c('0x30'),_0x1cf961,_0xa0b1d6));};AGIChannel[_0x410c('0x24')]['setContext']=function(_0x11600f){return this[_0x410c('0x27')](util[_0x410c('0x2b')](_0x410c('0x31'),_0x11600f));};AGIChannel['prototype'][_0x410c('0x32')]=function(_0x1a07a9){return this[_0x410c('0x27')](util['format'](_0x410c('0x33'),_0x1a07a9));};AGIChannel['prototype'][_0x410c('0x34')]=function(_0x51fded){return this['sendRequest'](util[_0x410c('0x2b')](_0x410c('0x35'),_0x51fded));};AGIChannel[_0x410c('0x24')][_0x410c('0xe')]=function(){return this[_0x410c('0x27')](_0x410c('0x36'));};AGIChannel[_0x410c('0x24')]['setVariable']=function(_0x14b055,_0x49384a){return this['sendRequest'](util['format'](_0x410c('0x37'),_0x14b055,_0x49384a?_0x49384a['toString']()[_0x410c('0x38')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x410c('0x24')][_0x410c('0x39')]=function(_0x52099b,_0xc50ef6){return this[_0x410c('0x27')](util[_0x410c('0x2b')](_0x410c('0x3a'),_0x52099b,_0xc50ef6));};AGIChannel[_0x410c('0x24')][_0x410c('0x3b')]=function(_0x51437a,_0x18319c){return this['sendRequest'](util['format'](_0x410c('0x3c'),_0x51437a,_0x18319c));};AGIChannel[_0x410c('0x24')][_0x410c('0x3d')]=function(_0x540661,_0x46b788){return this[_0x410c('0x27')](util[_0x410c('0x2b')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x540661,_0x46b788));};AGIChannel[_0x410c('0x24')][_0x410c('0x3e')]=function(_0x5d0dfb,_0x44297d,_0x32286c){_0x44297d=_0x44297d||this[_0x410c('0x3f')];_0x32286c=_0x32286c||0x1;this['setContext'](_0x5d0dfb);this['setExtension'](_0x44297d);this[_0x410c('0x34')](_0x32286c);return this[_0x410c('0x2d')](util[_0x410c('0x2b')](_0x410c('0x40'),_0x5d0dfb,_0x44297d,_0x32286c));};AGIChannel[_0x410c('0x24')]['getVariable']=function(_0x35d56c){return this[_0x410c('0x27')](util[_0x410c('0x2b')](_0x410c('0x41'),_0x35d56c));};AGIChannel[_0x410c('0x24')][_0x410c('0x42')]=function(_0x350c63,_0x56a00a,_0x36fab8,_0x1533ba,_0x2a208c,_0x161608){_0x56a00a=_0x56a00a||_0x410c('0x43');_0x36fab8=_0x36fab8||'';_0x1533ba=_0x1533ba===undefined?-0x1:_0x1533ba==='-1'?-0x1:_0x1533ba*0x3e8;_0x2a208c=_0x2a208c===undefined?'':'s='+_0x2a208c;_0x161608=_0x161608?_0x410c('0x44'):'';return this['sendRequest'](util[_0x410c('0x2b')](_0x410c('0x45'),_0x350c63,_0x56a00a,_0x36fab8,_0x1533ba,_0x161608,_0x2a208c));};AGIChannel[_0x410c('0x24')][_0x410c('0x46')]=function(_0x2fd68b,_0x1c73a1){_0x1c73a1=_0x1c73a1||'';return this[_0x410c('0x27')](util[_0x410c('0x2b')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x2fd68b,_0x1c73a1));};AGIChannel[_0x410c('0x24')][_0x410c('0x47')]=function(_0x11f8e7){return this[_0x410c('0x2f')](_0x410c('0x48'),_0x11f8e7);};AGIChannel[_0x410c('0x24')][_0x410c('0x49')]=function(_0x4213cc){return this[_0x410c('0x2f')]('WAIT',_0x4213cc);};AGIChannel[_0x410c('0x24')][_0x410c('0x1b')]=function(_0x6f2058,_0x35aad1){this[_0x410c('0x2d')](util[_0x410c('0x2b')](_0x410c('0x4a'),_0x6f2058['id'],_0x6f2058[_0x410c('0x4b')],_0x35aad1));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x410c('0x4c')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 3112aa9..a9982d2 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 _0xe5ca=['Undefined\x20error.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','apply','message','name','exports'];(function(_0x5b69e3,_0x2aabaa){var _0x35b163=function(_0x15554b){while(--_0x15554b){_0x5b69e3['push'](_0x5b69e3['shift']());}};_0x35b163(++_0x2aabaa);}(_0xe5ca,0x160));var _0xae5c=function(_0x216d45,_0x4989fe){_0x216d45=_0x216d45-0x0;var _0xbaac0b=_0xe5ca[_0x216d45];return _0xbaac0b;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xae5c('0x0'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xae5c('0x1'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xae5c('0x2'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xae5c('0x3'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x518aa6){var _0x518aa6=_0x518aa6||null,_0xfd16c1=_0xfd16c1||[],_0x516c13=0x1,_0x5b2010='';if(!error[_0x518aa6]){_0x518aa6=_0xae5c('0x4');}_0xfd16c1[_0xae5c('0x5')](error[_0x518aa6]);while(arguments[_0x516c13]){_0xfd16c1[_0xae5c('0x5')](arguments[_0x516c13]);_0x516c13++;}_0x5b2010=util[_0xae5c('0x6')][_0xae5c('0x7')](util,_0xfd16c1);this[_0xae5c('0x8')]=_0x5b2010;this[_0xae5c('0x9')]=_0x518aa6;}module[_0xae5c('0xa')]=AGIError; \ No newline at end of file +var _0x8192=['format','apply','message','name','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push'];(function(_0x595998,_0x24c904){var _0x1854c7=function(_0x5b448c){while(--_0x5b448c){_0x595998['push'](_0x595998['shift']());}};_0x1854c7(++_0x24c904);}(_0x8192,0x164));var _0x2819=function(_0x5b2a1d,_0x12305c){_0x5b2a1d=_0x5b2a1d-0x0;var _0x7d4850=_0x8192[_0x5b2a1d];return _0x7d4850;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x2819('0x0'),'E_AGI_ARGUMENT_PORT':_0x2819('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x2819('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x2819('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x2819('0x4'),'E_AGI_SOCKET_ERROR':_0x2819('0x5'),'E_AGI_SOCKET_CLOSE':_0x2819('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x2819('0x7'),'E_AGI_COMMAND_EMPTY':_0x2819('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x2819('0x9'),'E_AGI_IVR_ENTRY':_0x2819('0xa')};function AGIError(_0x467ce6){var _0x467ce6=_0x467ce6||null,_0x2ac69d=_0x2ac69d||[],_0x3e1d56=0x1,_0x442442='';if(!error[_0x467ce6]){_0x467ce6='E_AGI_UNDEFINED';}_0x2ac69d[_0x2819('0xb')](error[_0x467ce6]);while(arguments[_0x3e1d56]){_0x2ac69d[_0x2819('0xb')](arguments[_0x3e1d56]);_0x3e1d56++;}_0x442442=util[_0x2819('0xc')][_0x2819('0xd')](util,_0x2ac69d);this[_0x2819('0xe')]=_0x442442;this[_0x2819('0xf')]=_0x467ce6;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 88d68fc..eb2ad80 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 _0x7be1=['split','vswitch','target','agicommand','menu','invalid','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','lodash','../../../config/logger','agi','getdigits','getsecretdigits','vertices','edges','numberOfEdges','addEdge','push','prototype','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','length','no\x20edge/s\x20available','condition'];(function(_0x329a73,_0x55e5c0){var _0x483783=function(_0x462760){while(--_0x462760){_0x329a73['push'](_0x329a73['shift']());}};_0x483783(++_0x55e5c0);}(_0x7be1,0x165));var _0x17be=function(_0x47888a,_0x7d2f3a){_0x47888a=_0x47888a-0x0;var _0x2b15a4=_0x7be1[_0x47888a];return _0x2b15a4;};'use strict';var _=require(_0x17be('0x0'));var logger=require(_0x17be('0x1'))(_0x17be('0x2'));var verticesWithRetry=['menu',_0x17be('0x3'),_0x17be('0x4')];var Graph=function(){this[_0x17be('0x5')]={};this[_0x17be('0x6')]={};this[_0x17be('0x7')]=0x0;};Graph['prototype']['addVertex']=function(_0x55257a){this[_0x17be('0x5')][_0x55257a['id']]=_0x55257a;this[_0x17be('0x6')][_0x55257a['id']]=[];};Graph['prototype'][_0x17be('0x8')]=function(_0x23f19f,_0x2c74b2,_0xfd9c5){this[_0x17be('0x6')][_0x23f19f][_0x17be('0x9')]({'target':_0x2c74b2,'condition':_0xfd9c5});this['numberOfEdges']+=0x1;};Graph[_0x17be('0xa')]['size']=function(){return _[_0x17be('0xb')](this[_0x17be('0x5')]);};Graph['prototype'][_0x17be('0xc')]=function(){return this[_0x17be('0x7')];};Graph[_0x17be('0xa')][_0x17be('0xd')]=function(_0x4ddc25){return this[_0x17be('0x5')][_0x4ddc25];};Graph['prototype'][_0x17be('0xe')]=function(_0x4f4ad6,_0x2af298){if(!this[_0x17be('0x5')][_0x4f4ad6]){return logger[_0x17be('0xf')](_0x17be('0x10'));}var _0xfbfeeb=_0x2af298(this['vertices'][_0x4f4ad6]);if(!_0xfbfeeb){return logger[_0x17be('0xf')]('stop\x20traverse');}if(this['edges'][_0x4f4ad6][_0x17be('0x11')]===0x0){return logger['info'](_0x17be('0x12'));}for(var _0x4abdbc=0x0,_0x2aa9a6=[],_0x312b2e=![];_0x4abdbc\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid','uniqueid','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','maxRetry','retry','omit','mxCell','source','target','addEdge','value','getSquareProject','catch','createSquareReport','then','indexOf','substring','inspect','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','close','timeout','hangup','sync','start','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','code','result','response','toString','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','Project\x20%s\x20not\x20published','continueAt'];(function(_0x38f737,_0x54f685){var _0x7afda3=function(_0x1ac1d7){while(--_0x1ac1d7){_0x38f737['push'](_0x38f737['shift']());}};_0x7afda3(++_0x54f685);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x5b1bae,_0x1fb44b){_0x5b1bae=_0x5b1bae-0x0;var _0x4b127b=_0x0fda[_0x5b1bae];return _0x4b127b;};'use strict';var parser=require(_0xa0fd('0x0'));var _=require('lodash');var syncho=require(_0xa0fd('0x1'));var util=require(_0xa0fd('0x2'));var moment=require(_0xa0fd('0x3'));var config=require(_0xa0fd('0x4'));var logger=require(_0xa0fd('0x5'))(_0xa0fd('0x6'));var utilLicense=require(_0xa0fd('0x7'));var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0xa0fd('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0xa0fd('0x9')](config[_0xa0fd('0x6')],{'ip':_0xa0fd('0xa'),'port':0x11dd});function connectionHandler(_0x248cca){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x248cca);agiHandler(_0x248cca);}catch(_0x29da4c){logger[_0xa0fd('0xb')](_0x29da4c[_0xa0fd('0xc')]);}});});}function listeningHandler(){console[_0xa0fd('0xd')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xa0fd('0x6')][_0xa0fd('0xe')]);logger[_0xa0fd('0xf')](util['format'](_0xa0fd('0x10'),config[_0xa0fd('0x6')]['ip'],config[_0xa0fd('0x6')][_0xa0fd('0xe')]));}function errorHandler(_0x455457){if(_0x455457&&_0x455457['name']&&_0x455457['message']){logger[_0xa0fd('0xb')](util[_0xa0fd('0x11')]('[%s]\x20%s',_0x455457[_0xa0fd('0x12')],_0x455457[_0xa0fd('0x13')]));}else{logger[_0xa0fd('0xb')](util[_0xa0fd('0x11')](_0xa0fd('0x14'),_0x455457[_0xa0fd('0xc')]));}}function closeHandler(){logger[_0xa0fd('0xf')](util['format'](_0xa0fd('0x15'),this[_0xa0fd('0x16')],this['calleridname'],this['callerid'],this[_0xa0fd('0x17')],this[_0xa0fd('0x18')]));try{createSquareReport(this);}catch(_0x5d2d7b){logger[_0xa0fd('0xb')](_0x5d2d7b[_0xa0fd('0xc')]);}}function timeoutHandler(){logger[_0xa0fd('0xf')](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xa0fd('0x16')],this['calleridname'],this[_0xa0fd('0x19')],this[_0xa0fd('0x17')],this[_0xa0fd('0x18')]));}function hangupHandler(){logger[_0xa0fd('0xf')](util[_0xa0fd('0x11')](_0xa0fd('0x1a'),this[_0xa0fd('0x16')],this['calleridname'],this[_0xa0fd('0x19')],this[_0xa0fd('0x17')],this[_0xa0fd('0x18')]));this[_0xa0fd('0x1b')]=!![];}function getRoot(_0x26e3a4){return parser[_0xa0fd('0x1c')](_0x26e3a4,{'object':!![]})[_0xa0fd('0x1d')][_0xa0fd('0x1e')];}function addVertex(_0xda6f53,_0x13fc62,_0x28dbda){_0x13fc62[_0xa0fd('0x1f')]=_0x28dbda;if(_0x13fc62[_0xa0fd('0x20')]('retry')){_0x13fc62[_0xa0fd('0x21')]=parseInt(_0x13fc62[_0xa0fd('0x22')],0xa);}_0xda6f53['addVertex'](_[_0xa0fd('0x23')](_0x13fc62,_0xa0fd('0x24')));}function initGraph(_0x4f9258,_0x5bb0ee){var _0x2e9b0d=new Graph();for(var _0x267899 in _0x4f9258){if(_0x4f9258['hasOwnProperty'](_0x267899)){if(_['isArray'](_0x4f9258[_0x267899])){for(var _0x5b50c0=0x0;_0x5b50c0<_0x4f9258[_0x267899]['length'];_0x5b50c0+=0x1){addVertex(_0x2e9b0d,_0x4f9258[_0x267899][_0x5b50c0],_0x267899);}}else{addVertex(_0x2e9b0d,_0x4f9258[_0x267899],_0x267899);}}}for(var _0x11d7f1=0x0;_0x11d7f1<_0x5bb0ee['length'];_0x11d7f1+=0x1){if(_0x5bb0ee[_0x11d7f1][_0xa0fd('0x25')]&&_0x5bb0ee[_0x11d7f1][_0xa0fd('0x26')]){_0x2e9b0d[_0xa0fd('0x27')](_0x5bb0ee[_0x11d7f1]['source'],_0x5bb0ee[_0x11d7f1][_0xa0fd('0x26')],_0x5bb0ee[_0x11d7f1][_0xa0fd('0x28')]);}}return _0x2e9b0d;}function getSquareProject(_0x4feb93,_0x1dd0c4){rpc[_0xa0fd('0x29')](_0x4feb93)['then'](function(_0x366921){_0x1dd0c4(null,_0x366921);})[_0xa0fd('0x2a')](function(_0x72c222){_0x1dd0c4(null,_0x72c222);});}function createSquareReport(_0x2993aa,_0x5b4581){rpc[_0xa0fd('0x2b')](_0x2993aa)[_0xa0fd('0x2c')](function(_0x5e1b8e){if(_0x5b4581){_0x5b4581(null,_0x5e1b8e);}})['catch'](function(_0x581071){if(_0x5b4581){_0x5b4581(null,_0x581071);}});}function setChannelVariables(_0x1fc249){for(var _0x481271 in _0x1fc249){if(_0x1fc249['hasOwnProperty'](_0x481271)){if(_0x481271[_0xa0fd('0x2d')]('agi_')===0x0){_0x1fc249[_0x481271[_0xa0fd('0x2e')](0x4)]=_0x1fc249[_0x481271];delete _0x1fc249[_0x481271];}}}}function getLogFromObject(_0x410246){return util[_0xa0fd('0x2f')](_0x410246,{'showHidden':![],'depth':null});}function agiHandler(_0x2081dc){var _0x1f6e72,_0x3de88b,_0x3d2e32,_0x3187ef,_0x4ce77f;logger[_0xa0fd('0x30')]('variables',JSON[_0xa0fd('0x31')](_0x2081dc,null,0x2));logger['info'](util['format'](_0xa0fd('0x32'),_0x2081dc['arg_1'],_0x2081dc[_0xa0fd('0x33')],_0x2081dc[_0xa0fd('0x19')],_0x2081dc[_0xa0fd('0x17')],_0x2081dc[_0xa0fd('0x18')]));_0x2081dc['on']('error',errorHandler);_0x2081dc['on'](_0xa0fd('0x34'),closeHandler);_0x2081dc['on'](_0xa0fd('0x35'),timeoutHandler);_0x2081dc[_0xa0fd('0x1b')]=![];_0x2081dc['on'](_0xa0fd('0x36'),hangupHandler);var _0x2e3cfa=getSquareProject[_0xa0fd('0x37')](null,_0x2081dc[_0xa0fd('0x16')]);if(_0x2e3cfa){if(_0x2e3cfa['production']){_0x1f6e72=getRoot(_0x2e3cfa['production']);if(_0x1f6e72&&_0x1f6e72[_0xa0fd('0x38')]){logger[_0xa0fd('0x30')](_0xa0fd('0x1e'),JSON[_0xa0fd('0x31')](_0x1f6e72,null,0x2));_0x2081dc['joinAt']=moment()[_0xa0fd('0x11')](_0xa0fd('0x39'));_0x3de88b=initGraph(_[_0xa0fd('0x23')](_0x1f6e72,_0xa0fd('0x24')),_0x1f6e72[_0xa0fd('0x24')]);_0x3d2e32=new Vertices(_0x2081dc,rpc,mailRpc);logger['info'](util[_0xa0fd('0x11')](_0xa0fd('0x3a'),_0x2081dc['arg_1'],_0x2081dc['calleridname'],_0x2081dc[_0xa0fd('0x19')],_0x2081dc[_0xa0fd('0x17')],_0x2081dc[_0xa0fd('0x18')]));_0x3de88b[_0xa0fd('0x3b')](_0x1f6e72[_0xa0fd('0x38')]['id'],function(_0xbeca16){try{_0xbeca16=_0x3d2e32[_0xa0fd('0x3c')](_0xbeca16);logger[_0xa0fd('0x30')](_0xa0fd('0x3d'),JSON[_0xa0fd('0x31')](_0xbeca16,null,0x2));if(_0xbeca16[_0xa0fd('0x1f')]===_0xa0fd('0x3e')){logger[_0xa0fd('0xf')](_0xa0fd('0x3f'));_0x2081dc[_0xa0fd('0x40')]=_0xbeca16['context']||_0x2081dc['context'];_0x2081dc['extension']=_0xbeca16[_0xa0fd('0x41')];_0x2081dc[_0xa0fd('0x42')]=_0xbeca16[_0xa0fd('0x42')]?_0xbeca16['priority']-0x1:0x1;return null;}else if(_0xbeca16&&_0x3d2e32[_0xbeca16[_0xa0fd('0x1f')]]){_0x4ce77f=_0x3d2e32[_0xbeca16[_0xa0fd('0x1f')]](_0xbeca16);logger[_0xa0fd('0xf')]('response',JSON[_0xa0fd('0x31')](_0x4ce77f,null,0x2));if(_0x4ce77f&&_0x4ce77f[_0xa0fd('0x43')]===AGI_CODE_SUCCESS&&_0x4ce77f[_0xa0fd('0x44')]!==AGI_RESULT_ERROR&&!_0x2081dc[_0xa0fd('0x1b')]){logger[_0xa0fd('0x30')](_0xa0fd('0x45'),getLogFromObject(_0x4ce77f));return _['isUndefined'](_0x4ce77f[_0xa0fd('0x44')])?null:_0x4ce77f[_0xa0fd('0x44')][_0xa0fd('0x46')]();}else{logger[_0xa0fd('0xb')](_0xa0fd('0x45'),getLogFromObject(_0x4ce77f));return null;}}else{logger[_0xa0fd('0xb')]('agicommand\x20not\x20found');return null;}}catch(_0x2ccdf7){logger[_0xa0fd('0xb')](_0x2ccdf7[_0xa0fd('0xc')]);return null;}});if(_0x1f6e72[_0xa0fd('0x47')]){logger[_0xa0fd('0xf')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2081dc[_0xa0fd('0x16')],_0x2081dc[_0xa0fd('0x33')],_0x2081dc[_0xa0fd('0x19')],_0x2081dc[_0xa0fd('0x17')],_0x2081dc[_0xa0fd('0x18')]));_0x3de88b['traverseBFS'](_0x1f6e72[_0xa0fd('0x47')]['id'],function(_0x3cd0d0){try{_0x3cd0d0=_0x3d2e32[_0xa0fd('0x3c')](_0x3cd0d0);logger[_0xa0fd('0x30')](_0xa0fd('0x3d'),JSON[_0xa0fd('0x31')](_0x3cd0d0,null,0x2));if(_0x3cd0d0&&_0x3d2e32[_0x3cd0d0['agicommand']]){_0x4ce77f=_0x3d2e32[_0x3cd0d0['agicommand']](_0x3cd0d0);if(_0x4ce77f){logger['debug'](_0xa0fd('0x45'),getLogFromObject(_0x4ce77f));return _['isUndefined'](_0x4ce77f['result'])?null:_0x4ce77f[_0xa0fd('0x44')]['toString']();}else{logger[_0xa0fd('0xb')](_0xa0fd('0x45'),getLogFromObject(_0x4ce77f));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x213e67){logger[_0xa0fd('0xb')](_0x213e67[_0xa0fd('0xc')]);return null;}});}logger[_0xa0fd('0xf')](util[_0xa0fd('0x11')](_0xa0fd('0x48'),_0x2081dc['arg_1'],_0x2081dc['calleridname'],_0x2081dc['callerid'],_0x2081dc['dnid'],_0x2081dc[_0xa0fd('0x18')]));logger[_0xa0fd('0xf')](util[_0xa0fd('0x11')](_0xa0fd('0x49'),_0x2081dc[_0xa0fd('0x40')],_0x2081dc['extension'],parseInt(_0x2081dc['priority'],0xa)+0x1));_0x2081dc['continueAt'](_0x2081dc['context'],_0x2081dc['extension'],parseInt(_0x2081dc[_0xa0fd('0x42')],0xa)+0x1);_0x2081dc[_0xa0fd('0x34')]();}}else{logger[_0xa0fd('0xb')](util[_0xa0fd('0x11')](_0xa0fd('0x4a'),_0x2081dc[_0xa0fd('0x16')]));_0x2081dc[_0xa0fd('0x4b')](_0x2081dc[_0xa0fd('0x40')],_0x2081dc[_0xa0fd('0x41')],parseInt(_0x2081dc[_0xa0fd('0x42')],0xa)+0x1);_0x2081dc['close']();}}else{logger['error'](util[_0xa0fd('0x11')](_0xa0fd('0x4c'),_0x2081dc[_0xa0fd('0x16')]));_0x2081dc[_0xa0fd('0x4b')](_0x2081dc['context'],_0x2081dc[_0xa0fd('0x41')],parseInt(_0x2081dc[_0xa0fd('0x42')],0xa)+0x1);_0x2081dc['close']();}}function main(){var _0x920e0f;return utilLicense['getLicense']()[_0xa0fd('0x2c')](function(_0x39578a){if(_0x39578a){if(_0x39578a['voice']){if(_0x39578a[_0xa0fd('0x4d')]&&_0x39578a[_0xa0fd('0x4d')]>0x0){logger[_0xa0fd('0xf')](util[_0xa0fd('0x11')](_0xa0fd('0x4e'),_0x39578a[_0xa0fd('0x4d')]));_0x920e0f=_0x39578a[_0xa0fd('0x4d')];}else{logger[_0xa0fd('0xf')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xa0fd('0xf')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x920e0f=-0x1;}}})[_0xa0fd('0x2a')](function(_0x4205ac){logger[_0xa0fd('0xb')](_0xa0fd('0x4f'),_0x4205ac[_0xa0fd('0xc')]);})['finally'](function(){var _0x31710d=require(_0xa0fd('0x50'))(config['agi'][_0xa0fd('0xe')],config[_0xa0fd('0x6')]['ip'],_0x920e0f);_0x31710d['on'](_0xa0fd('0xb'),errorHandler);_0x31710d['on']('listening',listeningHandler);_0x31710d['on'](_0xa0fd('0x51'),connectionHandler);_0x31710d['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0xd13e=['stack','log','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\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','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','length','source','target','value','getSquareProject','catch','createSquareReport','then','agi_','substring','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','production','root','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','start','clear','vertex','gotoc','context','extension','priority','response','code','result','isUndefined','agicommand\x20not\x20found','finally','toString','[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:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','xml2json','lodash','syncho','util','../../config/environment','agi','./rpc','./mailRpc','defaults','127.0.0.1','nextTick','error'];(function(_0x5646b0,_0x453a95){var _0x295c45=function(_0x3da741){while(--_0x3da741){_0x5646b0['push'](_0x5646b0['shift']());}};_0x295c45(++_0x453a95);}(_0xd13e,0x193));var _0xed13=function(_0x237491,_0x468620){_0x237491=_0x237491-0x0;var _0x1e60e7=_0xd13e[_0x237491];return _0x1e60e7;};'use strict';var parser=require(_0xed13('0x0'));var _=require(_0xed13('0x1'));var syncho=require(_0xed13('0x2'));var util=require(_0xed13('0x3'));var moment=require('moment');var config=require(_0xed13('0x4'));var logger=require('../../config/logger')(_0xed13('0x5'));var utilLicense=require('../../config/license/util');var rpc=require(_0xed13('0x6'));var mailRpc=require(_0xed13('0x7'));var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0xed13('0x8')](config[_0xed13('0x5')],{'ip':_0xed13('0x9'),'port':0x11dd});function connectionHandler(_0x3b3984){process[_0xed13('0xa')](function(){syncho(function(){try{setChannelVariables(_0x3b3984);agiHandler(_0x3b3984);}catch(_0x2ba0d2){logger[_0xed13('0xb')](_0x2ba0d2[_0xed13('0xc')]);}});});}function listeningHandler(){console[_0xed13('0xd')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xed13('0x5')][_0xed13('0xe')]);logger[_0xed13('0xf')](util[_0xed13('0x10')](_0xed13('0x11'),config['agi']['ip'],config[_0xed13('0x5')][_0xed13('0xe')]));}function errorHandler(_0x2c68db){if(_0x2c68db&&_0x2c68db[_0xed13('0x12')]&&_0x2c68db[_0xed13('0x13')]){logger[_0xed13('0xb')](util['format'](_0xed13('0x14'),_0x2c68db['name'],_0x2c68db[_0xed13('0x13')]));}else{logger['error'](util[_0xed13('0x10')]('[ERROR]\x20%s',_0x2c68db[_0xed13('0xc')]));}}function closeHandler(){logger['info'](util[_0xed13('0x10')](_0xed13('0x15'),this[_0xed13('0x16')],this[_0xed13('0x17')],this[_0xed13('0x18')],this[_0xed13('0x19')],this[_0xed13('0x1a')]));try{createSquareReport(this);}catch(_0x1148a3){logger[_0xed13('0xb')](_0x1148a3[_0xed13('0xc')]);}}function timeoutHandler(){logger[_0xed13('0xf')](util[_0xed13('0x10')](_0xed13('0x1b'),this[_0xed13('0x16')],this[_0xed13('0x17')],this[_0xed13('0x18')],this['dnid'],this['uniqueid']));}function hangupHandler(){logger[_0xed13('0xf')](util[_0xed13('0x10')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xed13('0x16')],this['calleridname'],this['callerid'],this[_0xed13('0x19')],this[_0xed13('0x1a')]));this[_0xed13('0x1c')]=!![];}function getRoot(_0x192d12){return parser[_0xed13('0x1d')](_0x192d12,{'object':!![]})[_0xed13('0x1e')]['root'];}function addVertex(_0x5c0daf,_0x5d7ae1,_0x19d51b){_0x5d7ae1[_0xed13('0x1f')]=_0x19d51b;if(_0x5d7ae1[_0xed13('0x20')](_0xed13('0x21'))){_0x5d7ae1[_0xed13('0x22')]=parseInt(_0x5d7ae1[_0xed13('0x21')],0xa);}_0x5c0daf[_0xed13('0x23')](_[_0xed13('0x24')](_0x5d7ae1,_0xed13('0x25')));}function initGraph(_0x2f05f0,_0x1f064c){var _0x3bc666=new Graph();for(var _0x2c6c33 in _0x2f05f0){if(_0x2f05f0[_0xed13('0x20')](_0x2c6c33)){if(_['isArray'](_0x2f05f0[_0x2c6c33])){for(var _0x5e399c=0x0;_0x5e399c<_0x2f05f0[_0x2c6c33][_0xed13('0x26')];_0x5e399c+=0x1){addVertex(_0x3bc666,_0x2f05f0[_0x2c6c33][_0x5e399c],_0x2c6c33);}}else{addVertex(_0x3bc666,_0x2f05f0[_0x2c6c33],_0x2c6c33);}}}for(var _0x2ebdf6=0x0;_0x2ebdf6<_0x1f064c['length'];_0x2ebdf6+=0x1){if(_0x1f064c[_0x2ebdf6][_0xed13('0x27')]&&_0x1f064c[_0x2ebdf6][_0xed13('0x28')]){_0x3bc666['addEdge'](_0x1f064c[_0x2ebdf6][_0xed13('0x27')],_0x1f064c[_0x2ebdf6][_0xed13('0x28')],_0x1f064c[_0x2ebdf6][_0xed13('0x29')]);}}return _0x3bc666;}function getSquareProject(_0x570929,_0x3a5387){rpc[_0xed13('0x2a')](_0x570929)['then'](function(_0x433665){_0x3a5387(null,_0x433665);})[_0xed13('0x2b')](function(_0x56619a){_0x3a5387(null,_0x56619a);});}function createSquareReport(_0x11cb93,_0x43c061){rpc[_0xed13('0x2c')](_0x11cb93)[_0xed13('0x2d')](function(_0x1e34b6){if(_0x43c061){_0x43c061(null,_0x1e34b6);}})[_0xed13('0x2b')](function(_0xe332){if(_0x43c061){_0x43c061(null,_0xe332);}});}function setChannelVariables(_0x5b3828){for(var _0x7ee14a in _0x5b3828){if(_0x5b3828['hasOwnProperty'](_0x7ee14a)){if(_0x7ee14a['indexOf'](_0xed13('0x2e'))===0x0){_0x5b3828[_0x7ee14a[_0xed13('0x2f')](0x4)]=_0x5b3828[_0x7ee14a];delete _0x5b3828[_0x7ee14a];}}}}function getLogFromObject(_0x13e3bb){return util['inspect'](_0x13e3bb,{'showHidden':![],'depth':null});}function agiHandler(_0x2ee6e3){var _0x2dc3cb,_0x389ed3,_0x5bf415,_0x2f5abf,_0x1c6070;logger[_0xed13('0x30')](_0xed13('0x31'),JSON['stringify'](_0x2ee6e3,null,0x2));logger[_0xed13('0xf')](util[_0xed13('0x10')](_0xed13('0x32'),_0x2ee6e3[_0xed13('0x16')],_0x2ee6e3[_0xed13('0x17')],_0x2ee6e3[_0xed13('0x18')],_0x2ee6e3[_0xed13('0x19')],_0x2ee6e3[_0xed13('0x1a')]));_0x2ee6e3['on'](_0xed13('0xb'),errorHandler);_0x2ee6e3['on'](_0xed13('0x33'),closeHandler);_0x2ee6e3['on']('timeout',timeoutHandler);_0x2ee6e3[_0xed13('0x1c')]=![];_0x2ee6e3['on'](_0xed13('0x34'),hangupHandler);var _0x59384b=getSquareProject['sync'](null,_0x2ee6e3['arg_1']);if(_0x59384b){if(_0x59384b[_0xed13('0x35')]){_0x2dc3cb=getRoot(_0x59384b[_0xed13('0x35')]);if(_0x2dc3cb&&_0x2dc3cb['start']){logger['debug'](_0xed13('0x36'),JSON[_0xed13('0x37')](_0x2dc3cb,null,0x2));_0x2ee6e3[_0xed13('0x38')]=moment()[_0xed13('0x10')](_0xed13('0x39'));_0x389ed3=initGraph(_['omit'](_0x2dc3cb,'mxCell'),_0x2dc3cb[_0xed13('0x25')]);_0x5bf415=new Vertices(_0x2ee6e3,rpc,mailRpc);logger['info'](util[_0xed13('0x10')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2ee6e3[_0xed13('0x16')],_0x2ee6e3['calleridname'],_0x2ee6e3['callerid'],_0x2ee6e3['dnid'],_0x2ee6e3[_0xed13('0x1a')]));_0x389ed3[_0xed13('0x3a')](_0x2dc3cb[_0xed13('0x3b')]['id'],function(_0x42d5f7){try{_0x42d5f7=_0x5bf415[_0xed13('0x3c')](_0x42d5f7);logger['debug'](_0xed13('0x3d'),JSON[_0xed13('0x37')](_0x42d5f7,null,0x2));if(_0x42d5f7[_0xed13('0x1f')]===_0xed13('0x3e')){logger[_0xed13('0xf')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x2ee6e3[_0xed13('0x3f')]=_0x42d5f7[_0xed13('0x3f')]||_0x2ee6e3[_0xed13('0x3f')];_0x2ee6e3[_0xed13('0x40')]=_0x42d5f7[_0xed13('0x40')];_0x2ee6e3[_0xed13('0x41')]=_0x42d5f7['priority']?_0x42d5f7[_0xed13('0x41')]-0x1:0x1;return null;}else if(_0x42d5f7&&_0x5bf415[_0x42d5f7[_0xed13('0x1f')]]){_0x1c6070=_0x5bf415[_0x42d5f7[_0xed13('0x1f')]](_0x42d5f7);logger[_0xed13('0xf')](_0xed13('0x42'),JSON[_0xed13('0x37')](_0x1c6070,null,0x2));if(_0x1c6070&&_0x1c6070[_0xed13('0x43')]===AGI_CODE_SUCCESS&&_0x1c6070[_0xed13('0x44')]!==AGI_RESULT_ERROR&&!_0x2ee6e3[_0xed13('0x1c')]){logger[_0xed13('0x30')](_0xed13('0x42'),getLogFromObject(_0x1c6070));return _[_0xed13('0x45')](_0x1c6070[_0xed13('0x44')])?null:_0x1c6070[_0xed13('0x44')]['toString']();}else{logger[_0xed13('0xb')](_0xed13('0x42'),getLogFromObject(_0x1c6070));return null;}}else{logger['error'](_0xed13('0x46'));return null;}}catch(_0xbcaba0){logger[_0xed13('0xb')](_0xbcaba0['stack']);return null;}});if(_0x2dc3cb[_0xed13('0x47')]){logger[_0xed13('0xf')](util[_0xed13('0x10')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2ee6e3['arg_1'],_0x2ee6e3[_0xed13('0x17')],_0x2ee6e3[_0xed13('0x18')],_0x2ee6e3['dnid'],_0x2ee6e3[_0xed13('0x1a')]));_0x389ed3[_0xed13('0x3a')](_0x2dc3cb[_0xed13('0x47')]['id'],function(_0x278505){try{_0x278505=_0x5bf415['clear'](_0x278505);logger[_0xed13('0x30')](_0xed13('0x3d'),JSON[_0xed13('0x37')](_0x278505,null,0x2));if(_0x278505&&_0x5bf415[_0x278505[_0xed13('0x1f')]]){_0x1c6070=_0x5bf415[_0x278505['agicommand']](_0x278505);if(_0x1c6070){logger[_0xed13('0x30')]('response',getLogFromObject(_0x1c6070));return _[_0xed13('0x45')](_0x1c6070['result'])?null:_0x1c6070['result'][_0xed13('0x48')]();}else{logger[_0xed13('0xb')]('response',getLogFromObject(_0x1c6070));return null;}}else{logger[_0xed13('0xb')](_0xed13('0x46'));return null;}}catch(_0x41df8f){logger[_0xed13('0xb')](_0x41df8f['stack']);return null;}});}logger[_0xed13('0xf')](util['format'](_0xed13('0x49'),_0x2ee6e3[_0xed13('0x16')],_0x2ee6e3[_0xed13('0x17')],_0x2ee6e3[_0xed13('0x18')],_0x2ee6e3[_0xed13('0x19')],_0x2ee6e3[_0xed13('0x1a')]));logger[_0xed13('0xf')](util[_0xed13('0x10')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x2ee6e3[_0xed13('0x3f')],_0x2ee6e3[_0xed13('0x40')],parseInt(_0x2ee6e3[_0xed13('0x41')],0xa)+0x1));_0x2ee6e3[_0xed13('0x4a')](_0x2ee6e3['context'],_0x2ee6e3[_0xed13('0x40')],parseInt(_0x2ee6e3['priority'],0xa)+0x1);_0x2ee6e3[_0xed13('0x33')]();}}else{logger['error'](util['format']('Project\x20%s\x20not\x20published',_0x2ee6e3[_0xed13('0x16')]));_0x2ee6e3[_0xed13('0x4a')](_0x2ee6e3[_0xed13('0x3f')],_0x2ee6e3['extension'],parseInt(_0x2ee6e3[_0xed13('0x41')],0xa)+0x1);_0x2ee6e3[_0xed13('0x33')]();}}else{logger[_0xed13('0xb')](util[_0xed13('0x10')](_0xed13('0x4b'),_0x2ee6e3['arg_1']));_0x2ee6e3[_0xed13('0x4a')](_0x2ee6e3[_0xed13('0x3f')],_0x2ee6e3[_0xed13('0x40')],parseInt(_0x2ee6e3[_0xed13('0x41')],0xa)+0x1);_0x2ee6e3['close']();}}function main(){var _0x2b7ec9;return utilLicense[_0xed13('0x4c')]()[_0xed13('0x2d')](function(_0x24a00d){if(_0x24a00d){if(_0x24a00d[_0xed13('0x4d')]){if(_0x24a00d[_0xed13('0x4e')]&&_0x24a00d[_0xed13('0x4e')]>0x0){logger['info'](util[_0xed13('0x10')]('[LICENSE]\x20CHANNELS:\x20%s',_0x24a00d[_0xed13('0x4e')]));_0x2b7ec9=_0x24a00d['callysquare'];}else{logger[_0xed13('0xf')](_0xed13('0x4f'));}}else{logger[_0xed13('0xf')](_0xed13('0x50'));_0x2b7ec9=-0x1;}}})[_0xed13('0x2b')](function(_0x50d211){logger['error'](_0xed13('0x51'),_0x50d211[_0xed13('0xc')]);})[_0xed13('0x47')](function(){var _0x1d6de4=require(_0xed13('0x52'))(config[_0xed13('0x5')][_0xed13('0xe')],config[_0xed13('0x5')]['ip'],_0x2b7ec9);_0x1d6de4['on'](_0xed13('0xb'),errorHandler);_0x1d6de4['on']('listening',listeningHandler);_0x1d6de4['on']('connection',connectionHandler);_0x1d6de4['on']('close',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 2d49aa1..cf7e53f 100644 --- a/server/services/agi/mailRpc/index.js +++ b/server/services/agi/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x326836,_0xc09668){var _0x1709d7=function(_0x5a38ba){while(--_0x5a38ba){_0x326836['push'](_0x326836['shift']());}};_0x1709d7(++_0xc09668);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file +var _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x381b35,_0xbe6456){var _0x16adc2=function(_0x2b6b31){while(--_0x2b6b31){_0x381b35['push'](_0x381b35['shift']());}};_0x16adc2(++_0xbe6456);}(_0x814b,0x1a2));var _0xb814=function(_0x28cbc0,_0x203516){_0x28cbc0=_0x28cbc0-0x0;var _0x4b3cf5=_0x814b[_0x28cbc0];return _0x4b3cf5;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index f7485ae..d6061ef 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(_0x4d2b7f,_0x4836b9){var _0x1ee7d0=function(_0xda247a){while(--_0xda247a){_0x4d2b7f['push'](_0x4d2b7f['shift']());}};_0x1ee7d0(++_0x4836b9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x26dddb,_0x357835){_0x26dddb=_0x26dddb-0x0;var _0x5a1b78=_0x5f2f[_0x26dddb];return _0x5a1b78;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file +var _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0x254abd,_0x1ab7f0){var _0x31bf1b=function(_0x447fd8){while(--_0x447fd8){_0x254abd['push'](_0x254abd['shift']());}};_0x31bf1b(++_0x1ab7f0);}(_0xb10b,0x12a));var _0xbb10=function(_0x50c710,_0x504134){_0x50c710=_0x50c710-0x0;var _0x2d5f79=_0xb10b[_0x50c710];return _0x2d5f79;};'use strict';var util=require(_0xbb10('0x0'));var Transform=require('stream')[_0xbb10('0x1')];function AGIReply(_0x35bc5f){Transform[_0xbb10('0x2')](this,_0x35bc5f);this['_localBuffer']='';this[_0xbb10('0x3')]=![];}util[_0xbb10('0x4')](AGIReply,Transform);AGIReply[_0xbb10('0x5')][_0xbb10('0x6')]=function(_0x49baf4,_0x312b72,_0x481979){var _0x328583='\x0a',_0x3cdd53=['\x0a\x0a',_0xbb10('0x7')],_0x513741=-0x1,_0x1b9e94=-0x1,_0x3fb675='',_0x21370f=0x0,_0x1c3ee5='',_0x2353ef='';this[_0xbb10('0x8')]+=_0x49baf4[_0xbb10('0x9')]();_0x1c3ee5=this['_localBuffer'];if(!this['_inBody']){_0x21370f=0x0;while(_0x3cdd53[_0x21370f]){while((_0x1b9e94=_0x1c3ee5[_0xbb10('0xa')](_0x3cdd53[_0x21370f]))!=-0x1){_0x3fb675=_0x3cdd53[_0x21370f];_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x1b9e94);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x1b9e94+_0x3fb675['length']);var _0x408248=_0x2353ef[_0xbb10('0xc')](_0x328583),_0x5be7e0=0x0,_0x44fb19={},_0x916a32='',_0x285009='',_0x193a27=-0x1;while(_0x408248[_0x5be7e0]){_0x193a27=_0x408248[_0x5be7e0][_0xbb10('0xa')](':');if(_0x193a27!=-0x1){_0x916a32=_0x408248[_0x5be7e0]['slice'](0x0,_0x193a27)[_0xbb10('0xd')]();_0x285009=_0x408248[_0x5be7e0][_0xbb10('0xe')](_0x193a27+0x1)[_0xbb10('0xd')]();if(_0x916a32[_0xbb10('0xf')]>0x0){_0x44fb19[_0x916a32]=_0x285009;}}else{}_0x5be7e0++;}this[_0xbb10('0x10')](_0xbb10('0x11'),_0x44fb19);this[_0xbb10('0x3')]=!![];}_0x21370f++;}this[_0xbb10('0x8')]=_0x1c3ee5;}else{while((_0x513741=_0x1c3ee5[_0xbb10('0xa')](_0x328583))!=-0x1){_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x513741);this['emit'](_0xbb10('0x12'),_0x2353ef);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x513741+_0x328583[_0xbb10('0xf')]);}this[_0xbb10('0x8')]=_0x1c3ee5;}_0x481979();};module[_0xbb10('0x13')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index e742dd6..368535c 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 _0x6629=['util','client','http','then','error','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','name','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','Interval','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','bluebird','moment'];(function(_0x46d68b,_0x154971){var _0x3a7893=function(_0x17e56a){while(--_0x17e56a){_0x46d68b['push'](_0x46d68b['shift']());}};_0x3a7893(++_0x154971);}(_0x6629,0x1a9));var _0x9662=function(_0x247022,_0x5d5966){_0x247022=_0x247022-0x0;var _0xb0acda=_0x6629[_0x247022];return _0xb0acda;};'use strict';var BPromise=require(_0x9662('0x0'));var moment=require(_0x9662('0x1'));var _=require('lodash');var util=require(_0x9662('0x2'));var jayson=require('jayson/promise');var client=jayson[_0x9662('0x3')][_0x9662('0x4')]({'port':0x2329});function request(_0x123fd0,_0x4e765a){return new BPromise(function(_0x54a4cf,_0x480e15){return client['request'](_0x123fd0,_0x4e765a)[_0x9662('0x5')](function(_0xbc3676){if(_0xbc3676[_0x9662('0x6')]){return _0x480e15(_0xbc3676[_0x9662('0x6')][_0x9662('0x7')]);}else{return _0x54a4cf(_0xbc3676[_0x9662('0x8')]);}})[_0x9662('0x9')](function(_0x1ae47c){return _0x480e15(_0x1ae47c);});});}exports[_0x9662('0xa')]=function(_0x5061b9){return request(_0x9662('0xb'),{'options':{'raw':![],'where':{'name':_0x5061b9},'attributes':[_0x9662('0xc')]}});};exports[_0x9662('0xd')]=function(_0x552558){return request(_0x9662('0xe'),{'options':{'raw':![],'where':{'id':_0x552558},'include':[{'model':'MailServerOut','as':_0x9662('0xf')}],'attributes':['id','name',_0x9662('0x10')]}});};exports[_0x9662('0x11')]=function(_0x32dac3){return request('ShowSquareProject',{'options':{'where':{'id':_0x32dac3},'attributes':['name']}});};exports[_0x9662('0x12')]=function(_0x40e742){return request(_0x9662('0x13'),{'options':{'where':{'id':_0x40e742},'attributes':[_0x9662('0x14')]}});};exports[_0x9662('0x15')]=function(_0x5ba300){return request(_0x9662('0x16'),{'options':{'where':{'id':_0x5ba300},'attributes':[_0x9662('0x14')]}});};exports[_0x9662('0x17')]=function(_0x5056da){return request(_0x9662('0x18'),{'options':{'where':{'id':_0x5056da},'attributes':[_0x9662('0x19')]}});};exports[_0x9662('0x1a')]=function(_0x43dcbb){return request('ShowUser',{'options':{'where':{'id':_0x43dcbb},'attributes':[_0x9662('0x14')]}});};exports['getTrunkById']=function(_0x3fa206){return request(_0x9662('0x1b'),{'options':{'where':{'id':_0x3fa206},'attributes':[_0x9662('0x14')]}});};exports[_0x9662('0x1c')]=function(_0x52f59c){return request(_0x9662('0x1d'),{'options':{'where':{'id':_0x52f59c},'attributes':[_0x9662('0x1e')]}});};exports[_0x9662('0x1f')]=function(_0x1cfb24){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x1cfb24},'include':[{'model':_0x9662('0x20'),'as':'Intervals'}]}});};exports[_0x9662('0x21')]=function(_0x3920b0){return request('ShowSmsAccount',{'options':{'where':{'id':_0x3920b0},'attributes':['id',_0x9662('0x14')]}});};exports[_0x9662('0x22')]=function(_0x565b45){return request(_0x9662('0x23'),{'body':_0x565b45});};exports[_0x9662('0x24')]=function(_0x1ff22f){return request(_0x9662('0x25'),{'body':_0x1ff22f});};exports[_0x9662('0x26')]=function(_0x4b7c21){return request(_0x9662('0x27'),{'body':_[_0x9662('0x28')](_0x4b7c21,{'project_name':_0x4b7c21[_0x9662('0x29')],'prev_project_name':_0x4b7c21[_0x9662('0x2a')]||'','is_subproject':_0x4b7c21[_0x9662('0x2a')]?!![]:![],'leaveAt':moment()['format'](_0x9662('0x2b'))})});};exports[_0x9662('0x2c')]=function(_0x317f5e){return request(_0x9662('0x2d'),{'body':_0x317f5e});};exports[_0x9662('0x2e')]=function(_0xfb0240){return request(_0x9662('0x2f'),{'body':_0xfb0240});};exports[_0x9662('0x30')]=function(_0x47f56a){return request(_0x9662('0x31'),{'options':{'raw':![],'where':{'phone':_0x47f56a[_0x9662('0x32')],'ListId':_0x47f56a['ListId']}}})[_0x9662('0x5')](function(_0x302024){if(_0x302024){return _0x302024;}return request(_0x9662('0x33'),{'body':_0x47f56a});});};exports[_0x9662('0x34')]=function(_0x41a3ec){return request(_0x9662('0x35'),{'options':{'where':{'id':_0x41a3ec},'attributes':[_0x9662('0x14')]}});};exports[_0x9662('0x36')]=function(_0x1acc29,_0x74a6bd){return request(_0x9662('0x37'),{'body':{'interface':_0x74a6bd},'options':{'where':_0x1acc29}});};exports[_0x9662('0x38')]=function(_0x3cad29,_0x132463,_0x275f18){return request(_0x9662('0x39'),{'body':{'type':_0x132463,'uniqueid':_0x275f18},'options':{'where':_0x3cad29}});};exports['agentUnpause']=function(_0xa11b13){return request(_0x9662('0x3a'),{'body':{},'options':{'where':_0xa11b13}});};exports[_0x9662('0x3b')]=function(_0x4b292b){return request(_0x9662('0x3c'),{'body':{},'options':{'where':_0x4b292b}});}; \ No newline at end of file +var _0x5686=['createCmContact','phone','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','bluebird','moment','lodash','util','jayson/promise','client','http','then','error','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','dsn','ShowUser','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage'];(function(_0x388402,_0x1de21f){var _0xb1830e=function(_0x477f98){while(--_0x477f98){_0x388402['push'](_0x388402['shift']());}};_0xb1830e(++_0x1de21f);}(_0x5686,0x1be));var _0x6568=function(_0x26a10d,_0xe5c001){_0x26a10d=_0x26a10d-0x0;var _0xf90201=_0x5686[_0x26a10d];return _0xf90201;};'use strict';var BPromise=require(_0x6568('0x0'));var moment=require(_0x6568('0x1'));var _=require(_0x6568('0x2'));var util=require(_0x6568('0x3'));var jayson=require(_0x6568('0x4'));var client=jayson[_0x6568('0x5')][_0x6568('0x6')]({'port':0x2329});function request(_0x2e381f,_0x2e4089){return new BPromise(function(_0x24129b,_0xc95c){return client['request'](_0x2e381f,_0x2e4089)[_0x6568('0x7')](function(_0x25b5b4){if(_0x25b5b4[_0x6568('0x8')]){return _0xc95c(_0x25b5b4[_0x6568('0x8')][_0x6568('0x9')]);}else{return _0x24129b(_0x25b5b4[_0x6568('0xa')]);}})[_0x6568('0xb')](function(_0x20d8f1){return _0xc95c(_0x20d8f1);});});}exports[_0x6568('0xc')]=function(_0x94265e){return request(_0x6568('0xd'),{'options':{'raw':![],'where':{'name':_0x94265e},'attributes':[_0x6568('0xe')]}});};exports[_0x6568('0xf')]=function(_0x108822){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x108822},'include':[{'model':_0x6568('0x10'),'as':_0x6568('0x11')}],'attributes':['id',_0x6568('0x12'),_0x6568('0x13')]}});};exports[_0x6568('0x14')]=function(_0x3302b6){return request(_0x6568('0xd'),{'options':{'where':{'id':_0x3302b6},'attributes':[_0x6568('0x12')]}});};exports[_0x6568('0x15')]=function(_0x492eb7){return request(_0x6568('0x16'),{'options':{'where':{'id':_0x492eb7},'attributes':['name']}});};exports[_0x6568('0x17')]=function(_0x1b554f){return request(_0x6568('0x18'),{'options':{'where':{'id':_0x1b554f},'attributes':[_0x6568('0x12')]}});};exports['getSquareOdbcById']=function(_0x4d986a){return request(_0x6568('0x19'),{'options':{'where':{'id':_0x4d986a},'attributes':[_0x6568('0x1a')]}});};exports['getUserById']=function(_0x314bb0){return request(_0x6568('0x1b'),{'options':{'where':{'id':_0x314bb0},'attributes':[_0x6568('0x12')]}});};exports['getTrunkById']=function(_0x32696c){return request(_0x6568('0x1c'),{'options':{'where':{'id':_0x32696c},'attributes':[_0x6568('0x12')]}});};exports['getSoundById']=function(_0x2dd363){return request(_0x6568('0x1d'),{'options':{'where':{'id':_0x2dd363},'attributes':[_0x6568('0x1e')]}});};exports[_0x6568('0x1f')]=function(_0xf8d8df){return request(_0x6568('0x20'),{'options':{'raw':![],'where':{'id':_0xf8d8df},'include':[{'model':_0x6568('0x21'),'as':_0x6568('0x22')}]}});};exports['getSmsAccountById']=function(_0x1d18a0){return request(_0x6568('0x23'),{'options':{'where':{'id':_0x1d18a0},'attributes':['id',_0x6568('0x12')]}});};exports[_0x6568('0x24')]=function(_0x13181f){return request(_0x6568('0x25'),{'body':_0x13181f});};exports[_0x6568('0x26')]=function(_0x27fa7e){return request(_0x6568('0x27'),{'body':_0x27fa7e});};exports['createSquareReport']=function(_0x561cbe){return request(_0x6568('0x28'),{'body':_[_0x6568('0x29')](_0x561cbe,{'project_name':_0x561cbe[_0x6568('0x2a')],'prev_project_name':_0x561cbe[_0x6568('0x2b')]||'','is_subproject':_0x561cbe['arg_2']?!![]:![],'leaveAt':moment()[_0x6568('0x2c')](_0x6568('0x2d'))})});};exports[_0x6568('0x2e')]=function(_0x287656){return request(_0x6568('0x2f'),{'body':_0x287656});};exports[_0x6568('0x30')]=function(_0x2c445a){return request(_0x6568('0x31'),{'body':_0x2c445a});};exports[_0x6568('0x32')]=function(_0x6e2eb5){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x6e2eb5[_0x6568('0x33')],'ListId':_0x6e2eb5['ListId']}}})[_0x6568('0x7')](function(_0x12695){if(_0x12695){return _0x12695;}return request(_0x6568('0x34'),{'body':_0x6e2eb5});});};exports[_0x6568('0x35')]=function(_0x3e3e0f){return request(_0x6568('0x36'),{'options':{'where':{'id':_0x3e3e0f},'attributes':[_0x6568('0x12')]}});};exports[_0x6568('0x37')]=function(_0x338ba1,_0x11e399){return request(_0x6568('0x38'),{'body':{'interface':_0x11e399},'options':{'where':_0x338ba1}});};exports[_0x6568('0x39')]=function(_0x1ca65e,_0x30bc35,_0x3c8553){return request(_0x6568('0x3a'),{'body':{'type':_0x30bc35,'uniqueid':_0x3c8553},'options':{'where':_0x1ca65e}});};exports[_0x6568('0x3b')]=function(_0x24d78c){return request(_0x6568('0x3c'),{'body':{},'options':{'where':_0x24d78c}});};exports[_0x6568('0x3d')]=function(_0x55e303){return request('LogoutUser',{'body':{},'options':{'where':_0x55e303}});}; \ 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 b7311e7..d87a093 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 _0x08b2=['./lex','exports'];(function(_0x5667a5,_0x4b96b0){var _0x147384=function(_0x3a7f96){while(--_0x3a7f96){_0x5667a5['push'](_0x5667a5['shift']());}};_0x147384(++_0x4b96b0);}(_0x08b2,0xc0));var _0x208b=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x08b2[_0xc4001c];return _0x49f7bc;};var polly=require('./polly');var lex=require(_0x208b('0x0'));module[_0x208b('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x1ccc=['exports','./polly'];(function(_0xec624f,_0x13811e){var _0x1f512c=function(_0x183cad){while(--_0x183cad){_0xec624f['push'](_0xec624f['shift']());}};_0x1f512c(++_0x13811e);}(_0x1ccc,0x10d));var _0xc1cc=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0x1ccc[_0xf0bc07];return _0x1c50c2;};var polly=require(_0xc1cc('0x0'));var lex=require('./lex');module[_0xc1cc('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 163640a..cf5569b 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 _0xeddd=['exports','./lib/api'];(function(_0x248742,_0x1a2aed){var _0x245f0d=function(_0x1d1c74){while(--_0x1d1c74){_0x248742['push'](_0x248742['shift']());}};_0x245f0d(++_0x1a2aed);}(_0xeddd,0x69));var _0xdedd=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xeddd[_0x4ff09b];return _0x3f5c2e;};'use strict';var lex=require(_0xdedd('0x0'));module[_0xdedd('0x1')]=function(_0x161609,_0x1dc143,_0x587d60,_0x3a53b4,_0x591965,_0x10de65){return lex(_0x161609,_0x1dc143,_0x587d60,_0x3a53b4,_0x591965,_0x10de65);}; \ No newline at end of file +var _0xf0ba=['exports','./lib/api'];(function(_0x2610e2,_0x4ab2bd){var _0x436b80=function(_0x33f178){while(--_0x33f178){_0x2610e2['push'](_0x2610e2['shift']());}};_0x436b80(++_0x4ab2bd);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf0ba[_0x14add3];return _0x4a174f;};'use strict';var lex=require(_0xaf0b('0x0'));module[_0xaf0b('0x1')]=function(_0x1caf8c,_0x38cf45,_0xea88b2,_0x555620,_0x277920,_0xce0364){return lex(_0x1caf8c,_0x38cf45,_0xea88b2,_0x555620,_0x277920,_0xce0364);}; \ 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 f988c2a..fd38428 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 _0x47c9=['aws-sdk','postText','slots','hasOwnProperty','slot_','exports','LexRuntime'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x47c9,0x118));var _0x947c=function(_0x3c2032,_0x2866ff){_0x3c2032=_0x3c2032-0x0;var _0x1d0027=_0x47c9[_0x3c2032];return _0x1d0027;};'use strict';var BPromise=require('bluebird');var AWS=require(_0x947c('0x0'));function lexResult(_0x1d7af5,_0x166ad1){return new BPromise(function(_0x24c0ba,_0x197689){_0x1d7af5[_0x947c('0x1')](_0x166ad1,function(_0x24180f,_0x3730fd){if(_0x24180f){_0x197689(_0x24180f);}if(_0x3730fd[_0x947c('0x2')]){for(const _0x2db469 in _0x3730fd[_0x947c('0x2')]){if(_0x3730fd[_0x947c('0x2')][_0x947c('0x3')](_0x2db469)){var _0x1315b7=_0x3730fd['slots'][_0x2db469];_0x3730fd[_0x947c('0x4')+_0x2db469]=_0x1315b7;}}}_0x24c0ba(_0x3730fd);});});}module[_0x947c('0x5')]=function(_0x528340,_0x2448f7,_0x4f1141,_0x389942,_0x24e188,_0x49f0a7){var _0x329616=new AWS[(_0x947c('0x6'))]({'accessKeyId':_0x2448f7,'secretAccessKey':_0x4f1141,'region':_0x389942});var _0x59167c={'botAlias':'$LATEST','botName':_0x49f0a7,'inputText':_0x24e188,'userId':_0x528340};return lexResult(_0x329616,_0x59167c);}; \ No newline at end of file +var _0x74ca=['hasOwnProperty','exports','LexRuntime','aws-sdk','postText','slots'];(function(_0x35b93f,_0x48cda5){var _0x412fff=function(_0xef391c){while(--_0xef391c){_0x35b93f['push'](_0x35b93f['shift']());}};_0x412fff(++_0x48cda5);}(_0x74ca,0x183));var _0xa74c=function(_0x539693,_0xbf390e){_0x539693=_0x539693-0x0;var _0x5de9ac=_0x74ca[_0x539693];return _0x5de9ac;};'use strict';var BPromise=require('bluebird');var AWS=require(_0xa74c('0x0'));function lexResult(_0x359e48,_0x32ee41){return new BPromise(function(_0x321e9e,_0x4e49da){_0x359e48[_0xa74c('0x1')](_0x32ee41,function(_0x1a27f0,_0x3ee2d7){if(_0x1a27f0){_0x4e49da(_0x1a27f0);}if(_0x3ee2d7['slots']){for(const _0x3dd92e in _0x3ee2d7[_0xa74c('0x2')]){if(_0x3ee2d7[_0xa74c('0x2')][_0xa74c('0x3')](_0x3dd92e)){var _0x4eaf58=_0x3ee2d7['slots'][_0x3dd92e];_0x3ee2d7['slot_'+_0x3dd92e]=_0x4eaf58;}}}_0x321e9e(_0x3ee2d7);});});}module[_0xa74c('0x4')]=function(_0x59a259,_0x53b4a3,_0x108b87,_0x3865b2,_0x57157c,_0xdd221d){var _0x39e592=new AWS[(_0xa74c('0x5'))]({'accessKeyId':_0x53b4a3,'secretAccessKey':_0x108b87,'region':_0x3865b2});var _0x21c892={'botAlias':'$LATEST','botName':_0xdd221d,'inputText':_0x57157c,'userId':_0x59a259};return lexResult(_0x39e592,_0x21c892);}; \ 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 cf3b6b1..2d3a390 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 _0x27f5=['exports','./lib/api'];(function(_0x1d27a8,_0x2f5d59){var _0x37adc5=function(_0x354a20){while(--_0x354a20){_0x1d27a8['push'](_0x1d27a8['shift']());}};_0x37adc5(++_0x2f5d59);}(_0x27f5,0x1f3));var _0x527f=function(_0x441563,_0x1d4a28){_0x441563=_0x441563-0x0;var _0x2369ec=_0x27f5[_0x441563];return _0x2369ec;};'use strict';var polly=require(_0x527f('0x0'));module[_0x527f('0x1')]=function(_0x3127c7,_0x2b346f,_0x27e7b2,_0x43a879,_0xa65f39,_0x6b921e,_0x266faf){return polly(_0x3127c7,_0x2b346f,_0x27e7b2,_0x43a879,_0xa65f39,_0x6b921e,_0x266faf);}; \ No newline at end of file +var _0xca50=['./lib/api'];(function(_0x2ae554,_0x5e471f){var _0x456831=function(_0xd0659e){while(--_0xd0659e){_0x2ae554['push'](_0x2ae554['shift']());}};_0x456831(++_0x5e471f);}(_0xca50,0x1ed));var _0x0ca5=function(_0x2cae08,_0x27d2a6){_0x2cae08=_0x2cae08-0x0;var _0x369fd7=_0xca50[_0x2cae08];return _0x369fd7;};'use strict';var polly=require(_0x0ca5('0x0'));module['exports']=function(_0x19895f,_0xb5549f,_0x551639,_0x13fe82,_0x4e2335,_0x2a8c01,_0x4fc248){return polly(_0x19895f,_0xb5549f,_0x551639,_0x13fe82,_0x4e2335,_0x2a8c01,_0x4fc248);}; \ 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 64038f3..0186947 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 _0xd3db=['path','bluebird','randomstring','aws-sdk','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd3db,0x1c2));var _0xbd3d=function(_0x5c1411,_0x275bbe){_0x5c1411=_0x5c1411-0x0;var _0x75edb=_0xd3db[_0x5c1411];return _0x75edb;};'use strict';var fs=require('fs');var path=require(_0xbd3d('0x0'));var BPromise=require(_0xbd3d('0x1'));var rs=require(_0xbd3d('0x2'));var AWS=require(_0xbd3d('0x3'));function pollyResult(_0x5b0eb0,_0x3a141f,_0x511d60){return new BPromise(function(_0x413cc8,_0x3e24b3){_0x5b0eb0['synthesizeSpeech'](_0x3a141f,function(_0x4fe327,_0x5224ba){if(_0x4fe327){_0x3e24b3(_0x4fe327);}else if(_0x5224ba){if(_0x5224ba[_0xbd3d('0x4')]instanceof Buffer){fs['writeFile'](_0x511d60,_0x5224ba['AudioStream'],function(_0xf8ac0c){if(_0xf8ac0c){_0x3e24b3(_0xf8ac0c);}else{_0x413cc8();}});}else{_0x3e24b3(new Error(_0xbd3d('0x5')));}}else{_0x3e24b3(new Error(_0xbd3d('0x6')));}});});}module[_0xbd3d('0x7')]=function(_0x47eaa5,_0x500998,_0x3764e6,_0x14e64e,_0x2b859e,_0x50dd95,_0x242d03){var _0x37da1b=new AWS[(_0xbd3d('0x8'))]({'accessKeyId':_0x47eaa5,'secretAccessKey':_0x500998,'region':_0x3764e6});var _0x321b31={'Text':_0x2b859e,'TextType':_0x50dd95||'text','OutputFormat':_0xbd3d('0x9'),'VoiceId':_0x14e64e};return pollyResult(_0x37da1b,_0x321b31,_0x242d03);}; \ No newline at end of file +var _0xe4f7=['AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','path','bluebird','randomstring','aws-sdk','synthesizeSpeech'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe4f7,0x9d));var _0x7e4f=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xe4f7[_0x167cc1];return _0x10bc4b;};'use strict';var fs=require('fs');var path=require(_0x7e4f('0x0'));var BPromise=require(_0x7e4f('0x1'));var rs=require(_0x7e4f('0x2'));var AWS=require(_0x7e4f('0x3'));function pollyResult(_0x4117ab,_0x54f2c3,_0x565687){return new BPromise(function(_0x7f044e,_0x4cb6ff){_0x4117ab[_0x7e4f('0x4')](_0x54f2c3,function(_0x432744,_0x17f942){if(_0x432744){_0x4cb6ff(_0x432744);}else if(_0x17f942){if(_0x17f942['AudioStream']instanceof Buffer){fs['writeFile'](_0x565687,_0x17f942[_0x7e4f('0x5')],function(_0x151c1d){if(_0x151c1d){_0x4cb6ff(_0x151c1d);}else{_0x7f044e();}});}else{_0x4cb6ff(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x4cb6ff(new Error(_0x7e4f('0x6')));}});});}module[_0x7e4f('0x7')]=function(_0xc8b5ec,_0xd1bca2,_0x501e4c,_0x201618,_0x2f16d3,_0x3f53fc,_0xf3dbb1){var _0x2d86de=new AWS['Polly']({'accessKeyId':_0xc8b5ec,'secretAccessKey':_0xd1bca2,'region':_0x501e4c});var _0x3bff31={'Text':_0x2f16d3,'TextType':_0x3f53fc||_0x7e4f('0x8'),'OutputFormat':'mp3','VoiceId':_0x201618};return pollyResult(_0x2d86de,_0x3bff31,_0xf3dbb1);}; \ 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 220b35c..dc9752d 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. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x5a5889,_0x1c8a15,_0x4ed7a1,_0x54de82){return asr(_0x5a5889,_0x1c8a15,_0x4ed7a1);}; \ No newline at end of file +var _0xfa4d=['./lib/api','exports'];(function(_0x50c00a,_0x2afdb8){var _0x37e299=function(_0x21f5ac){while(--_0x21f5ac){_0x50c00a['push'](_0x50c00a['shift']());}};_0x37e299(++_0x2afdb8);}(_0xfa4d,0x90));var _0xdfa4=function(_0x485659,_0x31292e){_0x485659=_0x485659-0x0;var _0x5b248a=_0xfa4d[_0x485659];return _0x5b248a;};'use strict';var asr=require(_0xdfa4('0x0'));module[_0xdfa4('0x1')]=function(_0x4ec58a,_0x38b3c9,_0x4c5e52,_0x525bdc){return asr(_0x4ec58a,_0x38b3c9,_0x4c5e52);}; \ 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 74c0b69..23d0ff8 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 _0xb937=['LINEAR16','8000','bluebird','exports','string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb937,0x15e));var _0x7b93=function(_0x51cc27,_0x3067b9){_0x51cc27=_0x51cc27-0x0;var _0xd854cb=_0xb937[_0x51cc27];return _0xd854cb;};'use strict';var url=require('url');var BPromise=require(_0x7b93('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x7b93('0x1')]=function(_0x1d01a5,_0x9d32ad,_0x29ae01){return new BPromise(function(_0x534a0a,_0x2f9a70){var _0x2f5f78;if(typeof _0x1d01a5!==_0x7b93('0x2')||_0x1d01a5['length']===0x0){return _0x2f9a70('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x9d32ad!==_0x7b93('0x2')||_0x9d32ad[_0x7b93('0x3')]===0x0){return _0x2f9a70(_0x7b93('0x4'));}if(typeof _0x29ae01!==_0x7b93('0x5')&&(typeof _0x29ae01!=='string'||_0x29ae01[_0x7b93('0x3')]===0x0)){return _0x2f9a70(_0x7b93('0x6'));}try{_0x2f5f78=fs['readFileSync'](_0x1d01a5)[_0x7b93('0x7')](_0x7b93('0x8'));}catch(_0x3788cc){return _0x2f9a70(_0x3788cc);}return _0x534a0a({'method':_0x7b93('0x9'),'uri':host+'/v1/speech:recognize?key='+_0x9d32ad,'body':{'config':{'encoding':_0x7b93('0xa'),'sampleRateHertz':_0x7b93('0xb'),'languageCode':_0x29ae01},'audio':{'content':_0x2f5f78}},'json':!![]});});}; \ No newline at end of file +var _0x7c19=['https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','toString','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird'];(function(_0x18b907,_0x34082c){var _0x34538e=function(_0x32a769){while(--_0x32a769){_0x18b907['push'](_0x18b907['shift']());}};_0x34538e(++_0x34082c);}(_0x7c19,0x102));var _0x97c1=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x7c19[_0x68c979];return _0x4f0001;};'use strict';var url=require(_0x97c1('0x0'));var BPromise=require(_0x97c1('0x1'));var fs=require('fs');var host=_0x97c1('0x2');module[_0x97c1('0x3')]=function(_0x3ba4c6,_0xae8f27,_0x31703e){return new BPromise(function(_0x223c16,_0x2f07a8){var _0x1717f9;if(typeof _0x3ba4c6!==_0x97c1('0x4')||_0x3ba4c6[_0x97c1('0x5')]===0x0){return _0x2f07a8(_0x97c1('0x6'));}if(typeof _0xae8f27!=='string'||_0xae8f27['length']===0x0){return _0x2f07a8(_0x97c1('0x7'));}if(typeof _0x31703e!=='undefined'&&(typeof _0x31703e!=='string'||_0x31703e[_0x97c1('0x5')]===0x0)){return _0x2f07a8(_0x97c1('0x8'));}try{_0x1717f9=fs['readFileSync'](_0x3ba4c6)[_0x97c1('0x9')]('base64');}catch(_0x6ab3f2){return _0x2f07a8(_0x6ab3f2);}return _0x223c16({'method':_0x97c1('0xa'),'uri':host+_0x97c1('0xb')+_0xae8f27,'body':{'config':{'encoding':_0x97c1('0xc'),'sampleRateHertz':'8000','languageCode':_0x31703e},'audio':{'content':_0x1717f9}},'json':!![]});});}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index f33997f..314468f 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 _0xb10b=['url','parse','randomstring','sox','request-promise','util','querystring','moment','apiai-promise','md5','./aws','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','https:','data','transcode','wav','error\x20convert','info','finish\x20to\x20convert','start','tmp','.wav','base64','then','readFileSync','toString','googleTTS','resolve','generate','.mp3','goggleTTS\x20path','split','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','catch','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','fulfillment','score','status','code','metadata','endConversation','isFallbackIntent','tildeASR','asr','Tilde\x20ASR\x20transcription','awsPolly','polly','chmodSync','777','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','freeform=3','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','path','https'];(function(_0x5756c6,_0x58290a){var _0x4b5806=function(_0x193246){while(--_0x193246){_0x5756c6['push'](_0x5756c6['shift']());}};_0x4b5806(++_0x58290a);}(_0xb10b,0x12a));var _0xbb10=function(_0x5d8e11,_0x1b2574){_0x5d8e11=_0x5d8e11-0x0;var _0x25fa53=_0xb10b[_0x5d8e11];return _0x25fa53;};'use strict';var fs=require('fs');var path=require(_0xbb10('0x0'));var http=require('http');var https=require(_0xbb10('0x1'));var urlParse=require(_0xbb10('0x2'))[_0xbb10('0x3')];var BPromise=require('bluebird');var rs=require(_0xbb10('0x4'));var sox=require(_0xbb10('0x5'));var rp=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var querystring=require(_0xbb10('0x8'));var moment=require(_0xbb10('0x9'));var tts=require('google-tts-api');var apiai=require(_0xbb10('0xa'));var md5=require(_0xbb10('0xb'));var google=require('./google');var aws=require(_0xbb10('0xc'));var tilde=require(_0xbb10('0xd'));var sestek=require(_0xbb10('0xe'));var logger=require(_0xbb10('0xf'))(_0xbb10('0x10'));var ISPEECH_API=_0xbb10('0x11');function downloadFile(_0x229887,_0xa3adc8){return new BPromise(function(_0x5ab04a,_0x4e47f8){var _0x20bd61=urlParse(_0x229887);var _0x118a74=_0x20bd61[_0xbb10('0x12')]==='https:'?https:http;var _0x408248={'host':_0x20bd61['host'],'path':_0x20bd61[_0xbb10('0x0')],'headers':{'user-agent':_0xbb10('0x13')}};_0x118a74[_0xbb10('0x14')](_0x408248,function(_0x193a27){if(_0x193a27[_0xbb10('0x15')]!==0xc8){logger[_0xbb10('0x16')]('request\x20to\x20'+_0x229887+_0xbb10('0x17')+_0x193a27[_0xbb10('0x15')]+'\x20('+_0x193a27[_0xbb10('0x18')]+')');_0x4e47f8(new Error(_0xbb10('0x19')+_0x229887+_0xbb10('0x17')+_0x193a27[_0xbb10('0x15')]+'\x20('+_0x193a27[_0xbb10('0x18')]+')'));return;}var _0x36b5e8=fs[_0xbb10('0x1a')](_0xa3adc8);_0x36b5e8['on'](_0xbb10('0x1b'),function(){logger['info'](_0xbb10('0x1c'));_0x36b5e8[_0xbb10('0x1d')](_0x5ab04a);});_0x36b5e8['on'](_0xbb10('0x16'),function(_0x42db98){fs[_0xbb10('0x1e')](_0xa3adc8);logger[_0xbb10('0x16')](_0xbb10('0x1f'),_0x42db98);_0x4e47f8(_0x42db98);});_0x193a27[_0xbb10('0x20')](_0x36b5e8);})['on'](_0xbb10('0x16'),function(_0xe1c665){logger['error'](_0xe1c665);_0x4e47f8(_0xe1c665);})[_0xbb10('0x21')]();});}function uploadFile(_0x19f48d){return new BPromise(function(_0x388fab,_0x109908){var _0xdf237d=urlParse(_0x19f48d);var _0x44e563=_0xdf237d['protocol']===_0xbb10('0x22')?https:http;var _0x12ef77={'host':_0xdf237d['host'],'path':_0xdf237d['path'],'headers':{'user-agent':_0xbb10('0x13')}};_0x44e563[_0xbb10('0x14')](_0x12ef77,function(_0x2e911d){if(_0x2e911d[_0xbb10('0x15')]!==0xc8){_0x109908(new Error(_0xbb10('0x19')+_0x19f48d+_0xbb10('0x17')+_0x2e911d[_0xbb10('0x15')]+'\x20('+_0x2e911d[_0xbb10('0x18')]+')'));return;}var _0x7f2377='';_0x2e911d['on'](_0xbb10('0x23'),function(_0x3ba6cd){_0x7f2377+=_0x3ba6cd;});_0x2e911d['on'](_0xbb10('0x21'),function(){_0x388fab(_0x7f2377);});})['on']('error',function(_0x4fedac){_0x109908(_0x4fedac);})['end']();});}function convertFile(_0xc93a04,_0x3c5ae7){return new BPromise(function(_0x2c89b9,_0x4e25ff){var _0x2fdde9=sox[_0xbb10('0x24')](_0xc93a04,_0x3c5ae7,{'sampleRate':0x1f40,'format':_0xbb10('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2fdde9['on'](_0xbb10('0x16'),function(_0x1acce9){logger[_0xbb10('0x16')](_0xbb10('0x26'),_0x1acce9);_0x4e25ff(_0x1acce9);});_0x2fdde9['on']('end',function(){logger[_0xbb10('0x27')](_0xbb10('0x28'));_0x2c89b9();});_0x2fdde9[_0xbb10('0x29')]();});}function base64Decode(_0x2e0249,_0x1d30aa){var _0x2ff4c1=path['resolve'](__dirname,_0xbb10('0x2a'),rs['generate'](0x4)+_0xbb10('0x2b'));fs['writeFileSync'](_0x2ff4c1,_0x2e0249,_0xbb10('0x2c'));return convertFile(_0x2ff4c1,_0x1d30aa)[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x2ff4c1);fs['chmodSync'](_0x1d30aa,'777');}catch(_0x4c3744){logger[_0xbb10('0x16')](_0x4c3744);}return _0x1d30aa['split']('.')[0x0];});}function base64Encode(_0x359ad4){var _0x37dde7=fs[_0xbb10('0x2e')](_0x359ad4);return new Buffer(_0x37dde7)[_0xbb10('0x2f')](_0xbb10('0x2c'));}exports[_0xbb10('0x30')]=function(_0xf85197,_0x4975f5){var _0x25acb3,_0x1da9c9;return tts(_0xf85197,_0x4975f5||'en',0x1)[_0xbb10('0x2d')](function(_0x8c1ce6){logger[_0xbb10('0x27')](_0x8c1ce6);_0x25acb3=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));return downloadFile(_0x8c1ce6,_0x25acb3);})['then'](function(){_0x1da9c9=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x25acb3,_0x1da9c9);})['then'](function(){try{fs[_0xbb10('0x1e')](_0x25acb3);fs['chmodSync'](_0x1da9c9,'777');}catch(_0x3eb3cc){logger[_0xbb10('0x16')](_0x3eb3cc);}logger[_0xbb10('0x27')](_0xbb10('0x34'),_0x1da9c9[_0xbb10('0x35')]('.')[0x0]);return _0x1da9c9[_0xbb10('0x35')]('.')[0x0];});};exports['googleASR']=function(_0x1e5bbd,_0x25d72f,_0x52de31){return google['asr'](_0x1e5bbd,_0x25d72f,_0x52de31)['then'](function(_0x31bee3){logger[_0xbb10('0x27')](_0x31bee3[_0xbb10('0x36')]);return rp(_0x31bee3);})['then'](function(_0x3c0cd7){var _0x3e8538='';var _0x4345f3=0x0;try{fs['unlink'](_0x1e5bbd);}catch(_0x17b6c5){logger[_0xbb10('0x16')](_0x17b6c5);}if(_0x3c0cd7&&_0x3c0cd7[_0xbb10('0x37')]){_0x3e8538=_0x3c0cd7[_0xbb10('0x37')]['map'](function(_0xd238e9){return _0xd238e9&&_0xd238e9[_0xbb10('0x38')][0x0]&&_0xd238e9['alternatives'][0x0][_0xbb10('0x39')]?_0xd238e9[_0xbb10('0x38')][0x0][_0xbb10('0x39')]:'';})[_0xbb10('0x3a')]('\x0a');_0x4345f3=_0x3c0cd7[_0xbb10('0x37')][_0xbb10('0x3b')](function(_0x5f3d67){return _0x5f3d67&&_0x5f3d67[_0xbb10('0x38')][0x0]&&_0x5f3d67[_0xbb10('0x38')][0x0][_0xbb10('0x3c')]?_0x5f3d67[_0xbb10('0x38')][0x0]['confidence']:0x0;})[_0xbb10('0x3a')]('\x0a');}logger[_0xbb10('0x27')](_0xbb10('0x3d'),_0x3e8538);logger[_0xbb10('0x27')]('googleASR\x20confidence',_0x4345f3);return{'transcript':_0x3e8538,'confidence':_0x4345f3};})[_0xbb10('0x3e')](function(_0x202c60){logger['error']('[%s]\x20%s:%s',_0x202c60[_0xbb10('0x15')],_0x202c60['name'],_0x202c60[_0xbb10('0x3f')]);});};exports[_0xbb10('0x40')]=function(_0x4c66d8,_0x366608,_0x1d82bf,_0x474e99){var _0x5cf4f8=apiai(_0x366608,{'language':_0x474e99||'en'});return _0x5cf4f8[_0xbb10('0x41')](_0x1d82bf,{'sessionId':md5(_0x4c66d8)})[_0xbb10('0x2d')](function(_0x3b9fdf){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x3b9fdf));return{'source':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x44')],'resolvedQuery':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x45')],'action':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x46')],'actionIncomplete':_0x3b9fdf[_0xbb10('0x43')]['actionIncomplete'],'speech':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x47')]['speech'],'score':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x48')],'statusCode':_0x3b9fdf[_0xbb10('0x49')][_0xbb10('0x4a')],'endConversation':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x4b')][_0xbb10('0x4c')]||![],'isFallbackIntent':_0x3b9fdf['result']['metadata'][_0xbb10('0x4d')]};});};exports[_0xbb10('0x4e')]=function(_0x2b12bd,_0x57d2c0,_0x5f0c12,_0x3cd6f3){return tilde[_0xbb10('0x4f')](_0x2b12bd,_0x57d2c0,_0x5f0c12,_0x3cd6f3)[_0xbb10('0x2d')](function(_0xf820fe){try{fs[_0xbb10('0x1e')](_0x2b12bd);}catch(_0x22b315){logger[_0xbb10('0x16')](_0x22b315);}logger[_0xbb10('0x27')](_0xbb10('0x50'),_0xf820fe[_0xbb10('0x39')]);logger['info']('Tilde\x20ASR\x20confidence',_0xf820fe[_0xbb10('0x3c')]);return _0xf820fe;});};exports[_0xbb10('0x51')]=function(_0x36ab7d,_0xb014b0,_0x36aa7d,_0x440f9e,_0x358e7e,_0x445870){var _0x1c0d8f=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));var _0x2e6fd9;return aws[_0xbb10('0x52')](_0x36ab7d,_0xb014b0,_0x36aa7d,_0x440f9e,_0x358e7e,_0x445870,_0x1c0d8f)['then'](function(){_0x2e6fd9=path[_0xbb10('0x31')](__dirname,'tmp',rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x1c0d8f,_0x2e6fd9);})[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x1c0d8f);fs[_0xbb10('0x53')](_0x2e6fd9,_0xbb10('0x54'));}catch(_0x2e3326){logger[_0xbb10('0x16')](_0x2e3326);}return _0x2e6fd9[_0xbb10('0x35')]('.')[0x0];});};exports[_0xbb10('0x55')]=function(_0x44a056,_0x1c2dce,_0x1d49e1,_0x3d7e17,_0x4475e1,_0x5de0cc){return aws[_0xbb10('0x56')](_0x44a056,_0x1c2dce,_0x1d49e1,_0x3d7e17,_0x4475e1,_0x5de0cc)[_0xbb10('0x2d')](function(_0x1b83a9){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x1b83a9));return _0x1b83a9;});};exports[_0xbb10('0x57')]=function(_0x4bedd0,_0x120bda,_0x4731ce,_0x2909a1){var _0x14fed3=util[_0xbb10('0x58')](_0xbb10('0x59'),ISPEECH_API,_0x4bedd0,encodeURIComponent(_0x120bda),_0x4731ce,_0x2909a1);var _0x175872=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));var _0x2a1ce1;return downloadFile(_0x14fed3,_0x175872)[_0xbb10('0x2d')](function(){_0x2a1ce1=path['resolve'](__dirname,'tmp',rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x175872,_0x2a1ce1);})[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x175872);fs['chmodSync'](_0x2a1ce1,'777');}catch(_0x79411e){logger[_0xbb10('0x16')](_0x79411e);}return _0x2a1ce1[_0xbb10('0x35')]('.')[0x0];});};exports[_0xbb10('0x5a')]=function(_0x412f13,_0x3e9753,_0x45c0dc,_0x4a5fb9){var _0x117e84=util[_0xbb10('0x58')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x3e9753,_0x45c0dc,base64Encode(_0x412f13),_0x4a5fb9?util['format']('model=%s',encodeURIComponent(_0x4a5fb9)):_0xbb10('0x5b'));return uploadFile(_0x117e84)[_0xbb10('0x2d')](function(_0x155dc5){return querystring['parse'](_0x155dc5);});};exports['sestekNDA']=function(_0x5846d1,_0x3ebc5f){return sestek[_0xbb10('0x5c')](_0x5846d1,_0x3ebc5f)[_0xbb10('0x2d')](function(_0x4e9fbd){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x4e9fbd));var _0x5a6538={'speech':_0x4e9fbd['text'],'action':_0x4e9fbd[_0xbb10('0x5d')]?_0x4e9fbd[_0xbb10('0x5d')][_0xbb10('0x5e')]:undefined,'actiondata':_0x4e9fbd[_0xbb10('0x5d')]?_0x4e9fbd['channelData'][_0xbb10('0x5f')]:undefined};if(_0x4e9fbd[_0xbb10('0x5d')]&&_0x4e9fbd[_0xbb10('0x5d')]['AudioFromTts']){return base64Decode(_0x4e9fbd[_0xbb10('0x5d')][_0xbb10('0x60')][_0xbb10('0x61')],path['resolve'](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b')))[_0xbb10('0x2d')](function(_0x5e4a6e){_0x5a6538[_0xbb10('0x62')]=_0x5e4a6e;return _0x5a6538;});}return _0x5a6538;});};exports[_0xbb10('0x63')]=function(){return __dirname;}; \ No newline at end of file +var _0xb10b=['url','parse','randomstring','sox','request-promise','util','querystring','moment','apiai-promise','md5','./aws','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','https:','data','transcode','wav','error\x20convert','info','finish\x20to\x20convert','start','tmp','.wav','base64','then','readFileSync','toString','googleTTS','resolve','generate','.mp3','goggleTTS\x20path','split','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','catch','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','fulfillment','score','status','code','metadata','endConversation','isFallbackIntent','tildeASR','asr','Tilde\x20ASR\x20transcription','awsPolly','polly','chmodSync','777','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','freeform=3','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','path','https'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0xb10b,0x12a));var _0xbb10=function(_0x3b4d1b,_0x12517b){_0x3b4d1b=_0x3b4d1b-0x0;var _0x5a2ffd=_0xb10b[_0x3b4d1b];return _0x5a2ffd;};'use strict';var fs=require('fs');var path=require(_0xbb10('0x0'));var http=require('http');var https=require(_0xbb10('0x1'));var urlParse=require(_0xbb10('0x2'))[_0xbb10('0x3')];var BPromise=require('bluebird');var rs=require(_0xbb10('0x4'));var sox=require(_0xbb10('0x5'));var rp=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var querystring=require(_0xbb10('0x8'));var moment=require(_0xbb10('0x9'));var tts=require('google-tts-api');var apiai=require(_0xbb10('0xa'));var md5=require(_0xbb10('0xb'));var google=require('./google');var aws=require(_0xbb10('0xc'));var tilde=require(_0xbb10('0xd'));var sestek=require(_0xbb10('0xe'));var logger=require(_0xbb10('0xf'))(_0xbb10('0x10'));var ISPEECH_API=_0xbb10('0x11');function downloadFile(_0x229887,_0xa3adc8){return new BPromise(function(_0x5ab04a,_0x4e47f8){var _0x20bd61=urlParse(_0x229887);var _0x118a74=_0x20bd61[_0xbb10('0x12')]==='https:'?https:http;var _0x408248={'host':_0x20bd61['host'],'path':_0x20bd61[_0xbb10('0x0')],'headers':{'user-agent':_0xbb10('0x13')}};_0x118a74[_0xbb10('0x14')](_0x408248,function(_0x193a27){if(_0x193a27[_0xbb10('0x15')]!==0xc8){logger[_0xbb10('0x16')]('request\x20to\x20'+_0x229887+_0xbb10('0x17')+_0x193a27[_0xbb10('0x15')]+'\x20('+_0x193a27[_0xbb10('0x18')]+')');_0x4e47f8(new Error(_0xbb10('0x19')+_0x229887+_0xbb10('0x17')+_0x193a27[_0xbb10('0x15')]+'\x20('+_0x193a27[_0xbb10('0x18')]+')'));return;}var _0x36b5e8=fs[_0xbb10('0x1a')](_0xa3adc8);_0x36b5e8['on'](_0xbb10('0x1b'),function(){logger['info'](_0xbb10('0x1c'));_0x36b5e8[_0xbb10('0x1d')](_0x5ab04a);});_0x36b5e8['on'](_0xbb10('0x16'),function(_0x42db98){fs[_0xbb10('0x1e')](_0xa3adc8);logger[_0xbb10('0x16')](_0xbb10('0x1f'),_0x42db98);_0x4e47f8(_0x42db98);});_0x193a27[_0xbb10('0x20')](_0x36b5e8);})['on'](_0xbb10('0x16'),function(_0xe1c665){logger['error'](_0xe1c665);_0x4e47f8(_0xe1c665);})[_0xbb10('0x21')]();});}function uploadFile(_0x19f48d){return new BPromise(function(_0x388fab,_0x109908){var _0xdf237d=urlParse(_0x19f48d);var _0x44e563=_0xdf237d['protocol']===_0xbb10('0x22')?https:http;var _0x12ef77={'host':_0xdf237d['host'],'path':_0xdf237d['path'],'headers':{'user-agent':_0xbb10('0x13')}};_0x44e563[_0xbb10('0x14')](_0x12ef77,function(_0x2e911d){if(_0x2e911d[_0xbb10('0x15')]!==0xc8){_0x109908(new Error(_0xbb10('0x19')+_0x19f48d+_0xbb10('0x17')+_0x2e911d[_0xbb10('0x15')]+'\x20('+_0x2e911d[_0xbb10('0x18')]+')'));return;}var _0x7f2377='';_0x2e911d['on'](_0xbb10('0x23'),function(_0x3ba6cd){_0x7f2377+=_0x3ba6cd;});_0x2e911d['on'](_0xbb10('0x21'),function(){_0x388fab(_0x7f2377);});})['on']('error',function(_0x4fedac){_0x109908(_0x4fedac);})['end']();});}function convertFile(_0xc93a04,_0x3c5ae7){return new BPromise(function(_0x2c89b9,_0x4e25ff){var _0x2fdde9=sox[_0xbb10('0x24')](_0xc93a04,_0x3c5ae7,{'sampleRate':0x1f40,'format':_0xbb10('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2fdde9['on'](_0xbb10('0x16'),function(_0x1acce9){logger[_0xbb10('0x16')](_0xbb10('0x26'),_0x1acce9);_0x4e25ff(_0x1acce9);});_0x2fdde9['on']('end',function(){logger[_0xbb10('0x27')](_0xbb10('0x28'));_0x2c89b9();});_0x2fdde9[_0xbb10('0x29')]();});}function base64Decode(_0x2e0249,_0x1d30aa){var _0x2ff4c1=path['resolve'](__dirname,_0xbb10('0x2a'),rs['generate'](0x4)+_0xbb10('0x2b'));fs['writeFileSync'](_0x2ff4c1,_0x2e0249,_0xbb10('0x2c'));return convertFile(_0x2ff4c1,_0x1d30aa)[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x2ff4c1);fs['chmodSync'](_0x1d30aa,'777');}catch(_0x4c3744){logger[_0xbb10('0x16')](_0x4c3744);}return _0x1d30aa['split']('.')[0x0];});}function base64Encode(_0x359ad4){var _0x37dde7=fs[_0xbb10('0x2e')](_0x359ad4);return new Buffer(_0x37dde7)[_0xbb10('0x2f')](_0xbb10('0x2c'));}exports[_0xbb10('0x30')]=function(_0xf85197,_0x4975f5){var _0x25acb3,_0x1da9c9;return tts(_0xf85197,_0x4975f5||'en',0x1)[_0xbb10('0x2d')](function(_0x8c1ce6){logger[_0xbb10('0x27')](_0x8c1ce6);_0x25acb3=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));return downloadFile(_0x8c1ce6,_0x25acb3);})['then'](function(){_0x1da9c9=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x25acb3,_0x1da9c9);})['then'](function(){try{fs[_0xbb10('0x1e')](_0x25acb3);fs['chmodSync'](_0x1da9c9,'777');}catch(_0x3eb3cc){logger[_0xbb10('0x16')](_0x3eb3cc);}logger[_0xbb10('0x27')](_0xbb10('0x34'),_0x1da9c9[_0xbb10('0x35')]('.')[0x0]);return _0x1da9c9[_0xbb10('0x35')]('.')[0x0];});};exports['googleASR']=function(_0x1e5bbd,_0x25d72f,_0x52de31){return google['asr'](_0x1e5bbd,_0x25d72f,_0x52de31)['then'](function(_0x31bee3){logger[_0xbb10('0x27')](_0x31bee3[_0xbb10('0x36')]);return rp(_0x31bee3);})['then'](function(_0x3c0cd7){var _0x3e8538='';var _0x4345f3=0x0;try{fs['unlink'](_0x1e5bbd);}catch(_0x17b6c5){logger[_0xbb10('0x16')](_0x17b6c5);}if(_0x3c0cd7&&_0x3c0cd7[_0xbb10('0x37')]){_0x3e8538=_0x3c0cd7[_0xbb10('0x37')]['map'](function(_0xd238e9){return _0xd238e9&&_0xd238e9[_0xbb10('0x38')][0x0]&&_0xd238e9['alternatives'][0x0][_0xbb10('0x39')]?_0xd238e9[_0xbb10('0x38')][0x0][_0xbb10('0x39')]:'';})[_0xbb10('0x3a')]('\x0a');_0x4345f3=_0x3c0cd7[_0xbb10('0x37')][_0xbb10('0x3b')](function(_0x5f3d67){return _0x5f3d67&&_0x5f3d67[_0xbb10('0x38')][0x0]&&_0x5f3d67[_0xbb10('0x38')][0x0][_0xbb10('0x3c')]?_0x5f3d67[_0xbb10('0x38')][0x0]['confidence']:0x0;})[_0xbb10('0x3a')]('\x0a');}logger[_0xbb10('0x27')](_0xbb10('0x3d'),_0x3e8538);logger[_0xbb10('0x27')]('googleASR\x20confidence',_0x4345f3);return{'transcript':_0x3e8538,'confidence':_0x4345f3};})[_0xbb10('0x3e')](function(_0x202c60){logger['error']('[%s]\x20%s:%s',_0x202c60[_0xbb10('0x15')],_0x202c60['name'],_0x202c60[_0xbb10('0x3f')]);});};exports[_0xbb10('0x40')]=function(_0x4c66d8,_0x366608,_0x1d82bf,_0x474e99){var _0x5cf4f8=apiai(_0x366608,{'language':_0x474e99||'en'});return _0x5cf4f8[_0xbb10('0x41')](_0x1d82bf,{'sessionId':md5(_0x4c66d8)})[_0xbb10('0x2d')](function(_0x3b9fdf){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x3b9fdf));return{'source':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x44')],'resolvedQuery':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x45')],'action':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x46')],'actionIncomplete':_0x3b9fdf[_0xbb10('0x43')]['actionIncomplete'],'speech':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x47')]['speech'],'score':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x48')],'statusCode':_0x3b9fdf[_0xbb10('0x49')][_0xbb10('0x4a')],'endConversation':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x4b')][_0xbb10('0x4c')]||![],'isFallbackIntent':_0x3b9fdf['result']['metadata'][_0xbb10('0x4d')]};});};exports[_0xbb10('0x4e')]=function(_0x2b12bd,_0x57d2c0,_0x5f0c12,_0x3cd6f3){return tilde[_0xbb10('0x4f')](_0x2b12bd,_0x57d2c0,_0x5f0c12,_0x3cd6f3)[_0xbb10('0x2d')](function(_0xf820fe){try{fs[_0xbb10('0x1e')](_0x2b12bd);}catch(_0x22b315){logger[_0xbb10('0x16')](_0x22b315);}logger[_0xbb10('0x27')](_0xbb10('0x50'),_0xf820fe[_0xbb10('0x39')]);logger['info']('Tilde\x20ASR\x20confidence',_0xf820fe[_0xbb10('0x3c')]);return _0xf820fe;});};exports[_0xbb10('0x51')]=function(_0x36ab7d,_0xb014b0,_0x36aa7d,_0x440f9e,_0x358e7e,_0x445870){var _0x1c0d8f=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));var _0x2e6fd9;return aws[_0xbb10('0x52')](_0x36ab7d,_0xb014b0,_0x36aa7d,_0x440f9e,_0x358e7e,_0x445870,_0x1c0d8f)['then'](function(){_0x2e6fd9=path[_0xbb10('0x31')](__dirname,'tmp',rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x1c0d8f,_0x2e6fd9);})[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x1c0d8f);fs[_0xbb10('0x53')](_0x2e6fd9,_0xbb10('0x54'));}catch(_0x2e3326){logger[_0xbb10('0x16')](_0x2e3326);}return _0x2e6fd9[_0xbb10('0x35')]('.')[0x0];});};exports[_0xbb10('0x55')]=function(_0x44a056,_0x1c2dce,_0x1d49e1,_0x3d7e17,_0x4475e1,_0x5de0cc){return aws[_0xbb10('0x56')](_0x44a056,_0x1c2dce,_0x1d49e1,_0x3d7e17,_0x4475e1,_0x5de0cc)[_0xbb10('0x2d')](function(_0x1b83a9){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x1b83a9));return _0x1b83a9;});};exports[_0xbb10('0x57')]=function(_0x4bedd0,_0x120bda,_0x4731ce,_0x2909a1){var _0x14fed3=util[_0xbb10('0x58')](_0xbb10('0x59'),ISPEECH_API,_0x4bedd0,encodeURIComponent(_0x120bda),_0x4731ce,_0x2909a1);var _0x175872=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));var _0x2a1ce1;return downloadFile(_0x14fed3,_0x175872)[_0xbb10('0x2d')](function(){_0x2a1ce1=path['resolve'](__dirname,'tmp',rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x175872,_0x2a1ce1);})[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x175872);fs['chmodSync'](_0x2a1ce1,'777');}catch(_0x79411e){logger[_0xbb10('0x16')](_0x79411e);}return _0x2a1ce1[_0xbb10('0x35')]('.')[0x0];});};exports[_0xbb10('0x5a')]=function(_0x412f13,_0x3e9753,_0x45c0dc,_0x4a5fb9){var _0x117e84=util[_0xbb10('0x58')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x3e9753,_0x45c0dc,base64Encode(_0x412f13),_0x4a5fb9?util['format']('model=%s',encodeURIComponent(_0x4a5fb9)):_0xbb10('0x5b'));return uploadFile(_0x117e84)[_0xbb10('0x2d')](function(_0x155dc5){return querystring['parse'](_0x155dc5);});};exports['sestekNDA']=function(_0x5846d1,_0x3ebc5f){return sestek[_0xbb10('0x5c')](_0x5846d1,_0x3ebc5f)[_0xbb10('0x2d')](function(_0x4e9fbd){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x4e9fbd));var _0x5a6538={'speech':_0x4e9fbd['text'],'action':_0x4e9fbd[_0xbb10('0x5d')]?_0x4e9fbd[_0xbb10('0x5d')][_0xbb10('0x5e')]:undefined,'actiondata':_0x4e9fbd[_0xbb10('0x5d')]?_0x4e9fbd['channelData'][_0xbb10('0x5f')]:undefined};if(_0x4e9fbd[_0xbb10('0x5d')]&&_0x4e9fbd[_0xbb10('0x5d')]['AudioFromTts']){return base64Decode(_0x4e9fbd[_0xbb10('0x5d')][_0xbb10('0x60')][_0xbb10('0x61')],path['resolve'](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b')))[_0xbb10('0x2d')](function(_0x5e4a6e){_0x5a6538[_0xbb10('0x62')]=_0x5e4a6e;return _0x5a6538;});}return _0x5a6538;});};exports[_0xbb10('0x63')]=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 0dddeb8..c2afeb2 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 _0x3103=['exports','./nda'];(function(_0x516fcb,_0x1e2f8f){var _0xa08a4a=function(_0x29cc81){while(--_0x29cc81){_0x516fcb['push'](_0x516fcb['shift']());}};_0xa08a4a(++_0x1e2f8f);}(_0x3103,0xf9));var _0x3310=function(_0x96be88,_0x2c01a4){_0x96be88=_0x96be88-0x0;var _0x1c14c0=_0x3103[_0x96be88];return _0x1c14c0;};var nda=require(_0x3310('0x0'));module[_0x3310('0x1')]={'nda':nda}; \ No newline at end of file +var _0x4810=['exports'];(function(_0xb1d702,_0x2267ff){var _0x45f1e7=function(_0x31861f){while(--_0x31861f){_0xb1d702['push'](_0xb1d702['shift']());}};_0x45f1e7(++_0x2267ff);}(_0x4810,0xb6));var _0x0481=function(_0x481275,_0x222b6a){_0x481275=_0x481275-0x0;var _0x4d73d5=_0x4810[_0x481275];return _0x4d73d5;};var nda=require('./nda');module[_0x0481('0x0')]={'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 5fa95d9..d560529 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 _0x74ba=['CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','agi','exports','resolve','ndauth_url','/token','password','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid','calleridname','extension','access_token','channelData','ProjectName','project','ndagenerate_audio','body','AudioOutputSettings','audio/wav','custom_action'];(function(_0x237bc6,_0x3e7bc){var _0x12655d=function(_0x55c16d){while(--_0x55c16d){_0x237bc6['push'](_0x237bc6['shift']());}};_0x12655d(++_0x3e7bc);}(_0x74ba,0x105));var _0xa74b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x74ba[_0x2641f9];return _0x585741;};'use strict';var rp=require(_0xa74b('0x0'));var url=require(_0xa74b('0x1'));var logger=require('../../../../../config/logger')(_0xa74b('0x2'));module[_0xa74b('0x3')]=function(_0x59ef8d,_0x4463b2){var _0xcd1662={'method':'POST','uri':url[_0xa74b('0x4')](_0x4463b2[_0xa74b('0x5')],_0xa74b('0x6')),'form':{'grant_type':_0xa74b('0x7'),'username':_0x4463b2['username'],'password':_0x4463b2['password']},'json':!![]};return rp(_0xcd1662)[_0xa74b('0x8')](function(_0x96f9d6){var _0x2bd6db={'method':_0xa74b('0x9'),'uri':url[_0xa74b('0x4')](_0x4463b2[_0xa74b('0xa')],_0xa74b('0xb')),'body':{'type':_0x4463b2[_0xa74b('0xc')]||_0xa74b('0xd'),'channelId':'Nda','conversation':{'id':_0x59ef8d[_0xa74b('0xe')]},'from':{'id':_0x59ef8d[_0xa74b('0xf')],'name':_0x59ef8d[_0xa74b('0x10')]},'recipient':{'id':_0x59ef8d['dnid'],'name':_0x59ef8d[_0xa74b('0x11')]},'text':_0x4463b2['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x96f9d6[_0xa74b('0x12')]},'json':!![]};if(_0x4463b2['project']){_0x2bd6db['body'][_0xa74b('0x13')][_0xa74b('0x14')]=_0x4463b2[_0xa74b('0x15')];}if(_0x4463b2[_0xa74b('0x16')]=='1'){_0x2bd6db[_0xa74b('0x17')][_0xa74b('0x13')][_0xa74b('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xa74b('0x19')};}if(_0x4463b2[_0xa74b('0x1a')]){_0x2bd6db[_0xa74b('0x17')][_0xa74b('0x13')][_0xa74b('0x1b')]=_0x4463b2[_0xa74b('0x1a')];if(_0x4463b2[_0xa74b('0x1c')]){_0x2bd6db['body']['channelData'][_0xa74b('0x1d')]=_0x4463b2[_0xa74b('0x1c')];}}logger[_0xa74b('0x1e')](JSON[_0xa74b('0x1f')](_0x2bd6db));return rp(_0x2bd6db);});}; \ No newline at end of file +var _0x2849=['ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomActionData','custom_action_data','info','stringify','request-promise','../../../../../config/logger','agi','exports','POST','password','username','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','callerid','calleridname','dnid','extension','Bearer\x20','access_token','project','body','channelData'];(function(_0x1a8568,_0x5d672d){var _0x27c776=function(_0x5087f5){while(--_0x5087f5){_0x1a8568['push'](_0x1a8568['shift']());}};_0x27c776(++_0x5d672d);}(_0x2849,0xcc));var _0x9284=function(_0x18ae51,_0x565abc){_0x18ae51=_0x18ae51-0x0;var _0x1cffe4=_0x2849[_0x18ae51];return _0x1cffe4;};'use strict';var rp=require(_0x9284('0x0'));var url=require('url');var logger=require(_0x9284('0x1'))(_0x9284('0x2'));module[_0x9284('0x3')]=function(_0x48b2a9,_0x276c8e){var _0x3c3edb={'method':_0x9284('0x4'),'uri':url['resolve'](_0x276c8e['ndauth_url'],'/token'),'form':{'grant_type':_0x9284('0x5'),'username':_0x276c8e[_0x9284('0x6')],'password':_0x276c8e[_0x9284('0x5')]},'json':!![]};return rp(_0x3c3edb)['then'](function(_0x28551f){var _0x1cc1c4={'method':_0x9284('0x4'),'uri':url[_0x9284('0x7')](_0x276c8e[_0x9284('0x8')],_0x9284('0x9')),'body':{'type':_0x276c8e['ndaactivity_type']||_0x9284('0xa'),'channelId':'Nda','conversation':{'id':_0x48b2a9['uniqueid']},'from':{'id':_0x48b2a9[_0x9284('0xb')],'name':_0x48b2a9[_0x9284('0xc')]},'recipient':{'id':_0x48b2a9[_0x9284('0xd')],'name':_0x48b2a9[_0x9284('0xe')]},'text':_0x276c8e['text'],'channelData':{}},'headers':{'Authorization':_0x9284('0xf')+_0x28551f[_0x9284('0x10')]},'json':!![]};if(_0x276c8e[_0x9284('0x11')]){_0x1cc1c4[_0x9284('0x12')][_0x9284('0x13')][_0x9284('0x14')]=_0x276c8e[_0x9284('0x11')];}if(_0x276c8e[_0x9284('0x15')]=='1'){_0x1cc1c4[_0x9284('0x12')][_0x9284('0x13')][_0x9284('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x9284('0x17')};}if(_0x276c8e['custom_action']){_0x1cc1c4[_0x9284('0x12')]['channelData']['CustomAction']=_0x276c8e['custom_action'];if(_0x276c8e['custom_action_data']){_0x1cc1c4[_0x9284('0x12')][_0x9284('0x13')][_0x9284('0x18')]=_0x276c8e[_0x9284('0x19')];}}logger[_0x9284('0x1a')](JSON[_0x9284('0x1b')](_0x1cc1c4));return rp(_0x1cc1c4);});}; \ 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 7aa0441..90ab90e 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 _0xddba=['./lib/api','exports'];(function(_0x3db508,_0x399732){var _0x3bd01b=function(_0x9127ed){while(--_0x9127ed){_0x3db508['push'](_0x3db508['shift']());}};_0x3bd01b(++_0x399732);}(_0xddba,0xa2));var _0xaddb=function(_0x22275d,_0x311053){_0x22275d=_0x22275d-0x0;var _0xd47496=_0xddba[_0x22275d];return _0xd47496;};'use strict';var asr=require(_0xaddb('0x0'));module[_0xaddb('0x1')]=function(_0x524120,_0x2259f2,_0x5c1ce4,_0x1ed95c){return asr(_0x524120,_0x2259f2,_0x5c1ce4,_0x1ed95c);}; \ No newline at end of file +var _0x2270=['./lib/api','exports'];(function(_0x4fab1e,_0x34b507){var _0x59bf51=function(_0x18da54){while(--_0x18da54){_0x4fab1e['push'](_0x4fab1e['shift']());}};_0x59bf51(++_0x34b507);}(_0x2270,0x1c4));var _0x0227=function(_0x392a85,_0x67e8ea){_0x392a85=_0x392a85-0x0;var _0x3b8e02=_0x2270[_0x392a85];return _0x3b8e02;};'use strict';var asr=require(_0x0227('0x0'));module[_0x0227('0x1')]=function(_0x32562d,_0x2ff423,_0x983918,_0x3bfcb1){return asr(_0x32562d,_0x2ff423,_0x983918,_0x3bfcb1);}; \ 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 46a8134..22b679d 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 _0x6d68=['status','result','hypotheses','transcript','likelihood','info','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','isObject','open','error','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','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','digest','hex','Open\x20Tilde\x20ASR\x20socket','send','createReadStream','close','EOS','stringify','terminate','parse'];(function(_0x3250f7,_0x1c2afc){var _0xdb6ac4=function(_0x5a23f8){while(--_0x5a23f8){_0x3250f7['push'](_0x3250f7['shift']());}};_0xdb6ac4(++_0x1c2afc);}(_0x6d68,0x11a));var _0x86d6=function(_0x10d899,_0x2a1bdc){_0x10d899=_0x10d899-0x0;var _0x277c02=_0x6d68[_0x10d899];return _0x277c02;};'use strict';var BPromise=require(_0x86d6('0x0'));var _=require(_0x86d6('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x86d6('0x2'));var crypto=require(_0x86d6('0x3'));var logger=require(_0x86d6('0x4'))(_0x86d6('0x5'));module['exports']=function(_0x12ae92,_0x16b960,_0x1276e8,_0x222f5b){return new BPromise(function(_0x52bd54,_0x52a41f){logger['info'](_0x86d6('0x6'),_0x222f5b||_0x86d6('0x7'));var _0x36237a=new WebSocket(_0x222f5b||_0x86d6('0x7'),{'perMessageDeflate':![]});var _0x2e38bd='';var _0x35d8d2='0';var _0x26fd33='1';var _0x477a7c=_0x86d6('0x8');function _0x477708(_0x44e63a){var _0x2a7041=crypto[_0x86d6('0x9')](_0x86d6('0xa'));_0x2a7041[_0x86d6('0xb')](_0x44e63a);return _0x2a7041[_0x86d6('0xc')](_0x86d6('0xd'));}function _0x18e807(){try{logger['info'](_0x86d6('0xe'));var _0x1d6598=moment()['unix']();var _0x5b5178=_0x477708(_0x1d6598+_0x16b960+_0x1276e8);_0x36237a[_0x86d6('0xf')](JSON['stringify']({'appID':_0x16b960,'timestamp':_0x1d6598,'appKey':_0x5b5178}));var _0x1f18bd=fs[_0x86d6('0x10')](_0x12ae92);_0x1f18bd['on']('data',function(_0x451835){_0x36237a[_0x86d6('0xf')](_0x451835);});_0x1f18bd['on'](_0x86d6('0x11'),function(){_0x36237a[_0x86d6('0xf')](_0x86d6('0x12'));});}catch(_0x5a5e0e){logger['error']('Tilde\x20ASR\x20send\x20error',JSON[_0x86d6('0x13')](_0x5a5e0e));_0x36237a[_0x86d6('0x14')]();}}function _0x33ace0(_0x555257){try{if(_0x555257){var _0x5703dc=JSON[_0x86d6('0x15')](_0x555257);switch(_0x5703dc[_0x86d6('0x16')]){case 0x0:if(_0x5703dc[_0x86d6('0x17')]){if(_0x5703dc['result']['final']){logger['info']('Tilde\x20ASR\x20hypoteses',JSON[_0x86d6('0x13')](_0x5703dc[_0x86d6('0x17')][_0x86d6('0x18')]));_0x2e38bd=_0x5703dc[_0x86d6('0x17')][_0x86d6('0x18')][0x0][_0x86d6('0x19')];_0x35d8d2=_0x5703dc[_0x86d6('0x17')][_0x86d6('0x18')][0x0][_0x86d6('0x1a')];_0x26fd33='0';_0x477a7c='Success.';_0x36237a['terminate']();}}break;case 0x1:logger[_0x86d6('0x1b')](_0x86d6('0x8'));_0x26fd33='1';_0x477a7c=_0x86d6('0x8');break;case 0x2:logger[_0x86d6('0x1b')](_0x86d6('0x1c'));_0x26fd33='2';_0x477a7c=_0x86d6('0x1c');break;case 0x9:logger[_0x86d6('0x1b')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x26fd33='9';_0x477a7c=_0x86d6('0x1d');break;case 0xa:logger[_0x86d6('0x1b')](_0x86d6('0x1e'));_0x26fd33='10';_0x477a7c='Authentication\x20failed.';break;case 0xb:logger['info'](_0x86d6('0x1f'));_0x26fd33='11';_0x477a7c=_0x86d6('0x1f');}}}catch(_0xe07163){logger['error'](_0x86d6('0x20'),JSON[_0x86d6('0x13')](_0xe07163));_0x36237a['terminate']();}}function _0x1a53f1(){logger['info'](_0x86d6('0x21'));_0x52bd54({'transcript':_0x2e38bd,'confidence':_0x35d8d2,'status':_0x26fd33,'status_message':_0x477a7c});}function _0x5c9f95(_0x120549){logger['error']('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x86d6('0x22')](_0x120549)){logger['error'](_[_0x86d6('0x23')](_0x120549)?JSON[_0x86d6('0x13')](_0x120549):_0x120549);}}_0x36237a['on'](_0x86d6('0x24'),_0x18e807);_0x36237a['on']('message',_0x33ace0);_0x36237a['on'](_0x86d6('0x11'),_0x1a53f1);_0x36237a['on'](_0x86d6('0x25'),_0x5c9f95);});}; \ No newline at end of file +var _0x26f3=['hypotheses','transcript','likelihood','Success.','terminate','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','isObject','open','message','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','sha1','update','Open\x20Tilde\x20ASR\x20socket','send','createReadStream','close','EOS','error','stringify','parse','status','result','final','Tilde\x20ASR\x20hypoteses'];(function(_0x49cc43,_0x413e15){var _0x49f4a9=function(_0x4c9d9a){while(--_0x4c9d9a){_0x49cc43['push'](_0x49cc43['shift']());}};_0x49f4a9(++_0x413e15);}(_0x26f3,0x87));var _0x326f=function(_0x29df9a,_0x42aff3){_0x29df9a=_0x29df9a-0x0;var _0x3a8e96=_0x26f3[_0x29df9a];return _0x3a8e96;};'use strict';var BPromise=require(_0x326f('0x0'));var _=require(_0x326f('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x326f('0x2'));var crypto=require(_0x326f('0x3'));var logger=require(_0x326f('0x4'))(_0x326f('0x5'));module[_0x326f('0x6')]=function(_0x33e956,_0x556510,_0x3fc898,_0x294147){return new BPromise(function(_0xa4bcbe,_0x613cc8){logger[_0x326f('0x7')](_0x326f('0x8'),_0x294147||_0x326f('0x9'));var _0x49afcd=new WebSocket(_0x294147||_0x326f('0x9'),{'perMessageDeflate':![]});var _0xd2d01c='';var _0x3fef5a='0';var _0x316ef3='1';var _0x452f8f=_0x326f('0xa');function _0x2bb2cd(_0x4ce068){var _0x511b03=crypto['createHash'](_0x326f('0xb'));_0x511b03[_0x326f('0xc')](_0x4ce068);return _0x511b03['digest']('hex');}function _0xde76ee(){try{logger[_0x326f('0x7')](_0x326f('0xd'));var _0x4b76f6=moment()['unix']();var _0x4d2a0f=_0x2bb2cd(_0x4b76f6+_0x556510+_0x3fc898);_0x49afcd[_0x326f('0xe')](JSON['stringify']({'appID':_0x556510,'timestamp':_0x4b76f6,'appKey':_0x4d2a0f}));var _0x537871=fs[_0x326f('0xf')](_0x33e956);_0x537871['on']('data',function(_0x59ebf4){_0x49afcd[_0x326f('0xe')](_0x59ebf4);});_0x537871['on'](_0x326f('0x10'),function(){_0x49afcd[_0x326f('0xe')](_0x326f('0x11'));});}catch(_0x1f26aa){logger[_0x326f('0x12')]('Tilde\x20ASR\x20send\x20error',JSON[_0x326f('0x13')](_0x1f26aa));_0x49afcd['terminate']();}}function _0x3de134(_0x246a49){try{if(_0x246a49){var _0x1753a2=JSON[_0x326f('0x14')](_0x246a49);switch(_0x1753a2[_0x326f('0x15')]){case 0x0:if(_0x1753a2[_0x326f('0x16')]){if(_0x1753a2[_0x326f('0x16')][_0x326f('0x17')]){logger[_0x326f('0x7')](_0x326f('0x18'),JSON[_0x326f('0x13')](_0x1753a2[_0x326f('0x16')][_0x326f('0x19')]));_0xd2d01c=_0x1753a2['result']['hypotheses'][0x0][_0x326f('0x1a')];_0x3fef5a=_0x1753a2[_0x326f('0x16')][_0x326f('0x19')][0x0][_0x326f('0x1b')];_0x316ef3='0';_0x452f8f=_0x326f('0x1c');_0x49afcd[_0x326f('0x1d')]();}}break;case 0x1:logger[_0x326f('0x7')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x316ef3='1';_0x452f8f=_0x326f('0xa');break;case 0x2:logger[_0x326f('0x7')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x316ef3='2';_0x452f8f=_0x326f('0x1e');break;case 0x9:logger[_0x326f('0x7')](_0x326f('0x1f'));_0x316ef3='9';_0x452f8f=_0x326f('0x1f');break;case 0xa:logger['info'](_0x326f('0x20'));_0x316ef3='10';_0x452f8f=_0x326f('0x20');break;case 0xb:logger[_0x326f('0x7')](_0x326f('0x21'));_0x316ef3='11';_0x452f8f=_0x326f('0x21');}}}catch(_0x6a3025){logger['error'](_0x326f('0x22'),JSON[_0x326f('0x13')](_0x6a3025));_0x49afcd[_0x326f('0x1d')]();}}function _0x21991a(){logger[_0x326f('0x7')](_0x326f('0x23'));_0xa4bcbe({'transcript':_0xd2d01c,'confidence':_0x3fef5a,'status':_0x316ef3,'status_message':_0x452f8f});}function _0x50dae4(_0x56b32e){logger[_0x326f('0x12')](_0x326f('0x24'));if(!_['isNil'](_0x56b32e)){logger[_0x326f('0x12')](_[_0x326f('0x25')](_0x56b32e)?JSON[_0x326f('0x13')](_0x56b32e):_0x56b32e);}}_0x49afcd['on'](_0x326f('0x26'),_0xde76ee);_0x49afcd['on'](_0x326f('0x27'),_0x3de134);_0x49afcd['on'](_0x326f('0x10'),_0x21991a);_0x49afcd['on'](_0x326f('0x12'),_0x50dae4);});}; \ 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 fe7d442..23af678 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 _0xedd9=['exports'];(function(_0x1f6bf4,_0x470780){var _0x5076d1=function(_0x3bb5fc){while(--_0x3bb5fc){_0x1f6bf4['push'](_0x1f6bf4['shift']());}};_0x5076d1(++_0x470780);}(_0xedd9,0xfc));var _0x9edd=function(_0x51486d,_0x3c6ae4){_0x51486d=_0x51486d-0x0;var _0x490680=_0xedd9[_0x51486d];return _0x490680;};var asr=require('./asr');module[_0x9edd('0x0')]={'asr':asr}; \ No newline at end of file +var _0x008c=['./asr','exports'];(function(_0x56a7bc,_0x41d6f6){var _0x4f5883=function(_0x23e4a4){while(--_0x23e4a4){_0x56a7bc['push'](_0x56a7bc['shift']());}};_0x4f5883(++_0x41d6f6);}(_0x008c,0x188));var _0xc008=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0x008c[_0x4cbf20];return _0x582ae4;};var asr=require(_0xc008('0x0'));module[_0xc008('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 73cda70..9cd1817 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 _0x6599=['net','events','EventEmitter','./error','./channel','emit','E_AGI_ARGUMENT_PORT','listen','listening','connection','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports'];(function(_0x241eb9,_0x5bb5b2){var _0x1c03ab=function(_0x55ac97){while(--_0x55ac97){_0x241eb9['push'](_0x241eb9['shift']());}};_0x1c03ab(++_0x5bb5b2);}(_0x6599,0xb0));var _0x9659=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x6599[_0x4e7d25];return _0x526fe6;};'use strict';var util=require('util');var net=require(_0x9659('0x0'));var EventEmitter=require(_0x9659('0x1'))[_0x9659('0x2')];var AGIError=require(_0x9659('0x3'));var AGIChannel=require(_0x9659('0x4'));var AGIServer=function(_0x4c8ba9,_0xb8bddb,_0x5e2a8e){var _0x2f5d38=this,_0x4c8ba9=_0x4c8ba9||0x11dd,_0xb8bddb=_0xb8bddb||'127.0.0.1',_0xb08ede=null,_0x159ac2=0x0;EventEmitter['call'](_0x2f5d38);function _0xabdd12(){if(!_0x4c8ba9){_0x2f5d38[_0x9659('0x5')]('error',new AGIError(_0x9659('0x6')));return![];}_0xb08ede=net['createServer']();_0xb08ede[_0x9659('0x7')](_0x4c8ba9,_0xb8bddb);_0xb08ede['on'](_0x9659('0x8'),function(){_0x2f5d38['emit'](_0x9659('0x8'));});_0xb08ede['on'](_0x9659('0x9'),function(_0x349cfb){_0xb08ede['getConnections'](function(_0x2ca508,_0x520848){if(_0x2ca508){_0x2f5d38[_0x9659('0x5')](_0x9659('0xa'),new AGIError(_0x9659('0xb'),_0x2ca508));}else if(_0x5e2a8e&&_0x5e2a8e<0x0){_0x2f5d38['emit'](_0x9659('0xa'),new AGIError(_0x9659('0xc')));_0x349cfb[_0x9659('0xd')]();}else if(_0x5e2a8e&&_0x5e2a8e>0x0&&_0x5e2a8e<_0x520848){_0x159ac2+=0x1;_0x2f5d38[_0x9659('0x5')](_0x9659('0xa'),new AGIError(_0x9659('0xe'),_0x159ac2));_0x349cfb[_0x9659('0xd')]();}else{var _0x3a3b18=new AGIChannel(_0x349cfb);_0x3a3b18['on'](_0x9659('0xf'),function(){_0x2f5d38[_0x9659('0x5')](_0x9659('0x9'),_0x3a3b18);});}});});_0xb08ede['on'](_0x9659('0xa'),function(_0x23e514){_0x2f5d38[_0x9659('0x5')]('error',new AGIError(_0x9659('0xb'),_0x23e514[_0x9659('0x10')]));});_0xb08ede['on'](_0x9659('0x11'),function(){_0x2f5d38[_0x9659('0x5')](_0x9659('0x11'),new AGIError(_0x9659('0x12')));});}process[_0x9659('0x13')](function(){_0xabdd12();});};util[_0x9659('0x14')](AGIServer,EventEmitter);module[_0x9659('0x15')]=function(_0x525d27,_0xe3e9d4,_0xaa8560){return new AGIServer(_0x525d27,_0xe3e9d4,_0xaa8560);}; \ No newline at end of file +var _0x675c=['E_AGI_SERVER_ERROR','E_AGI_SERVER_MAXCONNECTION','destroy','ready','code','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listening','connection'];(function(_0x148235,_0x472870){var _0x255e6f=function(_0x4612c6){while(--_0x4612c6){_0x148235['push'](_0x148235['shift']());}};_0x255e6f(++_0x472870);}(_0x675c,0x72));var _0xc675=function(_0x34b049,_0x42ee2b){_0x34b049=_0x34b049-0x0;var _0x13fc11=_0x675c[_0x34b049];return _0x13fc11;};'use strict';var util=require(_0xc675('0x0'));var net=require(_0xc675('0x1'));var EventEmitter=require(_0xc675('0x2'))[_0xc675('0x3')];var AGIError=require('./error');var AGIChannel=require(_0xc675('0x4'));var AGIServer=function(_0x195ce2,_0x382fdf,_0x1c81fc){var _0x59a2e6=this,_0x195ce2=_0x195ce2||0x11dd,_0x382fdf=_0x382fdf||'127.0.0.1',_0x29162c=null,_0x248744=0x0;EventEmitter[_0xc675('0x5')](_0x59a2e6);function _0x2a970a(){if(!_0x195ce2){_0x59a2e6[_0xc675('0x6')](_0xc675('0x7'),new AGIError(_0xc675('0x8')));return![];}_0x29162c=net[_0xc675('0x9')]();_0x29162c['listen'](_0x195ce2,_0x382fdf);_0x29162c['on'](_0xc675('0xa'),function(){_0x59a2e6[_0xc675('0x6')](_0xc675('0xa'));});_0x29162c['on'](_0xc675('0xb'),function(_0x5c9c63){_0x29162c['getConnections'](function(_0x41505e,_0x41e1a0){if(_0x41505e){_0x59a2e6[_0xc675('0x6')](_0xc675('0x7'),new AGIError(_0xc675('0xc'),_0x41505e));}else if(_0x1c81fc&&_0x1c81fc<0x0){_0x59a2e6[_0xc675('0x6')](_0xc675('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x5c9c63['destroy']();}else if(_0x1c81fc&&_0x1c81fc>0x0&&_0x1c81fc<_0x41e1a0){_0x248744+=0x1;_0x59a2e6[_0xc675('0x6')](_0xc675('0x7'),new AGIError(_0xc675('0xd'),_0x248744));_0x5c9c63[_0xc675('0xe')]();}else{var _0x47f985=new AGIChannel(_0x5c9c63);_0x47f985['on'](_0xc675('0xf'),function(){_0x59a2e6[_0xc675('0x6')](_0xc675('0xb'),_0x47f985);});}});});_0x29162c['on'](_0xc675('0x7'),function(_0x5c91c9){_0x59a2e6[_0xc675('0x6')]('error',new AGIError(_0xc675('0xc'),_0x5c91c9[_0xc675('0x10')]));});_0x29162c['on'](_0xc675('0x11'),function(){_0x59a2e6['emit'](_0xc675('0x11'),new AGIError(_0xc675('0x12')));});}process['nextTick'](function(){_0x2a970a();});};util[_0xc675('0x13')](AGIServer,EventEmitter);module[_0xc675('0x14')]=function(_0x4e4801,_0x2f62f5,_0xf92d87){return new AGIServer(_0x4e4801,_0x2f62f5,_0xf92d87);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index d9587c9..9acc4f1 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 _0x46d5=['service','host','port','secure','authentication','auth','pass','template_id','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','arg_1','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','tts','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','menu','getdigits','getsecretdigits','rpc','mailRpc','prototype','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','sendMailMessage','getIntervals','getIntervalById','IntervalId','map','interval','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','channel','uniqueid','label','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','callback_priority','getPause','getPauseById','agent','agentPause','agentUnpause','agentLogout','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','replace','googleTTS','google_tts_language','text','sestekNDA','ispeechTTS','key','ispeech_tts_language','en-US','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_bot_name','googleASR','tildeASR','appid','appsecret','uri','clear','includes','agicommand','clone','isString','replaceAllVariables','length','split','replaceAll','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','createSquareDetailsReport','sync','retry','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','timeout','Wait\x20%s\x20seconds\x20before\x20answer','wait','no\x20list\x20selected','delay','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','options','Executed\x20command\x20%s\x20%s','lumenvoxtts','MRCPSynth','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','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_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','forEach','keys','setVariable','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','getUser','SIP/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','hasOwnProperty','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20variable\x20selected\x20for\x20the\x20result','response','maxdigit','toString','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','bot','Trying\x20Amazon\x20Lex:\x20%s','awsLex','AWS_LEX_%s','message','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','%s.%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','stringify','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','condition','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','operation','no\x20operation\x20configured','isArray','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause_id','playback','no\x20file\x20audio\x20selected','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','subject'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x46d5,0x1b2));var _0x546d=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x46d5[_0x465a0c];return _0x1e202e;};'use strict';var fs=require('fs');var path=require(_0x546d('0x0'));var util=require(_0x546d('0x1'));var _=require(_0x546d('0x2'));var sh=require(_0x546d('0x3'));var odbc=require(_0x546d('0x4'))();var rs=require(_0x546d('0x5'));var moment=require(_0x546d('0x6'));var Mustache=require(_0x546d('0x7'));var logger=require(_0x546d('0x8'))(_0x546d('0x9'));var config=require(_0x546d('0xa'));var scripts=require(_0x546d('0xb'));var FILES_PATH=_0x546d('0xc');var verticesWithRetry=[_0x546d('0xd'),_0x546d('0xe'),_0x546d('0xf')];var AGIVertices=function(_0x55ca37,_0x93118b,_0x369702){this['channel']=_0x55ca37;this[_0x546d('0x10')]=_0x93118b;this[_0x546d('0x11')]=_0x369702;};AGIVertices[_0x546d('0x12')]['getVariable']=function(_0x930448,_0x45bcac){this[_0x546d('0x10')]['getVariableById'](_0x930448)[_0x546d('0x13')](function(_0x2595fe){_0x45bcac(null,_0x2595fe?_0x2595fe[_0x546d('0x14')]:![]);})[_0x546d('0x15')](function(_0x240312){_0x45bcac(_0x240312);});};AGIVertices[_0x546d('0x12')][_0x546d('0x16')]=function(_0x2bf302,_0x34644f){this[_0x546d('0x10')][_0x546d('0x17')](_0x2bf302)[_0x546d('0x13')](function(_0x2c9b30){_0x34644f(null,_0x2c9b30?_0x2c9b30[_0x546d('0x14')]:![]);})[_0x546d('0x15')](function(_0x3e2cff){_0x34644f(_0x3e2cff);});};AGIVertices[_0x546d('0x12')][_0x546d('0x18')]=function(_0x406169,_0x5304ac){this[_0x546d('0x10')][_0x546d('0x19')](_0x406169)[_0x546d('0x13')](function(_0x4f6441){_0x5304ac(null,_0x4f6441?_0x4f6441[_0x546d('0x14')]:![]);})[_0x546d('0x15')](function(_0x2316da){_0x5304ac(_0x2316da);});};AGIVertices[_0x546d('0x12')][_0x546d('0x1a')]=function(_0x49c555,_0x4a8229){this[_0x546d('0x10')]['getSquareOdbcById'](_0x49c555)['then'](function(_0x2f2f67){_0x4a8229(null,_0x2f2f67?_0x2f2f67['dsn']:![]);})[_0x546d('0x15')](function(_0xaddf52){_0x4a8229(_0xaddf52);});};AGIVertices[_0x546d('0x12')]['getUser']=function(_0x22728b,_0x2a10be){this[_0x546d('0x10')]['getUserById'](_0x22728b)[_0x546d('0x13')](function(_0xe6489b){_0x2a10be(null,_0xe6489b?_0xe6489b[_0x546d('0x14')]:![]);})[_0x546d('0x15')](function(_0x545811){_0x2a10be(_0x545811);});};AGIVertices[_0x546d('0x12')][_0x546d('0x1b')]=function(_0x3cfbeb,_0x2b8fec){this[_0x546d('0x10')][_0x546d('0x1c')](_0x3cfbeb)[_0x546d('0x13')](function(_0x42654e){_0x2b8fec(null,_0x42654e?_0x42654e[_0x546d('0x14')]:![]);})[_0x546d('0x15')](function(_0x50b778){_0x2b8fec(_0x50b778);});};AGIVertices['prototype'][_0x546d('0x1d')]=function(_0x42d4ab,_0x2b8458){var _0xc78fae=this;this[_0x546d('0x10')][_0x546d('0x1e')](_0x42d4ab)[_0x546d('0x13')](function(_0x58ce0e){_0x2b8458(null,_0x58ce0e?_0xc78fae[_0x546d('0x1f')](_0x58ce0e[_0x546d('0x20')]):![]);})[_0x546d('0x15')](function(_0x2aedbd){_0x2b8458(_0x2aedbd);});};AGIVertices[_0x546d('0x12')]['getMailAccount']=function(_0xdf3e68,_0x2bc63d){this['rpc']['getMailAccountById'](_0xdf3e68)[_0x546d('0x13')](function(_0x14826d){_0x2bc63d(null,_0x14826d?_0x14826d:![]);})[_0x546d('0x15')](function(_0x4da81f){_0x2bc63d(_0x4da81f);});};AGIVertices[_0x546d('0x12')]['sendMailMessage']=function(_0x27305d,_0x276e47,_0xd7ffac){this[_0x546d('0x11')][_0x546d('0x21')](_0x27305d,_0x276e47)[_0x546d('0x13')](function(){_0xd7ffac(null);})[_0x546d('0x15')](function(_0x1bfee2){_0xd7ffac(_0x1bfee2);});};AGIVertices[_0x546d('0x12')][_0x546d('0x22')]=function(_0x5a61cf,_0xf3d7e2){this[_0x546d('0x10')][_0x546d('0x23')](_0x5a61cf)[_0x546d('0x13')](function(_0x5eb65f){if(_0x5eb65f){if(_0x5eb65f[_0x546d('0x24')]){_0xf3d7e2(null,[_0x5eb65f['interval']]);}else{_0xf3d7e2(null,_[_0x546d('0x25')](_0x5eb65f['Intervals'],_0x546d('0x26')));}}else{_0xf3d7e2(null,![]);}})[_0x546d('0x15')](function(_0x3b1755){_0xf3d7e2(_0x3b1755);});};AGIVertices[_0x546d('0x12')]['getSoundPath']=function(_0x4dc419){return util[_0x546d('0x27')]('%s/sounds/converted/%s',FILES_PATH,_0x4dc419);};AGIVertices['prototype'][_0x546d('0x28')]=function(_0x52759c,_0x24f992,_0x430656){odbc[_0x546d('0x29')](_0x52759c,function(_0x2be61d){if(_0x2be61d){logger[_0x546d('0x2a')](_0x546d('0x2b'),_0x2be61d);_0x430656(_0x2be61d);}else{logger[_0x546d('0x2c')]('ODBC\x20connection\x20successfully');odbc[_0x546d('0x2d')](_0x24f992,function(_0x579b55,_0x1d9300){if(_0x579b55){logger['info'](_0x546d('0x2e'),_0x24f992);_0x430656(_0x579b55);}else{logger[_0x546d('0x2c')](_0x546d('0x2f'),_0x24f992);odbc[_0x546d('0x30')](function(_0xd796e2){if(_0xd796e2){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0xd796e2);}_0x430656(null,_0x1d9300);});}});}});};AGIVertices[_0x546d('0x12')][_0x546d('0x31')]=function(_0x1708a1,_0x27f08c){this[_0x546d('0x10')][_0x546d('0x32')](_0x1708a1)[_0x546d('0x13')](function(_0x1a49ef){_0x27f08c(null,_0x1a49ef?_0x1a49ef:![]);})['catch'](function(_0x285c8e){_0x27f08c(_0x285c8e);});};AGIVertices[_0x546d('0x12')][_0x546d('0x33')]=function(_0x17c7d5,_0x58b8fa){this[_0x546d('0x10')][_0x546d('0x33')](_0x17c7d5)[_0x546d('0x13')](function(_0x1f0ef1){_0x58b8fa(null,_0x1f0ef1);})[_0x546d('0x15')](function(_0x318e0f){_0x58b8fa(_0x318e0f);});};AGIVertices[_0x546d('0x12')]['createSquareDetailsReport']=function(_0x2a25ce,_0x12a216,_0x4befd0){this[_0x546d('0x10')]['createSquareDetailsReport']({'uniqueid':this[_0x546d('0x34')][_0x546d('0x35')],'node':_0x2a25ce[_0x546d('0x36')],'application':_0x2a25ce['agicommand'],'data':_0x12a216||null,'project_name':this[_0x546d('0x34')]['arg_1'],'callerid':this[_0x546d('0x34')][_0x546d('0x37')]})[_0x546d('0x13')](function(_0x4768d7){if(_0x4befd0){_0x4befd0(null,_0x4768d7);}})[_0x546d('0x15')](function(_0x27735f){if(_0x4befd0){_0x4befd0(_0x27735f);}});};AGIVertices[_0x546d('0x12')][_0x546d('0x38')]=function(_0x587912,_0x5e8557,_0x4dafb2,_0x2d0db8){this['rpc'][_0x546d('0x38')]({'uniqueid':this['channel']['uniqueid'],'callerid':this[_0x546d('0x34')][_0x546d('0x37')],'calleridname':this[_0x546d('0x34')][_0x546d('0x39')],'context':this['channel'][_0x546d('0x3a')],'extension':this[_0x546d('0x34')][_0x546d('0x3b')],'priority':this['channel'][_0x546d('0x3c')],'accountcode':this[_0x546d('0x34')][_0x546d('0x3d')],'dnid':this[_0x546d('0x34')][_0x546d('0x3e')],'projectName':this['channel']['arg_1'],'saveName':_0x5e8557,'filename':_0x587912[_0x546d('0x3f')]||_0x5e8557,'savePath':_0x4dafb2})[_0x546d('0x13')](function(_0x137b71){_0x2d0db8(null,_0x137b71);})['catch'](function(_0x2d2fa0){_0x2d0db8(_0x2d2fa0);});};AGIVertices[_0x546d('0x12')][_0x546d('0x40')]=function(_0x4dfba3,_0x456599,_0x3ced1d){this[_0x546d('0x10')][_0x546d('0x40')]({'uniqueid':this[_0x546d('0x34')][_0x546d('0x35')],'body':_0x4dfba3,'direction':_0x456599})[_0x546d('0x13')](function(_0x1af094){if(_0x3ced1d){_0x3ced1d(null,_0x1af094);}})['catch'](function(_0x34febd){if(_0x3ced1d){_0x3ced1d(_0x34febd);}});};AGIVertices[_0x546d('0x12')][_0x546d('0x41')]=function(_0x15e0f0,_0x25b50e){this[_0x546d('0x10')]['createCmContact']({'firstName':_[_0x546d('0x42')](_0x15e0f0[_0x546d('0x14')])||_[_0x546d('0x43')](_0x15e0f0['name'])?'callback_'+Math[_0x546d('0x44')]():_0x15e0f0[_0x546d('0x14')],'lastName':_['isEmpty'](_0x15e0f0['lastName'])||_['isNil'](_0x15e0f0['lastName'])?null:_0x15e0f0[_0x546d('0x45')],'phone':_0x15e0f0['phone'],'ListId':_0x15e0f0[_0x546d('0x46')],'scheduledAt':_0x15e0f0[_0x546d('0x47')],'callbackUniqueid':this['channel'][_0x546d('0x35')],'tags':_0x546d('0x48'),'description':_0x546d('0x49')+_0x15e0f0[_0x546d('0x47')]['toString'](),'priority':_0x15e0f0[_0x546d('0x4a')]})[_0x546d('0x13')](function(_0x224009){_0x25b50e(null,_0x224009);})[_0x546d('0x15')](function(_0x17e396){_0x25b50e(_0x17e396);});};AGIVertices[_0x546d('0x12')][_0x546d('0x4b')]=function(_0x158491,_0x21d494){this['rpc'][_0x546d('0x4c')](_0x158491)[_0x546d('0x13')](function(_0x47f6b9){_0x21d494(null,_0x47f6b9?_0x47f6b9[_0x546d('0x14')]:![]);})[_0x546d('0x15')](function(_0x515e7a){_0x21d494(_0x515e7a);});};AGIVertices[_0x546d('0x12')]['agentPause']=function(_0x159798,_0x4f2f13,_0x1d5ce7){var _0x1e770e={'role':_0x546d('0x4d')};_0x1e770e[_0x159798]=this[_0x546d('0x34')][_0x546d('0x37')];this['rpc'][_0x546d('0x4e')](_0x1e770e,_0x4f2f13,this[_0x546d('0x34')][_0x546d('0x35')])['then'](function(_0x578fa0){_0x1d5ce7(null,_['isNil'](_0x578fa0)?![]:!![]);})['catch'](function(_0x500719){logger['error'](_0x500719);_0x1d5ce7(null,![]);});};AGIVertices[_0x546d('0x12')]['agentUnpause']=function(_0x593ef8,_0x3c5ba0){var _0x26b6f8={'role':_0x546d('0x4d')};_0x26b6f8[_0x593ef8]=this[_0x546d('0x34')][_0x546d('0x37')];this[_0x546d('0x10')][_0x546d('0x4f')](_0x26b6f8)[_0x546d('0x13')](function(_0x9f93b9){_0x3c5ba0(null,_[_0x546d('0x43')](_0x9f93b9)?![]:!![]);})[_0x546d('0x15')](function(_0x5a01ce){logger['error'](_0x5a01ce);_0x3c5ba0(null,![]);});};AGIVertices[_0x546d('0x12')][_0x546d('0x50')]=function(_0x1f0517,_0xa5a247){var _0x1d74da={'role':_0x546d('0x4d')};_0x1d74da[_0x1f0517]=this[_0x546d('0x34')][_0x546d('0x37')];this['rpc'][_0x546d('0x50')](_0x1d74da)[_0x546d('0x13')](function(_0x88fdd0){_0xa5a247(null,_[_0x546d('0x43')](_0x88fdd0)?![]:!![]);})[_0x546d('0x15')](function(_0x3f3d89){logger[_0x546d('0x2a')](_0x3f3d89);_0xa5a247(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x58b998,_0x3ea7a6){var _0x2aa950={'role':'agent'};_0x2aa950[_0x58b998]=this[_0x546d('0x34')]['callerid'];var _0x1de095=_0x58b998!='internal'?util[_0x546d('0x27')](_0x546d('0x51'),_0x546d('0x52'),this[_0x546d('0x34')][_0x546d('0x37')]):undefined;this['rpc'][_0x546d('0x53')](_0x2aa950,_0x1de095)['then'](function(_0x25263a){_0x3ea7a6(null,_['isNil'](_0x25263a)?![]:!![]);})['catch'](function(_0x67e9f3){logger[_0x546d('0x2a')](_0x67e9f3);_0x3ea7a6(null,![]);});};AGIVertices[_0x546d('0x12')][_0x546d('0x54')]=function(_0x2b7860,_0x577881){sh[_0x546d('0x55')](_['trim'](_0x2b7860),function(_0x4a08c6,_0x8cbce6){var _0x1a43c2=_0x8cbce6[_0x546d('0x56')](/(\r\n|\n|\r)/gm,'');_0x577881(null,_0x1a43c2);});};AGIVertices[_0x546d('0x12')][_0x546d('0x57')]=function(_0x433ac3,_0x58f2bd){scripts[_0x546d('0x57')](_0x433ac3['text'],_0x433ac3[_0x546d('0x58')]||'en',0x1)[_0x546d('0x13')](function(_0x44af89){_0x58f2bd(null,_0x44af89);})[_0x546d('0x15')](function(_0x43f702){_0x58f2bd(_0x43f702);});};AGIVertices[_0x546d('0x12')]['googleDialogflow']=function(_0x4e305b,_0x45159a){scripts['googleDialogflow'](this[_0x546d('0x34')][_0x546d('0x35')],_0x4e305b['key'],_0x4e305b[_0x546d('0x59')],_0x4e305b['dialogflow_language']||'en')['then'](function(_0xf8088c){_0x45159a(null,_0xf8088c);})[_0x546d('0x15')](function(_0x4fc2cf){_0x45159a(_0x4fc2cf);});};AGIVertices[_0x546d('0x12')][_0x546d('0x5a')]=function(_0x304ba2,_0x43207e){scripts[_0x546d('0x5a')](this['channel'],_0x304ba2)[_0x546d('0x13')](function(_0x5372b3){_0x43207e(null,_0x5372b3);})[_0x546d('0x15')](function(_0x3f20b8){_0x43207e(_0x3f20b8);});};AGIVertices['prototype']['ispeechTTS']=function(_0x3eaa21,_0x1943e0){scripts[_0x546d('0x5b')](_0x3eaa21[_0x546d('0x5c')],_0x3eaa21['text'],_0x3eaa21[_0x546d('0x5d')]||_0x546d('0x5e'),_0x3eaa21['speed'])[_0x546d('0x13')](function(_0x34c1cf){_0x1943e0(null,_0x34c1cf);})[_0x546d('0x15')](function(_0x364bbd){_0x1943e0(_0x364bbd);});};AGIVertices['prototype'][_0x546d('0x5f')]=function(_0x39ff71,_0x2f2ae3,_0x49b2d2){scripts[_0x546d('0x5f')](_0x2f2ae3,_0x39ff71[_0x546d('0x5c')],_0x39ff71[_0x546d('0x60')]||_0x546d('0x5e'),this[_0x546d('0x61')](_0x39ff71[_0x546d('0x62')])?_0x39ff71[_0x546d('0x62')]:undefined)[_0x546d('0x13')](function(_0x52aa9a){_0x49b2d2(null,_0x52aa9a);})['catch'](function(_0x162894){_0x49b2d2(_0x162894);});};AGIVertices['prototype'][_0x546d('0x63')]=function(_0x47a93a,_0x2f9b4a){scripts[_0x546d('0x63')](_0x47a93a[_0x546d('0x64')],_0x47a93a[_0x546d('0x65')],_0x47a93a[_0x546d('0x66')],_0x47a93a[_0x546d('0x67')]||_0x546d('0x68'),_0x47a93a[_0x546d('0x59')],_0x47a93a['aws_text_type']||_0x546d('0x59'))['then'](function(_0x5af7f3){_0x2f9b4a(null,_0x5af7f3);})['catch'](function(_0xda8f54){_0x2f9b4a(_0xda8f54);});};AGIVertices['prototype']['awsLex']=function(_0x18f40f,_0x4eed86){scripts['awsLex'](this[_0x546d('0x34')][_0x546d('0x35')],_0x18f40f['aws_access_key_id'],_0x18f40f[_0x546d('0x65')],_0x18f40f['aws_lex_region'],_0x18f40f['text'],_0x18f40f[_0x546d('0x69')])[_0x546d('0x13')](function(_0x4ba8cd){_0x4eed86(null,_0x4ba8cd);})[_0x546d('0x15')](function(_0x1172f7){_0x4eed86(_0x1172f7);});};AGIVertices[_0x546d('0x12')][_0x546d('0x6a')]=function(_0x17c94d,_0x29a9fb,_0x5b105d){scripts['googleASR'](_0x29a9fb,_0x17c94d['key'],_0x17c94d['google_asr_language']||'en-US')['then'](function(_0xf44f8b){_0x5b105d(null,_0xf44f8b);})[_0x546d('0x15')](function(_0x395253){_0x5b105d(_0x395253);});};AGIVertices[_0x546d('0x12')]['tildeASR']=function(_0x2c591e,_0x2eff37,_0x11d3e2){scripts[_0x546d('0x6b')](_0x2eff37,_0x2c591e[_0x546d('0x6c')],_0x2c591e[_0x546d('0x6d')],_0x2c591e[_0x546d('0x6e')])[_0x546d('0x13')](function(_0x536ae7){_0x11d3e2(null,_0x536ae7);})['catch'](function(_0x1f80d3){_0x11d3e2(_0x1f80d3);});};AGIVertices[_0x546d('0x12')][_0x546d('0x6f')]=function(_0x33996e){var _0x129559=_[_0x546d('0x70')](verticesWithRetry,_0x33996e[_0x546d('0x71')])?_0x33996e:_[_0x546d('0x72')](_0x33996e);for(var _0x500937 in _0x129559){if(_0x129559['hasOwnProperty'](_0x500937)){if(_0x129559[_0x500937]&&_[_0x546d('0x73')](_0x129559[_0x500937])){_0x129559[_0x500937]=this[_0x546d('0x74')](_0x129559[_0x500937]);}}}return _0x129559;};AGIVertices['prototype'][_0x546d('0x74')]=function(_0x35fb0f){var _0xf64954=_0x35fb0f['split']('{');for(var _0x3d94bd=0x1;_0x3d94bd<_0xf64954[_0x546d('0x75')];_0x3d94bd+=0x1){var _0x4cefc4=_0xf64954[_0x3d94bd][_0x546d('0x76')]('}');if(_0x4cefc4[_0x546d('0x75')]>0x1){_0x35fb0f=_0x35fb0f[_0x546d('0x77')]('{'+_0x4cefc4[0x0]+'}',this[_0x546d('0x34')][_0x546d('0x78')](_0x4cefc4[0x0])[_0x546d('0x79')]||_0x4cefc4[0x0]);}}if(_0xf64954[_0x546d('0x75')]===0x1){return _0x35fb0f['toString']();}return this[_0x546d('0x74')](_0x35fb0f);};AGIVertices['prototype'][_0x546d('0x7a')]=function(_0x198166,_0x3d7c9b){var _0xa8acf2=this['channel'][_0x546d('0x78')](_0x198166);if(_0xa8acf2[_0x546d('0x7b')]===-0x1){return _0xa8acf2;}logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x7c'),_0x3d7c9b,_0xa8acf2['extra']));return this[_0x546d('0x34')]['setVariable'](_0x3d7c9b,_0xa8acf2['extra']);};AGIVertices[_0x546d('0x12')][_0x546d('0x61')]=function(_0x5870b8){return _0x5870b8&&_0x5870b8!=='0'&&_0x5870b8!=='-1'&&_0x5870b8!=='';};AGIVertices['prototype'][_0x546d('0x7d')]=function(_0x22cf7e){this[_0x546d('0x7e')][_0x546d('0x7f')](this,_0x22cf7e,'-');_0x22cf7e[_0x546d('0x80')]=_0x22cf7e[_0x546d('0x7d')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x546d('0x12')][_0x546d('0x9')]=function(_0x339b0f){logger[_0x546d('0x2c')](util[_0x546d('0x27')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x339b0f[_0x546d('0x36')]));return this['channel']['agi']([_0x339b0f['command'],_0x339b0f['args']]);};AGIVertices[_0x546d('0x12')][_0x546d('0x81')]=function(_0x322d86){logger[_0x546d('0x2c')](util['format'](_0x546d('0x82'),_0x322d86[_0x546d('0x36')]));if(this[_0x546d('0x61')](_0x322d86[_0x546d('0x83')])){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x84'),_0x322d86['timeout']));var _0x52b5b5=this[_0x546d('0x34')][_0x546d('0x85')](_0x322d86[_0x546d('0x83')]);if(_0x52b5b5[_0x546d('0x7b')]===-0x1){return _0x52b5b5;}}return this[_0x546d('0x34')][_0x546d('0x81')]();};AGIVertices[_0x546d('0x12')]['callback']=function(_0x3291cc){logger[_0x546d('0x2c')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x3291cc[_0x546d('0x36')]));if(!this['isConfigured'](_0x3291cc[_0x546d('0x46')])){return this['channel']['error'](_0x3291cc,_0x546d('0x86'));}_0x3291cc[_0x546d('0x47')]=moment();if(this[_0x546d('0x61')](_0x3291cc['delay'])){_0x3291cc[_0x546d('0x47')]=moment()['add'](_0x3291cc[_0x546d('0x87')],'minutes');}if(!this[_0x546d('0x61')](_0x3291cc[_0x546d('0x4a')])){_0x3291cc['callback_priority']=0x2;}this[_0x546d('0x41')][_0x546d('0x7f')](this,_0x3291cc);return this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')](_0x546d('0x89'),_0x3291cc[_0x546d('0x8a')],_0x3291cc[_0x546d('0x46')],_0x3291cc[_0x546d('0x47')]));};AGIVertices[_0x546d('0x12')][_0x546d('0x8b')]=function(_0x241f60){logger['info'](util['format'](_0x546d('0x8c'),_0x241f60['label']));var _0x3ce11c=this[_0x546d('0x34')][_0x546d('0x55')](_0x241f60[_0x546d('0x8d')],_0x241f60[_0x546d('0x8e')]);if(_0x3ce11c['result']===-0x1){return _0x3ce11c;}return this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')](_0x546d('0x8f'),_0x241f60[_0x546d('0x8d')],_0x241f60['options']));};AGIVertices['prototype'][_0x546d('0x90')]=function(_0x197c56){logger['info'](util['format']('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x197c56[_0x546d('0x36')]));if(!this['isConfigured'](_0x197c56[_0x546d('0x59')])){return this['channel'][_0x546d('0x88')]('no\x20text\x20configured');}var _0x1f1bd7='\x22'+_0x197c56[_0x546d('0x59')]+'\x22';if(this[_0x546d('0x61')](_0x197c56[_0x546d('0x8e')])){_0x1f1bd7+=','+_0x197c56[_0x546d('0x8e')];}var _0x1f6e9a=this[_0x546d('0x34')][_0x546d('0x55')](_0x546d('0x91'),_0x1f1bd7);if(_0x1f6e9a[_0x546d('0x7b')]===-0x1){return _0x1f6e9a;}return this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x1f1bd7));};AGIVertices[_0x546d('0x12')]['sestektts']=function(_0x3bdbe1){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x92'),_0x3bdbe1[_0x546d('0x36')]));if(!this['isConfigured'](_0x3bdbe1[_0x546d('0x59')])){return this[_0x546d('0x34')][_0x546d('0x88')](_0x546d('0x93'));}var _0x4ce5d6='\x22'+_0x3bdbe1[_0x546d('0x59')]+'\x22';if(this['isConfigured'](_0x3bdbe1[_0x546d('0x8e')])){_0x4ce5d6+=','+_0x3bdbe1['options'];}var _0x1bcc5d=this[_0x546d('0x34')][_0x546d('0x55')]('MRCPSynth',_0x4ce5d6);if(_0x1bcc5d[_0x546d('0x7b')]===-0x1){return _0x1bcc5d;}return this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x4ce5d6));};AGIVertices[_0x546d('0x12')][_0x546d('0x94')]=function(_0x13142f){logger[_0x546d('0x2c')](util['format'](_0x546d('0x95'),_0x13142f[_0x546d('0x36')]));if(!this['isConfigured'](_0x13142f[_0x546d('0x96')])){return this[_0x546d('0x34')][_0x546d('0x88')](_0x546d('0x97'));}var _0x21da4a=_0x13142f[_0x546d('0x96')];if(this[_0x546d('0x61')](_0x13142f[_0x546d('0x8e')])){_0x21da4a+=','+_0x13142f[_0x546d('0x8e')];}var _0x12d0b7=this[_0x546d('0x34')][_0x546d('0x55')](_0x546d('0x98'),_0x21da4a);if(_0x12d0b7[_0x546d('0x7b')]===-0x1){return _0x12d0b7;}var _0x1a47f4=this[_0x546d('0x7a')](_0x546d('0x99'),_0x546d('0x9a'));if(_0x1a47f4[_0x546d('0x7b')]===-0x1){return _0x1a47f4;}var _0x289d9e=this[_0x546d('0x7a')](_0x546d('0x9b'),_0x546d('0x9c'));if(_0x289d9e['result']===-0x1){return _0x289d9e;}var _0x5186d1=this[_0x546d('0x7a')](_0x546d('0x9d'),_0x546d('0x9e'));if(_0x5186d1[_0x546d('0x7b')]===-0x1){return _0x5186d1;}return this[_0x546d('0x34')]['noop'](util[_0x546d('0x27')](_0x546d('0x9f'),_0x21da4a));};AGIVertices[_0x546d('0x12')][_0x546d('0xa0')]=function(_0x2c48ef){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0xa1'),_0x2c48ef[_0x546d('0x36')]));if(!this['isConfigured'](_0x2c48ef[_0x546d('0x96')])){return this[_0x546d('0x34')][_0x546d('0x88')](_0x546d('0x97'));}var _0x2c478b=_0x2c48ef[_0x546d('0x96')];if(this[_0x546d('0x61')](_0x2c48ef[_0x546d('0x8e')])){_0x2c478b+=','+_0x2c48ef[_0x546d('0x8e')];}var _0xecad05=this['channel'][_0x546d('0x55')](_0x546d('0x98'),_0x2c478b);if(_0xecad05[_0x546d('0x7b')]===-0x1){return _0xecad05;}var _0x19d3de=this['getAndSetVariable'](_0x546d('0x99'),_0x546d('0xa2'));if(_0x19d3de[_0x546d('0x7b')]===-0x1){return _0x19d3de;}var _0x1fac21=this[_0x546d('0x7a')](_0x546d('0x9b'),_0x546d('0xa3'));if(_0x1fac21[_0x546d('0x7b')]===-0x1){return _0x1fac21;}var _0x18281b=this[_0x546d('0x7a')](_0x546d('0x9d'),_0x546d('0xa4'));if(_0x18281b[_0x546d('0x7b')]===-0x1){return _0x18281b;}return this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')](_0x546d('0x9f'),_0x2c478b));};AGIVertices[_0x546d('0x12')]['database']=function(_0x3191a0){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0xa5'),_0x3191a0[_0x546d('0x36')]));if(!this['isConfigured'](_0x3191a0[_0x546d('0xa6')])){return this[_0x546d('0x34')][_0x546d('0x2a')](_0x3191a0,_0x546d('0xa7'));}var _0x397e43=this[_0x546d('0x1a')][_0x546d('0x7f')](this,_0x3191a0[_0x546d('0xa6')]);if(!_0x397e43){return this[_0x546d('0x34')][_0x546d('0x2a')](_0x3191a0,_0x546d('0xa8'));}if(!this[_0x546d('0x61')](_0x3191a0[_0x546d('0x2d')])){return this[_0x546d('0x34')]['error'](_0x3191a0,_0x546d('0xa9'));}var _0x3271bf=_0x3191a0['query'][_0x546d('0x56')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x546d('0x88')](util[_0x546d('0x27')](_0x546d('0xaa'),_0x3271bf));var _0x256f46=this[_0x546d('0x28')]['sync'](this,_0x397e43,_0x3271bf);this['createSquareDetailsReport'][_0x546d('0x7f')](this,_0x3191a0,_0x3271bf);if(!this[_0x546d('0x61')](_0x3191a0[_0x546d('0xab')])){return this[_0x546d('0x34')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3551b5=this[_0x546d('0x78')][_0x546d('0x7f')](this,_0x3191a0['variable_id']);if(!_0x3551b5){return this['channel'][_0x546d('0x2a')](_0x3191a0,_0x546d('0xac'));}var _0x49fe58=this;_0x256f46[_0x546d('0xad')](function(_0x28c28b,_0x33b30a){Object[_0x546d('0xae')](_0x28c28b)['forEach'](function(_0x4a86f1){_0x49fe58[_0x546d('0x34')][_0x546d('0xaf')](util[_0x546d('0x27')](_0x546d('0xb0'),_0x3551b5,_0x33b30a,_0x4a86f1),_0x28c28b[_0x4a86f1]);});});this[_0x546d('0x34')]['setVariable'](util[_0x546d('0x27')](_0x546d('0xb1'),_0x3551b5),_0x256f46[_0x546d('0x75')]);return this['channel'][_0x546d('0x88')](util['format'](_0x546d('0xb2'),_0x3551b5));};AGIVertices['prototype'][_0x546d('0xb3')]=function(_0x308fbc){logger[_0x546d('0xb4')](util[_0x546d('0x27')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x308fbc['label']));if(!this[_0x546d('0x61')](_0x308fbc[_0x546d('0xb5')])){return this[_0x546d('0x34')][_0x546d('0x2a')](_0x308fbc,_0x546d('0xb6'));}var _0x4dce91=this[_0x546d('0xb7')][_0x546d('0x7f')](this,_0x308fbc[_0x546d('0xb5')]);if(!_0x4dce91){return this[_0x546d('0x34')]['error'](_0x308fbc,'no\x20user\x20found');}var _0x3f10e8=this[_0x546d('0x34')][_0x546d('0x55')]('DIAL',[util[_0x546d('0x27')](_0x546d('0xb8'),_0x4dce91),_0x308fbc[_0x546d('0x83')],_0x308fbc[_0x546d('0xb9')],_0x308fbc['url']]);if(_0x3f10e8[_0x546d('0x7b')]===-0x1){return _0x3f10e8;}return this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')](_0x546d('0xba'),'DIAL'));};AGIVertices[_0x546d('0x12')]['dialogflow']=function(_0xae66e7){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0xbb'),_0xae66e7[_0x546d('0x36')]));if(!this['isConfigured'](_0xae66e7['key'])){return this[_0x546d('0x34')][_0x546d('0x88')]('no\x20key\x20configured');}if(!this[_0x546d('0x61')](_0xae66e7[_0x546d('0x59')])){return this[_0x546d('0x34')][_0x546d('0x88')](_0x546d('0x93'));}this[_0x546d('0x34')]['bot']=!![];this[_0x546d('0x7e')](_0xae66e7);this['createSquareMessage'](_0xae66e7[_0x546d('0x59')],'in');this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')]('Trying\x20Dialogflow:\x20%s',_0xae66e7[_0x546d('0x59')]));var _0xf75467=this['googleDialogflow']['sync'](this,_0xae66e7);if(_0xf75467){for(var _0xdf60cf in _0xf75467){if(_0xf75467[_0x546d('0xbc')](_0xdf60cf)){this[_0x546d('0x34')][_0x546d('0xaf')](util['format']('DIALOGFLOW_%s',_0xdf60cf[_0x546d('0xbd')]()),_0xf75467[_0xdf60cf]);}}this[_0x546d('0x40')](_0xf75467[_0x546d('0xbe')],_0x546d('0xbf'));return this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')](_0x546d('0xc0'),_0xf75467[_0x546d('0xbe')]));}return this[_0x546d('0x34')]['error'](_0xae66e7,_0x546d('0xc1'));};AGIVertices[_0x546d('0x12')][_0x546d('0xc2')]=function(_0x2f95ad){logger['info'](util[_0x546d('0x27')](_0x546d('0xc3'),_0x2f95ad[_0x546d('0x36')]));if(!this[_0x546d('0x61')](_0x2f95ad[_0x546d('0xc4')])){return this['channel'][_0x546d('0x88')](_0x546d('0xc5'));}if(!this[_0x546d('0x61')](_0x2f95ad[_0x546d('0xc6')])){return this[_0x546d('0x34')][_0x546d('0x88')](_0x546d('0xc7'));}if(!this['isConfigured'](_0x2f95ad[_0x546d('0xc8')])){return this[_0x546d('0x34')][_0x546d('0x88')]('no\x20password\x20configured');}if(!this[_0x546d('0x61')](_0x2f95ad['ndassistant_url'])){return this['channel']['noop'](_0x546d('0x93'));}this['channel']['bot']=!![];this[_0x546d('0x7e')](_0x2f95ad);this[_0x546d('0x40')](_0x2f95ad[_0x546d('0x59')],'in');this[_0x546d('0x34')]['noop'](util['format'](_0x546d('0xc9'),_0x2f95ad[_0x546d('0x59')]));var _0x38378a=this['sestekNDA'][_0x546d('0x7f')](this,_0x2f95ad);if(_0x38378a){for(var _0x3d80f5 in _0x38378a){if(_0x38378a[_0x546d('0xbc')](_0x3d80f5)){this['channel']['setVariable'](util[_0x546d('0x27')]('SESTEK_NDA_%s',_0x3d80f5[_0x546d('0xbd')]()),_0x38378a[_0x3d80f5]);}}this['createSquareMessage'](_0x38378a[_0x546d('0xbe')],'out');if(_0x38378a[_0x546d('0xca')]){this['channel']['noop'](util[_0x546d('0x27')](_0x546d('0xcb'),_0x38378a[_0x546d('0xca')]));var _0x5a3d96=this[_0x546d('0x34')][_0x546d('0xcc')](_0x38378a[_0x546d('0xca')]);try{fs[_0x546d('0xcd')](_0x38378a[_0x546d('0xca')]+'.wav');}catch(_0x2c0b7a){logger[_0x546d('0x2a')](_0x2c0b7a);}return _0x5a3d96;}else{return this[_0x546d('0x34')]['noop'](util[_0x546d('0x27')](_0x546d('0xce'),_0x38378a[_0x546d('0xbe')]));}}return this[_0x546d('0x34')]['error'](_0x2f95ad,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x546d('0x12')][_0x546d('0xcf')]=function(_0x163ba5){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0xd0'),_0x163ba5[_0x546d('0x36')]));return this[_0x546d('0x34')][_0x546d('0x88')]('end');};AGIVertices[_0x546d('0x12')]['ext_dial']=function(_0x3964a8){logger[_0x546d('0x2c')](util[_0x546d('0x27')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x3964a8[_0x546d('0x36')]));var _0x13b05a='';if(_0x3964a8[_0x546d('0xd1')]){if(!this[_0x546d('0x61')](_0x3964a8['trunk_id'])){return this['channel'][_0x546d('0x2a')](_0x3964a8,'no\x20trunk\x20selected');}else{var _0x508bb0=parseInt(_0x3964a8['trunk_id'],0xa);if(isNaN(_0x508bb0)){_0x13b05a=_0x3964a8[_0x546d('0xd1')];}else{_0x13b05a=this[_0x546d('0x1b')][_0x546d('0x7f')](this,_0x3964a8[_0x546d('0xd1')]);if(!_0x13b05a){return this[_0x546d('0x34')][_0x546d('0x2a')](_0x3964a8,_0x546d('0xd2'));}}}}else if(_0x3964a8[_0x546d('0xd3')]){_0x13b05a=_0x3964a8['trunk_name'];}else{return this['channel'][_0x546d('0x2a')](_0x3964a8,_0x546d('0xd4'));}var _0x56ada5=this[_0x546d('0x34')][_0x546d('0x55')]('DIAL',[util[_0x546d('0x27')]('SIP/%s/%s',_0x13b05a,_0x3964a8['phone']),_0x3964a8[_0x546d('0x83')],_0x3964a8[_0x546d('0xb9')],_0x3964a8['url']]);if(_0x56ada5['result']===-0x1){return _0x56ada5;}return this[_0x546d('0x34')][_0x546d('0x88')](util['format'](_0x546d('0xba'),'DIAL'));};AGIVertices[_0x546d('0x12')][_0x546d('0xd5')]=function(_0x74156){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0xd6'),_0x74156['label']));return this['channel'][_0x546d('0x88')]('finally');};AGIVertices[_0x546d('0x12')][_0x546d('0xe')]=function(_0x1b99fc){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0xd7'),_0x1b99fc[_0x546d('0x36')]));if(_0x1b99fc['retry']===0x0){return this['maxRetry'](_0x1b99fc);}_0x1b99fc[_0x546d('0x80')]-=0x1;if(!this[_0x546d('0x61')](_0x1b99fc[_0x546d('0xd8')])){return this[_0x546d('0x34')][_0x546d('0x2a')](_0x1b99fc,'no\x20file\x20audio\x20selected');}var _0x57f0e7=this['getSound']['sync'](this,_0x1b99fc[_0x546d('0xd8')]);if(!_0x57f0e7){return this['channel'][_0x546d('0x2a')](_0x1b99fc,'no\x20file\x20audio\x20found');}if(!this[_0x546d('0x61')](_0x1b99fc[_0x546d('0xab')])){return this['channel'][_0x546d('0x2a')](_0x546d('0xd9'));}var _0x2fbfb0=this[_0x546d('0x34')]['getData'](_0x57f0e7,_0x1b99fc[_0x546d('0xda')],_0x1b99fc[_0x546d('0xdb')]);var _0xb388cb=_0x2fbfb0[_0x546d('0x7b')]?_0x2fbfb0['result'][_0x546d('0xdc')]():'';logger[_0x546d('0x2c')](_0x546d('0xdd'),JSON['stringify'](_0x2fbfb0));if(_0x2fbfb0[_0x546d('0x7b')]===-0x1){this[_0x546d('0x7e')][_0x546d('0x7f')](this,_0x1b99fc,_0xb388cb);return _0x2fbfb0;}else if(_0x2fbfb0['extra']==='timeout'){_0x2fbfb0[_0x546d('0x7b')]=_0xb388cb[_0x546d('0x75')]>=parseInt(_0x1b99fc[_0x546d('0xde')])?'x':'i';}else{_0x2fbfb0['result']=_0xb388cb[_0x546d('0x75')]>=parseInt(_0x1b99fc[_0x546d('0xde')])&&_0xb388cb['length']<=parseInt(_0x1b99fc[_0x546d('0xdb')])?'x':'i';}var _0x5d9c48=this[_0x546d('0x78')][_0x546d('0x7f')](this,_0x1b99fc['variable_id']);if(!_0x5d9c48){return this[_0x546d('0x34')]['error'](_0x1b99fc,_0x546d('0xac'));}this['channel'][_0x546d('0xaf')](_0x5d9c48,_0xb388cb);if(this['isConfigured'](_0x1b99fc[_0x546d('0xdf')])){var _0x1e1a84=parseInt(_0x1b99fc[_0x546d('0xdf')],0xa);var _0x175725=rs[_0x546d('0xe0')]({'charset':'*','length':_0x1e1a84});var _0x5cab79=_0xb388cb[_0x546d('0x75')];if(_0x5cab79>0x0){if(_0x5cab79>_0x1e1a84){this[_0x546d('0x7e')][_0x546d('0x7f')](this,_0x1b99fc,_0x1b99fc[_0x546d('0xe1')]===_0x546d('0xe2')?_0x175725+_0xb388cb[_0x546d('0xe3')](_0x1e1a84):_0xb388cb[_0x546d('0xe3')](0x0,_0x5cab79-_0x1e1a84)+_0x175725);}else{this[_0x546d('0x7e')][_0x546d('0x7f')](this,_0x1b99fc,rs[_0x546d('0xe0')]({'charset':'*','length':_0x5cab79}));}}else{this[_0x546d('0x7e')][_0x546d('0x7f')](this,_0x1b99fc,'');}}else{this[_0x546d('0x7e')][_0x546d('0x7f')](this,_0x1b99fc,_0xb388cb);}return _0x2fbfb0;};AGIVertices['prototype'][_0x546d('0xf')]=function(_0x36dac7){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0xe4'),_0x36dac7[_0x546d('0x36')]));return this[_0x546d('0xe')](_0x36dac7);};AGIVertices[_0x546d('0x12')][_0x546d('0xe5')]=function(_0x182571){logger[_0x546d('0x2c')](util['format'](_0x546d('0xe6'),_0x182571['label']));this[_0x546d('0x7e')][_0x546d('0x7f')](this,_0x182571,_0x182571[_0x546d('0xe7')]);return this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')](_0x546d('0xe8'),_0x182571[_0x546d('0xe7')]));};AGIVertices[_0x546d('0x12')]['awspolly']=function(_0x2cda14){logger[_0x546d('0x2c')](util['format']('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x2cda14[_0x546d('0x36')]));if(!this[_0x546d('0x61')](_0x2cda14[_0x546d('0x64')])||!this[_0x546d('0x61')](_0x2cda14['aws_secret_access_key'])){return this[_0x546d('0x34')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x546d('0x61')](_0x2cda14[_0x546d('0x59')])){return this[_0x546d('0x34')][_0x546d('0x88')](_0x546d('0x93'));}this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')]('Trying\x20aws\x20Polly\x20%s',_0x2cda14[_0x546d('0x59')]));var _0x36a64b=this[_0x546d('0x63')][_0x546d('0x7f')](this,_0x2cda14);if(_0x36a64b){this[_0x546d('0x34')]['noop'](util[_0x546d('0x27')](_0x546d('0xe9'),_0x36a64b));var _0x1a5a73=this[_0x546d('0x34')][_0x546d('0xcc')](_0x36a64b);try{fs['unlink'](_0x36a64b+_0x546d('0xea'));}catch(_0x418d5d){logger['error'](_0x418d5d);}return _0x1a5a73;}return this[_0x546d('0x34')][_0x546d('0x2a')](_0x2cda14,_0x546d('0xeb'));};AGIVertices[_0x546d('0x12')][_0x546d('0xec')]=function(_0x1aeb34){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0xed'),_0x1aeb34[_0x546d('0x36')]));if(!this['isConfigured'](_0x1aeb34[_0x546d('0x64')])||!this['isConfigured'](_0x1aeb34[_0x546d('0x65')])){return this['channel']['noop'](_0x546d('0xee'));}if(!this['isConfigured'](_0x1aeb34[_0x546d('0x69')])){return this[_0x546d('0x34')]['noop'](_0x546d('0xef'));}if(!this[_0x546d('0x61')](_0x1aeb34[_0x546d('0x59')])){return this[_0x546d('0x34')][_0x546d('0x88')](_0x546d('0x93'));}this[_0x546d('0x34')][_0x546d('0xf0')]=!![];this['createSquareDetailsReport'](_0x1aeb34);this['createSquareMessage'](_0x1aeb34[_0x546d('0x59')],'in');this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')](_0x546d('0xf1'),_0x1aeb34[_0x546d('0x59')]));var _0x429dc9=this[_0x546d('0xf2')][_0x546d('0x7f')](this,_0x1aeb34);if(_0x429dc9){for(var _0x42829a in _0x429dc9){if(_0x429dc9[_0x546d('0xbc')](_0x42829a)&&_[_0x546d('0x73')](_0x429dc9[_0x42829a])){this[_0x546d('0x34')][_0x546d('0xaf')](util[_0x546d('0x27')](_0x546d('0xf3'),_0x42829a['toUpperCase']()),_0x429dc9[_0x42829a]);}}if(_[_0x546d('0x43')](_0x429dc9[_0x546d('0xf4')])){return this[_0x546d('0x34')][_0x546d('0x88')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x546d('0x40')](_0x429dc9[_0x546d('0xf4')],'out');return this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')]('Amazon\x20Lex\x20Result\x20%s',_0x429dc9['message']));}}return this[_0x546d('0x34')][_0x546d('0x2a')](_0x1aeb34,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x546d('0x12')][_0x546d('0xf5')]=function(_0x5bbc41){logger[_0x546d('0x2c')](util['format'](_0x546d('0xf6'),_0x5bbc41[_0x546d('0x36')],_0x5bbc41['timeout']));if(!this[_0x546d('0x61')](_0x5bbc41['key'])){return this[_0x546d('0x34')][_0x546d('0x88')](_0x546d('0xf7'));}var _0x3755b2=_0x546d('0xf8');var _0x560f11=util[_0x546d('0x27')](_0x546d('0xf9'),FILES_PATH,rs[_0x546d('0xe0')](0x4));var _0x1c2894=util[_0x546d('0x27')](_0x546d('0xfa'),_0x560f11,_0x3755b2);var _0x28a659=!![];if(_0x5bbc41['beep']===_0x546d('0xfb')){_0x28a659=![];}var _0x34c3f6=this[_0x546d('0x34')][_0x546d('0xfc')](_0x560f11,_0x3755b2,_0x5bbc41[_0x546d('0xfd')],_0x5bbc41[_0x546d('0x83')],undefined,_0x28a659);if(_0x34c3f6['result']!==-0x1){this['channel'][_0x546d('0x88')](util[_0x546d('0x27')](_0x546d('0xfe'),_0x1c2894));var _0x1900ca=this['googleASR'][_0x546d('0x7f')](this,_0x5bbc41,_0x1c2894);if(_0x1900ca){for(var _0x212dc7 in _0x1900ca){if(_0x1900ca[_0x546d('0xbc')](_0x212dc7)){this[_0x546d('0x34')][_0x546d('0xaf')](util[_0x546d('0x27')](_0x546d('0xff'),_0x212dc7[_0x546d('0xbd')]()),_0x1900ca[_0x212dc7]);}}return this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')]('GoogleASR\x20Result\x20%s',JSON[_0x546d('0x100')](_0x1900ca)));}}return _0x34c3f6;};AGIVertices[_0x546d('0x12')]['tildeasr']=function(_0x4e4c72){logger[_0x546d('0x2c')](util[_0x546d('0x27')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x4e4c72['label']));if(!this[_0x546d('0x61')](_0x4e4c72[_0x546d('0x6c')])){return this[_0x546d('0x34')][_0x546d('0x88')](_0x546d('0x101'));}if(!this[_0x546d('0x61')](_0x4e4c72[_0x546d('0x6d')])){return this['channel']['noop'](_0x546d('0x102'));}var _0x184c67=_0x546d('0xf8');var _0x2507db=util['format'](_0x546d('0xf9'),FILES_PATH,rs[_0x546d('0xe0')](0x4));var _0x31fb45=util[_0x546d('0x27')](_0x546d('0xfa'),_0x2507db,_0x184c67);var _0x297a7f=!![];if(_0x4e4c72[_0x546d('0x103')]==='NOBEEP'){_0x297a7f=![];}var _0xd47cb7=this[_0x546d('0x34')][_0x546d('0xfc')](_0x2507db,_0x184c67,_0x4e4c72[_0x546d('0xfd')],_0x4e4c72[_0x546d('0x83')],undefined,_0x297a7f);if(_0xd47cb7[_0x546d('0x7b')]!==-0x1){this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')](_0x546d('0x104'),_0x31fb45));var _0x103e4e=this[_0x546d('0x6b')][_0x546d('0x7f')](this,_0x4e4c72,_0x31fb45);if(_0x103e4e){for(var _0x2ec46b in _0x103e4e){if(_0x103e4e[_0x546d('0xbc')](_0x2ec46b)){this[_0x546d('0x34')][_0x546d('0xaf')](util['format'](_0x546d('0x105'),_0x2ec46b[_0x546d('0xbd')]()),_0x103e4e[_0x2ec46b]);}}return this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')](_0x546d('0x106'),JSON['stringify'](_0x103e4e)));}}return _0xd47cb7;};AGIVertices[_0x546d('0x12')][_0x546d('0x107')]=function(_0x11a2e7){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x108'),_0x11a2e7[_0x546d('0x36')]));return this[_0x546d('0x34')][_0x546d('0x109')](_0x11a2e7[_0x546d('0x3a')],_0x11a2e7[_0x546d('0x3b')],_0x11a2e7[_0x546d('0x3c')]);};AGIVertices['prototype']['gotoif']=function(_0x3e640c){logger[_0x546d('0x2c')](util[_0x546d('0x27')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x3e640c['label']));if(!this[_0x546d('0x61')](_0x3e640c[_0x546d('0x10a')])){return this[_0x546d('0x34')]['error'](_0x3e640c,'no\x20condition\x20configured');}try{var _0x18d4d6=eval(_0x3e640c[_0x546d('0x10a')])?'true':_0x546d('0x10b');this[_0x546d('0x34')][_0x546d('0x88')](util['format'](_0x546d('0x10c'),_0x3e640c['condition'],_0x18d4d6));return{'code':0xc8,'result':_0x18d4d6};}catch(_0x97143){return{'code':0xc8,'result':_0x546d('0x10b')};}};AGIVertices[_0x546d('0x12')][_0x546d('0x10d')]=function(_0x47a102){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x10e'),_0x47a102['label']));if(!this[_0x546d('0x61')](_0x47a102[_0x546d('0x10f')])){return this['channel'][_0x546d('0x2a')](_0x47a102,'no\x20interval\x20configured');}var _0x4e7f87=this[_0x546d('0x22')][_0x546d('0x7f')](this,_0x47a102['interval_id']);if(!_0x4e7f87){return this['channel']['error'](_0x47a102,_0x546d('0x110'));}for(var _0x189bab=0x0;_0x189bab<_0x4e7f87['length'];_0x189bab+=0x1){var _0x23ea1e=this['channel'][_0x546d('0x78')](util[_0x546d('0x27')](_0x546d('0x111'),_0x4e7f87[_0x189bab]));if(_0x23ea1e[_0x546d('0x7b')]===-0x1){return _0x23ea1e;}logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x112'),_0x4e7f87[_0x189bab],_0x23ea1e[_0x546d('0x79')]));if(_0x23ea1e[_0x546d('0x79')]==='true'){logger[_0x546d('0x2c')](util['format']('IFTIME\x20%s\x20%s',_0x4e7f87[_0x189bab],_0x546d('0x113')));this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')]('IFTIME\x20%s\x20%s',_0x4e7f87[_0x189bab],_0x546d('0x113')));return{'code':0xc8,'result':_0x546d('0x113')};}else{logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x112'),_0x4e7f87[_0x189bab],_0x546d('0x10b')));this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')](_0x546d('0x112'),_0x4e7f87[_0x189bab],_0x546d('0x10b')));}}return{'code':0xc8,'result':_0x546d('0x10b')};};AGIVertices['prototype']['hangup']=function(_0x4b8410){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x114'),_0x4b8410[_0x546d('0x36')]));return this[_0x546d('0x34')][_0x546d('0x115')]();};AGIVertices[_0x546d('0x12')]['ispeechasr']=function(_0x3efc8f){logger[_0x546d('0x2c')](util[_0x546d('0x27')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x3efc8f[_0x546d('0x36')]));if(!this['isConfigured'](_0x3efc8f[_0x546d('0x5c')])){return this[_0x546d('0x34')][_0x546d('0x88')]('no\x20key\x20configured');}var _0x1cf63d=_0x546d('0xf8');var _0x4dd847=util[_0x546d('0x27')](_0x546d('0xf9'),FILES_PATH,rs[_0x546d('0xe0')](0x4));var _0x1e64e9=util[_0x546d('0x27')](_0x546d('0xfa'),_0x4dd847,_0x1cf63d);var _0x15b770=!![];if(_0x3efc8f[_0x546d('0x103')]===_0x546d('0xfb')){_0x15b770=![];}var _0x18681e=this['channel']['recordFile'](_0x4dd847,_0x1cf63d,_0x3efc8f[_0x546d('0xfd')],_0x3efc8f[_0x546d('0x83')],undefined,_0x15b770);if(_0x18681e[_0x546d('0x7b')]!==-0x1){this['channel'][_0x546d('0x88')](util[_0x546d('0x27')]('ispeech\x20%s\x20file\x20created',_0x1e64e9));var _0x5ec302=this[_0x546d('0x5f')]['sync'](this,_0x3efc8f,_0x1e64e9);if(_0x5ec302){for(var _0x5cddbf in _0x5ec302){if(_0x5ec302['hasOwnProperty'](_0x5cddbf)){this['channel'][_0x546d('0xaf')](util['format'](_0x546d('0x116'),_0x5cddbf[_0x546d('0xbd')]()),_0x5ec302[_0x5cddbf]);}}return this[_0x546d('0x34')]['noop'](util[_0x546d('0x27')]('IspeechASR\x20Result\x20%s',JSON[_0x546d('0x100')](_0x5ec302)));}}return _0x18681e;};AGIVertices[_0x546d('0x12')][_0x546d('0x117')]=function(_0x3969af){logger[_0x546d('0x2c')](util['format'](_0x546d('0x118'),_0x3969af[_0x546d('0x36')]));if(!this[_0x546d('0x61')](_0x3969af[_0x546d('0x5c')])){return this[_0x546d('0x34')][_0x546d('0x88')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x3969af[_0x546d('0x59')])){return this[_0x546d('0x34')][_0x546d('0x88')](_0x546d('0x93'));}this[_0x546d('0x34')]['noop'](util['format'](_0x546d('0x119'),_0x3969af['text']));var _0x1cc135=this['ispeechTTS'][_0x546d('0x7f')](this,_0x3969af);if(_0x1cc135){this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')](_0x546d('0x11a'),_0x1cc135));var _0x4610f1=this['channel'][_0x546d('0xcc')](_0x1cc135,_0x3969af[_0x546d('0xfd')]);try{fs[_0x546d('0xcd')](_0x1cc135+_0x546d('0xea'));}catch(_0x4e5050){logger[_0x546d('0x2a')](_0x4e5050);}return _0x4610f1;}return this[_0x546d('0x34')][_0x546d('0x2a')](_0x3969af,_0x546d('0x11b'));};AGIVertices[_0x546d('0x12')][_0x546d('0x11c')]=function(_0x3f9d99){logger['info'](util[_0x546d('0x27')](_0x546d('0x11d'),_0x3f9d99[_0x546d('0x36')]));if(!this['isConfigured'](_0x3f9d99['findBy'])){return this[_0x546d('0x34')][_0x546d('0x2a')](_0x3f9d99,'no\x20find\x20by\x20configured');}logger['info'](util[_0x546d('0x27')](_0x546d('0x11e'),this['channel'][_0x546d('0x37')],_0x3f9d99[_0x546d('0x11f')]));var _0x15cf26=this['agentLogin'][_0x546d('0x7f')](this,_0x3f9d99[_0x546d('0x11f')]);if(_0x15cf26){logger[_0x546d('0x2c')](util[_0x546d('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x546d('0x37')],_0x3f9d99[_0x546d('0x11f')]));this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x546d('0x34')][_0x546d('0x37')],_0x3f9d99[_0x546d('0x11f')]));return{'code':0xc8,'result':_0x546d('0x120')};}else{logger[_0x546d('0x2c')](util[_0x546d('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x546d('0x34')]['callerid'],_0x3f9d99[_0x546d('0x11f')]));this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')](_0x546d('0x121'),this[_0x546d('0x34')]['callerid'],_0x3f9d99[_0x546d('0x11f')]));return{'code':0xc8,'result':_0x546d('0x122')};}};AGIVertices['prototype'][_0x546d('0x123')]=function(_0x4af509){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x124'),_0x4af509[_0x546d('0x36')]));if(!this['isConfigured'](_0x4af509[_0x546d('0x11f')])){return this[_0x546d('0x34')]['error'](_0x4af509,_0x546d('0x125'));}logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x11e'),this[_0x546d('0x34')][_0x546d('0x37')],_0x4af509[_0x546d('0x11f')]));var _0x357ae5=this['agentLogout']['sync'](this,_0x4af509[_0x546d('0x11f')]);if(_0x357ae5){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x126'),this[_0x546d('0x34')][_0x546d('0x37')],_0x4af509[_0x546d('0x11f')]));this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')](_0x546d('0x126'),this[_0x546d('0x34')][_0x546d('0x37')],_0x4af509[_0x546d('0x11f')]));return{'code':0xc8,'result':'success'};}else{logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x121'),this[_0x546d('0x34')]['callerid'],_0x4af509['findBy']));this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')](_0x546d('0x121'),this[_0x546d('0x34')][_0x546d('0x37')],_0x4af509[_0x546d('0x11f')]));return{'code':0xc8,'result':_0x546d('0x122')};}};AGIVertices[_0x546d('0x12')]['math']=function(_0x25e5e6){logger['info'](util[_0x546d('0x27')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x25e5e6['label']));if(!this[_0x546d('0x61')](_0x25e5e6[_0x546d('0x127')])){return this['channel']['error'](_0x25e5e6,_0x546d('0x128'));}this[_0x546d('0x34')][_0x546d('0x88')](util['format']('math\x20%s',_0x25e5e6[_0x546d('0x127')]));var _0x6f657b=eval(_0x25e5e6[_0x546d('0x127')]);if(!this['isConfigured'](_0x25e5e6[_0x546d('0xab')])){return this['channel'][_0x546d('0x88')](_0x546d('0xd9'));}var _0x313961=this[_0x546d('0x78')]['sync'](this,_0x25e5e6[_0x546d('0xab')]);if(!_0x313961){return this[_0x546d('0x34')][_0x546d('0x2a')](_0x25e5e6,'no\x20variable\x20found');}if(_[_0x546d('0x129')](_0x6f657b)){var _0x5005a7=this;_0x6f657b[_0x546d('0xad')](function(_0xdaeb49,_0x139997){_0x5005a7[_0x546d('0x34')][_0x546d('0xaf')](util[_0x546d('0x27')](_0x546d('0x12a'),_0x313961,_0x139997),_0xdaeb49);});return this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')]('variable\x20%s[key]\x20set',_0x313961));}else{return this[_0x546d('0x34')][_0x546d('0xaf')](_0x313961,_0x6f657b);}};AGIVertices[_0x546d('0x12')][_0x546d('0xd')]=function(_0x1bf4ad){logger[_0x546d('0x2c')](util['format'](_0x546d('0x12b'),_0x1bf4ad[_0x546d('0x36')]));if(_0x1bf4ad['retry']===0x0){return this[_0x546d('0x7d')](_0x1bf4ad);}_0x1bf4ad[_0x546d('0x80')]-=0x1;if(!this[_0x546d('0x61')](_0x1bf4ad[_0x546d('0xd8')])){return this[_0x546d('0x34')][_0x546d('0x2a')](_0x1bf4ad,'no\x20file\x20audio\x20selected');}var _0x1a6aae=this[_0x546d('0x1d')][_0x546d('0x7f')](this,_0x1bf4ad[_0x546d('0xd8')]);if(!_0x1a6aae){return this[_0x546d('0x34')][_0x546d('0x2a')](_0x1bf4ad,_0x546d('0x12c'));}var _0x2e1722=this[_0x546d('0x34')][_0x546d('0x12d')](_0x1a6aae,_0x1bf4ad['response'],_0x1bf4ad[_0x546d('0x12e')]);var _0x260391=_0x2e1722[_0x546d('0x7b')];if(_0x2e1722[_0x546d('0x7b')]===-0x1){this[_0x546d('0x7e')][_0x546d('0x7f')](this,_0x1bf4ad,'-1');return _0x2e1722;}else if(_0x2e1722['extra']===_0x546d('0x83')){_0x2e1722[_0x546d('0x7b')]=_0x2e1722[_0x546d('0x7b')][_0x546d('0x75')]>0x0?_0x2e1722[_0x546d('0x7b')]:'t';}else if(_[_0x546d('0x42')](_0x2e1722[_0x546d('0x7b')])){_0x2e1722[_0x546d('0x7b')]='#';_0x260391='#';}if(!this[_0x546d('0x61')](_0x1bf4ad['variable_id'])){this[_0x546d('0x34')][_0x546d('0x88')](_0x546d('0xd9'));}else{var _0x491c8c=this[_0x546d('0x78')]['sync'](this,_0x1bf4ad['variable_id']);if(!_0x491c8c){return this[_0x546d('0x34')]['error'](_0x1bf4ad,'no\x20variable\x20found');}this[_0x546d('0x34')][_0x546d('0xaf')](_0x491c8c,_0x260391);}this[_0x546d('0x7e')][_0x546d('0x7f')](this,_0x1bf4ad,_0x260391);return _0x2e1722;};AGIVertices[_0x546d('0x12')]['noop']=function(_0x15bc6b){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x12f'),_0x15bc6b[_0x546d('0x36')]));return this[_0x546d('0x34')][_0x546d('0x88')](_0x15bc6b[_0x546d('0x130')]||_0x15bc6b[_0x546d('0x36')]);};AGIVertices[_0x546d('0x12')]['pause']=function(_0xef96f9){logger[_0x546d('0x2c')](util[_0x546d('0x27')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0xef96f9['label']));if(!this[_0x546d('0x61')](_0xef96f9['findBy'])){return this[_0x546d('0x34')][_0x546d('0x2a')](_0xef96f9,_0x546d('0x125'));}logger[_0x546d('0x2c')](util['format'](_0x546d('0x11e'),this[_0x546d('0x34')]['callerid'],_0xef96f9['findBy']));var _0x4a157d=this[_0x546d('0x4b')][_0x546d('0x7f')](this,_0xef96f9[_0x546d('0x131')]);var _0x1e8ee3=this[_0x546d('0x4e')][_0x546d('0x7f')](this,_0xef96f9[_0x546d('0x11f')],_0x4a157d);if(_0x1e8ee3){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x546d('0x34')]['callerid'],_0xef96f9[_0x546d('0x11f')]));this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')](_0x546d('0x126'),this[_0x546d('0x34')][_0x546d('0x37')],_0xef96f9[_0x546d('0x11f')]));return{'code':0xc8,'result':_0x546d('0x120')};}else{logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x121'),this[_0x546d('0x34')][_0x546d('0x37')],_0xef96f9[_0x546d('0x11f')]));this['channel'][_0x546d('0x88')](util[_0x546d('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x546d('0x34')][_0x546d('0x37')],_0xef96f9[_0x546d('0x11f')]));return{'code':0xc8,'result':_0x546d('0x122')};}};AGIVertices['prototype'][_0x546d('0x132')]=function(_0xafb5f6){logger[_0x546d('0x2c')](util[_0x546d('0x27')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0xafb5f6[_0x546d('0x36')]));if(!this[_0x546d('0x61')](_0xafb5f6[_0x546d('0xd8')])){return this['channel']['error'](_0xafb5f6,_0x546d('0x133'));}var _0x2ff5ac=this['getSound'][_0x546d('0x7f')](this,_0xafb5f6[_0x546d('0xd8')]);if(!_0x2ff5ac){return this[_0x546d('0x34')][_0x546d('0x2a')](_0xafb5f6,_0x546d('0x12c'));}var _0x114378=this[_0x546d('0x34')][_0x546d('0x55')](_0x546d('0x134'),[_0x2ff5ac,_0xafb5f6[_0x546d('0xb9')]]);if(_0x114378['result']===-0x1){return _0x114378;}return this[_0x546d('0x34')][_0x546d('0x88')](util['format'](_0x546d('0x8f'),_0x546d('0x134'),_0x2ff5ac));};AGIVertices[_0x546d('0x12')]['queue']=function(_0xa8770a){logger['info'](util[_0x546d('0x27')](_0x546d('0x135'),_0xa8770a[_0x546d('0x36')]));if(!this['isConfigured'](_0xa8770a['queue_id'])){return this[_0x546d('0x34')][_0x546d('0x2a')](_0xa8770a,_0x546d('0x136'));}var _0x10b853='';var _0x3f8372=parseInt(_0xa8770a['queue_id'],0xa);if(isNaN(_0x3f8372)){_0x10b853=_0xa8770a['queue_id'];}else{_0x10b853=this[_0x546d('0x16')][_0x546d('0x7f')](this,_0xa8770a[_0x546d('0x137')]);if(!_0x10b853){return this['channel'][_0x546d('0x2a')](_0xa8770a,'no\x20queue\x20found');}}var _0x16c9da='';if(this[_0x546d('0x61')](_0xa8770a[_0x546d('0xd8')])){var _0x536da5=this['getSound'][_0x546d('0x7f')](this,_0xa8770a[_0x546d('0xd8')]);if(_0x536da5){_0x16c9da=_0x536da5;}}this[_0x546d('0x7e')][_0x546d('0x7f')](this,_0xa8770a,_0x10b853);if(_0xa8770a[_0x546d('0xb9')][_0x546d('0x138')]('x')<0x0){_0xa8770a[_0x546d('0xb9')]+='x';}if(_0xa8770a[_0x546d('0xb9')][_0x546d('0x138')]('X')<0x0){_0xa8770a[_0x546d('0xb9')]+='X';}this[_0x546d('0x34')][_0x546d('0xaf')](_0x546d('0x139'),_0x10b853?_0x10b853[_0x546d('0x13a')]():'');var _0x1616a4=this['channel'][_0x546d('0x55')](_0x546d('0x13b'),[_0x10b853,_0xa8770a[_0x546d('0xb9')],_0xa8770a['url'],_0x16c9da,_0xa8770a[_0x546d('0x83')],_0xa8770a[_0x546d('0x9')],_0xa8770a[_0x546d('0x13c')],_0xa8770a[_0x546d('0x13d')],'',_0xa8770a[_0x546d('0x13e')]]);if(_0x1616a4[_0x546d('0x7b')]===-0x1){return _0x1616a4;}return this['channel'][_0x546d('0x88')](util['format'](_0x546d('0x8f'),_0x546d('0x13b'),_0x10b853));};AGIVertices['prototype']['record']=function(_0x1c4608){logger[_0x546d('0x2c')](util['format'](_0x546d('0x13f'),_0x1c4608['label']));var _0x47a1ae=_0x1c4608[_0x546d('0x140')]||_0x546d('0xf8');var _0x19cc3f=util['format'](_0x546d('0x141'),this[_0x546d('0x34')][_0x546d('0x35')],rs['generate'](0x5));var _0x1abceb=util[_0x546d('0x27')](_0x546d('0x142'),FILES_PATH,_0x19cc3f,_0x47a1ae);var _0x48942b=util[_0x546d('0x27')](_0x546d('0xf9'),FILES_PATH,_0x19cc3f);this[_0x546d('0x38')][_0x546d('0x7f')](this,_0x1c4608,_0x19cc3f,_0x1abceb);this[_0x546d('0x34')]['setVariable']('RECORDING_SAVENAME',_0x19cc3f);logger['info'](_0x546d('0x143'),_0x48942b,_0x47a1ae,_0x1c4608['escape_digits'],_0x1c4608[_0x546d('0x83')]);return this[_0x546d('0x34')][_0x546d('0xfc')](_0x48942b,_0x47a1ae,_0x1c4608[_0x546d('0x144')],_0x1c4608['timeout'],undefined,!![]);};AGIVertices[_0x546d('0x12')][_0x546d('0x145')]=function(_0x30746a){logger[_0x546d('0x2c')](util['format'](_0x546d('0x146'),_0x30746a[_0x546d('0x36')]));return this[_0x546d('0x34')][_0x546d('0x147')](_0x30746a['digits'][_0x546d('0x56')](/\s+/g,''),_0x30746a[_0x546d('0x144')]);};AGIVertices[_0x546d('0x12')]['saynumber']=function(_0x491505){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x148'),_0x491505[_0x546d('0x36')]));return this['channel']['sayNumber'](_0x491505[_0x546d('0x149')][_0x546d('0x56')](/\s+/g,''),_0x491505[_0x546d('0x144')]);};AGIVertices[_0x546d('0x12')][_0x546d('0x14a')]=function(_0x1d26c1){logger['info'](util[_0x546d('0x27')](_0x546d('0x14b'),_0x1d26c1[_0x546d('0x36')]));return this[_0x546d('0x34')]['sayPhonetic'](_0x1d26c1[_0x546d('0x59')],_0x1d26c1['escape_digits']);};AGIVertices[_0x546d('0x12')][_0x546d('0x14c')]=function(_0x396979){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x14d'),_0x396979[_0x546d('0x36')]));if(!this[_0x546d('0x61')](_0x396979[_0x546d('0x14e')])){return this['channel']['noop'](_0x546d('0x14f'));}var _0x3af114=this[_0x546d('0x150')][_0x546d('0x7f')](this,_0x396979['account_id']);if(!_0x3af114||!_0x3af114['Smtp']){return this[_0x546d('0x34')]['error'](_0x396979,_0x546d('0x151'));}var _0x4c07a7={'from':util['format'](_0x546d('0x152'),_0x3af114['name'],_0x3af114[_0x546d('0x153')]||_0x3af114[_0x546d('0x154')][_0x546d('0x155')]),'to':_0x396979['to']||'','cc':_0x396979['cc']||'','bcc':_0x396979[_0x546d('0x156')]||'','subject':_0x396979[_0x546d('0x157')],'html':_0x396979['text'],'text':_0x396979[_0x546d('0x59')]};var _0x4d06d1={'tls':{'rejectUnauthorized':![]}};if(_0x3af114[_0x546d('0x154')][_0x546d('0x158')]){_0x4d06d1[_0x546d('0x158')]=_0x3af114[_0x546d('0x154')][_0x546d('0x158')];}else{_0x4d06d1[_0x546d('0x159')]=_0x3af114[_0x546d('0x154')]['host'];_0x4d06d1[_0x546d('0x15a')]=_0x3af114[_0x546d('0x154')][_0x546d('0x15a')];_0x4d06d1[_0x546d('0x15b')]=_0x3af114[_0x546d('0x154')][_0x546d('0x15b')];}if(_0x3af114[_0x546d('0x154')][_0x546d('0x15c')]){_0x4d06d1[_0x546d('0x15d')]={'user':_0x3af114[_0x546d('0x154')][_0x546d('0x155')],'pass':_0x3af114[_0x546d('0x154')][_0x546d('0x15e')]};}if(this['isConfigured'](_0x396979[_0x546d('0x15f')])){}logger[_0x546d('0xb4')]('sendMail\x20message',JSON[_0x546d('0x100')](_0x4c07a7));this[_0x546d('0x7e')]['sync'](this,_0x396979,_0x396979[_0x546d('0x14e')]);this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x3af114[_0x546d('0x14')]));this['sendMailMessage']['sync'](this,_0x4d06d1,_0x4c07a7);return this['channel'][_0x546d('0x88')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x546d('0x12')][_0x546d('0x160')]=function(_0x5d3ce2){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x161'),_0x5d3ce2[_0x546d('0x36')]));return this[_0x546d('0x34')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x546d('0x12')][_0x546d('0x162')]=function(_0x4a42a1){logger[_0x546d('0x2c')](util[_0x546d('0x27')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x4a42a1['label']));if(!this[_0x546d('0x61')](_0x4a42a1['sms_account_id'])){return this['channel'][_0x546d('0x88')](_0x546d('0x163'));}var _0x76d581=this[_0x546d('0x31')][_0x546d('0x7f')](this,_0x4a42a1[_0x546d('0x164')]);if(!_0x76d581){return this[_0x546d('0x34')][_0x546d('0x2a')](_0x4a42a1,_0x546d('0x165'));}var _0x48a94c={'body':_0x4a42a1[_0x546d('0x166')],'phone':_0x4a42a1['to']||'','SmsAccountId':_0x76d581['id']};logger[_0x546d('0xb4')](_0x546d('0x167'),JSON['stringify'](_0x48a94c));this[_0x546d('0x7e')]['sync'](this,_0x4a42a1,_0x4a42a1[_0x546d('0x164')]);this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')](_0x546d('0x168'),_0x76d581[_0x546d('0x14')]));this[_0x546d('0x33')]['sync'](this,_0x48a94c);return this[_0x546d('0x34')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x546d('0x12')]['set']=function(_0x10068e){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x169'),_0x10068e[_0x546d('0x36')]));if(!this[_0x546d('0x61')](_0x10068e[_0x546d('0xab')])){return this[_0x546d('0x34')][_0x546d('0x2a')](_0x10068e,_0x546d('0x16a'));}var _0x2fc2dc=this[_0x546d('0x78')][_0x546d('0x7f')](this,_0x10068e[_0x546d('0xab')]);if(!_0x2fc2dc){return this[_0x546d('0x34')][_0x546d('0x2a')](_0x10068e,_0x546d('0xac'));}return this[_0x546d('0x34')][_0x546d('0xaf')](_0x2fc2dc,_0x10068e[_0x546d('0x16b')]);};AGIVertices[_0x546d('0x12')][_0x546d('0x16c')]=function(_0x5eff80){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x16d'),_0x5eff80[_0x546d('0x36')]));this['channel']['noop']('START\x20CALLY\x20SQUARE');if(_0x5eff80['answer']==='yes'){this['channel'][_0x546d('0x88')]('Answer');return this[_0x546d('0x34')][_0x546d('0x81')]();}return this[_0x546d('0x34')][_0x546d('0x88')](_0x546d('0x16e'));};AGIVertices[_0x546d('0x12')][_0x546d('0x16f')]=function(_0x4265b3){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x170'),_0x4265b3[_0x546d('0x36')]));if(!this['isConfigured'](_0x4265b3[_0x546d('0x171')])){return this['channel']['error'](_0x4265b3,_0x546d('0x172'));}var _0x3f0eee=this[_0x546d('0x18')]['sync'](this,_0x4265b3[_0x546d('0x171')]);if(!this['isConfigured'](_0x3f0eee)){return this[_0x546d('0x34')]['error'](_0x4265b3,util[_0x546d('0x27')](_0x546d('0x173'),_0x4265b3[_0x546d('0x171')]));}if(_0x3f0eee===this[_0x546d('0x34')][_0x546d('0x174')]){return this[_0x546d('0x34')][_0x546d('0x2a')](_0x4265b3,_0x546d('0x175'));}this[_0x546d('0x7e')][_0x546d('0x7f')](this,_0x4265b3,_0x3f0eee);var _0x4656d3=this[_0x546d('0x34')][_0x546d('0x55')](_0x546d('0x176'),util[_0x546d('0x27')](_0x546d('0x177'),config[_0x546d('0x9')]['host']||'127.0.0.1',_0x3f0eee,this[_0x546d('0x34')][_0x546d('0x174')]));if(_0x4656d3[_0x546d('0x7b')]===-0x1){return _0x4656d3;}return this[_0x546d('0x34')]['noop'](util[_0x546d('0x27')](_0x546d('0x8f'),_0x546d('0x176'),_0x3f0eee));};AGIVertices[_0x546d('0x12')][_0x546d('0x178')]=function(_0x323580){logger['info'](util[_0x546d('0x27')](_0x546d('0x179'),_0x323580[_0x546d('0x36')]));var _0x1520c6=this['shellCommand'][_0x546d('0x7f')](this,_0x323580[_0x546d('0x17a')]);this[_0x546d('0x7e')][_0x546d('0x7f')](this,_0x323580,_0x323580[_0x546d('0x17a')]);if(this[_0x546d('0x61')](_0x323580['variable_id'])){var _0x1bb775=this[_0x546d('0x78')][_0x546d('0x7f')](this,_0x323580[_0x546d('0xab')]);if(_0x1bb775){this[_0x546d('0x34')][_0x546d('0xaf')](_0x1bb775,_0x1520c6);return this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')](_0x546d('0x17b'),_0x323580[_0x546d('0x17a')],_0x1bb775));}}return this[_0x546d('0x34')][_0x546d('0x88')](util['format'](_0x546d('0x17c'),_0x323580[_0x546d('0x17a')]));};AGIVertices[_0x546d('0x12')][_0x546d('0x17d')]=function(_0x3b430a){logger['info'](util[_0x546d('0x27')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x3b430a['label']));if(!this['isConfigured'](_0x3b430a['text'])){return this[_0x546d('0x34')][_0x546d('0x88')]('no\x20text\x20configured');}this[_0x546d('0x34')][_0x546d('0x88')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x3b430a[_0x546d('0x59')]));var _0x6dde51=this[_0x546d('0x57')][_0x546d('0x7f')](this,_0x3b430a);if(_0x6dde51){this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')]('Google\x20TTS\x20%s\x20file\x20created',_0x6dde51));var _0x464195=this[_0x546d('0x34')][_0x546d('0xcc')](_0x6dde51);try{fs[_0x546d('0xcd')](_0x6dde51+_0x546d('0xea'));}catch(_0x1069f3){logger[_0x546d('0x2a')](_0x1069f3);}return _0x464195;}return this['channel'][_0x546d('0x2a')](_0x3b430a,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x546d('0x12')]['unpause']=function(_0x2bcb7c){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x17e'),_0x2bcb7c['label']));if(!this[_0x546d('0x61')](_0x2bcb7c['findBy'])){return this[_0x546d('0x34')]['error'](_0x2bcb7c,_0x546d('0x125'));}logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x11e'),this[_0x546d('0x34')][_0x546d('0x37')],_0x2bcb7c[_0x546d('0x11f')]));var _0x4a0ed2=this[_0x546d('0x4f')][_0x546d('0x7f')](this,_0x2bcb7c[_0x546d('0x11f')]);if(_0x4a0ed2){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x126'),this[_0x546d('0x34')][_0x546d('0x37')],_0x2bcb7c[_0x546d('0x11f')]));this[_0x546d('0x34')][_0x546d('0x88')](util[_0x546d('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x546d('0x34')][_0x546d('0x37')],_0x2bcb7c[_0x546d('0x11f')]));return{'code':0xc8,'result':_0x546d('0x120')};}else{logger['info'](util['format'](_0x546d('0x121'),this['channel'][_0x546d('0x37')],_0x2bcb7c['findBy']));this['channel'][_0x546d('0x88')](util[_0x546d('0x27')](_0x546d('0x121'),this[_0x546d('0x34')][_0x546d('0x37')],_0x2bcb7c[_0x546d('0x11f')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x546d('0x12')][_0x546d('0x17f')]=function(_0x1d99ad){logger['info'](util[_0x546d('0x27')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x1d99ad[_0x546d('0x36')]));var _0x917151=this[_0x546d('0x34')][_0x546d('0x55')]('VOICEMAIL',[_0x1d99ad[_0x546d('0x180')],_0x1d99ad[_0x546d('0x8e')]]);if(_0x917151[_0x546d('0x7b')]===-0x1){return _0x917151;}return this[_0x546d('0x34')]['noop'](util[_0x546d('0x27')]('Executed\x20command\x20%s\x20%s',_0x546d('0x181'),_0x1d99ad[_0x546d('0x180')]));};AGIVertices[_0x546d('0x12')][_0x546d('0x182')]=function(_0x255c14){logger[_0x546d('0x2c')](util[_0x546d('0x27')](_0x546d('0x183'),_0x255c14[_0x546d('0x36')]));if(!this[_0x546d('0x61')](_0x255c14[_0x546d('0xab')])){return this['channel']['error'](_0x255c14,_0x546d('0x16a'));}var _0x931566=this[_0x546d('0x78')][_0x546d('0x7f')](this,_0x255c14[_0x546d('0xab')]);if(!_0x931566){return this[_0x546d('0x34')]['error'](_0x255c14,_0x546d('0xac'));}var _0x58c2ef=this[_0x546d('0x34')]['getVariable'](_0x931566);return{'code':0xc8,'result':_0x58c2ef[_0x546d('0x79')]?_0x58c2ef[_0x546d('0x79')]:'-'};};String[_0x546d('0x12')][_0x546d('0x77')]=function(_0x54ea3b,_0x1b063e){return this[_0x546d('0x76')](_0x54ea3b)[_0x546d('0x184')](_0x1b063e);};module['exports']=AGIVertices; \ No newline at end of file +var _0x3f0e=['Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','out','speech','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','url','Enter\x20in\x20FINALLY\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','stringify','mindigit','maxdigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','isString','message','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','%s.%s','NOBEEP','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','priority','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','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','beep','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','success','failure','operation','no\x20operation\x20configured','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','getData','Enter\x20in\x20NOOP\x20(%s)\x20block','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','saydigits','sayDigits','sayNumber','number','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','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','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','lodash','shelljs','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','./scripts','menu','getdigits','channel','mailRpc','prototype','getVariable','rpc','getVariableById','then','getVoiceQueue','getVoiceQueueById','name','getSquareProject','getSquareProjectById','catch','getSquareOdbcById','dsn','getUser','getUserById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','accountcode','file','createSquareMessage','createCmContact','isNil','random','isEmpty','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','callback_priority','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleTTS','googleDialogflow','key','text','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','isConfigured','model','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','includes','hasOwnProperty','replaceAllVariables','length','split','replaceAll','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','sync','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','label','Wait\x20%s\x20seconds\x20before\x20answer','wait','timeout','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','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','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','MRCPRecog','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','getSquareOdbc','odbc_id','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','setVariable','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts'];(function(_0x47c0f6,_0x490402){var _0x3273b2=function(_0x47d014){while(--_0x47d014){_0x47c0f6['push'](_0x47c0f6['shift']());}};_0x3273b2(++_0x490402);}(_0x3f0e,0xc9));var _0xe3f0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3f0e[_0x14add3];return _0x4a174f;};'use strict';var fs=require('fs');var path=require(_0xe3f0('0x0'));var util=require(_0xe3f0('0x1'));var _=require(_0xe3f0('0x2'));var sh=require(_0xe3f0('0x3'));var odbc=require('odbc')();var rs=require(_0xe3f0('0x4'));var moment=require(_0xe3f0('0x5'));var Mustache=require(_0xe3f0('0x6'));var logger=require(_0xe3f0('0x7'))(_0xe3f0('0x8'));var config=require(_0xe3f0('0x9'));var scripts=require(_0xe3f0('0xa'));var FILES_PATH='/var/opt/motion2/server/files';var verticesWithRetry=[_0xe3f0('0xb'),_0xe3f0('0xc'),'getsecretdigits'];var AGIVertices=function(_0x340950,_0x5741d4,_0x458cb3){this[_0xe3f0('0xd')]=_0x340950;this['rpc']=_0x5741d4;this[_0xe3f0('0xe')]=_0x458cb3;};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x10')]=function(_0x21e5e0,_0x27460){this[_0xe3f0('0x11')][_0xe3f0('0x12')](_0x21e5e0)[_0xe3f0('0x13')](function(_0x22596c){_0x27460(null,_0x22596c?_0x22596c['name']:![]);})['catch'](function(_0x36b243){_0x27460(_0x36b243);});};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x14')]=function(_0x3b2cd4,_0x490e79){this[_0xe3f0('0x11')][_0xe3f0('0x15')](_0x3b2cd4)['then'](function(_0x226e84){_0x490e79(null,_0x226e84?_0x226e84[_0xe3f0('0x16')]:![]);})['catch'](function(_0x3d5935){_0x490e79(_0x3d5935);});};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x17')]=function(_0x7f30c2,_0x242e2c){this['rpc'][_0xe3f0('0x18')](_0x7f30c2)[_0xe3f0('0x13')](function(_0x3e8862){_0x242e2c(null,_0x3e8862?_0x3e8862[_0xe3f0('0x16')]:![]);})[_0xe3f0('0x19')](function(_0x5bcc07){_0x242e2c(_0x5bcc07);});};AGIVertices[_0xe3f0('0xf')]['getSquareOdbc']=function(_0x15e107,_0x122781){this['rpc'][_0xe3f0('0x1a')](_0x15e107)[_0xe3f0('0x13')](function(_0x35a46f){_0x122781(null,_0x35a46f?_0x35a46f[_0xe3f0('0x1b')]:![]);})[_0xe3f0('0x19')](function(_0x3ed026){_0x122781(_0x3ed026);});};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x1c')]=function(_0xcbbea9,_0x4dd5bf){this['rpc'][_0xe3f0('0x1d')](_0xcbbea9)['then'](function(_0x5e1625){_0x4dd5bf(null,_0x5e1625?_0x5e1625[_0xe3f0('0x16')]:![]);})[_0xe3f0('0x19')](function(_0x4b1ccf){_0x4dd5bf(_0x4b1ccf);});};AGIVertices[_0xe3f0('0xf')]['getTrunk']=function(_0x30af1c,_0x501eaa){this[_0xe3f0('0x11')]['getTrunkById'](_0x30af1c)[_0xe3f0('0x13')](function(_0x3b6c52){_0x501eaa(null,_0x3b6c52?_0x3b6c52[_0xe3f0('0x16')]:![]);})[_0xe3f0('0x19')](function(_0x40580f){_0x501eaa(_0x40580f);});};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x1e')]=function(_0x2e4acf,_0x290e46){var _0x22bc21=this;this[_0xe3f0('0x11')][_0xe3f0('0x1f')](_0x2e4acf)['then'](function(_0x2c30ce){_0x290e46(null,_0x2c30ce?_0x22bc21[_0xe3f0('0x20')](_0x2c30ce[_0xe3f0('0x21')]):![]);})[_0xe3f0('0x19')](function(_0x11d3b9){_0x290e46(_0x11d3b9);});};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x22')]=function(_0x3c3725,_0x2ff176){this[_0xe3f0('0x11')][_0xe3f0('0x23')](_0x3c3725)[_0xe3f0('0x13')](function(_0x3179a5){_0x2ff176(null,_0x3179a5?_0x3179a5:![]);})[_0xe3f0('0x19')](function(_0x18a84d){_0x2ff176(_0x18a84d);});};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x24')]=function(_0x29ee21,_0x588f84,_0x344d95){this[_0xe3f0('0xe')][_0xe3f0('0x24')](_0x29ee21,_0x588f84)['then'](function(){_0x344d95(null);})[_0xe3f0('0x19')](function(_0x51c804){_0x344d95(_0x51c804);});};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x25')]=function(_0x4ab2e2,_0x3b0cc4){this[_0xe3f0('0x11')][_0xe3f0('0x26')](_0x4ab2e2)[_0xe3f0('0x13')](function(_0x3f8693){if(_0x3f8693){if(_0x3f8693[_0xe3f0('0x27')]){_0x3b0cc4(null,[_0x3f8693[_0xe3f0('0x28')]]);}else{_0x3b0cc4(null,_[_0xe3f0('0x29')](_0x3f8693[_0xe3f0('0x2a')],_0xe3f0('0x28')));}}else{_0x3b0cc4(null,![]);}})['catch'](function(_0x3cfbc3){_0x3b0cc4(_0x3cfbc3);});};AGIVertices[_0xe3f0('0xf')]['getSoundPath']=function(_0x74ae86){return util[_0xe3f0('0x2b')](_0xe3f0('0x2c'),FILES_PATH,_0x74ae86);};AGIVertices['prototype'][_0xe3f0('0x2d')]=function(_0x4b467e,_0x5d31ac,_0x1cee9a){odbc['open'](_0x4b467e,function(_0x2a2888){if(_0x2a2888){logger[_0xe3f0('0x2e')](_0xe3f0('0x2f'),_0x2a2888);_0x1cee9a(_0x2a2888);}else{logger[_0xe3f0('0x30')](_0xe3f0('0x31'));odbc[_0xe3f0('0x32')](_0x5d31ac,function(_0x14876f,_0x2f72d1){if(_0x14876f){logger[_0xe3f0('0x30')](_0xe3f0('0x33'),_0x5d31ac);_0x1cee9a(_0x14876f);}else{logger['info'](_0xe3f0('0x34'),_0x5d31ac);odbc[_0xe3f0('0x35')](function(_0x50f8d0){if(_0x50f8d0){logger[_0xe3f0('0x2e')](_0xe3f0('0x36'),_0x50f8d0);}_0x1cee9a(null,_0x2f72d1);});}});}});};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x37')]=function(_0x10ffee,_0x53ed69){this[_0xe3f0('0x11')][_0xe3f0('0x38')](_0x10ffee)[_0xe3f0('0x13')](function(_0x4baa04){_0x53ed69(null,_0x4baa04?_0x4baa04:![]);})[_0xe3f0('0x19')](function(_0x4104cd){_0x53ed69(_0x4104cd);});};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x39')]=function(_0x4cd64c,_0x53df28){this['rpc']['createSmsMessage'](_0x4cd64c)[_0xe3f0('0x13')](function(_0x2e73a7){_0x53df28(null,_0x2e73a7);})[_0xe3f0('0x19')](function(_0x959053){_0x53df28(_0x959053);});};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x3a')]=function(_0x3cb4df,_0x1dace0,_0x14346a){this[_0xe3f0('0x11')][_0xe3f0('0x3a')]({'uniqueid':this[_0xe3f0('0xd')][_0xe3f0('0x3b')],'node':_0x3cb4df['label'],'application':_0x3cb4df[_0xe3f0('0x3c')],'data':_0x1dace0||null,'project_name':this[_0xe3f0('0xd')][_0xe3f0('0x3d')],'callerid':this[_0xe3f0('0xd')][_0xe3f0('0x3e')]})[_0xe3f0('0x13')](function(_0x118c2f){if(_0x14346a){_0x14346a(null,_0x118c2f);}})[_0xe3f0('0x19')](function(_0xfa5b4d){if(_0x14346a){_0x14346a(_0xfa5b4d);}});};AGIVertices['prototype'][_0xe3f0('0x3f')]=function(_0xc0f469,_0x4d8fa6,_0x21e790,_0x5cbdcf){this['rpc'][_0xe3f0('0x3f')]({'uniqueid':this[_0xe3f0('0xd')]['uniqueid'],'callerid':this['channel'][_0xe3f0('0x3e')],'calleridname':this[_0xe3f0('0xd')][_0xe3f0('0x40')],'context':this[_0xe3f0('0xd')]['context'],'extension':this[_0xe3f0('0xd')][_0xe3f0('0x41')],'priority':this['channel']['priority'],'accountcode':this[_0xe3f0('0xd')][_0xe3f0('0x42')],'dnid':this[_0xe3f0('0xd')]['dnid'],'projectName':this['channel'][_0xe3f0('0x3d')],'saveName':_0x4d8fa6,'filename':_0xc0f469[_0xe3f0('0x43')]||_0x4d8fa6,'savePath':_0x21e790})['then'](function(_0x399ba9){_0x5cbdcf(null,_0x399ba9);})[_0xe3f0('0x19')](function(_0x243d96){_0x5cbdcf(_0x243d96);});};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x44')]=function(_0x304f53,_0x55ad60,_0x283e5c){this[_0xe3f0('0x11')][_0xe3f0('0x44')]({'uniqueid':this[_0xe3f0('0xd')][_0xe3f0('0x3b')],'body':_0x304f53,'direction':_0x55ad60})['then'](function(_0x27586e){if(_0x283e5c){_0x283e5c(null,_0x27586e);}})[_0xe3f0('0x19')](function(_0x5b9231){if(_0x283e5c){_0x283e5c(_0x5b9231);}});};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x45')]=function(_0x272d49,_0x27f3ed){this[_0xe3f0('0x11')][_0xe3f0('0x45')]({'firstName':_['isEmpty'](_0x272d49[_0xe3f0('0x16')])||_[_0xe3f0('0x46')](_0x272d49['name'])?'callback_'+Math[_0xe3f0('0x47')]():_0x272d49[_0xe3f0('0x16')],'lastName':_[_0xe3f0('0x48')](_0x272d49[_0xe3f0('0x49')])||_[_0xe3f0('0x46')](_0x272d49[_0xe3f0('0x49')])?null:_0x272d49[_0xe3f0('0x49')],'phone':_0x272d49[_0xe3f0('0x4a')],'ListId':_0x272d49[_0xe3f0('0x4b')],'scheduledAt':_0x272d49[_0xe3f0('0x4c')],'callbackUniqueid':this[_0xe3f0('0xd')]['uniqueid'],'tags':_0xe3f0('0x4d'),'description':_0xe3f0('0x4e')+_0x272d49[_0xe3f0('0x4c')]['toString'](),'priority':_0x272d49[_0xe3f0('0x4f')]})[_0xe3f0('0x13')](function(_0x4d4f94){_0x27f3ed(null,_0x4d4f94);})[_0xe3f0('0x19')](function(_0x3d6c2a){_0x27f3ed(_0x3d6c2a);});};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x50')]=function(_0x3fe170,_0x44a017){this[_0xe3f0('0x11')][_0xe3f0('0x51')](_0x3fe170)['then'](function(_0x237137){_0x44a017(null,_0x237137?_0x237137[_0xe3f0('0x16')]:![]);})[_0xe3f0('0x19')](function(_0x230fbc){_0x44a017(_0x230fbc);});};AGIVertices[_0xe3f0('0xf')]['agentPause']=function(_0x18c8bb,_0x3aaf7b,_0x18b889){var _0x178017={'role':'agent'};_0x178017[_0x18c8bb]=this[_0xe3f0('0xd')][_0xe3f0('0x3e')];this[_0xe3f0('0x11')][_0xe3f0('0x52')](_0x178017,_0x3aaf7b,this[_0xe3f0('0xd')][_0xe3f0('0x3b')])[_0xe3f0('0x13')](function(_0x849db8){_0x18b889(null,_[_0xe3f0('0x46')](_0x849db8)?![]:!![]);})[_0xe3f0('0x19')](function(_0xba6565){logger[_0xe3f0('0x2e')](_0xba6565);_0x18b889(null,![]);});};AGIVertices['prototype'][_0xe3f0('0x53')]=function(_0x23bc29,_0x401b12){var _0x247ed6={'role':_0xe3f0('0x54')};_0x247ed6[_0x23bc29]=this[_0xe3f0('0xd')][_0xe3f0('0x3e')];this[_0xe3f0('0x11')]['agentUnpause'](_0x247ed6)['then'](function(_0x33a8f5){_0x401b12(null,_[_0xe3f0('0x46')](_0x33a8f5)?![]:!![]);})[_0xe3f0('0x19')](function(_0x16daaf){logger[_0xe3f0('0x2e')](_0x16daaf);_0x401b12(null,![]);});};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x55')]=function(_0x5bf5e2,_0x2ae92f){var _0x3ae52b={'role':'agent'};_0x3ae52b[_0x5bf5e2]=this[_0xe3f0('0xd')][_0xe3f0('0x3e')];this['rpc'][_0xe3f0('0x55')](_0x3ae52b)[_0xe3f0('0x13')](function(_0x5c0317){_0x2ae92f(null,_['isNil'](_0x5c0317)?![]:!![]);})[_0xe3f0('0x19')](function(_0x4420bd){logger[_0xe3f0('0x2e')](_0x4420bd);_0x2ae92f(null,![]);});};AGIVertices['prototype'][_0xe3f0('0x56')]=function(_0x49eae3,_0x4a626b){var _0x35e868={'role':'agent'};_0x35e868[_0x49eae3]=this[_0xe3f0('0xd')][_0xe3f0('0x3e')];var _0x210dc3=_0x49eae3!='internal'?util[_0xe3f0('0x2b')](_0xe3f0('0x57'),_0xe3f0('0x58'),this[_0xe3f0('0xd')][_0xe3f0('0x3e')]):undefined;this[_0xe3f0('0x11')]['agentLogin'](_0x35e868,_0x210dc3)[_0xe3f0('0x13')](function(_0x38f66d){_0x4a626b(null,_[_0xe3f0('0x46')](_0x38f66d)?![]:!![]);})[_0xe3f0('0x19')](function(_0x5ca25e){logger['error'](_0x5ca25e);_0x4a626b(null,![]);});};AGIVertices['prototype'][_0xe3f0('0x59')]=function(_0x15478e,_0x45c9c8){sh[_0xe3f0('0x5a')](_[_0xe3f0('0x5b')](_0x15478e),function(_0x597d51,_0x478a61){var _0x4471f8=_0x478a61[_0xe3f0('0x5c')](/(\r\n|\n|\r)/gm,'');_0x45c9c8(null,_0x4471f8);});};AGIVertices[_0xe3f0('0xf')]['googleTTS']=function(_0x43f142,_0x112e87){scripts[_0xe3f0('0x5d')](_0x43f142['text'],_0x43f142['google_tts_language']||'en',0x1)['then'](function(_0x4880bf){_0x112e87(null,_0x4880bf);})['catch'](function(_0x5e13eb){_0x112e87(_0x5e13eb);});};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x5e')]=function(_0x17cb2b,_0x550afe){scripts['googleDialogflow'](this[_0xe3f0('0xd')][_0xe3f0('0x3b')],_0x17cb2b[_0xe3f0('0x5f')],_0x17cb2b[_0xe3f0('0x60')],_0x17cb2b[_0xe3f0('0x61')]||'en')[_0xe3f0('0x13')](function(_0x2e428a){_0x550afe(null,_0x2e428a);})[_0xe3f0('0x19')](function(_0x561636){_0x550afe(_0x561636);});};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x62')]=function(_0x1d6ca2,_0x487d4b){scripts[_0xe3f0('0x62')](this['channel'],_0x1d6ca2)['then'](function(_0x5eb641){_0x487d4b(null,_0x5eb641);})[_0xe3f0('0x19')](function(_0x45702f){_0x487d4b(_0x45702f);});};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x63')]=function(_0x14d68c,_0x37d5c9){scripts[_0xe3f0('0x63')](_0x14d68c[_0xe3f0('0x5f')],_0x14d68c['text'],_0x14d68c[_0xe3f0('0x64')]||_0xe3f0('0x65'),_0x14d68c[_0xe3f0('0x66')])[_0xe3f0('0x13')](function(_0x41de37){_0x37d5c9(null,_0x41de37);})[_0xe3f0('0x19')](function(_0x21c0fd){_0x37d5c9(_0x21c0fd);});};AGIVertices[_0xe3f0('0xf')]['ispeechASR']=function(_0x35cc6e,_0x45e6f4,_0x1a3f2c){scripts[_0xe3f0('0x67')](_0x45e6f4,_0x35cc6e['key'],_0x35cc6e['ispeech_asr_language']||_0xe3f0('0x65'),this[_0xe3f0('0x68')](_0x35cc6e['model'])?_0x35cc6e[_0xe3f0('0x69')]:undefined)[_0xe3f0('0x13')](function(_0x2bb05a){_0x1a3f2c(null,_0x2bb05a);})[_0xe3f0('0x19')](function(_0x1963fe){_0x1a3f2c(_0x1963fe);});};AGIVertices[_0xe3f0('0xf')]['awsPolly']=function(_0x4d5049,_0x1b2aac){scripts['awsPolly'](_0x4d5049['aws_access_key_id'],_0x4d5049[_0xe3f0('0x6a')],_0x4d5049[_0xe3f0('0x6b')],_0x4d5049[_0xe3f0('0x6c')]||_0xe3f0('0x6d'),_0x4d5049[_0xe3f0('0x60')],_0x4d5049[_0xe3f0('0x6e')]||_0xe3f0('0x60'))[_0xe3f0('0x13')](function(_0x40e6da){_0x1b2aac(null,_0x40e6da);})['catch'](function(_0x3e1298){_0x1b2aac(_0x3e1298);});};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x6f')]=function(_0x5adaf3,_0x477505){scripts[_0xe3f0('0x6f')](this[_0xe3f0('0xd')]['uniqueid'],_0x5adaf3[_0xe3f0('0x70')],_0x5adaf3['aws_secret_access_key'],_0x5adaf3[_0xe3f0('0x71')],_0x5adaf3['text'],_0x5adaf3[_0xe3f0('0x72')])[_0xe3f0('0x13')](function(_0x3b4d77){_0x477505(null,_0x3b4d77);})[_0xe3f0('0x19')](function(_0x50a341){_0x477505(_0x50a341);});};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x73')]=function(_0x3a970e,_0x5c6fe8,_0x1c2934){scripts[_0xe3f0('0x73')](_0x5c6fe8,_0x3a970e[_0xe3f0('0x5f')],_0x3a970e[_0xe3f0('0x74')]||'en-US')['then'](function(_0x25cffa){_0x1c2934(null,_0x25cffa);})[_0xe3f0('0x19')](function(_0x477593){_0x1c2934(_0x477593);});};AGIVertices['prototype']['tildeASR']=function(_0x4179b1,_0x333c06,_0x102591){scripts[_0xe3f0('0x75')](_0x333c06,_0x4179b1[_0xe3f0('0x76')],_0x4179b1[_0xe3f0('0x77')],_0x4179b1[_0xe3f0('0x78')])[_0xe3f0('0x13')](function(_0x106fc4){_0x102591(null,_0x106fc4);})[_0xe3f0('0x19')](function(_0x5dfeab){_0x102591(_0x5dfeab);});};AGIVertices['prototype'][_0xe3f0('0x79')]=function(_0x2713d4){var _0x5d1ed9=_[_0xe3f0('0x7a')](verticesWithRetry,_0x2713d4[_0xe3f0('0x3c')])?_0x2713d4:_['clone'](_0x2713d4);for(var _0xcada54 in _0x5d1ed9){if(_0x5d1ed9[_0xe3f0('0x7b')](_0xcada54)){if(_0x5d1ed9[_0xcada54]&&_['isString'](_0x5d1ed9[_0xcada54])){_0x5d1ed9[_0xcada54]=this[_0xe3f0('0x7c')](_0x5d1ed9[_0xcada54]);}}}return _0x5d1ed9;};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x7c')]=function(_0x21f939){var _0x34b59b=_0x21f939['split']('{');for(var _0x16caed=0x1;_0x16caed<_0x34b59b[_0xe3f0('0x7d')];_0x16caed+=0x1){var _0x372d35=_0x34b59b[_0x16caed][_0xe3f0('0x7e')]('}');if(_0x372d35[_0xe3f0('0x7d')]>0x1){_0x21f939=_0x21f939[_0xe3f0('0x7f')]('{'+_0x372d35[0x0]+'}',this[_0xe3f0('0xd')]['getVariable'](_0x372d35[0x0])['extra']||_0x372d35[0x0]);}}if(_0x34b59b[_0xe3f0('0x7d')]===0x1){return _0x21f939['toString']();}return this[_0xe3f0('0x7c')](_0x21f939);};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x80')]=function(_0x14e5c7,_0x588626){var _0x2c1c7d=this[_0xe3f0('0xd')]['getVariable'](_0x14e5c7);if(_0x2c1c7d[_0xe3f0('0x81')]===-0x1){return _0x2c1c7d;}logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0x82'),_0x588626,_0x2c1c7d[_0xe3f0('0x83')]));return this['channel']['setVariable'](_0x588626,_0x2c1c7d['extra']);};AGIVertices['prototype'][_0xe3f0('0x68')]=function(_0x100927){return _0x100927&&_0x100927!=='0'&&_0x100927!=='-1'&&_0x100927!=='';};AGIVertices['prototype'][_0xe3f0('0x84')]=function(_0x2d6376){this[_0xe3f0('0x3a')][_0xe3f0('0x85')](this,_0x2d6376,'-');_0x2d6376['retry']=_0x2d6376[_0xe3f0('0x84')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x8')]=function(_0x47038a){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x47038a['label']));return this[_0xe3f0('0xd')][_0xe3f0('0x8')]([_0x47038a[_0xe3f0('0x86')],_0x47038a[_0xe3f0('0x87')]]);};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x88')]=function(_0x2d27ea){logger[_0xe3f0('0x30')](util['format'](_0xe3f0('0x89'),_0x2d27ea[_0xe3f0('0x8a')]));if(this[_0xe3f0('0x68')](_0x2d27ea['timeout'])){logger['info'](util[_0xe3f0('0x2b')](_0xe3f0('0x8b'),_0x2d27ea['timeout']));var _0xd90c3=this[_0xe3f0('0xd')][_0xe3f0('0x8c')](_0x2d27ea[_0xe3f0('0x8d')]);if(_0xd90c3[_0xe3f0('0x81')]===-0x1){return _0xd90c3;}}return this[_0xe3f0('0xd')][_0xe3f0('0x88')]();};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x4d')]=function(_0x94b8d4){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0x8e'),_0x94b8d4['label']));if(!this[_0xe3f0('0x68')](_0x94b8d4[_0xe3f0('0x4b')])){return this[_0xe3f0('0xd')]['error'](_0x94b8d4,'no\x20list\x20selected');}_0x94b8d4[_0xe3f0('0x4c')]=moment();if(this[_0xe3f0('0x68')](_0x94b8d4[_0xe3f0('0x8f')])){_0x94b8d4['scheduledAt']=moment()[_0xe3f0('0x90')](_0x94b8d4[_0xe3f0('0x8f')],_0xe3f0('0x91'));}if(!this['isConfigured'](_0x94b8d4['callback_priority'])){_0x94b8d4['callback_priority']=0x2;}this[_0xe3f0('0x45')][_0xe3f0('0x85')](this,_0x94b8d4);return this['channel'][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0x93'),_0x94b8d4[_0xe3f0('0x4a')],_0x94b8d4[_0xe3f0('0x4b')],_0x94b8d4['scheduledAt']));};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x94')]=function(_0x21c365){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0x95'),_0x21c365[_0xe3f0('0x8a')]));var _0x99bacd=this['channel'][_0xe3f0('0x5a')](_0x21c365[_0xe3f0('0x96')],_0x21c365[_0xe3f0('0x97')]);if(_0x99bacd['result']===-0x1){return _0x99bacd;}return this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0x98'),_0x21c365['application'],_0x21c365[_0xe3f0('0x97')]));};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x99')]=function(_0x642380){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0x9a'),_0x642380[_0xe3f0('0x8a')]));if(!this['isConfigured'](_0x642380['text'])){return this['channel'][_0xe3f0('0x92')](_0xe3f0('0x9b'));}var _0x22c5b9='\x22'+_0x642380[_0xe3f0('0x60')]+'\x22';if(this[_0xe3f0('0x68')](_0x642380[_0xe3f0('0x97')])){_0x22c5b9+=','+_0x642380[_0xe3f0('0x97')];}var _0x45c76e=this[_0xe3f0('0xd')][_0xe3f0('0x5a')](_0xe3f0('0x9c'),_0x22c5b9);if(_0x45c76e['result']===-0x1){return _0x45c76e;}return this['channel'][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0x9d'),_0x22c5b9));};AGIVertices[_0xe3f0('0xf')]['sestektts']=function(_0x45da20){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0x9e'),_0x45da20['label']));if(!this[_0xe3f0('0x68')](_0x45da20[_0xe3f0('0x60')])){return this[_0xe3f0('0xd')][_0xe3f0('0x92')](_0xe3f0('0x9b'));}var _0x4919d1='\x22'+_0x45da20[_0xe3f0('0x60')]+'\x22';if(this['isConfigured'](_0x45da20[_0xe3f0('0x97')])){_0x4919d1+=','+_0x45da20[_0xe3f0('0x97')];}var _0x26c45b=this['channel'][_0xe3f0('0x5a')](_0xe3f0('0x9c'),_0x4919d1);if(_0x26c45b['result']===-0x1){return _0x26c45b;}return this[_0xe3f0('0xd')]['noop'](util[_0xe3f0('0x2b')]('Executed\x20command\x20MRCPSynth\x20%s',_0x4919d1));};AGIVertices[_0xe3f0('0xf')]['lumenvoxasr']=function(_0x4a3fd3){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0x9f'),_0x4a3fd3[_0xe3f0('0x8a')]));if(!this[_0xe3f0('0x68')](_0x4a3fd3[_0xe3f0('0xa0')])){return this[_0xe3f0('0xd')][_0xe3f0('0x92')](_0xe3f0('0xa1'));}var _0x4cb8a1=_0x4a3fd3[_0xe3f0('0xa0')];if(this['isConfigured'](_0x4a3fd3[_0xe3f0('0x97')])){_0x4cb8a1+=','+_0x4a3fd3[_0xe3f0('0x97')];}var _0x2f1e59=this[_0xe3f0('0xd')]['exec']('MRCPRecog',_0x4cb8a1);if(_0x2f1e59[_0xe3f0('0x81')]===-0x1){return _0x2f1e59;}var _0x3d5822=this[_0xe3f0('0x80')](_0xe3f0('0xa2'),_0xe3f0('0xa3'));if(_0x3d5822[_0xe3f0('0x81')]===-0x1){return _0x3d5822;}var _0x3da5d7=this[_0xe3f0('0x80')](_0xe3f0('0xa4'),_0xe3f0('0xa5'));if(_0x3da5d7['result']===-0x1){return _0x3da5d7;}var _0x528760=this[_0xe3f0('0x80')](_0xe3f0('0xa6'),_0xe3f0('0xa7'));if(_0x528760[_0xe3f0('0x81')]===-0x1){return _0x528760;}return this['channel'][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0xa8'),_0x4cb8a1));};AGIVertices['prototype']['sestekasr']=function(_0x7cd081){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0xa9'),_0x7cd081['label']));if(!this[_0xe3f0('0x68')](_0x7cd081['grammar'])){return this[_0xe3f0('0xd')][_0xe3f0('0x92')](_0xe3f0('0xa1'));}var _0x124c5f=_0x7cd081[_0xe3f0('0xa0')];if(this[_0xe3f0('0x68')](_0x7cd081[_0xe3f0('0x97')])){_0x124c5f+=','+_0x7cd081[_0xe3f0('0x97')];}var _0x2adb32=this[_0xe3f0('0xd')][_0xe3f0('0x5a')](_0xe3f0('0xaa'),_0x124c5f);if(_0x2adb32['result']===-0x1){return _0x2adb32;}var _0x5caa9e=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xe3f0('0xab'));if(_0x5caa9e[_0xe3f0('0x81')]===-0x1){return _0x5caa9e;}var _0x4e543c=this[_0xe3f0('0x80')](_0xe3f0('0xa4'),_0xe3f0('0xac'));if(_0x4e543c[_0xe3f0('0x81')]===-0x1){return _0x4e543c;}var _0x3ab83a=this['getAndSetVariable'](_0xe3f0('0xa6'),'SESTEK_ASR_INSTANCE');if(_0x3ab83a[_0xe3f0('0x81')]===-0x1){return _0x3ab83a;}return this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0xa8'),_0x124c5f));};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0xad')]=function(_0xb42cb6){logger[_0xe3f0('0x30')](util['format'](_0xe3f0('0xae'),_0xb42cb6['label']));if(!this[_0xe3f0('0x68')](_0xb42cb6['odbc_id'])){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0xb42cb6,'no\x20database\x20selected');}var _0x27d9d9=this[_0xe3f0('0xaf')][_0xe3f0('0x85')](this,_0xb42cb6[_0xe3f0('0xb0')]);if(!_0x27d9d9){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0xb42cb6,_0xe3f0('0xb1'));}if(!this[_0xe3f0('0x68')](_0xb42cb6['query'])){return this['channel'][_0xe3f0('0x2e')](_0xb42cb6,'no\x20query\x20configured');}var _0x5b1163=_0xb42cb6[_0xe3f0('0x32')][_0xe3f0('0x5c')](/(\r\n|\n|\r)/gm,'\x20');this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0xb2'),_0x5b1163));var _0x58fec2=this[_0xe3f0('0x2d')][_0xe3f0('0x85')](this,_0x27d9d9,_0x5b1163);this[_0xe3f0('0x3a')]['sync'](this,_0xb42cb6,_0x5b1163);if(!this[_0xe3f0('0x68')](_0xb42cb6[_0xe3f0('0xb3')])){return this[_0xe3f0('0xd')][_0xe3f0('0x92')](_0xe3f0('0xb4'));}var _0x54b85c=this[_0xe3f0('0x10')][_0xe3f0('0x85')](this,_0xb42cb6['variable_id']);if(!_0x54b85c){return this['channel']['error'](_0xb42cb6,_0xe3f0('0xb5'));}var _0x3669ac=this;_0x58fec2[_0xe3f0('0xb6')](function(_0x391285,_0x16d8c0){Object[_0xe3f0('0xb7')](_0x391285)['forEach'](function(_0x1f5dc){_0x3669ac[_0xe3f0('0xd')][_0xe3f0('0xb8')](util[_0xe3f0('0x2b')](_0xe3f0('0xb9'),_0x54b85c,_0x16d8c0,_0x1f5dc),_0x391285[_0x1f5dc]);});});this[_0xe3f0('0xd')][_0xe3f0('0xb8')](util[_0xe3f0('0x2b')](_0xe3f0('0xba'),_0x54b85c),_0x58fec2[_0xe3f0('0x7d')]);return this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')]('variable\x20%s\x20set',_0x54b85c));};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0xbb')]=function(_0x17984d){logger[_0xe3f0('0xbc')](util[_0xe3f0('0x2b')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x17984d[_0xe3f0('0x8a')]));if(!this[_0xe3f0('0x68')](_0x17984d[_0xe3f0('0xbd')])){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0x17984d,_0xe3f0('0xbe'));}var _0x3df13b=this[_0xe3f0('0x1c')]['sync'](this,_0x17984d[_0xe3f0('0xbd')]);if(!_0x3df13b){return this['channel'][_0xe3f0('0x2e')](_0x17984d,_0xe3f0('0xbf'));}var _0x1df458=this['channel'][_0xe3f0('0x5a')](_0xe3f0('0xc0'),[util['format'](_0xe3f0('0xc1'),_0x3df13b),_0x17984d[_0xe3f0('0x8d')],_0x17984d[_0xe3f0('0xc2')],_0x17984d['url']]);if(_0x1df458['result']===-0x1){return _0x1df458;}return this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0xc3'),_0xe3f0('0xc0')));};AGIVertices['prototype'][_0xe3f0('0xc4')]=function(_0x29cedf){logger['info'](util[_0xe3f0('0x2b')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x29cedf['label']));if(!this[_0xe3f0('0x68')](_0x29cedf[_0xe3f0('0x5f')])){return this[_0xe3f0('0xd')]['noop'](_0xe3f0('0xc5'));}if(!this['isConfigured'](_0x29cedf[_0xe3f0('0x60')])){return this['channel'][_0xe3f0('0x92')]('no\x20text\x20configured');}this[_0xe3f0('0xd')][_0xe3f0('0xc6')]=!![];this[_0xe3f0('0x3a')](_0x29cedf);this['createSquareMessage'](_0x29cedf[_0xe3f0('0x60')],'in');this['channel'][_0xe3f0('0x92')](util['format'](_0xe3f0('0xc7'),_0x29cedf[_0xe3f0('0x60')]));var _0x5b605a=this[_0xe3f0('0x5e')][_0xe3f0('0x85')](this,_0x29cedf);if(_0x5b605a){for(var _0x2bd90f in _0x5b605a){if(_0x5b605a['hasOwnProperty'](_0x2bd90f)){this[_0xe3f0('0xd')][_0xe3f0('0xb8')](util[_0xe3f0('0x2b')](_0xe3f0('0xc8'),_0x2bd90f[_0xe3f0('0xc9')]()),_0x5b605a[_0x2bd90f]);}}this[_0xe3f0('0x44')](_0x5b605a['speech'],_0xe3f0('0xca'));return this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')]('Dialogflow\x20Result\x20%s',_0x5b605a[_0xe3f0('0xcb')]));}return this['channel'][_0xe3f0('0x2e')](_0x29cedf,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0xcc')]=function(_0x4ba2fd){logger['info'](util['format'](_0xe3f0('0xcd'),_0x4ba2fd[_0xe3f0('0x8a')]));if(!this[_0xe3f0('0x68')](_0x4ba2fd[_0xe3f0('0xce')])){return this['channel'][_0xe3f0('0x92')](_0xe3f0('0xcf'));}if(!this[_0xe3f0('0x68')](_0x4ba2fd[_0xe3f0('0xd0')])){return this['channel'][_0xe3f0('0x92')]('no\x20username\x20configured');}if(!this['isConfigured'](_0x4ba2fd[_0xe3f0('0xd1')])){return this[_0xe3f0('0xd')]['noop'](_0xe3f0('0xd2'));}if(!this[_0xe3f0('0x68')](_0x4ba2fd[_0xe3f0('0xd3')])){return this[_0xe3f0('0xd')][_0xe3f0('0x92')](_0xe3f0('0x9b'));}this[_0xe3f0('0xd')]['bot']=!![];this['createSquareDetailsReport'](_0x4ba2fd);this[_0xe3f0('0x44')](_0x4ba2fd[_0xe3f0('0x60')],'in');this[_0xe3f0('0xd')][_0xe3f0('0x92')](util['format']('Trying\x20SestekNDA:\x20%s',_0x4ba2fd[_0xe3f0('0x60')]));var _0x3eff18=this['sestekNDA'][_0xe3f0('0x85')](this,_0x4ba2fd);if(_0x3eff18){for(var _0x1947bd in _0x3eff18){if(_0x3eff18[_0xe3f0('0x7b')](_0x1947bd)){this[_0xe3f0('0xd')][_0xe3f0('0xb8')](util[_0xe3f0('0x2b')]('SESTEK_NDA_%s',_0x1947bd[_0xe3f0('0xc9')]()),_0x3eff18[_0x1947bd]);}}this[_0xe3f0('0x44')](_0x3eff18[_0xe3f0('0xcb')],_0xe3f0('0xca'));if(_0x3eff18[_0xe3f0('0xd4')]){this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x3eff18[_0xe3f0('0xd4')]));var _0x59a9d5=this[_0xe3f0('0xd')][_0xe3f0('0xd5')](_0x3eff18[_0xe3f0('0xd4')]);try{fs[_0xe3f0('0xd6')](_0x3eff18[_0xe3f0('0xd4')]+_0xe3f0('0xd7'));}catch(_0x28eb7e){logger[_0xe3f0('0x2e')](_0x28eb7e);}return _0x59a9d5;}else{return this[_0xe3f0('0xd')]['noop'](util['format'](_0xe3f0('0xd8'),_0x3eff18['speech']));}}return this[_0xe3f0('0xd')]['error'](_0x4ba2fd,_0xe3f0('0xd9'));};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0xda')]=function(_0x5e7008){logger[_0xe3f0('0x30')](util['format'](_0xe3f0('0xdb'),_0x5e7008[_0xe3f0('0x8a')]));return this[_0xe3f0('0xd')][_0xe3f0('0x92')](_0xe3f0('0xda'));};AGIVertices[_0xe3f0('0xf')]['ext_dial']=function(_0x3e2015){logger[_0xe3f0('0x30')](util['format'](_0xe3f0('0xdc'),_0x3e2015[_0xe3f0('0x8a')]));var _0x206a4b='';if(_0x3e2015[_0xe3f0('0xdd')]){if(!this[_0xe3f0('0x68')](_0x3e2015['trunk_id'])){return this[_0xe3f0('0xd')]['error'](_0x3e2015,_0xe3f0('0xde'));}else{var _0x273a3d=parseInt(_0x3e2015[_0xe3f0('0xdd')],0xa);if(isNaN(_0x273a3d)){_0x206a4b=_0x3e2015[_0xe3f0('0xdd')];}else{_0x206a4b=this[_0xe3f0('0xdf')][_0xe3f0('0x85')](this,_0x3e2015[_0xe3f0('0xdd')]);if(!_0x206a4b){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0x3e2015,_0xe3f0('0xe0'));}}}}else if(_0x3e2015[_0xe3f0('0xe1')]){_0x206a4b=_0x3e2015['trunk_name'];}else{return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0x3e2015,'no\x20trunk\x20selected');}var _0x5b8342=this[_0xe3f0('0xd')][_0xe3f0('0x5a')](_0xe3f0('0xc0'),[util[_0xe3f0('0x2b')](_0xe3f0('0xe2'),_0x206a4b,_0x3e2015[_0xe3f0('0x4a')]),_0x3e2015[_0xe3f0('0x8d')],_0x3e2015['opts'],_0x3e2015[_0xe3f0('0xe3')]]);if(_0x5b8342['result']===-0x1){return _0x5b8342;}return this['channel'][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0xc3'),_0xe3f0('0xc0')));};AGIVertices[_0xe3f0('0xf')]['finally']=function(_0x4ac7c4){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0xe4'),_0x4ac7c4[_0xe3f0('0x8a')]));return this[_0xe3f0('0xd')][_0xe3f0('0x92')]('finally');};AGIVertices[_0xe3f0('0xf')]['getdigits']=function(_0x3cc667){logger[_0xe3f0('0x30')](util['format']('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x3cc667['label']));if(_0x3cc667['retry']===0x0){return this[_0xe3f0('0x84')](_0x3cc667);}_0x3cc667[_0xe3f0('0xe5')]-=0x1;if(!this[_0xe3f0('0x68')](_0x3cc667[_0xe3f0('0xe6')])){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0x3cc667,_0xe3f0('0xe7'));}var _0x3f5e7e=this[_0xe3f0('0x1e')][_0xe3f0('0x85')](this,_0x3cc667[_0xe3f0('0xe6')]);if(!_0x3f5e7e){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0x3cc667,'no\x20file\x20audio\x20found');}if(!this[_0xe3f0('0x68')](_0x3cc667[_0xe3f0('0xb3')])){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0xe4e0af=this['channel']['getData'](_0x3f5e7e,_0x3cc667['response'],_0x3cc667['maxdigit']);var _0x164c9d=_0xe4e0af[_0xe3f0('0x81')]?_0xe4e0af[_0xe3f0('0x81')]['toString']():'';logger[_0xe3f0('0x30')]('test',JSON[_0xe3f0('0xe8')](_0xe4e0af));if(_0xe4e0af[_0xe3f0('0x81')]===-0x1){this[_0xe3f0('0x3a')][_0xe3f0('0x85')](this,_0x3cc667,_0x164c9d);return _0xe4e0af;}else if(_0xe4e0af['extra']===_0xe3f0('0x8d')){_0xe4e0af[_0xe3f0('0x81')]=_0x164c9d[_0xe3f0('0x7d')]>=parseInt(_0x3cc667[_0xe3f0('0xe9')])?'x':'i';}else{_0xe4e0af[_0xe3f0('0x81')]=_0x164c9d[_0xe3f0('0x7d')]>=parseInt(_0x3cc667[_0xe3f0('0xe9')])&&_0x164c9d[_0xe3f0('0x7d')]<=parseInt(_0x3cc667[_0xe3f0('0xea')])?'x':'i';}var _0x2e9322=this[_0xe3f0('0x10')][_0xe3f0('0x85')](this,_0x3cc667[_0xe3f0('0xb3')]);if(!_0x2e9322){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0x3cc667,'no\x20variable\x20found');}this[_0xe3f0('0xd')][_0xe3f0('0xb8')](_0x2e9322,_0x164c9d);if(this[_0xe3f0('0x68')](_0x3cc667[_0xe3f0('0xeb')])){var _0x3eb48d=parseInt(_0x3cc667[_0xe3f0('0xeb')],0xa);var _0x31c698=rs['generate']({'charset':'*','length':_0x3eb48d});var _0x3cea97=_0x164c9d[_0xe3f0('0x7d')];if(_0x3cea97>0x0){if(_0x3cea97>_0x3eb48d){this[_0xe3f0('0x3a')][_0xe3f0('0x85')](this,_0x3cc667,_0x3cc667[_0xe3f0('0xec')]===_0xe3f0('0xed')?_0x31c698+_0x164c9d[_0xe3f0('0xee')](_0x3eb48d):_0x164c9d[_0xe3f0('0xee')](0x0,_0x3cea97-_0x3eb48d)+_0x31c698);}else{this['createSquareDetailsReport'][_0xe3f0('0x85')](this,_0x3cc667,rs[_0xe3f0('0xef')]({'charset':'*','length':_0x3cea97}));}}else{this[_0xe3f0('0x3a')][_0xe3f0('0x85')](this,_0x3cc667,'');}}else{this[_0xe3f0('0x3a')]['sync'](this,_0x3cc667,_0x164c9d);}return _0xe4e0af;};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0xf0')]=function(_0x2a3362){logger[_0xe3f0('0x30')](util['format'](_0xe3f0('0xf1'),_0x2a3362['label']));return this[_0xe3f0('0xc')](_0x2a3362);};AGIVertices['prototype']['goal']=function(_0x3d400d){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0xf2'),_0x3d400d[_0xe3f0('0x8a')]));this['createSquareDetailsReport'][_0xe3f0('0x85')](this,_0x3d400d,_0x3d400d[_0xe3f0('0xf3')]);return this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')]('GOAL\x20%s',_0x3d400d[_0xe3f0('0xf3')]));};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0xf4')]=function(_0x3071f0){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0xf5'),_0x3071f0[_0xe3f0('0x8a')]));if(!this['isConfigured'](_0x3071f0[_0xe3f0('0x70')])||!this['isConfigured'](_0x3071f0[_0xe3f0('0x6a')])){return this[_0xe3f0('0xd')][_0xe3f0('0x92')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xe3f0('0x68')](_0x3071f0['text'])){return this['channel'][_0xe3f0('0x92')](_0xe3f0('0x9b'));}this[_0xe3f0('0xd')][_0xe3f0('0x92')](util['format'](_0xe3f0('0xf6'),_0x3071f0[_0xe3f0('0x60')]));var _0x5af8c7=this['awsPolly'][_0xe3f0('0x85')](this,_0x3071f0);if(_0x5af8c7){this['channel']['noop'](util[_0xe3f0('0x2b')](_0xe3f0('0xf7'),_0x5af8c7));var _0x50ac19=this[_0xe3f0('0xd')][_0xe3f0('0xd5')](_0x5af8c7);try{fs[_0xe3f0('0xd6')](_0x5af8c7+_0xe3f0('0xd7'));}catch(_0x45c79a){logger['error'](_0x45c79a);}return _0x50ac19;}return this[_0xe3f0('0xd')]['error'](_0x3071f0,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xe3f0('0xf')]['awslex']=function(_0x6ee85f){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0xf8'),_0x6ee85f[_0xe3f0('0x8a')]));if(!this[_0xe3f0('0x68')](_0x6ee85f[_0xe3f0('0x70')])||!this['isConfigured'](_0x6ee85f[_0xe3f0('0x6a')])){return this[_0xe3f0('0xd')][_0xe3f0('0x92')](_0xe3f0('0xf9'));}if(!this['isConfigured'](_0x6ee85f[_0xe3f0('0x72')])){return this[_0xe3f0('0xd')][_0xe3f0('0x92')](_0xe3f0('0xfa'));}if(!this['isConfigured'](_0x6ee85f[_0xe3f0('0x60')])){return this[_0xe3f0('0xd')]['noop'](_0xe3f0('0x9b'));}this[_0xe3f0('0xd')][_0xe3f0('0xc6')]=!![];this[_0xe3f0('0x3a')](_0x6ee85f);this[_0xe3f0('0x44')](_0x6ee85f[_0xe3f0('0x60')],'in');this[_0xe3f0('0xd')][_0xe3f0('0x92')](util['format'](_0xe3f0('0xfb'),_0x6ee85f[_0xe3f0('0x60')]));var _0x4e8c1a=this[_0xe3f0('0x6f')][_0xe3f0('0x85')](this,_0x6ee85f);if(_0x4e8c1a){for(var _0xad30da in _0x4e8c1a){if(_0x4e8c1a[_0xe3f0('0x7b')](_0xad30da)&&_[_0xe3f0('0xfc')](_0x4e8c1a[_0xad30da])){this['channel'][_0xe3f0('0xb8')](util['format']('AWS_LEX_%s',_0xad30da['toUpperCase']()),_0x4e8c1a[_0xad30da]);}}if(_[_0xe3f0('0x46')](_0x4e8c1a[_0xe3f0('0xfd')])){return this[_0xe3f0('0xd')][_0xe3f0('0x92')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xe3f0('0x44')](_0x4e8c1a[_0xe3f0('0xfd')],_0xe3f0('0xca'));return this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0xfe'),_0x4e8c1a['message']));}}return this['channel'][_0xe3f0('0x2e')](_0x6ee85f,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0xff')]=function(_0x209945){logger[_0xe3f0('0x30')](util['format'](_0xe3f0('0x100'),_0x209945[_0xe3f0('0x8a')],_0x209945[_0xe3f0('0x8d')]));if(!this['isConfigured'](_0x209945[_0xe3f0('0x5f')])){return this[_0xe3f0('0xd')]['noop']('no\x20key\x20configured');}var _0x53800d=_0xe3f0('0x101');var _0x279608=util[_0xe3f0('0x2b')]('%s/recordings/%s',FILES_PATH,rs[_0xe3f0('0xef')](0x4));var _0x3cc897=util['format']('%s.%s',_0x279608,_0x53800d);var _0x4fc797=!![];if(_0x209945['beep']==='NOBEEP'){_0x4fc797=![];}var _0x3553cb=this['channel'][_0xe3f0('0x102')](_0x279608,_0x53800d,_0x209945[_0xe3f0('0x103')],_0x209945[_0xe3f0('0x8d')],undefined,_0x4fc797);if(_0x3553cb[_0xe3f0('0x81')]!==-0x1){this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')]('google\x20%s\x20file\x20created',_0x3cc897));var _0x25722a=this['googleASR'][_0xe3f0('0x85')](this,_0x209945,_0x3cc897);if(_0x25722a){for(var _0x103afa in _0x25722a){if(_0x25722a[_0xe3f0('0x7b')](_0x103afa)){this[_0xe3f0('0xd')]['setVariable'](util[_0xe3f0('0x2b')](_0xe3f0('0x104'),_0x103afa[_0xe3f0('0xc9')]()),_0x25722a[_0x103afa]);}}return this['channel'][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0x105'),JSON[_0xe3f0('0xe8')](_0x25722a)));}}return _0x3553cb;};AGIVertices['prototype'][_0xe3f0('0x106')]=function(_0x3785e3){logger['info'](util[_0xe3f0('0x2b')](_0xe3f0('0x107'),_0x3785e3[_0xe3f0('0x8a')]));if(!this[_0xe3f0('0x68')](_0x3785e3[_0xe3f0('0x76')])){return this[_0xe3f0('0xd')][_0xe3f0('0x92')](_0xe3f0('0x108'));}if(!this[_0xe3f0('0x68')](_0x3785e3[_0xe3f0('0x77')])){return this[_0xe3f0('0xd')][_0xe3f0('0x92')](_0xe3f0('0x109'));}var _0xdcc0fe=_0xe3f0('0x101');var _0x4c2766=util['format'](_0xe3f0('0x10a'),FILES_PATH,rs[_0xe3f0('0xef')](0x4));var _0x4f5d3b=util[_0xe3f0('0x2b')](_0xe3f0('0x10b'),_0x4c2766,_0xdcc0fe);var _0x23596a=!![];if(_0x3785e3['beep']===_0xe3f0('0x10c')){_0x23596a=![];}var _0xce28b=this[_0xe3f0('0xd')]['recordFile'](_0x4c2766,_0xdcc0fe,_0x3785e3['intKey'],_0x3785e3['timeout'],undefined,_0x23596a);if(_0xce28b['result']!==-0x1){this[_0xe3f0('0xd')]['noop'](util[_0xe3f0('0x2b')](_0xe3f0('0x10d'),_0x4f5d3b));var _0x4a88cc=this[_0xe3f0('0x75')][_0xe3f0('0x85')](this,_0x3785e3,_0x4f5d3b);if(_0x4a88cc){for(var _0x416cde in _0x4a88cc){if(_0x4a88cc[_0xe3f0('0x7b')](_0x416cde)){this[_0xe3f0('0xd')][_0xe3f0('0xb8')](util[_0xe3f0('0x2b')]('TILDE_ASR_%s',_0x416cde[_0xe3f0('0xc9')]()),_0x4a88cc[_0x416cde]);}}return this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0x10e'),JSON[_0xe3f0('0xe8')](_0x4a88cc)));}}return _0xce28b;};AGIVertices['prototype'][_0xe3f0('0x10f')]=function(_0x2a4c18){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0x110'),_0x2a4c18['label']));return this['channel'][_0xe3f0('0x111')](_0x2a4c18[_0xe3f0('0x112')],_0x2a4c18[_0xe3f0('0x41')],_0x2a4c18[_0xe3f0('0x113')]);};AGIVertices[_0xe3f0('0xf')]['gotoif']=function(_0x3dc484){logger[_0xe3f0('0x30')](util['format'](_0xe3f0('0x114'),_0x3dc484[_0xe3f0('0x8a')]));if(!this[_0xe3f0('0x68')](_0x3dc484[_0xe3f0('0x115')])){return this[_0xe3f0('0xd')]['error'](_0x3dc484,_0xe3f0('0x116'));}try{var _0xa68a0f=eval(_0x3dc484[_0xe3f0('0x115')])?_0xe3f0('0x117'):'false';this[_0xe3f0('0xd')][_0xe3f0('0x92')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x3dc484[_0xe3f0('0x115')],_0xa68a0f));return{'code':0xc8,'result':_0xa68a0f};}catch(_0x27ad9e){return{'code':0xc8,'result':_0xe3f0('0x118')};}};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x119')]=function(_0x502d53){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0x11a'),_0x502d53[_0xe3f0('0x8a')]));if(!this[_0xe3f0('0x68')](_0x502d53[_0xe3f0('0x11b')])){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0x502d53,'no\x20interval\x20configured');}var _0x11e98d=this['getIntervals']['sync'](this,_0x502d53[_0xe3f0('0x11b')]);if(!_0x11e98d){return this['channel'][_0xe3f0('0x2e')](_0x502d53,_0xe3f0('0x11c'));}for(var _0x2c667f=0x0;_0x2c667f<_0x11e98d[_0xe3f0('0x7d')];_0x2c667f+=0x1){var _0x2c8a36=this[_0xe3f0('0xd')][_0xe3f0('0x10')](util['format'](_0xe3f0('0x11d'),_0x11e98d[_0x2c667f]));if(_0x2c8a36['result']===-0x1){return _0x2c8a36;}logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0x11e'),_0x11e98d[_0x2c667f],_0x2c8a36[_0xe3f0('0x83')]));if(_0x2c8a36[_0xe3f0('0x83')]===_0xe3f0('0x117')){logger[_0xe3f0('0x30')](util['format'](_0xe3f0('0x11e'),_0x11e98d[_0x2c667f],'true'));this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0x11e'),_0x11e98d[_0x2c667f],'true'));return{'code':0xc8,'result':_0xe3f0('0x117')};}else{logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')]('IFTIME\x20%s\x20%s',_0x11e98d[_0x2c667f],_0xe3f0('0x118')));this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0x11e'),_0x11e98d[_0x2c667f],_0xe3f0('0x118')));}}return{'code':0xc8,'result':_0xe3f0('0x118')};};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x11f')]=function(_0x1ee1f6){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0x120'),_0x1ee1f6[_0xe3f0('0x8a')]));return this[_0xe3f0('0xd')]['hangup']();};AGIVertices[_0xe3f0('0xf')]['ispeechasr']=function(_0x283d30){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0x121'),_0x283d30[_0xe3f0('0x8a')]));if(!this[_0xe3f0('0x68')](_0x283d30[_0xe3f0('0x5f')])){return this[_0xe3f0('0xd')][_0xe3f0('0x92')](_0xe3f0('0xc5'));}var _0x4bc8e3=_0xe3f0('0x101');var _0x5f15ce=util['format'](_0xe3f0('0x10a'),FILES_PATH,rs[_0xe3f0('0xef')](0x4));var _0x39bfec=util[_0xe3f0('0x2b')](_0xe3f0('0x10b'),_0x5f15ce,_0x4bc8e3);var _0x69ab3=!![];if(_0x283d30[_0xe3f0('0x122')]==='NOBEEP'){_0x69ab3=![];}var _0x2ecb2b=this[_0xe3f0('0xd')][_0xe3f0('0x102')](_0x5f15ce,_0x4bc8e3,_0x283d30['intKey'],_0x283d30[_0xe3f0('0x8d')],undefined,_0x69ab3);if(_0x2ecb2b[_0xe3f0('0x81')]!==-0x1){this[_0xe3f0('0xd')][_0xe3f0('0x92')](util['format'](_0xe3f0('0x123'),_0x39bfec));var _0x3d8862=this[_0xe3f0('0x67')][_0xe3f0('0x85')](this,_0x283d30,_0x39bfec);if(_0x3d8862){for(var _0x158f93 in _0x3d8862){if(_0x3d8862[_0xe3f0('0x7b')](_0x158f93)){this['channel'][_0xe3f0('0xb8')](util[_0xe3f0('0x2b')](_0xe3f0('0x124'),_0x158f93['toUpperCase']()),_0x3d8862[_0x158f93]);}}return this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')]('IspeechASR\x20Result\x20%s',JSON[_0xe3f0('0xe8')](_0x3d8862)));}}return _0x2ecb2b;};AGIVertices['prototype'][_0xe3f0('0x125')]=function(_0x42a828){logger['info'](util[_0xe3f0('0x2b')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x42a828[_0xe3f0('0x8a')]));if(!this[_0xe3f0('0x68')](_0x42a828[_0xe3f0('0x5f')])){return this[_0xe3f0('0xd')][_0xe3f0('0x92')](_0xe3f0('0xc5'));}if(!this[_0xe3f0('0x68')](_0x42a828[_0xe3f0('0x60')])){return this[_0xe3f0('0xd')][_0xe3f0('0x92')](_0xe3f0('0x9b'));}this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0x126'),_0x42a828[_0xe3f0('0x60')]));var _0x430da8=this[_0xe3f0('0x63')][_0xe3f0('0x85')](this,_0x42a828);if(_0x430da8){this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')]('ispeech\x20%s\x20file\x20created',_0x430da8));var _0xbae092=this['channel'][_0xe3f0('0xd5')](_0x430da8,_0x42a828[_0xe3f0('0x103')]);try{fs[_0xe3f0('0xd6')](_0x430da8+_0xe3f0('0xd7'));}catch(_0x470250){logger['error'](_0x470250);}return _0xbae092;}return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0x42a828,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xe3f0('0xf')]['login']=function(_0x1b3ebd){logger['info'](util[_0xe3f0('0x2b')](_0xe3f0('0x127'),_0x1b3ebd['label']));if(!this[_0xe3f0('0x68')](_0x1b3ebd[_0xe3f0('0x128')])){return this['channel'][_0xe3f0('0x2e')](_0x1b3ebd,_0xe3f0('0x129'));}logger[_0xe3f0('0x30')](util['format'](_0xe3f0('0x12a'),this['channel'][_0xe3f0('0x3e')],_0x1b3ebd[_0xe3f0('0x128')]));var _0x211a46=this['agentLogin'][_0xe3f0('0x85')](this,_0x1b3ebd[_0xe3f0('0x128')]);if(_0x211a46){logger['info'](util[_0xe3f0('0x2b')](_0xe3f0('0x12b'),this[_0xe3f0('0xd')][_0xe3f0('0x3e')],_0x1b3ebd[_0xe3f0('0x128')]));this[_0xe3f0('0xd')][_0xe3f0('0x92')](util['format'](_0xe3f0('0x12b'),this['channel'][_0xe3f0('0x3e')],_0x1b3ebd[_0xe3f0('0x128')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format'](_0xe3f0('0x12c'),this[_0xe3f0('0xd')][_0xe3f0('0x3e')],_0x1b3ebd[_0xe3f0('0x128')]));this[_0xe3f0('0xd')][_0xe3f0('0x92')](util['format'](_0xe3f0('0x12c'),this['channel'][_0xe3f0('0x3e')],_0x1b3ebd[_0xe3f0('0x128')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x12d')]=function(_0x2119df){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x2119df[_0xe3f0('0x8a')]));if(!this[_0xe3f0('0x68')](_0x2119df['findBy'])){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0x2119df,_0xe3f0('0x129'));}logger[_0xe3f0('0x30')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xe3f0('0xd')][_0xe3f0('0x3e')],_0x2119df[_0xe3f0('0x128')]));var _0x499523=this['agentLogout']['sync'](this,_0x2119df['findBy']);if(_0x499523){logger['info'](util[_0xe3f0('0x2b')](_0xe3f0('0x12b'),this[_0xe3f0('0xd')][_0xe3f0('0x3e')],_0x2119df[_0xe3f0('0x128')]));this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0x12b'),this[_0xe3f0('0xd')][_0xe3f0('0x3e')],_0x2119df[_0xe3f0('0x128')]));return{'code':0xc8,'result':_0xe3f0('0x12e')};}else{logger['info'](util[_0xe3f0('0x2b')](_0xe3f0('0x12c'),this[_0xe3f0('0xd')][_0xe3f0('0x3e')],_0x2119df[_0xe3f0('0x128')]));this[_0xe3f0('0xd')]['noop'](util[_0xe3f0('0x2b')](_0xe3f0('0x12c'),this[_0xe3f0('0xd')][_0xe3f0('0x3e')],_0x2119df['findBy']));return{'code':0xc8,'result':_0xe3f0('0x12f')};}};AGIVertices[_0xe3f0('0xf')]['math']=function(_0x3caaf5){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x3caaf5['label']));if(!this[_0xe3f0('0x68')](_0x3caaf5[_0xe3f0('0x130')])){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0x3caaf5,_0xe3f0('0x131'));}this['channel'][_0xe3f0('0x92')](util[_0xe3f0('0x2b')]('math\x20%s',_0x3caaf5['operation']));var _0x41d0a0=eval(_0x3caaf5[_0xe3f0('0x130')]);if(!this['isConfigured'](_0x3caaf5['variable_id'])){return this[_0xe3f0('0xd')][_0xe3f0('0x92')](_0xe3f0('0xb4'));}var _0x30b29a=this[_0xe3f0('0x10')]['sync'](this,_0x3caaf5['variable_id']);if(!_0x30b29a){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0x3caaf5,_0xe3f0('0xb5'));}if(_['isArray'](_0x41d0a0)){var _0x11658b=this;_0x41d0a0[_0xe3f0('0xb6')](function(_0x239bb2,_0x48c15c){_0x11658b['channel'][_0xe3f0('0xb8')](util[_0xe3f0('0x2b')](_0xe3f0('0x132'),_0x30b29a,_0x48c15c),_0x239bb2);});return this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0x133'),_0x30b29a));}else{return this['channel']['setVariable'](_0x30b29a,_0x41d0a0);}};AGIVertices[_0xe3f0('0xf')]['menu']=function(_0x4f92be){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0x134'),_0x4f92be[_0xe3f0('0x8a')]));if(_0x4f92be[_0xe3f0('0xe5')]===0x0){return this[_0xe3f0('0x84')](_0x4f92be);}_0x4f92be[_0xe3f0('0xe5')]-=0x1;if(!this[_0xe3f0('0x68')](_0x4f92be[_0xe3f0('0xe6')])){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0x4f92be,_0xe3f0('0xe7'));}var _0x211c46=this[_0xe3f0('0x1e')][_0xe3f0('0x85')](this,_0x4f92be[_0xe3f0('0xe6')]);if(!_0x211c46){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0x4f92be,_0xe3f0('0x135'));}var _0x4a7f79=this[_0xe3f0('0xd')][_0xe3f0('0x136')](_0x211c46,_0x4f92be['response'],_0x4f92be['digit']);var _0x11b4e3=_0x4a7f79[_0xe3f0('0x81')];if(_0x4a7f79[_0xe3f0('0x81')]===-0x1){this['createSquareDetailsReport'][_0xe3f0('0x85')](this,_0x4f92be,'-1');return _0x4a7f79;}else if(_0x4a7f79['extra']===_0xe3f0('0x8d')){_0x4a7f79['result']=_0x4a7f79[_0xe3f0('0x81')]['length']>0x0?_0x4a7f79[_0xe3f0('0x81')]:'t';}else if(_[_0xe3f0('0x48')](_0x4a7f79[_0xe3f0('0x81')])){_0x4a7f79[_0xe3f0('0x81')]='#';_0x11b4e3='#';}if(!this[_0xe3f0('0x68')](_0x4f92be['variable_id'])){this[_0xe3f0('0xd')]['noop'](_0xe3f0('0xb4'));}else{var _0x2a9ddb=this[_0xe3f0('0x10')][_0xe3f0('0x85')](this,_0x4f92be[_0xe3f0('0xb3')]);if(!_0x2a9ddb){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0x4f92be,_0xe3f0('0xb5'));}this[_0xe3f0('0xd')][_0xe3f0('0xb8')](_0x2a9ddb,_0x11b4e3);}this[_0xe3f0('0x3a')][_0xe3f0('0x85')](this,_0x4f92be,_0x11b4e3);return _0x4a7f79;};AGIVertices[_0xe3f0('0xf')]['noop']=function(_0x18bed6){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0x137'),_0x18bed6[_0xe3f0('0x8a')]));return this[_0xe3f0('0xd')][_0xe3f0('0x92')](_0x18bed6['output']||_0x18bed6['label']);};AGIVertices[_0xe3f0('0xf')]['pause']=function(_0x4e1b95){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0x138'),_0x4e1b95[_0xe3f0('0x8a')]));if(!this[_0xe3f0('0x68')](_0x4e1b95[_0xe3f0('0x128')])){return this['channel']['error'](_0x4e1b95,_0xe3f0('0x129'));}logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x4e1b95[_0xe3f0('0x128')]));var _0xee85a4=this['getPause'][_0xe3f0('0x85')](this,_0x4e1b95[_0xe3f0('0x139')]);var _0x41ceef=this['agentPause']['sync'](this,_0x4e1b95['findBy'],_0xee85a4);if(_0x41ceef){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0x12b'),this[_0xe3f0('0xd')][_0xe3f0('0x3e')],_0x4e1b95[_0xe3f0('0x128')]));this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0x12b'),this[_0xe3f0('0xd')][_0xe3f0('0x3e')],_0x4e1b95[_0xe3f0('0x128')]));return{'code':0xc8,'result':_0xe3f0('0x12e')};}else{logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xe3f0('0xd')]['callerid'],_0x4e1b95['findBy']));this[_0xe3f0('0xd')]['noop'](util['format'](_0xe3f0('0x12b'),this['channel']['callerid'],_0x4e1b95['findBy']));return{'code':0xc8,'result':_0xe3f0('0x12f')};}};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x13a')]=function(_0x468353){logger['info'](util[_0xe3f0('0x2b')](_0xe3f0('0x13b'),_0x468353[_0xe3f0('0x8a')]));if(!this[_0xe3f0('0x68')](_0x468353[_0xe3f0('0xe6')])){return this['channel'][_0xe3f0('0x2e')](_0x468353,_0xe3f0('0xe7'));}var _0x9e902e=this[_0xe3f0('0x1e')][_0xe3f0('0x85')](this,_0x468353[_0xe3f0('0xe6')]);if(!_0x9e902e){return this[_0xe3f0('0xd')]['error'](_0x468353,'no\x20file\x20audio\x20found');}var _0x45bb98=this[_0xe3f0('0xd')]['exec'](_0xe3f0('0x13c'),[_0x9e902e,_0x468353[_0xe3f0('0xc2')]]);if(_0x45bb98[_0xe3f0('0x81')]===-0x1){return _0x45bb98;}return this['channel'][_0xe3f0('0x92')](util['format']('Executed\x20command\x20%s\x20%s',_0xe3f0('0x13c'),_0x9e902e));};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x13d')]=function(_0x66dc49){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x66dc49[_0xe3f0('0x8a')]));if(!this[_0xe3f0('0x68')](_0x66dc49[_0xe3f0('0x13e')])){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0x66dc49,_0xe3f0('0x13f'));}var _0x5e90a6='';var _0x38a97b=parseInt(_0x66dc49[_0xe3f0('0x13e')],0xa);if(isNaN(_0x38a97b)){_0x5e90a6=_0x66dc49[_0xe3f0('0x13e')];}else{_0x5e90a6=this['getVoiceQueue']['sync'](this,_0x66dc49['queue_id']);if(!_0x5e90a6){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0x66dc49,_0xe3f0('0x140'));}}var _0xd1af84='';if(this[_0xe3f0('0x68')](_0x66dc49[_0xe3f0('0xe6')])){var _0x35992d=this['getSound'][_0xe3f0('0x85')](this,_0x66dc49[_0xe3f0('0xe6')]);if(_0x35992d){_0xd1af84=_0x35992d;}}this[_0xe3f0('0x3a')]['sync'](this,_0x66dc49,_0x5e90a6);if(_0x66dc49[_0xe3f0('0xc2')][_0xe3f0('0x141')]('x')<0x0){_0x66dc49[_0xe3f0('0xc2')]+='x';}if(_0x66dc49['opts'][_0xe3f0('0x141')]('X')<0x0){_0x66dc49[_0xe3f0('0xc2')]+='X';}this[_0xe3f0('0xd')]['setVariable'](_0xe3f0('0x142'),_0x5e90a6?_0x5e90a6[_0xe3f0('0x143')]():'');var _0x466ceb=this[_0xe3f0('0xd')][_0xe3f0('0x5a')](_0xe3f0('0x144'),[_0x5e90a6,_0x66dc49['opts'],_0x66dc49[_0xe3f0('0xe3')],_0xd1af84,_0x66dc49[_0xe3f0('0x8d')],_0x66dc49['agi'],_0x66dc49[_0xe3f0('0x145')],_0x66dc49[_0xe3f0('0x146')],'',_0x66dc49[_0xe3f0('0x147')]]);if(_0x466ceb['result']===-0x1){return _0x466ceb;}return this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')]('Executed\x20command\x20%s\x20%s',_0xe3f0('0x144'),_0x5e90a6));};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x148')]=function(_0x462a99){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0x149'),_0x462a99['label']));var _0x26d1bf=_0x462a99[_0xe3f0('0x14a')]||_0xe3f0('0x101');var _0x3d6a07=util[_0xe3f0('0x2b')](_0xe3f0('0x14b'),this[_0xe3f0('0xd')]['uniqueid'],rs[_0xe3f0('0xef')](0x5));var _0x55136a=util[_0xe3f0('0x2b')](_0xe3f0('0x14c'),FILES_PATH,_0x3d6a07,_0x26d1bf);var _0x13752a=util['format'](_0xe3f0('0x10a'),FILES_PATH,_0x3d6a07);this[_0xe3f0('0x3f')][_0xe3f0('0x85')](this,_0x462a99,_0x3d6a07,_0x55136a);this[_0xe3f0('0xd')][_0xe3f0('0xb8')](_0xe3f0('0x14d'),_0x3d6a07);logger[_0xe3f0('0x30')](_0xe3f0('0x14e'),_0x13752a,_0x26d1bf,_0x462a99[_0xe3f0('0x14f')],_0x462a99[_0xe3f0('0x8d')]);return this[_0xe3f0('0xd')][_0xe3f0('0x102')](_0x13752a,_0x26d1bf,_0x462a99[_0xe3f0('0x14f')],_0x462a99[_0xe3f0('0x8d')],undefined,!![]);};AGIVertices['prototype'][_0xe3f0('0x150')]=function(_0x2bfce6){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x2bfce6[_0xe3f0('0x8a')]));return this['channel'][_0xe3f0('0x151')](_0x2bfce6['digits'][_0xe3f0('0x5c')](/\s+/g,''),_0x2bfce6['escape_digits']);};AGIVertices[_0xe3f0('0xf')]['saynumber']=function(_0x56e0ab){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x56e0ab[_0xe3f0('0x8a')]));return this[_0xe3f0('0xd')][_0xe3f0('0x152')](_0x56e0ab[_0xe3f0('0x153')][_0xe3f0('0x5c')](/\s+/g,''),_0x56e0ab['escape_digits']);};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x154')]=function(_0x48f5ce){logger['info'](util[_0xe3f0('0x2b')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x48f5ce[_0xe3f0('0x8a')]));return this[_0xe3f0('0xd')][_0xe3f0('0x155')](_0x48f5ce[_0xe3f0('0x60')],_0x48f5ce['escape_digits']);};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x156')]=function(_0x245418){logger[_0xe3f0('0x30')](util['format'](_0xe3f0('0x157'),_0x245418[_0xe3f0('0x8a')]));if(!this[_0xe3f0('0x68')](_0x245418[_0xe3f0('0x158')])){return this[_0xe3f0('0xd')][_0xe3f0('0x92')](_0xe3f0('0x159'));}var _0x4e1a84=this[_0xe3f0('0x22')]['sync'](this,_0x245418[_0xe3f0('0x158')]);if(!_0x4e1a84||!_0x4e1a84[_0xe3f0('0x15a')]){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0x245418,_0xe3f0('0x15b'));}var _0x4e2d17={'from':util[_0xe3f0('0x2b')](_0xe3f0('0x15c'),_0x4e1a84['name'],_0x4e1a84[_0xe3f0('0x15d')]||_0x4e1a84['Smtp'][_0xe3f0('0x15e')]),'to':_0x245418['to']||'','cc':_0x245418['cc']||'','bcc':_0x245418[_0xe3f0('0x15f')]||'','subject':_0x245418['subject'],'html':_0x245418[_0xe3f0('0x60')],'text':_0x245418[_0xe3f0('0x60')]};var _0x5d7845={'tls':{'rejectUnauthorized':![]}};if(_0x4e1a84['Smtp']['service']){_0x5d7845['service']=_0x4e1a84['Smtp']['service'];}else{_0x5d7845[_0xe3f0('0x160')]=_0x4e1a84[_0xe3f0('0x15a')]['host'];_0x5d7845['port']=_0x4e1a84['Smtp'][_0xe3f0('0x161')];_0x5d7845['secure']=_0x4e1a84[_0xe3f0('0x15a')][_0xe3f0('0x162')];}if(_0x4e1a84[_0xe3f0('0x15a')][_0xe3f0('0x163')]){_0x5d7845[_0xe3f0('0x164')]={'user':_0x4e1a84['Smtp'][_0xe3f0('0x15e')],'pass':_0x4e1a84[_0xe3f0('0x15a')][_0xe3f0('0x165')]};}if(this[_0xe3f0('0x68')](_0x245418[_0xe3f0('0x166')])){}logger[_0xe3f0('0xbc')](_0xe3f0('0x167'),JSON[_0xe3f0('0xe8')](_0x4e2d17));this[_0xe3f0('0x3a')][_0xe3f0('0x85')](this,_0x245418,_0x245418[_0xe3f0('0x158')]);this['channel'][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0x168'),_0x4e1a84['name']));this[_0xe3f0('0x24')][_0xe3f0('0x85')](this,_0x5d7845,_0x4e2d17);return this[_0xe3f0('0xd')][_0xe3f0('0x92')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xe3f0('0xf')]['sendFax']=function(_0x414cb2){logger['info'](util[_0xe3f0('0x2b')](_0xe3f0('0x169'),_0x414cb2[_0xe3f0('0x8a')]));return this[_0xe3f0('0xd')]['noop'](_0xe3f0('0x16a'));};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x16b')]=function(_0x432d4d){logger['info'](util[_0xe3f0('0x2b')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x432d4d[_0xe3f0('0x8a')]));if(!this['isConfigured'](_0x432d4d['sms_account_id'])){return this[_0xe3f0('0xd')]['noop'](_0xe3f0('0x16c'));}var _0x3ca742=this[_0xe3f0('0x37')][_0xe3f0('0x85')](this,_0x432d4d[_0xe3f0('0x16d')]);if(!_0x3ca742){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0x432d4d,_0xe3f0('0x16e'));}var _0x307e25={'body':_0x432d4d['sms_text'],'phone':_0x432d4d['to']||'','SmsAccountId':_0x3ca742['id']};logger[_0xe3f0('0xbc')]('sendSMS\x20message',JSON[_0xe3f0('0xe8')](_0x307e25));this['createSquareDetailsReport'][_0xe3f0('0x85')](this,_0x432d4d,_0x432d4d[_0xe3f0('0x16d')]);this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x3ca742[_0xe3f0('0x16')]));this[_0xe3f0('0x39')][_0xe3f0('0x85')](this,_0x307e25);return this['channel'][_0xe3f0('0x92')](_0xe3f0('0x16f'));};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x170')]=function(_0x4035f0){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0x171'),_0x4035f0['label']));if(!this[_0xe3f0('0x68')](_0x4035f0[_0xe3f0('0xb3')])){return this['channel'][_0xe3f0('0x2e')](_0x4035f0,_0xe3f0('0x172'));}var _0x2fbe55=this[_0xe3f0('0x10')][_0xe3f0('0x85')](this,_0x4035f0['variable_id']);if(!_0x2fbe55){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0x4035f0,_0xe3f0('0xb5'));}return this[_0xe3f0('0xd')]['setVariable'](_0x2fbe55,_0x4035f0[_0xe3f0('0x173')]);};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x174')]=function(_0x16426f){logger['info'](util[_0xe3f0('0x2b')](_0xe3f0('0x175'),_0x16426f[_0xe3f0('0x8a')]));this[_0xe3f0('0xd')][_0xe3f0('0x92')]('START\x20CALLY\x20SQUARE');if(_0x16426f['answer']==='yes'){this[_0xe3f0('0xd')][_0xe3f0('0x92')]('Answer');return this[_0xe3f0('0xd')][_0xe3f0('0x88')]();}return this[_0xe3f0('0xd')][_0xe3f0('0x92')](_0xe3f0('0x176'));};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x177')]=function(_0xad5d3){logger[_0xe3f0('0x30')](util['format'](_0xe3f0('0x178'),_0xad5d3[_0xe3f0('0x8a')]));if(!this[_0xe3f0('0x68')](_0xad5d3[_0xe3f0('0x179')])){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0xad5d3,_0xe3f0('0x17a'));}var _0x409728=this['getSquareProject'][_0xe3f0('0x85')](this,_0xad5d3[_0xe3f0('0x179')]);if(!this[_0xe3f0('0x68')](_0x409728)){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0xad5d3,util[_0xe3f0('0x2b')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0xad5d3[_0xe3f0('0x179')]));}if(_0x409728===this[_0xe3f0('0xd')][_0xe3f0('0x3d')]){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0xad5d3,_0xe3f0('0x17b'));}this['createSquareDetailsReport'][_0xe3f0('0x85')](this,_0xad5d3,_0x409728);var _0x3a9500=this[_0xe3f0('0xd')][_0xe3f0('0x5a')](_0xe3f0('0x17c'),util[_0xe3f0('0x2b')](_0xe3f0('0x17d'),config['agi'][_0xe3f0('0x160')]||_0xe3f0('0x17e'),_0x409728,this[_0xe3f0('0xd')][_0xe3f0('0x3d')]));if(_0x3a9500[_0xe3f0('0x81')]===-0x1){return _0x3a9500;}return this[_0xe3f0('0xd')]['noop'](util[_0xe3f0('0x2b')](_0xe3f0('0x98'),_0xe3f0('0x17c'),_0x409728));};AGIVertices[_0xe3f0('0xf')]['system']=function(_0x53d794){logger[_0xe3f0('0x30')](util['format'](_0xe3f0('0x17f'),_0x53d794[_0xe3f0('0x8a')]));var _0x387d17=this[_0xe3f0('0x59')][_0xe3f0('0x85')](this,_0x53d794['command']);this[_0xe3f0('0x3a')][_0xe3f0('0x85')](this,_0x53d794,_0x53d794[_0xe3f0('0x86')]);if(this[_0xe3f0('0x68')](_0x53d794[_0xe3f0('0xb3')])){var _0x354874=this[_0xe3f0('0x10')]['sync'](this,_0x53d794[_0xe3f0('0xb3')]);if(_0x354874){this[_0xe3f0('0xd')]['setVariable'](_0x354874,_0x387d17);return this['channel'][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0x180'),_0x53d794[_0xe3f0('0x86')],_0x354874));}}return this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0x181'),_0x53d794[_0xe3f0('0x86')]));};AGIVertices[_0xe3f0('0xf')]['tts']=function(_0x4b6c55){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x4b6c55[_0xe3f0('0x8a')]));if(!this[_0xe3f0('0x68')](_0x4b6c55[_0xe3f0('0x60')])){return this[_0xe3f0('0xd')][_0xe3f0('0x92')](_0xe3f0('0x9b'));}this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0x182'),_0x4b6c55[_0xe3f0('0x60')]));var _0x1f4380=this[_0xe3f0('0x5d')][_0xe3f0('0x85')](this,_0x4b6c55);if(_0x1f4380){this['channel']['noop'](util[_0xe3f0('0x2b')]('Google\x20TTS\x20%s\x20file\x20created',_0x1f4380));var _0xeb0c61=this[_0xe3f0('0xd')][_0xe3f0('0xd5')](_0x1f4380);try{fs[_0xe3f0('0xd6')](_0x1f4380+_0xe3f0('0xd7'));}catch(_0x5d527d){logger[_0xe3f0('0x2e')](_0x5d527d);}return _0xeb0c61;}return this['channel'][_0xe3f0('0x2e')](_0x4b6c55,_0xe3f0('0x183'));};AGIVertices[_0xe3f0('0xf')][_0xe3f0('0x184')]=function(_0x259bc9){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0x185'),_0x259bc9[_0xe3f0('0x8a')]));if(!this[_0xe3f0('0x68')](_0x259bc9[_0xe3f0('0x128')])){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0x259bc9,_0xe3f0('0x129'));}logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0x12a'),this[_0xe3f0('0xd')][_0xe3f0('0x3e')],_0x259bc9[_0xe3f0('0x128')]));var _0x46ad5e=this[_0xe3f0('0x53')][_0xe3f0('0x85')](this,_0x259bc9[_0xe3f0('0x128')]);if(_0x46ad5e){logger[_0xe3f0('0x30')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xe3f0('0xd')][_0xe3f0('0x3e')],_0x259bc9[_0xe3f0('0x128')]));this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0x12b'),this[_0xe3f0('0xd')][_0xe3f0('0x3e')],_0x259bc9[_0xe3f0('0x128')]));return{'code':0xc8,'result':_0xe3f0('0x12e')};}else{logger['info'](util[_0xe3f0('0x2b')](_0xe3f0('0x12c'),this[_0xe3f0('0xd')][_0xe3f0('0x3e')],_0x259bc9['findBy']));this[_0xe3f0('0xd')][_0xe3f0('0x92')](util[_0xe3f0('0x2b')](_0xe3f0('0x12c'),this['channel'][_0xe3f0('0x3e')],_0x259bc9['findBy']));return{'code':0xc8,'result':_0xe3f0('0x12f')};}};AGIVertices[_0xe3f0('0xf')]['voicemail']=function(_0x506539){logger[_0xe3f0('0x30')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x506539[_0xe3f0('0x8a')]));var _0x2006c1=this[_0xe3f0('0xd')]['exec'](_0xe3f0('0x186'),[_0x506539[_0xe3f0('0x187')],_0x506539[_0xe3f0('0x97')]]);if(_0x2006c1['result']===-0x1){return _0x2006c1;}return this[_0xe3f0('0xd')]['noop'](util[_0xe3f0('0x2b')](_0xe3f0('0x98'),'VOICEMAIL',_0x506539[_0xe3f0('0x187')]));};AGIVertices['prototype'][_0xe3f0('0x188')]=function(_0x17a183){logger[_0xe3f0('0x30')](util[_0xe3f0('0x2b')](_0xe3f0('0x189'),_0x17a183[_0xe3f0('0x8a')]));if(!this['isConfigured'](_0x17a183[_0xe3f0('0xb3')])){return this['channel'][_0xe3f0('0x2e')](_0x17a183,_0xe3f0('0x172'));}var _0x14519f=this[_0xe3f0('0x10')][_0xe3f0('0x85')](this,_0x17a183[_0xe3f0('0xb3')]);if(!_0x14519f){return this[_0xe3f0('0xd')][_0xe3f0('0x2e')](_0x17a183,_0xe3f0('0xb5'));}var _0x531a45=this[_0xe3f0('0xd')]['getVariable'](_0x14519f);return{'code':0xc8,'result':_0x531a45['extra']?_0x531a45['extra']:'-'};};String[_0xe3f0('0xf')][_0xe3f0('0x7f')]=function(_0x58139a,_0x433734){return this[_0xe3f0('0x7e')](_0x58139a)[_0xe3f0('0x18a')](_0x433734);};module[_0xe3f0('0x18b')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 77f71c7..58e0e0f 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 _0xed1f=['transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','syncAgentRingNoAnswer','autopause','all','Auto-Pause','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','bind','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDispositionPause','name','Action','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','lastPauseAt','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[TIMER][STOP][AGENT:%s]','saveUnpause','update','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','attended','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xed1f,0x6a));var _0xfed1=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xed1f[_0x599f41];return _0x2e4d58;};'use strict';var util=require(_0xfed1('0x0'));var _=require(_0xfed1('0x1'));var moment=require(_0xfed1('0x2'));var ami=require(_0xfed1('0x3'));var logger=require(_0xfed1('0x4'))(_0xfed1('0x5'));var RpcUser=require(_0xfed1('0x6'));var RpcVoiceAgentReport=require(_0xfed1('0x7'));function Acw(_0x2209b3){this[_0xfed1('0x8')]=_0x2209b3[_0xfed1('0x8')];this[_0xfed1('0x9')]=_0x2209b3[_0xfed1('0x9')];this[_0xfed1('0xa')]=_0x2209b3[_0xfed1('0xa')];this[_0xfed1('0xb')]={};ami['on'](_0xfed1('0xc'),this[_0xfed1('0xd')]['bind'](this));ami['on'](_0xfed1('0xe'),this[_0xfed1('0xf')]['bind'](this));ami['on'](_0xfed1('0x10'),this[_0xfed1('0x11')]['bind'](this));ami['on'](_0xfed1('0x12'),this['syncAgentRingNoAnswer'][_0xfed1('0x13')](this));ami['on'](_0xfed1('0x14'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0xfed1('0x15'),this[_0xfed1('0x16')]['bind'](this));ami['on'](_0xfed1('0x17'),this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0x3f6555){var _0x397af9=moment()['milliseconds'](0x0);var _0x2dde3a=moment(_0x3f6555)['milliseconds'](0x0);return _0x397af9['diff'](_0x2dde3a,_0xfed1('0x18'));}Acw[_0xfed1('0x19')][_0xfed1('0x1a')]=function(_0x123c46){try{var _0x582e67=this;var _0x1a00f6=this['channels'][_0x123c46][_0xfed1('0x1b')];var _0x29a32f=this['channels'][_0x123c46][_0xfed1('0x1c')];var _0xa72a20=this['voiceQueues'][_0x29a32f];var _0x59509b=![];var _0x586ea6=_0xfed1('0x1d');if(_0xa72a20['mandatoryDisposition']){if(_0xa72a20[_0xfed1('0x1e')][_0xfed1('0x1f')]){_0x59509b=!![];_0x586ea6=_0xa72a20['mandatoryDispositionPause'][_0xfed1('0x1f')];}}ami[_0xfed1('0x20')]({'action':'QueuePause','interface':_0x1a00f6,'paused':!![],'reason':_0x586ea6})[_0xfed1('0x21')](function(_0x2ea7a8){if(_0x582e67[_0xfed1('0x9')][_0x1a00f6]){return RpcUser[_0xfed1('0x22')](_0x582e67['agents'][_0x1a00f6]['id'])[_0xfed1('0x21')](function(_0x59333e){if(_0x59333e&&!_0x59333e[_0xfed1('0x23')]){logger[_0xfed1('0x24')](_0xfed1('0x25'),_0x123c46,_0x1a00f6,_0x29a32f);var _0x532ec2=_0x582e67[_0xfed1('0xb')][_0x123c46]['attended']&&_0x582e67[_0xfed1('0xb')][_0x123c46][_0xfed1('0x26')]?_0x582e67[_0xfed1('0xb')][_0x123c46][_0xfed1('0x26')]:_0x123c46;return RpcUser[_0xfed1('0x27')](_0x582e67[_0xfed1('0x9')][_0x1a00f6],_0x586ea6,_0x532ec2)['then'](function(_0x465ce6){if(!_0x59509b){_0x582e67[_0xfed1('0xa')][_0x1a00f6]={};logger['info'](_0xfed1('0x28'),_0x123c46,_0x582e67[_0xfed1('0x8')][_0x29a32f][_0xfed1('0x29')],_0x1a00f6,_0x29a32f);_0x582e67[_0xfed1('0xa')][_0x1a00f6][_0xfed1('0x2a')]=setTimeout(_0x582e67[_0xfed1('0x2b')]['bind'](_0x582e67,_0x1a00f6),_0x582e67[_0xfed1('0x8')][_0x29a32f]['acwTimeout']*0x3e8);_0x582e67[_0xfed1('0xa')][_0x1a00f6]['lastPauseAt']=moment()['format'](_0xfed1('0x2c'));_0x582e67[_0xfed1('0xa')][_0x1a00f6][_0xfed1('0x2d')]=_0x123c46;_0x582e67['timers'][_0x1a00f6][_0xfed1('0x1c')]=_0x29a32f;_0x582e67[_0xfed1('0xa')][_0x1a00f6][_0xfed1('0x2e')]=function(){var _0x383955=getDiff(_0x582e67[_0xfed1('0xa')][_0x1a00f6][_0xfed1('0x2f')]);clearTimeout(_0x582e67['timers'][_0x1a00f6][_0xfed1('0x2a')]);_0x582e67[_0xfed1('0xa')][_0x1a00f6]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x383955},_0x582e67[_0xfed1('0xa')][_0x1a00f6][_0xfed1('0x2d')],_0x1a00f6)[_0xfed1('0x21')](function(_0x71147f){logger[_0xfed1('0x24')]('[%s][UPDATE][ACWTIME:%s]',_0x123c46,_0x383955,_0x71147f);})[_0xfed1('0x30')](function(_0x21b292){logger[_0xfed1('0x31')](_0xfed1('0x32'),_0x123c46,_0x21b292);});delete _0x582e67[_0xfed1('0xa')][_0x1a00f6];};}});}else{logger['info'](_0xfed1('0x33'),_0x123c46,_0x1a00f6,_0x29a32f);}});}})['catch'](function(_0x11c5bd){logger[_0xfed1('0x31')](_0xfed1('0x28'),_0x123c46,_0x582e67[_0xfed1('0x8')][_0x29a32f][_0xfed1('0x29')],_0x1a00f6,_0x29a32f);})[_0xfed1('0x34')](function(){delete _0x582e67[_0xfed1('0xb')][_0x123c46];});}catch(_0x41bf2a){logger['error'](_0xfed1('0x35'),_0x41bf2a[_0xfed1('0x36')]);}};Acw[_0xfed1('0x19')][_0xfed1('0x2b')]=function(_0x57da75){try{var _0x4b1d7b=this;if(_0x4b1d7b[_0xfed1('0xa')][_0x57da75]){_0x4b1d7b[_0xfed1('0xa')][_0x57da75][_0xfed1('0x2a')]=![];var _0x1105bd=_0x4b1d7b[_0xfed1('0xa')][_0x57da75][_0xfed1('0x2d')];var _0x46a150=_0x4b1d7b[_0xfed1('0xa')][_0x57da75]['queue'];var _0x52c7b8=_0x4b1d7b[_0xfed1('0x8')][_0x46a150][_0xfed1('0x29')];logger['info'](_0xfed1('0x37'),_0x57da75);RpcUser[_0xfed1('0x38')](this[_0xfed1('0x9')][_0x57da75]);RpcVoiceAgentReport[_0xfed1('0x39')]({'acwtime':_0x52c7b8,'agentacw':!![]},_0x1105bd,_0x57da75)[_0xfed1('0x21')](function(_0x31ffeb){logger[_0xfed1('0x24')](_0xfed1('0x3a'),_0x1105bd,_0x52c7b8,_0x31ffeb);})[_0xfed1('0x30')](function(_0x5f3e1f){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x1105bd,_0x5f3e1f);});}else{logger[_0xfed1('0x31')](_0xfed1('0x3b'),_0x57da75);if(_0x4b1d7b[_0xfed1('0xa')]){logger['info'](_0xfed1('0x3c'),JSON['stringify'](_0x4b1d7b[_0xfed1('0xa')]));}}}catch(_0x2cfdca){logger[_0xfed1('0x31')]('[ACW][STOP]\x20%s',_0x2cfdca[_0xfed1('0x36')]);}};Acw[_0xfed1('0x19')][_0xfed1('0xd')]=function(_0x4b4115){try{if(this[_0xfed1('0x8')][_0x4b4115['queue']]&&(this[_0xfed1('0x8')][_0x4b4115[_0xfed1('0x1c')]][_0xfed1('0x5')]||this[_0xfed1('0x8')][_0x4b4115[_0xfed1('0x1c')]][_0xfed1('0x3d')])){if(this[_0xfed1('0x9')][_0x4b4115[_0xfed1('0x1b')]]){this[_0xfed1('0xb')][_0x4b4115['uniqueid']]={'queue':_0x4b4115[_0xfed1('0x1c')],'interface':_0x4b4115[_0xfed1('0x1b')],'destlinkedid':_0x4b4115[_0xfed1('0x26')]};}}}catch(_0x4a86af){logger['error'](_0xfed1('0x3e'),_0x4a86af[_0xfed1('0x36')]);}};Acw[_0xfed1('0x19')][_0xfed1('0x3f')]=function(_0x40c096){try{if(this[_0xfed1('0x8')][_0x40c096[_0xfed1('0x1c')]]&&(this[_0xfed1('0x8')][_0x40c096[_0xfed1('0x1c')]][_0xfed1('0x5')]||this[_0xfed1('0x8')][_0x40c096[_0xfed1('0x1c')]]['mandatoryDisposition'])){if(this[_0xfed1('0x9')][_0x40c096[_0xfed1('0x1b')]]){this[_0xfed1('0xb')][_0x40c096[_0xfed1('0x2d')]]={'queue':_0x40c096[_0xfed1('0x1c')],'interface':_0x40c096[_0xfed1('0x1b')]};}}}catch(_0x5eda29){logger[_0xfed1('0x31')](_0xfed1('0x40'),_0x5eda29[_0xfed1('0x36')]);}};Acw['prototype'][_0xfed1('0xf')]=function(_0x10f98d){try{if(this[_0xfed1('0xb')][_0x10f98d[_0xfed1('0x2d')]]&&_['isUndefined'](this[_0xfed1('0xb')][_0x10f98d[_0xfed1('0x2d')]][_0xfed1('0x41')])){logger[_0xfed1('0x24')](_0xfed1('0x42'),_0x10f98d[_0xfed1('0x2d')]);this[_0xfed1('0x1a')](_0x10f98d[_0xfed1('0x2d')]);}else if(this[_0xfed1('0xb')][_0x10f98d[_0xfed1('0x43')]]&&_[_0xfed1('0x44')](this[_0xfed1('0xb')][_0x10f98d[_0xfed1('0x43')]][_0xfed1('0x41')])){logger[_0xfed1('0x24')](_0xfed1('0x45'),_0x10f98d[_0xfed1('0x43')]);this[_0xfed1('0x1a')](_0x10f98d['linkedid']);}}catch(_0x589feb){logger[_0xfed1('0x31')](_0xfed1('0x46'),_0x589feb[_0xfed1('0x36')]);}};Acw[_0xfed1('0x19')]['syncHangup']=function(_0x3c2534){try{if(this[_0xfed1('0xb')][_0x3c2534['uniqueid']]&&this['channels'][_0x3c2534['uniqueid']][_0xfed1('0x41')]){logger[_0xfed1('0x24')](_0xfed1('0x47'),_0x3c2534[_0xfed1('0x2d')]);this[_0xfed1('0x1a')](_0x3c2534[_0xfed1('0x2d')]);}else if(this[_0xfed1('0xb')][_0x3c2534[_0xfed1('0x43')]]&&this[_0xfed1('0xb')][_0x3c2534[_0xfed1('0x43')]]['attended']){logger['info'](_0xfed1('0x48'),_0x3c2534[_0xfed1('0x43')]);this[_0xfed1('0x1a')](_0x3c2534[_0xfed1('0x43')]);}}catch(_0x83b8d0){logger[_0xfed1('0x31')](_0xfed1('0x49'),_0x83b8d0[_0xfed1('0x36')]);}};Acw[_0xfed1('0x19')][_0xfed1('0x4a')]=function(_0xbd49dc){try{if(!_[_0xfed1('0x4b')](this[_0xfed1('0xb')][_0xbd49dc[_0xfed1('0x4c')]])){this[_0xfed1('0x1a')](_0xbd49dc[_0xfed1('0x4c')]);if(this[_0xfed1('0xb')][_0xbd49dc['secondtransfereruniqueid']]){this['channels'][_0xbd49dc[_0xfed1('0x4d')]][_0xfed1('0x41')]=!![];this[_0xfed1('0xb')][_0xbd49dc[_0xfed1('0x4e')]]=this[_0xfed1('0xb')][_0xbd49dc[_0xfed1('0x4d')]];delete this[_0xfed1('0xb')][_0xbd49dc[_0xfed1('0x4d')]];}}else if(!_[_0xfed1('0x4b')](this[_0xfed1('0xb')][_0xbd49dc[_0xfed1('0x4e')]])){this[_0xfed1('0x1a')](_0xbd49dc[_0xfed1('0x4e')]);if(this[_0xfed1('0xb')][_0xbd49dc['origtransfereruniqueid']]){this[_0xfed1('0xb')][_0xbd49dc['origtransfereruniqueid']]['attended']=!![];this[_0xfed1('0xb')][_0xbd49dc['transfereeuniqueid']]=this[_0xfed1('0xb')][_0xbd49dc['origtransfereruniqueid']];delete this[_0xfed1('0xb')][_0xbd49dc[_0xfed1('0x4f')]];}}}catch(_0x53f0ab){logger[_0xfed1('0x31')](_0xfed1('0x50'),_0x53f0ab['message']);}};Acw[_0xfed1('0x19')][_0xfed1('0x16')]=function(_0x1c99c6){try{if(this[_0xfed1('0xb')][_0x1c99c6['transfereruniqueid']]){logger[_0xfed1('0x24')](_0xfed1('0x51'),JSON[_0xfed1('0x52')](_0x1c99c6[_0xfed1('0x53')]));this[_0xfed1('0x1a')](_0x1c99c6[_0xfed1('0x53')]);}else if(this[_0xfed1('0xb')][_0x1c99c6[_0xfed1('0x54')]]){logger['info'](_0xfed1('0x55'),JSON[_0xfed1('0x52')](_0x1c99c6[_0xfed1('0x54')]));this[_0xfed1('0x1a')](_0x1c99c6[_0xfed1('0x54')]);}}catch(_0x3d7be2){logger['error']('[ACW][syncBlindTransfer]\x20%s',_0x3d7be2['message']);}};Acw[_0xfed1('0x19')][_0xfed1('0x56')]=function(_0x3aea22){try{if(this[_0xfed1('0x8')][_0x3aea22['queue']]&&this[_0xfed1('0x8')][_0x3aea22['queue']][_0xfed1('0x57')]===_0xfed1('0x58')){if(this[_0xfed1('0x9')][_0x3aea22[_0xfed1('0x1b')]]){logger[_0xfed1('0x24')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x3aea22[_0xfed1('0x2d')],_0x3aea22[_0xfed1('0x1b')],_0x3aea22[_0xfed1('0x1c')]);return RpcUser['savePause'](this[_0xfed1('0x9')][_0x3aea22[_0xfed1('0x1b')]],_0xfed1('0x59'),_0x3aea22[_0xfed1('0x2d')]);}}}catch(_0x58b2b7){logger[_0xfed1('0x31')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x58b2b7[_0xfed1('0x36')]);}};module[_0xfed1('0x5a')]=Acw; \ No newline at end of file +var _0x2d17=['catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','message','queue','[TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereeuniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','exports','util','lodash','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','channels','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','then','info','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','update','uniqueid'];(function(_0x4362ad,_0x21f8d0){var _0x174e65=function(_0x43173d){while(--_0x43173d){_0x4362ad['push'](_0x4362ad['shift']());}};_0x174e65(++_0x21f8d0);}(_0x2d17,0x17e));var _0x72d1=function(_0x54a3d2,_0x25f13a){_0x54a3d2=_0x54a3d2-0x0;var _0x2cae00=_0x2d17[_0x54a3d2];return _0x2cae00;};'use strict';var util=require(_0x72d1('0x0'));var _=require(_0x72d1('0x1'));var moment=require('moment');var ami=require(_0x72d1('0x2'));var logger=require(_0x72d1('0x3'))('acw');var RpcUser=require(_0x72d1('0x4'));var RpcVoiceAgentReport=require(_0x72d1('0x5'));function Acw(_0x55b722){this[_0x72d1('0x6')]=_0x55b722['voiceQueues'];this[_0x72d1('0x7')]=_0x55b722['agents'];this[_0x72d1('0x8')]=_0x55b722[_0x72d1('0x8')];this['channels']={};ami['on'](_0x72d1('0x9'),this[_0x72d1('0xa')][_0x72d1('0xb')](this));ami['on']('hanguprequest',this[_0x72d1('0xc')][_0x72d1('0xb')](this));ami['on'](_0x72d1('0xd'),this['syncHangup'][_0x72d1('0xb')](this));ami['on'](_0x72d1('0xe'),this[_0x72d1('0xf')][_0x72d1('0xb')](this));ami['on'](_0x72d1('0x10'),this[_0x72d1('0x11')][_0x72d1('0xb')](this));ami['on'](_0x72d1('0x12'),this[_0x72d1('0x13')][_0x72d1('0xb')](this));ami['on']('custom:agentConnectPreview',this[_0x72d1('0x14')][_0x72d1('0xb')](this));}function getDiff(_0x4c1038){var _0x115cd7=moment()[_0x72d1('0x15')](0x0);var _0x685a27=moment(_0x4c1038)[_0x72d1('0x15')](0x0);return _0x115cd7[_0x72d1('0x16')](_0x685a27,_0x72d1('0x17'));}Acw[_0x72d1('0x18')][_0x72d1('0x19')]=function(_0x23a238){try{var _0x8d458=this;var _0x491af4=this[_0x72d1('0x1a')][_0x23a238]['interface'];var _0x3885b2=this[_0x72d1('0x1a')][_0x23a238]['queue'];var _0x1061b7=this[_0x72d1('0x6')][_0x3885b2];var _0x1ca18d=![];var _0x49caf4='ACW';if(_0x1061b7[_0x72d1('0x1b')]){if(_0x1061b7[_0x72d1('0x1c')][_0x72d1('0x1d')]){_0x1ca18d=!![];_0x49caf4=_0x1061b7[_0x72d1('0x1c')][_0x72d1('0x1d')];}}ami[_0x72d1('0x1e')]({'action':_0x72d1('0x1f'),'interface':_0x491af4,'paused':!![],'reason':_0x49caf4})['then'](function(_0x1c695c){if(_0x8d458['agents'][_0x491af4]){return RpcUser['getAgent'](_0x8d458['agents'][_0x491af4]['id'])['then'](function(_0x445985){if(_0x445985&&!_0x445985[_0x72d1('0x20')]){logger['info'](_0x72d1('0x21'),_0x23a238,_0x491af4,_0x3885b2);var _0x256dc1=_0x8d458[_0x72d1('0x1a')][_0x23a238][_0x72d1('0x22')]&&_0x8d458[_0x72d1('0x1a')][_0x23a238]['destlinkedid']?_0x8d458['channels'][_0x23a238][_0x72d1('0x23')]:_0x23a238;return RpcUser[_0x72d1('0x24')](_0x8d458[_0x72d1('0x7')][_0x491af4],_0x49caf4,_0x256dc1)[_0x72d1('0x25')](function(_0xdf6a69){if(!_0x1ca18d){_0x8d458[_0x72d1('0x8')][_0x491af4]={};logger[_0x72d1('0x26')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x23a238,_0x8d458['voiceQueues'][_0x3885b2][_0x72d1('0x27')],_0x491af4,_0x3885b2);_0x8d458['timers'][_0x491af4][_0x72d1('0x28')]=setTimeout(_0x8d458[_0x72d1('0x29')][_0x72d1('0xb')](_0x8d458,_0x491af4),_0x8d458['voiceQueues'][_0x3885b2][_0x72d1('0x27')]*0x3e8);_0x8d458['timers'][_0x491af4][_0x72d1('0x2a')]=moment()[_0x72d1('0x2b')](_0x72d1('0x2c'));_0x8d458[_0x72d1('0x8')][_0x491af4]['uniqueid']=_0x23a238;_0x8d458[_0x72d1('0x8')][_0x491af4]['queue']=_0x3885b2;_0x8d458[_0x72d1('0x8')][_0x491af4][_0x72d1('0x2d')]=function(){var _0x5cec3f=getDiff(_0x8d458[_0x72d1('0x8')][_0x491af4][_0x72d1('0x2a')]);clearTimeout(_0x8d458[_0x72d1('0x8')][_0x491af4][_0x72d1('0x28')]);_0x8d458[_0x72d1('0x8')][_0x491af4]['timer']=![];RpcVoiceAgentReport[_0x72d1('0x2e')]({'acwtime':_0x5cec3f},_0x8d458[_0x72d1('0x8')][_0x491af4][_0x72d1('0x2f')],_0x491af4)['then'](function(_0x244f4a){logger[_0x72d1('0x26')]('[%s][UPDATE][ACWTIME:%s]',_0x23a238,_0x5cec3f,_0x244f4a);})[_0x72d1('0x30')](function(_0x750de6){logger[_0x72d1('0x31')]('[%s][UPDATE][ERRORS:%s]',_0x23a238,_0x750de6);});delete _0x8d458[_0x72d1('0x8')][_0x491af4];};}});}else{logger['info'](_0x72d1('0x32'),_0x23a238,_0x491af4,_0x3885b2);}});}})[_0x72d1('0x30')](function(_0x23418d){logger[_0x72d1('0x31')](_0x72d1('0x33'),_0x23a238,_0x8d458[_0x72d1('0x6')][_0x3885b2][_0x72d1('0x27')],_0x491af4,_0x3885b2);})[_0x72d1('0x34')](function(){delete _0x8d458[_0x72d1('0x1a')][_0x23a238];});}catch(_0x24be04){logger[_0x72d1('0x31')]('[ACW][START]\x20%s',_0x24be04[_0x72d1('0x35')]);}};Acw[_0x72d1('0x18')][_0x72d1('0x29')]=function(_0x325209){try{var _0x49e074=this;if(_0x49e074[_0x72d1('0x8')][_0x325209]){_0x49e074[_0x72d1('0x8')][_0x325209][_0x72d1('0x28')]=![];var _0x4fb07b=_0x49e074[_0x72d1('0x8')][_0x325209][_0x72d1('0x2f')];var _0x163538=_0x49e074['timers'][_0x325209][_0x72d1('0x36')];var _0x117440=_0x49e074[_0x72d1('0x6')][_0x163538]['acwTimeout'];logger[_0x72d1('0x26')](_0x72d1('0x37'),_0x325209);RpcUser[_0x72d1('0x38')](this[_0x72d1('0x7')][_0x325209]);RpcVoiceAgentReport[_0x72d1('0x2e')]({'acwtime':_0x117440,'agentacw':!![]},_0x4fb07b,_0x325209)[_0x72d1('0x25')](function(_0xd7ec0f){logger['info'](_0x72d1('0x39'),_0x4fb07b,_0x117440,_0xd7ec0f);})[_0x72d1('0x30')](function(_0x440ac5){logger[_0x72d1('0x31')](_0x72d1('0x3a'),_0x4fb07b,_0x440ac5);});}else{logger[_0x72d1('0x31')](_0x72d1('0x3b'),_0x325209);if(_0x49e074[_0x72d1('0x8')]){logger['info'](_0x72d1('0x3c'),JSON[_0x72d1('0x3d')](_0x49e074[_0x72d1('0x8')]));}}}catch(_0x1d6704){logger[_0x72d1('0x31')](_0x72d1('0x3e'),_0x1d6704[_0x72d1('0x35')]);}};Acw[_0x72d1('0x18')]['syncAgentConnect']=function(_0x563c5a){try{if(this[_0x72d1('0x6')][_0x563c5a[_0x72d1('0x36')]]&&(this[_0x72d1('0x6')][_0x563c5a[_0x72d1('0x36')]]['acw']||this[_0x72d1('0x6')][_0x563c5a[_0x72d1('0x36')]]['mandatoryDisposition'])){if(this[_0x72d1('0x7')][_0x563c5a['interface']]){this[_0x72d1('0x1a')][_0x563c5a[_0x72d1('0x2f')]]={'queue':_0x563c5a['queue'],'interface':_0x563c5a[_0x72d1('0x3f')],'destlinkedid':_0x563c5a['destlinkedid']};}}}catch(_0x527223){logger['error'](_0x72d1('0x40'),_0x527223['message']);}};Acw[_0x72d1('0x18')][_0x72d1('0x14')]=function(_0x28332b){try{if(this['voiceQueues'][_0x28332b['queue']]&&(this[_0x72d1('0x6')][_0x28332b['queue']]['acw']||this[_0x72d1('0x6')][_0x28332b[_0x72d1('0x36')]][_0x72d1('0x1b')])){if(this['agents'][_0x28332b['interface']]){this['channels'][_0x28332b['uniqueid']]={'queue':_0x28332b[_0x72d1('0x36')],'interface':_0x28332b[_0x72d1('0x3f')]};}}}catch(_0x197483){logger[_0x72d1('0x31')](_0x72d1('0x41'),_0x197483[_0x72d1('0x35')]);}};Acw[_0x72d1('0x18')][_0x72d1('0xc')]=function(_0x1e2c11){try{if(this['channels'][_0x1e2c11[_0x72d1('0x2f')]]&&_[_0x72d1('0x42')](this[_0x72d1('0x1a')][_0x1e2c11['uniqueid']][_0x72d1('0x22')])){logger[_0x72d1('0x26')](_0x72d1('0x43'),_0x1e2c11['uniqueid']);this[_0x72d1('0x19')](_0x1e2c11[_0x72d1('0x2f')]);}else if(this[_0x72d1('0x1a')][_0x1e2c11[_0x72d1('0x44')]]&&_['isUndefined'](this['channels'][_0x1e2c11[_0x72d1('0x44')]][_0x72d1('0x22')])){logger[_0x72d1('0x26')]('[%s][HANGUP:LINKEDID]',_0x1e2c11[_0x72d1('0x44')]);this[_0x72d1('0x19')](_0x1e2c11[_0x72d1('0x44')]);}}catch(_0x463670){logger[_0x72d1('0x31')](_0x72d1('0x45'),_0x463670[_0x72d1('0x35')]);}};Acw[_0x72d1('0x18')][_0x72d1('0x46')]=function(_0x18f986){try{if(this[_0x72d1('0x1a')][_0x18f986['uniqueid']]&&this[_0x72d1('0x1a')][_0x18f986['uniqueid']]['attended']){logger[_0x72d1('0x26')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x18f986[_0x72d1('0x2f')]);this[_0x72d1('0x19')](_0x18f986[_0x72d1('0x2f')]);}else if(this[_0x72d1('0x1a')][_0x18f986[_0x72d1('0x44')]]&&this[_0x72d1('0x1a')][_0x18f986[_0x72d1('0x44')]][_0x72d1('0x22')]){logger[_0x72d1('0x26')](_0x72d1('0x47'),_0x18f986[_0x72d1('0x44')]);this['startAcw'](_0x18f986[_0x72d1('0x44')]);}}catch(_0x3da39a){logger[_0x72d1('0x31')]('[ACW][syncHangup]\x20%s',_0x3da39a['message']);}};Acw[_0x72d1('0x18')][_0x72d1('0x11')]=function(_0x16e9e7){try{if(!_[_0x72d1('0x48')](this[_0x72d1('0x1a')][_0x16e9e7['transfereeuniqueid']])){this[_0x72d1('0x19')](_0x16e9e7['transfereeuniqueid']);if(this[_0x72d1('0x1a')][_0x16e9e7[_0x72d1('0x49')]]){this[_0x72d1('0x1a')][_0x16e9e7[_0x72d1('0x49')]][_0x72d1('0x22')]=!![];this[_0x72d1('0x1a')][_0x16e9e7[_0x72d1('0x4a')]]=this[_0x72d1('0x1a')][_0x16e9e7[_0x72d1('0x49')]];delete this[_0x72d1('0x1a')][_0x16e9e7[_0x72d1('0x49')]];}}else if(!_[_0x72d1('0x48')](this[_0x72d1('0x1a')][_0x16e9e7[_0x72d1('0x4a')]])){this[_0x72d1('0x19')](_0x16e9e7[_0x72d1('0x4a')]);if(this[_0x72d1('0x1a')][_0x16e9e7['origtransfereruniqueid']]){this[_0x72d1('0x1a')][_0x16e9e7[_0x72d1('0x4b')]][_0x72d1('0x22')]=!![];this[_0x72d1('0x1a')][_0x16e9e7[_0x72d1('0x4c')]]=this[_0x72d1('0x1a')][_0x16e9e7['origtransfereruniqueid']];delete this[_0x72d1('0x1a')][_0x16e9e7[_0x72d1('0x4b')]];}}}catch(_0xb05cd9){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0xb05cd9[_0x72d1('0x35')]);}};Acw['prototype'][_0x72d1('0x13')]=function(_0x359176){try{if(this[_0x72d1('0x1a')][_0x359176[_0x72d1('0x4d')]]){logger[_0x72d1('0x26')](_0x72d1('0x4e'),JSON[_0x72d1('0x3d')](_0x359176[_0x72d1('0x4d')]));this[_0x72d1('0x19')](_0x359176['transfereruniqueid']);}else if(this['channels'][_0x359176[_0x72d1('0x4f')]]){logger[_0x72d1('0x26')](_0x72d1('0x50'),JSON['stringify'](_0x359176[_0x72d1('0x4f')]));this[_0x72d1('0x19')](_0x359176['transfererlinkedid']);}}catch(_0x39d7f9){logger[_0x72d1('0x31')](_0x72d1('0x51'),_0x39d7f9[_0x72d1('0x35')]);}};Acw[_0x72d1('0x18')][_0x72d1('0xf')]=function(_0x102574){try{if(this[_0x72d1('0x6')][_0x102574[_0x72d1('0x36')]]&&this[_0x72d1('0x6')][_0x102574[_0x72d1('0x36')]][_0x72d1('0x52')]==='all'){if(this['agents'][_0x102574[_0x72d1('0x3f')]]){logger[_0x72d1('0x26')](_0x72d1('0x53'),_0x102574[_0x72d1('0x2f')],_0x102574[_0x72d1('0x3f')],_0x102574[_0x72d1('0x36')]);return RpcUser[_0x72d1('0x24')](this[_0x72d1('0x7')][_0x102574['interface']],_0x72d1('0x54'),_0x102574['uniqueid']);}}}catch(_0x475016){logger[_0x72d1('0x31')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x475016['message']);}};module[_0x72d1('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 188b00f..607c8a5 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 _0x093a=['../../config/environment','asterisk','username','password','keepConnected','Action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','log','exports','asterisk-manager','bluebird','moment','lodash','../../config/logger'];(function(_0x481636,_0x37e865){var _0x2a4d5b=function(_0x52a07f){while(--_0x52a07f){_0x481636['push'](_0x481636['shift']());}};_0x2a4d5b(++_0x37e865);}(_0x093a,0x151));var _0xa093=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0x093a[_0x20a558];return _0x53d3f7;};'use strict';var Manager=require(_0xa093('0x0'));var BPromise=require(_0xa093('0x1'));var moment=require(_0xa093('0x2'));var util=require('util');var _=require(_0xa093('0x3'));var logger=require(_0xa093('0x4'))('ami');var config=require(_0xa093('0x5'));var ami=new Manager(config['asterisk']['port'],config[_0xa093('0x6')]['ip'],config[_0xa093('0x6')][_0xa093('0x7')],config[_0xa093('0x6')][_0xa093('0x8')],!![]);ami[_0xa093('0x9')]();ami[_0xa093('0xa')]=BPromise['promisify'](ami['action']);function error(_0x1a0c73){logger[_0xa093('0xb')](util[_0xa093('0xc')](_0xa093('0xd'),config[_0xa093('0x6')][_0xa093('0x7')],config[_0xa093('0x6')]['ip'],config['asterisk'][_0xa093('0xe')],util['inspect'](_0x1a0c73,![],null)));}function close(){logger[_0xa093('0xb')](util[_0xa093('0xc')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xa093('0x6')][_0xa093('0x7')],config['asterisk']['ip'],config[_0xa093('0x6')][_0xa093('0xe')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xa093('0xa')]({'action':_0xa093('0xf')});};};ami[_0xa093('0x10')]=function(){return function(){return ami[_0xa093('0xa')]({'action':_0xa093('0x11')});};};ami[_0xa093('0x12')]=function(){return function(){return ami['Action']({'action':_0xa093('0x13')});};};ami[_0xa093('0x14')]=function(){return function(){return ami['Action']({'action':_0xa093('0x15')});};};ami[_0xa093('0x16')]=function(){return function(){return ami[_0xa093('0xa')]({'action':_0xa093('0x17')});};};function connect(_0x1f5f4a){logger[_0xa093('0x18')](util[_0xa093('0xc')](_0xa093('0x19'),config[_0xa093('0x6')][_0xa093('0x7')],config[_0xa093('0x6')]['ip'],config[_0xa093('0x6')][_0xa093('0xe')]));ami[_0xa093('0x1a')](_0xa093('0xb'),error);ami[_0xa093('0x1a')](_0xa093('0x1b'),close);}ami['on'](_0xa093('0x1c'),connect);ami['on']('shutdown',function(_0x28768b){logger['info'](util[_0xa093('0xc')](_0xa093('0x1d'),config[_0xa093('0x6')]['username'],config[_0xa093('0x6')]['ip'],config['asterisk'][_0xa093('0xe')],util[_0xa093('0x1e')](_0x28768b,![],null)));});ami['on'](_0xa093('0x1f'),function(_0x504bba){logger['info'](util[_0xa093('0xc')](_0xa093('0x20'),config['asterisk'][_0xa093('0x7')],config[_0xa093('0x6')]['ip'],config[_0xa093('0x6')][_0xa093('0xe')]));return BPromise[_0xa093('0x21')]()[_0xa093('0x22')](ami['actionSipShowRegistry']())[_0xa093('0x22')](ami[_0xa093('0x10')]())[_0xa093('0x22')](ami[_0xa093('0x12')]())[_0xa093('0x22')](ami['actionQueueSummary']())[_0xa093('0x22')](ami['actionCoreShowChannels']())[_0xa093('0x23')](function(_0x55d016){console[_0xa093('0x24')](_0x55d016);});});ami['once'](_0xa093('0xb'),error);ami['once'](_0xa093('0x1b'),close);module[_0xa093('0x25')]=ami; \ No newline at end of file +var _0xff2b=['username','password','promisify','action','error','inspect','format','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','info','fullybooted','resolve','then','actionSipShowRegistry','catch','log','exports','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','ami','../../config/environment','asterisk','port'];(function(_0x141749,_0x477b04){var _0x3e6932=function(_0x47b3f2){while(--_0x47b3f2){_0x141749['push'](_0x141749['shift']());}};_0x3e6932(++_0x477b04);}(_0xff2b,0x1ca));var _0xbff2=function(_0x29f9b5,_0x681186){_0x29f9b5=_0x29f9b5-0x0;var _0x274051=_0xff2b[_0x29f9b5];return _0x274051;};'use strict';var Manager=require(_0xbff2('0x0'));var BPromise=require(_0xbff2('0x1'));var moment=require(_0xbff2('0x2'));var util=require(_0xbff2('0x3'));var _=require(_0xbff2('0x4'));var logger=require(_0xbff2('0x5'))(_0xbff2('0x6'));var config=require(_0xbff2('0x7'));var ami=new Manager(config[_0xbff2('0x8')][_0xbff2('0x9')],config[_0xbff2('0x8')]['ip'],config[_0xbff2('0x8')][_0xbff2('0xa')],config[_0xbff2('0x8')][_0xbff2('0xb')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0xbff2('0xc')](ami[_0xbff2('0xd')]);function error(_0x718877){logger[_0xbff2('0xe')](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0xbff2('0x8')][_0xbff2('0xa')],config['asterisk']['ip'],config[_0xbff2('0x8')][_0xbff2('0x9')],util[_0xbff2('0xf')](_0x718877,![],null)));}function close(){logger[_0xbff2('0xe')](util[_0xbff2('0x10')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xbff2('0x8')]['username'],config['asterisk']['ip'],config[_0xbff2('0x8')][_0xbff2('0x9')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xbff2('0x11')]({'action':_0xbff2('0x12')});};};ami[_0xbff2('0x13')]=function(){return function(){return ami[_0xbff2('0x11')]({'action':_0xbff2('0x14')});};};ami[_0xbff2('0x15')]=function(){return function(){return ami['Action']({'action':'sippeerstatus'});};};ami[_0xbff2('0x16')]=function(){return function(){return ami[_0xbff2('0x11')]({'action':_0xbff2('0x17')});};};ami[_0xbff2('0x18')]=function(){return function(){return ami[_0xbff2('0x11')]({'action':_0xbff2('0x19')});};};function connect(_0x3d4ba0){logger['info'](util[_0xbff2('0x10')](_0xbff2('0x1a'),config['asterisk'][_0xbff2('0xa')],config[_0xbff2('0x8')]['ip'],config[_0xbff2('0x8')][_0xbff2('0x9')]));ami[_0xbff2('0x1b')](_0xbff2('0xe'),error);ami[_0xbff2('0x1b')](_0xbff2('0x1c'),close);}ami['on'](_0xbff2('0x1d'),connect);ami['on'](_0xbff2('0x1e'),function(_0x3b3afb){logger[_0xbff2('0x1f')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xbff2('0x8')][_0xbff2('0xa')],config['asterisk']['ip'],config[_0xbff2('0x8')][_0xbff2('0x9')],util['inspect'](_0x3b3afb,![],null)));});ami['on'](_0xbff2('0x20'),function(_0x470dc2){logger[_0xbff2('0x1f')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xbff2('0x8')]['username'],config[_0xbff2('0x8')]['ip'],config[_0xbff2('0x8')][_0xbff2('0x9')]));return BPromise[_0xbff2('0x21')]()[_0xbff2('0x22')](ami[_0xbff2('0x23')]())[_0xbff2('0x22')](ami['actionDeviceStateList']())[_0xbff2('0x22')](ami['actionSipPeerStatus']())['then'](ami[_0xbff2('0x16')]())[_0xbff2('0x22')](ami[_0xbff2('0x18')]())[_0xbff2('0x24')](function(_0x19a995){console[_0xbff2('0x25')](_0x19a995);});});ami['once'](_0xbff2('0xe'),error);ami[_0xbff2('0x1b')](_0xbff2('0x1c'),close);module[_0xbff2('0x26')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index bea1485..b557e3b 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 _0x25c1=['ami','client','http','Request','then','debug','error','rpc','memberReport','message','result','catch','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x4e95d9,_0x276a97){var _0x43bcb8=function(_0x6e6a61){while(--_0x6e6a61){_0x4e95d9['push'](_0x4e95d9['shift']());}};_0x43bcb8(++_0x276a97);}(_0x25c1,0x13d));var _0x125c=function(_0x5b74c9,_0x23efda){_0x5b74c9=_0x5b74c9-0x0;var _0x27cfe4=_0x25c1[_0x5b74c9];return _0x27cfe4;};'use strict';var jayson=require(_0x125c('0x0'));var BPromise=require(_0x125c('0x1'));var logger=require(_0x125c('0x2'))(_0x125c('0x3'));var client=jayson[_0x125c('0x4')][_0x125c('0x5')]({'port':0x2329});client[_0x125c('0x6')]=function(_0x6bd302,_0x1a2fc2){return new BPromise(function(_0xbce5b5,_0xa4a65){return client['request'](_0x6bd302,_0x1a2fc2)[_0x125c('0x7')](function(_0xf34349){logger[_0x125c('0x8')]('rpc','memberReport',_0x6bd302,_0x1a2fc2,_0xf34349);if(_0xf34349[_0x125c('0x9')]){logger[_0x125c('0x9')](_0x125c('0xa'),_0x125c('0xb'),_0x6bd302,_0xf34349[_0x125c('0x9')][_0x125c('0xc')],_0x1a2fc2);return _0xa4a65(_0xf34349['error'][_0x125c('0xc')]);}else{return _0xbce5b5(_0xf34349[_0x125c('0xd')]);}})[_0x125c('0xe')](function(_0x431ad7){logger['error'](_0x125c('0xa'),'memberReport',_0x6bd302,_0x431ad7,_0x1a2fc2);return _0xa4a65(_0x431ad7);});});};module[_0x125c('0xf')]=client; \ No newline at end of file +var _0xa0fe=['../../config/logger','client','then','debug','memberReport','error','rpc','message','result','catch','exports','jayson/promise'];(function(_0xa3fadc,_0xd1e16){var _0x23ecb8=function(_0x2c71f7){while(--_0x2c71f7){_0xa3fadc['push'](_0xa3fadc['shift']());}};_0x23ecb8(++_0xd1e16);}(_0xa0fe,0x6b));var _0xea0f=function(_0x55f6a2,_0x5e70cb){_0x55f6a2=_0x55f6a2-0x0;var _0xd52e51=_0xa0fe[_0x55f6a2];return _0xd52e51;};'use strict';var jayson=require(_0xea0f('0x0'));var BPromise=require('bluebird');var logger=require(_0xea0f('0x1'))('ami');var client=jayson[_0xea0f('0x2')]['http']({'port':0x2329});client['Request']=function(_0x52ed3e,_0x476793){return new BPromise(function(_0x2169e1,_0xd9e687){return client['request'](_0x52ed3e,_0x476793)[_0xea0f('0x3')](function(_0x1f731d){logger[_0xea0f('0x4')]('rpc',_0xea0f('0x5'),_0x52ed3e,_0x476793,_0x1f731d);if(_0x1f731d[_0xea0f('0x6')]){logger[_0xea0f('0x6')](_0xea0f('0x7'),_0xea0f('0x5'),_0x52ed3e,_0x1f731d[_0xea0f('0x6')][_0xea0f('0x8')],_0x476793);return _0xd9e687(_0x1f731d[_0xea0f('0x6')][_0xea0f('0x8')]);}else{return _0x2169e1(_0x1f731d[_0xea0f('0x9')]);}})[_0xea0f('0xa')](function(_0xe332cf){logger[_0xea0f('0x6')](_0xea0f('0x7'),_0xea0f('0x5'),_0x52ed3e,_0xe332cf,_0x476793);return _0xd9e687(_0xe332cf);});});};module[_0xea0f('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 8228bab..84b941c 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 _0xa6e6=['idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callbackuniqueid','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','util','moment','isNil','string','voiceQueue','name','phone','Contact','firstName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','VoiceQueueId','CampaignId'];(function(_0x5ac18d,_0x54f72e){var _0x5ee470=function(_0x1cedd6){while(--_0x1cedd6){_0x5ac18d['push'](_0x5ac18d['shift']());}};_0x5ee470(++_0x54f72e);}(_0xa6e6,0x183));var _0x6a6e=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0xa6e6[_0x2ff238];return _0x204a56;};'use strict';var util=require(_0x6a6e('0x0'));var _=require('lodash');var moment=require(_0x6a6e('0x1'));function checkNameSurname(_0x54e20e,_0x5b7a6e,_0x3b282c){var _0x3d0437='';if(!_[_0x6a6e('0x2')](_0x5b7a6e)&&_0x6a6e('0x3')===typeof _0x5b7a6e){_0x3d0437+=_0x5b7a6e;}if(!_[_0x6a6e('0x2')](_0x3b282c)&&_0x6a6e('0x3')===typeof _0x3b282c){_0x3d0437+='\x20'+_0x3b282c;}if(_0x3d0437!==''){return _0x3d0437;}return _0x54e20e;}function Action(_0x5a384a,_0xfc4153,_0x86f68c){this[_0x6a6e('0x4')]=_0x5a384a;this['uniqueid']=_0x86f68c||undefined;this[_0x6a6e('0x5')]=checkNameSurname(_0xfc4153['Contact'][_0x6a6e('0x6')],_0xfc4153[_0x6a6e('0x7')][_0x6a6e('0x8')],_0xfc4153['Contact']['lastName']);this['number']=_0xfc4153[_0x6a6e('0x7')][_0x6a6e('0x6')];this[_0x6a6e('0x9')]=_0x5a384a['name'];this['active']=_0xfc4153[_0x6a6e('0xa')]||![];this[_0x6a6e('0xb')]=_0x5a384a[_0x6a6e('0xb')];this[_0x6a6e('0xc')]=_0x5a384a['dialQueueTimeout']||0x3;this[_0x6a6e('0xd')]=_0xfc4153[_0x6a6e('0xd')];this[_0x6a6e('0xe')]=_0xfc4153['countbusyretry'];this[_0x6a6e('0xf')]=_0xfc4153[_0x6a6e('0xf')];this['countnoanswerretry']=_0xfc4153[_0x6a6e('0x10')];this['ContactId']=_0xfc4153[_0x6a6e('0x11')];this[_0x6a6e('0x12')]=_0xfc4153[_0x6a6e('0x12')];this['UserId']=_0xfc4153['UserId'];this[_0x6a6e('0x13')]=_0xfc4153[_0x6a6e('0x13')];this['CampaignId']=_0xfc4153[_0x6a6e('0x14')];this[_0x6a6e('0x15')]=_0xfc4153['id'];this[_0x6a6e('0x16')]=_0xfc4153[_0x6a6e('0x7')]['firstName']||'';this[_0x6a6e('0x17')]=moment()[_0x6a6e('0x18')](_0x6a6e('0x19'));this['callback']=_0xfc4153['callback'];this['callbackuniqueid']=_0xfc4153[_0x6a6e('0x1a')];this['callbackat']=_0xfc4153['callbackat'];this['recallme']=_0xfc4153[_0x6a6e('0x1b')];this[_0x6a6e('0x1c')]='';this['originatecalleridname']='';}Action[_0x6a6e('0x1d')][_0x6a6e('0x1e')]=function(){return util[_0x6a6e('0x18')](_0x6a6e('0x1f'),this['name'],this[_0x6a6e('0x4')][_0x6a6e('0x20')]>0x0?this['number']['substring'](this['voiceQueue'][_0x6a6e('0x20')]):this[_0x6a6e('0x21')]);};Action['prototype']['getQueue']=function(){return this[_0x6a6e('0x9')];};module['exports']=Action; \ No newline at end of file +var _0xb0e4=['YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','recallme','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','prototype','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','firstName','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','CampaignId','idHopper','ContactFirstName','starttime','format'];(function(_0x4c4ca2,_0x30d812){var _0x17dac3=function(_0x4f07e6){while(--_0x4f07e6){_0x4c4ca2['push'](_0x4c4ca2['shift']());}};_0x17dac3(++_0x30d812);}(_0xb0e4,0xef));var _0x4b0e=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xb0e4[_0x263a74];return _0x2aa86c;};'use strict';var util=require(_0x4b0e('0x0'));var _=require(_0x4b0e('0x1'));var moment=require(_0x4b0e('0x2'));function checkNameSurname(_0x4612e4,_0x32b2d8,_0x46d70b){var _0x3a5a7a='';if(!_[_0x4b0e('0x3')](_0x32b2d8)&&_0x4b0e('0x4')===typeof _0x32b2d8){_0x3a5a7a+=_0x32b2d8;}if(!_[_0x4b0e('0x3')](_0x46d70b)&&_0x4b0e('0x4')===typeof _0x46d70b){_0x3a5a7a+='\x20'+_0x46d70b;}if(_0x3a5a7a!==''){return _0x3a5a7a;}return _0x4612e4;}function Action(_0x28d5c2,_0x5f3513,_0x1ab4f8){this[_0x4b0e('0x5')]=_0x28d5c2;this[_0x4b0e('0x6')]=_0x1ab4f8||undefined;this[_0x4b0e('0x7')]=checkNameSurname(_0x5f3513[_0x4b0e('0x8')]['phone'],_0x5f3513[_0x4b0e('0x8')][_0x4b0e('0x9')],_0x5f3513['Contact']['lastName']);this['number']=_0x5f3513[_0x4b0e('0x8')][_0x4b0e('0xa')];this[_0x4b0e('0xb')]=_0x28d5c2['name'];this[_0x4b0e('0xc')]=_0x5f3513[_0x4b0e('0xc')]||![];this[_0x4b0e('0xd')]=_0x28d5c2[_0x4b0e('0xd')];this[_0x4b0e('0xe')]=_0x28d5c2[_0x4b0e('0xe')]||0x3;this[_0x4b0e('0xf')]=_0x5f3513[_0x4b0e('0xf')];this[_0x4b0e('0x10')]=_0x5f3513[_0x4b0e('0x10')];this[_0x4b0e('0x11')]=_0x5f3513[_0x4b0e('0x11')];this[_0x4b0e('0x12')]=_0x5f3513[_0x4b0e('0x12')];this[_0x4b0e('0x13')]=_0x5f3513['ContactId'];this[_0x4b0e('0x14')]=_0x5f3513[_0x4b0e('0x14')];this[_0x4b0e('0x15')]=_0x5f3513['UserId'];this['VoiceQueueId']=_0x5f3513['VoiceQueueId'];this[_0x4b0e('0x16')]=_0x5f3513['CampaignId'];this[_0x4b0e('0x17')]=_0x5f3513['id'];this[_0x4b0e('0x18')]=_0x5f3513[_0x4b0e('0x8')][_0x4b0e('0x9')]||'';this[_0x4b0e('0x19')]=moment()[_0x4b0e('0x1a')](_0x4b0e('0x1b'));this[_0x4b0e('0x1c')]=_0x5f3513[_0x4b0e('0x1c')];this[_0x4b0e('0x1d')]=_0x5f3513[_0x4b0e('0x1d')];this['callbackat']=_0x5f3513['callbackat'];this['recallme']=_0x5f3513[_0x4b0e('0x1e')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action['prototype']['getCaller']=function(){return util[_0x4b0e('0x1a')](_0x4b0e('0x1f'),this[_0x4b0e('0x7')],this[_0x4b0e('0x5')][_0x4b0e('0x20')]>0x0?this[_0x4b0e('0x21')][_0x4b0e('0x22')](this['voiceQueue'][_0x4b0e('0x20')]):this[_0x4b0e('0x21')]);};Action[_0x4b0e('0x23')][_0x4b0e('0x24')]=function(){return this['queue'];};module[_0x4b0e('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 0f7f9ce..aaec65d 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 _0x8980=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','milliseconds','diff','seconds','state','statedesc','scheduledat','type','outbound','countbusyretry','countcongestionretry','countglobal','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','answertime','talktime','queue','membername','callback'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x8980,0x114));var _0x0898=function(_0x30b9e3,_0x9a40cb){_0x30b9e3=_0x30b9e3-0x0;var _0x1bbab0=_0x8980[_0x30b9e3];return _0x1bbab0;};'use strict';var util=require(_0x0898('0x0'));var _=require(_0x0898('0x1'));var moment=require('moment');function getSeconds(_0x216792,_0x3c0329){var _0x1f4c2e=moment(_0x216792)['milliseconds'](0x0);var _0x565d8b=moment(_0x3c0329)[_0x0898('0x2')](0x0);return _0x1f4c2e[_0x0898('0x3')](_0x565d8b,_0x0898('0x4'));}function AgentComplete(_0xc07829,_0x1eaae3){this[_0x0898('0x5')]=0x4;this[_0x0898('0x6')]='Answer';this[_0x0898('0x7')]=_0xc07829['scheduledat'];this[_0x0898('0x8')]=_0xc07829[_0x0898('0x8')];this['campaigntype']=_0xc07829[_0x0898('0x8')]===_0x0898('0x9')?'queue':_0xc07829['type'];this[_0x0898('0xa')]=_0xc07829[_0x0898('0xa')];this['countcongestionretry']=_0xc07829[_0x0898('0xb')];this['countnoanswerretry']=_0xc07829['countnoanswerretry'];this[_0x0898('0xc')]=_0xc07829[_0x0898('0xa')]+_0xc07829[_0x0898('0xb')]+_0xc07829['countnoanswerretry'];this['uniqueid']=_0x1eaae3[_0x0898('0xd')];this[_0x0898('0xe')]=_0xc07829[_0x0898('0xf')];this[_0x0898('0x10')]=_0xc07829[_0x0898('0x11')];this['starttime']=_0xc07829[_0x0898('0x12')];this[_0x0898('0x13')]=_0xc07829[_0x0898('0x13')];this['answertime']=_0xc07829['answertime'];this[_0x0898('0x14')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0898('0x15')]=getSeconds(_0xc07829[_0x0898('0x13')],_0xc07829[_0x0898('0x12')]);this[_0x0898('0x16')]=getSeconds(_0xc07829[_0x0898('0x17')],_0xc07829[_0x0898('0x13')]);this[_0x0898('0x18')]=getSeconds(this[_0x0898('0x14')],_0xc07829[_0x0898('0x17')]);this[_0x0898('0x19')]=_0x1eaae3['queue'];this[_0x0898('0x1a')]=_0x1eaae3['membername'];this['reason']=_0x1eaae3['reason'];this[_0x0898('0x1b')]=_0xc07829[_0x0898('0x1b')];this[_0x0898('0x1c')]=_0xc07829[_0x0898('0x1c')];this[_0x0898('0x1d')]=_0xc07829[_0x0898('0x1d')];this[_0x0898('0x1e')]=_0xc07829[_0x0898('0x1e')];this[_0x0898('0x1f')]=_0xc07829[_0x0898('0x1f')];this['ListId']=_0xc07829[_0x0898('0x20')];this['UserId']=_0xc07829[_0x0898('0x21')];this['VoiceQueueId']=_0xc07829[_0x0898('0x22')];this['CampaignId']=_0xc07829[_0x0898('0x23')];this[_0x0898('0x24')]=_0xc07829[_0x0898('0x24')]||'';this['originatecalleridname']=_0xc07829['originatecalleridname']||'';}module[_0x0898('0x25')]=AgentComplete; \ No newline at end of file +var _0x33ba=['calleridnum','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','holdtime','talktime','membername','reason','callback','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','calleridname','name'];(function(_0x2650e9,_0xb91cc){var _0x3511c8=function(_0x5069cf){while(--_0x5069cf){_0x2650e9['push'](_0x2650e9['shift']());}};_0x3511c8(++_0xb91cc);}(_0x33ba,0xfe));var _0xa33b=function(_0x47d69d,_0x2faf40){_0x47d69d=_0x47d69d-0x0;var _0x6b89d3=_0x33ba[_0x47d69d];return _0x6b89d3;};'use strict';var util=require(_0xa33b('0x0'));var _=require(_0xa33b('0x1'));var moment=require(_0xa33b('0x2'));function getSeconds(_0x265898,_0x1d2acb){var _0x472271=moment(_0x265898)[_0xa33b('0x3')](0x0);var _0x79292a=moment(_0x1d2acb)[_0xa33b('0x3')](0x0);return _0x472271[_0xa33b('0x4')](_0x79292a,_0xa33b('0x5'));}function AgentComplete(_0xaf5f0,_0x59460f){this[_0xa33b('0x6')]=0x4;this['statedesc']=_0xa33b('0x7');this[_0xa33b('0x8')]=_0xaf5f0[_0xa33b('0x8')];this[_0xa33b('0x9')]=_0xaf5f0[_0xa33b('0x9')];this[_0xa33b('0xa')]=_0xaf5f0[_0xa33b('0x9')]===_0xa33b('0xb')?_0xa33b('0xc'):_0xaf5f0[_0xa33b('0x9')];this[_0xa33b('0xd')]=_0xaf5f0[_0xa33b('0xd')];this[_0xa33b('0xe')]=_0xaf5f0[_0xa33b('0xe')];this['countnoanswerretry']=_0xaf5f0['countnoanswerretry'];this['countglobal']=_0xaf5f0[_0xa33b('0xd')]+_0xaf5f0[_0xa33b('0xe')]+_0xaf5f0[_0xa33b('0xf')];this['uniqueid']=_0x59460f[_0xa33b('0x10')];this[_0xa33b('0x11')]=_0xaf5f0[_0xa33b('0x12')];this[_0xa33b('0x13')]=_0xaf5f0['number'];this['starttime']=_0xaf5f0['starttime'];this[_0xa33b('0x14')]=_0xaf5f0[_0xa33b('0x14')];this[_0xa33b('0x15')]=_0xaf5f0['answertime'];this[_0xa33b('0x16')]=moment()[_0xa33b('0x17')](_0xa33b('0x18'));this[_0xa33b('0x19')]=getSeconds(_0xaf5f0['responsetime'],_0xaf5f0[_0xa33b('0x1a')]);this[_0xa33b('0x1b')]=getSeconds(_0xaf5f0['answertime'],_0xaf5f0[_0xa33b('0x14')]);this[_0xa33b('0x1c')]=getSeconds(this[_0xa33b('0x16')],_0xaf5f0['answertime']);this[_0xa33b('0xc')]=_0x59460f[_0xa33b('0xc')];this[_0xa33b('0x1d')]=_0x59460f[_0xa33b('0x1d')];this['reason']=_0x59460f[_0xa33b('0x1e')];this[_0xa33b('0x1f')]=_0xaf5f0[_0xa33b('0x1f')];this['callbackuniqueid']=_0xaf5f0['callbackuniqueid'];this['callbackat']=_0xaf5f0[_0xa33b('0x20')];this[_0xa33b('0x21')]=_0xaf5f0[_0xa33b('0x21')];this['ContactId']=_0xaf5f0[_0xa33b('0x22')];this['ListId']=_0xaf5f0['ListId'];this[_0xa33b('0x23')]=_0xaf5f0[_0xa33b('0x23')];this[_0xa33b('0x24')]=_0xaf5f0[_0xa33b('0x24')];this['CampaignId']=_0xaf5f0[_0xa33b('0x25')];this['originatecalleridnum']=_0xaf5f0['originatecalleridnum']||'';this[_0xa33b('0x26')]=_0xaf5f0[_0xa33b('0x26')]||'';}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index c635b74..9f77a5e 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 _0x110e=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','starttime','endtime','ringtime','holdtime','talktime','callback'];(function(_0xadba8a,_0x4c6fb1){var _0x36f4c8=function(_0x4d7fe1){while(--_0x4d7fe1){_0xadba8a['push'](_0xadba8a['shift']());}};_0x36f4c8(++_0x4c6fb1);}(_0x110e,0x68));var _0xe110=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x110e[_0x565ed7];return _0x183ad7;};'use strict';var util=require(_0xe110('0x0'));var _=require(_0xe110('0x1'));var moment=require('moment');function getSeconds(_0x1a21dd,_0x2a7c73){var _0x2a4965=moment(_0x1a21dd)[_0xe110('0x2')](0x0);var _0x3f8825=moment(_0x2a7c73)['milliseconds'](0x0);return _0x2a4965['diff'](_0x3f8825,'seconds');}function Final(_0x5b82b3){this[_0xe110('0x3')]=_0x5b82b3['uniqueid'];this[_0xe110('0x4')]=_0x5b82b3[_0xe110('0x4')];this[_0xe110('0x5')]=_0x5b82b3[_0xe110('0x5')];this[_0xe110('0x6')]=_0x5b82b3[_0xe110('0x5')]===_0xe110('0x7')?_0xe110('0x8'):_0x5b82b3[_0xe110('0x5')];this['countbusyretry']=_0x5b82b3[_0xe110('0x9')];this[_0xe110('0xa')]=_0x5b82b3['countcongestionretry'];this[_0xe110('0xb')]=_0x5b82b3[_0xe110('0xb')];this[_0xe110('0xc')]=_0x5b82b3[_0xe110('0x9')]+_0x5b82b3['countcongestionretry']+_0x5b82b3['countnoanswerretry'];this['queue']=_0x5b82b3[_0xe110('0x8')];this[_0xe110('0xd')]=_0x5b82b3['calleridname'];this['calleridnum']=_0x5b82b3['calleridnum'];this[_0xe110('0xe')]=_0x5b82b3[_0xe110('0xe')];this['responsetime']=_0x5b82b3['responsetime'];this[_0xe110('0xf')]=_0x5b82b3['responsetime'];this[_0xe110('0x10')]=_0x5b82b3[_0xe110('0x10')]||0x0;this[_0xe110('0x11')]=_0x5b82b3[_0xe110('0x11')]||0x0;this['talktime']=_0x5b82b3[_0xe110('0x12')]||0x0;this[_0xe110('0x13')]=_0x5b82b3['callback'];this['callbackuniqueid']=_0x5b82b3[_0xe110('0x14')];this['callbackat']=_0x5b82b3[_0xe110('0x15')];this[_0xe110('0x16')]=_0x5b82b3['recallme'];this[_0xe110('0x17')]=_0x5b82b3[_0xe110('0x17')];this[_0xe110('0x18')]=_0x5b82b3[_0xe110('0x18')];this[_0xe110('0x19')]=_0x5b82b3['UserId'];this[_0xe110('0x1a')]=_0x5b82b3[_0xe110('0x1a')];this['CampaignId']=_0x5b82b3[_0xe110('0x1b')];this[_0xe110('0x1c')]=_0x5b82b3[_0xe110('0x1c')]||'';this[_0xe110('0x1d')]=_0x5b82b3[_0xe110('0x1d')]||'';}module[_0xe110('0x1e')]=Final; \ No newline at end of file +var _0xe953=['scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid'];(function(_0x2c91a1,_0x43585e){var _0x3b56df=function(_0x3fd69d){while(--_0x3fd69d){_0x2c91a1['push'](_0x2c91a1['shift']());}};_0x3b56df(++_0x43585e);}(_0xe953,0xf9));var _0x3e95=function(_0x31991b,_0xaf75d2){_0x31991b=_0x31991b-0x0;var _0x307304=_0xe953[_0x31991b];return _0x307304;};'use strict';var util=require(_0x3e95('0x0'));var _=require(_0x3e95('0x1'));var moment=require(_0x3e95('0x2'));function getSeconds(_0x4ab01c,_0x8dbd4f){var _0x1762e9=moment(_0x4ab01c)[_0x3e95('0x3')](0x0);var _0x30e34e=moment(_0x8dbd4f)[_0x3e95('0x3')](0x0);return _0x1762e9[_0x3e95('0x4')](_0x30e34e,_0x3e95('0x5'));}function Final(_0x57fc59){this['uniqueid']=_0x57fc59[_0x3e95('0x6')];this['scheduledat']=_0x57fc59[_0x3e95('0x7')];this['type']=_0x57fc59[_0x3e95('0x8')];this[_0x3e95('0x9')]=_0x57fc59['type']==='outbound'?_0x3e95('0xa'):_0x57fc59['type'];this[_0x3e95('0xb')]=_0x57fc59['countbusyretry'];this['countcongestionretry']=_0x57fc59[_0x3e95('0xc')];this[_0x3e95('0xd')]=_0x57fc59[_0x3e95('0xd')];this['countglobal']=_0x57fc59[_0x3e95('0xb')]+_0x57fc59[_0x3e95('0xc')]+_0x57fc59[_0x3e95('0xd')];this[_0x3e95('0xa')]=_0x57fc59[_0x3e95('0xa')];this['calleridname']=_0x57fc59[_0x3e95('0xe')];this[_0x3e95('0xf')]=_0x57fc59[_0x3e95('0xf')];this['starttime']=_0x57fc59[_0x3e95('0x10')];this[_0x3e95('0x11')]=_0x57fc59[_0x3e95('0x11')];this[_0x3e95('0x12')]=_0x57fc59[_0x3e95('0x11')];this[_0x3e95('0x13')]=_0x57fc59[_0x3e95('0x13')]||0x0;this['holdtime']=_0x57fc59[_0x3e95('0x14')]||0x0;this[_0x3e95('0x15')]=_0x57fc59[_0x3e95('0x15')]||0x0;this['callback']=_0x57fc59[_0x3e95('0x16')];this[_0x3e95('0x17')]=_0x57fc59[_0x3e95('0x17')];this['callbackat']=_0x57fc59['callbackat'];this[_0x3e95('0x18')]=_0x57fc59['recallme'];this['ContactId']=_0x57fc59[_0x3e95('0x19')];this['ListId']=_0x57fc59[_0x3e95('0x1a')];this[_0x3e95('0x1b')]=_0x57fc59[_0x3e95('0x1b')];this['VoiceQueueId']=_0x57fc59[_0x3e95('0x1c')];this['CampaignId']=_0x57fc59[_0x3e95('0x1d')];this[_0x3e95('0x1e')]=_0x57fc59[_0x3e95('0x1e')]||'';this['originatecalleridname']=_0x57fc59['originatecalleridname']||'';}module[_0x3e95('0x1f')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 99d9550..812671b 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 _0x9957=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds'];(function(_0x4bcbf5,_0x36ed34){var _0x213a72=function(_0x11212f){while(--_0x11212f){_0x4bcbf5['push'](_0x4bcbf5['shift']());}};_0x213a72(++_0x36ed34);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('0x25')]=Hangup; \ No newline at end of file +var _0x9957=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds'];(function(_0x5422e8,_0x2d975a){var _0x1b69c6=function(_0x1977ce){while(--_0x1977ce){_0x5422e8['push'](_0x5422e8['shift']());}};_0x1b69c6(++_0x2d975a);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('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 a17f5ca..2426758 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 _0x54cd=['originatecalleridname','util','lodash','milliseconds','diff','seconds','uniqueid','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','calleridname','calleridnum','starttime','responsetime','endtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x19e935,_0x435d18){var _0x2eb371=function(_0xa43b33){while(--_0xa43b33){_0x19e935['push'](_0x19e935['shift']());}};_0x2eb371(++_0x435d18);}(_0x54cd,0xaf));var _0xd54c=function(_0x2554a0,_0x5822d9){_0x2554a0=_0x2554a0-0x0;var _0x3a77b8=_0x54cd[_0x2554a0];return _0x3a77b8;};'use strict';var util=require(_0xd54c('0x0'));var _=require(_0xd54c('0x1'));var moment=require('moment');function getSeconds(_0x3bb649,_0x5a2af7){var _0x9f75d2=moment(_0x3bb649)[_0xd54c('0x2')](0x0);var _0x1e6266=moment(_0x5a2af7)[_0xd54c('0x2')](0x0);return _0x9f75d2[_0xd54c('0x3')](_0x1e6266,_0xd54c('0x4'));}function History(_0x4845cb){this[_0xd54c('0x5')]=_0x4845cb[_0xd54c('0x5')];this['scheduledat']=_0x4845cb['scheduledat']||undefined;this[_0xd54c('0x6')]=_0x4845cb['type'];this[_0xd54c('0x7')]=_0x4845cb[_0xd54c('0x6')]===_0xd54c('0x8')?_0xd54c('0x9'):_0x4845cb['type'];this['countbusyretry']=_0x4845cb[_0xd54c('0xa')];this[_0xd54c('0xb')]=_0x4845cb[_0xd54c('0xb')];this[_0xd54c('0xc')]=_0x4845cb['countnoanswerretry'];this['countglobal']=_0x4845cb[_0xd54c('0xa')]+_0x4845cb[_0xd54c('0xb')]+_0x4845cb[_0xd54c('0xc')];this[_0xd54c('0x9')]=_0x4845cb[_0xd54c('0x9')];this[_0xd54c('0xd')]=_0x4845cb['name'];this[_0xd54c('0xe')]=_0x4845cb['number'];this[_0xd54c('0xf')]=_0x4845cb['starttime'];this['responsetime']=_0x4845cb[_0xd54c('0x10')];this[_0xd54c('0x11')]=_0x4845cb[_0xd54c('0x10')];this['ringtime']=getSeconds(_0x4845cb[_0xd54c('0x10')],_0x4845cb['starttime']);this['holdtime']=0x0;this['talktime']=0x0;this[_0xd54c('0x12')]=_0x4845cb[_0xd54c('0x12')];this[_0xd54c('0x13')]=_0x4845cb[_0xd54c('0x13')];this[_0xd54c('0x14')]=_0x4845cb[_0xd54c('0x14')];this['recallme']=_0x4845cb[_0xd54c('0x15')];this[_0xd54c('0x16')]=_0x4845cb[_0xd54c('0x16')];this[_0xd54c('0x17')]=_0x4845cb[_0xd54c('0x17')];this[_0xd54c('0x18')]=_0x4845cb[_0xd54c('0x18')];this[_0xd54c('0x19')]=_0x4845cb['VoiceQueueId'];this[_0xd54c('0x1a')]=_0x4845cb['CampaignId'];this[_0xd54c('0x1b')]=_0x4845cb[_0xd54c('0x1b')]||'';this[_0xd54c('0x1c')]=_0x4845cb[_0xd54c('0x1c')]||'';}module['exports']=History; \ No newline at end of file +var _0xb409=['util','moment','milliseconds','diff','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','name','calleridnum','number','responsetime','ringtime','starttime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports'];(function(_0x319fe6,_0x4430a8){var _0x4ebd83=function(_0x55237d){while(--_0x55237d){_0x319fe6['push'](_0x319fe6['shift']());}};_0x4ebd83(++_0x4430a8);}(_0xb409,0x14a));var _0x9b40=function(_0x519abb,_0x4d3f5b){_0x519abb=_0x519abb-0x0;var _0x48d4d6=_0xb409[_0x519abb];return _0x48d4d6;};'use strict';var util=require(_0x9b40('0x0'));var _=require('lodash');var moment=require(_0x9b40('0x1'));function getSeconds(_0x67d9b8,_0x42f0f0){var _0x2d496c=moment(_0x67d9b8)[_0x9b40('0x2')](0x0);var _0x2b444d=moment(_0x42f0f0)['milliseconds'](0x0);return _0x2d496c[_0x9b40('0x3')](_0x2b444d,'seconds');}function History(_0x41537e){this[_0x9b40('0x4')]=_0x41537e[_0x9b40('0x4')];this[_0x9b40('0x5')]=_0x41537e[_0x9b40('0x5')]||undefined;this[_0x9b40('0x6')]=_0x41537e['type'];this['campaigntype']=_0x41537e[_0x9b40('0x6')]===_0x9b40('0x7')?_0x9b40('0x8'):_0x41537e[_0x9b40('0x6')];this[_0x9b40('0x9')]=_0x41537e['countbusyretry'];this[_0x9b40('0xa')]=_0x41537e[_0x9b40('0xa')];this[_0x9b40('0xb')]=_0x41537e[_0x9b40('0xb')];this[_0x9b40('0xc')]=_0x41537e[_0x9b40('0x9')]+_0x41537e['countcongestionretry']+_0x41537e[_0x9b40('0xb')];this[_0x9b40('0x8')]=_0x41537e['queue'];this['calleridname']=_0x41537e[_0x9b40('0xd')];this[_0x9b40('0xe')]=_0x41537e[_0x9b40('0xf')];this['starttime']=_0x41537e['starttime'];this[_0x9b40('0x10')]=_0x41537e[_0x9b40('0x10')];this['endtime']=_0x41537e['responsetime'];this[_0x9b40('0x11')]=getSeconds(_0x41537e[_0x9b40('0x10')],_0x41537e[_0x9b40('0x12')]);this[_0x9b40('0x13')]=0x0;this[_0x9b40('0x14')]=0x0;this[_0x9b40('0x15')]=_0x41537e[_0x9b40('0x15')];this[_0x9b40('0x16')]=_0x41537e[_0x9b40('0x16')];this[_0x9b40('0x17')]=_0x41537e['callbackat'];this[_0x9b40('0x18')]=_0x41537e['recallme'];this[_0x9b40('0x19')]=_0x41537e['ContactId'];this['ListId']=_0x41537e[_0x9b40('0x1a')];this[_0x9b40('0x1b')]=_0x41537e[_0x9b40('0x1b')];this[_0x9b40('0x1c')]=_0x41537e['VoiceQueueId'];this['CampaignId']=_0x41537e[_0x9b40('0x1d')];this[_0x9b40('0x1e')]=_0x41537e[_0x9b40('0x1e')]||'';this['originatecalleridname']=_0x41537e[_0x9b40('0x1f')]||'';}module[_0x9b40('0x20')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index f871068..219af02 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 _0x990b=['NoAnswer','countglobal','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','[syncAgentComplete][createHistory][?]','Global','Success','contact\x20not\x20moved','outboundDropCallsDayTimeout','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','agentBusyFactor','dialPredictiveOptimizationPercentage','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','predictiveIntervalPauses','abandonmentRate','busyFactor','[CatchErlangB]','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','temp','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','loggerHandler','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','tryOriginatePredictive','[handlePredictive][limitChannel]','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment/','booked','../../../config/logger','predictive','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./final','./hangup','env','XCALLY_IP_AGI','roundrobin','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','queuecallerabandon','bind','agentcomplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','Error','stringify','milliseconds','diff','seconds','type','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','format','voice:queue:%s','campaign:ivr:%s','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','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','predictiveIntervalTotalCalls','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\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','isUndefined','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','isEmpty','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','stack','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','prototype','loopClearZombieChannels','clearZombieChannels','[uniqueid]','actions','[actions]','isNil','Action','status','catch','No\x20such\x20channel','queue','[Dialer][checkChannel]','updateOriginated','countReScheduled','then','[countReScheduled]\x20','checkIsBlackList','resolve','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','saveInDb','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','SIP/%s','unmonitored','uniqueid','variable','amdstatus','exten','dialAMDActive','value','HangupInAMD','AMD','[syncHangupInAMD][createHistory]','MACHINE','Machine','[syncMachine]','HANGUP','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','membername','amd','[syncMachineIvr][createHistory]','[syncMachineIvr]','AnswerAGI','AGI','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','Unknow','syncAgentComplete','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','syncQueueCallerAbandon','droptime','Drop','dropreason','TIMEOUT','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','channel','actionid','locked','paused','stateinterface','rrmemory','queueBooked','push','pick','idHopper','[booked][unlockQueueStatus]','queueStatusComplete','run','ListId','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','[Catch][Preview][syncQueueStatusComplete]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','content','true','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','progressive','handlePower','power','dialPowerLevel','method\x20not\x20recognized','launchHandleIvr','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','checkIfTimeIntervals','[syncCampaigns]','\x5cw{0,','pow','random','match','originate','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','tags','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','callerid','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','substring','dialCutDigit','from-sip','[originateError]:\x20%s','OriginateError','starttime','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','responsetime','getQueue','response','[callProgressDetecting]\x20','checkRetriveMax','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','countbusyretry','dialBusyMaxRetry','minutes','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','callProgressDetecting','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','outboundNoAnswerCallsDay'];(function(_0x22ee1e,_0x3eff80){var _0x49a5c9=function(_0x373480){while(--_0x373480){_0x22ee1e['push'](_0x22ee1e['shift']());}};_0x49a5c9(++_0x3eff80);}(_0x990b,0x67));var _0xb990=function(_0x336edb,_0x2ac146){_0x336edb=_0x336edb-0x0;var _0x26a97f=_0x990b[_0x336edb];return _0x26a97f;};'use strict';var util=require('util');var _=require(_0xb990('0x0'));var BPromise=require(_0xb990('0x1'));var uuid=require(_0xb990('0x2'));var moment=require(_0xb990('0x3'));var rr=require('rr');var md5=require(_0xb990('0x4'));var Redis=require(_0xb990('0x5'));var config=require(_0xb990('0x6'));var logger=require('../../../config/logger')('dialer');var loggerBooked=require('../../../config/logger')(_0xb990('0x7'));var loggerPredictive=require(_0xb990('0x8'))(_0xb990('0x9'));var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require(_0xb990('0x8'))(_0xb990('0xa'));var ami=require(_0xb990('0xb'));config[_0xb990('0xc')]=_[_0xb990('0xd')](config[_0xb990('0xc')],{'host':_0xb990('0xe'),'port':0x18eb});var io=require(_0xb990('0xf'))(new Redis(config[_0xb990('0xc')]));var cmHopper=require(_0xb990('0x10'));var cmHopperFinal=require(_0xb990('0x11'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xb990('0x12'));var voiceQueueRt=require(_0xb990('0x13'));var Action=require(_0xb990('0x14'));var History=require('./history');var Final=require(_0xb990('0x15'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0xb990('0x16'));var ipAgi=process[_0xb990('0x17')][_0xb990('0x18')]||'127.0.0.1';var strategy={'rrmemory':'rrmemory','roundrobin':_0xb990('0x19')};var Sequence=function(){};Sequence['prototype'][_0xb990('0x1a')]=function(_0x391acf){this[_0xb990('0x1b')]=this['tail']?this[_0xb990('0x1b')][_0xb990('0x1c')](_0x391acf):_0x391acf();};function Dialer(_0x5dba64,_0x50b1c3){this[_0xb990('0x1d')]=new Sequence();this[_0xb990('0x1e')]=_0x50b1c3;this['voiceQueues']=_0x5dba64[_0xb990('0x1f')];this[_0xb990('0x20')]=_0x5dba64[_0xb990('0x20')];this['agents']=_0x5dba64[_0xb990('0x21')];this[_0xb990('0x22')]=_0x5dba64['trunks'];this[_0xb990('0x23')]=config[_0xb990('0x23')]||0x2;this[_0xb990('0x24')]={};this['actions']={};this[_0xb990('0x25')]={};this[_0xb990('0x26')]={};this[_0xb990('0x27')]={};this['startPredictive']={};this[_0xb990('0x28')]={};this[_0xb990('0x29')]={};this['queueBooked']={};this[_0xb990('0x2a')]={};ami['on'](_0xb990('0x2b'),this['syncAgentConnect']['bind'](this));ami['on'](_0xb990('0x2c'),this['syncQueueCallerAbandon'][_0xb990('0x2d')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0xb990('0x2d')](this));ami['on'](_0xb990('0x2e'),this['syncAgentComplete'][_0xb990('0x2d')](this));ami['on']('custom:queuesummary',this[_0xb990('0xa')]['bind'](this));ami['on'](_0xb990('0x2f'),this[_0xb990('0x30')][_0xb990('0x2d')](this));ami['on'](_0xb990('0x31'),this[_0xb990('0x32')][_0xb990('0x2d')](this));ami['on'](_0xb990('0x33'),this[_0xb990('0x34')][_0xb990('0x2d')](this));ami['on'](_0xb990('0x35'),this[_0xb990('0x36')][_0xb990('0x2d')](this));ami['on'](_0xb990('0x37'),this[_0xb990('0x38')][_0xb990('0x2d')](this));this[_0xb990('0x39')]();this['loopClearZombieChannels']();}function isNotNull(_0x97218c){return _0x97218c!==null&&!_['isUndefined'](_0x97218c);}function checkIsLoggedIn(_0x242964,_0x3d9a2b){return function(){if(_0x3d9a2b<=0x0){_0x242964[_0xb990('0x3a')]='AGENTS_NOT_LOGGED';throw _0x242964[_0xb990('0x3b')]+_0xb990('0x3c');}};}function isActive(_0x3dceb7){return _0x3dceb7;}function checkIsActive(_0x1d2bfa,_0x3f5ff1){return function(){if(!isActive(_0x3f5ff1)){_0x1d2bfa[_0xb990('0x3a')]=_0xb990('0x3d');throw _0x1d2bfa[_0xb990('0x3b')]+'\x20NOT\x20Active';}};}function checkInterval(_0x10bff0){return function(){if(!isNotNull(_0x10bff0[_0xb990('0x3e')])){_0x10bff0[_0xb990('0x3a')]=_0xb990('0x3f');throw _0x10bff0['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x10bff0[_0xb990('0x3e')][_0xb990('0x40')])){_0x10bff0[_0xb990('0x3a')]=_0xb990('0x3f');throw _0x10bff0[_0xb990('0x3b')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0x10bff0['Interval'][_0xb990('0x40')]))){_0x10bff0['message']=_0xb990('0x3f');throw _0x10bff0['name']+_0xb990('0x41');}};}function msgResponse(_0x7e4031,_0x5eee98,_0x4a0b9d){return{'action':_0x7e4031,'response':_0x5eee98,'message':_0x4a0b9d,'stack':_0x4a0b9d};}function myreject(_0x120fad){return function(_0x3976a5){return _0x120fad(msgResponse('[ifTime][Action]',_0xb990('0x42'),JSON[_0xb990('0x43')](_0x3976a5)));};}function getSeconds(_0x5dd221,_0x5b4eb9){var _0x58972b=moment(_0x5dd221)[_0xb990('0x44')](0x0);var _0xcb3cb6=moment(_0x5b4eb9)[_0xb990('0x44')](0x0);return _0x58972b[_0xb990('0x45')](_0xcb3cb6,_0xb990('0x46'));}function emit(_0x2cc631,_0x1989c4,_0x28a122){io['to'](_0x2cc631)['emit'](_0x1989c4,_0x28a122);}function emitVoiceQueueSummary(_0x4442ac){if(_0x4442ac[_0xb990('0x47')]===_0xb990('0x48')){var _0x323b7e={'id':_0x4442ac['id'],'name':_0x4442ac[_0xb990('0x3b')],'strategy':_0x4442ac[_0xb990('0x49')],'answered':_0x4442ac['answered'],'available':_0x4442ac[_0xb990('0x4a')],'loggedIn':_0x4442ac[_0xb990('0x4b')],'pTalking':_0x4442ac[_0xb990('0x4c')],'sumBillable':_0x4442ac[_0xb990('0x4d')],'sumDuration':_0x4442ac[_0xb990('0x4e')],'sumHoldTime':_0x4442ac[_0xb990('0x4f')]||0x0,'talking':_0x4442ac[_0xb990('0x50')],'total':_0x4442ac[_0xb990('0x51')],'type':_0x4442ac[_0xb990('0x47')],'unmanaged':_0x4442ac[_0xb990('0x52')],'abandoned':_0x4442ac['abandoned'],'waiting':_0x4442ac[_0xb990('0x53')],'loggedInDb':_0x4442ac[_0xb990('0x54')],'dialActive':_0x4442ac[_0xb990('0x55')],'dialMethod':_0x4442ac[_0xb990('0x56')],'dialOriginateCallerIdName':_0x4442ac['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x4442ac[_0xb990('0x57')],'dialOriginateTimeout':_0x4442ac[_0xb990('0x58')],'dialPrefix':_0x4442ac[_0xb990('0x59')],'outboundAnswerAgiCallsDay':_0x4442ac[_0xb990('0x5a')],'outboundAnswerCallsDay':_0x4442ac[_0xb990('0x5b')],'outboundBlacklistCallsDay':_0x4442ac[_0xb990('0x5c')],'outboundBusyCallsDay':_0x4442ac[_0xb990('0x5d')],'outboundCongestionCallsDay':_0x4442ac[_0xb990('0x5e')],'outboundDropCallsDayACS':_0x4442ac[_0xb990('0x5f')],'outboundDropCallsDayCallersExit':_0x4442ac['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x4442ac['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x4442ac['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x4442ac[_0xb990('0x60')],'outboundOriginateFailureCallsDay':_0x4442ac[_0xb990('0x61')],'outboundReCallsDay':_0x4442ac[_0xb990('0x62')],'outboundRejectCallsDay':_0x4442ac[_0xb990('0x63')],'outboundUnknownCallsDay':_0x4442ac[_0xb990('0x64')],'predictiveIntervalAnsweredCalls':_0x4442ac[_0xb990('0x65')],'predictiveIntervalAvgHoldtime':_0x4442ac[_0xb990('0x66')],'predictiveIntervalAvgTalktime':_0x4442ac[_0xb990('0x67')],'predictiveIntervalDroppedCallsCallersExit':_0x4442ac[_0xb990('0x68')],'predictiveIntervalDroppedCallsTimeout':_0x4442ac[_0xb990('0x69')],'predictiveIntervalErlangCalls':_0x4442ac[_0xb990('0x6a')],'predictiveIntervalErlangCallsDroppedCalls':_0x4442ac[_0xb990('0x6b')],'predictiveIntervalHitRate':_0x4442ac[_0xb990('0x6c')],'predictiveIntervalMultiplicativeFactor':_0x4442ac['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x4442ac['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x4442ac['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x4442ac['predictiveIntervalTotalCalls'],'message':_0x4442ac[_0xb990('0x3a')],'originated':_0x4442ac[_0xb990('0x6d')],'erlangCalls':_0x4442ac[_0xb990('0x6e')],'erlangCallToSecond':_0x4442ac[_0xb990('0x6f')],'erlangAbandonmentRate':_0x4442ac[_0xb990('0x70')],'erlangBusyFactor':_0x4442ac[_0xb990('0x71')],'startPredictive':_0x4442ac[_0xb990('0x72')],'startProgressive':_0x4442ac[_0xb990('0x28')]};if(_0x4442ac[_0xb990('0x73')]){_0x323b7e['Trunk']={'id':_0x4442ac['Trunk']['id'],'name':_0x4442ac[_0xb990('0x73')][_0xb990('0x3b')],'active':_0x4442ac['Trunk'][_0xb990('0x74')],'callerid':_0x4442ac[_0xb990('0x73')]['callerid']};}if(_0x4442ac['Interval']){_0x323b7e[_0xb990('0x3e')]={'id':_0x4442ac['Interval']['id'],'name':_0x4442ac[_0xb990('0x3e')][_0xb990('0x3b')]};}var _0x1073f9=md5(JSON[_0xb990('0x43')](_0x323b7e));if(_0x4442ac[_0xb990('0x4')]!==_0x1073f9){_0x4442ac[_0xb990('0x4')]=_0x1073f9;emit(util[_0xb990('0x75')](_0xb990('0x76'),_0x323b7e[_0xb990('0x3b')]),'voice_queue:save',_0x323b7e);}}}function emitCampaignSummary(_0x5b2c55){if(_0x5b2c55[_0xb990('0x47')]==='ivr'){emit(util[_0xb990('0x75')](_0xb990('0x77'),_0x5b2c55[_0xb990('0x3b')]),_0xb990('0x78'),_0x5b2c55);}}function checkGetDataPredictive(_0x64e821){if(isNotNull(_0x64e821)){if(!_['isEmpty'](_0x64e821)){loggerPredictive[_0xb990('0x79')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive['info'](_0xb990('0x7a'),_0x64e821['predictiveIntervalTotalCalls']);loggerPredictive[_0xb990('0x79')](_0xb990('0x7b'),_0x64e821[_0xb990('0x65')]);loggerPredictive[_0xb990('0x79')](_0xb990('0x7c'),_0x64e821[_0xb990('0x69')]);loggerPredictive[_0xb990('0x79')](_0xb990('0x7d'),_0x64e821[_0xb990('0x68')]);loggerPredictive[_0xb990('0x79')](_0xb990('0x7e'),_0x64e821[_0xb990('0x66')]);loggerPredictive['info'](_0xb990('0x7f'),_0x64e821[_0xb990('0x67')]);loggerPredictive[_0xb990('0x79')]('---------------------------');if(_0x64e821[_0xb990('0x80')]>0x0){if(!_['isUndefined'](_0x64e821[_0xb990('0x67')])&&_0x64e821['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive['info'](_0xb990('0x81'));}if(!_['isUndefined'](_0x64e821[_0xb990('0x66')])&&_0x64e821[_0xb990('0x66')]>0x0){return!![];}else{loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xb990('0x79')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xb990('0x79')](_0xb990('0x82'));}}else{loggerPredictive[_0xb990('0x79')](_0xb990('0x82'));}return![];}function mergeDataErlangB(_0x59663a){return function(_0xba5c61){loggerPredictive['info'](_0xb990('0x83'));loggerPredictive[_0xb990('0x79')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xba5c61[_0xb990('0x6e')]);loggerPredictive['info'](_0xb990('0x84'),_0xba5c61[_0xb990('0x6f')]);loggerPredictive[_0xb990('0x79')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xba5c61['erlangAbandonmentRate']);loggerPredictive['info'](_0xb990('0x85'),_0xba5c61[_0xb990('0x71')]);loggerPredictive[_0xb990('0x79')](_0xb990('0x86'),_0xba5c61['erlangAbandonmentRate']);loggerPredictive[_0xb990('0x79')]('---------------------------');_[_0xb990('0x87')](_0x59663a,_0xba5c61);};}function getDiff(_0x18768d){var _0x59e631=moment()[_0xb990('0x44')](0x0);var _0x582703=moment(_0x18768d)['milliseconds'](0x0);return _0x59e631['diff'](_0x582703,'seconds');}function ifInterval(_0x2f3d03,_0x525312){if(_[_0xb990('0x88')](_0x525312)){return![];}if(getDiff(_0x525312)<_0x2f3d03*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0xfc6215){if(isNotNull(_0xfc6215)){if(!_[_0xb990('0x88')](_0xfc6215[_0xb990('0x28')])){_0xfc6215['startProgressive']=undefined;loggerPredictive['info'](_0xfc6215[_0xb990('0x3b')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0xb990('0x88')](_0xfc6215['startPredictive'])){_0xfc6215[_0xb990('0x72')]=undefined;loggerPredictive['info'](_0xfc6215[_0xb990('0x3b')],_0xb990('0x89'));}if(!_['isUndefined'](_0xfc6215[_0xb990('0x8a')])){clearInterval(_0xfc6215[_0xb990('0x8a')]);_0xfc6215['handlePredictive']=undefined;loggerPredictive[_0xb990('0x79')](_0xfc6215['name'],_0xb990('0x8b'));}}}function erlangb(_0x5b4b61,_0x51e2c7){if(_0x51e2c7===0x0){return 0x0;}var _0x202291=0x1;for(var _0x1d5391=0x1;_0x1d5391<=_0x51e2c7;_0x1d5391+=0x1){_0x202291=0x1+_0x202291*_0x1d5391/_0x5b4b61;}return 0x1/_0x202291;}function isVoiceQueueOutbound(_0x5bee45){return _0x5bee45===_0xb990('0x48');}function isNotPreview(_0x121258){return _0x121258!==_0xb990('0x1e');}function isCampaignIvr(_0x903d83){return _0x903d83===_0xb990('0x8c');}function getCallerId(_0x58fcc8,_0x1b28b0,_0xc81d7d){if(!_[_0xb990('0x88')](_0xc81d7d)&&_0xb990('0x8d')===typeof _0xc81d7d&&!_[_0xb990('0x8e')](_0xc81d7d)){if(!_[_0xb990('0x88')](_0x1b28b0)&&'string'===typeof _0x1b28b0&&!_['isEmpty'](_0x1b28b0)){return util['format'](_0xb990('0x8f'),_0x1b28b0,_0xc81d7d);}return util['format'](_0xb990('0x8f'),_0xc81d7d,_0xc81d7d);}if(!_[_0xb990('0x88')](_0x58fcc8)&&_0xb990('0x8d')===typeof _0x58fcc8&&!_[_0xb990('0x8e')](_0x58fcc8)){return _0x58fcc8;}return _0xb990('0x90');}function loggerCatchQueueSummary(_0x25925d,_0x3d4ec4){return function(_0x3a6779){freeVariablesPredictive(_0x3d4ec4);emitVoiceQueueSummary(_0x3d4ec4);emitCampaignSummary(_0x3d4ec4);loggerSyncQueueSummary['error'](_0x25925d,util[_0xb990('0x91')](_0x3a6779,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1999c0,_0x2e21d9){return function(_0x1065b7){loggerPredictive[_0xb990('0x92')](_0x2e21d9[_0xb990('0x3b')],_0x1999c0);loggerPredictive[_0xb990('0x92')](_0x1065b7[_0xb990('0x93')]);freeVariablesPredictive(_0x2e21d9);};}function loggerCatch(_0x16f047){return function(_0x460fef){logger[_0xb990('0x92')](_0x16f047,util[_0xb990('0x91')](_0x460fef,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x179581){return _0x179581&&!_['isUndefined'](_0x179581)&&_0x179581['length']>0x0;}function decremetOriginate(_0xc65f52){if(!_[_0xb990('0x88')](_0xc65f52)&&_0xc65f52!==null){if(_0xc65f52[_0xb990('0x94')](_0xb990('0x6d'))){if(_0xc65f52[_0xb990('0x6d')]>0x0){_0xc65f52[_0xb990('0x6d')]-=0x1;}else{logger[_0xb990('0x92')](_0xb990('0x95'));}}}else{logger[_0xb990('0x92')](_0xb990('0x96'));}}function checkContactLowerLimitOriginate(_0x160554,_0x1f5d9b,_0x491877){if(_0x1f5d9b>_0x491877){for(var _0x3a5cd0=0x0;_0x3a5cd0<_0x1f5d9b-_0x491877;_0x3a5cd0+=0x1){decremetOriginate(_0x160554);}}}function loggerGetContactDialer(_0x591b43,_0x42f3cf,_0x34b892){return function(_0x4e52cd){checkContactLowerLimitOriginate(_0x42f3cf,_0x34b892,0x0);logger[_0xb990('0x92')](_0x591b43,util['inspect'](_0x4e52cd,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1a10e3){return function(_0x2ccdd5){if(isNotNull(_0x2ccdd5)&&isNotNull(_0x2ccdd5[0x0])){if(_0x2ccdd5[0x0][_0xb990('0x97')]>0x0){_0x1a10e3[_0xb990('0x3a')]='RESCHEDULED_CONTACTS';logger[_0xb990('0x79')](_0xb990('0x98')+_0x1a10e3['name'],_0x2ccdd5[0x0]['contactsRescheduled'],'contacts');}else{_0x1a10e3[_0xb990('0x3a')]=_0xb990('0x99');logger['info'](_0xb990('0x9a')+_0x1a10e3[_0xb990('0x3b')]);}}};}function notSendMessagesQueue(_0xb3c70c){if(_0xb3c70c['sendMessageOneNotActive']){freeVariablesPredictive(_0xb3c70c);if(_0xb3c70c[_0xb990('0x6d')]===0x0&&_0xb3c70c[_0xb990('0x50')]===0x0&&_0xb3c70c[_0xb990('0x53')]===0x0&&(_0xb3c70c[_0xb990('0x4c')]||0x0)===0x0){_0xb3c70c[_0xb990('0x9b')]=![];_0xb3c70c[_0xb990('0x4a')]=0x0;_0xb3c70c[_0xb990('0x3a')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xb990('0x92')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0xb3c70c['name'],_0xb990('0x9c'));}else{_0xb3c70c[_0xb990('0x3a')]=_0xb990('0x9d');loggerSyncQueueSummary[_0xb990('0x92')](_0xb990('0x9e'),_0xb3c70c[_0xb990('0x3b')],_0xb990('0x9f'));}emitVoiceQueueSummary(_0xb3c70c);}}function notSendMessagesCampaign(_0x11513f){if(_0x11513f['sendMessageOneNotActive']){if(_0x11513f['originated']===0x0){_0x11513f[_0xb990('0x9b')]=![];_0x11513f[_0xb990('0x3a')]=_0xb990('0x3d');loggerSyncQueueSummary[_0xb990('0x92')](_0xb990('0xa0'),_0x11513f['name'],'is\x20not\x20active');}else{_0x11513f[_0xb990('0x3a')]=_0xb990('0x9d');loggerSyncQueueSummary[_0xb990('0x92')](_0xb990('0xa0'),_0x11513f[_0xb990('0x3b')],_0xb990('0x9f'));}emitCampaignSummary(_0x11513f);}}function createObjHistory(_0x47f6f5,_0x1460a2,_0x21d209,_0x445a8a,_0x1a3a59){_0x47f6f5['message']=_0x21d209;var _0x84e0ec=new Action(_0x47f6f5,_0x1460a2);var _0x449349=new History(_0x84e0ec);_0x449349[_0xb990('0xa1')]=_0x445a8a;_0x449349[_0xb990('0xa2')]=_0x1a3a59;_0x449349[_0xb990('0xa3')]=_0x84e0ec['starttime'];return _0x449349;}Dialer[_0xb990('0xa4')][_0xb990('0xa5')]=function(){var _0xeffe1d=this;setInterval(function(){_0xeffe1d[_0xb990('0xa6')](_0xeffe1d['uniqueId'],_0xb990('0xa7'));_0xeffe1d[_0xb990('0xa6')](_0xeffe1d[_0xb990('0xa8')],_0xb990('0xa9'));},0x32c8);};Dialer[_0xb990('0xa4')][_0xb990('0xa6')]=function(_0x41b75f,_0x149d68){var _0x557afc=this;for(var _0x1aeeca in _0x41b75f){if(_0x41b75f['hasOwnProperty'](_0x1aeeca)){this['sequence'][_0xb990('0x1a')](function(){if(!_[_0xb990('0xaa')](_0x41b75f[_0x1aeeca])){return ami[_0xb990('0xab')]({'action':_0xb990('0xac'),'channel':_0x41b75f[_0x1aeeca]['channel']})[_0xb990('0xad')](function(_0x56e151){if(_0x56e151[_0xb990('0x3a')]===_0xb990('0xae')){setTimeout(function(){if(_0x41b75f[_0x1aeeca]&&_0x41b75f[_0x1aeeca][_0xb990('0x47')]!==_0xb990('0x8c')){_0x557afc['updateOriginated'](_0x557afc[_0xb990('0x1f')][_0x41b75f[_0x1aeeca][_0xb990('0xaf')]]);logger[_0xb990('0x92')](_0xb990('0xb0'),_0x149d68,_0x1aeeca,_0x41b75f[_0x1aeeca]['queue']);delete _0x41b75f[_0x1aeeca];}if(_0x41b75f[_0x1aeeca]&&_0x41b75f[_0x1aeeca][_0xb990('0x47')]==='ivr'){_0x557afc[_0xb990('0xb1')](_0x557afc['campaigns'][_0x41b75f[_0x1aeeca][_0xb990('0xaf')]]);logger[_0xb990('0x92')]('[Dialer][checkChannel][ivr]',_0x149d68,_0x1aeeca,_0x41b75f[_0x1aeeca]['queue']);delete _0x41b75f[_0x1aeeca];}},0x2328);}});}});}}};Dialer[_0xb990('0xa4')][_0xb990('0xb2')]=function(_0x41a42a){return BPromise['resolve']()[_0xb990('0xb3')](cmHopper[_0xb990('0xb2')](_0x41a42a))['catch'](loggerCatch(_0xb990('0xb4')));};Dialer[_0xb990('0xa4')][_0xb990('0xb5')]=function(_0xc1e0db){return BPromise[_0xb990('0xb6')]()[_0xb990('0xb3')](cmHopperBlack[_0xb990('0xb5')](_0xc1e0db))[_0xb990('0xad')](loggerCatch(_0xb990('0xb7')));};Dialer[_0xb990('0xa4')][_0xb990('0xb8')]=function(_0x2ff7e6){return BPromise[_0xb990('0xb6')]()[_0xb990('0xb3')](cmHopperBlack[_0xb990('0xb8')](_0x2ff7e6))[_0xb990('0xad')](loggerCatch(_0xb990('0xb9')));};Dialer[_0xb990('0xa4')][_0xb990('0xba')]=function(_0x4e9d7b){return BPromise['resolve']()[_0xb990('0xb3')](cmHopperHistory[_0xb990('0xbb')](_0x4e9d7b))['catch'](loggerCatch(_0xb990('0xbc')));};Dialer['prototype']['rescheduleContact']=function(_0x253cb0){return BPromise[_0xb990('0xb6')]()[_0xb990('0xb3')](cmHopper[_0xb990('0xbd')](_0x253cb0))[_0xb990('0xad')](loggerCatch(_0xb990('0xbe')));};Dialer[_0xb990('0xa4')]['getContactDialer']=function(_0x3c0644,_0x235e78,_0xb14d96,_0x192550){return BPromise[_0xb990('0xb6')]()[_0xb990('0xb3')](cmHopper[_0xb990('0xbf')](_0x3c0644,_0x235e78,_0xb14d96,_0x192550))[_0xb990('0xad')](loggerCatch(_0xb990('0xc0')));};Dialer[_0xb990('0xa4')][_0xb990('0xc1')]=function(_0x11a40b,_0x51bf27,_0x1f23ef){return BPromise[_0xb990('0xb6')]()[_0xb990('0xb3')](cmHopper[_0xb990('0xc1')](_0x11a40b,_0x51bf27,_0x1f23ef))[_0xb990('0xad')](loggerCatch(_0xb990('0xc0')));};Dialer[_0xb990('0xa4')]['getVoiceQueueRtPauses']=function(_0x4c1773){return BPromise[_0xb990('0xb6')]()[_0xb990('0xb3')](voiceQueueRt['getVoiceQueueRtPauses'](_0x4c1773))['catch'](loggerCatch(_0xb990('0xc2')));};Dialer[_0xb990('0xa4')][_0xb990('0xc3')]=function(_0x3e3858){return BPromise[_0xb990('0xb6')]()[_0xb990('0xb3')](cmHopper[_0xb990('0xc3')](_0x3e3858))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0xb990('0xa4')][_0xb990('0xc4')]=function(_0x54d269){return BPromise[_0xb990('0xb6')]()[_0xb990('0xb3')](cmHopperHistory['createHistory'](_0x54d269))[_0xb990('0xad')](loggerCatch(_0xb990('0xc5')));};Dialer[_0xb990('0xa4')][_0xb990('0xb1')]=function(_0x285b5b){if(!_[_0xb990('0x88')](_0x285b5b)&&_0x285b5b!==null){if(_0x285b5b[_0xb990('0x94')](_0xb990('0x6d'))){if(_0x285b5b[_0xb990('0x6d')]>0x0){_0x285b5b['originated']-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xb990('0x92')](_0xb990('0xc6'));}};Dialer[_0xb990('0xa4')]['loggerHandler']=function(_0x2a9919,_0x42b518){var _0x536ee4=this;return function(_0x1b7b54){_0x536ee4['updateOriginated'](_0x42b518);logger[_0xb990('0x92')](_0x2a9919,util[_0xb990('0x91')](_0x1b7b54,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xb990('0xc7')]=function(_0xacd920,_0x509b18,_0x11dcf4){var _0x3b672c={'state':0x19,'statedesc':_0xb990('0xc8')};this[_0xb990('0xb1')](_0x509b18);this[_0xb990('0xc9')](_[_0xb990('0x87')](_0x3b672c,_['pick'](_0x11dcf4,[_0xb990('0xca'),'ListId',_0xb990('0xcb'),_0xb990('0xcc'),_0xb990('0xcd')])),_0xb990('0xce'),'[emptyContact]');logger[_0xb990('0x92')](_0xacd920);};Dialer[_0xb990('0xa4')][_0xb990('0xcf')]=function(_0x423b21){return _0x423b21==='Success';};Dialer[_0xb990('0xa4')]['isTrunkReachable']=function(_0xf94386){return!_['isUndefined'](_0xf94386)&&_0xf94386&&!_[_0xb990('0x88')](_0xf94386['name'])&&!_[_0xb990('0x88')](_0xf94386[_0xb990('0x74')])&&_0xf94386[_0xb990('0x74')]&&(this[_0xb990('0x22')][util[_0xb990('0x75')](_0xb990('0xd0'),_0xf94386[_0xb990('0x3b')])]['status']==='reachable'||this[_0xb990('0x22')][util[_0xb990('0x75')](_0xb990('0xd0'),_0xf94386[_0xb990('0x3b')])][_0xb990('0xac')]===_0xb990('0xd1'));};Dialer['prototype']['saveInDb']=function(_0x5f518a,_0x163426,_0x4dab0a){this[_0xb990('0xc4')](_0x5f518a)[_0xb990('0xad')](loggerCatch(_0x163426));this['moveContactManagedDialer'](_0x5f518a)[_0xb990('0xad')](loggerCatch(_0x4dab0a));};Dialer[_0xb990('0xa4')][_0xb990('0x34')]=function(_0x15e1f7){var _0x205ea0=this[_0xb990('0x26')][_0x15e1f7[_0xb990('0xd2')]];var _0x50d75d;if(!_['isNil'](_0x15e1f7)&&!_['isNil'](_0x15e1f7[_0xb990('0xd3')])&&!_[_0xb990('0xaa')](_0x15e1f7['variable'][_0xb990('0xd4')])&&_0x15e1f7[_0xb990('0xd5')]==='xcally-motion-dialer'&&_0x205ea0){if(_0x205ea0[_0xb990('0x47')]!==_0xb990('0x8c')&&this[_0xb990('0x1f')][_0x205ea0[_0xb990('0xaf')]][_0xb990('0xd6')]&&_0x15e1f7[_0xb990('0xd7')]==='HANGUP'){delete this['uniqueId'][_0x15e1f7['uniqueid']];this[_0xb990('0xb1')](this[_0xb990('0x1f')][_0x205ea0['queue']]);this[_0xb990('0x1f')][_0x205ea0[_0xb990('0xaf')]][_0xb990('0x5b')]+=0x1;this[_0xb990('0x1f')][_0x205ea0[_0xb990('0xaf')]][_0xb990('0x5a')]+=0x1;_0x50d75d=new Hangup(_0x205ea0,_0x15e1f7);_0x50d75d[_0xb990('0xa1')]=0x12;_0x50d75d[_0xb990('0xa2')]=_0xb990('0xd8');_0x50d75d['membername']=_0xb990('0xd9');this[_0xb990('0xc9')](_0x50d75d,_0xb990('0xda'),'[syncHangupInAMD]');}if(_0x205ea0['type']!==_0xb990('0x8c')&&this[_0xb990('0x1f')][_0x205ea0[_0xb990('0xaf')]][_0xb990('0xd6')]&&_0x15e1f7['value']===_0xb990('0xdb')){delete this[_0xb990('0x26')][_0x15e1f7[_0xb990('0xd2')]];this[_0xb990('0xb1')](this['voiceQueues'][_0x205ea0['queue']]);this[_0xb990('0x1f')][_0x205ea0[_0xb990('0xaf')]][_0xb990('0x5b')]+=0x1;this['voiceQueues'][_0x205ea0[_0xb990('0xaf')]][_0xb990('0x5a')]+=0x1;_0x50d75d=new Hangup(_0x205ea0,_0x15e1f7);_0x50d75d[_0xb990('0xa1')]=0x13;_0x50d75d[_0xb990('0xa2')]=_0xb990('0xdc');_0x50d75d['membername']=_0xb990('0xd9');_0x50d75d['amd']=!![];this['saveInDb'](_0x50d75d,'[syncMachine][createHistory]',_0xb990('0xdd'));}if(_0x205ea0['type']===_0xb990('0x8c')&&this[_0xb990('0x20')][_0x205ea0[_0xb990('0xaf')]]['dialAMDActive']&&_0x15e1f7['value']===_0xb990('0xde')){delete this[_0xb990('0x26')][_0x15e1f7[_0xb990('0xd2')]];this['updateOriginated'](this[_0xb990('0x20')][_0x205ea0['queue']]);_0x50d75d=new Hangup(_0x205ea0,_0x15e1f7);_0x50d75d['state']=0x12;_0x50d75d['statedesc']='HangupInAMD';_0x50d75d['membername']=_0xb990('0xd9');this[_0xb990('0xc9')](_0x50d75d,_0xb990('0xdf'),_0xb990('0xe0'));}if(_0x205ea0[_0xb990('0x47')]===_0xb990('0x8c')&&this[_0xb990('0x20')][_0x205ea0[_0xb990('0xaf')]][_0xb990('0xd6')]&&_0x15e1f7[_0xb990('0xd7')]===_0xb990('0xdb')){delete this[_0xb990('0x26')][_0x15e1f7[_0xb990('0xd2')]];this[_0xb990('0xb1')](this[_0xb990('0x20')][_0x205ea0['queue']]);_0x50d75d=new Hangup(_0x205ea0,_0x15e1f7);_0x50d75d[_0xb990('0xa1')]=0x13;_0x50d75d[_0xb990('0xa2')]='Machine';_0x50d75d[_0xb990('0xe1')]=_0xb990('0xd9');_0x50d75d[_0xb990('0xe2')]=!![];this[_0xb990('0xc9')](_0x50d75d,_0xb990('0xe3'),_0xb990('0xe4'));}}};Dialer[_0xb990('0xa4')][_0xb990('0x30')]=function(_0x1340b8){var _0x1e2428=this[_0xb990('0x26')][_0x1340b8[_0xb990('0xd2')]];var _0x56783a=this;var _0x127c6a;if(_0x1e2428&&_0x1e2428[_0xb990('0x47')]==='ivr'){delete this[_0xb990('0x26')][_0x1340b8[_0xb990('0xd2')]];this['updateOriginated'](this[_0xb990('0x20')][_0x1e2428['queue']]);this['campaigns'][_0x1e2428['queue']]['ivrAnswerCallsDay']+=0x1;_0x127c6a=new Hangup(_0x1e2428,_0x1340b8);this[_0xb990('0xc4')](_0x127c6a)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xb990('0xc3')](_0x127c6a)[_0xb990('0xad')](loggerCatch('[syncHangupIvr]'));}if(_0x1e2428&&_0x1e2428[_0xb990('0x47')]!==_0xb990('0x8c')&&isNotNull(this['voiceQueues'][_0x1e2428['queue']]['dialQueueProject'])){delete this['uniqueId'][_0x1340b8['uniqueid']];this[_0xb990('0xb1')](this[_0xb990('0x1f')][_0x1e2428['queue']]);this[_0xb990('0x1f')][_0x1e2428[_0xb990('0xaf')]][_0xb990('0x5b')]+=0x1;this[_0xb990('0x1f')][_0x1e2428['queue']][_0xb990('0x5a')]+=0x1;_0x127c6a=new Hangup(_0x1e2428,_0x1340b8);_0x127c6a[_0xb990('0xa1')]=0x10;_0x127c6a[_0xb990('0xa2')]=_0xb990('0xe5');_0x127c6a[_0xb990('0xe1')]=_0xb990('0xe6');this[_0xb990('0xc4')](_0x127c6a)['catch'](loggerCatch(_0xb990('0xe7')));this[_0xb990('0xc3')](_0x127c6a)['catch'](loggerCatch(_0xb990('0xe8')));}if(_0x1e2428&&_0x1e2428[_0xb990('0x47')]!==_0xb990('0x8c')&&!isNotNull(this[_0xb990('0x1f')][_0x1e2428[_0xb990('0xaf')]][_0xb990('0xe9')])){delete this[_0xb990('0x26')][_0x1340b8[_0xb990('0xd2')]];this[_0xb990('0xb1')](this[_0xb990('0x1f')][_0x1e2428[_0xb990('0xaf')]]);this['voiceQueues'][_0x1e2428[_0xb990('0xaf')]]['outboundUnknownCallsDay']+=0x1;_0x127c6a=new Hangup(_0x1e2428,_0x1340b8);_0x127c6a[_0xb990('0xa1')]=0xc;_0x127c6a['statedesc']=_0x1340b8['cause-txt'];_0x127c6a[_0xb990('0xe1')]=_0xb990('0xea');this[_0xb990('0xc4')](_0x127c6a)[_0xb990('0xad')](loggerCatch(_0xb990('0xe7')));this[_0xb990('0xc3')](_0x127c6a)['catch'](loggerCatch(_0xb990('0xe8')));}};Dialer['prototype'][_0xb990('0xeb')]=function(_0x506f65){var _0x40ff26=this[_0xb990('0x26')][_0x506f65[_0xb990('0xd2')]];var _0x593ff9=this;if(this[_0xb990('0x1f')][_0x506f65['queue']]){if(_0x40ff26&&_0x40ff26[_0xb990('0x47')]!==_0xb990('0x8c')){delete this[_0xb990('0x26')][_0x506f65[_0xb990('0xd2')]];this['voiceQueues'][_0x506f65[_0xb990('0xaf')]]['outboundAnswerCallsDay']+=0x1;var _0x36b059=new AgentComplete(_0x40ff26,_0x506f65);if(_0x506f65[_0xb990('0xec')]===_0xb990('0xed')){_0x36b059[_0xb990('0xee')]=this[_0xb990('0x1f')][_0x506f65[_0xb990('0xaf')]][_0xb990('0xef')]&&this[_0xb990('0x1f')][_0x506f65[_0xb990('0xaf')]][_0xb990('0xf0')]?moment()[_0xb990('0x75')](_0xb990('0xf1')):undefined;}this[_0xb990('0xc4')](_0x36b059)[_0xb990('0xad')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xb990('0xc3')](_0x36b059)[_0xb990('0xad')](loggerCatch(_0xb990('0xf2')));}}};Dialer[_0xb990('0xa4')][_0xb990('0xf3')]=function(_0x52fe9b){if(this[_0xb990('0x1f')][_0x52fe9b[_0xb990('0xaf')]]){if(this[_0xb990('0x26')][_0x52fe9b[_0xb990('0xd2')]]&&this[_0xb990('0x26')][_0x52fe9b[_0xb990('0xd2')]][_0xb990('0x47')]!=='ivr'){this[_0xb990('0xb1')](this[_0xb990('0x1f')][_0x52fe9b[_0xb990('0xaf')]]);this[_0xb990('0x26')][_0x52fe9b[_0xb990('0xd2')]][_0xb990('0xf4')]=moment()[_0xb990('0x75')](_0xb990('0xf1'));}}};Dialer[_0xb990('0xa4')][_0xb990('0xf5')]=function(_0x34f968){this[_0xb990('0xc4')](_0x34f968)[_0xb990('0xad')](loggerCatch(_0xb990('0xf6')));this['moveContactManagedDialer'](_0x34f968)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0xb990('0xa4')][_0xb990('0xf7')]=function(_0xce109e){var _0x65dabc=this[_0xb990('0x26')][_0xce109e['uniqueid']];var _0x34b9e2=this;if(this['voiceQueues'][_0xce109e['queue']]){if(_0x65dabc&&_0x65dabc['type']!=='ivr'){delete this[_0xb990('0x26')][_0xce109e[_0xb990('0xd2')]];this[_0xb990('0xb1')](this[_0xb990('0x1f')][_0xce109e['queue']]);_0x65dabc[_0xb990('0xf8')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x5d281e=new QueueCallerAbandon(_0x65dabc,_0xce109e);if(getSeconds(_0x65dabc[_0xb990('0xf8')],_0x65dabc['responsetime'])>=_0x65dabc['dialQueueTimeout']){this['voiceQueues'][_0xce109e[_0xb990('0xaf')]][_0xb990('0x69')]+=0x1;this[_0xb990('0x1f')][_0xce109e[_0xb990('0xaf')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xb990('0x1f')][_0xce109e[_0xb990('0xaf')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x5d281e[_0xb990('0xa1')]=0xa;_0x5d281e[_0xb990('0xa2')]=_0xb990('0xf9');_0x5d281e[_0xb990('0xfa')]=_0xb990('0xfb');_0x5d281e[_0xb990('0xee')]=this[_0xb990('0x1f')][_0xce109e[_0xb990('0xaf')]][_0xb990('0xef')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;this[_0xb990('0xf5')](_0x5d281e);}else{this['voiceQueues'][_0xce109e[_0xb990('0xaf')]][_0xb990('0x68')]+=0x1;this[_0xb990('0x1f')][_0xce109e['queue']][_0xb990('0xfc')]+=0x1;_0x5d281e[_0xb990('0xa1')]=0xb;_0x5d281e['statedesc']=_0xb990('0xfd');_0x5d281e[_0xb990('0xfa')]=_0xb990('0xfe');this[_0xb990('0xf5')](_0x5d281e);}}}};Dialer[_0xb990('0xa4')][_0xb990('0x32')]=function(_0x112a21){if(this[_0xb990('0xa8')][_0x112a21[_0xb990('0xd2')]]){this['actions'][_0x112a21['uniqueid']][_0xb990('0xff')]=_0x112a21['channel'];}if(this[_0xb990('0x26')][_0x112a21[_0xb990('0xd2')]]){this[_0xb990('0x26')][_0x112a21[_0xb990('0xd2')]][_0xb990('0xff')]=_0x112a21[_0xb990('0xff')];}};Dialer['prototype'][_0xb990('0x36')]=function(_0x26b621){if(strategy[this[_0xb990('0x1f')][this[_0xb990('0xa8')][_0x26b621[_0xb990('0x100')]]['queue']][_0xb990('0x49')]]===_0xb990('0x19')){if(this['actions'][_0x26b621[_0xb990('0x100')]]&&_[_0xb990('0xaa')](this[_0xb990('0xa8')][_0x26b621['actionid']][_0xb990('0x101')])&&_0x26b621[_0xb990('0xac')]==='1'&&_0x26b621[_0xb990('0x102')]==='0'){if(this['agents'][_0x26b621[_0xb990('0x103')]]){if(!this[_0xb990('0x21')][_0x26b621[_0xb990('0x103')]]['locked']){this[_0xb990('0x21')][_0x26b621['stateinterface']]['locked']=!![];this['actions'][_0x26b621[_0xb990('0x100')]][_0xb990('0x101')]=!![];this[_0xb990('0xa8')][_0x26b621[_0xb990('0x100')]][_0xb990('0x103')]=_0x26b621[_0xb990('0x103')];}}}}else if((strategy[this[_0xb990('0x1f')][this[_0xb990('0xa8')][_0x26b621[_0xb990('0x100')]][_0xb990('0xaf')]][_0xb990('0x49')]]||_0xb990('0x104'))===_0xb990('0x104')){if(this[_0xb990('0xa8')][_0x26b621['actionid']]){if(this[_0xb990('0x21')][_0x26b621[_0xb990('0x103')]]){this[_0xb990('0xa8')][_0x26b621[_0xb990('0x100')]]['stateinterface']=_0x26b621[_0xb990('0x103')];if(_[_0xb990('0xaa')](this['queueBooked'][this[_0xb990('0xa8')][_0x26b621[_0xb990('0x100')]][_0xb990('0xaf')]])){this[_0xb990('0x105')][this[_0xb990('0xa8')][_0x26b621[_0xb990('0x100')]][_0xb990('0xaf')]]=[];}this['queueBooked'][this[_0xb990('0xa8')][_0x26b621[_0xb990('0x100')]][_0xb990('0xaf')]][_0xb990('0x106')](_[_0xb990('0x87')](_[_0xb990('0x107')](this[_0xb990('0xa8')][_0x26b621['actionid']],[_0xb990('0x108'),_0xb990('0x103')]),{'status':_0x26b621['status'],'paused':_0x26b621[_0xb990('0x102')]}));}}}};function unlockQueueStatus(_0x257ebd,_0x430bf5){setTimeout(function(){if(_[_0xb990('0x88')](_0x257ebd['queueStatusComplete'])){loggerBooked[_0xb990('0x92')]('[unlockQueueStatus][undefined]',_0x430bf5);}_0x257ebd['queueStatusComplete']=!![];loggerBooked[_0xb990('0x79')](_0xb990('0x109'),_0x430bf5,JSON[_0xb990('0x43')](_[_0xb990('0x107')](_0x257ebd,[_0xb990('0x3b'),_0xb990('0x10a')])));},0x1f3);}Dialer[_0xb990('0xa4')][_0xb990('0x38')]=function(_0x40b792){var _0x55f170=this;var _0x315bbd=_0x55f170[_0xb990('0x1f')][_0x55f170['actions'][_0x40b792[_0xb990('0x100')]]['queue']];if(strategy[this[_0xb990('0x1f')][this['actions'][_0x40b792['actionid']][_0xb990('0xaf')]][_0xb990('0x49')]]==='roundrobin'){if(this[_0xb990('0xa8')][_0x40b792[_0xb990('0x100')]]&&this['actions'][_0x40b792[_0xb990('0x100')]][_0xb990('0x103')]){this[_0xb990('0x1e')][_0xb990('0x10b')](this[_0xb990('0xa8')][_0x40b792['actionid']][_0xb990('0x108')],this[_0xb990('0xa8')][_0x40b792[_0xb990('0x100')]][_0xb990('0x103')])[_0xb990('0xad')](function(_0xc9f2f7){logger[_0xb990('0x92')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xb990('0x91')](_0xc9f2f7,{'showHidden':![],'depth':null}));})[_0xb990('0x1c')](function(){_0x55f170[_0xb990('0xb1')](_0x55f170[_0xb990('0x1f')][_0x55f170[_0xb990('0xa8')][_0x40b792[_0xb990('0x100')]]['queue']]);_0x55f170[_0xb990('0x21')][_0x55f170[_0xb990('0xa8')][_0x40b792[_0xb990('0x100')]][_0xb990('0x103')]][_0xb990('0x101')]=![];delete _0x55f170[_0xb990('0xa8')][_0x40b792['actionid']];unlockQueueStatus(_0x315bbd);});}else{this[_0xb990('0xb1')](this[_0xb990('0x1f')][this[_0xb990('0xa8')][_0x40b792[_0xb990('0x100')]]['queue']]);this[_0xb990('0xbd')]({'active':![],'ContactId':this[_0xb990('0xa8')][_0x40b792[_0xb990('0x100')]]['ContactId'],'ListId':this[_0xb990('0xa8')][_0x40b792['actionid']][_0xb990('0x10c')],'VoiceQueueId':this['actions'][_0x40b792[_0xb990('0x100')]][_0xb990('0xcc')]||undefined,'CampaignId':this['actions'][_0x40b792[_0xb990('0x100')]][_0xb990('0xcd')]||undefined})['catch'](loggerCatch(_0xb990('0x10d')));delete this[_0xb990('0xa8')][_0x40b792['actionid']];unlockQueueStatus(_0x315bbd);}}else if((strategy[this[_0xb990('0x1f')][this[_0xb990('0xa8')][_0x40b792[_0xb990('0x100')]][_0xb990('0xaf')]]['strategy']]||_0xb990('0x104'))===_0xb990('0x104')){var _0x24c689;if(this[_0xb990('0xa8')][_0x40b792[_0xb990('0x100')]]&&!_[_0xb990('0x8e')](this[_0xb990('0x105')][this['actions'][_0x40b792['actionid']][_0xb990('0xaf')]])){if(this['queueBookedRR'][_0x55f170[_0xb990('0xa8')][_0x40b792[_0xb990('0x100')]][_0xb990('0xaf')]]){this['queueBookedRR'][_0x55f170[_0xb990('0xa8')][_0x40b792[_0xb990('0x100')]][_0xb990('0xaf')]]=this[_0xb990('0x2a')][this['actions'][_0x40b792[_0xb990('0x100')]][_0xb990('0xaf')]]?this[_0xb990('0x2a')][this[_0xb990('0xa8')][_0x40b792[_0xb990('0x100')]]['queue']]:this['queueBooked'][this[_0xb990('0xa8')][_0x40b792[_0xb990('0x100')]][_0xb990('0xaf')]]?this[_0xb990('0x105')][this['actions'][_0x40b792[_0xb990('0x100')]][_0xb990('0xaf')]]['_rr']||0x0:0x0;}this[_0xb990('0x105')][this[_0xb990('0xa8')][_0x40b792['actionid']]['queue']][_0xb990('0x10e')]=this[_0xb990('0x2a')][this[_0xb990('0xa8')][_0x40b792[_0xb990('0x100')]][_0xb990('0xaf')]];for(var _0x1cb1a2=0x0;_0x1cb1a2=0x0?!![]:![];})[_0xb990('0xad')](myreject(_0x46df59)));}}else{_0x43389c[_0xb990('0x106')](ami[_0xb990('0xab')]({'action':_0xb990('0x126'),'command':util[_0xb990('0x75')](_0xb990('0x127'),_0x17b7e2,!_[_0xb990('0x88')](config[_0xb990('0x122')][_0x224d55])?_0x224d55:'')})[_0xb990('0xb3')](function(_0x466658){return _0x466658[_0xb990('0x129')][_0xb990('0x12b')](_0xb990('0x12a'))>=0x0?!![]:![];})['catch'](myreject(_0x46df59)));}BPromise[_0xb990('0x12c')](_0x43389c)[_0xb990('0xb3')](function(_0x4a7817){var _0xcd8ea=_[_0xb990('0x12d')](_0x4a7817);if(_0xcd8ea){return _0x2a9c84(_0xcd8ea);}else{_0x1c9e9d[_0xb990('0x3a')]=_0x312c7a?_0xb990('0x12e'):'INTERVAL_IS_OVERTIME';return _0x46df59(msgResponse(_0xb990('0x12f'),'Failure',_0xb990('0x130')+_0x312c7a+'\x20'+_0x310598+_0xb990('0x131')+util[_0xb990('0x91')](_0x17b7e2,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x224d55));}})[_0xb990('0xad')](function(_0x514a84){return _0x46df59(msgResponse(_0xb990('0x11e'),_0xb990('0x11f'),JSON[_0xb990('0x43')](_0x514a84)));});});};Dialer[_0xb990('0xa4')]['checkDialMethod']=function(_0x46e20a){var _0x5c4e76=this;return function(){switch(_0x46e20a[_0xb990('0x56')]){case _0xb990('0x132'):freeVariablesPredictive(_0x46e20a);_0x5c4e76[_0xb990('0x133')](_0x46e20a,0x1);break;case _0xb990('0x134'):freeVariablesPredictive(_0x46e20a);_0x5c4e76[_0xb990('0x133')](_0x46e20a,_0x46e20a[_0xb990('0x135')]);break;case _0xb990('0x9'):_0x5c4e76[_0xb990('0x9')](_0x46e20a);break;case _0xb990('0x7'):freeVariablesPredictive(_0x46e20a);_0x5c4e76['handlePower'](_0x46e20a,0x1);break;default:freeVariablesPredictive(_0x46e20a);logger[_0xb990('0x92')]('Queue',_0x46e20a['name'],_0xb990('0x136'));}};};Dialer[_0xb990('0xa4')][_0xb990('0x137')]=function(_0x18a0e3){var _0x49d6c9=this;return function(){_0x49d6c9['handleIvr'](_0x18a0e3);};};Dialer[_0xb990('0xa4')][_0xb990('0xa')]=function(_0x21e923){var _0x1b738e=this;if(isNotPreview(_0x21e923[_0xb990('0x56')])){if(isVoiceQueueOutbound(_0x21e923[_0xb990('0x47')])&&isActive(_0x21e923[_0xb990('0x55')])){_0x21e923[_0xb990('0x9b')]=!![];BPromise['resolve']()[_0xb990('0xb3')](checkIsLoggedIn(_0x21e923,_0x21e923['loggedIn']))[_0xb990('0xb3')](checkIsActive(_0x21e923,_0x21e923[_0xb990('0x55')]))['then'](checkInterval(_0x21e923))['then'](_0x1b738e[_0xb990('0x118')](_0x21e923))[_0xb990('0xb3')](_0x1b738e[_0xb990('0x11d')](_0x21e923[_0xb990('0x138')],_0x21e923['dialTimezone'],_0x21e923['name'],_0x21e923))['then'](_0x1b738e['checkIfTimeIntervals'](_0x21e923[_0xb990('0x3e')],_0x21e923[_0xb990('0x139')],_0x21e923[_0xb990('0x3b')],_0x21e923))['then'](_0x1b738e[_0xb990('0x13a')](_0x21e923))[_0xb990('0xad')](loggerCatchQueueSummary(_0xb990('0x13b'),_0x21e923));}else{notSendMessagesQueue(_0x21e923);}}else{freeVariablesPredictive(_0x21e923);}};Dialer[_0xb990('0xa4')][_0xb990('0x117')]=function(){var _0x530d4a=this;var _0x1cec9c;for(var _0x19cfad in this[_0xb990('0x20')]){if(this[_0xb990('0x20')]['hasOwnProperty'](_0x19cfad)){_0x1cec9c=this[_0xb990('0x20')][_0x19cfad];if(isCampaignIvr(_0x1cec9c[_0xb990('0x47')])&&isActive(_0x1cec9c[_0xb990('0x74')])){_0x1cec9c[_0xb990('0x9b')]=!![];BPromise['resolve']()[_0xb990('0xb3')](checkIsActive(_0x1cec9c,_0x1cec9c[_0xb990('0x74')]))[_0xb990('0xb3')](checkInterval(_0x1cec9c))[_0xb990('0xb3')](_0x530d4a['checkIsTrunkReachable'](_0x1cec9c))[_0xb990('0xb3')](_0x530d4a['checkIfTime'](_0x1cec9c[_0xb990('0x138')],_0x1cec9c[_0xb990('0x139')],_0x1cec9c[_0xb990('0x3b')],_0x1cec9c))[_0xb990('0xb3')](_0x530d4a[_0xb990('0x13c')](_0x1cec9c['Interval'],_0x1cec9c['dialTimezone'],_0x1cec9c['name'],_0x1cec9c))[_0xb990('0xb3')](_0x530d4a[_0xb990('0x137')](_0x1cec9c))[_0xb990('0xad')](loggerCatchQueueSummary(_0xb990('0x13d'),_0x1cec9c));}else{notSendMessagesCampaign(_0x1cec9c);}}}};function getCallerIdRandom(_0x17c07d,_0xd2df2b){var _0x2ad9f3,_0x475d78,_0xb4ce69;if(_0xd2df2b<=0x0){_0xd2df2b=0x1;}_0x2ad9f3=new RegExp(_0xb990('0x13e')+_0xd2df2b+'}$');_0x475d78=Math[_0xb990('0x13f')](0xa,_0xd2df2b-0x1);_0xb4ce69=Math[_0xb990('0x13f')](0xa,_0xd2df2b)-0x1;return util[_0xb990('0x75')]('%s',_['replace'](_0x17c07d,_0x2ad9f3,_[_0xb990('0x140')](_0x475d78,_0xb4ce69)));}function extractCalleridName(_0x5c0702){var _0x32d1d4=_0x5c0702[_0xb990('0x141')](/"(.*?)"/);return _0x32d1d4?_0x32d1d4[0x1]:_0x5c0702;}function extractCalleridNumber(_0x27f743){var _0x3a692c=_0x27f743[_0xb990('0x141')](/<(.*?)>/);return _0x3a692c?_0x3a692c[0x1]:_0x27f743;}Dialer[_0xb990('0xa4')]['actionOriginate']=function(_0xb0dee3,_0x4b2551){var _0x444e44=this;var _0x2eb4a0=uuid['v4']();this[_0xb990('0xa8')][_0x2eb4a0]=new Action(_0xb0dee3,_0x4b2551,_0x2eb4a0);return new BPromise(function(_0x5ad36e,_0x474f05){if(_[_0xb990('0x88')](_0xb0dee3)&&'object'!==typeof _0xb0dee3){return _0x474f05(msgResponse(_0xb990('0x142'),_0xb990('0x11f'),'voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x4b2551[_0xb990('0x143')][_0xb990('0x144')])||_0x4b2551['Contact']['phone']===null){return _0x474f05(msgResponse('originate',_0xb990('0x11f'),_0xb990('0x145')));}var _0x137163={'XMD-CALLERID':_0x444e44[_0xb990('0xa8')][_0x2eb4a0][_0xb990('0x146')](),'XMD-AGI':_0xb0dee3[_0xb990('0xe9')]?util[_0xb990('0x75')](_0xb990('0x147'),ipAgi,_0xb0dee3[_0xb990('0xe9')]):'NONE','XMD-AGIAFTER':_0xb0dee3[_0xb990('0xef')]?util[_0xb990('0x75')](_0xb990('0x147'),ipAgi,_0xb0dee3[_0xb990('0xef')]):_0xb990('0x148'),'XMD-QUEUE':_0xb0dee3[_0xb990('0x47')]===_0xb990('0x48')?util[_0xb990('0x75')](_0xb990('0x149'),_0xb0dee3[_0xb990('0x3b')],_0xb0dee3[_0xb990('0x14a')]||'',_0xb0dee3[_0xb990('0xf0')]?'c':'',_0xb0dee3['dialQueueTimeout']||0x3):_0xb990('0x148'),'XMD-CONTACTID':_0x4b2551['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x444e44[_0xb990('0xa8')][_0x2eb4a0][_0xb990('0x146')](),'XMD-AMD':_0xb0dee3[_0xb990('0xd6')]?_0xb990('0x14b'):_0xb990('0x148'),'XMD-DESTINATION':_0xb990('0x14c')};if(_0xb0dee3[_0xb990('0xd6')]){_0x137163[_0xb990('0x14d')]=_0xb0dee3[_0xb990('0x14e')]||0x9c4;_0x137163[_0xb990('0x14f')]=_0xb0dee3['dialAMDGreeting']||0x5dc;_0x137163['XMD-AMDAFTERGREETINGSILENCE']=_0xb0dee3['dialAMDAfterGreetingSilence']||0x320;_0x137163[_0xb990('0x150')]=_0xb0dee3[_0xb990('0x151')]||0x1388;_0x137163[_0xb990('0x152')]=_0xb0dee3[_0xb990('0x153')]||0x64;_0x137163['XMD-AMDBETWEENWORDSSILENCE']=_0xb0dee3[_0xb990('0x154')]||0x32;_0x137163[_0xb990('0x155')]=_0xb0dee3[_0xb990('0x156')]||0x3;_0x137163[_0xb990('0x157')]=_0xb0dee3['dialAMDSilenceThreshold']||0x100;_0x137163[_0xb990('0x158')]=_0xb0dee3['dialAMDMaximumWordLength']||0x1388;}if(_0xb0dee3[_0xb990('0x47')]===_0xb990('0x48')){_0x137163['XMD-VOICEQUEUEID']=_0x4b2551[_0xb990('0xcc')];}else{_0x137163['XMD-CAMPAIGNID']=_0x4b2551[_0xb990('0xcd')];}for(var _0x49cccc in _0x4b2551['Contact']){if(_0x4b2551[_0xb990('0x143')][_0xb990('0x94')](_0x49cccc)){if(isNotNull(_0x4b2551[_0xb990('0x143')][_0x49cccc])&&_0x49cccc!=='id'&&_0x49cccc!==_0xb990('0x159')&&_0x49cccc!=='createdAt'&&_0x49cccc!=='updatedAt'){_0x137163[util['format'](_0xb990('0x15a'),_0xb990('0x15b'),_[_0xb990('0x15c')](_0x49cccc))]=_0x4b2551[_0xb990('0x143')][_0x49cccc];}}}var _0x5a9dea=_0x444e44[_0xb990('0x119')](_0xb0dee3[_0xb990('0x73')])?getCallerId(_0xb0dee3[_0xb990('0x73')]['callerid'],_0xb0dee3['dialOriginateCallerIdName'],_0xb0dee3[_0xb990('0x15d')]>0x0?getCallerIdRandom(_0xb0dee3['dialOriginateCallerIdNumber'],_0xb0dee3[_0xb990('0x15d')]):_0xb0dee3[_0xb990('0x57')]):getCallerId(_[_0xb990('0xaa')](_0xb0dee3[_0xb990('0x11a')])?_0xb0dee3[_0xb990('0x73')][_0xb990('0x15e')]:_0xb0dee3[_0xb990('0x11a')][_0xb990('0x15e')],_0xb0dee3[_0xb990('0x15f')],_0xb0dee3[_0xb990('0x15d')]>0x0?getCallerIdRandom(_0xb0dee3['dialOriginateCallerIdNumber'],_0xb0dee3['dialRandomLastDigitCallerIdNumber']):_0xb0dee3[_0xb990('0x57')]);if(_0x5a9dea){_0x137163[_0xb990('0x160')]=_0x444e44[_0xb990('0xa8')][_0x2eb4a0][_0xb990('0x161')]=extractCalleridName(_0x5a9dea);_0x137163[_0xb990('0x162')]=_0x444e44[_0xb990('0xa8')][_0x2eb4a0][_0xb990('0x163')]=extractCalleridNumber(_0x5a9dea);}return ami['Action']({'actionid':_0x2eb4a0,'action':'originate','channel':_0x444e44[_0xb990('0x119')](_0xb0dee3[_0xb990('0x73')])?util[_0xb990('0x75')](_0xb990('0x164'),_0xb0dee3[_0xb990('0x73')][_0xb990('0x3b')],isNotNull(_0xb0dee3['dialPrefix'])?_0xb0dee3[_0xb990('0x59')][_0xb990('0x165')]()||'':'',_0xb0dee3['dialCutDigit']>0x0?_0x4b2551[_0xb990('0x143')][_0xb990('0x144')][_0xb990('0x166')](_0xb0dee3[_0xb990('0x167')]):_0x4b2551[_0xb990('0x143')][_0xb990('0x144')]):util[_0xb990('0x75')](_0xb990('0x164'),_[_0xb990('0xaa')](_0xb0dee3[_0xb990('0x11a')])?_0xb0dee3['Trunk'][_0xb990('0x3b')]:_0xb0dee3[_0xb990('0x11a')]['name'],isNotNull(_0xb0dee3['dialPrefix'])?_0xb0dee3[_0xb990('0x59')][_0xb990('0x165')]()||'':'',_0xb0dee3['dialCutDigit']>0x0?_0x4b2551[_0xb990('0x143')][_0xb990('0x144')][_0xb990('0x166')](_0xb0dee3[_0xb990('0x167')]):_0x4b2551[_0xb990('0x143')][_0xb990('0x144')]),'callerid':_0x5a9dea,'Exten':_0xb990('0x14c'),'Context':_0xb990('0x168'),'Priority':'1','variable':_0x137163,'timeout':(_0xb0dee3[_0xb990('0x58')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2eb4a0})[_0xb990('0xb3')](function(_0x4c1fea){return _0x5ad36e(_0x4c1fea);})[_0xb990('0xad')](function(_0x13323b){_0xb0dee3['outboundOriginateFailureCallsDay']+=0x1;var _0x1ab9b0=new History(_0x444e44[_0xb990('0xa8')][_0x2eb4a0]);logger['error'](util['format'](_0xb990('0x169'),JSON[_0xb990('0x43')](_0x13323b)));_0x1ab9b0[_0xb990('0xa1')]=0xe;_0x1ab9b0['statedesc']=_0xb990('0x16a');_0x1ab9b0[_0xb990('0x16b')]=moment()[_0xb990('0x75')](_0xb990('0xf1'));_0x1ab9b0['endtime']=_0x1ab9b0[_0xb990('0x16b')];_0x444e44[_0xb990('0xc4')](_0x1ab9b0)[_0xb990('0xad')](loggerCatch(_0xb990('0x16c')));_0x444e44[_0xb990('0xc3')](_0x1ab9b0)['catch'](loggerCatch('[originate][error]'))[_0xb990('0x1c')](function(){delete _0x444e44['actions'][_0x2eb4a0];return _0x474f05(msgResponse(_0xb990('0x142'),'Error',_0xb990('0x16d')));});});});};Dialer[_0xb990('0xa4')][_0xb990('0x16e')]=function(_0x16aea2){var _0x38157b=this[_0xb990('0xa8')][_0x16aea2[_0xb990('0x100')]];var _0x768534=this;if(_0x38157b){delete this[_0xb990('0xa8')][_0x16aea2[_0xb990('0x100')]];_0x38157b[_0xb990('0x16f')]=moment()[_0xb990('0x75')](_0xb990('0xf1'));var _0x15f1cb=_0x38157b[_0xb990('0x47')]===_0xb990('0x8c')?this[_0xb990('0x20')][_0x38157b[_0xb990('0xaf')]]:this[_0xb990('0x1f')][_0x38157b[_0xb990('0x170')]()];if(!this[_0xb990('0xcf')](_0x16aea2[_0xb990('0x171')])){this[_0xb990('0xb1')](_0x15f1cb);return this['callProgressDetecting'](_0x38157b,_0x15f1cb,_0x16aea2)['then'](function(_0x279b7b){})[_0xb990('0xad')](loggerCatch(_0xb990('0x172')));}else{this[_0xb990('0x26')][_0x16aea2['uniqueid']]=_0x38157b;}}};Dialer['prototype'][_0xb990('0x173')]=function(_0x4c5719,_0x3b2d8d,_0x4f1f1d){var _0x2b13e0=new History(_0x3b2d8d);if(_0x2b13e0['countbusyretry']+_0x2b13e0[_0xb990('0x174')]+_0x2b13e0[_0xb990('0x175')]>=_0x4f1f1d[_0xb990('0x176')]-0x1){return!![];}switch(_0x4c5719){case 0x3:if(_0x2b13e0[_0xb990('0x175')]>=_0x4f1f1d[_0xb990('0x177')]-0x1){return!![];}else{this[_0xb990('0xbd')]({'active':![],'countnoanswerretry':_0x2b13e0[_0xb990('0x175')]+=0x1,'scheduledat':moment()[_0xb990('0x178')](_0x4f1f1d[_0xb990('0x179')],'minutes')[_0xb990('0x75')](_0xb990('0xf1')),'ContactId':_0x2b13e0[_0xb990('0xca')],'ListId':_0x2b13e0[_0xb990('0x10c')],'VoiceQueueId':_0x2b13e0[_0xb990('0xcc')]||undefined,'CampaignId':_0x2b13e0[_0xb990('0xcd')]||undefined})[_0xb990('0xad')](loggerCatch(_0xb990('0x17a')));}break;case 0x5:if(_0x2b13e0[_0xb990('0x17b')]>=_0x4f1f1d[_0xb990('0x17c')]-0x1){return!![];}else{this[_0xb990('0xbd')]({'active':![],'countbusyretry':_0x2b13e0[_0xb990('0x17b')]+=0x1,'scheduledat':moment()['add'](_0x4f1f1d['dialBusyRetryFrequency'],_0xb990('0x17d'))[_0xb990('0x75')](_0xb990('0xf1')),'ContactId':_0x2b13e0['ContactId'],'ListId':_0x2b13e0['ListId'],'VoiceQueueId':_0x2b13e0[_0xb990('0xcc')]||undefined,'CampaignId':_0x2b13e0[_0xb990('0xcd')]||undefined})['catch'](loggerCatch(_0xb990('0x17e')));}break;case 0x8:if(_0x2b13e0['countcongestionretry']>=_0x4f1f1d[_0xb990('0x17f')]-0x1){return!![];}else{this[_0xb990('0xbd')]({'active':![],'countcongestionretry':_0x2b13e0[_0xb990('0x174')]+=0x1,'scheduledat':moment()['add'](_0x4f1f1d['dialCongestionRetryFrequency'],_0xb990('0x17d'))[_0xb990('0x75')](_0xb990('0xf1')),'ContactId':_0x2b13e0['ContactId'],'ListId':_0x2b13e0[_0xb990('0x10c')],'VoiceQueueId':_0x2b13e0['VoiceQueueId']||undefined,'CampaignId':_0x2b13e0[_0xb990('0xcd')]||undefined})[_0xb990('0xad')](loggerCatch(_0xb990('0x180')));}break;default:return!![];}};Dialer[_0xb990('0xa4')][_0xb990('0x181')]=function(_0x16d182,_0x3bca74,_0x310ad1){var _0xe06b50=this;var _0x42f44d=new History(_0x16d182);return new BPromise(function(_0xdde1e8,_0x38458c){if(_[_0xb990('0x88')](_0x3bca74)&&_0xb990('0x182')!==typeof _0x3bca74){return _0x38458c(msgResponse(_0xb990('0x183'),'Failure',_0xb990('0x184')));}if(_[_0xb990('0x88')](_0x310ad1)&&_0xb990('0x182')!==typeof _0x310ad1){return _0x38458c(msgResponse('[callProgressDetecting]',_0xb990('0x11f'),_0xb990('0x185')));}switch(_0x310ad1[_0xb990('0xec')]){case'0':_0x3bca74[_0xb990('0x60')]+=0x1;_0x42f44d[_0xb990('0xa1')]=0x0;_0x42f44d['statedesc']=_0xb990('0x186');_0xe06b50[_0xb990('0xc4')](_0x42f44d)[_0xb990('0xad')](loggerCatch(_0xb990('0x187')));if(_0xe06b50[_0xb990('0x173')](0x0,_0x16d182,_0x3bca74)){if(_0x42f44d['countbusyretry']+_0x42f44d[_0xb990('0x174')]+_0x42f44d[_0xb990('0x175')]>=_0x3bca74['dialGlobalMaxRetry']){_0xe06b50[_0xb990('0x188')](_0x42f44d,_0xdde1e8,_0x38458c,_0xb990('0x189'));}else{_0xe06b50[_0xb990('0x18a')](_0x42f44d,_0xdde1e8,_0x38458c,_0xb990('0x189'));}}break;case'3':_0x3bca74[_0xb990('0x18b')]+=0x1;_0x42f44d[_0xb990('0xa1')]=0x3;_0x42f44d[_0xb990('0xa2')]=_0xb990('0x18c');_0x42f44d['countnoanswerretry']+=0x1;_0x42f44d[_0xb990('0x18d')]+=0x1;_0xe06b50[_0xb990('0xc4')](_0x42f44d)[_0xb990('0xad')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0xe06b50[_0xb990('0x173')](0x3,_0x16d182,_0x3bca74)){if(_0x42f44d[_0xb990('0x175')]>=_0x3bca74[_0xb990('0x177')]){_0xe06b50[_0xb990('0x18a')](_0x42f44d,_0xdde1e8,_0x38458c,_0xb990('0x18e'));}else{_0xe06b50[_0xb990('0x188')](_0x42f44d,_0xdde1e8,_0x38458c,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x3bca74[_0xb990('0x5d')]+=0x1;_0x42f44d[_0xb990('0xa1')]=0x5;_0x42f44d['statedesc']=_0xb990('0x18f');_0x42f44d[_0xb990('0x17b')]+=0x1;_0x42f44d[_0xb990('0x18d')]+=0x1;_0xe06b50[_0xb990('0xc4')](_0x42f44d)[_0xb990('0xad')](loggerCatch(_0xb990('0x190')));if(_0xe06b50['checkRetriveMax'](0x5,_0x16d182,_0x3bca74)){if(_0x42f44d[_0xb990('0x17b')]>=_0x3bca74[_0xb990('0x17c')]){_0xe06b50[_0xb990('0x18a')](_0x42f44d,_0xdde1e8,_0x38458c,_0xb990('0x191'));}else{_0xe06b50[_0xb990('0x188')](_0x42f44d,_0xdde1e8,_0x38458c,'reason\x205\x20busy');}}break;case'8':_0x3bca74[_0xb990('0x5e')]+=0x1;_0x42f44d[_0xb990('0xa1')]=0x8;_0x42f44d[_0xb990('0xa2')]=_0xb990('0x192');_0x42f44d[_0xb990('0x174')]+=0x1;_0x42f44d[_0xb990('0x18d')]+=0x1;_0xe06b50[_0xb990('0xc4')](_0x42f44d)[_0xb990('0xad')](loggerCatch(_0xb990('0x193')));if(_0xe06b50[_0xb990('0x173')](0x8,_0x16d182,_0x3bca74)){if(_0x42f44d[_0xb990('0x174')]>=_0x3bca74['dialCongestionMaxRetry']){_0xe06b50[_0xb990('0x18a')](_0x42f44d,_0xdde1e8,_0x38458c,'reason\x208\x20congestion');}else{_0xe06b50['stateGlobal'](_0x42f44d,_0xdde1e8,_0x38458c,'reason\x208\x20congestion');}}break;default:_0x3bca74[_0xb990('0x64')]+=0x1;_0x42f44d[_0xb990('0xa1')]=0xc;_0x42f44d[_0xb990('0xa2')]=_0x310ad1[_0xb990('0xec')];_0xe06b50[_0xb990('0xc4')](_0x42f44d)[_0xb990('0xad')](loggerCatch(_0xb990('0x194')));if(_0xe06b50[_0xb990('0x173')](_0x310ad1[_0xb990('0xec')],_0x16d182,_0x3bca74)){if(_0x42f44d[_0xb990('0x17b')]+_0x42f44d[_0xb990('0x174')]+_0x42f44d[_0xb990('0x175')]>=_0x3bca74[_0xb990('0x176')]){_0xe06b50[_0xb990('0x188')](_0x42f44d,_0xdde1e8,_0x38458c,_0x310ad1[_0xb990('0xec')]);}else{_0xe06b50[_0xb990('0x18a')](_0x42f44d,_0xdde1e8,_0x38458c,_0x310ad1[_0xb990('0xec')]);}}}});};Dialer[_0xb990('0xa4')][_0xb990('0x188')]=function(_0x138800,_0x5ca62b,_0x184082,_0x2b24cb){var _0x3c9f41=new Final(_0x138800);_0x3c9f41[_0xb990('0xa1')]=0xf;_0x3c9f41['statedesc']=_0xb990('0x195');this['createStateFinal'](_0x3c9f41,_0x5ca62b,_0x184082,_0x2b24cb);};Dialer['prototype'][_0xb990('0x18a')]=function(_0xd95d01,_0x3a3a66,_0x4e7116,_0x5db175){this[_0xb990('0xc3')](_0xd95d01)[_0xb990('0xb3')](function(_0x577525){return _0x3a3a66(msgResponse(_0xb990('0x183'),_0xb990('0x196'),_0x5db175));})[_0xb990('0xad')](function(_0x32f686){return _0x4e7116(msgResponse('[moveContactManagedDialer][0]',_0xb990('0x11f'),_0xb990('0x197')));});};Dialer[_0xb990('0xa4')][_0xb990('0x9')]=function(_0x1b9c48){var _0x5a93d2=this;var _0x52b10e=_0x1b9c48['dialPredictiveOptimizationPercentage']/0x64;var _0x3a7416=_0x1b9c48[_0xb990('0x198')]/(_0x1b9c48[_0xb990('0x198')]+_0x1b9c48[_0xb990('0x5b')]);var _0x24b132=Math[_0xb990('0x199')](_0x1b9c48[_0xb990('0x19a')]*(_0x1b9c48[_0xb990('0x19b')]/0x64));var _0x2a6b31=Math[_0xb990('0x199')](_0x1b9c48[_0xb990('0x19a')]*(_0x1b9c48['predictiveIntervalMinThreshold']/0x64));var _0x45bac5=_0x1b9c48[_0xb990('0x4a')]+_0x1b9c48[_0xb990('0x50')];var _0x5a5743=Math[_0xb990('0x19c')](_0x1b9c48[_0xb990('0x6e')]*_0x1b9c48[_0xb990('0x70')]*_0x1b9c48[_0xb990('0x6c')]*_0x1b9c48[_0xb990('0x19d')]);if(_[_0xb990('0x88')](_0x1b9c48[_0xb990('0x28')])){if(!_[_0xb990('0x88')](_0x1b9c48[_0xb990('0x72')])){_0x1b9c48[_0xb990('0x72')]=undefined;loggerPredictive[_0xb990('0x92')](_0xb990('0x19e'),_0xb990('0x19f'));}if(!_[_0xb990('0x88')](_0x1b9c48[_0xb990('0x8a')])){loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0xb990('0x1a0'));clearInterval(_0x1b9c48[_0xb990('0x8a')]);_0x1b9c48[_0xb990('0x8a')]=undefined;}_0x1b9c48['startProgressive']=moment()[_0xb990('0x75')](_0xb990('0xf1'));loggerPredictive[_0xb990('0x79')](_0x1b9c48[_0xb990('0x3b')],_0xb990('0x1a1'),_0x1b9c48['startProgressive']);this[_0xb990('0x133')](_0x1b9c48,0x1);}else if(ifInterval(_0x1b9c48['dialPredictiveInterval'],_0x1b9c48[_0xb990('0x28')])){this['handlePower'](_0x1b9c48,0x1);loggerPredictiveCalls[_0xb990('0x79')](_0xb990('0x1a2'),_0x1b9c48[_0xb990('0x28')],_0x1b9c48['name']);_0x1b9c48[_0xb990('0x6e')]=0x0;_0x1b9c48[_0xb990('0x6b')]=0x0;}else if(_0x52b10e<_0x3a7416&&_0x1b9c48[_0xb990('0x1a3')]===_0xb990('0x1a4')){freeVariablesPredictive(_0x1b9c48);loggerPredictive[_0xb990('0x79')](_0xb990('0x1a5'),'Dropped\x20calls\x20day',_0x3a7416,_0xb990('0x28'),_0x1b9c48[_0xb990('0x3b')]);}else if(_0x5a5743<_0x1b9c48[_0xb990('0x6b')]&&_0x1b9c48[_0xb990('0x1a3')]==='dropRate'){freeVariablesPredictive(_0x1b9c48);loggerPredictive[_0xb990('0x79')](_0xb990('0x1a6'),_0xb990('0x1a7'),_0x5a5743,_0xb990('0x1a8'),_0x1b9c48['predictiveIntervalErlangCallsDroppedCalls'],_0xb990('0x28'),_0x1b9c48[_0xb990('0x3b')]);}else if(!ifInterval(_0x1b9c48[_0xb990('0x1a9')],_0x1b9c48[_0xb990('0x28')])&&_[_0xb990('0x88')](_0x1b9c48[_0xb990('0x72')])&&!_[_0xb990('0x88')](_0x1b9c48[_0xb990('0x28')])){_0x1b9c48['startPredictive']=moment()[_0xb990('0x75')](_0xb990('0xf1'));loggerPredictive[_0xb990('0x79')](_0x1b9c48['name'],_0xb990('0x1aa'),_0x1b9c48['startPredictive']);this['averageHandleTime'](_0x1b9c48[_0xb990('0x1a9')])['then'](this[_0xb990('0x1ab')](_0x1b9c48))[_0xb990('0xb3')](mergeDataErlangB(_0x1b9c48))[_0xb990('0xb3')](this[_0xb990('0x1ac')](_0x1b9c48))['catch'](loggerCatchPredictive(_0xb990('0x1ad'),_0x1b9c48));}else if(!ifInterval(_0x1b9c48['dialPredictiveInterval'],_0x1b9c48[_0xb990('0x72')])){_0x1b9c48['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x1b9c48[_0xb990('0x72')]=moment()[_0xb990('0x75')](_0xb990('0xf1'));loggerPredictive['info'](_0x1b9c48[_0xb990('0x3b')],_0xb990('0x1ae'),_0x1b9c48[_0xb990('0x72')]);clearInterval(_0x1b9c48['handlePredictive']);_0x1b9c48[_0xb990('0x8a')]=undefined;this[_0xb990('0xba')](_0x1b9c48['dialPredictiveInterval'])[_0xb990('0xb3')](this[_0xb990('0x1ab')](_0x1b9c48))[_0xb990('0xb3')](mergeDataErlangB(_0x1b9c48))['then'](this[_0xb990('0x1ac')](_0x1b9c48))[_0xb990('0xad')](loggerCatchPredictive(_0xb990('0x1af'),_0x1b9c48));}else if(_0x1b9c48[_0xb990('0x19a')]&&_0x45bac5<_0x1b9c48[_0xb990('0x19a')]-_0x2a6b31){freeVariablesPredictive(_0x1b9c48);loggerPredictive['info'](_0x1b9c48[_0xb990('0x3b')],_0xb990('0x1b0'),_0x45bac5,_0xb990('0x1b1'),_0x1b9c48['predictiveIntervalAvailable'],'-',_0x2a6b31,'=',_0x1b9c48[_0xb990('0x19a')]-_0x2a6b31,')');}else if(_0x1b9c48[_0xb990('0x19a')]&&_0x45bac5>_0x1b9c48['predictiveIntervalAvailable']+_0x24b132){freeVariablesPredictive(_0x1b9c48);loggerPredictive[_0xb990('0x79')](_0x1b9c48[_0xb990('0x3b')],_0xb990('0x1b0'),_0x45bac5,')\x20are\x20more\x20than\x20threshold\x20(',_0x1b9c48[_0xb990('0x19a')],'+',_0x24b132,'=',_0x1b9c48['predictiveIntervalAvailable']+_0x24b132,')');}};Dialer['prototype'][_0xb990('0x1ab')]=function(_0x4f1062){var _0x5abc6f=this;return function(_0x4b0907){return new BPromise(function(_0x27cb31,_0x48138e){_[_0xb990('0x87')](_0x4f1062,_0x4b0907[0x0]);if(checkGetDataPredictive(_0x4b0907[0x0])){var _0x338138=_0x4f1062[_0xb990('0x19a')]=_0x4f1062[_0xb990('0x50')]+_0x4f1062[_0xb990('0x4a')];var _0x1ab001=_0x4f1062['dialPredictiveInterval']*0x3c;var _0x4ceaaa=_0x4b0907[0x0][_0xb990('0x67')]+_0x4b0907[0x0][_0xb990('0x66')];var _0x49e390=(_0x4b0907[0x0][_0xb990('0x65')]+_0x4b0907[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4b0907[0x0][_0xb990('0x68')])/_0x4b0907[0x0][_0xb990('0x80')];_0x4f1062[_0xb990('0x6c')]=_0x49e390>0x0?_0x49e390:0x1;switch(_0x4f1062[_0xb990('0x1a3')]){case _0xb990('0x1a4'):var _0x37c2cf=_0x4f1062['dialPredictiveOptimizationPercentage']/0x64;return _0x5abc6f['abandonmentRate'](_0x338138,_0x1ab001,_0x4ceaaa,_0x49e390,_0x37c2cf)[_0xb990('0xb3')](function(_0x3b7f22){return _0x27cb31(_0x3b7f22);});case _0xb990('0x1b2'):var _0x28b108=_0x4f1062[_0xb990('0x1b3')]/0x64;return _0x5abc6f['busyFactor'](_0x338138,_0x1ab001,_0x4ceaaa,_0x49e390,_0x28b108)['then'](function(_0x11088c){return _0x27cb31(_0x11088c);});default:return _0x48138e(msgResponse(_0xb990('0x1b4'),'Failure',_0xb990('0x1b5')));}}else{return _0x48138e(msgResponse(_0xb990('0x1b4'),'Failure',_0xb990('0x1b6')));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x20f07a){var _0x4c7229=this;return function(_0xa011f7){return new BPromise(function(_0x38fc44,_0x2de648){_[_0xb990('0x87')](_0x20f07a,_0xa011f7[0x0]);if(checkGetDataPredictive(_0xa011f7[0x0])){loggerPredictive[_0xb990('0x79')](JSON[_0xb990('0x43')](_0xa011f7[0x0]));if(_0x20f07a['dialPredictiveOptimization']===_0xb990('0x1a4')){return _0x4c7229['getVoiceQueueRtPauses'](_0x20f07a['id'])[_0xb990('0xb3')](function(_0x3085c6){var _0x178747=_0x20f07a[_0xb990('0x4b')]-_0x3085c6[0x0][_0xb990('0x1b7')];var _0x58d2b2=_0x20f07a['dialPredictiveInterval']*0x3c;var _0x162650=_0xa011f7[0x0][_0xb990('0x67')]+_0xa011f7[0x0][_0xb990('0x66')];var _0x6d260e=(_0xa011f7[0x0][_0xb990('0x65')]+_0xa011f7[0x0][_0xb990('0x69')]+_0xa011f7[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xa011f7[0x0][_0xb990('0x80')];var _0x4a4fca=_0x20f07a['dialPredictiveOptimizationPercentage']/0x64;_0x20f07a[_0xb990('0x1b8')]=_0x3085c6[0x0][_0xb990('0x1b7')]||0x0;_0x20f07a[_0xb990('0x6c')]=_0x6d260e>0x0?_0x6d260e:0x1;return _0x4c7229[_0xb990('0x1b9')](_0x178747,_0x58d2b2,_0x162650,_0x6d260e,_0x4a4fca);})[_0xb990('0xb3')](function(_0x3f88d3){return _0x38fc44(_0x3f88d3);})[_0xb990('0xad')](function(_0xac0813){return _0x2de648(msgResponse('[CatchErlangB]',_0xb990('0x11f'),JSON[_0xb990('0x43')](_0xac0813)));});}if(_0x20f07a[_0xb990('0x1a3')]==='agentBusyFactor'){return _0x4c7229['getVoiceQueueRtPauses'](_0x20f07a['id'])[_0xb990('0xb3')](function(_0x3f649a){var _0x7d4914=_0x20f07a['loggedIn']-_0x3f649a[0x0][_0xb990('0x1b7')];var _0x18d013=_0x20f07a['dialPredictiveInterval']*0x3c;var _0x30d3b1=_0xa011f7[0x0]['predictiveIntervalAvgTalktime']+_0xa011f7[0x0][_0xb990('0x66')];var _0x229512=(_0xa011f7[0x0][_0xb990('0x65')]+_0xa011f7[0x0][_0xb990('0x69')]+_0xa011f7[0x0][_0xb990('0x68')])/_0xa011f7[0x0][_0xb990('0x80')];var _0x1f47c9=_0x20f07a[_0xb990('0x1b3')]/0x64;_0x20f07a[_0xb990('0x1b8')]=_0x3f649a[0x0][_0xb990('0x1b7')]||0x0;_0x20f07a[_0xb990('0x6c')]=_0x229512>0x0?_0x229512:0x1;return _0x4c7229[_0xb990('0x1ba')](_0x7d4914,_0x18d013,_0x30d3b1,_0x229512,_0x1f47c9);})[_0xb990('0xb3')](function(_0x3b557e){return _0x38fc44(_0x3b557e);})['catch'](function(_0x5ab51c){return _0x2de648(msgResponse(_0xb990('0x1bb'),_0xb990('0x11f'),JSON[_0xb990('0x43')](_0x5ab51c)));});}}else{return _0x2de648(msgResponse(_0xb990('0x1b4'),_0xb990('0x11f'),'check\x20failure'));}});};};Dialer[_0xb990('0xa4')][_0xb990('0x1ac')]=function(_0x1ee3ba){var _0x3b880d=this;return function(){var _0x267e17=0x0;var _0x1706cd=Math[_0xb990('0x19c')](_0x1ee3ba[_0xb990('0x6f')]*0x3e8);if(_0x1706cd>0x0){_0x1706cd=_0x1706cd<0x64?0x64:_0x1706cd;loggerPredictive[_0xb990('0x79')](_0x1ee3ba[_0xb990('0x3b')],_0xb990('0x1bc'),_0x1706cd,_0xb990('0x44'));_0x1ee3ba['handlePredictive']=setInterval(function(){_0x3b880d[_0xb990('0x8a')](_0x1ee3ba);loggerPredictiveCalls[_0xb990('0x79')]('[handlePredictive]',_0x267e17+=0x1);},_0x1706cd);}else{loggerPredictive[_0xb990('0x79')](_0x1ee3ba['name'],_0xb990('0x1bd'));}};};Dialer['prototype'][_0xb990('0x1be')]=function(_0x131dce,_0x3d6a85){var _0x1f4c5e=this;return function(_0x744a07){if(_[_0xb990('0x8e')](_0x744a07)){if(_[_0xb990('0xaa')](_0x3d6a85['UserId'])||!_0x3d6a85[_0xb990('0x1bf')]){if(_0x131dce[_0xb990('0x56')]===_0xb990('0x7')){_0x131dce['queueStatusComplete']=_['isUndefined'](_0x131dce['queueStatusComplete'])?!![]:_0x131dce[_0xb990('0x10a')];var _0x23c597=uuid['v4']();_0x1f4c5e[_0xb990('0xa8')][_0x23c597]=new Action(_0x131dce,_0x3d6a85,_0x23c597);loggerBooked[_0xb990('0x79')](_0xb990('0x1c0'),_0x23c597,_0xb990('0x1c1'),JSON[_0xb990('0x43')](_0x131dce[_0xb990('0x10a')]),_0xb990('0x1c2'),_0x131dce[_0xb990('0x3b')]);if(_0x131dce['queueStatusComplete']){_0x131dce['queueStatusComplete']=![];_0x1f4c5e['queueBooked'][_0x1f4c5e[_0xb990('0xa8')][_0x23c597]['queue']]=[];ami[_0xb990('0xab')]({'actionid':_0x23c597,'action':_0xb990('0x1c3'),'queue':_0x131dce[_0xb990('0x3b')]})[_0xb990('0xad')](function(_0x175432){_0x1f4c5e[_0xb990('0xb1')](_0x131dce);_0x1f4c5e[_0xb990('0xbd')]({'active':![],'ContactId':_0x1f4c5e[_0xb990('0xa8')][_0x23c597][_0xb990('0xca')],'ListId':_0x1f4c5e[_0xb990('0xa8')][_0x23c597]['ListId'],'VoiceQueueId':_0x1f4c5e[_0xb990('0xa8')][_0x23c597][_0xb990('0xcc')]||undefined,'CampaignId':_0x1f4c5e[_0xb990('0xa8')][_0x23c597][_0xb990('0xcd')]||undefined})[_0xb990('0xad')](loggerCatch(_0xb990('0x1c4')));delete _0x1f4c5e[_0xb990('0xa8')][_0x23c597];});}else{loggerBooked[_0xb990('0x79')]('[booked][checkContactBlack][else]',JSON[_0xb990('0x43')](_0x131dce[_0xb990('0x10a')]),_0xb990('0x1c2'),_0x131dce[_0xb990('0x3b')]);_0x1f4c5e[_0xb990('0xb1')](_0x131dce);_0x1f4c5e[_0xb990('0xbd')]({'active':![],'ContactId':_0x1f4c5e[_0xb990('0xa8')][_0x23c597][_0xb990('0xca')],'ListId':_0x1f4c5e['actions'][_0x23c597][_0xb990('0x10c')],'VoiceQueueId':_0x1f4c5e['actions'][_0x23c597]['VoiceQueueId']||undefined,'CampaignId':_0x1f4c5e['actions'][_0x23c597][_0xb990('0xcd')]||undefined})[_0xb990('0xad')](loggerCatch(_0xb990('0x1c4')));delete _0x1f4c5e[_0xb990('0xa8')][_0x23c597];}}else{return _0x1f4c5e[_0xb990('0x1c5')](_0x131dce,_0x3d6a85);}}else{if(getDiff(_0x3d6a85[_0xb990('0x1c6')])<_0x131dce[_0xb990('0x1c7')]*0x3c){_0x1f4c5e['preview'][_0xb990('0x10b')](_0x3d6a85['id'])['finally'](function(){_0x1f4c5e['updateOriginated'](_0x131dce);});}else{_0x131dce['outboundReCallsDay']+=0x1;_0x1f4c5e[_0xb990('0xb1')](_0x131dce);if(_0x131dce[_0xb990('0x1c8')]){_0x1f4c5e[_0xb990('0xbd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3d6a85['ContactId'],'ListId':_0x3d6a85[_0xb990('0x10c')],'VoiceQueueId':_0x3d6a85[_0xb990('0xcc')]||undefined,'CampaignId':_0x3d6a85[_0xb990('0xcd')]||undefined})[_0xb990('0xad')](loggerCatch(_0xb990('0x1c9')));_0x1f4c5e[_0xb990('0xc4')](createObjHistory(_0x131dce,_0x3d6a85,_0xb990('0x1ca'),0x17,'RecallInQueue'))[_0xb990('0xad')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x1f4c5e[_0xb990('0xc9')](createObjHistory(_0x131dce,_0x3d6a85,_0xb990('0x1cb'),0x16,_0xb990('0x1cc')),_0xb990('0x1cd'),_0xb990('0x1ce'));}}}}else{_0x131dce[_0xb990('0x5c')]+=0x1;_0x1f4c5e[_0xb990('0xc9')](createObjHistory(_0x131dce,_0x3d6a85,'BLACKLIST',0xd,_0xb990('0x1cf')),'[Originate][historyBlacklist]',_0xb990('0x1d0'));throw _0xb990('0x1d1');}};};Dialer['prototype'][_0xb990('0x1d2')]=function(_0x45be22){var _0x9f0b86=this;var _0x1ce3d6=[];var _0x4812ce=_0x45be22[_0xb990('0x1d3')]-_0x45be22[_0xb990('0x6d')]-_0x45be22['temp'];emitCampaignSummary(_0x45be22);if(_0x4812ce>0x0){if(_0x4812ce>this[_0xb990('0x23')]){_0x4812ce=this['maxNumberOriginate'];}_0x45be22[_0xb990('0x1d4')]+=_0x4812ce;this[_0xb990('0xc1')](_0x45be22['id'],_0x4812ce,_0x45be22[_0xb990('0x1d5')])[_0xb990('0xb3')](function(_0x5e2660){_0x45be22[_0xb990('0x1d4')]-=_0x4812ce;_0x45be22[_0xb990('0x1d4')]=_0x45be22[_0xb990('0x1d4')]>0x0?_0x45be22['temp']:0x0;if(!checkContactEmpty(_0x5e2660)){_0x45be22[_0xb990('0x3a')]=_0xb990('0x99');logger[_0xb990('0x79')]('[getContactCampaign2][Empty]'+_0x45be22[_0xb990('0x3b')]);}else{_0x45be22[_0xb990('0x6d')]+=_0x5e2660['length'];_0x45be22['message']=_0xb990('0x1d6');for(var _0x1c1ddd=0x0;_0x1c1ddd<_0x5e2660[_0xb990('0x10f')];_0x1c1ddd+=0x1){_0x45be22[_0xb990('0x1d7')]+=0x1;if(_['isNil'](_0x5e2660[_0x1c1ddd])||_[_0xb990('0xaa')](_0x5e2660[_0x1c1ddd]['Contact'])||_[_0xb990('0xaa')](_0x5e2660[_0x1c1ddd][_0xb990('0x143')][_0xb990('0x144')])){_0x9f0b86[_0xb990('0xc7')](_0xb990('0x1d8'),_0x45be22,_0x5e2660[_0x1c1ddd]);}else{_0x9f0b86[_0xb990('0xb8')](_[_0xb990('0x107')](_0x5e2660[_0x1c1ddd],['CampaignId',_0xb990('0x1d9')]))[_0xb990('0xb3')](_0x9f0b86[_0xb990('0x1be')](_0x45be22,_0x5e2660[_0x1c1ddd]))['catch'](_0x9f0b86[_0xb990('0x1da')]('[actionOriginateIvr]\x20',_0x45be22));}}}})[_0xb990('0xad')](loggerGetContactDialer(_0xb990('0x1db'),_0x45be22,_0x4812ce));}};Dialer[_0xb990('0xa4')][_0xb990('0x133')]=function(_0x410d5b,_0x594cb2){var _0x348bdc=this;var _0x47280a=[];var _0x8f9536=_0x594cb2>=0x1?_0x594cb2:0x1;var _0x3732f1=[];if(_0x410d5b[_0xb990('0x56')]==='booked'){_0x8f9536=0x1;}var _0x16fbd5=Math['floor'](_0x410d5b[_0xb990('0x4a')]*_0x8f9536)-_0x410d5b[_0xb990('0x6d')]-_0x410d5b[_0xb990('0x1d4')];emitVoiceQueueSummary(_0x410d5b);if(_0x410d5b[_0xb990('0x1dc')]>0x0){var _0x25894c=_0x410d5b['dialLimitQueue']-_0x410d5b['originated']-_0x410d5b[_0xb990('0x50')]-_0x410d5b[_0xb990('0x1d4')]-_0x410d5b[_0xb990('0x4c')];if(_0x16fbd5>_0x25894c){_0x16fbd5=_0x25894c;}}if(_0x16fbd5>0x0){if(_0x410d5b[_0xb990('0x56')]===_0xb990('0x7')){_0x16fbd5=0x1;}if(_0x16fbd5>this[_0xb990('0x23')]){_0x16fbd5=this['maxNumberOriginate'];}_0x410d5b[_0xb990('0x1d4')]+=_0x16fbd5;for(var _0x2cf247 in this[_0xb990('0x21')]){if(this[_0xb990('0x21')][_0xb990('0x94')](_0x2cf247)){if(this[_0xb990('0x21')][_0x2cf247][_0xb990('0xa1')]===_0xb990('0x1dd')&&this[_0xb990('0x21')][_0x2cf247][_0xb990('0xac')]===_0xb990('0x1de')){_0x47280a['push'](this['agents'][_0x2cf247]['id']);}}}this[_0xb990('0xbf')](_0x410d5b['id'],_0x47280a,_0x16fbd5,_0x410d5b[_0xb990('0x1d5')])[_0xb990('0xb3')](function(_0x3dcf78){_0x410d5b[_0xb990('0x1d4')]-=_0x16fbd5;_0x410d5b[_0xb990('0x1d4')]=_0x410d5b[_0xb990('0x1d4')]>0x0?_0x410d5b[_0xb990('0x1d4')]:0x0;if(!checkContactEmpty(_0x3dcf78)){_0x348bdc[_0xb990('0xb2')](_0x410d5b)[_0xb990('0xb3')](sendMessageReschedule(_0x410d5b))['catch'](loggerCatch(_0xb990('0xb4')));}else{_0x410d5b['originated']+=_0x3dcf78[_0xb990('0x10f')];_0x410d5b[_0xb990('0x3a')]=_0x410d5b['dialMethod']===_0xb990('0x7')?_0xb990('0x14b'):_0xb990('0x1d6');for(var _0x28f842=0x0;_0x28f842<_0x3dcf78[_0xb990('0x10f')];_0x28f842+=0x1){if(_[_0xb990('0xaa')](_0x3dcf78[_0x28f842])||_[_0xb990('0xaa')](_0x3dcf78[_0x28f842][_0xb990('0x143')])||_[_0xb990('0xaa')](_0x3dcf78[_0x28f842][_0xb990('0x143')][_0xb990('0x144')])){_0x348bdc[_0xb990('0xc7')](_0xb990('0x1d8'),_0x410d5b,_0x3dcf78[_0x28f842]);}else{_0x348bdc[_0xb990('0xb5')](_[_0xb990('0x107')](_0x3dcf78[_0x28f842],[_0xb990('0xcc'),'Contact.phone']))[_0xb990('0xb3')](_0x348bdc[_0xb990('0x1be')](_0x410d5b,_0x3dcf78[_0x28f842]))[_0xb990('0xad')](_0x348bdc[_0xb990('0x1da')](_0xb990('0x1d8'),_0x410d5b));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x410d5b,_0x16fbd5));}};Dialer[_0xb990('0xa4')][_0xb990('0x8a')]=function(_0x1e5407){var _0x36b8f8=this;if(_0x1e5407[_0xb990('0x1dc')]>0x0){var _0x5819f2=_0x1e5407[_0xb990('0x1dc')]-_0x1e5407[_0xb990('0x6d')]-_0x1e5407[_0xb990('0x50')];if(_0x5819f2>0x0){this[_0xb990('0x1df')](_0x1e5407);}else{loggerPredictiveCalls[_0xb990('0x79')](_0xb990('0x1e0'));}}else{this[_0xb990('0x1df')](_0x1e5407);}};Dialer['prototype'][_0xb990('0x1df')]=function(_0x56e62b){var _0x44e69b=this;var _0x5a617a=[];_0x56e62b[_0xb990('0x6d')]+=0x1;for(var _0x4adc26 in this['agents']){if(this['agents'][_0xb990('0x94')](_0x4adc26)){if(this[_0xb990('0x21')][_0x4adc26][_0xb990('0xa1')]==='not_inuse'&&this[_0xb990('0x21')][_0x4adc26]['status']===_0xb990('0x1de')){_0x5a617a[_0xb990('0x106')](this['agents'][_0x4adc26]['id']);}}}this['getContactDialer'](_0x56e62b['id'],_0x5a617a,0x1,_0x56e62b[_0xb990('0x1d5')])['then'](function(_0x1c7a50){if(!checkContactEmpty(_0x1c7a50)){checkContactLowerLimitOriginate(_0x56e62b,0x1,0x0);_0x44e69b[_0xb990('0xb2')](_0x56e62b)[_0xb990('0xb3')](sendMessageReschedule(_0x56e62b))[_0xb990('0xad')](loggerCatch(_0xb990('0xb4')));}else{_0x56e62b[_0xb990('0x3a')]=_0xb990('0x1d6');if(_['isNil'](_0x1c7a50[0x0])||_[_0xb990('0xaa')](_0x1c7a50[0x0][_0xb990('0x143')])||_[_0xb990('0xaa')](_0x1c7a50[0x0][_0xb990('0x143')][_0xb990('0x144')])){_0x44e69b[_0xb990('0xc7')](_0xb990('0x1d8'),_0x56e62b,_0x1c7a50[0x0]);}else{_0x44e69b[_0xb990('0xb5')](_['pick'](_0x1c7a50[0x0],[_0xb990('0xcc'),'Contact.phone']))[_0xb990('0xb3')](_0x44e69b[_0xb990('0x1be')](_0x56e62b,_0x1c7a50[0x0]))['catch'](_0x44e69b['loggerHandler']('[actionOriginatePredictive]\x20',_0x56e62b));}}})[_0xb990('0xad')](loggerGetContactDialer(_0xb990('0x1e1'),_0x56e62b,0x1));emitVoiceQueueSummary(_0x56e62b);};Dialer[_0xb990('0xa4')]['abandonmentRate']=function(_0x59be86,_0xa55603,_0x16bb43,_0x421228,_0x1ea120,_0x4dc3e8){loggerPredictive[_0xb990('0x79')](_0xb990('0x1e2'));loggerPredictive[_0xb990('0x79')](_0xb990('0x1e3'),_0x59be86);loggerPredictive[_0xb990('0x79')](_0xb990('0x1e4'),_0xa55603);loggerPredictive['info'](_0xb990('0x1e5'),_0x16bb43);loggerPredictive[_0xb990('0x79')](_0xb990('0x1e6'),_0x421228);loggerPredictive[_0xb990('0x79')](_0xb990('0x1e7'),_0x1ea120);loggerPredictive['info'](_0xb990('0x1e8'));return new BPromise(function(_0x55a375,_0x677ef){if(_0x59be86<=0x0||isNaN(_0x59be86)){return _0x677ef(msgResponse(_0xb990('0x1e9'),'Error',_0xb990('0x1ea')+_0x59be86));}if(_0x16bb43<=0x0||isNaN(_0x16bb43)){return _0x677ef(msgResponse('[abandonmentRate]',_0xb990('0x42'),_0xb990('0x1eb')+_0x16bb43));}if(_0x421228<=0x0||isNaN(_0x421228)){return _0x677ef(msgResponse(_0xb990('0x1e9'),_0xb990('0x42'),_0xb990('0x1ec')+_0x421228));}if(_0xa55603<=0x0||isNaN(_0xa55603)){return _0x677ef(msgResponse(_0xb990('0x1e9'),_0xb990('0x42'),_0xb990('0x1ed')+_0xa55603));}if(_0x1ea120<=0x0||isNaN(_0x1ea120)){return _0x677ef(msgResponse(_0xb990('0x1e9'),_0xb990('0x42'),_0xb990('0x1ee')+_0x1ea120));}_0x4dc3e8=_0x4dc3e8||0x0;var _0x17ea70=0x1/_0x16bb43;var _0x6dbb46=0x0;var _0x49c171=0x0;var _0x4eee1a=0x0;var _0xb887f4=0x0;for(var _0x19d784=0x0;_0x4eee1a<_0x1ea120;_0x19d784+=0x1){_0x49c171=_0x19d784/_0xa55603;_0x6dbb46=(_0x421228*_0x49c171+_0x4dc3e8)/_0x17ea70;_0x4eee1a=erlangb(_0x6dbb46,_0x59be86);_0xb887f4=_0x6dbb46/_0x59be86*(0x1-erlangb(_0x6dbb46,_0x59be86));}return _0x55a375({'erlangCalls':_0x19d784,'erlangCallToSecond':_0xa55603/_0x19d784,'erlangAbandonmentRate':_0x4eee1a,'erlangBusyFactor':_0xb887f4});});};Dialer[_0xb990('0xa4')]['busyFactor']=function(_0x591585,_0x59888a,_0xc8c989,_0x3e017d,_0xa5700a,_0x1d722e){loggerPredictive[_0xb990('0x79')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xb990('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',_0x591585);loggerPredictive['info'](_0xb990('0x1e4'),_0x59888a);loggerPredictive[_0xb990('0x79')](_0xb990('0x1e5'),_0xc8c989);loggerPredictive[_0xb990('0x79')](_0xb990('0x1e6'),_0x3e017d);loggerPredictive[_0xb990('0x79')](_0xb990('0x1ef'),_0xa5700a);loggerPredictive[_0xb990('0x79')](_0xb990('0x1e8'));return new BPromise(function(_0x224ba6,_0x121440){if(_0x591585<=0x0||isNaN(_0x591585)){return _0x121440(msgResponse(_0xb990('0x1f0'),_0xb990('0x42'),_0xb990('0x1ea')+_0x591585));}if(_0xc8c989<=0x0||isNaN(_0xc8c989)){return _0x121440(msgResponse(_0xb990('0x1f0'),_0xb990('0x42'),_0xb990('0x1eb')+_0xc8c989));}if(_0x3e017d<=0x0||isNaN(_0x3e017d)){return _0x121440(msgResponse('[busyFactor]','Error',_0xb990('0x1ec')+_0x3e017d));}if(_0x59888a<=0x0||isNaN(_0x59888a)){return _0x121440(msgResponse(_0xb990('0x1f0'),_0xb990('0x42'),_0xb990('0x1ed')+_0x59888a));}if(_0xa5700a<=0x0||isNaN(_0xa5700a)){return _0x121440(msgResponse(_0xb990('0x1f0'),_0xb990('0x42'),_0xb990('0x1f1')+_0xa5700a));}_0x1d722e=_0x1d722e||0x0;var _0x120ebf=0x1/_0xc8c989;var _0x206c47=0x0;var _0x1ba837=0x0;var _0xaa1c7b=0x0;var _0x41265a=0x0;for(var _0x271de4=0x0;_0x41265a<_0xa5700a;_0x271de4+=0x1){_0x1ba837=_0x271de4/_0x59888a;_0x206c47=(_0x3e017d*_0x1ba837+_0x1d722e)/_0x120ebf;_0xaa1c7b=erlangb(_0x206c47,_0x591585);_0x41265a=_0x206c47/_0x591585*(0x1-erlangb(_0x206c47,_0x591585));}return _0x224ba6({'erlangCalls':_0x271de4,'erlangCallToSecond':_0x59888a/_0x271de4,'erlangAbandonmentRate':_0xaa1c7b,'erlangBusyFactor':_0x41265a});});};module[_0xb990('0x1f2')]=Dialer; \ No newline at end of file +var _0xd389=['countbusyretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerRetryFrequency','dialBusyRetryFrequency','minutes','countcongestionretry','add','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','reason','NoSuchNumber','[syncAgentComplete][createHistory][0]','reason\x200\x20no\x20such\x20number....','createStateFinal','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','stateGlobal','Busy','countglobal','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','busyFactor','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','booked','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','[countReScheduled]\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','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Error','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Ts\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','moment','ioredis','../../../config/environment/','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./action','./agentComplete','./queueCallerAbandon','env','127.0.0.1','roundrobin','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','bind','agentcomplete','syncAgentComplete','custom:queuesummary','newexten','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','stringify','milliseconds','seconds','emit','type','outbound','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','format','campaign:ivr:%s','campaign:save','isEmpty','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','info','Answered\x20Calls:\x20\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','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','hasOwnProperty','originated','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','statedesc','clearZombieChannels','[uniqueid]','[actions]','prototype','isNil','Action','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel][ivr]','countReScheduled','then','checkIsBlackList','resolve','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','saveInDb','pick','ListId','VoiceQueueId','[emptyContact]','SIP/%s','status','reachable','unmonitored','uniqueid','variable','amdstatus','value','state','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','dialAMDActive','outboundAnswerAgiCallsDay','Machine','amd','[syncMachine][createHistory]','[syncMachine]','HANGUP','[syncHangupInAMDIvr][createHistory]','MACHINE','[syncMachineIvr][createHistory]','[syncMachineIvr]','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','AnswerAGI','AGI','dialQueueProject','cause-txt','Unknow','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','YYYY-MM-DD\x20HH:mm:ss','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialQueueProject2','Abandoned','CALLEREXIT','actions','actionid','strategy','locked','stateinterface','rrmemory','paused','queueStatusComplete','[unlockQueueStatus][undefined]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','finally','ContactId','CampaignId','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','push','command','iftime\x20%s,%s','content','indexOf','true','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','NONE','\x22agi://%s/square,%s\x22','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','trim','dialCutDigit','SIP/%s/%s%s','substring','from-sip','[originateError]:\x20%s','starttime','[originate][error]','originate\x20action\x20Error','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax'];(function(_0x3223e5,_0x444ba2){var _0x3a6a60=function(_0x2ec19a){while(--_0x2ec19a){_0x3223e5['push'](_0x3223e5['shift']());}};_0x3a6a60(++_0x444ba2);}(_0xd389,0x7a));var _0x9d38=function(_0x21f0fc,_0x56ae34){_0x21f0fc=_0x21f0fc-0x0;var _0x4a12ec=_0xd389[_0x21f0fc];return _0x4a12ec;};'use strict';var util=require(_0x9d38('0x0'));var _=require(_0x9d38('0x1'));var BPromise=require('bluebird');var uuid=require(_0x9d38('0x2'));var moment=require(_0x9d38('0x3'));var rr=require('rr');var md5=require('md5');var Redis=require(_0x9d38('0x4'));var config=require(_0x9d38('0x5'));var logger=require(_0x9d38('0x6'))(_0x9d38('0x7'));var loggerBooked=require('../../../config/logger')('booked');var loggerPredictive=require('../../../config/logger')(_0x9d38('0x8'));var loggerPredictiveCalls=require(_0x9d38('0x6'))(_0x9d38('0x9'));var loggerSyncQueueSummary=require(_0x9d38('0x6'))(_0x9d38('0xa'));var ami=require('../ami');config[_0x9d38('0xb')]=_[_0x9d38('0xc')](config[_0x9d38('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x9d38('0xd'))(new Redis(config[_0x9d38('0xb')]));var cmHopper=require(_0x9d38('0xe'));var cmHopperFinal=require(_0x9d38('0xf'));var cmHopperHistory=require(_0x9d38('0x10'));var cmHopperBlack=require(_0x9d38('0x11'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x9d38('0x12'));var History=require('./history');var Final=require('./final');var AgentComplete=require(_0x9d38('0x13'));var QueueCallerAbandon=require(_0x9d38('0x14'));var Hangup=require('./hangup');var ipAgi=process[_0x9d38('0x15')]['XCALLY_IP_AGI']||_0x9d38('0x16');var strategy={'rrmemory':'rrmemory','roundrobin':_0x9d38('0x17')};var Sequence=function(){};Sequence['prototype'][_0x9d38('0x18')]=function(_0x1c8d95){this[_0x9d38('0x19')]=this[_0x9d38('0x19')]?this['tail']['finally'](_0x1c8d95):_0x1c8d95();};function Dialer(_0x5ec25a,_0x302099){this[_0x9d38('0x1a')]=new Sequence();this[_0x9d38('0x1b')]=_0x302099;this['voiceQueues']=_0x5ec25a[_0x9d38('0x1c')];this[_0x9d38('0x1d')]=_0x5ec25a[_0x9d38('0x1d')];this[_0x9d38('0x1e')]=_0x5ec25a[_0x9d38('0x1e')];this[_0x9d38('0x1f')]=_0x5ec25a[_0x9d38('0x1f')];this[_0x9d38('0x20')]=config[_0x9d38('0x20')]||0x2;this[_0x9d38('0x21')]={};this['actions']={};this[_0x9d38('0x22')]={};this[_0x9d38('0x23')]={};this['optionPredictive']={};this['startPredictive']={};this[_0x9d38('0x24')]={};this[_0x9d38('0x25')]={};this[_0x9d38('0x26')]={};this[_0x9d38('0x27')]={};ami['on'](_0x9d38('0x28'),this[_0x9d38('0x29')]['bind'](this));ami['on'](_0x9d38('0x2a'),this[_0x9d38('0x2b')]['bind'](this));ami['on'](_0x9d38('0x2c'),this[_0x9d38('0x2d')][_0x9d38('0x2e')](this));ami['on'](_0x9d38('0x2f'),this[_0x9d38('0x30')][_0x9d38('0x2e')](this));ami['on'](_0x9d38('0x31'),this[_0x9d38('0xa')][_0x9d38('0x2e')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0x9d38('0x32'),this[_0x9d38('0x33')]['bind'](this));ami['on'](_0x9d38('0x34'),this['syncVarSet'][_0x9d38('0x2e')](this));ami['on'](_0x9d38('0x35'),this[_0x9d38('0x36')][_0x9d38('0x2e')](this));ami['on'](_0x9d38('0x37'),this[_0x9d38('0x38')][_0x9d38('0x2e')](this));this[_0x9d38('0x39')]();this[_0x9d38('0x3a')]();}function isNotNull(_0x360b3c){return _0x360b3c!==null&&!_['isUndefined'](_0x360b3c);}function checkIsLoggedIn(_0xceff88,_0x9eccc6){return function(){if(_0x9eccc6<=0x0){_0xceff88[_0x9d38('0x3b')]='AGENTS_NOT_LOGGED';throw _0xceff88[_0x9d38('0x3c')]+_0x9d38('0x3d');}};}function isActive(_0x3950b3){return _0x3950b3;}function checkIsActive(_0x52cd71,_0x55097d){return function(){if(!isActive(_0x55097d)){_0x52cd71[_0x9d38('0x3b')]=_0x9d38('0x3e');throw _0x52cd71[_0x9d38('0x3c')]+_0x9d38('0x3f');}};}function checkInterval(_0x1cb438){return function(){if(!isNotNull(_0x1cb438[_0x9d38('0x40')])){_0x1cb438[_0x9d38('0x3b')]=_0x9d38('0x41');throw _0x1cb438[_0x9d38('0x3c')]+_0x9d38('0x42');}if(!isNotNull(_0x1cb438['Interval']['Intervals'])){_0x1cb438[_0x9d38('0x3b')]=_0x9d38('0x41');throw _0x1cb438[_0x9d38('0x3c')]+_0x9d38('0x42');}if(!isNotNull(_['isEmpty'](_0x1cb438[_0x9d38('0x40')][_0x9d38('0x43')]))){_0x1cb438[_0x9d38('0x3b')]=_0x9d38('0x41');throw _0x1cb438[_0x9d38('0x3c')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x183b89,_0x3bbb47,_0x5cbcce){return{'action':_0x183b89,'response':_0x3bbb47,'message':_0x5cbcce,'stack':_0x5cbcce};}function myreject(_0x5449bf){return function(_0x59b05e){return _0x5449bf(msgResponse('[ifTime][Action]','Error',JSON[_0x9d38('0x44')](_0x59b05e)));};}function getSeconds(_0x26b050,_0x2a6d79){var _0x4ddb5f=moment(_0x26b050)[_0x9d38('0x45')](0x0);var _0x56c696=moment(_0x2a6d79)[_0x9d38('0x45')](0x0);return _0x4ddb5f['diff'](_0x56c696,_0x9d38('0x46'));}function emit(_0x2acbdd,_0x4c4ffb,_0x28d319){io['to'](_0x2acbdd)[_0x9d38('0x47')](_0x4c4ffb,_0x28d319);}function emitVoiceQueueSummary(_0x45ac5a){if(_0x45ac5a[_0x9d38('0x48')]===_0x9d38('0x49')){var _0x2841a7={'id':_0x45ac5a['id'],'name':_0x45ac5a[_0x9d38('0x3c')],'strategy':_0x45ac5a['strategy'],'answered':_0x45ac5a[_0x9d38('0x4a')],'available':_0x45ac5a[_0x9d38('0x4b')],'loggedIn':_0x45ac5a[_0x9d38('0x4c')],'pTalking':_0x45ac5a[_0x9d38('0x4d')],'sumBillable':_0x45ac5a[_0x9d38('0x4e')],'sumDuration':_0x45ac5a[_0x9d38('0x4f')],'sumHoldTime':_0x45ac5a[_0x9d38('0x50')]||0x0,'talking':_0x45ac5a[_0x9d38('0x51')],'total':_0x45ac5a[_0x9d38('0x52')],'type':_0x45ac5a['type'],'unmanaged':_0x45ac5a[_0x9d38('0x53')],'abandoned':_0x45ac5a[_0x9d38('0x54')],'waiting':_0x45ac5a[_0x9d38('0x55')],'loggedInDb':_0x45ac5a[_0x9d38('0x56')],'dialActive':_0x45ac5a[_0x9d38('0x57')],'dialMethod':_0x45ac5a[_0x9d38('0x58')],'dialOriginateCallerIdName':_0x45ac5a[_0x9d38('0x59')],'dialOriginateCallerIdNumber':_0x45ac5a[_0x9d38('0x5a')],'dialOriginateTimeout':_0x45ac5a[_0x9d38('0x5b')],'dialPrefix':_0x45ac5a[_0x9d38('0x5c')],'outboundAnswerAgiCallsDay':_0x45ac5a['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x45ac5a[_0x9d38('0x5d')],'outboundBlacklistCallsDay':_0x45ac5a['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x45ac5a[_0x9d38('0x5e')],'outboundCongestionCallsDay':_0x45ac5a['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x45ac5a['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x45ac5a[_0x9d38('0x5f')],'outboundDropCallsDayTimeout':_0x45ac5a[_0x9d38('0x60')],'outboundNoAnswerCallsDay':_0x45ac5a[_0x9d38('0x61')],'outboundNoSuchCallsDay':_0x45ac5a[_0x9d38('0x62')],'outboundOriginateFailureCallsDay':_0x45ac5a[_0x9d38('0x63')],'outboundReCallsDay':_0x45ac5a['outboundReCallsDay'],'outboundRejectCallsDay':_0x45ac5a['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x45ac5a[_0x9d38('0x64')],'predictiveIntervalAnsweredCalls':_0x45ac5a[_0x9d38('0x65')],'predictiveIntervalAvgHoldtime':_0x45ac5a[_0x9d38('0x66')],'predictiveIntervalAvgTalktime':_0x45ac5a[_0x9d38('0x67')],'predictiveIntervalDroppedCallsCallersExit':_0x45ac5a[_0x9d38('0x68')],'predictiveIntervalDroppedCallsTimeout':_0x45ac5a[_0x9d38('0x69')],'predictiveIntervalErlangCalls':_0x45ac5a[_0x9d38('0x6a')],'predictiveIntervalErlangCallsDroppedCalls':_0x45ac5a[_0x9d38('0x6b')],'predictiveIntervalHitRate':_0x45ac5a['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x45ac5a[_0x9d38('0x6c')],'predictiveIntervalPauses':_0x45ac5a[_0x9d38('0x6d')],'predictiveIntervalAvailable':_0x45ac5a[_0x9d38('0x6e')],'predictiveIntervalTotalCalls':_0x45ac5a[_0x9d38('0x6f')],'message':_0x45ac5a[_0x9d38('0x3b')],'originated':_0x45ac5a['originated'],'erlangCalls':_0x45ac5a[_0x9d38('0x70')],'erlangCallToSecond':_0x45ac5a[_0x9d38('0x71')],'erlangAbandonmentRate':_0x45ac5a[_0x9d38('0x72')],'erlangBusyFactor':_0x45ac5a[_0x9d38('0x73')],'startPredictive':_0x45ac5a[_0x9d38('0x74')],'startProgressive':_0x45ac5a[_0x9d38('0x24')]};if(_0x45ac5a[_0x9d38('0x75')]){_0x2841a7[_0x9d38('0x75')]={'id':_0x45ac5a[_0x9d38('0x75')]['id'],'name':_0x45ac5a['Trunk'][_0x9d38('0x3c')],'active':_0x45ac5a[_0x9d38('0x75')][_0x9d38('0x76')],'callerid':_0x45ac5a[_0x9d38('0x75')][_0x9d38('0x77')]};}if(_0x45ac5a[_0x9d38('0x40')]){_0x2841a7['Interval']={'id':_0x45ac5a['Interval']['id'],'name':_0x45ac5a['Interval'][_0x9d38('0x3c')]};}var _0x1e617d=md5(JSON['stringify'](_0x2841a7));if(_0x45ac5a['md5']!==_0x1e617d){_0x45ac5a['md5']=_0x1e617d;emit(util['format']('voice:queue:%s',_0x2841a7[_0x9d38('0x3c')]),'voice_queue:save',_0x2841a7);}}}function emitCampaignSummary(_0x4e697c){if(_0x4e697c[_0x9d38('0x48')]==='ivr'){emit(util[_0x9d38('0x78')](_0x9d38('0x79'),_0x4e697c[_0x9d38('0x3c')]),_0x9d38('0x7a'),_0x4e697c);}}function checkGetDataPredictive(_0x18219f){if(isNotNull(_0x18219f)){if(!_[_0x9d38('0x7b')](_0x18219f)){loggerPredictive['info'](_0x9d38('0x7c'));loggerPredictive['info'](_0x9d38('0x7d'),_0x18219f[_0x9d38('0x6f')]);loggerPredictive[_0x9d38('0x7e')](_0x9d38('0x7f'),_0x18219f[_0x9d38('0x65')]);loggerPredictive[_0x9d38('0x7e')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x18219f[_0x9d38('0x69')]);loggerPredictive['info'](_0x9d38('0x80'),_0x18219f[_0x9d38('0x68')]);loggerPredictive['info'](_0x9d38('0x81'),_0x18219f[_0x9d38('0x66')]);loggerPredictive[_0x9d38('0x7e')](_0x9d38('0x82'),_0x18219f[_0x9d38('0x67')]);loggerPredictive[_0x9d38('0x7e')]('---------------------------');if(_0x18219f['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x18219f[_0x9d38('0x67')])&&_0x18219f['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive[_0x9d38('0x7e')](_0x9d38('0x83'));}if(!_[_0x9d38('0x84')](_0x18219f[_0x9d38('0x66')])&&_0x18219f['predictiveIntervalAvgHoldtime']>0x0){return!![];}else{loggerPredictive[_0x9d38('0x7e')](_0x9d38('0x85'));}}else{loggerPredictive['info'](_0x9d38('0x86'));}}else{loggerPredictive[_0x9d38('0x7e')](_0x9d38('0x87'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x1174bd){return function(_0x5907a5){loggerPredictive[_0x9d38('0x7e')](_0x9d38('0x88'));loggerPredictive[_0x9d38('0x7e')](_0x9d38('0x89'),_0x5907a5[_0x9d38('0x70')]);loggerPredictive['info'](_0x9d38('0x8a'),_0x5907a5['erlangCallToSecond']);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5907a5[_0x9d38('0x72')]);loggerPredictive['info'](_0x9d38('0x8b'),_0x5907a5[_0x9d38('0x73')]);loggerPredictive['info'](_0x9d38('0x8c'),_0x5907a5['erlangAbandonmentRate']);loggerPredictive[_0x9d38('0x7e')]('---------------------------');_[_0x9d38('0x8d')](_0x1174bd,_0x5907a5);};}function getDiff(_0x56ca2d){var _0x1e42af=moment()['milliseconds'](0x0);var _0x3a427e=moment(_0x56ca2d)[_0x9d38('0x45')](0x0);return _0x1e42af['diff'](_0x3a427e,_0x9d38('0x46'));}function ifInterval(_0x3e61ab,_0xf0e39d){if(_['isUndefined'](_0xf0e39d)){return![];}if(getDiff(_0xf0e39d)<_0x3e61ab*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x58bcde){if(isNotNull(_0x58bcde)){if(!_[_0x9d38('0x84')](_0x58bcde[_0x9d38('0x24')])){_0x58bcde['startProgressive']=undefined;loggerPredictive[_0x9d38('0x7e')](_0x58bcde[_0x9d38('0x3c')],_0x9d38('0x8e'));}if(!_[_0x9d38('0x84')](_0x58bcde[_0x9d38('0x74')])){_0x58bcde[_0x9d38('0x74')]=undefined;loggerPredictive[_0x9d38('0x7e')](_0x58bcde[_0x9d38('0x3c')],_0x9d38('0x8f'));}if(!_['isUndefined'](_0x58bcde[_0x9d38('0x90')])){clearInterval(_0x58bcde[_0x9d38('0x90')]);_0x58bcde[_0x9d38('0x90')]=undefined;loggerPredictive[_0x9d38('0x7e')](_0x58bcde[_0x9d38('0x3c')],_0x9d38('0x91'));}}}function erlangb(_0x557092,_0x298751){if(_0x298751===0x0){return 0x0;}var _0x117a53=0x1;for(var _0xbc821a=0x1;_0xbc821a<=_0x298751;_0xbc821a+=0x1){_0x117a53=0x1+_0x117a53*_0xbc821a/_0x557092;}return 0x1/_0x117a53;}function isVoiceQueueOutbound(_0x257ee0){return _0x257ee0===_0x9d38('0x49');}function isNotPreview(_0x22c5f6){return _0x22c5f6!==_0x9d38('0x1b');}function isCampaignIvr(_0x176826){return _0x176826===_0x9d38('0x92');}function getCallerId(_0x59c5c5,_0x485613,_0x11abef){if(!_['isUndefined'](_0x11abef)&&_0x9d38('0x93')===typeof _0x11abef&&!_[_0x9d38('0x7b')](_0x11abef)){if(!_[_0x9d38('0x84')](_0x485613)&&_0x9d38('0x93')===typeof _0x485613&&!_[_0x9d38('0x7b')](_0x485613)){return util['format']('\x22%s\x22\x20<%s>',_0x485613,_0x11abef);}return util[_0x9d38('0x78')](_0x9d38('0x94'),_0x11abef,_0x11abef);}if(!_[_0x9d38('0x84')](_0x59c5c5)&&'string'===typeof _0x59c5c5&&!_['isEmpty'](_0x59c5c5)){return _0x59c5c5;}return _0x9d38('0x95');}function loggerCatchQueueSummary(_0x4ac4de,_0x1068a7){return function(_0x599074){freeVariablesPredictive(_0x1068a7);emitVoiceQueueSummary(_0x1068a7);emitCampaignSummary(_0x1068a7);loggerSyncQueueSummary[_0x9d38('0x96')](_0x4ac4de,util[_0x9d38('0x97')](_0x599074,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x334aa6,_0x40a922){return function(_0x6abca0){loggerPredictive['error'](_0x40a922[_0x9d38('0x3c')],_0x334aa6);loggerPredictive[_0x9d38('0x96')](_0x6abca0['stack']);freeVariablesPredictive(_0x40a922);};}function loggerCatch(_0x50511e){return function(_0x55d4bc){logger['error'](_0x50511e,util[_0x9d38('0x97')](_0x55d4bc,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x43e6fa){return _0x43e6fa&&!_['isUndefined'](_0x43e6fa)&&_0x43e6fa['length']>0x0;}function decremetOriginate(_0x5ce017){if(!_[_0x9d38('0x84')](_0x5ce017)&&_0x5ce017!==null){if(_0x5ce017[_0x9d38('0x98')]('originated')){if(_0x5ce017[_0x9d38('0x99')]>0x0){_0x5ce017[_0x9d38('0x99')]-=0x1;}else{logger[_0x9d38('0x96')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x9d38('0x96')](_0x9d38('0x9a'));}}function checkContactLowerLimitOriginate(_0x5927ac,_0xd61b33,_0x3a4826){if(_0xd61b33>_0x3a4826){for(var _0x4bdce3=0x0;_0x4bdce3<_0xd61b33-_0x3a4826;_0x4bdce3+=0x1){decremetOriginate(_0x5927ac);}}}function loggerGetContactDialer(_0x4e243c,_0x41b4d1,_0x5374f0){return function(_0x5a6e15){checkContactLowerLimitOriginate(_0x41b4d1,_0x5374f0,0x0);logger[_0x9d38('0x96')](_0x4e243c,util[_0x9d38('0x97')](_0x5a6e15,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x14b4d9){return function(_0x59f5cc){if(isNotNull(_0x59f5cc)&&isNotNull(_0x59f5cc[0x0])){if(_0x59f5cc[0x0]['contactsRescheduled']>0x0){_0x14b4d9[_0x9d38('0x3b')]=_0x9d38('0x9b');logger[_0x9d38('0x7e')](_0x9d38('0x9c')+_0x14b4d9[_0x9d38('0x3c')],_0x59f5cc[0x0]['contactsRescheduled'],_0x9d38('0x9d'));}else{_0x14b4d9[_0x9d38('0x3b')]=_0x9d38('0x9e');logger['info'](_0x9d38('0x9f')+_0x14b4d9[_0x9d38('0x3c')]);}}};}function notSendMessagesQueue(_0x565e1d){if(_0x565e1d[_0x9d38('0xa0')]){freeVariablesPredictive(_0x565e1d);if(_0x565e1d['originated']===0x0&&_0x565e1d['talking']===0x0&&_0x565e1d[_0x9d38('0x55')]===0x0&&(_0x565e1d[_0x9d38('0x4d')]||0x0)===0x0){_0x565e1d['sendMessageOneNotActive']=![];_0x565e1d[_0x9d38('0x4b')]=0x0;_0x565e1d[_0x9d38('0x3b')]=_0x9d38('0x3e');loggerSyncQueueSummary[_0x9d38('0x96')](_0x9d38('0xa1'),_0x565e1d[_0x9d38('0x3c')],_0x9d38('0xa2'));}else{_0x565e1d[_0x9d38('0x3b')]='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0x9d38('0xa1'),_0x565e1d[_0x9d38('0x3c')],_0x9d38('0xa3'));}emitVoiceQueueSummary(_0x565e1d);}}function notSendMessagesCampaign(_0x2353f0){if(_0x2353f0['sendMessageOneNotActive']){if(_0x2353f0[_0x9d38('0x99')]===0x0){_0x2353f0[_0x9d38('0xa0')]=![];_0x2353f0['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0x9d38('0x96')](_0x9d38('0xa4'),_0x2353f0[_0x9d38('0x3c')],'is\x20not\x20active');}else{_0x2353f0[_0x9d38('0x3b')]=_0x9d38('0xa5');loggerSyncQueueSummary[_0x9d38('0x96')](_0x9d38('0xa4'),_0x2353f0['name'],_0x9d38('0xa3'));}emitCampaignSummary(_0x2353f0);}}function createObjHistory(_0x540b13,_0x2733f1,_0x4d7f25,_0x16662,_0x21e466){_0x540b13[_0x9d38('0x3b')]=_0x4d7f25;var _0x49f704=new Action(_0x540b13,_0x2733f1);var _0x1cb983=new History(_0x49f704);_0x1cb983['state']=_0x16662;_0x1cb983[_0x9d38('0xa6')]=_0x21e466;_0x1cb983['endtime']=_0x49f704['starttime'];return _0x1cb983;}Dialer['prototype'][_0x9d38('0x3a')]=function(){var _0x1536b1=this;setInterval(function(){_0x1536b1[_0x9d38('0xa7')](_0x1536b1[_0x9d38('0x23')],_0x9d38('0xa8'));_0x1536b1[_0x9d38('0xa7')](_0x1536b1['actions'],_0x9d38('0xa9'));},0x32c8);};Dialer[_0x9d38('0xaa')]['clearZombieChannels']=function(_0x4873b4,_0x5ebc95){var _0x5417e6=this;for(var _0x3018af in _0x4873b4){if(_0x4873b4[_0x9d38('0x98')](_0x3018af)){this[_0x9d38('0x1a')][_0x9d38('0x18')](function(){if(!_[_0x9d38('0xab')](_0x4873b4[_0x3018af])){return ami[_0x9d38('0xac')]({'action':'status','channel':_0x4873b4[_0x3018af][_0x9d38('0xad')]})[_0x9d38('0xae')](function(_0x15137e){if(_0x15137e[_0x9d38('0x3b')]===_0x9d38('0xaf')){setTimeout(function(){if(_0x4873b4[_0x3018af]&&_0x4873b4[_0x3018af][_0x9d38('0x48')]!=='ivr'){_0x5417e6[_0x9d38('0xb0')](_0x5417e6[_0x9d38('0x1c')][_0x4873b4[_0x3018af][_0x9d38('0xb1')]]);logger[_0x9d38('0x96')]('[Dialer][checkChannel]',_0x5ebc95,_0x3018af,_0x4873b4[_0x3018af][_0x9d38('0xb1')]);delete _0x4873b4[_0x3018af];}if(_0x4873b4[_0x3018af]&&_0x4873b4[_0x3018af][_0x9d38('0x48')]===_0x9d38('0x92')){_0x5417e6['updateOriginated'](_0x5417e6[_0x9d38('0x1d')][_0x4873b4[_0x3018af]['queue']]);logger[_0x9d38('0x96')](_0x9d38('0xb2'),_0x5ebc95,_0x3018af,_0x4873b4[_0x3018af][_0x9d38('0xb1')]);delete _0x4873b4[_0x3018af];}},0x2328);}});}});}}};Dialer[_0x9d38('0xaa')][_0x9d38('0xb3')]=function(_0xeb68e){return BPromise['resolve']()[_0x9d38('0xb4')](cmHopper[_0x9d38('0xb3')](_0xeb68e))[_0x9d38('0xae')](loggerCatch('[countReScheduled]\x20'));};Dialer['prototype'][_0x9d38('0xb5')]=function(_0x576a3b){return BPromise[_0x9d38('0xb6')]()[_0x9d38('0xb4')](cmHopperBlack[_0x9d38('0xb5')](_0x576a3b))[_0x9d38('0xae')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x9d38('0xaa')][_0x9d38('0xb7')]=function(_0x4bd578){return BPromise[_0x9d38('0xb6')]()[_0x9d38('0xb4')](cmHopperBlack[_0x9d38('0xb7')](_0x4bd578))[_0x9d38('0xae')](loggerCatch(_0x9d38('0xb8')));};Dialer['prototype'][_0x9d38('0xb9')]=function(_0x2328a9){return BPromise[_0x9d38('0xb6')]()[_0x9d38('0xb4')](cmHopperHistory['avgHandleTime'](_0x2328a9))['catch'](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x9d38('0xaa')][_0x9d38('0xba')]=function(_0x5d6e54){return BPromise[_0x9d38('0xb6')]()[_0x9d38('0xb4')](cmHopper[_0x9d38('0xba')](_0x5d6e54))[_0x9d38('0xae')](loggerCatch(_0x9d38('0xbb')));};Dialer[_0x9d38('0xaa')][_0x9d38('0xbc')]=function(_0x5d37f9,_0x241ba4,_0x508b1c,_0x55a178){return BPromise[_0x9d38('0xb6')]()[_0x9d38('0xb4')](cmHopper[_0x9d38('0xbc')](_0x5d37f9,_0x241ba4,_0x508b1c,_0x55a178))[_0x9d38('0xae')](loggerCatch(_0x9d38('0xbd')));};Dialer[_0x9d38('0xaa')][_0x9d38('0xbe')]=function(_0x44eb1e,_0x277938,_0x622fbf){return BPromise[_0x9d38('0xb6')]()[_0x9d38('0xb4')](cmHopper['getContactDialerIvr'](_0x44eb1e,_0x277938,_0x622fbf))[_0x9d38('0xae')](loggerCatch(_0x9d38('0xbd')));};Dialer[_0x9d38('0xaa')]['getVoiceQueueRtPauses']=function(_0x20eb76){return BPromise[_0x9d38('0xb6')]()[_0x9d38('0xb4')](voiceQueueRt[_0x9d38('0xbf')](_0x20eb76))['catch'](loggerCatch(_0x9d38('0xc0')));};Dialer[_0x9d38('0xaa')][_0x9d38('0xc1')]=function(_0x4e349d){return BPromise[_0x9d38('0xb6')]()[_0x9d38('0xb4')](cmHopper[_0x9d38('0xc1')](_0x4e349d))[_0x9d38('0xae')](loggerCatch(_0x9d38('0xc2')));};Dialer['prototype'][_0x9d38('0xc3')]=function(_0x22fee1){return BPromise[_0x9d38('0xb6')]()[_0x9d38('0xb4')](cmHopperHistory[_0x9d38('0xc3')](_0x22fee1))[_0x9d38('0xae')](loggerCatch(_0x9d38('0xc4')));};Dialer['prototype'][_0x9d38('0xb0')]=function(_0x12e8c1){if(!_[_0x9d38('0x84')](_0x12e8c1)&&_0x12e8c1!==null){if(_0x12e8c1[_0x9d38('0x98')](_0x9d38('0x99'))){if(_0x12e8c1[_0x9d38('0x99')]>0x0){_0x12e8c1[_0x9d38('0x99')]-=0x1;}else{logger[_0x9d38('0x96')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x9d38('0x96')](_0x9d38('0xc5'));}};Dialer[_0x9d38('0xaa')][_0x9d38('0xc6')]=function(_0x2fdddd,_0x9d0f8d){var _0xf6c901=this;return function(_0x57e0d0){_0xf6c901[_0x9d38('0xb0')](_0x9d0f8d);logger[_0x9d38('0x96')](_0x2fdddd,util[_0x9d38('0x97')](_0x57e0d0,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x1a2a31,_0x54da22,_0x399eb0){var _0x23ae16={'state':0x19,'statedesc':_0x9d38('0xc7')};this['updateOriginated'](_0x54da22);this[_0x9d38('0xc8')](_['merge'](_0x23ae16,_[_0x9d38('0xc9')](_0x399eb0,['ContactId',_0x9d38('0xca'),'UserId',_0x9d38('0xcb'),'CampaignId'])),'[emptyContact][createHistory]',_0x9d38('0xcc'));logger['error'](_0x1a2a31);};Dialer[_0x9d38('0xaa')]['isSuccess']=function(_0x18d6e2){return _0x18d6e2==='Success';};Dialer[_0x9d38('0xaa')]['isTrunkReachable']=function(_0x54936d){return!_[_0x9d38('0x84')](_0x54936d)&&_0x54936d&&!_[_0x9d38('0x84')](_0x54936d[_0x9d38('0x3c')])&&!_[_0x9d38('0x84')](_0x54936d['active'])&&_0x54936d['active']&&(this['trunks'][util[_0x9d38('0x78')](_0x9d38('0xcd'),_0x54936d[_0x9d38('0x3c')])][_0x9d38('0xce')]===_0x9d38('0xcf')||this[_0x9d38('0x1f')][util[_0x9d38('0x78')](_0x9d38('0xcd'),_0x54936d[_0x9d38('0x3c')])]['status']===_0x9d38('0xd0'));};Dialer[_0x9d38('0xaa')][_0x9d38('0xc8')]=function(_0x351f91,_0x2eda98,_0x38fc1c){this[_0x9d38('0xc3')](_0x351f91)[_0x9d38('0xae')](loggerCatch(_0x2eda98));this[_0x9d38('0xc1')](_0x351f91)[_0x9d38('0xae')](loggerCatch(_0x38fc1c));};Dialer[_0x9d38('0xaa')]['syncVarSet']=function(_0x3d44d7){var _0x37b467=this[_0x9d38('0x23')][_0x3d44d7[_0x9d38('0xd1')]];var _0x40f939;if(!_[_0x9d38('0xab')](_0x3d44d7)&&!_[_0x9d38('0xab')](_0x3d44d7[_0x9d38('0xd2')])&&!_[_0x9d38('0xab')](_0x3d44d7[_0x9d38('0xd2')][_0x9d38('0xd3')])&&_0x3d44d7['exten']==='xcally-motion-dialer'&&_0x37b467){if(_0x37b467[_0x9d38('0x48')]!==_0x9d38('0x92')&&this['voiceQueues'][_0x37b467[_0x9d38('0xb1')]]['dialAMDActive']&&_0x3d44d7[_0x9d38('0xd4')]==='HANGUP'){delete this[_0x9d38('0x23')][_0x3d44d7[_0x9d38('0xd1')]];this[_0x9d38('0xb0')](this[_0x9d38('0x1c')][_0x37b467[_0x9d38('0xb1')]]);this[_0x9d38('0x1c')][_0x37b467[_0x9d38('0xb1')]][_0x9d38('0x5d')]+=0x1;this['voiceQueues'][_0x37b467[_0x9d38('0xb1')]]['outboundAnswerAgiCallsDay']+=0x1;_0x40f939=new Hangup(_0x37b467,_0x3d44d7);_0x40f939[_0x9d38('0xd5')]=0x12;_0x40f939[_0x9d38('0xa6')]=_0x9d38('0xd6');_0x40f939[_0x9d38('0xd7')]=_0x9d38('0xd8');this[_0x9d38('0xc8')](_0x40f939,_0x9d38('0xd9'),'[syncHangupInAMD]');}if(_0x37b467[_0x9d38('0x48')]!==_0x9d38('0x92')&&this[_0x9d38('0x1c')][_0x37b467[_0x9d38('0xb1')]][_0x9d38('0xda')]&&_0x3d44d7[_0x9d38('0xd4')]==='MACHINE'){delete this[_0x9d38('0x23')][_0x3d44d7[_0x9d38('0xd1')]];this[_0x9d38('0xb0')](this[_0x9d38('0x1c')][_0x37b467['queue']]);this[_0x9d38('0x1c')][_0x37b467[_0x9d38('0xb1')]][_0x9d38('0x5d')]+=0x1;this[_0x9d38('0x1c')][_0x37b467[_0x9d38('0xb1')]][_0x9d38('0xdb')]+=0x1;_0x40f939=new Hangup(_0x37b467,_0x3d44d7);_0x40f939['state']=0x13;_0x40f939[_0x9d38('0xa6')]=_0x9d38('0xdc');_0x40f939['membername']=_0x9d38('0xd8');_0x40f939[_0x9d38('0xdd')]=!![];this['saveInDb'](_0x40f939,_0x9d38('0xde'),_0x9d38('0xdf'));}if(_0x37b467[_0x9d38('0x48')]===_0x9d38('0x92')&&this[_0x9d38('0x1d')][_0x37b467[_0x9d38('0xb1')]][_0x9d38('0xda')]&&_0x3d44d7[_0x9d38('0xd4')]===_0x9d38('0xe0')){delete this[_0x9d38('0x23')][_0x3d44d7[_0x9d38('0xd1')]];this['updateOriginated'](this['campaigns'][_0x37b467[_0x9d38('0xb1')]]);_0x40f939=new Hangup(_0x37b467,_0x3d44d7);_0x40f939['state']=0x12;_0x40f939[_0x9d38('0xa6')]=_0x9d38('0xd6');_0x40f939['membername']=_0x9d38('0xd8');this[_0x9d38('0xc8')](_0x40f939,_0x9d38('0xe1'),'[syncHangupInAMDIvr]');}if(_0x37b467[_0x9d38('0x48')]==='ivr'&&this['campaigns'][_0x37b467['queue']][_0x9d38('0xda')]&&_0x3d44d7[_0x9d38('0xd4')]===_0x9d38('0xe2')){delete this[_0x9d38('0x23')][_0x3d44d7[_0x9d38('0xd1')]];this[_0x9d38('0xb0')](this[_0x9d38('0x1d')][_0x37b467['queue']]);_0x40f939=new Hangup(_0x37b467,_0x3d44d7);_0x40f939[_0x9d38('0xd5')]=0x13;_0x40f939[_0x9d38('0xa6')]='Machine';_0x40f939[_0x9d38('0xd7')]='AMD';_0x40f939['amd']=!![];this[_0x9d38('0xc8')](_0x40f939,_0x9d38('0xe3'),_0x9d38('0xe4'));}}};Dialer[_0x9d38('0xaa')][_0x9d38('0xe5')]=function(_0x27a3dc){var _0x5ed086=this[_0x9d38('0x23')][_0x27a3dc['uniqueid']];var _0x28e952=this;var _0x46e63b;if(_0x5ed086&&_0x5ed086['type']===_0x9d38('0x92')){delete this[_0x9d38('0x23')][_0x27a3dc['uniqueid']];this[_0x9d38('0xb0')](this[_0x9d38('0x1d')][_0x5ed086['queue']]);this[_0x9d38('0x1d')][_0x5ed086[_0x9d38('0xb1')]][_0x9d38('0xe6')]+=0x1;_0x46e63b=new Hangup(_0x5ed086,_0x27a3dc);this[_0x9d38('0xc3')](_0x46e63b)['catch'](loggerCatch(_0x9d38('0xe7')));this[_0x9d38('0xc1')](_0x46e63b)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x5ed086&&_0x5ed086['type']!=='ivr'&&isNotNull(this[_0x9d38('0x1c')][_0x5ed086[_0x9d38('0xb1')]]['dialQueueProject'])){delete this['uniqueId'][_0x27a3dc[_0x9d38('0xd1')]];this[_0x9d38('0xb0')](this[_0x9d38('0x1c')][_0x5ed086[_0x9d38('0xb1')]]);this[_0x9d38('0x1c')][_0x5ed086[_0x9d38('0xb1')]][_0x9d38('0x5d')]+=0x1;this[_0x9d38('0x1c')][_0x5ed086['queue']][_0x9d38('0xdb')]+=0x1;_0x46e63b=new Hangup(_0x5ed086,_0x27a3dc);_0x46e63b['state']=0x10;_0x46e63b[_0x9d38('0xa6')]=_0x9d38('0xe8');_0x46e63b[_0x9d38('0xd7')]=_0x9d38('0xe9');this[_0x9d38('0xc3')](_0x46e63b)[_0x9d38('0xae')](loggerCatch(_0x9d38('0xe7')));this['moveContactManagedDialer'](_0x46e63b)[_0x9d38('0xae')](loggerCatch('[syncHangupIvr]'));}if(_0x5ed086&&_0x5ed086[_0x9d38('0x48')]!==_0x9d38('0x92')&&!isNotNull(this[_0x9d38('0x1c')][_0x5ed086['queue']][_0x9d38('0xea')])){delete this[_0x9d38('0x23')][_0x27a3dc['uniqueid']];this[_0x9d38('0xb0')](this['voiceQueues'][_0x5ed086['queue']]);this[_0x9d38('0x1c')][_0x5ed086[_0x9d38('0xb1')]][_0x9d38('0x64')]+=0x1;_0x46e63b=new Hangup(_0x5ed086,_0x27a3dc);_0x46e63b[_0x9d38('0xd5')]=0xc;_0x46e63b[_0x9d38('0xa6')]=_0x27a3dc[_0x9d38('0xeb')];_0x46e63b[_0x9d38('0xd7')]=_0x9d38('0xec');this['createHistory'](_0x46e63b)[_0x9d38('0xae')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x9d38('0xc1')](_0x46e63b)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x9d38('0xaa')][_0x9d38('0x30')]=function(_0x198870){var _0x2b2c3a=this['uniqueId'][_0x198870[_0x9d38('0xd1')]];var _0x91eb37=this;if(this['voiceQueues'][_0x198870[_0x9d38('0xb1')]]){if(_0x2b2c3a&&_0x2b2c3a[_0x9d38('0x48')]!==_0x9d38('0x92')){delete this[_0x9d38('0x23')][_0x198870[_0x9d38('0xd1')]];this[_0x9d38('0x1c')][_0x198870[_0x9d38('0xb1')]][_0x9d38('0x5d')]+=0x1;var _0x582fba=new AgentComplete(_0x2b2c3a,_0x198870);if(_0x198870['reason']===_0x9d38('0xed')){_0x582fba[_0x9d38('0xee')]=this[_0x9d38('0x1c')][_0x198870[_0x9d38('0xb1')]]['dialQueueProject2']&&this[_0x9d38('0x1c')][_0x198870[_0x9d38('0xb1')]][_0x9d38('0xef')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this['createHistory'](_0x582fba)[_0x9d38('0xae')](loggerCatch(_0x9d38('0xf0')));this[_0x9d38('0xc1')](_0x582fba)['catch'](loggerCatch(_0x9d38('0xf1')));}}};Dialer[_0x9d38('0xaa')]['syncAgentConnect']=function(_0x3b283a){if(this['voiceQueues'][_0x3b283a[_0x9d38('0xb1')]]){if(this[_0x9d38('0x23')][_0x3b283a['uniqueid']]&&this[_0x9d38('0x23')][_0x3b283a[_0x9d38('0xd1')]]['type']!==_0x9d38('0x92')){this[_0x9d38('0xb0')](this[_0x9d38('0x1c')][_0x3b283a[_0x9d38('0xb1')]]);this['uniqueId'][_0x3b283a[_0x9d38('0xd1')]][_0x9d38('0xf2')]=moment()[_0x9d38('0x78')](_0x9d38('0xf3'));}}};Dialer[_0x9d38('0xaa')][_0x9d38('0xf4')]=function(_0x351f9a){this[_0x9d38('0xc3')](_0x351f9a)['catch'](loggerCatch(_0x9d38('0xf0')));this['moveContactManagedDialer'](_0x351f9a)[_0x9d38('0xae')](loggerCatch(_0x9d38('0xf5')));};Dialer[_0x9d38('0xaa')][_0x9d38('0x2b')]=function(_0x233a78){var _0x1d5b5b=this[_0x9d38('0x23')][_0x233a78[_0x9d38('0xd1')]];var _0x412750=this;if(this[_0x9d38('0x1c')][_0x233a78[_0x9d38('0xb1')]]){if(_0x1d5b5b&&_0x1d5b5b['type']!==_0x9d38('0x92')){delete this[_0x9d38('0x23')][_0x233a78[_0x9d38('0xd1')]];this[_0x9d38('0xb0')](this[_0x9d38('0x1c')][_0x233a78[_0x9d38('0xb1')]]);_0x1d5b5b[_0x9d38('0xf6')]=moment()[_0x9d38('0x78')](_0x9d38('0xf3'));var _0x8b8e0=new QueueCallerAbandon(_0x1d5b5b,_0x233a78);if(getSeconds(_0x1d5b5b['droptime'],_0x1d5b5b[_0x9d38('0xf7')])>=_0x1d5b5b[_0x9d38('0xf8')]){this[_0x9d38('0x1c')][_0x233a78[_0x9d38('0xb1')]][_0x9d38('0x69')]+=0x1;this[_0x9d38('0x1c')][_0x233a78['queue']]['outboundDropCallsDayTimeout']+=0x1;this[_0x9d38('0x1c')][_0x233a78[_0x9d38('0xb1')]][_0x9d38('0x6b')]+=0x1;_0x8b8e0[_0x9d38('0xd5')]=0xa;_0x8b8e0[_0x9d38('0xa6')]=_0x9d38('0xf9');_0x8b8e0[_0x9d38('0xfa')]=_0x9d38('0xfb');_0x8b8e0[_0x9d38('0xee')]=this[_0x9d38('0x1c')][_0x233a78['queue']][_0x9d38('0xfc')]?moment()[_0x9d38('0x78')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;this['queueCallerAbandonCreateState'](_0x8b8e0);}else{this[_0x9d38('0x1c')][_0x233a78[_0x9d38('0xb1')]][_0x9d38('0x68')]+=0x1;this[_0x9d38('0x1c')][_0x233a78['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x8b8e0['state']=0xb;_0x8b8e0[_0x9d38('0xa6')]=_0x9d38('0xfd');_0x8b8e0[_0x9d38('0xfa')]=_0x9d38('0xfe');this['queueCallerAbandonCreateState'](_0x8b8e0);}}}};Dialer[_0x9d38('0xaa')][_0x9d38('0x33')]=function(_0x2dd274){if(this[_0x9d38('0xff')][_0x2dd274[_0x9d38('0xd1')]]){this['actions'][_0x2dd274[_0x9d38('0xd1')]][_0x9d38('0xad')]=_0x2dd274['channel'];}if(this[_0x9d38('0x23')][_0x2dd274['uniqueid']]){this[_0x9d38('0x23')][_0x2dd274[_0x9d38('0xd1')]]['channel']=_0x2dd274[_0x9d38('0xad')];}};Dialer['prototype']['syncQueueMember']=function(_0x4542af){if(strategy[this[_0x9d38('0x1c')][this[_0x9d38('0xff')][_0x4542af[_0x9d38('0x100')]][_0x9d38('0xb1')]][_0x9d38('0x101')]]==='roundrobin'){if(this[_0x9d38('0xff')][_0x4542af['actionid']]&&_[_0x9d38('0xab')](this['actions'][_0x4542af[_0x9d38('0x100')]][_0x9d38('0x102')])&&_0x4542af[_0x9d38('0xce')]==='1'&&_0x4542af['paused']==='0'){if(this[_0x9d38('0x1e')][_0x4542af['stateinterface']]){if(!this[_0x9d38('0x1e')][_0x4542af[_0x9d38('0x103')]][_0x9d38('0x102')]){this['agents'][_0x4542af['stateinterface']]['locked']=!![];this[_0x9d38('0xff')][_0x4542af[_0x9d38('0x100')]]['locked']=!![];this['actions'][_0x4542af[_0x9d38('0x100')]][_0x9d38('0x103')]=_0x4542af['stateinterface'];}}}}else if((strategy[this[_0x9d38('0x1c')][this[_0x9d38('0xff')][_0x4542af['actionid']][_0x9d38('0xb1')]][_0x9d38('0x101')]]||_0x9d38('0x104'))===_0x9d38('0x104')){if(this[_0x9d38('0xff')][_0x4542af[_0x9d38('0x100')]]){if(this[_0x9d38('0x1e')][_0x4542af[_0x9d38('0x103')]]){this[_0x9d38('0xff')][_0x4542af[_0x9d38('0x100')]][_0x9d38('0x103')]=_0x4542af[_0x9d38('0x103')];if(_[_0x9d38('0xab')](this[_0x9d38('0x26')][this['actions'][_0x4542af[_0x9d38('0x100')]][_0x9d38('0xb1')]])){this[_0x9d38('0x26')][this['actions'][_0x4542af[_0x9d38('0x100')]][_0x9d38('0xb1')]]=[];}this[_0x9d38('0x26')][this['actions'][_0x4542af[_0x9d38('0x100')]][_0x9d38('0xb1')]]['push'](_[_0x9d38('0x8d')](_['pick'](this[_0x9d38('0xff')][_0x4542af['actionid']],['idHopper',_0x9d38('0x103')]),{'status':_0x4542af[_0x9d38('0xce')],'paused':_0x4542af[_0x9d38('0x105')]}));}}}};function unlockQueueStatus(_0x20fe99,_0x1c19d9){setTimeout(function(){if(_[_0x9d38('0x84')](_0x20fe99[_0x9d38('0x106')])){loggerBooked['error'](_0x9d38('0x107'),_0x1c19d9);}_0x20fe99[_0x9d38('0x106')]=!![];loggerBooked[_0x9d38('0x7e')]('[booked][unlockQueueStatus]',_0x1c19d9,JSON[_0x9d38('0x44')](_['pick'](_0x20fe99,['name',_0x9d38('0x106')])));},0x1f3);}Dialer[_0x9d38('0xaa')][_0x9d38('0x38')]=function(_0x308b76){var _0x309838=this;var _0x1c68e2=_0x309838[_0x9d38('0x1c')][_0x309838[_0x9d38('0xff')][_0x308b76[_0x9d38('0x100')]][_0x9d38('0xb1')]];if(strategy[this[_0x9d38('0x1c')][this[_0x9d38('0xff')][_0x308b76[_0x9d38('0x100')]][_0x9d38('0xb1')]][_0x9d38('0x101')]]==='roundrobin'){if(this['actions'][_0x308b76[_0x9d38('0x100')]]&&this['actions'][_0x308b76[_0x9d38('0x100')]][_0x9d38('0x103')]){this[_0x9d38('0x1b')][_0x9d38('0x108')](this[_0x9d38('0xff')][_0x308b76[_0x9d38('0x100')]][_0x9d38('0x109')],this[_0x9d38('0xff')][_0x308b76['actionid']]['stateinterface'])[_0x9d38('0xae')](function(_0x4a1d68){logger[_0x9d38('0x96')](_0x9d38('0x10a'),util[_0x9d38('0x97')](_0x4a1d68,{'showHidden':![],'depth':null}));})[_0x9d38('0x10b')](function(){_0x309838[_0x9d38('0xb0')](_0x309838[_0x9d38('0x1c')][_0x309838[_0x9d38('0xff')][_0x308b76['actionid']][_0x9d38('0xb1')]]);_0x309838[_0x9d38('0x1e')][_0x309838[_0x9d38('0xff')][_0x308b76['actionid']][_0x9d38('0x103')]][_0x9d38('0x102')]=![];delete _0x309838[_0x9d38('0xff')][_0x308b76['actionid']];unlockQueueStatus(_0x1c68e2);});}else{this[_0x9d38('0xb0')](this[_0x9d38('0x1c')][this['actions'][_0x308b76['actionid']]['queue']]);this[_0x9d38('0xba')]({'active':![],'ContactId':this[_0x9d38('0xff')][_0x308b76['actionid']][_0x9d38('0x10c')],'ListId':this[_0x9d38('0xff')][_0x308b76['actionid']][_0x9d38('0xca')],'VoiceQueueId':this[_0x9d38('0xff')][_0x308b76[_0x9d38('0x100')]][_0x9d38('0xcb')]||undefined,'CampaignId':this['actions'][_0x308b76[_0x9d38('0x100')]][_0x9d38('0x10d')]||undefined})[_0x9d38('0xae')](loggerCatch(_0x9d38('0x10e')));delete this[_0x9d38('0xff')][_0x308b76[_0x9d38('0x100')]];unlockQueueStatus(_0x1c68e2);}}else if((strategy[this[_0x9d38('0x1c')][this[_0x9d38('0xff')][_0x308b76['actionid']][_0x9d38('0xb1')]]['strategy']]||'rrmemory')===_0x9d38('0x104')){var _0x17ea5c;if(this[_0x9d38('0xff')][_0x308b76[_0x9d38('0x100')]]&&!_[_0x9d38('0x7b')](this['queueBooked'][this[_0x9d38('0xff')][_0x308b76[_0x9d38('0x100')]]['queue']])){if(this[_0x9d38('0x27')][_0x309838[_0x9d38('0xff')][_0x308b76[_0x9d38('0x100')]][_0x9d38('0xb1')]]){this['queueBookedRR'][_0x309838[_0x9d38('0xff')][_0x308b76[_0x9d38('0x100')]]['queue']]=this[_0x9d38('0x27')][this[_0x9d38('0xff')][_0x308b76[_0x9d38('0x100')]][_0x9d38('0xb1')]]?this[_0x9d38('0x27')][this[_0x9d38('0xff')][_0x308b76[_0x9d38('0x100')]][_0x9d38('0xb1')]]:this[_0x9d38('0x26')][this[_0x9d38('0xff')][_0x308b76[_0x9d38('0x100')]][_0x9d38('0xb1')]]?this[_0x9d38('0x26')][this[_0x9d38('0xff')][_0x308b76['actionid']]['queue']][_0x9d38('0x10f')]||0x0:0x0;}this[_0x9d38('0x26')][this[_0x9d38('0xff')][_0x308b76['actionid']]['queue']][_0x9d38('0x10f')]=this['queueBookedRR'][this[_0x9d38('0xff')][_0x308b76[_0x9d38('0x100')]][_0x9d38('0xb1')]];for(var _0xaf573f=0x0;_0xaf573f=0x0?!![]:![];})['catch'](myreject(_0x3d9626)));}}else{_0x5de620[_0x9d38('0x128')](ami[_0x9d38('0xac')]({'action':_0x9d38('0x129'),'command':util[_0x9d38('0x78')](_0x9d38('0x12a'),_0x12daf8,!_['isUndefined'](config[_0x9d38('0x125')][_0x11be97])?_0x11be97:'')})['then'](function(_0x520d40){return _0x520d40['content'][_0x9d38('0x12c')](_0x9d38('0x12d'))>=0x0?!![]:![];})[_0x9d38('0xae')](myreject(_0x3d9626)));}BPromise[_0x9d38('0x12e')](_0x5de620)['then'](function(_0xc8bba2){var _0x5d1c0d=_['some'](_0xc8bba2);if(_0x5d1c0d){return _0x2841a8(_0x5d1c0d);}else{_0x4fdc6d['message']=_0x2ef498?_0x9d38('0x12f'):_0x9d38('0x130');return _0x3d9626(msgResponse(_0x9d38('0x131'),_0x9d38('0x122'),_0x9d38('0x132')+_0x2ef498+'\x20'+_0x55044c+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x12daf8,{'showHidden':![],'depth':null})+_0x9d38('0x133')+_0x11be97));}})['catch'](function(_0x3dbd86){return _0x3d9626(msgResponse('ifTime',_0x9d38('0x122'),JSON[_0x9d38('0x44')](_0x3dbd86)));});});};Dialer[_0x9d38('0xaa')][_0x9d38('0x134')]=function(_0x2451f1){var _0x39274f=this;return function(){switch(_0x2451f1[_0x9d38('0x58')]){case _0x9d38('0x135'):freeVariablesPredictive(_0x2451f1);_0x39274f[_0x9d38('0x136')](_0x2451f1,0x1);break;case _0x9d38('0x137'):freeVariablesPredictive(_0x2451f1);_0x39274f[_0x9d38('0x136')](_0x2451f1,_0x2451f1['dialPowerLevel']);break;case _0x9d38('0x8'):_0x39274f[_0x9d38('0x8')](_0x2451f1);break;case'booked':freeVariablesPredictive(_0x2451f1);_0x39274f[_0x9d38('0x136')](_0x2451f1,0x1);break;default:freeVariablesPredictive(_0x2451f1);logger[_0x9d38('0x96')](_0x9d38('0x138'),_0x2451f1[_0x9d38('0x3c')],_0x9d38('0x139'));}};};Dialer['prototype'][_0x9d38('0x13a')]=function(_0x529464){var _0x1a114c=this;return function(){_0x1a114c[_0x9d38('0x13b')](_0x529464);};};Dialer['prototype'][_0x9d38('0xa')]=function(_0x3e8c67){var _0x4b31a1=this;if(isNotPreview(_0x3e8c67['dialMethod'])){if(isVoiceQueueOutbound(_0x3e8c67[_0x9d38('0x48')])&&isActive(_0x3e8c67[_0x9d38('0x57')])){_0x3e8c67[_0x9d38('0xa0')]=!![];BPromise[_0x9d38('0xb6')]()[_0x9d38('0xb4')](checkIsLoggedIn(_0x3e8c67,_0x3e8c67[_0x9d38('0x4c')]))[_0x9d38('0xb4')](checkIsActive(_0x3e8c67,_0x3e8c67[_0x9d38('0x57')]))[_0x9d38('0xb4')](checkInterval(_0x3e8c67))['then'](_0x4b31a1[_0x9d38('0x13c')](_0x3e8c67))[_0x9d38('0xb4')](_0x4b31a1[_0x9d38('0x11f')](_0x3e8c67[_0x9d38('0x13d')],_0x3e8c67[_0x9d38('0x13e')],_0x3e8c67[_0x9d38('0x3c')],_0x3e8c67))[_0x9d38('0xb4')](_0x4b31a1['checkIfTimeIntervals'](_0x3e8c67[_0x9d38('0x40')],_0x3e8c67[_0x9d38('0x13e')],_0x3e8c67[_0x9d38('0x3c')],_0x3e8c67))[_0x9d38('0xb4')](_0x4b31a1[_0x9d38('0x134')](_0x3e8c67))[_0x9d38('0xae')](loggerCatchQueueSummary(_0x9d38('0x13f'),_0x3e8c67));}else{notSendMessagesQueue(_0x3e8c67);}}else{freeVariablesPredictive(_0x3e8c67);}};Dialer['prototype']['syncCampaigns']=function(){var _0x437502=this;var _0x142872;for(var _0x8fd97 in this[_0x9d38('0x1d')]){if(this[_0x9d38('0x1d')][_0x9d38('0x98')](_0x8fd97)){_0x142872=this[_0x9d38('0x1d')][_0x8fd97];if(isCampaignIvr(_0x142872['type'])&&isActive(_0x142872[_0x9d38('0x76')])){_0x142872[_0x9d38('0xa0')]=!![];BPromise[_0x9d38('0xb6')]()[_0x9d38('0xb4')](checkIsActive(_0x142872,_0x142872['active']))[_0x9d38('0xb4')](checkInterval(_0x142872))[_0x9d38('0xb4')](_0x437502[_0x9d38('0x13c')](_0x142872))[_0x9d38('0xb4')](_0x437502[_0x9d38('0x11f')](_0x142872[_0x9d38('0x13d')],_0x142872[_0x9d38('0x13e')],_0x142872[_0x9d38('0x3c')],_0x142872))[_0x9d38('0xb4')](_0x437502[_0x9d38('0x120')](_0x142872['Interval'],_0x142872[_0x9d38('0x13e')],_0x142872[_0x9d38('0x3c')],_0x142872))[_0x9d38('0xb4')](_0x437502[_0x9d38('0x13a')](_0x142872))[_0x9d38('0xae')](loggerCatchQueueSummary(_0x9d38('0x140'),_0x142872));}else{notSendMessagesCampaign(_0x142872);}}}};function getCallerIdRandom(_0x58e7f4,_0x5ac2db){var _0x39e928,_0x5886b4,_0x42ef90;if(_0x5ac2db<=0x0){_0x5ac2db=0x1;}_0x39e928=new RegExp('\x5cw{0,'+_0x5ac2db+'}$');_0x5886b4=Math[_0x9d38('0x141')](0xa,_0x5ac2db-0x1);_0x42ef90=Math[_0x9d38('0x141')](0xa,_0x5ac2db)-0x1;return util['format']('%s',_[_0x9d38('0x142')](_0x58e7f4,_0x39e928,_[_0x9d38('0x143')](_0x5886b4,_0x42ef90)));}function extractCalleridName(_0x22ff30){var _0x9dec88=_0x22ff30[_0x9d38('0x144')](/"(.*?)"/);return _0x9dec88?_0x9dec88[0x1]:_0x22ff30;}function extractCalleridNumber(_0x44e767){var _0x2882cc=_0x44e767[_0x9d38('0x144')](/<(.*?)>/);return _0x2882cc?_0x2882cc[0x1]:_0x44e767;}Dialer[_0x9d38('0xaa')][_0x9d38('0x145')]=function(_0x7cd3e6,_0x377b58){var _0x53a71e=this;var _0x347636=uuid['v4']();this[_0x9d38('0xff')][_0x347636]=new Action(_0x7cd3e6,_0x377b58,_0x347636);return new BPromise(function(_0x2b8b2e,_0x4b73df){if(_[_0x9d38('0x84')](_0x7cd3e6)&&_0x9d38('0x146')!==typeof _0x7cd3e6){return _0x4b73df(msgResponse(_0x9d38('0x147'),_0x9d38('0x122'),_0x9d38('0x148')));}if(_[_0x9d38('0x84')](_0x377b58[_0x9d38('0x149')][_0x9d38('0x14a')])||_0x377b58['Contact'][_0x9d38('0x14a')]===null){return _0x4b73df(msgResponse(_0x9d38('0x147'),'Failure',_0x9d38('0x14b')));}var _0x4ed928={'XMD-CALLERID':_0x53a71e[_0x9d38('0xff')][_0x347636]['getCaller'](),'XMD-AGI':_0x7cd3e6['dialQueueProject']?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x7cd3e6[_0x9d38('0xea')]):_0x9d38('0x14c'),'XMD-AGIAFTER':_0x7cd3e6[_0x9d38('0xfc')]?util[_0x9d38('0x78')](_0x9d38('0x14d'),ipAgi,_0x7cd3e6[_0x9d38('0xfc')]):_0x9d38('0x14c'),'XMD-QUEUE':_0x7cd3e6[_0x9d38('0x48')]===_0x9d38('0x49')?util[_0x9d38('0x78')]('\x22%s,%s%s,,,%s\x22',_0x7cd3e6[_0x9d38('0x3c')],_0x7cd3e6['dialQueueOptions']||'',_0x7cd3e6[_0x9d38('0xef')]?'c':'',_0x7cd3e6['dialQueueTimeout']||0x3):_0x9d38('0x14c'),'XMD-CONTACTID':_0x377b58[_0x9d38('0x10c')],'XMD-CDRTYPE':_0x9d38('0x7'),'CALLERID(all)':_0x53a71e[_0x9d38('0xff')][_0x347636]['getCaller'](),'XMD-AMD':_0x7cd3e6[_0x9d38('0xda')]?_0x9d38('0x14e'):_0x9d38('0x14c'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x7cd3e6['dialAMDActive']){_0x4ed928[_0x9d38('0x14f')]=_0x7cd3e6[_0x9d38('0x150')]||0x9c4;_0x4ed928['XMD-AMDGREETING']=_0x7cd3e6['dialAMDGreeting']||0x5dc;_0x4ed928[_0x9d38('0x151')]=_0x7cd3e6[_0x9d38('0x152')]||0x320;_0x4ed928['XMD-AMDTOTALANALYSISTIME']=_0x7cd3e6[_0x9d38('0x153')]||0x1388;_0x4ed928[_0x9d38('0x154')]=_0x7cd3e6[_0x9d38('0x155')]||0x64;_0x4ed928[_0x9d38('0x156')]=_0x7cd3e6[_0x9d38('0x157')]||0x32;_0x4ed928[_0x9d38('0x158')]=_0x7cd3e6[_0x9d38('0x159')]||0x3;_0x4ed928[_0x9d38('0x15a')]=_0x7cd3e6[_0x9d38('0x15b')]||0x100;_0x4ed928[_0x9d38('0x15c')]=_0x7cd3e6[_0x9d38('0x15d')]||0x1388;}if(_0x7cd3e6['type']===_0x9d38('0x49')){_0x4ed928[_0x9d38('0x15e')]=_0x377b58[_0x9d38('0xcb')];}else{_0x4ed928[_0x9d38('0x15f')]=_0x377b58[_0x9d38('0x10d')];}for(var _0x198ab5 in _0x377b58[_0x9d38('0x149')]){if(_0x377b58[_0x9d38('0x149')][_0x9d38('0x98')](_0x198ab5)){if(isNotNull(_0x377b58['Contact'][_0x198ab5])&&_0x198ab5!=='id'&&_0x198ab5!==_0x9d38('0x160')&&_0x198ab5!==_0x9d38('0x161')&&_0x198ab5!=='updatedAt'){_0x4ed928[util[_0x9d38('0x78')](_0x9d38('0x162'),_0x9d38('0x163'),_[_0x9d38('0x164')](_0x198ab5))]=_0x377b58[_0x9d38('0x149')][_0x198ab5];}}}var _0x1b2100=_0x53a71e[_0x9d38('0x11b')](_0x7cd3e6['Trunk'])?getCallerId(_0x7cd3e6['Trunk']['callerid'],_0x7cd3e6[_0x9d38('0x59')],_0x7cd3e6['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x7cd3e6[_0x9d38('0x5a')],_0x7cd3e6['dialRandomLastDigitCallerIdNumber']):_0x7cd3e6[_0x9d38('0x5a')]):getCallerId(_['isNil'](_0x7cd3e6[_0x9d38('0x11c')])?_0x7cd3e6[_0x9d38('0x75')][_0x9d38('0x77')]:_0x7cd3e6[_0x9d38('0x11c')]['callerid'],_0x7cd3e6['dialOriginateCallerIdName'],_0x7cd3e6[_0x9d38('0x165')]>0x0?getCallerIdRandom(_0x7cd3e6[_0x9d38('0x5a')],_0x7cd3e6['dialRandomLastDigitCallerIdNumber']):_0x7cd3e6[_0x9d38('0x5a')]);if(_0x1b2100){_0x4ed928[_0x9d38('0x166')]=_0x53a71e['actions'][_0x347636][_0x9d38('0x167')]=extractCalleridName(_0x1b2100);_0x4ed928[_0x9d38('0x168')]=_0x53a71e[_0x9d38('0xff')][_0x347636]['originatecalleridnum']=extractCalleridNumber(_0x1b2100);}return ami[_0x9d38('0xac')]({'actionid':_0x347636,'action':'originate','channel':_0x53a71e[_0x9d38('0x11b')](_0x7cd3e6[_0x9d38('0x75')])?util[_0x9d38('0x78')]('SIP/%s/%s%s',_0x7cd3e6[_0x9d38('0x75')]['name'],isNotNull(_0x7cd3e6[_0x9d38('0x5c')])?_0x7cd3e6[_0x9d38('0x5c')][_0x9d38('0x169')]()||'':'',_0x7cd3e6[_0x9d38('0x16a')]>0x0?_0x377b58[_0x9d38('0x149')][_0x9d38('0x14a')]['substring'](_0x7cd3e6[_0x9d38('0x16a')]):_0x377b58[_0x9d38('0x149')][_0x9d38('0x14a')]):util[_0x9d38('0x78')](_0x9d38('0x16b'),_[_0x9d38('0xab')](_0x7cd3e6[_0x9d38('0x11c')])?_0x7cd3e6[_0x9d38('0x75')][_0x9d38('0x3c')]:_0x7cd3e6['TrunkBackup'][_0x9d38('0x3c')],isNotNull(_0x7cd3e6[_0x9d38('0x5c')])?_0x7cd3e6[_0x9d38('0x5c')][_0x9d38('0x169')]()||'':'',_0x7cd3e6['dialCutDigit']>0x0?_0x377b58[_0x9d38('0x149')][_0x9d38('0x14a')][_0x9d38('0x16c')](_0x7cd3e6[_0x9d38('0x16a')]):_0x377b58[_0x9d38('0x149')][_0x9d38('0x14a')]),'callerid':_0x1b2100,'Exten':'xcally-motion-dialer','Context':_0x9d38('0x16d'),'Priority':'1','variable':_0x4ed928,'timeout':(_0x7cd3e6['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x347636})[_0x9d38('0xb4')](function(_0x530326){return _0x2b8b2e(_0x530326);})[_0x9d38('0xae')](function(_0x775cfa){_0x7cd3e6['outboundOriginateFailureCallsDay']+=0x1;var _0x3a2d32=new History(_0x53a71e[_0x9d38('0xff')][_0x347636]);logger[_0x9d38('0x96')](util[_0x9d38('0x78')](_0x9d38('0x16e'),JSON['stringify'](_0x775cfa)));_0x3a2d32[_0x9d38('0xd5')]=0xe;_0x3a2d32[_0x9d38('0xa6')]='OriginateError';_0x3a2d32['starttime']=moment()['format'](_0x9d38('0xf3'));_0x3a2d32['endtime']=_0x3a2d32[_0x9d38('0x16f')];_0x53a71e[_0x9d38('0xc3')](_0x3a2d32)[_0x9d38('0xae')](loggerCatch(_0x9d38('0x170')));_0x53a71e[_0x9d38('0xc1')](_0x3a2d32)[_0x9d38('0xae')](loggerCatch(_0x9d38('0x170')))['finally'](function(){delete _0x53a71e['actions'][_0x347636];return _0x4b73df(msgResponse(_0x9d38('0x147'),'Error',_0x9d38('0x171')));});});});};Dialer['prototype'][_0x9d38('0x2d')]=function(_0x22f885){var _0x452d39=this[_0x9d38('0xff')][_0x22f885[_0x9d38('0x100')]];var _0x5995b0=this;if(_0x452d39){delete this[_0x9d38('0xff')][_0x22f885['actionid']];_0x452d39[_0x9d38('0xf7')]=moment()[_0x9d38('0x78')]('YYYY-MM-DD\x20HH:mm:ss');var _0x35e5a1=_0x452d39[_0x9d38('0x48')]==='ivr'?this['campaigns'][_0x452d39[_0x9d38('0xb1')]]:this['voiceQueues'][_0x452d39[_0x9d38('0x172')]()];if(!this[_0x9d38('0x173')](_0x22f885[_0x9d38('0x174')])){this[_0x9d38('0xb0')](_0x35e5a1);return this[_0x9d38('0x175')](_0x452d39,_0x35e5a1,_0x22f885)[_0x9d38('0xb4')](function(_0x416afa){})[_0x9d38('0xae')](loggerCatch(_0x9d38('0x176')));}else{this[_0x9d38('0x23')][_0x22f885[_0x9d38('0xd1')]]=_0x452d39;}}};Dialer[_0x9d38('0xaa')][_0x9d38('0x177')]=function(_0x1a4a77,_0x406a6a,_0x17ede6){var _0x5925f7=new History(_0x406a6a);if(_0x5925f7[_0x9d38('0x178')]+_0x5925f7['countcongestionretry']+_0x5925f7[_0x9d38('0x179')]>=_0x17ede6[_0x9d38('0x17a')]-0x1){return!![];}switch(_0x1a4a77){case 0x3:if(_0x5925f7[_0x9d38('0x179')]>=_0x17ede6['dialNoAnswerMaxRetry']-0x1){return!![];}else{this[_0x9d38('0xba')]({'active':![],'countnoanswerretry':_0x5925f7[_0x9d38('0x179')]+=0x1,'scheduledat':moment()['add'](_0x17ede6[_0x9d38('0x17b')],'minutes')[_0x9d38('0x78')](_0x9d38('0xf3')),'ContactId':_0x5925f7[_0x9d38('0x10c')],'ListId':_0x5925f7[_0x9d38('0xca')],'VoiceQueueId':_0x5925f7[_0x9d38('0xcb')]||undefined,'CampaignId':_0x5925f7['CampaignId']||undefined})[_0x9d38('0xae')](loggerCatch('[rescheduleContact][NoAnswer]'));}break;case 0x5:if(_0x5925f7['countbusyretry']>=_0x17ede6['dialBusyMaxRetry']-0x1){return!![];}else{this[_0x9d38('0xba')]({'active':![],'countbusyretry':_0x5925f7[_0x9d38('0x178')]+=0x1,'scheduledat':moment()['add'](_0x17ede6[_0x9d38('0x17c')],_0x9d38('0x17d'))['format'](_0x9d38('0xf3')),'ContactId':_0x5925f7[_0x9d38('0x10c')],'ListId':_0x5925f7[_0x9d38('0xca')],'VoiceQueueId':_0x5925f7[_0x9d38('0xcb')]||undefined,'CampaignId':_0x5925f7[_0x9d38('0x10d')]||undefined})[_0x9d38('0xae')](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0x5925f7['countcongestionretry']>=_0x17ede6['dialCongestionMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countcongestionretry':_0x5925f7[_0x9d38('0x17e')]+=0x1,'scheduledat':moment()[_0x9d38('0x17f')](_0x17ede6[_0x9d38('0x180')],_0x9d38('0x17d'))[_0x9d38('0x78')](_0x9d38('0xf3')),'ContactId':_0x5925f7[_0x9d38('0x10c')],'ListId':_0x5925f7[_0x9d38('0xca')],'VoiceQueueId':_0x5925f7[_0x9d38('0xcb')]||undefined,'CampaignId':_0x5925f7[_0x9d38('0x10d')]||undefined})[_0x9d38('0xae')](loggerCatch(_0x9d38('0x181')));}break;default:return!![];}};Dialer[_0x9d38('0xaa')][_0x9d38('0x175')]=function(_0x360059,_0x57feb3,_0x15379b){var _0x1d90e9=this;var _0x45cee8=new History(_0x360059);return new BPromise(function(_0x2b46dd,_0x3ed8e6){if(_['isUndefined'](_0x57feb3)&&_0x9d38('0x146')!==typeof _0x57feb3){return _0x3ed8e6(msgResponse('[callProgressDetecting]',_0x9d38('0x122'),'entity\x20is\x20undefine'));}if(_[_0x9d38('0x84')](_0x15379b)&&'object'!==typeof _0x15379b){return _0x3ed8e6(msgResponse(_0x9d38('0x182'),_0x9d38('0x122'),'evt\x20is\x20undefine'));}switch(_0x15379b[_0x9d38('0x183')]){case'0':_0x57feb3[_0x9d38('0x62')]+=0x1;_0x45cee8[_0x9d38('0xd5')]=0x0;_0x45cee8[_0x9d38('0xa6')]=_0x9d38('0x184');_0x1d90e9[_0x9d38('0xc3')](_0x45cee8)[_0x9d38('0xae')](loggerCatch(_0x9d38('0x185')));if(_0x1d90e9['checkRetriveMax'](0x0,_0x360059,_0x57feb3)){if(_0x45cee8[_0x9d38('0x178')]+_0x45cee8['countcongestionretry']+_0x45cee8[_0x9d38('0x179')]>=_0x57feb3['dialGlobalMaxRetry']){_0x1d90e9['stateGlobal'](_0x45cee8,_0x2b46dd,_0x3ed8e6,_0x9d38('0x186'));}else{_0x1d90e9[_0x9d38('0x187')](_0x45cee8,_0x2b46dd,_0x3ed8e6,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x57feb3[_0x9d38('0x61')]+=0x1;_0x45cee8[_0x9d38('0xd5')]=0x3;_0x45cee8[_0x9d38('0xa6')]='NoAnswer';_0x45cee8[_0x9d38('0x179')]+=0x1;_0x45cee8['countglobal']+=0x1;_0x1d90e9['createHistory'](_0x45cee8)[_0x9d38('0xae')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x1d90e9[_0x9d38('0x177')](0x3,_0x360059,_0x57feb3)){if(_0x45cee8[_0x9d38('0x179')]>=_0x57feb3[_0x9d38('0x188')]){_0x1d90e9[_0x9d38('0x187')](_0x45cee8,_0x2b46dd,_0x3ed8e6,_0x9d38('0x189'));}else{_0x1d90e9[_0x9d38('0x18a')](_0x45cee8,_0x2b46dd,_0x3ed8e6,_0x9d38('0x189'));}}break;case'5':_0x57feb3[_0x9d38('0x5e')]+=0x1;_0x45cee8[_0x9d38('0xd5')]=0x5;_0x45cee8[_0x9d38('0xa6')]=_0x9d38('0x18b');_0x45cee8[_0x9d38('0x178')]+=0x1;_0x45cee8[_0x9d38('0x18c')]+=0x1;_0x1d90e9['createHistory'](_0x45cee8)['catch'](loggerCatch(_0x9d38('0x18d')));if(_0x1d90e9[_0x9d38('0x177')](0x5,_0x360059,_0x57feb3)){if(_0x45cee8['countbusyretry']>=_0x57feb3['dialBusyMaxRetry']){_0x1d90e9[_0x9d38('0x187')](_0x45cee8,_0x2b46dd,_0x3ed8e6,_0x9d38('0x18e'));}else{_0x1d90e9[_0x9d38('0x18a')](_0x45cee8,_0x2b46dd,_0x3ed8e6,_0x9d38('0x18e'));}}break;case'8':_0x57feb3[_0x9d38('0x18f')]+=0x1;_0x45cee8['state']=0x8;_0x45cee8[_0x9d38('0xa6')]=_0x9d38('0x190');_0x45cee8[_0x9d38('0x17e')]+=0x1;_0x45cee8[_0x9d38('0x18c')]+=0x1;_0x1d90e9[_0x9d38('0xc3')](_0x45cee8)[_0x9d38('0xae')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x1d90e9[_0x9d38('0x177')](0x8,_0x360059,_0x57feb3)){if(_0x45cee8[_0x9d38('0x17e')]>=_0x57feb3['dialCongestionMaxRetry']){_0x1d90e9['createStateFinal'](_0x45cee8,_0x2b46dd,_0x3ed8e6,'reason\x208\x20congestion');}else{_0x1d90e9[_0x9d38('0x18a')](_0x45cee8,_0x2b46dd,_0x3ed8e6,'reason\x208\x20congestion');}}break;default:_0x57feb3[_0x9d38('0x64')]+=0x1;_0x45cee8[_0x9d38('0xd5')]=0xc;_0x45cee8[_0x9d38('0xa6')]=_0x15379b[_0x9d38('0x183')];_0x1d90e9[_0x9d38('0xc3')](_0x45cee8)['catch'](loggerCatch(_0x9d38('0x191')));if(_0x1d90e9[_0x9d38('0x177')](_0x15379b['reason'],_0x360059,_0x57feb3)){if(_0x45cee8[_0x9d38('0x178')]+_0x45cee8[_0x9d38('0x17e')]+_0x45cee8['countnoanswerretry']>=_0x57feb3[_0x9d38('0x17a')]){_0x1d90e9[_0x9d38('0x18a')](_0x45cee8,_0x2b46dd,_0x3ed8e6,_0x15379b[_0x9d38('0x183')]);}else{_0x1d90e9[_0x9d38('0x187')](_0x45cee8,_0x2b46dd,_0x3ed8e6,_0x15379b[_0x9d38('0x183')]);}}}});};Dialer[_0x9d38('0xaa')][_0x9d38('0x18a')]=function(_0x3a5973,_0x37d68b,_0x2460b0,_0x37850d){var _0x57276d=new Final(_0x3a5973);_0x57276d[_0x9d38('0xd5')]=0xf;_0x57276d[_0x9d38('0xa6')]=_0x9d38('0x192');this['createStateFinal'](_0x57276d,_0x37d68b,_0x2460b0,_0x37850d);};Dialer[_0x9d38('0xaa')][_0x9d38('0x187')]=function(_0xa6b726,_0x4f38a0,_0x55eec9,_0x51ed69){this[_0x9d38('0xc1')](_0xa6b726)['then'](function(_0x14c4b8){return _0x4f38a0(msgResponse(_0x9d38('0x182'),'Success',_0x51ed69));})[_0x9d38('0xae')](function(_0x438067){return _0x55eec9(msgResponse(_0x9d38('0x193'),'Failure','contact\x20not\x20moved'));});};Dialer[_0x9d38('0xaa')][_0x9d38('0x8')]=function(_0x2f3d90){var _0x5bb0dc=this;var _0x2b3a1f=_0x2f3d90['dialPredictiveOptimizationPercentage']/0x64;var _0x1e5f74=_0x2f3d90[_0x9d38('0x60')]/(_0x2f3d90[_0x9d38('0x60')]+_0x2f3d90[_0x9d38('0x5d')]);var _0x5c9abb=Math[_0x9d38('0x194')](_0x2f3d90[_0x9d38('0x6e')]*(_0x2f3d90[_0x9d38('0x195')]/0x64));var _0xead0c1=Math[_0x9d38('0x194')](_0x2f3d90[_0x9d38('0x6e')]*(_0x2f3d90[_0x9d38('0x196')]/0x64));var _0x22568c=_0x2f3d90[_0x9d38('0x4b')]+_0x2f3d90[_0x9d38('0x51')];var _0x2e41b8=Math[_0x9d38('0x197')](_0x2f3d90[_0x9d38('0x70')]*_0x2f3d90[_0x9d38('0x72')]*_0x2f3d90[_0x9d38('0x198')]*_0x2f3d90[_0x9d38('0x6c')]);if(_['isUndefined'](_0x2f3d90['startProgressive'])){if(!_[_0x9d38('0x84')](_0x2f3d90[_0x9d38('0x74')])){_0x2f3d90[_0x9d38('0x74')]=undefined;loggerPredictive[_0x9d38('0x96')](_0x9d38('0x199'),_0x9d38('0x19a'));}if(!_[_0x9d38('0x84')](_0x2f3d90[_0x9d38('0x90')])){loggerPredictive['error'](_0x9d38('0x199'),_0x9d38('0x19b'));clearInterval(_0x2f3d90[_0x9d38('0x90')]);_0x2f3d90['handlePredictive']=undefined;}_0x2f3d90[_0x9d38('0x24')]=moment()[_0x9d38('0x78')](_0x9d38('0xf3'));loggerPredictive[_0x9d38('0x7e')](_0x2f3d90[_0x9d38('0x3c')],_0x9d38('0x19c'),_0x2f3d90['startProgressive']);this[_0x9d38('0x136')](_0x2f3d90,0x1);}else if(ifInterval(_0x2f3d90['dialPredictiveInterval'],_0x2f3d90[_0x9d38('0x24')])){this['handlePower'](_0x2f3d90,0x1);loggerPredictiveCalls[_0x9d38('0x7e')](_0x9d38('0x19d'),_0x2f3d90[_0x9d38('0x24')],_0x2f3d90[_0x9d38('0x3c')]);_0x2f3d90[_0x9d38('0x70')]=0x0;_0x2f3d90[_0x9d38('0x6b')]=0x0;}else if(_0x2b3a1f<_0x1e5f74&&_0x2f3d90[_0x9d38('0x19e')]===_0x9d38('0x19f')){freeVariablesPredictive(_0x2f3d90);loggerPredictive['info'](_0x9d38('0x1a0'),'Dropped\x20calls\x20day',_0x1e5f74,'startProgressive',_0x2f3d90[_0x9d38('0x3c')]);}else if(_0x2e41b8<_0x2f3d90[_0x9d38('0x6b')]&&_0x2f3d90[_0x9d38('0x19e')]==='dropRate'){freeVariablesPredictive(_0x2f3d90);loggerPredictive[_0x9d38('0x7e')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x9d38('0x1a1'),_0x2e41b8,_0x9d38('0x1a2'),_0x2f3d90[_0x9d38('0x6b')],'startProgressive',_0x2f3d90['name']);}else if(!ifInterval(_0x2f3d90[_0x9d38('0x1a3')],_0x2f3d90[_0x9d38('0x24')])&&_[_0x9d38('0x84')](_0x2f3d90[_0x9d38('0x74')])&&!_['isUndefined'](_0x2f3d90[_0x9d38('0x24')])){_0x2f3d90[_0x9d38('0x74')]=moment()[_0x9d38('0x78')](_0x9d38('0xf3'));loggerPredictive[_0x9d38('0x7e')](_0x2f3d90[_0x9d38('0x3c')],_0x9d38('0x1a4'),_0x2f3d90[_0x9d38('0x74')]);this[_0x9d38('0xb9')](_0x2f3d90[_0x9d38('0x1a3')])[_0x9d38('0xb4')](this[_0x9d38('0x1a5')](_0x2f3d90))[_0x9d38('0xb4')](mergeDataErlangB(_0x2f3d90))[_0x9d38('0xb4')](this[_0x9d38('0x1a6')](_0x2f3d90))[_0x9d38('0xae')](loggerCatchPredictive(_0x9d38('0x1a7'),_0x2f3d90));}else if(!ifInterval(_0x2f3d90[_0x9d38('0x1a3')],_0x2f3d90[_0x9d38('0x74')])){_0x2f3d90['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x2f3d90[_0x9d38('0x74')]=moment()[_0x9d38('0x78')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x2f3d90[_0x9d38('0x3c')],'recalculate\x20predictive\x20at',_0x2f3d90[_0x9d38('0x74')]);clearInterval(_0x2f3d90[_0x9d38('0x90')]);_0x2f3d90[_0x9d38('0x90')]=undefined;this[_0x9d38('0xb9')](_0x2f3d90[_0x9d38('0x1a3')])[_0x9d38('0xb4')](this[_0x9d38('0x1a5')](_0x2f3d90))['then'](mergeDataErlangB(_0x2f3d90))[_0x9d38('0xb4')](this['startMethodPredictive'](_0x2f3d90))[_0x9d38('0xae')](loggerCatchPredictive(_0x9d38('0x1a8'),_0x2f3d90));}else if(_0x2f3d90[_0x9d38('0x6e')]&&_0x22568c<_0x2f3d90[_0x9d38('0x6e')]-_0xead0c1){freeVariablesPredictive(_0x2f3d90);loggerPredictive[_0x9d38('0x7e')](_0x2f3d90['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x22568c,_0x9d38('0x1a9'),_0x2f3d90[_0x9d38('0x6e')],'-',_0xead0c1,'=',_0x2f3d90[_0x9d38('0x6e')]-_0xead0c1,')');}else if(_0x2f3d90[_0x9d38('0x6e')]&&_0x22568c>_0x2f3d90[_0x9d38('0x6e')]+_0x5c9abb){freeVariablesPredictive(_0x2f3d90);loggerPredictive[_0x9d38('0x7e')](_0x2f3d90[_0x9d38('0x3c')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x22568c,_0x9d38('0x1aa'),_0x2f3d90['predictiveIntervalAvailable'],'+',_0x5c9abb,'=',_0x2f3d90[_0x9d38('0x6e')]+_0x5c9abb,')');}};Dialer[_0x9d38('0xaa')][_0x9d38('0x1a5')]=function(_0x32e7d3){var _0x34f34a=this;return function(_0x324ca2){return new BPromise(function(_0x4068cc,_0x4779a1){_[_0x9d38('0x8d')](_0x32e7d3,_0x324ca2[0x0]);if(checkGetDataPredictive(_0x324ca2[0x0])){var _0x5695ec=_0x32e7d3[_0x9d38('0x6e')]=_0x32e7d3[_0x9d38('0x51')]+_0x32e7d3[_0x9d38('0x4b')];var _0x44e92e=_0x32e7d3[_0x9d38('0x1a3')]*0x3c;var _0x1cc515=_0x324ca2[0x0][_0x9d38('0x67')]+_0x324ca2[0x0][_0x9d38('0x66')];var _0x17e472=(_0x324ca2[0x0]['predictiveIntervalAnsweredCalls']+_0x324ca2[0x0][_0x9d38('0x69')]+_0x324ca2[0x0][_0x9d38('0x68')])/_0x324ca2[0x0][_0x9d38('0x6f')];_0x32e7d3['predictiveIntervalHitRate']=_0x17e472>0x0?_0x17e472:0x1;switch(_0x32e7d3['dialPredictiveOptimization']){case'dropRate':var _0x3a4e07=_0x32e7d3[_0x9d38('0x1ab')]/0x64;return _0x34f34a[_0x9d38('0x1ac')](_0x5695ec,_0x44e92e,_0x1cc515,_0x17e472,_0x3a4e07)[_0x9d38('0xb4')](function(_0x1a9c92){return _0x4068cc(_0x1a9c92);});case'agentBusyFactor':var _0x5a96d2=_0x32e7d3[_0x9d38('0x1ab')]/0x64;return _0x34f34a[_0x9d38('0x1ad')](_0x5695ec,_0x44e92e,_0x1cc515,_0x17e472,_0x5a96d2)[_0x9d38('0xb4')](function(_0x29ccff){return _0x4068cc(_0x29ccff);});default:return _0x4779a1(msgResponse('[getDataPredictive]','Failure',_0x9d38('0x1ae')));}}else{return _0x4779a1(msgResponse('[getDataPredictive]',_0x9d38('0x122'),_0x9d38('0x1af')));}});};};Dialer[_0x9d38('0xaa')][_0x9d38('0x1b0')]=function(_0x4ed0f3){var _0x277f2a=this;return function(_0x1ecbe0){return new BPromise(function(_0x2e6bb0,_0x36e3e6){_[_0x9d38('0x8d')](_0x4ed0f3,_0x1ecbe0[0x0]);if(checkGetDataPredictive(_0x1ecbe0[0x0])){loggerPredictive[_0x9d38('0x7e')](JSON[_0x9d38('0x44')](_0x1ecbe0[0x0]));if(_0x4ed0f3[_0x9d38('0x19e')]==='dropRate'){return _0x277f2a['getVoiceQueueRtPauses'](_0x4ed0f3['id'])[_0x9d38('0xb4')](function(_0x1b292e){var _0x4da593=_0x4ed0f3[_0x9d38('0x4c')]-_0x1b292e[0x0]['outboundQueuePauses'];var _0x55da67=_0x4ed0f3[_0x9d38('0x1a3')]*0x3c;var _0x19f295=_0x1ecbe0[0x0][_0x9d38('0x67')]+_0x1ecbe0[0x0][_0x9d38('0x66')];var _0x33be44=(_0x1ecbe0[0x0][_0x9d38('0x65')]+_0x1ecbe0[0x0][_0x9d38('0x69')]+_0x1ecbe0[0x0][_0x9d38('0x68')])/_0x1ecbe0[0x0][_0x9d38('0x6f')];var _0x2ddf6b=_0x4ed0f3[_0x9d38('0x1ab')]/0x64;_0x4ed0f3[_0x9d38('0x6d')]=_0x1b292e[0x0][_0x9d38('0x1b1')]||0x0;_0x4ed0f3[_0x9d38('0x198')]=_0x33be44>0x0?_0x33be44:0x1;return _0x277f2a[_0x9d38('0x1ac')](_0x4da593,_0x55da67,_0x19f295,_0x33be44,_0x2ddf6b);})['then'](function(_0x44eab6){return _0x2e6bb0(_0x44eab6);})[_0x9d38('0xae')](function(_0x14ce43){return _0x36e3e6(msgResponse(_0x9d38('0x1b2'),'Failure',JSON[_0x9d38('0x44')](_0x14ce43)));});}if(_0x4ed0f3['dialPredictiveOptimization']===_0x9d38('0x1b3')){return _0x277f2a['getVoiceQueueRtPauses'](_0x4ed0f3['id'])[_0x9d38('0xb4')](function(_0x5526bd){var _0x5cf907=_0x4ed0f3[_0x9d38('0x4c')]-_0x5526bd[0x0][_0x9d38('0x1b1')];var _0x45d853=_0x4ed0f3['dialPredictiveInterval']*0x3c;var _0x2bec48=_0x1ecbe0[0x0]['predictiveIntervalAvgTalktime']+_0x1ecbe0[0x0][_0x9d38('0x66')];var _0x5448f1=(_0x1ecbe0[0x0][_0x9d38('0x65')]+_0x1ecbe0[0x0][_0x9d38('0x69')]+_0x1ecbe0[0x0][_0x9d38('0x68')])/_0x1ecbe0[0x0][_0x9d38('0x6f')];var _0x1400c8=_0x4ed0f3['dialPredictiveOptimizationPercentage']/0x64;_0x4ed0f3[_0x9d38('0x6d')]=_0x5526bd[0x0][_0x9d38('0x1b1')]||0x0;_0x4ed0f3[_0x9d38('0x198')]=_0x5448f1>0x0?_0x5448f1:0x1;return _0x277f2a[_0x9d38('0x1ad')](_0x5cf907,_0x45d853,_0x2bec48,_0x5448f1,_0x1400c8);})['then'](function(_0x11f520){return _0x2e6bb0(_0x11f520);})[_0x9d38('0xae')](function(_0x20fe30){return _0x36e3e6(msgResponse('[CatchErlangB]',_0x9d38('0x122'),JSON['stringify'](_0x20fe30)));});}}else{return _0x36e3e6(msgResponse('[getDataPredictive]','Failure','check\x20failure'));}});};};Dialer['prototype'][_0x9d38('0x1a6')]=function(_0x29d3f3){var _0xf123af=this;return function(){var _0x2446b0=0x0;var _0x33f24c=Math[_0x9d38('0x197')](_0x29d3f3['erlangCallToSecond']*0x3e8);if(_0x33f24c>0x0){_0x33f24c=_0x33f24c<0x64?0x64:_0x33f24c;loggerPredictive[_0x9d38('0x7e')](_0x29d3f3[_0x9d38('0x3c')],_0x9d38('0x1b4'),_0x33f24c,_0x9d38('0x45'));_0x29d3f3['handlePredictive']=setInterval(function(){_0xf123af['handlePredictive'](_0x29d3f3);loggerPredictiveCalls[_0x9d38('0x7e')](_0x9d38('0x1b5'),_0x2446b0+=0x1);},_0x33f24c);}else{loggerPredictive[_0x9d38('0x7e')](_0x29d3f3[_0x9d38('0x3c')],_0x9d38('0x1b6'));}};};Dialer[_0x9d38('0xaa')][_0x9d38('0x1b7')]=function(_0x186524,_0xe9198f){var _0x34c9f5=this;return function(_0x1d8dad){if(_[_0x9d38('0x7b')](_0x1d8dad)){if(_[_0x9d38('0xab')](_0xe9198f[_0x9d38('0x1b8')])||!_0xe9198f['recallme']){if(_0x186524['dialMethod']===_0x9d38('0x1b9')){_0x186524['queueStatusComplete']=_[_0x9d38('0x84')](_0x186524[_0x9d38('0x106')])?!![]:_0x186524[_0x9d38('0x106')];var _0x319983=uuid['v4']();_0x34c9f5[_0x9d38('0xff')][_0x319983]=new Action(_0x186524,_0xe9198f,_0x319983);loggerBooked[_0x9d38('0x7e')](_0x9d38('0x1ba'),_0x319983,_0x9d38('0x1bb'),JSON[_0x9d38('0x44')](_0x186524[_0x9d38('0x106')]),_0x9d38('0x1bc'),_0x186524['name']);if(_0x186524[_0x9d38('0x106')]){_0x186524[_0x9d38('0x106')]=![];_0x34c9f5[_0x9d38('0x26')][_0x34c9f5[_0x9d38('0xff')][_0x319983][_0x9d38('0xb1')]]=[];ami[_0x9d38('0xac')]({'actionid':_0x319983,'action':_0x9d38('0x1bd'),'queue':_0x186524[_0x9d38('0x3c')]})[_0x9d38('0xae')](function(_0x5f01c5){_0x34c9f5['updateOriginated'](_0x186524);_0x34c9f5[_0x9d38('0xba')]({'active':![],'ContactId':_0x34c9f5[_0x9d38('0xff')][_0x319983][_0x9d38('0x10c')],'ListId':_0x34c9f5[_0x9d38('0xff')][_0x319983][_0x9d38('0xca')],'VoiceQueueId':_0x34c9f5['actions'][_0x319983][_0x9d38('0xcb')]||undefined,'CampaignId':_0x34c9f5[_0x9d38('0xff')][_0x319983][_0x9d38('0x10d')]||undefined})[_0x9d38('0xae')](loggerCatch(_0x9d38('0x1be')));delete _0x34c9f5[_0x9d38('0xff')][_0x319983];});}else{loggerBooked[_0x9d38('0x7e')](_0x9d38('0x1bf'),JSON[_0x9d38('0x44')](_0x186524[_0x9d38('0x106')]),_0x9d38('0x1bc'),_0x186524[_0x9d38('0x3c')]);_0x34c9f5['updateOriginated'](_0x186524);_0x34c9f5[_0x9d38('0xba')]({'active':![],'ContactId':_0x34c9f5[_0x9d38('0xff')][_0x319983][_0x9d38('0x10c')],'ListId':_0x34c9f5[_0x9d38('0xff')][_0x319983][_0x9d38('0xca')],'VoiceQueueId':_0x34c9f5[_0x9d38('0xff')][_0x319983][_0x9d38('0xcb')]||undefined,'CampaignId':_0x34c9f5[_0x9d38('0xff')][_0x319983]['CampaignId']||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x34c9f5[_0x9d38('0xff')][_0x319983];}}else{return _0x34c9f5[_0x9d38('0x145')](_0x186524,_0xe9198f);}}else{if(getDiff(_0xe9198f[_0x9d38('0x1c0')])<_0x186524[_0x9d38('0x1c1')]*0x3c){_0x34c9f5['preview'][_0x9d38('0x108')](_0xe9198f['id'])[_0x9d38('0x10b')](function(){_0x34c9f5[_0x9d38('0xb0')](_0x186524);});}else{_0x186524['outboundReCallsDay']+=0x1;_0x34c9f5[_0x9d38('0xb0')](_0x186524);if(_0x186524[_0x9d38('0x1c2')]){_0x34c9f5[_0x9d38('0xba')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xe9198f['ContactId'],'ListId':_0xe9198f[_0x9d38('0xca')],'VoiceQueueId':_0xe9198f[_0x9d38('0xcb')]||undefined,'CampaignId':_0xe9198f[_0x9d38('0x10d')]||undefined})[_0x9d38('0xae')](loggerCatch(_0x9d38('0x1c3')));_0x34c9f5[_0x9d38('0xc3')](createObjHistory(_0x186524,_0xe9198f,_0x9d38('0x1c4'),0x17,_0x9d38('0x1c5')))['catch'](loggerCatch(_0x9d38('0x1c6')));}else{_0x34c9f5[_0x9d38('0xc8')](createObjHistory(_0x186524,_0xe9198f,_0x9d38('0x1c7'),0x16,_0x9d38('0x1c8')),_0x9d38('0x1c9'),'[Originate][HistoryRecallClose]');}}}}else{_0x186524[_0x9d38('0x1ca')]+=0x1;_0x34c9f5['saveInDb'](createObjHistory(_0x186524,_0xe9198f,'BLACKLIST',0xd,_0x9d38('0x1cb')),_0x9d38('0x1cc'),_0x9d38('0x1cd'));throw _0x9d38('0x1ce');}};};Dialer['prototype'][_0x9d38('0x13b')]=function(_0x3b2dd4){var _0x75738b=this;var _0x1f8543=[];var _0x75484b=_0x3b2dd4[_0x9d38('0x1cf')]-_0x3b2dd4['originated']-_0x3b2dd4[_0x9d38('0x1d0')];emitCampaignSummary(_0x3b2dd4);if(_0x75484b>0x0){if(_0x75484b>this[_0x9d38('0x20')]){_0x75484b=this[_0x9d38('0x20')];}_0x3b2dd4[_0x9d38('0x1d0')]+=_0x75484b;this['getContactDialerIvr'](_0x3b2dd4['id'],_0x75484b,_0x3b2dd4['dialOrderByScheduledAt'])[_0x9d38('0xb4')](function(_0x3fc6a4){_0x3b2dd4[_0x9d38('0x1d0')]-=_0x75484b;_0x3b2dd4[_0x9d38('0x1d0')]=_0x3b2dd4[_0x9d38('0x1d0')]>0x0?_0x3b2dd4[_0x9d38('0x1d0')]:0x0;if(!checkContactEmpty(_0x3fc6a4)){_0x3b2dd4[_0x9d38('0x3b')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x9d38('0x7e')](_0x9d38('0x1d1')+_0x3b2dd4[_0x9d38('0x3c')]);}else{_0x3b2dd4[_0x9d38('0x99')]+=_0x3fc6a4[_0x9d38('0x110')];_0x3b2dd4[_0x9d38('0x3b')]=_0x9d38('0x1d2');for(var _0x77b42a=0x0;_0x77b42a<_0x3fc6a4[_0x9d38('0x110')];_0x77b42a+=0x1){_0x3b2dd4[_0x9d38('0x1d3')]+=0x1;if(_[_0x9d38('0xab')](_0x3fc6a4[_0x77b42a])||_[_0x9d38('0xab')](_0x3fc6a4[_0x77b42a][_0x9d38('0x149')])||_[_0x9d38('0xab')](_0x3fc6a4[_0x77b42a]['Contact'][_0x9d38('0x14a')])){_0x75738b[_0x9d38('0x1d4')](_0x9d38('0x1d5'),_0x3b2dd4,_0x3fc6a4[_0x77b42a]);}else{_0x75738b[_0x9d38('0xb7')](_['pick'](_0x3fc6a4[_0x77b42a],[_0x9d38('0x10d'),'Contact.phone']))['then'](_0x75738b[_0x9d38('0x1b7')](_0x3b2dd4,_0x3fc6a4[_0x77b42a]))['catch'](_0x75738b[_0x9d38('0xc6')](_0x9d38('0x1d6'),_0x3b2dd4));}}}})[_0x9d38('0xae')](loggerGetContactDialer(_0x9d38('0x1d7'),_0x3b2dd4,_0x75484b));}};Dialer[_0x9d38('0xaa')][_0x9d38('0x136')]=function(_0x3588f1,_0x14bd0b){var _0x2909a6=this;var _0x16de58=[];var _0x3bec1e=_0x14bd0b>=0x1?_0x14bd0b:0x1;var _0x2b5878=[];if(_0x3588f1[_0x9d38('0x58')]===_0x9d38('0x1b9')){_0x3bec1e=0x1;}var _0x420275=Math['floor'](_0x3588f1['available']*_0x3bec1e)-_0x3588f1[_0x9d38('0x99')]-_0x3588f1['temp'];emitVoiceQueueSummary(_0x3588f1);if(_0x3588f1[_0x9d38('0x1d8')]>0x0){var _0x53fe72=_0x3588f1[_0x9d38('0x1d8')]-_0x3588f1['originated']-_0x3588f1[_0x9d38('0x51')]-_0x3588f1[_0x9d38('0x1d0')]-_0x3588f1[_0x9d38('0x4d')];if(_0x420275>_0x53fe72){_0x420275=_0x53fe72;}}if(_0x420275>0x0){if(_0x3588f1[_0x9d38('0x58')]===_0x9d38('0x1b9')){_0x420275=0x1;}if(_0x420275>this['maxNumberOriginate']){_0x420275=this[_0x9d38('0x20')];}_0x3588f1[_0x9d38('0x1d0')]+=_0x420275;for(var _0x499e17 in this['agents']){if(this[_0x9d38('0x1e')][_0x9d38('0x98')](_0x499e17)){if(this[_0x9d38('0x1e')][_0x499e17][_0x9d38('0xd5')]===_0x9d38('0x1d9')&&this[_0x9d38('0x1e')][_0x499e17][_0x9d38('0xce')]===_0x9d38('0xcf')){_0x16de58['push'](this[_0x9d38('0x1e')][_0x499e17]['id']);}}}this['getContactDialer'](_0x3588f1['id'],_0x16de58,_0x420275,_0x3588f1['dialOrderByScheduledAt'])[_0x9d38('0xb4')](function(_0x12dc34){_0x3588f1[_0x9d38('0x1d0')]-=_0x420275;_0x3588f1['temp']=_0x3588f1[_0x9d38('0x1d0')]>0x0?_0x3588f1[_0x9d38('0x1d0')]:0x0;if(!checkContactEmpty(_0x12dc34)){_0x2909a6[_0x9d38('0xb3')](_0x3588f1)[_0x9d38('0xb4')](sendMessageReschedule(_0x3588f1))[_0x9d38('0xae')](loggerCatch('[countReScheduled]\x20'));}else{_0x3588f1['originated']+=_0x12dc34[_0x9d38('0x110')];_0x3588f1[_0x9d38('0x3b')]=_0x3588f1['dialMethod']===_0x9d38('0x1b9')?_0x9d38('0x14e'):_0x9d38('0x1d2');for(var _0x34b75d=0x0;_0x34b75d<_0x12dc34[_0x9d38('0x110')];_0x34b75d+=0x1){if(_[_0x9d38('0xab')](_0x12dc34[_0x34b75d])||_[_0x9d38('0xab')](_0x12dc34[_0x34b75d]['Contact'])||_[_0x9d38('0xab')](_0x12dc34[_0x34b75d][_0x9d38('0x149')][_0x9d38('0x14a')])){_0x2909a6[_0x9d38('0x1d4')]('[actionOriginate]\x20',_0x3588f1,_0x12dc34[_0x34b75d]);}else{_0x2909a6['checkIsBlackList'](_[_0x9d38('0xc9')](_0x12dc34[_0x34b75d],['VoiceQueueId',_0x9d38('0x1da')]))['then'](_0x2909a6[_0x9d38('0x1b7')](_0x3588f1,_0x12dc34[_0x34b75d]))[_0x9d38('0xae')](_0x2909a6[_0x9d38('0xc6')](_0x9d38('0x1d5'),_0x3588f1));}}}})[_0x9d38('0xae')](loggerGetContactDialer(_0x9d38('0x1db'),_0x3588f1,_0x420275));}};Dialer[_0x9d38('0xaa')][_0x9d38('0x90')]=function(_0x509115){var _0xb6abaa=this;if(_0x509115[_0x9d38('0x1d8')]>0x0){var _0x966ba2=_0x509115[_0x9d38('0x1d8')]-_0x509115[_0x9d38('0x99')]-_0x509115['talking'];if(_0x966ba2>0x0){this[_0x9d38('0x1dc')](_0x509115);}else{loggerPredictiveCalls[_0x9d38('0x7e')](_0x9d38('0x1dd'));}}else{this[_0x9d38('0x1dc')](_0x509115);}};Dialer[_0x9d38('0xaa')][_0x9d38('0x1dc')]=function(_0x2959b5){var _0x258089=this;var _0x3690e2=[];_0x2959b5[_0x9d38('0x99')]+=0x1;for(var _0x531436 in this[_0x9d38('0x1e')]){if(this[_0x9d38('0x1e')]['hasOwnProperty'](_0x531436)){if(this['agents'][_0x531436][_0x9d38('0xd5')]==='not_inuse'&&this[_0x9d38('0x1e')][_0x531436][_0x9d38('0xce')]===_0x9d38('0xcf')){_0x3690e2[_0x9d38('0x128')](this[_0x9d38('0x1e')][_0x531436]['id']);}}}this[_0x9d38('0xbc')](_0x2959b5['id'],_0x3690e2,0x1,_0x2959b5[_0x9d38('0x1de')])[_0x9d38('0xb4')](function(_0x4e1b2f){if(!checkContactEmpty(_0x4e1b2f)){checkContactLowerLimitOriginate(_0x2959b5,0x1,0x0);_0x258089[_0x9d38('0xb3')](_0x2959b5)[_0x9d38('0xb4')](sendMessageReschedule(_0x2959b5))[_0x9d38('0xae')](loggerCatch(_0x9d38('0x1df')));}else{_0x2959b5[_0x9d38('0x3b')]=_0x9d38('0x1d2');if(_['isNil'](_0x4e1b2f[0x0])||_[_0x9d38('0xab')](_0x4e1b2f[0x0]['Contact'])||_[_0x9d38('0xab')](_0x4e1b2f[0x0][_0x9d38('0x149')][_0x9d38('0x14a')])){_0x258089['emptyContact']('[actionOriginate]\x20',_0x2959b5,_0x4e1b2f[0x0]);}else{_0x258089['checkIsBlackList'](_[_0x9d38('0xc9')](_0x4e1b2f[0x0],[_0x9d38('0xcb'),_0x9d38('0x1da')]))[_0x9d38('0xb4')](_0x258089[_0x9d38('0x1b7')](_0x2959b5,_0x4e1b2f[0x0]))[_0x9d38('0xae')](_0x258089[_0x9d38('0xc6')]('[actionOriginatePredictive]\x20',_0x2959b5));}}})[_0x9d38('0xae')](loggerGetContactDialer(_0x9d38('0x1e0'),_0x2959b5,0x1));emitVoiceQueueSummary(_0x2959b5);};Dialer['prototype'][_0x9d38('0x1ac')]=function(_0x100b42,_0x34f2ae,_0x3f4a95,_0x27c063,_0xe2195a,_0x3651da){loggerPredictive[_0x9d38('0x7e')](_0x9d38('0x1e1'));loggerPredictive[_0x9d38('0x7e')](_0x9d38('0x1e2'),_0x100b42);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x34f2ae);loggerPredictive[_0x9d38('0x7e')](_0x9d38('0x1e3'),_0x3f4a95);loggerPredictive[_0x9d38('0x7e')](_0x9d38('0x1e4'),_0x27c063);loggerPredictive[_0x9d38('0x7e')](_0x9d38('0x1e5'),_0xe2195a);loggerPredictive[_0x9d38('0x7e')]('---------------------------');return new BPromise(function(_0x24ad97,_0x2a5264){if(_0x100b42<=0x0||isNaN(_0x100b42)){return _0x2a5264(msgResponse(_0x9d38('0x1e6'),'Error','m\x20=\x20'+_0x100b42));}if(_0x3f4a95<=0x0||isNaN(_0x3f4a95)){return _0x2a5264(msgResponse(_0x9d38('0x1e6'),_0x9d38('0x1e7'),'Ts\x20=\x20'+_0x3f4a95));}if(_0x27c063<=0x0||isNaN(_0x27c063)){return _0x2a5264(msgResponse(_0x9d38('0x1e6'),_0x9d38('0x1e7'),_0x9d38('0x1e8')+_0x27c063));}if(_0x34f2ae<=0x0||isNaN(_0x34f2ae)){return _0x2a5264(msgResponse(_0x9d38('0x1e6'),_0x9d38('0x1e7'),_0x9d38('0x1e9')+_0x34f2ae));}if(_0xe2195a<=0x0||isNaN(_0xe2195a)){return _0x2a5264(msgResponse(_0x9d38('0x1e6'),'Error','Amax\x20=\x20'+_0xe2195a));}_0x3651da=_0x3651da||0x0;var _0x40b8c5=0x1/_0x3f4a95;var _0x13ee5b=0x0;var _0x4d349e=0x0;var _0x3ffc9b=0x0;var _0x21c988=0x0;for(var _0x2ca72d=0x0;_0x3ffc9b<_0xe2195a;_0x2ca72d+=0x1){_0x4d349e=_0x2ca72d/_0x34f2ae;_0x13ee5b=(_0x27c063*_0x4d349e+_0x3651da)/_0x40b8c5;_0x3ffc9b=erlangb(_0x13ee5b,_0x100b42);_0x21c988=_0x13ee5b/_0x100b42*(0x1-erlangb(_0x13ee5b,_0x100b42));}return _0x24ad97({'erlangCalls':_0x2ca72d,'erlangCallToSecond':_0x34f2ae/_0x2ca72d,'erlangAbandonmentRate':_0x3ffc9b,'erlangBusyFactor':_0x21c988});});};Dialer['prototype'][_0x9d38('0x1ad')]=function(_0x4cfebd,_0x15bcd2,_0xc9db22,_0x5e2e17,_0x248562,_0x21b17c){loggerPredictive[_0x9d38('0x7e')](_0x9d38('0x1ea'));loggerPredictive[_0x9d38('0x7e')](_0x9d38('0x1e2'),_0x4cfebd);loggerPredictive[_0x9d38('0x7e')](_0x9d38('0x1eb'),_0x15bcd2);loggerPredictive[_0x9d38('0x7e')](_0x9d38('0x1e3'),_0xc9db22);loggerPredictive['info']('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',_0x5e2e17);loggerPredictive[_0x9d38('0x7e')](_0x9d38('0x1ec'),_0x248562);loggerPredictive[_0x9d38('0x7e')]('---------------------------');return new BPromise(function(_0x6c14e1,_0x2e81ed){if(_0x4cfebd<=0x0||isNaN(_0x4cfebd)){return _0x2e81ed(msgResponse(_0x9d38('0x1ed'),_0x9d38('0x1e7'),_0x9d38('0x1ee')+_0x4cfebd));}if(_0xc9db22<=0x0||isNaN(_0xc9db22)){return _0x2e81ed(msgResponse(_0x9d38('0x1ed'),_0x9d38('0x1e7'),_0x9d38('0x1ef')+_0xc9db22));}if(_0x5e2e17<=0x0||isNaN(_0x5e2e17)){return _0x2e81ed(msgResponse(_0x9d38('0x1ed'),_0x9d38('0x1e7'),_0x9d38('0x1e8')+_0x5e2e17));}if(_0x15bcd2<=0x0||isNaN(_0x15bcd2)){return _0x2e81ed(msgResponse(_0x9d38('0x1ed'),_0x9d38('0x1e7'),_0x9d38('0x1e9')+_0x15bcd2));}if(_0x248562<=0x0||isNaN(_0x248562)){return _0x2e81ed(msgResponse(_0x9d38('0x1ed'),_0x9d38('0x1e7'),_0x9d38('0x1f0')+_0x248562));}_0x21b17c=_0x21b17c||0x0;var _0x39116f=0x1/_0xc9db22;var _0x135b6d=0x0;var _0x4f546e=0x0;var _0x22b49d=0x0;var _0x23a852=0x0;for(var _0x11e578=0x0;_0x23a852<_0x248562;_0x11e578+=0x1){_0x4f546e=_0x11e578/_0x15bcd2;_0x135b6d=(_0x5e2e17*_0x4f546e+_0x21b17c)/_0x39116f;_0x22b49d=erlangb(_0x135b6d,_0x4cfebd);_0x23a852=_0x135b6d/_0x4cfebd*(0x1-erlangb(_0x135b6d,_0x4cfebd));}return _0x6c14e1({'erlangCalls':_0x11e578,'erlangCallToSecond':_0x15bcd2/_0x11e578,'erlangAbandonmentRate':_0x22b49d,'erlangBusyFactor':_0x23a852});});};module[_0x9d38('0x1f1')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 44893ec..4f5c5d1 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 _0x64e7=['membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','endtime','ringtime'];(function(_0x1e3ee7,_0x4d3649){var _0x2ca187=function(_0x15ad73){while(--_0x15ad73){_0x1e3ee7['push'](_0x1e3ee7['shift']());}};_0x2ca187(++_0x4d3649);}(_0x64e7,0x1ef));var _0x764e=function(_0x5c9f15,_0x4a5491){_0x5c9f15=_0x5c9f15-0x0;var _0x535ffc=_0x64e7[_0x5c9f15];return _0x535ffc;};'use strict';var util=require(_0x764e('0x0'));var _=require(_0x764e('0x1'));var moment=require('moment');function getSeconds(_0x410aa8,_0x2a97ea){var _0x1410de=moment(_0x410aa8)[_0x764e('0x2')](0x0);var _0x2625ae=moment(_0x2a97ea)[_0x764e('0x2')](0x0);return _0x1410de[_0x764e('0x3')](_0x2625ae,_0x764e('0x4'));}function QueueCallerAbandon(_0x3338f7,_0x29d032){this[_0x764e('0x5')]=_0x3338f7[_0x764e('0x5')];this[_0x764e('0x6')]=_0x3338f7[_0x764e('0x6')];this[_0x764e('0x7')]=_0x3338f7['type']===_0x764e('0x8')?_0x764e('0x9'):_0x3338f7['type'];this[_0x764e('0xa')]=_0x3338f7[_0x764e('0xa')];this[_0x764e('0xb')]=_0x3338f7[_0x764e('0xb')];this[_0x764e('0xc')]=_0x3338f7[_0x764e('0xc')];this[_0x764e('0xd')]=_0x3338f7[_0x764e('0xa')]+_0x3338f7['countcongestionretry']+_0x3338f7[_0x764e('0xc')];this[_0x764e('0xe')]=_0x29d032[_0x764e('0xe')];this[_0x764e('0xf')]=_0x3338f7[_0x764e('0x10')];this[_0x764e('0x11')]=_0x3338f7['number'];this[_0x764e('0x12')]=_0x3338f7['starttime'];this[_0x764e('0x13')]=_0x3338f7['responsetime'];this[_0x764e('0x14')]=_0x3338f7[_0x764e('0x14')];this[_0x764e('0x15')]=this['droptime'];this[_0x764e('0x16')]=getSeconds(_0x3338f7[_0x764e('0x13')],_0x3338f7['starttime']);this['holdtime']=getSeconds(this[_0x764e('0x14')],_0x3338f7[_0x764e('0x13')]);this['talktime']=0x0;this[_0x764e('0x9')]=_0x29d032[_0x764e('0x9')];this[_0x764e('0x17')]=_0x29d032['connectedlinename'];this[_0x764e('0x18')]=_0x29d032[_0x764e('0x18')];this[_0x764e('0x19')]=_0x3338f7['callback'];this[_0x764e('0x1a')]=_0x3338f7[_0x764e('0x1a')];this[_0x764e('0x1b')]=_0x3338f7[_0x764e('0x1b')];this[_0x764e('0x1c')]=_0x3338f7[_0x764e('0x1c')];this[_0x764e('0x1d')]=_0x3338f7[_0x764e('0x1d')];this[_0x764e('0x1e')]=_0x3338f7['ListId'];this[_0x764e('0x1f')]=_0x3338f7['UserId'];this[_0x764e('0x20')]=_0x3338f7['VoiceQueueId'];this[_0x764e('0x21')]=_0x3338f7[_0x764e('0x21')];this['originatecalleridnum']=_0x3338f7[_0x764e('0x22')]||'';this[_0x764e('0x23')]=_0x3338f7[_0x764e('0x23')]||'';}module[_0x764e('0x24')]=QueueCallerAbandon; \ No newline at end of file +var _0x79ef=['starttime','responsetime','droptime','endtime','ringtime','holdtime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','number'];(function(_0x261844,_0x15e233){var _0x13028c=function(_0x16590f){while(--_0x16590f){_0x261844['push'](_0x261844['shift']());}};_0x13028c(++_0x15e233);}(_0x79ef,0x13b));var _0xf79e=function(_0x2184bd,_0xfc4324){_0x2184bd=_0x2184bd-0x0;var _0x4820d5=_0x79ef[_0x2184bd];return _0x4820d5;};'use strict';var util=require(_0xf79e('0x0'));var _=require(_0xf79e('0x1'));var moment=require('moment');function getSeconds(_0x3cceb9,_0x1b0d18){var _0x2284c0=moment(_0x3cceb9)[_0xf79e('0x2')](0x0);var _0x11c14d=moment(_0x1b0d18)[_0xf79e('0x2')](0x0);return _0x2284c0[_0xf79e('0x3')](_0x11c14d,'seconds');}function QueueCallerAbandon(_0x1b2b7f,_0x5acc76){this[_0xf79e('0x4')]=_0x1b2b7f[_0xf79e('0x4')];this[_0xf79e('0x5')]=_0x1b2b7f[_0xf79e('0x5')];this[_0xf79e('0x6')]=_0x1b2b7f['type']===_0xf79e('0x7')?_0xf79e('0x8'):_0x1b2b7f['type'];this[_0xf79e('0x9')]=_0x1b2b7f[_0xf79e('0x9')];this[_0xf79e('0xa')]=_0x1b2b7f['countcongestionretry'];this[_0xf79e('0xb')]=_0x1b2b7f[_0xf79e('0xb')];this[_0xf79e('0xc')]=_0x1b2b7f[_0xf79e('0x9')]+_0x1b2b7f[_0xf79e('0xa')]+_0x1b2b7f[_0xf79e('0xb')];this[_0xf79e('0xd')]=_0x5acc76['uniqueid'];this[_0xf79e('0xe')]=_0x1b2b7f[_0xf79e('0xf')];this[_0xf79e('0x10')]=_0x1b2b7f[_0xf79e('0x11')];this[_0xf79e('0x12')]=_0x1b2b7f[_0xf79e('0x12')];this[_0xf79e('0x13')]=_0x1b2b7f[_0xf79e('0x13')];this[_0xf79e('0x14')]=_0x1b2b7f[_0xf79e('0x14')];this[_0xf79e('0x15')]=this['droptime'];this[_0xf79e('0x16')]=getSeconds(_0x1b2b7f[_0xf79e('0x13')],_0x1b2b7f['starttime']);this[_0xf79e('0x17')]=getSeconds(this[_0xf79e('0x14')],_0x1b2b7f['responsetime']);this['talktime']=0x0;this[_0xf79e('0x8')]=_0x5acc76[_0xf79e('0x8')];this['membername']=_0x5acc76[_0xf79e('0x18')];this['reason']=_0x5acc76[_0xf79e('0x19')];this[_0xf79e('0x1a')]=_0x1b2b7f['callback'];this['callbackuniqueid']=_0x1b2b7f[_0xf79e('0x1b')];this[_0xf79e('0x1c')]=_0x1b2b7f[_0xf79e('0x1c')];this[_0xf79e('0x1d')]=_0x1b2b7f[_0xf79e('0x1d')];this[_0xf79e('0x1e')]=_0x1b2b7f[_0xf79e('0x1e')];this[_0xf79e('0x1f')]=_0x1b2b7f[_0xf79e('0x1f')];this[_0xf79e('0x20')]=_0x1b2b7f['UserId'];this['VoiceQueueId']=_0x1b2b7f[_0xf79e('0x21')];this['CampaignId']=_0x1b2b7f['CampaignId'];this[_0xf79e('0x22')]=_0x1b2b7f[_0xf79e('0x22')]||'';this[_0xf79e('0x23')]=_0x1b2b7f[_0xf79e('0x23')]||'';}module[_0xf79e('0x24')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 4088a1c..f3cb695 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 _0x5829=['AttachmentId','lodash','channel','format','%s/%s/%s','tech','Trunk','name','fax','localstationid','headerinfo','path'];(function(_0x231431,_0x171faa){var _0x1fa7c7=function(_0x4c5af0){while(--_0x4c5af0){_0x231431['push'](_0x231431['shift']());}};_0x1fa7c7(++_0x171faa);}(_0x5829,0x115));var _0x9582=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x5829[_0x82129b];return _0x2ae5dc;};'use strict';var util=require('util');var _=require(_0x9582('0x0'));var moment=require('moment');function Action(_0x2974bc,_0x31e6c3,_0x3f1366){this['uniqueid']=_0x2974bc||undefined;this[_0x9582('0x1')]=util[_0x9582('0x2')](_0x9582('0x3'),_0x31e6c3[_0x9582('0x4')],_0x31e6c3[_0x9582('0x5')][_0x9582('0x6')],_0x3f1366[_0x9582('0x7')]);this[_0x9582('0x8')]=_0x31e6c3['localstationid'];this[_0x9582('0x9')]=_0x31e6c3[_0x9582('0x9')];this['path']=_0x3f1366[_0x9582('0xa')];this[_0x9582('0xb')]=_0x3f1366[_0x9582('0xb')];}module['exports']=Action; \ No newline at end of file +var _0x0f86=['tech','Trunk','name','fax','localstationid','headerinfo','path','AttachmentId','exports','util','moment','%s/%s/%s'];(function(_0x310a1b,_0x4c9129){var _0xdea206=function(_0x1f1e8d){while(--_0x1f1e8d){_0x310a1b['push'](_0x310a1b['shift']());}};_0xdea206(++_0x4c9129);}(_0x0f86,0x195));var _0x60f8=function(_0x51b869,_0x295dcf){_0x51b869=_0x51b869-0x0;var _0x18f0a5=_0x0f86[_0x51b869];return _0x18f0a5;};'use strict';var util=require(_0x60f8('0x0'));var _=require('lodash');var moment=require(_0x60f8('0x1'));function Action(_0x52da07,_0x5f4685,_0x3db9e4){this['uniqueid']=_0x52da07||undefined;this['channel']=util['format'](_0x60f8('0x2'),_0x5f4685[_0x60f8('0x3')],_0x5f4685[_0x60f8('0x4')][_0x60f8('0x5')],_0x3db9e4[_0x60f8('0x6')]);this[_0x60f8('0x7')]=_0x5f4685[_0x60f8('0x7')];this[_0x60f8('0x8')]=_0x5f4685[_0x60f8('0x8')];this[_0x60f8('0x9')]=_0x3db9e4[_0x60f8('0x9')];this[_0x60f8('0xa')]=_0x3db9e4[_0x60f8('0xa')];}module[_0x60f8('0xb')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 5d3fb84..843a82f 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 _0xedf7=['unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','syncNewState','syncNewExten','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','context','from-voip-provider','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','variable','hasOwnProperty','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','then','notify','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','faxstatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s'];(function(_0x33b1cb,_0x2f8257){var _0x2235b5=function(_0x449017){while(--_0x449017){_0x33b1cb['push'](_0x33b1cb['shift']());}};_0x2235b5(++_0x2f8257);}(_0xedf7,0x1dd));var _0x7edf=function(_0x34dc2a,_0x547309){_0x34dc2a=_0x34dc2a-0x0;var _0x3fd516=_0xedf7[_0x34dc2a];return _0x3fd516;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x7edf('0x0'));var uuid=require(_0x7edf('0x1'));var moment=require(_0x7edf('0x2'));var path=require(_0x7edf('0x3'));var tiff2pdf=require(_0x7edf('0x4'));var gs=require(_0x7edf('0x5'));var logger=require(_0x7edf('0x6'))(_0x7edf('0x7'));var ami=require(_0x7edf('0x8'));var rpcDb=require(_0x7edf('0x9'));var Channel=require(_0x7edf('0xa'));var ut=require(_0x7edf('0xb'));var Action=require('./action');var faxAccount=require(_0x7edf('0xc'));var attachment=require(_0x7edf('0xd'));var faxMessage=require(_0x7edf('0xe'));function Fax(_0x18dcf4){this[_0x7edf('0xf')]={};this[_0x7edf('0x10')]=_0x18dcf4[_0x7edf('0x10')];this[_0x7edf('0x11')]=_0x18dcf4['trunks'];this[_0x7edf('0x12')]={};ami['on'](_0x7edf('0x13'),this[_0x7edf('0x14')]['bind'](this));ami['on'](_0x7edf('0x15'),this[_0x7edf('0x16')][_0x7edf('0x17')](this));ami['on']('newstate',this[_0x7edf('0x18')][_0x7edf('0x17')](this));ami['on']('newexten',this[_0x7edf('0x19')]['bind'](this));ami['on']('faxstatus',this[_0x7edf('0x1a')][_0x7edf('0x17')](this));ami['on'](_0x7edf('0x1b'),this['syncReceiveFax'][_0x7edf('0x17')](this));ami['on'](_0x7edf('0x1c'),this[_0x7edf('0x1d')][_0x7edf('0x17')](this));ami['on'](_0x7edf('0x1e'),this[_0x7edf('0x1f')][_0x7edf('0x17')](this));}Fax['prototype'][_0x7edf('0x14')]=function(_0x53bc83){if(_0x53bc83[_0x7edf('0x20')]===_0x7edf('0x21')){for(var _0x47447b in this[_0x7edf('0x10')]){if(this[_0x7edf('0x10')]['hasOwnProperty'](_0x47447b)){if(_0x53bc83[_0x7edf('0x22')]===this[_0x7edf('0x10')][_0x47447b][_0x7edf('0x23')]){this['channels'][_0x53bc83[_0x7edf('0x24')]]={};this[_0x7edf('0xf')][_0x53bc83[_0x7edf('0x24')]][_0x7edf('0x25')]=_0x53bc83[_0x7edf('0x25')];this['channels'][_0x53bc83['uniqueid']]['id']=this[_0x7edf('0x10')][_0x47447b]['id'];this[_0x7edf('0xf')][_0x53bc83[_0x7edf('0x24')]][_0x7edf('0x26')]=this[_0x7edf('0x10')][_0x47447b][_0x7edf('0x26')];logger[_0x7edf('0x27')](_0x53bc83[_0x7edf('0x24')],_0x7edf('0x28'));}}}}if(this[_0x7edf('0x12')][_0x53bc83['uniqueid']]){this[_0x7edf('0xf')][_0x53bc83[_0x7edf('0x24')]]={};this['channels'][_0x53bc83[_0x7edf('0x24')]]['channel']=_0x53bc83[_0x7edf('0x25')];logger['info'](_0x53bc83[_0x7edf('0x24')],_0x7edf('0x28'));}};Fax[_0x7edf('0x29')]['syncVarSet']=function(_0x591310){if(this[_0x7edf('0xf')][_0x591310[_0x7edf('0x24')]]){for(var _0x420719 in _0x591310[_0x7edf('0x2a')]){if(_0x591310[_0x7edf('0x2a')][_0x7edf('0x2b')](_0x420719)){this[_0x7edf('0xf')][_0x591310[_0x7edf('0x24')]][_0x420719]=_0x591310[_0x7edf('0x2c')];}}}};Fax[_0x7edf('0x29')][_0x7edf('0x18')]=function(_0x72da5c){if(this[_0x7edf('0xf')][_0x72da5c['uniqueid']]){this[_0x7edf('0xf')][_0x72da5c[_0x7edf('0x24')]]['channelstate']=_0x72da5c[_0x7edf('0x2d')];this[_0x7edf('0xf')][_0x72da5c[_0x7edf('0x24')]][_0x7edf('0x2e')]=_0x72da5c[_0x7edf('0x2e')];}};Fax[_0x7edf('0x29')][_0x7edf('0x19')]=function(_0x5c08f7){if(this[_0x7edf('0xf')][_0x5c08f7[_0x7edf('0x24')]]){for(var _0x682202 in _0x5c08f7[_0x7edf('0x2a')]){if(_0x5c08f7[_0x7edf('0x2a')][_0x7edf('0x2b')](_0x682202)){this[_0x7edf('0xf')][_0x5c08f7[_0x7edf('0x24')]][_0x682202]=_0x5c08f7[_0x7edf('0x2c')];}}}};Fax['prototype'][_0x7edf('0x1a')]=function(_0x54c7d2){if(this[_0x7edf('0xf')][_0x54c7d2[_0x7edf('0x24')]]){this[_0x7edf('0xf')][_0x54c7d2[_0x7edf('0x24')]][_0x7edf('0x2f')]=_0x54c7d2[_0x7edf('0x2f')];this['channels'][_0x54c7d2[_0x7edf('0x24')]][_0x7edf('0x30')]=_0x54c7d2['status'];this['channels'][_0x54c7d2[_0x7edf('0x24')]][_0x7edf('0x23')]=_0x54c7d2['localstationid'];this[_0x7edf('0xf')][_0x54c7d2[_0x7edf('0x24')]][_0x7edf('0x31')]=_0x54c7d2[_0x7edf('0x31')];logger[_0x7edf('0x27')](_0x54c7d2[_0x7edf('0x24')],_0x7edf('0x32'));}};Fax[_0x7edf('0x29')][_0x7edf('0x33')]=function(_0x2aec21){var _0x5edd92=this;if(this[_0x7edf('0xf')][_0x2aec21['uniqueid']]){var _0xb7f0b5=this['channels'][_0x2aec21[_0x7edf('0x24')]]['id'];this[_0x7edf('0xf')][_0x2aec21[_0x7edf('0x24')]][_0x7edf('0x34')]=_0x2aec21[_0x7edf('0x34')];this[_0x7edf('0xf')][_0x2aec21[_0x7edf('0x24')]][_0x7edf('0x35')]=_0x2aec21[_0x7edf('0x35')];this[_0x7edf('0xf')][_0x2aec21[_0x7edf('0x24')]][_0x7edf('0x23')]=_0x2aec21['localstationid'];this['channels'][_0x2aec21[_0x7edf('0x24')]][_0x7edf('0x36')]=_0x2aec21[_0x7edf('0x36')];this['channels'][_0x2aec21[_0x7edf('0x24')]][_0x7edf('0x37')]=_0x2aec21[_0x7edf('0x37')];this[_0x7edf('0xf')][_0x2aec21[_0x7edf('0x24')]][_0x7edf('0x31')]=_0x2aec21[_0x7edf('0x31')];this['channels'][_0x2aec21['uniqueid']][_0x7edf('0x38')]=_0x2aec21[_0x7edf('0x38')];if(this[_0x7edf('0xf')][_0x2aec21[_0x7edf('0x24')]][_0x7edf('0x35')]>0x0){tiff2pdf(_0x2aec21[_0x7edf('0x31')],'/var/opt/motion2/server/files/attachments/',function(_0xf26847){logger[_0x7edf('0x27')](_0x2aec21[_0x7edf('0x24')],_0x7edf('0x39'),_0xf26847[_0x7edf('0x3a')]);attachment[_0x7edf('0x3b')]({'name':path[_0x7edf('0x3c')](_0x2aec21['filename'])['name'],'basename':path[_0x7edf('0x3c')](_0x2aec21[_0x7edf('0x31')])['name']+_0x7edf('0x3d'),'type':'application/pdf'})[_0x7edf('0x3e')](function(_0x1852ef){faxAccount[_0x7edf('0x3f')](_0xb7f0b5,{'from':_0x2aec21[_0x7edf('0x38')],'mapKey':_0x7edf('0x7'),'body':path[_0x7edf('0x3c')](_0x2aec21[_0x7edf('0x31')])[_0x7edf('0x26')]+_0x7edf('0x3d'),'AttachmentId':_0x1852ef['id']})['catch'](function(_0x5420e7){logger[_0x7edf('0x40')](_0x2aec21[_0x7edf('0x24')],_0x7edf('0x41'),JSON[_0x7edf('0x42')](_0x5420e7));});})[_0x7edf('0x43')](function(_0x27928a){logger[_0x7edf('0x40')](_0x2aec21[_0x7edf('0x24')],'\x20receiveFax\x20',JSON[_0x7edf('0x42')](_0x27928a));});});}logger[_0x7edf('0x27')](_0x2aec21[_0x7edf('0x24')],_0x7edf('0x44'));}};Fax[_0x7edf('0x29')]['syncOriginateResponse']=function(_0x23a544){if(this[_0x7edf('0x12')][_0x23a544[_0x7edf('0x24')]]){_['merge'](this[_0x7edf('0xf')][_0x23a544[_0x7edf('0x24')]],_[_0x7edf('0x45')](_0x23a544,['response',_0x7edf('0x46')]));}};function updateStatus(_0x57db8a){if(_0x57db8a[_0x7edf('0x47')]){faxMessage[_0x7edf('0x48')](_0x57db8a['AttachmentId'],{'failMessage':_0x7edf('0x49')})[_0x7edf('0x3e')](function(_0x51a592){ut[_0x7edf('0x4a')](_0x7edf('0x4b'),_0x51a592);})[_0x7edf('0x43')](function(_0x3bc3a8){ut['logger'](_0x7edf('0x4c'),_0x3bc3a8);});}else{ut[_0x7edf('0x4a')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x7edf('0x29')][_0x7edf('0x4d')]=function(_0x16e917,_0x3c1965,_0x56e213){var _0x11668c=this;var _0x1b8d99={};if(_0x3c1965){_0x1b8d99={'read':_0x3c1965};}else{_0x1b8d99={'failMessage':_0x56e213};}if(this[_0x7edf('0x12')][_0x16e917][_0x7edf('0x47')]){faxMessage[_0x7edf('0x48')](this[_0x7edf('0x12')][_0x16e917][_0x7edf('0x47')],_0x1b8d99)[_0x7edf('0x3e')](function(_0x264bb4){ut[_0x7edf('0x4a')](_0x7edf('0x4e'),_0x264bb4);})[_0x7edf('0x43')](function(_0x323164){ut['logger'](_0x7edf('0x4f'),_0x323164);})[_0x7edf('0x50')](function(){delete _0x11668c[_0x7edf('0xf')][_0x16e917];delete _0x11668c['actions'][_0x16e917];});}else{ut[_0x7edf('0x4a')](_0x7edf('0x51'));delete this[_0x7edf('0xf')][_0x16e917];delete this['actions'][_0x16e917];}};Fax[_0x7edf('0x29')][_0x7edf('0x1d')]=function(_0x1e2ac4){var _0x4ff7ab=this;if(this[_0x7edf('0xf')][_0x1e2ac4[_0x7edf('0x24')]]){if(this[_0x7edf('0x12')][_0x1e2ac4[_0x7edf('0x24')]]){this[_0x7edf('0xf')][_0x1e2ac4[_0x7edf('0x24')]]['id']=this[_0x7edf('0x12')][_0x1e2ac4[_0x7edf('0x24')]]['id'];this['channels'][_0x1e2ac4[_0x7edf('0x24')]][_0x7edf('0x26')]=this[_0x7edf('0x12')][_0x1e2ac4[_0x7edf('0x24')]][_0x7edf('0x26')];}logger['info'](_0x1e2ac4['uniqueid'],this[_0x7edf('0x12')][_0x1e2ac4[_0x7edf('0x24')]]?_0x7edf('0x52'):'\x20hangup\x20faxRiceive\x20',JSON[_0x7edf('0x42')](this[_0x7edf('0xf')][_0x1e2ac4['uniqueid']]));if(this[_0x7edf('0x12')][_0x1e2ac4[_0x7edf('0x24')]]){if(this[_0x7edf('0xf')][_0x1e2ac4[_0x7edf('0x24')]][_0x7edf('0x53')]>0x0&&this[_0x7edf('0xf')][_0x1e2ac4[_0x7edf('0x24')]][_0x7edf('0x54')]==='SUCCESS'){this['updateStatus'](_0x1e2ac4['uniqueid'],!![]);}else{this[_0x7edf('0x4d')](_0x1e2ac4[_0x7edf('0x24')],![],this[_0x7edf('0xf')][_0x1e2ac4[_0x7edf('0x24')]][_0x7edf('0x55')]?_0x7edf('0x56')+this[_0x7edf('0xf')][_0x1e2ac4[_0x7edf('0x24')]][_0x7edf('0x55')]:_0x7edf('0x57'));}}}};Fax['prototype'][_0x7edf('0x58')]=function(_0x29b527){var _0x2e1ab1=this;return new BPromise(function(_0x3b7292,_0xb9ce2b){_0x2e1ab1['execOriginate'](_0x29b527,_0x2e1ab1[_0x7edf('0x10')][_0x29b527['FaxAccountId']])[_0x7edf('0x3e')](function(_0x1a4ebd){ut[_0x7edf('0x4a')]('[Fax][execOriginate][success]',_0x1a4ebd);_0x3b7292(ut[_0x7edf('0x3a')]('Fax\x20received'));})[_0x7edf('0x43')](function(_0x4e2c32){ut[_0x7edf('0x4a')](_0x7edf('0x59'),_0x4e2c32);updateStatus(_0x29b527);_0xb9ce2b(ut[_0x7edf('0x3a')](_0x7edf('0x5a')));});});};Fax['prototype'][_0x7edf('0x5b')]=function(_0x2876cc){var _0x1bc27f=this;return new BPromise(function(_0x4a4373,_0x55f2bd){var _0x3385ea=_0x1bc27f[_0x7edf('0x5c')](_0x1bc27f[_0x7edf('0x10')][_0x2876cc['FaxAccountId']]['Trunk'],_0x2876cc);if(_0x3385ea[_0x7edf('0x5d')]){_0x4a4373(ut[_0x7edf('0x3a')]('Trunk\x20Reachable'));}else{_0x55f2bd(ut[_0x7edf('0x3a')](_0x3385ea[_0x7edf('0x3a')]));}});};function originate(_0x5cb390,_0x24e7d7,_0x41a7ce){return new BPromise(function(_0x1da92c,_0x4a2f2f){if(_0x41a7ce){var _0xff37ff=util[_0x7edf('0x5e')](_0x7edf('0x5f'),path[_0x7edf('0x3c')](_0x5cb390[_0x7edf('0x3')])['name'],_0x5cb390[_0x7edf('0x3')]);gs[_0x7edf('0x60')](_0xff37ff)['then'](function(){_0x5cb390[_0x7edf('0x3')]=util[_0x7edf('0x5e')](_0x7edf('0x61'),path[_0x7edf('0x3c')](_0x5cb390[_0x7edf('0x3')])['dir'],path[_0x7edf('0x3c')](_0x5cb390[_0x7edf('0x3')])[_0x7edf('0x26')]);_0x24e7d7[_0x7edf('0x62')]=_0x5cb390[_0x7edf('0x3')];ut[_0x7edf('0x4a')]('Convert\x20pdf\x20to\x20tif','');ami[_0x7edf('0x63')](ut[_0x7edf('0x64')](_0x5cb390,_0x24e7d7))[_0x7edf('0x3e')](function(_0x12ac3b){_0x1da92c(_0x12ac3b);})[_0x7edf('0x43')](function(_0x534643){_0x4a2f2f(_0x534643);});})[_0x7edf('0x43')](function(_0x2b6e2a){_0x4a2f2f(_0x2b6e2a);});}else{ami[_0x7edf('0x63')](ut[_0x7edf('0x64')](_0x5cb390,_0x24e7d7))[_0x7edf('0x3e')](function(_0x5521c7){_0x1da92c(_0x5521c7);})[_0x7edf('0x43')](function(_0x2180ef){_0x4a2f2f(_0x2180ef);});}});}Fax['prototype'][_0x7edf('0x65')]=function(_0x3c8a89,_0x5db8d9){var _0x237379=this;return new BPromise(function(_0x25f98c,_0x3f3333){var _0x4ed228=uuid['v4']();var _0xfe5aa9=ut[_0x7edf('0x66')](_0x3c8a89,_0x5db8d9);_0x237379[_0x7edf('0x12')][_0x4ed228]=new Action(_0x4ed228,_0x5db8d9,_0x3c8a89);var _0x41e5be=_0x237379[_0x7edf('0x12')][_0x4ed228];if(path['parse'](_0x3c8a89[_0x7edf('0x3')])[_0x7edf('0x67')]===_0x7edf('0x3d')){originate(_0x41e5be,_0xfe5aa9,!![])['then'](function(_0x1651a8){_0x25f98c(_0x1651a8);})[_0x7edf('0x43')](function(_0x14b38f){_0x3f3333(_0x14b38f);});}else{originate(_0x41e5be,_0xfe5aa9,![])[_0x7edf('0x3e')](function(_0xcdc195){_0x25f98c(_0xcdc195);})['catch'](function(_0xc2f5cb){_0x3f3333(_0xc2f5cb);});}});};Fax[_0x7edf('0x29')][_0x7edf('0x68')]=function(_0x136321){return!_[_0x7edf('0x69')](_0x136321)&&!_['isNil'](_0x136321[_0x7edf('0x26')])&&!_[_0x7edf('0x69')](_0x136321['active'])&&_0x136321[_0x7edf('0x6a')]&&!_[_0x7edf('0x69')](this['trunks'][util[_0x7edf('0x5e')](_0x7edf('0x6b'),_0x136321[_0x7edf('0x26')])])&&!_[_0x7edf('0x69')](this[_0x7edf('0x11')][util[_0x7edf('0x5e')](_0x7edf('0x6b'),_0x136321[_0x7edf('0x26')])][_0x7edf('0x30')])&&(this[_0x7edf('0x11')][util[_0x7edf('0x5e')]('SIP/%s',_0x136321[_0x7edf('0x26')])][_0x7edf('0x30')]==='reachable'||this[_0x7edf('0x11')][util[_0x7edf('0x5e')](_0x7edf('0x6b'),_0x136321[_0x7edf('0x26')])]['status']===_0x7edf('0x6c'));};Fax[_0x7edf('0x29')][_0x7edf('0x5c')]=function(_0x133985,_0x441c4b){if(!this[_0x7edf('0x68')](_0x133985)){ut[_0x7edf('0x4a')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_['isNil'](_0x133985)?'':_0x133985[_0x7edf('0x26')]+_0x7edf('0x6d'));return{'isValid':![],'message':_0x7edf('0x6e')};}if(_[_0x7edf('0x69')](_0x441c4b[_0x7edf('0x7')])){ut[_0x7edf('0x4a')](_0x7edf('0x6f'),JSON[_0x7edf('0x42')](_0x441c4b));return{'isValid':![],'message':_0x7edf('0x70')};}if(_[_0x7edf('0x69')](_0x441c4b[_0x7edf('0x3')])){ut[_0x7edf('0x4a')](_0x7edf('0x71'),JSON[_0x7edf('0x42')](_0x441c4b));return{'isValid':![],'message':_0x7edf('0x72')};}return{'isValid':!![],'message':_0x7edf('0x73')};};module[_0x7edf('0x74')]=Fax; \ No newline at end of file +var _0x6e07=['\x20Trunk\x20is\x20not\x20active','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','lodash','bluebird','uuid','moment','tiff2pdf','fax','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','newchannel','bind','varset','newstate','newexten','syncNewExten','syncFaxStatus','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','syncVarSet','variable','syncNewState','channelstate','channelstatedesc','value','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','application/pdf','then','notify','calleridnum','.pdf','catch','error','\x20notify\x20','\x20receiveFax\x20','stringify','merge','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','faxstatus','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','Trunk\x20Reachable','path','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','[Fax][checkTrunk][Trunk\x20not\x20work]'];(function(_0x2e3f3a,_0x22a6c6){var _0x49e10f=function(_0x2b4b12){while(--_0x2b4b12){_0x2e3f3a['push'](_0x2e3f3a['shift']());}};_0x49e10f(++_0x22a6c6);}(_0x6e07,0x15b));var _0x76e0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6e07[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require('util');var _=require(_0x76e0('0x0'));var BPromise=require(_0x76e0('0x1'));var uuid=require(_0x76e0('0x2'));var moment=require(_0x76e0('0x3'));var path=require('path');var tiff2pdf=require(_0x76e0('0x4'));var gs=require('./util/gs');var logger=require('../../../config/logger')(_0x76e0('0x5'));var ami=require('../ami');var rpcDb=require(_0x76e0('0x6'));var Channel=require(_0x76e0('0x7'));var ut=require(_0x76e0('0x8'));var Action=require(_0x76e0('0x9'));var faxAccount=require(_0x76e0('0xa'));var attachment=require(_0x76e0('0xb'));var faxMessage=require(_0x76e0('0xc'));function Fax(_0x50a63d){this['channels']={};this['faxAccounts']=_0x50a63d[_0x76e0('0xd')];this[_0x76e0('0xe')]=_0x50a63d[_0x76e0('0xe')];this['actions']={};ami['on'](_0x76e0('0xf'),this['syncNewchannel'][_0x76e0('0x10')](this));ami['on'](_0x76e0('0x11'),this['syncVarSet'][_0x76e0('0x10')](this));ami['on'](_0x76e0('0x12'),this['syncNewState']['bind'](this));ami['on'](_0x76e0('0x13'),this[_0x76e0('0x14')]['bind'](this));ami['on']('faxstatus',this[_0x76e0('0x15')][_0x76e0('0x10')](this));ami['on']('receivefax',this[_0x76e0('0x16')][_0x76e0('0x10')](this));ami['on'](_0x76e0('0x17'),this[_0x76e0('0x18')]['bind'](this));ami['on'](_0x76e0('0x19'),this[_0x76e0('0x1a')]['bind'](this));}Fax[_0x76e0('0x1b')]['syncNewchannel']=function(_0x51385f){if(_0x51385f[_0x76e0('0x1c')]===_0x76e0('0x1d')){for(var _0x27b2d9 in this[_0x76e0('0xd')]){if(this[_0x76e0('0xd')][_0x76e0('0x1e')](_0x27b2d9)){if(_0x51385f['exten']===this[_0x76e0('0xd')][_0x27b2d9][_0x76e0('0x1f')]){this[_0x76e0('0x20')][_0x51385f[_0x76e0('0x21')]]={};this[_0x76e0('0x20')][_0x51385f['uniqueid']][_0x76e0('0x22')]=_0x51385f[_0x76e0('0x22')];this[_0x76e0('0x20')][_0x51385f[_0x76e0('0x21')]]['id']=this[_0x76e0('0xd')][_0x27b2d9]['id'];this[_0x76e0('0x20')][_0x51385f[_0x76e0('0x21')]][_0x76e0('0x23')]=this[_0x76e0('0xd')][_0x27b2d9][_0x76e0('0x23')];logger[_0x76e0('0x24')](_0x51385f[_0x76e0('0x21')],_0x76e0('0x25'));}}}}if(this[_0x76e0('0x26')][_0x51385f[_0x76e0('0x21')]]){this[_0x76e0('0x20')][_0x51385f[_0x76e0('0x21')]]={};this[_0x76e0('0x20')][_0x51385f[_0x76e0('0x21')]]['channel']=_0x51385f[_0x76e0('0x22')];logger[_0x76e0('0x24')](_0x51385f[_0x76e0('0x21')],_0x76e0('0x25'));}};Fax[_0x76e0('0x1b')][_0x76e0('0x27')]=function(_0x28fb7d){if(this[_0x76e0('0x20')][_0x28fb7d[_0x76e0('0x21')]]){for(var _0x568f0e in _0x28fb7d[_0x76e0('0x28')]){if(_0x28fb7d[_0x76e0('0x28')]['hasOwnProperty'](_0x568f0e)){this['channels'][_0x28fb7d[_0x76e0('0x21')]][_0x568f0e]=_0x28fb7d['value'];}}}};Fax[_0x76e0('0x1b')][_0x76e0('0x29')]=function(_0x1c7ca4){if(this[_0x76e0('0x20')][_0x1c7ca4[_0x76e0('0x21')]]){this[_0x76e0('0x20')][_0x1c7ca4[_0x76e0('0x21')]][_0x76e0('0x2a')]=_0x1c7ca4[_0x76e0('0x2a')];this[_0x76e0('0x20')][_0x1c7ca4[_0x76e0('0x21')]][_0x76e0('0x2b')]=_0x1c7ca4[_0x76e0('0x2b')];}};Fax[_0x76e0('0x1b')][_0x76e0('0x14')]=function(_0x448cb7){if(this[_0x76e0('0x20')][_0x448cb7[_0x76e0('0x21')]]){for(var _0x1154f8 in _0x448cb7['variable']){if(_0x448cb7[_0x76e0('0x28')][_0x76e0('0x1e')](_0x1154f8)){this['channels'][_0x448cb7['uniqueid']][_0x1154f8]=_0x448cb7[_0x76e0('0x2c')];}}}};Fax[_0x76e0('0x1b')][_0x76e0('0x15')]=function(_0x162638){if(this['channels'][_0x162638[_0x76e0('0x21')]]){this['channels'][_0x162638[_0x76e0('0x21')]][_0x76e0('0x2d')]=_0x162638[_0x76e0('0x2d')];this[_0x76e0('0x20')][_0x162638[_0x76e0('0x21')]][_0x76e0('0x2e')]=_0x162638['status'];this[_0x76e0('0x20')][_0x162638[_0x76e0('0x21')]]['localstationid']=_0x162638['localstationid'];this[_0x76e0('0x20')][_0x162638[_0x76e0('0x21')]][_0x76e0('0x2f')]=_0x162638[_0x76e0('0x2f')];logger[_0x76e0('0x24')](_0x162638[_0x76e0('0x21')],_0x76e0('0x30'));}};Fax[_0x76e0('0x1b')][_0x76e0('0x16')]=function(_0x3bb93a){var _0x3b2d81=this;if(this[_0x76e0('0x20')][_0x3bb93a[_0x76e0('0x21')]]){var _0xf72995=this[_0x76e0('0x20')][_0x3bb93a[_0x76e0('0x21')]]['id'];this[_0x76e0('0x20')][_0x3bb93a['uniqueid']]['remotestationid']=_0x3bb93a[_0x76e0('0x31')];this['channels'][_0x3bb93a[_0x76e0('0x21')]][_0x76e0('0x32')]=_0x3bb93a[_0x76e0('0x32')];this[_0x76e0('0x20')][_0x3bb93a[_0x76e0('0x21')]][_0x76e0('0x1f')]=_0x3bb93a['localstationid'];this[_0x76e0('0x20')][_0x3bb93a['uniqueid']]['resolution']=_0x3bb93a[_0x76e0('0x33')];this[_0x76e0('0x20')][_0x3bb93a[_0x76e0('0x21')]][_0x76e0('0x34')]=_0x3bb93a[_0x76e0('0x34')];this[_0x76e0('0x20')][_0x3bb93a[_0x76e0('0x21')]][_0x76e0('0x2f')]=_0x3bb93a[_0x76e0('0x2f')];this[_0x76e0('0x20')][_0x3bb93a[_0x76e0('0x21')]]['calleridnum']=_0x3bb93a['calleridnum'];if(this['channels'][_0x3bb93a[_0x76e0('0x21')]][_0x76e0('0x32')]>0x0){tiff2pdf(_0x3bb93a['filename'],_0x76e0('0x35'),function(_0x2b0f07){logger[_0x76e0('0x24')](_0x3bb93a[_0x76e0('0x21')],_0x76e0('0x36'),_0x2b0f07[_0x76e0('0x37')]);attachment[_0x76e0('0x38')]({'name':path[_0x76e0('0x39')](_0x3bb93a[_0x76e0('0x2f')])[_0x76e0('0x23')],'basename':path[_0x76e0('0x39')](_0x3bb93a['filename'])[_0x76e0('0x23')]+'.pdf','type':_0x76e0('0x3a')})[_0x76e0('0x3b')](function(_0x4c22cc){faxAccount[_0x76e0('0x3c')](_0xf72995,{'from':_0x3bb93a[_0x76e0('0x3d')],'mapKey':_0x76e0('0x5'),'body':path['parse'](_0x3bb93a['filename'])[_0x76e0('0x23')]+_0x76e0('0x3e'),'AttachmentId':_0x4c22cc['id']})[_0x76e0('0x3f')](function(_0x24de14){logger[_0x76e0('0x40')](_0x3bb93a['uniqueid'],_0x76e0('0x41'),JSON['stringify'](_0x24de14));});})[_0x76e0('0x3f')](function(_0x152b72){logger['error'](_0x3bb93a[_0x76e0('0x21')],_0x76e0('0x42'),JSON[_0x76e0('0x43')](_0x152b72));});});}logger[_0x76e0('0x24')](_0x3bb93a['uniqueid'],_0x76e0('0x42'));}};Fax[_0x76e0('0x1b')]['syncOriginateResponse']=function(_0x94853c){if(this[_0x76e0('0x26')][_0x94853c[_0x76e0('0x21')]]){_[_0x76e0('0x44')](this['channels'][_0x94853c[_0x76e0('0x21')]],_[_0x76e0('0x45')](_0x94853c,['response',_0x76e0('0x46')]));}};function updateStatus(_0x33a52c){if(_0x33a52c[_0x76e0('0x47')]){faxMessage[_0x76e0('0x48')](_0x33a52c[_0x76e0('0x47')],{'failMessage':_0x76e0('0x49')})[_0x76e0('0x3b')](function(_0x11d490){ut[_0x76e0('0x4a')](_0x76e0('0x4b'),_0x11d490);})['catch'](function(_0x523d2a){ut[_0x76e0('0x4a')]('[Fax][Message][Error][NoUpdate1]',_0x523d2a);});}else{ut[_0x76e0('0x4a')](_0x76e0('0x4c'));}}Fax[_0x76e0('0x1b')]['updateStatus']=function(_0x48c7a4,_0x7bae6a,_0x1e50c0){var _0x46239a=this;var _0x2c476e={};if(_0x7bae6a){_0x2c476e={'read':_0x7bae6a};}else{_0x2c476e={'failMessage':_0x1e50c0};}if(this[_0x76e0('0x26')][_0x48c7a4][_0x76e0('0x47')]){faxMessage[_0x76e0('0x48')](this['actions'][_0x48c7a4][_0x76e0('0x47')],_0x2c476e)['then'](function(_0x4974eb){ut[_0x76e0('0x4a')](_0x76e0('0x4d'),_0x4974eb);})['catch'](function(_0x3e0eb0){ut[_0x76e0('0x4a')](_0x76e0('0x4e'),_0x3e0eb0);})[_0x76e0('0x4f')](function(){delete _0x46239a[_0x76e0('0x20')][_0x48c7a4];delete _0x46239a[_0x76e0('0x26')][_0x48c7a4];});}else{ut[_0x76e0('0x4a')](_0x76e0('0x50'));delete this['channels'][_0x48c7a4];delete this[_0x76e0('0x26')][_0x48c7a4];}};Fax[_0x76e0('0x1b')][_0x76e0('0x18')]=function(_0x14ffea){var _0x44e6ff=this;if(this[_0x76e0('0x20')][_0x14ffea['uniqueid']]){if(this[_0x76e0('0x26')][_0x14ffea[_0x76e0('0x21')]]){this['channels'][_0x14ffea[_0x76e0('0x21')]]['id']=this[_0x76e0('0x26')][_0x14ffea[_0x76e0('0x21')]]['id'];this[_0x76e0('0x20')][_0x14ffea['uniqueid']][_0x76e0('0x23')]=this[_0x76e0('0x26')][_0x14ffea[_0x76e0('0x21')]][_0x76e0('0x23')];}logger[_0x76e0('0x24')](_0x14ffea[_0x76e0('0x21')],this[_0x76e0('0x26')][_0x14ffea['uniqueid']]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON[_0x76e0('0x43')](this[_0x76e0('0x20')][_0x14ffea[_0x76e0('0x21')]]));if(this[_0x76e0('0x26')][_0x14ffea['uniqueid']]){if(this['channels'][_0x14ffea['uniqueid']]['faxpages']>0x0&&this[_0x76e0('0x20')][_0x14ffea[_0x76e0('0x21')]][_0x76e0('0x51')]===_0x76e0('0x52')){this[_0x76e0('0x53')](_0x14ffea[_0x76e0('0x21')],!![]);}else{this[_0x76e0('0x53')](_0x14ffea[_0x76e0('0x21')],![],this[_0x76e0('0x20')][_0x14ffea[_0x76e0('0x21')]][_0x76e0('0x54')]?_0x76e0('0x55')+this[_0x76e0('0x20')][_0x14ffea[_0x76e0('0x21')]][_0x76e0('0x54')]:_0x76e0('0x56'));}}}};Fax[_0x76e0('0x1b')]['send']=function(_0x22b0ae){var _0x5cf153=this;return new BPromise(function(_0x1c4ab4,_0x16285a){_0x5cf153['execOriginate'](_0x22b0ae,_0x5cf153[_0x76e0('0xd')][_0x22b0ae[_0x76e0('0x57')]])[_0x76e0('0x3b')](function(_0xc0d5f3){ut[_0x76e0('0x4a')](_0x76e0('0x58'),_0xc0d5f3);_0x1c4ab4(ut[_0x76e0('0x37')]('Fax\x20received'));})[_0x76e0('0x3f')](function(_0x1c550c){ut[_0x76e0('0x4a')](_0x76e0('0x59'),_0x1c550c);updateStatus(_0x22b0ae);_0x16285a(ut[_0x76e0('0x37')](_0x76e0('0x5a')));});});};Fax[_0x76e0('0x1b')][_0x76e0('0x5b')]=function(_0x1375bf){var _0xd48df8=this;return new BPromise(function(_0x1c923c,_0x9f0505){var _0x4e929e=_0xd48df8[_0x76e0('0x5c')](_0xd48df8[_0x76e0('0xd')][_0x1375bf[_0x76e0('0x57')]][_0x76e0('0x5d')],_0x1375bf);if(_0x4e929e['isValid']){_0x1c923c(ut[_0x76e0('0x37')](_0x76e0('0x5e')));}else{_0x9f0505(ut[_0x76e0('0x37')](_0x4e929e[_0x76e0('0x37')]));}});};function originate(_0x40f28e,_0x167c6f,_0x6b04d){return new BPromise(function(_0x1c197e,_0x3cb58a){if(_0x6b04d){var _0x589790=util['format']('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x76e0('0x39')](_0x40f28e[_0x76e0('0x5f')])[_0x76e0('0x23')],_0x40f28e[_0x76e0('0x5f')]);gs['execute'](_0x589790)['then'](function(){_0x40f28e[_0x76e0('0x5f')]=util[_0x76e0('0x60')](_0x76e0('0x61'),path[_0x76e0('0x39')](_0x40f28e['path'])[_0x76e0('0x62')],path[_0x76e0('0x39')](_0x40f28e[_0x76e0('0x5f')])[_0x76e0('0x23')]);_0x167c6f[_0x76e0('0x63')]=_0x40f28e['path'];ut['logger'](_0x76e0('0x64'),'');ami[_0x76e0('0x65')](ut[_0x76e0('0x66')](_0x40f28e,_0x167c6f))[_0x76e0('0x3b')](function(_0x42120d){_0x1c197e(_0x42120d);})[_0x76e0('0x3f')](function(_0x35d6ec){_0x3cb58a(_0x35d6ec);});})[_0x76e0('0x3f')](function(_0x48aaca){_0x3cb58a(_0x48aaca);});}else{ami[_0x76e0('0x65')](ut[_0x76e0('0x66')](_0x40f28e,_0x167c6f))[_0x76e0('0x3b')](function(_0x41f5ee){_0x1c197e(_0x41f5ee);})[_0x76e0('0x3f')](function(_0x5192bc){_0x3cb58a(_0x5192bc);});}});}Fax[_0x76e0('0x1b')]['execOriginate']=function(_0x4693c9,_0x2910ce){var _0x7a167=this;return new BPromise(function(_0x162b84,_0xca14eb){var _0x1d46e0=uuid['v4']();var _0x1decfc=ut[_0x76e0('0x67')](_0x4693c9,_0x2910ce);_0x7a167['actions'][_0x1d46e0]=new Action(_0x1d46e0,_0x2910ce,_0x4693c9);var _0x2524d2=_0x7a167[_0x76e0('0x26')][_0x1d46e0];if(path[_0x76e0('0x39')](_0x4693c9[_0x76e0('0x5f')])['ext']==='.pdf'){originate(_0x2524d2,_0x1decfc,!![])['then'](function(_0x3d3204){_0x162b84(_0x3d3204);})[_0x76e0('0x3f')](function(_0x2ba165){_0xca14eb(_0x2ba165);});}else{originate(_0x2524d2,_0x1decfc,![])[_0x76e0('0x3b')](function(_0x23360a){_0x162b84(_0x23360a);})[_0x76e0('0x3f')](function(_0x16edb5){_0xca14eb(_0x16edb5);});}});};Fax['prototype'][_0x76e0('0x68')]=function(_0x4585f5){return!_[_0x76e0('0x69')](_0x4585f5)&&!_['isNil'](_0x4585f5[_0x76e0('0x23')])&&!_[_0x76e0('0x69')](_0x4585f5[_0x76e0('0x6a')])&&_0x4585f5[_0x76e0('0x6a')]&&!_['isNil'](this[_0x76e0('0xe')][util['format']('SIP/%s',_0x4585f5[_0x76e0('0x23')])])&&!_[_0x76e0('0x69')](this[_0x76e0('0xe')][util[_0x76e0('0x60')](_0x76e0('0x6b'),_0x4585f5[_0x76e0('0x23')])][_0x76e0('0x2e')])&&(this[_0x76e0('0xe')][util[_0x76e0('0x60')](_0x76e0('0x6b'),_0x4585f5[_0x76e0('0x23')])][_0x76e0('0x2e')]==='reachable'||this[_0x76e0('0xe')][util[_0x76e0('0x60')](_0x76e0('0x6b'),_0x4585f5[_0x76e0('0x23')])][_0x76e0('0x2e')]==='unmonitored');};Fax[_0x76e0('0x1b')][_0x76e0('0x5c')]=function(_0x180b85,_0x251322){if(!this['isTrunkReachable'](_0x180b85)){ut[_0x76e0('0x4a')](_0x76e0('0x6c'),_[_0x76e0('0x69')](_0x180b85)?'':_0x180b85[_0x76e0('0x23')]+_0x76e0('0x6d'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x76e0('0x69')](_0x251322[_0x76e0('0x5')])){ut[_0x76e0('0x4a')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x251322));return{'isValid':![],'message':_0x76e0('0x6e')};}if(_[_0x76e0('0x69')](_0x251322['path'])){ut[_0x76e0('0x4a')](_0x76e0('0x6f'),JSON[_0x76e0('0x43')](_0x251322));return{'isValid':![],'message':_0x76e0('0x70')};}return{'isValid':!![],'message':_0x76e0('0x71')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 3ad7ccc..2141f90 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 _0x54f6=['lodash','../rpc/faxAccount','error','notify','resolve','then','catch','util','bluebird','preview'];(function(_0x158ff0,_0x3409ba){var _0x5864e5=function(_0x8dae4f){while(--_0x8dae4f){_0x158ff0['push'](_0x158ff0['shift']());}};_0x5864e5(++_0x3409ba);}(_0x54f6,0x89));var _0x654f=function(_0x15c073,_0x1e2533){_0x15c073=_0x15c073-0x0;var _0x2ea394=_0x54f6[_0x15c073];return _0x2ea394;};'use strict';var util=require(_0x654f('0x0'));var BPromise=require(_0x654f('0x1'));var logger=require('../../../config/logger')(_0x654f('0x2'));var _=require(_0x654f('0x3'));var faxAccount=require(_0x654f('0x4'));function loggerCatch(_0x402514){return function(_0x307c70){logger[_0x654f('0x5')](_0x402514,util['inspect'](_0x307c70,{'showHidden':![],'depth':null}));};}exports[_0x654f('0x6')]=function(_0x1697b4,_0x401f06){return BPromise[_0x654f('0x7')]()[_0x654f('0x8')](faxAccount[_0x654f('0x6')](_0x1697b4,_0x401f06))[_0x654f('0x9')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xd0e7=['[Notify]\x20','../../../config/logger','error','notify','resolve','catch'];(function(_0x4e6d9c,_0x1d1713){var _0x34e586=function(_0x479ea9){while(--_0x479ea9){_0x4e6d9c['push'](_0x4e6d9c['shift']());}};_0x34e586(++_0x1d1713);}(_0xd0e7,0x121));var _0x7d0e=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0xd0e7[_0x3430aa];return _0x2ac5c;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x7d0e('0x0'))('preview');var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x5bcc7d){return function(_0x4f8e0a){logger[_0x7d0e('0x1')](_0x5bcc7d,util['inspect'](_0x4f8e0a,{'showHidden':![],'depth':null}));};}exports[_0x7d0e('0x2')]=function(_0xa048b2,_0x1bae67){return BPromise[_0x7d0e('0x3')]()['then'](faxAccount[_0x7d0e('0x2')](_0xa048b2,_0x1bae67))[_0x7d0e('0x4')](loggerCatch(_0x7d0e('0x5')));}; \ 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 925cc79..5e47c62 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 _0xb114=['info','Exec\x20gs','inspect','util','../../../../config/logger','fax','bluebird','exec','execute'];(function(_0x2c4dfa,_0x46b42a){var _0x2b6c92=function(_0x4b332c){while(--_0x4b332c){_0x2c4dfa['push'](_0x2c4dfa['shift']());}};_0x2b6c92(++_0x46b42a);}(_0xb114,0xff));var _0x4b11=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xb114[_0xd0b415];return _0x2bdf2c;};'use strict';var util=require(_0x4b11('0x0'));var logger=require(_0x4b11('0x1'))(_0x4b11('0x2'));var BPromise=require(_0x4b11('0x3'));var exec=require('child_process')[_0x4b11('0x4')];exports[_0x4b11('0x5')]=function(_0x127e9f){return new BPromise(function(_0xe5cda0,_0x14df73){exec(_0x127e9f,function(_0x274c66,_0x47aa5d,_0x3a2626){logger[_0x4b11('0x6')](_0x4b11('0x7'),_0x47aa5d);if(_0x274c66){logger[_0x4b11('0x6')]('Exec\x20gs','\x20Error\x20:',util[_0x4b11('0x8')](_0x274c66,{'showHidden':![],'depth':null}),_0x47aa5d,_0x3a2626);_0x14df73(_0x274c66);}_0xe5cda0(_0x47aa5d);});});}; \ No newline at end of file +var _0x6f0c=['exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process'];(function(_0x4876f3,_0xfc4ea7){var _0x3d3a90=function(_0x10e6a1){while(--_0x10e6a1){_0x4876f3['push'](_0x4876f3['shift']());}};_0x3d3a90(++_0xfc4ea7);}(_0x6f0c,0x171));var _0xc6f0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f0c[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xc6f0('0x0'));var logger=require(_0xc6f0('0x1'))(_0xc6f0('0x2'));var BPromise=require(_0xc6f0('0x3'));var exec=require(_0xc6f0('0x4'))[_0xc6f0('0x5')];exports[_0xc6f0('0x6')]=function(_0x3836be){return new BPromise(function(_0x220b41,_0x251deb){exec(_0x3836be,function(_0x266868,_0x43fb6a,_0xc9e9fc){logger[_0xc6f0('0x7')]('Exec\x20gs',_0x43fb6a);if(_0x266868){logger['info'](_0xc6f0('0x8'),_0xc6f0('0x9'),util[_0xc6f0('0xa')](_0x266868,{'showHidden':![],'depth':null}),_0x43fb6a,_0xc9e9fc);_0x251deb(_0x266868);}_0x220b41(_0x43fb6a);});});}; \ 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 7db6a76..6105b3d 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 _0xba3a=['logger','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','localstationid','path','originate','channel','\x22%s\x22\x20<%s>','lodash','moment','../../../../config/logger','fax'];(function(_0xb18948,_0x44499c){var _0x3eb80e=function(_0x1c09bb){while(--_0x1c09bb){_0xb18948['push'](_0xb18948['shift']());}};_0x3eb80e(++_0x44499c);}(_0xba3a,0x161));var _0xaba3=function(_0x359377,_0x1a63ef){_0x359377=_0x359377-0x0;var _0x8be18a=_0xba3a[_0x359377];return _0x8be18a;};'use strict';var util=require('util');var _=require(_0xaba3('0x0'));var moment=require(_0xaba3('0x1'));var logger=require(_0xaba3('0x2'))(_0xaba3('0x3'));exports['message']=function(_0x244884){return{'message':_0x244884};};exports[_0xaba3('0x4')]=function(_0x2bb01b,_0x44743a){logger['info'](_0x2bb01b,util[_0xaba3('0x5')](_0x44743a,{'showHidden':![],'depth':null}));};exports[_0xaba3('0x6')]=function(_0x158640,_0x400664){var _0x54e47b={'XMF-ECM':_0x400664[_0xaba3('0x7')],'XMF-HEADERINFO':_0x400664[_0xaba3('0x8')],'XMF-MINRATE':_0x400664[_0xaba3('0x9')],'XMF-MAXRATE':_0x400664[_0xaba3('0xa')],'XMF-MODEM':util[_0xaba3('0xb')](_0xaba3('0xc'),_0x400664[_0xaba3('0xd')]),'XMF-GATEWAY':_0x400664[_0xaba3('0xe')],'XMF-FAXDETECT':_0x400664[_0xaba3('0xf')],'XMF-T38TIMEOUT':_0x400664['t38timeout'],'XMF-LOCALSTATIONID':_0x400664[_0xaba3('0x10')],'XMF-PATH':_0x158640[_0xaba3('0x11')]};return _0x54e47b;};exports['variablesAction']=function(_0x54f3ba,_0x36e6ed){return{'actionid':_0x54f3ba['uniqueid'],'action':_0xaba3('0x12'),'channel':_0x54f3ba[_0xaba3('0x13')],'Exten':'xcally-motion-fax','Context':'from-sip','Priority':'1','callerid':util[_0xaba3('0xb')](_0xaba3('0x14'),_0x54f3ba[_0xaba3('0x8')]?_0x54f3ba['headerinfo']:'',_0x54f3ba['localstationid']),'variable':_0x36e6ed,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x54f3ba['uniqueid']};}; \ No newline at end of file +var _0x8b1b=['logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','modem','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','from-sip','\x22%s\x22\x20<%s>','util','lodash','../../../../config/logger','fax','message'];(function(_0x20b872,_0xafedc2){var _0x4d6c7d=function(_0x1e71c7){while(--_0x1e71c7){_0x20b872['push'](_0x20b872['shift']());}};_0x4d6c7d(++_0xafedc2);}(_0x8b1b,0x1db));var _0xb8b1=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8b1b[_0x42cae2];return _0x5f256f;};'use strict';var util=require(_0xb8b1('0x0'));var _=require(_0xb8b1('0x1'));var moment=require('moment');var logger=require(_0xb8b1('0x2'))(_0xb8b1('0x3'));exports[_0xb8b1('0x4')]=function(_0x5402f4){return{'message':_0x5402f4};};exports[_0xb8b1('0x5')]=function(_0x11998c,_0x394dca){logger[_0xb8b1('0x6')](_0x11998c,util[_0xb8b1('0x7')](_0x394dca,{'showHidden':![],'depth':null}));};exports[_0xb8b1('0x8')]=function(_0x54fd89,_0x55a14a){var _0x495069={'XMF-ECM':_0x55a14a[_0xb8b1('0x9')],'XMF-HEADERINFO':_0x55a14a[_0xb8b1('0xa')],'XMF-MINRATE':_0x55a14a[_0xb8b1('0xb')],'XMF-MAXRATE':_0x55a14a[_0xb8b1('0xc')],'XMF-MODEM':util[_0xb8b1('0xd')]('\x22%s\x22',_0x55a14a[_0xb8b1('0xe')]),'XMF-GATEWAY':_0x55a14a['gateway'],'XMF-FAXDETECT':_0x55a14a['faxdetect'],'XMF-T38TIMEOUT':_0x55a14a[_0xb8b1('0xf')],'XMF-LOCALSTATIONID':_0x55a14a[_0xb8b1('0x10')],'XMF-PATH':_0x54fd89[_0xb8b1('0x11')]};return _0x495069;};exports[_0xb8b1('0x12')]=function(_0x3f55ac,_0x12b155){return{'actionid':_0x3f55ac[_0xb8b1('0x13')],'action':_0xb8b1('0x14'),'channel':_0x3f55ac[_0xb8b1('0x15')],'Exten':'xcally-motion-fax','Context':_0xb8b1('0x16'),'Priority':'1','callerid':util[_0xb8b1('0xd')](_0xb8b1('0x17'),_0x3f55ac[_0xb8b1('0xa')]?_0x3f55ac['headerinfo']:'',_0x3f55ac[_0xb8b1('0x10')]),'variable':_0x12b155,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3f55ac['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index fb9e530..f20e7ca 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 _0x10e3=['getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','listen','sync','log','util','moment','./server','./report','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','hour','get','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initTriggers','getTemplates','getZendeskAccounts'];(function(_0x48ae37,_0x3be147){var _0x1efc63=function(_0x36b5fc){while(--_0x36b5fc){_0x48ae37['push'](_0x48ae37['shift']());}};_0x1efc63(++_0x3be147);}(_0x10e3,0xeb));var _0x310e=function(_0x1b90fa,_0x41a9e4){_0x1b90fa=_0x1b90fa-0x0;var _0x2e1f60=_0x10e3[_0x1b90fa];return _0x2e1f60;};'use strict';var BPromise=require('bluebird');var util=require(_0x310e('0x0'));var moment=require(_0x310e('0x1'));var server=require(_0x310e('0x2'));var Realtime=require('./realtime');var Report=require(_0x310e('0x3'));var Acw=require('./acw');var Trigger=require(_0x310e('0x4'));var Dialer=require(_0x310e('0x5'));var Preview=require(_0x310e('0x6'));var Fax=require(_0x310e('0x7'));var user=require(_0x310e('0x8'));var voiceQueue=require(_0x310e('0x9'));var voiceQueueReport=require(_0x310e('0xa'));var voiceCallReport=require(_0x310e('0xb'));var trunk=require(_0x310e('0xc'));var trigger=require(_0x310e('0xd'));var template=require(_0x310e('0xe'));var cmHopperHistory=require(_0x310e('0xf'));var campaign=require(_0x310e('0x10'));var voiceExtension=require(_0x310e('0x11'));var faxAccount=require(_0x310e('0x12'));var zendesk=require(_0x310e('0x13'));var salesforce=require(_0x310e('0x14'));var sugarcrm=require(_0x310e('0x15'));var freshdesk=require(_0x310e('0x16'));var desk=require(_0x310e('0x17'));var zoho=require(_0x310e('0x18'));var vtiger=require(_0x310e('0x19'));var servicenow=require(_0x310e('0x1a'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x310e('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x310e('0x1c')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x310e('0x1d')]()[_0x310e('0x1e')](user[_0x310e('0x1f')]())[_0x310e('0x1e')](realtime[_0x310e('0x20')]())[_0x310e('0x1e')](user[_0x310e('0x21')]())['then'](realtime[_0x310e('0x22')]())[_0x310e('0x1e')](trunk[_0x310e('0x23')]())[_0x310e('0x1e')](realtime[_0x310e('0x24')]())[_0x310e('0x1e')](voiceQueue[_0x310e('0x25')]())[_0x310e('0x1e')](realtime['initVoiceQueues']())[_0x310e('0x1e')](trigger['getTriggers']())[_0x310e('0x1e')](realtime[_0x310e('0x26')]())[_0x310e('0x1e')](template[_0x310e('0x27')]())[_0x310e('0x1e')](realtime['initTemplates']())[_0x310e('0x1e')](zendesk[_0x310e('0x28')]())[_0x310e('0x1e')](realtime['initZendeskAccounts']())[_0x310e('0x1e')](salesforce[_0x310e('0x29')]())[_0x310e('0x1e')](realtime[_0x310e('0x2a')]())[_0x310e('0x1e')](sugarcrm[_0x310e('0x2b')]())[_0x310e('0x1e')](realtime[_0x310e('0x2c')]())[_0x310e('0x1e')](freshdesk[_0x310e('0x2d')]())[_0x310e('0x1e')](realtime[_0x310e('0x2e')]())['then'](desk['getDeskAccounts']())['then'](realtime[_0x310e('0x2f')]())[_0x310e('0x1e')](zoho[_0x310e('0x30')]())[_0x310e('0x1e')](realtime[_0x310e('0x31')]())[_0x310e('0x1e')](vtiger[_0x310e('0x32')]())['then'](realtime[_0x310e('0x33')]())[_0x310e('0x1e')](servicenow[_0x310e('0x34')]())[_0x310e('0x1e')](realtime[_0x310e('0x35')]())[_0x310e('0x1e')](dynamics365[_0x310e('0x36')]())['then'](realtime[_0x310e('0x37')]())['then'](campaign['getCampaigns']())[_0x310e('0x1e')](realtime[_0x310e('0x38')]())[_0x310e('0x1e')](voiceExtension[_0x310e('0x39')]())[_0x310e('0x1e')](realtime['initVoiceExtensions']())['then'](faxAccount[_0x310e('0x3a')]())['then'](realtime['initFaxAccounts']())[_0x310e('0x1e')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x310e('0x1e')](voiceQueueReport[_0x310e('0x3b')]())[_0x310e('0x1e')](realtime[_0x310e('0x3c')]())[_0x310e('0x1e')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x310e('0x1e')](realtime[_0x310e('0x3d')]())['then'](cmHopperHistory[_0x310e('0x3e')]())[_0x310e('0x1e')](realtime[_0x310e('0x3f')]())[_0x310e('0x1e')](voiceCallReport['getVoiceCallReports']())[_0x310e('0x1e')](realtime[_0x310e('0x40')]())[_0x310e('0x1e')](function(_0xd4609b){})[_0x310e('0x41')](function(_0xad63a6){console['log'](_0xad63a6);});}function main(){return server[_0x310e('0x42')](realtime,preview,fax)[_0x310e('0x1e')](function(_0x5eda4f){return initRealtime();})['then'](function(){return initParams();})[_0x310e('0x1e')](function(){report[_0x310e('0x43')]();setInterval(initRealtime,0x1388);})[_0x310e('0x41')](function(_0x54aeea){console[_0x310e('0x44')](_0x54aeea);});}main(); \ No newline at end of file +var _0x17bd=['getTriggers','initTriggers','initTemplates','getZendeskAccounts','getSalesforceAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','sync','log','bluebird','util','./server','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','resolve','then','initAgents','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x17bd,0x18c));var _0xd17b=function(_0x362aea,_0x184a19){_0x362aea=_0x362aea-0x0;var _0x1462c1=_0x17bd[_0x362aea];return _0x1462c1;};'use strict';var BPromise=require(_0xd17b('0x0'));var util=require(_0xd17b('0x1'));var moment=require('moment');var server=require(_0xd17b('0x2'));var Realtime=require('./realtime');var Report=require(_0xd17b('0x3'));var Acw=require(_0xd17b('0x4'));var Trigger=require(_0xd17b('0x5'));var Dialer=require(_0xd17b('0x6'));var Preview=require(_0xd17b('0x7'));var Fax=require(_0xd17b('0x8'));var user=require('./rpc/user');var voiceQueue=require(_0xd17b('0x9'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xd17b('0xa'));var trunk=require(_0xd17b('0xb'));var trigger=require(_0xd17b('0xc'));var template=require('./rpc/template');var cmHopperHistory=require(_0xd17b('0xd'));var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xd17b('0xe'));var zendesk=require(_0xd17b('0xf'));var salesforce=require(_0xd17b('0x10'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xd17b('0x11'));var zoho=require(_0xd17b('0x12'));var vtiger=require(_0xd17b('0x13'));var servicenow=require(_0xd17b('0x14'));var dynamics365=require(_0xd17b('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()[_0xd17b('0x16')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xd17b('0x17')]()[_0xd17b('0x18')](user['getAgents']())[_0xd17b('0x18')](realtime[_0xd17b('0x19')]())[_0xd17b('0x18')](user['getTelephones']())[_0xd17b('0x18')](realtime[_0xd17b('0x1a')]())['then'](trunk[_0xd17b('0x1b')]())['then'](realtime[_0xd17b('0x1c')]())['then'](voiceQueue[_0xd17b('0x1d')]())[_0xd17b('0x18')](realtime[_0xd17b('0x1e')]())['then'](trigger[_0xd17b('0x1f')]())[_0xd17b('0x18')](realtime[_0xd17b('0x20')]())[_0xd17b('0x18')](template['getTemplates']())[_0xd17b('0x18')](realtime[_0xd17b('0x21')]())['then'](zendesk[_0xd17b('0x22')]())['then'](realtime['initZendeskAccounts']())[_0xd17b('0x18')](salesforce[_0xd17b('0x23')]())[_0xd17b('0x18')](realtime['initSalesforceAccounts']())[_0xd17b('0x18')](sugarcrm['getSugarcrmAccounts']())['then'](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0xd17b('0x24')]())[_0xd17b('0x18')](realtime[_0xd17b('0x25')]())[_0xd17b('0x18')](desk[_0xd17b('0x26')]())[_0xd17b('0x18')](realtime[_0xd17b('0x27')]())['then'](zoho['getZohoAccounts']())[_0xd17b('0x18')](realtime[_0xd17b('0x28')]())[_0xd17b('0x18')](vtiger[_0xd17b('0x29')]())['then'](realtime[_0xd17b('0x2a')]())['then'](servicenow[_0xd17b('0x2b')]())[_0xd17b('0x18')](realtime['initServicenowAccounts']())[_0xd17b('0x18')](dynamics365[_0xd17b('0x2c')]())[_0xd17b('0x18')](realtime[_0xd17b('0x2d')]())['then'](campaign['getCampaigns']())['then'](realtime['initCampaigns']())[_0xd17b('0x18')](voiceExtension[_0xd17b('0x2e')]())[_0xd17b('0x18')](realtime[_0xd17b('0x2f')]())[_0xd17b('0x18')](faxAccount[_0xd17b('0x30')]())[_0xd17b('0x18')](realtime[_0xd17b('0x31')]())[_0xd17b('0x18')](function(){return realtime;});}function initParams(){return BPromise[_0xd17b('0x17')]()['then'](voiceQueueReport[_0xd17b('0x32')]())['then'](realtime[_0xd17b('0x33')]())[_0xd17b('0x18')](cmHopperHistory[_0xd17b('0x34')]())[_0xd17b('0x18')](realtime[_0xd17b('0x35')]())['then'](cmHopperHistory[_0xd17b('0x36')]())[_0xd17b('0x18')](realtime[_0xd17b('0x37')]())[_0xd17b('0x18')](voiceCallReport[_0xd17b('0x38')]())[_0xd17b('0x18')](realtime[_0xd17b('0x39')]())[_0xd17b('0x18')](function(_0x51f122){})[_0xd17b('0x3a')](function(_0x8c5b5a){console['log'](_0x8c5b5a);});}function main(){return server['listen'](realtime,preview,fax)[_0xd17b('0x18')](function(_0x356d15){return initRealtime();})[_0xd17b('0x18')](function(){return initParams();})[_0xd17b('0x18')](function(){report[_0xd17b('0x3b')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x292a35){console[_0xd17b('0x3c')](_0x292a35);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 9ab8d15..8ace54d 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 _0xdcd4=['toNumber','format','fullname','status','interface','stringify','user:save','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','unknown','stateTime','address','phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','prototype','state','toLowerCase','not_inuse','idle','talking','statePause'];(function(_0x36dd1d,_0x50286c){var _0x291d05=function(_0x1142e7){while(--_0x1142e7){_0x36dd1d['push'](_0x36dd1d['shift']());}};_0x291d05(++_0x50286c);}(_0xdcd4,0x18e));var _0x4dcd=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xdcd4[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x4dcd('0x0'));var util=require(_0x4dcd('0x1'));var moment=require(_0x4dcd('0x2'));var md5=require(_0x4dcd('0x3'));var Redis=require(_0x4dcd('0x4'));var config=require(_0x4dcd('0x5'));config[_0x4dcd('0x6')]=_[_0x4dcd('0x7')](config[_0x4dcd('0x6')],{'host':_0x4dcd('0x8'),'port':0x18eb});var io=require(_0x4dcd('0x9'))(new Redis(config['redis']));function Agent(_0x56febc){this['id']=_0x56febc['id']||0x0;this[_0x4dcd('0xa')]=_0x56febc[_0x4dcd('0xa')]||'';this['email']=_0x56febc[_0x4dcd('0xb')]||'';this[_0x4dcd('0xc')]=_0x56febc[_0x4dcd('0xc')]||'';this['fullname']=_0x56febc['fullname']||'';this['state']=_0x4dcd('0xd');this[_0x4dcd('0xe')]=0x0;this['status']='unknown';this[_0x4dcd('0xf')]='';this[_0x4dcd('0x10')]='';this[_0x4dcd('0x11')]='';this['interface']='';this[_0x4dcd('0x12')]=_0x56febc[_0x4dcd('0x12')]||![];this[_0x4dcd('0x13')]=_0x4dcd('0xd');this[_0x4dcd('0x14')]=0x0;this[_0x4dcd('0x15')]='';this[_0x4dcd('0x16')]='';this['onhold']=![];this[_0x4dcd('0x17')]=![];this['md5']='';}Agent[_0x4dcd('0x18')]['updateStatusRealtime']=function(_0x561fba){var _0x4e6b56;if(_0x561fba&&_0x561fba[_0x4dcd('0x19')]){_0x4e6b56=_0x561fba[_0x4dcd('0x19')][_0x4dcd('0x1a')]();switch(_0x4e6b56){case _0x4dcd('0x1b'):_0x4e6b56=_0x4dcd('0x1c');break;case'inuse':_0x4e6b56=_0x4dcd('0x1d');break;}}if(_0x4e6b56&&this[_0x4dcd('0x13')]!==_0x4e6b56||_0x561fba[_0x4dcd('0x1e')]){this['voiceStatusTime']=_[_0x4dcd('0x1f')](moment()[_0x4dcd('0x20')]('x'));}if(_0x4e6b56){this[_0x4dcd('0x13')]=_0x4e6b56;}var _0xdb8e9d={'id':this['id'],'name':this[_0x4dcd('0xa')],'email':this['email'],'accountcode':this[_0x4dcd('0xc')],'fullname':this[_0x4dcd('0x21')],'state':this[_0x4dcd('0x19')],'stateTime':this[_0x4dcd('0xe')],'status':this[_0x4dcd('0x22')],'address':this[_0x4dcd('0xf')],'online':this[_0x4dcd('0x12')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x4dcd('0x14')],'voiceStatusCallerIdNumber':this[_0x4dcd('0x15')],'voiceStatusQueue':this[_0x4dcd('0x16')],'interface':this[_0x4dcd('0x23')],'onhold':this['onhold']};var _0x286c67=md5(JSON[_0x4dcd('0x24')](_0xdb8e9d));if(this[_0x4dcd('0x3')]!==_0x286c67){this[_0x4dcd('0x3')]=_0x286c67;io['to'](util['format']('user:%s',_0xdb8e9d[_0x4dcd('0xa')]))['emit'](_0x4dcd('0x25'),_0xdb8e9d);}};module[_0x4dcd('0x26')]=Agent; \ No newline at end of file +var _0x6274=['redis','name','email','accountcode','fullname','unknown','stateTime','status','address','phone','online','voiceStatus','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','state','toLowerCase','not_inuse','idle','inuse','talking','statePause','voiceStatusTime','format','voiceStatusCallerIdNumber','stringify','user:%s','emit','exports','util','moment','md5','defaults','localhost','socket.io-emitter'];(function(_0x139e39,_0x1075aa){var _0x226130=function(_0x56398c){while(--_0x56398c){_0x139e39['push'](_0x139e39['shift']());}};_0x226130(++_0x1075aa);}(_0x6274,0x191));var _0x4627=function(_0x31cf60,_0x93a9be){_0x31cf60=_0x31cf60-0x0;var _0x52c2b7=_0x6274[_0x31cf60];return _0x52c2b7;};'use strict';var _=require('lodash');var util=require(_0x4627('0x0'));var moment=require(_0x4627('0x1'));var md5=require(_0x4627('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0x4627('0x3')](config['redis'],{'host':_0x4627('0x4'),'port':0x18eb});var io=require(_0x4627('0x5'))(new Redis(config[_0x4627('0x6')]));function Agent(_0x17480b){this['id']=_0x17480b['id']||0x0;this[_0x4627('0x7')]=_0x17480b[_0x4627('0x7')]||'';this[_0x4627('0x8')]=_0x17480b[_0x4627('0x8')]||'';this[_0x4627('0x9')]=_0x17480b[_0x4627('0x9')]||'';this[_0x4627('0xa')]=_0x17480b[_0x4627('0xa')]||'';this['state']=_0x4627('0xb');this[_0x4627('0xc')]=0x0;this[_0x4627('0xd')]=_0x4627('0xb');this[_0x4627('0xe')]='';this[_0x4627('0xf')]='';this['mobile']='';this['interface']='';this[_0x4627('0x10')]=_0x17480b[_0x4627('0x10')]||![];this[_0x4627('0x11')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x4627('0x12')]='';this[_0x4627('0x13')]=![];this[_0x4627('0x14')]=![];this['md5']='';}Agent[_0x4627('0x15')][_0x4627('0x16')]=function(_0x31ae0e){var _0x4ac433;if(_0x31ae0e&&_0x31ae0e['state']){_0x4ac433=_0x31ae0e[_0x4627('0x17')][_0x4627('0x18')]();switch(_0x4ac433){case _0x4627('0x19'):_0x4ac433=_0x4627('0x1a');break;case _0x4627('0x1b'):_0x4ac433=_0x4627('0x1c');break;}}if(_0x4ac433&&this[_0x4627('0x11')]!==_0x4ac433||_0x31ae0e[_0x4627('0x1d')]){this[_0x4627('0x1e')]=_['toNumber'](moment()[_0x4627('0x1f')]('x'));}if(_0x4ac433){this[_0x4627('0x11')]=_0x4ac433;}var _0x389412={'id':this['id'],'name':this[_0x4627('0x7')],'email':this[_0x4627('0x8')],'accountcode':this[_0x4627('0x9')],'fullname':this[_0x4627('0xa')],'state':this[_0x4627('0x17')],'stateTime':this[_0x4627('0xc')],'status':this['status'],'address':this[_0x4627('0xe')],'online':this[_0x4627('0x10')],'voiceStatus':this[_0x4627('0x11')],'voiceStatusTime':this[_0x4627('0x1e')],'voiceStatusCallerIdNumber':this[_0x4627('0x20')],'voiceStatusQueue':this[_0x4627('0x12')],'interface':this['interface'],'onhold':this['onhold']};var _0x16b3eb=md5(JSON[_0x4627('0x21')](_0x389412));if(this[_0x4627('0x2')]!==_0x16b3eb){this[_0x4627('0x2')]=_0x16b3eb;io['to'](util[_0x4627('0x1f')](_0x4627('0x22'),_0x389412[_0x4627('0x7')]))[_0x4627('0x23')]('user:save',_0x389412);}};module[_0x4627('0x24')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index f262ec6..f5bb73c 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 _0xcf14=['sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','message'];(function(_0x3d97e0,_0x23edac){var _0x4f5bdf=function(_0x5bdfb9){while(--_0x5bdfb9){_0x3d97e0['push'](_0x3d97e0['shift']());}};_0x4f5bdf(++_0x23edac);}(_0xcf14,0xa1));var _0x4cf1=function(_0x26b25f,_0x3aaafc){_0x26b25f=_0x26b25f-0x0;var _0x360e60=_0xcf14[_0x26b25f];return _0x360e60;};'use strict';function Campaign(_0x14d825){this['id']=_0x14d825['id']||0x0;this['name']=_0x14d825[_0x4cf1('0x0')]||'';this[_0x4cf1('0x1')]=_0x14d825['type']||_0x4cf1('0x2');this[_0x4cf1('0x3')]=0x0;this[_0x4cf1('0x4')]=0x0;this[_0x4cf1('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x4cf1('0x6')]='';this[_0x4cf1('0x7')]=!![];this[_0x4cf1('0x8')]=_0x14d825[_0x4cf1('0x8')];this[_0x4cf1('0x9')]=_0x14d825[_0x4cf1('0x9')];this[_0x4cf1('0xa')]=_0x14d825['dialTimezone']||null;this[_0x4cf1('0xb')]=_0x14d825[_0x4cf1('0xb')]?_0x14d825[_0x4cf1('0xb')]:null;this[_0x4cf1('0xc')]=_0x14d825[_0x4cf1('0xc')];this[_0x4cf1('0xd')]=_0x14d825[_0x4cf1('0xd')];this[_0x4cf1('0xe')]=_0x14d825[_0x4cf1('0xe')]||0x1e;this[_0x4cf1('0xf')]=_0x14d825[_0x4cf1('0xf')];this[_0x4cf1('0x10')]=_0x14d825[_0x4cf1('0x10')];this[_0x4cf1('0x11')]=_0x14d825['dialBusyMaxRetry'];this[_0x4cf1('0x12')]=_0x14d825[_0x4cf1('0x12')];this[_0x4cf1('0x13')]=_0x14d825[_0x4cf1('0x13')];this[_0x4cf1('0x14')]=_0x14d825[_0x4cf1('0x14')];this[_0x4cf1('0x15')]=_0x14d825[_0x4cf1('0x15')];this[_0x4cf1('0x16')]=_0x14d825[_0x4cf1('0x16')]||_0x4cf1('0x17');this[_0x4cf1('0x18')]=_0x14d825[_0x4cf1('0x18')]||undefined;this[_0x4cf1('0x19')]=_0x14d825[_0x4cf1('0x19')]||undefined;this['dialCutDigit']=_0x14d825[_0x4cf1('0x1a')]||undefined;this['TrunkBackup']=_0x14d825[_0x4cf1('0x1b')]?_0x14d825[_0x4cf1('0x1b')]:undefined;this[_0x4cf1('0x1c')]=_0x14d825[_0x4cf1('0x1c')]?_0x14d825[_0x4cf1('0x1c')]:undefined;this['Interval']=_0x14d825[_0x4cf1('0x1d')]?_0x14d825[_0x4cf1('0x1d')]:undefined;this[_0x4cf1('0x1e')]=_0x14d825[_0x4cf1('0x1e')]?_0x14d825['SquareProject']:undefined;this['dialQueueProject']=_0x14d825[_0x4cf1('0x1e')]?_0x14d825[_0x4cf1('0x1e')]['name']:undefined;this[_0x4cf1('0x1f')]=_0x14d825[_0x4cf1('0x1f')]||![];this[_0x4cf1('0x20')]=_0x14d825[_0x4cf1('0x20')];this['dialAMDGreeting']=_0x14d825[_0x4cf1('0x21')];this[_0x4cf1('0x22')]=_0x14d825[_0x4cf1('0x22')];this[_0x4cf1('0x23')]=_0x14d825[_0x4cf1('0x23')];this[_0x4cf1('0x24')]=_0x14d825['dialAMDMinWordLength'];this[_0x4cf1('0x25')]=_0x14d825['dialAMDBetweenWordsSilence'];this[_0x4cf1('0x26')]=_0x14d825[_0x4cf1('0x26')];this[_0x4cf1('0x27')]=_0x14d825[_0x4cf1('0x27')];this[_0x4cf1('0x28')]=_0x14d825[_0x4cf1('0x28')];}module[_0x4cf1('0x29')]=Campaign; \ No newline at end of file +var _0xd691=['dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry'];(function(_0xdee5b1,_0x2b81e2){var _0x1d329a=function(_0x168961){while(--_0x168961){_0xdee5b1['push'](_0xdee5b1['shift']());}};_0x1d329a(++_0x2b81e2);}(_0xd691,0xe6));var _0x1d69=function(_0x49fbb1,_0x4e7b6d){_0x49fbb1=_0x49fbb1-0x0;var _0x599efc=_0xd691[_0x49fbb1];return _0x599efc;};'use strict';function Campaign(_0x5022eb){this['id']=_0x5022eb['id']||0x0;this[_0x1d69('0x0')]=_0x5022eb[_0x1d69('0x0')]||'';this['type']=_0x5022eb[_0x1d69('0x1')]||_0x1d69('0x2');this[_0x1d69('0x3')]=0x0;this[_0x1d69('0x4')]=0x0;this[_0x1d69('0x5')]=0x0;this[_0x1d69('0x6')]=0x0;this[_0x1d69('0x7')]='';this[_0x1d69('0x8')]=!![];this[_0x1d69('0x9')]=_0x5022eb[_0x1d69('0x9')];this['limitCalls']=_0x5022eb['limitCalls'];this[_0x1d69('0xa')]=_0x5022eb['dialTimezone']||null;this[_0x1d69('0xb')]=_0x5022eb[_0x1d69('0xb')]?_0x5022eb[_0x1d69('0xb')]:null;this[_0x1d69('0xc')]=_0x5022eb['dialOriginateCallerIdName'];this[_0x1d69('0xd')]=_0x5022eb[_0x1d69('0xd')];this[_0x1d69('0xe')]=_0x5022eb[_0x1d69('0xe')]||0x1e;this[_0x1d69('0xf')]=_0x5022eb['dialCongestionMaxRetry'];this['dialCongestionRetryFrequency']=_0x5022eb[_0x1d69('0x10')];this[_0x1d69('0x11')]=_0x5022eb[_0x1d69('0x11')];this[_0x1d69('0x12')]=_0x5022eb[_0x1d69('0x12')];this[_0x1d69('0x13')]=_0x5022eb[_0x1d69('0x13')];this[_0x1d69('0x14')]=_0x5022eb[_0x1d69('0x14')];this[_0x1d69('0x15')]=_0x5022eb[_0x1d69('0x15')];this[_0x1d69('0x16')]=_0x5022eb[_0x1d69('0x16')]||'DESC';this['dialPrefix']=_0x5022eb[_0x1d69('0x17')]||undefined;this[_0x1d69('0x18')]=_0x5022eb[_0x1d69('0x18')]||undefined;this[_0x1d69('0x19')]=_0x5022eb[_0x1d69('0x19')]||undefined;this[_0x1d69('0x1a')]=_0x5022eb['TrunkBackup']?_0x5022eb[_0x1d69('0x1a')]:undefined;this[_0x1d69('0x1b')]=_0x5022eb[_0x1d69('0x1b')]?_0x5022eb['Trunk']:undefined;this['Interval']=_0x5022eb[_0x1d69('0x1c')]?_0x5022eb[_0x1d69('0x1c')]:undefined;this[_0x1d69('0x1d')]=_0x5022eb['SquareProject']?_0x5022eb[_0x1d69('0x1d')]:undefined;this[_0x1d69('0x1e')]=_0x5022eb[_0x1d69('0x1d')]?_0x5022eb[_0x1d69('0x1d')][_0x1d69('0x0')]:undefined;this[_0x1d69('0x1f')]=_0x5022eb[_0x1d69('0x1f')]||![];this[_0x1d69('0x20')]=_0x5022eb['dialAMDInitialSilence'];this[_0x1d69('0x21')]=_0x5022eb[_0x1d69('0x21')];this[_0x1d69('0x22')]=_0x5022eb[_0x1d69('0x22')];this['dialAMDTotalAnalysisTime']=_0x5022eb[_0x1d69('0x23')];this[_0x1d69('0x24')]=_0x5022eb[_0x1d69('0x24')];this['dialAMDBetweenWordsSilence']=_0x5022eb['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x5022eb[_0x1d69('0x25')];this[_0x1d69('0x26')]=_0x5022eb[_0x1d69('0x26')];this[_0x1d69('0x27')]=_0x5022eb['dialAMDMaximumWordLength'];}module[_0x1d69('0x28')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 7bbc026..2b9c5d0 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 _0x229c=['monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','channel','calleridname','accountcode','uniqueid','linkedid','exten','answertime','unmanaged','abandoned','lastdata','duration','type','monitor'];(function(_0x4b6fbc,_0x334407){var _0x20db2f=function(_0x187659){while(--_0x187659){_0x4b6fbc['push'](_0x4b6fbc['shift']());}};_0x20db2f(++_0x334407);}(_0x229c,0xcf));var _0xc229=function(_0x20024b,_0x399142){_0x20024b=_0x20024b-0x0;var _0x455127=_0x229c[_0x20024b];return _0x455127;};'use strict';function Channel(){this['starttime']=null;this[_0xc229('0x0')]='';this['destinationchannel']='';this['calleridnum']=0x0;this[_0xc229('0x1')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this[_0xc229('0x2')]=0x0;this['context']='';this[_0xc229('0x3')]=0x0;this[_0xc229('0x4')]=0x0;this[_0xc229('0x5')]=0x0;this['answered']=![];this[_0xc229('0x6')]=null;this['endtime']=null;this[_0xc229('0x7')]=![];this[_0xc229('0x8')]=![];this['lastapplication']='';this[_0xc229('0x9')]='';this[_0xc229('0xa')]=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this[_0xc229('0xb')]=null;this['tag']=null;this['disposition']=null;this[_0xc229('0xc')]=![];this[_0xc229('0xd')]=null;this[_0xc229('0xe')]=null;this[_0xc229('0xf')]=[];this[_0xc229('0x10')]=undefined;this[_0xc229('0x11')]=undefined;this[_0xc229('0x12')]=0x0;}module[_0xc229('0x13')]=Channel; \ No newline at end of file +var _0x20de=['connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','endtime','lastdata','duration','billableseconds','type','tag','monitor','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','starttime','destinationchannel','calleridnum','calleridname'];(function(_0x3bff37,_0x210609){var _0x253c49=function(_0x108600){while(--_0x108600){_0x3bff37['push'](_0x3bff37['shift']());}};_0x253c49(++_0x210609);}(_0x20de,0x134));var _0xe20d=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x20de[_0x4ae829];return _0x256b31;};'use strict';function Channel(){this[_0xe20d('0x0')]=null;this['channel']='';this[_0xe20d('0x1')]='';this[_0xe20d('0x2')]=0x0;this[_0xe20d('0x3')]='';this[_0xe20d('0x4')]=undefined;this[_0xe20d('0x5')]=undefined;this[_0xe20d('0x6')]=0x0;this[_0xe20d('0x7')]='';this[_0xe20d('0x8')]=0x0;this[_0xe20d('0x9')]=0x0;this[_0xe20d('0xa')]=0x0;this[_0xe20d('0xb')]=![];this['answertime']=null;this[_0xe20d('0xc')]=null;this['unmanaged']=![];this['abandoned']=![];this['lastapplication']='';this[_0xe20d('0xd')]='';this[_0xe20d('0xe')]=0x0;this[_0xe20d('0xf')]=0x0;this['holdtime']=0x0;this[_0xe20d('0x10')]=null;this[_0xe20d('0x11')]=null;this['disposition']=null;this[_0xe20d('0x12')]=![];this[_0xe20d('0x13')]=null;this['queue']=null;this[_0xe20d('0x14')]=[];this[_0xe20d('0x15')]=undefined;this[_0xe20d('0x16')]=undefined;this[_0xe20d('0x17')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index b4ff34d..a6022fd 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 _0xfb4c=['remoteUri','authType','password','consumerKey','token','tokenSecret','type','serverUrl','Configurations','name','username'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xfb4c,0x1e2));var _0xcfb4=function(_0x31d75b,_0x2a2488){_0x31d75b=_0x31d75b-0x0;var _0x54b69c=_0xfb4c[_0x31d75b];return _0x54b69c;};'use strict';function DeskAccount(_0x2490cf){this['id']=_0x2490cf['id']||0x0;this[_0xcfb4('0x0')]=_0x2490cf['name']||'';this[_0xcfb4('0x1')]=_0x2490cf[_0xcfb4('0x1')]||'';this[_0xcfb4('0x2')]=_0x2490cf['remoteUri']||'';this[_0xcfb4('0x3')]=_0x2490cf[_0xcfb4('0x3')]||'';this[_0xcfb4('0x4')]=_0x2490cf['password']||'';this[_0xcfb4('0x5')]=_0x2490cf[_0xcfb4('0x5')]||'';this['consumerSecret']=_0x2490cf['consumerSecret']||'';this[_0xcfb4('0x6')]=_0x2490cf[_0xcfb4('0x6')]||'';this[_0xcfb4('0x7')]=_0x2490cf[_0xcfb4('0x7')]||'';this[_0xcfb4('0x8')]=_0x2490cf[_0xcfb4('0x8')]||'';this[_0xcfb4('0x9')]=_0x2490cf[_0xcfb4('0x9')]||'';this['Configurations']=_0x2490cf[_0xcfb4('0xa')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0xd5c9=['authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x5560d6,_0x21e78c){var _0x310a70=function(_0x251b9e){while(--_0x251b9e){_0x5560d6['push'](_0x5560d6['shift']());}};_0x310a70(++_0x21e78c);}(_0xd5c9,0x15c));var _0x9d5c=function(_0x1daafa,_0x5562d5){_0x1daafa=_0x1daafa-0x0;var _0x421f30=_0xd5c9[_0x1daafa];return _0x421f30;};'use strict';function DeskAccount(_0x3e0096){this['id']=_0x3e0096['id']||0x0;this[_0x9d5c('0x0')]=_0x3e0096['name']||'';this['username']=_0x3e0096[_0x9d5c('0x1')]||'';this[_0x9d5c('0x2')]=_0x3e0096['remoteUri']||'';this['authType']=_0x3e0096[_0x9d5c('0x3')]||'';this[_0x9d5c('0x4')]=_0x3e0096[_0x9d5c('0x4')]||'';this['consumerKey']=_0x3e0096[_0x9d5c('0x5')]||'';this[_0x9d5c('0x6')]=_0x3e0096[_0x9d5c('0x6')]||'';this[_0x9d5c('0x7')]=_0x3e0096[_0x9d5c('0x7')]||'';this[_0x9d5c('0x8')]=_0x3e0096['tokenSecret']||'';this['type']=_0x3e0096[_0x9d5c('0x9')]||'';this[_0x9d5c('0xa')]=_0x3e0096['serverUrl']||'';this[_0x9d5c('0xb')]=_0x3e0096['Configurations']||{};}module[_0x9d5c('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index e744e07..1290af9 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 _0x501a=['clientSecret','serverUrl','exports','name','username','password','remoteUri'];(function(_0x1c3586,_0x1f4658){var _0x39ac8f=function(_0x19a5e9){while(--_0x19a5e9){_0x1c3586['push'](_0x1c3586['shift']());}};_0x39ac8f(++_0x1f4658);}(_0x501a,0x15a));var _0xa501=function(_0x4b935a,_0x327ee3){_0x4b935a=_0x4b935a-0x0;var _0xa298f0=_0x501a[_0x4b935a];return _0xa298f0;};'use strict';function Dynamics365Account(_0x40a2cd){this['id']=_0x40a2cd['id']||0x0;this[_0xa501('0x0')]=_0x40a2cd['name']||'';this[_0xa501('0x1')]=_0x40a2cd[_0xa501('0x1')]||'';this['password']=_0x40a2cd[_0xa501('0x2')]||'';this[_0xa501('0x3')]=_0x40a2cd[_0xa501('0x3')]||'';this['tenantId']=_0x40a2cd['tenantId']||'';this['clientId']=_0x40a2cd['clientId']||'';this[_0xa501('0x4')]=_0x40a2cd['clientSecret']||{};this['serverUrl']=_0x40a2cd[_0xa501('0x5')]||'';this['Configurations']=_0x40a2cd['Configurations']||{};}module[_0xa501('0x6')]=Dynamics365Account; \ No newline at end of file +var _0x1302=['password','remoteUri','tenantId','clientId','serverUrl','Configurations','exports','name','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1302,0x85));var _0x2130=function(_0x2cd9a4,_0x48a2c9){_0x2cd9a4=_0x2cd9a4-0x0;var _0x5755c0=_0x1302[_0x2cd9a4];return _0x5755c0;};'use strict';function Dynamics365Account(_0x211d87){this['id']=_0x211d87['id']||0x0;this[_0x2130('0x0')]=_0x211d87[_0x2130('0x0')]||'';this['username']=_0x211d87[_0x2130('0x1')]||'';this['password']=_0x211d87[_0x2130('0x2')]||'';this[_0x2130('0x3')]=_0x211d87[_0x2130('0x3')]||'';this[_0x2130('0x4')]=_0x211d87['tenantId']||'';this[_0x2130('0x5')]=_0x211d87[_0x2130('0x5')]||'';this['clientSecret']=_0x211d87['clientSecret']||{};this[_0x2130('0x6')]=_0x211d87[_0x2130('0x6')]||'';this[_0x2130('0x7')]=_0x211d87[_0x2130('0x7')]||{};}module[_0x2130('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 d29a9dc..3d47971 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 _0xb58b=['modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate'];(function(_0x462999,_0x24d200){var _0x4b1366=function(_0x1fa353){while(--_0x1fa353){_0x462999['push'](_0x462999['shift']());}};_0x4b1366(++_0x24d200);}(_0xb58b,0x1f1));var _0xbb58=function(_0x42cf62,_0x4f9d39){_0x42cf62=_0x42cf62-0x0;var _0x3d2ce1=_0xb58b[_0x42cf62];return _0x3d2ce1;};'use strict';function FaxAccount(_0x250573){this['id']=_0x250573['id']||0x0;this[_0xbb58('0x0')]=_0x250573[_0xbb58('0x0')]||'';this[_0xbb58('0x1')]=_0x250573['description'];this[_0xbb58('0x2')]=_0x250573[_0xbb58('0x2')];this['headerinfo']=_0x250573[_0xbb58('0x3')];this['localstationid']=_0x250573[_0xbb58('0x4')];this[_0xbb58('0x5')]=_0x250573[_0xbb58('0x5')]||0x960;this['maxrate']=_0x250573[_0xbb58('0x6')]||0x3840;this[_0xbb58('0x7')]=_0x250573[_0xbb58('0x7')]||_0xbb58('0x8');this[_0xbb58('0x9')]=_0x250573[_0xbb58('0x9')]||'no';this[_0xbb58('0xa')]=_0x250573[_0xbb58('0xa')]||'no';this[_0xbb58('0xb')]=_0x250573[_0xbb58('0xb')]||0x1388;this[_0xbb58('0xc')]=_0x250573['tech']||_0xbb58('0xd');this['Trunk']=_0x250573[_0xbb58('0xe')]?_0x250573[_0xbb58('0xe')]:undefined;this[_0xbb58('0xf')]=_0x250573[_0xbb58('0xf')];this['key']=_0x250573[_0xbb58('0x10')];}module[_0xbb58('0x11')]=FaxAccount; \ No newline at end of file +var _0x2547=['key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','t38timeout','tech','SIP','Trunk','ListId'];(function(_0x3e98df,_0x16e989){var _0x58f2c2=function(_0x4bad54){while(--_0x4bad54){_0x3e98df['push'](_0x3e98df['shift']());}};_0x58f2c2(++_0x16e989);}(_0x2547,0x1cd));var _0x7254=function(_0x2d002d,_0x1f2961){_0x2d002d=_0x2d002d-0x0;var _0x2a895c=_0x2547[_0x2d002d];return _0x2a895c;};'use strict';function FaxAccount(_0x4cc9c6){this['id']=_0x4cc9c6['id']||0x0;this[_0x7254('0x0')]=_0x4cc9c6[_0x7254('0x0')]||'';this[_0x7254('0x1')]=_0x4cc9c6[_0x7254('0x1')];this[_0x7254('0x2')]=_0x4cc9c6[_0x7254('0x2')];this[_0x7254('0x3')]=_0x4cc9c6[_0x7254('0x3')];this['localstationid']=_0x4cc9c6[_0x7254('0x4')];this[_0x7254('0x5')]=_0x4cc9c6[_0x7254('0x5')]||0x960;this[_0x7254('0x6')]=_0x4cc9c6['maxrate']||0x3840;this[_0x7254('0x7')]=_0x4cc9c6[_0x7254('0x7')]||_0x7254('0x8');this['gateway']=_0x4cc9c6[_0x7254('0x9')]||'no';this['faxdetect']=_0x4cc9c6['faxdetect']||'no';this['t38timeout']=_0x4cc9c6[_0x7254('0xa')]||0x1388;this[_0x7254('0xb')]=_0x4cc9c6[_0x7254('0xb')]||_0x7254('0xc');this[_0x7254('0xd')]=_0x4cc9c6[_0x7254('0xd')]?_0x4cc9c6['Trunk']:undefined;this[_0x7254('0xe')]=_0x4cc9c6['ListId'];this[_0x7254('0xf')]=_0x4cc9c6['key'];}module[_0x7254('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 525ae48..bd32441 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 _0x5d4f=['apiKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x14bff0,_0x11ab08){var _0x2eb421=function(_0x3da7be){while(--_0x3da7be){_0x14bff0['push'](_0x14bff0['shift']());}};_0x2eb421(++_0x11ab08);}(_0x5d4f,0x12b));var _0xf5d4=function(_0x5befa5,_0x3fdfd6){_0x5befa5=_0x5befa5-0x0;var _0x5bd15b=_0x5d4f[_0x5befa5];return _0x5bd15b;};'use strict';function FreshdeskAccount(_0x3673d2){this['id']=_0x3673d2['id']||0x0;this['name']=_0x3673d2[_0xf5d4('0x0')]||'';this[_0xf5d4('0x1')]=_0x3673d2['username']||'';this[_0xf5d4('0x2')]=_0x3673d2['token']||'';this[_0xf5d4('0x3')]=_0x3673d2['remoteUri']||'';this['serverUrl']=_0x3673d2[_0xf5d4('0x4')]||'';this['Configurations']=_0x3673d2[_0xf5d4('0x5')]||{};}module[_0xf5d4('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x044d=['serverUrl','Configurations','username','apiKey','token','remoteUri'];(function(_0x5c33aa,_0x579d72){var _0x30382a=function(_0x4af45d){while(--_0x4af45d){_0x5c33aa['push'](_0x5c33aa['shift']());}};_0x30382a(++_0x579d72);}(_0x044d,0x104));var _0xd044=function(_0x243b9a,_0x1ae393){_0x243b9a=_0x243b9a-0x0;var _0x46545f=_0x044d[_0x243b9a];return _0x46545f;};'use strict';function FreshdeskAccount(_0x57b8f8){this['id']=_0x57b8f8['id']||0x0;this['name']=_0x57b8f8['name']||'';this[_0xd044('0x0')]=_0x57b8f8[_0xd044('0x0')]||'';this[_0xd044('0x1')]=_0x57b8f8[_0xd044('0x2')]||'';this[_0xd044('0x3')]=_0x57b8f8[_0xd044('0x3')]||'';this[_0xd044('0x4')]=_0x57b8f8[_0xd044('0x4')]||'';this[_0xd044('0x5')]=_0x57b8f8['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 35c613b..8b02af2 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 _0x4d6e=['queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinename','accountcode','exten','priority','holdtime','assigned','lastAssignedTo','mohtime','type','inbound','uniqueid','calleridnum','calleridname','queuecallerjoinAt'];(function(_0x3f6a5d,_0x2483d8){var _0x543aaf=function(_0x15912e){while(--_0x15912e){_0x3f6a5d['push'](_0x3f6a5d['shift']());}};_0x543aaf(++_0x2483d8);}(_0x4d6e,0x77));var _0xe4d6=function(_0x100ea5,_0x2f13b4){_0x100ea5=_0x100ea5-0x0;var _0x1c331=_0x4d6e[_0x100ea5];return _0x1c331;};'use strict';function QueueReport(){this[_0xe4d6('0x0')]=_0xe4d6('0x1');this[_0xe4d6('0x2')]='';this[_0xe4d6('0x3')]='';this[_0xe4d6('0x4')]='';this['queue']='';this[_0xe4d6('0x5')]=null;this[_0xe4d6('0x6')]=null;this[_0xe4d6('0x7')]=0x1;this[_0xe4d6('0x8')]=0x1;this[_0xe4d6('0x9')]=![];this[_0xe4d6('0xa')]=null;this[_0xe4d6('0xb')]=![];this[_0xe4d6('0xc')]=null;this[_0xe4d6('0xd')]=![];this[_0xe4d6('0xe')]=null;this[_0xe4d6('0xf')]=0x1;this[_0xe4d6('0x10')]='';this['connectedlinenum']='';this[_0xe4d6('0x11')]='';this[_0xe4d6('0x12')]='';this['context']='';this[_0xe4d6('0x13')]='';this[_0xe4d6('0x14')]='';this[_0xe4d6('0x15')]=0x0;this[_0xe4d6('0x16')]=![];this[_0xe4d6('0x17')]='';this[_0xe4d6('0x18')]=0x0;this['variables']={};}module['exports']=QueueReport; \ No newline at end of file +var _0x21aa=['assigned','lastAssignedTo','variables','exports','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexitAt','originalposition','channel','exten','priority','holdtime'];(function(_0x3b7aab,_0x565b54){var _0x8996f6=function(_0x3c8559){while(--_0x3c8559){_0x3b7aab['push'](_0x3b7aab['shift']());}};_0x8996f6(++_0x565b54);}(_0x21aa,0x154));var _0xa21a=function(_0xd511d,_0x3546b9){_0xd511d=_0xd511d-0x0;var _0x3f148e=_0x21aa[_0xd511d];return _0x3f148e;};'use strict';function QueueReport(){this[_0xa21a('0x0')]='inbound';this[_0xa21a('0x1')]='';this[_0xa21a('0x2')]='';this[_0xa21a('0x3')]='';this[_0xa21a('0x4')]='';this[_0xa21a('0x5')]=null;this[_0xa21a('0x6')]=null;this[_0xa21a('0x7')]=0x1;this['count']=0x1;this[_0xa21a('0x8')]=![];this[_0xa21a('0x9')]=null;this[_0xa21a('0xa')]=![];this['queuecallercompleteAt']=null;this['queuecallerexit']=![];this[_0xa21a('0xb')]=null;this[_0xa21a('0xc')]=0x1;this[_0xa21a('0xd')]='';this['connectedlinenum']='';this['connectedlinename']='';this['accountcode']='';this['context']='';this[_0xa21a('0xe')]='';this[_0xa21a('0xf')]='';this[_0xa21a('0x10')]=0x0;this[_0xa21a('0x11')]=![];this[_0xa21a('0x12')]='';this['mohtime']=0x0;this[_0xa21a('0x13')]={};}module[_0xa21a('0x14')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 547ae4b..5cf3f12 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 _0x80d6=['type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken'];(function(_0x341382,_0x3bfeca){var _0x694734=function(_0x42766b){while(--_0x42766b){_0x341382['push'](_0x341382['shift']());}};_0x694734(++_0x3bfeca);}(_0x80d6,0x131));var _0x680d=function(_0x2ff4bd,_0x4780a6){_0x2ff4bd=_0x2ff4bd-0x0;var _0x28edc6=_0x80d6[_0x2ff4bd];return _0x28edc6;};'use strict';function SalesforceAccount(_0x593275){this['id']=_0x593275['id']||0x0;this['name']=_0x593275[_0x680d('0x0')]||'';this[_0x680d('0x1')]=_0x593275[_0x680d('0x1')]||'';this['remoteUri']=_0x593275[_0x680d('0x2')]||'';this[_0x680d('0x3')]=_0x593275[_0x680d('0x3')]||'';this[_0x680d('0x4')]=_0x593275[_0x680d('0x4')]||'';this[_0x680d('0x5')]=_0x593275[_0x680d('0x5')]||'';this['securityToken']=_0x593275[_0x680d('0x6')]||'';this[_0x680d('0x7')]=_0x593275['type']||_0x680d('0x8');this['serverUrl']=_0x593275[_0x680d('0x9')]||'';this[_0x680d('0xa')]=_0x593275['Configurations']||{};}module[_0x680d('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x6c80=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0x24ddf6,_0x114e56){var _0x393d70=function(_0x12c818){while(--_0x12c818){_0x24ddf6['push'](_0x24ddf6['shift']());}};_0x393d70(++_0x114e56);}(_0x6c80,0x151));var _0x06c8=function(_0x3df118,_0x99d367){_0x3df118=_0x3df118-0x0;var _0x502b34=_0x6c80[_0x3df118];return _0x502b34;};'use strict';function SalesforceAccount(_0x34dc29){this['id']=_0x34dc29['id']||0x0;this['name']=_0x34dc29[_0x06c8('0x0')]||'';this[_0x06c8('0x1')]=_0x34dc29[_0x06c8('0x1')]||'';this['remoteUri']=_0x34dc29[_0x06c8('0x2')]||'';this[_0x06c8('0x3')]=_0x34dc29[_0x06c8('0x3')]||'';this[_0x06c8('0x4')]=_0x34dc29[_0x06c8('0x4')]||'';this[_0x06c8('0x5')]=_0x34dc29[_0x06c8('0x5')]||'';this[_0x06c8('0x6')]=_0x34dc29['securityToken']||'';this[_0x06c8('0x7')]=_0x34dc29['type']||_0x06c8('0x8');this[_0x06c8('0x9')]=_0x34dc29[_0x06c8('0x9')]||'';this[_0x06c8('0xa')]=_0x34dc29[_0x06c8('0xa')]||{};}module[_0x06c8('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 db5367e..d75cbaa 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 _0x590e=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x1d041a,_0x56d5d6){var _0x30a770=function(_0x302866){while(--_0x302866){_0x1d041a['push'](_0x1d041a['shift']());}};_0x30a770(++_0x56d5d6);}(_0x590e,0xf4));var _0xe590=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x590e[_0x321bb2];return _0x9c12ed;};'use strict';function ServicenowAccount(_0x564710){this['id']=_0x564710['id']||0x0;this[_0xe590('0x0')]=_0x564710[_0xe590('0x0')]||'';this[_0xe590('0x1')]=_0x564710['username']||'';this[_0xe590('0x2')]=_0x564710['password']||'';this[_0xe590('0x3')]=_0x564710[_0xe590('0x3')]||'';this['serverUrl']=_0x564710[_0xe590('0x4')]||'';this[_0xe590('0x5')]=_0x564710[_0xe590('0x5')]||{};}module[_0xe590('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xf692=['exports','name','username','remoteUri','Configurations'];(function(_0xfd5211,_0x490686){var _0x19797d=function(_0x496d08){while(--_0x496d08){_0xfd5211['push'](_0xfd5211['shift']());}};_0x19797d(++_0x490686);}(_0xf692,0x105));var _0x2f69=function(_0x367df9,_0x251596){_0x367df9=_0x367df9-0x0;var _0x2bca29=_0xf692[_0x367df9];return _0x2bca29;};'use strict';function ServicenowAccount(_0x214dda){this['id']=_0x214dda['id']||0x0;this[_0x2f69('0x0')]=_0x214dda[_0x2f69('0x0')]||'';this[_0x2f69('0x1')]=_0x214dda[_0x2f69('0x1')]||'';this['password']=_0x214dda['password']||'';this[_0x2f69('0x2')]=_0x214dda[_0x2f69('0x2')]||'';this['serverUrl']=_0x214dda['serverUrl']||'';this[_0x2f69('0x3')]=_0x214dda[_0x2f69('0x3')]||{};}module[_0x2f69('0x4')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 5d2bf6a..78c07e1 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 _0x7232=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x339263,_0x1afc90){var _0x460930=function(_0xf92e8f){while(--_0xf92e8f){_0x339263['push'](_0x339263['shift']());}};_0x460930(++_0x1afc90);}(_0x7232,0x1a7));var _0x2723=function(_0xc74ae3,_0x2b4c18){_0xc74ae3=_0xc74ae3-0x0;var _0x16367e=_0x7232[_0xc74ae3];return _0x16367e;};'use strict';function SugarcrmAccount(_0x4bc826){this['id']=_0x4bc826['id']||0x0;this[_0x2723('0x0')]=_0x4bc826[_0x2723('0x0')]||'';this[_0x2723('0x1')]=_0x4bc826['username']||'';this[_0x2723('0x2')]=_0x4bc826[_0x2723('0x2')]||'';this[_0x2723('0x3')]=_0x4bc826['remoteUri']||'';this[_0x2723('0x4')]=_0x4bc826[_0x2723('0x4')]||'';this['Configurations']=_0x4bc826[_0x2723('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x44dd=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x1ede16,_0x171281){var _0x1a9efe=function(_0x4b03fd){while(--_0x4b03fd){_0x1ede16['push'](_0x1ede16['shift']());}};_0x1a9efe(++_0x171281);}(_0x44dd,0x153));var _0xd44d=function(_0x12a435,_0x2e5f72){_0x12a435=_0x12a435-0x0;var _0x5e16c7=_0x44dd[_0x12a435];return _0x5e16c7;};'use strict';function SugarcrmAccount(_0x12b1d5){this['id']=_0x12b1d5['id']||0x0;this[_0xd44d('0x0')]=_0x12b1d5[_0xd44d('0x0')]||'';this[_0xd44d('0x1')]=_0x12b1d5[_0xd44d('0x1')]||'';this[_0xd44d('0x2')]=_0x12b1d5['password']||'';this[_0xd44d('0x3')]=_0x12b1d5[_0xd44d('0x3')]||'';this['serverUrl']=_0x12b1d5[_0xd44d('0x4')]||'';this[_0xd44d('0x5')]=_0x12b1d5[_0xd44d('0x5')]||{};}module[_0xd44d('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 68ebd61..a375967 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 _0xf965=['unknown','stateTime','status','address','name','state'];(function(_0x3daa8c,_0x388a87){var _0x2b1bd7=function(_0xdb2963){while(--_0xdb2963){_0x3daa8c['push'](_0x3daa8c['shift']());}};_0x2b1bd7(++_0x388a87);}(_0xf965,0xc4));var _0x5f96=function(_0x443f85,_0x1c2f84){_0x443f85=_0x443f85-0x0;var _0x40d7fe=_0xf965[_0x443f85];return _0x40d7fe;};'use strict';function Telephone(_0x495944){this['id']=_0x495944['id']||0x0;this[_0x5f96('0x0')]=_0x495944[_0x5f96('0x0')]||'';this['accountcode']=_0x495944['accountcode']||'';this[_0x5f96('0x1')]=_0x5f96('0x2');this[_0x5f96('0x3')]=0x0;this[_0x5f96('0x4')]=_0x5f96('0x2');this[_0x5f96('0x5')]='';}module['exports']=Telephone; \ No newline at end of file +var _0xcd97=['stateTime','exports','name','accountcode','state','unknown'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd97,0xf2));var _0x7cd9=function(_0xcce37e,_0x2c587f){_0xcce37e=_0xcce37e-0x0;var _0x57ad35=_0xcd97[_0xcce37e];return _0x57ad35;};'use strict';function Telephone(_0x25ee0e){this['id']=_0x25ee0e['id']||0x0;this[_0x7cd9('0x0')]=_0x25ee0e[_0x7cd9('0x0')]||'';this[_0x7cd9('0x1')]=_0x25ee0e[_0x7cd9('0x1')]||'';this[_0x7cd9('0x2')]=_0x7cd9('0x3');this[_0x7cd9('0x4')]=0x0;this['status']=_0x7cd9('0x3');this['address']='';}module[_0x7cd9('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index b6cd002..594e5f4 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 _0xb7c8=['html','exports','name'];(function(_0xf5028c,_0x1e8561){var _0x43fc85=function(_0x3afefb){while(--_0x3afefb){_0xf5028c['push'](_0xf5028c['shift']());}};_0x43fc85(++_0x1e8561);}(_0xb7c8,0x119));var _0x8b7c=function(_0x395fc4,_0x4dc943){_0x395fc4=_0x395fc4-0x0;var _0x1358da=_0xb7c8[_0x395fc4];return _0x1358da;};'use strict';function template(_0x4a7b99){this['id']=_0x4a7b99['id']||0x0;this[_0x8b7c('0x0')]=_0x4a7b99[_0x8b7c('0x0')]||'';this[_0x8b7c('0x1')]=_0x4a7b99[_0x8b7c('0x1')]||'';}module[_0x8b7c('0x2')]=template; \ No newline at end of file +var _0x702d=['html','name'];(function(_0x4de7c3,_0x9b0318){var _0x59e8b0=function(_0x32cbc2){while(--_0x32cbc2){_0x4de7c3['push'](_0x4de7c3['shift']());}};_0x59e8b0(++_0x9b0318);}(_0x702d,0x147));var _0xd702=function(_0x473e1e,_0x5b0c2f){_0x473e1e=_0x473e1e-0x0;var _0x241dd3=_0x702d[_0x473e1e];return _0x241dd3;};'use strict';function template(_0x14de3f){this['id']=_0x14de3f['id']||0x0;this[_0xd702('0x0')]=_0x14de3f[_0xd702('0x0')]||'';this[_0xd702('0x1')]=_0x14de3f[_0xd702('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 8185982..83ae91f 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 _0x4749=['AnyConditions','exports','name','channel','status','AllConditions'];(function(_0x5cab28,_0x307622){var _0xa3554d=function(_0x330139){while(--_0x330139){_0x5cab28['push'](_0x5cab28['shift']());}};_0xa3554d(++_0x307622);}(_0x4749,0x11c));var _0x9474=function(_0x158970,_0x1f9776){_0x158970=_0x158970-0x0;var _0x588002=_0x4749[_0x158970];return _0x588002;};'use strict';function Trigger(_0x56c0cd){this['id']=_0x56c0cd['id']||0x0;this[_0x9474('0x0')]=_0x56c0cd['name']||'';this[_0x9474('0x1')]=_0x56c0cd[_0x9474('0x1')]||'voice';this['status']=_0x56c0cd[_0x9474('0x2')]||![];this[_0x9474('0x3')]=_0x56c0cd[_0x9474('0x3')]||[];this[_0x9474('0x4')]=_0x56c0cd[_0x9474('0x4')]||[];this['Actions']=_0x56c0cd['Actions']||[];}module[_0x9474('0x5')]=Trigger; \ No newline at end of file +var _0x1601=['voice','status','AllConditions','AnyConditions','Actions','exports','name','channel'];(function(_0x25490f,_0x1851cb){var _0x345d86=function(_0x575052){while(--_0x575052){_0x25490f['push'](_0x25490f['shift']());}};_0x345d86(++_0x1851cb);}(_0x1601,0x1d6));var _0x1160=function(_0x3543e7,_0x501fcf){_0x3543e7=_0x3543e7-0x0;var _0x42df23=_0x1601[_0x3543e7];return _0x42df23;};'use strict';function Trigger(_0x441f7b){this['id']=_0x441f7b['id']||0x0;this[_0x1160('0x0')]=_0x441f7b[_0x1160('0x0')]||'';this[_0x1160('0x1')]=_0x441f7b[_0x1160('0x1')]||_0x1160('0x2');this[_0x1160('0x3')]=_0x441f7b[_0x1160('0x3')]||![];this[_0x1160('0x4')]=_0x441f7b[_0x1160('0x4')]||[];this[_0x1160('0x5')]=_0x441f7b[_0x1160('0x5')]||[];this[_0x1160('0x6')]=_0x441f7b[_0x1160('0x6')]||[];}module[_0x1160('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 f3e27c4..0f94207 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 _0xa17f=['domain','domainport','stateRegistry','registrationtime','active','name','state','unknown','stateTime','status','registry','indexOf','port'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xa17f,0xc7));var _0xfa17=function(_0x4d8a8f,_0x2afd4c){_0x4d8a8f=_0x4d8a8f-0x0;var _0xfc4adc=_0xa17f[_0x4d8a8f];return _0xfc4adc;};'use strict';function Trunk(_0x3f8d5a){this['id']=_0x3f8d5a['id']||0x0;this[_0xfa17('0x0')]=_0x3f8d5a[_0xfa17('0x0')]||![];this[_0xfa17('0x1')]=_0x3f8d5a['name']||'';this[_0xfa17('0x2')]=_0xfa17('0x3');this[_0xfa17('0x4')]=0x0;this[_0xfa17('0x5')]=_0xfa17('0x3');this[_0xfa17('0x6')]=_0x3f8d5a[_0xfa17('0x6')]&&_0x3f8d5a[_0xfa17('0x6')][_0xfa17('0x7')](':')?_0x3f8d5a[_0xfa17('0x6')]['split'](':')[0x0]:'';this['host']='';this[_0xfa17('0x8')]='';this[_0xfa17('0x9')]='';this[_0xfa17('0xa')]='';this['refresh']='';this[_0xfa17('0xb')]='unknown';this[_0xfa17('0xc')]='';this['address']='';}module['exports']=Trunk; \ No newline at end of file +var _0x620d=['split','host','port','domain','domainport','refresh','stateRegistry','registrationtime','address','exports','active','name','state','stateTime','unknown','registry','indexOf'];(function(_0x5f2321,_0x823d58){var _0x2f5f4c=function(_0x49d97c){while(--_0x49d97c){_0x5f2321['push'](_0x5f2321['shift']());}};_0x2f5f4c(++_0x823d58);}(_0x620d,0xf8));var _0xd620=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x620d[_0x3bf83f];return _0x22c4a9;};'use strict';function Trunk(_0x11f7ac){this['id']=_0x11f7ac['id']||0x0;this[_0xd620('0x0')]=_0x11f7ac['active']||![];this[_0xd620('0x1')]=_0x11f7ac['name']||'';this[_0xd620('0x2')]='unknown';this[_0xd620('0x3')]=0x0;this['status']=_0xd620('0x4');this[_0xd620('0x5')]=_0x11f7ac['registry']&&_0x11f7ac[_0xd620('0x5')][_0xd620('0x6')](':')?_0x11f7ac[_0xd620('0x5')][_0xd620('0x7')](':')[0x0]:'';this[_0xd620('0x8')]='';this[_0xd620('0x9')]='';this[_0xd620('0xa')]='';this[_0xd620('0xb')]='';this[_0xd620('0xc')]='';this[_0xd620('0xd')]=_0xd620('0x4');this[_0xd620('0xe')]='';this[_0xd620('0xf')]='';}module[_0xd620('0x10')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 7a175b9..59adf0f 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 _0x422b=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x1b64dd,_0x2cf769){var _0xeb464c=function(_0x38272c){while(--_0x38272c){_0x1b64dd['push'](_0x1b64dd['shift']());}};_0xeb464c(++_0x2cf769);}(_0x422b,0x1d5));var _0xb422=function(_0x53eb03,_0xc12a02){_0x53eb03=_0x53eb03-0x0;var _0x46a7c4=_0x422b[_0x53eb03];return _0x46a7c4;};'use strict';function voiceExtension(_0x5c571d){this['id']=_0x5c571d['id']||0x0;this[_0xb422('0x0')]=_0x5c571d[_0xb422('0x0')]||'';this[_0xb422('0x1')]=_0x5c571d[_0xb422('0x1')]||_0xb422('0x2');this[_0xb422('0x3')]=_0x5c571d[_0xb422('0x3')]||![];}module[_0xb422('0x4')]=voiceExtension; \ No newline at end of file +var _0xe33b=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x2c94e0,_0x564d81){var _0x5d3af8=function(_0x304699){while(--_0x304699){_0x2c94e0['push'](_0x2c94e0['shift']());}};_0x5d3af8(++_0x564d81);}(_0xe33b,0xd1));var _0xbe33=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xe33b[_0x167cc1];return _0x10bc4b;};'use strict';function voiceExtension(_0x5ed885){this['id']=_0x5ed885['id']||0x0;this['exten']=_0x5ed885[_0xbe33('0x0')]||'';this['recordingFormat']=_0x5ed885[_0xbe33('0x1')]||_0xbe33('0x2');this[_0xbe33('0x3')]=_0x5ed885['mandatoryDisposition']||![];}module[_0xbe33('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 3ea756d..e68c2c0 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 _0x648b=['dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','inuse','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','name','monitor_format','type','talking','total','unmanaged','abandoned','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','progressive','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','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence'];(function(_0x492535,_0x46524a){var _0x256620=function(_0x3015f8){while(--_0x3015f8){_0x492535['push'](_0x492535['shift']());}};_0x256620(++_0x46524a);}(_0x648b,0x1cb));var _0xb648=function(_0x29933f,_0x1c3f94){_0x29933f=_0x29933f-0x0;var _0x568651=_0x648b[_0x29933f];return _0x568651;};'use strict';var statusDesc=['unknown','not_inuse',_0xb648('0x0'),'busy',_0xb648('0x1'),_0xb648('0x2'),_0xb648('0x3'),_0xb648('0x4'),_0xb648('0x5')];var monitorFormat={'wav':_0xb648('0x6'),'wav49':_0xb648('0x7'),'gsm':_0xb648('0x8')};var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};function VoiceQueue(_0x147174){this['id']=_0x147174['id']||0x0;this[_0xb648('0x9')]=_0x147174[_0xb648('0x9')]||'';this[_0xb648('0xa')]=_0x147174['monitor_format']||'';this[_0xb648('0xb')]=_0x147174['type']||'inbound';this['waiting']=0x0;this[_0xb648('0xc')]=0x0;this[_0xb648('0xd')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0xb648('0xe')]=0x0;this[_0xb648('0xf')]=0x0;this['loggedIn']=0x0;this[_0xb648('0x10')]=0x0;this['acw']=_0x147174[_0xb648('0x11')]||![];this[_0xb648('0x12')]=_0x147174[_0xb648('0x12')]||0xa;this[_0xb648('0x13')]=_0x147174[_0xb648('0x13')]||'no';this[_0xb648('0x14')]=!![];this[_0xb648('0x15')]='';this[_0xb648('0x16')]=0x0;this[_0xb648('0x17')]=0x0;this[_0xb648('0x18')]=_0x147174[_0xb648('0x18')]||null;this['dialGlobalInterval']=_0x147174[_0xb648('0x19')]?_0x147174['dialGlobalInterval']:null;this[_0xb648('0x1a')]=_0x147174[_0xb648('0x1a')];this['dialMethod']=_0x147174['dialMethod']||_0xb648('0x1b');this[_0xb648('0x1c')]=_0x147174[_0xb648('0x1c')]||0x0;this[_0xb648('0x1d')]=_0x147174[_0xb648('0x1d')]||0x0;this['dialPowerLevel']=_0x147174[_0xb648('0x1e')]||0x1;this['dialPredictiveOptimization']=_0x147174[_0xb648('0x1f')]||_0xb648('0x20');this[_0xb648('0x21')]=_0x147174['dialPredictiveOptimizationPercentage']||0.03;this[_0xb648('0x22')]=_0x147174[_0xb648('0x22')]||0x258;this[_0xb648('0x23')]=_0x147174[_0xb648('0x23')]||_0xb648('0x24');this[_0xb648('0x25')]=_0x147174['dialOriginateCallerIdNumber']||_0xb648('0x24');this[_0xb648('0x26')]=_0x147174[_0xb648('0x26')]||0x1e;this['dialQueueOptions']=_0x147174[_0xb648('0x27')]||_0xb648('0x28');this[_0xb648('0x29')]=_0x147174[_0xb648('0x29')]||0x3;this['dialQueueProject']=_0x147174[_0xb648('0x2a')]||undefined;this['dialCongestionMaxRetry']=_0x147174[_0xb648('0x2b')]||0x3;this[_0xb648('0x2c')]=_0x147174['dialCongestionRetryFrequency']||0x96;this[_0xb648('0x2d')]=_0x147174[_0xb648('0x2d')]||0x3;this[_0xb648('0x2e')]=_0x147174[_0xb648('0x2e')]||0x96;this[_0xb648('0x2f')]=_0x147174['dialNoAnswerMaxRetry']||0x3;this[_0xb648('0x30')]=_0x147174['dialNoAnswerRetryFrequency']||0x96;this['dialGlobalMaxRetry']=_0x147174[_0xb648('0x31')]||0x4;this['Trunk']=_0x147174['Trunk']?_0x147174[_0xb648('0x32')]:undefined;this[_0xb648('0x33')]=_0x147174['TrunkBackup']?_0x147174[_0xb648('0x33')]:undefined;this[_0xb648('0x34')]=_0x147174[_0xb648('0x34')]||undefined;this[_0xb648('0x35')]=_0x147174[_0xb648('0x35')]?_0x147174[_0xb648('0x35')]:undefined;this['dialOrderByScheduledAt']=_0x147174['dialOrderByScheduledAt']||_0xb648('0x36');this[_0xb648('0x37')]=_0x147174[_0xb648('0x37')]||undefined;this[_0xb648('0x38')]=_0x147174[_0xb648('0x38')]||undefined;this[_0xb648('0x39')]=strategy[_0x147174[_0xb648('0x39')]]||_0xb648('0x3a');this[_0xb648('0x3b')]=!![];this[_0xb648('0x3c')]=_0x147174[_0xb648('0x3c')]||![];this[_0xb648('0x3d')]=_0x147174[_0xb648('0x3d')];this['dialAMDGreeting']=_0x147174[_0xb648('0x3e')];this['dialAMDAfterGreetingSilence']=_0x147174['dialAMDAfterGreetingSilence'];this[_0xb648('0x3f')]=_0x147174['dialAMDTotalAnalysisTime'];this[_0xb648('0x40')]=_0x147174[_0xb648('0x40')];this[_0xb648('0x41')]=_0x147174[_0xb648('0x41')];this[_0xb648('0x42')]=_0x147174[_0xb648('0x42')];this[_0xb648('0x43')]=_0x147174[_0xb648('0x43')];this[_0xb648('0x44')]=_0x147174[_0xb648('0x44')];this['outboundRejectCallsDay']=0x0;this['pTalking']=0x0;this[_0xb648('0x45')]=_0x147174[_0xb648('0x45')];this[_0xb648('0x46')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xb648('0x47')]=0x0;this[_0xb648('0x48')]=0x0;this[_0xb648('0x49')]=0x0;this[_0xb648('0x4a')]=0x0;this[_0xb648('0x4b')]=0x0;this[_0xb648('0x4c')]=0x0;this[_0xb648('0x4d')]=0x0;this[_0xb648('0x4e')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xb648('0x4f')]=0x0;this[_0xb648('0x50')]=0x0;this[_0xb648('0x51')]=undefined;this[_0xb648('0x52')]=undefined;this[_0xb648('0x53')]=undefined;this[_0xb648('0x54')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0xb648('0x55')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xb648('0x56')]=0x0;this[_0xb648('0x57')]=0x0;this[_0xb648('0x58')]=0x0;this[_0xb648('0x59')]=0x0;this['predictiveIntervalMaxThreshold']=_0x147174[_0xb648('0x5a')]||0x14;this[_0xb648('0x5b')]=_0x147174[_0xb648('0x5a')]||0xa;this[_0xb648('0x5c')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0xb648('0x5d')]=0x1;this[_0xb648('0x5e')]=0x0;this[_0xb648('0x5f')]=0x0;this[_0xb648('0x60')]=0x0;this[_0xb648('0x61')]=0x0;this[_0xb648('0x62')]=_0x147174['dialRecallMeTimeout']||0x1e;this[_0xb648('0x63')]=_0x147174[_0xb648('0x63')]||![];this['dialQueueProject2']=_0x147174['dialQueueProject2']||undefined;this['dialAgiAfterHangupClient']=_0x147174[_0xb648('0x64')]||![];this[_0xb648('0x65')]=_0x147174[_0xb648('0x65')]||![];this[_0xb648('0xa')]=monitorFormat[_0x147174['monitor_format']]?monitorFormat[_0x147174['monitor_format']]:undefined;this['mandatoryDisposition']=_0x147174[_0xb648('0x66')]||![];this[_0xb648('0x67')]=_0x147174['mandatoryDispositionPause']?_0x147174['mandatoryDispositionPause']:undefined;}module[_0xb648('0x68')]=VoiceQueue; \ No newline at end of file +var _0x8dbf=['Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','startProgressive','startPredictive','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','busy','invalid','unavailable','ringing','ringinuse','wav','wav49','gsm','rrmemory','name','monitor_format','type','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0xf7debe,_0x3d7e3d){var _0x465c03=function(_0x4193df){while(--_0x4193df){_0xf7debe['push'](_0xf7debe['shift']());}};_0x465c03(++_0x3d7e3d);}(_0x8dbf,0x1f2));var _0xf8db=function(_0x387e81,_0x1c19c3){_0x387e81=_0x387e81-0x0;var _0xf4363d=_0x8dbf[_0x387e81];return _0xf4363d;};'use strict';var statusDesc=[_0xf8db('0x0'),_0xf8db('0x1'),'inuse',_0xf8db('0x2'),_0xf8db('0x3'),_0xf8db('0x4'),_0xf8db('0x5'),_0xf8db('0x6'),'onhold'];var monitorFormat={'wav':_0xf8db('0x7'),'wav49':_0xf8db('0x8'),'gsm':_0xf8db('0x9')};var strategy={'rrmemory':_0xf8db('0xa'),'roundrobin':'roundrobin'};function VoiceQueue(_0xa21ee2){this['id']=_0xa21ee2['id']||0x0;this['name']=_0xa21ee2[_0xf8db('0xb')]||'';this[_0xf8db('0xc')]=_0xa21ee2[_0xf8db('0xc')]||'';this[_0xf8db('0xd')]=_0xa21ee2[_0xf8db('0xd')]||'inbound';this[_0xf8db('0xe')]=0x0;this[_0xf8db('0xf')]=0x0;this[_0xf8db('0x10')]=0x0;this[_0xf8db('0x11')]=0x0;this[_0xf8db('0x12')]=0x0;this[_0xf8db('0x13')]=0x0;this[_0xf8db('0x14')]=0x0;this[_0xf8db('0x15')]=0x0;this[_0xf8db('0x16')]=0x0;this[_0xf8db('0x17')]=0x0;this['available']=0x0;this['acw']=_0xa21ee2[_0xf8db('0x18')]||![];this['acwTimeout']=_0xa21ee2[_0xf8db('0x19')]||0xa;this['autopause']=_0xa21ee2[_0xf8db('0x1a')]||'no';this[_0xf8db('0x1b')]=!![];this[_0xf8db('0x1c')]='';this[_0xf8db('0x1d')]=0x0;this[_0xf8db('0x1e')]=0x0;this[_0xf8db('0x1f')]=_0xa21ee2['dialTimezone']||null;this[_0xf8db('0x20')]=_0xa21ee2[_0xf8db('0x20')]?_0xa21ee2[_0xf8db('0x20')]:null;this['dialActive']=_0xa21ee2[_0xf8db('0x21')];this['dialMethod']=_0xa21ee2['dialMethod']||_0xf8db('0x22');this['dialLimitChannel']=_0xa21ee2[_0xf8db('0x23')]||0x0;this[_0xf8db('0x24')]=_0xa21ee2['dialLimitQueue']||0x0;this[_0xf8db('0x25')]=_0xa21ee2['dialPowerLevel']||0x1;this[_0xf8db('0x26')]=_0xa21ee2[_0xf8db('0x26')]||_0xf8db('0x27');this['dialPredictiveOptimizationPercentage']=_0xa21ee2[_0xf8db('0x28')]||0.03;this['dialPredictiveInterval']=_0xa21ee2[_0xf8db('0x29')]||0x258;this[_0xf8db('0x2a')]=_0xa21ee2[_0xf8db('0x2a')]||_0xf8db('0x2b');this[_0xf8db('0x2c')]=_0xa21ee2[_0xf8db('0x2c')]||_0xf8db('0x2b');this[_0xf8db('0x2d')]=_0xa21ee2['dialOriginateTimeout']||0x1e;this[_0xf8db('0x2e')]=_0xa21ee2[_0xf8db('0x2e')]||_0xf8db('0x2f');this[_0xf8db('0x30')]=_0xa21ee2[_0xf8db('0x30')]||0x3;this['dialQueueProject']=_0xa21ee2[_0xf8db('0x31')]||undefined;this[_0xf8db('0x32')]=_0xa21ee2[_0xf8db('0x32')]||0x3;this[_0xf8db('0x33')]=_0xa21ee2['dialCongestionRetryFrequency']||0x96;this[_0xf8db('0x34')]=_0xa21ee2[_0xf8db('0x34')]||0x3;this[_0xf8db('0x35')]=_0xa21ee2[_0xf8db('0x35')]||0x96;this['dialNoAnswerMaxRetry']=_0xa21ee2[_0xf8db('0x36')]||0x3;this[_0xf8db('0x37')]=_0xa21ee2[_0xf8db('0x37')]||0x96;this[_0xf8db('0x38')]=_0xa21ee2['dialGlobalMaxRetry']||0x4;this[_0xf8db('0x39')]=_0xa21ee2[_0xf8db('0x39')]?_0xa21ee2[_0xf8db('0x39')]:undefined;this[_0xf8db('0x3a')]=_0xa21ee2[_0xf8db('0x3a')]?_0xa21ee2[_0xf8db('0x3a')]:undefined;this[_0xf8db('0x3b')]=_0xa21ee2['dialPrefix']||undefined;this[_0xf8db('0x3c')]=_0xa21ee2[_0xf8db('0x3c')]?_0xa21ee2[_0xf8db('0x3c')]:undefined;this[_0xf8db('0x3d')]=_0xa21ee2[_0xf8db('0x3d')]||_0xf8db('0x3e');this['dialRandomLastDigitCallerIdNumber']=_0xa21ee2[_0xf8db('0x3f')]||undefined;this['dialCutDigit']=_0xa21ee2[_0xf8db('0x40')]||undefined;this[_0xf8db('0x41')]=strategy[_0xa21ee2[_0xf8db('0x41')]]||_0xf8db('0xa');this[_0xf8db('0x42')]=!![];this[_0xf8db('0x43')]=_0xa21ee2[_0xf8db('0x43')]||![];this[_0xf8db('0x44')]=_0xa21ee2[_0xf8db('0x44')];this[_0xf8db('0x45')]=_0xa21ee2[_0xf8db('0x45')];this[_0xf8db('0x46')]=_0xa21ee2[_0xf8db('0x46')];this['dialAMDTotalAnalysisTime']=_0xa21ee2[_0xf8db('0x47')];this[_0xf8db('0x48')]=_0xa21ee2[_0xf8db('0x48')];this[_0xf8db('0x49')]=_0xa21ee2[_0xf8db('0x49')];this[_0xf8db('0x4a')]=_0xa21ee2[_0xf8db('0x4a')];this[_0xf8db('0x4b')]=_0xa21ee2[_0xf8db('0x4b')];this[_0xf8db('0x4c')]=_0xa21ee2['dialAMDMaximumWordLength'];this[_0xf8db('0x4d')]=0x0;this[_0xf8db('0x4e')]=0x0;this['timeout']=_0xa21ee2['timeout'];this[_0xf8db('0x4f')]=0x0;this[_0xf8db('0x50')]=0x0;this[_0xf8db('0x51')]=0x0;this[_0xf8db('0x52')]=0x0;this[_0xf8db('0x53')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0xf8db('0x54')]=0x0;this[_0xf8db('0x55')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xf8db('0x56')]=0x0;this[_0xf8db('0x57')]=0x0;this[_0xf8db('0x58')]=0x0;this['outboundReCallsDay']=0x0;this[_0xf8db('0x59')]=undefined;this[_0xf8db('0x5a')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xf8db('0x5b')]=0x0;this[_0xf8db('0x5c')]=0x0;this[_0xf8db('0x5d')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xf8db('0x5e')]=0x0;this[_0xf8db('0x5f')]=0x0;this[_0xf8db('0x60')]=0x0;this[_0xf8db('0x61')]=_0xa21ee2[_0xf8db('0x62')]||0x14;this['predictiveIntervalMinThreshold']=_0xa21ee2[_0xf8db('0x62')]||0xa;this[_0xf8db('0x63')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0xf8db('0x64')]=0x1;this[_0xf8db('0x65')]=0x0;this[_0xf8db('0x66')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xf8db('0x67')]=0x0;this[_0xf8db('0x68')]=_0xa21ee2[_0xf8db('0x68')]||0x1e;this[_0xf8db('0x69')]=_0xa21ee2[_0xf8db('0x69')]||![];this['dialQueueProject2']=_0xa21ee2['dialQueueProject2']||undefined;this[_0xf8db('0x6a')]=_0xa21ee2['dialAgiAfterHangupClient']||![];this[_0xf8db('0x6b')]=_0xa21ee2['dialAgiAfterHangupAgent']||![];this[_0xf8db('0xc')]=monitorFormat[_0xa21ee2[_0xf8db('0xc')]]?monitorFormat[_0xa21ee2[_0xf8db('0xc')]]:undefined;this[_0xf8db('0x6c')]=_0xa21ee2[_0xf8db('0x6c')]||![];this[_0xf8db('0x6d')]=_0xa21ee2[_0xf8db('0x6d')]?_0xa21ee2[_0xf8db('0x6d')]:undefined;}module[_0xf8db('0x6e')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 6f71441..1cee499 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 _0x0c33=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x1c402a,_0x459e4b){var _0x44c8ab=function(_0x491029){while(--_0x491029){_0x1c402a['push'](_0x1c402a['shift']());}};_0x44c8ab(++_0x459e4b);}(_0x0c33,0x7a));var _0x30c3=function(_0x2742db,_0x58e00c){_0x2742db=_0x2742db-0x0;var _0x18659e=_0x0c33[_0x2742db];return _0x18659e;};'use strict';function VtigerAccount(_0x2952ad){this['id']=_0x2952ad['id']||0x0;this[_0x30c3('0x0')]=_0x2952ad['name']||'';this[_0x30c3('0x1')]=_0x2952ad[_0x30c3('0x1')]||'';this[_0x30c3('0x2')]=_0x2952ad[_0x30c3('0x2')]||'';this['remoteUri']=_0x2952ad[_0x30c3('0x3')]||'';this[_0x30c3('0x4')]=_0x2952ad[_0x30c3('0x4')]||'';this['Configurations']=_0x2952ad[_0x30c3('0x5')]||{};}module[_0x30c3('0x6')]=VtigerAccount; \ No newline at end of file +var _0x5f79=['Configurations','exports','name','username','accessKey','serverUrl'];(function(_0x211b34,_0x15348f){var _0x26fe44=function(_0x3a9d17){while(--_0x3a9d17){_0x211b34['push'](_0x211b34['shift']());}};_0x26fe44(++_0x15348f);}(_0x5f79,0x146));var _0x95f7=function(_0x1f7839,_0x2a26e6){_0x1f7839=_0x1f7839-0x0;var _0x36b42e=_0x5f79[_0x1f7839];return _0x36b42e;};'use strict';function VtigerAccount(_0xd2a69d){this['id']=_0xd2a69d['id']||0x0;this['name']=_0xd2a69d[_0x95f7('0x0')]||'';this[_0x95f7('0x1')]=_0xd2a69d[_0x95f7('0x1')]||'';this[_0x95f7('0x2')]=_0xd2a69d[_0x95f7('0x2')]||'';this['remoteUri']=_0xd2a69d['remoteUri']||'';this[_0x95f7('0x3')]=_0xd2a69d[_0x95f7('0x3')]||'';this['Configurations']=_0xd2a69d[_0x95f7('0x4')]||{};}module[_0x95f7('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 9653dc8..39def45 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 _0xbcd5=['authType','type','serverUrl','Configurations','exports','name','username','password','token','remoteUri'];(function(_0x1fc85c,_0x4b72b8){var _0x952c1e=function(_0x5966d6){while(--_0x5966d6){_0x1fc85c['push'](_0x1fc85c['shift']());}};_0x952c1e(++_0x4b72b8);}(_0xbcd5,0x131));var _0x5bcd=function(_0x5401ae,_0x5e58ac){_0x5401ae=_0x5401ae-0x0;var _0x286068=_0xbcd5[_0x5401ae];return _0x286068;};'use strict';function ZendeskAccount(_0x5b0519){this['id']=_0x5b0519['id']||0x0;this['name']=_0x5b0519[_0x5bcd('0x0')]||'';this[_0x5bcd('0x1')]=_0x5b0519['username']||'';this[_0x5bcd('0x2')]=_0x5b0519[_0x5bcd('0x2')]||'';this['token']=_0x5b0519[_0x5bcd('0x3')]||'';this[_0x5bcd('0x4')]=_0x5b0519[_0x5bcd('0x4')]||'';this[_0x5bcd('0x5')]=_0x5b0519[_0x5bcd('0x5')]||'';this[_0x5bcd('0x6')]=_0x5b0519[_0x5bcd('0x6')]||'integrationTab';this['serverUrl']=_0x5b0519[_0x5bcd('0x7')]||'';this[_0x5bcd('0x8')]=_0x5b0519[_0x5bcd('0x8')]||{};}module[_0x5bcd('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x2f71=['serverUrl','Configurations','exports','name','password','token','remoteUri','authType','type','integrationTab'];(function(_0x5d8241,_0xb42c9){var _0x2d508f=function(_0x5ce6e3){while(--_0x5ce6e3){_0x5d8241['push'](_0x5d8241['shift']());}};_0x2d508f(++_0xb42c9);}(_0x2f71,0x1cf));var _0x12f7=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x2f71[_0x56482c];return _0x5aae7a;};'use strict';function ZendeskAccount(_0x234da8){this['id']=_0x234da8['id']||0x0;this[_0x12f7('0x0')]=_0x234da8[_0x12f7('0x0')]||'';this['username']=_0x234da8['username']||'';this[_0x12f7('0x1')]=_0x234da8['password']||'';this['token']=_0x234da8[_0x12f7('0x2')]||'';this[_0x12f7('0x3')]=_0x234da8['remoteUri']||'';this[_0x12f7('0x4')]=_0x234da8[_0x12f7('0x4')]||'';this[_0x12f7('0x5')]=_0x234da8[_0x12f7('0x5')]||_0x12f7('0x6');this[_0x12f7('0x7')]=_0x234da8['serverUrl']||'';this[_0x12f7('0x8')]=_0x234da8['Configurations']||{};}module[_0x12f7('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 3c96850..a24cdb7 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 _0xeff8=['name','authToken','host','Configurations','serverUrl'];(function(_0x1d74b0,_0x162210){var _0x2fa48f=function(_0x5d7141){while(--_0x5d7141){_0x1d74b0['push'](_0x1d74b0['shift']());}};_0x2fa48f(++_0x162210);}(_0xeff8,0x186));var _0x8eff=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xeff8[_0x1d24eb];return _0x1dc576;};'use strict';function ZohoAccount(_0x46fc91){this['id']=_0x46fc91['id']||0x0;this[_0x8eff('0x0')]=_0x46fc91['name']||'';this[_0x8eff('0x1')]=_0x46fc91[_0x8eff('0x1')]||'';this[_0x8eff('0x2')]=_0x46fc91['host']||'';this[_0x8eff('0x3')]=_0x46fc91[_0x8eff('0x3')]||{};this[_0x8eff('0x4')]=_0x46fc91[_0x8eff('0x4')]||'';}module['exports']=ZohoAccount; \ No newline at end of file +var _0xc1c6=['Configurations','exports','name','authToken','host'];(function(_0x4a1a2f,_0x4738f4){var _0x37ae4a=function(_0x55ab88){while(--_0x55ab88){_0x4a1a2f['push'](_0x4a1a2f['shift']());}};_0x37ae4a(++_0x4738f4);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x2be344,_0x2291cf){_0x2be344=_0x2be344-0x0;var _0x53fa1e=_0xc1c6[_0x2be344];return _0x53fa1e;};'use strict';function ZohoAccount(_0xfb8a07){this['id']=_0xfb8a07['id']||0x0;this[_0x6c1c('0x0')]=_0xfb8a07[_0x6c1c('0x0')]||'';this['authToken']=_0xfb8a07[_0x6c1c('0x1')]||'';this['host']=_0xfb8a07[_0x6c1c('0x2')]||'';this[_0x6c1c('0x3')]=_0xfb8a07[_0x6c1c('0x3')]||{};this['serverUrl']=_0xfb8a07['serverUrl']||'';}module[_0x6c1c('0x4')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index bafc940..a5e3c0b 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 _0x8b74=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','lodash','moment','string','isNil','idContact','queue','type','campaigntype','membername','Agent','name','channelAgent','format','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','callback'];(function(_0x1d1854,_0x4a83b1){var _0x5b2acb=function(_0x29ae13){while(--_0x29ae13){_0x1d1854['push'](_0x1d1854['shift']());}};_0x5b2acb(++_0x4a83b1);}(_0x8b74,0x1ef));var _0x48b7=function(_0x2af603,_0x2b3a71){_0x2af603=_0x2af603-0x0;var _0x11a952=_0x8b74[_0x2af603];return _0x11a952;};'use strict';var util=require('util');var _=require(_0x48b7('0x0'));var moment=require(_0x48b7('0x1'));function checkNameSurname(_0x1cd681,_0x34bdd7,_0x2a244e){var _0x5b1f13='';if(!_['isNil'](_0x34bdd7)&&_0x48b7('0x2')===typeof _0x34bdd7){_0x5b1f13+=_0x34bdd7;}if(!_[_0x48b7('0x3')](_0x2a244e)&&_0x48b7('0x2')===typeof _0x2a244e){_0x5b1f13+='\x20'+_0x2a244e;}if(_0x5b1f13!==''){return _0x5b1f13;}return _0x1cd681;}function Action(_0x3548c,_0x3bed19,_0x434a1c,_0x2f1926,_0x19b125){this['uniqueid']=_0x434a1c||undefined;this[_0x48b7('0x4')]=_0x3548c['id'];this[_0x48b7('0x5')]=_0x3bed19['name'];this[_0x48b7('0x6')]=_0x3bed19[_0x48b7('0x6')];this[_0x48b7('0x7')]=_0x48b7('0x5');this['dialAnswer']=![];this[_0x48b7('0x8')]=_[_0x48b7('0x3')](_0x3548c['Agent'])?undefined:_0x3548c[_0x48b7('0x9')][_0x48b7('0xa')];this[_0x48b7('0xb')]=this['membername']?util[_0x48b7('0xc')](_0x48b7('0xd'),this[_0x48b7('0x8')]):_0x2f1926||undefined;this['calleridname']=checkNameSurname(_0x3548c[_0x48b7('0xe')][_0x48b7('0xf')],_0x3548c[_0x48b7('0xe')][_0x48b7('0x10')],_0x3548c['Contact'][_0x48b7('0x11')]);this[_0x48b7('0x12')]=_0x3548c[_0x48b7('0x12')]||![];this[_0x48b7('0x13')]=_0x3548c[_0x48b7('0xe')][_0x48b7('0xf')];this[_0x48b7('0x14')]=_0x3548c[_0x48b7('0x14')];this[_0x48b7('0x15')]=_0x3548c[_0x48b7('0x15')]||0x0;this[_0x48b7('0x16')]=_0x3548c[_0x48b7('0x16')]||0x0;this['countnoanswerretry']=_0x3548c[_0x48b7('0x17')]||0x0;this['countglobal']=(_0x3548c[_0x48b7('0x15')]||0x0)+(_0x3548c[_0x48b7('0x16')]||0x0)+(_0x3548c[_0x48b7('0x17')]||0x0);this[_0x48b7('0x18')]=_0x3548c['callback'];this[_0x48b7('0x19')]=_0x3548c[_0x48b7('0x19')];this[_0x48b7('0x1a')]=_0x3548c['callbackat'];this['recallme']=_0x3548c[_0x48b7('0x1b')];this[_0x48b7('0x1c')]=_0x3548c['ContactId'];this[_0x48b7('0x1d')]=_0x3548c['ListId'];this['UserId']=_[_0x48b7('0x3')](_0x3548c['Agent'])?_0x3548c[_0x48b7('0x1e')]:_0x3548c[_0x48b7('0x9')]['id'];this[_0x48b7('0x1f')]=_0x3548c['VoiceQueueId'];this[_0x48b7('0x20')]='';this[_0x48b7('0x21')]='';}Action[_0x48b7('0x22')][_0x48b7('0x23')]=function(){return util[_0x48b7('0xc')](_0x48b7('0x24'),this[_0x48b7('0x25')],this[_0x48b7('0x26')]);};module[_0x48b7('0x27')]=Action; \ No newline at end of file +var _0x345d=['getCaller','\x22%s\x22\x20<%s>','number','exports','util','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','name','format','SIP/%s','calleridname','Contact','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','prototype'];(function(_0x3596fb,_0x3594b8){var _0x5af476=function(_0x53dd93){while(--_0x53dd93){_0x3596fb['push'](_0x3596fb['shift']());}};_0x5af476(++_0x3594b8);}(_0x345d,0xc7));var _0xd345=function(_0x4fb2ba,_0x1de815){_0x4fb2ba=_0x4fb2ba-0x0;var _0x48a90b=_0x345d[_0x4fb2ba];return _0x48a90b;};'use strict';var util=require(_0xd345('0x0'));var _=require('lodash');var moment=require(_0xd345('0x1'));function checkNameSurname(_0x145dab,_0x3c3315,_0x477af5){var _0x29b793='';if(!_[_0xd345('0x2')](_0x3c3315)&&_0xd345('0x3')===typeof _0x3c3315){_0x29b793+=_0x3c3315;}if(!_['isNil'](_0x477af5)&&_0xd345('0x3')===typeof _0x477af5){_0x29b793+='\x20'+_0x477af5;}if(_0x29b793!==''){return _0x29b793;}return _0x145dab;}function Action(_0x293528,_0x52ca6b,_0x3ac3f4,_0x4335f0,_0x28786c){this[_0xd345('0x4')]=_0x3ac3f4||undefined;this[_0xd345('0x5')]=_0x293528['id'];this[_0xd345('0x6')]=_0x52ca6b['name'];this[_0xd345('0x7')]=_0x52ca6b[_0xd345('0x7')];this[_0xd345('0x8')]=_0xd345('0x6');this[_0xd345('0x9')]=![];this[_0xd345('0xa')]=_['isNil'](_0x293528[_0xd345('0xb')])?undefined:_0x293528[_0xd345('0xb')][_0xd345('0xc')];this['channelAgent']=this['membername']?util[_0xd345('0xd')](_0xd345('0xe'),this[_0xd345('0xa')]):_0x4335f0||undefined;this[_0xd345('0xf')]=checkNameSurname(_0x293528[_0xd345('0x10')][_0xd345('0x11')],_0x293528['Contact'][_0xd345('0x12')],_0x293528[_0xd345('0x10')]['lastName']);this['active']=_0x293528[_0xd345('0x13')]||![];this[_0xd345('0x14')]=_0x293528['Contact'][_0xd345('0x11')];this['scheduledat']=_0x293528[_0xd345('0x15')];this[_0xd345('0x16')]=_0x293528['countbusyretry']||0x0;this[_0xd345('0x17')]=_0x293528[_0xd345('0x17')]||0x0;this[_0xd345('0x18')]=_0x293528['countnoanswerretry']||0x0;this[_0xd345('0x19')]=(_0x293528['countbusyretry']||0x0)+(_0x293528['countcongestionretry']||0x0)+(_0x293528[_0xd345('0x18')]||0x0);this[_0xd345('0x1a')]=_0x293528[_0xd345('0x1a')];this[_0xd345('0x1b')]=_0x293528['callbackuniqueid'];this[_0xd345('0x1c')]=_0x293528[_0xd345('0x1c')];this[_0xd345('0x1d')]=_0x293528[_0xd345('0x1d')];this[_0xd345('0x1e')]=_0x293528['ContactId'];this['ListId']=_0x293528[_0xd345('0x1f')];this[_0xd345('0x20')]=_['isNil'](_0x293528[_0xd345('0xb')])?_0x293528[_0xd345('0x20')]:_0x293528[_0xd345('0xb')]['id'];this[_0xd345('0x21')]=_0x293528[_0xd345('0x21')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0xd345('0x22')][_0xd345('0x23')]=function(){return util[_0xd345('0xd')](_0xd345('0x24'),this[_0xd345('0xf')],this[_0xd345('0x25')]);};module[_0xd345('0x26')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 9d56919..acbbf6f 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 _0x2f2e=['buildAcw','custom:agentcomplete','buildObj','complete','Answer','createCustomerFinal','crateCustomerReportQueue','[syncHangup][talking][decrement]','linkedid','countbusyretry','Busy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','rescheduleContact','dialBusyRetryFrequency','unlockAgent','activeContact','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','Global','dialNoAnswerMaxRetry','scheduledAt','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','unlockContact','idContact','disableContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','createHistory','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','run','execRun','unlock','recallme','validateContact','isValid','Contact.phone','Call\x20unsuccessful','[Preview][getContactPreview]','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','TrunkBackup','getCallerId','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','callerid','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','variablesAction','[originated][increment]','OriginateError','actionid','logLookAgent','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','hangup','syncHangup','syncHangupRequest','syncDialEnd','bind','newexten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','campaignsPreview','emit','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','stringify','format','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','\x20is\x20not\x20active','IS_DISACTIVED','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','hasOwnProperty','clearZombieChannels','recallMe','clearZombieChannel','info','originated:\x20','queue','originated','pTalking:\x20','dialAnswer','pick','contactId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','getContactRecallMe','then','isNil','length','getDiff','scheduledat','dialRecallMeTimeout','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','setMessage','IsNotLoggedIn','dialActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentConnectPreview'];(function(_0x5c6469,_0x54afe8){var _0x4a85d0=function(_0x668156){while(--_0x668156){_0x5c6469['push'](_0x5c6469['shift']());}};_0x4a85d0(++_0x54afe8);}(_0x2f2e,0x1c3));var _0xe2f2=function(_0x447f6d,_0x36fc29){_0x447f6d=_0x447f6d-0x0;var _0x56a9b8=_0x2f2e[_0x447f6d];return _0x56a9b8;};'use strict';var util=require(_0xe2f2('0x0'));var _=require(_0xe2f2('0x1'));var BPromise=require(_0xe2f2('0x2'));var uuid=require(_0xe2f2('0x3'));var moment=require('moment');var md5=require(_0xe2f2('0x4'));var Redis=require(_0xe2f2('0x5'));var config=require(_0xe2f2('0x6'));var logger=require(_0xe2f2('0x7'))(_0xe2f2('0x8'));var loggerAction=require(_0xe2f2('0x7'))(_0xe2f2('0x9'));var ami=require(_0xe2f2('0xa'));var rpcDb=require(_0xe2f2('0xb'));var Action=require(_0xe2f2('0xc'));var ut=require(_0xe2f2('0xd'));config[_0xe2f2('0xe')]=_[_0xe2f2('0xf')](config['redis'],{'host':_0xe2f2('0x10'),'port':0x18eb});var io=require(_0xe2f2('0x11'))(new Redis(config[_0xe2f2('0xe')]));var Sequence=function(){};Sequence[_0xe2f2('0x12')][_0xe2f2('0x13')]=function(_0x167675){this[_0xe2f2('0x14')]=this[_0xe2f2('0x14')]?this[_0xe2f2('0x14')][_0xe2f2('0x15')](_0x167675):_0x167675();};function Preview(_0x3fc04e){this[_0xe2f2('0x16')]=new Sequence();this['campaignsPreview']=_0x3fc04e[_0xe2f2('0x17')];this[_0xe2f2('0x18')]=_0x3fc04e[_0xe2f2('0x18')];this[_0xe2f2('0x19')]={};this[_0xe2f2('0x1a')]=_0x3fc04e[_0xe2f2('0x1a')];this[_0xe2f2('0x1b')]=0x0;ami['on']('originateresponse',this[_0xe2f2('0x1c')]['bind'](this));ami['on'](_0xe2f2('0x1d'),this[_0xe2f2('0x1e')]['bind'](this));ami['on']('hanguprequest',this[_0xe2f2('0x1f')]['bind'](this));ami['on']('dialend',this[_0xe2f2('0x20')][_0xe2f2('0x21')](this));ami['on'](_0xe2f2('0x22'),this['syncNewExten'][_0xe2f2('0x21')](this));ami['on'](_0xe2f2('0x23'),this['syncVarSet'][_0xe2f2('0x21')](this));ami['on'](_0xe2f2('0x24'),this[_0xe2f2('0x25')][_0xe2f2('0x21')](this));ami['on'](_0xe2f2('0x26'),this['syncBlindTransfer'][_0xe2f2('0x21')](this));this[_0xe2f2('0x27')](this[_0xe2f2('0x28')]);}function emit(_0x50a365,_0x29f4fb,_0x3dd7b0){io['to'](_0x50a365)[_0xe2f2('0x29')](_0x29f4fb,_0x3dd7b0);}function emitCampaignPreview(_0xa13e99){if(_0xa13e99['type']===_0xe2f2('0x2a')){var _0x24027a={'id':_0xa13e99['id'],'name':_0xa13e99[_0xe2f2('0x2b')],'strategy':_0xa13e99[_0xe2f2('0x2c')],'answered':_0xa13e99[_0xe2f2('0x2d')],'available':_0xa13e99[_0xe2f2('0x2e')],'loggedIn':_0xa13e99[_0xe2f2('0x2f')],'pTalking':_0xa13e99[_0xe2f2('0x30')],'sumBillable':_0xa13e99[_0xe2f2('0x31')],'sumDuration':_0xa13e99[_0xe2f2('0x32')],'sumHoldTime':_0xa13e99[_0xe2f2('0x33')]||0x0,'talking':_0xa13e99[_0xe2f2('0x34')],'total':_0xa13e99[_0xe2f2('0x35')],'type':_0xa13e99[_0xe2f2('0x36')],'unmanaged':_0xa13e99[_0xe2f2('0x37')],'abandoned':_0xa13e99[_0xe2f2('0x38')],'waiting':_0xa13e99[_0xe2f2('0x39')],'loggedInDb':_0xa13e99[_0xe2f2('0x3a')],'dialActive':_0xa13e99['dialActive'],'dialMethod':_0xa13e99[_0xe2f2('0x3b')],'dialOriginateCallerIdName':_0xa13e99[_0xe2f2('0x3c')],'dialOriginateCallerIdNumber':_0xa13e99['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0xa13e99[_0xe2f2('0x3d')],'dialPrefix':_0xa13e99['dialPrefix'],'outboundAnswerAgiCallsDay':_0xa13e99[_0xe2f2('0x3e')],'outboundAnswerCallsDay':_0xa13e99[_0xe2f2('0x3f')],'outboundBlacklistCallsDay':_0xa13e99[_0xe2f2('0x40')],'outboundBusyCallsDay':_0xa13e99[_0xe2f2('0x41')],'outboundCongestionCallsDay':_0xa13e99['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0xa13e99['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0xa13e99[_0xe2f2('0x42')],'outboundDropCallsDayTimeout':_0xa13e99[_0xe2f2('0x43')],'outboundNoAnswerCallsDay':_0xa13e99[_0xe2f2('0x44')],'outboundNoSuchCallsDay':_0xa13e99[_0xe2f2('0x45')],'outboundOriginateFailureCallsDay':_0xa13e99[_0xe2f2('0x46')],'outboundReCallsDay':_0xa13e99['outboundReCallsDay'],'outboundRejectCallsDay':_0xa13e99[_0xe2f2('0x47')],'outboundUnknownCallsDay':_0xa13e99[_0xe2f2('0x48')],'predictiveIntervalAnsweredCalls':_0xa13e99[_0xe2f2('0x49')],'predictiveIntervalAvgHoldtime':_0xa13e99[_0xe2f2('0x4a')],'predictiveIntervalAvgTalktime':_0xa13e99[_0xe2f2('0x4b')],'predictiveIntervalDroppedCallsCallersExit':_0xa13e99[_0xe2f2('0x4c')],'predictiveIntervalDroppedCallsTimeout':_0xa13e99[_0xe2f2('0x4d')],'predictiveIntervalErlangCalls':_0xa13e99['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0xa13e99['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0xa13e99[_0xe2f2('0x4e')],'predictiveIntervalMultiplicativeFactor':_0xa13e99[_0xe2f2('0x4f')],'predictiveIntervalPauses':_0xa13e99[_0xe2f2('0x50')],'predictiveIntervalAvailable':_0xa13e99[_0xe2f2('0x51')],'predictiveIntervalTotalCalls':_0xa13e99[_0xe2f2('0x52')],'message':_0xa13e99[_0xe2f2('0x53')],'originated':_0xa13e99['originated'],'erlangCalls':_0xa13e99[_0xe2f2('0x54')],'erlangCallToSecond':_0xa13e99[_0xe2f2('0x55')],'erlangAbandonmentRate':_0xa13e99[_0xe2f2('0x56')],'erlangBusyFactor':_0xa13e99[_0xe2f2('0x57')],'startPredictive':_0xa13e99[_0xe2f2('0x58')],'startProgressive':_0xa13e99[_0xe2f2('0x59')]};if(_0xa13e99['Trunk']){_0x24027a[_0xe2f2('0x5a')]={'id':_0xa13e99[_0xe2f2('0x5a')]['id'],'name':_0xa13e99[_0xe2f2('0x5a')]['name'],'active':_0xa13e99[_0xe2f2('0x5a')][_0xe2f2('0x5b')],'callerid':_0xa13e99[_0xe2f2('0x5a')]['callerid']};}if(_0xa13e99['Interval']){_0x24027a['Interval']={'id':_0xa13e99['Interval']['id'],'name':_0xa13e99['Interval'][_0xe2f2('0x2b')]};}var _0x523213=md5(JSON[_0xe2f2('0x5c')](_0x24027a));if(_0xa13e99[_0xe2f2('0x4')]!==_0x523213){_0xa13e99[_0xe2f2('0x4')]=_0x523213;emit(util['format']('voice:queue:%s',_0x24027a[_0xe2f2('0x2b')]),'voice_queue:save',_0x24027a);}}}function emitVoiceQueueChannelRemove(_0x2b70b8){emit(util[_0xe2f2('0x5d')](_0xe2f2('0x5e'),_0x2b70b8[_0xe2f2('0x2b')]),_0xe2f2('0x5f'),_0x2b70b8);}function notSendMessagesQueue(_0x5c59de){if(_0x5c59de[_0xe2f2('0x60')]){if(_0x5c59de['originated']===0x0&&_0x5c59de[_0xe2f2('0x30')]===0x0){_0x5c59de[_0xe2f2('0x60')]=![];_0x5c59de['available']=0x0;_0x5c59de[_0xe2f2('0x61')]=0x0;_0x5c59de['message']=_0xe2f2('0x62');ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x5c59de[_0xe2f2('0x2b')]+_0xe2f2('0x63'));}else{_0x5c59de[_0xe2f2('0x53')]=_0xe2f2('0x64');ut[_0xe2f2('0x65')](_0xe2f2('0x66'),_0x5c59de['name']+_0xe2f2('0x67'));}emitCampaignPreview(_0x5c59de);}}Preview[_0xe2f2('0x12')][_0xe2f2('0x27')]=function(){var _0x226ddf=this;setInterval(function(){_0x226ddf[_0xe2f2('0x68')]();},0x7cf);};Preview['prototype'][_0xe2f2('0x68')]=function(){var _0x59fc43=this[_0xe2f2('0x28')];this['clockClearZombieChannels']+=0x1;for(var _0x5d7fdb in _0x59fc43){if(_0x59fc43[_0xe2f2('0x69')](_0x5d7fdb)&&(_0x59fc43[_0x5d7fdb]['dialMethod']===_0xe2f2('0x8')||_0x59fc43[_0x5d7fdb][_0xe2f2('0x3b')]==='booked')&&_0x59fc43[_0x5d7fdb][_0xe2f2('0x36')]===_0xe2f2('0x2a')){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this[_0xe2f2('0x6a')]();}}if(_0x59fc43[_0xe2f2('0x69')](_0x5d7fdb)&&_0x59fc43[_0x5d7fdb][_0xe2f2('0x3b')]===_0xe2f2('0x8')&&_0x59fc43[_0x5d7fdb][_0xe2f2('0x36')]===_0xe2f2('0x2a')){if(_0x59fc43[_0x5d7fdb]['dialActive']){this['setMessage'](_0x59fc43[_0x5d7fdb]);this[_0xe2f2('0x6b')](_0x59fc43[_0x5d7fdb]);}else{notSendMessagesQueue(_0x59fc43[_0x5d7fdb]);}}}};Preview[_0xe2f2('0x12')][_0xe2f2('0x6c')]=function(_0x141b59){var _0x22fd2b=this;this['sequence']['enqueue'](function(){if(!_['isNil'](_0x22fd2b[_0xe2f2('0x19')][_0x141b59])){loggerAction[_0xe2f2('0x6d')]('[clearZombieChannels][talking]',_0x141b59,'Queue',_0x22fd2b[_0xe2f2('0x19')][_0x141b59]['queue'],_0xe2f2('0x6e'),JSON[_0xe2f2('0x5c')](_0x22fd2b['campaignsPreview'][_0x22fd2b[_0xe2f2('0x19')][_0x141b59][_0xe2f2('0x6f')]][_0xe2f2('0x70')]),_0xe2f2('0x71'),JSON['stringify'](_0x22fd2b[_0xe2f2('0x28')][_0x22fd2b[_0xe2f2('0x19')][_0x141b59][_0xe2f2('0x6f')]]['pTalking']),JSON[_0xe2f2('0x5c')](_0x22fd2b['actions'][_0x141b59][_0xe2f2('0x72')]),JSON[_0xe2f2('0x5c')](_[_0xe2f2('0x73')](_0x22fd2b[_0xe2f2('0x19')][_0x141b59],[_0xe2f2('0x74'),'UserId',_0xe2f2('0x75'),_0xe2f2('0x76')])));return ami[_0xe2f2('0x77')]({'action':_0xe2f2('0x78'),'channel':_0x22fd2b[_0xe2f2('0x19')][_0x141b59][_0xe2f2('0x79')]})[_0xe2f2('0x7a')](function(_0x5c418){if(_0x5c418[_0xe2f2('0x53')]===_0xe2f2('0x7b')){setTimeout(function(){if(_0x22fd2b[_0xe2f2('0x19')][_0x141b59]){ut[_0xe2f2('0x7c')](_0x22fd2b[_0xe2f2('0x28')][_0x22fd2b[_0xe2f2('0x19')][_0x141b59][_0xe2f2('0x6f')]],_0xe2f2('0x7d'));if(_0x22fd2b[_0xe2f2('0x19')][_0x141b59][_0xe2f2('0x72')]===!![]){ut[_0xe2f2('0x7e')](_0x22fd2b['campaignsPreview'][_0x22fd2b[_0xe2f2('0x19')][_0x141b59]['queue']],_0xe2f2('0x7d'));ut[_0xe2f2('0x7f')](_0xe2f2('0x80')+_0x141b59,_0x22fd2b['actions'][_0x141b59][_0xe2f2('0x6f')]);}ut[_0xe2f2('0x7f')](_0xe2f2('0x81')+_0x141b59,_0x22fd2b[_0xe2f2('0x19')][_0x141b59][_0xe2f2('0x6f')]);delete _0x22fd2b['actions'][_0x141b59];}},0x2328);}});}});};Preview[_0xe2f2('0x12')][_0xe2f2('0x6a')]=function(){var _0x4f7220=this;loggerAction[_0xe2f2('0x6d')](_0xe2f2('0x82'),_['size'](this[_0xe2f2('0x19')]));for(var _0x3c13e6 in this[_0xe2f2('0x19')]){if(_0x4f7220[_0xe2f2('0x19')][_0xe2f2('0x69')](_0x3c13e6)){_0x4f7220[_0xe2f2('0x6c')](_0x3c13e6);}}};Preview[_0xe2f2('0x12')][_0xe2f2('0x6b')]=function(_0x5d961f){var _0x3a5b2e=this;rpcDb[_0xe2f2('0x83')](_0x5d961f['id'],ut['agentReadyId'](this[_0xe2f2('0x1a')]))[_0xe2f2('0x84')](function(_0x48dd5d){if(!_[_0xe2f2('0x85')](_0x48dd5d)){for(var _0x170a7d=0x0;_0x170a7d<_0x48dd5d[_0xe2f2('0x86')];_0x170a7d+=0x1){if(ut[_0xe2f2('0x87')](_0x48dd5d[_0x170a7d][_0xe2f2('0x88')])<_0x5d961f[_0xe2f2('0x89')]*0x3c){_0x3a5b2e['run'](_0x48dd5d[_0x170a7d]['id'])[_0xe2f2('0x84')](ut[_0xe2f2('0x8a')](_0xe2f2('0x8b')))[_0xe2f2('0x7a')](ut[_0xe2f2('0x8a')](_0xe2f2('0x8b')));}else{var _0x96562d=new Action(_0x48dd5d[_0x170a7d],_0x5d961f);_0x96562d[_0xe2f2('0x8c')]=moment()[_0xe2f2('0x5d')](_0xe2f2('0x8d'));_0x5d961f[_0xe2f2('0x8e')]+=0x1;ut[_0xe2f2('0x8f')](_0x96562d,0x17,_0xe2f2('0x90'));if(_0x5d961f['dialRecallInQueue']){rpcDb[_0xe2f2('0x91')](ut[_0xe2f2('0x92')](_0x48dd5d[_0x170a7d]));rpcDb[_0xe2f2('0x93')](_0x96562d,_0xe2f2('0x94'));}else{ut[_0xe2f2('0x8f')](_0x96562d,0x16,_0xe2f2('0x95'));rpcDb[_0xe2f2('0x93')](_0x96562d,_0xe2f2('0x96'));rpcDb['createCustomerFinal'](_0x96562d,'[HistoryRecallClose]');}}}}})[_0xe2f2('0x7a')](ut[_0xe2f2('0x8a')](_0xe2f2('0x97')));};Preview[_0xe2f2('0x12')][_0xe2f2('0x98')]=function(_0x54a574){_0x54a574[_0xe2f2('0x60')]=!![];if(ut[_0xe2f2('0x99')](_0x54a574[_0xe2f2('0x2f')])){_0x54a574[_0xe2f2('0x53')]='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x54a574[_0xe2f2('0x9a')])){_0x54a574[_0xe2f2('0x53')]='NOT_ACTIVE';}else if(!this['isTrunkReachable'](_0x54a574['Trunk'])){if(!this[_0xe2f2('0x9b')](_0x54a574['TrunkBackup'])){_0x54a574[_0xe2f2('0x53')]=_0xe2f2('0x9c');}else{_0x54a574[_0xe2f2('0x53')]='ACTIVE';}}else{_0x54a574['message']=_0xe2f2('0x9d');}emitCampaignPreview(_0x54a574);};Preview[_0xe2f2('0x12')][_0xe2f2('0x9e')]=function(_0x102161,_0x3ea9c4,_0x5dd505){var _0x4b9d4a=this;var _0x3020d2=this[_0xe2f2('0x19')][_0x3ea9c4];var _0x3f85a7=this['campaignsPreview'][_0x3020d2[_0xe2f2('0x6f')]];var _0x592b21;if(_0x3f85a7){switch(_0x5dd505){case'1':_0x3f85a7[_0xe2f2('0x45')]+=0x1;_0x3020d2[_0xe2f2('0x9f')]=ut[_0xe2f2('0xa0')](_0x3020d2);ut[_0xe2f2('0x8f')](_0x3020d2,0x0,_0xe2f2('0xa1'));rpcDb['createCustomerHistory'](_0x3020d2,_0xe2f2('0xa2'));if(ut[_0xe2f2('0xa0')](_0x3020d2)>=_0x3f85a7[_0xe2f2('0xa3')]){_0x592b21=ut[_0xe2f2('0xa4')](_0x3020d2,0xf,'Global');rpcDb['createCustomerFinal'](_0x592b21,_0xe2f2('0xa5'));}else{rpcDb['createCustomerFinal'](_0x3020d2,'[callProgressDetectingCustomer][logNoSuchGlobal]');}delete this['actions'][_0x102161['linkedid']];break;case _0xe2f2('0xa6'):var _0x5e13c7=moment()[_0xe2f2('0x5d')](_0xe2f2('0x8d'));_0x3020d2[_0xe2f2('0xa7')]=_0x5e13c7;_0x3020d2[_0xe2f2('0xa8')]=_0x5e13c7;_0x3020d2['dialAnswer']=!![];_0x3f85a7[_0xe2f2('0x30')]+=0x1;logger[_0xe2f2('0x6d')](_0xe2f2('0xa9'),_0x3020d2[_0xe2f2('0xaa')],_0xe2f2('0xab'),_0x3f85a7['name'],_0xe2f2('0x71'),_0x3f85a7['pTalking']);ami[_0xe2f2('0x29')]('custom:agentconnect',ut['buildObj'](_0x3020d2,'connect'));if(_0x3f85a7['acw']){ami[_0xe2f2('0x29')](_0xe2f2('0xac'),ut[_0xe2f2('0xad')](_0x3020d2));}break;case'16':ami[_0xe2f2('0x29')](_0xe2f2('0xae'),ut[_0xe2f2('0xaf')](_0x3020d2,'complete'));emitVoiceQueueChannelRemove(ut[_0xe2f2('0xaf')](_0x3020d2,_0xe2f2('0xb0')));_0x3f85a7[_0xe2f2('0x3f')]+=0x1;_0x3f85a7[_0xe2f2('0x35')]+=0x1;_0x3f85a7[_0xe2f2('0x2d')]+=0x1;ut[_0xe2f2('0x7e')](_0x3f85a7,'[16]');_0x3020d2[_0xe2f2('0x9f')]=ut[_0xe2f2('0xa0')](_0x3020d2);ut[_0xe2f2('0x8f')](_0x3020d2,0x4,_0xe2f2('0xb1'));rpcDb['createCustomerHistory'](_0x3020d2,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xe2f2('0xb2')](_0x3020d2,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xe2f2('0xb3')](_0x3020d2);_0x3f85a7[_0xe2f2('0x32')]+=_0x3020d2['talktime'];_0x3f85a7[_0xe2f2('0x31')]+=_0x3020d2['talktime'];logger['info'](_0xe2f2('0xb4'),_0x3020d2['uniqueid'],_0xe2f2('0xab'),_0x3f85a7['name'],'pTalking:\x20',_0x3f85a7[_0xe2f2('0x30')]);delete this[_0xe2f2('0x19')][_0x102161[_0xe2f2('0xb5')]];break;case'BUSY':_0x3f85a7[_0xe2f2('0x41')]+=0x1;_0x3020d2[_0xe2f2('0xb6')]+=0x1;_0x3020d2[_0xe2f2('0x9f')]=ut[_0xe2f2('0xa0')](_0x3020d2);ut['logCustomer'](_0x3020d2,0x5,_0xe2f2('0xb7'));rpcDb[_0xe2f2('0x93')](_0x3020d2,'[callProgressDetectingCustomer][logBusy]');if(ut[_0xe2f2('0xa0')](_0x3020d2)>=_0x3f85a7['dialGlobalMaxRetry']){_0x592b21=ut['cloneAction'](_0x3020d2,0xf,'Global');rpcDb[_0xe2f2('0xb2')](_0x592b21,_0xe2f2('0xb8'));}else{if(_0x3020d2[_0xe2f2('0xb6')]>=_0x3f85a7[_0xe2f2('0xb9')]){rpcDb[_0xe2f2('0xb2')](_0x3020d2,_0xe2f2('0xba'));}else{rpcDb[_0xe2f2('0xbb')](ut['scheduledAt'](_0x3020d2,_0xe2f2('0xb6'),_0x3f85a7[_0xe2f2('0xbc')]),_0x3020d2[_0xe2f2('0xbd')],_0x3020d2[_0xe2f2('0xbe')]);}}break;case'NOANSWER':_0x3f85a7[_0xe2f2('0x44')]+=0x1;_0x3020d2[_0xe2f2('0xbf')]+=0x1;_0x3020d2[_0xe2f2('0x9f')]=ut[_0xe2f2('0xa0')](_0x3020d2);ut[_0xe2f2('0x8f')](_0x3020d2,0x3,_0xe2f2('0xc0'));rpcDb[_0xe2f2('0x93')](_0x3020d2,_0xe2f2('0xc1'));if(ut[_0xe2f2('0xa0')](_0x3020d2)>=_0x3f85a7[_0xe2f2('0xa3')]){_0x592b21=ut['cloneAction'](_0x3020d2,0xf,_0xe2f2('0xc2'));rpcDb[_0xe2f2('0xb2')](_0x592b21,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x3020d2[_0xe2f2('0xbf')]>=_0x3f85a7[_0xe2f2('0xc3')]){rpcDb['createCustomerFinal'](_0x3020d2,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xe2f2('0xbb')](ut[_0xe2f2('0xc4')](_0x3020d2,_0xe2f2('0xbf'),_0x3f85a7['dialNoAnswerRetryFrequency']),_0x3020d2[_0xe2f2('0xbd')],_0x3020d2[_0xe2f2('0xbe')]);}}break;case _0xe2f2('0xc5'):_0x3f85a7[_0xe2f2('0xc6')]+=0x1;_0x3020d2[_0xe2f2('0xc7')]+=0x1;_0x3020d2[_0xe2f2('0x9f')]=ut[_0xe2f2('0xa0')](_0x3020d2);ut[_0xe2f2('0x8f')](_0x3020d2,0x8,_0xe2f2('0xc8'));rpcDb[_0xe2f2('0x93')](_0x3020d2,'[callProgressDetectingCustomer][logCongestion]');if(ut['totalGlobal'](_0x3020d2)>=_0x3f85a7[_0xe2f2('0xa3')]){_0x592b21=ut[_0xe2f2('0xa4')](_0x3020d2,0xf,'Global');rpcDb[_0xe2f2('0xb2')](_0x592b21,_0xe2f2('0xc9'));}else{if(_0x3020d2['countcongestionretry']>=_0x3f85a7[_0xe2f2('0xca')]){rpcDb[_0xe2f2('0xb2')](_0x3020d2,_0xe2f2('0xcb'));}else{rpcDb[_0xe2f2('0xbb')](ut[_0xe2f2('0xc4')](_0x3020d2,_0xe2f2('0xc7'),_0x3f85a7[_0xe2f2('0xbc')]),_0x3020d2[_0xe2f2('0xbd')],_0x3020d2[_0xe2f2('0xbe')]);}}break;case _0xe2f2('0xcc'):_0x3f85a7['outboundRejectCallsDay']+=0x1;_0x3020d2[_0xe2f2('0x9f')]=ut[_0xe2f2('0xa0')](_0x3020d2);ut[_0xe2f2('0x8f')](_0x3020d2,0x14,'AgentReject');rpcDb['createCustomerHistory'](_0x3020d2,'[syncHangupRequest][logAgentReject]');if(_0x3020d2['unlockAgent']){rpcDb[_0xe2f2('0xcd')](_0x3020d2[_0xe2f2('0xce')]);}if(_0x3020d2[_0xe2f2('0xbe')]){rpcDb[_0xe2f2('0xcf')](_0x3020d2[_0xe2f2('0xce')]);}break;default:if(_0x3020d2[_0xe2f2('0x72')]){ut[_0xe2f2('0x7e')](_0x3f85a7,_0xe2f2('0xd0'));ut[_0xe2f2('0x7f')](_0xe2f2('0xd1')+_0x3f85a7['name'],_0x102161);}_0x3f85a7['outboundUnknownCallsDay']+=0x1;_0x3020d2['countglobal']=ut['totalGlobal'](_0x3020d2);ut[_0xe2f2('0x8f')](_0x3020d2,0xc,_0x102161['cause-txt']||_0x102161[_0xe2f2('0xd2')]);rpcDb['createCustomerHistory'](_0x3020d2,_0xe2f2('0xd3'));if(ut[_0xe2f2('0xa0')](_0x3020d2)>=_0x3f85a7[_0xe2f2('0xa3')]){_0x592b21=ut[_0xe2f2('0xa4')](_0x3020d2,0xf,_0xe2f2('0xc2'));rpcDb[_0xe2f2('0xb2')](_0x592b21,_0xe2f2('0xd4'));}else{rpcDb['createCustomerFinal'](_0x3020d2,_0xe2f2('0xd4'));}delete this[_0xe2f2('0x19')][_0x102161[_0xe2f2('0xb5')]];}if(!(_0x3020d2[_0xe2f2('0x72')]&&_0x5dd505==='16')){ut['updateOriginated'](_0x3f85a7,_0xe2f2('0xd5'));logger[_0xe2f2('0x6d')](_0xe2f2('0xd6'),_0x3020d2['uniqueid'],'\x20Queue',_0x3f85a7[_0xe2f2('0x2b')],_0xe2f2('0x6e'),_0x3f85a7[_0xe2f2('0x70')]);}if(_0x5dd505!==_0xe2f2('0xa6')){delete this[_0xe2f2('0x19')][_0x102161[_0xe2f2('0xb5')]];delete this[_0xe2f2('0x19')][_0x102161[_0xe2f2('0xd7')]];}}};Preview[_0xe2f2('0x12')][_0xe2f2('0xd8')]=function(_0x5e7899,_0xc763bc,_0x4c4016){if(_[_0xe2f2('0xd9')](_0xc763bc)&&_0xe2f2('0xda')!==typeof _0xc763bc){return;}if(_['isUndefined'](_0x4c4016)&&'object'!==typeof _0x4c4016){return;}switch(_0x4c4016[_0xe2f2('0xdb')]){case'0':ut[_0xe2f2('0xdc')](_0x5e7899,0x0,'NoSuchNumber');rpcDb[_0xe2f2('0xdd')](_0x5e7899,_0xe2f2('0xde'));break;case'3':ut[_0xe2f2('0xdc')](_0x5e7899,0x3,_0xe2f2('0xc0'));rpcDb[_0xe2f2('0xdd')](_0x5e7899,_0xe2f2('0xdf'));break;case'5':ut[_0xe2f2('0xdc')](_0x5e7899,0x5,_0xe2f2('0xb7'));rpcDb['createAgentHistory'](_0x5e7899,_0xe2f2('0xe0'));break;case'8':ut[_0xe2f2('0xdc')](_0x5e7899,0x8,_0xe2f2('0xc8'));rpcDb[_0xe2f2('0xdd')](_0x5e7899,_0xe2f2('0xe1'));break;case'22':ut[_0xe2f2('0xdc')](_0x5e7899,0x16,'AnswerAGI');rpcDb[_0xe2f2('0xdd')](_0x5e7899,_0xe2f2('0xe2'));break;default:ut[_0xe2f2('0xdc')](_0x5e7899,0xc,_0x4c4016[_0xe2f2('0xdb')]);rpcDb[_0xe2f2('0xdd')](_0x5e7899,_0xe2f2('0xe1'));}ut[_0xe2f2('0x7c')](_0xc763bc,_0xe2f2('0xe3'));logger['info'](_0xe2f2('0xe4'),_0x5e7899[_0xe2f2('0xaa')],_0xe2f2('0xab'),_0xc763bc[_0xe2f2('0x2b')],_0xe2f2('0x6e'),_0xc763bc[_0xe2f2('0x70')]);delete this[_0xe2f2('0x19')][_0x5e7899[_0xe2f2('0xaa')]];};Preview['prototype'][_0xe2f2('0xe5')]=function(_0x5ba9ec,_0x2bed68,_0x1e1063,_0x1b8924,_0x2631e7){var _0x56c22f=this;return new BPromise(function(_0x3a518f,_0x2b9790){if(_[_0xe2f2('0x85')](_0x2bed68)||_[_0xe2f2('0x85')](_0x2bed68[_0xe2f2('0xe6')])||_['isNil'](_0x2bed68[_0xe2f2('0xe6')][_0xe2f2('0xe7')])||_[_0xe2f2('0x85')](_0x2bed68[_0xe2f2('0x75')])){_0x2b9790(ut['message'](_0xe2f2('0xe8'),_0x1b8924,_0x2631e7));return;}var _0x2095c9=uuid['v4']();var _0x35e15c=_0x56c22f[_0xe2f2('0x28')][_0x2bed68[_0xe2f2('0xe9')]['name']];var _0x313605=_0x1e1063?_0x56c22f['agents'][_0x1e1063]['id']:undefined;_0x56c22f[_0xe2f2('0x19')][_0x2095c9]=new Action(_0x2bed68,_0x35e15c,_0x2095c9,_0x1e1063,_0x313605);var _0x1ff17b=_0x56c22f['actions'][_0x2095c9];_0x1ff17b[_0xe2f2('0xbd')]=_0x1b8924;_0x1ff17b[_0xe2f2('0xbe')]=_0x2631e7;_0x1ff17b[_0xe2f2('0xea')]=_0x1e1063;if(_[_0xe2f2('0xeb')](_0x5ba9ec)){_0x56c22f[_0xe2f2('0xec')](_0x1ff17b,_0x35e15c,_0x2bed68,_0x1e1063)['then'](function(_0x241574){logger['info'](_0xe2f2('0xed'),_0xe2f2('0xee')+_0x1ff17b[_0xe2f2('0x6f')]+'\x20IdHopper:\x20'+_0x1ff17b[_0xe2f2('0xce')],JSON[_0xe2f2('0x5c')](_0x241574));ami[_0xe2f2('0x29')](_0xe2f2('0xef'),ut[_0xe2f2('0xaf')](_0x1ff17b,_0xe2f2('0xf0')));_0x3a518f(ut['message'](_0xe2f2('0xf1')));})[_0xe2f2('0x7a')](function(_0x10e609){ut[_0xe2f2('0x65')](_0xe2f2('0xf2'),_0x10e609);_0x2b9790(ut[_0xe2f2('0x53')](_0xe2f2('0xf3'),_0x1b8924,_0x2631e7));});}else{_0x35e15c['outboundBlacklistCallsDay']+=0x1;ut['logBlacklist'](_0x1ff17b);rpcDb[_0xe2f2('0xf4')](_0x1ff17b,'[Blacklist][error]');delete _0x56c22f['actions'][_0x2095c9];_0x2b9790(ut[_0xe2f2('0x53')](_0xe2f2('0xf5'),_0x1b8924,_0x2631e7));}});};Preview[_0xe2f2('0x12')][_0xe2f2('0x9b')]=function(_0x2864cd){return!_[_0xe2f2('0x85')](_0x2864cd)&&!_[_0xe2f2('0x85')](_0x2864cd['name'])&&!_[_0xe2f2('0x85')](_0x2864cd[_0xe2f2('0x5b')])&&_0x2864cd['active']&&!_['isNil'](this['trunks'][util[_0xe2f2('0x5d')]('SIP/%s',_0x2864cd[_0xe2f2('0x2b')])])&&!_[_0xe2f2('0x85')](this[_0xe2f2('0x18')][util['format']('SIP/%s',_0x2864cd[_0xe2f2('0x2b')])][_0xe2f2('0x78')])&&(this[_0xe2f2('0x18')][util[_0xe2f2('0x5d')](_0xe2f2('0xf6'),_0x2864cd[_0xe2f2('0x2b')])][_0xe2f2('0x78')]===_0xe2f2('0xf7')||this[_0xe2f2('0x18')][util[_0xe2f2('0x5d')](_0xe2f2('0xf6'),_0x2864cd[_0xe2f2('0x2b')])][_0xe2f2('0x78')]===_0xe2f2('0xf8'));};Preview[_0xe2f2('0x12')][_0xe2f2('0xf9')]=function(_0x492270,_0x25bfb8){var _0x151970=this;return new BPromise(function(_0x5239f5,_0x2503d7){_0x151970[_0xe2f2('0xfa')](_0x492270,_0x25bfb8)[_0xe2f2('0x84')](function(_0x438956){_0x5239f5(_[_0xe2f2('0x73')](_0x438956,[_0xe2f2('0x53')]));})[_0xe2f2('0x7a')](function(_0x2db872){if(_0x2db872[_0xe2f2('0xfb')]){rpcDb[_0xe2f2('0xcd')](_0x492270);}if(_0x2db872['active']){rpcDb[_0xe2f2('0xcf')](_0x492270);}_0x2503d7(_[_0xe2f2('0x73')](_0x2db872,[_0xe2f2('0x53')]));});});};Preview[_0xe2f2('0x12')][_0xe2f2('0xfa')]=function(_0x30094e,_0x3b9301){var _0x4d6f41=this;return new BPromise(function(_0x5cfdff,_0x346ddb){var _0x52b30c,_0x3ce5df;rpcDb['getContactPreview'](_0x30094e)[_0xe2f2('0x84')](function(_0x31ce33){if(!_[_0xe2f2('0x85')](_0x31ce33[0x0])){_0x3ce5df=_0x31ce33[0x0]['recallme']?![]:!![];_0x52b30c=_0x31ce33[0x0][_0xe2f2('0xfc')]?!![]:![];_0x52b30c=_0x3b9301?!![]:_0x52b30c;}var _0x3ec435=_0x4d6f41[_0xe2f2('0xfd')](_0x31ce33);if(_0x3ec435[_0xe2f2('0xfe')]){rpcDb['checkIsBlackList'](_[_0xe2f2('0x73')](_0x31ce33[0x0],[_0xe2f2('0x75'),_0xe2f2('0xff')]))[_0xe2f2('0x84')](function(_0x8f08c0){_0x4d6f41[_0xe2f2('0xe5')](_0x8f08c0,_0x31ce33[0x0],_0x3b9301,_0x3ce5df,_0x52b30c)[_0xe2f2('0x84')](function(_0x17404b){_0x5cfdff(_0x17404b);})[_0xe2f2('0x7a')](function(_0x599dd4){_0x346ddb(_0x599dd4);});})[_0xe2f2('0x7a')](function(_0x58d5aa){ut[_0xe2f2('0x65')]('[Preview][checkIsBlackList]',_0x58d5aa);_0x346ddb(ut[_0xe2f2('0x53')](_0xe2f2('0x100'),_0x3ce5df,_0x52b30c));});}else{_0x346ddb(ut[_0xe2f2('0x53')](_0x3ec435[_0xe2f2('0x53')],_0x3ce5df,_0x52b30c));}})[_0xe2f2('0x7a')](function(_0x53d7bf){ut['logger'](_0xe2f2('0x101'),_0x53d7bf);_0x346ddb(ut[_0xe2f2('0x53')](_0xe2f2('0x100'),![],!![]));});});};Preview[_0xe2f2('0x12')]['validateContact']=function(_0x2e5ca0){if(_['isNil'](_0x2e5ca0)||_[_0xe2f2('0xeb')](_0x2e5ca0)||!_['isNil'](_0x2e5ca0[0x0][_0xe2f2('0x102')])&&_[_0xe2f2('0x85')](_0x2e5ca0[0x0]['Agent'][_0xe2f2('0x2b')])){ut['logger'](_0xe2f2('0x103'),_0x2e5ca0);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x14ccff=this[_0xe2f2('0x28')][_0x2e5ca0[0x0]['Queue'][_0xe2f2('0x2b')]];_0x14ccff[_0xe2f2('0x53')]='ACTIVE';if(_[_0xe2f2('0x85')](_0x14ccff)){ut[_0xe2f2('0x65')]('[Preview][validateContact][Empty\x20Campaign]',_0x14ccff);return{'isValid':![],'message':_0xe2f2('0x104')};}if(!this[_0xe2f2('0x9b')](_0x14ccff['Trunk'])){ut['logger'](_0xe2f2('0x105'),_0xe2f2('0x106')+_0x14ccff['name']+_0xe2f2('0x107'));if(!this[_0xe2f2('0x9b')](_0x14ccff['TrunkBackup'])){ut[_0xe2f2('0x65')](_0xe2f2('0x105'),_0x14ccff[_0xe2f2('0x2b')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xe2f2('0x108')};}}if(!ut[_0xe2f2('0x109')](_0x14ccff[_0xe2f2('0x9a')])){ut[_0xe2f2('0x65')](_0xe2f2('0x10a'),_0x14ccff[_0xe2f2('0x2b')]+_0xe2f2('0x10b'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x14ccff[_0xe2f2('0x2b')]+_0xe2f2('0x10b')};}return{'isValid':!![],'message':_0xe2f2('0x10c')};};Preview[_0xe2f2('0x12')][_0xe2f2('0xec')]=function(_0x1b54ef,_0x55af4b,_0x5efa67,_0x1d216a){var _0x348fba=this;return new BPromise(function(_0x1e8a9a,_0x49389b){var _0x36b6af=_0x1b54ef['uniqueid'];var _0x1e5989=_0x348fba[_0xe2f2('0x9b')](_0x55af4b[_0xe2f2('0x5a')])?util['format'](_0xe2f2('0x10d'),_0x55af4b[_0xe2f2('0x5a')][_0xe2f2('0x2b')],_[_0xe2f2('0x85')](_0x55af4b[_0xe2f2('0x10e')])?'':_0x55af4b[_0xe2f2('0x10e')][_0xe2f2('0x10f')]()||'',_0x55af4b[_0xe2f2('0x110')]>0x0?_0x5efa67[_0xe2f2('0xe6')][_0xe2f2('0xe7')][_0xe2f2('0x111')](_0x55af4b[_0xe2f2('0x110')]):_0x5efa67[_0xe2f2('0xe6')]['phone']):util[_0xe2f2('0x5d')](_0xe2f2('0x10d'),_['isNil'](_0x55af4b[_0xe2f2('0x112')])?_0x55af4b[_0xe2f2('0x5a')][_0xe2f2('0x2b')]:_0x55af4b[_0xe2f2('0x112')][_0xe2f2('0x2b')],_['isNil'](_0x55af4b[_0xe2f2('0x10e')])?'':_0x55af4b['dialPrefix']['trim']()||'',_0x55af4b[_0xe2f2('0x110')]>0x0?_0x5efa67[_0xe2f2('0xe6')]['phone'][_0xe2f2('0x111')](_0x55af4b[_0xe2f2('0x110')]):_0x5efa67[_0xe2f2('0xe6')][_0xe2f2('0xe7')]);var _0xfaf324=_0x348fba['isTrunkReachable'](_0x55af4b[_0xe2f2('0x5a')])?ut[_0xe2f2('0x113')](_0x55af4b[_0xe2f2('0x5a')]['callerid'],_0x55af4b[_0xe2f2('0x3c')],_0x55af4b[_0xe2f2('0x114')]>0x0?ut['getCallerIdRandom'](_0x55af4b['dialOriginateCallerIdNumber'],_0x55af4b[_0xe2f2('0x114')]):_0x55af4b[_0xe2f2('0x115')]):ut[_0xe2f2('0x113')](_[_0xe2f2('0x85')](_0x55af4b['TrunkBackup'])?_0x55af4b['Trunk']['callerid']:_0x55af4b[_0xe2f2('0x112')][_0xe2f2('0x116')],_0x55af4b[_0xe2f2('0x3c')],_0x55af4b[_0xe2f2('0x114')]>0x0?ut['getCallerIdRandom'](_0x55af4b[_0xe2f2('0x115')],_0x55af4b[_0xe2f2('0x114')]):_0x55af4b['dialOriginateCallerIdNumber']);if(_0xfaf324){_0x1b54ef[_0xe2f2('0x117')]=ut[_0xe2f2('0x118')](_0xfaf324);_0x1b54ef[_0xe2f2('0x119')]=ut[_0xe2f2('0x11a')](_0xfaf324);}var _0x5f1df3=ut[_0xe2f2('0x11b')](_0x55af4b,_0x5efa67,_0x1e5989,_0xfaf324,_0x36b6af,_0x1b54ef);_[_0xe2f2('0x11c')](_0x1b54ef,ut['toLowerVariables'](_0x5f1df3));_0x1b54ef['starttime']=moment()[_0xe2f2('0x5d')](_0xe2f2('0x8d'));ami['Action'](ut[_0xe2f2('0x11d')](_0x1b54ef,_0x55af4b,_0x5f1df3,_0x1b54ef[_0xe2f2('0xbe')],_0x1d216a))[_0xe2f2('0x84')](function(_0x5156e9){_0x55af4b[_0xe2f2('0x70')]+=0x1;logger[_0xe2f2('0x6d')](_0xe2f2('0x11e'),_0x36b6af,_0xe2f2('0xab'),_0x55af4b[_0xe2f2('0x2b')],'originated:\x20',_0x55af4b[_0xe2f2('0x70')]);_0x1e8a9a(_0x5156e9);})['catch'](function(_0x284547){ut[_0xe2f2('0xdc')](_0x1b54ef,0xe,_0xe2f2('0x11f'));rpcDb[_0xe2f2('0xdd')](_0x1b54ef,'[originateFailure][logOriginateFailure]');_0x49389b(_0x284547);});});};Preview[_0xe2f2('0x12')]['syncNewExten']=function(_0x42b40d){if(this[_0xe2f2('0x19')][_0x42b40d[_0xe2f2('0xb5')]]){this[_0xe2f2('0x19')][_0x42b40d[_0xe2f2('0xb5')]][_0xe2f2('0x79')]=_0x42b40d[_0xe2f2('0x79')];}};Preview[_0xe2f2('0x12')]['syncOriginateResponse']=function(_0x41057c){var _0x301bb7=this;var _0x2b3c3b=this[_0xe2f2('0x19')][_0x41057c[_0xe2f2('0x120')]];if(_0x2b3c3b){if(_0x2b3c3b[_0xe2f2('0xea')]&&this['agents'][_0x2b3c3b['lookAgent']]){ut[_0xe2f2('0x121')](_0x2b3c3b,this['agents'][_0x2b3c3b[_0xe2f2('0xea')]][_0xe2f2('0x2b')],this[_0xe2f2('0x1a')][_0x2b3c3b['lookAgent']]['id']);}var _0x4e8a39=_['clone'](_0x2b3c3b);_0x4e8a39[_0xe2f2('0xa7')]=moment()[_0xe2f2('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4997af=_0x301bb7[_0xe2f2('0x28')][_0x2b3c3b[_0xe2f2('0x6f')]];if(ut['isFailure'](_0x41057c[_0xe2f2('0x122')])){if(_0x2b3c3b[_0xe2f2('0xbd')]){rpcDb[_0xe2f2('0xcd')](_0x2b3c3b[_0xe2f2('0xce')]);}if(_0x2b3c3b[_0xe2f2('0xbe')]){rpcDb[_0xe2f2('0xcf')](_0x2b3c3b[_0xe2f2('0xce')]);}ami['emit'](_0xe2f2('0x123'),ut[_0xe2f2('0xaf')](_0x2b3c3b,_0xe2f2('0x124')));this['callProgressDetectingAgent'](_0x4e8a39,_0x4997af,_0x41057c);}else{_0x2b3c3b[_0xe2f2('0x8c')]=moment()[_0xe2f2('0x5d')](_0xe2f2('0x8d'));ut['logAgent'](_0x4e8a39,0x4,_0xe2f2('0xb1'));rpcDb[_0xe2f2('0xdd')](_0x4e8a39,_0xe2f2('0x125'));}}};Preview['prototype'][_0xe2f2('0x1e')]=function(_0x218690){var _0x1a2ad1=this;var _0x2eb0fd=this[_0xe2f2('0x19')][_0x218690[_0xe2f2('0xb5')]];var _0x26f2ad;if(_0x2eb0fd){_0x26f2ad=this[_0xe2f2('0x28')][_0x2eb0fd[_0xe2f2('0x6f')]];logger[_0xe2f2('0x6d')]('[syncHangup][talking]',_0x218690[_0xe2f2('0xb5')],_0xe2f2('0xab'),_0x26f2ad[_0xe2f2('0x2b')],'pTalking:\x20',_0x26f2ad[_0xe2f2('0x30')]);}if(this[_0xe2f2('0x19')][_0x218690['linkedid']]&&_0x218690[_0xe2f2('0xb5')]!==_0x218690[_0xe2f2('0xaa')]){if(_0x218690['cause']==='16'&&this[_0xe2f2('0x19')][_0x218690['linkedid']][_0xe2f2('0x72')]){this[_0xe2f2('0x9e')](_0x218690,_0x218690[_0xe2f2('0xb5')],_0x218690[_0xe2f2('0x126')]);}else if(this[_0xe2f2('0x19')][_0x218690['linkedid']][_0xe2f2('0x72')]){logger[_0xe2f2('0x6d')](_0xe2f2('0x127'),_0x218690['linkedid'],_0x218690[_0xe2f2('0x126')],_0xe2f2('0xab'),_0x26f2ad[_0xe2f2('0x2b')],'pTalking:\x20',_0x26f2ad['pTalking']);this[_0xe2f2('0x9e')](_0x218690,_0x218690['linkedid'],_0x218690[_0xe2f2('0x126')]);}}else if(_0x2eb0fd&&_[_0xe2f2('0x85')](_0x2eb0fd[_0xe2f2('0x128')])&&_0x26f2ad[_0xe2f2('0x129')]&&_0x218690['linkedid']===_0x218690[_0xe2f2('0xaa')]&&_[_0xe2f2('0x85')](_0x218690[_0xe2f2('0xdb')])&&_0x218690[_0xe2f2('0x126')]==='16'&&_0x218690['channelstate']==='6'&&_[_0xe2f2('0xd9')](_0x2eb0fd[_0xe2f2('0x12a')])){if(_0x2eb0fd[_0xe2f2('0xbd')]){rpcDb['unlockContact'](_0x2eb0fd[_0xe2f2('0xce')]);}if(_0x2eb0fd['activeContact']){rpcDb[_0xe2f2('0xcf')](_0x2eb0fd[_0xe2f2('0xce')]);}_0x218690[_0xe2f2('0xdb')]='22';this[_0xe2f2('0xd8')](_0x2eb0fd,_0x26f2ad,_0x218690);}else if(_0x2eb0fd&&_0x2eb0fd[_0xe2f2('0x12a')]){if(_0x218690[_0xe2f2('0x126')]==='16'&&this[_0xe2f2('0x19')][_0x218690[_0xe2f2('0xb5')]]['dialAnswer']){logger[_0xe2f2('0x6d')](_0xe2f2('0x12b'),_0x218690['linkedid'],_0x218690['cause'],'\x20Queue',_0x26f2ad[_0xe2f2('0x2b')],'pTalking:\x20',_0x26f2ad[_0xe2f2('0x30')]);this[_0xe2f2('0x9e')](_0x218690,_0x218690['linkedid'],_0x218690[_0xe2f2('0x126')]);}else if(this['actions'][_0x218690[_0xe2f2('0xb5')]][_0xe2f2('0x72')]){logger[_0xe2f2('0x6d')](_0xe2f2('0x127'),_0x218690['linkedid'],_0x218690[_0xe2f2('0x126')],_0xe2f2('0xab'),_0x26f2ad['name'],'pTalking:\x20',_0x26f2ad['pTalking']);this[_0xe2f2('0x9e')](_0x218690,_0x218690[_0xe2f2('0xb5')],_0x218690['cause']);}}};Preview[_0xe2f2('0x12')][_0xe2f2('0x20')]=function(_0x58e9f9){if(this[_0xe2f2('0x19')][_0x58e9f9['destlinkedid']]&&_0x58e9f9['destlinkedid']!==_0x58e9f9[_0xe2f2('0x12c')]){this[_0xe2f2('0x9e')](_0x58e9f9,_0x58e9f9['destlinkedid'],_0x58e9f9['dialstatus']);}};Preview['prototype'][_0xe2f2('0x1f')]=function(_0x6976f5){if(this[_0xe2f2('0x19')][_0x6976f5[_0xe2f2('0xb5')]]&&_0x6976f5[_0xe2f2('0xb5')]!==_0x6976f5[_0xe2f2('0xaa')]&&!this['actions'][_0x6976f5[_0xe2f2('0xb5')]]['dialAnswer']){if(_0x6976f5['cause']==='1'){this[_0xe2f2('0x9e')](_0x6976f5,_0x6976f5[_0xe2f2('0xb5')],_0x6976f5[_0xe2f2('0x126')]);}}};Preview[_0xe2f2('0x12')][_0xe2f2('0x12d')]=function(_0x510643,_0x570f4a,_0x16be5e){if(this['actions'][_0x510643]){if(_['isNil'](this['actions'][_0x510643][_0xe2f2('0x12e')])){this[_0xe2f2('0x19')][_0x510643][_0xe2f2('0x12e')]={};}this[_0xe2f2('0x19')][_0x510643]['variables'][_0x570f4a]=_0x16be5e;}};Preview[_0xe2f2('0x12')]['syncVarSet']=function(_0x4b7e5d){try{if(!_['isNil'](_0x4b7e5d)){if(ut[_0xe2f2('0x12f')](_[_0xe2f2('0x130')](_0x4b7e5d[_0xe2f2('0x131')])[0x0])){this[_0xe2f2('0x12d')](_0x4b7e5d[_0xe2f2('0xaa')],_[_0xe2f2('0x130')](_0x4b7e5d['variable'])[0x0],_0x4b7e5d[_0xe2f2('0x132')]);}}}catch(_0x367203){logger[_0xe2f2('0x133')](_0xe2f2('0x134'),util['inspect'](_0x367203,{'showHidden':![],'depth':null}));}};Preview[_0xe2f2('0x12')]['syncAttendedTransfer']=function(_0x2da767){if(_0x2da767){if(this[_0xe2f2('0x19')][_0x2da767[_0xe2f2('0x135')]]){this[_0xe2f2('0x19')][_0x2da767['transfertargetlinkedid']][_0xe2f2('0x12a')]=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0x5cc26a){if(_0x5cc26a){if(this['actions'][_0x5cc26a[_0xe2f2('0x136')]]){this[_0xe2f2('0x19')][_0x5cc26a[_0xe2f2('0x136')]][_0xe2f2('0x12a')]=!![];}}};module[_0xe2f2('0x137')]=Preview; \ No newline at end of file +var _0x6ef6=['createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','logAgent','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','trunks','SIP/%s','reachable','unmonitored','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','toLowerVariables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','channel','syncOriginateResponse','actionid','lookAgent','clone','isFailure','response','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','variables','filterKey','variable','addVariable','keys','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','md5','../../../config/environment','preview','../../../config/logger','../ami','./rpcDb','./action','redis','defaults','socket.io-emitter','enqueue','tail','finally','campaignsPreview','voiceQueues','agents','originateresponse','syncHangup','bind','hanguprequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','type','strategy','answered','pTalking','sumBillable','talking','total','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','message','originated','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','voice_queue_channel:remove','sendMessageOneNotActive','available','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','loopCampaigns','syncCampaigns','clockClearZombieChannels','hasOwnProperty','booked','outbound','clearZombieChannels','setMessage','clearZombieChannel','sequence','isNil','actions','info','[clearZombieChannels][talking]','Queue','originated:\x20','queue','pTalking:\x20','pick','contactId','VoiceQueueId','ListId','Action','status','updateOriginated','[clearZombieChannel]','loggerError','[action]','size','recallMe','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','run','logger2','[RecallMe]','catch','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','loggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','[callProgressDetectingCustomer][logNoSuch]','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','ANSWER','responsetime','answertime','dialAnswer','[syncHangup][talking][increment]','custom:agentconnect','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','[syncHangup][talking][decrement]','\x20Queue','BUSY','countbusyretry','Busy','dialBusyMaxRetry','rescheduleContact','scheduledAt','dialBusyRetryFrequency','unlockAgent','activeContact','NOANSWER','NoAnswer','dialGlobalMaxRetry','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','CANCEL','AgentReject','unlockContact','idContact','disableContact','[default]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','linkedid','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','uniqueid','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','NoSuchNumber'];(function(_0x51bc67,_0x12c7d2){var _0x4a3b6d=function(_0x6a1711){while(--_0x6a1711){_0x51bc67['push'](_0x51bc67['shift']());}};_0x4a3b6d(++_0x12c7d2);}(_0x6ef6,0x19e));var _0x66ef=function(_0x1fef5a,_0x3a2b7f){_0x1fef5a=_0x1fef5a-0x0;var _0x19a90a=_0x6ef6[_0x1fef5a];return _0x19a90a;};'use strict';var util=require(_0x66ef('0x0'));var _=require(_0x66ef('0x1'));var BPromise=require('bluebird');var uuid=require(_0x66ef('0x2'));var moment=require('moment');var md5=require(_0x66ef('0x3'));var Redis=require('ioredis');var config=require(_0x66ef('0x4'));var logger=require('../../../config/logger')(_0x66ef('0x5'));var loggerAction=require(_0x66ef('0x6'))('actionPreview');var ami=require(_0x66ef('0x7'));var rpcDb=require(_0x66ef('0x8'));var Action=require(_0x66ef('0x9'));var ut=require('./util/util');config[_0x66ef('0xa')]=_[_0x66ef('0xb')](config[_0x66ef('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x66ef('0xc'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0x66ef('0xd')]=function(_0x3ffb5e){this[_0x66ef('0xe')]=this[_0x66ef('0xe')]?this[_0x66ef('0xe')][_0x66ef('0xf')](_0x3ffb5e):_0x3ffb5e();};function Preview(_0x29e40e){this['sequence']=new Sequence();this[_0x66ef('0x10')]=_0x29e40e[_0x66ef('0x11')];this['trunks']=_0x29e40e['trunks'];this['actions']={};this[_0x66ef('0x12')]=_0x29e40e[_0x66ef('0x12')];this['clockClearZombieChannels']=0x0;ami['on'](_0x66ef('0x13'),this['syncOriginateResponse']['bind'](this));ami['on']('hangup',this[_0x66ef('0x14')][_0x66ef('0x15')](this));ami['on'](_0x66ef('0x16'),this['syncHangupRequest'][_0x66ef('0x15')](this));ami['on'](_0x66ef('0x17'),this[_0x66ef('0x18')][_0x66ef('0x15')](this));ami['on'](_0x66ef('0x19'),this[_0x66ef('0x1a')][_0x66ef('0x15')](this));ami['on'](_0x66ef('0x1b'),this[_0x66ef('0x1c')][_0x66ef('0x15')](this));ami['on'](_0x66ef('0x1d'),this[_0x66ef('0x1e')]['bind'](this));ami['on'](_0x66ef('0x1f'),this[_0x66ef('0x20')][_0x66ef('0x15')](this));this['loopCampaigns'](this[_0x66ef('0x10')]);}function emit(_0x3bf7af,_0x4f2540,_0x22e84c){io['to'](_0x3bf7af)[_0x66ef('0x21')](_0x4f2540,_0x22e84c);}function emitCampaignPreview(_0x1027d0){if(_0x1027d0[_0x66ef('0x22')]==='outbound'){var _0x560103={'id':_0x1027d0['id'],'name':_0x1027d0['name'],'strategy':_0x1027d0[_0x66ef('0x23')],'answered':_0x1027d0[_0x66ef('0x24')],'available':_0x1027d0['available'],'loggedIn':_0x1027d0['loggedIn'],'pTalking':_0x1027d0[_0x66ef('0x25')],'sumBillable':_0x1027d0[_0x66ef('0x26')],'sumDuration':_0x1027d0['sumDuration'],'sumHoldTime':_0x1027d0['sumHoldTime']||0x0,'talking':_0x1027d0[_0x66ef('0x27')],'total':_0x1027d0[_0x66ef('0x28')],'type':_0x1027d0[_0x66ef('0x22')],'unmanaged':_0x1027d0[_0x66ef('0x29')],'abandoned':_0x1027d0['abandoned'],'waiting':_0x1027d0[_0x66ef('0x2a')],'loggedInDb':_0x1027d0[_0x66ef('0x2b')],'dialActive':_0x1027d0[_0x66ef('0x2c')],'dialMethod':_0x1027d0[_0x66ef('0x2d')],'dialOriginateCallerIdName':_0x1027d0[_0x66ef('0x2e')],'dialOriginateCallerIdNumber':_0x1027d0[_0x66ef('0x2f')],'dialOriginateTimeout':_0x1027d0[_0x66ef('0x30')],'dialPrefix':_0x1027d0[_0x66ef('0x31')],'outboundAnswerAgiCallsDay':_0x1027d0[_0x66ef('0x32')],'outboundAnswerCallsDay':_0x1027d0['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x1027d0[_0x66ef('0x33')],'outboundBusyCallsDay':_0x1027d0[_0x66ef('0x34')],'outboundCongestionCallsDay':_0x1027d0[_0x66ef('0x35')],'outboundDropCallsDayACS':_0x1027d0['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x1027d0[_0x66ef('0x36')],'outboundDropCallsDayTimeout':_0x1027d0[_0x66ef('0x37')],'outboundNoAnswerCallsDay':_0x1027d0[_0x66ef('0x38')],'outboundNoSuchCallsDay':_0x1027d0[_0x66ef('0x39')],'outboundOriginateFailureCallsDay':_0x1027d0['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x1027d0['outboundReCallsDay'],'outboundRejectCallsDay':_0x1027d0[_0x66ef('0x3a')],'outboundUnknownCallsDay':_0x1027d0[_0x66ef('0x3b')],'predictiveIntervalAnsweredCalls':_0x1027d0[_0x66ef('0x3c')],'predictiveIntervalAvgHoldtime':_0x1027d0['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x1027d0[_0x66ef('0x3d')],'predictiveIntervalDroppedCallsCallersExit':_0x1027d0['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x1027d0[_0x66ef('0x3e')],'predictiveIntervalErlangCalls':_0x1027d0[_0x66ef('0x3f')],'predictiveIntervalErlangCallsDroppedCalls':_0x1027d0[_0x66ef('0x40')],'predictiveIntervalHitRate':_0x1027d0[_0x66ef('0x41')],'predictiveIntervalMultiplicativeFactor':_0x1027d0['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x1027d0[_0x66ef('0x42')],'predictiveIntervalAvailable':_0x1027d0[_0x66ef('0x43')],'predictiveIntervalTotalCalls':_0x1027d0['predictiveIntervalTotalCalls'],'message':_0x1027d0[_0x66ef('0x44')],'originated':_0x1027d0[_0x66ef('0x45')],'erlangCalls':_0x1027d0['erlangCalls'],'erlangCallToSecond':_0x1027d0[_0x66ef('0x46')],'erlangAbandonmentRate':_0x1027d0['erlangAbandonmentRate'],'erlangBusyFactor':_0x1027d0[_0x66ef('0x47')],'startPredictive':_0x1027d0[_0x66ef('0x48')],'startProgressive':_0x1027d0[_0x66ef('0x49')]};if(_0x1027d0[_0x66ef('0x4a')]){_0x560103[_0x66ef('0x4a')]={'id':_0x1027d0[_0x66ef('0x4a')]['id'],'name':_0x1027d0[_0x66ef('0x4a')][_0x66ef('0x4b')],'active':_0x1027d0['Trunk'][_0x66ef('0x4c')],'callerid':_0x1027d0[_0x66ef('0x4a')][_0x66ef('0x4d')]};}if(_0x1027d0[_0x66ef('0x4e')]){_0x560103[_0x66ef('0x4e')]={'id':_0x1027d0[_0x66ef('0x4e')]['id'],'name':_0x1027d0[_0x66ef('0x4e')]['name']};}var _0xd570ac=md5(JSON[_0x66ef('0x4f')](_0x560103));if(_0x1027d0[_0x66ef('0x3')]!==_0xd570ac){_0x1027d0[_0x66ef('0x3')]=_0xd570ac;emit(util[_0x66ef('0x50')](_0x66ef('0x51'),_0x560103[_0x66ef('0x4b')]),_0x66ef('0x52'),_0x560103);}}}function emitVoiceQueueChannelRemove(_0x1ee0d5){emit(util[_0x66ef('0x50')](_0x66ef('0x51'),_0x1ee0d5[_0x66ef('0x4b')]),_0x66ef('0x53'),_0x1ee0d5);}function notSendMessagesQueue(_0x400534){if(_0x400534[_0x66ef('0x54')]){if(_0x400534['originated']===0x0&&_0x400534['pTalking']===0x0){_0x400534[_0x66ef('0x54')]=![];_0x400534[_0x66ef('0x55')]=0x0;_0x400534[_0x66ef('0x56')]=0x0;_0x400534[_0x66ef('0x44')]=_0x66ef('0x57');ut[_0x66ef('0x58')](_0x66ef('0x59'),_0x400534[_0x66ef('0x4b')]+_0x66ef('0x5a'));}else{_0x400534['message']=_0x66ef('0x5b');ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x400534['name']+_0x66ef('0x5c'));}emitCampaignPreview(_0x400534);}}Preview[_0x66ef('0x5d')][_0x66ef('0x5e')]=function(){var _0x18a3d0=this;setInterval(function(){_0x18a3d0[_0x66ef('0x5f')]();},0x7cf);};Preview[_0x66ef('0x5d')]['syncCampaigns']=function(){var _0x1d28ed=this[_0x66ef('0x10')];this[_0x66ef('0x60')]+=0x1;for(var _0x41b3c0 in _0x1d28ed){if(_0x1d28ed[_0x66ef('0x61')](_0x41b3c0)&&(_0x1d28ed[_0x41b3c0][_0x66ef('0x2d')]==='preview'||_0x1d28ed[_0x41b3c0][_0x66ef('0x2d')]===_0x66ef('0x62'))&&_0x1d28ed[_0x41b3c0][_0x66ef('0x22')]===_0x66ef('0x63')){if(this[_0x66ef('0x60')]>0x7){this[_0x66ef('0x60')]=0x0;this[_0x66ef('0x64')]();}}if(_0x1d28ed[_0x66ef('0x61')](_0x41b3c0)&&_0x1d28ed[_0x41b3c0][_0x66ef('0x2d')]===_0x66ef('0x5')&&_0x1d28ed[_0x41b3c0][_0x66ef('0x22')]===_0x66ef('0x63')){if(_0x1d28ed[_0x41b3c0]['dialActive']){this[_0x66ef('0x65')](_0x1d28ed[_0x41b3c0]);this['recallMe'](_0x1d28ed[_0x41b3c0]);}else{notSendMessagesQueue(_0x1d28ed[_0x41b3c0]);}}}};Preview['prototype'][_0x66ef('0x66')]=function(_0x190fef){var _0xfedc41=this;this[_0x66ef('0x67')]['enqueue'](function(){if(!_[_0x66ef('0x68')](_0xfedc41[_0x66ef('0x69')][_0x190fef])){loggerAction[_0x66ef('0x6a')](_0x66ef('0x6b'),_0x190fef,_0x66ef('0x6c'),_0xfedc41[_0x66ef('0x69')][_0x190fef]['queue'],_0x66ef('0x6d'),JSON[_0x66ef('0x4f')](_0xfedc41[_0x66ef('0x10')][_0xfedc41[_0x66ef('0x69')][_0x190fef][_0x66ef('0x6e')]][_0x66ef('0x45')]),_0x66ef('0x6f'),JSON[_0x66ef('0x4f')](_0xfedc41[_0x66ef('0x10')][_0xfedc41[_0x66ef('0x69')][_0x190fef][_0x66ef('0x6e')]][_0x66ef('0x25')]),JSON[_0x66ef('0x4f')](_0xfedc41[_0x66ef('0x69')][_0x190fef]['dialAnswer']),JSON[_0x66ef('0x4f')](_[_0x66ef('0x70')](_0xfedc41[_0x66ef('0x69')][_0x190fef],[_0x66ef('0x71'),'UserId',_0x66ef('0x72'),_0x66ef('0x73')])));return ami[_0x66ef('0x74')]({'action':_0x66ef('0x75'),'channel':_0xfedc41[_0x66ef('0x69')][_0x190fef]['channel']})['catch'](function(_0x3602bc){if(_0x3602bc[_0x66ef('0x44')]==='No\x20such\x20channel'){setTimeout(function(){if(_0xfedc41['actions'][_0x190fef]){ut[_0x66ef('0x76')](_0xfedc41[_0x66ef('0x10')][_0xfedc41[_0x66ef('0x69')][_0x190fef][_0x66ef('0x6e')]],_0x66ef('0x77'));if(_0xfedc41['actions'][_0x190fef]['dialAnswer']===!![]){ut['decrementTalkink'](_0xfedc41['campaignsPreview'][_0xfedc41[_0x66ef('0x69')][_0x190fef]['queue']],_0x66ef('0x77'));ut[_0x66ef('0x78')]('[Dialer][checkChannel][pTalking][Preview]'+_0x190fef,_0xfedc41[_0x66ef('0x69')][_0x190fef]['queue']);}ut['loggerError']('[Dialer][checkChannel][Preview]'+_0x190fef,_0xfedc41['actions'][_0x190fef]['queue']);delete _0xfedc41[_0x66ef('0x69')][_0x190fef];}},0x2328);}});}});};Preview[_0x66ef('0x5d')][_0x66ef('0x64')]=function(){var _0x46503c=this;loggerAction[_0x66ef('0x6a')](_0x66ef('0x79'),_[_0x66ef('0x7a')](this[_0x66ef('0x69')]));for(var _0x5df29c in this[_0x66ef('0x69')]){if(_0x46503c[_0x66ef('0x69')][_0x66ef('0x61')](_0x5df29c)){_0x46503c['clearZombieChannel'](_0x5df29c);}}};Preview[_0x66ef('0x5d')][_0x66ef('0x7b')]=function(_0x2c3aed){var _0x1f01af=this;rpcDb[_0x66ef('0x7c')](_0x2c3aed['id'],ut[_0x66ef('0x7d')](this[_0x66ef('0x12')]))[_0x66ef('0x7e')](function(_0x3cc952){if(!_[_0x66ef('0x68')](_0x3cc952)){for(var _0x20443b=0x0;_0x20443b<_0x3cc952[_0x66ef('0x7f')];_0x20443b+=0x1){if(ut[_0x66ef('0x80')](_0x3cc952[_0x20443b][_0x66ef('0x81')])<_0x2c3aed[_0x66ef('0x82')]*0x3c){_0x1f01af[_0x66ef('0x83')](_0x3cc952[_0x20443b]['id'])[_0x66ef('0x7e')](ut[_0x66ef('0x84')](_0x66ef('0x85')))[_0x66ef('0x86')](ut['logger2'](_0x66ef('0x85')));}else{var _0x40236a=new Action(_0x3cc952[_0x20443b],_0x2c3aed);_0x40236a[_0x66ef('0x87')]=moment()[_0x66ef('0x50')](_0x66ef('0x88'));_0x2c3aed['outboundReCallsDay']+=0x1;ut[_0x66ef('0x89')](_0x40236a,0x17,_0x66ef('0x8a'));if(_0x2c3aed[_0x66ef('0x8b')]){rpcDb[_0x66ef('0x8c')](ut['createBody'](_0x3cc952[_0x20443b]));rpcDb[_0x66ef('0x8d')](_0x40236a,_0x66ef('0x8e'));}else{ut['logCustomer'](_0x40236a,0x16,_0x66ef('0x8f'));rpcDb[_0x66ef('0x8d')](_0x40236a,_0x66ef('0x90'));rpcDb[_0x66ef('0x91')](_0x40236a,_0x66ef('0x90'));}}}}})[_0x66ef('0x86')](ut[_0x66ef('0x84')]('[getContactRecallMe]'));};Preview[_0x66ef('0x5d')][_0x66ef('0x65')]=function(_0x40b36c){_0x40b36c[_0x66ef('0x54')]=!![];if(ut['IsNotLoggedIn'](_0x40b36c[_0x66ef('0x92')])){_0x40b36c['message']=_0x66ef('0x93');}else if(!ut['isActive'](_0x40b36c[_0x66ef('0x2c')])){_0x40b36c[_0x66ef('0x44')]=_0x66ef('0x57');}else if(!this[_0x66ef('0x94')](_0x40b36c[_0x66ef('0x4a')])){if(!this[_0x66ef('0x94')](_0x40b36c[_0x66ef('0x95')])){_0x40b36c['message']=_0x66ef('0x96');}else{_0x40b36c[_0x66ef('0x44')]=_0x66ef('0x97');}}else{_0x40b36c[_0x66ef('0x44')]=_0x66ef('0x97');}emitCampaignPreview(_0x40b36c);};Preview[_0x66ef('0x5d')][_0x66ef('0x98')]=function(_0x1a8d85,_0x5d5064,_0x3c3758){var _0xcb2471=this;var _0x42ea82=this[_0x66ef('0x69')][_0x5d5064];var _0x5b8c75=this['campaignsPreview'][_0x42ea82['queue']];var _0x34b29a;if(_0x5b8c75){switch(_0x3c3758){case'1':_0x5b8c75[_0x66ef('0x39')]+=0x1;_0x42ea82[_0x66ef('0x99')]=ut[_0x66ef('0x9a')](_0x42ea82);ut[_0x66ef('0x89')](_0x42ea82,0x0,'NoSuchNumber');rpcDb['createCustomerHistory'](_0x42ea82,_0x66ef('0x9b'));if(ut[_0x66ef('0x9a')](_0x42ea82)>=_0x5b8c75['dialGlobalMaxRetry']){_0x34b29a=ut[_0x66ef('0x9c')](_0x42ea82,0xf,_0x66ef('0x9d'));rpcDb[_0x66ef('0x91')](_0x34b29a,_0x66ef('0x9e'));}else{rpcDb['createCustomerFinal'](_0x42ea82,_0x66ef('0x9e'));}delete this[_0x66ef('0x69')][_0x1a8d85['linkedid']];break;case _0x66ef('0x9f'):var _0x286e66=moment()[_0x66ef('0x50')](_0x66ef('0x88'));_0x42ea82[_0x66ef('0xa0')]=_0x286e66;_0x42ea82[_0x66ef('0xa1')]=_0x286e66;_0x42ea82[_0x66ef('0xa2')]=!![];_0x5b8c75['pTalking']+=0x1;logger[_0x66ef('0x6a')](_0x66ef('0xa3'),_0x42ea82['uniqueid'],'\x20Queue',_0x5b8c75[_0x66ef('0x4b')],_0x66ef('0x6f'),_0x5b8c75[_0x66ef('0x25')]);ami['emit'](_0x66ef('0xa4'),ut[_0x66ef('0xa5')](_0x42ea82,_0x66ef('0xa6')));if(_0x5b8c75[_0x66ef('0xa7')]){ami['emit'](_0x66ef('0xa8'),ut[_0x66ef('0xa9')](_0x42ea82));}break;case'16':ami[_0x66ef('0x21')](_0x66ef('0xaa'),ut[_0x66ef('0xa5')](_0x42ea82,_0x66ef('0xab')));emitVoiceQueueChannelRemove(ut['buildObj'](_0x42ea82,_0x66ef('0xab')));_0x5b8c75[_0x66ef('0xac')]+=0x1;_0x5b8c75[_0x66ef('0x28')]+=0x1;_0x5b8c75['answered']+=0x1;ut[_0x66ef('0xad')](_0x5b8c75,_0x66ef('0xae'));_0x42ea82['countglobal']=ut['totalGlobal'](_0x42ea82);ut[_0x66ef('0x89')](_0x42ea82,0x4,_0x66ef('0xaf'));rpcDb[_0x66ef('0x8d')](_0x42ea82,_0x66ef('0xb0'));rpcDb[_0x66ef('0x91')](_0x42ea82,_0x66ef('0xb1'));rpcDb['crateCustomerReportQueue'](_0x42ea82);_0x5b8c75[_0x66ef('0xb2')]+=_0x42ea82['talktime'];_0x5b8c75['sumBillable']+=_0x42ea82[_0x66ef('0xb3')];logger[_0x66ef('0x6a')](_0x66ef('0xb4'),_0x42ea82['uniqueid'],_0x66ef('0xb5'),_0x5b8c75[_0x66ef('0x4b')],_0x66ef('0x6f'),_0x5b8c75[_0x66ef('0x25')]);delete this[_0x66ef('0x69')][_0x1a8d85['linkedid']];break;case _0x66ef('0xb6'):_0x5b8c75['outboundBusyCallsDay']+=0x1;_0x42ea82[_0x66ef('0xb7')]+=0x1;_0x42ea82[_0x66ef('0x99')]=ut['totalGlobal'](_0x42ea82);ut['logCustomer'](_0x42ea82,0x5,_0x66ef('0xb8'));rpcDb[_0x66ef('0x8d')](_0x42ea82,'[callProgressDetectingCustomer][logBusy]');if(ut['totalGlobal'](_0x42ea82)>=_0x5b8c75['dialGlobalMaxRetry']){_0x34b29a=ut[_0x66ef('0x9c')](_0x42ea82,0xf,'Global');rpcDb[_0x66ef('0x91')](_0x34b29a,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x42ea82['countbusyretry']>=_0x5b8c75[_0x66ef('0xb9')]){rpcDb['createCustomerFinal'](_0x42ea82,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x66ef('0xba')](ut[_0x66ef('0xbb')](_0x42ea82,'countbusyretry',_0x5b8c75[_0x66ef('0xbc')]),_0x42ea82[_0x66ef('0xbd')],_0x42ea82[_0x66ef('0xbe')]);}}break;case _0x66ef('0xbf'):_0x5b8c75[_0x66ef('0x38')]+=0x1;_0x42ea82['countnoanswerretry']+=0x1;_0x42ea82[_0x66ef('0x99')]=ut['totalGlobal'](_0x42ea82);ut[_0x66ef('0x89')](_0x42ea82,0x3,_0x66ef('0xc0'));rpcDb[_0x66ef('0x8d')](_0x42ea82,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x66ef('0x9a')](_0x42ea82)>=_0x5b8c75[_0x66ef('0xc1')]){_0x34b29a=ut[_0x66ef('0x9c')](_0x42ea82,0xf,_0x66ef('0x9d'));rpcDb[_0x66ef('0x91')](_0x34b29a,_0x66ef('0xc2'));}else{if(_0x42ea82[_0x66ef('0xc3')]>=_0x5b8c75['dialNoAnswerMaxRetry']){rpcDb[_0x66ef('0x91')](_0x42ea82,_0x66ef('0xc4'));}else{rpcDb[_0x66ef('0xba')](ut['scheduledAt'](_0x42ea82,_0x66ef('0xc3'),_0x5b8c75[_0x66ef('0xc5')]),_0x42ea82[_0x66ef('0xbd')],_0x42ea82['activeContact']);}}break;case'CONGESTION':_0x5b8c75['outboundCongestionCallsDay']+=0x1;_0x42ea82[_0x66ef('0xc6')]+=0x1;_0x42ea82[_0x66ef('0x99')]=ut[_0x66ef('0x9a')](_0x42ea82);ut[_0x66ef('0x89')](_0x42ea82,0x8,_0x66ef('0xc7'));rpcDb[_0x66ef('0x8d')](_0x42ea82,_0x66ef('0xc8'));if(ut['totalGlobal'](_0x42ea82)>=_0x5b8c75[_0x66ef('0xc1')]){_0x34b29a=ut[_0x66ef('0x9c')](_0x42ea82,0xf,_0x66ef('0x9d'));rpcDb[_0x66ef('0x91')](_0x34b29a,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x42ea82[_0x66ef('0xc6')]>=_0x5b8c75[_0x66ef('0xc9')]){rpcDb[_0x66ef('0x91')](_0x42ea82,_0x66ef('0xc8'));}else{rpcDb[_0x66ef('0xba')](ut[_0x66ef('0xbb')](_0x42ea82,_0x66ef('0xc6'),_0x5b8c75[_0x66ef('0xbc')]),_0x42ea82[_0x66ef('0xbd')],_0x42ea82[_0x66ef('0xbe')]);}}break;case _0x66ef('0xca'):_0x5b8c75[_0x66ef('0x3a')]+=0x1;_0x42ea82['countglobal']=ut[_0x66ef('0x9a')](_0x42ea82);ut[_0x66ef('0x89')](_0x42ea82,0x14,_0x66ef('0xcb'));rpcDb['createCustomerHistory'](_0x42ea82,'[syncHangupRequest][logAgentReject]');if(_0x42ea82[_0x66ef('0xbd')]){rpcDb[_0x66ef('0xcc')](_0x42ea82[_0x66ef('0xcd')]);}if(_0x42ea82['activeContact']){rpcDb[_0x66ef('0xce')](_0x42ea82[_0x66ef('0xcd')]);}break;default:if(_0x42ea82['dialAnswer']){ut[_0x66ef('0xad')](_0x5b8c75,_0x66ef('0xcf'));ut[_0x66ef('0x78')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x5b8c75[_0x66ef('0x4b')],_0x1a8d85);}_0x5b8c75['outboundUnknownCallsDay']+=0x1;_0x42ea82['countglobal']=ut[_0x66ef('0x9a')](_0x42ea82);ut['logCustomer'](_0x42ea82,0xc,_0x1a8d85[_0x66ef('0xd0')]||_0x1a8d85[_0x66ef('0xd1')]);rpcDb['createCustomerHistory'](_0x42ea82,_0x66ef('0xd2'));if(ut[_0x66ef('0x9a')](_0x42ea82)>=_0x5b8c75[_0x66ef('0xc1')]){_0x34b29a=ut[_0x66ef('0x9c')](_0x42ea82,0xf,_0x66ef('0x9d'));rpcDb['createCustomerFinal'](_0x34b29a,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x66ef('0x91')](_0x42ea82,_0x66ef('0xd3'));}delete this['actions'][_0x1a8d85[_0x66ef('0xd4')]];}if(!(_0x42ea82['dialAnswer']&&_0x3c3758==='16')){ut[_0x66ef('0x76')](_0x5b8c75,_0x66ef('0xd5'));logger[_0x66ef('0x6a')](_0x66ef('0xd6'),_0x42ea82[_0x66ef('0xd7')],'\x20Queue',_0x5b8c75[_0x66ef('0x4b')],_0x66ef('0x6d'),_0x5b8c75[_0x66ef('0x45')]);}if(_0x3c3758!=='ANSWER'){delete this[_0x66ef('0x69')][_0x1a8d85['linkedid']];delete this[_0x66ef('0x69')][_0x1a8d85[_0x66ef('0xd8')]];}}};Preview[_0x66ef('0x5d')][_0x66ef('0xd9')]=function(_0x125817,_0x43f21f,_0x7601f){if(_[_0x66ef('0xda')](_0x43f21f)&&_0x66ef('0xdb')!==typeof _0x43f21f){return;}if(_[_0x66ef('0xda')](_0x7601f)&&_0x66ef('0xdb')!==typeof _0x7601f){return;}switch(_0x7601f[_0x66ef('0xdc')]){case'0':ut['logAgent'](_0x125817,0x0,_0x66ef('0xdd'));rpcDb[_0x66ef('0xde')](_0x125817,_0x66ef('0xdf'));break;case'3':ut['logAgent'](_0x125817,0x3,_0x66ef('0xc0'));rpcDb[_0x66ef('0xde')](_0x125817,_0x66ef('0xe0'));break;case'5':ut[_0x66ef('0xe1')](_0x125817,0x5,_0x66ef('0xb8'));rpcDb[_0x66ef('0xde')](_0x125817,_0x66ef('0xe2'));break;case'8':ut[_0x66ef('0xe1')](_0x125817,0x8,_0x66ef('0xc7'));rpcDb[_0x66ef('0xde')](_0x125817,_0x66ef('0xe3'));break;case'22':ut['logAgent'](_0x125817,0x16,_0x66ef('0xe4'));rpcDb['createAgentHistory'](_0x125817,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x66ef('0xe1')](_0x125817,0xc,_0x7601f[_0x66ef('0xdc')]);rpcDb['createAgentHistory'](_0x125817,_0x66ef('0xe3'));}ut[_0x66ef('0x76')](_0x43f21f,_0x66ef('0xe5'));logger[_0x66ef('0x6a')]('[originated][decrement][callProgressDetectingAgent]',_0x125817[_0x66ef('0xd7')],_0x66ef('0xb5'),_0x43f21f[_0x66ef('0x4b')],_0x66ef('0x6d'),_0x43f21f['originated']);delete this[_0x66ef('0x69')][_0x125817[_0x66ef('0xd7')]];};Preview[_0x66ef('0x5d')][_0x66ef('0xe6')]=function(_0x3d1b7c,_0x3bf8d3,_0x21ebf7,_0x343b2d,_0x2126c1){var _0x2b6181=this;return new BPromise(function(_0x25c405,_0x575e19){if(_[_0x66ef('0x68')](_0x3bf8d3)||_[_0x66ef('0x68')](_0x3bf8d3['Contact'])||_[_0x66ef('0x68')](_0x3bf8d3[_0x66ef('0xe7')][_0x66ef('0xe8')])||_[_0x66ef('0x68')](_0x3bf8d3[_0x66ef('0x72')])){_0x575e19(ut[_0x66ef('0x44')](_0x66ef('0xe9'),_0x343b2d,_0x2126c1));return;}var _0x277f7b=uuid['v4']();var _0x4870c5=_0x2b6181['campaignsPreview'][_0x3bf8d3['Queue'][_0x66ef('0x4b')]];var _0x4b2815=_0x21ebf7?_0x2b6181['agents'][_0x21ebf7]['id']:undefined;_0x2b6181['actions'][_0x277f7b]=new Action(_0x3bf8d3,_0x4870c5,_0x277f7b,_0x21ebf7,_0x4b2815);var _0x1dc955=_0x2b6181[_0x66ef('0x69')][_0x277f7b];_0x1dc955[_0x66ef('0xbd')]=_0x343b2d;_0x1dc955[_0x66ef('0xbe')]=_0x2126c1;_0x1dc955['lookAgent']=_0x21ebf7;if(_[_0x66ef('0xea')](_0x3d1b7c)){_0x2b6181['execCall'](_0x1dc955,_0x4870c5,_0x3bf8d3,_0x21ebf7)[_0x66ef('0x7e')](function(_0x590a59){logger['info'](_0x66ef('0xeb'),_0x66ef('0xec')+_0x1dc955[_0x66ef('0x6e')]+_0x66ef('0xed')+_0x1dc955[_0x66ef('0xcd')],JSON[_0x66ef('0x4f')](_0x590a59));ami['emit'](_0x66ef('0xee'),ut[_0x66ef('0xa5')](_0x1dc955,_0x66ef('0xef')));_0x25c405(ut['message'](_0x66ef('0xf0')));})[_0x66ef('0x86')](function(_0x8a3dd9){ut[_0x66ef('0x58')](_0x66ef('0xf1'),_0x8a3dd9);_0x575e19(ut[_0x66ef('0x44')](_0x66ef('0xf2'),_0x343b2d,_0x2126c1));});}else{_0x4870c5[_0x66ef('0x33')]+=0x1;ut['logBlacklist'](_0x1dc955);rpcDb[_0x66ef('0xf3')](_0x1dc955,_0x66ef('0xf4'));delete _0x2b6181[_0x66ef('0x69')][_0x277f7b];_0x575e19(ut[_0x66ef('0x44')](_0x66ef('0xf5'),_0x343b2d,_0x2126c1));}});};Preview[_0x66ef('0x5d')][_0x66ef('0x94')]=function(_0x12dad2){return!_[_0x66ef('0x68')](_0x12dad2)&&!_[_0x66ef('0x68')](_0x12dad2['name'])&&!_['isNil'](_0x12dad2['active'])&&_0x12dad2[_0x66ef('0x4c')]&&!_[_0x66ef('0x68')](this[_0x66ef('0xf6')][util[_0x66ef('0x50')](_0x66ef('0xf7'),_0x12dad2[_0x66ef('0x4b')])])&&!_[_0x66ef('0x68')](this[_0x66ef('0xf6')][util[_0x66ef('0x50')](_0x66ef('0xf7'),_0x12dad2[_0x66ef('0x4b')])][_0x66ef('0x75')])&&(this['trunks'][util[_0x66ef('0x50')]('SIP/%s',_0x12dad2[_0x66ef('0x4b')])][_0x66ef('0x75')]===_0x66ef('0xf8')||this[_0x66ef('0xf6')][util['format'](_0x66ef('0xf7'),_0x12dad2[_0x66ef('0x4b')])]['status']===_0x66ef('0xf9'));};Preview[_0x66ef('0x5d')][_0x66ef('0x83')]=function(_0x597b56,_0x3fa912){var _0x450864=this;return new BPromise(function(_0x4d0796,_0x308d08){_0x450864['execRun'](_0x597b56,_0x3fa912)['then'](function(_0x416002){_0x4d0796(_[_0x66ef('0x70')](_0x416002,[_0x66ef('0x44')]));})[_0x66ef('0x86')](function(_0x4ac1f2){if(_0x4ac1f2[_0x66ef('0xfa')]){rpcDb['unlockContact'](_0x597b56);}if(_0x4ac1f2[_0x66ef('0x4c')]){rpcDb['disableContact'](_0x597b56);}_0x308d08(_[_0x66ef('0x70')](_0x4ac1f2,[_0x66ef('0x44')]));});});};Preview[_0x66ef('0x5d')]['execRun']=function(_0x1f1703,_0x17886f){var _0x4f3d58=this;return new BPromise(function(_0x2d6b57,_0x35c0da){var _0x1f088e,_0x4a8c27;rpcDb[_0x66ef('0xfb')](_0x1f1703)[_0x66ef('0x7e')](function(_0xa736a2){if(!_[_0x66ef('0x68')](_0xa736a2[0x0])){_0x4a8c27=_0xa736a2[0x0][_0x66ef('0xfc')]?![]:!![];_0x1f088e=_0xa736a2[0x0][_0x66ef('0xfc')]?!![]:![];_0x1f088e=_0x17886f?!![]:_0x1f088e;}var _0x3da47a=_0x4f3d58[_0x66ef('0xfd')](_0xa736a2);if(_0x3da47a[_0x66ef('0xfe')]){rpcDb[_0x66ef('0xff')](_[_0x66ef('0x70')](_0xa736a2[0x0],[_0x66ef('0x72'),_0x66ef('0x100')]))[_0x66ef('0x7e')](function(_0x385b52){_0x4f3d58['checkInBlack'](_0x385b52,_0xa736a2[0x0],_0x17886f,_0x4a8c27,_0x1f088e)[_0x66ef('0x7e')](function(_0x2b323e){_0x2d6b57(_0x2b323e);})[_0x66ef('0x86')](function(_0xd7af98){_0x35c0da(_0xd7af98);});})['catch'](function(_0x4e2900){ut[_0x66ef('0x58')](_0x66ef('0x101'),_0x4e2900);_0x35c0da(ut[_0x66ef('0x44')](_0x66ef('0x102'),_0x4a8c27,_0x1f088e));});}else{_0x35c0da(ut[_0x66ef('0x44')](_0x3da47a['message'],_0x4a8c27,_0x1f088e));}})[_0x66ef('0x86')](function(_0x15473f){ut[_0x66ef('0x58')](_0x66ef('0x103'),_0x15473f);_0x35c0da(ut[_0x66ef('0x44')](_0x66ef('0x102'),![],!![]));});});};Preview[_0x66ef('0x5d')][_0x66ef('0xfd')]=function(_0x39f340){if(_[_0x66ef('0x68')](_0x39f340)||_[_0x66ef('0xea')](_0x39f340)||!_[_0x66ef('0x68')](_0x39f340[0x0][_0x66ef('0x104')])&&_[_0x66ef('0x68')](_0x39f340[0x0][_0x66ef('0x104')]['name'])){ut[_0x66ef('0x58')](_0x66ef('0x105'),_0x39f340);return{'isValid':![],'message':_0x66ef('0x106')};}var _0x23426b=this[_0x66ef('0x10')][_0x39f340[0x0][_0x66ef('0x6c')][_0x66ef('0x4b')]];_0x23426b[_0x66ef('0x44')]='ACTIVE';if(_[_0x66ef('0x68')](_0x23426b)){ut['logger']('[Preview][validateContact][Empty\x20Campaign]',_0x23426b);return{'isValid':![],'message':_0x66ef('0x107')};}if(!this[_0x66ef('0x94')](_0x23426b['Trunk'])){ut[_0x66ef('0x58')](_0x66ef('0x108'),_0x66ef('0x109')+_0x23426b[_0x66ef('0x4b')]+_0x66ef('0x10a'));if(!this[_0x66ef('0x94')](_0x23426b[_0x66ef('0x95')])){ut[_0x66ef('0x58')](_0x66ef('0x108'),_0x23426b['name']+_0x66ef('0x10b'));return{'isValid':![],'message':_0x66ef('0x10c')};}}if(!ut[_0x66ef('0x10d')](_0x23426b[_0x66ef('0x2c')])){ut[_0x66ef('0x58')](_0x66ef('0x10e'),_0x23426b[_0x66ef('0x4b')]+_0x66ef('0x10f'));return{'isValid':![],'message':_0x66ef('0x109')+_0x23426b['name']+_0x66ef('0x10f')};}return{'isValid':!![],'message':_0x66ef('0x110')};};Preview[_0x66ef('0x5d')][_0x66ef('0x111')]=function(_0x347a1e,_0x25bfdb,_0x48eba4,_0x1a5b98){var _0x37720d=this;return new BPromise(function(_0x11fa8a,_0x166312){var _0x5e4738=_0x347a1e['uniqueid'];var _0x333499=_0x37720d['isTrunkReachable'](_0x25bfdb[_0x66ef('0x4a')])?util[_0x66ef('0x50')](_0x66ef('0x112'),_0x25bfdb['Trunk'][_0x66ef('0x4b')],_[_0x66ef('0x68')](_0x25bfdb[_0x66ef('0x31')])?'':_0x25bfdb[_0x66ef('0x31')][_0x66ef('0x113')]()||'',_0x25bfdb[_0x66ef('0x114')]>0x0?_0x48eba4[_0x66ef('0xe7')][_0x66ef('0xe8')][_0x66ef('0x115')](_0x25bfdb['dialCutDigit']):_0x48eba4[_0x66ef('0xe7')][_0x66ef('0xe8')]):util[_0x66ef('0x50')](_0x66ef('0x112'),_[_0x66ef('0x68')](_0x25bfdb[_0x66ef('0x95')])?_0x25bfdb['Trunk'][_0x66ef('0x4b')]:_0x25bfdb['TrunkBackup'][_0x66ef('0x4b')],_[_0x66ef('0x68')](_0x25bfdb['dialPrefix'])?'':_0x25bfdb[_0x66ef('0x31')][_0x66ef('0x113')]()||'',_0x25bfdb['dialCutDigit']>0x0?_0x48eba4[_0x66ef('0xe7')][_0x66ef('0xe8')]['substring'](_0x25bfdb[_0x66ef('0x114')]):_0x48eba4['Contact'][_0x66ef('0xe8')]);var _0x167fd5=_0x37720d['isTrunkReachable'](_0x25bfdb[_0x66ef('0x4a')])?ut[_0x66ef('0x116')](_0x25bfdb[_0x66ef('0x4a')][_0x66ef('0x4d')],_0x25bfdb['dialOriginateCallerIdName'],_0x25bfdb[_0x66ef('0x117')]>0x0?ut[_0x66ef('0x118')](_0x25bfdb['dialOriginateCallerIdNumber'],_0x25bfdb[_0x66ef('0x117')]):_0x25bfdb[_0x66ef('0x2f')]):ut[_0x66ef('0x116')](_[_0x66ef('0x68')](_0x25bfdb[_0x66ef('0x95')])?_0x25bfdb[_0x66ef('0x4a')][_0x66ef('0x4d')]:_0x25bfdb['TrunkBackup'][_0x66ef('0x4d')],_0x25bfdb[_0x66ef('0x2e')],_0x25bfdb[_0x66ef('0x117')]>0x0?ut[_0x66ef('0x118')](_0x25bfdb['dialOriginateCallerIdNumber'],_0x25bfdb[_0x66ef('0x117')]):_0x25bfdb[_0x66ef('0x2f')]);if(_0x167fd5){_0x347a1e[_0x66ef('0x119')]=ut[_0x66ef('0x11a')](_0x167fd5);_0x347a1e[_0x66ef('0x11b')]=ut['extractCalleridNumber'](_0x167fd5);}var _0x11ee39=ut[_0x66ef('0x11c')](_0x25bfdb,_0x48eba4,_0x333499,_0x167fd5,_0x5e4738,_0x347a1e);_[_0x66ef('0x11d')](_0x347a1e,ut[_0x66ef('0x11e')](_0x11ee39));_0x347a1e[_0x66ef('0x87')]=moment()[_0x66ef('0x50')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x66ef('0x74')](ut[_0x66ef('0x11f')](_0x347a1e,_0x25bfdb,_0x11ee39,_0x347a1e[_0x66ef('0xbe')],_0x1a5b98))[_0x66ef('0x7e')](function(_0x2b3c80){_0x25bfdb[_0x66ef('0x45')]+=0x1;logger[_0x66ef('0x6a')]('[originated][increment]',_0x5e4738,_0x66ef('0xb5'),_0x25bfdb[_0x66ef('0x4b')],_0x66ef('0x6d'),_0x25bfdb[_0x66ef('0x45')]);_0x11fa8a(_0x2b3c80);})[_0x66ef('0x86')](function(_0x5d99c8){ut['logAgent'](_0x347a1e,0xe,_0x66ef('0x120'));rpcDb['createAgentHistory'](_0x347a1e,_0x66ef('0x121'));_0x166312(_0x5d99c8);});});};Preview[_0x66ef('0x5d')][_0x66ef('0x1a')]=function(_0x3884e3){if(this['actions'][_0x3884e3[_0x66ef('0xd4')]]){this['actions'][_0x3884e3[_0x66ef('0xd4')]][_0x66ef('0x122')]=_0x3884e3[_0x66ef('0x122')];}};Preview[_0x66ef('0x5d')][_0x66ef('0x123')]=function(_0x111319){var _0x590dfa=this;var _0x31f31d=this[_0x66ef('0x69')][_0x111319[_0x66ef('0x124')]];if(_0x31f31d){if(_0x31f31d[_0x66ef('0x125')]&&this[_0x66ef('0x12')][_0x31f31d['lookAgent']]){ut['logLookAgent'](_0x31f31d,this[_0x66ef('0x12')][_0x31f31d[_0x66ef('0x125')]][_0x66ef('0x4b')],this[_0x66ef('0x12')][_0x31f31d[_0x66ef('0x125')]]['id']);}var _0x3c61db=_[_0x66ef('0x126')](_0x31f31d);_0x3c61db[_0x66ef('0xa0')]=moment()['format'](_0x66ef('0x88'));var _0x40f006=_0x590dfa[_0x66ef('0x10')][_0x31f31d[_0x66ef('0x6e')]];if(ut[_0x66ef('0x127')](_0x111319[_0x66ef('0x128')])){if(_0x31f31d[_0x66ef('0xbd')]){rpcDb['unlockContact'](_0x31f31d['idContact']);}if(_0x31f31d['activeContact']){rpcDb['disableContact'](_0x31f31d[_0x66ef('0xcd')]);}ami[_0x66ef('0x21')](_0x66ef('0x129'),ut[_0x66ef('0xa5')](_0x31f31d,'rejected'));this[_0x66ef('0xd9')](_0x3c61db,_0x40f006,_0x111319);}else{_0x31f31d['starttime']=moment()[_0x66ef('0x50')](_0x66ef('0x88'));ut[_0x66ef('0xe1')](_0x3c61db,0x4,_0x66ef('0xaf'));rpcDb['createAgentHistory'](_0x3c61db,_0x66ef('0x12a'));}}};Preview[_0x66ef('0x5d')]['syncHangup']=function(_0x77d044){var _0x534dcc=this;var _0x3a69a4=this[_0x66ef('0x69')][_0x77d044['linkedid']];var _0x1b062c;if(_0x3a69a4){_0x1b062c=this[_0x66ef('0x10')][_0x3a69a4['queue']];logger['info'](_0x66ef('0x12b'),_0x77d044[_0x66ef('0xd4')],_0x66ef('0xb5'),_0x1b062c[_0x66ef('0x4b')],'pTalking:\x20',_0x1b062c[_0x66ef('0x25')]);}if(this[_0x66ef('0x69')][_0x77d044[_0x66ef('0xd4')]]&&_0x77d044[_0x66ef('0xd4')]!==_0x77d044[_0x66ef('0xd7')]){if(_0x77d044[_0x66ef('0x12c')]==='16'&&this['actions'][_0x77d044[_0x66ef('0xd4')]][_0x66ef('0xa2')]){this[_0x66ef('0x98')](_0x77d044,_0x77d044['linkedid'],_0x77d044['cause']);}else if(this[_0x66ef('0x69')][_0x77d044[_0x66ef('0xd4')]][_0x66ef('0xa2')]){logger[_0x66ef('0x6a')](_0x66ef('0x12d'),_0x77d044[_0x66ef('0xd4')],_0x77d044[_0x66ef('0x12c')],_0x66ef('0xb5'),_0x1b062c['name'],_0x66ef('0x6f'),_0x1b062c['pTalking']);this[_0x66ef('0x98')](_0x77d044,_0x77d044[_0x66ef('0xd4')],_0x77d044[_0x66ef('0x12c')]);}}else if(_0x3a69a4&&_[_0x66ef('0x68')](_0x3a69a4[_0x66ef('0x12e')])&&_0x1b062c[_0x66ef('0x12f')]&&_0x77d044[_0x66ef('0xd4')]===_0x77d044[_0x66ef('0xd7')]&&_[_0x66ef('0x68')](_0x77d044[_0x66ef('0xdc')])&&_0x77d044[_0x66ef('0x12c')]==='16'&&_0x77d044[_0x66ef('0x130')]==='6'&&_[_0x66ef('0xda')](_0x3a69a4[_0x66ef('0x131')])){if(_0x3a69a4[_0x66ef('0xbd')]){rpcDb['unlockContact'](_0x3a69a4['idContact']);}if(_0x3a69a4[_0x66ef('0xbe')]){rpcDb['disableContact'](_0x3a69a4[_0x66ef('0xcd')]);}_0x77d044[_0x66ef('0xdc')]='22';this[_0x66ef('0xd9')](_0x3a69a4,_0x1b062c,_0x77d044);}else if(_0x3a69a4&&_0x3a69a4[_0x66ef('0x131')]){if(_0x77d044[_0x66ef('0x12c')]==='16'&&this[_0x66ef('0x69')][_0x77d044['linkedid']]['dialAnswer']){logger[_0x66ef('0x6a')](_0x66ef('0x132'),_0x77d044[_0x66ef('0xd4')],_0x77d044[_0x66ef('0x12c')],_0x66ef('0xb5'),_0x1b062c['name'],_0x66ef('0x6f'),_0x1b062c[_0x66ef('0x25')]);this[_0x66ef('0x98')](_0x77d044,_0x77d044[_0x66ef('0xd4')],_0x77d044[_0x66ef('0x12c')]);}else if(this[_0x66ef('0x69')][_0x77d044[_0x66ef('0xd4')]][_0x66ef('0xa2')]){logger[_0x66ef('0x6a')](_0x66ef('0x12d'),_0x77d044[_0x66ef('0xd4')],_0x77d044[_0x66ef('0x12c')],_0x66ef('0xb5'),_0x1b062c[_0x66ef('0x4b')],_0x66ef('0x6f'),_0x1b062c[_0x66ef('0x25')]);this[_0x66ef('0x98')](_0x77d044,_0x77d044[_0x66ef('0xd4')],_0x77d044[_0x66ef('0x12c')]);}}};Preview[_0x66ef('0x5d')][_0x66ef('0x18')]=function(_0x9b8e52){if(this['actions'][_0x9b8e52[_0x66ef('0xd8')]]&&_0x9b8e52[_0x66ef('0xd8')]!==_0x9b8e52[_0x66ef('0x133')]){this[_0x66ef('0x98')](_0x9b8e52,_0x9b8e52[_0x66ef('0xd8')],_0x9b8e52[_0x66ef('0xd1')]);}};Preview[_0x66ef('0x5d')]['syncHangupRequest']=function(_0x1fc5b0){if(this[_0x66ef('0x69')][_0x1fc5b0[_0x66ef('0xd4')]]&&_0x1fc5b0[_0x66ef('0xd4')]!==_0x1fc5b0[_0x66ef('0xd7')]&&!this[_0x66ef('0x69')][_0x1fc5b0[_0x66ef('0xd4')]]['dialAnswer']){if(_0x1fc5b0[_0x66ef('0x12c')]==='1'){this[_0x66ef('0x98')](_0x1fc5b0,_0x1fc5b0[_0x66ef('0xd4')],_0x1fc5b0[_0x66ef('0x12c')]);}}};Preview[_0x66ef('0x5d')]['addVariable']=function(_0x7e99ee,_0x2959a3,_0x13382a){if(this[_0x66ef('0x69')][_0x7e99ee]){if(_[_0x66ef('0x68')](this[_0x66ef('0x69')][_0x7e99ee][_0x66ef('0x134')])){this[_0x66ef('0x69')][_0x7e99ee][_0x66ef('0x134')]={};}this[_0x66ef('0x69')][_0x7e99ee]['variables'][_0x2959a3]=_0x13382a;}};Preview[_0x66ef('0x5d')][_0x66ef('0x1c')]=function(_0x83c951){try{if(!_[_0x66ef('0x68')](_0x83c951)){if(ut[_0x66ef('0x135')](_['keys'](_0x83c951[_0x66ef('0x136')])[0x0])){this[_0x66ef('0x137')](_0x83c951[_0x66ef('0xd7')],_[_0x66ef('0x138')](_0x83c951['variable'])[0x0],_0x83c951['value']);}}}catch(_0x9e9896){logger[_0x66ef('0x139')](_0x66ef('0x13a'),util['inspect'](_0x9e9896,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0x66ef('0x1e')]=function(_0x1aabc5){if(_0x1aabc5){if(this[_0x66ef('0x69')][_0x1aabc5[_0x66ef('0x13b')]]){this[_0x66ef('0x69')][_0x1aabc5['transfertargetlinkedid']][_0x66ef('0x131')]=!![];}}};Preview[_0x66ef('0x5d')][_0x66ef('0x20')]=function(_0x2e4024){if(_0x2e4024){if(this[_0x66ef('0x69')][_0x2e4024[_0x66ef('0x13c')]]){this[_0x66ef('0x69')][_0x2e4024[_0x66ef('0x13c')]][_0x66ef('0x131')]=!![];}}};module[_0x66ef('0x13d')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 9b0f9a7..f8fec24 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 _0xe4d1=['holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','then','createHistory','resolve','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','from-sip'];(function(_0x38fff7,_0x3d2f6f){var _0x335292=function(_0x2c2470){while(--_0x2c2470){_0x38fff7['push'](_0x38fff7['shift']());}};_0x335292(++_0x3d2f6f);}(_0xe4d1,0x1d3));var _0x1e4d=function(_0xc61a85,_0x3843ab){_0xc61a85=_0xc61a85-0x0;var _0x15e6b5=_0xe4d1[_0xc61a85];return _0x15e6b5;};'use strict';var util=require(_0x1e4d('0x0'));var BPromise=require(_0x1e4d('0x1'));var logger=require('../../../config/logger')(_0x1e4d('0x2'));var _=require('lodash');var cmHopper=require(_0x1e4d('0x3'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x1e4d('0x4'));var cmHopperBlack=require(_0x1e4d('0x5'));var voiceQueueRt=require(_0x1e4d('0x6'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x1e4d('0x7'));function loggerCatch(_0x468621){return function(_0x121f9e){logger[_0x1e4d('0x8')](_0x468621,util[_0x1e4d('0x9')](_0x121f9e,{'showHidden':![],'depth':null}));};}function create(_0x156e94){return BPromise['resolve']()[_0x1e4d('0xa')](cmHopperHistory[_0x1e4d('0xb')](_0x156e94))['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x568258){return BPromise[_0x1e4d('0xc')]()[_0x1e4d('0xa')](agentReportPreview['createHistory'](_0x568258))[_0x1e4d('0xd')](loggerCatch(_0x1e4d('0xe')));}function moveContact(_0x5db6ba){return BPromise[_0x1e4d('0xc')]()[_0x1e4d('0xa')](cmHopper[_0x1e4d('0xf')](_0x5db6ba,!![]))[_0x1e4d('0xd')](loggerCatch(_0x1e4d('0x10')));}exports[_0x1e4d('0x11')]=function(_0x1d3820){return BPromise[_0x1e4d('0xc')]()[_0x1e4d('0xa')](cmHopperBlack[_0x1e4d('0x11')](_0x1d3820))[_0x1e4d('0xd')](loggerCatch(_0x1e4d('0x12')));};exports[_0x1e4d('0x13')]=function(_0x401338){return BPromise[_0x1e4d('0xc')]()[_0x1e4d('0xa')](cmHopper[_0x1e4d('0x13')](_0x401338))[_0x1e4d('0xd')](loggerCatch(_0x1e4d('0x14')));};exports['createHistory']=function(_0x342888,_0x159dbf){create(_0x342888)[_0x1e4d('0xd')](loggerCatch(_0x159dbf));moveContact(_0x342888)[_0x1e4d('0xd')](loggerCatch(_0x159dbf));};exports[_0x1e4d('0x15')]=function(_0x1dc470,_0x2ff54a){createAgent(_0x1dc470)[_0x1e4d('0xd')](loggerCatch(_0x2ff54a));};exports[_0x1e4d('0x16')]=function(_0x571d0b,_0x375557){create(_0x571d0b)[_0x1e4d('0xd')](loggerCatch(_0x375557));};exports[_0x1e4d('0x17')]=function(_0x1d6f6d,_0x32f22d){moveContact(_0x1d6f6d)['catch'](loggerCatch(_0x32f22d));};exports[_0x1e4d('0x18')]=function(_0x2a683d,_0x3241d4,_0x248ebf){if(_0x3241d4){_0x2a683d['UserId']=null;}if(_0x248ebf){_0x2a683d[_0x1e4d('0x19')]=![];}return BPromise[_0x1e4d('0xc')]()['then'](cmHopper[_0x1e4d('0x18')](_0x2a683d))[_0x1e4d('0xd')](loggerCatch(_0x1e4d('0x1a')));};exports[_0x1e4d('0x1b')]=function(_0x325efd){return BPromise[_0x1e4d('0xc')]()[_0x1e4d('0xa')](cmHopper['countReScheduled'](_0x325efd))['catch'](loggerCatch(_0x1e4d('0x1c')));};exports[_0x1e4d('0x1d')]=function(_0x3a1606){return BPromise[_0x1e4d('0xc')]()[_0x1e4d('0xa')](cmHopper[_0x1e4d('0x1d')]({'UserId':null},_0x3a1606,0x1))[_0x1e4d('0xd')](loggerCatch(_0x1e4d('0x1e')));};exports[_0x1e4d('0x1f')]=function(_0x5dbe9a){return BPromise['resolve']()[_0x1e4d('0xa')](cmHopper[_0x1e4d('0x1d')]({'active':![]},_0x5dbe9a,0x1))[_0x1e4d('0xd')](loggerCatch('[activeContact]\x20'));};exports[_0x1e4d('0x20')]=function(_0x3b93c5){var _0x4b6405={};_0x4b6405[_0x1e4d('0x21')]=_0x3b93c5['type'];_0x4b6405[_0x1e4d('0x22')]=_0x3b93c5[_0x1e4d('0x22')];_0x4b6405[_0x1e4d('0x23')]=_0x3b93c5[_0x1e4d('0x23')];_0x4b6405['calleridname']=_0x3b93c5['calleridname'];_0x4b6405[_0x1e4d('0x24')]=_0x3b93c5[_0x1e4d('0x24')];_0x4b6405[_0x1e4d('0x25')]=_0x3b93c5[_0x1e4d('0x26')];_0x4b6405[_0x1e4d('0x27')]=_0x3b93c5[_0x1e4d('0x26')];_0x4b6405[_0x1e4d('0x28')]=0x1;_0x4b6405[_0x1e4d('0x29')]=_0x3b93c5[_0x1e4d('0x2a')];_0x4b6405[_0x1e4d('0x2b')]=_0x3b93c5[_0x1e4d('0x2c')];_0x4b6405['context']=_0x1e4d('0x2d');_0x4b6405['exten']='xcally-motion-preview';_0x4b6405[_0x1e4d('0x2e')]=0x0;_0x4b6405[_0x1e4d('0x2f')]=0x1;_0x4b6405[_0x1e4d('0x30')]=_0x3b93c5['membername'];_0x4b6405[_0x1e4d('0x31')]=_0x1e4d('0x32');return BPromise[_0x1e4d('0xc')]()[_0x1e4d('0xa')](voiceQueueReport[_0x1e4d('0x33')](_0x4b6405))[_0x1e4d('0xd')](loggerCatch(_0x1e4d('0x34')));};exports[_0x1e4d('0x35')]=function(_0x3b2a90,_0x404cd5){return BPromise[_0x1e4d('0xc')]()[_0x1e4d('0xa')](cmHopper['getContactRecallMe'](_0x3b2a90,_0x404cd5))[_0x1e4d('0xd')](loggerCatch(_0x1e4d('0x36')));};exports[_0x1e4d('0x37')]=function(_0x17a3e8){return BPromise[_0x1e4d('0xc')]()[_0x1e4d('0xa')](cmHopper[_0x1e4d('0x18')](_0x17a3e8,!![],!![]))[_0x1e4d('0xd')](loggerCatch(_0x1e4d('0x38')));}; \ No newline at end of file +var _0xf37f=['disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','context','from-sip','exten','xcally-motion-preview','holdtime','membername','queuecallerexitreason','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','resolve','createHistory','then','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','UserId','rescheduleContact','countReScheduled','[countReScheduled]\x20','unlockContact'];(function(_0x4fc80b,_0xfe1b3d){var _0x119dba=function(_0x16ed12){while(--_0x16ed12){_0x4fc80b['push'](_0x4fc80b['shift']());}};_0x119dba(++_0xfe1b3d);}(_0xf37f,0xfc));var _0xff37=function(_0x5efb9e,_0x47e288){_0x5efb9e=_0x5efb9e-0x0;var _0x571f58=_0xf37f[_0x5efb9e];return _0x571f58;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0xff37('0x0'))('preview');var _=require(_0xff37('0x1'));var cmHopper=require(_0xff37('0x2'));var cmHopperFinal=require(_0xff37('0x3'));var cmHopperHistory=require(_0xff37('0x4'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xff37('0x5'));var agentReportPreview=require(_0xff37('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x28bbbc){return function(_0x2bb071){logger[_0xff37('0x7')](_0x28bbbc,util['inspect'](_0x2bb071,{'showHidden':![],'depth':null}));};}function create(_0x4ddf14){return BPromise[_0xff37('0x8')]()['then'](cmHopperHistory[_0xff37('0x9')](_0x4ddf14))['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x2730f3){return BPromise[_0xff37('0x8')]()[_0xff37('0xa')](agentReportPreview[_0xff37('0x9')](_0x2730f3))[_0xff37('0xb')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x2298fb){return BPromise[_0xff37('0x8')]()['then'](cmHopper[_0xff37('0xc')](_0x2298fb,!![]))[_0xff37('0xb')](loggerCatch(_0xff37('0xd')));}exports[_0xff37('0xe')]=function(_0x455a68){return BPromise[_0xff37('0x8')]()['then'](cmHopperBlack[_0xff37('0xe')](_0x455a68))['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xff37('0xf')]=function(_0x583ce2){return BPromise[_0xff37('0x8')]()[_0xff37('0xa')](cmHopper[_0xff37('0xf')](_0x583ce2))['catch'](loggerCatch(_0xff37('0x10')));};exports[_0xff37('0x9')]=function(_0x155e0c,_0x429271){create(_0x155e0c)[_0xff37('0xb')](loggerCatch(_0x429271));moveContact(_0x155e0c)[_0xff37('0xb')](loggerCatch(_0x429271));};exports[_0xff37('0x11')]=function(_0x9d0876,_0x292449){createAgent(_0x9d0876)[_0xff37('0xb')](loggerCatch(_0x292449));};exports[_0xff37('0x12')]=function(_0x5ed3cd,_0x549201){create(_0x5ed3cd)[_0xff37('0xb')](loggerCatch(_0x549201));};exports['createCustomerFinal']=function(_0x288c3a,_0x3b5b0e){moveContact(_0x288c3a)[_0xff37('0xb')](loggerCatch(_0x3b5b0e));};exports['rescheduleContact']=function(_0x27a65b,_0x516372,_0x1696d9){if(_0x516372){_0x27a65b[_0xff37('0x13')]=null;}if(_0x1696d9){_0x27a65b['active']=![];}return BPromise[_0xff37('0x8')]()[_0xff37('0xa')](cmHopper[_0xff37('0x14')](_0x27a65b))['catch'](loggerCatch('[rescheduleContact]\x20'));};exports[_0xff37('0x15')]=function(_0x5f048c){return BPromise['resolve']()['then'](cmHopper[_0xff37('0x15')](_0x5f048c))[_0xff37('0xb')](loggerCatch(_0xff37('0x16')));};exports['unlockContact']=function(_0xa653c7){return BPromise[_0xff37('0x8')]()[_0xff37('0xa')](cmHopper[_0xff37('0x17')]({'UserId':null},_0xa653c7,0x1))[_0xff37('0xb')](loggerCatch('[unlockContact]\x20'));};exports[_0xff37('0x18')]=function(_0x26c720){return BPromise[_0xff37('0x8')]()[_0xff37('0xa')](cmHopper['unlockContact']({'active':![]},_0x26c720,0x1))[_0xff37('0xb')](loggerCatch('[activeContact]\x20'));};exports[_0xff37('0x19')]=function(_0x50b4b1){var _0x288520={};_0x288520['type']=_0x50b4b1[_0xff37('0x1a')];_0x288520['uniqueid']=_0x50b4b1[_0xff37('0x1b')];_0x288520['calleridnum']=_0x50b4b1[_0xff37('0x1c')];_0x288520[_0xff37('0x1d')]=_0x50b4b1['calleridname'];_0x288520[_0xff37('0x1e')]=_0x50b4b1[_0xff37('0x1e')];_0x288520[_0xff37('0x1f')]=_0x50b4b1[_0xff37('0x20')];_0x288520[_0xff37('0x21')]=_0x50b4b1[_0xff37('0x20')];_0x288520['queuecallercomplete']=0x1;_0x288520['queuecallercompleteAt']=_0x50b4b1['endtime'];_0x288520['connectedlinename']=_0x50b4b1['membername'];_0x288520[_0xff37('0x22')]=_0xff37('0x23');_0x288520[_0xff37('0x24')]=_0xff37('0x25');_0x288520[_0xff37('0x26')]=0x0;_0x288520['assigned']=0x1;_0x288520['lastAssignedTo']=_0x50b4b1[_0xff37('0x27')];_0x288520[_0xff37('0x28')]='COMPLETED';return BPromise[_0xff37('0x8')]()[_0xff37('0xa')](voiceQueueReport[_0xff37('0x29')](_0x288520))[_0xff37('0xb')](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0x315d2a,_0x310891){return BPromise[_0xff37('0x8')]()[_0xff37('0xa')](cmHopper[_0xff37('0x2a')](_0x315d2a,_0x310891))['catch'](loggerCatch(_0xff37('0x2b')));};exports[_0xff37('0x2c')]=function(_0x554f00){return BPromise[_0xff37('0x8')]()[_0xff37('0xa')](cmHopper['rescheduleContact'](_0x554f00,!![],!![]))[_0xff37('0xb')](loggerCatch(_0xff37('0x2d')));}; \ 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 ba8718a..5fb8725 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 _0xf5db=['Contact','hasOwnProperty','tags','createdAt','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','responsetime','endtime','starttime','membername','ringtime','talktime','answertime','Failure','variablesAction','RECALL','uniqueid','from-sip','timeout','countbusyretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','isNil','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','buildObj','lastevent','queue','interface','channelAgent','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','type','dialAnswer','countcongestionretry','callbackat','recallme','UserId','sipcallid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','lodash','moment','../../../../config/logger','preview','env','127.0.0.1','milliseconds','diff','seconds','loggerCatch','inspect','logger','info','error','getCallerId','isUndefined','isEmpty','string','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID'];(function(_0x138c29,_0x41c9c4){var _0x474fae=function(_0x2bfeea){while(--_0x2bfeea){_0x138c29['push'](_0x138c29['shift']());}};_0x474fae(++_0x41c9c4);}(_0xf5db,0x1eb));var _0xbf5d=function(_0x2f2239,_0x3486c8){_0x2f2239=_0x2f2239-0x0;var _0x266f02=_0xf5db[_0x2f2239];return _0x266f02;};'use strict';var util=require('util');var _=require(_0xbf5d('0x0'));var moment=require(_0xbf5d('0x1'));var logger=require(_0xbf5d('0x2'))(_0xbf5d('0x3'));var ipAgi=process[_0xbf5d('0x4')]['XCALLY_IP_AGI']||_0xbf5d('0x5');function getSeconds(_0x2d6da7,_0x44d367){var _0x572c7a=moment(_0x2d6da7)[_0xbf5d('0x6')](0x0);var _0x20d4bd=moment(_0x44d367)[_0xbf5d('0x6')](0x0);return _0x572c7a[_0xbf5d('0x7')](_0x20d4bd,_0xbf5d('0x8'));}exports[_0xbf5d('0x9')]=function(_0x3d1962){return function(_0x3003e0){logger['error'](_0x3d1962,util[_0xbf5d('0xa')](_0x3003e0,{'showHidden':![],'depth':null}));};};exports[_0xbf5d('0xb')]=function(_0xd5d640,_0x4e2c02){logger[_0xbf5d('0xc')](_0xd5d640,util[_0xbf5d('0xa')](_0x4e2c02,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x196b0a,_0x83f3c1){logger[_0xbf5d('0xd')](_0x196b0a,util[_0xbf5d('0xa')](_0x83f3c1,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x5effda){return function(_0x379398){logger['info'](_0x5effda,util[_0xbf5d('0xa')](_0x379398,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x2c1eba,_0x1802d0,_0x109097){return{'message':_0x2c1eba,'unlock':_0x1802d0,'active':_0x109097};};exports[_0xbf5d('0xe')]=function(_0xab57d7,_0x4d86a2,_0x4b365e){if(!_[_0xbf5d('0xf')](_0x4b365e)&&'string'===typeof _0x4b365e&&!_[_0xbf5d('0x10')](_0x4b365e)){if(!_['isUndefined'](_0x4d86a2)&&_0xbf5d('0x11')===typeof _0x4d86a2&&!_[_0xbf5d('0x10')](_0x4d86a2)){return util['format'](_0xbf5d('0x12'),_0x4d86a2,_0x4b365e);}return util[_0xbf5d('0x13')](_0xbf5d('0x12'),_0x4b365e,_0x4b365e);}if(!_[_0xbf5d('0xf')](_0xab57d7)&&_0xbf5d('0x11')===typeof _0xab57d7&&!_[_0xbf5d('0x10')](_0xab57d7)){return _0xab57d7;}return _0xbf5d('0x14');};exports[_0xbf5d('0x15')]=function(_0x1fcfeb){if(_['isNil'](_0x1fcfeb)){return![];}return _0x1fcfeb;};exports[_0xbf5d('0x16')]=function(_0x1f3b63,_0x456423,_0x7923b,_0x56245a,_0x90d2a9,_0x5157e1){var _0x4b71d0={'XMD-QUEUE':_0x456423['Queue']?_0x456423[_0xbf5d('0x17')][_0xbf5d('0x18')]:'','XMD-CALLERID':_0x56245a,'XMD-CALLERID-PREVIEW':_0x5157e1?util[_0xbf5d('0x13')]('\x22%s\x22\x20<%s>',_0x5157e1[_0xbf5d('0x19')],_0x5157e1[_0xbf5d('0x1a')]):_0x56245a,'XMD-DIALID':_0x90d2a9,'XMD-CONTACTID':_0x456423[_0xbf5d('0x1b')],'XMD-CDRTYPE':_0xbf5d('0x1c'),'CALLERID(all)':_0x56245a,'XMD-VOICEQUEUEID':_0x456423[_0xbf5d('0x1d')],'XMD-DIALCHANNEL':_0x7923b,'XMD-DIALTIMEOUT':_0x1f3b63[_0xbf5d('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0xbf5d('0x13')]('\x22rtTxX%s%s\x22',_0x1f3b63['dialQueueProject2']?'g':'',_[_0xbf5d('0x10')](_0x1f3b63['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x1f3b63[_0xbf5d('0x1f')]||'','XMD-AGI':_0x1f3b63[_0xbf5d('0x20')]?util[_0xbf5d('0x13')](_0xbf5d('0x21'),ipAgi,_0x1f3b63[_0xbf5d('0x20')]):_0xbf5d('0x22'),'XMD-AGIAFTER':_0x1f3b63[_0xbf5d('0x23')]?util[_0xbf5d('0x13')](_0xbf5d('0x21'),ipAgi,_0x1f3b63[_0xbf5d('0x23')]):_0xbf5d('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x5157e1?_0x5157e1[_0xbf5d('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x5157e1?_0x5157e1[_0xbf5d('0x25')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0xbf5d('0x10')](_0x1f3b63[_0xbf5d('0x26')])){_0x4b71d0[util[_0xbf5d('0x13')]('%s',_0xbf5d('0x27'))]=_0x1f3b63[_0xbf5d('0x26')];_0x4b71d0[util[_0xbf5d('0x13')]('%s',_0xbf5d('0x28'))]=_0x90d2a9;}if(_0x456423&&_0x456423[_0xbf5d('0x29')]){for(var _0x35f940 in _0x456423['Contact']){if(_0x456423[_0xbf5d('0x29')][_0xbf5d('0x2a')](_0x35f940)){if(!_['isNil'](_0x456423[_0xbf5d('0x29')][_0x35f940])&&_0x35f940!=='id'&&_0x35f940!==_0xbf5d('0x2b')&&_0x35f940!==_0xbf5d('0x2c')&&_0x35f940!=='updatedAt'){_0x4b71d0[util[_0xbf5d('0x13')]('%s%s',_0xbf5d('0x2d'),_[_0xbf5d('0x2e')](_0x35f940))]=_0x456423[_0xbf5d('0x29')][_0x35f940];}}}}return _0x4b71d0;};exports[_0xbf5d('0x2f')]=function(_0x29e1e8){var _0x5e02af={};for(var _0x89759c in _0x29e1e8){if(_0x29e1e8[_0xbf5d('0x2a')](_0x89759c)){_0x5e02af[util[_0xbf5d('0x13')]('%s',_[_0xbf5d('0x30')](_0x89759c))]=_0x29e1e8[_0x89759c];}}return{'variables':_0x5e02af};};exports[_0xbf5d('0x31')]=function(_0x48c9cb,_0x30020c){if(!_['isNil'](_0x48c9cb)){if(_0x48c9cb[_0xbf5d('0x2a')](_0xbf5d('0x32'))){if(_0x48c9cb['originated']>0x0){_0x48c9cb['originated']-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x30020c);}}}else{logger[_0xbf5d('0xd')](_0xbf5d('0x33'),_0x30020c);}};exports[_0xbf5d('0x34')]=function(_0x5ee893){var _0x429f40=moment()[_0xbf5d('0x13')](_0xbf5d('0x35'));_0x5ee893[_0xbf5d('0x36')]=0xd;_0x5ee893[_0xbf5d('0x37')]='Blacklist';_0x5ee893['starttime']=_0x429f40;_0x5ee893[_0xbf5d('0x38')]=_0x429f40;_0x5ee893[_0xbf5d('0x39')]=_0x429f40;};exports['logAgent']=function(_0x25babf,_0x1388f9,_0x3bb929){var _0x595108=moment()['format'](_0xbf5d('0x35'));_0x25babf[_0xbf5d('0x36')]=_0x1388f9;_0x25babf[_0xbf5d('0x37')]=_0x3bb929;_0x25babf['responsetime']=_0x595108;_0x25babf['ringtime']=getSeconds(_0x25babf['responsetime'],_0x25babf[_0xbf5d('0x3a')]);};exports['logLookAgent']=function(_0x337908,_0x5db3f1,_0x4a5279){_0x337908[_0xbf5d('0x3b')]=_0x5db3f1;_0x337908['UserId']=_0x4a5279;};exports['logCustomer']=function(_0x5bc4f8,_0x2ef95f,_0x167ece){var _0x4b681d=moment()[_0xbf5d('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x5bc4f8[_0xbf5d('0x36')]=_0x2ef95f;_0x5bc4f8[_0xbf5d('0x37')]=_0x167ece;_0x5bc4f8['responsetime']=_0x5bc4f8[_0xbf5d('0x38')]?_0x5bc4f8['responsetime']:_0x4b681d;_0x5bc4f8[_0xbf5d('0x39')]=_0x5bc4f8['endtime']?_0x5bc4f8[_0xbf5d('0x39')]:_0x4b681d;_0x5bc4f8[_0xbf5d('0x3c')]=getSeconds(_0x5bc4f8[_0xbf5d('0x38')]||0x0,_0x5bc4f8[_0xbf5d('0x3a')]||0x0);_0x5bc4f8[_0xbf5d('0x3d')]=_0x5bc4f8[_0xbf5d('0x3e')]?getSeconds(_0x5bc4f8[_0xbf5d('0x39')],_0x5bc4f8[_0xbf5d('0x3e')]):0x0;};exports['isFailure']=function(_0x2f13f9){return _0x2f13f9===_0xbf5d('0x3f');};exports[_0xbf5d('0x40')]=function(_0xb0accc,_0x40567d,_0x22d41d,_0x3ccf19,_0x19becb){var _0x4ba4ad=_0x3ccf19?_0xbf5d('0x41'):_0xb0accc[_0xbf5d('0x19')];_0x4ba4ad=_0x19becb?'BOOKED':_0x4ba4ad;return{'actionid':_0xb0accc[_0xbf5d('0x42')],'action':'originate','channel':_0xb0accc['channelAgent'],'callerid':util['format'](_0xbf5d('0x12'),_0x4ba4ad,_0xb0accc[_0xbf5d('0x1a')]),'Exten':'xcally-motion-preview','Context':_0xbf5d('0x43'),'Priority':'1','variable':_0x22d41d,'timeout':(_0x40567d[_0xbf5d('0x44')]||0x1e)*0x3e8,'async':!![],'channelid':_0xb0accc[_0xbf5d('0x42')]};};exports['totalGlobal']=function(_0x5277cb){return _0x5277cb[_0xbf5d('0x45')]+_0x5277cb['countcongestionretry']+_0x5277cb[_0xbf5d('0x46')];};exports[_0xbf5d('0x47')]=function(_0x541381){var _0x5f7d94=_[_0xbf5d('0x48')](_0x541381);_0x5f7d94[_0xbf5d('0x36')]=0xf;_0x5f7d94['statedesc']=_0xbf5d('0x49');return _0x5f7d94;};exports[_0xbf5d('0x4a')]=function(_0x33f96e,_0x44535f,_0x2f65b3){var _0x572969={};_0x572969[_0x44535f]=_0x33f96e[_0x44535f];_0x572969[_0xbf5d('0x4b')]=![];_0x572969[_0xbf5d('0x4c')]=moment()[_0xbf5d('0x4d')](_0x2f65b3,_0xbf5d('0x4e'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x572969[_0xbf5d('0x1b')]=_0x33f96e[_0xbf5d('0x1b')];_0x572969['ListId']=_0x33f96e[_0xbf5d('0x4f')];_0x572969[_0xbf5d('0x1d')]=_0x33f96e[_0xbf5d('0x1d')]||undefined;return _0x572969;};exports[_0xbf5d('0x50')]=function(_0x4fc25f,_0xa7e7eb){if(!_[_0xbf5d('0x51')](_0x4fc25f)){if(_0x4fc25f[_0xbf5d('0x52')]>0x0){_0x4fc25f[_0xbf5d('0x52')]-=0x1;}else{logger['error'](_0xa7e7eb,_0xbf5d('0x53'));}}else{logger[_0xbf5d('0xd')](_0xa7e7eb,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xbf5d('0x54')]=function(_0x71b79e){if(_0x71b79e<=0x0){return!![];}return![];};exports[_0xbf5d('0x55')]=function(_0x2bbf1d,_0x58acd0){_0x2bbf1d[_0xbf5d('0x56')]=_0x58acd0;_0x2bbf1d[_0xbf5d('0x18')]=_0x2bbf1d[_0xbf5d('0x57')];_0x2bbf1d[_0xbf5d('0x58')]=_0x2bbf1d[_0xbf5d('0x59')];return _0x2bbf1d;};exports[_0xbf5d('0x5a')]=function(_0x1b82e7){var _0x291f29={};_0x291f29['queue']=_0x1b82e7[_0xbf5d('0x57')];_0x291f29[_0xbf5d('0x58')]=_0x1b82e7[_0xbf5d('0x59')];_0x291f29[_0xbf5d('0x42')]=_0x1b82e7[_0xbf5d('0x42')];return _0x291f29;};exports[_0xbf5d('0x5b')]=function(_0x56cd00){var _0x1183c5=[];for(var _0x11d3f6 in _0x56cd00){if(_0x56cd00[_0xbf5d('0x2a')](_0x11d3f6)){if(!_[_0xbf5d('0x51')](_0x56cd00[_0x11d3f6])&&_0x56cd00[_0x11d3f6][_0xbf5d('0x36')]===_0xbf5d('0x5c')&&_0x56cd00[_0x11d3f6][_0xbf5d('0x5d')]===_0xbf5d('0x5e')){_0x1183c5[_0xbf5d('0x5f')](_0x56cd00[_0x11d3f6]['id']);}}}return _0x1183c5;};exports[_0xbf5d('0x60')]=function(_0x58e540){var _0x419f87=moment()[_0xbf5d('0x6')](0x0);var _0x4814fb=moment(_0x58e540)[_0xbf5d('0x6')](0x0);return _0x419f87[_0xbf5d('0x7')](_0x4814fb,_0xbf5d('0x8'));};exports[_0xbf5d('0x61')]=function(_0x2fd1f0){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2fd1f0[_0xbf5d('0x1b')],'ListId':_0x2fd1f0['ListId'],'VoiceQueueId':_0x2fd1f0['VoiceQueueId']||undefined,'CampaignId':_0x2fd1f0[_0xbf5d('0x62')]||undefined};};exports[_0xbf5d('0x63')]=function(_0x4192d4){if(_0x4192d4===_0xbf5d('0x42')||_0x4192d4===_0xbf5d('0x64')||_0x4192d4===_0xbf5d('0x57')||_0x4192d4===_0xbf5d('0x65')||_0x4192d4==='campaigntype'||_0x4192d4===_0xbf5d('0x66')||_0x4192d4===_0xbf5d('0x3b')||_0x4192d4==='channelAgent'||_0x4192d4===_0xbf5d('0x19')||_0x4192d4===_0xbf5d('0x4b')||_0x4192d4==='calleridnum'||_0x4192d4===_0xbf5d('0x4c')||_0x4192d4===_0xbf5d('0x45')||_0x4192d4===_0xbf5d('0x67')||_0x4192d4===_0xbf5d('0x46')||_0x4192d4==='countglobal'||_0x4192d4==='callback'||_0x4192d4==='callbackuniqueid'||_0x4192d4===_0xbf5d('0x68')||_0x4192d4===_0xbf5d('0x69')||_0x4192d4===_0xbf5d('0x1b')||_0x4192d4===_0xbf5d('0x4f')||_0x4192d4===_0xbf5d('0x6a')||_0x4192d4===_0xbf5d('0x1d')||_0x4192d4===_0xbf5d('0x6b')||_0x4192d4==='xmd-voicequeueid'||_0x4192d4===_0xbf5d('0x6c')||_0x4192d4==='xmd-phone'||_0x4192d4===_0xbf5d('0x6d')||_0x4192d4===_0xbf5d('0x6e')||_0x4192d4==='xmd-dialtimeout'||_0x4192d4===_0xbf5d('0x6f')||_0x4192d4==='xmd-dialid'||_0x4192d4==='xmd-dialchannel'||_0x4192d4==='xmd-contactid'||_0x4192d4===_0xbf5d('0x70')||_0x4192d4===_0xbf5d('0x71')||_0x4192d4===_0xbf5d('0x72')||_0x4192d4===_0xbf5d('0x73')||_0x4192d4===_0xbf5d('0x74')||_0x4192d4===_0xbf5d('0x75')||_0x4192d4==='rtpaudioqosjitter'||_0x4192d4===_0xbf5d('0x76')||_0x4192d4===_0xbf5d('0x77')||_0x4192d4===_0xbf5d('0x78')||_0x4192d4===_0xbf5d('0x79')||_0x4192d4===_0xbf5d('0x7a')||_0x4192d4==='rtpaudioqos'||_0x4192d4==='rtpaudioqosbridged'||_0x4192d4===_0xbf5d('0x7b')||_0x4192d4===_0xbf5d('0x76')||_0x4192d4===_0xbf5d('0x77')||_0x4192d4===_0xbf5d('0x78')||_0x4192d4==='rtpaudioqosrtt'||_0x4192d4==='rtpaudioqosrttbridged'||_0x4192d4===_0xbf5d('0x7c')||_0x4192d4===_0xbf5d('0x7d')||_0x4192d4===_0xbf5d('0x36')||_0x4192d4==='statedesc'){return![];}return!![];};exports[_0xbf5d('0x7e')]=function(_0x33c3d5,_0x2b79cc){var _0x1ad8f8,_0x1dcb07,_0xce6823;if(_0x2b79cc<=0x0){_0x2b79cc=0x1;}_0x1ad8f8=new RegExp(_0xbf5d('0x7f')+_0x2b79cc+'}$');_0x1dcb07=Math[_0xbf5d('0x80')](0xa,_0x2b79cc-0x1);_0xce6823=Math['pow'](0xa,_0x2b79cc)-0x1;return util['format']('%s',_[_0xbf5d('0x81')](_0x33c3d5,_0x1ad8f8,_[_0xbf5d('0x82')](_0x1dcb07,_0xce6823)));};exports['extractCalleridName']=function(_0x4fc551){var _0x58482f=_0x4fc551[_0xbf5d('0x83')](/"(.*?)"/);return _0x58482f?_0x58482f[0x1]:_0x4fc551;};exports[_0xbf5d('0x84')]=function(_0x1ef85b){var _0x181be9=_0x1ef85b[_0xbf5d('0x83')](/<(.*?)>/);return _0x181be9?_0x181be9[0x1]:_0x1ef85b;}; \ No newline at end of file +var _0x834e=['xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','util','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','error','inspect','logger','info','loggerError','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','dialer','VoiceQueueId','dialQueueProject2','dialPreviewUrl','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','XMD-','toUpper','toLowerVariables','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','endtime','logAgent','ringtime','responsetime','starttime','logLookAgent','UserId','logCustomer','answertime','isFailure','Failure','variablesAction','uniqueid','originate','calleridnum','timeout','totalGlobal','countbusyretry','countcongestionretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','queue','interface','channelAgent','not_inuse','reachable','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','membername','countnoanswerretry','countglobal','callback','callbackat','recallme','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0x834e,0x19d));var _0xe834=function(_0x6cfdd2,_0x65105a){_0x6cfdd2=_0x6cfdd2-0x0;var _0x57d752=_0x834e[_0x6cfdd2];return _0x57d752;};'use strict';var util=require(_0xe834('0x0'));var _=require(_0xe834('0x1'));var moment=require(_0xe834('0x2'));var logger=require(_0xe834('0x3'))(_0xe834('0x4'));var ipAgi=process['env'][_0xe834('0x5')]||_0xe834('0x6');function getSeconds(_0x413288,_0x2e1450){var _0x151299=moment(_0x413288)[_0xe834('0x7')](0x0);var _0x3b2f8c=moment(_0x2e1450)['milliseconds'](0x0);return _0x151299[_0xe834('0x8')](_0x3b2f8c,_0xe834('0x9'));}exports['loggerCatch']=function(_0x35bc3d){return function(_0x47a899){logger[_0xe834('0xa')](_0x35bc3d,util[_0xe834('0xb')](_0x47a899,{'showHidden':![],'depth':null}));};};exports[_0xe834('0xc')]=function(_0xdd65ff,_0xd11807){logger[_0xe834('0xd')](_0xdd65ff,util['inspect'](_0xd11807,{'showHidden':![],'depth':null}));};exports[_0xe834('0xe')]=function(_0x4b4778,_0x107961){logger[_0xe834('0xa')](_0x4b4778,util['inspect'](_0x107961,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x58ea66){return function(_0x1462b7){logger[_0xe834('0xd')](_0x58ea66,util['inspect'](_0x1462b7,{'showHidden':![],'depth':null}));};};exports[_0xe834('0xf')]=function(_0x1f5356,_0x3045a2,_0x22fd1b){return{'message':_0x1f5356,'unlock':_0x3045a2,'active':_0x22fd1b};};exports[_0xe834('0x10')]=function(_0x2c6ffc,_0x33b3ae,_0x39b47e){if(!_[_0xe834('0x11')](_0x39b47e)&&_0xe834('0x12')===typeof _0x39b47e&&!_[_0xe834('0x13')](_0x39b47e)){if(!_[_0xe834('0x11')](_0x33b3ae)&&_0xe834('0x12')===typeof _0x33b3ae&&!_[_0xe834('0x13')](_0x33b3ae)){return util['format'](_0xe834('0x14'),_0x33b3ae,_0x39b47e);}return util[_0xe834('0x15')](_0xe834('0x14'),_0x39b47e,_0x39b47e);}if(!_['isUndefined'](_0x2c6ffc)&&_0xe834('0x12')===typeof _0x2c6ffc&&!_[_0xe834('0x13')](_0x2c6ffc)){return _0x2c6ffc;}return _0xe834('0x16');};exports[_0xe834('0x17')]=function(_0x47bb02){if(_[_0xe834('0x18')](_0x47bb02)){return![];}return _0x47bb02;};exports[_0xe834('0x19')]=function(_0x5d52da,_0x56684b,_0x43c48b,_0x1134f4,_0x196bdf,_0x22534c){var _0x12b608={'XMD-QUEUE':_0x56684b[_0xe834('0x1a')]?_0x56684b[_0xe834('0x1a')][_0xe834('0x1b')]:'','XMD-CALLERID':_0x1134f4,'XMD-CALLERID-PREVIEW':_0x22534c?util[_0xe834('0x15')](_0xe834('0x14'),_0x22534c[_0xe834('0x1c')],_0x22534c['calleridnum']):_0x1134f4,'XMD-DIALID':_0x196bdf,'XMD-CONTACTID':_0x56684b['ContactId'],'XMD-CDRTYPE':_0xe834('0x1d'),'CALLERID(all)':_0x1134f4,'XMD-VOICEQUEUEID':_0x56684b[_0xe834('0x1e')],'XMD-DIALCHANNEL':_0x43c48b,'XMD-DIALTIMEOUT':_0x5d52da['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xe834('0x15')]('\x22rtTxX%s%s\x22',_0x5d52da[_0xe834('0x1f')]?'g':'',_[_0xe834('0x13')](_0x5d52da['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x5d52da[_0xe834('0x20')]||'','XMD-AGI':_0x5d52da[_0xe834('0x21')]?util[_0xe834('0x15')]('\x22agi://%s/square,%s\x22',ipAgi,_0x5d52da[_0xe834('0x21')]):_0xe834('0x22'),'XMD-AGIAFTER':_0x5d52da[_0xe834('0x1f')]?util[_0xe834('0x15')]('\x22agi://%s/square,%s\x22',ipAgi,_0x5d52da[_0xe834('0x1f')]):_0xe834('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x22534c?_0x22534c[_0xe834('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x22534c?_0x22534c[_0xe834('0x24')]:'','XMD-DESTINATION':_0xe834('0x25')};if(!_[_0xe834('0x13')](_0x5d52da['monitor_format'])){_0x12b608[util[_0xe834('0x15')]('%s',_0xe834('0x26'))]=_0x5d52da[_0xe834('0x27')];_0x12b608[util[_0xe834('0x15')]('%s',_0xe834('0x28'))]=_0x196bdf;}if(_0x56684b&&_0x56684b[_0xe834('0x29')]){for(var _0x1e437d in _0x56684b[_0xe834('0x29')]){if(_0x56684b[_0xe834('0x29')][_0xe834('0x2a')](_0x1e437d)){if(!_[_0xe834('0x18')](_0x56684b[_0xe834('0x29')][_0x1e437d])&&_0x1e437d!=='id'&&_0x1e437d!==_0xe834('0x2b')&&_0x1e437d!=='createdAt'&&_0x1e437d!=='updatedAt'){_0x12b608[util[_0xe834('0x15')]('%s%s',_0xe834('0x2c'),_[_0xe834('0x2d')](_0x1e437d))]=_0x56684b[_0xe834('0x29')][_0x1e437d];}}}}return _0x12b608;};exports[_0xe834('0x2e')]=function(_0x4f107f){var _0x38e5b9={};for(var _0xdd907f in _0x4f107f){if(_0x4f107f['hasOwnProperty'](_0xdd907f)){_0x38e5b9[util[_0xe834('0x15')]('%s',_['toLower'](_0xdd907f))]=_0x4f107f[_0xdd907f];}}return{'variables':_0x38e5b9};};exports['updateOriginated']=function(_0x480988,_0x432c19){if(!_[_0xe834('0x18')](_0x480988)){if(_0x480988[_0xe834('0x2a')](_0xe834('0x2f'))){if(_0x480988['originated']>0x0){_0x480988[_0xe834('0x2f')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x432c19);}}}else{logger[_0xe834('0xa')](_0xe834('0x30'),_0x432c19);}};exports[_0xe834('0x31')]=function(_0x3375e6){var _0x495a57=moment()[_0xe834('0x15')](_0xe834('0x32'));_0x3375e6[_0xe834('0x33')]=0xd;_0x3375e6[_0xe834('0x34')]=_0xe834('0x35');_0x3375e6['starttime']=_0x495a57;_0x3375e6['responsetime']=_0x495a57;_0x3375e6[_0xe834('0x36')]=_0x495a57;};exports[_0xe834('0x37')]=function(_0x355b5f,_0x2f082a,_0x37e69e){var _0x3de804=moment()[_0xe834('0x15')](_0xe834('0x32'));_0x355b5f[_0xe834('0x33')]=_0x2f082a;_0x355b5f[_0xe834('0x34')]=_0x37e69e;_0x355b5f['responsetime']=_0x3de804;_0x355b5f[_0xe834('0x38')]=getSeconds(_0x355b5f[_0xe834('0x39')],_0x355b5f[_0xe834('0x3a')]);};exports[_0xe834('0x3b')]=function(_0x46528b,_0x3ffcb9,_0x280366){_0x46528b['membername']=_0x3ffcb9;_0x46528b[_0xe834('0x3c')]=_0x280366;};exports[_0xe834('0x3d')]=function(_0x1d010a,_0x8c048a,_0x40cabc){var _0x36c5d2=moment()[_0xe834('0x15')](_0xe834('0x32'));_0x1d010a[_0xe834('0x33')]=_0x8c048a;_0x1d010a['statedesc']=_0x40cabc;_0x1d010a['responsetime']=_0x1d010a[_0xe834('0x39')]?_0x1d010a[_0xe834('0x39')]:_0x36c5d2;_0x1d010a['endtime']=_0x1d010a[_0xe834('0x36')]?_0x1d010a[_0xe834('0x36')]:_0x36c5d2;_0x1d010a['ringtime']=getSeconds(_0x1d010a[_0xe834('0x39')]||0x0,_0x1d010a['starttime']||0x0);_0x1d010a['talktime']=_0x1d010a[_0xe834('0x3e')]?getSeconds(_0x1d010a[_0xe834('0x36')],_0x1d010a[_0xe834('0x3e')]):0x0;};exports[_0xe834('0x3f')]=function(_0xa135c2){return _0xa135c2===_0xe834('0x40');};exports[_0xe834('0x41')]=function(_0x183beb,_0x136cc6,_0x459abb,_0x4a711e,_0x5d0654){var _0x5d08d3=_0x4a711e?'RECALL':_0x183beb[_0xe834('0x1c')];_0x5d08d3=_0x5d0654?'BOOKED':_0x5d08d3;return{'actionid':_0x183beb[_0xe834('0x42')],'action':_0xe834('0x43'),'channel':_0x183beb['channelAgent'],'callerid':util[_0xe834('0x15')](_0xe834('0x14'),_0x5d08d3,_0x183beb[_0xe834('0x44')]),'Exten':_0xe834('0x25'),'Context':'from-sip','Priority':'1','variable':_0x459abb,'timeout':(_0x136cc6[_0xe834('0x45')]||0x1e)*0x3e8,'async':!![],'channelid':_0x183beb[_0xe834('0x42')]};};exports[_0xe834('0x46')]=function(_0x2e87ed){return _0x2e87ed[_0xe834('0x47')]+_0x2e87ed[_0xe834('0x48')]+_0x2e87ed['countnoanswerretry'];};exports[_0xe834('0x49')]=function(_0xa722e0){var _0x386aac=_[_0xe834('0x4a')](_0xa722e0);_0x386aac[_0xe834('0x33')]=0xf;_0x386aac[_0xe834('0x34')]=_0xe834('0x4b');return _0x386aac;};exports[_0xe834('0x4c')]=function(_0x3fc5a0,_0xb775a9,_0x24c522){var _0x1a0d70={};_0x1a0d70[_0xb775a9]=_0x3fc5a0[_0xb775a9];_0x1a0d70[_0xe834('0x4d')]=![];_0x1a0d70[_0xe834('0x4e')]=moment()['add'](_0x24c522,'minutes')[_0xe834('0x15')](_0xe834('0x32'));_0x1a0d70[_0xe834('0x4f')]=_0x3fc5a0[_0xe834('0x4f')];_0x1a0d70['ListId']=_0x3fc5a0[_0xe834('0x50')];_0x1a0d70['VoiceQueueId']=_0x3fc5a0[_0xe834('0x1e')]||undefined;return _0x1a0d70;};exports[_0xe834('0x51')]=function(_0x17e7dd,_0x1e8382){if(!_[_0xe834('0x18')](_0x17e7dd)){if(_0x17e7dd[_0xe834('0x52')]>0x0){_0x17e7dd['pTalking']-=0x1;}else{logger[_0xe834('0xa')](_0x1e8382,_0xe834('0x53'));}}else{logger[_0xe834('0xa')](_0x1e8382,_0xe834('0x54'));}};exports[_0xe834('0x55')]=function(_0x45ebf6){if(_0x45ebf6<=0x0){return!![];}return![];};exports['buildObj']=function(_0x34f53c,_0x4cf2a3){_0x34f53c['lastevent']=_0x4cf2a3;_0x34f53c[_0xe834('0x1b')]=_0x34f53c[_0xe834('0x56')];_0x34f53c[_0xe834('0x57')]=_0x34f53c[_0xe834('0x58')];return _0x34f53c;};exports['buildAcw']=function(_0xe8c042){var _0x490fe1={};_0x490fe1[_0xe834('0x56')]=_0xe8c042[_0xe834('0x56')];_0x490fe1[_0xe834('0x57')]=_0xe8c042[_0xe834('0x58')];_0x490fe1[_0xe834('0x42')]=_0xe8c042['uniqueid'];return _0x490fe1;};exports['agentReadyId']=function(_0x33f0bc){var _0x224aa6=[];for(var _0x3ba485 in _0x33f0bc){if(_0x33f0bc['hasOwnProperty'](_0x3ba485)){if(!_[_0xe834('0x18')](_0x33f0bc[_0x3ba485])&&_0x33f0bc[_0x3ba485]['state']===_0xe834('0x59')&&_0x33f0bc[_0x3ba485]['status']===_0xe834('0x5a')){_0x224aa6['push'](_0x33f0bc[_0x3ba485]['id']);}}}return _0x224aa6;};exports['getDiff']=function(_0x456916){var _0x4f5de8=moment()[_0xe834('0x7')](0x0);var _0x4cd96f=moment(_0x456916)[_0xe834('0x7')](0x0);return _0x4f5de8[_0xe834('0x8')](_0x4cd96f,_0xe834('0x9'));};exports[_0xe834('0x5b')]=function(_0x4779f4){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4779f4['ContactId'],'ListId':_0x4779f4[_0xe834('0x50')],'VoiceQueueId':_0x4779f4[_0xe834('0x1e')]||undefined,'CampaignId':_0x4779f4[_0xe834('0x5c')]||undefined};};exports[_0xe834('0x5d')]=function(_0x98b69){if(_0x98b69==='uniqueid'||_0x98b69===_0xe834('0x5e')||_0x98b69===_0xe834('0x56')||_0x98b69==='type'||_0x98b69===_0xe834('0x5f')||_0x98b69===_0xe834('0x60')||_0x98b69===_0xe834('0x61')||_0x98b69==='channelAgent'||_0x98b69===_0xe834('0x1c')||_0x98b69===_0xe834('0x4d')||_0x98b69===_0xe834('0x44')||_0x98b69===_0xe834('0x4e')||_0x98b69===_0xe834('0x47')||_0x98b69==='countcongestionretry'||_0x98b69===_0xe834('0x62')||_0x98b69===_0xe834('0x63')||_0x98b69===_0xe834('0x64')||_0x98b69==='callbackuniqueid'||_0x98b69===_0xe834('0x65')||_0x98b69===_0xe834('0x66')||_0x98b69===_0xe834('0x4f')||_0x98b69===_0xe834('0x50')||_0x98b69==='UserId'||_0x98b69===_0xe834('0x1e')||_0x98b69==='sipcallid'||_0x98b69==='xmd-voicequeueid'||_0x98b69==='xmd-queue'||_0x98b69===_0xe834('0x67')||_0x98b69===_0xe834('0x68')||_0x98b69===_0xe834('0x69')||_0x98b69===_0xe834('0x6a')||_0x98b69===_0xe834('0x6b')||_0x98b69==='xmd-dialid'||_0x98b69===_0xe834('0x6c')||_0x98b69===_0xe834('0x6d')||_0x98b69===_0xe834('0x6e')||_0x98b69===_0xe834('0x6f')||_0x98b69==='xmd-agiafter'||_0x98b69===_0xe834('0x70')||_0x98b69===_0xe834('0x71')||_0x98b69===_0xe834('0x72')||_0x98b69===_0xe834('0x73')||_0x98b69==='rtpaudioqosjitterbridged'||_0x98b69===_0xe834('0x74')||_0x98b69===_0xe834('0x75')||_0x98b69===_0xe834('0x76')||_0x98b69===_0xe834('0x77')||_0x98b69===_0xe834('0x71')||_0x98b69===_0xe834('0x72')||_0x98b69==='rtpaudioqosjitter'||_0x98b69===_0xe834('0x78')||_0x98b69===_0xe834('0x74')||_0x98b69===_0xe834('0x75')||_0x98b69==='rtpaudioqosrtt'||_0x98b69==='rtpaudioqosrttbridged'||_0x98b69===_0xe834('0x79')||_0x98b69===_0xe834('0x7a')||_0x98b69===_0xe834('0x33')||_0x98b69===_0xe834('0x34')){return![];}return!![];};exports[_0xe834('0x7b')]=function(_0x4cb9c2,_0x1f334e){var _0xbd797f,_0x5eec8a,_0x2a0aa5;if(_0x1f334e<=0x0){_0x1f334e=0x1;}_0xbd797f=new RegExp(_0xe834('0x7c')+_0x1f334e+'}$');_0x5eec8a=Math[_0xe834('0x7d')](0xa,_0x1f334e-0x1);_0x2a0aa5=Math[_0xe834('0x7d')](0xa,_0x1f334e)-0x1;return util[_0xe834('0x15')]('%s',_[_0xe834('0x7e')](_0x4cb9c2,_0xbd797f,_[_0xe834('0x7f')](_0x5eec8a,_0x2a0aa5)));};exports[_0xe834('0x80')]=function(_0x19d398){var _0x50c561=_0x19d398[_0xe834('0x81')](/"(.*?)"/);return _0x50c561?_0x50c561[0x1]:_0x19d398;};exports['extractCalleridNumber']=function(_0x5c3f87){var _0x3c146c=_0x5c3f87[_0xe834('0x81')](/<(.*?)>/);return _0x3c146c?_0x3c146c[0x1]:_0x5c3f87;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 6d2428e..7768868 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 _0xec39=['voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','voicequeuechannel','voicequeuechannelhangup'];(function(_0x4ed4d2,_0x47acf7){var _0x15ae2e=function(_0x3199f0){while(--_0x3199f0){_0x4ed4d2['push'](_0x4ed4d2['shift']());}};_0x15ae2e(++_0x47acf7);}(_0xec39,0x19f));var _0x9ec3=function(_0x293721,_0xdd0a34){_0x293721=_0x293721-0x0;var _0x36a0b3=_0xec39[_0x293721];return _0x36a0b3;};'use strict';exports[_0x9ec3('0x0')]={'queue':{'type':_0x9ec3('0x1'),'required':!![]},'interface':{'type':_0x9ec3('0x1'),'required':!![]},'membername':{'type':_0x9ec3('0x1'),'required':!![]},'penalty':{'type':_0x9ec3('0x2'),'required':![]},'paused':{'type':_0x9ec3('0x3'),'required':![]}};exports[_0x9ec3('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x9ec3('0x1'),'required':!![]}};exports[_0x9ec3('0x5')]={'interface':{'type':_0x9ec3('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0x9ec3('0x1'),'required':![]}};exports[_0x9ec3('0x6')]={'uniqueid':{'type':_0x9ec3('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x9ec3('0x1'),'required':!![]},'filename':{'type':_0x9ec3('0x1')},'format':{'type':_0x9ec3('0x1')},'mixmonitorid':{'type':_0x9ec3('0x1')}};exports[_0x9ec3('0x7')]={'uniqueid':{'type':_0x9ec3('0x1'),'required':!![]}};exports[_0x9ec3('0x8')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x9ec3('0x1'),'required':!![]},'context':{'type':_0x9ec3('0x1')}}; \ No newline at end of file +var _0xee24=['boolean','queueremove','queuepause','voicequeuechannel','voicechannel','voicequeuechannelredirect','string','number'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xee24,0x1a6));var _0x4ee2=function(_0x414bfe,_0x4a7771){_0x414bfe=_0x414bfe-0x0;var _0x2dfb7e=_0xee24[_0x414bfe];return _0x2dfb7e;};'use strict';exports['queueadd']={'queue':{'type':_0x4ee2('0x0'),'required':!![]},'interface':{'type':_0x4ee2('0x0'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x4ee2('0x1'),'required':![]},'paused':{'type':_0x4ee2('0x2'),'required':![]}};exports[_0x4ee2('0x3')]={'queue':{'type':_0x4ee2('0x0'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x4ee2('0x4')]={'interface':{'type':_0x4ee2('0x0'),'required':!![]},'paused':{'type':_0x4ee2('0x2')},'reason':{'type':_0x4ee2('0x0'),'required':![]}};exports['reload']={'module':{'type':_0x4ee2('0x0'),'required':![]}};exports[_0x4ee2('0x5')]={'uniqueid':{'type':_0x4ee2('0x0'),'required':!![]}};exports[_0x4ee2('0x6')]={'uniqueid':{'type':_0x4ee2('0x0'),'required':!![]},'filename':{'type':_0x4ee2('0x0')},'format':{'type':_0x4ee2('0x0')},'mixmonitorid':{'type':_0x4ee2('0x0')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':'string','required':!![]}};exports[_0x4ee2('0x7')]={'uniqueid':{'type':_0x4ee2('0x0'),'required':!![]},'exten':{'type':_0x4ee2('0x0'),'required':!![]},'context':{'type':_0x4ee2('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 40f0c5e..48e2d04 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 _0xc30d=['bluebird','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','voiceQueues','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','isNil','interface','answered','sumHoldTime','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','initTelephones','isUndefined','initTrunks','initVoiceQueues','initTriggers','triggers','templates','initZendeskAccounts','salesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queue','queuecallerexit','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','queuecallerjoinAt','queuecallercomplete','queuecallerleaveAt','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports'];(function(_0x30871e,_0x8f2701){var _0x1ef62e=function(_0x2e5507){while(--_0x2e5507){_0x30871e['push'](_0x30871e['shift']());}};_0x1ef62e(++_0x8f2701);}(_0xc30d,0x6e));var _0xdc30=function(_0x461546,_0x152a89){_0x461546=_0x461546-0x0;var _0xf9e527=_0xc30d[_0x461546];return _0xf9e527;};'use strict';var BPromise=require(_0xdc30('0x0'));var util=require('util');var _=require(_0xdc30('0x1'));var moment=require(_0xdc30('0x2'));var Agent=require(_0xdc30('0x3'));var Telephone=require(_0xdc30('0x4'));var Trunk=require(_0xdc30('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0xdc30('0x6'));var Template=require('../model/template');var Campaign=require(_0xdc30('0x7'));var VoiceExtension=require(_0xdc30('0x8'));var ZendeskAccount=require(_0xdc30('0x9'));var SalesforceAccount=require(_0xdc30('0xa'));var FreshdeskAccount=require(_0xdc30('0xb'));var SugarcrmAccount=require(_0xdc30('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xdc30('0xd'));var VtigerAccount=require(_0xdc30('0xe'));var ServicenowAccount=require(_0xdc30('0xf'));var Dynamics365Account=require(_0xdc30('0x10'));var FaxAccount=require(_0xdc30('0x11'));var Realtime=function(){this[_0xdc30('0x12')]={};this[_0xdc30('0x13')]={};this[_0xdc30('0x14')]={};this[_0xdc30('0x15')]={};this['triggers']={};this['campaigns']={};this['templates']={};this[_0xdc30('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xdc30('0x17')]={};this[_0xdc30('0x18')]={};this[_0xdc30('0x19')]={};this[_0xdc30('0x1a')]={};this[_0xdc30('0x1b')]={};this[_0xdc30('0x1c')]={};this['salesforceAccounts']={};this[_0xdc30('0x1d')]={};this[_0xdc30('0x1e')]={};this[_0xdc30('0x1f')]={};this[_0xdc30('0x20')]={};this['vtigerAccounts']={};this[_0xdc30('0x21')]={};this[_0xdc30('0x22')]={};this[_0xdc30('0x23')]={};};function freeIsNotKey(_0x553b45,_0x21e3f1,_0x160404){var _0x3a3cb5=_[_0xdc30('0x24')](_0x553b45,function(_0x358251,_0xc88c27){return _0x358251[_0x160404];});for(var _0x37d9bb in _0x21e3f1){if(_0x21e3f1['hasOwnProperty'](_0x37d9bb)){if(!_0x3a3cb5[_0x37d9bb]){delete _0x21e3f1[_0x37d9bb];}}}}function freeIsNotKeySip(_0x3eff2c,_0x158bfc){var _0x57a868=_['mapKeys'](_0x3eff2c,function(_0x3d984e,_0x1620be){return util[_0xdc30('0x25')](_0xdc30('0x26'),_0x3d984e[_0xdc30('0x27')]);});for(var _0x2934a1 in _0x158bfc){if(_0x158bfc[_0xdc30('0x28')](_0x2934a1)){if(!_0x57a868[_0x2934a1]){delete _0x158bfc[_0x2934a1];}}}}function freeIsNotKeyAgent(_0x8dd720,_0x38f237){var _0x1696c2=_[_0xdc30('0x24')](_0x8dd720,function(_0xb06d46,_0x36ac96){var _0x274d9a=_[_0xdc30('0x29')](_0xb06d46[_0xdc30('0x2a')])?util['format'](_0xdc30('0x26'),_0xb06d46['name']):_0xb06d46['interface'];return _0x274d9a;});for(var _0x2bde2e in _0x38f237){if(_0x38f237[_0xdc30('0x28')](_0x2bde2e)){if(!_0x1696c2[_0x2bde2e]){delete _0x38f237[_0x2bde2e];}}}}function clearVoiceCallReports(_0xada788){_0xada788['total']=0x0;_0xada788[_0xdc30('0x2b')]=0x0;_0xada788[_0xdc30('0x2c')]=0x0;_0xada788['sumDuration']=0x0;_0xada788[_0xdc30('0x2d')]=0x0;}function clearCampaigns(_0x4dc9f8){if(!_[_0xdc30('0x2e')](_0x4dc9f8)){for(var _0x4c0725 in _0x4dc9f8){if(_0x4dc9f8[_0xdc30('0x28')](_0x4c0725)){_0x4dc9f8[_0x4c0725][_0xdc30('0x2f')]=0x0;_0x4dc9f8[_0x4c0725][_0xdc30('0x30')]=0x0;}}}}function clearVoiceQueues(_0x58cc60){if(!_['isEmpty'](_0x58cc60)){for(var _0x7c310e in _0x58cc60){if(_0x58cc60['hasOwnProperty'](_0x7c310e)){_0x58cc60[_0x7c310e][_0xdc30('0x31')]=0x0;_0x58cc60[_0x7c310e][_0xdc30('0x2b')]=0x0;_0x58cc60[_0x7c310e][_0xdc30('0x32')]=0x0;_0x58cc60[_0x7c310e][_0xdc30('0x33')]=0x0;_0x58cc60[_0x7c310e][_0xdc30('0x2c')]=0x0;_0x58cc60[_0x7c310e][_0xdc30('0x34')]=0x0;_0x58cc60[_0x7c310e]['sumBillable']=0x0;_0x58cc60[_0x7c310e][_0xdc30('0x35')]=0x0;_0x58cc60[_0x7c310e][_0xdc30('0x36')]=0x0;_0x58cc60[_0x7c310e][_0xdc30('0x37')]=0x0;_0x58cc60[_0x7c310e][_0xdc30('0x38')]=0x0;_0x58cc60[_0x7c310e][_0xdc30('0x39')]=0x0;_0x58cc60[_0x7c310e]['outboundUnknownCallsDay']=0x0;_0x58cc60[_0x7c310e][_0xdc30('0x3a')]=0x0;_0x58cc60[_0x7c310e][_0xdc30('0x3b')]=0x0;_0x58cc60[_0x7c310e][_0xdc30('0x3c')]=0x0;_0x58cc60[_0x7c310e][_0xdc30('0x3d')]=0x0;_0x58cc60[_0x7c310e]['outboundRejectCallsDay']=0x0;_0x58cc60[_0x7c310e][_0xdc30('0x3e')]=0x0;_0x58cc60[_0x7c310e][_0xdc30('0x35')]=0x0;_0x58cc60[_0x7c310e][_0xdc30('0x3f')]=0x0;_0x58cc60[_0x7c310e][_0xdc30('0x40')]=!![];}}}}Realtime[_0xdc30('0x41')][_0xdc30('0x42')]=function(_0x253adc,_0x7ba575){for(var _0x211786 in _0x7ba575){if(_0x253adc[_0xdc30('0x28')](_0x211786)){_0x253adc[_0x211786]=_0x7ba575[_0x211786];}}};Realtime['prototype'][_0xdc30('0x43')]=function(){var _0xa70641=this;return function(_0x13937c){if(_0x13937c){freeIsNotKeyAgent(_0x13937c,_0xa70641[_0xdc30('0x12')]);for(var _0x1c4a56=0x0,_0x4fcf33={},_0x157bee={};_0x1c4a56<_0x13937c[_0xdc30('0x44')];_0x1c4a56+=0x1){_0x4fcf33=_0x13937c[_0x1c4a56];var _0x84435b=_[_0xdc30('0x29')](_0x4fcf33[_0xdc30('0x2a')])?util[_0xdc30('0x25')](_0xdc30('0x26'),_0x4fcf33[_0xdc30('0x27')]):_0x4fcf33[_0xdc30('0x2a')];if(_['isUndefined'](_0xa70641[_0xdc30('0x12')][_0x84435b])){_0xa70641[_0xdc30('0x12')][_0x84435b]=new Agent(_0x4fcf33);}else{_0xa70641[_0xdc30('0x42')](_0xa70641[_0xdc30('0x12')][_0x84435b],_0x4fcf33);}}}return _0xa70641[_0xdc30('0x12')];};};Realtime[_0xdc30('0x41')][_0xdc30('0x45')]=function(){var _0x18acaf=this;return function(_0x151b77){if(_0x151b77){freeIsNotKeySip(_0x151b77,_0x18acaf[_0xdc30('0x13')]);for(var _0x19a1f3=0x0,_0x7a8cb3={},_0x45d12f={};_0x19a1f3<_0x151b77[_0xdc30('0x44')];_0x19a1f3+=0x1){_0x7a8cb3=_0x151b77[_0x19a1f3];if(_[_0xdc30('0x46')](_0x18acaf[_0xdc30('0x13')][util[_0xdc30('0x25')](_0xdc30('0x26'),_0x7a8cb3[_0xdc30('0x27')])])){_0x18acaf[_0xdc30('0x13')][util['format'](_0xdc30('0x26'),_0x7a8cb3[_0xdc30('0x27')])]=new Telephone(_0x7a8cb3);}else{_0x18acaf[_0xdc30('0x42')](_0x18acaf[_0xdc30('0x13')][util[_0xdc30('0x25')](_0xdc30('0x26'),_0x7a8cb3['name'])],_0x7a8cb3);}}}return _0x18acaf[_0xdc30('0x13')];};};Realtime['prototype'][_0xdc30('0x47')]=function(){var _0x231a19=this;return function(_0x598732){if(_0x598732){freeIsNotKeySip(_0x598732,_0x231a19[_0xdc30('0x14')]);for(var _0x997831=0x0,_0x2d865e={},_0x2a2ad4={};_0x997831<_0x598732[_0xdc30('0x44')];_0x997831+=0x1){_0x2d865e=_0x598732[_0x997831];if(_[_0xdc30('0x46')](_0x231a19[_0xdc30('0x14')][util[_0xdc30('0x25')](_0xdc30('0x26'),_0x2d865e[_0xdc30('0x27')])])){_0x231a19[_0xdc30('0x14')][util['format'](_0xdc30('0x26'),_0x2d865e['name'])]=new Trunk(_0x2d865e);}else{_0x231a19[_0xdc30('0x42')](_0x231a19['trunks'][util[_0xdc30('0x25')](_0xdc30('0x26'),_0x2d865e[_0xdc30('0x27')])],_0x2d865e);}}}return _0x231a19['trunks'];};};Realtime[_0xdc30('0x41')][_0xdc30('0x48')]=function(){var _0x4a3924=this;return function(_0x1603b1){if(_0x1603b1){freeIsNotKey(_0x1603b1,_0x4a3924[_0xdc30('0x15')],_0xdc30('0x27'));for(var _0x2e8ebf=0x0,_0x494c48={},_0x2a6a8d={};_0x2e8ebf<_0x1603b1[_0xdc30('0x44')];_0x2e8ebf+=0x1){_0x494c48=_0x1603b1[_0x2e8ebf];if(_[_0xdc30('0x46')](_0x4a3924[_0xdc30('0x15')][_0x494c48[_0xdc30('0x27')]])){_0x4a3924[_0xdc30('0x15')][_0x494c48[_0xdc30('0x27')]]=new VoiceQueue(_0x494c48);}else{_0x4a3924[_0xdc30('0x42')](_0x4a3924[_0xdc30('0x15')][_0x494c48[_0xdc30('0x27')]],_0x494c48);}}}return _0x4a3924[_0xdc30('0x15')];};};Realtime[_0xdc30('0x41')][_0xdc30('0x49')]=function(){var _0x12d6a0=this;return function(_0x525366){if(_0x525366){freeIsNotKey(_0x525366,_0x12d6a0['triggers'],'id');for(var _0x2e1246=0x0,_0x14c883={},_0x2ec952={};_0x2e1246<_0x525366[_0xdc30('0x44')];_0x2e1246+=0x1){_0x14c883=_0x525366[_0x2e1246];if(_[_0xdc30('0x46')](_0x12d6a0[_0xdc30('0x4a')][_0x14c883['id']])){_0x12d6a0[_0xdc30('0x4a')][_0x14c883['id']]=new Trigger(_0x14c883);}else{_0x12d6a0[_0xdc30('0x42')](_0x12d6a0[_0xdc30('0x4a')][_0x14c883['id']],_0x14c883);}}}return _0x12d6a0['triggers'];};};Realtime[_0xdc30('0x41')]['initTemplates']=function(){var _0xe4f180=this;return function(_0x5036b2){if(_0x5036b2){freeIsNotKey(_0x5036b2,_0xe4f180['templates'],'id');for(var _0x4c5a3f=0x0,_0x35a3bb={},_0xcf2e54={};_0x4c5a3f<_0x5036b2[_0xdc30('0x44')];_0x4c5a3f+=0x1){_0x35a3bb=_0x5036b2[_0x4c5a3f];if(_[_0xdc30('0x46')](_0xe4f180[_0xdc30('0x4b')][_0x35a3bb['id']])){_0xe4f180[_0xdc30('0x4b')][_0x35a3bb['id']]=new Template(_0x35a3bb);}else{_0xe4f180[_0xdc30('0x42')](_0xe4f180[_0xdc30('0x4b')][_0x35a3bb['id']],_0x35a3bb);}}}return _0xe4f180[_0xdc30('0x4b')];};};Realtime[_0xdc30('0x41')][_0xdc30('0x4c')]=function(){var _0x169f1c=this;return function(_0x1abdc0){if(_0x1abdc0){freeIsNotKey(_0x1abdc0,_0x169f1c['zendeskAccounts'],'id');for(var _0x59458a=0x0,_0x126359={},_0x14e9f7={};_0x59458a<_0x1abdc0[_0xdc30('0x44')];_0x59458a+=0x1){_0x126359=_0x1abdc0[_0x59458a];if(_[_0xdc30('0x46')](_0x169f1c[_0xdc30('0x1c')][_0x126359['id']])){_0x169f1c[_0xdc30('0x1c')][_0x126359['id']]=new ZendeskAccount(_0x126359);}else{_0x169f1c[_0xdc30('0x42')](_0x169f1c[_0xdc30('0x1c')][_0x126359['id']],_0x126359);}}}return _0x169f1c[_0xdc30('0x1c')];};};Realtime[_0xdc30('0x41')]['initSalesforceAccounts']=function(){var _0x15490e=this;return function(_0x410905){if(_0x410905){freeIsNotKey(_0x410905,_0x15490e['salesforceAccounts'],'id');for(var _0x4051b4=0x0,_0x1229d7={},_0x125539={};_0x4051b4<_0x410905[_0xdc30('0x44')];_0x4051b4+=0x1){_0x1229d7=_0x410905[_0x4051b4];if(_['isUndefined'](_0x15490e[_0xdc30('0x4d')][_0x1229d7['id']])){_0x15490e[_0xdc30('0x4d')][_0x1229d7['id']]=new SalesforceAccount(_0x1229d7);}else{_0x15490e['mergeFromDatabase'](_0x15490e['salesforceAccounts'][_0x1229d7['id']],_0x1229d7);}}}return _0x15490e[_0xdc30('0x4d')];};};Realtime[_0xdc30('0x41')]['initFreshdeskAccounts']=function(){var _0x293b6c=this;return function(_0x1bd9d1){if(_0x1bd9d1){freeIsNotKey(_0x1bd9d1,_0x293b6c[_0xdc30('0x1e')],'id');for(var _0x23b034=0x0,_0x3975c8={},_0x238aa7={};_0x23b034<_0x1bd9d1[_0xdc30('0x44')];_0x23b034+=0x1){_0x3975c8=_0x1bd9d1[_0x23b034];if(_['isUndefined'](_0x293b6c[_0xdc30('0x1e')][_0x3975c8['id']])){_0x293b6c[_0xdc30('0x1e')][_0x3975c8['id']]=new FreshdeskAccount(_0x3975c8);}else{_0x293b6c[_0xdc30('0x42')](_0x293b6c[_0xdc30('0x1e')][_0x3975c8['id']],_0x3975c8);}}}return _0x293b6c[_0xdc30('0x1e')];};};Realtime[_0xdc30('0x41')][_0xdc30('0x4e')]=function(){var _0x2190bb=this;return function(_0x4f38ac){if(_0x4f38ac){freeIsNotKey(_0x4f38ac,_0x2190bb[_0xdc30('0x1f')],'id');for(var _0x1236f8=0x0,_0x401163={},_0x390b93={};_0x1236f8<_0x4f38ac[_0xdc30('0x44')];_0x1236f8+=0x1){_0x401163=_0x4f38ac[_0x1236f8];if(_['isUndefined'](_0x2190bb[_0xdc30('0x1f')][_0x401163['id']])){_0x2190bb[_0xdc30('0x1f')][_0x401163['id']]=new ZohoAccount(_0x401163);}else{_0x2190bb[_0xdc30('0x42')](_0x2190bb[_0xdc30('0x1f')][_0x401163['id']],_0x401163);}}}return _0x2190bb[_0xdc30('0x1f')];};};Realtime['prototype'][_0xdc30('0x4f')]=function(){var _0x363c53=this;return function(_0x40626c){if(_0x40626c){freeIsNotKey(_0x40626c,_0x363c53[_0xdc30('0x20')],'id');for(var _0x5dad2d=0x0,_0x1309e3={},_0x4f6e4d={};_0x5dad2d<_0x40626c[_0xdc30('0x44')];_0x5dad2d+=0x1){_0x1309e3=_0x40626c[_0x5dad2d];if(_['isUndefined'](_0x363c53[_0xdc30('0x20')][_0x1309e3['id']])){_0x363c53['deskAccounts'][_0x1309e3['id']]=new DeskAccount(_0x1309e3);}else{_0x363c53['mergeFromDatabase'](_0x363c53[_0xdc30('0x20')][_0x1309e3['id']],_0x1309e3);}}}return _0x363c53[_0xdc30('0x20')];};};Realtime['prototype'][_0xdc30('0x50')]=function(){var _0x5db99b=this;return function(_0x50db8d){if(_0x50db8d){freeIsNotKey(_0x50db8d,_0x5db99b['sugarcrmAccounts'],'id');for(var _0x336b23=0x0,_0x4036f7={},_0x1e8185={};_0x336b23<_0x50db8d['length'];_0x336b23+=0x1){_0x4036f7=_0x50db8d[_0x336b23];if(_['isUndefined'](_0x5db99b['sugarcrmAccounts'][_0x4036f7['id']])){_0x5db99b['sugarcrmAccounts'][_0x4036f7['id']]=new SugarcrmAccount(_0x4036f7);}else{_0x5db99b[_0xdc30('0x42')](_0x5db99b[_0xdc30('0x1d')][_0x4036f7['id']],_0x4036f7);}}}return _0x5db99b[_0xdc30('0x1d')];};};Realtime[_0xdc30('0x41')][_0xdc30('0x51')]=function(){var _0x9f034=this;return function(_0xab4d2){if(_0xab4d2){freeIsNotKey(_0xab4d2,_0x9f034['vtigerAccounts'],'id');for(var _0x289360=0x0,_0x2aeda8={},_0x287786={};_0x289360<_0xab4d2[_0xdc30('0x44')];_0x289360+=0x1){_0x2aeda8=_0xab4d2[_0x289360];if(_[_0xdc30('0x46')](_0x9f034['vtigerAccounts'][_0x2aeda8['id']])){_0x9f034[_0xdc30('0x52')][_0x2aeda8['id']]=new VtigerAccount(_0x2aeda8);}else{_0x9f034[_0xdc30('0x42')](_0x9f034[_0xdc30('0x52')][_0x2aeda8['id']],_0x2aeda8);}}}return _0x9f034[_0xdc30('0x52')];};};Realtime[_0xdc30('0x41')][_0xdc30('0x53')]=function(){var _0x511e60=this;return function(_0x1a99f0){if(_0x1a99f0){freeIsNotKey(_0x1a99f0,_0x511e60['servicenowAccounts'],'id');for(var _0x39681b=0x0,_0x1fb99f={},_0x23fb25={};_0x39681b<_0x1a99f0[_0xdc30('0x44')];_0x39681b+=0x1){_0x1fb99f=_0x1a99f0[_0x39681b];if(_['isUndefined'](_0x511e60[_0xdc30('0x21')][_0x1fb99f['id']])){_0x511e60['servicenowAccounts'][_0x1fb99f['id']]=new ServicenowAccount(_0x1fb99f);}else{_0x511e60[_0xdc30('0x42')](_0x511e60[_0xdc30('0x21')][_0x1fb99f['id']],_0x1fb99f);}}}return _0x511e60[_0xdc30('0x21')];};};Realtime[_0xdc30('0x41')][_0xdc30('0x54')]=function(){var _0x46ba67=this;return function(_0x1c918c){if(_0x1c918c){freeIsNotKey(_0x1c918c,_0x46ba67[_0xdc30('0x22')],'id');for(var _0x3f5a65=0x0,_0x2a1069={},_0x5c3a3b={};_0x3f5a65<_0x1c918c[_0xdc30('0x44')];_0x3f5a65+=0x1){_0x2a1069=_0x1c918c[_0x3f5a65];if(_[_0xdc30('0x46')](_0x46ba67[_0xdc30('0x22')][_0x2a1069['id']])){_0x46ba67['dynamics365Accounts'][_0x2a1069['id']]=new Dynamics365Account(_0x2a1069);}else{_0x46ba67[_0xdc30('0x42')](_0x46ba67[_0xdc30('0x22')][_0x2a1069['id']],_0x2a1069);}}}return _0x46ba67[_0xdc30('0x22')];};};Realtime[_0xdc30('0x41')][_0xdc30('0x55')]=function(){var _0xd0ef18=this;return function(_0x5ee0a7){for(var _0x2228b6=0x0;_0x2228b6<_0x5ee0a7[_0xdc30('0x44')];_0x2228b6+=0x1){_[_0xdc30('0x56')](_0xd0ef18[_0xdc30('0x15')][_0x5ee0a7[_0x2228b6][_0xdc30('0x27')]],_0x5ee0a7[_0x2228b6]);}return _0xd0ef18[_0xdc30('0x15')];};};Realtime['prototype'][_0xdc30('0x57')]=function(){var _0x231bae=this;return function(_0x1e6bc1){clearVoiceQueues(_0x231bae[_0xdc30('0x15')]);if(_0x1e6bc1){_0x1e6bc1=_['groupBy'](_0x1e6bc1,_0xdc30('0x58'));for(var _0x54db1c in _0x1e6bc1){if(_0x1e6bc1[_0xdc30('0x28')](_0x54db1c)){var _0x186c9c={};for(var _0x59ed9e=0x0;_0x59ed9e<_0x1e6bc1[_0x54db1c][_0xdc30('0x44')];_0x59ed9e+=0x1){var _0x53a857=_0x1e6bc1[_0x54db1c][_0x59ed9e][_0xdc30('0x59')];if(_0x231bae['voiceQueues'][_0x53a857]){if(_0x1e6bc1[_0x54db1c][_0x59ed9e][_0xdc30('0x5a')]){_0x231bae[_0xdc30('0x15')][_0x53a857][_0xdc30('0x32')]+=0x1;}if(_0x1e6bc1[_0x54db1c][_0x59ed9e]['queuecallerabandon']){_0x231bae[_0xdc30('0x15')][_0x53a857][_0xdc30('0x33')]+=0x1;}_0x231bae['voiceQueues'][_0x53a857][_0xdc30('0x2c')]+=moment(_0x1e6bc1[_0x54db1c][_0x59ed9e]['queuecallerleaveAt'])['diff'](moment(_0x1e6bc1[_0x54db1c][_0x59ed9e]['queuecallerjoinAt']),_0xdc30('0x5b'))||0x0;if(_0x59ed9e===_0x1e6bc1[_0x54db1c][_0xdc30('0x44')]-0x1){_0x231bae[_0xdc30('0x15')][_0x53a857][_0xdc30('0x34')]+=moment(_0x1e6bc1[_0x54db1c][_0x59ed9e][_0xdc30('0x5c')]||_0x1e6bc1[_0x54db1c][_0x59ed9e][_0xdc30('0x5d')]||_0x1e6bc1[_0x54db1c][_0x59ed9e][_0xdc30('0x5e')])[_0xdc30('0x5f')](moment(_0x1e6bc1[_0x54db1c][_0x59ed9e][_0xdc30('0x60')]),_0xdc30('0x5b'))||0x0;_0x231bae[_0xdc30('0x15')][_0x53a857]['total']+=0x1;if(_0x1e6bc1[_0x54db1c][_0x59ed9e][_0xdc30('0x61')]){_0x231bae[_0xdc30('0x15')][_0x53a857][_0xdc30('0x2b')]+=0x1;_0x231bae[_0xdc30('0x15')][_0x53a857][_0xdc30('0x2d')]+=moment(_0x1e6bc1[_0x54db1c][_0x59ed9e][_0xdc30('0x5c')])[_0xdc30('0x5f')](moment(_0x1e6bc1[_0x54db1c][_0x59ed9e][_0xdc30('0x62')]),_0xdc30('0x5b'))||0x0;}}else{_0x231bae['voiceQueues'][_0x53a857]['sumDuration']+=_0x231bae[_0xdc30('0x15')][_0x53a857]['sumHoldTime']||0x0;}}}}}}return _0x231bae[_0xdc30('0x15')];};};Realtime[_0xdc30('0x41')][_0xdc30('0x63')]=function(){var _0x460bb3=this;return function(_0x3aca52){clearVoiceCallReports(_0x460bb3[_0xdc30('0x16')]);if(_0x3aca52){for(var _0x3017ed=0x0;_0x3017ed<_0x3aca52[_0xdc30('0x44')];_0x3017ed+=0x1){_0x460bb3[_0xdc30('0x16')]['total']+=0x1;_0x460bb3[_0xdc30('0x16')][_0xdc30('0x34')]+=_0x3aca52[_0x3017ed][_0xdc30('0x64')];if(_0x3aca52[_0x3017ed][_0xdc30('0x65')]===_0xdc30('0x66')){_0x460bb3[_0xdc30('0x16')][_0xdc30('0x2b')]+=0x1;_0x460bb3[_0xdc30('0x16')][_0xdc30('0x2c')]+=_0x3aca52[_0x3017ed]['duration']-_0x3aca52[_0x3017ed]['billableseconds']||0x0;_0x460bb3[_0xdc30('0x16')][_0xdc30('0x2d')]+=_0x3aca52[_0x3017ed][_0xdc30('0x67')];}}}return _0x460bb3[_0xdc30('0x16')];};};Realtime[_0xdc30('0x41')][_0xdc30('0x68')]=function(){var _0x4734a=this;return function(_0x5f2742){if(_0x5f2742){freeIsNotKey(_0x5f2742,_0x4734a['campaigns'],_0xdc30('0x27'));for(var _0x10f1a3=0x0,_0x17609b={};_0x10f1a3<_0x5f2742[_0xdc30('0x44')];_0x10f1a3+=0x1){_0x17609b=_0x5f2742[_0x10f1a3];if(_[_0xdc30('0x46')](_0x4734a[_0xdc30('0x69')][_0x17609b['name']])){_0x4734a[_0xdc30('0x69')][_0x17609b[_0xdc30('0x27')]]=new Campaign(_0x17609b);}else{_0x4734a[_0xdc30('0x42')](_0x4734a[_0xdc30('0x69')][_0x17609b[_0xdc30('0x27')]],_0x17609b);}}}return _0x4734a['campaigns'];};};Realtime[_0xdc30('0x41')][_0xdc30('0x6a')]=function(){var _0x2aed3e=this;return function(_0x139bcb){if(_0x139bcb){freeIsNotKey(_0x139bcb,_0x2aed3e[_0xdc30('0x17')],'id');for(var _0x186569=0x0,_0x3dd74a={};_0x186569<_0x139bcb[_0xdc30('0x44')];_0x186569+=0x1){_0x3dd74a=_0x139bcb[_0x186569];if(_[_0xdc30('0x46')](_0x2aed3e['voiceExtensions'][_0x3dd74a['id']])){_0x2aed3e['voiceExtensions'][_0x3dd74a['id']]=new VoiceExtension(_0x3dd74a);}else{_0x2aed3e['mergeFromDatabase'](_0x2aed3e[_0xdc30('0x17')][_0x3dd74a['id']],_0x3dd74a);}}}return _0x2aed3e['voiceExtensions'];};};Realtime[_0xdc30('0x41')][_0xdc30('0x6b')]=function(){var _0x32841a=this;return function(_0x455286){clearCampaigns(_0x32841a[_0xdc30('0x69')]);for(var _0x5c5712=0x0;_0x5c5712<_0x455286[_0xdc30('0x44')];_0x5c5712+=0x1){_[_0xdc30('0x56')](_0x32841a['campaigns'][_0x455286[_0x5c5712]['name']],_0x455286[_0x5c5712]);}return _0x32841a[_0xdc30('0x69')];};};Realtime[_0xdc30('0x41')][_0xdc30('0x6c')]=function(){var _0x4b7b51=this;return function(_0x9b4c28){if(_0x9b4c28){freeIsNotKey(_0x9b4c28,_0x4b7b51[_0xdc30('0x23')],'id');for(var _0x4c2453=0x0,_0x16cec0={},_0x5cc116={};_0x4c2453<_0x9b4c28[_0xdc30('0x44')];_0x4c2453+=0x1){_0x16cec0=_0x9b4c28[_0x4c2453];if(_['isUndefined'](_0x4b7b51[_0xdc30('0x23')][_0x16cec0['id']])){_0x4b7b51[_0xdc30('0x23')][_0x16cec0['id']]=new FaxAccount(_0x16cec0);}else{_0x4b7b51[_0xdc30('0x42')](_0x4b7b51[_0xdc30('0x23')][_0x16cec0['id']],_0x16cec0);}}}return _0x4b7b51[_0xdc30('0x23')];};};module[_0xdc30('0x6d')]=Realtime; \ No newline at end of file +var _0x5d6b=['trunks','voiceQueues','triggers','campaigns','templates','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','unmanaged','abandoned','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','name','isUndefined','initTelephones','initVoiceQueues','initTriggers','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','servicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','queuecallercompleteAt','diff','queuecallerleaveAt','outbound','ANSWERED','billableseconds','initCampaigns','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones'];(function(_0x2a0bf0,_0x247ffd){var _0x104fd6=function(_0x555e9b){while(--_0x555e9b){_0x2a0bf0['push'](_0x2a0bf0['shift']());}};_0x104fd6(++_0x247ffd);}(_0x5d6b,0xc1));var _0xb5d6=function(_0x1730dd,_0x3cacb2){_0x1730dd=_0x1730dd-0x0;var _0x15a53c=_0x5d6b[_0x1730dd];return _0x15a53c;};'use strict';var BPromise=require(_0xb5d6('0x0'));var util=require(_0xb5d6('0x1'));var _=require(_0xb5d6('0x2'));var moment=require(_0xb5d6('0x3'));var Agent=require(_0xb5d6('0x4'));var Telephone=require(_0xb5d6('0x5'));var Trunk=require(_0xb5d6('0x6'));var VoiceQueue=require(_0xb5d6('0x7'));var Trigger=require('../model/trigger');var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0xb5d6('0x8'));var ZendeskAccount=require(_0xb5d6('0x9'));var SalesforceAccount=require(_0xb5d6('0xa'));var FreshdeskAccount=require(_0xb5d6('0xb'));var SugarcrmAccount=require(_0xb5d6('0xc'));var ZohoAccount=require(_0xb5d6('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xb5d6('0xe'));var Dynamics365Account=require(_0xb5d6('0xf'));var FaxAccount=require(_0xb5d6('0x10'));var Realtime=function(){this[_0xb5d6('0x11')]={};this[_0xb5d6('0x12')]={};this[_0xb5d6('0x13')]={};this[_0xb5d6('0x14')]={};this[_0xb5d6('0x15')]={};this[_0xb5d6('0x16')]={};this[_0xb5d6('0x17')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xb5d6('0x18')]={};this[_0xb5d6('0x19')]={};this[_0xb5d6('0x1a')]={};this[_0xb5d6('0x1b')]={};this[_0xb5d6('0x1c')]={};this[_0xb5d6('0x1d')]={};this[_0xb5d6('0x1e')]={};this[_0xb5d6('0x1f')]={};this[_0xb5d6('0x20')]={};this[_0xb5d6('0x21')]={};this[_0xb5d6('0x22')]={};this[_0xb5d6('0x23')]={};this['servicenowAccounts']={};this[_0xb5d6('0x24')]={};this[_0xb5d6('0x25')]={};};function freeIsNotKey(_0x6eb599,_0x140542,_0x1d760f){var _0x1afaf2=_[_0xb5d6('0x26')](_0x6eb599,function(_0x4b7b5d,_0x4eb104){return _0x4b7b5d[_0x1d760f];});for(var _0x251e61 in _0x140542){if(_0x140542[_0xb5d6('0x27')](_0x251e61)){if(!_0x1afaf2[_0x251e61]){delete _0x140542[_0x251e61];}}}}function freeIsNotKeySip(_0x269113,_0x100ee0){var _0x16ba96=_[_0xb5d6('0x26')](_0x269113,function(_0x5d6a40,_0x1085cb){return util[_0xb5d6('0x28')](_0xb5d6('0x29'),_0x5d6a40['name']);});for(var _0x4f1c12 in _0x100ee0){if(_0x100ee0[_0xb5d6('0x27')](_0x4f1c12)){if(!_0x16ba96[_0x4f1c12]){delete _0x100ee0[_0x4f1c12];}}}}function freeIsNotKeyAgent(_0x1f30ca,_0x23aac5){var _0x45428f=_[_0xb5d6('0x26')](_0x1f30ca,function(_0x582152,_0x239ab4){var _0x418ba8=_[_0xb5d6('0x2a')](_0x582152[_0xb5d6('0x2b')])?util[_0xb5d6('0x28')](_0xb5d6('0x29'),_0x582152['name']):_0x582152['interface'];return _0x418ba8;});for(var _0x1a5701 in _0x23aac5){if(_0x23aac5[_0xb5d6('0x27')](_0x1a5701)){if(!_0x45428f[_0x1a5701]){delete _0x23aac5[_0x1a5701];}}}}function clearVoiceCallReports(_0x328677){_0x328677[_0xb5d6('0x2c')]=0x0;_0x328677[_0xb5d6('0x2d')]=0x0;_0x328677[_0xb5d6('0x2e')]=0x0;_0x328677[_0xb5d6('0x2f')]=0x0;_0x328677[_0xb5d6('0x30')]=0x0;}function clearCampaigns(_0x59ab60){if(!_['isEmpty'](_0x59ab60)){for(var _0x5b83d1 in _0x59ab60){if(_0x59ab60['hasOwnProperty'](_0x5b83d1)){_0x59ab60[_0x5b83d1][_0xb5d6('0x31')]=0x0;_0x59ab60[_0x5b83d1][_0xb5d6('0x32')]=0x0;}}}}function clearVoiceQueues(_0x145fe5){if(!_[_0xb5d6('0x33')](_0x145fe5)){for(var _0x379132 in _0x145fe5){if(_0x145fe5[_0xb5d6('0x27')](_0x379132)){_0x145fe5[_0x379132][_0xb5d6('0x2c')]=0x0;_0x145fe5[_0x379132]['answered']=0x0;_0x145fe5[_0x379132][_0xb5d6('0x34')]=0x0;_0x145fe5[_0x379132][_0xb5d6('0x35')]=0x0;_0x145fe5[_0x379132]['sumHoldTime']=0x0;_0x145fe5[_0x379132][_0xb5d6('0x2f')]=0x0;_0x145fe5[_0x379132]['sumBillable']=0x0;_0x145fe5[_0x379132]['outboundAnswerAgiCallsDay']=0x0;_0x145fe5[_0x379132]['outboundNoAnswerCallsDay']=0x0;_0x145fe5[_0x379132][_0xb5d6('0x36')]=0x0;_0x145fe5[_0x379132][_0xb5d6('0x37')]=0x0;_0x145fe5[_0x379132][_0xb5d6('0x38')]=0x0;_0x145fe5[_0x379132]['outboundUnknownCallsDay']=0x0;_0x145fe5[_0x379132][_0xb5d6('0x39')]=0x0;_0x145fe5[_0x379132][_0xb5d6('0x3a')]=0x0;_0x145fe5[_0x379132][_0xb5d6('0x3b')]=0x0;_0x145fe5[_0x379132][_0xb5d6('0x3c')]=0x0;_0x145fe5[_0x379132][_0xb5d6('0x3d')]=0x0;_0x145fe5[_0x379132][_0xb5d6('0x3e')]=0x0;_0x145fe5[_0x379132][_0xb5d6('0x3f')]=0x0;_0x145fe5[_0x379132][_0xb5d6('0x40')]=0x0;_0x145fe5[_0x379132][_0xb5d6('0x41')]=!![];}}}}Realtime['prototype'][_0xb5d6('0x42')]=function(_0x553390,_0x2d851e){for(var _0x5cbf63 in _0x2d851e){if(_0x553390[_0xb5d6('0x27')](_0x5cbf63)){_0x553390[_0x5cbf63]=_0x2d851e[_0x5cbf63];}}};Realtime[_0xb5d6('0x43')][_0xb5d6('0x44')]=function(){var _0x5c8af5=this;return function(_0x58cd60){if(_0x58cd60){freeIsNotKeyAgent(_0x58cd60,_0x5c8af5[_0xb5d6('0x11')]);for(var _0x53419f=0x0,_0x498779={},_0xa097fc={};_0x53419f<_0x58cd60[_0xb5d6('0x45')];_0x53419f+=0x1){_0x498779=_0x58cd60[_0x53419f];var _0x5a8eaa=_[_0xb5d6('0x2a')](_0x498779[_0xb5d6('0x2b')])?util['format'](_0xb5d6('0x29'),_0x498779[_0xb5d6('0x46')]):_0x498779[_0xb5d6('0x2b')];if(_[_0xb5d6('0x47')](_0x5c8af5[_0xb5d6('0x11')][_0x5a8eaa])){_0x5c8af5[_0xb5d6('0x11')][_0x5a8eaa]=new Agent(_0x498779);}else{_0x5c8af5[_0xb5d6('0x42')](_0x5c8af5['agents'][_0x5a8eaa],_0x498779);}}}return _0x5c8af5[_0xb5d6('0x11')];};};Realtime[_0xb5d6('0x43')][_0xb5d6('0x48')]=function(){var _0x471002=this;return function(_0x3bd12e){if(_0x3bd12e){freeIsNotKeySip(_0x3bd12e,_0x471002[_0xb5d6('0x12')]);for(var _0x9e0ad2=0x0,_0x3abea9={},_0x285de6={};_0x9e0ad2<_0x3bd12e[_0xb5d6('0x45')];_0x9e0ad2+=0x1){_0x3abea9=_0x3bd12e[_0x9e0ad2];if(_[_0xb5d6('0x47')](_0x471002[_0xb5d6('0x12')][util[_0xb5d6('0x28')](_0xb5d6('0x29'),_0x3abea9[_0xb5d6('0x46')])])){_0x471002[_0xb5d6('0x12')][util['format'](_0xb5d6('0x29'),_0x3abea9[_0xb5d6('0x46')])]=new Telephone(_0x3abea9);}else{_0x471002[_0xb5d6('0x42')](_0x471002[_0xb5d6('0x12')][util[_0xb5d6('0x28')](_0xb5d6('0x29'),_0x3abea9[_0xb5d6('0x46')])],_0x3abea9);}}}return _0x471002[_0xb5d6('0x12')];};};Realtime[_0xb5d6('0x43')]['initTrunks']=function(){var _0x46410c=this;return function(_0x46e27b){if(_0x46e27b){freeIsNotKeySip(_0x46e27b,_0x46410c['trunks']);for(var _0x3146f8=0x0,_0x119a17={},_0x57c2b6={};_0x3146f8<_0x46e27b[_0xb5d6('0x45')];_0x3146f8+=0x1){_0x119a17=_0x46e27b[_0x3146f8];if(_[_0xb5d6('0x47')](_0x46410c[_0xb5d6('0x13')][util[_0xb5d6('0x28')](_0xb5d6('0x29'),_0x119a17[_0xb5d6('0x46')])])){_0x46410c[_0xb5d6('0x13')][util[_0xb5d6('0x28')](_0xb5d6('0x29'),_0x119a17[_0xb5d6('0x46')])]=new Trunk(_0x119a17);}else{_0x46410c[_0xb5d6('0x42')](_0x46410c[_0xb5d6('0x13')][util[_0xb5d6('0x28')](_0xb5d6('0x29'),_0x119a17[_0xb5d6('0x46')])],_0x119a17);}}}return _0x46410c[_0xb5d6('0x13')];};};Realtime['prototype'][_0xb5d6('0x49')]=function(){var _0x4d6f9c=this;return function(_0x5260ab){if(_0x5260ab){freeIsNotKey(_0x5260ab,_0x4d6f9c[_0xb5d6('0x14')],_0xb5d6('0x46'));for(var _0x43d125=0x0,_0x17bb65={},_0x16799d={};_0x43d125<_0x5260ab[_0xb5d6('0x45')];_0x43d125+=0x1){_0x17bb65=_0x5260ab[_0x43d125];if(_[_0xb5d6('0x47')](_0x4d6f9c['voiceQueues'][_0x17bb65[_0xb5d6('0x46')]])){_0x4d6f9c[_0xb5d6('0x14')][_0x17bb65[_0xb5d6('0x46')]]=new VoiceQueue(_0x17bb65);}else{_0x4d6f9c[_0xb5d6('0x42')](_0x4d6f9c[_0xb5d6('0x14')][_0x17bb65[_0xb5d6('0x46')]],_0x17bb65);}}}return _0x4d6f9c[_0xb5d6('0x14')];};};Realtime['prototype'][_0xb5d6('0x4a')]=function(){var _0x19b679=this;return function(_0x386fe2){if(_0x386fe2){freeIsNotKey(_0x386fe2,_0x19b679['triggers'],'id');for(var _0x5729bc=0x0,_0x35b4e2={},_0x5a3d2b={};_0x5729bc<_0x386fe2[_0xb5d6('0x45')];_0x5729bc+=0x1){_0x35b4e2=_0x386fe2[_0x5729bc];if(_[_0xb5d6('0x47')](_0x19b679[_0xb5d6('0x15')][_0x35b4e2['id']])){_0x19b679[_0xb5d6('0x15')][_0x35b4e2['id']]=new Trigger(_0x35b4e2);}else{_0x19b679[_0xb5d6('0x42')](_0x19b679[_0xb5d6('0x15')][_0x35b4e2['id']],_0x35b4e2);}}}return _0x19b679[_0xb5d6('0x15')];};};Realtime[_0xb5d6('0x43')]['initTemplates']=function(){var _0x1905c1=this;return function(_0x4549df){if(_0x4549df){freeIsNotKey(_0x4549df,_0x1905c1['templates'],'id');for(var _0x3dbb00=0x0,_0x36d213={},_0x3a20aa={};_0x3dbb00<_0x4549df[_0xb5d6('0x45')];_0x3dbb00+=0x1){_0x36d213=_0x4549df[_0x3dbb00];if(_[_0xb5d6('0x47')](_0x1905c1[_0xb5d6('0x17')][_0x36d213['id']])){_0x1905c1[_0xb5d6('0x17')][_0x36d213['id']]=new Template(_0x36d213);}else{_0x1905c1[_0xb5d6('0x42')](_0x1905c1[_0xb5d6('0x17')][_0x36d213['id']],_0x36d213);}}}return _0x1905c1[_0xb5d6('0x17')];};};Realtime[_0xb5d6('0x43')][_0xb5d6('0x4b')]=function(){var _0x5d0da5=this;return function(_0x12ee06){if(_0x12ee06){freeIsNotKey(_0x12ee06,_0x5d0da5[_0xb5d6('0x1d')],'id');for(var _0x505579=0x0,_0x4fe650={},_0x4c2e78={};_0x505579<_0x12ee06[_0xb5d6('0x45')];_0x505579+=0x1){_0x4fe650=_0x12ee06[_0x505579];if(_[_0xb5d6('0x47')](_0x5d0da5[_0xb5d6('0x1d')][_0x4fe650['id']])){_0x5d0da5['zendeskAccounts'][_0x4fe650['id']]=new ZendeskAccount(_0x4fe650);}else{_0x5d0da5[_0xb5d6('0x42')](_0x5d0da5[_0xb5d6('0x1d')][_0x4fe650['id']],_0x4fe650);}}}return _0x5d0da5[_0xb5d6('0x1d')];};};Realtime['prototype'][_0xb5d6('0x4c')]=function(){var _0x94ffd=this;return function(_0x50201f){if(_0x50201f){freeIsNotKey(_0x50201f,_0x94ffd[_0xb5d6('0x1e')],'id');for(var _0x640eb=0x0,_0x3a8617={},_0x44c984={};_0x640eb<_0x50201f[_0xb5d6('0x45')];_0x640eb+=0x1){_0x3a8617=_0x50201f[_0x640eb];if(_['isUndefined'](_0x94ffd['salesforceAccounts'][_0x3a8617['id']])){_0x94ffd[_0xb5d6('0x1e')][_0x3a8617['id']]=new SalesforceAccount(_0x3a8617);}else{_0x94ffd['mergeFromDatabase'](_0x94ffd[_0xb5d6('0x1e')][_0x3a8617['id']],_0x3a8617);}}}return _0x94ffd[_0xb5d6('0x1e')];};};Realtime['prototype'][_0xb5d6('0x4d')]=function(){var _0x11b30b=this;return function(_0x37b6fb){if(_0x37b6fb){freeIsNotKey(_0x37b6fb,_0x11b30b[_0xb5d6('0x20')],'id');for(var _0x2ab69e=0x0,_0x43c1fe={},_0x9e3118={};_0x2ab69e<_0x37b6fb[_0xb5d6('0x45')];_0x2ab69e+=0x1){_0x43c1fe=_0x37b6fb[_0x2ab69e];if(_[_0xb5d6('0x47')](_0x11b30b[_0xb5d6('0x20')][_0x43c1fe['id']])){_0x11b30b[_0xb5d6('0x20')][_0x43c1fe['id']]=new FreshdeskAccount(_0x43c1fe);}else{_0x11b30b['mergeFromDatabase'](_0x11b30b[_0xb5d6('0x20')][_0x43c1fe['id']],_0x43c1fe);}}}return _0x11b30b[_0xb5d6('0x20')];};};Realtime['prototype'][_0xb5d6('0x4e')]=function(){var _0x320e41=this;return function(_0x478c30){if(_0x478c30){freeIsNotKey(_0x478c30,_0x320e41['zohoAccounts'],'id');for(var _0x178d9a=0x0,_0x493109={},_0x3959b5={};_0x178d9a<_0x478c30[_0xb5d6('0x45')];_0x178d9a+=0x1){_0x493109=_0x478c30[_0x178d9a];if(_['isUndefined'](_0x320e41['zohoAccounts'][_0x493109['id']])){_0x320e41['zohoAccounts'][_0x493109['id']]=new ZohoAccount(_0x493109);}else{_0x320e41[_0xb5d6('0x42')](_0x320e41[_0xb5d6('0x21')][_0x493109['id']],_0x493109);}}}return _0x320e41['zohoAccounts'];};};Realtime[_0xb5d6('0x43')][_0xb5d6('0x4f')]=function(){var _0x3238bd=this;return function(_0x2700cd){if(_0x2700cd){freeIsNotKey(_0x2700cd,_0x3238bd[_0xb5d6('0x22')],'id');for(var _0x211b8a=0x0,_0x3e413c={},_0xe24b42={};_0x211b8a<_0x2700cd['length'];_0x211b8a+=0x1){_0x3e413c=_0x2700cd[_0x211b8a];if(_[_0xb5d6('0x47')](_0x3238bd[_0xb5d6('0x22')][_0x3e413c['id']])){_0x3238bd[_0xb5d6('0x22')][_0x3e413c['id']]=new DeskAccount(_0x3e413c);}else{_0x3238bd['mergeFromDatabase'](_0x3238bd[_0xb5d6('0x22')][_0x3e413c['id']],_0x3e413c);}}}return _0x3238bd['deskAccounts'];};};Realtime[_0xb5d6('0x43')][_0xb5d6('0x50')]=function(){var _0x1bf38d=this;return function(_0x439479){if(_0x439479){freeIsNotKey(_0x439479,_0x1bf38d[_0xb5d6('0x1f')],'id');for(var _0x395d3e=0x0,_0x5710fd={},_0x4f86e8={};_0x395d3e<_0x439479[_0xb5d6('0x45')];_0x395d3e+=0x1){_0x5710fd=_0x439479[_0x395d3e];if(_[_0xb5d6('0x47')](_0x1bf38d['sugarcrmAccounts'][_0x5710fd['id']])){_0x1bf38d[_0xb5d6('0x1f')][_0x5710fd['id']]=new SugarcrmAccount(_0x5710fd);}else{_0x1bf38d[_0xb5d6('0x42')](_0x1bf38d['sugarcrmAccounts'][_0x5710fd['id']],_0x5710fd);}}}return _0x1bf38d[_0xb5d6('0x1f')];};};Realtime[_0xb5d6('0x43')][_0xb5d6('0x51')]=function(){var _0x9ddae=this;return function(_0x5db7fa){if(_0x5db7fa){freeIsNotKey(_0x5db7fa,_0x9ddae['vtigerAccounts'],'id');for(var _0x2566b5=0x0,_0x3ad37b={},_0x30985f={};_0x2566b5<_0x5db7fa[_0xb5d6('0x45')];_0x2566b5+=0x1){_0x3ad37b=_0x5db7fa[_0x2566b5];if(_[_0xb5d6('0x47')](_0x9ddae[_0xb5d6('0x23')][_0x3ad37b['id']])){_0x9ddae[_0xb5d6('0x23')][_0x3ad37b['id']]=new VtigerAccount(_0x3ad37b);}else{_0x9ddae['mergeFromDatabase'](_0x9ddae['vtigerAccounts'][_0x3ad37b['id']],_0x3ad37b);}}}return _0x9ddae['vtigerAccounts'];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x350403=this;return function(_0x44e768){if(_0x44e768){freeIsNotKey(_0x44e768,_0x350403[_0xb5d6('0x52')],'id');for(var _0x2999cf=0x0,_0x45b422={},_0x92c29={};_0x2999cf<_0x44e768[_0xb5d6('0x45')];_0x2999cf+=0x1){_0x45b422=_0x44e768[_0x2999cf];if(_[_0xb5d6('0x47')](_0x350403[_0xb5d6('0x52')][_0x45b422['id']])){_0x350403['servicenowAccounts'][_0x45b422['id']]=new ServicenowAccount(_0x45b422);}else{_0x350403[_0xb5d6('0x42')](_0x350403['servicenowAccounts'][_0x45b422['id']],_0x45b422);}}}return _0x350403[_0xb5d6('0x52')];};};Realtime['prototype'][_0xb5d6('0x53')]=function(){var _0x504392=this;return function(_0x580432){if(_0x580432){freeIsNotKey(_0x580432,_0x504392['dynamics365Accounts'],'id');for(var _0x6be8fe=0x0,_0x3c8379={},_0x1f8b13={};_0x6be8fe<_0x580432['length'];_0x6be8fe+=0x1){_0x3c8379=_0x580432[_0x6be8fe];if(_[_0xb5d6('0x47')](_0x504392[_0xb5d6('0x24')][_0x3c8379['id']])){_0x504392[_0xb5d6('0x24')][_0x3c8379['id']]=new Dynamics365Account(_0x3c8379);}else{_0x504392[_0xb5d6('0x42')](_0x504392[_0xb5d6('0x24')][_0x3c8379['id']],_0x3c8379);}}}return _0x504392['dynamics365Accounts'];};};Realtime[_0xb5d6('0x43')][_0xb5d6('0x54')]=function(){var _0xf35b6f=this;return function(_0x428df7){for(var _0x59bebc=0x0;_0x59bebc<_0x428df7[_0xb5d6('0x45')];_0x59bebc+=0x1){_[_0xb5d6('0x55')](_0xf35b6f['voiceQueues'][_0x428df7[_0x59bebc][_0xb5d6('0x46')]],_0x428df7[_0x59bebc]);}return _0xf35b6f[_0xb5d6('0x14')];};};Realtime[_0xb5d6('0x43')]['initVoiceQueueReports']=function(){var _0x3e76d4=this;return function(_0x33bd92){clearVoiceQueues(_0x3e76d4['voiceQueues']);if(_0x33bd92){_0x33bd92=_[_0xb5d6('0x56')](_0x33bd92,_0xb5d6('0x57'));for(var _0x51938a in _0x33bd92){if(_0x33bd92[_0xb5d6('0x27')](_0x51938a)){var _0x2fb181={};for(var _0x9fa5b3=0x0;_0x9fa5b3<_0x33bd92[_0x51938a]['length'];_0x9fa5b3+=0x1){var _0x3c35eb=_0x33bd92[_0x51938a][_0x9fa5b3][_0xb5d6('0x58')];if(_0x3e76d4['voiceQueues'][_0x3c35eb]){if(_0x33bd92[_0x51938a][_0x9fa5b3][_0xb5d6('0x59')]){_0x3e76d4[_0xb5d6('0x14')][_0x3c35eb][_0xb5d6('0x34')]+=0x1;}if(_0x33bd92[_0x51938a][_0x9fa5b3][_0xb5d6('0x5a')]){_0x3e76d4['voiceQueues'][_0x3c35eb][_0xb5d6('0x35')]+=0x1;}_0x3e76d4[_0xb5d6('0x14')][_0x3c35eb][_0xb5d6('0x2e')]+=moment(_0x33bd92[_0x51938a][_0x9fa5b3]['queuecallerleaveAt'])['diff'](moment(_0x33bd92[_0x51938a][_0x9fa5b3][_0xb5d6('0x5b')]),_0xb5d6('0x5c'))||0x0;if(_0x9fa5b3===_0x33bd92[_0x51938a]['length']-0x1){_0x3e76d4[_0xb5d6('0x14')][_0x3c35eb][_0xb5d6('0x2f')]+=moment(_0x33bd92[_0x51938a][_0x9fa5b3]['queuecallercompleteAt']||_0x33bd92[_0x51938a][_0x9fa5b3][_0xb5d6('0x5d')]||_0x33bd92[_0x51938a][_0x9fa5b3][_0xb5d6('0x5e')])['diff'](moment(_0x33bd92[_0x51938a][_0x9fa5b3][_0xb5d6('0x5b')]),_0xb5d6('0x5c'))||0x0;_0x3e76d4[_0xb5d6('0x14')][_0x3c35eb]['total']+=0x1;if(_0x33bd92[_0x51938a][_0x9fa5b3][_0xb5d6('0x5f')]){_0x3e76d4[_0xb5d6('0x14')][_0x3c35eb][_0xb5d6('0x2d')]+=0x1;_0x3e76d4[_0xb5d6('0x14')][_0x3c35eb][_0xb5d6('0x30')]+=moment(_0x33bd92[_0x51938a][_0x9fa5b3][_0xb5d6('0x60')])[_0xb5d6('0x61')](moment(_0x33bd92[_0x51938a][_0x9fa5b3][_0xb5d6('0x62')]),_0xb5d6('0x5c'))||0x0;}}else{_0x3e76d4[_0xb5d6('0x14')][_0x3c35eb][_0xb5d6('0x2f')]+=_0x3e76d4['voiceQueues'][_0x3c35eb]['sumHoldTime']||0x0;}}}}}}return _0x3e76d4[_0xb5d6('0x14')];};};Realtime[_0xb5d6('0x43')]['initVoiceCallReports']=function(){var _0x4de62d=this;return function(_0x5ed815){clearVoiceCallReports(_0x4de62d[_0xb5d6('0x63')]);if(_0x5ed815){for(var _0xe3b904=0x0;_0xe3b904<_0x5ed815['length'];_0xe3b904+=0x1){_0x4de62d['outbound'][_0xb5d6('0x2c')]+=0x1;_0x4de62d[_0xb5d6('0x63')][_0xb5d6('0x2f')]+=_0x5ed815[_0xe3b904]['duration'];if(_0x5ed815[_0xe3b904]['disposition']===_0xb5d6('0x64')){_0x4de62d['outbound']['answered']+=0x1;_0x4de62d['outbound']['sumHoldTime']+=_0x5ed815[_0xe3b904]['duration']-_0x5ed815[_0xe3b904]['billableseconds']||0x0;_0x4de62d['outbound'][_0xb5d6('0x30')]+=_0x5ed815[_0xe3b904][_0xb5d6('0x65')];}}}return _0x4de62d['outbound'];};};Realtime[_0xb5d6('0x43')][_0xb5d6('0x66')]=function(){var _0x4b19a7=this;return function(_0x287548){if(_0x287548){freeIsNotKey(_0x287548,_0x4b19a7[_0xb5d6('0x16')],_0xb5d6('0x46'));for(var _0x56e8b8=0x0,_0x615793={};_0x56e8b8<_0x287548['length'];_0x56e8b8+=0x1){_0x615793=_0x287548[_0x56e8b8];if(_['isUndefined'](_0x4b19a7[_0xb5d6('0x16')][_0x615793[_0xb5d6('0x46')]])){_0x4b19a7[_0xb5d6('0x16')][_0x615793['name']]=new Campaign(_0x615793);}else{_0x4b19a7[_0xb5d6('0x42')](_0x4b19a7[_0xb5d6('0x16')][_0x615793[_0xb5d6('0x46')]],_0x615793);}}}return _0x4b19a7['campaigns'];};};Realtime[_0xb5d6('0x43')][_0xb5d6('0x67')]=function(){var _0x37c8e2=this;return function(_0x1acd39){if(_0x1acd39){freeIsNotKey(_0x1acd39,_0x37c8e2[_0xb5d6('0x18')],'id');for(var _0x390e36=0x0,_0x2e082a={};_0x390e36<_0x1acd39[_0xb5d6('0x45')];_0x390e36+=0x1){_0x2e082a=_0x1acd39[_0x390e36];if(_[_0xb5d6('0x47')](_0x37c8e2['voiceExtensions'][_0x2e082a['id']])){_0x37c8e2[_0xb5d6('0x18')][_0x2e082a['id']]=new VoiceExtension(_0x2e082a);}else{_0x37c8e2['mergeFromDatabase'](_0x37c8e2[_0xb5d6('0x18')][_0x2e082a['id']],_0x2e082a);}}}return _0x37c8e2[_0xb5d6('0x18')];};};Realtime[_0xb5d6('0x43')][_0xb5d6('0x68')]=function(){var _0x263f79=this;return function(_0x2167c6){clearCampaigns(_0x263f79[_0xb5d6('0x16')]);for(var _0x2bb4ec=0x0;_0x2bb4ec<_0x2167c6[_0xb5d6('0x45')];_0x2bb4ec+=0x1){_['merge'](_0x263f79[_0xb5d6('0x16')][_0x2167c6[_0x2bb4ec][_0xb5d6('0x46')]],_0x2167c6[_0x2bb4ec]);}return _0x263f79[_0xb5d6('0x16')];};};Realtime[_0xb5d6('0x43')][_0xb5d6('0x69')]=function(){var _0x47a982=this;return function(_0x7f9712){if(_0x7f9712){freeIsNotKey(_0x7f9712,_0x47a982[_0xb5d6('0x25')],'id');for(var _0x4ccde6=0x0,_0x3b5eee={},_0x292c7e={};_0x4ccde6<_0x7f9712['length'];_0x4ccde6+=0x1){_0x3b5eee=_0x7f9712[_0x4ccde6];if(_['isUndefined'](_0x47a982[_0xb5d6('0x25')][_0x3b5eee['id']])){_0x47a982['faxAccounts'][_0x3b5eee['id']]=new FaxAccount(_0x3b5eee);}else{_0x47a982['mergeFromDatabase'](_0x47a982[_0xb5d6('0x25')][_0x3b5eee['id']],_0x3b5eee);}}}return _0x47a982[_0xb5d6('0x25')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 6618e9d..69555de 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 _0xab1b=['match','voiceCallReport','destination','exten','type','dialer','lastapplication','queue','lastdata','context','callerid','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','create','monitors','length','monitorFilename','filename','createdAt','connectedlinename','membername','voiceAgentReport','isArray','forEach','voiceDialReport','startsWith','Local','substring','indexOf','mobile','lastIndexOf','exports','bluebird','lodash','moment','util','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','telephones','sync','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceAgentReport','custom:voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','agents','accountcode','name','isNil','find','interface','prototype','connectedlinenum','lastAssignedTo','format','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3eaae1,_0x1d200e){var _0x46bf2a=function(_0x2b3a75){while(--_0x2b3a75){_0x3eaae1['push'](_0x3eaae1['shift']());}};_0x46bf2a(++_0x1d200e);}(_0xab1b,0xce));var _0xbab1=function(_0x2fe70c,_0x21f3dd){_0x2fe70c=_0x2fe70c-0x0;var _0x25fbc6=_0xab1b[_0x2fe70c];return _0x25fbc6;};'use strict';var BPromise=require(_0xbab1('0x0'));var _=require(_0xbab1('0x1'));var moment=require(_0xbab1('0x2'));var util=require(_0xbab1('0x3'));var config=require(_0xbab1('0x4'));var logger=require('../../../config/logger')('ami');var ami=require('../ami');var RpcVoiceAgentReport=require(_0xbab1('0x5'));var RpcVoiceCallReport=require(_0xbab1('0x6'));var RpcVoiceDialReport=require(_0xbab1('0x7'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xbab1('0x8'));var RpcVoiceRecording=require(_0xbab1('0x9'));var RpcVoiceTransferReport=require(_0xbab1('0xa'));var VoiceQueueReport=require(_0xbab1('0xb'));var VoiceCallReport=require(_0xbab1('0xc'));var VoiceAgentReport=require(_0xbab1('0xd'));var VoiceDialReport=require(_0xbab1('0xe'));var UserReport=require(_0xbab1('0xf'));function Report(_0x4b881f){this[_0xbab1('0x10')]=_0x4b881f;this['agents']=_0x4b881f['agents'];this[_0xbab1('0x11')]=_0x4b881f[_0xbab1('0x11')];}Report['prototype'][_0xbab1('0x12')]=function(_0x29174d){var _0x3678c4=new VoiceQueueReport(this['realtime']);var _0x149ea8=new VoiceAgentReport(this['realtime']);var _0x4af62f=new VoiceDialReport(this['realtime']);var _0x2bca42=new VoiceCallReport(this[_0xbab1('0x10')]);var _0xa4f82f=new UserReport(this[_0xbab1('0x10')]);if(config[_0xbab1('0x13')]&&config['xdr']['disabled']){ami['on'](_0xbab1('0x14'),this[_0xbab1('0x15')][_0xbab1('0x16')](this));ami['on']('custom:voiceCallReport',this['voiceCallReport']['bind'](this));ami['on'](_0xbab1('0x17'),this['voiceAgentReport'][_0xbab1('0x16')](this));ami['on'](_0xbab1('0x18'),this['voiceDialReport'][_0xbab1('0x16')](this));ami['on'](_0xbab1('0x19'),this['blindTransfer']['bind'](this));ami['on'](_0xbab1('0x1a'),this[_0xbab1('0x1b')][_0xbab1('0x16')](this));}};Report['prototype'][_0xbab1('0x1c')]=function(_0x36f750){var _0x4dfc8d=undefined;_0x4dfc8d=_['find'](this[_0xbab1('0x1d')],function(_0x26accf){return _0x26accf[_0xbab1('0x1e')]==_0x36f750||_0x26accf[_0xbab1('0x1f')]==_0x36f750;});if(_[_0xbab1('0x20')](_0x4dfc8d)){var _0x532c10=_[_0xbab1('0x21')](this['telephones'],function(_0x4157a4){return _0x4157a4[_0xbab1('0x1e')]==_0x36f750||_0x4157a4[_0xbab1('0x1f')]==_0x36f750;});if(_0x532c10){_0x4dfc8d=_[_0xbab1('0x21')](this[_0xbab1('0x1d')],function(_0x131274){return _0x131274[_0xbab1('0x22')]==util['format']('SIP/%s',_0x532c10[_0xbab1('0x1f')]);});}}return _0x4dfc8d;};Report[_0xbab1('0x23')]['voiceQueueReport']=function(_0x2d0856){for(var _0x20a172=0x0;_0x20a172<_0x2d0856['length'];_0x20a172+=0x1){var _0x23bde9=this[_0xbab1('0x1c')](_0x2d0856[_0x20a172][_0xbab1('0x24')]);if(_0x23bde9){_0x2d0856[_0x20a172][_0xbab1('0x1e')]=_0x23bde9[_0xbab1('0x1e')];_0x2d0856[_0x20a172]['assigned']=!![];_0x2d0856[_0x20a172][_0xbab1('0x25')]=_0x23bde9[_0xbab1('0x1f')];_0x2d0856[_0x20a172][_0xbab1('0x22')]=_['isNil'](_0x23bde9[_0xbab1('0x22')])?util[_0xbab1('0x26')](_0xbab1('0x27'),_0x23bde9[_0xbab1('0x1f')]):_0x23bde9[_0xbab1('0x22')];if(_0x2d0856[_0x20a172][_0xbab1('0x28')]){_0x2d0856[_0x20a172][_0xbab1('0x29')]=moment()[_0xbab1('0x26')](_0xbab1('0x2a'));}if(_0x2d0856[_0x20a172]['queuecallerexit']){_0x2d0856[_0x20a172]['queuecallerexitAt']=moment()[_0xbab1('0x26')](_0xbab1('0x2a'));}RpcMemberReport[_0xbab1('0x15')](_0x2d0856[_0x20a172]);}RpcVoiceQueueReport['create'](_0x2d0856[_0x20a172]);}};function extractCalleridNumber(_0x293fe4){var _0x2942a0=_0x293fe4[_0xbab1('0x2b')](/<(.*?)>/);return _0x2942a0?_0x2942a0[0x1]:_0x293fe4;}Report[_0xbab1('0x23')][_0xbab1('0x2c')]=function(_0x40492d){_0x40492d[_0xbab1('0x2d')]=_0x40492d[_0xbab1('0x2d')]||_0x40492d[_0xbab1('0x2e')];if(_0x40492d[_0xbab1('0x2f')]==_0xbab1('0x30')){_0x40492d[_0xbab1('0x31')]=_0xbab1('0x32');_0x40492d[_0xbab1('0x33')]=_0x40492d[_0xbab1('0x32')];if(_0x40492d[_0xbab1('0x34')]=='from-voip-provider'){_0x40492d[_0xbab1('0x1e')]='';_0x40492d['destination']=extractCalleridNumber(_0x40492d[_0xbab1('0x35')]);}else if(_0x40492d[_0xbab1('0x34')]=='from-sip'){if(_0x40492d[_0xbab1('0x2d')]==_0xbab1('0x36')){_0x40492d['destination']=extractCalleridNumber(_0x40492d[_0xbab1('0x37')]);_0x40492d[_0xbab1('0x38')]=_0x40492d[_0xbab1('0x39')];_0x40492d[_0xbab1('0x3a')]=[_0x40492d[_0xbab1('0x3b')],_0x40492d['channel']=_0x40492d[_0xbab1('0x3a')]][0x0];_0x40492d[_0xbab1('0x35')]=_0x40492d[_0xbab1('0x37')];}else{_0x40492d[_0xbab1('0x2d')]=_0x40492d[_0xbab1('0x38')];_0x40492d[_0xbab1('0x38')]=_0x40492d[_0xbab1('0x39')];if(_0x40492d[_0xbab1('0x3c')]==_0xbab1('0x3d')){_0x40492d[_0xbab1('0x1e')]=_0x40492d[_0xbab1('0x24')];}else{_0x40492d[_0xbab1('0x1e')]='';}}}}else{_0x40492d[_0xbab1('0x35')]=util[_0xbab1('0x26')](_0xbab1('0x3e'),_0x40492d[_0xbab1('0x3f')],_0x40492d[_0xbab1('0x38')]);}RpcVoiceCallReport[_0xbab1('0x40')](_0x40492d);if(_0x40492d['monitor']){for(var _0x3bb946=0x0;_0x3bb946<_0x40492d[_0xbab1('0x41')][_0xbab1('0x42')];_0x3bb946+=0x1){_0x40492d[_0xbab1('0x43')]=_0x40492d[_0xbab1('0x41')][_0x3bb946][_0xbab1('0x44')];_0x40492d[_0xbab1('0x45')]=_0x40492d[_0xbab1('0x41')][_0x3bb946]['createdAt'];if(_0x40492d['exten']==_0xbab1('0x36')){_0x40492d[_0xbab1('0x38')]=_0x40492d[_0xbab1('0x24')];_0x40492d[_0xbab1('0x3f')]=_0x40492d[_0xbab1('0x46')];_0x40492d[_0xbab1('0x24')]=_0x40492d['accountcode'];_0x40492d['connectedlinename']=_0x40492d[_0xbab1('0x47')];_0x40492d[_0xbab1('0x2e')]=_0x40492d[_0xbab1('0x39')];}else if(_0x40492d[_0xbab1('0x2e')]=='xcally-motion-dialer'){_0x40492d[_0xbab1('0x38')]=_0x40492d[_0xbab1('0x2d')];_0x40492d[_0xbab1('0x2e')]=_0x40492d[_0xbab1('0x39')];}RpcVoiceRecording[_0xbab1('0x40')](_0x40492d);}}};Report[_0xbab1('0x23')][_0xbab1('0x48')]=function(_0x5d8534){if(_[_0xbab1('0x49')](_0x5d8534)){_0x5d8534[_0xbab1('0x4a')](function(_0x20d670){RpcVoiceAgentReport[_0xbab1('0x40')](_0x20d670);});}else{RpcVoiceAgentReport[_0xbab1('0x40')](_0x5d8534);}};Report[_0xbab1('0x23')][_0xbab1('0x4b')]=function(_0x3ff6cd){RpcVoiceDialReport[_0xbab1('0x40')](_0x3ff6cd);var _0x2d981d=undefined;var _0x23352c=_0x3ff6cd['channel'];if(_[_0xbab1('0x4c')](_0x23352c,_0xbab1('0x4d'))){var _0x56fea0=_0x23352c[_0xbab1('0x4e')](_0x23352c[_0xbab1('0x4f')]('/')+0x1,_0x23352c[_0xbab1('0x4f')]('@'));_0x2d981d=_[_0xbab1('0x21')](this[_0xbab1('0x1d')],function(_0x2d82e9){return _0x2d82e9[_0xbab1('0x50')]==_0x56fea0||_0x2d82e9['phone']==_0x56fea0||_0x2d82e9[_0xbab1('0x1e')]==_0x56fea0;});}else{var _0x56fea0=_0x23352c[_0xbab1('0x4e')](_0x23352c[_0xbab1('0x4f')]('/')+0x1,_0x23352c[_0xbab1('0x51')]('-'));_0x2d981d=this[_0xbab1('0x1c')](_0x56fea0);}if(_0x2d981d){_0x3ff6cd[_0xbab1('0x22')]=_[_0xbab1('0x20')](_0x2d981d[_0xbab1('0x22')])?util[_0xbab1('0x26')](_0xbab1('0x27'),_0x2d981d['name']):_0x2d981d[_0xbab1('0x22')];_0x3ff6cd[_0xbab1('0x47')]=_0x2d981d[_0xbab1('0x1f')];_0x3ff6cd[_0xbab1('0x1e')]=_0x2d981d[_0xbab1('0x1e')];RpcMemberReport[_0xbab1('0x4b')](_0x3ff6cd);}};Report[_0xbab1('0x23')]['blindTransfer']=function(_0x43bbb0){RpcVoiceTransferReport['blindTransfer'](_0x43bbb0);};Report['prototype']['attendedTransfer']=function(_0x274a5f){RpcVoiceTransferReport[_0xbab1('0x1b')](_0x274a5f);};module[_0xbab1('0x52')]=Report; \ No newline at end of file +var _0x20a8=['channel','calleridnum','disposition','ANSWERED','format','\x22%s\x22\x20<%s>','monitor','monitors','monitorFilename','filename','createdAt','exten','calleridname','connectedlinename','membername','xcally-motion-dialer','isArray','voiceDialReport','startsWith','Local','substring','indexOf','phone','blindTransfer','exports','bluebird','lodash','moment','util','../../../config/environment','ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','attendedTransfer','findAgent','find','accountcode','isNil','name','interface','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','destination','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel'];(function(_0x3c651b,_0x58b85c){var _0x3676a2=function(_0x503538){while(--_0x503538){_0x3c651b['push'](_0x3c651b['shift']());}};_0x3676a2(++_0x58b85c);}(_0x20a8,0x1d6));var _0x820a=function(_0x36f380,_0x3cb82c){_0x36f380=_0x36f380-0x0;var _0x25a6ed=_0x20a8[_0x36f380];return _0x25a6ed;};'use strict';var BPromise=require(_0x820a('0x0'));var _=require(_0x820a('0x1'));var moment=require(_0x820a('0x2'));var util=require(_0x820a('0x3'));var config=require(_0x820a('0x4'));var logger=require('../../../config/logger')(_0x820a('0x5'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0x820a('0x6'));var RpcVoiceCallReport=require(_0x820a('0x7'));var RpcVoiceDialReport=require(_0x820a('0x8'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x820a('0x9'));var RpcVoiceTransferReport=require(_0x820a('0xa'));var VoiceQueueReport=require(_0x820a('0xb'));var VoiceCallReport=require(_0x820a('0xc'));var VoiceAgentReport=require(_0x820a('0xd'));var VoiceDialReport=require(_0x820a('0xe'));var UserReport=require(_0x820a('0xf'));function Report(_0x2de7ed){this[_0x820a('0x10')]=_0x2de7ed;this[_0x820a('0x11')]=_0x2de7ed[_0x820a('0x11')];this['telephones']=_0x2de7ed[_0x820a('0x12')];}Report[_0x820a('0x13')][_0x820a('0x14')]=function(_0x24bc4f){var _0x2e9215=new VoiceQueueReport(this[_0x820a('0x10')]);var _0x3b0894=new VoiceAgentReport(this['realtime']);var _0x126064=new VoiceDialReport(this[_0x820a('0x10')]);var _0x5e3a10=new VoiceCallReport(this[_0x820a('0x10')]);var _0x5a82bc=new UserReport(this[_0x820a('0x10')]);if(config[_0x820a('0x15')]&&config['xdr'][_0x820a('0x16')]){ami['on'](_0x820a('0x17'),this[_0x820a('0x18')][_0x820a('0x19')](this));ami['on'](_0x820a('0x1a'),this[_0x820a('0x1b')][_0x820a('0x19')](this));ami['on'](_0x820a('0x1c'),this[_0x820a('0x1d')][_0x820a('0x19')](this));ami['on'](_0x820a('0x1e'),this['voiceDialReport']['bind'](this));ami['on'](_0x820a('0x1f'),this['blindTransfer'][_0x820a('0x19')](this));ami['on']('attendedtransfer',this[_0x820a('0x20')]['bind'](this));}};Report[_0x820a('0x13')][_0x820a('0x21')]=function(_0x346d50){var _0x20aff5=undefined;_0x20aff5=_[_0x820a('0x22')](this[_0x820a('0x11')],function(_0x55e5cf){return _0x55e5cf[_0x820a('0x23')]==_0x346d50||_0x55e5cf['name']==_0x346d50;});if(_[_0x820a('0x24')](_0x20aff5)){var _0x2140de=_[_0x820a('0x22')](this[_0x820a('0x12')],function(_0x34547a){return _0x34547a['accountcode']==_0x346d50||_0x34547a[_0x820a('0x25')]==_0x346d50;});if(_0x2140de){_0x20aff5=_[_0x820a('0x22')](this['agents'],function(_0x35f799){return _0x35f799[_0x820a('0x26')]==util['format'](_0x820a('0x27'),_0x2140de['name']);});}}return _0x20aff5;};Report['prototype'][_0x820a('0x18')]=function(_0x552ba8){for(var _0x437bcc=0x0;_0x437bcc<_0x552ba8[_0x820a('0x28')];_0x437bcc+=0x1){var _0x7c8109=this[_0x820a('0x21')](_0x552ba8[_0x437bcc][_0x820a('0x29')]);if(_0x7c8109){_0x552ba8[_0x437bcc][_0x820a('0x23')]=_0x7c8109[_0x820a('0x23')];_0x552ba8[_0x437bcc][_0x820a('0x2a')]=!![];_0x552ba8[_0x437bcc][_0x820a('0x2b')]=_0x7c8109[_0x820a('0x25')];_0x552ba8[_0x437bcc][_0x820a('0x26')]=_[_0x820a('0x24')](_0x7c8109[_0x820a('0x26')])?util['format'](_0x820a('0x27'),_0x7c8109[_0x820a('0x25')]):_0x7c8109[_0x820a('0x26')];if(_0x552ba8[_0x437bcc][_0x820a('0x2c')]){_0x552ba8[_0x437bcc][_0x820a('0x2d')]=moment()['format'](_0x820a('0x2e'));}if(_0x552ba8[_0x437bcc][_0x820a('0x2f')]){_0x552ba8[_0x437bcc][_0x820a('0x30')]=moment()['format'](_0x820a('0x2e'));}RpcMemberReport[_0x820a('0x18')](_0x552ba8[_0x437bcc]);}RpcVoiceQueueReport[_0x820a('0x31')](_0x552ba8[_0x437bcc]);}};function extractCalleridNumber(_0x3741e4){var _0x2cc1cf=_0x3741e4['match'](/<(.*?)>/);return _0x2cc1cf?_0x2cc1cf[0x1]:_0x3741e4;}Report[_0x820a('0x13')][_0x820a('0x1b')]=function(_0x5b042c){_0x5b042c[_0x820a('0x32')]=_0x5b042c['destination']||_0x5b042c['exten'];if(_0x5b042c[_0x820a('0x33')]==_0x820a('0x34')){_0x5b042c[_0x820a('0x35')]=_0x820a('0x36');_0x5b042c[_0x820a('0x37')]=_0x5b042c[_0x820a('0x36')];if(_0x5b042c[_0x820a('0x38')]==_0x820a('0x39')){_0x5b042c[_0x820a('0x23')]='';_0x5b042c[_0x820a('0x32')]=extractCalleridNumber(_0x5b042c[_0x820a('0x3a')]);}else if(_0x5b042c[_0x820a('0x38')]==_0x820a('0x3b')){if(_0x5b042c[_0x820a('0x32')]==_0x820a('0x3c')){_0x5b042c[_0x820a('0x32')]=extractCalleridNumber(_0x5b042c[_0x820a('0x3d')]);_0x5b042c['calleridnum']=_0x5b042c[_0x820a('0x3e')];_0x5b042c[_0x820a('0x3f')]=[_0x5b042c[_0x820a('0x40')],_0x5b042c[_0x820a('0x40')]=_0x5b042c['destinationchannel']][0x0];_0x5b042c[_0x820a('0x3a')]=_0x5b042c[_0x820a('0x3d')];}else{_0x5b042c[_0x820a('0x32')]=_0x5b042c[_0x820a('0x41')];_0x5b042c[_0x820a('0x41')]=_0x5b042c['originatecalleridnum'];if(_0x5b042c[_0x820a('0x42')]==_0x820a('0x43')){_0x5b042c[_0x820a('0x23')]=_0x5b042c[_0x820a('0x29')];}else{_0x5b042c[_0x820a('0x23')]='';}}}}else{_0x5b042c[_0x820a('0x3a')]=util[_0x820a('0x44')](_0x820a('0x45'),_0x5b042c['calleridname'],_0x5b042c[_0x820a('0x41')]);}RpcVoiceCallReport[_0x820a('0x31')](_0x5b042c);if(_0x5b042c[_0x820a('0x46')]){for(var _0x558b5f=0x0;_0x558b5f<_0x5b042c[_0x820a('0x47')][_0x820a('0x28')];_0x558b5f+=0x1){_0x5b042c[_0x820a('0x48')]=_0x5b042c[_0x820a('0x47')][_0x558b5f][_0x820a('0x49')];_0x5b042c[_0x820a('0x4a')]=_0x5b042c['monitors'][_0x558b5f][_0x820a('0x4a')];if(_0x5b042c[_0x820a('0x4b')]==_0x820a('0x3c')){_0x5b042c['calleridnum']=_0x5b042c['connectedlinenum'];_0x5b042c[_0x820a('0x4c')]=_0x5b042c[_0x820a('0x4d')];_0x5b042c[_0x820a('0x29')]=_0x5b042c[_0x820a('0x23')];_0x5b042c[_0x820a('0x4d')]=_0x5b042c[_0x820a('0x4e')];_0x5b042c[_0x820a('0x4b')]=_0x5b042c[_0x820a('0x3e')];}else if(_0x5b042c[_0x820a('0x4b')]==_0x820a('0x4f')){_0x5b042c[_0x820a('0x41')]=_0x5b042c[_0x820a('0x32')];_0x5b042c[_0x820a('0x4b')]=_0x5b042c[_0x820a('0x3e')];}RpcVoiceRecording[_0x820a('0x31')](_0x5b042c);}}};Report[_0x820a('0x13')][_0x820a('0x1d')]=function(_0x29467c){if(_[_0x820a('0x50')](_0x29467c)){_0x29467c['forEach'](function(_0x33f42a){RpcVoiceAgentReport[_0x820a('0x31')](_0x33f42a);});}else{RpcVoiceAgentReport['create'](_0x29467c);}};Report[_0x820a('0x13')][_0x820a('0x51')]=function(_0x568658){RpcVoiceDialReport[_0x820a('0x31')](_0x568658);var _0x1a28a7=undefined;var _0x5adfb7=_0x568658[_0x820a('0x40')];if(_[_0x820a('0x52')](_0x5adfb7,_0x820a('0x53'))){var _0x5b33f6=_0x5adfb7[_0x820a('0x54')](_0x5adfb7[_0x820a('0x55')]('/')+0x1,_0x5adfb7[_0x820a('0x55')]('@'));_0x1a28a7=_[_0x820a('0x22')](this['agents'],function(_0x46f92a){return _0x46f92a['mobile']==_0x5b33f6||_0x46f92a[_0x820a('0x56')]==_0x5b33f6||_0x46f92a['accountcode']==_0x5b33f6;});}else{var _0x5b33f6=_0x5adfb7['substring'](_0x5adfb7[_0x820a('0x55')]('/')+0x1,_0x5adfb7['lastIndexOf']('-'));_0x1a28a7=this[_0x820a('0x21')](_0x5b33f6);}if(_0x1a28a7){_0x568658[_0x820a('0x26')]=_[_0x820a('0x24')](_0x1a28a7['interface'])?util[_0x820a('0x44')](_0x820a('0x27'),_0x1a28a7['name']):_0x1a28a7[_0x820a('0x26')];_0x568658[_0x820a('0x4e')]=_0x1a28a7[_0x820a('0x25')];_0x568658['accountcode']=_0x1a28a7['accountcode'];RpcMemberReport[_0x820a('0x51')](_0x568658);}};Report[_0x820a('0x13')][_0x820a('0x57')]=function(_0x19e4ce){RpcVoiceTransferReport[_0x820a('0x57')](_0x19e4ce);};Report[_0x820a('0x13')][_0x820a('0x20')]=function(_0x386741){RpcVoiceTransferReport[_0x820a('0x20')](_0x386741);};module[_0x820a('0x58')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 7f6d109..a680ae8 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 _0x8aeb=['status','address','telephone:%s','[syncPeerStatus][UserReport]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','syncDeviceState','peerstatus','loopSyncRealTimeShow','then','actionSipShowRegistry','actionDeviceStateList','[loopSyncRealTimeShow]','inspect','prototype','resolve','actionSipPeerStatus','catch','isNotNull','emit','find','username','state','omit','event','actionid','format','name','trunk:save','error','[syncRegistry][UserReport]','device','local','toLowerCase','stateTime','toNumber','updateStatusRealtime','telephone:save','trunk:%s','startsWith','Queue','Local','substring','indexOf','mobile','accountcode','[syncDeviceState][UserReport]','peer','registered'];(function(_0x2b8603,_0x45ac0c){var _0x55bc1b=function(_0x1d9413){while(--_0x1d9413){_0x2b8603['push'](_0x2b8603['shift']());}};_0x55bc1b(++_0x45ac0c);}(_0x8aeb,0x10d));var _0xb8ae=function(_0x229128,_0x273558){_0x229128=_0x229128-0x0;var _0x1875b9=_0x8aeb[_0x229128];return _0x1875b9;};'use strict';var _=require(_0xb8ae('0x0'));var moment=require(_0xb8ae('0x1'));var BPromise=require('bluebird');var util=require(_0xb8ae('0x2'));var Redis=require(_0xb8ae('0x3'));var config=require(_0xb8ae('0x4'));var logger=require(_0xb8ae('0x5'))(_0xb8ae('0x6'));var ami=require(_0xb8ae('0x7'));config['redis']=_[_0xb8ae('0x8')](config[_0xb8ae('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xb8ae('0xa'))(new Redis(config[_0xb8ae('0x9')]));function UserReport(_0x1111af){this[_0xb8ae('0xb')]=_0x1111af['trunks'];this[_0xb8ae('0xc')]=_0x1111af[_0xb8ae('0xc')];this[_0xb8ae('0xd')]=_0x1111af['telephones'];ami['on'](_0xb8ae('0xe'),this[_0xb8ae('0xf')]['bind'](this));ami['on']('registry',this[_0xb8ae('0xf')][_0xb8ae('0x10')](this));ami['on'](_0xb8ae('0x11'),this[_0xb8ae('0x12')][_0xb8ae('0x10')](this));ami['on'](_0xb8ae('0x13'),this['syncPeerStatus'][_0xb8ae('0x10')](this));this[_0xb8ae('0x14')]();return BPromise['resolve']()[_0xb8ae('0x15')](ami[_0xb8ae('0x16')]())['then'](ami[_0xb8ae('0x17')]())['then'](ami['actionSipPeerStatus']())['catch'](loggerCatch(_0xb8ae('0x18')));}function loggerCatch(_0x5a36e8){return function(_0x266114){logger['error'](_0x5a36e8,util[_0xb8ae('0x19')](_0x266114,{'showHidden':![],'depth':null}));};}UserReport[_0xb8ae('0x1a')][_0xb8ae('0x14')]=function(){setInterval(function(){BPromise[_0xb8ae('0x1b')]()['then'](ami[_0xb8ae('0x16')]())['then'](ami[_0xb8ae('0x17')]())[_0xb8ae('0x15')](ami[_0xb8ae('0x1c')]())[_0xb8ae('0x1d')](loggerCatch(_0xb8ae('0x18')));},0x32c8);};UserReport[_0xb8ae('0x1a')][_0xb8ae('0x1e')]=function(_0x367325){return _0x367325!==null&&!_['isUndefined'](_0x367325);};UserReport[_0xb8ae('0x1a')][_0xb8ae('0x1f')]=function(_0x1945e8,_0x51b0f8,_0x404b86){io['to'](_0x1945e8)[_0xb8ae('0x1f')](_0x51b0f8,_0x404b86);};UserReport['prototype'][_0xb8ae('0xf')]=function(_0x639947){try{if(this[_0xb8ae('0x1e')](_0x639947)){var _0x45e732=_[_0xb8ae('0x20')](this[_0xb8ae('0xb')],{'registry':_0x639947[_0xb8ae('0x21')]});if(_0x45e732){_0x639947['stateRegistry']=_0x639947[_0xb8ae('0x22')];_['merge'](_0x45e732,_[_0xb8ae('0x23')](_0x639947,[_0xb8ae('0x24'),_0xb8ae('0x25'),_0xb8ae('0x21'),_0xb8ae('0x22')]));this[_0xb8ae('0x1f')](util[_0xb8ae('0x26')]('trunk:%s',_0x45e732[_0xb8ae('0x27')]),_0xb8ae('0x28'),_0x45e732);}}}catch(_0x4f1921){logger[_0xb8ae('0x29')](_0xb8ae('0x2a'),util[_0xb8ae('0x19')](_0x4f1921,{'showHidden':![],'depth':null}));}};UserReport[_0xb8ae('0x1a')]['syncDeviceState']=function(_0xfd8495){try{if(this['isNotNull'](_0xfd8495)){if(this['agents'][_0xfd8495[_0xb8ae('0x2b')]]){if(!this[_0xb8ae('0xc')][_0xfd8495['device']]['local']||_0xfd8495[_0xb8ae('0x22')]['toLowerCase']()=='inuse'){this['agents'][_0xfd8495['device']][_0xb8ae('0x2c')]=![];if(this['agents'][_0xfd8495[_0xb8ae('0x2b')]][_0xb8ae('0x22')]!==_0xfd8495[_0xb8ae('0x22')][_0xb8ae('0x2d')]()){this[_0xb8ae('0xc')][_0xfd8495[_0xb8ae('0x2b')]][_0xb8ae('0x2e')]=_[_0xb8ae('0x2f')](moment()[_0xb8ae('0x26')]('x'));}this[_0xb8ae('0xc')][_0xfd8495[_0xb8ae('0x2b')]]['state']=_0xfd8495['state'][_0xb8ae('0x2d')]();this[_0xb8ae('0xc')][_0xfd8495['device']][_0xb8ae('0x30')](_0xfd8495);}}else if(this['telephones'][_0xfd8495[_0xb8ae('0x2b')]]){if(this[_0xb8ae('0xd')][_0xfd8495['device']][_0xb8ae('0x22')]!==_0xfd8495[_0xb8ae('0x22')][_0xb8ae('0x2d')]()){this['telephones'][_0xfd8495[_0xb8ae('0x2b')]]['stateTime']=_[_0xb8ae('0x2f')](moment()[_0xb8ae('0x26')]('x'));}this[_0xb8ae('0xd')][_0xfd8495[_0xb8ae('0x2b')]]['state']=_0xfd8495[_0xb8ae('0x22')][_0xb8ae('0x2d')]();this[_0xb8ae('0x1f')](util[_0xb8ae('0x26')]('telephone:%s',this[_0xb8ae('0xd')][_0xfd8495[_0xb8ae('0x2b')]][_0xb8ae('0x27')]),_0xb8ae('0x31'),this[_0xb8ae('0xd')][_0xfd8495['device']]);}else if(this[_0xb8ae('0xb')][_0xfd8495['device']]){if(this[_0xb8ae('0xb')][_0xfd8495[_0xb8ae('0x2b')]]['state']!==_0xfd8495[_0xb8ae('0x22')][_0xb8ae('0x2d')]()){this[_0xb8ae('0xb')][_0xfd8495['device']]['stateTime']=_[_0xb8ae('0x2f')](moment()[_0xb8ae('0x26')]('x'));}this[_0xb8ae('0xb')][_0xfd8495[_0xb8ae('0x2b')]][_0xb8ae('0x22')]=_0xfd8495[_0xb8ae('0x22')][_0xb8ae('0x2d')]();this[_0xb8ae('0x1f')](util[_0xb8ae('0x26')](_0xb8ae('0x32'),this[_0xb8ae('0xb')][_0xfd8495[_0xb8ae('0x2b')]][_0xb8ae('0x27')]),_0xb8ae('0x28'),this[_0xb8ae('0xb')][_0xfd8495[_0xb8ae('0x2b')]]);}else if(_[_0xb8ae('0x33')](_0xfd8495['device'],_0xb8ae('0x34'))){}else if(_['startsWith'](_0xfd8495[_0xb8ae('0x2b')],_0xb8ae('0x35'))){var _0x145e24=_0xfd8495[_0xb8ae('0x2b')];var _0x4ec35e=_0x145e24[_0xb8ae('0x36')](_0x145e24[_0xb8ae('0x37')]('/')+0x1,_0x145e24['indexOf']('@'));var _0xdee15b=_[_0xb8ae('0x20')](this['agents'],function(_0x1261d7){return _0x1261d7[_0xb8ae('0x38')]==_0x4ec35e||_0x1261d7['phone']==_0x4ec35e||_0x1261d7[_0xb8ae('0x39')]==_0x4ec35e;});if(_0xdee15b){if(_0xdee15b[_0xb8ae('0x22')]!==_0xfd8495['state'][_0xb8ae('0x2d')]()){_0xdee15b[_0xb8ae('0x2e')]=_[_0xb8ae('0x2f')](moment()[_0xb8ae('0x26')]('x'));}_0xdee15b['state']=_0xfd8495[_0xb8ae('0x22')][_0xb8ae('0x2d')]();_0xdee15b[_0xb8ae('0x2c')]=!![];_0xdee15b[_0xb8ae('0x30')](_0xfd8495);}}else{}}}catch(_0x5ce739){logger['error'](_0xb8ae('0x3a'),util[_0xb8ae('0x19')](_0x5ce739,{'showHidden':![],'depth':null}));}};UserReport[_0xb8ae('0x1a')]['syncPeerStatus']=function(_0x518f9b){try{if(this[_0xb8ae('0x1e')](_0x518f9b)&&this[_0xb8ae('0x1e')](_0x518f9b[_0xb8ae('0x13')])){if(this[_0xb8ae('0xc')][_0x518f9b[_0xb8ae('0x3b')]]){if(!this[_0xb8ae('0xc')][_0x518f9b[_0xb8ae('0x3b')]][_0xb8ae('0x2c')]||_0x518f9b[_0xb8ae('0x13')][_0xb8ae('0x2d')]()==_0xb8ae('0x3c')){this[_0xb8ae('0xc')][_0x518f9b[_0xb8ae('0x3b')]][_0xb8ae('0x2c')]=![];this[_0xb8ae('0xc')][_0x518f9b[_0xb8ae('0x3b')]][_0xb8ae('0x3d')]=_0x518f9b[_0xb8ae('0x13')]['toLowerCase']();this['agents'][_0x518f9b['peer']][_0xb8ae('0x3e')]=_0x518f9b[_0xb8ae('0x3e')];this[_0xb8ae('0xc')][_0x518f9b['peer']][_0xb8ae('0x30')](_0x518f9b);}}else if(this[_0xb8ae('0xd')][_0x518f9b['peer']]){this[_0xb8ae('0xd')][_0x518f9b[_0xb8ae('0x3b')]][_0xb8ae('0x3d')]=_0x518f9b[_0xb8ae('0x13')][_0xb8ae('0x2d')]();this['telephones'][_0x518f9b[_0xb8ae('0x3b')]]['address']=_0x518f9b['address'];this[_0xb8ae('0x1f')](util[_0xb8ae('0x26')](_0xb8ae('0x3f'),this[_0xb8ae('0xd')][_0x518f9b[_0xb8ae('0x3b')]][_0xb8ae('0x27')]),_0xb8ae('0x31'),this['telephones'][_0x518f9b[_0xb8ae('0x3b')]]);}else if(this['trunks'][_0x518f9b[_0xb8ae('0x3b')]]){this[_0xb8ae('0xb')][_0x518f9b[_0xb8ae('0x3b')]]['status']=_0x518f9b[_0xb8ae('0x13')][_0xb8ae('0x2d')]();this[_0xb8ae('0xb')][_0x518f9b['peer']]['address']=_0x518f9b[_0xb8ae('0x3e')];this[_0xb8ae('0x1f')](util['format'](_0xb8ae('0x32'),this['trunks'][_0x518f9b['peer']][_0xb8ae('0x27')]),_0xb8ae('0x28'),this[_0xb8ae('0xb')][_0x518f9b[_0xb8ae('0x3b')]]);}else{}}}catch(_0x2e899e){logger[_0xb8ae('0x29')](_0xb8ae('0x40'),util[_0xb8ae('0x19')](_0x2e899e,{'showHidden':![],'depth':null}));}};module[_0xb8ae('0x41')]=UserReport; \ No newline at end of file +var _0x1491=['stateTime','toNumber','format','updateStatusRealtime','telephone:%s','telephone:save','startsWith','Queue','Local','substring','indexOf','phone','accountcode','[syncDeviceState][UserReport]','peer','status','address','[syncPeerStatus][UserReport]','exports','lodash','bluebird','util','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','bind','registry','devicestatechange','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','prototype','isUndefined','emit','isNotNull','find','username','stateRegistry','state','merge','actionid','trunk:%s','name','trunk:save','[syncRegistry][UserReport]','syncDeviceState','device','local','toLowerCase'];(function(_0xc312d3,_0x159660){var _0xd3bc7c=function(_0x3ac453){while(--_0x3ac453){_0xc312d3['push'](_0xc312d3['shift']());}};_0xd3bc7c(++_0x159660);}(_0x1491,0x162));var _0x1149=function(_0x5c1c99,_0x47c1a5){_0x5c1c99=_0x5c1c99-0x0;var _0x5fa09f=_0x1491[_0x5c1c99];return _0x5fa09f;};'use strict';var _=require(_0x1149('0x0'));var moment=require('moment');var BPromise=require(_0x1149('0x1'));var util=require(_0x1149('0x2'));var Redis=require(_0x1149('0x3'));var config=require(_0x1149('0x4'));var logger=require(_0x1149('0x5'))('ami');var ami=require(_0x1149('0x6'));config[_0x1149('0x7')]=_[_0x1149('0x8')](config['redis'],{'host':_0x1149('0x9'),'port':0x18eb});var io=require(_0x1149('0xa'))(new Redis(config[_0x1149('0x7')]));function UserReport(_0x180f18){this['trunks']=_0x180f18[_0x1149('0xb')];this[_0x1149('0xc')]=_0x180f18[_0x1149('0xc')];this[_0x1149('0xd')]=_0x180f18[_0x1149('0xd')];ami['on']('registryentry',this[_0x1149('0xe')][_0x1149('0xf')](this));ami['on'](_0x1149('0x10'),this[_0x1149('0xe')][_0x1149('0xf')](this));ami['on'](_0x1149('0x11'),this['syncDeviceState'][_0x1149('0xf')](this));ami['on'](_0x1149('0x12'),this[_0x1149('0x13')][_0x1149('0xf')](this));this[_0x1149('0x14')]();return BPromise[_0x1149('0x15')]()[_0x1149('0x16')](ami[_0x1149('0x17')]())[_0x1149('0x16')](ami[_0x1149('0x18')]())[_0x1149('0x16')](ami[_0x1149('0x19')]())[_0x1149('0x1a')](loggerCatch(_0x1149('0x1b')));}function loggerCatch(_0x14f7d8){return function(_0x2e30a0){logger[_0x1149('0x1c')](_0x14f7d8,util[_0x1149('0x1d')](_0x2e30a0,{'showHidden':![],'depth':null}));};}UserReport[_0x1149('0x1e')]['loopSyncRealTimeShow']=function(){setInterval(function(){BPromise['resolve']()[_0x1149('0x16')](ami[_0x1149('0x17')]())[_0x1149('0x16')](ami[_0x1149('0x18')]())['then'](ami[_0x1149('0x19')]())[_0x1149('0x1a')](loggerCatch(_0x1149('0x1b')));},0x32c8);};UserReport[_0x1149('0x1e')]['isNotNull']=function(_0x447da0){return _0x447da0!==null&&!_[_0x1149('0x1f')](_0x447da0);};UserReport[_0x1149('0x1e')]['emit']=function(_0x348609,_0x118507,_0x159fd6){io['to'](_0x348609)[_0x1149('0x20')](_0x118507,_0x159fd6);};UserReport[_0x1149('0x1e')][_0x1149('0xe')]=function(_0x1da3c4){try{if(this[_0x1149('0x21')](_0x1da3c4)){var _0x2620cf=_[_0x1149('0x22')](this[_0x1149('0xb')],{'registry':_0x1da3c4[_0x1149('0x23')]});if(_0x2620cf){_0x1da3c4[_0x1149('0x24')]=_0x1da3c4[_0x1149('0x25')];_[_0x1149('0x26')](_0x2620cf,_['omit'](_0x1da3c4,['event',_0x1149('0x27'),'username',_0x1149('0x25')]));this['emit'](util['format'](_0x1149('0x28'),_0x2620cf[_0x1149('0x29')]),_0x1149('0x2a'),_0x2620cf);}}}catch(_0x4ce307){logger['error'](_0x1149('0x2b'),util[_0x1149('0x1d')](_0x4ce307,{'showHidden':![],'depth':null}));}};UserReport[_0x1149('0x1e')][_0x1149('0x2c')]=function(_0x4c914b){try{if(this[_0x1149('0x21')](_0x4c914b)){if(this[_0x1149('0xc')][_0x4c914b[_0x1149('0x2d')]]){if(!this[_0x1149('0xc')][_0x4c914b[_0x1149('0x2d')]][_0x1149('0x2e')]||_0x4c914b[_0x1149('0x25')][_0x1149('0x2f')]()=='inuse'){this['agents'][_0x4c914b['device']][_0x1149('0x2e')]=![];if(this[_0x1149('0xc')][_0x4c914b[_0x1149('0x2d')]][_0x1149('0x25')]!==_0x4c914b[_0x1149('0x25')]['toLowerCase']()){this[_0x1149('0xc')][_0x4c914b[_0x1149('0x2d')]][_0x1149('0x30')]=_[_0x1149('0x31')](moment()[_0x1149('0x32')]('x'));}this[_0x1149('0xc')][_0x4c914b[_0x1149('0x2d')]][_0x1149('0x25')]=_0x4c914b[_0x1149('0x25')][_0x1149('0x2f')]();this[_0x1149('0xc')][_0x4c914b['device']][_0x1149('0x33')](_0x4c914b);}}else if(this[_0x1149('0xd')][_0x4c914b['device']]){if(this[_0x1149('0xd')][_0x4c914b['device']][_0x1149('0x25')]!==_0x4c914b['state']['toLowerCase']()){this[_0x1149('0xd')][_0x4c914b[_0x1149('0x2d')]][_0x1149('0x30')]=_[_0x1149('0x31')](moment()[_0x1149('0x32')]('x'));}this[_0x1149('0xd')][_0x4c914b[_0x1149('0x2d')]][_0x1149('0x25')]=_0x4c914b[_0x1149('0x25')][_0x1149('0x2f')]();this[_0x1149('0x20')](util['format'](_0x1149('0x34'),this[_0x1149('0xd')][_0x4c914b[_0x1149('0x2d')]]['name']),_0x1149('0x35'),this[_0x1149('0xd')][_0x4c914b[_0x1149('0x2d')]]);}else if(this[_0x1149('0xb')][_0x4c914b['device']]){if(this[_0x1149('0xb')][_0x4c914b['device']]['state']!==_0x4c914b[_0x1149('0x25')]['toLowerCase']()){this[_0x1149('0xb')][_0x4c914b['device']][_0x1149('0x30')]=_[_0x1149('0x31')](moment()[_0x1149('0x32')]('x'));}this[_0x1149('0xb')][_0x4c914b['device']][_0x1149('0x25')]=_0x4c914b[_0x1149('0x25')]['toLowerCase']();this['emit'](util[_0x1149('0x32')](_0x1149('0x28'),this[_0x1149('0xb')][_0x4c914b[_0x1149('0x2d')]][_0x1149('0x29')]),'trunk:save',this[_0x1149('0xb')][_0x4c914b[_0x1149('0x2d')]]);}else if(_[_0x1149('0x36')](_0x4c914b[_0x1149('0x2d')],_0x1149('0x37'))){}else if(_['startsWith'](_0x4c914b[_0x1149('0x2d')],_0x1149('0x38'))){var _0x3be998=_0x4c914b[_0x1149('0x2d')];var _0x344df5=_0x3be998[_0x1149('0x39')](_0x3be998[_0x1149('0x3a')]('/')+0x1,_0x3be998['indexOf']('@'));var _0x28baed=_['find'](this['agents'],function(_0x346fdb){return _0x346fdb['mobile']==_0x344df5||_0x346fdb[_0x1149('0x3b')]==_0x344df5||_0x346fdb[_0x1149('0x3c')]==_0x344df5;});if(_0x28baed){if(_0x28baed['state']!==_0x4c914b[_0x1149('0x25')][_0x1149('0x2f')]()){_0x28baed['stateTime']=_[_0x1149('0x31')](moment()['format']('x'));}_0x28baed[_0x1149('0x25')]=_0x4c914b[_0x1149('0x25')]['toLowerCase']();_0x28baed[_0x1149('0x2e')]=!![];_0x28baed['updateStatusRealtime'](_0x4c914b);}}else{}}}catch(_0x5c7bdf){logger[_0x1149('0x1c')](_0x1149('0x3d'),util[_0x1149('0x1d')](_0x5c7bdf,{'showHidden':![],'depth':null}));}};UserReport[_0x1149('0x1e')][_0x1149('0x13')]=function(_0x3ea957){try{if(this[_0x1149('0x21')](_0x3ea957)&&this['isNotNull'](_0x3ea957[_0x1149('0x12')])){if(this[_0x1149('0xc')][_0x3ea957[_0x1149('0x3e')]]){if(!this['agents'][_0x3ea957[_0x1149('0x3e')]][_0x1149('0x2e')]||_0x3ea957[_0x1149('0x12')][_0x1149('0x2f')]()=='registered'){this[_0x1149('0xc')][_0x3ea957[_0x1149('0x3e')]][_0x1149('0x2e')]=![];this[_0x1149('0xc')][_0x3ea957[_0x1149('0x3e')]][_0x1149('0x3f')]=_0x3ea957[_0x1149('0x12')][_0x1149('0x2f')]();this[_0x1149('0xc')][_0x3ea957[_0x1149('0x3e')]][_0x1149('0x40')]=_0x3ea957[_0x1149('0x40')];this[_0x1149('0xc')][_0x3ea957['peer']][_0x1149('0x33')](_0x3ea957);}}else if(this[_0x1149('0xd')][_0x3ea957[_0x1149('0x3e')]]){this['telephones'][_0x3ea957[_0x1149('0x3e')]][_0x1149('0x3f')]=_0x3ea957[_0x1149('0x12')][_0x1149('0x2f')]();this[_0x1149('0xd')][_0x3ea957['peer']]['address']=_0x3ea957[_0x1149('0x40')];this['emit'](util[_0x1149('0x32')]('telephone:%s',this[_0x1149('0xd')][_0x3ea957[_0x1149('0x3e')]][_0x1149('0x29')]),_0x1149('0x35'),this[_0x1149('0xd')][_0x3ea957[_0x1149('0x3e')]]);}else if(this[_0x1149('0xb')][_0x3ea957[_0x1149('0x3e')]]){this['trunks'][_0x3ea957[_0x1149('0x3e')]]['status']=_0x3ea957[_0x1149('0x12')][_0x1149('0x2f')]();this[_0x1149('0xb')][_0x3ea957[_0x1149('0x3e')]]['address']=_0x3ea957['address'];this[_0x1149('0x20')](util[_0x1149('0x32')]('trunk:%s',this[_0x1149('0xb')][_0x3ea957[_0x1149('0x3e')]][_0x1149('0x29')]),'trunk:save',this[_0x1149('0xb')][_0x3ea957['peer']]);}else{}}}catch(_0x5d9018){logger[_0x1149('0x1c')](_0x1149('0x41'),util[_0x1149('0x1d')](_0x5d9018,{'showHidden':![],'depth':null}));}};module[_0x1149('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 34344f0..2fe5a1f 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 _0x342d=['talktime','transfer','agent','acw','acwTimeout','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','value','variables','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','memberdynamic','memberlastcall','memberrealtime','isNil','includes','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','[syncBlindTransfer][VoiceAgentReport]','syncMusicOnHoldStart','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','util','../../../config/environment','../../../config/logger','../ami','defaults','localhost','socket.io-emitter','redis','voiceQueues','agents','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','bind','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','syncVarSet','hangup','syncHangup','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','channels','uniqueid','destuniqueid','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','omit','event','privilege','custom:agentcalled','format','user:%s','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','agentconnectAt','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','merge','interface','pick','membername','user:agentconnect','custom:agentconnect','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','agentringnoanswerAt','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','syncAgentComplete','hasOwnProperty','agentcompleteAt','complete'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x342d,0x1b3));var _0xd342=function(_0x4d1d52,_0x28a82e){_0x4d1d52=_0x4d1d52-0x0;var _0x17533f=_0x342d[_0x4d1d52];return _0x17533f;};'use strict';var _=require(_0xd342('0x0'));var moment=require(_0xd342('0x1'));var util=require(_0xd342('0x2'));var Redis=require('ioredis');var config=require(_0xd342('0x3'));var logger=require(_0xd342('0x4'))('ami');var ami=require(_0xd342('0x5'));config['redis']=_[_0xd342('0x6')](config['redis'],{'host':_0xd342('0x7'),'port':0x18eb});var io=require(_0xd342('0x8'))(new Redis(config[_0xd342('0x9')]));function VoiceAgentReport(_0x3f59bd){this['channels']={};this[_0xd342('0xa')]=_0x3f59bd[_0xd342('0xa')];this['agents']=_0x3f59bd[_0xd342('0xb')];this['variables']={};ami['on'](_0xd342('0xc'),this[_0xd342('0xd')]['bind'](this));ami['on'](_0xd342('0xe'),this[_0xd342('0xf')][_0xd342('0x10')](this));ami['on'](_0xd342('0x11'),this[_0xd342('0x12')][_0xd342('0x10')](this));ami['on'](_0xd342('0x13'),this['syncQueueCallerAbandon'][_0xd342('0x10')](this));ami['on'](_0xd342('0x14'),this['syncAgentComplete']['bind'](this));ami['on']('varset',this[_0xd342('0x15')][_0xd342('0x10')](this));ami['on'](_0xd342('0x16'),this[_0xd342('0x17')]['bind'](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0xd342('0x10')](this));ami['on'](_0xd342('0x18'),this[_0xd342('0x19')]['bind'](this));ami['on'](_0xd342('0x1a'),this['syncAttendedTransfer'][_0xd342('0x10')](this));ami['on'](_0xd342('0x1b'),this[_0xd342('0x1c')][_0xd342('0x10')](this));}VoiceAgentReport[_0xd342('0x1d')][_0xd342('0x1e')]=function(_0x1fb0e6,_0x1c9879,_0x1bb007){io['to'](_0x1fb0e6)[_0xd342('0x1e')](_0x1c9879,_0x1bb007);};VoiceAgentReport[_0xd342('0x1d')][_0xd342('0x1f')]=function(_0x2dbd08){return _0x2dbd08!==null&&!_['isUndefined'](_0x2dbd08);};VoiceAgentReport[_0xd342('0x1d')][_0xd342('0xd')]=function(_0x105db1){try{if(this[_0xd342('0x1f')](_0x105db1)){if(_[_0xd342('0x20')](this[_0xd342('0x21')][_0x105db1['uniqueid']])){this[_0xd342('0x21')][_0x105db1[_0xd342('0x22')]]={};}if(_['isUndefined'](this[_0xd342('0x21')][_0x105db1[_0xd342('0x22')]][_0x105db1['destuniqueid']])){this['channels'][_0x105db1[_0xd342('0x22')]][_0x105db1[_0xd342('0x23')]]={'agentcalledAt':moment()['format'](_0xd342('0x24')),'lastevent':_0xd342('0x25'),'variables':this['variables'][_0x105db1['uniqueid']],'type':this[_0xd342('0xa')][_0x105db1[_0xd342('0x26')]]?this[_0xd342('0xa')][_0x105db1[_0xd342('0x26')]][_0xd342('0x27')]||_0xd342('0x28'):'inbound'};}_['merge'](this[_0xd342('0x21')][_0x105db1[_0xd342('0x22')]][_0x105db1[_0xd342('0x23')]],_[_0xd342('0x29')](_0x105db1,[_0xd342('0x2a'),_0xd342('0x2b')]));ami['emit'](_0xd342('0x2c'),this[_0xd342('0x21')][_0x105db1['uniqueid']][_0x105db1[_0xd342('0x23')]]);this[_0xd342('0x1e')](util[_0xd342('0x2d')](_0xd342('0x2e'),_0x105db1['membername']),_0xd342('0x2f'),this[_0xd342('0x21')][_0x105db1[_0xd342('0x22')]][_0x105db1[_0xd342('0x23')]]);}}catch(_0x309660){logger[_0xd342('0x30')](_0xd342('0x31'),util[_0xd342('0x32')](_0x309660,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd342('0x1d')][_0xd342('0xf')]=function(_0x1a96e0){try{if(this['isNotNull'](_0x1a96e0)){if(this[_0xd342('0x21')][_0x1a96e0[_0xd342('0x22')]]){for(var _0x26a5c3 in this[_0xd342('0x21')][_0x1a96e0[_0xd342('0x22')]]){if(this[_0xd342('0x21')][_0x1a96e0['uniqueid']]['hasOwnProperty'](_0x26a5c3)){if(_0x1a96e0[_0xd342('0x23')]===_0x26a5c3){this['channels'][_0x1a96e0[_0xd342('0x22')]][_0x26a5c3][_0xd342('0x33')]=moment()[_0xd342('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xd342('0x21')][_0x1a96e0['uniqueid']][_0x26a5c3][_0xd342('0x34')]=_0xd342('0x35');this[_0xd342('0x21')][_0x1a96e0[_0xd342('0x22')]][_0x26a5c3][_0xd342('0x36')]=_0x1a96e0[_0xd342('0x36')];this[_0xd342('0x21')][_0x1a96e0[_0xd342('0x22')]][_0x26a5c3]['connectedlinenum']=_0x1a96e0[_0xd342('0x37')];this[_0xd342('0x21')][_0x1a96e0[_0xd342('0x22')]][_0x26a5c3][_0xd342('0x38')]=_0x1a96e0['connectedlinename'];this[_0xd342('0x21')][_0x1a96e0[_0xd342('0x22')]][_0x26a5c3][_0xd342('0x39')]=_0x1a96e0[_0xd342('0x39')];this[_0xd342('0x21')][_0x1a96e0[_0xd342('0x22')]][_0x26a5c3][_0xd342('0x3a')]=_0x1a96e0[_0xd342('0x3a')];_[_0xd342('0x3b')](this[_0xd342('0xb')][_0x1a96e0[_0xd342('0x3c')]],_[_0xd342('0x3d')](_0x1a96e0,['queue','destconnectedlinenum']));this[_0xd342('0x1e')](util[_0xd342('0x2d')](_0xd342('0x2e'),_0x1a96e0[_0xd342('0x3e')]),_0xd342('0x3f'),this[_0xd342('0x21')][_0x1a96e0[_0xd342('0x22')]][_0x1a96e0[_0xd342('0x23')]]);ami[_0xd342('0x1e')](_0xd342('0x40'),this[_0xd342('0x21')][_0x1a96e0[_0xd342('0x22')]][_0x26a5c3]);}else if(!this[_0xd342('0x21')][_0x1a96e0[_0xd342('0x22')]][_0x26a5c3]['agentringnoanswer']&&!this[_0xd342('0x21')][_0x1a96e0['uniqueid']][_0x26a5c3][_0xd342('0x14')]){this['channels'][_0x1a96e0[_0xd342('0x22')]][_0x26a5c3]['agentringnoanswer']=!![];this['channels'][_0x1a96e0['uniqueid']][_0x26a5c3]['agentringnoanswerAt']=moment()[_0xd342('0x2d')](_0xd342('0x24'));this['channels'][_0x1a96e0[_0xd342('0x22')]][_0x26a5c3][_0xd342('0x41')]=_0xd342('0x42');this['channels'][_0x1a96e0['uniqueid']][_0x26a5c3][_0xd342('0x34')]=_0xd342('0x42');this[_0xd342('0x21')][_0x1a96e0[_0xd342('0x22')]][_0x26a5c3][_0xd342('0x43')]=_0x1a96e0[_0xd342('0x23')];this['channels'][_0x1a96e0[_0xd342('0x22')]][_0x26a5c3][_0xd342('0x44')]=_0x1a96e0[_0xd342('0x3e')];ami[_0xd342('0x1e')](_0xd342('0x45'),this[_0xd342('0x21')][_0x1a96e0[_0xd342('0x22')]][_0x26a5c3]);}}}}}}catch(_0x989014){logger[_0xd342('0x30')]('[syncAgentConnect][VoiceAgentReport]',util[_0xd342('0x32')](_0x989014,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd342('0x1d')][_0xd342('0x12')]=function(_0x26b2c6){try{if(this[_0xd342('0x1f')](_0x26b2c6)){if(this[_0xd342('0x21')][_0x26b2c6[_0xd342('0x22')]]&&this[_0xd342('0x21')][_0x26b2c6[_0xd342('0x22')]][_0x26b2c6[_0xd342('0x23')]]){this[_0xd342('0x21')][_0x26b2c6['uniqueid']][_0x26b2c6[_0xd342('0x23')]][_0xd342('0x11')]=!![];this['channels'][_0x26b2c6[_0xd342('0x22')]][_0x26b2c6[_0xd342('0x23')]][_0xd342('0x46')]=moment()[_0xd342('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x26b2c6[_0xd342('0x22')]][_0x26b2c6[_0xd342('0x23')]][_0xd342('0x41')]='rejected';this[_0xd342('0x21')][_0x26b2c6[_0xd342('0x22')]][_0x26b2c6[_0xd342('0x23')]][_0xd342('0x34')]=_0xd342('0x47');ami[_0xd342('0x1e')](_0xd342('0x48'),this['channels'][_0x26b2c6[_0xd342('0x22')]][_0x26b2c6['destuniqueid']]);}}}catch(_0x594bec){logger['error'](_0xd342('0x49'),util['inspect'](_0x594bec,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncQueueCallerAbandon']=function(_0x295536){try{if(this['isNotNull'](_0x295536)){if(this[_0xd342('0x21')][_0x295536[_0xd342('0x22')]]){for(var _0xea2cd7 in this['channels'][_0x295536[_0xd342('0x22')]]){if(this[_0xd342('0x21')][_0x295536['uniqueid']]['hasOwnProperty'](_0xea2cd7)&&!this[_0xd342('0x21')][_0x295536['uniqueid']][_0xea2cd7][_0xd342('0x11')]&&!this[_0xd342('0x21')][_0x295536['uniqueid']][_0xea2cd7]['agentcomplete']){this[_0xd342('0x21')][_0x295536[_0xd342('0x22')]][_0xea2cd7][_0xd342('0x11')]=!![];this[_0xd342('0x21')][_0x295536['uniqueid']][_0xea2cd7][_0xd342('0x46')]=moment()[_0xd342('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xd342('0x21')][_0x295536[_0xd342('0x22')]][_0xea2cd7]['reason']=_0xd342('0x4a');this[_0xd342('0x21')][_0x295536[_0xd342('0x22')]][_0xea2cd7][_0xd342('0x34')]=_0xd342('0x4a');ami['emit'](_0xd342('0x4b'),this[_0xd342('0x21')][_0x295536[_0xd342('0x22')]][_0xea2cd7]);}}}}}catch(_0x25355d){logger[_0xd342('0x30')](_0xd342('0x4c'),util['inspect'](_0x25355d,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xd342('0x4d')]=function(_0x2c3924){try{if(this[_0xd342('0x1f')](_0x2c3924)){if(this[_0xd342('0x21')][_0x2c3924[_0xd342('0x22')]]){for(var _0x3dac10 in this[_0xd342('0x21')][_0x2c3924[_0xd342('0x22')]]){if(this['channels'][_0x2c3924[_0xd342('0x22')]][_0xd342('0x4e')](_0x3dac10)){if(this[_0xd342('0x21')][_0x2c3924[_0xd342('0x22')]][_0x3dac10][_0xd342('0x33')]&&!this['channels'][_0x2c3924[_0xd342('0x22')]][_0x3dac10][_0xd342('0x14')]){this['channels'][_0x2c3924['uniqueid']][_0x3dac10][_0xd342('0x14')]=!![];this['channels'][_0x2c3924['uniqueid']][_0x3dac10][_0xd342('0x4f')]=moment()[_0xd342('0x2d')](_0xd342('0x24'));this['channels'][_0x2c3924[_0xd342('0x22')]][_0x3dac10][_0xd342('0x34')]=_0xd342('0x50');this[_0xd342('0x21')][_0x2c3924['uniqueid']][_0x3dac10]['talktime']=_0x2c3924[_0xd342('0x51')];this[_0xd342('0x21')][_0x2c3924['uniqueid']][_0x3dac10][_0xd342('0x41')]=_0x2c3924[_0xd342('0x41')]==_0xd342('0x52')?_0xd342('0x53'):_0x2c3924[_0xd342('0x41')];if(this['voiceQueues'][_0x2c3924[_0xd342('0x26')]]&&this['voiceQueues'][_0x2c3924[_0xd342('0x26')]][_0xd342('0x54')]){this[_0xd342('0x21')][_0x2c3924[_0xd342('0x22')]][_0x3dac10]['agentacw']=!![];this[_0xd342('0x21')][_0x2c3924['uniqueid']][_0x3dac10]['acwtime']=this[_0xd342('0xa')][_0x2c3924[_0xd342('0x26')]][_0xd342('0x55')];}this[_0xd342('0xb')][_0x2c3924[_0xd342('0x3c')]]=_[_0xd342('0x29')](this['agents'][_0x2c3924[_0xd342('0x3c')]],['queue','destconnectedlinenum']);this[_0xd342('0x1e')](util[_0xd342('0x2d')](_0xd342('0x2e'),_0x2c3924[_0xd342('0x3e')]),_0xd342('0x56'),this[_0xd342('0x21')][_0x2c3924[_0xd342('0x22')]][_0x3dac10]);ami[_0xd342('0x1e')](_0xd342('0x57'),this[_0xd342('0x21')][_0x2c3924[_0xd342('0x22')]][_0x3dac10]);}}}}}}catch(_0x1b1113){logger[_0xd342('0x30')](_0xd342('0x58'),util[_0xd342('0x32')](_0x1b1113,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd342('0x1d')][_0xd342('0x15')]=function(_0x3beaaf){try{if(this[_0xd342('0x1f')](_0x3beaaf)){this[_0xd342('0x59')](_0x3beaaf['uniqueid'],_[_0xd342('0x5a')](_0x3beaaf[_0xd342('0x5b')])[0x0],_0x3beaaf[_0xd342('0x5c')]);if(this[_0xd342('0x21')][_0x3beaaf['uniqueid']]){for(var _0x520b27 in this[_0xd342('0x21')][_0x3beaaf[_0xd342('0x22')]]){if(this[_0xd342('0x21')][_0x3beaaf[_0xd342('0x22')]][_0xd342('0x4e')](_0x520b27)){if(_['isUndefined'](this[_0xd342('0x21')][_0x3beaaf[_0xd342('0x22')]][_0x520b27][_0xd342('0x5d')])){this[_0xd342('0x21')][_0x3beaaf[_0xd342('0x22')]][_0x520b27][_0xd342('0x5d')]={};}this[_0xd342('0x21')][_0x3beaaf[_0xd342('0x22')]][_0x520b27][_0xd342('0x5d')]=this[_0xd342('0x5d')][_0x3beaaf['uniqueid']];}}}}}catch(_0x240297){logger[_0xd342('0x30')](_0xd342('0x5e'),util['inspect'](_0x240297,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd342('0x1d')]['addVariable']=function(_0x39947b,_0x140c86,_0x239d7f){var _0x139f1a=[_0xd342('0x5f'),_0xd342('0x60'),_0xd342('0x61'),'rtpaudioqosjitterbridged',_0xd342('0x62'),_0xd342('0x63'),_0xd342('0x64'),_0xd342('0x65'),_0xd342('0x66'),'sipuri',_0xd342('0x67'),_0xd342('0x68'),'membercalls',_0xd342('0x69'),'memberinterface',_0xd342('0x6a'),_0xd342('0x3e'),'memberpenalty',_0xd342('0x6b')];if(!_[_0xd342('0x6c')](_0x140c86)&&!_[_0xd342('0x6d')](_0x139f1a,_0x140c86)){if(_[_0xd342('0x20')](this['variables'][_0x39947b])){this['variables'][_0x39947b]={};}this['variables'][_0x39947b][_0x140c86]=_0x239d7f;}};VoiceAgentReport[_0xd342('0x1d')][_0xd342('0x17')]=function(_0x3cfec4){try{if(this[_0xd342('0x1f')](_0x3cfec4)){if(this[_0xd342('0x21')][_0x3cfec4[_0xd342('0x22')]]){for(var _0x256633 in this[_0xd342('0x21')][_0x3cfec4[_0xd342('0x22')]]){if(this[_0xd342('0x21')][_0x3cfec4[_0xd342('0x22')]]['hasOwnProperty'](_0x256633)){if(this['channels'][_0x3cfec4[_0xd342('0x22')]][_0x256633][_0xd342('0x41')]==_0xd342('0x52')&&this[_0xd342('0x21')][_0x3cfec4[_0xd342('0x22')]][_0x256633]['agentcomplete']){this[_0xd342('0x21')][_0x3cfec4['uniqueid']][_0x256633][_0xd342('0x4f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}}ami[_0xd342('0x1e')](_0xd342('0x6e'),_[_0xd342('0x6f')](this[_0xd342('0x21')][_0x3cfec4['uniqueid']]));delete this[_0xd342('0x21')][_0x3cfec4[_0xd342('0x22')]];}if(this[_0xd342('0x5d')][_0x3cfec4[_0xd342('0x22')]]){delete this['variables'][_0x3cfec4[_0xd342('0x22')]];}}}catch(_0x1a0161){logger[_0xd342('0x30')](_0xd342('0x70'),util[_0xd342('0x32')](_0x1a0161,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd342('0x1d')]['syncAttendedTransfer']=function(_0x155f99){try{if(this[_0xd342('0x1f')](_0x155f99)){if(this[_0xd342('0x21')][_0x155f99[_0xd342('0x71')]]){for(var _0x134446 in this[_0xd342('0x21')][_0x155f99[_0xd342('0x71')]]){if(this[_0xd342('0x21')][_0x155f99[_0xd342('0x71')]][_0xd342('0x4e')](_0x134446)){if(_0x155f99[_0xd342('0x72')]===_0x134446){var _0x1ac76c=moment();this[_0xd342('0x21')][_0x155f99[_0xd342('0x71')]][_0x134446][_0xd342('0x14')]=!![];this[_0xd342('0x21')][_0x155f99[_0xd342('0x71')]][_0x134446][_0xd342('0x4f')]=moment()[_0xd342('0x2d')](_0xd342('0x24'));this[_0xd342('0x21')][_0x155f99[_0xd342('0x71')]][_0x134446][_0xd342('0x41')]=_0xd342('0x52');this[_0xd342('0x21')][_0x155f99[_0xd342('0x71')]][_0x134446][_0xd342('0x34')]=_0xd342('0x50');this[_0xd342('0x21')][_0x155f99[_0xd342('0x71')]][_0x134446][_0xd342('0x51')]=_0x1ac76c[_0xd342('0x73')](this[_0xd342('0x21')][_0x155f99[_0xd342('0x71')]][_0x134446]['agentconnectAt'],_0xd342('0x74'));}}}}if(this[_0xd342('0x21')][_0x155f99[_0xd342('0x75')]]){var _0x2d933a=this[_0xd342('0x21')][_0x155f99['secondtransfereruniqueid']];this[_0xd342('0x21')][_0x155f99[_0xd342('0x75')]]=this[_0xd342('0x21')][_0x155f99[_0xd342('0x71')]];this[_0xd342('0x21')][_0x155f99[_0xd342('0x71')]]=_0x2d933a;}}}catch(_0x5a3382){logger[_0xd342('0x30')](_0xd342('0x76'),util[_0xd342('0x32')](_0x5a3382,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd342('0x1d')][_0xd342('0x1c')]=function(_0x40a793){try{if(this[_0xd342('0x1f')](_0x40a793)){if(this['channels'][_0x40a793[_0xd342('0x71')]]){for(var _0xf24653 in this['channels'][_0x40a793[_0xd342('0x71')]]){if(this['channels'][_0x40a793[_0xd342('0x71')]]['hasOwnProperty'](_0xf24653)){if(_0x40a793[_0xd342('0x77')]===_0xf24653){var _0x394d17=moment();this['channels'][_0x40a793[_0xd342('0x71')]][_0xf24653][_0xd342('0x14')]=!![];this[_0xd342('0x21')][_0x40a793['transfereeuniqueid']][_0xf24653]['agentcompleteAt']=_0x394d17;this['channels'][_0x40a793['transfereeuniqueid']][_0xf24653][_0xd342('0x41')]=_0xd342('0x52');this['channels'][_0x40a793[_0xd342('0x71')]][_0xf24653][_0xd342('0x34')]='complete';this[_0xd342('0x21')][_0x40a793[_0xd342('0x71')]][_0xf24653]['talktime']=_0x394d17[_0xd342('0x73')](this[_0xd342('0x21')][_0x40a793['transfereeuniqueid']][_0xf24653]['agentconnectAt'],_0xd342('0x74'));}}}}}}catch(_0x5c13f4){logger['error'](_0xd342('0x78'),util['inspect'](_0x5c13f4,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xd342('0x79')]=function(_0xc40ed8){var _0x4ce6e0='';try{if(this[_0xd342('0x1f')](_0xc40ed8)){if(_0xc40ed8[_0xd342('0x7a')]){_0x4ce6e0=_0xc40ed8[_0xd342('0x7a')][_0xd342('0x7b')](0x0,_0xc40ed8[_0xd342('0x7a')][_0xd342('0x7c')]('-'));if(this['agents'][_0x4ce6e0]){this[_0xd342('0xb')][_0x4ce6e0][_0xd342('0x7d')]=!![];}}}}catch(_0x52e6bd){logger[_0xd342('0x30')](_0xd342('0x7e'),util[_0xd342('0x32')](_0x52e6bd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xd342('0x19')]=function(_0x32c0ab){var _0x160d0a='';try{if(this[_0xd342('0x1f')](_0x32c0ab)){if(_0x32c0ab[_0xd342('0x7a')]){_0x160d0a=_0x32c0ab[_0xd342('0x7a')]['substring'](0x0,_0x32c0ab[_0xd342('0x7a')][_0xd342('0x7c')]('-'));if(this[_0xd342('0xb')][_0x160d0a]){this[_0xd342('0xb')][_0x160d0a][_0xd342('0x7d')]=![];}}}}catch(_0x5b52ee){logger['error'](_0xd342('0x7f'),util[_0xd342('0x32')](_0x5b52ee,{'showHidden':![],'depth':null}));}};module[_0xd342('0x80')]=VoiceAgentReport; \ No newline at end of file +var _0xbbaf=['[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','syncBlindTransfer','transfereruniqueid','diff','[syncBlindTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','lodash','moment','util','../ami','redis','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','prototype','emit','isNotNull','isUndefined','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','merge','omit','event','privilege','user:%s','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','agentconnectAt','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','destconnectedlinenum','membername','user:agentconnect','custom:agentconnect','agentringnoanswerAt','answered_elsewhere','answeredelsewheremembername','[syncAgentConnect][VoiceAgentReport]','syncAgentRingNoAnswer','reason','lastevent','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','custom:agentqueuecallerabandon','agentcompleteAt','complete','talktime','transfer','agent','acwtime','acwTimeout','user:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','custom:voiceAgentReport','values'];(function(_0x466e01,_0x837362){var _0x46f413=function(_0x1a24c9){while(--_0x1a24c9){_0x466e01['push'](_0x466e01['shift']());}};_0x46f413(++_0x837362);}(_0xbbaf,0x17e));var _0xfbba=function(_0x53f29b,_0x22cf73){_0x53f29b=_0x53f29b-0x0;var _0x18b486=_0xbbaf[_0x53f29b];return _0x18b486;};'use strict';var _=require(_0xfbba('0x0'));var moment=require(_0xfbba('0x1'));var util=require(_0xfbba('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require('../../../config/logger')('ami');var ami=require(_0xfbba('0x3'));config[_0xfbba('0x4')]=_['defaults'](config[_0xfbba('0x4')],{'host':_0xfbba('0x5'),'port':0x18eb});var io=require(_0xfbba('0x6'))(new Redis(config[_0xfbba('0x4')]));function VoiceAgentReport(_0x3440e7){this[_0xfbba('0x7')]={};this[_0xfbba('0x8')]=_0x3440e7['voiceQueues'];this['agents']=_0x3440e7[_0xfbba('0x9')];this[_0xfbba('0xa')]={};ami['on'](_0xfbba('0xb'),this['syncAgentCalled'][_0xfbba('0xc')](this));ami['on'](_0xfbba('0xd'),this[_0xfbba('0xe')][_0xfbba('0xc')](this));ami['on'](_0xfbba('0xf'),this['syncAgentRingNoAnswer'][_0xfbba('0xc')](this));ami['on'](_0xfbba('0x10'),this[_0xfbba('0x11')]['bind'](this));ami['on'](_0xfbba('0x12'),this[_0xfbba('0x13')]['bind'](this));ami['on']('varset',this[_0xfbba('0x14')][_0xfbba('0xc')](this));ami['on'](_0xfbba('0x15'),this[_0xfbba('0x16')][_0xfbba('0xc')](this));ami['on'](_0xfbba('0x17'),this[_0xfbba('0x18')][_0xfbba('0xc')](this));ami['on'](_0xfbba('0x19'),this[_0xfbba('0x1a')][_0xfbba('0xc')](this));ami['on'](_0xfbba('0x1b'),this[_0xfbba('0x1c')][_0xfbba('0xc')](this));ami['on'](_0xfbba('0x1d'),this['syncBlindTransfer']['bind'](this));}VoiceAgentReport[_0xfbba('0x1e')]['emit']=function(_0x405450,_0x2990ea,_0x5c8607){io['to'](_0x405450)[_0xfbba('0x1f')](_0x2990ea,_0x5c8607);};VoiceAgentReport[_0xfbba('0x1e')][_0xfbba('0x20')]=function(_0x3369d8){return _0x3369d8!==null&&!_[_0xfbba('0x21')](_0x3369d8);};VoiceAgentReport[_0xfbba('0x1e')]['syncAgentCalled']=function(_0xb938d9){try{if(this[_0xfbba('0x20')](_0xb938d9)){if(_[_0xfbba('0x21')](this[_0xfbba('0x7')][_0xb938d9[_0xfbba('0x22')]])){this[_0xfbba('0x7')][_0xb938d9[_0xfbba('0x22')]]={};}if(_['isUndefined'](this['channels'][_0xb938d9[_0xfbba('0x22')]][_0xb938d9[_0xfbba('0x23')]])){this[_0xfbba('0x7')][_0xb938d9[_0xfbba('0x22')]][_0xb938d9[_0xfbba('0x23')]]={'agentcalledAt':moment()[_0xfbba('0x24')](_0xfbba('0x25')),'lastevent':_0xfbba('0x26'),'variables':this['variables'][_0xb938d9['uniqueid']],'type':this[_0xfbba('0x8')][_0xb938d9[_0xfbba('0x27')]]?this[_0xfbba('0x8')][_0xb938d9['queue']][_0xfbba('0x28')]||_0xfbba('0x29'):'inbound'};}_[_0xfbba('0x2a')](this[_0xfbba('0x7')][_0xb938d9[_0xfbba('0x22')]][_0xb938d9['destuniqueid']],_[_0xfbba('0x2b')](_0xb938d9,[_0xfbba('0x2c'),_0xfbba('0x2d')]));ami['emit']('custom:agentcalled',this[_0xfbba('0x7')][_0xb938d9[_0xfbba('0x22')]][_0xb938d9['destuniqueid']]);this[_0xfbba('0x1f')](util[_0xfbba('0x24')](_0xfbba('0x2e'),_0xb938d9['membername']),_0xfbba('0x2f'),this[_0xfbba('0x7')][_0xb938d9[_0xfbba('0x22')]][_0xb938d9['destuniqueid']]);}}catch(_0x421e01){logger[_0xfbba('0x30')](_0xfbba('0x31'),util[_0xfbba('0x32')](_0x421e01,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xfbba('0x1e')][_0xfbba('0xe')]=function(_0x36e417){try{if(this['isNotNull'](_0x36e417)){if(this[_0xfbba('0x7')][_0x36e417[_0xfbba('0x22')]]){for(var _0x59521f in this[_0xfbba('0x7')][_0x36e417['uniqueid']]){if(this[_0xfbba('0x7')][_0x36e417[_0xfbba('0x22')]][_0xfbba('0x33')](_0x59521f)){if(_0x36e417['destuniqueid']===_0x59521f){this[_0xfbba('0x7')][_0x36e417[_0xfbba('0x22')]][_0x59521f][_0xfbba('0x34')]=moment()[_0xfbba('0x24')](_0xfbba('0x25'));this[_0xfbba('0x7')][_0x36e417[_0xfbba('0x22')]][_0x59521f]['lastevent']='connect';this[_0xfbba('0x7')][_0x36e417['uniqueid']][_0x59521f][_0xfbba('0x35')]=_0x36e417[_0xfbba('0x35')];this['channels'][_0x36e417[_0xfbba('0x22')]][_0x59521f][_0xfbba('0x36')]=_0x36e417['connectedlinenum'];this[_0xfbba('0x7')][_0x36e417[_0xfbba('0x22')]][_0x59521f][_0xfbba('0x37')]=_0x36e417[_0xfbba('0x37')];this[_0xfbba('0x7')][_0x36e417[_0xfbba('0x22')]][_0x59521f][_0xfbba('0x38')]=_0x36e417[_0xfbba('0x38')];this['channels'][_0x36e417[_0xfbba('0x22')]][_0x59521f][_0xfbba('0x39')]=_0x36e417['destchannelstatedesc'];_[_0xfbba('0x2a')](this['agents'][_0x36e417[_0xfbba('0x3a')]],_[_0xfbba('0x3b')](_0x36e417,[_0xfbba('0x27'),_0xfbba('0x3c')]));this['emit'](util['format'](_0xfbba('0x2e'),_0x36e417[_0xfbba('0x3d')]),_0xfbba('0x3e'),this[_0xfbba('0x7')][_0x36e417[_0xfbba('0x22')]][_0x36e417['destuniqueid']]);ami[_0xfbba('0x1f')](_0xfbba('0x3f'),this[_0xfbba('0x7')][_0x36e417[_0xfbba('0x22')]][_0x59521f]);}else if(!this[_0xfbba('0x7')][_0x36e417[_0xfbba('0x22')]][_0x59521f][_0xfbba('0xf')]&&!this[_0xfbba('0x7')][_0x36e417[_0xfbba('0x22')]][_0x59521f]['agentcomplete']){this[_0xfbba('0x7')][_0x36e417['uniqueid']][_0x59521f][_0xfbba('0xf')]=!![];this[_0xfbba('0x7')][_0x36e417[_0xfbba('0x22')]][_0x59521f][_0xfbba('0x40')]=moment()[_0xfbba('0x24')](_0xfbba('0x25'));this[_0xfbba('0x7')][_0x36e417[_0xfbba('0x22')]][_0x59521f]['reason']=_0xfbba('0x41');this[_0xfbba('0x7')][_0x36e417[_0xfbba('0x22')]][_0x59521f]['lastevent']=_0xfbba('0x41');this[_0xfbba('0x7')][_0x36e417[_0xfbba('0x22')]][_0x59521f]['answeredelsewheredestinationuniqueid']=_0x36e417[_0xfbba('0x23')];this['channels'][_0x36e417[_0xfbba('0x22')]][_0x59521f][_0xfbba('0x42')]=_0x36e417['membername'];ami['emit']('custom:agentansweredelsewhere',this[_0xfbba('0x7')][_0x36e417[_0xfbba('0x22')]][_0x59521f]);}}}}}}catch(_0x5e9e91){logger[_0xfbba('0x30')](_0xfbba('0x43'),util[_0xfbba('0x32')](_0x5e9e91,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xfbba('0x1e')][_0xfbba('0x44')]=function(_0x3bed07){try{if(this[_0xfbba('0x20')](_0x3bed07)){if(this[_0xfbba('0x7')][_0x3bed07[_0xfbba('0x22')]]&&this[_0xfbba('0x7')][_0x3bed07['uniqueid']][_0x3bed07[_0xfbba('0x23')]]){this[_0xfbba('0x7')][_0x3bed07[_0xfbba('0x22')]][_0x3bed07['destuniqueid']][_0xfbba('0xf')]=!![];this[_0xfbba('0x7')][_0x3bed07[_0xfbba('0x22')]][_0x3bed07[_0xfbba('0x23')]]['agentringnoanswerAt']=moment()[_0xfbba('0x24')](_0xfbba('0x25'));this[_0xfbba('0x7')][_0x3bed07['uniqueid']][_0x3bed07[_0xfbba('0x23')]][_0xfbba('0x45')]='rejected';this[_0xfbba('0x7')][_0x3bed07[_0xfbba('0x22')]][_0x3bed07[_0xfbba('0x23')]][_0xfbba('0x46')]=_0xfbba('0x47');ami[_0xfbba('0x1f')](_0xfbba('0x48'),this[_0xfbba('0x7')][_0x3bed07['uniqueid']][_0x3bed07[_0xfbba('0x23')]]);}}}catch(_0xadb539){logger[_0xfbba('0x30')](_0xfbba('0x49'),util[_0xfbba('0x32')](_0xadb539,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xfbba('0x1e')][_0xfbba('0x11')]=function(_0x503a61){try{if(this[_0xfbba('0x20')](_0x503a61)){if(this[_0xfbba('0x7')][_0x503a61['uniqueid']]){for(var _0x128bdb in this[_0xfbba('0x7')][_0x503a61[_0xfbba('0x22')]]){if(this[_0xfbba('0x7')][_0x503a61[_0xfbba('0x22')]][_0xfbba('0x33')](_0x128bdb)&&!this[_0xfbba('0x7')][_0x503a61['uniqueid']][_0x128bdb][_0xfbba('0xf')]&&!this[_0xfbba('0x7')][_0x503a61[_0xfbba('0x22')]][_0x128bdb][_0xfbba('0x12')]){this[_0xfbba('0x7')][_0x503a61[_0xfbba('0x22')]][_0x128bdb][_0xfbba('0xf')]=!![];this['channels'][_0x503a61[_0xfbba('0x22')]][_0x128bdb][_0xfbba('0x40')]=moment()[_0xfbba('0x24')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xfbba('0x7')][_0x503a61['uniqueid']][_0x128bdb][_0xfbba('0x45')]='abandoned';this[_0xfbba('0x7')][_0x503a61[_0xfbba('0x22')]][_0x128bdb][_0xfbba('0x46')]='abandoned';ami[_0xfbba('0x1f')](_0xfbba('0x4a'),this[_0xfbba('0x7')][_0x503a61[_0xfbba('0x22')]][_0x128bdb]);}}}}}catch(_0x20d1b0){logger['error']('[syncQueueCallerAbandon][VoiceAgentReport]',util[_0xfbba('0x32')](_0x20d1b0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xfbba('0x1e')][_0xfbba('0x13')]=function(_0x40fd2e){try{if(this[_0xfbba('0x20')](_0x40fd2e)){if(this[_0xfbba('0x7')][_0x40fd2e['uniqueid']]){for(var _0x2bcc74 in this[_0xfbba('0x7')][_0x40fd2e[_0xfbba('0x22')]]){if(this['channels'][_0x40fd2e['uniqueid']][_0xfbba('0x33')](_0x2bcc74)){if(this[_0xfbba('0x7')][_0x40fd2e[_0xfbba('0x22')]][_0x2bcc74][_0xfbba('0x34')]&&!this[_0xfbba('0x7')][_0x40fd2e[_0xfbba('0x22')]][_0x2bcc74]['agentcomplete']){this[_0xfbba('0x7')][_0x40fd2e[_0xfbba('0x22')]][_0x2bcc74][_0xfbba('0x12')]=!![];this[_0xfbba('0x7')][_0x40fd2e[_0xfbba('0x22')]][_0x2bcc74][_0xfbba('0x4b')]=moment()[_0xfbba('0x24')](_0xfbba('0x25'));this[_0xfbba('0x7')][_0x40fd2e[_0xfbba('0x22')]][_0x2bcc74][_0xfbba('0x46')]=_0xfbba('0x4c');this['channels'][_0x40fd2e[_0xfbba('0x22')]][_0x2bcc74]['talktime']=_0x40fd2e[_0xfbba('0x4d')];this[_0xfbba('0x7')][_0x40fd2e[_0xfbba('0x22')]][_0x2bcc74][_0xfbba('0x45')]=_0x40fd2e[_0xfbba('0x45')]==_0xfbba('0x4e')?_0xfbba('0x4f'):_0x40fd2e[_0xfbba('0x45')];if(this[_0xfbba('0x8')][_0x40fd2e['queue']]&&this['voiceQueues'][_0x40fd2e[_0xfbba('0x27')]]['acw']){this[_0xfbba('0x7')][_0x40fd2e[_0xfbba('0x22')]][_0x2bcc74]['agentacw']=!![];this[_0xfbba('0x7')][_0x40fd2e[_0xfbba('0x22')]][_0x2bcc74][_0xfbba('0x50')]=this[_0xfbba('0x8')][_0x40fd2e['queue']][_0xfbba('0x51')];}this[_0xfbba('0x9')][_0x40fd2e['interface']]=_[_0xfbba('0x2b')](this[_0xfbba('0x9')][_0x40fd2e[_0xfbba('0x3a')]],[_0xfbba('0x27'),_0xfbba('0x3c')]);this['emit'](util[_0xfbba('0x24')](_0xfbba('0x2e'),_0x40fd2e['membername']),_0xfbba('0x52'),this[_0xfbba('0x7')][_0x40fd2e[_0xfbba('0x22')]][_0x2bcc74]);ami[_0xfbba('0x1f')]('custom:agentcomplete',this[_0xfbba('0x7')][_0x40fd2e[_0xfbba('0x22')]][_0x2bcc74]);}}}}}}catch(_0x3bb0e6){logger[_0xfbba('0x30')](_0xfbba('0x53'),util[_0xfbba('0x32')](_0x3bb0e6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xfbba('0x1e')][_0xfbba('0x14')]=function(_0x9a7195){try{if(this[_0xfbba('0x20')](_0x9a7195)){this[_0xfbba('0x54')](_0x9a7195[_0xfbba('0x22')],_[_0xfbba('0x55')](_0x9a7195[_0xfbba('0x56')])[0x0],_0x9a7195['value']);if(this['channels'][_0x9a7195['uniqueid']]){for(var _0x5e2e77 in this['channels'][_0x9a7195['uniqueid']]){if(this[_0xfbba('0x7')][_0x9a7195[_0xfbba('0x22')]]['hasOwnProperty'](_0x5e2e77)){if(_[_0xfbba('0x21')](this[_0xfbba('0x7')][_0x9a7195[_0xfbba('0x22')]][_0x5e2e77]['variables'])){this[_0xfbba('0x7')][_0x9a7195['uniqueid']][_0x5e2e77][_0xfbba('0xa')]={};}this['channels'][_0x9a7195[_0xfbba('0x22')]][_0x5e2e77]['variables']=this[_0xfbba('0xa')][_0x9a7195[_0xfbba('0x22')]];}}}}}catch(_0x5a4cbc){logger[_0xfbba('0x30')](_0xfbba('0x57'),util[_0xfbba('0x32')](_0x5a4cbc,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xfbba('0x1e')][_0xfbba('0x54')]=function(_0x169ac2,_0x468f87,_0x1c2cdd){var _0x422084=[_0xfbba('0x58'),_0xfbba('0x59'),'rtpaudioqosjitter',_0xfbba('0x5a'),_0xfbba('0x5b'),_0xfbba('0x5c'),_0xfbba('0x5d'),_0xfbba('0x5e'),'sipcallid','sipuri',_0xfbba('0x5f'),_0xfbba('0x60'),_0xfbba('0x61'),_0xfbba('0x62'),_0xfbba('0x63'),_0xfbba('0x64'),_0xfbba('0x3d'),_0xfbba('0x65'),_0xfbba('0x66')];if(!_['isNil'](_0x468f87)&&!_[_0xfbba('0x67')](_0x422084,_0x468f87)){if(_['isUndefined'](this[_0xfbba('0xa')][_0x169ac2])){this['variables'][_0x169ac2]={};}this['variables'][_0x169ac2][_0x468f87]=_0x1c2cdd;}};VoiceAgentReport['prototype'][_0xfbba('0x16')]=function(_0x4192a4){try{if(this[_0xfbba('0x20')](_0x4192a4)){if(this[_0xfbba('0x7')][_0x4192a4['uniqueid']]){for(var _0x857bd6 in this['channels'][_0x4192a4[_0xfbba('0x22')]]){if(this[_0xfbba('0x7')][_0x4192a4['uniqueid']][_0xfbba('0x33')](_0x857bd6)){if(this['channels'][_0x4192a4[_0xfbba('0x22')]][_0x857bd6]['reason']==_0xfbba('0x4e')&&this['channels'][_0x4192a4[_0xfbba('0x22')]][_0x857bd6][_0xfbba('0x12')]){this[_0xfbba('0x7')][_0x4192a4[_0xfbba('0x22')]][_0x857bd6][_0xfbba('0x4b')]=moment()[_0xfbba('0x24')](_0xfbba('0x25'));}}}ami[_0xfbba('0x1f')](_0xfbba('0x68'),_[_0xfbba('0x69')](this['channels'][_0x4192a4['uniqueid']]));delete this[_0xfbba('0x7')][_0x4192a4['uniqueid']];}if(this[_0xfbba('0xa')][_0x4192a4[_0xfbba('0x22')]]){delete this[_0xfbba('0xa')][_0x4192a4['uniqueid']];}}}catch(_0x458718){logger[_0xfbba('0x30')](_0xfbba('0x6a'),util[_0xfbba('0x32')](_0x458718,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xfbba('0x1e')][_0xfbba('0x1c')]=function(_0x1a0431){try{if(this[_0xfbba('0x20')](_0x1a0431)){if(this[_0xfbba('0x7')][_0x1a0431[_0xfbba('0x6b')]]){for(var _0x4d2697 in this[_0xfbba('0x7')][_0x1a0431[_0xfbba('0x6b')]]){if(this[_0xfbba('0x7')][_0x1a0431['transfereeuniqueid']][_0xfbba('0x33')](_0x4d2697)){if(_0x1a0431[_0xfbba('0x6c')]===_0x4d2697){var _0x36830a=moment();this[_0xfbba('0x7')][_0x1a0431['transfereeuniqueid']][_0x4d2697][_0xfbba('0x12')]=!![];this[_0xfbba('0x7')][_0x1a0431[_0xfbba('0x6b')]][_0x4d2697][_0xfbba('0x4b')]=moment()['format'](_0xfbba('0x25'));this[_0xfbba('0x7')][_0x1a0431['transfereeuniqueid']][_0x4d2697][_0xfbba('0x45')]=_0xfbba('0x4e');this[_0xfbba('0x7')][_0x1a0431[_0xfbba('0x6b')]][_0x4d2697][_0xfbba('0x46')]=_0xfbba('0x4c');this['channels'][_0x1a0431['transfereeuniqueid']][_0x4d2697][_0xfbba('0x4d')]=_0x36830a['diff'](this[_0xfbba('0x7')][_0x1a0431[_0xfbba('0x6b')]][_0x4d2697][_0xfbba('0x34')],_0xfbba('0x6d'));}}}}if(this['channels'][_0x1a0431['secondtransfereruniqueid']]){var _0x2b0041=this['channels'][_0x1a0431[_0xfbba('0x6e')]];this[_0xfbba('0x7')][_0x1a0431[_0xfbba('0x6e')]]=this[_0xfbba('0x7')][_0x1a0431[_0xfbba('0x6b')]];this['channels'][_0x1a0431[_0xfbba('0x6b')]]=_0x2b0041;}}}catch(_0x165b40){logger['error'](_0xfbba('0x6f'),util[_0xfbba('0x32')](_0x165b40,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xfbba('0x1e')][_0xfbba('0x70')]=function(_0x2f70e6){try{if(this[_0xfbba('0x20')](_0x2f70e6)){if(this[_0xfbba('0x7')][_0x2f70e6[_0xfbba('0x6b')]]){for(var _0x469329 in this[_0xfbba('0x7')][_0x2f70e6['transfereeuniqueid']]){if(this[_0xfbba('0x7')][_0x2f70e6[_0xfbba('0x6b')]][_0xfbba('0x33')](_0x469329)){if(_0x2f70e6[_0xfbba('0x71')]===_0x469329){var _0x32e81d=moment();this['channels'][_0x2f70e6['transfereeuniqueid']][_0x469329]['agentcomplete']=!![];this[_0xfbba('0x7')][_0x2f70e6[_0xfbba('0x6b')]][_0x469329][_0xfbba('0x4b')]=_0x32e81d;this[_0xfbba('0x7')][_0x2f70e6[_0xfbba('0x6b')]][_0x469329][_0xfbba('0x45')]=_0xfbba('0x4e');this[_0xfbba('0x7')][_0x2f70e6[_0xfbba('0x6b')]][_0x469329]['lastevent']=_0xfbba('0x4c');this[_0xfbba('0x7')][_0x2f70e6[_0xfbba('0x6b')]][_0x469329][_0xfbba('0x4d')]=_0x32e81d[_0xfbba('0x72')](this[_0xfbba('0x7')][_0x2f70e6[_0xfbba('0x6b')]][_0x469329][_0xfbba('0x34')],_0xfbba('0x6d'));}}}}}}catch(_0x1c5752){logger['error'](_0xfbba('0x73'),util[_0xfbba('0x32')](_0x1c5752,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xfbba('0x1e')][_0xfbba('0x18')]=function(_0xb60670){var _0x5aecf7='';try{if(this['isNotNull'](_0xb60670)){if(_0xb60670[_0xfbba('0x74')]){_0x5aecf7=_0xb60670[_0xfbba('0x74')][_0xfbba('0x75')](0x0,_0xb60670[_0xfbba('0x74')][_0xfbba('0x76')]('-'));if(this[_0xfbba('0x9')][_0x5aecf7]){this[_0xfbba('0x9')][_0x5aecf7][_0xfbba('0x77')]=!![];}}}}catch(_0x1acf31){logger['error'](_0xfbba('0x78'),util[_0xfbba('0x32')](_0x1acf31,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStop']=function(_0x557b59){var _0x975682='';try{if(this[_0xfbba('0x20')](_0x557b59)){if(_0x557b59[_0xfbba('0x74')]){_0x975682=_0x557b59[_0xfbba('0x74')]['substring'](0x0,_0x557b59[_0xfbba('0x74')]['lastIndexOf']('-'));if(this['agents'][_0x975682]){this[_0xfbba('0x9')][_0x975682][_0xfbba('0x77')]=![];}}}}catch(_0x429feb){logger['error'](_0xfbba('0x79'),util[_0xfbba('0x32')](_0x429feb,{'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 e06bc0b..560f50d 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 _0xe5a9=['[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','replace','monitorFilename','find','isNil','monitors','push','variable','xmd-phone','value','xmd-callerid','callerid','xmd-cdrtype','type','xmd-queue','xmd-originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','mixmonitor_filename','parse','[syncVarSet][VoiceCallReport]','endtime','billableseconds','omit','user:agentcomplete','[syncHangup][VoiceCallReport]','transfercalleridnum','transfereeuniqueid','transfertargetcalleridnum','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','extension','[syncBlindTransfer][VoiceCallReport]','mohstarttime','milliseconds','exports','lodash','path','ioredis','../../../config/environment','../../../config/logger','ami','../model/channel','unknown','not_inuse','inuse','unavailable','ringing','ringinuse','onhold','set','queue','agi','playback','voicemail','NO\x20ANSWER','ANSWERED','FAILED','defaults','redis','socket.io-emitter','channels','agents','syncNewExten','bind','newchannel','syncNewChannel','newstate','varset','hangup','syncHangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','catch','log','prototype','isNotNull','emit','uniqueid','linkedid','isUndefined','merge','keys','[syncNewCallerId][VoiceCallReport]','channel','OutgoingSpoolFailed','starttime','YYYY-MM-DD\x20HH:mm:ss','toNumber','channelstate','pick','context','from-sip','split','destconnectedlinenum','exten','user:%s','name','user:agentconnect','accountcode','error','inspect','application','applicationdata','toLowerCase','subtract','duration','seconds','format','disposition','includes','lastdata','startsWith','cdr(','match','[syncNewExten][VoiceCallReport]','syncNewState','answered','answertime','holdtime','diff','calleridnum','connectedlinenum','connectedlinename','calleridname','destinationchannel','membername'];(function(_0x523031,_0x355d4f){var _0x2c0acc=function(_0x547c82){while(--_0x547c82){_0x523031['push'](_0x523031['shift']());}};_0x2c0acc(++_0x355d4f);}(_0xe5a9,0x1dd));var _0x9e5a=function(_0x1b24eb,_0x39029e){_0x1b24eb=_0x1b24eb-0x0;var _0x157b17=_0xe5a9[_0x1b24eb];return _0x157b17;};'use strict';var BPromise=require('bluebird');var _=require(_0x9e5a('0x0'));var moment=require('moment');var util=require('util');var path=require(_0x9e5a('0x1'));var Redis=require(_0x9e5a('0x2'));var config=require(_0x9e5a('0x3'));var logger=require(_0x9e5a('0x4'))(_0x9e5a('0x5'));var ami=require('../ami');var Channel=require(_0x9e5a('0x6'));var statusDesc=[_0x9e5a('0x7'),_0x9e5a('0x8'),_0x9e5a('0x9'),'busy','invalid',_0x9e5a('0xa'),_0x9e5a('0xb'),_0x9e5a('0xc'),_0x9e5a('0xd')];var applications=[_0x9e5a('0xe'),_0x9e5a('0xf'),_0x9e5a('0x10'),'dial',_0x9e5a('0x11'),_0x9e5a('0x12')];var dispositions=[_0x9e5a('0x13'),'FAILED','FAILED','NO\x20ANSWER',_0x9e5a('0x13'),_0x9e5a('0x13'),_0x9e5a('0x14'),'BUSY',_0x9e5a('0x15'),_0x9e5a('0x15'),_0x9e5a('0x15')];var actions={};config['redis']=_[_0x9e5a('0x16')](config[_0x9e5a('0x17')],{'host':'localhost','port':0x18eb});var io=require(_0x9e5a('0x18'))(new Redis(config['redis']));function VoiceCallReport(_0x54ff7b){this[_0x9e5a('0x19')]=_0x54ff7b[_0x9e5a('0x19')];this['agents']=_0x54ff7b[_0x9e5a('0x1a')];ami['on']('coreshowchannel',this[_0x9e5a('0x1b')][_0x9e5a('0x1c')](this));ami['on']('newexten',this[_0x9e5a('0x1b')]['bind'](this));ami['on'](_0x9e5a('0x1d'),this[_0x9e5a('0x1e')]['bind'](this));ami['on'](_0x9e5a('0x1f'),this['syncNewState'][_0x9e5a('0x1c')](this));ami['on'](_0x9e5a('0x20'),this['syncVarSet'][_0x9e5a('0x1c')](this));ami['on'](_0x9e5a('0x21'),this[_0x9e5a('0x22')][_0x9e5a('0x1c')](this));ami['on']('newcallerid',this[_0x9e5a('0x23')]['bind'](this));ami['on'](_0x9e5a('0x24'),this[_0x9e5a('0x25')][_0x9e5a('0x1c')](this));ami['on']('blindtransfer',this[_0x9e5a('0x26')][_0x9e5a('0x1c')](this));ami['on']('musiconholdstart',this[_0x9e5a('0x27')]['bind'](this));ami['on'](_0x9e5a('0x28'),this[_0x9e5a('0x29')][_0x9e5a('0x1c')](this));return BPromise[_0x9e5a('0x2a')]()[_0x9e5a('0x2b')](ami[_0x9e5a('0x2c')]())[_0x9e5a('0x2d')](function(_0x2d6f66){console[_0x9e5a('0x2e')](_0x2d6f66);});}VoiceCallReport[_0x9e5a('0x2f')][_0x9e5a('0x30')]=function(_0x4dae69){return _0x4dae69!==null&&!_['isUndefined'](_0x4dae69);};VoiceCallReport[_0x9e5a('0x2f')][_0x9e5a('0x31')]=function(_0x55d5ff,_0x30f8f8,_0x17da42){io['to'](_0x55d5ff)['emit'](_0x30f8f8,_0x17da42);};VoiceCallReport[_0x9e5a('0x2f')][_0x9e5a('0x23')]=function(_0x462680){try{if(this[_0x9e5a('0x30')](_0x462680)){if(_0x462680[_0x9e5a('0x32')]===_0x462680[_0x9e5a('0x33')]){if(!_[_0x9e5a('0x34')](this[_0x9e5a('0x19')][_0x462680[_0x9e5a('0x32')]])){_[_0x9e5a('0x35')](this[_0x9e5a('0x19')][_0x462680['uniqueid']],_['pick'](_0x462680,_[_0x9e5a('0x36')](this[_0x9e5a('0x19')][_0x462680['uniqueid']])));}}}}catch(_0xbb5e01){logger['error'](_0x9e5a('0x37'),util['inspect'](_0xbb5e01,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e5a('0x2f')][_0x9e5a('0x1e')]=function(_0x31dc3d){try{if(this[_0x9e5a('0x30')](_0x31dc3d)){if(_0x31dc3d['uniqueid']===_0x31dc3d[_0x9e5a('0x33')]&&_0x31dc3d[_0x9e5a('0x38')]!=_0x9e5a('0x39')){if(_[_0x9e5a('0x34')](this['channels'][_0x31dc3d[_0x9e5a('0x32')]])){this['channels'][_0x31dc3d[_0x9e5a('0x32')]]=new Channel();this[_0x9e5a('0x19')][_0x31dc3d['uniqueid']][_0x9e5a('0x3a')]=moment()['format'](_0x9e5a('0x3b'));this['channels'][_0x31dc3d['uniqueid']]['disposition']=dispositions[_[_0x9e5a('0x3c')](_0x31dc3d[_0x9e5a('0x3d')])];_[_0x9e5a('0x35')](this[_0x9e5a('0x19')][_0x31dc3d['uniqueid']],_[_0x9e5a('0x3e')](_0x31dc3d,_[_0x9e5a('0x36')](this[_0x9e5a('0x19')][_0x31dc3d['uniqueid']])));if(_0x31dc3d[_0x9e5a('0x3f')]===_0x9e5a('0x40')){if(this[_0x9e5a('0x1a')][_0x31dc3d[_0x9e5a('0x38')][_0x9e5a('0x41')]('-')[0x0]]){this[_0x9e5a('0x1a')][_0x31dc3d[_0x9e5a('0x38')]['split']('-')[0x0]][_0x9e5a('0x42')]=_0x31dc3d[_0x9e5a('0x43')];this[_0x9e5a('0x31')](util['format'](_0x9e5a('0x44'),this[_0x9e5a('0x1a')][_0x31dc3d[_0x9e5a('0x38')]['split']('-')[0x0]][_0x9e5a('0x45')]),_0x9e5a('0x46'),{'destaccountcode':this['agents'][_0x31dc3d[_0x9e5a('0x38')][_0x9e5a('0x41')]('-')[0x0]][_0x9e5a('0x47')],'destconnectedlinenum':_0x31dc3d[_0x9e5a('0x43')]});}}}}}}catch(_0x578f75){logger[_0x9e5a('0x48')]('[syncNewChannel][VoiceCallReport]',util[_0x9e5a('0x49')](_0x578f75,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e5a('0x2f')]['syncNewExten']=function(_0x1e2b71){try{if(this['isNotNull'](_0x1e2b71)){if(_0x1e2b71[_0x9e5a('0x32')]===_0x1e2b71[_0x9e5a('0x33')]&&_0x1e2b71['exten']!='h'&&_0x1e2b71['channel']!=_0x9e5a('0x39')){_0x1e2b71[_0x9e5a('0x4a')]=_0x1e2b71[_0x9e5a('0x4a')]['toLowerCase']();_0x1e2b71[_0x9e5a('0x4b')]=(_0x1e2b71['appdata']||_0x1e2b71['applicationdata'])[_0x9e5a('0x4c')]();if(_[_0x9e5a('0x34')](this['channels'][_0x1e2b71[_0x9e5a('0x32')]])){this[_0x9e5a('0x19')][_0x1e2b71[_0x9e5a('0x32')]]=new Channel();this[_0x9e5a('0x19')][_0x1e2b71[_0x9e5a('0x32')]]['starttime']=_0x1e2b71['duration']?moment()[_0x9e5a('0x4d')](moment[_0x9e5a('0x4e')](_0x1e2b71[_0x9e5a('0x4e')])['seconds'](),_0x9e5a('0x4f'))['format'](_0x9e5a('0x3b')):moment()[_0x9e5a('0x50')](_0x9e5a('0x3b'));this[_0x9e5a('0x19')][_0x1e2b71[_0x9e5a('0x32')]][_0x9e5a('0x51')]=_0x9e5a('0x13');}_[_0x9e5a('0x35')](this[_0x9e5a('0x19')][_0x1e2b71['uniqueid']],_['pick'](_0x1e2b71,_[_0x9e5a('0x36')](this[_0x9e5a('0x19')][_0x1e2b71[_0x9e5a('0x32')]])));if(_[_0x9e5a('0x52')](applications,_0x1e2b71[_0x9e5a('0x4a')])){this[_0x9e5a('0x19')][_0x1e2b71[_0x9e5a('0x32')]]['lastapplication']=_0x1e2b71[_0x9e5a('0x4a')];this[_0x9e5a('0x19')][_0x1e2b71['uniqueid']][_0x9e5a('0x53')]=_0x1e2b71['applicationdata'];if(_0x1e2b71[_0x9e5a('0x4a')]===_0x9e5a('0xe')&&_[_0x9e5a('0x54')](_0x1e2b71[_0x9e5a('0x4b')],_0x9e5a('0x55'))){var _0x17d8aa=_0x1e2b71[_0x9e5a('0x4b')][_0x9e5a('0x41')]('=');var _0x47a4a3=_0x17d8aa[0x0][_0x9e5a('0x56')](/cdr\((.*)\)/);if(_0x47a4a3){this[_0x9e5a('0x19')][_0x1e2b71['uniqueid']][_0x47a4a3[0x1]]=_0x17d8aa[0x1];}}else if(_0x1e2b71[_0x9e5a('0x4a')]===_0x9e5a('0xf')){this[_0x9e5a('0x19')][_0x1e2b71[_0x9e5a('0x32')]][_0x9e5a('0xf')]=_0x1e2b71[_0x9e5a('0x4b')][_0x9e5a('0x41')](',')[0x0];}}}}}catch(_0x5c96a2){logger[_0x9e5a('0x48')](_0x9e5a('0x57'),util[_0x9e5a('0x49')](_0x5c96a2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e5a('0x2f')][_0x9e5a('0x58')]=function(_0x5416ce){try{if(this[_0x9e5a('0x30')](_0x5416ce)){if(_0x5416ce[_0x9e5a('0x32')]!==_0x5416ce[_0x9e5a('0x33')]){if(this[_0x9e5a('0x19')][_0x5416ce[_0x9e5a('0x33')]]){if(_0x5416ce[_0x9e5a('0x3d')]==='6'){if(!this[_0x9e5a('0x19')][_0x5416ce[_0x9e5a('0x33')]][_0x9e5a('0x59')]){var _0x324365=moment();this[_0x9e5a('0x19')][_0x5416ce[_0x9e5a('0x33')]][_0x9e5a('0x59')]=!![];this[_0x9e5a('0x19')][_0x5416ce[_0x9e5a('0x33')]][_0x9e5a('0x5a')]=_0x324365[_0x9e5a('0x50')](_0x9e5a('0x3b'));if(this[_0x9e5a('0x19')][_0x5416ce[_0x9e5a('0x33')]][_0x9e5a('0x3a')]){this['channels'][_0x5416ce[_0x9e5a('0x33')]][_0x9e5a('0x5b')]=_0x324365[_0x9e5a('0x5c')](this[_0x9e5a('0x19')][_0x5416ce[_0x9e5a('0x33')]][_0x9e5a('0x3a')],'seconds');}}this[_0x9e5a('0x19')][_0x5416ce[_0x9e5a('0x33')]][_0x9e5a('0x33')]=_0x5416ce['uniqueid'];if(_0x5416ce[_0x9e5a('0x5d')]!=='xcally-motion-preview'){this[_0x9e5a('0x19')][_0x5416ce[_0x9e5a('0x33')]][_0x9e5a('0x5e')]=_0x5416ce['calleridnum'];}this[_0x9e5a('0x19')][_0x5416ce[_0x9e5a('0x33')]][_0x9e5a('0x5f')]=_0x5416ce[_0x9e5a('0x60')];this[_0x9e5a('0x19')][_0x5416ce[_0x9e5a('0x33')]][_0x9e5a('0x61')]=_0x5416ce[_0x9e5a('0x38')];this[_0x9e5a('0x19')][_0x5416ce[_0x9e5a('0x33')]][_0x9e5a('0x51')]=dispositions[_['toNumber'](_0x5416ce['channelstate'])];if(this[_0x9e5a('0x1a')][_0x5416ce[_0x9e5a('0x38')]['split']('-')[0x0]]){this['channels'][_0x5416ce['linkedid']]['UserId']=this[_0x9e5a('0x1a')][_0x5416ce[_0x9e5a('0x38')][_0x9e5a('0x41')]('-')[0x0]]['id'];this['channels'][_0x5416ce[_0x9e5a('0x33')]][_0x9e5a('0x62')]=this[_0x9e5a('0x1a')][_0x5416ce[_0x9e5a('0x38')][_0x9e5a('0x41')]('-')[0x0]][_0x9e5a('0x45')];}}}}else{if(this[_0x9e5a('0x19')][_0x5416ce[_0x9e5a('0x32')]]){if(_0x5416ce[_0x9e5a('0x3d')]==='6'){if(this[_0x9e5a('0x1a')][_0x5416ce[_0x9e5a('0x38')][_0x9e5a('0x41')]('-')[0x0]]){this[_0x9e5a('0x19')][_0x5416ce['uniqueid']]['UserId']=this['agents'][_0x5416ce[_0x9e5a('0x38')]['split']('-')[0x0]]['id'];this[_0x9e5a('0x19')][_0x5416ce['uniqueid']][_0x9e5a('0x62')]=this[_0x9e5a('0x1a')][_0x5416ce['channel']['split']('-')[0x0]][_0x9e5a('0x45')];}}}}}}catch(_0xc6b976){logger[_0x9e5a('0x48')](_0x9e5a('0x63'),util[_0x9e5a('0x49')](_0xc6b976,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e5a('0x2f')][_0x9e5a('0x64')]=function(_0x1ce9f0,_0x33cc5b){if(this[_0x9e5a('0x19')][_0x1ce9f0]){this[_0x9e5a('0x19')][_0x1ce9f0][_0x9e5a('0x65')]=!![];if(_[_0x9e5a('0x66')](_0x33cc5b,'.wav49')){_0x33cc5b=_0x33cc5b[_0x9e5a('0x67')]('.wav49','.WAV');}this[_0x9e5a('0x19')][_0x1ce9f0][_0x9e5a('0x68')]=_0x33cc5b;var _0x32449e=_[_0x9e5a('0x69')](this[_0x9e5a('0x19')][_0x1ce9f0]['monitors'],{'filename':_0x33cc5b});if(_[_0x9e5a('0x6a')](_0x32449e)){this['channels'][_0x1ce9f0][_0x9e5a('0x6b')][_0x9e5a('0x6c')]({'filename':_0x33cc5b,'createdAt':moment()['format'](_0x9e5a('0x3b')),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport[_0x9e5a('0x2f')]['syncVarSet']=function(_0x5a4777){try{if(this['isNotNull'](_0x5a4777)){if(this[_0x9e5a('0x19')][_0x5a4777[_0x9e5a('0x32')]]&&_0x5a4777['channel']!=_0x9e5a('0x39')){if(this[_0x9e5a('0x30')](_0x5a4777[_0x9e5a('0x6d')])){if(this[_0x9e5a('0x30')](_0x5a4777[_0x9e5a('0x6d')]['mixmonitor_filename'])){this[_0x9e5a('0x64')](_0x5a4777['uniqueid'],_0x5a4777['value']);}else if(this[_0x9e5a('0x30')](_0x5a4777[_0x9e5a('0x6d')][_0x9e5a('0x6e')])){this[_0x9e5a('0x19')][_0x5a4777[_0x9e5a('0x32')]][_0x9e5a('0x5d')]=_0x5a4777[_0x9e5a('0x6f')];}else if(this['isNotNull'](_0x5a4777[_0x9e5a('0x6d')][_0x9e5a('0x70')])){this[_0x9e5a('0x19')][_0x5a4777['uniqueid']][_0x9e5a('0x71')]=_0x5a4777[_0x9e5a('0x6f')];}else if(this[_0x9e5a('0x30')](_0x5a4777[_0x9e5a('0x6d')][_0x9e5a('0x72')])){this['channels'][_0x5a4777[_0x9e5a('0x32')]][_0x9e5a('0x73')]=_0x5a4777[_0x9e5a('0x6f')];}else if(this['isNotNull'](_0x5a4777[_0x9e5a('0x6d')][_0x9e5a('0x74')])){this[_0x9e5a('0x19')][_0x5a4777[_0x9e5a('0x32')]][_0x9e5a('0xf')]=_0x5a4777[_0x9e5a('0x6f')]['split'](',')[0x0];}else if(this['isNotNull'](_0x5a4777[_0x9e5a('0x6d')][_0x9e5a('0x75')])){this[_0x9e5a('0x19')][_0x5a4777[_0x9e5a('0x32')]]['originatecalleridnum']=_0x5a4777['value'];}else if(this[_0x9e5a('0x30')](_0x5a4777[_0x9e5a('0x6d')][_0x9e5a('0x76')])){this[_0x9e5a('0x19')][_0x5a4777['uniqueid']][_0x9e5a('0x77')]=_0x5a4777[_0x9e5a('0x6f')];}else if(this[_0x9e5a('0x30')](_0x5a4777[_0x9e5a('0x6d')][_0x9e5a('0x78')])){this[_0x9e5a('0x19')][_0x5a4777[_0x9e5a('0x32')]][_0x9e5a('0x79')]=_0x5a4777[_0x9e5a('0x6f')];}else if(this['isNotNull'](_0x5a4777[_0x9e5a('0x6d')][_0x9e5a('0x7a')])){this[_0x9e5a('0x19')][_0x5a4777[_0x9e5a('0x32')]]['queue']=_0x5a4777[_0x9e5a('0x6f')];}else if(this[_0x9e5a('0x30')](_0x5a4777[_0x9e5a('0x6d')][_0x9e5a('0x7b')])){this[_0x9e5a('0x19')][_0x5a4777[_0x9e5a('0x32')]][_0x9e5a('0x7c')]=_0x5a4777[_0x9e5a('0x6f')];}}}else if(this[_0x9e5a('0x30')](_0x5a4777['variable'][_0x9e5a('0x7d')])){if(_0x5a4777['value']){var _0xa5f9f8=path[_0x9e5a('0x7e')](_0x5a4777['value'])[_0x9e5a('0x45')];this['syncMixMonitorFilename'](_0xa5f9f8,_0x5a4777[_0x9e5a('0x6f')]);}}else if(this['channels'][_0x5a4777[_0x9e5a('0x33')]]){if(this[_0x9e5a('0x30')](_0x5a4777[_0x9e5a('0x6d')])){if(this['isNotNull'](_0x5a4777[_0x9e5a('0x6d')][_0x9e5a('0x7b')])){this['channels'][_0x5a4777[_0x9e5a('0x33')]]['sipcalllinkedid']=_0x5a4777[_0x9e5a('0x6f')];}}}}}catch(_0x15b48d){logger[_0x9e5a('0x48')](_0x9e5a('0x7f'),util[_0x9e5a('0x49')](_0x15b48d,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncHangup']=function(_0x3ddb83){try{if(this[_0x9e5a('0x30')](_0x3ddb83)){if(this[_0x9e5a('0x19')][_0x3ddb83[_0x9e5a('0x32')]]){var _0x33067e=moment();this[_0x9e5a('0x19')][_0x3ddb83[_0x9e5a('0x32')]][_0x9e5a('0x80')]=_0x33067e[_0x9e5a('0x50')](_0x9e5a('0x3b'));this[_0x9e5a('0x19')][_0x3ddb83['uniqueid']]['duration']=_0x33067e['diff'](this[_0x9e5a('0x19')][_0x3ddb83[_0x9e5a('0x32')]]['starttime'],_0x9e5a('0x4f'));if(this[_0x9e5a('0x19')][_0x3ddb83['uniqueid']][_0x9e5a('0x59')]){this[_0x9e5a('0x19')][_0x3ddb83[_0x9e5a('0x32')]]['billableseconds']=_0x33067e[_0x9e5a('0x5c')](this[_0x9e5a('0x19')][_0x3ddb83[_0x9e5a('0x32')]][_0x9e5a('0x5a')],_0x9e5a('0x4f'));this['channels'][_0x3ddb83['uniqueid']][_0x9e5a('0x5b')]=this[_0x9e5a('0x19')][_0x3ddb83[_0x9e5a('0x32')]]['duration']-this[_0x9e5a('0x19')][_0x3ddb83[_0x9e5a('0x32')]][_0x9e5a('0x81')];}if(_0x3ddb83[_0x9e5a('0x3f')]===_0x9e5a('0x40')){if(this[_0x9e5a('0x1a')][_0x3ddb83['channel'][_0x9e5a('0x41')]('-')[0x0]]){this[_0x9e5a('0x1a')][_0x3ddb83[_0x9e5a('0x38')][_0x9e5a('0x41')]('-')[0x0]]=_[_0x9e5a('0x82')](this['agents'][_0x3ddb83[_0x9e5a('0x38')]['split']('-')[0x0]],['destconnectedlinenum']);this['emit'](util[_0x9e5a('0x50')]('user:%s',this[_0x9e5a('0x1a')][_0x3ddb83[_0x9e5a('0x38')][_0x9e5a('0x41')]('-')[0x0]][_0x9e5a('0x45')]),_0x9e5a('0x83'),{'destaccountcode':this['agents'][_0x3ddb83[_0x9e5a('0x38')][_0x9e5a('0x41')]('-')[0x0]][_0x9e5a('0x47')]});}}ami[_0x9e5a('0x31')]('custom:voiceCallReport',this[_0x9e5a('0x19')][_0x3ddb83[_0x9e5a('0x32')]]);delete this[_0x9e5a('0x19')][_0x3ddb83[_0x9e5a('0x32')]];}}}catch(_0x3df321){logger[_0x9e5a('0x48')](_0x9e5a('0x84'),util[_0x9e5a('0x49')](_0x3df321,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e5a('0x2f')][_0x9e5a('0x25')]=function(_0xa3cbe8){try{if(this['isNotNull'](_0xa3cbe8)){if(this[_0x9e5a('0x19')][_0xa3cbe8['transfereeuniqueid']]){this[_0x9e5a('0x19')][_0xa3cbe8['transfereeuniqueid']][_0x9e5a('0x85')]=_0xa3cbe8['origtransferercalleridnum'];this[_0x9e5a('0x19')][_0xa3cbe8[_0x9e5a('0x86')]]['transferconnectedlinenum']=_0xa3cbe8[_0x9e5a('0x87')];if(this[_0x9e5a('0x19')][_0xa3cbe8['secondtransfereruniqueid']]){var _0x1de622=this[_0x9e5a('0x19')][_0xa3cbe8['secondtransfereruniqueid']];this[_0x9e5a('0x19')][_0xa3cbe8['secondtransfereruniqueid']]=this[_0x9e5a('0x19')][_0xa3cbe8[_0x9e5a('0x86')]];this[_0x9e5a('0x19')][_0xa3cbe8[_0x9e5a('0x86')]]=_0x1de622;}}else if(this['channels'][_0xa3cbe8['transfertargetuniqueid']]){this[_0x9e5a('0x19')][_0xa3cbe8[_0x9e5a('0x88')]]['transfercalleridnum']=_0xa3cbe8['origtransferercalleridnum'];this[_0x9e5a('0x19')][_0xa3cbe8[_0x9e5a('0x88')]][_0x9e5a('0x89')]=_0xa3cbe8['transfertargetcalleridnum'];if(this['channels'][_0xa3cbe8['origtransfereruniqueid']]){var _0x1de622=this[_0x9e5a('0x19')][_0xa3cbe8[_0x9e5a('0x8a')]];this[_0x9e5a('0x19')][_0xa3cbe8[_0x9e5a('0x8a')]]=this[_0x9e5a('0x19')][_0xa3cbe8[_0x9e5a('0x88')]];this[_0x9e5a('0x19')][_0xa3cbe8['transfertargetuniqueid']]=_0x1de622;}}}}catch(_0x50306e){logger[_0x9e5a('0x48')]('[syncAttendedTransfer][VoiceCallReport]',util[_0x9e5a('0x49')](_0x50306e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e5a('0x2f')][_0x9e5a('0x26')]=function(_0x35e79d){try{if(this[_0x9e5a('0x30')](_0x35e79d)){if(this[_0x9e5a('0x19')][_0x35e79d[_0x9e5a('0x86')]]){this['channels'][_0x35e79d[_0x9e5a('0x86')]][_0x9e5a('0x85')]=_0x35e79d['transfereecalleridnum'];this['channels'][_0x35e79d[_0x9e5a('0x86')]][_0x9e5a('0x89')]=_0x35e79d[_0x9e5a('0x8b')];this[_0x9e5a('0x22')]({'event':'BlindTransfer','uniqueid':_0x35e79d[_0x9e5a('0x86')],'context':_0x35e79d[_0x9e5a('0x3f')],'channel':_0x35e79d['transfererchannel']});}}}catch(_0x59ca5e){logger[_0x9e5a('0x48')](_0x9e5a('0x8c'),util[_0x9e5a('0x49')](_0x59ca5e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e5a('0x2f')]['syncMusicOnHoldStart']=function(_0x3d04e2){try{if(this[_0x9e5a('0x30')](_0x3d04e2)){if(this['channels'][_0x3d04e2['uniqueid']]){if(!_[_0x9e5a('0x6a')](this['channels'][_0x3d04e2[_0x9e5a('0x32')]][_0x9e5a('0x5a')])){this[_0x9e5a('0x19')][_0x3d04e2['uniqueid']][_0x9e5a('0x8d')]=moment()[_0x9e5a('0x50')]('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0x21b77d){logger['error']('[syncMusicOnHoldStart][VoiceCallReport]',util[_0x9e5a('0x49')](_0x21b77d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e5a('0x2f')]['syncMusicOnHoldStop']=function(_0x49ce91){try{if(this[_0x9e5a('0x30')](_0x49ce91)){if(this[_0x9e5a('0x19')][_0x49ce91[_0x9e5a('0x32')]]){if(!_['isNil'](this[_0x9e5a('0x19')][_0x49ce91[_0x9e5a('0x32')]][_0x9e5a('0x8d')])){this[_0x9e5a('0x19')][_0x49ce91[_0x9e5a('0x32')]]['mohtime']+=moment()[_0x9e5a('0x8e')](0x0)[_0x9e5a('0x5c')](this['channels'][_0x49ce91[_0x9e5a('0x32')]]['mohstarttime'],_0x9e5a('0x4f'));delete this[_0x9e5a('0x19')][_0x49ce91['uniqueid']][_0x9e5a('0x8d')];}}}}catch(_0x40cbcf){logger[_0x9e5a('0x48')]('[syncMusicOnHoldStop][VoiceCallReport]',util[_0x9e5a('0x49')](_0x40cbcf,{'showHidden':![],'depth':null}));}};module[_0x9e5a('0x8f')]=VoiceCallReport; \ No newline at end of file +var _0x1c52=['split','destconnectedlinenum','exten','user:%s','name','user:agentconnect','accountcode','error','[syncNewChannel][VoiceCallReport]','inspect','application','toLowerCase','applicationdata','appdata','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','lastdata','startsWith','match','[syncNewExten][VoiceCallReport]','isNotNull','answered','answertime','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinename','destinationchannel','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','replace','.wav49','monitorFilename','find','monitors','isNil','push','rec','variable','mixmonitor_filename','xmd-phone','xmd-callerid','callerid','xmd-cdrtype','type','value','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','destination','xmcs-queue','sipcallid','sipcalluniqueid','parse','[syncVarSet][VoiceCallReport]','endtime','billableseconds','user:agentcomplete','custom:voiceCallReport','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','transfererchannel','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','unknown','not_inuse','inuse','busy','invalid','ringing','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','redis','defaults','localhost','channels','agents','coreshowchannel','syncNewExten','newexten','bind','newchannel','syncNewChannel','newstate','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','catch','prototype','isUndefined','emit','uniqueid','linkedid','pick','keys','channel','OutgoingSpoolFailed','starttime','format','disposition','toNumber','channelstate','context','from-sip'];(function(_0x67a2ed,_0x23b964){var _0x38128d=function(_0x315c1e){while(--_0x315c1e){_0x67a2ed['push'](_0x67a2ed['shift']());}};_0x38128d(++_0x23b964);}(_0x1c52,0xf5));var _0x21c5=function(_0x58857b,_0x29106c){_0x58857b=_0x58857b-0x0;var _0x2fd63d=_0x1c52[_0x58857b];return _0x2fd63d;};'use strict';var BPromise=require('bluebird');var _=require(_0x21c5('0x0'));var moment=require(_0x21c5('0x1'));var util=require(_0x21c5('0x2'));var path=require(_0x21c5('0x3'));var Redis=require(_0x21c5('0x4'));var config=require(_0x21c5('0x5'));var logger=require(_0x21c5('0x6'))(_0x21c5('0x7'));var ami=require(_0x21c5('0x8'));var Channel=require(_0x21c5('0x9'));var statusDesc=[_0x21c5('0xa'),_0x21c5('0xb'),_0x21c5('0xc'),_0x21c5('0xd'),_0x21c5('0xe'),'unavailable',_0x21c5('0xf'),'ringinuse',_0x21c5('0x10')];var applications=[_0x21c5('0x11'),_0x21c5('0x12'),_0x21c5('0x13'),_0x21c5('0x14'),_0x21c5('0x15'),_0x21c5('0x16')];var dispositions=[_0x21c5('0x17'),_0x21c5('0x18'),_0x21c5('0x18'),_0x21c5('0x17'),_0x21c5('0x17'),'NO\x20ANSWER',_0x21c5('0x19'),'BUSY',_0x21c5('0x18'),'FAILED',_0x21c5('0x18')];var actions={};config[_0x21c5('0x1a')]=_[_0x21c5('0x1b')](config[_0x21c5('0x1a')],{'host':_0x21c5('0x1c'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x21c5('0x1a')]));function VoiceCallReport(_0x3b728b){this[_0x21c5('0x1d')]=_0x3b728b['channels'];this[_0x21c5('0x1e')]=_0x3b728b[_0x21c5('0x1e')];ami['on'](_0x21c5('0x1f'),this[_0x21c5('0x20')]['bind'](this));ami['on'](_0x21c5('0x21'),this[_0x21c5('0x20')][_0x21c5('0x22')](this));ami['on'](_0x21c5('0x23'),this[_0x21c5('0x24')][_0x21c5('0x22')](this));ami['on'](_0x21c5('0x25'),this['syncNewState'][_0x21c5('0x22')](this));ami['on'](_0x21c5('0x26'),this[_0x21c5('0x27')][_0x21c5('0x22')](this));ami['on'](_0x21c5('0x28'),this[_0x21c5('0x29')][_0x21c5('0x22')](this));ami['on'](_0x21c5('0x2a'),this[_0x21c5('0x2b')][_0x21c5('0x22')](this));ami['on'](_0x21c5('0x2c'),this[_0x21c5('0x2d')][_0x21c5('0x22')](this));ami['on']('blindtransfer',this[_0x21c5('0x2e')][_0x21c5('0x22')](this));ami['on'](_0x21c5('0x2f'),this[_0x21c5('0x30')][_0x21c5('0x22')](this));ami['on'](_0x21c5('0x31'),this[_0x21c5('0x32')][_0x21c5('0x22')](this));return BPromise[_0x21c5('0x33')]()['then'](ami['actionCoreShowChannels']())[_0x21c5('0x34')](function(_0x46841f){console['log'](_0x46841f);});}VoiceCallReport[_0x21c5('0x35')]['isNotNull']=function(_0x3fc474){return _0x3fc474!==null&&!_[_0x21c5('0x36')](_0x3fc474);};VoiceCallReport['prototype'][_0x21c5('0x37')]=function(_0xa75408,_0x1c7937,_0x1c1dbb){io['to'](_0xa75408)[_0x21c5('0x37')](_0x1c7937,_0x1c1dbb);};VoiceCallReport[_0x21c5('0x35')][_0x21c5('0x2b')]=function(_0xbe4217){try{if(this['isNotNull'](_0xbe4217)){if(_0xbe4217[_0x21c5('0x38')]===_0xbe4217[_0x21c5('0x39')]){if(!_[_0x21c5('0x36')](this['channels'][_0xbe4217[_0x21c5('0x38')]])){_['merge'](this[_0x21c5('0x1d')][_0xbe4217[_0x21c5('0x38')]],_[_0x21c5('0x3a')](_0xbe4217,_[_0x21c5('0x3b')](this[_0x21c5('0x1d')][_0xbe4217[_0x21c5('0x38')]])));}}}}catch(_0x8dc1c2){logger['error']('[syncNewCallerId][VoiceCallReport]',util['inspect'](_0x8dc1c2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21c5('0x35')][_0x21c5('0x24')]=function(_0x3698ad){try{if(this['isNotNull'](_0x3698ad)){if(_0x3698ad[_0x21c5('0x38')]===_0x3698ad[_0x21c5('0x39')]&&_0x3698ad[_0x21c5('0x3c')]!=_0x21c5('0x3d')){if(_[_0x21c5('0x36')](this['channels'][_0x3698ad[_0x21c5('0x38')]])){this[_0x21c5('0x1d')][_0x3698ad[_0x21c5('0x38')]]=new Channel();this[_0x21c5('0x1d')][_0x3698ad[_0x21c5('0x38')]][_0x21c5('0x3e')]=moment()[_0x21c5('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x3698ad['uniqueid']][_0x21c5('0x40')]=dispositions[_[_0x21c5('0x41')](_0x3698ad[_0x21c5('0x42')])];_['merge'](this[_0x21c5('0x1d')][_0x3698ad[_0x21c5('0x38')]],_[_0x21c5('0x3a')](_0x3698ad,_[_0x21c5('0x3b')](this[_0x21c5('0x1d')][_0x3698ad[_0x21c5('0x38')]])));if(_0x3698ad[_0x21c5('0x43')]===_0x21c5('0x44')){if(this[_0x21c5('0x1e')][_0x3698ad[_0x21c5('0x3c')]['split']('-')[0x0]]){this[_0x21c5('0x1e')][_0x3698ad[_0x21c5('0x3c')][_0x21c5('0x45')]('-')[0x0]][_0x21c5('0x46')]=_0x3698ad[_0x21c5('0x47')];this[_0x21c5('0x37')](util[_0x21c5('0x3f')](_0x21c5('0x48'),this[_0x21c5('0x1e')][_0x3698ad['channel'][_0x21c5('0x45')]('-')[0x0]][_0x21c5('0x49')]),_0x21c5('0x4a'),{'destaccountcode':this[_0x21c5('0x1e')][_0x3698ad[_0x21c5('0x3c')][_0x21c5('0x45')]('-')[0x0]][_0x21c5('0x4b')],'destconnectedlinenum':_0x3698ad['exten']});}}}}}}catch(_0x34bd33){logger[_0x21c5('0x4c')](_0x21c5('0x4d'),util[_0x21c5('0x4e')](_0x34bd33,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21c5('0x35')]['syncNewExten']=function(_0x42ee52){try{if(this['isNotNull'](_0x42ee52)){if(_0x42ee52[_0x21c5('0x38')]===_0x42ee52[_0x21c5('0x39')]&&_0x42ee52[_0x21c5('0x47')]!='h'&&_0x42ee52['channel']!=_0x21c5('0x3d')){_0x42ee52[_0x21c5('0x4f')]=_0x42ee52[_0x21c5('0x4f')][_0x21c5('0x50')]();_0x42ee52[_0x21c5('0x51')]=(_0x42ee52[_0x21c5('0x52')]||_0x42ee52[_0x21c5('0x51')])[_0x21c5('0x50')]();if(_[_0x21c5('0x36')](this[_0x21c5('0x1d')][_0x42ee52[_0x21c5('0x38')]])){this[_0x21c5('0x1d')][_0x42ee52[_0x21c5('0x38')]]=new Channel();this['channels'][_0x42ee52[_0x21c5('0x38')]][_0x21c5('0x3e')]=_0x42ee52[_0x21c5('0x53')]?moment()[_0x21c5('0x54')](moment['duration'](_0x42ee52[_0x21c5('0x53')])[_0x21c5('0x55')](),_0x21c5('0x55'))['format'](_0x21c5('0x56')):moment()[_0x21c5('0x3f')](_0x21c5('0x56'));this[_0x21c5('0x1d')][_0x42ee52[_0x21c5('0x38')]][_0x21c5('0x40')]='NO\x20ANSWER';}_['merge'](this[_0x21c5('0x1d')][_0x42ee52['uniqueid']],_[_0x21c5('0x3a')](_0x42ee52,_[_0x21c5('0x3b')](this[_0x21c5('0x1d')][_0x42ee52[_0x21c5('0x38')]])));if(_[_0x21c5('0x57')](applications,_0x42ee52[_0x21c5('0x4f')])){this['channels'][_0x42ee52[_0x21c5('0x38')]][_0x21c5('0x58')]=_0x42ee52['application'];this[_0x21c5('0x1d')][_0x42ee52[_0x21c5('0x38')]][_0x21c5('0x59')]=_0x42ee52[_0x21c5('0x51')];if(_0x42ee52[_0x21c5('0x4f')]===_0x21c5('0x11')&&_[_0x21c5('0x5a')](_0x42ee52[_0x21c5('0x51')],'cdr(')){var _0x3741db=_0x42ee52['applicationdata'][_0x21c5('0x45')]('=');var _0x3127f7=_0x3741db[0x0][_0x21c5('0x5b')](/cdr\((.*)\)/);if(_0x3127f7){this[_0x21c5('0x1d')][_0x42ee52[_0x21c5('0x38')]][_0x3127f7[0x1]]=_0x3741db[0x1];}}else if(_0x42ee52['application']===_0x21c5('0x12')){this[_0x21c5('0x1d')][_0x42ee52[_0x21c5('0x38')]]['queue']=_0x42ee52[_0x21c5('0x51')][_0x21c5('0x45')](',')[0x0];}}}}}catch(_0x3e02b7){logger[_0x21c5('0x4c')](_0x21c5('0x5c'),util[_0x21c5('0x4e')](_0x3e02b7,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewState']=function(_0x364a83){try{if(this[_0x21c5('0x5d')](_0x364a83)){if(_0x364a83['uniqueid']!==_0x364a83[_0x21c5('0x39')]){if(this[_0x21c5('0x1d')][_0x364a83['linkedid']]){if(_0x364a83[_0x21c5('0x42')]==='6'){if(!this[_0x21c5('0x1d')][_0x364a83[_0x21c5('0x39')]]['answered']){var _0x2fc2dd=moment();this[_0x21c5('0x1d')][_0x364a83[_0x21c5('0x39')]][_0x21c5('0x5e')]=!![];this[_0x21c5('0x1d')][_0x364a83[_0x21c5('0x39')]][_0x21c5('0x5f')]=_0x2fc2dd['format']('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x21c5('0x1d')][_0x364a83[_0x21c5('0x39')]]['starttime']){this['channels'][_0x364a83[_0x21c5('0x39')]][_0x21c5('0x60')]=_0x2fc2dd[_0x21c5('0x61')](this['channels'][_0x364a83[_0x21c5('0x39')]][_0x21c5('0x3e')],_0x21c5('0x55'));}}this[_0x21c5('0x1d')][_0x364a83[_0x21c5('0x39')]][_0x21c5('0x39')]=_0x364a83[_0x21c5('0x38')];if(_0x364a83[_0x21c5('0x62')]!==_0x21c5('0x63')){this[_0x21c5('0x1d')][_0x364a83[_0x21c5('0x39')]]['connectedlinenum']=_0x364a83[_0x21c5('0x62')];}this[_0x21c5('0x1d')][_0x364a83[_0x21c5('0x39')]][_0x21c5('0x64')]=_0x364a83['calleridname'];this[_0x21c5('0x1d')][_0x364a83[_0x21c5('0x39')]][_0x21c5('0x65')]=_0x364a83[_0x21c5('0x3c')];this[_0x21c5('0x1d')][_0x364a83[_0x21c5('0x39')]][_0x21c5('0x40')]=dispositions[_[_0x21c5('0x41')](_0x364a83['channelstate'])];if(this[_0x21c5('0x1e')][_0x364a83[_0x21c5('0x3c')]['split']('-')[0x0]]){this['channels'][_0x364a83[_0x21c5('0x39')]][_0x21c5('0x66')]=this['agents'][_0x364a83[_0x21c5('0x3c')][_0x21c5('0x45')]('-')[0x0]]['id'];this[_0x21c5('0x1d')][_0x364a83[_0x21c5('0x39')]]['membername']=this[_0x21c5('0x1e')][_0x364a83[_0x21c5('0x3c')]['split']('-')[0x0]][_0x21c5('0x49')];}}}}else{if(this['channels'][_0x364a83[_0x21c5('0x38')]]){if(_0x364a83['channelstate']==='6'){if(this[_0x21c5('0x1e')][_0x364a83[_0x21c5('0x3c')][_0x21c5('0x45')]('-')[0x0]]){this[_0x21c5('0x1d')][_0x364a83[_0x21c5('0x38')]][_0x21c5('0x66')]=this[_0x21c5('0x1e')][_0x364a83[_0x21c5('0x3c')][_0x21c5('0x45')]('-')[0x0]]['id'];this[_0x21c5('0x1d')][_0x364a83[_0x21c5('0x38')]][_0x21c5('0x67')]=this[_0x21c5('0x1e')][_0x364a83['channel'][_0x21c5('0x45')]('-')[0x0]][_0x21c5('0x49')];}}}}}}catch(_0x4328cc){logger[_0x21c5('0x4c')](_0x21c5('0x68'),util['inspect'](_0x4328cc,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21c5('0x35')][_0x21c5('0x69')]=function(_0x151bb9,_0xcf1d28){if(this[_0x21c5('0x1d')][_0x151bb9]){this[_0x21c5('0x1d')][_0x151bb9][_0x21c5('0x6a')]=!![];if(_[_0x21c5('0x6b')](_0xcf1d28,'.wav49')){_0xcf1d28=_0xcf1d28[_0x21c5('0x6c')](_0x21c5('0x6d'),'.WAV');}this['channels'][_0x151bb9][_0x21c5('0x6e')]=_0xcf1d28;var _0x509a47=_[_0x21c5('0x6f')](this['channels'][_0x151bb9][_0x21c5('0x70')],{'filename':_0xcf1d28});if(_[_0x21c5('0x71')](_0x509a47)){this['channels'][_0x151bb9][_0x21c5('0x70')][_0x21c5('0x72')]({'filename':_0xcf1d28,'createdAt':moment()[_0x21c5('0x3f')](_0x21c5('0x56')),'mixmonitorid':'','status':_0x21c5('0x73')});}}};VoiceCallReport[_0x21c5('0x35')]['syncVarSet']=function(_0x2c3c17){try{if(this[_0x21c5('0x5d')](_0x2c3c17)){if(this[_0x21c5('0x1d')][_0x2c3c17[_0x21c5('0x38')]]&&_0x2c3c17['channel']!=_0x21c5('0x3d')){if(this[_0x21c5('0x5d')](_0x2c3c17['variable'])){if(this[_0x21c5('0x5d')](_0x2c3c17[_0x21c5('0x74')][_0x21c5('0x75')])){this[_0x21c5('0x69')](_0x2c3c17[_0x21c5('0x38')],_0x2c3c17['value']);}else if(this[_0x21c5('0x5d')](_0x2c3c17[_0x21c5('0x74')][_0x21c5('0x76')])){this[_0x21c5('0x1d')][_0x2c3c17[_0x21c5('0x38')]][_0x21c5('0x62')]=_0x2c3c17['value'];}else if(this[_0x21c5('0x5d')](_0x2c3c17[_0x21c5('0x74')][_0x21c5('0x77')])){this[_0x21c5('0x1d')][_0x2c3c17['uniqueid']][_0x21c5('0x78')]=_0x2c3c17['value'];}else if(this['isNotNull'](_0x2c3c17[_0x21c5('0x74')][_0x21c5('0x79')])){this[_0x21c5('0x1d')][_0x2c3c17[_0x21c5('0x38')]][_0x21c5('0x7a')]=_0x2c3c17[_0x21c5('0x7b')];}else if(this['isNotNull'](_0x2c3c17['variable'][_0x21c5('0x7c')])){this[_0x21c5('0x1d')][_0x2c3c17[_0x21c5('0x38')]][_0x21c5('0x12')]=_0x2c3c17['value'][_0x21c5('0x45')](',')[0x0];}else if(this[_0x21c5('0x5d')](_0x2c3c17['variable'][_0x21c5('0x7d')])){this['channels'][_0x2c3c17[_0x21c5('0x38')]][_0x21c5('0x7e')]=_0x2c3c17[_0x21c5('0x7b')];}else if(this[_0x21c5('0x5d')](_0x2c3c17[_0x21c5('0x74')][_0x21c5('0x7f')])){this[_0x21c5('0x1d')][_0x2c3c17[_0x21c5('0x38')]][_0x21c5('0x80')]=_0x2c3c17[_0x21c5('0x7b')];}else if(this[_0x21c5('0x5d')](_0x2c3c17['variable']['xmd-callerid-preview'])){this['channels'][_0x2c3c17[_0x21c5('0x38')]]['calleridpreview']=_0x2c3c17['value'];}else if(this[_0x21c5('0x5d')](_0x2c3c17[_0x21c5('0x74')][_0x21c5('0x81')])){this[_0x21c5('0x1d')][_0x2c3c17[_0x21c5('0x38')]]['queue']=_0x2c3c17[_0x21c5('0x7b')];}else if(this[_0x21c5('0x5d')](_0x2c3c17[_0x21c5('0x74')][_0x21c5('0x82')])){this[_0x21c5('0x1d')][_0x2c3c17[_0x21c5('0x38')]][_0x21c5('0x83')]=_0x2c3c17[_0x21c5('0x7b')];}}}else if(this['isNotNull'](_0x2c3c17[_0x21c5('0x74')][_0x21c5('0x75')])){if(_0x2c3c17['value']){var _0x47c28a=path[_0x21c5('0x84')](_0x2c3c17['value'])[_0x21c5('0x49')];this['syncMixMonitorFilename'](_0x47c28a,_0x2c3c17[_0x21c5('0x7b')]);}}else if(this[_0x21c5('0x1d')][_0x2c3c17[_0x21c5('0x39')]]){if(this[_0x21c5('0x5d')](_0x2c3c17[_0x21c5('0x74')])){if(this[_0x21c5('0x5d')](_0x2c3c17[_0x21c5('0x74')][_0x21c5('0x82')])){this[_0x21c5('0x1d')][_0x2c3c17[_0x21c5('0x39')]]['sipcalllinkedid']=_0x2c3c17['value'];}}}}}catch(_0x5166c6){logger[_0x21c5('0x4c')](_0x21c5('0x85'),util[_0x21c5('0x4e')](_0x5166c6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21c5('0x35')]['syncHangup']=function(_0x2cdbba){try{if(this[_0x21c5('0x5d')](_0x2cdbba)){if(this['channels'][_0x2cdbba[_0x21c5('0x38')]]){var _0x47671e=moment();this[_0x21c5('0x1d')][_0x2cdbba[_0x21c5('0x38')]][_0x21c5('0x86')]=_0x47671e[_0x21c5('0x3f')](_0x21c5('0x56'));this[_0x21c5('0x1d')][_0x2cdbba[_0x21c5('0x38')]][_0x21c5('0x53')]=_0x47671e[_0x21c5('0x61')](this[_0x21c5('0x1d')][_0x2cdbba[_0x21c5('0x38')]][_0x21c5('0x3e')],'seconds');if(this['channels'][_0x2cdbba[_0x21c5('0x38')]][_0x21c5('0x5e')]){this['channels'][_0x2cdbba[_0x21c5('0x38')]][_0x21c5('0x87')]=_0x47671e['diff'](this[_0x21c5('0x1d')][_0x2cdbba[_0x21c5('0x38')]]['answertime'],'seconds');this[_0x21c5('0x1d')][_0x2cdbba[_0x21c5('0x38')]]['holdtime']=this[_0x21c5('0x1d')][_0x2cdbba['uniqueid']][_0x21c5('0x53')]-this[_0x21c5('0x1d')][_0x2cdbba['uniqueid']][_0x21c5('0x87')];}if(_0x2cdbba[_0x21c5('0x43')]===_0x21c5('0x44')){if(this['agents'][_0x2cdbba['channel']['split']('-')[0x0]]){this[_0x21c5('0x1e')][_0x2cdbba[_0x21c5('0x3c')][_0x21c5('0x45')]('-')[0x0]]=_['omit'](this['agents'][_0x2cdbba[_0x21c5('0x3c')][_0x21c5('0x45')]('-')[0x0]],['destconnectedlinenum']);this[_0x21c5('0x37')](util[_0x21c5('0x3f')]('user:%s',this[_0x21c5('0x1e')][_0x2cdbba[_0x21c5('0x3c')][_0x21c5('0x45')]('-')[0x0]]['name']),_0x21c5('0x88'),{'destaccountcode':this['agents'][_0x2cdbba[_0x21c5('0x3c')][_0x21c5('0x45')]('-')[0x0]][_0x21c5('0x4b')]});}}ami['emit'](_0x21c5('0x89'),this[_0x21c5('0x1d')][_0x2cdbba[_0x21c5('0x38')]]);delete this[_0x21c5('0x1d')][_0x2cdbba['uniqueid']];}}}catch(_0x36a9a9){logger['error']('[syncHangup][VoiceCallReport]',util[_0x21c5('0x4e')](_0x36a9a9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21c5('0x35')][_0x21c5('0x2d')]=function(_0x5b7632){try{if(this[_0x21c5('0x5d')](_0x5b7632)){if(this[_0x21c5('0x1d')][_0x5b7632[_0x21c5('0x8a')]]){this[_0x21c5('0x1d')][_0x5b7632['transfereeuniqueid']][_0x21c5('0x8b')]=_0x5b7632[_0x21c5('0x8c')];this[_0x21c5('0x1d')][_0x5b7632[_0x21c5('0x8a')]][_0x21c5('0x8d')]=_0x5b7632[_0x21c5('0x8e')];if(this['channels'][_0x5b7632[_0x21c5('0x8f')]]){var _0x52b91b=this['channels'][_0x5b7632[_0x21c5('0x8f')]];this[_0x21c5('0x1d')][_0x5b7632[_0x21c5('0x8f')]]=this[_0x21c5('0x1d')][_0x5b7632[_0x21c5('0x8a')]];this[_0x21c5('0x1d')][_0x5b7632[_0x21c5('0x8a')]]=_0x52b91b;}}else if(this[_0x21c5('0x1d')][_0x5b7632[_0x21c5('0x90')]]){this[_0x21c5('0x1d')][_0x5b7632[_0x21c5('0x90')]][_0x21c5('0x8b')]=_0x5b7632[_0x21c5('0x8c')];this[_0x21c5('0x1d')][_0x5b7632[_0x21c5('0x90')]][_0x21c5('0x8d')]=_0x5b7632['transfertargetcalleridnum'];if(this[_0x21c5('0x1d')][_0x5b7632[_0x21c5('0x91')]]){var _0x52b91b=this[_0x21c5('0x1d')][_0x5b7632[_0x21c5('0x91')]];this[_0x21c5('0x1d')][_0x5b7632[_0x21c5('0x91')]]=this[_0x21c5('0x1d')][_0x5b7632[_0x21c5('0x90')]];this[_0x21c5('0x1d')][_0x5b7632[_0x21c5('0x90')]]=_0x52b91b;}}}}catch(_0x37729e){logger[_0x21c5('0x4c')](_0x21c5('0x92'),util[_0x21c5('0x4e')](_0x37729e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21c5('0x35')][_0x21c5('0x2e')]=function(_0xb3ba77){try{if(this['isNotNull'](_0xb3ba77)){if(this[_0x21c5('0x1d')][_0xb3ba77[_0x21c5('0x8a')]]){this[_0x21c5('0x1d')][_0xb3ba77['transfereeuniqueid']][_0x21c5('0x8b')]=_0xb3ba77[_0x21c5('0x93')];this[_0x21c5('0x1d')][_0xb3ba77['transfereeuniqueid']][_0x21c5('0x8d')]=_0xb3ba77[_0x21c5('0x94')];this['syncHangup']({'event':_0x21c5('0x95'),'uniqueid':_0xb3ba77[_0x21c5('0x8a')],'context':_0xb3ba77['context'],'channel':_0xb3ba77[_0x21c5('0x96')]});}}}catch(_0x39f7e1){logger[_0x21c5('0x4c')]('[syncBlindTransfer][VoiceCallReport]',util[_0x21c5('0x4e')](_0x39f7e1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21c5('0x35')][_0x21c5('0x30')]=function(_0x21b424){try{if(this[_0x21c5('0x5d')](_0x21b424)){if(this[_0x21c5('0x1d')][_0x21b424[_0x21c5('0x38')]]){if(!_['isNil'](this[_0x21c5('0x1d')][_0x21b424['uniqueid']]['answertime'])){this[_0x21c5('0x1d')][_0x21b424[_0x21c5('0x38')]][_0x21c5('0x97')]=moment()[_0x21c5('0x3f')](_0x21c5('0x56'));}}}}catch(_0x32e2f1){logger['error'](_0x21c5('0x98'),util[_0x21c5('0x4e')](_0x32e2f1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21c5('0x35')][_0x21c5('0x32')]=function(_0x2d555c){try{if(this[_0x21c5('0x5d')](_0x2d555c)){if(this[_0x21c5('0x1d')][_0x2d555c[_0x21c5('0x38')]]){if(!_[_0x21c5('0x71')](this[_0x21c5('0x1d')][_0x2d555c['uniqueid']][_0x21c5('0x97')])){this[_0x21c5('0x1d')][_0x2d555c['uniqueid']][_0x21c5('0x99')]+=moment()[_0x21c5('0x9a')](0x0)[_0x21c5('0x61')](this['channels'][_0x2d555c['uniqueid']][_0x21c5('0x97')],_0x21c5('0x55'));delete this[_0x21c5('0x1d')][_0x2d555c[_0x21c5('0x38')]][_0x21c5('0x97')];}}}}catch(_0x9dc421){logger[_0x21c5('0x4c')](_0x21c5('0x9b'),util['inspect'](_0x9dc421,{'showHidden':![],'depth':null}));}};module[_0x21c5('0x9c')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index b9c34b4..11b5573 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 _0x3a05=['includes','endtime','diff','seconds','total','answered','holdtime','billableseconds','sumBillable','sumDuration','custom:voiceDialReport','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','lodash','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','syncVarSet','syncHangup','prototype','isNotNull','emit','channels','uniqueid','merge','YYYY-MM-DD\x20HH:mm:ss','substring','channel','lastIndexOf','voice_outbound_channel:save','custom:dialbegin','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','format','lastevent','connect','custom:dialconnect','voice:outbound','error','[syncDialEnd][VoiceDialReport]','addVariable','keys','variable','value','outboundrouteid','isUndefined','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','memberdynamic','memberinterface','membername','memberpenalty','memberrealtime','isNil'];(function(_0x1bed52,_0x53ffcf){var _0x44a4a7=function(_0xa5db60){while(--_0xa5db60){_0x1bed52['push'](_0x1bed52['shift']());}};_0x44a4a7(++_0x53ffcf);}(_0x3a05,0x1f0));var _0x53a0=function(_0x13740f,_0x571e5e){_0x13740f=_0x13740f-0x0;var _0x379f5b=_0x3a05[_0x13740f];return _0x379f5b;};'use strict';var _=require(_0x53a0('0x0'));var moment=require('moment');var util=require('util');var Redis=require('ioredis');var config=require(_0x53a0('0x1'));var logger=require(_0x53a0('0x2'))(_0x53a0('0x3'));var ami=require(_0x53a0('0x4'));config[_0x53a0('0x5')]=_[_0x53a0('0x6')](config[_0x53a0('0x5')],{'host':_0x53a0('0x7'),'port':0x18eb});var io=require(_0x53a0('0x8'))(new Redis(config[_0x53a0('0x5')]));function VoiceDialReport(_0x9329d9){this['channels']=_0x9329d9[_0x53a0('0x9')];this[_0x53a0('0xa')]=_0x9329d9[_0x53a0('0xa')];this[_0x53a0('0xb')]={};ami['on'](_0x53a0('0xc'),this[_0x53a0('0xd')][_0x53a0('0xe')](this));ami['on'](_0x53a0('0xf'),this[_0x53a0('0x10')][_0x53a0('0xe')](this));ami['on']('varset',this[_0x53a0('0x11')][_0x53a0('0xe')](this));ami['on']('hangup',this[_0x53a0('0x12')][_0x53a0('0xe')](this));}VoiceDialReport[_0x53a0('0x13')][_0x53a0('0x14')]=function(_0x12f7e3){return _0x12f7e3!==null&&!_['isUndefined'](_0x12f7e3);};VoiceDialReport[_0x53a0('0x13')][_0x53a0('0x15')]=function(_0x11f3eb,_0x5e50f2,_0x4db8da){io['to'](_0x11f3eb)['emit'](_0x5e50f2,_0x4db8da);};VoiceDialReport[_0x53a0('0x13')]['syncDialBegin']=function(_0x57963c){try{if(this[_0x53a0('0x14')](_0x57963c)){if(this[_0x53a0('0x16')][_0x57963c[_0x53a0('0x17')]]){_[_0x53a0('0x18')](this[_0x53a0('0x16')][_0x57963c[_0x53a0('0x17')]],{'starttime':moment()['format'](_0x53a0('0x19')),'lastevent':'called','interface':_0x57963c['channel'][_0x53a0('0x1a')](0x0,_0x57963c[_0x53a0('0x1b')][_0x53a0('0x1c')]('-')),'membername':_0x57963c[_0x53a0('0x1b')]['substring'](_0x57963c[_0x53a0('0x1b')][_0x53a0('0x1c')]('/')+0x1,_0x57963c['channel'][_0x53a0('0x1c')]('-'))},_['omit'](_0x57963c,['event','privilege']));this[_0x53a0('0x15')]('voice:outbound',_0x53a0('0x1d'),this['channels'][_0x57963c['uniqueid']]);ami['emit'](_0x53a0('0x1e'),this[_0x53a0('0x16')][_0x57963c[_0x53a0('0x17')]]);}}}catch(_0x148b20){logger['error'](_0x53a0('0x1f'),util[_0x53a0('0x20')](_0x148b20,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x53a0('0x13')]['syncDialEnd']=function(_0x435bf7){try{if(this['isNotNull'](_0x435bf7)){if(this[_0x53a0('0x16')][_0x435bf7['uniqueid']]){this['channels'][_0x435bf7['uniqueid']][_0x53a0('0x21')]=_0x435bf7[_0x53a0('0x21')];if(_0x435bf7[_0x53a0('0x21')]===_0x53a0('0x22')){this[_0x53a0('0x16')][_0x435bf7[_0x53a0('0x17')]][_0x53a0('0x23')]=_0x435bf7[_0x53a0('0x23')];this[_0x53a0('0x16')][_0x435bf7[_0x53a0('0x17')]][_0x53a0('0x24')]=_0x435bf7['connectedlinename'];this[_0x53a0('0x16')][_0x435bf7[_0x53a0('0x17')]][_0x53a0('0x25')]=moment()[_0x53a0('0x26')](_0x53a0('0x19'));this[_0x53a0('0x16')][_0x435bf7[_0x53a0('0x17')]][_0x53a0('0x27')]=_0x53a0('0x28');ami[_0x53a0('0x15')](_0x53a0('0x29'),this[_0x53a0('0x16')][_0x435bf7[_0x53a0('0x17')]]);}this['emit'](_0x53a0('0x2a'),_0x53a0('0x1d'),this[_0x53a0('0x16')][_0x435bf7[_0x53a0('0x17')]]);}}}catch(_0x18b708){logger[_0x53a0('0x2b')](_0x53a0('0x2c'),util[_0x53a0('0x20')](_0x18b708,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x53a0('0x13')]['syncVarSet']=function(_0x11c027){try{if(this['isNotNull'](_0x11c027)){this[_0x53a0('0x2d')](_0x11c027[_0x53a0('0x17')],_[_0x53a0('0x2e')](_0x11c027[_0x53a0('0x2f')])[0x0],_0x11c027[_0x53a0('0x30')]);if(this[_0x53a0('0x14')](_0x11c027[_0x53a0('0x2f')])&&this[_0x53a0('0x14')](_0x11c027['variable'][_0x53a0('0x31')])){if(_[_0x53a0('0x32')](this['channels'][_0x11c027[_0x53a0('0x17')]])){this['channels'][_0x11c027[_0x53a0('0x17')]]={'routeId':_0x11c027[_0x53a0('0x30')],'variables':this[_0x53a0('0xb')][_0x11c027[_0x53a0('0x17')]]};this[_0x53a0('0x15')](_0x53a0('0x2a'),_0x53a0('0x1d'),this[_0x53a0('0x16')][_0x11c027['uniqueid']]);}}}}catch(_0x1e69cd){logger[_0x53a0('0x2b')]('[syncVarSet][VoiceDialReport]',util[_0x53a0('0x20')](_0x1e69cd,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x53a0('0x2d')]=function(_0x188ec7,_0x29e453,_0x54a9cc){var _0x209aa7=[_0x53a0('0x33'),'rtpaudioqosbridged',_0x53a0('0x34'),_0x53a0('0x35'),'rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt',_0x53a0('0x36'),_0x53a0('0x37'),_0x53a0('0x38'),'bridgepeer',_0x53a0('0x39'),'membercalls',_0x53a0('0x3a'),_0x53a0('0x3b'),'memberlastcall',_0x53a0('0x3c'),_0x53a0('0x3d'),_0x53a0('0x3e')];if(!_[_0x53a0('0x3f')](_0x29e453)&&!_[_0x53a0('0x40')](_0x209aa7,_0x29e453)){if(_[_0x53a0('0x32')](this[_0x53a0('0xb')][_0x188ec7])){this['variables'][_0x188ec7]={};}this[_0x53a0('0xb')][_0x188ec7][_0x29e453]=_0x54a9cc;}};VoiceDialReport[_0x53a0('0x13')][_0x53a0('0x12')]=function(_0x228025){try{if(this[_0x53a0('0x14')](_0x228025)){if(this[_0x53a0('0x16')][_0x228025['uniqueid']]){this[_0x53a0('0x16')][_0x228025[_0x53a0('0x17')]][_0x53a0('0x41')]=moment()[_0x53a0('0x26')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x228025['uniqueid']]['duration']=moment(this[_0x53a0('0x16')][_0x228025[_0x53a0('0x17')]][_0x53a0('0x41')])[_0x53a0('0x42')](this[_0x53a0('0x16')][_0x228025['uniqueid']]['starttime'],_0x53a0('0x43'));this[_0x53a0('0x16')][_0x228025['uniqueid']][_0x53a0('0x27')]='complete';this['outbound'][_0x53a0('0x44')]+=0x1;if(this[_0x53a0('0x16')][_0x228025[_0x53a0('0x17')]][_0x53a0('0x25')]){this['outbound'][_0x53a0('0x45')]+=0x1;this['channels'][_0x228025[_0x53a0('0x17')]][_0x53a0('0x46')]=moment(this[_0x53a0('0x16')][_0x228025[_0x53a0('0x17')]][_0x53a0('0x25')])[_0x53a0('0x42')](this['channels'][_0x228025[_0x53a0('0x17')]]['starttime'],_0x53a0('0x43'));this['channels'][_0x228025[_0x53a0('0x17')]][_0x53a0('0x47')]=moment(this[_0x53a0('0x16')][_0x228025[_0x53a0('0x17')]][_0x53a0('0x41')])['diff'](this['channels'][_0x228025[_0x53a0('0x17')]][_0x53a0('0x25')],_0x53a0('0x43'));this['outbound']['sumHoldTime']+=this[_0x53a0('0x16')][_0x228025[_0x53a0('0x17')]][_0x53a0('0x46')]||0x0;this[_0x53a0('0xa')][_0x53a0('0x48')]+=this['channels'][_0x228025[_0x53a0('0x17')]][_0x53a0('0x47')];}this[_0x53a0('0xa')][_0x53a0('0x49')]+=this[_0x53a0('0x16')][_0x228025[_0x53a0('0x17')]]['duration'];ami[_0x53a0('0x15')](_0x53a0('0x4a'),this[_0x53a0('0x16')][_0x228025['uniqueid']]);ami[_0x53a0('0x15')](_0x53a0('0x4b'),this[_0x53a0('0x16')][_0x228025[_0x53a0('0x17')]]);this[_0x53a0('0x15')](_0x53a0('0x2a'),_0x53a0('0x4c'),this[_0x53a0('0xa')]);this[_0x53a0('0x15')](_0x53a0('0x2a'),_0x53a0('0x4d'),this['channels'][_0x228025[_0x53a0('0x17')]]);delete this[_0x53a0('0x16')][_0x228025['uniqueid']];}if(this[_0x53a0('0xb')][_0x228025[_0x53a0('0x17')]]){delete this[_0x53a0('0xb')][_0x228025[_0x53a0('0x17')]];}}}catch(_0x204964){logger[_0x53a0('0x2b')](_0x53a0('0x4e'),util['inspect'](_0x204964,{'showHidden':![],'depth':null}));}};module[_0x53a0('0x4f')]=VoiceDialReport; \ No newline at end of file +var _0xb7fe=['syncHangup','duration','endtime','diff','complete','total','holdtime','seconds','sumHoldTime','sumBillable','billableseconds','custom:voiceDialReport','custom:dialend','voice_outbound:save','[syncHangup][VoiceDialReport]','lodash','moment','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','dialbegin','syncDialBegin','dialend','bind','varset','hangup','isNotNull','prototype','emit','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','privilege','voice_outbound_channel:save','custom:dialbegin','uniqueid','error','[syncDialBegin][VoiceDialReport]','inspect','syncDialEnd','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','custom:dialconnect','voice:outbound','[syncDialEnd][VoiceDialReport]','keys','variable','outboundrouteid','isUndefined','value','variables','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime'];(function(_0x34232c,_0x18e61d){var _0x4d4f4e=function(_0x1aeb3d){while(--_0x1aeb3d){_0x34232c['push'](_0x34232c['shift']());}};_0x4d4f4e(++_0x18e61d);}(_0xb7fe,0x114));var _0xeb7f=function(_0x2f8d91,_0x208e5f){_0x2f8d91=_0x2f8d91-0x0;var _0x271286=_0xb7fe[_0x2f8d91];return _0x271286;};'use strict';var _=require(_0xeb7f('0x0'));var moment=require(_0xeb7f('0x1'));var util=require('util');var Redis=require(_0xeb7f('0x2'));var config=require(_0xeb7f('0x3'));var logger=require(_0xeb7f('0x4'))('ami');var ami=require(_0xeb7f('0x5'));config[_0xeb7f('0x6')]=_[_0xeb7f('0x7')](config[_0xeb7f('0x6')],{'host':_0xeb7f('0x8'),'port':0x18eb});var io=require(_0xeb7f('0x9'))(new Redis(config[_0xeb7f('0x6')]));function VoiceDialReport(_0x1508ba){this[_0xeb7f('0xa')]=_0x1508ba[_0xeb7f('0xb')];this[_0xeb7f('0xc')]=_0x1508ba[_0xeb7f('0xc')];this['variables']={};ami['on'](_0xeb7f('0xd'),this[_0xeb7f('0xe')]['bind'](this));ami['on'](_0xeb7f('0xf'),this['syncDialEnd'][_0xeb7f('0x10')](this));ami['on'](_0xeb7f('0x11'),this['syncVarSet'][_0xeb7f('0x10')](this));ami['on'](_0xeb7f('0x12'),this['syncHangup']['bind'](this));}VoiceDialReport['prototype'][_0xeb7f('0x13')]=function(_0x543b69){return _0x543b69!==null&&!_['isUndefined'](_0x543b69);};VoiceDialReport[_0xeb7f('0x14')][_0xeb7f('0x15')]=function(_0x549dfd,_0x134c97,_0x599ffb){io['to'](_0x549dfd)['emit'](_0x134c97,_0x599ffb);};VoiceDialReport[_0xeb7f('0x14')]['syncDialBegin']=function(_0x444d22){try{if(this[_0xeb7f('0x13')](_0x444d22)){if(this[_0xeb7f('0xa')][_0x444d22['uniqueid']]){_[_0xeb7f('0x16')](this['channels'][_0x444d22['uniqueid']],{'starttime':moment()[_0xeb7f('0x17')](_0xeb7f('0x18')),'lastevent':_0xeb7f('0x19'),'interface':_0x444d22[_0xeb7f('0x1a')][_0xeb7f('0x1b')](0x0,_0x444d22[_0xeb7f('0x1a')]['lastIndexOf']('-')),'membername':_0x444d22[_0xeb7f('0x1a')][_0xeb7f('0x1b')](_0x444d22[_0xeb7f('0x1a')][_0xeb7f('0x1c')]('/')+0x1,_0x444d22['channel'][_0xeb7f('0x1c')]('-'))},_[_0xeb7f('0x1d')](_0x444d22,[_0xeb7f('0x1e'),_0xeb7f('0x1f')]));this['emit']('voice:outbound',_0xeb7f('0x20'),this[_0xeb7f('0xa')][_0x444d22['uniqueid']]);ami['emit'](_0xeb7f('0x21'),this[_0xeb7f('0xa')][_0x444d22[_0xeb7f('0x22')]]);}}}catch(_0xdaf51f){logger[_0xeb7f('0x23')](_0xeb7f('0x24'),util[_0xeb7f('0x25')](_0xdaf51f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xeb7f('0x14')][_0xeb7f('0x26')]=function(_0x6d0920){try{if(this[_0xeb7f('0x13')](_0x6d0920)){if(this[_0xeb7f('0xa')][_0x6d0920[_0xeb7f('0x22')]]){this[_0xeb7f('0xa')][_0x6d0920[_0xeb7f('0x22')]][_0xeb7f('0x27')]=_0x6d0920['dialstatus'];if(_0x6d0920[_0xeb7f('0x27')]===_0xeb7f('0x28')){this[_0xeb7f('0xa')][_0x6d0920['uniqueid']]['connectedlinenum']=_0x6d0920[_0xeb7f('0x29')];this[_0xeb7f('0xa')][_0x6d0920['uniqueid']][_0xeb7f('0x2a')]=_0x6d0920[_0xeb7f('0x2a')];this[_0xeb7f('0xa')][_0x6d0920[_0xeb7f('0x22')]][_0xeb7f('0x2b')]=moment()[_0xeb7f('0x17')](_0xeb7f('0x18'));this['channels'][_0x6d0920['uniqueid']][_0xeb7f('0x2c')]=_0xeb7f('0x2d');ami[_0xeb7f('0x15')](_0xeb7f('0x2e'),this[_0xeb7f('0xa')][_0x6d0920[_0xeb7f('0x22')]]);}this['emit'](_0xeb7f('0x2f'),_0xeb7f('0x20'),this[_0xeb7f('0xa')][_0x6d0920['uniqueid']]);}}}catch(_0x2f74e6){logger[_0xeb7f('0x23')](_0xeb7f('0x30'),util[_0xeb7f('0x25')](_0x2f74e6,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xeb7f('0x14')]['syncVarSet']=function(_0x36d09b){try{if(this[_0xeb7f('0x13')](_0x36d09b)){this['addVariable'](_0x36d09b['uniqueid'],_[_0xeb7f('0x31')](_0x36d09b[_0xeb7f('0x32')])[0x0],_0x36d09b['value']);if(this[_0xeb7f('0x13')](_0x36d09b[_0xeb7f('0x32')])&&this[_0xeb7f('0x13')](_0x36d09b[_0xeb7f('0x32')][_0xeb7f('0x33')])){if(_[_0xeb7f('0x34')](this[_0xeb7f('0xa')][_0x36d09b[_0xeb7f('0x22')]])){this[_0xeb7f('0xa')][_0x36d09b['uniqueid']]={'routeId':_0x36d09b[_0xeb7f('0x35')],'variables':this[_0xeb7f('0x36')][_0x36d09b['uniqueid']]};this[_0xeb7f('0x15')](_0xeb7f('0x2f'),_0xeb7f('0x20'),this[_0xeb7f('0xa')][_0x36d09b[_0xeb7f('0x22')]]);}}}}catch(_0x5215af){logger['error'](_0xeb7f('0x37'),util[_0xeb7f('0x25')](_0x5215af,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['addVariable']=function(_0x137374,_0x158dc6,_0x183f02){var _0xe614c9=[_0xeb7f('0x38'),_0xeb7f('0x39'),_0xeb7f('0x3a'),'rtpaudioqosjitterbridged',_0xeb7f('0x3b'),_0xeb7f('0x3c'),_0xeb7f('0x3d'),_0xeb7f('0x3e'),'sipcallid',_0xeb7f('0x3f'),_0xeb7f('0x40'),_0xeb7f('0x41'),_0xeb7f('0x42'),'memberdynamic',_0xeb7f('0x43'),_0xeb7f('0x44'),_0xeb7f('0x45'),_0xeb7f('0x46'),_0xeb7f('0x47')];if(!_['isNil'](_0x158dc6)&&!_['includes'](_0xe614c9,_0x158dc6)){if(_['isUndefined'](this[_0xeb7f('0x36')][_0x137374])){this[_0xeb7f('0x36')][_0x137374]={};}this[_0xeb7f('0x36')][_0x137374][_0x158dc6]=_0x183f02;}};VoiceDialReport['prototype'][_0xeb7f('0x48')]=function(_0x4f4c4b){try{if(this[_0xeb7f('0x13')](_0x4f4c4b)){if(this[_0xeb7f('0xa')][_0x4f4c4b[_0xeb7f('0x22')]]){this[_0xeb7f('0xa')][_0x4f4c4b['uniqueid']]['endtime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xeb7f('0xa')][_0x4f4c4b[_0xeb7f('0x22')]][_0xeb7f('0x49')]=moment(this[_0xeb7f('0xa')][_0x4f4c4b[_0xeb7f('0x22')]][_0xeb7f('0x4a')])[_0xeb7f('0x4b')](this['channels'][_0x4f4c4b[_0xeb7f('0x22')]]['starttime'],'seconds');this['channels'][_0x4f4c4b['uniqueid']][_0xeb7f('0x2c')]=_0xeb7f('0x4c');this[_0xeb7f('0xc')][_0xeb7f('0x4d')]+=0x1;if(this['channels'][_0x4f4c4b[_0xeb7f('0x22')]][_0xeb7f('0x2b')]){this[_0xeb7f('0xc')]['answered']+=0x1;this[_0xeb7f('0xa')][_0x4f4c4b[_0xeb7f('0x22')]][_0xeb7f('0x4e')]=moment(this[_0xeb7f('0xa')][_0x4f4c4b[_0xeb7f('0x22')]]['answertime'])[_0xeb7f('0x4b')](this[_0xeb7f('0xa')][_0x4f4c4b[_0xeb7f('0x22')]]['starttime'],'seconds');this[_0xeb7f('0xa')][_0x4f4c4b['uniqueid']]['billableseconds']=moment(this['channels'][_0x4f4c4b[_0xeb7f('0x22')]][_0xeb7f('0x4a')])['diff'](this['channels'][_0x4f4c4b[_0xeb7f('0x22')]][_0xeb7f('0x2b')],_0xeb7f('0x4f'));this[_0xeb7f('0xc')][_0xeb7f('0x50')]+=this[_0xeb7f('0xa')][_0x4f4c4b[_0xeb7f('0x22')]]['holdtime']||0x0;this[_0xeb7f('0xc')][_0xeb7f('0x51')]+=this[_0xeb7f('0xa')][_0x4f4c4b[_0xeb7f('0x22')]][_0xeb7f('0x52')];}this[_0xeb7f('0xc')]['sumDuration']+=this[_0xeb7f('0xa')][_0x4f4c4b['uniqueid']][_0xeb7f('0x49')];ami[_0xeb7f('0x15')](_0xeb7f('0x53'),this['channels'][_0x4f4c4b[_0xeb7f('0x22')]]);ami['emit'](_0xeb7f('0x54'),this[_0xeb7f('0xa')][_0x4f4c4b[_0xeb7f('0x22')]]);this[_0xeb7f('0x15')](_0xeb7f('0x2f'),_0xeb7f('0x55'),this[_0xeb7f('0xc')]);this[_0xeb7f('0x15')](_0xeb7f('0x2f'),'voice_outbound_channel:remove',this[_0xeb7f('0xa')][_0x4f4c4b[_0xeb7f('0x22')]]);delete this[_0xeb7f('0xa')][_0x4f4c4b[_0xeb7f('0x22')]];}if(this[_0xeb7f('0x36')][_0x4f4c4b[_0xeb7f('0x22')]]){delete this[_0xeb7f('0x36')][_0x4f4c4b[_0xeb7f('0x22')]];}}}catch(_0x57ace4){logger[_0xeb7f('0x23')](_0xeb7f('0x56'),util['inspect'](_0x57ace4,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 694da87..019cca0 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 _0x6c2e=['voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','abandoned','Trunk','active','Interval','stringify','isNotNull','queues','[queues]','then','queue','countBy','callers','loggedin','toNumber','[syncQueueSummary][VoiceQueueReport]','syncQueueSummaryComplete','syncNewExten','uniqueid','queuecallerjoinAt','position','count','keys','push','[syncQueueCallerJoin][VoiceQueueReport]','queuecallercomplete','queuecallercompleteAt','holdtime','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitreason','ABANDONED','lastAssignedTo','last','queuecallerleaveAt','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','[syncAgentConnect][VoiceQueueReport]','assigned','membername','queuecallerexitAt','transfer','reason','COMPLETED','startsWith','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','transferuniqueid','[syncAgentComplete][VoiceQueueReport]','addVariable','variable','value','CONTINUE','queuecallerexit','queueposition','EXITWITHKEY','[syncVarSet][VoiceQueueReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','bridgepeer','memberdynamic','memberinterface','memberlastcall','memberpenalty','unmanaged','length','milliseconds','diff','total','custom:queuecallerunmanaged','lastevent','custom:voiceQueueReport','[syncHangup][VoiceQueueReport]','secondtransfererexten','ATTENDEDTRANSFER','ATTENDED','secondtransfereruniqueid','transfereeuniqueid','transfertargetuniqueid','origtransfereruniqueid','BLINDTRANSFER','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','syncMusicOnHoldStart','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','mohtime','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','localhost','socket.io-emitter','enqueue','tail','finally','sequence','queueChannels','voiceQueues','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','bind','queuesummarycomplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','syncHangup','syncFullyBooted','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isUndefined','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','unlockRR','prototype','clearZombieChannels','channels','switch','isNil','Action','status','channel','catch','message','No\x20such\x20channel','queueReports','error','variables','[FullyBooted]\x20clear\x20realtime','clearQueueReport','agents','inspect','emit','emitVoiceQueueChannelSave','voice:queue:%s','name','voice_queue_channel:save','emitVoiceQueueChannelRemove','format'];(function(_0x306512,_0x24dc64){var _0x1ec789=function(_0x51be21){while(--_0x51be21){_0x306512['push'](_0x306512['shift']());}};_0x1ec789(++_0x24dc64);}(_0x6c2e,0x1ea));var _0xe6c2=function(_0x2257c9,_0x40d27f){_0x2257c9=_0x2257c9-0x0;var _0x1312f3=_0x6c2e[_0x2257c9];return _0x1312f3;};'use strict';var _=require(_0xe6c2('0x0'));var moment=require(_0xe6c2('0x1'));var BPromise=require(_0xe6c2('0x2'));var util=require('util');var md5=require(_0xe6c2('0x3'));var Redis=require(_0xe6c2('0x4'));var config=require(_0xe6c2('0x5'));var logger=require(_0xe6c2('0x6'))(_0xe6c2('0x7'));var ami=require(_0xe6c2('0x8'));var QueueReport=require(_0xe6c2('0x9'));config[_0xe6c2('0xa')]=_['defaults'](config[_0xe6c2('0xa')],{'host':_0xe6c2('0xb'),'port':0x18eb});var io=require(_0xe6c2('0xc'))(new Redis(config[_0xe6c2('0xa')]));var Sequence=function(){};Sequence['prototype'][_0xe6c2('0xd')]=function(_0x49db26){this['tail']=this['tail']?this[_0xe6c2('0xe')][_0xe6c2('0xf')](_0x49db26):_0x49db26();};function VoiceQueueReport(_0x151bd9){this[_0xe6c2('0x10')]=new Sequence();this['queueReports']={};this['agents']=_0x151bd9['agents'];this['channels']=_0x151bd9[_0xe6c2('0x11')];this[_0xe6c2('0x12')]=_0x151bd9[_0xe6c2('0x12')];this[_0xe6c2('0x13')]=!![];this['campaigns']=_0x151bd9[_0xe6c2('0x14')];this['variables']={};ami['on'](_0xe6c2('0x15'),this[_0xe6c2('0x16')][_0xe6c2('0x17')](this));ami['on'](_0xe6c2('0x18'),this['syncQueueSummaryComplete'][_0xe6c2('0x17')](this));ami['on'](_0xe6c2('0x19'),this[_0xe6c2('0x1a')][_0xe6c2('0x17')](this));ami['on'](_0xe6c2('0x1b'),this[_0xe6c2('0x1c')][_0xe6c2('0x17')](this));ami['on'](_0xe6c2('0x1d'),this[_0xe6c2('0x1e')][_0xe6c2('0x17')](this));ami['on'](_0xe6c2('0x1f'),this[_0xe6c2('0x20')][_0xe6c2('0x17')](this));ami['on'](_0xe6c2('0x21'),this[_0xe6c2('0x22')][_0xe6c2('0x17')](this));ami['on'](_0xe6c2('0x23'),this[_0xe6c2('0x24')]['bind'](this));ami['on']('hangup',this[_0xe6c2('0x25')][_0xe6c2('0x17')](this));ami['on']('fullybooted',this[_0xe6c2('0x26')][_0xe6c2('0x17')](this));ami['on'](_0xe6c2('0x27'),this['syncMusicOnHoldStart'][_0xe6c2('0x17')](this));ami['on'](_0xe6c2('0x28'),this[_0xe6c2('0x29')][_0xe6c2('0x17')](this));ami['on'](_0xe6c2('0x2a'),this[_0xe6c2('0x2b')][_0xe6c2('0x17')](this));ami['on']('blindtransfer',this[_0xe6c2('0x2c')][_0xe6c2('0x17')](this));this[_0xe6c2('0x2d')]();this[_0xe6c2('0x2e')]();}function isNotNull(_0x2e848f){return _0x2e848f!==null&&!_[_0xe6c2('0x2f')](_0x2e848f);}function clearChannels(_0x2e70ed){if(!_[_0xe6c2('0x30')](_0x2e70ed)){for(var _0x4af763 in _0x2e70ed){if(_0x2e70ed['hasOwnProperty'](_0x4af763)){delete _0x2e70ed[_0x4af763];}}}}function clearCampaigns(_0x1f070d){if(!_[_0xe6c2('0x30')](_0x1f070d)){for(var _0xced7af in _0x1f070d){if(_0x1f070d[_0xe6c2('0x31')](_0xced7af)){_0x1f070d[_0xced7af]['originated']=0x0;}}}}function clearVoiceQueues(_0x2cf025){if(!_[_0xe6c2('0x30')](_0x2cf025)){for(var _0x49abe3 in _0x2cf025){if(_0x2cf025[_0xe6c2('0x31')](_0x49abe3)){_0x2cf025[_0x49abe3][_0xe6c2('0x32')]=0x0;_0x2cf025[_0x49abe3][_0xe6c2('0x33')]=0x0;_0x2cf025[_0x49abe3][_0xe6c2('0x34')]=0x0;_0x2cf025[_0x49abe3][_0xe6c2('0x35')]=0x0;_0x2cf025[_0x49abe3]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x40a1a2){if(!_['isEmpty'](_0x40a1a2)){for(var _0x4ea142 in _0x40a1a2){if(_0x40a1a2[_0xe6c2('0x31')](_0x4ea142)){_0x40a1a2[_0x4ea142][_0xe6c2('0x36')]=!![];}}}}VoiceQueueReport[_0xe6c2('0x37')][_0xe6c2('0x38')]=function(){var _0x3a9a89=this;for(var _0x1a8741 in this['channels']){if(this[_0xe6c2('0x39')][_0xe6c2('0x31')](_0x1a8741)&&!this[_0xe6c2('0x39')][_0x1a8741][_0xe6c2('0x3a')]){this[_0xe6c2('0x10')][_0xe6c2('0xd')](function(){if(!_[_0xe6c2('0x3b')](_0x3a9a89[_0xe6c2('0x39')][_0x1a8741])){return ami[_0xe6c2('0x3c')]({'action':_0xe6c2('0x3d'),'channel':_0x3a9a89[_0xe6c2('0x39')][_0x1a8741][_0xe6c2('0x3e')]})[_0xe6c2('0x3f')](function(_0x2a1d0f){if(_0x2a1d0f[_0xe6c2('0x40')]===_0xe6c2('0x41')){setTimeout(function(){if(_0x3a9a89[_0xe6c2('0x39')][_0x1a8741]){delete _0x3a9a89[_0xe6c2('0x39')][_0x1a8741];logger['error']('[voiceQueueReport][checkChannel]',_0x1a8741);}if(_0x3a9a89[_0xe6c2('0x42')][_0x1a8741]){delete _0x3a9a89[_0xe6c2('0x42')][_0x1a8741];logger[_0xe6c2('0x43')]('[voiceQueueReport][checkQueueReport]',_0x1a8741);}if(_0x3a9a89[_0xe6c2('0x44')][_0x1a8741]){delete _0x3a9a89['variables'][_0x1a8741];logger[_0xe6c2('0x43')]('[voiceQueueReport][checkVariables]',_0x1a8741);}},0x1f40);}});}});}}};VoiceQueueReport['prototype']['syncFullyBooted']=function(){logger['error'](_0xe6c2('0x45'));clearChannels(this[_0xe6c2('0x39')]);this[_0xe6c2('0x46')](this[_0xe6c2('0x42')]);clearAgentBooked(this[_0xe6c2('0x47')]);clearVoiceQueues(this[_0xe6c2('0x12')]);clearCampaigns(this[_0xe6c2('0x14')]);};VoiceQueueReport['prototype']['clearQueueReport']=function(_0xab7cde){var _0x4fceed=this;if(!_[_0xe6c2('0x30')](_0xab7cde)){for(var _0x1a4d4a in _0xab7cde){if(_0xab7cde[_0xe6c2('0x31')](_0x1a4d4a)){_0x4fceed['emitVoiceQueueChannelRemove'](_0xab7cde[_0x1a4d4a]);delete _0xab7cde[_0x1a4d4a];}}}};function loggerCatch(_0x29b95a){return function(_0x149369){logger[_0xe6c2('0x43')](_0x29b95a,util[_0xe6c2('0x48')](_0x149369,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0xe6c2('0x37')][_0xe6c2('0x49')]=function(_0x56b0b2,_0x26c8c5,_0x4eea53){io['to'](_0x56b0b2)[_0xe6c2('0x49')](_0x26c8c5,_0x4eea53);};VoiceQueueReport[_0xe6c2('0x37')][_0xe6c2('0x4a')]=function(_0x2bc3d8){this[_0xe6c2('0x49')](util['format'](_0xe6c2('0x4b'),_0x2bc3d8[_0xe6c2('0x4c')]),_0xe6c2('0x4d'),_0x2bc3d8);};VoiceQueueReport[_0xe6c2('0x37')][_0xe6c2('0x4e')]=function(_0x1e769d){this[_0xe6c2('0x49')](util[_0xe6c2('0x4f')](_0xe6c2('0x4b'),_0x1e769d[_0xe6c2('0x4c')]),_0xe6c2('0x50'),_0x1e769d);};VoiceQueueReport[_0xe6c2('0x37')][_0xe6c2('0x51')]=function(_0x59b9ae){if(_0x59b9ae[_0xe6c2('0x52')]===_0xe6c2('0x53')){var _0x18ed04={'id':_0x59b9ae['id'],'name':_0x59b9ae[_0xe6c2('0x4c')],'strategy':_0x59b9ae[_0xe6c2('0x54')],'answered':_0x59b9ae[_0xe6c2('0x55')],'available':_0x59b9ae[_0xe6c2('0x56')],'loggedIn':_0x59b9ae[_0xe6c2('0x57')],'pTalking':_0x59b9ae[_0xe6c2('0x34')],'sumBillable':_0x59b9ae[_0xe6c2('0x58')],'sumDuration':_0x59b9ae[_0xe6c2('0x59')],'sumHoldTime':_0x59b9ae[_0xe6c2('0x5a')]||0x0,'talking':_0x59b9ae[_0xe6c2('0x33')],'total':_0x59b9ae['total'],'type':_0x59b9ae[_0xe6c2('0x52')],'unmanaged':_0x59b9ae['unmanaged'],'abandoned':_0x59b9ae[_0xe6c2('0x5b')],'waiting':_0x59b9ae['waiting']};if(_0x59b9ae[_0xe6c2('0x5c')]){_0x18ed04[_0xe6c2('0x5c')]={'id':_0x59b9ae[_0xe6c2('0x5c')]['id'],'name':_0x59b9ae[_0xe6c2('0x5c')][_0xe6c2('0x4c')],'active':_0x59b9ae['Trunk'][_0xe6c2('0x5d')],'callerid':_0x59b9ae[_0xe6c2('0x5c')]['callerid']};}if(_0x59b9ae['Interval']){_0x18ed04[_0xe6c2('0x5e')]={'id':_0x59b9ae['Interval']['id'],'name':_0x59b9ae[_0xe6c2('0x5e')][_0xe6c2('0x4c')]};}var _0x11be66=md5(JSON[_0xe6c2('0x5f')](_0x18ed04));if(_0x59b9ae[_0xe6c2('0x3')]!==_0x11be66){_0x59b9ae[_0xe6c2('0x3')]=_0x11be66;this[_0xe6c2('0x49')](util[_0xe6c2('0x4f')]('voice:queue:%s',_0x18ed04[_0xe6c2('0x4c')]),'voice_queue:save',_0x18ed04);}}};VoiceQueueReport[_0xe6c2('0x37')][_0xe6c2('0x60')]=function(_0x3a9b54){return _0x3a9b54!==null&&!_[_0xe6c2('0x2f')](_0x3a9b54);};VoiceQueueReport[_0xe6c2('0x37')][_0xe6c2('0x2e')]=function(){var _0x41ecb6=this;setInterval(function(){_0x41ecb6[_0xe6c2('0x38')]();ami['Action']({'action':_0xe6c2('0x61')})[_0xe6c2('0x3f')](loggerCatch(_0xe6c2('0x62')));},0x2710);};VoiceQueueReport['prototype'][_0xe6c2('0x2d')]=function(){var _0x5e26de=this;setInterval(function(){if(_0x5e26de['flagQueueSummary']){return ami[_0xe6c2('0x3c')]({'action':_0xe6c2('0x15')})[_0xe6c2('0x63')](function(_0x51492f){_0x5e26de[_0xe6c2('0x13')]=![];})[_0xe6c2('0x3f')](loggerCatch('[queuesummary]'));}},0x3e8);};VoiceQueueReport[_0xe6c2('0x37')][_0xe6c2('0x16')]=function(_0x49e25e){try{if(this[_0xe6c2('0x60')](_0x49e25e)&&this[_0xe6c2('0x60')](_0x49e25e[_0xe6c2('0x64')])){if(this[_0xe6c2('0x12')][_0x49e25e[_0xe6c2('0x64')]]){var _0x5887cc=_[_0xe6c2('0x65')](this[_0xe6c2('0x39')],_0xe6c2('0x64'))[_0x49e25e[_0xe6c2('0x64')]]||0x0;var _0x5e4fe0=_0x5887cc-_0x49e25e[_0xe6c2('0x66')];if(this['voiceQueues'][_0x49e25e[_0xe6c2('0x64')]][_0xe6c2('0x35')]!==_['toNumber'](_0x49e25e[_0xe6c2('0x66')])||this[_0xe6c2('0x12')][_0x49e25e[_0xe6c2('0x64')]]['loggedIn']!==_['toNumber'](_0x49e25e[_0xe6c2('0x67')])||this[_0xe6c2('0x12')][_0x49e25e[_0xe6c2('0x64')]][_0xe6c2('0x56')]!==_['toNumber'](_0x49e25e[_0xe6c2('0x56')])||this[_0xe6c2('0x12')][_0x49e25e['queue']][_0xe6c2('0x33')]!==_0x5e4fe0){this['voiceQueues'][_0x49e25e[_0xe6c2('0x64')]][_0xe6c2('0x35')]=_[_0xe6c2('0x68')](_0x49e25e[_0xe6c2('0x66')]);this[_0xe6c2('0x12')][_0x49e25e[_0xe6c2('0x64')]][_0xe6c2('0x57')]=_['toNumber'](_0x49e25e['loggedin']);this[_0xe6c2('0x12')][_0x49e25e[_0xe6c2('0x64')]][_0xe6c2('0x56')]=_[_0xe6c2('0x68')](_0x49e25e[_0xe6c2('0x56')]);this[_0xe6c2('0x12')][_0x49e25e[_0xe6c2('0x64')]][_0xe6c2('0x33')]=_0x5e4fe0>0x0?_0x5e4fe0:0x0;this[_0xe6c2('0x12')][_0x49e25e[_0xe6c2('0x64')]][_0xe6c2('0x33')]=this['voiceQueues'][_0x49e25e[_0xe6c2('0x64')]][_0xe6c2('0x33')]>_[_0xe6c2('0x68')](_0x49e25e['loggedin'])?_['toNumber'](_0x49e25e[_0xe6c2('0x67')]):this[_0xe6c2('0x12')][_0x49e25e[_0xe6c2('0x64')]]['talking'];this['emitVoiceQueueSummary'](this[_0xe6c2('0x12')][_0x49e25e[_0xe6c2('0x64')]]);}ami[_0xe6c2('0x49')]('custom:queuesummary',this[_0xe6c2('0x12')][_0x49e25e[_0xe6c2('0x64')]]);}}}catch(_0x406311){logger[_0xe6c2('0x43')](_0xe6c2('0x69'),util['inspect'](_0x406311,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe6c2('0x37')][_0xe6c2('0x6a')]=function(_0x125491){this[_0xe6c2('0x13')]=!![];};VoiceQueueReport[_0xe6c2('0x37')][_0xe6c2('0x6b')]=function(_0x5d8551){};VoiceQueueReport['prototype'][_0xe6c2('0x1a')]=function(_0x2befbd){try{if(this[_0xe6c2('0x60')](_0x2befbd)){if(_[_0xe6c2('0x2f')](this[_0xe6c2('0x42')][_0x2befbd[_0xe6c2('0x6c')]])){this[_0xe6c2('0x42')][_0x2befbd[_0xe6c2('0x6c')]]=[];this['channels'][_0x2befbd[_0xe6c2('0x6c')]]={};}var _0x5833a3=new QueueReport();_0x5833a3['name']=_0x2befbd['queue'];_0x5833a3['type']=this[_0xe6c2('0x12')][_0x5833a3[_0xe6c2('0x4c')]]&&this['voiceQueues'][_0x5833a3[_0xe6c2('0x4c')]]['type']?this['voiceQueues'][_0x5833a3[_0xe6c2('0x4c')]][_0xe6c2('0x52')]||_0xe6c2('0x53'):_0xe6c2('0x53');_0x5833a3[_0xe6c2('0x64')]=_0x2befbd[_0xe6c2('0x64')];_0x5833a3[_0xe6c2('0x6d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5833a3[_0xe6c2('0x6e')]=_0x2befbd['position'];_0x5833a3[_0xe6c2('0x6f')]=_0x2befbd[_0xe6c2('0x6f')];_['merge'](_0x5833a3,_['pick'](_0x2befbd,_[_0xe6c2('0x70')](_0x5833a3)));this[_0xe6c2('0x42')][_0x2befbd[_0xe6c2('0x6c')]][_0xe6c2('0x71')](_0x5833a3);this[_0xe6c2('0x39')][_0x2befbd['uniqueid']]=_0x5833a3;this['emitVoiceQueueChannelSave'](_0x5833a3);}}catch(_0x520276){logger['error'](_0xe6c2('0x72'),util[_0xe6c2('0x48')](_0x520276,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe6c2('0x1c')]=function(_0x161148){try{if(this[_0xe6c2('0x60')](_0x161148)){if(this[_0xe6c2('0x42')][_0x161148[_0xe6c2('0x6c')]]){var _0xd369f0=_['last'](this[_0xe6c2('0x42')][_0x161148[_0xe6c2('0x6c')]]);_0xd369f0[_0xe6c2('0x73')]=![];_0xd369f0[_0xe6c2('0x74')]=null;_0xd369f0['holdtime']=_0x161148[_0xe6c2('0x75')];_0xd369f0['originalposition']=_0x161148['originalposition'];_0xd369f0[_0xe6c2('0x1b')]=!![];_0xd369f0[_0xe6c2('0x76')]=moment()[_0xe6c2('0x4f')](_0xe6c2('0x77'));_0xd369f0[_0xe6c2('0x78')]=_0xe6c2('0x79');_0xd369f0[_0xe6c2('0x7a')]=null;this[_0xe6c2('0x39')][_0x161148['uniqueid']]=_0xd369f0;this[_0xe6c2('0x4e')](_0xd369f0);}}}catch(_0xbe863e){logger[_0xe6c2('0x43')]('[syncQueueCallerAbandon][VoiceQueueReport]',util[_0xe6c2('0x48')](_0xbe863e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe6c2('0x37')][_0xe6c2('0x1e')]=function(_0x2df841){try{if(this[_0xe6c2('0x60')](_0x2df841)){if(this[_0xe6c2('0x42')][_0x2df841[_0xe6c2('0x6c')]]){var _0x9ca1a3=_[_0xe6c2('0x7b')](this[_0xe6c2('0x42')][_0x2df841[_0xe6c2('0x6c')]]);_0x9ca1a3[_0xe6c2('0x7c')]=moment()[_0xe6c2('0x4f')](_0xe6c2('0x77'));_0x9ca1a3[_0xe6c2('0x7d')]=_0x2df841[_0xe6c2('0x7d')];_0x9ca1a3[_0xe6c2('0x7e')]=_0x2df841[_0xe6c2('0x7e')];this[_0xe6c2('0x39')][_0x2df841[_0xe6c2('0x6c')]]=_0x9ca1a3;this[_0xe6c2('0x4a')](_0x9ca1a3);}}}catch(_0x24e643){logger[_0xe6c2('0x43')](_0xe6c2('0x7f'),util['inspect'](_0x24e643,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x51ee1d){try{if(this[_0xe6c2('0x60')](_0x51ee1d)){if(this[_0xe6c2('0x42')][_0x51ee1d[_0xe6c2('0x6c')]]){var _0x50f3f1=_[_0xe6c2('0x7b')](this[_0xe6c2('0x42')][_0x51ee1d[_0xe6c2('0x6c')]]);_0x50f3f1['queuecallercomplete']=!![];_0x50f3f1[_0xe6c2('0x78')]='COMPLETEDBYAGENT';}}}catch(_0x5c58f8){logger[_0xe6c2('0x43')](_0xe6c2('0x80'),util[_0xe6c2('0x48')](_0x5c58f8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe6c2('0x37')]['syncAgentComplete']=function(_0x273640){try{if(this[_0xe6c2('0x60')](_0x273640)){if(this[_0xe6c2('0x42')][_0x273640[_0xe6c2('0x6c')]]){var _0x19bef7=_[_0xe6c2('0x7b')](this[_0xe6c2('0x42')][_0x273640['uniqueid']]);_0x19bef7[_0xe6c2('0x1b')]=![];_0x19bef7[_0xe6c2('0x76')]=null;_0x19bef7[_0xe6c2('0x81')]=!![];_0x19bef7['lastAssignedTo']=_0x273640[_0xe6c2('0x82')];_0x19bef7[_0xe6c2('0x75')]=_0x273640[_0xe6c2('0x75')];_0x19bef7[_0xe6c2('0x73')]=!![];_0x19bef7['queuecallerexit']=![];_0x19bef7[_0xe6c2('0x83')]=null;if(!_0x19bef7[_0xe6c2('0x84')]){if(_0x273640[_0xe6c2('0x85')]=='transfer'){_0x19bef7[_0xe6c2('0x78')]=_0xe6c2('0x86');}else{if(_[_0xe6c2('0x87')](_0x273640[_0xe6c2('0x3e')][_0xe6c2('0x88')](),_0xe6c2('0x89'))){if(this[_0xe6c2('0x42')][_0x273640[_0xe6c2('0x8a')]]){var _0x46d66b=_['last'](this[_0xe6c2('0x42')][_0x273640[_0xe6c2('0x8a')]]);_0x46d66b['queuecallercomplete']=![];_0x46d66b['queuecallerexit']=!![];_0x46d66b['queuecallerexitAt']=moment(_0x19bef7['queuecallerjoinAt'])[_0xe6c2('0x8b')](_0x273640['holdtime'],_0xe6c2('0x8c'))[_0xe6c2('0x4f')](_0xe6c2('0x77'));_0x46d66b[_0xe6c2('0x78')]=_0xe6c2('0x8d');_0x46d66b['transfer']=!![];_0x46d66b[_0xe6c2('0x8e')]=_0xe6c2('0x8f');_0x46d66b[_0xe6c2('0x90')]=_0x273640['destexten'];_0x46d66b[_0xe6c2('0x91')]=_0x273640[_0xe6c2('0x6c')];var _0x51d286=this[_0xe6c2('0x42')][_0x273640[_0xe6c2('0x8a')]];this[_0xe6c2('0x42')][_0x273640[_0xe6c2('0x8a')]]=this[_0xe6c2('0x42')][_0x273640['uniqueid']];this['queueReports'][_0x273640[_0xe6c2('0x6c')]]=_0x51d286;}}else{_0x19bef7['queuecallerexitreason']='COMPLETEDBY'+_0x273640[_0xe6c2('0x85')]['toUpperCase']();}}}this[_0xe6c2('0x39')][_0x273640[_0xe6c2('0x6c')]]=_0x19bef7;this[_0xe6c2('0x4e')](_0x19bef7);}}}catch(_0x2625f1){logger['error'](_0xe6c2('0x92'),util[_0xe6c2('0x48')](_0x2625f1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe6c2('0x37')]['syncVarSet']=function(_0x4ae89a){try{if(this['isNotNull'](_0x4ae89a)){this[_0xe6c2('0x93')](_0x4ae89a['uniqueid'],_[_0xe6c2('0x70')](_0x4ae89a['variable'])[0x0],_0x4ae89a['value']);if(this[_0xe6c2('0x42')][_0x4ae89a[_0xe6c2('0x6c')]]){var _0x2e14ec=_['last'](this['queueReports'][_0x4ae89a['uniqueid']]);if(_0x2e14ec){if(this[_0xe6c2('0x60')](_0x4ae89a[_0xe6c2('0x94')])&&this['isNotNull'](_0x4ae89a[_0xe6c2('0x94')]['queuestatus'])){switch(_0x4ae89a[_0xe6c2('0x95')]){case _0xe6c2('0x96'):_0x2e14ec['queuecallerexit']=![];_0x2e14ec[_0xe6c2('0x83')]=null;break;default:_0x2e14ec[_0xe6c2('0x97')]=!![];_0x2e14ec[_0xe6c2('0x83')]=moment()['format'](_0xe6c2('0x77'));_0x2e14ec[_0xe6c2('0x7c')]=moment()[_0xe6c2('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2e14ec[_0xe6c2('0x1b')]=![];_0x2e14ec['queuecallerabandonAt']=null;_0x2e14ec[_0xe6c2('0x78')]=_0x4ae89a[_0xe6c2('0x95')];this[_0xe6c2('0x39')][_0x4ae89a['uniqueid']]=_0x2e14ec;this[_0xe6c2('0x4e')](_0x2e14ec);}else if(this[_0xe6c2('0x60')](_0x4ae89a['variable'])&&this['isNotNull'](_0x4ae89a[_0xe6c2('0x94')][_0xe6c2('0x98')])){if(!_0x2e14ec['queuecallerabandon']){_0x2e14ec['queuecallerexit']=!![];_0x2e14ec['queuecallerexitAt']=moment()[_0xe6c2('0x4f')](_0xe6c2('0x77'));_0x2e14ec[_0xe6c2('0x78')]=_0xe6c2('0x99');_0x2e14ec[_0xe6c2('0x7c')]=moment()['format'](_0xe6c2('0x77'));this['channels'][_0x4ae89a[_0xe6c2('0x6c')]]=_0x2e14ec;}}_0x2e14ec[_0xe6c2('0x44')]=this[_0xe6c2('0x44')][_0x4ae89a['uniqueid']];}}}}catch(_0x1a29ea){logger[_0xe6c2('0x43')](_0xe6c2('0x9a'),util[_0xe6c2('0x48')](_0x1a29ea,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe6c2('0x93')]=function(_0x29ac04,_0x46c8e5,_0x438082){var _0x279ee1=[_0xe6c2('0x9b'),_0xe6c2('0x9c'),_0xe6c2('0x9d'),_0xe6c2('0x9e'),'rtpaudioqosloss',_0xe6c2('0x9f'),'rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri',_0xe6c2('0xa0'),'bridgepvtcallid','membercalls',_0xe6c2('0xa1'),_0xe6c2('0xa2'),_0xe6c2('0xa3'),'membername',_0xe6c2('0xa4'),'memberrealtime'];if(!_[_0xe6c2('0x3b')](_0x46c8e5)&&!_['includes'](_0x279ee1,_0x46c8e5)){if(_[_0xe6c2('0x2f')](this['variables'][_0x29ac04])){this['variables'][_0x29ac04]={};}this['variables'][_0x29ac04][_0x46c8e5]=_0x438082;}};VoiceQueueReport[_0xe6c2('0x37')][_0xe6c2('0x25')]=function(_0xc371b9){try{if(this[_0xe6c2('0x60')](_0xc371b9)){if(this[_0xe6c2('0x42')][_0xc371b9[_0xe6c2('0x6c')]]){for(var _0x74303=0x0,_0x128822={};_0x743030x0?_0x151d72:0x0;this[_0xd45f('0x15')][_0x422154[_0xd45f('0x5c')]]['talking']=this[_0xd45f('0x15')][_0x422154['queue']]['talking']>_[_0xd45f('0x5f')](_0x422154[_0xd45f('0x60')])?_[_0xd45f('0x5f')](_0x422154[_0xd45f('0x60')]):this[_0xd45f('0x15')][_0x422154['queue']][_0xd45f('0x36')];this['emitVoiceQueueSummary'](this[_0xd45f('0x15')][_0x422154[_0xd45f('0x5c')]]);}ami['emit'](_0xd45f('0x62'),this[_0xd45f('0x15')][_0x422154['queue']]);}}}catch(_0x33254a){logger[_0xd45f('0x40')](_0xd45f('0x63'),util['inspect'](_0x33254a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd45f('0x3a')][_0xd45f('0x64')]=function(_0xfb8b34){this[_0xd45f('0x16')]=!![];};VoiceQueueReport['prototype'][_0xd45f('0x65')]=function(_0x106a4e){};VoiceQueueReport[_0xd45f('0x3a')]['syncQueueCallerJoin']=function(_0x6db5ff){try{if(this[_0xd45f('0x66')](_0x6db5ff)){if(_[_0xd45f('0x32')](this[_0xd45f('0x11')][_0x6db5ff[_0xd45f('0x67')]])){this['queueReports'][_0x6db5ff['uniqueid']]=[];this['channels'][_0x6db5ff[_0xd45f('0x67')]]={};}var _0x423340=new QueueReport();_0x423340['name']=_0x6db5ff[_0xd45f('0x5c')];_0x423340[_0xd45f('0x52')]=this['voiceQueues'][_0x423340['name']]&&this[_0xd45f('0x15')][_0x423340[_0xd45f('0x4a')]][_0xd45f('0x52')]?this[_0xd45f('0x15')][_0x423340[_0xd45f('0x4a')]][_0xd45f('0x52')]||_0xd45f('0x68'):_0xd45f('0x68');_0x423340['queue']=_0x6db5ff[_0xd45f('0x5c')];_0x423340[_0xd45f('0x69')]=moment()[_0xd45f('0x48')](_0xd45f('0x6a'));_0x423340['position']=_0x6db5ff[_0xd45f('0x6b')];_0x423340[_0xd45f('0x6c')]=_0x6db5ff['count'];_[_0xd45f('0x6d')](_0x423340,_[_0xd45f('0x6e')](_0x6db5ff,_[_0xd45f('0x6f')](_0x423340)));this[_0xd45f('0x11')][_0x6db5ff[_0xd45f('0x67')]][_0xd45f('0x70')](_0x423340);this[_0xd45f('0x13')][_0x6db5ff[_0xd45f('0x67')]]=_0x423340;this[_0xd45f('0x71')](_0x423340);}}catch(_0x301206){logger[_0xd45f('0x40')](_0xd45f('0x72'),util[_0xd45f('0x46')](_0x301206,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd45f('0x3a')][_0xd45f('0x1f')]=function(_0x55e51d){try{if(this[_0xd45f('0x66')](_0x55e51d)){if(this['queueReports'][_0x55e51d[_0xd45f('0x67')]]){var _0x514e90=_[_0xd45f('0x73')](this[_0xd45f('0x11')][_0x55e51d['uniqueid']]);_0x514e90[_0xd45f('0x74')]=![];_0x514e90[_0xd45f('0x75')]=null;_0x514e90['holdtime']=_0x55e51d['holdtime'];_0x514e90[_0xd45f('0x76')]=_0x55e51d[_0xd45f('0x76')];_0x514e90[_0xd45f('0x1e')]=!![];_0x514e90['queuecallerabandonAt']=moment()[_0xd45f('0x48')](_0xd45f('0x6a'));_0x514e90['queuecallerexitreason']=_0xd45f('0x77');_0x514e90[_0xd45f('0x78')]=null;this['channels'][_0x55e51d['uniqueid']]=_0x514e90;this['emitVoiceQueueChannelRemove'](_0x514e90);}}}catch(_0x2131c2){logger[_0xd45f('0x40')](_0xd45f('0x79'),util[_0xd45f('0x46')](_0x2131c2,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xd45f('0x21')]=function(_0x3a7afe){try{if(this[_0xd45f('0x66')](_0x3a7afe)){if(this[_0xd45f('0x11')][_0x3a7afe[_0xd45f('0x67')]]){var _0x368c73=_[_0xd45f('0x73')](this['queueReports'][_0x3a7afe[_0xd45f('0x67')]]);_0x368c73[_0xd45f('0x7a')]=moment()[_0xd45f('0x48')](_0xd45f('0x6a'));_0x368c73[_0xd45f('0x7b')]=_0x3a7afe['connectedlinenum'];_0x368c73['connectedlinename']=_0x3a7afe[_0xd45f('0x7c')];this[_0xd45f('0x13')][_0x3a7afe[_0xd45f('0x67')]]=_0x368c73;this[_0xd45f('0x71')](_0x368c73);}}}catch(_0x224457){logger['error'](_0xd45f('0x7d'),util[_0xd45f('0x46')](_0x224457,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd45f('0x3a')][_0xd45f('0x24')]=function(_0x4cad33){try{if(this[_0xd45f('0x66')](_0x4cad33)){if(this[_0xd45f('0x11')][_0x4cad33[_0xd45f('0x67')]]){var _0xb16a16=_['last'](this['queueReports'][_0x4cad33[_0xd45f('0x67')]]);_0xb16a16[_0xd45f('0x74')]=!![];_0xb16a16['queuecallerexitreason']=_0xd45f('0x7e');}}}catch(_0x760f64){logger[_0xd45f('0x40')]('[syncAgentConnect][VoiceQueueReport]',util['inspect'](_0x760f64,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd45f('0x3a')][_0xd45f('0x7f')]=function(_0x36581f){try{if(this['isNotNull'](_0x36581f)){if(this[_0xd45f('0x11')][_0x36581f[_0xd45f('0x67')]]){var _0x223450=_[_0xd45f('0x73')](this['queueReports'][_0x36581f[_0xd45f('0x67')]]);_0x223450['queuecallerabandon']=![];_0x223450[_0xd45f('0x80')]=null;_0x223450[_0xd45f('0x81')]=!![];_0x223450['lastAssignedTo']=_0x36581f[_0xd45f('0x82')];_0x223450['holdtime']=_0x36581f[_0xd45f('0x83')];_0x223450[_0xd45f('0x74')]=!![];_0x223450[_0xd45f('0x84')]=![];_0x223450[_0xd45f('0x85')]=null;if(!_0x223450[_0xd45f('0x86')]){if(_0x36581f[_0xd45f('0x87')]==_0xd45f('0x86')){_0x223450[_0xd45f('0x88')]='COMPLETED';}else{if(_[_0xd45f('0x89')](_0x36581f[_0xd45f('0x3d')][_0xd45f('0x8a')](),_0xd45f('0x8b'))){if(this[_0xd45f('0x11')][_0x36581f[_0xd45f('0x8c')]]){var _0x526d33=_[_0xd45f('0x73')](this[_0xd45f('0x11')][_0x36581f['linkedid']]);_0x526d33[_0xd45f('0x74')]=![];_0x526d33['queuecallerexit']=!![];_0x526d33['queuecallerexitAt']=moment(_0x223450[_0xd45f('0x69')])['add'](_0x36581f[_0xd45f('0x83')],'seconds')[_0xd45f('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x526d33[_0xd45f('0x88')]=_0xd45f('0x8d');_0x526d33[_0xd45f('0x86')]=!![];_0x526d33[_0xd45f('0x8e')]='FORWARD';_0x526d33[_0xd45f('0x8f')]=_0x36581f[_0xd45f('0x90')];_0x526d33[_0xd45f('0x91')]=_0x36581f[_0xd45f('0x67')];var _0x17ba97=this[_0xd45f('0x11')][_0x36581f[_0xd45f('0x8c')]];this[_0xd45f('0x11')][_0x36581f['linkedid']]=this[_0xd45f('0x11')][_0x36581f['uniqueid']];this[_0xd45f('0x11')][_0x36581f['uniqueid']]=_0x17ba97;}}else{_0x223450[_0xd45f('0x88')]='COMPLETEDBY'+_0x36581f[_0xd45f('0x87')]['toUpperCase']();}}}this['channels'][_0x36581f[_0xd45f('0x67')]]=_0x223450;this[_0xd45f('0x45')](_0x223450);}}}catch(_0x238f76){logger['error'](_0xd45f('0x92'),util[_0xd45f('0x46')](_0x238f76,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd45f('0x3a')][_0xd45f('0x26')]=function(_0x273e57){try{if(this[_0xd45f('0x66')](_0x273e57)){this[_0xd45f('0x93')](_0x273e57[_0xd45f('0x67')],_[_0xd45f('0x6f')](_0x273e57[_0xd45f('0x94')])[0x0],_0x273e57[_0xd45f('0x95')]);if(this['queueReports'][_0x273e57['uniqueid']]){var _0x175bbd=_['last'](this[_0xd45f('0x11')][_0x273e57['uniqueid']]);if(_0x175bbd){if(this[_0xd45f('0x66')](_0x273e57[_0xd45f('0x94')])&&this[_0xd45f('0x66')](_0x273e57['variable'][_0xd45f('0x96')])){switch(_0x273e57[_0xd45f('0x95')]){case _0xd45f('0x97'):_0x175bbd['queuecallerexit']=![];_0x175bbd[_0xd45f('0x85')]=null;break;default:_0x175bbd[_0xd45f('0x84')]=!![];_0x175bbd[_0xd45f('0x85')]=moment()[_0xd45f('0x48')](_0xd45f('0x6a'));_0x175bbd[_0xd45f('0x7a')]=moment()[_0xd45f('0x48')](_0xd45f('0x6a'));}_0x175bbd[_0xd45f('0x1e')]=![];_0x175bbd[_0xd45f('0x80')]=null;_0x175bbd[_0xd45f('0x88')]=_0x273e57[_0xd45f('0x95')];this[_0xd45f('0x13')][_0x273e57[_0xd45f('0x67')]]=_0x175bbd;this['emitVoiceQueueChannelRemove'](_0x175bbd);}else if(this[_0xd45f('0x66')](_0x273e57[_0xd45f('0x94')])&&this[_0xd45f('0x66')](_0x273e57[_0xd45f('0x94')][_0xd45f('0x98')])){if(!_0x175bbd[_0xd45f('0x1e')]){_0x175bbd[_0xd45f('0x84')]=!![];_0x175bbd[_0xd45f('0x85')]=moment()[_0xd45f('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x175bbd['queuecallerexitreason']=_0xd45f('0x99');_0x175bbd['queuecallerleaveAt']=moment()[_0xd45f('0x48')](_0xd45f('0x6a'));this[_0xd45f('0x13')][_0x273e57[_0xd45f('0x67')]]=_0x175bbd;}}_0x175bbd[_0xd45f('0x18')]=this['variables'][_0x273e57[_0xd45f('0x67')]];}}}}catch(_0x4cecbf){logger[_0xd45f('0x40')](_0xd45f('0x9a'),util['inspect'](_0x4cecbf,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xd45f('0x93')]=function(_0x5a5476,_0x51acae,_0x1b993d){var _0x242fc4=[_0xd45f('0x9b'),'rtpaudioqosbridged','rtpaudioqosjitter',_0xd45f('0x9c'),'rtpaudioqosloss',_0xd45f('0x9d'),_0xd45f('0x9e'),_0xd45f('0x9f'),_0xd45f('0xa0'),_0xd45f('0xa1'),_0xd45f('0xa2'),_0xd45f('0xa3'),_0xd45f('0xa4'),'memberdynamic',_0xd45f('0xa5'),_0xd45f('0xa6'),_0xd45f('0x82'),_0xd45f('0xa7'),_0xd45f('0xa8')];if(!_[_0xd45f('0x3c')](_0x51acae)&&!_['includes'](_0x242fc4,_0x51acae)){if(_['isUndefined'](this[_0xd45f('0x18')][_0x5a5476])){this[_0xd45f('0x18')][_0x5a5476]={};}this[_0xd45f('0x18')][_0x5a5476][_0x51acae]=_0x1b993d;}};VoiceQueueReport[_0xd45f('0x3a')][_0xd45f('0x28')]=function(_0x1ba1bd){try{if(this[_0xd45f('0x66')](_0x1ba1bd)){if(this[_0xd45f('0x11')][_0x1ba1bd['uniqueid']]){for(var _0x3d8259=0x0,_0x222b06={};_0x3d8259=0x0?moment(_0x3dc860[_0xbb12('0x17')])[_0xbb12('0xc')](_0x3dc860[_0xbb12('0x16')],_0xbb12('0xd')):null,'data1':_0xbb12('0x18'),'data2':_0x3dc860[_0xbb12('0x10')],'data3':_0x3dc860[_0xbb12('0x19')],'data4':_0x3dc860[_0xbb12('0x1a')]||null,'role':_0xbb12('0xf'),'internal':_0x3dc860[_0xbb12('0x10')]?_[_0xbb12('0x11')](_0x3dc860[_0xbb12('0x10')]):undefined,'uniqueid':_0x3dc860[_0xbb12('0x12')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x7ecb=['uniqueid','lodash','../client','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','isNil','interface','format','SIP/%s','lastAssignedTo','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','voiceDialReport','voice','membername','TALKING','starttime','outbound','dialstring'];(function(_0x384038,_0x38f19f){var _0x2aa68c=function(_0x1e4e01){while(--_0x1e4e01){_0x384038['push'](_0x384038['shift']());}};_0x2aa68c(++_0x38f19f);}(_0x7ecb,0x1d1));var _0xb7ec=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7ecb[_0x20a584];return _0x4b41a8;};'use strict';var moment=require('moment');var _=require(_0xb7ec('0x0'));var util=require('util');var client=require(_0xb7ec('0x1'));exports[_0xb7ec('0x2')]=function(_0x9c22b2){var _0x3acd0f=_0x9c22b2['queuecallercompleteAt']||_0x9c22b2[_0xb7ec('0x3')];return client[_0xb7ec('0x4')](_0xb7ec('0x5'),{'body':{'channel':'voice','membername':_0x9c22b2['lastAssignedTo'],'interface':_[_0xb7ec('0x6')](_0x9c22b2[_0xb7ec('0x7')])?util[_0xb7ec('0x8')](_0xb7ec('0x9'),_0x9c22b2[_0xb7ec('0xa')]):_0x9c22b2[_0xb7ec('0x7')],'type':'TALKING','enterAt':_0x9c22b2[_0xb7ec('0xb')],'exitAt':_0x3acd0f,'duration':moment(_0x3acd0f)[_0xb7ec('0xc')](_0x9c22b2['queuecallerleaveAt'],_0xb7ec('0xd')),'data1':_0xb7ec('0xe'),'data2':_0x9c22b2[_0xb7ec('0xf')],'data3':_0x9c22b2[_0xb7ec('0x10')],'data4':null,'data5':_0x9c22b2[_0xb7ec('0x11')],'role':_0xb7ec('0x12'),'internal':_0x9c22b2[_0xb7ec('0x13')]?_[_0xb7ec('0x14')](_0x9c22b2[_0xb7ec('0x13')]):undefined,'uniqueid':_0x9c22b2['uniqueid']},'log':_0xb7ec('0x5')});};exports[_0xb7ec('0x15')]=function(_0x30a877){return client[_0xb7ec('0x4')](_0xb7ec('0x5'),{'body':{'channel':_0xb7ec('0x16'),'membername':_0x30a877[_0xb7ec('0x17')],'interface':_0x30a877[_0xb7ec('0x7')],'type':_0xb7ec('0x18'),'enterAt':_0x30a877[_0xb7ec('0x19')],'exitAt':_0x30a877['endtime'],'duration':moment(_0x30a877['endtime'])[_0xb7ec('0xc')](_0x30a877[_0xb7ec('0x19')],_0xb7ec('0xd'))>=0x0?moment(_0x30a877['endtime'])[_0xb7ec('0xc')](_0x30a877[_0xb7ec('0x19')],_0xb7ec('0xd')):null,'data1':_0xb7ec('0x1a'),'data2':_0x30a877[_0xb7ec('0x13')],'data3':_0x30a877['exten'],'data4':_0x30a877[_0xb7ec('0x1b')]||null,'role':_0xb7ec('0x12'),'internal':_0x30a877[_0xb7ec('0x13')]?_[_0xb7ec('0x14')](_0x30a877[_0xb7ec('0x13')]):undefined,'uniqueid':_0x30a877[_0xb7ec('0x1c')]},'log':_0xb7ec('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 5c71974..e901e84 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 _0xcd00=['../client','getTemplates','Request','GetTemplate','name','html'];(function(_0x76fc5f,_0xa7a135){var _0x5b7088=function(_0x4a3d6e){while(--_0x4a3d6e){_0x76fc5f['push'](_0x76fc5f['shift']());}};_0x5b7088(++_0xa7a135);}(_0xcd00,0xba));var _0x0cd0=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xcd00[_0x5f1391];return _0x50ebe3;};'use strict';var client=require(_0x0cd0('0x0'));exports[_0x0cd0('0x1')]=function(_0x583d1d){return function(_0x429369){return client[_0x0cd0('0x2')](_0x0cd0('0x3'),{'options':{'raw':!![],'attributes':['id',_0x0cd0('0x4'),_0x0cd0('0x5')]},'log':_0x0cd0('0x3')});};}; \ No newline at end of file +var _0x51fe=['GetTemplate','../client','getTemplates','Request','name','html'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x51fe,0xd3));var _0xe51f=function(_0x16dc81,_0x1f72ca){_0x16dc81=_0x16dc81-0x0;var _0x21f2e6=_0x51fe[_0x16dc81];return _0x21f2e6;};'use strict';var client=require(_0xe51f('0x0'));exports[_0xe51f('0x1')]=function(_0x45ae9c){return function(_0x5b3846){return client[_0xe51f('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xe51f('0x3'),_0xe51f('0x4')]},'log':_0xe51f('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 6776fce..f192d4c 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(_0xff5372,_0x31b0c8){var _0xc6df7d=function(_0x26310e){while(--_0x26310e){_0xff5372['push'](_0xff5372['shift']());}};_0xc6df7d(++_0x31b0c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0x1fdc5d,_0x4831e3){var _0xdf6da2=function(_0x5e9207){while(--_0x5e9207){_0x1fdc5d['push'](_0x1fdc5d['shift']());}};_0xdf6da2(++_0x4831e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 e9a8cc5..46a874b 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 _0xf9e5=['registry','../client','getTrunks','GetTrunk'];(function(_0x2dd218,_0x188aa8){var _0x52c298=function(_0x462e81){while(--_0x462e81){_0x2dd218['push'](_0x2dd218['shift']());}};_0x52c298(++_0x188aa8);}(_0xf9e5,0xd1));var _0x5f9e=function(_0x5f2849,_0x1a8fef){_0x5f2849=_0x5f2849-0x0;var _0x21daed=_0xf9e5[_0x5f2849];return _0x21daed;};'use strict';var client=require(_0x5f9e('0x0'));exports[_0x5f9e('0x1')]=function(_0x13bc0a){return function(_0x758f4b){return client['Request'](_0x5f9e('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x5f9e('0x3')]},'log':_0x5f9e('0x2')});};}; \ No newline at end of file +var _0xd09d=['../client','getTrunks','Request','GetTrunk','name','registry'];(function(_0x2f6a63,_0x2ea449){var _0xc9edcf=function(_0x1bbdf4){while(--_0x1bbdf4){_0x2f6a63['push'](_0x2f6a63['shift']());}};_0xc9edcf(++_0x2ea449);}(_0xd09d,0x102));var _0xdd09=function(_0x56edee,_0x51ef4a){_0x56edee=_0x56edee-0x0;var _0x2d01be=_0xd09d[_0x56edee];return _0x2d01be;};'use strict';var client=require(_0xdd09('0x0'));exports[_0xdd09('0x1')]=function(_0x3528af){return function(_0x3498c3){return client[_0xdd09('0x2')](_0xdd09('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xdd09('0x4'),_0xdd09('0x5')]},'log':_0xdd09('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index a161d57..235275e 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 _0xb87e=['fullname','online','lastLoginAt','lastPauseAt','interface','getTelephones','name','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','voicePause','getAgents','Request','GetUser','agent','email','accountcode'];(function(_0x4ce863,_0x1fae2a){var _0x112fee=function(_0x57d3c4){while(--_0x57d3c4){_0x4ce863['push'](_0x4ce863['shift']());}};_0x112fee(++_0x1fae2a);}(_0xb87e,0x10b));var _0xeb87=function(_0x115f4a,_0x35ae8a){_0x115f4a=_0x115f4a-0x0;var _0x14a72b=_0xb87e[_0x115f4a];return _0x14a72b;};'use strict';var client=require('../client');exports[_0xeb87('0x0')]=function(){return function(){return client[_0xeb87('0x1')](_0xeb87('0x2'),{'options':{'raw':![],'where':{'role':_0xeb87('0x3')},'attributes':['id','name',_0xeb87('0x4'),_0xeb87('0x5'),_0xeb87('0x6'),_0xeb87('0x7'),_0xeb87('0x8'),'pauseType',_0xeb87('0x9'),'voicePause','phone','mobile',_0xeb87('0xa')]},'log':'getAgents'});};};exports[_0xeb87('0xb')]=function(){return function(){return client[_0xeb87('0x1')](_0xeb87('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0xeb87('0xc'),_0xeb87('0x5'),_0xeb87('0xd')]},'log':_0xeb87('0xb')});};};exports[_0xeb87('0xe')]=function(_0x5da980,_0x5012d4,_0x263a1a){return client['Request'](_0xeb87('0xf'),{'body':{'type':_0x5012d4,'uniqueid':_0x263a1a},'options':{'where':{'id':_0x5da980['id']}},'log':'savePause'});};exports[_0xeb87('0x10')]=function(_0x31ce8e){return client[_0xeb87('0x1')](_0xeb87('0x11'),{'body':{},'options':{'where':{'id':_0x31ce8e['id']}},'log':'savePause'});};exports[_0xeb87('0x12')]=function(_0x3b0b8c){return client[_0xeb87('0x1')](_0xeb87('0x13'),{'options':{'raw':![],'where':{'role':_0xeb87('0x3'),'id':_0x3b0b8c},'attributes':['id',_0xeb87('0xc'),'email',_0xeb87('0x5'),_0xeb87('0x6'),_0xeb87('0x7'),_0xeb87('0x8'),'pauseType',_0xeb87('0x9'),_0xeb87('0x14'),_0xeb87('0xa')]},'log':_0xeb87('0x12')});}; \ No newline at end of file +var _0x4939=['email','accountcode','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','savePause','PauseUser','UnpauseUser','getAgent','fullname','../client','getAgents','Request','GetUser','agent','name'];(function(_0xf0ddb3,_0x44186c){var _0x57343b=function(_0x192387){while(--_0x192387){_0xf0ddb3['push'](_0xf0ddb3['shift']());}};_0x57343b(++_0x44186c);}(_0x4939,0x9b));var _0x9493=function(_0x5930f1,_0x51f5cd){_0x5930f1=_0x5930f1-0x0;var _0x460f45=_0x4939[_0x5930f1];return _0x460f45;};'use strict';var client=require(_0x9493('0x0'));exports[_0x9493('0x1')]=function(){return function(){return client[_0x9493('0x2')](_0x9493('0x3'),{'options':{'raw':![],'where':{'role':_0x9493('0x4')},'attributes':['id',_0x9493('0x5'),_0x9493('0x6'),_0x9493('0x7'),'fullname',_0x9493('0x8'),_0x9493('0x9'),_0x9493('0xa'),_0x9493('0xb'),_0x9493('0xc'),_0x9493('0xd'),_0x9493('0xe'),_0x9493('0xf')]},'log':_0x9493('0x1')});};};exports[_0x9493('0x10')]=function(){return function(){return client[_0x9493('0x2')](_0x9493('0x3'),{'options':{'raw':!![],'where':{'role':_0x9493('0x11')},'attributes':['id',_0x9493('0x5'),_0x9493('0x7'),'internal']},'log':_0x9493('0x10')});};};exports[_0x9493('0x12')]=function(_0x1f70b5,_0x204482,_0x5dbecd){return client[_0x9493('0x2')](_0x9493('0x13'),{'body':{'type':_0x204482,'uniqueid':_0x5dbecd},'options':{'where':{'id':_0x1f70b5['id']}},'log':'savePause'});};exports['saveUnpause']=function(_0x29f2b8){return client[_0x9493('0x2')](_0x9493('0x14'),{'body':{},'options':{'where':{'id':_0x29f2b8['id']}},'log':_0x9493('0x12')});};exports[_0x9493('0x15')]=function(_0x284797){return client[_0x9493('0x2')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x9493('0x4'),'id':_0x284797},'attributes':['id',_0x9493('0x5'),_0x9493('0x6'),_0x9493('0x7'),_0x9493('0x16'),_0x9493('0x8'),_0x9493('0x9'),'pauseType','lastPauseAt',_0x9493('0xc'),_0x9493('0xf')]},'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 86becf5..b07d3ce 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 _0x6af7=['create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x3c89e9,_0x226039){var _0x3a7cd1=function(_0x3defa0){while(--_0x3defa0){_0x3c89e9['push'](_0x3c89e9['shift']());}};_0x3a7cd1(++_0x226039);}(_0x6af7,0x65));var _0x76af=function(_0x295d5e,_0x334a01){_0x295d5e=_0x295d5e-0x0;var _0x13465a=_0x6af7[_0x295d5e];return _0x13465a;};'use strict';var client=require(_0x76af('0x0'));exports[_0x76af('0x1')]=function(_0x15ca20){return client[_0x76af('0x2')](_0x76af('0x3'),{'body':_0x15ca20,'log':_0x76af('0x3')});};exports[_0x76af('0x4')]=function(_0x1783db,_0x50ee36,_0x4baa24){return client[_0x76af('0x2')](_0x76af('0x5'),{'body':_0x1783db,'options':{'where':{'uniqueid':_0x50ee36,'interface':_0x4baa24}},'log':_0x76af('0x5')});}; \ No newline at end of file +var _0x9c3b=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport','update'];(function(_0x305bbf,_0x5647b3){var _0x4ed772=function(_0x3315ed){while(--_0x3315ed){_0x305bbf['push'](_0x305bbf['shift']());}};_0x4ed772(++_0x5647b3);}(_0x9c3b,0x139));var _0xb9c3=function(_0xf078ac,_0x445c85){_0xf078ac=_0xf078ac-0x0;var _0x114c01=_0x9c3b[_0xf078ac];return _0x114c01;};'use strict';var client=require(_0xb9c3('0x0'));exports[_0xb9c3('0x1')]=function(_0x1fa689){return client[_0xb9c3('0x2')](_0xb9c3('0x3'),{'body':_0x1fa689,'log':'CreateVoiceAgentReport'});};exports[_0xb9c3('0x4')]=function(_0x2ba276,_0xe45160,_0x4fa9a2){return client[_0xb9c3('0x2')](_0xb9c3('0x5'),{'body':_0x2ba276,'options':{'where':{'uniqueid':_0xe45160,'interface':_0x4fa9a2}},'log':_0xb9c3('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index cadedf8..98ae509 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 _0x2e01=['callerid','DOCUMENTATION','getVoiceCallReports','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','billableseconds','GetVoiceCallReports','moment','util','lodash','create','Request','CreateVoiceCallReport','calleridnum','context'];(function(_0x51cc10,_0x1f6b47){var _0x4a5f97=function(_0x664981){while(--_0x664981){_0x51cc10['push'](_0x51cc10['shift']());}};_0x4a5f97(++_0x1f6b47);}(_0x2e01,0xf4));var _0x12e0=function(_0x40bd13,_0xb0a4bd){_0x40bd13=_0x40bd13-0x0;var _0x30bb8d=_0x2e01[_0x40bd13];return _0x30bb8d;};'use strict';var moment=require(_0x12e0('0x0'));var util=require(_0x12e0('0x1'));var _=require(_0x12e0('0x2'));var client=require('../client');exports[_0x12e0('0x3')]=function(_0x968f23){return client[_0x12e0('0x4')](_0x12e0('0x5'),{'body':_['merge'](_0x968f23,{'source':_0x968f23[_0x12e0('0x6')],'destinationcontext':_0x968f23[_0x12e0('0x7')],'callerid':_0x968f23[_0x12e0('0x8')],'amaflags':_0x12e0('0x9')}),'log':_0x12e0('0x5')});};exports[_0x12e0('0xa')]=function(){return function(){return client[_0x12e0('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x12e0('0xb')](_0x12e0('0xc'))[_0x12e0('0xd')](_0x12e0('0xe')),moment()[_0x12e0('0xf')](_0x12e0('0xc'))[_0x12e0('0xd')](_0x12e0('0xe'))]}},'attributes':['type','disposition','duration',_0x12e0('0x10')]},'log':_0x12e0('0x11')});};}; \ No newline at end of file +var _0xb798=['format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','GetVoiceCallReports','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','getVoiceCallReports','startOf','day'];(function(_0x56f8e6,_0x3c1b02){var _0x38f13e=function(_0x207cca){while(--_0x207cca){_0x56f8e6['push'](_0x56f8e6['shift']());}};_0x38f13e(++_0x3c1b02);}(_0xb798,0xa6));var _0x8b79=function(_0x408280,_0x5eb2a8){_0x408280=_0x408280-0x0;var _0x5468c7=_0xb798[_0x408280];return _0x5468c7;};'use strict';var moment=require(_0x8b79('0x0'));var util=require(_0x8b79('0x1'));var _=require(_0x8b79('0x2'));var client=require(_0x8b79('0x3'));exports[_0x8b79('0x4')]=function(_0xb0f832){return client[_0x8b79('0x5')](_0x8b79('0x6'),{'body':_[_0x8b79('0x7')](_0xb0f832,{'source':_0xb0f832[_0x8b79('0x8')],'destinationcontext':_0xb0f832[_0x8b79('0x9')],'callerid':_0xb0f832[_0x8b79('0xa')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0x8b79('0xb')]=function(){return function(){return client[_0x8b79('0x5')]('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x8b79('0xc')](_0x8b79('0xd'))[_0x8b79('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf']('day')['format'](_0x8b79('0xf'))]}},'attributes':[_0x8b79('0x10'),_0x8b79('0x11'),_0x8b79('0x12'),'billableseconds']},'log':_0x8b79('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index e135871..c8aeb4b 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 _0x9846=['Request','CreateVoiceDialReport','../client'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9846,0x155));var _0x6984=function(_0x4e977c,_0xa4b5ce){_0x4e977c=_0x4e977c-0x0;var _0x52fb3f=_0x9846[_0x4e977c];return _0x52fb3f;};'use strict';var client=require(_0x6984('0x0'));exports['create']=function(_0x26ec67){return client[_0x6984('0x1')](_0x6984('0x2'),{'body':_0x26ec67,'log':_0x6984('0x2')});}; \ No newline at end of file +var _0xf51f=['Request','CreateVoiceDialReport','../client','create'];(function(_0x3f9c49,_0x5d59c9){var _0x46421e=function(_0x396b4f){while(--_0x396b4f){_0x3f9c49['push'](_0x3f9c49['shift']());}};_0x46421e(++_0x5d59c9);}(_0xf51f,0x1b2));var _0xff51=function(_0x3861f7,_0x995b22){_0x3861f7=_0x3861f7-0x0;var _0x50879f=_0xf51f[_0x3861f7];return _0x50879f;};'use strict';var client=require(_0xff51('0x0'));exports[_0xff51('0x1')]=function(_0x3ac290){return client[_0xff51('0x2')](_0xff51('0x3'),{'body':_0x3ac290,'log':_0xff51('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index d2a5347..6bcd322 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 _0x895e=['exten','recordingFormat','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x895e,0x1c9));var _0xe895=function(_0x4b0d5d,_0xd17598){_0x4b0d5d=_0x4b0d5d-0x0;var _0x42ebdc=_0x895e[_0x4b0d5d];return _0x42ebdc;};'use strict';var client=require('../client');exports[_0xe895('0x0')]=function(){return function(){return client[_0xe895('0x1')](_0xe895('0x2'),{'options':{'raw':!![],'attributes':['id',_0xe895('0x3'),_0xe895('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x03c2=['exten','recordingFormat','../client','Request'];(function(_0x2e8a57,_0x1a2877){var _0x42adf5=function(_0xc2eec4){while(--_0xc2eec4){_0x2e8a57['push'](_0x2e8a57['shift']());}};_0x42adf5(++_0x1a2877);}(_0x03c2,0x102));var _0x203c=function(_0x28893b,_0x5adb1c){_0x28893b=_0x28893b-0x0;var _0xc3b404=_0x03c2[_0x28893b];return _0xc3b404;};'use strict';var client=require(_0x203c('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x203c('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x203c('0x2'),_0x203c('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 661491c..5000336 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 _0x7008=['GetVoiceQueue','acw','acwTimeout','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialPredictiveIntervalMinThreshold','Trunk','name','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','interval','../client','getVoiceQueues','Request'];(function(_0x25c151,_0x5df87a){var _0x19b175=function(_0x4e5d81){while(--_0x4e5d81){_0x25c151['push'](_0x25c151['shift']());}};_0x19b175(++_0x5df87a);}(_0x7008,0x185));var _0x8700=function(_0x2c2799,_0x50fe15){_0x2c2799=_0x2c2799-0x0;var _0x370d07=_0x7008[_0x2c2799];return _0x370d07;};'use strict';var client=require(_0x8700('0x0'));exports[_0x8700('0x1')]=function(){return function(){return client[_0x8700('0x2')](_0x8700('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x8700('0x4'),_0x8700('0x5'),'autopause',_0x8700('0x6'),_0x8700('0x7'),_0x8700('0x8'),_0x8700('0x9'),_0x8700('0xa'),_0x8700('0xb'),_0x8700('0xc'),'dialPredictiveOptimization',_0x8700('0xd'),_0x8700('0xe'),_0x8700('0xf'),_0x8700('0x10'),_0x8700('0x11'),_0x8700('0x12'),_0x8700('0x13'),_0x8700('0x14'),_0x8700('0x15'),_0x8700('0x16'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0x8700('0x17'),'dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone',_0x8700('0x18'),_0x8700('0x19'),_0x8700('0x1a'),_0x8700('0x1b'),_0x8700('0x1c'),_0x8700('0x1d'),_0x8700('0x1e'),'dialAMDTotalAnalysisTime',_0x8700('0x1f'),_0x8700('0x20'),_0x8700('0x21'),_0x8700('0x22'),_0x8700('0x23'),_0x8700('0x24'),'dialRecallMeTimeout',_0x8700('0x25'),_0x8700('0x26'),_0x8700('0x27'),_0x8700('0x28'),_0x8700('0x29'),'monitor_format',_0x8700('0x2a'),_0x8700('0x2b'),_0x8700('0x2c'),'mandatoryDisposition','dialPredictiveIntervalMaxThreshold',_0x8700('0x2d')],'include':[{'model':_0x8700('0x2e'),'as':_0x8700('0x2e'),'attributes':['id',_0x8700('0x2f'),'callerid',_0x8700('0x30')]},{'model':_0x8700('0x31'),'as':_0x8700('0x32'),'attributes':['id',_0x8700('0x2f')]},{'model':_0x8700('0x2e'),'as':_0x8700('0x33'),'attributes':['id',_0x8700('0x2f'),_0x8700('0x34'),_0x8700('0x30')]},{'model':_0x8700('0x35'),'as':'Interval','attributes':['id',_0x8700('0x2f')],'include':[{'model':_0x8700('0x35'),'as':_0x8700('0x36'),'attributes':['id',_0x8700('0x2f'),_0x8700('0x37')]}]}]},'log':_0x8700('0x1')});};}; \ No newline at end of file +var _0xaeb6=['dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialRandomLastDigitCallerIdNumber','dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','callerid','Pause','mandatoryDispositionPause','TrunkBackup','Interval','../client','getVoiceQueues','Request','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence'];(function(_0x196982,_0x4ba1e7){var _0x4d8b33=function(_0x1ea4e4){while(--_0x1ea4e4){_0x196982['push'](_0x196982['shift']());}};_0x4d8b33(++_0x4ba1e7);}(_0xaeb6,0x115));var _0x6aeb=function(_0x5d9568,_0x253de2){_0x5d9568=_0x5d9568-0x0;var _0x1b093d=_0xaeb6[_0x5d9568];return _0x1b093d;};'use strict';var client=require(_0x6aeb('0x0'));exports[_0x6aeb('0x1')]=function(){return function(){return client[_0x6aeb('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x6aeb('0x3'),_0x6aeb('0x4'),_0x6aeb('0x5'),_0x6aeb('0x6'),_0x6aeb('0x7'),_0x6aeb('0x8'),_0x6aeb('0x9'),_0x6aeb('0xa'),_0x6aeb('0xb'),_0x6aeb('0xc'),_0x6aeb('0xd'),'dialPredictiveOptimization',_0x6aeb('0xe'),'dialPredictiveInterval',_0x6aeb('0xf'),'dialOriginateCallerIdNumber',_0x6aeb('0x10'),_0x6aeb('0x11'),_0x6aeb('0x12'),_0x6aeb('0x13'),_0x6aeb('0x14'),_0x6aeb('0x15'),_0x6aeb('0x16'),_0x6aeb('0x17'),_0x6aeb('0x18'),_0x6aeb('0x19'),_0x6aeb('0x1a'),'dialTimezone',_0x6aeb('0x1b'),_0x6aeb('0x1c'),'dialCheckDuplicateType',_0x6aeb('0x1d'),_0x6aeb('0x1e'),_0x6aeb('0x1f'),'dialAMDAfterGreetingSilence',_0x6aeb('0x20'),_0x6aeb('0x21'),_0x6aeb('0x22'),_0x6aeb('0x23'),'dialAMDSilenceThreshold',_0x6aeb('0x24'),'timeout',_0x6aeb('0x25'),_0x6aeb('0x26'),_0x6aeb('0x27'),_0x6aeb('0x28'),_0x6aeb('0x29'),'dialQueueProject2',_0x6aeb('0x7'),'strategy',_0x6aeb('0x2a'),_0x6aeb('0x2b'),_0x6aeb('0x2c'),'dialPredictiveIntervalMaxThreshold',_0x6aeb('0x2d')],'include':[{'model':_0x6aeb('0x2e'),'as':_0x6aeb('0x2e'),'attributes':['id',_0x6aeb('0x3'),_0x6aeb('0x2f'),'active']},{'model':_0x6aeb('0x30'),'as':_0x6aeb('0x31'),'attributes':['id','name']},{'model':'Trunk','as':_0x6aeb('0x32'),'attributes':['id',_0x6aeb('0x3'),_0x6aeb('0x2f'),'active']},{'model':_0x6aeb('0x33'),'as':'Interval','attributes':['id',_0x6aeb('0x3')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x6aeb('0x3'),'interval']}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 1faee4a..ea30478 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 _0xe5c1=['queuecallerabandon','GetVoiceQueueReports','../client','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe5c1,0x16a));var _0x1e5c=function(_0x32f05e,_0xc56ad0){_0x32f05e=_0x32f05e-0x0;var _0x413031=_0xe5c1[_0x32f05e];return _0x413031;};'use strict';var moment=require('moment');var _=require('lodash');var client=require(_0x1e5c('0x0'));exports[_0x1e5c('0x1')]=function(_0x48560b){return client[_0x1e5c('0x2')](_0x1e5c('0x3'),{'body':_0x48560b,'log':'CreateVoiceQueueReport'});};exports[_0x1e5c('0x4')]=function(){return function(){return client[_0x1e5c('0x2')](_0x1e5c('0x5'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x1e5c('0x6')]('day')[_0x1e5c('0x7')](_0x1e5c('0x8')),moment()[_0x1e5c('0x9')]('day')['format'](_0x1e5c('0x8'))]}},'attributes':[_0x1e5c('0xa'),_0x1e5c('0xb'),_0x1e5c('0xc'),_0x1e5c('0xd'),_0x1e5c('0xe'),_0x1e5c('0xf'),_0x1e5c('0x10'),_0x1e5c('0x11'),_0x1e5c('0x12'),'queuecallerabandonAt']},'log':_0x1e5c('0x13')});};}; \ No newline at end of file +var _0x7adb=['CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','queuecallerabandonAt','GetVoiceQueueReports','moment','lodash','../client','create','Request'];(function(_0x3bb9bc,_0x3c5149){var _0x1fc313=function(_0x214dfd){while(--_0x214dfd){_0x3bb9bc['push'](_0x3bb9bc['shift']());}};_0x1fc313(++_0x3c5149);}(_0x7adb,0x19f));var _0xb7ad=function(_0x57c5e0,_0x46441f){_0x57c5e0=_0x57c5e0-0x0;var _0x512049=_0x7adb[_0x57c5e0];return _0x512049;};'use strict';var moment=require(_0xb7ad('0x0'));var _=require(_0xb7ad('0x1'));var client=require(_0xb7ad('0x2'));exports[_0xb7ad('0x3')]=function(_0x25d0b5){return client[_0xb7ad('0x4')]('CreateVoiceQueueReport',{'body':_0x25d0b5,'log':_0xb7ad('0x5')});};exports[_0xb7ad('0x6')]=function(){return function(){return client['Request'](_0xb7ad('0x7'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xb7ad('0x8'))[_0xb7ad('0x9')](_0xb7ad('0xa')),moment()[_0xb7ad('0xb')]('day')[_0xb7ad('0x9')](_0xb7ad('0xa'))]}},'attributes':[_0xb7ad('0xc'),_0xb7ad('0xd'),_0xb7ad('0xe'),_0xb7ad('0xf'),_0xb7ad('0x10'),_0xb7ad('0x11'),'queuecallerexit',_0xb7ad('0x12'),'queuecallerabandon',_0xb7ad('0x13')]},'log':_0xb7ad('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 3a9a4da..241c9fe 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 _0x9d42=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x260a7c,_0x1a7e14){var _0x21458c=function(_0x23add8){while(--_0x23add8){_0x260a7c['push'](_0x260a7c['shift']());}};_0x21458c(++_0x1a7e14);}(_0x9d42,0xe6));var _0x29d4=function(_0x5219ca,_0x10b9f5){_0x5219ca=_0x5219ca-0x0;var _0x50c2e4=_0x9d42[_0x5219ca];return _0x50c2e4;};'use strict';var client=require('../client');exports[_0x29d4('0x0')]=function(_0x34744b){return function(){return client[_0x29d4('0x1')](_0x29d4('0x2'),{'options':{'where':{'VoiceQueueId':_0x34744b,'paused':!![]},'raw':!![]},'log':_0x29d4('0x0')});};}; \ No newline at end of file +var _0x2833=['../client','getVoiceQueueRtPauses','Request'];(function(_0x57bb71,_0x22be3c){var _0x3b0c89=function(_0x20f57a){while(--_0x20f57a){_0x57bb71['push'](_0x57bb71['shift']());}};_0x3b0c89(++_0x22be3c);}(_0x2833,0x1aa));var _0x3283=function(_0xc24942,_0x49acee){_0xc24942=_0xc24942-0x0;var _0x25c4e3=_0x2833[_0xc24942];return _0x25c4e3;};'use strict';var client=require(_0x3283('0x0'));exports[_0x3283('0x1')]=function(_0x262506){return function(){return client[_0x3283('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x262506,'paused':!![]},'raw':!![]},'log':_0x3283('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 63ec4d0..6c3f5f1 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 _0x64ef=['create','merge','monitorFilename','CreateVoiceRecording','lodash'];(function(_0x1b57a5,_0x12f267){var _0x2f7bd3=function(_0x53416f){while(--_0x53416f){_0x1b57a5['push'](_0x1b57a5['shift']());}};_0x2f7bd3(++_0x12f267);}(_0x64ef,0x1c1));var _0xf64e=function(_0x31f18f,_0xb37cba){_0x31f18f=_0x31f18f-0x0;var _0x296de0=_0x64ef[_0x31f18f];return _0x296de0;};'use strict';var _=require(_0xf64e('0x0'));var client=require('../client');exports[_0xf64e('0x1')]=function(_0xa1e5f3){return client['Request']('CreateVoiceRecording',{'body':_[_0xf64e('0x2')](_0xa1e5f3,{'value':_0xa1e5f3[_0xf64e('0x3')]}),'log':_0xf64e('0x4')});}; \ No newline at end of file +var _0x9012=['lodash','../client','create','merge'];(function(_0x10076e,_0x12b41d){var _0x1792cd=function(_0x1dfe10){while(--_0x1dfe10){_0x10076e['push'](_0x10076e['shift']());}};_0x1792cd(++_0x12b41d);}(_0x9012,0x90));var _0x2901=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x9012[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0x2901('0x0'));var client=require(_0x2901('0x1'));exports[_0x2901('0x2')]=function(_0x5768a5){return client['Request']('CreateVoiceRecording',{'body':_[_0x2901('0x3')](_0x5768a5,{'value':_0x5768a5['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 f81af78..c4d1e86 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 _0xfc64=['transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeexten','transfereelinkedid','context','extension','blind','Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransfererexten','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','attended','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext'];(function(_0x247885,_0xaba743){var _0x21edce=function(_0x9ef2a6){while(--_0x9ef2a6){_0x247885['push'](_0x247885['shift']());}};_0x21edce(++_0xaba743);}(_0xfc64,0x11f));var _0x4fc6=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xfc64[_0x55e08b];return _0xd1a7ff;};'use strict';var client=require('../client');exports[_0x4fc6('0x0')]=function(_0x4c88fb){return client['Request'](_0x4fc6('0x1'),{'body':{'result':_0x4c88fb[_0x4fc6('0x2')],'transfererchannel':_0x4c88fb[_0x4fc6('0x3')],'transferercalleridnum':_0x4c88fb[_0x4fc6('0x4')],'transferercalleridname':_0x4c88fb[_0x4fc6('0x5')],'transfererconnectedlinenum':_0x4c88fb[_0x4fc6('0x6')],'transfererconnectedlinename':_0x4c88fb[_0x4fc6('0x7')],'transfereraccountcode':_0x4c88fb['transfereraccountcode'],'transferercontext':_0x4c88fb[_0x4fc6('0x8')],'transfererexten':_0x4c88fb[_0x4fc6('0x9')],'transfererlinkedid':_0x4c88fb[_0x4fc6('0xa')],'transfereechannel':_0x4c88fb[_0x4fc6('0xb')],'transfereecalleridnum':_0x4c88fb[_0x4fc6('0xc')],'transfereecalleridname':_0x4c88fb[_0x4fc6('0xd')],'transfereeconnectedlinenum':_0x4c88fb[_0x4fc6('0xe')],'transfereeconnectedlinename':_0x4c88fb['transfereeconnectedlinename'],'transfereeaccountcode':_0x4c88fb['transfereeaccountcode'],'transfereecontext':_0x4c88fb['transfereecontext'],'transfereeexten':_0x4c88fb[_0x4fc6('0xf')],'transfereelinkedid':_0x4c88fb[_0x4fc6('0x10')],'isexternal':_0x4c88fb['isexternal'],'context':_0x4c88fb[_0x4fc6('0x11')],'extension':_0x4c88fb[_0x4fc6('0x12')],'type':_0x4fc6('0x13')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x3bdec4){return client[_0x4fc6('0x14')](_0x4fc6('0x1'),{'body':{'result':_0x3bdec4['result'],'transfererchannel':_0x3bdec4[_0x4fc6('0x15')],'transferercalleridnum':_0x3bdec4[_0x4fc6('0x16')],'transferercalleridname':_0x3bdec4[_0x4fc6('0x17')],'transfererconnectedlinenum':_0x3bdec4[_0x4fc6('0x18')],'transfererconnectedlinename':_0x3bdec4['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3bdec4[_0x4fc6('0x19')],'transferercontext':_0x3bdec4['secondtransferercontext'],'transfererexten':_0x3bdec4[_0x4fc6('0x1a')],'transfererlinkedid':_0x3bdec4['origtransfererlinkedid'],'transfereechannel':_0x3bdec4['transfertargetchannel'],'transfereecalleridnum':_0x3bdec4[_0x4fc6('0x1b')],'transfereecalleridname':_0x3bdec4[_0x4fc6('0x1c')],'transfereeconnectedlinenum':_0x3bdec4[_0x4fc6('0x1d')],'transfereeconnectedlinename':_0x3bdec4['transfertargetconnectedlinename'],'transfereeaccountcode':_0x3bdec4[_0x4fc6('0x1e')],'transfereecontext':_0x3bdec4[_0x4fc6('0x1f')],'transfereeexten':_0x3bdec4[_0x4fc6('0x20')],'transfereelinkedid':_0x3bdec4[_0x4fc6('0x21')],'isexternal':_0x3bdec4[_0x4fc6('0x22')],'context':_0x3bdec4[_0x4fc6('0x23')],'extension':_0x3bdec4['origtransfererexten'],'type':_0x4fc6('0x24')},'log':_0x4fc6('0x1')});}; \ No newline at end of file +var _0x6679=['transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridname','transfereeconnectedlinenum'];(function(_0x119cd8,_0x556b73){var _0x7072a3=function(_0x5908d1){while(--_0x5908d1){_0x119cd8['push'](_0x119cd8['shift']());}};_0x7072a3(++_0x556b73);}(_0x6679,0x8a));var _0x9667=function(_0x47408e,_0x481428){_0x47408e=_0x47408e-0x0;var _0x1636bc=_0x6679[_0x47408e];return _0x1636bc;};'use strict';var client=require('../client');exports[_0x9667('0x0')]=function(_0x1cd627){return client[_0x9667('0x1')](_0x9667('0x2'),{'body':{'result':_0x1cd627[_0x9667('0x3')],'transfererchannel':_0x1cd627[_0x9667('0x4')],'transferercalleridnum':_0x1cd627[_0x9667('0x5')],'transferercalleridname':_0x1cd627['transferercalleridname'],'transfererconnectedlinenum':_0x1cd627[_0x9667('0x6')],'transfererconnectedlinename':_0x1cd627[_0x9667('0x7')],'transfereraccountcode':_0x1cd627[_0x9667('0x8')],'transferercontext':_0x1cd627[_0x9667('0x9')],'transfererexten':_0x1cd627[_0x9667('0xa')],'transfererlinkedid':_0x1cd627['transfererlinkedid'],'transfereechannel':_0x1cd627[_0x9667('0xb')],'transfereecalleridnum':_0x1cd627['transfereecalleridnum'],'transfereecalleridname':_0x1cd627[_0x9667('0xc')],'transfereeconnectedlinenum':_0x1cd627[_0x9667('0xd')],'transfereeconnectedlinename':_0x1cd627[_0x9667('0xe')],'transfereeaccountcode':_0x1cd627['transfereeaccountcode'],'transfereecontext':_0x1cd627[_0x9667('0xf')],'transfereeexten':_0x1cd627[_0x9667('0x10')],'transfereelinkedid':_0x1cd627[_0x9667('0x11')],'isexternal':_0x1cd627['isexternal'],'context':_0x1cd627[_0x9667('0x12')],'extension':_0x1cd627[_0x9667('0x13')],'type':_0x9667('0x14')},'log':_0x9667('0x2')});};exports[_0x9667('0x15')]=function(_0x4da5a6){return client[_0x9667('0x1')]('CreateVoiceTransferReport',{'body':{'result':_0x4da5a6[_0x9667('0x3')],'transfererchannel':_0x4da5a6[_0x9667('0x16')],'transferercalleridnum':_0x4da5a6[_0x9667('0x17')],'transferercalleridname':_0x4da5a6['origtransferercalleridname'],'transfererconnectedlinenum':_0x4da5a6[_0x9667('0x18')],'transfererconnectedlinename':_0x4da5a6[_0x9667('0x19')],'transfereraccountcode':_0x4da5a6[_0x9667('0x1a')],'transferercontext':_0x4da5a6['secondtransferercontext'],'transfererexten':_0x4da5a6[_0x9667('0x1b')],'transfererlinkedid':_0x4da5a6[_0x9667('0x1c')],'transfereechannel':_0x4da5a6[_0x9667('0x1d')],'transfereecalleridnum':_0x4da5a6[_0x9667('0x1e')],'transfereecalleridname':_0x4da5a6['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x4da5a6['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x4da5a6[_0x9667('0x1f')],'transfereeaccountcode':_0x4da5a6[_0x9667('0x20')],'transfereecontext':_0x4da5a6[_0x9667('0x21')],'transfereeexten':_0x4da5a6[_0x9667('0x22')],'transfereelinkedid':_0x4da5a6[_0x9667('0x23')],'isexternal':_0x4da5a6['isexternal'],'context':_0x4da5a6[_0x9667('0x24')],'extension':_0x4da5a6['origtransfererexten'],'type':_0x9667('0x25')},'log':_0x9667('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 93e2c77..45a55d5 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 _0x44dd=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','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','callerid','Interval','push','length','values','channels','voicechannel','map','find','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','event','emit','custom:','faxAccounts','send','checkAfterSend','server','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','validate','bluebird','moment','../ami','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','ami\x20disconnected','join','pick','keys','module','Reload','Action','then','message','catch','error','action','Command','content','voiceQueues','strategy','loggedIn','pTalking','sumBillable','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName'];(function(_0x1312f5,_0x30cf21){var _0x4fd7eb=function(_0x2141d1){while(--_0x2141d1){_0x1312f5['push'](_0x1312f5['shift']());}};_0x4fd7eb(++_0x30cf21);}(_0x44dd,0xdf));var _0xd44d=function(_0x1d2db5,_0x622491){_0x1d2db5=_0x1d2db5-0x0;var _0x1cdee9=_0x44dd[_0x1d2db5];return _0x1cdee9;};'use strict';var _=require('lodash');var util=require(_0xd44d('0x0'));var jayson=require('jayson/promise');var schema=require(_0xd44d('0x1'));var BPromise=require(_0xd44d('0x2'));var moment=require(_0xd44d('0x3'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require(_0xd44d('0x4'));exports['listen']=function(_0x10a4ca,_0x2ffa15,_0x19998d){return new BPromise(function(_0x5c355a,_0x56bb05){var _0x286482={'QueuePause':function(_0x1779b4){return new Promise(function(_0x3a1372,_0x4ea48c){var _0x31ccbc=util[_0xd44d('0x5')](_0xd44d('0x6'),_0xd44d('0x7'),_0x1779b4[_0xd44d('0x8')]);if(_0x10a4ca[_0xd44d('0x9')]&&_0x10a4ca[_0xd44d('0x9')][_0x31ccbc]&&_0x10a4ca[_0xd44d('0x9')][_0x31ccbc][_0xd44d('0xa')]){_0x10a4ca[_0xd44d('0x9')][_0x31ccbc][_0xd44d('0xb')]();}if(_0x10a4ca[_0xd44d('0xc')][_0x31ccbc]){_0x10a4ca['agents'][_0x31ccbc][_0xd44d('0xd')]({'statePause':_0x1779b4[_0xd44d('0xe')]?!![]:![]});}_0x3a1372({'code':0xc8,'message':_0xd44d('0xf')});});},'Reload':function(_0x415a69){var _0x2ffabb=this;return new Promise(function(_0x1634ca,_0x398589){if(ami[_0xd44d('0x10')]()==![]){return _0x398589(_0x2ffabb['error'](0x1f4,[config[_0xd44d('0x11')]['ip'],config[_0xd44d('0x11')][_0xd44d('0x12')],_0xd44d('0x13')][_0xd44d('0x14')]('\x20')));}_0x415a69=_[_0xd44d('0x15')](_0x415a69,_[_0xd44d('0x16')](properties[_0xd44d('0x17')]));_0x415a69['action']=_0xd44d('0x18');return ami[_0xd44d('0x19')](_0x415a69)[_0xd44d('0x1a')](function(_0x39f113){_0x1634ca({'code':0xc8,'message':_0x39f113[_0xd44d('0x1b')]});})[_0xd44d('0x1c')](function(_0x38ca8d){_0x398589(_0x2ffabb['error'](0x1f5,_0x38ca8d[_0xd44d('0x1b')]));});});},'Command':function(_0x5d5463){var _0x565460=this;return new Promise(function(_0x378e40,_0x284d10){if(ami['isConnected']()==![]){return _0x284d10(_0x565460[_0xd44d('0x1d')](0x1f4,[config[_0xd44d('0x11')]['ip'],config[_0xd44d('0x11')][_0xd44d('0x12')],_0xd44d('0x13')]['join']('\x20')));}_0x5d5463=_[_0xd44d('0x15')](_0x5d5463,'command');_0x5d5463[_0xd44d('0x1e')]=_0xd44d('0x1f');return ami[_0xd44d('0x19')](_0x5d5463)[_0xd44d('0x1a')](function(_0xcb59ba){_0x378e40({'code':0xc8,'message':_0xcb59ba[_0xd44d('0x20')]});})[_0xd44d('0x1c')](function(_0x1a8ff0){_0x284d10(_0x565460[_0xd44d('0x1d')](0x1f5,_0x1a8ff0['message']));});});},'VoiceQueues':function(_0x6d61f4){return new Promise(function(_0x33cb62,_0x1780a3){var _0x36de0a=[];for(var _0x38cec4 in _0x10a4ca[_0xd44d('0x21')]){if(_0x10a4ca[_0xd44d('0x21')]['hasOwnProperty'](_0x38cec4)){var _0x99c74a=_0x10a4ca['voiceQueues'][_0x38cec4];var _0x3026a6={'id':_0x99c74a['id'],'name':_0x99c74a[_0xd44d('0x8')],'strategy':_0x99c74a[_0xd44d('0x22')],'answered':_0x99c74a['answered'],'available':_0x99c74a['available'],'loggedIn':_0x99c74a[_0xd44d('0x23')],'pTalking':_0x99c74a[_0xd44d('0x24')],'sumBillable':_0x99c74a[_0xd44d('0x25')],'sumDuration':_0x99c74a['sumDuration'],'sumHoldTime':_0x99c74a['sumHoldTime']||0x0,'talking':_0x99c74a[_0xd44d('0x26')],'total':_0x99c74a[_0xd44d('0x27')],'type':_0x99c74a[_0xd44d('0x28')],'unmanaged':_0x99c74a[_0xd44d('0x29')],'abandoned':_0x99c74a[_0xd44d('0x2a')],'waiting':_0x99c74a[_0xd44d('0x2b')],'loggedInDb':_0x99c74a[_0xd44d('0x2c')]};if(_0x99c74a['type']===_0xd44d('0x2d')){_0x3026a6[_0xd44d('0x2e')]=_0x99c74a[_0xd44d('0x2e')];_0x3026a6[_0xd44d('0x2f')]=_0x99c74a[_0xd44d('0x2f')];_0x3026a6['dialOriginateCallerIdName']=_0x99c74a[_0xd44d('0x30')];_0x3026a6[_0xd44d('0x31')]=_0x99c74a[_0xd44d('0x31')];_0x3026a6[_0xd44d('0x32')]=_0x99c74a['dialOriginateTimeout'];_0x3026a6[_0xd44d('0x33')]=_0x99c74a[_0xd44d('0x33')];_0x3026a6[_0xd44d('0x34')]=_0x99c74a[_0xd44d('0x34')];_0x3026a6['outboundAnswerCallsDay']=_0x99c74a[_0xd44d('0x35')];_0x3026a6[_0xd44d('0x36')]=_0x99c74a['outboundBlacklistCallsDay'];_0x3026a6['outboundBusyCallsDay']=_0x99c74a['outboundBusyCallsDay'];_0x3026a6['outboundCongestionCallsDay']=_0x99c74a['outboundCongestionCallsDay'];_0x3026a6[_0xd44d('0x37')]=_0x99c74a[_0xd44d('0x37')];_0x3026a6[_0xd44d('0x38')]=_0x99c74a['outboundDropCallsDayCallersExit'];_0x3026a6[_0xd44d('0x39')]=_0x99c74a[_0xd44d('0x39')];_0x3026a6[_0xd44d('0x3a')]=_0x99c74a[_0xd44d('0x3a')];_0x3026a6['outboundNoSuchCallsDay']=_0x99c74a[_0xd44d('0x3b')];_0x3026a6[_0xd44d('0x3c')]=_0x99c74a[_0xd44d('0x3c')];_0x3026a6[_0xd44d('0x3d')]=_0x99c74a[_0xd44d('0x3d')];_0x3026a6[_0xd44d('0x3e')]=_0x99c74a[_0xd44d('0x3e')];_0x3026a6[_0xd44d('0x3f')]=_0x99c74a[_0xd44d('0x3f')];_0x3026a6['predictiveIntervalAnsweredCalls']=_0x99c74a[_0xd44d('0x40')];_0x3026a6[_0xd44d('0x41')]=_0x99c74a[_0xd44d('0x41')];_0x3026a6['predictiveIntervalAvgTalktime']=_0x99c74a[_0xd44d('0x42')];_0x3026a6[_0xd44d('0x43')]=_0x99c74a[_0xd44d('0x43')];_0x3026a6['predictiveIntervalDroppedCallsTimeout']=_0x99c74a[_0xd44d('0x44')];_0x3026a6[_0xd44d('0x45')]=_0x99c74a[_0xd44d('0x45')];_0x3026a6[_0xd44d('0x46')]=_0x99c74a['predictiveIntervalErlangCallsDroppedCalls'];_0x3026a6[_0xd44d('0x47')]=_0x99c74a[_0xd44d('0x47')];_0x3026a6[_0xd44d('0x48')]=_0x99c74a['predictiveIntervalMultiplicativeFactor'];_0x3026a6[_0xd44d('0x49')]=_0x99c74a[_0xd44d('0x49')];_0x3026a6['predictiveIntervalAvailable']=_0x99c74a[_0xd44d('0x4a')];_0x3026a6[_0xd44d('0x4b')]=_0x99c74a['predictiveIntervalTotalCalls'];_0x3026a6['message']=_0x99c74a[_0xd44d('0x1b')];_0x3026a6[_0xd44d('0x4c')]=_0x99c74a['originated'];_0x3026a6[_0xd44d('0x4d')]=_0x99c74a[_0xd44d('0x4d')];_0x3026a6[_0xd44d('0x4e')]=_0x99c74a['erlangCallToSecond'];_0x3026a6[_0xd44d('0x4f')]=_0x99c74a[_0xd44d('0x4f')];_0x3026a6[_0xd44d('0x50')]=_0x99c74a['erlangBusyFactor'];_0x3026a6[_0xd44d('0x51')]=_0x99c74a['startPredictive'];_0x3026a6['startProgressive']=_0x99c74a[_0xd44d('0x52')];}if(_0x99c74a['Trunk']){_0x3026a6[_0xd44d('0x53')]={'id':_0x99c74a[_0xd44d('0x53')]['id'],'name':_0x99c74a['Trunk'][_0xd44d('0x8')],'active':_0x99c74a['Trunk']['active'],'callerid':_0x99c74a[_0xd44d('0x53')][_0xd44d('0x54')]};}if(_0x99c74a['Interval']){_0x3026a6[_0xd44d('0x55')]={'id':_0x99c74a[_0xd44d('0x55')]['id'],'name':_0x99c74a[_0xd44d('0x55')]['name']};}_0x36de0a[_0xd44d('0x56')](_0x3026a6);}}_0x33cb62({'count':_0x36de0a[_0xd44d('0x57')],'rows':_0x36de0a});});},'VoiceChannels':function(_0x5c829e){return new Promise(function(_0x579598,_0xe86d9b){var _0x44842c=_[_0xd44d('0x58')](_0x10a4ca[_0xd44d('0x59')]);_0x579598({'count':_0x44842c[_0xd44d('0x57')],'rows':_0x44842c});});},'VoiceChannelMixMonitor':function(_0x241823){var _0x12c982=this;return new Promise(function(_0x166295,_0xc30213){if(ami[_0xd44d('0x10')]()==![]){return _0xc30213(_0x12c982['error'](0x1f4,[config[_0xd44d('0x11')]['ip'],config[_0xd44d('0x11')][_0xd44d('0x12')],_0xd44d('0x13')][_0xd44d('0x14')]('\x20')));}var _0x1c21c8=schema(properties[_0xd44d('0x5a')])[_0xd44d('0x1')](_0x241823);if(_0x1c21c8[_0xd44d('0x57')]>0x0){return _0xc30213(_0x12c982['error'](0x1f4,_[_0xd44d('0x5b')](_0x1c21c8,'message')[_0xd44d('0x14')](',\x20')));}var _0x1ebdcd=_[_0xd44d('0x5c')](_0x10a4ca[_0xd44d('0x59')],{'uniqueid':_0x241823[_0xd44d('0x5d')]});if(_0x1ebdcd&&_0x1ebdcd[_0xd44d('0x5e')]){var _0x272802=util[_0xd44d('0x5')](_0xd44d('0x5f'),_0x241823[_0xd44d('0x60')]||_0x241823[_0xd44d('0x5d')],_0x241823[_0xd44d('0x5')]||_0xd44d('0x61'));return ami[_0xd44d('0x19')]({'action':_0xd44d('0x62'),'channel':_0x1ebdcd[_0xd44d('0x5e')],'file':_0x272802,'options':_0xd44d('0x63')})[_0xd44d('0x1a')](function(_0x560fc8){var _0x49fe67=_['find'](_0x1ebdcd[_0xd44d('0x64')],{'filename':_0xd44d('0x65')+_0x272802[_0xd44d('0x66')]()});if(_[_0xd44d('0x67')](_0x49fe67)){_0x1ebdcd[_0xd44d('0x64')]['push']({'filename':_0xd44d('0x65')+_0x272802[_0xd44d('0x66')](),'createdAt':moment()['format'](_0xd44d('0x68')),'mixmonitorid':_0x560fc8[_0xd44d('0x69')],'status':_0xd44d('0x6a')});}else{_0x49fe67[_0xd44d('0x69')]=_0x560fc8['mixmonitorid'];_0x49fe67[_0xd44d('0x6b')]=_0xd44d('0x6a');}_0x166295({'code':0xc8,'message':[_0x241823[_0xd44d('0x5d')],'MixMonitor\x20Success',_0x560fc8[_0xd44d('0x69')]][_0xd44d('0x14')]('\x20'),'mixmonitorid':_0x560fc8[_0xd44d('0x69')]});})[_0xd44d('0x1c')](function(_0x216512){_0xc30213(_0x12c982[_0xd44d('0x1d')](0x1f5,[_0x241823['uniqueid'],_0x216512[_0xd44d('0x1b')]['toLowerCase']()][_0xd44d('0x14')]('\x20')));});}else{return _0xc30213(_0x12c982[_0xd44d('0x1d')](0x1f5,_0xd44d('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x2c4e17){var _0x55a67a=this;return new Promise(function(_0x2c96da,_0x5a9404){if(ami[_0xd44d('0x10')]()==![]){return _0x5a9404(_0x55a67a[_0xd44d('0x1d')](0x1f4,[config[_0xd44d('0x11')]['ip'],config[_0xd44d('0x11')][_0xd44d('0x12')],_0xd44d('0x13')][_0xd44d('0x14')]('\x20')));}var _0x41a03f=schema(properties[_0xd44d('0x5a')])[_0xd44d('0x1')](_0x2c4e17);if(_0x41a03f[_0xd44d('0x57')]>0x0){return _0x5a9404(_0x55a67a[_0xd44d('0x1d')](0x1f4,_[_0xd44d('0x5b')](_0x41a03f,_0xd44d('0x1b'))[_0xd44d('0x14')](',\x20')));}var _0x532f83=_[_0xd44d('0x5c')](_0x10a4ca['channels'],{'uniqueid':_0x2c4e17['uniqueid']});if(_0x532f83){return BPromise[_0xd44d('0x6d')]()[_0xd44d('0x1a')](function(){if(_0x532f83[_0xd44d('0x5e')]){return ami[_0xd44d('0x19')]({'action':_0xd44d('0x6e'),'channel':_0x532f83[_0xd44d('0x5e')],'mixmonitorid':_0x2c4e17[_0xd44d('0x69')]})[_0xd44d('0x1c')](function(_0x3da158){});}})[_0xd44d('0x1a')](function(){if(_0x532f83[_0xd44d('0x6f')]){return ami[_0xd44d('0x19')]({'action':_0xd44d('0x6e'),'channel':_0x532f83[_0xd44d('0x6f')],'mixmonitorid':_0x2c4e17[_0xd44d('0x69')]})[_0xd44d('0x1c')](function(_0x172158){});}})[_0xd44d('0x1a')](function(_0x43104b){var _0xc139a1=_[_0xd44d('0x5c')](_0x532f83[_0xd44d('0x64')],{'mixmonitorid':_0x2c4e17[_0xd44d('0x69')]});if(_0xc139a1){_0xc139a1[_0xd44d('0x6b')]=_0xd44d('0x70');}})['then'](function(){var _0x5b1fb4=util[_0xd44d('0x5')]('%s.%s',_0x2c4e17[_0xd44d('0x60')]||_0x2c4e17[_0xd44d('0x5d')],_0x2c4e17[_0xd44d('0x5')]||_0xd44d('0x61'));var _0x3f909d=_[_0xd44d('0x5c')](_0x532f83[_0xd44d('0x64')],{'filename':_0xd44d('0x65')+_0x5b1fb4[_0xd44d('0x66')]()});if(_0x3f909d){_0x3f909d[_0xd44d('0x6b')]=_0xd44d('0x70');}})[_0xd44d('0x1a')](function(){_0x2c96da({'code':0xc8,'message':[_0x2c4e17[_0xd44d('0x5d')],_0xd44d('0x71')]['join']('\x20')});})[_0xd44d('0x1c')](function(_0x324bcb){_0x5a9404(_0x55a67a[_0xd44d('0x1d')](0x1f5,[_0x2c4e17[_0xd44d('0x5d')],_0x324bcb[_0xd44d('0x1b')][_0xd44d('0x66')]()][_0xd44d('0x14')]('\x20')));});}else{return _0x5a9404(_0x55a67a[_0xd44d('0x1d')](0x1f5,_0xd44d('0x6c')));}});},'VoiceQueuesChannels':function(_0x3f21a2){return new Promise(function(_0x44f767,_0x57c611){var _0x1d00fd=_[_0xd44d('0x58')](_0x10a4ca[_0xd44d('0x72')]);_0x44f767({'count':_0x1d00fd[_0xd44d('0x57')],'rows':_0x1d00fd});});},'VoiceQueuesChannel':function(_0x132d5e){var _0x3e5d42=this;return new Promise(function(_0x35262b,_0x15c617){var _0x2db5b0=schema(properties[_0xd44d('0x73')])[_0xd44d('0x1')](_0x132d5e);if(_0x2db5b0[_0xd44d('0x57')]>0x0){return _0x15c617(_0x3e5d42['error'](0x1f4,_[_0xd44d('0x5b')](_0x2db5b0,_0xd44d('0x1b'))[_0xd44d('0x14')](',\x20')));}var _0x63d150=_['find'](_0x10a4ca['queueChannels'],{'uniqueid':_0x132d5e['uniqueid']});if(_0x63d150){_0x35262b(_0x63d150);}else{return _0x15c617(_0x3e5d42[_0xd44d('0x1d')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x47bab4){var _0x1d4a03=this;return new Promise(function(_0x49fe6d,_0x1a6f18){if(ami[_0xd44d('0x10')]()==![]){return _0x1a6f18(_0x1d4a03[_0xd44d('0x1d')](0x1f4,[config['asterisk']['ip'],config[_0xd44d('0x11')][_0xd44d('0x12')],_0xd44d('0x13')][_0xd44d('0x14')]('\x20')));}var _0x191e7e=schema(properties[_0xd44d('0x74')])[_0xd44d('0x1')](_0x47bab4);if(_0x191e7e[_0xd44d('0x57')]>0x0){return _0x1a6f18(_0x1d4a03[_0xd44d('0x1d')](0x1f4,_[_0xd44d('0x5b')](_0x191e7e,_0xd44d('0x1b'))[_0xd44d('0x14')](',\x20')));}var _0x8a331c=_[_0xd44d('0x5c')](_0x10a4ca[_0xd44d('0x72')],{'uniqueid':_0x47bab4['uniqueid']});if(_0x8a331c&&_0x8a331c['channel']){return ami['Action']({'action':'Hangup','channel':_0x8a331c['channel']})[_0xd44d('0x1a')](function(_0x344fd8){_0x49fe6d({'code':0xc8,'message':[_0x47bab4['uniqueid'],_0x344fd8['message'][_0xd44d('0x66')]()]['join']('\x20')});})[_0xd44d('0x1c')](function(_0x5d5e98){_0x1a6f18(_0x1d4a03[_0xd44d('0x1d')](0x1f5,[_0x47bab4['uniqueid'],_0x5d5e98[_0xd44d('0x1b')][_0xd44d('0x66')]()][_0xd44d('0x14')]('\x20')));});}else{return _0x1a6f18(_0x1d4a03[_0xd44d('0x1d')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3498cc){var _0x2213af=this;return new Promise(function(_0x4e9ede,_0x2edc46){if(ami[_0xd44d('0x10')]()==![]){return _0x2edc46(_0x2213af[_0xd44d('0x1d')](0x1f4,[config['asterisk']['ip'],config[_0xd44d('0x11')][_0xd44d('0x12')],_0xd44d('0x13')]['join']('\x20')));}var _0x395a3e=schema(properties[_0xd44d('0x75')])[_0xd44d('0x1')](_0x3498cc);if(_0x395a3e[_0xd44d('0x57')]>0x0){return _0x2edc46(_0x2213af[_0xd44d('0x1d')](0x1f4,_[_0xd44d('0x5b')](_0x395a3e,_0xd44d('0x1b'))['join'](',\x20')));}var _0x40fd8c=_[_0xd44d('0x5c')](_0x10a4ca[_0xd44d('0x72')],{'uniqueid':_0x3498cc[_0xd44d('0x5d')]});if(_0x40fd8c&&_0x40fd8c['channel']){return ami[_0xd44d('0x19')]({'action':_0xd44d('0x76'),'channel':_0x40fd8c[_0xd44d('0x5e')],'exten':_0x3498cc[_0xd44d('0x77')],'context':_0x3498cc[_0xd44d('0x78')]||_0x40fd8c[_0xd44d('0x78')],'priority':0x1})[_0xd44d('0x1a')](function(_0x10bdb1){_0x4e9ede({'code':0xc8,'message':[_0x3498cc['uniqueid'],_0x10bdb1[_0xd44d('0x1b')][_0xd44d('0x66')]()]['join']('\x20')});})[_0xd44d('0x1c')](function(_0x5ba823){_0x2edc46(_0x2213af['error'](0x1f5,[_0x3498cc[_0xd44d('0x5d')],_0x5ba823[_0xd44d('0x1b')][_0xd44d('0x66')]()]['join']('\x20')));});}else{return _0x2edc46(_0x2213af[_0xd44d('0x1d')](0x1f5,_0xd44d('0x6c')));}});},'Agents':function(_0x4bfe33){return new Promise(function(_0x149c1e,_0x546387){var _0x42e928=_[_0xd44d('0x58')](_0x10a4ca[_0xd44d('0xc')]);_0x149c1e({'count':_0x42e928[_0xd44d('0x57')],'rows':_0x42e928});});},'Telephones':function(_0x3c4703){return new Promise(function(_0x58a29d,_0x5194fe){var _0x341d92=_['values'](_0x10a4ca[_0xd44d('0x79')]);_0x58a29d({'count':_0x341d92[_0xd44d('0x57')],'rows':_0x341d92});});},'Trunks':function(_0x23b5f1){return new Promise(function(_0x18be86,_0x7d1071){var _0x5588cd=_['values'](_0x10a4ca[_0xd44d('0x7a')]);_0x18be86({'count':_0x5588cd[_0xd44d('0x57')],'rows':_0x5588cd});});},'OutboundChannels':function(_0x50fc76){return new Promise(function(_0x3b353e,_0x33bf5d){var _0x49c07a=_[_0xd44d('0x58')](_0x10a4ca[_0xd44d('0x7b')]);_0x3b353e({'count':_0x49c07a['length'],'rows':_0x49c07a});});},'Outbound':function(_0x4dca0c){return new Promise(function(_0x12c7af,_0x4f1c2b){_0x12c7af(_0x10a4ca[_0xd44d('0x2d')]);});},'Campaigns':function(_0x443cb3){return new Promise(function(_0x330652,_0x18001f){var _0x52713f=_[_0xd44d('0x58')](_0x10a4ca['campaigns']);_0x330652({'count':_0x52713f['length'],'rows':_0x52713f});});},'VoiceQueuesPreview':function(_0x254492){var _0x589779=this;return new Promise(function(_0x11b7dc,_0xaf396b){_0x2ffa15[_0xd44d('0x7c')](_0x254492['id'])[_0xd44d('0x1a')](function(_0x2fb9c6){_0x11b7dc({'code':0xc8,'message':_0x2fb9c6[_0xd44d('0x1b')]});})[_0xd44d('0x1c')](function(_0x21e3b4){_0xaf396b(_0x589779['error'](0x1f4,_0x21e3b4[_0xd44d('0x1b')]));});});},'EventManager':function(_0x15e88f){var _0x3ff446=this;return new Promise(function(_0x19fce9,_0x1c4dd6){if(!_0x15e88f[_0xd44d('0x7d')]){return _0x1c4dd6(_0x3ff446[_0xd44d('0x1d')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xd44d('0x7e')](_0xd44d('0x7f')+_0x15e88f[_0xd44d('0x7d')],_0x15e88f[_0xd44d('0x1b')]);_0x19fce9({'code':0xc8,'message':_0x15e88f});});},'FaxAccounts':function(_0x356901){return new Promise(function(_0x16d53a,_0x2bdaa0){var _0x5806d4=_[_0xd44d('0x58')](_0x10a4ca[_0xd44d('0x80')]);_0x16d53a({'count':_0x5806d4[_0xd44d('0x57')],'rows':_0x5806d4});});},'SendFax':function(_0xadc3c4){var _0xc66f90=this;return new Promise(function(_0x518c11,_0x75b12c){_0x19998d[_0xd44d('0x81')](_0xadc3c4)['then'](function(_0x24a92f){_0x518c11({'code':0xc8,'message':_0x24a92f[_0xd44d('0x1b')]});})[_0xd44d('0x1c')](function(_0x3d40e4){_0x75b12c(_0xc66f90['error'](0x1f4,_0x3d40e4['message']));});});},'CheckAfterSend':function(_0x3a847d){var _0x548713=this;return new Promise(function(_0x5032a7,_0x30c600){_0x19998d[_0xd44d('0x82')](_0x3a847d)[_0xd44d('0x1a')](function(_0x9c1824){_0x5032a7({'code':0xc8,'message':_0x9c1824['message']});})[_0xd44d('0x1c')](function(_0x474b4f){_0x30c600(_0x548713['error'](0x1f4,_0x474b4f[_0xd44d('0x1b')]));});});}};var _0x3cfd0f=jayson[_0xd44d('0x83')](_0x286482)[_0xd44d('0x84')]();_0x3cfd0f['on'](_0xd44d('0x1d'),function(_0x1b1d6b){return _0x56bb05(_0x1b1d6b);});_0x3cfd0f['listen'](0x232a,'127.0.0.1',function(){console[_0xd44d('0x85')](_0xd44d('0x86'),0x232a);return _0x5c355a(_0xd44d('0x87')+0x232a);});});}; \ No newline at end of file +var _0x75ed=['MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','isConnected','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','values','voicequeuechannel','map','queueChannels','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','trunks','outboundChannels','outbound','campaigns','run','event','faxAccounts','send','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','jayson/promise','validate','bluebird','moment','../../../config/environment','format','%s/%s','SIP','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','Command','voiceQueues','hasOwnProperty','strategy','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','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','callerid','Interval','push','length','channels','voicechannel','find','uniqueid','%s.%s','filename','wav','MixMonitor','channel','/var/spool/asterisk/monitor/','toLowerCase','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status'];(function(_0x1e9816,_0x11bef5){var _0x41e572=function(_0x1928b2){while(--_0x1928b2){_0x1e9816['push'](_0x1e9816['shift']());}};_0x41e572(++_0x11bef5);}(_0x75ed,0x1b0));var _0xd75e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x75ed[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xd75e('0x0'));var util=require('util');var jayson=require(_0xd75e('0x1'));var schema=require(_0xd75e('0x2'));var BPromise=require(_0xd75e('0x3'));var moment=require(_0xd75e('0x4'));var config=require(_0xd75e('0x5'));var properties=require('../properties');var ami=require('../ami');exports['listen']=function(_0x47b347,_0x2682c0,_0x1df14e){return new BPromise(function(_0x367820,_0x52085f){var _0x4a1a54={'QueuePause':function(_0xc3d480){return new Promise(function(_0x716032,_0x2ec242){var _0x103b8e=util[_0xd75e('0x6')](_0xd75e('0x7'),_0xd75e('0x8'),_0xc3d480[_0xd75e('0x9')]);if(_0x47b347[_0xd75e('0xa')]&&_0x47b347[_0xd75e('0xa')][_0x103b8e]&&_0x47b347[_0xd75e('0xa')][_0x103b8e]['timer']){_0x47b347['timers'][_0x103b8e][_0xd75e('0xb')]();}if(_0x47b347[_0xd75e('0xc')][_0x103b8e]){_0x47b347['agents'][_0x103b8e][_0xd75e('0xd')]({'statePause':_0xc3d480[_0xd75e('0xe')]?!![]:![]});}_0x716032({'code':0xc8,'message':_0xd75e('0xf')});});},'Reload':function(_0x518ae2){var _0x1e6391=this;return new Promise(function(_0x675892,_0x53dd12){if(ami['isConnected']()==![]){return _0x53dd12(_0x1e6391[_0xd75e('0x10')](0x1f4,[config[_0xd75e('0x11')]['ip'],config['asterisk'][_0xd75e('0x12')],_0xd75e('0x13')][_0xd75e('0x14')]('\x20')));}_0x518ae2=_[_0xd75e('0x15')](_0x518ae2,_[_0xd75e('0x16')](properties[_0xd75e('0x17')]));_0x518ae2[_0xd75e('0x18')]=_0xd75e('0x19');return ami[_0xd75e('0x1a')](_0x518ae2)[_0xd75e('0x1b')](function(_0x595025){_0x675892({'code':0xc8,'message':_0x595025[_0xd75e('0x1c')]});})[_0xd75e('0x1d')](function(_0x318f41){_0x53dd12(_0x1e6391[_0xd75e('0x10')](0x1f5,_0x318f41[_0xd75e('0x1c')]));});});},'Command':function(_0x54f4a4){var _0x522f3f=this;return new Promise(function(_0x58504e,_0x42d10a){if(ami['isConnected']()==![]){return _0x42d10a(_0x522f3f[_0xd75e('0x10')](0x1f4,[config[_0xd75e('0x11')]['ip'],config[_0xd75e('0x11')]['username'],'ami\x20disconnected'][_0xd75e('0x14')]('\x20')));}_0x54f4a4=_['pick'](_0x54f4a4,'command');_0x54f4a4['action']=_0xd75e('0x1e');return ami[_0xd75e('0x1a')](_0x54f4a4)[_0xd75e('0x1b')](function(_0x2c0b2b){_0x58504e({'code':0xc8,'message':_0x2c0b2b['content']});})[_0xd75e('0x1d')](function(_0x3f72dc){_0x42d10a(_0x522f3f[_0xd75e('0x10')](0x1f5,_0x3f72dc[_0xd75e('0x1c')]));});});},'VoiceQueues':function(_0xf8effa){return new Promise(function(_0x41bbb3,_0x3f9af3){var _0xc62f09=[];for(var _0x986328 in _0x47b347[_0xd75e('0x1f')]){if(_0x47b347['voiceQueues'][_0xd75e('0x20')](_0x986328)){var _0x266ea8=_0x47b347[_0xd75e('0x1f')][_0x986328];var _0x2465ea={'id':_0x266ea8['id'],'name':_0x266ea8[_0xd75e('0x9')],'strategy':_0x266ea8[_0xd75e('0x21')],'answered':_0x266ea8['answered'],'available':_0x266ea8[_0xd75e('0x22')],'loggedIn':_0x266ea8[_0xd75e('0x23')],'pTalking':_0x266ea8[_0xd75e('0x24')],'sumBillable':_0x266ea8['sumBillable'],'sumDuration':_0x266ea8[_0xd75e('0x25')],'sumHoldTime':_0x266ea8[_0xd75e('0x26')]||0x0,'talking':_0x266ea8[_0xd75e('0x27')],'total':_0x266ea8[_0xd75e('0x28')],'type':_0x266ea8[_0xd75e('0x29')],'unmanaged':_0x266ea8[_0xd75e('0x2a')],'abandoned':_0x266ea8[_0xd75e('0x2b')],'waiting':_0x266ea8[_0xd75e('0x2c')],'loggedInDb':_0x266ea8[_0xd75e('0x2d')]};if(_0x266ea8[_0xd75e('0x29')]==='outbound'){_0x2465ea[_0xd75e('0x2e')]=_0x266ea8[_0xd75e('0x2e')];_0x2465ea[_0xd75e('0x2f')]=_0x266ea8[_0xd75e('0x2f')];_0x2465ea['dialOriginateCallerIdName']=_0x266ea8['dialOriginateCallerIdName'];_0x2465ea['dialOriginateCallerIdNumber']=_0x266ea8[_0xd75e('0x30')];_0x2465ea[_0xd75e('0x31')]=_0x266ea8['dialOriginateTimeout'];_0x2465ea[_0xd75e('0x32')]=_0x266ea8[_0xd75e('0x32')];_0x2465ea[_0xd75e('0x33')]=_0x266ea8[_0xd75e('0x33')];_0x2465ea[_0xd75e('0x34')]=_0x266ea8[_0xd75e('0x34')];_0x2465ea[_0xd75e('0x35')]=_0x266ea8['outboundBlacklistCallsDay'];_0x2465ea['outboundBusyCallsDay']=_0x266ea8[_0xd75e('0x36')];_0x2465ea['outboundCongestionCallsDay']=_0x266ea8[_0xd75e('0x37')];_0x2465ea['outboundDropCallsDayACS']=_0x266ea8['outboundDropCallsDayACS'];_0x2465ea['outboundDropCallsDayCallersExit']=_0x266ea8[_0xd75e('0x38')];_0x2465ea[_0xd75e('0x39')]=_0x266ea8[_0xd75e('0x39')];_0x2465ea['outboundNoAnswerCallsDay']=_0x266ea8[_0xd75e('0x3a')];_0x2465ea[_0xd75e('0x3b')]=_0x266ea8[_0xd75e('0x3b')];_0x2465ea[_0xd75e('0x3c')]=_0x266ea8[_0xd75e('0x3c')];_0x2465ea[_0xd75e('0x3d')]=_0x266ea8['outboundReCallsDay'];_0x2465ea[_0xd75e('0x3e')]=_0x266ea8[_0xd75e('0x3e')];_0x2465ea['outboundUnknownCallsDay']=_0x266ea8[_0xd75e('0x3f')];_0x2465ea[_0xd75e('0x40')]=_0x266ea8[_0xd75e('0x40')];_0x2465ea[_0xd75e('0x41')]=_0x266ea8[_0xd75e('0x41')];_0x2465ea[_0xd75e('0x42')]=_0x266ea8['predictiveIntervalAvgTalktime'];_0x2465ea[_0xd75e('0x43')]=_0x266ea8[_0xd75e('0x43')];_0x2465ea[_0xd75e('0x44')]=_0x266ea8[_0xd75e('0x44')];_0x2465ea['predictiveIntervalErlangCalls']=_0x266ea8[_0xd75e('0x45')];_0x2465ea[_0xd75e('0x46')]=_0x266ea8[_0xd75e('0x46')];_0x2465ea[_0xd75e('0x47')]=_0x266ea8[_0xd75e('0x47')];_0x2465ea[_0xd75e('0x48')]=_0x266ea8['predictiveIntervalMultiplicativeFactor'];_0x2465ea[_0xd75e('0x49')]=_0x266ea8[_0xd75e('0x49')];_0x2465ea[_0xd75e('0x4a')]=_0x266ea8[_0xd75e('0x4a')];_0x2465ea[_0xd75e('0x4b')]=_0x266ea8['predictiveIntervalTotalCalls'];_0x2465ea[_0xd75e('0x1c')]=_0x266ea8[_0xd75e('0x1c')];_0x2465ea['originated']=_0x266ea8[_0xd75e('0x4c')];_0x2465ea[_0xd75e('0x4d')]=_0x266ea8[_0xd75e('0x4d')];_0x2465ea['erlangCallToSecond']=_0x266ea8[_0xd75e('0x4e')];_0x2465ea['erlangAbandonmentRate']=_0x266ea8[_0xd75e('0x4f')];_0x2465ea[_0xd75e('0x50')]=_0x266ea8[_0xd75e('0x50')];_0x2465ea['startPredictive']=_0x266ea8[_0xd75e('0x51')];_0x2465ea[_0xd75e('0x52')]=_0x266ea8['startProgressive'];}if(_0x266ea8[_0xd75e('0x53')]){_0x2465ea[_0xd75e('0x53')]={'id':_0x266ea8[_0xd75e('0x53')]['id'],'name':_0x266ea8[_0xd75e('0x53')][_0xd75e('0x9')],'active':_0x266ea8[_0xd75e('0x53')]['active'],'callerid':_0x266ea8['Trunk'][_0xd75e('0x54')]};}if(_0x266ea8[_0xd75e('0x55')]){_0x2465ea[_0xd75e('0x55')]={'id':_0x266ea8[_0xd75e('0x55')]['id'],'name':_0x266ea8['Interval'][_0xd75e('0x9')]};}_0xc62f09[_0xd75e('0x56')](_0x2465ea);}}_0x41bbb3({'count':_0xc62f09[_0xd75e('0x57')],'rows':_0xc62f09});});},'VoiceChannels':function(_0x365ddf){return new Promise(function(_0x234a28,_0x4cf1d6){var _0x12e21c=_['values'](_0x47b347[_0xd75e('0x58')]);_0x234a28({'count':_0x12e21c[_0xd75e('0x57')],'rows':_0x12e21c});});},'VoiceChannelMixMonitor':function(_0x4b1689){var _0x2db73d=this;return new Promise(function(_0x5da26d,_0x241d8c){if(ami['isConnected']()==![]){return _0x241d8c(_0x2db73d[_0xd75e('0x10')](0x1f4,[config['asterisk']['ip'],config[_0xd75e('0x11')]['username'],'ami\x20disconnected'][_0xd75e('0x14')]('\x20')));}var _0x474703=schema(properties[_0xd75e('0x59')])['validate'](_0x4b1689);if(_0x474703['length']>0x0){return _0x241d8c(_0x2db73d[_0xd75e('0x10')](0x1f4,_['map'](_0x474703,'message')[_0xd75e('0x14')](',\x20')));}var _0x534f8b=_[_0xd75e('0x5a')](_0x47b347['channels'],{'uniqueid':_0x4b1689[_0xd75e('0x5b')]});if(_0x534f8b&&_0x534f8b['channel']){var _0x550e40=util[_0xd75e('0x6')](_0xd75e('0x5c'),_0x4b1689[_0xd75e('0x5d')]||_0x4b1689[_0xd75e('0x5b')],_0x4b1689[_0xd75e('0x6')]||_0xd75e('0x5e'));return ami[_0xd75e('0x1a')]({'action':_0xd75e('0x5f'),'channel':_0x534f8b[_0xd75e('0x60')],'file':_0x550e40,'options':'ai(mixmonitorid)'})[_0xd75e('0x1b')](function(_0x1d70fa){var _0x191ae5=_['find'](_0x534f8b['monitors'],{'filename':_0xd75e('0x61')+_0x550e40[_0xd75e('0x62')]()});if(_['isNil'](_0x191ae5)){_0x534f8b[_0xd75e('0x63')][_0xd75e('0x56')]({'filename':_0xd75e('0x61')+_0x550e40['toLowerCase'](),'createdAt':moment()[_0xd75e('0x6')](_0xd75e('0x64')),'mixmonitorid':_0x1d70fa[_0xd75e('0x65')],'status':_0xd75e('0x66')});}else{_0x191ae5[_0xd75e('0x65')]=_0x1d70fa[_0xd75e('0x65')];_0x191ae5[_0xd75e('0x67')]=_0xd75e('0x66');}_0x5da26d({'code':0xc8,'message':[_0x4b1689[_0xd75e('0x5b')],_0xd75e('0x68'),_0x1d70fa[_0xd75e('0x65')]][_0xd75e('0x14')]('\x20'),'mixmonitorid':_0x1d70fa[_0xd75e('0x65')]});})[_0xd75e('0x1d')](function(_0x4db9dd){_0x241d8c(_0x2db73d['error'](0x1f5,[_0x4b1689[_0xd75e('0x5b')],_0x4db9dd[_0xd75e('0x1c')][_0xd75e('0x62')]()][_0xd75e('0x14')]('\x20')));});}else{return _0x241d8c(_0x2db73d['error'](0x1f5,_0xd75e('0x69')));}});},'VoiceChannelStopMixMonitor':function(_0xfa4cfb){var _0x534f90=this;return new Promise(function(_0xc072da,_0xa2cf3){if(ami[_0xd75e('0x6a')]()==![]){return _0xa2cf3(_0x534f90['error'](0x1f4,[config['asterisk']['ip'],config[_0xd75e('0x11')][_0xd75e('0x12')],_0xd75e('0x13')][_0xd75e('0x14')]('\x20')));}var _0x2fd529=schema(properties['voicechannel'])[_0xd75e('0x2')](_0xfa4cfb);if(_0x2fd529[_0xd75e('0x57')]>0x0){return _0xa2cf3(_0x534f90[_0xd75e('0x10')](0x1f4,_['map'](_0x2fd529,_0xd75e('0x1c'))['join'](',\x20')));}var _0x5ce72a=_[_0xd75e('0x5a')](_0x47b347[_0xd75e('0x58')],{'uniqueid':_0xfa4cfb[_0xd75e('0x5b')]});if(_0x5ce72a){return BPromise[_0xd75e('0x6b')]()['then'](function(){if(_0x5ce72a[_0xd75e('0x60')]){return ami['Action']({'action':_0xd75e('0x6c'),'channel':_0x5ce72a[_0xd75e('0x60')],'mixmonitorid':_0xfa4cfb['mixmonitorid']})[_0xd75e('0x1d')](function(_0x455220){});}})['then'](function(){if(_0x5ce72a[_0xd75e('0x6d')]){return ami[_0xd75e('0x1a')]({'action':'StopMixMonitor','channel':_0x5ce72a['destinationchannel'],'mixmonitorid':_0xfa4cfb['mixmonitorid']})[_0xd75e('0x1d')](function(_0x1512a0){});}})[_0xd75e('0x1b')](function(_0x467195){var _0x4834f9=_['find'](_0x5ce72a[_0xd75e('0x63')],{'mixmonitorid':_0xfa4cfb['mixmonitorid']});if(_0x4834f9){_0x4834f9['status']=_0xd75e('0x6e');}})['then'](function(){var _0x457400=util['format'](_0xd75e('0x5c'),_0xfa4cfb[_0xd75e('0x5d')]||_0xfa4cfb[_0xd75e('0x5b')],_0xfa4cfb[_0xd75e('0x6')]||_0xd75e('0x5e'));var _0x4aa3db=_[_0xd75e('0x5a')](_0x5ce72a[_0xd75e('0x63')],{'filename':_0xd75e('0x61')+_0x457400[_0xd75e('0x62')]()});if(_0x4aa3db){_0x4aa3db[_0xd75e('0x67')]=_0xd75e('0x6e');}})[_0xd75e('0x1b')](function(){_0xc072da({'code':0xc8,'message':[_0xfa4cfb['uniqueid'],_0xd75e('0x6f')]['join']('\x20')});})[_0xd75e('0x1d')](function(_0x16fbea){_0xa2cf3(_0x534f90[_0xd75e('0x10')](0x1f5,[_0xfa4cfb[_0xd75e('0x5b')],_0x16fbea[_0xd75e('0x1c')][_0xd75e('0x62')]()][_0xd75e('0x14')]('\x20')));});}else{return _0xa2cf3(_0x534f90[_0xd75e('0x10')](0x1f5,_0xd75e('0x69')));}});},'VoiceQueuesChannels':function(_0x26e1d9){return new Promise(function(_0x2b3845,_0x44853d){var _0x488043=_[_0xd75e('0x70')](_0x47b347['queueChannels']);_0x2b3845({'count':_0x488043[_0xd75e('0x57')],'rows':_0x488043});});},'VoiceQueuesChannel':function(_0x4a08fa){var _0x40030a=this;return new Promise(function(_0x3c6f7b,_0x107549){var _0x16d9e6=schema(properties[_0xd75e('0x71')])[_0xd75e('0x2')](_0x4a08fa);if(_0x16d9e6[_0xd75e('0x57')]>0x0){return _0x107549(_0x40030a[_0xd75e('0x10')](0x1f4,_[_0xd75e('0x72')](_0x16d9e6,_0xd75e('0x1c'))['join'](',\x20')));}var _0x28aa07=_[_0xd75e('0x5a')](_0x47b347[_0xd75e('0x73')],{'uniqueid':_0x4a08fa[_0xd75e('0x5b')]});if(_0x28aa07){_0x3c6f7b(_0x28aa07);}else{return _0x107549(_0x40030a['error'](0x1f5,_0xd75e('0x69')));}});},'VoiceQueuesChannelHangup':function(_0x291cbd){var _0xa6d08c=this;return new Promise(function(_0x2c2fdc,_0x11383d){if(ami[_0xd75e('0x6a')]()==![]){return _0x11383d(_0xa6d08c[_0xd75e('0x10')](0x1f4,[config['asterisk']['ip'],config[_0xd75e('0x11')][_0xd75e('0x12')],_0xd75e('0x13')]['join']('\x20')));}var _0x4372e6=schema(properties[_0xd75e('0x74')])[_0xd75e('0x2')](_0x291cbd);if(_0x4372e6[_0xd75e('0x57')]>0x0){return _0x11383d(_0xa6d08c[_0xd75e('0x10')](0x1f4,_[_0xd75e('0x72')](_0x4372e6,_0xd75e('0x1c'))[_0xd75e('0x14')](',\x20')));}var _0x1167ae=_['find'](_0x47b347[_0xd75e('0x73')],{'uniqueid':_0x291cbd[_0xd75e('0x5b')]});if(_0x1167ae&&_0x1167ae[_0xd75e('0x60')]){return ami[_0xd75e('0x1a')]({'action':'Hangup','channel':_0x1167ae[_0xd75e('0x60')]})[_0xd75e('0x1b')](function(_0x663a2d){_0x2c2fdc({'code':0xc8,'message':[_0x291cbd[_0xd75e('0x5b')],_0x663a2d['message'][_0xd75e('0x62')]()][_0xd75e('0x14')]('\x20')});})[_0xd75e('0x1d')](function(_0x4f3142){_0x11383d(_0xa6d08c[_0xd75e('0x10')](0x1f5,[_0x291cbd[_0xd75e('0x5b')],_0x4f3142[_0xd75e('0x1c')][_0xd75e('0x62')]()][_0xd75e('0x14')]('\x20')));});}else{return _0x11383d(_0xa6d08c[_0xd75e('0x10')](0x1f5,_0xd75e('0x69')));}});},'VoiceQueuesChannelRedirect':function(_0x124b51){var _0x257ba7=this;return new Promise(function(_0x25942c,_0x7f181b){if(ami[_0xd75e('0x6a')]()==![]){return _0x7f181b(_0x257ba7[_0xd75e('0x10')](0x1f4,[config[_0xd75e('0x11')]['ip'],config['asterisk']['username'],_0xd75e('0x13')][_0xd75e('0x14')]('\x20')));}var _0x4ee15e=schema(properties[_0xd75e('0x75')])[_0xd75e('0x2')](_0x124b51);if(_0x4ee15e[_0xd75e('0x57')]>0x0){return _0x7f181b(_0x257ba7[_0xd75e('0x10')](0x1f4,_[_0xd75e('0x72')](_0x4ee15e,'message')['join'](',\x20')));}var _0x32692d=_['find'](_0x47b347[_0xd75e('0x73')],{'uniqueid':_0x124b51[_0xd75e('0x5b')]});if(_0x32692d&&_0x32692d['channel']){return ami[_0xd75e('0x1a')]({'action':_0xd75e('0x76'),'channel':_0x32692d[_0xd75e('0x60')],'exten':_0x124b51[_0xd75e('0x77')],'context':_0x124b51['context']||_0x32692d[_0xd75e('0x78')],'priority':0x1})['then'](function(_0x77edcb){_0x25942c({'code':0xc8,'message':[_0x124b51[_0xd75e('0x5b')],_0x77edcb[_0xd75e('0x1c')][_0xd75e('0x62')]()]['join']('\x20')});})['catch'](function(_0x269abf){_0x7f181b(_0x257ba7[_0xd75e('0x10')](0x1f5,[_0x124b51[_0xd75e('0x5b')],_0x269abf[_0xd75e('0x1c')][_0xd75e('0x62')]()][_0xd75e('0x14')]('\x20')));});}else{return _0x7f181b(_0x257ba7[_0xd75e('0x10')](0x1f5,_0xd75e('0x69')));}});},'Agents':function(_0x387355){return new Promise(function(_0x119594,_0x35f4dc){var _0x38b691=_[_0xd75e('0x70')](_0x47b347[_0xd75e('0xc')]);_0x119594({'count':_0x38b691[_0xd75e('0x57')],'rows':_0x38b691});});},'Telephones':function(_0x33f61e){return new Promise(function(_0x368d8a,_0x1138ca){var _0xbce5ad=_[_0xd75e('0x70')](_0x47b347['telephones']);_0x368d8a({'count':_0xbce5ad[_0xd75e('0x57')],'rows':_0xbce5ad});});},'Trunks':function(_0x142cfe){return new Promise(function(_0x353b8f,_0x542cd2){var _0x1d790f=_[_0xd75e('0x70')](_0x47b347[_0xd75e('0x79')]);_0x353b8f({'count':_0x1d790f[_0xd75e('0x57')],'rows':_0x1d790f});});},'OutboundChannels':function(_0xb5df10){return new Promise(function(_0x2f3d1e,_0xaa8d76){var _0x2adac6=_['values'](_0x47b347[_0xd75e('0x7a')]);_0x2f3d1e({'count':_0x2adac6[_0xd75e('0x57')],'rows':_0x2adac6});});},'Outbound':function(_0x4882fe){return new Promise(function(_0x188bf0,_0x3217ba){_0x188bf0(_0x47b347[_0xd75e('0x7b')]);});},'Campaigns':function(_0x40f1d7){return new Promise(function(_0x2948fd,_0xfa1757){var _0x1767e3=_['values'](_0x47b347[_0xd75e('0x7c')]);_0x2948fd({'count':_0x1767e3[_0xd75e('0x57')],'rows':_0x1767e3});});},'VoiceQueuesPreview':function(_0x269d80){var _0x5459a2=this;return new Promise(function(_0x1e2516,_0x5d7a5b){_0x2682c0[_0xd75e('0x7d')](_0x269d80['id'])[_0xd75e('0x1b')](function(_0x441655){_0x1e2516({'code':0xc8,'message':_0x441655['message']});})[_0xd75e('0x1d')](function(_0x20ab81){_0x5d7a5b(_0x5459a2[_0xd75e('0x10')](0x1f4,_0x20ab81[_0xd75e('0x1c')]));});});},'EventManager':function(_0x18d345){var _0x38226a=this;return new Promise(function(_0x35947b,_0x1d45b6){if(!_0x18d345[_0xd75e('0x7e')]){return _0x1d45b6(_0x38226a['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit']('custom:'+_0x18d345['event'],_0x18d345['message']);_0x35947b({'code':0xc8,'message':_0x18d345});});},'FaxAccounts':function(_0x3ac5e0){return new Promise(function(_0x28841d,_0x11244d){var _0x5d76a4=_['values'](_0x47b347[_0xd75e('0x7f')]);_0x28841d({'count':_0x5d76a4['length'],'rows':_0x5d76a4});});},'SendFax':function(_0x32b067){var _0xf86fcd=this;return new Promise(function(_0xf0cd9c,_0x2f11aa){_0x1df14e[_0xd75e('0x80')](_0x32b067)[_0xd75e('0x1b')](function(_0x5e8fe4){_0xf0cd9c({'code':0xc8,'message':_0x5e8fe4['message']});})[_0xd75e('0x1d')](function(_0x4b171f){_0x2f11aa(_0xf86fcd['error'](0x1f4,_0x4b171f[_0xd75e('0x1c')]));});});},'CheckAfterSend':function(_0x4d1d7c){var _0x467002=this;return new Promise(function(_0x82dfe6,_0x29766a){_0x1df14e['checkAfterSend'](_0x4d1d7c)[_0xd75e('0x1b')](function(_0x1c6570){_0x82dfe6({'code':0xc8,'message':_0x1c6570[_0xd75e('0x1c')]});})[_0xd75e('0x1d')](function(_0x5d7c8a){_0x29766a(_0x467002[_0xd75e('0x10')](0x1f4,_0x5d7c8a['message']));});});}};var _0x46a39a=jayson['server'](_0x4a1a54)[_0xd75e('0x81')]();_0x46a39a['on'](_0xd75e('0x10'),function(_0x387166){return _0x52085f(_0x387166);});_0x46a39a[_0xd75e('0x82')](0x232a,_0xd75e('0x83'),function(){console[_0xd75e('0x84')](_0xd75e('0x85'),0x232a);return _0x367820('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 1fa5962..f2136e8 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 _0x722a=['toLowerCase','merge','createContact','user:%s','catch','error','Error\x20creating\x20contact','util','lodash','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','stringify','emit','exec','autoCreate','data1','calleridnum','isNil','routeId','firstName','calleridname','','uniqueid','destcalleridname','destcalleridnum','phone','resolve','then','showContact','omit','xmd-contactid2','format','name','trigger:%s','action'];(function(_0x50367a,_0x4d4853){var _0x7eee81=function(_0x1f4bc4){while(--_0x1f4bc4){_0x50367a['push'](_0x50367a['shift']());}};_0x7eee81(++_0x4d4853);}(_0x722a,0xd4));var _0xa722=function(_0x104861,_0x368f40){_0x104861=_0x104861-0x0;var _0x2b86b7=_0x722a[_0x104861];return _0x2b86b7;};'use strict';var BPromise=require('bluebird');var util=require(_0xa722('0x0'));var _=require(_0xa722('0x1'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0xa722('0x2'))(_0xa722('0x3'));var cmContactRpc=require(_0xa722('0x4'));config[_0xa722('0x5')]=_[_0xa722('0x6')](config[_0xa722('0x5')],{'host':_0xa722('0x7'),'port':0x18eb});var io=require(_0xa722('0x8'))(new Redis(config[_0xa722('0x5')]));function emit(_0x2a4e6b,_0x7a92e4,_0x100120){logger[_0xa722('0x9')](_0x2a4e6b,_0x7a92e4,JSON[_0xa722('0xa')](_0x100120));io['to'](_0x2a4e6b)[_0xa722('0xb')](_0x7a92e4,_0x100120);}exports[_0xa722('0xc')]=function(_0x400ecc,_0x1db430,_0x2617cc){_0x2617cc[_0xa722('0xd')]=0x0;if(_0x1db430['data2']&&parseInt(_0x1db430['data2'],0xa)){var _0xe1bcd4={'ListId':parseInt(_0x1db430[_0xa722('0xe')],0xa),'phone':_0x2617cc[_0xa722('0xf')]};if(_[_0xa722('0x10')](_0x2617cc[_0xa722('0x11')])){_0xe1bcd4[_0xa722('0x12')]=_0x2617cc[_0xa722('0x13')]&&_0x2617cc[_0xa722('0x13')]!==_0xa722('0x14')?_0x2617cc[_0xa722('0x13')]:_0x2617cc[_0xa722('0xf')]||_0x2617cc[_0xa722('0x15')];}else{_0xe1bcd4['firstName']=_0x2617cc[_0xa722('0x16')]&&_0x2617cc['destcalleridname']!==_0xa722('0x14')?_0x2617cc[_0xa722('0x16')]:_0x2617cc[_0xa722('0x17')]||_0x2617cc['uniqueid'];_0xe1bcd4[_0xa722('0x18')]=_0x2617cc[_0xa722('0x16')]&&_0x2617cc[_0xa722('0x16')]!==_0xa722('0x14')?_0x2617cc[_0xa722('0x16')]:_0x2617cc[_0xa722('0x17')]||_0x2617cc[_0xa722('0x15')];}BPromise[_0xa722('0x19')]()[_0xa722('0x1a')](cmContactRpc[_0xa722('0x1b')]({'where':_[_0xa722('0x1c')](_0xe1bcd4,[_0xa722('0x12')])}))[_0xa722('0x1a')](function(_0x4eece1){if(_0x4eece1){_0x2617cc[_0xa722('0x1d')]=_0x4eece1['id'];emit(util[_0xa722('0x1e')]('user:%s',_0x400ecc[_0xa722('0x1f')]),util[_0xa722('0x1e')](_0xa722('0x20'),_0x1db430[_0xa722('0x21')][_0xa722('0x22')]()),_[_0xa722('0x23')](_0x2617cc,{'ListId':parseInt(_0x1db430[_0xa722('0xe')],0xa)}));return;}else{return BPromise[_0xa722('0x19')]()[_0xa722('0x1a')](cmContactRpc[_0xa722('0x24')](_0xe1bcd4));}})['then'](function(_0x3be491){if(_0x3be491){_0x2617cc[_0xa722('0x1d')]=_0x3be491['id'];emit(util['format'](_0xa722('0x25'),_0x400ecc[_0xa722('0x1f')]),util[_0xa722('0x1e')](_0xa722('0x20'),_0x1db430['action'][_0xa722('0x22')]()),_['merge'](_0x2617cc,{'ListId':parseInt(_0x1db430[_0xa722('0xe')],0xa)}));}})[_0xa722('0x26')](function(_0x117098){logger[_0xa722('0x27')](_0xa722('0x28'),JSON[_0xa722('0xa')](_0x117098));});}else{if(_0x400ecc){emit(util['format'](_0xa722('0x25'),_0x400ecc[_0xa722('0x1f')]),util['format'](_0xa722('0x20'),_0x1db430['action'][_0xa722('0x22')]()),_['merge']({'ListId':parseInt(_0x1db430['data1'],0xa)},_0x2617cc));}}}; \ No newline at end of file +var _0xc1cf=['ioredis','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','stringify','exec','autoCreate','data2','data1','isNil','routeId','calleridname','','calleridnum','uniqueid','firstName','destcalleridname','destcalleridnum','resolve','then','showContact','omit','xmd-contactid2','format','user:%s','name','trigger:%s','action','toLowerCase','catch','error','util','lodash'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xc1cf,0x17a));var _0xfc1c=function(_0x59892f,_0x1666cc){_0x59892f=_0x59892f-0x0;var _0x4525d9=_0xc1cf[_0x59892f];return _0x4525d9;};'use strict';var BPromise=require('bluebird');var util=require(_0xfc1c('0x0'));var _=require(_0xfc1c('0x1'));var Redis=require(_0xfc1c('0x2'));var config=require(_0xfc1c('0x3'));var logger=require(_0xfc1c('0x4'))('trigger');var cmContactRpc=require(_0xfc1c('0x5'));config[_0xfc1c('0x6')]=_[_0xfc1c('0x7')](config[_0xfc1c('0x6')],{'host':_0xfc1c('0x8'),'port':0x18eb});var io=require(_0xfc1c('0x9'))(new Redis(config[_0xfc1c('0x6')]));function emit(_0xa815d9,_0xd6feb2,_0x437cf8){logger[_0xfc1c('0xa')](_0xa815d9,_0xd6feb2,JSON[_0xfc1c('0xb')](_0x437cf8));io['to'](_0xa815d9)['emit'](_0xd6feb2,_0x437cf8);}exports[_0xfc1c('0xc')]=function(_0x256a2c,_0x509917,_0x111d8e){_0x111d8e[_0xfc1c('0xd')]=0x0;if(_0x509917[_0xfc1c('0xe')]&&parseInt(_0x509917[_0xfc1c('0xe')],0xa)){var _0x3cb69c={'ListId':parseInt(_0x509917[_0xfc1c('0xf')],0xa),'phone':_0x111d8e['calleridnum']};if(_[_0xfc1c('0x10')](_0x111d8e[_0xfc1c('0x11')])){_0x3cb69c['firstName']=_0x111d8e[_0xfc1c('0x12')]&&_0x111d8e[_0xfc1c('0x12')]!==_0xfc1c('0x13')?_0x111d8e[_0xfc1c('0x12')]:_0x111d8e[_0xfc1c('0x14')]||_0x111d8e[_0xfc1c('0x15')];}else{_0x3cb69c[_0xfc1c('0x16')]=_0x111d8e[_0xfc1c('0x17')]&&_0x111d8e[_0xfc1c('0x17')]!==_0xfc1c('0x13')?_0x111d8e[_0xfc1c('0x17')]:_0x111d8e[_0xfc1c('0x18')]||_0x111d8e[_0xfc1c('0x15')];_0x3cb69c['phone']=_0x111d8e['destcalleridname']&&_0x111d8e[_0xfc1c('0x17')]!==_0xfc1c('0x13')?_0x111d8e[_0xfc1c('0x17')]:_0x111d8e['destcalleridnum']||_0x111d8e['uniqueid'];}BPromise[_0xfc1c('0x19')]()[_0xfc1c('0x1a')](cmContactRpc[_0xfc1c('0x1b')]({'where':_[_0xfc1c('0x1c')](_0x3cb69c,[_0xfc1c('0x16')])}))[_0xfc1c('0x1a')](function(_0x259645){if(_0x259645){_0x111d8e[_0xfc1c('0x1d')]=_0x259645['id'];emit(util[_0xfc1c('0x1e')](_0xfc1c('0x1f'),_0x256a2c[_0xfc1c('0x20')]),util[_0xfc1c('0x1e')](_0xfc1c('0x21'),_0x509917[_0xfc1c('0x22')][_0xfc1c('0x23')]()),_['merge'](_0x111d8e,{'ListId':parseInt(_0x509917[_0xfc1c('0xf')],0xa)}));return;}else{return BPromise['resolve']()[_0xfc1c('0x1a')](cmContactRpc['createContact'](_0x3cb69c));}})['then'](function(_0x2088a6){if(_0x2088a6){_0x111d8e[_0xfc1c('0x1d')]=_0x2088a6['id'];emit(util[_0xfc1c('0x1e')](_0xfc1c('0x1f'),_0x256a2c['name']),util['format'](_0xfc1c('0x21'),_0x509917[_0xfc1c('0x22')][_0xfc1c('0x23')]()),_['merge'](_0x111d8e,{'ListId':parseInt(_0x509917[_0xfc1c('0xf')],0xa)}));}})[_0xfc1c('0x24')](function(_0x4597cf){logger[_0xfc1c('0x25')]('Error\x20creating\x20contact',JSON[_0xfc1c('0xb')](_0x4597cf));});}else{if(_0x256a2c){emit(util[_0xfc1c('0x1e')](_0xfc1c('0x1f'),_0x256a2c[_0xfc1c('0x20')]),util[_0xfc1c('0x1e')](_0xfc1c('0x21'),_0x509917[_0xfc1c('0x22')]['toLowerCase']()),_['merge']({'ListId':parseInt(_0x509917[_0xfc1c('0xf')],0xa)},_0x111d8e));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 952cf36..8ea4144 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 _0x4a3a=['redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','emit','stringify','prototype','clone','checkTriggers','interface','hasOwnProperty','status','checkTrigger','Actions','length','action','toLowerCase','contactmanager','browser','TemplateId','html','data2','render','template\x20not\x20found','uri','isNil','data3','data4','location','uriLocation','windowWidth','800','data5','data6','600','format','user:%s','agents','trigger:%s:%s','jscripty','name','trigger:%s','merge','exec','integration','queue','urlforward','script','buildUri','parse','query','search','checkConditions','channel','AnyConditions','some','field','account','ChatWebsiteId','operator','upperFirst','AccountId','interaction','message','event','value','membername','lastevent','routeId','exports','util','lodash','url','mustache','ioredis','./integration','./script','../../../config/environment','../../../config/logger','../ami'];(function(_0x48a40e,_0x4eb2c7){var _0x537980=function(_0x55a980){while(--_0x55a980){_0x48a40e['push'](_0x48a40e['shift']());}};_0x537980(++_0x4eb2c7);}(_0x4a3a,0x140));var _0xa4a3=function(_0x147341,_0x46307e){_0x147341=_0x147341-0x0;var _0x26b6ce=_0x4a3a[_0x147341];return _0x26b6ce;};'use strict';var util=require(_0xa4a3('0x0'));var _=require(_0xa4a3('0x1'));var url=require(_0xa4a3('0x2'));var Mustache=require(_0xa4a3('0x3'));var Redis=require(_0xa4a3('0x4'));var urlforward=require('./urlforward');var integration=require(_0xa4a3('0x5'));var cmContact=require('./cmContact');var script=require(_0xa4a3('0x6'));var cmContactRpc=require('../rpc/cmContact');var config=require(_0xa4a3('0x7'));var logger=require(_0xa4a3('0x8'))('trigger');var ami=require(_0xa4a3('0x9'));config[_0xa4a3('0xa')]=_[_0xa4a3('0xb')](config[_0xa4a3('0xa')],{'host':_0xa4a3('0xc'),'port':0x18eb});var io=require(_0xa4a3('0xd'))(new Redis(config[_0xa4a3('0xa')]));var operators={'equals':function(_0xd6e12,_0x263d1a){return _0xd6e12==_0x263d1a;},'not_equals':function(_0x381a9f,_0x329bda){return _0x381a9f!=_0x329bda;}};var barAndWebActions=[_0xa4a3('0xe'),'url',_0xa4a3('0xf')];function Trigger(_0x1ebaa0){this['triggers']=_0x1ebaa0[_0xa4a3('0x10')];this['agents']=_0x1ebaa0['agents'];this[_0xa4a3('0x11')]=_0x1ebaa0[_0xa4a3('0x11')];this[_0xa4a3('0x12')]=_0x1ebaa0[_0xa4a3('0x12')];this['voiceExtensions']=_0x1ebaa0[_0xa4a3('0x13')];this[_0xa4a3('0x14')]=_0x1ebaa0[_0xa4a3('0x14')];this[_0xa4a3('0x15')]=_0x1ebaa0[_0xa4a3('0x15')];this[_0xa4a3('0x16')]=_0x1ebaa0[_0xa4a3('0x16')];this[_0xa4a3('0x17')]=_0x1ebaa0[_0xa4a3('0x17')];this['zohoAccounts']=_0x1ebaa0[_0xa4a3('0x18')];this[_0xa4a3('0x19')]=_0x1ebaa0[_0xa4a3('0x19')];this['vtigerAccounts']=_0x1ebaa0[_0xa4a3('0x1a')];this[_0xa4a3('0x1b')]=_0x1ebaa0[_0xa4a3('0x1b')];this[_0xa4a3('0x1c')]=_0x1ebaa0[_0xa4a3('0x1c')];this[_0xa4a3('0x1d')]={'zendesk':this['zendeskAccounts'],'salesforce':this['salesforceAccounts'],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0xa4a3('0x17')],'zoho':this['zohoAccounts'],'desk':this['deskAccounts'],'vtiger':this['vtigerAccounts'],'servicenow':this[_0xa4a3('0x1b')],'dynamics365':this['dynamics365Accounts']};ami['on'](_0xa4a3('0x1e'),this[_0xa4a3('0x1f')][_0xa4a3('0x20')](this));ami['on'](_0xa4a3('0x21'),this[_0xa4a3('0x1f')]['bind'](this));ami['on'](_0xa4a3('0x22'),this[_0xa4a3('0x1f')][_0xa4a3('0x20')](this));ami['on']('custom:agentcomplete',this[_0xa4a3('0x1f')][_0xa4a3('0x20')](this));ami['on'](_0xa4a3('0x23'),this[_0xa4a3('0x1f')]['bind'](this));ami['on'](_0xa4a3('0x24'),this[_0xa4a3('0x25')]['bind'](this));ami['on'](_0xa4a3('0x26'),this[_0xa4a3('0x25')]['bind'](this));ami['on']('custom:dialend',this[_0xa4a3('0x25')][_0xa4a3('0x20')](this));ami['on'](_0xa4a3('0x27'),this['syncCustomEvent'][_0xa4a3('0x20')](this));ami['on'](_0xa4a3('0x28'),this['syncCustomEvent'][_0xa4a3('0x20')](this));ami['on']('custom:incomingmessage',this[_0xa4a3('0x1f')][_0xa4a3('0x20')](this));ami['on'](_0xa4a3('0x29'),this[_0xa4a3('0x1f')][_0xa4a3('0x20')](this));ami['on'](_0xa4a3('0x2a'),this['syncCustomEvent']['bind'](this));ami['on'](_0xa4a3('0x2b'),this[_0xa4a3('0x1f')]['bind'](this));}Trigger['prototype'][_0xa4a3('0x2c')]=function(_0x5dca9b,_0x321977,_0x5b585f){logger['info'](_0x5dca9b,_0x321977,JSON[_0xa4a3('0x2d')](_0x5b585f));io['to'](_0x5dca9b)[_0xa4a3('0x2c')](_0x321977,_0x5b585f);};Trigger[_0xa4a3('0x2e')][_0xa4a3('0x1f')]=function(_0x1ff872){var _0x3d2226=_[_0xa4a3('0x2f')](_0x1ff872);this[_0xa4a3('0x30')](_0x3d2226);};Trigger[_0xa4a3('0x2e')][_0xa4a3('0x25')]=function(_0x1c1099){if(this['agents'][_0x1c1099[_0xa4a3('0x31')]]){this[_0xa4a3('0x1f')](_0x1c1099);}};Trigger[_0xa4a3('0x2e')][_0xa4a3('0x30')]=function(_0x3b33ea){var _0xaa9396;for(var _0x4908d8 in this['triggers']){if(this[_0xa4a3('0x10')][_0xa4a3('0x32')](_0x4908d8)){if(this[_0xa4a3('0x10')][_0x4908d8][_0xa4a3('0x33')]){_0xaa9396=this[_0xa4a3('0x34')](this['triggers'][_0x4908d8],_0x3b33ea);if(_0xaa9396){_['merge'](_0x3b33ea,_0x3b33ea['variables']);for(var _0x356fcf=0x0,_0x276b8c,_0x36a2a2,_0x1f66ac;_0x356fcf0x0){_0x199061=_['map'](_0xa2fc23,_0xca10c9);}return _0x199061;}function getCustomFields(_0x13221e,_0x2b82fe){var _0x3e9304=[];var _0x2f14c2={'custom_fields':{}};if(_0x13221e[_0xc6c0('0x28')]>0x0){_['forEach'](_0x13221e,function(_0x5d595d){if(_0x5d595d[_0xc6c0('0x29')]===_0xc6c0('0x2a')&&_0x5d595d['nameField']&&!_0x5d595d[_0xc6c0('0x2b')]){_0x2f14c2[_0x5d595d[_0xc6c0('0x2c')][_0xc6c0('0x2d')]()]=_0x5d595d[_0xc6c0('0x2e')][_0xc6c0('0x2f')]();}else if(_0x5d595d['type']===_0xc6c0('0x2a')&&_0x5d595d['idField']&&_0x5d595d[_0xc6c0('0x2b')]){_0x2f14c2['custom_fields'][_0x5d595d[_0xc6c0('0x30')]]=_0x5d595d['content'][_0xc6c0('0x2f')]();}else if(_0x5d595d[_0xc6c0('0x29')]===_0xc6c0('0x31')&&_0x5d595d[_0xc6c0('0x32')]&&_0x5d595d[_0xc6c0('0x30')]&&_0x5d595d[_0xc6c0('0x2b')]){_0x2b82fe[_0x5d595d[_0xc6c0('0x32')]]&&(_0x2f14c2[_0xc6c0('0x33')][_0x5d595d['idField']]=_0x2b82fe[_0x5d595d[_0xc6c0('0x32')]][_0xc6c0('0x2f')]());}else if(_0x5d595d[_0xc6c0('0x29')]==='customVariable'&&_0x5d595d[_0xc6c0('0x34')]&&_0x5d595d[_0xc6c0('0x34')][_0xc6c0('0x35')]&&_0x5d595d[_0xc6c0('0x30')]&&_0x5d595d[_0xc6c0('0x2b')]){_0x2b82fe[_0x5d595d[_0xc6c0('0x34')]['name'][_0xc6c0('0x2d')]()]&&(_0x2f14c2[_0xc6c0('0x33')][_0x5d595d[_0xc6c0('0x30')]]=_0x2b82fe[_0x5d595d[_0xc6c0('0x34')][_0xc6c0('0x35')]['toLowerCase']()][_0xc6c0('0x2f')]());}});}if(_0x2f14c2[_0xc6c0('0x36')]){_0x2f14c2['priority']=Number(_0x2f14c2['priority']);}return _0x2f14c2;}function getTicket(_0xe1f85c,_0x6752a1,_0x5728ff,_0x198f9a,_0x163588){logger[_0xc6c0('0x13')](_0xc6c0('0x37'));var _0x29388c=_[_0xc6c0('0x38')]({'subject':intUtil[_0xc6c0('0x39')](_0x198f9a[_0xc6c0('0x3a')],_0x163588,'\x20'),'type':_0xc6c0('0x3b'),'status':_0xc6c0('0x3c'),'labels':[_0xc6c0('0x3d'),_0xc6c0('0x3e'),'CTI'][_0xc6c0('0x3f')](getTags(_0x198f9a[_0xc6c0('0x40')],_0xc6c0('0x35'))),'description':intUtil[_0xc6c0('0x39')](_0x198f9a[_0xc6c0('0x41')],_0x163588,'\x0a'),'_links':{'assigned_user':{'href':util[_0xc6c0('0xf')]('/api/v2/users/%d',_0x6752a1['id']),'class':_0xc6c0('0x42')}},'message':{'direction':'in','body':intUtil[_0xc6c0('0x39')](_0x198f9a[_0xc6c0('0x41')],_0x163588,'\x0a')}},getCustomFields(_0x198f9a['Fields'],_0x163588));return request({'uri':util[_0xc6c0('0xf')]('%s/customers/%d/cases',_0xe1f85c[_0xc6c0('0x16')],_0x5728ff['id']),'method':_0xc6c0('0x43'),'body':_0x29388c});}exports[_0xc6c0('0x44')]=function(_0x5da1db,_0x426170,_0x1af86f,_0x1e3ab3,_0x5d11a7,_0x2d4548){var _0x4f4ad2,_0x2b98d2;_0x2d4548[_0xc6c0('0x16')]=intUtil['stripTrailingSlash'](_0x2d4548['remoteUri']);_0x2d4548[_0xc6c0('0x45')]=intUtil[_0xc6c0('0x46')](_0x2d4548[_0xc6c0('0x45')]);if(_0x5d11a7&&_0x5d11a7[_0xc6c0('0x47')]){logger[_0xc6c0('0x13')](_0xc6c0('0x48'),_0xc6c0('0x49'));_0x426170[_0xc6c0('0x4a')]=util['format'](_0xc6c0('0x4b'),_0x2d4548[_0xc6c0('0x45')],_0x426170[_0xc6c0('0x4c')],md5(_0x426170['uniqueid']));}else{_0x426170[_0xc6c0('0x4a')]='';}headers[_0xc6c0('0x4d')]=getAuth(_0x2d4548);return getUser(_0x2d4548,_0x1e3ab3[_0xc6c0('0x4e')])[_0xc6c0('0x11')](function(_0x55f2bf){_0x4f4ad2=_0x55f2bf;logger[_0xc6c0('0x13')](_0xc6c0('0x4f'),_0x4f4ad2['id']);return getEndUser(_0x2d4548,_0x426170[_0xc6c0('0x50')],_0x426170[_0xc6c0('0x51')]);})['then'](function(_0x2bd082){_0x2b98d2=_0x2bd082;logger[_0xc6c0('0x13')]('The\x20Enduser\x20ID\x20is:',_0x2b98d2['id']);return getTicket(_0x2d4548,_0x4f4ad2,_0x2b98d2,_0x1af86f,_0x426170);})[_0xc6c0('0x11')](function(_0xfb54a1){if(_0xfb54a1){logger['info'](_0xc6c0('0x52'));logger[_0xc6c0('0x13')]('The\x20Ticket\x20ID\x20is:',_0xfb54a1['id']);switch(_0x2d4548[_0xc6c0('0x29')]){case _0xc6c0('0x53'):logger[_0xc6c0('0x13')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0xc6c0('0xf')](_0xc6c0('0x54'),_0x1e3ab3['name']),_0xc6c0('0x55'),{'recordId':_0xfb54a1['id']});break;case _0xc6c0('0x56'):logger[_0xc6c0('0x13')](_0xc6c0('0x48'),_0xc6c0('0x57'));emit(util[_0xc6c0('0xf')](_0xc6c0('0x54'),_0x1e3ab3[_0xc6c0('0x35')]),'trigger:browser:url',{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0xfb54a1['id'])});break;default:logger[_0xc6c0('0x58')](_0xc6c0('0x48'),_0xc6c0('0x59'));}}})['catch'](function(_0x74dd93){console['error'](_0x74dd93);logger[_0xc6c0('0x58')](_0xc6c0('0x48'),JSON[_0xc6c0('0x5a')](_0x74dd93));});};exports[_0xc6c0('0x5b')]=function(_0x11b4ac,_0x7b2c23,_0x3b7a45,_0x221971,_0x298d7b,_0x1eb11a,_0x317c22){var _0x52c6a4,_0x3271d4;_0x1eb11a[_0xc6c0('0x16')]=intUtil[_0xc6c0('0x46')](_0x1eb11a[_0xc6c0('0x16')]);_0x1eb11a['serverUrl']=intUtil[_0xc6c0('0x46')](_0x1eb11a['serverUrl']);if(_0x317c22&&_0x317c22[_0xc6c0('0x5c')]&&_0x317c22[_0xc6c0('0x5c')]!==_0xc6c0('0x5d')){logger['info'](_0xc6c0('0x5e'),_0xc6c0('0x49'));_0x7b2c23[_0xc6c0('0x4a')]=util[_0xc6c0('0xf')](_0xc6c0('0x4b'),_0x1eb11a[_0xc6c0('0x45')],_0x7b2c23[_0xc6c0('0x4c')],md5(_0x7b2c23[_0xc6c0('0x4c')]));}headers[_0xc6c0('0x4d')]=getAuth(_0x1eb11a);return getUser(_0x1eb11a,_0x221971[_0xc6c0('0x4e')])[_0xc6c0('0x11')](function(_0x2f0d56){_0x52c6a4=_0x2f0d56;logger[_0xc6c0('0x13')](_0xc6c0('0x4f'),_0x52c6a4['id']);return getEndUser(_0x1eb11a,_0x7b2c23['destcalleridname'],_0x7b2c23[_0xc6c0('0x5f')]);})[_0xc6c0('0x11')](function(_0x59cc80){_0x3271d4=_0x59cc80;logger[_0xc6c0('0x13')](_0xc6c0('0x60'),_0x3271d4['id']);return getTicket(_0x1eb11a,_0x52c6a4,_0x3271d4,_0x3b7a45,_0x7b2c23);})['then'](function(_0x3bbe21){if(_0x3bbe21){logger[_0xc6c0('0x13')](_0xc6c0('0x52'));logger['info'](_0xc6c0('0x61'),_0x3bbe21['id']);switch(_0x1eb11a[_0xc6c0('0x29')]){case _0xc6c0('0x53'):logger[_0xc6c0('0x13')](_0xc6c0('0x48'),_0xc6c0('0x62'));emit(util['format'](_0xc6c0('0x54'),_0x221971['name']),'trigger:desk:display',{'recordId':_0x3bbe21['id']});break;case _0xc6c0('0x56'):logger[_0xc6c0('0x13')](_0xc6c0('0x48'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc6c0('0xf')]('user:%s',_0x221971[_0xc6c0('0x35')]),_0xc6c0('0x63'),{'uri':util[_0xc6c0('0xf')](_0xc6c0('0x64'),_0x1eb11a[_0xc6c0('0x16')],_0x3bbe21['id'])});break;default:logger[_0xc6c0('0x58')]('[OUTBOUND]','Desk\x20account\x20type\x20not\x20recognized');}}})[_0xc6c0('0x65')](function(_0x241747){logger[_0xc6c0('0x58')]('[OUTBOUND]',JSON['stringify'](_0x241747));});};exports[_0xc6c0('0x66')]=function(_0x28f90f,_0x4d7c96,_0x5eda99,_0x95483b,_0x297be6,_0x46ab30){var _0x34d2d6,_0x2106ff;_0x46ab30[_0xc6c0('0x16')]=intUtil[_0xc6c0('0x46')](_0x46ab30[_0xc6c0('0x16')]);_0x46ab30[_0xc6c0('0x45')]=intUtil[_0xc6c0('0x46')](_0x46ab30[_0xc6c0('0x45')]);if(_0x297be6&&_0x297be6[_0xc6c0('0x47')]){logger[_0xc6c0('0x13')](_0xc6c0('0x67'),_0xc6c0('0x49'));_0x4d7c96[_0xc6c0('0x4a')]=util[_0xc6c0('0xf')](_0xc6c0('0x4b'),_0x46ab30[_0xc6c0('0x45')],_0x4d7c96[_0xc6c0('0x4c')],md5(_0x4d7c96[_0xc6c0('0x4c')]));}else{_0x4d7c96[_0xc6c0('0x4a')]='';}headers[_0xc6c0('0x4d')]=getAuth(_0x46ab30);return getUser(_0x46ab30)['then'](function(_0x138f03){_0x34d2d6=_0x138f03;logger[_0xc6c0('0x13')](_0xc6c0('0x4f'),_0x34d2d6['id']);return getEndUser(_0x46ab30,_0x4d7c96[_0xc6c0('0x50')],_0x4d7c96[_0xc6c0('0x51')]);})[_0xc6c0('0x11')](function(_0x107aa2){_0x2106ff=_0x107aa2;logger[_0xc6c0('0x13')](_0xc6c0('0x60'),_0x2106ff['id']);return getTicket(_0x46ab30,_0x34d2d6,_0x2106ff,_0x5eda99,_0x4d7c96);})['then'](function(_0x30157a){if(_0x30157a){logger[_0xc6c0('0x13')](_0xc6c0('0x52'));logger[_0xc6c0('0x13')](_0xc6c0('0x61'),_0x30157a['id']);}})[_0xc6c0('0x65')](function(_0x1d1c40){logger[_0xc6c0('0x58')]('[ABANDONED]',JSON[_0xc6c0('0x5a')](_0x1d1c40));});}; \ No newline at end of file +var _0x56e1=['nameField','customField','toLowerCase','content','idField','custom_fields','variableName','Variable','name','priority','merge','getString','Subjects','phone','new','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','%s/customers/%d/cases','POST','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','[OUTBOUND]','email','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','abandoned','[ABANDONED]','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','emit','application/json','validateEmail','info','format','remoteUri','then','find','_embedded','entries','Agent\x20found!','%s/users/me','debug','[HTTP]','stringify','authType','basic','username','password','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','total_entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','length','map','forEach','type','string'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0x56e1,0x1da));var _0x156e=function(_0xd9dda1,_0x260e39){_0xd9dda1=_0xd9dda1-0x0;var _0x57b03b=_0x56e1[_0xd9dda1];return _0x57b03b;};'use strict';var _=require(_0x156e('0x0'));var rp=require(_0x156e('0x1'));var md5=require(_0x156e('0x2'));var util=require(_0x156e('0x3'));var Redis=require(_0x156e('0x4'));var intUtil=require(_0x156e('0x5'));var config=require(_0x156e('0x6'));var logger=require('../../../../config/logger')(_0x156e('0x7'));config[_0x156e('0x8')]=_[_0x156e('0x9')](config[_0x156e('0x8')],{'host':_0x156e('0xa'),'port':0x18eb});var io=require(_0x156e('0xb'))(new Redis(config['redis']));function emit(_0x100a29,_0x53d0b1,_0x2948a6){io['to'](_0x100a29)[_0x156e('0xc')](_0x53d0b1,_0x2948a6);}var headers={'Content-Type':_0x156e('0xd'),'Accept':'application/json'};function getUser(_0x721555,_0x5d6863){if(intUtil[_0x156e('0xe')](_0x5d6863)===!![]){logger[_0x156e('0xf')]('Getting\x20agent\x20with\x20email',_0x5d6863);return request({'uri':util[_0x156e('0x10')]('%s/users',_0x721555[_0x156e('0x11')])})[_0x156e('0x12')](function(_0x16246f){if(_0x16246f['total_entries']){return _[_0x156e('0x13')](_0x16246f[_0x156e('0x14')][_0x156e('0x15')],{'email':_0x5d6863});}})[_0x156e('0x12')](function(_0x4202f0){if(_0x4202f0){logger[_0x156e('0xf')](_0x156e('0x16'));return _0x4202f0;}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x156e('0x10')]('%s/users/me',_0x721555[_0x156e('0x11')])});}});}else{logger[_0x156e('0xf')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x156e('0x10')](_0x156e('0x17'),_0x721555[_0x156e('0x11')])});}}function request(_0x423282){logger[_0x156e('0x18')](_0x156e('0x19'),JSON[_0x156e('0x1a')](_0x423282));return rp(_[_0x156e('0x9')](_0x423282,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0xd1d2c2){var _0x336c01;if(_0xd1d2c2[_0x156e('0x1b')]===_0x156e('0x1c')){_0x336c01=util[_0x156e('0x10')]('%s:%s',_0xd1d2c2[_0x156e('0x1d')],_0xd1d2c2[_0x156e('0x1e')]);}else if(_0xd1d2c2['authType']===_0x156e('0x1f')){_0x336c01=util[_0x156e('0x10')](_0x156e('0x20'),_0xd1d2c2[_0x156e('0x1d')],_0xd1d2c2[_0x156e('0x1f')]);}return util[_0x156e('0x10')](_0x156e('0x21'),new Buffer(_0x336c01)[_0x156e('0x22')](_0x156e('0x23')));}function getEndUser(_0x4491fb,_0x5e3496,_0x4e4cc6){logger[_0x156e('0xf')](_0x156e('0x24'),_0x4e4cc6);return request({'uri':util[_0x156e('0x10')](_0x156e('0x25'),_0x4491fb[_0x156e('0x11')]),'qs':{'phone':_0x4e4cc6}})['then'](function(_0x10f611){if(_0x10f611[_0x156e('0x26')]){logger[_0x156e('0xf')]('Enduser\x20found!');return _0x10f611[_0x156e('0x14')][_0x156e('0x15')][0x0];}else{logger[_0x156e('0xf')](_0x156e('0x27'));return request({'uri':util[_0x156e('0x10')](_0x156e('0x28'),_0x4491fb['remoteUri']),'method':'POST','body':{'first_name':_0x5e3496,'title':_0x5e3496,'phone_numbers':[{'type':'work','value':_0x4e4cc6}]}});}});}function getTags(_0x59103b,_0x3509d8){var _0x1084d0=[];if(_0x59103b&&_0x59103b[_0x156e('0x29')]>0x0){_0x1084d0=_[_0x156e('0x2a')](_0x59103b,_0x3509d8);}return _0x1084d0;}function getCustomFields(_0x338573,_0x1e01ea){var _0xf785e1=[];var _0x3313cb={'custom_fields':{}};if(_0x338573['length']>0x0){_[_0x156e('0x2b')](_0x338573,function(_0x88939f){if(_0x88939f[_0x156e('0x2c')]===_0x156e('0x2d')&&_0x88939f[_0x156e('0x2e')]&&!_0x88939f[_0x156e('0x2f')]){_0x3313cb[_0x88939f[_0x156e('0x2e')][_0x156e('0x30')]()]=_0x88939f[_0x156e('0x31')][_0x156e('0x22')]();}else if(_0x88939f[_0x156e('0x2c')]===_0x156e('0x2d')&&_0x88939f[_0x156e('0x32')]&&_0x88939f[_0x156e('0x2f')]){_0x3313cb[_0x156e('0x33')][_0x88939f[_0x156e('0x32')]]=_0x88939f[_0x156e('0x31')][_0x156e('0x22')]();}else if(_0x88939f[_0x156e('0x2c')]==='variable'&&_0x88939f[_0x156e('0x34')]&&_0x88939f[_0x156e('0x32')]&&_0x88939f[_0x156e('0x2f')]){_0x1e01ea[_0x88939f[_0x156e('0x34')]]&&(_0x3313cb[_0x156e('0x33')][_0x88939f[_0x156e('0x32')]]=_0x1e01ea[_0x88939f[_0x156e('0x34')]][_0x156e('0x22')]());}else if(_0x88939f['type']==='customVariable'&&_0x88939f['Variable']&&_0x88939f[_0x156e('0x35')]['name']&&_0x88939f[_0x156e('0x32')]&&_0x88939f[_0x156e('0x2f')]){_0x1e01ea[_0x88939f[_0x156e('0x35')][_0x156e('0x36')][_0x156e('0x30')]()]&&(_0x3313cb[_0x156e('0x33')][_0x88939f['idField']]=_0x1e01ea[_0x88939f[_0x156e('0x35')][_0x156e('0x36')][_0x156e('0x30')]()][_0x156e('0x22')]());}});}if(_0x3313cb[_0x156e('0x37')]){_0x3313cb[_0x156e('0x37')]=Number(_0x3313cb[_0x156e('0x37')]);}return _0x3313cb;}function getTicket(_0x54ba63,_0x5a2a92,_0x4f3e44,_0x6d94f8,_0x166b39){logger[_0x156e('0xf')]('Creating\x20new\x20ticket...');var _0x47e8ab=_[_0x156e('0x38')]({'subject':intUtil[_0x156e('0x39')](_0x6d94f8[_0x156e('0x3a')],_0x166b39,'\x20'),'type':_0x156e('0x3b'),'status':_0x156e('0x3c'),'labels':['xCALLY','Motion',_0x156e('0x3d')][_0x156e('0x3e')](getTags(_0x6d94f8[_0x156e('0x3f')],_0x156e('0x36'))),'description':intUtil[_0x156e('0x39')](_0x6d94f8[_0x156e('0x40')],_0x166b39,'\x0a'),'_links':{'assigned_user':{'href':util[_0x156e('0x10')](_0x156e('0x41'),_0x5a2a92['id']),'class':_0x156e('0x42')}},'message':{'direction':'in','body':intUtil[_0x156e('0x39')](_0x6d94f8[_0x156e('0x40')],_0x166b39,'\x0a')}},getCustomFields(_0x6d94f8['Fields'],_0x166b39));return request({'uri':util[_0x156e('0x10')](_0x156e('0x43'),_0x54ba63[_0x156e('0x11')],_0x4f3e44['id']),'method':_0x156e('0x44'),'body':_0x47e8ab});}exports[_0x156e('0x45')]=function(_0x1b9228,_0x2defc8,_0x2a3993,_0x36c9ec,_0x3e7625,_0x205aa4){var _0x20db48,_0x5c3b5d;_0x205aa4[_0x156e('0x11')]=intUtil[_0x156e('0x46')](_0x205aa4['remoteUri']);_0x205aa4[_0x156e('0x47')]=intUtil[_0x156e('0x46')](_0x205aa4[_0x156e('0x47')]);if(_0x3e7625&&_0x3e7625['monitor_format']){logger['info'](_0x156e('0x48'),_0x156e('0x49'));_0x2defc8[_0x156e('0x4a')]=util[_0x156e('0x10')](_0x156e('0x4b'),_0x205aa4[_0x156e('0x47')],_0x2defc8[_0x156e('0x4c')],md5(_0x2defc8['uniqueid']));}else{_0x2defc8[_0x156e('0x4a')]='';}headers[_0x156e('0x4d')]=getAuth(_0x205aa4);return getUser(_0x205aa4,_0x36c9ec['email'])[_0x156e('0x12')](function(_0x1b6133){_0x20db48=_0x1b6133;logger[_0x156e('0xf')]('The\x20User\x20ID\x20is:',_0x20db48['id']);return getEndUser(_0x205aa4,_0x2defc8[_0x156e('0x4e')],_0x2defc8[_0x156e('0x4f')]);})[_0x156e('0x12')](function(_0x33ebd0){_0x5c3b5d=_0x33ebd0;logger[_0x156e('0xf')]('The\x20Enduser\x20ID\x20is:',_0x5c3b5d['id']);return getTicket(_0x205aa4,_0x20db48,_0x5c3b5d,_0x2a3993,_0x2defc8);})[_0x156e('0x12')](function(_0x316f6c){if(_0x316f6c){logger['info']('Ticket\x20created!');logger[_0x156e('0xf')](_0x156e('0x50'),_0x316f6c['id']);switch(_0x205aa4[_0x156e('0x2c')]){case _0x156e('0x51'):logger[_0x156e('0xf')](_0x156e('0x48'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x156e('0x10')](_0x156e('0x52'),_0x36c9ec[_0x156e('0x36')]),_0x156e('0x53'),{'recordId':_0x316f6c['id']});break;case _0x156e('0x54'):logger['info'](_0x156e('0x48'),_0x156e('0x55'));emit(util['format']('user:%s',_0x36c9ec[_0x156e('0x36')]),_0x156e('0x56'),{'uri':util['format'](_0x156e('0x57'),_0x316f6c['id'])});break;default:logger[_0x156e('0x58')](_0x156e('0x48'),_0x156e('0x59'));}}})[_0x156e('0x5a')](function(_0x58cade){console[_0x156e('0x58')](_0x58cade);logger[_0x156e('0x58')](_0x156e('0x48'),JSON['stringify'](_0x58cade));});};exports[_0x156e('0x5b')]=function(_0x1d1a29,_0x49b0b6,_0x4aabd2,_0x1f865c,_0x36c349,_0x8ecc01,_0x12915b){var _0x5c9724,_0x255921;_0x8ecc01[_0x156e('0x11')]=intUtil[_0x156e('0x46')](_0x8ecc01[_0x156e('0x11')]);_0x8ecc01['serverUrl']=intUtil['stripTrailingSlash'](_0x8ecc01['serverUrl']);if(_0x12915b&&_0x12915b[_0x156e('0x5c')]&&_0x12915b[_0x156e('0x5c')]!=='none'){logger[_0x156e('0xf')](_0x156e('0x5d'),_0x156e('0x49'));_0x49b0b6[_0x156e('0x4a')]=util[_0x156e('0x10')](_0x156e('0x4b'),_0x8ecc01[_0x156e('0x47')],_0x49b0b6['uniqueid'],md5(_0x49b0b6[_0x156e('0x4c')]));}headers['Authorization']=getAuth(_0x8ecc01);return getUser(_0x8ecc01,_0x1f865c[_0x156e('0x5e')])[_0x156e('0x12')](function(_0x2437e6){_0x5c9724=_0x2437e6;logger['info'](_0x156e('0x5f'),_0x5c9724['id']);return getEndUser(_0x8ecc01,_0x49b0b6[_0x156e('0x60')],_0x49b0b6[_0x156e('0x61')]);})[_0x156e('0x12')](function(_0x551460){_0x255921=_0x551460;logger[_0x156e('0xf')](_0x156e('0x62'),_0x255921['id']);return getTicket(_0x8ecc01,_0x5c9724,_0x255921,_0x4aabd2,_0x49b0b6);})['then'](function(_0x1490d9){if(_0x1490d9){logger[_0x156e('0xf')](_0x156e('0x63'));logger[_0x156e('0xf')](_0x156e('0x50'),_0x1490d9['id']);switch(_0x8ecc01[_0x156e('0x2c')]){case _0x156e('0x51'):logger[_0x156e('0xf')](_0x156e('0x48'),_0x156e('0x64'));emit(util[_0x156e('0x10')](_0x156e('0x52'),_0x1f865c['name']),_0x156e('0x53'),{'recordId':_0x1490d9['id']});break;case _0x156e('0x54'):logger[_0x156e('0xf')](_0x156e('0x48'),_0x156e('0x55'));emit(util[_0x156e('0x10')]('user:%s',_0x1f865c['name']),_0x156e('0x56'),{'uri':util['format'](_0x156e('0x65'),_0x8ecc01[_0x156e('0x11')],_0x1490d9['id'])});break;default:logger[_0x156e('0x58')](_0x156e('0x5d'),_0x156e('0x59'));}}})[_0x156e('0x5a')](function(_0x74fa6){logger['error'](_0x156e('0x5d'),JSON[_0x156e('0x1a')](_0x74fa6));});};exports[_0x156e('0x66')]=function(_0x3bd324,_0x23f7d2,_0x310576,_0x4a2d7c,_0x5ab352,_0x5e72a7){var _0xe75893,_0x5db047;_0x5e72a7[_0x156e('0x11')]=intUtil[_0x156e('0x46')](_0x5e72a7['remoteUri']);_0x5e72a7[_0x156e('0x47')]=intUtil[_0x156e('0x46')](_0x5e72a7['serverUrl']);if(_0x5ab352&&_0x5ab352['monitor_format']){logger[_0x156e('0xf')]('[ABANDONED]',_0x156e('0x49'));_0x23f7d2['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5e72a7['serverUrl'],_0x23f7d2[_0x156e('0x4c')],md5(_0x23f7d2[_0x156e('0x4c')]));}else{_0x23f7d2['recordingURL']='';}headers[_0x156e('0x4d')]=getAuth(_0x5e72a7);return getUser(_0x5e72a7)[_0x156e('0x12')](function(_0x1343c0){_0xe75893=_0x1343c0;logger[_0x156e('0xf')](_0x156e('0x5f'),_0xe75893['id']);return getEndUser(_0x5e72a7,_0x23f7d2[_0x156e('0x4e')],_0x23f7d2[_0x156e('0x4f')]);})[_0x156e('0x12')](function(_0x553f64){_0x5db047=_0x553f64;logger['info'](_0x156e('0x62'),_0x5db047['id']);return getTicket(_0x5e72a7,_0xe75893,_0x5db047,_0x310576,_0x23f7d2);})['then'](function(_0x498a73){if(_0x498a73){logger[_0x156e('0xf')](_0x156e('0x63'));logger['info'](_0x156e('0x50'),_0x498a73['id']);}})[_0x156e('0x5a')](function(_0x1b2891){logger[_0x156e('0x58')](_0x156e('0x67'),JSON[_0x156e('0x1a')](_0x1b2891));});}; \ 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 f564372..1132f99 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 _0x2cb4=['trigger:browser:url','serverUrl','stripTrailingSlash','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','abandoned','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','md5','ioredis','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','userEmail','length','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','toLowerCase','outbound','destcalleridnum','calleridnum','/systemusers(','odata-entityid','lastIndexOf','enduserId','contacts?$select=telephone1','telephone1',']\x20Enduser\x20created!','forEach','type','string','nameField','customField','substring','indexOf','content','ticketType','incident','incidents','assign','Subjects','getString','Descriptions','/contacts(','Fields','phonecall','phonecalls','callDirection','queue','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format'];(function(_0x44ca4e,_0x4adfdb){var _0x36a969=function(_0x188676){while(--_0x188676){_0x44ca4e['push'](_0x44ca4e['shift']());}};_0x36a969(++_0x4adfdb);}(_0x2cb4,0x13e));var _0x42cb=function(_0x56f6c0,_0x37c097){_0x56f6c0=_0x56f6c0-0x0;var _0x249342=_0x2cb4[_0x56f6c0];return _0x249342;};'use strict';var _=require(_0x42cb('0x0'));var BPromise=require(_0x42cb('0x1'));var rp=require(_0x42cb('0x2'));var util=require(_0x42cb('0x3'));var intUtil=require(_0x42cb('0x4'));var md5=require(_0x42cb('0x5'));var Redis=require(_0x42cb('0x6'));var logger=require('../../../../config/logger')(_0x42cb('0x7'));var config=require(_0x42cb('0x8'));config[_0x42cb('0x9')]=_[_0x42cb('0xa')](config[_0x42cb('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x42cb('0xb'))(new Redis(config[_0x42cb('0x9')]));function getAuthToken(_0x820474,_0x2f0871,_0x54bc00){var _0x2f7f59={'method':_0x42cb('0xc'),'uri':_0x2f0871,'form':{'client_id':_0x820474[_0x42cb('0xd')],'resource':_0x820474[_0x42cb('0xe')],'username':_0x820474[_0x42cb('0xf')],'password':_0x820474[_0x42cb('0x10')],'grant_type':_0x42cb('0x10'),'client_secret':_0x820474[_0x42cb('0x11')]},'json':!![]};return rp(_0x2f7f59)[_0x42cb('0x12')](function(_0x55dfe0){return _0x55dfe0['access_token'];})[_0x42cb('0x13')](function(_0x10bf41){logger[_0x42cb('0x14')]('['+[_0x54bc00[_0x42cb('0x15')]()]+_0x42cb('0x16'));return _0x10bf41[_0x42cb('0x17')];});}function getUser(_0x2b23b6,_0x20b6d0,_0x39378e,_0x497e60,_0xfb073a,_0x15b801){return new BPromise(function(_0x1702fa,_0x439b88){return getAuthToken(_0x20b6d0,_0x497e60,_0x15b801)[_0x42cb('0x12')](function(_0x47f50c){var _0x125c0e={'method':_0x42cb('0x18'),'uri':_0xfb073a+_0x42cb('0x19'),'headers':{'Authorization':_0x42cb('0x1a')+_0x47f50c,'OData-Version':_0x42cb('0x1b')},'json':!![]};return rp(_0x125c0e);})[_0x42cb('0x12')](function(_0x4df2ab){var _0x3d0e32=_0x4df2ab[_0x42cb('0x1c')];var _0x92c180=![];var _0x5c5a6f=null;if(!_['isNil'](_0x39378e)){if(intUtil[_0x42cb('0x1d')](_0x39378e[_0x42cb('0x1e')])){_0x2b23b6[_0x42cb('0x1f')]=_0x39378e[_0x42cb('0x1e')];for(_0x5c5a6f=0x0;_0x5c5a6f<_0x3d0e32[_0x42cb('0x20')];_0x5c5a6f++){if(_0x3d0e32[_0x5c5a6f]['internalemailaddress']===_0x39378e[_0x42cb('0x1e')]&&!_0x3d0e32[_0x5c5a6f]['isdisabled']){_0x92c180=!![];logger[_0x42cb('0x21')]('['+[_0x15b801[_0x42cb('0x15')]()]+_0x42cb('0x22')+_0x3d0e32[_0x5c5a6f][_0x42cb('0x23')]+'!');_0x2b23b6[_0x42cb('0x24')]=_0x3d0e32[_0x5c5a6f][_0x42cb('0x23')];}}}}if(!_0x92c180){logger[_0x42cb('0x21')]('['+[_0x15b801[_0x42cb('0x15')]()]+_0x42cb('0x25'));_0x2b23b6[_0x42cb('0x1f')]=_0x20b6d0[_0x42cb('0xf')];for(_0x5c5a6f=0x0;_0x5c5a6f<_0x3d0e32[_0x42cb('0x20')];_0x5c5a6f++){if(_0x3d0e32[_0x5c5a6f][_0x42cb('0x26')]===_0x20b6d0['username']){_0x2b23b6[_0x42cb('0x24')]=_0x3d0e32[_0x5c5a6f]['systemuserid'];}}}_0x1702fa(_0x2b23b6);})[_0x42cb('0x13')](function(_0x31d8e4){_0x439b88(_0x31d8e4[_0x42cb('0x17')]);});});}function createEndUser(_0x464a73,_0x488401,_0x1556c2,_0x257404,_0x304fe2,_0x2053fc){return new BPromise(function(_0x306f65,_0x23511f){return getAuthToken(_0x488401,_0x1556c2,_0x2053fc)[_0x42cb('0x12')](function(_0x5abd58){var _0x1291af=_0x2053fc[_0x42cb('0x27')]()===_0x42cb('0x28')?_0x304fe2[_0x42cb('0x29')]:_0x304fe2[_0x42cb('0x2a')];var _0x16d034={'method':_0x42cb('0xc'),'uri':_0x257404+'contacts','body':{'telephone1':_0x1291af,'fullname':_0x1291af,'firstname':_0x1291af,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x42cb('0x2b')+_0x464a73['userId']+')'},'headers':{'Authorization':'Bearer\x20'+_0x5abd58,'OData-Version':_0x42cb('0x1b')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x16d034);})['then'](function(_0x3d2772){var _0x4228ef=_0x3d2772['headers'][_0x42cb('0x2c')];var _0x545630=_0x4228ef['substring'](_0x4228ef['lastIndexOf']('(')+0x1,_0x4228ef[_0x42cb('0x2d')](')'));_0x464a73[_0x42cb('0x2e')]=_0x545630;_0x306f65(_0x464a73);})['catch'](function(_0x34785e){_0x23511f(_0x34785e[_0x42cb('0x17')]);});});}function getEndUser(_0x47712c,_0x132cf9,_0x396fd3,_0xa49f4c,_0x5e0d25,_0x56d14c){return new BPromise(function(_0x499052,_0x3cb8ba){return getAuthToken(_0x132cf9,_0x396fd3,_0x56d14c)['then'](function(_0x2ebb4b){var _0x146a8b={'method':'GET','uri':_0xa49f4c+_0x42cb('0x2f'),'headers':{'Authorization':_0x42cb('0x1a')+_0x2ebb4b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x146a8b);})[_0x42cb('0x12')](function(_0x38c124){var _0x2ef0a0=null;if(_0x38c124){var _0x28bc12=_0x38c124['value'];var _0x24cc14=![];for(_0x2ef0a0=0x0;_0x2ef0a0<_0x28bc12['length'];_0x2ef0a0++){var _0x256561=_0x56d14c[_0x42cb('0x27')]()===_0x42cb('0x28')?_0x5e0d25[_0x42cb('0x29')]:_0x5e0d25[_0x42cb('0x2a')];if(_0x28bc12[_0x2ef0a0][_0x42cb('0x30')]===_0x256561){_0x24cc14=!![];_0x47712c[_0x42cb('0x2e')]=_0x28bc12[_0x2ef0a0]['contactid'];}}if(_0x24cc14){_0x499052(_0x47712c);}else{return createEndUser(_0x47712c,_0x132cf9,_0x396fd3,_0xa49f4c,_0x5e0d25,_0x56d14c)[_0x42cb('0x12')](function(_0x35e239){logger[_0x42cb('0x21')]('['+[_0x56d14c[_0x42cb('0x15')]()]+_0x42cb('0x31'),_0x35e239[_0x42cb('0x2e')]);_0x499052(_0x35e239);});}}else{return createEndUser(_0x47712c,_0x132cf9,_0x396fd3,_0xa49f4c,_0x5e0d25,_0x56d14c)[_0x42cb('0x12')](function(_0x7f4ca3){logger[_0x42cb('0x21')]('['+[_0x56d14c['toUpperCase']()]+']\x20Enduser\x20Created!',_0x7f4ca3[_0x42cb('0x2e')]);_0x499052(_0x7f4ca3);});}});});}function getCustomFields(_0x3fbcb7,_0x563669,_0x50114e){var _0x3bf9c6={};if(_0x3fbcb7[_0x42cb('0x20')]>0x0){_[_0x42cb('0x32')](_0x3fbcb7,function(_0x5097a0){if(_0x5097a0[_0x42cb('0x33')]===_0x42cb('0x34')&&_0x5097a0[_0x42cb('0x35')]&&!_0x5097a0[_0x42cb('0x36')]){var _0x60b5c5=_0x5097a0['idField'][_0x42cb('0x27')]();var _0x303a7d=_0x60b5c5[_0x42cb('0x37')](0x0,_0x60b5c5[_0x42cb('0x38')]('_'));var _0x32c55d=_0x60b5c5[_0x42cb('0x37')](_0x60b5c5[_0x42cb('0x38')]('_')+0x1);if(_0x303a7d===_0x50114e){_0x3bf9c6[_0x32c55d]=_0x5097a0[_0x42cb('0x39')];}}});}return _0x3bf9c6;}function getTicket(_0x29947f,_0x33fbe0,_0x1f7160,_0x3a0bf0,_0x4f1519,_0x264183,_0x4420f9){return new BPromise(function(_0x3bfff6,_0x373e9e){var _0x526c94;return getAuthToken(_0x33fbe0,_0x1f7160,_0x4420f9)[_0x42cb('0x12')](function(_0x4a7f7a){if(_0x264183[_0x42cb('0x3a')]===_0x42cb('0x3b')){_0x526c94={'method':'POST','uri':_0x3a0bf0+_0x42cb('0x3c'),'body':Object[_0x42cb('0x3d')]({},{'title':intUtil['getString'](_0x264183[_0x42cb('0x3e')],_0x4f1519,'\x20'),'description':intUtil[_0x42cb('0x3f')](_0x264183[_0x42cb('0x40')],_0x4f1519,'\x0a'),'customerid_contact@odata.bind':_0x42cb('0x41')+_0x29947f[_0x42cb('0x2e')]+')','ownerid@odata.bind':_0x42cb('0x2b')+_0x29947f[_0x42cb('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x264183[_0x42cb('0x42')],_0x4f1519,_0x264183[_0x42cb('0x3a')])),'headers':{'Authorization':_0x42cb('0x1a')+_0x4a7f7a,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x264183[_0x42cb('0x3a')]===_0x42cb('0x43')){_0x526c94={'method':_0x42cb('0xc'),'uri':_0x3a0bf0+_0x42cb('0x44'),'body':Object[_0x42cb('0x3d')]({},{'subject':intUtil[_0x42cb('0x3f')](_0x264183[_0x42cb('0x3e')],_0x4f1519,'\x20'),'phonenumber':String(_0x4f1519[_0x42cb('0x2a')]),'description':intUtil[_0x42cb('0x3f')](_0x264183[_0x42cb('0x40')],_0x4f1519,'\x0a'),'regardingobjectid_contact@odata.bind':_0x42cb('0x41')+_0x29947f[_0x42cb('0x2e')]+')','ownerid@odata.bind':'/systemusers('+_0x29947f[_0x42cb('0x24')]+')','directioncode':_0x29947f[_0x42cb('0x45')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x29947f[_0x42cb('0x24')]+')','participationtypemask':_0x29947f['callDirection']===_0x42cb('0x46')?0x2:0x1},{'partyid_contact@odata.bind':_0x42cb('0x41')+_0x29947f[_0x42cb('0x2e')]+')','participationtypemask':_0x29947f[_0x42cb('0x45')]===_0x42cb('0x46')?0x1:0x2}]},getCustomFields(_0x264183[_0x42cb('0x42')],_0x4f1519,_0x264183[_0x42cb('0x3a')])),'headers':{'Authorization':'Bearer\x20'+_0x4a7f7a,'OData-Version':_0x42cb('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x526c94);})[_0x42cb('0x12')](function(_0x4dac9f){var _0xf2028e=_0x4dac9f['headers'][_0x42cb('0x2c')];var _0x1c6278=_0xf2028e[_0x42cb('0x37')](_0xf2028e[_0x42cb('0x2d')]('(')+0x1,_0xf2028e[_0x42cb('0x2d')](')'));_0x29947f[_0x42cb('0x47')]=_0x1c6278;_0x3bfff6(_0x29947f);})[_0x42cb('0x13')](function(_0x101ac0){_0x373e9e(_0x101ac0[_0x42cb('0x17')]);});});}function emit(_0x3edb86,_0x241903,_0x29d7ae,_0x32e83a){var _0x4662e3={'uri':util['format'](_0x42cb('0x48'),_0x3edb86,_0x29d7ae,_0x32e83a)};io['to'](util[_0x42cb('0x49')]('user:%s',_0x241903))['emit'](_0x42cb('0x4a'),_0x4662e3);}exports['cs']=function(_0x4ce378,_0x393806,_0x741214,_0x455745,_0x2d017e,_0x1d39ee,_0x3aca1f,_0x5fd2f2){var _0x487e46={};_0x1d39ee[_0x42cb('0xe')]=intUtil['stripTrailingSlash'](_0x1d39ee[_0x42cb('0xe')]);_0x1d39ee[_0x42cb('0x4b')]=intUtil[_0x42cb('0x4c')](_0x1d39ee[_0x42cb('0x4b')]);_0x487e46['callDirection']=_0x5fd2f2===_0x42cb('0x46')||_0x5fd2f2==='abandoned'?'queue':_0x42cb('0x28');var _0x35e8d0=util[_0x42cb('0x49')](_0x42cb('0x4d'),_0x1d39ee[_0x42cb('0xe')]);var _0x487ff6=util[_0x42cb('0x49')]('https://login.microsoftonline.com/%s/oauth2/token',_0x1d39ee[_0x42cb('0x4e')]);var _0x4de552=util[_0x42cb('0x49')](_0x42cb('0x4f'),_0x1d39ee[_0x42cb('0x4b')],_0x393806['uniqueid'],md5(_0x393806[_0x42cb('0x50')]));if(_0x2d017e&&_0x2d017e[_0x42cb('0x51')]){logger[_0x42cb('0x21')](_0x42cb('0x52'),'Recording\x20is\x20enabled!');_0x393806['recordingURL']=_0x4de552;}else if(_0x3aca1f&&_0x3aca1f[_0x42cb('0x53')]&&_0x3aca1f[_0x42cb('0x53')]!==_0x42cb('0x54')){logger[_0x42cb('0x21')](_0x42cb('0x55'),_0x42cb('0x56'));_0x393806['recordingURL']=_0x4de552;}else{_0x393806[_0x42cb('0x57')]='';}return getUser(_0x487e46,_0x1d39ee,_0x455745,_0x487ff6,_0x35e8d0,_0x5fd2f2)[_0x42cb('0x12')](function(_0x3f2f06){logger[_0x42cb('0x21')]('['+_0x5fd2f2[_0x42cb('0x15')]()+_0x42cb('0x58'),_0x3f2f06['userId']);logger[_0x42cb('0x21')]('['+_0x5fd2f2[_0x42cb('0x15')]()+_0x42cb('0x59'),_0x3f2f06[_0x42cb('0x1f')]);return getEndUser(_0x3f2f06,_0x1d39ee,_0x487ff6,_0x35e8d0,_0x393806,_0x5fd2f2);})['then'](function(_0x465afe){logger[_0x42cb('0x21')]('['+_0x5fd2f2['toUpperCase']()+_0x42cb('0x5a'),_0x465afe[_0x42cb('0x2e')]);logger[_0x42cb('0x21')]('['+_0x5fd2f2[_0x42cb('0x15')]()+_0x42cb('0x5b'),_0x393806[_0x42cb('0x2a')]);return getTicket(_0x465afe,_0x1d39ee,_0x487ff6,_0x35e8d0,_0x393806,_0x741214,_0x5fd2f2);})[_0x42cb('0x12')](function(_0x4d6526){logger[_0x42cb('0x21')](util[_0x42cb('0x49')]('['+_0x5fd2f2[_0x42cb('0x15')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x741214[_0x42cb('0x3a')],_0x4d6526[_0x42cb('0x47')]));logger['info'](util[_0x42cb('0x49')]('['+_0x5fd2f2[_0x42cb('0x15')]()+_0x42cb('0x5c'),_0x5fd2f2));if(_0x5fd2f2!==_0x42cb('0x5d')){logger[_0x42cb('0x21')]('['+_0x5fd2f2['toUpperCase']()+']',_0x42cb('0x5e'));emit(_0x1d39ee[_0x42cb('0xe')],_0x455745[_0x42cb('0x5f')],_0x741214[_0x42cb('0x3a')],_0x4d6526['ticketId']);}})[_0x42cb('0x13')](function(_0x41606e){logger[_0x42cb('0x14')]('['+_0x5fd2f2[_0x42cb('0x15')]()+_0x42cb('0x60'),util[_0x42cb('0x61')](_0x41606e,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe8cd=['type','string','nameField','customField','idField','substring','indexOf','ticketType','incident','incidents','Subjects','getString','Descriptions','/contacts(','Fields','phonecalls','assign','callDirection','queue','lastIndexOf','format','%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','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','bluebird','request-promise','util','./util','ioredis','../../../../config/logger','dynamics365','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','calleridnum','contacts','/systemusers(','headers','odata-entityid','enduserId','contacts?$select=telephone1','length','toLowerCase','outbound','destcalleridnum','telephone1',']\x20Enduser\x20created!',']\x20Enduser\x20Created!'];(function(_0x15a634,_0x4feb86){var _0xf4f7a0=function(_0x31d9fe){while(--_0x31d9fe){_0x15a634['push'](_0x15a634['shift']());}};_0xf4f7a0(++_0x4feb86);}(_0xe8cd,0x90));var _0xde8c=function(_0x2181b1,_0x569637){_0x2181b1=_0x2181b1-0x0;var _0x530548=_0xe8cd[_0x2181b1];return _0x530548;};'use strict';var _=require('lodash');var BPromise=require(_0xde8c('0x0'));var rp=require(_0xde8c('0x1'));var util=require(_0xde8c('0x2'));var intUtil=require(_0xde8c('0x3'));var md5=require('md5');var Redis=require(_0xde8c('0x4'));var logger=require(_0xde8c('0x5'))(_0xde8c('0x6'));var config=require('../../../../config/environment');config[_0xde8c('0x7')]=_[_0xde8c('0x8')](config['redis'],{'host':_0xde8c('0x9'),'port':0x18eb});var io=require(_0xde8c('0xa'))(new Redis(config['redis']));function getAuthToken(_0x2996ca,_0x1d3c3a,_0x4f8517){var _0x245c86={'method':_0xde8c('0xb'),'uri':_0x1d3c3a,'form':{'client_id':_0x2996ca[_0xde8c('0xc')],'resource':_0x2996ca[_0xde8c('0xd')],'username':_0x2996ca[_0xde8c('0xe')],'password':_0x2996ca[_0xde8c('0xf')],'grant_type':_0xde8c('0xf'),'client_secret':_0x2996ca[_0xde8c('0x10')]},'json':!![]};return rp(_0x245c86)['then'](function(_0x2e8e34){return _0x2e8e34['access_token'];})[_0xde8c('0x11')](function(_0x844951){logger[_0xde8c('0x12')]('['+[_0x4f8517[_0xde8c('0x13')]()]+_0xde8c('0x14'));return _0x844951[_0xde8c('0x15')];});}function getUser(_0x12de0c,_0x566f74,_0x155fb5,_0x43715d,_0x1d1116,_0x141a60){return new BPromise(function(_0x2eaf07,_0x41c8bc){return getAuthToken(_0x566f74,_0x43715d,_0x141a60)[_0xde8c('0x16')](function(_0xb96f0c){var _0x27cf69={'method':_0xde8c('0x17'),'uri':_0x1d1116+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xde8c('0x18')+_0xb96f0c,'OData-Version':_0xde8c('0x19')},'json':!![]};return rp(_0x27cf69);})[_0xde8c('0x16')](function(_0x2dadd){var _0x1992fc=_0x2dadd[_0xde8c('0x1a')];var _0x4e2a73=![];var _0x4cecae=null;if(!_[_0xde8c('0x1b')](_0x155fb5)){if(intUtil[_0xde8c('0x1c')](_0x155fb5[_0xde8c('0x1d')])){_0x12de0c[_0xde8c('0x1e')]=_0x155fb5[_0xde8c('0x1d')];for(_0x4cecae=0x0;_0x4cecae<_0x1992fc['length'];_0x4cecae++){if(_0x1992fc[_0x4cecae][_0xde8c('0x1f')]===_0x155fb5[_0xde8c('0x1d')]&&!_0x1992fc[_0x4cecae][_0xde8c('0x20')]){_0x4e2a73=!![];logger[_0xde8c('0x21')]('['+[_0x141a60['toUpperCase']()]+_0xde8c('0x22')+_0x1992fc[_0x4cecae]['systemuserid']+'!');_0x12de0c[_0xde8c('0x23')]=_0x1992fc[_0x4cecae][_0xde8c('0x24')];}}}}if(!_0x4e2a73){logger[_0xde8c('0x21')]('['+[_0x141a60[_0xde8c('0x13')]()]+_0xde8c('0x25'));_0x12de0c[_0xde8c('0x1e')]=_0x566f74[_0xde8c('0xe')];for(_0x4cecae=0x0;_0x4cecae<_0x1992fc['length'];_0x4cecae++){if(_0x1992fc[_0x4cecae][_0xde8c('0x1f')]===_0x566f74[_0xde8c('0xe')]){_0x12de0c[_0xde8c('0x23')]=_0x1992fc[_0x4cecae][_0xde8c('0x24')];}}}_0x2eaf07(_0x12de0c);})[_0xde8c('0x11')](function(_0x2d3c73){_0x41c8bc(_0x2d3c73[_0xde8c('0x15')]);});});}function createEndUser(_0x4a5547,_0x4fbc56,_0x47e230,_0x4dbd1c,_0x1fbdc9,_0x1f3aa7){return new BPromise(function(_0x55693f,_0x1006a4){return getAuthToken(_0x4fbc56,_0x47e230,_0x1f3aa7)[_0xde8c('0x16')](function(_0xeca9d5){var _0x118aa4=_0x1f3aa7['toLowerCase']()==='outbound'?_0x1fbdc9['destcalleridnum']:_0x1fbdc9[_0xde8c('0x26')];var _0x32ccff={'method':_0xde8c('0xb'),'uri':_0x4dbd1c+_0xde8c('0x27'),'body':{'telephone1':_0x118aa4,'fullname':_0x118aa4,'firstname':_0x118aa4,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xde8c('0x28')+_0x4a5547[_0xde8c('0x23')]+')'},'headers':{'Authorization':'Bearer\x20'+_0xeca9d5,'OData-Version':_0xde8c('0x19')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x32ccff);})[_0xde8c('0x16')](function(_0x2d55b2){var _0x4a561c=_0x2d55b2[_0xde8c('0x29')][_0xde8c('0x2a')];var _0x1a229f=_0x4a561c['substring'](_0x4a561c['lastIndexOf']('(')+0x1,_0x4a561c['lastIndexOf'](')'));_0x4a5547[_0xde8c('0x2b')]=_0x1a229f;_0x55693f(_0x4a5547);})[_0xde8c('0x11')](function(_0x85572e){_0x1006a4(_0x85572e[_0xde8c('0x15')]);});});}function getEndUser(_0xc35b93,_0x42fe13,_0x3fdfc5,_0x2e17a3,_0x15a2d5,_0x17d108){return new BPromise(function(_0x485d26,_0x462050){return getAuthToken(_0x42fe13,_0x3fdfc5,_0x17d108)[_0xde8c('0x16')](function(_0x58e404){var _0x3fe85b={'method':_0xde8c('0x17'),'uri':_0x2e17a3+_0xde8c('0x2c'),'headers':{'Authorization':_0xde8c('0x18')+_0x58e404,'If-None-Match':null,'OData-Version':_0xde8c('0x19')},'json':!![]};return rp(_0x3fe85b);})[_0xde8c('0x16')](function(_0x3d34a7){var _0x2feff9=null;if(_0x3d34a7){var _0x58c9ac=_0x3d34a7['value'];var _0x378e62=![];for(_0x2feff9=0x0;_0x2feff9<_0x58c9ac[_0xde8c('0x2d')];_0x2feff9++){var _0x5564df=_0x17d108[_0xde8c('0x2e')]()===_0xde8c('0x2f')?_0x15a2d5[_0xde8c('0x30')]:_0x15a2d5['calleridnum'];if(_0x58c9ac[_0x2feff9][_0xde8c('0x31')]===_0x5564df){_0x378e62=!![];_0xc35b93['enduserId']=_0x58c9ac[_0x2feff9]['contactid'];}}if(_0x378e62){_0x485d26(_0xc35b93);}else{return createEndUser(_0xc35b93,_0x42fe13,_0x3fdfc5,_0x2e17a3,_0x15a2d5,_0x17d108)['then'](function(_0xe29456){logger[_0xde8c('0x21')]('['+[_0x17d108[_0xde8c('0x13')]()]+_0xde8c('0x32'),_0xe29456[_0xde8c('0x2b')]);_0x485d26(_0xe29456);});}}else{return createEndUser(_0xc35b93,_0x42fe13,_0x3fdfc5,_0x2e17a3,_0x15a2d5,_0x17d108)[_0xde8c('0x16')](function(_0x3e1ff0){logger[_0xde8c('0x21')]('['+[_0x17d108[_0xde8c('0x13')]()]+_0xde8c('0x33'),_0x3e1ff0[_0xde8c('0x2b')]);_0x485d26(_0x3e1ff0);});}});});}function getCustomFields(_0x51b97c,_0x12656b,_0x10fc63){var _0x18683a={};if(_0x51b97c[_0xde8c('0x2d')]>0x0){_['forEach'](_0x51b97c,function(_0x3bdb12){if(_0x3bdb12[_0xde8c('0x34')]===_0xde8c('0x35')&&_0x3bdb12[_0xde8c('0x36')]&&!_0x3bdb12[_0xde8c('0x37')]){var _0x3273e3=_0x3bdb12[_0xde8c('0x38')][_0xde8c('0x2e')]();var _0x51ad7b=_0x3273e3[_0xde8c('0x39')](0x0,_0x3273e3['indexOf']('_'));var _0x16d455=_0x3273e3[_0xde8c('0x39')](_0x3273e3[_0xde8c('0x3a')]('_')+0x1);if(_0x51ad7b===_0x10fc63){_0x18683a[_0x16d455]=_0x3bdb12['content'];}}});}return _0x18683a;}function getTicket(_0x5cf7d6,_0x9071d9,_0x3df6e4,_0x2c183f,_0x4151ac,_0x2c06a1,_0x3274f9){return new BPromise(function(_0x21659f,_0x23ef0c){var _0x53ae2d;return getAuthToken(_0x9071d9,_0x3df6e4,_0x3274f9)['then'](function(_0x932d44){if(_0x2c06a1[_0xde8c('0x3b')]===_0xde8c('0x3c')){_0x53ae2d={'method':_0xde8c('0xb'),'uri':_0x2c183f+_0xde8c('0x3d'),'body':Object['assign']({},{'title':intUtil['getString'](_0x2c06a1[_0xde8c('0x3e')],_0x4151ac,'\x20'),'description':intUtil[_0xde8c('0x3f')](_0x2c06a1[_0xde8c('0x40')],_0x4151ac,'\x0a'),'customerid_contact@odata.bind':_0xde8c('0x41')+_0x5cf7d6[_0xde8c('0x2b')]+')','ownerid@odata.bind':_0xde8c('0x28')+_0x5cf7d6[_0xde8c('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x2c06a1[_0xde8c('0x42')],_0x4151ac,_0x2c06a1[_0xde8c('0x3b')])),'headers':{'Authorization':_0xde8c('0x18')+_0x932d44,'OData-Version':_0xde8c('0x19')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2c06a1[_0xde8c('0x3b')]==='phonecall'){_0x53ae2d={'method':_0xde8c('0xb'),'uri':_0x2c183f+_0xde8c('0x43'),'body':Object[_0xde8c('0x44')]({},{'subject':intUtil[_0xde8c('0x3f')](_0x2c06a1['Subjects'],_0x4151ac,'\x20'),'phonenumber':String(_0x4151ac[_0xde8c('0x26')]),'description':intUtil[_0xde8c('0x3f')](_0x2c06a1[_0xde8c('0x40')],_0x4151ac,'\x0a'),'regardingobjectid_contact@odata.bind':_0xde8c('0x41')+_0x5cf7d6[_0xde8c('0x2b')]+')','ownerid@odata.bind':_0xde8c('0x28')+_0x5cf7d6['userId']+')','directioncode':_0x5cf7d6[_0xde8c('0x45')]===_0xde8c('0x46')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xde8c('0x28')+_0x5cf7d6['userId']+')','participationtypemask':_0x5cf7d6[_0xde8c('0x45')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xde8c('0x41')+_0x5cf7d6[_0xde8c('0x2b')]+')','participationtypemask':_0x5cf7d6[_0xde8c('0x45')]===_0xde8c('0x46')?0x1:0x2}]},getCustomFields(_0x2c06a1['Fields'],_0x4151ac,_0x2c06a1[_0xde8c('0x3b')])),'headers':{'Authorization':'Bearer\x20'+_0x932d44,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x53ae2d);})['then'](function(_0x425d24){var _0x4cd9f0=_0x425d24[_0xde8c('0x29')][_0xde8c('0x2a')];var _0x283032=_0x4cd9f0[_0xde8c('0x39')](_0x4cd9f0[_0xde8c('0x47')]('(')+0x1,_0x4cd9f0['lastIndexOf'](')'));_0x5cf7d6['ticketId']=_0x283032;_0x21659f(_0x5cf7d6);})[_0xde8c('0x11')](function(_0x2ca847){_0x23ef0c(_0x2ca847[_0xde8c('0x15')]);});});}function emit(_0x4d7f7c,_0x5177f9,_0x11d209,_0x2f7284){var _0xc018d={'uri':util[_0xde8c('0x48')](_0xde8c('0x49'),_0x4d7f7c,_0x11d209,_0x2f7284)};io['to'](util[_0xde8c('0x48')](_0xde8c('0x4a'),_0x5177f9))[_0xde8c('0x4b')](_0xde8c('0x4c'),_0xc018d);}exports['cs']=function(_0x43765f,_0x58c72c,_0x33fcfa,_0x365dda,_0x5e1603,_0x36566d,_0x3df366,_0x373a68){var _0x445302={};_0x36566d['remoteUri']=intUtil[_0xde8c('0x4d')](_0x36566d[_0xde8c('0xd')]);_0x36566d[_0xde8c('0x4e')]=intUtil[_0xde8c('0x4d')](_0x36566d[_0xde8c('0x4e')]);_0x445302[_0xde8c('0x45')]=_0x373a68===_0xde8c('0x46')||_0x373a68===_0xde8c('0x4f')?'queue':_0xde8c('0x2f');var _0x239150=util[_0xde8c('0x48')](_0xde8c('0x50'),_0x36566d[_0xde8c('0xd')]);var _0x4abc5c=util[_0xde8c('0x48')](_0xde8c('0x51'),_0x36566d[_0xde8c('0x52')]);var _0x48f433=util[_0xde8c('0x48')](_0xde8c('0x53'),_0x36566d[_0xde8c('0x4e')],_0x58c72c[_0xde8c('0x54')],md5(_0x58c72c['uniqueid']));if(_0x5e1603&&_0x5e1603[_0xde8c('0x55')]){logger['info']('[QUEUE]',_0xde8c('0x56'));_0x58c72c['recordingURL']=_0x48f433;}else if(_0x3df366&&_0x3df366[_0xde8c('0x57')]&&_0x3df366[_0xde8c('0x57')]!==_0xde8c('0x58')){logger[_0xde8c('0x21')](_0xde8c('0x59'),_0xde8c('0x56'));_0x58c72c[_0xde8c('0x5a')]=_0x48f433;}else{_0x58c72c[_0xde8c('0x5a')]='';}return getUser(_0x445302,_0x36566d,_0x365dda,_0x4abc5c,_0x239150,_0x373a68)[_0xde8c('0x16')](function(_0x4d61e0){logger['info']('['+_0x373a68[_0xde8c('0x13')]()+_0xde8c('0x5b'),_0x4d61e0['userId']);logger[_0xde8c('0x21')]('['+_0x373a68[_0xde8c('0x13')]()+']\x20The\x20User\x20email\x20is:',_0x4d61e0['userEmail']);return getEndUser(_0x4d61e0,_0x36566d,_0x4abc5c,_0x239150,_0x58c72c,_0x373a68);})[_0xde8c('0x16')](function(_0x1769d1){logger['info']('['+_0x373a68[_0xde8c('0x13')]()+_0xde8c('0x5c'),_0x1769d1[_0xde8c('0x2b')]);logger[_0xde8c('0x21')]('['+_0x373a68[_0xde8c('0x13')]()+_0xde8c('0x5d'),_0x58c72c[_0xde8c('0x26')]);return getTicket(_0x1769d1,_0x36566d,_0x4abc5c,_0x239150,_0x58c72c,_0x33fcfa,_0x373a68);})[_0xde8c('0x16')](function(_0x5775f1){logger['info'](util[_0xde8c('0x48')]('['+_0x373a68['toUpperCase']()+_0xde8c('0x5e'),_0x33fcfa[_0xde8c('0x3b')],_0x5775f1[_0xde8c('0x5f')]));logger[_0xde8c('0x21')](util[_0xde8c('0x48')]('['+_0x373a68[_0xde8c('0x13')]()+']\x20Call\x20direction:\x20%s',_0x373a68));if(_0x373a68!==_0xde8c('0x4f')){logger[_0xde8c('0x21')]('['+_0x373a68['toUpperCase']()+']',_0xde8c('0x60'));emit(_0x36566d[_0xde8c('0xd')],_0x365dda['name'],_0x33fcfa['ticketType'],_0x5775f1[_0xde8c('0x5f')]);}})[_0xde8c('0x11')](function(_0x30e6b0){logger[_0xde8c('0x12')]('['+_0x373a68[_0xde8c('0x13')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0xde8c('0x61')](_0x30e6b0,{'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 20ffa84..168efd0 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 _0x4285=['outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','abandoned','[ABANDONED]','lodash','request-promise','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','localhost','socket.io-emitter','application/json','emit','info','format','calleridname','calleridnum','getString','Subjects','Descriptions','
','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','then','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','remoteUri','Enduser\x20found!','%s/api/v2/contacts','POST','Enduser\x20created.','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','map','forEach','type','nameField','customField','toLowerCase','content','string','idField','push','toString','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x4285,0x67));var _0x5428=function(_0x2fe59d,_0x52db0e){_0x2fe59d=_0x2fe59d-0x0;var _0x2ae152=_0x4285[_0x2fe59d];return _0x2ae152;};'use strict';var _=require(_0x5428('0x0'));var rp=require(_0x5428('0x1'));var md5=require('md5');var util=require(_0x5428('0x2'));var Redis=require('ioredis');var intUtil=require(_0x5428('0x3'));var config=require(_0x5428('0x4'));var logger=require(_0x5428('0x5'))(_0x5428('0x6'));config['redis']=_[_0x5428('0x7')](config[_0x5428('0x8')],{'host':_0x5428('0x9'),'port':0x18eb});var io=require(_0x5428('0xa'))(new Redis(config['redis']));var headers={'Content-Type':_0x5428('0xb'),'Accept':_0x5428('0xb')};function emit(_0x551204,_0x5648c5,_0x3448d5){io['to'](_0x551204)[_0x5428('0xc')](_0x5648c5,_0x3448d5);}function getTicket(_0x5efbb5,_0x24cbd6,_0x43af8f,_0x38cd06,_0x2d668f){logger[_0x5428('0xd')]('Creating\x20new\x20ticket...');var _0x47f5ce=_['merge']({'responder_id':_0x24cbd6['id'],'requester_id':_0x43af8f['id'],'name':util[_0x5428('0xe')]('Caller\x20-\x20%s',_0x2d668f[_0x5428('0xf')]),'phone':_0x2d668f[_0x5428('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x5428('0x11')](_0x38cd06[_0x5428('0x12')],_0x2d668f,'\x20'),'description':intUtil[_0x5428('0x11')](_0x38cd06[_0x5428('0x13')],_0x2d668f,_0x5428('0x14')),'tags':getTags(_0x38cd06['Tags'],'name')},getCustomFields(_0x38cd06[_0x5428('0x15')],_0x2d668f));_0x47f5ce[_0x5428('0x16')]=_[_0x5428('0x17')](_[_0x5428('0x18')](_0x47f5ce['custom_fields'],'id'),_0x5428('0x19'));return request({'uri':util[_0x5428('0xe')](_0x5428('0x1a'),_0x5efbb5['remoteUri']),'method':'POST','body':_0x47f5ce})[_0x5428('0x1b')](function(_0x352a84){logger[_0x5428('0xd')]('Ticket\x20created!');return _0x352a84;});}function getUser(_0xbfbd5a,_0x13a99c){if(intUtil['validateEmail'](_0x13a99c)){return request({'uri':util[_0x5428('0xe')](_0x5428('0x1c'),_0xbfbd5a['remoteUri']),'qs':{'email':_0x13a99c}})[_0x5428('0x1b')](function(_0x493af8){if(_0x493af8[_0x5428('0x1d')]){logger['info'](_0x5428('0x1e'));return _[_0x5428('0x1f')](_0x493af8,function(_0x3500f7){return _0x3500f7[_0x5428('0x20')][_0x5428('0x21')]===_0x13a99c;});}else{logger[_0x5428('0xd')](_0x5428('0x22'));return request({'uri':util[_0x5428('0xe')](_0x5428('0x23'),_0xbfbd5a['remoteUri'])})[_0x5428('0x1b')](function(_0x299693){logger[_0x5428('0xd')](_0x5428('0x24'));return _0x299693;});}});}else{logger[_0x5428('0xd')](_0x5428('0x25'));return request({'uri':util[_0x5428('0xe')](_0x5428('0x23'),_0xbfbd5a['remoteUri'])})[_0x5428('0x1b')](function(_0x282335){logger[_0x5428('0xd')](_0x5428('0x24'));return _0x282335;});}}function getEndUser(_0xad8739,_0x45aabf,_0x515509){logger['info'](_0x5428('0x26'),_0x515509);return request({'uri':util[_0x5428('0xe')]('%s/api/v2/contacts',_0xad8739[_0x5428('0x27')]),'qs':{'phone':_0x515509}})[_0x5428('0x1b')](function(_0x3e0d98){if(_0x3e0d98['length']){logger[_0x5428('0xd')](_0x5428('0x28'));return _[_0x5428('0x1f')](_0x3e0d98,{'phone':_0x515509});}else{logger[_0x5428('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x5428('0xe')](_0x5428('0x29'),_0xad8739[_0x5428('0x27')]),'method':_0x5428('0x2a'),'body':{'name':_0x45aabf,'phone':_0x515509}})['then'](function(_0x534bc0){logger['info'](_0x5428('0x2b'));return _0x534bc0;});}});}function getAuth(_0x18d1c2){return util['format'](_0x5428('0x2c'),new Buffer(_0x18d1c2[_0x5428('0x2d')]+':X')['toString'](_0x5428('0x2e')));}function request(_0x14e55f){logger[_0x5428('0x2f')](_0x5428('0x30'),JSON[_0x5428('0x31')](_0x14e55f));return rp(_[_0x5428('0x7')](_0x14e55f,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x51070a,_0x14494a){var _0x3bc5e7=[];if(_0x51070a&&_0x51070a[_0x5428('0x1d')]>0x0){_0x3bc5e7=_[_0x5428('0x32')](_0x51070a,_0x14494a);}return _0x3bc5e7;}function getCustomFields(_0x535384,_0x5ef530){var _0x48caa7=[];var _0x219b0e={'custom_fields':[]};if(_0x535384['length']>0x0){_[_0x5428('0x33')](_0x535384,function(_0x34022b){if(_0x34022b[_0x5428('0x34')]==='string'&&_0x34022b[_0x5428('0x35')]&&!_0x34022b[_0x5428('0x36')]){_0x219b0e[_0x34022b[_0x5428('0x35')][_0x5428('0x37')]()]=_0x34022b[_0x5428('0x38')]['toString']();}else if(_0x34022b[_0x5428('0x34')]===_0x5428('0x39')&&_0x34022b[_0x5428('0x3a')]&&_0x34022b[_0x5428('0x36')]){_0x219b0e[_0x5428('0x16')][_0x5428('0x3b')]({'id':_0x34022b['idField'],'value':_0x34022b[_0x5428('0x38')][_0x5428('0x3c')]()});}else if(_0x34022b['type']===_0x5428('0x3d')&&_0x34022b[_0x5428('0x3e')]&&_0x34022b[_0x5428('0x3a')]&&_0x34022b[_0x5428('0x36')]){_0x5ef530[_0x34022b[_0x5428('0x3e')]]&&_0x219b0e['custom_fields']['push']({'id':_0x34022b[_0x5428('0x3a')],'value':_0x5ef530[_0x34022b['variableName']]['toString']()});}else if(_0x34022b[_0x5428('0x34')]===_0x5428('0x3f')&&_0x34022b[_0x5428('0x40')]&&_0x34022b[_0x5428('0x40')]['name']&&_0x34022b[_0x5428('0x3a')]&&_0x34022b[_0x5428('0x36')]){_0x5ef530[_0x34022b[_0x5428('0x40')][_0x5428('0x41')][_0x5428('0x37')]()]&&_0x219b0e[_0x5428('0x16')][_0x5428('0x3b')]({'id':_0x34022b[_0x5428('0x3a')],'value':_0x5ef530[_0x34022b['Variable'][_0x5428('0x41')][_0x5428('0x37')]()][_0x5428('0x3c')]()});}});}return _0x219b0e;}exports[_0x5428('0x42')]=function(_0x468acd,_0x326155,_0x190ff6,_0x46d3c4,_0x2e9f3c,_0x350142){var _0x36376b,_0x826967;_0x350142[_0x5428('0x27')]=intUtil[_0x5428('0x43')](_0x350142[_0x5428('0x27')]);_0x350142[_0x5428('0x44')]=intUtil[_0x5428('0x43')](_0x350142[_0x5428('0x44')]);if(_0x2e9f3c&&_0x2e9f3c[_0x5428('0x45')]){logger[_0x5428('0xd')](_0x5428('0x46'),_0x5428('0x47'));_0x326155[_0x5428('0x48')]=util[_0x5428('0xe')](_0x5428('0x49'),_0x350142[_0x5428('0x44')],_0x326155[_0x5428('0x4a')],md5(_0x326155['uniqueid']));}else{_0x326155[_0x5428('0x48')]='';}headers[_0x5428('0x4b')]=getAuth(_0x350142);return getUser(_0x350142,_0x46d3c4['email'])['then'](function(_0x185ed0){_0x36376b=_0x185ed0;logger[_0x5428('0xd')]('The\x20User\x20ID\x20is:',_0x36376b['id']);return getEndUser(_0x350142,_0x326155[_0x5428('0xf')],_0x326155[_0x5428('0x10')]);})[_0x5428('0x1b')](function(_0x2ff42e){_0x826967=_0x2ff42e;logger['info']('The\x20Enduser\x20ID\x20is:',_0x826967['id']);return getTicket(_0x350142,_0x36376b,_0x826967,_0x190ff6,_0x326155);})['then'](function(_0x256b31){if(_0x256b31&&_0x256b31['id']){logger[_0x5428('0xd')]('Ticket\x20created!');logger[_0x5428('0xd')](_0x5428('0x4c'),_0x256b31['id']);logger[_0x5428('0xd')](_0x5428('0x46'),_0x5428('0x4d'));emit(util[_0x5428('0xe')](_0x5428('0x4e'),_0x46d3c4[_0x5428('0x41')]),_0x5428('0x4f'),{'uri':util[_0x5428('0xe')](_0x5428('0x50'),_0x350142[_0x5428('0x27')],_0x256b31['id'])});}})[_0x5428('0x51')](function(_0xdd3132){logger[_0x5428('0x52')](_0x5428('0x46'),JSON[_0x5428('0x31')](_0xdd3132));});};exports[_0x5428('0x53')]=function(_0x485e41,_0x44449f,_0x4426d4,_0x2f9a39,_0x53e697,_0x458e96,_0x646da0){var _0x5b095f,_0x1917dc;_0x458e96[_0x5428('0x27')]=intUtil[_0x5428('0x43')](_0x458e96[_0x5428('0x27')]);_0x458e96['serverUrl']=intUtil[_0x5428('0x43')](_0x458e96[_0x5428('0x44')]);if(_0x646da0&&_0x646da0[_0x5428('0x54')]&&_0x646da0[_0x5428('0x54')]!==_0x5428('0x55')){logger[_0x5428('0xd')](_0x5428('0x56'),_0x5428('0x47'));_0x44449f[_0x5428('0x48')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x458e96[_0x5428('0x44')],_0x44449f[_0x5428('0x4a')],md5(_0x44449f[_0x5428('0x4a')]));}headers[_0x5428('0x4b')]=getAuth(_0x458e96);return getUser(_0x458e96,_0x2f9a39[_0x5428('0x21')])['then'](function(_0x9541ad){_0x5b095f=_0x9541ad;logger[_0x5428('0xd')](_0x5428('0x57'),_0x5b095f['id']);return getEndUser(_0x458e96,_0x44449f['destcalleridname'],_0x44449f[_0x5428('0x58')]);})['then'](function(_0x51ed77){_0x1917dc=_0x51ed77;logger[_0x5428('0xd')](_0x5428('0x59'),_0x1917dc['id']);return getTicket(_0x458e96,_0x5b095f,_0x1917dc,_0x4426d4,_0x44449f);})[_0x5428('0x1b')](function(_0x110f77){if(_0x110f77&&_0x110f77['id']){logger[_0x5428('0xd')](_0x5428('0x5a'));logger['info'](_0x5428('0x4c'),_0x110f77['id']);logger[_0x5428('0xd')]('[OUTBOUND]',_0x5428('0x4d'));emit(util[_0x5428('0xe')](_0x5428('0x4e'),_0x2f9a39[_0x5428('0x41')]),_0x5428('0x4f'),{'uri':util['format'](_0x5428('0x50'),_0x458e96[_0x5428('0x27')],_0x110f77['id'])});}})[_0x5428('0x51')](function(_0x1faf38){logger['error'](_0x5428('0x56'),JSON[_0x5428('0x31')](_0x1faf38));});};exports[_0x5428('0x5b')]=function(_0x573a44,_0x3d64e3,_0xe86b86,_0x3dbc98,_0x4cca7f,_0x19ba9b){var _0x122d14,_0x290e10;_0x19ba9b['remoteUri']=intUtil['stripTrailingSlash'](_0x19ba9b['remoteUri']);_0x19ba9b[_0x5428('0x44')]=intUtil['stripTrailingSlash'](_0x19ba9b[_0x5428('0x44')]);if(_0x4cca7f&&_0x4cca7f[_0x5428('0x45')]){logger[_0x5428('0xd')](_0x5428('0x5c'),_0x5428('0x47'));_0x3d64e3[_0x5428('0x48')]=util[_0x5428('0xe')](_0x5428('0x49'),_0x19ba9b[_0x5428('0x44')],_0x3d64e3[_0x5428('0x4a')],md5(_0x3d64e3[_0x5428('0x4a')]));}else{_0x3d64e3['recordingURL']='';}headers[_0x5428('0x4b')]=getAuth(_0x19ba9b);return getUser(_0x19ba9b,'')[_0x5428('0x1b')](function(_0x595733){_0x122d14=_0x595733;logger[_0x5428('0xd')](_0x5428('0x57'),_0x122d14['id']);return getEndUser(_0x19ba9b,_0x3d64e3[_0x5428('0xf')],_0x3d64e3[_0x5428('0x10')]);})[_0x5428('0x1b')](function(_0x1f244a){_0x290e10=_0x1f244a;logger[_0x5428('0xd')](_0x5428('0x59'),_0x290e10['id']);return getTicket(_0x19ba9b,_0x122d14,_0x290e10,_0xe86b86,_0x3d64e3);})[_0x5428('0x1b')](function(_0x3e2ee2){if(_0x3e2ee2){logger[_0x5428('0xd')](_0x5428('0x5a'));logger[_0x5428('0xd')](_0x5428('0x4c'),_0x3e2ee2['id']);}})['catch'](function(_0x100eda){logger[_0x5428('0x52')](_0x5428('0x5c'),JSON['stringify'](_0x100eda));});}; \ No newline at end of file +var _0x6ed1=['toLowerCase','content','idField','push','type','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','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','error','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','catch','[OUTBOUND]','abandoned','monitor_format','The\x20User\x20ID\x20is:','lodash','request-promise','util','ioredis','./util','../../../../config/environment','freshdesk','defaults','redis','localhost','application/json','emit','info','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','validateEmail','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','stringify','GET','map','string','nameField','customField'];(function(_0x33c98e,_0x4eb3d0){var _0x39a756=function(_0x3cfded){while(--_0x3cfded){_0x33c98e['push'](_0x33c98e['shift']());}};_0x39a756(++_0x4eb3d0);}(_0x6ed1,0xd5));var _0x16ed=function(_0x38782c,_0x5c9fef){_0x38782c=_0x38782c-0x0;var _0x3708bf=_0x6ed1[_0x38782c];return _0x3708bf;};'use strict';var _=require(_0x16ed('0x0'));var rp=require(_0x16ed('0x1'));var md5=require('md5');var util=require(_0x16ed('0x2'));var Redis=require(_0x16ed('0x3'));var intUtil=require(_0x16ed('0x4'));var config=require(_0x16ed('0x5'));var logger=require('../../../../config/logger')(_0x16ed('0x6'));config['redis']=_[_0x16ed('0x7')](config[_0x16ed('0x8')],{'host':_0x16ed('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x16ed('0x8')]));var headers={'Content-Type':'application/json','Accept':_0x16ed('0xa')};function emit(_0x50e1ce,_0x37209f,_0x1eba1e){io['to'](_0x50e1ce)[_0x16ed('0xb')](_0x37209f,_0x1eba1e);}function getTicket(_0x5612f5,_0x2f1642,_0x5e6054,_0x4c5bc8,_0x43f977){logger[_0x16ed('0xc')]('Creating\x20new\x20ticket...');var _0xc50142=_[_0x16ed('0xd')]({'responder_id':_0x2f1642['id'],'requester_id':_0x5e6054['id'],'name':util[_0x16ed('0xe')](_0x16ed('0xf'),_0x43f977[_0x16ed('0x10')]),'phone':_0x43f977[_0x16ed('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x16ed('0x12')](_0x4c5bc8[_0x16ed('0x13')],_0x43f977,'\x20'),'description':intUtil[_0x16ed('0x12')](_0x4c5bc8[_0x16ed('0x14')],_0x43f977,'
'),'tags':getTags(_0x4c5bc8['Tags'],_0x16ed('0x15'))},getCustomFields(_0x4c5bc8[_0x16ed('0x16')],_0x43f977));_0xc50142[_0x16ed('0x17')]=_[_0x16ed('0x18')](_[_0x16ed('0x19')](_0xc50142[_0x16ed('0x17')],'id'),_0x16ed('0x1a'));return request({'uri':util['format'](_0x16ed('0x1b'),_0x5612f5[_0x16ed('0x1c')]),'method':'POST','body':_0xc50142})[_0x16ed('0x1d')](function(_0x58e419){logger[_0x16ed('0xc')](_0x16ed('0x1e'));return _0x58e419;});}function getUser(_0x10406f,_0x3b544b){if(intUtil[_0x16ed('0x1f')](_0x3b544b)){return request({'uri':util[_0x16ed('0xe')]('%s/api/v2/agents',_0x10406f['remoteUri']),'qs':{'email':_0x3b544b}})[_0x16ed('0x1d')](function(_0x40c64f){if(_0x40c64f[_0x16ed('0x20')]){logger[_0x16ed('0xc')](_0x16ed('0x21'));return _[_0x16ed('0x22')](_0x40c64f,function(_0xb7373a){return _0xb7373a[_0x16ed('0x23')][_0x16ed('0x24')]===_0x3b544b;});}else{logger[_0x16ed('0xc')](_0x16ed('0x25'));return request({'uri':util[_0x16ed('0xe')](_0x16ed('0x26'),_0x10406f['remoteUri'])})[_0x16ed('0x1d')](function(_0x3db500){logger[_0x16ed('0xc')](_0x16ed('0x27'));return _0x3db500;});}});}else{logger[_0x16ed('0xc')](_0x16ed('0x28'));return request({'uri':util['format'](_0x16ed('0x26'),_0x10406f[_0x16ed('0x1c')])})[_0x16ed('0x1d')](function(_0xdfe15b){logger[_0x16ed('0xc')](_0x16ed('0x27'));return _0xdfe15b;});}}function getEndUser(_0x28abb6,_0x9bba2,_0x307471){logger[_0x16ed('0xc')](_0x16ed('0x29'),_0x307471);return request({'uri':util[_0x16ed('0xe')](_0x16ed('0x2a'),_0x28abb6[_0x16ed('0x1c')]),'qs':{'phone':_0x307471}})[_0x16ed('0x1d')](function(_0x2b9aaa){if(_0x2b9aaa['length']){logger['info'](_0x16ed('0x2b'));return _[_0x16ed('0x22')](_0x2b9aaa,{'phone':_0x307471});}else{logger[_0x16ed('0xc')](_0x16ed('0x2c'));return request({'uri':util['format'](_0x16ed('0x2a'),_0x28abb6[_0x16ed('0x1c')]),'method':_0x16ed('0x2d'),'body':{'name':_0x9bba2,'phone':_0x307471}})['then'](function(_0x543998){logger[_0x16ed('0xc')](_0x16ed('0x2e'));return _0x543998;});}});}function getAuth(_0x437ce8){return util[_0x16ed('0xe')](_0x16ed('0x2f'),new Buffer(_0x437ce8[_0x16ed('0x30')]+':X')[_0x16ed('0x31')]('base64'));}function request(_0x3e147f){logger[_0x16ed('0x32')]('[HTTP]',JSON[_0x16ed('0x33')](_0x3e147f));return rp(_[_0x16ed('0x7')](_0x3e147f,{'method':_0x16ed('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x200a97,_0x2f311e){var _0x140e0e=[];if(_0x200a97&&_0x200a97[_0x16ed('0x20')]>0x0){_0x140e0e=_[_0x16ed('0x35')](_0x200a97,_0x2f311e);}return _0x140e0e;}function getCustomFields(_0x258ab5,_0x352d53){var _0x3d415e=[];var _0x576eae={'custom_fields':[]};if(_0x258ab5[_0x16ed('0x20')]>0x0){_['forEach'](_0x258ab5,function(_0x50dba8){if(_0x50dba8['type']===_0x16ed('0x36')&&_0x50dba8[_0x16ed('0x37')]&&!_0x50dba8[_0x16ed('0x38')]){_0x576eae[_0x50dba8[_0x16ed('0x37')][_0x16ed('0x39')]()]=_0x50dba8[_0x16ed('0x3a')][_0x16ed('0x31')]();}else if(_0x50dba8['type']===_0x16ed('0x36')&&_0x50dba8[_0x16ed('0x3b')]&&_0x50dba8[_0x16ed('0x38')]){_0x576eae[_0x16ed('0x17')][_0x16ed('0x3c')]({'id':_0x50dba8[_0x16ed('0x3b')],'value':_0x50dba8[_0x16ed('0x3a')][_0x16ed('0x31')]()});}else if(_0x50dba8[_0x16ed('0x3d')]===_0x16ed('0x3e')&&_0x50dba8[_0x16ed('0x3f')]&&_0x50dba8[_0x16ed('0x3b')]&&_0x50dba8[_0x16ed('0x38')]){_0x352d53[_0x50dba8[_0x16ed('0x3f')]]&&_0x576eae['custom_fields'][_0x16ed('0x3c')]({'id':_0x50dba8[_0x16ed('0x3b')],'value':_0x352d53[_0x50dba8['variableName']][_0x16ed('0x31')]()});}else if(_0x50dba8[_0x16ed('0x3d')]===_0x16ed('0x40')&&_0x50dba8[_0x16ed('0x41')]&&_0x50dba8[_0x16ed('0x41')][_0x16ed('0x15')]&&_0x50dba8['idField']&&_0x50dba8[_0x16ed('0x38')]){_0x352d53[_0x50dba8['Variable']['name'][_0x16ed('0x39')]()]&&_0x576eae['custom_fields'][_0x16ed('0x3c')]({'id':_0x50dba8[_0x16ed('0x3b')],'value':_0x352d53[_0x50dba8[_0x16ed('0x41')][_0x16ed('0x15')][_0x16ed('0x39')]()]['toString']()});}});}return _0x576eae;}exports[_0x16ed('0x42')]=function(_0x3134a4,_0x12a5af,_0x288ae7,_0x33fd3c,_0x5927dd,_0x121534){var _0x1a4ec6,_0x10f3bc;_0x121534[_0x16ed('0x1c')]=intUtil[_0x16ed('0x43')](_0x121534[_0x16ed('0x1c')]);_0x121534['serverUrl']=intUtil[_0x16ed('0x43')](_0x121534[_0x16ed('0x44')]);if(_0x5927dd&&_0x5927dd['monitor_format']){logger[_0x16ed('0xc')](_0x16ed('0x45'),_0x16ed('0x46'));_0x12a5af[_0x16ed('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x121534[_0x16ed('0x44')],_0x12a5af[_0x16ed('0x48')],md5(_0x12a5af[_0x16ed('0x48')]));}else{_0x12a5af[_0x16ed('0x47')]='';}headers[_0x16ed('0x49')]=getAuth(_0x121534);return getUser(_0x121534,_0x33fd3c[_0x16ed('0x24')])[_0x16ed('0x1d')](function(_0x2af966){_0x1a4ec6=_0x2af966;logger[_0x16ed('0xc')]('The\x20User\x20ID\x20is:',_0x1a4ec6['id']);return getEndUser(_0x121534,_0x12a5af['calleridname'],_0x12a5af['calleridnum']);})[_0x16ed('0x1d')](function(_0x3d1c10){_0x10f3bc=_0x3d1c10;logger[_0x16ed('0xc')](_0x16ed('0x4a'),_0x10f3bc['id']);return getTicket(_0x121534,_0x1a4ec6,_0x10f3bc,_0x288ae7,_0x12a5af);})['then'](function(_0xf1621a){if(_0xf1621a&&_0xf1621a['id']){logger[_0x16ed('0xc')](_0x16ed('0x1e'));logger[_0x16ed('0xc')](_0x16ed('0x4b'),_0xf1621a['id']);logger[_0x16ed('0xc')](_0x16ed('0x45'),_0x16ed('0x4c'));emit(util[_0x16ed('0xe')](_0x16ed('0x4d'),_0x33fd3c[_0x16ed('0x15')]),_0x16ed('0x4e'),{'uri':util[_0x16ed('0xe')](_0x16ed('0x4f'),_0x121534[_0x16ed('0x1c')],_0xf1621a['id'])});}})['catch'](function(_0x21c8f6){logger[_0x16ed('0x50')](_0x16ed('0x45'),JSON[_0x16ed('0x33')](_0x21c8f6));});};exports['outbound']=function(_0x48269a,_0x53370a,_0x518a4b,_0x1155d4,_0x397ef8,_0x4fb2cc,_0x35860b){var _0x2e4d5d,_0x4ee4cd;_0x4fb2cc[_0x16ed('0x1c')]=intUtil[_0x16ed('0x43')](_0x4fb2cc['remoteUri']);_0x4fb2cc[_0x16ed('0x44')]=intUtil[_0x16ed('0x43')](_0x4fb2cc[_0x16ed('0x44')]);if(_0x35860b&&_0x35860b['recordingFormat']&&_0x35860b['recordingFormat']!==_0x16ed('0x51')){logger[_0x16ed('0xc')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x53370a['recordingURL']=util[_0x16ed('0xe')](_0x16ed('0x52'),_0x4fb2cc['serverUrl'],_0x53370a['uniqueid'],md5(_0x53370a[_0x16ed('0x48')]));}headers[_0x16ed('0x49')]=getAuth(_0x4fb2cc);return getUser(_0x4fb2cc,_0x1155d4[_0x16ed('0x24')])['then'](function(_0x20ba8c){_0x2e4d5d=_0x20ba8c;logger[_0x16ed('0xc')]('The\x20User\x20ID\x20is:',_0x2e4d5d['id']);return getEndUser(_0x4fb2cc,_0x53370a[_0x16ed('0x53')],_0x53370a[_0x16ed('0x54')]);})[_0x16ed('0x1d')](function(_0x1fa1d0){_0x4ee4cd=_0x1fa1d0;logger[_0x16ed('0xc')](_0x16ed('0x4a'),_0x4ee4cd['id']);return getTicket(_0x4fb2cc,_0x2e4d5d,_0x4ee4cd,_0x518a4b,_0x53370a);})[_0x16ed('0x1d')](function(_0x20df31){if(_0x20df31&&_0x20df31['id']){logger[_0x16ed('0xc')](_0x16ed('0x1e'));logger[_0x16ed('0xc')](_0x16ed('0x4b'),_0x20df31['id']);logger[_0x16ed('0xc')]('[OUTBOUND]',_0x16ed('0x4c'));emit(util[_0x16ed('0xe')]('user:%s',_0x1155d4['name']),_0x16ed('0x4e'),{'uri':util[_0x16ed('0xe')]('%s/helpdesk/tickets/%d',_0x4fb2cc[_0x16ed('0x1c')],_0x20df31['id'])});}})[_0x16ed('0x55')](function(_0x55b932){logger[_0x16ed('0x50')](_0x16ed('0x56'),JSON[_0x16ed('0x33')](_0x55b932));});};exports[_0x16ed('0x57')]=function(_0x1c5784,_0x26e38c,_0x75a84a,_0x5b54b9,_0x3f76b2,_0x47e978){var _0x5564db,_0x348177;_0x47e978[_0x16ed('0x1c')]=intUtil[_0x16ed('0x43')](_0x47e978['remoteUri']);_0x47e978[_0x16ed('0x44')]=intUtil[_0x16ed('0x43')](_0x47e978[_0x16ed('0x44')]);if(_0x3f76b2&&_0x3f76b2[_0x16ed('0x58')]){logger[_0x16ed('0xc')]('[ABANDONED]',_0x16ed('0x46'));_0x26e38c[_0x16ed('0x47')]=util[_0x16ed('0xe')](_0x16ed('0x52'),_0x47e978['serverUrl'],_0x26e38c['uniqueid'],md5(_0x26e38c['uniqueid']));}else{_0x26e38c[_0x16ed('0x47')]='';}headers[_0x16ed('0x49')]=getAuth(_0x47e978);return getUser(_0x47e978,'')['then'](function(_0x181ad7){_0x5564db=_0x181ad7;logger['info'](_0x16ed('0x59'),_0x5564db['id']);return getEndUser(_0x47e978,_0x26e38c['calleridname'],_0x26e38c[_0x16ed('0x11')]);})['then'](function(_0x4e6f33){_0x348177=_0x4e6f33;logger[_0x16ed('0xc')](_0x16ed('0x4a'),_0x348177['id']);return getTicket(_0x47e978,_0x5564db,_0x348177,_0x75a84a,_0x26e38c);})['then'](function(_0xe5c749){if(_0xe5c749){logger[_0x16ed('0xc')](_0x16ed('0x1e'));logger[_0x16ed('0xc')](_0x16ed('0x4b'),_0xe5c749['id']);}})[_0x16ed('0x55')](function(_0x44d629){logger[_0x16ed('0x50')]('[ABANDONED]',JSON['stringify'](_0x44d629));});}; \ 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 2a8de0b..68f3769 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 _0xb9aa=['./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','sugarcrm','zoho','desk','vtiger','servicenow','dynamics365','exec','includes','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound','log','abandoned','freshdesk','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','error','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xb9aa,0xc0));var _0xab9a=function(_0x38447d,_0x4c3dcf){_0x38447d=_0x38447d-0x0;var _0x1f6025=_0xb9aa[_0x38447d];return _0x1f6025;};'use strict';var _=require(_0xab9a('0x0'));var util=require(_0xab9a('0x1'));var zendesk=require(_0xab9a('0x2'));var salesforce=require(_0xab9a('0x3'));var sugarcrm=require(_0xab9a('0x4'));var freshdesk=require(_0xab9a('0x5'));var zoho=require('./zoho');var desk=require(_0xab9a('0x6'));var vtiger=require(_0xab9a('0x7'));var servicenow=require(_0xab9a('0x8'));var dynamics365=require(_0xab9a('0x9'));var integrations=[_0xab9a('0xa'),_0xab9a('0xb'),_0xab9a('0xc'),'freshdesk',_0xab9a('0xd'),_0xab9a('0xe'),_0xab9a('0xf'),_0xab9a('0x10'),_0xab9a('0x11')];exports[_0xab9a('0x12')]=function(_0x5488ed,_0x14310b,_0x53ee6d,_0x190ee1,_0x3900f0,_0x322f08){if(_0x53ee6d){if(_[_0xab9a('0x13')](integrations,_0x5488ed[_0xab9a('0x14')][_0xab9a('0x15')]())){try{var _0x5b4502=null;var _0x408601='';var _0x5a8f96=_0x53ee6d[_0x5488ed[_0xab9a('0x14')][_0xab9a('0x15')]()];if(_0x5a8f96){var _0x4cdc10=_0x5a8f96[_0x5488ed[_0xab9a('0x16')]];if(_0x4cdc10){var _0x3961dc=_[_0xab9a('0x17')](_0x4cdc10[_0xab9a('0x18')],{'id':parseInt(_0x5488ed['data3'],0xa)});if(_0x3961dc){if(_0x190ee1){if(_0x3900f0&&_0x14310b[_0xab9a('0x19')]){_0x408601=_0xab9a('0x19');}else if(_0x14310b[_0xab9a('0x1a')]){_0x408601=_0xab9a('0x1b');}else{console[_0xab9a('0x1c')]('EVENT\x20UNKNOWN',_0x14310b);}}else{_0x408601=_0xab9a('0x1d');}switch(_0x5488ed[_0xab9a('0x14')]['toLowerCase']()){case _0xab9a('0xa'):zendesk[_0x408601](_0x5488ed,_0x14310b,_0x3961dc,_0x190ee1,_0x3900f0,_0x4cdc10,_0x322f08);break;case _0xab9a('0xb'):salesforce[_0x408601](_0x5488ed,_0x14310b,_0x3961dc,_0x190ee1,_0x3900f0,_0x4cdc10,_0x322f08);break;case _0xab9a('0xc'):sugarcrm[_0x408601](_0x5488ed,_0x14310b,_0x3961dc,_0x190ee1,_0x3900f0,_0x4cdc10,_0x322f08);break;case _0xab9a('0x1e'):freshdesk[_0x408601](_0x5488ed,_0x14310b,_0x3961dc,_0x190ee1,_0x3900f0,_0x4cdc10,_0x322f08);break;case _0xab9a('0xd'):zoho[_0x408601](_0x5488ed,_0x14310b,_0x3961dc,_0x190ee1,_0x3900f0,_0x4cdc10,_0x322f08);break;case _0xab9a('0xe'):desk[_0x408601](_0x5488ed,_0x14310b,_0x3961dc,_0x190ee1,_0x3900f0,_0x4cdc10,_0x322f08);break;case'vtiger':vtiger[_0x408601](_0x5488ed,_0x14310b,_0x3961dc,_0x190ee1,_0x3900f0,_0x4cdc10,_0x322f08);break;case _0xab9a('0x10'):servicenow['cs'](_0x5488ed,_0x14310b,_0x3961dc,_0x190ee1,_0x3900f0,_0x4cdc10,_0x322f08,_0x408601);break;case _0xab9a('0x11'):dynamics365['cs'](_0x5488ed,_0x14310b,_0x3961dc,_0x190ee1,_0x3900f0,_0x4cdc10,_0x322f08,_0x408601);break;default:console['log'](_0xab9a('0x1f'));}}else{_0x5b4502=require(_0xab9a('0x20'))(_0x5488ed[_0xab9a('0x14')][_0xab9a('0x15')]());_0x5b4502['error'](_0xab9a('0x21'),util[_0xab9a('0x22')](_0xab9a('0x23'),_0x5488ed['data1']['toLowerCase'](),_0x5488ed[_0xab9a('0x24')]));}}else{_0x5b4502=require(_0xab9a('0x20'))(_0x5488ed[_0xab9a('0x14')][_0xab9a('0x15')]());_0x5b4502[_0xab9a('0x25')](_0xab9a('0x21'),util[_0xab9a('0x22')](_0xab9a('0x26'),_0x5488ed[_0xab9a('0x14')][_0xab9a('0x15')](),_0x5488ed['data2']));}}else{}}catch(_0x10e3b1){console[_0xab9a('0x25')](_0x10e3b1);}}}}; \ No newline at end of file +var _0xa756=['./vtiger','./servicenow','./dynamics365','zendesk','sugarcrm','freshdesk','zoho','servicenow','dynamics365','exec','data1','data2','find','queue','outbound','EVENT\x20UNKNOWN','abandoned','toLowerCase','salesforce','vtiger','log','unknown\x20integration','[EXEC]','../../../../config/logger','format','%s\x20account\x20#%s\x20not\x20found','error','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk'];(function(_0x1cfc8c,_0x172bf6){var _0x20393f=function(_0x9628b){while(--_0x9628b){_0x1cfc8c['push'](_0x1cfc8c['shift']());}};_0x20393f(++_0x172bf6);}(_0xa756,0xe7));var _0x6a75=function(_0x47ff9c,_0x5e4c9e){_0x47ff9c=_0x47ff9c-0x0;var _0x482bde=_0xa756[_0x47ff9c];return _0x482bde;};'use strict';var _=require('lodash');var util=require(_0x6a75('0x0'));var zendesk=require(_0x6a75('0x1'));var salesforce=require(_0x6a75('0x2'));var sugarcrm=require(_0x6a75('0x3'));var freshdesk=require(_0x6a75('0x4'));var zoho=require(_0x6a75('0x5'));var desk=require(_0x6a75('0x6'));var vtiger=require(_0x6a75('0x7'));var servicenow=require(_0x6a75('0x8'));var dynamics365=require(_0x6a75('0x9'));var integrations=[_0x6a75('0xa'),'salesforce',_0x6a75('0xb'),_0x6a75('0xc'),_0x6a75('0xd'),'desk','vtiger',_0x6a75('0xe'),_0x6a75('0xf')];exports[_0x6a75('0x10')]=function(_0x61b43b,_0xe194f7,_0x36e5dc,_0x1016be,_0x303f0b,_0x4aa729){if(_0x36e5dc){if(_['includes'](integrations,_0x61b43b[_0x6a75('0x11')]['toLowerCase']())){try{var _0x222753=null;var _0x1020cd='';var _0x332c53=_0x36e5dc[_0x61b43b[_0x6a75('0x11')]['toLowerCase']()];if(_0x332c53){var _0x159395=_0x332c53[_0x61b43b[_0x6a75('0x12')]];if(_0x159395){var _0x246b38=_[_0x6a75('0x13')](_0x159395['Configurations'],{'id':parseInt(_0x61b43b['data3'],0xa)});if(_0x246b38){if(_0x1016be){if(_0x303f0b&&_0xe194f7[_0x6a75('0x14')]){_0x1020cd=_0x6a75('0x14');}else if(_0xe194f7['routeId']){_0x1020cd=_0x6a75('0x15');}else{console['log'](_0x6a75('0x16'),_0xe194f7);}}else{_0x1020cd=_0x6a75('0x17');}switch(_0x61b43b[_0x6a75('0x11')][_0x6a75('0x18')]()){case'zendesk':zendesk[_0x1020cd](_0x61b43b,_0xe194f7,_0x246b38,_0x1016be,_0x303f0b,_0x159395,_0x4aa729);break;case _0x6a75('0x19'):salesforce[_0x1020cd](_0x61b43b,_0xe194f7,_0x246b38,_0x1016be,_0x303f0b,_0x159395,_0x4aa729);break;case _0x6a75('0xb'):sugarcrm[_0x1020cd](_0x61b43b,_0xe194f7,_0x246b38,_0x1016be,_0x303f0b,_0x159395,_0x4aa729);break;case'freshdesk':freshdesk[_0x1020cd](_0x61b43b,_0xe194f7,_0x246b38,_0x1016be,_0x303f0b,_0x159395,_0x4aa729);break;case _0x6a75('0xd'):zoho[_0x1020cd](_0x61b43b,_0xe194f7,_0x246b38,_0x1016be,_0x303f0b,_0x159395,_0x4aa729);break;case'desk':desk[_0x1020cd](_0x61b43b,_0xe194f7,_0x246b38,_0x1016be,_0x303f0b,_0x159395,_0x4aa729);break;case _0x6a75('0x1a'):vtiger[_0x1020cd](_0x61b43b,_0xe194f7,_0x246b38,_0x1016be,_0x303f0b,_0x159395,_0x4aa729);break;case'servicenow':servicenow['cs'](_0x61b43b,_0xe194f7,_0x246b38,_0x1016be,_0x303f0b,_0x159395,_0x4aa729,_0x1020cd);break;case _0x6a75('0xf'):dynamics365['cs'](_0x61b43b,_0xe194f7,_0x246b38,_0x1016be,_0x303f0b,_0x159395,_0x4aa729,_0x1020cd);break;default:console[_0x6a75('0x1b')](_0x6a75('0x1c'));}}else{_0x222753=require('../../../../config/logger')(_0x61b43b[_0x6a75('0x11')][_0x6a75('0x18')]());_0x222753['error'](_0x6a75('0x1d'),util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x61b43b[_0x6a75('0x11')][_0x6a75('0x18')](),_0x61b43b['data3']));}}else{_0x222753=require(_0x6a75('0x1e'))(_0x61b43b[_0x6a75('0x11')]['toLowerCase']());_0x222753['error'](_0x6a75('0x1d'),util[_0x6a75('0x1f')](_0x6a75('0x20'),_0x61b43b[_0x6a75('0x11')]['toLowerCase'](),_0x61b43b[_0x6a75('0x12')]));}}else{}}catch(_0x410a82){console[_0x6a75('0x21')](_0x410a82);}}}}; \ 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 0571dc7..4556e4c 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 _0xcb91=['concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','user:%s','newTab','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','stringify','outbound','recordingFormat','[OUTBOUND]','uniqueid','Fields','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','abandoned','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','moment','bluebird','md5','jsforce','ioredis','./util','../../../../config/logger','salesforce','defaults','redis','socket.io-emitter','ticketType','Task','Subjects','getString','Descriptions','WhoId','Case','assign','sobject','create','isNil','User','find','execute','then','Email','info','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','resolve','moduleSearch','contact_lead','Contact','length','Lead','contact','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','Phone','Enduser\x20with\x20phone\x20%s\x20found.','','format','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','lead','Company','No\x20Company','upperFirst','type','string','idField','content','variableName','customVariable','name','Variable','toLowerCase','password'];(function(_0xfa514e,_0x2665aa){var _0x39d8b0=function(_0x46328e){while(--_0x46328e){_0xfa514e['push'](_0xfa514e['shift']());}};_0x39d8b0(++_0x2665aa);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x136a0d,_0x476fe2){_0x136a0d=_0x136a0d-0x0;var _0x212ea5=_0xcb91[_0x136a0d];return _0x212ea5;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var md5=require(_0x1cb9('0x2'));var jsforce=require(_0x1cb9('0x3'));var util=require('util');var Redis=require(_0x1cb9('0x4'));var intUtil=require(_0x1cb9('0x5'));var config=require('../../../../config/environment');var logger=require(_0x1cb9('0x6'))(_0x1cb9('0x7'));config['redis']=_[_0x1cb9('0x8')](config[_0x1cb9('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0xa'))(new Redis(config[_0x1cb9('0x9')]));function emit(_0x59d1be,_0x3ae0f1,_0x5a0e99){io['to'](_0x59d1be)['emit'](_0x3ae0f1,_0x5a0e99);}function getTicket(_0x45a12f,_0x2fa15c,_0x74ce19,_0x1f0eca,_0x2fc627,_0x50ce71,_0x9b58f1,_0x44a6b4){var _0x3af35f={};if(_0x1f0eca[_0x1cb9('0xb')]===_0x1cb9('0xc')){_0x3af35f=Object['assign']({},{'OwnerId':_0x2fa15c['id'],'ActivityDate':moment['utc'](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil['getString'](_0x1f0eca[_0x1cb9('0xd')],_0x2fc627,'\x20'),'Description':intUtil[_0x1cb9('0xe')](_0x1f0eca[_0x1cb9('0xf')],_0x2fc627,'\x0a')},getCustomFields(_0x50ce71,_0x2fc627));if(_0x74ce19){_0x3af35f[_0x1cb9('0x10')]=_0x74ce19['id'];}}else if(_0x1f0eca['ticketType']===_0x1cb9('0x11')){_0x3af35f=Object[_0x1cb9('0x12')]({},{'OwnerId':_0x2fa15c['id'],'Subject':intUtil[_0x1cb9('0xe')](_0x1f0eca[_0x1cb9('0xd')],_0x2fc627,'\x20'),'Description':intUtil[_0x1cb9('0xe')](_0x1f0eca['Descriptions'],_0x2fc627,'\x0a')},getCustomFields(_0x50ce71,_0x2fc627));if(_0x74ce19){_0x3af35f['ContactId']=_0x74ce19['id'];}}return _0x9b58f1[_0x1cb9('0x13')](_0x1f0eca[_0x1cb9('0xb')])[_0x1cb9('0x14')](_0x3af35f);}function getUser(_0x3f1376,_0x3e21e0,_0xf22920){if(!_[_0x1cb9('0x15')](_0x3e21e0)&&intUtil['validateEmail'](_0x3e21e0)){var _0x479d43={'Email':_0x3e21e0};var _0x1b2fa6={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xf22920[_0x1cb9('0x13')](_0x1cb9('0x16'))[_0x1cb9('0x17')](_0x479d43,_0x1b2fa6)[_0x1cb9('0x18')]()[_0x1cb9('0x19')](function(_0x24fa1f){if(_0x24fa1f['length']){var _0x559bcc=_[_0x1cb9('0x17')](_0x24fa1f,function(_0x5dbfae){return _0x5dbfae[_0x1cb9('0x1a')]===_0x3e21e0;});if(_0x559bcc){logger[_0x1cb9('0x1b')]('Agent\x20%s\x20found.',_0x3e21e0);return BPromise['resolve']({'id':_0x559bcc['Id'],'name':_0x559bcc[_0x1cb9('0x1c')]});}}else{logger[_0x1cb9('0x1b')](_0x1cb9('0x1d'),_0x3e21e0);return _0xf22920[_0x1cb9('0x1e')]()[_0x1cb9('0x19')](function(_0x27db16){return BPromise['resolve']({'id':_0x27db16['user_id'],'name':_0x27db16[_0x1cb9('0x1f')]});});}});}else{logger['info'](_0x1cb9('0x1d'),_0x3e21e0);return _0xf22920[_0x1cb9('0x1e')]()[_0x1cb9('0x19')](function(_0x44d3c4){return BPromise[_0x1cb9('0x20')]({'id':_0x44d3c4['user_id'],'name':_0x44d3c4[_0x1cb9('0x1f')]});});}}function getEndUser(_0x9df250,_0x4c8d76,_0xd6891c,_0x21effa,_0x41a9a0){var _0x1804fd={'Phone':_0x21effa};var _0x406821={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x1cb9('0x20')]()[_0x1cb9('0x19')](function(){if(_0x4c8d76[_0x1cb9('0xb')]===_0x1cb9('0xc')){logger[_0x1cb9('0x1b')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x21effa,_0x4c8d76[_0x1cb9('0x21')]);switch(_0x4c8d76['moduleSearch']){case _0x1cb9('0x22'):return _0x41a9a0['sobject'](_0x1cb9('0x23'))[_0x1cb9('0x17')](_0x1804fd,_0x406821)[_0x1cb9('0x18')]()[_0x1cb9('0x19')](function(_0x561d89){if(_0x561d89&&_0x561d89[_0x1cb9('0x24')]){return _0x561d89;}else{return _0x41a9a0['sobject'](_0x1cb9('0x25'))[_0x1cb9('0x17')](_0x1804fd,_0x406821);}});case _0x1cb9('0x26'):return _0x41a9a0['sobject'](_0x1cb9('0x23'))['find'](_0x1804fd,_0x406821)[_0x1cb9('0x18')]();case'lead':return _0x41a9a0[_0x1cb9('0x13')](_0x1cb9('0x25'))[_0x1cb9('0x17')](_0x1804fd,_0x406821);default:return null;}}else if(_0x4c8d76[_0x1cb9('0xb')]==='Case'){logger[_0x1cb9('0x1b')](_0x1cb9('0x27'),_0x21effa,_0x1cb9('0x26'));return _0x41a9a0[_0x1cb9('0x13')](_0x1cb9('0x23'))[_0x1cb9('0x17')](_0x1804fd,_0x406821)[_0x1cb9('0x18')]();}})[_0x1cb9('0x19')](function(_0x386e8b){if(_0x386e8b&&_0x386e8b[_0x1cb9('0x24')]){var _0x294eec=_[_0x1cb9('0x17')](_0x386e8b,function(_0x29f149){return _0x29f149['Phone']===_0x21effa;});if(_0x294eec){return BPromise['resolve']({'id':_0x294eec['Id'],'name':_0x294eec[_0x1cb9('0x1c')],'phone':_0x294eec[_0x1cb9('0x28')]});}}})[_0x1cb9('0x19')](function(_0x29f451){if(_0x29f451){logger[_0x1cb9('0x1b')](_0x1cb9('0x29'),_0x21effa);return BPromise[_0x1cb9('0x20')](_0x29f451);}else{logger[_0x1cb9('0x1b')]('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x21effa);var _0x2aa59b={'LastName':_0xd6891c!==_0x1cb9('0x2a')?_0xd6891c:util[_0x1cb9('0x2b')]('Caller\x20-\x20%s',_0x21effa),'Phone':_0x21effa};if(_0x4c8d76[_0x1cb9('0x2c')]){if(_0x4c8d76['moduleCreate']===_0x1cb9('0x26')){logger['info'](_0x1cb9('0x2d'),_0x21effa,_0x4c8d76[_0x1cb9('0x2c')]);}else if(_0x4c8d76[_0x1cb9('0x2c')]===_0x1cb9('0x2e')&&_0x4c8d76[_0x1cb9('0xb')]===_0x1cb9('0xc')){logger[_0x1cb9('0x1b')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x21effa,_0x4c8d76['moduleCreate']);_0x2aa59b[_0x1cb9('0x2f')]=_0x1cb9('0x30');}else{return null;}}return _0x41a9a0[_0x1cb9('0x13')](_[_0x1cb9('0x31')](_0x4c8d76[_0x1cb9('0x2c')]))[_0x1cb9('0x14')](_0x2aa59b);}});}function getCustomFields(_0x32130b,_0x4a670c){var _0xbcaa32={};if(_0x32130b['length']>0x0){_['forEach'](_0x32130b,function(_0x4c6c75){if(_0x4c6c75[_0x1cb9('0x32')]===_0x1cb9('0x33')&&_0x4c6c75[_0x1cb9('0x34')]){_0xbcaa32[_0x4c6c75[_0x1cb9('0x34')]]=_0x4c6c75[_0x1cb9('0x35')]['toString']();}else if(_0x4c6c75[_0x1cb9('0x32')]==='variable'&&_0x4c6c75[_0x1cb9('0x36')]&&_0x4c6c75[_0x1cb9('0x34')]){_0x4a670c[_0x4c6c75[_0x1cb9('0x36')]]&&(_0xbcaa32[_0x4c6c75['idField']]=_0x4a670c[_0x4c6c75[_0x1cb9('0x36')]]['toString']());}else if(_0x4c6c75[_0x1cb9('0x32')]===_0x1cb9('0x37')&&_0x4c6c75['Variable']&&_0x4c6c75['Variable'][_0x1cb9('0x38')]&&_0x4c6c75[_0x1cb9('0x34')]){_0x4a670c[_0x4c6c75[_0x1cb9('0x39')][_0x1cb9('0x38')][_0x1cb9('0x3a')]()]&&(_0xbcaa32[_0x4c6c75['idField']]=_0x4a670c[_0x4c6c75[_0x1cb9('0x39')]['name']['toLowerCase']()]['toString']());}});}return _0xbcaa32;}function getConnection(_0x398d04){var _0x242ec4=_0x398d04[_0x1cb9('0x3b')][_0x1cb9('0x3c')](_0x398d04[_0x1cb9('0x3d')]);var _0x2a8b7f=new jsforce[(_0x1cb9('0x3e'))]({'oauth2':{'loginUrl':_0x398d04[_0x1cb9('0x3f')]||_0x1cb9('0x40'),'clientId':_0x398d04[_0x1cb9('0x41')],'clientSecret':_0x398d04[_0x1cb9('0x42')]}});return _0x2a8b7f['login'](_0x398d04[_0x1cb9('0x43')],_0x242ec4)[_0x1cb9('0x19')](function(){logger[_0x1cb9('0x1b')]('Connection\x20established.');return _0x2a8b7f;});}exports[_0x1cb9('0x44')]=function(_0x57251,_0x3c6044,_0x2efdbb,_0x4599a4,_0x4791ee,_0x2c18c6){var _0x59d76b,_0x2eaa11,_0x4ac483,_0x1cf2ee;_0x2c18c6[_0x1cb9('0x45')]=intUtil[_0x1cb9('0x46')](_0x2c18c6[_0x1cb9('0x45')]);_0x2c18c6['remoteUri']=intUtil[_0x1cb9('0x46')](_0x2c18c6[_0x1cb9('0x3f')]);if(_0x4791ee&&_0x4791ee[_0x1cb9('0x47')]){logger[_0x1cb9('0x1b')](_0x1cb9('0x48'),_0x1cb9('0x49'));_0x3c6044[_0x1cb9('0x4a')]=util[_0x1cb9('0x2b')](_0x1cb9('0x4b'),_0x2c18c6[_0x1cb9('0x45')],_0x3c6044['uniqueid'],md5(_0x3c6044['uniqueid']));}else{_0x3c6044[_0x1cb9('0x4a')]='';}return getConnection(_0x2c18c6)[_0x1cb9('0x19')](function(_0x19e83a){_0x1cf2ee=_0x19e83a;return getUser(_0x2c18c6,_0x4599a4[_0x1cb9('0x4c')],_0x1cf2ee);})[_0x1cb9('0x19')](function(_0x2d076b){_0x59d76b=_0x2d076b;return getEndUser(_0x2c18c6,_0x2efdbb,_0x3c6044[_0x1cb9('0x4d')],_0x3c6044[_0x1cb9('0x4e')],_0x1cf2ee);})[_0x1cb9('0x19')](function(_0x166ca2){_0x2eaa11=_0x166ca2;return getTicket(_0x2c18c6,_0x59d76b,_0x2eaa11,_0x2efdbb,_0x3c6044,_0x2efdbb['Fields'],_0x1cf2ee,_0x1cb9('0x44'));})['then'](function(_0x222aa4){_0x4ac483=_0x222aa4;logger['info'](_0x1cb9('0x4f'),_0x4ac483['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4ac483['id'],_0x4599a4[_0x1cb9('0x38')],_0x2c18c6[_0x1cb9('0x32')]);switch(_0x2c18c6[_0x1cb9('0x32')]){case'integrationTab':emit(util[_0x1cb9('0x2b')](_0x1cb9('0x50'),_0x4599a4['name']),'trigger:salesforce:display',{'recordId':_0x4ac483['id']});break;case _0x1cb9('0x51'):emit(util[_0x1cb9('0x2b')](_0x1cb9('0x50'),_0x4599a4[_0x1cb9('0x38')]),_0x1cb9('0x52'),{'uri':util[_0x1cb9('0x2b')](_0x1cb9('0x53'),_0x1cf2ee['instanceUrl'],_0x4ac483['id'])});break;default:logger[_0x1cb9('0x54')](_0x1cb9('0x55'));}})[_0x1cb9('0x56')](function(_0x49946f){logger[_0x1cb9('0x54')](_0x1cb9('0x48'),JSON[_0x1cb9('0x57')](_0x49946f));});};exports[_0x1cb9('0x58')]=function(_0x12d283,_0x3c4681,_0x5ae762,_0x37ceb5,_0x36c40d,_0x41e81f,_0x128c5b){var _0x4ad7cd,_0x274c90,_0x1c27d3,_0x3c126a;_0x41e81f[_0x1cb9('0x45')]=intUtil[_0x1cb9('0x46')](_0x41e81f[_0x1cb9('0x45')]);_0x41e81f['remoteUri']=intUtil[_0x1cb9('0x46')](_0x41e81f[_0x1cb9('0x3f')]);if(_0x128c5b&&_0x128c5b[_0x1cb9('0x59')]&&_0x128c5b[_0x1cb9('0x59')]!=='none'){logger['info'](_0x1cb9('0x5a'),_0x1cb9('0x49'));_0x3c4681[_0x1cb9('0x4a')]=util[_0x1cb9('0x2b')](_0x1cb9('0x4b'),_0x41e81f[_0x1cb9('0x45')],_0x3c4681[_0x1cb9('0x5b')],md5(_0x3c4681[_0x1cb9('0x5b')]));}return getConnection(_0x41e81f)['then'](function(_0x49f74c){_0x3c126a=_0x49f74c;return getUser(_0x41e81f,_0x37ceb5[_0x1cb9('0x4c')],_0x3c126a);})['then'](function(_0x5cefa3){_0x4ad7cd=_0x5cefa3;return getEndUser(_0x41e81f,_0x5ae762,_0x3c4681['destcalleridname'],_0x3c4681['destcalleridnum'],_0x3c126a);})['then'](function(_0x455c40){_0x274c90=_0x455c40;return getTicket(_0x41e81f,_0x4ad7cd,_0x274c90,_0x5ae762,_0x3c4681,_0x5ae762[_0x1cb9('0x5c')],_0x3c126a,_0x1cb9('0x58'));})[_0x1cb9('0x19')](function(_0x23d435){_0x1c27d3=_0x23d435;logger[_0x1cb9('0x1b')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x1c27d3['id']);logger[_0x1cb9('0x1b')](_0x1cb9('0x5d'),_0x1c27d3['id'],_0x37ceb5['name'],_0x41e81f['type']);switch(_0x41e81f[_0x1cb9('0x32')]){case _0x1cb9('0x5e'):emit(util[_0x1cb9('0x2b')](_0x1cb9('0x50'),_0x37ceb5[_0x1cb9('0x38')]),'trigger:salesforce:display',{'recordId':_0x1c27d3['id']});break;case'newTab':emit(util['format'](_0x1cb9('0x50'),_0x37ceb5[_0x1cb9('0x38')]),_0x1cb9('0x52'),{'uri':util[_0x1cb9('0x2b')](_0x1cb9('0x53'),_0x3c126a['instanceUrl'],_0x1c27d3['id'])});break;default:logger[_0x1cb9('0x54')](_0x1cb9('0x5a'),'Salesforce\x20account\x20type\x20not\x20recognized');}})['catch'](function(_0x1d914d){logger['error'](_0x1cb9('0x5a'),JSON[_0x1cb9('0x57')](_0x1d914d));});};exports[_0x1cb9('0x5f')]=function(_0x1e7561,_0x3619a2,_0x398779,_0x4aeeff,_0xde0d93,_0x15fc04){var _0x330fc1,_0x17c361,_0x5b5f0d,_0x520d98;_0x15fc04[_0x1cb9('0x45')]=intUtil[_0x1cb9('0x46')](_0x15fc04[_0x1cb9('0x45')]);_0x15fc04[_0x1cb9('0x3f')]=intUtil[_0x1cb9('0x46')](_0x15fc04[_0x1cb9('0x3f')]);if(_0xde0d93&&_0xde0d93['monitor_format']){logger[_0x1cb9('0x1b')]('[ABANDONED]',_0x1cb9('0x49'));_0x3619a2[_0x1cb9('0x4a')]=util['format'](_0x1cb9('0x4b'),_0x15fc04[_0x1cb9('0x45')],_0x3619a2[_0x1cb9('0x5b')],md5(_0x3619a2['uniqueid']));}else{_0x3619a2[_0x1cb9('0x4a')]='';}return getConnection(_0x15fc04)[_0x1cb9('0x19')](function(_0x306abf){_0x520d98=_0x306abf;if(!_[_0x1cb9('0x15')](_0x4aeeff)){return getUser(_0x15fc04,_0x4aeeff[_0x1cb9('0x38')],_0x520d98);}else{return getUser(_0x15fc04,null,_0x520d98);}})[_0x1cb9('0x19')](function(_0x5a3f1d){_0x330fc1=_0x5a3f1d;return getEndUser(_0x15fc04,_0x398779,_0x3619a2[_0x1cb9('0x4d')],_0x3619a2[_0x1cb9('0x4e')],_0x520d98);})[_0x1cb9('0x19')](function(_0x4398dc){_0x17c361=_0x4398dc;return getTicket(_0x15fc04,_0x330fc1,_0x17c361,_0x398779,_0x3619a2,_0x398779[_0x1cb9('0x5c')],_0x520d98);})[_0x1cb9('0x19')](function(_0x128a41){_0x5b5f0d=_0x128a41;logger[_0x1cb9('0x1b')]('[ABANDONED]\x20Ticket\x20%s\x20created.',_0x5b5f0d['id']);logger[_0x1cb9('0x1b')](_0x1cb9('0x60'),_0x15fc04['type']);})[_0x1cb9('0x56')](function(_0x5415fa){logger[_0x1cb9('0x54')]('[ABANDONED]',JSON['stringify'](_0x5415fa));});}; \ No newline at end of file +var _0x9c44=['username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','[QUEUE]','stringify','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','catch','abandoned','isNil','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','[ABANDONED]','moment','bluebird','md5','jsforce','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','ticketType','Task','utc','getString','Descriptions','WhoId','Case','assign','Subjects','ContactId','sobject','create','find','then','length','Email','info','Agent\x20%s\x20found.','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','user_id','display_name','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Contact','execute','Lead','contact','lead','Phone','Name','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','upperFirst','forEach','type','string','idField','content','variable','variableName','customVariable','Variable','name','toLowerCase','toString','concat','securityToken','Connection','remoteUri','clientId','clientSecret','login'];(function(_0x514afe,_0x5ec68d){var _0x200173=function(_0xaca4c3){while(--_0xaca4c3){_0x514afe['push'](_0x514afe['shift']());}};_0x200173(++_0x5ec68d);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var md5=require(_0x49c4('0x2'));var jsforce=require(_0x49c4('0x3'));var util=require(_0x49c4('0x4'));var Redis=require(_0x49c4('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x49c4('0x6'))('salesforce');config[_0x49c4('0x7')]=_[_0x49c4('0x8')](config[_0x49c4('0x7')],{'host':_0x49c4('0x9'),'port':0x18eb});var io=require(_0x49c4('0xa'))(new Redis(config['redis']));function emit(_0x11c586,_0x42e4f8,_0x1d13fb){io['to'](_0x11c586)[_0x49c4('0xb')](_0x42e4f8,_0x1d13fb);}function getTicket(_0x4c7d3a,_0x5ab4a3,_0x451ea6,_0x313e73,_0x58cad7,_0xb611a1,_0x459d09,_0x4adb3c){var _0x536d42={};if(_0x313e73[_0x49c4('0xc')]===_0x49c4('0xd')){_0x536d42=Object['assign']({},{'OwnerId':_0x5ab4a3['id'],'ActivityDate':moment[_0x49c4('0xe')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x49c4('0xf')](_0x313e73['Subjects'],_0x58cad7,'\x20'),'Description':intUtil[_0x49c4('0xf')](_0x313e73[_0x49c4('0x10')],_0x58cad7,'\x0a')},getCustomFields(_0xb611a1,_0x58cad7));if(_0x451ea6){_0x536d42[_0x49c4('0x11')]=_0x451ea6['id'];}}else if(_0x313e73[_0x49c4('0xc')]===_0x49c4('0x12')){_0x536d42=Object[_0x49c4('0x13')]({},{'OwnerId':_0x5ab4a3['id'],'Subject':intUtil[_0x49c4('0xf')](_0x313e73[_0x49c4('0x14')],_0x58cad7,'\x20'),'Description':intUtil['getString'](_0x313e73[_0x49c4('0x10')],_0x58cad7,'\x0a')},getCustomFields(_0xb611a1,_0x58cad7));if(_0x451ea6){_0x536d42[_0x49c4('0x15')]=_0x451ea6['id'];}}return _0x459d09[_0x49c4('0x16')](_0x313e73[_0x49c4('0xc')])[_0x49c4('0x17')](_0x536d42);}function getUser(_0x53e3a2,_0x44e607,_0x2891f4){if(!_['isNil'](_0x44e607)&&intUtil['validateEmail'](_0x44e607)){var _0x3c782d={'Email':_0x44e607};var _0x2f82d5={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2891f4[_0x49c4('0x16')]('User')[_0x49c4('0x18')](_0x3c782d,_0x2f82d5)['execute']()[_0x49c4('0x19')](function(_0x1806c2){if(_0x1806c2[_0x49c4('0x1a')]){var _0x291526=_[_0x49c4('0x18')](_0x1806c2,function(_0x41078c){return _0x41078c[_0x49c4('0x1b')]===_0x44e607;});if(_0x291526){logger[_0x49c4('0x1c')](_0x49c4('0x1d'),_0x44e607);return BPromise['resolve']({'id':_0x291526['Id'],'name':_0x291526['Name']});}}else{logger['info'](_0x49c4('0x1e'),_0x44e607);return _0x2891f4['identity']()['then'](function(_0x2263ae){return BPromise[_0x49c4('0x1f')]({'id':_0x2263ae[_0x49c4('0x20')],'name':_0x2263ae[_0x49c4('0x21')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x44e607);return _0x2891f4[_0x49c4('0x22')]()[_0x49c4('0x19')](function(_0x565423){return BPromise[_0x49c4('0x1f')]({'id':_0x565423[_0x49c4('0x20')],'name':_0x565423[_0x49c4('0x21')]});});}}function getEndUser(_0xa7a826,_0x531d92,_0x543ea2,_0x449960,_0x53c199){var _0x3800b7={'Phone':_0x449960};var _0x3852b2={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x49c4('0x1f')]()[_0x49c4('0x19')](function(){if(_0x531d92['ticketType']===_0x49c4('0xd')){logger[_0x49c4('0x1c')](_0x49c4('0x23'),_0x449960,_0x531d92[_0x49c4('0x24')]);switch(_0x531d92[_0x49c4('0x24')]){case _0x49c4('0x25'):return _0x53c199[_0x49c4('0x16')](_0x49c4('0x26'))[_0x49c4('0x18')](_0x3800b7,_0x3852b2)[_0x49c4('0x27')]()[_0x49c4('0x19')](function(_0x4ea6ea){if(_0x4ea6ea&&_0x4ea6ea['length']){return _0x4ea6ea;}else{return _0x53c199['sobject'](_0x49c4('0x28'))[_0x49c4('0x18')](_0x3800b7,_0x3852b2);}});case _0x49c4('0x29'):return _0x53c199[_0x49c4('0x16')](_0x49c4('0x26'))['find'](_0x3800b7,_0x3852b2)[_0x49c4('0x27')]();case _0x49c4('0x2a'):return _0x53c199[_0x49c4('0x16')](_0x49c4('0x28'))['find'](_0x3800b7,_0x3852b2);default:return null;}}else if(_0x531d92['ticketType']===_0x49c4('0x12')){logger[_0x49c4('0x1c')](_0x49c4('0x23'),_0x449960,_0x49c4('0x29'));return _0x53c199[_0x49c4('0x16')]('Contact')[_0x49c4('0x18')](_0x3800b7,_0x3852b2)[_0x49c4('0x27')]();}})[_0x49c4('0x19')](function(_0x512d02){if(_0x512d02&&_0x512d02['length']){var _0x85dce2=_[_0x49c4('0x18')](_0x512d02,function(_0x3bec0a){return _0x3bec0a[_0x49c4('0x2b')]===_0x449960;});if(_0x85dce2){return BPromise[_0x49c4('0x1f')]({'id':_0x85dce2['Id'],'name':_0x85dce2[_0x49c4('0x2c')],'phone':_0x85dce2[_0x49c4('0x2b')]});}}})[_0x49c4('0x19')](function(_0x3209cd){if(_0x3209cd){logger['info'](_0x49c4('0x2d'),_0x449960);return BPromise['resolve'](_0x3209cd);}else{logger[_0x49c4('0x1c')](_0x49c4('0x2e'),_0x449960);var _0x2625a6={'LastName':_0x543ea2!==_0x49c4('0x2f')?_0x543ea2:util['format'](_0x49c4('0x30'),_0x449960),'Phone':_0x449960};if(_0x531d92[_0x49c4('0x31')]){if(_0x531d92[_0x49c4('0x31')]==='contact'){logger[_0x49c4('0x1c')](_0x49c4('0x32'),_0x449960,_0x531d92[_0x49c4('0x31')]);}else if(_0x531d92[_0x49c4('0x31')]===_0x49c4('0x2a')&&_0x531d92[_0x49c4('0xc')]===_0x49c4('0xd')){logger[_0x49c4('0x1c')](_0x49c4('0x32'),_0x449960,_0x531d92[_0x49c4('0x31')]);_0x2625a6[_0x49c4('0x33')]='No\x20Company';}else{return null;}}return _0x53c199[_0x49c4('0x16')](_[_0x49c4('0x34')](_0x531d92[_0x49c4('0x31')]))[_0x49c4('0x17')](_0x2625a6);}});}function getCustomFields(_0x41ad28,_0x29dd5d){var _0x1be62d={};if(_0x41ad28[_0x49c4('0x1a')]>0x0){_[_0x49c4('0x35')](_0x41ad28,function(_0x2668ed){if(_0x2668ed[_0x49c4('0x36')]===_0x49c4('0x37')&&_0x2668ed[_0x49c4('0x38')]){_0x1be62d[_0x2668ed['idField']]=_0x2668ed[_0x49c4('0x39')]['toString']();}else if(_0x2668ed[_0x49c4('0x36')]===_0x49c4('0x3a')&&_0x2668ed[_0x49c4('0x3b')]&&_0x2668ed[_0x49c4('0x38')]){_0x29dd5d[_0x2668ed[_0x49c4('0x3b')]]&&(_0x1be62d[_0x2668ed[_0x49c4('0x38')]]=_0x29dd5d[_0x2668ed['variableName']]['toString']());}else if(_0x2668ed[_0x49c4('0x36')]===_0x49c4('0x3c')&&_0x2668ed[_0x49c4('0x3d')]&&_0x2668ed[_0x49c4('0x3d')]['name']&&_0x2668ed[_0x49c4('0x38')]){_0x29dd5d[_0x2668ed[_0x49c4('0x3d')][_0x49c4('0x3e')][_0x49c4('0x3f')]()]&&(_0x1be62d[_0x2668ed[_0x49c4('0x38')]]=_0x29dd5d[_0x2668ed[_0x49c4('0x3d')][_0x49c4('0x3e')][_0x49c4('0x3f')]()][_0x49c4('0x40')]());}});}return _0x1be62d;}function getConnection(_0x5640d3){var _0x2ad771=_0x5640d3['password'][_0x49c4('0x41')](_0x5640d3[_0x49c4('0x42')]);var _0x301def=new jsforce[(_0x49c4('0x43'))]({'oauth2':{'loginUrl':_0x5640d3[_0x49c4('0x44')]||'https://login.salesforce.com','clientId':_0x5640d3[_0x49c4('0x45')],'clientSecret':_0x5640d3[_0x49c4('0x46')]}});return _0x301def[_0x49c4('0x47')](_0x5640d3[_0x49c4('0x48')],_0x2ad771)[_0x49c4('0x19')](function(){logger[_0x49c4('0x1c')](_0x49c4('0x49'));return _0x301def;});}exports['queue']=function(_0x3bac1b,_0x5cfff9,_0x3f7379,_0x906d3,_0x29fe65,_0x27adfe){var _0x2d8087,_0x30bea5,_0x2c6be1,_0x506c71;_0x27adfe[_0x49c4('0x4a')]=intUtil[_0x49c4('0x4b')](_0x27adfe['serverUrl']);_0x27adfe[_0x49c4('0x44')]=intUtil[_0x49c4('0x4b')](_0x27adfe[_0x49c4('0x44')]);if(_0x29fe65&&_0x29fe65[_0x49c4('0x4c')]){logger['info']('[QUEUE]',_0x49c4('0x4d'));_0x5cfff9['recordingURL']=util[_0x49c4('0x4e')](_0x49c4('0x4f'),_0x27adfe[_0x49c4('0x4a')],_0x5cfff9[_0x49c4('0x50')],md5(_0x5cfff9[_0x49c4('0x50')]));}else{_0x5cfff9[_0x49c4('0x51')]='';}return getConnection(_0x27adfe)[_0x49c4('0x19')](function(_0x563f0b){_0x506c71=_0x563f0b;return getUser(_0x27adfe,_0x906d3[_0x49c4('0x52')],_0x506c71);})[_0x49c4('0x19')](function(_0x3936d3){_0x2d8087=_0x3936d3;return getEndUser(_0x27adfe,_0x3f7379,_0x5cfff9[_0x49c4('0x53')],_0x5cfff9[_0x49c4('0x54')],_0x506c71);})[_0x49c4('0x19')](function(_0x156748){_0x30bea5=_0x156748;return getTicket(_0x27adfe,_0x2d8087,_0x30bea5,_0x3f7379,_0x5cfff9,_0x3f7379[_0x49c4('0x55')],_0x506c71,_0x49c4('0x56'));})[_0x49c4('0x19')](function(_0x5b822f){_0x2c6be1=_0x5b822f;logger['info'](_0x49c4('0x57'),_0x2c6be1['id']);logger[_0x49c4('0x1c')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2c6be1['id'],_0x906d3['name'],_0x27adfe[_0x49c4('0x36')]);switch(_0x27adfe['type']){case'integrationTab':emit(util[_0x49c4('0x4e')](_0x49c4('0x58'),_0x906d3[_0x49c4('0x3e')]),_0x49c4('0x59'),{'recordId':_0x2c6be1['id']});break;case _0x49c4('0x5a'):emit(util[_0x49c4('0x4e')](_0x49c4('0x58'),_0x906d3['name']),_0x49c4('0x5b'),{'uri':util[_0x49c4('0x4e')](_0x49c4('0x5c'),_0x506c71[_0x49c4('0x5d')],_0x2c6be1['id'])});break;default:logger[_0x49c4('0x5e')](_0x49c4('0x5f'));}})['catch'](function(_0x5c7ddd){logger[_0x49c4('0x5e')](_0x49c4('0x60'),JSON[_0x49c4('0x61')](_0x5c7ddd));});};exports[_0x49c4('0x62')]=function(_0x23288e,_0x6b2592,_0xc2033f,_0x58dc5f,_0x45d715,_0x33c9a6,_0x4ba4eb){var _0x42928c,_0x53690f,_0x2f966c,_0x147ebd;_0x33c9a6[_0x49c4('0x4a')]=intUtil[_0x49c4('0x4b')](_0x33c9a6[_0x49c4('0x4a')]);_0x33c9a6[_0x49c4('0x44')]=intUtil[_0x49c4('0x4b')](_0x33c9a6[_0x49c4('0x44')]);if(_0x4ba4eb&&_0x4ba4eb['recordingFormat']&&_0x4ba4eb[_0x49c4('0x63')]!==_0x49c4('0x64')){logger['info'](_0x49c4('0x65'),_0x49c4('0x4d'));_0x6b2592['recordingURL']=util[_0x49c4('0x4e')](_0x49c4('0x4f'),_0x33c9a6['serverUrl'],_0x6b2592['uniqueid'],md5(_0x6b2592['uniqueid']));}return getConnection(_0x33c9a6)['then'](function(_0xc43386){_0x147ebd=_0xc43386;return getUser(_0x33c9a6,_0x58dc5f['email'],_0x147ebd);})[_0x49c4('0x19')](function(_0x32f344){_0x42928c=_0x32f344;return getEndUser(_0x33c9a6,_0xc2033f,_0x6b2592['destcalleridname'],_0x6b2592[_0x49c4('0x66')],_0x147ebd);})[_0x49c4('0x19')](function(_0x5ac9f0){_0x53690f=_0x5ac9f0;return getTicket(_0x33c9a6,_0x42928c,_0x53690f,_0xc2033f,_0x6b2592,_0xc2033f[_0x49c4('0x55')],_0x147ebd,_0x49c4('0x62'));})[_0x49c4('0x19')](function(_0x35f46f){_0x2f966c=_0x35f46f;logger['info'](_0x49c4('0x67'),_0x2f966c['id']);logger[_0x49c4('0x1c')](_0x49c4('0x68'),_0x2f966c['id'],_0x58dc5f[_0x49c4('0x3e')],_0x33c9a6['type']);switch(_0x33c9a6[_0x49c4('0x36')]){case'integrationTab':emit(util['format']('user:%s',_0x58dc5f['name']),_0x49c4('0x59'),{'recordId':_0x2f966c['id']});break;case _0x49c4('0x5a'):emit(util[_0x49c4('0x4e')](_0x49c4('0x58'),_0x58dc5f['name']),'trigger:browser:url',{'uri':util[_0x49c4('0x4e')](_0x49c4('0x5c'),_0x147ebd[_0x49c4('0x5d')],_0x2f966c['id'])});break;default:logger[_0x49c4('0x5e')](_0x49c4('0x65'),_0x49c4('0x69'));}})[_0x49c4('0x6a')](function(_0x3b949d){logger['error'](_0x49c4('0x65'),JSON['stringify'](_0x3b949d));});};exports[_0x49c4('0x6b')]=function(_0x264902,_0x1a5d4c,_0x1ea1b4,_0x3a1c81,_0x2e062f,_0x13d657){var _0x3feb0b,_0x13d951,_0x1743d0,_0x1e3911;_0x13d657[_0x49c4('0x4a')]=intUtil[_0x49c4('0x4b')](_0x13d657[_0x49c4('0x4a')]);_0x13d657[_0x49c4('0x44')]=intUtil[_0x49c4('0x4b')](_0x13d657[_0x49c4('0x44')]);if(_0x2e062f&&_0x2e062f[_0x49c4('0x4c')]){logger['info']('[ABANDONED]',_0x49c4('0x4d'));_0x1a5d4c[_0x49c4('0x51')]=util['format'](_0x49c4('0x4f'),_0x13d657[_0x49c4('0x4a')],_0x1a5d4c[_0x49c4('0x50')],md5(_0x1a5d4c[_0x49c4('0x50')]));}else{_0x1a5d4c['recordingURL']='';}return getConnection(_0x13d657)['then'](function(_0x4a85d4){_0x1e3911=_0x4a85d4;if(!_[_0x49c4('0x6c')](_0x3a1c81)){return getUser(_0x13d657,_0x3a1c81[_0x49c4('0x3e')],_0x1e3911);}else{return getUser(_0x13d657,null,_0x1e3911);}})[_0x49c4('0x19')](function(_0x2f4289){_0x3feb0b=_0x2f4289;return getEndUser(_0x13d657,_0x1ea1b4,_0x1a5d4c[_0x49c4('0x53')],_0x1a5d4c[_0x49c4('0x54')],_0x1e3911);})[_0x49c4('0x19')](function(_0x3692a4){_0x13d951=_0x3692a4;return getTicket(_0x13d657,_0x3feb0b,_0x13d951,_0x1ea1b4,_0x1a5d4c,_0x1ea1b4[_0x49c4('0x55')],_0x1e3911);})['then'](function(_0x363b2e){_0x1743d0=_0x363b2e;logger[_0x49c4('0x1c')](_0x49c4('0x6d'),_0x1743d0['id']);logger['info'](_0x49c4('0x6e'),_0x13d657[_0x49c4('0x36')]);})[_0x49c4('0x6a')](function(_0xb6031b){logger[_0x49c4('0x5e')](_0x49c4('0x6f'),JSON[_0x49c4('0x61')](_0xb6031b));});}; \ 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 545818e..c1a37fe 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 _0x61b8=['Variable','name',']\x20getTicket\x20input\x20crm','outbound','POST','assign','Subjects','getString','Fields','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','incident','Incident','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','forEach','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','user:%s','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','abandoned','inspect','lodash','bluebird','request-promise','md5','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','localhost','socket.io-emitter','GET','then','result','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','userId','adminId',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','true','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','type','string','nameField','customField','toLowerCase','content','toString','idField','variable','variableName','customVariable'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x61b8,0x169));var _0x861b=function(_0x32f77b,_0x2fa487){_0x32f77b=_0x32f77b-0x0;var _0x247b35=_0x61b8[_0x32f77b];return _0x247b35;};'use strict';var _=require(_0x861b('0x0'));var Promise=require(_0x861b('0x1'));var rp=require(_0x861b('0x2'));var util=require('util');var md5=require(_0x861b('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x861b('0x4'));var logger=require(_0x861b('0x5'))(_0x861b('0x6'));config['redis']=_[_0x861b('0x7')](config[_0x861b('0x8')],{'host':_0x861b('0x9'),'port':0x18eb});var io=require(_0x861b('0xa'))(new Redis(config[_0x861b('0x8')]));function getAdminUser(_0xe2504a,_0x436722,_0x41a4c5,_0x3179ec,_0x421d4f,_0x45c39d){return new Promise(function(_0x5c6fc1,_0xdc4df8){var _0x23a689={'method':_0x861b('0xb'),'uri':_0x3179ec+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x421d4f+'&'+_0x45c39d,'auth':_0x436722,'json':!![]};return rp(_0x23a689)[_0x861b('0xc')](function(_0x55826c){if(_0x55826c[_0x861b('0xd')][_0x861b('0xe')]>0x0){_0x41a4c5['adminId']=_0x55826c[_0x861b('0xd')][0x0][_0x861b('0xf')];}logger[_0x861b('0x10')]('['+[_0xe2504a[_0x861b('0x11')]()]+_0x861b('0x12'),_0x41a4c5);_0x5c6fc1(_0x41a4c5);})[_0x861b('0x13')](function(_0x245c41){logger[_0x861b('0x14')]('['+[_0xe2504a[_0x861b('0x11')]()]+']',_0x245c41[_0x861b('0x15')]);_0xdc4df8(_0x245c41[_0x861b('0x15')]);});});}function getUser(_0x8deb78,_0x264ba1,_0x3ee3ab,_0x437bbd,_0x3dbd5e){return function(_0x5121aa){logger[_0x861b('0x10')]('['+[_0x8deb78['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x5121aa);return new Promise(function(_0x3d828f,_0x496221){if(intUtil[_0x861b('0x16')](_0x5121aa[_0x861b('0x17')])){var _0x4aafa8={'method':_0x861b('0xb'),'uri':_0x3ee3ab+_0x861b('0x18')+_0x5121aa[_0x861b('0x17')]+'&'+_0x437bbd+'&'+_0x3dbd5e,'auth':_0x264ba1,'json':!![]};logger[_0x861b('0x10')]('['+[_0x8deb78['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0x4aafa8);return rp(_0x4aafa8)[_0x861b('0xc')](function(_0x426a99){logger[_0x861b('0x10')]('['+[_0x8deb78['toUpperCase']()]+_0x861b('0x19'),_0x426a99);if(_0x426a99['result'][_0x861b('0xe')]>0x0&&String(_0x426a99[_0x861b('0xd')][0x0]['active'])==='true'){_0x5121aa[_0x861b('0x1a')]=_0x426a99[_0x861b('0xd')][0x0]['sys_id'];}else{_0x5121aa['userId']=_0x5121aa[_0x861b('0x1b')];_0x5121aa['userEmail']=_0x5121aa['adminEmail'];}logger[_0x861b('0x10')]('['+[_0x8deb78['toUpperCase']()]+'],\x20getUser\x20crm',_0x5121aa);_0x3d828f(_0x5121aa);})[_0x861b('0x13')](function(_0x24d378){logger[_0x861b('0x14')]('['+[_0x8deb78[_0x861b('0x11')]()]+']',_0x24d378[_0x861b('0x15')]);_0x496221(_0x24d378[_0x861b('0x15')]);});}else{logger['info']('['+[_0x8deb78[_0x861b('0x11')]()]+_0x861b('0x1c'));_0x5121aa[_0x861b('0x1a')]=_0x5121aa[_0x861b('0x1b')];_0x5121aa[_0x861b('0x17')]=_0x5121aa[_0x861b('0x1d')];_0x3d828f(_0x5121aa);}});};}function createEndUser(_0x47e89a,_0x4b56c3,_0x3882a1,_0x3aeaf8,_0x419259){logger[_0x861b('0x10')]('['+[_0x47e89a[_0x861b('0x11')]()]+_0x861b('0x1e'),_0x3882a1);return new Promise(function(_0x5bee82,_0x4b21b9){var _0x19ee4e={'method':'POST','uri':_0x3aeaf8+_0x861b('0x1f')+_0x419259,'body':{'user_name':_0x3882a1[_0x861b('0x20')],'roles':_0x861b('0x21'),'first_name':_0x3882a1[_0x861b('0x20')],'active':_0x861b('0x22'),'date_format':_0x861b('0x23'),'phone':_0x3882a1[_0x861b('0x20')]},'auth':_0x4b56c3,'json':!![]};return rp(_0x19ee4e)[_0x861b('0xc')](function(_0x4f17c1){logger['info']('['+[_0x47e89a[_0x861b('0x11')]()]+'],\x20EndUser\x20schema',_0x4f17c1[_0x861b('0xd')]);_0x3882a1[_0x861b('0x24')]=_0x4f17c1['result'][_0x861b('0xf')];_0x5bee82(_0x3882a1);})['catch'](function(_0x51da3e){logger[_0x861b('0x14')]('['+[_0x47e89a[_0x861b('0x11')]()]+']',_0x51da3e['message']);_0x4b21b9(_0x51da3e[_0x861b('0x15')]);});});}function getEndUser(_0x3dce55,_0x5d2fa7,_0x1ecf53,_0xce2f23,_0x5e0410){return function(_0x23f5c3){logger[_0x861b('0x10')]('['+[_0x3dce55[_0x861b('0x11')]()]+_0x861b('0x25'),_0x23f5c3);return new Promise(function(_0x3960a1,_0x27c4b0){var _0x4fe671={'method':_0x861b('0xb'),'uri':_0x1ecf53+_0x861b('0x26')+_0x23f5c3[_0x861b('0x20')]+'&'+_0xce2f23+'&'+_0x5e0410,'auth':_0x5d2fa7,'json':!![]};return rp(_0x4fe671)[_0x861b('0xc')](function(_0x5fa252){if(_0x5fa252['result']['length']>0x0){_0x23f5c3[_0x861b('0x24')]=_0x5fa252[_0x861b('0xd')][0x0]['sys_id'];logger['info']('['+[_0x3dce55[_0x861b('0x11')]()]+_0x861b('0x27'),_0x23f5c3);_0x3960a1(_0x23f5c3);}else{return createEndUser(_0x3dce55,_0x5d2fa7,_0x23f5c3,_0x1ecf53,_0xce2f23)[_0x861b('0xc')](function(_0x35f638){logger[_0x861b('0x10')]('['+[_0x3dce55[_0x861b('0x11')]()]+'],\x20createEndUser\x20crm',_0x35f638);_0x3960a1(_0x35f638);});}})[_0x861b('0x13')](function(_0x466be2){logger[_0x861b('0x14')]('['+[_0x3dce55[_0x861b('0x11')]()]+']',_0x466be2[_0x861b('0x15')]);_0x27c4b0(_0x466be2[_0x861b('0x15')]);});});};}function getCustomFields(_0x4fb091,_0x21ea70){var _0x48b9c1={};if(_0x4fb091[_0x861b('0xe')]>0x0){_['forEach'](_0x4fb091,function(_0x521f5c){if(_0x521f5c[_0x861b('0x28')]===_0x861b('0x29')&&_0x521f5c[_0x861b('0x2a')]&&!_0x521f5c[_0x861b('0x2b')]){_0x48b9c1[_0x521f5c['idField'][_0x861b('0x2c')]()]=_0x521f5c[_0x861b('0x2d')][_0x861b('0x2e')]();}else if(_0x521f5c[_0x861b('0x28')]==='string'&&_0x521f5c[_0x861b('0x2f')]&&_0x521f5c[_0x861b('0x2b')]){_0x48b9c1[_0x521f5c['idField'][_0x861b('0x2c')]()]=_0x521f5c[_0x861b('0x2d')][_0x861b('0x2e')]();}else if(_0x521f5c['type']===_0x861b('0x30')&&_0x521f5c[_0x861b('0x31')]&&_0x521f5c['idField']&&_0x521f5c[_0x861b('0x2b')]){_0x48b9c1[_0x521f5c[_0x861b('0x2f')]['toLowerCase']()]=_0x21ea70[_0x521f5c[_0x861b('0x31')]][_0x861b('0x2e')]();}else if(_0x521f5c['type']===_0x861b('0x32')&&_0x521f5c[_0x861b('0x33')]&&_0x521f5c[_0x861b('0x33')][_0x861b('0x34')]&&_0x521f5c[_0x861b('0x2f')]&&_0x521f5c[_0x861b('0x2b')]){_0x48b9c1[_0x521f5c['idField'][_0x861b('0x2c')]()]=_0x21ea70[_0x521f5c['Variable'][_0x861b('0x34')][_0x861b('0x2c')]()]['toString']();}});}return _0x48b9c1;}function getTicket(_0x3e2bdb,_0x186135,_0x3b789d,_0x2ab105,_0x179a3b,_0x4b39e2){return function(_0xb793be){logger[_0x861b('0x10')]('['+[_0x3e2bdb['toUpperCase']()]+_0x861b('0x35'),_0xb793be);return new Promise(function(_0x3efda4,_0xfca2ec){var _0x78a727=_0x3e2bdb[_0x861b('0x2c')]()===_0x861b('0x36')?_0xb793be[_0x861b('0x1a')]:_0xb793be[_0x861b('0x24')];var _0x11631d={'method':_0x861b('0x37'),'uri':_0x3b789d+'incident'+'?'+_0x4b39e2,'body':Object[_0x861b('0x38')]({},{'active':'true','caller_id':_0x78a727,'assigned_to':_0xb793be[_0x861b('0x1a')],'short_description':intUtil['getString'](_0x2ab105[_0x861b('0x39')],_0x179a3b,'\x20'),'description':intUtil[_0x861b('0x3a')](_0x2ab105['Descriptions'],_0x179a3b,'\x0a')},getCustomFields(_0x2ab105[_0x861b('0x3b')],_0x179a3b)),'auth':_0x186135,'json':!![]};return rp(_0x11631d)['then'](function(_0x41ac52){logger[_0x861b('0x10')]('['+[_0x3e2bdb[_0x861b('0x11')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x41ac52[_0x861b('0xd')]);_0xb793be[_0x861b('0x3c')]=_0x41ac52[_0x861b('0xd')][_0x861b('0xf')];_0xb793be[_0x861b('0x3d')]=_0x41ac52[_0x861b('0xd')][_0x861b('0x3e')];logger[_0x861b('0x10')]('['+[_0x3e2bdb['toUpperCase']()]+_0x861b('0x3f'),_0xb793be);_0x3efda4(_0xb793be);})[_0x861b('0x13')](function(_0x408874){logger['error']('['+[_0x3e2bdb[_0x861b('0x11')]()]+']',_0x408874[_0x861b('0x15')]);_0xfca2ec(_0x408874['message']);});});};}function createRemoteTag(_0x2aac41,_0x4f025a,_0x1b9934,_0x1871c2){return new Promise(function(_0x1358ac,_0x1c9cc3){var _0x53d8b7={'method':_0x861b('0x37'),'uri':_0x1b9934+_0x861b('0x40')+'?'+_0x1871c2,'body':{'short_description':_0x2aac41,'global':!![],'active':!![],'name':_0x2aac41},'auth':_0x4f025a,'json':!![]};return rp(_0x53d8b7)['then'](function(_0x3fc0a7){var _0x28a8bc=_0x3fc0a7['result'][_0x861b('0xf')];_0x1358ac(_0x28a8bc);});});}function getRemoteTag(_0x16f364,_0x192868,_0x14a90c,_0x28cc8e,_0x2e3297){return new Promise(function(_0x313fdc,_0x34b55f){var _0xa1272e={'method':_0x861b('0xb'),'uri':_0x14a90c+'label'+_0x861b('0x41')+_0x16f364+'&'+_0x28cc8e,'auth':_0x192868,'json':!![]};return rp(_0xa1272e)[_0x861b('0xc')](function(_0x2a1489){if(_0x2a1489[_0x861b('0xd')][_0x861b('0xe')]>0x0){var _0x505401=_0x2a1489[_0x861b('0xd')][0x0][_0x861b('0xf')];_0x313fdc(_0x505401);}else{return createRemoteTag(_0x16f364,_0x192868,_0x14a90c,_0x28cc8e)[_0x861b('0xc')](function(_0x49b1e4){_0x313fdc(_0x49b1e4);});}});});}function assignTagToIncident(_0x444c18,_0x48a879,_0x5de579,_0x40cea6,_0x2d6016){return new Promise(function(_0x5d8a70,_0x1e5e46){var _0x1f8bc6={'method':_0x861b('0x37'),'uri':_0x5de579+_0x861b('0x42')+'?'+_0x2d6016,'body':{'label':_0x444c18,'table':_0x861b('0x43'),'id_type':_0x861b('0x44'),'table_key':_0x40cea6[_0x861b('0x3c')],'title':_0x861b('0x45')+_0x40cea6[_0x861b('0x3d')],'id_display':_0x40cea6[_0x861b('0x3d')]},'auth':_0x48a879,'json':!![]};return rp(_0x1f8bc6)[_0x861b('0xc')](function(_0x3ffa42){_0x5d8a70();})[_0x861b('0x13')](function(){_0x5d8a70();});});}function manageTags(_0x4fabe0,_0x4ad59a,_0x325bb8,_0x260305,_0x1ae998,_0x135d0b,_0x487227){return new Promise(function(_0x32fa4e,_0x11207c){var _0x654bcd=[];_0x4ad59a['forEach'](function(_0x479a8f){_0x654bcd['push'](getRemoteTag(_0x479a8f,_0x325bb8,_0x260305,_0x135d0b,_0x487227));});return Promise[_0x861b('0x46')](_0x654bcd)[_0x861b('0xc')](function(_0x8b21ba){if(_0x8b21ba[_0x861b('0xe')]){logger['info']('['+[_0x4fabe0[_0x861b('0x11')]()]+_0x861b('0x47'),_0x8b21ba);var _0xe7ea7a=[];_0x8b21ba[_0x861b('0x48')](function(_0x2f8836){_0xe7ea7a['push'](assignTagToIncident(_0x2f8836,_0x325bb8,_0x260305,_0x1ae998,_0x135d0b));});return Promise[_0x861b('0x46')](_0xe7ea7a)[_0x861b('0xc')](function(){_0x32fa4e();})[_0x861b('0x13')](function(){_0x32fa4e();});}else{_0x32fa4e();}});});}function getTags(_0x1b9ebb,_0x1def3b,_0x4955ad,_0x2e92b,_0x2c8b13,_0x1f200b){return function(_0x4f7018){return new Promise(function(_0xb7ca2,_0xc15ef5){var _0x4f79e8=[];var _0x40c85c=_0x2e92b['Tags'];if(_0x40c85c&&_0x40c85c['length']>0x0){_0x4f79e8=_['map'](_0x40c85c,_0x861b('0x34'));}if(_0x4f79e8[_0x861b('0xe')]>0x0){return manageTags(_0x1b9ebb,_0x4f79e8,_0x1def3b,_0x4955ad,_0x4f7018,_0x2c8b13,_0x1f200b)[_0x861b('0xc')](function(){_0xb7ca2(_0x4f7018);});}else{_0xb7ca2(_0x4f7018);}});};}function emit(_0x1e285f,_0x19d2e5,_0x1968c5){var _0x18f1ea='%26sysparm_record_target%3Dincident'+_0x861b('0x49')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x861b('0x4a');var _0x215f3d={'uri':_0x1e285f+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x1968c5+_0x18f1ea};io['to'](util['format'](_0x861b('0x4b'),_0x19d2e5))['emit'](_0x861b('0x4c'),_0x215f3d);}exports['cs']=function(_0x29b275,_0x47d232,_0x54ba64,_0x4545d6,_0x230e9d,_0x307ca0,_0x2800e7,_0x47848a){var _0x32e723={};var _0xb3895f={'user':_0x307ca0[_0x861b('0x4d')],'pass':_0x307ca0[_0x861b('0x4e')]};var _0x3fc275=_0x861b('0x4f');var _0x349849=_0x861b('0x50');_0x307ca0[_0x861b('0x51')]=intUtil[_0x861b('0x52')](_0x307ca0['remoteUri']);_0x307ca0[_0x861b('0x53')]=intUtil[_0x861b('0x52')](_0x307ca0[_0x861b('0x53')]);var _0xe3f2e0=util[_0x861b('0x54')](_0x861b('0x55'),_0x307ca0[_0x861b('0x51')]);_0x32e723[_0x861b('0x17')]=!_['isNil'](_0x4545d6)?_0x4545d6[_0x861b('0x56')]:null;_0x32e723[_0x861b('0x1d')]=_0x307ca0['email'];_0x32e723['endUserNumber']=_0x47848a['toLowerCase']()===_0x861b('0x36')?_0x47d232[_0x861b('0x57')]:_0x47d232[_0x861b('0x58')];_0x32e723[_0x861b('0x59')]=_0x47848a===_0x861b('0x5a')||_0x47848a==='abandoned'?'queue':_0x861b('0x36');var _0x2f65d1=util['format'](_0x861b('0x5b'),_0x307ca0[_0x861b('0x53')],_0x47d232[_0x861b('0x5c')],md5(_0x47d232[_0x861b('0x5c')]));if(_0x230e9d&&_0x230e9d[_0x861b('0x5d')]){logger['info'](_0x861b('0x5e'),'Recording\x20is\x20enabled!');_0x47d232[_0x861b('0x5f')]=_0x2f65d1;}else if(_0x2800e7&&_0x2800e7[_0x861b('0x60')]&&_0x2800e7[_0x861b('0x60')]!==_0x861b('0x61')){logger[_0x861b('0x10')](_0x861b('0x62'),_0x861b('0x63'));_0x47d232[_0x861b('0x5f')]=_0x2f65d1;}else{_0x47d232[_0x861b('0x5f')]='';}return getAdminUser(_0x47848a,_0xb3895f,_0x32e723,_0xe3f2e0,_0x349849,_0x3fc275)['then'](getUser(_0x47848a,_0xb3895f,_0xe3f2e0,_0x349849,_0x3fc275))['then'](getEndUser(_0x47848a,_0xb3895f,_0xe3f2e0,_0x349849,_0x3fc275))[_0x861b('0xc')](getTicket(_0x47848a,_0xb3895f,_0xe3f2e0,_0x54ba64,_0x47d232,_0x349849))[_0x861b('0xc')](function(_0x31f949){logger[_0x861b('0x10')](util[_0x861b('0x54')](_0x861b('0x64'),_0x31f949[_0x861b('0x3c')]));logger['info'](util[_0x861b('0x54')]('call\x20direction:\x20%s',_0x47848a));if(_0x47848a!==_0x861b('0x65')){logger[_0x861b('0x10')]('['+[_0x47848a['toUpperCase']()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x307ca0[_0x861b('0x51')],_0x4545d6[_0x861b('0x34')],_0x31f949['ticketId']);}})['catch'](function(_0x500f12){logger[_0x861b('0x14')]('['+[_0x47848a[_0x861b('0x11')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x861b('0x66')](_0x500f12,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xb18e=['customField','variable','variableName','toString','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','ticketNumber','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','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','username','sysparm_limit=1','remoteUri','serverUrl','stripTrailingSlash','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','abandoned','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','request-promise','md5','./util','../../../../config/environment','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','sys_id','],\x20getAdminUser\x20crm','catch','message','info','toUpperCase','],\x20getUser\x20input\x20crm','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','result','active','true','userId','adminEmail','],\x20getUser\x20crm','error','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','type','string','nameField','idField','toLowerCase','content'];(function(_0x335f5c,_0xce622c){var _0x27458c=function(_0x108b7f){while(--_0x108b7f){_0x335f5c['push'](_0x335f5c['shift']());}};_0x27458c(++_0xce622c);}(_0xb18e,0x181));var _0xeb18=function(_0x1a87b3,_0x45ba68){_0x1a87b3=_0x1a87b3-0x0;var _0x37e84d=_0xb18e[_0x1a87b3];return _0x37e84d;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require(_0xeb18('0x0'));var util=require('util');var md5=require(_0xeb18('0x1'));var Redis=require('ioredis');var intUtil=require(_0xeb18('0x2'));var config=require(_0xeb18('0x3'));var logger=require('../../../../config/logger')(_0xeb18('0x4'));config[_0xeb18('0x5')]=_[_0xeb18('0x6')](config[_0xeb18('0x5')],{'host':_0xeb18('0x7'),'port':0x18eb});var io=require(_0xeb18('0x8'))(new Redis(config['redis']));function getAdminUser(_0x1bc3ee,_0x131389,_0x534358,_0x979077,_0x17c70b,_0x942945){return new Promise(function(_0x233bad,_0x3ad7a3){var _0x86cdfc={'method':_0xeb18('0x9'),'uri':_0x979077+_0xeb18('0xa')+'&'+_0x17c70b+'&'+_0x942945,'auth':_0x131389,'json':!![]};return rp(_0x86cdfc)[_0xeb18('0xb')](function(_0x24b6a0){if(_0x24b6a0['result'][_0xeb18('0xc')]>0x0){_0x534358[_0xeb18('0xd')]=_0x24b6a0['result'][0x0][_0xeb18('0xe')];}logger['info']('['+[_0x1bc3ee['toUpperCase']()]+_0xeb18('0xf'),_0x534358);_0x233bad(_0x534358);})[_0xeb18('0x10')](function(_0x1d415a){logger['error']('['+[_0x1bc3ee['toUpperCase']()]+']',_0x1d415a[_0xeb18('0x11')]);_0x3ad7a3(_0x1d415a[_0xeb18('0x11')]);});});}function getUser(_0x570517,_0x2666cc,_0x1d7230,_0x145cc8,_0x4b1e93){return function(_0x314156){logger[_0xeb18('0x12')]('['+[_0x570517[_0xeb18('0x13')]()]+_0xeb18('0x14'),_0x314156);return new Promise(function(_0x272cd9,_0x285400){if(intUtil[_0xeb18('0x15')](_0x314156['userEmail'])){var _0x30f706={'method':'GET','uri':_0x1d7230+_0xeb18('0x16')+_0x314156[_0xeb18('0x17')]+'&'+_0x145cc8+'&'+_0x4b1e93,'auth':_0x2666cc,'json':!![]};logger[_0xeb18('0x12')]('['+[_0x570517[_0xeb18('0x13')]()]+_0xeb18('0x18'),_0x30f706);return rp(_0x30f706)['then'](function(_0x399817){logger[_0xeb18('0x12')]('['+[_0x570517[_0xeb18('0x13')]()]+_0xeb18('0x19'),_0x399817);if(_0x399817['result'][_0xeb18('0xc')]>0x0&&String(_0x399817[_0xeb18('0x1a')][0x0][_0xeb18('0x1b')])===_0xeb18('0x1c')){_0x314156[_0xeb18('0x1d')]=_0x399817[_0xeb18('0x1a')][0x0][_0xeb18('0xe')];}else{_0x314156[_0xeb18('0x1d')]=_0x314156[_0xeb18('0xd')];_0x314156[_0xeb18('0x17')]=_0x314156[_0xeb18('0x1e')];}logger[_0xeb18('0x12')]('['+[_0x570517['toUpperCase']()]+_0xeb18('0x1f'),_0x314156);_0x272cd9(_0x314156);})['catch'](function(_0x51867f){logger[_0xeb18('0x20')]('['+[_0x570517[_0xeb18('0x13')]()]+']',_0x51867f[_0xeb18('0x11')]);_0x285400(_0x51867f[_0xeb18('0x11')]);});}else{logger[_0xeb18('0x12')]('['+[_0x570517['toUpperCase']()]+']\x20using\x20admin\x20profile');_0x314156[_0xeb18('0x1d')]=_0x314156[_0xeb18('0xd')];_0x314156[_0xeb18('0x17')]=_0x314156['adminEmail'];_0x272cd9(_0x314156);}});};}function createEndUser(_0xde2775,_0x1c76b9,_0x5d2f33,_0x119b4d,_0x5be996){logger['info']('['+[_0xde2775['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0x5d2f33);return new Promise(function(_0x5120f6,_0x6e6c){var _0x29a152={'method':_0xeb18('0x21'),'uri':_0x119b4d+_0xeb18('0x22')+_0x5be996,'body':{'user_name':_0x5d2f33[_0xeb18('0x23')],'roles':_0xeb18('0x24'),'first_name':_0x5d2f33['endUserNumber'],'active':_0xeb18('0x1c'),'date_format':_0xeb18('0x25'),'phone':_0x5d2f33[_0xeb18('0x23')]},'auth':_0x1c76b9,'json':!![]};return rp(_0x29a152)[_0xeb18('0xb')](function(_0x37f568){logger[_0xeb18('0x12')]('['+[_0xde2775[_0xeb18('0x13')]()]+_0xeb18('0x26'),_0x37f568['result']);_0x5d2f33[_0xeb18('0x27')]=_0x37f568[_0xeb18('0x1a')][_0xeb18('0xe')];_0x5120f6(_0x5d2f33);})[_0xeb18('0x10')](function(_0x199d50){logger[_0xeb18('0x20')]('['+[_0xde2775[_0xeb18('0x13')]()]+']',_0x199d50['message']);_0x6e6c(_0x199d50[_0xeb18('0x11')]);});});}function getEndUser(_0x58e92d,_0x8f5471,_0x1e08f1,_0x64814c,_0x11d482){return function(_0x4b503f){logger[_0xeb18('0x12')]('['+[_0x58e92d[_0xeb18('0x13')]()]+_0xeb18('0x28'),_0x4b503f);return new Promise(function(_0x335abd,_0x1d1701){var _0x193131={'method':'GET','uri':_0x1e08f1+_0xeb18('0x29')+_0x4b503f[_0xeb18('0x23')]+'&'+_0x64814c+'&'+_0x11d482,'auth':_0x8f5471,'json':!![]};return rp(_0x193131)[_0xeb18('0xb')](function(_0x177ff4){if(_0x177ff4[_0xeb18('0x1a')][_0xeb18('0xc')]>0x0){_0x4b503f[_0xeb18('0x27')]=_0x177ff4[_0xeb18('0x1a')][0x0][_0xeb18('0xe')];logger[_0xeb18('0x12')]('['+[_0x58e92d[_0xeb18('0x13')]()]+_0xeb18('0x2a'),_0x4b503f);_0x335abd(_0x4b503f);}else{return createEndUser(_0x58e92d,_0x8f5471,_0x4b503f,_0x1e08f1,_0x64814c)['then'](function(_0x386297){logger[_0xeb18('0x12')]('['+[_0x58e92d[_0xeb18('0x13')]()]+_0xeb18('0x2b'),_0x386297);_0x335abd(_0x386297);});}})[_0xeb18('0x10')](function(_0x5ef16b){logger[_0xeb18('0x20')]('['+[_0x58e92d[_0xeb18('0x13')]()]+']',_0x5ef16b[_0xeb18('0x11')]);_0x1d1701(_0x5ef16b[_0xeb18('0x11')]);});});};}function getCustomFields(_0x1437d1,_0x517840){var _0xdbe683={};if(_0x1437d1['length']>0x0){_[_0xeb18('0x2c')](_0x1437d1,function(_0x39450e){if(_0x39450e[_0xeb18('0x2d')]===_0xeb18('0x2e')&&_0x39450e[_0xeb18('0x2f')]&&!_0x39450e['customField']){_0xdbe683[_0x39450e[_0xeb18('0x30')][_0xeb18('0x31')]()]=_0x39450e[_0xeb18('0x32')]['toString']();}else if(_0x39450e['type']===_0xeb18('0x2e')&&_0x39450e[_0xeb18('0x30')]&&_0x39450e[_0xeb18('0x33')]){_0xdbe683[_0x39450e[_0xeb18('0x30')][_0xeb18('0x31')]()]=_0x39450e['content']['toString']();}else if(_0x39450e['type']===_0xeb18('0x34')&&_0x39450e[_0xeb18('0x35')]&&_0x39450e[_0xeb18('0x30')]&&_0x39450e['customField']){_0xdbe683[_0x39450e[_0xeb18('0x30')][_0xeb18('0x31')]()]=_0x517840[_0x39450e[_0xeb18('0x35')]][_0xeb18('0x36')]();}else if(_0x39450e[_0xeb18('0x2d')]===_0xeb18('0x37')&&_0x39450e[_0xeb18('0x38')]&&_0x39450e['Variable'][_0xeb18('0x39')]&&_0x39450e[_0xeb18('0x30')]&&_0x39450e[_0xeb18('0x33')]){_0xdbe683[_0x39450e[_0xeb18('0x30')][_0xeb18('0x31')]()]=_0x517840[_0x39450e[_0xeb18('0x38')][_0xeb18('0x39')]['toLowerCase']()][_0xeb18('0x36')]();}});}return _0xdbe683;}function getTicket(_0x3671cb,_0x5a7517,_0x3bc165,_0x2d5a1f,_0x2fe4aa,_0x3f4936){return function(_0x1fc830){logger[_0xeb18('0x12')]('['+[_0x3671cb[_0xeb18('0x13')]()]+_0xeb18('0x3a'),_0x1fc830);return new Promise(function(_0x5a4a29,_0x5941fe){var _0x130642=_0x3671cb[_0xeb18('0x31')]()==='outbound'?_0x1fc830[_0xeb18('0x1d')]:_0x1fc830['endUserId'];var _0x12be15={'method':'POST','uri':_0x3bc165+_0xeb18('0x3b')+'?'+_0x3f4936,'body':Object[_0xeb18('0x3c')]({},{'active':'true','caller_id':_0x130642,'assigned_to':_0x1fc830[_0xeb18('0x1d')],'short_description':intUtil[_0xeb18('0x3d')](_0x2d5a1f[_0xeb18('0x3e')],_0x2fe4aa,'\x20'),'description':intUtil[_0xeb18('0x3d')](_0x2d5a1f[_0xeb18('0x3f')],_0x2fe4aa,'\x0a')},getCustomFields(_0x2d5a1f[_0xeb18('0x40')],_0x2fe4aa)),'auth':_0x5a7517,'json':!![]};return rp(_0x12be15)[_0xeb18('0xb')](function(_0x14c3ff){logger['info']('['+[_0x3671cb[_0xeb18('0x13')]()]+_0xeb18('0x41'),_0x14c3ff['result']);_0x1fc830[_0xeb18('0x42')]=_0x14c3ff[_0xeb18('0x1a')][_0xeb18('0xe')];_0x1fc830['ticketNumber']=_0x14c3ff[_0xeb18('0x1a')]['number'];logger[_0xeb18('0x12')]('['+[_0x3671cb[_0xeb18('0x13')]()]+']\x20getTicket\x20crm',_0x1fc830);_0x5a4a29(_0x1fc830);})[_0xeb18('0x10')](function(_0xbbb2b9){logger[_0xeb18('0x20')]('['+[_0x3671cb[_0xeb18('0x13')]()]+']',_0xbbb2b9[_0xeb18('0x11')]);_0x5941fe(_0xbbb2b9['message']);});});};}function createRemoteTag(_0x4d39d4,_0x296f27,_0x12c9fd,_0x5c41a6){return new Promise(function(_0x83ea2e,_0x58d7df){var _0xfb8301={'method':'POST','uri':_0x12c9fd+_0xeb18('0x43')+'?'+_0x5c41a6,'body':{'short_description':_0x4d39d4,'global':!![],'active':!![],'name':_0x4d39d4},'auth':_0x296f27,'json':!![]};return rp(_0xfb8301)[_0xeb18('0xb')](function(_0x1924d4){var _0x3a4b0d=_0x1924d4[_0xeb18('0x1a')][_0xeb18('0xe')];_0x83ea2e(_0x3a4b0d);});});}function getRemoteTag(_0x3920a0,_0x3835d4,_0x1211ed,_0xdec9a4,_0x4fd7ba){return new Promise(function(_0x39c1ba,_0x335bcc){var _0x2fa7c4={'method':'GET','uri':_0x1211ed+'label'+_0xeb18('0x44')+_0x3920a0+'&'+_0xdec9a4,'auth':_0x3835d4,'json':!![]};return rp(_0x2fa7c4)['then'](function(_0x479a49){if(_0x479a49[_0xeb18('0x1a')][_0xeb18('0xc')]>0x0){var _0x4b08b3=_0x479a49[_0xeb18('0x1a')][0x0]['sys_id'];_0x39c1ba(_0x4b08b3);}else{return createRemoteTag(_0x3920a0,_0x3835d4,_0x1211ed,_0xdec9a4)[_0xeb18('0xb')](function(_0x3e4886){_0x39c1ba(_0x3e4886);});}});});}function assignTagToIncident(_0x449c67,_0x4c9ce7,_0x462f30,_0x550400,_0x24c427){return new Promise(function(_0x577ca2,_0x633b9c){var _0x71ee78={'method':'POST','uri':_0x462f30+_0xeb18('0x45')+'?'+_0x24c427,'body':{'label':_0x449c67,'table':'incident','id_type':_0xeb18('0x46'),'table_key':_0x550400[_0xeb18('0x42')],'title':_0xeb18('0x47')+_0x550400[_0xeb18('0x48')],'id_display':_0x550400[_0xeb18('0x48')]},'auth':_0x4c9ce7,'json':!![]};return rp(_0x71ee78)[_0xeb18('0xb')](function(_0x51cacf){_0x577ca2();})['catch'](function(){_0x577ca2();});});}function manageTags(_0x12056d,_0x588030,_0x1a8754,_0x2e8dfc,_0x102b3c,_0xdc12a3,_0x46507b){return new Promise(function(_0x282abb,_0x1a55c5){var _0x2abd29=[];_0x588030['forEach'](function(_0x5c1454){_0x2abd29['push'](getRemoteTag(_0x5c1454,_0x1a8754,_0x2e8dfc,_0xdc12a3,_0x46507b));});return Promise[_0xeb18('0x49')](_0x2abd29)[_0xeb18('0xb')](function(_0x393fef){if(_0x393fef[_0xeb18('0xc')]){logger[_0xeb18('0x12')]('['+[_0x12056d['toUpperCase']()]+_0xeb18('0x4a'),_0x393fef);var _0x4158df=[];_0x393fef[_0xeb18('0x2c')](function(_0x589fd0){_0x4158df['push'](assignTagToIncident(_0x589fd0,_0x1a8754,_0x2e8dfc,_0x102b3c,_0xdc12a3));});return Promise[_0xeb18('0x49')](_0x4158df)['then'](function(){_0x282abb();})[_0xeb18('0x10')](function(){_0x282abb();});}else{_0x282abb();}});});}function getTags(_0x1ece13,_0x28c4a8,_0x344681,_0x59b1fe,_0x5c2202,_0x48374d){return function(_0xd578c){return new Promise(function(_0x3f4778,_0x5f00eb){var _0x4b514e=[];var _0x2940fc=_0x59b1fe['Tags'];if(_0x2940fc&&_0x2940fc[_0xeb18('0xc')]>0x0){_0x4b514e=_[_0xeb18('0x4b')](_0x2940fc,'name');}if(_0x4b514e[_0xeb18('0xc')]>0x0){return manageTags(_0x1ece13,_0x4b514e,_0x28c4a8,_0x344681,_0xd578c,_0x5c2202,_0x48374d)[_0xeb18('0xb')](function(){_0x3f4778(_0xd578c);});}else{_0x3f4778(_0xd578c);}});};}function emit(_0x4b783b,_0xd004dc,_0x821f6b){var _0x353963=_0xeb18('0x4c')+_0xeb18('0x4d')+_0xeb18('0x4e')+_0xeb18('0x4f');var _0x3dbab2={'uri':_0x4b783b+_0xeb18('0x50')+_0x821f6b+_0x353963};io['to'](util[_0xeb18('0x51')](_0xeb18('0x52'),_0xd004dc))['emit']('trigger:browser:url',_0x3dbab2);}exports['cs']=function(_0x37d7ca,_0x4ca2f0,_0x17a239,_0x3cb1ce,_0x267a1f,_0x1804da,_0x59f897,_0x1de4bf){var _0x3651da={};var _0x17d061={'user':_0x1804da[_0xeb18('0x53')],'pass':_0x1804da['password']};var _0x59dee9=_0xeb18('0x54');var _0x16dd86='sysparm_display_value=true';_0x1804da[_0xeb18('0x55')]=intUtil['stripTrailingSlash'](_0x1804da[_0xeb18('0x55')]);_0x1804da[_0xeb18('0x56')]=intUtil[_0xeb18('0x57')](_0x1804da[_0xeb18('0x56')]);var _0x402b0=util[_0xeb18('0x51')](_0xeb18('0x58'),_0x1804da['remoteUri']);_0x3651da[_0xeb18('0x17')]=!_[_0xeb18('0x59')](_0x3cb1ce)?_0x3cb1ce['email']:null;_0x3651da[_0xeb18('0x1e')]=_0x1804da[_0xeb18('0x5a')];_0x3651da['endUserNumber']=_0x1de4bf[_0xeb18('0x31')]()==='outbound'?_0x4ca2f0[_0xeb18('0x5b')]:_0x4ca2f0[_0xeb18('0x5c')];_0x3651da[_0xeb18('0x5d')]=_0x1de4bf===_0xeb18('0x5e')||_0x1de4bf===_0xeb18('0x5f')?_0xeb18('0x5e'):_0xeb18('0x60');var _0x42216b=util[_0xeb18('0x51')](_0xeb18('0x61'),_0x1804da[_0xeb18('0x56')],_0x4ca2f0[_0xeb18('0x62')],md5(_0x4ca2f0['uniqueid']));if(_0x267a1f&&_0x267a1f['monitor_format']){logger['info'](_0xeb18('0x63'),_0xeb18('0x64'));_0x4ca2f0[_0xeb18('0x65')]=_0x42216b;}else if(_0x59f897&&_0x59f897[_0xeb18('0x66')]&&_0x59f897[_0xeb18('0x66')]!==_0xeb18('0x67')){logger[_0xeb18('0x12')](_0xeb18('0x68'),_0xeb18('0x64'));_0x4ca2f0[_0xeb18('0x65')]=_0x42216b;}else{_0x4ca2f0['recordingURL']='';}return getAdminUser(_0x1de4bf,_0x17d061,_0x3651da,_0x402b0,_0x16dd86,_0x59dee9)[_0xeb18('0xb')](getUser(_0x1de4bf,_0x17d061,_0x402b0,_0x16dd86,_0x59dee9))[_0xeb18('0xb')](getEndUser(_0x1de4bf,_0x17d061,_0x402b0,_0x16dd86,_0x59dee9))[_0xeb18('0xb')](getTicket(_0x1de4bf,_0x17d061,_0x402b0,_0x17a239,_0x4ca2f0,_0x16dd86))[_0xeb18('0xb')](function(_0x1f5199){logger[_0xeb18('0x12')](util[_0xeb18('0x51')](_0xeb18('0x69'),_0x1f5199['ticketId']));logger[_0xeb18('0x12')](util[_0xeb18('0x51')](_0xeb18('0x6a'),_0x1de4bf));if(_0x1de4bf!==_0xeb18('0x5f')){logger['info']('['+[_0x1de4bf[_0xeb18('0x13')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x1804da[_0xeb18('0x55')],_0x3cb1ce[_0xeb18('0x39')],_0x1f5199['ticketId']);}})['catch'](function(_0x50ae28){logger[_0xeb18('0x20')]('['+[_0x1de4bf[_0xeb18('0x13')]()]+_0xeb18('0x6b'),util[_0xeb18('0x6c')](_0x50ae28,{'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 2d06161..c063a1d 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 _0x60a7=['user_id','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Enduser\x20created.','debug','[HTTP]','merge','map','string','nameField','customField','toLowerCase','content','type','variable','custom_fields','push','customVariable','Variable','login','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','remoteUri','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','Outbound','Ticket\x20created!','[OUTBOUND]','abandoned','[ABANDONED]','lodash','bluebird','md5','util','ioredis','./util','../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','getString','assigned_user_id','description','Descriptions','date_start','toISOString','slice','duration_hours','duration_minutes','parent_id','parent_type','direction','length','forEach','variableName','idField','stringify','Calls','format','apiKey','toString','base64','get_server_info','JSON','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve'];(function(_0x2f39cf,_0x3c59ec){var _0xd0ece8=function(_0x4ffc0f){while(--_0x4ffc0f){_0x2f39cf['push'](_0x2f39cf['shift']());}};_0xd0ece8(++_0x3c59ec);}(_0x60a7,0x130));var _0x760a=function(_0x4dac8b,_0x4341ab){_0x4dac8b=_0x4dac8b-0x0;var _0x2ebe6a=_0x60a7[_0x4dac8b];return _0x2ebe6a;};'use strict';var _=require(_0x760a('0x0'));var rp=require('request-promise');var BPromise=require(_0x760a('0x1'));var md5=require(_0x760a('0x2'));var util=require(_0x760a('0x3'));var Redis=require(_0x760a('0x4'));var intUtil=require(_0x760a('0x5'));var config=require('../../../../config/environment');var logger=require(_0x760a('0x6'))(_0x760a('0x7'));config[_0x760a('0x8')]=_['defaults'](config[_0x760a('0x8')],{'host':_0x760a('0x9'),'port':0x18eb});var io=require(_0x760a('0xa'))(new Redis(config['redis']));var def={'method':_0x760a('0xb'),'json':!![]};function emit(_0x2f3ca4,_0x2c1dda,_0x1a9c9e){io['to'](_0x2f3ca4)[_0x760a('0xc')](_0x2c1dda,_0x1a9c9e);}function getTicket(_0x5e9c3b,_0x3aa013,_0x417c42,_0x12b0a5,_0x210b91,_0xf3d32,_0x575f75,_0x51e9ee){logger[_0x760a('0xd')](_0x760a('0xe'));var _0x5572c9=new Date();var _0x4fb72b=[{'name':'name','value':intUtil[_0x760a('0xf')](_0x12b0a5['Subjects'],_0x210b91,'\x20')},{'name':_0x760a('0x10'),'value':_0x3aa013['id']},{'name':'created_by','value':_0x3aa013['id']},{'name':_0x760a('0x11'),'value':intUtil[_0x760a('0xf')](_0x12b0a5[_0x760a('0x12')],_0x210b91,'\x0a')},{'name':_0x760a('0x13'),'value':_0x5572c9[_0x760a('0x14')]()[_0x760a('0x15')](0x0,0x13)['replace']('T','\x20')},{'name':_0x760a('0x16'),'value':'0'},{'name':_0x760a('0x17'),'value':'15'},{'name':_0x760a('0x18'),'value':_0x417c42['id']},{'name':_0x760a('0x19'),'value':'Contacts'},{'name':'parent_name','value':_0x417c42['name']},{'name':_0x760a('0x1a'),'value':_0x51e9ee}];if(_0xf3d32[_0x760a('0x1b')]){_[_0x760a('0x1c')](_0xf3d32,function(_0x208353){if(_0x210b91[_0x208353[_0x760a('0x1d')]]){_0x4fb72b['push']({'name':_0x208353[_0x760a('0x1e')],'value':_0x210b91[_0x208353['variableName']]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x760a('0x1f')]({'session':_0x575f75['id'],'module_name':_0x760a('0x20'),'name_value_list':_0x4fb72b})}});}function getAuth(_0x4f0a86){return util[_0x760a('0x21')]('Basic\x20%s',new Buffer(_0x4f0a86[_0x760a('0x22')]+':X')[_0x760a('0x23')](_0x760a('0x24')));}function getServerInfo(_0xe50848){return request({'form':{'method':_0x760a('0x25'),'input_type':_0x760a('0x26'),'response_type':_0x760a('0x26'),'rest_data':JSON[_0x760a('0x1f')]({'session':_0xe50848['id']})}});}function getUser(_0x2429e3,_0x1f7bde,_0x197b6a){if(!_['isNil'](_0x1f7bde)){logger[_0x760a('0xd')](_0x760a('0x27'),_0x1f7bde);return request({'form':{'method':_0x760a('0x28'),'input_type':_0x760a('0x26'),'response_type':_0x760a('0x26'),'rest_data':JSON[_0x760a('0x1f')]({'session':_0x197b6a['id'],'module_name':_0x760a('0x29'),'query':util[_0x760a('0x21')](_0x760a('0x2a'),_0x1f7bde),'order_by':'','offset':'0','select_fields':['id','name',_0x760a('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x760a('0x2c')](function(_0x16f8a8){if(_0x16f8a8[_0x760a('0x2d')]['length']){var _0x59e465=_[_0x760a('0x2e')](_0x16f8a8[_0x760a('0x2d')],function(_0x4c4d10){return _0x4c4d10[_0x760a('0x2f')][_0x760a('0x2b')][_0x760a('0x30')]===_0x1f7bde;});if(_0x59e465){logger['info'](_0x760a('0x31'));return BPromise['resolve']({'id':_0x59e465[_0x760a('0x2f')]['id'][_0x760a('0x30')],'name':_0x59e465[_0x760a('0x2f')][_0x760a('0x32')][_0x760a('0x30')]});}}logger[_0x760a('0xd')](_0x760a('0x33'));return BPromise[_0x760a('0x34')]({'id':_0x197b6a['name_value_list'][_0x760a('0x35')][_0x760a('0x30')],'name':_0x197b6a[_0x760a('0x2f')][_0x760a('0x2b')][_0x760a('0x30')]});});}else{logger[_0x760a('0xd')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x760a('0x34')]({'id':_0x197b6a[_0x760a('0x2f')][_0x760a('0x35')][_0x760a('0x30')],'name':_0x197b6a[_0x760a('0x2f')]['user_name'][_0x760a('0x30')]});}}function getEndUser(_0x1eb9e0,_0x5783ac,_0x132c33,_0x28b5ad){logger[_0x760a('0xd')](_0x760a('0x36'),_0x132c33);return request({'form':{'method':_0x760a('0x28'),'input_type':_0x760a('0x26'),'response_type':_0x760a('0x26'),'rest_data':JSON[_0x760a('0x1f')]({'session':_0x28b5ad['id'],'module_name':_0x760a('0x37'),'query':util['format'](_0x760a('0x38'),_0x132c33),'order_by':'','offset':'0','select_fields':['id',_0x760a('0x32'),_0x760a('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x760a('0x2c')](function(_0x25d612){if(_0x25d612['entry_list']['length']){var _0xe35522=_[_0x760a('0x2e')](_0x25d612['entry_list'],function(_0x539223){return _0x539223[_0x760a('0x2f')][_0x760a('0x39')][_0x760a('0x30')]===_0x132c33;});if(_0xe35522){logger[_0x760a('0xd')](_0x760a('0x3a'));return BPromise[_0x760a('0x34')]({'id':_0xe35522[_0x760a('0x2f')]['id'][_0x760a('0x30')],'name':_0xe35522[_0x760a('0x2f')][_0x760a('0x32')][_0x760a('0x30')],'phone':_0xe35522[_0x760a('0x2f')][_0x760a('0x39')]['value']});}}else{logger['info'](_0x760a('0x3b'));return request({'form':{'method':'set_entry','input_type':_0x760a('0x26'),'response_type':'JSON','rest_data':JSON[_0x760a('0x1f')]({'session':_0x28b5ad['id'],'module_name':_0x760a('0x37'),'name_value_list':[{'name':_0x760a('0x3c'),'value':_0x5783ac!==_0x760a('0x3d')?_0x5783ac:util['format']('Caller\x20-\x20%s',_0x132c33)},{'name':_0x760a('0x39'),'value':_0x132c33}]})}})['then'](function(_0x345b7b){logger[_0x760a('0xd')](_0x760a('0x3e'));return BPromise[_0x760a('0x34')]({'id':_0x345b7b['id'],'name':_0x345b7b[_0x760a('0x2d')][_0x760a('0x3c')][_0x760a('0x30')],'phone':_0x345b7b[_0x760a('0x2d')][_0x760a('0x39')]['value']});});}});}function request(_0x46c6c1){logger[_0x760a('0x3f')](_0x760a('0x40'),JSON[_0x760a('0x1f')](_0x46c6c1));return rp(_[_0x760a('0x41')](def,_0x46c6c1));}function getTags(_0x3416a5,_0x5d53be){var _0x7281f6=[];if(_0x3416a5&&_0x3416a5['length']>0x0){_0x7281f6=_[_0x760a('0x42')](_0x3416a5,_0x5d53be);}return _0x7281f6;}function getCustomFields(_0x29d94a,_0x4a2eab){var _0x7f32e5=[];var _0x3f1a45={'custom_fields':[]};if(_0x29d94a[_0x760a('0x1b')]>0x0){_[_0x760a('0x1c')](_0x29d94a,function(_0x2eb9c7){if(_0x2eb9c7['type']===_0x760a('0x43')&&_0x2eb9c7[_0x760a('0x44')]&&!_0x2eb9c7[_0x760a('0x45')]){_0x3f1a45[_0x2eb9c7[_0x760a('0x44')][_0x760a('0x46')]()]=_0x2eb9c7[_0x760a('0x47')][_0x760a('0x23')]();}else if(_0x2eb9c7[_0x760a('0x48')]==='string'&&_0x2eb9c7['idField']&&_0x2eb9c7[_0x760a('0x45')]){_0x3f1a45['custom_fields']['push']({'id':_0x2eb9c7['idField'],'value':_0x2eb9c7[_0x760a('0x47')][_0x760a('0x23')]()});}else if(_0x2eb9c7[_0x760a('0x48')]===_0x760a('0x49')&&_0x2eb9c7['variableName']&&_0x2eb9c7[_0x760a('0x1e')]&&_0x2eb9c7['customField']){_0x4a2eab[_0x2eb9c7[_0x760a('0x1d')]]&&_0x3f1a45[_0x760a('0x4a')][_0x760a('0x4b')]({'id':_0x2eb9c7['idField'],'value':_0x4a2eab[_0x2eb9c7[_0x760a('0x1d')]]['toString']()});}else if(_0x2eb9c7['type']===_0x760a('0x4c')&&_0x2eb9c7[_0x760a('0x4d')]&&_0x2eb9c7[_0x760a('0x4d')][_0x760a('0x32')]&&_0x2eb9c7[_0x760a('0x1e')]&&_0x2eb9c7[_0x760a('0x45')]){_0x4a2eab[_0x2eb9c7[_0x760a('0x4d')][_0x760a('0x32')][_0x760a('0x46')]()]&&_0x3f1a45['custom_fields'][_0x760a('0x4b')]({'id':_0x2eb9c7[_0x760a('0x1e')],'value':_0x4a2eab[_0x2eb9c7[_0x760a('0x4d')][_0x760a('0x32')][_0x760a('0x46')]()]['toString']()});}});}return _0x3f1a45;}function getConnection(_0x20b9f2){return request({'method':_0x760a('0xb'),'form':{'method':_0x760a('0x4e'),'input_type':'JSON','response_type':_0x760a('0x26'),'rest_data':JSON[_0x760a('0x1f')]({'user_auth':{'user_name':_0x20b9f2['username'],'password':_0x20b9f2[_0x760a('0x4f')],'encryption':_0x760a('0x50')},'application':_0x760a('0x51')})}})[_0x760a('0x2c')](function(_0x4d44a1){var _0x4d011e=_0x4d44a1;if(_0x4d011e['id']){def['sessionID']=_0x4d011e['id'];return BPromise['resolve'](_0x4d011e);}else{throw new Error(util[_0x760a('0x21')](_0x760a('0x52'),_0x20b9f2['id']));}});}function setRelationship(_0x550f56,_0x2f5eda,_0x159b03,_0x4165bd){return request({'form':{'method':'set_relationship','input_type':_0x760a('0x26'),'response_type':_0x760a('0x26'),'rest_data':JSON[_0x760a('0x1f')]({'session':_0x550f56['id'],'module_name':_0x760a('0x20'),'module_id':_0x159b03['id'],'link_field_name':_0x4165bd,'related_ids':[_0x2f5eda['id']]})}});}exports['queue']=function(_0x11b9a4,_0x4ad745,_0x5a2a68,_0x58fb8b,_0x1d8fdf,_0x27ba24){var _0x23905e,_0x5b40c8,_0x41bcd0,_0x295f41;_0x27ba24['remoteUri']=intUtil[_0x760a('0x53')](_0x27ba24['remoteUri']);_0x27ba24[_0x760a('0x54')]=intUtil[_0x760a('0x53')](_0x27ba24[_0x760a('0x54')]);def[_0x760a('0x55')]=util['format'](_0x760a('0x56'),_0x27ba24['remoteUri']);if(_0x1d8fdf&&_0x1d8fdf[_0x760a('0x57')]){logger[_0x760a('0xd')](_0x760a('0x58'),_0x760a('0x59'));_0x4ad745[_0x760a('0x5a')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x27ba24[_0x760a('0x54')],_0x4ad745[_0x760a('0x5b')],md5(_0x4ad745[_0x760a('0x5b')]));}else{_0x4ad745[_0x760a('0x5a')]='';}return getConnection(_0x27ba24)[_0x760a('0x2c')](function(_0x2fb5a8){_0x295f41=_0x2fb5a8;return getUser(_0x27ba24,_0x58fb8b[_0x760a('0x32')],_0x295f41);})[_0x760a('0x2c')](function(_0x4b6e13){_0x23905e=_0x4b6e13;logger[_0x760a('0xd')](_0x760a('0x5c'),_0x23905e['id']);return getEndUser(_0x27ba24,_0x4ad745[_0x760a('0x5d')],_0x4ad745[_0x760a('0x5e')],_0x295f41);})[_0x760a('0x2c')](function(_0x1cedcf){_0x5b40c8=_0x1cedcf;logger[_0x760a('0xd')](_0x760a('0x5f'),_0x5b40c8['id']);return getTicket(_0x27ba24,_0x23905e,_0x5b40c8,_0x5a2a68,_0x4ad745,_0x5a2a68[_0x760a('0x60')],_0x295f41,_0x760a('0x61'));})[_0x760a('0x2c')](function(_0x274f37){_0x41bcd0=_0x274f37;logger[_0x760a('0xd')]('Ticket\x20created!');logger[_0x760a('0xd')](_0x760a('0x62'),_0x41bcd0['id']);return setRelationship(_0x295f41,_0x23905e,_0x41bcd0,_0x760a('0x63'));})[_0x760a('0x2c')](function(){return setRelationship(_0x295f41,_0x5b40c8,_0x41bcd0,_0x760a('0x64'));})[_0x760a('0x2c')](function(){return getServerInfo(_0x295f41);})[_0x760a('0x2c')](function(_0x480fbb){var _0x507e17=parseInt(_0x480fbb['version'][_0x760a('0x65')](0x0));var _0x3b9fe6=util[_0x760a('0x21')](_0x760a('0x66'),_0x27ba24[_0x760a('0x67')],_0x41bcd0['id']);if(_0x507e17>0x6){_0x3b9fe6=util['format'](_0x760a('0x68'),_0x27ba24['remoteUri'],_0x41bcd0['id']);}logger[_0x760a('0xd')](_0x760a('0x58'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x760a('0x21')](_0x760a('0x69'),_0x58fb8b['name']),_0x760a('0x6a'),{'uri':_0x3b9fe6});})[_0x760a('0x6b')](function(_0x2cae0e){logger[_0x760a('0x6c')](_0x760a('0x58'),JSON[_0x760a('0x1f')](_0x2cae0e));});};exports[_0x760a('0x6d')]=function(_0x2f2eda,_0x24abfd,_0x532347,_0x466062,_0x570dc9,_0x4d5719,_0x5d4e69){var _0x2072f0,_0x4f83c1,_0x35e19f,_0x18f206;_0x4d5719[_0x760a('0x67')]=intUtil[_0x760a('0x53')](_0x4d5719[_0x760a('0x67')]);_0x4d5719[_0x760a('0x54')]=intUtil[_0x760a('0x53')](_0x4d5719[_0x760a('0x54')]);def[_0x760a('0x55')]=util[_0x760a('0x21')]('%s/service/v4_1/rest.php',_0x4d5719[_0x760a('0x67')]);if(_0x5d4e69&&_0x5d4e69[_0x760a('0x6e')]&&_0x5d4e69[_0x760a('0x6e')]!==_0x760a('0x6f')){logger[_0x760a('0xd')]('[OUTBOUND]',_0x760a('0x59'));_0x24abfd[_0x760a('0x5a')]=util[_0x760a('0x21')](_0x760a('0x70'),_0x4d5719[_0x760a('0x54')],_0x24abfd[_0x760a('0x5b')],md5(_0x24abfd[_0x760a('0x5b')]));}return getConnection(_0x4d5719)[_0x760a('0x2c')](function(_0x22971f){_0x18f206=_0x22971f;return getUser(_0x4d5719,_0x466062[_0x760a('0x32')],_0x18f206);})['then'](function(_0x2f191c){_0x2072f0=_0x2f191c;logger['info'](_0x760a('0x5c'),_0x2072f0['id']);return getEndUser(_0x4d5719,_0x24abfd['destcalleridname'],_0x24abfd[_0x760a('0x71')],_0x18f206);})[_0x760a('0x2c')](function(_0x3adbbf){_0x4f83c1=_0x3adbbf;logger['info'](_0x760a('0x5f'),_0x4f83c1['id']);return getTicket(_0x4d5719,_0x2072f0,_0x4f83c1,_0x532347,_0x24abfd,_0x532347[_0x760a('0x60')],_0x18f206,_0x760a('0x72'));})[_0x760a('0x2c')](function(_0xf17411){_0x35e19f=_0xf17411;logger['info'](_0x760a('0x73'));logger[_0x760a('0xd')]('The\x20Ticket\x20ID\x20is:',_0x35e19f['id']);return setRelationship(_0x18f206,_0x2072f0,_0x35e19f,'users');})[_0x760a('0x2c')](function(){return setRelationship(_0x18f206,_0x4f83c1,_0x35e19f,_0x760a('0x64'));})[_0x760a('0x2c')](function(){return getServerInfo(_0x18f206);})[_0x760a('0x2c')](function(_0x50c1fb){var _0x38a47f=parseInt(_0x50c1fb['version']['charAt'](0x0));var _0x3f8884=util[_0x760a('0x21')](_0x760a('0x66'),_0x4d5719['remoteUri'],_0x35e19f['id']);if(_0x38a47f>0x6){_0x3f8884=util['format'](_0x760a('0x68'),_0x4d5719['remoteUri'],_0x35e19f['id']);}logger[_0x760a('0xd')](_0x760a('0x74'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x760a('0x21')](_0x760a('0x69'),_0x466062[_0x760a('0x32')]),_0x760a('0x6a'),{'uri':_0x3f8884});})['catch'](function(_0x2f2c4f){logger[_0x760a('0x6c')](_0x760a('0x74'),JSON['stringify'](_0x2f2c4f));});};exports[_0x760a('0x75')]=function(_0x5592a5,_0x1b7a93,_0x2f7b57,_0x4c2d83,_0xd6819c,_0x20f75c){var _0x6e77b5,_0x4db392,_0x13bb10,_0x216c10;_0x20f75c[_0x760a('0x67')]=intUtil[_0x760a('0x53')](_0x20f75c['remoteUri']);_0x20f75c[_0x760a('0x54')]=intUtil[_0x760a('0x53')](_0x20f75c['serverUrl']);def[_0x760a('0x55')]=util[_0x760a('0x21')](_0x760a('0x56'),_0x20f75c[_0x760a('0x67')]);if(_0xd6819c&&_0xd6819c['monitor_format']){logger[_0x760a('0xd')](_0x760a('0x76'),'Recording\x20is\x20enabled!');_0x1b7a93[_0x760a('0x5a')]=util['format'](_0x760a('0x70'),_0x20f75c[_0x760a('0x54')],_0x1b7a93['uniqueid'],md5(_0x1b7a93[_0x760a('0x5b')]));}else{_0x1b7a93[_0x760a('0x5a')]='';}return getConnection(_0x20f75c)[_0x760a('0x2c')](function(_0x2bb6e4){_0x216c10=_0x2bb6e4;if(!_['isNil'](_0x4c2d83)){return getUser(_0x20f75c,_0x4c2d83['name'],_0x216c10);}else{return getUser(_0x20f75c,null,_0x216c10);}})[_0x760a('0x2c')](function(_0x23843f){_0x6e77b5=_0x23843f;logger['info']('The\x20User\x20ID\x20is:',_0x6e77b5['id']);return getEndUser(_0x20f75c,_0x1b7a93['calleridname'],_0x1b7a93[_0x760a('0x5e')],_0x216c10);})[_0x760a('0x2c')](function(_0x53c6b7){_0x4db392=_0x53c6b7;logger[_0x760a('0xd')](_0x760a('0x5f'),_0x4db392['id']);return getTicket(_0x20f75c,_0x6e77b5,_0x4db392,_0x2f7b57,_0x1b7a93,_0x2f7b57['Fields'],_0x216c10,_0x760a('0x61'));})[_0x760a('0x2c')](function(_0x287864){_0x13bb10=_0x287864;logger[_0x760a('0xd')](_0x760a('0x73'));logger['info'](_0x760a('0x62'),_0x13bb10['id']);return setRelationship(_0x216c10,_0x6e77b5,_0x13bb10,'users');})[_0x760a('0x2c')](function(){return setRelationship(_0x216c10,_0x4db392,_0x13bb10,_0x760a('0x64'));})['then'](function(){return getServerInfo(_0x216c10);})[_0x760a('0x6b')](function(_0x394a41){logger[_0x760a('0x6c')](_0x760a('0x76'),JSON['stringify'](_0x394a41));});}; \ No newline at end of file +var _0x3c0b=['entry_list','length','find','name_value_list','value','Agent\x20found!','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!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','forEach','type','nameField','customField','content','toString','custom_fields','variable','customVariable','Variable','toLowerCase','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','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','Outbound','Fields','[ABANDONED]','bluebird','md5','util','ioredis','../../../../config/environment','../../../../config/logger','defaults','localhost','socket.io-emitter','redis','POST','emit','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','direction','variableName','push','idField','set_entry','JSON','stringify','Calls','Basic\x20%s','apiKey','base64','get_server_info','isNil','info','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','name','user_name','then'];(function(_0x4f1821,_0xbbbf0f){var _0x2dc421=function(_0x4c0b4c){while(--_0x4c0b4c){_0x4f1821['push'](_0x4f1821['shift']());}};_0x2dc421(++_0xbbbf0f);}(_0x3c0b,0xcd));var _0xb3c0=function(_0xfb7598,_0x3325de){_0xfb7598=_0xfb7598-0x0;var _0x1f4a8c=_0x3c0b[_0xfb7598];return _0x1f4a8c;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0xb3c0('0x0'));var md5=require(_0xb3c0('0x1'));var util=require(_0xb3c0('0x2'));var Redis=require(_0xb3c0('0x3'));var intUtil=require('./util');var config=require(_0xb3c0('0x4'));var logger=require(_0xb3c0('0x5'))('sugarcrm');config['redis']=_[_0xb3c0('0x6')](config['redis'],{'host':_0xb3c0('0x7'),'port':0x18eb});var io=require(_0xb3c0('0x8'))(new Redis(config[_0xb3c0('0x9')]));var def={'method':_0xb3c0('0xa'),'json':!![]};function emit(_0x55ceb9,_0x2ad2f8,_0x2a4bb1){io['to'](_0x55ceb9)[_0xb3c0('0xb')](_0x2ad2f8,_0x2a4bb1);}function getTicket(_0x40660d,_0x473680,_0x441599,_0x6e5b71,_0x4ff91b,_0x1c048d,_0x8525c4,_0x525aa5){logger['info'](_0xb3c0('0xc'));var _0x1b999d=new Date();var _0x183f09=[{'name':'name','value':intUtil[_0xb3c0('0xd')](_0x6e5b71[_0xb3c0('0xe')],_0x4ff91b,'\x20')},{'name':_0xb3c0('0xf'),'value':_0x473680['id']},{'name':_0xb3c0('0x10'),'value':_0x473680['id']},{'name':_0xb3c0('0x11'),'value':intUtil[_0xb3c0('0xd')](_0x6e5b71[_0xb3c0('0x12')],_0x4ff91b,'\x0a')},{'name':_0xb3c0('0x13'),'value':_0x1b999d[_0xb3c0('0x14')]()[_0xb3c0('0x15')](0x0,0x13)[_0xb3c0('0x16')]('T','\x20')},{'name':_0xb3c0('0x17'),'value':'0'},{'name':_0xb3c0('0x18'),'value':'15'},{'name':_0xb3c0('0x19'),'value':_0x441599['id']},{'name':_0xb3c0('0x1a'),'value':_0xb3c0('0x1b')},{'name':'parent_name','value':_0x441599['name']},{'name':_0xb3c0('0x1c'),'value':_0x525aa5}];if(_0x1c048d['length']){_['forEach'](_0x1c048d,function(_0x50a42b){if(_0x4ff91b[_0x50a42b[_0xb3c0('0x1d')]]){_0x183f09[_0xb3c0('0x1e')]({'name':_0x50a42b[_0xb3c0('0x1f')],'value':_0x4ff91b[_0x50a42b[_0xb3c0('0x1d')]]});}});}return request({'form':{'method':_0xb3c0('0x20'),'input_type':_0xb3c0('0x21'),'response_type':_0xb3c0('0x21'),'rest_data':JSON[_0xb3c0('0x22')]({'session':_0x8525c4['id'],'module_name':_0xb3c0('0x23'),'name_value_list':_0x183f09})}});}function getAuth(_0x42bcce){return util['format'](_0xb3c0('0x24'),new Buffer(_0x42bcce[_0xb3c0('0x25')]+':X')['toString'](_0xb3c0('0x26')));}function getServerInfo(_0x3291e9){return request({'form':{'method':_0xb3c0('0x27'),'input_type':_0xb3c0('0x21'),'response_type':_0xb3c0('0x21'),'rest_data':JSON['stringify']({'session':_0x3291e9['id']})}});}function getUser(_0x253e88,_0x4bbd99,_0x500994){if(!_[_0xb3c0('0x28')](_0x4bbd99)){logger[_0xb3c0('0x29')]('Getting\x20agent\x20with\x20name',_0x4bbd99);return request({'form':{'method':_0xb3c0('0x2a'),'input_type':_0xb3c0('0x21'),'response_type':_0xb3c0('0x21'),'rest_data':JSON[_0xb3c0('0x22')]({'session':_0x500994['id'],'module_name':_0xb3c0('0x2b'),'query':util[_0xb3c0('0x2c')](_0xb3c0('0x2d'),_0x4bbd99),'order_by':'','offset':'0','select_fields':['id',_0xb3c0('0x2e'),_0xb3c0('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb3c0('0x30')](function(_0x3f7aa5){if(_0x3f7aa5[_0xb3c0('0x31')][_0xb3c0('0x32')]){var _0x2ee823=_[_0xb3c0('0x33')](_0x3f7aa5['entry_list'],function(_0x17f276){return _0x17f276[_0xb3c0('0x34')][_0xb3c0('0x2f')][_0xb3c0('0x35')]===_0x4bbd99;});if(_0x2ee823){logger[_0xb3c0('0x29')](_0xb3c0('0x36'));return BPromise[_0xb3c0('0x37')]({'id':_0x2ee823[_0xb3c0('0x34')]['id'][_0xb3c0('0x35')],'name':_0x2ee823[_0xb3c0('0x34')][_0xb3c0('0x2e')][_0xb3c0('0x35')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x500994['name_value_list'][_0xb3c0('0x38')]['value'],'name':_0x500994[_0xb3c0('0x34')][_0xb3c0('0x2f')][_0xb3c0('0x35')]});});}else{logger[_0xb3c0('0x29')](_0xb3c0('0x39'));return BPromise[_0xb3c0('0x37')]({'id':_0x500994[_0xb3c0('0x34')]['user_id'][_0xb3c0('0x35')],'name':_0x500994['name_value_list']['user_name'][_0xb3c0('0x35')]});}}function getEndUser(_0x107840,_0x3894ae,_0x32f00d,_0x4e1d98){logger[_0xb3c0('0x29')](_0xb3c0('0x3a'),_0x32f00d);return request({'form':{'method':_0xb3c0('0x2a'),'input_type':_0xb3c0('0x21'),'response_type':_0xb3c0('0x21'),'rest_data':JSON['stringify']({'session':_0x4e1d98['id'],'module_name':'Contacts','query':util[_0xb3c0('0x2c')](_0xb3c0('0x3b'),_0x32f00d),'order_by':'','offset':'0','select_fields':['id',_0xb3c0('0x2e'),_0xb3c0('0x3c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb3c0('0x30')](function(_0x194a67){if(_0x194a67[_0xb3c0('0x31')][_0xb3c0('0x32')]){var _0x47bf95=_[_0xb3c0('0x33')](_0x194a67[_0xb3c0('0x31')],function(_0x4884ab){return _0x4884ab[_0xb3c0('0x34')][_0xb3c0('0x3c')]['value']===_0x32f00d;});if(_0x47bf95){logger[_0xb3c0('0x29')](_0xb3c0('0x3d'));return BPromise[_0xb3c0('0x37')]({'id':_0x47bf95['name_value_list']['id'][_0xb3c0('0x35')],'name':_0x47bf95[_0xb3c0('0x34')]['name'][_0xb3c0('0x35')],'phone':_0x47bf95['name_value_list'][_0xb3c0('0x3c')][_0xb3c0('0x35')]});}}else{logger[_0xb3c0('0x29')](_0xb3c0('0x3e'));return request({'form':{'method':'set_entry','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xb3c0('0x22')]({'session':_0x4e1d98['id'],'module_name':_0xb3c0('0x1b'),'name_value_list':[{'name':_0xb3c0('0x3f'),'value':_0x3894ae!==_0xb3c0('0x40')?_0x3894ae:util['format'](_0xb3c0('0x41'),_0x32f00d)},{'name':_0xb3c0('0x3c'),'value':_0x32f00d}]})}})[_0xb3c0('0x30')](function(_0xbc517d){logger[_0xb3c0('0x29')](_0xb3c0('0x42'));return BPromise[_0xb3c0('0x37')]({'id':_0xbc517d['id'],'name':_0xbc517d[_0xb3c0('0x31')][_0xb3c0('0x3f')][_0xb3c0('0x35')],'phone':_0xbc517d[_0xb3c0('0x31')]['phone_home'][_0xb3c0('0x35')]});});}});}function request(_0x4209d0){logger[_0xb3c0('0x43')](_0xb3c0('0x44'),JSON[_0xb3c0('0x22')](_0x4209d0));return rp(_[_0xb3c0('0x45')](def,_0x4209d0));}function getTags(_0x64629e,_0xda1054){var _0x4e72e2=[];if(_0x64629e&&_0x64629e['length']>0x0){_0x4e72e2=_[_0xb3c0('0x46')](_0x64629e,_0xda1054);}return _0x4e72e2;}function getCustomFields(_0x4f12cc,_0x273080){var _0x480a74=[];var _0x1589be={'custom_fields':[]};if(_0x4f12cc[_0xb3c0('0x32')]>0x0){_[_0xb3c0('0x47')](_0x4f12cc,function(_0x407ca1){if(_0x407ca1[_0xb3c0('0x48')]==='string'&&_0x407ca1[_0xb3c0('0x49')]&&!_0x407ca1[_0xb3c0('0x4a')]){_0x1589be[_0x407ca1[_0xb3c0('0x49')]['toLowerCase']()]=_0x407ca1[_0xb3c0('0x4b')][_0xb3c0('0x4c')]();}else if(_0x407ca1[_0xb3c0('0x48')]==='string'&&_0x407ca1[_0xb3c0('0x1f')]&&_0x407ca1[_0xb3c0('0x4a')]){_0x1589be[_0xb3c0('0x4d')][_0xb3c0('0x1e')]({'id':_0x407ca1[_0xb3c0('0x1f')],'value':_0x407ca1['content'][_0xb3c0('0x4c')]()});}else if(_0x407ca1[_0xb3c0('0x48')]===_0xb3c0('0x4e')&&_0x407ca1['variableName']&&_0x407ca1[_0xb3c0('0x1f')]&&_0x407ca1[_0xb3c0('0x4a')]){_0x273080[_0x407ca1[_0xb3c0('0x1d')]]&&_0x1589be['custom_fields'][_0xb3c0('0x1e')]({'id':_0x407ca1['idField'],'value':_0x273080[_0x407ca1[_0xb3c0('0x1d')]][_0xb3c0('0x4c')]()});}else if(_0x407ca1[_0xb3c0('0x48')]===_0xb3c0('0x4f')&&_0x407ca1[_0xb3c0('0x50')]&&_0x407ca1['Variable'][_0xb3c0('0x2e')]&&_0x407ca1[_0xb3c0('0x1f')]&&_0x407ca1['customField']){_0x273080[_0x407ca1['Variable'][_0xb3c0('0x2e')][_0xb3c0('0x51')]()]&&_0x1589be[_0xb3c0('0x4d')][_0xb3c0('0x1e')]({'id':_0x407ca1[_0xb3c0('0x1f')],'value':_0x273080[_0x407ca1[_0xb3c0('0x50')][_0xb3c0('0x2e')][_0xb3c0('0x51')]()]['toString']()});}});}return _0x1589be;}function getConnection(_0x57e3bb){return request({'method':'POST','form':{'method':_0xb3c0('0x52'),'input_type':_0xb3c0('0x21'),'response_type':_0xb3c0('0x21'),'rest_data':JSON[_0xb3c0('0x22')]({'user_auth':{'user_name':_0x57e3bb[_0xb3c0('0x53')],'password':_0x57e3bb[_0xb3c0('0x54')],'encryption':_0xb3c0('0x55')},'application':_0xb3c0('0x56')})}})[_0xb3c0('0x30')](function(_0x1acfe4){var _0x13eff0=_0x1acfe4;if(_0x13eff0['id']){def[_0xb3c0('0x57')]=_0x13eff0['id'];return BPromise[_0xb3c0('0x37')](_0x13eff0);}else{throw new Error(util[_0xb3c0('0x2c')](_0xb3c0('0x58'),_0x57e3bb['id']));}});}function setRelationship(_0x1e4e94,_0x551c34,_0xca7781,_0x44d691){return request({'form':{'method':_0xb3c0('0x59'),'input_type':_0xb3c0('0x21'),'response_type':_0xb3c0('0x21'),'rest_data':JSON[_0xb3c0('0x22')]({'session':_0x1e4e94['id'],'module_name':_0xb3c0('0x23'),'module_id':_0xca7781['id'],'link_field_name':_0x44d691,'related_ids':[_0x551c34['id']]})}});}exports[_0xb3c0('0x5a')]=function(_0x5da39d,_0x3d3fa7,_0x1cdbfe,_0x3e831a,_0x57d3fc,_0x59e0e3){var _0x4d7e63,_0x3325cf,_0x5b937e,_0x4558d7;_0x59e0e3['remoteUri']=intUtil['stripTrailingSlash'](_0x59e0e3[_0xb3c0('0x5b')]);_0x59e0e3['serverUrl']=intUtil[_0xb3c0('0x5c')](_0x59e0e3[_0xb3c0('0x5d')]);def[_0xb3c0('0x5e')]=util['format'](_0xb3c0('0x5f'),_0x59e0e3['remoteUri']);if(_0x57d3fc&&_0x57d3fc[_0xb3c0('0x60')]){logger['info'](_0xb3c0('0x61'),'Recording\x20is\x20enabled!');_0x3d3fa7[_0xb3c0('0x62')]=util[_0xb3c0('0x2c')](_0xb3c0('0x63'),_0x59e0e3[_0xb3c0('0x5d')],_0x3d3fa7[_0xb3c0('0x64')],md5(_0x3d3fa7[_0xb3c0('0x64')]));}else{_0x3d3fa7[_0xb3c0('0x62')]='';}return getConnection(_0x59e0e3)[_0xb3c0('0x30')](function(_0xdd3a66){_0x4558d7=_0xdd3a66;return getUser(_0x59e0e3,_0x3e831a[_0xb3c0('0x2e')],_0x4558d7);})[_0xb3c0('0x30')](function(_0x2e8e9e){_0x4d7e63=_0x2e8e9e;logger[_0xb3c0('0x29')](_0xb3c0('0x65'),_0x4d7e63['id']);return getEndUser(_0x59e0e3,_0x3d3fa7[_0xb3c0('0x66')],_0x3d3fa7[_0xb3c0('0x67')],_0x4558d7);})['then'](function(_0x4fbbc5){_0x3325cf=_0x4fbbc5;logger[_0xb3c0('0x29')](_0xb3c0('0x68'),_0x3325cf['id']);return getTicket(_0x59e0e3,_0x4d7e63,_0x3325cf,_0x1cdbfe,_0x3d3fa7,_0x1cdbfe['Fields'],_0x4558d7,_0xb3c0('0x69'));})['then'](function(_0x52dd9b){_0x5b937e=_0x52dd9b;logger[_0xb3c0('0x29')](_0xb3c0('0x6a'));logger[_0xb3c0('0x29')]('The\x20Ticket\x20ID\x20is:',_0x5b937e['id']);return setRelationship(_0x4558d7,_0x4d7e63,_0x5b937e,_0xb3c0('0x6b'));})[_0xb3c0('0x30')](function(){return setRelationship(_0x4558d7,_0x3325cf,_0x5b937e,_0xb3c0('0x6c'));})['then'](function(){return getServerInfo(_0x4558d7);})[_0xb3c0('0x30')](function(_0x3862b1){var _0x2efe60=parseInt(_0x3862b1[_0xb3c0('0x6d')][_0xb3c0('0x6e')](0x0));var _0x295492=util[_0xb3c0('0x2c')](_0xb3c0('0x6f'),_0x59e0e3['remoteUri'],_0x5b937e['id']);if(_0x2efe60>0x6){_0x295492=util[_0xb3c0('0x2c')](_0xb3c0('0x70'),_0x59e0e3[_0xb3c0('0x5b')],_0x5b937e['id']);}logger[_0xb3c0('0x29')](_0xb3c0('0x61'),_0xb3c0('0x71'));emit(util[_0xb3c0('0x2c')](_0xb3c0('0x72'),_0x3e831a[_0xb3c0('0x2e')]),_0xb3c0('0x73'),{'uri':_0x295492});})[_0xb3c0('0x74')](function(_0x466dc2){logger[_0xb3c0('0x75')](_0xb3c0('0x61'),JSON[_0xb3c0('0x22')](_0x466dc2));});};exports[_0xb3c0('0x76')]=function(_0x5478bb,_0xc68f19,_0x5edb2a,_0x5b485e,_0x54c8e5,_0x5aaadc,_0x47d0a5){var _0x5385c6,_0x581d11,_0x3feda5,_0x4a50e1;_0x5aaadc['remoteUri']=intUtil[_0xb3c0('0x5c')](_0x5aaadc[_0xb3c0('0x5b')]);_0x5aaadc[_0xb3c0('0x5d')]=intUtil[_0xb3c0('0x5c')](_0x5aaadc['serverUrl']);def[_0xb3c0('0x5e')]=util[_0xb3c0('0x2c')]('%s/service/v4_1/rest.php',_0x5aaadc[_0xb3c0('0x5b')]);if(_0x47d0a5&&_0x47d0a5[_0xb3c0('0x77')]&&_0x47d0a5['recordingFormat']!==_0xb3c0('0x78')){logger[_0xb3c0('0x29')](_0xb3c0('0x79'),_0xb3c0('0x7a'));_0xc68f19[_0xb3c0('0x62')]=util[_0xb3c0('0x2c')](_0xb3c0('0x63'),_0x5aaadc['serverUrl'],_0xc68f19[_0xb3c0('0x64')],md5(_0xc68f19[_0xb3c0('0x64')]));}return getConnection(_0x5aaadc)[_0xb3c0('0x30')](function(_0x2d87e5){_0x4a50e1=_0x2d87e5;return getUser(_0x5aaadc,_0x5b485e[_0xb3c0('0x2e')],_0x4a50e1);})['then'](function(_0x3d9456){_0x5385c6=_0x3d9456;logger['info'](_0xb3c0('0x65'),_0x5385c6['id']);return getEndUser(_0x5aaadc,_0xc68f19[_0xb3c0('0x7b')],_0xc68f19['destcalleridnum'],_0x4a50e1);})['then'](function(_0x30bff7){_0x581d11=_0x30bff7;logger[_0xb3c0('0x29')](_0xb3c0('0x68'),_0x581d11['id']);return getTicket(_0x5aaadc,_0x5385c6,_0x581d11,_0x5edb2a,_0xc68f19,_0x5edb2a['Fields'],_0x4a50e1,_0xb3c0('0x7c'));})['then'](function(_0x31c2e4){_0x3feda5=_0x31c2e4;logger[_0xb3c0('0x29')](_0xb3c0('0x6a'));logger[_0xb3c0('0x29')]('The\x20Ticket\x20ID\x20is:',_0x3feda5['id']);return setRelationship(_0x4a50e1,_0x5385c6,_0x3feda5,_0xb3c0('0x6b'));})['then'](function(){return setRelationship(_0x4a50e1,_0x581d11,_0x3feda5,'contacts');})['then'](function(){return getServerInfo(_0x4a50e1);})['then'](function(_0x560456){var _0x499240=parseInt(_0x560456[_0xb3c0('0x6d')][_0xb3c0('0x6e')](0x0));var _0x3c138e=util[_0xb3c0('0x2c')](_0xb3c0('0x6f'),_0x5aaadc[_0xb3c0('0x5b')],_0x3feda5['id']);if(_0x499240>0x6){_0x3c138e=util[_0xb3c0('0x2c')](_0xb3c0('0x70'),_0x5aaadc[_0xb3c0('0x5b')],_0x3feda5['id']);}logger[_0xb3c0('0x29')]('[OUTBOUND]',_0xb3c0('0x71'));emit(util['format'](_0xb3c0('0x72'),_0x5b485e[_0xb3c0('0x2e')]),_0xb3c0('0x73'),{'uri':_0x3c138e});})[_0xb3c0('0x74')](function(_0x3fd1b2){logger[_0xb3c0('0x75')](_0xb3c0('0x79'),JSON[_0xb3c0('0x22')](_0x3fd1b2));});};exports['abandoned']=function(_0x3e667,_0x492579,_0x5915d3,_0x42492f,_0x5ab8f5,_0x461566){var _0x36008c,_0x4ff8c9,_0x1ab8aa,_0x2f8785;_0x461566['remoteUri']=intUtil['stripTrailingSlash'](_0x461566['remoteUri']);_0x461566['serverUrl']=intUtil[_0xb3c0('0x5c')](_0x461566[_0xb3c0('0x5d')]);def[_0xb3c0('0x5e')]=util[_0xb3c0('0x2c')]('%s/service/v4_1/rest.php',_0x461566[_0xb3c0('0x5b')]);if(_0x5ab8f5&&_0x5ab8f5[_0xb3c0('0x60')]){logger[_0xb3c0('0x29')]('[ABANDONED]',_0xb3c0('0x7a'));_0x492579[_0xb3c0('0x62')]=util[_0xb3c0('0x2c')](_0xb3c0('0x63'),_0x461566['serverUrl'],_0x492579[_0xb3c0('0x64')],md5(_0x492579[_0xb3c0('0x64')]));}else{_0x492579[_0xb3c0('0x62')]='';}return getConnection(_0x461566)[_0xb3c0('0x30')](function(_0x5c1e75){_0x2f8785=_0x5c1e75;if(!_[_0xb3c0('0x28')](_0x42492f)){return getUser(_0x461566,_0x42492f['name'],_0x2f8785);}else{return getUser(_0x461566,null,_0x2f8785);}})[_0xb3c0('0x30')](function(_0x32f9eb){_0x36008c=_0x32f9eb;logger[_0xb3c0('0x29')](_0xb3c0('0x65'),_0x36008c['id']);return getEndUser(_0x461566,_0x492579[_0xb3c0('0x66')],_0x492579[_0xb3c0('0x67')],_0x2f8785);})[_0xb3c0('0x30')](function(_0x49d838){_0x4ff8c9=_0x49d838;logger[_0xb3c0('0x29')](_0xb3c0('0x68'),_0x4ff8c9['id']);return getTicket(_0x461566,_0x36008c,_0x4ff8c9,_0x5915d3,_0x492579,_0x5915d3[_0xb3c0('0x7d')],_0x2f8785,_0xb3c0('0x69'));})[_0xb3c0('0x30')](function(_0x44f25f){_0x1ab8aa=_0x44f25f;logger[_0xb3c0('0x29')](_0xb3c0('0x6a'));logger[_0xb3c0('0x29')]('The\x20Ticket\x20ID\x20is:',_0x1ab8aa['id']);return setRelationship(_0x2f8785,_0x36008c,_0x1ab8aa,_0xb3c0('0x6b'));})[_0xb3c0('0x30')](function(){return setRelationship(_0x2f8785,_0x4ff8c9,_0x1ab8aa,_0xb3c0('0x6c'));})[_0xb3c0('0x30')](function(){return getServerInfo(_0x2f8785);})['catch'](function(_0x4acb97){logger['error'](_0xb3c0('0x7e'),JSON[_0xb3c0('0x22')](_0x4acb97));});}; \ 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 c6b9f9b..c55d1f5 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 _0x3109=['lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','type','push','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','string','key','format','%s:\x20%s','keyContent','join','slice','substring'];(function(_0x4d162a,_0x5cfd72){var _0x5601d8=function(_0x23c0bb){while(--_0x23c0bb){_0x4d162a['push'](_0x4d162a['shift']());}};_0x5601d8(++_0x5cfd72);}(_0x3109,0x199));var _0x9310=function(_0xb9f411,_0x51f9a2){_0xb9f411=_0xb9f411-0x0;var _0x25a634=_0x3109[_0xb9f411];return _0x25a634;};'use strict';var _=require(_0x9310('0x0'));var util=require(_0x9310('0x1'));exports[_0x9310('0x2')]=function(_0x1ba80c,_0x3c6989,_0x23aaf1){var _0x24f15f=[];if(_0x1ba80c[_0x9310('0x3')]>0x0){var _0x11d38d=_['sortBy'](_0x1ba80c,['id']);for(var _0x249127=0x0;_0x249127<_0x11d38d['length'];_0x249127++){var _0x3f857d=_0x11d38d[_0x249127];if(_0x3f857d[_0x9310('0x4')]==='string'){_0x24f15f[_0x9310('0x5')](_0x3f857d['content']);}else if(_0x3f857d[_0x9310('0x4')]===_0x9310('0x6')&&_0x3f857d[_0x9310('0x7')]){_0x3c6989[_0x3f857d['variableName']]&&_0x24f15f['push'](_0x3c6989[_0x3f857d[_0x9310('0x7')]][_0x9310('0x8')]());}else if(_0x3f857d['type']===_0x9310('0x9')&&_0x3f857d[_0x9310('0xa')]&&_0x3f857d['Variable'][_0x9310('0xb')]){_0x3c6989[_0x3f857d[_0x9310('0xa')][_0x9310('0xb')][_0x9310('0xc')]()]&&_0x24f15f[_0x9310('0x5')](_0x3c6989[_0x3f857d[_0x9310('0xa')][_0x9310('0xb')][_0x9310('0xc')]()][_0x9310('0x8')]());}else if(_0x3f857d[_0x9310('0x4')]===_0x9310('0xd')){if(_0x3f857d[_0x9310('0xe')]===_0x9310('0xf')&&_0x3f857d[_0x9310('0x10')]){_0x24f15f[_0x9310('0x5')](util[_0x9310('0x11')](_0x9310('0x12'),_0x3f857d['key'],_0x3f857d[_0x9310('0x13')]));}else if(_0x3f857d[_0x9310('0xe')]===_0x9310('0x6')&&_0x3f857d[_0x9310('0x7')]&&_0x3f857d[_0x9310('0x10')]){_0x3c6989[_0x3f857d[_0x9310('0x7')]]&&_0x24f15f['push'](util['format'](_0x9310('0x12'),_0x3f857d['key'],_0x3c6989[_0x3f857d['variableName']]));}else if(_0x3f857d[_0x9310('0xe')]===_0x9310('0x9')&&_0x3f857d[_0x9310('0xa')]&&_0x3f857d['Variable'][_0x9310('0xb')]&&_0x3f857d[_0x9310('0x10')]){_0x3c6989[_0x3f857d[_0x9310('0xa')][_0x9310('0xb')]['toLowerCase']()]&&_0x24f15f[_0x9310('0x5')](util[_0x9310('0x11')]('%s:\x20%s',_0x3f857d[_0x9310('0x10')],_0x3c6989[_0x3f857d[_0x9310('0xa')]['name'][_0x9310('0xc')]()]));}}}}return _0x24f15f[_0x9310('0x14')](_0x23aaf1);};exports['stripTrailingSlash']=function(_0x571e82){var _0x2e6448=_0x571e82[_0x9310('0x15')](-0x1);if(_0x2e6448==='/'){_0x571e82=_0x571e82[_0x9310('0x16')](0x0,_0x571e82[_0x9310('0x17')](_0x2e6448));}return _0x571e82;};exports[_0x9310('0x18')]=function(_0x2365b8){if(!_[_0x9310('0x19')](_0x2365b8)&&_0x2365b8!==''){var _0x3709ff=/^(([^<>()\[\]\\.,;:\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 _0x3709ff[_0x9310('0x1a')](String(_0x2365b8)[_0x9310('0xc')]());}else{return![];}}; \ No newline at end of file +var _0x7cb5=['isNil','lodash','getString','length','sortBy','type','push','variable','variableName','customVariable','Variable','name','toLowerCase','keyValue','keyType','string','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','slice'];(function(_0x5ce05e,_0x2929b6){var _0x231e1e=function(_0x24c589){while(--_0x24c589){_0x5ce05e['push'](_0x5ce05e['shift']());}};_0x231e1e(++_0x2929b6);}(_0x7cb5,0x74));var _0x57cb=function(_0x594617,_0x560824){_0x594617=_0x594617-0x0;var _0x36df8e=_0x7cb5[_0x594617];return _0x36df8e;};'use strict';var _=require(_0x57cb('0x0'));var util=require('util');exports[_0x57cb('0x1')]=function(_0x52ebf9,_0x2cd4ce,_0x5ebd67){var _0x2810f3=[];if(_0x52ebf9[_0x57cb('0x2')]>0x0){var _0x178b87=_[_0x57cb('0x3')](_0x52ebf9,['id']);for(var _0x2f54b7=0x0;_0x2f54b7<_0x178b87[_0x57cb('0x2')];_0x2f54b7++){var _0x2b5043=_0x178b87[_0x2f54b7];if(_0x2b5043[_0x57cb('0x4')]==='string'){_0x2810f3[_0x57cb('0x5')](_0x2b5043['content']);}else if(_0x2b5043['type']===_0x57cb('0x6')&&_0x2b5043[_0x57cb('0x7')]){_0x2cd4ce[_0x2b5043['variableName']]&&_0x2810f3['push'](_0x2cd4ce[_0x2b5043['variableName']]['toString']());}else if(_0x2b5043['type']===_0x57cb('0x8')&&_0x2b5043['Variable']&&_0x2b5043[_0x57cb('0x9')]['name']){_0x2cd4ce[_0x2b5043['Variable']['name']['toLowerCase']()]&&_0x2810f3[_0x57cb('0x5')](_0x2cd4ce[_0x2b5043[_0x57cb('0x9')][_0x57cb('0xa')][_0x57cb('0xb')]()]['toString']());}else if(_0x2b5043[_0x57cb('0x4')]===_0x57cb('0xc')){if(_0x2b5043[_0x57cb('0xd')]===_0x57cb('0xe')&&_0x2b5043[_0x57cb('0xf')]){_0x2810f3[_0x57cb('0x5')](util[_0x57cb('0x10')](_0x57cb('0x11'),_0x2b5043[_0x57cb('0xf')],_0x2b5043[_0x57cb('0x12')]));}else if(_0x2b5043[_0x57cb('0xd')]===_0x57cb('0x6')&&_0x2b5043[_0x57cb('0x7')]&&_0x2b5043['key']){_0x2cd4ce[_0x2b5043['variableName']]&&_0x2810f3[_0x57cb('0x5')](util[_0x57cb('0x10')](_0x57cb('0x11'),_0x2b5043[_0x57cb('0xf')],_0x2cd4ce[_0x2b5043[_0x57cb('0x7')]]));}else if(_0x2b5043[_0x57cb('0xd')]===_0x57cb('0x8')&&_0x2b5043[_0x57cb('0x9')]&&_0x2b5043[_0x57cb('0x9')]['name']&&_0x2b5043[_0x57cb('0xf')]){_0x2cd4ce[_0x2b5043[_0x57cb('0x9')][_0x57cb('0xa')][_0x57cb('0xb')]()]&&_0x2810f3[_0x57cb('0x5')](util['format'](_0x57cb('0x11'),_0x2b5043[_0x57cb('0xf')],_0x2cd4ce[_0x2b5043[_0x57cb('0x9')][_0x57cb('0xa')][_0x57cb('0xb')]()]));}}}}return _0x2810f3[_0x57cb('0x13')](_0x5ebd67);};exports[_0x57cb('0x14')]=function(_0x35d576){var _0x35984c=_0x35d576[_0x57cb('0x15')](-0x1);if(_0x35984c==='/'){_0x35d576=_0x35d576['substring'](0x0,_0x35d576['lastIndexOf'](_0x35984c));}return _0x35d576;};exports['validateEmail']=function(_0x439716){if(!_[_0x57cb('0x16')](_0x439716)&&_0x439716!==''){var _0x480488=/^(([^<>()\[\]\\.,;:\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 _0x480488['test'](String(_0x439716)[_0x57cb('0xb')]());}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 2e71356..920065c 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 _0xddb8=['Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','[QUEUE]','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','abandoned','[ABANDONED]','Fields','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','string','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Open','getString','Subjects','POST','remoteUri','create','sessionName','stringify','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','admin','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','Agent\x20found!','last_name','[vTiger],\x20%s,\x20%s,\x20%s','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','username','getUser','Searching\x20end\x20user\x20with\x20phone','then','Enduser\x20found!','firstname','Contacts','Enduser\x20created.','lastname','phone','getEndUser','accessKey','getConnection','[HTTP]','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xddb8,0xd7));var _0x8ddb=function(_0x336b2c,_0xf89e9f){_0x336b2c=_0x336b2c-0x0;var _0x23dd8f=_0xddb8[_0x336b2c];return _0x23dd8f;};'use strict';var _=require('lodash');var rp=require(_0x8ddb('0x0'));var BPromise=require(_0x8ddb('0x1'));var md5=require(_0x8ddb('0x2'));var util=require('util');var Redis=require(_0x8ddb('0x3'));var intUtil=require(_0x8ddb('0x4'));var config=require(_0x8ddb('0x5'));var logger=require(_0x8ddb('0x6'))(_0x8ddb('0x7'));config[_0x8ddb('0x8')]=_['defaults'](config['redis'],{'host':_0x8ddb('0x9'),'port':0x18eb});var io=require(_0x8ddb('0xa'))(new Redis(config['redis']));function emit(_0x49d529,_0x27b901,_0x2af85c){io['to'](_0x49d529)[_0x8ddb('0xb')](_0x27b901,_0x2af85c);}function getCustomFields(_0x49b77e,_0x459f24){var _0x21d488={};if(_0x49b77e[_0x8ddb('0xc')]>0x0){_[_0x8ddb('0xd')](_0x49b77e,function(_0x258ac4){if(_0x258ac4['type']===_0x8ddb('0xe')&&_0x258ac4[_0x8ddb('0xf')]){_0x21d488[_0x258ac4['idField']]=_0x258ac4[_0x8ddb('0x10')][_0x8ddb('0x11')]();}else if(_0x258ac4[_0x8ddb('0x12')]===_0x8ddb('0x13')&&_0x258ac4[_0x8ddb('0x14')]&&_0x258ac4[_0x8ddb('0xf')]&&_0x459f24[_0x258ac4[_0x8ddb('0x14')]]){_0x21d488[_0x258ac4[_0x8ddb('0xf')]]=_0x459f24[_0x258ac4[_0x8ddb('0x14')]]['toString']();}else if(_0x258ac4[_0x8ddb('0x12')]===_0x8ddb('0x15')&&_0x258ac4[_0x8ddb('0x16')]&&_0x258ac4[_0x8ddb('0x16')][_0x8ddb('0x17')]&&_0x258ac4[_0x8ddb('0xf')]&&_0x459f24[_0x258ac4[_0x8ddb('0x16')][_0x8ddb('0x17')]['toLowerCase']()]){_0x21d488[_0x258ac4[_0x8ddb('0xf')]]=_0x459f24[_0x258ac4['Variable'][_0x8ddb('0x17')][_0x8ddb('0x18')]()][_0x8ddb('0x11')]();}});}return _0x21d488;}function createTicket(_0x4a8693,_0x3dee19,_0xc11909,_0x13a3f8,_0x26cee6,_0x14b115,_0x10628d){logger[_0x8ddb('0x19')](_0x8ddb('0x1a'));var _0x1030b3=_[_0x8ddb('0x1b')]({'parent_id':'','assigned_user_id':_0x3dee19['id'],'ticketpriorities':'Normal','ticketstatus':_0x8ddb('0x1c'),'ticket_title':intUtil[_0x8ddb('0x1d')](_0x13a3f8[_0x8ddb('0x1e')],_0x26cee6,'\x20'),'description':intUtil[_0x8ddb('0x1d')](_0x13a3f8['Descriptions'],_0x26cee6,'\x0a'),'contact_id':_0xc11909['id']},getCustomFields(_0x14b115,_0x26cee6));var _0x42b978={'method':_0x8ddb('0x1f'),'uri':util['format']('%s/webservice.php',_0x4a8693[_0x8ddb('0x20')]),'form':{'operation':_0x8ddb('0x21'),'username':'admin','sessionName':_0x10628d[_0x8ddb('0x22')],'elementType':'HelpDesk','element':JSON[_0x8ddb('0x23')](_0x1030b3)},'json':!![]};return request(_0x42b978)['then'](function(_0x53b199){if(_0x53b199['success']){return BPromise[_0x8ddb('0x24')]({'id':_0x53b199[_0x8ddb('0x25')]['id']});}else{throw new Error(util[_0x8ddb('0x26')](_0x8ddb('0x27'),JSON[_0x8ddb('0x23')](_0x53b199['error'])));}})[_0x8ddb('0x28')](function(_0xc74028){var _0x3c7622=_0xc74028[_0x8ddb('0x29')]||0x1f4;logger[_0x8ddb('0x2a')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x8ddb('0x2b'),_0x3c7622,JSON['stringify'](_0xc74028));});}function getUser(_0x1e4625,_0x4c0281,_0x5b080c){if(intUtil[_0x8ddb('0x2c')](_0x4c0281)){logger[_0x8ddb('0x19')](_0x8ddb('0x2d'),_0x4c0281);return request({'method':_0x8ddb('0x2e'),'uri':util[_0x8ddb('0x26')](_0x8ddb('0x2f'),_0x1e4625[_0x8ddb('0x20')]),'qs':{'operation':_0x8ddb('0x30'),'username':_0x8ddb('0x31'),'sessionName':_0x5b080c['sessionName'],'query':util[_0x8ddb('0x26')](_0x8ddb('0x32'),_0x4c0281)},'json':!![]})['then'](function(_0x46f47a){if(_0x46f47a[_0x8ddb('0x33')]&&_0x46f47a[_0x8ddb('0x25')][_0x8ddb('0xc')]){logger[_0x8ddb('0x19')](_0x8ddb('0x34'));return BPromise['resolve']({'id':_0x46f47a[_0x8ddb('0x25')][0x0]['id'],'email':_0x46f47a[_0x8ddb('0x25')][0x0]['email1'],'name':_0x46f47a[_0x8ddb('0x25')][0x0]['first_name']+'\x20'+_0x46f47a['result'][_0x8ddb('0x35')]});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x8ddb('0x24')]({'id':_0x5b080c['userId'],'email':_0x1e4625['username'],'name':_0x8ddb('0x31')});}})[_0x8ddb('0x28')](function(_0x50f960){var _0x116c06=_0x50f960['statusCode']||0x1f4;logger[_0x8ddb('0x2a')](_0x8ddb('0x36'),'getUser',_0x116c06,JSON[_0x8ddb('0x23')](_0x50f960));});}else{logger['info'](_0x8ddb('0x37'));return BPromise[_0x8ddb('0x24')]({'id':_0x5b080c[_0x8ddb('0x38')],'email':_0x1e4625[_0x8ddb('0x39')],'name':_0x8ddb('0x31')})[_0x8ddb('0x28')](function(_0x5bd9f9){var _0x3ff2e5=_0x5bd9f9['statusCode']||0x1f4;logger[_0x8ddb('0x2a')](_0x8ddb('0x36'),_0x8ddb('0x3a'),_0x3ff2e5,JSON[_0x8ddb('0x23')](_0x5bd9f9));});}}function getEndUser(_0x836e36,_0x50faa2,_0x5ed4af,_0x22e75b){logger['info'](_0x8ddb('0x3b'),_0x5ed4af);return request({'method':_0x8ddb('0x2e'),'uri':util[_0x8ddb('0x26')](_0x8ddb('0x2f'),_0x836e36[_0x8ddb('0x20')]),'qs':{'operation':_0x8ddb('0x30'),'username':_0x8ddb('0x31'),'sessionName':_0x22e75b[_0x8ddb('0x22')],'query':util[_0x8ddb('0x26')]('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;',_0x5ed4af,_0x5ed4af,_0x5ed4af,_0x5ed4af,_0x5ed4af)},'json':!![]})[_0x8ddb('0x3c')](function(_0x29c6d6){if(_0x29c6d6['success']&&_0x29c6d6[_0x8ddb('0x25')][_0x8ddb('0xc')]){logger[_0x8ddb('0x19')](_0x8ddb('0x3d'));return BPromise[_0x8ddb('0x24')]({'id':_0x29c6d6[_0x8ddb('0x25')][0x0]['id'],'name':_0x29c6d6[_0x8ddb('0x25')][0x0][_0x8ddb('0x3e')]+'\x20'+_0x29c6d6[_0x8ddb('0x25')][0x0]['lastname'],'phone':_0x5ed4af});}else{logger[_0x8ddb('0x19')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':_0x8ddb('0x1f'),'uri':util['format'](_0x8ddb('0x2f'),_0x836e36['remoteUri']),'form':{'operation':_0x8ddb('0x21'),'sessionName':_0x22e75b['sessionName'],'elementType':_0x8ddb('0x3f'),'element':JSON[_0x8ddb('0x23')]({'lastname':_0x50faa2,'phone':_0x5ed4af,'assigned_user_id':'\x20'})},'json':!![]})[_0x8ddb('0x3c')](function(_0x36754b){logger['info'](_0x8ddb('0x40'));return BPromise[_0x8ddb('0x24')]({'id':_0x36754b['result']['id'],'name':_0x36754b['result'][_0x8ddb('0x41')],'phone':_0x36754b[_0x8ddb('0x25')][_0x8ddb('0x42')]});})[_0x8ddb('0x28')](function(_0x3257d){var _0x7a0a6e=_0x3257d[_0x8ddb('0x29')]||0x1f4;logger[_0x8ddb('0x2a')](_0x8ddb('0x36'),_0x8ddb('0x43'),_0x7a0a6e,JSON[_0x8ddb('0x23')](_0x3257d));});}});}function getConnection(_0x170ca2){var _0x175c35=_0x170ca2[_0x8ddb('0x39')];var _0x2815bc=_0x170ca2[_0x8ddb('0x44')];return request({'method':_0x8ddb('0x2e'),'uri':util[_0x8ddb('0x26')](_0x8ddb('0x2f'),_0x170ca2[_0x8ddb('0x20')]),'qs':{'operation':'getchallenge','username':_0x175c35},'json':!![]})[_0x8ddb('0x3c')](function(_0xb535d3){if(_0xb535d3[_0x8ddb('0x33')]){return request({'method':_0x8ddb('0x1f'),'uri':util[_0x8ddb('0x26')](_0x8ddb('0x2f'),_0x170ca2[_0x8ddb('0x20')]),'form':{'operation':'login','username':_0x8ddb('0x31'),'accessKey':md5(_0xb535d3[_0x8ddb('0x25')]['token']+_0x2815bc)},'json':!![]});}})[_0x8ddb('0x3c')](function(_0x35e78b){if(_0x35e78b[_0x8ddb('0x33')]){return BPromise[_0x8ddb('0x24')](_0x35e78b['result']);}else{throw new Error(util[_0x8ddb('0x26')]('Account\x20%d\x20is\x20not\x20valid',_0x170ca2['id']));}})[_0x8ddb('0x28')](function(_0x223586){var _0x215a74=_0x223586[_0x8ddb('0x29')]||0x1f4;logger[_0x8ddb('0x2a')](_0x8ddb('0x36'),_0x8ddb('0x45'),_0x215a74,JSON[_0x8ddb('0x23')](_0x223586));});}function request(_0x4e5dda){logger[_0x8ddb('0x19')](_0x8ddb('0x46'),JSON[_0x8ddb('0x23')](_0x4e5dda));return rp(_0x4e5dda);}exports['queue']=function(_0x3a497b,_0x523624,_0x15bdad,_0x19b2f8,_0x5642c2,_0x2356ab){var _0x2f67ae,_0x5bb8c6,_0x51c1d7,_0x46efd1;_0x2356ab[_0x8ddb('0x20')]=intUtil['stripTrailingSlash'](_0x2356ab['remoteUri']);if(_0x5642c2&&_0x5642c2[_0x8ddb('0x47')]){logger[_0x8ddb('0x19')]('[QUEUE]',_0x8ddb('0x48'));_0x523624[_0x8ddb('0x49')]=util[_0x8ddb('0x26')](_0x8ddb('0x4a'),_0x2356ab[_0x8ddb('0x4b')],_0x523624[_0x8ddb('0x4c')],md5(_0x523624[_0x8ddb('0x4c')]));}else{_0x523624[_0x8ddb('0x49')]='';}return getConnection(_0x2356ab)['then'](function(_0x526c35){_0x46efd1=_0x526c35;return getUser(_0x2356ab,_0x19b2f8[_0x8ddb('0x4d')],_0x46efd1);})[_0x8ddb('0x3c')](function(_0xba6b0b){_0x2f67ae=_0xba6b0b;logger[_0x8ddb('0x19')](_0x8ddb('0x4e'),_0x2f67ae['id']);return getEndUser(_0x2356ab,_0x523624[_0x8ddb('0x4f')],_0x523624[_0x8ddb('0x50')],_0x46efd1);})[_0x8ddb('0x3c')](function(_0x203215){_0x5bb8c6=_0x203215;logger['info'](_0x8ddb('0x51'),_0x5bb8c6['id']);return createTicket(_0x2356ab,_0x2f67ae,_0x5bb8c6,_0x15bdad,_0x523624,_0x15bdad['Fields'],_0x46efd1);})[_0x8ddb('0x3c')](function(_0xcdb024){_0x51c1d7=_0xcdb024;logger[_0x8ddb('0x19')](_0x8ddb('0x52'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x51c1d7['id']);var _0x5b1210=util[_0x8ddb('0x26')](_0x8ddb('0x53'),_0x2356ab[_0x8ddb('0x20')],_[_0x8ddb('0x54')](_0x51c1d7['id'],'x')[0x1]);logger[_0x8ddb('0x19')]('[QUEUE]',_0x8ddb('0x55'));emit(util['format'](_0x8ddb('0x56'),_0x19b2f8['name']),_0x8ddb('0x57'),{'uri':_0x5b1210});})[_0x8ddb('0x28')](function(_0x29b476){logger[_0x8ddb('0x2a')](_0x8ddb('0x58'),JSON[_0x8ddb('0x23')](_0x29b476));});};exports['outbound']=function(_0x369ca7,_0x3e2de2,_0x1bd4fc,_0x4f0ae4,_0x583a09,_0x1e15c3,_0x73e809){var _0x84f32b,_0x2a59cc,_0x43f67f,_0x1b995b;_0x1e15c3[_0x8ddb('0x20')]=intUtil[_0x8ddb('0x59')](_0x1e15c3['remoteUri']);_0x1e15c3['serverUrl']=intUtil[_0x8ddb('0x59')](_0x1e15c3[_0x8ddb('0x4b')]);if(_0x73e809&&_0x73e809[_0x8ddb('0x5a')]&&_0x73e809[_0x8ddb('0x5a')]!==_0x8ddb('0x5b')){logger[_0x8ddb('0x19')](_0x8ddb('0x5c'),_0x8ddb('0x48'));_0x3e2de2[_0x8ddb('0x49')]=util['format'](_0x8ddb('0x4a'),_0x1e15c3[_0x8ddb('0x4b')],_0x3e2de2[_0x8ddb('0x4c')],md5(_0x3e2de2['uniqueid']));}return getConnection(_0x1e15c3)[_0x8ddb('0x3c')](function(_0x149ce6){_0x1b995b=_0x149ce6;return getUser(_0x1e15c3,_0x4f0ae4['email'],_0x1b995b);})[_0x8ddb('0x3c')](function(_0x2c8ce1){_0x84f32b=_0x2c8ce1;logger[_0x8ddb('0x19')](_0x8ddb('0x4e'),_0x84f32b['id']);return getEndUser(_0x1e15c3,_0x3e2de2[_0x8ddb('0x5d')],_0x3e2de2[_0x8ddb('0x5e')],_0x1b995b);})[_0x8ddb('0x3c')](function(_0x28bda2){_0x2a59cc=_0x28bda2;logger['info'](_0x8ddb('0x51'),_0x2a59cc['id']);return createTicket(_0x1e15c3,_0x84f32b,_0x2a59cc,_0x1bd4fc,_0x3e2de2,_0x1bd4fc['Fields'],_0x1b995b);})['then'](function(_0x17ab4d){_0x43f67f=_0x17ab4d;logger['info'](_0x8ddb('0x52'));logger[_0x8ddb('0x19')](_0x8ddb('0x5f'),_0x43f67f['id']);var _0x2109c4=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x1e15c3[_0x8ddb('0x20')],_[_0x8ddb('0x54')](_0x43f67f['id'],'x')[0x1]);logger['info']('[OUTBOUND]',_0x8ddb('0x55'));emit(util[_0x8ddb('0x26')](_0x8ddb('0x56'),_0x4f0ae4[_0x8ddb('0x17')]),_0x8ddb('0x57'),{'uri':_0x2109c4});})[_0x8ddb('0x28')](function(_0x3e86bf){logger[_0x8ddb('0x2a')](_0x8ddb('0x5c'),JSON[_0x8ddb('0x23')](_0x3e86bf));});};exports[_0x8ddb('0x60')]=function(_0xaebed4,_0x2342af,_0x2a8894,_0x5c88c8,_0x2eaf9b,_0x7dc1a2){var _0x3ceca7,_0x3ee1b4,_0x54eac4,_0x2af470;_0x7dc1a2[_0x8ddb('0x20')]=intUtil[_0x8ddb('0x59')](_0x7dc1a2[_0x8ddb('0x20')]);_0x7dc1a2['serverUrl']=intUtil[_0x8ddb('0x59')](_0x7dc1a2[_0x8ddb('0x4b')]);if(_0x2eaf9b&&_0x2eaf9b['monitor_format']){logger[_0x8ddb('0x19')](_0x8ddb('0x61'),_0x8ddb('0x48'));_0x2342af[_0x8ddb('0x49')]=util[_0x8ddb('0x26')](_0x8ddb('0x4a'),_0x7dc1a2[_0x8ddb('0x4b')],_0x2342af[_0x8ddb('0x4c')],md5(_0x2342af[_0x8ddb('0x4c')]));}else{_0x2342af[_0x8ddb('0x49')]='';}return getConnection(_0x7dc1a2)[_0x8ddb('0x3c')](function(_0xa98da9){_0x2af470=_0xa98da9;return getUser(_0x7dc1a2,'',_0x2af470);})[_0x8ddb('0x3c')](function(_0xed4758){_0x3ceca7=_0xed4758;logger['info'](_0x8ddb('0x4e'),_0x3ceca7['id']);return getEndUser(_0x7dc1a2,_0x2342af[_0x8ddb('0x4f')],_0x2342af[_0x8ddb('0x50')],_0x2af470);})['then'](function(_0x47a1e3){_0x3ee1b4=_0x47a1e3;logger[_0x8ddb('0x19')](_0x8ddb('0x51'),_0x3ee1b4['id']);return createTicket(_0x7dc1a2,_0x3ceca7,_0x3ee1b4,_0x2a8894,_0x2342af,_0x2a8894[_0x8ddb('0x62')],_0x2af470);})[_0x8ddb('0x3c')](function(_0x4e3591){_0x54eac4=_0x4e3591;logger[_0x8ddb('0x19')](_0x8ddb('0x52'));logger[_0x8ddb('0x19')](_0x8ddb('0x5f'),_0x54eac4['id']);})['catch'](function(_0x961cd4){logger[_0x8ddb('0x2a')](_0x8ddb('0x61'),JSON[_0x8ddb('0x23')](_0x961cd4));});}; \ No newline at end of file +var _0x56dc=['Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','username','admin','catch','getUser','Searching\x20end\x20user\x20with\x20phone','format','query','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','success','Enduser\x20found!','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','getEndUser','accessKey','getchallenge','login','token','getConnection','[HTTP]','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','[QUEUE]','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','[ABANDONED]','calleridname','lodash','bluebird','md5','util','ioredis','./util','../../../../config/logger','vTiger','redis','defaults','localhost','emit','length','type','string','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','info','merge','Normal','Open','Descriptions','POST','remoteUri','create','sessionName','HelpDesk','stringify','then','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x56dc,0xfd));var _0xc56d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56dc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc56d('0x0'));var rp=require('request-promise');var BPromise=require(_0xc56d('0x1'));var md5=require(_0xc56d('0x2'));var util=require(_0xc56d('0x3'));var Redis=require(_0xc56d('0x4'));var intUtil=require(_0xc56d('0x5'));var config=require('../../../../config/environment');var logger=require(_0xc56d('0x6'))(_0xc56d('0x7'));config[_0xc56d('0x8')]=_[_0xc56d('0x9')](config[_0xc56d('0x8')],{'host':_0xc56d('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc56d('0x8')]));function emit(_0x24b556,_0x3ac7cd,_0x51ca01){io['to'](_0x24b556)[_0xc56d('0xb')](_0x3ac7cd,_0x51ca01);}function getCustomFields(_0x1043f9,_0x3ff2cb){var _0x1df34e={};if(_0x1043f9[_0xc56d('0xc')]>0x0){_['forEach'](_0x1043f9,function(_0x3bfd34){if(_0x3bfd34[_0xc56d('0xd')]===_0xc56d('0xe')&&_0x3bfd34['idField']){_0x1df34e[_0x3bfd34[_0xc56d('0xf')]]=_0x3bfd34[_0xc56d('0x10')][_0xc56d('0x11')]();}else if(_0x3bfd34[_0xc56d('0xd')]==='variable'&&_0x3bfd34[_0xc56d('0x12')]&&_0x3bfd34[_0xc56d('0xf')]&&_0x3ff2cb[_0x3bfd34[_0xc56d('0x12')]]){_0x1df34e[_0x3bfd34['idField']]=_0x3ff2cb[_0x3bfd34[_0xc56d('0x12')]][_0xc56d('0x11')]();}else if(_0x3bfd34[_0xc56d('0xd')]===_0xc56d('0x13')&&_0x3bfd34['Variable']&&_0x3bfd34[_0xc56d('0x14')][_0xc56d('0x15')]&&_0x3bfd34['idField']&&_0x3ff2cb[_0x3bfd34['Variable'][_0xc56d('0x15')][_0xc56d('0x16')]()]){_0x1df34e[_0x3bfd34[_0xc56d('0xf')]]=_0x3ff2cb[_0x3bfd34[_0xc56d('0x14')]['name'][_0xc56d('0x16')]()]['toString']();}});}return _0x1df34e;}function createTicket(_0x25df28,_0x1058a1,_0x523cfd,_0x23cced,_0x22f20a,_0x256e8f,_0x2bdb45){logger[_0xc56d('0x17')]('Creating\x20new\x20ticket...');var _0x2f6736=_[_0xc56d('0x18')]({'parent_id':'','assigned_user_id':_0x1058a1['id'],'ticketpriorities':_0xc56d('0x19'),'ticketstatus':_0xc56d('0x1a'),'ticket_title':intUtil['getString'](_0x23cced['Subjects'],_0x22f20a,'\x20'),'description':intUtil['getString'](_0x23cced[_0xc56d('0x1b')],_0x22f20a,'\x0a'),'contact_id':_0x523cfd['id']},getCustomFields(_0x256e8f,_0x22f20a));var _0x1c9a1c={'method':_0xc56d('0x1c'),'uri':util['format']('%s/webservice.php',_0x25df28[_0xc56d('0x1d')]),'form':{'operation':_0xc56d('0x1e'),'username':'admin','sessionName':_0x2bdb45[_0xc56d('0x1f')],'elementType':_0xc56d('0x20'),'element':JSON[_0xc56d('0x21')](_0x2f6736)},'json':!![]};return request(_0x1c9a1c)[_0xc56d('0x22')](function(_0x527929){if(_0x527929['success']){return BPromise[_0xc56d('0x23')]({'id':_0x527929[_0xc56d('0x24')]['id']});}else{throw new Error(util['format'](_0xc56d('0x25'),JSON[_0xc56d('0x21')](_0x527929[_0xc56d('0x26')])));}})['catch'](function(_0x29e8e2){var _0x2e48ae=_0x29e8e2[_0xc56d('0x27')]||0x1f4;logger[_0xc56d('0x26')](_0xc56d('0x28'),_0xc56d('0x29'),_0x2e48ae,JSON['stringify'](_0x29e8e2));});}function getUser(_0x5a50fb,_0x51e7c7,_0xb1c8ab){if(intUtil[_0xc56d('0x2a')](_0x51e7c7)){logger[_0xc56d('0x17')](_0xc56d('0x2b'),_0x51e7c7);return request({'method':_0xc56d('0x2c'),'uri':util['format'](_0xc56d('0x2d'),_0x5a50fb['remoteUri']),'qs':{'operation':'query','username':'admin','sessionName':_0xb1c8ab[_0xc56d('0x1f')],'query':util['format'](_0xc56d('0x2e'),_0x51e7c7)},'json':!![]})[_0xc56d('0x22')](function(_0x32d057){if(_0x32d057['success']&&_0x32d057[_0xc56d('0x24')][_0xc56d('0xc')]){logger[_0xc56d('0x17')](_0xc56d('0x2f'));return BPromise['resolve']({'id':_0x32d057['result'][0x0]['id'],'email':_0x32d057['result'][0x0][_0xc56d('0x30')],'name':_0x32d057[_0xc56d('0x24')][0x0][_0xc56d('0x31')]+'\x20'+_0x32d057[_0xc56d('0x24')][_0xc56d('0x32')]});}else{logger['info'](_0xc56d('0x33'));return BPromise[_0xc56d('0x23')]({'id':_0xb1c8ab[_0xc56d('0x34')],'email':_0x5a50fb[_0xc56d('0x35')],'name':_0xc56d('0x36')});}})[_0xc56d('0x37')](function(_0x2f63dc){var _0x4a855f=_0x2f63dc[_0xc56d('0x27')]||0x1f4;logger['error'](_0xc56d('0x28'),_0xc56d('0x38'),_0x4a855f,JSON['stringify'](_0x2f63dc));});}else{logger[_0xc56d('0x17')](_0xc56d('0x33'));return BPromise[_0xc56d('0x23')]({'id':_0xb1c8ab[_0xc56d('0x34')],'email':_0x5a50fb[_0xc56d('0x35')],'name':_0xc56d('0x36')})[_0xc56d('0x37')](function(_0x37b4a8){var _0x475408=_0x37b4a8[_0xc56d('0x27')]||0x1f4;logger[_0xc56d('0x26')](_0xc56d('0x28'),_0xc56d('0x38'),_0x475408,JSON[_0xc56d('0x21')](_0x37b4a8));});}}function getEndUser(_0x25c96b,_0x360cd8,_0x45ff19,_0x3cdbf1){logger[_0xc56d('0x17')](_0xc56d('0x39'),_0x45ff19);return request({'method':_0xc56d('0x2c'),'uri':util[_0xc56d('0x3a')](_0xc56d('0x2d'),_0x25c96b[_0xc56d('0x1d')]),'qs':{'operation':_0xc56d('0x3b'),'username':_0xc56d('0x36'),'sessionName':_0x3cdbf1[_0xc56d('0x1f')],'query':util[_0xc56d('0x3a')](_0xc56d('0x3c'),_0x45ff19,_0x45ff19,_0x45ff19,_0x45ff19,_0x45ff19)},'json':!![]})['then'](function(_0x402775){if(_0x402775[_0xc56d('0x3d')]&&_0x402775[_0xc56d('0x24')]['length']){logger['info'](_0xc56d('0x3e'));return BPromise['resolve']({'id':_0x402775['result'][0x0]['id'],'name':_0x402775['result'][0x0]['firstname']+'\x20'+_0x402775['result'][0x0][_0xc56d('0x3f')],'phone':_0x45ff19});}else{logger[_0xc56d('0x17')](_0xc56d('0x40'));return request({'method':_0xc56d('0x1c'),'uri':util[_0xc56d('0x3a')](_0xc56d('0x2d'),_0x25c96b[_0xc56d('0x1d')]),'form':{'operation':_0xc56d('0x1e'),'sessionName':_0x3cdbf1[_0xc56d('0x1f')],'elementType':_0xc56d('0x41'),'element':JSON['stringify']({'lastname':_0x360cd8,'phone':_0x45ff19,'assigned_user_id':'\x20'})},'json':!![]})[_0xc56d('0x22')](function(_0x25da4b){logger[_0xc56d('0x17')]('Enduser\x20created.');return BPromise[_0xc56d('0x23')]({'id':_0x25da4b[_0xc56d('0x24')]['id'],'name':_0x25da4b[_0xc56d('0x24')][_0xc56d('0x3f')],'phone':_0x25da4b[_0xc56d('0x24')][_0xc56d('0x42')]});})[_0xc56d('0x37')](function(_0x258bc4){var _0x556dd3=_0x258bc4[_0xc56d('0x27')]||0x1f4;logger[_0xc56d('0x26')](_0xc56d('0x28'),_0xc56d('0x43'),_0x556dd3,JSON[_0xc56d('0x21')](_0x258bc4));});}});}function getConnection(_0x462359){var _0x198112=_0x462359['username'];var _0x203abf=_0x462359[_0xc56d('0x44')];return request({'method':_0xc56d('0x2c'),'uri':util['format'](_0xc56d('0x2d'),_0x462359[_0xc56d('0x1d')]),'qs':{'operation':_0xc56d('0x45'),'username':_0x198112},'json':!![]})[_0xc56d('0x22')](function(_0x2a744f){if(_0x2a744f[_0xc56d('0x3d')]){return request({'method':_0xc56d('0x1c'),'uri':util['format'](_0xc56d('0x2d'),_0x462359['remoteUri']),'form':{'operation':_0xc56d('0x46'),'username':_0xc56d('0x36'),'accessKey':md5(_0x2a744f['result'][_0xc56d('0x47')]+_0x203abf)},'json':!![]});}})[_0xc56d('0x22')](function(_0x24adf3){if(_0x24adf3['success']){return BPromise[_0xc56d('0x23')](_0x24adf3[_0xc56d('0x24')]);}else{throw new Error(util[_0xc56d('0x3a')]('Account\x20%d\x20is\x20not\x20valid',_0x462359['id']));}})[_0xc56d('0x37')](function(_0x1f0c54){var _0x606d8f=_0x1f0c54[_0xc56d('0x27')]||0x1f4;logger[_0xc56d('0x26')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xc56d('0x48'),_0x606d8f,JSON[_0xc56d('0x21')](_0x1f0c54));});}function request(_0x23e3cf){logger[_0xc56d('0x17')](_0xc56d('0x49'),JSON[_0xc56d('0x21')](_0x23e3cf));return rp(_0x23e3cf);}exports['queue']=function(_0x526baf,_0x1ab838,_0x20d7b6,_0x2524a1,_0x8b4879,_0x584e59){var _0x9b34ac,_0xa54d26,_0x3bc8eb,_0x256ebb;_0x584e59[_0xc56d('0x1d')]=intUtil['stripTrailingSlash'](_0x584e59[_0xc56d('0x1d')]);if(_0x8b4879&&_0x8b4879[_0xc56d('0x4a')]){logger[_0xc56d('0x17')]('[QUEUE]',_0xc56d('0x4b'));_0x1ab838[_0xc56d('0x4c')]=util['format'](_0xc56d('0x4d'),_0x584e59[_0xc56d('0x4e')],_0x1ab838[_0xc56d('0x4f')],md5(_0x1ab838['uniqueid']));}else{_0x1ab838[_0xc56d('0x4c')]='';}return getConnection(_0x584e59)[_0xc56d('0x22')](function(_0x4117f5){_0x256ebb=_0x4117f5;return getUser(_0x584e59,_0x2524a1[_0xc56d('0x50')],_0x256ebb);})[_0xc56d('0x22')](function(_0x46a469){_0x9b34ac=_0x46a469;logger['info']('The\x20User\x20ID\x20is:',_0x9b34ac['id']);return getEndUser(_0x584e59,_0x1ab838['calleridname'],_0x1ab838[_0xc56d('0x51')],_0x256ebb);})['then'](function(_0x3dd5a5){_0xa54d26=_0x3dd5a5;logger[_0xc56d('0x17')](_0xc56d('0x52'),_0xa54d26['id']);return createTicket(_0x584e59,_0x9b34ac,_0xa54d26,_0x20d7b6,_0x1ab838,_0x20d7b6[_0xc56d('0x53')],_0x256ebb);})[_0xc56d('0x22')](function(_0x2944ee){_0x3bc8eb=_0x2944ee;logger[_0xc56d('0x17')]('Ticket\x20created!');logger['info'](_0xc56d('0x54'),_0x3bc8eb['id']);var _0x180fc9=util['format'](_0xc56d('0x55'),_0x584e59[_0xc56d('0x1d')],_[_0xc56d('0x56')](_0x3bc8eb['id'],'x')[0x1]);logger[_0xc56d('0x17')](_0xc56d('0x57'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc56d('0x3a')]('user:%s',_0x2524a1[_0xc56d('0x15')]),_0xc56d('0x58'),{'uri':_0x180fc9});})[_0xc56d('0x37')](function(_0x2ef74d){logger[_0xc56d('0x26')](_0xc56d('0x57'),JSON[_0xc56d('0x21')](_0x2ef74d));});};exports[_0xc56d('0x59')]=function(_0x5615fc,_0x43e78a,_0xc20908,_0x4b3d74,_0x31f078,_0x42319b,_0x19938f){var _0x195d5a,_0x392896,_0x673d5c,_0x1ce40a;_0x42319b[_0xc56d('0x1d')]=intUtil[_0xc56d('0x5a')](_0x42319b[_0xc56d('0x1d')]);_0x42319b[_0xc56d('0x4e')]=intUtil[_0xc56d('0x5a')](_0x42319b['serverUrl']);if(_0x19938f&&_0x19938f[_0xc56d('0x5b')]&&_0x19938f[_0xc56d('0x5b')]!==_0xc56d('0x5c')){logger['info']('[OUTBOUND]',_0xc56d('0x4b'));_0x43e78a[_0xc56d('0x4c')]=util[_0xc56d('0x3a')](_0xc56d('0x4d'),_0x42319b[_0xc56d('0x4e')],_0x43e78a[_0xc56d('0x4f')],md5(_0x43e78a[_0xc56d('0x4f')]));}return getConnection(_0x42319b)[_0xc56d('0x22')](function(_0x46e566){_0x1ce40a=_0x46e566;return getUser(_0x42319b,_0x4b3d74['email'],_0x1ce40a);})['then'](function(_0x2ac4fe){_0x195d5a=_0x2ac4fe;logger['info'](_0xc56d('0x5d'),_0x195d5a['id']);return getEndUser(_0x42319b,_0x43e78a[_0xc56d('0x5e')],_0x43e78a['destcalleridnum'],_0x1ce40a);})[_0xc56d('0x22')](function(_0x3a468f){_0x392896=_0x3a468f;logger[_0xc56d('0x17')](_0xc56d('0x52'),_0x392896['id']);return createTicket(_0x42319b,_0x195d5a,_0x392896,_0xc20908,_0x43e78a,_0xc20908[_0xc56d('0x53')],_0x1ce40a);})[_0xc56d('0x22')](function(_0x48d489){_0x673d5c=_0x48d489;logger[_0xc56d('0x17')]('Ticket\x20created!');logger[_0xc56d('0x17')]('The\x20Ticket\x20ID\x20is:',_0x673d5c['id']);var _0x1f64d9=util[_0xc56d('0x3a')](_0xc56d('0x55'),_0x42319b['remoteUri'],_['split'](_0x673d5c['id'],'x')[0x1]);logger[_0xc56d('0x17')](_0xc56d('0x5f'),_0xc56d('0x60'));emit(util[_0xc56d('0x3a')](_0xc56d('0x61'),_0x4b3d74[_0xc56d('0x15')]),_0xc56d('0x58'),{'uri':_0x1f64d9});})[_0xc56d('0x37')](function(_0x855aab){logger[_0xc56d('0x26')](_0xc56d('0x5f'),JSON[_0xc56d('0x21')](_0x855aab));});};exports['abandoned']=function(_0x920659,_0x505800,_0x540ef9,_0x33c2c7,_0x5806d1,_0x17ebd9){var _0x3cdafa,_0x44a9df,_0x15ffc2,_0x3fc729;_0x17ebd9[_0xc56d('0x1d')]=intUtil[_0xc56d('0x5a')](_0x17ebd9[_0xc56d('0x1d')]);_0x17ebd9['serverUrl']=intUtil[_0xc56d('0x5a')](_0x17ebd9['serverUrl']);if(_0x5806d1&&_0x5806d1[_0xc56d('0x4a')]){logger[_0xc56d('0x17')](_0xc56d('0x62'),_0xc56d('0x4b'));_0x505800['recordingURL']=util[_0xc56d('0x3a')](_0xc56d('0x4d'),_0x17ebd9['serverUrl'],_0x505800['uniqueid'],md5(_0x505800['uniqueid']));}else{_0x505800[_0xc56d('0x4c')]='';}return getConnection(_0x17ebd9)[_0xc56d('0x22')](function(_0x2dc125){_0x3fc729=_0x2dc125;return getUser(_0x17ebd9,'',_0x3fc729);})[_0xc56d('0x22')](function(_0x18ebf){_0x3cdafa=_0x18ebf;logger[_0xc56d('0x17')]('The\x20User\x20ID\x20is:',_0x3cdafa['id']);return getEndUser(_0x17ebd9,_0x505800[_0xc56d('0x63')],_0x505800[_0xc56d('0x51')],_0x3fc729);})[_0xc56d('0x22')](function(_0x34f456){_0x44a9df=_0x34f456;logger[_0xc56d('0x17')](_0xc56d('0x52'),_0x44a9df['id']);return createTicket(_0x17ebd9,_0x3cdafa,_0x44a9df,_0x540ef9,_0x505800,_0x540ef9[_0xc56d('0x53')],_0x3fc729);})[_0xc56d('0x22')](function(_0x59c445){_0x15ffc2=_0x59c445;logger[_0xc56d('0x17')]('Ticket\x20created!');logger[_0xc56d('0x17')](_0xc56d('0x54'),_0x15ffc2['id']);})[_0xc56d('0x37')](function(_0x2714dc){logger[_0xc56d('0x26')](_0xc56d('0x62'),JSON[_0xc56d('0x21')](_0x2714dc));});}; \ 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 429d03c..2c09285 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 _0x5e88=['custom_fields','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridname','calleridnum','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','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','email','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','emit','application/json','Creating\x20new\x20ticket...','remoteUri','Tags','name','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','ticket','validateEmail','format','type:user\x20role:agent\x20email:%s','count','find','results','agent','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','base64','debug','stringify','GET','map','forEach','type','customField','nameField','toLowerCase','content','toString','idField','push','variable','variableName'];(function(_0x298756,_0x1d71a8){var _0x391c71=function(_0x2adc42){while(--_0x2adc42){_0x298756['push'](_0x298756['shift']());}};_0x391c71(++_0x1d71a8);}(_0x5e88,0x1de));var _0x85e8=function(_0x6a5c7f,_0x227cbb){_0x6a5c7f=_0x6a5c7f-0x0;var _0x46affc=_0x5e88[_0x6a5c7f];return _0x46affc;};'use strict';var _=require(_0x85e8('0x0'));var rp=require(_0x85e8('0x1'));var md5=require('md5');var util=require(_0x85e8('0x2'));var Redis=require(_0x85e8('0x3'));var intUtil=require(_0x85e8('0x4'));var config=require(_0x85e8('0x5'));var logger=require(_0x85e8('0x6'))(_0x85e8('0x7'));config[_0x85e8('0x8')]=_[_0x85e8('0x9')](config['redis'],{'host':_0x85e8('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x2df0ec,_0x168a82,_0x16cce0){io['to'](_0x2df0ec)[_0x85e8('0xb')](_0x168a82,_0x16cce0);}var headers={'Content-Type':_0x85e8('0xc'),'Accept':_0x85e8('0xc')};function getTicket(_0x699ac,_0x492504,_0x557c63,_0x4682e3,_0x3bd37a){logger['info'](_0x85e8('0xd'));return request({'uri':util['format']('%s/tickets.json',_0x699ac[_0x85e8('0xe')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x557c63['id'],'submitter_id':_0x492504?_0x492504['id']:undefined,'assignee_id':_0x492504?_0x492504['id']:undefined,'tags':getTags(_0x4682e3[_0x85e8('0xf')],_0x85e8('0x10')),'subject':intUtil[_0x85e8('0x11')](_0x4682e3[_0x85e8('0x12')],_0x3bd37a,'\x20'),'description':intUtil[_0x85e8('0x11')](_0x4682e3[_0x85e8('0x13')],_0x3bd37a,'\x0a'),'comment':{'public':![],'body':intUtil[_0x85e8('0x11')](_0x4682e3[_0x85e8('0x13')],_0x3bd37a,'\x0a')}},getCustomFields(_0x4682e3[_0x85e8('0x14')],_0x3bd37a))}})[_0x85e8('0x15')](function(_0x43b6bf){logger[_0x85e8('0x16')](_0x85e8('0x17'));return _0x43b6bf[_0x85e8('0x18')];});}function getUser(_0x30ccbf,_0x4a946b){if(intUtil[_0x85e8('0x19')](_0x4a946b)){logger[_0x85e8('0x16')]('Getting\x20agent\x20with\x20email',_0x4a946b);return request({'uri':util[_0x85e8('0x1a')]('%s/search.json',_0x30ccbf[_0x85e8('0xe')]),'qs':{'query':util[_0x85e8('0x1a')](_0x85e8('0x1b'),_0x4a946b)}})[_0x85e8('0x15')](function(_0x19f253){if(_0x19f253[_0x85e8('0x1c')]){logger[_0x85e8('0x16')]('Agent\x20found!');return _[_0x85e8('0x1d')](_0x19f253[_0x85e8('0x1e')],{'email':_0x4a946b,'role':_0x85e8('0x1f')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x30ccbf['remoteUri'])})[_0x85e8('0x15')](function(_0x287818){logger[_0x85e8('0x16')](_0x85e8('0x20'));return _0x287818[_0x85e8('0x21')];});}});}else{logger[_0x85e8('0x16')](_0x85e8('0x22'));return request({'uri':util['format'](_0x85e8('0x23'),_0x30ccbf[_0x85e8('0xe')])})[_0x85e8('0x15')](function(_0x124860){logger[_0x85e8('0x16')](_0x85e8('0x20'));return _0x124860[_0x85e8('0x21')];});}}function getEndUser(_0x583613,_0x55e818,_0x2b7522){logger[_0x85e8('0x16')](_0x85e8('0x24'),_0x2b7522);return request({'uri':util[_0x85e8('0x1a')](_0x85e8('0x25'),_0x583613[_0x85e8('0xe')]),'qs':{'query':util[_0x85e8('0x1a')](_0x85e8('0x26'),_0x2b7522)}})[_0x85e8('0x15')](function(_0x1bfac5){var _0x42d598;if(_0x1bfac5[_0x85e8('0x1e')][_0x85e8('0x27')]){_0x1bfac5[_0x85e8('0x1e')]=_[_0x85e8('0x28')](_0x1bfac5[_0x85e8('0x1e')],{'suspended':![],'role':'end-user'});if(_0x1bfac5[_0x85e8('0x1e')][_0x85e8('0x27')]){_0x42d598=_[_0x85e8('0x29')](_0x1bfac5[_0x85e8('0x1e')]);}}if(_0x42d598){logger[_0x85e8('0x16')](_0x85e8('0x2a'));return _0x42d598;}else{logger[_0x85e8('0x16')](_0x85e8('0x2b'));return request({'uri':util[_0x85e8('0x1a')](_0x85e8('0x2c'),_0x583613[_0x85e8('0xe')]),'method':_0x85e8('0x2d'),'body':{'user':{'role':_0x85e8('0x2e'),'name':util['format'](_0x85e8('0x2f'),_0x55e818||_0x2b7522),'phone':_0x2b7522}}})[_0x85e8('0x15')](function(_0x54b091){logger[_0x85e8('0x16')](_0x85e8('0x30'));return _0x54b091[_0x85e8('0x21')];});}});}function getAuth(_0x3c1a26){var _0x1b882a;if(_0x3c1a26[_0x85e8('0x31')]===_0x85e8('0x32')){_0x1b882a=util['format'](_0x85e8('0x33'),_0x3c1a26[_0x85e8('0x34')],_0x3c1a26[_0x85e8('0x32')]);}else if(_0x3c1a26[_0x85e8('0x31')]===_0x85e8('0x35')){_0x1b882a=util[_0x85e8('0x1a')](_0x85e8('0x36'),_0x3c1a26['username'],_0x3c1a26[_0x85e8('0x35')]);}return util[_0x85e8('0x1a')](_0x85e8('0x37'),new Buffer(_0x1b882a)['toString'](_0x85e8('0x38')));}function request(_0x3bdb88){logger[_0x85e8('0x39')]('[HTTP]',JSON[_0x85e8('0x3a')](_0x3bdb88));return rp(_['defaults'](_0x3bdb88,{'method':_0x85e8('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0x2835a4,_0x341cd3){var _0x3a81c1=[];if(_0x2835a4&&_0x2835a4[_0x85e8('0x27')]>0x0){_0x3a81c1=_[_0x85e8('0x3c')](_0x2835a4,_0x341cd3);}return _0x3a81c1;}function getCustomFields(_0xf98f71,_0x5aa223){var _0x502406=[];var _0x2a1dc8={'custom_fields':[]};if(_0xf98f71[_0x85e8('0x27')]>0x0){_[_0x85e8('0x3d')](_0xf98f71,function(_0x2e7f99){if(_0x2e7f99[_0x85e8('0x3e')]==='string'&&_0x2e7f99['nameField']&&!_0x2e7f99[_0x85e8('0x3f')]){_0x2a1dc8[_0x2e7f99[_0x85e8('0x40')][_0x85e8('0x41')]()]=_0x2e7f99[_0x85e8('0x42')][_0x85e8('0x43')]();}else if(_0x2e7f99['type']==='string'&&_0x2e7f99[_0x85e8('0x44')]&&_0x2e7f99[_0x85e8('0x3f')]){_0x2a1dc8['custom_fields'][_0x85e8('0x45')]({'id':_0x2e7f99[_0x85e8('0x44')],'value':_0x2e7f99[_0x85e8('0x42')][_0x85e8('0x43')]()});}else if(_0x2e7f99[_0x85e8('0x3e')]===_0x85e8('0x46')&&_0x2e7f99[_0x85e8('0x47')]&&_0x2e7f99[_0x85e8('0x44')]&&_0x2e7f99[_0x85e8('0x3f')]){_0x5aa223[_0x2e7f99[_0x85e8('0x47')]]&&_0x2a1dc8[_0x85e8('0x48')][_0x85e8('0x45')]({'id':_0x2e7f99[_0x85e8('0x44')],'value':_0x5aa223[_0x2e7f99[_0x85e8('0x47')]][_0x85e8('0x43')]()});}else if(_0x2e7f99[_0x85e8('0x3e')]===_0x85e8('0x49')&&_0x2e7f99[_0x85e8('0x4a')]&&_0x2e7f99[_0x85e8('0x4a')][_0x85e8('0x10')]&&_0x2e7f99['idField']&&_0x2e7f99[_0x85e8('0x3f')]){_0x5aa223[_0x2e7f99[_0x85e8('0x4a')]['name'][_0x85e8('0x41')]()]&&_0x2a1dc8['custom_fields'][_0x85e8('0x45')]({'id':_0x2e7f99[_0x85e8('0x44')],'value':_0x5aa223[_0x2e7f99[_0x85e8('0x4a')][_0x85e8('0x10')][_0x85e8('0x41')]()]['toString']()});}});}return _0x2a1dc8;}exports[_0x85e8('0x4b')]=function(_0x167e56,_0x1ba49c,_0x1ec823,_0x4abd12,_0x2db26f,_0x4826e9){var _0xdc36a6,_0x57d37b;_0x4826e9['remoteUri']=intUtil[_0x85e8('0x4c')](_0x4826e9[_0x85e8('0xe')]);_0x4826e9[_0x85e8('0x4d')]=intUtil[_0x85e8('0x4c')](_0x4826e9[_0x85e8('0x4d')]);if(_0x2db26f&&_0x2db26f['monitor_format']){logger[_0x85e8('0x16')](_0x85e8('0x4e'),_0x85e8('0x4f'));_0x1ba49c[_0x85e8('0x50')]=util[_0x85e8('0x1a')](_0x85e8('0x51'),_0x4826e9['serverUrl'],_0x1ba49c[_0x85e8('0x52')],md5(_0x1ba49c['uniqueid']));}else{_0x1ba49c['recordingURL']='';}headers[_0x85e8('0x53')]=getAuth(_0x4826e9);return getUser(_0x4826e9,_0x4abd12['email'])['then'](function(_0x93548a){_0xdc36a6=_0x93548a;logger[_0x85e8('0x16')]('The\x20User\x20ID\x20is:',_0xdc36a6['id']);return getEndUser(_0x4826e9,_0x1ba49c[_0x85e8('0x54')],_0x1ba49c[_0x85e8('0x55')]);})[_0x85e8('0x15')](function(_0xfbcdd1){_0x57d37b=_0xfbcdd1;logger[_0x85e8('0x16')](_0x85e8('0x56'),_0x57d37b['id']);return getTicket(_0x4826e9,_0xdc36a6,_0x57d37b,_0x1ec823,_0x1ba49c);})[_0x85e8('0x15')](function(_0x184d67){if(_0x184d67){logger[_0x85e8('0x16')](_0x85e8('0x57'),_0x184d67['id']);switch(_0x4826e9[_0x85e8('0x3e')]){case'integrationTab':logger[_0x85e8('0x16')](_0x85e8('0x4e'),_0x85e8('0x58'));return request({'uri':util[_0x85e8('0x1a')](_0x85e8('0x59'),_0x4826e9[_0x85e8('0xe')],_0xdc36a6['id'],_0x184d67['id']),'method':_0x85e8('0x2d')});case _0x85e8('0x5a'):logger['info'](_0x85e8('0x4e'),_0x85e8('0x5b'));emit(util[_0x85e8('0x1a')](_0x85e8('0x5c'),_0x4abd12[_0x85e8('0x10')]),_0x85e8('0x5d'),{'uri':util[_0x85e8('0x1a')](_0x85e8('0x5e'),_0x4826e9[_0x85e8('0xe')],_0x184d67['id'])});break;default:logger[_0x85e8('0x5f')](_0x85e8('0x4e'),_0x85e8('0x60'));}}})[_0x85e8('0x61')](function(_0x1282a1){logger[_0x85e8('0x5f')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x85e8('0x62')](_0x1282a1,{'showHidden':!![],'depth':null}));});};exports[_0x85e8('0x63')]=function(_0x5536d6,_0xabed06,_0x58e8b4,_0x5d6fb3,_0x2c8327,_0x28ca7f,_0x1fd364){var _0x445d60,_0x1f3cc8;_0x28ca7f[_0x85e8('0xe')]=intUtil[_0x85e8('0x4c')](_0x28ca7f[_0x85e8('0xe')]);_0x28ca7f[_0x85e8('0x4d')]=intUtil['stripTrailingSlash'](_0x28ca7f[_0x85e8('0x4d')]);if(_0x1fd364&&_0x1fd364[_0x85e8('0x64')]&&_0x1fd364[_0x85e8('0x64')]!==_0x85e8('0x65')){logger[_0x85e8('0x16')](_0x85e8('0x66'),_0x85e8('0x4f'));_0xabed06[_0x85e8('0x50')]=util['format'](_0x85e8('0x51'),_0x28ca7f['serverUrl'],_0xabed06['uniqueid'],md5(_0xabed06['uniqueid']));}headers['Authorization']=getAuth(_0x28ca7f);return getUser(_0x28ca7f,_0x5d6fb3[_0x85e8('0x67')])['then'](function(_0x366ed4){_0x445d60=_0x366ed4;logger[_0x85e8('0x16')](_0x85e8('0x68'),_0x445d60['id']);return getEndUser(_0x28ca7f,_0xabed06[_0x85e8('0x69')],_0xabed06[_0x85e8('0x6a')]);})[_0x85e8('0x15')](function(_0x25cd8e){_0x1f3cc8=_0x25cd8e;logger[_0x85e8('0x16')]('The\x20Enduser\x20ID\x20is:',_0x1f3cc8['id']);return getTicket(_0x28ca7f,_0x445d60,_0x1f3cc8,_0x58e8b4,_0xabed06);})[_0x85e8('0x15')](function(_0x11c916){if(_0x11c916){logger[_0x85e8('0x16')](_0x85e8('0x57'),_0x11c916['id']);switch(_0x28ca7f[_0x85e8('0x3e')]){case'integrationTab':logger['info'](_0x85e8('0x66'),_0x85e8('0x58'));return request({'uri':util['format'](_0x85e8('0x59'),_0x28ca7f[_0x85e8('0xe')],_0x445d60['id'],_0x11c916['id']),'method':'POST'});case _0x85e8('0x5a'):logger['info'](_0x85e8('0x66'),_0x85e8('0x5b'));emit(util[_0x85e8('0x1a')](_0x85e8('0x5c'),_0x5d6fb3[_0x85e8('0x10')]),_0x85e8('0x5d'),{'uri':util[_0x85e8('0x1a')](_0x85e8('0x5e'),_0x28ca7f[_0x85e8('0xe')],_0x11c916['id'])});break;default:logger[_0x85e8('0x5f')](_0x85e8('0x66'),_0x85e8('0x60'));}}})[_0x85e8('0x61')](function(_0x4842b9){logger[_0x85e8('0x5f')](_0x85e8('0x6b'),util['inspect'](_0x4842b9,{'showHidden':!![],'depth':null}));});};exports[_0x85e8('0x6c')]=function(_0x35e135,_0x4b89ed,_0x3043f6,_0x2a25cd,_0x487400,_0x5bb45a){var _0x2c33eb,_0x14c445;_0x5bb45a[_0x85e8('0xe')]=intUtil['stripTrailingSlash'](_0x5bb45a[_0x85e8('0xe')]);_0x5bb45a['serverUrl']=intUtil[_0x85e8('0x4c')](_0x5bb45a[_0x85e8('0x4d')]);if(_0x487400&&_0x487400['monitor_format']){logger[_0x85e8('0x16')](_0x85e8('0x6d'),_0x85e8('0x4f'));_0x4b89ed[_0x85e8('0x50')]=util[_0x85e8('0x1a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5bb45a[_0x85e8('0x4d')],_0x4b89ed['uniqueid'],md5(_0x4b89ed[_0x85e8('0x52')]));}else{_0x4b89ed[_0x85e8('0x50')]='';}headers[_0x85e8('0x53')]=getAuth(_0x5bb45a);return getUser(_0x5bb45a)[_0x85e8('0x15')](function(_0x1620c9){_0x2c33eb=_0x1620c9;logger['info'](_0x85e8('0x68'),_0x2c33eb['id']);return getEndUser(_0x5bb45a,_0x4b89ed['calleridname'],_0x4b89ed[_0x85e8('0x55')]);})[_0x85e8('0x15')](function(_0x20333d){_0x14c445=_0x20333d;logger[_0x85e8('0x16')](_0x85e8('0x56'),_0x14c445['id']);return getTicket(_0x5bb45a,_0x2c33eb,_0x14c445,_0x3043f6,_0x4b89ed);})[_0x85e8('0x15')](function(_0x5d1827){if(_0x5d1827){logger[_0x85e8('0x16')](_0x85e8('0x57'),_0x5d1827['id']);}})[_0x85e8('0x61')](function(_0xab4086){logger[_0x85e8('0x5f')]('[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0xab4086,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6c6b=['debug','[HTTP]','forEach','type','string','nameField','customField','toLowerCase','push','idField','content','variable','variableName','custom_fields','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','trigger:browser:url','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','Authorization','destcalleridname','destcalleridnum','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','./util','../../../../config/environment','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','format','%s/search.json','type:user\x20role:agent\x20email:%s','count','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','user','password','%s:%s','username','authType','token','%s/token:%s','Basic\x20%s','toString','base64'];(function(_0x47b9d3,_0x559df9){var _0x40b2c6=function(_0x3039e1){while(--_0x3039e1){_0x47b9d3['push'](_0x47b9d3['shift']());}};_0x40b2c6(++_0x559df9);}(_0x6c6b,0x16d));var _0xb6c6=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x6c6b[_0x40a825];return _0x273a54;};'use strict';var _=require(_0xb6c6('0x0'));var rp=require(_0xb6c6('0x1'));var md5=require('md5');var util=require(_0xb6c6('0x2'));var Redis=require('ioredis');var intUtil=require(_0xb6c6('0x3'));var config=require(_0xb6c6('0x4'));var logger=require('../../../../config/logger')(_0xb6c6('0x5'));config[_0xb6c6('0x6')]=_['defaults'](config['redis'],{'host':_0xb6c6('0x7'),'port':0x18eb});var io=require(_0xb6c6('0x8'))(new Redis(config[_0xb6c6('0x6')]));function emit(_0x2288e7,_0x352bf4,_0x1b8194){io['to'](_0x2288e7)[_0xb6c6('0x9')](_0x352bf4,_0x1b8194);}var headers={'Content-Type':_0xb6c6('0xa'),'Accept':_0xb6c6('0xa')};function getTicket(_0x21247e,_0x4937eb,_0x55e114,_0x4f0aab,_0xd64172){logger[_0xb6c6('0xb')]('Creating\x20new\x20ticket...');return request({'uri':util['format'](_0xb6c6('0xc'),_0x21247e[_0xb6c6('0xd')]),'method':_0xb6c6('0xe'),'body':{'ticket':_[_0xb6c6('0xf')]({'requester_id':_0x55e114['id'],'submitter_id':_0x4937eb?_0x4937eb['id']:undefined,'assignee_id':_0x4937eb?_0x4937eb['id']:undefined,'tags':getTags(_0x4f0aab[_0xb6c6('0x10')],_0xb6c6('0x11')),'subject':intUtil[_0xb6c6('0x12')](_0x4f0aab['Subjects'],_0xd64172,'\x20'),'description':intUtil[_0xb6c6('0x12')](_0x4f0aab[_0xb6c6('0x13')],_0xd64172,'\x0a'),'comment':{'public':![],'body':intUtil[_0xb6c6('0x12')](_0x4f0aab[_0xb6c6('0x13')],_0xd64172,'\x0a')}},getCustomFields(_0x4f0aab[_0xb6c6('0x14')],_0xd64172))}})[_0xb6c6('0x15')](function(_0xba77d9){logger['info'](_0xb6c6('0x16'));return _0xba77d9[_0xb6c6('0x17')];});}function getUser(_0x4268a5,_0x1a0f01){if(intUtil[_0xb6c6('0x18')](_0x1a0f01)){logger[_0xb6c6('0xb')]('Getting\x20agent\x20with\x20email',_0x1a0f01);return request({'uri':util[_0xb6c6('0x19')](_0xb6c6('0x1a'),_0x4268a5[_0xb6c6('0xd')]),'qs':{'query':util[_0xb6c6('0x19')](_0xb6c6('0x1b'),_0x1a0f01)}})['then'](function(_0x22b3af){if(_0x22b3af[_0xb6c6('0x1c')]){logger[_0xb6c6('0xb')]('Agent\x20found!');return _['find'](_0x22b3af[_0xb6c6('0x1d')],{'email':_0x1a0f01,'role':_0xb6c6('0x1e')});}else{logger[_0xb6c6('0xb')](_0xb6c6('0x1f'));return request({'uri':util[_0xb6c6('0x19')](_0xb6c6('0x20'),_0x4268a5[_0xb6c6('0xd')])})[_0xb6c6('0x15')](function(_0x2f4200){logger['info'](_0xb6c6('0x21'));return _0x2f4200['user'];});}});}else{logger[_0xb6c6('0xb')](_0xb6c6('0x1f'));return request({'uri':util['format'](_0xb6c6('0x20'),_0x4268a5['remoteUri'])})['then'](function(_0x11e2f4){logger[_0xb6c6('0xb')](_0xb6c6('0x21'));return _0x11e2f4['user'];});}}function getEndUser(_0x3b2c08,_0x35d995,_0xd690fd){logger[_0xb6c6('0xb')](_0xb6c6('0x22'),_0xd690fd);return request({'uri':util['format'](_0xb6c6('0x1a'),_0x3b2c08[_0xb6c6('0xd')]),'qs':{'query':util[_0xb6c6('0x19')](_0xb6c6('0x23'),_0xd690fd)}})[_0xb6c6('0x15')](function(_0x174db1){var _0x555ff0;if(_0x174db1[_0xb6c6('0x1d')]['length']){_0x174db1[_0xb6c6('0x1d')]=_[_0xb6c6('0x24')](_0x174db1[_0xb6c6('0x1d')],{'suspended':![],'role':'end-user'});if(_0x174db1['results'][_0xb6c6('0x25')]){_0x555ff0=_[_0xb6c6('0x26')](_0x174db1['results']);}}if(_0x555ff0){logger['info'](_0xb6c6('0x27'));return _0x555ff0;}else{logger[_0xb6c6('0xb')](_0xb6c6('0x28'));return request({'uri':util[_0xb6c6('0x19')](_0xb6c6('0x29'),_0x3b2c08['remoteUri']),'method':_0xb6c6('0xe'),'body':{'user':{'role':_0xb6c6('0x2a'),'name':util[_0xb6c6('0x19')](_0xb6c6('0x2b'),_0x35d995||_0xd690fd),'phone':_0xd690fd}}})['then'](function(_0x596547){logger[_0xb6c6('0xb')](_0xb6c6('0x2c'));return _0x596547[_0xb6c6('0x2d')];});}});}function getAuth(_0x2826a3){var _0x412eaf;if(_0x2826a3['authType']===_0xb6c6('0x2e')){_0x412eaf=util[_0xb6c6('0x19')](_0xb6c6('0x2f'),_0x2826a3[_0xb6c6('0x30')],_0x2826a3[_0xb6c6('0x2e')]);}else if(_0x2826a3[_0xb6c6('0x31')]===_0xb6c6('0x32')){_0x412eaf=util[_0xb6c6('0x19')](_0xb6c6('0x33'),_0x2826a3['username'],_0x2826a3[_0xb6c6('0x32')]);}return util['format'](_0xb6c6('0x34'),new Buffer(_0x412eaf)[_0xb6c6('0x35')](_0xb6c6('0x36')));}function request(_0xf666a5){logger[_0xb6c6('0x37')](_0xb6c6('0x38'),JSON['stringify'](_0xf666a5));return rp(_['defaults'](_0xf666a5,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x586811,_0x1bf8c8){var _0xf51826=[];if(_0x586811&&_0x586811[_0xb6c6('0x25')]>0x0){_0xf51826=_['map'](_0x586811,_0x1bf8c8);}return _0xf51826;}function getCustomFields(_0x39993f,_0xdc6cdb){var _0x110e1f=[];var _0x228893={'custom_fields':[]};if(_0x39993f[_0xb6c6('0x25')]>0x0){_[_0xb6c6('0x39')](_0x39993f,function(_0xef16ce){if(_0xef16ce[_0xb6c6('0x3a')]===_0xb6c6('0x3b')&&_0xef16ce[_0xb6c6('0x3c')]&&!_0xef16ce[_0xb6c6('0x3d')]){_0x228893[_0xef16ce[_0xb6c6('0x3c')][_0xb6c6('0x3e')]()]=_0xef16ce['content'][_0xb6c6('0x35')]();}else if(_0xef16ce[_0xb6c6('0x3a')]===_0xb6c6('0x3b')&&_0xef16ce['idField']&&_0xef16ce['customField']){_0x228893['custom_fields'][_0xb6c6('0x3f')]({'id':_0xef16ce[_0xb6c6('0x40')],'value':_0xef16ce[_0xb6c6('0x41')][_0xb6c6('0x35')]()});}else if(_0xef16ce[_0xb6c6('0x3a')]===_0xb6c6('0x42')&&_0xef16ce[_0xb6c6('0x43')]&&_0xef16ce[_0xb6c6('0x40')]&&_0xef16ce[_0xb6c6('0x3d')]){_0xdc6cdb[_0xef16ce[_0xb6c6('0x43')]]&&_0x228893[_0xb6c6('0x44')][_0xb6c6('0x3f')]({'id':_0xef16ce[_0xb6c6('0x40')],'value':_0xdc6cdb[_0xef16ce[_0xb6c6('0x43')]][_0xb6c6('0x35')]()});}else if(_0xef16ce[_0xb6c6('0x3a')]==='customVariable'&&_0xef16ce['Variable']&&_0xef16ce[_0xb6c6('0x45')][_0xb6c6('0x11')]&&_0xef16ce[_0xb6c6('0x40')]&&_0xef16ce['customField']){_0xdc6cdb[_0xef16ce[_0xb6c6('0x45')][_0xb6c6('0x11')][_0xb6c6('0x3e')]()]&&_0x228893[_0xb6c6('0x44')]['push']({'id':_0xef16ce['idField'],'value':_0xdc6cdb[_0xef16ce[_0xb6c6('0x45')][_0xb6c6('0x11')][_0xb6c6('0x3e')]()]['toString']()});}});}return _0x228893;}exports[_0xb6c6('0x46')]=function(_0x521541,_0x1424e0,_0x336059,_0xaeb78d,_0x421ad0,_0x39a749){var _0x507006,_0x295cd1;_0x39a749[_0xb6c6('0xd')]=intUtil[_0xb6c6('0x47')](_0x39a749['remoteUri']);_0x39a749['serverUrl']=intUtil['stripTrailingSlash'](_0x39a749[_0xb6c6('0x48')]);if(_0x421ad0&&_0x421ad0['monitor_format']){logger[_0xb6c6('0xb')](_0xb6c6('0x49'),_0xb6c6('0x4a'));_0x1424e0[_0xb6c6('0x4b')]=util[_0xb6c6('0x19')](_0xb6c6('0x4c'),_0x39a749[_0xb6c6('0x48')],_0x1424e0[_0xb6c6('0x4d')],md5(_0x1424e0[_0xb6c6('0x4d')]));}else{_0x1424e0[_0xb6c6('0x4b')]='';}headers['Authorization']=getAuth(_0x39a749);return getUser(_0x39a749,_0xaeb78d[_0xb6c6('0x4e')])['then'](function(_0x469d97){_0x507006=_0x469d97;logger['info'](_0xb6c6('0x4f'),_0x507006['id']);return getEndUser(_0x39a749,_0x1424e0['calleridname'],_0x1424e0[_0xb6c6('0x50')]);})[_0xb6c6('0x15')](function(_0x4b5d9f){_0x295cd1=_0x4b5d9f;logger[_0xb6c6('0xb')](_0xb6c6('0x51'),_0x295cd1['id']);return getTicket(_0x39a749,_0x507006,_0x295cd1,_0x336059,_0x1424e0);})[_0xb6c6('0x15')](function(_0x37d23e){if(_0x37d23e){logger[_0xb6c6('0xb')](_0xb6c6('0x52'),_0x37d23e['id']);switch(_0x39a749[_0xb6c6('0x3a')]){case _0xb6c6('0x53'):logger['info'](_0xb6c6('0x49'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xb6c6('0x19')](_0xb6c6('0x54'),_0x39a749[_0xb6c6('0xd')],_0x507006['id'],_0x37d23e['id']),'method':_0xb6c6('0xe')});case _0xb6c6('0x55'):logger[_0xb6c6('0xb')](_0xb6c6('0x49'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb6c6('0x19')]('user:%s',_0xaeb78d['name']),_0xb6c6('0x56'),{'uri':util[_0xb6c6('0x19')]('%s/agent/tickets/%s',_0x39a749[_0xb6c6('0xd')],_0x37d23e['id'])});break;default:logger[_0xb6c6('0x57')](_0xb6c6('0x49'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xb6c6('0x58')](function(_0x371b74){logger[_0xb6c6('0x57')](_0xb6c6('0x59'),util[_0xb6c6('0x5a')](_0x371b74,{'showHidden':!![],'depth':null}));});};exports[_0xb6c6('0x5b')]=function(_0x2f5701,_0x5d8028,_0x3e9956,_0x504e3d,_0x229aad,_0x36dec1,_0x12d431){var _0x5e809c,_0x1113b7;_0x36dec1[_0xb6c6('0xd')]=intUtil[_0xb6c6('0x47')](_0x36dec1[_0xb6c6('0xd')]);_0x36dec1['serverUrl']=intUtil[_0xb6c6('0x47')](_0x36dec1[_0xb6c6('0x48')]);if(_0x12d431&&_0x12d431[_0xb6c6('0x5c')]&&_0x12d431[_0xb6c6('0x5c')]!==_0xb6c6('0x5d')){logger[_0xb6c6('0xb')]('[OUTBOUND]',_0xb6c6('0x4a'));_0x5d8028['recordingURL']=util[_0xb6c6('0x19')](_0xb6c6('0x4c'),_0x36dec1[_0xb6c6('0x48')],_0x5d8028[_0xb6c6('0x4d')],md5(_0x5d8028[_0xb6c6('0x4d')]));}headers[_0xb6c6('0x5e')]=getAuth(_0x36dec1);return getUser(_0x36dec1,_0x504e3d[_0xb6c6('0x4e')])[_0xb6c6('0x15')](function(_0x36b464){_0x5e809c=_0x36b464;logger['info'](_0xb6c6('0x4f'),_0x5e809c['id']);return getEndUser(_0x36dec1,_0x5d8028[_0xb6c6('0x5f')],_0x5d8028[_0xb6c6('0x60')]);})[_0xb6c6('0x15')](function(_0x1b898d){_0x1113b7=_0x1b898d;logger[_0xb6c6('0xb')](_0xb6c6('0x51'),_0x1113b7['id']);return getTicket(_0x36dec1,_0x5e809c,_0x1113b7,_0x3e9956,_0x5d8028);})['then'](function(_0x52b628){if(_0x52b628){logger[_0xb6c6('0xb')](_0xb6c6('0x52'),_0x52b628['id']);switch(_0x36dec1['type']){case _0xb6c6('0x53'):logger[_0xb6c6('0xb')](_0xb6c6('0x61'),_0xb6c6('0x62'));return request({'uri':util[_0xb6c6('0x19')](_0xb6c6('0x54'),_0x36dec1[_0xb6c6('0xd')],_0x5e809c['id'],_0x52b628['id']),'method':_0xb6c6('0xe')});case'newTab':logger[_0xb6c6('0xb')](_0xb6c6('0x61'),_0xb6c6('0x63'));emit(util['format']('user:%s',_0x504e3d[_0xb6c6('0x11')]),'trigger:browser:url',{'uri':util[_0xb6c6('0x19')](_0xb6c6('0x64'),_0x36dec1[_0xb6c6('0xd')],_0x52b628['id'])});break;default:logger[_0xb6c6('0x57')](_0xb6c6('0x61'),_0xb6c6('0x65'));}}})[_0xb6c6('0x58')](function(_0x54bd58){logger['error'](_0xb6c6('0x66'),util['inspect'](_0x54bd58,{'showHidden':!![],'depth':null}));});};exports[_0xb6c6('0x67')]=function(_0x3fa26b,_0xbea8a0,_0x3a97f4,_0x254d76,_0xc70d7b,_0xf135e1){var _0x4bc9d0,_0x26fc25;_0xf135e1[_0xb6c6('0xd')]=intUtil[_0xb6c6('0x47')](_0xf135e1[_0xb6c6('0xd')]);_0xf135e1[_0xb6c6('0x48')]=intUtil[_0xb6c6('0x47')](_0xf135e1[_0xb6c6('0x48')]);if(_0xc70d7b&&_0xc70d7b['monitor_format']){logger['info']('[ABANDONED]',_0xb6c6('0x4a'));_0xbea8a0[_0xb6c6('0x4b')]=util[_0xb6c6('0x19')](_0xb6c6('0x4c'),_0xf135e1[_0xb6c6('0x48')],_0xbea8a0[_0xb6c6('0x4d')],md5(_0xbea8a0[_0xb6c6('0x4d')]));}else{_0xbea8a0[_0xb6c6('0x4b')]='';}headers[_0xb6c6('0x5e')]=getAuth(_0xf135e1);return getUser(_0xf135e1)[_0xb6c6('0x15')](function(_0x402c11){_0x4bc9d0=_0x402c11;logger[_0xb6c6('0xb')](_0xb6c6('0x4f'),_0x4bc9d0['id']);return getEndUser(_0xf135e1,_0xbea8a0['calleridname'],_0xbea8a0[_0xb6c6('0x50')]);})[_0xb6c6('0x15')](function(_0x1d5628){_0x26fc25=_0x1d5628;logger['info'](_0xb6c6('0x51'),_0x26fc25['id']);return getTicket(_0xf135e1,_0x4bc9d0,_0x26fc25,_0x3a97f4,_0xbea8a0);})['then'](function(_0x37264c){if(_0x37264c){logger[_0xb6c6('0xb')](_0xb6c6('0x52'),_0x37264c['id']);}})['catch'](function(_0x220e39){logger[_0xb6c6('0x57')](_0xb6c6('0x68'),util['inspect'](_0x220e39,{'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 c7002ad..2f72379 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 _0x3189=['Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','error','Searching\x20enduser\x20with\x20phone','GET','https://crm.%s/crm/private/json/Contacts/searchRecords','((Phone:%s))','Enduser\x20found\x20in\x20Contacts!','row','Contacts','val','Enduser\x20found\x20in\x20Leads!','Leads','length','content','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','https://crm.%s/crm/private/xml/Leads/insertRecords','%s%s%s','encodeXML','Enduser\x20created.','Error\x20on\x20Lead\x20creation:\x20','debug','[HTTP]','forEach','type','string','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','queue','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','stripTrailingSlash','recordingFormat','The\x20User\x20ID\x20is:','destcalleridnum','Outbound','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','[OUTBOUND]','[ABANDONED]','lodash','request-promise','md5','util','./util','xml2json','entities','moment','../../../../config/environment','zoho','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20call...','merge','inbound','starttime','agentcalledAt','format','YYYY-MM-DD\x20HH:mm:ss','getString','Subjects','Fields','lastevent','called','Called','complete','connect','Answered','rejected','Call\x20Result','abandoned','Abandoned','Call\x20Duration','utc','talktime','endtime','diff','mm:ss','CONTACTID','LEADID','SEMODULE','SEID','hasOwnProperty','','host','authToken','crmapi','then','parse','toJson','result','response','recorddetail','Error\x20on\x20call\x20creation:\x20','stringify','https://crm.%s/crm/private/json/Users/getUsers','AllUsers','users','user','zoho\x20data\x20users','isArrayLikeObject','log','find','Standard','active','isNil','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','zoho\x20user','profile','The\x20failing\x20result\x20is'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x3189,0xcb));var _0x9318=function(_0x148edd,_0xb645be){_0x148edd=_0x148edd-0x0;var _0x233721=_0x3189[_0x148edd];return _0x233721;};'use strict';var _=require(_0x9318('0x0'));var rp=require(_0x9318('0x1'));var md5=require(_0x9318('0x2'));var util=require(_0x9318('0x3'));var intUtil=require(_0x9318('0x4'));var parser=require(_0x9318('0x5'));var entities=require(_0x9318('0x6'));var moment=require(_0x9318('0x7'));var Redis=require('ioredis');var config=require(_0x9318('0x8'));var logger=require('../../../../config/logger')(_0x9318('0x9'));config[_0x9318('0xa')]=_[_0x9318('0xb')](config[_0x9318('0xa')],{'host':_0x9318('0xc'),'port':0x18eb});var io=require(_0x9318('0xd'))(new Redis(config[_0x9318('0xa')]));function emit(_0x68f6da,_0x4a9123,_0x3195d4){io['to'](_0x68f6da)[_0x9318('0xe')](_0x4a9123,_0x3195d4);}var headers={'Content-Type':'application/json','Accept':_0x9318('0xf')};function getCall(_0x53ce69,_0x1569eb,_0x1326bb,_0x5d649f,_0x3ae2f,_0x375a65){logger[_0x9318('0x10')](_0x9318('0x11'));var _0x26cced=_[_0x9318('0x12')]({'SMOWNERID':_0x1569eb['id'],'Call Type':_0x375a65||_0x9318('0x13'),'Call Start Time':(_0x375a65==='outbound'?_0x3ae2f[_0x9318('0x14')]:_0x3ae2f[_0x9318('0x15')])||moment()[_0x9318('0x16')](_0x9318('0x17')),'Subject':intUtil[_0x9318('0x18')](_0x5d649f[_0x9318('0x19')],_0x3ae2f,'\x20'),'Description':intUtil[_0x9318('0x18')](_0x5d649f['Descriptions'],_0x3ae2f,'\x0a')},getCustomFields(_0x5d649f[_0x9318('0x1a')],_0x3ae2f));switch(_0x3ae2f[_0x9318('0x1b')]){case _0x9318('0x1c'):_0x26cced['Call\x20Result']=_0x9318('0x1d');break;case _0x9318('0x1e'):case _0x9318('0x1f'):_0x26cced['Call\x20Result']=_0x9318('0x20');break;case _0x9318('0x21'):_0x26cced[_0x9318('0x22')]='Rejected';break;case _0x9318('0x23'):_0x26cced[_0x9318('0x22')]=_0x9318('0x24');break;default:}if(_0x3ae2f['talktime']){_0x26cced[_0x9318('0x25')]=moment[_0x9318('0x26')](parseInt(_0x3ae2f[_0x9318('0x27')])*0x3e8)[_0x9318('0x16')]('mm:ss');}else if(_0x3ae2f['answertime']&&_0x3ae2f[_0x9318('0x28')]){_0x26cced[_0x9318('0x25')]=moment[_0x9318('0x26')](moment(_0x3ae2f[_0x9318('0x28')],_0x9318('0x17'))[_0x9318('0x29')](moment(_0x3ae2f[_0x9318('0x14')],_0x9318('0x17'))))[_0x9318('0x16')](_0x9318('0x2a'));}if(_0x1326bb['CONTACTID']){_0x26cced[_0x9318('0x2b')]=_0x1326bb['CONTACTID'];}else if(_0x1326bb[_0x9318('0x2c')]){_0x26cced[_0x9318('0x2d')]='Leads';_0x26cced[_0x9318('0x2e')]=_0x1326bb[_0x9318('0x2c')];}var _0x189576='';for(var _0x1c9ac9 in _0x26cced){if(_0x26cced[_0x9318('0x2f')](_0x1c9ac9)){_0x189576+=util[_0x9318('0x16')]('%s',entities['encodeXML'](_0x1c9ac9),entities['encodeXML'](_0x26cced[_0x1c9ac9]));}}_0x189576+=_0x9318('0x30');return request({'method':'POST','uri':util[_0x9318('0x16')]('https://crm.%s/crm/private/xml/Calls/insertRecords',_0x53ce69[_0x9318('0x31')]),'qs':{'authtoken':_0x53ce69[_0x9318('0x32')],'scope':_0x9318('0x33'),'xmlData':_0x189576},'json':!![]})[_0x9318('0x34')](function(_0x21be76){_0x21be76=JSON[_0x9318('0x35')](parser[_0x9318('0x36')](_0x21be76));if(_0x21be76['response']){if(_0x21be76['response'][_0x9318('0x37')]&&_0x21be76[_0x9318('0x38')][_0x9318('0x37')][_0x9318('0x39')]){logger[_0x9318('0x10')]('Call\x20created!');return{'id':_0x21be76['response'][_0x9318('0x37')][_0x9318('0x39')]['FL'][0x0]['$t']};}}throw new Error(_0x9318('0x3a')+JSON[_0x9318('0x3b')](_0x21be76));});}function getUser(_0x959c05,_0x427b6b){return request({'method':'GET','uri':util[_0x9318('0x16')](_0x9318('0x3c'),_0x959c05['host']),'qs':{'type':_0x9318('0x3d'),'authtoken':_0x959c05[_0x9318('0x32')],'scope':_0x9318('0x33')},'json':!![]})[_0x9318('0x34')](function(_0x59a883){if(_0x59a883[_0x9318('0x3e')]&&_0x59a883['users'][_0x9318('0x3f')]){var _0x362c5e;console['log'](_0x9318('0x40'),_0x59a883[_0x9318('0x3e')][_0x9318('0x3f')]);if(_[_0x9318('0x41')](_0x59a883['users'][_0x9318('0x3f')])){console[_0x9318('0x42')](_0x9318('0x40'),_0x59a883[_0x9318('0x3e')][_0x9318('0x3f')]);if(!_['isNil'](_0x427b6b)){_0x362c5e=_[_0x9318('0x43')](_0x59a883[_0x9318('0x3e')]['user'],{'email':_0x427b6b,'profile':_0x9318('0x44'),'status':_0x9318('0x45')});}if(!_[_0x9318('0x46')](_0x362c5e)){logger['info'](_0x9318('0x47'));}else{logger[_0x9318('0x10')](_0x9318('0x48'));_0x362c5e=_[_0x9318('0x43')](_0x59a883[_0x9318('0x3e')][_0x9318('0x3f')],{'profile':_0x9318('0x49')});}console[_0x9318('0x42')](_0x9318('0x4a'),_0x362c5e);return _0x362c5e;}else{if(_0x59a883[_0x9318('0x3e')][_0x9318('0x3f')][_0x9318('0x4b')]==='Administrator'){logger[_0x9318('0x10')](_0x9318('0x48'));_0x362c5e=_0x59a883[_0x9318('0x3e')]['user'];return _0x362c5e;}else{logger['error'](_0x9318('0x4c'),JSON['stringify'](_0x59a883));throw new Error(_0x9318('0x4d')+JSON[_0x9318('0x3b')](_0x59a883));}}}else{logger[_0x9318('0x4e')](_0x9318('0x4c'),JSON[_0x9318('0x3b')](_0x59a883));throw new Error(_0x9318('0x4d')+JSON[_0x9318('0x3b')](_0x59a883));}});}function getEndUser(_0x3c7509,_0xc8ef0b,_0x2073a4){logger['info'](_0x9318('0x4f'),_0x2073a4);return request({'method':_0x9318('0x50'),'uri':util[_0x9318('0x16')](_0x9318('0x51'),_0x3c7509['host']),'qs':{'authtoken':_0x3c7509[_0x9318('0x32')],'scope':'crmapi','criteria':util[_0x9318('0x16')](_0x9318('0x52'),_0x2073a4)},'json':!![]})['then'](function(_0x1ed919){if(_0x1ed919[_0x9318('0x38')]&&_0x1ed919[_0x9318('0x38')][_0x9318('0x37')]){logger['info'](_0x9318('0x53'));var _0x362eb0={};var _0x740568=_0x1ed919[_0x9318('0x38')][_0x9318('0x37')]['Contacts'][_0x9318('0x54')]['no']?_0x1ed919[_0x9318('0x38')][_0x9318('0x37')][_0x9318('0x55')][_0x9318('0x54')]['FL']:_0x1ed919[_0x9318('0x38')][_0x9318('0x37')][_0x9318('0x55')][_0x9318('0x54')][0x0]['FL'];for(var _0x4bfe3e=0x0,_0x57d41e=_0x740568['length'];_0x4bfe3e<_0x57d41e;_0x4bfe3e++){_0x362eb0[_0x740568[_0x4bfe3e][_0x9318('0x56')]]=_0x740568[_0x4bfe3e]['content'];}return _0x362eb0;}else{return request({'method':_0x9318('0x50'),'uri':util[_0x9318('0x16')]('https://crm.%s/crm/private/json/Leads/searchRecords',_0x3c7509['host']),'qs':{'authtoken':_0x3c7509[_0x9318('0x32')],'scope':_0x9318('0x33'),'criteria':util['format'](_0x9318('0x52'),_0x2073a4)},'json':!![]})[_0x9318('0x34')](function(_0x5ef823){if(_0x5ef823['response']&&_0x5ef823[_0x9318('0x38')][_0x9318('0x37')]){logger['info'](_0x9318('0x57'));var _0x3763ce={};var _0x4d2f2e=_0x5ef823[_0x9318('0x38')][_0x9318('0x37')][_0x9318('0x58')]['row']['no']?_0x5ef823[_0x9318('0x38')][_0x9318('0x37')][_0x9318('0x58')][_0x9318('0x54')]['FL']:_0x5ef823['response']['result'][_0x9318('0x58')][_0x9318('0x54')][0x0]['FL'];for(var _0x39ec9b=0x0,_0x1139f1=_0x4d2f2e[_0x9318('0x59')];_0x39ec9b<_0x1139f1;_0x39ec9b++){_0x3763ce[_0x4d2f2e[_0x39ec9b][_0x9318('0x56')]]=_0x4d2f2e[_0x39ec9b][_0x9318('0x5a')];}return _0x3763ce;}else{logger[_0x9318('0x10')](_0x9318('0x5b'));_0xc8ef0b=getName(_0xc8ef0b);return request({'method':_0x9318('0x5c'),'uri':util[_0x9318('0x16')](_0x9318('0x5d'),_0x3c7509[_0x9318('0x31')]),'qs':{'authtoken':_0x3c7509[_0x9318('0x32')],'scope':_0x9318('0x33'),'xmlData':util[_0x9318('0x16')](_0x9318('0x5e'),entities[_0x9318('0x5f')](_0xc8ef0b[0x0]),entities[_0x9318('0x5f')](_0xc8ef0b[0x1]),_0x2073a4)},'json':!![]})[_0x9318('0x34')](function(_0x72752a){_0x72752a=JSON[_0x9318('0x35')](parser['toJson'](_0x72752a));if(_0x72752a[_0x9318('0x38')]){if(_0x72752a[_0x9318('0x38')][_0x9318('0x37')]&&_0x72752a[_0x9318('0x38')][_0x9318('0x37')][_0x9318('0x39')]){logger['info'](_0x9318('0x60'));return request({'method':_0x9318('0x50'),'uri':util[_0x9318('0x16')]('https://crm.%s/crm/private/json/Leads/getRecordById',_0x3c7509[_0x9318('0x31')]),'qs':{'authtoken':_0x3c7509[_0x9318('0x32')],'scope':'crmapi','id':_0x72752a[_0x9318('0x38')][_0x9318('0x37')]['recorddetail']['FL'][0x0]['$t']},'json':!![]});}}throw new Error(_0x9318('0x61')+JSON[_0x9318('0x3b')](_0x72752a));})[_0x9318('0x34')](function(_0x1a467e){if(_0x1a467e[_0x9318('0x38')]){if(_0x1a467e[_0x9318('0x38')][_0x9318('0x37')]){var _0x1e48db={};for(var _0x17d27c=0x0,_0x1af002=_0x1a467e[_0x9318('0x38')][_0x9318('0x37')][_0x9318('0x58')][_0x9318('0x54')]['FL'][_0x9318('0x59')];_0x17d27c<_0x1af002;_0x17d27c++){_0x1e48db[_0x1a467e['response'][_0x9318('0x37')]['Leads'][_0x9318('0x54')]['FL'][_0x17d27c][_0x9318('0x56')]]=_0x1a467e[_0x9318('0x38')][_0x9318('0x37')]['Leads'][_0x9318('0x54')]['FL'][_0x17d27c][_0x9318('0x5a')];}return _0x1e48db;}}throw new Error('Error\x20on\x20Lead\x20retrieve:\x20'+JSON[_0x9318('0x3b')](_0x1a467e));});}});}});}function request(_0x5bcfd7){logger[_0x9318('0x62')](_0x9318('0x63'),JSON[_0x9318('0x3b')](_0x5bcfd7));return rp(_0x5bcfd7);}function getCustomFields(_0x476e8f,_0xaab485){var _0x2882f5={};if(_0x476e8f[_0x9318('0x59')]>0x0){_[_0x9318('0x64')](_0x476e8f,function(_0x31017f){if(_0x31017f[_0x9318('0x65')]===_0x9318('0x66')&&_0x31017f[_0x9318('0x67')]){_0x2882f5[_0x31017f['idField']]=_0x31017f['content'][_0x9318('0x68')]();}else if(_0x31017f[_0x9318('0x65')]===_0x9318('0x69')&&_0x31017f[_0x9318('0x6a')]&&_0x31017f['idField']&&_0xaab485[_0x31017f[_0x9318('0x6a')]]){_0x2882f5[_0x31017f['idField']]=_0xaab485[_0x31017f[_0x9318('0x6a')]][_0x9318('0x68')]();}else if(_0x31017f[_0x9318('0x65')]===_0x9318('0x6b')&&_0x31017f[_0x9318('0x6c')]&&_0x31017f[_0x9318('0x6c')][_0x9318('0x6d')]&&_0x31017f[_0x9318('0x67')]&&_0xaab485[_0x31017f[_0x9318('0x6c')]['name'][_0x9318('0x6e')]()]){_0x2882f5[_0x31017f[_0x9318('0x67')]]=_0xaab485[_0x31017f['Variable']['name'][_0x9318('0x6e')]()][_0x9318('0x68')]();}});}return _0x2882f5;}function getName(_0x291147){if(_0x291147[_0x9318('0x6f')]('\x20')>0x0){var _0x140f78=_0x291147[_0x9318('0x70')](/ (.+)/);if(_0x140f78[0x1]){return _0x140f78;}}return[_0x291147,_0x291147];}exports[_0x9318('0x71')]=function(_0x2d4683,_0x5ecc68,_0x4acc0b,_0x3675ed,_0x5b300b,_0x1443b3){var _0x31a6ff,_0x53f48a;_0x1443b3[_0x9318('0x31')]=intUtil['stripTrailingSlash'](_0x1443b3[_0x9318('0x31')]);_0x1443b3[_0x9318('0x72')]=intUtil['stripTrailingSlash'](_0x1443b3[_0x9318('0x72')]);if(_0x5b300b&&_0x5b300b[_0x9318('0x73')]){logger[_0x9318('0x10')]('[QUEUE]',_0x9318('0x74'));_0x5ecc68[_0x9318('0x75')]=util[_0x9318('0x16')](_0x9318('0x76'),_0x1443b3[_0x9318('0x72')],_0x5ecc68[_0x9318('0x77')],md5(_0x5ecc68['uniqueid']));}else{_0x5ecc68[_0x9318('0x75')]='';}return getUser(_0x1443b3,_0x3675ed[_0x9318('0x78')])['then'](function(_0x1069b1){_0x31a6ff=_0x1069b1;logger[_0x9318('0x10')]('The\x20User\x20ID\x20is:',_0x31a6ff['id']);return getEndUser(_0x1443b3,_0x5ecc68[_0x9318('0x79')],_0x5ecc68[_0x9318('0x7a')]);})[_0x9318('0x34')](function(_0x3d8f06){_0x53f48a=_0x3d8f06;logger[_0x9318('0x10')](_0x9318('0x7b'),_0x53f48a[_0x9318('0x2b')]||_0x53f48a[_0x9318('0x2c')]);return getCall(_0x1443b3,_0x31a6ff,_0x53f48a,_0x4acc0b,_0x5ecc68,_0x9318('0x7c'));})['then'](function(_0x26f573){if(_0x26f573){logger['info'](_0x9318('0x7d'),_0x26f573['id']);logger[_0x9318('0x10')](_0x9318('0x7e'),_0x9318('0x7f'));emit(util[_0x9318('0x16')](_0x9318('0x80'),_0x3675ed['name']),_0x9318('0x81'),{'uri':util['format']('https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s',_0x1443b3[_0x9318('0x31')],_0x26f573['id'])});}})[_0x9318('0x82')](function(_0x1fedc1){logger[_0x9318('0x4e')](_0x9318('0x7e'),JSON[_0x9318('0x3b')](_0x1fedc1));});};exports[_0x9318('0x83')]=function(_0xdaa87d,_0x3a3e94,_0x49f4a8,_0x1409cf,_0x17dcc5,_0xc9ad26,_0x5d5025){var _0x37d3b8,_0x1b0562;_0xc9ad26[_0x9318('0x31')]=intUtil['stripTrailingSlash'](_0xc9ad26['host']);_0xc9ad26['serverUrl']=intUtil[_0x9318('0x84')](_0xc9ad26[_0x9318('0x72')]);if(_0x5d5025&&_0x5d5025[_0x9318('0x85')]&&_0x5d5025[_0x9318('0x85')]!=='none'){logger['info']('[OUTBOUND]',_0x9318('0x74'));_0x3a3e94[_0x9318('0x75')]=util[_0x9318('0x16')](_0x9318('0x76'),_0xc9ad26[_0x9318('0x72')],_0x3a3e94[_0x9318('0x77')],md5(_0x3a3e94[_0x9318('0x77')]));}return getUser(_0xc9ad26,_0x1409cf[_0x9318('0x78')])[_0x9318('0x34')](function(_0x13ee92){_0x37d3b8=_0x13ee92;logger[_0x9318('0x10')](_0x9318('0x86'),_0x37d3b8['id']);return getEndUser(_0xc9ad26,_0x3a3e94['destcalleridname'],_0x3a3e94[_0x9318('0x87')]);})[_0x9318('0x34')](function(_0x1d0696){_0x1b0562=_0x1d0696;logger[_0x9318('0x10')]('The\x20Enduser\x20ID\x20is:',_0x1b0562[_0x9318('0x2b')]||_0x1b0562['LEADID']);return getCall(_0xc9ad26,_0x37d3b8,_0x1b0562,_0x49f4a8,_0x3a3e94,_0x9318('0x88'));})[_0x9318('0x34')](function(_0x5462da){if(_0x5462da){logger['info'](_0x9318('0x7d'),_0x5462da['id']);logger['info']('[OUTBOUND]',_0x9318('0x7f'));emit(util[_0x9318('0x16')](_0x9318('0x80'),_0x1409cf['name']),'trigger:browser:url',{'uri':util[_0x9318('0x16')](_0x9318('0x89'),_0xc9ad26[_0x9318('0x31')],_0x5462da['id'])});}})[_0x9318('0x82')](function(_0x3a57e5){logger[_0x9318('0x4e')](_0x9318('0x8a'),JSON[_0x9318('0x3b')](_0x3a57e5));});};exports[_0x9318('0x23')]=function(_0x86c46e,_0x29c6ba,_0x5ec4fc,_0x4953b4,_0xe7caf1,_0x149a86){var _0x39cda5,_0x5e28a4;_0x149a86[_0x9318('0x31')]=intUtil[_0x9318('0x84')](_0x149a86['host']);_0x149a86[_0x9318('0x72')]=intUtil[_0x9318('0x84')](_0x149a86[_0x9318('0x72')]);if(_0xe7caf1&&_0xe7caf1[_0x9318('0x73')]){logger[_0x9318('0x10')](_0x9318('0x8b'),_0x9318('0x74'));_0x29c6ba[_0x9318('0x75')]=util['format'](_0x9318('0x76'),_0x149a86['serverUrl'],_0x29c6ba[_0x9318('0x77')],md5(_0x29c6ba[_0x9318('0x77')]));}else{_0x29c6ba[_0x9318('0x75')]='';}return getUser(_0x149a86)[_0x9318('0x34')](function(_0x50f7f5){_0x39cda5=_0x50f7f5;logger[_0x9318('0x10')](_0x9318('0x86'),_0x39cda5['id']);return getEndUser(_0x149a86,_0x29c6ba[_0x9318('0x79')],_0x29c6ba[_0x9318('0x7a')]);})[_0x9318('0x34')](function(_0x368f6b){_0x5e28a4=_0x368f6b;logger[_0x9318('0x10')](_0x9318('0x7b'),_0x5e28a4[_0x9318('0x2b')]||_0x5e28a4['LEADID']);return getCall(_0x149a86,_0x39cda5,_0x5e28a4,_0x5ec4fc,_0x29c6ba,'Inbound');})[_0x9318('0x34')](function(_0xd33eca){if(_0xd33eca){logger[_0x9318('0x10')](_0x9318('0x7d'),_0xd33eca['id']);}})[_0x9318('0x82')](function(_0x3f36e7){logger[_0x9318('0x4e')](_0x9318('0x8b'),JSON[_0x9318('0x3b')](_0x3f36e7));});}; \ No newline at end of file +var _0x8b0c=['none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','[ABANDONED]','calleridname','Inbound','util','./util','entities','moment','../../../../config/environment','zoho','redis','localhost','application/json','info','Creating\x20new\x20call...','inbound','outbound','starttime','agentcalledAt','format','YYYY-MM-DD\x20HH:mm:ss','getString','Subjects','Descriptions','Fields','lastevent','called','Call\x20Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','talktime','mm:ss','answertime','endtime','utc','diff','CONTACTID','LEADID','SEMODULE','SEID','','hasOwnProperty','%s','POST','https://crm.%s/crm/private/xml/Calls/insertRecords','host','authToken','crmapi','then','parse','toJson','response','result','recorddetail','Call\x20created!','Error\x20on\x20call\x20creation:\x20','stringify','https://crm.%s/crm/private/json/Users/getUsers','AllUsers','users','user','log','zoho\x20data\x20users','isArrayLikeObject','find','Standard','active','isNil','Agent\x20found!','Using\x20the\x20admin\x20account!','zoho\x20user','Administrator','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','GET','((Phone:%s))','Enduser\x20found\x20in\x20Contacts!','Contacts','row','length','val','https://crm.%s/crm/private/json/Leads/searchRecords','Enduser\x20found\x20in\x20Leads!','Leads','content','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','https://crm.%s/crm/private/xml/Leads/insertRecords','%s%s%s','Enduser\x20created.','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20creation:\x20','Error\x20on\x20Lead\x20retrieve:\x20','debug','[HTTP]','type','string','idField','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','catch','serverUrl','recordingFormat'];(function(_0x4f31d8,_0x25f615){var _0x27ea0d=function(_0x5a382e){while(--_0x5a382e){_0x4f31d8['push'](_0x4f31d8['shift']());}};_0x27ea0d(++_0x25f615);}(_0x8b0c,0x93));var _0xc8b0=function(_0x3db94c,_0x525fca){_0x3db94c=_0x3db94c-0x0;var _0x4dabb6=_0x8b0c[_0x3db94c];return _0x4dabb6;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0xc8b0('0x0'));var intUtil=require(_0xc8b0('0x1'));var parser=require('xml2json');var entities=require(_0xc8b0('0x2'));var moment=require(_0xc8b0('0x3'));var Redis=require('ioredis');var config=require(_0xc8b0('0x4'));var logger=require('../../../../config/logger')(_0xc8b0('0x5'));config[_0xc8b0('0x6')]=_['defaults'](config[_0xc8b0('0x6')],{'host':_0xc8b0('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x249eca,_0x53878c,_0x426f42){io['to'](_0x249eca)['emit'](_0x53878c,_0x426f42);}var headers={'Content-Type':_0xc8b0('0x8'),'Accept':'application/json'};function getCall(_0x5eec88,_0x7fb351,_0x17116b,_0x269209,_0x4418bf,_0x4f28ed){logger[_0xc8b0('0x9')](_0xc8b0('0xa'));var _0x85b0c5=_['merge']({'SMOWNERID':_0x7fb351['id'],'Call Type':_0x4f28ed||_0xc8b0('0xb'),'Call Start Time':(_0x4f28ed===_0xc8b0('0xc')?_0x4418bf[_0xc8b0('0xd')]:_0x4418bf[_0xc8b0('0xe')])||moment()[_0xc8b0('0xf')](_0xc8b0('0x10')),'Subject':intUtil[_0xc8b0('0x11')](_0x269209[_0xc8b0('0x12')],_0x4418bf,'\x20'),'Description':intUtil[_0xc8b0('0x11')](_0x269209[_0xc8b0('0x13')],_0x4418bf,'\x0a')},getCustomFields(_0x269209[_0xc8b0('0x14')],_0x4418bf));switch(_0x4418bf[_0xc8b0('0x15')]){case _0xc8b0('0x16'):_0x85b0c5[_0xc8b0('0x17')]=_0xc8b0('0x18');break;case _0xc8b0('0x19'):case _0xc8b0('0x1a'):_0x85b0c5['Call\x20Result']=_0xc8b0('0x1b');break;case _0xc8b0('0x1c'):_0x85b0c5[_0xc8b0('0x17')]=_0xc8b0('0x1d');break;case _0xc8b0('0x1e'):_0x85b0c5[_0xc8b0('0x17')]=_0xc8b0('0x1f');break;default:}if(_0x4418bf[_0xc8b0('0x20')]){_0x85b0c5['Call\x20Duration']=moment['utc'](parseInt(_0x4418bf[_0xc8b0('0x20')])*0x3e8)[_0xc8b0('0xf')](_0xc8b0('0x21'));}else if(_0x4418bf[_0xc8b0('0x22')]&&_0x4418bf[_0xc8b0('0x23')]){_0x85b0c5['Call\x20Duration']=moment[_0xc8b0('0x24')](moment(_0x4418bf['endtime'],_0xc8b0('0x10'))[_0xc8b0('0x25')](moment(_0x4418bf[_0xc8b0('0xd')],_0xc8b0('0x10'))))[_0xc8b0('0xf')](_0xc8b0('0x21'));}if(_0x17116b[_0xc8b0('0x26')]){_0x85b0c5[_0xc8b0('0x26')]=_0x17116b[_0xc8b0('0x26')];}else if(_0x17116b[_0xc8b0('0x27')]){_0x85b0c5[_0xc8b0('0x28')]='Leads';_0x85b0c5[_0xc8b0('0x29')]=_0x17116b['LEADID'];}var _0x5857d1=_0xc8b0('0x2a');for(var _0x2d4818 in _0x85b0c5){if(_0x85b0c5[_0xc8b0('0x2b')](_0x2d4818)){_0x5857d1+=util[_0xc8b0('0xf')](_0xc8b0('0x2c'),entities['encodeXML'](_0x2d4818),entities['encodeXML'](_0x85b0c5[_0x2d4818]));}}_0x5857d1+='';return request({'method':_0xc8b0('0x2d'),'uri':util['format'](_0xc8b0('0x2e'),_0x5eec88[_0xc8b0('0x2f')]),'qs':{'authtoken':_0x5eec88[_0xc8b0('0x30')],'scope':_0xc8b0('0x31'),'xmlData':_0x5857d1},'json':!![]})[_0xc8b0('0x32')](function(_0x3ad21b){_0x3ad21b=JSON[_0xc8b0('0x33')](parser[_0xc8b0('0x34')](_0x3ad21b));if(_0x3ad21b[_0xc8b0('0x35')]){if(_0x3ad21b[_0xc8b0('0x35')][_0xc8b0('0x36')]&&_0x3ad21b[_0xc8b0('0x35')][_0xc8b0('0x36')][_0xc8b0('0x37')]){logger[_0xc8b0('0x9')](_0xc8b0('0x38'));return{'id':_0x3ad21b[_0xc8b0('0x35')][_0xc8b0('0x36')][_0xc8b0('0x37')]['FL'][0x0]['$t']};}}throw new Error(_0xc8b0('0x39')+JSON[_0xc8b0('0x3a')](_0x3ad21b));});}function getUser(_0x1d0808,_0x14dcff){return request({'method':'GET','uri':util[_0xc8b0('0xf')](_0xc8b0('0x3b'),_0x1d0808[_0xc8b0('0x2f')]),'qs':{'type':_0xc8b0('0x3c'),'authtoken':_0x1d0808[_0xc8b0('0x30')],'scope':_0xc8b0('0x31')},'json':!![]})[_0xc8b0('0x32')](function(_0x2a195c){if(_0x2a195c[_0xc8b0('0x3d')]&&_0x2a195c[_0xc8b0('0x3d')][_0xc8b0('0x3e')]){var _0x158816;console[_0xc8b0('0x3f')](_0xc8b0('0x40'),_0x2a195c[_0xc8b0('0x3d')][_0xc8b0('0x3e')]);if(_[_0xc8b0('0x41')](_0x2a195c[_0xc8b0('0x3d')][_0xc8b0('0x3e')])){console['log'](_0xc8b0('0x40'),_0x2a195c[_0xc8b0('0x3d')][_0xc8b0('0x3e')]);if(!_['isNil'](_0x14dcff)){_0x158816=_[_0xc8b0('0x42')](_0x2a195c['users'][_0xc8b0('0x3e')],{'email':_0x14dcff,'profile':_0xc8b0('0x43'),'status':_0xc8b0('0x44')});}if(!_[_0xc8b0('0x45')](_0x158816)){logger[_0xc8b0('0x9')](_0xc8b0('0x46'));}else{logger['info'](_0xc8b0('0x47'));_0x158816=_['find'](_0x2a195c[_0xc8b0('0x3d')][_0xc8b0('0x3e')],{'profile':'Administrator'});}console[_0xc8b0('0x3f')](_0xc8b0('0x48'),_0x158816);return _0x158816;}else{if(_0x2a195c[_0xc8b0('0x3d')][_0xc8b0('0x3e')]['profile']===_0xc8b0('0x49')){logger[_0xc8b0('0x9')](_0xc8b0('0x47'));_0x158816=_0x2a195c['users']['user'];return _0x158816;}else{logger[_0xc8b0('0x4a')](_0xc8b0('0x4b'),JSON[_0xc8b0('0x3a')](_0x2a195c));throw new Error(_0xc8b0('0x4c')+JSON[_0xc8b0('0x3a')](_0x2a195c));}}}else{logger[_0xc8b0('0x4a')](_0xc8b0('0x4b'),JSON[_0xc8b0('0x3a')](_0x2a195c));throw new Error(_0xc8b0('0x4c')+JSON[_0xc8b0('0x3a')](_0x2a195c));}});}function getEndUser(_0x24cf5b,_0x141636,_0x41eade){logger[_0xc8b0('0x9')]('Searching\x20enduser\x20with\x20phone',_0x41eade);return request({'method':_0xc8b0('0x4d'),'uri':util[_0xc8b0('0xf')]('https://crm.%s/crm/private/json/Contacts/searchRecords',_0x24cf5b[_0xc8b0('0x2f')]),'qs':{'authtoken':_0x24cf5b[_0xc8b0('0x30')],'scope':_0xc8b0('0x31'),'criteria':util[_0xc8b0('0xf')](_0xc8b0('0x4e'),_0x41eade)},'json':!![]})[_0xc8b0('0x32')](function(_0x570bff){if(_0x570bff[_0xc8b0('0x35')]&&_0x570bff[_0xc8b0('0x35')]['result']){logger['info'](_0xc8b0('0x4f'));var _0x176ae9={};var _0x466b7d=_0x570bff['response'][_0xc8b0('0x36')][_0xc8b0('0x50')][_0xc8b0('0x51')]['no']?_0x570bff[_0xc8b0('0x35')][_0xc8b0('0x36')][_0xc8b0('0x50')]['row']['FL']:_0x570bff[_0xc8b0('0x35')]['result'][_0xc8b0('0x50')][_0xc8b0('0x51')][0x0]['FL'];for(var _0xf7a647=0x0,_0x2933f4=_0x466b7d[_0xc8b0('0x52')];_0xf7a647<_0x2933f4;_0xf7a647++){_0x176ae9[_0x466b7d[_0xf7a647][_0xc8b0('0x53')]]=_0x466b7d[_0xf7a647]['content'];}return _0x176ae9;}else{return request({'method':_0xc8b0('0x4d'),'uri':util[_0xc8b0('0xf')](_0xc8b0('0x54'),_0x24cf5b[_0xc8b0('0x2f')]),'qs':{'authtoken':_0x24cf5b[_0xc8b0('0x30')],'scope':_0xc8b0('0x31'),'criteria':util[_0xc8b0('0xf')]('((Phone:%s))',_0x41eade)},'json':!![]})[_0xc8b0('0x32')](function(_0x408758){if(_0x408758['response']&&_0x408758[_0xc8b0('0x35')][_0xc8b0('0x36')]){logger[_0xc8b0('0x9')](_0xc8b0('0x55'));var _0x2effa2={};var _0x3062d6=_0x408758[_0xc8b0('0x35')][_0xc8b0('0x36')][_0xc8b0('0x56')][_0xc8b0('0x51')]['no']?_0x408758[_0xc8b0('0x35')][_0xc8b0('0x36')][_0xc8b0('0x56')][_0xc8b0('0x51')]['FL']:_0x408758[_0xc8b0('0x35')][_0xc8b0('0x36')]['Leads']['row'][0x0]['FL'];for(var _0xfd31f8=0x0,_0x2f4909=_0x3062d6[_0xc8b0('0x52')];_0xfd31f8<_0x2f4909;_0xfd31f8++){_0x2effa2[_0x3062d6[_0xfd31f8][_0xc8b0('0x53')]]=_0x3062d6[_0xfd31f8][_0xc8b0('0x57')];}return _0x2effa2;}else{logger[_0xc8b0('0x9')](_0xc8b0('0x58'));_0x141636=getName(_0x141636);return request({'method':_0xc8b0('0x2d'),'uri':util[_0xc8b0('0xf')](_0xc8b0('0x59'),_0x24cf5b[_0xc8b0('0x2f')]),'qs':{'authtoken':_0x24cf5b[_0xc8b0('0x30')],'scope':_0xc8b0('0x31'),'xmlData':util[_0xc8b0('0xf')](_0xc8b0('0x5a'),entities['encodeXML'](_0x141636[0x0]),entities['encodeXML'](_0x141636[0x1]),_0x41eade)},'json':!![]})[_0xc8b0('0x32')](function(_0x11b541){_0x11b541=JSON[_0xc8b0('0x33')](parser[_0xc8b0('0x34')](_0x11b541));if(_0x11b541['response']){if(_0x11b541[_0xc8b0('0x35')][_0xc8b0('0x36')]&&_0x11b541[_0xc8b0('0x35')][_0xc8b0('0x36')][_0xc8b0('0x37')]){logger[_0xc8b0('0x9')](_0xc8b0('0x5b'));return request({'method':'GET','uri':util[_0xc8b0('0xf')](_0xc8b0('0x5c'),_0x24cf5b[_0xc8b0('0x2f')]),'qs':{'authtoken':_0x24cf5b[_0xc8b0('0x30')],'scope':_0xc8b0('0x31'),'id':_0x11b541[_0xc8b0('0x35')]['result']['recorddetail']['FL'][0x0]['$t']},'json':!![]});}}throw new Error(_0xc8b0('0x5d')+JSON[_0xc8b0('0x3a')](_0x11b541));})[_0xc8b0('0x32')](function(_0x34fa7a){if(_0x34fa7a[_0xc8b0('0x35')]){if(_0x34fa7a[_0xc8b0('0x35')][_0xc8b0('0x36')]){var _0x2b39d8={};for(var _0x4ee842=0x0,_0x4a612c=_0x34fa7a[_0xc8b0('0x35')][_0xc8b0('0x36')][_0xc8b0('0x56')]['row']['FL']['length'];_0x4ee842<_0x4a612c;_0x4ee842++){_0x2b39d8[_0x34fa7a[_0xc8b0('0x35')][_0xc8b0('0x36')][_0xc8b0('0x56')][_0xc8b0('0x51')]['FL'][_0x4ee842]['val']]=_0x34fa7a[_0xc8b0('0x35')][_0xc8b0('0x36')][_0xc8b0('0x56')][_0xc8b0('0x51')]['FL'][_0x4ee842][_0xc8b0('0x57')];}return _0x2b39d8;}}throw new Error(_0xc8b0('0x5e')+JSON['stringify'](_0x34fa7a));});}});}});}function request(_0x186ffd){logger[_0xc8b0('0x5f')](_0xc8b0('0x60'),JSON[_0xc8b0('0x3a')](_0x186ffd));return rp(_0x186ffd);}function getCustomFields(_0x280eb7,_0x10508f){var _0x4b13ae={};if(_0x280eb7[_0xc8b0('0x52')]>0x0){_['forEach'](_0x280eb7,function(_0x8d6291){if(_0x8d6291[_0xc8b0('0x61')]===_0xc8b0('0x62')&&_0x8d6291[_0xc8b0('0x63')]){_0x4b13ae[_0x8d6291[_0xc8b0('0x63')]]=_0x8d6291['content']['toString']();}else if(_0x8d6291[_0xc8b0('0x61')]===_0xc8b0('0x64')&&_0x8d6291[_0xc8b0('0x65')]&&_0x8d6291[_0xc8b0('0x63')]&&_0x10508f[_0x8d6291[_0xc8b0('0x65')]]){_0x4b13ae[_0x8d6291[_0xc8b0('0x63')]]=_0x10508f[_0x8d6291[_0xc8b0('0x65')]][_0xc8b0('0x66')]();}else if(_0x8d6291[_0xc8b0('0x61')]===_0xc8b0('0x67')&&_0x8d6291['Variable']&&_0x8d6291[_0xc8b0('0x68')][_0xc8b0('0x69')]&&_0x8d6291['idField']&&_0x10508f[_0x8d6291[_0xc8b0('0x68')]['name'][_0xc8b0('0x6a')]()]){_0x4b13ae[_0x8d6291[_0xc8b0('0x63')]]=_0x10508f[_0x8d6291[_0xc8b0('0x68')][_0xc8b0('0x69')][_0xc8b0('0x6a')]()][_0xc8b0('0x66')]();}});}return _0x4b13ae;}function getName(_0x2053b7){if(_0x2053b7[_0xc8b0('0x6b')]('\x20')>0x0){var _0x393866=_0x2053b7[_0xc8b0('0x6c')](/ (.+)/);if(_0x393866[0x1]){return _0x393866;}}return[_0x2053b7,_0x2053b7];}exports['queue']=function(_0x24f523,_0x45d8cd,_0x369da4,_0x497c81,_0x3ac5b9,_0xef64fd){var _0x395dcc,_0x21e4b9;_0xef64fd[_0xc8b0('0x2f')]=intUtil[_0xc8b0('0x6d')](_0xef64fd[_0xc8b0('0x2f')]);_0xef64fd['serverUrl']=intUtil['stripTrailingSlash'](_0xef64fd['serverUrl']);if(_0x3ac5b9&&_0x3ac5b9[_0xc8b0('0x6e')]){logger[_0xc8b0('0x9')](_0xc8b0('0x6f'),_0xc8b0('0x70'));_0x45d8cd[_0xc8b0('0x71')]=util[_0xc8b0('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xef64fd['serverUrl'],_0x45d8cd['uniqueid'],md5(_0x45d8cd['uniqueid']));}else{_0x45d8cd[_0xc8b0('0x71')]='';}return getUser(_0xef64fd,_0x497c81[_0xc8b0('0x72')])[_0xc8b0('0x32')](function(_0x11bf49){_0x395dcc=_0x11bf49;logger['info'](_0xc8b0('0x73'),_0x395dcc['id']);return getEndUser(_0xef64fd,_0x45d8cd['calleridname'],_0x45d8cd[_0xc8b0('0x74')]);})[_0xc8b0('0x32')](function(_0x5ccdeb){_0x21e4b9=_0x5ccdeb;logger[_0xc8b0('0x9')]('The\x20Enduser\x20ID\x20is:',_0x21e4b9[_0xc8b0('0x26')]||_0x21e4b9[_0xc8b0('0x27')]);return getCall(_0xef64fd,_0x395dcc,_0x21e4b9,_0x369da4,_0x45d8cd,'Inbound');})[_0xc8b0('0x32')](function(_0x692425){if(_0x692425){logger[_0xc8b0('0x9')](_0xc8b0('0x75'),_0x692425['id']);logger[_0xc8b0('0x9')](_0xc8b0('0x6f'),_0xc8b0('0x76'));emit(util['format'](_0xc8b0('0x77'),_0x497c81[_0xc8b0('0x69')]),_0xc8b0('0x78'),{'uri':util[_0xc8b0('0xf')](_0xc8b0('0x79'),_0xef64fd[_0xc8b0('0x2f')],_0x692425['id'])});}})[_0xc8b0('0x7a')](function(_0x40b9da){logger[_0xc8b0('0x4a')]('[QUEUE]',JSON[_0xc8b0('0x3a')](_0x40b9da));});};exports[_0xc8b0('0xc')]=function(_0x25cf3b,_0x4f289a,_0x502671,_0x48dac1,_0x9792f5,_0x5af7f2,_0x5ec2b0){var _0x25a197,_0x36765e;_0x5af7f2[_0xc8b0('0x2f')]=intUtil[_0xc8b0('0x6d')](_0x5af7f2[_0xc8b0('0x2f')]);_0x5af7f2[_0xc8b0('0x7b')]=intUtil['stripTrailingSlash'](_0x5af7f2[_0xc8b0('0x7b')]);if(_0x5ec2b0&&_0x5ec2b0[_0xc8b0('0x7c')]&&_0x5ec2b0[_0xc8b0('0x7c')]!==_0xc8b0('0x7d')){logger[_0xc8b0('0x9')](_0xc8b0('0x7e'),_0xc8b0('0x70'));_0x4f289a[_0xc8b0('0x71')]=util[_0xc8b0('0xf')](_0xc8b0('0x7f'),_0x5af7f2[_0xc8b0('0x7b')],_0x4f289a[_0xc8b0('0x80')],md5(_0x4f289a['uniqueid']));}return getUser(_0x5af7f2,_0x48dac1[_0xc8b0('0x72')])['then'](function(_0x212762){_0x25a197=_0x212762;logger['info'](_0xc8b0('0x73'),_0x25a197['id']);return getEndUser(_0x5af7f2,_0x4f289a[_0xc8b0('0x81')],_0x4f289a[_0xc8b0('0x82')]);})[_0xc8b0('0x32')](function(_0x10cd4a){_0x36765e=_0x10cd4a;logger['info'](_0xc8b0('0x83'),_0x36765e[_0xc8b0('0x26')]||_0x36765e[_0xc8b0('0x27')]);return getCall(_0x5af7f2,_0x25a197,_0x36765e,_0x502671,_0x4f289a,_0xc8b0('0x84'));})[_0xc8b0('0x32')](function(_0x3d5878){if(_0x3d5878){logger[_0xc8b0('0x9')](_0xc8b0('0x75'),_0x3d5878['id']);logger['info'](_0xc8b0('0x7e'),_0xc8b0('0x76'));emit(util[_0xc8b0('0xf')]('user:%s',_0x48dac1[_0xc8b0('0x69')]),_0xc8b0('0x78'),{'uri':util[_0xc8b0('0xf')](_0xc8b0('0x79'),_0x5af7f2['host'],_0x3d5878['id'])});}})[_0xc8b0('0x7a')](function(_0xc0cc36){logger['error'](_0xc8b0('0x7e'),JSON['stringify'](_0xc0cc36));});};exports['abandoned']=function(_0x5cd92f,_0x1b7c9a,_0x415a0b,_0x47e3a6,_0x4e5375,_0x73ca48){var _0x450b58,_0x27af02;_0x73ca48['host']=intUtil[_0xc8b0('0x6d')](_0x73ca48[_0xc8b0('0x2f')]);_0x73ca48[_0xc8b0('0x7b')]=intUtil['stripTrailingSlash'](_0x73ca48['serverUrl']);if(_0x4e5375&&_0x4e5375[_0xc8b0('0x6e')]){logger[_0xc8b0('0x9')](_0xc8b0('0x85'),'Recording\x20is\x20enabled!');_0x1b7c9a[_0xc8b0('0x71')]=util[_0xc8b0('0xf')](_0xc8b0('0x7f'),_0x73ca48[_0xc8b0('0x7b')],_0x1b7c9a['uniqueid'],md5(_0x1b7c9a['uniqueid']));}else{_0x1b7c9a['recordingURL']='';}return getUser(_0x73ca48)[_0xc8b0('0x32')](function(_0x3ac19e){_0x450b58=_0x3ac19e;logger[_0xc8b0('0x9')]('The\x20User\x20ID\x20is:',_0x450b58['id']);return getEndUser(_0x73ca48,_0x1b7c9a[_0xc8b0('0x86')],_0x1b7c9a[_0xc8b0('0x74')]);})[_0xc8b0('0x32')](function(_0x216101){_0x27af02=_0x216101;logger['info'](_0xc8b0('0x83'),_0x27af02[_0xc8b0('0x26')]||_0x27af02[_0xc8b0('0x27')]);return getCall(_0x73ca48,_0x450b58,_0x27af02,_0x415a0b,_0x1b7c9a,_0xc8b0('0x87'));})[_0xc8b0('0x32')](function(_0x14c320){if(_0x14c320){logger[_0xc8b0('0x9')]('The\x20Call\x20ID\x20is:',_0x14c320['id']);}})[_0xc8b0('0x7a')](function(_0x438d79){logger[_0xc8b0('0x4a')]('[ABANDONED]',JSON['stringify'](_0x438d79));});}; \ 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 6a6baa9..5af91e4 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(_0x3f43f5,_0x1a6de4){var _0x532e28=function(_0xf00594){while(--_0xf00594){_0x3f43f5['push'](_0x3f43f5['shift']());}};_0x532e28(++_0x1a6de4);}(_0x7a54,0x106));var _0x47a5=function(_0x15f8c5,_0x447fdf){_0x15f8c5=_0x15f8c5-0x0;var _0x1e1677=_0x7a54[_0x15f8c5];return _0x1e1677;};'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(_0x29980f,_0x487955){var _0x10ce8a=function(_0x139647){while(--_0x139647){_0x29980f['push'](_0x29980f['shift']());}};_0x10ce8a(++_0x487955);}(_0x7a54,0x106));var _0x47a5=function(_0x36b7c0,_0xf51b0f){_0x36b7c0=_0x36b7c0-0x0;var _0x24b30a=_0x7a54[_0x36b7c0];return _0x24b30a;};'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 e898079..825fa74 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 _0xb19a=['stringify','then',',\x20request\x20body:\x20','body','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise','mustache','exec','data1','render','data2','data6','error','stack','toUpperCase','GET','POST','PUT','data7','parse','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s'];(function(_0x4ce08f,_0x34aa36){var _0x2e0d2c=function(_0x4589f6){while(--_0x4589f6){_0x4ce08f['push'](_0x4ce08f['shift']());}};_0x2e0d2c(++_0x34aa36);}(_0xb19a,0xd0));var _0xab19=function(_0x373858,_0xd24b55){_0x373858=_0x373858-0x0;var _0x375ccb=_0xb19a[_0x373858];return _0x375ccb;};'use strict';var rp=require(_0xab19('0x0'));var util=require('util');var _=require('lodash');var Mustache=require(_0xab19('0x1'));var logger=require('../../../../config/logger')('trigger');exports[_0xab19('0x2')]=function(_0xc5e5df,_0x20333b){var _0x3b7129,_0x2e1aed;var _0x6ec577={'method':_0xc5e5df[_0xab19('0x3')]['toUpperCase'](),'uri':encodeURI(Mustache[_0xab19('0x4')](_0xc5e5df[_0xab19('0x5')],_0x20333b)),'json':!![],'resolveWithFullResponse':!![]};try{_0x6ec577['headers']=_0xc5e5df[_0xab19('0x6')]?JSON['parse'](Mustache[_0xab19('0x4')](_0xc5e5df[_0xab19('0x6')],_0x20333b)):{};}catch(_0x2c6a67){logger[_0xab19('0x7')](_0x2c6a67[_0xab19('0x8')]);}switch(_0xc5e5df[_0xab19('0x3')][_0xab19('0x9')]()){case _0xab19('0xa'):_0x6ec577['qs']=_0x20333b;break;case _0xab19('0xb'):case _0xab19('0xc'):_0x3b7129={};if(_0xc5e5df[_0xab19('0xd')]){_0x3b7129=Mustache[_0xab19('0x4')](_0xc5e5df['data7'],_0x20333b);}else{_0x3b7129=_0x20333b;}_0x6ec577['body']=JSON[_0xab19('0xe')](_0x3b7129);break;}logger['info'](util[_0xab19('0xf')](_0xab19('0x10'),_0xc5e5df[_0xab19('0x3')],_0xc5e5df[_0xab19('0x5')],JSON[_0xab19('0x11')](_0x6ec577)));rp(_0x6ec577)[_0xab19('0x12')](function(_0x10fc99){_0x3b7129=!_['isNil'](_0x3b7129)?_0xab19('0x13')+_0x3b7129:'';_0x2e1aed=typeof _0x10fc99[_0xab19('0x14')]==='object'?JSON[_0xab19('0x11')](_0x10fc99[_0xab19('0x14')]):_0x10fc99['body'];logger['info'](util[_0xab19('0xf')](_0xab19('0x15'),_0xc5e5df[_0xab19('0x3')],_0xc5e5df[_0xab19('0x5')],_0x10fc99['statusCode'],_0x2e1aed));})[_0xab19('0x16')](function(_0x45d2bc){logger['error'](util[_0xab19('0xf')](_0xab19('0x17'),_0xc5e5df[_0xab19('0x3')],_0xc5e5df['data2'],_0x45d2bc['statusCode'],_0x45d2bc['name'],_0x45d2bc[_0xab19('0x18')]));});}; \ No newline at end of file +var _0x8769=['statusCode','name','request-promise','util','mustache','trigger','exec','data1','toUpperCase','data2','headers','data6','parse','render','error','stack','GET','POST','PUT','data7','info','stringify','then','isNil','body','object','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s'];(function(_0x20d87e,_0x199ccd){var _0x293015=function(_0x4788e5){while(--_0x4788e5){_0x20d87e['push'](_0x20d87e['shift']());}};_0x293015(++_0x199ccd);}(_0x8769,0x110));var _0x9876=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x8769[_0x101e7b];return _0x4995c0;};'use strict';var rp=require(_0x9876('0x0'));var util=require(_0x9876('0x1'));var _=require('lodash');var Mustache=require(_0x9876('0x2'));var logger=require('../../../../config/logger')(_0x9876('0x3'));exports[_0x9876('0x4')]=function(_0x5db67f,_0x4f7b6b){var _0x2a6a2b,_0x34f712;var _0x5bcfdf={'method':_0x5db67f[_0x9876('0x5')][_0x9876('0x6')](),'uri':encodeURI(Mustache['render'](_0x5db67f[_0x9876('0x7')],_0x4f7b6b)),'json':!![],'resolveWithFullResponse':!![]};try{_0x5bcfdf[_0x9876('0x8')]=_0x5db67f[_0x9876('0x9')]?JSON[_0x9876('0xa')](Mustache[_0x9876('0xb')](_0x5db67f[_0x9876('0x9')],_0x4f7b6b)):{};}catch(_0xe97c24){logger[_0x9876('0xc')](_0xe97c24[_0x9876('0xd')]);}switch(_0x5db67f[_0x9876('0x5')][_0x9876('0x6')]()){case _0x9876('0xe'):_0x5bcfdf['qs']=_0x4f7b6b;break;case _0x9876('0xf'):case _0x9876('0x10'):_0x2a6a2b={};if(_0x5db67f[_0x9876('0x11')]){_0x2a6a2b=Mustache['render'](_0x5db67f[_0x9876('0x11')],_0x4f7b6b);}else{_0x2a6a2b=_0x4f7b6b;}_0x5bcfdf['body']=JSON[_0x9876('0xa')](_0x2a6a2b);break;}logger[_0x9876('0x12')](util['format']('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x5db67f[_0x9876('0x5')],_0x5db67f['data2'],JSON[_0x9876('0x13')](_0x5bcfdf)));rp(_0x5bcfdf)[_0x9876('0x14')](function(_0xce611){_0x2a6a2b=!_[_0x9876('0x15')](_0x2a6a2b)?',\x20request\x20body:\x20'+_0x2a6a2b:'';_0x34f712=typeof _0xce611[_0x9876('0x16')]===_0x9876('0x17')?JSON[_0x9876('0x13')](_0xce611[_0x9876('0x16')]):_0xce611[_0x9876('0x16')];logger[_0x9876('0x12')](util[_0x9876('0x18')](_0x9876('0x19'),_0x5db67f[_0x9876('0x5')],_0x5db67f[_0x9876('0x7')],_0xce611['statusCode'],_0x34f712));})[_0x9876('0x1a')](function(_0x1239ba){logger['error'](util[_0x9876('0x18')](_0x9876('0x1b'),_0x5db67f[_0x9876('0x5')],_0x5db67f[_0x9876('0x7')],_0x1239ba[_0x9876('0x1c')],_0x1239ba[_0x9876('0x1d')],_0x1239ba['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 19bb132..92bda2e 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 _0xf006=['catch','exports','../../config/logger','routing','http','request','then','debug','error','rpc','message','result'];(function(_0x4452dc,_0x479149){var _0x52b892=function(_0x4a0098){while(--_0x4a0098){_0x4452dc['push'](_0x4452dc['shift']());}};_0x52b892(++_0x479149);}(_0xf006,0x146));var _0x6f00=function(_0x3da1b1,_0x2d9081){_0x3da1b1=_0x3da1b1-0x0;var _0x2403ce=_0xf006[_0x3da1b1];return _0x2403ce;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x6f00('0x0'))(_0x6f00('0x1'));var client=jayson['client'][_0x6f00('0x2')]({'port':0x2329});client['Request']=function(_0x1c7a9e,_0x4f4466){return new BPromise(function(_0x5039fb,_0x44a0f9){return client[_0x6f00('0x3')](_0x1c7a9e,_0x4f4466)[_0x6f00('0x4')](function(_0x52c9a2){logger[_0x6f00('0x5')]('rpc',_0x6f00('0x1'),_0x1c7a9e,_0x4f4466,_0x52c9a2);if(_0x52c9a2[_0x6f00('0x6')]){logger[_0x6f00('0x6')](_0x6f00('0x7'),_0x6f00('0x1'),_0x1c7a9e,_0x52c9a2[_0x6f00('0x6')][_0x6f00('0x8')],_0x4f4466);return _0x44a0f9(_0x52c9a2[_0x6f00('0x6')][_0x6f00('0x8')]);}else{return _0x5039fb(_0x52c9a2[_0x6f00('0x9')]);}})[_0x6f00('0xa')](function(_0x13b052){logger[_0x6f00('0x6')]('rpc',_0x6f00('0x1'),_0x1c7a9e,_0x13b052,_0x4f4466);return _0x44a0f9(_0x13b052);});});};module[_0x6f00('0xb')]=client; \ No newline at end of file +var _0x1da1=['jayson/promise','bluebird','../../config/logger','routing','client','request','then','error','rpc','message','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1da1,0x1a4));var _0x11da=function(_0x323c14,_0x38c049){_0x323c14=_0x323c14-0x0;var _0x35d84d=_0x1da1[_0x323c14];return _0x35d84d;};'use strict';var jayson=require(_0x11da('0x0'));var BPromise=require(_0x11da('0x1'));var logger=require(_0x11da('0x2'))(_0x11da('0x3'));var client=jayson[_0x11da('0x4')]['http']({'port':0x2329});client['Request']=function(_0x23014b,_0x1beca5){return new BPromise(function(_0x3d6bd5,_0x4d265f){return client[_0x11da('0x5')](_0x23014b,_0x1beca5)[_0x11da('0x6')](function(_0x15c324){logger['debug']('rpc',_0x11da('0x3'),_0x23014b,_0x1beca5,_0x15c324);if(_0x15c324[_0x11da('0x7')]){logger['error'](_0x11da('0x8'),_0x11da('0x3'),_0x23014b,_0x15c324['error'][_0x11da('0x9')],_0x1beca5);return _0x4d265f(_0x15c324[_0x11da('0x7')][_0x11da('0x9')]);}else{return _0x3d6bd5(_0x15c324[_0x11da('0xa')]);}})[_0x11da('0xb')](function(_0x37e537){logger[_0x11da('0x7')](_0x11da('0x8'),_0x11da('0x3'),_0x23014b,_0x37e537,_0x1beca5);return _0x4d265f(_0x37e537);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 1c2801e..cc47bd2 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 _0x84b8=['then','getMailAccounts','initMailAccounts','refresh','listen','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','resolve'];(function(_0x46e47b,_0x550179){var _0x4c00aa=function(_0x2c28c7){while(--_0x2c28c7){_0x46e47b['push'](_0x46e47b['shift']());}};_0x4c00aa(++_0x550179);}(_0x84b8,0x102));var _0x884b=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x84b8[_0x618414];return _0x21c19a;};'use strict';var BPromise=require(_0x884b('0x0'));var server=require(_0x884b('0x1'));var Realtime=require(_0x884b('0x2'));var EmailChannel=require(_0x884b('0x3'));var mailAccount=require(_0x884b('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x884b('0x5')]()[_0x884b('0x6')](mailAccount[_0x884b('0x7')]())['then'](realtime[_0x884b('0x8')]())[_0x884b('0x6')](function(){email[_0x884b('0x9')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x884b('0xa')](realtime,email)['then'](function(_0x54707e){return initRealtime();})[_0x884b('0x6')](function(_0x456565){return setInterval(initRealtime,0x2710);})['catch'](function(_0x4d5355){console['log'](_0x4d5355);});}main(); \ No newline at end of file +var _0xb448=['log','bluebird','./realtime','./rpc/mailAccount','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','catch'];(function(_0x59bbbd,_0x53d361){var _0x63aa27=function(_0x4b34c7){while(--_0x4b34c7){_0x59bbbd['push'](_0x59bbbd['shift']());}};_0x63aa27(++_0x53d361);}(_0xb448,0x1e5));var _0x8b44=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xb448[_0x413feb];return _0x40ee88;};'use strict';var BPromise=require(_0x8b44('0x0'));var server=require('./server');var Realtime=require(_0x8b44('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x8b44('0x2'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0x8b44('0x3')](mailAccount[_0x8b44('0x4')]())[_0x8b44('0x3')](realtime[_0x8b44('0x5')]())[_0x8b44('0x3')](function(){email[_0x8b44('0x6')](realtime[_0x8b44('0x7')]);return realtime;});}function main(){return server[_0x8b44('0x8')](realtime,email)['then'](function(_0x45bd2e){return initRealtime();})[_0x8b44('0x3')](function(_0x22a88f){return setInterval(initRealtime,0x2710);})[_0x8b44('0x9')](function(_0x48831d){console[_0x8b44('0xa')](_0x48831d);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index b7cac2a..a07982d 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 _0xc6ac=['moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','name','key','status','Imap','messageStatus','isNil','stringify','mailAccount:update','prototype','hasOwnProperty','active','box','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','connected','messages','total','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','verifySmtp','Smtp','verify','verified','exports','lodash'];(function(_0x14e00d,_0x10205d){var _0x534f4d=function(_0x7f016a){while(--_0x7f016a){_0x14e00d['push'](_0x14e00d['shift']());}};_0x534f4d(++_0x10205d);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x241035,_0x222336){_0x241035=_0x241035-0x0;var _0xcbf689=_0xc6ac[_0x241035];return _0xcbf689;};'use strict';var _=require(_0xcc6a('0x0'));var moment=require(_0xcc6a('0x1'));var BPromise=require(_0xcc6a('0x2'));var md5=require(_0xcc6a('0x3'));var Redis=require(_0xcc6a('0x4'));var config=require(_0xcc6a('0x5'));var logger=require(_0xcc6a('0x6'))(_0xcc6a('0x7'));config[_0xcc6a('0x8')]=_[_0xcc6a('0x9')](config[_0xcc6a('0x8')],{'host':_0xcc6a('0xa'),'port':0x18eb});var io=require(_0xcc6a('0xb'))(new Redis(config[_0xcc6a('0x8')]));var EmailImap=require('./imap');var EmailSmtp=require(_0xcc6a('0xc'));var mailAccount=require(_0xcc6a('0xd'));var md5Accounts={};function EmailChannel(_0xf02261){logger['info'](_0xcc6a('0xe'));this[_0xcc6a('0xf')]=_0xf02261[_0xcc6a('0xf')];this[_0xcc6a('0x10')]={};this[_0xcc6a('0x11')]=new EmailSmtp();}EmailChannel['prototype'][_0xcc6a('0x12')]=function(_0x290119){var _0x109693=this['mailAccounts'][_0x290119];var _0x1d91a5={'id':_0x109693['id'],'name':_0x109693[_0xcc6a('0x13')],'key':_0x109693[_0xcc6a('0x14')],'active':_0x109693['active'],'Imap':{'status':_0x109693['Imap'][_0xcc6a('0x15')],'messageStatus':_0x109693[_0xcc6a('0x16')][_0xcc6a('0x17')],'total':_0x109693['Imap']['total']}};if(_[_0xcc6a('0x18')](md5Accounts[_0x290119])){md5Accounts[_0x290119]={};}var _0xcb9e2e=md5(JSON[_0xcc6a('0x19')](_0x1d91a5));if(md5Accounts[_0x290119][_0xcc6a('0x3')]!==_0xcb9e2e){md5Accounts[_0x290119][_0xcc6a('0x3')]=_0xcb9e2e;io[_0xcc6a('0x12')](_0xcc6a('0x1a'),_0x1d91a5);}};EmailChannel[_0xcc6a('0x1b')]['refresh']=function(_0x4e628f){for(var _0x4d021a in _0x4e628f){if(_0x4e628f[_0xcc6a('0x1c')](_0x4d021a)){if(_0x4e628f[_0x4d021a][_0xcc6a('0x16')]&&_0x4e628f[_0x4d021a][_0xcc6a('0x1d')]){var _0x3e63d9=_0x4e628f[_0x4d021a][_0xcc6a('0x16')];if(!this[_0xcc6a('0x10')][_0xcc6a('0x1c')](_0x3e63d9['id'])){this[_0xcc6a('0x10')][_0x3e63d9['id']]=new EmailImap(_0x3e63d9,_0x4e628f[_0x4d021a][_0xcc6a('0x7')]);this[_0xcc6a('0x10')][_0x3e63d9['id']]['on'](_0xcc6a('0x1e'),this['handleImapBox'][_0xcc6a('0x1f')](this,_0x4d021a));this[_0xcc6a('0x10')][_0x3e63d9['id']]['on'](_0xcc6a('0x7'),this[_0xcc6a('0x20')][_0xcc6a('0x1f')](this,_0x4d021a));this[_0xcc6a('0x10')][_0x3e63d9['id']]['on'](_0xcc6a('0x21'),this[_0xcc6a('0x22')][_0xcc6a('0x1f')](this,_0x4d021a));this[_0xcc6a('0x10')][_0x3e63d9['id']]['on'](_0xcc6a('0x23'),this[_0xcc6a('0x24')]['bind'](this,_0x4d021a));}}else{if(_[_0xcc6a('0x18')](this[_0xcc6a('0xf')][_0x4d021a][_0xcc6a('0x16')])){this['mailAccounts'][_0x4d021a][_0xcc6a('0x16')]={};}this[_0xcc6a('0xf')][_0x4d021a][_0xcc6a('0x16')][_0xcc6a('0x15')]=_0xcc6a('0x25');this[_0xcc6a('0xf')][_0x4d021a]['Imap'][_0xcc6a('0x17')]='';this[_0xcc6a('0x12')](_0x4d021a);}}}};EmailChannel[_0xcc6a('0x1b')]['handleImapBox']=function(_0x3afb3a,_0x3dad72){if(this['mailAccounts'][_0x3afb3a]){this[_0xcc6a('0xf')][_0x3afb3a][_0xcc6a('0x16')][_0xcc6a('0x15')]=_0xcc6a('0x26');this['mailAccounts'][_0x3afb3a][_0xcc6a('0x16')][_0xcc6a('0x17')]=_0x3dad72[_0xcc6a('0x13')];if(_0x3dad72['messages']){this[_0xcc6a('0xf')][_0x3afb3a]['Imap']['total']=_0x3dad72[_0xcc6a('0x27')][_0xcc6a('0x28')];}return this[_0xcc6a('0x12')](_0x3afb3a);}};EmailChannel[_0xcc6a('0x1b')][_0xcc6a('0x20')]=function(_0x131138,_0x4e2de4){logger[_0xcc6a('0x29')](_0xcc6a('0x2a'),_0x4e2de4[_0xcc6a('0x2b')],_0x4e2de4[_0xcc6a('0x2c')],_0x4e2de4[_0xcc6a('0x2d')],_0x131138);if(this[_0xcc6a('0xf')][_0x131138]){return mailAccount[_0xcc6a('0x2e')](_0x131138,_0x4e2de4)[_0xcc6a('0x2f')](function(_0x5bb39d){if(_0x5bb39d){logger[_0xcc6a('0x29')](_0xcc6a('0x30'));}})[_0xcc6a('0x31')](function(_0x1538bc){logger[_0xcc6a('0x23')](_0xcc6a('0x32'),JSON[_0xcc6a('0x19')](_0x1538bc));});}};EmailChannel['prototype'][_0xcc6a('0x22')]=function(_0x5a41b4){if(this['mailAccounts'][_0x5a41b4]&&this['mailAccounts'][_0x5a41b4][_0xcc6a('0x16')]){if(this[_0xcc6a('0x10')][this[_0xcc6a('0xf')][_0x5a41b4][_0xcc6a('0x16')]['id']]){delete this[_0xcc6a('0x10')][this['mailAccounts'][_0x5a41b4]['Imap']['id']];}this[_0xcc6a('0xf')][_0x5a41b4][_0xcc6a('0x16')][_0xcc6a('0x33')]=moment();this['emit'](_0x5a41b4);}};EmailChannel[_0xcc6a('0x1b')][_0xcc6a('0x24')]=function(_0x7449c1,_0xa326b2){if(this[_0xcc6a('0xf')][_0x7449c1]){this[_0xcc6a('0xf')][_0x7449c1][_0xcc6a('0x16')][_0xcc6a('0x15')]=_0xcc6a('0x23');this[_0xcc6a('0xf')][_0x7449c1][_0xcc6a('0x16')][_0xcc6a('0x17')]=_0xa326b2;return this[_0xcc6a('0x12')](_0x7449c1);}};EmailChannel[_0xcc6a('0x1b')][_0xcc6a('0x34')]=function(_0x33e8c8,_0x11e5b1){return this[_0xcc6a('0x11')]['send'](_0x33e8c8,_0x11e5b1);};EmailChannel['prototype'][_0xcc6a('0x35')]=function(_0x42d7af){var _0x16dde7=this;if(this[_0xcc6a('0xf')][_0x42d7af['id']]){if(_[_0xcc6a('0x18')](this[_0xcc6a('0xf')][_0x42d7af['id']][_0xcc6a('0x36')])){this[_0xcc6a('0xf')][_0x42d7af['id']]['Smtp']={};}this['mailAccounts'][_0x42d7af['id']][_0xcc6a('0x36')]['lastSync']=moment();return new BPromise(function(_0x578525,_0x5cf1ba){return _0x16dde7[_0xcc6a('0x11')][_0xcc6a('0x37')](_0x42d7af)[_0xcc6a('0x2f')](function(_0x46e273){_0x16dde7[_0xcc6a('0xf')][_0x42d7af['id']]['Smtp'][_0xcc6a('0x15')]=_0xcc6a('0x38');_0x16dde7[_0xcc6a('0xf')][_0x42d7af['id']][_0xcc6a('0x36')][_0xcc6a('0x17')]='';_0x16dde7[_0xcc6a('0x12')](_0x42d7af['id']);_0x578525(_0x46e273);})['catch'](function(_0x4447cc){_0x16dde7[_0xcc6a('0xf')][_0x42d7af['id']][_0xcc6a('0x36')][_0xcc6a('0x15')]='error';_0x16dde7[_0xcc6a('0xf')][_0x42d7af['id']]['Smtp'][_0xcc6a('0x17')]=_0x4447cc;_0x16dde7[_0xcc6a('0x12')](_0x42d7af['id']);_0x5cf1ba(_0x4447cc);});});}return this[_0xcc6a('0x11')]['verify'](_0x42d7af);};module[_0xcc6a('0x39')]=EmailChannel; \ No newline at end of file +var _0xba18=['total','isNil','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','bind','end','handleImapEnd','handleImapError','disabled','messageStatus','connected','messages','handleImapEmail','info','firstName','from','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','sendMail','smtp','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','defaults','redis','localhost','socket.io-emitter','./imap','../rpc/mailAccount','mailAccounts','imapAccounts','prototype','emit','name','key','active','Imap','status'];(function(_0x40f408,_0xdfc7ec){var _0x347847=function(_0x5151a6){while(--_0x5151a6){_0x40f408['push'](_0x40f408['shift']());}};_0x347847(++_0xdfc7ec);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8ba1('0x0'));var moment=require(_0x8ba1('0x1'));var BPromise=require(_0x8ba1('0x2'));var md5=require(_0x8ba1('0x3'));var Redis=require(_0x8ba1('0x4'));var config=require(_0x8ba1('0x5'));var logger=require(_0x8ba1('0x6'))(_0x8ba1('0x7'));config['redis']=_[_0x8ba1('0x8')](config[_0x8ba1('0x9')],{'host':_0x8ba1('0xa'),'port':0x18eb});var io=require(_0x8ba1('0xb'))(new Redis(config[_0x8ba1('0x9')]));var EmailImap=require(_0x8ba1('0xc'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x8ba1('0xd'));var md5Accounts={};function EmailChannel(_0x3d1fe7){logger['info']('start\x20email\x20channel');this['mailAccounts']=_0x3d1fe7[_0x8ba1('0xe')];this[_0x8ba1('0xf')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x8ba1('0x10')][_0x8ba1('0x11')]=function(_0x460e69){var _0x443ec3=this[_0x8ba1('0xe')][_0x460e69];var _0x4c270f={'id':_0x443ec3['id'],'name':_0x443ec3[_0x8ba1('0x12')],'key':_0x443ec3[_0x8ba1('0x13')],'active':_0x443ec3[_0x8ba1('0x14')],'Imap':{'status':_0x443ec3[_0x8ba1('0x15')][_0x8ba1('0x16')],'messageStatus':_0x443ec3[_0x8ba1('0x15')]['messageStatus'],'total':_0x443ec3[_0x8ba1('0x15')][_0x8ba1('0x17')]}};if(_[_0x8ba1('0x18')](md5Accounts[_0x460e69])){md5Accounts[_0x460e69]={};}var _0xca53c4=md5(JSON['stringify'](_0x4c270f));if(md5Accounts[_0x460e69]['md5']!==_0xca53c4){md5Accounts[_0x460e69]['md5']=_0xca53c4;io[_0x8ba1('0x11')](_0x8ba1('0x19'),_0x4c270f);}};EmailChannel[_0x8ba1('0x10')][_0x8ba1('0x1a')]=function(_0xc72b8d){for(var _0x3880aa in _0xc72b8d){if(_0xc72b8d[_0x8ba1('0x1b')](_0x3880aa)){if(_0xc72b8d[_0x3880aa][_0x8ba1('0x15')]&&_0xc72b8d[_0x3880aa][_0x8ba1('0x14')]){var _0x245929=_0xc72b8d[_0x3880aa]['Imap'];if(!this['imapAccounts'][_0x8ba1('0x1b')](_0x245929['id'])){this[_0x8ba1('0xf')][_0x245929['id']]=new EmailImap(_0x245929,_0xc72b8d[_0x3880aa]['email']);this[_0x8ba1('0xf')][_0x245929['id']]['on'](_0x8ba1('0x1c'),this[_0x8ba1('0x1d')][_0x8ba1('0x1e')](this,_0x3880aa));this[_0x8ba1('0xf')][_0x245929['id']]['on'](_0x8ba1('0x7'),this['handleImapEmail'][_0x8ba1('0x1e')](this,_0x3880aa));this['imapAccounts'][_0x245929['id']]['on'](_0x8ba1('0x1f'),this[_0x8ba1('0x20')][_0x8ba1('0x1e')](this,_0x3880aa));this[_0x8ba1('0xf')][_0x245929['id']]['on']('error',this[_0x8ba1('0x21')][_0x8ba1('0x1e')](this,_0x3880aa));}}else{if(_[_0x8ba1('0x18')](this[_0x8ba1('0xe')][_0x3880aa][_0x8ba1('0x15')])){this[_0x8ba1('0xe')][_0x3880aa][_0x8ba1('0x15')]={};}this[_0x8ba1('0xe')][_0x3880aa][_0x8ba1('0x15')][_0x8ba1('0x16')]=_0x8ba1('0x22');this['mailAccounts'][_0x3880aa]['Imap'][_0x8ba1('0x23')]='';this[_0x8ba1('0x11')](_0x3880aa);}}}};EmailChannel['prototype'][_0x8ba1('0x1d')]=function(_0xef508d,_0x2b1f46){if(this[_0x8ba1('0xe')][_0xef508d]){this[_0x8ba1('0xe')][_0xef508d][_0x8ba1('0x15')][_0x8ba1('0x16')]=_0x8ba1('0x24');this[_0x8ba1('0xe')][_0xef508d][_0x8ba1('0x15')][_0x8ba1('0x23')]=_0x2b1f46[_0x8ba1('0x12')];if(_0x2b1f46[_0x8ba1('0x25')]){this[_0x8ba1('0xe')][_0xef508d]['Imap'][_0x8ba1('0x17')]=_0x2b1f46[_0x8ba1('0x25')][_0x8ba1('0x17')];}return this[_0x8ba1('0x11')](_0xef508d);}};EmailChannel[_0x8ba1('0x10')][_0x8ba1('0x26')]=function(_0x52b9c6,_0x35378e){logger[_0x8ba1('0x27')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x35378e[_0x8ba1('0x28')],_0x35378e['lastName'],_0x35378e[_0x8ba1('0x29')],_0x52b9c6);if(this[_0x8ba1('0xe')][_0x52b9c6]){return mailAccount['notify'](_0x52b9c6,_0x35378e)[_0x8ba1('0x2a')](function(_0x40b97c){if(_0x40b97c){logger[_0x8ba1('0x27')](_0x8ba1('0x2b'));}})[_0x8ba1('0x2c')](function(_0x58d923){logger[_0x8ba1('0x2d')](_0x8ba1('0x2e'),JSON[_0x8ba1('0x2f')](_0x58d923));});}};EmailChannel[_0x8ba1('0x10')][_0x8ba1('0x20')]=function(_0x2abd37){if(this[_0x8ba1('0xe')][_0x2abd37]&&this[_0x8ba1('0xe')][_0x2abd37]['Imap']){if(this[_0x8ba1('0xf')][this[_0x8ba1('0xe')][_0x2abd37][_0x8ba1('0x15')]['id']]){delete this[_0x8ba1('0xf')][this[_0x8ba1('0xe')][_0x2abd37][_0x8ba1('0x15')]['id']];}this[_0x8ba1('0xe')][_0x2abd37][_0x8ba1('0x15')][_0x8ba1('0x30')]=moment();this[_0x8ba1('0x11')](_0x2abd37);}};EmailChannel['prototype'][_0x8ba1('0x21')]=function(_0x22cbd1,_0x146104){if(this[_0x8ba1('0xe')][_0x22cbd1]){this[_0x8ba1('0xe')][_0x22cbd1][_0x8ba1('0x15')][_0x8ba1('0x16')]=_0x8ba1('0x2d');this[_0x8ba1('0xe')][_0x22cbd1][_0x8ba1('0x15')]['messageStatus']=_0x146104;return this['emit'](_0x22cbd1);}};EmailChannel[_0x8ba1('0x10')][_0x8ba1('0x31')]=function(_0x1463e9,_0x58e6fb){return this[_0x8ba1('0x32')][_0x8ba1('0x33')](_0x1463e9,_0x58e6fb);};EmailChannel[_0x8ba1('0x10')][_0x8ba1('0x34')]=function(_0x2506f0){var _0x2305ff=this;if(this[_0x8ba1('0xe')][_0x2506f0['id']]){if(_[_0x8ba1('0x18')](this[_0x8ba1('0xe')][_0x2506f0['id']][_0x8ba1('0x35')])){this['mailAccounts'][_0x2506f0['id']][_0x8ba1('0x35')]={};}this[_0x8ba1('0xe')][_0x2506f0['id']][_0x8ba1('0x35')][_0x8ba1('0x30')]=moment();return new BPromise(function(_0x5d4821,_0x5828bf){return _0x2305ff[_0x8ba1('0x32')][_0x8ba1('0x36')](_0x2506f0)[_0x8ba1('0x2a')](function(_0x3430d4){_0x2305ff[_0x8ba1('0xe')][_0x2506f0['id']]['Smtp'][_0x8ba1('0x16')]=_0x8ba1('0x37');_0x2305ff[_0x8ba1('0xe')][_0x2506f0['id']]['Smtp'][_0x8ba1('0x23')]='';_0x2305ff[_0x8ba1('0x11')](_0x2506f0['id']);_0x5d4821(_0x3430d4);})[_0x8ba1('0x2c')](function(_0x30109d){_0x2305ff[_0x8ba1('0xe')][_0x2506f0['id']][_0x8ba1('0x35')]['status']=_0x8ba1('0x2d');_0x2305ff['mailAccounts'][_0x2506f0['id']][_0x8ba1('0x35')][_0x8ba1('0x23')]=_0x30109d;_0x2305ff[_0x8ba1('0x11')](_0x2506f0['id']);_0x5828bf(_0x30109d);});});}return this[_0x8ba1('0x32')][_0x8ba1('0x36')](_0x2506f0);};module[_0x8ba1('0x38')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index c494ae7..fddecdb 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 _0x0e0f=['INBOX','account','getAccount','imap','ready','handleReady','bind','handleError','connect','connTimeout','authTimeout','service','authentication','user','password','host','port','tls','anonymous@xcally.com','prototype','handleOpenBox','emit','box','handleCloseBox','end','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','error','handleFetchError','once','closeBox','body','handleMessageBody','attributes','handleMessageEnd','handleMessageAttributes','handleSimpleParser','parser','handleFetchEnd','handleEnd','stringify','textCode','upperFirst','path','lodash','randomstring','mailparser','simpleParser','iconv','events','EventEmitter','../../../config/logger','email','mailbox'];(function(_0x3be577,_0x33c662){var _0x10bbd8=function(_0x42141f){while(--_0x42141f){_0x3be577['push'](_0x3be577['shift']());}};_0x10bbd8(++_0x33c662);}(_0x0e0f,0xe5));var _0xf0e0=function(_0x332b4a,_0x2e34fa){_0x332b4a=_0x332b4a-0x0;var _0x1d8886=_0x0e0f[_0x332b4a];return _0x1d8886;};'use strict';var fs=require('fs');var path=require(_0xf0e0('0x0'));var util=require('util');var Imap=require('imap');var _=require(_0xf0e0('0x1'));var rs=require(_0xf0e0('0x2'));var simpleParser=require(_0xf0e0('0x3'))[_0xf0e0('0x4')];var Iconv=require(_0xf0e0('0x5'))['Iconv'];var EventEmitter=require(_0xf0e0('0x6'))[_0xf0e0('0x7')];var utils=require('./utils');var logger=require(_0xf0e0('0x8'))(_0xf0e0('0x9'));function EmailImap(_0x46bd04,_0x295495){this[_0xf0e0('0xa')]=_0xf0e0('0xb');this[_0xf0e0('0xc')]=this[_0xf0e0('0xd')](_0x46bd04,_0x295495);this[_0xf0e0('0xe')]=new Imap(this['account']);this[_0xf0e0('0xe')]['once'](_0xf0e0('0xf'),this[_0xf0e0('0x10')][_0xf0e0('0x11')](this));this['imap']['once']('end',this['handleEnd'][_0xf0e0('0x11')](this));this['imap']['on']('error',this[_0xf0e0('0x12')]['bind'](this));this[_0xf0e0('0xe')][_0xf0e0('0x13')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0xf0e0('0xd')]=function(_0x5b3719,_0xaf664b){var _0x522ac0={'connTimeout':_0x5b3719[_0xf0e0('0x14')]?_0x5b3719['connTimeout']*0x3e8:0x2710,'authTimeout':_0x5b3719[_0xf0e0('0x15')]?_0x5b3719[_0xf0e0('0x15')]*0x3e8:0x1388};if(_['isNil'](_0x5b3719[_0xf0e0('0x16')])){if(_0x5b3719[_0xf0e0('0x17')]){_0x522ac0[_0xf0e0('0x18')]=_0x5b3719[_0xf0e0('0x18')];_0x522ac0['password']=_0x5b3719[_0xf0e0('0x19')];}_0x522ac0[_0xf0e0('0x1a')]=_0x5b3719['host'];_0x522ac0['port']=_0x5b3719[_0xf0e0('0x1b')]||0x3e1;if(_0x5b3719[_0xf0e0('0x1c')]){_0x522ac0['tls']=!![];}else{_0x522ac0[_0xf0e0('0x1c')]=![];_0x522ac0['autotls']='required';}}else{_0x522ac0['user']=_0x5b3719[_0xf0e0('0x18')];_0x522ac0[_0xf0e0('0x19')]=_0x5b3719['password'];_0x522ac0['host']=utils['getHost'](_0x5b3719[_0xf0e0('0x16')]);_0x522ac0['port']=0x3e1;_0x522ac0['tls']=!![];}_0x522ac0['email']=_0xaf664b||_0x5b3719['user']||_0xf0e0('0x1d');return _0x522ac0;};EmailImap[_0xf0e0('0x1e')][_0xf0e0('0x10')]=function(){this[_0xf0e0('0xe')]['openBox'](this[_0xf0e0('0xa')],![],this[_0xf0e0('0x1f')]['bind'](this));};EmailImap[_0xf0e0('0x1e')]['handleOpenBox']=function(_0x379256,_0x364675){if(_0x379256){this['handleError'](_0x379256,!![]);}else{this[_0xf0e0('0x20')](_0xf0e0('0x21'),_0x364675);this['readUnseen']();}};EmailImap[_0xf0e0('0x1e')][_0xf0e0('0x22')]=function(_0x596241){if(_0x596241){this[_0xf0e0('0x12')](_0x596241,!![]);}else{this[_0xf0e0('0xe')][_0xf0e0('0x23')]();}};EmailImap[_0xf0e0('0x1e')][_0xf0e0('0x24')]=function(){this[_0xf0e0('0xe')][_0xf0e0('0x25')]([_0xf0e0('0x26')],this['handleReadUnseen'][_0xf0e0('0x11')](this));};EmailImap['prototype'][_0xf0e0('0x27')]=function(_0x5c9850,_0x22996c){if(_0x5c9850){this[_0xf0e0('0x12')](_0x5c9850,!![]);}else{if(_0x22996c[_0xf0e0('0x28')]){try{var _0x3c9b24=this['imap'][_0xf0e0('0x29')](_0x22996c,{'bodies':'','markSeen':!![]});_0x3c9b24['on'](_0xf0e0('0x2a'),this[_0xf0e0('0x2b')][_0xf0e0('0x11')](this));_0x3c9b24['once'](_0xf0e0('0x2c'),this[_0xf0e0('0x2d')][_0xf0e0('0x11')](this));_0x3c9b24[_0xf0e0('0x2e')](_0xf0e0('0x23'),this['handleFetchEnd'][_0xf0e0('0x11')](this));}catch(_0x2262ed){logger[_0xf0e0('0x2c')](_0x2262ed);}}else{this[_0xf0e0('0xe')][_0xf0e0('0x2f')](!![],this['handleCloseBox'][_0xf0e0('0x11')](this));}}};EmailImap[_0xf0e0('0x1e')]['handleFetchMessage']=function(_0x29183b,_0xde8325){_0x29183b['on'](_0xf0e0('0x30'),this[_0xf0e0('0x31')][_0xf0e0('0x11')](this));_0x29183b[_0xf0e0('0x2e')](_0xf0e0('0x32'),this['handleMessageAttributes'][_0xf0e0('0x11')](this));_0x29183b[_0xf0e0('0x2e')](_0xf0e0('0x23'),this[_0xf0e0('0x33')][_0xf0e0('0x11')](this));};EmailImap[_0xf0e0('0x1e')]['handleMessageBody']=function(_0x56b47f,_0x1a8e74){simpleParser(_0x56b47f,{'Iconv':Iconv},this['handleSimpleParser'][_0xf0e0('0x11')](this));};EmailImap[_0xf0e0('0x1e')][_0xf0e0('0x34')]=function(_0x4dec91){};EmailImap['prototype']['handleMessageEnd']=function(){};EmailImap[_0xf0e0('0x1e')][_0xf0e0('0x35')]=function(_0x1f0d7e,_0xed1354){if(_0x1f0d7e){logger[_0xf0e0('0x2c')](_0x1f0d7e);}else{var _0x39c930=this;utils[_0xf0e0('0x36')](this[_0xf0e0('0xc')],_0xed1354,function(_0x22ead8){_0x39c930[_0xf0e0('0x20')]('email',_0x22ead8);});}};EmailImap['prototype'][_0xf0e0('0x37')]=function(){this[_0xf0e0('0xe')][_0xf0e0('0x2f')](!![],this[_0xf0e0('0x22')][_0xf0e0('0x11')](this));};EmailImap[_0xf0e0('0x1e')][_0xf0e0('0x2d')]=function(_0x395b02){this[_0xf0e0('0x12')](_0x395b02);this['imap'][_0xf0e0('0x2f')](!![],this[_0xf0e0('0x22')]['bind'](this));};EmailImap[_0xf0e0('0x1e')][_0xf0e0('0x38')]=function(){this[_0xf0e0('0x20')]('end');};EmailImap[_0xf0e0('0x1e')]['handleError']=function(_0x595156,_0x557025){logger['error'](_0xf0e0('0x12'),this['account'][_0xf0e0('0x9')],JSON[_0xf0e0('0x39')](_0x595156));var _0x32fba3='';if(_0x595156){if(_0x595156['textCode']){_0x32fba3=_0x595156[_0xf0e0('0x3a')];}else{for(var _0x50256b in _0x595156){if(_0x595156['hasOwnProperty'](_0x50256b)){_0x32fba3+=_[_0xf0e0('0x3b')](_0x50256b)+':\x20'+_0x595156[_0x50256b]+'\x0a';}}}}if(_0x557025){this['imap']['end']();}else{this[_0xf0e0('0x20')](_0xf0e0('0x2c'),_0x32fba3);this['emit']('end');}};module['exports']=EmailImap; \ No newline at end of file +var _0xfe9d=['prototype','getAccount','connTimeout','authTimeout','isNil','service','authentication','user','host','port','tls','autotls','password','email','anonymous@xcally.com','openBox','mailbox','handleOpenBox','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','length','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd','parser','emit','textCode','hasOwnProperty','exports','path','util','imap','lodash','randomstring','simpleParser','Iconv','events','EventEmitter','./utils','../../../config/logger','INBOX','account','once','handleReady','bind','end','handleEnd','error','handleError'];(function(_0x2f5768,_0x342316){var _0xbd5069=function(_0x5ba0f8){while(--_0x5ba0f8){_0x2f5768['push'](_0x2f5768['shift']());}};_0xbd5069(++_0x342316);}(_0xfe9d,0x10e));var _0xdfe9=function(_0x5cc515,_0xc8ef78){_0x5cc515=_0x5cc515-0x0;var _0x4bcd5d=_0xfe9d[_0x5cc515];return _0x4bcd5d;};'use strict';var fs=require('fs');var path=require(_0xdfe9('0x0'));var util=require(_0xdfe9('0x1'));var Imap=require(_0xdfe9('0x2'));var _=require(_0xdfe9('0x3'));var rs=require(_0xdfe9('0x4'));var simpleParser=require('mailparser')[_0xdfe9('0x5')];var Iconv=require('iconv')[_0xdfe9('0x6')];var EventEmitter=require(_0xdfe9('0x7'))[_0xdfe9('0x8')];var utils=require(_0xdfe9('0x9'));var logger=require(_0xdfe9('0xa'))('email');function EmailImap(_0x523ecf,_0x3e3fe6){this['mailbox']=_0xdfe9('0xb');this[_0xdfe9('0xc')]=this['getAccount'](_0x523ecf,_0x3e3fe6);this[_0xdfe9('0x2')]=new Imap(this[_0xdfe9('0xc')]);this[_0xdfe9('0x2')][_0xdfe9('0xd')]('ready',this[_0xdfe9('0xe')][_0xdfe9('0xf')](this));this[_0xdfe9('0x2')][_0xdfe9('0xd')](_0xdfe9('0x10'),this[_0xdfe9('0x11')][_0xdfe9('0xf')](this));this[_0xdfe9('0x2')]['on'](_0xdfe9('0x12'),this[_0xdfe9('0x13')]['bind'](this));this[_0xdfe9('0x2')]['connect']();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xdfe9('0x14')][_0xdfe9('0x15')]=function(_0x531409,_0x186792){var _0x3a7ac8={'connTimeout':_0x531409['connTimeout']?_0x531409[_0xdfe9('0x16')]*0x3e8:0x2710,'authTimeout':_0x531409['authTimeout']?_0x531409[_0xdfe9('0x17')]*0x3e8:0x1388};if(_[_0xdfe9('0x18')](_0x531409[_0xdfe9('0x19')])){if(_0x531409[_0xdfe9('0x1a')]){_0x3a7ac8[_0xdfe9('0x1b')]=_0x531409[_0xdfe9('0x1b')];_0x3a7ac8['password']=_0x531409['password'];}_0x3a7ac8[_0xdfe9('0x1c')]=_0x531409['host'];_0x3a7ac8[_0xdfe9('0x1d')]=_0x531409[_0xdfe9('0x1d')]||0x3e1;if(_0x531409[_0xdfe9('0x1e')]){_0x3a7ac8['tls']=!![];}else{_0x3a7ac8['tls']=![];_0x3a7ac8[_0xdfe9('0x1f')]='required';}}else{_0x3a7ac8['user']=_0x531409[_0xdfe9('0x1b')];_0x3a7ac8['password']=_0x531409[_0xdfe9('0x20')];_0x3a7ac8[_0xdfe9('0x1c')]=utils['getHost'](_0x531409['service']);_0x3a7ac8[_0xdfe9('0x1d')]=0x3e1;_0x3a7ac8[_0xdfe9('0x1e')]=!![];}_0x3a7ac8[_0xdfe9('0x21')]=_0x186792||_0x531409[_0xdfe9('0x1b')]||_0xdfe9('0x22');return _0x3a7ac8;};EmailImap[_0xdfe9('0x14')][_0xdfe9('0xe')]=function(){this[_0xdfe9('0x2')][_0xdfe9('0x23')](this[_0xdfe9('0x24')],![],this[_0xdfe9('0x25')]['bind'](this));};EmailImap['prototype'][_0xdfe9('0x25')]=function(_0x2ad2ac,_0x57005b){if(_0x2ad2ac){this[_0xdfe9('0x13')](_0x2ad2ac,!![]);}else{this['emit']('box',_0x57005b);this[_0xdfe9('0x26')]();}};EmailImap[_0xdfe9('0x14')][_0xdfe9('0x27')]=function(_0x4188ea){if(_0x4188ea){this['handleError'](_0x4188ea,!![]);}else{this['imap'][_0xdfe9('0x10')]();}};EmailImap[_0xdfe9('0x14')][_0xdfe9('0x26')]=function(){this[_0xdfe9('0x2')]['search']([_0xdfe9('0x28')],this[_0xdfe9('0x29')]['bind'](this));};EmailImap[_0xdfe9('0x14')][_0xdfe9('0x29')]=function(_0x204648,_0x497e72){if(_0x204648){this[_0xdfe9('0x13')](_0x204648,!![]);}else{if(_0x497e72[_0xdfe9('0x2a')]){try{var _0x1d4cfb=this[_0xdfe9('0x2')]['fetch'](_0x497e72,{'bodies':'','markSeen':!![]});_0x1d4cfb['on'](_0xdfe9('0x2b'),this[_0xdfe9('0x2c')][_0xdfe9('0xf')](this));_0x1d4cfb[_0xdfe9('0xd')]('error',this[_0xdfe9('0x2d')][_0xdfe9('0xf')](this));_0x1d4cfb['once'](_0xdfe9('0x10'),this[_0xdfe9('0x2e')][_0xdfe9('0xf')](this));}catch(_0x3344d4){logger[_0xdfe9('0x12')](_0x3344d4);}}else{this[_0xdfe9('0x2')][_0xdfe9('0x2f')](!![],this[_0xdfe9('0x27')][_0xdfe9('0xf')](this));}}};EmailImap[_0xdfe9('0x14')][_0xdfe9('0x2c')]=function(_0x3ce9d7,_0x4f31be){_0x3ce9d7['on']('body',this[_0xdfe9('0x30')][_0xdfe9('0xf')](this));_0x3ce9d7[_0xdfe9('0xd')](_0xdfe9('0x31'),this[_0xdfe9('0x32')][_0xdfe9('0xf')](this));_0x3ce9d7[_0xdfe9('0xd')](_0xdfe9('0x10'),this['handleMessageEnd'][_0xdfe9('0xf')](this));};EmailImap[_0xdfe9('0x14')][_0xdfe9('0x30')]=function(_0x4d01df,_0x577fb3){simpleParser(_0x4d01df,{'Iconv':Iconv},this[_0xdfe9('0x33')]['bind'](this));};EmailImap[_0xdfe9('0x14')][_0xdfe9('0x32')]=function(_0x56ce22){};EmailImap[_0xdfe9('0x14')][_0xdfe9('0x34')]=function(){};EmailImap[_0xdfe9('0x14')][_0xdfe9('0x33')]=function(_0x41e2ad,_0x382549){if(_0x41e2ad){logger['error'](_0x41e2ad);}else{var _0x3e9d56=this;utils[_0xdfe9('0x35')](this['account'],_0x382549,function(_0x412b58){_0x3e9d56[_0xdfe9('0x36')](_0xdfe9('0x21'),_0x412b58);});}};EmailImap[_0xdfe9('0x14')][_0xdfe9('0x2e')]=function(){this[_0xdfe9('0x2')][_0xdfe9('0x2f')](!![],this[_0xdfe9('0x27')][_0xdfe9('0xf')](this));};EmailImap[_0xdfe9('0x14')][_0xdfe9('0x2d')]=function(_0x12ca7c){this[_0xdfe9('0x13')](_0x12ca7c);this[_0xdfe9('0x2')][_0xdfe9('0x2f')](!![],this[_0xdfe9('0x27')]['bind'](this));};EmailImap[_0xdfe9('0x14')][_0xdfe9('0x11')]=function(){this[_0xdfe9('0x36')](_0xdfe9('0x10'));};EmailImap[_0xdfe9('0x14')]['handleError']=function(_0x17991f,_0x499ab0){logger[_0xdfe9('0x12')](_0xdfe9('0x13'),this[_0xdfe9('0xc')]['email'],JSON['stringify'](_0x17991f));var _0x52161c='';if(_0x17991f){if(_0x17991f[_0xdfe9('0x37')]){_0x52161c=_0x17991f[_0xdfe9('0x37')];}else{for(var _0x35ad18 in _0x17991f){if(_0x17991f[_0xdfe9('0x38')](_0x35ad18)){_0x52161c+=_['upperFirst'](_0x35ad18)+':\x20'+_0x17991f[_0x35ad18]+'\x0a';}}}}if(_0x499ab0){this[_0xdfe9('0x2')][_0xdfe9('0x10')]();}else{this[_0xdfe9('0x36')]('error',_0x52161c);this[_0xdfe9('0x36')](_0xdfe9('0x10'));}};module[_0xdfe9('0x39')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 668c511..5a5513d 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 _0x36eb=['verify','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','compile'];(function(_0x1c79a7,_0x38220e){var _0x4de69f=function(_0x569582){while(--_0x569582){_0x1c79a7['push'](_0x1c79a7['shift']());}};_0x4de69f(++_0x38220e);}(_0x36eb,0x8f));var _0xb36e=function(_0x45121d,_0x2bb43b){_0x45121d=_0x45121d-0x0;var _0x176f9c=_0x36eb[_0x45121d];return _0x176f9c;};'use strict';var nodemailer=require(_0xb36e('0x0'));var BPromise=require(_0xb36e('0x1'));var inlineBase64=require(_0xb36e('0x2'));function EmailSmtp(){}EmailSmtp[_0xb36e('0x3')][_0xb36e('0x4')]=function(_0x10b43a,_0x419b1d){return new BPromise(function(_0x5170e0,_0x2c709a){var _0x2675b1=nodemailer[_0xb36e('0x5')](_0x10b43a);_0x2675b1['use'](_0xb36e('0x6'),inlineBase64());_0x2675b1['sendMail'](_0x419b1d,function(_0x4fd6fa,_0x331455){if(_0x4fd6fa){_0x2c709a(_0x4fd6fa['toString']());}else{_0x5170e0(_0x331455);}});});};EmailSmtp[_0xb36e('0x3')][_0xb36e('0x7')]=function(_0x44d047){return new BPromise(function(_0x18c333,_0x321cd0){var _0xfedee7=nodemailer[_0xb36e('0x5')](_0x44d047);_0xfedee7[_0xb36e('0x7')](function(_0xd6731e,_0x23b714){if(_0xd6731e){_0x321cd0(_0xd6731e['toString']());}else{if(_0x23b714){_0x18c333(_0x23b714);}else{_0x321cd0(_0xb36e('0x8'));}}});});};module[_0xb36e('0x9')]=EmailSmtp; \ No newline at end of file +var _0xfa4a=['nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','toString','verify','exports','nodemailer'];(function(_0x222952,_0x5a491f){var _0x311077=function(_0x9cbaa1){while(--_0x9cbaa1){_0x222952['push'](_0x222952['shift']());}};_0x311077(++_0x5a491f);}(_0xfa4a,0x1df));var _0xafa4=function(_0x5068d5,_0x353c3d){_0x5068d5=_0x5068d5-0x0;var _0x22123e=_0xfa4a[_0x5068d5];return _0x22123e;};'use strict';var nodemailer=require(_0xafa4('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0xafa4('0x1'));function EmailSmtp(){}EmailSmtp[_0xafa4('0x2')][_0xafa4('0x3')]=function(_0x123c5f,_0x1ec3d3){return new BPromise(function(_0x45c70f,_0x2b7017){var _0x257eea=nodemailer[_0xafa4('0x4')](_0x123c5f);_0x257eea[_0xafa4('0x5')](_0xafa4('0x6'),inlineBase64());_0x257eea['sendMail'](_0x1ec3d3,function(_0x56956c,_0x4fdd59){if(_0x56956c){_0x2b7017(_0x56956c[_0xafa4('0x7')]());}else{_0x45c70f(_0x4fdd59);}});});};EmailSmtp['prototype'][_0xafa4('0x8')]=function(_0x528c7d){return new BPromise(function(_0x51a128,_0x190947){var _0x51ed6f=nodemailer['createTransport'](_0x528c7d);_0x51ed6f[_0xafa4('0x8')](function(_0x4f1328,_0x30f2f6){if(_0x4f1328){_0x190947(_0x4f1328[_0xafa4('0x7')]());}else{if(_0x30f2f6){_0x51a128(_0x30f2f6);}else{_0x190947('Not\x20verifired');}}});});};module[_0xafa4('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 057b360..67e42b8 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 _0x04e0=['attachment-','format','writeFileSync','content','push','contentType','parser','from','subject','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','messageId','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Data','getHost','gmail','imap.gmail.com','yahoo','imap-mail.outlook.com','outlook365','127.0.0.1','moment','randomstring','path','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','length','slice','join','split','pop','html','test','replace','body','textAsHtml','0x1?_0x305cc6[_0x004e('0x12')]():'';}return'';}function getMails(_0x538472,_0x327b9d){var _0x38b995='';for(var _0x24067d=0x0;_0x24067d<_0x327b9d[_0x004e('0x8')][_0x004e('0xe')];_0x24067d+=0x1){if(_0x327b9d[_0x004e('0x8')][_0x24067d][_0x004e('0x9')]!==_0x538472){if(!_['isEmpty'](_0x38b995)){_0x38b995+=',';}_0x38b995+=_0x327b9d[_0x004e('0x8')][_0x24067d]['name']||_0x327b9d[_0x004e('0x8')][_0x24067d]['address']||'';_0x38b995+='\x20<';_0x38b995+=_0x327b9d[_0x004e('0x8')][_0x24067d]['address']?_0x327b9d[_0x004e('0x8')][_0x24067d][_0x004e('0x9')]:_0x004e('0xa')+random[_0x004e('0xb')](0x6)+'@xcally.com';_0x38b995+='>';}}return _0x38b995;}function parseEmail(_0x197c8f,_0x5b9543,_0x38e233){if(_0x5b9543[_0x004e('0x13')]){var _0x267aa=/)<[^<]*)*<\/script>/gi;while(_0x267aa[_0x004e('0x14')](_0x5b9543['html'])){_0x5b9543[_0x004e('0x13')]=_0x5b9543[_0x004e('0x13')][_0x004e('0x15')](_0x267aa,'');}_0x38e233[_0x004e('0x16')]=_0x5b9543[_0x004e('0x13')];}else{_0x38e233[_0x004e('0x16')]=_0x5b9543[_0x004e('0x17')];}if(_0x38e233[_0x004e('0x16')]){_0x38e233['body']=_0x38e233[_0x004e('0x16')][_0x004e('0x15')](/Empty\x20message

','Attachments','Title','getHost','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','127.0.0.1','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','@xcally.com','value','name','split','slice','join','Anonymous','length','isEmpty','html','test','replace','body'];(function(_0x17e3c4,_0x821010){var _0x2211b9=function(_0x33ab42){while(--_0x33ab42){_0x17e3c4['push'](_0x17e3c4['shift']());}};_0x2211b9(++_0x821010);}(_0x52aa,0x113));var _0xa52a=function(_0x2ac551,_0x525c42){_0x2ac551=_0x2ac551-0x0;var _0xe78aab=_0x52aa[_0x2ac551];return _0xe78aab;};'use strict';var _=require('lodash');var moment=require(_0xa52a('0x0'));var random=require(_0xa52a('0x1'));var fs=require('fs');var path=require(_0xa52a('0x2'));var util=require(_0xa52a('0x3'));var tnef=require(_0xa52a('0x4'));var logger=require(_0xa52a('0x5'))(_0xa52a('0x6'));var config=require(_0xa52a('0x7'));function getAddress(_0x18975a){var _0x3aaabd=_[_0xa52a('0x8')](_0x18975a['value']);return _0x3aaabd&&_0x3aaabd['address']?_0x3aaabd[_0xa52a('0x9')]:_0xa52a('0xa')+random[_0xa52a('0xb')](0x6)+_0xa52a('0xc');}function getFirstName(_0x19d5cf){var _0x398a62=_[_0xa52a('0x8')](_0x19d5cf[_0xa52a('0xd')]);if(_0x398a62&&_0x398a62[_0xa52a('0xe')]){var _0x2a575f=_0x398a62['name'][_0xa52a('0xf')](/\s+/);return _0x2a575f['length']?_0x2a575f[_0xa52a('0x10')](0x0,-0x1)[_0xa52a('0x11')]('\x20'):_0x398a62[_0xa52a('0xe')];}return _0xa52a('0x12');}function getLastName(_0x4095dd){var _0x3f2d98=_[_0xa52a('0x8')](_0x4095dd[_0xa52a('0xd')]);if(_0x3f2d98&&_0x3f2d98[_0xa52a('0xe')]){var _0x10342c=_0x3f2d98[_0xa52a('0xe')][_0xa52a('0xf')](/\s+/);return _0x10342c[_0xa52a('0x13')]>0x1?_0x10342c['pop']():'';}return'';}function getMails(_0x56a2d2,_0x64faab){var _0x34e286='';for(var _0x534580=0x0;_0x534580<_0x64faab[_0xa52a('0xd')][_0xa52a('0x13')];_0x534580+=0x1){if(_0x64faab[_0xa52a('0xd')][_0x534580][_0xa52a('0x9')]!==_0x56a2d2){if(!_[_0xa52a('0x14')](_0x34e286)){_0x34e286+=',';}_0x34e286+=_0x64faab[_0xa52a('0xd')][_0x534580][_0xa52a('0xe')]||_0x64faab[_0xa52a('0xd')][_0x534580][_0xa52a('0x9')]||'';_0x34e286+='\x20<';_0x34e286+=_0x64faab[_0xa52a('0xd')][_0x534580]['address']?_0x64faab[_0xa52a('0xd')][_0x534580][_0xa52a('0x9')]:_0xa52a('0xa')+random[_0xa52a('0xb')](0x6)+_0xa52a('0xc');_0x34e286+='>';}}return _0x34e286;}function parseEmail(_0xa0fd2d,_0x5d0fe4,_0x357887){if(_0x5d0fe4[_0xa52a('0x15')]){var _0xd4d131=/)<[^<]*)*<\/script>/gi;while(_0xd4d131[_0xa52a('0x16')](_0x5d0fe4['html'])){_0x5d0fe4[_0xa52a('0x15')]=_0x5d0fe4[_0xa52a('0x15')][_0xa52a('0x17')](_0xd4d131,'');}_0x357887[_0xa52a('0x18')]=_0x5d0fe4[_0xa52a('0x15')];}else{_0x357887['body']=_0x5d0fe4[_0xa52a('0x19')];}if(_0x357887['body']){_0x357887['body']=_0x357887[_0xa52a('0x18')][_0xa52a('0x17')](/0x0){if(this[_0x566a33+_0x6af1('0x24')]>0x0&&this[_0x566a33+_0x6af1('0x23')]>=this[_0x566a33+'Capacity']){return'maxcapacity';}else{return'working';}}else{return _0x6af1('0x25');}};Agent['prototype']['updateRealtime']=function(){var _0x1d4a78=[_0x6af1('0x26'),_0x6af1('0x27'),'openchannel',_0x6af1('0x28'),'sms'];for(var _0x43d37b=0x0;_0x43d37b<_0x1d4a78['length'];_0x43d37b+=0x1){var _0x31171d=this[_0x6af1('0x29')](_0x1d4a78[_0x43d37b]);if(this[_0x1d4a78[_0x43d37b]+_0x6af1('0x2a')]!==_0x31171d){this[_0x1d4a78[_0x43d37b]+'StatusTime']=_[_0x6af1('0x2b')](moment()['format']('x'));}this[_0x1d4a78[_0x43d37b]+_0x6af1('0x2a')]=_0x31171d;}var _0x5f2fa6={'id':this['id'],'name':this[_0x6af1('0x8')],'online':this[_0x6af1('0x9')],'voicePause':this['voicePause'],'chatPause':this[_0x6af1('0xb')],'mailPause':this[_0x6af1('0xc')],'smsPause':this[_0x6af1('0xe')],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x6af1('0xf')],'chatStatusTime':this[_0x6af1('0x2c')],'chatCapacity':this[_0x6af1('0x11')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x6af1('0x12')],'mailStatusTime':this[_0x6af1('0x13')],'mailCapacity':this[_0x6af1('0x14')],'mailCurrentCapacity':this[_0x6af1('0x15')],'faxStatus':this[_0x6af1('0x16')],'faxStatusTime':this[_0x6af1('0x17')],'faxCapacity':this[_0x6af1('0x18')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x6af1('0x1a')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x6af1('0x1b')],'smsCurrentCapacity':this[_0x6af1('0x2d')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x6af1('0x1d')],'openchannelCapacity':this[_0x6af1('0x1e')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x6af1('0x1f')],'busyQueue':this[_0x6af1('0x20')]};var _0x4d2171=md5(JSON[_0x6af1('0x2e')](_0x5f2fa6));if(this['md5']!==_0x4d2171){this[_0x6af1('0x2')]=_0x4d2171;io[_0x6af1('0x2f')](_0x6af1('0x30'),_0x5f2fa6);}};module[_0x6af1('0x31')]=Agent; \ No newline at end of file +var _0x7d77=['mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','prototype','CurrentCapacity','Capacity','working','idle','mail','chat','openchannel','fax','sms','getChannelStatus','Status','StatusTime','toNumber','format','chatStatusTime','mailStatus','busyQueue','stringify','emit','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity'];(function(_0x534795,_0xd6fe98){var _0x5d17a4=function(_0x29d566){while(--_0x29d566){_0x534795['push'](_0x534795['shift']());}};_0x5d17a4(++_0xd6fe98);}(_0x7d77,0xca));var _0x77d7=function(_0x1e24b1,_0x14ab30){_0x1e24b1=_0x1e24b1-0x0;var _0x212baf=_0x7d77[_0x1e24b1];return _0x212baf;};'use strict';var _=require(_0x77d7('0x0'));var moment=require(_0x77d7('0x1'));var md5=require(_0x77d7('0x2'));var Redis=require(_0x77d7('0x3'));var config=require(_0x77d7('0x4'));config[_0x77d7('0x5')]=_[_0x77d7('0x6')](config[_0x77d7('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x77d7('0x7'))(new Redis(config['redis']));function Agent(_0x5aaae6){this['id']=_0x5aaae6['id']||0x0;this['name']=_0x5aaae6[_0x77d7('0x8')]||'';this[_0x77d7('0x9')]=_0x5aaae6[_0x77d7('0x9')]||!![];this['voicePause']=_0x5aaae6[_0x77d7('0xa')]||![];this[_0x77d7('0xb')]=_0x5aaae6['chatPause']||![];this[_0x77d7('0xc')]=_0x5aaae6[_0x77d7('0xc')]||![];this['faxPause']=_0x5aaae6[_0x77d7('0xd')]||![];this[_0x77d7('0xe')]=_0x5aaae6[_0x77d7('0xe')]||![];this[_0x77d7('0xf')]=_0x5aaae6[_0x77d7('0xf')]||![];this[_0x77d7('0x10')]=_0x77d7('0x11');this['chatStatusTime']=0x0;this[_0x77d7('0x12')]=_0x5aaae6[_0x77d7('0x12')]||0x0;this[_0x77d7('0x13')]=0x0;this['mailStatus']=_0x77d7('0x11');this[_0x77d7('0x14')]=0x0;this[_0x77d7('0x15')]=_0x5aaae6['mailCapacity']||0x0;this[_0x77d7('0x16')]=0x0;this[_0x77d7('0x17')]='unknown';this[_0x77d7('0x18')]=0x0;this[_0x77d7('0x19')]=_0x5aaae6['faxCapacity']||0x0;this[_0x77d7('0x1a')]=0x0;this[_0x77d7('0x1b')]=_0x77d7('0x11');this[_0x77d7('0x1c')]=0x0;this['smsCapacity']=_0x5aaae6[_0x77d7('0x1d')]||0x0;this[_0x77d7('0x1e')]=0x0;this[_0x77d7('0x1f')]=_0x77d7('0x11');this[_0x77d7('0x20')]=0x0;this['openchannelCapacity']=_0x5aaae6[_0x77d7('0x21')]||0x0;this[_0x77d7('0x22')]=0x0;this[_0x77d7('0x23')]=![];this['busyQueue']=undefined;this[_0x77d7('0x2')]='';this['updateRealtime']();}Agent[_0x77d7('0x24')]['getChannelStatus']=function(_0x3b9d77){if(this[_0x3b9d77+_0x77d7('0x25')]>0x0){if(this[_0x3b9d77+_0x77d7('0x26')]>0x0&&this[_0x3b9d77+'CurrentCapacity']>=this[_0x3b9d77+_0x77d7('0x26')]){return'maxcapacity';}else{return _0x77d7('0x27');}}else{return _0x77d7('0x28');}};Agent[_0x77d7('0x24')]['updateRealtime']=function(){var _0x558242=[_0x77d7('0x29'),_0x77d7('0x2a'),_0x77d7('0x2b'),_0x77d7('0x2c'),_0x77d7('0x2d')];for(var _0x22c07a=0x0;_0x22c07a<_0x558242['length'];_0x22c07a+=0x1){var _0x2e6381=this[_0x77d7('0x2e')](_0x558242[_0x22c07a]);if(this[_0x558242[_0x22c07a]+_0x77d7('0x2f')]!==_0x2e6381){this[_0x558242[_0x22c07a]+_0x77d7('0x30')]=_[_0x77d7('0x31')](moment()[_0x77d7('0x32')]('x'));}this[_0x558242[_0x22c07a]+_0x77d7('0x2f')]=_0x2e6381;}var _0x3b0dd3={'id':this['id'],'name':this[_0x77d7('0x8')],'online':this[_0x77d7('0x9')],'voicePause':this['voicePause'],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x77d7('0xe')],'faxPause':this[_0x77d7('0xd')],'openchannelPause':this[_0x77d7('0xf')],'chatStatus':this[_0x77d7('0x10')],'chatStatusTime':this[_0x77d7('0x33')],'chatCapacity':this[_0x77d7('0x12')],'chatCurrentCapacity':this[_0x77d7('0x13')],'mailStatus':this[_0x77d7('0x34')],'mailStatusTime':this[_0x77d7('0x14')],'mailCapacity':this[_0x77d7('0x15')],'mailCurrentCapacity':this[_0x77d7('0x16')],'faxStatus':this[_0x77d7('0x17')],'faxStatusTime':this[_0x77d7('0x18')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x77d7('0x1a')],'smsStatus':this[_0x77d7('0x1b')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x77d7('0x1d')],'smsCurrentCapacity':this[_0x77d7('0x1e')],'openchannelStatus':this[_0x77d7('0x1f')],'openchannelStatusTime':this[_0x77d7('0x20')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x77d7('0x22')],'busy':this[_0x77d7('0x23')],'busyQueue':this[_0x77d7('0x35')]};var _0x591355=md5(JSON[_0x77d7('0x36')](_0x3b0dd3));if(this[_0x77d7('0x2')]!==_0x591355){this['md5']=_0x591355;io[_0x77d7('0x37')]('user:save',_0x3b0dd3);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 8864d7d..6aba732 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 _0x6d9c=['loggedIn','paused','length','online','available','format','chat:queue:%s','emit','chat_queue:save','exports','md5','util','ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr'];(function(_0xb7e71c,_0x39b47e){var _0xcd9aae=function(_0x1dface){while(--_0x1dface){_0xb7e71c['push'](_0xb7e71c['shift']());}};_0xcd9aae(++_0x39b47e);}(_0x6d9c,0x14e));var _0xc6d9=function(_0x5cf2ac,_0x3c619f){_0x5cf2ac=_0x5cf2ac-0x0;var _0x1ac7e9=_0x6d9c[_0x5cf2ac];return _0x1ac7e9;};'use strict';var _=require('lodash');var md5=require(_0xc6d9('0x0'));var util=require(_0xc6d9('0x1'));var Redis=require(_0xc6d9('0x2'));var config=require('../../../config/environment');config['redis']=_[_0xc6d9('0x3')](config[_0xc6d9('0x4')],{'host':_0xc6d9('0x5'),'port':0x18eb});var io=require(_0xc6d9('0x6'))(new Redis(config[_0xc6d9('0x4')]));function ChatQueue(_0x3fa6af){this['id']=_0x3fa6af['id']||0x0;this[_0xc6d9('0x7')]=_0x3fa6af[_0xc6d9('0x7')]||'';this[_0xc6d9('0x8')]=_0x3fa6af[_0xc6d9('0x8')]||0xa;this[_0xc6d9('0x9')]=_0x3fa6af[_0xc6d9('0x9')]||'beepall';this[_0xc6d9('0xa')]=_0x3fa6af['Agents'];this['mapAgentsId']={};this[_0xc6d9('0xb')]=0x0;this[_0xc6d9('0x0')]='';this[_0xc6d9('0xc')]();this[_0xc6d9('0xd')]();}ChatQueue[_0xc6d9('0xe')]['updateRouting']=function(){var _0x1d99ab=this[_0xc6d9('0xf')][_0xc6d9('0x10')];this['mapAgentsId']=_['map'](this[_0xc6d9('0xa')],'id');this[_0xc6d9('0xf')][_0xc6d9('0x10')]=_0x1d99ab;};ChatQueue[_0xc6d9('0xe')][_0xc6d9('0xd')]=function(){this[_0xc6d9('0x11')]=0x0;this[_0xc6d9('0x12')]=0x0;for(var _0x5ad36b=0x0;_0x5ad36b=0x0?this[_0xc6d9('0x15')]:0x0;var _0x3ef2cb={'id':this['id'],'available':this[_0xc6d9('0x15')],'loggedIn':this[_0xc6d9('0x11')],'name':this[_0xc6d9('0x7')],'paused':this[_0xc6d9('0x12')],'waiting':this[_0xc6d9('0xb')]};var _0x1784fc=md5(JSON['stringify'](_0x3ef2cb));if(this[_0xc6d9('0x0')]!==_0x1784fc){this[_0xc6d9('0x0')]=_0x1784fc;io['to'](util[_0xc6d9('0x16')](_0xc6d9('0x17'),_0x3ef2cb[_0xc6d9('0x7')]))[_0xc6d9('0x18')](_0xc6d9('0x19'),_0x3ef2cb);}};module[_0xc6d9('0x1a')]=ChatQueue; \ No newline at end of file +var _0xac31=['emit','exports','lodash','md5','util','ioredis','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','length','online','chatPause','available','loggedIn','paused','format'];(function(_0x238e8,_0x52e37e){var _0x4e4502=function(_0x2b1c0b){while(--_0x2b1c0b){_0x238e8['push'](_0x238e8['shift']());}};_0x4e4502(++_0x52e37e);}(_0xac31,0x1a6));var _0x1ac3=function(_0x620f4b,_0x4f62d2){_0x620f4b=_0x620f4b-0x0;var _0x1d711d=_0xac31[_0x620f4b];return _0x1d711d;};'use strict';var _=require(_0x1ac3('0x0'));var md5=require(_0x1ac3('0x1'));var util=require(_0x1ac3('0x2'));var Redis=require(_0x1ac3('0x3'));var config=require('../../../config/environment');config[_0x1ac3('0x4')]=_[_0x1ac3('0x5')](config['redis'],{'host':_0x1ac3('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1ac3('0x4')]));function ChatQueue(_0x47a7e3){this['id']=_0x47a7e3['id']||0x0;this[_0x1ac3('0x7')]=_0x47a7e3[_0x1ac3('0x7')]||'';this[_0x1ac3('0x8')]=_0x47a7e3[_0x1ac3('0x8')]||0xa;this[_0x1ac3('0x9')]=_0x47a7e3[_0x1ac3('0x9')]||_0x1ac3('0xa');this[_0x1ac3('0xb')]=_0x47a7e3[_0x1ac3('0xb')];this[_0x1ac3('0xc')]={};this[_0x1ac3('0xd')]=0x0;this['md5']='';this['updateRouting']();this[_0x1ac3('0xe')]();}ChatQueue[_0x1ac3('0xf')][_0x1ac3('0x10')]=function(){var _0x25e28e=this[_0x1ac3('0xc')][_0x1ac3('0x11')];this['mapAgentsId']=_[_0x1ac3('0x12')](this[_0x1ac3('0xb')],'id');this[_0x1ac3('0xc')][_0x1ac3('0x11')]=_0x25e28e;};ChatQueue['prototype'][_0x1ac3('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x214792=0x0;_0x214792=0x0?this[_0x1ac3('0x16')]:0x0;var _0x3de924={'id':this['id'],'available':this[_0x1ac3('0x16')],'loggedIn':this[_0x1ac3('0x17')],'name':this[_0x1ac3('0x7')],'paused':this[_0x1ac3('0x18')],'waiting':this[_0x1ac3('0xd')]};var _0x79807c=md5(JSON['stringify'](_0x3de924));if(this[_0x1ac3('0x1')]!==_0x79807c){this['md5']=_0x79807c;io['to'](util[_0x1ac3('0x19')]('chat:queue:%s',_0x3de924[_0x1ac3('0x7')]))[_0x1ac3('0x1a')]('chat_queue:save',_0x3de924);}};module[_0x1ac3('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 1e82a15..91c9323 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 _0xc802=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','length','online','faxPause','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','md5','ioredis'];(function(_0x38b357,_0x5603ad){var _0x1859ec=function(_0x2508dd){while(--_0x2508dd){_0x38b357['push'](_0x38b357['shift']());}};_0x1859ec(++_0x5603ad);}(_0xc802,0xb2));var _0x2c80=function(_0x4034f8,_0x4ddbb2){_0x4034f8=_0x4034f8-0x0;var _0x2216f5=_0xc802[_0x4034f8];return _0x2216f5;};'use strict';var _=require('lodash');var md5=require(_0x2c80('0x0'));var util=require('util');var Redis=require(_0x2c80('0x1'));var config=require(_0x2c80('0x2'));config[_0x2c80('0x3')]=_['defaults'](config['redis'],{'host':_0x2c80('0x4'),'port':0x18eb});var io=require(_0x2c80('0x5'))(new Redis(config[_0x2c80('0x3')]));function FaxQueue(_0x33494f){this['id']=_0x33494f['id']||0x0;this[_0x2c80('0x6')]=_0x33494f['name']||'';this[_0x2c80('0x7')]=_0x33494f[_0x2c80('0x7')]||0xa;this[_0x2c80('0x8')]=_0x33494f[_0x2c80('0x8')]||_0x2c80('0x9');this[_0x2c80('0xa')]=_0x33494f[_0x2c80('0xa')];this[_0x2c80('0xb')]={};this[_0x2c80('0xc')]=0x0;this[_0x2c80('0x0')]='';this[_0x2c80('0xd')]();this['updateRealtime']();}FaxQueue[_0x2c80('0xe')][_0x2c80('0xd')]=function(){var _0x2776ac=this['mapAgentsId'][_0x2c80('0xf')];this[_0x2c80('0xb')]=_[_0x2c80('0x10')](this['Agents'],'id');this[_0x2c80('0xb')][_0x2c80('0xf')]=_0x2776ac;};FaxQueue[_0x2c80('0xe')][_0x2c80('0x11')]=function(){this[_0x2c80('0x12')]=0x0;this[_0x2c80('0x13')]=0x0;for(var _0x1bc604=0x0;_0x1bc604=0x0?this[_0x2c80('0x17')]:0x0;var _0x382ec6={'id':this['id'],'available':this['available'],'loggedIn':this[_0x2c80('0x12')],'name':this[_0x2c80('0x6')],'paused':this['paused'],'waiting':this[_0x2c80('0xc')]};var _0x1fa8d1=md5(JSON[_0x2c80('0x18')](_0x382ec6));if(this['md5']!==_0x1fa8d1){this[_0x2c80('0x0')]=_0x1fa8d1;io['to'](util[_0x2c80('0x19')](_0x2c80('0x1a'),_0x382ec6['name']))[_0x2c80('0x1b')](_0x2c80('0x1c'),_0x382ec6);}};module[_0x2c80('0x1d')]=FaxQueue; \ No newline at end of file +var _0x144d=['emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','online','faxPause','available','paused','format','fax:queue:%s'];(function(_0x8349f7,_0x59f1f7){var _0x2eae26=function(_0x45d266){while(--_0x45d266){_0x8349f7['push'](_0x8349f7['shift']());}};_0x2eae26(++_0x59f1f7);}(_0x144d,0xea));var _0xd144=function(_0x5bb09f,_0x3a0950){_0x5bb09f=_0x5bb09f-0x0;var _0x56de24=_0x144d[_0x5bb09f];return _0x56de24;};'use strict';var _=require(_0xd144('0x0'));var md5=require(_0xd144('0x1'));var util=require(_0xd144('0x2'));var Redis=require(_0xd144('0x3'));var config=require(_0xd144('0x4'));config[_0xd144('0x5')]=_[_0xd144('0x6')](config[_0xd144('0x5')],{'host':_0xd144('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd144('0x5')]));function FaxQueue(_0x274624){this['id']=_0x274624['id']||0x0;this[_0xd144('0x8')]=_0x274624[_0xd144('0x8')]||'';this[_0xd144('0x9')]=_0x274624[_0xd144('0x9')]||0xa;this[_0xd144('0xa')]=_0x274624[_0xd144('0xa')]||_0xd144('0xb');this[_0xd144('0xc')]=_0x274624[_0xd144('0xc')];this[_0xd144('0xd')]={};this[_0xd144('0xe')]=0x0;this['md5']='';this[_0xd144('0xf')]();this['updateRealtime']();}FaxQueue[_0xd144('0x10')][_0xd144('0xf')]=function(){var _0x3ce559=this[_0xd144('0xd')][_0xd144('0x11')];this[_0xd144('0xd')]=_[_0xd144('0x12')](this[_0xd144('0xc')],'id');this[_0xd144('0xd')][_0xd144('0x11')]=_0x3ce559;};FaxQueue[_0xd144('0x10')][_0xd144('0x13')]=function(){this[_0xd144('0x14')]=0x0;this['paused']=0x0;for(var _0x257ce8=0x0;_0x257ce8=0x0?this['available']:0x0;var _0x43e89d={'id':this['id'],'available':this[_0xd144('0x17')],'loggedIn':this[_0xd144('0x14')],'name':this[_0xd144('0x8')],'paused':this[_0xd144('0x18')],'waiting':this['waiting']};var _0x1746bb=md5(JSON['stringify'](_0x43e89d));if(this[_0xd144('0x1')]!==_0x1746bb){this[_0xd144('0x1')]=_0x1746bb;io['to'](util[_0xd144('0x19')](_0xd144('0x1a'),_0x43e89d['name']))[_0xd144('0x1b')]('fax_queue:save',_0x43e89d);}};module[_0xd144('0x1c')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 8c00efe..5620ab5 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 _0x1b12=['Intervals','exports','name'];(function(_0x5322e4,_0x292f37){var _0x32e06f=function(_0x28b660){while(--_0x28b660){_0x5322e4['push'](_0x5322e4['shift']());}};_0x32e06f(++_0x292f37);}(_0x1b12,0x74));var _0x21b1=function(_0x5d99a1,_0x2e5d0b){_0x5d99a1=_0x5d99a1-0x0;var _0x24f98e=_0x1b12[_0x5d99a1];return _0x24f98e;};'use strict';function Interval(_0x142882){this['id']=_0x142882['id']||0x0;this[_0x21b1('0x0')]=_0x142882[_0x21b1('0x0')]||'';this['Intervals']=_0x142882[_0x21b1('0x1')]||{};}module[_0x21b1('0x2')]=Interval; \ No newline at end of file +var _0xc64f=['exports','name','Intervals'];(function(_0x341a9a,_0x37a9b7){var _0x251272=function(_0x28ef2f){while(--_0x28ef2f){_0x341a9a['push'](_0x341a9a['shift']());}};_0x251272(++_0x37a9b7);}(_0xc64f,0x118));var _0xfc64=function(_0x491ccb,_0x3e6e1c){_0x491ccb=_0x491ccb-0x0;var _0x441e3c=_0xc64f[_0x491ccb];return _0x441e3c;};'use strict';function Interval(_0x28d55a){this['id']=_0x28d55a['id']||0x0;this[_0xfc64('0x0')]=_0x28d55a[_0xfc64('0x0')]||'';this[_0xfc64('0x1')]=_0x28d55a['Intervals']||{};}module[_0xfc64('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 b44cc6f..45c6c60 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 _0x8c8b=['map','paused','online','loggedIn','available','stringify','format','mail:queue:%s','mail_queue:save','exports','lodash','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8c8b,0x106));var _0xb8c8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8c8b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb8c8('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xb8c8('0x1'));var config=require(_0xb8c8('0x2'));config[_0xb8c8('0x3')]=_[_0xb8c8('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb8c8('0x5'))(new Redis(config[_0xb8c8('0x3')]));function MailQueue(_0xccf4da){this['id']=_0xccf4da['id']||0x0;this[_0xb8c8('0x6')]=_0xccf4da[_0xb8c8('0x6')]||'';this[_0xb8c8('0x7')]=_0xccf4da[_0xb8c8('0x7')]||0xa;this[_0xb8c8('0x8')]=_0xccf4da[_0xb8c8('0x8')]||_0xb8c8('0x9');this[_0xb8c8('0xa')]=_0xccf4da['Agents'];this[_0xb8c8('0xb')]={};this[_0xb8c8('0xc')]=0x0;this[_0xb8c8('0xd')]='';this[_0xb8c8('0xe')]();this[_0xb8c8('0xf')]();}MailQueue[_0xb8c8('0x10')][_0xb8c8('0xe')]=function(){var _0xf2120c=this[_0xb8c8('0xb')][_0xb8c8('0x11')];this[_0xb8c8('0xb')]=_[_0xb8c8('0x12')](this['Agents'],'id');this[_0xb8c8('0xb')]['_rr']=_0xf2120c;};MailQueue[_0xb8c8('0x10')][_0xb8c8('0xf')]=function(){this['loggedIn']=0x0;this[_0xb8c8('0x13')]=0x0;for(var _0x2efe06=0x0;_0x2efe06=0x0?this[_0xb8c8('0x16')]:0x0;var _0x31886c={'id':this['id'],'available':this[_0xb8c8('0x16')],'loggedIn':this[_0xb8c8('0x15')],'name':this[_0xb8c8('0x6')],'paused':this[_0xb8c8('0x13')],'waiting':this[_0xb8c8('0xc')]};var _0x355e6e=md5(JSON[_0xb8c8('0x17')](_0x31886c));if(this[_0xb8c8('0xd')]!==_0x355e6e){this[_0xb8c8('0xd')]=_0x355e6e;io['to'](util[_0xb8c8('0x18')](_0xb8c8('0x19'),_0x31886c[_0xb8c8('0x6')]))['emit'](_0xb8c8('0x1a'),_0x31886c);}};module[_0xb8c8('0x1b')]=MailQueue; \ No newline at end of file +var _0x7e4b=['mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online'];(function(_0x458363,_0x1675db){var _0x4d0290=function(_0x22960f){while(--_0x22960f){_0x458363['push'](_0x458363['shift']());}};_0x4d0290(++_0x1675db);}(_0x7e4b,0x84));var _0xb7e4=function(_0x3da7af,_0x545a21){_0x3da7af=_0x3da7af-0x0;var _0x6b1c4e=_0x7e4b[_0x3da7af];return _0x6b1c4e;};'use strict';var _=require(_0xb7e4('0x0'));var md5=require(_0xb7e4('0x1'));var util=require('util');var Redis=require(_0xb7e4('0x2'));var config=require(_0xb7e4('0x3'));config['redis']=_[_0xb7e4('0x4')](config[_0xb7e4('0x5')],{'host':_0xb7e4('0x6'),'port':0x18eb});var io=require(_0xb7e4('0x7'))(new Redis(config[_0xb7e4('0x5')]));function MailQueue(_0xa314f9){this['id']=_0xa314f9['id']||0x0;this[_0xb7e4('0x8')]=_0xa314f9[_0xb7e4('0x8')]||'';this[_0xb7e4('0x9')]=_0xa314f9['timeout']||0xa;this[_0xb7e4('0xa')]=_0xa314f9['strategy']||_0xb7e4('0xb');this[_0xb7e4('0xc')]=_0xa314f9[_0xb7e4('0xc')];this[_0xb7e4('0xd')]={};this[_0xb7e4('0xe')]=0x0;this[_0xb7e4('0x1')]='';this[_0xb7e4('0xf')]();this[_0xb7e4('0x10')]();}MailQueue[_0xb7e4('0x11')][_0xb7e4('0xf')]=function(){var _0x3179b3=this[_0xb7e4('0xd')][_0xb7e4('0x12')];this['mapAgentsId']=_['map'](this[_0xb7e4('0xc')],'id');this[_0xb7e4('0xd')]['_rr']=_0x3179b3;};MailQueue[_0xb7e4('0x11')][_0xb7e4('0x10')]=function(){this[_0xb7e4('0x13')]=0x0;this[_0xb7e4('0x14')]=0x0;for(var _0x2acf77=0x0;_0x2acf77=0x0?this[_0xb7e4('0x18')]:0x0;var _0x44a6c9={'id':this['id'],'available':this[_0xb7e4('0x18')],'loggedIn':this[_0xb7e4('0x13')],'name':this[_0xb7e4('0x8')],'paused':this[_0xb7e4('0x14')],'waiting':this[_0xb7e4('0xe')]};var _0x4ee2f0=md5(JSON[_0xb7e4('0x19')](_0x44a6c9));if(this[_0xb7e4('0x1')]!==_0x4ee2f0){this[_0xb7e4('0x1')]=_0x4ee2f0;io['to'](util[_0xb7e4('0x1a')](_0xb7e4('0x1b'),_0x44a6c9['name']))[_0xb7e4('0x1c')](_0xb7e4('0x1d'),_0x44a6c9);}};module[_0xb7e4('0x1e')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 0e8f477..e667839 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 _0x359d=['mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','Agents','length','online','loggedIn','openchannelPause','paused','available','format','openchannel:queue:%s','emit','openchannel_queue:save','exports','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout'];(function(_0x497971,_0x4a7f7d){var _0xefaa97=function(_0xec8984){while(--_0xec8984){_0x497971['push'](_0x497971['shift']());}};_0xefaa97(++_0x4a7f7d);}(_0x359d,0xeb));var _0xd359=function(_0x1e4a8e,_0x18022b){_0x1e4a8e=_0x1e4a8e-0x0;var _0x5408f9=_0x359d[_0x1e4a8e];return _0x5408f9;};'use strict';var _=require('lodash');var md5=require(_0xd359('0x0'));var util=require('util');var Redis=require(_0xd359('0x1'));var config=require(_0xd359('0x2'));config[_0xd359('0x3')]=_[_0xd359('0x4')](config[_0xd359('0x3')],{'host':_0xd359('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function OpenchannelQueue(_0x17acdb){this['id']=_0x17acdb['id']||0x0;this[_0xd359('0x6')]=_0x17acdb[_0xd359('0x6')]||'';this['timeout']=_0x17acdb[_0xd359('0x7')]||0xa;this['strategy']=_0x17acdb['strategy']||'beepall';this['Agents']=_0x17acdb['Agents'];this[_0xd359('0x8')]={};this[_0xd359('0x9')]=0x0;this[_0xd359('0x0')]='';this[_0xd359('0xa')]();this[_0xd359('0xb')]();}OpenchannelQueue[_0xd359('0xc')]['updateRouting']=function(){var _0x1b098a=this[_0xd359('0x8')][_0xd359('0xd')];this[_0xd359('0x8')]=_[_0xd359('0xe')](this[_0xd359('0xf')],'id');this[_0xd359('0x8')][_0xd359('0xd')]=_0x1b098a;};OpenchannelQueue[_0xd359('0xc')][_0xd359('0xb')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x15f6d0=0x0;_0x15f6d0=0x0?this[_0xd359('0x15')]:0x0;var _0x2215e5={'id':this['id'],'available':this[_0xd359('0x15')],'loggedIn':this[_0xd359('0x12')],'name':this[_0xd359('0x6')],'paused':this[_0xd359('0x14')],'waiting':this[_0xd359('0x9')]};var _0x2d3448=md5(JSON['stringify'](_0x2215e5));if(this[_0xd359('0x0')]!==_0x2d3448){this[_0xd359('0x0')]=_0x2d3448;io['to'](util[_0xd359('0x16')](_0xd359('0x17'),_0x2215e5[_0xd359('0x6')]))[_0xd359('0x18')](_0xd359('0x19'),_0x2215e5);}};module[_0xd359('0x1a')]=OpenchannelQueue; \ No newline at end of file +var _0xc98f=['updateRouting','_rr','map','updateRealtime','loggedIn','paused','length','online','openchannelPause','available','stringify','format','openchannel:queue:%s','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','Agents','mapAgentsId','waiting'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xc98f,0xee));var _0xfc98=function(_0x332780,_0x23f674){_0x332780=_0x332780-0x0;var _0x1e835d=_0xc98f[_0x332780];return _0x1e835d;};'use strict';var _=require(_0xfc98('0x0'));var md5=require(_0xfc98('0x1'));var util=require(_0xfc98('0x2'));var Redis=require(_0xfc98('0x3'));var config=require(_0xfc98('0x4'));config[_0xfc98('0x5')]=_[_0xfc98('0x6')](config[_0xfc98('0x5')],{'host':_0xfc98('0x7'),'port':0x18eb});var io=require(_0xfc98('0x8'))(new Redis(config['redis']));function OpenchannelQueue(_0x5bc528){this['id']=_0x5bc528['id']||0x0;this[_0xfc98('0x9')]=_0x5bc528[_0xfc98('0x9')]||'';this['timeout']=_0x5bc528['timeout']||0xa;this['strategy']=_0x5bc528[_0xfc98('0xa')]||'beepall';this[_0xfc98('0xb')]=_0x5bc528['Agents'];this[_0xfc98('0xc')]={};this[_0xfc98('0xd')]=0x0;this[_0xfc98('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue['prototype'][_0xfc98('0xe')]=function(){var _0x17a5e2=this[_0xfc98('0xc')][_0xfc98('0xf')];this[_0xfc98('0xc')]=_[_0xfc98('0x10')](this[_0xfc98('0xb')],'id');this[_0xfc98('0xc')][_0xfc98('0xf')]=_0x17a5e2;};OpenchannelQueue['prototype'][_0xfc98('0x11')]=function(){this[_0xfc98('0x12')]=0x0;this[_0xfc98('0x13')]=0x0;for(var _0x14737c=0x0;_0x14737c=0x0?this['available']:0x0;var _0x1f6002={'id':this['id'],'available':this[_0xfc98('0x17')],'loggedIn':this['loggedIn'],'name':this[_0xfc98('0x9')],'paused':this[_0xfc98('0x13')],'waiting':this[_0xfc98('0xd')]};var _0x497dbe=md5(JSON[_0xfc98('0x18')](_0x1f6002));if(this[_0xfc98('0x1')]!==_0x497dbe){this[_0xfc98('0x1')]=_0x497dbe;io['to'](util[_0xfc98('0x19')](_0xfc98('0x1a'),_0x1f6002[_0xfc98('0x9')]))['emit']('openchannel_queue:save',_0x1f6002);}};module[_0xfc98('0x1b')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 5b8404a..0daa209 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 _0x006d=['length','online','loggedIn','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','paused'];(function(_0x545e86,_0x46a2ed){var _0xa98055=function(_0x41aa23){while(--_0x41aa23){_0x545e86['push'](_0x545e86['shift']());}};_0xa98055(++_0x46a2ed);}(_0x006d,0xea));var _0xd006=function(_0x2577b8,_0x1f6875){_0x2577b8=_0x2577b8-0x0;var _0x54fad3=_0x006d[_0x2577b8];return _0x54fad3;};'use strict';var _=require(_0xd006('0x0'));var md5=require(_0xd006('0x1'));var util=require(_0xd006('0x2'));var Redis=require(_0xd006('0x3'));var config=require(_0xd006('0x4'));config[_0xd006('0x5')]=_[_0xd006('0x6')](config[_0xd006('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd006('0x5')]));function SmsQueue(_0x1de496){this['id']=_0x1de496['id']||0x0;this['name']=_0x1de496[_0xd006('0x7')]||'';this['timeout']=_0x1de496[_0xd006('0x8')]||0xa;this[_0xd006('0x9')]=_0x1de496[_0xd006('0x9')]||_0xd006('0xa');this['Agents']=_0x1de496[_0xd006('0xb')];this[_0xd006('0xc')]={};this[_0xd006('0xd')]=0x0;this[_0xd006('0x1')]='';this[_0xd006('0xe')]();this['updateRealtime']();}SmsQueue[_0xd006('0xf')]['updateRouting']=function(){var _0x3b69bf=this['mapAgentsId'][_0xd006('0x10')];this[_0xd006('0xc')]=_['map'](this[_0xd006('0xb')],'id');this[_0xd006('0xc')]['_rr']=_0x3b69bf;};SmsQueue[_0xd006('0xf')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xd006('0x11')]=0x0;for(var _0x426e4d=0x0;_0x426e4d=0x0?this[_0xd006('0x15')]:0x0;var _0x5c22ff={'id':this['id'],'available':this['available'],'loggedIn':this[_0xd006('0x14')],'name':this[_0xd006('0x7')],'paused':this[_0xd006('0x11')],'waiting':this[_0xd006('0xd')]};var _0x1d4b73=md5(JSON[_0xd006('0x16')](_0x5c22ff));if(this[_0xd006('0x1')]!==_0x1d4b73){this[_0xd006('0x1')]=_0x1d4b73;io['to'](util[_0xd006('0x17')](_0xd006('0x18'),_0x5c22ff['name']))[_0xd006('0x19')](_0xd006('0x1a'),_0x5c22ff);}};module[_0xd006('0x1b')]=SmsQueue; \ No newline at end of file +var _0xb5fa=['md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit','exports','lodash','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting'];(function(_0x25e2bc,_0x27d1ef){var _0x5152d3=function(_0x354708){while(--_0x354708){_0x25e2bc['push'](_0x25e2bc['shift']());}};_0x5152d3(++_0x27d1ef);}(_0xb5fa,0x133));var _0xab5f=function(_0x327518,_0x1b5b69){_0x327518=_0x327518-0x0;var _0x20225a=_0xb5fa[_0x327518];return _0x20225a;};'use strict';var _=require(_0xab5f('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xab5f('0x1'));var config=require(_0xab5f('0x2'));config[_0xab5f('0x3')]=_['defaults'](config['redis'],{'host':_0xab5f('0x4'),'port':0x18eb});var io=require(_0xab5f('0x5'))(new Redis(config[_0xab5f('0x3')]));function SmsQueue(_0x29c5a7){this['id']=_0x29c5a7['id']||0x0;this['name']=_0x29c5a7[_0xab5f('0x6')]||'';this['timeout']=_0x29c5a7[_0xab5f('0x7')]||0xa;this['strategy']=_0x29c5a7['strategy']||_0xab5f('0x8');this['Agents']=_0x29c5a7[_0xab5f('0x9')];this[_0xab5f('0xa')]={};this[_0xab5f('0xb')]=0x0;this[_0xab5f('0xc')]='';this[_0xab5f('0xd')]();this[_0xab5f('0xe')]();}SmsQueue[_0xab5f('0xf')]['updateRouting']=function(){var _0x13f990=this['mapAgentsId'][_0xab5f('0x10')];this[_0xab5f('0xa')]=_[_0xab5f('0x11')](this[_0xab5f('0x9')],'id');this[_0xab5f('0xa')][_0xab5f('0x10')]=_0x13f990;};SmsQueue[_0xab5f('0xf')][_0xab5f('0xe')]=function(){this[_0xab5f('0x12')]=0x0;this[_0xab5f('0x13')]=0x0;for(var _0x562619=0x0;_0x562619=0x0?this[_0xab5f('0x17')]:0x0;var _0x73ff30={'id':this['id'],'available':this['available'],'loggedIn':this[_0xab5f('0x12')],'name':this[_0xab5f('0x6')],'paused':this['paused'],'waiting':this[_0xab5f('0xb')]};var _0x363195=md5(JSON[_0xab5f('0x18')](_0x73ff30));if(this['md5']!==_0x363195){this[_0xab5f('0xc')]=_0x363195;io['to'](util[_0xab5f('0x19')](_0xab5f('0x1a'),_0x73ff30[_0xab5f('0x6')]))[_0xab5f('0x1b')]('sms_queue:save',_0x73ff30);}};module[_0xab5f('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 27e78b1..e334bc5 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 _0x1099=['initAgents','length','isUndefined','agents','initOpenchannelQueues','updateRouting','initChatQueues','updateRealtime','initMailQueues','initFaxQueues','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','intervals','openchannelQueues','chatQueues','smsQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase'];(function(_0x28ce5d,_0x4d70ff){var _0x3643c1=function(_0x58fe05){while(--_0x58fe05){_0x28ce5d['push'](_0x28ce5d['shift']());}};_0x3643c1(++_0x4d70ff);}(_0x1099,0x1aa));var _0x9109=function(_0x29c62f,_0x495a67){_0x29c62f=_0x29c62f-0x0;var _0x501642=_0x1099[_0x29c62f];return _0x501642;};'use strict';var BPromise=require(_0x9109('0x0'));var util=require('util');var _=require(_0x9109('0x1'));var moment=require(_0x9109('0x2'));var Agent=require(_0x9109('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0x9109('0x4'));var ChatQueue=require(_0x9109('0x5'));var SmsQueue=require(_0x9109('0x6'));var MailQueue=require(_0x9109('0x7'));var FaxQueue=require(_0x9109('0x8'));var Realtime=function(){this['agents']={};this[_0x9109('0x9')]={};this[_0x9109('0xa')]={};this[_0x9109('0xb')]={};this[_0x9109('0xc')]={};this[_0x9109('0xd')]={};this[_0x9109('0xe')]={};this[_0x9109('0xf')]={};this[_0x9109('0x10')]={};this['openchannelQueuesWaitingInteractions']={};this[_0x9109('0x11')]={};this[_0x9109('0x12')]={};};function freeIsNotKey(_0x42a173,_0x308efa,_0x1af60){var _0x25a362=_['mapKeys'](_0x42a173,function(_0x19dddd,_0x5599b0){return _0x19dddd[_0x1af60];});for(var _0x178c96 in _0x308efa){if(_0x308efa[_0x9109('0x13')](_0x178c96)){if(!_0x25a362[_0x178c96]){delete _0x308efa[_0x178c96];}}}}Realtime[_0x9109('0x14')][_0x9109('0x15')]=function(_0x543baa,_0x1e1d93){for(var _0x334145 in _0x1e1d93){if(_0x543baa['hasOwnProperty'](_0x334145)){_0x543baa[_0x334145]=_0x1e1d93[_0x334145];}}};Realtime[_0x9109('0x14')][_0x9109('0x16')]=function(){var _0x2d6562=this;return function(_0x52eca6){if(_0x52eca6){freeIsNotKey(_0x52eca6,_0x2d6562['agents'],'id');for(var _0x5a9e94=0x0,_0x44c90f={},_0x45b067={};_0x5a9e94<_0x52eca6[_0x9109('0x17')];_0x5a9e94+=0x1){_0x44c90f=_0x52eca6[_0x5a9e94];if(_[_0x9109('0x18')](_0x2d6562[_0x9109('0x19')][_0x44c90f['id']])){_0x2d6562[_0x9109('0x19')][_0x44c90f['id']]=new Agent(_0x44c90f);}else{_0x2d6562[_0x9109('0x15')](_0x2d6562[_0x9109('0x19')][_0x44c90f['id']],_0x44c90f);}}}return _0x2d6562[_0x9109('0x19')];};};Realtime['prototype']['initIntervals']=function(){var _0x130efd=this;return function(_0x345d2e){if(_0x345d2e){freeIsNotKey(_0x345d2e,_0x130efd['intervals'],'id');for(var _0x55ed0e=0x0,_0x5c80af={},_0x1f596a={};_0x55ed0e<_0x345d2e[_0x9109('0x17')];_0x55ed0e+=0x1){_0x5c80af=_0x345d2e[_0x55ed0e];if(_['isUndefined'](_0x130efd[_0x9109('0x9')][_0x5c80af['id']])){_0x130efd[_0x9109('0x9')][_0x5c80af['id']]=new Interval(_0x5c80af);}else{_0x130efd[_0x9109('0x15')](_0x130efd[_0x9109('0x9')][_0x5c80af['id']],_0x5c80af);}}}return _0x130efd['intervals'];};};Realtime[_0x9109('0x14')][_0x9109('0x1a')]=function(){var _0x392000=this;return function(_0x377842){if(_0x377842){freeIsNotKey(_0x377842,_0x392000['openchannelQueues'],'id');for(var _0x19e1f6=0x0,_0x56abca={},_0x47ea64={};_0x19e1f6<_0x377842[_0x9109('0x17')];_0x19e1f6+=0x1){_0x56abca=_0x377842[_0x19e1f6];if(_[_0x9109('0x18')](_0x392000[_0x9109('0xa')][_0x56abca['id']])){_0x392000[_0x9109('0xa')][_0x56abca['id']]=new OpenchannelQueue(_0x56abca);}else{_0x392000[_0x9109('0x15')](_0x392000['openchannelQueues'][_0x56abca['id']],_0x56abca);}_0x392000['openchannelQueues'][_0x56abca['id']][_0x9109('0x1b')]();_0x392000[_0x9109('0xa')][_0x56abca['id']]['updateRealtime']();}}return _0x392000[_0x9109('0xa')];};};Realtime['prototype'][_0x9109('0x1c')]=function(){var _0x158a9e=this;return function(_0x516d38){if(_0x516d38){freeIsNotKey(_0x516d38,_0x158a9e['chatQueues'],'id');for(var _0xe62dce=0x0,_0x4ff128={},_0x75fe73={};_0xe62dce<_0x516d38[_0x9109('0x17')];_0xe62dce+=0x1){_0x4ff128=_0x516d38[_0xe62dce];if(_[_0x9109('0x18')](_0x158a9e[_0x9109('0xb')][_0x4ff128['id']])){_0x158a9e['chatQueues'][_0x4ff128['id']]=new ChatQueue(_0x4ff128);}else{_0x158a9e[_0x9109('0x15')](_0x158a9e[_0x9109('0xb')][_0x4ff128['id']],_0x4ff128);}_0x158a9e['chatQueues'][_0x4ff128['id']]['updateRouting']();_0x158a9e[_0x9109('0xb')][_0x4ff128['id']][_0x9109('0x1d')]();}}return _0x158a9e[_0x9109('0xb')];};};Realtime[_0x9109('0x14')]['initSmsQueues']=function(){var _0x594585=this;return function(_0x416c5f){if(_0x416c5f){freeIsNotKey(_0x416c5f,_0x594585[_0x9109('0xc')],'id');for(var _0x4eb573=0x0,_0x2a3ded={},_0x143288={};_0x4eb573<_0x416c5f[_0x9109('0x17')];_0x4eb573+=0x1){_0x2a3ded=_0x416c5f[_0x4eb573];if(_['isUndefined'](_0x594585['smsQueues'][_0x2a3ded['id']])){_0x594585[_0x9109('0xc')][_0x2a3ded['id']]=new SmsQueue(_0x2a3ded);}else{_0x594585[_0x9109('0x15')](_0x594585[_0x9109('0xc')][_0x2a3ded['id']],_0x2a3ded);}_0x594585[_0x9109('0xc')][_0x2a3ded['id']][_0x9109('0x1b')]();_0x594585[_0x9109('0xc')][_0x2a3ded['id']][_0x9109('0x1d')]();}}return _0x594585[_0x9109('0xc')];};};Realtime[_0x9109('0x14')][_0x9109('0x1e')]=function(){var _0x474c16=this;return function(_0xfffc77){if(_0xfffc77){freeIsNotKey(_0xfffc77,_0x474c16[_0x9109('0xd')],'id');for(var _0x58b481=0x0,_0x416be6={},_0x5e6618={};_0x58b481<_0xfffc77[_0x9109('0x17')];_0x58b481+=0x1){_0x416be6=_0xfffc77[_0x58b481];if(_[_0x9109('0x18')](_0x474c16[_0x9109('0xd')][_0x416be6['id']])){_0x474c16[_0x9109('0xd')][_0x416be6['id']]=new MailQueue(_0x416be6);}else{_0x474c16[_0x9109('0x15')](_0x474c16[_0x9109('0xd')][_0x416be6['id']],_0x416be6);}_0x474c16[_0x9109('0xd')][_0x416be6['id']][_0x9109('0x1b')]();_0x474c16['mailQueues'][_0x416be6['id']]['updateRealtime']();}}return _0x474c16[_0x9109('0xd')];};};Realtime['prototype'][_0x9109('0x1f')]=function(){var _0x5708b1=this;return function(_0x526eda){if(_0x526eda){freeIsNotKey(_0x526eda,_0x5708b1[_0x9109('0xe')],'id');for(var _0x10911a=0x0,_0x1b1118={},_0x3c314f={};_0x10911a<_0x526eda[_0x9109('0x17')];_0x10911a+=0x1){_0x1b1118=_0x526eda[_0x10911a];if(_['isUndefined'](_0x5708b1[_0x9109('0xe')][_0x1b1118['id']])){_0x5708b1['faxQueues'][_0x1b1118['id']]=new FaxQueue(_0x1b1118);}else{_0x5708b1[_0x9109('0x15')](_0x5708b1[_0x9109('0xe')][_0x1b1118['id']],_0x1b1118);}_0x5708b1[_0x9109('0xe')][_0x1b1118['id']][_0x9109('0x1b')]();_0x5708b1[_0x9109('0xe')][_0x1b1118['id']][_0x9109('0x1d')]();}}return _0x5708b1[_0x9109('0xe')];};};module['exports']=Realtime; \ No newline at end of file +var _0x0e35=['agents','intervals','openchannelQueues','chatQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','hasOwnProperty','mergeFromDatabase','initAgents','length','isUndefined','prototype','initIntervals','initOpenchannelQueues','updateRouting','updateRealtime','initChatQueues','initSmsQueues','initMailQueues','mailQueues','initFaxQueues','exports','util','lodash','moment','../model/agent','../model/openchannelQueue','../model/faxQueue'];(function(_0x741e19,_0x797454){var _0x16a55a=function(_0xc1b638){while(--_0xc1b638){_0x741e19['push'](_0x741e19['shift']());}};_0x16a55a(++_0x797454);}(_0x0e35,0x123));var _0x50e3=function(_0x599392,_0xea7cbc){_0x599392=_0x599392-0x0;var _0x417177=_0x0e35[_0x599392];return _0x417177;};'use strict';var BPromise=require('bluebird');var util=require(_0x50e3('0x0'));var _=require(_0x50e3('0x1'));var moment=require(_0x50e3('0x2'));var Agent=require(_0x50e3('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0x50e3('0x4'));var ChatQueue=require('../model/chatQueue');var SmsQueue=require('../model/smsQueue');var MailQueue=require('../model/mailQueue');var FaxQueue=require(_0x50e3('0x5'));var Realtime=function(){this[_0x50e3('0x6')]={};this[_0x50e3('0x7')]={};this[_0x50e3('0x8')]={};this[_0x50e3('0x9')]={};this[_0x50e3('0xa')]={};this['mailQueues']={};this[_0x50e3('0xb')]={};this[_0x50e3('0xc')]={};this[_0x50e3('0xd')]={};this[_0x50e3('0xe')]={};this[_0x50e3('0xf')]={};this[_0x50e3('0x10')]={};};function freeIsNotKey(_0x22e37f,_0x562478,_0x479761){var _0x1d1ed2=_['mapKeys'](_0x22e37f,function(_0x404d31,_0x353066){return _0x404d31[_0x479761];});for(var _0x14cdcf in _0x562478){if(_0x562478[_0x50e3('0x11')](_0x14cdcf)){if(!_0x1d1ed2[_0x14cdcf]){delete _0x562478[_0x14cdcf];}}}}Realtime['prototype'][_0x50e3('0x12')]=function(_0x19d4d7,_0x21a3f9){for(var _0x51ac2a in _0x21a3f9){if(_0x19d4d7[_0x50e3('0x11')](_0x51ac2a)){_0x19d4d7[_0x51ac2a]=_0x21a3f9[_0x51ac2a];}}};Realtime['prototype'][_0x50e3('0x13')]=function(){var _0x481b52=this;return function(_0xd89521){if(_0xd89521){freeIsNotKey(_0xd89521,_0x481b52['agents'],'id');for(var _0x15e781=0x0,_0x38984f={},_0x248045={};_0x15e781<_0xd89521[_0x50e3('0x14')];_0x15e781+=0x1){_0x38984f=_0xd89521[_0x15e781];if(_[_0x50e3('0x15')](_0x481b52[_0x50e3('0x6')][_0x38984f['id']])){_0x481b52[_0x50e3('0x6')][_0x38984f['id']]=new Agent(_0x38984f);}else{_0x481b52['mergeFromDatabase'](_0x481b52[_0x50e3('0x6')][_0x38984f['id']],_0x38984f);}}}return _0x481b52[_0x50e3('0x6')];};};Realtime[_0x50e3('0x16')][_0x50e3('0x17')]=function(){var _0x2b90ea=this;return function(_0x551930){if(_0x551930){freeIsNotKey(_0x551930,_0x2b90ea[_0x50e3('0x7')],'id');for(var _0x23bf5e=0x0,_0x350679={},_0x458dbe={};_0x23bf5e<_0x551930['length'];_0x23bf5e+=0x1){_0x350679=_0x551930[_0x23bf5e];if(_[_0x50e3('0x15')](_0x2b90ea[_0x50e3('0x7')][_0x350679['id']])){_0x2b90ea[_0x50e3('0x7')][_0x350679['id']]=new Interval(_0x350679);}else{_0x2b90ea[_0x50e3('0x12')](_0x2b90ea['intervals'][_0x350679['id']],_0x350679);}}}return _0x2b90ea['intervals'];};};Realtime[_0x50e3('0x16')][_0x50e3('0x18')]=function(){var _0x409587=this;return function(_0x349e01){if(_0x349e01){freeIsNotKey(_0x349e01,_0x409587[_0x50e3('0x8')],'id');for(var _0x3caf56=0x0,_0x124719={},_0x407d64={};_0x3caf56<_0x349e01['length'];_0x3caf56+=0x1){_0x124719=_0x349e01[_0x3caf56];if(_[_0x50e3('0x15')](_0x409587[_0x50e3('0x8')][_0x124719['id']])){_0x409587[_0x50e3('0x8')][_0x124719['id']]=new OpenchannelQueue(_0x124719);}else{_0x409587[_0x50e3('0x12')](_0x409587[_0x50e3('0x8')][_0x124719['id']],_0x124719);}_0x409587[_0x50e3('0x8')][_0x124719['id']][_0x50e3('0x19')]();_0x409587[_0x50e3('0x8')][_0x124719['id']][_0x50e3('0x1a')]();}}return _0x409587[_0x50e3('0x8')];};};Realtime[_0x50e3('0x16')][_0x50e3('0x1b')]=function(){var _0x41cb39=this;return function(_0x3164b6){if(_0x3164b6){freeIsNotKey(_0x3164b6,_0x41cb39[_0x50e3('0x9')],'id');for(var _0x455566=0x0,_0x4992af={},_0x4a2945={};_0x455566<_0x3164b6[_0x50e3('0x14')];_0x455566+=0x1){_0x4992af=_0x3164b6[_0x455566];if(_[_0x50e3('0x15')](_0x41cb39['chatQueues'][_0x4992af['id']])){_0x41cb39['chatQueues'][_0x4992af['id']]=new ChatQueue(_0x4992af);}else{_0x41cb39['mergeFromDatabase'](_0x41cb39['chatQueues'][_0x4992af['id']],_0x4992af);}_0x41cb39[_0x50e3('0x9')][_0x4992af['id']][_0x50e3('0x19')]();_0x41cb39[_0x50e3('0x9')][_0x4992af['id']][_0x50e3('0x1a')]();}}return _0x41cb39[_0x50e3('0x9')];};};Realtime['prototype'][_0x50e3('0x1c')]=function(){var _0x598787=this;return function(_0x3757fd){if(_0x3757fd){freeIsNotKey(_0x3757fd,_0x598787['smsQueues'],'id');for(var _0xfc6b22=0x0,_0x382954={},_0x32eb38={};_0xfc6b22<_0x3757fd[_0x50e3('0x14')];_0xfc6b22+=0x1){_0x382954=_0x3757fd[_0xfc6b22];if(_['isUndefined'](_0x598787['smsQueues'][_0x382954['id']])){_0x598787[_0x50e3('0xa')][_0x382954['id']]=new SmsQueue(_0x382954);}else{_0x598787[_0x50e3('0x12')](_0x598787[_0x50e3('0xa')][_0x382954['id']],_0x382954);}_0x598787['smsQueues'][_0x382954['id']]['updateRouting']();_0x598787[_0x50e3('0xa')][_0x382954['id']][_0x50e3('0x1a')]();}}return _0x598787[_0x50e3('0xa')];};};Realtime['prototype'][_0x50e3('0x1d')]=function(){var _0x4b349b=this;return function(_0x11356b){if(_0x11356b){freeIsNotKey(_0x11356b,_0x4b349b[_0x50e3('0x1e')],'id');for(var _0x3a1b76=0x0,_0x2d5c55={},_0x25f04a={};_0x3a1b76<_0x11356b[_0x50e3('0x14')];_0x3a1b76+=0x1){_0x2d5c55=_0x11356b[_0x3a1b76];if(_[_0x50e3('0x15')](_0x4b349b[_0x50e3('0x1e')][_0x2d5c55['id']])){_0x4b349b[_0x50e3('0x1e')][_0x2d5c55['id']]=new MailQueue(_0x2d5c55);}else{_0x4b349b[_0x50e3('0x12')](_0x4b349b[_0x50e3('0x1e')][_0x2d5c55['id']],_0x2d5c55);}_0x4b349b[_0x50e3('0x1e')][_0x2d5c55['id']][_0x50e3('0x19')]();_0x4b349b[_0x50e3('0x1e')][_0x2d5c55['id']][_0x50e3('0x1a')]();}}return _0x4b349b[_0x50e3('0x1e')];};};Realtime[_0x50e3('0x16')][_0x50e3('0x1f')]=function(){var _0x1a953b=this;return function(_0x4be664){if(_0x4be664){freeIsNotKey(_0x4be664,_0x1a953b[_0x50e3('0xb')],'id');for(var _0x4e6bc7=0x0,_0x48078d={},_0x4aa9ac={};_0x4e6bc7<_0x4be664[_0x50e3('0x14')];_0x4e6bc7+=0x1){_0x48078d=_0x4be664[_0x4e6bc7];if(_[_0x50e3('0x15')](_0x1a953b['faxQueues'][_0x48078d['id']])){_0x1a953b[_0x50e3('0xb')][_0x48078d['id']]=new FaxQueue(_0x48078d);}else{_0x1a953b[_0x50e3('0x12')](_0x1a953b[_0x50e3('0xb')][_0x48078d['id']],_0x48078d);}_0x1a953b[_0x50e3('0xb')][_0x48078d['id']][_0x50e3('0x19')]();_0x1a953b[_0x50e3('0xb')][_0x48078d['id']][_0x50e3('0x1a')]();}}return _0x1a953b[_0x50e3('0xb')];};};module[_0x50e3('0x20')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index b7ff489..137cb80 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 _0x36d6=['Request','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x36d6,0x1b0));var _0x636d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36d6[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x636d('0x0'));exports[_0x636d('0x1')]=function(_0x5bb7a1,_0x464350){return client[_0x636d('0x2')]('UpdateChatInteraction',{'body':_0x464350,'options':{'where':{'id':_0x5bb7a1}},'log':_0x636d('0x3')});};exports[_0x636d('0x4')]=function(_0x523479,_0x182adb){return client[_0x636d('0x2')](_0x636d('0x5'),{'body':_0x182adb,'options':{'where':{'id':_0x523479}},'log':_0x636d('0x6')});}; \ No newline at end of file +var _0xd88d=['update','Request','updateChatInteraction','AddTagsToChatInteraction'];(function(_0x412e27,_0x20a978){var _0x53da42=function(_0x43cae5){while(--_0x43cae5){_0x412e27['push'](_0x412e27['shift']());}};_0x53da42(++_0x20a978);}(_0xd88d,0x1d0));var _0xdd88=function(_0x467891,_0x5203a4){_0x467891=_0x467891-0x0;var _0x38c7b9=_0xd88d[_0x467891];return _0x38c7b9;};'use strict';var client=require('../client');exports[_0xdd88('0x0')]=function(_0x3b336b,_0x2c44a9){return client[_0xdd88('0x1')]('UpdateChatInteraction',{'body':_0x2c44a9,'options':{'where':{'id':_0x3b336b}},'log':_0xdd88('0x2')});};exports['addTags']=function(_0x2c7390,_0x57ef90){return client[_0xdd88('0x1')](_0xdd88('0x3'),{'body':_0x57ef90,'options':{'where':{'id':_0x2c7390}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 2f4464e..5145378 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 _0x0758=['../client','Request','CreateChatMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0758,0xbd));var _0x8075=function(_0x3099b9,_0x2c2aa3){_0x3099b9=_0x3099b9-0x0;var _0x28cee0=_0x0758[_0x3099b9];return _0x28cee0;};'use strict';var client=require(_0x8075('0x0'));exports['create']=function(_0xed418d){return client[_0x8075('0x1')](_0x8075('0x2'),{'body':_0xed418d,'log':'createChatMessage'});}; \ No newline at end of file +var _0x772e=['CreateChatMessage','../client','Request'];(function(_0x24a188,_0x4efd77){var _0x493a78=function(_0x7ac91){while(--_0x7ac91){_0x24a188['push'](_0x24a188['shift']());}};_0x493a78(++_0x4efd77);}(_0x772e,0x70));var _0xe772=function(_0x53a331,_0x4d8bdc){_0x53a331=_0x53a331-0x0;var _0x57dbb1=_0x772e[_0x53a331];return _0x57dbb1;};'use strict';var client=require(_0xe772('0x0'));exports['create']=function(_0x1935ca){return client[_0xe772('0x1')](_0xe772('0x2'),{'body':_0x1935ca,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index edabc5c..813f94c 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 _0xc060=['getChatQueues','Request','name','timeout','strategy','Agents','online','../client'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc060,0xbf));var _0x0c06=function(_0x5740f4,_0x5327e6){_0x5740f4=_0x5740f4-0x0;var _0x4f8055=_0xc060[_0x5740f4];return _0x4f8055;};'use strict';var client=require(_0x0c06('0x0'));exports[_0x0c06('0x1')]=function(){return function(){return client[_0x0c06('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x0c06('0x3'),_0x0c06('0x4'),_0x0c06('0x5')],'include':[{'model':'User','as':_0x0c06('0x6'),'attributes':['id',_0x0c06('0x3'),_0x0c06('0x7'),'chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0xab30=['timeout','strategy','User','name','online','../client','getChatQueues','Request','GetChatQueue'];(function(_0x2ac8a5,_0x1769b4){var _0x3d3890=function(_0x47c749){while(--_0x47c749){_0x2ac8a5['push'](_0x2ac8a5['shift']());}};_0x3d3890(++_0x1769b4);}(_0xab30,0x17f));var _0x0ab3=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xab30[_0x2064e5];return _0x21a233;};'use strict';var client=require(_0x0ab3('0x0'));exports[_0x0ab3('0x1')]=function(){return function(){return client[_0x0ab3('0x2')](_0x0ab3('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x0ab3('0x4'),_0x0ab3('0x5')],'include':[{'model':_0x0ab3('0x6'),'as':'Agents','attributes':['id',_0x0ab3('0x7'),_0x0ab3('0x8'),'chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index b335d7e..3d48bbd 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 _0x5ab4=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create'];(function(_0xd3b0ac,_0x2f5065){var _0x3d773e=function(_0x2e10d1){while(--_0x2e10d1){_0xd3b0ac['push'](_0xd3b0ac['shift']());}};_0x3d773e(++_0x2f5065);}(_0x5ab4,0x9f));var _0x45ab=function(_0x241495,_0x3c0027){_0x241495=_0x241495-0x0;var _0x4627f2=_0x5ab4[_0x241495];return _0x4627f2;};'use strict';var client=require(_0x45ab('0x0'));exports[_0x45ab('0x1')]=function(_0x17df82){return client[_0x45ab('0x2')](_0x45ab('0x3'),{'body':_0x17df82,'log':'CreateChatQueueReport'});};exports[_0x45ab('0x4')]=function(_0x2d0e3b,_0x3d5dbd){return client[_0x45ab('0x2')](_0x45ab('0x5'),{'body':_0x3d5dbd,'options':{'where':{'uniqueid':_0x2d0e3b},'order':[['id',_0x45ab('0x6')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x87df=['create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','../client'];(function(_0x4b78b8,_0x4f176b){var _0xd27f04=function(_0x5a52fa){while(--_0x5a52fa){_0x4b78b8['push'](_0x4b78b8['shift']());}};_0xd27f04(++_0x4f176b);}(_0x87df,0x167));var _0xf87d=function(_0x51f3a2,_0x3368c7){_0x51f3a2=_0x51f3a2-0x0;var _0x4ba8f7=_0x87df[_0x51f3a2];return _0x4ba8f7;};'use strict';var client=require(_0xf87d('0x0'));exports[_0xf87d('0x1')]=function(_0x34023a){return client[_0xf87d('0x2')](_0xf87d('0x3'),{'body':_0x34023a,'log':_0xf87d('0x3')});};exports[_0xf87d('0x4')]=function(_0xb0fb5a,_0x25290a){return client[_0xf87d('0x2')]('UpdateChatQueueReport',{'body':_0x25290a,'options':{'where':{'uniqueid':_0xb0fb5a},'order':[['id','DESC']],'limit':0x1},'log':_0xf87d('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index eb56af2..c1a172a 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 _0x4bf0=['addTags','AddTagsToFaxInteraction','addTagsToFaxInteraction','update','Request','UpdateFaxInteraction','updateFaxInteraction'];(function(_0x5913b3,_0x734242){var _0x28b7ad=function(_0x75e16c){while(--_0x75e16c){_0x5913b3['push'](_0x5913b3['shift']());}};_0x28b7ad(++_0x734242);}(_0x4bf0,0x1ae));var _0x04bf=function(_0xd3acc,_0x87a0c3){_0xd3acc=_0xd3acc-0x0;var _0x5cea39=_0x4bf0[_0xd3acc];return _0x5cea39;};'use strict';var client=require('../client');exports[_0x04bf('0x0')]=function(_0x2d2313,_0x805a0c){return client[_0x04bf('0x1')](_0x04bf('0x2'),{'body':_0x805a0c,'options':{'where':{'id':_0x2d2313}},'log':_0x04bf('0x3')});};exports[_0x04bf('0x4')]=function(_0x3d6297,_0x3ac755){return client[_0x04bf('0x1')](_0x04bf('0x5'),{'body':_0x3ac755,'options':{'where':{'id':_0x3d6297}},'log':_0x04bf('0x6')});}; \ No newline at end of file +var _0x5633=['UpdateFaxInteraction','addTags','addTagsToFaxInteraction','../client','update','Request'];(function(_0xb9289f,_0x3d1711){var _0x58e2d2=function(_0x40623f){while(--_0x40623f){_0xb9289f['push'](_0xb9289f['shift']());}};_0x58e2d2(++_0x3d1711);}(_0x5633,0x141));var _0x3563=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x5633[_0x4b2863];return _0x567d67;};'use strict';var client=require(_0x3563('0x0'));exports[_0x3563('0x1')]=function(_0x1c101a,_0x243272){return client[_0x3563('0x2')](_0x3563('0x3'),{'body':_0x243272,'options':{'where':{'id':_0x1c101a}},'log':'updateFaxInteraction'});};exports[_0x3563('0x4')]=function(_0x34a0ae,_0xb6ea33){return client[_0x3563('0x2')]('AddTagsToFaxInteraction',{'body':_0xb6ea33,'options':{'where':{'id':_0x34a0ae}},'log':_0x3563('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 09b139d..d285bee 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 _0xa422=['CreateFaxMessage','createFaxMessage','../client','Request'];(function(_0xeb96a9,_0x499dac){var _0x3eec4c=function(_0x42d094){while(--_0x42d094){_0xeb96a9['push'](_0xeb96a9['shift']());}};_0x3eec4c(++_0x499dac);}(_0xa422,0x1f2));var _0x2a42=function(_0x386d73,_0x48d7a9){_0x386d73=_0x386d73-0x0;var _0x120b9d=_0xa422[_0x386d73];return _0x120b9d;};'use strict';var client=require(_0x2a42('0x0'));exports['create']=function(_0x41392c){return client[_0x2a42('0x1')](_0x2a42('0x2'),{'body':_0x41392c,'log':_0x2a42('0x3')});}; \ No newline at end of file +var _0x00a3=['create','Request','CreateFaxMessage','../client'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x00a3,0xf3));var _0x300a=function(_0x2e31df,_0x5baa27){_0x2e31df=_0x2e31df-0x0;var _0x46342b=_0x00a3[_0x2e31df];return _0x46342b;};'use strict';var client=require(_0x300a('0x0'));exports[_0x300a('0x1')]=function(_0x36118a){return client[_0x300a('0x2')](_0x300a('0x3'),{'body':_0x36118a,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index f19faef..60cb478 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 _0x93fc=['User','Agents','name','online','faxPause','getFaxQueues','../client','Request','GetFaxQueue','timeout','strategy'];(function(_0x407f84,_0x2b75bd){var _0x31eb71=function(_0x12bdce){while(--_0x12bdce){_0x407f84['push'](_0x407f84['shift']());}};_0x31eb71(++_0x2b75bd);}(_0x93fc,0xf8));var _0xc93f=function(_0x4ada3f,_0x3f4756){_0x4ada3f=_0x4ada3f-0x0;var _0x3ddd0c=_0x93fc[_0x4ada3f];return _0x3ddd0c;};'use strict';var client=require(_0xc93f('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0xc93f('0x1')](_0xc93f('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xc93f('0x3'),_0xc93f('0x4')],'include':[{'model':_0xc93f('0x5'),'as':_0xc93f('0x6'),'attributes':['id',_0xc93f('0x7'),_0xc93f('0x8'),_0xc93f('0x9')]}]},'log':_0xc93f('0xa')});};}; \ No newline at end of file +var _0xfa6f=['timeout','User','Agents','online','faxPause','getFaxQueues','../client','Request','GetFaxQueue','name'];(function(_0x2ff739,_0x1c8e0f){var _0x12dc13=function(_0x26fc97){while(--_0x26fc97){_0x2ff739['push'](_0x2ff739['shift']());}};_0x12dc13(++_0x1c8e0f);}(_0xfa6f,0x132));var _0xffa6=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0xfa6f[_0x4bc65f];return _0x44f85f;};'use strict';var client=require(_0xffa6('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0xffa6('0x1')](_0xffa6('0x2'),{'options':{'raw':![],'attributes':['id',_0xffa6('0x3'),_0xffa6('0x4'),'strategy'],'include':[{'model':_0xffa6('0x5'),'as':_0xffa6('0x6'),'attributes':['id',_0xffa6('0x3'),_0xffa6('0x7'),_0xffa6('0x8')]}]},'log':_0xffa6('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index f3f030a..c9915b6 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 _0xe8d6=['create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client'];(function(_0x184bb1,_0xebc9ae){var _0x1fe730=function(_0x5dfd41){while(--_0x5dfd41){_0x184bb1['push'](_0x184bb1['shift']());}};_0x1fe730(++_0xebc9ae);}(_0xe8d6,0xb5));var _0x6e8d=function(_0x52a60a,_0x56bc78){_0x52a60a=_0x52a60a-0x0;var _0x1fa3e3=_0xe8d6[_0x52a60a];return _0x1fa3e3;};'use strict';var client=require(_0x6e8d('0x0'));exports[_0x6e8d('0x1')]=function(_0xbae485){return client[_0x6e8d('0x2')](_0x6e8d('0x3'),{'body':_0xbae485,'log':_0x6e8d('0x3')});};exports[_0x6e8d('0x4')]=function(_0x4ee630,_0x2fb173){return client[_0x6e8d('0x2')](_0x6e8d('0x5'),{'body':_0x2fb173,'options':{'where':{'uniqueid':_0x4ee630},'order':[['id',_0x6e8d('0x6')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0xc19f=['UpdateFaxQueueReport','DESC','../client','Request','CreateFaxQueueReport','update'];(function(_0x1326e3,_0x1c6728){var _0x33d5bb=function(_0x15c64a){while(--_0x15c64a){_0x1326e3['push'](_0x1326e3['shift']());}};_0x33d5bb(++_0x1c6728);}(_0xc19f,0xbc));var _0xfc19=function(_0x26fbd9,_0x159518){_0x26fbd9=_0x26fbd9-0x0;var _0xb3e5d5=_0xc19f[_0x26fbd9];return _0xb3e5d5;};'use strict';var client=require(_0xfc19('0x0'));exports['create']=function(_0xc41f14){return client[_0xfc19('0x1')](_0xfc19('0x2'),{'body':_0xc41f14,'log':_0xfc19('0x2')});};exports[_0xfc19('0x3')]=function(_0xe02637,_0x2ec201){return client[_0xfc19('0x1')](_0xfc19('0x4'),{'body':_0x2ec201,'options':{'where':{'uniqueid':_0xe02637},'order':[['id',_0xfc19('0x5')]],'limit':0x1},'log':_0xfc19('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index f11df46..e8f3e70 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 _0x4849=['Intervals','name','interval','../client','getIntervals','Request','Interval'];(function(_0x5150df,_0x19a3ec){var _0x14e718=function(_0x20ed1d){while(--_0x20ed1d){_0x5150df['push'](_0x5150df['shift']());}};_0x14e718(++_0x19a3ec);}(_0x4849,0xf8));var _0x9484=function(_0x13a701,_0x2c6ef9){_0x13a701=_0x13a701-0x0;var _0x588aff=_0x4849[_0x13a701];return _0x588aff;};'use strict';var client=require(_0x9484('0x0'));exports[_0x9484('0x1')]=function(){return function(){return client[_0x9484('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x9484('0x3'),'as':_0x9484('0x4'),'attributes':['id',_0x9484('0x5'),_0x9484('0x6')]}]},'log':_0x9484('0x1')});};}; \ No newline at end of file +var _0x1b0e=['Request','GetInterval','name','Interval','interval','../client','getIntervals'];(function(_0x5ee244,_0x3cfee0){var _0x30f5c8=function(_0x55088d){while(--_0x55088d){_0x5ee244['push'](_0x5ee244['shift']());}};_0x30f5c8(++_0x3cfee0);}(_0x1b0e,0x132));var _0xe1b0=function(_0x16d376,_0x3e0417){_0x16d376=_0x16d376-0x0;var _0x1f90f9=_0x1b0e[_0x16d376];return _0x1f90f9;};'use strict';var client=require(_0xe1b0('0x0'));exports[_0xe1b0('0x1')]=function(){return function(){return client[_0xe1b0('0x2')](_0xe1b0('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xe1b0('0x4')],'include':[{'model':_0xe1b0('0x5'),'as':'Intervals','attributes':['id','name',_0xe1b0('0x6')]}]},'log':_0xe1b0('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 508a147..afaef81 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 _0x3890=['addTagsToChatInteraction','../client','Request','UpdateMailInteraction','updateMailInteraction','AddTagsToMailInteraction'];(function(_0xc39fed,_0x47bcbd){var _0x370883=function(_0x6f6e0){while(--_0x6f6e0){_0xc39fed['push'](_0xc39fed['shift']());}};_0x370883(++_0x47bcbd);}(_0x3890,0x145));var _0x0389=function(_0x4a5c68,_0x233de3){_0x4a5c68=_0x4a5c68-0x0;var _0x1a516b=_0x3890[_0x4a5c68];return _0x1a516b;};'use strict';var client=require(_0x0389('0x0'));exports['update']=function(_0x1fe65c,_0x5249df){return client[_0x0389('0x1')](_0x0389('0x2'),{'body':_0x5249df,'options':{'where':{'id':_0x1fe65c}},'log':_0x0389('0x3')});};exports['addTags']=function(_0x3a556b,_0x140995){return client['Request'](_0x0389('0x4'),{'body':_0x140995,'options':{'where':{'id':_0x3a556b}},'log':_0x0389('0x5')});}; \ No newline at end of file +var _0xb50e=['AddTagsToMailInteraction','../client','update','Request','UpdateMailInteraction'];(function(_0x48bd5f,_0x1bb073){var _0x20129e=function(_0x2283d8){while(--_0x2283d8){_0x48bd5f['push'](_0x48bd5f['shift']());}};_0x20129e(++_0x1bb073);}(_0xb50e,0x155));var _0xeb50=function(_0x146dd7,_0x4d877d){_0x146dd7=_0x146dd7-0x0;var _0x2af0bb=_0xb50e[_0x146dd7];return _0x2af0bb;};'use strict';var client=require(_0xeb50('0x0'));exports[_0xeb50('0x1')]=function(_0x41f4f6,_0x453380){return client[_0xeb50('0x2')](_0xeb50('0x3'),{'body':_0x453380,'options':{'where':{'id':_0x41f4f6}},'log':'updateMailInteraction'});};exports['addTags']=function(_0x4d4575,_0x194cdf){return client[_0xeb50('0x2')](_0xeb50('0x4'),{'body':_0x194cdf,'options':{'where':{'id':_0x4d4575}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 13045c3..9ce9bf7 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 _0xbce6=['../client','Request','CreateMailMessage','createMailMessage'];(function(_0x2e8646,_0xbd4cea){var _0x4e3f0a=function(_0x142b66){while(--_0x142b66){_0x2e8646['push'](_0x2e8646['shift']());}};_0x4e3f0a(++_0xbd4cea);}(_0xbce6,0xb8));var _0x6bce=function(_0x2af462,_0xba428e){_0x2af462=_0x2af462-0x0;var _0x37cb1e=_0xbce6[_0x2af462];return _0x37cb1e;};'use strict';var client=require(_0x6bce('0x0'));exports['create']=function(_0x258819){return client[_0x6bce('0x1')](_0x6bce('0x2'),{'body':_0x258819,'log':_0x6bce('0x3')});}; \ No newline at end of file +var _0xa57c=['CreateMailMessage','createMailMessage','../client','create','Request'];(function(_0x11dd40,_0x2dc06e){var _0x4d9a9c=function(_0x1b902a){while(--_0x1b902a){_0x11dd40['push'](_0x11dd40['shift']());}};_0x4d9a9c(++_0x2dc06e);}(_0xa57c,0x192));var _0xca57=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xa57c[_0x2e4e19];return _0x9ba20b;};'use strict';var client=require(_0xca57('0x0'));exports[_0xca57('0x1')]=function(_0x3355cc){return client[_0xca57('0x2')](_0xca57('0x3'),{'body':_0x3355cc,'log':_0xca57('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index e30d303..89f604e 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 _0xfbe9=['getMailQueues','Request','GetMailQueue','timeout','User','Agents','name','online'];(function(_0x110389,_0x40dfb5){var _0x14fbda=function(_0x17afc4){while(--_0x17afc4){_0x110389['push'](_0x110389['shift']());}};_0x14fbda(++_0x40dfb5);}(_0xfbe9,0x1f1));var _0x9fbe=function(_0x5e6f3a,_0x4a0ba5){_0x5e6f3a=_0x5e6f3a-0x0;var _0xceef8b=_0xfbe9[_0x5e6f3a];return _0xceef8b;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client[_0x9fbe('0x0')](_0x9fbe('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x9fbe('0x2'),'strategy'],'include':[{'model':_0x9fbe('0x3'),'as':_0x9fbe('0x4'),'attributes':['id',_0x9fbe('0x5'),_0x9fbe('0x6'),'mailPause']}]},'log':_0x9fbe('0x7')});};}; \ No newline at end of file +var _0x261b=['Agents','name','mailPause','getMailQueues','../client','Request','GetMailQueue','timeout','strategy','User'];(function(_0x211a77,_0x18355c){var _0x37ee53=function(_0xc8d3a4){while(--_0xc8d3a4){_0x211a77['push'](_0x211a77['shift']());}};_0x37ee53(++_0x18355c);}(_0x261b,0xd6));var _0xb261=function(_0x3b371c,_0x1f6782){_0x3b371c=_0x3b371c-0x0;var _0x20f2d2=_0x261b[_0x3b371c];return _0x20f2d2;};'use strict';var client=require(_0xb261('0x0'));exports['getMailQueues']=function(){return function(){return client[_0xb261('0x1')](_0xb261('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xb261('0x3'),_0xb261('0x4')],'include':[{'model':_0xb261('0x5'),'as':_0xb261('0x6'),'attributes':['id',_0xb261('0x7'),'online',_0xb261('0x8')]}]},'log':_0xb261('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 1b015ba..329c35e 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 _0xe9d8=['DESC','../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x1d77e4,_0x16c504){var _0x19d03c=function(_0x18bc2b){while(--_0x18bc2b){_0x1d77e4['push'](_0x1d77e4['shift']());}};_0x19d03c(++_0x16c504);}(_0xe9d8,0x19e));var _0x8e9d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe9d8[_0xfae23b];return _0x200640;};'use strict';var client=require(_0x8e9d('0x0'));exports[_0x8e9d('0x1')]=function(_0xd31abd){return client[_0x8e9d('0x2')]('CreateMailQueueReport',{'body':_0xd31abd,'log':_0x8e9d('0x3')});};exports[_0x8e9d('0x4')]=function(_0x17666f,_0x3a107d){return client['Request'](_0x8e9d('0x5'),{'body':_0x3a107d,'options':{'where':{'uniqueid':_0x17666f},'order':[['id',_0x8e9d('0x6')]],'limit':0x1},'log':_0x8e9d('0x5')});}; \ No newline at end of file +var _0xd88a=['CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create','Request'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xd88a,0x185));var _0xad88=function(_0xb98825,_0x554182){_0xb98825=_0xb98825-0x0;var _0x451d90=_0xd88a[_0xb98825];return _0x451d90;};'use strict';var client=require(_0xad88('0x0'));exports[_0xad88('0x1')]=function(_0x56fab6){return client[_0xad88('0x2')](_0xad88('0x3'),{'body':_0x56fab6,'log':_0xad88('0x3')});};exports[_0xad88('0x4')]=function(_0x1ca2f3,_0x54557d){return client[_0xad88('0x2')](_0xad88('0x5'),{'body':_0x54557d,'options':{'where':{'uniqueid':_0x1ca2f3},'order':[['id',_0xad88('0x6')]],'limit':0x1},'log':_0xad88('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 90155d0..b3ae3ae 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 _0xfe1c=['../client','update','Request','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x5ce105,_0x34f3ce){var _0x33d030=function(_0x3e64ef){while(--_0x3e64ef){_0x5ce105['push'](_0x5ce105['shift']());}};_0x33d030(++_0x34f3ce);}(_0xfe1c,0x1e0));var _0xcfe1=function(_0x5b7859,_0x44e40c){_0x5b7859=_0x5b7859-0x0;var _0x42c029=_0xfe1c[_0x5b7859];return _0x42c029;};'use strict';var client=require(_0xcfe1('0x0'));exports[_0xcfe1('0x1')]=function(_0x245c0f,_0x3ce9fa){return client[_0xcfe1('0x2')]('UpdateOpenchannelInteraction',{'body':_0x3ce9fa,'options':{'where':{'id':_0x245c0f}},'log':_0xcfe1('0x3')});};exports['addTags']=function(_0x38bc46,_0x346a4b){return client[_0xcfe1('0x2')](_0xcfe1('0x4'),{'body':_0x346a4b,'options':{'where':{'id':_0x38bc46}},'log':_0xcfe1('0x5')});}; \ No newline at end of file +var _0x83b0=['addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction'];(function(_0x1c7305,_0x35f822){var _0x188819=function(_0x432b2d){while(--_0x432b2d){_0x1c7305['push'](_0x1c7305['shift']());}};_0x188819(++_0x35f822);}(_0x83b0,0x96));var _0x083b=function(_0x4216de,_0x1b0039){_0x4216de=_0x4216de-0x0;var _0x546b83=_0x83b0[_0x4216de];return _0x546b83;};'use strict';var client=require(_0x083b('0x0'));exports[_0x083b('0x1')]=function(_0xf36f14,_0x56818f){return client[_0x083b('0x2')](_0x083b('0x3'),{'body':_0x56818f,'options':{'where':{'id':_0xf36f14}},'log':'updateOpenchannelInteraction'});};exports[_0x083b('0x4')]=function(_0x256e11,_0x42b92f){return client[_0x083b('0x2')](_0x083b('0x5'),{'body':_0x42b92f,'options':{'where':{'id':_0x256e11}},'log':_0x083b('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index f133242..12298b1 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 _0x6f0d=['CreateOpenchannelMessage','create','Request'];(function(_0x4af47c,_0xba1d52){var _0x4f42a6=function(_0x38fdb6){while(--_0x38fdb6){_0x4af47c['push'](_0x4af47c['shift']());}};_0x4f42a6(++_0xba1d52);}(_0x6f0d,0x16c));var _0xd6f0=function(_0xdad72b,_0x2ca1b0){_0xdad72b=_0xdad72b-0x0;var _0x6e1356=_0x6f0d[_0xdad72b];return _0x6e1356;};'use strict';var client=require('../client');exports[_0xd6f0('0x0')]=function(_0x64ebf2){return client[_0xd6f0('0x1')](_0xd6f0('0x2'),{'body':_0x64ebf2,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0xe706=['create','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x3b6a3f,_0x1537d5){var _0x3f7379=function(_0x2167f6){while(--_0x2167f6){_0x3b6a3f['push'](_0x3b6a3f['shift']());}};_0x3f7379(++_0x1537d5);}(_0xe706,0xa3));var _0x6e70=function(_0x338442,_0x1974d1){_0x338442=_0x338442-0x0;var _0x11179b=_0xe706[_0x338442];return _0x11179b;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(_0x311951){return client['Request'](_0x6e70('0x2'),{'body':_0x311951,'log':_0x6e70('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 3efd2ce..ff97564 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 _0xf118=['openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User','Agents','online'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xf118,0x198));var _0x8f11=function(_0x375bfd,_0x7c9e97){_0x375bfd=_0x375bfd-0x0;var _0x5ae9af=_0xf118[_0x375bfd];return _0x5ae9af;};'use strict';var client=require(_0x8f11('0x0'));exports[_0x8f11('0x1')]=function(){return function(){return client[_0x8f11('0x2')](_0x8f11('0x3'),{'options':{'raw':![],'attributes':['id',_0x8f11('0x4'),_0x8f11('0x5'),_0x8f11('0x6')],'include':[{'model':_0x8f11('0x7'),'as':_0x8f11('0x8'),'attributes':['id',_0x8f11('0x4'),_0x8f11('0x9'),_0x8f11('0xa')]}]},'log':_0x8f11('0x1')});};}; \ No newline at end of file +var _0xf704=['timeout','strategy','User','Agents','online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name'];(function(_0x2e686b,_0x1cc985){var _0x156e75=function(_0x2c2c6d){while(--_0x2c2c6d){_0x2e686b['push'](_0x2e686b['shift']());}};_0x156e75(++_0x1cc985);}(_0xf704,0xab));var _0x4f70=function(_0x4b0eab,_0x4862cb){_0x4b0eab=_0x4b0eab-0x0;var _0x373dd3=_0xf704[_0x4b0eab];return _0x373dd3;};'use strict';var client=require(_0x4f70('0x0'));exports[_0x4f70('0x1')]=function(){return function(){return client[_0x4f70('0x2')](_0x4f70('0x3'),{'options':{'raw':![],'attributes':['id',_0x4f70('0x4'),_0x4f70('0x5'),_0x4f70('0x6')],'include':[{'model':_0x4f70('0x7'),'as':_0x4f70('0x8'),'attributes':['id',_0x4f70('0x4'),_0x4f70('0x9'),_0x4f70('0xa')]}]},'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 9e805d8..9259b41 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 _0xfa62=['create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client'];(function(_0x3f6bcf,_0x531e79){var _0x1c5350=function(_0x282fc5){while(--_0x282fc5){_0x3f6bcf['push'](_0x3f6bcf['shift']());}};_0x1c5350(++_0x531e79);}(_0xfa62,0x12c));var _0x2fa6=function(_0x55c39d,_0x250583){_0x55c39d=_0x55c39d-0x0;var _0x4958ab=_0xfa62[_0x55c39d];return _0x4958ab;};'use strict';var client=require(_0x2fa6('0x0'));exports[_0x2fa6('0x1')]=function(_0x5696c6){return client[_0x2fa6('0x2')](_0x2fa6('0x3'),{'body':_0x5696c6,'log':_0x2fa6('0x3')});};exports[_0x2fa6('0x4')]=function(_0x5db787,_0x5bd4cc){return client['Request'](_0x2fa6('0x5'),{'body':_0x5bd4cc,'options':{'where':{'uniqueid':_0x5db787},'order':[['id',_0x2fa6('0x6')]],'limit':0x1},'log':_0x2fa6('0x5')});}; \ No newline at end of file +var _0xe64a=['UpdateOpenchannelQueueReport','DESC','../client','create','CreateOpenchannelQueueReport','update'];(function(_0x2fe5e4,_0x43a312){var _0x5ece82=function(_0x1c3e3b){while(--_0x1c3e3b){_0x2fe5e4['push'](_0x2fe5e4['shift']());}};_0x5ece82(++_0x43a312);}(_0xe64a,0x1e2));var _0xae64=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe64a[_0x57b54c];return _0x59cc19;};'use strict';var client=require(_0xae64('0x0'));exports[_0xae64('0x1')]=function(_0x157341){return client['Request'](_0xae64('0x2'),{'body':_0x157341,'log':_0xae64('0x2')});};exports[_0xae64('0x3')]=function(_0x59f46a,_0x315f9c){return client['Request'](_0xae64('0x4'),{'body':_0x315f9c,'options':{'where':{'uniqueid':_0x59f46a},'order':[['id',_0xae64('0x5')]],'limit':0x1},'log':_0xae64('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 01d674f..910eaf4 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 _0x08e2=['../client','update','Request','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x08e2,0x8c));var _0x208e=function(_0x275f3c,_0x2316f1){_0x275f3c=_0x275f3c-0x0;var _0x15b771=_0x08e2[_0x275f3c];return _0x15b771;};'use strict';var client=require(_0x208e('0x0'));exports[_0x208e('0x1')]=function(_0x2dd19c,_0x12e3c8){return client[_0x208e('0x2')]('UpdateSmsInteraction',{'body':_0x12e3c8,'options':{'where':{'id':_0x2dd19c}},'log':_0x208e('0x3')});};exports[_0x208e('0x4')]=function(_0x19e7a4,_0x925327){return client[_0x208e('0x2')](_0x208e('0x5'),{'body':_0x925327,'options':{'where':{'id':_0x19e7a4}},'log':_0x208e('0x6')});}; \ No newline at end of file +var _0x926e=['updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x926e,0xf8));var _0xe926=function(_0x54f3c7,_0x5e33ed){_0x54f3c7=_0x54f3c7-0x0;var _0x52b079=_0x926e[_0x54f3c7];return _0x52b079;};'use strict';var client=require(_0xe926('0x0'));exports[_0xe926('0x1')]=function(_0x1b489e,_0x3fa09d){return client[_0xe926('0x2')](_0xe926('0x3'),{'body':_0x3fa09d,'options':{'where':{'id':_0x1b489e}},'log':_0xe926('0x4')});};exports['addTags']=function(_0x57d926,_0x515783){return client[_0xe926('0x2')](_0xe926('0x5'),{'body':_0x515783,'options':{'where':{'id':_0x57d926}},'log':_0xe926('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 28d7064..a96247d 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 _0x6108=['Request','CreateSmsMessage','../client'];(function(_0x20f87f,_0x26ba32){var _0x322b2b=function(_0x4b4e11){while(--_0x4b4e11){_0x20f87f['push'](_0x20f87f['shift']());}};_0x322b2b(++_0x26ba32);}(_0x6108,0xbc));var _0x8610=function(_0x537d6e,_0x51e9cd){_0x537d6e=_0x537d6e-0x0;var _0x14fd81=_0x6108[_0x537d6e];return _0x14fd81;};'use strict';var client=require(_0x8610('0x0'));exports['create']=function(_0xb0b92a){return client[_0x8610('0x1')](_0x8610('0x2'),{'body':_0xb0b92a,'log':'createSmsMessage'});}; \ No newline at end of file +var _0xcc19=['create','Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x473ee7,_0x4dd754){var _0x30f0d4=function(_0x4d961d){while(--_0x4d961d){_0x473ee7['push'](_0x473ee7['shift']());}};_0x30f0d4(++_0x4dd754);}(_0xcc19,0xbd));var _0x9cc1=function(_0x118139,_0x7ce965){_0x118139=_0x118139-0x0;var _0x2fece9=_0xcc19[_0x118139];return _0x2fece9;};'use strict';var client=require(_0x9cc1('0x0'));exports[_0x9cc1('0x1')]=function(_0x5a379c){return client[_0x9cc1('0x2')](_0x9cc1('0x3'),{'body':_0x5a379c,'log':_0x9cc1('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 4b52310..250bac0 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 _0xdb8b=['Agents','name','online','smsPause','getSmsQueues','Request','GetSmsQueue','strategy'];(function(_0x3827fb,_0xc26585){var _0x580ca5=function(_0x46f6b8){while(--_0x46f6b8){_0x3827fb['push'](_0x3827fb['shift']());}};_0x580ca5(++_0xc26585);}(_0xdb8b,0x1c4));var _0xbdb8=function(_0x43f196,_0x255c29){_0x43f196=_0x43f196-0x0;var _0x3204fa=_0xdb8b[_0x43f196];return _0x3204fa;};'use strict';var client=require('../client');exports[_0xbdb8('0x0')]=function(){return function(){return client[_0xbdb8('0x1')](_0xbdb8('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xbdb8('0x3')],'include':[{'model':'User','as':_0xbdb8('0x4'),'attributes':['id',_0xbdb8('0x5'),_0xbdb8('0x6'),_0xbdb8('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xd237=['getSmsQueues','Request','GetSmsQueue','timeout','User','Agents','name','online','smsPause','../client'];(function(_0x573d1c,_0x21f2f1){var _0x5d9e18=function(_0x26b076){while(--_0x26b076){_0x573d1c['push'](_0x573d1c['shift']());}};_0x5d9e18(++_0x21f2f1);}(_0xd237,0x12b));var _0x7d23=function(_0x355e8e,_0x4313f0){_0x355e8e=_0x355e8e-0x0;var _0x52cb43=_0xd237[_0x355e8e];return _0x52cb43;};'use strict';var client=require(_0x7d23('0x0'));exports[_0x7d23('0x1')]=function(){return function(){return client[_0x7d23('0x2')](_0x7d23('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x7d23('0x4'),'strategy'],'include':[{'model':_0x7d23('0x5'),'as':_0x7d23('0x6'),'attributes':['id',_0x7d23('0x7'),_0x7d23('0x8'),_0x7d23('0x9')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index b78ad60..0e24c30 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 _0x094c=['create','CreateSmsQueueReport','Request','UpdateSmsQueueReport','DESC'];(function(_0x20777c,_0x45753b){var _0x4795c3=function(_0x35e35c){while(--_0x35e35c){_0x20777c['push'](_0x20777c['shift']());}};_0x4795c3(++_0x45753b);}(_0x094c,0x131));var _0xc094=function(_0x57ed68,_0x13cab4){_0x57ed68=_0x57ed68-0x0;var _0x5a46f9=_0x094c[_0x57ed68];return _0x5a46f9;};'use strict';var client=require('../client');exports[_0xc094('0x0')]=function(_0x1fc9a5){return client['Request'](_0xc094('0x1'),{'body':_0x1fc9a5,'log':_0xc094('0x1')});};exports['update']=function(_0x342b0f,_0x23b9da){return client[_0xc094('0x2')](_0xc094('0x3'),{'body':_0x23b9da,'options':{'where':{'uniqueid':_0x342b0f},'order':[['id',_0xc094('0x4')]],'limit':0x1},'log':_0xc094('0x3')});}; \ No newline at end of file +var _0xa3d5=['update','UpdateSmsQueueReport','DESC','../client','create','Request','CreateSmsQueueReport'];(function(_0x2d9c41,_0x3e32ff){var _0x420f90=function(_0x4bcbdc){while(--_0x4bcbdc){_0x2d9c41['push'](_0x2d9c41['shift']());}};_0x420f90(++_0x3e32ff);}(_0xa3d5,0xc7));var _0x5a3d=function(_0x5a6961,_0xd41ca6){_0x5a6961=_0x5a6961-0x0;var _0x4af0a6=_0xa3d5[_0x5a6961];return _0x4af0a6;};'use strict';var client=require(_0x5a3d('0x0'));exports[_0x5a3d('0x1')]=function(_0x2f462a){return client[_0x5a3d('0x2')]('CreateSmsQueueReport',{'body':_0x2f462a,'log':_0x5a3d('0x3')});};exports[_0x5a3d('0x4')]=function(_0x21e829,_0x177039){return client[_0x5a3d('0x2')](_0x5a3d('0x5'),{'body':_0x177039,'options':{'where':{'uniqueid':_0x21e829},'order':[['id',_0x5a3d('0x6')]],'limit':0x1},'log':_0x5a3d('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 3cd8530..e779d20 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 _0x50bc=['lastPauseAt','voicePause','mailPause','faxPause','smsPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity','openchannelCapacity','getAgents','Request','GetUser','agent','name','pauseType'];(function(_0xe89d97,_0x33e5ac){var _0x1b6e5d=function(_0x5618cb){while(--_0x5618cb){_0xe89d97['push'](_0xe89d97['shift']());}};_0x1b6e5d(++_0x33e5ac);}(_0x50bc,0xfb));var _0xc50b=function(_0x671461,_0xdb73a3){_0x671461=_0x671461-0x0;var _0x1f83c1=_0x50bc[_0x671461];return _0x1f83c1;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0xc50b('0x0')](_0xc50b('0x1'),{'options':{'raw':!![],'where':{'role':_0xc50b('0x2')},'attributes':['id',_0xc50b('0x3'),'online',_0xc50b('0x4'),_0xc50b('0x5'),_0xc50b('0x6'),'chatPause',_0xc50b('0x7'),_0xc50b('0x8'),_0xc50b('0x9'),_0xc50b('0xa'),_0xc50b('0xb'),_0xc50b('0xc'),_0xc50b('0xd'),'smsCapacity',_0xc50b('0xe')]},'log':_0xc50b('0xf')});};}; \ No newline at end of file +var _0xac75=['smsCapacity','openchannelCapacity','../client','getAgents','Request','name','online','pauseType','voicePause','chatPause','faxPause','smsPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity'];(function(_0xeb7b15,_0x3faeb1){var _0x2107ee=function(_0x1f5034){while(--_0x1f5034){_0xeb7b15['push'](_0xeb7b15['shift']());}};_0x2107ee(++_0x3faeb1);}(_0xac75,0x1b2));var _0x5ac7=function(_0x2ecb22,_0x160464){_0x2ecb22=_0x2ecb22-0x0;var _0x2614e5=_0xac75[_0x2ecb22];return _0x2614e5;};'use strict';var client=require(_0x5ac7('0x0'));exports[_0x5ac7('0x1')]=function(){return function(){return client[_0x5ac7('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x5ac7('0x3'),_0x5ac7('0x4'),_0x5ac7('0x5'),'lastPauseAt',_0x5ac7('0x6'),_0x5ac7('0x7'),'mailPause',_0x5ac7('0x8'),_0x5ac7('0x9'),_0x5ac7('0xa'),_0x5ac7('0xb'),_0x5ac7('0xc'),_0x5ac7('0xd'),_0x5ac7('0xe'),_0x5ac7('0xf')]},'log':_0x5ac7('0x1')});};}; \ 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 6575fb5..e474105 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 _0x7295=['[%s][QUEUE]\x20%s','stack','lodash','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','validate','length','error','[%s][AGENT]\x20%s','map','message','join','stop','agents','timeout','atimeout','channel','end','close','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','[%s][AGENT]\x20ROUTING\x20END','next','agent'];(function(_0x47488f,_0x285360){var _0x3f6129=function(_0x40bdc6){while(--_0x40bdc6){_0x47488f['push'](_0x47488f['shift']());}};_0x3f6129(++_0x285360);}(_0x7295,0xac));var _0x5729=function(_0x102123,_0x5c1a48){_0x102123=_0x102123-0x0;var _0x151fee=_0x7295[_0x102123];return _0x151fee;};'use strict';var schema=require('validate');var _=require(_0x5729('0x0'));var util=require('util');var seqqueue=require('seq-queue');var logger=require(_0x5729('0x1'))(_0x5729('0x2'));var strategy=require(_0x5729('0x3'));var queue=schema({'name':{'type':_0x5729('0x4'),'required':!![],'message':_0x5729('0x5')},'timeout':{'type':_0x5729('0x6'),'message':_0x5729('0x7')}});function writeLog(_0x329d9e,_0x223e5d,_0x4794cf){return logger[_0x5729('0x8')](util[_0x5729('0x9')](_0x5729('0xa'),_0x329d9e,_0x223e5d[_0x5729('0xb')],_0x4794cf));}function handleFindAgent(_0x221bd2){return function(_0x4ff317){return _0x4ff317['name'][_0x5729('0xc')]()===_0x221bd2['toLowerCase']();};}exports['consequence']=function(_0x478c95,_0x43ffc4,_0x5a086c,_0x2820ff){return function(_0x731517){try{var _0x1e18e4={'name':_0x43ffc4[0x0],'timeout':_0x43ffc4[0x1]};var _0x5d0cf0=queue[_0x5729('0xd')](_0x1e18e4,{'typecast':!![]});if(_0x5d0cf0[_0x5729('0xe')]){logger[_0x5729('0xf')](_0x5729('0x10'),_0x478c95,_[_0x5729('0x11')](_0x5d0cf0,_0x5729('0x12'))[_0x5729('0x13')](',\x20'));_0x731517[_0x5729('0x14')]();}else{var _0x3d03c5=_['find'](_0x5a086c[_0x5729('0x15')],handleFindAgent(_0x1e18e4[_0x5729('0xb')]));if(_0x3d03c5){var _0x5a3a78=(_0x1e18e4[_0x5729('0x16')]||0xa)*0x3e8;var _0xa4f42c,_0x21343f;var _0x3e2043=seqqueue['createQueue'](_0x5a3a78);_0x3e2043['id']=_0x478c95;_0x3e2043[_0x5729('0x17')]=_0x5a3a78;_0x3e2043[_0x5729('0x18')]=_0x2820ff[_0x5729('0x18')];writeLog(_0x478c95,_0x3d03c5,util[_0x5729('0x9')]('START:%s',_0x5a3a78));_0x5a086c['rules'][_0x478c95]['on'](_0x5729('0x19'),function(){_0x3e2043[_0x5729('0x1a')]();clearTimeout(_0x21343f);_0x21343f=undefined;if(_0x5a086c[_0x5729('0x1b')][_0x478c95]){delete _0x5a086c[_0x5729('0x1b')][_0x478c95];}logger['info'](_0x5729('0x1c'),_0x478c95);_0x731517[_0x5729('0x14')]();});_0x21343f=setTimeout(function(){clearTimeout(_0x21343f);_0x3e2043[_0x5729('0x1a')]();logger['info'](_0x5729('0x1d'),_0x478c95);_0x731517[_0x5729('0x1e')]();},_0x5a3a78);strategy[_0x5729('0x1f')](_0x3e2043,_0x3d03c5,_0x5a086c,_0x2820ff);}else{logger[_0x5729('0xf')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x478c95,_0x1e18e4['name']);_0x731517[_0x5729('0x14')]();}}}catch(_0x3807d1){console['log'](_0x3807d1);logger[_0x5729('0xf')](_0x5729('0x20'),_0x478c95,_0x3807d1[_0x5729('0x21')]);_0x731517[_0x5729('0x14')]();}};}; \ No newline at end of file +var _0xe509=['map','message','find','agents','timeout','createQueue','atimeout','channel','rules','end','close','[%s][AGENT]\x20ROUTING\x20STOPPED','stop','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s'];(function(_0x585d81,_0xf6d74f){var _0x1aca0d=function(_0x3782d3){while(--_0x3782d3){_0x585d81['push'](_0x585d81['shift']());}};_0x1aca0d(++_0xf6d74f);}(_0xe509,0x187));var _0x9e50=function(_0x49f8c2,_0x5166b7){_0x49f8c2=_0x49f8c2-0x0;var _0x3e63ec=_0xe509[_0x49f8c2];return _0x3e63ec;};'use strict';var schema=require(_0x9e50('0x0'));var _=require(_0x9e50('0x1'));var util=require(_0x9e50('0x2'));var seqqueue=require(_0x9e50('0x3'));var logger=require(_0x9e50('0x4'))(_0x9e50('0x5'));var strategy=require(_0x9e50('0x6'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x9e50('0x7')},'timeout':{'type':_0x9e50('0x8'),'message':_0x9e50('0x9')}});function writeLog(_0x53f82f,_0x58b538,_0x39bb07){return logger[_0x9e50('0xa')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x53f82f,_0x58b538['name'],_0x39bb07));}function handleFindAgent(_0x2f35c5){return function(_0x45a6c1){return _0x45a6c1[_0x9e50('0xb')][_0x9e50('0xc')]()===_0x2f35c5['toLowerCase']();};}exports[_0x9e50('0xd')]=function(_0x1ba02b,_0x321180,_0x22b2d7,_0x275f8f){return function(_0x141052){try{var _0x495bfa={'name':_0x321180[0x0],'timeout':_0x321180[0x1]};var _0x1032c6=queue['validate'](_0x495bfa,{'typecast':!![]});if(_0x1032c6[_0x9e50('0xe')]){logger[_0x9e50('0xf')](_0x9e50('0x10'),_0x1ba02b,_[_0x9e50('0x11')](_0x1032c6,_0x9e50('0x12'))['join'](',\x20'));_0x141052['stop']();}else{var _0x55ae9d=_[_0x9e50('0x13')](_0x22b2d7[_0x9e50('0x14')],handleFindAgent(_0x495bfa[_0x9e50('0xb')]));if(_0x55ae9d){var _0x1029e5=(_0x495bfa[_0x9e50('0x15')]||0xa)*0x3e8;var _0x4c454e,_0x2a44b6;var _0x2e242b=seqqueue[_0x9e50('0x16')](_0x1029e5);_0x2e242b['id']=_0x1ba02b;_0x2e242b[_0x9e50('0x17')]=_0x1029e5;_0x2e242b[_0x9e50('0x18')]=_0x275f8f['channel'];writeLog(_0x1ba02b,_0x55ae9d,util['format']('START:%s',_0x1029e5));_0x22b2d7[_0x9e50('0x19')][_0x1ba02b]['on'](_0x9e50('0x1a'),function(){_0x2e242b[_0x9e50('0x1b')]();clearTimeout(_0x2a44b6);_0x2a44b6=undefined;if(_0x22b2d7[_0x9e50('0x19')][_0x1ba02b]){delete _0x22b2d7[_0x9e50('0x19')][_0x1ba02b];}logger[_0x9e50('0xa')](_0x9e50('0x1c'),_0x1ba02b);_0x141052[_0x9e50('0x1d')]();});_0x2a44b6=setTimeout(function(){clearTimeout(_0x2a44b6);_0x2e242b[_0x9e50('0x1b')]();logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x1ba02b);_0x141052['next']();},_0x1029e5);strategy[_0x9e50('0x1e')](_0x2e242b,_0x55ae9d,_0x22b2d7,_0x275f8f);}else{logger[_0x9e50('0xf')](_0x9e50('0x1f'),_0x1ba02b,_0x495bfa[_0x9e50('0xb')]);_0x141052[_0x9e50('0x1d')]();}}}catch(_0x326a59){console['log'](_0x326a59);logger[_0x9e50('0xf')](_0x9e50('0x20'),_0x1ba02b,_0x326a59[_0x9e50('0x21')]);_0x141052[_0x9e50('0x1d')]();}};}; \ 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 817fe0b..3302485 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 _0x8899=['body','getMustacheRender','Message','create','then','catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','Failed','lodash','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','channel','chat','AccountId','upperFirst','created','isEmpty'];(function(_0x1a1087,_0x200642){var _0x1559ff=function(_0x17c430){while(--_0x17c430){_0x1a1087['push'](_0x1a1087['shift']());}};_0x1559ff(++_0x200642);}(_0x8899,0xd0));var _0x9889=function(_0x483d6a,_0x5c3688){_0x483d6a=_0x483d6a-0x0;var _0x2b9a4f=_0x8899[_0x483d6a];return _0x2b9a4f;};'use strict';var _=require(_0x9889('0x0'));var moment=require('moment');var AWS=require(_0x9889('0x1'));var utils=require('./utils');var logger=require(_0x9889('0x2'))(_0x9889('0x3'));var rpc={'chatMessage':require(_0x9889('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x9889('0x5')),'faxMessage':require(_0x9889('0x6'))};exports['consequence']=function(_0x523cc2,_0x14193f){return function(_0x568650){try{if(!_[_0x9889('0x7')](this[_0x9889('0x8')][_0x9889('0x9')])){logger[_0x9889('0xa')](_0x9889('0xb'),_0x523cc2,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x568650[_0x9889('0xc')]();}var _0x5d9545={'ContactId':this[_0x9889('0xd')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};var _0xeb7119=this[_0x9889('0xe')];if(_0xeb7119===_0x9889('0xf')){_0x5d9545['ChatWebsiteId']=this['account']['id'];}else{_0x5d9545[_['upperFirst'](_0xeb7119)+_0x9889('0x10')]=this['account']['id'];}_0x5d9545[_[_0x9889('0x11')](_0xeb7119)+'InteractionId']=this['interaction']['id'];if(this[_0x9889('0x8')][_0x9889('0x12')]){var _0x323bc2=_0x14193f[0x4];if(!_[_0x9889('0x13')](_0x323bc2)){_0x5d9545[_0x9889('0x14')]=utils[_0x9889('0x15')](_0x323bc2,this);return rpc[_0xeb7119+_0x9889('0x16')][_0x9889('0x17')](_0x5d9545)[_0x9889('0x18')](function(_0x31250e){logger['info'](_0x9889('0xb'),_0x523cc2,_0x5d9545[_0x9889('0x14')]);})[_0x9889('0x19')](function(_0x4af2ac){logger[_0x9889('0x1a')](_0x9889('0xb'),_0x523cc2,JSON[_0x9889('0x1b')](_0x4af2ac));})['finally'](function(){logger[_0x9889('0xa')](_0x9889('0x1c'),_0x523cc2);_0x568650[_0x9889('0x1d')]();});}else{logger[_0x9889('0xa')](_0x9889('0x1e'),_0x523cc2);_0x568650[_0x9889('0x1d')]();}}else{var _0x27fcd3=this;var _0x34998e=new AWS[(_0x9889('0x1f'))]({'accessKeyId':_0x14193f[0x0],'secretAccessKey':_0x14193f[0x1],'region':_0x14193f[0x2]});var _0xb96142={'botAlias':_0x9889('0x20'),'botName':_0x14193f[0x3],'inputText':this[_0x9889('0x21')]['body'],'userId':this[_0x9889('0x8')]['id'][_0x9889('0x22')]()};_0x34998e[_0x9889('0x23')](_0xb96142,function(_0x5cfb0c,_0x25fcee){if(_0x5cfb0c){logger[_0x9889('0x1a')](_0x9889('0xb'),_0x523cc2,_0x5cfb0c[_0x9889('0x21')]);_0x568650[_0x9889('0xc')]();}else if(_0x25fcee&&_0x25fcee[_0x9889('0x21')]){_0x27fcd3[_0x9889('0x14')][_0x9889('0x24')]=_0x25fcee;_0x5d9545[_0x9889('0x14')]=_0x25fcee[_0x9889('0x21')];return rpc[_0xeb7119+_0x9889('0x16')][_0x9889('0x17')](_0x5d9545)[_0x9889('0x18')](function(_0x24caf0){logger[_0x9889('0xa')](_0x9889('0xb'),_0x523cc2,_0x5d9545[_0x9889('0x14')]);if(_0x25fcee['dialogState']==_0x9889('0x25')){_0x568650['next']();}else{_0x568650[_0x9889('0x1d')]();}})[_0x9889('0x19')](function(_0x10f89e){logger[_0x9889('0x1a')](_0x9889('0xb'),_0x523cc2,JSON['stringify'](_0x10f89e));_0x568650[_0x9889('0xc')]();});}else{_0x568650[_0x9889('0xc')]();}});}}catch(_0x55e067){logger[_0x9889('0x1a')]('[%s][AMAZONLEX]\x20%s',_0x523cc2,JSON[_0x9889('0x1b')](_0x55e067));_0x568650['stop']();}};}; \ No newline at end of file +var _0xc581=['lodash','moment','aws-sdk','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','created','body','getMustacheRender','error','stringify','stop','LexRuntime','$LATEST','message','toString','postText','next','amazonlex','Message','create','then','catch'];(function(_0x1e8069,_0x1498d1){var _0x138614=function(_0x39cb81){while(--_0x39cb81){_0x1e8069['push'](_0x1e8069['shift']());}};_0x138614(++_0x1498d1);}(_0xc581,0x150));var _0x1c58=function(_0x3c19fe,_0x2e1b96){_0x3c19fe=_0x3c19fe-0x0;var _0x25245a=_0xc581[_0x3c19fe];return _0x25245a;};'use strict';var _=require(_0x1c58('0x0'));var moment=require(_0x1c58('0x1'));var AWS=require(_0x1c58('0x2'));var utils=require(_0x1c58('0x3'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x1c58('0x4')),'openchannelMessage':require(_0x1c58('0x5')),'mailMessage':require(_0x1c58('0x6')),'smsMessage':require(_0x1c58('0x7')),'faxMessage':require(_0x1c58('0x8'))};exports[_0x1c58('0x9')]=function(_0x3a17f7,_0xd32d53){return function(_0x1b5e53){try{if(!_['isNil'](this['interaction'][_0x1c58('0xa')])){logger[_0x1c58('0xb')](_0x1c58('0xc'),_0x3a17f7,_0x1c58('0xd'));return _0x1b5e53['next']();}var _0x52d908={'ContactId':this[_0x1c58('0xe')]['id'],'sentAt':moment()['format'](_0x1c58('0xf')),'direction':_0x1c58('0x10')};var _0x5a45c6=this[_0x1c58('0x11')];if(_0x5a45c6===_0x1c58('0x12')){_0x52d908[_0x1c58('0x13')]=this[_0x1c58('0x14')]['id'];}else{_0x52d908[_[_0x1c58('0x15')](_0x5a45c6)+_0x1c58('0x16')]=this[_0x1c58('0x14')]['id'];}_0x52d908[_[_0x1c58('0x15')](_0x5a45c6)+_0x1c58('0x17')]=this[_0x1c58('0x18')]['id'];if(this['interaction'][_0x1c58('0x19')]){var _0x291cc6=_0xd32d53[0x4];if(!_['isEmpty'](_0x291cc6)){_0x52d908[_0x1c58('0x1a')]=utils[_0x1c58('0x1b')](_0x291cc6,this);return rpc[_0x5a45c6+'Message']['create'](_0x52d908)['then'](function(_0x5e2455){logger[_0x1c58('0xb')](_0x1c58('0xc'),_0x3a17f7,_0x52d908[_0x1c58('0x1a')]);})['catch'](function(_0x566527){logger[_0x1c58('0x1c')]('[%s][AMAZONLEX]\x20%s',_0x3a17f7,JSON[_0x1c58('0x1d')](_0x566527));})['finally'](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x3a17f7);_0x1b5e53['stop']();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x3a17f7);_0x1b5e53[_0x1c58('0x1e')]();}}else{var _0x5e4633=this;var _0xb35758=new AWS[(_0x1c58('0x1f'))]({'accessKeyId':_0xd32d53[0x0],'secretAccessKey':_0xd32d53[0x1],'region':_0xd32d53[0x2]});var _0x27e421={'botAlias':_0x1c58('0x20'),'botName':_0xd32d53[0x3],'inputText':this[_0x1c58('0x21')][_0x1c58('0x1a')],'userId':this[_0x1c58('0x18')]['id'][_0x1c58('0x22')]()};_0xb35758[_0x1c58('0x23')](_0x27e421,function(_0x2680f0,_0x7fa11d){if(_0x2680f0){logger[_0x1c58('0x1c')](_0x1c58('0xc'),_0x3a17f7,_0x2680f0[_0x1c58('0x21')]);_0x1b5e53[_0x1c58('0x24')]();}else if(_0x7fa11d&&_0x7fa11d[_0x1c58('0x21')]){_0x5e4633['body'][_0x1c58('0x25')]=_0x7fa11d;_0x52d908[_0x1c58('0x1a')]=_0x7fa11d[_0x1c58('0x21')];return rpc[_0x5a45c6+_0x1c58('0x26')][_0x1c58('0x27')](_0x52d908)[_0x1c58('0x28')](function(_0x7752da){logger[_0x1c58('0xb')](_0x1c58('0xc'),_0x3a17f7,_0x52d908[_0x1c58('0x1a')]);if(_0x7fa11d['dialogState']=='Failed'){_0x1b5e53[_0x1c58('0x24')]();}else{_0x1b5e53['stop']();}})[_0x1c58('0x29')](function(_0x158799){logger['error'](_0x1c58('0xc'),_0x3a17f7,JSON['stringify'](_0x158799));_0x1b5e53[_0x1c58('0x24')]();});}else{_0x1b5e53[_0x1c58('0x24')]();}});}}catch(_0x4b8ae9){logger[_0x1c58('0x1c')](_0x1c58('0xc'),_0x3a17f7,JSON[_0x1c58('0x1d')](_0x4b8ae9));_0x1b5e53['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 8e0b05a..de03378 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 _0xe706=['next','channel','getMustacheRender','YYYY-MM-DD\x20HH:mm:ss','out','message','from','read','subject','Re:','Re:\x20','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','Message','Smtp','service','host','port','secure','auth','user','pass','inReplyTo','messageId','html','','replace','body','';return mailRpc[_0x6e70('0x33')](_0x228350,_0x37b3e0)['then'](function(_0x259486){logger['info'](_0x6e70('0x34'),_0x1b0389);_0x37b3e0[_0x6e70('0x2c')]=_0x259486[_0x6e70('0x16')]['messageId'];return rpc[_0x743eb5+_0x6e70('0x22')][_0x6e70('0x35')](_0x37b3e0);})['then'](function(_0x13d673){logger[_0x6e70('0xe')]('[%s][AUTOREPLY]\x20%s',_0x1b0389,JSON[_0x6e70('0x36')](_0x13d673));})[_0x6e70('0x37')](function(_0x2d52bd){logger[_0x6e70('0x38')](_0x6e70('0x39'),_0x1b0389,JSON[_0x6e70('0x36')](_0x2d52bd));})[_0x6e70('0x3a')](function(){_0x36357b[_0x6e70('0x11')]();});}else{return rpc[this[_0x6e70('0x12')]+_0x6e70('0x22')]['create'](_0x37b3e0)[_0x6e70('0x3b')](function(_0x4795a0){logger[_0x6e70('0xe')](_0x6e70('0xf'),_0x1b0389,_0x37b3e0[_0x6e70('0x30')]);})[_0x6e70('0x37')](function(_0x233a83){logger[_0x6e70('0x38')](_0x6e70('0xf'),_0x1b0389,JSON[_0x6e70('0x36')](_0x233a83));})[_0x6e70('0x3a')](function(){_0x36357b[_0x6e70('0x11')]();});}}}catch(_0x2a5444){logger[_0x6e70('0x38')](_0x6e70('0xf'),_0x1b0389,JSON['stringify'](_0x2a5444));_0x36357b['stop']();}};}; \ No newline at end of file +var _0xe706=['next','channel','getMustacheRender','YYYY-MM-DD\x20HH:mm:ss','out','message','from','read','subject','Re:','Re:\x20','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','Message','Smtp','service','host','port','secure','auth','user','pass','inReplyTo','messageId','html','','replace','body','';return mailRpc[_0x6e70('0x33')](_0x228350,_0x37b3e0)['then'](function(_0x259486){logger['info'](_0x6e70('0x34'),_0x1b0389);_0x37b3e0[_0x6e70('0x2c')]=_0x259486[_0x6e70('0x16')]['messageId'];return rpc[_0x743eb5+_0x6e70('0x22')][_0x6e70('0x35')](_0x37b3e0);})['then'](function(_0x13d673){logger[_0x6e70('0xe')]('[%s][AUTOREPLY]\x20%s',_0x1b0389,JSON[_0x6e70('0x36')](_0x13d673));})[_0x6e70('0x37')](function(_0x2d52bd){logger[_0x6e70('0x38')](_0x6e70('0x39'),_0x1b0389,JSON[_0x6e70('0x36')](_0x2d52bd));})[_0x6e70('0x3a')](function(){_0x36357b[_0x6e70('0x11')]();});}else{return rpc[this[_0x6e70('0x12')]+_0x6e70('0x22')]['create'](_0x37b3e0)[_0x6e70('0x3b')](function(_0x4795a0){logger[_0x6e70('0xe')](_0x6e70('0xf'),_0x1b0389,_0x37b3e0[_0x6e70('0x30')]);})[_0x6e70('0x37')](function(_0x233a83){logger[_0x6e70('0x38')](_0x6e70('0xf'),_0x1b0389,JSON[_0x6e70('0x36')](_0x233a83));})[_0x6e70('0x3a')](function(){_0x36357b[_0x6e70('0x11')]();});}}}catch(_0x2a5444){logger[_0x6e70('0x38')](_0x6e70('0xf'),_0x1b0389,JSON['stringify'](_0x2a5444));_0x36357b['stop']();}};}; \ 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 e3c1481..6efad95 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 _0x20d6=['../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','channel','Interaction','update','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x20d6,0x1b8));var _0x620d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x20d6[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0x620d('0x0'));var logger=require(_0x620d('0x1'))(_0x620d('0x2'));var rpc={'chatInteraction':require(_0x620d('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x620d('0x4')),'mailInteraction':require(_0x620d('0x5')),'faxInteraction':require(_0x620d('0x6'))};exports[_0x620d('0x7')]=function(_0xe56e86,_0x38b12d,_0xe492df,_0x46fc14){return function(_0x28e29a){try{logger[_0x620d('0x8')](_0x620d('0x9'),_0xe56e86,_0x38b12d[0x0]);var _0x52657f={'closed':0x1,'closedAt':moment()[_0x620d('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':'system','disposition':_0x38b12d[0x0]};if(rpc[_0x46fc14[_0x620d('0xb')]+_0x620d('0xc')]){rpc[_0x46fc14[_0x620d('0xb')]+_0x620d('0xc')][_0x620d('0xd')](_0x46fc14[_0x620d('0xe')]['id'],_0x52657f)['then'](function(_0x3d8b2b){logger[_0x620d('0x8')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0xe56e86,_0x46fc14[_0x620d('0xe')]['id']);})[_0x620d('0xf')](function(_0x253090){logger[_0x620d('0x10')](_0x620d('0x11'),_0xe56e86,JSON[_0x620d('0x12')](_0x253090));})[_0x620d('0x13')](function(){_0x28e29a[_0x620d('0x14')]();});}}catch(_0x55867d){logger[_0x620d('0x10')](_0x620d('0x11'),_0xe56e86,JSON[_0x620d('0x12')](_0x55867d));_0x28e29a[_0x620d('0x14')]();}};}; \ No newline at end of file +var _0xe5b5=['system','channel','Interaction','update','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5ebf27,_0x4514e0){var _0x121c72=function(_0x28de34){while(--_0x28de34){_0x5ebf27['push'](_0x5ebf27['shift']());}};_0x121c72(++_0x4514e0);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xe5b5[_0x5834bc];return _0x3e183a;};'use strict';var moment=require(_0x5e5b('0x0'));var logger=require(_0x5e5b('0x1'))(_0x5e5b('0x2'));var rpc={'chatInteraction':require(_0x5e5b('0x3')),'openchannelInteraction':require(_0x5e5b('0x4')),'smsInteraction':require(_0x5e5b('0x5')),'mailInteraction':require(_0x5e5b('0x6')),'faxInteraction':require(_0x5e5b('0x7'))};exports[_0x5e5b('0x8')]=function(_0x20a50c,_0xdc6616,_0x40bc5b,_0xf1fbe2){return function(_0x11e0e0){try{logger[_0x5e5b('0x9')](_0x5e5b('0xa'),_0x20a50c,_0xdc6616[0x0]);var _0xe089b1={'closed':0x1,'closedAt':moment()[_0x5e5b('0xb')](_0x5e5b('0xc')),'closeReason':_0x5e5b('0xd'),'disposition':_0xdc6616[0x0]};if(rpc[_0xf1fbe2[_0x5e5b('0xe')]+_0x5e5b('0xf')]){rpc[_0xf1fbe2[_0x5e5b('0xe')]+'Interaction'][_0x5e5b('0x10')](_0xf1fbe2['interaction']['id'],_0xe089b1)[_0x5e5b('0x11')](function(_0x58185){logger[_0x5e5b('0x9')](_0x5e5b('0x12'),_0x20a50c,_0xf1fbe2['interaction']['id']);})['catch'](function(_0x5ebf65){logger[_0x5e5b('0x13')](_0x5e5b('0x14'),_0x20a50c,JSON[_0x5e5b('0x15')](_0x5ebf65));})[_0x5e5b('0x16')](function(){_0x11e0e0[_0x5e5b('0x17')]();});}}catch(_0x1e3483){logger[_0x5e5b('0x13')]('[%s][CLOSE]\x20%s',_0x20a50c,JSON[_0x5e5b('0x15')](_0x1e3483));_0x11e0e0[_0x5e5b('0x17')]();}};}; \ 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 5f85fc8..3375014 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 _0x053e=['../../rpc/faxMessage','consequence','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','account','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','then','[%s][DIALOGFLOW]\x20%s','catch','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','dialogflow','speech','result','metadata','stringify','moment','md5','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x053e,0x189));var _0xe053=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x053e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require(_0xe053('0x0'));var apiai=require('apiai-promise');var md5=require(_0xe053('0x1'));var utils=require(_0xe053('0x2'));var logger=require(_0xe053('0x3'))(_0xe053('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xe053('0x5')),'smsMessage':require(_0xe053('0x6')),'faxMessage':require(_0xe053('0x7'))};exports[_0xe053('0x8')]=function(_0x32a468,_0x27f5e1){return function(_0x51609c){try{if(!_['isNil'](this[_0xe053('0x9')][_0xe053('0xa')])){logger[_0xe053('0xb')]('[%s][DIALOGFLOW]\x20%s',_0x32a468,_0xe053('0xc'));return _0x51609c[_0xe053('0xd')]();}var _0x4fd440={'ContactId':this[_0xe053('0xe')]['id'],'sentAt':moment()[_0xe053('0xf')](_0xe053('0x10')),'direction':_0xe053('0x11')};var _0x294fee=this['channel'];if(_0x294fee==='chat'){_0x4fd440['ChatWebsiteId']=this[_0xe053('0x12')]['id'];}else{_0x4fd440[_['upperFirst'](_0x294fee)+_0xe053('0x13')]=this[_0xe053('0x12')]['id'];}_0x4fd440[_['upperFirst'](_0x294fee)+_0xe053('0x14')]=this[_0xe053('0x9')]['id'];if(this['interaction'][_0xe053('0x15')]){var _0x25ae96=_0x27f5e1[0x2];if(!_[_0xe053('0x16')](_0x25ae96)){_0x4fd440[_0xe053('0x17')]=utils[_0xe053('0x18')](_0x25ae96,this);return rpc[_0x294fee+_0xe053('0x19')]['create'](_0x4fd440)[_0xe053('0x1a')](function(_0x3a118b){logger[_0xe053('0xb')](_0xe053('0x1b'),_0x32a468,_0x4fd440['body']);})[_0xe053('0x1c')](function(_0x1ff571){logger[_0xe053('0x1d')]('[%s][DIALOGFLOW]\x20%s',_0x32a468,JSON['stringify'](_0x1ff571));})[_0xe053('0x1e')](function(){logger[_0xe053('0xb')](_0xe053('0x1f'),_0x32a468);_0x51609c[_0xe053('0x20')]();});}else{logger[_0xe053('0xb')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x32a468);_0x51609c[_0xe053('0x20')]();}}else{var _0x796599=this;var _0x1d0520=apiai(_0x27f5e1[0x0],{'language':_0x27f5e1[0x1]||'en'});return _0x1d0520[_0xe053('0x21')](this[_0xe053('0x22')][_0xe053('0x17')],{'sessionId':md5(this[_0xe053('0x9')]['id'])})[_0xe053('0x1a')](function(_0x5f2ae5){_0x796599['body'][_0xe053('0x23')]=_0x5f2ae5;_0x4fd440['body']=_0x5f2ae5['result']['fulfillment'][_0xe053('0x24')];return rpc[_0x294fee+_0xe053('0x19')]['create'](_0x4fd440)[_0xe053('0x1a')](function(_0x3b6043){logger[_0xe053('0xb')]('[%s][DIALOGFLOW]\x20%s',_0x32a468,_0x4fd440[_0xe053('0x17')]);if(_0x5f2ae5[_0xe053('0x25')][_0xe053('0x26')]['endConversation']){_0x51609c[_0xe053('0xd')]();}else{_0x51609c[_0xe053('0x20')]();}})[_0xe053('0x1c')](function(_0x548f99){logger[_0xe053('0x1d')]('[%s][DIALOGFLOW]\x20%s',_0x32a468,JSON[_0xe053('0x27')](_0x548f99));_0x51609c['next']();});})['catch'](function(_0x4dc6dd){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x32a468,_0x4dc6dd[_0xe053('0x22')]);_0x51609c[_0xe053('0xd')]();});}}catch(_0x4ab0ea){logger[_0xe053('0x1d')](_0xe053('0x1b'),_0x32a468,JSON['stringify'](_0x4ab0ea));_0x51609c[_0xe053('0x20')]();}};}; \ No newline at end of file +var _0x5710=['info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','getMustacheRender','create','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','then','body','result','fulfillment','speech','Message','metadata','catch','error','message','lodash','moment','apiai-promise','md5','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','isNil','interaction','UserId'];(function(_0xa09b6f,_0x2bd21f){var _0x368800=function(_0x144dd2){while(--_0x144dd2){_0xa09b6f['push'](_0xa09b6f['shift']());}};_0x368800(++_0x2bd21f);}(_0x5710,0xa4));var _0x0571=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x5710[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x0571('0x0'));var moment=require(_0x0571('0x1'));var apiai=require(_0x0571('0x2'));var md5=require(_0x0571('0x3'));var utils=require('./utils');var logger=require(_0x0571('0x4'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x0571('0x5')),'mailMessage':require(_0x0571('0x6')),'smsMessage':require(_0x0571('0x7')),'faxMessage':require('../../rpc/faxMessage')};exports[_0x0571('0x8')]=function(_0x4862be,_0x50be94){return function(_0x4c35b2){try{if(!_[_0x0571('0x9')](this[_0x0571('0xa')][_0x0571('0xb')])){logger[_0x0571('0xc')](_0x0571('0xd'),_0x4862be,_0x0571('0xe'));return _0x4c35b2[_0x0571('0xf')]();}var _0x2a4443={'ContactId':this[_0x0571('0x10')]['id'],'sentAt':moment()[_0x0571('0x11')](_0x0571('0x12')),'direction':_0x0571('0x13')};var _0x21c217=this[_0x0571('0x14')];if(_0x21c217===_0x0571('0x15')){_0x2a4443[_0x0571('0x16')]=this[_0x0571('0x17')]['id'];}else{_0x2a4443[_[_0x0571('0x18')](_0x21c217)+'AccountId']=this[_0x0571('0x17')]['id'];}_0x2a4443[_[_0x0571('0x18')](_0x21c217)+_0x0571('0x19')]=this[_0x0571('0xa')]['id'];if(this[_0x0571('0xa')][_0x0571('0x1a')]){var _0x4c5d47=_0x50be94[0x2];if(!_[_0x0571('0x1b')](_0x4c5d47)){_0x2a4443['body']=utils[_0x0571('0x1c')](_0x4c5d47,this);return rpc[_0x21c217+'Message'][_0x0571('0x1d')](_0x2a4443)['then'](function(_0x901559){logger['info'](_0x0571('0xd'),_0x4862be,_0x2a4443['body']);})['catch'](function(_0x5ba927){logger['error'](_0x0571('0xd'),_0x4862be,JSON[_0x0571('0x1e')](_0x5ba927));})['finally'](function(){logger['info'](_0x0571('0x1f'),_0x4862be);_0x4c35b2[_0x0571('0x20')]();});}else{logger[_0x0571('0xc')](_0x0571('0x21'),_0x4862be);_0x4c35b2[_0x0571('0x20')]();}}else{var _0x590a38=this;var _0x42d9d4=apiai(_0x50be94[0x0],{'language':_0x50be94[0x1]||'en'});return _0x42d9d4['textRequest'](this['message']['body'],{'sessionId':md5(this[_0x0571('0xa')]['id'])})[_0x0571('0x22')](function(_0x2ae6c6){_0x590a38['body']['dialogflow']=_0x2ae6c6;_0x2a4443[_0x0571('0x23')]=_0x2ae6c6[_0x0571('0x24')][_0x0571('0x25')][_0x0571('0x26')];return rpc[_0x21c217+_0x0571('0x27')]['create'](_0x2a4443)[_0x0571('0x22')](function(_0x3ba85b){logger[_0x0571('0xc')](_0x0571('0xd'),_0x4862be,_0x2a4443[_0x0571('0x23')]);if(_0x2ae6c6[_0x0571('0x24')][_0x0571('0x28')]['endConversation']){_0x4c35b2[_0x0571('0xf')]();}else{_0x4c35b2[_0x0571('0x20')]();}})[_0x0571('0x29')](function(_0x4fd261){logger['error'](_0x0571('0xd'),_0x4862be,JSON[_0x0571('0x1e')](_0x4fd261));_0x4c35b2[_0x0571('0xf')]();});})[_0x0571('0x29')](function(_0x5cd202){logger[_0x0571('0x2a')](_0x0571('0xd'),_0x4862be,_0x5cd202[_0x0571('0x2b')]);_0x4c35b2[_0x0571('0xf')]();});}}catch(_0x5b7f85){logger[_0x0571('0x2a')]('[%s][DIALOGFLOW]\x20%s',_0x4862be,JSON['stringify'](_0x5b7f85));_0x4c35b2[_0x0571('0x20')]();}};}; \ 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 8b7eb81..53e3cbc 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 _0xca6d=['info','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','lodash','html-to-text','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','[%s][GOTOIF]\x20%s','map','join','stop','condition'];(function(_0x35b3b0,_0xfea288){var _0x2aa5e2=function(_0x34637a){while(--_0x34637a){_0x35b3b0['push'](_0x35b3b0['shift']());}};_0x2aa5e2(++_0xfea288);}(_0xca6d,0xe9));var _0xdca6=function(_0x56a7bc,_0x41d6f6){_0x56a7bc=_0x56a7bc-0x0;var _0x4f5883=_0xca6d[_0x56a7bc];return _0x4f5883;};'use strict';var schema=require('validate');var _=require(_0xdca6('0x0'));var htmlToText=require(_0xdca6('0x1'));var utils=require(_0xdca6('0x2'));var logger=require(_0xdca6('0x3'))('routing');var gotoif=schema({'condition':{'type':_0xdca6('0x4'),'required':!![],'message':_0xdca6('0x5')},'priorityTrue':{'type':_0xdca6('0x6'),'message':_0xdca6('0x7')},'priorityFalse':{'type':_0xdca6('0x6'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xdca6('0x8')]=function(_0x2bce72,_0x264afd){return function(_0x319b6a){try{var _0x296d28={'condition':htmlToText[_0xdca6('0x9')](utils[_0xdca6('0xa')](_0x264afd[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x264afd[0x1],'priorityFalse':_0x264afd[0x2]};var _0x3f886f=gotoif['validate'](_0x296d28,{'typecast':!![]});if(_0x3f886f[_0xdca6('0xb')]){logger['error'](_0xdca6('0xc'),_0x2bce72,_[_0xdca6('0xd')](_0x3f886f,'message')[_0xdca6('0xe')](',\x20'));_0x319b6a[_0xdca6('0xf')]();}else{try{var _0x386ae2=eval('('+_0x296d28[_0xdca6('0x10')]+')');var _0x10d8ad=_0x386ae2?_0x296d28['priorityTrue']:_0x296d28['priorityFalse'];logger[_0xdca6('0x11')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x2bce72,_0x296d28[_0xdca6('0x10')],_0x386ae2,_0x10d8ad||_0xdca6('0x12'));if(_0x10d8ad){var _0x238ba9=_[_0xdca6('0x13')](_0x319b6a['rules'](),{'p':_0x10d8ad});if(_0x238ba9>=0x0){logger[_0xdca6('0x11')](_0xdca6('0x14'),_0x2bce72,_0x10d8ad||'next',_0x238ba9);_0x319b6a['next'](_0x238ba9);}else{logger[_0xdca6('0x11')](_0xdca6('0x15'),_0x2bce72,_0x10d8ad||_0xdca6('0x12'));_0x319b6a['stop']();}}else{_0x319b6a['next']();}}catch(_0x2cb15b){logger[_0xdca6('0x16')](_0xdca6('0x17'),_0x2bce72,_0x2cb15b[_0xdca6('0x18')]);_0x319b6a['stop']();}}}catch(_0x491b57){logger['error']('[%s][GOTOIF]\x20%s',_0x2bce72,JSON['stringify'](_0x491b57));_0x319b6a['stop']();}};}; \ No newline at end of file +var _0x95b8=['info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','lodash','html-to-text','routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','validate','error','[%s][GOTOIF]\x20%s','map','message','join','priorityTrue','priorityFalse'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0x95b8,0x159));var _0x895b=function(_0x53c564,_0x1ef0ca){_0x53c564=_0x53c564-0x0;var _0x48962c=_0x95b8[_0x53c564];return _0x48962c;};'use strict';var schema=require('validate');var _=require(_0x895b('0x0'));var htmlToText=require(_0x895b('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x895b('0x2'));var gotoif=schema({'condition':{'type':_0x895b('0x3'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x895b('0x4'),'message':_0x895b('0x5')},'priorityFalse':{'type':_0x895b('0x4'),'message':_0x895b('0x6')}});exports[_0x895b('0x7')]=function(_0x1c10cf,_0x2d00b8){return function(_0xc1c883){try{var _0x50f4bc={'condition':htmlToText[_0x895b('0x8')](utils[_0x895b('0x9')](_0x2d00b8[0x0],this),{'wordwrap':![]})[_0x895b('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2d00b8[0x1],'priorityFalse':_0x2d00b8[0x2]};var _0x244ad4=gotoif[_0x895b('0xb')](_0x50f4bc,{'typecast':!![]});if(_0x244ad4['length']){logger[_0x895b('0xc')](_0x895b('0xd'),_0x1c10cf,_[_0x895b('0xe')](_0x244ad4,_0x895b('0xf'))[_0x895b('0x10')](',\x20'));_0xc1c883['stop']();}else{try{var _0x175c57=eval('('+_0x50f4bc['condition']+')');var _0x1382fc=_0x175c57?_0x50f4bc[_0x895b('0x11')]:_0x50f4bc[_0x895b('0x12')];logger[_0x895b('0x13')](_0x895b('0x14'),_0x1c10cf,_0x50f4bc[_0x895b('0x15')],_0x175c57,_0x1382fc||_0x895b('0x16'));if(_0x1382fc){var _0x4a6a47=_['findIndex'](_0xc1c883['rules'](),{'p':_0x1382fc});if(_0x4a6a47>=0x0){logger['info'](_0x895b('0x17'),_0x1c10cf,_0x1382fc||_0x895b('0x16'),_0x4a6a47);_0xc1c883[_0x895b('0x16')](_0x4a6a47);}else{logger[_0x895b('0x13')](_0x895b('0x18'),_0x1c10cf,_0x1382fc||'next');_0xc1c883['stop']();}}else{_0xc1c883['next']();}}catch(_0x574717){logger[_0x895b('0xc')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x1c10cf,_0x574717[_0x895b('0xf')]);_0xc1c883[_0x895b('0x19')]();}}}catch(_0x32c0c9){logger[_0x895b('0xc')](_0x895b('0xd'),_0x1c10cf,JSON['stringify'](_0x32c0c9));_0xc1c883['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 343758c..407375f 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 _0xcf4c=['length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','priority','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing','number','consequence'];(function(_0xda47d5,_0x3ee907){var _0xb6e511=function(_0x3c42ca){while(--_0x3c42ca){_0xda47d5['push'](_0xda47d5['shift']());}};_0xb6e511(++_0x3ee907);}(_0xcf4c,0x1d5));var _0xccf4=function(_0x337ee8,_0x8d213a){_0x337ee8=_0x337ee8-0x0;var _0x488424=_0xcf4c[_0x337ee8];return _0x488424;};'use strict';var schema=require(_0xccf4('0x0'));var _=require(_0xccf4('0x1'));var logger=require(_0xccf4('0x2'))(_0xccf4('0x3'));var gotop=schema({'priority':{'type':_0xccf4('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xccf4('0x5')]=function(_0x46dee1,_0x228158){return function(_0x289280){try{var _0xed5a8e={'priority':_0x228158[0x0]};var _0x42d7b8=gotop['validate'](_0xed5a8e,{'typecast':!![]});if(_0x42d7b8[_0xccf4('0x6')]){logger[_0xccf4('0x7')](_0xccf4('0x8'),_0x46dee1,_[_0xccf4('0x9')](_0x42d7b8,_0xccf4('0xa'))[_0xccf4('0xb')](',\x20'));_0x289280[_0xccf4('0xc')]();}else{logger[_0xccf4('0xd')]('[%s][GOTOP]\x20priority\x20%s',_0x46dee1,_0xed5a8e[_0xccf4('0xe')]);if(_0xed5a8e[_0xccf4('0xe')]){var _0xf776af=_['findIndex'](_0x289280[_0xccf4('0xf')](),{'p':_0xed5a8e['priority']});if(_0xf776af>=0x0){logger[_0xccf4('0xd')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x46dee1,_0xed5a8e['priority']||'next',_0xf776af);_0x289280[_0xccf4('0x10')](_0xf776af);}else{logger['info'](_0xccf4('0x11'),_0x46dee1,_0xed5a8e[_0xccf4('0xe')]||_0xccf4('0x10'));_0x289280[_0xccf4('0xc')]();}}else{_0x289280[_0xccf4('0x10')]();}}}catch(_0x460082){logger[_0xccf4('0x7')](_0xccf4('0x8'),_0x46dee1,JSON[_0xccf4('0x12')](_0x460082));_0x289280[_0xccf4('0xc')]();}};}; \ No newline at end of file +var _0xe024=['priority','findIndex','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','validate','lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s'];(function(_0xd3cb39,_0x139ec6){var _0x4b8309=function(_0x3a443a){while(--_0x3a443a){_0xd3cb39['push'](_0xd3cb39['shift']());}};_0x4b8309(++_0x139ec6);}(_0xe024,0xd7));var _0x4e02=function(_0x3aeb36,_0x312dc9){_0x3aeb36=_0x3aeb36-0x0;var _0xa2ef21=_0xe024[_0x3aeb36];return _0xa2ef21;};'use strict';var schema=require(_0x4e02('0x0'));var _=require(_0x4e02('0x1'));var logger=require(_0x4e02('0x2'))('routing');var gotop=schema({'priority':{'type':_0x4e02('0x3'),'required':!![],'message':_0x4e02('0x4')}});exports[_0x4e02('0x5')]=function(_0x417cb7,_0x195889){return function(_0x465f50){try{var _0x18135e={'priority':_0x195889[0x0]};var _0x4a4c4b=gotop['validate'](_0x18135e,{'typecast':!![]});if(_0x4a4c4b[_0x4e02('0x6')]){logger['error']('[%s][GOTOP]\x20%s',_0x417cb7,_[_0x4e02('0x7')](_0x4a4c4b,_0x4e02('0x8'))[_0x4e02('0x9')](',\x20'));_0x465f50[_0x4e02('0xa')]();}else{logger[_0x4e02('0xb')](_0x4e02('0xc'),_0x417cb7,_0x18135e[_0x4e02('0xd')]);if(_0x18135e[_0x4e02('0xd')]){var _0x11b14b=_[_0x4e02('0xe')](_0x465f50[_0x4e02('0xf')](),{'p':_0x18135e['priority']});if(_0x11b14b>=0x0){logger[_0x4e02('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x417cb7,_0x18135e[_0x4e02('0xd')]||_0x4e02('0x10'),_0x11b14b);_0x465f50[_0x4e02('0x10')](_0x11b14b);}else{logger['info'](_0x4e02('0x11'),_0x417cb7,_0x18135e['priority']||_0x4e02('0x10'));_0x465f50['stop']();}}else{_0x465f50[_0x4e02('0x10')]();}}}catch(_0x1fcbf5){logger['error'](_0x4e02('0x12'),_0x417cb7,JSON['stringify'](_0x1fcbf5));_0x465f50['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index fe271c4..ec9aee5 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 _0x52ac=['body','catch','error','stringify','stop','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','upperFirst','channel','AccountId','account','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s'];(function(_0x4ffd20,_0x1e83b6){var _0x49b5e2=function(_0xfdd1a6){while(--_0xfdd1a6){_0x4ffd20['push'](_0x4ffd20['shift']());}};_0x49b5e2(++_0x1e83b6);}(_0x52ac,0xcd));var _0xc52a=function(_0x12b294,_0x192e53){_0x12b294=_0x12b294-0x0;var _0x7b92cb=_0x52ac[_0x12b294];return _0x7b92cb;};'use strict';var _=require(_0xc52a('0x0'));var utils=require(_0xc52a('0x1'));var logger=require('../../../../config/logger')(_0xc52a('0x2'));var rpc={'chatMessage':require(_0xc52a('0x3')),'openchannelMessage':require(_0xc52a('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xc52a('0x5'))};exports[_0xc52a('0x6')]=function(_0x5d3034,_0x177fd8){return function(_0x1beff4){try{var _0x4e9127={'body':utils[_0xc52a('0x7')](_0x177fd8[0x0],this),'ContactId':this[_0xc52a('0x8')]['id']};if(this['channel']==='chat'){_0x4e9127['ChatWebsiteId']=this['account']['id'];}else{_0x4e9127[_[_0xc52a('0x9')](this[_0xc52a('0xa')])+_0xc52a('0xb')]=this[_0xc52a('0xc')]['id'];}_0x4e9127[_[_0xc52a('0x9')](this[_0xc52a('0xa')])+_0xc52a('0xd')]=this[_0xc52a('0xe')]['id'];if(rpc[this['channel']+_0xc52a('0xf')]){return rpc[this[_0xc52a('0xa')]+_0xc52a('0xf')][_0xc52a('0x10')](_0x4e9127)[_0xc52a('0x11')](function(_0x563ab2){logger[_0xc52a('0x12')](_0xc52a('0x13'),_0x5d3034,_0x4e9127[_0xc52a('0x14')]);_0x1beff4['next']();})[_0xc52a('0x15')](function(_0x4960e7){logger[_0xc52a('0x16')](_0xc52a('0x13'),_0x5d3034,JSON[_0xc52a('0x17')](_0x4960e7));_0x1beff4[_0xc52a('0x18')]();});}}catch(_0x428b74){logger[_0xc52a('0x16')](_0xc52a('0x13'),_0x5d3034,JSON[_0xc52a('0x17')](_0x428b74));_0x1beff4[_0xc52a('0x18')]();}};}; \ No newline at end of file +var _0xfb52=['../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','getMustacheRender','contact','channel','chat','account','upperFirst','AccountId','InteractionId','interaction','Message','create','info','[%s][MESSAGE]\x20%s','body','stringify','stop','error','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage'];(function(_0x5b9588,_0x9266b5){var _0x273454=function(_0x3909fb){while(--_0x3909fb){_0x5b9588['push'](_0x5b9588['shift']());}};_0x273454(++_0x9266b5);}(_0xfb52,0x1e8));var _0x2fb5=function(_0x1b7887,_0x22f78f){_0x1b7887=_0x1b7887-0x0;var _0x3ec4bd=_0xfb52[_0x1b7887];return _0x3ec4bd;};'use strict';var _=require(_0x2fb5('0x0'));var utils=require(_0x2fb5('0x1'));var logger=require(_0x2fb5('0x2'))(_0x2fb5('0x3'));var rpc={'chatMessage':require(_0x2fb5('0x4')),'openchannelMessage':require(_0x2fb5('0x5')),'mailMessage':require(_0x2fb5('0x6')),'smsMessage':require(_0x2fb5('0x7')),'faxMessage':require(_0x2fb5('0x8'))};exports['consequence']=function(_0xf25258,_0x72ed36){return function(_0x37f909){try{var _0x24cb7b={'body':utils[_0x2fb5('0x9')](_0x72ed36[0x0],this),'ContactId':this[_0x2fb5('0xa')]['id']};if(this[_0x2fb5('0xb')]===_0x2fb5('0xc')){_0x24cb7b['ChatWebsiteId']=this[_0x2fb5('0xd')]['id'];}else{_0x24cb7b[_[_0x2fb5('0xe')](this['channel'])+_0x2fb5('0xf')]=this[_0x2fb5('0xd')]['id'];}_0x24cb7b[_[_0x2fb5('0xe')](this[_0x2fb5('0xb')])+_0x2fb5('0x10')]=this[_0x2fb5('0x11')]['id'];if(rpc[this['channel']+_0x2fb5('0x12')]){return rpc[this[_0x2fb5('0xb')]+_0x2fb5('0x12')][_0x2fb5('0x13')](_0x24cb7b)['then'](function(_0x1f020a){logger[_0x2fb5('0x14')](_0x2fb5('0x15'),_0xf25258,_0x24cb7b[_0x2fb5('0x16')]);_0x37f909['next']();})['catch'](function(_0x3b96a3){logger['error'](_0x2fb5('0x15'),_0xf25258,JSON[_0x2fb5('0x17')](_0x3b96a3));_0x37f909[_0x2fb5('0x18')]();});}}catch(_0x5de1f0){logger[_0x2fb5('0x19')]('[%s][MESSAGE]\x20%s',_0xf25258,JSON['stringify'](_0x5de1f0));_0x37f909['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index aa6ea96..6b48840 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 _0x30c5=['consequence','info','getMustacheRender','error','[%s][NOOP]\x20%s','stringify','stop','./utils','../../../../config/logger'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x30c5,0x14b));var _0x530c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x30c5[_0x2dafbe];return _0x58a45a;};'use strict';var utils=require(_0x530c('0x0'));var logger=require(_0x530c('0x1'))('routing');exports[_0x530c('0x2')]=function(_0x16daf7,_0x4884b2){return function(_0x44ded5){try{logger[_0x530c('0x3')]('[%s][NOOP]\x20%s',_0x16daf7,utils[_0x530c('0x4')](_0x4884b2[0x0],this));_0x44ded5['next']();}catch(_0x3f713e){logger[_0x530c('0x5')](_0x530c('0x6'),_0x16daf7,JSON[_0x530c('0x7')](_0x3f713e));_0x44ded5[_0x530c('0x8')]();}};}; \ No newline at end of file +var _0x704d=['info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','../../../../config/logger','routing','consequence'];(function(_0x4555d7,_0x41dab9){var _0x26e271=function(_0xf5c4ba){while(--_0xf5c4ba){_0x4555d7['push'](_0x4555d7['shift']());}};_0x26e271(++_0x41dab9);}(_0x704d,0x138));var _0xd704=function(_0xa7adf8,_0xf5fc67){_0xa7adf8=_0xa7adf8-0x0;var _0x15c27e=_0x704d[_0xa7adf8];return _0x15c27e;};'use strict';var utils=require('./utils');var logger=require(_0xd704('0x0'))(_0xd704('0x1'));exports[_0xd704('0x2')]=function(_0xae52e4,_0x1e20dd){return function(_0x11b0ad){try{logger[_0xd704('0x3')](_0xd704('0x4'),_0xae52e4,utils[_0xd704('0x5')](_0x1e20dd[0x0],this));_0x11b0ad[_0xd704('0x6')]();}catch(_0x3078a5){logger[_0xd704('0x7')](_0xd704('0x4'),_0xae52e4,JSON[_0xd704('0x8')](_0x3078a5));_0x11b0ad['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 e95aea6..94e45ee 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 _0xf31a=['channel','QueueId','InteractionId','interaction','MessageId','chat','AccountId','WebsiteId','info','name','message','QueueReport','create','catch','update','error','update\x20queue\x20report','timeout','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','close','[%s][QUEUE]\x20ROUTING\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','queue_id','account','queue','from','emit','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst'];(function(_0x31a576,_0x424419){var _0x30b1d3=function(_0x4710e8){while(--_0x4710e8){_0x31a576['push'](_0x31a576['shift']());}};_0x30b1d3(++_0x424419);}(_0xf31a,0x105));var _0xaf31=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xf31a[_0x4d8ed9];return _0x1e2140;};'use strict';var schema=require(_0xaf31('0x0'));var _=require(_0xaf31('0x1'));var util=require(_0xaf31('0x2'));var seqqueue=require('seq-queue');var moment=require(_0xaf31('0x3'));var Redis=require(_0xaf31('0x4'));var config=require(_0xaf31('0x5'));var logger=require(_0xaf31('0x6'))(_0xaf31('0x7'));var strategy=require(_0xaf31('0x8'));config[_0xaf31('0x9')]=_['defaults'](config[_0xaf31('0x9')],{'host':_0xaf31('0xa'),'port':0x18eb});var io=require(_0xaf31('0xb'))(new Redis(config[_0xaf31('0x9')]));var attributes=['id',_0xaf31('0xc'),_0xaf31('0xd'),_0xaf31('0xe'),_0xaf31('0xf'),'joinAt'];function emit(_0x3a6582,_0x4e520f,_0x13ef55){io['to'](_0x3a6582)[_0xaf31('0x10')](_0x4e520f,_0x13ef55);}function emitChannelQueueInteraction(_0x460e8e,_0xbc4ba9,_0x1a4cfd,_0x43986f,_0xc20311,_0x8ea11e,_0x4a826d,_0x3d36fc){_0x1a4cfd[_0xaf31('0xc')]=_0x3d36fc;_0x1a4cfd[_0xaf31('0xe')]=_0xbc4ba9;_0x1a4cfd[_0xaf31('0xd')]=_0x43986f;_0x1a4cfd['id']=_0xc20311;if(_0x8ea11e){_0x4a826d[util['format'](_0xaf31('0x11'),_0x460e8e)][_0xc20311]=_[_0xaf31('0x12')](_0x1a4cfd,attributes);}else{delete _0x4a826d[util[_0xaf31('0x13')](_0xaf31('0x11'),_0x460e8e)][_0xc20311];}emit(util[_0xaf31('0x13')](_0xaf31('0x14'),_0x460e8e,_0xbc4ba9),util[_0xaf31('0x13')](_0xaf31('0x15'),_0x460e8e,_0x8ea11e?_0xaf31('0x16'):_0xaf31('0x17')),_[_0xaf31('0x12')](_0x1a4cfd,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xaf31('0x18')),'faxQueueReport':require(_0xaf31('0x19'))};var queue=schema({'name':{'type':_0xaf31('0x1a'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xaf31('0x1b'),'message':_0xaf31('0x1c')}});function startRouting(_0x397e59,_0x4be980,_0x41817a,_0x40675c){if(_0x397e59&&_0x4be980&&_0x41817a){_0x4be980[_0xaf31('0x1d')]+=0x1;var _0xccab01={'uniqueid':_0x397e59,'from':_0x41817a[_0xaf31('0x1e')]?_0x41817a[_0xaf31('0x1e')]['from']:'','joinAt':moment()['format'](_0xaf31('0x1f')),'ContactId':_0x41817a[_0xaf31('0x20')]?_0x41817a[_0xaf31('0x20')]['id']:null,'ListId':_0x41817a[_0xaf31('0x21')]?_0x41817a[_0xaf31('0x21')]['id']:null};_0xccab01[_[_0xaf31('0x22')](_0x41817a[_0xaf31('0x23')])+_0xaf31('0x24')]=_0x4be980['id']||null;_0xccab01[_[_0xaf31('0x22')](_0x41817a['channel'])+_0xaf31('0x25')]=_0x41817a[_0xaf31('0x26')]?_0x41817a['interaction']['id']:null;_0xccab01[_['upperFirst'](_0x41817a[_0xaf31('0x23')])+_0xaf31('0x27')]=_0x41817a['message']?_0x41817a['message']['id']:null;_0xccab01[_[_0xaf31('0x22')](_0x41817a[_0xaf31('0x23')])+(_0x41817a['channel']!==_0xaf31('0x28')?_0xaf31('0x29'):_0xaf31('0x2a'))]=_0x41817a['account']?_0x41817a[_0xaf31('0xd')]['id']:null;logger[_0xaf31('0x2b')](util[_0xaf31('0x13')]('[%s][START:QUEUE][NAME:%s]',_0x397e59,_0x4be980[_0xaf31('0x2c')]));emitChannelQueueInteraction(_0x41817a[_0xaf31('0x23')],_0x4be980[_0xaf31('0x2c')],_0xccab01,_0x41817a['account'][_0xaf31('0x2c')],_0x41817a[_0xaf31('0x2d')]['id'],!![],_0x40675c,_0x4be980['id']);if(rpc[_0x41817a[_0xaf31('0x23')]+'QueueReport']){return rpc[_0x41817a[_0xaf31('0x23')]+_0xaf31('0x2e')][_0xaf31('0x2f')](_0xccab01)[_0xaf31('0x30')](function(_0x4ca51b){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0x3bb30d,_0x63a519,_0x15da74,_0x5bb662){if(_0x3bb30d&&_0x63a519){_0x63a519['waiting']-=0x1;var _0x25a293={'leaveAt':moment()['format'](_0xaf31('0x1f')),'acceptAt':moment()[_0xaf31('0x13')](_0xaf31('0x1f')),'reason':'accepted'};logger['info'](util[_0xaf31('0x13')]('[%s][STOP:QUEUE][NAME:%s]',_0x3bb30d,_0x63a519[_0xaf31('0x2c')]));emitChannelQueueInteraction(_0x15da74[_0xaf31('0x23')],_0x63a519[_0xaf31('0x2c')],_0x15da74[_0xaf31('0x1e')],_0x15da74[_0xaf31('0xd')]['name'],_0x15da74[_0xaf31('0x2d')]['id'],![],_0x5bb662,_0x63a519['id']);if(rpc[_0x15da74[_0xaf31('0x23')]+_0xaf31('0x2e')]){return rpc[_0x15da74[_0xaf31('0x23')]+_0xaf31('0x2e')][_0xaf31('0x31')](_0x3bb30d,_0x25a293)[_0xaf31('0x30')](function(_0x4e1714){logger[_0xaf31('0x32')](_0xaf31('0x33'));});}}}function endRouting(_0x21935b,_0x2a99b7,_0x53eded,_0x17c51e){if(_0x21935b&&_0x2a99b7){_0x2a99b7[_0xaf31('0x1d')]-=0x1;var _0xb363f3={'leaveAt':moment()[_0xaf31('0x13')](_0xaf31('0x1f')),'exitAt':moment()[_0xaf31('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xaf31('0x34')};logger['info'](util['format']('[%s][END:QUEUE][NAME:%s]',_0x21935b,_0x2a99b7[_0xaf31('0x2c')]));emitChannelQueueInteraction(_0x53eded[_0xaf31('0x23')],_0x2a99b7['name'],_0x53eded[_0xaf31('0x1e')],_0x53eded[_0xaf31('0xd')][_0xaf31('0x2c')],_0x53eded[_0xaf31('0x2d')]['id'],![],_0x17c51e);if(rpc[_0x53eded['channel']+_0xaf31('0x2e')]){return rpc[_0x53eded[_0xaf31('0x23')]+_0xaf31('0x2e')][_0xaf31('0x31')](_0x21935b,_0xb363f3)[_0xaf31('0x30')](function(_0x13af45){logger['error']('update\x20queue\x20report');});}}}function handleFindQueue(_0x1430ac){return function(_0x39c9c7){return _0x39c9c7['name'][_0xaf31('0x35')]()===_0x1430ac['toLowerCase']();};}exports[_0xaf31('0x36')]=function(_0x97b090,_0x10abaf,_0x44ef10,_0x17323e){return function(_0x2bf83a){try{var _0x2fb55d={'name':_0x10abaf[0x0],'timeout':_0x10abaf[0x1]};var _0x5eb108=queue[_0xaf31('0x0')](_0x2fb55d,{'typecast':!![]});if(_0x5eb108[_0xaf31('0x37')]){logger[_0xaf31('0x32')](_0xaf31('0x38'),_0x97b090,_[_0xaf31('0x39')](_0x5eb108,_0xaf31('0x2d'))[_0xaf31('0x3a')](',\x20'));_0x2bf83a[_0xaf31('0x3b')]();}else{var _0x4ff93f=_[_0xaf31('0x3c')](_0x44ef10[_0x17323e[_0xaf31('0x23')]+_0xaf31('0x3d')],handleFindQueue(_0x2fb55d[_0xaf31('0x2c')]));if(_0x4ff93f){startRouting(_0x97b090,_0x4ff93f,_0x17323e,_0x44ef10);var _0x376f76=(_0x4ff93f['timeout']||0xa)*0x3e8;var _0x53203=(_0x2fb55d['timeout']||0x14)*0x3e8;var _0x2c38ab,_0x318bb2;if(_0x376f76>_0x53203){_0x53203=_0x376f76;}var _0x469e12=seqqueue[_0xaf31('0x3e')](_0x376f76);_0x469e12['id']=_0x97b090;_0x469e12[_0xaf31('0x3f')]=_0x376f76;_0x469e12[_0xaf31('0x40')]=_0x53203;_0x469e12[_0xaf31('0x23')]=_0x17323e[_0xaf31('0x23')];_0x44ef10[_0xaf31('0x41')][_0x97b090]['on'](_0xaf31('0x42'),function(){stopRouting(_0x97b090,_0x4ff93f,_0x17323e,_0x44ef10);_0x469e12[_0xaf31('0x43')](!![]);clearTimeout(_0x2c38ab);_0x2c38ab=undefined;if(_0x44ef10['rules'][_0x97b090]){delete _0x44ef10[_0xaf31('0x41')][_0x97b090];}logger[_0xaf31('0x2b')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x97b090);_0x2bf83a[_0xaf31('0x3b')]();});_0x2c38ab=setTimeout(function(){endRouting(_0x97b090,_0x4ff93f,_0x17323e,_0x44ef10);clearTimeout(_0x2c38ab);_0x469e12['close'](!![]);logger[_0xaf31('0x2b')](_0xaf31('0x44'),_0x97b090);_0x2bf83a[_0xaf31('0x45')]();},_0x53203);switch(_0x4ff93f[_0xaf31('0x46')]){case _0xaf31('0x47'):strategy[_0xaf31('0x47')](_0x469e12,_0x4ff93f,_0x44ef10,_0x17323e);break;default:strategy['beepall'](_0x469e12,_0x4ff93f,_0x44ef10,_0x17323e);}}else{logger[_0xaf31('0x32')](_0xaf31('0x48'),_0x97b090,_0x2fb55d['name']);_0x2bf83a[_0xaf31('0x3b')]();}}}catch(_0x5e3776){console['log'](_0x5e3776);logger['error']('[%s][QUEUE]\x20%s',_0x97b090,_0x5e3776[_0xaf31('0x49')]);_0x2bf83a[_0xaf31('0x3b')]();}};}; \ No newline at end of file +var _0x3488=['close','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','stop','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','lodash','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','redis','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/faxQueueReport','string','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','accepted','[%s][STOP:QUEUE][NAME:%s]','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','map','join','find','Queues','createQueue','atimeout','qtimeout'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x3488,0x16b));var _0x8348=function(_0x2434bf,_0x3f8d35){_0x2434bf=_0x2434bf-0x0;var _0x3e9203=_0x3488[_0x2434bf];return _0x3e9203;};'use strict';var schema=require(_0x8348('0x0'));var _=require(_0x8348('0x1'));var util=require('util');var seqqueue=require(_0x8348('0x2'));var moment=require(_0x8348('0x3'));var Redis=require('ioredis');var config=require(_0x8348('0x4'));var logger=require(_0x8348('0x5'))(_0x8348('0x6'));var strategy=require('./strategy');config[_0x8348('0x7')]=_['defaults'](config[_0x8348('0x7')],{'host':_0x8348('0x8'),'port':0x18eb});var io=require(_0x8348('0x9'))(new Redis(config[_0x8348('0x7')]));var attributes=['id',_0x8348('0xa'),_0x8348('0xb'),_0x8348('0xc'),_0x8348('0xd'),_0x8348('0xe')];function emit(_0x3a7242,_0x2fd2cf,_0x204e18){io['to'](_0x3a7242)[_0x8348('0xf')](_0x2fd2cf,_0x204e18);}function emitChannelQueueInteraction(_0x5257a7,_0x3b690b,_0x4cfc34,_0x26c28c,_0x2389c3,_0x40c0b0,_0x108a40,_0x55751a){_0x4cfc34[_0x8348('0xa')]=_0x55751a;_0x4cfc34['queue']=_0x3b690b;_0x4cfc34[_0x8348('0xb')]=_0x26c28c;_0x4cfc34['id']=_0x2389c3;if(_0x40c0b0){_0x108a40[util[_0x8348('0x10')](_0x8348('0x11'),_0x5257a7)][_0x2389c3]=_[_0x8348('0x12')](_0x4cfc34,attributes);}else{delete _0x108a40[util[_0x8348('0x10')]('%sQueuesWaitingInteractions',_0x5257a7)][_0x2389c3];}emit(util['format'](_0x8348('0x13'),_0x5257a7,_0x3b690b),util[_0x8348('0x10')](_0x8348('0x14'),_0x5257a7,_0x40c0b0?_0x8348('0x15'):_0x8348('0x16')),_[_0x8348('0x12')](_0x4cfc34,attributes));}var rpc={'openchannelQueueReport':require(_0x8348('0x17')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x8348('0x18'))};var queue=schema({'name':{'type':_0x8348('0x19'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x8348('0x1a')}});function startRouting(_0x2540b3,_0x2f9832,_0x453aff,_0x349101){if(_0x2540b3&&_0x2f9832&&_0x453aff){_0x2f9832[_0x8348('0x1b')]+=0x1;var _0x169dd1={'uniqueid':_0x2540b3,'from':_0x453aff[_0x8348('0x1c')]?_0x453aff[_0x8348('0x1c')][_0x8348('0xd')]:'','joinAt':moment()[_0x8348('0x10')](_0x8348('0x1d')),'ContactId':_0x453aff[_0x8348('0x1e')]?_0x453aff[_0x8348('0x1e')]['id']:null,'ListId':_0x453aff[_0x8348('0x1f')]?_0x453aff[_0x8348('0x1f')]['id']:null};_0x169dd1[_[_0x8348('0x20')](_0x453aff[_0x8348('0x21')])+_0x8348('0x22')]=_0x2f9832['id']||null;_0x169dd1[_[_0x8348('0x20')](_0x453aff[_0x8348('0x21')])+'InteractionId']=_0x453aff[_0x8348('0x23')]?_0x453aff[_0x8348('0x23')]['id']:null;_0x169dd1[_[_0x8348('0x20')](_0x453aff['channel'])+_0x8348('0x24')]=_0x453aff['message']?_0x453aff[_0x8348('0x25')]['id']:null;_0x169dd1[_[_0x8348('0x20')](_0x453aff[_0x8348('0x21')])+(_0x453aff[_0x8348('0x21')]!==_0x8348('0x26')?_0x8348('0x27'):_0x8348('0x28'))]=_0x453aff[_0x8348('0xb')]?_0x453aff[_0x8348('0xb')]['id']:null;logger[_0x8348('0x29')](util[_0x8348('0x10')](_0x8348('0x2a'),_0x2540b3,_0x2f9832[_0x8348('0x2b')]));emitChannelQueueInteraction(_0x453aff['channel'],_0x2f9832[_0x8348('0x2b')],_0x169dd1,_0x453aff[_0x8348('0xb')][_0x8348('0x2b')],_0x453aff['message']['id'],!![],_0x349101,_0x2f9832['id']);if(rpc[_0x453aff[_0x8348('0x21')]+_0x8348('0x2c')]){return rpc[_0x453aff[_0x8348('0x21')]+'QueueReport'][_0x8348('0x2d')](_0x169dd1)[_0x8348('0x2e')](function(_0x4a720f){logger[_0x8348('0x2f')]('create\x20queue\x20report');});}}}function stopRouting(_0x1bdc7c,_0x9e6904,_0x9d08c,_0x2887cb){if(_0x1bdc7c&&_0x9e6904){_0x9e6904[_0x8348('0x1b')]-=0x1;var _0x4e3b49={'leaveAt':moment()[_0x8348('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x8348('0x10')](_0x8348('0x1d')),'reason':_0x8348('0x30')};logger[_0x8348('0x29')](util[_0x8348('0x10')](_0x8348('0x31'),_0x1bdc7c,_0x9e6904[_0x8348('0x2b')]));emitChannelQueueInteraction(_0x9d08c[_0x8348('0x21')],_0x9e6904[_0x8348('0x2b')],_0x9d08c[_0x8348('0x1c')],_0x9d08c[_0x8348('0xb')][_0x8348('0x2b')],_0x9d08c[_0x8348('0x25')]['id'],![],_0x2887cb,_0x9e6904['id']);if(rpc[_0x9d08c['channel']+_0x8348('0x2c')]){return rpc[_0x9d08c[_0x8348('0x21')]+_0x8348('0x2c')]['update'](_0x1bdc7c,_0x4e3b49)[_0x8348('0x2e')](function(_0x2b4433){logger[_0x8348('0x2f')](_0x8348('0x32'));});}}}function endRouting(_0x17e579,_0x2669eb,_0x361dd2,_0x163cfe){if(_0x17e579&&_0x2669eb){_0x2669eb[_0x8348('0x1b')]-=0x1;var _0x373e94={'leaveAt':moment()['format'](_0x8348('0x1d')),'exitAt':moment()[_0x8348('0x10')](_0x8348('0x1d')),'reason':_0x8348('0x33')};logger['info'](util[_0x8348('0x10')](_0x8348('0x34'),_0x17e579,_0x2669eb[_0x8348('0x2b')]));emitChannelQueueInteraction(_0x361dd2[_0x8348('0x21')],_0x2669eb['name'],_0x361dd2[_0x8348('0x1c')],_0x361dd2[_0x8348('0xb')]['name'],_0x361dd2[_0x8348('0x25')]['id'],![],_0x163cfe);if(rpc[_0x361dd2[_0x8348('0x21')]+_0x8348('0x2c')]){return rpc[_0x361dd2[_0x8348('0x21')]+_0x8348('0x2c')][_0x8348('0x35')](_0x17e579,_0x373e94)['catch'](function(_0x10bfd1){logger[_0x8348('0x2f')](_0x8348('0x32'));});}}}function handleFindQueue(_0xe054){return function(_0x28ae5d){return _0x28ae5d['name'][_0x8348('0x36')]()===_0xe054[_0x8348('0x36')]();};}exports[_0x8348('0x37')]=function(_0x55e547,_0x4d3dbc,_0x226292,_0x5bfbdc){return function(_0x3d9cf0){try{var _0x55ee84={'name':_0x4d3dbc[0x0],'timeout':_0x4d3dbc[0x1]};var _0x5b066f=queue[_0x8348('0x0')](_0x55ee84,{'typecast':!![]});if(_0x5b066f['length']){logger[_0x8348('0x2f')]('[%s][QUEUE]\x20%s',_0x55e547,_[_0x8348('0x38')](_0x5b066f,'message')[_0x8348('0x39')](',\x20'));_0x3d9cf0['stop']();}else{var _0x1fa737=_[_0x8348('0x3a')](_0x226292[_0x5bfbdc[_0x8348('0x21')]+_0x8348('0x3b')],handleFindQueue(_0x55ee84[_0x8348('0x2b')]));if(_0x1fa737){startRouting(_0x55e547,_0x1fa737,_0x5bfbdc,_0x226292);var _0x402d1d=(_0x1fa737['timeout']||0xa)*0x3e8;var _0x3402d0=(_0x55ee84[_0x8348('0x33')]||0x14)*0x3e8;var _0x524d7e,_0x57932c;if(_0x402d1d>_0x3402d0){_0x3402d0=_0x402d1d;}var _0x28ebc4=seqqueue[_0x8348('0x3c')](_0x402d1d);_0x28ebc4['id']=_0x55e547;_0x28ebc4[_0x8348('0x3d')]=_0x402d1d;_0x28ebc4[_0x8348('0x3e')]=_0x3402d0;_0x28ebc4['channel']=_0x5bfbdc[_0x8348('0x21')];_0x226292['rules'][_0x55e547]['on']('end',function(){stopRouting(_0x55e547,_0x1fa737,_0x5bfbdc,_0x226292);_0x28ebc4[_0x8348('0x3f')](!![]);clearTimeout(_0x524d7e);_0x524d7e=undefined;if(_0x226292[_0x8348('0x40')][_0x55e547]){delete _0x226292[_0x8348('0x40')][_0x55e547];}logger[_0x8348('0x29')](_0x8348('0x41'),_0x55e547);_0x3d9cf0[_0x8348('0x42')]();});_0x524d7e=setTimeout(function(){endRouting(_0x55e547,_0x1fa737,_0x5bfbdc,_0x226292);clearTimeout(_0x524d7e);_0x28ebc4['close'](!![]);logger['info']('[%s][QUEUE]\x20ROUTING\x20END',_0x55e547);_0x3d9cf0['next']();},_0x3402d0);switch(_0x1fa737['strategy']){case _0x8348('0x43'):strategy['rrmemory'](_0x28ebc4,_0x1fa737,_0x226292,_0x5bfbdc);break;default:strategy['beepall'](_0x28ebc4,_0x1fa737,_0x226292,_0x5bfbdc);}}else{logger[_0x8348('0x2f')](_0x8348('0x44'),_0x55e547,_0x55ee84[_0x8348('0x2b')]);_0x3d9cf0[_0x8348('0x42')]();}}}catch(_0x2f8641){console['log'](_0x2f8641);logger[_0x8348('0x2f')](_0x8348('0x45'),_0x55e547,_0x2f8641[_0x8348('0x46')]);_0x3d9cf0['stop']();}};}; \ 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 7e1b1cf..66125a2 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 _0x0b3d=['handleDrained','prototype','push','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','channel','busyQueue','showNotification','RINGING','forcedOwnership','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','busy','writeLog','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','handleRun','bind','handleTimeout','drained'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0b3d,0x1e3));var _0xd0b3=function(_0x81fee8,_0x32f097){_0x81fee8=_0x81fee8-0x0;var _0x2b2c4e=_0x0b3d[_0x81fee8];return _0x2b2c4e;};'use strict';var _=require(_0xd0b3('0x0'));var uuid=require(_0xd0b3('0x1'));var util=require(_0xd0b3('0x2'));var logger=require(_0xd0b3('0x3'))(_0xd0b3('0x4'));var Agent=function(_0x125262,_0x285817,_0x5770ce,_0xb53705){this[_0xd0b3('0x5')]=uuid['v4']();this[_0xd0b3('0x6')]=_0x125262;this[_0xd0b3('0x7')]=_0x285817;this['realtime']=_0x5770ce;this[_0xd0b3('0x4')]=_0xb53705;this[_0xd0b3('0x6')]['push'](this[_0xd0b3('0x8')][_0xd0b3('0x9')](this),this[_0xd0b3('0xa')][_0xd0b3('0x9')](this));this[_0xd0b3('0x6')]['on']('timeout',this['handleTimeout'][_0xd0b3('0x9')](this));this['squeue']['on'](_0xd0b3('0xb'),this[_0xd0b3('0xc')]['bind'](this));};Agent[_0xd0b3('0xd')]['push']=function(){this[_0xd0b3('0x6')][_0xd0b3('0xe')](this[_0xd0b3('0x8')]['bind'](this),this[_0xd0b3('0xa')][_0xd0b3('0x9')](this));};Agent[_0xd0b3('0xd')]['handleDrained']=function(){this[_0xd0b3('0xa')](!![]);};Agent[_0xd0b3('0xd')][_0xd0b3('0x8')]=function(_0x1d1fd2){logger[_0xd0b3('0xf')](_0xd0b3('0x10'),this[_0xd0b3('0x6')]['id'],this[_0xd0b3('0x7')]['id']);if(_[_0xd0b3('0x11')](this[_0xd0b3('0x12')]['agents'][this[_0xd0b3('0x7')]['id']])){logger['info'](_0xd0b3('0x13'),this[_0xd0b3('0x6')]['id'],this[_0xd0b3('0x7')]['id']);setTimeout(this[_0xd0b3('0xe')][_0xd0b3('0x9')](this),0x3e8);}else{if(this[_0xd0b3('0x4')]['forcedOwnership']||util[_0xd0b3('0x14')](this['squeue']['id'],this[_0xd0b3('0x12')][_0xd0b3('0x15')][this[_0xd0b3('0x7')]['id']],this['squeue'][_0xd0b3('0x16')],![])){this[_0xd0b3('0x12')][_0xd0b3('0x15')][this['agent']['id']]['busy']=!![];this[_0xd0b3('0x12')][_0xd0b3('0x15')][this[_0xd0b3('0x7')]['id']][_0xd0b3('0x17')]=undefined;util[_0xd0b3('0x18')](this[_0xd0b3('0x5')],this[_0xd0b3('0x6')]['id'],this['realtime']['agents'][this[_0xd0b3('0x7')]['id']],null,this[_0xd0b3('0x4')]);util['writeLog'](this['squeue']['id'],this[_0xd0b3('0x12')]['agents'][this[_0xd0b3('0x7')]['id']],_0xd0b3('0x19')+(this['routing'][_0xd0b3('0x1a')]?':FORCED':''));}else{logger[_0xd0b3('0xf')](_0xd0b3('0x1b'),this[_0xd0b3('0x6')]['id'],this[_0xd0b3('0x7')]['id']);setTimeout(this[_0xd0b3('0xe')][_0xd0b3('0x9')](this),0x3e8);}}};Agent[_0xd0b3('0xd')]['handleTimeout']=function(_0x20bd14){if(_[_0xd0b3('0x11')](this[_0xd0b3('0x12')]['agents'][this['agent']['id']])){return logger[_0xd0b3('0xf')](_0xd0b3('0x13'),this[_0xd0b3('0x6')]['id'],this[_0xd0b3('0x7')]['id']);}else{logger[_0xd0b3('0xf')](_0xd0b3('0x1c'),this[_0xd0b3('0x6')]['id'],this['agent']['id']);util['hideNotification'](this['notificationId'],this['squeue']['id'],this[_0xd0b3('0x12')][_0xd0b3('0x15')][this[_0xd0b3('0x7')]['id']],null,this[_0xd0b3('0x4')]);this[_0xd0b3('0x12')][_0xd0b3('0x15')][this[_0xd0b3('0x7')]['id']][_0xd0b3('0x1d')]=![];this['realtime'][_0xd0b3('0x15')][this['agent']['id']]['busyQueue']=undefined;util[_0xd0b3('0x1e')](this[_0xd0b3('0x6')]['id'],this['realtime']['agents'][this[_0xd0b3('0x7')]['id']],_0x20bd14?'STOP':_0xd0b3('0x1f'));}if(!_0x20bd14){setTimeout(this[_0xd0b3('0xe')][_0xd0b3('0x9')](this),0x3e8);}};function agent(_0x1e8bf9,_0x22186e,_0x3a44f9,_0x2e075){return new Agent(_0x1e8bf9,_0x22186e,_0x3a44f9,_0x2e075);}module[_0xd0b3('0x20')]=agent; \ No newline at end of file +var _0x8c34=['STOP','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','channel','busy','busyQueue','showNotification','writeLog','RINGING','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8c34,0x181));var _0x48c3=function(_0x1527c3,_0x11c088){_0x1527c3=_0x1527c3-0x0;var _0x5105ae=_0x8c34[_0x1527c3];return _0x5105ae;};'use strict';var _=require('lodash');var uuid=require(_0x48c3('0x0'));var util=require(_0x48c3('0x1'));var logger=require(_0x48c3('0x2'))(_0x48c3('0x3'));var Agent=function(_0x1299ca,_0x23d0ac,_0x3df265,_0x84fa9e){this[_0x48c3('0x4')]=uuid['v4']();this[_0x48c3('0x5')]=_0x1299ca;this[_0x48c3('0x6')]=_0x23d0ac;this[_0x48c3('0x7')]=_0x3df265;this[_0x48c3('0x3')]=_0x84fa9e;this[_0x48c3('0x5')][_0x48c3('0x8')](this[_0x48c3('0x9')][_0x48c3('0xa')](this),this['handleTimeout'][_0x48c3('0xa')](this));this['squeue']['on'](_0x48c3('0xb'),this[_0x48c3('0xc')][_0x48c3('0xa')](this));this['squeue']['on'](_0x48c3('0xd'),this[_0x48c3('0xe')][_0x48c3('0xa')](this));};Agent[_0x48c3('0xf')]['push']=function(){this[_0x48c3('0x5')][_0x48c3('0x8')](this[_0x48c3('0x9')]['bind'](this),this[_0x48c3('0xc')][_0x48c3('0xa')](this));};Agent[_0x48c3('0xf')][_0x48c3('0xe')]=function(){this[_0x48c3('0xc')](!![]);};Agent[_0x48c3('0xf')][_0x48c3('0x9')]=function(_0x30bde8){logger[_0x48c3('0x10')](_0x48c3('0x11'),this['squeue']['id'],this[_0x48c3('0x6')]['id']);if(_[_0x48c3('0x12')](this[_0x48c3('0x7')]['agents'][this['agent']['id']])){logger[_0x48c3('0x10')](_0x48c3('0x13'),this[_0x48c3('0x5')]['id'],this[_0x48c3('0x6')]['id']);setTimeout(this[_0x48c3('0x8')]['bind'](this),0x3e8);}else{if(this[_0x48c3('0x3')][_0x48c3('0x14')]||util[_0x48c3('0x15')](this[_0x48c3('0x5')]['id'],this['realtime'][_0x48c3('0x16')][this[_0x48c3('0x6')]['id']],this[_0x48c3('0x5')][_0x48c3('0x17')],![])){this[_0x48c3('0x7')][_0x48c3('0x16')][this['agent']['id']][_0x48c3('0x18')]=!![];this['realtime'][_0x48c3('0x16')][this[_0x48c3('0x6')]['id']][_0x48c3('0x19')]=undefined;util[_0x48c3('0x1a')](this[_0x48c3('0x4')],this[_0x48c3('0x5')]['id'],this[_0x48c3('0x7')][_0x48c3('0x16')][this[_0x48c3('0x6')]['id']],null,this[_0x48c3('0x3')]);util[_0x48c3('0x1b')](this['squeue']['id'],this[_0x48c3('0x7')][_0x48c3('0x16')][this[_0x48c3('0x6')]['id']],_0x48c3('0x1c')+(this[_0x48c3('0x3')][_0x48c3('0x14')]?':FORCED':''));}else{logger[_0x48c3('0x10')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x48c3('0x5')]['id'],this[_0x48c3('0x6')]['id']);setTimeout(this[_0x48c3('0x8')][_0x48c3('0xa')](this),0x3e8);}}};Agent[_0x48c3('0xf')][_0x48c3('0xc')]=function(_0x315d31){if(_[_0x48c3('0x12')](this[_0x48c3('0x7')][_0x48c3('0x16')][this[_0x48c3('0x6')]['id']])){return logger['info'](_0x48c3('0x13'),this[_0x48c3('0x5')]['id'],this[_0x48c3('0x6')]['id']);}else{logger['info'](_0x48c3('0x1d'),this[_0x48c3('0x5')]['id'],this[_0x48c3('0x6')]['id']);util[_0x48c3('0x1e')](this[_0x48c3('0x4')],this[_0x48c3('0x5')]['id'],this[_0x48c3('0x7')][_0x48c3('0x16')][this[_0x48c3('0x6')]['id']],null,this[_0x48c3('0x3')]);this[_0x48c3('0x7')][_0x48c3('0x16')][this[_0x48c3('0x6')]['id']][_0x48c3('0x18')]=![];this['realtime'][_0x48c3('0x16')][this[_0x48c3('0x6')]['id']][_0x48c3('0x19')]=undefined;util[_0x48c3('0x1b')](this[_0x48c3('0x5')]['id'],this['realtime']['agents'][this[_0x48c3('0x6')]['id']],_0x315d31?_0x48c3('0x1f'):'TIMEOUT');}if(!_0x315d31){setTimeout(this[_0x48c3('0x8')][_0x48c3('0xa')](this),0x3e8);}};function agent(_0x475e3a,_0x304170,_0x4a47a2,_0x168da0){return new Agent(_0x475e3a,_0x304170,_0x4a47a2,_0x168da0);}module['exports']=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 4bcc265..0448d93 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 _0xebf9=['length','Agents','agents','info','isAgentAvailable','channel','realtime','busy','busyQueue','name','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','writeLog','STOP','TIMEOUT','exports','routing','notificationId','squeue','queue','push','handleTimeout','bind','drained','handleDrained','prototype','handleRun','isNil'];(function(_0xf4251f,_0x5d37e8){var _0x2f1248=function(_0x169cae){while(--_0x169cae){_0xf4251f['push'](_0xf4251f['shift']());}};_0x2f1248(++_0x5d37e8);}(_0xebf9,0x133));var _0x9ebf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xebf9[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require('./util');var logger=require('../../../../../config/logger')(_0x9ebf('0x0'));var Beepall=function(_0x54444d,_0x11348c,_0xe49b59,_0x40d26f){this[_0x9ebf('0x1')]=uuid['v4']();this[_0x9ebf('0x2')]=_0x54444d;this[_0x9ebf('0x3')]=_0x11348c;this['realtime']=_0xe49b59;this[_0x9ebf('0x0')]=_0x40d26f;this[_0x9ebf('0x2')][_0x9ebf('0x4')](this['handleRun']['bind'](this),this[_0x9ebf('0x5')][_0x9ebf('0x6')](this));this[_0x9ebf('0x2')]['on']('timeout',this[_0x9ebf('0x5')]['bind'](this));this[_0x9ebf('0x2')]['on'](_0x9ebf('0x7'),this[_0x9ebf('0x8')][_0x9ebf('0x6')](this));};Beepall[_0x9ebf('0x9')][_0x9ebf('0x4')]=function(){this[_0x9ebf('0x2')]['push'](this[_0x9ebf('0xa')]['bind'](this),this[_0x9ebf('0x5')][_0x9ebf('0x6')](this));};Beepall[_0x9ebf('0x9')][_0x9ebf('0x8')]=function(_0x473f71){this['handleTimeout'](!![]);};Beepall[_0x9ebf('0x9')][_0x9ebf('0xa')]=function(_0x351e63){var _0x39988d=!![];if(!_['isNil'](this[_0x9ebf('0x3')])&&!_[_0x9ebf('0xb')](this['queue']['Agents'])&&this[_0x9ebf('0x3')]['Agents'][_0x9ebf('0xc')]>0x0){for(var _0x426dfe=0x0,_0x4332e4;_0x426dfe0x0){for(var _0x5b30c8=0x0,_0x37e891;_0x5b30c80x0&&_0x5a4403[_0x984f37+'CurrentCapacity']>=_0x5a4403[_0x984f37+_0xe3be('0x23')]){writeLog(_0x35a9b3,_0x5a4403,_0x984f37['toUpperCase']()+_0xe3be('0x25'));return![];}}return!![];};exports['showNotification']=function(_0x2dd8ea,_0x4c8f19,_0x6d8caa,_0x13b29d,_0x13b967){return sendNotification(!![],_0x2dd8ea,_0x4c8f19,_0x6d8caa,_0x13b29d,_0x13b967);};exports[_0xe3be('0x26')]=function(_0x69c920,_0x42c562,_0x4da6e9,_0xdf6df2,_0x995c4a){return sendNotification(![],_0x69c920,_0x42c562,_0x4da6e9,_0xdf6df2,_0x995c4a);};exports[_0xe3be('0x27')]=writeLog; \ No newline at end of file +var _0xd0d4=['notificationSound','account','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','message','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','util','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','localhost','socket.io-emitter','emit','format','user:%s','name','user:save','\x20interaction'];(function(_0x3ef4f1,_0x5f0f9b){var _0x69953c=function(_0xb4e621){while(--_0xb4e621){_0x3ef4f1['push'](_0x3ef4f1['shift']());}};_0x69953c(++_0x5f0f9b);}(_0xd0d4,0x74));var _0x4d0d=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xd0d4[_0x42bdad];return _0x122626;};'use strict';var _=require(_0x4d0d('0x0'));var util=require(_0x4d0d('0x1'));var utils=require('../utils');var Mustache=require(_0x4d0d('0x2'));var Redis=require(_0x4d0d('0x3'));var config=require(_0x4d0d('0x4'));var logger=require(_0x4d0d('0x5'))(_0x4d0d('0x6'));config[_0x4d0d('0x7')]=_['defaults'](config[_0x4d0d('0x7')],{'host':_0x4d0d('0x8'),'port':0x18eb});var io=require(_0x4d0d('0x9'))(new Redis(config[_0x4d0d('0x7')]));function emit(_0x14e52b,_0x230eab,_0x47759f){io['to'](_0x14e52b)[_0x4d0d('0xa')](_0x230eab,_0x47759f);}function sendNotification(_0x14e1d6,_0x30acc9,_0x27a62c,_0x56b4ba,_0x24217c,_0xfeb10c){io['to'](util[_0x4d0d('0xb')](_0x4d0d('0xc'),_0x56b4ba[_0x4d0d('0xd')]))['emit'](_0x4d0d('0xe'),_0x56b4ba);var _0x4c88d1=_0xfeb10c||{};var _0x26f5df=_0x27a62c['split']('.');var _0x5b7d24={'uniqueid':_0x30acc9,'channel':_0x26f5df[0x0],'id':_0x26f5df[0x1],'title':_0x26f5df[0x0]+_0x4d0d('0xf'),'interactionId':_0x26f5df[0x2],'queue':_0x24217c?_0x24217c['name']:null,'sound':_0x4c88d1['account'][_0x4d0d('0x10')],'shake':_0x4c88d1[_0x4d0d('0x11')][_0x4d0d('0x12')]};try{if(!_0x4c88d1[_0x4d0d('0x13')]){_0x4c88d1[_0x4d0d('0x13')]={};}if(_0x24217c){_0x4c88d1[_0x4d0d('0x13')][_0x4d0d('0x14')]=_0x24217c;}else if(_0x4c88d1[_0x4d0d('0x13')][_0x4d0d('0x14')]){delete _0x4c88d1['body'][_0x4d0d('0x14')];}_0x5b7d24[_0x4d0d('0x15')]=utils[_0x4d0d('0x16')](_0x4c88d1['account'][_0x4d0d('0x17')],_0x4c88d1);}catch(_0xe610d3){_0x5b7d24[_0x4d0d('0x15')]=_0x4d0d('0x18');logger['error'](util[_0x4d0d('0xb')](_0x4d0d('0x19'),_0x30acc9,_0xe610d3[_0x4d0d('0x1a')]));}io['to'](util[_0x4d0d('0xb')](_0x4d0d('0xc'),_0x56b4ba[_0x4d0d('0xd')]))[_0x4d0d('0xa')](util[_0x4d0d('0xb')]('notification:%s',_0x14e1d6?_0x4d0d('0x1b'):_0x4d0d('0x1c')),_0x5b7d24);}function writeLog(_0x57c464,_0x57c9dd,_0x298406){return logger[_0x4d0d('0x1d')](util[_0x4d0d('0xb')](_0x4d0d('0x1e'),_0x57c464,_0x57c9dd[_0x4d0d('0xd')],_0x298406));}exports[_0x4d0d('0x1f')]=function(_0x440992,_0xc6ee71,_0x21d3b2,_0x3a5116){if(_0xc6ee71[_0x4d0d('0x20')]){writeLog(_0x440992,_0xc6ee71,_0x4d0d('0x21'));return![];}if(!_0xc6ee71[_0x4d0d('0x22')]){writeLog(_0x440992,_0xc6ee71,_0x4d0d('0x23'));return![];}if(_0xc6ee71[_0x21d3b2+_0x4d0d('0x24')]){writeLog(_0x440992,_0xc6ee71,'PAUSE');return![];}if(_0x3a5116&&_0xc6ee71[_0x4d0d('0x25')](_0x21d3b2+_0x4d0d('0x26'))&&_0xc6ee71[_0x4d0d('0x25')](_0x21d3b2+_0x4d0d('0x27'))){if(_0xc6ee71[_0x21d3b2+_0x4d0d('0x26')]>0x0&&_0xc6ee71[_0x21d3b2+'CurrentCapacity']>=_0xc6ee71[_0x21d3b2+'Capacity']){writeLog(_0x440992,_0xc6ee71,_0x21d3b2['toUpperCase']()+_0x4d0d('0x28'));return![];}}return!![];};exports[_0x4d0d('0x29')]=function(_0x25ef69,_0x6a571b,_0x1ba895,_0x42ba9a,_0x1f4b71){return sendNotification(!![],_0x25ef69,_0x6a571b,_0x1ba895,_0x42ba9a,_0x1f4b71);};exports[_0x4d0d('0x2a')]=function(_0x29cfc2,_0x2846c8,_0x3f0c01,_0x55dedb,_0x564548){return sendNotification(![],_0x29cfc2,_0x2846c8,_0x3f0c01,_0x55dedb,_0x564548);};exports[_0x4d0d('0x2b')]=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 63a0a2b..9fb90e2 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 _0x58a5=['string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','./utils','../../../../config/logger','routing'];(function(_0x5407f0,_0x3657ba){var _0x197faa=function(_0x4d7b48){while(--_0x4d7b48){_0x5407f0['push'](_0x5407f0['shift']());}};_0x197faa(++_0x3657ba);}(_0x58a5,0x167));var _0x558a=function(_0x1fcaf1,_0x21c3c2){_0x1fcaf1=_0x1fcaf1-0x0;var _0x55f464=_0x58a5[_0x1fcaf1];return _0x55f464;};'use strict';var schema=require(_0x558a('0x0'));var sh=require(_0x558a('0x1'));var _=require('lodash');var utils=require(_0x558a('0x2'));var logger=require(_0x558a('0x3'))(_0x558a('0x4'));var system=schema({'command':{'type':_0x558a('0x5'),'required':!![],'message':_0x558a('0x6')}});exports[_0x558a('0x7')]=function(_0x45c0cf,_0x360317){return function(_0x26cec5){try{var _0x33c3d2={'command':_0x360317[0x0]};var _0xb00efb=system['validate'](_0x33c3d2,{'typecast':!![]});if(_0xb00efb[_0x558a('0x8')]){logger['error']('[%s][SYSTEM]\x20%s',_0x45c0cf,_['map'](_0xb00efb,_0x558a('0x9'))[_0x558a('0xa')](',\x20'));logger[_0x558a('0xb')](_0x558a('0xc'),_0x45c0cf);_0x26cec5[_0x558a('0xd')]();}else{var _0x5d7ea8=this;var _0x72eef9=utils[_0x558a('0xe')](_0x360317[0x0],this);logger[_0x558a('0xb')](_0x558a('0xf'),_0x45c0cf,_0x72eef9);sh[_0x558a('0x10')](_[_0x558a('0x11')](_0x72eef9),function(_0x5d896d,_0x30ff58){logger[_0x558a('0xb')](_0x558a('0x12'),_0x45c0cf,_0x5d896d);if(_0x5d896d==0x0){var _0x32c0d9=_0x30ff58[_0x558a('0x13')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x360317[0x1])||_[_0x558a('0x14')](_0x360317[0x1])){logger[_0x558a('0xb')](_0x558a('0x15'),_0x45c0cf);_0x5d7ea8[_0x558a('0x16')][_0x360317[0x1]]=_0x32c0d9;}else{logger['info'](_0x558a('0x17'),_0x45c0cf,_0x360317[0x1],_0x32c0d9);_0x5d7ea8[_0x558a('0x16')][_0x360317[0x1]]=_0x32c0d9;}}_0x26cec5[_0x558a('0xd')]();});}}catch(_0x32af35){logger['error']('[%s][SYSTEM]\x20%s',_0x45c0cf,_[_0x558a('0x18')](_0x32af35)?JSON[_0x558a('0x19')](_0x32af35):_0x32af35);logger[_0x558a('0xb')](_0x558a('0xc'),_0x45c0cf);_0x26cec5[_0x558a('0xd')]();}};}; \ No newline at end of file +var _0x104f=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','./utils','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','stringify'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x104f,0x112));var _0xf104=function(_0x3ccf3c,_0xceb701){_0x3ccf3c=_0x3ccf3c-0x0;var _0x54e819=_0x104f[_0x3ccf3c];return _0x54e819;};'use strict';var schema=require(_0xf104('0x0'));var sh=require(_0xf104('0x1'));var _=require(_0xf104('0x2'));var utils=require(_0xf104('0x3'));var logger=require(_0xf104('0x4'))('routing');var system=schema({'command':{'type':_0xf104('0x5'),'required':!![],'message':_0xf104('0x6')}});exports[_0xf104('0x7')]=function(_0x3a4915,_0x5572af){return function(_0x74604b){try{var _0x3e5c23={'command':_0x5572af[0x0]};var _0x2397b1=system['validate'](_0x3e5c23,{'typecast':!![]});if(_0x2397b1['length']){logger[_0xf104('0x8')](_0xf104('0x9'),_0x3a4915,_[_0xf104('0xa')](_0x2397b1,_0xf104('0xb'))[_0xf104('0xc')](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x3a4915);_0x74604b['next']();}else{var _0x4f1f8f=this;var _0x37c0f4=utils['getMustacheRender'](_0x5572af[0x0],this);logger[_0xf104('0xd')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x3a4915,_0x37c0f4);sh['exec'](_['trim'](_0x37c0f4),function(_0x4a436c,_0x4e0104){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x3a4915,_0x4a436c);if(_0x4a436c==0x0){var _0x65291a=_0x4e0104['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x5572af[0x1])||_['isEmpty'](_0x5572af[0x1])){logger[_0xf104('0xd')](_0xf104('0xe'),_0x3a4915);_0x4f1f8f[_0xf104('0xf')][_0x5572af[0x1]]=_0x65291a;}else{logger[_0xf104('0xd')](_0xf104('0x10'),_0x3a4915,_0x5572af[0x1],_0x65291a);_0x4f1f8f[_0xf104('0xf')][_0x5572af[0x1]]=_0x65291a;}}_0x74604b[_0xf104('0x11')]();});}}catch(_0x2b5128){logger['error']('[%s][SYSTEM]\x20%s',_0x3a4915,_[_0xf104('0x12')](_0x2b5128)?JSON[_0xf104('0x13')](_0x2b5128):_0x2b5128);logger[_0xf104('0xd')](_0xf104('0x14'),_0x3a4915);_0x74604b[_0xf104('0x11')]();}};}; \ 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 f2f0040..bacd04e 100644 --- a/server/services/routing/server/applications/tag.js +++ b/server/services/routing/server/applications/tag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['join','info','next','Interaction','channel','addTags','interaction','then','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message'];(function(_0x51e77b,_0x4d4926){var _0x1dfcf9=function(_0x2e227a){while(--_0x2e227a){_0x51e77b['push'](_0x51e77b['shift']());}};_0x1dfcf9(++_0x4d4926);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var schema=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var rpc={'chatInteraction':require(_0x7995('0x2')),'openchannelInteraction':require(_0x7995('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x7995('0x4')),'faxInteraction':require(_0x7995('0x5'))};var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x7995('0x8')}});exports[_0x7995('0x9')]=function(_0x137b6b,_0x219534,_0xbda126,_0x326741){return function(_0x4996ca){try{var _0x465276={'tag':_0x219534[0x0]};var _0x1cad37=tag['validate'](_0x465276,{'typecast':!![]});if(_0x1cad37[_0x7995('0xa')]){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0xd')](_0x1cad37,_0x7995('0xe'))[_0x7995('0xf')](',\x20'));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca[_0x7995('0x11')]();}else{var _0x41c652={'ids':[_0x219534[0x0]]};if(rpc[_0x326741['channel']+_0x7995('0x12')]){rpc[_0x326741[_0x7995('0x13')]+_0x7995('0x12')][_0x7995('0x14')](_0x326741[_0x7995('0x15')]['id'],_0x41c652)[_0x7995('0x16')](function(_0x2bbe7a){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x137b6b,_0x219534[0x1],_0x326741[_0x7995('0x13')],_0x326741[_0x7995('0x15')]['id']);})[_0x7995('0x17')](function(_0x321ae8){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,JSON[_0x7995('0x18')](_0x321ae8));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);})[_0x7995('0x19')](function(){_0x4996ca['next']();});}}}catch(_0x2f832e){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0x1a')](_0x2f832e)?JSON[_0x7995('0x18')](_0x2f832e):_0x2f832e);logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca['next']();}};}; \ No newline at end of file +var _0x9957=['join','info','next','Interaction','channel','addTags','interaction','then','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message'];(function(_0x400766,_0x368660){var _0x3ae58b=function(_0x4c6a6e){while(--_0x4c6a6e){_0x400766['push'](_0x400766['shift']());}};_0x3ae58b(++_0x368660);}(_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 768ed91..e095a3c 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 _0xefbf=['list','mustache','lodash','render','merge','body','contact','message','account'];(function(_0x216a26,_0x4c4283){var _0x2e3695=function(_0x1801fa){while(--_0x1801fa){_0x216a26['push'](_0x216a26['shift']());}};_0x2e3695(++_0x4c4283);}(_0xefbf,0xa3));var _0xfefb=function(_0x2d775e,_0x4c0165){_0x2d775e=_0x2d775e-0x0;var _0x47e959=_0xefbf[_0x2d775e];return _0x47e959;};'use strict';var Mustache=require(_0xfefb('0x0'));var _=require(_0xfefb('0x1'));module['exports']={'getMustacheRender':function(_0x537bf7,_0x5f199d){return Mustache[_0xfefb('0x2')](_0x537bf7,_[_0xfefb('0x3')](_0x5f199d[_0xfefb('0x4')],{'contact':_0x5f199d[_0xfefb('0x5')],'message':_0x5f199d[_0xfefb('0x6')],'account':_0x5f199d[_0xfefb('0x7')],'interaction':_0x5f199d['interaction'],'list':_0x5f199d[_0xfefb('0x8')]}))||'';}}; \ No newline at end of file +var _0xd52d=['exports','body','contact','message','account','interaction','list','lodash'];(function(_0x1d5977,_0x18e429){var _0x3b5cc1=function(_0xa952eb){while(--_0xa952eb){_0x1d5977['push'](_0x1d5977['shift']());}};_0x3b5cc1(++_0x18e429);}(_0xd52d,0x1c7));var _0xdd52=function(_0xc9824f,_0x4347a4){_0xc9824f=_0xc9824f-0x0;var _0x1ed076=_0xd52d[_0xc9824f];return _0x1ed076;};'use strict';var Mustache=require('mustache');var _=require(_0xdd52('0x0'));module[_0xdd52('0x1')]={'getMustacheRender':function(_0x4a8e8e,_0x3bed6e){return Mustache['render'](_0x4a8e8e,_['merge'](_0x3bed6e[_0xdd52('0x2')],{'contact':_0x3bed6e[_0xdd52('0x3')],'message':_0x3bed6e[_0xdd52('0x4')],'account':_0x3bed6e[_0xdd52('0x5')],'interaction':_0x3bed6e[_0xdd52('0x6')],'list':_0x3bed6e[_0xdd52('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 5c37b2d..e091bd1 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 _0x3fbe=['applications','isArray','length','existsSync','app','toLowerCase','autoreply','appdata','split','push','slice','join','dialogflow','amazonlex','tag','TagId','format','./interval','condition','consequence','priority','info','Push\x20new\x20rule','\x20|\x20','error','.js','execute','Applications\x20executed','stringify','matchPath','rules','end','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','emit','QueueReport','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','values','chatQueues','available','paused','waiting','mailQueues','name','openchannelQueues','smsQueues','loggedIn','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','uuid','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction'];(function(_0xfa5c65,_0x54ab9b){var _0x3946c0=function(_0x41dad9){while(--_0x41dad9){_0xfa5c65['push'](_0xfa5c65['shift']());}};_0x3946c0(++_0x54ab9b);}(_0x3fbe,0x1ac));var _0xe3fb=function(_0x5d88bc,_0x2a37b9){_0x5d88bc=_0x5d88bc-0x0;var _0xfd4d97=_0x3fbe[_0x5d88bc];return _0xfd4d97;};'use strict';var _=require('lodash');var util=require(_0xe3fb('0x0'));var path=require(_0xe3fb('0x1'));var fs=require('fs');var jayson=require(_0xe3fb('0x2'));var BPromise=require(_0xe3fb('0x3'));var uuid=require(_0xe3fb('0x4'));var config=require(_0xe3fb('0x5'));var logger=require('../../../config/logger')(_0xe3fb('0x6'));var rpc={'openchannelQueueReport':require(_0xe3fb('0x7'))};var rpc={'openchannelQueueReport':require(_0xe3fb('0x7')),'mailQueueReport':require(_0xe3fb('0x8')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xe3fb('0x9')),'faxQueueReport':require(_0xe3fb('0xa'))};var RuleEngine=require(_0xe3fb('0xb'));function getId(_0x550ca9,_0x1b081f,_0x55cfae){return util['format'](_0xe3fb('0xc'),_0x550ca9,_0x1b081f||0x0,_0x55cfae||0x0);}function getIntervals(_0x12342c,_0x5dda48){var _0x58f617=[];if(!_[_0xe3fb('0xd')](_0x5dda48[_0xe3fb('0xe')])&&!_[_0xe3fb('0xd')](_0x12342c[_0x5dda48['IntervalId']])&&!_[_0xe3fb('0xd')](_0x12342c[_0x5dda48[_0xe3fb('0xe')]][_0xe3fb('0xf')])){_0x58f617=_[_0xe3fb('0x10')](_0x12342c[_0x5dda48['IntervalId']]['Intervals'],_0xe3fb('0x11'));}else if(!_['isNil'](_0x5dda48[_0xe3fb('0x11')])){_0x58f617=[_0x5dda48[_0xe3fb('0x11')]];}return _0x58f617;}exports[_0xe3fb('0x12')]=function(_0x209b36){_0x209b36['rules']={};return new BPromise(function(_0x556cca,_0x42871f){var _0x5c772c={'Start':function(_0x1025c4){var _0x3ba0f3=this;return new Promise(function(_0x29185f,_0x1bf2e4){if(_0x1025c4){try{var _0x58171e=[];var _0x2f66d6=getId(_0x1025c4[_0xe3fb('0x13')],_0x1025c4[_0xe3fb('0x14')]?_0x1025c4[_0xe3fb('0x14')]['id']:0x0,_0x1025c4['interaction']?_0x1025c4[_0xe3fb('0x15')]['id']:0x0);if(_0x1025c4[_0xe3fb('0x16')]&&_[_0xe3fb('0x17')](_0x1025c4[_0xe3fb('0x16')])&&_0x1025c4['applications'][_0xe3fb('0x18')]){for(var _0x43deac=0x0;_0x43deac<_0x1025c4[_0xe3fb('0x16')]['length'];_0x43deac+=0x1){var _0x132cef=_0x1025c4[_0xe3fb('0x16')][_0x43deac];if(fs[_0xe3fb('0x19')](path['join'](__dirname,_0xe3fb('0x16'),_0x132cef[_0xe3fb('0x1a')]+'.js'))){var _0x4ea80a=[];switch(_0x132cef['app'][_0xe3fb('0x1b')]()){case _0xe3fb('0x1c'):var _0xa44636=_0x132cef[_0xe3fb('0x1d')][_0xe3fb('0x1e')](',');_0x4ea80a[_0xe3fb('0x1f')](_0xa44636[0x0]);_0x4ea80a['push'](_0xa44636[_0xe3fb('0x20')](0x1,_0xa44636[_0xe3fb('0x18')])[_0xe3fb('0x21')](','));break;case _0xe3fb('0x22'):var _0xa44636=_0x132cef[_0xe3fb('0x1d')][_0xe3fb('0x1e')](',');_0x4ea80a[_0xe3fb('0x1f')](_0xa44636[0x0]);_0x4ea80a['push'](_0xa44636[0x1]);_0x4ea80a[_0xe3fb('0x1f')](_0xa44636[_0xe3fb('0x20')](0x2,_0xa44636[_0xe3fb('0x18')])[_0xe3fb('0x21')](','));break;case _0xe3fb('0x23'):var _0xa44636=_0x132cef[_0xe3fb('0x1d')][_0xe3fb('0x1e')](',');_0x4ea80a['push'](_0xa44636[0x0]);_0x4ea80a[_0xe3fb('0x1f')](_0xa44636[0x1]);_0x4ea80a[_0xe3fb('0x1f')](_0xa44636[0x2]);_0x4ea80a[_0xe3fb('0x1f')](_0xa44636[0x3]);_0x4ea80a['push'](_0xa44636[_0xe3fb('0x20')](0x4,_0xa44636[_0xe3fb('0x18')])['join'](','));break;case _0xe3fb('0x14'):_0x4ea80a[_0xe3fb('0x1f')](_0x132cef[_0xe3fb('0x1d')]);break;case _0xe3fb('0x24'):_0x4ea80a[_0xe3fb('0x1f')](_0x132cef[_0xe3fb('0x25')]);_0x4ea80a[_0xe3fb('0x1f')](_0x132cef['appdata']);break;default:_0x4ea80a=_[_0xe3fb('0xd')](_0x132cef['appdata'])?[]:_0x132cef[_0xe3fb('0x1d')][_0xe3fb('0x1e')](',');}var _0x39a021={'id':util[_0xe3fb('0x26')]('%s:%s:%s',_0x2f66d6,_0x132cef['id'],_0x132cef[_0xe3fb('0x1a')]),'condition':require(_0xe3fb('0x27'))[_0xe3fb('0x28')](_0x2f66d6,getIntervals(_0x209b36['intervals'],_0x132cef),_0x209b36),'consequence':require('./applications/'+_0x132cef[_0xe3fb('0x1a')])[_0xe3fb('0x29')](_0x2f66d6,_0x4ea80a,_0x209b36,_0x1025c4),'p':_0x132cef[_0xe3fb('0x2a')]||0x0};logger[_0xe3fb('0x2b')](_0xe3fb('0x2c'),_0x39a021['id'],'on\x20interval',getIntervals(_0x209b36['intervals'],_0x132cef)['join'](_0xe3fb('0x2d')));_0x58171e['push'](_0x39a021);}else{logger[_0xe3fb('0x2e')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xe3fb('0x21')](__dirname,_0xe3fb('0x16'),_0x132cef[_0xe3fb('0x1a')]+_0xe3fb('0x2f')));}}_0x209b36['rules'][_0x2f66d6]=new RuleEngine(_0x58171e);_0x209b36['rules'][_0x2f66d6][_0xe3fb('0x30')](_0x1025c4,function(_0x2a24fb){logger[_0xe3fb('0x2b')](_0xe3fb('0x31'),JSON[_0xe3fb('0x32')](_0x2a24fb[_0xe3fb('0x33')]));if(_0x209b36[_0xe3fb('0x34')][_0x2f66d6]){_0x209b36[_0xe3fb('0x34')][_0x2f66d6]['emit'](_0xe3fb('0x35'));}});return _0x29185f({'code':0xc8,'message':_0x1025c4});}else{logger[_0xe3fb('0x2b')](_0xe3fb('0x36'));return _0x29185f({'code':0xc8,'message':_0x1025c4});}}catch(_0x313265){logger[_0xe3fb('0x2e')](_0x313265[_0xe3fb('0x37')]);return _0x1bf2e4(_0x3ba0f3['error'](0x1f4,_0x313265));}}return _0x1bf2e4(_0xe3fb('0x38'));});},'AcceptMessage':function(_0x19e03f){var _0xc29c88=this;return new Promise(function(_0x320ecb,_0x37246e){if(_0x19e03f[_0xe3fb('0x14')]&&_0x19e03f[_0xe3fb('0x14')]['id']){try{var _0x26c406=getId(_0x19e03f[_0xe3fb('0x13')],_0x19e03f[_0xe3fb('0x14')]?_0x19e03f[_0xe3fb('0x14')]['id']:0x0,_0x19e03f[_0xe3fb('0x15')]?_0x19e03f[_0xe3fb('0x15')]['id']:0x0);if(_0x209b36[_0xe3fb('0x34')][_0x26c406]){_0x209b36[_0xe3fb('0x34')][_0x26c406][_0xe3fb('0x39')](_0xe3fb('0x35'));if(rpc[_0x19e03f['channel']+_0xe3fb('0x3a')]){rpc[_0x19e03f[_0xe3fb('0x13')]+_0xe3fb('0x3a')]['update'](_0x26c406,{'UserId':_0x19e03f['message']['UserId']})[_0xe3fb('0x3b')](function(_0x28bda3){logger['error'](_0xe3fb('0x3c'));});}}return _0x320ecb({'code':0xc8,'message':_0x19e03f});}catch(_0x4fee82){logger[_0xe3fb('0x2e')](_0x4fee82['stack']);return _0x37246e(_0xc29c88[_0xe3fb('0x2e')](0x1f4,_0x4fee82));}}logger['error'](_0xe3fb('0x3d'));return _0x37246e(_0xc29c88[_0xe3fb('0x2e')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x3a04f1){var _0x3b25fc=this;return new Promise(function(_0xc2cba3,_0x2196f7){if(_0x3a04f1[_0xe3fb('0x3e')]&&_0x3a04f1[_0xe3fb('0x3e')]['id']){try{if(_0x209b36[_0xe3fb('0x3f')][_0x3a04f1[_0xe3fb('0x3e')]['id']]){_0x209b36[_0xe3fb('0x3f')][_0x3a04f1['agent']['id']][_0xe3fb('0x40')]=![];_0x209b36[_0xe3fb('0x3f')][_0x3a04f1['agent']['id']]['busyQueue']=undefined;}return _0xc2cba3({'code':0xc8,'message':_0x3a04f1});}catch(_0x1a8343){logger['error'](_0x1a8343[_0xe3fb('0x37')]);return _0x2196f7(_0x3b25fc[_0xe3fb('0x2e')](0x1f4,_0x1a8343));}}logger[_0xe3fb('0x2e')](_0xe3fb('0x3d'));return _0x2196f7(_0x3b25fc[_0xe3fb('0x2e')](0x1f4,_0xe3fb('0x3d')));});},'AbandonInteraction':function(_0x260bcb){var _0x48d682=this;return new Promise(function(_0x30dc97,_0x5347f4){if(_0x260bcb['channel']&&_0x260bcb['interaction']&&_0x260bcb['interaction']['id']){try{var _0x15f210=getId(_0x260bcb[_0xe3fb('0x13')],_0x260bcb[_0xe3fb('0x14')]?_0x260bcb['message']['id']:0x0,_0x260bcb[_0xe3fb('0x15')]?_0x260bcb[_0xe3fb('0x15')]['id']:0x0);if(_0x209b36[_0xe3fb('0x34')][_0x15f210]){_0x209b36[_0xe3fb('0x34')][_0x15f210]['emit'](_0xe3fb('0x35'));}return _0x30dc97({'code':0xc8,'message':_0x260bcb});}catch(_0x2f509e){logger[_0xe3fb('0x2e')](_0x2f509e[_0xe3fb('0x37')]);return _0x5347f4(_0x48d682[_0xe3fb('0x2e')](0x1f4,_0x2f509e));}}logger[_0xe3fb('0x2e')](_0xe3fb('0x3d'));return _0x5347f4(_0x48d682[_0xe3fb('0x2e')](0x1f4,_0xe3fb('0x3d')));});},'AgentCapacity':function(_0x39bb5a){var _0x247049=this;return new Promise(function(_0x2f7767,_0x4342e0){if(_0x209b36['agents']['hasOwnProperty'](_0x39bb5a['id'])){for(var _0xa67cdd in _0x39bb5a[_0xe3fb('0x41')]){if(_0x39bb5a['capacity'][_0xe3fb('0x42')](_0xa67cdd)){if(_0x209b36[_0xe3fb('0x3f')][_0x39bb5a['id']][_0xe3fb('0x42')](_0xa67cdd+_0xe3fb('0x43'))){_0x209b36['agents'][_0x39bb5a['id']][_0xa67cdd+'CurrentCapacity']=parseInt(_0x39bb5a[_0xe3fb('0x41')][_0xa67cdd],0xa);}}}_0x209b36[_0xe3fb('0x3f')][_0x39bb5a['id']][_0xe3fb('0x44')]();return _0x2f7767({'code':0xc8,'message':_0x209b36['agents'][_0x39bb5a['id']]});}else{return _0x4342e0(_0x247049[_0xe3fb('0x2e')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x55d80e){return new Promise(function(_0x4f508c,_0x2fb8cf){var _0x27a746=_[_0xe3fb('0x45')](_0x209b36[_0xe3fb('0x3f')]);_0x4f508c({'count':_0x27a746[_0xe3fb('0x18')],'rows':_0x27a746});});},'ChatQueues':function(_0x5dfb8b){return new Promise(function(_0x19bbc7,_0x53fddf){var _0x638563=[];for(var _0x85233 in _0x209b36[_0xe3fb('0x46')]){if(_0x209b36[_0xe3fb('0x46')][_0xe3fb('0x42')](_0x85233)){var _0x5082f7=_0x209b36['chatQueues'][_0x85233];var _0x46b192={'id':_0x5082f7['id'],'available':_0x5082f7[_0xe3fb('0x47')],'loggedIn':_0x5082f7['loggedIn'],'name':_0x5082f7['name'],'paused':_0x5082f7[_0xe3fb('0x48')],'waiting':_0x5082f7[_0xe3fb('0x49')]};_0x638563[_0xe3fb('0x1f')](_0x46b192);}}_0x19bbc7({'count':_0x638563[_0xe3fb('0x18')],'rows':_0x638563});});},'MailQueues':function(_0x26db0a){return new Promise(function(_0xe47e99,_0x9d888c){var _0x8330d1=[];for(var _0x465f48 in _0x209b36[_0xe3fb('0x4a')]){if(_0x209b36[_0xe3fb('0x4a')]['hasOwnProperty'](_0x465f48)){var _0x3590c0=_0x209b36['mailQueues'][_0x465f48];var _0x6805a7={'id':_0x3590c0['id'],'available':_0x3590c0[_0xe3fb('0x47')],'loggedIn':_0x3590c0['loggedIn'],'name':_0x3590c0[_0xe3fb('0x4b')],'paused':_0x3590c0[_0xe3fb('0x48')],'waiting':_0x3590c0['waiting']};_0x8330d1[_0xe3fb('0x1f')](_0x6805a7);}}_0xe47e99({'count':_0x8330d1[_0xe3fb('0x18')],'rows':_0x8330d1});});},'OpenchannelQueues':function(_0x3963d0){return new Promise(function(_0x1a33a5,_0x5ad67f){var _0x4694ed=[];for(var _0x33e5ba in _0x209b36['openchannelQueues']){if(_0x209b36['openchannelQueues'][_0xe3fb('0x42')](_0x33e5ba)){var _0xec6b48=_0x209b36[_0xe3fb('0x4c')][_0x33e5ba];var _0x4e426a={'id':_0xec6b48['id'],'available':_0xec6b48[_0xe3fb('0x47')],'loggedIn':_0xec6b48['loggedIn'],'name':_0xec6b48['name'],'paused':_0xec6b48[_0xe3fb('0x48')],'waiting':_0xec6b48[_0xe3fb('0x49')]};_0x4694ed['push'](_0x4e426a);}}_0x1a33a5({'count':_0x4694ed[_0xe3fb('0x18')],'rows':_0x4694ed});});},'SmsQueues':function(_0x3a138a){return new Promise(function(_0xc7f1d9,_0x4b3491){var _0x405638=[];for(var _0x35ea05 in _0x209b36[_0xe3fb('0x4d')]){if(_0x209b36[_0xe3fb('0x4d')][_0xe3fb('0x42')](_0x35ea05)){var _0x42ed36=_0x209b36[_0xe3fb('0x4d')][_0x35ea05];var _0x2c9070={'id':_0x42ed36['id'],'available':_0x42ed36[_0xe3fb('0x47')],'loggedIn':_0x42ed36[_0xe3fb('0x4e')],'name':_0x42ed36[_0xe3fb('0x4b')],'paused':_0x42ed36[_0xe3fb('0x48')],'waiting':_0x42ed36[_0xe3fb('0x49')]};_0x405638['push'](_0x2c9070);}}_0xc7f1d9({'count':_0x405638[_0xe3fb('0x18')],'rows':_0x405638});});},'FaxQueues':function(_0x50829e){return new Promise(function(_0x418f9b,_0x1ea872){var _0x5a4bc6=[];for(var _0xfb3262 in _0x209b36[_0xe3fb('0x4f')]){if(_0x209b36[_0xe3fb('0x4f')][_0xe3fb('0x42')](_0xfb3262)){var _0x1f8033=_0x209b36[_0xe3fb('0x4f')][_0xfb3262];var _0x4429b3={'id':_0x1f8033['id'],'available':_0x1f8033['available'],'loggedIn':_0x1f8033[_0xe3fb('0x4e')],'name':_0x1f8033[_0xe3fb('0x4b')],'paused':_0x1f8033[_0xe3fb('0x48')],'waiting':_0x1f8033[_0xe3fb('0x49')]};_0x5a4bc6[_0xe3fb('0x1f')](_0x4429b3);}}_0x418f9b({'count':_0x5a4bc6[_0xe3fb('0x18')],'rows':_0x5a4bc6});});},'ChatQueuesWaitingInteractions':function(_0x23b1e6){return new Promise(function(_0x3f9385,_0x6200fc){var _0x5cf381=_[_0xe3fb('0x45')](_0x209b36[_0xe3fb('0x50')]);_0x3f9385({'count':_0x5cf381[_0xe3fb('0x18')],'rows':_0x5cf381});});},'MailQueuesWaitingInteractions':function(_0x57b91e){return new Promise(function(_0x5223d1,_0x9655cc){var _0x45226c=_[_0xe3fb('0x45')](_0x209b36[_0xe3fb('0x51')]);_0x5223d1({'count':_0x45226c[_0xe3fb('0x18')],'rows':_0x45226c});});},'OpenchannelQueuesWaitingInteractions':function(_0x44081d){return new Promise(function(_0x46b3a4,_0x243301){var _0x1f6f58=_[_0xe3fb('0x45')](_0x209b36[_0xe3fb('0x52')]);_0x46b3a4({'count':_0x1f6f58['length'],'rows':_0x1f6f58});});},'SmsQueuesWaitingInteractions':function(_0x40b1c6){return new Promise(function(_0x5cf9cf,_0x19707c){var _0x21be07=_['values'](_0x209b36[_0xe3fb('0x53')]);_0x5cf9cf({'count':_0x21be07[_0xe3fb('0x18')],'rows':_0x21be07});});},'FaxQueuesWaitingInteractions':function(_0x50f776){return new Promise(function(_0x13c636,_0x8af1b0){var _0x39b378=_[_0xe3fb('0x45')](_0x209b36[_0xe3fb('0x54')]);_0x13c636({'count':_0x39b378[_0xe3fb('0x18')],'rows':_0x39b378});});}};var _0x331860=jayson[_0xe3fb('0x55')](_0x5c772c)[_0xe3fb('0x56')]();_0x331860['on'](_0xe3fb('0x2e'),function(_0x2620df){logger[_0xe3fb('0x2e')](JSON[_0xe3fb('0x32')](_0x2620df));return _0x42871f(_0x2620df);});_0x331860['listen'](0x232c,'127.0.0.1',function(){console[_0xe3fb('0x57')](_0xe3fb('0x58'),0x232c);return _0x556cca(_0xe3fb('0x59')+0x232c);});});}; \ No newline at end of file +var _0x62e7=['map','interval','listen','rules','channel','message','interaction','applications','isArray','length','join','app','.js','appdata','split','push','slice','amazonlex','tag','TagId','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','stringify','matchPath','emit','No\x20applications\x20to\x20execute','routing\x20is\x20empty','end','QueueReport','UserId','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','agent','agents','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','hasOwnProperty','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals'];(function(_0x4bb581,_0x6f7037){var _0x316bf5=function(_0x1f6ed0){while(--_0x1f6ed0){_0x4bb581['push'](_0x4bb581['shift']());}};_0x316bf5(++_0x6f7037);}(_0x62e7,0xf5));var _0x762e=function(_0x179c78,_0x96fb6c){_0x179c78=_0x179c78-0x0;var _0x2ac793=_0x62e7[_0x179c78];return _0x2ac793;};'use strict';var _=require(_0x762e('0x0'));var util=require('util');var path=require(_0x762e('0x1'));var fs=require('fs');var jayson=require(_0x762e('0x2'));var BPromise=require('bluebird');var uuid=require(_0x762e('0x3'));var config=require(_0x762e('0x4'));var logger=require(_0x762e('0x5'))(_0x762e('0x6'));var rpc={'openchannelQueueReport':require(_0x762e('0x7'))};var rpc={'openchannelQueueReport':require(_0x762e('0x7')),'mailQueueReport':require(_0x762e('0x8')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x762e('0x9')),'faxQueueReport':require(_0x762e('0xa'))};var RuleEngine=require(_0x762e('0xb'));function getId(_0x1b71c6,_0x535e58,_0x1f32ae){return util['format'](_0x762e('0xc'),_0x1b71c6,_0x535e58||0x0,_0x1f32ae||0x0);}function getIntervals(_0x132dc2,_0x3f2414){var _0x53d7bf=[];if(!_[_0x762e('0xd')](_0x3f2414['IntervalId'])&&!_[_0x762e('0xd')](_0x132dc2[_0x3f2414[_0x762e('0xe')]])&&!_[_0x762e('0xd')](_0x132dc2[_0x3f2414[_0x762e('0xe')]][_0x762e('0xf')])){_0x53d7bf=_[_0x762e('0x10')](_0x132dc2[_0x3f2414['IntervalId']][_0x762e('0xf')],_0x762e('0x11'));}else if(!_[_0x762e('0xd')](_0x3f2414[_0x762e('0x11')])){_0x53d7bf=[_0x3f2414[_0x762e('0x11')]];}return _0x53d7bf;}exports[_0x762e('0x12')]=function(_0x4bd12a){_0x4bd12a[_0x762e('0x13')]={};return new BPromise(function(_0x508328,_0x1700bf){var _0x168b5d={'Start':function(_0x48ae66){var _0x4b6b7b=this;return new Promise(function(_0x7e535e,_0x3468cd){if(_0x48ae66){try{var _0x391da0=[];var _0x4abcbd=getId(_0x48ae66[_0x762e('0x14')],_0x48ae66[_0x762e('0x15')]?_0x48ae66[_0x762e('0x15')]['id']:0x0,_0x48ae66['interaction']?_0x48ae66[_0x762e('0x16')]['id']:0x0);if(_0x48ae66[_0x762e('0x17')]&&_[_0x762e('0x18')](_0x48ae66[_0x762e('0x17')])&&_0x48ae66[_0x762e('0x17')][_0x762e('0x19')]){for(var _0x54904e=0x0;_0x54904e<_0x48ae66[_0x762e('0x17')][_0x762e('0x19')];_0x54904e+=0x1){var _0x2b387=_0x48ae66['applications'][_0x54904e];if(fs['existsSync'](path[_0x762e('0x1a')](__dirname,_0x762e('0x17'),_0x2b387[_0x762e('0x1b')]+_0x762e('0x1c')))){var _0x145d02=[];switch(_0x2b387[_0x762e('0x1b')]['toLowerCase']()){case'autoreply':var _0x3d12cd=_0x2b387[_0x762e('0x1d')][_0x762e('0x1e')](',');_0x145d02[_0x762e('0x1f')](_0x3d12cd[0x0]);_0x145d02[_0x762e('0x1f')](_0x3d12cd[_0x762e('0x20')](0x1,_0x3d12cd[_0x762e('0x19')])[_0x762e('0x1a')](','));break;case'dialogflow':var _0x3d12cd=_0x2b387['appdata']['split'](',');_0x145d02[_0x762e('0x1f')](_0x3d12cd[0x0]);_0x145d02[_0x762e('0x1f')](_0x3d12cd[0x1]);_0x145d02[_0x762e('0x1f')](_0x3d12cd[_0x762e('0x20')](0x2,_0x3d12cd[_0x762e('0x19')])[_0x762e('0x1a')](','));break;case _0x762e('0x21'):var _0x3d12cd=_0x2b387[_0x762e('0x1d')][_0x762e('0x1e')](',');_0x145d02[_0x762e('0x1f')](_0x3d12cd[0x0]);_0x145d02[_0x762e('0x1f')](_0x3d12cd[0x1]);_0x145d02['push'](_0x3d12cd[0x2]);_0x145d02[_0x762e('0x1f')](_0x3d12cd[0x3]);_0x145d02[_0x762e('0x1f')](_0x3d12cd[_0x762e('0x20')](0x4,_0x3d12cd[_0x762e('0x19')])[_0x762e('0x1a')](','));break;case'message':_0x145d02[_0x762e('0x1f')](_0x2b387['appdata']);break;case _0x762e('0x22'):_0x145d02['push'](_0x2b387[_0x762e('0x23')]);_0x145d02[_0x762e('0x1f')](_0x2b387[_0x762e('0x1d')]);break;default:_0x145d02=_[_0x762e('0xd')](_0x2b387[_0x762e('0x1d')])?[]:_0x2b387['appdata'][_0x762e('0x1e')](',');}var _0x1b7e28={'id':util['format']('%s:%s:%s',_0x4abcbd,_0x2b387['id'],_0x2b387[_0x762e('0x1b')]),'condition':require(_0x762e('0x24'))[_0x762e('0x25')](_0x4abcbd,getIntervals(_0x4bd12a[_0x762e('0x26')],_0x2b387),_0x4bd12a),'consequence':require(_0x762e('0x27')+_0x2b387['app'])[_0x762e('0x28')](_0x4abcbd,_0x145d02,_0x4bd12a,_0x48ae66),'p':_0x2b387[_0x762e('0x29')]||0x0};logger[_0x762e('0x2a')](_0x762e('0x2b'),_0x1b7e28['id'],_0x762e('0x2c'),getIntervals(_0x4bd12a[_0x762e('0x26')],_0x2b387)[_0x762e('0x1a')](_0x762e('0x2d')));_0x391da0[_0x762e('0x1f')](_0x1b7e28);}else{logger[_0x762e('0x2e')](_0x762e('0x2f'),path['join'](__dirname,_0x762e('0x17'),_0x2b387[_0x762e('0x1b')]+_0x762e('0x1c')));}}_0x4bd12a[_0x762e('0x13')][_0x4abcbd]=new RuleEngine(_0x391da0);_0x4bd12a[_0x762e('0x13')][_0x4abcbd]['execute'](_0x48ae66,function(_0x39a8bb){logger[_0x762e('0x2a')](_0x762e('0x30'),JSON[_0x762e('0x31')](_0x39a8bb[_0x762e('0x32')]));if(_0x4bd12a['rules'][_0x4abcbd]){_0x4bd12a[_0x762e('0x13')][_0x4abcbd][_0x762e('0x33')]('end');}});return _0x7e535e({'code':0xc8,'message':_0x48ae66});}else{logger[_0x762e('0x2a')](_0x762e('0x34'));return _0x7e535e({'code':0xc8,'message':_0x48ae66});}}catch(_0x32f75b){logger[_0x762e('0x2e')](_0x32f75b['stack']);return _0x3468cd(_0x4b6b7b[_0x762e('0x2e')](0x1f4,_0x32f75b));}}return _0x3468cd(_0x762e('0x35'));});},'AcceptMessage':function(_0x2f7860){var _0x2a4148=this;return new Promise(function(_0x1af6df,_0x3fedf6){if(_0x2f7860[_0x762e('0x15')]&&_0x2f7860['message']['id']){try{var _0x3c7295=getId(_0x2f7860[_0x762e('0x14')],_0x2f7860[_0x762e('0x15')]?_0x2f7860['message']['id']:0x0,_0x2f7860[_0x762e('0x16')]?_0x2f7860[_0x762e('0x16')]['id']:0x0);if(_0x4bd12a[_0x762e('0x13')][_0x3c7295]){_0x4bd12a[_0x762e('0x13')][_0x3c7295]['emit'](_0x762e('0x36'));if(rpc[_0x2f7860[_0x762e('0x14')]+_0x762e('0x37')]){rpc[_0x2f7860[_0x762e('0x14')]+_0x762e('0x37')]['update'](_0x3c7295,{'UserId':_0x2f7860['message'][_0x762e('0x38')]})['catch'](function(_0x36a3d5){logger['error'](_0x762e('0x39'));});}}return _0x1af6df({'code':0xc8,'message':_0x2f7860});}catch(_0x36b09e){logger['error'](_0x36b09e[_0x762e('0x3a')]);return _0x3fedf6(_0x2a4148[_0x762e('0x2e')](0x1f4,_0x36b09e));}}logger[_0x762e('0x2e')](_0x762e('0x3b'));return _0x3fedf6(_0x2a4148[_0x762e('0x2e')](0x1f4,_0x762e('0x3b')));});},'RejectMessage':function(_0x401d9f){var _0x394c45=this;return new Promise(function(_0x5971c2,_0x363b3c){if(_0x401d9f[_0x762e('0x3c')]&&_0x401d9f['agent']['id']){try{if(_0x4bd12a[_0x762e('0x3d')][_0x401d9f[_0x762e('0x3c')]['id']]){_0x4bd12a[_0x762e('0x3d')][_0x401d9f[_0x762e('0x3c')]['id']]['busy']=![];_0x4bd12a[_0x762e('0x3d')][_0x401d9f[_0x762e('0x3c')]['id']]['busyQueue']=undefined;}return _0x5971c2({'code':0xc8,'message':_0x401d9f});}catch(_0x14df05){logger[_0x762e('0x2e')](_0x14df05[_0x762e('0x3a')]);return _0x363b3c(_0x394c45['error'](0x1f4,_0x14df05));}}logger[_0x762e('0x2e')](_0x762e('0x3b'));return _0x363b3c(_0x394c45[_0x762e('0x2e')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x757e22){var _0x434fff=this;return new Promise(function(_0x4ace03,_0x164765){if(_0x757e22[_0x762e('0x14')]&&_0x757e22[_0x762e('0x16')]&&_0x757e22[_0x762e('0x16')]['id']){try{var _0x5c430d=getId(_0x757e22[_0x762e('0x14')],_0x757e22[_0x762e('0x15')]?_0x757e22[_0x762e('0x15')]['id']:0x0,_0x757e22['interaction']?_0x757e22['interaction']['id']:0x0);if(_0x4bd12a[_0x762e('0x13')][_0x5c430d]){_0x4bd12a[_0x762e('0x13')][_0x5c430d][_0x762e('0x33')]('end');}return _0x4ace03({'code':0xc8,'message':_0x757e22});}catch(_0x297acf){logger[_0x762e('0x2e')](_0x297acf[_0x762e('0x3a')]);return _0x164765(_0x434fff[_0x762e('0x2e')](0x1f4,_0x297acf));}}logger[_0x762e('0x2e')](_0x762e('0x3b'));return _0x164765(_0x434fff[_0x762e('0x2e')](0x1f4,_0x762e('0x3b')));});},'AgentCapacity':function(_0x2979b0){var _0x39b936=this;return new Promise(function(_0x4198a1,_0x2c3277){if(_0x4bd12a[_0x762e('0x3d')]['hasOwnProperty'](_0x2979b0['id'])){for(var _0x29eae7 in _0x2979b0[_0x762e('0x3e')]){if(_0x2979b0[_0x762e('0x3e')]['hasOwnProperty'](_0x29eae7)){if(_0x4bd12a[_0x762e('0x3d')][_0x2979b0['id']]['hasOwnProperty'](_0x29eae7+'CurrentCapacity')){_0x4bd12a[_0x762e('0x3d')][_0x2979b0['id']][_0x29eae7+_0x762e('0x3f')]=parseInt(_0x2979b0[_0x762e('0x3e')][_0x29eae7],0xa);}}}_0x4bd12a[_0x762e('0x3d')][_0x2979b0['id']][_0x762e('0x40')]();return _0x4198a1({'code':0xc8,'message':_0x4bd12a[_0x762e('0x3d')][_0x2979b0['id']]});}else{return _0x2c3277(_0x39b936[_0x762e('0x2e')](0x1f4,_0x762e('0x41')));}});},'Agents':function(_0xdbdd6){return new Promise(function(_0x45ca0f,_0x476e44){var _0x189b31=_[_0x762e('0x42')](_0x4bd12a['agents']);_0x45ca0f({'count':_0x189b31[_0x762e('0x19')],'rows':_0x189b31});});},'ChatQueues':function(_0x59a1e0){return new Promise(function(_0x48a094,_0xc99de7){var _0x35d667=[];for(var _0x594d27 in _0x4bd12a[_0x762e('0x43')]){if(_0x4bd12a[_0x762e('0x43')][_0x762e('0x44')](_0x594d27)){var _0x323077=_0x4bd12a[_0x762e('0x43')][_0x594d27];var _0x4c4b2e={'id':_0x323077['id'],'available':_0x323077[_0x762e('0x45')],'loggedIn':_0x323077[_0x762e('0x46')],'name':_0x323077[_0x762e('0x47')],'paused':_0x323077[_0x762e('0x48')],'waiting':_0x323077[_0x762e('0x49')]};_0x35d667[_0x762e('0x1f')](_0x4c4b2e);}}_0x48a094({'count':_0x35d667[_0x762e('0x19')],'rows':_0x35d667});});},'MailQueues':function(_0x28619d){return new Promise(function(_0x4c77ee,_0x5c7890){var _0x13b286=[];for(var _0x227142 in _0x4bd12a[_0x762e('0x4a')]){if(_0x4bd12a[_0x762e('0x4a')][_0x762e('0x44')](_0x227142)){var _0x26a018=_0x4bd12a[_0x762e('0x4a')][_0x227142];var _0x2c6b3c={'id':_0x26a018['id'],'available':_0x26a018['available'],'loggedIn':_0x26a018['loggedIn'],'name':_0x26a018[_0x762e('0x47')],'paused':_0x26a018[_0x762e('0x48')],'waiting':_0x26a018[_0x762e('0x49')]};_0x13b286[_0x762e('0x1f')](_0x2c6b3c);}}_0x4c77ee({'count':_0x13b286[_0x762e('0x19')],'rows':_0x13b286});});},'OpenchannelQueues':function(_0x5e9549){return new Promise(function(_0x4f4e39,_0x167115){var _0x2f6daa=[];for(var _0x3d136b in _0x4bd12a[_0x762e('0x4b')]){if(_0x4bd12a[_0x762e('0x4b')]['hasOwnProperty'](_0x3d136b)){var _0x1a1983=_0x4bd12a[_0x762e('0x4b')][_0x3d136b];var _0x480fff={'id':_0x1a1983['id'],'available':_0x1a1983[_0x762e('0x45')],'loggedIn':_0x1a1983[_0x762e('0x46')],'name':_0x1a1983[_0x762e('0x47')],'paused':_0x1a1983[_0x762e('0x48')],'waiting':_0x1a1983['waiting']};_0x2f6daa[_0x762e('0x1f')](_0x480fff);}}_0x4f4e39({'count':_0x2f6daa[_0x762e('0x19')],'rows':_0x2f6daa});});},'SmsQueues':function(_0x1ff5e9){return new Promise(function(_0x5484ad,_0x29d9e1){var _0x341c9e=[];for(var _0x1cbf64 in _0x4bd12a['smsQueues']){if(_0x4bd12a['smsQueues']['hasOwnProperty'](_0x1cbf64)){var _0x4b8726=_0x4bd12a[_0x762e('0x4c')][_0x1cbf64];var _0x2a7c57={'id':_0x4b8726['id'],'available':_0x4b8726['available'],'loggedIn':_0x4b8726[_0x762e('0x46')],'name':_0x4b8726[_0x762e('0x47')],'paused':_0x4b8726[_0x762e('0x48')],'waiting':_0x4b8726['waiting']};_0x341c9e[_0x762e('0x1f')](_0x2a7c57);}}_0x5484ad({'count':_0x341c9e[_0x762e('0x19')],'rows':_0x341c9e});});},'FaxQueues':function(_0x1d6b01){return new Promise(function(_0x516b3e,_0x5141ad){var _0x5e8aa5=[];for(var _0x56190f in _0x4bd12a['faxQueues']){if(_0x4bd12a[_0x762e('0x4d')][_0x762e('0x44')](_0x56190f)){var _0x564644=_0x4bd12a[_0x762e('0x4d')][_0x56190f];var _0x232324={'id':_0x564644['id'],'available':_0x564644[_0x762e('0x45')],'loggedIn':_0x564644[_0x762e('0x46')],'name':_0x564644[_0x762e('0x47')],'paused':_0x564644['paused'],'waiting':_0x564644[_0x762e('0x49')]};_0x5e8aa5[_0x762e('0x1f')](_0x232324);}}_0x516b3e({'count':_0x5e8aa5[_0x762e('0x19')],'rows':_0x5e8aa5});});},'ChatQueuesWaitingInteractions':function(_0x503e66){return new Promise(function(_0x4a8d1a,_0x523894){var _0x4ada5e=_[_0x762e('0x42')](_0x4bd12a['chatQueuesWaitingInteractions']);_0x4a8d1a({'count':_0x4ada5e[_0x762e('0x19')],'rows':_0x4ada5e});});},'MailQueuesWaitingInteractions':function(_0x47ee08){return new Promise(function(_0x26c2b9,_0x4f0378){var _0xc86ddf=_[_0x762e('0x42')](_0x4bd12a['mailQueuesWaitingInteractions']);_0x26c2b9({'count':_0xc86ddf[_0x762e('0x19')],'rows':_0xc86ddf});});},'OpenchannelQueuesWaitingInteractions':function(_0x51d87d){return new Promise(function(_0x3f4066,_0xf19f76){var _0x504056=_['values'](_0x4bd12a[_0x762e('0x4e')]);_0x3f4066({'count':_0x504056[_0x762e('0x19')],'rows':_0x504056});});},'SmsQueuesWaitingInteractions':function(_0x3b6322){return new Promise(function(_0x5e77fb,_0x5e01da){var _0x4d291e=_[_0x762e('0x42')](_0x4bd12a[_0x762e('0x4f')]);_0x5e77fb({'count':_0x4d291e[_0x762e('0x19')],'rows':_0x4d291e});});},'FaxQueuesWaitingInteractions':function(_0x558f08){return new Promise(function(_0x41cc39,_0x4277ea){var _0x4739ef=_[_0x762e('0x42')](_0x4bd12a[_0x762e('0x50')]);_0x41cc39({'count':_0x4739ef[_0x762e('0x19')],'rows':_0x4739ef});});}};var _0x42ba83=jayson[_0x762e('0x51')](_0x168b5d)[_0x762e('0x52')]();_0x42ba83['on'](_0x762e('0x2e'),function(_0x4cf704){logger[_0x762e('0x2e')](JSON[_0x762e('0x31')](_0x4cf704));return _0x1700bf(_0x4cf704);});_0x42ba83[_0x762e('0x12')](0x232c,_0x762e('0x53'),function(){console[_0x762e('0x54')](_0x762e('0x55'),0x232c);return _0x508328(_0x762e('0x56')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index f4d4682..d1da092 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 _0xeb3d=['some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','http','request','then','error','message','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','format','indexOf','all'];(function(_0x3ce2c4,_0x4544c1){var _0x4047c1=function(_0x3fece6){while(--_0x3fece6){_0x3ce2c4['push'](_0x3ce2c4['shift']());}};_0x4047c1(++_0x4544c1);}(_0xeb3d,0x71));var _0xdeb3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeb3d[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xdeb3('0x0'));var BPromise=require(_0xdeb3('0x1'));var jayson=require(_0xdeb3('0x2'));var _=require(_0xdeb3('0x3'));var logger=require(_0xdeb3('0x4'))(_0xdeb3('0x5'));var client=jayson['client'][_0xdeb3('0x6')]({'port':0x232a});function request(_0x186230,_0x3fe8d0){return new BPromise(function(_0x5196a6,_0x31d233){return client[_0xdeb3('0x7')](_0x186230,_0x3fe8d0)[_0xdeb3('0x8')](function(_0x236a76){if(_0x236a76[_0xdeb3('0x9')]){return _0x31d233(_0x236a76['error'][_0xdeb3('0xa')]);}else{return _0x5196a6(_0x236a76[_0xdeb3('0xb')]);}})[_0xdeb3('0xc')](function(_0x412687){return _0x31d233(_0x412687);});});}exports[_0xdeb3('0xd')]=function(_0x207121,_0x557d8c,_0x31d8bb){return function(_0x58cdae){if(_0x31d8bb[_0xdeb3('0xe')]&&!_0x31d8bb[_0xdeb3('0xe')][_0x207121]){logger['info'](_0xdeb3('0xf'),_0x207121);return _0x58cdae[_0xdeb3('0x10')]();}var _0x54a1a3=[];for(var _0x5982ba=0x0;_0x5982ba<_0x557d8c[_0xdeb3('0x11')];_0x5982ba+=0x1){_0x54a1a3[_0xdeb3('0x12')](request('Command',{'command':util[_0xdeb3('0x13')]('iftime\x20%s',_0x557d8c[_0x5982ba])})['then'](function(_0x44efd9){return _0x44efd9&&_0x44efd9['message']&&_0x44efd9[_0xdeb3('0xa')][_0xdeb3('0x14')]('true')>=0x0?!![]:![];})[_0xdeb3('0xc')](function(_0x23cf9a){logger[_0xdeb3('0x9')]('[%s][INTERVAL]\x20%s',_0x207121,_0x557d8c[_0x5982ba]);}));}BPromise[_0xdeb3('0x15')](_0x54a1a3)[_0xdeb3('0x8')](function(_0x1695fd){var _0x25f823=_[_0xdeb3('0x16')](_0x1695fd);logger['info'](_0xdeb3('0x17'),_0x207121,_0x557d8c[_0xdeb3('0x18')](_0xdeb3('0x19')),_0x25f823);_0x58cdae['when'](_0x25f823);})[_0xdeb3('0xc')](function(_0x20a9be){console[_0xdeb3('0x1a')](_0x20a9be);logger[_0xdeb3('0x9')]('[%s][INTERVAL]\x20%s\x20%s',_0x207121,_0x557d8c['join'](_0xdeb3('0x19')),_0x20a9be['stack']);_0x58cdae['stop']();});};}; \ No newline at end of file +var _0x46cc=['../../../config/logger','routing','client','http','error','message','result','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','format','indexOf','true','catch','all','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','stack','stop','util'];(function(_0x21dd4e,_0x3270cd){var _0x3d7fe9=function(_0x2f59b2){while(--_0x2f59b2){_0x21dd4e['push'](_0x21dd4e['shift']());}};_0x3d7fe9(++_0x3270cd);}(_0x46cc,0x11d));var _0xc46c=function(_0x526bbe,_0x4b63a2){_0x526bbe=_0x526bbe-0x0;var _0x5c74fc=_0x46cc[_0x526bbe];return _0x5c74fc;};'use strict';var util=require(_0xc46c('0x0'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var _=require('lodash');var logger=require(_0xc46c('0x1'))(_0xc46c('0x2'));var client=jayson[_0xc46c('0x3')][_0xc46c('0x4')]({'port':0x232a});function request(_0x30ef41,_0x180af9){return new BPromise(function(_0x4c0023,_0x5a60e4){return client['request'](_0x30ef41,_0x180af9)['then'](function(_0x5ef48d){if(_0x5ef48d['error']){return _0x5a60e4(_0x5ef48d[_0xc46c('0x5')][_0xc46c('0x6')]);}else{return _0x4c0023(_0x5ef48d[_0xc46c('0x7')]);}})['catch'](function(_0x1f791e){return _0x5a60e4(_0x1f791e);});});}exports['condition']=function(_0xf7a1ae,_0x395eb2,_0x2835b3){return function(_0x5e26c1){if(_0x2835b3[_0xc46c('0x8')]&&!_0x2835b3[_0xc46c('0x8')][_0xf7a1ae]){logger[_0xc46c('0x9')](_0xc46c('0xa'),_0xf7a1ae);return _0x5e26c1['stop']();}var _0xdabc46=[];for(var _0x37c64a=0x0;_0x37c64a<_0x395eb2[_0xc46c('0xb')];_0x37c64a+=0x1){_0xdabc46[_0xc46c('0xc')](request('Command',{'command':util[_0xc46c('0xd')]('iftime\x20%s',_0x395eb2[_0x37c64a])})['then'](function(_0x39f7c5){return _0x39f7c5&&_0x39f7c5[_0xc46c('0x6')]&&_0x39f7c5[_0xc46c('0x6')][_0xc46c('0xe')](_0xc46c('0xf'))>=0x0?!![]:![];})[_0xc46c('0x10')](function(_0x157491){logger[_0xc46c('0x5')]('[%s][INTERVAL]\x20%s',_0xf7a1ae,_0x395eb2[_0x37c64a]);}));}BPromise[_0xc46c('0x11')](_0xdabc46)['then'](function(_0x4a1062){var _0x5c2387=_['some'](_0x4a1062);logger[_0xc46c('0x9')](_0xc46c('0x12'),_0xf7a1ae,_0x395eb2['join'](_0xc46c('0x13')),_0x5c2387);_0x5e26c1['when'](_0x5c2387);})[_0xc46c('0x10')](function(_0x54a991){console['log'](_0x54a991);logger['error'](_0xc46c('0x12'),_0xf7a1ae,_0x395eb2['join'](_0xc46c('0x13')),_0x54a991[_0xc46c('0x14')]);_0x5e26c1[_0xc46c('0x15')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 2065779..9a8d1a5 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 _0x2031=['agentacw','acw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','agentcalledAt','now','lastevent','connectedlinename','error','stack','agentringnoanswer','isNil','agentringnoanswerAt','rejected','holdtime','ringtime','queuecallerabandon','forIn','abandoned','reason','talktime','agentconnect','connect','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','diffTime','agentcompleteAt','blindtransfer','transfereruniqueid','transfer','blind','transferexten','origtransfererlinkedid','secondtransfereruniqueid','transfertype','origtransfereruniqueid','transfereeuniqueid','agententerreason','clone','calleridname','ATTENDED','transferuniqueid','transfertargetuniqueid','agentconnectAt','hangup','agent','complete','util','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','interface','calleridnum','connectedlinenum','then','type'];(function(_0x69e89e,_0x1fb302){var _0x39b87d=function(_0x45f224){while(--_0x45f224){_0x69e89e['push'](_0x69e89e['shift']());}};_0x39b87d(++_0x1fb302);}(_0x2031,0x16e));var _0x1203=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2031[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x1203('0x0'));var utils=require('./utils');var agents={};var transfers={};function writeDB(_0x442072,_0x2c6f14){utils[_0x1203('0x1')](util[_0x1203('0x2')](_0x1203('0x3'),_0x442072[_0x1203('0x4')],_0x442072[_0x1203('0x5')],_0x442072[_0x1203('0x6')],_0x442072['membername'],_0x442072[_0x1203('0x7')],_0x442072[_0x1203('0x8')],_0x442072[_0x1203('0x9')],_0x442072['lastevent']));if(_0x442072[_0x1203('0x6')]){utils['getVoiceQueueByName'](_0x442072[_0x1203('0x6')])[_0x1203('0xa')](function(_0x3f267e){if(_0x3f267e){_0x442072[_0x1203('0xb')]=_0x3f267e[_0x1203('0xb')];_0x442072[_0x1203('0xc')]=_0x442072['agentcomplete']?_0x3f267e[_0x1203('0xd')]:![];_0x442072['acwtime']=_0x442072[_0x1203('0xc')]?_0x3f267e[_0x1203('0xe')]:0x0;}utils[_0x1203('0xf')](_0x1203('0x10'),_0x442072);});}else{utils['request']('CreateVoiceAgentReport',_0x442072);}if(_0x2c6f14){delete transfers[_0x442072['uniqueid']];}else{delete agents[_0x442072[_0x1203('0x11')]];}}exports[_0x1203('0x12')]=function(_0x4782b5){try{agents[_0x4782b5[_0x1203('0x11')]]=_0x4782b5;agents[_0x4782b5['destuniqueid']][_0x1203('0x13')]=utils[_0x1203('0x14')]();agents[_0x4782b5[_0x1203('0x11')]][_0x1203('0x15')]='called';agents[_0x4782b5[_0x1203('0x11')]]['connectedlinenum']=null;agents[_0x4782b5[_0x1203('0x11')]][_0x1203('0x16')]=null;}catch(_0x165367){utils[_0x1203('0x17')](_0x165367[_0x1203('0x18')]);}};exports[_0x1203('0x19')]=function(_0xd1a918){try{if(!_[_0x1203('0x1a')](agents[_0xd1a918[_0x1203('0x11')]])){agents[_0xd1a918[_0x1203('0x11')]][_0x1203('0x19')]=!![];agents[_0xd1a918[_0x1203('0x11')]][_0x1203('0x1b')]=utils[_0x1203('0x14')]();agents[_0xd1a918['destuniqueid']][_0x1203('0x15')]=_0x1203('0x1c');agents[_0xd1a918[_0x1203('0x11')]]['reason']=_0x1203('0x1c');agents[_0xd1a918['destuniqueid']][_0x1203('0x1d')]=_0xd1a918['ringtime']?parseInt(_0xd1a918[_0x1203('0x1e')])/0x3e8:0x0;agents[_0xd1a918[_0x1203('0x11')]]['talktime']=0x0;writeDB(agents[_0xd1a918[_0x1203('0x11')]]);}}catch(_0x1e0d63){utils[_0x1203('0x17')](_0x1e0d63[_0x1203('0x18')]);}};exports[_0x1203('0x1f')]=function(_0x5660b0){try{_[_0x1203('0x20')](agents,function(_0x39fcfb,_0xf5d9fb){if(_0x39fcfb[_0x1203('0x4')]==_0x5660b0[_0x1203('0x4')]){_0x39fcfb[_0x1203('0x19')]=!![];_0x39fcfb[_0x1203('0x1b')]=utils[_0x1203('0x14')]();_0x39fcfb['lastevent']=_0x1203('0x21');_0x39fcfb[_0x1203('0x22')]=_0x1203('0x21');_0x39fcfb[_0x1203('0x1d')]=_0x5660b0[_0x1203('0x1d')];_0x39fcfb[_0x1203('0x23')]=0x0;writeDB(_0x39fcfb);}});}catch(_0x4bcdce){utils[_0x1203('0x17')](_0x4bcdce[_0x1203('0x18')]);}};exports[_0x1203('0x24')]=function(_0x4ae6b8){try{if(agents[_0x4ae6b8['destuniqueid']]){agents[_0x4ae6b8[_0x1203('0x11')]]['agentconnectAt']=utils[_0x1203('0x14')]();agents[_0x4ae6b8['destuniqueid']][_0x1203('0x9')]=_0x4ae6b8[_0x1203('0x9')];agents[_0x4ae6b8[_0x1203('0x11')]]['connectedlinename']=_0x4ae6b8[_0x1203('0x16')];agents[_0x4ae6b8[_0x1203('0x11')]][_0x1203('0x1d')]=_0x4ae6b8['ringtime'];agents[_0x4ae6b8[_0x1203('0x11')]][_0x1203('0x15')]=_0x1203('0x25');_[_0x1203('0x20')](agents,function(_0x1cd27c,_0x542ea4){if(_0x1cd27c[_0x1203('0x11')]!=_0x4ae6b8[_0x1203('0x11')]&&_0x1cd27c[_0x1203('0x4')]==_0x4ae6b8[_0x1203('0x4')]){_0x1cd27c['talktime']=0x0;_0x1cd27c[_0x1203('0x1d')]=_0x4ae6b8[_0x1203('0x1e')];_0x1cd27c[_0x1203('0x19')]=!![];_0x1cd27c[_0x1203('0x1b')]=utils[_0x1203('0x14')]();_0x1cd27c[_0x1203('0x15')]='answered_elsewhere';_0x1cd27c['reason']='answered_elsewhere';_0x1cd27c[_0x1203('0x26')]=_0x4ae6b8[_0x1203('0x11')];_0x1cd27c[_0x1203('0x27')]=_0x4ae6b8['membername'];writeDB(_0x1cd27c);}});}}catch(_0x3b19fc){utils[_0x1203('0x17')](_0x3b19fc[_0x1203('0x18')]);}};exports[_0x1203('0x28')]=function(_0x2b6dd6){try{if(!_[_0x1203('0x1a')](agents[_0x2b6dd6['destuniqueid']])){agents[_0x2b6dd6[_0x1203('0x11')]][_0x1203('0x28')]=!![];agents[_0x2b6dd6[_0x1203('0x11')]]['agentcompleteAt']=utils[_0x1203('0x14')]();agents[_0x2b6dd6[_0x1203('0x11')]][_0x1203('0x23')]=utils[_0x1203('0x29')](agents[_0x2b6dd6[_0x1203('0x11')]][_0x1203('0x2a')],agents[_0x2b6dd6[_0x1203('0x11')]]['agentconnectAt']);agents[_0x2b6dd6[_0x1203('0x11')]][_0x1203('0x22')]=_0x2b6dd6[_0x1203('0x22')];agents[_0x2b6dd6[_0x1203('0x11')]][_0x1203('0x15')]='complete';writeDB(agents[_0x2b6dd6[_0x1203('0x11')]]);}}catch(_0x572245){utils[_0x1203('0x17')](_0x572245[_0x1203('0x18')]);}};exports[_0x1203('0x2b')]=function(_0x45787e){try{if(!_[_0x1203('0x1a')](agents[_0x45787e[_0x1203('0x2c')]])){agents[_0x45787e['transfereruniqueid']][_0x1203('0x2d')]=!![];agents[_0x45787e[_0x1203('0x2c')]]['transfertype']=_0x1203('0x2e');agents[_0x45787e['transfereruniqueid']][_0x1203('0x2f')]=_0x45787e['extension'];agents[_0x45787e[_0x1203('0x2c')]]['transferuniqueid']=agents[_0x45787e['transfereruniqueid']][_0x1203('0x4')];}}catch(_0x4babb9){utils[_0x1203('0x17')](_0x4babb9['stack']);}};exports['attendedtransfer']=function(_0x517775){try{if(_0x517775['origtransfereruniqueid']==_0x517775[_0x1203('0x30')]){if(!_[_0x1203('0x1a')](agents[_0x517775[_0x1203('0x31')]])){agents[_0x517775['secondtransfereruniqueid']]['transfer']=!![];agents[_0x517775['secondtransfereruniqueid']][_0x1203('0x32')]='ATTENDED';agents[_0x517775[_0x1203('0x31')]]['transferexten']=_0x517775['origtransfererexten'];agents[_0x517775['secondtransfereruniqueid']]['transferuniqueid']=_0x517775[_0x1203('0x33')];}if(_0x517775['transfereeuniqueid']&&agents[_0x517775[_0x1203('0x34')]]){agents[_0x517775['transfereeuniqueid']][_0x1203('0x35')]=0x1;transfers[_0x517775[_0x1203('0x34')]]=_[_0x1203('0x36')](agents[_0x517775[_0x1203('0x34')]]);transfers[_0x517775[_0x1203('0x34')]][_0x1203('0x8')]=agents[_0x517775['secondtransfereruniqueid']][_0x1203('0x8')];transfers[_0x517775[_0x1203('0x34')]][_0x1203('0x37')]=agents[_0x517775[_0x1203('0x31')]][_0x1203('0x37')];transfers[_0x517775[_0x1203('0x34')]]['agentcalledAt']=utils['now']();transfers[_0x517775[_0x1203('0x34')]]['agentconnectAt']=utils['now']();transfers[_0x517775[_0x1203('0x34')]][_0x1203('0x1d')]=0x0;transfers[_0x517775[_0x1203('0x34')]][_0x1203('0x35')]=0x2;}}else if(_0x517775[_0x1203('0x31')]==_0x517775['secondtransfererlinkedid']){if(!_[_0x1203('0x1a')](agents[_0x517775[_0x1203('0x33')]])){agents[_0x517775[_0x1203('0x33')]][_0x1203('0x2d')]=!![];agents[_0x517775[_0x1203('0x33')]][_0x1203('0x32')]=_0x1203('0x38');agents[_0x517775[_0x1203('0x33')]][_0x1203('0x2f')]=_0x517775['secondtransfererexten'];agents[_0x517775[_0x1203('0x33')]][_0x1203('0x39')]=_0x517775[_0x1203('0x31')];}if(_0x517775['transfertargetuniqueid']&&agents[_0x517775[_0x1203('0x3a')]]){agents[_0x517775[_0x1203('0x3a')]][_0x1203('0x35')]=0x1;transfers[_0x517775[_0x1203('0x3a')]]=_['clone'](agents[_0x517775[_0x1203('0x3a')]]);transfers[_0x517775[_0x1203('0x3a')]][_0x1203('0x8')]=agents[_0x517775[_0x1203('0x33')]][_0x1203('0x8')];transfers[_0x517775[_0x1203('0x3a')]][_0x1203('0x37')]=agents[_0x517775[_0x1203('0x33')]][_0x1203('0x37')];transfers[_0x517775[_0x1203('0x3a')]][_0x1203('0x13')]=utils[_0x1203('0x14')]();transfers[_0x517775['transfertargetuniqueid']][_0x1203('0x3b')]=utils[_0x1203('0x14')]();transfers[_0x517775[_0x1203('0x3a')]][_0x1203('0x1d')]=0x0;transfers[_0x517775[_0x1203('0x3a')]]['agententerreason']=0x2;}}}catch(_0x53e017){utils['error'](_0x53e017[_0x1203('0x18')]);}};exports[_0x1203('0x3c')]=function(_0x540c8f){try{if(transfers[_0x540c8f[_0x1203('0x4')]]){transfers[_0x540c8f['uniqueid']][_0x1203('0x28')]=!![];transfers[_0x540c8f[_0x1203('0x4')]][_0x1203('0x2a')]=utils['now']();transfers[_0x540c8f[_0x1203('0x4')]]['talktime']=utils[_0x1203('0x29')](transfers[_0x540c8f[_0x1203('0x4')]][_0x1203('0x2a')],transfers[_0x540c8f[_0x1203('0x4')]][_0x1203('0x3b')]);transfers[_0x540c8f['uniqueid']][_0x1203('0x22')]=_0x1203('0x3d');transfers[_0x540c8f[_0x1203('0x4')]]['lastevent']=_0x1203('0x3e');writeDB(transfers[_0x540c8f[_0x1203('0x4')]],!![]);}if(agents[_0x540c8f['uniqueid']]&&agents[_0x540c8f['uniqueid']][_0x1203('0x3b')]){agents[_0x540c8f['uniqueid']]['agentcomplete']=!![];agents[_0x540c8f[_0x1203('0x4')]][_0x1203('0x2a')]=utils[_0x1203('0x14')]();agents[_0x540c8f[_0x1203('0x4')]]['talktime']=utils[_0x1203('0x29')](agents[_0x540c8f[_0x1203('0x4')]][_0x1203('0x2a')],agents[_0x540c8f[_0x1203('0x4')]]['agentconnectAt']);agents[_0x540c8f[_0x1203('0x4')]][_0x1203('0x22')]=agents[_0x540c8f[_0x1203('0x4')]][_0x1203('0x2d')]?_0x1203('0x2d'):'agent';agents[_0x540c8f[_0x1203('0x4')]][_0x1203('0x15')]=_0x1203('0x3e');writeDB(agents[_0x540c8f[_0x1203('0x4')]]);}}catch(_0x4ebfd9){utils[_0x1203('0x17')](_0x4ebfd9[_0x1203('0x18')]);}}; \ No newline at end of file +var _0xd227=['rejected','holdtime','ringtime','error','queuecallerabandon','forIn','now','abandoned','reason','agentconnect','connect','membername','isNil','talktime','diffTime','agentcompleteAt','agentconnectAt','complete','blindtransfer','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','transfertargetuniqueid','hangup','agent','lodash','./utils','info','format','uniqueid','channel','queue','connectedlinenum','getVoiceQueueByName','then','type','agentcomplete','acw','acwtime','CreateVoiceAgentReport','agentcalled','destuniqueid','agentcalledAt','called','connectedlinename','stack','agentringnoanswer','agentringnoanswerAt','lastevent'];(function(_0x2e4b68,_0x353ecf){var _0x442e48=function(_0x804e95){while(--_0x804e95){_0x2e4b68['push'](_0x2e4b68['shift']());}};_0x442e48(++_0x353ecf);}(_0xd227,0xe8));var _0x7d22=function(_0x235563,_0x260ece){_0x235563=_0x235563-0x0;var _0x219be0=_0xd227[_0x235563];return _0x219be0;};'use strict';var _=require(_0x7d22('0x0'));var util=require('util');var utils=require(_0x7d22('0x1'));var agents={};var transfers={};function writeDB(_0x128b33,_0x20168c){utils[_0x7d22('0x2')](util[_0x7d22('0x3')]('AGENT|%s|%s|%s|%s|%s|%s|%s|%s',_0x128b33[_0x7d22('0x4')],_0x128b33[_0x7d22('0x5')],_0x128b33[_0x7d22('0x6')],_0x128b33['membername'],_0x128b33['interface'],_0x128b33['calleridnum'],_0x128b33[_0x7d22('0x7')],_0x128b33['lastevent']));if(_0x128b33['queue']){utils[_0x7d22('0x8')](_0x128b33[_0x7d22('0x6')])[_0x7d22('0x9')](function(_0x5e1b9b){if(_0x5e1b9b){_0x128b33[_0x7d22('0xa')]=_0x5e1b9b[_0x7d22('0xa')];_0x128b33['agentacw']=_0x128b33[_0x7d22('0xb')]?_0x5e1b9b[_0x7d22('0xc')]:![];_0x128b33[_0x7d22('0xd')]=_0x128b33['agentacw']?_0x5e1b9b['acwTimeout']:0x0;}utils['request']('CreateVoiceAgentReport',_0x128b33);});}else{utils['request'](_0x7d22('0xe'),_0x128b33);}if(_0x20168c){delete transfers[_0x128b33[_0x7d22('0x4')]];}else{delete agents[_0x128b33['destuniqueid']];}}exports[_0x7d22('0xf')]=function(_0x54772b){try{agents[_0x54772b[_0x7d22('0x10')]]=_0x54772b;agents[_0x54772b[_0x7d22('0x10')]][_0x7d22('0x11')]=utils['now']();agents[_0x54772b[_0x7d22('0x10')]]['lastevent']=_0x7d22('0x12');agents[_0x54772b[_0x7d22('0x10')]]['connectedlinenum']=null;agents[_0x54772b['destuniqueid']][_0x7d22('0x13')]=null;}catch(_0x49cb95){utils['error'](_0x49cb95[_0x7d22('0x14')]);}};exports[_0x7d22('0x15')]=function(_0xb4f73a){try{if(!_['isNil'](agents[_0xb4f73a[_0x7d22('0x10')]])){agents[_0xb4f73a[_0x7d22('0x10')]][_0x7d22('0x15')]=!![];agents[_0xb4f73a[_0x7d22('0x10')]][_0x7d22('0x16')]=utils['now']();agents[_0xb4f73a[_0x7d22('0x10')]][_0x7d22('0x17')]='rejected';agents[_0xb4f73a['destuniqueid']]['reason']=_0x7d22('0x18');agents[_0xb4f73a[_0x7d22('0x10')]][_0x7d22('0x19')]=_0xb4f73a[_0x7d22('0x1a')]?parseInt(_0xb4f73a[_0x7d22('0x1a')])/0x3e8:0x0;agents[_0xb4f73a[_0x7d22('0x10')]]['talktime']=0x0;writeDB(agents[_0xb4f73a[_0x7d22('0x10')]]);}}catch(_0x250204){utils[_0x7d22('0x1b')](_0x250204[_0x7d22('0x14')]);}};exports[_0x7d22('0x1c')]=function(_0x5ac076){try{_[_0x7d22('0x1d')](agents,function(_0x51a55e,_0x20753e){if(_0x51a55e[_0x7d22('0x4')]==_0x5ac076['uniqueid']){_0x51a55e['agentringnoanswer']=!![];_0x51a55e[_0x7d22('0x16')]=utils[_0x7d22('0x1e')]();_0x51a55e[_0x7d22('0x17')]=_0x7d22('0x1f');_0x51a55e[_0x7d22('0x20')]=_0x7d22('0x1f');_0x51a55e[_0x7d22('0x19')]=_0x5ac076[_0x7d22('0x19')];_0x51a55e['talktime']=0x0;writeDB(_0x51a55e);}});}catch(_0x44b46c){utils[_0x7d22('0x1b')](_0x44b46c[_0x7d22('0x14')]);}};exports[_0x7d22('0x21')]=function(_0x512f33){try{if(agents[_0x512f33[_0x7d22('0x10')]]){agents[_0x512f33[_0x7d22('0x10')]]['agentconnectAt']=utils[_0x7d22('0x1e')]();agents[_0x512f33[_0x7d22('0x10')]][_0x7d22('0x7')]=_0x512f33[_0x7d22('0x7')];agents[_0x512f33[_0x7d22('0x10')]][_0x7d22('0x13')]=_0x512f33[_0x7d22('0x13')];agents[_0x512f33['destuniqueid']][_0x7d22('0x19')]=_0x512f33[_0x7d22('0x1a')];agents[_0x512f33[_0x7d22('0x10')]][_0x7d22('0x17')]=_0x7d22('0x22');_[_0x7d22('0x1d')](agents,function(_0x57cd64,_0x38de00){if(_0x57cd64[_0x7d22('0x10')]!=_0x512f33[_0x7d22('0x10')]&&_0x57cd64[_0x7d22('0x4')]==_0x512f33[_0x7d22('0x4')]){_0x57cd64['talktime']=0x0;_0x57cd64[_0x7d22('0x19')]=_0x512f33['ringtime'];_0x57cd64[_0x7d22('0x15')]=!![];_0x57cd64['agentringnoanswerAt']=utils[_0x7d22('0x1e')]();_0x57cd64['lastevent']='answered_elsewhere';_0x57cd64[_0x7d22('0x20')]='answered_elsewhere';_0x57cd64['answeredelsewheredestinationuniqueid']=_0x512f33[_0x7d22('0x10')];_0x57cd64['answeredelsewheremembername']=_0x512f33[_0x7d22('0x23')];writeDB(_0x57cd64);}});}}catch(_0x5d9036){utils[_0x7d22('0x1b')](_0x5d9036[_0x7d22('0x14')]);}};exports[_0x7d22('0xb')]=function(_0xd0f379){try{if(!_[_0x7d22('0x24')](agents[_0xd0f379[_0x7d22('0x10')]])){agents[_0xd0f379[_0x7d22('0x10')]][_0x7d22('0xb')]=!![];agents[_0xd0f379[_0x7d22('0x10')]]['agentcompleteAt']=utils[_0x7d22('0x1e')]();agents[_0xd0f379[_0x7d22('0x10')]][_0x7d22('0x25')]=utils[_0x7d22('0x26')](agents[_0xd0f379[_0x7d22('0x10')]][_0x7d22('0x27')],agents[_0xd0f379[_0x7d22('0x10')]][_0x7d22('0x28')]);agents[_0xd0f379[_0x7d22('0x10')]][_0x7d22('0x20')]=_0xd0f379[_0x7d22('0x20')];agents[_0xd0f379[_0x7d22('0x10')]][_0x7d22('0x17')]=_0x7d22('0x29');writeDB(agents[_0xd0f379[_0x7d22('0x10')]]);}}catch(_0x18790f){utils[_0x7d22('0x1b')](_0x18790f[_0x7d22('0x14')]);}};exports[_0x7d22('0x2a')]=function(_0x13d360){try{if(!_[_0x7d22('0x24')](agents[_0x13d360[_0x7d22('0x2b')]])){agents[_0x13d360['transfereruniqueid']][_0x7d22('0x2c')]=!![];agents[_0x13d360[_0x7d22('0x2b')]][_0x7d22('0x2d')]=_0x7d22('0x2e');agents[_0x13d360[_0x7d22('0x2b')]][_0x7d22('0x2f')]=_0x13d360[_0x7d22('0x30')];agents[_0x13d360['transfereruniqueid']][_0x7d22('0x31')]=agents[_0x13d360[_0x7d22('0x2b')]][_0x7d22('0x4')];}}catch(_0x1f806a){utils[_0x7d22('0x1b')](_0x1f806a[_0x7d22('0x14')]);}};exports[_0x7d22('0x32')]=function(_0xa40562){try{if(_0xa40562[_0x7d22('0x33')]==_0xa40562[_0x7d22('0x34')]){if(!_['isNil'](agents[_0xa40562[_0x7d22('0x35')]])){agents[_0xa40562[_0x7d22('0x35')]][_0x7d22('0x2c')]=!![];agents[_0xa40562[_0x7d22('0x35')]][_0x7d22('0x2d')]=_0x7d22('0x36');agents[_0xa40562['secondtransfereruniqueid']][_0x7d22('0x2f')]=_0xa40562['origtransfererexten'];agents[_0xa40562[_0x7d22('0x35')]][_0x7d22('0x31')]=_0xa40562[_0x7d22('0x33')];}if(_0xa40562[_0x7d22('0x37')]&&agents[_0xa40562[_0x7d22('0x37')]]){agents[_0xa40562[_0x7d22('0x37')]][_0x7d22('0x38')]=0x1;transfers[_0xa40562['transfereeuniqueid']]=_[_0x7d22('0x39')](agents[_0xa40562[_0x7d22('0x37')]]);transfers[_0xa40562[_0x7d22('0x37')]][_0x7d22('0x3a')]=agents[_0xa40562[_0x7d22('0x35')]][_0x7d22('0x3a')];transfers[_0xa40562[_0x7d22('0x37')]][_0x7d22('0x3b')]=agents[_0xa40562[_0x7d22('0x35')]]['calleridname'];transfers[_0xa40562[_0x7d22('0x37')]][_0x7d22('0x11')]=utils[_0x7d22('0x1e')]();transfers[_0xa40562[_0x7d22('0x37')]][_0x7d22('0x28')]=utils[_0x7d22('0x1e')]();transfers[_0xa40562['transfereeuniqueid']][_0x7d22('0x19')]=0x0;transfers[_0xa40562[_0x7d22('0x37')]][_0x7d22('0x38')]=0x2;}}else if(_0xa40562[_0x7d22('0x35')]==_0xa40562[_0x7d22('0x3c')]){if(!_[_0x7d22('0x24')](agents[_0xa40562[_0x7d22('0x33')]])){agents[_0xa40562[_0x7d22('0x33')]][_0x7d22('0x2c')]=!![];agents[_0xa40562[_0x7d22('0x33')]][_0x7d22('0x2d')]=_0x7d22('0x36');agents[_0xa40562[_0x7d22('0x33')]][_0x7d22('0x2f')]=_0xa40562['secondtransfererexten'];agents[_0xa40562[_0x7d22('0x33')]][_0x7d22('0x31')]=_0xa40562[_0x7d22('0x35')];}if(_0xa40562[_0x7d22('0x3d')]&&agents[_0xa40562[_0x7d22('0x3d')]]){agents[_0xa40562[_0x7d22('0x3d')]]['agententerreason']=0x1;transfers[_0xa40562[_0x7d22('0x3d')]]=_[_0x7d22('0x39')](agents[_0xa40562[_0x7d22('0x3d')]]);transfers[_0xa40562[_0x7d22('0x3d')]][_0x7d22('0x3a')]=agents[_0xa40562[_0x7d22('0x33')]][_0x7d22('0x3a')];transfers[_0xa40562[_0x7d22('0x3d')]][_0x7d22('0x3b')]=agents[_0xa40562[_0x7d22('0x33')]]['calleridname'];transfers[_0xa40562[_0x7d22('0x3d')]][_0x7d22('0x11')]=utils[_0x7d22('0x1e')]();transfers[_0xa40562[_0x7d22('0x3d')]][_0x7d22('0x28')]=utils['now']();transfers[_0xa40562[_0x7d22('0x3d')]]['holdtime']=0x0;transfers[_0xa40562[_0x7d22('0x3d')]][_0x7d22('0x38')]=0x2;}}}catch(_0x54b732){utils[_0x7d22('0x1b')](_0x54b732[_0x7d22('0x14')]);}};exports[_0x7d22('0x3e')]=function(_0x5d5d94){try{if(transfers[_0x5d5d94[_0x7d22('0x4')]]){transfers[_0x5d5d94['uniqueid']]['agentcomplete']=!![];transfers[_0x5d5d94['uniqueid']][_0x7d22('0x27')]=utils[_0x7d22('0x1e')]();transfers[_0x5d5d94[_0x7d22('0x4')]][_0x7d22('0x25')]=utils[_0x7d22('0x26')](transfers[_0x5d5d94[_0x7d22('0x4')]][_0x7d22('0x27')],transfers[_0x5d5d94['uniqueid']][_0x7d22('0x28')]);transfers[_0x5d5d94[_0x7d22('0x4')]][_0x7d22('0x20')]='agent';transfers[_0x5d5d94[_0x7d22('0x4')]][_0x7d22('0x17')]=_0x7d22('0x29');writeDB(transfers[_0x5d5d94[_0x7d22('0x4')]],!![]);}if(agents[_0x5d5d94[_0x7d22('0x4')]]&&agents[_0x5d5d94[_0x7d22('0x4')]][_0x7d22('0x28')]){agents[_0x5d5d94[_0x7d22('0x4')]][_0x7d22('0xb')]=!![];agents[_0x5d5d94['uniqueid']][_0x7d22('0x27')]=utils[_0x7d22('0x1e')]();agents[_0x5d5d94[_0x7d22('0x4')]][_0x7d22('0x25')]=utils[_0x7d22('0x26')](agents[_0x5d5d94['uniqueid']][_0x7d22('0x27')],agents[_0x5d5d94[_0x7d22('0x4')]][_0x7d22('0x28')]);agents[_0x5d5d94[_0x7d22('0x4')]][_0x7d22('0x20')]=agents[_0x5d5d94[_0x7d22('0x4')]]['transfer']?_0x7d22('0x2c'):_0x7d22('0x3f');agents[_0x5d5d94[_0x7d22('0x4')]]['lastevent']=_0x7d22('0x29');writeDB(agents[_0x5d5d94[_0x7d22('0x4')]]);}}catch(_0x4ed441){utils[_0x7d22('0x1b')](_0x4ed441[_0x7d22('0x14')]);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 027f9cd..5b0840e 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 _0x384b=['disposition','stack','endtime','duration','starttime','attendedtransfer','localtwolinkedid','transfereechannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','diffTime','varset','variable','xmd-originatecalleridnum','value','xmd-phone','\x22\x20<','xmd-callerid','xmd-queue','xmcs-queue','Queue','lastdata','queue','xmd-contactid','ContactId','xmd-cdrtype','outboundrouteid','routeid','sipcallid','newexten','application','toLowerCase','set','startsWith','appdata','lastIndexOf','hangup','noop','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','type','accountcode','source','callerid','getUserByInternal','UserId','CreateVoiceCallReport','request','uniqueid','linkedid','channel','OutgoingSpoolFailed','calleridnum','context','error','newstate','isNil','channelstate','systemanswertime','now','destinationchannel','answertime'];(function(_0x1cdf59,_0x2f406f){var _0x129684=function(_0xa4c659){while(--_0xa4c659){_0x1cdf59['push'](_0x1cdf59['shift']());}};_0x129684(++_0x2f406f);}(_0x384b,0x108));var _0xb384=function(_0x538a55,_0x4b708d){_0x538a55=_0x538a55-0x0;var _0x324ab1=_0x384b[_0x538a55];return _0x324ab1;};'use strict';var _=require(_0xb384('0x0'));var util=require(_0xb384('0x1'));var utils=require(_0xb384('0x2'));var dispositions=[_0xb384('0x3'),_0xb384('0x4'),_0xb384('0x4'),_0xb384('0x3'),_0xb384('0x3'),_0xb384('0x3'),_0xb384('0x5'),_0xb384('0x6'),'FAILED',_0xb384('0x4'),_0xb384('0x4')];var channels={};function writeDB(_0x1c6401){utils[_0xb384('0x7')](util[_0xb384('0x8')](_0xb384('0x9'),_0x1c6401['uniqueid'],_0x1c6401['channel'],_0x1c6401[_0xb384('0xa')],_0x1c6401[_0xb384('0xb')],_0x1c6401[_0xb384('0xc')],_0x1c6401['destination'],_0x1c6401[_0xb384('0xd')],_0x1c6401['disposition']));if(_0x1c6401[_0xb384('0xb')]){utils[_0xb384('0xe')](_0x1c6401[_0xb384('0xb')])['then'](function(_0x3ddc97){if(_0x3ddc97){_0x1c6401[_0xb384('0xf')]=_0x3ddc97['id'];}utils['request'](_0xb384('0x10'),_0x1c6401);});}else{utils[_0xb384('0x11')](_0xb384('0x10'),_0x1c6401);}if(channels[_0x1c6401[_0xb384('0x12')]]){delete channels[_0x1c6401[_0xb384('0x12')]];}}exports['newchannel']=function(_0x33ead0){try{if(_0x33ead0[_0xb384('0x12')]==_0x33ead0[_0xb384('0x13')]&&_0x33ead0[_0xb384('0x14')]!=_0xb384('0x15')){channels[_0x33ead0[_0xb384('0x12')]]={'uniqueid':_0x33ead0[_0xb384('0x12')],'accountcode':_0x33ead0[_0xb384('0xb')],'source':_0x33ead0[_0xb384('0x16')],'destination':_0x33ead0['exten'],'destinationcontext':_0x33ead0[_0xb384('0x17')],'channel':_0x33ead0[_0xb384('0x14')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0x2c0bca){utils[_0xb384('0x18')](_0x2c0bca['stack']);}};exports[_0xb384('0x19')]=function(_0x1daf07){try{if(!_[_0xb384('0x1a')](channels[_0x1daf07[_0xb384('0x12')]])&&_0x1daf07[_0xb384('0x1b')]==0x6){if(_[_0xb384('0x1a')](channels[_0x1daf07[_0xb384('0x12')]][_0xb384('0x1c')])){channels[_0x1daf07[_0xb384('0x12')]][_0xb384('0x1c')]=utils[_0xb384('0x1d')]();}}else if(!_['isNil'](channels[_0x1daf07[_0xb384('0x13')]])&&_0x1daf07[_0xb384('0x1b')]==0x6&&_0x1daf07[_0xb384('0x17')]!='transfer'){channels[_0x1daf07[_0xb384('0x13')]][_0xb384('0xb')]=_0x1daf07[_0xb384('0xb')];channels[_0x1daf07[_0xb384('0x13')]][_0xb384('0x1e')]=_0x1daf07['channel'];if(_[_0xb384('0x1a')](channels[_0x1daf07[_0xb384('0x13')]][_0xb384('0x1f')])){channels[_0x1daf07[_0xb384('0x13')]][_0xb384('0x1f')]=utils[_0xb384('0x1d')]();}channels[_0x1daf07[_0xb384('0x13')]][_0xb384('0x20')]=dispositions[_['toNumber'](_0x1daf07[_0xb384('0x1b')])]||_0xb384('0x5');}}catch(_0x480270){utils[_0xb384('0x18')](_0x480270[_0xb384('0x21')]);}};exports['hangup']=function(_0x1671bc){try{if(!_[_0xb384('0x1a')](channels[_0x1671bc[_0xb384('0x12')]])){if(_[_0xb384('0x1a')](channels[_0x1671bc[_0xb384('0x12')]][_0xb384('0xd')])){channels[_0x1671bc[_0xb384('0x12')]][_0xb384('0xd')]=_0x1671bc['calleridname']+'\x20<'+_0x1671bc[_0xb384('0x16')]+'>';}channels[_0x1671bc[_0xb384('0x12')]][_0xb384('0x22')]=utils[_0xb384('0x1d')]();channels[_0x1671bc[_0xb384('0x12')]][_0xb384('0x23')]=utils['diffTime'](channels[_0x1671bc[_0xb384('0x12')]][_0xb384('0x22')],channels[_0x1671bc[_0xb384('0x12')]][_0xb384('0x24')]);channels[_0x1671bc[_0xb384('0x12')]]['billableseconds']=channels[_0x1671bc[_0xb384('0x12')]]['answertime']?utils['diffTime'](channels[_0x1671bc[_0xb384('0x12')]]['endtime'],channels[_0x1671bc[_0xb384('0x12')]][_0xb384('0x1f')]):0x0;writeDB(channels[_0x1671bc[_0xb384('0x12')]]);}}catch(_0x39b4ea){utils['error'](_0x39b4ea['stack']);}};exports[_0xb384('0x25')]=function(_0x47a16c){try{if(!_['isNil'](channels[_0x47a16c['localtwolinkedid']])){if(channels[_0x47a16c[_0xb384('0x26')]][_0xb384('0x14')]==_0x47a16c[_0xb384('0x27')]){channels[_0x47a16c[_0xb384('0x26')]]['destinationchannel']=_0x47a16c['secondtransfererchannel'];channels[_0x47a16c['localtwolinkedid']][_0xb384('0x28')]=_0xb384('0x29');}else if(channels[_0x47a16c[_0xb384('0x26')]][_0xb384('0x14')]=_0x47a16c[_0xb384('0x2a')]){channels[_0x47a16c[_0xb384('0x26')]][_0xb384('0x1e')]=_0x47a16c[_0xb384('0x2b')];channels[_0x47a16c['localtwolinkedid']][_0xb384('0x28')]=_0xb384('0x29');}}}catch(_0x26e9d1){utils[_0xb384('0x18')](_0x26e9d1[_0xb384('0x21')]);}};exports[_0xb384('0x2c')]=function(_0x4f3890){try{if(!_['isNil'](channels[_0x4f3890[_0xb384('0x12')]])){channels[_0x4f3890['uniqueid']]['musiconholdstartAt']=utils[_0xb384('0x1d')]();}}catch(_0x18b029){utils[_0xb384('0x18')](_0x18b029['stack']);}};exports['musiconholdstop']=function(_0x5e713c){try{if(!_['isNil'](channels[_0x5e713c['uniqueid']])){if(!_[_0xb384('0x1a')](channels[_0x5e713c[_0xb384('0x12')]][_0xb384('0x2d')])){channels[_0x5e713c['uniqueid']]['mohtime']+=utils[_0xb384('0x2e')](utils[_0xb384('0x1d')](),channels[_0x5e713c[_0xb384('0x12')]][_0xb384('0x2d')]);delete channels[_0x5e713c[_0xb384('0x12')]][_0xb384('0x2d')];}}}catch(_0x186b6b){utils['error'](_0x186b6b['stack']);}};exports[_0xb384('0x2f')]=function(_0x34a050){try{if(!_[_0xb384('0x1a')](channels[_0x34a050[_0xb384('0x12')]])){if(!_[_0xb384('0x1a')](_0x34a050[_0xb384('0x30')][_0xb384('0x31')])){channels[_0x34a050['uniqueid']]['source']=_0x34a050[_0xb384('0x32')];}if(!_[_0xb384('0x1a')](_0x34a050[_0xb384('0x30')][_0xb384('0x33')])){channels[_0x34a050[_0xb384('0x12')]]['destination']=_0x34a050[_0xb384('0x32')];channels[_0x34a050[_0xb384('0x12')]]['callerid']='\x22'+_0x34a050[_0xb384('0x32')]+_0xb384('0x34')+_0x34a050[_0xb384('0x32')]+'>';}if(!_[_0xb384('0x1a')](_0x34a050[_0xb384('0x30')]['xmd-callerid-preview'])||!_[_0xb384('0x1a')](_0x34a050[_0xb384('0x30')][_0xb384('0x35')])){channels[_0x34a050[_0xb384('0x12')]]['callerid']=_0x34a050['value'];}if(!_['isNil'](_0x34a050['variable'][_0xb384('0x36')])||!_[_0xb384('0x1a')](_0x34a050[_0xb384('0x30')][_0xb384('0x37')])){channels[_0x34a050['uniqueid']]['lastapplication']=_0xb384('0x38');channels[_0x34a050[_0xb384('0x12')]][_0xb384('0x39')]=_0x34a050[_0xb384('0x32')];channels[_0x34a050['uniqueid']][_0xb384('0x3a')]=!![];}if(!_[_0xb384('0x1a')](_0x34a050['variable'][_0xb384('0x3b')])){channels[_0x34a050['uniqueid']][_0xb384('0x3c')]=_0x34a050[_0xb384('0x32')];}if(!_[_0xb384('0x1a')](_0x34a050[_0xb384('0x30')][_0xb384('0x3d')])){channels[_0x34a050[_0xb384('0x12')]][_0xb384('0xa')]=_0x34a050[_0xb384('0x32')];}if(!_[_0xb384('0x1a')](_0x34a050['variable'][_0xb384('0x3e')])){channels[_0x34a050['uniqueid']][_0xb384('0x3f')]=_0x34a050[_0xb384('0x32')];}if(!_[_0xb384('0x1a')](_0x34a050[_0xb384('0x30')]['sipcallid'])){channels[_0x34a050[_0xb384('0x12')]][_0xb384('0x40')]=_0x34a050[_0xb384('0x32')];}}}catch(_0x50bbf0){utils['error'](_0x50bbf0[_0xb384('0x21')]);}};exports[_0xb384('0x41')]=function(_0x5d093d){try{if(!_[_0xb384('0x1a')](channels[_0x5d093d['uniqueid']])){if(_0x5d093d[_0xb384('0x42')][_0xb384('0x43')]()==_0xb384('0x44')&&_[_0xb384('0x45')](_0x5d093d[_0xb384('0x46')][_0xb384('0x43')](),'cdr')){var _0x583857=_0x5d093d[_0xb384('0x46')]['split']('=');var _0x5757d5=_0x583857[0x0]['substring'](_0x583857[0x0][_0xb384('0x47')]('(')+0x1,_0x583857[0x0][_0xb384('0x47')](')'));var _0x395b47=_0x583857[0x1];channels[_0x5d093d[_0xb384('0x12')]][_0x5757d5]=_0x395b47;}if(!_['includes']([_0xb384('0x48'),_0xb384('0x49'),'execif','set','gotoif'],_0x5d093d[_0xb384('0x42')]['toLowerCase']())){channels[_0x5d093d[_0xb384('0x12')]]['lastapplication']=_0x5d093d[_0xb384('0x42')];channels[_0x5d093d['uniqueid']]['lastdata']=_0x5d093d[_0xb384('0x46')];}}}catch(_0x331481){utils[_0xb384('0x18')](_0x331481['stack']);}}; \ No newline at end of file +var _0x52a4=['application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','type','source','callerid','disposition','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','uniqueid','linkedid','calleridnum','exten','context','channel','now','DOCUMENTATION','error','stack','newstate','isNil','systemanswertime','transfer','destinationchannel','answertime','channelstate','hangup','calleridname','endtime','duration','starttime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','transfereechannel','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstop','musiconholdstartAt','variable','xmd-originatecalleridnum','value','xmd-phone','xmd-callerid-preview','xmd-callerid','xmd-queue','lastapplication','Queue','lastdata','queue','xmd-cdrtype','outboundrouteid','routeid','sipcallid','newexten'];(function(_0x16b088,_0x33fe44){var _0x54be98=function(_0x3b3a20){while(--_0x3b3a20){_0x16b088['push'](_0x16b088['shift']());}};_0x54be98(++_0x33fe44);}(_0x52a4,0x151));var _0x452a=function(_0x565898,_0x33a9df){_0x565898=_0x565898-0x0;var _0x3d876e=_0x52a4[_0x565898];return _0x3d876e;};'use strict';var _=require('lodash');var util=require(_0x452a('0x0'));var utils=require(_0x452a('0x1'));var dispositions=[_0x452a('0x2'),'FAILED',_0x452a('0x3'),_0x452a('0x2'),_0x452a('0x2'),_0x452a('0x2'),_0x452a('0x4'),_0x452a('0x5'),_0x452a('0x3'),_0x452a('0x3'),'FAILED'];var channels={};function writeDB(_0x236521){utils['info'](util[_0x452a('0x6')](_0x452a('0x7'),_0x236521['uniqueid'],_0x236521['channel'],_0x236521[_0x452a('0x8')],_0x236521['accountcode'],_0x236521[_0x452a('0x9')],_0x236521['destination'],_0x236521[_0x452a('0xa')],_0x236521[_0x452a('0xb')]));if(_0x236521[_0x452a('0xc')]){utils[_0x452a('0xd')](_0x236521[_0x452a('0xc')])[_0x452a('0xe')](function(_0x1cecb4){if(_0x1cecb4){_0x236521[_0x452a('0xf')]=_0x1cecb4['id'];}utils[_0x452a('0x10')](_0x452a('0x11'),_0x236521);});}else{utils[_0x452a('0x10')](_0x452a('0x11'),_0x236521);}if(channels[_0x236521[_0x452a('0x12')]]){delete channels[_0x236521[_0x452a('0x12')]];}}exports['newchannel']=function(_0x45d7cf){try{if(_0x45d7cf['uniqueid']==_0x45d7cf[_0x452a('0x13')]&&_0x45d7cf['channel']!='OutgoingSpoolFailed'){channels[_0x45d7cf['uniqueid']]={'uniqueid':_0x45d7cf[_0x452a('0x12')],'accountcode':_0x45d7cf[_0x452a('0xc')],'source':_0x45d7cf[_0x452a('0x14')],'destination':_0x45d7cf[_0x452a('0x15')],'destinationcontext':_0x45d7cf[_0x452a('0x16')],'channel':_0x45d7cf[_0x452a('0x17')],'starttime':utils[_0x452a('0x18')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x452a('0x2'),'amaflags':_0x452a('0x19')};}}catch(_0x7177b1){utils[_0x452a('0x1a')](_0x7177b1[_0x452a('0x1b')]);}};exports[_0x452a('0x1c')]=function(_0x402a56){try{if(!_['isNil'](channels[_0x402a56[_0x452a('0x12')]])&&_0x402a56['channelstate']==0x6){if(_[_0x452a('0x1d')](channels[_0x402a56[_0x452a('0x12')]][_0x452a('0x1e')])){channels[_0x402a56['uniqueid']][_0x452a('0x1e')]=utils['now']();}}else if(!_['isNil'](channels[_0x402a56['linkedid']])&&_0x402a56['channelstate']==0x6&&_0x402a56[_0x452a('0x16')]!=_0x452a('0x1f')){channels[_0x402a56[_0x452a('0x13')]][_0x452a('0xc')]=_0x402a56['accountcode'];channels[_0x402a56[_0x452a('0x13')]][_0x452a('0x20')]=_0x402a56[_0x452a('0x17')];if(_[_0x452a('0x1d')](channels[_0x402a56['linkedid']][_0x452a('0x21')])){channels[_0x402a56[_0x452a('0x13')]]['answertime']=utils[_0x452a('0x18')]();}channels[_0x402a56[_0x452a('0x13')]]['disposition']=dispositions[_['toNumber'](_0x402a56[_0x452a('0x22')])]||'ANSWERED';}}catch(_0x263a63){utils[_0x452a('0x1a')](_0x263a63[_0x452a('0x1b')]);}};exports[_0x452a('0x23')]=function(_0x58c87f){try{if(!_[_0x452a('0x1d')](channels[_0x58c87f[_0x452a('0x12')]])){if(_[_0x452a('0x1d')](channels[_0x58c87f[_0x452a('0x12')]][_0x452a('0xa')])){channels[_0x58c87f[_0x452a('0x12')]][_0x452a('0xa')]=_0x58c87f[_0x452a('0x24')]+'\x20<'+_0x58c87f['calleridnum']+'>';}channels[_0x58c87f['uniqueid']][_0x452a('0x25')]=utils[_0x452a('0x18')]();channels[_0x58c87f[_0x452a('0x12')]][_0x452a('0x26')]=utils['diffTime'](channels[_0x58c87f[_0x452a('0x12')]][_0x452a('0x25')],channels[_0x58c87f[_0x452a('0x12')]][_0x452a('0x27')]);channels[_0x58c87f[_0x452a('0x12')]][_0x452a('0x28')]=channels[_0x58c87f[_0x452a('0x12')]][_0x452a('0x21')]?utils[_0x452a('0x29')](channels[_0x58c87f[_0x452a('0x12')]][_0x452a('0x25')],channels[_0x58c87f['uniqueid']][_0x452a('0x21')]):0x0;writeDB(channels[_0x58c87f[_0x452a('0x12')]]);}}catch(_0x3a04df){utils[_0x452a('0x1a')](_0x3a04df[_0x452a('0x1b')]);}};exports[_0x452a('0x2a')]=function(_0x2f65b4){try{if(!_[_0x452a('0x1d')](channels[_0x2f65b4[_0x452a('0x2b')]])){if(channels[_0x2f65b4[_0x452a('0x2b')]][_0x452a('0x17')]==_0x2f65b4[_0x452a('0x2c')]){channels[_0x2f65b4[_0x452a('0x2b')]][_0x452a('0x20')]=_0x2f65b4[_0x452a('0x2d')];channels[_0x2f65b4[_0x452a('0x2b')]][_0x452a('0x2e')]='_attended';}else if(channels[_0x2f65b4['localtwolinkedid']][_0x452a('0x17')]=_0x2f65b4[_0x452a('0x2f')]){channels[_0x2f65b4[_0x452a('0x2b')]][_0x452a('0x20')]=_0x2f65b4[_0x452a('0x30')];channels[_0x2f65b4[_0x452a('0x2b')]]['userfield']=_0x452a('0x31');}}}catch(_0x256ba5){utils['error'](_0x256ba5[_0x452a('0x1b')]);}};exports['musiconholdstart']=function(_0x5b3c72){try{if(!_[_0x452a('0x1d')](channels[_0x5b3c72[_0x452a('0x12')]])){channels[_0x5b3c72['uniqueid']]['musiconholdstartAt']=utils[_0x452a('0x18')]();}}catch(_0x111d78){utils[_0x452a('0x1a')](_0x111d78[_0x452a('0x1b')]);}};exports[_0x452a('0x32')]=function(_0x5935c9){try{if(!_[_0x452a('0x1d')](channels[_0x5935c9[_0x452a('0x12')]])){if(!_['isNil'](channels[_0x5935c9['uniqueid']][_0x452a('0x33')])){channels[_0x5935c9['uniqueid']]['mohtime']+=utils[_0x452a('0x29')](utils[_0x452a('0x18')](),channels[_0x5935c9[_0x452a('0x12')]]['musiconholdstartAt']);delete channels[_0x5935c9[_0x452a('0x12')]][_0x452a('0x33')];}}}catch(_0x2a7bc7){utils[_0x452a('0x1a')](_0x2a7bc7[_0x452a('0x1b')]);}};exports['varset']=function(_0x75f87d){try{if(!_[_0x452a('0x1d')](channels[_0x75f87d[_0x452a('0x12')]])){if(!_[_0x452a('0x1d')](_0x75f87d[_0x452a('0x34')][_0x452a('0x35')])){channels[_0x75f87d[_0x452a('0x12')]][_0x452a('0x9')]=_0x75f87d[_0x452a('0x36')];}if(!_['isNil'](_0x75f87d[_0x452a('0x34')][_0x452a('0x37')])){channels[_0x75f87d[_0x452a('0x12')]]['destination']=_0x75f87d[_0x452a('0x36')];channels[_0x75f87d[_0x452a('0x12')]][_0x452a('0xa')]='\x22'+_0x75f87d[_0x452a('0x36')]+'\x22\x20<'+_0x75f87d['value']+'>';}if(!_['isNil'](_0x75f87d[_0x452a('0x34')][_0x452a('0x38')])||!_['isNil'](_0x75f87d[_0x452a('0x34')][_0x452a('0x39')])){channels[_0x75f87d[_0x452a('0x12')]][_0x452a('0xa')]=_0x75f87d[_0x452a('0x36')];}if(!_['isNil'](_0x75f87d[_0x452a('0x34')][_0x452a('0x3a')])||!_[_0x452a('0x1d')](_0x75f87d['variable']['xmcs-queue'])){channels[_0x75f87d[_0x452a('0x12')]][_0x452a('0x3b')]=_0x452a('0x3c');channels[_0x75f87d[_0x452a('0x12')]][_0x452a('0x3d')]=_0x75f87d[_0x452a('0x36')];channels[_0x75f87d[_0x452a('0x12')]][_0x452a('0x3e')]=!![];}if(!_[_0x452a('0x1d')](_0x75f87d[_0x452a('0x34')]['xmd-contactid'])){channels[_0x75f87d[_0x452a('0x12')]]['ContactId']=_0x75f87d[_0x452a('0x36')];}if(!_['isNil'](_0x75f87d['variable'][_0x452a('0x3f')])){channels[_0x75f87d[_0x452a('0x12')]][_0x452a('0x8')]=_0x75f87d[_0x452a('0x36')];}if(!_[_0x452a('0x1d')](_0x75f87d[_0x452a('0x34')][_0x452a('0x40')])){channels[_0x75f87d[_0x452a('0x12')]][_0x452a('0x41')]=_0x75f87d['value'];}if(!_['isNil'](_0x75f87d[_0x452a('0x34')][_0x452a('0x42')])){channels[_0x75f87d[_0x452a('0x12')]][_0x452a('0x42')]=_0x75f87d[_0x452a('0x36')];}}}catch(_0x271770){utils[_0x452a('0x1a')](_0x271770[_0x452a('0x1b')]);}};exports[_0x452a('0x43')]=function(_0x309f7e){try{if(!_['isNil'](channels[_0x309f7e['uniqueid']])){if(_0x309f7e[_0x452a('0x44')][_0x452a('0x45')]()==_0x452a('0x46')&&_[_0x452a('0x47')](_0x309f7e[_0x452a('0x48')]['toLowerCase'](),_0x452a('0x49'))){var _0x12225c=_0x309f7e[_0x452a('0x48')][_0x452a('0x4a')]('=');var _0x322d20=_0x12225c[0x0][_0x452a('0x4b')](_0x12225c[0x0]['lastIndexOf']('(')+0x1,_0x12225c[0x0][_0x452a('0x4c')](')'));var _0x35e954=_0x12225c[0x1];channels[_0x309f7e[_0x452a('0x12')]][_0x322d20]=_0x35e954;}if(!_[_0x452a('0x4d')](['hangup',_0x452a('0x4e'),_0x452a('0x4f'),'set',_0x452a('0x50')],_0x309f7e[_0x452a('0x44')][_0x452a('0x45')]())){channels[_0x309f7e[_0x452a('0x12')]][_0x452a('0x3b')]=_0x309f7e[_0x452a('0x44')];channels[_0x309f7e['uniqueid']][_0x452a('0x3d')]=_0x309f7e[_0x452a('0x48')];}}}catch(_0x34e0a5){utils[_0x452a('0x1a')](_0x34e0a5[_0x452a('0x1b')]);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 988dc01..6c262e9 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 _0xc949=['./utils','connect','info','CONNECTED','shutdown','SHUTDOWN','fullybooted','FULLYBOOTED','error','CLOSE','managerevent'];(function(_0x5428a6,_0x172a4d){var _0x191995=function(_0x65a93f){while(--_0x65a93f){_0x5428a6['push'](_0x5428a6['shift']());}};_0x191995(++_0x172a4d);}(_0xc949,0x181));var _0x9c94=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xc949[_0x4baae2];return _0x1a2285;};'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 +var _0x99c9=['error','close','CLOSE','managerevent','./utils','lodash','connect','info','CONNECTED','shutdown','fullybooted','FULLYBOOTED'];(function(_0xc8835,_0x2d5adf){var _0x1458dc=function(_0x4e5557){while(--_0x4e5557){_0xc8835['push'](_0xc8835['shift']());}};_0x1458dc(++_0x2d5adf);}(_0x99c9,0x13c));var _0x999c=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x99c9[_0x27af45];return _0x18df21;};'use strict';var utils=require(_0x999c('0x0'));var _=require(_0x999c('0x1'));exports[_0x999c('0x2')]=function(){utils[_0x999c('0x3')](_0x999c('0x4'));};exports[_0x999c('0x5')]=function(){utils[_0x999c('0x3')]('SHUTDOWN');};exports[_0x999c('0x6')]=function(){utils[_0x999c('0x3')](_0x999c('0x7'));};exports[_0x999c('0x8')]=function(_0x2bdd73){utils[_0x999c('0x8')](_0x2bdd73);};exports[_0x999c('0x9')]=function(){utils[_0x999c('0x3')](_0x999c('0xa'));};exports[_0x999c('0xb')]=function(_0x329252){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index f2b1e2d..243f37d 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 _0x8f85=['util','format','DIAL|%s|%s|%s|%s|%s|%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten','toLowerCase','set','appdata','cdr(routeid)','split','error','stack','varset','isNil','outboundrouteid','dialbegin','assign','starttime','lastevent','dialend','ANSWER','answertime','connect','hangup','now','endtime','holdtime','diffTime','billableseconds','lodash'];(function(_0x595e6d,_0xf8812a){var _0x1d57c5=function(_0x4e43fb){while(--_0x4e43fb){_0x595e6d['push'](_0x595e6d['shift']());}};_0x1d57c5(++_0xf8812a);}(_0x8f85,0x6e));var _0x58f8=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x8f85[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x58f8('0x0'));var util=require(_0x58f8('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x12ce50){utils['info'](util[_0x58f8('0x2')](_0x58f8('0x3'),_0x12ce50['uniqueid'],_0x12ce50[_0x58f8('0x4')],_0x12ce50[_0x58f8('0x5')],_0x12ce50[_0x58f8('0x6')],_0x12ce50[_0x58f8('0x7')],_0x12ce50[_0x58f8('0x8')]));utils[_0x58f8('0x9')](_0x58f8('0xa'),_0x12ce50);delete dials[_0x12ce50[_0x58f8('0xb')]];}exports[_0x58f8('0xc')]=function(_0x341ce0){try{if(_0x341ce0['application'][_0x58f8('0xd')]()==_0x58f8('0xe')&&_['startsWith'](_0x341ce0[_0x58f8('0xf')][_0x58f8('0xd')](),_0x58f8('0x10'))){var _0x1578e4=_0x341ce0[_0x58f8('0xf')][_0x58f8('0x11')]('=');dials[_0x341ce0['uniqueid']]={'routeId':_0x1578e4[0x1]};}}catch(_0x1be3b4){utils[_0x58f8('0x12')](_0x1be3b4[_0x58f8('0x13')]);}};exports[_0x58f8('0x14')]=function(_0x145a5c){try{if(!_[_0x58f8('0x15')](_0x145a5c['variable'][_0x58f8('0x16')])){dials[_0x145a5c[_0x58f8('0xb')]]={'routeId':_0x145a5c['value']};}}catch(_0x38b895){utils[_0x58f8('0x12')](_0x38b895['stack']);}};exports[_0x58f8('0x17')]=function(_0x22add3){try{if(!_['isNil'](dials[_0x22add3[_0x58f8('0xb')]])){dials[_0x22add3[_0x58f8('0xb')]]=_[_0x58f8('0x18')](dials[_0x22add3[_0x58f8('0xb')]],_0x22add3);dials[_0x22add3['uniqueid']][_0x58f8('0x19')]=utils['now']();dials[_0x22add3[_0x58f8('0xb')]][_0x58f8('0x1a')]='called';}}catch(_0x1f3d35){utils[_0x58f8('0x12')](_0x1f3d35[_0x58f8('0x13')]);}};exports[_0x58f8('0x1b')]=function(_0x3015e5){try{if(!_[_0x58f8('0x15')](dials[_0x3015e5[_0x58f8('0xb')]])){dials[_0x3015e5[_0x58f8('0xb')]][_0x58f8('0x8')]=_0x3015e5[_0x58f8('0x8')];if(_0x3015e5['dialstatus']==_0x58f8('0x1c')){dials[_0x3015e5[_0x58f8('0xb')]]=_[_0x58f8('0x18')](dials[_0x3015e5['uniqueid']],_0x3015e5);dials[_0x3015e5[_0x58f8('0xb')]][_0x58f8('0x1d')]=utils['now']();dials[_0x3015e5[_0x58f8('0xb')]][_0x58f8('0x1a')]=_0x58f8('0x1e');}}}catch(_0x29e1c7){utils[_0x58f8('0x12')](_0x29e1c7['stack']);}};exports[_0x58f8('0x1f')]=function(_0x1e5b54){try{if(!_['isNil'](dials[_0x1e5b54[_0x58f8('0xb')]])){dials[_0x1e5b54[_0x58f8('0xb')]]=_[_0x58f8('0x18')](dials[_0x1e5b54[_0x58f8('0xb')]],{'endtime':utils[_0x58f8('0x20')](),'lastevent':'complete'});dials[_0x1e5b54[_0x58f8('0xb')]]['duration']=utils['diffTime'](dials[_0x1e5b54[_0x58f8('0xb')]][_0x58f8('0x21')],dials[_0x1e5b54[_0x58f8('0xb')]][_0x58f8('0x19')]);dials[_0x1e5b54[_0x58f8('0xb')]][_0x58f8('0x22')]=utils[_0x58f8('0x23')](dials[_0x1e5b54[_0x58f8('0xb')]]['answertime']||dials[_0x1e5b54['uniqueid']][_0x58f8('0x21')],dials[_0x1e5b54[_0x58f8('0xb')]][_0x58f8('0x19')]);dials[_0x1e5b54[_0x58f8('0xb')]][_0x58f8('0x24')]=dials[_0x1e5b54[_0x58f8('0xb')]]['answertime']?utils[_0x58f8('0x23')](dials[_0x1e5b54[_0x58f8('0xb')]][_0x58f8('0x21')],dials[_0x1e5b54[_0x58f8('0xb')]][_0x58f8('0x1d')]):0x0;writeDB(dials[_0x1e5b54[_0x58f8('0xb')]]);}}catch(_0x2c2bf1){utils['error'](_0x2c2bf1[_0x58f8('0x13')]);}}; \ No newline at end of file +var _0xd04b=['info','format','DIAL|%s|%s|%s|%s|%s|%s','channel','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','uniqueid','newexten','toLowerCase','set','split','stack','isNil','outboundrouteid','value','dialbegin','assign','starttime','now','lastevent','called','ANSWER','answertime','complete','holdtime','diffTime','endtime','billableseconds','error','lodash','util','./utils'];(function(_0x1c3315,_0x5a8bec){var _0x2f7954=function(_0x158406){while(--_0x158406){_0x1c3315['push'](_0x1c3315['shift']());}};_0x2f7954(++_0x5a8bec);}(_0xd04b,0x173));var _0xbd04=function(_0x32fbb5,_0xe23755){_0x32fbb5=_0x32fbb5-0x0;var _0x3bb9e2=_0xd04b[_0x32fbb5];return _0x3bb9e2;};'use strict';var _=require(_0xbd04('0x0'));var util=require(_0xbd04('0x1'));var utils=require(_0xbd04('0x2'));var dials={};function writeDB(_0x3a9384){utils[_0xbd04('0x3')](util[_0xbd04('0x4')](_0xbd04('0x5'),_0x3a9384['uniqueid'],_0x3a9384[_0xbd04('0x6')],_0x3a9384['dialstring'],_0x3a9384[_0xbd04('0x7')],_0x3a9384[_0xbd04('0x8')],_0x3a9384[_0xbd04('0x9')]));utils['request'](_0xbd04('0xa'),_0x3a9384);delete dials[_0x3a9384[_0xbd04('0xb')]];}exports[_0xbd04('0xc')]=function(_0xdd978d){try{if(_0xdd978d['application'][_0xbd04('0xd')]()==_0xbd04('0xe')&&_['startsWith'](_0xdd978d['appdata']['toLowerCase'](),'cdr(routeid)')){var _0x576efa=_0xdd978d['appdata'][_0xbd04('0xf')]('=');dials[_0xdd978d['uniqueid']]={'routeId':_0x576efa[0x1]};}}catch(_0x5e91c5){utils['error'](_0x5e91c5[_0xbd04('0x10')]);}};exports['varset']=function(_0x5a7b79){try{if(!_[_0xbd04('0x11')](_0x5a7b79['variable'][_0xbd04('0x12')])){dials[_0x5a7b79[_0xbd04('0xb')]]={'routeId':_0x5a7b79[_0xbd04('0x13')]};}}catch(_0x182d84){utils['error'](_0x182d84[_0xbd04('0x10')]);}};exports[_0xbd04('0x14')]=function(_0x5673f8){try{if(!_[_0xbd04('0x11')](dials[_0x5673f8[_0xbd04('0xb')]])){dials[_0x5673f8[_0xbd04('0xb')]]=_[_0xbd04('0x15')](dials[_0x5673f8[_0xbd04('0xb')]],_0x5673f8);dials[_0x5673f8[_0xbd04('0xb')]][_0xbd04('0x16')]=utils[_0xbd04('0x17')]();dials[_0x5673f8[_0xbd04('0xb')]][_0xbd04('0x18')]=_0xbd04('0x19');}}catch(_0x4a1249){utils['error'](_0x4a1249[_0xbd04('0x10')]);}};exports['dialend']=function(_0x42c9f8){try{if(!_[_0xbd04('0x11')](dials[_0x42c9f8[_0xbd04('0xb')]])){dials[_0x42c9f8[_0xbd04('0xb')]][_0xbd04('0x9')]=_0x42c9f8[_0xbd04('0x9')];if(_0x42c9f8[_0xbd04('0x9')]==_0xbd04('0x1a')){dials[_0x42c9f8[_0xbd04('0xb')]]=_['assign'](dials[_0x42c9f8[_0xbd04('0xb')]],_0x42c9f8);dials[_0x42c9f8['uniqueid']][_0xbd04('0x1b')]=utils[_0xbd04('0x17')]();dials[_0x42c9f8[_0xbd04('0xb')]][_0xbd04('0x18')]='connect';}}}catch(_0x54c6db){utils['error'](_0x54c6db[_0xbd04('0x10')]);}};exports['hangup']=function(_0x41425f){try{if(!_['isNil'](dials[_0x41425f[_0xbd04('0xb')]])){dials[_0x41425f[_0xbd04('0xb')]]=_['assign'](dials[_0x41425f[_0xbd04('0xb')]],{'endtime':utils['now'](),'lastevent':_0xbd04('0x1c')});dials[_0x41425f['uniqueid']]['duration']=utils['diffTime'](dials[_0x41425f['uniqueid']]['endtime'],dials[_0x41425f['uniqueid']][_0xbd04('0x16')]);dials[_0x41425f['uniqueid']][_0xbd04('0x1d')]=utils[_0xbd04('0x1e')](dials[_0x41425f[_0xbd04('0xb')]]['answertime']||dials[_0x41425f['uniqueid']][_0xbd04('0x1f')],dials[_0x41425f['uniqueid']][_0xbd04('0x16')]);dials[_0x41425f['uniqueid']][_0xbd04('0x20')]=dials[_0x41425f[_0xbd04('0xb')]][_0xbd04('0x1b')]?utils[_0xbd04('0x1e')](dials[_0x41425f[_0xbd04('0xb')]][_0xbd04('0x1f')],dials[_0x41425f[_0xbd04('0xb')]][_0xbd04('0x1b')]):0x0;writeDB(dials[_0x41425f[_0xbd04('0xb')]]);}}catch(_0x237a6a){utils[_0xbd04('0x21')](_0x237a6a['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index c2022f2..3e5b154 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 _0x6e04=['agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./utils','asterisk','username','password','keepConnected','xdr','disabled','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','close','managerevent','devicestatechange','error'];(function(_0x2545d0,_0x397e79){var _0x10111b=function(_0x2fdcd8){while(--_0x2fdcd8){_0x2545d0['push'](_0x2545d0['shift']());}};_0x10111b(++_0x397e79);}(_0x6e04,0x6b));var _0x46e0=function(_0x15ca1a,_0x30fc82){_0x15ca1a=_0x15ca1a-0x0;var _0x507626=_0x6e04[_0x15ca1a];return _0x507626;};var AsteriskManager=require(_0x46e0('0x0'));var config=require(_0x46e0('0x1'));var utils=require(_0x46e0('0x2'));var ami=new AsteriskManager(config['asterisk']['port'],config[_0x46e0('0x3')]['ip'],config['asterisk'][_0x46e0('0x4')],config[_0x46e0('0x3')][_0x46e0('0x5')],!![]);ami[_0x46e0('0x6')]();if(config[_0x46e0('0x7')]&&config['xdr'][_0x46e0('0x8')]){utils['info'](_0x46e0('0x9'));}else{var agents=require(_0x46e0('0xa'));var calls=require(_0x46e0('0xb'));var queues=require(_0x46e0('0xc'));var recordings=require(_0x46e0('0xd'));var members=require(_0x46e0('0xe'));var dials=require(_0x46e0('0xf'));var transfers=require(_0x46e0('0x10'));var core=require(_0x46e0('0x11'));ami['on'](_0x46e0('0x12'),core[_0x46e0('0x12')]);ami['on'](_0x46e0('0x13'),core[_0x46e0('0x13')]);ami['on'](_0x46e0('0x14'),core[_0x46e0('0x14')]);ami['on']('error',core['error']);ami['on'](_0x46e0('0x15'),core[_0x46e0('0x15')]);ami['on'](_0x46e0('0x16'),core[_0x46e0('0x16')]);ami['on'](_0x46e0('0x17'),function(_0x1c6038){try{members[_0x46e0('0x17')](_0x1c6038);}catch(_0x5c4d94){utils[_0x46e0('0x18')](_0x5c4d94);}});ami['on'](_0x46e0('0x19'),function(_0x5387ae){try{agents['agentcalled'](_0x5387ae);}catch(_0x4008ba){utils['error'](_0x4008ba);}});ami['on'](_0x46e0('0x1a'),function(_0x5628d0){try{agents[_0x46e0('0x1a')](_0x5628d0);}catch(_0x570245){utils['error'](_0x570245);}});ami['on'](_0x46e0('0x1b'),function(_0x226878){try{agents['agentconnect'](_0x226878);queues[_0x46e0('0x1b')](_0x226878);}catch(_0x1c75e5){utils['error'](_0x1c75e5);}});ami['on'](_0x46e0('0x1c'),function(_0x5393f3){try{agents['agentcomplete'](_0x5393f3);queues[_0x46e0('0x1c')](_0x5393f3);members[_0x46e0('0x1c')](_0x5393f3);}catch(_0x35e765){utils[_0x46e0('0x18')](_0x35e765);}});ami['on'](_0x46e0('0x1d'),function(_0x54dd16){try{agents['queuecallerabandon'](_0x54dd16);queues['queuecallerabandon'](_0x54dd16);}catch(_0x49c5d6){utils[_0x46e0('0x18')](_0x49c5d6);}});ami['on']('queuecallerjoin',function(_0x2d7228){try{queues[_0x46e0('0x1e')](_0x2d7228);recordings['queuecallerjoin'](_0x2d7228);}catch(_0x1f50b0){utils[_0x46e0('0x18')](_0x1f50b0);}});ami['on'](_0x46e0('0x1f'),function(_0x307ac4){try{queues['queuecallerleave'](_0x307ac4);}catch(_0x10547d){utils[_0x46e0('0x18')](_0x10547d);}});ami['on'](_0x46e0('0x20'),function(_0x2f9117){try{queues[_0x46e0('0x20')](_0x2f9117);calls[_0x46e0('0x20')](_0x2f9117);}catch(_0xa70b86){utils[_0x46e0('0x18')](_0xa70b86);}});ami['on'](_0x46e0('0x21'),function(_0x41497b){try{queues[_0x46e0('0x21')](_0x41497b);calls[_0x46e0('0x21')](_0x41497b);}catch(_0xceb3fc){utils['error'](_0xceb3fc);}});ami['on'](_0x46e0('0x22'),function(_0x1532dc){try{calls[_0x46e0('0x22')](_0x1532dc);recordings[_0x46e0('0x22')](_0x1532dc);}catch(_0x4381b1){utils[_0x46e0('0x18')](_0x4381b1);}});ami['on'](_0x46e0('0x23'),function(_0x2e1c5e){try{calls[_0x46e0('0x23')](_0x2e1c5e);recordings[_0x46e0('0x23')](_0x2e1c5e);dials[_0x46e0('0x23')](_0x2e1c5e);agents['hangup'](_0x2e1c5e);queues[_0x46e0('0x23')](_0x2e1c5e);}catch(_0xa6bd6f){utils['error'](_0xa6bd6f);}});ami['on'](_0x46e0('0x24'),function(_0xcd87c2){try{members['cdr'](_0xcd87c2);}catch(_0x966f20){utils[_0x46e0('0x18')](_0x966f20);}});ami['on']('blindtransfer',function(_0x58db07){try{queues[_0x46e0('0x25')](_0x58db07);agents[_0x46e0('0x25')](_0x58db07);transfers[_0x46e0('0x25')](_0x58db07);}catch(_0x436f6c){utils['error'](_0x436f6c);}});ami['on'](_0x46e0('0x26'),function(_0x10a323){try{queues[_0x46e0('0x26')](_0x10a323);transfers['attendedtransfer'](_0x10a323);agents[_0x46e0('0x26')](_0x10a323);calls[_0x46e0('0x26')](_0x10a323);}catch(_0x2d1dbb){utils[_0x46e0('0x18')](_0x2d1dbb);}});ami['on'](_0x46e0('0x27'),function(_0x5b0e61){try{queues[_0x46e0('0x27')](_0x5b0e61);recordings[_0x46e0('0x27')](_0x5b0e61);calls[_0x46e0('0x27')](_0x5b0e61);dials['varset'](_0x5b0e61);}catch(_0x50b5a5){utils['error'](_0x50b5a5);}});ami['on'](_0x46e0('0x28'),function(_0x3ba088){try{calls[_0x46e0('0x28')](_0x3ba088);recordings['newexten'](_0x3ba088);dials[_0x46e0('0x28')](_0x3ba088);}catch(_0x38e796){utils['error'](_0x38e796);}});ami['on'](_0x46e0('0x29'),function(_0x27f7da){try{calls['newchannel'](_0x27f7da);recordings[_0x46e0('0x29')](_0x27f7da);}catch(_0x5606f5){utils[_0x46e0('0x18')](_0x5606f5);}});ami['on']('dialbegin',function(_0x32908e){try{dials[_0x46e0('0x2a')](_0x32908e);}catch(_0x19ee36){utils[_0x46e0('0x18')](_0x19ee36);}});ami['on'](_0x46e0('0x2b'),function(_0x4773c2){try{dials[_0x46e0('0x2b')](_0x4773c2);}catch(_0x45f4f6){utils[_0x46e0('0x18')](_0x45f4f6);}});} \ No newline at end of file +var _0x33d2=['musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./utils','asterisk','port','password','keepConnected','xdr','disabled','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave'];(function(_0x599a04,_0x39b314){var _0x450baa=function(_0x59a656){while(--_0x59a656){_0x599a04['push'](_0x599a04['shift']());}};_0x450baa(++_0x39b314);}(_0x33d2,0x164));var _0x233d=function(_0x4973ff,_0x30abe4){_0x4973ff=_0x4973ff-0x0;var _0x4dd6b6=_0x33d2[_0x4973ff];return _0x4dd6b6;};var AsteriskManager=require(_0x233d('0x0'));var config=require(_0x233d('0x1'));var utils=require(_0x233d('0x2'));var ami=new AsteriskManager(config[_0x233d('0x3')][_0x233d('0x4')],config[_0x233d('0x3')]['ip'],config['asterisk']['username'],config[_0x233d('0x3')][_0x233d('0x5')],!![]);ami[_0x233d('0x6')]();if(config[_0x233d('0x7')]&&config[_0x233d('0x7')][_0x233d('0x8')]){utils['info'](_0x233d('0x9'));}else{var agents=require(_0x233d('0xa'));var calls=require(_0x233d('0xb'));var queues=require(_0x233d('0xc'));var recordings=require('./recordings.controller');var members=require(_0x233d('0xd'));var dials=require(_0x233d('0xe'));var transfers=require(_0x233d('0xf'));var core=require(_0x233d('0x10'));ami['on'](_0x233d('0x11'),core[_0x233d('0x11')]);ami['on'](_0x233d('0x12'),core[_0x233d('0x12')]);ami['on'](_0x233d('0x13'),core[_0x233d('0x13')]);ami['on'](_0x233d('0x14'),core['error']);ami['on']('close',core[_0x233d('0x15')]);ami['on'](_0x233d('0x16'),core[_0x233d('0x16')]);ami['on'](_0x233d('0x17'),function(_0x184bea){try{members['devicestatechange'](_0x184bea);}catch(_0x1a3d0c){utils[_0x233d('0x14')](_0x1a3d0c);}});ami['on'](_0x233d('0x18'),function(_0x280b42){try{agents['agentcalled'](_0x280b42);}catch(_0x14cd01){utils[_0x233d('0x14')](_0x14cd01);}});ami['on'](_0x233d('0x19'),function(_0x3d3f94){try{agents[_0x233d('0x19')](_0x3d3f94);}catch(_0x51959e){utils[_0x233d('0x14')](_0x51959e);}});ami['on'](_0x233d('0x1a'),function(_0x7614e1){try{agents[_0x233d('0x1a')](_0x7614e1);queues[_0x233d('0x1a')](_0x7614e1);}catch(_0x132aef){utils[_0x233d('0x14')](_0x132aef);}});ami['on']('agentcomplete',function(_0x3e03ae){try{agents[_0x233d('0x1b')](_0x3e03ae);queues[_0x233d('0x1b')](_0x3e03ae);members[_0x233d('0x1b')](_0x3e03ae);}catch(_0x54d6e6){utils[_0x233d('0x14')](_0x54d6e6);}});ami['on'](_0x233d('0x1c'),function(_0x2b63d1){try{agents[_0x233d('0x1c')](_0x2b63d1);queues[_0x233d('0x1c')](_0x2b63d1);}catch(_0x872dde){utils['error'](_0x872dde);}});ami['on'](_0x233d('0x1d'),function(_0x3792a0){try{queues[_0x233d('0x1d')](_0x3792a0);recordings['queuecallerjoin'](_0x3792a0);}catch(_0x4b5b0b){utils['error'](_0x4b5b0b);}});ami['on'](_0x233d('0x1e'),function(_0x53c714){try{queues[_0x233d('0x1e')](_0x53c714);}catch(_0x304164){utils[_0x233d('0x14')](_0x304164);}});ami['on'](_0x233d('0x1f'),function(_0x5eb523){try{queues['musiconholdstart'](_0x5eb523);calls['musiconholdstart'](_0x5eb523);}catch(_0x2df8b3){utils[_0x233d('0x14')](_0x2df8b3);}});ami['on'](_0x233d('0x20'),function(_0x4fe215){try{queues[_0x233d('0x20')](_0x4fe215);calls['musiconholdstop'](_0x4fe215);}catch(_0x366e4d){utils[_0x233d('0x14')](_0x366e4d);}});ami['on'](_0x233d('0x21'),function(_0x2ff465){try{calls[_0x233d('0x21')](_0x2ff465);recordings[_0x233d('0x21')](_0x2ff465);}catch(_0x30dc9a){utils[_0x233d('0x14')](_0x30dc9a);}});ami['on'](_0x233d('0x22'),function(_0x2fcd6d){try{calls[_0x233d('0x22')](_0x2fcd6d);recordings[_0x233d('0x22')](_0x2fcd6d);dials[_0x233d('0x22')](_0x2fcd6d);agents['hangup'](_0x2fcd6d);queues[_0x233d('0x22')](_0x2fcd6d);}catch(_0x279b40){utils['error'](_0x279b40);}});ami['on'](_0x233d('0x23'),function(_0x14e77b){try{members[_0x233d('0x23')](_0x14e77b);}catch(_0xb4b480){utils[_0x233d('0x14')](_0xb4b480);}});ami['on']('blindtransfer',function(_0x5183d5){try{queues[_0x233d('0x24')](_0x5183d5);agents[_0x233d('0x24')](_0x5183d5);transfers['blindtransfer'](_0x5183d5);}catch(_0x37a475){utils['error'](_0x37a475);}});ami['on'](_0x233d('0x25'),function(_0x27956b){try{queues['attendedtransfer'](_0x27956b);transfers[_0x233d('0x25')](_0x27956b);agents[_0x233d('0x25')](_0x27956b);calls['attendedtransfer'](_0x27956b);}catch(_0x12dc6f){utils[_0x233d('0x14')](_0x12dc6f);}});ami['on']('varset',function(_0x23d9ce){try{queues[_0x233d('0x26')](_0x23d9ce);recordings[_0x233d('0x26')](_0x23d9ce);calls['varset'](_0x23d9ce);dials[_0x233d('0x26')](_0x23d9ce);}catch(_0x33654d){utils['error'](_0x33654d);}});ami['on'](_0x233d('0x27'),function(_0x651ecf){try{calls[_0x233d('0x27')](_0x651ecf);recordings[_0x233d('0x27')](_0x651ecf);dials[_0x233d('0x27')](_0x651ecf);}catch(_0x420c39){utils[_0x233d('0x14')](_0x420c39);}});ami['on']('newchannel',function(_0x30f836){try{calls[_0x233d('0x28')](_0x30f836);recordings[_0x233d('0x28')](_0x30f836);}catch(_0x57d18f){utils[_0x233d('0x14')](_0x57d18f);}});ami['on'](_0x233d('0x29'),function(_0x26c7da){try{dials[_0x233d('0x29')](_0x26c7da);}catch(_0x264acf){utils[_0x233d('0x14')](_0x264acf);}});ami['on'](_0x233d('0x2a'),function(_0x2b428f){try{dials[_0x233d('0x2a')](_0x2b428f);}catch(_0x2d0931){utils[_0x233d('0x14')](_0x2d0931);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 7b2ac04..ae12e5f 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 _0x04c5=['info','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','channel','membername','type','getUserByInterface','interface','then','internal','request','CreateMemberReport','getUserByName','name','catch','some','startsWith','devicestatechange','state','INUSE','device','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','enterAt','agentcomplete','cdr','assign','data1','data2','source','data3','destination','split','lodash','util','./utils','Local/_attended@transfer'];(function(_0x5bf2b3,_0xfcd364){var _0x5e8a9b=function(_0x43546b){while(--_0x43546b){_0x5bf2b3['push'](_0x5bf2b3['shift']());}};_0x5e8a9b(++_0xfcd364);}(_0x04c5,0x154));var _0x504c=function(_0x45abc9,_0x16fdf2){_0x45abc9=_0x45abc9-0x0;var _0x1aff1b=_0x04c5[_0x45abc9];return _0x1aff1b;};'use strict';var _=require(_0x504c('0x0'));var util=require(_0x504c('0x1'));var utils=require(_0x504c('0x2'));var members={};var exclude=[_0x504c('0x3'),'Queue:'];function writeDB(_0x1d0a0d){utils[_0x504c('0x4')](util['format'](_0x504c('0x5'),_0x1d0a0d[_0x504c('0x6')],_0x1d0a0d['interface'],_0x1d0a0d[_0x504c('0x7')],_0x1d0a0d['data2'],_0x1d0a0d[_0x504c('0x8')],_0x1d0a0d[_0x504c('0x9')]));if(_0x1d0a0d['interface']){utils[_0x504c('0xa')](_0x1d0a0d[_0x504c('0xb')])[_0x504c('0xc')](function(_0x2a4f28){if(_0x2a4f28){_0x1d0a0d[_0x504c('0x8')]=_0x2a4f28['name'];_0x1d0a0d[_0x504c('0xd')]=_0x2a4f28[_0x504c('0xd')];utils[_0x504c('0xe')](_0x504c('0xf'),_0x1d0a0d);}else{utils[_0x504c('0x10')](_0x1d0a0d[_0x504c('0xb')]['split']('/')[0x1])[_0x504c('0xc')](function(_0x3f8610){if(_0x3f8610){_0x1d0a0d[_0x504c('0x8')]=_0x3f8610[_0x504c('0x11')];_0x1d0a0d[_0x504c('0xd')]=_0x3f8610[_0x504c('0xd')];utils[_0x504c('0xe')](_0x504c('0xf'),_0x1d0a0d);}});}})[_0x504c('0x12')](function(_0x89b032){utils['error'](_0x89b032);});}delete members[_0x1d0a0d[_0x504c('0xb')]];}function startsWith(_0x42a8ff,_0x4bd4c9){return _[_0x504c('0x13')](_0x42a8ff,function(_0xb0de2d){return _[_0x504c('0x14')](_0x4bd4c9,_0xb0de2d);});}exports[_0x504c('0x15')]=function(_0x450f2f){switch(_0x450f2f[_0x504c('0x16')]){case _0x504c('0x17'):case'BUSY':if(!startsWith(exclude,_0x450f2f[_0x504c('0x18')])){members[_0x450f2f[_0x504c('0x18')]]={'channel':_0x504c('0x19'),'interface':_0x450f2f[_0x504c('0x18')],'type':_0x504c('0x1a'),'enterAt':utils[_0x504c('0x1b')](),'role':_0x504c('0x1c')};}break;case _0x504c('0x1d'):if(!_[_0x504c('0x1e')](members[_0x450f2f[_0x504c('0x18')]])){members[_0x450f2f[_0x504c('0x18')]][_0x504c('0x1f')]=utils['now']();members[_0x450f2f[_0x504c('0x18')]][_0x504c('0x20')]=utils['diffTime'](members[_0x450f2f[_0x504c('0x18')]][_0x504c('0x1f')],members[_0x450f2f[_0x504c('0x18')]][_0x504c('0x21')]);if(members[_0x450f2f['device']][_0x504c('0x6')]){writeDB(members[_0x450f2f['device']]);}}default:break;}};exports[_0x504c('0x22')]=function(_0x3f3b25){if(!_[_0x504c('0x1e')](members[_0x3f3b25[_0x504c('0xb')]])){members[_0x3f3b25['interface']]=_['assign'](members[_0x3f3b25['interface']],{'data4':_0x3f3b25['queue'],'uniqueid':_0x3f3b25['uniqueid']});}};exports[_0x504c('0x23')]=function(_0x3290b3){if(_0x3290b3[_0x504c('0x7')]){var _0x121472=_0x3290b3[_0x504c('0x7')]['split']('-')[0x0];if(!_[_0x504c('0x1e')](members[_0x121472])){members[_0x121472]=_[_0x504c('0x24')](members[_0x121472],{'data1':members[_0x121472][_0x504c('0x25')]||_0x3290b3[_0x504c('0x9')],'data2':members[_0x121472][_0x504c('0x26')]||_0x3290b3[_0x504c('0x27')],'data3':members[_0x121472][_0x504c('0x28')]||_0x3290b3[_0x504c('0x29')],'uniqueid':members[_0x121472][_0x504c('0x6')]||_0x3290b3[_0x504c('0x6')]});if(members[_0x121472][_0x504c('0x1f')]){writeDB(members[_0x121472]);}}}if(_0x3290b3['destinationchannel']){var _0x28cab3=_0x3290b3['destinationchannel'][_0x504c('0x2a')]('-')[0x0];if(!_['isNil'](members[_0x28cab3])){members[_0x28cab3]=_[_0x504c('0x24')](members[_0x28cab3],{'data1':members[_0x28cab3][_0x504c('0x25')]||_0x3290b3[_0x504c('0x9')],'data2':members[_0x28cab3]['data2']||_0x3290b3[_0x504c('0x27')],'data3':members[_0x28cab3][_0x504c('0x28')]||_0x3290b3[_0x504c('0x29')],'uniqueid':members[_0x28cab3][_0x504c('0x6')]||_0x3290b3[_0x504c('0x6')]});if(members[_0x28cab3]['exitAt']){writeDB(members[_0x28cab3]);}}}}; \ No newline at end of file +var _0xef45=['startsWith','devicestatechange','INUSE','BUSY','device','voice','TALKING','now','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','assign','queue','cdr','data1','data3','destinationchannel','source','destination','lodash','util','./utils','Local/_attended@transfer','Queue:','info','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','channel','data2','membername','type','interface','name','internal','CreateMemberReport','getUserByName','split','then','catch','error','some'];(function(_0xbed6a1,_0x5e2f5b){var _0x45c834=function(_0x3a12f9){while(--_0x3a12f9){_0xbed6a1['push'](_0xbed6a1['shift']());}};_0x45c834(++_0x5e2f5b);}(_0xef45,0x1ce));var _0x5ef4=function(_0x569a68,_0x10542b){_0x569a68=_0x569a68-0x0;var _0x346026=_0xef45[_0x569a68];return _0x346026;};'use strict';var _=require(_0x5ef4('0x0'));var util=require(_0x5ef4('0x1'));var utils=require(_0x5ef4('0x2'));var members={};var exclude=[_0x5ef4('0x3'),_0x5ef4('0x4')];function writeDB(_0x5603ce){utils[_0x5ef4('0x5')](util['format'](_0x5ef4('0x6'),_0x5603ce[_0x5ef4('0x7')],_0x5603ce['interface'],_0x5603ce[_0x5ef4('0x8')],_0x5603ce[_0x5ef4('0x9')],_0x5603ce[_0x5ef4('0xa')],_0x5603ce[_0x5ef4('0xb')]));if(_0x5603ce[_0x5ef4('0xc')]){utils['getUserByInterface'](_0x5603ce[_0x5ef4('0xc')])['then'](function(_0x30ee93){if(_0x30ee93){_0x5603ce[_0x5ef4('0xa')]=_0x30ee93[_0x5ef4('0xd')];_0x5603ce[_0x5ef4('0xe')]=_0x30ee93['internal'];utils['request'](_0x5ef4('0xf'),_0x5603ce);}else{utils[_0x5ef4('0x10')](_0x5603ce['interface'][_0x5ef4('0x11')]('/')[0x1])[_0x5ef4('0x12')](function(_0x59c7cd){if(_0x59c7cd){_0x5603ce[_0x5ef4('0xa')]=_0x59c7cd[_0x5ef4('0xd')];_0x5603ce[_0x5ef4('0xe')]=_0x59c7cd['internal'];utils['request'](_0x5ef4('0xf'),_0x5603ce);}});}})[_0x5ef4('0x13')](function(_0x4c24c0){utils[_0x5ef4('0x14')](_0x4c24c0);});}delete members[_0x5603ce[_0x5ef4('0xc')]];}function startsWith(_0x98631a,_0x1c2934){return _[_0x5ef4('0x15')](_0x98631a,function(_0x2ac3f6){return _[_0x5ef4('0x16')](_0x1c2934,_0x2ac3f6);});}exports[_0x5ef4('0x17')]=function(_0xb108f4){switch(_0xb108f4['state']){case _0x5ef4('0x18'):case _0x5ef4('0x19'):if(!startsWith(exclude,_0xb108f4[_0x5ef4('0x1a')])){members[_0xb108f4[_0x5ef4('0x1a')]]={'channel':_0x5ef4('0x1b'),'interface':_0xb108f4['device'],'type':_0x5ef4('0x1c'),'enterAt':utils[_0x5ef4('0x1d')](),'role':'agent'};}break;case'NOT_INUSE':if(!_[_0x5ef4('0x1e')](members[_0xb108f4['device']])){members[_0xb108f4[_0x5ef4('0x1a')]][_0x5ef4('0x1f')]=utils[_0x5ef4('0x1d')]();members[_0xb108f4['device']][_0x5ef4('0x20')]=utils[_0x5ef4('0x21')](members[_0xb108f4['device']][_0x5ef4('0x1f')],members[_0xb108f4[_0x5ef4('0x1a')]][_0x5ef4('0x22')]);if(members[_0xb108f4[_0x5ef4('0x1a')]][_0x5ef4('0x7')]){writeDB(members[_0xb108f4['device']]);}}default:break;}};exports[_0x5ef4('0x23')]=function(_0x3d2da5){if(!_[_0x5ef4('0x1e')](members[_0x3d2da5[_0x5ef4('0xc')]])){members[_0x3d2da5['interface']]=_[_0x5ef4('0x24')](members[_0x3d2da5[_0x5ef4('0xc')]],{'data4':_0x3d2da5[_0x5ef4('0x25')],'uniqueid':_0x3d2da5[_0x5ef4('0x7')]});}};exports[_0x5ef4('0x26')]=function(_0x38dd6d){if(_0x38dd6d[_0x5ef4('0x8')]){var _0x3797df=_0x38dd6d[_0x5ef4('0x8')][_0x5ef4('0x11')]('-')[0x0];if(!_['isNil'](members[_0x3797df])){members[_0x3797df]=_[_0x5ef4('0x24')](members[_0x3797df],{'data1':members[_0x3797df][_0x5ef4('0x27')]||_0x38dd6d[_0x5ef4('0xb')],'data2':members[_0x3797df]['data2']||_0x38dd6d['source'],'data3':members[_0x3797df][_0x5ef4('0x28')]||_0x38dd6d['destination'],'uniqueid':members[_0x3797df][_0x5ef4('0x7')]||_0x38dd6d['uniqueid']});if(members[_0x3797df][_0x5ef4('0x1f')]){writeDB(members[_0x3797df]);}}}if(_0x38dd6d[_0x5ef4('0x29')]){var _0x14edd9=_0x38dd6d[_0x5ef4('0x29')]['split']('-')[0x0];if(!_[_0x5ef4('0x1e')](members[_0x14edd9])){members[_0x14edd9]=_['assign'](members[_0x14edd9],{'data1':members[_0x14edd9][_0x5ef4('0x27')]||_0x38dd6d[_0x5ef4('0xb')],'data2':members[_0x14edd9][_0x5ef4('0x9')]||_0x38dd6d[_0x5ef4('0x2a')],'data3':members[_0x14edd9][_0x5ef4('0x28')]||_0x38dd6d[_0x5ef4('0x2b')],'uniqueid':members[_0x14edd9][_0x5ef4('0x7')]||_0x38dd6d[_0x5ef4('0x7')]});if(members[_0x14edd9][_0x5ef4('0x1f')]){writeDB(members[_0x14edd9]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 65dde3e..b679d4b 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 _0x2713=['info','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','position','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallercompleteAt','now','COMPLETEDBYAGENT','queuecallerenterreason','varset','variable','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','toUpperCase','queueposition','EXITWITHKEY','ABANDONED','queuecallerleave','holdtime','diffTime','count','connectedlinenum','connectedlinename','destaccountcode','membername','queuecallercomplete','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','queuecallerjoinAt','transferuniqueid','secondtransfereruniqueid','transfertargetlinkedid','mohtime','error','stack','musiconholdstart','musiconholdstartAt','musiconholdstop','lodash','util','./utils'];(function(_0x4ea444,_0x56dde4){var _0x52b1e0=function(_0x53c37c){while(--_0x53c37c){_0x4ea444['push'](_0x4ea444['shift']());}};_0x52b1e0(++_0x56dde4);}(_0x2713,0x99));var _0x3271=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2713[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x3271('0x0'));var util=require(_0x3271('0x1'));var utils=require(_0x3271('0x2'));var queues={};function writeDB(_0x14ff96){utils[_0x3271('0x3')](util['format'](_0x3271('0x4'),_0x14ff96[_0x3271('0x5')],_0x14ff96[_0x3271('0x6')],_0x14ff96[_0x3271('0x7')],_0x14ff96[_0x3271('0x8')],_0x14ff96['calleridnum'],_0x14ff96[_0x3271('0x9')],_0x14ff96[_0x3271('0xa')]));if(_0x14ff96[_0x3271('0x7')]){utils[_0x3271('0xb')](_0x14ff96[_0x3271('0x7')])[_0x3271('0xc')](function(_0x35d097){if(_0x35d097){_0x14ff96[_0x3271('0xd')]=_0x35d097['type'];}utils[_0x3271('0xe')](_0x3271('0xf'),_0x14ff96);});}else{utils['request'](_0x3271('0xf'),_0x14ff96);}if(_0x14ff96[_0x3271('0x10')]){delete queues[_0x14ff96['transfereduniqueid']];}else{delete queues[_0x14ff96[_0x3271('0x5')]];}}exports[_0x3271('0x11')]=function(_0x456cac){queues[_0x456cac[_0x3271('0x5')]]=_['assign'](_0x456cac,{'originalposition':_0x456cac[_0x3271('0x12')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});};exports[_0x3271('0x13')]=function(_0x329741){if(!_[_0x3271('0x14')](queues[_0x329741[_0x3271('0x5')]])){if(queues[_0x329741[_0x3271('0x5')]][_0x3271('0x15')]){if(!queues[_0x329741[_0x3271('0x5')]][_0x3271('0x16')]&&!queues[_0x329741[_0x3271('0x5')]]['queuecallerexit']){queues[_0x329741[_0x3271('0x5')]]['queuecallercomplete']=!![];queues[_0x329741[_0x3271('0x5')]][_0x3271('0x17')]=utils[_0x3271('0x18')]();queues[_0x329741[_0x3271('0x5')]][_0x3271('0xa')]=_0x3271('0x19');}writeDB(queues[_0x329741[_0x3271('0x5')]]);}else{if(queues[_0x329741[_0x3271('0x5')]]['transfereduniqueid']){queues[queues[_0x329741[_0x3271('0x5')]][_0x3271('0x10')]]=queues[_0x329741[_0x3271('0x5')]];queues[queues[_0x329741[_0x3271('0x5')]]['transfereduniqueid']][_0x3271('0x1a')]=0x2;delete queues[_0x329741[_0x3271('0x5')]];}}}};exports[_0x3271('0x1b')]=function(_0x57628f){if(!_[_0x3271('0x14')](_0x57628f[_0x3271('0x1c')]['queuestatus'])){if(!_[_0x3271('0x14')](queues[_0x57628f[_0x3271('0x5')]])){queues[_0x57628f[_0x3271('0x5')]][_0x3271('0x16')]=![];queues[_0x57628f[_0x3271('0x5')]][_0x3271('0x1d')]=null;queues[_0x57628f[_0x3271('0x5')]][_0x3271('0x1e')]=!![];queues[_0x57628f[_0x3271('0x5')]][_0x3271('0x1f')]=utils[_0x3271('0x18')]();queues[_0x57628f[_0x3271('0x5')]]['queuecallerexitreason']=_0x57628f['value'][_0x3271('0x20')]();writeDB(queues[_0x57628f[_0x3271('0x5')]]);}}else if(!_['isNil'](_0x57628f[_0x3271('0x1c')][_0x3271('0x21')])){if(!_[_0x3271('0x14')](queues[_0x57628f[_0x3271('0x5')]])&&!queues[_0x57628f[_0x3271('0x5')]][_0x3271('0x16')]){queues[_0x57628f[_0x3271('0x5')]]['queuecallerabandon']=![];queues[_0x57628f[_0x3271('0x5')]][_0x3271('0x1d')]=null;queues[_0x57628f[_0x3271('0x5')]][_0x3271('0x1e')]=!![];queues[_0x57628f[_0x3271('0x5')]][_0x3271('0x1f')]=utils[_0x3271('0x18')]();queues[_0x57628f['uniqueid']][_0x3271('0xa')]=_0x3271('0x22');}}};exports[_0x3271('0x16')]=function(_0x28c6d8){if(!_[_0x3271('0x14')](queues[_0x28c6d8[_0x3271('0x5')]])){queues[_0x28c6d8[_0x3271('0x5')]][_0x3271('0x1e')]=![];queues[_0x28c6d8[_0x3271('0x5')]][_0x3271('0x1f')]=null;queues[_0x28c6d8[_0x3271('0x5')]]['queuecallerabandon']=!![];queues[_0x28c6d8['uniqueid']][_0x3271('0x1d')]=utils[_0x3271('0x18')]();queues[_0x28c6d8['uniqueid']]['queuecallerexitreason']=_0x3271('0x23');}};exports[_0x3271('0x24')]=function(_0x15031d){if(!_[_0x3271('0x14')](queues[_0x15031d[_0x3271('0x5')]])){queues[_0x15031d[_0x3271('0x5')]][_0x3271('0x24')]=!![];queues[_0x15031d[_0x3271('0x5')]][_0x3271('0x15')]=utils[_0x3271('0x18')]();queues[_0x15031d[_0x3271('0x5')]][_0x3271('0x25')]=utils[_0x3271('0x26')](queues[_0x15031d[_0x3271('0x5')]]['queuecallerleaveAt'],queues[_0x15031d[_0x3271('0x5')]]['queuecallerjoinAt']);queues[_0x15031d[_0x3271('0x5')]][_0x3271('0x12')]=_0x15031d[_0x3271('0x12')];queues[_0x15031d[_0x3271('0x5')]][_0x3271('0x27')]=_0x15031d[_0x3271('0x27')];queues[_0x15031d[_0x3271('0x5')]][_0x3271('0x28')]=_0x15031d[_0x3271('0x28')];queues[_0x15031d['uniqueid']][_0x3271('0x29')]=_0x15031d[_0x3271('0x29')];}};exports['agentconnect']=function(_0x5bcb20){if(!_[_0x3271('0x14')](queues[_0x5bcb20[_0x3271('0x5')]])){queues[_0x5bcb20[_0x3271('0x5')]][_0x3271('0x16')]=![];queues[_0x5bcb20[_0x3271('0x5')]][_0x3271('0x16')]=![];queues[_0x5bcb20[_0x3271('0x5')]][_0x3271('0x1d')]=null;queues[_0x5bcb20[_0x3271('0x5')]][_0x3271('0x1e')]=![];queues[_0x5bcb20[_0x3271('0x5')]][_0x3271('0x1f')]=null;queues[_0x5bcb20[_0x3271('0x5')]]['assigned']=!![];queues[_0x5bcb20[_0x3271('0x5')]][_0x3271('0x9')]=_0x5bcb20[_0x3271('0x2a')];queues[_0x5bcb20[_0x3271('0x5')]]['lastAssignedTo']=_0x5bcb20[_0x3271('0x2b')];}};exports['agentcomplete']=function(_0x5a4a46){if(!_[_0x3271('0x14')](queues[_0x5a4a46[_0x3271('0x5')]])){if(queues[_0x5a4a46[_0x3271('0x5')]][_0x3271('0x15')]){queues[_0x5a4a46[_0x3271('0x5')]]['queuecallerabandon']=![];queues[_0x5a4a46['uniqueid']]['queuecallerabandon']=![];queues[_0x5a4a46[_0x3271('0x5')]][_0x3271('0x1d')]=null;queues[_0x5a4a46['uniqueid']]['queuecallerexit']=![];queues[_0x5a4a46['uniqueid']][_0x3271('0x1f')]=null;queues[_0x5a4a46[_0x3271('0x5')]]['assigned']=!![];queues[_0x5a4a46[_0x3271('0x5')]][_0x3271('0x8')]=_0x5a4a46[_0x3271('0x2b')];queues[_0x5a4a46[_0x3271('0x5')]][_0x3271('0x2c')]=!![];queues[_0x5a4a46[_0x3271('0x5')]]['queuecallercompleteAt']=utils[_0x3271('0x18')]();if(_0x5a4a46[_0x3271('0x2d')]=='transfer'){if(!queues[_0x5a4a46[_0x3271('0x5')]][_0x3271('0x2e')]){queues[_0x5a4a46[_0x3271('0x5')]][_0x3271('0xa')]=_0x3271('0x2f');}}else{queues[_0x5a4a46['uniqueid']][_0x3271('0xa')]=_0x3271('0x30')+_0x5a4a46[_0x3271('0x2d')]['toUpperCase']();}writeDB(queues[_0x5a4a46[_0x3271('0x5')]]);}}};exports[_0x3271('0x31')]=function(_0x3f8e81){if(!_['isNil'](queues[_0x3f8e81[_0x3271('0x32')]])){queues[_0x3f8e81[_0x3271('0x32')]]['transfer']=!![];queues[_0x3f8e81['transfereeuniqueid']][_0x3271('0x33')]=_0x3271('0x34');queues[_0x3f8e81['transfereeuniqueid']][_0x3271('0x35')]=_0x3f8e81[_0x3271('0x36')];queues[_0x3f8e81[_0x3271('0x32')]]['transferuniqueid']=_0x3f8e81[_0x3271('0x32')];queues[_0x3f8e81[_0x3271('0x32')]]['queuecallerexitreason']=_0x3271('0x37');}};exports[_0x3271('0x38')]=function(_0x4de722){try{if(_0x4de722[_0x3271('0x39')]==_0x4de722[_0x3271('0x3a')]){if(!_[_0x3271('0x14')](queues[_0x4de722[_0x3271('0x3b')]])){queues[_0x4de722[_0x3271('0x3b')]][_0x3271('0x2e')]=!![];queues[_0x4de722[_0x3271('0x3b')]]['transfertype']=_0x3271('0x3c');queues[_0x4de722['secondtransfererlinkedid']][_0x3271('0x35')]=_0x4de722[_0x3271('0x3d')];queues[_0x4de722[_0x3271('0x3b')]]['transferuniqueid']=_0x4de722[_0x3271('0x39')];queues[_0x4de722[_0x3271('0x3b')]][_0x3271('0xa')]=_0x3271('0x3e');}if(!_[_0x3271('0x14')](queues[_0x4de722[_0x3271('0x3a')]])){if(_0x4de722[_0x3271('0x3f')]&&queues[_0x4de722['transfereelinkedid']]){queues[_0x4de722[_0x3271('0x3f')]]['queuecallerenterreason']=0x1;queues[_0x4de722['transfereeuniqueid']]=_[_0x3271('0x40')](queues[_0x4de722[_0x3271('0x3f')]]);queues[_0x4de722[_0x3271('0x32')]]['transfereduniqueid']=_0x4de722[_0x3271('0x41')];queues[_0x4de722[_0x3271('0x32')]][_0x3271('0x1a')]=0x2;queues[_0x4de722['transfereeuniqueid']][_0x3271('0x42')]=queues[_0x4de722[_0x3271('0x3b')]][_0x3271('0x42')];queues[_0x4de722[_0x3271('0x32')]][_0x3271('0x43')]=queues[_0x4de722[_0x3271('0x3b')]][_0x3271('0x43')];queues[_0x4de722[_0x3271('0x32')]][_0x3271('0x44')]=utils[_0x3271('0x18')]();queues[_0x4de722[_0x3271('0x32')]]['queuecallerleaveAt']=utils['now']();queues[_0x4de722[_0x3271('0x32')]][_0x3271('0x25')]=0x0;queues[_0x4de722[_0x3271('0x32')]]['mohtime']=0x0;}else{queues[_0x4de722[_0x3271('0x3a')]][_0x3271('0x10')]=_0x4de722[_0x3271('0x3b')];}}}else if(_0x4de722['secondtransfereruniqueid']==_0x4de722[_0x3271('0x3b')]){if(!_[_0x3271('0x14')](queues[_0x4de722[_0x3271('0x3a')]])){queues[_0x4de722[_0x3271('0x3a')]][_0x3271('0x2e')]=!![];queues[_0x4de722[_0x3271('0x3a')]]['transfertype']='ATTENDED';queues[_0x4de722[_0x3271('0x3a')]][_0x3271('0x35')]=_0x4de722['secondtransfererexten'];queues[_0x4de722[_0x3271('0x3a')]][_0x3271('0x45')]=_0x4de722[_0x3271('0x46')];queues[_0x4de722[_0x3271('0x3a')]]['queuecallerexitreason']=_0x3271('0x3e');}if(!_['isNil'](queues[_0x4de722['secondtransfererlinkedid']])){if(_0x4de722[_0x3271('0x47')]&&queues[_0x4de722[_0x3271('0x47')]]){queues[_0x4de722[_0x3271('0x47')]][_0x3271('0x1a')]=0x1;queues[_0x4de722[_0x3271('0x41')]]=_[_0x3271('0x40')](queues[_0x4de722[_0x3271('0x47')]]);queues[_0x4de722[_0x3271('0x41')]][_0x3271('0x10')]=_0x4de722[_0x3271('0x41')];queues[_0x4de722[_0x3271('0x41')]][_0x3271('0x1a')]=0x2;queues[_0x4de722[_0x3271('0x41')]][_0x3271('0x42')]=queues[_0x4de722[_0x3271('0x3a')]][_0x3271('0x42')];queues[_0x4de722[_0x3271('0x41')]][_0x3271('0x43')]=queues[_0x4de722['origtransfererlinkedid']][_0x3271('0x43')];queues[_0x4de722[_0x3271('0x41')]][_0x3271('0x44')]=utils['now']();queues[_0x4de722[_0x3271('0x41')]][_0x3271('0x15')]=utils[_0x3271('0x18')]();queues[_0x4de722[_0x3271('0x41')]]['holdtime']=0x0;queues[_0x4de722[_0x3271('0x41')]][_0x3271('0x48')]=0x0;}else{queues[_0x4de722[_0x3271('0x3b')]][_0x3271('0x10')]=_0x4de722[_0x3271('0x3a')];}}}}catch(_0xbce390){utils[_0x3271('0x49')](_0xbce390[_0x3271('0x4a')]);}};exports[_0x3271('0x4b')]=function(_0x596c21){if(!_[_0x3271('0x14')](queues[_0x596c21[_0x3271('0x5')]])){queues[_0x596c21['uniqueid']][_0x3271('0x4c')]=utils['now']();}};exports[_0x3271('0x4d')]=function(_0x3e4353){if(!_['isNil'](queues[_0x3e4353[_0x3271('0x5')]])){if(!_[_0x3271('0x14')](queues[_0x3e4353[_0x3271('0x5')]]['musiconholdstartAt'])){queues[_0x3e4353[_0x3271('0x5')]]['mohtime']+=utils[_0x3271('0x26')](utils['now'](),queues[_0x3e4353[_0x3271('0x5')]]['musiconholdstartAt']);delete queues[_0x3e4353[_0x3271('0x5')]][_0x3271('0x4c')];}}}; \ No newline at end of file +var _0x9ba4=['queuecallerleave','diffTime','queuecallerjoinAt','count','connectedlinenum','agentconnect','queuecallerabandonAt','assigned','lastAssignedTo','membername','agentcomplete','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','BLIND','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','transferexten','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','transfertargetuniqueid','calleridname','holdtime','mohtime','secondtransfererexten','transfertargetlinkedid','stack','musiconholdstart','musiconholdstartAt','musiconholdstop','lodash','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','channel','queue','calleridnum','accountcode','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','queuecallerjoin','uniqueid','assign','position','now','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','transfereduniqueid','variable','queuestatus','queuecallerexitAt','queuecallerexitreason','value','toUpperCase','queueposition','ABANDONED'];(function(_0x588cf2,_0x2e250a){var _0x437057=function(_0x3c75cb){while(--_0x3c75cb){_0x588cf2['push'](_0x588cf2['shift']());}};_0x437057(++_0x2e250a);}(_0x9ba4,0x74));var _0x49ba=function(_0x291f17,_0x16dc3d){_0x291f17=_0x291f17-0x0;var _0xd1965b=_0x9ba4[_0x291f17];return _0xd1965b;};'use strict';var _=require(_0x49ba('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x582695){utils['info'](util[_0x49ba('0x1')](_0x49ba('0x2'),_0x582695['uniqueid'],_0x582695[_0x49ba('0x3')],_0x582695[_0x49ba('0x4')],_0x582695['lastAssignedTo'],_0x582695[_0x49ba('0x5')],_0x582695[_0x49ba('0x6')],_0x582695['queuecallerexitreason']));if(_0x582695[_0x49ba('0x4')]){utils[_0x49ba('0x7')](_0x582695[_0x49ba('0x4')])[_0x49ba('0x8')](function(_0x35c530){if(_0x35c530){_0x582695[_0x49ba('0x9')]=_0x35c530[_0x49ba('0x9')];}utils[_0x49ba('0xa')](_0x49ba('0xb'),_0x582695);});}else{utils[_0x49ba('0xa')]('CreateVoiceQueueReport',_0x582695);}if(_0x582695['transfereduniqueid']){delete queues[_0x582695['transfereduniqueid']];}else{delete queues[_0x582695['uniqueid']];}}exports[_0x49ba('0xc')]=function(_0x5c09f1){queues[_0x5c09f1[_0x49ba('0xd')]]=_[_0x49ba('0xe')](_0x5c09f1,{'originalposition':_0x5c09f1[_0x49ba('0xf')],'queuecallerjoinAt':utils[_0x49ba('0x10')](),'mohtime':0x0});};exports['hangup']=function(_0x5379ca){if(!_[_0x49ba('0x11')](queues[_0x5379ca[_0x49ba('0xd')]])){if(queues[_0x5379ca['uniqueid']][_0x49ba('0x12')]){if(!queues[_0x5379ca['uniqueid']][_0x49ba('0x13')]&&!queues[_0x5379ca[_0x49ba('0xd')]][_0x49ba('0x14')]){queues[_0x5379ca[_0x49ba('0xd')]][_0x49ba('0x15')]=!![];queues[_0x5379ca[_0x49ba('0xd')]]['queuecallercompleteAt']=utils[_0x49ba('0x10')]();queues[_0x5379ca[_0x49ba('0xd')]]['queuecallerexitreason']=_0x49ba('0x16');}writeDB(queues[_0x5379ca[_0x49ba('0xd')]]);}else{if(queues[_0x5379ca['uniqueid']][_0x49ba('0x17')]){queues[queues[_0x5379ca[_0x49ba('0xd')]][_0x49ba('0x17')]]=queues[_0x5379ca[_0x49ba('0xd')]];queues[queues[_0x5379ca[_0x49ba('0xd')]][_0x49ba('0x17')]]['queuecallerenterreason']=0x2;delete queues[_0x5379ca['uniqueid']];}}}};exports['varset']=function(_0x21edcc){if(!_[_0x49ba('0x11')](_0x21edcc[_0x49ba('0x18')][_0x49ba('0x19')])){if(!_['isNil'](queues[_0x21edcc[_0x49ba('0xd')]])){queues[_0x21edcc[_0x49ba('0xd')]][_0x49ba('0x13')]=![];queues[_0x21edcc[_0x49ba('0xd')]]['queuecallerabandonAt']=null;queues[_0x21edcc[_0x49ba('0xd')]][_0x49ba('0x14')]=!![];queues[_0x21edcc[_0x49ba('0xd')]][_0x49ba('0x1a')]=utils[_0x49ba('0x10')]();queues[_0x21edcc['uniqueid']][_0x49ba('0x1b')]=_0x21edcc[_0x49ba('0x1c')][_0x49ba('0x1d')]();writeDB(queues[_0x21edcc[_0x49ba('0xd')]]);}}else if(!_[_0x49ba('0x11')](_0x21edcc[_0x49ba('0x18')][_0x49ba('0x1e')])){if(!_['isNil'](queues[_0x21edcc['uniqueid']])&&!queues[_0x21edcc[_0x49ba('0xd')]]['queuecallerabandon']){queues[_0x21edcc['uniqueid']][_0x49ba('0x13')]=![];queues[_0x21edcc['uniqueid']]['queuecallerabandonAt']=null;queues[_0x21edcc[_0x49ba('0xd')]]['queuecallerexit']=!![];queues[_0x21edcc[_0x49ba('0xd')]][_0x49ba('0x1a')]=utils[_0x49ba('0x10')]();queues[_0x21edcc[_0x49ba('0xd')]]['queuecallerexitreason']='EXITWITHKEY';}}};exports[_0x49ba('0x13')]=function(_0x1e2790){if(!_['isNil'](queues[_0x1e2790['uniqueid']])){queues[_0x1e2790[_0x49ba('0xd')]]['queuecallerexit']=![];queues[_0x1e2790[_0x49ba('0xd')]][_0x49ba('0x1a')]=null;queues[_0x1e2790[_0x49ba('0xd')]][_0x49ba('0x13')]=!![];queues[_0x1e2790['uniqueid']]['queuecallerabandonAt']=utils[_0x49ba('0x10')]();queues[_0x1e2790['uniqueid']][_0x49ba('0x1b')]=_0x49ba('0x1f');}};exports[_0x49ba('0x20')]=function(_0x418767){if(!_[_0x49ba('0x11')](queues[_0x418767[_0x49ba('0xd')]])){queues[_0x418767[_0x49ba('0xd')]][_0x49ba('0x20')]=!![];queues[_0x418767['uniqueid']][_0x49ba('0x12')]=utils[_0x49ba('0x10')]();queues[_0x418767[_0x49ba('0xd')]]['holdtime']=utils[_0x49ba('0x21')](queues[_0x418767[_0x49ba('0xd')]][_0x49ba('0x12')],queues[_0x418767[_0x49ba('0xd')]][_0x49ba('0x22')]);queues[_0x418767[_0x49ba('0xd')]][_0x49ba('0xf')]=_0x418767[_0x49ba('0xf')];queues[_0x418767['uniqueid']][_0x49ba('0x23')]=_0x418767['count'];queues[_0x418767[_0x49ba('0xd')]][_0x49ba('0x24')]=_0x418767[_0x49ba('0x24')];queues[_0x418767[_0x49ba('0xd')]]['connectedlinename']=_0x418767['connectedlinename'];}};exports[_0x49ba('0x25')]=function(_0x1c86c6){if(!_['isNil'](queues[_0x1c86c6[_0x49ba('0xd')]])){queues[_0x1c86c6[_0x49ba('0xd')]][_0x49ba('0x13')]=![];queues[_0x1c86c6['uniqueid']][_0x49ba('0x13')]=![];queues[_0x1c86c6[_0x49ba('0xd')]][_0x49ba('0x26')]=null;queues[_0x1c86c6['uniqueid']]['queuecallerexit']=![];queues[_0x1c86c6[_0x49ba('0xd')]]['queuecallerexitAt']=null;queues[_0x1c86c6[_0x49ba('0xd')]][_0x49ba('0x27')]=!![];queues[_0x1c86c6['uniqueid']]['accountcode']=_0x1c86c6['destaccountcode'];queues[_0x1c86c6[_0x49ba('0xd')]][_0x49ba('0x28')]=_0x1c86c6[_0x49ba('0x29')];}};exports[_0x49ba('0x2a')]=function(_0xcf9f1){if(!_['isNil'](queues[_0xcf9f1['uniqueid']])){if(queues[_0xcf9f1['uniqueid']]['queuecallerleaveAt']){queues[_0xcf9f1['uniqueid']][_0x49ba('0x13')]=![];queues[_0xcf9f1['uniqueid']][_0x49ba('0x13')]=![];queues[_0xcf9f1['uniqueid']][_0x49ba('0x26')]=null;queues[_0xcf9f1[_0x49ba('0xd')]][_0x49ba('0x14')]=![];queues[_0xcf9f1['uniqueid']][_0x49ba('0x1a')]=null;queues[_0xcf9f1[_0x49ba('0xd')]][_0x49ba('0x27')]=!![];queues[_0xcf9f1['uniqueid']][_0x49ba('0x28')]=_0xcf9f1[_0x49ba('0x29')];queues[_0xcf9f1[_0x49ba('0xd')]]['queuecallercomplete']=!![];queues[_0xcf9f1['uniqueid']][_0x49ba('0x2b')]=utils['now']();if(_0xcf9f1[_0x49ba('0x2c')]==_0x49ba('0x2d')){if(!queues[_0xcf9f1[_0x49ba('0xd')]][_0x49ba('0x2d')]){queues[_0xcf9f1[_0x49ba('0xd')]]['queuecallerexitreason']=_0x49ba('0x2e');}}else{queues[_0xcf9f1[_0x49ba('0xd')]][_0x49ba('0x1b')]=_0x49ba('0x2f')+_0xcf9f1[_0x49ba('0x2c')]['toUpperCase']();}writeDB(queues[_0xcf9f1[_0x49ba('0xd')]]);}}};exports[_0x49ba('0x30')]=function(_0x2b7931){if(!_[_0x49ba('0x11')](queues[_0x2b7931[_0x49ba('0x31')]])){queues[_0x2b7931[_0x49ba('0x31')]][_0x49ba('0x2d')]=!![];queues[_0x2b7931[_0x49ba('0x31')]][_0x49ba('0x32')]=_0x49ba('0x33');queues[_0x2b7931[_0x49ba('0x31')]]['transferexten']=_0x2b7931[_0x49ba('0x34')];queues[_0x2b7931['transfereeuniqueid']][_0x49ba('0x35')]=_0x2b7931['transfereeuniqueid'];queues[_0x2b7931[_0x49ba('0x31')]][_0x49ba('0x1b')]='BLINDTRANSFER';}};exports[_0x49ba('0x36')]=function(_0x5e025e){try{if(_0x5e025e[_0x49ba('0x37')]==_0x5e025e[_0x49ba('0x38')]){if(!_[_0x49ba('0x11')](queues[_0x5e025e[_0x49ba('0x39')]])){queues[_0x5e025e[_0x49ba('0x39')]]['transfer']=!![];queues[_0x5e025e[_0x49ba('0x39')]][_0x49ba('0x32')]=_0x49ba('0x3a');queues[_0x5e025e[_0x49ba('0x39')]][_0x49ba('0x3b')]=_0x5e025e[_0x49ba('0x3c')];queues[_0x5e025e['secondtransfererlinkedid']]['transferuniqueid']=_0x5e025e[_0x49ba('0x37')];queues[_0x5e025e['secondtransfererlinkedid']]['queuecallerexitreason']=_0x49ba('0x3d');}if(!_[_0x49ba('0x11')](queues[_0x5e025e['origtransfererlinkedid']])){if(_0x5e025e[_0x49ba('0x3e')]&&queues[_0x5e025e[_0x49ba('0x3e')]]){queues[_0x5e025e[_0x49ba('0x3e')]][_0x49ba('0x3f')]=0x1;queues[_0x5e025e[_0x49ba('0x31')]]=_['clone'](queues[_0x5e025e[_0x49ba('0x3e')]]);queues[_0x5e025e[_0x49ba('0x31')]][_0x49ba('0x17')]=_0x5e025e[_0x49ba('0x40')];queues[_0x5e025e[_0x49ba('0x31')]][_0x49ba('0x3f')]=0x2;queues[_0x5e025e[_0x49ba('0x31')]]['calleridnum']=queues[_0x5e025e[_0x49ba('0x39')]][_0x49ba('0x5')];queues[_0x5e025e[_0x49ba('0x31')]][_0x49ba('0x41')]=queues[_0x5e025e[_0x49ba('0x39')]]['calleridname'];queues[_0x5e025e[_0x49ba('0x31')]]['queuecallerjoinAt']=utils[_0x49ba('0x10')]();queues[_0x5e025e[_0x49ba('0x31')]][_0x49ba('0x12')]=utils[_0x49ba('0x10')]();queues[_0x5e025e[_0x49ba('0x31')]][_0x49ba('0x42')]=0x0;queues[_0x5e025e[_0x49ba('0x31')]][_0x49ba('0x43')]=0x0;}else{queues[_0x5e025e[_0x49ba('0x38')]][_0x49ba('0x17')]=_0x5e025e[_0x49ba('0x39')];}}}else if(_0x5e025e['secondtransfereruniqueid']==_0x5e025e[_0x49ba('0x39')]){if(!_['isNil'](queues[_0x5e025e['origtransfererlinkedid']])){queues[_0x5e025e['origtransfererlinkedid']][_0x49ba('0x2d')]=!![];queues[_0x5e025e[_0x49ba('0x38')]][_0x49ba('0x32')]=_0x49ba('0x3a');queues[_0x5e025e[_0x49ba('0x38')]]['transferexten']=_0x5e025e[_0x49ba('0x44')];queues[_0x5e025e[_0x49ba('0x38')]][_0x49ba('0x35')]=_0x5e025e['secondtransfereruniqueid'];queues[_0x5e025e[_0x49ba('0x38')]][_0x49ba('0x1b')]=_0x49ba('0x3d');}if(!_[_0x49ba('0x11')](queues[_0x5e025e[_0x49ba('0x39')]])){if(_0x5e025e[_0x49ba('0x45')]&&queues[_0x5e025e[_0x49ba('0x45')]]){queues[_0x5e025e['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x5e025e[_0x49ba('0x40')]]=_['clone'](queues[_0x5e025e[_0x49ba('0x45')]]);queues[_0x5e025e[_0x49ba('0x40')]]['transfereduniqueid']=_0x5e025e[_0x49ba('0x40')];queues[_0x5e025e[_0x49ba('0x40')]][_0x49ba('0x3f')]=0x2;queues[_0x5e025e[_0x49ba('0x40')]][_0x49ba('0x5')]=queues[_0x5e025e['origtransfererlinkedid']][_0x49ba('0x5')];queues[_0x5e025e[_0x49ba('0x40')]][_0x49ba('0x41')]=queues[_0x5e025e[_0x49ba('0x38')]][_0x49ba('0x41')];queues[_0x5e025e['transfertargetuniqueid']]['queuecallerjoinAt']=utils[_0x49ba('0x10')]();queues[_0x5e025e[_0x49ba('0x40')]][_0x49ba('0x12')]=utils['now']();queues[_0x5e025e[_0x49ba('0x40')]][_0x49ba('0x42')]=0x0;queues[_0x5e025e[_0x49ba('0x40')]][_0x49ba('0x43')]=0x0;}else{queues[_0x5e025e['secondtransfererlinkedid']][_0x49ba('0x17')]=_0x5e025e['origtransfererlinkedid'];}}}}catch(_0x25103b){utils['error'](_0x25103b[_0x49ba('0x46')]);}};exports[_0x49ba('0x47')]=function(_0x54a3bf){if(!_[_0x49ba('0x11')](queues[_0x54a3bf[_0x49ba('0xd')]])){queues[_0x54a3bf['uniqueid']][_0x49ba('0x48')]=utils[_0x49ba('0x10')]();}};exports[_0x49ba('0x49')]=function(_0x5ec191){if(!_[_0x49ba('0x11')](queues[_0x5ec191[_0x49ba('0xd')]])){if(!_[_0x49ba('0x11')](queues[_0x5ec191[_0x49ba('0xd')]][_0x49ba('0x48')])){queues[_0x5ec191[_0x49ba('0xd')]][_0x49ba('0x43')]+=utils[_0x49ba('0x21')](utils['now'](),queues[_0x5ec191[_0x49ba('0xd')]][_0x49ba('0x48')]);delete queues[_0x5ec191[_0x49ba('0xd')]][_0x49ba('0x48')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 6bb5cd0..85df2fa 100644 --- a/server/services/xdr/recordings.controller.js +++ b/server/services/xdr/recordings.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['membername','name','UserId','CreateVoiceRecording','newchannel','uniqueid','linkedid','exten','context','channel','error','stack','newstate','isNil','channelstate','transfer','variable','mixmonitor_filename','value','.wav49','replace','.WAV','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','debug','getUserByInternal','accountcode','then'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x34e8,0x12c));var _0x834e=function(_0x343f8c,_0x525568){_0x343f8c=_0x343f8c-0x0;var _0x4791be=_0x34e8[_0x343f8c];return _0x4791be;};'use strict';var _=require(_0x834e('0x0'));var utils=require(_0x834e('0x1'));var recordings={};function writeDB(_0x8b339){utils[_0x834e('0x2')](_0x8b339);if(_0x8b339['accountcode']){utils[_0x834e('0x3')](_0x8b339[_0x834e('0x4')])[_0x834e('0x5')](function(_0x31bf20){if(_0x31bf20){_0x8b339[_0x834e('0x6')]=_0x31bf20[_0x834e('0x7')];_0x8b339[_0x834e('0x8')]=_0x31bf20['id'];}utils['request'](_0x834e('0x9'),_0x8b339);});}else{utils['request'](_0x834e('0x9'),_0x8b339);}}exports[_0x834e('0xa')]=function(_0x3a3ef6){try{if(_0x3a3ef6[_0x834e('0xb')]==_0x3a3ef6[_0x834e('0xc')]){recordings[_0x3a3ef6[_0x834e('0xb')]]={'uniqueid':_0x3a3ef6[_0x834e('0xb')],'accountcode':_0x3a3ef6[_0x834e('0x4')],'exten':_0x3a3ef6[_0x834e('0xd')],'context':_0x3a3ef6[_0x834e('0xe')],'channel':_0x3a3ef6[_0x834e('0xf')],'monitors':[]};}}catch(_0x36e124){utils[_0x834e('0x10')](_0x36e124[_0x834e('0x11')]);}};exports[_0x834e('0x12')]=function(_0x1e00de){try{if(!_[_0x834e('0x13')](recordings[_0x1e00de['uniqueid']])&&_0x1e00de[_0x834e('0x14')]==0x6){}else if(!_[_0x834e('0x13')](recordings[_0x1e00de['linkedid']])&&_0x1e00de[_0x834e('0x14')]==0x6&&_0x1e00de[_0x834e('0xe')]!=_0x834e('0x15')){recordings[_0x1e00de[_0x834e('0xc')]]['accountcode']=_0x1e00de[_0x834e('0x4')];}}catch(_0x302cbd){utils['error'](_0x302cbd[_0x834e('0x11')]);}};exports['varset']=function(_0x38a8cd){try{if(!_[_0x834e('0x13')](_0x38a8cd['variable'])&&!_[_0x834e('0x13')](_0x38a8cd[_0x834e('0x16')][_0x834e('0x17')])){if(_['endsWith'](_0x38a8cd[_0x834e('0x18')],_0x834e('0x19'))){_0x38a8cd[_0x834e('0x18')]=_0x38a8cd[_0x834e('0x18')][_0x834e('0x1a')](_0x834e('0x19'),_0x834e('0x1b'));}if(recordings[_0x38a8cd['linkedid']]){var _0x2545b4=_[_0x834e('0x1c')](recordings[_0x38a8cd[_0x834e('0xc')]][_0x834e('0x1d')],{'value':_0x38a8cd['value']});if(_[_0x834e('0x13')](_0x2545b4)){recordings[_0x38a8cd[_0x834e('0xc')]]['monitors'][_0x834e('0x1e')]({'value':_0x38a8cd[_0x834e('0x18')]});}}}}catch(_0x8d406e){utils['error'](_0x8d406e['stack']);}};exports[_0x834e('0x1f')]=function(_0x34563b){try{if(!_['isNil'](recordings[_0x34563b[_0x834e('0xb')]])){recordings[_0x34563b[_0x834e('0xb')]]['calleridnum']=_0x34563b[_0x834e('0x20')];recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x21')]=_0x34563b['calleridname'];recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x22')]=_0x34563b['connectedlinenum'];recordings[_0x34563b['uniqueid']][_0x834e('0x23')]=_0x34563b['connectedlinename'];if(recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x24')]==_0x834e('0x25')&&recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x4')]){recordings[_0x34563b[_0x834e('0xb')]]['connectedlinenum']=recordings[_0x34563b['uniqueid']]['accountcode'];recordings[_0x34563b['uniqueid']][_0x834e('0x23')]='';}recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x1d')]['forEach'](_0xb5bc06=>{var _0x11f1ce=_[_0x834e('0x26')](recordings[_0x34563b[_0x834e('0xb')]]);_0x11f1ce[_0x834e('0x18')]=_0xb5bc06[_0x834e('0x18')];writeDB(_0x11f1ce);});delete recordings[_0x34563b[_0x834e('0xb')]];}}catch(_0xfaf716){utils[_0x834e('0x10')](_0xfaf716['stack']);}};exports[_0x834e('0x27')]=function(_0x5cad11){try{if(!_[_0x834e('0x13')](recordings[_0x5cad11[_0x834e('0xb')]])){if(_0x5cad11[_0x834e('0x28')][_0x834e('0x29')]()==_0x834e('0x2a')&&_[_0x834e('0x2b')](_0x5cad11[_0x834e('0x2c')][_0x834e('0x29')](),_0x834e('0x2d'))){var _0x12b2bc=_0x5cad11['appdata'][_0x834e('0x2e')]('=');var _0x2f408a=_0x12b2bc[0x0][_0x834e('0x2f')](_0x12b2bc[0x0][_0x834e('0x30')]('(')+0x1,_0x12b2bc[0x0]['lastIndexOf'](')'));var _0x3f88ad=_0x12b2bc[0x1];recordings[_0x5cad11[_0x834e('0xb')]][_0x2f408a]=_0x3f88ad;}}}catch(_0x4b12f5){utils['error'](_0x4b12f5['stack']);}};exports[_0x834e('0x31')]=function(_0x41bf4d){try{if(!_[_0x834e('0x13')](recordings[_0x41bf4d[_0x834e('0xb')]])){recordings[_0x41bf4d[_0x834e('0xb')]][_0x834e('0x32')]=_0x41bf4d['queue'];}}catch(_0x2c2d94){utils['error'](_0x2c2d94[_0x834e('0x11')]);}}; \ No newline at end of file +var _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(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x34e8,0x12c));var _0x834e=function(_0x5eae07,_0xf9d0b6){_0x5eae07=_0x5eae07-0x0;var _0x420a8c=_0x34e8[_0x5eae07];return _0x420a8c;};'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 1c9b1eb..e1c0b80 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 _0x53a9=['transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','lodash','util','./utils','info','format','TRANSFER|%s','type','CreateVoiceTransferReport','blindtransfer','stack','attendedtransfer','assign','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum'];(function(_0x53ea74,_0x570dbc){var _0xe6c384=function(_0x120c63){while(--_0x120c63){_0x53ea74['push'](_0x53ea74['shift']());}};_0xe6c384(++_0x570dbc);}(_0x53a9,0x11c));var _0x953a=function(_0x4d37cc,_0x33813b){_0x4d37cc=_0x4d37cc-0x0;var _0x16afed=_0x53a9[_0x4d37cc];return _0x16afed;};'use strict';var _=require(_0x953a('0x0'));var util=require(_0x953a('0x1'));var utils=require(_0x953a('0x2'));function writeDB(_0x1f4708){utils[_0x953a('0x3')](util[_0x953a('0x4')](_0x953a('0x5'),_0x1f4708[_0x953a('0x6')]));utils['request'](_0x953a('0x7'),_0x1f4708);}exports[_0x953a('0x8')]=function(_0x2da487){try{_0x2da487[_0x953a('0x6')]='blind';writeDB(_0x2da487);}catch(_0x343308){utils['error'](_0x343308[_0x953a('0x9')]);}};exports[_0x953a('0xa')]=function(_0x399e54){try{_0x399e54=_[_0x953a('0xb')](_0x399e54,{'transfererchannel':_0x399e54['origtransfererchannel'],'transferercalleridnum':_0x399e54[_0x953a('0xc')],'transferercalleridname':_0x399e54[_0x953a('0xd')],'transfererconnectedlinenum':_0x399e54[_0x953a('0xe')],'transfererconnectedlinename':_0x399e54['secondtransfererconnectedlinename'],'transfereraccountcode':_0x399e54[_0x953a('0xf')],'transferercontext':_0x399e54[_0x953a('0x10')],'transfererexten':_0x399e54[_0x953a('0x11')],'transfererlinkedid':_0x399e54[_0x953a('0x12')],'context':_0x399e54[_0x953a('0x13')],'extension':_0x399e54[_0x953a('0x14')],'type':_0x953a('0x15')});if(_[_0x953a('0x16')](_0x399e54[_0x953a('0x17')])){_0x399e54=_[_0x953a('0xb')](_0x399e54,{'transfereechannel':_0x399e54[_0x953a('0x18')],'transfereecalleridnum':_0x399e54[_0x953a('0x19')],'transfereecalleridname':_0x399e54[_0x953a('0x1a')],'transfereeconnectedlinenum':_0x399e54[_0x953a('0x1b')],'transfereeconnectedlinename':_0x399e54[_0x953a('0x1c')],'transfereeaccountcode':_0x399e54[_0x953a('0x1d')],'transfereecontext':_0x399e54['transfertargetcontext'],'transfereeexten':_0x399e54[_0x953a('0x1e')],'transfereelinkedid':_0x399e54['transfertargetlinkedid']});}writeDB(_0x399e54);}catch(_0x52d4e7){utils['error'](_0x52d4e7['stack']);}}; \ No newline at end of file +var _0x840f=['transfertargetexten','lodash','util','info','TRANSFER|%s','type','request','CreateVoiceTransferReport','blindtransfer','blind','error','stack','attendedtransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','assign','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode'];(function(_0x3d70da,_0x40b755){var _0x59bdc4=function(_0x544ce3){while(--_0x544ce3){_0x3d70da['push'](_0x3d70da['shift']());}};_0x59bdc4(++_0x40b755);}(_0x840f,0x140));var _0xf840=function(_0xe92a70,_0x257f1d){_0xe92a70=_0xe92a70-0x0;var _0x1c5bc7=_0x840f[_0xe92a70];return _0x1c5bc7;};'use strict';var _=require(_0xf840('0x0'));var util=require(_0xf840('0x1'));var utils=require('./utils');function writeDB(_0x551e13){utils[_0xf840('0x2')](util['format'](_0xf840('0x3'),_0x551e13[_0xf840('0x4')]));utils[_0xf840('0x5')](_0xf840('0x6'),_0x551e13);}exports[_0xf840('0x7')]=function(_0x1b7f74){try{_0x1b7f74[_0xf840('0x4')]=_0xf840('0x8');writeDB(_0x1b7f74);}catch(_0x4da841){utils[_0xf840('0x9')](_0x4da841[_0xf840('0xa')]);}};exports[_0xf840('0xb')]=function(_0x59c51f){try{_0x59c51f=_['assign'](_0x59c51f,{'transfererchannel':_0x59c51f['origtransfererchannel'],'transferercalleridnum':_0x59c51f[_0xf840('0xc')],'transferercalleridname':_0x59c51f[_0xf840('0xd')],'transfererconnectedlinenum':_0x59c51f['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x59c51f[_0xf840('0xe')],'transfereraccountcode':_0x59c51f[_0xf840('0xf')],'transferercontext':_0x59c51f[_0xf840('0x10')],'transfererexten':_0x59c51f['secondtransfererexten'],'transfererlinkedid':_0x59c51f[_0xf840('0x11')],'context':_0x59c51f[_0xf840('0x12')],'extension':_0x59c51f[_0xf840('0x13')],'type':_0xf840('0x14')});if(_[_0xf840('0x15')](_0x59c51f[_0xf840('0x16')])){_0x59c51f=_[_0xf840('0x17')](_0x59c51f,{'transfereechannel':_0x59c51f['transfertargetchannel'],'transfereecalleridnum':_0x59c51f[_0xf840('0x18')],'transfereecalleridname':_0x59c51f[_0xf840('0x19')],'transfereeconnectedlinenum':_0x59c51f['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x59c51f[_0xf840('0x1a')],'transfereeaccountcode':_0x59c51f[_0xf840('0x1b')],'transfereecontext':_0x59c51f['transfertargetcontext'],'transfereeexten':_0x59c51f[_0xf840('0x1c')],'transfereelinkedid':_0x59c51f['transfertargetlinkedid']});}writeDB(_0x59c51f);}catch(_0x507538){utils[_0xf840('0x9')](_0x507538[_0xf840('0xa')]);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 75512d4..538a1ea 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 _0xb743=['GETVOICEQUEUEBYNAME|','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','now','isBefore','jayson/promise','bluebird','client','http','../../config/logger','xdr','info','debug','stringify','request','then','catch','internal','name','interface','GETUSER|','length','FOUND','NOTFOUND','result','getUserByInternal','error','getUserByInterface','stack','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb743,0xab));var _0x3b74=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb743[_0x122ef9];return _0x42fba0;};'use strict';var jayson=require(_0x3b74('0x0'));var moment=require('moment');var BPromise=require(_0x3b74('0x1'));var client=jayson[_0x3b74('0x2')][_0x3b74('0x3')]({'port':0x2329});var logger=require(_0x3b74('0x4'))(_0x3b74('0x5'));exports[_0x3b74('0x6')]=function(_0x1c40b3){logger[_0x3b74('0x6')](_0x1c40b3);};exports[_0x3b74('0x7')]=function(_0x567d90){logger[_0x3b74('0x7')](JSON[_0x3b74('0x8')](_0x567d90));};exports['error']=function(_0x3b60d0){logger['error'](_0x3b60d0['stack']);};exports[_0x3b74('0x9')]=function(_0x108790,_0x4bcacb){return client[_0x3b74('0x9')](_0x108790,{'body':_0x4bcacb})[_0x3b74('0xa')](function(_0x49ca91){logger[_0x3b74('0x7')](JSON['stringify'](_0x49ca91));})[_0x3b74('0xb')](function(_0xe86e7e){logger['error'](_0xe86e7e['stack']);});};function getUser(_0x55065c){return client[_0x3b74('0x9')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x3b74('0xc'),_0x3b74('0xd'),_0x3b74('0xe')],'where':_0x55065c,'limit':0x1}})[_0x3b74('0xa')](function(_0x1df366){logger[_0x3b74('0x6')](_0x3b74('0xf')+JSON[_0x3b74('0x8')](_0x55065c)+'|'+(_0x1df366['result'][_0x3b74('0x10')]?_0x3b74('0x11'):_0x3b74('0x12')));return _0x1df366[_0x3b74('0x13')]['length']?_0x1df366[_0x3b74('0x13')][0x0]:null;});}exports[_0x3b74('0x14')]=function(_0xcdfa61){return new BPromise(function(_0x358fa5,_0x309e4c){if(_0xcdfa61){return getUser({'internal':_0xcdfa61})[_0x3b74('0xa')](function(_0x2068d8){return _0x358fa5(_0x2068d8);})[_0x3b74('0xb')](function(_0x2609be){logger[_0x3b74('0x15')](_0x2609be['stack']);return _0x358fa5(null);});}else{return _0x358fa5(null);}});};exports[_0x3b74('0x16')]=function(_0x42ca5e){return new BPromise(function(_0x2837c3,_0x14165e){if(_0x42ca5e){return getUser({'interface':_0x42ca5e})['then'](function(_0x3009e4){return _0x2837c3(_0x3009e4);})[_0x3b74('0xb')](function(_0x4cd554){logger['error'](_0x4cd554['stack']);return _0x2837c3(null);});}else{return _0x2837c3(null);}});};exports['getUserByName']=function(_0x1741de){return new BPromise(function(_0x362aee,_0x4490fd){if(_0x1741de){return getUser({'name':_0x1741de})[_0x3b74('0xa')](function(_0x38290b){return _0x362aee(_0x38290b);})[_0x3b74('0xb')](function(_0x39aa49){logger[_0x3b74('0x15')](_0x39aa49[_0x3b74('0x17')]);return _0x362aee(null);});}else{return _0x362aee(null);}});};exports[_0x3b74('0x18')]=function(_0x3db9f5){return new BPromise(function(_0x293512,_0x55debd){if(_0x3db9f5){return client[_0x3b74('0x9')](_0x3b74('0x19'),{'options':{'raw':!![],'attributes':['id',_0x3b74('0xd'),_0x3b74('0x1a'),_0x3b74('0x1b'),_0x3b74('0x1c')],'where':{'name':_0x3db9f5},'limit':0x1}})[_0x3b74('0xa')](function(_0x3482b1){logger[_0x3b74('0x6')](_0x3b74('0x1d')+_0x3db9f5+'|'+(_0x3482b1[_0x3b74('0x13')]['length']?_0x3b74('0x11'):_0x3b74('0x12')));return _0x293512(_0x3482b1['result']['length']?_0x3482b1[_0x3b74('0x13')][0x0]:null);})['catch'](function(_0x4e9c05){logger[_0x3b74('0x15')](_0x4e9c05[_0x3b74('0x17')]);return _0x293512(null);});}else{return _0x293512(null);}});};exports[_0x3b74('0x1e')]=function(_0x1cd75e,_0xe0df82){return moment(_0x1cd75e)['add'](_0xe0df82,_0x3b74('0x1f'))[_0x3b74('0x20')](_0x3b74('0x21'));};exports[_0x3b74('0x22')]=function(_0x19ec59,_0x5188c4){return moment(_0x19ec59)[_0x3b74('0x23')](_0x5188c4,_0x3b74('0x1f'))[_0x3b74('0x20')](_0x3b74('0x21'));};exports[_0x3b74('0x24')]=function(_0x110998,_0x40ac00){return moment(_0x110998)[_0x3b74('0x25')](moment(_0x40ac00),_0x3b74('0x1f'));};exports['sumTime']=function(_0x1f60a0,_0x154da1){return parseInt(_0x1f60a0,0xa)+parseInt(_0x154da1,0xa);};exports[_0x3b74('0x26')]=function(){return moment()[_0x3b74('0x20')](_0x3b74('0x21'));};exports['isAfter']=function(_0x3a3170,_0x9df00a){if(_0x9df00a){return moment(_0x3a3170)['isAfter'](_0x9df00a);}else{return!![];}};exports['isBefore']=function(_0x94ea3e,_0x2eddc0){if(_0x2eddc0){return moment(_0x94ea3e)[_0x3b74('0x27')](_0x2eddc0);}else if(_0x94ea3e){return!![];}else{return![];}}; \ No newline at end of file +var _0x6ef5=['diffTime','diff','sumTime','isAfter','isBefore','jayson/promise','moment','bluebird','client','http','../../config/logger','info','debug','error','stack','request','then','stringify','catch','GetUser','name','interface','GETUSER|','result','length','FOUND','NOTFOUND','getUserByInternal','getUserByInterface','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acw','GETVOICEQUEUEBYNAME|','addTime','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','format'];(function(_0x4d66e0,_0x1d1450){var _0x2d821e=function(_0x18354e){while(--_0x18354e){_0x4d66e0['push'](_0x4d66e0['shift']());}};_0x2d821e(++_0x1d1450);}(_0x6ef5,0x176));var _0x56ef=function(_0xd571c0,_0x1aa4d3){_0xd571c0=_0xd571c0-0x0;var _0x4de2b2=_0x6ef5[_0xd571c0];return _0x4de2b2;};'use strict';var jayson=require(_0x56ef('0x0'));var moment=require(_0x56ef('0x1'));var BPromise=require(_0x56ef('0x2'));var client=jayson[_0x56ef('0x3')][_0x56ef('0x4')]({'port':0x2329});var logger=require(_0x56ef('0x5'))('xdr');exports[_0x56ef('0x6')]=function(_0x4e1641){logger[_0x56ef('0x6')](_0x4e1641);};exports[_0x56ef('0x7')]=function(_0x9c9784){logger[_0x56ef('0x7')](JSON['stringify'](_0x9c9784));};exports[_0x56ef('0x8')]=function(_0x6b7a61){logger[_0x56ef('0x8')](_0x6b7a61[_0x56ef('0x9')]);};exports[_0x56ef('0xa')]=function(_0x432b58,_0x31077e){return client[_0x56ef('0xa')](_0x432b58,{'body':_0x31077e})[_0x56ef('0xb')](function(_0x54359f){logger[_0x56ef('0x7')](JSON[_0x56ef('0xc')](_0x54359f));})[_0x56ef('0xd')](function(_0x26c6b2){logger[_0x56ef('0x8')](_0x26c6b2[_0x56ef('0x9')]);});};function getUser(_0x426dea){return client['request'](_0x56ef('0xe'),{'options':{'raw':!![],'attributes':['id','internal',_0x56ef('0xf'),_0x56ef('0x10')],'where':_0x426dea,'limit':0x1}})[_0x56ef('0xb')](function(_0xa2bb18){logger[_0x56ef('0x6')](_0x56ef('0x11')+JSON[_0x56ef('0xc')](_0x426dea)+'|'+(_0xa2bb18[_0x56ef('0x12')][_0x56ef('0x13')]?_0x56ef('0x14'):_0x56ef('0x15')));return _0xa2bb18[_0x56ef('0x12')][_0x56ef('0x13')]?_0xa2bb18[_0x56ef('0x12')][0x0]:null;});}exports[_0x56ef('0x16')]=function(_0xfd2a95){return new BPromise(function(_0x2ed45c,_0x21580b){if(_0xfd2a95){return getUser({'internal':_0xfd2a95})[_0x56ef('0xb')](function(_0x599d64){return _0x2ed45c(_0x599d64);})[_0x56ef('0xd')](function(_0x1a6d42){logger['error'](_0x1a6d42[_0x56ef('0x9')]);return _0x2ed45c(null);});}else{return _0x2ed45c(null);}});};exports[_0x56ef('0x17')]=function(_0x26d033){return new BPromise(function(_0x33ab6e,_0x854742){if(_0x26d033){return getUser({'interface':_0x26d033})[_0x56ef('0xb')](function(_0x1cef25){return _0x33ab6e(_0x1cef25);})['catch'](function(_0x1b937b){logger[_0x56ef('0x8')](_0x1b937b[_0x56ef('0x9')]);return _0x33ab6e(null);});}else{return _0x33ab6e(null);}});};exports[_0x56ef('0x18')]=function(_0x35066f){return new BPromise(function(_0x4282cb,_0xd5fc5c){if(_0x35066f){return getUser({'name':_0x35066f})[_0x56ef('0xb')](function(_0x1a3d49){return _0x4282cb(_0x1a3d49);})['catch'](function(_0x37416b){logger[_0x56ef('0x8')](_0x37416b['stack']);return _0x4282cb(null);});}else{return _0x4282cb(null);}});};exports[_0x56ef('0x19')]=function(_0x30d8bc){return new BPromise(function(_0x54bb17,_0x1126ef){if(_0x30d8bc){return client[_0x56ef('0xa')](_0x56ef('0x1a'),{'options':{'raw':!![],'attributes':['id',_0x56ef('0xf'),_0x56ef('0x1b'),_0x56ef('0x1c'),'acwTimeout'],'where':{'name':_0x30d8bc},'limit':0x1}})[_0x56ef('0xb')](function(_0x36e1d0){logger[_0x56ef('0x6')](_0x56ef('0x1d')+_0x30d8bc+'|'+(_0x36e1d0[_0x56ef('0x12')][_0x56ef('0x13')]?_0x56ef('0x14'):_0x56ef('0x15')));return _0x54bb17(_0x36e1d0['result'][_0x56ef('0x13')]?_0x36e1d0[_0x56ef('0x12')][0x0]:null);})['catch'](function(_0x7f51f4){logger[_0x56ef('0x8')](_0x7f51f4[_0x56ef('0x9')]);return _0x54bb17(null);});}else{return _0x54bb17(null);}});};exports[_0x56ef('0x1e')]=function(_0x54af89,_0x101d23){return moment(_0x54af89)['add'](_0x101d23,_0x56ef('0x1f'))['format'](_0x56ef('0x20'));};exports[_0x56ef('0x21')]=function(_0x53f00b,_0x4db599){return moment(_0x53f00b)[_0x56ef('0x22')](_0x4db599,_0x56ef('0x1f'))[_0x56ef('0x23')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x56ef('0x24')]=function(_0xfe43d0,_0x5285a1){return moment(_0xfe43d0)[_0x56ef('0x25')](moment(_0x5285a1),_0x56ef('0x1f'));};exports[_0x56ef('0x26')]=function(_0x1bbcf6,_0x34f06c){return parseInt(_0x1bbcf6,0xa)+parseInt(_0x34f06c,0xa);};exports['now']=function(){return moment()[_0x56ef('0x23')](_0x56ef('0x20'));};exports[_0x56ef('0x27')]=function(_0x396750,_0x96f9d2){if(_0x96f9d2){return moment(_0x396750)[_0x56ef('0x27')](_0x96f9d2);}else{return!![];}};exports[_0x56ef('0x28')]=function(_0x4cea69,_0x58adfc){if(_0x58adfc){return moment(_0x4cea69)[_0x56ef('0x28')](_0x58adfc);}else if(_0x4cea69){return!![];}else{return![];}}; \ No newline at end of file